From: support Date: Thu, 8 Sep 2022 10:14:37 +0000 (+0000) Subject: Built motion from commit be5d5b00.|2.6.15 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20110license.mail?a=commitdiff_plain;h=d68b1694e771368a75bbbe4585fe85eb1a990126;p=motion2.git Built motion from commit be5d5b00.|2.6.15 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 0fa6722..8f97c3d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-08T07:46:17.569Z", + "time": "2022-09-08T10:06:45.064Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 6535bde..7ab325f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-08T07:46:17.569Z", + "time": "2022-09-08T10:06:45.064Z", "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 0b6d855..ad1db03 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 _0x247c=['jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','getDataValue','action','STRING','contactManager','integration','motionbar'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x247c,0x162));var _0xc247=function(_0xbe31a4,_0x11ba89){_0xbe31a4=_0xbe31a4-0x0;var _0x15ec28=_0x247c[_0xbe31a4];return _0x15ec28;};'use strict';var Sequelize=require('sequelize');module[_0xc247('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2c8929){return this[_0xc247('0x1')](_0xc247('0x2'));}},'action':{'type':Sequelize[_0xc247('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc247('0x4'),_0xc247('0x5'),_0xc247('0x6'),_0xc247('0x7'),_0xc247('0x8'),_0xc247('0x9'),_0xc247('0xa'),_0xc247('0xb')]],'msg':_0xc247('0xc')}},'comment':_0xc247('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc247('0xd')},'data2':{'type':Sequelize[_0xc247('0x3')](0x1000),'comment':_0xc247('0xe')},'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[_0xc247('0x3')](0x1000),'comments':_0xc247('0xf')},'data5':{'type':Sequelize[_0xc247('0x3')](0x1000),'comments':_0xc247('0x10')},'data6':{'type':Sequelize[_0xc247('0x3')],'comments':_0xc247('0x11')},'data7':{'type':Sequelize[_0xc247('0x12')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x7b17=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT'];(function(_0x47f615,_0x4d80d9){var _0x33e97e=function(_0x3d6c1){while(--_0x3d6c1){_0x47f615['push'](_0x47f615['shift']());}};_0x33e97e(++_0x4d80d9);}(_0x7b17,0x157));var _0x77b1=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x7b17[_0xa990b7];return _0x52c99c;};'use strict';var Sequelize=require(_0x77b1('0x0'));module[_0x77b1('0x1')]={'name':{'type':Sequelize[_0x77b1('0x2')],'get':function(_0x2060f6){return this[_0x77b1('0x3')]('action');}},'action':{'type':Sequelize[_0x77b1('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x77b1('0x5'),_0x77b1('0x6'),_0x77b1('0x7'),_0x77b1('0x8'),_0x77b1('0x9'),_0x77b1('0xa'),_0x77b1('0xb'),_0x77b1('0xc')]],'msg':_0x77b1('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x77b1('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x77b1('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x77b1('0xf')},'data4':{'type':Sequelize[_0x77b1('0x4')](0x1000),'comments':_0x77b1('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x77b1('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x77b1('0x11')],'comments':_0x77b1('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1bb981c..7f3e647 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 _0x7317=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','body','Action','params','catch','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x4b4b92,_0x9be674){var _0x4a63e3=function(_0x384e7b){while(--_0x384e7b){_0x4b4b92['push'](_0x4b4b92['shift']());}};_0x4a63e3(++_0x9be674);}(_0x7317,0x81));var _0x7731=function(_0x32b4cc,_0x7821a7){_0x32b4cc=_0x32b4cc-0x0;var _0x2a3577=_0x7317[_0x32b4cc];return _0x2a3577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7731('0x0'));var zipdir=require(_0x7731('0x1'));var jsonpatch=require(_0x7731('0x2'));var rp=require(_0x7731('0x3'));var moment=require(_0x7731('0x4'));var BPromise=require(_0x7731('0x5'));var Mustache=require(_0x7731('0x6'));var util=require(_0x7731('0x7'));var path=require(_0x7731('0x8'));var sox=require(_0x7731('0x9'));var csv=require('to-csv');var ejs=require(_0x7731('0xa'));var fs=require('fs');var fs_extra=require(_0x7731('0xb'));var _=require(_0x7731('0xc'));var squel=require('squel');var crypto=require(_0x7731('0xd'));var jsforce=require(_0x7731('0xe'));var deskjs=require(_0x7731('0xf'));var toCsv=require(_0x7731('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7731('0x11'));var authService=require(_0x7731('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7731('0x13'));var utils=require(_0x7731('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa2bd4b,_0x5c2942){_0x5c2942=_0x5c2942||0xcc;return function(_0x59534d){if(_0x59534d){return _0xa2bd4b[_0x7731('0x15')](_0x5c2942);}return _0xa2bd4b[_0x7731('0x16')](_0x5c2942)[_0x7731('0x17')]();};}function respondWithResult(_0x230635,_0x3ec047){_0x3ec047=_0x3ec047||0xc8;return function(_0xca9119){if(_0xca9119){return _0x230635[_0x7731('0x16')](_0x3ec047)[_0x7731('0x18')](_0xca9119);}};}function respondWithFilteredResult(_0x10babd,_0x479c7e){return function(_0x23800e){if(_0x23800e){var _0x10697f=typeof _0x479c7e[_0x7731('0x19')]===_0x7731('0x1a')&&typeof _0x479c7e[_0x7731('0x1b')]===_0x7731('0x1a');var _0x11bddb=_0x23800e[_0x7731('0x1c')];var _0x3c7107=_0x10697f?0x0:_0x479c7e['offset'];var _0x594909=_0x10697f?_0x23800e['count']:_0x479c7e['offset']+_0x479c7e[_0x7731('0x1b')];var _0x3ee622;if(_0x594909>=_0x11bddb){_0x594909=_0x11bddb;_0x3ee622=0xc8;}else{_0x3ee622=0xce;}_0x10babd[_0x7731('0x16')](_0x3ee622);return _0x10babd[_0x7731('0x1d')](_0x7731('0x1e'),_0x3c7107+'-'+_0x594909+'/'+_0x11bddb)['json'](_0x23800e);}return null;};}function patchUpdates(_0x3cc60b){return function(_0x33e1eb){try{jsonpatch[_0x7731('0x1f')](_0x33e1eb,_0x3cc60b,!![]);}catch(_0x4470cc){return BPromise[_0x7731('0x20')](_0x4470cc);}return _0x33e1eb[_0x7731('0x21')]();};}function saveUpdates(_0x21fb08,_0x4d8bd6){return function(_0x1b5bce){if(_0x1b5bce){return _0x1b5bce[_0x7731('0x22')](_0x21fb08)['then'](function(_0x71366a){return _0x71366a;});}return null;};}function removeEntity(_0x206f39,_0x5bdaba){return function(_0x49343d){if(_0x49343d){return _0x49343d[_0x7731('0x23')]()[_0x7731('0x24')](function(){_0x206f39[_0x7731('0x16')](0xcc)[_0x7731('0x17')]();});}};}function handleEntityNotFound(_0x164ce7,_0x4ec222){return function(_0x287956){if(!_0x287956){_0x164ce7[_0x7731('0x15')](0x194);}return _0x287956;};}function handleError(_0x4051f4,_0x3abf1e){_0x3abf1e=_0x3abf1e||0x1f4;return function(_0x389651){logger[_0x7731('0x25')](_0x389651[_0x7731('0x26')]);if(_0x389651[_0x7731('0x27')]){delete _0x389651[_0x7731('0x27')];}_0x4051f4['status'](_0x3abf1e)[_0x7731('0x28')](_0x389651);};}exports[_0x7731('0x22')]=function(_0xc95e81,_0x2e200b){if(_0xc95e81[_0x7731('0x29')]['id']){delete _0xc95e81['body']['id'];}return db[_0x7731('0x2a')]['find']({'where':{'id':_0xc95e81[_0x7731('0x2b')]['id']}})[_0x7731('0x24')](handleEntityNotFound(_0x2e200b,null))[_0x7731('0x24')](saveUpdates(_0xc95e81[_0x7731('0x29')],null))[_0x7731('0x24')](respondWithResult(_0x2e200b,null))[_0x7731('0x2c')](handleError(_0x2e200b,null));};exports[_0x7731('0x23')]=function(_0x5370bc,_0x44267f){return db[_0x7731('0x2a')][_0x7731('0x2d')]({'where':{'id':_0x5370bc[_0x7731('0x2b')]['id']}})[_0x7731('0x24')](handleEntityNotFound(_0x44267f,null))['then'](removeEntity(_0x44267f,null))[_0x7731('0x2c')](handleError(_0x44267f,null));}; \ No newline at end of file +var _0x9f4d=['destroy','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','error','stack','name','send','update','body','Action','params','catch'];(function(_0x56eb2e,_0x4889dd){var _0x4a52ce=function(_0x1023f9){while(--_0x1023f9){_0x56eb2e['push'](_0x56eb2e['shift']());}};_0x4a52ce(++_0x4889dd);}(_0x9f4d,0x8f));var _0xd9f4=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x9f4d[_0x16de68];return _0x1c277e;};'use strict';var emlformat=require(_0xd9f4('0x0'));var rimraf=require(_0xd9f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9f4('0x2'));var rp=require('request-promise');var moment=require(_0xd9f4('0x3'));var BPromise=require(_0xd9f4('0x4'));var Mustache=require(_0xd9f4('0x5'));var util=require(_0xd9f4('0x6'));var path=require(_0xd9f4('0x7'));var sox=require(_0xd9f4('0x8'));var csv=require(_0xd9f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9f4('0xa'));var _=require(_0xd9f4('0xb'));var squel=require('squel');var crypto=require(_0xd9f4('0xc'));var jsforce=require(_0xd9f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd9f4('0xe'));var Papa=require(_0xd9f4('0xf'));var Redis=require(_0xd9f4('0x10'));var authService=require(_0xd9f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd9f4('0x12'));var hardwareService=require(_0xd9f4('0x13'));var logger=require(_0xd9f4('0x14'))(_0xd9f4('0x15'));var utils=require(_0xd9f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd9f4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x874eda,_0x56ac21){_0x56ac21=_0x56ac21||0xcc;return function(_0x4f76d2){if(_0x4f76d2){return _0x874eda['sendStatus'](_0x56ac21);}return _0x874eda[_0xd9f4('0x18')](_0x56ac21)[_0xd9f4('0x19')]();};}function respondWithResult(_0x276cc9,_0x2db951){_0x2db951=_0x2db951||0xc8;return function(_0x46e6fd){if(_0x46e6fd){return _0x276cc9['status'](_0x2db951)[_0xd9f4('0x1a')](_0x46e6fd);}};}function respondWithFilteredResult(_0x1e1d20,_0x3b955b){return function(_0xfaa282){if(_0xfaa282){var _0x269f7d=typeof _0x3b955b['offset']===_0xd9f4('0x1b')&&typeof _0x3b955b[_0xd9f4('0x1c')]===_0xd9f4('0x1b');var _0x4815f5=_0xfaa282[_0xd9f4('0x1d')];var _0x2bbfe3=_0x269f7d?0x0:_0x3b955b[_0xd9f4('0x1e')];var _0x5eb015=_0x269f7d?_0xfaa282['count']:_0x3b955b[_0xd9f4('0x1e')]+_0x3b955b[_0xd9f4('0x1c')];var _0x5661b2;if(_0x5eb015>=_0x4815f5){_0x5eb015=_0x4815f5;_0x5661b2=0xc8;}else{_0x5661b2=0xce;}_0x1e1d20[_0xd9f4('0x18')](_0x5661b2);return _0x1e1d20[_0xd9f4('0x1f')]('Content-Range',_0x2bbfe3+'-'+_0x5eb015+'/'+_0x4815f5)[_0xd9f4('0x1a')](_0xfaa282);}return null;};}function patchUpdates(_0x2cf3b0){return function(_0x3756b5){try{jsonpatch[_0xd9f4('0x20')](_0x3756b5,_0x2cf3b0,!![]);}catch(_0x4fdaad){return BPromise[_0xd9f4('0x21')](_0x4fdaad);}return _0x3756b5[_0xd9f4('0x22')]();};}function saveUpdates(_0x246c0e,_0x5e3411){return function(_0xf2f308){if(_0xf2f308){return _0xf2f308['update'](_0x246c0e)['then'](function(_0x905eaa){return _0x905eaa;});}return null;};}function removeEntity(_0x51c424,_0x498b20){return function(_0x56a0da){if(_0x56a0da){return _0x56a0da['destroy']()[_0xd9f4('0x23')](function(){_0x51c424['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x358372,_0x525f35){return function(_0x541997){if(!_0x541997){_0x358372['sendStatus'](0x194);}return _0x541997;};}function handleError(_0x2fc749,_0x4a448c){_0x4a448c=_0x4a448c||0x1f4;return function(_0x2b81c5){logger[_0xd9f4('0x24')](_0x2b81c5[_0xd9f4('0x25')]);if(_0x2b81c5[_0xd9f4('0x26')]){delete _0x2b81c5[_0xd9f4('0x26')];}_0x2fc749[_0xd9f4('0x18')](_0x4a448c)[_0xd9f4('0x27')](_0x2b81c5);};}exports[_0xd9f4('0x28')]=function(_0x2ee209,_0x105bfe){if(_0x2ee209[_0xd9f4('0x29')]['id']){delete _0x2ee209[_0xd9f4('0x29')]['id'];}return db[_0xd9f4('0x2a')]['find']({'where':{'id':_0x2ee209[_0xd9f4('0x2b')]['id']}})[_0xd9f4('0x23')](handleEntityNotFound(_0x105bfe,null))[_0xd9f4('0x23')](saveUpdates(_0x2ee209[_0xd9f4('0x29')],null))[_0xd9f4('0x23')](respondWithResult(_0x105bfe,null))[_0xd9f4('0x2c')](handleError(_0x105bfe,null));};exports[_0xd9f4('0x2d')]=function(_0x557892,_0x41d568){return db[_0xd9f4('0x2a')][_0xd9f4('0x2e')]({'where':{'id':_0x557892[_0xd9f4('0x2b')]['id']}})[_0xd9f4('0x23')](handleEntityNotFound(_0x41d568,null))['then'](removeEntity(_0x41d568,null))[_0xd9f4('0x2c')](handleError(_0x41d568,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index bbbb1ff..3e490c9 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 _0x49aa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x49aa,0x173));var _0xa49a=function(_0x1ab2d8,_0x8471f9){_0x1ab2d8=_0x1ab2d8-0x0;var _0x3b1e9d=_0x49aa[_0x1ab2d8];return _0x3b1e9d;};'use strict';var _=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var logger=require(_0xa49a('0x2'))('api');var moment=require(_0xa49a('0x3'));var BPromise=require(_0xa49a('0x4'));var rp=require(_0xa49a('0x5'));var fs=require('fs');var path=require(_0xa49a('0x6'));var rimraf=require(_0xa49a('0x7'));var config=require(_0xa49a('0x8'));var attributes=require('./action.attributes');module[_0xa49a('0x9')]=function(_0x3889ad,_0x3a2283){return _0x3889ad[_0xa49a('0xa')](_0xa49a('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26dc=['path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x26dc,0x1b9));var _0xc26d=function(_0x506f65,_0x1b5e34){_0x506f65=_0x506f65-0x0;var _0xf57e51=_0x26dc[_0x506f65];return _0xf57e51;};'use strict';var _=require(_0xc26d('0x0'));var util=require(_0xc26d('0x1'));var logger=require(_0xc26d('0x2'))(_0xc26d('0x3'));var moment=require(_0xc26d('0x4'));var BPromise=require(_0xc26d('0x5'));var rp=require(_0xc26d('0x6'));var fs=require('fs');var path=require(_0xc26d('0x7'));var rimraf=require(_0xc26d('0x8'));var config=require(_0xc26d('0x9'));var attributes=require(_0xc26d('0xa'));module[_0xc26d('0xb')]=function(_0x430182,_0x500d97){return _0x430182[_0xc26d('0xc')]('Action',attributes,{'tableName':_0xc26d('0xd'),'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 8cb8beb..1d0af03 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x46eb65,_0xfe1c1c){var _0x2339e8=function(_0x3c2d9b){while(--_0x3c2d9b){_0x46eb65['push'](_0x46eb65['shift']());}};_0x2339e8(++_0xfe1c1c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x33ab57,_0x449de8){_0x33ab57=_0x33ab57-0x0;var _0x3af8ce=_0x7fbe[_0x33ab57];return _0x3af8ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3793c0,_0x3b8839){var _0x5273ae=function(_0x272e6d){while(--_0x272e6d){_0x3793c0['push'](_0x3793c0['shift']());}};_0x5273ae(++_0x3b8839);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 8f6ad36..03176ca 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 _0x35af=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x9fd829,_0x1eaf0b){var _0x4146fd=function(_0x20e796){while(--_0x20e796){_0x9fd829['push'](_0x9fd829['shift']());}};_0x4146fd(++_0x1eaf0b);}(_0x35af,0x1b9));var _0xf35a=function(_0x1d50fb,_0x211d7e){_0x1d50fb=_0x1d50fb-0x0;var _0x547c95=_0x35af[_0x1d50fb];return _0x547c95;};'use strict';var multer=require(_0xf35a('0x0'));var util=require(_0xf35a('0x1'));var path=require(_0xf35a('0x2'));var timeout=require(_0xf35a('0x3'));var express=require(_0xf35a('0x4'));var router=express[_0xf35a('0x5')]();var fs_extra=require(_0xf35a('0x6'));var auth=require(_0xf35a('0x7'));var interaction=require(_0xf35a('0x8'));var config=require(_0xf35a('0x9'));var controller=require(_0xf35a('0xa'));router[_0xf35a('0xb')](_0xf35a('0xc'),auth['isAuthenticated'](),controller[_0xf35a('0xd')]);router[_0xf35a('0xe')](_0xf35a('0xc'),auth[_0xf35a('0xf')](),controller[_0xf35a('0x10')]);module[_0xf35a('0x11')]=router; \ No newline at end of file +var _0xab92=['destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab92,0xfe));var _0x2ab9=function(_0x1a14a2,_0x4bd091){_0x1a14a2=_0x1a14a2-0x0;var _0x540c65=_0xab92[_0x1a14a2];return _0x540c65;};'use strict';var multer=require('multer');var util=require(_0x2ab9('0x0'));var path=require(_0x2ab9('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ab9('0x2'));var router=express[_0x2ab9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ab9('0x4'));var config=require(_0x2ab9('0x5'));var controller=require(_0x2ab9('0x6'));router[_0x2ab9('0x7')]('/:id',auth[_0x2ab9('0x8')](),controller[_0x2ab9('0x9')]);router[_0x2ab9('0xa')](_0x2ab9('0xb'),auth['isAuthenticated'](),controller[_0x2ab9('0xc')]);module[_0x2ab9('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index db4472e..0b0eb8a 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x56e2b0,_0x195eb8){var _0xb38e84=function(_0x46ef76){while(--_0x46ef76){_0x56e2b0['push'](_0x56e2b0['shift']());}};_0xb38e84(++_0x195eb8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x185180,_0x145d70){_0x185180=_0x185180-0x0;var _0x2d9d42=_0x3f8a[_0x185180];return _0x2d9d42;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x3cd6da,_0x55b35a){var _0x5e09c1=function(_0x1496da){while(--_0x1496da){_0x3cd6da['push'](_0x3cd6da['shift']());}};_0x5e09c1(++_0x55b35a);}(_0xe14b,0x93));var _0xbe14=function(_0x4404fe,_0x1b662a){_0x4404fe=_0x4404fe-0x0;var _0x16e391=_0xe14b[_0x4404fe];return _0x16e391;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 8081ae3..a4db8e8 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 _0xbf70=['filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','get','user','userProfileId','join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','select','MetricId','metric','function','replace','format','groupBy','DESC','joins','parse','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','debug','sequelize','toString','QueryTypes','left_join','right_join','COUNT(%s)','ROUND(%s)','operator','AnalyticMetric','keyBy','from','orderBy','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','SELECT','run','Please\x20insert\x20at\x20least\x20one\x20field','clone','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','CustomReports','UserProfileResource','then','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x16a428,_0xf7c68f){var _0x4702d1=function(_0x12b930){while(--_0x12b930){_0x16a428['push'](_0x16a428['shift']());}};_0x4702d1(++_0xf7c68f);}(_0xbf70,0x1b0));var _0x0bf7=function(_0x3bc4b9,_0x1e9592){_0x3bc4b9=_0x3bc4b9-0x0;var _0x54320c=_0xbf70[_0x3bc4b9];return _0x54320c;};'use strict';var emlformat=require(_0x0bf7('0x0'));var rimraf=require(_0x0bf7('0x1'));var zipdir=require(_0x0bf7('0x2'));var jsonpatch=require(_0x0bf7('0x3'));var rp=require(_0x0bf7('0x4'));var moment=require(_0x0bf7('0x5'));var BPromise=require(_0x0bf7('0x6'));var Mustache=require(_0x0bf7('0x7'));var util=require(_0x0bf7('0x8'));var path=require('path');var sox=require(_0x0bf7('0x9'));var csv=require(_0x0bf7('0xa'));var ejs=require(_0x0bf7('0xb'));var fs=require('fs');var fs_extra=require(_0x0bf7('0xc'));var _=require('lodash');var squel=require(_0x0bf7('0xd'));var crypto=require(_0x0bf7('0xe'));var jsforce=require(_0x0bf7('0xf'));var deskjs=require(_0x0bf7('0x10'));var toCsv=require(_0x0bf7('0xa'));var querystring=require(_0x0bf7('0x11'));var Papa=require(_0x0bf7('0x12'));var Redis=require(_0x0bf7('0x13'));var authService=require(_0x0bf7('0x14'));var qs=require(_0x0bf7('0x15'));var as=require(_0x0bf7('0x16'));var hardwareService=require(_0x0bf7('0x17'));var logger=require('../../config/logger')(_0x0bf7('0x18'));var utils=require(_0x0bf7('0x19'));var config=require(_0x0bf7('0x1a'));var licenseUtil=require(_0x0bf7('0x1b'));var db=require(_0x0bf7('0x1c'))['db'];var dbH=require(_0x0bf7('0x1c'))[_0x0bf7('0x1d')];function respondWithStatusCode(_0x1ef562,_0x528cdc){_0x528cdc=_0x528cdc||0xcc;return function(_0x598e48){if(_0x598e48){return _0x1ef562[_0x0bf7('0x1e')](_0x528cdc);}return _0x1ef562['status'](_0x528cdc)[_0x0bf7('0x1f')]();};}function respondWithResult(_0x17655b,_0x12b41d){_0x12b41d=_0x12b41d||0xc8;return function(_0x410ffb){if(_0x410ffb){return _0x17655b[_0x0bf7('0x20')](_0x12b41d)['json'](_0x410ffb);}};}function respondWithFilteredResult(_0x319d68,_0x4764e9){return function(_0xb0e54c){if(_0xb0e54c){var _0x8f3b52=typeof _0x4764e9['offset']==='undefined'&&typeof _0x4764e9[_0x0bf7('0x21')]==='undefined';var _0x39d88c=_0xb0e54c[_0x0bf7('0x22')];var _0x4bc308=_0x8f3b52?0x0:_0x4764e9[_0x0bf7('0x23')];var _0x1314e7=_0x8f3b52?_0xb0e54c[_0x0bf7('0x22')]:_0x4764e9[_0x0bf7('0x23')]+_0x4764e9[_0x0bf7('0x21')];var _0x161ac9;if(_0x1314e7>=_0x39d88c){_0x1314e7=_0x39d88c;_0x161ac9=0xc8;}else{_0x161ac9=0xce;}_0x319d68[_0x0bf7('0x20')](_0x161ac9);return _0x319d68[_0x0bf7('0x24')](_0x0bf7('0x25'),_0x4bc308+'-'+_0x1314e7+'/'+_0x39d88c)[_0x0bf7('0x26')](_0xb0e54c);}return null;};}function patchUpdates(_0x152219){return function(_0x59ea27){try{jsonpatch[_0x0bf7('0x27')](_0x59ea27,_0x152219,!![]);}catch(_0xd6d442){return BPromise[_0x0bf7('0x28')](_0xd6d442);}return _0x59ea27[_0x0bf7('0x29')]();};}function saveUpdates(_0x2146cd,_0x3b0dd7){return function(_0x13003d){if(_0x13003d){return _0x13003d[_0x0bf7('0x2a')](_0x2146cd)['then'](function(_0x58931a){return _0x58931a;});}return null;};}function removeEntity(_0x5c61c7,_0x4833ba){return function(_0x24fa11){if(_0x24fa11){return _0x24fa11[_0x0bf7('0x2b')]()['then'](function(){var _0xe66b4a=_0x24fa11['get']({'plain':!![]});var _0x30bd14=_0x0bf7('0x2c');return db[_0x0bf7('0x2d')][_0x0bf7('0x2b')]({'where':{'type':_0x30bd14,'resourceId':_0xe66b4a['id']}})[_0x0bf7('0x2e')](function(){return _0x24fa11;});})[_0x0bf7('0x2e')](function(){_0x5c61c7[_0x0bf7('0x20')](0xcc)[_0x0bf7('0x1f')]();});}};}function handleEntityNotFound(_0x5cbee1,_0x211593){return function(_0x54c879){if(!_0x54c879){_0x5cbee1[_0x0bf7('0x1e')](0x194);}return _0x54c879;};}function handleError(_0x586fad,_0x5e0022){_0x5e0022=_0x5e0022||0x1f4;return function(_0x41cea1){logger[_0x0bf7('0x2f')](_0x41cea1['stack']);if(_0x41cea1[_0x0bf7('0x30')]){delete _0x41cea1['name'];}_0x586fad[_0x0bf7('0x20')](_0x5e0022)[_0x0bf7('0x31')](_0x41cea1);};}exports[_0x0bf7('0x32')]=function(_0x168b3d,_0x1adcb0){var _0x2cc147={},_0xd61cb0={},_0x2633fd={'count':0x0,'rows':[]};var _0x2287b2=_[_0x0bf7('0x33')](db[_0x0bf7('0x34')][_0x0bf7('0x35')],function(_0x5ec654){return{'name':_0x5ec654[_0x0bf7('0x36')],'type':_0x5ec654['type'][_0x0bf7('0x37')]};});_0xd61cb0[_0x0bf7('0x38')]=_[_0x0bf7('0x33')](_0x2287b2,_0x0bf7('0x30'));_0xd61cb0[_0x0bf7('0x39')]=_[_0x0bf7('0x3a')](_0x168b3d[_0x0bf7('0x39')]);_0xd61cb0[_0x0bf7('0x3b')]=_[_0x0bf7('0x3c')](_0xd61cb0['model'],_0xd61cb0[_0x0bf7('0x39')]);_0x2cc147[_0x0bf7('0x3d')]=_['intersection'](_0xd61cb0[_0x0bf7('0x38')],qs[_0x0bf7('0x3e')](_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x3e')]));_0x2cc147[_0x0bf7('0x3d')]=_0x2cc147[_0x0bf7('0x3d')][_0x0bf7('0x3f')]?_0x2cc147[_0x0bf7('0x3d')]:_0xd61cb0['model'];if(!_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x40')](_0x0bf7('0x41'))){_0x2cc147[_0x0bf7('0x21')]=qs[_0x0bf7('0x21')](_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x21')]);_0x2cc147[_0x0bf7('0x23')]=qs[_0x0bf7('0x23')](_0x168b3d['query'][_0x0bf7('0x23')]);}_0x2cc147[_0x0bf7('0x42')]=qs[_0x0bf7('0x43')](_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x43')]);_0x2cc147[_0x0bf7('0x44')]=qs[_0x0bf7('0x3b')](_['pick'](_0x168b3d[_0x0bf7('0x39')],_0xd61cb0['filters']),_0x2287b2);if(_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x45')]){_0x2cc147[_0x0bf7('0x44')]=_['merge'](_0x2cc147[_0x0bf7('0x44')],{'$or':_['map'](_0x2287b2,function(_0x3746a4){if(_0x3746a4[_0x0bf7('0x46')]!==_0x0bf7('0x47')){var _0x36c317={};_0x36c317[_0x3746a4[_0x0bf7('0x30')]]={'$like':'%'+_0x168b3d['query']['filter']+'%'};return _0x36c317;}})});}_0x2cc147=_[_0x0bf7('0x48')]({},_0x2cc147,_0x168b3d[_0x0bf7('0x49')]);var _0x379325={'where':_0x2cc147[_0x0bf7('0x44')]};return db[_0x0bf7('0x34')]['count'](_0x379325)[_0x0bf7('0x2e')](function(_0x118d03){_0x2633fd[_0x0bf7('0x22')]=_0x118d03;if(_0x168b3d[_0x0bf7('0x39')][_0x0bf7('0x4a')]){_0x2cc147[_0x0bf7('0x4b')]=[{'all':!![]}];}return db[_0x0bf7('0x34')][_0x0bf7('0x4c')](_0x2cc147);})[_0x0bf7('0x2e')](function(_0x5c2f64){_0x2633fd[_0x0bf7('0x4d')]=_0x5c2f64;return _0x2633fd;})[_0x0bf7('0x2e')](respondWithFilteredResult(_0x1adcb0,_0x2cc147))['catch'](handleError(_0x1adcb0,null));};exports[_0x0bf7('0x4e')]=function(_0x490e0a,_0x2b0998){var _0x3ce951={'raw':![],'where':{'id':_0x490e0a[_0x0bf7('0x4f')]['id']}},_0xec79ac={};_0xec79ac[_0x0bf7('0x38')]=_[_0x0bf7('0x3a')](db[_0x0bf7('0x34')]['rawAttributes']);_0xec79ac[_0x0bf7('0x39')]=_[_0x0bf7('0x3a')](_0x490e0a[_0x0bf7('0x39')]);_0xec79ac[_0x0bf7('0x3b')]=_[_0x0bf7('0x3c')](_0xec79ac[_0x0bf7('0x38')],_0xec79ac['query']);_0x3ce951['attributes']=_[_0x0bf7('0x3c')](_0xec79ac[_0x0bf7('0x38')],qs[_0x0bf7('0x3e')](_0x490e0a[_0x0bf7('0x39')][_0x0bf7('0x3e')]));_0x3ce951[_0x0bf7('0x3d')]=_0x3ce951[_0x0bf7('0x3d')]['length']?_0x3ce951[_0x0bf7('0x3d')]:_0xec79ac[_0x0bf7('0x38')];if(_0x490e0a['query'][_0x0bf7('0x4a')]){_0x3ce951[_0x0bf7('0x4b')]=[{'all':!![]}];}_0x3ce951=_[_0x0bf7('0x48')]({},_0x3ce951,_0x490e0a['options']);return db['AnalyticCustomReport'][_0x0bf7('0x50')](_0x3ce951)[_0x0bf7('0x2e')](handleEntityNotFound(_0x2b0998,null))['then'](respondWithResult(_0x2b0998,null))[_0x0bf7('0x51')](handleError(_0x2b0998,null));};exports[_0x0bf7('0x52')]=function(_0x2695b5,_0x4af75c){return db[_0x0bf7('0x34')][_0x0bf7('0x52')](_0x2695b5[_0x0bf7('0x53')],{})[_0x0bf7('0x2e')](function(_0x467c26){var _0xe67588=_0x2695b5['user'][_0x0bf7('0x54')]({'plain':!![]});if(!_0xe67588)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe67588['role']===_0x0bf7('0x55')){var _0x16e221=_0x467c26[_0x0bf7('0x54')]({'plain':!![]});var _0x26e614='Reports';return db['UserProfileSection'][_0x0bf7('0x50')]({'where':{'name':_0x26e614,'userProfileId':_0xe67588[_0x0bf7('0x56')]},'raw':!![]})[_0x0bf7('0x2e')](function(_0x453541){if(_0x453541&&_0x453541['autoAssociation']===0x0){return db['UserProfileResource'][_0x0bf7('0x52')]({'name':_0x16e221['name'],'resourceId':_0x16e221['id'],'type':_0x0bf7('0x2c'),'sectionId':_0x453541['id']},{})[_0x0bf7('0x2e')](function(){return _0x467c26;});}else{return _0x467c26;}})[_0x0bf7('0x51')](function(_0x7de933){logger[_0x0bf7('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7de933);throw _0x7de933;});}return _0x467c26;})[_0x0bf7('0x2e')](respondWithResult(_0x4af75c,0xc9))['catch'](handleError(_0x4af75c,null));};exports[_0x0bf7('0x2a')]=function(_0x52ad4a,_0x39f9bd){if(_0x52ad4a['body']['id']){delete _0x52ad4a[_0x0bf7('0x53')]['id'];}return db['AnalyticCustomReport'][_0x0bf7('0x50')]({'where':{'id':_0x52ad4a[_0x0bf7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39f9bd,null))[_0x0bf7('0x2e')](saveUpdates(_0x52ad4a['body'],null))[_0x0bf7('0x2e')](respondWithResult(_0x39f9bd,null))[_0x0bf7('0x51')](handleError(_0x39f9bd,null));};exports[_0x0bf7('0x2b')]=function(_0xfb9d52,_0x7b65ac){return db[_0x0bf7('0x34')][_0x0bf7('0x50')]({'where':{'id':_0xfb9d52[_0x0bf7('0x4f')]['id']}})[_0x0bf7('0x2e')](handleEntityNotFound(_0x7b65ac,null))[_0x0bf7('0x2e')](removeEntity(_0x7b65ac,null))[_0x0bf7('0x51')](handleError(_0x7b65ac,null));};exports['preview']=function(_0x5abdc3,_0x2c3409){var _0x48bde4=0xa;var _0x2c75e2=[_0x0bf7('0x57'),'left_join','right_join',_0x0bf7('0x58')];var _0x5eb79c={'SUM':_0x0bf7('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0bf7('0x5a'),'MAX':_0x0bf7('0x5b'),'MIN':_0x0bf7('0x5c'),'AVG':_0x0bf7('0x5d'),'GROUP_CONCAT':_0x0bf7('0x5e'),'GROUP_CONCAT ASC':_0x0bf7('0x5f'),'GROUP_CONCAT DESC':_0x0bf7('0x60')};var _0x273489={'SEC_TO_TIME':_0x0bf7('0x61'),'DATE':_0x0bf7('0x62'),'HOUR':_0x0bf7('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0bf7('0x64')};var _0x334f4c=function(_0x503237){return!_['includes']([_0x0bf7('0x65'),_0x0bf7('0x66'),_0x0bf7('0x67'),_0x0bf7('0x68')],_0x503237);};var _0x3630ae=function(_0x51deb3){if(!_0x51deb3||!_0x51deb3[_0x0bf7('0x69')]['length']){return'';}for(var _0x445247='(',_0x13ae4d=0x0;_0x13ae4d<_0x51deb3[_0x0bf7('0x69')][_0x0bf7('0x3f')];_0x13ae4d+=0x1){_0x13ae4d>0x0&&(_0x445247+='\x20'+_0x51deb3['operator']+'\x20');_0x445247+=_0x51deb3[_0x0bf7('0x69')][_0x13ae4d][_0x0bf7('0x6a')]?_0x3630ae(_0x51deb3[_0x0bf7('0x69')][_0x13ae4d][_0x0bf7('0x6a')]):_0x51deb3[_0x0bf7('0x69')][_0x13ae4d][_0x0bf7('0x6b')]+'\x20'+_0x51deb3[_0x0bf7('0x69')][_0x13ae4d]['condition']+(_0x334f4c(_0x51deb3[_0x0bf7('0x69')][_0x13ae4d][_0x0bf7('0x6c')])?'\x20'+_0x51deb3[_0x0bf7('0x69')][_0x13ae4d][_0x0bf7('0x6d')]:'');}return _0x445247+')';};var _0x914a1b={'where':{'id':_0x5abdc3[_0x0bf7('0x4f')]['id']}},_0x5d8290,_0x9c5456,_0x4d9664,_0x8d1e9f,_0x3b2e36;_0x914a1b=_['merge']({},_0x914a1b,_0x5abdc3[_0x0bf7('0x49')]);return db['AnalyticCustomReport']['find'](_0x914a1b)[_0x0bf7('0x2e')](function(_0x3f708e){if(_0x3f708e){_0x5d8290=_0x3f708e;return _0x3f708e[_0x0bf7('0x6e')]();}return null;})['then'](function(_0x41f253){if(_0x41f253){if(!_0x41f253[_0x0bf7('0x3f')]){throw new db[(_0x0bf7('0x6f'))][(_0x0bf7('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9c5456=_0x41f253;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x0bf7('0x2e')](function(_0x1ab52b){if(_0x1ab52b){_0x4d9664=_['keyBy'](_0x1ab52b,'id');var _0x2a607e;var _0xb3cebf=squel[_0x0bf7('0x71')]();_0xb3cebf['from'](_0x5d8290['table']);for(var _0x474b85=0x0;_0x474b85<_0x9c5456[_0x0bf7('0x3f')];_0x474b85+=0x1){_0x2a607e=_0x9c5456[_0x474b85]['MetricId']?_0x4d9664[_0x9c5456[_0x474b85][_0x0bf7('0x72')]][_0x0bf7('0x73')]:_0x9c5456[_0x474b85][_0x0bf7('0x6b')];_0x2a607e=_0x9c5456[_0x474b85][_0x0bf7('0x74')]?_[_0x0bf7('0x75')](_0x5eb79c[_0x9c5456[_0x474b85][_0x0bf7('0x74')]],'%s',_0x2a607e):_0x2a607e;_0x2a607e=_0x9c5456[_0x474b85]['format']?_[_0x0bf7('0x75')](_0x273489[_0x9c5456[_0x474b85][_0x0bf7('0x76')]],'%s',_0x2a607e):_0x2a607e;if(_0x9c5456[_0x474b85][_0x0bf7('0x77')]){_0xb3cebf['group'](_0x2a607e);}_0x9c5456[_0x474b85]['orderBy']&&_0xb3cebf['order'](_0x2a607e,_0x9c5456[_0x474b85]['orderBy']===_0x0bf7('0x78')?![]:!![]);_0xb3cebf[_0x0bf7('0x6b')](_0x2a607e,_0x9c5456[_0x474b85]['alias']||_0x2a607e);}if(_0x5d8290[_0x0bf7('0x79')]){_0x5d8290[_0x0bf7('0x79')]=JSON[_0x0bf7('0x7a')](_0x5d8290[_0x0bf7('0x79')]);for(var _0x3377a2=0x0;_0x3377a2<_0x5d8290[_0x0bf7('0x79')][_0x0bf7('0x3f')];_0x3377a2+=0x1){if(_0x5d8290[_0x0bf7('0x79')][_0x3377a2]['type']&&_[_0x0bf7('0x7b')](_0x2c75e2,_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x46')])&&_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7c')]&&_0x5d8290['joins'][_0x3377a2]['foreignTable']&&_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7d')]){_0xb3cebf[_0x5d8290['joins'][_0x3377a2][_0x0bf7('0x46')]](_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7e')],null,util[_0x0bf7('0x76')](_0x0bf7('0x7f'),_0x5d8290[_0x0bf7('0x80')],_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7c')],_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7e')],_0x5d8290[_0x0bf7('0x79')][_0x3377a2][_0x0bf7('0x7d')]));}}}if(_0x5d8290[_0x0bf7('0x81')]){_0x5d8290['conditions']=JSON[_0x0bf7('0x7a')](_0x5d8290[_0x0bf7('0x81')]);_0xb3cebf['where'](_0x3630ae(_0x5d8290[_0x0bf7('0x81')]['group']));}_0x3b2e36=_0xb3cebf['clone']();_0xb3cebf[_0x0bf7('0x21')](_0x48bde4);_0xb3cebf['offset'](0x0);logger[_0x0bf7('0x82')]('Limited\x20Query:',_0xb3cebf['toString']());return dbH[_0x0bf7('0x83')][_0x0bf7('0x39')](_0xb3cebf[_0x0bf7('0x84')](),{'type':dbH[_0x0bf7('0x83')][_0x0bf7('0x85')]['SELECT']});}})[_0x0bf7('0x2e')](respondWithResult(_0x2c3409,null))[_0x0bf7('0x51')](handleError(_0x2c3409,null));};function runReport(_0xa50132,_0x12410a,_0x143fb5){var _0x3e1c12=_0x12410a['name'];var _0x5e5a07=0xa;var _0x3ac051=[_0x0bf7('0x57'),_0x0bf7('0x86'),_0x0bf7('0x87'),'cross_join'];var _0x576e7c={'SUM':_0x0bf7('0x59'),'COUNT':_0x0bf7('0x88'),'COUNT DISTINCT':_0x0bf7('0x5a'),'MAX':'MAX(%s)','MIN':_0x0bf7('0x5c'),'AVG':_0x0bf7('0x5d'),'GROUP_CONCAT':_0x0bf7('0x5e'),'GROUP_CONCAT ASC':_0x0bf7('0x5f'),'GROUP_CONCAT DESC':_0x0bf7('0x60')};var _0x36e7a6={'SEC_TO_TIME':_0x0bf7('0x61'),'DATE':_0x0bf7('0x62'),'HOUR':_0x0bf7('0x63'),'ROUND':_0x0bf7('0x89'),'UNIX_TIMESTAMP':_0x0bf7('0x64')};var _0x3a88a6=function(_0x1bcd89){return!_['includes']([_0x0bf7('0x65'),'IS\x20NOT\x20NULL',_0x0bf7('0x67'),'IS\x20NOT\x20EMPTY'],_0x1bcd89);};var _0x5b77e1=function(_0x15687f){if(!_0x15687f||!_0x15687f[_0x0bf7('0x69')][_0x0bf7('0x3f')]){return'';}for(var _0x2c2852='(',_0xdbb32c=0x0;_0xdbb32c<_0x15687f[_0x0bf7('0x69')]['length'];_0xdbb32c+=0x1){_0xdbb32c>0x0&&(_0x2c2852+='\x20'+_0x15687f[_0x0bf7('0x8a')]+'\x20');_0x2c2852+=_0x15687f[_0x0bf7('0x69')][_0xdbb32c][_0x0bf7('0x6a')]?_0x5b77e1(_0x15687f[_0x0bf7('0x69')][_0xdbb32c]['group']):_0x15687f[_0x0bf7('0x69')][_0xdbb32c][_0x0bf7('0x6b')]+'\x20'+_0x15687f[_0x0bf7('0x69')][_0xdbb32c][_0x0bf7('0x6c')]+(_0x3a88a6(_0x15687f[_0x0bf7('0x69')][_0xdbb32c][_0x0bf7('0x6c')])?'\x20'+_0x15687f[_0x0bf7('0x69')][_0xdbb32c][_0x0bf7('0x6d')]:'');}return _0x2c2852+')';};var _0x58a7d9={'where':{'id':_0xa50132['id']}},_0x57331c,_0x3525fe,_0x2e1e6d,_0x3e0b4b,_0x1615cc;_0x58a7d9=_[_0x0bf7('0x48')]({},_0x58a7d9,_0x143fb5);return db[_0x0bf7('0x34')]['find'](_0x58a7d9)[_0x0bf7('0x2e')](function(_0x44d1aa){if(_0x44d1aa){_0x57331c=_0x44d1aa;return _0x44d1aa['getFields']();}return null;})[_0x0bf7('0x2e')](function(_0x104132){if(_0x104132){if(!_0x104132[_0x0bf7('0x3f')]){throw new db[(_0x0bf7('0x6f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3525fe=_0x104132;return db[_0x0bf7('0x8b')]['findAll']({'raw':!![]});}return null;})[_0x0bf7('0x2e')](function(_0x264d2a){if(_0x264d2a){_0x2e1e6d=_[_0x0bf7('0x8c')](_0x264d2a,'id');var _0x4d4291;var _0x4a8c27=squel[_0x0bf7('0x71')]();_0x4a8c27[_0x0bf7('0x8d')](_0x57331c['table']);for(var _0xfbb434=0x0;_0xfbb434<_0x3525fe[_0x0bf7('0x3f')];_0xfbb434+=0x1){_0x4d4291=_0x3525fe[_0xfbb434][_0x0bf7('0x72')]?_0x2e1e6d[_0x3525fe[_0xfbb434][_0x0bf7('0x72')]][_0x0bf7('0x73')]:_0x3525fe[_0xfbb434]['field'];_0x4d4291=_0x3525fe[_0xfbb434]['function']?_[_0x0bf7('0x75')](_0x576e7c[_0x3525fe[_0xfbb434]['function']],'%s',_0x4d4291):_0x4d4291;_0x4d4291=_0x3525fe[_0xfbb434]['format']?_[_0x0bf7('0x75')](_0x36e7a6[_0x3525fe[_0xfbb434]['format']],'%s',_0x4d4291):_0x4d4291;if(_0x3525fe[_0xfbb434][_0x0bf7('0x77')]){_0x4a8c27['group'](_0x4d4291);}_0x3525fe[_0xfbb434][_0x0bf7('0x8e')]&&_0x4a8c27['order'](_0x4d4291,_0x3525fe[_0xfbb434]['orderBy']===_0x0bf7('0x78')?![]:!![]);_0x4a8c27[_0x0bf7('0x6b')](_0x4d4291,_0x3525fe[_0xfbb434][_0x0bf7('0x8f')]||_0x4d4291);}if(_0x57331c[_0x0bf7('0x79')]){_0x57331c[_0x0bf7('0x79')]=JSON[_0x0bf7('0x7a')](_0x57331c[_0x0bf7('0x79')]);for(var _0x21afd0=0x0;_0x21afd0<_0x57331c[_0x0bf7('0x79')][_0x0bf7('0x3f')];_0x21afd0+=0x1){if(_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x46')]&&_[_0x0bf7('0x7b')](_0x3ac051,_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x46')])&&_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x7c')]&&_0x57331c['joins'][_0x21afd0][_0x0bf7('0x7e')]&&_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x7d')]){_0x4a8c27[_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x46')]](_0x57331c['joins'][_0x21afd0][_0x0bf7('0x7e')],null,util['format'](_0x0bf7('0x7f'),_0x57331c[_0x0bf7('0x80')],_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x7c')],_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x7e')],_0x57331c[_0x0bf7('0x79')][_0x21afd0][_0x0bf7('0x7d')]));}}}if(_0x57331c[_0x0bf7('0x81')]){_0x57331c[_0x0bf7('0x81')]=JSON[_0x0bf7('0x7a')](_0x57331c[_0x0bf7('0x81')]);_0x4a8c27[_0x0bf7('0x44')](_0x5b77e1(_0x57331c['conditions'][_0x0bf7('0x6a')]));}_0x1615cc=_0x4a8c27['clone']();_0x4a8c27[_0x0bf7('0x21')](_0x5e5a07);_0x4a8c27[_0x0bf7('0x23')](0x0);return;}})[_0x0bf7('0x2e')](function(){if(_0x12410a[_0x0bf7('0x90')]===_0x0bf7('0x91')){return null;}var _0x20e2a1=_[_0x0bf7('0x48')](_0x12410a,{'name':_0x12410a[_0x0bf7('0x92')]||_0x12410a['name']||_0x57331c[_0x0bf7('0x30')],'basename':_0x3e1c12,'savename':util[_0x0bf7('0x76')](_0x0bf7('0x93'),_0x12410a[_0x0bf7('0x30')]||_0x57331c[_0x0bf7('0x30')],require(_0x0bf7('0x94'))[_0x0bf7('0x95')](0x4),_0x12410a[_0x0bf7('0x90')]||_0x0bf7('0x96')),'reportId':_0x57331c['id'],'reportType':_0x0bf7('0x97')});return db[_0x0bf7('0x98')][_0x0bf7('0x52')](_0x20e2a1,{'raw':!![]});})['then'](function(_0x8acfed){if(_0x57331c[_0x0bf7('0x80')]==='cdr'){_0x1615cc[_0x0bf7('0x44')](_0x57331c['table']+_0x0bf7('0x99'),_0x12410a[_0x0bf7('0x9a')],_0x12410a[_0x0bf7('0x9b')]);}else{_0x1615cc[_0x0bf7('0x44')](_0x57331c[_0x0bf7('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12410a[_0x0bf7('0x9a')],_0x12410a[_0x0bf7('0x9b')]);}if(_0x8acfed){logger[_0x0bf7('0x9c')]('Run\x20Query:',_0x1615cc[_0x0bf7('0x84')]());require(_0x0bf7('0x9d'))[_0x0bf7('0x9e')](path[_0x0bf7('0x57')](__dirname,_0x0bf7('0x9f'),_0x8acfed['output']),[_0x8acfed['id'],_0x1615cc[_0x0bf7('0x84')](),path['join'](__dirname,_0x0bf7('0xa0'),_0x8acfed[_0x0bf7('0xa1')]),_0x3e1c12]);return _0x8acfed;}else{var _0x589548=squel[_0x0bf7('0x71')]();_0x589548[_0x0bf7('0x8d')]('('+_0x1615cc[_0x0bf7('0x84')]()+')',_0x0bf7('0xa2'));_0x589548[_0x0bf7('0x6b')]('COUNT(*)',_0x0bf7('0x22'));_0x1615cc['limit'](_0x12410a[_0x0bf7('0x21')]||_0x5e5a07);_0x1615cc[_0x0bf7('0x23')](_0x12410a[_0x0bf7('0x23')]||0x0);return dbH[_0x0bf7('0x83')]['query'](_0x589548['toString'](),{'type':dbH['sequelize'][_0x0bf7('0x85')][_0x0bf7('0xa3')]})[_0x0bf7('0x2e')](function(_0x40a806){if(!_0x40a806[_0x0bf7('0x3f')]){_0x3e0b4b=0x0;}else{_0x3e0b4b=_0x40a806[0x0][_0x0bf7('0x22')]||0x0;}return dbH[_0x0bf7('0x83')][_0x0bf7('0x39')](_0x1615cc[_0x0bf7('0x84')](),{'type':dbH['sequelize'][_0x0bf7('0x85')][_0x0bf7('0xa3')]});})['then'](function(_0x1dea75){return{'rows':_0x1dea75||[],'count':_0x3e0b4b};});}});}exports[_0x0bf7('0xa4')]=function(_0x2ff9a7,_0x17f0ca){return runReport(_0x2ff9a7[_0x0bf7('0x4f')],_0x2ff9a7['query'],_0x2ff9a7['options'])[_0x0bf7('0x2e')](respondWithResult(_0x17f0ca,null))[_0x0bf7('0x51')](handleError(_0x17f0ca,null));};exports['runReport']=runReport;exports[_0x0bf7('0x39')]=function(_0x230f86,_0x17523a){var _0x1bd22d=0xa;var _0x3f41bf=[_0x0bf7('0x57'),_0x0bf7('0x86'),_0x0bf7('0x87'),_0x0bf7('0x58')];var _0xb52e2e={'SUM':_0x0bf7('0x59'),'COUNT':_0x0bf7('0x88'),'COUNT DISTINCT':_0x0bf7('0x5a'),'MAX':_0x0bf7('0x5b'),'MIN':'MIN(%s)','AVG':_0x0bf7('0x5d'),'GROUP_CONCAT':_0x0bf7('0x5e'),'GROUP_CONCAT ASC':_0x0bf7('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x19dfee={'SEC_TO_TIME':_0x0bf7('0x61'),'DATE':_0x0bf7('0x62'),'HOUR':_0x0bf7('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0bf7('0x64')};var _0x556833=function(_0x2a0827){return!_[_0x0bf7('0x7b')](['IS\x20NULL',_0x0bf7('0x66'),_0x0bf7('0x67'),_0x0bf7('0x68')],_0x2a0827);};var _0x2de17f=function(_0x56e85b){if(!_0x56e85b||!_0x56e85b[_0x0bf7('0x69')][_0x0bf7('0x3f')]){return'';}for(var _0x47052e='(',_0x551051=0x0;_0x551051<_0x56e85b[_0x0bf7('0x69')][_0x0bf7('0x3f')];_0x551051+=0x1){_0x551051>0x0&&(_0x47052e+='\x20'+_0x56e85b['operator']+'\x20');_0x47052e+=_0x56e85b[_0x0bf7('0x69')][_0x551051][_0x0bf7('0x6a')]?_0x2de17f(_0x56e85b[_0x0bf7('0x69')][_0x551051][_0x0bf7('0x6a')]):_0x56e85b[_0x0bf7('0x69')][_0x551051][_0x0bf7('0x6b')]+'\x20'+_0x56e85b[_0x0bf7('0x69')][_0x551051]['condition']+(_0x556833(_0x56e85b[_0x0bf7('0x69')][_0x551051]['condition'])?'\x20'+_0x56e85b[_0x0bf7('0x69')][_0x551051]['value']:'');}return _0x47052e+')';};var _0x5c8606={'where':{'id':_0x230f86[_0x0bf7('0x4f')]['id']}},_0xddda4e,_0x26abf8,_0x1448d5,_0x3ca8a8,_0x2258c2;_0x5c8606=_[_0x0bf7('0x48')]({},_0x5c8606,_0x230f86[_0x0bf7('0x49')]);return db[_0x0bf7('0x34')][_0x0bf7('0x50')](_0x5c8606)[_0x0bf7('0x2e')](function(_0x298293){if(_0x298293){_0xddda4e=_0x298293;return _0x298293['getFields']();}return null;})['then'](function(_0x142ec5){if(_0x142ec5){if(!_0x142ec5[_0x0bf7('0x3f')]){throw new db['Sequelize'][(_0x0bf7('0x70'))](_0x0bf7('0xa5'),0x193);}_0x26abf8=_0x142ec5;return db[_0x0bf7('0x8b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xfe2a79){if(_0xfe2a79){_0x1448d5=_[_0x0bf7('0x8c')](_0xfe2a79,'id');var _0x7bb7d;var _0x143445=squel[_0x0bf7('0x71')]();_0x143445[_0x0bf7('0x8d')](_0xddda4e[_0x0bf7('0x80')]);for(var _0x5f176d=0x0;_0x5f176d<_0x26abf8['length'];_0x5f176d+=0x1){_0x7bb7d=_0x26abf8[_0x5f176d][_0x0bf7('0x72')]?_0x1448d5[_0x26abf8[_0x5f176d][_0x0bf7('0x72')]][_0x0bf7('0x73')]:_0x26abf8[_0x5f176d][_0x0bf7('0x6b')];_0x7bb7d=_0x26abf8[_0x5f176d]['function']?_[_0x0bf7('0x75')](_0xb52e2e[_0x26abf8[_0x5f176d][_0x0bf7('0x74')]],'%s',_0x7bb7d):_0x7bb7d;_0x7bb7d=_0x26abf8[_0x5f176d][_0x0bf7('0x76')]?_[_0x0bf7('0x75')](_0x19dfee[_0x26abf8[_0x5f176d][_0x0bf7('0x76')]],'%s',_0x7bb7d):_0x7bb7d;if(_0x26abf8[_0x5f176d][_0x0bf7('0x77')]){_0x143445['group'](_0x7bb7d);}_0x26abf8[_0x5f176d]['orderBy']&&_0x143445[_0x0bf7('0x42')](_0x7bb7d,_0x26abf8[_0x5f176d][_0x0bf7('0x8e')]===_0x0bf7('0x78')?![]:!![]);_0x143445[_0x0bf7('0x6b')](_0x7bb7d,_0x26abf8[_0x5f176d][_0x0bf7('0x8f')]||_0x7bb7d);}if(_0xddda4e['joins']){_0xddda4e['joins']=JSON[_0x0bf7('0x7a')](_0xddda4e[_0x0bf7('0x79')]);for(var _0x3aeb3d=0x0;_0x3aeb3d<_0xddda4e[_0x0bf7('0x79')][_0x0bf7('0x3f')];_0x3aeb3d+=0x1){if(_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x46')]&&_[_0x0bf7('0x7b')](_0x3f41bf,_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x46')])&&_0xddda4e['joins'][_0x3aeb3d][_0x0bf7('0x7c')]&&_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x7e')]&&_0xddda4e['joins'][_0x3aeb3d][_0x0bf7('0x7d')]){_0x143445[_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x46')]](_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x7e')],null,util[_0x0bf7('0x76')](_0x0bf7('0x7f'),_0xddda4e[_0x0bf7('0x80')],_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x7c')],_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x7e')],_0xddda4e[_0x0bf7('0x79')][_0x3aeb3d][_0x0bf7('0x7d')]));}}}if(_0xddda4e['conditions']){_0xddda4e[_0x0bf7('0x81')]=JSON['parse'](_0xddda4e[_0x0bf7('0x81')]);_0x143445[_0x0bf7('0x44')](_0x2de17f(_0xddda4e[_0x0bf7('0x81')][_0x0bf7('0x6a')]));}_0x2258c2=_0x143445[_0x0bf7('0xa6')]();_0x143445[_0x0bf7('0x21')](_0x1bd22d);_0x143445['offset'](0x0);logger[_0x0bf7('0x82')]('Limited\x20Query:',_0x143445['toString']());return dbH['sequelize'][_0x0bf7('0x39')](_0x143445[_0x0bf7('0x84')](),{'type':dbH[_0x0bf7('0x83')][_0x0bf7('0x85')]['SELECT']});}})[_0x0bf7('0x2e')](function(){return{'sql':_0x2258c2[_0x0bf7('0x84')]()};})['then'](respondWithResult(_0x17523a,null))[_0x0bf7('0x51')](handleError(_0x17523a,null));}; \ No newline at end of file +var _0x275b=['Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','order','DESC','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','value','function','web','fullPath','%s-%s.%s','randomstring','generate','output','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','COUNT(*)','run','runReport','AVG(%s)','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','CustomReports','UserProfileResource','destroy','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','pick','filter','where','merge','options','includeAll','include','rows','catch','params','create','body','role','user','get'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x275b,0x1a1));var _0xb275=function(_0xf6aa77,_0x50c3e9){_0xf6aa77=_0xf6aa77-0x0;var _0x2f4c1f=_0x275b[_0xf6aa77];return _0x2f4c1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb275('0x0'));var zipdir=require(_0xb275('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb275('0x2'));var moment=require(_0xb275('0x3'));var BPromise=require(_0xb275('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb275('0x5'));var sox=require(_0xb275('0x6'));var csv=require('to-csv');var ejs=require(_0xb275('0x7'));var fs=require('fs');var fs_extra=require(_0xb275('0x8'));var _=require(_0xb275('0x9'));var squel=require(_0xb275('0xa'));var crypto=require(_0xb275('0xb'));var jsforce=require(_0xb275('0xc'));var deskjs=require(_0xb275('0xd'));var toCsv=require(_0xb275('0xe'));var querystring=require(_0xb275('0xf'));var Papa=require(_0xb275('0x10'));var Redis=require(_0xb275('0x11'));var authService=require(_0xb275('0x12'));var qs=require(_0xb275('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb275('0x14'));var logger=require(_0xb275('0x15'))(_0xb275('0x16'));var utils=require(_0xb275('0x17'));var config=require(_0xb275('0x18'));var licenseUtil=require(_0xb275('0x19'));var db=require(_0xb275('0x1a'))['db'];var dbH=require(_0xb275('0x1a'))[_0xb275('0x1b')];function respondWithStatusCode(_0x748eea,_0x17bf47){_0x17bf47=_0x17bf47||0xcc;return function(_0x2a0a6d){if(_0x2a0a6d){return _0x748eea[_0xb275('0x1c')](_0x17bf47);}return _0x748eea[_0xb275('0x1d')](_0x17bf47)[_0xb275('0x1e')]();};}function respondWithResult(_0x508e3e,_0x1d3869){_0x1d3869=_0x1d3869||0xc8;return function(_0x33d114){if(_0x33d114){return _0x508e3e[_0xb275('0x1d')](_0x1d3869)[_0xb275('0x1f')](_0x33d114);}};}function respondWithFilteredResult(_0x2e5695,_0x4fb37d){return function(_0x3ac202){if(_0x3ac202){var _0x3ddc59=typeof _0x4fb37d[_0xb275('0x20')]===_0xb275('0x21')&&typeof _0x4fb37d[_0xb275('0x22')]===_0xb275('0x21');var _0x5e5020=_0x3ac202['count'];var _0x5d24a3=_0x3ddc59?0x0:_0x4fb37d[_0xb275('0x20')];var _0x2555f8=_0x3ddc59?_0x3ac202[_0xb275('0x23')]:_0x4fb37d[_0xb275('0x20')]+_0x4fb37d['limit'];var _0x13f944;if(_0x2555f8>=_0x5e5020){_0x2555f8=_0x5e5020;_0x13f944=0xc8;}else{_0x13f944=0xce;}_0x2e5695[_0xb275('0x1d')](_0x13f944);return _0x2e5695[_0xb275('0x24')](_0xb275('0x25'),_0x5d24a3+'-'+_0x2555f8+'/'+_0x5e5020)[_0xb275('0x1f')](_0x3ac202);}return null;};}function patchUpdates(_0x1c2828){return function(_0xccebe0){try{jsonpatch['apply'](_0xccebe0,_0x1c2828,!![]);}catch(_0x5ace6c){return BPromise[_0xb275('0x26')](_0x5ace6c);}return _0xccebe0[_0xb275('0x27')]();};}function saveUpdates(_0x4a05bb,_0x266ac5){return function(_0x269ba2){if(_0x269ba2){return _0x269ba2['update'](_0x4a05bb)[_0xb275('0x28')](function(_0x2e2a43){return _0x2e2a43;});}return null;};}function removeEntity(_0x528541,_0x25f789){return function(_0x1504d4){if(_0x1504d4){return _0x1504d4['destroy']()[_0xb275('0x28')](function(){var _0x17aabd=_0x1504d4['get']({'plain':!![]});var _0x414ae3=_0xb275('0x29');return db[_0xb275('0x2a')][_0xb275('0x2b')]({'where':{'type':_0x414ae3,'resourceId':_0x17aabd['id']}})[_0xb275('0x28')](function(){return _0x1504d4;});})['then'](function(){_0x528541[_0xb275('0x1d')](0xcc)[_0xb275('0x1e')]();});}};}function handleEntityNotFound(_0x572b8b,_0x4d5a2b){return function(_0x48e0ed){if(!_0x48e0ed){_0x572b8b[_0xb275('0x1c')](0x194);}return _0x48e0ed;};}function handleError(_0x52c6ed,_0x19f14e){_0x19f14e=_0x19f14e||0x1f4;return function(_0x57f60b){logger[_0xb275('0x2c')](_0x57f60b[_0xb275('0x2d')]);if(_0x57f60b[_0xb275('0x2e')]){delete _0x57f60b['name'];}_0x52c6ed[_0xb275('0x1d')](_0x19f14e)[_0xb275('0x2f')](_0x57f60b);};}exports['index']=function(_0xf735a4,_0x286e0d){var _0x550f8f={},_0x24a3e2={},_0x3a61ce={'count':0x0,'rows':[]};var _0x81c979=_[_0xb275('0x30')](db[_0xb275('0x31')][_0xb275('0x32')],function(_0x5b877c){return{'name':_0x5b877c[_0xb275('0x33')],'type':_0x5b877c[_0xb275('0x34')][_0xb275('0x35')]};});_0x24a3e2[_0xb275('0x36')]=_[_0xb275('0x30')](_0x81c979,_0xb275('0x2e'));_0x24a3e2[_0xb275('0x37')]=_[_0xb275('0x38')](_0xf735a4['query']);_0x24a3e2[_0xb275('0x39')]=_[_0xb275('0x3a')](_0x24a3e2[_0xb275('0x36')],_0x24a3e2[_0xb275('0x37')]);_0x550f8f[_0xb275('0x3b')]=_[_0xb275('0x3a')](_0x24a3e2[_0xb275('0x36')],qs[_0xb275('0x3c')](_0xf735a4['query'][_0xb275('0x3c')]));_0x550f8f[_0xb275('0x3b')]=_0x550f8f[_0xb275('0x3b')][_0xb275('0x3d')]?_0x550f8f['attributes']:_0x24a3e2[_0xb275('0x36')];if(!_0xf735a4[_0xb275('0x37')]['hasOwnProperty'](_0xb275('0x3e'))){_0x550f8f[_0xb275('0x22')]=qs[_0xb275('0x22')](_0xf735a4[_0xb275('0x37')][_0xb275('0x22')]);_0x550f8f[_0xb275('0x20')]=qs[_0xb275('0x20')](_0xf735a4[_0xb275('0x37')]['offset']);}_0x550f8f['order']=qs['sort'](_0xf735a4[_0xb275('0x37')]['sort']);_0x550f8f['where']=qs[_0xb275('0x39')](_[_0xb275('0x3f')](_0xf735a4[_0xb275('0x37')],_0x24a3e2[_0xb275('0x39')]),_0x81c979);if(_0xf735a4[_0xb275('0x37')][_0xb275('0x40')]){_0x550f8f[_0xb275('0x41')]=_[_0xb275('0x42')](_0x550f8f['where'],{'$or':_[_0xb275('0x30')](_0x81c979,function(_0x5deff2){if(_0x5deff2[_0xb275('0x34')]!=='VIRTUAL'){var _0x50f9b0={};_0x50f9b0[_0x5deff2[_0xb275('0x2e')]]={'$like':'%'+_0xf735a4[_0xb275('0x37')]['filter']+'%'};return _0x50f9b0;}})});}_0x550f8f=_[_0xb275('0x42')]({},_0x550f8f,_0xf735a4[_0xb275('0x43')]);var _0x958135={'where':_0x550f8f[_0xb275('0x41')]};return db['AnalyticCustomReport'][_0xb275('0x23')](_0x958135)[_0xb275('0x28')](function(_0x3e5bbe){_0x3a61ce[_0xb275('0x23')]=_0x3e5bbe;if(_0xf735a4['query'][_0xb275('0x44')]){_0x550f8f[_0xb275('0x45')]=[{'all':!![]}];}return db[_0xb275('0x31')]['findAll'](_0x550f8f);})[_0xb275('0x28')](function(_0x49f2d9){_0x3a61ce[_0xb275('0x46')]=_0x49f2d9;return _0x3a61ce;})[_0xb275('0x28')](respondWithFilteredResult(_0x286e0d,_0x550f8f))[_0xb275('0x47')](handleError(_0x286e0d,null));};exports['show']=function(_0x438692,_0x383927){var _0x12410c={'raw':![],'where':{'id':_0x438692[_0xb275('0x48')]['id']}},_0x5d9702={};_0x5d9702['model']=_['keys'](db[_0xb275('0x31')][_0xb275('0x32')]);_0x5d9702[_0xb275('0x37')]=_[_0xb275('0x38')](_0x438692[_0xb275('0x37')]);_0x5d9702[_0xb275('0x39')]=_[_0xb275('0x3a')](_0x5d9702['model'],_0x5d9702['query']);_0x12410c[_0xb275('0x3b')]=_[_0xb275('0x3a')](_0x5d9702[_0xb275('0x36')],qs[_0xb275('0x3c')](_0x438692[_0xb275('0x37')]['fields']));_0x12410c['attributes']=_0x12410c['attributes'][_0xb275('0x3d')]?_0x12410c[_0xb275('0x3b')]:_0x5d9702[_0xb275('0x36')];if(_0x438692[_0xb275('0x37')][_0xb275('0x44')]){_0x12410c[_0xb275('0x45')]=[{'all':!![]}];}_0x12410c=_[_0xb275('0x42')]({},_0x12410c,_0x438692[_0xb275('0x43')]);return db['AnalyticCustomReport']['find'](_0x12410c)[_0xb275('0x28')](handleEntityNotFound(_0x383927,null))[_0xb275('0x28')](respondWithResult(_0x383927,null))[_0xb275('0x47')](handleError(_0x383927,null));};exports[_0xb275('0x49')]=function(_0x3a98b0,_0x495515){return db['AnalyticCustomReport'][_0xb275('0x49')](_0x3a98b0[_0xb275('0x4a')],{})[_0xb275('0x28')](function(_0x55e843){var _0x51f0b9=_0x3a98b0['user']['get']({'plain':!![]});if(!_0x51f0b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51f0b9[_0xb275('0x4b')]===_0xb275('0x4c')){var _0x3c682f=_0x55e843[_0xb275('0x4d')]({'plain':!![]});var _0x328d61=_0xb275('0x4e');return db[_0xb275('0x4f')][_0xb275('0x50')]({'where':{'name':_0x328d61,'userProfileId':_0x51f0b9[_0xb275('0x51')]},'raw':!![]})[_0xb275('0x28')](function(_0x5d8d6a){if(_0x5d8d6a&&_0x5d8d6a[_0xb275('0x52')]===0x0){return db[_0xb275('0x2a')]['create']({'name':_0x3c682f[_0xb275('0x2e')],'resourceId':_0x3c682f['id'],'type':'CustomReports','sectionId':_0x5d8d6a['id']},{})[_0xb275('0x28')](function(){return _0x55e843;});}else{return _0x55e843;}})['catch'](function(_0x31f81c){logger['error'](_0xb275('0x53'),_0x31f81c);throw _0x31f81c;});}return _0x55e843;})[_0xb275('0x28')](respondWithResult(_0x495515,0xc9))['catch'](handleError(_0x495515,null));};exports[_0xb275('0x54')]=function(_0x42af35,_0x5b7c58){if(_0x42af35[_0xb275('0x4a')]['id']){delete _0x42af35[_0xb275('0x4a')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x42af35[_0xb275('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b7c58,null))[_0xb275('0x28')](saveUpdates(_0x42af35[_0xb275('0x4a')],null))[_0xb275('0x28')](respondWithResult(_0x5b7c58,null))[_0xb275('0x47')](handleError(_0x5b7c58,null));};exports[_0xb275('0x2b')]=function(_0x2f2d99,_0x17ef29){return db[_0xb275('0x31')][_0xb275('0x50')]({'where':{'id':_0x2f2d99['params']['id']}})['then'](handleEntityNotFound(_0x17ef29,null))[_0xb275('0x28')](removeEntity(_0x17ef29,null))['catch'](handleError(_0x17ef29,null));};exports[_0xb275('0x55')]=function(_0xa92d0d,_0x4d156c){var _0x4f25f4=0xa;var _0x38b8f9=[_0xb275('0x56'),_0xb275('0x57'),_0xb275('0x58'),_0xb275('0x59')];var _0x46e5f2={'SUM':'SUM(%s)','COUNT':_0xb275('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb275('0x5b'),'MIN':_0xb275('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb275('0x5d'),'GROUP_CONCAT ASC':_0xb275('0x5e'),'GROUP_CONCAT DESC':_0xb275('0x5f')};var _0x23d1f1={'SEC_TO_TIME':_0xb275('0x60'),'DATE':'DATE(%s)','HOUR':_0xb275('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb275('0x62')};var _0x2c4283=function(_0x292570){return!_['includes']([_0xb275('0x63'),'IS\x20NOT\x20NULL',_0xb275('0x64'),_0xb275('0x65')],_0x292570);};var _0x1939dc=function(_0x423627){if(!_0x423627||!_0x423627[_0xb275('0x66')][_0xb275('0x3d')]){return'';}for(var _0x4a07d2='(',_0x50eb39=0x0;_0x50eb39<_0x423627[_0xb275('0x66')][_0xb275('0x3d')];_0x50eb39+=0x1){_0x50eb39>0x0&&(_0x4a07d2+='\x20'+_0x423627[_0xb275('0x67')]+'\x20');_0x4a07d2+=_0x423627[_0xb275('0x66')][_0x50eb39][_0xb275('0x68')]?_0x1939dc(_0x423627['rules'][_0x50eb39]['group']):_0x423627[_0xb275('0x66')][_0x50eb39][_0xb275('0x69')]+'\x20'+_0x423627[_0xb275('0x66')][_0x50eb39][_0xb275('0x6a')]+(_0x2c4283(_0x423627[_0xb275('0x66')][_0x50eb39][_0xb275('0x6a')])?'\x20'+_0x423627[_0xb275('0x66')][_0x50eb39]['value']:'');}return _0x4a07d2+')';};var _0x575a0a={'where':{'id':_0xa92d0d['params']['id']}},_0x5913a0,_0x108d96,_0x524d80,_0x40b7b7,_0x491037;_0x575a0a=_['merge']({},_0x575a0a,_0xa92d0d['options']);return db[_0xb275('0x31')][_0xb275('0x50')](_0x575a0a)[_0xb275('0x28')](function(_0x312bc5){if(_0x312bc5){_0x5913a0=_0x312bc5;return _0x312bc5[_0xb275('0x6b')]();}return null;})['then'](function(_0x49a33f){if(_0x49a33f){if(!_0x49a33f['length']){throw new db[(_0xb275('0x6c'))][(_0xb275('0x6d'))](_0xb275('0x6e'),0x193);}_0x108d96=_0x49a33f;return db[_0xb275('0x6f')][_0xb275('0x70')]({'raw':!![]});}return null;})[_0xb275('0x28')](function(_0x40a337){if(_0x40a337){_0x524d80=_[_0xb275('0x71')](_0x40a337,'id');var _0x4abd37;var _0x434462=squel[_0xb275('0x72')]();_0x434462[_0xb275('0x73')](_0x5913a0[_0xb275('0x74')]);for(var _0x1b54d0=0x0;_0x1b54d0<_0x108d96[_0xb275('0x3d')];_0x1b54d0+=0x1){_0x4abd37=_0x108d96[_0x1b54d0][_0xb275('0x75')]?_0x524d80[_0x108d96[_0x1b54d0]['MetricId']][_0xb275('0x76')]:_0x108d96[_0x1b54d0][_0xb275('0x69')];_0x4abd37=_0x108d96[_0x1b54d0]['function']?_[_0xb275('0x77')](_0x46e5f2[_0x108d96[_0x1b54d0]['function']],'%s',_0x4abd37):_0x4abd37;_0x4abd37=_0x108d96[_0x1b54d0][_0xb275('0x78')]?_[_0xb275('0x77')](_0x23d1f1[_0x108d96[_0x1b54d0][_0xb275('0x78')]],'%s',_0x4abd37):_0x4abd37;if(_0x108d96[_0x1b54d0][_0xb275('0x79')]){_0x434462[_0xb275('0x68')](_0x4abd37);}_0x108d96[_0x1b54d0][_0xb275('0x7a')]&&_0x434462[_0xb275('0x7b')](_0x4abd37,_0x108d96[_0x1b54d0][_0xb275('0x7a')]===_0xb275('0x7c')?![]:!![]);_0x434462[_0xb275('0x69')](_0x4abd37,_0x108d96[_0x1b54d0]['alias']||_0x4abd37);}if(_0x5913a0[_0xb275('0x7d')]){_0x5913a0['joins']=JSON[_0xb275('0x7e')](_0x5913a0[_0xb275('0x7d')]);for(var _0x32177c=0x0;_0x32177c<_0x5913a0[_0xb275('0x7d')][_0xb275('0x3d')];_0x32177c+=0x1){if(_0x5913a0[_0xb275('0x7d')][_0x32177c]['type']&&_[_0xb275('0x7f')](_0x38b8f9,_0x5913a0[_0xb275('0x7d')][_0x32177c]['type'])&&_0x5913a0[_0xb275('0x7d')][_0x32177c][_0xb275('0x80')]&&_0x5913a0[_0xb275('0x7d')][_0x32177c]['foreignTable']&&_0x5913a0[_0xb275('0x7d')][_0x32177c]['foreignKey']){_0x434462[_0x5913a0[_0xb275('0x7d')][_0x32177c][_0xb275('0x34')]](_0x5913a0[_0xb275('0x7d')][_0x32177c][_0xb275('0x81')],null,util['format'](_0xb275('0x82'),_0x5913a0[_0xb275('0x74')],_0x5913a0[_0xb275('0x7d')][_0x32177c]['parentKey'],_0x5913a0[_0xb275('0x7d')][_0x32177c][_0xb275('0x81')],_0x5913a0[_0xb275('0x7d')][_0x32177c][_0xb275('0x83')]));}}}if(_0x5913a0[_0xb275('0x84')]){_0x5913a0[_0xb275('0x84')]=JSON['parse'](_0x5913a0[_0xb275('0x84')]);_0x434462[_0xb275('0x41')](_0x1939dc(_0x5913a0[_0xb275('0x84')][_0xb275('0x68')]));}_0x491037=_0x434462[_0xb275('0x85')]();_0x434462[_0xb275('0x22')](_0x4f25f4);_0x434462['offset'](0x0);logger[_0xb275('0x86')](_0xb275('0x87'),_0x434462[_0xb275('0x88')]());return dbH[_0xb275('0x89')]['query'](_0x434462[_0xb275('0x88')](),{'type':dbH['sequelize'][_0xb275('0x8a')][_0xb275('0x8b')]});}})[_0xb275('0x28')](respondWithResult(_0x4d156c,null))['catch'](handleError(_0x4d156c,null));};function runReport(_0x3eeb42,_0x833581,_0x3154c4){var _0x15c25c=_0x833581[_0xb275('0x2e')];var _0xa6055e=0xa;var _0x576e54=[_0xb275('0x56'),_0xb275('0x57'),_0xb275('0x58'),_0xb275('0x59')];var _0x4bb2be={'SUM':'SUM(%s)','COUNT':_0xb275('0x5a'),'COUNT DISTINCT':_0xb275('0x8c'),'MAX':_0xb275('0x5b'),'MIN':_0xb275('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb275('0x5d'),'GROUP_CONCAT ASC':_0xb275('0x5e'),'GROUP_CONCAT DESC':_0xb275('0x5f')};var _0x23ed9d={'SEC_TO_TIME':_0xb275('0x60'),'DATE':_0xb275('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0xb275('0x8e'),'UNIX_TIMESTAMP':_0xb275('0x62')};var _0x445274=function(_0x41765c){return!_[_0xb275('0x7f')]([_0xb275('0x63'),_0xb275('0x8f'),_0xb275('0x64'),_0xb275('0x65')],_0x41765c);};var _0x310cbc=function(_0x25968c){if(!_0x25968c||!_0x25968c['rules']['length']){return'';}for(var _0x3e35ca='(',_0x4e7cb8=0x0;_0x4e7cb8<_0x25968c['rules'][_0xb275('0x3d')];_0x4e7cb8+=0x1){_0x4e7cb8>0x0&&(_0x3e35ca+='\x20'+_0x25968c[_0xb275('0x67')]+'\x20');_0x3e35ca+=_0x25968c[_0xb275('0x66')][_0x4e7cb8][_0xb275('0x68')]?_0x310cbc(_0x25968c['rules'][_0x4e7cb8][_0xb275('0x68')]):_0x25968c[_0xb275('0x66')][_0x4e7cb8][_0xb275('0x69')]+'\x20'+_0x25968c[_0xb275('0x66')][_0x4e7cb8][_0xb275('0x6a')]+(_0x445274(_0x25968c['rules'][_0x4e7cb8]['condition'])?'\x20'+_0x25968c[_0xb275('0x66')][_0x4e7cb8][_0xb275('0x90')]:'');}return _0x3e35ca+')';};var _0x400d73={'where':{'id':_0x3eeb42['id']}},_0x41a4e3,_0x43d7fe,_0x335cc3,_0x5e58fc,_0x3b7a67;_0x400d73=_['merge']({},_0x400d73,_0x3154c4);return db[_0xb275('0x31')][_0xb275('0x50')](_0x400d73)[_0xb275('0x28')](function(_0xfb7640){if(_0xfb7640){_0x41a4e3=_0xfb7640;return _0xfb7640[_0xb275('0x6b')]();}return null;})[_0xb275('0x28')](function(_0x25c169){if(_0x25c169){if(!_0x25c169[_0xb275('0x3d')]){throw new db['Sequelize']['ValidationErrorItem'](_0xb275('0x6e'),0x193);}_0x43d7fe=_0x25c169;return db[_0xb275('0x6f')][_0xb275('0x70')]({'raw':!![]});}return null;})[_0xb275('0x28')](function(_0x52231c){if(_0x52231c){_0x335cc3=_['keyBy'](_0x52231c,'id');var _0x1fe172;var _0x2f94bc=squel['select']();_0x2f94bc[_0xb275('0x73')](_0x41a4e3[_0xb275('0x74')]);for(var _0x5e17b2=0x0;_0x5e17b2<_0x43d7fe['length'];_0x5e17b2+=0x1){_0x1fe172=_0x43d7fe[_0x5e17b2][_0xb275('0x75')]?_0x335cc3[_0x43d7fe[_0x5e17b2][_0xb275('0x75')]][_0xb275('0x76')]:_0x43d7fe[_0x5e17b2][_0xb275('0x69')];_0x1fe172=_0x43d7fe[_0x5e17b2][_0xb275('0x91')]?_[_0xb275('0x77')](_0x4bb2be[_0x43d7fe[_0x5e17b2][_0xb275('0x91')]],'%s',_0x1fe172):_0x1fe172;_0x1fe172=_0x43d7fe[_0x5e17b2]['format']?_[_0xb275('0x77')](_0x23ed9d[_0x43d7fe[_0x5e17b2]['format']],'%s',_0x1fe172):_0x1fe172;if(_0x43d7fe[_0x5e17b2][_0xb275('0x79')]){_0x2f94bc[_0xb275('0x68')](_0x1fe172);}_0x43d7fe[_0x5e17b2][_0xb275('0x7a')]&&_0x2f94bc[_0xb275('0x7b')](_0x1fe172,_0x43d7fe[_0x5e17b2]['orderBy']===_0xb275('0x7c')?![]:!![]);_0x2f94bc[_0xb275('0x69')](_0x1fe172,_0x43d7fe[_0x5e17b2]['alias']||_0x1fe172);}if(_0x41a4e3[_0xb275('0x7d')]){_0x41a4e3[_0xb275('0x7d')]=JSON[_0xb275('0x7e')](_0x41a4e3[_0xb275('0x7d')]);for(var _0xaa5d2d=0x0;_0xaa5d2d<_0x41a4e3[_0xb275('0x7d')][_0xb275('0x3d')];_0xaa5d2d+=0x1){if(_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x34')]&&_[_0xb275('0x7f')](_0x576e54,_0x41a4e3['joins'][_0xaa5d2d]['type'])&&_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x80')]&&_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d]['foreignTable']&&_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x83')]){_0x2f94bc[_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x34')]](_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x81')],null,util[_0xb275('0x78')]('%s.%s\x20=\x20%s.%s',_0x41a4e3[_0xb275('0x74')],_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x80')],_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d][_0xb275('0x81')],_0x41a4e3[_0xb275('0x7d')][_0xaa5d2d]['foreignKey']));}}}if(_0x41a4e3[_0xb275('0x84')]){_0x41a4e3[_0xb275('0x84')]=JSON['parse'](_0x41a4e3[_0xb275('0x84')]);_0x2f94bc['where'](_0x310cbc(_0x41a4e3['conditions'][_0xb275('0x68')]));}_0x3b7a67=_0x2f94bc['clone']();_0x2f94bc['limit'](_0xa6055e);_0x2f94bc[_0xb275('0x20')](0x0);return;}})['then'](function(){if(_0x833581['output']===_0xb275('0x92')){return null;}var _0x254f1e=_['merge'](_0x833581,{'name':_0x833581[_0xb275('0x93')]||_0x833581[_0xb275('0x2e')]||_0x41a4e3[_0xb275('0x2e')],'basename':_0x15c25c,'savename':util[_0xb275('0x78')](_0xb275('0x94'),_0x833581[_0xb275('0x2e')]||_0x41a4e3[_0xb275('0x2e')],require(_0xb275('0x95'))[_0xb275('0x96')](0x4),_0x833581[_0xb275('0x97')]||'csv'),'reportId':_0x41a4e3['id'],'reportType':'custom'});return db[_0xb275('0x98')][_0xb275('0x49')](_0x254f1e,{'raw':!![]});})['then'](function(_0x1c4211){if(_0x41a4e3[_0xb275('0x74')]==='cdr'){_0x3b7a67[_0xb275('0x41')](_0x41a4e3[_0xb275('0x74')]+_0xb275('0x99'),_0x833581[_0xb275('0x9a')],_0x833581[_0xb275('0x9b')]);}else{_0x3b7a67[_0xb275('0x41')](_0x41a4e3[_0xb275('0x74')]+_0xb275('0x9c'),_0x833581['startDate'],_0x833581[_0xb275('0x9b')]);}if(_0x1c4211){logger[_0xb275('0x9d')](_0xb275('0x9e'),_0x3b7a67[_0xb275('0x88')]());require(_0xb275('0x9f'))[_0xb275('0xa0')](path[_0xb275('0x56')](__dirname,'../../components/export/',_0x1c4211['output']),[_0x1c4211['id'],_0x3b7a67['toString'](),path['join'](__dirname,'../../files/reports',_0x1c4211['savename']),_0x15c25c]);return _0x1c4211;}else{var _0x537c13=squel['select']();_0x537c13[_0xb275('0x73')]('('+_0x3b7a67[_0xb275('0x88')]()+')','countTable');_0x537c13['field'](_0xb275('0xa1'),'count');_0x3b7a67[_0xb275('0x22')](_0x833581[_0xb275('0x22')]||_0xa6055e);_0x3b7a67[_0xb275('0x20')](_0x833581[_0xb275('0x20')]||0x0);return dbH['sequelize'][_0xb275('0x37')](_0x537c13[_0xb275('0x88')](),{'type':dbH[_0xb275('0x89')][_0xb275('0x8a')][_0xb275('0x8b')]})['then'](function(_0x10b427){if(!_0x10b427['length']){_0x5e58fc=0x0;}else{_0x5e58fc=_0x10b427[0x0][_0xb275('0x23')]||0x0;}return dbH[_0xb275('0x89')][_0xb275('0x37')](_0x3b7a67[_0xb275('0x88')](),{'type':dbH[_0xb275('0x89')][_0xb275('0x8a')][_0xb275('0x8b')]});})['then'](function(_0x1cdb59){return{'rows':_0x1cdb59||[],'count':_0x5e58fc};});}});}exports[_0xb275('0xa2')]=function(_0x33b45c,_0x55ebce){return runReport(_0x33b45c['params'],_0x33b45c[_0xb275('0x37')],_0x33b45c[_0xb275('0x43')])[_0xb275('0x28')](respondWithResult(_0x55ebce,null))[_0xb275('0x47')](handleError(_0x55ebce,null));};exports[_0xb275('0xa3')]=runReport;exports['query']=function(_0x4fa7d3,_0x3fa985){var _0x1ef908=0xa;var _0x1e0717=[_0xb275('0x56'),_0xb275('0x57'),_0xb275('0x58'),'cross_join'];var _0x4bd0e0={'SUM':'SUM(%s)','COUNT':_0xb275('0x5a'),'COUNT DISTINCT':_0xb275('0x8c'),'MAX':_0xb275('0x5b'),'MIN':'MIN(%s)','AVG':_0xb275('0xa4'),'GROUP_CONCAT':_0xb275('0x5d'),'GROUP_CONCAT ASC':_0xb275('0x5e'),'GROUP_CONCAT DESC':_0xb275('0x5f')};var _0x510292={'SEC_TO_TIME':_0xb275('0x60'),'DATE':_0xb275('0x8d'),'HOUR':_0xb275('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb275('0x62')};var _0x4977e6=function(_0x4035ff){return!_['includes']([_0xb275('0x63'),_0xb275('0x8f'),_0xb275('0x64'),_0xb275('0x65')],_0x4035ff);};var _0x322a73=function(_0x516bab){if(!_0x516bab||!_0x516bab['rules'][_0xb275('0x3d')]){return'';}for(var _0x1ad869='(',_0x12603b=0x0;_0x12603b<_0x516bab['rules']['length'];_0x12603b+=0x1){_0x12603b>0x0&&(_0x1ad869+='\x20'+_0x516bab[_0xb275('0x67')]+'\x20');_0x1ad869+=_0x516bab['rules'][_0x12603b][_0xb275('0x68')]?_0x322a73(_0x516bab['rules'][_0x12603b][_0xb275('0x68')]):_0x516bab[_0xb275('0x66')][_0x12603b][_0xb275('0x69')]+'\x20'+_0x516bab['rules'][_0x12603b][_0xb275('0x6a')]+(_0x4977e6(_0x516bab['rules'][_0x12603b][_0xb275('0x6a')])?'\x20'+_0x516bab[_0xb275('0x66')][_0x12603b][_0xb275('0x90')]:'');}return _0x1ad869+')';};var _0x2d3dd5={'where':{'id':_0x4fa7d3[_0xb275('0x48')]['id']}},_0x5bf7d0,_0x556324,_0x1b9d68,_0x5c9e36,_0x29bc91;_0x2d3dd5=_['merge']({},_0x2d3dd5,_0x4fa7d3[_0xb275('0x43')]);return db[_0xb275('0x31')][_0xb275('0x50')](_0x2d3dd5)['then'](function(_0x32d3ad){if(_0x32d3ad){_0x5bf7d0=_0x32d3ad;return _0x32d3ad['getFields']();}return null;})['then'](function(_0x5bcb3a){if(_0x5bcb3a){if(!_0x5bcb3a['length']){throw new db['Sequelize'][(_0xb275('0x6d'))](_0xb275('0x6e'),0x193);}_0x556324=_0x5bcb3a;return db['AnalyticMetric'][_0xb275('0x70')]({'raw':!![]});}return null;})[_0xb275('0x28')](function(_0x51b43b){if(_0x51b43b){_0x1b9d68=_[_0xb275('0x71')](_0x51b43b,'id');var _0x1d2a1b;var _0x3ec3e0=squel[_0xb275('0x72')]();_0x3ec3e0['from'](_0x5bf7d0[_0xb275('0x74')]);for(var _0x383b3b=0x0;_0x383b3b<_0x556324[_0xb275('0x3d')];_0x383b3b+=0x1){_0x1d2a1b=_0x556324[_0x383b3b]['MetricId']?_0x1b9d68[_0x556324[_0x383b3b]['MetricId']][_0xb275('0x76')]:_0x556324[_0x383b3b]['field'];_0x1d2a1b=_0x556324[_0x383b3b][_0xb275('0x91')]?_[_0xb275('0x77')](_0x4bd0e0[_0x556324[_0x383b3b]['function']],'%s',_0x1d2a1b):_0x1d2a1b;_0x1d2a1b=_0x556324[_0x383b3b][_0xb275('0x78')]?_[_0xb275('0x77')](_0x510292[_0x556324[_0x383b3b][_0xb275('0x78')]],'%s',_0x1d2a1b):_0x1d2a1b;if(_0x556324[_0x383b3b][_0xb275('0x79')]){_0x3ec3e0['group'](_0x1d2a1b);}_0x556324[_0x383b3b][_0xb275('0x7a')]&&_0x3ec3e0[_0xb275('0x7b')](_0x1d2a1b,_0x556324[_0x383b3b][_0xb275('0x7a')]==='DESC'?![]:!![]);_0x3ec3e0[_0xb275('0x69')](_0x1d2a1b,_0x556324[_0x383b3b]['alias']||_0x1d2a1b);}if(_0x5bf7d0[_0xb275('0x7d')]){_0x5bf7d0['joins']=JSON['parse'](_0x5bf7d0[_0xb275('0x7d')]);for(var _0x59332c=0x0;_0x59332c<_0x5bf7d0[_0xb275('0x7d')][_0xb275('0x3d')];_0x59332c+=0x1){if(_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x34')]&&_[_0xb275('0x7f')](_0x1e0717,_0x5bf7d0[_0xb275('0x7d')][_0x59332c]['type'])&&_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x80')]&&_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x81')]&&_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x83')]){_0x3ec3e0[_0x5bf7d0['joins'][_0x59332c]['type']](_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x81')],null,util[_0xb275('0x78')](_0xb275('0x82'),_0x5bf7d0[_0xb275('0x74')],_0x5bf7d0[_0xb275('0x7d')][_0x59332c][_0xb275('0x80')],_0x5bf7d0['joins'][_0x59332c][_0xb275('0x81')],_0x5bf7d0[_0xb275('0x7d')][_0x59332c]['foreignKey']));}}}if(_0x5bf7d0[_0xb275('0x84')]){_0x5bf7d0['conditions']=JSON[_0xb275('0x7e')](_0x5bf7d0[_0xb275('0x84')]);_0x3ec3e0[_0xb275('0x41')](_0x322a73(_0x5bf7d0[_0xb275('0x84')][_0xb275('0x68')]));}_0x29bc91=_0x3ec3e0[_0xb275('0x85')]();_0x3ec3e0['limit'](_0x1ef908);_0x3ec3e0[_0xb275('0x20')](0x0);logger[_0xb275('0x86')]('Limited\x20Query:',_0x3ec3e0['toString']());return dbH[_0xb275('0x89')][_0xb275('0x37')](_0x3ec3e0['toString'](),{'type':dbH[_0xb275('0x89')][_0xb275('0x8a')][_0xb275('0x8b')]});}})[_0xb275('0x28')](function(){return{'sql':_0x29bc91[_0xb275('0x88')]()};})['then'](respondWithResult(_0x3fa985,null))[_0xb275('0x47')](handleError(_0x3fa985,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index e05cd4d..40f2754 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 _0xe91d=['../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xe91d,0x1b4));var _0xde91=function(_0x14dfd6,_0x392fa4){_0x14dfd6=_0x14dfd6-0x0;var _0x36c19a=_0xe91d[_0x14dfd6];return _0x36c19a;};'use strict';var _=require(_0xde91('0x0'));var util=require(_0xde91('0x1'));var logger=require(_0xde91('0x2'))('api');var moment=require(_0xde91('0x3'));var BPromise=require(_0xde91('0x4'));var rp=require(_0xde91('0x5'));var fs=require('fs');var path=require(_0xde91('0x6'));var rimraf=require(_0xde91('0x7'));var config=require(_0xde91('0x8'));var attributes=require(_0xde91('0x9'));module['exports']=function(_0x3b2996,_0x2221e5){return _0x3b2996['define'](_0xde91('0xa'),attributes,{'tableName':_0xde91('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6820=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x3b5e9d,_0x5970dc){var _0x44681d=function(_0x306697){while(--_0x306697){_0x3b5e9d['push'](_0x3b5e9d['shift']());}};_0x44681d(++_0x5970dc);}(_0x6820,0x177));var _0x0682=function(_0x57e8d7,_0x5ba3e0){_0x57e8d7=_0x57e8d7-0x0;var _0x527e11=_0x6820[_0x57e8d7];return _0x527e11;};'use strict';var _=require(_0x0682('0x0'));var util=require(_0x0682('0x1'));var logger=require(_0x0682('0x2'))(_0x0682('0x3'));var moment=require(_0x0682('0x4'));var BPromise=require(_0x0682('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0682('0x6'));var rimraf=require(_0x0682('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x0682('0x8')]=function(_0x22092d,_0x2d62e2){return _0x22092d[_0x0682('0x9')](_0x0682('0xa'),attributes,{'tableName':_0x0682('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 a759c65..d15ce4d 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 _0x3c57=['../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3cf1e1,_0x52b3a0){var _0x366993=function(_0x6eeec3){while(--_0x6eeec3){_0x3cf1e1['push'](_0x3cf1e1['shift']());}};_0x366993(++_0x52b3a0);}(_0x3c57,0x18a));var _0x73c5=function(_0x2a1e64,_0x575a12){_0x2a1e64=_0x2a1e64-0x0;var _0x1c44bf=_0x3c57[_0x2a1e64];return _0x1c44bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73c5('0x0'));var BPromise=require(_0x73c5('0x1'));var rs=require(_0x73c5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x73c5('0x3'));var logger=require(_0x73c5('0x4'))(_0x73c5('0x5'));var config=require(_0x73c5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x73c5('0x7')][_0x73c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa17c58,_0x20efda,_0x4fda92){return new BPromise(function(_0x4d7ad6,_0x4972db){return client['request'](_0xa17c58,_0x4fda92)[_0x73c5('0x9')](function(_0x3e7381){logger[_0x73c5('0xa')](_0x73c5('0xb'),_0x20efda,_0x73c5('0xc'));logger[_0x73c5('0xd')](_0x73c5('0xe'),_0x20efda,'request\x20sent',JSON[_0x73c5('0xf')](_0x3e7381));if(_0x3e7381[_0x73c5('0x10')]){if(_0x3e7381['error']['code']===0x1f4){logger[_0x73c5('0x10')](_0x73c5('0xb'),_0x20efda,_0x3e7381[_0x73c5('0x10')][_0x73c5('0x11')]);return _0x4972db(_0x3e7381[_0x73c5('0x10')][_0x73c5('0x11')]);}logger[_0x73c5('0x10')](_0x73c5('0xb'),_0x20efda,_0x3e7381['error'][_0x73c5('0x11')]);return _0x4d7ad6(_0x3e7381[_0x73c5('0x10')][_0x73c5('0x11')]);}else{logger['info'](_0x73c5('0xb'),_0x20efda,_0x73c5('0xc'));_0x4d7ad6(_0x3e7381[_0x73c5('0x12')][_0x73c5('0x11')]);}})[_0x73c5('0x13')](function(_0x492ffb){logger[_0x73c5('0x10')](_0x73c5('0xb'),_0x20efda,_0x492ffb);_0x4972db(_0x492ffb);});});} \ No newline at end of file +var _0x2469=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result'];(function(_0x214214,_0x469594){var _0x11df66=function(_0x2ee39b){while(--_0x2ee39b){_0x214214['push'](_0x214214['shift']());}};_0x11df66(++_0x469594);}(_0x2469,0x1a2));var _0x9246=function(_0xeca329,_0x59b998){_0xeca329=_0xeca329-0x0;var _0x395c5f=_0x2469[_0xeca329];return _0x395c5f;};'use strict';var _=require(_0x9246('0x0'));var util=require(_0x9246('0x1'));var moment=require('moment');var BPromise=require(_0x9246('0x2'));var rs=require(_0x9246('0x3'));var fs=require('fs');var Redis=require(_0x9246('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9246('0x5'));var logger=require(_0x9246('0x6'))(_0x9246('0x7'));var config=require(_0x9246('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9246('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1730c2,_0x226a22,_0xa9990f){return new BPromise(function(_0x54d31d,_0x39e0fe){return client[_0x9246('0xa')](_0x1730c2,_0xa9990f)[_0x9246('0xb')](function(_0xf1cb8d){logger['info'](_0x9246('0xc'),_0x226a22,'request\x20sent');logger[_0x9246('0xd')](_0x9246('0xe'),_0x226a22,_0x9246('0xf'),JSON[_0x9246('0x10')](_0xf1cb8d));if(_0xf1cb8d['error']){if(_0xf1cb8d['error'][_0x9246('0x11')]===0x1f4){logger[_0x9246('0x12')](_0x9246('0xc'),_0x226a22,_0xf1cb8d['error'][_0x9246('0x13')]);return _0x39e0fe(_0xf1cb8d[_0x9246('0x12')]['message']);}logger[_0x9246('0x12')](_0x9246('0xc'),_0x226a22,_0xf1cb8d[_0x9246('0x12')]['message']);return _0x54d31d(_0xf1cb8d[_0x9246('0x12')]['message']);}else{logger[_0x9246('0x14')](_0x9246('0xc'),_0x226a22,_0x9246('0xf'));_0x54d31d(_0xf1cb8d[_0x9246('0x15')][_0x9246('0x13')]);}})['catch'](function(_0x35b91d){logger['error'](_0x9246('0xc'),_0x226a22,_0x35b91d);_0x39e0fe(_0x35b91d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 8cb0098..8ca0a2c 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 _0xf686=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xf686,0x123));var _0x6f68=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf686[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6f68('0x0'));var util=require('util');var path=require(_0x6f68('0x1'));var timeout=require(_0x6f68('0x2'));var express=require(_0x6f68('0x3'));var router=express[_0x6f68('0x4')]();var fs_extra=require(_0x6f68('0x5'));var auth=require(_0x6f68('0x6'));var interaction=require(_0x6f68('0x7'));var config=require(_0x6f68('0x8'));var controller=require(_0x6f68('0x9'));router[_0x6f68('0xa')]('/',auth['isAuthenticated'](),controller[_0x6f68('0xb')]);router[_0x6f68('0xa')](_0x6f68('0xc'),auth[_0x6f68('0xd')](),controller[_0x6f68('0xe')]);router[_0x6f68('0xa')](_0x6f68('0xf'),auth['isAuthenticated'](),controller[_0x6f68('0x10')]);router[_0x6f68('0xa')](_0x6f68('0x11'),auth['isAuthenticated'](),controller[_0x6f68('0x12')]);router[_0x6f68('0xa')](_0x6f68('0x13'),auth[_0x6f68('0xd')](),controller[_0x6f68('0x14')]);router[_0x6f68('0x15')]('/',auth[_0x6f68('0xd')](),controller[_0x6f68('0x16')]);router['put']('/:id',auth[_0x6f68('0xd')](),controller[_0x6f68('0x17')]);router[_0x6f68('0x18')](_0x6f68('0xc'),auth['isAuthenticated'](),controller[_0x6f68('0x19')]);module[_0x6f68('0x1a')]=router; \ No newline at end of file +var _0x6164=['get','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x1ea682,_0x70bf1d){var _0x27fc4b=function(_0x3c0ebb){while(--_0x3c0ebb){_0x1ea682['push'](_0x1ea682['shift']());}};_0x27fc4b(++_0x70bf1d);}(_0x6164,0xd6));var _0x4616=function(_0x156b03,_0x238b09){_0x156b03=_0x156b03-0x0;var _0x302cc5=_0x6164[_0x156b03];return _0x302cc5;};'use strict';var multer=require('multer');var util=require(_0x4616('0x0'));var path=require(_0x4616('0x1'));var timeout=require(_0x4616('0x2'));var express=require(_0x4616('0x3'));var router=express[_0x4616('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4616('0x5'));var interaction=require(_0x4616('0x6'));var config=require(_0x4616('0x7'));var controller=require(_0x4616('0x8'));router['get']('/',auth[_0x4616('0x9')](),controller[_0x4616('0xa')]);router[_0x4616('0xb')](_0x4616('0xc'),auth[_0x4616('0x9')](),controller['show']);router[_0x4616('0xb')](_0x4616('0xd'),auth['isAuthenticated'](),controller[_0x4616('0xe')]);router[_0x4616('0xb')](_0x4616('0xf'),auth[_0x4616('0x9')](),controller[_0x4616('0x10')]);router[_0x4616('0xb')](_0x4616('0x11'),auth[_0x4616('0x9')](),controller[_0x4616('0x12')]);router[_0x4616('0x13')]('/',auth[_0x4616('0x9')](),controller[_0x4616('0x14')]);router[_0x4616('0x15')]('/:id',auth[_0x4616('0x9')](),controller[_0x4616('0x16')]);router[_0x4616('0x17')](_0x4616('0xc'),auth[_0x4616('0x9')](),controller['destroy']);module[_0x4616('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ed15ebb..c9d1a97 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x2b79f4,_0x50d267){var _0x111a9c=function(_0x60b635){while(--_0x60b635){_0x2b79f4['push'](_0x2b79f4['shift']());}};_0x111a9c(++_0x50d267);}(_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')]={'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 +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x2675,0x75));var _0x5267=function(_0x460386,_0x553ec4){_0x460386=_0x460386-0x0;var _0x326666=_0x2675[_0x460386];return _0x326666;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e29537b..01b441f 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3c8893,_0x3bb73e){var _0x3f9f4b=function(_0x427a21){while(--_0x427a21){_0x3c8893['push'](_0x3c8893['shift']());}};_0x3f9f4b(++_0x3bb73e);}(_0x53ec,0x192));var _0xc53e=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0x53ec[_0xd93cbe];return _0xe0bb40;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file +var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x4a858b,_0x270c1c){var _0x5ae6a0=function(_0x38f9dc){while(--_0x38f9dc){_0x4a858b['push'](_0x4a858b['shift']());}};_0x5ae6a0(++_0x270c1c);}(_0x4819,0xcd));var _0x9481=function(_0x5cbab1,_0x32afac){_0x5cbab1=_0x5cbab1-0x0;var _0x2637f4=_0x4819[_0x5cbab1];return _0x2637f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3dfbba1..cc03c2a 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 _0x599f=['rimraf','../../config/environment','./analyticDefaultReport.attributes','../../config/logger','api','request-promise','path'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x599f,0x65));var _0xf599=function(_0x3c257f,_0x6d7dfd){_0x3c257f=_0x3c257f-0x0;var _0xc8098=_0x599f[_0x3c257f];return _0xc8098;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf599('0x0'))(_0xf599('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf599('0x2'));var fs=require('fs');var path=require(_0xf599('0x3'));var rimraf=require(_0xf599('0x4'));var config=require(_0xf599('0x5'));var attributes=require(_0xf599('0x6'));module['exports']=function(_0x3bf820,_0x352f44){return _0x3bf820['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeba9=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x4c2808,_0x2ddffe){var _0x45d22c=function(_0x5cfdbb){while(--_0x5cfdbb){_0x4c2808['push'](_0x4c2808['shift']());}};_0x45d22c(++_0x2ddffe);}(_0xeba9,0x15c));var _0x9eba=function(_0x52a5a5,_0x138112){_0x52a5a5=_0x52a5a5-0x0;var _0x39db45=_0xeba9[_0x52a5a5];return _0x39db45;};'use strict';var _=require(_0x9eba('0x0'));var util=require(_0x9eba('0x1'));var logger=require('../../config/logger')(_0x9eba('0x2'));var moment=require('moment');var BPromise=require(_0x9eba('0x3'));var rp=require(_0x9eba('0x4'));var fs=require('fs');var path=require(_0x9eba('0x5'));var rimraf=require(_0x9eba('0x6'));var config=require(_0x9eba('0x7'));var attributes=require(_0x9eba('0x8'));module[_0x9eba('0x9')]=function(_0x3300e9,_0x743f69){return _0x3300e9[_0x9eba('0xa')](_0x9eba('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 3d50450..c86d281 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 _0x7fcb=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\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','http','request','info'];(function(_0x2c6717,_0x240ba5){var _0x5395f6=function(_0x4184c5){while(--_0x4184c5){_0x2c6717['push'](_0x2c6717['shift']());}};_0x5395f6(++_0x240ba5);}(_0x7fcb,0x1b9));var _0xb7fc=function(_0x4e58e3,_0x9c4995){_0x4e58e3=_0x4e58e3-0x0;var _0x11927a=_0x7fcb[_0x4e58e3];return _0x11927a;};'use strict';var _=require(_0xb7fc('0x0'));var util=require(_0xb7fc('0x1'));var moment=require(_0xb7fc('0x2'));var BPromise=require(_0xb7fc('0x3'));var rs=require(_0xb7fc('0x4'));var fs=require('fs');var Redis=require(_0xb7fc('0x5'));var db=require(_0xb7fc('0x6'))['db'];var utils=require(_0xb7fc('0x7'));var logger=require(_0xb7fc('0x8'))(_0xb7fc('0x9'));var config=require(_0xb7fc('0xa'));var jayson=require(_0xb7fc('0xb'));var client=jayson['client'][_0xb7fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f66c5,_0x5e67e9,_0x2cdf80){return new BPromise(function(_0x21bd7a,_0xce63e4){return client[_0xb7fc('0xd')](_0x3f66c5,_0x2cdf80)['then'](function(_0x2d2d61){logger[_0xb7fc('0xe')](_0xb7fc('0xf'),_0x5e67e9,_0xb7fc('0x10'));logger['debug'](_0xb7fc('0x11'),_0x5e67e9,_0xb7fc('0x10'),JSON[_0xb7fc('0x12')](_0x2d2d61));if(_0x2d2d61['error']){if(_0x2d2d61[_0xb7fc('0x13')][_0xb7fc('0x14')]===0x1f4){logger[_0xb7fc('0x13')](_0xb7fc('0xf'),_0x5e67e9,_0x2d2d61[_0xb7fc('0x13')][_0xb7fc('0x15')]);return _0xce63e4(_0x2d2d61[_0xb7fc('0x13')]['message']);}logger[_0xb7fc('0x13')](_0xb7fc('0xf'),_0x5e67e9,_0x2d2d61[_0xb7fc('0x13')][_0xb7fc('0x15')]);return _0x21bd7a(_0x2d2d61[_0xb7fc('0x13')][_0xb7fc('0x15')]);}else{logger[_0xb7fc('0xe')](_0xb7fc('0xf'),_0x5e67e9,_0xb7fc('0x10'));_0x21bd7a(_0x2d2d61[_0xb7fc('0x16')][_0xb7fc('0x15')]);}})[_0xb7fc('0x17')](function(_0x9307d2){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e67e9,_0x9307d2);_0xce63e4(_0x9307d2);});});} \ No newline at end of file +var _0x2995=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3ea7f7,_0x58d463){var _0x36831a=function(_0x7dad2){while(--_0x7dad2){_0x3ea7f7['push'](_0x3ea7f7['shift']());}};_0x36831a(++_0x58d463);}(_0x2995,0x1df));var _0x5299=function(_0x542bf5,_0x1e6222){_0x542bf5=_0x542bf5-0x0;var _0x5e1a14=_0x2995[_0x542bf5];return _0x5e1a14;};'use strict';var _=require(_0x5299('0x0'));var util=require('util');var moment=require(_0x5299('0x1'));var BPromise=require(_0x5299('0x2'));var rs=require(_0x5299('0x3'));var fs=require('fs');var Redis=require(_0x5299('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5299('0x5'))(_0x5299('0x6'));var config=require('../../config/environment');var jayson=require(_0x5299('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe0dc63,_0x993442,_0x18aa1b){return new BPromise(function(_0x58836c,_0x330345){return client['request'](_0xe0dc63,_0x18aa1b)['then'](function(_0x4e3838){logger[_0x5299('0x8')](_0x5299('0x9'),_0x993442,_0x5299('0xa'));logger[_0x5299('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x993442,_0x5299('0xa'),JSON[_0x5299('0xc')](_0x4e3838));if(_0x4e3838['error']){if(_0x4e3838['error']['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x993442,_0x4e3838[_0x5299('0xd')]['message']);return _0x330345(_0x4e3838[_0x5299('0xd')][_0x5299('0xe')]);}logger['error'](_0x5299('0x9'),_0x993442,_0x4e3838[_0x5299('0xd')][_0x5299('0xe')]);return _0x58836c(_0x4e3838[_0x5299('0xd')]['message']);}else{logger[_0x5299('0x8')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x993442,'request\x20sent');_0x58836c(_0x4e3838[_0x5299('0xf')][_0x5299('0xe')]);}})[_0x5299('0x10')](function(_0x5b990e){logger[_0x5299('0xd')](_0x5299('0x9'),_0x993442,_0x5b990e);_0x330345(_0x5b990e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2bc59ec..e620b45 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 _0x6fb2=['index','/:id','/:id/preview','preview','/:id/run','run','query','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x2659b3,_0x1bbcd5){var _0x29ab72=function(_0x203d1f){while(--_0x203d1f){_0x2659b3['push'](_0x2659b3['shift']());}};_0x29ab72(++_0x1bbcd5);}(_0x6fb2,0x1ef));var _0x26fb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6fb2[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x26fb('0x0'));var util=require(_0x26fb('0x1'));var path=require(_0x26fb('0x2'));var timeout=require(_0x26fb('0x3'));var express=require('express');var router=express[_0x26fb('0x4')]();var fs_extra=require(_0x26fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x26fb('0x6'));var config=require(_0x26fb('0x7'));var controller=require(_0x26fb('0x8'));router[_0x26fb('0x9')]('/',auth[_0x26fb('0xa')](),controller[_0x26fb('0xb')]);router['get'](_0x26fb('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x26fb('0x9')](_0x26fb('0xd'),auth[_0x26fb('0xa')](),controller[_0x26fb('0xe')]);router[_0x26fb('0x9')](_0x26fb('0xf'),auth[_0x26fb('0xa')](),controller[_0x26fb('0x10')]);router[_0x26fb('0x9')]('/:id/query',auth[_0x26fb('0xa')](),controller[_0x26fb('0x11')]);router[_0x26fb('0x12')]('/',auth['isAuthenticated'](),controller[_0x26fb('0x13')]);router[_0x26fb('0x14')](_0x26fb('0xc'),auth[_0x26fb('0xa')](),controller['update']);router[_0x26fb('0x15')](_0x26fb('0xc'),auth[_0x26fb('0xa')](),controller[_0x26fb('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc311=['isAuthenticated','index','get','/:id','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2f2d62,_0x8ea173){var _0x3987c8=function(_0x2e3f7c){while(--_0x2e3f7c){_0x2f2d62['push'](_0x2f2d62['shift']());}};_0x3987c8(++_0x8ea173);}(_0xc311,0x1a0));var _0x1c31=function(_0x44ae49,_0x1d00b4){_0x44ae49=_0x44ae49-0x0;var _0x476a6a=_0xc311[_0x44ae49];return _0x476a6a;};'use strict';var multer=require(_0x1c31('0x0'));var util=require(_0x1c31('0x1'));var path=require(_0x1c31('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c31('0x3')]();var fs_extra=require(_0x1c31('0x4'));var auth=require(_0x1c31('0x5'));var interaction=require(_0x1c31('0x6'));var config=require(_0x1c31('0x7'));var controller=require(_0x1c31('0x8'));router['get']('/',auth[_0x1c31('0x9')](),controller[_0x1c31('0xa')]);router[_0x1c31('0xb')](_0x1c31('0xc'),auth[_0x1c31('0x9')](),controller['show']);router[_0x1c31('0xb')](_0x1c31('0xd'),auth[_0x1c31('0x9')](),controller[_0x1c31('0xe')]);router[_0x1c31('0xb')]('/:id/run',auth['isAuthenticated'](),controller[_0x1c31('0xf')]);router[_0x1c31('0xb')](_0x1c31('0x10'),auth['isAuthenticated'](),controller[_0x1c31('0x11')]);router[_0x1c31('0x12')]('/',auth[_0x1c31('0x9')](),controller[_0x1c31('0x13')]);router[_0x1c31('0x14')](_0x1c31('0xc'),auth[_0x1c31('0x9')](),controller[_0x1c31('0x15')]);router[_0x1c31('0x16')](_0x1c31('0xc'),auth['isAuthenticated'](),controller[_0x1c31('0x17')]);module[_0x1c31('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 35b9531..1c451ca 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 _0xe44c=['ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx','DATE','Loading'];(function(_0x50c3fd,_0x5c7478){var _0x6ac237=function(_0x1ebc17){while(--_0x1ebc17){_0x50c3fd['push'](_0x50c3fd['shift']());}};_0x6ac237(++_0x5c7478);}(_0xe44c,0x157));var _0xce44=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0xe44c[_0x1a37e3];return _0x4db78a;};'use strict';var Sequelize=require(_0xce44('0x0'));var moment=require('moment');module[_0xce44('0x1')]={'name':{'type':Sequelize[_0xce44('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xce44('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xce44('0x3'),_0xce44('0x4'),_0xce44('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xce44('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xce44('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xce44('0x7')},'type':{'type':Sequelize[_0xce44('0x8')](_0xce44('0x9'),_0xce44('0xa')),'allowNull':![],'defaultValue':_0xce44('0x9')},'reportId':{'type':Sequelize[_0xce44('0xb')](0xb)[_0xce44('0xc')]},'reportType':{'type':Sequelize[_0xce44('0x2')]}}; \ No newline at end of file +var _0xab9d=['csv','xlsx','DATE','Loading','manual','scheduled','sequelize','moment','exports','STRING','ENUM'];(function(_0x432987,_0x5b96a2){var _0x47ce4a=function(_0x1af2f7){while(--_0x1af2f7){_0x432987['push'](_0x432987['shift']());}};_0x47ce4a(++_0x5b96a2);}(_0xab9d,0x1df));var _0xdab9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xab9d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xdab9('0x0'));var moment=require(_0xdab9('0x1'));module[_0xdab9('0x2')]={'name':{'type':Sequelize[_0xdab9('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xdab9('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xdab9('0x4')](_0xdab9('0x5'),'pdf',_0xdab9('0x6')),'allowNull':![],'defaultValue':_0xdab9('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xdab9('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xdab9('0x3')],'defaultValue':_0xdab9('0x8')},'type':{'type':Sequelize['ENUM'](_0xdab9('0x9'),_0xdab9('0xa')),'allowNull':![],'defaultValue':_0xdab9('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8626176..8f5a599 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 _0xaead=['savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','show','params','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','body','download','basename','output','join','server/files/reports'];(function(_0xa7d678,_0x3dfdff){var _0x5cc539=function(_0x4393d7){while(--_0x4393d7){_0xa7d678['push'](_0xa7d678['shift']());}};_0x5cc539(++_0x3dfdff);}(_0xaead,0x69));var _0xdaea=function(_0x431bf0,_0x223e9d){_0x431bf0=_0x431bf0-0x0;var _0x2818a7=_0xaead[_0x431bf0];return _0x2818a7;};'use strict';var emlformat=require(_0xdaea('0x0'));var rimraf=require(_0xdaea('0x1'));var zipdir=require(_0xdaea('0x2'));var jsonpatch=require(_0xdaea('0x3'));var rp=require(_0xdaea('0x4'));var moment=require(_0xdaea('0x5'));var BPromise=require(_0xdaea('0x6'));var Mustache=require(_0xdaea('0x7'));var util=require(_0xdaea('0x8'));var path=require(_0xdaea('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdaea('0xa'));var fs=require('fs');var fs_extra=require(_0xdaea('0xb'));var _=require(_0xdaea('0xc'));var squel=require(_0xdaea('0xd'));var crypto=require(_0xdaea('0xe'));var jsforce=require(_0xdaea('0xf'));var deskjs=require(_0xdaea('0x10'));var toCsv=require(_0xdaea('0x11'));var querystring=require(_0xdaea('0x12'));var Papa=require(_0xdaea('0x13'));var Redis=require(_0xdaea('0x14'));var authService=require(_0xdaea('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xdaea('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaea('0x17'))('api');var utils=require(_0xdaea('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdaea('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51aca2,_0x40640d){_0x40640d=_0x40640d||0xcc;return function(_0x2af343){if(_0x2af343){return _0x51aca2[_0xdaea('0x1a')](_0x40640d);}return _0x51aca2[_0xdaea('0x1b')](_0x40640d)[_0xdaea('0x1c')]();};}function respondWithResult(_0x39f503,_0x117850){_0x117850=_0x117850||0xc8;return function(_0x54459c){if(_0x54459c){return _0x39f503[_0xdaea('0x1b')](_0x117850)[_0xdaea('0x1d')](_0x54459c);}};}function respondWithFilteredResult(_0x267f92,_0x3f07e3){return function(_0x57b0f3){if(_0x57b0f3){var _0x3feb81=typeof _0x3f07e3[_0xdaea('0x1e')]===_0xdaea('0x1f')&&typeof _0x3f07e3[_0xdaea('0x20')]==='undefined';var _0x538132=_0x57b0f3[_0xdaea('0x21')];var _0x123ccf=_0x3feb81?0x0:_0x3f07e3[_0xdaea('0x1e')];var _0x103dc7=_0x3feb81?_0x57b0f3[_0xdaea('0x21')]:_0x3f07e3[_0xdaea('0x1e')]+_0x3f07e3['limit'];var _0x355b8e;if(_0x103dc7>=_0x538132){_0x103dc7=_0x538132;_0x355b8e=0xc8;}else{_0x355b8e=0xce;}_0x267f92[_0xdaea('0x1b')](_0x355b8e);return _0x267f92['set'](_0xdaea('0x22'),_0x123ccf+'-'+_0x103dc7+'/'+_0x538132)[_0xdaea('0x1d')](_0x57b0f3);}return null;};}function patchUpdates(_0x599345){return function(_0x3d1616){try{jsonpatch[_0xdaea('0x23')](_0x3d1616,_0x599345,!![]);}catch(_0x15aede){return BPromise[_0xdaea('0x24')](_0x15aede);}return _0x3d1616[_0xdaea('0x25')]();};}function saveUpdates(_0x55f892,_0x2a9a83){return function(_0x4579b2){if(_0x4579b2){return _0x4579b2[_0xdaea('0x26')](_0x55f892)[_0xdaea('0x27')](function(_0x4b7e73){return _0x4b7e73;});}return null;};}function removeEntity(_0x21ddc9,_0xb5b996){return function(_0x2b53ff){if(_0x2b53ff){return _0x2b53ff['destroy']()[_0xdaea('0x27')](function(){var _0x3a3ae5=_0x2b53ff[_0xdaea('0x28')]({'plain':!![]});var _0x563243='ExtractedReports';return db[_0xdaea('0x29')][_0xdaea('0x2a')]({'where':{'type':_0x563243,'resourceId':_0x3a3ae5['id']}})['then'](function(){return _0x2b53ff;});})[_0xdaea('0x27')](function(){_0x21ddc9[_0xdaea('0x1b')](0xcc)[_0xdaea('0x1c')]();});}};}function handleEntityNotFound(_0x81833c,_0xc7031f){return function(_0x31518a){if(!_0x31518a){_0x81833c[_0xdaea('0x1a')](0x194);}return _0x31518a;};}function handleError(_0x1c9caf,_0x2fe833){_0x2fe833=_0x2fe833||0x1f4;return function(_0x4e7007){logger[_0xdaea('0x2b')](_0x4e7007[_0xdaea('0x2c')]);if(_0x4e7007[_0xdaea('0x2d')]){delete _0x4e7007['name'];}_0x1c9caf['status'](_0x2fe833)[_0xdaea('0x2e')](_0x4e7007);};}exports[_0xdaea('0x2f')]=function(_0x3b0247,_0x5d2ae4){var _0x15d142={},_0x209ab4={},_0x241ec2={'count':0x0,'rows':[]};var _0x92f658=_[_0xdaea('0x30')](db[_0xdaea('0x31')][_0xdaea('0x32')],function(_0x4b8402){return{'name':_0x4b8402[_0xdaea('0x33')],'type':_0x4b8402[_0xdaea('0x34')][_0xdaea('0x35')]};});_0x209ab4[_0xdaea('0x36')]=_[_0xdaea('0x30')](_0x92f658,_0xdaea('0x2d'));_0x209ab4[_0xdaea('0x37')]=_[_0xdaea('0x38')](_0x3b0247[_0xdaea('0x37')]);_0x209ab4[_0xdaea('0x39')]=_[_0xdaea('0x3a')](_0x209ab4[_0xdaea('0x36')],_0x209ab4[_0xdaea('0x37')]);_0x15d142['attributes']=_[_0xdaea('0x3a')](_0x209ab4[_0xdaea('0x36')],qs['fields'](_0x3b0247['query'][_0xdaea('0x3b')]));_0x15d142[_0xdaea('0x3c')]=_0x15d142[_0xdaea('0x3c')][_0xdaea('0x3d')]?_0x15d142[_0xdaea('0x3c')]:_0x209ab4['model'];if(!_0x3b0247['query']['hasOwnProperty'](_0xdaea('0x3e'))){_0x15d142[_0xdaea('0x20')]=qs[_0xdaea('0x20')](_0x3b0247[_0xdaea('0x37')][_0xdaea('0x20')]);_0x15d142[_0xdaea('0x1e')]=qs[_0xdaea('0x1e')](_0x3b0247[_0xdaea('0x37')][_0xdaea('0x1e')]);}_0x15d142[_0xdaea('0x3f')]=qs[_0xdaea('0x40')](_0x3b0247[_0xdaea('0x37')][_0xdaea('0x40')]);_0x15d142['where']=qs[_0xdaea('0x39')](_[_0xdaea('0x41')](_0x3b0247['query'],_0x209ab4['filters']),_0x92f658);if(_0x3b0247['query'][_0xdaea('0x42')]){_0x15d142[_0xdaea('0x43')]=_[_0xdaea('0x44')](_0x15d142[_0xdaea('0x43')],{'$or':_[_0xdaea('0x30')](_0x92f658,function(_0x16ba40){if(_0x16ba40[_0xdaea('0x34')]!==_0xdaea('0x45')){var _0x5b663f={};_0x5b663f[_0x16ba40[_0xdaea('0x2d')]]={'$like':'%'+_0x3b0247['query'][_0xdaea('0x42')]+'%'};return _0x5b663f;}})});}_0x15d142=_[_0xdaea('0x44')]({},_0x15d142,_0x3b0247[_0xdaea('0x46')]);var _0x4039ec={'where':_0x15d142[_0xdaea('0x43')]};return db['AnalyticExtractedReport']['count'](_0x4039ec)[_0xdaea('0x27')](function(_0x27071e){_0x241ec2[_0xdaea('0x21')]=_0x27071e;if(_0x3b0247[_0xdaea('0x37')]['includeAll']){_0x15d142[_0xdaea('0x47')]=[{'all':!![]}];}return db[_0xdaea('0x31')]['findAll'](_0x15d142);})[_0xdaea('0x27')](function(_0xabcc9b){_0x241ec2['rows']=_0xabcc9b;return _0x241ec2;})[_0xdaea('0x27')](respondWithFilteredResult(_0x5d2ae4,_0x15d142))['catch'](handleError(_0x5d2ae4,null));};exports[_0xdaea('0x48')]=function(_0x17e540,_0x3adc81){var _0x1f31eb={'raw':!![],'where':{'id':_0x17e540[_0xdaea('0x49')]['id']}},_0x261b37={};_0x261b37['model']=_[_0xdaea('0x38')](db['AnalyticExtractedReport'][_0xdaea('0x32')]);_0x261b37[_0xdaea('0x37')]=_['keys'](_0x17e540[_0xdaea('0x37')]);_0x261b37['filters']=_[_0xdaea('0x3a')](_0x261b37[_0xdaea('0x36')],_0x261b37['query']);_0x1f31eb['attributes']=_[_0xdaea('0x3a')](_0x261b37[_0xdaea('0x36')],qs[_0xdaea('0x3b')](_0x17e540[_0xdaea('0x37')]['fields']));_0x1f31eb[_0xdaea('0x3c')]=_0x1f31eb[_0xdaea('0x3c')][_0xdaea('0x3d')]?_0x1f31eb['attributes']:_0x261b37[_0xdaea('0x36')];if(_0x17e540['query'][_0xdaea('0x4a')]){_0x1f31eb[_0xdaea('0x47')]=[{'all':!![]}];}_0x1f31eb=_[_0xdaea('0x44')]({},_0x1f31eb,_0x17e540['options']);return db['AnalyticExtractedReport']['find'](_0x1f31eb)[_0xdaea('0x27')](handleEntityNotFound(_0x3adc81,null))['then'](respondWithResult(_0x3adc81,null))[_0xdaea('0x4b')](handleError(_0x3adc81,null));};exports[_0xdaea('0x4c')]=function(_0x1474d1,_0x450214){return db[_0xdaea('0x31')][_0xdaea('0x4c')](_0x1474d1['body'],{})[_0xdaea('0x27')](function(_0xc15322){var _0x34cde4=_0x1474d1[_0xdaea('0x4d')]['get']({'plain':!![]});if(!_0x34cde4)throw new Error(_0xdaea('0x4e'));if(_0x34cde4[_0xdaea('0x4f')]===_0xdaea('0x4d')){var _0x37c240=_0xc15322[_0xdaea('0x28')]({'plain':!![]});var _0x1690b6='ExtractedReports';return db['UserProfileSection'][_0xdaea('0x50')]({'where':{'name':_0x1690b6,'userProfileId':_0x34cde4[_0xdaea('0x51')]},'raw':!![]})[_0xdaea('0x27')](function(_0x4032bc){if(_0x4032bc&&_0x4032bc[_0xdaea('0x52')]===0x0){return db[_0xdaea('0x29')][_0xdaea('0x4c')]({'name':_0x37c240[_0xdaea('0x2d')],'resourceId':_0x37c240['id'],'type':_0x4032bc[_0xdaea('0x2d')],'sectionId':_0x4032bc['id']},{})[_0xdaea('0x27')](function(){return _0xc15322;});}else{return _0xc15322;}})[_0xdaea('0x4b')](function(_0x38eb5d){logger[_0xdaea('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38eb5d);throw _0x38eb5d;});}return _0xc15322;})[_0xdaea('0x27')](respondWithResult(_0x450214,0xc9))[_0xdaea('0x4b')](handleError(_0x450214,null));};exports[_0xdaea('0x26')]=function(_0x440da1,_0x49b307){if(_0x440da1['body']['id']){delete _0x440da1[_0xdaea('0x53')]['id'];}return db[_0xdaea('0x31')]['find']({'where':{'id':_0x440da1[_0xdaea('0x49')]['id']}})[_0xdaea('0x27')](handleEntityNotFound(_0x49b307,null))['then'](saveUpdates(_0x440da1['body'],null))[_0xdaea('0x27')](respondWithResult(_0x49b307,null))[_0xdaea('0x4b')](handleError(_0x49b307,null));};exports['destroy']=function(_0x5577f4,_0x168886){return db['AnalyticExtractedReport'][_0xdaea('0x50')]({'where':{'id':_0x5577f4[_0xdaea('0x49')]['id']}})[_0xdaea('0x27')](handleEntityNotFound(_0x168886,null))[_0xdaea('0x27')](removeEntity(_0x168886,null))[_0xdaea('0x4b')](handleError(_0x168886,null));};exports[_0xdaea('0x54')]=function(_0x285251,_0x2750a7,_0x486fdb){return db[_0xdaea('0x31')]['find']({'where':{'id':_0x285251[_0xdaea('0x49')]['id']},'attributes':['name',_0xdaea('0x55'),'savename',_0xdaea('0x56')],'raw':!![]})[_0xdaea('0x27')](handleEntityNotFound(_0x2750a7,null))[_0xdaea('0x27')](function(_0x38fc22){if(_0x38fc22){if(!fs['existsSync'](path[_0xdaea('0x57')](config['root'],_0xdaea('0x58'),_0x38fc22[_0xdaea('0x59')]))){throw new db[(_0xdaea('0x5a'))][(_0xdaea('0x5b'))](_0xdaea('0x5c'));}if(_0x285251[_0xdaea('0x37')][_0xdaea('0x5d')]){return _0x2750a7['sendStatus'](0xc8);}return _0x2750a7[_0xdaea('0x54')](path[_0xdaea('0x57')](config[_0xdaea('0x5e')],_0xdaea('0x58'),_0x38fc22[_0xdaea('0x59')]),util[_0xdaea('0x5f')]('%s.%s',_0x38fc22[_0xdaea('0x55')]||_0x38fc22[_0xdaea('0x2d')],_0x38fc22[_0xdaea('0x56')][_0xdaea('0x60')]()));}})[_0xdaea('0x4b')](handleError(_0x2750a7,null));}; \ No newline at end of file +var _0x276c=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','format','%s.%s','toLowerCase','rimraf','fast-json-patch'];(function(_0xf273f9,_0x486198){var _0xb4abcc=function(_0x2f9418){while(--_0x2f9418){_0xf273f9['push'](_0xf273f9['shift']());}};_0xb4abcc(++_0x486198);}(_0x276c,0x176));var _0xc276=function(_0x32d60a,_0x5e40fe){_0x32d60a=_0x32d60a-0x0;var _0x31ac01=_0x276c[_0x32d60a];return _0x31ac01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc276('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc276('0x1'));var rp=require(_0xc276('0x2'));var moment=require(_0xc276('0x3'));var BPromise=require(_0xc276('0x4'));var Mustache=require(_0xc276('0x5'));var util=require(_0xc276('0x6'));var path=require(_0xc276('0x7'));var sox=require(_0xc276('0x8'));var csv=require(_0xc276('0x9'));var ejs=require(_0xc276('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc276('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc276('0xc'));var toCsv=require(_0xc276('0x9'));var querystring=require('querystring');var Papa=require(_0xc276('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc276('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc276('0xf'));var logger=require(_0xc276('0x10'))(_0xc276('0x11'));var utils=require(_0xc276('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc276('0x13'));var db=require(_0xc276('0x14'))['db'];function respondWithStatusCode(_0x32e5d6,_0x3c348d){_0x3c348d=_0x3c348d||0xcc;return function(_0x371f5a){if(_0x371f5a){return _0x32e5d6['sendStatus'](_0x3c348d);}return _0x32e5d6[_0xc276('0x15')](_0x3c348d)[_0xc276('0x16')]();};}function respondWithResult(_0x30372e,_0x796efd){_0x796efd=_0x796efd||0xc8;return function(_0x507086){if(_0x507086){return _0x30372e[_0xc276('0x15')](_0x796efd)[_0xc276('0x17')](_0x507086);}};}function respondWithFilteredResult(_0x42fdb6,_0xd771f3){return function(_0x1662e4){if(_0x1662e4){var _0x33825e=typeof _0xd771f3[_0xc276('0x18')]==='undefined'&&typeof _0xd771f3[_0xc276('0x19')]==='undefined';var _0x3136af=_0x1662e4[_0xc276('0x1a')];var _0x3fc9a6=_0x33825e?0x0:_0xd771f3[_0xc276('0x18')];var _0x1acd8d=_0x33825e?_0x1662e4[_0xc276('0x1a')]:_0xd771f3[_0xc276('0x18')]+_0xd771f3[_0xc276('0x19')];var _0x631692;if(_0x1acd8d>=_0x3136af){_0x1acd8d=_0x3136af;_0x631692=0xc8;}else{_0x631692=0xce;}_0x42fdb6[_0xc276('0x15')](_0x631692);return _0x42fdb6[_0xc276('0x1b')](_0xc276('0x1c'),_0x3fc9a6+'-'+_0x1acd8d+'/'+_0x3136af)[_0xc276('0x17')](_0x1662e4);}return null;};}function patchUpdates(_0x584715){return function(_0x54002d){try{jsonpatch[_0xc276('0x1d')](_0x54002d,_0x584715,!![]);}catch(_0x5bc216){return BPromise[_0xc276('0x1e')](_0x5bc216);}return _0x54002d[_0xc276('0x1f')]();};}function saveUpdates(_0x4b2c42,_0x1320bb){return function(_0x37b7d6){if(_0x37b7d6){return _0x37b7d6[_0xc276('0x20')](_0x4b2c42)[_0xc276('0x21')](function(_0x3ce7e9){return _0x3ce7e9;});}return null;};}function removeEntity(_0xd4f59f,_0x1d3c18){return function(_0x567224){if(_0x567224){return _0x567224[_0xc276('0x22')]()[_0xc276('0x21')](function(){var _0x271702=_0x567224['get']({'plain':!![]});var _0x4ddab1=_0xc276('0x23');return db[_0xc276('0x24')]['destroy']({'where':{'type':_0x4ddab1,'resourceId':_0x271702['id']}})[_0xc276('0x21')](function(){return _0x567224;});})['then'](function(){_0xd4f59f['status'](0xcc)[_0xc276('0x16')]();});}};}function handleEntityNotFound(_0x57a660,_0x2fc5f1){return function(_0x47b1f8){if(!_0x47b1f8){_0x57a660['sendStatus'](0x194);}return _0x47b1f8;};}function handleError(_0x1f2010,_0x3bde1b){_0x3bde1b=_0x3bde1b||0x1f4;return function(_0x22f089){logger['error'](_0x22f089[_0xc276('0x25')]);if(_0x22f089['name']){delete _0x22f089[_0xc276('0x26')];}_0x1f2010['status'](_0x3bde1b)[_0xc276('0x27')](_0x22f089);};}exports['index']=function(_0x199b35,_0x52cb4d){var _0x3a3993={},_0x567c27={},_0x40e4d7={'count':0x0,'rows':[]};var _0x1942be=_[_0xc276('0x28')](db[_0xc276('0x29')][_0xc276('0x2a')],function(_0x156672){return{'name':_0x156672[_0xc276('0x2b')],'type':_0x156672[_0xc276('0x2c')][_0xc276('0x2d')]};});_0x567c27['model']=_['map'](_0x1942be,_0xc276('0x26'));_0x567c27[_0xc276('0x2e')]=_[_0xc276('0x2f')](_0x199b35[_0xc276('0x2e')]);_0x567c27[_0xc276('0x30')]=_['intersection'](_0x567c27[_0xc276('0x31')],_0x567c27['query']);_0x3a3993['attributes']=_[_0xc276('0x32')](_0x567c27[_0xc276('0x31')],qs[_0xc276('0x33')](_0x199b35[_0xc276('0x2e')][_0xc276('0x33')]));_0x3a3993[_0xc276('0x34')]=_0x3a3993[_0xc276('0x34')]['length']?_0x3a3993[_0xc276('0x34')]:_0x567c27[_0xc276('0x31')];if(!_0x199b35[_0xc276('0x2e')][_0xc276('0x35')]('nolimit')){_0x3a3993[_0xc276('0x19')]=qs[_0xc276('0x19')](_0x199b35['query'][_0xc276('0x19')]);_0x3a3993['offset']=qs[_0xc276('0x18')](_0x199b35[_0xc276('0x2e')][_0xc276('0x18')]);}_0x3a3993[_0xc276('0x36')]=qs[_0xc276('0x37')](_0x199b35[_0xc276('0x2e')][_0xc276('0x37')]);_0x3a3993['where']=qs['filters'](_[_0xc276('0x38')](_0x199b35[_0xc276('0x2e')],_0x567c27[_0xc276('0x30')]),_0x1942be);if(_0x199b35[_0xc276('0x2e')]['filter']){_0x3a3993[_0xc276('0x39')]=_[_0xc276('0x3a')](_0x3a3993[_0xc276('0x39')],{'$or':_[_0xc276('0x28')](_0x1942be,function(_0x30b9fd){if(_0x30b9fd[_0xc276('0x2c')]!==_0xc276('0x3b')){var _0x3ef2d8={};_0x3ef2d8[_0x30b9fd[_0xc276('0x26')]]={'$like':'%'+_0x199b35[_0xc276('0x2e')][_0xc276('0x3c')]+'%'};return _0x3ef2d8;}})});}_0x3a3993=_[_0xc276('0x3a')]({},_0x3a3993,_0x199b35[_0xc276('0x3d')]);var _0x5c3a76={'where':_0x3a3993[_0xc276('0x39')]};return db['AnalyticExtractedReport'][_0xc276('0x1a')](_0x5c3a76)['then'](function(_0x261dbb){_0x40e4d7[_0xc276('0x1a')]=_0x261dbb;if(_0x199b35[_0xc276('0x2e')][_0xc276('0x3e')]){_0x3a3993[_0xc276('0x3f')]=[{'all':!![]}];}return db[_0xc276('0x29')][_0xc276('0x40')](_0x3a3993);})[_0xc276('0x21')](function(_0x31667e){_0x40e4d7[_0xc276('0x41')]=_0x31667e;return _0x40e4d7;})[_0xc276('0x21')](respondWithFilteredResult(_0x52cb4d,_0x3a3993))[_0xc276('0x42')](handleError(_0x52cb4d,null));};exports[_0xc276('0x43')]=function(_0x33a101,_0x96221a){var _0x5f2d97={'raw':!![],'where':{'id':_0x33a101[_0xc276('0x44')]['id']}},_0x448344={};_0x448344[_0xc276('0x31')]=_[_0xc276('0x2f')](db[_0xc276('0x29')]['rawAttributes']);_0x448344[_0xc276('0x2e')]=_[_0xc276('0x2f')](_0x33a101[_0xc276('0x2e')]);_0x448344[_0xc276('0x30')]=_['intersection'](_0x448344[_0xc276('0x31')],_0x448344['query']);_0x5f2d97[_0xc276('0x34')]=_[_0xc276('0x32')](_0x448344[_0xc276('0x31')],qs['fields'](_0x33a101['query'][_0xc276('0x33')]));_0x5f2d97[_0xc276('0x34')]=_0x5f2d97[_0xc276('0x34')][_0xc276('0x45')]?_0x5f2d97[_0xc276('0x34')]:_0x448344['model'];if(_0x33a101[_0xc276('0x2e')][_0xc276('0x3e')]){_0x5f2d97[_0xc276('0x3f')]=[{'all':!![]}];}_0x5f2d97=_[_0xc276('0x3a')]({},_0x5f2d97,_0x33a101[_0xc276('0x3d')]);return db[_0xc276('0x29')]['find'](_0x5f2d97)[_0xc276('0x21')](handleEntityNotFound(_0x96221a,null))[_0xc276('0x21')](respondWithResult(_0x96221a,null))['catch'](handleError(_0x96221a,null));};exports[_0xc276('0x46')]=function(_0x491b34,_0x553d9c){return db[_0xc276('0x29')]['create'](_0x491b34[_0xc276('0x47')],{})[_0xc276('0x21')](function(_0x4adf8c){var _0x400828=_0x491b34[_0xc276('0x48')][_0xc276('0x49')]({'plain':!![]});if(!_0x400828)throw new Error(_0xc276('0x4a'));if(_0x400828['role']===_0xc276('0x48')){var _0x52f165=_0x4adf8c[_0xc276('0x49')]({'plain':!![]});var _0x916a8='ExtractedReports';return db[_0xc276('0x4b')][_0xc276('0x4c')]({'where':{'name':_0x916a8,'userProfileId':_0x400828[_0xc276('0x4d')]},'raw':!![]})[_0xc276('0x21')](function(_0x46d7fc){if(_0x46d7fc&&_0x46d7fc[_0xc276('0x4e')]===0x0){return db[_0xc276('0x24')][_0xc276('0x46')]({'name':_0x52f165[_0xc276('0x26')],'resourceId':_0x52f165['id'],'type':_0x46d7fc[_0xc276('0x26')],'sectionId':_0x46d7fc['id']},{})[_0xc276('0x21')](function(){return _0x4adf8c;});}else{return _0x4adf8c;}})['catch'](function(_0x2ef0a3){logger[_0xc276('0x4f')](_0xc276('0x50'),_0x2ef0a3);throw _0x2ef0a3;});}return _0x4adf8c;})[_0xc276('0x21')](respondWithResult(_0x553d9c,0xc9))[_0xc276('0x42')](handleError(_0x553d9c,null));};exports['update']=function(_0x1d231b,_0x4d4def){if(_0x1d231b['body']['id']){delete _0x1d231b['body']['id'];}return db[_0xc276('0x29')][_0xc276('0x4c')]({'where':{'id':_0x1d231b[_0xc276('0x44')]['id']}})[_0xc276('0x21')](handleEntityNotFound(_0x4d4def,null))[_0xc276('0x21')](saveUpdates(_0x1d231b['body'],null))[_0xc276('0x21')](respondWithResult(_0x4d4def,null))[_0xc276('0x42')](handleError(_0x4d4def,null));};exports['destroy']=function(_0x2ad2b2,_0x1f044c){return db[_0xc276('0x29')][_0xc276('0x4c')]({'where':{'id':_0x2ad2b2[_0xc276('0x44')]['id']}})[_0xc276('0x21')](handleEntityNotFound(_0x1f044c,null))[_0xc276('0x21')](removeEntity(_0x1f044c,null))[_0xc276('0x42')](handleError(_0x1f044c,null));};exports['download']=function(_0x3baa93,_0x2d6243,_0x1a8dfb){return db[_0xc276('0x29')]['find']({'where':{'id':_0x3baa93[_0xc276('0x44')]['id']},'attributes':[_0xc276('0x26'),'basename',_0xc276('0x51'),'output'],'raw':!![]})[_0xc276('0x21')](handleEntityNotFound(_0x2d6243,null))[_0xc276('0x21')](function(_0x4d1110){if(_0x4d1110){if(!fs['existsSync'](path[_0xc276('0x52')](config[_0xc276('0x53')],_0xc276('0x54'),_0x4d1110['savename']))){throw new db[(_0xc276('0x55'))][(_0xc276('0x56'))](_0xc276('0x57'));}if(_0x3baa93[_0xc276('0x2e')][_0xc276('0x58')]){return _0x2d6243[_0xc276('0x59')](0xc8);}return _0x2d6243[_0xc276('0x5a')](path[_0xc276('0x52')](config[_0xc276('0x53')],'server/files/reports',_0x4d1110[_0xc276('0x51')]),util[_0xc276('0x5b')](_0xc276('0x5c'),_0x4d1110['basename']||_0x4d1110[_0xc276('0x26')],_0x4d1110['output'][_0xc276('0x5d')]()));}})[_0xc276('0x42')](handleError(_0x2d6243,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 54cf4b4..b0da306 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 _0x09f3=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x236f54,_0x1edd41){var _0x292518=function(_0x5c31e8){while(--_0x5c31e8){_0x236f54['push'](_0x236f54['shift']());}};_0x292518(++_0x1edd41);}(_0x09f3,0x117));var _0x309f=function(_0x29ecbc,_0x2929d9){_0x29ecbc=_0x29ecbc-0x0;var _0x5709b0=_0x09f3[_0x29ecbc];return _0x5709b0;};'use strict';var _=require(_0x309f('0x0'));var util=require(_0x309f('0x1'));var logger=require('../../config/logger')(_0x309f('0x2'));var moment=require(_0x309f('0x3'));var BPromise=require(_0x309f('0x4'));var rp=require(_0x309f('0x5'));var fs=require('fs');var path=require(_0x309f('0x6'));var rimraf=require(_0x309f('0x7'));var config=require(_0x309f('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x309f('0x9')]=function(_0x356f51,_0x54f714){return _0x356f51[_0x309f('0xa')](_0x309f('0xb'),attributes,{'tableName':_0x309f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9122=['AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3be5c0,_0x55ed8e){var _0x26ee97=function(_0x6966b8){while(--_0x6966b8){_0x3be5c0['push'](_0x3be5c0['shift']());}};_0x26ee97(++_0x55ed8e);}(_0x9122,0x120));var _0x2912=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0x9122[_0x412b2a];return _0x5872e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2912('0x0'))('api');var moment=require(_0x2912('0x1'));var BPromise=require(_0x2912('0x2'));var rp=require(_0x2912('0x3'));var fs=require('fs');var path=require(_0x2912('0x4'));var rimraf=require(_0x2912('0x5'));var config=require(_0x2912('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x2912('0x7')]=function(_0x4ba2b4,_0x210e35){return _0x4ba2b4[_0x2912('0x8')](_0x2912('0x9'),attributes,{'tableName':_0x2912('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index b1e285a..bf127b5 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 _0xb9f0=['jayson/promise','client','http','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x91324a,_0x51db1a){var _0x155733=function(_0x46ebe3){while(--_0x46ebe3){_0x91324a['push'](_0x91324a['shift']());}};_0x155733(++_0x51db1a);}(_0xb9f0,0x181));var _0x0b9f=function(_0x20732f,_0x147fbc){_0x20732f=_0x20732f-0x0;var _0x5c3d7b=_0xb9f0[_0x20732f];return _0x5c3d7b;};'use strict';var _=require('lodash');var util=require(_0x0b9f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b9f('0x1'));var db=require(_0x0b9f('0x2'))['db'];var utils=require(_0x0b9f('0x3'));var logger=require(_0x0b9f('0x4'))(_0x0b9f('0x5'));var config=require('../../config/environment');var jayson=require(_0x0b9f('0x6'));var client=jayson[_0x0b9f('0x7')][_0x0b9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48d6c8,_0x369f79,_0x1729bb){return new BPromise(function(_0x4440e1,_0xf56540){return client['request'](_0x48d6c8,_0x1729bb)['then'](function(_0x4fda66){logger['info'](_0x0b9f('0x9'),_0x369f79,'request\x20sent');logger['debug'](_0x0b9f('0xa'),_0x369f79,'request\x20sent',JSON[_0x0b9f('0xb')](_0x4fda66));if(_0x4fda66[_0x0b9f('0xc')]){if(_0x4fda66['error'][_0x0b9f('0xd')]===0x1f4){logger[_0x0b9f('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x369f79,_0x4fda66[_0x0b9f('0xc')][_0x0b9f('0xe')]);return _0xf56540(_0x4fda66[_0x0b9f('0xc')][_0x0b9f('0xe')]);}logger[_0x0b9f('0xc')](_0x0b9f('0x9'),_0x369f79,_0x4fda66[_0x0b9f('0xc')][_0x0b9f('0xe')]);return _0x4440e1(_0x4fda66[_0x0b9f('0xc')][_0x0b9f('0xe')]);}else{logger['info'](_0x0b9f('0x9'),_0x369f79,_0x0b9f('0xf'));_0x4440e1(_0x4fda66[_0x0b9f('0x10')][_0x0b9f('0xe')]);}})['catch'](function(_0x5bc40a){logger[_0x0b9f('0xc')](_0x0b9f('0x9'),_0x369f79,_0x5bc40a);_0xf56540(_0x5bc40a);});});} \ No newline at end of file +var _0x8425=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6aa32f,_0x3820f7){var _0x52bfee=function(_0x49814f){while(--_0x49814f){_0x6aa32f['push'](_0x6aa32f['shift']());}};_0x52bfee(++_0x3820f7);}(_0x8425,0x13b));var _0x5842=function(_0x2d1586,_0x51def){_0x2d1586=_0x2d1586-0x0;var _0x20c876=_0x8425[_0x2d1586];return _0x20c876;};'use strict';var _=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var moment=require(_0x5842('0x2'));var BPromise=require(_0x5842('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5842('0x4'));var db=require(_0x5842('0x5'))['db'];var utils=require(_0x5842('0x6'));var logger=require(_0x5842('0x7'))(_0x5842('0x8'));var config=require(_0x5842('0x9'));var jayson=require(_0x5842('0xa'));var client=jayson['client'][_0x5842('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15eb92,_0x6d04d0,_0x3ccf6e){return new BPromise(function(_0x3ad2e0,_0x4f4fc4){return client['request'](_0x15eb92,_0x3ccf6e)[_0x5842('0xc')](function(_0x47e603){logger[_0x5842('0xd')](_0x5842('0xe'),_0x6d04d0,_0x5842('0xf'));logger[_0x5842('0x10')](_0x5842('0x11'),_0x6d04d0,_0x5842('0xf'),JSON[_0x5842('0x12')](_0x47e603));if(_0x47e603[_0x5842('0x13')]){if(_0x47e603[_0x5842('0x13')][_0x5842('0x14')]===0x1f4){logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x47e603['error'][_0x5842('0x15')]);return _0x4f4fc4(_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);}logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);return _0x3ad2e0(_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);}else{logger[_0x5842('0xd')](_0x5842('0xe'),_0x6d04d0,_0x5842('0xf'));_0x3ad2e0(_0x47e603[_0x5842('0x16')][_0x5842('0x15')]);}})[_0x5842('0x17')](function(_0x4c1240){logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x4c1240);_0x4f4fc4(_0x4c1240);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b2dbf2c..e868003 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 _0x8b80=['delete','util','path','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update'];(function(_0xb4fc76,_0x166108){var _0x2a3faf=function(_0x35cff4){while(--_0x35cff4){_0xb4fc76['push'](_0xb4fc76['shift']());}};_0x2a3faf(++_0x166108);}(_0x8b80,0x1b1));var _0x08b8=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x8b80[_0x160248];return _0x4e589d;};'use strict';var multer=require('multer');var util=require(_0x08b8('0x0'));var path=require(_0x08b8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x08b8('0x2'));var config=require(_0x08b8('0x3'));var controller=require('./analyticExtractedReport.controller');router[_0x08b8('0x4')]('/',auth['isAuthenticated'](),controller[_0x08b8('0x5')]);router[_0x08b8('0x4')](_0x08b8('0x6'),auth[_0x08b8('0x7')](),controller[_0x08b8('0x8')]);router['get'](_0x08b8('0x9'),auth['isAuthenticated'](),controller[_0x08b8('0xa')]);router[_0x08b8('0xb')]('/',auth[_0x08b8('0x7')](),controller[_0x08b8('0xc')]);router[_0x08b8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x08b8('0xe')]);router[_0x08b8('0xf')](_0x08b8('0x6'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdff6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','isAuthenticated','download','put','update','delete','/:id','destroy','exports'];(function(_0x21cb94,_0x52ea8b){var _0x1fbfdb=function(_0x3eeb9c){while(--_0x3eeb9c){_0x21cb94['push'](_0x21cb94['shift']());}};_0x1fbfdb(++_0x52ea8b);}(_0xdff6,0x1d4));var _0x6dff=function(_0x50422f,_0x188962){_0x50422f=_0x50422f-0x0;var _0x4e9766=_0xdff6[_0x50422f];return _0x4e9766;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6dff('0x0'));var timeout=require(_0x6dff('0x1'));var express=require(_0x6dff('0x2'));var router=express[_0x6dff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6dff('0x4'));var interaction=require(_0x6dff('0x5'));var config=require(_0x6dff('0x6'));var controller=require(_0x6dff('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6dff('0x8')]);router[_0x6dff('0x9')]('/:id',auth[_0x6dff('0xa')](),controller['show']);router[_0x6dff('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x6dff('0xb')]);router['post']('/',auth[_0x6dff('0xa')](),controller['create']);router[_0x6dff('0xc')]('/:id',auth[_0x6dff('0xa')](),controller[_0x6dff('0xd')]);router[_0x6dff('0xe')](_0x6dff('0xf'),auth[_0x6dff('0xa')](),controller[_0x6dff('0x10')]);module[_0x6dff('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b2ede9c..bdc7ea9 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 _0xcf18=['BOOLEAN','exports','TEXT','STRING'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0xcf18,0x101));var _0x8cf1=function(_0x1fedfe,_0x1c8f22){_0x1fedfe=_0x1fedfe-0x0;var _0x55303d=_0xcf18[_0x1fedfe];return _0x55303d;};'use strict';var Sequelize=require('sequelize');module[_0x8cf1('0x0')]={'field':{'type':Sequelize[_0x8cf1('0x1')]},'alias':{'type':Sequelize[_0x8cf1('0x2')]},'function':{'type':Sequelize[_0x8cf1('0x2')]},'format':{'type':Sequelize[_0x8cf1('0x2')]},'groupBy':{'type':Sequelize[_0x8cf1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x8cf1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3080=['STRING','BOOLEAN','exports','TEXT'];(function(_0x4d1be4,_0x280173){var _0x4668f6=function(_0xcbdb2){while(--_0xcbdb2){_0x4d1be4['push'](_0x4d1be4['shift']());}};_0x4668f6(++_0x280173);}(_0x3080,0xce));var _0x0308=function(_0x59b65c,_0x496d5e){_0x59b65c=_0x59b65c-0x0;var _0x175784=_0x3080[_0x59b65c];return _0x175784;};'use strict';var Sequelize=require('sequelize');module[_0x0308('0x0')]={'field':{'type':Sequelize[_0x0308('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0308('0x2')]},'format':{'type':Sequelize[_0x0308('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0308('0x2')]},'custom':{'type':Sequelize[_0x0308('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 4d3f577..c66b0c2 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 _0xb107=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x16dd98,_0x11d346){var _0xfc7fb3=function(_0x40d7d8){while(--_0x40d7d8){_0x16dd98['push'](_0x16dd98['shift']());}};_0xfc7fb3(++_0x11d346);}(_0xb107,0x8f));var _0x7b10=function(_0x48b122,_0x2b397f){_0x48b122=_0x48b122-0x0;var _0x21d87c=_0xb107[_0x48b122];return _0x21d87c;};'use strict';var emlformat=require(_0x7b10('0x0'));var rimraf=require(_0x7b10('0x1'));var zipdir=require(_0x7b10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b10('0x3'));var moment=require(_0x7b10('0x4'));var BPromise=require(_0x7b10('0x5'));var Mustache=require('mustache');var util=require(_0x7b10('0x6'));var path=require(_0x7b10('0x7'));var sox=require(_0x7b10('0x8'));var csv=require(_0x7b10('0x9'));var ejs=require(_0x7b10('0xa'));var fs=require('fs');var fs_extra=require(_0x7b10('0xb'));var _=require(_0x7b10('0xc'));var squel=require(_0x7b10('0xd'));var crypto=require(_0x7b10('0xe'));var jsforce=require(_0x7b10('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7b10('0x9'));var querystring=require(_0x7b10('0x10'));var Papa=require(_0x7b10('0x11'));var Redis=require(_0x7b10('0x12'));var authService=require(_0x7b10('0x13'));var qs=require(_0x7b10('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b10('0x15'));var logger=require(_0x7b10('0x16'))(_0x7b10('0x17'));var utils=require('../../config/utils');var config=require(_0x7b10('0x18'));var licenseUtil=require(_0x7b10('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fb7f7,_0x31771e){_0x31771e=_0x31771e||0xcc;return function(_0x4060c1){if(_0x4060c1){return _0x1fb7f7[_0x7b10('0x1a')](_0x31771e);}return _0x1fb7f7[_0x7b10('0x1b')](_0x31771e)[_0x7b10('0x1c')]();};}function respondWithResult(_0x571315,_0x38d7f4){_0x38d7f4=_0x38d7f4||0xc8;return function(_0x3ea883){if(_0x3ea883){return _0x571315[_0x7b10('0x1b')](_0x38d7f4)['json'](_0x3ea883);}};}function respondWithFilteredResult(_0x325ede,_0x3cdbfd){return function(_0x1cc13b){if(_0x1cc13b){var _0x5024bb=typeof _0x3cdbfd[_0x7b10('0x1d')]===_0x7b10('0x1e')&&typeof _0x3cdbfd[_0x7b10('0x1f')]===_0x7b10('0x1e');var _0x54fa39=_0x1cc13b['count'];var _0x5135cc=_0x5024bb?0x0:_0x3cdbfd[_0x7b10('0x1d')];var _0x3b3f72=_0x5024bb?_0x1cc13b['count']:_0x3cdbfd[_0x7b10('0x1d')]+_0x3cdbfd['limit'];var _0x170129;if(_0x3b3f72>=_0x54fa39){_0x3b3f72=_0x54fa39;_0x170129=0xc8;}else{_0x170129=0xce;}_0x325ede[_0x7b10('0x1b')](_0x170129);return _0x325ede[_0x7b10('0x20')]('Content-Range',_0x5135cc+'-'+_0x3b3f72+'/'+_0x54fa39)[_0x7b10('0x21')](_0x1cc13b);}return null;};}function patchUpdates(_0x58334f){return function(_0x23e78e){try{jsonpatch[_0x7b10('0x22')](_0x23e78e,_0x58334f,!![]);}catch(_0xae08ca){return BPromise[_0x7b10('0x23')](_0xae08ca);}return _0x23e78e[_0x7b10('0x24')]();};}function saveUpdates(_0x4a28f4,_0x128c73){return function(_0xb9238c){if(_0xb9238c){return _0xb9238c['update'](_0x4a28f4)[_0x7b10('0x25')](function(_0x38a5fb){return _0x38a5fb;});}return null;};}function removeEntity(_0x31ebb0,_0x3d4b56){return function(_0x405f00){if(_0x405f00){return _0x405f00[_0x7b10('0x26')]()['then'](function(){_0x31ebb0[_0x7b10('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2251fe,_0x36218f){return function(_0x501e58){if(!_0x501e58){_0x2251fe['sendStatus'](0x194);}return _0x501e58;};}function handleError(_0x1eaf39,_0x38e73e){_0x38e73e=_0x38e73e||0x1f4;return function(_0x56f2bc){logger[_0x7b10('0x27')](_0x56f2bc['stack']);if(_0x56f2bc[_0x7b10('0x28')]){delete _0x56f2bc[_0x7b10('0x28')];}_0x1eaf39['status'](_0x38e73e)[_0x7b10('0x29')](_0x56f2bc);};}exports[_0x7b10('0x2a')]=function(_0x2287d8,_0x54b144){var _0x536d6f={},_0xcd474={},_0x4f821b={'count':0x0,'rows':[]};var _0x16209e=_[_0x7b10('0x2b')](db[_0x7b10('0x2c')][_0x7b10('0x2d')],function(_0x420a65){return{'name':_0x420a65[_0x7b10('0x2e')],'type':_0x420a65['type']['key']};});_0xcd474[_0x7b10('0x2f')]=_[_0x7b10('0x2b')](_0x16209e,_0x7b10('0x28'));_0xcd474[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x2287d8[_0x7b10('0x30')]);_0xcd474[_0x7b10('0x32')]=_[_0x7b10('0x33')](_0xcd474[_0x7b10('0x2f')],_0xcd474[_0x7b10('0x30')]);_0x536d6f[_0x7b10('0x34')]=_[_0x7b10('0x33')](_0xcd474[_0x7b10('0x2f')],qs['fields'](_0x2287d8['query'][_0x7b10('0x35')]));_0x536d6f['attributes']=_0x536d6f[_0x7b10('0x34')]['length']?_0x536d6f['attributes']:_0xcd474[_0x7b10('0x2f')];if(!_0x2287d8[_0x7b10('0x30')]['hasOwnProperty'](_0x7b10('0x36'))){_0x536d6f['limit']=qs[_0x7b10('0x1f')](_0x2287d8[_0x7b10('0x30')][_0x7b10('0x1f')]);_0x536d6f[_0x7b10('0x1d')]=qs[_0x7b10('0x1d')](_0x2287d8[_0x7b10('0x30')]['offset']);}_0x536d6f[_0x7b10('0x37')]=qs[_0x7b10('0x38')](_0x2287d8[_0x7b10('0x30')][_0x7b10('0x38')]);_0x536d6f['where']=qs[_0x7b10('0x32')](_[_0x7b10('0x39')](_0x2287d8['query'],_0xcd474['filters']),_0x16209e);if(_0x2287d8['query'][_0x7b10('0x3a')]){_0x536d6f[_0x7b10('0x3b')]=_['merge'](_0x536d6f[_0x7b10('0x3b')],{'$or':_[_0x7b10('0x2b')](_0x16209e,function(_0x26c289){if(_0x26c289[_0x7b10('0x3c')]!==_0x7b10('0x3d')){var _0x1fdb8c={};_0x1fdb8c[_0x26c289['name']]={'$like':'%'+_0x2287d8[_0x7b10('0x30')][_0x7b10('0x3a')]+'%'};return _0x1fdb8c;}})});}_0x536d6f=_[_0x7b10('0x3e')]({},_0x536d6f,_0x2287d8['options']);var _0x5323e5={'where':_0x536d6f[_0x7b10('0x3b')]};return db[_0x7b10('0x2c')][_0x7b10('0x3f')](_0x5323e5)[_0x7b10('0x25')](function(_0x260459){_0x4f821b[_0x7b10('0x3f')]=_0x260459;if(_0x2287d8[_0x7b10('0x30')][_0x7b10('0x40')]){_0x536d6f[_0x7b10('0x41')]=[{'all':!![]}];}return db[_0x7b10('0x2c')][_0x7b10('0x42')](_0x536d6f);})[_0x7b10('0x25')](function(_0x1b68db){_0x4f821b[_0x7b10('0x43')]=_0x1b68db;return _0x4f821b;})['then'](respondWithFilteredResult(_0x54b144,_0x536d6f))[_0x7b10('0x44')](handleError(_0x54b144,null));};exports[_0x7b10('0x45')]=function(_0x53e577,_0x1ed875){var _0x1657f4={'raw':![],'where':{'id':_0x53e577[_0x7b10('0x46')]['id']}},_0xad112e={};_0xad112e[_0x7b10('0x2f')]=_[_0x7b10('0x31')](db[_0x7b10('0x2c')][_0x7b10('0x2d')]);_0xad112e[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x53e577[_0x7b10('0x30')]);_0xad112e[_0x7b10('0x32')]=_[_0x7b10('0x33')](_0xad112e[_0x7b10('0x2f')],_0xad112e[_0x7b10('0x30')]);_0x1657f4[_0x7b10('0x34')]=_[_0x7b10('0x33')](_0xad112e[_0x7b10('0x2f')],qs[_0x7b10('0x35')](_0x53e577['query'][_0x7b10('0x35')]));_0x1657f4['attributes']=_0x1657f4['attributes'][_0x7b10('0x47')]?_0x1657f4[_0x7b10('0x34')]:_0xad112e[_0x7b10('0x2f')];if(_0x53e577[_0x7b10('0x30')]['includeAll']){_0x1657f4[_0x7b10('0x41')]=[{'all':!![]}];}_0x1657f4=_[_0x7b10('0x3e')]({},_0x1657f4,_0x53e577['options']);return db['AnalyticFieldReport'][_0x7b10('0x48')](_0x1657f4)[_0x7b10('0x25')](handleEntityNotFound(_0x1ed875,null))[_0x7b10('0x25')](respondWithResult(_0x1ed875,null))[_0x7b10('0x44')](handleError(_0x1ed875,null));};exports['create']=function(_0x289276,_0x2a07c6){return db[_0x7b10('0x2c')][_0x7b10('0x49')](_0x289276[_0x7b10('0x4a')],{})['then'](respondWithResult(_0x2a07c6,0xc9))['catch'](handleError(_0x2a07c6,null));};exports[_0x7b10('0x4b')]=function(_0x3dc083,_0x3b33a5){return db[_0x7b10('0x2c')][_0x7b10('0x4b')](_0x3dc083[_0x7b10('0x4a')],{'raw':![],'individualHooks':!![]})[_0x7b10('0x25')](respondWithResult(_0x3b33a5,0xc9))['catch'](handleError(_0x3b33a5,null));};exports[_0x7b10('0x4c')]=function(_0x451f72,_0x119729){if(_0x451f72['body']['id']){delete _0x451f72[_0x7b10('0x4a')]['id'];}return db[_0x7b10('0x2c')][_0x7b10('0x48')]({'where':{'id':_0x451f72[_0x7b10('0x46')]['id']}})[_0x7b10('0x25')](handleEntityNotFound(_0x119729,null))[_0x7b10('0x25')](saveUpdates(_0x451f72[_0x7b10('0x4a')],null))[_0x7b10('0x25')](respondWithResult(_0x119729,null))[_0x7b10('0x44')](handleError(_0x119729,null));};exports[_0x7b10('0x26')]=function(_0x3cfed4,_0x1766ee){return db[_0x7b10('0x2c')][_0x7b10('0x48')]({'where':{'id':_0x3cfed4[_0x7b10('0x46')]['id']}})[_0x7b10('0x25')](handleEntityNotFound(_0x1766ee,null))[_0x7b10('0x25')](removeEntity(_0x1766ee,null))['catch'](handleError(_0x1766ee,null));};exports[_0x7b10('0x4d')]=function(_0x2314ac,_0x5e6a63){return db[_0x7b10('0x2c')]['destroy']({'where':{'id':_0x2314ac[_0x7b10('0x30')][_0x7b10('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x7b10('0x25')](respondWithResult(_0x5e6a63,0xcc))[_0x7b10('0x44')](handleError(_0x5e6a63,null));};exports[_0x7b10('0x4f')]=function(_0x3b7444,_0x5ed9b5,_0xed55d3){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x3b7444[_0x7b10('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ed9b5,null))['then'](function(_0x27114b){if(_0x27114b){return db['sequelize']['transaction'](function(_0x46d874){return db[_0x7b10('0x2c')][_0x7b10('0x26')]({'where':{'CustomReportId':_0x3b7444['params']['id']},'transaction':_0x46d874})['then'](function(_0x5e56b5){var _0x69b27a=_['map'](_0x3b7444[_0x7b10('0x4a')],function(_0x4b4924){delete _0x4b4924['id'];_0x4b4924[_0x7b10('0x50')]=_0x3b7444['params']['id'];return _0x4b4924;});return db['AnalyticFieldReport'][_0x7b10('0x4b')](_0x69b27a,{'transaction':_0x46d874});});})[_0x7b10('0x25')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x3b7444['params']['id']}});});}})[_0x7b10('0x25')](respondWithResult(_0x5ed9b5,null))[_0x7b10('0x44')](handleError(_0x5ed9b5,null));}; \ No newline at end of file +var _0x381b=['destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','fields','length','model','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x2dfbc5,_0x3d245c){var _0x5b1cee=function(_0x5f1394){while(--_0x5f1394){_0x2dfbc5['push'](_0x2dfbc5['shift']());}};_0x5b1cee(++_0x3d245c);}(_0x381b,0x7c));var _0xb381=function(_0x343b56,_0x27ebbf){_0x343b56=_0x343b56-0x0;var _0x4bdc57=_0x381b[_0x343b56];return _0x4bdc57;};'use strict';var emlformat=require(_0xb381('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb381('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb381('0x2'));var moment=require(_0xb381('0x3'));var BPromise=require(_0xb381('0x4'));var Mustache=require(_0xb381('0x5'));var util=require(_0xb381('0x6'));var path=require(_0xb381('0x7'));var sox=require(_0xb381('0x8'));var csv=require(_0xb381('0x9'));var ejs=require(_0xb381('0xa'));var fs=require('fs');var fs_extra=require(_0xb381('0xb'));var _=require('lodash');var squel=require(_0xb381('0xc'));var crypto=require(_0xb381('0xd'));var jsforce=require(_0xb381('0xe'));var deskjs=require(_0xb381('0xf'));var toCsv=require(_0xb381('0x9'));var querystring=require(_0xb381('0x10'));var Papa=require(_0xb381('0x11'));var Redis=require(_0xb381('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb381('0x13'));var as=require(_0xb381('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb381('0x15'));var utils=require(_0xb381('0x16'));var config=require(_0xb381('0x17'));var licenseUtil=require(_0xb381('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c22a9,_0x555e10){_0x555e10=_0x555e10||0xcc;return function(_0x41ba0e){if(_0x41ba0e){return _0x3c22a9[_0xb381('0x19')](_0x555e10);}return _0x3c22a9[_0xb381('0x1a')](_0x555e10)[_0xb381('0x1b')]();};}function respondWithResult(_0x5695de,_0x199ddd){_0x199ddd=_0x199ddd||0xc8;return function(_0x22b5d3){if(_0x22b5d3){return _0x5695de['status'](_0x199ddd)[_0xb381('0x1c')](_0x22b5d3);}};}function respondWithFilteredResult(_0x1155b4,_0x5b4ea2){return function(_0x442d89){if(_0x442d89){var _0x1cfa50=typeof _0x5b4ea2[_0xb381('0x1d')]===_0xb381('0x1e')&&typeof _0x5b4ea2[_0xb381('0x1f')]===_0xb381('0x1e');var _0xf989dc=_0x442d89[_0xb381('0x20')];var _0x42497d=_0x1cfa50?0x0:_0x5b4ea2[_0xb381('0x1d')];var _0x3d51e7=_0x1cfa50?_0x442d89[_0xb381('0x20')]:_0x5b4ea2[_0xb381('0x1d')]+_0x5b4ea2[_0xb381('0x1f')];var _0x51c5ad;if(_0x3d51e7>=_0xf989dc){_0x3d51e7=_0xf989dc;_0x51c5ad=0xc8;}else{_0x51c5ad=0xce;}_0x1155b4['status'](_0x51c5ad);return _0x1155b4[_0xb381('0x21')](_0xb381('0x22'),_0x42497d+'-'+_0x3d51e7+'/'+_0xf989dc)[_0xb381('0x1c')](_0x442d89);}return null;};}function patchUpdates(_0x152948){return function(_0x1c76ea){try{jsonpatch[_0xb381('0x23')](_0x1c76ea,_0x152948,!![]);}catch(_0xa41a0c){return BPromise[_0xb381('0x24')](_0xa41a0c);}return _0x1c76ea[_0xb381('0x25')]();};}function saveUpdates(_0x4e11e4,_0x3419e9){return function(_0x31ccc2){if(_0x31ccc2){return _0x31ccc2[_0xb381('0x26')](_0x4e11e4)[_0xb381('0x27')](function(_0x41ce86){return _0x41ce86;});}return null;};}function removeEntity(_0x571d83,_0x531732){return function(_0xc62e6b){if(_0xc62e6b){return _0xc62e6b[_0xb381('0x28')]()['then'](function(){_0x571d83[_0xb381('0x1a')](0xcc)[_0xb381('0x1b')]();});}};}function handleEntityNotFound(_0x4d25a1,_0x51a922){return function(_0x307f9){if(!_0x307f9){_0x4d25a1['sendStatus'](0x194);}return _0x307f9;};}function handleError(_0x485974,_0x35f816){_0x35f816=_0x35f816||0x1f4;return function(_0x3e9150){logger[_0xb381('0x29')](_0x3e9150[_0xb381('0x2a')]);if(_0x3e9150[_0xb381('0x2b')]){delete _0x3e9150[_0xb381('0x2b')];}_0x485974[_0xb381('0x1a')](_0x35f816)[_0xb381('0x2c')](_0x3e9150);};}exports[_0xb381('0x2d')]=function(_0x1c73b5,_0x3659e5){var _0x1f1b62={},_0x39c5e0={},_0x226284={'count':0x0,'rows':[]};var _0x3401cd=_[_0xb381('0x2e')](db[_0xb381('0x2f')][_0xb381('0x30')],function(_0x471b43){return{'name':_0x471b43[_0xb381('0x31')],'type':_0x471b43[_0xb381('0x32')][_0xb381('0x33')]};});_0x39c5e0['model']=_[_0xb381('0x2e')](_0x3401cd,_0xb381('0x2b'));_0x39c5e0[_0xb381('0x34')]=_['keys'](_0x1c73b5[_0xb381('0x34')]);_0x39c5e0[_0xb381('0x35')]=_['intersection'](_0x39c5e0['model'],_0x39c5e0[_0xb381('0x34')]);_0x1f1b62[_0xb381('0x36')]=_[_0xb381('0x37')](_0x39c5e0['model'],qs[_0xb381('0x38')](_0x1c73b5['query'][_0xb381('0x38')]));_0x1f1b62[_0xb381('0x36')]=_0x1f1b62[_0xb381('0x36')][_0xb381('0x39')]?_0x1f1b62['attributes']:_0x39c5e0[_0xb381('0x3a')];if(!_0x1c73b5[_0xb381('0x34')]['hasOwnProperty']('nolimit')){_0x1f1b62[_0xb381('0x1f')]=qs[_0xb381('0x1f')](_0x1c73b5[_0xb381('0x34')]['limit']);_0x1f1b62[_0xb381('0x1d')]=qs[_0xb381('0x1d')](_0x1c73b5['query'][_0xb381('0x1d')]);}_0x1f1b62['order']=qs[_0xb381('0x3b')](_0x1c73b5['query'][_0xb381('0x3b')]);_0x1f1b62[_0xb381('0x3c')]=qs[_0xb381('0x35')](_[_0xb381('0x3d')](_0x1c73b5[_0xb381('0x34')],_0x39c5e0[_0xb381('0x35')]),_0x3401cd);if(_0x1c73b5[_0xb381('0x34')][_0xb381('0x3e')]){_0x1f1b62[_0xb381('0x3c')]=_[_0xb381('0x3f')](_0x1f1b62[_0xb381('0x3c')],{'$or':_[_0xb381('0x2e')](_0x3401cd,function(_0x2d9e10){if(_0x2d9e10['type']!=='VIRTUAL'){var _0x323853={};_0x323853[_0x2d9e10[_0xb381('0x2b')]]={'$like':'%'+_0x1c73b5[_0xb381('0x34')][_0xb381('0x3e')]+'%'};return _0x323853;}})});}_0x1f1b62=_[_0xb381('0x3f')]({},_0x1f1b62,_0x1c73b5[_0xb381('0x40')]);var _0x1e1aff={'where':_0x1f1b62['where']};return db[_0xb381('0x2f')][_0xb381('0x20')](_0x1e1aff)['then'](function(_0x2a8853){_0x226284[_0xb381('0x20')]=_0x2a8853;if(_0x1c73b5[_0xb381('0x34')][_0xb381('0x41')]){_0x1f1b62[_0xb381('0x42')]=[{'all':!![]}];}return db[_0xb381('0x2f')]['findAll'](_0x1f1b62);})['then'](function(_0x16c8cd){_0x226284[_0xb381('0x43')]=_0x16c8cd;return _0x226284;})['then'](respondWithFilteredResult(_0x3659e5,_0x1f1b62))[_0xb381('0x44')](handleError(_0x3659e5,null));};exports[_0xb381('0x45')]=function(_0x41d978,_0x29d719){var _0x40831c={'raw':![],'where':{'id':_0x41d978[_0xb381('0x46')]['id']}},_0x4a982f={};_0x4a982f['model']=_[_0xb381('0x47')](db['AnalyticFieldReport'][_0xb381('0x30')]);_0x4a982f[_0xb381('0x34')]=_[_0xb381('0x47')](_0x41d978[_0xb381('0x34')]);_0x4a982f[_0xb381('0x35')]=_[_0xb381('0x37')](_0x4a982f[_0xb381('0x3a')],_0x4a982f['query']);_0x40831c['attributes']=_[_0xb381('0x37')](_0x4a982f[_0xb381('0x3a')],qs['fields'](_0x41d978[_0xb381('0x34')][_0xb381('0x38')]));_0x40831c[_0xb381('0x36')]=_0x40831c['attributes'][_0xb381('0x39')]?_0x40831c['attributes']:_0x4a982f[_0xb381('0x3a')];if(_0x41d978[_0xb381('0x34')][_0xb381('0x41')]){_0x40831c[_0xb381('0x42')]=[{'all':!![]}];}_0x40831c=_[_0xb381('0x3f')]({},_0x40831c,_0x41d978[_0xb381('0x40')]);return db[_0xb381('0x2f')][_0xb381('0x48')](_0x40831c)[_0xb381('0x27')](handleEntityNotFound(_0x29d719,null))['then'](respondWithResult(_0x29d719,null))[_0xb381('0x44')](handleError(_0x29d719,null));};exports['create']=function(_0x98053d,_0x5a112c){return db[_0xb381('0x2f')][_0xb381('0x49')](_0x98053d[_0xb381('0x4a')],{})['then'](respondWithResult(_0x5a112c,0xc9))[_0xb381('0x44')](handleError(_0x5a112c,null));};exports[_0xb381('0x4b')]=function(_0x58656b,_0x33e11b){return db[_0xb381('0x2f')][_0xb381('0x4b')](_0x58656b[_0xb381('0x4a')],{'raw':![],'individualHooks':!![]})[_0xb381('0x27')](respondWithResult(_0x33e11b,0xc9))[_0xb381('0x44')](handleError(_0x33e11b,null));};exports[_0xb381('0x26')]=function(_0x186721,_0x49db8a){if(_0x186721[_0xb381('0x4a')]['id']){delete _0x186721[_0xb381('0x4a')]['id'];}return db[_0xb381('0x2f')]['find']({'where':{'id':_0x186721[_0xb381('0x46')]['id']}})[_0xb381('0x27')](handleEntityNotFound(_0x49db8a,null))['then'](saveUpdates(_0x186721[_0xb381('0x4a')],null))[_0xb381('0x27')](respondWithResult(_0x49db8a,null))['catch'](handleError(_0x49db8a,null));};exports['destroy']=function(_0x460264,_0x3fcd51){return db[_0xb381('0x2f')][_0xb381('0x48')]({'where':{'id':_0x460264[_0xb381('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fcd51,null))['then'](removeEntity(_0x3fcd51,null))['catch'](handleError(_0x3fcd51,null));};exports['bulkDestroy']=function(_0x7e0157,_0x2740fa){return db[_0xb381('0x2f')][_0xb381('0x28')]({'where':{'id':_0x7e0157[_0xb381('0x34')][_0xb381('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xb381('0x27')](respondWithResult(_0x2740fa,0xcc))[_0xb381('0x44')](handleError(_0x2740fa,null));};exports[_0xb381('0x4d')]=function(_0x34e302,_0x598823,_0x2280c1){return db[_0xb381('0x4e')][_0xb381('0x4f')]({'where':{'id':_0x34e302[_0xb381('0x46')]['id']}})['then'](handleEntityNotFound(_0x598823,null))[_0xb381('0x27')](function(_0x215b6a){if(_0x215b6a){return db['sequelize'][_0xb381('0x50')](function(_0x3c702e){return db[_0xb381('0x2f')]['destroy']({'where':{'CustomReportId':_0x34e302[_0xb381('0x46')]['id']},'transaction':_0x3c702e})['then'](function(_0x36786b){var _0x3989f8=_[_0xb381('0x2e')](_0x34e302[_0xb381('0x4a')],function(_0x591ab3){delete _0x591ab3['id'];_0x591ab3[_0xb381('0x51')]=_0x34e302[_0xb381('0x46')]['id'];return _0x591ab3;});return db[_0xb381('0x2f')][_0xb381('0x4b')](_0x3989f8,{'transaction':_0x3c702e});});})[_0xb381('0x27')](function(){return db[_0xb381('0x2f')]['findAll']({'where':{'CustomReportId':_0x34e302[_0xb381('0x46')]['id']}});});}})[_0xb381('0x27')](respondWithResult(_0x598823,null))['catch'](handleError(_0x598823,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ead2f31..9620a35 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 _0x4514=['request-promise','path','rimraf','../../config/environment','exports','analytics_report_fields','lodash','util','../../config/logger','moment'];(function(_0x42e07c,_0x57098b){var _0x514610=function(_0xd3f628){while(--_0xd3f628){_0x42e07c['push'](_0x42e07c['shift']());}};_0x514610(++_0x57098b);}(_0x4514,0xd8));var _0x4451=function(_0x49be25,_0x3d95d8){_0x49be25=_0x49be25-0x0;var _0x47a85a=_0x4514[_0x49be25];return _0x47a85a;};'use strict';var _=require(_0x4451('0x0'));var util=require(_0x4451('0x1'));var logger=require(_0x4451('0x2'))('api');var moment=require(_0x4451('0x3'));var BPromise=require('bluebird');var rp=require(_0x4451('0x4'));var fs=require('fs');var path=require(_0x4451('0x5'));var rimraf=require(_0x4451('0x6'));var config=require(_0x4451('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x4451('0x8')]=function(_0x391363,_0x53a77b){return _0x391363['define']('AnalyticFieldReport',attributes,{'tableName':_0x4451('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfcc=['api','moment','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x316fba,_0x2ddcb5){var _0x2ee42d=function(_0x582419){while(--_0x582419){_0x316fba['push'](_0x316fba['shift']());}};_0x2ee42d(++_0x2ddcb5);}(_0xbfcc,0x128));var _0xcbfc=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xbfcc[_0x1e6659];return _0x4d16e4;};'use strict';var _=require(_0xcbfc('0x0'));var util=require(_0xcbfc('0x1'));var logger=require(_0xcbfc('0x2'))(_0xcbfc('0x3'));var moment=require(_0xcbfc('0x4'));var BPromise=require('bluebird');var rp=require(_0xcbfc('0x5'));var fs=require('fs');var path=require(_0xcbfc('0x6'));var rimraf=require('rimraf');var config=require(_0xcbfc('0x7'));var attributes=require(_0xcbfc('0x8'));module[_0xcbfc('0x9')]=function(_0x589009,_0x401957){return _0x589009[_0xcbfc('0xa')](_0xcbfc('0xb'),attributes,{'tableName':_0xcbfc('0xc'),'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 fd857e9..d3de0db 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 _0x7a63=['debug','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x59a69a,_0x20b8fb){var _0x59cb5a=function(_0x3a168b){while(--_0x3a168b){_0x59a69a['push'](_0x59a69a['shift']());}};_0x59cb5a(++_0x20b8fb);}(_0x7a63,0x11e));var _0x37a6=function(_0x269147,_0x3fcc85){_0x269147=_0x269147-0x0;var _0x32a4ce=_0x7a63[_0x269147];return _0x32a4ce;};'use strict';var _=require('lodash');var util=require(_0x37a6('0x0'));var moment=require(_0x37a6('0x1'));var BPromise=require(_0x37a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37a6('0x3'));var db=require(_0x37a6('0x4'))['db'];var utils=require(_0x37a6('0x5'));var logger=require('../../config/logger')(_0x37a6('0x6'));var config=require(_0x37a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x37a6('0x8')][_0x37a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e53aa,_0x25e0c5,_0x2b562f){return new BPromise(function(_0x4d6db0,_0x2111ae){return client[_0x37a6('0xa')](_0x4e53aa,_0x2b562f)['then'](function(_0x39ff1f){logger[_0x37a6('0xb')](_0x37a6('0xc'),_0x25e0c5,_0x37a6('0xd'));logger[_0x37a6('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x25e0c5,_0x37a6('0xd'),JSON[_0x37a6('0xf')](_0x39ff1f));if(_0x39ff1f['error']){if(_0x39ff1f[_0x37a6('0x10')][_0x37a6('0x11')]===0x1f4){logger[_0x37a6('0x10')](_0x37a6('0xc'),_0x25e0c5,_0x39ff1f[_0x37a6('0x10')][_0x37a6('0x12')]);return _0x2111ae(_0x39ff1f['error']['message']);}logger[_0x37a6('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x25e0c5,_0x39ff1f[_0x37a6('0x10')]['message']);return _0x4d6db0(_0x39ff1f[_0x37a6('0x10')][_0x37a6('0x12')]);}else{logger['info'](_0x37a6('0xc'),_0x25e0c5,_0x37a6('0xd'));_0x4d6db0(_0x39ff1f['result'][_0x37a6('0x12')]);}})[_0x37a6('0x13')](function(_0xb3f873){logger[_0x37a6('0x10')](_0x37a6('0xc'),_0x25e0c5,_0xb3f873);_0x2111ae(_0xb3f873);});});} \ No newline at end of file +var _0xcf9f=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5ad973,_0x3cc9de){var _0x3407ed=function(_0x58c4fb){while(--_0x58c4fb){_0x5ad973['push'](_0x5ad973['shift']());}};_0x3407ed(++_0x3cc9de);}(_0xcf9f,0x13d));var _0xfcf9=function(_0x5e7f47,_0x2f526e){_0x5e7f47=_0x5e7f47-0x0;var _0x57caee=_0xcf9f[_0x5e7f47];return _0x57caee;};'use strict';var _=require('lodash');var util=require(_0xfcf9('0x0'));var moment=require(_0xfcf9('0x1'));var BPromise=require('bluebird');var rs=require(_0xfcf9('0x2'));var fs=require('fs');var Redis=require(_0xfcf9('0x3'));var db=require(_0xfcf9('0x4'))['db'];var utils=require(_0xfcf9('0x5'));var logger=require(_0xfcf9('0x6'))(_0xfcf9('0x7'));var config=require(_0xfcf9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfcf9('0x9')][_0xfcf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ef0b7,_0x16d535,_0x3d4b00){return new BPromise(function(_0x37c825,_0xc3930d){return client[_0xfcf9('0xb')](_0x1ef0b7,_0x3d4b00)[_0xfcf9('0xc')](function(_0x192908){logger[_0xfcf9('0xd')](_0xfcf9('0xe'),_0x16d535,_0xfcf9('0xf'));logger['debug'](_0xfcf9('0x10'),_0x16d535,'request\x20sent',JSON[_0xfcf9('0x11')](_0x192908));if(_0x192908['error']){if(_0x192908[_0xfcf9('0x12')][_0xfcf9('0x13')]===0x1f4){logger[_0xfcf9('0x12')](_0xfcf9('0xe'),_0x16d535,_0x192908[_0xfcf9('0x12')]['message']);return _0xc3930d(_0x192908['error']['message']);}logger[_0xfcf9('0x12')](_0xfcf9('0xe'),_0x16d535,_0x192908[_0xfcf9('0x12')]['message']);return _0x37c825(_0x192908[_0xfcf9('0x12')][_0xfcf9('0x14')]);}else{logger[_0xfcf9('0xd')](_0xfcf9('0xe'),_0x16d535,_0xfcf9('0xf'));_0x37c825(_0x192908[_0xfcf9('0x15')][_0xfcf9('0x14')]);}})[_0xfcf9('0x16')](function(_0xc16c6c){logger[_0xfcf9('0x12')](_0xfcf9('0xe'),_0x16d535,_0xc16c6c);_0xc3930d(_0xc16c6c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 7cd5c75..18c0e25 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(_0xc2be2e,_0x56a5ec){var _0x8b38d4=function(_0x30ac55){while(--_0x30ac55){_0xc2be2e['push'](_0xc2be2e['shift']());}};_0x8b38d4(++_0x56a5ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x545b51,_0x3928a0){var _0x9ac8a6=function(_0x3db365){while(--_0x3db365){_0x545b51['push'](_0x545b51['shift']());}};_0x9ac8a6(++_0x3928a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 113948f..f810418 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 _0x2cb0=['sequelize','exports','name','STRING','TEXT'];(function(_0x2fd88d,_0x37d225){var _0x2d5323=function(_0x22404f){while(--_0x22404f){_0x2fd88d['push'](_0x2fd88d['shift']());}};_0x2d5323(++_0x37d225);}(_0x2cb0,0x12c));var _0x02cb=function(_0x5b5701,_0x27a3b5){_0x5b5701=_0x5b5701-0x0;var _0x245fe8=_0x2cb0[_0x5b5701];return _0x245fe8;};'use strict';var Sequelize=require(_0x02cb('0x0'));module[_0x02cb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x02cb('0x2')},'table':{'type':Sequelize[_0x02cb('0x3')]},'metric':{'type':Sequelize[_0x02cb('0x4')]},'description':{'type':Sequelize[_0x02cb('0x3')]}}; \ No newline at end of file +var _0xfc61=['sequelize','exports','STRING','name'];(function(_0x21be30,_0x470620){var _0x5874d8=function(_0xebaa72){while(--_0xebaa72){_0x21be30['push'](_0x21be30['shift']());}};_0x5874d8(++_0x470620);}(_0xfc61,0x78));var _0x1fc6=function(_0x4d2b3f,_0x408d7e){_0x4d2b3f=_0x4d2b3f-0x0;var _0x47bef1=_0xfc61[_0x4d2b3f];return _0x47bef1;};'use strict';var Sequelize=require(_0x1fc6('0x0'));module[_0x1fc6('0x1')]={'name':{'type':Sequelize[_0x1fc6('0x2')],'allowNull':![],'unique':_0x1fc6('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index fd6816e..acc8231 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(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x84ab,0x12f));var _0xb84a=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x84ab[_0x5a7d5f];return _0x5dcded;};'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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x187371,_0x5ae3e3){var _0x3a7787=function(_0x50b23e){while(--_0x50b23e){_0x187371['push'](_0x187371['shift']());}};_0x3a7787(++_0x5ae3e3);}(_0x9a19,0x114));var _0x99a1=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x9a19[_0x31ced5];return _0x10d9e5;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ccc84ee..5144ba0 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 _0xe14a=['exports','define','AnalyticMetric','analytics_metrics','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x74397c,_0x238e74){var _0x53a7d2=function(_0x5ebdfc){while(--_0x5ebdfc){_0x74397c['push'](_0x74397c['shift']());}};_0x53a7d2(++_0x238e74);}(_0xe14a,0x94));var _0xae14=function(_0x381883,_0x445784){_0x381883=_0x381883-0x0;var _0x44f175=_0xe14a[_0x381883];return _0x44f175;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae14('0x0'));var rp=require(_0xae14('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae14('0x2'));var config=require(_0xae14('0x3'));var attributes=require(_0xae14('0x4'));module[_0xae14('0x5')]=function(_0x2b5138,_0x3a6279){return _0x2b5138[_0xae14('0x6')](_0xae14('0x7'),attributes,{'tableName':_0xae14('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2087=['analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','AnalyticMetric'];(function(_0xf6520a,_0x5959cd){var _0x40301a=function(_0x33f154){while(--_0x33f154){_0xf6520a['push'](_0xf6520a['shift']());}};_0x40301a(++_0x5959cd);}(_0x2087,0xf3));var _0x7208=function(_0x1998f5,_0x4aae86){_0x1998f5=_0x1998f5-0x0;var _0x3f768e=_0x2087[_0x1998f5];return _0x3f768e;};'use strict';var _=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var logger=require(_0x7208('0x2'))(_0x7208('0x3'));var moment=require('moment');var BPromise=require(_0x7208('0x4'));var rp=require(_0x7208('0x5'));var fs=require('fs');var path=require(_0x7208('0x6'));var rimraf=require(_0x7208('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x7208('0x8')]=function(_0x5cc93f,_0x3c7d9d){return _0x5cc93f['define'](_0x7208('0x9'),attributes,{'tableName':_0x7208('0xa'),'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 955a4dd..67aabea 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 _0x6e07=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5d4381,_0x4e8c05){var _0x2d99bd=function(_0x5d37c8){while(--_0x5d37c8){_0x5d4381['push'](_0x5d4381['shift']());}};_0x2d99bd(++_0x4e8c05);}(_0x6e07,0xf9));var _0x76e0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6e07[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x76e0('0x0'));var moment=require(_0x76e0('0x1'));var BPromise=require(_0x76e0('0x2'));var rs=require(_0x76e0('0x3'));var fs=require('fs');var Redis=require(_0x76e0('0x4'));var db=require(_0x76e0('0x5'))['db'];var utils=require(_0x76e0('0x6'));var logger=require(_0x76e0('0x7'))(_0x76e0('0x8'));var config=require(_0x76e0('0x9'));var jayson=require(_0x76e0('0xa'));var client=jayson[_0x76e0('0xb')][_0x76e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x158982,_0x53fd77,_0x7d80c2){return new BPromise(function(_0x10cbf4,_0x3638c8){return client['request'](_0x158982,_0x7d80c2)[_0x76e0('0xd')](function(_0x31f0b7){logger[_0x76e0('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x53fd77,_0x76e0('0xf'));logger[_0x76e0('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x53fd77,_0x76e0('0xf'),JSON[_0x76e0('0x11')](_0x31f0b7));if(_0x31f0b7[_0x76e0('0x12')]){if(_0x31f0b7['error']['code']===0x1f4){logger['error'](_0x76e0('0x13'),_0x53fd77,_0x31f0b7[_0x76e0('0x12')]['message']);return _0x3638c8(_0x31f0b7['error'][_0x76e0('0x14')]);}logger[_0x76e0('0x12')](_0x76e0('0x13'),_0x53fd77,_0x31f0b7[_0x76e0('0x12')]['message']);return _0x10cbf4(_0x31f0b7['error'][_0x76e0('0x14')]);}else{logger[_0x76e0('0xe')](_0x76e0('0x13'),_0x53fd77,_0x76e0('0xf'));_0x10cbf4(_0x31f0b7[_0x76e0('0x15')]['message']);}})[_0x76e0('0x16')](function(_0x4f2a58){logger[_0x76e0('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x53fd77,_0x4f2a58);_0x3638c8(_0x4f2a58);});});} \ No newline at end of file +var _0xa77c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x303d18,_0x216807){var _0x5daa73=function(_0x4e37f6){while(--_0x4e37f6){_0x303d18['push'](_0x303d18['shift']());}};_0x5daa73(++_0x216807);}(_0xa77c,0xaa));var _0xca77=function(_0x24b5c7,_0xebed55){_0x24b5c7=_0x24b5c7-0x0;var _0x19f269=_0xa77c[_0x24b5c7];return _0x19f269;};'use strict';var _=require(_0xca77('0x0'));var util=require(_0xca77('0x1'));var moment=require(_0xca77('0x2'));var BPromise=require(_0xca77('0x3'));var rs=require(_0xca77('0x4'));var fs=require('fs');var Redis=require(_0xca77('0x5'));var db=require(_0xca77('0x6'))['db'];var utils=require(_0xca77('0x7'));var logger=require(_0xca77('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca77('0x9'));var client=jayson[_0xca77('0xa')][_0xca77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1362d1,_0x2997b1,_0x50ebb4){return new BPromise(function(_0xa35e9a,_0x3c5005){return client[_0xca77('0xc')](_0x1362d1,_0x50ebb4)[_0xca77('0xd')](function(_0x2733bc){logger[_0xca77('0xe')](_0xca77('0xf'),_0x2997b1,_0xca77('0x10'));logger[_0xca77('0x11')](_0xca77('0x12'),_0x2997b1,_0xca77('0x10'),JSON[_0xca77('0x13')](_0x2733bc));if(_0x2733bc[_0xca77('0x14')]){if(_0x2733bc['error'][_0xca77('0x15')]===0x1f4){logger[_0xca77('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x2997b1,_0x2733bc[_0xca77('0x14')][_0xca77('0x16')]);return _0x3c5005(_0x2733bc[_0xca77('0x14')]['message']);}logger['error'](_0xca77('0xf'),_0x2997b1,_0x2733bc[_0xca77('0x14')][_0xca77('0x16')]);return _0xa35e9a(_0x2733bc['error'][_0xca77('0x16')]);}else{logger[_0xca77('0xe')](_0xca77('0xf'),_0x2997b1,_0xca77('0x10'));_0xa35e9a(_0x2733bc[_0xca77('0x17')]['message']);}})[_0xca77('0x18')](function(_0x4e8d28){logger[_0xca77('0x14')](_0xca77('0xf'),_0x2997b1,_0x4e8d28);_0x3c5005(_0x4e8d28);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 52fb7cd..8d6c5cc 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 _0x8ca9=['express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45a5b5,_0x3cf11b){var _0x2d856f=function(_0x2c7a15){while(--_0x2c7a15){_0x45a5b5['push'](_0x45a5b5['shift']());}};_0x2d856f(++_0x3cf11b);}(_0x8ca9,0x9c));var _0x98ca=function(_0x66e507,_0x3b65bb){_0x66e507=_0x66e507-0x0;var _0x66823b=_0x8ca9[_0x66e507];return _0x66823b;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var fs_extra=require(_0x98ca('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x7'));var controller=require('./analyticMetric.controller');router[_0x98ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x9')]);router[_0x98ca('0x8')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xc')]);router[_0x98ca('0xd')]('/',auth[_0x98ca('0xb')](),controller[_0x98ca('0xe')]);router[_0x98ca('0xf')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x11')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x12')]);module[_0x98ca('0x13')]=router; \ No newline at end of file +var _0xe4d9=['path','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','show','isAuthenticated','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0xe4d9,0x141));var _0x9e4d=function(_0x5778d5,_0x4c05fb){_0x5778d5=_0x5778d5-0x0;var _0x3fc5c3=_0xe4d9[_0x5778d5];return _0x3fc5c3;};'use strict';var multer=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var path=require(_0x9e4d('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e4d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e4d('0x4'));var interaction=require(_0x9e4d('0x5'));var config=require('../../config/environment');var controller=require(_0x9e4d('0x6'));router[_0x9e4d('0x7')]('/',auth['isAuthenticated'](),controller[_0x9e4d('0x8')]);router[_0x9e4d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9e4d('0x9')]);router['post']('/',auth[_0x9e4d('0xa')](),controller[_0x9e4d('0xb')]);router['put'](_0x9e4d('0xc'),auth[_0x9e4d('0xa')](),controller[_0x9e4d('0xd')]);router[_0x9e4d('0xe')](_0x9e4d('0xc'),auth[_0x9e4d('0xa')](),controller[_0x9e4d('0xf')]);module[_0x9e4d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 38dc8c6..7a2319e 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 _0xf402=['TEXT','sequelize','exports'];(function(_0x47378d,_0xf6bf20){var _0x2369aa=function(_0x575814){while(--_0x575814){_0x47378d['push'](_0x47378d['shift']());}};_0x2369aa(++_0xf6bf20);}(_0xf402,0x124));var _0x2f40=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf402[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x2f40('0x0'));module[_0x2f40('0x1')]={'tree':{'type':Sequelize[_0x2f40('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc727=['TEXT','sequelize','exports'];(function(_0x300eb6,_0x576dce){var _0x22a706=function(_0xc3972a){while(--_0xc3972a){_0x300eb6['push'](_0x300eb6['shift']());}};_0x22a706(++_0x576dce);}(_0xc727,0x18a));var _0x7c72=function(_0x52652f,_0x138b0f){_0x52652f=_0x52652f-0x0;var _0x51db50=_0xc727[_0x52652f];return _0x51db50;};'use strict';var Sequelize=require(_0x7c72('0x0'));module[_0x7c72('0x1')]={'tree':{'type':Sequelize[_0x7c72('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 3670069..1b66150 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 _0xfda4=['body','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','update'];(function(_0x10effa,_0x14ff60){var _0x9b0053=function(_0x2551be){while(--_0x2551be){_0x10effa['push'](_0x10effa['shift']());}};_0x9b0053(++_0x14ff60);}(_0xfda4,0x8d));var _0x4fda=function(_0xeeb6dd,_0x3e5f7b){_0xeeb6dd=_0xeeb6dd-0x0;var _0x95d347=_0xfda4[_0xeeb6dd];return _0x95d347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fda('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4fda('0x1'));var moment=require('moment');var BPromise=require(_0x4fda('0x2'));var Mustache=require(_0x4fda('0x3'));var util=require(_0x4fda('0x4'));var path=require(_0x4fda('0x5'));var sox=require(_0x4fda('0x6'));var csv=require('to-csv');var ejs=require(_0x4fda('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fda('0x8'));var squel=require('squel');var crypto=require(_0x4fda('0x9'));var jsforce=require(_0x4fda('0xa'));var deskjs=require(_0x4fda('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4fda('0xc'));var Papa=require(_0x4fda('0xd'));var Redis=require(_0x4fda('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4fda('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4fda('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4fda('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3bff,_0x58a65d){_0x58a65d=_0x58a65d||0xcc;return function(_0x54e1a3){if(_0x54e1a3){return _0x3e3bff[_0x4fda('0x12')](_0x58a65d);}return _0x3e3bff[_0x4fda('0x13')](_0x58a65d)[_0x4fda('0x14')]();};}function respondWithResult(_0x1c497b,_0x57f50f){_0x57f50f=_0x57f50f||0xc8;return function(_0x5555cd){if(_0x5555cd){return _0x1c497b[_0x4fda('0x13')](_0x57f50f)[_0x4fda('0x15')](_0x5555cd);}};}function respondWithFilteredResult(_0x785202,_0xff2a5d){return function(_0xfcb48){if(_0xfcb48){var _0x178d16=typeof _0xff2a5d[_0x4fda('0x16')]==='undefined'&&typeof _0xff2a5d[_0x4fda('0x17')]===_0x4fda('0x18');var _0x2570a8=_0xfcb48[_0x4fda('0x19')];var _0x181c1e=_0x178d16?0x0:_0xff2a5d[_0x4fda('0x16')];var _0x573a98=_0x178d16?_0xfcb48[_0x4fda('0x19')]:_0xff2a5d[_0x4fda('0x16')]+_0xff2a5d[_0x4fda('0x17')];var _0x38de64;if(_0x573a98>=_0x2570a8){_0x573a98=_0x2570a8;_0x38de64=0xc8;}else{_0x38de64=0xce;}_0x785202[_0x4fda('0x13')](_0x38de64);return _0x785202[_0x4fda('0x1a')](_0x4fda('0x1b'),_0x181c1e+'-'+_0x573a98+'/'+_0x2570a8)[_0x4fda('0x15')](_0xfcb48);}return null;};}function patchUpdates(_0x62f799){return function(_0x3cad2c){try{jsonpatch[_0x4fda('0x1c')](_0x3cad2c,_0x62f799,!![]);}catch(_0x1d61b0){return BPromise['reject'](_0x1d61b0);}return _0x3cad2c[_0x4fda('0x1d')]();};}function saveUpdates(_0x526444,_0x104fd6){return function(_0x1e0418){if(_0x1e0418){return _0x1e0418['update'](_0x526444)[_0x4fda('0x1e')](function(_0x1510ad){return _0x1510ad;});}return null;};}function removeEntity(_0x19148f,_0x2c2ca3){return function(_0x760ce1){if(_0x760ce1){return _0x760ce1[_0x4fda('0x1f')]()[_0x4fda('0x1e')](function(){_0x19148f[_0x4fda('0x13')](0xcc)[_0x4fda('0x14')]();});}};}function handleEntityNotFound(_0x212a6d,_0x14678a){return function(_0x5f19e5){if(!_0x5f19e5){_0x212a6d[_0x4fda('0x12')](0x194);}return _0x5f19e5;};}function handleError(_0x4b788e,_0x3297f2){_0x3297f2=_0x3297f2||0x1f4;return function(_0x14e7a3){logger['error'](_0x14e7a3[_0x4fda('0x20')]);if(_0x14e7a3['name']){delete _0x14e7a3[_0x4fda('0x21')];}_0x4b788e[_0x4fda('0x13')](_0x3297f2)[_0x4fda('0x22')](_0x14e7a3);};}exports[_0x4fda('0x23')]=function(_0x13d900,_0x44e9d7){var _0x15c93d={},_0x567dbf={},_0x30d62a={'count':0x0,'rows':[]};var _0x596b56=_[_0x4fda('0x24')](db[_0x4fda('0x25')][_0x4fda('0x26')],function(_0x4e27c){return{'name':_0x4e27c[_0x4fda('0x27')],'type':_0x4e27c['type']['key']};});_0x567dbf[_0x4fda('0x28')]=_[_0x4fda('0x24')](_0x596b56,_0x4fda('0x21'));_0x567dbf[_0x4fda('0x29')]=_[_0x4fda('0x2a')](_0x13d900[_0x4fda('0x29')]);_0x567dbf['filters']=_['intersection'](_0x567dbf[_0x4fda('0x28')],_0x567dbf[_0x4fda('0x29')]);_0x15c93d[_0x4fda('0x2b')]=_[_0x4fda('0x2c')](_0x567dbf[_0x4fda('0x28')],qs['fields'](_0x13d900['query'][_0x4fda('0x2d')]));_0x15c93d['attributes']=_0x15c93d[_0x4fda('0x2b')][_0x4fda('0x2e')]?_0x15c93d[_0x4fda('0x2b')]:_0x567dbf[_0x4fda('0x28')];if(!_0x13d900['query'][_0x4fda('0x2f')](_0x4fda('0x30'))){_0x15c93d[_0x4fda('0x17')]=qs[_0x4fda('0x17')](_0x13d900['query'][_0x4fda('0x17')]);_0x15c93d[_0x4fda('0x16')]=qs['offset'](_0x13d900['query'][_0x4fda('0x16')]);}_0x15c93d[_0x4fda('0x31')]=qs[_0x4fda('0x32')](_0x13d900[_0x4fda('0x29')]['sort']);_0x15c93d['where']=qs[_0x4fda('0x33')](_[_0x4fda('0x34')](_0x13d900[_0x4fda('0x29')],_0x567dbf['filters']),_0x596b56);if(_0x13d900[_0x4fda('0x29')]['filter']){_0x15c93d[_0x4fda('0x35')]=_[_0x4fda('0x36')](_0x15c93d[_0x4fda('0x35')],{'$or':_['map'](_0x596b56,function(_0x318b4f){if(_0x318b4f[_0x4fda('0x37')]!==_0x4fda('0x38')){var _0x833ded={};_0x833ded[_0x318b4f[_0x4fda('0x21')]]={'$like':'%'+_0x13d900[_0x4fda('0x29')][_0x4fda('0x39')]+'%'};return _0x833ded;}})});}_0x15c93d=_['merge']({},_0x15c93d,_0x13d900[_0x4fda('0x3a')]);var _0x15983e={'where':_0x15c93d[_0x4fda('0x35')]};return db[_0x4fda('0x25')][_0x4fda('0x19')](_0x15983e)['then'](function(_0x5a4c68){_0x30d62a[_0x4fda('0x19')]=_0x5a4c68;if(_0x13d900[_0x4fda('0x29')][_0x4fda('0x3b')]){_0x15c93d['include']=[{'all':!![]}];}return db[_0x4fda('0x25')][_0x4fda('0x3c')](_0x15c93d);})[_0x4fda('0x1e')](function(_0x58856b){_0x30d62a[_0x4fda('0x3d')]=_0x58856b;return _0x30d62a;})[_0x4fda('0x1e')](respondWithFilteredResult(_0x44e9d7,_0x15c93d))[_0x4fda('0x3e')](handleError(_0x44e9d7,null));};exports[_0x4fda('0x3f')]=function(_0x1ab0ad,_0xafde6c){var _0x43c4d0={'raw':!![],'where':{'id':_0x1ab0ad[_0x4fda('0x40')]['id']}},_0x4c35a4={};_0x4c35a4[_0x4fda('0x28')]=_[_0x4fda('0x2a')](db[_0x4fda('0x25')][_0x4fda('0x26')]);_0x4c35a4[_0x4fda('0x29')]=_[_0x4fda('0x2a')](_0x1ab0ad['query']);_0x4c35a4['filters']=_[_0x4fda('0x2c')](_0x4c35a4[_0x4fda('0x28')],_0x4c35a4[_0x4fda('0x29')]);_0x43c4d0[_0x4fda('0x2b')]=_[_0x4fda('0x2c')](_0x4c35a4['model'],qs[_0x4fda('0x2d')](_0x1ab0ad[_0x4fda('0x29')][_0x4fda('0x2d')]));_0x43c4d0[_0x4fda('0x2b')]=_0x43c4d0[_0x4fda('0x2b')][_0x4fda('0x2e')]?_0x43c4d0[_0x4fda('0x2b')]:_0x4c35a4[_0x4fda('0x28')];if(_0x1ab0ad['query'][_0x4fda('0x3b')]){_0x43c4d0[_0x4fda('0x41')]=[{'all':!![]}];}_0x43c4d0=_[_0x4fda('0x36')]({},_0x43c4d0,_0x1ab0ad['options']);return db[_0x4fda('0x25')][_0x4fda('0x42')](_0x43c4d0)[_0x4fda('0x1e')](handleEntityNotFound(_0xafde6c,null))['then'](respondWithResult(_0xafde6c,null))[_0x4fda('0x3e')](handleError(_0xafde6c,null));};exports[_0x4fda('0x43')]=function(_0x2c0567,_0x392089){return db[_0x4fda('0x25')]['create'](_0x2c0567['body'],{})['then'](respondWithResult(_0x392089,0xc9))['catch'](handleError(_0x392089,null));};exports[_0x4fda('0x44')]=function(_0x16a584,_0x2440bd){if(_0x16a584[_0x4fda('0x45')]['id']){delete _0x16a584[_0x4fda('0x45')]['id'];}return db[_0x4fda('0x25')][_0x4fda('0x42')]({'where':{'id':_0x16a584[_0x4fda('0x40')]['id']}})[_0x4fda('0x1e')](handleEntityNotFound(_0x2440bd,null))[_0x4fda('0x1e')](saveUpdates(_0x16a584[_0x4fda('0x45')],null))['then'](respondWithResult(_0x2440bd,null))[_0x4fda('0x3e')](handleError(_0x2440bd,null));};exports[_0x4fda('0x1f')]=function(_0x3cf467,_0x5013e0){return db['AnalyticTreeReport']['find']({'where':{'id':_0x3cf467[_0x4fda('0x40')]['id']}})[_0x4fda('0x1e')](handleEntityNotFound(_0x5013e0,null))[_0x4fda('0x1e')](removeEntity(_0x5013e0,null))[_0x4fda('0x3e')](handleError(_0x5013e0,null));}; \ No newline at end of file +var _0xdb91=['../../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','set','apply','update','then','destroy','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdb91,0x1b0));var _0x1db9=function(_0x157fe3,_0x4f76fc){_0x157fe3=_0x157fe3-0x0;var _0x4f2791=_0xdb91[_0x157fe3];return _0x4f2791;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1db9('0x0'));var jsonpatch=require(_0x1db9('0x1'));var rp=require(_0x1db9('0x2'));var moment=require(_0x1db9('0x3'));var BPromise=require(_0x1db9('0x4'));var Mustache=require(_0x1db9('0x5'));var util=require(_0x1db9('0x6'));var path=require(_0x1db9('0x7'));var sox=require(_0x1db9('0x8'));var csv=require('to-csv');var ejs=require(_0x1db9('0x9'));var fs=require('fs');var fs_extra=require(_0x1db9('0xa'));var _=require(_0x1db9('0xb'));var squel=require(_0x1db9('0xc'));var crypto=require(_0x1db9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1db9('0xe'));var toCsv=require(_0x1db9('0xf'));var querystring=require(_0x1db9('0x10'));var Papa=require(_0x1db9('0x11'));var Redis=require('ioredis');var authService=require(_0x1db9('0x12'));var qs=require(_0x1db9('0x13'));var as=require(_0x1db9('0x14'));var hardwareService=require(_0x1db9('0x15'));var logger=require(_0x1db9('0x16'))(_0x1db9('0x17'));var utils=require(_0x1db9('0x18'));var config=require(_0x1db9('0x19'));var licenseUtil=require(_0x1db9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281a6e,_0x182247){_0x182247=_0x182247||0xcc;return function(_0xee2cf0){if(_0xee2cf0){return _0x281a6e[_0x1db9('0x1b')](_0x182247);}return _0x281a6e[_0x1db9('0x1c')](_0x182247)[_0x1db9('0x1d')]();};}function respondWithResult(_0x2b949c,_0x547ec2){_0x547ec2=_0x547ec2||0xc8;return function(_0x77f835){if(_0x77f835){return _0x2b949c[_0x1db9('0x1c')](_0x547ec2)[_0x1db9('0x1e')](_0x77f835);}};}function respondWithFilteredResult(_0x414984,_0x34657c){return function(_0x3ec63b){if(_0x3ec63b){var _0x5d1650=typeof _0x34657c['offset']===_0x1db9('0x1f')&&typeof _0x34657c[_0x1db9('0x20')]===_0x1db9('0x1f');var _0x3ceeb6=_0x3ec63b[_0x1db9('0x21')];var _0x2b67a8=_0x5d1650?0x0:_0x34657c[_0x1db9('0x22')];var _0x3ac83a=_0x5d1650?_0x3ec63b[_0x1db9('0x21')]:_0x34657c[_0x1db9('0x22')]+_0x34657c[_0x1db9('0x20')];var _0x264688;if(_0x3ac83a>=_0x3ceeb6){_0x3ac83a=_0x3ceeb6;_0x264688=0xc8;}else{_0x264688=0xce;}_0x414984[_0x1db9('0x1c')](_0x264688);return _0x414984[_0x1db9('0x23')]('Content-Range',_0x2b67a8+'-'+_0x3ac83a+'/'+_0x3ceeb6)['json'](_0x3ec63b);}return null;};}function patchUpdates(_0x3a3d89){return function(_0x4289bf){try{jsonpatch[_0x1db9('0x24')](_0x4289bf,_0x3a3d89,!![]);}catch(_0x4485eb){return BPromise['reject'](_0x4485eb);}return _0x4289bf['save']();};}function saveUpdates(_0x5b453e,_0x13ce81){return function(_0x5adaf0){if(_0x5adaf0){return _0x5adaf0[_0x1db9('0x25')](_0x5b453e)[_0x1db9('0x26')](function(_0x413f1f){return _0x413f1f;});}return null;};}function removeEntity(_0x43ebb4,_0x3f4c6){return function(_0x32b880){if(_0x32b880){return _0x32b880[_0x1db9('0x27')]()[_0x1db9('0x26')](function(){_0x43ebb4[_0x1db9('0x1c')](0xcc)[_0x1db9('0x1d')]();});}};}function handleEntityNotFound(_0x4ac2ed,_0x2dd666){return function(_0x12637f){if(!_0x12637f){_0x4ac2ed[_0x1db9('0x1b')](0x194);}return _0x12637f;};}function handleError(_0xdb1d5,_0x34d4b1){_0x34d4b1=_0x34d4b1||0x1f4;return function(_0x234a18){logger[_0x1db9('0x28')](_0x234a18['stack']);if(_0x234a18[_0x1db9('0x29')]){delete _0x234a18[_0x1db9('0x29')];}_0xdb1d5[_0x1db9('0x1c')](_0x34d4b1)['send'](_0x234a18);};}exports['index']=function(_0x424d27,_0x11c630){var _0x1960a8={},_0x2b81b0={},_0x2039fa={'count':0x0,'rows':[]};var _0x3221c9=_[_0x1db9('0x2a')](db[_0x1db9('0x2b')][_0x1db9('0x2c')],function(_0x3408ec){return{'name':_0x3408ec[_0x1db9('0x2d')],'type':_0x3408ec['type'][_0x1db9('0x2e')]};});_0x2b81b0['model']=_['map'](_0x3221c9,_0x1db9('0x29'));_0x2b81b0[_0x1db9('0x2f')]=_['keys'](_0x424d27[_0x1db9('0x2f')]);_0x2b81b0[_0x1db9('0x30')]=_[_0x1db9('0x31')](_0x2b81b0['model'],_0x2b81b0[_0x1db9('0x2f')]);_0x1960a8[_0x1db9('0x32')]=_['intersection'](_0x2b81b0['model'],qs[_0x1db9('0x33')](_0x424d27['query'][_0x1db9('0x33')]));_0x1960a8[_0x1db9('0x32')]=_0x1960a8[_0x1db9('0x32')][_0x1db9('0x34')]?_0x1960a8[_0x1db9('0x32')]:_0x2b81b0[_0x1db9('0x35')];if(!_0x424d27[_0x1db9('0x2f')][_0x1db9('0x36')]('nolimit')){_0x1960a8[_0x1db9('0x20')]=qs[_0x1db9('0x20')](_0x424d27['query'][_0x1db9('0x20')]);_0x1960a8[_0x1db9('0x22')]=qs[_0x1db9('0x22')](_0x424d27['query']['offset']);}_0x1960a8[_0x1db9('0x37')]=qs[_0x1db9('0x38')](_0x424d27[_0x1db9('0x2f')][_0x1db9('0x38')]);_0x1960a8[_0x1db9('0x39')]=qs[_0x1db9('0x30')](_[_0x1db9('0x3a')](_0x424d27[_0x1db9('0x2f')],_0x2b81b0[_0x1db9('0x30')]),_0x3221c9);if(_0x424d27['query']['filter']){_0x1960a8[_0x1db9('0x39')]=_[_0x1db9('0x3b')](_0x1960a8['where'],{'$or':_[_0x1db9('0x2a')](_0x3221c9,function(_0x50a056){if(_0x50a056[_0x1db9('0x3c')]!==_0x1db9('0x3d')){var _0x2dfdfd={};_0x2dfdfd[_0x50a056[_0x1db9('0x29')]]={'$like':'%'+_0x424d27[_0x1db9('0x2f')][_0x1db9('0x3e')]+'%'};return _0x2dfdfd;}})});}_0x1960a8=_[_0x1db9('0x3b')]({},_0x1960a8,_0x424d27[_0x1db9('0x3f')]);var _0x44fa8c={'where':_0x1960a8[_0x1db9('0x39')]};return db[_0x1db9('0x2b')][_0x1db9('0x21')](_0x44fa8c)['then'](function(_0xe0bb64){_0x2039fa['count']=_0xe0bb64;if(_0x424d27[_0x1db9('0x2f')]['includeAll']){_0x1960a8[_0x1db9('0x40')]=[{'all':!![]}];}return db[_0x1db9('0x2b')][_0x1db9('0x41')](_0x1960a8);})['then'](function(_0x1522a9){_0x2039fa[_0x1db9('0x42')]=_0x1522a9;return _0x2039fa;})[_0x1db9('0x26')](respondWithFilteredResult(_0x11c630,_0x1960a8))['catch'](handleError(_0x11c630,null));};exports[_0x1db9('0x43')]=function(_0x4dade5,_0x24ba1d){var _0x2e22f0={'raw':!![],'where':{'id':_0x4dade5[_0x1db9('0x44')]['id']}},_0x190082={};_0x190082[_0x1db9('0x35')]=_[_0x1db9('0x45')](db[_0x1db9('0x2b')][_0x1db9('0x2c')]);_0x190082[_0x1db9('0x2f')]=_['keys'](_0x4dade5[_0x1db9('0x2f')]);_0x190082[_0x1db9('0x30')]=_[_0x1db9('0x31')](_0x190082['model'],_0x190082['query']);_0x2e22f0[_0x1db9('0x32')]=_[_0x1db9('0x31')](_0x190082[_0x1db9('0x35')],qs[_0x1db9('0x33')](_0x4dade5['query'][_0x1db9('0x33')]));_0x2e22f0[_0x1db9('0x32')]=_0x2e22f0[_0x1db9('0x32')][_0x1db9('0x34')]?_0x2e22f0[_0x1db9('0x32')]:_0x190082[_0x1db9('0x35')];if(_0x4dade5['query'][_0x1db9('0x46')]){_0x2e22f0['include']=[{'all':!![]}];}_0x2e22f0=_[_0x1db9('0x3b')]({},_0x2e22f0,_0x4dade5[_0x1db9('0x3f')]);return db[_0x1db9('0x2b')][_0x1db9('0x47')](_0x2e22f0)[_0x1db9('0x26')](handleEntityNotFound(_0x24ba1d,null))['then'](respondWithResult(_0x24ba1d,null))[_0x1db9('0x48')](handleError(_0x24ba1d,null));};exports[_0x1db9('0x49')]=function(_0xcf0f35,_0x585295){return db['AnalyticTreeReport'][_0x1db9('0x49')](_0xcf0f35['body'],{})[_0x1db9('0x26')](respondWithResult(_0x585295,0xc9))['catch'](handleError(_0x585295,null));};exports[_0x1db9('0x25')]=function(_0x19310e,_0x2ee192){if(_0x19310e[_0x1db9('0x4a')]['id']){delete _0x19310e[_0x1db9('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x1db9('0x47')]({'where':{'id':_0x19310e[_0x1db9('0x44')]['id']}})[_0x1db9('0x26')](handleEntityNotFound(_0x2ee192,null))['then'](saveUpdates(_0x19310e[_0x1db9('0x4a')],null))['then'](respondWithResult(_0x2ee192,null))[_0x1db9('0x48')](handleError(_0x2ee192,null));};exports[_0x1db9('0x27')]=function(_0x3e1e85,_0x57b8a6){return db['AnalyticTreeReport'][_0x1db9('0x47')]({'where':{'id':_0x3e1e85[_0x1db9('0x44')]['id']}})[_0x1db9('0x26')](handleEntityNotFound(_0x57b8a6,null))[_0x1db9('0x26')](removeEntity(_0x57b8a6,null))['catch'](handleError(_0x57b8a6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7446f69..d99c0e3 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 _0x51f2=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x29e5a7,_0x2fcd7f){var _0x3c72db=function(_0x30ba19){while(--_0x30ba19){_0x29e5a7['push'](_0x29e5a7['shift']());}};_0x3c72db(++_0x2fcd7f);}(_0x51f2,0x77));var _0x251f=function(_0x3752ef,_0x377837){_0x3752ef=_0x3752ef-0x0;var _0xf91ec2=_0x51f2[_0x3752ef];return _0xf91ec2;};'use strict';var _=require(_0x251f('0x0'));var util=require('util');var logger=require(_0x251f('0x1'))(_0x251f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x251f('0x3'));var config=require(_0x251f('0x4'));var attributes=require(_0x251f('0x5'));module[_0x251f('0x6')]=function(_0x5b7416,_0x1fce04){return _0x5b7416['define'](_0x251f('0x7'),attributes,{'tableName':_0x251f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdac3=['path','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x39f7b6,_0x57f2ca){var _0x372521=function(_0x49527){while(--_0x49527){_0x39f7b6['push'](_0x39f7b6['shift']());}};_0x372521(++_0x57f2ca);}(_0xdac3,0x1c7));var _0x3dac=function(_0x9c3c94,_0x296e5a){_0x9c3c94=_0x9c3c94-0x0;var _0x598937=_0xdac3[_0x9c3c94];return _0x598937;};'use strict';var _=require('lodash');var util=require(_0x3dac('0x0'));var logger=require(_0x3dac('0x1'))('api');var moment=require(_0x3dac('0x2'));var BPromise=require(_0x3dac('0x3'));var rp=require(_0x3dac('0x4'));var fs=require('fs');var path=require(_0x3dac('0x5'));var rimraf=require('rimraf');var config=require(_0x3dac('0x6'));var attributes=require(_0x3dac('0x7'));module['exports']=function(_0x4ecd34,_0x5716e1){return _0x4ecd34[_0x3dac('0x8')](_0x3dac('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index f1c48cf..23cd010 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x15f1cc,_0x1e99c9){var _0x3549d7=function(_0x3e2e04){while(--_0x3e2e04){_0x15f1cc['push'](_0x15f1cc['shift']());}};_0x3549d7(++_0x1e99c9);}(_0x1261,0x144));var _0x1126=function(_0x8cb470,_0x2b9757){_0x8cb470=_0x8cb470-0x0;var _0x2ca139=_0x1261[_0x8cb470];return _0x2ca139;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x523671,_0x4657fc){var _0x5b0bdc=function(_0x301007){while(--_0x301007){_0x523671['push'](_0x523671['shift']());}};_0x5b0bdc(++_0x4657fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x172000,_0x56dd6c){_0x172000=_0x172000-0x0;var _0x13cee5=_0x2ef3[_0x172000];return _0x13cee5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b8f93cd..8421255 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 _0x597e=['delete','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x597e,0x1e3));var _0xe597=function(_0x3100d7,_0x2cb5ee){_0x3100d7=_0x3100d7-0x0;var _0x34ab38=_0x597e[_0x3100d7];return _0x34ab38;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe597('0x0'));var express=require(_0xe597('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe597('0x2'));var interaction=require(_0xe597('0x3'));var config=require(_0xe597('0x4'));var controller=require(_0xe597('0x5'));router[_0xe597('0x6')]('/',auth[_0xe597('0x7')](),controller['index']);router[_0xe597('0x6')](_0xe597('0x8'),auth['isAuthenticated'](),controller[_0xe597('0x9')]);router['post']('/',auth[_0xe597('0x7')](),controller[_0xe597('0xa')]);router[_0xe597('0xb')](_0xe597('0x8'),auth[_0xe597('0x7')](),controller[_0xe597('0xc')]);router[_0xe597('0xd')](_0xe597('0x8'),auth[_0xe597('0x7')](),controller[_0xe597('0xe')]);module[_0xe597('0xf')]=router; \ No newline at end of file +var _0x9433=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9433,0x181));var _0x3943=function(_0x195cd1,_0x54ec93){_0x195cd1=_0x195cd1-0x0;var _0x4b6af2=_0x9433[_0x195cd1];return _0x4b6af2;};'use strict';var multer=require(_0x3943('0x0'));var util=require(_0x3943('0x1'));var path=require(_0x3943('0x2'));var timeout=require(_0x3943('0x3'));var express=require(_0x3943('0x4'));var router=express[_0x3943('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3943('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3943('0x7'));router[_0x3943('0x8')]('/',auth[_0x3943('0x9')](),controller[_0x3943('0xa')]);router[_0x3943('0x8')](_0x3943('0xb'),auth[_0x3943('0x9')](),controller[_0x3943('0xc')]);router[_0x3943('0xd')]('/',auth[_0x3943('0x9')](),controller[_0x3943('0xe')]);router[_0x3943('0xf')](_0x3943('0xb'),auth[_0x3943('0x9')](),controller[_0x3943('0x10')]);router[_0x3943('0x11')]('/:id',auth[_0x3943('0x9')](),controller[_0x3943('0x12')]);module[_0x3943('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e1d8496..9eebda5 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 _0x2557=['sequelize','STRING'];(function(_0x514b9a,_0x95c0c8){var _0x3adf88=function(_0x4875f0){while(--_0x4875f0){_0x514b9a['push'](_0x514b9a['shift']());}};_0x3adf88(++_0x95c0c8);}(_0x2557,0x11e));var _0x7255=function(_0xf317de,_0xee24f5){_0xf317de=_0xf317de-0x0;var _0x127838=_0x2557[_0xf317de];return _0x127838;};'use strict';var Sequelize=require(_0x7255('0x0'));module['exports']={'name':{'type':Sequelize[_0x7255('0x1')]},'basename':{'type':Sequelize[_0x7255('0x1')]},'type':{'type':Sequelize[_0x7255('0x1')]}}; \ No newline at end of file +var _0xd847=['STRING','sequelize','exports'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xd847,0x18a));var _0x7d84=function(_0xc445cc,_0x2d7b13){_0xc445cc=_0xc445cc-0x0;var _0x4cb500=_0xd847[_0xc445cc];return _0x4cb500;};'use strict';var Sequelize=require(_0x7d84('0x0'));module[_0x7d84('0x1')]={'name':{'type':Sequelize[_0x7d84('0x2')]},'basename':{'type':Sequelize[_0x7d84('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6bad01e..2df92a5 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 _0x400d=['hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','clone','length','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','filename','mimetype','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x400d,0x1ca));var _0xd400=function(_0x3c5cc8,_0x336027){_0x3c5cc8=_0x3c5cc8-0x0;var _0x44675c=_0x400d[_0x3c5cc8];return _0x44675c;};'use strict';var emlformat=require(_0xd400('0x0'));var rimraf=require(_0xd400('0x1'));var zipdir=require(_0xd400('0x2'));var jsonpatch=require(_0xd400('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd400('0x4'));var Mustache=require('mustache');var util=require(_0xd400('0x5'));var path=require('path');var sox=require(_0xd400('0x6'));var csv=require(_0xd400('0x7'));var ejs=require(_0xd400('0x8'));var fs=require('fs');var fs_extra=require(_0xd400('0x9'));var _=require(_0xd400('0xa'));var squel=require(_0xd400('0xb'));var crypto=require(_0xd400('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd400('0xd'));var toCsv=require(_0xd400('0x7'));var querystring=require(_0xd400('0xe'));var Papa=require(_0xd400('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd400('0x10'));var as=require(_0xd400('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd400('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd400('0x13'));var db=require(_0xd400('0x14'))['db'];function respondWithStatusCode(_0x511e59,_0x5886ee){_0x5886ee=_0x5886ee||0xcc;return function(_0x3e233f){if(_0x3e233f){return _0x511e59[_0xd400('0x15')](_0x5886ee);}return _0x511e59[_0xd400('0x16')](_0x5886ee)[_0xd400('0x17')]();};}function respondWithResult(_0x1c3d2a,_0x41a445){_0x41a445=_0x41a445||0xc8;return function(_0x17184a){if(_0x17184a){return _0x1c3d2a[_0xd400('0x16')](_0x41a445)[_0xd400('0x18')](_0x17184a);}};}function respondWithFilteredResult(_0x3645b7,_0x49e544){return function(_0x49d31e){if(_0x49d31e){var _0x5f1ddd=typeof _0x49e544['offset']===_0xd400('0x19')&&typeof _0x49e544[_0xd400('0x1a')]===_0xd400('0x19');var _0x5b4919=_0x49d31e[_0xd400('0x1b')];var _0x52a005=_0x5f1ddd?0x0:_0x49e544[_0xd400('0x1c')];var _0x150452=_0x5f1ddd?_0x49d31e[_0xd400('0x1b')]:_0x49e544[_0xd400('0x1c')]+_0x49e544[_0xd400('0x1a')];var _0x547a9f;if(_0x150452>=_0x5b4919){_0x150452=_0x5b4919;_0x547a9f=0xc8;}else{_0x547a9f=0xce;}_0x3645b7[_0xd400('0x16')](_0x547a9f);return _0x3645b7[_0xd400('0x1d')](_0xd400('0x1e'),_0x52a005+'-'+_0x150452+'/'+_0x5b4919)[_0xd400('0x18')](_0x49d31e);}return null;};}function patchUpdates(_0x1e8d7f){return function(_0x37dd71){try{jsonpatch[_0xd400('0x1f')](_0x37dd71,_0x1e8d7f,!![]);}catch(_0x342d90){return BPromise[_0xd400('0x20')](_0x342d90);}return _0x37dd71['save']();};}function saveUpdates(_0x3af716,_0x1c16ad){return function(_0x24345a){if(_0x24345a){return _0x24345a['update'](_0x3af716)[_0xd400('0x21')](function(_0x256e02){return _0x256e02;});}return null;};}function removeEntity(_0x2fde81,_0x3706ea){return function(_0x2da8a7){if(_0x2da8a7){return _0x2da8a7[_0xd400('0x22')]()[_0xd400('0x21')](function(){_0x2fde81['status'](0xcc)[_0xd400('0x17')]();});}};}function handleEntityNotFound(_0x179833,_0x205849){return function(_0x48458e){if(!_0x48458e){_0x179833[_0xd400('0x15')](0x194);}return _0x48458e;};}function handleError(_0x48ac3a,_0x2781de){_0x2781de=_0x2781de||0x1f4;return function(_0x2d48f7){logger[_0xd400('0x23')](_0x2d48f7[_0xd400('0x24')]);if(_0x2d48f7[_0xd400('0x25')]){delete _0x2d48f7[_0xd400('0x25')];}_0x48ac3a[_0xd400('0x16')](_0x2781de)[_0xd400('0x26')](_0x2d48f7);};}exports[_0xd400('0x27')]=function(_0x10efcf,_0x262d82){var _0x2046d1={},_0x2e1955={},_0x4aaddc={'count':0x0,'rows':[]};var _0x379221=_[_0xd400('0x28')](db[_0xd400('0x29')][_0xd400('0x2a')],function(_0x3e75bb){return{'name':_0x3e75bb['fieldName'],'type':_0x3e75bb[_0xd400('0x2b')][_0xd400('0x2c')]};});_0x2e1955['model']=_['map'](_0x379221,_0xd400('0x25'));_0x2e1955[_0xd400('0x2d')]=_[_0xd400('0x2e')](_0x10efcf['query']);_0x2e1955[_0xd400('0x2f')]=_[_0xd400('0x30')](_0x2e1955[_0xd400('0x31')],_0x2e1955['query']);_0x2046d1[_0xd400('0x32')]=_[_0xd400('0x30')](_0x2e1955[_0xd400('0x31')],qs[_0xd400('0x33')](_0x10efcf[_0xd400('0x2d')][_0xd400('0x33')]));_0x2046d1[_0xd400('0x32')]=_0x2046d1[_0xd400('0x32')]['length']?_0x2046d1[_0xd400('0x32')]:_0x2e1955[_0xd400('0x31')];if(!_0x10efcf[_0xd400('0x2d')][_0xd400('0x34')](_0xd400('0x35'))){_0x2046d1[_0xd400('0x1a')]=qs[_0xd400('0x1a')](_0x10efcf[_0xd400('0x2d')][_0xd400('0x1a')]);_0x2046d1[_0xd400('0x1c')]=qs[_0xd400('0x1c')](_0x10efcf[_0xd400('0x2d')][_0xd400('0x1c')]);}_0x2046d1['order']=qs[_0xd400('0x36')](_0x10efcf['query'][_0xd400('0x36')]);_0x2046d1[_0xd400('0x37')]=qs[_0xd400('0x2f')](_['pick'](_0x10efcf['query'],_0x2e1955['filters']),_0x379221);if(_0x10efcf[_0xd400('0x2d')]['filter']){_0x2046d1[_0xd400('0x37')]=_[_0xd400('0x38')](_0x2046d1[_0xd400('0x37')],{'$or':_[_0xd400('0x28')](_0x379221,function(_0x4011f5){if(_0x4011f5[_0xd400('0x2b')]!==_0xd400('0x39')){var _0x3af403={};_0x3af403[_0x4011f5[_0xd400('0x25')]]={'$like':'%'+_0x10efcf[_0xd400('0x2d')][_0xd400('0x3a')]+'%'};return _0x3af403;}})});}_0x2046d1=_[_0xd400('0x38')]({},_0x2046d1,_0x10efcf[_0xd400('0x3b')]);var _0x33bd7a={'where':_0x2046d1[_0xd400('0x37')]};return db[_0xd400('0x29')][_0xd400('0x1b')](_0x33bd7a)[_0xd400('0x21')](function(_0x52755c){_0x4aaddc['count']=_0x52755c;if(_0x10efcf[_0xd400('0x2d')][_0xd400('0x3c')]){_0x2046d1[_0xd400('0x3d')]=[{'all':!![]}];}return db[_0xd400('0x29')][_0xd400('0x3e')](_0x2046d1);})[_0xd400('0x21')](function(_0x122133){_0x4aaddc[_0xd400('0x3f')]=_0x122133;return _0x4aaddc;})['then'](respondWithFilteredResult(_0x262d82,_0x2046d1))[_0xd400('0x40')](handleError(_0x262d82,null));};exports[_0xd400('0x41')]=function(_0xc35eaa,_0x15cee5){var _0x1d0d03={'raw':!![],'where':{'id':_0xc35eaa[_0xd400('0x42')]['id']}},_0x552fb7={};_0x552fb7[_0xd400('0x31')]=_[_0xd400('0x2e')](db[_0xd400('0x29')]['rawAttributes']);_0x552fb7[_0xd400('0x2d')]=_['keys'](_0xc35eaa[_0xd400('0x2d')]);_0x552fb7[_0xd400('0x2f')]=_['intersection'](_0x552fb7[_0xd400('0x31')],_0x552fb7['query']);_0x1d0d03[_0xd400('0x32')]=_[_0xd400('0x30')](_0x552fb7['model'],qs[_0xd400('0x33')](_0xc35eaa[_0xd400('0x2d')][_0xd400('0x33')]));_0x1d0d03['attributes']=_0x1d0d03[_0xd400('0x32')]['length']?_0x1d0d03[_0xd400('0x32')]:_0x552fb7[_0xd400('0x31')];if(_0xc35eaa[_0xd400('0x2d')][_0xd400('0x3c')]){_0x1d0d03[_0xd400('0x3d')]=[{'all':!![]}];}_0x1d0d03=_[_0xd400('0x38')]({},_0x1d0d03,_0xc35eaa['options']);return db[_0xd400('0x29')][_0xd400('0x43')](_0x1d0d03)[_0xd400('0x21')](handleEntityNotFound(_0x15cee5,null))['then'](respondWithResult(_0x15cee5,null))[_0xd400('0x40')](handleError(_0x15cee5,null));};exports[_0xd400('0x44')]=function(_0x427de0,_0x2ded5b){var _0x28a6d4={'where':{'id':_0x427de0[_0xd400('0x42')]['id']}},_0x1fba4e={};_0x1fba4e[_0xd400('0x31')]=_['keys'](db[_0xd400('0x29')]['rawAttributes']);_0x28a6d4['attributes']=_['intersection'](_0x1fba4e[_0xd400('0x31')],qs['fields'](_0x427de0[_0xd400('0x2d')]['fields']));_0x28a6d4[_0xd400('0x32')]=_0x28a6d4[_0xd400('0x32')][_0xd400('0x45')]?_0x28a6d4[_0xd400('0x32')]:_0x1fba4e['model'];if(_0x427de0[_0xd400('0x2d')]['includeAll']){_0x28a6d4['include']=[{'all':!![]}];}_0x28a6d4=_[_0xd400('0x38')]({},_0x28a6d4,_0x427de0[_0xd400('0x3b')]);return db['Attachment'][_0xd400('0x43')](_0x28a6d4)[_0xd400('0x21')](handleEntityNotFound(_0x2ded5b,null))['then'](function(_0x395502){if(_0x395502){var _0x36678b=_0x395502['get']({'plain':!![]});_0x36678b=qs[_0xd400('0x46')](_0x36678b,['id',_0xd400('0x47'),'updatedAt']);_0x427de0[_0xd400('0x48')]=_['omit'](_0x427de0[_0xd400('0x48')],['id','createdAt',_0xd400('0x49')]);return db[_0xd400('0x29')][_0xd400('0x4a')](_[_0xd400('0x38')](_0x36678b,_0x427de0[_0xd400('0x48')]),{'include':_0x427de0[_0xd400('0x2d')][_0xd400('0x3c')]?[{'all':!![]}]:undefined});}})[_0xd400('0x21')](respondWithResult(_0x2ded5b,0xc9))[_0xd400('0x40')](handleError(_0x2ded5b,null));};exports[_0xd400('0x4b')]=function(_0x3f8f2d,_0xaf167e){if(_0x3f8f2d[_0xd400('0x48')]['id']){delete _0x3f8f2d[_0xd400('0x48')]['id'];}return db[_0xd400('0x29')][_0xd400('0x43')]({'where':{'id':_0x3f8f2d[_0xd400('0x42')]['id']}})[_0xd400('0x21')](handleEntityNotFound(_0xaf167e,null))[_0xd400('0x21')](saveUpdates(_0x3f8f2d[_0xd400('0x48')],null))[_0xd400('0x21')](respondWithResult(_0xaf167e,null))['catch'](handleError(_0xaf167e,null));};exports[_0xd400('0x22')]=function(_0x3b404e,_0x4d1dfe){return db[_0xd400('0x29')][_0xd400('0x43')]({'where':{'id':_0x3b404e[_0xd400('0x42')]['id']}})[_0xd400('0x21')](handleEntityNotFound(_0x4d1dfe,null))[_0xd400('0x21')](removeEntity(_0x4d1dfe,null))['catch'](handleError(_0x4d1dfe,null));};exports[_0xd400('0x4a')]=function(_0x5c3149,_0xd1dd99,_0x188065){_0x5c3149[_0xd400('0x48')][_0xd400('0x25')]=_0x5c3149[_0xd400('0x4c')][_0xd400('0x4d')];_0x5c3149[_0xd400('0x48')][_0xd400('0x4e')]=_0x5c3149[_0xd400('0x4c')][_0xd400('0x4f')];_0x5c3149[_0xd400('0x48')]['type']=_0x5c3149[_0xd400('0x4c')][_0xd400('0x50')];return db[_0xd400('0x29')][_0xd400('0x4a')](_0x5c3149[_0xd400('0x48')])['then'](respondWithResult(_0xd1dd99,0xc9))[_0xd400('0x40')](handleError(_0xd1dd99,null));};exports['download']=function(_0x319059,_0x3a1641,_0x2711e5){return db['Attachment']['findOne']({'where':{'id':_0x319059[_0xd400('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3a1641,null))[_0xd400('0x21')](function(_0x2ccf50){if(_0x2ccf50){var _0xa0502e=_0x2ccf50['ChatOfflineMessageId']!==null;var _0x3a6150=path[_0xd400('0x51')](config[_0xd400('0x52')],_0xd400('0x53'));if(_0xa0502e){_0x3a6150=path['join'](_0x3a6150,'offline-chat/');}var _0x123a56=path[_0xd400('0x51')](_0x3a6150,_0x2ccf50[_0xd400('0x4e')]);return _0x3a1641[_0xd400('0x54')](_0x123a56);}})[_0xd400('0x40')](handleError(_0x3a1641,null));}; \ No newline at end of file +var _0x3253=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','Attachment','find','catch','clone','params','omit','updatedAt','body','create','file','basename','filename','mimetype','download','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x692cb,_0x4cd91d){var _0x3e5d0e=function(_0x4420d8){while(--_0x4420d8){_0x692cb['push'](_0x692cb['shift']());}};_0x3e5d0e(++_0x4cd91d);}(_0x3253,0xf6));var _0x3325=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x3253[_0x5b47d9];return _0x4151f0;};'use strict';var emlformat=require(_0x3325('0x0'));var rimraf=require(_0x3325('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3325('0x2'));var rp=require(_0x3325('0x3'));var moment=require(_0x3325('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3325('0x5'));var util=require(_0x3325('0x6'));var path=require('path');var sox=require(_0x3325('0x7'));var csv=require(_0x3325('0x8'));var ejs=require(_0x3325('0x9'));var fs=require('fs');var fs_extra=require(_0x3325('0xa'));var _=require(_0x3325('0xb'));var squel=require(_0x3325('0xc'));var crypto=require('crypto');var jsforce=require(_0x3325('0xd'));var deskjs=require(_0x3325('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3325('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3325('0x10'));var qs=require(_0x3325('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3325('0x12'));var logger=require(_0x3325('0x13'))(_0x3325('0x14'));var utils=require(_0x3325('0x15'));var config=require(_0x3325('0x16'));var licenseUtil=require(_0x3325('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d4ec8,_0x5e7270){_0x5e7270=_0x5e7270||0xcc;return function(_0x58fbef){if(_0x58fbef){return _0x5d4ec8['sendStatus'](_0x5e7270);}return _0x5d4ec8[_0x3325('0x18')](_0x5e7270)[_0x3325('0x19')]();};}function respondWithResult(_0x4d9d23,_0x4c015d){_0x4c015d=_0x4c015d||0xc8;return function(_0x2ef776){if(_0x2ef776){return _0x4d9d23[_0x3325('0x18')](_0x4c015d)[_0x3325('0x1a')](_0x2ef776);}};}function respondWithFilteredResult(_0x3bda39,_0x30df9f){return function(_0x45c072){if(_0x45c072){var _0x5b89d0=typeof _0x30df9f[_0x3325('0x1b')]===_0x3325('0x1c')&&typeof _0x30df9f[_0x3325('0x1d')]==='undefined';var _0x580100=_0x45c072[_0x3325('0x1e')];var _0x164861=_0x5b89d0?0x0:_0x30df9f[_0x3325('0x1b')];var _0x32c499=_0x5b89d0?_0x45c072[_0x3325('0x1e')]:_0x30df9f[_0x3325('0x1b')]+_0x30df9f['limit'];var _0x58d9e5;if(_0x32c499>=_0x580100){_0x32c499=_0x580100;_0x58d9e5=0xc8;}else{_0x58d9e5=0xce;}_0x3bda39[_0x3325('0x18')](_0x58d9e5);return _0x3bda39[_0x3325('0x1f')](_0x3325('0x20'),_0x164861+'-'+_0x32c499+'/'+_0x580100)[_0x3325('0x1a')](_0x45c072);}return null;};}function patchUpdates(_0x36185b){return function(_0xd7fc87){try{jsonpatch['apply'](_0xd7fc87,_0x36185b,!![]);}catch(_0x423b0c){return BPromise[_0x3325('0x21')](_0x423b0c);}return _0xd7fc87[_0x3325('0x22')]();};}function saveUpdates(_0x163962,_0x17ef02){return function(_0x5ac090){if(_0x5ac090){return _0x5ac090[_0x3325('0x23')](_0x163962)['then'](function(_0x6c811a){return _0x6c811a;});}return null;};}function removeEntity(_0x4a3abc,_0x4eea53){return function(_0x170e43){if(_0x170e43){return _0x170e43[_0x3325('0x24')]()[_0x3325('0x25')](function(){_0x4a3abc[_0x3325('0x18')](0xcc)[_0x3325('0x19')]();});}};}function handleEntityNotFound(_0x343c7a,_0x3806f7){return function(_0x52c4e7){if(!_0x52c4e7){_0x343c7a[_0x3325('0x26')](0x194);}return _0x52c4e7;};}function handleError(_0xda843c,_0x7449ae){_0x7449ae=_0x7449ae||0x1f4;return function(_0x5529d0){logger[_0x3325('0x27')](_0x5529d0[_0x3325('0x28')]);if(_0x5529d0[_0x3325('0x29')]){delete _0x5529d0[_0x3325('0x29')];}_0xda843c['status'](_0x7449ae)[_0x3325('0x2a')](_0x5529d0);};}exports[_0x3325('0x2b')]=function(_0x5fb281,_0x1e1017){var _0x397143={},_0x53fd4d={},_0x4d970f={'count':0x0,'rows':[]};var _0xb87d0f=_[_0x3325('0x2c')](db['Attachment'][_0x3325('0x2d')],function(_0x50d482){return{'name':_0x50d482[_0x3325('0x2e')],'type':_0x50d482[_0x3325('0x2f')][_0x3325('0x30')]};});_0x53fd4d['model']=_[_0x3325('0x2c')](_0xb87d0f,'name');_0x53fd4d[_0x3325('0x31')]=_[_0x3325('0x32')](_0x5fb281[_0x3325('0x31')]);_0x53fd4d['filters']=_[_0x3325('0x33')](_0x53fd4d[_0x3325('0x34')],_0x53fd4d[_0x3325('0x31')]);_0x397143[_0x3325('0x35')]=_[_0x3325('0x33')](_0x53fd4d[_0x3325('0x34')],qs[_0x3325('0x36')](_0x5fb281[_0x3325('0x31')][_0x3325('0x36')]));_0x397143[_0x3325('0x35')]=_0x397143[_0x3325('0x35')][_0x3325('0x37')]?_0x397143[_0x3325('0x35')]:_0x53fd4d['model'];if(!_0x5fb281[_0x3325('0x31')][_0x3325('0x38')](_0x3325('0x39'))){_0x397143[_0x3325('0x1d')]=qs['limit'](_0x5fb281[_0x3325('0x31')][_0x3325('0x1d')]);_0x397143[_0x3325('0x1b')]=qs[_0x3325('0x1b')](_0x5fb281[_0x3325('0x31')][_0x3325('0x1b')]);}_0x397143['order']=qs[_0x3325('0x3a')](_0x5fb281[_0x3325('0x31')][_0x3325('0x3a')]);_0x397143[_0x3325('0x3b')]=qs[_0x3325('0x3c')](_[_0x3325('0x3d')](_0x5fb281['query'],_0x53fd4d[_0x3325('0x3c')]),_0xb87d0f);if(_0x5fb281[_0x3325('0x31')][_0x3325('0x3e')]){_0x397143[_0x3325('0x3b')]=_['merge'](_0x397143[_0x3325('0x3b')],{'$or':_[_0x3325('0x2c')](_0xb87d0f,function(_0x16928a){if(_0x16928a[_0x3325('0x2f')]!=='VIRTUAL'){var _0x5e60a5={};_0x5e60a5[_0x16928a[_0x3325('0x29')]]={'$like':'%'+_0x5fb281[_0x3325('0x31')][_0x3325('0x3e')]+'%'};return _0x5e60a5;}})});}_0x397143=_[_0x3325('0x3f')]({},_0x397143,_0x5fb281[_0x3325('0x40')]);var _0x3b0d17={'where':_0x397143[_0x3325('0x3b')]};return db['Attachment']['count'](_0x3b0d17)['then'](function(_0x5cd64){_0x4d970f[_0x3325('0x1e')]=_0x5cd64;if(_0x5fb281[_0x3325('0x31')][_0x3325('0x41')]){_0x397143[_0x3325('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x3325('0x43')](_0x397143);})[_0x3325('0x25')](function(_0x76e782){_0x4d970f[_0x3325('0x44')]=_0x76e782;return _0x4d970f;})[_0x3325('0x25')](respondWithFilteredResult(_0x1e1017,_0x397143))['catch'](handleError(_0x1e1017,null));};exports[_0x3325('0x45')]=function(_0x180ae4,_0x1005e7){var _0x3ce915={'raw':!![],'where':{'id':_0x180ae4['params']['id']}},_0x3c1758={};_0x3c1758[_0x3325('0x34')]=_[_0x3325('0x32')](db[_0x3325('0x46')][_0x3325('0x2d')]);_0x3c1758['query']=_[_0x3325('0x32')](_0x180ae4['query']);_0x3c1758[_0x3325('0x3c')]=_[_0x3325('0x33')](_0x3c1758[_0x3325('0x34')],_0x3c1758[_0x3325('0x31')]);_0x3ce915[_0x3325('0x35')]=_[_0x3325('0x33')](_0x3c1758[_0x3325('0x34')],qs[_0x3325('0x36')](_0x180ae4['query'][_0x3325('0x36')]));_0x3ce915['attributes']=_0x3ce915[_0x3325('0x35')]['length']?_0x3ce915[_0x3325('0x35')]:_0x3c1758[_0x3325('0x34')];if(_0x180ae4['query'][_0x3325('0x41')]){_0x3ce915[_0x3325('0x42')]=[{'all':!![]}];}_0x3ce915=_[_0x3325('0x3f')]({},_0x3ce915,_0x180ae4[_0x3325('0x40')]);return db[_0x3325('0x46')][_0x3325('0x47')](_0x3ce915)['then'](handleEntityNotFound(_0x1005e7,null))[_0x3325('0x25')](respondWithResult(_0x1005e7,null))[_0x3325('0x48')](handleError(_0x1005e7,null));};exports[_0x3325('0x49')]=function(_0x3c6f0f,_0x41c3c1){var _0xbc10fc={'where':{'id':_0x3c6f0f[_0x3325('0x4a')]['id']}},_0x597438={};_0x597438[_0x3325('0x34')]=_[_0x3325('0x32')](db[_0x3325('0x46')][_0x3325('0x2d')]);_0xbc10fc[_0x3325('0x35')]=_[_0x3325('0x33')](_0x597438[_0x3325('0x34')],qs['fields'](_0x3c6f0f[_0x3325('0x31')][_0x3325('0x36')]));_0xbc10fc[_0x3325('0x35')]=_0xbc10fc[_0x3325('0x35')]['length']?_0xbc10fc[_0x3325('0x35')]:_0x597438[_0x3325('0x34')];if(_0x3c6f0f[_0x3325('0x31')][_0x3325('0x41')]){_0xbc10fc['include']=[{'all':!![]}];}_0xbc10fc=_[_0x3325('0x3f')]({},_0xbc10fc,_0x3c6f0f['options']);return db['Attachment'][_0x3325('0x47')](_0xbc10fc)[_0x3325('0x25')](handleEntityNotFound(_0x41c3c1,null))[_0x3325('0x25')](function(_0x12e097){if(_0x12e097){var _0x2ef0dd=_0x12e097['get']({'plain':!![]});_0x2ef0dd=qs[_0x3325('0x4b')](_0x2ef0dd,['id','createdAt',_0x3325('0x4c')]);_0x3c6f0f[_0x3325('0x4d')]=_[_0x3325('0x4b')](_0x3c6f0f[_0x3325('0x4d')],['id','createdAt',_0x3325('0x4c')]);return db[_0x3325('0x46')][_0x3325('0x4e')](_[_0x3325('0x3f')](_0x2ef0dd,_0x3c6f0f[_0x3325('0x4d')]),{'include':_0x3c6f0f['query'][_0x3325('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x41c3c1,0xc9))[_0x3325('0x48')](handleError(_0x41c3c1,null));};exports[_0x3325('0x23')]=function(_0x49ea3c,_0x25596f){if(_0x49ea3c[_0x3325('0x4d')]['id']){delete _0x49ea3c[_0x3325('0x4d')]['id'];}return db[_0x3325('0x46')]['find']({'where':{'id':_0x49ea3c[_0x3325('0x4a')]['id']}})[_0x3325('0x25')](handleEntityNotFound(_0x25596f,null))[_0x3325('0x25')](saveUpdates(_0x49ea3c['body'],null))[_0x3325('0x25')](respondWithResult(_0x25596f,null))['catch'](handleError(_0x25596f,null));};exports[_0x3325('0x24')]=function(_0x3ab421,_0x3d71f7){return db[_0x3325('0x46')][_0x3325('0x47')]({'where':{'id':_0x3ab421['params']['id']}})[_0x3325('0x25')](handleEntityNotFound(_0x3d71f7,null))['then'](removeEntity(_0x3d71f7,null))[_0x3325('0x48')](handleError(_0x3d71f7,null));};exports[_0x3325('0x4e')]=function(_0x45bd51,_0x1ae281,_0x241816){_0x45bd51[_0x3325('0x4d')]['name']=_0x45bd51[_0x3325('0x4f')]['originalname'];_0x45bd51[_0x3325('0x4d')][_0x3325('0x50')]=_0x45bd51['file'][_0x3325('0x51')];_0x45bd51['body'][_0x3325('0x2f')]=_0x45bd51['file'][_0x3325('0x52')];return db[_0x3325('0x46')]['create'](_0x45bd51['body'])[_0x3325('0x25')](respondWithResult(_0x1ae281,0xc9))[_0x3325('0x48')](handleError(_0x1ae281,null));};exports[_0x3325('0x53')]=function(_0x27cf18,_0x27c7be,_0x3ab0c9){return db[_0x3325('0x46')]['findOne']({'where':{'id':_0x27cf18[_0x3325('0x4a')]['id']},'raw':!![]})[_0x3325('0x25')](handleEntityNotFound(_0x27c7be,null))[_0x3325('0x25')](function(_0x2dcd0e){if(_0x2dcd0e){var _0x50978b=_0x2dcd0e[_0x3325('0x54')]!==null;var _0x5c92fb=path[_0x3325('0x55')](config['root'],'server/files/attachments/');if(_0x50978b){_0x5c92fb=path[_0x3325('0x55')](_0x5c92fb,_0x3325('0x56'));}var _0x4636ef=path['join'](_0x5c92fb,_0x2dcd0e['basename']);return _0x27c7be[_0x3325('0x53')](_0x4636ef);}})['catch'](handleError(_0x27c7be,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0d8024f..045cd42 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 _0x835a=['define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0x835a,0x66));var _0xa835=function(_0x5db010,_0x49469f){_0x5db010=_0x5db010-0x0;var _0x527c72=_0x835a[_0x5db010];return _0x527c72;};'use strict';var _=require(_0xa835('0x0'));var util=require('util');var logger=require(_0xa835('0x1'))(_0xa835('0x2'));var moment=require(_0xa835('0x3'));var BPromise=require(_0xa835('0x4'));var rp=require(_0xa835('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa835('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xa835('0x7')]=function(_0x3e4b5f,_0x2572af){return _0x3e4b5f[_0xa835('0x8')](_0xa835('0x9'),attributes,{'tableName':_0xa835('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b90=['define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1730d7,_0x130c47){var _0x7d4107=function(_0x5a89a1){while(--_0x5a89a1){_0x1730d7['push'](_0x1730d7['shift']());}};_0x7d4107(++_0x130c47);}(_0x0b90,0x10d));var _0x00b9=function(_0xbf54aa,_0x242ccf){_0xbf54aa=_0xbf54aa-0x0;var _0x5a7478=_0x0b90[_0xbf54aa];return _0x5a7478;};'use strict';var _=require(_0x00b9('0x0'));var util=require(_0x00b9('0x1'));var logger=require(_0x00b9('0x2'))(_0x00b9('0x3'));var moment=require(_0x00b9('0x4'));var BPromise=require(_0x00b9('0x5'));var rp=require(_0x00b9('0x6'));var fs=require('fs');var path=require(_0x00b9('0x7'));var rimraf=require(_0x00b9('0x8'));var config=require(_0x00b9('0x9'));var attributes=require('./attachment.attributes');module[_0x00b9('0xa')]=function(_0x4e9e11,_0x280a2f){return _0x4e9e11[_0x00b9('0xb')](_0x00b9('0xc'),attributes,{'tableName':_0x00b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 4600e81..e5dc80f 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 _0x89f7=['result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x4217cf,_0x39fc3f){var _0x1f5722=function(_0x7993af){while(--_0x7993af){_0x4217cf['push'](_0x4217cf['shift']());}};_0x1f5722(++_0x39fc3f);}(_0x89f7,0x105));var _0x789f=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x89f7[_0x4ed17b];return _0x24b248;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var moment=require(_0x789f('0x2'));var BPromise=require('bluebird');var rs=require(_0x789f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x789f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x789f('0x5'))(_0x789f('0x6'));var config=require(_0x789f('0x7'));var jayson=require(_0x789f('0x8'));var client=jayson['client'][_0x789f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1faaa5,_0x2e2dba,_0x1037cc){return new BPromise(function(_0x48f79b,_0x4f59aa){return client[_0x789f('0xa')](_0x1faaa5,_0x1037cc)[_0x789f('0xb')](function(_0x23f5c5){logger['info'](_0x789f('0xc'),_0x2e2dba,_0x789f('0xd'));logger[_0x789f('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2e2dba,'request\x20sent',JSON['stringify'](_0x23f5c5));if(_0x23f5c5['error']){if(_0x23f5c5[_0x789f('0xf')][_0x789f('0x10')]===0x1f4){logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x23f5c5[_0x789f('0xf')][_0x789f('0x11')]);return _0x4f59aa(_0x23f5c5['error'][_0x789f('0x11')]);}logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x23f5c5[_0x789f('0xf')]['message']);return _0x48f79b(_0x23f5c5[_0x789f('0xf')]['message']);}else{logger[_0x789f('0x12')]('Attachment,\x20%s,\x20%s',_0x2e2dba,'request\x20sent');_0x48f79b(_0x23f5c5[_0x789f('0x13')][_0x789f('0x11')]);}})[_0x789f('0x14')](function(_0x137f51){logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x137f51);_0x4f59aa(_0x137f51);});});}exports[_0x789f('0x15')]=function(_0x509853){var _0xb4a258=this;return new Promise(function(_0x678cfb,_0x27d632){return db[_0x789f('0x16')][_0x789f('0x17')](_0x509853[_0x789f('0x18')],{'raw':_0x509853['options']?_0x509853[_0x789f('0x19')][_0x789f('0x1a')]===undefined?!![]:![]:!![]})[_0x789f('0xb')](function(_0x5f2999){logger[_0x789f('0x12')](_0x789f('0x15'),_0x509853);logger[_0x789f('0xe')](_0x789f('0x15'),_0x509853,JSON[_0x789f('0x1b')](_0x5f2999));_0x678cfb(_0x5f2999);})['catch'](function(_0x2611d8){logger[_0x789f('0xf')]('CreateAttachment',_0x2611d8[_0x789f('0x11')],_0x509853);_0x27d632(_0xb4a258[_0x789f('0xf')](0x1f4,_0x2611d8[_0x789f('0x11')]));});});}; \ No newline at end of file +var _0x765e=['request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x17ace5,_0x11a736){var _0x44a983=function(_0x547d9f){while(--_0x547d9f){_0x17ace5['push'](_0x17ace5['shift']());}};_0x44a983(++_0x11a736);}(_0x765e,0x131));var _0xe765=function(_0x17804e,_0x1cd787){_0x17804e=_0x17804e-0x0;var _0x5e6025=_0x765e[_0x17804e];return _0x5e6025;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var moment=require(_0xe765('0x2'));var BPromise=require(_0xe765('0x3'));var rs=require(_0xe765('0x4'));var fs=require('fs');var Redis=require(_0xe765('0x5'));var db=require(_0xe765('0x6'))['db'];var utils=require(_0xe765('0x7'));var logger=require(_0xe765('0x8'))(_0xe765('0x9'));var config=require(_0xe765('0xa'));var jayson=require(_0xe765('0xb'));var client=jayson[_0xe765('0xc')][_0xe765('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdd89e7,_0x504542,_0x35d891){return new BPromise(function(_0x28e955,_0x27b0f4){return client[_0xe765('0xe')](_0xdd89e7,_0x35d891)[_0xe765('0xf')](function(_0x41801f){logger[_0xe765('0x10')]('Attachment,\x20%s,\x20%s',_0x504542,_0xe765('0x11'));logger[_0xe765('0x12')](_0xe765('0x13'),_0x504542,'request\x20sent',JSON[_0xe765('0x14')](_0x41801f));if(_0x41801f['error']){if(_0x41801f['error']['code']===0x1f4){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x27b0f4(_0x41801f[_0xe765('0x15')]['message']);}logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x28e955(_0x41801f[_0xe765('0x15')]['message']);}else{logger['info'](_0xe765('0x16'),_0x504542,_0xe765('0x11'));_0x28e955(_0x41801f[_0xe765('0x18')]['message']);}})[_0xe765('0x19')](function(_0x36aca3){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x36aca3);_0x27b0f4(_0x36aca3);});});}exports[_0xe765('0x1a')]=function(_0xf93371){var _0x788b40=this;return new Promise(function(_0x2a95a9,_0x99e6a9){return db['Attachment'][_0xe765('0x1b')](_0xf93371['body'],{'raw':_0xf93371[_0xe765('0x1c')]?_0xf93371[_0xe765('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe765('0xf')](function(_0x59118f){logger[_0xe765('0x10')](_0xe765('0x1a'),_0xf93371);logger[_0xe765('0x12')]('CreateAttachment',_0xf93371,JSON['stringify'](_0x59118f));_0x2a95a9(_0x59118f);})['catch'](function(_0x1c6de4){logger[_0xe765('0x15')](_0xe765('0x1a'),_0x1c6de4[_0xe765('0x17')],_0xf93371);_0x99e6a9(_0x788b40['error'](0x1f4,_0x1c6de4['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 3e6dea4..61cccc3 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x251180,_0x5492d8){var _0x87dae7=function(_0x1ad249){while(--_0x1ad249){_0x251180['push'](_0x251180['shift']());}};_0x87dae7(++_0x5492d8);}(_0xb10b,0x12a));var _0xbb10=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xb10b[_0xd9f102];return _0x2652e4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4e11e7,_0x42d0b6){_0x4e11e7=_0x4e11e7-0x0;var _0x1d7d39=_0x0b0e[_0x4e11e7];return _0x1d7d39;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 75828ef..3b17d14 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 _0x5674=['role','disabled','blocked','blockedAt','admin','user','agent','name','add','minutes','clearBlockUser','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','undefined','activedirectory','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5674,0x15d));var _0x4567=function(_0x35a6bd,_0x50250d){_0x35a6bd=_0x35a6bd-0x0;var _0x501807=_0x5674[_0x35a6bd];return _0x501807;};'use strict';var passport=require(_0x4567('0x0'));var LocalStrategy=require(_0x4567('0x1'))[_0x4567('0x2')];var moment=require(_0x4567('0x3'));var ActiveDirectory=require(_0x4567('0x4'));var BPromise=require(_0x4567('0x5'));var util=require(_0x4567('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x4567('0x7'));var utils=require(_0x4567('0x8'));var config=require(_0x4567('0x9'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x225fc9){var _0x389cac=![];if(typeof _0x225fc9['activedirectory']!==_0x4567('0xa')){_0x389cac=_0x225fc9[_0x4567('0xb')][_0x4567('0xc')]&&_0x225fc9[_0x4567('0xb')]['url']&&_0x225fc9[_0x4567('0xb')][_0x4567('0xd')];}return _0x389cac;}function adAuthenticate(_0x53220b,_0x5d747a,_0x314fd7){return new BPromise(function(_0x53efb9,_0x2f242a){try{var _0x434edc=new ActiveDirectory(_0x53220b);_0x434edc[_0x4567('0xe')](_0x5d747a,_0x314fd7,function(_0x5257dc,_0x11184e){if(_0x5257dc){logger[_0x4567('0xf')](_0x4567('0x10'),_0x5d747a,util['inspect'](_0x5257dc,{'showHidden':![],'depth':null}));_0x2f242a(_0x4567('0x11'));}else if(!_0x11184e){logger[_0x4567('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5d747a);_0x2f242a(_0x4567('0x11'));}else{_0x53efb9(_0x11184e);}});}catch(_0x8b8bd1){_0x2f242a(_0x8b8bd1);}});}function ActiveDirectoryAuthenticate(_0x30b4bb,_0x1b1586,_0x5566c9,_0x4e4662){var _0x2a15e8,_0x2e5f59;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4567('0x12'),_0x1b1586);return _0x4e4662(null,![],{'message':_0x4567('0x11')});}return db[_0x4567('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x4567('0x14'),_0x4567('0x15')],'raw':!![]})[_0x4567('0x16')](function(_0x32bf74){_0x2a15e8=_0x32bf74;if(!_0x2a15e8[_0x4567('0x14')]){logger[_0x4567('0xf')](_0x4567('0x17'),_0x1b1586);throw new Error(_0x4567('0x11'));}return _0x30b4bb[_0x4567('0x18')]({'attributes':['id','name',_0x4567('0x19'),_0x4567('0x1a'),_0x4567('0x1b'),_0x4567('0x1c'),_0x4567('0x1d'),_0x4567('0x1e'),'online'],'where':{'name':_0x1b1586,'role':{'$or':[_0x4567('0x1f'),_0x4567('0x20'),_0x4567('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x3b95e2){if(!_0x3b95e2||_0x3b95e2&&_0x3b95e2[_0x4567('0x22')]!==_0x1b1586){throw new Error(_0x4567('0x11'));}_0x2e5f59=_0x3b95e2;var _0xb83aa4=_0x2e5f59[_0x4567('0x22')]+'@'+config[_0x4567('0xb')][_0x4567('0xd')];return adAuthenticate(config[_0x4567('0xb')],_0xb83aa4,_0x5566c9);})[_0x4567('0x16')](function(_0x583487){if(_0x2e5f59[_0x4567('0x1c')]){throw new Error(_0x4567('0x11'));}if(_0x2a15e8[_0x4567('0x15')]>0x0){if(_0x2e5f59[_0x4567('0x1d')]){if(moment(_0x2e5f59[_0x4567('0x1e')])[_0x4567('0x23')](_0x2a15e8[_0x4567('0x15')],_0x4567('0x24'))>moment()){throw new Error(_0x4567('0x11'));}return utils[_0x4567('0x25')](_0x2e5f59,0x0,![],null)[_0x4567('0x16')](function(){return utils[_0x4567('0x26')](_0x2e5f59);})[_0x4567('0x16')](function(){return _0x4e4662(null,_0x2e5f59);});}else{return utils[_0x4567('0x26')](_0x2e5f59)['then'](function(){return _0x4e4662(null,_0x2e5f59);});}}else{return utils[_0x4567('0x26')](_0x2e5f59)[_0x4567('0x16')](function(){return _0x4e4662(null,_0x2e5f59);});}})['catch'](function(_0x58c738){return _0x4e4662(null,![],_0x58c738);});}function handleError(_0x31dbc7,_0x4d997a,_0x1fdcec){return _0x31dbc7[_0x4567('0x27')](_0x4d997a||0x1f4)[_0x4567('0x28')]({'message':_0x1fdcec?_0x1fdcec[_0x4567('0x29')]||_0x1fdcec:''});}exports['login']=function(_0x1888ad,_0x22dbe7,_0x403423){passport[_0x4567('0xe')](_0x4567('0x2a'),function(_0x1a881b,_0x6b83cb,_0x3e59a3){var _0x2feef3=_0x1a881b||_0x3e59a3;if(_0x2feef3){return handleError(_0x22dbe7,0x191,_0x2feef3);}if(!_0x6b83cb){return handleError(_0x22dbe7,0x194,{'message':_0x4567('0x2b')});}else{var _0x2084ac={'payload':{'id':_0x6b83cb['id'],'role':_0x6b83cb[_0x4567('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x4567('0x2c')](_0x2084ac)[_0x4567('0x16')](function(_0x299b06){_0x22dbe7[_0x4567('0x2d')]({'id':_0x6b83cb['id'],'token':_0x299b06,'statusCall':'','isAlreadyLogged':_0x6b83cb['online']});});}})(_0x1888ad,_0x22dbe7,_0x403423);};passport[_0x4567('0x2e')](_0x4567('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x4567('0x19')},function(_0x212e8b,_0x28ab64,_0x3b312f){return ActiveDirectoryAuthenticate(db['User'],_0x212e8b,_0x28ab64,_0x3b312f);})); \ No newline at end of file +var _0xa10d=['util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','password','role','disabled','blocked','online','admin','user','agent','name','blockedAt','add','minutes','getLicense','login','signToken','json','ad-login','User','passport','passport-local','Strategy','moment','bluebird'];(function(_0x2e0f64,_0x17743b){var _0x40ec93=function(_0x3f95a){while(--_0x3f95a){_0x2e0f64['push'](_0x2e0f64['shift']());}};_0x40ec93(++_0x17743b);}(_0xa10d,0xd2));var _0xda10=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa10d[_0x4ff09b];return _0x3f5c2e;};'use strict';var passport=require(_0xda10('0x0'));var LocalStrategy=require(_0xda10('0x1'))[_0xda10('0x2')];var moment=require(_0xda10('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xda10('0x4'));var util=require(_0xda10('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xda10('0x6'));var utils=require(_0xda10('0x7'));var config=require(_0xda10('0x8'));var logger=require(_0xda10('0x9'))(_0xda10('0xa'));function isActiveDirectoryConfigured(_0x122603){var _0x254978=![];if(typeof _0x122603[_0xda10('0xb')]!==_0xda10('0xc')){_0x254978=_0x122603[_0xda10('0xb')][_0xda10('0xd')]&&_0x122603[_0xda10('0xb')]['url']&&_0x122603['activedirectory'][_0xda10('0xe')];}return _0x254978;}function adAuthenticate(_0xc44a1f,_0x23fb85,_0x10a15d){return new BPromise(function(_0x576f6e,_0x2876a8){try{var _0x161975=new ActiveDirectory(_0xc44a1f);_0x161975[_0xda10('0xf')](_0x23fb85,_0x10a15d,function(_0x3c8f4e,_0x67600){if(_0x3c8f4e){logger[_0xda10('0x10')](_0xda10('0x11'),_0x23fb85,util[_0xda10('0x12')](_0x3c8f4e,{'showHidden':![],'depth':null}));_0x2876a8(_0xda10('0x13'));}else if(!_0x67600){logger[_0xda10('0x10')](_0xda10('0x14'),_0x23fb85);_0x2876a8(_0xda10('0x13'));}else{_0x576f6e(_0x67600);}});}catch(_0x495766){_0x2876a8(_0x495766);}});}function ActiveDirectoryAuthenticate(_0xe44d1e,_0x48667e,_0x17e13f,_0x5a756b){var _0x2f6c70,_0xb99592;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x48667e);return _0x5a756b(null,![],{'message':_0xda10('0x13')});}return db['Setting'][_0xda10('0x15')]({'where':{'id':0x1},'attributes':[_0xda10('0x16'),_0xda10('0x17')],'raw':!![]})[_0xda10('0x18')](function(_0x19936c){_0x2f6c70=_0x19936c;if(!_0x2f6c70['adSsoEnabled']){logger[_0xda10('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x48667e);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xe44d1e[_0xda10('0x15')]({'attributes':['id','name',_0xda10('0x19'),'salt',_0xda10('0x1a'),_0xda10('0x1b'),_0xda10('0x1c'),'blockedAt',_0xda10('0x1d')],'where':{'name':_0x48667e,'role':{'$or':[_0xda10('0x1e'),_0xda10('0x1f'),_0xda10('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x32a731){if(!_0x32a731||_0x32a731&&_0x32a731[_0xda10('0x21')]!==_0x48667e){throw new Error(_0xda10('0x13'));}_0xb99592=_0x32a731;var _0x1c59a7=_0xb99592[_0xda10('0x21')]+'@'+config[_0xda10('0xb')]['domain'];return adAuthenticate(config[_0xda10('0xb')],_0x1c59a7,_0x17e13f);})[_0xda10('0x18')](function(_0x3ad924){if(_0xb99592[_0xda10('0x1b')]){throw new Error(_0xda10('0x13'));}if(_0x2f6c70[_0xda10('0x17')]>0x0){if(_0xb99592[_0xda10('0x1c')]){if(moment(_0xb99592[_0xda10('0x22')])[_0xda10('0x23')](_0x2f6c70[_0xda10('0x17')],_0xda10('0x24'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0xb99592,0x0,![],null)[_0xda10('0x18')](function(){return utils[_0xda10('0x25')](_0xb99592);})[_0xda10('0x18')](function(){return _0x5a756b(null,_0xb99592);});}else{return utils['getLicense'](_0xb99592)['then'](function(){return _0x5a756b(null,_0xb99592);});}}else{return utils['getLicense'](_0xb99592)[_0xda10('0x18')](function(){return _0x5a756b(null,_0xb99592);});}})['catch'](function(_0x137668){return _0x5a756b(null,![],_0x137668);});}function handleError(_0x5e396f,_0x690ad4,_0x292d86){return _0x5e396f['status'](_0x690ad4||0x1f4)['send']({'message':_0x292d86?_0x292d86['message']||_0x292d86:''});}exports[_0xda10('0x26')]=function(_0x47bee8,_0x1d2090,_0x7c22f9){passport[_0xda10('0xf')]('ad-login',function(_0x23470a,_0x106d5c,_0x1ac4d6){var _0x28592e=_0x23470a||_0x1ac4d6;if(_0x28592e){return handleError(_0x1d2090,0x191,_0x28592e);}if(!_0x106d5c){return handleError(_0x1d2090,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x436be6={'payload':{'id':_0x106d5c['id'],'role':_0x106d5c[_0xda10('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xda10('0x27')](_0x436be6)[_0xda10('0x18')](function(_0x19be42){_0x1d2090[_0xda10('0x28')]({'id':_0x106d5c['id'],'token':_0x19be42,'statusCall':'','isAlreadyLogged':_0x106d5c[_0xda10('0x1d')]});});}})(_0x47bee8,_0x1d2090,_0x7c22f9);};passport['use'](_0xda10('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0xda10('0x19')},function(_0x2358ac,_0x2fa66f,_0x2ba005){return ActiveDirectoryAuthenticate(db[_0xda10('0x2a')],_0x2358ac,_0x2fa66f,_0x2ba005);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 404e40a..c647f17 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 _0xbe4b=['exports','express','Router','post','login'];(function(_0x54f3ee,_0x192fdd){var _0x883dd7=function(_0x2c153c){while(--_0x2c153c){_0x54f3ee['push'](_0x54f3ee['shift']());}};_0x883dd7(++_0x192fdd);}(_0xbe4b,0x1a5));var _0xbbe4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbe4b[_0x209941];return _0x1e8729;};'use strict';var express=require(_0xbbe4('0x0'));var router=express[_0xbbe4('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xbbe4('0x2')]('/',controller[_0xbbe4('0x3')]);module[_0xbbe4('0x4')]=router; \ No newline at end of file +var _0xd4e9=['login','express','Router','post'];(function(_0x2d9f25,_0x173f8b){var _0x5dbb89=function(_0x374bd2){while(--_0x374bd2){_0x2d9f25['push'](_0x2d9f25['shift']());}};_0x5dbb89(++_0x173f8b);}(_0xd4e9,0x109));var _0x9d4e=function(_0x6a4251,_0x3f98e7){_0x6a4251=_0x6a4251-0x0;var _0x2a2425=_0xd4e9[_0x6a4251];return _0x2a2425;};'use strict';var express=require(_0x9d4e('0x0'));var router=express[_0x9d4e('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x9d4e('0x2')]('/',controller[_0x9d4e('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 18ef49e..5fb4489 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(_0x3bc0fb,_0xb10c23){var _0x472a05=function(_0x18bce6){while(--_0x18bce6){_0x3bc0fb['push'](_0x3bc0fb['shift']());}};_0x472a05(++_0xb10c23);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7a54,0x106));var _0x47a5=function(_0x1e2bc0,_0x486773){_0x1e2bc0=_0x1e2bc0-0x0;var _0x4ceb73=_0x7a54[_0x1e2bc0];return _0x4ceb73;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ed9d58c..abcb958 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 _0x0625=['callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x8cb6d2,_0x28b612){var _0x1a4dd7=function(_0x4c4c5c){while(--_0x4c4c5c){_0x8cb6d2['push'](_0x8cb6d2['shift']());}};_0x1a4dd7(++_0x28b612);}(_0x0625,0xac));var _0x5062=function(_0x505c11,_0x1c10f7){_0x505c11=_0x505c11-0x0;var _0x3fff77=_0x0625[_0x505c11];return _0x3fff77;};'use strict';var express=require('express');var passport=require(_0x5062('0x0'));var router=express[_0x5062('0x1')]();var controller=require(_0x5062('0x2'));var userController=require(_0x5062('0x3'));var authService=require(_0x5062('0x4'));router[_0x5062('0x5')]('/',controller[_0x5062('0x6')]);router['get'](_0x5062('0x7'),controller[_0x5062('0x8')],authService[_0x5062('0x9')],userController[_0x5062('0x6')],authService[_0x5062('0xa')]);module[_0x5062('0xb')]=router; \ No newline at end of file +var _0x30ea=['callback','isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x30ea,0x13a));var _0xa30e=function(_0xcb09c5,_0x41c348){_0xcb09c5=_0xcb09c5-0x0;var _0x149219=_0x30ea[_0xcb09c5];return _0x149219;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xa30e('0x0')]();var controller=require(_0xa30e('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xa30e('0x2'));router[_0xa30e('0x3')]('/',controller[_0xa30e('0x4')]);router['get'](_0xa30e('0x5'),controller[_0xa30e('0x6')],authService[_0xa30e('0x7')],userController[_0xa30e('0x4')],authService[_0xa30e('0x8')]);module[_0xa30e('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d481f48..fffe73b 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 _0x76f8=['MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email'];(function(_0x3f68dc,_0x3ae2f8){var _0x8c9e6f=function(_0x32b1cd){while(--_0x32b1cd){_0x3f68dc['push'](_0x3f68dc['shift']());}};_0x8c9e6f(++_0x3ae2f8);}(_0x76f8,0x12a));var _0x876f=function(_0x1aa90b,_0x2d9228){_0x1aa90b=_0x1aa90b-0x0;var _0x6f02d5=_0x76f8[_0x1aa90b];return _0x6f02d5;};'use strict';var util=require('util');var passport=require(_0x876f('0x0'));var LocalStrategy=require(_0x876f('0x1'))[_0x876f('0x2')];var jayson=require(_0x876f('0x3'));var _=require('lodash');var rs=require(_0x876f('0x4'));var moment=require(_0x876f('0x5'));var db=require(_0x876f('0x6'))['db'];var authService=require(_0x876f('0x7'));var utils=require(_0x876f('0x8'));var client=jayson[_0x876f('0x9')][_0x876f('0xa')]({'port':0x232b});function localAuthenticate(_0x413078,_0x1c19da,_0x368f39,_0x2412b3){var _0xf451e2,_0x2729d7;return db[_0x876f('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x876f('0xc'),_0x876f('0xd')],'raw':!![]})[_0x876f('0xe')](function(_0x23a730){_0xf451e2=_0x23a730;return _0x413078[_0x876f('0xf')]({'attributes':['id',_0x876f('0x10'),'password',_0x876f('0x11'),_0x876f('0x12'),_0x876f('0x13'),'blocked',_0x876f('0x14'),_0x876f('0x15')],'where':{'name':_0x1c19da,'role':{'$or':[_0x876f('0x16'),_0x876f('0x17'),'agent']}}});})['then'](function(_0x43ef60){if(!_0x43ef60||_0x43ef60&&_0x43ef60[_0x876f('0x10')]!==_0x1c19da){throw new Error(_0x876f('0x18'));}else{_0x2729d7=_0x43ef60;return _0x2729d7;}})[_0x876f('0xe')](function(){_0x2729d7['authenticate'](_0x368f39,function(_0x45c311,_0x43e5fe){var _0x8c12ce=_0x2729d7[_0x876f('0x15')]+0x1;if(_0x45c311){return _0x2412b3(_0x45c311);}else if(!_0x43e5fe){if(_0x2729d7['disabled']){return _0x2412b3(null,![],{'message':_0x876f('0x18')});}else if(_0xf451e2[_0x876f('0xc')]>0x0){if(_0x2729d7[_0x876f('0x19')]){if(_0xf451e2[_0x876f('0xd')]>0x0){if(moment(_0x2729d7[_0x876f('0x14')])[_0x876f('0x1a')](_0xf451e2[_0x876f('0xd')],_0x876f('0x1b'))>moment()){return _0x2412b3(null,![],{'message':_0x876f('0x18')});}else{return utils[_0x876f('0x1c')](_0x2729d7,_0x8c12ce,![],null)[_0x876f('0xe')](function(){return _0x2412b3(null,![],{'message':_0x876f('0x18')});});}}else{return _0x2412b3(null,![],{'message':_0x876f('0x18')});}}else{if(_0x8c12ce>=_0xf451e2['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2729d7,0x0,!![],moment())[_0x876f('0xe')](function(){return _0x2412b3(null,![],{'message':_0x876f('0x18')});});}else{return utils['clearBlockUser'](_0x2729d7,_0x8c12ce,![],null)[_0x876f('0xe')](function(){return _0x2412b3(null,![],{'message':_0x876f('0x18')});});}}}else{return _0x2412b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2729d7[_0x876f('0x13')]){return _0x2412b3(null,![],{'message':_0x876f('0x18')});}else if(_0xf451e2['allowedLoginAttempts']>0x0){if(_0x2729d7['blocked']){if(_0xf451e2[_0x876f('0xd')]>0x0){if(moment(_0x2729d7[_0x876f('0x14')])[_0x876f('0x1a')](_0xf451e2[_0x876f('0xd')],_0x876f('0x1b'))>moment()){return _0x2412b3(null,![],{'message':_0x876f('0x18')});}else{return utils['clearBlockUser'](_0x2729d7,0x0,![],null)[_0x876f('0xe')](function(){return utils['getLicense'](_0x2729d7);})[_0x876f('0xe')](function(){return _0x2412b3(null,_0x2729d7);});}}else{return _0x2412b3(null,![],{'message':_0x876f('0x18')});}}else{return utils[_0x876f('0x1c')](_0x2729d7,0x0,![],null)['then'](function(){return utils[_0x876f('0x1d')](_0x2729d7);})[_0x876f('0xe')](function(){return _0x2412b3(null,_0x2729d7);})[_0x876f('0x1e')](function(_0x281aea){return _0x2412b3(null,![],_0x281aea);});}}else{if(_0x2729d7['blocked']){return _0x2412b3(null,![],{'message':_0x876f('0x18')});}else{return utils[_0x876f('0x1d')](_0x2729d7)[_0x876f('0xe')](function(){return _0x2412b3(null,_0x2729d7);});}}}});})[_0x876f('0x1e')](function(_0x3c88ca){return _0x2412b3(null,![],_0x3c88ca);});}function sendServiceMail(_0x1056ec){return db[_0x876f('0x1f')][_0x876f('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x876f('0x21')],'include':[{'model':db[_0x876f('0x22')],'as':_0x876f('0x23'),'include':[{'model':db['CloudProvider'],'as':_0x876f('0x24')}]}]})[_0x876f('0xe')](function(_0x2c2913){if(!_0x2c2913){throw new Error(_0x876f('0x25'));}var _0x451a96=_0x2c2913['getSmtpOptions']();var _0x34026f={'account':_0x451a96,'message':_[_0x876f('0x26')]({'from':util['format'](_0x876f('0x27'),_0x2c2913[_0x876f('0x10')],_0x2c2913['email']||_0x2c2913[_0x876f('0x23')][_0x876f('0x17')])},_0x1056ec)};return client['request'](_0x876f('0x28'),_0x34026f);})[_0x876f('0xe')](function(_0x25ec6c){if(_0x25ec6c[_0x876f('0x29')]){throw new Error(util['format'](_0x876f('0x2a'),_0x25ec6c[_0x876f('0x29')][_0x876f('0x2b')]||JSON[_0x876f('0x2c')](_0x25ec6c[_0x876f('0x29')])));}return!![];});}function handleError(_0x299482,_0x45f2f4,_0x4c9ac7){return _0x299482['status'](_0x45f2f4||0x1f4)[_0x876f('0x2d')]({'message':_0x4c9ac7?_0x4c9ac7['message']||_0x4c9ac7:''});}exports[_0x876f('0x2e')]=function(_0x1ee66c,_0x309812,_0x207d91){passport['authenticate'](_0x876f('0x2f'),function(_0x51e5ac,_0x3421c3,_0x4de70c){var _0xea62c0=_0x51e5ac||_0x4de70c;if(_0xea62c0){return handleError(_0x309812,0x191,_0xea62c0);}if(!_0x3421c3){return handleError(_0x309812,0x194,{'message':_0x876f('0x30')});}else{var _0x29a40a={'payload':{'id':_0x3421c3['id'],'role':_0x3421c3[_0x876f('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x876f('0x31')](_0x29a40a)['then'](function(_0x31e36c){_0x309812[_0x876f('0x32')]({'id':_0x3421c3['id'],'token':_0x31e36c,'statusCall':'','isAlreadyLogged':_0x3421c3['online']});});}})(_0x1ee66c,_0x309812,_0x207d91);};exports[_0x876f('0x33')]=function(_0x39d7cd,_0x230f65){if(!_0x39d7cd[_0x876f('0x34')][_0x876f('0x21')]){return handleError(_0x230f65,0x1f4,{'message':_0x876f('0x35')});}var _0x3ec0d6=rs[_0x876f('0x36')]();_0x39d7cd['body'][_0x876f('0x21')]=_0x39d7cd[_0x876f('0x34')][_0x876f('0x21')][_0x876f('0x37')]()[_0x876f('0x38')]();var _0x1375bd;return db[_0x876f('0xb')][_0x876f('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x876f('0xd')],'raw':!![]})[_0x876f('0xe')](function(_0x1e0910){_0x1375bd=_0x1e0910;return db['User'][_0x876f('0x20')]({'where':{'email':_0x39d7cd[_0x876f('0x34')][_0x876f('0x21')]}});})[_0x876f('0xe')](function(_0x5c596e){if(!_0x5c596e){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5c596e['disabled']){throw new Error(_0x876f('0x39'));}if(_0x5c596e[_0x876f('0x19')]){if(moment(_0x5c596e[_0x876f('0x14')])['add'](_0x1375bd[_0x876f('0xd')],_0x876f('0x1b'))>moment()){throw new Error(_0x876f('0x3a'));}else{_0x5c596e[_0x876f('0x19')]=![];_0x5c596e[_0x876f('0x14')]=null;}}_0x5c596e[_0x876f('0x3b')]=_0x3ec0d6;_0x5c596e[_0x876f('0x3c')]=Date[_0x876f('0x3d')]()+0x36ee80;return _0x5c596e[_0x876f('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x39d7cd[_0x876f('0x34')][_0x876f('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'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'+_0x876f('0x3f')+_0x39d7cd[_0x876f('0x40')][_0x876f('0x41')]+_0x876f('0x42')+_0x3ec0d6+'\x0a\x0a'+_0x876f('0x43')});})[_0x876f('0xe')](function(){_0x230f65[_0x876f('0x44')](0xc8)[_0x876f('0x2d')]({'message':_0x876f('0x45')});})[_0x876f('0x1e')](function(_0x9a3a44){return handleError(_0x230f65,0x1f4,_0x9a3a44);});};exports[_0x876f('0x46')]=function(_0x378752,_0x2fb546){return db[_0x876f('0x47')]['find']({'where':{'resetPasswordToken':_0x378752[_0x876f('0x48')][_0x876f('0x49')],'resetPasswordExpires':{'$gt':Date[_0x876f('0x3d')]()}}})[_0x876f('0xe')](function(_0x5142ed){if(!_0x5142ed){throw new Error(_0x876f('0x4a'));}return db[_0x876f('0xb')][_0x876f('0xf')]({'attributes':['id',_0x876f('0x4b'),'enforcePasswordHistory',_0x876f('0x4c')]})[_0x876f('0xe')](function(_0x29b2f9){if(_0x29b2f9[_0x876f('0x4b')])authService['validatePasswordPattern'](_0x378752[_0x876f('0x34')][_0x876f('0x4d')]);if(!_0x29b2f9[_0x876f('0x4e')]||!_0x5142ed[_0x876f('0x4f')])return _0x5142ed;authService[_0x876f('0x50')](_0x378752[_0x876f('0x34')]['password'],_0x5142ed[_0x876f('0x4f')],_0x29b2f9[_0x876f('0x4c')]);return _0x5142ed;})[_0x876f('0xe')](function(){_0x5142ed['password']=_0x378752[_0x876f('0x34')][_0x876f('0x4d')];_0x5142ed[_0x876f('0x3b')]=null;_0x5142ed[_0x876f('0x3c')]=null;return _0x5142ed[_0x876f('0x3e')]();});})['then'](function(){_0x2fb546[_0x876f('0x44')](0xc8)['send']({'message':_0x876f('0x51')});})[_0x876f('0x1e')](function(_0x9835ab){return handleError(_0x2fb546,0x1f4,_0x9835ab);});};passport[_0x876f('0x52')]('local-login',new LocalStrategy({'usernameField':_0x876f('0x10'),'passwordField':_0x876f('0x4d')},function(_0x5d9b16,_0x11afd6,_0x3e2da8){return localAuthenticate(db[_0x876f('0x47')],_0x5d9b16,_0x11afd6,_0x3e2da8);})); \ No newline at end of file +var _0xcf12=['merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','send','login','local-login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','User','util','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','then','findOne','name','salt','role','disabled','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','blockDuration','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf12,0x16a));var _0x2cf1=function(_0x8bece7,_0x2b0a5f){_0x8bece7=_0x8bece7-0x0;var _0x54191b=_0xcf12[_0x8bece7];return _0x54191b;};'use strict';var util=require(_0x2cf1('0x0'));var passport=require('passport');var LocalStrategy=require(_0x2cf1('0x1'))[_0x2cf1('0x2')];var jayson=require(_0x2cf1('0x3'));var _=require(_0x2cf1('0x4'));var rs=require('randomstring');var moment=require(_0x2cf1('0x5'));var db=require(_0x2cf1('0x6'))['db'];var authService=require(_0x2cf1('0x7'));var utils=require(_0x2cf1('0x8'));var client=jayson[_0x2cf1('0x9')][_0x2cf1('0xa')]({'port':0x232b});function localAuthenticate(_0x5ae8aa,_0x6b3677,_0x391b76,_0x1a9475){var _0x5a6371,_0x15b407;return db[_0x2cf1('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x2cf1('0xc')](function(_0x31e8ec){_0x5a6371=_0x31e8ec;return _0x5ae8aa[_0x2cf1('0xd')]({'attributes':['id',_0x2cf1('0xe'),'password',_0x2cf1('0xf'),_0x2cf1('0x10'),_0x2cf1('0x11'),'blocked',_0x2cf1('0x12'),_0x2cf1('0x13')],'where':{'name':_0x6b3677,'role':{'$or':['admin',_0x2cf1('0x14'),_0x2cf1('0x15')]}}});})[_0x2cf1('0xc')](function(_0x2a7a78){if(!_0x2a7a78||_0x2a7a78&&_0x2a7a78[_0x2cf1('0xe')]!==_0x6b3677){throw new Error(_0x2cf1('0x16'));}else{_0x15b407=_0x2a7a78;return _0x15b407;}})[_0x2cf1('0xc')](function(){_0x15b407[_0x2cf1('0x17')](_0x391b76,function(_0xfd810c,_0x10884b){var _0x295b0a=_0x15b407[_0x2cf1('0x13')]+0x1;if(_0xfd810c){return _0x1a9475(_0xfd810c);}else if(!_0x10884b){if(_0x15b407[_0x2cf1('0x11')]){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}else if(_0x5a6371[_0x2cf1('0x18')]>0x0){if(_0x15b407['blocked']){if(_0x5a6371['blockDuration']>0x0){if(moment(_0x15b407[_0x2cf1('0x12')])[_0x2cf1('0x19')](_0x5a6371[_0x2cf1('0x1a')],_0x2cf1('0x1b'))>moment()){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}else{return utils[_0x2cf1('0x1c')](_0x15b407,_0x295b0a,![],null)[_0x2cf1('0xc')](function(){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});});}}else{return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}}else{if(_0x295b0a>=_0x5a6371['allowedLoginAttempts']){return utils[_0x2cf1('0x1c')](_0x15b407,0x0,!![],moment())[_0x2cf1('0xc')](function(){return _0x1a9475(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x2cf1('0x1c')](_0x15b407,_0x295b0a,![],null)[_0x2cf1('0xc')](function(){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});});}}}else{return _0x1a9475(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x15b407['disabled']){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}else if(_0x5a6371[_0x2cf1('0x18')]>0x0){if(_0x15b407[_0x2cf1('0x1d')]){if(_0x5a6371[_0x2cf1('0x1a')]>0x0){if(moment(_0x15b407['blockedAt'])['add'](_0x5a6371[_0x2cf1('0x1a')],'minutes')>moment()){return _0x1a9475(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2cf1('0x1c')](_0x15b407,0x0,![],null)[_0x2cf1('0xc')](function(){return utils[_0x2cf1('0x1e')](_0x15b407);})['then'](function(){return _0x1a9475(null,_0x15b407);});}}else{return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}}else{return utils[_0x2cf1('0x1c')](_0x15b407,0x0,![],null)['then'](function(){return utils[_0x2cf1('0x1e')](_0x15b407);})[_0x2cf1('0xc')](function(){return _0x1a9475(null,_0x15b407);})[_0x2cf1('0x1f')](function(_0x27c5b0){return _0x1a9475(null,![],_0x27c5b0);});}}else{if(_0x15b407[_0x2cf1('0x1d')]){return _0x1a9475(null,![],{'message':_0x2cf1('0x16')});}else{return utils[_0x2cf1('0x1e')](_0x15b407)[_0x2cf1('0xc')](function(){return _0x1a9475(null,_0x15b407);});}}}});})[_0x2cf1('0x1f')](function(_0x81d620){return _0x1a9475(null,![],_0x81d620);});}function sendServiceMail(_0x53a05d){return db[_0x2cf1('0x20')][_0x2cf1('0x21')]({'where':{'service':!![]},'attributes':['id',_0x2cf1('0xe'),_0x2cf1('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x2cf1('0x23'),'include':[{'model':db[_0x2cf1('0x24')],'as':_0x2cf1('0x24')}]}]})['then'](function(_0x531869){if(!_0x531869){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x9cf36f=_0x531869[_0x2cf1('0x25')]();var _0xf9c535={'account':_0x9cf36f,'message':_[_0x2cf1('0x26')]({'from':util[_0x2cf1('0x27')](_0x2cf1('0x28'),_0x531869[_0x2cf1('0xe')],_0x531869['email']||_0x531869['Smtp'][_0x2cf1('0x14')])},_0x53a05d)};return client[_0x2cf1('0x29')](_0x2cf1('0x2a'),_0xf9c535);})[_0x2cf1('0xc')](function(_0x4eddeb){if(_0x4eddeb['error']){throw new Error(util[_0x2cf1('0x27')](_0x2cf1('0x2b'),_0x4eddeb['error'][_0x2cf1('0x2c')]||JSON['stringify'](_0x4eddeb[_0x2cf1('0x2d')])));}return!![];});}function handleError(_0x140e5c,_0x207093,_0x3d78cb){return _0x140e5c['status'](_0x207093||0x1f4)[_0x2cf1('0x2e')]({'message':_0x3d78cb?_0x3d78cb[_0x2cf1('0x2c')]||_0x3d78cb:''});}exports[_0x2cf1('0x2f')]=function(_0x575bf9,_0x3e0eed,_0x51626a){passport[_0x2cf1('0x17')](_0x2cf1('0x30'),function(_0x513e15,_0x4f4ad5,_0x18c9a0){var _0x3e9bc9=_0x513e15||_0x18c9a0;if(_0x3e9bc9){return handleError(_0x3e0eed,0x191,_0x3e9bc9);}if(!_0x4f4ad5){return handleError(_0x3e0eed,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1c225={'payload':{'id':_0x4f4ad5['id'],'role':_0x4f4ad5[_0x2cf1('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1c225)[_0x2cf1('0xc')](function(_0x22fe52){_0x3e0eed[_0x2cf1('0x31')]({'id':_0x4f4ad5['id'],'token':_0x22fe52,'statusCall':'','isAlreadyLogged':_0x4f4ad5[_0x2cf1('0x32')]});});}})(_0x575bf9,_0x3e0eed,_0x51626a);};exports[_0x2cf1('0x33')]=function(_0x23a3fd,_0x5ba968){if(!_0x23a3fd[_0x2cf1('0x34')][_0x2cf1('0x22')]){return handleError(_0x5ba968,0x1f4,{'message':_0x2cf1('0x35')});}var _0x5522de=rs[_0x2cf1('0x36')]();_0x23a3fd[_0x2cf1('0x34')][_0x2cf1('0x22')]=_0x23a3fd['body'][_0x2cf1('0x22')][_0x2cf1('0x37')]()['toLowerCase']();var _0x3d9a72;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x2cf1('0x18'),_0x2cf1('0x1a')],'raw':!![]})[_0x2cf1('0xc')](function(_0xb88b57){_0x3d9a72=_0xb88b57;return db['User'][_0x2cf1('0x21')]({'where':{'email':_0x23a3fd[_0x2cf1('0x34')][_0x2cf1('0x22')]}});})[_0x2cf1('0xc')](function(_0x3e566a){if(!_0x3e566a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3e566a['disabled']){throw new Error(_0x2cf1('0x38'));}if(_0x3e566a[_0x2cf1('0x1d')]){if(moment(_0x3e566a[_0x2cf1('0x12')])[_0x2cf1('0x19')](_0x3d9a72['blockDuration'],_0x2cf1('0x1b'))>moment()){throw new Error(_0x2cf1('0x39'));}else{_0x3e566a[_0x2cf1('0x1d')]=![];_0x3e566a[_0x2cf1('0x12')]=null;}}_0x3e566a['resetPasswordToken']=_0x5522de;_0x3e566a[_0x2cf1('0x3a')]=Date[_0x2cf1('0x3b')]()+0x36ee80;return _0x3e566a[_0x2cf1('0x3c')]();})[_0x2cf1('0xc')](function(){return sendServiceMail({'to':_0x23a3fd[_0x2cf1('0x34')][_0x2cf1('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x2cf1('0x3d')+_0x2cf1('0x3e')+_0x2cf1('0x3f')+_0x23a3fd['headers'][_0x2cf1('0x40')]+'/reset/'+_0x5522de+'\x0a\x0a'+_0x2cf1('0x41')});})['then'](function(){_0x5ba968[_0x2cf1('0x42')](0xc8)[_0x2cf1('0x2e')]({'message':_0x2cf1('0x43')});})[_0x2cf1('0x1f')](function(_0x15c3b0){return handleError(_0x5ba968,0x1f4,_0x15c3b0);});};exports[_0x2cf1('0x44')]=function(_0x131df0,_0x10ef5d){return db['User'][_0x2cf1('0x21')]({'where':{'resetPasswordToken':_0x131df0[_0x2cf1('0x45')]['token'],'resetPasswordExpires':{'$gt':Date[_0x2cf1('0x3b')]()}}})[_0x2cf1('0xc')](function(_0x10731e){if(!_0x10731e){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x2cf1('0xb')][_0x2cf1('0xd')]({'attributes':['id',_0x2cf1('0x46'),_0x2cf1('0x47'),_0x2cf1('0x48')]})['then'](function(_0x4a3e5f){if(_0x4a3e5f[_0x2cf1('0x46')])authService[_0x2cf1('0x49')](_0x131df0[_0x2cf1('0x34')][_0x2cf1('0x4a')]);if(!_0x4a3e5f[_0x2cf1('0x47')]||!_0x10731e[_0x2cf1('0x4b')])return _0x10731e;authService[_0x2cf1('0x4c')](_0x131df0[_0x2cf1('0x34')][_0x2cf1('0x4a')],_0x10731e[_0x2cf1('0x4b')],_0x4a3e5f[_0x2cf1('0x48')]);return _0x10731e;})['then'](function(){_0x10731e[_0x2cf1('0x4a')]=_0x131df0[_0x2cf1('0x34')][_0x2cf1('0x4a')];_0x10731e[_0x2cf1('0x4d')]=null;_0x10731e[_0x2cf1('0x3a')]=null;return _0x10731e[_0x2cf1('0x3c')]();});})['then'](function(){_0x10ef5d['status'](0xc8)[_0x2cf1('0x2e')]({'message':_0x2cf1('0x4e')});})[_0x2cf1('0x1f')](function(_0x535a12){return handleError(_0x10ef5d,0x1f4,_0x535a12);});};passport['use'](_0x2cf1('0x30'),new LocalStrategy({'usernameField':_0x2cf1('0xe'),'passwordField':_0x2cf1('0x4a')},function(_0x4cb05b,_0x2489a5,_0x14bf2c){return localAuthenticate(db[_0x2cf1('0x4f')],_0x4cb05b,_0x2489a5,_0x14bf2c);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f3e91e8..e107033 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 _0xe984=['post','/reset/:token','reset','exports','Router'];(function(_0x3b1342,_0x36350e){var _0x2bed54=function(_0x3ade07){while(--_0x3ade07){_0x3b1342['push'](_0x3b1342['shift']());}};_0x2bed54(++_0x36350e);}(_0xe984,0x185));var _0x4e98=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xe984[_0x403c20];return _0x2b271a;};'use strict';var express=require('express');var router=express[_0x4e98('0x0')]();var controller=require('./authLocal.controller');router[_0x4e98('0x1')]('/',controller['login']);router[_0x4e98('0x1')]('/forgot',controller['forgot']);router['post'](_0x4e98('0x2'),controller[_0x4e98('0x3')]);module[_0x4e98('0x4')]=router; \ No newline at end of file +var _0x4062=['exports','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x198bd7,_0x26c4a4){var _0x16b8fe=function(_0xaf0ef4){while(--_0xaf0ef4){_0x198bd7['push'](_0x198bd7['shift']());}};_0x16b8fe(++_0x26c4a4);}(_0x4062,0xb5));var _0x2406=function(_0x32b259,_0x239e98){_0x32b259=_0x32b259-0x0;var _0x3180f7=_0x4062[_0x32b259];return _0x3180f7;};'use strict';var express=require('express');var router=express[_0x2406('0x0')]();var controller=require(_0x2406('0x1'));router[_0x2406('0x2')]('/',controller[_0x2406('0x3')]);router[_0x2406('0x2')](_0x2406('0x4'),controller[_0x2406('0x5')]);router[_0x2406('0x2')](_0x2406('0x6'),controller[_0x2406('0x7')]);module[_0x2406('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 13e67ac..4c1c7dd 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 _0x73a5=['STRING','INTEGER','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x73a5,0xe6));var _0x573a=function(_0xdf9836,_0x30337c){_0xdf9836=_0xdf9836-0x0;var _0x2746b4=_0x73a5[_0xdf9836];return _0x2746b4;};'use strict';var Sequelize=require('sequelize');module[_0x573a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x573a('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x573a('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x8fe6=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4c1af6,_0x3c9659){var _0x4ca15f=function(_0x5ea790){while(--_0x5ea790){_0x4c1af6['push'](_0x4c1af6['shift']());}};_0x4ca15f(++_0x3c9659);}(_0x8fe6,0x79));var _0x68fe=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x8fe6[_0x39772f];return _0xc9edbf;};'use strict';var Sequelize=require(_0x68fe('0x0'));module[_0x68fe('0x1')]={'name':{'type':Sequelize[_0x68fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x68fe('0x2')]},'description':{'type':Sequelize[_0x68fe('0x2')]},'status':{'type':Sequelize[_0x68fe('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x68fe('0x4')],'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 75d63fe..353f2f2 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 _0xfd50=['pick','getConditions','hasOwnProperty','nolimit','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','apply','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','addConditions','Condition','ids','omit','findOne'];(function(_0x3f1c2c,_0x27d030){var _0xd0576=function(_0x1f1966){while(--_0x1f1966){_0x3f1c2c['push'](_0x3f1c2c['shift']());}};_0xd0576(++_0x27d030);}(_0xfd50,0x153));var _0x0fd5=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xfd50[_0x1a7550];return _0x426e22;};'use strict';var emlformat=require(_0x0fd5('0x0'));var rimraf=require(_0x0fd5('0x1'));var zipdir=require(_0x0fd5('0x2'));var jsonpatch=require(_0x0fd5('0x3'));var rp=require(_0x0fd5('0x4'));var moment=require(_0x0fd5('0x5'));var BPromise=require(_0x0fd5('0x6'));var Mustache=require('mustache');var util=require(_0x0fd5('0x7'));var path=require(_0x0fd5('0x8'));var sox=require(_0x0fd5('0x9'));var csv=require(_0x0fd5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0fd5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd5('0xc'));var jsforce=require(_0x0fd5('0xd'));var deskjs=require(_0x0fd5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0fd5('0xf'));var authService=require(_0x0fd5('0x10'));var qs=require(_0x0fd5('0x11'));var as=require(_0x0fd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd5('0x13'))(_0x0fd5('0x14'));var utils=require(_0x0fd5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0fd5('0x16'));var db=require(_0x0fd5('0x17'))['db'];function respondWithStatusCode(_0x4d6052,_0x434be9){_0x434be9=_0x434be9||0xcc;return function(_0x1c82e2){if(_0x1c82e2){return _0x4d6052[_0x0fd5('0x18')](_0x434be9);}return _0x4d6052['status'](_0x434be9)[_0x0fd5('0x19')]();};}function respondWithResult(_0x4ca70a,_0x4bba64){_0x4bba64=_0x4bba64||0xc8;return function(_0x450317){if(_0x450317){return _0x4ca70a['status'](_0x4bba64)[_0x0fd5('0x1a')](_0x450317);}};}function respondWithFilteredResult(_0x451f9f,_0x28befa){return function(_0x1b677d){if(_0x1b677d){var _0x68188f=typeof _0x28befa[_0x0fd5('0x1b')]==='undefined'&&typeof _0x28befa[_0x0fd5('0x1c')]===_0x0fd5('0x1d');var _0x1c6bc3=_0x1b677d['count'];var _0x571266=_0x68188f?0x0:_0x28befa[_0x0fd5('0x1b')];var _0x23de9a=_0x68188f?_0x1b677d[_0x0fd5('0x1e')]:_0x28befa[_0x0fd5('0x1b')]+_0x28befa['limit'];var _0x68d5ff;if(_0x23de9a>=_0x1c6bc3){_0x23de9a=_0x1c6bc3;_0x68d5ff=0xc8;}else{_0x68d5ff=0xce;}_0x451f9f[_0x0fd5('0x1f')](_0x68d5ff);return _0x451f9f['set']('Content-Range',_0x571266+'-'+_0x23de9a+'/'+_0x1c6bc3)[_0x0fd5('0x1a')](_0x1b677d);}return null;};}function patchUpdates(_0x523920){return function(_0x137bf0){try{jsonpatch[_0x0fd5('0x20')](_0x137bf0,_0x523920,!![]);}catch(_0x94853){return BPromise['reject'](_0x94853);}return _0x137bf0['save']();};}function saveUpdates(_0x86d4d9,_0x155fd4){return function(_0x1c67da){if(_0x1c67da){return _0x1c67da['update'](_0x86d4d9)[_0x0fd5('0x21')](function(_0x1f9530){return _0x1f9530;});}return null;};}function removeEntity(_0x2a1b56,_0x4f47b9){return function(_0x2ccc39){if(_0x2ccc39){return _0x2ccc39[_0x0fd5('0x22')]()['then'](function(){_0x2a1b56[_0x0fd5('0x1f')](0xcc)[_0x0fd5('0x19')]();});}};}function handleEntityNotFound(_0x57e715,_0x326104){return function(_0x3f08c2){if(!_0x3f08c2){_0x57e715[_0x0fd5('0x18')](0x194);}return _0x3f08c2;};}function handleError(_0x553815,_0x38278e){_0x38278e=_0x38278e||0x1f4;return function(_0x1de58e){logger[_0x0fd5('0x23')](_0x1de58e[_0x0fd5('0x24')]);if(_0x1de58e[_0x0fd5('0x25')]){delete _0x1de58e['name'];}_0x553815['status'](_0x38278e)[_0x0fd5('0x26')](_0x1de58e);};}exports[_0x0fd5('0x27')]=function(_0xa6770d,_0x4ed837){var _0x245024={},_0x35a831={},_0x57d767={'count':0x0,'rows':[]};var _0x4db29d=_['map'](db[_0x0fd5('0x28')][_0x0fd5('0x29')],function(_0x2cfba5){return{'name':_0x2cfba5[_0x0fd5('0x2a')],'type':_0x2cfba5[_0x0fd5('0x2b')][_0x0fd5('0x2c')]};});_0x35a831[_0x0fd5('0x2d')]=_[_0x0fd5('0x2e')](_0x4db29d,_0x0fd5('0x25'));_0x35a831[_0x0fd5('0x2f')]=_[_0x0fd5('0x30')](_0xa6770d[_0x0fd5('0x2f')]);_0x35a831[_0x0fd5('0x31')]=_['intersection'](_0x35a831[_0x0fd5('0x2d')],_0x35a831['query']);_0x245024['attributes']=_[_0x0fd5('0x32')](_0x35a831['model'],qs[_0x0fd5('0x33')](_0xa6770d[_0x0fd5('0x2f')][_0x0fd5('0x33')]));_0x245024[_0x0fd5('0x34')]=_0x245024[_0x0fd5('0x34')][_0x0fd5('0x35')]?_0x245024[_0x0fd5('0x34')]:_0x35a831[_0x0fd5('0x2d')];if(!_0xa6770d[_0x0fd5('0x2f')]['hasOwnProperty']('nolimit')){_0x245024['limit']=qs[_0x0fd5('0x1c')](_0xa6770d[_0x0fd5('0x2f')]['limit']);_0x245024['offset']=qs[_0x0fd5('0x1b')](_0xa6770d[_0x0fd5('0x2f')]['offset']);}_0x245024[_0x0fd5('0x36')]=qs[_0x0fd5('0x37')](_0xa6770d[_0x0fd5('0x2f')][_0x0fd5('0x37')]);_0x245024[_0x0fd5('0x38')]=qs[_0x0fd5('0x31')](_['pick'](_0xa6770d[_0x0fd5('0x2f')],_0x35a831[_0x0fd5('0x31')]),_0x4db29d);if(_0xa6770d[_0x0fd5('0x2f')][_0x0fd5('0x39')]){_0x245024['where']=_[_0x0fd5('0x3a')](_0x245024[_0x0fd5('0x38')],{'$or':_[_0x0fd5('0x2e')](_0x4db29d,function(_0x134f64){if(_0x134f64[_0x0fd5('0x2b')]!==_0x0fd5('0x3b')){var _0x34d438={};_0x34d438[_0x134f64[_0x0fd5('0x25')]]={'$like':'%'+_0xa6770d['query'][_0x0fd5('0x39')]+'%'};return _0x34d438;}})});}_0x245024=_[_0x0fd5('0x3a')]({},_0x245024,_0xa6770d['options']);var _0x27144d={'where':_0x245024[_0x0fd5('0x38')]};return db[_0x0fd5('0x28')][_0x0fd5('0x1e')](_0x27144d)['then'](function(_0x55dfb3){_0x57d767[_0x0fd5('0x1e')]=_0x55dfb3;if(_0xa6770d['query']['includeAll']){_0x245024['include']=[{'all':!![]}];}return db[_0x0fd5('0x28')][_0x0fd5('0x3c')](_0x245024);})[_0x0fd5('0x21')](function(_0x138537){_0x57d767[_0x0fd5('0x3d')]=_0x138537;return _0x57d767;})[_0x0fd5('0x21')](respondWithFilteredResult(_0x4ed837,_0x245024))[_0x0fd5('0x3e')](handleError(_0x4ed837,null));};exports[_0x0fd5('0x3f')]=function(_0x4fef0f,_0x188615){var _0x28a9b7={'raw':![],'where':{'id':_0x4fef0f['params']['id']}},_0x4fb522={};_0x4fb522[_0x0fd5('0x2d')]=_[_0x0fd5('0x30')](db['Automation'][_0x0fd5('0x29')]);_0x4fb522[_0x0fd5('0x2f')]=_[_0x0fd5('0x30')](_0x4fef0f[_0x0fd5('0x2f')]);_0x4fb522[_0x0fd5('0x31')]=_[_0x0fd5('0x32')](_0x4fb522[_0x0fd5('0x2d')],_0x4fb522[_0x0fd5('0x2f')]);_0x28a9b7[_0x0fd5('0x34')]=_['intersection'](_0x4fb522[_0x0fd5('0x2d')],qs[_0x0fd5('0x33')](_0x4fef0f['query'][_0x0fd5('0x33')]));_0x28a9b7['attributes']=_0x28a9b7[_0x0fd5('0x34')][_0x0fd5('0x35')]?_0x28a9b7[_0x0fd5('0x34')]:_0x4fb522[_0x0fd5('0x2d')];if(_0x4fef0f[_0x0fd5('0x2f')][_0x0fd5('0x40')]){_0x28a9b7['include']=[{'all':!![]}];}_0x28a9b7=_[_0x0fd5('0x3a')]({},_0x28a9b7,_0x4fef0f[_0x0fd5('0x41')]);return db[_0x0fd5('0x28')][_0x0fd5('0x42')](_0x28a9b7)['then'](handleEntityNotFound(_0x188615,null))[_0x0fd5('0x21')](respondWithResult(_0x188615,null))[_0x0fd5('0x3e')](handleError(_0x188615,null));};exports[_0x0fd5('0x43')]=function(_0x220061,_0xc2bf3a){return db[_0x0fd5('0x28')]['create'](_0x220061[_0x0fd5('0x44')],{})[_0x0fd5('0x21')](respondWithResult(_0xc2bf3a,0xc9))[_0x0fd5('0x3e')](handleError(_0xc2bf3a,null));};exports[_0x0fd5('0x45')]=function(_0x5f56b3,_0x137632){if(_0x5f56b3['body']['id']){delete _0x5f56b3[_0x0fd5('0x44')]['id'];}return db[_0x0fd5('0x28')][_0x0fd5('0x42')]({'where':{'id':_0x5f56b3[_0x0fd5('0x46')]['id']}})[_0x0fd5('0x21')](handleEntityNotFound(_0x137632,null))[_0x0fd5('0x21')](saveUpdates(_0x5f56b3[_0x0fd5('0x44')],null))[_0x0fd5('0x21')](respondWithResult(_0x137632,null))[_0x0fd5('0x3e')](handleError(_0x137632,null));};exports[_0x0fd5('0x22')]=function(_0xd234fe,_0x12464a){return db[_0x0fd5('0x28')][_0x0fd5('0x42')]({'where':{'id':_0xd234fe[_0x0fd5('0x46')]['id']}})[_0x0fd5('0x21')](handleEntityNotFound(_0x12464a,null))[_0x0fd5('0x21')](removeEntity(_0x12464a,null))[_0x0fd5('0x3e')](handleError(_0x12464a,null));};exports[_0x0fd5('0x47')]=function(_0x5e5698,_0x1b8a64,_0x2e0954){return db[_0x0fd5('0x48')][_0x0fd5('0x42')]({'where':{'id':_0x5e5698[_0x0fd5('0x46')]['id']}})[_0x0fd5('0x21')](handleEntityNotFound(_0x1b8a64,null))[_0x0fd5('0x21')](function(_0x1b735d){if(_0x1b735d){return _0x1b735d[_0x0fd5('0x47')](_0x5e5698['body'][_0x0fd5('0x49')],_[_0x0fd5('0x4a')](_0x5e5698[_0x0fd5('0x44')],[_0x0fd5('0x49'),'id'])||{});}})[_0x0fd5('0x21')](respondWithResult(_0x1b8a64,null))['catch'](handleError(_0x1b8a64,null));};exports['getConditions']=function(_0x4bd44e,_0x368ed6,_0x26ad0b){var _0x4216f5={};var _0x475290={};var _0x341919;var _0x53409f;return db['Automation'][_0x0fd5('0x4b')]({'where':{'id':_0x4bd44e[_0x0fd5('0x46')]['id']}})[_0x0fd5('0x21')](handleEntityNotFound(_0x368ed6,null))[_0x0fd5('0x21')](function(_0x2f5771){if(_0x2f5771){_0x341919=_0x2f5771;_0x475290[_0x0fd5('0x2d')]=_['keys'](db[_0x0fd5('0x48')]['rawAttributes']);_0x475290[_0x0fd5('0x2f')]=_[_0x0fd5('0x30')](_0x4bd44e[_0x0fd5('0x2f')]);_0x475290['filters']=_[_0x0fd5('0x32')](_0x475290[_0x0fd5('0x2d')],_0x475290['query']);_0x4216f5['attributes']=_[_0x0fd5('0x32')](_0x475290[_0x0fd5('0x2d')],qs[_0x0fd5('0x33')](_0x4bd44e['query'][_0x0fd5('0x33')]));_0x4216f5[_0x0fd5('0x34')]=_0x4216f5['attributes'][_0x0fd5('0x35')]?_0x4216f5['attributes']:_0x475290[_0x0fd5('0x2d')];_0x4216f5['order']=qs['sort'](_0x4bd44e[_0x0fd5('0x2f')][_0x0fd5('0x37')]);_0x4216f5[_0x0fd5('0x38')]=qs[_0x0fd5('0x31')](_[_0x0fd5('0x4c')](_0x4bd44e[_0x0fd5('0x2f')],_0x475290[_0x0fd5('0x31')]));if(_0x4bd44e[_0x0fd5('0x2f')][_0x0fd5('0x39')]){_0x4216f5[_0x0fd5('0x38')]=_[_0x0fd5('0x3a')](_0x4216f5[_0x0fd5('0x38')],{'$or':_[_0x0fd5('0x2e')](_0x4216f5['attributes'],function(_0x5a7f28){var _0x362eab={};_0x362eab[_0x5a7f28]={'$like':'%'+_0x4bd44e[_0x0fd5('0x2f')][_0x0fd5('0x39')]+'%'};return _0x362eab;})});}_0x4216f5=_['merge']({},_0x4216f5,_0x4bd44e['options']);return _0x341919[_0x0fd5('0x4d')](_0x4216f5);}})['then'](function(_0x1be263){if(_0x1be263){_0x53409f=_0x1be263[_0x0fd5('0x35')];if(!_0x4bd44e['query'][_0x0fd5('0x4e')](_0x0fd5('0x4f'))){_0x4216f5['limit']=qs[_0x0fd5('0x1c')](_0x4bd44e[_0x0fd5('0x2f')][_0x0fd5('0x1c')]);_0x4216f5[_0x0fd5('0x1b')]=qs[_0x0fd5('0x1b')](_0x4bd44e[_0x0fd5('0x2f')][_0x0fd5('0x1b')]);}return _0x341919['getConditions'](_0x4216f5);}})[_0x0fd5('0x21')](function(_0x3c7948){if(_0x3c7948){return _0x3c7948?{'count':_0x53409f,'rows':_0x3c7948}:null;}})[_0x0fd5('0x21')](respondWithResult(_0x368ed6,null))[_0x0fd5('0x3e')](handleError(_0x368ed6,null));};exports['addActions']=function(_0x293b1b,_0x5985f4,_0x5ca974){return db['Action']['find']({'where':{'id':_0x293b1b[_0x0fd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5985f4,null))[_0x0fd5('0x21')](function(_0x2cc149){if(_0x2cc149){return _0x2cc149[_0x0fd5('0x50')](_0x293b1b['body'][_0x0fd5('0x49')],_['omit'](_0x293b1b[_0x0fd5('0x44')],[_0x0fd5('0x49'),'id'])||{});}})[_0x0fd5('0x21')](respondWithResult(_0x5985f4,null))['catch'](handleError(_0x5985f4,null));};exports[_0x0fd5('0x51')]=function(_0x54ec76,_0x8fef4d,_0x2d70f){var _0x822472={};var _0x5b4c64={};var _0x246c03;var _0x29e916;return db['Automation'][_0x0fd5('0x4b')]({'where':{'id':_0x54ec76[_0x0fd5('0x46')]['id']}})[_0x0fd5('0x21')](handleEntityNotFound(_0x8fef4d,null))[_0x0fd5('0x21')](function(_0x14e2aa){if(_0x14e2aa){_0x246c03=_0x14e2aa;_0x5b4c64[_0x0fd5('0x2d')]=_[_0x0fd5('0x30')](db[_0x0fd5('0x52')][_0x0fd5('0x29')]);_0x5b4c64['query']=_['keys'](_0x54ec76[_0x0fd5('0x2f')]);_0x5b4c64['filters']=_[_0x0fd5('0x32')](_0x5b4c64[_0x0fd5('0x2d')],_0x5b4c64[_0x0fd5('0x2f')]);_0x822472['attributes']=_[_0x0fd5('0x32')](_0x5b4c64[_0x0fd5('0x2d')],qs['fields'](_0x54ec76[_0x0fd5('0x2f')]['fields']));_0x822472['attributes']=_0x822472[_0x0fd5('0x34')][_0x0fd5('0x35')]?_0x822472[_0x0fd5('0x34')]:_0x5b4c64[_0x0fd5('0x2d')];_0x822472[_0x0fd5('0x36')]=qs[_0x0fd5('0x37')](_0x54ec76[_0x0fd5('0x2f')]['sort']);_0x822472[_0x0fd5('0x38')]=qs[_0x0fd5('0x31')](_[_0x0fd5('0x4c')](_0x54ec76[_0x0fd5('0x2f')],_0x5b4c64[_0x0fd5('0x31')]));if(_0x54ec76['query'][_0x0fd5('0x39')]){_0x822472['where']=_[_0x0fd5('0x3a')](_0x822472[_0x0fd5('0x38')],{'$or':_[_0x0fd5('0x2e')](_0x822472['attributes'],function(_0x5a58eb){var _0x29b31b={};_0x29b31b[_0x5a58eb]={'$like':'%'+_0x54ec76[_0x0fd5('0x2f')][_0x0fd5('0x39')]+'%'};return _0x29b31b;})});}_0x822472=_[_0x0fd5('0x3a')]({},_0x822472,_0x54ec76[_0x0fd5('0x41')]);return _0x246c03[_0x0fd5('0x51')](_0x822472);}})[_0x0fd5('0x21')](function(_0x5713c7){if(_0x5713c7){_0x29e916=_0x5713c7[_0x0fd5('0x35')];if(!_0x54ec76[_0x0fd5('0x2f')]['hasOwnProperty'](_0x0fd5('0x4f'))){_0x822472[_0x0fd5('0x1c')]=qs['limit'](_0x54ec76[_0x0fd5('0x2f')][_0x0fd5('0x1c')]);_0x822472[_0x0fd5('0x1b')]=qs[_0x0fd5('0x1b')](_0x54ec76[_0x0fd5('0x2f')][_0x0fd5('0x1b')]);}return _0x246c03[_0x0fd5('0x51')](_0x822472);}})[_0x0fd5('0x21')](function(_0x513a16){if(_0x513a16){return _0x513a16?{'count':_0x29e916,'rows':_0x513a16}:null;}})[_0x0fd5('0x21')](respondWithResult(_0x8fef4d,null))[_0x0fd5('0x3e')](handleError(_0x8fef4d,null));}; \ No newline at end of file +var _0x7fd5=['end','limit','count','offset','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','Automation','includeAll','include','findAll','rows','show','intersection','options','catch','create','body','find','params','addConditions','Condition','omit','findOne','order','getConditions','hasOwnProperty','nolimit','addActions','Action','ids','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3dcb6f,_0x1400fd){var _0x4ff635=function(_0xdf2ed){while(--_0xdf2ed){_0x3dcb6f['push'](_0x3dcb6f['shift']());}};_0x4ff635(++_0x1400fd);}(_0x7fd5,0x1de));var _0x57fd=function(_0x34eabc,_0x51d411){_0x34eabc=_0x34eabc-0x0;var _0x43e72f=_0x7fd5[_0x34eabc];return _0x43e72f;};'use strict';var emlformat=require(_0x57fd('0x0'));var rimraf=require(_0x57fd('0x1'));var zipdir=require(_0x57fd('0x2'));var jsonpatch=require(_0x57fd('0x3'));var rp=require(_0x57fd('0x4'));var moment=require(_0x57fd('0x5'));var BPromise=require(_0x57fd('0x6'));var Mustache=require(_0x57fd('0x7'));var util=require('util');var path=require(_0x57fd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57fd('0x9'));var fs=require('fs');var fs_extra=require(_0x57fd('0xa'));var _=require(_0x57fd('0xb'));var squel=require(_0x57fd('0xc'));var crypto=require(_0x57fd('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57fd('0xe'));var Papa=require(_0x57fd('0xf'));var Redis=require(_0x57fd('0x10'));var authService=require(_0x57fd('0x11'));var qs=require(_0x57fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x57fd('0x13'))(_0x57fd('0x14'));var utils=require(_0x57fd('0x15'));var config=require(_0x57fd('0x16'));var licenseUtil=require(_0x57fd('0x17'));var db=require(_0x57fd('0x18'))['db'];function respondWithStatusCode(_0x933311,_0x4bcf76){_0x4bcf76=_0x4bcf76||0xcc;return function(_0xf90776){if(_0xf90776){return _0x933311['sendStatus'](_0x4bcf76);}return _0x933311[_0x57fd('0x19')](_0x4bcf76)[_0x57fd('0x1a')]();};}function respondWithResult(_0x26c5d8,_0x304f5e){_0x304f5e=_0x304f5e||0xc8;return function(_0x4f2598){if(_0x4f2598){return _0x26c5d8[_0x57fd('0x19')](_0x304f5e)['json'](_0x4f2598);}};}function respondWithFilteredResult(_0x58a42d,_0x8bc81){return function(_0x346496){if(_0x346496){var _0x2c30be=typeof _0x8bc81['offset']==='undefined'&&typeof _0x8bc81[_0x57fd('0x1b')]==='undefined';var _0x4c8f43=_0x346496[_0x57fd('0x1c')];var _0x4faf8f=_0x2c30be?0x0:_0x8bc81[_0x57fd('0x1d')];var _0x1772f7=_0x2c30be?_0x346496[_0x57fd('0x1c')]:_0x8bc81[_0x57fd('0x1d')]+_0x8bc81[_0x57fd('0x1b')];var _0x2e980c;if(_0x1772f7>=_0x4c8f43){_0x1772f7=_0x4c8f43;_0x2e980c=0xc8;}else{_0x2e980c=0xce;}_0x58a42d[_0x57fd('0x19')](_0x2e980c);return _0x58a42d[_0x57fd('0x1e')](_0x57fd('0x1f'),_0x4faf8f+'-'+_0x1772f7+'/'+_0x4c8f43)[_0x57fd('0x20')](_0x346496);}return null;};}function patchUpdates(_0x258bba){return function(_0x43f6af){try{jsonpatch['apply'](_0x43f6af,_0x258bba,!![]);}catch(_0xcea535){return BPromise[_0x57fd('0x21')](_0xcea535);}return _0x43f6af['save']();};}function saveUpdates(_0x44d1d9,_0x5a0184){return function(_0x2015df){if(_0x2015df){return _0x2015df[_0x57fd('0x22')](_0x44d1d9)[_0x57fd('0x23')](function(_0x309d58){return _0x309d58;});}return null;};}function removeEntity(_0x215ccf,_0x13ca60){return function(_0x43df46){if(_0x43df46){return _0x43df46[_0x57fd('0x24')]()[_0x57fd('0x23')](function(){_0x215ccf[_0x57fd('0x19')](0xcc)[_0x57fd('0x1a')]();});}};}function handleEntityNotFound(_0x4447ab,_0xda44b7){return function(_0x53eebf){if(!_0x53eebf){_0x4447ab[_0x57fd('0x25')](0x194);}return _0x53eebf;};}function handleError(_0x358ca4,_0x44af2d){_0x44af2d=_0x44af2d||0x1f4;return function(_0x2d2606){logger[_0x57fd('0x26')](_0x2d2606['stack']);if(_0x2d2606[_0x57fd('0x27')]){delete _0x2d2606[_0x57fd('0x27')];}_0x358ca4[_0x57fd('0x19')](_0x44af2d)['send'](_0x2d2606);};}exports[_0x57fd('0x28')]=function(_0xa3d603,_0x207760){var _0x4935be={},_0x177a3e={},_0x57b40d={'count':0x0,'rows':[]};var _0x16522c=_[_0x57fd('0x29')](db['Automation'][_0x57fd('0x2a')],function(_0x3742e4){return{'name':_0x3742e4[_0x57fd('0x2b')],'type':_0x3742e4[_0x57fd('0x2c')][_0x57fd('0x2d')]};});_0x177a3e['model']=_[_0x57fd('0x29')](_0x16522c,_0x57fd('0x27'));_0x177a3e['query']=_[_0x57fd('0x2e')](_0xa3d603[_0x57fd('0x2f')]);_0x177a3e[_0x57fd('0x30')]=_['intersection'](_0x177a3e[_0x57fd('0x31')],_0x177a3e['query']);_0x4935be['attributes']=_['intersection'](_0x177a3e[_0x57fd('0x31')],qs[_0x57fd('0x32')](_0xa3d603['query'][_0x57fd('0x32')]));_0x4935be['attributes']=_0x4935be[_0x57fd('0x33')][_0x57fd('0x34')]?_0x4935be['attributes']:_0x177a3e[_0x57fd('0x31')];if(!_0xa3d603[_0x57fd('0x2f')]['hasOwnProperty']('nolimit')){_0x4935be['limit']=qs[_0x57fd('0x1b')](_0xa3d603[_0x57fd('0x2f')][_0x57fd('0x1b')]);_0x4935be[_0x57fd('0x1d')]=qs['offset'](_0xa3d603[_0x57fd('0x2f')]['offset']);}_0x4935be['order']=qs['sort'](_0xa3d603['query'][_0x57fd('0x35')]);_0x4935be[_0x57fd('0x36')]=qs[_0x57fd('0x30')](_[_0x57fd('0x37')](_0xa3d603[_0x57fd('0x2f')],_0x177a3e[_0x57fd('0x30')]),_0x16522c);if(_0xa3d603['query'][_0x57fd('0x38')]){_0x4935be[_0x57fd('0x36')]=_[_0x57fd('0x39')](_0x4935be['where'],{'$or':_[_0x57fd('0x29')](_0x16522c,function(_0x7b3a53){if(_0x7b3a53[_0x57fd('0x2c')]!==_0x57fd('0x3a')){var _0x2716a7={};_0x2716a7[_0x7b3a53[_0x57fd('0x27')]]={'$like':'%'+_0xa3d603[_0x57fd('0x2f')]['filter']+'%'};return _0x2716a7;}})});}_0x4935be=_[_0x57fd('0x39')]({},_0x4935be,_0xa3d603['options']);var _0x567e78={'where':_0x4935be[_0x57fd('0x36')]};return db[_0x57fd('0x3b')]['count'](_0x567e78)[_0x57fd('0x23')](function(_0x4ceee2){_0x57b40d[_0x57fd('0x1c')]=_0x4ceee2;if(_0xa3d603['query'][_0x57fd('0x3c')]){_0x4935be[_0x57fd('0x3d')]=[{'all':!![]}];}return db[_0x57fd('0x3b')][_0x57fd('0x3e')](_0x4935be);})['then'](function(_0x42f0a3){_0x57b40d[_0x57fd('0x3f')]=_0x42f0a3;return _0x57b40d;})[_0x57fd('0x23')](respondWithFilteredResult(_0x207760,_0x4935be))['catch'](handleError(_0x207760,null));};exports[_0x57fd('0x40')]=function(_0x5730f9,_0xf988a4){var _0x27a0f3={'raw':![],'where':{'id':_0x5730f9['params']['id']}},_0x1436f7={};_0x1436f7['model']=_[_0x57fd('0x2e')](db['Automation']['rawAttributes']);_0x1436f7[_0x57fd('0x2f')]=_[_0x57fd('0x2e')](_0x5730f9[_0x57fd('0x2f')]);_0x1436f7[_0x57fd('0x30')]=_[_0x57fd('0x41')](_0x1436f7[_0x57fd('0x31')],_0x1436f7[_0x57fd('0x2f')]);_0x27a0f3[_0x57fd('0x33')]=_[_0x57fd('0x41')](_0x1436f7[_0x57fd('0x31')],qs[_0x57fd('0x32')](_0x5730f9[_0x57fd('0x2f')][_0x57fd('0x32')]));_0x27a0f3[_0x57fd('0x33')]=_0x27a0f3[_0x57fd('0x33')][_0x57fd('0x34')]?_0x27a0f3[_0x57fd('0x33')]:_0x1436f7[_0x57fd('0x31')];if(_0x5730f9[_0x57fd('0x2f')][_0x57fd('0x3c')]){_0x27a0f3[_0x57fd('0x3d')]=[{'all':!![]}];}_0x27a0f3=_[_0x57fd('0x39')]({},_0x27a0f3,_0x5730f9[_0x57fd('0x42')]);return db[_0x57fd('0x3b')]['find'](_0x27a0f3)['then'](handleEntityNotFound(_0xf988a4,null))[_0x57fd('0x23')](respondWithResult(_0xf988a4,null))[_0x57fd('0x43')](handleError(_0xf988a4,null));};exports[_0x57fd('0x44')]=function(_0xb701c7,_0x18d800){return db['Automation'][_0x57fd('0x44')](_0xb701c7[_0x57fd('0x45')],{})[_0x57fd('0x23')](respondWithResult(_0x18d800,0xc9))[_0x57fd('0x43')](handleError(_0x18d800,null));};exports['update']=function(_0x33d5bd,_0x1d9d99){if(_0x33d5bd[_0x57fd('0x45')]['id']){delete _0x33d5bd['body']['id'];}return db[_0x57fd('0x3b')][_0x57fd('0x46')]({'where':{'id':_0x33d5bd[_0x57fd('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d9d99,null))[_0x57fd('0x23')](saveUpdates(_0x33d5bd[_0x57fd('0x45')],null))[_0x57fd('0x23')](respondWithResult(_0x1d9d99,null))[_0x57fd('0x43')](handleError(_0x1d9d99,null));};exports[_0x57fd('0x24')]=function(_0x4d8478,_0x57ab14){return db[_0x57fd('0x3b')][_0x57fd('0x46')]({'where':{'id':_0x4d8478['params']['id']}})[_0x57fd('0x23')](handleEntityNotFound(_0x57ab14,null))['then'](removeEntity(_0x57ab14,null))[_0x57fd('0x43')](handleError(_0x57ab14,null));};exports[_0x57fd('0x48')]=function(_0x233ff6,_0x1a3345,_0x1c9f7d){return db[_0x57fd('0x49')]['find']({'where':{'id':_0x233ff6[_0x57fd('0x47')]['id']}})[_0x57fd('0x23')](handleEntityNotFound(_0x1a3345,null))['then'](function(_0x4a7b63){if(_0x4a7b63){return _0x4a7b63['addConditions'](_0x233ff6[_0x57fd('0x45')]['ids'],_[_0x57fd('0x4a')](_0x233ff6[_0x57fd('0x45')],['ids','id'])||{});}})[_0x57fd('0x23')](respondWithResult(_0x1a3345,null))['catch'](handleError(_0x1a3345,null));};exports['getConditions']=function(_0x153daa,_0x1e5c52,_0x5d15d8){var _0x3ee8e7={};var _0xee54a7={};var _0x13551b;var _0x3814de;return db['Automation'][_0x57fd('0x4b')]({'where':{'id':_0x153daa['params']['id']}})[_0x57fd('0x23')](handleEntityNotFound(_0x1e5c52,null))['then'](function(_0x4b487d){if(_0x4b487d){_0x13551b=_0x4b487d;_0xee54a7['model']=_[_0x57fd('0x2e')](db[_0x57fd('0x49')][_0x57fd('0x2a')]);_0xee54a7[_0x57fd('0x2f')]=_['keys'](_0x153daa[_0x57fd('0x2f')]);_0xee54a7[_0x57fd('0x30')]=_[_0x57fd('0x41')](_0xee54a7['model'],_0xee54a7['query']);_0x3ee8e7[_0x57fd('0x33')]=_[_0x57fd('0x41')](_0xee54a7[_0x57fd('0x31')],qs[_0x57fd('0x32')](_0x153daa[_0x57fd('0x2f')]['fields']));_0x3ee8e7[_0x57fd('0x33')]=_0x3ee8e7['attributes'][_0x57fd('0x34')]?_0x3ee8e7[_0x57fd('0x33')]:_0xee54a7['model'];_0x3ee8e7[_0x57fd('0x4c')]=qs['sort'](_0x153daa[_0x57fd('0x2f')][_0x57fd('0x35')]);_0x3ee8e7['where']=qs[_0x57fd('0x30')](_['pick'](_0x153daa[_0x57fd('0x2f')],_0xee54a7['filters']));if(_0x153daa['query'][_0x57fd('0x38')]){_0x3ee8e7[_0x57fd('0x36')]=_[_0x57fd('0x39')](_0x3ee8e7['where'],{'$or':_[_0x57fd('0x29')](_0x3ee8e7[_0x57fd('0x33')],function(_0x11cc9e){var _0x2dbe27={};_0x2dbe27[_0x11cc9e]={'$like':'%'+_0x153daa['query'][_0x57fd('0x38')]+'%'};return _0x2dbe27;})});}_0x3ee8e7=_['merge']({},_0x3ee8e7,_0x153daa['options']);return _0x13551b[_0x57fd('0x4d')](_0x3ee8e7);}})[_0x57fd('0x23')](function(_0x1c542f){if(_0x1c542f){_0x3814de=_0x1c542f[_0x57fd('0x34')];if(!_0x153daa[_0x57fd('0x2f')][_0x57fd('0x4e')](_0x57fd('0x4f'))){_0x3ee8e7[_0x57fd('0x1b')]=qs[_0x57fd('0x1b')](_0x153daa['query'][_0x57fd('0x1b')]);_0x3ee8e7[_0x57fd('0x1d')]=qs[_0x57fd('0x1d')](_0x153daa[_0x57fd('0x2f')][_0x57fd('0x1d')]);}return _0x13551b['getConditions'](_0x3ee8e7);}})['then'](function(_0x808f6){if(_0x808f6){return _0x808f6?{'count':_0x3814de,'rows':_0x808f6}:null;}})[_0x57fd('0x23')](respondWithResult(_0x1e5c52,null))[_0x57fd('0x43')](handleError(_0x1e5c52,null));};exports[_0x57fd('0x50')]=function(_0x442cb8,_0x54af58,_0x1ae7cf){return db[_0x57fd('0x51')]['find']({'where':{'id':_0x442cb8[_0x57fd('0x47')]['id']}})['then'](handleEntityNotFound(_0x54af58,null))[_0x57fd('0x23')](function(_0x23969c){if(_0x23969c){return _0x23969c[_0x57fd('0x50')](_0x442cb8['body']['ids'],_[_0x57fd('0x4a')](_0x442cb8['body'],[_0x57fd('0x52'),'id'])||{});}})[_0x57fd('0x23')](respondWithResult(_0x54af58,null))['catch'](handleError(_0x54af58,null));};exports[_0x57fd('0x53')]=function(_0x2d7695,_0xca09db,_0x4ed02a){var _0x253a45={};var _0x1574d2={};var _0x42db95;var _0x2ea43c;return db[_0x57fd('0x3b')][_0x57fd('0x4b')]({'where':{'id':_0x2d7695[_0x57fd('0x47')]['id']}})[_0x57fd('0x23')](handleEntityNotFound(_0xca09db,null))[_0x57fd('0x23')](function(_0x2645c2){if(_0x2645c2){_0x42db95=_0x2645c2;_0x1574d2[_0x57fd('0x31')]=_[_0x57fd('0x2e')](db[_0x57fd('0x51')]['rawAttributes']);_0x1574d2[_0x57fd('0x2f')]=_[_0x57fd('0x2e')](_0x2d7695[_0x57fd('0x2f')]);_0x1574d2[_0x57fd('0x30')]=_[_0x57fd('0x41')](_0x1574d2[_0x57fd('0x31')],_0x1574d2[_0x57fd('0x2f')]);_0x253a45['attributes']=_['intersection'](_0x1574d2['model'],qs[_0x57fd('0x32')](_0x2d7695[_0x57fd('0x2f')][_0x57fd('0x32')]));_0x253a45[_0x57fd('0x33')]=_0x253a45[_0x57fd('0x33')][_0x57fd('0x34')]?_0x253a45[_0x57fd('0x33')]:_0x1574d2[_0x57fd('0x31')];_0x253a45['order']=qs[_0x57fd('0x35')](_0x2d7695[_0x57fd('0x2f')]['sort']);_0x253a45[_0x57fd('0x36')]=qs[_0x57fd('0x30')](_[_0x57fd('0x37')](_0x2d7695['query'],_0x1574d2[_0x57fd('0x30')]));if(_0x2d7695['query'][_0x57fd('0x38')]){_0x253a45['where']=_[_0x57fd('0x39')](_0x253a45[_0x57fd('0x36')],{'$or':_[_0x57fd('0x29')](_0x253a45[_0x57fd('0x33')],function(_0x52bd69){var _0x3e9617={};_0x3e9617[_0x52bd69]={'$like':'%'+_0x2d7695[_0x57fd('0x2f')][_0x57fd('0x38')]+'%'};return _0x3e9617;})});}_0x253a45=_[_0x57fd('0x39')]({},_0x253a45,_0x2d7695[_0x57fd('0x42')]);return _0x42db95[_0x57fd('0x53')](_0x253a45);}})['then'](function(_0x560ab1){if(_0x560ab1){_0x2ea43c=_0x560ab1[_0x57fd('0x34')];if(!_0x2d7695[_0x57fd('0x2f')][_0x57fd('0x4e')](_0x57fd('0x4f'))){_0x253a45[_0x57fd('0x1b')]=qs[_0x57fd('0x1b')](_0x2d7695[_0x57fd('0x2f')][_0x57fd('0x1b')]);_0x253a45[_0x57fd('0x1d')]=qs[_0x57fd('0x1d')](_0x2d7695['query'][_0x57fd('0x1d')]);}return _0x42db95[_0x57fd('0x53')](_0x253a45);}})[_0x57fd('0x23')](function(_0x2da51a){if(_0x2da51a){return _0x2da51a?{'count':_0x2ea43c,'rows':_0x2da51a}:null;}})[_0x57fd('0x23')](respondWithResult(_0xca09db,null))['catch'](handleError(_0xca09db,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 08143c1..2b36dc5 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 _0x7939=['api','bluebird','request-promise','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x493bc9,_0x54192b){var _0x4f9e6b=function(_0x2c9458){while(--_0x2c9458){_0x493bc9['push'](_0x493bc9['shift']());}};_0x4f9e6b(++_0x54192b);}(_0x7939,0x147));var _0x9793=function(_0x52382e,_0x45e3dd){_0x52382e=_0x52382e-0x0;var _0x2a4fa9=_0x7939[_0x52382e];return _0x2a4fa9;};'use strict';var _=require(_0x9793('0x0'));var util=require(_0x9793('0x1'));var logger=require(_0x9793('0x2'))(_0x9793('0x3'));var moment=require('moment');var BPromise=require(_0x9793('0x4'));var rp=require(_0x9793('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9793('0x6'));module['exports']=function(_0x3e5f6d,_0x4c4603){return _0x3e5f6d[_0x9793('0x7')](_0x9793('0x8'),attributes,{'tableName':_0x9793('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8316=['../../config/environment','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5579d4,_0x15e79f){var _0x1325ec=function(_0x588c31){while(--_0x588c31){_0x5579d4['push'](_0x5579d4['shift']());}};_0x1325ec(++_0x15e79f);}(_0x8316,0x191));var _0x6831=function(_0x5cf287,_0x4ab971){_0x5cf287=_0x5cf287-0x0;var _0x222ffb=_0x8316[_0x5cf287];return _0x222ffb;};'use strict';var _=require(_0x6831('0x0'));var util=require(_0x6831('0x1'));var logger=require(_0x6831('0x2'))(_0x6831('0x3'));var moment=require(_0x6831('0x4'));var BPromise=require(_0x6831('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6831('0x6'));var attributes=require('./automation.attributes');module[_0x6831('0x7')]=function(_0x5beb02,_0x4cf20e){return _0x5beb02[_0x6831('0x8')](_0x6831('0x9'),attributes,{'tableName':_0x6831('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 8d62877..c2cee2e 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 _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2f326c,_0x8216e8){var _0x28b84b=function(_0x49552d){while(--_0x49552d){_0x2f326c['push'](_0x2f326c['shift']());}};_0x28b84b(++_0x8216e8);}(_0x9148,0x10d));var _0x8914=function(_0x11d7af,_0x3f431a){_0x11d7af=_0x11d7af-0x0;var _0x3ed293=_0x9148[_0x11d7af];return _0x3ed293;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});} \ No newline at end of file +var _0xeda7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c5a3a,_0x34960a){var _0x36aae3=function(_0x2c0d6b){while(--_0x2c0d6b){_0x1c5a3a['push'](_0x1c5a3a['shift']());}};_0x36aae3(++_0x34960a);}(_0xeda7,0x196));var _0x7eda=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xeda7[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var moment=require(_0x7eda('0x2'));var BPromise=require(_0x7eda('0x3'));var rs=require(_0x7eda('0x4'));var fs=require('fs');var Redis=require(_0x7eda('0x5'));var db=require(_0x7eda('0x6'))['db'];var utils=require(_0x7eda('0x7'));var logger=require(_0x7eda('0x8'))(_0x7eda('0x9'));var config=require(_0x7eda('0xa'));var jayson=require(_0x7eda('0xb'));var client=jayson[_0x7eda('0xc')][_0x7eda('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x314602,_0x839e38,_0x163427){return new BPromise(function(_0x2bc200,_0x11576a){return client[_0x7eda('0xe')](_0x314602,_0x163427)['then'](function(_0x29bce2){logger['info']('Automation,\x20%s,\x20%s',_0x839e38,_0x7eda('0xf'));logger[_0x7eda('0x10')](_0x7eda('0x11'),_0x839e38,_0x7eda('0xf'),JSON['stringify'](_0x29bce2));if(_0x29bce2['error']){if(_0x29bce2[_0x7eda('0x12')][_0x7eda('0x13')]===0x1f4){logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x29bce2['error'][_0x7eda('0x15')]);return _0x11576a(_0x29bce2['error'][_0x7eda('0x15')]);}logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x29bce2[_0x7eda('0x12')][_0x7eda('0x15')]);return _0x2bc200(_0x29bce2[_0x7eda('0x12')][_0x7eda('0x15')]);}else{logger[_0x7eda('0x16')](_0x7eda('0x14'),_0x839e38,'request\x20sent');_0x2bc200(_0x29bce2['result'][_0x7eda('0x15')]);}})['catch'](function(_0x597ce9){logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x597ce9);_0x11576a(_0x597ce9);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c9d1b5c..9ed3919 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 _0x032e=['./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2148c5,_0x57fe58){var _0x16187c=function(_0xd1c046){while(--_0xd1c046){_0x2148c5['push'](_0x2148c5['shift']());}};_0x16187c(++_0x57fe58);}(_0x032e,0x124));var _0xe032=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x032e[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0x8')](_0xe032('0xf'),auth['isAuthenticated'](),controller[_0xe032('0x10')]);router[_0xe032('0x11')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0x12')]);router[_0xe032('0x11')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller['addConditions']);router[_0xe032('0x11')](_0xe032('0xf'),auth[_0xe032('0x9')](),controller[_0xe032('0x13')]);router['put'](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0x14')]);router[_0xe032('0x15')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8388=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getConditions','getActions','post','/:id/conditions','addConditions','/:id/actions','put','update','delete'];(function(_0x524c4a,_0x498be2){var _0x3c7527=function(_0x537a8e){while(--_0x537a8e){_0x524c4a['push'](_0x524c4a['shift']());}};_0x3c7527(++_0x498be2);}(_0x8388,0x18d));var _0x8838=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x8388[_0x2fc012];return _0x2891f9;};'use strict';var multer=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var path=require(_0x8838('0x2'));var timeout=require(_0x8838('0x3'));var express=require('express');var router=express[_0x8838('0x4')]();var fs_extra=require(_0x8838('0x5'));var auth=require(_0x8838('0x6'));var interaction=require(_0x8838('0x7'));var config=require(_0x8838('0x8'));var controller=require('./automation.controller');router[_0x8838('0x9')]('/',auth[_0x8838('0xa')](),controller['index']);router[_0x8838('0x9')](_0x8838('0xb'),auth[_0x8838('0xa')](),controller['show']);router[_0x8838('0x9')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x8838('0xc')]);router['get']('/:id/actions',auth[_0x8838('0xa')](),controller[_0x8838('0xd')]);router[_0x8838('0xe')]('/',auth[_0x8838('0xa')](),controller['create']);router[_0x8838('0xe')](_0x8838('0xf'),auth[_0x8838('0xa')](),controller[_0x8838('0x10')]);router['post'](_0x8838('0x11'),auth['isAuthenticated'](),controller['addActions']);router[_0x8838('0x12')](_0x8838('0xb'),auth[_0x8838('0xa')](),controller[_0x8838('0x13')]);router[_0x8838('0x14')](_0x8838('0xb'),auth[_0x8838('0xa')](),controller[_0x8838('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 62b0a7d..722dd9c 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 _0x90c1=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','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)','#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)'];(function(_0x306638,_0x498296){var _0x3217e9=function(_0x30e219){while(--_0x30e219){_0x306638['push'](_0x306638['shift']());}};_0x3217e9(++_0x498296);}(_0x90c1,0x131));var _0x190c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x90c1[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x190c('0x0'));module[_0x190c('0x1')]={'name':{'type':Sequelize[_0x190c('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x190c('0x3')](_0x190c('0x4')),'allowNull':![],'defaultValue':_0x190c('0x4')},'description':{'type':Sequelize[_0x190c('0x2')]},'active':{'type':Sequelize[_0x190c('0x5')],'defaultValue':0x0,'comment':_0x190c('0x6')},'limitCalls':{'type':Sequelize[_0x190c('0x7')](0x4)[_0x190c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x190c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x190c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x190c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x190c('0xf')},'dialTimezone':{'type':Sequelize[_0x190c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x190c('0x2')],'defaultValue':_0x190c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x190c('0x3')](_0x190c('0x11'),_0x190c('0x12'),_0x190c('0x13')),'defaultValue':_0x190c('0x11')},'dialAMDActive':{'type':Sequelize[_0x190c('0x5')],'defaultValue':0x0,'comment':_0x190c('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x190c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x190c('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x190c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x190c('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x190c('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x190c('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x190c('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x190c('0x7')](0x9)[_0x190c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x190c('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x190c('0x3')]('DESC',_0x190c('0x1b')),'defaultValue':_0x190c('0x1c')},'dialPrefix':{'type':Sequelize[_0x190c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x190c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x190c('0x1d')},'dialCutDigit':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x190c('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x190c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)[_0x190c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x190c('0x7')](0x3)[_0x190c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x190c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x190c('0x25')}}; \ No newline at end of file +var _0xbe62=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x5b509f,_0x2fa1e0){var _0x23db71=function(_0x2eca36){while(--_0x2eca36){_0x5b509f['push'](_0x5b509f['shift']());}};_0x23db71(++_0x2fa1e0);}(_0xbe62,0x9e));var _0x2be6=function(_0x352a83,_0x5b64db){_0x352a83=_0x352a83-0x0;var _0x3c7ed0=_0xbe62[_0x352a83];return _0x3c7ed0;};'use strict';var Sequelize=require('sequelize');module[_0x2be6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x2be6('0x1')},'description':{'type':Sequelize[_0x2be6('0x2')]},'active':{'type':Sequelize[_0x2be6('0x3')],'defaultValue':0x0,'comment':_0x2be6('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2be6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2be6('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2be6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2be6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'comment':_0x2be6('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2be6('0xd')},'dialTimezone':{'type':Sequelize[_0x2be6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2be6('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x2be6('0xf')](_0x2be6('0x10'),'never',_0x2be6('0x11')),'defaultValue':_0x2be6('0x10')},'dialAMDActive':{'type':Sequelize[_0x2be6('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2be6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x2be6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2be6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2be6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2be6('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2be6('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2be6('0x7')](0x9)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2be6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2be6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2be6('0xf')]('DESC',_0x2be6('0x18')),'defaultValue':_0x2be6('0x19')},'dialPrefix':{'type':Sequelize[_0x2be6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2be6('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)[_0x2be6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2be6('0x7')](0x3)[_0x2be6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2be6('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2be6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2be6('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 0cca796..2e6da37 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 _0xdbf0=['cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','cm_hopper_additional_phones','cmHopperId','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','name','send','Campaign','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','field','NOW()','scheduledAt','toString','from'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbf0,0x1db));var _0x0dbf=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdbf0[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0dbf('0x0'));var zipdir=require(_0x0dbf('0x1'));var jsonpatch=require(_0x0dbf('0x2'));var rp=require(_0x0dbf('0x3'));var moment=require('moment');var BPromise=require(_0x0dbf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0dbf('0x5'));var sox=require(_0x0dbf('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0dbf('0x7'));var _=require(_0x0dbf('0x8'));var squel=require(_0x0dbf('0x9'));var crypto=require(_0x0dbf('0xa'));var jsforce=require(_0x0dbf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0dbf('0xc'));var querystring=require(_0x0dbf('0xd'));var Papa=require(_0x0dbf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0dbf('0xf'));var as=require(_0x0dbf('0x10'));var hardwareService=require(_0x0dbf('0x11'));var logger=require(_0x0dbf('0x12'))(_0x0dbf('0x13'));var utils=require(_0x0dbf('0x14'));var config=require(_0x0dbf('0x15'));var licenseUtil=require(_0x0dbf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4641c9,_0x22f03c){_0x22f03c=_0x22f03c||0xcc;return function(_0x3e8430){if(_0x3e8430){return _0x4641c9[_0x0dbf('0x17')](_0x22f03c);}return _0x4641c9[_0x0dbf('0x18')](_0x22f03c)[_0x0dbf('0x19')]();};}function respondWithResult(_0x18865a,_0x2b7288){_0x2b7288=_0x2b7288||0xc8;return function(_0x56d46d){if(_0x56d46d){return _0x18865a[_0x0dbf('0x18')](_0x2b7288)[_0x0dbf('0x1a')](_0x56d46d);}};}function respondWithFilteredResult(_0xb1c789,_0x2951e1){return function(_0x3923ea){if(_0x3923ea){var _0x46f6ae=typeof _0x2951e1[_0x0dbf('0x1b')]===_0x0dbf('0x1c')&&typeof _0x2951e1[_0x0dbf('0x1d')]===_0x0dbf('0x1c');var _0xb4e3bc=_0x3923ea[_0x0dbf('0x1e')];var _0x45a5de=_0x46f6ae?0x0:_0x2951e1['offset'];var _0x590cbb=_0x46f6ae?_0x3923ea[_0x0dbf('0x1e')]:_0x2951e1[_0x0dbf('0x1b')]+_0x2951e1[_0x0dbf('0x1d')];var _0x4deb36;if(_0x590cbb>=_0xb4e3bc){_0x590cbb=_0xb4e3bc;_0x4deb36=0xc8;}else{_0x4deb36=0xce;}_0xb1c789[_0x0dbf('0x18')](_0x4deb36);return _0xb1c789[_0x0dbf('0x1f')](_0x0dbf('0x20'),_0x45a5de+'-'+_0x590cbb+'/'+_0xb4e3bc)[_0x0dbf('0x1a')](_0x3923ea);}return null;};}function patchUpdates(_0x351699){return function(_0x3485a4){try{jsonpatch[_0x0dbf('0x21')](_0x3485a4,_0x351699,!![]);}catch(_0x14884f){return BPromise[_0x0dbf('0x22')](_0x14884f);}return _0x3485a4['save']();};}function saveUpdates(_0x936f86,_0x4f9721){return function(_0x327698){if(_0x327698){return _0x327698[_0x0dbf('0x23')](_0x936f86)[_0x0dbf('0x24')](function(_0x4172fe){return _0x4172fe;});}return null;};}function removeEntity(_0x43b2cd,_0x269c32){return function(_0x2efc84){if(_0x2efc84){return _0x2efc84[_0x0dbf('0x25')]()[_0x0dbf('0x24')](function(){var _0x2991af=_0x2efc84['get']({'plain':!![]});var _0x435683='IvrCampaigns';return db[_0x0dbf('0x26')][_0x0dbf('0x25')]({'where':{'type':_0x435683,'resourceId':_0x2991af['id']}})[_0x0dbf('0x24')](function(){return _0x2efc84;});})[_0x0dbf('0x24')](function(){_0x43b2cd[_0x0dbf('0x18')](0xcc)[_0x0dbf('0x19')]();});}};}function handleEntityNotFound(_0x3048e4,_0x215595){return function(_0x492cb3){if(!_0x492cb3){_0x3048e4[_0x0dbf('0x17')](0x194);}return _0x492cb3;};}function handleError(_0x45f65d,_0x528ac5){_0x528ac5=_0x528ac5||0x1f4;return function(_0x4f9dd6){logger[_0x0dbf('0x27')](_0x4f9dd6[_0x0dbf('0x28')]);if(_0x4f9dd6[_0x0dbf('0x29')]){delete _0x4f9dd6[_0x0dbf('0x29')];}_0x45f65d[_0x0dbf('0x18')](_0x528ac5)[_0x0dbf('0x2a')](_0x4f9dd6);};}exports['index']=function(_0x4b3bc5,_0x39eb90){var _0x5b7f5f={},_0x56bb28={},_0x193d83={'count':0x0,'rows':[]};var _0x260c0b=_['map'](db[_0x0dbf('0x2b')]['rawAttributes'],function(_0x28922c){return{'name':_0x28922c[_0x0dbf('0x2c')],'type':_0x28922c[_0x0dbf('0x2d')]['key']};});_0x56bb28[_0x0dbf('0x2e')]=_[_0x0dbf('0x2f')](_0x260c0b,_0x0dbf('0x29'));_0x56bb28[_0x0dbf('0x30')]=_[_0x0dbf('0x31')](_0x4b3bc5[_0x0dbf('0x30')]);_0x56bb28[_0x0dbf('0x32')]=_[_0x0dbf('0x33')](_0x56bb28['model'],_0x56bb28[_0x0dbf('0x30')]);_0x5b7f5f[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x56bb28[_0x0dbf('0x2e')],qs[_0x0dbf('0x35')](_0x4b3bc5[_0x0dbf('0x30')]['fields']));_0x5b7f5f['attributes']=_0x5b7f5f[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x5b7f5f[_0x0dbf('0x34')]:_0x56bb28['model'];if(!_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x37')](_0x0dbf('0x38'))){_0x5b7f5f[_0x0dbf('0x1d')]=qs[_0x0dbf('0x1d')](_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x1d')]);_0x5b7f5f[_0x0dbf('0x1b')]=qs[_0x0dbf('0x1b')](_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x1b')]);}_0x5b7f5f['order']=qs[_0x0dbf('0x39')](_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x39')]);_0x5b7f5f[_0x0dbf('0x3a')]=qs['filters'](_[_0x0dbf('0x3b')](_0x4b3bc5[_0x0dbf('0x30')],_0x56bb28['filters']),_0x260c0b);if(_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x3c')]){_0x5b7f5f[_0x0dbf('0x3a')]=_[_0x0dbf('0x3d')](_0x5b7f5f['where'],{'$or':_['map'](_0x260c0b,function(_0xd84635){if(_0xd84635['type']!==_0x0dbf('0x3e')){var _0x187838={};_0x187838[_0xd84635[_0x0dbf('0x29')]]={'$like':'%'+_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x3c')]+'%'};return _0x187838;}})});}_0x5b7f5f=_['merge']({},_0x5b7f5f,_0x4b3bc5[_0x0dbf('0x3f')]);var _0x328925={'where':_0x5b7f5f[_0x0dbf('0x3a')]};return db['Campaign']['count'](_0x328925)[_0x0dbf('0x24')](function(_0x1569ed){_0x193d83[_0x0dbf('0x1e')]=_0x1569ed;if(_0x4b3bc5[_0x0dbf('0x30')][_0x0dbf('0x40')]){_0x5b7f5f[_0x0dbf('0x41')]=[{'all':!![]}];}return db[_0x0dbf('0x2b')][_0x0dbf('0x42')](_0x5b7f5f);})[_0x0dbf('0x24')](function(_0x54d86b){_0x193d83[_0x0dbf('0x43')]=_0x54d86b;return _0x193d83;})['then'](respondWithFilteredResult(_0x39eb90,_0x5b7f5f))['catch'](handleError(_0x39eb90,null));};exports[_0x0dbf('0x44')]=function(_0x247e13,_0x1de410){var _0x5c794a={'raw':![],'where':{'id':_0x247e13[_0x0dbf('0x45')]['id']}},_0x331ab4={};_0x331ab4[_0x0dbf('0x2e')]=_['keys'](db[_0x0dbf('0x2b')][_0x0dbf('0x46')]);_0x331ab4[_0x0dbf('0x30')]=_[_0x0dbf('0x31')](_0x247e13[_0x0dbf('0x30')]);_0x331ab4[_0x0dbf('0x32')]=_[_0x0dbf('0x33')](_0x331ab4[_0x0dbf('0x2e')],_0x331ab4['query']);_0x5c794a[_0x0dbf('0x34')]=_['intersection'](_0x331ab4[_0x0dbf('0x2e')],qs[_0x0dbf('0x35')](_0x247e13[_0x0dbf('0x30')][_0x0dbf('0x35')]));_0x5c794a[_0x0dbf('0x34')]=_0x5c794a[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x5c794a['attributes']:_0x331ab4[_0x0dbf('0x2e')];if(_0x247e13[_0x0dbf('0x30')][_0x0dbf('0x40')]){_0x5c794a[_0x0dbf('0x41')]=[{'all':!![]}];}_0x5c794a=_[_0x0dbf('0x3d')]({},_0x5c794a,_0x247e13['options']);return db[_0x0dbf('0x2b')][_0x0dbf('0x47')](_0x5c794a)['then'](handleEntityNotFound(_0x1de410,null))[_0x0dbf('0x24')](respondWithResult(_0x1de410,null))[_0x0dbf('0x48')](handleError(_0x1de410,null));};exports['create']=function(_0x5831a5,_0xacb125){return db[_0x0dbf('0x2b')][_0x0dbf('0x49')](_0x5831a5['body'],{})[_0x0dbf('0x24')](function(_0x469935){var _0x1c6cf7=_0x5831a5['user'][_0x0dbf('0x4a')]({'plain':!![]});if(!_0x1c6cf7)throw new Error(_0x0dbf('0x4b'));if(_0x1c6cf7[_0x0dbf('0x4c')]===_0x0dbf('0x4d')){var _0x1e3cd1=_0x469935[_0x0dbf('0x4a')]({'plain':!![]});var _0x49b5e2='IvrCampaigns';return db[_0x0dbf('0x4e')]['find']({'where':{'name':_0x49b5e2,'userProfileId':_0x1c6cf7[_0x0dbf('0x4f')]},'raw':!![]})['then'](function(_0x4a270b){if(_0x4a270b&&_0x4a270b[_0x0dbf('0x50')]===0x0){return db[_0x0dbf('0x26')][_0x0dbf('0x49')]({'name':_0x1e3cd1['name'],'resourceId':_0x1e3cd1['id'],'type':_0x4a270b[_0x0dbf('0x29')],'sectionId':_0x4a270b['id']},{})[_0x0dbf('0x24')](function(){return _0x469935;});}else{return _0x469935;}})[_0x0dbf('0x48')](function(_0x14fc68){logger[_0x0dbf('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14fc68);throw _0x14fc68;});}return _0x469935;})['then'](respondWithResult(_0xacb125,0xc9))['catch'](handleError(_0xacb125,null));};exports[_0x0dbf('0x51')]=function(_0x466f17,_0x35adb8){var _0x1ce98a={'where':{'id':_0x466f17['params']['id']}},_0x35e16c={};_0x35e16c[_0x0dbf('0x2e')]=_['keys'](db[_0x0dbf('0x2b')][_0x0dbf('0x46')]);_0x1ce98a[_0x0dbf('0x34')]=_['intersection'](_0x35e16c['model'],qs[_0x0dbf('0x35')](_0x466f17['query']['fields']));_0x1ce98a[_0x0dbf('0x34')]=_0x1ce98a[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x1ce98a[_0x0dbf('0x34')]:_0x35e16c[_0x0dbf('0x2e')];if(_0x466f17[_0x0dbf('0x30')][_0x0dbf('0x40')]){_0x1ce98a['include']=[{'all':!![]}];}_0x1ce98a=_[_0x0dbf('0x3d')]({},_0x1ce98a,_0x466f17[_0x0dbf('0x3f')]);return db[_0x0dbf('0x2b')][_0x0dbf('0x47')](_0x1ce98a)[_0x0dbf('0x24')](handleEntityNotFound(_0x35adb8,null))[_0x0dbf('0x24')](function(_0x40d4ae){if(_0x40d4ae){var _0x382c2c=_0x40d4ae['get']({'plain':!![]});_0x382c2c=qs[_0x0dbf('0x52')](_0x382c2c,['id',_0x0dbf('0x53'),_0x0dbf('0x54')]);_0x466f17[_0x0dbf('0x55')]=_[_0x0dbf('0x52')](_0x466f17['body'],['id','createdAt',_0x0dbf('0x54')]);return db['Campaign'][_0x0dbf('0x49')](_[_0x0dbf('0x3d')](_0x382c2c,_0x466f17[_0x0dbf('0x55')]),{'include':_0x466f17[_0x0dbf('0x30')][_0x0dbf('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x2b1dc2){var _0x4e881d=_0x466f17['user'][_0x0dbf('0x4a')]({'plain':!![]});if(!_0x4e881d)throw new Error(_0x0dbf('0x4b'));if(_0x4e881d[_0x0dbf('0x4c')]===_0x0dbf('0x4d')){var _0x22bd74=_0x2b1dc2[_0x0dbf('0x4a')]({'plain':!![]});var _0x125ff5=_0x0dbf('0x56');return db[_0x0dbf('0x4e')]['find']({'where':{'name':_0x125ff5,'userProfileId':_0x4e881d[_0x0dbf('0x4f')]},'raw':!![]})['then'](function(_0x43309b){if(_0x43309b&&_0x43309b[_0x0dbf('0x50')]===0x0){return db[_0x0dbf('0x26')][_0x0dbf('0x49')]({'name':_0x22bd74[_0x0dbf('0x29')],'resourceId':_0x22bd74['id'],'type':_0x43309b[_0x0dbf('0x29')],'sectionId':_0x43309b['id']},{})[_0x0dbf('0x24')](function(){return _0x2b1dc2;});}else{return _0x2b1dc2;}})['catch'](function(_0x2db170){logger[_0x0dbf('0x27')](_0x0dbf('0x57'),_0x2db170);throw _0x2db170;});}return _0x2b1dc2;});}})[_0x0dbf('0x24')](respondWithResult(_0x35adb8,0xc9))[_0x0dbf('0x48')](handleError(_0x35adb8,null));};exports['update']=function(_0x3a8f95,_0xd7f334){if(_0x3a8f95[_0x0dbf('0x55')]['id']){delete _0x3a8f95[_0x0dbf('0x55')]['id'];}return db['Campaign'][_0x0dbf('0x47')]({'where':{'id':_0x3a8f95[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0xd7f334,null))[_0x0dbf('0x24')](saveUpdates(_0x3a8f95['body'],null))[_0x0dbf('0x24')](respondWithResult(_0xd7f334,null))[_0x0dbf('0x48')](handleError(_0xd7f334,null));};exports[_0x0dbf('0x25')]=function(_0x34ca79,_0x48dac5){return db[_0x0dbf('0x2b')][_0x0dbf('0x47')]({'where':{'id':_0x34ca79[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x48dac5,null))['then'](removeEntity(_0x48dac5,null))[_0x0dbf('0x48')](handleError(_0x48dac5,null));};exports['getHoppers']=function(_0x305f3e,_0x2fc0cc,_0x363101){var _0x2f5556={'raw':!![],'where':{}};var _0x627f4c={};var _0x594a88={'count':0x0,'rows':[]};return db['Campaign'][_0x0dbf('0x58')]({'where':{'id':_0x305f3e['params']['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x2fc0cc,null))[_0x0dbf('0x24')](function(_0x1e6f54){if(_0x1e6f54){_0x627f4c[_0x0dbf('0x2e')]=_[_0x0dbf('0x31')](db[_0x0dbf('0x59')][_0x0dbf('0x46')]);_0x627f4c[_0x0dbf('0x30')]=_[_0x0dbf('0x31')](_0x305f3e[_0x0dbf('0x30')]);_0x627f4c['filters']=_[_0x0dbf('0x33')](_0x627f4c[_0x0dbf('0x2e')],_0x627f4c[_0x0dbf('0x30')]);_0x2f5556[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x627f4c[_0x0dbf('0x2e')],qs[_0x0dbf('0x35')](_0x305f3e[_0x0dbf('0x30')][_0x0dbf('0x35')]));_0x2f5556['attributes']=_0x2f5556[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x2f5556[_0x0dbf('0x34')]:_0x627f4c[_0x0dbf('0x2e')];if(!_0x305f3e['query'][_0x0dbf('0x37')]('nolimit')){_0x2f5556[_0x0dbf('0x1d')]=qs['limit'](_0x305f3e[_0x0dbf('0x30')]['limit']);_0x2f5556[_0x0dbf('0x1b')]=qs[_0x0dbf('0x1b')](_0x305f3e[_0x0dbf('0x30')]['offset']);}_0x2f5556[_0x0dbf('0x5a')]=qs[_0x0dbf('0x39')](_0x305f3e[_0x0dbf('0x30')][_0x0dbf('0x39')]);_0x2f5556[_0x0dbf('0x3a')]=qs['filters'](_[_0x0dbf('0x3b')](_0x305f3e[_0x0dbf('0x30')],_0x627f4c['filters']));_0x2f5556[_0x0dbf('0x3a')][_0x0dbf('0x5b')]=_0x1e6f54['id'];if(_0x305f3e['query'][_0x0dbf('0x3c')]){_0x2f5556[_0x0dbf('0x3a')]=_[_0x0dbf('0x3d')](_0x2f5556[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x2f5556[_0x0dbf('0x34')],function(_0x3c9007){var _0x53519e={};_0x53519e[_0x3c9007]={'$like':'%'+_0x305f3e['query']['filter']+'%'};return _0x53519e;})});}_0x2f5556=_[_0x0dbf('0x3d')]({},_0x2f5556,_0x305f3e['options']);return db['CmHopper']['count']({'where':_0x2f5556[_0x0dbf('0x3a')]})['then'](function(_0x5794db){_0x594a88[_0x0dbf('0x1e')]=_0x5794db;if(_0x305f3e[_0x0dbf('0x30')][_0x0dbf('0x40')]){_0x2f5556[_0x0dbf('0x41')]=[{'all':!![]}];}return db[_0x0dbf('0x59')][_0x0dbf('0x42')](_0x2f5556);})['then'](function(_0x44d9f7){_0x594a88['rows']=_0x44d9f7;return _0x594a88;});}})[_0x0dbf('0x24')](respondWithFilteredResult(_0x2fc0cc,_0x2f5556))[_0x0dbf('0x48')](handleError(_0x2fc0cc,null));};exports[_0x0dbf('0x5c')]=function(_0x3b2ef2,_0x4537be,_0x208ea9){var _0x221fe3={'raw':!![],'where':{}};var _0x52b77e={};var _0x3eb42e={'count':0x0,'rows':[]};return db[_0x0dbf('0x2b')][_0x0dbf('0x58')]({'where':{'id':_0x3b2ef2[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x4537be,null))[_0x0dbf('0x24')](function(_0x415e42){if(_0x415e42){_0x52b77e[_0x0dbf('0x2e')]=_[_0x0dbf('0x31')](db[_0x0dbf('0x5d')]['rawAttributes']);_0x52b77e['query']=_['keys'](_0x3b2ef2[_0x0dbf('0x30')]);_0x52b77e[_0x0dbf('0x32')]=_[_0x0dbf('0x33')](_0x52b77e[_0x0dbf('0x2e')],_0x52b77e[_0x0dbf('0x30')]);_0x221fe3[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x52b77e[_0x0dbf('0x2e')],qs['fields'](_0x3b2ef2['query'][_0x0dbf('0x35')]));_0x221fe3[_0x0dbf('0x34')]=_0x221fe3[_0x0dbf('0x34')]['length']?_0x221fe3[_0x0dbf('0x34')]:_0x52b77e[_0x0dbf('0x2e')];if(!_0x3b2ef2[_0x0dbf('0x30')][_0x0dbf('0x37')](_0x0dbf('0x38'))){_0x221fe3[_0x0dbf('0x1d')]=qs[_0x0dbf('0x1d')](_0x3b2ef2[_0x0dbf('0x30')][_0x0dbf('0x1d')]);_0x221fe3[_0x0dbf('0x1b')]=qs[_0x0dbf('0x1b')](_0x3b2ef2[_0x0dbf('0x30')][_0x0dbf('0x1b')]);}_0x221fe3[_0x0dbf('0x5a')]=qs[_0x0dbf('0x39')](_0x3b2ef2[_0x0dbf('0x30')][_0x0dbf('0x39')]);_0x221fe3[_0x0dbf('0x3a')]=qs[_0x0dbf('0x32')](_[_0x0dbf('0x3b')](_0x3b2ef2['query'],_0x52b77e[_0x0dbf('0x32')]));_0x221fe3[_0x0dbf('0x3a')][_0x0dbf('0x5b')]=_0x415e42['id'];if(_0x3b2ef2['query']['filter']){_0x221fe3[_0x0dbf('0x3a')]=_[_0x0dbf('0x3d')](_0x221fe3[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x221fe3['attributes'],function(_0x58bc76){var _0x31d498={};_0x31d498[_0x58bc76]={'$like':'%'+_0x3b2ef2[_0x0dbf('0x30')][_0x0dbf('0x3c')]+'%'};return _0x31d498;})});}_0x221fe3=_['merge']({},_0x221fe3,_0x3b2ef2[_0x0dbf('0x3f')]);return db[_0x0dbf('0x5d')][_0x0dbf('0x1e')]({'where':_0x221fe3[_0x0dbf('0x3a')]})[_0x0dbf('0x24')](function(_0x5e8937){_0x3eb42e[_0x0dbf('0x1e')]=_0x5e8937;if(_0x3b2ef2['query'][_0x0dbf('0x40')]){_0x221fe3[_0x0dbf('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0dbf('0x42')](_0x221fe3);})[_0x0dbf('0x24')](function(_0x471c80){_0x3eb42e[_0x0dbf('0x43')]=_0x471c80;return _0x3eb42e;});}})[_0x0dbf('0x24')](respondWithFilteredResult(_0x4537be,_0x221fe3))['catch'](handleError(_0x4537be,null));};exports[_0x0dbf('0x5e')]=function(_0x564b96,_0x39276b,_0x416fbc){var _0x1f2d67={'raw':!![],'where':{}};var _0x5f32de={};var _0x536d13={'count':0x0,'rows':[]};return db[_0x0dbf('0x2b')][_0x0dbf('0x58')]({'where':{'id':_0x564b96['params']['id']}})['then'](handleEntityNotFound(_0x39276b,null))['then'](function(_0x449ad9){if(_0x449ad9){_0x5f32de[_0x0dbf('0x2e')]=_[_0x0dbf('0x31')](db[_0x0dbf('0x5f')][_0x0dbf('0x46')]);_0x5f32de['query']=_['keys'](_0x564b96[_0x0dbf('0x30')]);_0x5f32de[_0x0dbf('0x32')]=_[_0x0dbf('0x33')](_0x5f32de[_0x0dbf('0x2e')],_0x5f32de['query']);_0x1f2d67[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x5f32de[_0x0dbf('0x2e')],qs[_0x0dbf('0x35')](_0x564b96[_0x0dbf('0x30')][_0x0dbf('0x35')]));_0x1f2d67[_0x0dbf('0x34')]=_0x1f2d67['attributes'][_0x0dbf('0x36')]?_0x1f2d67[_0x0dbf('0x34')]:_0x5f32de[_0x0dbf('0x2e')];if(!_0x564b96['query']['hasOwnProperty'](_0x0dbf('0x38'))){_0x1f2d67['limit']=qs[_0x0dbf('0x1d')](_0x564b96[_0x0dbf('0x30')][_0x0dbf('0x1d')]);_0x1f2d67[_0x0dbf('0x1b')]=qs[_0x0dbf('0x1b')](_0x564b96[_0x0dbf('0x30')][_0x0dbf('0x1b')]);}_0x1f2d67[_0x0dbf('0x5a')]=qs[_0x0dbf('0x39')](_0x564b96[_0x0dbf('0x30')]['sort']);_0x1f2d67[_0x0dbf('0x3a')]=qs[_0x0dbf('0x32')](_[_0x0dbf('0x3b')](_0x564b96[_0x0dbf('0x30')],_0x5f32de[_0x0dbf('0x32')]));_0x1f2d67[_0x0dbf('0x3a')][_0x0dbf('0x5b')]=_0x449ad9['id'];if(_0x564b96['query'][_0x0dbf('0x3c')]){_0x1f2d67[_0x0dbf('0x3a')]=_[_0x0dbf('0x3d')](_0x1f2d67[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x1f2d67[_0x0dbf('0x34')],function(_0xd6fe0c){var _0x3915ef={};_0x3915ef[_0xd6fe0c]={'$like':'%'+_0x564b96[_0x0dbf('0x30')]['filter']+'%'};return _0x3915ef;})});}_0x1f2d67=_[_0x0dbf('0x3d')]({},_0x1f2d67,_0x564b96[_0x0dbf('0x3f')]);return db[_0x0dbf('0x5f')][_0x0dbf('0x1e')]({'where':_0x1f2d67['where']})[_0x0dbf('0x24')](function(_0x3c6732){_0x536d13['count']=_0x3c6732;if(_0x564b96[_0x0dbf('0x30')]['includeAll']){_0x1f2d67[_0x0dbf('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0dbf('0x42')](_0x1f2d67);})['then'](function(_0x3fd037){_0x536d13[_0x0dbf('0x43')]=_0x3fd037;return _0x536d13;});}})[_0x0dbf('0x24')](respondWithFilteredResult(_0x39276b,_0x1f2d67))[_0x0dbf('0x48')](handleError(_0x39276b,null));};exports[_0x0dbf('0x60')]=function(_0x5cbdd0,_0x31bb13,_0x3bc9c3){var _0x2ae59b={'raw':!![],'where':{}};var _0x2bef7f={};var _0x19c20f={'count':0x0,'rows':[]};return db[_0x0dbf('0x2b')][_0x0dbf('0x58')]({'where':{'id':_0x5cbdd0[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x31bb13,null))['then'](function(_0x50123c){if(_0x50123c){_0x2bef7f[_0x0dbf('0x2e')]=_[_0x0dbf('0x31')](db[_0x0dbf('0x61')][_0x0dbf('0x46')]);_0x2bef7f[_0x0dbf('0x30')]=_['keys'](_0x5cbdd0[_0x0dbf('0x30')]);_0x2bef7f['filters']=_[_0x0dbf('0x33')](_0x2bef7f[_0x0dbf('0x2e')],_0x2bef7f[_0x0dbf('0x30')]);_0x2ae59b[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x2bef7f['model'],qs['fields'](_0x5cbdd0[_0x0dbf('0x30')]['fields']));_0x2ae59b[_0x0dbf('0x34')]=_0x2ae59b[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x2ae59b[_0x0dbf('0x34')]:_0x2bef7f[_0x0dbf('0x2e')];if(!_0x5cbdd0['query']['hasOwnProperty'](_0x0dbf('0x38'))){_0x2ae59b[_0x0dbf('0x1d')]=qs['limit'](_0x5cbdd0[_0x0dbf('0x30')][_0x0dbf('0x1d')]);_0x2ae59b['offset']=qs[_0x0dbf('0x1b')](_0x5cbdd0[_0x0dbf('0x30')][_0x0dbf('0x1b')]);}_0x2ae59b['order']=qs[_0x0dbf('0x39')](_0x5cbdd0[_0x0dbf('0x30')][_0x0dbf('0x39')]);_0x2ae59b[_0x0dbf('0x3a')]=qs[_0x0dbf('0x32')](_[_0x0dbf('0x3b')](_0x5cbdd0[_0x0dbf('0x30')],_0x2bef7f[_0x0dbf('0x32')]));_0x2ae59b[_0x0dbf('0x3a')][_0x0dbf('0x5b')]=_0x50123c['id'];if(_0x5cbdd0[_0x0dbf('0x30')][_0x0dbf('0x3c')]){_0x2ae59b['where']=_[_0x0dbf('0x3d')](_0x2ae59b[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x2ae59b['attributes'],function(_0x3fbdb5){var _0x5dfb4c={};_0x5dfb4c[_0x3fbdb5]={'$like':'%'+_0x5cbdd0[_0x0dbf('0x30')][_0x0dbf('0x3c')]+'%'};return _0x5dfb4c;})});}_0x2ae59b=_[_0x0dbf('0x3d')]({},_0x2ae59b,_0x5cbdd0[_0x0dbf('0x3f')]);return db[_0x0dbf('0x61')]['count']({'where':_0x2ae59b[_0x0dbf('0x3a')]})[_0x0dbf('0x24')](function(_0x5df04e){_0x19c20f['count']=_0x5df04e;if(_0x5cbdd0[_0x0dbf('0x30')]['includeAll']){_0x2ae59b['include']=[{'all':!![]}];}return db[_0x0dbf('0x61')][_0x0dbf('0x42')](_0x2ae59b);})[_0x0dbf('0x24')](function(_0x396435){_0x19c20f[_0x0dbf('0x43')]=_0x396435;return _0x19c20f;});}})[_0x0dbf('0x24')](respondWithFilteredResult(_0x31bb13,_0x2ae59b))['catch'](handleError(_0x31bb13,null));};exports[_0x0dbf('0x62')]=function(_0x3fc5de,_0x1839a3,_0x526879){var _0x59ecc4={};var _0x466a80={};var _0x4dd216;var _0x14f445;return db[_0x0dbf('0x2b')][_0x0dbf('0x58')]({'where':{'id':_0x3fc5de['params']['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x1839a3,null))[_0x0dbf('0x24')](function(_0x3b90fc){if(_0x3b90fc){_0x4dd216=_0x3b90fc;_0x466a80['model']=_['keys'](db[_0x0dbf('0x63')][_0x0dbf('0x46')]);_0x466a80[_0x0dbf('0x30')]=_[_0x0dbf('0x31')](_0x3fc5de[_0x0dbf('0x30')]);_0x466a80[_0x0dbf('0x32')]=_['intersection'](_0x466a80['model'],_0x466a80[_0x0dbf('0x30')]);_0x59ecc4[_0x0dbf('0x34')]=_[_0x0dbf('0x33')](_0x466a80[_0x0dbf('0x2e')],qs[_0x0dbf('0x35')](_0x3fc5de[_0x0dbf('0x30')][_0x0dbf('0x35')]));_0x59ecc4['attributes']=_0x59ecc4[_0x0dbf('0x34')]['length']?_0x59ecc4[_0x0dbf('0x34')]:_0x466a80[_0x0dbf('0x2e')];_0x59ecc4[_0x0dbf('0x5a')]=qs[_0x0dbf('0x39')](_0x3fc5de[_0x0dbf('0x30')][_0x0dbf('0x39')]);_0x59ecc4[_0x0dbf('0x3a')]=qs[_0x0dbf('0x32')](_[_0x0dbf('0x3b')](_0x3fc5de[_0x0dbf('0x30')],_0x466a80[_0x0dbf('0x32')]));if(_0x3fc5de[_0x0dbf('0x30')][_0x0dbf('0x3c')]){_0x59ecc4[_0x0dbf('0x3a')]=_['merge'](_0x59ecc4[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x59ecc4[_0x0dbf('0x34')],function(_0x507e14){var _0x205b61={};_0x205b61[_0x507e14]={'$like':'%'+_0x3fc5de[_0x0dbf('0x30')][_0x0dbf('0x3c')]+'%'};return _0x205b61;})});}_0x59ecc4=_[_0x0dbf('0x3d')]({},_0x59ecc4,_0x3fc5de['options']);return _0x4dd216[_0x0dbf('0x62')](_0x59ecc4);}})[_0x0dbf('0x24')](function(_0xd5e956){if(_0xd5e956){_0x14f445=_0xd5e956[_0x0dbf('0x36')];if(!_0x3fc5de['query'][_0x0dbf('0x37')](_0x0dbf('0x38'))){_0x59ecc4[_0x0dbf('0x1d')]=qs[_0x0dbf('0x1d')](_0x3fc5de[_0x0dbf('0x30')]['limit']);_0x59ecc4[_0x0dbf('0x1b')]=qs[_0x0dbf('0x1b')](_0x3fc5de[_0x0dbf('0x30')][_0x0dbf('0x1b')]);}return _0x4dd216['getLists'](_0x59ecc4);}})['then'](function(_0x1fd890){if(_0x1fd890){return _0x1fd890?{'count':_0x14f445,'rows':_0x1fd890}:null;}})[_0x0dbf('0x24')](respondWithResult(_0x1839a3,null))[_0x0dbf('0x48')](handleError(_0x1839a3,null));};exports[_0x0dbf('0x64')]=function(_0x5ae077,_0x58e539,_0x730ee1){var _0x55d79c,_0x55c87f;var _0x104730=[];var _0x5e319b=moment()[_0x0dbf('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0dbf('0x2b')]['find']({'where':{'id':_0x5ae077[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x58e539,null))[_0x0dbf('0x24')](function(_0x68b9bb){if(_0x68b9bb){_0x55c87f=_0x68b9bb;return _0x68b9bb[_0x0dbf('0x64')](_0x5ae077['body']['ids'],_[_0x0dbf('0x52')](_0x5ae077[_0x0dbf('0x55')],['ids','id'])||{});}return null;})[_0x0dbf('0x66')](function(_0x3a7662){var _0x295117;var _0x563f77;_0x55d79c=_0x3a7662||[];var _0x3f4556=[];if(_0x3a7662){for(var _0x39c406=0x0;_0x39c406<_0x3a7662['length'];_0x39c406+=0x1){var _0x725302=_0x3a7662[_0x39c406][_0x0dbf('0x4a')]({'plain':!![]});_0x55c87f['dialCheckDuplicateType']=_0x5ae077[_0x0dbf('0x55')][_0x0dbf('0x67')]?_0x5ae077['body']['dialCheckDuplicateType']:_0x55c87f[_0x0dbf('0x67')];switch(_0x55c87f[_0x0dbf('0x67')]){case _0x0dbf('0x68'):_0x295117=squel[_0x0dbf('0x69')]()[_0x0dbf('0x6a')](_0x0dbf('0x6b'))[_0x0dbf('0x6c')](['phone','scheduledAt',_0x0dbf('0x6d'),_0x0dbf('0x6e'),_0x0dbf('0x5b'),_0x0dbf('0x53'),_0x0dbf('0x54')],squel[_0x0dbf('0x6f')]()['field']('phone','phone')[_0x0dbf('0x70')](_0x0dbf('0x71'),_0x0dbf('0x72'))[_0x0dbf('0x70')]('id',_0x0dbf('0x6d'))[_0x0dbf('0x70')](_0x725302['CmListId'][_0x0dbf('0x73')](),'ListId')[_0x0dbf('0x70')](_0x5ae077[_0x0dbf('0x45')]['id']['toString'](),_0x0dbf('0x5b'))[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27','createdAt')[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27','updatedAt')[_0x0dbf('0x74')](_0x0dbf('0x75'))[_0x0dbf('0x3a')](_0x0dbf('0x76'))['where'](_0x0dbf('0x77'),_0x725302[_0x0dbf('0x78')][_0x0dbf('0x73')]())[_0x0dbf('0x3a')](_0x0dbf('0x79'))[_0x0dbf('0x3a')](_0x0dbf('0x7a'),squel[_0x0dbf('0x6f')]()[_0x0dbf('0x70')](_0x0dbf('0x7b'))['from'](_0x0dbf('0x7c'))['where'](_0x0dbf('0x7d'),_0x5ae077[_0x0dbf('0x45')]['id'][_0x0dbf('0x73')]()))[_0x0dbf('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x0dbf('0x7e'))[_0x0dbf('0x74')](_0x0dbf('0x6b'))[_0x0dbf('0x3a')](_0x0dbf('0x7d'),_0x5ae077[_0x0dbf('0x45')]['id'][_0x0dbf('0x73')]())))['toString']();break;case _0x0dbf('0x7f'):_0x295117=squel[_0x0dbf('0x69')]()[_0x0dbf('0x6a')](_0x0dbf('0x6b'))[_0x0dbf('0x6c')]([_0x0dbf('0x80'),_0x0dbf('0x72'),_0x0dbf('0x6d'),_0x0dbf('0x6e'),_0x0dbf('0x5b'),_0x0dbf('0x53'),'updatedAt'],squel[_0x0dbf('0x6f')]()[_0x0dbf('0x70')](_0x0dbf('0x80'),_0x0dbf('0x80'))[_0x0dbf('0x70')](_0x0dbf('0x71'),_0x0dbf('0x72'))['field']('id','ContactId')[_0x0dbf('0x70')](_0x725302[_0x0dbf('0x78')][_0x0dbf('0x73')](),_0x0dbf('0x6e'))[_0x0dbf('0x70')](_0x5ae077[_0x0dbf('0x45')]['id'][_0x0dbf('0x73')](),_0x0dbf('0x5b'))[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27',_0x0dbf('0x53'))['field']('\x27'+_0x5e319b+'\x27',_0x0dbf('0x54'))[_0x0dbf('0x74')](_0x0dbf('0x75'))[_0x0dbf('0x3a')](_0x0dbf('0x76'))['where']('ListId\x20=\x20?',_0x725302[_0x0dbf('0x78')][_0x0dbf('0x73')]())[_0x0dbf('0x3a')](_0x0dbf('0x79'))[_0x0dbf('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0dbf('0x70')](_0x0dbf('0x7e'))[_0x0dbf('0x74')]('cm_hopper')[_0x0dbf('0x3a')](_0x0dbf('0x7d'),_0x5ae077['params']['id'][_0x0dbf('0x73')]())))['toString']();break;default:_0x295117=squel[_0x0dbf('0x69')]()[_0x0dbf('0x6a')](_0x0dbf('0x6b'))[_0x0dbf('0x6c')]([_0x0dbf('0x80'),_0x0dbf('0x72'),_0x0dbf('0x6d'),_0x0dbf('0x6e'),_0x0dbf('0x5b'),_0x0dbf('0x53'),_0x0dbf('0x54')],squel[_0x0dbf('0x6f')]()['field'](_0x0dbf('0x80'),_0x0dbf('0x80'))[_0x0dbf('0x70')](_0x0dbf('0x71'),_0x0dbf('0x72'))[_0x0dbf('0x70')]('id',_0x0dbf('0x6d'))[_0x0dbf('0x70')](_0x725302[_0x0dbf('0x78')]['toString'](),_0x0dbf('0x6e'))[_0x0dbf('0x70')](_0x5ae077['params']['id'][_0x0dbf('0x73')](),_0x0dbf('0x5b'))[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27','createdAt')[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27',_0x0dbf('0x54'))['from'](_0x0dbf('0x75'))['where'](_0x0dbf('0x76'))[_0x0dbf('0x3a')]('ListId\x20=\x20?',_0x725302[_0x0dbf('0x78')][_0x0dbf('0x73')]())[_0x0dbf('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x0dbf('0x73')]();}_0x563f77=squel[_0x0dbf('0x69')]()[_0x0dbf('0x6a')](_0x0dbf('0x81'))[_0x0dbf('0x6c')]([_0x0dbf('0x82'),_0x0dbf('0x72'),_0x0dbf('0x80'),_0x0dbf('0x83'),_0x0dbf('0x53'),_0x0dbf('0x54')],squel[_0x0dbf('0x6f')]()['field']('h.id','id')[_0x0dbf('0x70')](_0x0dbf('0x71'),_0x0dbf('0x72'))[_0x0dbf('0x70')]('ci.item','phone')['field']('ci.OrderBY','OrderBy')[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27',_0x0dbf('0x53'))[_0x0dbf('0x70')]('\x27'+_0x5e319b+'\x27',_0x0dbf('0x54'))[_0x0dbf('0x74')](_0x0dbf('0x84'),'ci')[_0x0dbf('0x85')]('cm_hopper','h',_0x0dbf('0x86'))[_0x0dbf('0x3a')](_0x0dbf('0x87'),_0x725302[_0x0dbf('0x78')][_0x0dbf('0x73')]())[_0x0dbf('0x3a')](_0x0dbf('0x88'),_0x5ae077[_0x0dbf('0x45')]['id']['toString']())[_0x0dbf('0x3a')](_0x0dbf('0x89'),_0x5e319b))['toString']();_0x3f4556[_0x0dbf('0x8a')](db[_0x0dbf('0x8b')][_0x0dbf('0x30')](_0x295117));_0x104730[_0x0dbf('0x8a')](db['sequelize'][_0x0dbf('0x30')](_0x563f77));}return BPromise[_0x0dbf('0x8c')](_0x3f4556);}})[_0x0dbf('0x24')](function(){return BPromise[_0x0dbf('0x8c')](_0x104730);})['then'](function(){return _0x55d79c;})[_0x0dbf('0x24')](respondWithResult(_0x58e539,null))[_0x0dbf('0x48')](handleError(_0x58e539,null));};exports['removeLists']=function(_0x5a0091,_0x48f3a4,_0x4034ce){return db[_0x0dbf('0x2b')]['find']({'where':{'id':_0x5a0091[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x48f3a4,null))['then'](function(_0x3b8d6a){if(_0x3b8d6a){return _0x3b8d6a[_0x0dbf('0x8d')](_0x5a0091[_0x0dbf('0x30')][_0x0dbf('0x8e')]);}})[_0x0dbf('0x24')](function(_0x3bf646){if(_0x3bf646){return db['CmHopper'][_0x0dbf('0x25')]({'where':{'ListId':_0x5a0091['query']['ids'],'CampaignId':_0x5a0091[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](function(){return _0x3bf646;});}})[_0x0dbf('0x24')](respondWithStatusCode(_0x48f3a4,null))[_0x0dbf('0x48')](handleError(_0x48f3a4,null));};exports[_0x0dbf('0x8f')]=function(_0x16ba51,_0x293d9d,_0x27fd66){var _0x2b0a17={};var _0x1116dc={};var _0xcba0c3;var _0x54cf8c;return db[_0x0dbf('0x2b')][_0x0dbf('0x58')]({'where':{'id':_0x16ba51[_0x0dbf('0x45')]['id']}})['then'](handleEntityNotFound(_0x293d9d,null))[_0x0dbf('0x24')](function(_0x3aeb5c){if(_0x3aeb5c){_0xcba0c3=_0x3aeb5c;_0x1116dc[_0x0dbf('0x2e')]=_[_0x0dbf('0x31')](db[_0x0dbf('0x63')][_0x0dbf('0x46')]);_0x1116dc['query']=_[_0x0dbf('0x31')](_0x16ba51['query']);_0x1116dc[_0x0dbf('0x32')]=_['intersection'](_0x1116dc[_0x0dbf('0x2e')],_0x1116dc[_0x0dbf('0x30')]);_0x2b0a17[_0x0dbf('0x34')]=_['intersection'](_0x1116dc['model'],qs[_0x0dbf('0x35')](_0x16ba51[_0x0dbf('0x30')]['fields']));_0x2b0a17['attributes']=_0x2b0a17[_0x0dbf('0x34')][_0x0dbf('0x36')]?_0x2b0a17[_0x0dbf('0x34')]:_0x1116dc['model'];_0x2b0a17['order']=qs[_0x0dbf('0x39')](_0x16ba51[_0x0dbf('0x30')]['sort']);_0x2b0a17[_0x0dbf('0x3a')]=qs['filters'](_[_0x0dbf('0x3b')](_0x16ba51['query'],_0x1116dc[_0x0dbf('0x32')]));if(_0x16ba51[_0x0dbf('0x30')]['filter']){_0x2b0a17[_0x0dbf('0x3a')]=_[_0x0dbf('0x3d')](_0x2b0a17[_0x0dbf('0x3a')],{'$or':_[_0x0dbf('0x2f')](_0x2b0a17[_0x0dbf('0x34')],function(_0x436ed3){var _0x17a80c={};_0x17a80c[_0x436ed3]={'$like':'%'+_0x16ba51[_0x0dbf('0x30')][_0x0dbf('0x3c')]+'%'};return _0x17a80c;})});}_0x2b0a17=_[_0x0dbf('0x3d')]({},_0x2b0a17,_0x16ba51[_0x0dbf('0x3f')]);return _0xcba0c3[_0x0dbf('0x8f')](_0x2b0a17);}})['then'](function(_0x1c1b6b){if(_0x1c1b6b){_0x54cf8c=_0x1c1b6b[_0x0dbf('0x36')];if(!_0x16ba51[_0x0dbf('0x30')]['hasOwnProperty'](_0x0dbf('0x38'))){_0x2b0a17['limit']=qs[_0x0dbf('0x1d')](_0x16ba51[_0x0dbf('0x30')]['limit']);_0x2b0a17['offset']=qs[_0x0dbf('0x1b')](_0x16ba51['query'][_0x0dbf('0x1b')]);}return _0xcba0c3[_0x0dbf('0x8f')](_0x2b0a17);}})[_0x0dbf('0x24')](function(_0x2a83ac){if(_0x2a83ac){return _0x2a83ac?{'count':_0x54cf8c,'rows':_0x2a83ac}:null;}})[_0x0dbf('0x24')](respondWithResult(_0x293d9d,null))['catch'](handleError(_0x293d9d,null));};exports['addBlackLists']=function(_0x21129c,_0x285793,_0x3580de){var _0x212138,_0x19f1bd;var _0x328cfb=[];var _0x3aceed=moment()[_0x0dbf('0x65')](_0x0dbf('0x90'));return db[_0x0dbf('0x2b')]['find']({'where':{'id':_0x21129c[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](handleEntityNotFound(_0x285793,null))[_0x0dbf('0x24')](function(_0x399aa5){if(_0x399aa5){_0x19f1bd=_0x399aa5;return _0x399aa5[_0x0dbf('0x91')](_0x21129c[_0x0dbf('0x55')][_0x0dbf('0x8e')],_['omit'](_0x21129c[_0x0dbf('0x55')],[_0x0dbf('0x8e'),'id'])||{});}return null;})['spread'](function(_0x2d4801){var _0x18ff46;var _0x3e979b;_0x212138=_0x2d4801||[];var _0xd84f81=[];if(_0x2d4801){for(var _0x4af2db=0x0;_0x4af2db<_0x2d4801[_0x0dbf('0x36')];_0x4af2db+=0x1){var _0x53c4c5=_0x2d4801[_0x4af2db][_0x0dbf('0x4a')]({'plain':!![]});_0x18ff46=squel[_0x0dbf('0x69')]()['into'](_0x0dbf('0x92'))['fromQuery']([_0x0dbf('0x80'),_0x0dbf('0x6d'),_0x0dbf('0x6e'),'CampaignId',_0x0dbf('0x53'),_0x0dbf('0x54')],squel[_0x0dbf('0x6f')]()['field']('phone',_0x0dbf('0x80'))[_0x0dbf('0x70')]('id',_0x0dbf('0x6d'))[_0x0dbf('0x70')](_0x53c4c5[_0x0dbf('0x78')][_0x0dbf('0x73')](),_0x0dbf('0x6e'))[_0x0dbf('0x70')](_0x21129c[_0x0dbf('0x45')]['id'][_0x0dbf('0x73')](),'CampaignId')[_0x0dbf('0x70')](_0x0dbf('0x71'),_0x0dbf('0x53'))['field'](_0x0dbf('0x71'),_0x0dbf('0x54'))['from'](_0x0dbf('0x75'))['where'](_0x0dbf('0x76'))[_0x0dbf('0x3a')](_0x0dbf('0x77'),_0x53c4c5[_0x0dbf('0x78')][_0x0dbf('0x73')]())[_0x0dbf('0x3a')](_0x0dbf('0x79')))[_0x0dbf('0x73')]();_0xd84f81[_0x0dbf('0x8a')](db[_0x0dbf('0x8b')]['query'](_0x18ff46));}return BPromise['all'](_0xd84f81);}})['then'](function(){return _0x212138;})['then'](respondWithResult(_0x285793,null))[_0x0dbf('0x48')](handleError(_0x285793,null));};exports[_0x0dbf('0x93')]=function(_0x8e306b,_0x4e3b01,_0x44626d){return db['Campaign'][_0x0dbf('0x47')]({'where':{'id':_0x8e306b['params']['id']}})['then'](handleEntityNotFound(_0x4e3b01,null))[_0x0dbf('0x24')](function(_0x290ef9){if(_0x290ef9){return _0x290ef9[_0x0dbf('0x93')](_0x8e306b[_0x0dbf('0x30')][_0x0dbf('0x8e')]);}})[_0x0dbf('0x24')](function(_0x332899){if(_0x332899){return db[_0x0dbf('0x61')]['destroy']({'where':{'ListId':_0x8e306b[_0x0dbf('0x30')][_0x0dbf('0x8e')],'CampaignId':_0x8e306b[_0x0dbf('0x45')]['id']}})['then'](function(){return _0x332899;});}})['then'](respondWithStatusCode(_0x4e3b01,null))[_0x0dbf('0x48')](handleError(_0x4e3b01,null));}; \ No newline at end of file +var _0xbd9f=['h.id','ci.item','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','Campaign','rawAttributes','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','params','keys','fields','length','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','clone','createdAt','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findOne','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_contacts','cm_hopper_additional_phones'];(function(_0x32602f,_0x20be94){var _0x18f845=function(_0x14ab58){while(--_0x14ab58){_0x32602f['push'](_0x32602f['shift']());}};_0x18f845(++_0x20be94);}(_0xbd9f,0x98));var _0xfbd9=function(_0x3102af,_0x137b65){_0x3102af=_0x3102af-0x0;var _0x3c208c=_0xbd9f[_0x3102af];return _0x3c208c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbd9('0x0'));var rp=require('request-promise');var moment=require(_0xfbd9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xfbd9('0x2'));var util=require('util');var path=require(_0xfbd9('0x3'));var sox=require(_0xfbd9('0x4'));var csv=require(_0xfbd9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbd9('0x6'));var _=require('lodash');var squel=require(_0xfbd9('0x7'));var crypto=require(_0xfbd9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfbd9('0x9'));var toCsv=require(_0xfbd9('0x5'));var querystring=require(_0xfbd9('0xa'));var Papa=require('papaparse');var Redis=require(_0xfbd9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xfbd9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbd9('0xd'));var logger=require(_0xfbd9('0xe'))('api');var utils=require(_0xfbd9('0xf'));var config=require(_0xfbd9('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbd9('0x11'))['db'];function respondWithStatusCode(_0x301770,_0x1a4a0e){_0x1a4a0e=_0x1a4a0e||0xcc;return function(_0x527707){if(_0x527707){return _0x301770[_0xfbd9('0x12')](_0x1a4a0e);}return _0x301770['status'](_0x1a4a0e)['end']();};}function respondWithResult(_0x36113b,_0x35adb1){_0x35adb1=_0x35adb1||0xc8;return function(_0x159743){if(_0x159743){return _0x36113b[_0xfbd9('0x13')](_0x35adb1)['json'](_0x159743);}};}function respondWithFilteredResult(_0x2fef54,_0x9f8390){return function(_0x2b9553){if(_0x2b9553){var _0x58d553=typeof _0x9f8390[_0xfbd9('0x14')]===_0xfbd9('0x15')&&typeof _0x9f8390['limit']===_0xfbd9('0x15');var _0x516dcf=_0x2b9553[_0xfbd9('0x16')];var _0x13918f=_0x58d553?0x0:_0x9f8390['offset'];var _0x3ed394=_0x58d553?_0x2b9553[_0xfbd9('0x16')]:_0x9f8390[_0xfbd9('0x14')]+_0x9f8390[_0xfbd9('0x17')];var _0x35bf78;if(_0x3ed394>=_0x516dcf){_0x3ed394=_0x516dcf;_0x35bf78=0xc8;}else{_0x35bf78=0xce;}_0x2fef54[_0xfbd9('0x13')](_0x35bf78);return _0x2fef54[_0xfbd9('0x18')](_0xfbd9('0x19'),_0x13918f+'-'+_0x3ed394+'/'+_0x516dcf)[_0xfbd9('0x1a')](_0x2b9553);}return null;};}function patchUpdates(_0x1b1eea){return function(_0x2d2c6e){try{jsonpatch[_0xfbd9('0x1b')](_0x2d2c6e,_0x1b1eea,!![]);}catch(_0x2fc10b){return BPromise[_0xfbd9('0x1c')](_0x2fc10b);}return _0x2d2c6e[_0xfbd9('0x1d')]();};}function saveUpdates(_0x32f9bb,_0x12140b){return function(_0x4d3020){if(_0x4d3020){return _0x4d3020[_0xfbd9('0x1e')](_0x32f9bb)[_0xfbd9('0x1f')](function(_0x175373){return _0x175373;});}return null;};}function removeEntity(_0x299dd2,_0x237313){return function(_0x39da76){if(_0x39da76){return _0x39da76[_0xfbd9('0x20')]()[_0xfbd9('0x1f')](function(){var _0x3624f3=_0x39da76[_0xfbd9('0x21')]({'plain':!![]});var _0x1b0cc5='IvrCampaigns';return db[_0xfbd9('0x22')][_0xfbd9('0x20')]({'where':{'type':_0x1b0cc5,'resourceId':_0x3624f3['id']}})[_0xfbd9('0x1f')](function(){return _0x39da76;});})['then'](function(){_0x299dd2['status'](0xcc)[_0xfbd9('0x23')]();});}};}function handleEntityNotFound(_0x4d0104,_0x3c8cca){return function(_0x58de44){if(!_0x58de44){_0x4d0104['sendStatus'](0x194);}return _0x58de44;};}function handleError(_0x3a6a0,_0x5a00ff){_0x5a00ff=_0x5a00ff||0x1f4;return function(_0x303257){logger[_0xfbd9('0x24')](_0x303257[_0xfbd9('0x25')]);if(_0x303257[_0xfbd9('0x26')]){delete _0x303257[_0xfbd9('0x26')];}_0x3a6a0[_0xfbd9('0x13')](_0x5a00ff)[_0xfbd9('0x27')](_0x303257);};}exports['index']=function(_0x27dc31,_0x179b8e){var _0x2728c9={},_0x4515b5={},_0x43f09b={'count':0x0,'rows':[]};var _0x17936b=_[_0xfbd9('0x28')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')],function(_0x1f66d1){return{'name':_0x1f66d1['fieldName'],'type':_0x1f66d1['type'][_0xfbd9('0x2b')]};});_0x4515b5[_0xfbd9('0x2c')]=_[_0xfbd9('0x28')](_0x17936b,_0xfbd9('0x26'));_0x4515b5[_0xfbd9('0x2d')]=_['keys'](_0x27dc31[_0xfbd9('0x2d')]);_0x4515b5[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],_0x4515b5[_0xfbd9('0x2d')]);_0x2728c9[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],qs['fields'](_0x27dc31[_0xfbd9('0x2d')]['fields']));_0x2728c9[_0xfbd9('0x30')]=_0x2728c9['attributes']['length']?_0x2728c9[_0xfbd9('0x30')]:_0x4515b5[_0xfbd9('0x2c')];if(!_0x27dc31['query'][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x2728c9[_0xfbd9('0x17')]=qs['limit'](_0x27dc31[_0xfbd9('0x2d')]['limit']);_0x2728c9[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x27dc31['query'][_0xfbd9('0x14')]);}_0x2728c9[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x2728c9[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x27dc31['query'],_0x4515b5[_0xfbd9('0x2e')]),_0x17936b);if(_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x2728c9[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x2728c9['where'],{'$or':_[_0xfbd9('0x28')](_0x17936b,function(_0x5b7040){if(_0x5b7040[_0xfbd9('0x39')]!=='VIRTUAL'){var _0x1b88c5={};_0x1b88c5[_0x5b7040[_0xfbd9('0x26')]]={'$like':'%'+_0x27dc31[_0xfbd9('0x2d')]['filter']+'%'};return _0x1b88c5;}})});}_0x2728c9=_[_0xfbd9('0x38')]({},_0x2728c9,_0x27dc31[_0xfbd9('0x3a')]);var _0x16bfdf={'where':_0x2728c9[_0xfbd9('0x35')]};return db[_0xfbd9('0x29')][_0xfbd9('0x16')](_0x16bfdf)[_0xfbd9('0x1f')](function(_0x55f3dc){_0x43f09b[_0xfbd9('0x16')]=_0x55f3dc;if(_0x27dc31[_0xfbd9('0x2d')]['includeAll']){_0x2728c9[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x29')][_0xfbd9('0x3c')](_0x2728c9);})[_0xfbd9('0x1f')](function(_0x2eaa5d){_0x43f09b['rows']=_0x2eaa5d;return _0x43f09b;})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x179b8e,_0x2728c9))['catch'](handleError(_0x179b8e,null));};exports['show']=function(_0x443cdc,_0x5d8a94){var _0xa19c47={'raw':![],'where':{'id':_0x443cdc[_0xfbd9('0x3d')]['id']}},_0x1aa6d3={};_0x1aa6d3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x1aa6d3['query']=_[_0xfbd9('0x3e')](_0x443cdc[_0xfbd9('0x2d')]);_0x1aa6d3['filters']=_[_0xfbd9('0x2f')](_0x1aa6d3[_0xfbd9('0x2c')],_0x1aa6d3[_0xfbd9('0x2d')]);_0xa19c47[_0xfbd9('0x30')]=_['intersection'](_0x1aa6d3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x443cdc[_0xfbd9('0x2d')]['fields']));_0xa19c47['attributes']=_0xa19c47[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0xa19c47[_0xfbd9('0x30')]:_0x1aa6d3[_0xfbd9('0x2c')];if(_0x443cdc[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0xa19c47[_0xfbd9('0x3b')]=[{'all':!![]}];}_0xa19c47=_[_0xfbd9('0x38')]({},_0xa19c47,_0x443cdc[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')]['find'](_0xa19c47)[_0xfbd9('0x1f')](handleEntityNotFound(_0x5d8a94,null))[_0xfbd9('0x1f')](respondWithResult(_0x5d8a94,null))[_0xfbd9('0x42')](handleError(_0x5d8a94,null));};exports[_0xfbd9('0x43')]=function(_0x4add02,_0x5d2576){return db['Campaign'][_0xfbd9('0x43')](_0x4add02[_0xfbd9('0x44')],{})[_0xfbd9('0x1f')](function(_0x11365a){var _0x484523=_0x4add02['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x484523)throw new Error(_0xfbd9('0x45'));if(_0x484523[_0xfbd9('0x46')]==='user'){var _0x3e3d94=_0x11365a[_0xfbd9('0x21')]({'plain':!![]});var _0x5ccd07=_0xfbd9('0x47');return db[_0xfbd9('0x48')][_0xfbd9('0x49')]({'where':{'name':_0x5ccd07,'userProfileId':_0x484523[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x5dbaa6){if(_0x5dbaa6&&_0x5dbaa6[_0xfbd9('0x4b')]===0x0){return db[_0xfbd9('0x22')][_0xfbd9('0x43')]({'name':_0x3e3d94[_0xfbd9('0x26')],'resourceId':_0x3e3d94['id'],'type':_0x5dbaa6[_0xfbd9('0x26')],'sectionId':_0x5dbaa6['id']},{})['then'](function(){return _0x11365a;});}else{return _0x11365a;}})[_0xfbd9('0x42')](function(_0x310b73){logger[_0xfbd9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x310b73);throw _0x310b73;});}return _0x11365a;})['then'](respondWithResult(_0x5d2576,0xc9))[_0xfbd9('0x42')](handleError(_0x5d2576,null));};exports[_0xfbd9('0x4c')]=function(_0xe4d9f,_0x84cddb){var _0x18ac89={'where':{'id':_0xe4d9f[_0xfbd9('0x3d')]['id']}},_0x3406c8={};_0x3406c8[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x18ac89[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3406c8['model'],qs['fields'](_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x18ac89['attributes']=_0x18ac89[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x18ac89[_0xfbd9('0x30')]:_0x3406c8['model'];if(_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x18ac89[_0xfbd9('0x3b')]=[{'all':!![]}];}_0x18ac89=_['merge']({},_0x18ac89,_0xe4d9f[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')][_0xfbd9('0x49')](_0x18ac89)[_0xfbd9('0x1f')](handleEntityNotFound(_0x84cddb,null))[_0xfbd9('0x1f')](function(_0x5b7187){if(_0x5b7187){var _0x2e53f8=_0x5b7187['get']({'plain':!![]});_0x2e53f8=qs['omit'](_0x2e53f8,['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);_0xe4d9f['body']=_[_0xfbd9('0x4f')](_0xe4d9f['body'],['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);return db[_0xfbd9('0x29')][_0xfbd9('0x43')](_[_0xfbd9('0x38')](_0x2e53f8,_0xe4d9f[_0xfbd9('0x44')]),{'include':_0xe4d9f['query'][_0xfbd9('0x41')]?[{'all':!![]}]:undefined})[_0xfbd9('0x1f')](function(_0x683623){var _0x42bc46=_0xe4d9f['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x42bc46)throw new Error(_0xfbd9('0x45'));if(_0x42bc46['role']==='user'){var _0x5c287b=_0x683623[_0xfbd9('0x21')]({'plain':!![]});var _0x41416a=_0xfbd9('0x47');return db['UserProfileSection'][_0xfbd9('0x49')]({'where':{'name':_0x41416a,'userProfileId':_0x42bc46[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x366b9a){if(_0x366b9a&&_0x366b9a[_0xfbd9('0x4b')]===0x0){return db['UserProfileResource'][_0xfbd9('0x43')]({'name':_0x5c287b[_0xfbd9('0x26')],'resourceId':_0x5c287b['id'],'type':_0x366b9a[_0xfbd9('0x26')],'sectionId':_0x366b9a['id']},{})[_0xfbd9('0x1f')](function(){return _0x683623;});}else{return _0x683623;}})[_0xfbd9('0x42')](function(_0x50651b){logger[_0xfbd9('0x24')](_0xfbd9('0x50'),_0x50651b);throw _0x50651b;});}return _0x683623;});}})[_0xfbd9('0x1f')](respondWithResult(_0x84cddb,0xc9))['catch'](handleError(_0x84cddb,null));};exports[_0xfbd9('0x1e')]=function(_0x5b5284,_0xb25879){if(_0x5b5284[_0xfbd9('0x44')]['id']){delete _0x5b5284[_0xfbd9('0x44')]['id'];}return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x5b5284['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0xb25879,null))[_0xfbd9('0x1f')](saveUpdates(_0x5b5284['body'],null))['then'](respondWithResult(_0xb25879,null))[_0xfbd9('0x42')](handleError(_0xb25879,null));};exports['destroy']=function(_0x6f3c37,_0x260949){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x6f3c37[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x260949,null))['then'](removeEntity(_0x260949,null))['catch'](handleError(_0x260949,null));};exports[_0xfbd9('0x51')]=function(_0x3d1698,_0x2de072,_0x935dc4){var _0x2fb24a={'raw':!![],'where':{}};var _0x3b59c0={};var _0x243b1d={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x3d1698['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x2de072,null))[_0xfbd9('0x1f')](function(_0x7d7cc4){if(_0x7d7cc4){_0x3b59c0['model']=_['keys'](db[_0xfbd9('0x52')]['rawAttributes']);_0x3b59c0['query']=_[_0xfbd9('0x3e')](_0x3d1698[_0xfbd9('0x2d')]);_0x3b59c0['filters']=_[_0xfbd9('0x2f')](_0x3b59c0[_0xfbd9('0x2c')],_0x3b59c0[_0xfbd9('0x2d')]);_0x2fb24a[_0xfbd9('0x30')]=_['intersection'](_0x3b59c0[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x3d1698[_0xfbd9('0x2d')]['fields']));_0x2fb24a[_0xfbd9('0x30')]=_0x2fb24a['attributes'][_0xfbd9('0x40')]?_0x2fb24a[_0xfbd9('0x30')]:_0x3b59c0[_0xfbd9('0x2c')];if(!_0x3d1698[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x2fb24a[_0xfbd9('0x17')]=qs['limit'](_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x2fb24a[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3d1698[_0xfbd9('0x2d')]['offset']);}_0x2fb24a[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x3d1698[_0xfbd9('0x2d')]['sort']);_0x2fb24a['where']=qs['filters'](_['pick'](_0x3d1698[_0xfbd9('0x2d')],_0x3b59c0[_0xfbd9('0x2e')]));_0x2fb24a['where'][_0xfbd9('0x53')]=_0x7d7cc4['id'];if(_0x3d1698[_0xfbd9('0x2d')]['filter']){_0x2fb24a['where']=_[_0xfbd9('0x38')](_0x2fb24a[_0xfbd9('0x35')],{'$or':_['map'](_0x2fb24a[_0xfbd9('0x30')],function(_0x3c97b3){var _0x555d8e={};_0x555d8e[_0x3c97b3]={'$like':'%'+_0x3d1698[_0xfbd9('0x2d')]['filter']+'%'};return _0x555d8e;})});}_0x2fb24a=_['merge']({},_0x2fb24a,_0x3d1698[_0xfbd9('0x3a')]);return db[_0xfbd9('0x52')][_0xfbd9('0x16')]({'where':_0x2fb24a[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x411a37){_0x243b1d['count']=_0x411a37;if(_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x2fb24a[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x52')]['findAll'](_0x2fb24a);})['then'](function(_0x20292a){_0x243b1d[_0xfbd9('0x54')]=_0x20292a;return _0x243b1d;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x2de072,_0x2fb24a))[_0xfbd9('0x42')](handleError(_0x2de072,null));};exports[_0xfbd9('0x55')]=function(_0x527e7b,_0x31e50e,_0xb6f4ee){var _0x1ba4fc={'raw':!![],'where':{}};var _0x26311b={};var _0x4a5a05={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x527e7b['params']['id']}})['then'](handleEntityNotFound(_0x31e50e,null))[_0xfbd9('0x1f')](function(_0x2cd315){if(_0x2cd315){_0x26311b[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x56')][_0xfbd9('0x2a')]);_0x26311b[_0xfbd9('0x2d')]=_[_0xfbd9('0x3e')](_0x527e7b[_0xfbd9('0x2d')]);_0x26311b[_0xfbd9('0x2e')]=_['intersection'](_0x26311b['model'],_0x26311b['query']);_0x1ba4fc[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26311b[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x1ba4fc['attributes']=_0x1ba4fc[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x1ba4fc[_0xfbd9('0x30')]:_0x26311b[_0xfbd9('0x2c')];if(!_0x527e7b[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x1ba4fc[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x1ba4fc[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x527e7b['query'][_0xfbd9('0x14')]);}_0x1ba4fc['order']=qs[_0xfbd9('0x34')](_0x527e7b[_0xfbd9('0x2d')]['sort']);_0x1ba4fc['where']=qs[_0xfbd9('0x2e')](_['pick'](_0x527e7b[_0xfbd9('0x2d')],_0x26311b[_0xfbd9('0x2e')]));_0x1ba4fc[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x2cd315['id'];if(_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x1ba4fc['where']=_[_0xfbd9('0x38')](_0x1ba4fc[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x1ba4fc[_0xfbd9('0x30')],function(_0x596e34){var _0x8049d8={};_0x8049d8[_0x596e34]={'$like':'%'+_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x8049d8;})});}_0x1ba4fc=_[_0xfbd9('0x38')]({},_0x1ba4fc,_0x527e7b[_0xfbd9('0x3a')]);return db['CmHopperHistory'][_0xfbd9('0x16')]({'where':_0x1ba4fc['where']})[_0xfbd9('0x1f')](function(_0x4cf720){_0x4a5a05['count']=_0x4cf720;if(_0x527e7b[_0xfbd9('0x2d')]['includeAll']){_0x1ba4fc[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x56')][_0xfbd9('0x3c')](_0x1ba4fc);})['then'](function(_0x821f1e){_0x4a5a05['rows']=_0x821f1e;return _0x4a5a05;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x31e50e,_0x1ba4fc))[_0xfbd9('0x42')](handleError(_0x31e50e,null));};exports[_0xfbd9('0x57')]=function(_0x304d68,_0x27dd2e,_0x51f33a){var _0x4ddfc6={'raw':!![],'where':{}};var _0x26deb3={};var _0x2bb227={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x304d68[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x27dd2e,null))['then'](function(_0x5a0f34){if(_0x5a0f34){_0x26deb3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db['CmHopperFinal'][_0xfbd9('0x2a')]);_0x26deb3['query']=_[_0xfbd9('0x3e')](_0x304d68[_0xfbd9('0x2d')]);_0x26deb3[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x26deb3['model'],_0x26deb3[_0xfbd9('0x2d')]);_0x4ddfc6[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26deb3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x304d68['query'][_0xfbd9('0x3f')]));_0x4ddfc6[_0xfbd9('0x30')]=_0x4ddfc6[_0xfbd9('0x30')]['length']?_0x4ddfc6['attributes']:_0x26deb3[_0xfbd9('0x2c')];if(!_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x4ddfc6[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x304d68[_0xfbd9('0x2d')]['limit']);_0x4ddfc6[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x4ddfc6[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x4ddfc6[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x304d68[_0xfbd9('0x2d')],_0x26deb3['filters']));_0x4ddfc6['where'][_0xfbd9('0x53')]=_0x5a0f34['id'];if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x4ddfc6[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x4ddfc6['where'],{'$or':_[_0xfbd9('0x28')](_0x4ddfc6[_0xfbd9('0x30')],function(_0x66b429){var _0x4f5ac1={};_0x4f5ac1[_0x66b429]={'$like':'%'+_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x4f5ac1;})});}_0x4ddfc6=_[_0xfbd9('0x38')]({},_0x4ddfc6,_0x304d68[_0xfbd9('0x3a')]);return db[_0xfbd9('0x58')]['count']({'where':_0x4ddfc6['where']})['then'](function(_0x4648b2){_0x2bb227[_0xfbd9('0x16')]=_0x4648b2;if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x4ddfc6['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xfbd9('0x3c')](_0x4ddfc6);})[_0xfbd9('0x1f')](function(_0x27bc94){_0x2bb227['rows']=_0x27bc94;return _0x2bb227;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x27dd2e,_0x4ddfc6))['catch'](handleError(_0x27dd2e,null));};exports['getHopperBlacks']=function(_0x1de195,_0x4c70de,_0x1a3fc5){var _0x304594={'raw':!![],'where':{}};var _0x3582c1={};var _0x239267={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x1de195[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c70de,null))[_0xfbd9('0x1f')](function(_0x5aada3){if(_0x5aada3){_0x3582c1[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x5a')][_0xfbd9('0x2a')]);_0x3582c1['query']=_[_0xfbd9('0x3e')](_0x1de195['query']);_0x3582c1[_0xfbd9('0x2e')]=_['intersection'](_0x3582c1['model'],_0x3582c1['query']);_0x304594[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3582c1[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x1de195['query'][_0xfbd9('0x3f')]));_0x304594['attributes']=_0x304594[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x304594['attributes']:_0x3582c1[_0xfbd9('0x2c')];if(!_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x304594[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x304594[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x304594[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x1de195['query']['sort']);_0x304594[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x1de195[_0xfbd9('0x2d')],_0x3582c1[_0xfbd9('0x2e')]));_0x304594[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x5aada3['id'];if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x304594['where']=_[_0xfbd9('0x38')](_0x304594[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x304594[_0xfbd9('0x30')],function(_0x16ea14){var _0x358cd6={};_0x358cd6[_0x16ea14]={'$like':'%'+_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x358cd6;})});}_0x304594=_['merge']({},_0x304594,_0x1de195[_0xfbd9('0x3a')]);return db[_0xfbd9('0x5a')][_0xfbd9('0x16')]({'where':_0x304594[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x5db30a){_0x239267['count']=_0x5db30a;if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x304594[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x5a')][_0xfbd9('0x3c')](_0x304594);})[_0xfbd9('0x1f')](function(_0x246599){_0x239267[_0xfbd9('0x54')]=_0x246599;return _0x239267;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x4c70de,_0x304594))[_0xfbd9('0x42')](handleError(_0x4c70de,null));};exports['getLists']=function(_0x3b07aa,_0x50fa49,_0x19b565){var _0x5cf769={};var _0x1c6093={};var _0x5a3d9d;var _0x228b74;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x3b07aa[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x50fa49,null))['then'](function(_0x2090bc){if(_0x2090bc){_0x5a3d9d=_0x2090bc;_0x1c6093[_0xfbd9('0x2c')]=_['keys'](db['CmList'][_0xfbd9('0x2a')]);_0x1c6093[_0xfbd9('0x2d')]=_['keys'](_0x3b07aa[_0xfbd9('0x2d')]);_0x1c6093[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x1c6093[_0xfbd9('0x2c')],_0x1c6093['query']);_0x5cf769[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x1c6093['model'],qs[_0xfbd9('0x3f')](_0x3b07aa['query'][_0xfbd9('0x3f')]));_0x5cf769[_0xfbd9('0x30')]=_0x5cf769[_0xfbd9('0x30')]['length']?_0x5cf769['attributes']:_0x1c6093[_0xfbd9('0x2c')];_0x5cf769[_0xfbd9('0x33')]=qs['sort'](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x5cf769[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x3b07aa['query'],_0x1c6093[_0xfbd9('0x2e')]));if(_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x5cf769[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x5cf769[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x5cf769['attributes'],function(_0x1330ca){var _0x23467e={};_0x23467e[_0x1330ca]={'$like':'%'+_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23467e;})});}_0x5cf769=_[_0xfbd9('0x38')]({},_0x5cf769,_0x3b07aa[_0xfbd9('0x3a')]);return _0x5a3d9d[_0xfbd9('0x5b')](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0x3cee54){if(_0x3cee54){_0x228b74=_0x3cee54['length'];if(!_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x5cf769[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x5cf769[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3b07aa['query']['offset']);}return _0x5a3d9d['getLists'](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0xdb663){if(_0xdb663){return _0xdb663?{'count':_0x228b74,'rows':_0xdb663}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x50fa49,null))[_0xfbd9('0x42')](handleError(_0x50fa49,null));};exports[_0xfbd9('0x5c')]=function(_0xed8d73,_0x4226dd,_0x209d04){var _0x359bb8,_0x555179;var _0x16c43=[];var _0x4d2d4a=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0xed8d73[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x4226dd,null))[_0xfbd9('0x1f')](function(_0x6dd950){if(_0x6dd950){_0x555179=_0x6dd950;return _0x6dd950[_0xfbd9('0x5c')](_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x5f')],_[_0xfbd9('0x4f')](_0xed8d73[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})['spread'](function(_0x4186f2){var _0x45b4f6;var _0x57f0c9;_0x359bb8=_0x4186f2||[];var _0x538e9d=[];if(_0x4186f2){for(var _0x26b11a=0x0;_0x26b11a<_0x4186f2[_0xfbd9('0x40')];_0x26b11a+=0x1){var _0x3d3271=_0x4186f2[_0x26b11a][_0xfbd9('0x21')]({'plain':!![]});_0x555179[_0xfbd9('0x60')]=_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x60')]?_0xed8d73[_0xfbd9('0x44')]['dialCheckDuplicateType']:_0x555179['dialCheckDuplicateType'];switch(_0x555179[_0xfbd9('0x60')]){case _0xfbd9('0x61'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),'ContactId',_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),'CampaignId')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27','createdAt')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0xfbd9('0x70'),_0x3d3271['CmListId'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))['where'](_0xfbd9('0x72'),squel['select']()[_0xfbd9('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xfbd9('0x6f')](_0xfbd9('0x73'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]()))[_0xfbd9('0x35')](_0xfbd9('0x72'),squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))['where'](_0xfbd9('0x74'),_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())))[_0xfbd9('0x6e')]();break;case _0xfbd9('0x76'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()['field'](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))['field'](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))['field']('\x27'+_0x4d2d4a+'\x27','updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))[_0xfbd9('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]())))['toString']();break;default:_0x45b4f6=squel[_0xfbd9('0x62')]()['into'](_0xfbd9('0x64'))[_0xfbd9('0x65')]([_0xfbd9('0x6a'),_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')](_0xfbd9('0x6b'),'scheduledAt')['field']('id','ContactId')['field'](_0x3d3271[_0xfbd9('0x6d')]['toString'](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))['from'](_0xfbd9('0x78'))[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71')))['toString']();}_0x57f0c9=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x79'))[_0xfbd9('0x65')](['cmHopperId',_0xfbd9('0x66'),_0xfbd9('0x6a'),'OrderBy',_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x7a'),'id')[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))['field'](_0xfbd9('0x7b'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x7c'),_0xfbd9('0x7d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contact_has_items','ci')[_0xfbd9('0x7e')](_0xfbd9('0x64'),'h',_0xfbd9('0x7f'))[_0xfbd9('0x35')]('h.ListId\x20=\x20?',_0x3d3271['CmListId'][_0xfbd9('0x6e')]())['where']('h.CampaignId=?',_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')]('h.createdAt\x20=\x20?',_0x4d2d4a))['toString']();_0x538e9d['push'](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x45b4f6));_0x16c43[_0xfbd9('0x81')](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x57f0c9));}return BPromise[_0xfbd9('0x82')](_0x538e9d);}})[_0xfbd9('0x1f')](function(){return BPromise['all'](_0x16c43);})['then'](function(){return _0x359bb8;})[_0xfbd9('0x1f')](respondWithResult(_0x4226dd,null))[_0xfbd9('0x42')](handleError(_0x4226dd,null));};exports[_0xfbd9('0x83')]=function(_0x2711e5,_0x166238,_0x59e460){return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x166238,null))[_0xfbd9('0x1f')](function(_0x3e4416){if(_0x3e4416){return _0x3e4416[_0xfbd9('0x83')](_0x2711e5[_0xfbd9('0x2d')]['ids']);}})[_0xfbd9('0x1f')](function(_0xcb6afc){if(_0xcb6afc){return db['CmHopper'][_0xfbd9('0x20')]({'where':{'ListId':_0x2711e5[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](function(){return _0xcb6afc;});}})['then'](respondWithStatusCode(_0x166238,null))['catch'](handleError(_0x166238,null));};exports[_0xfbd9('0x84')]=function(_0xb24a8a,_0x53c930,_0x186429){var _0x411f9e={};var _0x16a131={};var _0x5c444e;var _0x1f97bb;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0xb24a8a[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x53c930,null))[_0xfbd9('0x1f')](function(_0xc4d6ec){if(_0xc4d6ec){_0x5c444e=_0xc4d6ec;_0x16a131['model']=_[_0xfbd9('0x3e')](db['CmList'][_0xfbd9('0x2a')]);_0x16a131['query']=_['keys'](_0xb24a8a[_0xfbd9('0x2d')]);_0x16a131[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x16a131[_0xfbd9('0x2c')],_0x16a131[_0xfbd9('0x2d')]);_0x411f9e['attributes']=_['intersection'](_0x16a131[_0xfbd9('0x2c')],qs['fields'](_0xb24a8a[_0xfbd9('0x2d')]['fields']));_0x411f9e[_0xfbd9('0x30')]=_0x411f9e[_0xfbd9('0x30')]['length']?_0x411f9e['attributes']:_0x16a131['model'];_0x411f9e[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x411f9e[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0xb24a8a['query'],_0x16a131[_0xfbd9('0x2e')]));if(_0xb24a8a['query'][_0xfbd9('0x37')]){_0x411f9e[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x411f9e[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x411f9e[_0xfbd9('0x30')],function(_0x6e7c5f){var _0x23f9a5={};_0x23f9a5[_0x6e7c5f]={'$like':'%'+_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23f9a5;})});}_0x411f9e=_[_0xfbd9('0x38')]({},_0x411f9e,_0xb24a8a['options']);return _0x5c444e['getBlackLists'](_0x411f9e);}})['then'](function(_0x5004a4){if(_0x5004a4){_0x1f97bb=_0x5004a4[_0xfbd9('0x40')];if(!_0xb24a8a['query']['hasOwnProperty'](_0xfbd9('0x32'))){_0x411f9e['limit']=qs[_0xfbd9('0x17')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x411f9e[_0xfbd9('0x14')]=qs['offset'](_0xb24a8a['query'][_0xfbd9('0x14')]);}return _0x5c444e[_0xfbd9('0x84')](_0x411f9e);}})[_0xfbd9('0x1f')](function(_0x1b595b){if(_0x1b595b){return _0x1b595b?{'count':_0x1f97bb,'rows':_0x1b595b}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x53c930,null))[_0xfbd9('0x42')](handleError(_0x53c930,null));};exports[_0xfbd9('0x85')]=function(_0x2e8e68,_0x578b32,_0x4e9cc0){var _0x53326c,_0xc9b979;var _0x390b08=[];var _0x38cfeb=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2e8e68[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x578b32,null))[_0xfbd9('0x1f')](function(_0x3b826d){if(_0x3b826d){_0xc9b979=_0x3b826d;return _0x3b826d[_0xfbd9('0x85')](_0x2e8e68[_0xfbd9('0x44')]['ids'],_[_0xfbd9('0x4f')](_0x2e8e68[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})[_0xfbd9('0x86')](function(_0x38445a){var _0x4555dd;var _0x3aae2a;_0x53326c=_0x38445a||[];var _0x5160f3=[];if(_0x38445a){for(var _0x5acda9=0x0;_0x5acda9<_0x38445a[_0xfbd9('0x40')];_0x5acda9+=0x1){var _0x461471=_0x38445a[_0x5acda9][_0xfbd9('0x21')]({'plain':!![]});_0x4555dd=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x87'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x461471['CmListId'][_0xfbd9('0x6e')](),'ListId')[_0xfbd9('0x69')](_0x2e8e68['params']['id']['toString'](),_0xfbd9('0x53'))['field'](_0xfbd9('0x6b'),_0xfbd9('0x4d'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),'updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')](_0xfbd9('0x70'),_0x461471[_0xfbd9('0x6d')]['toString']())[_0xfbd9('0x35')](_0xfbd9('0x71')))[_0xfbd9('0x6e')]();_0x5160f3[_0xfbd9('0x81')](db['sequelize'][_0xfbd9('0x2d')](_0x4555dd));}return BPromise[_0xfbd9('0x82')](_0x5160f3);}})['then'](function(){return _0x53326c;})[_0xfbd9('0x1f')](respondWithResult(_0x578b32,null))[_0xfbd9('0x42')](handleError(_0x578b32,null));};exports['removeBlackLists']=function(_0x40dd26,_0x192241,_0x2a419b){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x40dd26[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x192241,null))[_0xfbd9('0x1f')](function(_0x19ffd5){if(_0x19ffd5){return _0x19ffd5[_0xfbd9('0x88')](_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')]);}})[_0xfbd9('0x1f')](function(_0x5aa56e){if(_0x5aa56e){return db['CmHopperBlack'][_0xfbd9('0x20')]({'where':{'ListId':_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x40dd26[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](function(){return _0x5aa56e;});}})[_0xfbd9('0x1f')](respondWithStatusCode(_0x192241,null))[_0xfbd9('0x42')](handleError(_0x192241,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f7f2c56..d7e2da4 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5b82e9,_0x382fe1){var _0x204239=function(_0x477bd3){while(--_0x477bd3){_0x5b82e9['push'](_0x5b82e9['shift']());}};_0x204239(++_0x382fe1);}(_0x7a54,0x106));var _0x47a5=function(_0xd30af1,_0x39c836){_0xd30af1=_0xd30af1-0x0;var _0x22df5f=_0x7a54[_0xd30af1];return _0x22df5f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3b6778,_0x57ddd4){var _0x4061de=function(_0x3c5060){while(--_0x3c5060){_0x3b6778['push'](_0x3b6778['shift']());}};_0x4061de(++_0x57ddd4);}(_0x7a54,0x106));var _0x47a5=function(_0x39800f,_0x14ab33){_0x39800f=_0x39800f-0x0;var _0x23b0b6=_0x7a54[_0x39800f];return _0x23b0b6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 964b8b0..1f5e9e3 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 _0x3098=['info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3098,0x86));var _0x8309=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x3098[_0x49e584];return _0x58b1be;};'use strict';var _=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var moment=require(_0x8309('0x2'));var BPromise=require(_0x8309('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8309('0x4'));var db=require(_0x8309('0x5'))['db'];var utils=require(_0x8309('0x6'));var logger=require(_0x8309('0x7'))(_0x8309('0x8'));var config=require(_0x8309('0x9'));var jayson=require(_0x8309('0xa'));var client=jayson[_0x8309('0xb')][_0x8309('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e9ac6,_0x5142f1,_0x35ca92){return new BPromise(function(_0x5c2cd1,_0x421fa5){return client[_0x8309('0xd')](_0x1e9ac6,_0x35ca92)['then'](function(_0x554405){logger[_0x8309('0xe')](_0x8309('0xf'),_0x5142f1,_0x8309('0x10'));logger[_0x8309('0x11')](_0x8309('0x12'),_0x5142f1,'request\x20sent',JSON[_0x8309('0x13')](_0x554405));if(_0x554405[_0x8309('0x14')]){if(_0x554405[_0x8309('0x14')][_0x8309('0x15')]===0x1f4){logger[_0x8309('0x14')]('Campaign,\x20%s,\x20%s',_0x5142f1,_0x554405[_0x8309('0x14')]['message']);return _0x421fa5(_0x554405[_0x8309('0x14')]['message']);}logger[_0x8309('0x14')](_0x8309('0xf'),_0x5142f1,_0x554405[_0x8309('0x14')][_0x8309('0x16')]);return _0x5c2cd1(_0x554405[_0x8309('0x14')][_0x8309('0x16')]);}else{logger[_0x8309('0xe')]('Campaign,\x20%s,\x20%s',_0x5142f1,'request\x20sent');_0x5c2cd1(_0x554405[_0x8309('0x17')][_0x8309('0x16')]);}})[_0x8309('0x18')](function(_0x33742f){logger[_0x8309('0x14')](_0x8309('0xf'),_0x5142f1,_0x33742f);_0x421fa5(_0x33742f);});});}exports[_0x8309('0x19')]=function(_0x97f042){var _0x59d391=this;return new Promise(function(_0x353f64,_0x475030){return db[_0x8309('0x1a')][_0x8309('0x1b')]({'raw':_0x97f042[_0x8309('0x1c')]?_0x97f042[_0x8309('0x1c')][_0x8309('0x1d')]===undefined?!![]:![]:!![],'where':_0x97f042[_0x8309('0x1c')]?_0x97f042[_0x8309('0x1c')][_0x8309('0x1e')]||null:null,'attributes':_0x97f042[_0x8309('0x1c')]?_0x97f042[_0x8309('0x1c')]['attributes']||null:null,'limit':_0x97f042['options']?_0x97f042[_0x8309('0x1c')][_0x8309('0x1f')]||null:null,'include':_0x97f042[_0x8309('0x1c')]?_0x97f042[_0x8309('0x1c')][_0x8309('0x20')]?_[_0x8309('0x21')](_0x97f042['options'][_0x8309('0x20')],function(_0x350f51){return{'model':db[_0x350f51[_0x8309('0x22')]],'as':_0x350f51['as'],'attributes':_0x350f51['attributes'],'include':_0x350f51[_0x8309('0x20')]?_[_0x8309('0x21')](_0x350f51['include'],function(_0x166902){return{'model':db[_0x166902['model']],'as':_0x166902['as'],'attributes':_0x166902[_0x8309('0x23')],'include':_0x166902['include']?_[_0x8309('0x21')](_0x166902[_0x8309('0x20')],function(_0x3f8722){return{'model':db[_0x3f8722[_0x8309('0x22')]],'as':_0x3f8722['as'],'attributes':_0x3f8722['attributes']};}):[]};}):[]};}):[]:[]})[_0x8309('0x24')](function(_0x26a378){logger[_0x8309('0xe')]('GetCampaign',_0x97f042);logger[_0x8309('0x11')]('GetCampaign',_0x97f042,JSON[_0x8309('0x13')](_0x26a378));_0x353f64(_0x26a378);})[_0x8309('0x18')](function(_0x342325){logger[_0x8309('0x14')](_0x8309('0x19'),_0x342325[_0x8309('0x16')],_0x97f042);_0x475030(_0x59d391[_0x8309('0x14')](0x1f4,_0x342325[_0x8309('0x16')]));});});}; \ No newline at end of file +var _0x3379=['attributes','map','include','model','GetCampaign','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Campaign','findAll','options','raw','where'];(function(_0x58cc03,_0x35315d){var _0x27deda=function(_0x28e198){while(--_0x28e198){_0x58cc03['push'](_0x58cc03['shift']());}};_0x27deda(++_0x35315d);}(_0x3379,0x115));var _0x9337=function(_0x3191be,_0x47b026){_0x3191be=_0x3191be-0x0;var _0x3b3e79=_0x3379[_0x3191be];return _0x3b3e79;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var moment=require(_0x9337('0x2'));var BPromise=require(_0x9337('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x4'));var db=require(_0x9337('0x5'))['db'];var utils=require(_0x9337('0x6'));var logger=require(_0x9337('0x7'))('rpc');var config=require(_0x9337('0x8'));var jayson=require(_0x9337('0x9'));var client=jayson[_0x9337('0xa')][_0x9337('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a59ab,_0x16e2a4,_0x5b1986){return new BPromise(function(_0x268943,_0xdaec59){return client[_0x9337('0xc')](_0x5a59ab,_0x5b1986)[_0x9337('0xd')](function(_0x15c578){logger['info'](_0x9337('0xe'),_0x16e2a4,_0x9337('0xf'));logger[_0x9337('0x10')](_0x9337('0x11'),_0x16e2a4,_0x9337('0xf'),JSON['stringify'](_0x15c578));if(_0x15c578[_0x9337('0x12')]){if(_0x15c578[_0x9337('0x12')][_0x9337('0x13')]===0x1f4){logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x15c578[_0x9337('0x12')][_0x9337('0x14')]);return _0xdaec59(_0x15c578['error']['message']);}logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x15c578[_0x9337('0x12')][_0x9337('0x14')]);return _0x268943(_0x15c578['error']['message']);}else{logger[_0x9337('0x15')]('Campaign,\x20%s,\x20%s',_0x16e2a4,'request\x20sent');_0x268943(_0x15c578[_0x9337('0x16')][_0x9337('0x14')]);}})[_0x9337('0x17')](function(_0x48644e){logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x48644e);_0xdaec59(_0x48644e);});});}exports['GetCampaign']=function(_0x5e49e7){var _0x424f11=this;return new Promise(function(_0x462196,_0x4a27cc){return db[_0x9337('0x18')][_0x9337('0x19')]({'raw':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')][_0x9337('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')][_0x9337('0x1c')]||null:null,'attributes':_0x5e49e7['options']?_0x5e49e7['options'][_0x9337('0x1d')]||null:null,'limit':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')]['limit']||null:null,'include':_0x5e49e7[_0x9337('0x1a')]?_0x5e49e7['options']['include']?_[_0x9337('0x1e')](_0x5e49e7['options'][_0x9337('0x1f')],function(_0x543cfc){return{'model':db[_0x543cfc[_0x9337('0x20')]],'as':_0x543cfc['as'],'attributes':_0x543cfc[_0x9337('0x1d')],'include':_0x543cfc[_0x9337('0x1f')]?_[_0x9337('0x1e')](_0x543cfc[_0x9337('0x1f')],function(_0xb49ff1){return{'model':db[_0xb49ff1['model']],'as':_0xb49ff1['as'],'attributes':_0xb49ff1['attributes'],'include':_0xb49ff1[_0x9337('0x1f')]?_[_0x9337('0x1e')](_0xb49ff1[_0x9337('0x1f')],function(_0x178ed5){return{'model':db[_0x178ed5['model']],'as':_0x178ed5['as'],'attributes':_0x178ed5[_0x9337('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e2c6e){logger[_0x9337('0x15')](_0x9337('0x21'),_0x5e49e7);logger[_0x9337('0x10')]('GetCampaign',_0x5e49e7,JSON['stringify'](_0x2e2c6e));_0x462196(_0x2e2c6e);})[_0x9337('0x17')](function(_0x1bcb04){logger[_0x9337('0x12')](_0x9337('0x21'),_0x1bcb04[_0x9337('0x14')],_0x5e49e7);_0x4a27cc(_0x424f11['error'](0x1f4,_0x1bcb04[_0x9337('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4688194..80ba23f 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 _0x859c=['./campaign.controller','get','index','/:id','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x859c,0x86));var _0xc859=function(_0x428659,_0x2ea392){_0x428659=_0x428659-0x0;var _0x5cf903=_0x859c[_0x428659];return _0x5cf903;};'use strict';var multer=require(_0xc859('0x0'));var util=require(_0xc859('0x1'));var path=require(_0xc859('0x2'));var timeout=require(_0xc859('0x3'));var express=require(_0xc859('0x4'));var router=express[_0xc859('0x5')]();var fs_extra=require(_0xc859('0x6'));var auth=require(_0xc859('0x7'));var interaction=require(_0xc859('0x8'));var config=require(_0xc859('0x9'));var controller=require(_0xc859('0xa'));router[_0xc859('0xb')]('/',auth['isAuthenticated'](),controller[_0xc859('0xc')]);router[_0xc859('0xb')](_0xc859('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc859('0xb')](_0xc859('0xe'),auth[_0xc859('0xf')](),controller[_0xc859('0x10')]);router[_0xc859('0xb')](_0xc859('0x11'),auth[_0xc859('0xf')](),controller[_0xc859('0x12')]);router[_0xc859('0xb')](_0xc859('0x13'),auth['isAuthenticated'](),controller[_0xc859('0x14')]);router[_0xc859('0xb')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xc859('0x15')]);router['get'](_0xc859('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0xc859('0xb')](_0xc859('0x17'),auth[_0xc859('0xf')](),controller[_0xc859('0x18')]);router[_0xc859('0x19')]('/',auth[_0xc859('0xf')](),controller[_0xc859('0x1a')]);router[_0xc859('0x19')]('/:id/clone',auth[_0xc859('0xf')](),controller[_0xc859('0x1b')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0xc859('0x19')]('/:id/blacklists',auth[_0xc859('0xf')](),controller[_0xc859('0x1c')]);router[_0xc859('0x1d')]('/:id',auth[_0xc859('0xf')](),controller[_0xc859('0x1e')]);router[_0xc859('0x1f')](_0xc859('0xd'),auth[_0xc859('0xf')](),controller[_0xc859('0x20')]);router[_0xc859('0x1f')](_0xc859('0x16'),auth[_0xc859('0xf')](),controller[_0xc859('0x21')]);router[_0xc859('0x1f')](_0xc859('0x17'),auth[_0xc859('0xf')](),controller[_0xc859('0x22')]);module[_0xc859('0x23')]=router; \ No newline at end of file +var _0x08e7=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x5dcf96,_0x287bf0){var _0x385d5d=function(_0x1ddd2f){while(--_0x1ddd2f){_0x5dcf96['push'](_0x5dcf96['shift']());}};_0x385d5d(++_0x287bf0);}(_0x08e7,0x9d));var _0x708e=function(_0x3fbc49,_0x416d37){_0x3fbc49=_0x3fbc49-0x0;var _0x5c57b0=_0x08e7[_0x3fbc49];return _0x5c57b0;};'use strict';var multer=require(_0x708e('0x0'));var util=require(_0x708e('0x1'));var path=require(_0x708e('0x2'));var timeout=require(_0x708e('0x3'));var express=require(_0x708e('0x4'));var router=express[_0x708e('0x5')]();var fs_extra=require(_0x708e('0x6'));var auth=require(_0x708e('0x7'));var interaction=require(_0x708e('0x8'));var config=require('../../config/environment');var controller=require(_0x708e('0x9'));router[_0x708e('0xa')]('/',auth[_0x708e('0xb')](),controller['index']);router[_0x708e('0xa')](_0x708e('0xc'),auth[_0x708e('0xb')](),controller[_0x708e('0xd')]);router['get'](_0x708e('0xe'),auth[_0x708e('0xb')](),controller[_0x708e('0xf')]);router['get'](_0x708e('0x10'),auth[_0x708e('0xb')](),controller[_0x708e('0x11')]);router[_0x708e('0xa')](_0x708e('0x12'),auth[_0x708e('0xb')](),controller[_0x708e('0x13')]);router[_0x708e('0xa')](_0x708e('0x14'),auth[_0x708e('0xb')](),controller[_0x708e('0x15')]);router[_0x708e('0xa')](_0x708e('0x16'),auth[_0x708e('0xb')](),controller[_0x708e('0x17')]);router[_0x708e('0xa')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x708e('0x18')]);router[_0x708e('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x708e('0x19')](_0x708e('0x1a'),auth[_0x708e('0xb')](),controller[_0x708e('0x1b')]);router[_0x708e('0x19')](_0x708e('0x16'),auth[_0x708e('0xb')](),controller[_0x708e('0x1c')]);router[_0x708e('0x19')](_0x708e('0x1d'),auth[_0x708e('0xb')](),controller['addBlackLists']);router[_0x708e('0x1e')](_0x708e('0xc'),auth[_0x708e('0xb')](),controller[_0x708e('0x1f')]);router[_0x708e('0x20')](_0x708e('0xc'),auth[_0x708e('0xb')](),controller[_0x708e('0x21')]);router['delete'](_0x708e('0x16'),auth['isAuthenticated'](),controller[_0x708e('0x22')]);router['delete'](_0x708e('0x1d'),auth[_0x708e('0xb')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f689349..28c8936 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 _0xe695=['key','sequelize','exports','STRING','getDataValue'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xe695,0x123));var _0x5e69=function(_0x50d9e0,_0xa7bb5){_0x50d9e0=_0x50d9e0-0x0;var _0x15ff7b=_0xe695[_0x50d9e0];return _0x15ff7b;};'use strict';var Sequelize=require(_0x5e69('0x0'));module[_0x5e69('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x5e69('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5e69('0x3')](_0x5e69('0x4'));}}}; \ No newline at end of file +var _0x1737=['VIRTUAL','key','sequelize','exports','STRING','TEXT'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x1737,0xda));var _0x7173=function(_0x246906,_0xd907d3){_0x246906=_0x246906-0x0;var _0x12e86a=_0x1737[_0x246906];return _0x12e86a;};'use strict';var Sequelize=require(_0x7173('0x0'));module[_0x7173('0x1')]={'key':{'type':Sequelize[_0x7173('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7173('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7173('0x4')],'get':function(){return this['getDataValue'](_0x7173('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8e321c3..9ee6d33 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 _0x7e13=['set','Content-Range','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','CannedAnswer','include','rows','params','find','body','catch','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count'];(function(_0x4b5099,_0x2cd16f){var _0x49ae79=function(_0x243119){while(--_0x243119){_0x4b5099['push'](_0x4b5099['shift']());}};_0x49ae79(++_0x2cd16f);}(_0x7e13,0x1dd));var _0x37e1=function(_0x3b8abd,_0x28f148){_0x3b8abd=_0x3b8abd-0x0;var _0x254942=_0x7e13[_0x3b8abd];return _0x254942;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37e1('0x0'));var zipdir=require(_0x37e1('0x1'));var jsonpatch=require(_0x37e1('0x2'));var rp=require(_0x37e1('0x3'));var moment=require(_0x37e1('0x4'));var BPromise=require(_0x37e1('0x5'));var Mustache=require(_0x37e1('0x6'));var util=require(_0x37e1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x37e1('0x8'));var ejs=require(_0x37e1('0x9'));var fs=require('fs');var fs_extra=require(_0x37e1('0xa'));var _=require('lodash');var squel=require(_0x37e1('0xb'));var crypto=require(_0x37e1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37e1('0xd'));var toCsv=require(_0x37e1('0x8'));var querystring=require(_0x37e1('0xe'));var Papa=require('papaparse');var Redis=require(_0x37e1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x37e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x37e1('0x11'))(_0x37e1('0x12'));var utils=require(_0x37e1('0x13'));var config=require(_0x37e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fad79,_0x455524){_0x455524=_0x455524||0xcc;return function(_0x53b425){if(_0x53b425){return _0x2fad79[_0x37e1('0x15')](_0x455524);}return _0x2fad79['status'](_0x455524)['end']();};}function respondWithResult(_0x447e75,_0x38b485){_0x38b485=_0x38b485||0xc8;return function(_0x1b75ee){if(_0x1b75ee){return _0x447e75[_0x37e1('0x16')](_0x38b485)['json'](_0x1b75ee);}};}function respondWithFilteredResult(_0x6d08d7,_0x1315ec){return function(_0x201c6d){if(_0x201c6d){var _0x2816e2=typeof _0x1315ec[_0x37e1('0x17')]===_0x37e1('0x18')&&typeof _0x1315ec[_0x37e1('0x19')]===_0x37e1('0x18');var _0x53e869=_0x201c6d[_0x37e1('0x1a')];var _0x407a8a=_0x2816e2?0x0:_0x1315ec[_0x37e1('0x17')];var _0x35dab1=_0x2816e2?_0x201c6d[_0x37e1('0x1a')]:_0x1315ec['offset']+_0x1315ec['limit'];var _0x41070f;if(_0x35dab1>=_0x53e869){_0x35dab1=_0x53e869;_0x41070f=0xc8;}else{_0x41070f=0xce;}_0x6d08d7[_0x37e1('0x16')](_0x41070f);return _0x6d08d7[_0x37e1('0x1b')](_0x37e1('0x1c'),_0x407a8a+'-'+_0x35dab1+'/'+_0x53e869)[_0x37e1('0x1d')](_0x201c6d);}return null;};}function patchUpdates(_0x42322c){return function(_0xc28abe){try{jsonpatch[_0x37e1('0x1e')](_0xc28abe,_0x42322c,!![]);}catch(_0x50ddd2){return BPromise[_0x37e1('0x1f')](_0x50ddd2);}return _0xc28abe[_0x37e1('0x20')]();};}function saveUpdates(_0x3024ec,_0x48c96a){return function(_0x8c24d8){if(_0x8c24d8){return _0x8c24d8[_0x37e1('0x21')](_0x3024ec)[_0x37e1('0x22')](function(_0x4a7221){return _0x4a7221;});}return null;};}function removeEntity(_0x584a19,_0x17d8c0){return function(_0x504924){if(_0x504924){return _0x504924[_0x37e1('0x23')]()[_0x37e1('0x22')](function(){var _0x57e84e=_0x504924[_0x37e1('0x24')]({'plain':!![]});var _0x3f4e8d=_0x37e1('0x25');return db[_0x37e1('0x26')][_0x37e1('0x23')]({'where':{'type':_0x3f4e8d,'resourceId':_0x57e84e['id']}})[_0x37e1('0x22')](function(){return _0x504924;});})[_0x37e1('0x22')](function(){_0x584a19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e047,_0x4a0572){return function(_0x3eadb1){if(!_0x3eadb1){_0x23e047[_0x37e1('0x15')](0x194);}return _0x3eadb1;};}function handleError(_0x2fc229,_0x5333d0){_0x5333d0=_0x5333d0||0x1f4;return function(_0x1417da){logger[_0x37e1('0x27')](_0x1417da['stack']);if(_0x1417da[_0x37e1('0x28')]){delete _0x1417da['name'];}_0x2fc229[_0x37e1('0x16')](_0x5333d0)[_0x37e1('0x29')](_0x1417da);};}exports[_0x37e1('0x2a')]=function(_0x3dfec9,_0x300884){var _0x29b3e0={},_0x49ba85={},_0x141176={'count':0x0,'rows':[]};var _0x365e2e=_[_0x37e1('0x2b')](db['CannedAnswer'][_0x37e1('0x2c')],function(_0x250b55){return{'name':_0x250b55[_0x37e1('0x2d')],'type':_0x250b55['type']['key']};});_0x49ba85[_0x37e1('0x2e')]=_[_0x37e1('0x2b')](_0x365e2e,'name');_0x49ba85['query']=_[_0x37e1('0x2f')](_0x3dfec9[_0x37e1('0x30')]);_0x49ba85['filters']=_[_0x37e1('0x31')](_0x49ba85['model'],_0x49ba85[_0x37e1('0x30')]);_0x29b3e0[_0x37e1('0x32')]=_[_0x37e1('0x31')](_0x49ba85[_0x37e1('0x2e')],qs[_0x37e1('0x33')](_0x3dfec9[_0x37e1('0x30')][_0x37e1('0x33')]));_0x29b3e0['attributes']=_0x29b3e0[_0x37e1('0x32')][_0x37e1('0x34')]?_0x29b3e0[_0x37e1('0x32')]:_0x49ba85[_0x37e1('0x2e')];if(!_0x3dfec9['query'][_0x37e1('0x35')](_0x37e1('0x36'))){_0x29b3e0[_0x37e1('0x19')]=qs[_0x37e1('0x19')](_0x3dfec9[_0x37e1('0x30')]['limit']);_0x29b3e0['offset']=qs[_0x37e1('0x17')](_0x3dfec9[_0x37e1('0x30')][_0x37e1('0x17')]);}_0x29b3e0[_0x37e1('0x37')]=qs[_0x37e1('0x38')](_0x3dfec9[_0x37e1('0x30')]['sort']);_0x29b3e0[_0x37e1('0x39')]=qs[_0x37e1('0x3a')](_['pick'](_0x3dfec9[_0x37e1('0x30')],_0x49ba85['filters']),_0x365e2e);if(_0x3dfec9['query'][_0x37e1('0x3b')]){_0x29b3e0[_0x37e1('0x39')]=_[_0x37e1('0x3c')](_0x29b3e0[_0x37e1('0x39')],{'$or':[{'key':{'$like':'%'+_0x3dfec9[_0x37e1('0x30')][_0x37e1('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3dfec9[_0x37e1('0x30')][_0x37e1('0x3b')]+'%'}}]});}_0x29b3e0=_['merge']({},_0x29b3e0,_0x3dfec9[_0x37e1('0x3d')]);var _0x2eb65e={'where':_0x29b3e0[_0x37e1('0x39')]};return db[_0x37e1('0x3e')][_0x37e1('0x1a')](_0x2eb65e)[_0x37e1('0x22')](function(_0x4347cf){_0x141176[_0x37e1('0x1a')]=_0x4347cf;if(_0x3dfec9[_0x37e1('0x30')]['includeAll']){_0x29b3e0[_0x37e1('0x3f')]=[{'all':!![]}];}return db[_0x37e1('0x3e')]['findAll'](_0x29b3e0);})[_0x37e1('0x22')](function(_0x4075e2){_0x141176[_0x37e1('0x40')]=_0x4075e2;return _0x141176;})[_0x37e1('0x22')](respondWithFilteredResult(_0x300884,_0x29b3e0))['catch'](handleError(_0x300884,null));};exports['show']=function(_0x2e09c4,_0x39bfbd){var _0x3b60e5={'raw':!![],'where':{'id':_0x2e09c4[_0x37e1('0x41')]['id']}},_0x48a81a={};_0x48a81a[_0x37e1('0x2e')]=_[_0x37e1('0x2f')](db['CannedAnswer'][_0x37e1('0x2c')]);_0x48a81a[_0x37e1('0x30')]=_[_0x37e1('0x2f')](_0x2e09c4[_0x37e1('0x30')]);_0x48a81a[_0x37e1('0x3a')]=_['intersection'](_0x48a81a[_0x37e1('0x2e')],_0x48a81a[_0x37e1('0x30')]);_0x3b60e5[_0x37e1('0x32')]=_[_0x37e1('0x31')](_0x48a81a['model'],qs[_0x37e1('0x33')](_0x2e09c4[_0x37e1('0x30')][_0x37e1('0x33')]));_0x3b60e5[_0x37e1('0x32')]=_0x3b60e5[_0x37e1('0x32')]['length']?_0x3b60e5[_0x37e1('0x32')]:_0x48a81a[_0x37e1('0x2e')];if(_0x2e09c4['query']['includeAll']){_0x3b60e5[_0x37e1('0x3f')]=[{'all':!![]}];}_0x3b60e5=_[_0x37e1('0x3c')]({},_0x3b60e5,_0x2e09c4[_0x37e1('0x3d')]);return db[_0x37e1('0x3e')][_0x37e1('0x42')](_0x3b60e5)['then'](handleEntityNotFound(_0x39bfbd,null))['then'](respondWithResult(_0x39bfbd,null))['catch'](handleError(_0x39bfbd,null));};exports['update']=function(_0x2b611f,_0xd884c7){if(_0x2b611f[_0x37e1('0x43')]['id']){delete _0x2b611f[_0x37e1('0x43')]['id'];}return db[_0x37e1('0x3e')][_0x37e1('0x42')]({'where':{'id':_0x2b611f[_0x37e1('0x41')]['id']}})['then'](handleEntityNotFound(_0xd884c7,null))['then'](saveUpdates(_0x2b611f['body'],null))[_0x37e1('0x22')](respondWithResult(_0xd884c7,null))[_0x37e1('0x44')](handleError(_0xd884c7,null));};exports['destroy']=function(_0x3888c5,_0x2f753d){return db[_0x37e1('0x3e')][_0x37e1('0x42')]({'where':{'id':_0x3888c5[_0x37e1('0x41')]['id']}})[_0x37e1('0x22')](handleEntityNotFound(_0x2f753d,null))['then'](removeEntity(_0x2f753d,null))['catch'](handleError(_0x2f753d,null));};exports[_0x37e1('0x45')]=function(_0x384a41,_0x1b12e4){var _0x4374ca={'key':_0x384a41['body'][_0x37e1('0x46')]};if(_0x384a41[_0x37e1('0x43')][_0x37e1('0x47')]){_0x4374ca[_0x37e1('0x47')]=_0x384a41[_0x37e1('0x43')][_0x37e1('0x47')];}else if(_0x384a41[_0x37e1('0x43')][_0x37e1('0x48')]){_0x4374ca[_0x37e1('0x48')]=_0x384a41[_0x37e1('0x43')][_0x37e1('0x48')];}else if(_0x384a41[_0x37e1('0x43')][_0x37e1('0x49')]){_0x4374ca[_0x37e1('0x49')]=_0x384a41[_0x37e1('0x43')][_0x37e1('0x49')];}else if(_0x384a41['body']['ChatWebsiteId']){_0x4374ca[_0x37e1('0x4a')]=_0x384a41['body'][_0x37e1('0x4a')];}return db[_0x37e1('0x3e')]['find']({'where':_0x4374ca})[_0x37e1('0x22')](function(_0x459aeb){if(_0x459aeb){throw new db[(_0x37e1('0x4b'))][(_0x37e1('0x4c'))](_0x37e1('0x4d'));}return db[_0x37e1('0x3e')][_0x37e1('0x45')](_0x384a41[_0x37e1('0x43')]);})[_0x37e1('0x22')](function(_0x2a8935){var _0x46192a=_0x384a41['user']['get']({'plain':!![]});if(!_0x46192a)throw new Error(_0x37e1('0x4e'));if(_0x46192a[_0x37e1('0x4f')]===_0x37e1('0x50')){var _0x594c41=_0x2a8935[_0x37e1('0x24')]({'plain':!![]});return db[_0x37e1('0x51')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x46192a[_0x37e1('0x52')]},'raw':!![]})[_0x37e1('0x22')](function(_0x2af448){if(_0x2af448&&_0x2af448['autoAssociation']===0x0){return db[_0x37e1('0x26')][_0x37e1('0x45')]({'name':_0x594c41[_0x37e1('0x28')],'resourceId':_0x594c41['id'],'type':_0x2af448['name'],'sectionId':_0x2af448['id']},{})[_0x37e1('0x22')](function(){return _0x2a8935;});}else{return _0x2a8935;}})[_0x37e1('0x44')](function(_0x5ec4f7){logger[_0x37e1('0x27')](_0x37e1('0x53'),_0x5ec4f7);throw _0x5ec4f7;});}return _0x2a8935;})[_0x37e1('0x22')](respondWithResult(_0x1b12e4,0xc9))[_0x37e1('0x44')](handleError(_0x1b12e4,null));}; \ No newline at end of file +var _0xd6f8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','map','CannedAnswer','rawAttributes','fieldName','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','filters','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4e4681,_0x2f0100){var _0x5bbb8b=function(_0x47de74){while(--_0x47de74){_0x4e4681['push'](_0x4e4681['shift']());}};_0x5bbb8b(++_0x2f0100);}(_0xd6f8,0x1ad));var _0x8d6f=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xd6f8[_0x5cab28];return _0xa3554d;};'use strict';var emlformat=require(_0x8d6f('0x0'));var rimraf=require(_0x8d6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d6f('0x2'));var rp=require(_0x8d6f('0x3'));var moment=require(_0x8d6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d6f('0x5'));var util=require(_0x8d6f('0x6'));var path=require(_0x8d6f('0x7'));var sox=require(_0x8d6f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d6f('0x9'));var _=require(_0x8d6f('0xa'));var squel=require(_0x8d6f('0xb'));var crypto=require(_0x8d6f('0xc'));var jsforce=require(_0x8d6f('0xd'));var deskjs=require(_0x8d6f('0xe'));var toCsv=require(_0x8d6f('0xf'));var querystring=require(_0x8d6f('0x10'));var Papa=require(_0x8d6f('0x11'));var Redis=require(_0x8d6f('0x12'));var authService=require(_0x8d6f('0x13'));var qs=require(_0x8d6f('0x14'));var as=require(_0x8d6f('0x15'));var hardwareService=require(_0x8d6f('0x16'));var logger=require(_0x8d6f('0x17'))(_0x8d6f('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d6f('0x19'));var db=require(_0x8d6f('0x1a'))['db'];function respondWithStatusCode(_0x4b915c,_0x181f46){_0x181f46=_0x181f46||0xcc;return function(_0x10d710){if(_0x10d710){return _0x4b915c[_0x8d6f('0x1b')](_0x181f46);}return _0x4b915c[_0x8d6f('0x1c')](_0x181f46)[_0x8d6f('0x1d')]();};}function respondWithResult(_0xd003d9,_0x56dfd2){_0x56dfd2=_0x56dfd2||0xc8;return function(_0x9708f1){if(_0x9708f1){return _0xd003d9[_0x8d6f('0x1c')](_0x56dfd2)[_0x8d6f('0x1e')](_0x9708f1);}};}function respondWithFilteredResult(_0x3818ec,_0x3ef57e){return function(_0x117a8f){if(_0x117a8f){var _0x30ee40=typeof _0x3ef57e[_0x8d6f('0x1f')]===_0x8d6f('0x20')&&typeof _0x3ef57e[_0x8d6f('0x21')]==='undefined';var _0x55eeb7=_0x117a8f[_0x8d6f('0x22')];var _0x20139d=_0x30ee40?0x0:_0x3ef57e[_0x8d6f('0x1f')];var _0x2c87bf=_0x30ee40?_0x117a8f[_0x8d6f('0x22')]:_0x3ef57e['offset']+_0x3ef57e[_0x8d6f('0x21')];var _0x59a8a1;if(_0x2c87bf>=_0x55eeb7){_0x2c87bf=_0x55eeb7;_0x59a8a1=0xc8;}else{_0x59a8a1=0xce;}_0x3818ec['status'](_0x59a8a1);return _0x3818ec['set'](_0x8d6f('0x23'),_0x20139d+'-'+_0x2c87bf+'/'+_0x55eeb7)[_0x8d6f('0x1e')](_0x117a8f);}return null;};}function patchUpdates(_0x2375a1){return function(_0x47ad12){try{jsonpatch[_0x8d6f('0x24')](_0x47ad12,_0x2375a1,!![]);}catch(_0x20ff2f){return BPromise[_0x8d6f('0x25')](_0x20ff2f);}return _0x47ad12[_0x8d6f('0x26')]();};}function saveUpdates(_0x42f895,_0x2e102a){return function(_0x2cb693){if(_0x2cb693){return _0x2cb693['update'](_0x42f895)[_0x8d6f('0x27')](function(_0x367d1f){return _0x367d1f;});}return null;};}function removeEntity(_0x9678b2,_0x22353f){return function(_0x40d546){if(_0x40d546){return _0x40d546[_0x8d6f('0x28')]()['then'](function(){var _0x4f42cc=_0x40d546[_0x8d6f('0x29')]({'plain':!![]});var _0x369aea='CannedAnswers';return db[_0x8d6f('0x2a')][_0x8d6f('0x28')]({'where':{'type':_0x369aea,'resourceId':_0x4f42cc['id']}})[_0x8d6f('0x27')](function(){return _0x40d546;});})['then'](function(){_0x9678b2[_0x8d6f('0x1c')](0xcc)[_0x8d6f('0x1d')]();});}};}function handleEntityNotFound(_0x57bd76,_0xd0f703){return function(_0x46c649){if(!_0x46c649){_0x57bd76[_0x8d6f('0x1b')](0x194);}return _0x46c649;};}function handleError(_0x73767a,_0xcffb2a){_0xcffb2a=_0xcffb2a||0x1f4;return function(_0x80c1ca){logger['error'](_0x80c1ca['stack']);if(_0x80c1ca[_0x8d6f('0x2b')]){delete _0x80c1ca[_0x8d6f('0x2b')];}_0x73767a[_0x8d6f('0x1c')](_0xcffb2a)[_0x8d6f('0x2c')](_0x80c1ca);};}exports['index']=function(_0x17c2d2,_0x359e4f){var _0x349f9f={},_0x37d2c5={},_0x836a99={'count':0x0,'rows':[]};var _0x5afabc=_[_0x8d6f('0x2d')](db[_0x8d6f('0x2e')][_0x8d6f('0x2f')],function(_0x28f679){return{'name':_0x28f679[_0x8d6f('0x30')],'type':_0x28f679['type'][_0x8d6f('0x31')]};});_0x37d2c5['model']=_[_0x8d6f('0x2d')](_0x5afabc,_0x8d6f('0x2b'));_0x37d2c5[_0x8d6f('0x32')]=_[_0x8d6f('0x33')](_0x17c2d2[_0x8d6f('0x32')]);_0x37d2c5['filters']=_['intersection'](_0x37d2c5['model'],_0x37d2c5[_0x8d6f('0x32')]);_0x349f9f[_0x8d6f('0x34')]=_[_0x8d6f('0x35')](_0x37d2c5[_0x8d6f('0x36')],qs[_0x8d6f('0x37')](_0x17c2d2[_0x8d6f('0x32')][_0x8d6f('0x37')]));_0x349f9f[_0x8d6f('0x34')]=_0x349f9f[_0x8d6f('0x34')][_0x8d6f('0x38')]?_0x349f9f[_0x8d6f('0x34')]:_0x37d2c5['model'];if(!_0x17c2d2[_0x8d6f('0x32')][_0x8d6f('0x39')]('nolimit')){_0x349f9f[_0x8d6f('0x21')]=qs[_0x8d6f('0x21')](_0x17c2d2[_0x8d6f('0x32')]['limit']);_0x349f9f[_0x8d6f('0x1f')]=qs['offset'](_0x17c2d2['query']['offset']);}_0x349f9f[_0x8d6f('0x3a')]=qs[_0x8d6f('0x3b')](_0x17c2d2[_0x8d6f('0x32')][_0x8d6f('0x3b')]);_0x349f9f[_0x8d6f('0x3c')]=qs['filters'](_['pick'](_0x17c2d2[_0x8d6f('0x32')],_0x37d2c5['filters']),_0x5afabc);if(_0x17c2d2['query']['filter']){_0x349f9f[_0x8d6f('0x3c')]=_[_0x8d6f('0x3d')](_0x349f9f[_0x8d6f('0x3c')],{'$or':[{'key':{'$like':'%'+_0x17c2d2[_0x8d6f('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x17c2d2[_0x8d6f('0x32')][_0x8d6f('0x3e')]+'%'}}]});}_0x349f9f=_[_0x8d6f('0x3d')]({},_0x349f9f,_0x17c2d2[_0x8d6f('0x3f')]);var _0x2d8eff={'where':_0x349f9f[_0x8d6f('0x3c')]};return db[_0x8d6f('0x2e')][_0x8d6f('0x22')](_0x2d8eff)['then'](function(_0x1358dc){_0x836a99[_0x8d6f('0x22')]=_0x1358dc;if(_0x17c2d2[_0x8d6f('0x32')][_0x8d6f('0x40')]){_0x349f9f[_0x8d6f('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8d6f('0x42')](_0x349f9f);})[_0x8d6f('0x27')](function(_0x516173){_0x836a99[_0x8d6f('0x43')]=_0x516173;return _0x836a99;})[_0x8d6f('0x27')](respondWithFilteredResult(_0x359e4f,_0x349f9f))[_0x8d6f('0x44')](handleError(_0x359e4f,null));};exports['show']=function(_0x19c4a0,_0x3ca176){var _0x3d8772={'raw':!![],'where':{'id':_0x19c4a0[_0x8d6f('0x45')]['id']}},_0x5ada97={};_0x5ada97['model']=_['keys'](db[_0x8d6f('0x2e')][_0x8d6f('0x2f')]);_0x5ada97[_0x8d6f('0x32')]=_['keys'](_0x19c4a0[_0x8d6f('0x32')]);_0x5ada97[_0x8d6f('0x46')]=_[_0x8d6f('0x35')](_0x5ada97[_0x8d6f('0x36')],_0x5ada97[_0x8d6f('0x32')]);_0x3d8772[_0x8d6f('0x34')]=_['intersection'](_0x5ada97[_0x8d6f('0x36')],qs[_0x8d6f('0x37')](_0x19c4a0['query'][_0x8d6f('0x37')]));_0x3d8772[_0x8d6f('0x34')]=_0x3d8772['attributes'][_0x8d6f('0x38')]?_0x3d8772[_0x8d6f('0x34')]:_0x5ada97[_0x8d6f('0x36')];if(_0x19c4a0[_0x8d6f('0x32')][_0x8d6f('0x40')]){_0x3d8772[_0x8d6f('0x41')]=[{'all':!![]}];}_0x3d8772=_['merge']({},_0x3d8772,_0x19c4a0[_0x8d6f('0x3f')]);return db['CannedAnswer'][_0x8d6f('0x47')](_0x3d8772)[_0x8d6f('0x27')](handleEntityNotFound(_0x3ca176,null))[_0x8d6f('0x27')](respondWithResult(_0x3ca176,null))[_0x8d6f('0x44')](handleError(_0x3ca176,null));};exports[_0x8d6f('0x48')]=function(_0x5cd29a,_0x34deb0){if(_0x5cd29a[_0x8d6f('0x49')]['id']){delete _0x5cd29a['body']['id'];}return db[_0x8d6f('0x2e')][_0x8d6f('0x47')]({'where':{'id':_0x5cd29a[_0x8d6f('0x45')]['id']}})[_0x8d6f('0x27')](handleEntityNotFound(_0x34deb0,null))[_0x8d6f('0x27')](saveUpdates(_0x5cd29a[_0x8d6f('0x49')],null))[_0x8d6f('0x27')](respondWithResult(_0x34deb0,null))[_0x8d6f('0x44')](handleError(_0x34deb0,null));};exports['destroy']=function(_0x3c6277,_0x2cbf7){return db['CannedAnswer']['find']({'where':{'id':_0x3c6277[_0x8d6f('0x45')]['id']}})[_0x8d6f('0x27')](handleEntityNotFound(_0x2cbf7,null))['then'](removeEntity(_0x2cbf7,null))[_0x8d6f('0x44')](handleError(_0x2cbf7,null));};exports[_0x8d6f('0x4a')]=function(_0x16e79a,_0x14c8ee){var _0x51e2fb={'key':_0x16e79a['body']['key']};if(_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4b')]){_0x51e2fb[_0x8d6f('0x4b')]=_0x16e79a[_0x8d6f('0x49')]['MailAccountId'];}else if(_0x16e79a[_0x8d6f('0x49')]['SmsAccountId']){_0x51e2fb[_0x8d6f('0x4c')]=_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4c')];}else if(_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4d')]){_0x51e2fb[_0x8d6f('0x4d')]=_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4d')];}else if(_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4e')]){_0x51e2fb[_0x8d6f('0x4e')]=_0x16e79a[_0x8d6f('0x49')][_0x8d6f('0x4e')];}return db[_0x8d6f('0x2e')][_0x8d6f('0x47')]({'where':_0x51e2fb})[_0x8d6f('0x27')](function(_0x2fe248){if(_0x2fe248){throw new db['Sequelize'][(_0x8d6f('0x4f'))](_0x8d6f('0x50'));}return db[_0x8d6f('0x2e')]['create'](_0x16e79a[_0x8d6f('0x49')]);})['then'](function(_0x23993f){var _0x54c3e9=_0x16e79a['user'][_0x8d6f('0x29')]({'plain':!![]});if(!_0x54c3e9)throw new Error(_0x8d6f('0x51'));if(_0x54c3e9[_0x8d6f('0x52')]===_0x8d6f('0x53')){var _0x3c17c2=_0x23993f[_0x8d6f('0x29')]({'plain':!![]});return db[_0x8d6f('0x54')][_0x8d6f('0x47')]({'where':{'name':_0x8d6f('0x55'),'userProfileId':_0x54c3e9[_0x8d6f('0x56')]},'raw':!![]})[_0x8d6f('0x27')](function(_0xbe2285){if(_0xbe2285&&_0xbe2285['autoAssociation']===0x0){return db['UserProfileResource'][_0x8d6f('0x4a')]({'name':_0x3c17c2[_0x8d6f('0x2b')],'resourceId':_0x3c17c2['id'],'type':_0xbe2285[_0x8d6f('0x2b')],'sectionId':_0xbe2285['id']},{})['then'](function(){return _0x23993f;});}else{return _0x23993f;}})['catch'](function(_0x525d70){logger[_0x8d6f('0x57')](_0x8d6f('0x58'),_0x525d70);throw _0x525d70;});}return _0x23993f;})[_0x8d6f('0x27')](respondWithResult(_0x14c8ee,0xc9))[_0x8d6f('0x44')](handleError(_0x14c8ee,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 08f8c1f..f13f381 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 _0xe900=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x3b4ce6,_0x5c5d3f){var _0x3098ed=function(_0x369e71){while(--_0x369e71){_0x3b4ce6['push'](_0x3b4ce6['shift']());}};_0x3098ed(++_0x5c5d3f);}(_0xe900,0x89));var _0x0e90=function(_0x4787b7,_0x2b0651){_0x4787b7=_0x4787b7-0x0;var _0x578226=_0xe900[_0x4787b7];return _0x578226;};'use strict';var _=require(_0x0e90('0x0'));var util=require('util');var logger=require(_0x0e90('0x1'))(_0x0e90('0x2'));var moment=require(_0x0e90('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e90('0x4'));var fs=require('fs');var path=require(_0x0e90('0x5'));var rimraf=require('rimraf');var config=require(_0x0e90('0x6'));var attributes=require(_0x0e90('0x7'));module[_0x0e90('0x8')]=function(_0x413d4b,_0x34a068){return _0x413d4b[_0x0e90('0x9')](_0x0e90('0xa'),attributes,{'tableName':_0x0e90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e90('0xc')});}; \ No newline at end of file +var _0xa9b2=['exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x5d5837,_0x407b1e){var _0x4c3e56=function(_0x55d1da){while(--_0x55d1da){_0x5d5837['push'](_0x5d5837['shift']());}};_0x4c3e56(++_0x407b1e);}(_0xa9b2,0x1e5));var _0x2a9b=function(_0x4aa7b8,_0xc69b67){_0x4aa7b8=_0x4aa7b8-0x0;var _0x310986=_0xa9b2[_0x4aa7b8];return _0x310986;};'use strict';var _=require(_0x2a9b('0x0'));var util=require(_0x2a9b('0x1'));var logger=require(_0x2a9b('0x2'))(_0x2a9b('0x3'));var moment=require(_0x2a9b('0x4'));var BPromise=require(_0x2a9b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a9b('0x6'));var rimraf=require('rimraf');var config=require(_0x2a9b('0x7'));var attributes=require(_0x2a9b('0x8'));module[_0x2a9b('0x9')]=function(_0xb93bc3,_0x8a4bdd){return _0xb93bc3[_0x2a9b('0xa')](_0x2a9b('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2a9b('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index bd8f9e8..5cad14a 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(_0x479b6f,_0xdb87f2){var _0x4f8df7=function(_0x5496ea){while(--_0x5496ea){_0x479b6f['push'](_0x479b6f['shift']());}};_0x4f8df7(++_0xdb87f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x44b28a,_0x4fd472){var _0xf4402b=function(_0x5cd321){while(--_0x5cd321){_0x44b28a['push'](_0x44b28a['shift']());}};_0xf4402b(++_0x4fd472);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var 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 c28de10..157c268 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 _0xcc7b=['./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x591549,_0x3dced2){var _0x4fb5b1=function(_0x2611e3){while(--_0x2611e3){_0x591549['push'](_0x591549['shift']());}};_0x4fb5b1(++_0x3dced2);}(_0xcc7b,0x1bf));var _0xbcc7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc7b[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xbcc7('0x0'));var util=require(_0xbcc7('0x1'));var path=require(_0xbcc7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbcc7('0x3'));var router=express[_0xbcc7('0x4')]();var fs_extra=require(_0xbcc7('0x5'));var auth=require(_0xbcc7('0x6'));var interaction=require(_0xbcc7('0x7'));var config=require(_0xbcc7('0x8'));var controller=require(_0xbcc7('0x9'));router[_0xbcc7('0xa')]('/',auth[_0xbcc7('0xb')](),controller[_0xbcc7('0xc')]);router[_0xbcc7('0xa')]('/:id',auth[_0xbcc7('0xb')](),controller[_0xbcc7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbcc7('0xe')]);router[_0xbcc7('0xf')]('/:id',auth[_0xbcc7('0xb')](),controller['update']);router['delete'](_0xbcc7('0x10'),auth['isAuthenticated'](),controller[_0xbcc7('0x11')]);module[_0xbcc7('0x12')]=router; \ No newline at end of file +var _0xca1d=['util','path','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','create','put','/:id','update','delete','exports'];(function(_0x4a1e84,_0x247c02){var _0x21ed01=function(_0x2ff1d2){while(--_0x2ff1d2){_0x4a1e84['push'](_0x4a1e84['shift']());}};_0x21ed01(++_0x247c02);}(_0xca1d,0x186));var _0xdca1=function(_0x10a4a5,_0x4773ac){_0x10a4a5=_0x10a4a5-0x0;var _0x51edae=_0xca1d[_0x10a4a5];return _0x51edae;};'use strict';var multer=require('multer');var util=require(_0xdca1('0x0'));var path=require(_0xdca1('0x1'));var timeout=require('connect-timeout');var express=require(_0xdca1('0x2'));var router=express[_0xdca1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdca1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdca1('0x5'));var controller=require(_0xdca1('0x6'));router[_0xdca1('0x7')]('/',auth[_0xdca1('0x8')](),controller['index']);router[_0xdca1('0x7')]('/:id',auth[_0xdca1('0x8')](),controller['show']);router['post']('/',auth[_0xdca1('0x8')](),controller[_0xdca1('0x9')]);router[_0xdca1('0xa')](_0xdca1('0xb'),auth[_0xdca1('0x8')](),controller[_0xdca1('0xc')]);router[_0xdca1('0xd')](_0xdca1('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdca1('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b6298a9..a369bf6 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 _0xd398=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd398,0x1dd));var _0x8d39=function(_0x2f5105,_0x55607e){_0x2f5105=_0x2f5105-0x0;var _0x47c791=_0xd398[_0x2f5105];return _0x47c791;};'use strict';var Sequelize=require(_0x8d39('0x0'));module[_0x8d39('0x1')]={'calldate':{'type':Sequelize[_0x8d39('0x2')],'allowNull':![],'defaultValue':_0x8d39('0x3')},'clid':{'type':Sequelize[_0x8d39('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8d39('0x4')]},'dcontext':{'type':Sequelize[_0x8d39('0x4')]},'channel':{'type':Sequelize[_0x8d39('0x4')]},'dstchannel':{'type':Sequelize[_0x8d39('0x4')]},'lastapp':{'type':Sequelize[_0x8d39('0x4')]},'lastdata':{'type':Sequelize[_0x8d39('0x4')]},'duration':{'type':Sequelize[_0x8d39('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8d39('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8d39('0x4')]},'amaflags':{'type':Sequelize[_0x8d39('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8d39('0x4')]},'userfield':{'type':Sequelize[_0x8d39('0x4')]},'uniqueid':{'type':Sequelize[_0x8d39('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8d39('0x4')]},'peeraccount':{'type':Sequelize[_0x8d39('0x4')]},'type':{'type':Sequelize[_0x8d39('0x4')]},'tag':{'type':Sequelize[_0x8d39('0x4')]}}; \ No newline at end of file +var _0xd845=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4c7a4d,_0xf6fda9){var _0x16a471=function(_0x2a736f){while(--_0x2a736f){_0x4c7a4d['push'](_0x4c7a4d['shift']());}};_0x16a471(++_0xf6fda9);}(_0xd845,0x135));var _0x5d84=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xd845[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x5d84('0x0'));module[_0x5d84('0x1')]={'calldate':{'type':Sequelize[_0x5d84('0x2')],'allowNull':![],'defaultValue':_0x5d84('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5d84('0x4')]},'dst':{'type':Sequelize[_0x5d84('0x4')]},'dcontext':{'type':Sequelize[_0x5d84('0x4')]},'channel':{'type':Sequelize[_0x5d84('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5d84('0x4')]},'lastdata':{'type':Sequelize[_0x5d84('0x4')]},'duration':{'type':Sequelize[_0x5d84('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5d84('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5d84('0x4')]},'amaflags':{'type':Sequelize[_0x5d84('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5d84('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5d84('0x4')]},'sequence':{'type':Sequelize[_0x5d84('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5d84('0x4')]},'tag':{'type':Sequelize[_0x5d84('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 5ab550c..4e3915d 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr'];(function(_0x403844,_0x2ab23a){var _0x5edd12=function(_0xe02fdf){while(--_0xe02fdf){_0x403844['push'](_0x403844['shift']());}};_0x5edd12(++_0x2ab23a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x44b99b,_0xc58d16){_0x44b99b=_0x44b99b-0x0;var _0x313271=_0x1cb9[_0x44b99b];return _0x313271;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29'));_0x504275[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x3b3ee6[_0x91cb('0x33')]);_0x504275['filters']=_[_0x91cb('0x35')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x33')]);_0x468908[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x504275['model'],qs[_0x91cb('0x37')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x37')]));_0x468908[_0x91cb('0x36')]=_0x468908[_0x91cb('0x36')]['length']?_0x468908[_0x91cb('0x36')]:_0x504275['model'];if(!_0x3b3ee6['query']['hasOwnProperty'](_0x91cb('0x38'))){_0x468908['limit']=qs[_0x91cb('0x1d')](_0x3b3ee6['query']['limit']);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x1f')]);}_0x468908[_0x91cb('0x39')]=qs['sort'](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3a')]);_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_['pick'](_0x3b3ee6['query'],_0x504275[_0x91cb('0x3c')]),_0x52670a);if(_0x3b3ee6[_0x91cb('0x33')]['filter']){_0x468908[_0x91cb('0x3b')]=_[_0x91cb('0x3d')](_0x468908['where'],{'$or':_[_0x91cb('0x2c')](_0x52670a,function(_0xddc409){if(_0xddc409['type']!==_0x91cb('0x3e')){var _0x545687={};_0x545687[_0xddc409[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3f')]+'%'};return _0x545687;}})});}_0x468908=_[_0x91cb('0x3d')]({},_0x468908,_0x3b3ee6[_0x91cb('0x40')]);var _0x20bf50={'where':_0x468908['where']};return db[_0x91cb('0x2d')][_0x91cb('0x1e')](_0x20bf50)['then'](function(_0x312581){_0x2f04a3['count']=_0x312581;if(_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x41')]){_0x468908[_0x91cb('0x42')]=[{'all':!![]}];}return db[_0x91cb('0x2d')]['findAll'](_0x468908);})[_0x91cb('0x25')](function(_0x5af0e6){_0x2f04a3[_0x91cb('0x43')]=_0x5af0e6;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x44')](handleError(_0x2fb473,null));};exports[_0x91cb('0x45')]=function(_0x451463,_0x111cc0){var _0x325dca={'raw':!![],'where':{'id':_0x451463['params']['id']}},_0x3cc4c1={};_0x3cc4c1[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x3cc4c1[_0x91cb('0x33')]=_['keys'](_0x451463[_0x91cb('0x33')]);_0x3cc4c1[_0x91cb('0x3c')]=_[_0x91cb('0x35')](_0x3cc4c1[_0x91cb('0x32')],_0x3cc4c1['query']);_0x325dca[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x3cc4c1['model'],qs[_0x91cb('0x37')](_0x451463[_0x91cb('0x33')][_0x91cb('0x37')]));_0x325dca[_0x91cb('0x36')]=_0x325dca[_0x91cb('0x36')][_0x91cb('0x46')]?_0x325dca[_0x91cb('0x36')]:_0x3cc4c1[_0x91cb('0x32')];if(_0x451463[_0x91cb('0x33')]['includeAll']){_0x325dca[_0x91cb('0x42')]=[{'all':!![]}];}_0x325dca=_[_0x91cb('0x3d')]({},_0x325dca,_0x451463[_0x91cb('0x40')]);return db[_0x91cb('0x2d')][_0x91cb('0x47')](_0x325dca)[_0x91cb('0x25')](handleEntityNotFound(_0x111cc0,null))[_0x91cb('0x25')](respondWithResult(_0x111cc0,null))[_0x91cb('0x44')](handleError(_0x111cc0,null));};exports['create']=function(_0x348d78,_0x46caf1){return db[_0x91cb('0x2d')][_0x91cb('0x48')](_0x348d78['body'],{})[_0x91cb('0x25')](respondWithResult(_0x46caf1,0xc9))[_0x91cb('0x44')](handleError(_0x46caf1,null));};exports['update']=function(_0x212473,_0x47cdb7){if(_0x212473[_0x91cb('0x49')]['id']){delete _0x212473['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x212473[_0x91cb('0x4a')]['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x25')](saveUpdates(_0x212473[_0x91cb('0x49')],null))[_0x91cb('0x25')](respondWithResult(_0x47cdb7,null))['catch'](handleError(_0x47cdb7,null));};exports['destroy']=function(_0x1d26b8,_0xfe6692){return db[_0x91cb('0x2d')][_0x91cb('0x47')]({'where':{'id':_0x1d26b8['params']['id']}})['then'](handleEntityNotFound(_0xfe6692,null))['then'](removeEntity(_0xfe6692,null))[_0x91cb('0x44')](handleError(_0xfe6692,null));};exports['describe']=function(_0x3f22a1,_0x4aa670){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]()[_0x91cb('0x25')](respondWithResult(_0x4aa670,null))[_0x91cb('0x44')](handleError(_0x4aa670,null));}; \ No newline at end of file +var _0x885a=['include','findAll','rows','show','params','rawAttributes','length','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','reject','save','update','then','error','stack','name','map','Cdr','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','count','includeAll'];(function(_0x39f320,_0x21bfda){var _0x48a7ee=function(_0x18ba35){while(--_0x18ba35){_0x39f320['push'](_0x39f320['shift']());}};_0x48a7ee(++_0x21bfda);}(_0x885a,0x180));var _0xa885=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x885a[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa885('0x0'));var zipdir=require(_0xa885('0x1'));var jsonpatch=require(_0xa885('0x2'));var rp=require(_0xa885('0x3'));var moment=require('moment');var BPromise=require(_0xa885('0x4'));var Mustache=require(_0xa885('0x5'));var util=require(_0xa885('0x6'));var path=require(_0xa885('0x7'));var sox=require(_0xa885('0x8'));var csv=require(_0xa885('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa885('0xa'));var _=require(_0xa885('0xb'));var squel=require(_0xa885('0xc'));var crypto=require('crypto');var jsforce=require(_0xa885('0xd'));var deskjs=require(_0xa885('0xe'));var toCsv=require(_0xa885('0x9'));var querystring=require('querystring');var Papa=require(_0xa885('0xf'));var Redis=require(_0xa885('0x10'));var authService=require(_0xa885('0x11'));var qs=require(_0xa885('0x12'));var as=require(_0xa885('0x13'));var hardwareService=require(_0xa885('0x14'));var logger=require(_0xa885('0x15'))('api');var utils=require(_0xa885('0x16'));var config=require(_0xa885('0x17'));var licenseUtil=require(_0xa885('0x18'));var db=require(_0xa885('0x19'))['db'];function respondWithStatusCode(_0x412b2a,_0x3e9c7a){_0x3e9c7a=_0x3e9c7a||0xcc;return function(_0x4585d9){if(_0x4585d9){return _0x412b2a['sendStatus'](_0x3e9c7a);}return _0x412b2a[_0xa885('0x1a')](_0x3e9c7a)[_0xa885('0x1b')]();};}function respondWithResult(_0x27b24a,_0x12d81c){_0x12d81c=_0x12d81c||0xc8;return function(_0x33ce2e){if(_0x33ce2e){return _0x27b24a['status'](_0x12d81c)[_0xa885('0x1c')](_0x33ce2e);}};}function respondWithFilteredResult(_0x2ca5c5,_0x5296e6){return function(_0x14bff1){if(_0x14bff1){var _0x32fc86=typeof _0x5296e6['offset']===_0xa885('0x1d')&&typeof _0x5296e6[_0xa885('0x1e')]==='undefined';var _0x20a206=_0x14bff1['count'];var _0x2e9290=_0x32fc86?0x0:_0x5296e6[_0xa885('0x1f')];var _0x8c26c=_0x32fc86?_0x14bff1['count']:_0x5296e6[_0xa885('0x1f')]+_0x5296e6['limit'];var _0x127a86;if(_0x8c26c>=_0x20a206){_0x8c26c=_0x20a206;_0x127a86=0xc8;}else{_0x127a86=0xce;}_0x2ca5c5[_0xa885('0x1a')](_0x127a86);return _0x2ca5c5[_0xa885('0x20')]('Content-Range',_0x2e9290+'-'+_0x8c26c+'/'+_0x20a206)[_0xa885('0x1c')](_0x14bff1);}return null;};}function patchUpdates(_0x32b8df){return function(_0x1530b6){try{jsonpatch['apply'](_0x1530b6,_0x32b8df,!![]);}catch(_0x273988){return BPromise[_0xa885('0x21')](_0x273988);}return _0x1530b6[_0xa885('0x22')]();};}function saveUpdates(_0x4ad909,_0x303830){return function(_0x582b59){if(_0x582b59){return _0x582b59[_0xa885('0x23')](_0x4ad909)[_0xa885('0x24')](function(_0x5d2b43){return _0x5d2b43;});}return null;};}function removeEntity(_0x1d94c1,_0x190a57){return function(_0x21c98c){if(_0x21c98c){return _0x21c98c['destroy']()[_0xa885('0x24')](function(){_0x1d94c1[_0xa885('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ae58,_0x47daee){return function(_0x15ff4d){if(!_0x15ff4d){_0x39ae58['sendStatus'](0x194);}return _0x15ff4d;};}function handleError(_0x1a28d6,_0x110e63){_0x110e63=_0x110e63||0x1f4;return function(_0x3e347e){logger[_0xa885('0x25')](_0x3e347e[_0xa885('0x26')]);if(_0x3e347e[_0xa885('0x27')]){delete _0x3e347e[_0xa885('0x27')];}_0x1a28d6[_0xa885('0x1a')](_0x110e63)['send'](_0x3e347e);};}exports['index']=function(_0x5c4ca7,_0x4fc438){var _0x1c94ab={},_0x3e9e22={},_0x3af5d9={'count':0x0,'rows':[]};var _0x17c0eb=_[_0xa885('0x28')](db[_0xa885('0x29')]['rawAttributes'],function(_0x40d982){return{'name':_0x40d982['fieldName'],'type':_0x40d982[_0xa885('0x2a')]['key']};});_0x3e9e22[_0xa885('0x2b')]=_['map'](_0x17c0eb,_0xa885('0x27'));_0x3e9e22[_0xa885('0x2c')]=_[_0xa885('0x2d')](_0x5c4ca7['query']);_0x3e9e22[_0xa885('0x2e')]=_[_0xa885('0x2f')](_0x3e9e22['model'],_0x3e9e22[_0xa885('0x2c')]);_0x1c94ab['attributes']=_[_0xa885('0x2f')](_0x3e9e22[_0xa885('0x2b')],qs[_0xa885('0x30')](_0x5c4ca7['query'][_0xa885('0x30')]));_0x1c94ab[_0xa885('0x31')]=_0x1c94ab[_0xa885('0x31')]['length']?_0x1c94ab[_0xa885('0x31')]:_0x3e9e22[_0xa885('0x2b')];if(!_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x32')](_0xa885('0x33'))){_0x1c94ab[_0xa885('0x1e')]=qs[_0xa885('0x1e')](_0x5c4ca7[_0xa885('0x2c')]['limit']);_0x1c94ab['offset']=qs[_0xa885('0x1f')](_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x1f')]);}_0x1c94ab[_0xa885('0x34')]=qs[_0xa885('0x35')](_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x35')]);_0x1c94ab[_0xa885('0x36')]=qs[_0xa885('0x2e')](_['pick'](_0x5c4ca7['query'],_0x3e9e22[_0xa885('0x2e')]),_0x17c0eb);if(_0x5c4ca7['query']['filter']){_0x1c94ab[_0xa885('0x36')]=_['merge'](_0x1c94ab[_0xa885('0x36')],{'$or':_[_0xa885('0x28')](_0x17c0eb,function(_0x39503d){if(_0x39503d[_0xa885('0x2a')]!==_0xa885('0x37')){var _0xc35213={};_0xc35213[_0x39503d[_0xa885('0x27')]]={'$like':'%'+_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x38')]+'%'};return _0xc35213;}})});}_0x1c94ab=_[_0xa885('0x39')]({},_0x1c94ab,_0x5c4ca7['options']);var _0x30759d={'where':_0x1c94ab[_0xa885('0x36')]};return db[_0xa885('0x29')][_0xa885('0x3a')](_0x30759d)[_0xa885('0x24')](function(_0x5e327f){_0x3af5d9['count']=_0x5e327f;if(_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x3b')]){_0x1c94ab[_0xa885('0x3c')]=[{'all':!![]}];}return db[_0xa885('0x29')][_0xa885('0x3d')](_0x1c94ab);})['then'](function(_0x1f2a71){_0x3af5d9[_0xa885('0x3e')]=_0x1f2a71;return _0x3af5d9;})['then'](respondWithFilteredResult(_0x4fc438,_0x1c94ab))['catch'](handleError(_0x4fc438,null));};exports[_0xa885('0x3f')]=function(_0x299baf,_0x4da64c){var _0x561bf0={'raw':!![],'where':{'id':_0x299baf[_0xa885('0x40')]['id']}},_0x1089e5={};_0x1089e5[_0xa885('0x2b')]=_[_0xa885('0x2d')](db[_0xa885('0x29')][_0xa885('0x41')]);_0x1089e5[_0xa885('0x2c')]=_[_0xa885('0x2d')](_0x299baf[_0xa885('0x2c')]);_0x1089e5[_0xa885('0x2e')]=_[_0xa885('0x2f')](_0x1089e5['model'],_0x1089e5[_0xa885('0x2c')]);_0x561bf0[_0xa885('0x31')]=_[_0xa885('0x2f')](_0x1089e5['model'],qs[_0xa885('0x30')](_0x299baf[_0xa885('0x2c')][_0xa885('0x30')]));_0x561bf0[_0xa885('0x31')]=_0x561bf0['attributes'][_0xa885('0x42')]?_0x561bf0['attributes']:_0x1089e5[_0xa885('0x2b')];if(_0x299baf[_0xa885('0x2c')]['includeAll']){_0x561bf0[_0xa885('0x3c')]=[{'all':!![]}];}_0x561bf0=_[_0xa885('0x39')]({},_0x561bf0,_0x299baf[_0xa885('0x43')]);return db[_0xa885('0x29')][_0xa885('0x44')](_0x561bf0)['then'](handleEntityNotFound(_0x4da64c,null))[_0xa885('0x24')](respondWithResult(_0x4da64c,null))[_0xa885('0x45')](handleError(_0x4da64c,null));};exports[_0xa885('0x46')]=function(_0x51f4df,_0x4d146e){return db['Cdr'][_0xa885('0x46')](_0x51f4df[_0xa885('0x47')],{})[_0xa885('0x24')](respondWithResult(_0x4d146e,0xc9))[_0xa885('0x45')](handleError(_0x4d146e,null));};exports[_0xa885('0x23')]=function(_0x49aa9b,_0x43245c){if(_0x49aa9b[_0xa885('0x47')]['id']){delete _0x49aa9b[_0xa885('0x47')]['id'];}return db[_0xa885('0x29')][_0xa885('0x44')]({'where':{'id':_0x49aa9b['params']['id']}})['then'](handleEntityNotFound(_0x43245c,null))['then'](saveUpdates(_0x49aa9b[_0xa885('0x47')],null))[_0xa885('0x24')](respondWithResult(_0x43245c,null))[_0xa885('0x45')](handleError(_0x43245c,null));};exports[_0xa885('0x48')]=function(_0x164d9d,_0x66a035){return db[_0xa885('0x29')]['find']({'where':{'id':_0x164d9d[_0xa885('0x40')]['id']}})[_0xa885('0x24')](handleEntityNotFound(_0x66a035,null))[_0xa885('0x24')](removeEntity(_0x66a035,null))[_0xa885('0x45')](handleError(_0x66a035,null));};exports[_0xa885('0x49')]=function(_0x1bd3a2,_0x159d12){return db['Cdr'][_0xa885('0x49')]()[_0xa885('0x24')](respondWithResult(_0x159d12,null))[_0xa885('0x45')](handleError(_0x159d12,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b2db896..9b97f81 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(_0x2fbc1c,_0x1d800d){var _0x814de7=function(_0x4291ad){while(--_0x4291ad){_0x2fbc1c['push'](_0x2fbc1c['shift']());}};_0x814de7(++_0x1d800d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x275981,_0x303dcc){var _0x12c333=function(_0x33c5fb){while(--_0x33c5fb){_0x275981['push'](_0x275981['shift']());}};_0x12c333(++_0x303dcc);}(_0x7a54,0x106));var _0x47a5=function(_0x11fa52,_0x62aa2f){_0x11fa52=_0x11fa52-0x0;var _0x1afad2=_0x7a54[_0x11fa52];return _0x1afad2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 637c37c..f7efde0 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 _0xd97e=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0xd97e,0x9e));var _0xed97=function(_0x3a5efb,_0x1c55a5){_0x3a5efb=_0x3a5efb-0x0;var _0x1a5c2f=_0xd97e[_0x3a5efb];return _0x1a5c2f;};'use strict';var _=require(_0xed97('0x0'));var util=require(_0xed97('0x1'));var moment=require(_0xed97('0x2'));var BPromise=require(_0xed97('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed97('0x4'));var db=require(_0xed97('0x5'))['db'];var utils=require(_0xed97('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xed97('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed97('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35864e,_0x1ee472,_0x241999){return new BPromise(function(_0x15e6cf,_0x14ac86){return client[_0xed97('0x9')](_0x35864e,_0x241999)['then'](function(_0x2fd913){logger['info'](_0xed97('0xa'),_0x1ee472,_0xed97('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1ee472,_0xed97('0xb'),JSON[_0xed97('0xc')](_0x2fd913));if(_0x2fd913[_0xed97('0xd')]){if(_0x2fd913[_0xed97('0xd')][_0xed97('0xe')]===0x1f4){logger[_0xed97('0xd')](_0xed97('0xa'),_0x1ee472,_0x2fd913[_0xed97('0xd')][_0xed97('0xf')]);return _0x14ac86(_0x2fd913[_0xed97('0xd')][_0xed97('0xf')]);}logger['error'](_0xed97('0xa'),_0x1ee472,_0x2fd913[_0xed97('0xd')]['message']);return _0x15e6cf(_0x2fd913[_0xed97('0xd')][_0xed97('0xf')]);}else{logger[_0xed97('0x10')]('Cdr,\x20%s,\x20%s',_0x1ee472,'request\x20sent');_0x15e6cf(_0x2fd913['result']['message']);}})[_0xed97('0x11')](function(_0x3664e0){logger[_0xed97('0xd')](_0xed97('0xa'),_0x1ee472,_0x3664e0);_0x14ac86(_0x3664e0);});});} \ No newline at end of file +var _0xce99=['Cdr,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xb78b9a,_0x3693bc){var _0x291888=function(_0x23190a){while(--_0x23190a){_0xb78b9a['push'](_0xb78b9a['shift']());}};_0x291888(++_0x3693bc);}(_0xce99,0x138));var _0x9ce9=function(_0x2d0f26,_0x209a8c){_0x2d0f26=_0x2d0f26-0x0;var _0x35dfd5=_0xce99[_0x2d0f26];return _0x35dfd5;};'use strict';var _=require(_0x9ce9('0x0'));var util=require(_0x9ce9('0x1'));var moment=require(_0x9ce9('0x2'));var BPromise=require(_0x9ce9('0x3'));var rs=require(_0x9ce9('0x4'));var fs=require('fs');var Redis=require(_0x9ce9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ce9('0x6'));var logger=require(_0x9ce9('0x7'))(_0x9ce9('0x8'));var config=require(_0x9ce9('0x9'));var jayson=require(_0x9ce9('0xa'));var client=jayson[_0x9ce9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x580add,_0xc5869c,_0x2e3da2){return new BPromise(function(_0x337cca,_0x31dce3){return client[_0x9ce9('0xc')](_0x580add,_0x2e3da2)[_0x9ce9('0xd')](function(_0x2fdaa4){logger[_0x9ce9('0xe')](_0x9ce9('0xf'),_0xc5869c,_0x9ce9('0x10'));logger[_0x9ce9('0x11')](_0x9ce9('0x12'),_0xc5869c,_0x9ce9('0x10'),JSON['stringify'](_0x2fdaa4));if(_0x2fdaa4[_0x9ce9('0x13')]){if(_0x2fdaa4[_0x9ce9('0x13')]['code']===0x1f4){logger[_0x9ce9('0x13')](_0x9ce9('0xf'),_0xc5869c,_0x2fdaa4[_0x9ce9('0x13')][_0x9ce9('0x14')]);return _0x31dce3(_0x2fdaa4[_0x9ce9('0x13')][_0x9ce9('0x14')]);}logger[_0x9ce9('0x13')](_0x9ce9('0xf'),_0xc5869c,_0x2fdaa4[_0x9ce9('0x13')][_0x9ce9('0x14')]);return _0x337cca(_0x2fdaa4[_0x9ce9('0x13')][_0x9ce9('0x14')]);}else{logger[_0x9ce9('0xe')]('Cdr,\x20%s,\x20%s',_0xc5869c,'request\x20sent');_0x337cca(_0x2fdaa4['result'][_0x9ce9('0x14')]);}})[_0x9ce9('0x15')](function(_0x40cd33){logger[_0x9ce9('0x13')](_0x9ce9('0xf'),_0xc5869c,_0x40cd33);_0x31dce3(_0x40cd33);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 07d5faa..5209ca8 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(_0x20410e,_0x11ea83){var _0x18e1cc=function(_0x58a0f0){while(--_0x58a0f0){_0x20410e['push'](_0x20410e['shift']());}};_0x18e1cc(++_0x11ea83);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x574c35,_0x2a1658){var _0x3ace87=function(_0x1a4035){while(--_0x1a4035){_0x574c35['push'](_0x574c35['shift']());}};_0x3ace87(++_0x2a1658);}(_0xb10b,0x12a));var _0xbb10=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0xb10b[_0xcbe787];return _0x4c78fa;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f878bd1..c9d5f39 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 _0x0924=['INTEGER','STRING','noop','TEXT','exports'];(function(_0xf7f96f,_0x132272){var _0x324a98=function(_0x22ebd3){while(--_0x22ebd3){_0xf7f96f['push'](_0xf7f96f['shift']());}};_0x324a98(++_0x132272);}(_0x0924,0x77));var _0x4092=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x0924[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require('sequelize');module[_0x4092('0x0')]={'priority':{'type':Sequelize[_0x4092('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4092('0x2')],'allowNull':![],'defaultValue':_0x4092('0x3')},'appdata':{'type':Sequelize[_0x4092('0x4')]()},'description':{'type':Sequelize[_0x4092('0x2')]},'interval':{'type':Sequelize[_0x4092('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4300=['STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x4300,0x99));var _0x0430=function(_0x5ee02e,_0x170ab6){_0x5ee02e=_0x5ee02e-0x0;var _0x206e55=_0x4300[_0x5ee02e];return _0x206e55;};'use strict';var Sequelize=require(_0x0430('0x0'));module[_0x0430('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0430('0x2')],'allowNull':![],'defaultValue':_0x0430('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0430('0x2')]},'interval':{'type':Sequelize[_0x0430('0x2')],'defaultValue':_0x0430('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index eab6aff..e33d3bc 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 _0xd52d=['../../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','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','ChatApplication','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4feb3c,_0x128498){var _0x2744cf=function(_0x5b400){while(--_0x5b400){_0x4feb3c['push'](_0x4feb3c['shift']());}};_0x2744cf(++_0x128498);}(_0xd52d,0x1c7));var _0xdd52=function(_0x1a3cce,_0x1ebd46){_0x1a3cce=_0x1a3cce-0x0;var _0x1782a0=_0xd52d[_0x1a3cce];return _0x1782a0;};'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={'raw':!![],'where':{'id':_0x3f96bd[_0xdd52('0x2a')]['id']}},_0x499e14={};_0x499e14[_0xdd52('0x2b')]=_[_0xdd52('0x2c')](db['ChatApplication']['rawAttributes']);_0x499e14[_0xdd52('0x2d')]=_['keys'](_0x3f96bd[_0xdd52('0x2d')]);_0x499e14[_0xdd52('0x2e')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],_0x499e14[_0xdd52('0x2d')]);_0x539418[_0xdd52('0x30')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],qs[_0xdd52('0x31')](_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x31')]));_0x539418[_0xdd52('0x30')]=_0x539418[_0xdd52('0x30')][_0xdd52('0x32')]?_0x539418[_0xdd52('0x30')]:_0x499e14[_0xdd52('0x2b')];if(_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x33')]){_0x539418[_0xdd52('0x34')]=[{'all':!![]}];}_0x539418=_[_0xdd52('0x35')]({},_0x539418,_0x3f96bd[_0xdd52('0x36')]);return db['ChatApplication'][_0xdd52('0x37')](_0x539418)[_0xdd52('0x24')](handleEntityNotFound(_0xeb81a0,null))['then'](respondWithResult(_0xeb81a0,null))['catch'](handleError(_0xeb81a0,null));};exports['update']=function(_0x17f735,_0x10d053){if(_0x17f735[_0xdd52('0x38')]['id']){delete _0x17f735[_0xdd52('0x38')]['id'];}return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x17f735[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x10d053,null))[_0xdd52('0x24')](saveUpdates(_0x17f735[_0xdd52('0x38')],null))['then'](respondWithResult(_0x10d053,null))[_0xdd52('0x3a')](handleError(_0x10d053,null));};exports[_0xdd52('0x25')]=function(_0x19ab35,_0x3497c3){return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x19ab35[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x3497c3,null))[_0xdd52('0x24')](removeEntity(_0x3497c3,null))[_0xdd52('0x3a')](handleError(_0x3497c3,null));}; \ No newline at end of file +var _0x43fd=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','reject','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x14df8c,_0xa43c02){var _0x4b1247=function(_0x24c37b){while(--_0x24c37b){_0x14df8c['push'](_0x14df8c['shift']());}};_0x4b1247(++_0xa43c02);}(_0x43fd,0x150));var _0xd43f=function(_0x53ad9a,_0x2bfcc6){_0x53ad9a=_0x53ad9a-0x0;var _0x474c67=_0x43fd[_0x53ad9a];return _0x474c67;};'use strict';var emlformat=require(_0xd43f('0x0'));var rimraf=require(_0xd43f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd43f('0x2'));var rp=require('request-promise');var moment=require(_0xd43f('0x3'));var BPromise=require(_0xd43f('0x4'));var Mustache=require(_0xd43f('0x5'));var util=require(_0xd43f('0x6'));var path=require(_0xd43f('0x7'));var sox=require(_0xd43f('0x8'));var csv=require(_0xd43f('0x9'));var ejs=require(_0xd43f('0xa'));var fs=require('fs');var fs_extra=require(_0xd43f('0xb'));var _=require(_0xd43f('0xc'));var squel=require(_0xd43f('0xd'));var crypto=require(_0xd43f('0xe'));var jsforce=require(_0xd43f('0xf'));var deskjs=require(_0xd43f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd43f('0x11'));var Papa=require(_0xd43f('0x12'));var Redis=require(_0xd43f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd43f('0x14'));var as=require(_0xd43f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd43f('0x16'))(_0xd43f('0x17'));var utils=require(_0xd43f('0x18'));var config=require(_0xd43f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be74e,_0xed42ff){_0xed42ff=_0xed42ff||0xcc;return function(_0x5b90a7){if(_0x5b90a7){return _0x3be74e[_0xd43f('0x1a')](_0xed42ff);}return _0x3be74e['status'](_0xed42ff)['end']();};}function respondWithResult(_0x28fe2d,_0x12bd82){_0x12bd82=_0x12bd82||0xc8;return function(_0x568087){if(_0x568087){return _0x28fe2d[_0xd43f('0x1b')](_0x12bd82)[_0xd43f('0x1c')](_0x568087);}};}function respondWithFilteredResult(_0x54f136,_0x229f81){return function(_0x351c9c){if(_0x351c9c){var _0x10f584=typeof _0x229f81[_0xd43f('0x1d')]===_0xd43f('0x1e')&&typeof _0x229f81['limit']==='undefined';var _0x5c03a6=_0x351c9c[_0xd43f('0x1f')];var _0x22d86f=_0x10f584?0x0:_0x229f81[_0xd43f('0x1d')];var _0x2e2396=_0x10f584?_0x351c9c['count']:_0x229f81[_0xd43f('0x1d')]+_0x229f81[_0xd43f('0x20')];var _0x263e9a;if(_0x2e2396>=_0x5c03a6){_0x2e2396=_0x5c03a6;_0x263e9a=0xc8;}else{_0x263e9a=0xce;}_0x54f136[_0xd43f('0x1b')](_0x263e9a);return _0x54f136[_0xd43f('0x21')]('Content-Range',_0x22d86f+'-'+_0x2e2396+'/'+_0x5c03a6)[_0xd43f('0x1c')](_0x351c9c);}return null;};}function patchUpdates(_0x5bae9e){return function(_0x1ad9d3){try{jsonpatch['apply'](_0x1ad9d3,_0x5bae9e,!![]);}catch(_0x1ce702){return BPromise[_0xd43f('0x22')](_0x1ce702);}return _0x1ad9d3['save']();};}function saveUpdates(_0x37da4a,_0x1c79b8){return function(_0x15a7d9){if(_0x15a7d9){return _0x15a7d9['update'](_0x37da4a)[_0xd43f('0x23')](function(_0x51c68c){return _0x51c68c;});}return null;};}function removeEntity(_0x3ff3dc,_0x4646c2){return function(_0x1bf18d){if(_0x1bf18d){return _0x1bf18d[_0xd43f('0x24')]()[_0xd43f('0x23')](function(){_0x3ff3dc[_0xd43f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cf19f,_0x4750c3){return function(_0x30d7a3){if(!_0x30d7a3){_0x3cf19f[_0xd43f('0x1a')](0x194);}return _0x30d7a3;};}function handleError(_0x3381b6,_0x2f7769){_0x2f7769=_0x2f7769||0x1f4;return function(_0x2df5b4){logger[_0xd43f('0x25')](_0x2df5b4[_0xd43f('0x26')]);if(_0x2df5b4[_0xd43f('0x27')]){delete _0x2df5b4['name'];}_0x3381b6[_0xd43f('0x1b')](_0x2f7769)[_0xd43f('0x28')](_0x2df5b4);};}exports[_0xd43f('0x29')]=function(_0x1215cf,_0x82103b){var _0x30d1dc={'raw':!![],'where':{'id':_0x1215cf[_0xd43f('0x2a')]['id']}},_0x4efdb5={};_0x4efdb5[_0xd43f('0x2b')]=_[_0xd43f('0x2c')](db[_0xd43f('0x2d')][_0xd43f('0x2e')]);_0x4efdb5[_0xd43f('0x2f')]=_[_0xd43f('0x2c')](_0x1215cf[_0xd43f('0x2f')]);_0x4efdb5[_0xd43f('0x30')]=_['intersection'](_0x4efdb5[_0xd43f('0x2b')],_0x4efdb5[_0xd43f('0x2f')]);_0x30d1dc['attributes']=_[_0xd43f('0x31')](_0x4efdb5['model'],qs[_0xd43f('0x32')](_0x1215cf['query'][_0xd43f('0x32')]));_0x30d1dc['attributes']=_0x30d1dc[_0xd43f('0x33')]['length']?_0x30d1dc[_0xd43f('0x33')]:_0x4efdb5[_0xd43f('0x2b')];if(_0x1215cf['query'][_0xd43f('0x34')]){_0x30d1dc[_0xd43f('0x35')]=[{'all':!![]}];}_0x30d1dc=_[_0xd43f('0x36')]({},_0x30d1dc,_0x1215cf[_0xd43f('0x37')]);return db[_0xd43f('0x2d')][_0xd43f('0x38')](_0x30d1dc)['then'](handleEntityNotFound(_0x82103b,null))[_0xd43f('0x23')](respondWithResult(_0x82103b,null))[_0xd43f('0x39')](handleError(_0x82103b,null));};exports['update']=function(_0x12f22f,_0x15759d){if(_0x12f22f[_0xd43f('0x3a')]['id']){delete _0x12f22f[_0xd43f('0x3a')]['id'];}return db[_0xd43f('0x2d')]['find']({'where':{'id':_0x12f22f[_0xd43f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x15759d,null))[_0xd43f('0x23')](saveUpdates(_0x12f22f[_0xd43f('0x3a')],null))[_0xd43f('0x23')](respondWithResult(_0x15759d,null))[_0xd43f('0x39')](handleError(_0x15759d,null));};exports[_0xd43f('0x24')]=function(_0x400fa5,_0x4b6608){return db[_0xd43f('0x2d')][_0xd43f('0x38')]({'where':{'id':_0x400fa5['params']['id']}})[_0xd43f('0x23')](handleEntityNotFound(_0x4b6608,null))[_0xd43f('0x23')](removeEntity(_0x4b6608,null))[_0xd43f('0x39')](handleError(_0x4b6608,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9bbeff8..ea545f5 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 _0xec1b=['../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22de09,_0x3db597){var _0x4a13dc=function(_0x2b02eb){while(--_0x2b02eb){_0x22de09['push'](_0x22de09['shift']());}};_0x4a13dc(++_0x3db597);}(_0xec1b,0xf5));var _0xbec1=function(_0xe5b3e1,_0x57a645){_0xe5b3e1=_0xe5b3e1-0x0;var _0x121dad=_0xec1b[_0xe5b3e1];return _0x121dad;};'use strict';var _=require('lodash');var util=require(_0xbec1('0x0'));var logger=require('../../config/logger')(_0xbec1('0x1'));var moment=require(_0xbec1('0x2'));var BPromise=require(_0xbec1('0x3'));var rp=require(_0xbec1('0x4'));var fs=require('fs');var path=require(_0xbec1('0x5'));var rimraf=require(_0xbec1('0x6'));var config=require(_0xbec1('0x7'));var attributes=require('./chatApplication.attributes');module[_0xbec1('0x8')]=function(_0x4edd94,_0x9d1bbe){return _0x4edd94[_0xbec1('0x9')](_0xbec1('0xa'),attributes,{'tableName':_0xbec1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbec1('0xc'),'collate':_0xbec1('0xd')});}; \ No newline at end of file +var _0xbe79=['api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger'];(function(_0x1e2115,_0x3a2d14){var _0x9ce664=function(_0x24cafd){while(--_0x24cafd){_0x1e2115['push'](_0x1e2115['shift']());}};_0x9ce664(++_0x3a2d14);}(_0xbe79,0x169));var _0x9be7=function(_0x2c1d7a,_0x148f5a){_0x2c1d7a=_0x2c1d7a-0x0;var _0x4f258b=_0xbe79[_0x2c1d7a];return _0x4f258b;};'use strict';var _=require(_0x9be7('0x0'));var util=require(_0x9be7('0x1'));var logger=require(_0x9be7('0x2'))(_0x9be7('0x3'));var moment=require(_0x9be7('0x4'));var BPromise=require('bluebird');var rp=require(_0x9be7('0x5'));var fs=require('fs');var path=require(_0x9be7('0x6'));var rimraf=require(_0x9be7('0x7'));var config=require(_0x9be7('0x8'));var attributes=require(_0x9be7('0x9'));module[_0x9be7('0xa')]=function(_0x57b111,_0x2ddcb5){return _0x57b111[_0x9be7('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9be7('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 9d8ff56..fc3dc58 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 _0xf285=['info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x53bd0a,_0xd5ecab){var _0x54b119=function(_0x35a586){while(--_0x35a586){_0x53bd0a['push'](_0x53bd0a['shift']());}};_0x54b119(++_0xd5ecab);}(_0xf285,0x159));var _0x5f28=function(_0x389e9a,_0x52005d){_0x389e9a=_0x389e9a-0x0;var _0x1ce51a=_0xf285[_0x389e9a];return _0x1ce51a;};'use strict';var _=require(_0x5f28('0x0'));var util=require(_0x5f28('0x1'));var moment=require(_0x5f28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f28('0x3'));var db=require(_0x5f28('0x4'))['db'];var utils=require(_0x5f28('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5f28('0x6'));var client=jayson[_0x5f28('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32544f,_0x4ed56c,_0x4733b9){return new BPromise(function(_0x56b779,_0x2c293f){return client[_0x5f28('0x8')](_0x32544f,_0x4733b9)['then'](function(_0x413396){logger['info'](_0x5f28('0x9'),_0x4ed56c,'request\x20sent');logger[_0x5f28('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4ed56c,_0x5f28('0xb'),JSON[_0x5f28('0xc')](_0x413396));if(_0x413396[_0x5f28('0xd')]){if(_0x413396['error']['code']===0x1f4){logger[_0x5f28('0xd')](_0x5f28('0x9'),_0x4ed56c,_0x413396['error'][_0x5f28('0xe')]);return _0x2c293f(_0x413396[_0x5f28('0xd')][_0x5f28('0xe')]);}logger['error'](_0x5f28('0x9'),_0x4ed56c,_0x413396[_0x5f28('0xd')]['message']);return _0x56b779(_0x413396['error'][_0x5f28('0xe')]);}else{logger[_0x5f28('0xf')](_0x5f28('0x9'),_0x4ed56c,'request\x20sent');_0x56b779(_0x413396[_0x5f28('0x10')][_0x5f28('0xe')]);}})[_0x5f28('0x11')](function(_0x5b0d7d){logger[_0x5f28('0xd')](_0x5f28('0x9'),_0x4ed56c,_0x5b0d7d);_0x2c293f(_0x5b0d7d);});});} \ No newline at end of file +var _0xa2fd=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4e90ff,_0x1cbed2){var _0x29f031=function(_0xbd9648){while(--_0xbd9648){_0x4e90ff['push'](_0x4e90ff['shift']());}};_0x29f031(++_0x1cbed2);}(_0xa2fd,0x177));var _0xda2f=function(_0x1878a1,_0x1ead6c){_0x1878a1=_0x1878a1-0x0;var _0x563c42=_0xa2fd[_0x1878a1];return _0x563c42;};'use strict';var _=require(_0xda2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda2f('0x1'));var rs=require(_0xda2f('0x2'));var fs=require('fs');var Redis=require(_0xda2f('0x3'));var db=require(_0xda2f('0x4'))['db'];var utils=require(_0xda2f('0x5'));var logger=require(_0xda2f('0x6'))(_0xda2f('0x7'));var config=require('../../config/environment');var jayson=require(_0xda2f('0x8'));var client=jayson['client'][_0xda2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b816b,_0x57a56a,_0xedbd0b){return new BPromise(function(_0x300635,_0x33751c){return client[_0xda2f('0xa')](_0x4b816b,_0xedbd0b)['then'](function(_0x2445a5){logger['info'](_0xda2f('0xb'),_0x57a56a,_0xda2f('0xc'));logger[_0xda2f('0xd')](_0xda2f('0xe'),_0x57a56a,_0xda2f('0xc'),JSON[_0xda2f('0xf')](_0x2445a5));if(_0x2445a5[_0xda2f('0x10')]){if(_0x2445a5['error'][_0xda2f('0x11')]===0x1f4){logger[_0xda2f('0x10')](_0xda2f('0xb'),_0x57a56a,_0x2445a5[_0xda2f('0x10')][_0xda2f('0x12')]);return _0x33751c(_0x2445a5[_0xda2f('0x10')][_0xda2f('0x12')]);}logger[_0xda2f('0x10')](_0xda2f('0xb'),_0x57a56a,_0x2445a5[_0xda2f('0x10')][_0xda2f('0x12')]);return _0x300635(_0x2445a5[_0xda2f('0x10')][_0xda2f('0x12')]);}else{logger[_0xda2f('0x13')](_0xda2f('0xb'),_0x57a56a,_0xda2f('0xc'));_0x300635(_0x2445a5[_0xda2f('0x14')][_0xda2f('0x12')]);}})[_0xda2f('0x15')](function(_0x1fea1c){logger[_0xda2f('0x10')]('ChatApplication,\x20%s,\x20%s',_0x57a56a,_0x1fea1c);_0x33751c(_0x1fea1c);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b8246d3..fab09a9 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 _0xda11=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','show','put','isAuthenticated','delete'];(function(_0x3fd487,_0x5017a4){var _0x3142fd=function(_0x58dbc4){while(--_0x58dbc4){_0x3fd487['push'](_0x3fd487['shift']());}};_0x3142fd(++_0x5017a4);}(_0xda11,0x141));var _0x1da1=function(_0x172bfb,_0x69024b){_0x172bfb=_0x172bfb-0x0;var _0x2796b9=_0xda11[_0x172bfb];return _0x2796b9;};'use strict';var multer=require(_0x1da1('0x0'));var util=require(_0x1da1('0x1'));var path=require(_0x1da1('0x2'));var timeout=require(_0x1da1('0x3'));var express=require(_0x1da1('0x4'));var router=express['Router']();var fs_extra=require(_0x1da1('0x5'));var auth=require(_0x1da1('0x6'));var interaction=require(_0x1da1('0x7'));var config=require('../../config/environment');var controller=require(_0x1da1('0x8'));router[_0x1da1('0x9')](_0x1da1('0xa'),auth['isAuthenticated'](),controller[_0x1da1('0xb')]);router[_0x1da1('0xc')]('/:id',auth[_0x1da1('0xd')](),controller['update']);router[_0x1da1('0xe')](_0x1da1('0xa'),auth[_0x1da1('0xd')](),controller[_0x1da1('0xf')]);module['exports']=router; \ No newline at end of file +var _0x45e0=['update','delete','exports','multer','util','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','put','isAuthenticated'];(function(_0x315104,_0x3c08d2){var _0x8ca6ce=function(_0x2136a4){while(--_0x2136a4){_0x315104['push'](_0x315104['shift']());}};_0x8ca6ce(++_0x3c08d2);}(_0x45e0,0xe0));var _0x045e=function(_0x5203f3,_0x231e6d){_0x5203f3=_0x5203f3-0x0;var _0x48296a=_0x45e0[_0x5203f3];return _0x48296a;};'use strict';var multer=require(_0x045e('0x0'));var util=require(_0x045e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x045e('0x2')]();var fs_extra=require(_0x045e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x045e('0x4'));var config=require('../../config/environment');var controller=require(_0x045e('0x5'));router[_0x045e('0x6')](_0x045e('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x045e('0x8')](_0x045e('0x7'),auth[_0x045e('0x9')](),controller[_0x045e('0xa')]);router[_0x045e('0xb')](_0x045e('0x7'),auth[_0x045e('0x9')](),controller['destroy']);module[_0x045e('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 46112ea..3e9c35b 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 _0x97bf=['sequelize','exports','STRING','BOOLEAN'];(function(_0x44ff8c,_0x5d4d9c){var _0x132903=function(_0x46868d){while(--_0x46868d){_0x44ff8c['push'](_0x44ff8c['shift']());}};_0x132903(++_0x5d4d9c);}(_0x97bf,0x188));var _0xf97b=function(_0x24d740,_0x55ec91){_0x24d740=_0x24d740-0x0;var _0x44f1fb=_0x97bf[_0x24d740];return _0x44f1fb;};'use strict';var Sequelize=require(_0xf97b('0x0'));module[_0xf97b('0x1')]={'name':{'type':Sequelize[_0xf97b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf97b('0x2')]},'write':{'type':Sequelize[_0xf97b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd668=['STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd668,0x18e));var _0x8d66=function(_0x44bbac,_0x5299a4){_0x44bbac=_0x44bbac-0x0;var _0x32216b=_0xd668[_0x44bbac];return _0x32216b;};'use strict';var Sequelize=require(_0x8d66('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d66('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8d66('0x1')]},'write':{'type':Sequelize[_0x8d66('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 4b59977..124ad1b 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 _0x22ec=['name','send','index','ChatGroup','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','find','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','filters','map','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatGroup.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','update','then','end','sendStatus','stack'];(function(_0x598bc1,_0x543990){var _0x14625d=function(_0x568ae7){while(--_0x568ae7){_0x598bc1['push'](_0x598bc1['shift']());}};_0x14625d(++_0x543990);}(_0x22ec,0xf6));var _0xc22e=function(_0x2ec530,_0x7c548d){_0x2ec530=_0x2ec530-0x0;var _0x12182a=_0x22ec[_0x2ec530];return _0x12182a;};'use strict';var emlformat=require(_0xc22e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc22e('0x1'));var jsonpatch=require(_0xc22e('0x2'));var rp=require(_0xc22e('0x3'));var moment=require(_0xc22e('0x4'));var BPromise=require(_0xc22e('0x5'));var Mustache=require(_0xc22e('0x6'));var util=require('util');var path=require(_0xc22e('0x7'));var sox=require(_0xc22e('0x8'));var csv=require(_0xc22e('0x9'));var ejs=require(_0xc22e('0xa'));var fs=require('fs');var fs_extra=require(_0xc22e('0xb'));var _=require(_0xc22e('0xc'));var squel=require(_0xc22e('0xd'));var crypto=require(_0xc22e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc22e('0xf'));var Papa=require('papaparse');var Redis=require(_0xc22e('0x10'));var authService=require(_0xc22e('0x11'));var qs=require(_0xc22e('0x12'));var as=require(_0xc22e('0x13'));var hardwareService=require(_0xc22e('0x14'));var logger=require(_0xc22e('0x15'))(_0xc22e('0x16'));var utils=require(_0xc22e('0x17'));var config=require(_0xc22e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc22e('0x19'))['db'];config['redis']=_[_0xc22e('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc22e('0x1b'))(new Redis(config[_0xc22e('0x1c')]));require(_0xc22e('0x1d'))[_0xc22e('0x1e')](socket);function respondWithStatusCode(_0xdbb01b,_0x188580){_0x188580=_0x188580||0xcc;return function(_0x1404b3){if(_0x1404b3){return _0xdbb01b['sendStatus'](_0x188580);}return _0xdbb01b['status'](_0x188580)['end']();};}function respondWithResult(_0x3166e1,_0x432b33){_0x432b33=_0x432b33||0xc8;return function(_0x4a50df){if(_0x4a50df){return _0x3166e1[_0xc22e('0x1f')](_0x432b33)[_0xc22e('0x20')](_0x4a50df);}};}function respondWithFilteredResult(_0x275267,_0x28a415){return function(_0x25133a){if(_0x25133a){var _0x12deaa=typeof _0x28a415[_0xc22e('0x21')]==='undefined'&&typeof _0x28a415[_0xc22e('0x22')]===_0xc22e('0x23');var _0x3524c=_0x25133a['count'];var _0x11380a=_0x12deaa?0x0:_0x28a415[_0xc22e('0x21')];var _0x30a393=_0x12deaa?_0x25133a[_0xc22e('0x24')]:_0x28a415[_0xc22e('0x21')]+_0x28a415[_0xc22e('0x22')];var _0xb627b1;if(_0x30a393>=_0x3524c){_0x30a393=_0x3524c;_0xb627b1=0xc8;}else{_0xb627b1=0xce;}_0x275267[_0xc22e('0x1f')](_0xb627b1);return _0x275267[_0xc22e('0x25')]('Content-Range',_0x11380a+'-'+_0x30a393+'/'+_0x3524c)[_0xc22e('0x20')](_0x25133a);}return null;};}function patchUpdates(_0x32883b){return function(_0x4700f9){try{jsonpatch[_0xc22e('0x26')](_0x4700f9,_0x32883b,!![]);}catch(_0x552a24){return BPromise[_0xc22e('0x27')](_0x552a24);}return _0x4700f9['save']();};}function saveUpdates(_0x3ae7a0,_0x46448c){return function(_0x3b5a5f){if(_0x3b5a5f){return _0x3b5a5f[_0xc22e('0x28')](_0x3ae7a0)[_0xc22e('0x29')](function(_0x1ff06c){return _0x1ff06c;});}return null;};}function removeEntity(_0x496d22,_0x2f480a){return function(_0x33e684){if(_0x33e684){return _0x33e684['destroy']()['then'](function(){_0x496d22[_0xc22e('0x1f')](0xcc)[_0xc22e('0x2a')]();});}};}function handleEntityNotFound(_0x3141ac,_0x5865a5){return function(_0x45756e){if(!_0x45756e){_0x3141ac[_0xc22e('0x2b')](0x194);}return _0x45756e;};}function handleError(_0x5a084b,_0x1a624c){_0x1a624c=_0x1a624c||0x1f4;return function(_0x4b9a3e){logger['error'](_0x4b9a3e[_0xc22e('0x2c')]);if(_0x4b9a3e[_0xc22e('0x2d')]){delete _0x4b9a3e[_0xc22e('0x2d')];}_0x5a084b['status'](_0x1a624c)[_0xc22e('0x2e')](_0x4b9a3e);};}exports[_0xc22e('0x2f')]=function(_0x437980,_0x5bcd75){var _0x3a21d3={},_0x104da1={},_0x24f587={'count':0x0,'rows':[]};var _0x22d86a=_['map'](db[_0xc22e('0x30')]['rawAttributes'],function(_0x33fe4f){return{'name':_0x33fe4f[_0xc22e('0x31')],'type':_0x33fe4f[_0xc22e('0x32')][_0xc22e('0x33')]};});_0x104da1['model']=_['map'](_0x22d86a,'name');_0x104da1[_0xc22e('0x34')]=_[_0xc22e('0x35')](_0x437980['query']);_0x104da1['filters']=_[_0xc22e('0x36')](_0x104da1[_0xc22e('0x37')],_0x104da1[_0xc22e('0x34')]);_0x3a21d3[_0xc22e('0x38')]=_['intersection'](_0x104da1['model'],qs[_0xc22e('0x39')](_0x437980[_0xc22e('0x34')][_0xc22e('0x39')]));_0x3a21d3[_0xc22e('0x38')]=_0x3a21d3['attributes'][_0xc22e('0x3a')]?_0x3a21d3[_0xc22e('0x38')]:_0x104da1[_0xc22e('0x37')];if(!_0x437980['query'][_0xc22e('0x3b')](_0xc22e('0x3c'))){_0x3a21d3[_0xc22e('0x22')]=qs['limit'](_0x437980[_0xc22e('0x34')][_0xc22e('0x22')]);_0x3a21d3[_0xc22e('0x21')]=qs[_0xc22e('0x21')](_0x437980[_0xc22e('0x34')][_0xc22e('0x21')]);}_0x3a21d3[_0xc22e('0x3d')]=qs[_0xc22e('0x3e')](_0x437980[_0xc22e('0x34')][_0xc22e('0x3e')]);_0x3a21d3[_0xc22e('0x3f')]=qs['filters'](_[_0xc22e('0x40')](_0x437980[_0xc22e('0x34')],_0x104da1['filters']),_0x22d86a);if(_0x437980[_0xc22e('0x34')][_0xc22e('0x41')]){_0x3a21d3[_0xc22e('0x3f')]=_[_0xc22e('0x42')](_0x3a21d3[_0xc22e('0x3f')],{'$or':_['map'](_0x22d86a,function(_0x43b39c){if(_0x43b39c['type']!==_0xc22e('0x43')){var _0x474147={};_0x474147[_0x43b39c[_0xc22e('0x2d')]]={'$like':'%'+_0x437980[_0xc22e('0x34')][_0xc22e('0x41')]+'%'};return _0x474147;}})});}_0x3a21d3=_['merge']({},_0x3a21d3,_0x437980[_0xc22e('0x44')]);var _0x4ecaea={'where':_0x3a21d3[_0xc22e('0x3f')]};return db[_0xc22e('0x30')]['count'](_0x4ecaea)[_0xc22e('0x29')](function(_0x20f4e2){_0x24f587['count']=_0x20f4e2;if(_0x437980[_0xc22e('0x34')][_0xc22e('0x45')]){_0x3a21d3['include']=[{'all':!![]}];}return db['ChatGroup'][_0xc22e('0x46')](_0x3a21d3);})[_0xc22e('0x29')](function(_0x29c765){_0x24f587[_0xc22e('0x47')]=_0x29c765;return _0x24f587;})['then'](respondWithFilteredResult(_0x5bcd75,_0x3a21d3))[_0xc22e('0x48')](handleError(_0x5bcd75,null));};exports['show']=function(_0x567c62,_0x441b7d){var _0x44e4cf={'raw':!![],'where':{'id':_0x567c62[_0xc22e('0x49')]['id']}},_0x4cfc66={};_0x4cfc66[_0xc22e('0x37')]=_[_0xc22e('0x35')](db[_0xc22e('0x30')]['rawAttributes']);_0x4cfc66['query']=_[_0xc22e('0x35')](_0x567c62['query']);_0x4cfc66['filters']=_[_0xc22e('0x36')](_0x4cfc66[_0xc22e('0x37')],_0x4cfc66['query']);_0x44e4cf[_0xc22e('0x38')]=_[_0xc22e('0x36')](_0x4cfc66[_0xc22e('0x37')],qs[_0xc22e('0x39')](_0x567c62[_0xc22e('0x34')]['fields']));_0x44e4cf['attributes']=_0x44e4cf[_0xc22e('0x38')]['length']?_0x44e4cf[_0xc22e('0x38')]:_0x4cfc66[_0xc22e('0x37')];if(_0x567c62[_0xc22e('0x34')][_0xc22e('0x45')]){_0x44e4cf[_0xc22e('0x4a')]=[{'all':!![]}];}_0x44e4cf=_[_0xc22e('0x42')]({},_0x44e4cf,_0x567c62['options']);return db[_0xc22e('0x30')]['find'](_0x44e4cf)[_0xc22e('0x29')](handleEntityNotFound(_0x441b7d,null))[_0xc22e('0x29')](respondWithResult(_0x441b7d,null))[_0xc22e('0x48')](handleError(_0x441b7d,null));};exports[_0xc22e('0x4b')]=function(_0x31ba83,_0x127e6a){return db[_0xc22e('0x30')][_0xc22e('0x4b')](_0x31ba83['body'],{})[_0xc22e('0x29')](respondWithResult(_0x127e6a,0xc9))[_0xc22e('0x48')](handleError(_0x127e6a,null));};exports[_0xc22e('0x28')]=function(_0x259578,_0x4ba0b3){if(_0x259578[_0xc22e('0x4c')]['id']){delete _0x259578[_0xc22e('0x4c')]['id'];}return db[_0xc22e('0x30')][_0xc22e('0x4d')]({'where':{'id':_0x259578[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x4ba0b3,null))[_0xc22e('0x29')](saveUpdates(_0x259578[_0xc22e('0x4c')],null))[_0xc22e('0x29')](respondWithResult(_0x4ba0b3,null))[_0xc22e('0x48')](handleError(_0x4ba0b3,null));};exports['destroy']=function(_0x2b7772,_0x5334ed){return db[_0xc22e('0x30')][_0xc22e('0x4d')]({'where':{'id':_0x2b7772[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x5334ed,null))[_0xc22e('0x29')](removeEntity(_0x5334ed,null))[_0xc22e('0x48')](handleError(_0x5334ed,null));};exports[_0xc22e('0x4e')]=function(_0x58cbf9,_0x1ca7c1){return db[_0xc22e('0x30')][_0xc22e('0x4e')]()[_0xc22e('0x29')](respondWithResult(_0x1ca7c1,null))[_0xc22e('0x48')](handleError(_0x1ca7c1,null));};exports['getUnread']=function(_0x2ec5fa,_0x4c3ba9,_0x21793e){return db[_0xc22e('0x4f')][_0xc22e('0x24')]({'where':{'ChatGroupId':_0x2ec5fa[_0xc22e('0x49')]['id'],'ToId':_0x2ec5fa[_0xc22e('0x50')]['id'],'read':![]}})[_0xc22e('0x29')](function(_0x231f24){return{'id':_['toInteger'](_0x2ec5fa[_0xc22e('0x49')]['id']),'count':_0x231f24};})[_0xc22e('0x29')](respondWithResult(_0x4c3ba9,null))['catch'](handleError(_0x4c3ba9,null));};exports[_0xc22e('0x51')]=function(_0x38430b,_0x6edcb6,_0x312faa){return db[_0xc22e('0x30')][_0xc22e('0x4d')]({'where':{'id':_0x38430b[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x6edcb6,null))['then'](function(_0x1dc2c4){if(_0x1dc2c4){return _0x1dc2c4['addMembers'](_0x38430b[_0xc22e('0x4c')][_0xc22e('0x52')],_[_0xc22e('0x53')](_0x38430b['body'],[_0xc22e('0x52'),'id'])||{});}})[_0xc22e('0x29')](respondWithResult(_0x6edcb6,null))['catch'](handleError(_0x6edcb6,null));};exports[_0xc22e('0x54')]=function(_0x3ddf93,_0x512669,_0x19ce06){var _0x401da1={};var _0x58d659={};var _0x1621f6;var _0x1cf296;return db[_0xc22e('0x30')][_0xc22e('0x55')]({'where':{'id':_0x3ddf93[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x512669,null))[_0xc22e('0x29')](function(_0x1cad7f){if(_0x1cad7f){_0x1621f6=_0x1cad7f;_0x58d659['model']=_[_0xc22e('0x35')](db[_0xc22e('0x56')][_0xc22e('0x57')]);_0x58d659[_0xc22e('0x34')]=_['keys'](_0x3ddf93['query']);_0x58d659[_0xc22e('0x58')]=_['intersection'](_0x58d659['model'],_0x58d659[_0xc22e('0x34')]);_0x401da1[_0xc22e('0x38')]=_[_0xc22e('0x36')](_0x58d659[_0xc22e('0x37')],qs[_0xc22e('0x39')](_0x3ddf93['query'][_0xc22e('0x39')]));_0x401da1[_0xc22e('0x38')]=_0x401da1[_0xc22e('0x38')][_0xc22e('0x3a')]?_0x401da1[_0xc22e('0x38')]:_0x58d659[_0xc22e('0x37')];_0x401da1['order']=qs[_0xc22e('0x3e')](_0x3ddf93[_0xc22e('0x34')][_0xc22e('0x3e')]);_0x401da1[_0xc22e('0x3f')]=qs[_0xc22e('0x58')](_['pick'](_0x3ddf93[_0xc22e('0x34')],_0x58d659['filters']));if(_0x3ddf93[_0xc22e('0x34')][_0xc22e('0x41')]){_0x401da1[_0xc22e('0x3f')]=_[_0xc22e('0x42')](_0x401da1[_0xc22e('0x3f')],{'$or':_[_0xc22e('0x59')](_0x401da1['attributes'],function(_0x438932){var _0x3a5803={};_0x3a5803[_0x438932]={'$like':'%'+_0x3ddf93['query'][_0xc22e('0x41')]+'%'};return _0x3a5803;})});}_0x401da1=_[_0xc22e('0x42')]({},_0x401da1,_0x3ddf93['options']);return _0x1621f6['getMembers'](_0x401da1);}})[_0xc22e('0x29')](function(_0x369a36){if(_0x369a36){_0x1cf296=_0x369a36[_0xc22e('0x3a')];if(!_0x3ddf93['query'][_0xc22e('0x3b')](_0xc22e('0x3c'))){_0x401da1['limit']=qs[_0xc22e('0x22')](_0x3ddf93[_0xc22e('0x34')][_0xc22e('0x22')]);_0x401da1['offset']=qs['offset'](_0x3ddf93['query'][_0xc22e('0x21')]);}return _0x1621f6['getMembers'](_0x401da1);}})['then'](function(_0x35015b){if(_0x35015b){return _0x35015b?{'count':_0x1cf296,'rows':_0x35015b}:null;}})[_0xc22e('0x29')](respondWithResult(_0x512669,null))[_0xc22e('0x48')](handleError(_0x512669,null));};exports[_0xc22e('0x5a')]=function(_0x30db78,_0x51a883,_0x494ce7){return db[_0xc22e('0x30')][_0xc22e('0x4d')]({'where':{'id':_0x30db78[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x51a883,null))[_0xc22e('0x29')](function(_0x57131a){if(_0x57131a){return _0x57131a['removeMembers'](_0x30db78[_0xc22e('0x34')][_0xc22e('0x52')]);}})[_0xc22e('0x29')](respondWithStatusCode(_0x51a883,null))[_0xc22e('0x48')](handleError(_0x51a883,null));};exports['addMessage']=function(_0xa838cb,_0x521077,_0x1b570d){if(_0xa838cb[_0xc22e('0x4c')]['id']){delete _0xa838cb['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0xa838cb[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x521077,null))[_0xc22e('0x29')](function(_0x41c1be){if(_0x41c1be){_0xa838cb[_0xc22e('0x4c')][_0xc22e('0x5b')]=_0x41c1be['id'];return db[_0xc22e('0x4f')][_0xc22e('0x4b')](_0xa838cb[_0xc22e('0x4c')]);}})[_0xc22e('0x29')](respondWithResult(_0x521077,null))[_0xc22e('0x48')](handleError(_0x521077,null));};exports['getMessages']=function(_0x4ce44e,_0x1f9461,_0x18fa78){var _0x48c2ea={};var _0x409993={};var _0x69c0fd;var _0x33b59d;return db[_0xc22e('0x30')][_0xc22e('0x55')]({'where':{'id':_0x4ce44e[_0xc22e('0x49')]['id']}})[_0xc22e('0x29')](handleEntityNotFound(_0x1f9461,null))['then'](function(_0x5c691a){if(_0x5c691a){_0x69c0fd=_0x5c691a;_0x409993[_0xc22e('0x37')]=_[_0xc22e('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x409993['query']=_[_0xc22e('0x35')](_0x4ce44e[_0xc22e('0x34')]);_0x409993[_0xc22e('0x58')]=_[_0xc22e('0x36')](_0x409993['model'],_0x409993[_0xc22e('0x34')]);_0x48c2ea[_0xc22e('0x38')]=_[_0xc22e('0x36')](_0x409993['model'],qs[_0xc22e('0x39')](_0x4ce44e['query'][_0xc22e('0x39')]));_0x48c2ea[_0xc22e('0x38')]=_0x48c2ea['attributes'][_0xc22e('0x3a')]?_0x48c2ea[_0xc22e('0x38')]:_0x409993[_0xc22e('0x37')];_0x48c2ea['order']=qs[_0xc22e('0x3e')](_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x3e')]);_0x48c2ea['where']=qs[_0xc22e('0x58')](_[_0xc22e('0x40')](_0x4ce44e[_0xc22e('0x34')],_0x409993[_0xc22e('0x58')]));if(_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x41')]){_0x48c2ea[_0xc22e('0x3f')]=_['merge'](_0x48c2ea[_0xc22e('0x3f')],{'$or':_[_0xc22e('0x59')](_0x48c2ea[_0xc22e('0x38')],function(_0x4c2091){var _0x40d931={};_0x40d931[_0x4c2091]={'$like':'%'+_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x41')]+'%'};return _0x40d931;})});}if(_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x5c')]){var _0x30ea4c=_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x5c')][_0xc22e('0x5d')](',');var _0xef0b80={};_0xef0b80[_0x30ea4c[0x0]]={'$gte':moment(_0x30ea4c[0x1])[_0xc22e('0x5e')](_0xc22e('0x5f'))};_0x48c2ea[_0xc22e('0x3f')]=_[_0xc22e('0x42')](_0x48c2ea[_0xc22e('0x3f')],_0xef0b80);}_0x48c2ea=_[_0xc22e('0x42')]({},_0x48c2ea,_0x4ce44e[_0xc22e('0x44')]);return _0x69c0fd['getMessages'](_0x48c2ea);}})[_0xc22e('0x29')](function(_0x26fc95){if(_0x26fc95){_0x33b59d=_0x26fc95[_0xc22e('0x3a')];if(!_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x3b')](_0xc22e('0x3c'))){_0x48c2ea['limit']=qs[_0xc22e('0x22')](_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x22')]);_0x48c2ea['offset']=qs[_0xc22e('0x21')](_0x4ce44e[_0xc22e('0x34')][_0xc22e('0x21')]);}return _0x69c0fd[_0xc22e('0x60')](_0x48c2ea);}})['then'](function(_0x26e8cf){if(_0x26e8cf){return _0x26e8cf?{'count':_0x33b59d,'rows':_0x26e8cf}:null;}})['then'](respondWithResult(_0x1f9461,null))[_0xc22e('0x48')](handleError(_0x1f9461,null));}; \ No newline at end of file +var _0xc27e=['include','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','map','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','request-promise','bluebird','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','catch','params'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xc27e,0x7d));var _0xec27=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc27e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xec27('0x0'));var rimraf=require(_0xec27('0x1'));var zipdir=require(_0xec27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec27('0x3'));var moment=require('moment');var BPromise=require(_0xec27('0x4'));var Mustache=require(_0xec27('0x5'));var util=require(_0xec27('0x6'));var path=require(_0xec27('0x7'));var sox=require(_0xec27('0x8'));var csv=require(_0xec27('0x9'));var ejs=require(_0xec27('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec27('0xb'));var squel=require(_0xec27('0xc'));var crypto=require(_0xec27('0xd'));var jsforce=require(_0xec27('0xe'));var deskjs=require(_0xec27('0xf'));var toCsv=require(_0xec27('0x9'));var querystring=require(_0xec27('0x10'));var Papa=require('papaparse');var Redis=require(_0xec27('0x11'));var authService=require(_0xec27('0x12'));var qs=require(_0xec27('0x13'));var as=require(_0xec27('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec27('0x15'))(_0xec27('0x16'));var utils=require(_0xec27('0x17'));var config=require(_0xec27('0x18'));var licenseUtil=require(_0xec27('0x19'));var db=require(_0xec27('0x1a'))['db'];config[_0xec27('0x1b')]=_['defaults'](config[_0xec27('0x1b')],{'host':_0xec27('0x1c'),'port':0x18eb});var socket=require(_0xec27('0x1d'))(new Redis(config[_0xec27('0x1b')]));require(_0xec27('0x1e'))['register'](socket);function respondWithStatusCode(_0x41b8ad,_0x427193){_0x427193=_0x427193||0xcc;return function(_0x1a34b9){if(_0x1a34b9){return _0x41b8ad['sendStatus'](_0x427193);}return _0x41b8ad['status'](_0x427193)[_0xec27('0x1f')]();};}function respondWithResult(_0x20257b,_0x24bcf3){_0x24bcf3=_0x24bcf3||0xc8;return function(_0x5df6f7){if(_0x5df6f7){return _0x20257b[_0xec27('0x20')](_0x24bcf3)[_0xec27('0x21')](_0x5df6f7);}};}function respondWithFilteredResult(_0x36b1b3,_0x3e360b){return function(_0x364f6c){if(_0x364f6c){var _0x3b6606=typeof _0x3e360b[_0xec27('0x22')]===_0xec27('0x23')&&typeof _0x3e360b[_0xec27('0x24')]==='undefined';var _0x93c619=_0x364f6c[_0xec27('0x25')];var _0x42a89c=_0x3b6606?0x0:_0x3e360b[_0xec27('0x22')];var _0x3b1585=_0x3b6606?_0x364f6c[_0xec27('0x25')]:_0x3e360b['offset']+_0x3e360b[_0xec27('0x24')];var _0x5ceaa0;if(_0x3b1585>=_0x93c619){_0x3b1585=_0x93c619;_0x5ceaa0=0xc8;}else{_0x5ceaa0=0xce;}_0x36b1b3[_0xec27('0x20')](_0x5ceaa0);return _0x36b1b3[_0xec27('0x26')](_0xec27('0x27'),_0x42a89c+'-'+_0x3b1585+'/'+_0x93c619)[_0xec27('0x21')](_0x364f6c);}return null;};}function patchUpdates(_0x2d5d30){return function(_0x16d6b8){try{jsonpatch['apply'](_0x16d6b8,_0x2d5d30,!![]);}catch(_0x3a1506){return BPromise[_0xec27('0x28')](_0x3a1506);}return _0x16d6b8[_0xec27('0x29')]();};}function saveUpdates(_0x44e594,_0x17e954){return function(_0xb708ef){if(_0xb708ef){return _0xb708ef[_0xec27('0x2a')](_0x44e594)[_0xec27('0x2b')](function(_0x255d42){return _0x255d42;});}return null;};}function removeEntity(_0x468a82,_0x419abb){return function(_0x28bb7f){if(_0x28bb7f){return _0x28bb7f[_0xec27('0x2c')]()[_0xec27('0x2b')](function(){_0x468a82[_0xec27('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f5389,_0x33c9d6){return function(_0x122aa5){if(!_0x122aa5){_0x4f5389[_0xec27('0x2d')](0x194);}return _0x122aa5;};}function handleError(_0x1b4169,_0x5bad00){_0x5bad00=_0x5bad00||0x1f4;return function(_0x35e19b){logger[_0xec27('0x2e')](_0x35e19b[_0xec27('0x2f')]);if(_0x35e19b[_0xec27('0x30')]){delete _0x35e19b[_0xec27('0x30')];}_0x1b4169['status'](_0x5bad00)[_0xec27('0x31')](_0x35e19b);};}exports[_0xec27('0x32')]=function(_0x5738fb,_0x18440d){var _0x4c4a2e={},_0x16e745={},_0x464757={'count':0x0,'rows':[]};var _0x2dcea9=_['map'](db[_0xec27('0x33')][_0xec27('0x34')],function(_0x27f4c1){return{'name':_0x27f4c1[_0xec27('0x35')],'type':_0x27f4c1[_0xec27('0x36')][_0xec27('0x37')]};});_0x16e745[_0xec27('0x38')]=_['map'](_0x2dcea9,'name');_0x16e745[_0xec27('0x39')]=_[_0xec27('0x3a')](_0x5738fb[_0xec27('0x39')]);_0x16e745[_0xec27('0x3b')]=_[_0xec27('0x3c')](_0x16e745[_0xec27('0x38')],_0x16e745[_0xec27('0x39')]);_0x4c4a2e[_0xec27('0x3d')]=_['intersection'](_0x16e745[_0xec27('0x38')],qs['fields'](_0x5738fb[_0xec27('0x39')][_0xec27('0x3e')]));_0x4c4a2e[_0xec27('0x3d')]=_0x4c4a2e['attributes'][_0xec27('0x3f')]?_0x4c4a2e[_0xec27('0x3d')]:_0x16e745[_0xec27('0x38')];if(!_0x5738fb['query']['hasOwnProperty']('nolimit')){_0x4c4a2e[_0xec27('0x24')]=qs[_0xec27('0x24')](_0x5738fb['query']['limit']);_0x4c4a2e[_0xec27('0x22')]=qs[_0xec27('0x22')](_0x5738fb['query'][_0xec27('0x22')]);}_0x4c4a2e[_0xec27('0x40')]=qs[_0xec27('0x41')](_0x5738fb[_0xec27('0x39')][_0xec27('0x41')]);_0x4c4a2e[_0xec27('0x42')]=qs[_0xec27('0x3b')](_[_0xec27('0x43')](_0x5738fb[_0xec27('0x39')],_0x16e745[_0xec27('0x3b')]),_0x2dcea9);if(_0x5738fb[_0xec27('0x39')]['filter']){_0x4c4a2e[_0xec27('0x42')]=_[_0xec27('0x44')](_0x4c4a2e[_0xec27('0x42')],{'$or':_['map'](_0x2dcea9,function(_0x56c7c4){if(_0x56c7c4[_0xec27('0x36')]!==_0xec27('0x45')){var _0x546c32={};_0x546c32[_0x56c7c4[_0xec27('0x30')]]={'$like':'%'+_0x5738fb['query'][_0xec27('0x46')]+'%'};return _0x546c32;}})});}_0x4c4a2e=_[_0xec27('0x44')]({},_0x4c4a2e,_0x5738fb['options']);var _0x51a186={'where':_0x4c4a2e[_0xec27('0x42')]};return db[_0xec27('0x33')][_0xec27('0x25')](_0x51a186)[_0xec27('0x2b')](function(_0x5bdbdb){_0x464757['count']=_0x5bdbdb;if(_0x5738fb[_0xec27('0x39')][_0xec27('0x47')]){_0x4c4a2e['include']=[{'all':!![]}];}return db[_0xec27('0x33')][_0xec27('0x48')](_0x4c4a2e);})[_0xec27('0x2b')](function(_0x11a1cd){_0x464757['rows']=_0x11a1cd;return _0x464757;})[_0xec27('0x2b')](respondWithFilteredResult(_0x18440d,_0x4c4a2e))[_0xec27('0x49')](handleError(_0x18440d,null));};exports['show']=function(_0x18c9be,_0x3623d5){var _0x43b01f={'raw':!![],'where':{'id':_0x18c9be[_0xec27('0x4a')]['id']}},_0x2b3ba6={};_0x2b3ba6[_0xec27('0x38')]=_[_0xec27('0x3a')](db[_0xec27('0x33')][_0xec27('0x34')]);_0x2b3ba6[_0xec27('0x39')]=_[_0xec27('0x3a')](_0x18c9be[_0xec27('0x39')]);_0x2b3ba6[_0xec27('0x3b')]=_['intersection'](_0x2b3ba6[_0xec27('0x38')],_0x2b3ba6[_0xec27('0x39')]);_0x43b01f[_0xec27('0x3d')]=_[_0xec27('0x3c')](_0x2b3ba6[_0xec27('0x38')],qs['fields'](_0x18c9be[_0xec27('0x39')]['fields']));_0x43b01f[_0xec27('0x3d')]=_0x43b01f[_0xec27('0x3d')]['length']?_0x43b01f[_0xec27('0x3d')]:_0x2b3ba6[_0xec27('0x38')];if(_0x18c9be['query'][_0xec27('0x47')]){_0x43b01f[_0xec27('0x4b')]=[{'all':!![]}];}_0x43b01f=_[_0xec27('0x44')]({},_0x43b01f,_0x18c9be[_0xec27('0x4c')]);return db['ChatGroup'][_0xec27('0x4d')](_0x43b01f)[_0xec27('0x2b')](handleEntityNotFound(_0x3623d5,null))['then'](respondWithResult(_0x3623d5,null))[_0xec27('0x49')](handleError(_0x3623d5,null));};exports[_0xec27('0x4e')]=function(_0x545e70,_0x33886a){return db[_0xec27('0x33')][_0xec27('0x4e')](_0x545e70[_0xec27('0x4f')],{})[_0xec27('0x2b')](respondWithResult(_0x33886a,0xc9))[_0xec27('0x49')](handleError(_0x33886a,null));};exports['update']=function(_0x255c77,_0x249b26){if(_0x255c77['body']['id']){delete _0x255c77['body']['id'];}return db[_0xec27('0x33')][_0xec27('0x4d')]({'where':{'id':_0x255c77['params']['id']}})['then'](handleEntityNotFound(_0x249b26,null))['then'](saveUpdates(_0x255c77['body'],null))[_0xec27('0x2b')](respondWithResult(_0x249b26,null))[_0xec27('0x49')](handleError(_0x249b26,null));};exports['destroy']=function(_0x5311ce,_0x3afa76){return db[_0xec27('0x33')][_0xec27('0x4d')]({'where':{'id':_0x5311ce[_0xec27('0x4a')]['id']}})[_0xec27('0x2b')](handleEntityNotFound(_0x3afa76,null))['then'](removeEntity(_0x3afa76,null))[_0xec27('0x49')](handleError(_0x3afa76,null));};exports[_0xec27('0x50')]=function(_0xd37bd3,_0x45456e){return db['ChatGroup']['describe']()[_0xec27('0x2b')](respondWithResult(_0x45456e,null))[_0xec27('0x49')](handleError(_0x45456e,null));};exports[_0xec27('0x51')]=function(_0x4cc638,_0x4cef52,_0x57a2c2){return db[_0xec27('0x52')]['count']({'where':{'ChatGroupId':_0x4cc638['params']['id'],'ToId':_0x4cc638[_0xec27('0x53')]['id'],'read':![]}})[_0xec27('0x2b')](function(_0x3f57ef){return{'id':_[_0xec27('0x54')](_0x4cc638[_0xec27('0x4a')]['id']),'count':_0x3f57ef};})['then'](respondWithResult(_0x4cef52,null))[_0xec27('0x49')](handleError(_0x4cef52,null));};exports[_0xec27('0x55')]=function(_0x36478a,_0x129760,_0x4bdd58){return db['ChatGroup'][_0xec27('0x4d')]({'where':{'id':_0x36478a['params']['id']}})[_0xec27('0x2b')](handleEntityNotFound(_0x129760,null))[_0xec27('0x2b')](function(_0x4ce445){if(_0x4ce445){return _0x4ce445[_0xec27('0x55')](_0x36478a[_0xec27('0x4f')][_0xec27('0x56')],_[_0xec27('0x57')](_0x36478a[_0xec27('0x4f')],[_0xec27('0x56'),'id'])||{});}})['then'](respondWithResult(_0x129760,null))[_0xec27('0x49')](handleError(_0x129760,null));};exports[_0xec27('0x58')]=function(_0x5ea398,_0x12f603,_0x32d9b7){var _0x39798b={};var _0x13d132={};var _0x5cb77b;var _0x38f4f5;return db['ChatGroup'][_0xec27('0x59')]({'where':{'id':_0x5ea398[_0xec27('0x4a')]['id']}})[_0xec27('0x2b')](handleEntityNotFound(_0x12f603,null))['then'](function(_0x4a6feb){if(_0x4a6feb){_0x5cb77b=_0x4a6feb;_0x13d132['model']=_['keys'](db['User'][_0xec27('0x34')]);_0x13d132[_0xec27('0x39')]=_[_0xec27('0x3a')](_0x5ea398['query']);_0x13d132['filters']=_[_0xec27('0x3c')](_0x13d132['model'],_0x13d132[_0xec27('0x39')]);_0x39798b[_0xec27('0x3d')]=_['intersection'](_0x13d132['model'],qs[_0xec27('0x3e')](_0x5ea398[_0xec27('0x39')][_0xec27('0x3e')]));_0x39798b['attributes']=_0x39798b[_0xec27('0x3d')][_0xec27('0x3f')]?_0x39798b[_0xec27('0x3d')]:_0x13d132['model'];_0x39798b[_0xec27('0x40')]=qs[_0xec27('0x41')](_0x5ea398[_0xec27('0x39')][_0xec27('0x41')]);_0x39798b[_0xec27('0x42')]=qs[_0xec27('0x3b')](_[_0xec27('0x43')](_0x5ea398[_0xec27('0x39')],_0x13d132[_0xec27('0x3b')]));if(_0x5ea398[_0xec27('0x39')][_0xec27('0x46')]){_0x39798b[_0xec27('0x42')]=_[_0xec27('0x44')](_0x39798b[_0xec27('0x42')],{'$or':_[_0xec27('0x5a')](_0x39798b[_0xec27('0x3d')],function(_0xa93056){var _0x446008={};_0x446008[_0xa93056]={'$like':'%'+_0x5ea398[_0xec27('0x39')]['filter']+'%'};return _0x446008;})});}_0x39798b=_[_0xec27('0x44')]({},_0x39798b,_0x5ea398[_0xec27('0x4c')]);return _0x5cb77b[_0xec27('0x58')](_0x39798b);}})[_0xec27('0x2b')](function(_0x125083){if(_0x125083){_0x38f4f5=_0x125083[_0xec27('0x3f')];if(!_0x5ea398[_0xec27('0x39')][_0xec27('0x5b')]('nolimit')){_0x39798b[_0xec27('0x24')]=qs['limit'](_0x5ea398['query'][_0xec27('0x24')]);_0x39798b[_0xec27('0x22')]=qs[_0xec27('0x22')](_0x5ea398[_0xec27('0x39')][_0xec27('0x22')]);}return _0x5cb77b[_0xec27('0x58')](_0x39798b);}})[_0xec27('0x2b')](function(_0x44c54b){if(_0x44c54b){return _0x44c54b?{'count':_0x38f4f5,'rows':_0x44c54b}:null;}})[_0xec27('0x2b')](respondWithResult(_0x12f603,null))['catch'](handleError(_0x12f603,null));};exports[_0xec27('0x5c')]=function(_0x2686a3,_0x540ab9,_0x558978){return db[_0xec27('0x33')][_0xec27('0x4d')]({'where':{'id':_0x2686a3['params']['id']}})['then'](handleEntityNotFound(_0x540ab9,null))['then'](function(_0x34da2e){if(_0x34da2e){return _0x34da2e['removeMembers'](_0x2686a3[_0xec27('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x540ab9,null))[_0xec27('0x49')](handleError(_0x540ab9,null));};exports[_0xec27('0x5d')]=function(_0x41e31d,_0x19a31e,_0xb79c3){if(_0x41e31d['body']['id']){delete _0x41e31d[_0xec27('0x4f')]['id'];}return db[_0xec27('0x33')][_0xec27('0x4d')]({'where':{'id':_0x41e31d[_0xec27('0x4a')]['id']}})[_0xec27('0x2b')](handleEntityNotFound(_0x19a31e,null))[_0xec27('0x2b')](function(_0x58934d){if(_0x58934d){_0x41e31d[_0xec27('0x4f')][_0xec27('0x5e')]=_0x58934d['id'];return db[_0xec27('0x52')]['create'](_0x41e31d[_0xec27('0x4f')]);}})[_0xec27('0x2b')](respondWithResult(_0x19a31e,null))[_0xec27('0x49')](handleError(_0x19a31e,null));};exports[_0xec27('0x5f')]=function(_0x2927ad,_0x76dd33,_0x1e2bda){var _0xf4b388={};var _0x34dece={};var _0x437cf1;var _0x109967;return db['ChatGroup'][_0xec27('0x59')]({'where':{'id':_0x2927ad[_0xec27('0x4a')]['id']}})[_0xec27('0x2b')](handleEntityNotFound(_0x76dd33,null))[_0xec27('0x2b')](function(_0x19cea1){if(_0x19cea1){_0x437cf1=_0x19cea1;_0x34dece[_0xec27('0x38')]=_[_0xec27('0x3a')](db[_0xec27('0x52')][_0xec27('0x34')]);_0x34dece[_0xec27('0x39')]=_['keys'](_0x2927ad[_0xec27('0x39')]);_0x34dece[_0xec27('0x3b')]=_['intersection'](_0x34dece['model'],_0x34dece[_0xec27('0x39')]);_0xf4b388[_0xec27('0x3d')]=_[_0xec27('0x3c')](_0x34dece[_0xec27('0x38')],qs[_0xec27('0x3e')](_0x2927ad['query'][_0xec27('0x3e')]));_0xf4b388['attributes']=_0xf4b388[_0xec27('0x3d')]['length']?_0xf4b388[_0xec27('0x3d')]:_0x34dece['model'];_0xf4b388['order']=qs['sort'](_0x2927ad['query']['sort']);_0xf4b388[_0xec27('0x42')]=qs['filters'](_[_0xec27('0x43')](_0x2927ad[_0xec27('0x39')],_0x34dece['filters']));if(_0x2927ad[_0xec27('0x39')][_0xec27('0x46')]){_0xf4b388['where']=_[_0xec27('0x44')](_0xf4b388[_0xec27('0x42')],{'$or':_[_0xec27('0x5a')](_0xf4b388[_0xec27('0x3d')],function(_0x50e4cf){var _0x47a7f3={};_0x47a7f3[_0x50e4cf]={'$like':'%'+_0x2927ad['query'][_0xec27('0x46')]+'%'};return _0x47a7f3;})});}if(_0x2927ad[_0xec27('0x39')]['$gte']){var _0x42887e=_0x2927ad[_0xec27('0x39')][_0xec27('0x60')][_0xec27('0x61')](',');var _0x440f99={};_0x440f99[_0x42887e[0x0]]={'$gte':moment(_0x42887e[0x1])['format'](_0xec27('0x62'))};_0xf4b388[_0xec27('0x42')]=_['merge'](_0xf4b388[_0xec27('0x42')],_0x440f99);}_0xf4b388=_[_0xec27('0x44')]({},_0xf4b388,_0x2927ad['options']);return _0x437cf1[_0xec27('0x5f')](_0xf4b388);}})[_0xec27('0x2b')](function(_0x52c389){if(_0x52c389){_0x109967=_0x52c389[_0xec27('0x3f')];if(!_0x2927ad[_0xec27('0x39')][_0xec27('0x5b')](_0xec27('0x63'))){_0xf4b388['limit']=qs[_0xec27('0x24')](_0x2927ad['query'][_0xec27('0x24')]);_0xf4b388[_0xec27('0x22')]=qs['offset'](_0x2927ad[_0xec27('0x39')][_0xec27('0x22')]);}return _0x437cf1[_0xec27('0x5f')](_0xf4b388);}})[_0xec27('0x2b')](function(_0x4a9761){if(_0x4a9761){return _0x4a9761?{'count':_0x109967,'rows':_0x4a9761}:null;}})[_0xec27('0x2b')](respondWithResult(_0x76dd33,null))[_0xec27('0x49')](handleError(_0x76dd33,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6c03db5..f8ecddd 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 _0x03cf=['hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0xedf830,_0x33ad86){var _0x51a23f=function(_0x6d9740){while(--_0x6d9740){_0xedf830['push'](_0xedf830['shift']());}};_0x51a23f(++_0x33ad86);}(_0x03cf,0x67));var _0xf03c=function(_0x3472f2,_0xf7a0c8){_0x3472f2=_0x3472f2-0x0;var _0x3689a5=_0x03cf[_0x3472f2];return _0x3689a5;};'use strict';var EventEmitter=require(_0xf03c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xf03c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf03c('0x2')](0x0);var events={'afterCreate':_0xf03c('0x3'),'afterUpdate':_0xf03c('0x4'),'afterDestroy':_0xf03c('0x5')};function emitEvent(_0x255c45){return function(_0x2b934f,_0x45d0ae,_0x507b29){ChatGroupEvents[_0xf03c('0x6')](_0x255c45+':'+_0x2b934f['id'],_0x2b934f);ChatGroupEvents[_0xf03c('0x6')](_0x255c45,_0x2b934f);_0x507b29(null);};}for(var e in events){if(events[_0xf03c('0x7')](e)){var event=events[e];ChatGroup[_0xf03c('0x8')](e,emitEvent(event));}}module[_0xf03c('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xa77e=['hasOwnProperty','hook','events','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0xbe5d6b,_0x439324){var _0x210aa0=function(_0x19755d){while(--_0x19755d){_0xbe5d6b['push'](_0xbe5d6b['shift']());}};_0x210aa0(++_0x439324);}(_0xa77e,0x197));var _0xea77=function(_0x32d122,_0x3effeb){_0x32d122=_0x32d122-0x0;var _0x16d0fe=_0xa77e[_0x32d122];return _0x16d0fe;};'use strict';var EventEmitter=require(_0xea77('0x0'));var ChatGroup=require(_0xea77('0x1'))['db'][_0xea77('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea77('0x3'),'afterUpdate':_0xea77('0x4'),'afterDestroy':_0xea77('0x5')};function emitEvent(_0x3475a1){return function(_0x30d29a,_0x15970e,_0x3b7a0f){ChatGroupEvents['emit'](_0x3475a1+':'+_0x30d29a['id'],_0x30d29a);ChatGroupEvents[_0xea77('0x6')](_0x3475a1,_0x30d29a);_0x3b7a0f(null);};}for(var e in events){if(events[_0xea77('0x7')](e)){var event=events[e];ChatGroup[_0xea77('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1e170f0..6cf708a 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 _0xaa3f=['define','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x439897,_0x37c3dc){var _0x5c3ba6=function(_0x4d2a46){while(--_0x4d2a46){_0x439897['push'](_0x439897['shift']());}};_0x5c3ba6(++_0x37c3dc);}(_0xaa3f,0x9e));var _0xfaa3=function(_0x132216,_0x1a4fa2){_0x132216=_0x132216-0x0;var _0x2e6ad6=_0xaa3f[_0x132216];return _0x2e6ad6;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require('bluebird');var rp=require(_0xfaa3('0x5'));var fs=require('fs');var path=require(_0xfaa3('0x6'));var rimraf=require(_0xfaa3('0x7'));var config=require(_0xfaa3('0x8'));var attributes=require(_0xfaa3('0x9'));module[_0xfaa3('0xa')]=function(_0x55852a,_0x524bab){return _0x55852a[_0xfaa3('0xb')]('ChatGroup',attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fae=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups'];(function(_0xc8c149,_0x104184){var _0x261259=function(_0x314df3){while(--_0x314df3){_0xc8c149['push'](_0xc8c149['shift']());}};_0x261259(++_0x104184);}(_0x3fae,0xbb));var _0xe3fa=function(_0x468289,_0x6aee23){_0x468289=_0x468289-0x0;var _0x54e03f=_0x3fae[_0x468289];return _0x54e03f;};'use strict';var _=require('lodash');var util=require(_0xe3fa('0x0'));var logger=require('../../config/logger')(_0xe3fa('0x1'));var moment=require(_0xe3fa('0x2'));var BPromise=require(_0xe3fa('0x3'));var rp=require(_0xe3fa('0x4'));var fs=require('fs');var path=require(_0xe3fa('0x5'));var rimraf=require(_0xe3fa('0x6'));var config=require(_0xe3fa('0x7'));var attributes=require(_0xe3fa('0x8'));module['exports']=function(_0x4851d4,_0x24e236){return _0x4851d4[_0xe3fa('0x9')]('ChatGroup',attributes,{'tableName':_0xe3fa('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 8430fde..8264dd9 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 _0xf3ff=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x45b5bd,_0x1b2655){var _0x1af8bb=function(_0x16d485){while(--_0x16d485){_0x45b5bd['push'](_0x45b5bd['shift']());}};_0x1af8bb(++_0x1b2655);}(_0xf3ff,0xae));var _0xff3f=function(_0x55d7a4,_0x1dd9d2){_0x55d7a4=_0x55d7a4-0x0;var _0x682d27=_0xf3ff[_0x55d7a4];return _0x682d27;};'use strict';var _=require(_0xff3f('0x0'));var util=require('util');var moment=require(_0xff3f('0x1'));var BPromise=require(_0xff3f('0x2'));var rs=require(_0xff3f('0x3'));var fs=require('fs');var Redis=require(_0xff3f('0x4'));var db=require(_0xff3f('0x5'))['db'];var utils=require(_0xff3f('0x6'));var logger=require('../../config/logger')(_0xff3f('0x7'));var config=require(_0xff3f('0x8'));var jayson=require(_0xff3f('0x9'));var client=jayson['client'][_0xff3f('0xa')]({'port':0x232a});config[_0xff3f('0xb')]=_['defaults'](config[_0xff3f('0xb')],{'host':_0xff3f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xff3f('0xd')](socket);function respondWithRpcPromise(_0x5f58d5,_0x3e61d8,_0x52da36){return new BPromise(function(_0x27747c,_0x2c74ec){return client[_0xff3f('0xe')](_0x5f58d5,_0x52da36)[_0xff3f('0xf')](function(_0xe3e559){logger[_0xff3f('0x10')](_0xff3f('0x11'),_0x3e61d8,_0xff3f('0x12'));logger[_0xff3f('0x13')](_0xff3f('0x14'),_0x3e61d8,'request\x20sent',JSON['stringify'](_0xe3e559));if(_0xe3e559[_0xff3f('0x15')]){if(_0xe3e559[_0xff3f('0x15')][_0xff3f('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3e61d8,_0xe3e559[_0xff3f('0x15')]['message']);return _0x2c74ec(_0xe3e559['error'][_0xff3f('0x17')]);}logger[_0xff3f('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3e61d8,_0xe3e559[_0xff3f('0x15')]['message']);return _0x27747c(_0xe3e559[_0xff3f('0x15')]['message']);}else{logger[_0xff3f('0x10')](_0xff3f('0x11'),_0x3e61d8,_0xff3f('0x12'));_0x27747c(_0xe3e559['result'][_0xff3f('0x17')]);}})[_0xff3f('0x18')](function(_0x5e0b90){logger[_0xff3f('0x15')](_0xff3f('0x11'),_0x3e61d8,_0x5e0b90);_0x2c74ec(_0x5e0b90);});});} \ No newline at end of file +var _0x3937=['http','redis','defaults','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x428161,_0x47a951){var _0x53b947=function(_0x311774){while(--_0x311774){_0x428161['push'](_0x428161['shift']());}};_0x53b947(++_0x47a951);}(_0x3937,0xbf));var _0x7393=function(_0xbbc38,_0x429f7e){_0xbbc38=_0xbbc38-0x0;var _0xe0fb99=_0x3937[_0xbbc38];return _0xe0fb99;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var moment=require(_0x7393('0x1'));var BPromise=require(_0x7393('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7393('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7393('0x4'));var logger=require('../../config/logger')(_0x7393('0x5'));var config=require(_0x7393('0x6'));var jayson=require(_0x7393('0x7'));var client=jayson[_0x7393('0x8')][_0x7393('0x9')]({'port':0x232a});config[_0x7393('0xa')]=_[_0x7393('0xb')](config[_0x7393('0xa')],{'host':_0x7393('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7393('0xd'))[_0x7393('0xe')](socket);function respondWithRpcPromise(_0x1cc3fd,_0x4d3f6c,_0xab290c){return new BPromise(function(_0x5f0dd5,_0x56ed4c){return client['request'](_0x1cc3fd,_0xab290c)['then'](function(_0xe00598){logger[_0x7393('0xf')](_0x7393('0x10'),_0x4d3f6c,'request\x20sent');logger[_0x7393('0x11')](_0x7393('0x12'),_0x4d3f6c,_0x7393('0x13'),JSON[_0x7393('0x14')](_0xe00598));if(_0xe00598[_0x7393('0x15')]){if(_0xe00598[_0x7393('0x15')][_0x7393('0x16')]===0x1f4){logger[_0x7393('0x15')](_0x7393('0x10'),_0x4d3f6c,_0xe00598['error']['message']);return _0x56ed4c(_0xe00598[_0x7393('0x15')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4d3f6c,_0xe00598[_0x7393('0x15')]['message']);return _0x5f0dd5(_0xe00598[_0x7393('0x15')][_0x7393('0x17')]);}else{logger['info'](_0x7393('0x10'),_0x4d3f6c,'request\x20sent');_0x5f0dd5(_0xe00598['result'][_0x7393('0x17')]);}})[_0x7393('0x18')](function(_0x1b032c){logger[_0x7393('0x15')](_0x7393('0x10'),_0x4d3f6c,_0x1b032c);_0x56ed4c(_0x1b032c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c74a8a4..efce9ba 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 _0x0e42=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x5ed526,_0x44337f){var _0x4b7105=function(_0x394136){while(--_0x394136){_0x5ed526['push'](_0x5ed526['shift']());}};_0x4b7105(++_0x44337f);}(_0x0e42,0x9b));var _0x20e4=function(_0x219b85,_0x46ab1e){_0x219b85=_0x219b85-0x0;var _0x32a645=_0x0e42[_0x219b85];return _0x32a645;};'use strict';var ChatGroupEvents=require(_0x20e4('0x0'));var events=[_0x20e4('0x1'),_0x20e4('0x2'),_0x20e4('0x3')];function createListener(_0x645f55,_0x294c47){return function(_0x1b9464){_0x294c47[_0x20e4('0x4')](_0x645f55,_0x1b9464);};}function removeListener(_0x31f3cf,_0x1a380c){return function(){ChatGroupEvents[_0x20e4('0x5')](_0x31f3cf,_0x1a380c);};}exports['register']=function(_0xa37f01){for(var _0x1a34cb=0x0,_0x5defe2=events[_0x20e4('0x6')];_0x1a34cb<_0x5defe2;_0x1a34cb++){var _0x373a32=events[_0x1a34cb];var _0x48e5c1=createListener(_0x20e4('0x7')+_0x373a32,_0xa37f01);ChatGroupEvents['on'](_0x373a32,_0x48e5c1);}}; \ No newline at end of file +var _0x8b07=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x1c71cd,_0x4b696a){var _0x505500=function(_0x56300b){while(--_0x56300b){_0x1c71cd['push'](_0x1c71cd['shift']());}};_0x505500(++_0x4b696a);}(_0x8b07,0xc2));var _0x78b0=function(_0xc44d75,_0x222848){_0xc44d75=_0xc44d75-0x0;var _0x280d05=_0x8b07[_0xc44d75];return _0x280d05;};'use strict';var ChatGroupEvents=require(_0x78b0('0x0'));var events=[_0x78b0('0x1'),_0x78b0('0x2'),_0x78b0('0x3')];function createListener(_0x3fc51d,_0x4022e4){return function(_0x374dc2){_0x4022e4[_0x78b0('0x4')](_0x3fc51d,_0x374dc2);};}function removeListener(_0x409e81,_0x391cc1){return function(){ChatGroupEvents[_0x78b0('0x5')](_0x409e81,_0x391cc1);};}exports[_0x78b0('0x6')]=function(_0x2ce1a0){for(var _0x390fa8=0x0,_0x1b3a0f=events[_0x78b0('0x7')];_0x390fa8<_0x1b3a0f;_0x390fa8++){var _0x3ea73d=events[_0x390fa8];var _0x3c78de=createListener(_0x78b0('0x8')+_0x3ea73d,_0x2ce1a0);ChatGroupEvents['on'](_0x3ea73d,_0x3c78de);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2dd064a..9d86252 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 _0xc5b1=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','path','connect-timeout'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xc5b1,0x141));var _0x1c5b=function(_0x10d0e4,_0x2cf51e){_0x10d0e4=_0x10d0e4-0x0;var _0x305177=_0xc5b1[_0x10d0e4];return _0x305177;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require('util');var path=require(_0x1c5b('0x1'));var timeout=require(_0x1c5b('0x2'));var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require(_0x1c5b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x5'));var config=require(_0x1c5b('0x6'));var controller=require('./chatGroup.controller');router[_0x1c5b('0x7')]('/',auth[_0x1c5b('0x8')](),controller[_0x1c5b('0x9')]);router[_0x1c5b('0x7')](_0x1c5b('0xa'),auth['isAuthenticated'](),controller[_0x1c5b('0xb')]);router[_0x1c5b('0x7')](_0x1c5b('0xc'),auth[_0x1c5b('0x8')](),controller[_0x1c5b('0xd')]);router['get'](_0x1c5b('0xe'),auth[_0x1c5b('0x8')](),controller['getUnread']);router['get'](_0x1c5b('0xf'),auth[_0x1c5b('0x8')](),controller['getMembers']);router[_0x1c5b('0x7')](_0x1c5b('0x10'),auth[_0x1c5b('0x8')](),controller[_0x1c5b('0x11')]);router['post']('/',auth[_0x1c5b('0x8')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x13')]('/:id/members',auth[_0x1c5b('0x8')](),controller[_0x1c5b('0x14')]);router['post'](_0x1c5b('0x10'),auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);router[_0x1c5b('0x16')](_0x1c5b('0xc'),auth[_0x1c5b('0x8')](),controller['update']);router[_0x1c5b('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x1c5b('0x18')]);router['delete']('/:id/members',auth[_0x1c5b('0x8')](),controller[_0x1c5b('0x19')]);module[_0x1c5b('0x1a')]=router; \ No newline at end of file +var _0xf3c2=['../../components/interaction/service','./chatGroup.controller','get','index','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x69b55a,_0x438b40){var _0x235e7e=function(_0x25d8cd){while(--_0x25d8cd){_0x69b55a['push'](_0x69b55a['shift']());}};_0x235e7e(++_0x438b40);}(_0xf3c2,0xbd));var _0x2f3c=function(_0x521c3b,_0x1cc177){_0x521c3b=_0x521c3b-0x0;var _0x264eb2=_0xf3c2[_0x521c3b];return _0x264eb2;};'use strict';var multer=require(_0x2f3c('0x0'));var util=require(_0x2f3c('0x1'));var path=require(_0x2f3c('0x2'));var timeout=require(_0x2f3c('0x3'));var express=require('express');var router=express[_0x2f3c('0x4')]();var fs_extra=require(_0x2f3c('0x5'));var auth=require(_0x2f3c('0x6'));var interaction=require(_0x2f3c('0x7'));var config=require('../../config/environment');var controller=require(_0x2f3c('0x8'));router[_0x2f3c('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f3c('0xa')]);router[_0x2f3c('0x9')]('/describe',auth[_0x2f3c('0xb')](),controller[_0x2f3c('0xc')]);router[_0x2f3c('0x9')](_0x2f3c('0xd'),auth['isAuthenticated'](),controller[_0x2f3c('0xe')]);router[_0x2f3c('0x9')](_0x2f3c('0xf'),auth[_0x2f3c('0xb')](),controller[_0x2f3c('0x10')]);router[_0x2f3c('0x9')](_0x2f3c('0x11'),auth[_0x2f3c('0xb')](),controller['getMembers']);router['get'](_0x2f3c('0x12'),auth['isAuthenticated'](),controller[_0x2f3c('0x13')]);router[_0x2f3c('0x14')]('/',auth[_0x2f3c('0xb')](),controller[_0x2f3c('0x15')]);router[_0x2f3c('0x14')](_0x2f3c('0x11'),auth[_0x2f3c('0xb')](),controller[_0x2f3c('0x16')]);router['post'](_0x2f3c('0x12'),auth[_0x2f3c('0xb')](),controller['addMessage']);router[_0x2f3c('0x17')](_0x2f3c('0xd'),auth[_0x2f3c('0xb')](),controller[_0x2f3c('0x18')]);router[_0x2f3c('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x2f3c('0x1a')]);router[_0x2f3c('0x19')](_0x2f3c('0x11'),auth['isAuthenticated'](),controller[_0x2f3c('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d27168e..dc3e7aa 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 _0xd8b0=['DATE','out','BOOLEAN','sequelize','exports','star','thumb','TEXT','STRING','long'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_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')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x2')},'ratingMessage':{'type':Sequelize[_0x0d8b('0x4')]},'pathTranscript':{'type':Sequelize[_0x0d8b('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x5')]},'secondDisposition':{'type':Sequelize[_0x0d8b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0d8b('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0d8b('0x5')]},'browserVersion':{'type':Sequelize[_0x0d8b('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x0d8b('0x5')]},'deviceModel':{'type':Sequelize[_0x0d8b('0x5')]},'deviceVendor':{'type':Sequelize[_0x0d8b('0x5')]},'deviceType':{'type':Sequelize[_0x0d8b('0x5')]},'referer':{'type':Sequelize[_0x0d8b('0x4')]},'customerIp':{'type':Sequelize[_0x0d8b('0x5')]},'formData':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x6'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x0d8b('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0d8b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0d8b('0x5')]},'customerPort':{'type':Sequelize[_0x0d8b('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x0d8b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x0d8b('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x6f59=['long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x177d4a,_0x35bcb7){var _0x3b1aa0=function(_0x6cda2){while(--_0x6cda2){_0x177d4a['push'](_0x177d4a['shift']());}};_0x3b1aa0(++_0x35bcb7);}(_0x6f59,0x1be));var _0x96f5=function(_0x282a11,_0x48910d){_0x282a11=_0x282a11-0x0;var _0x40895a=_0x6f59[_0x282a11];return _0x40895a;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'closed':{'type':Sequelize[_0x96f5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x96f5('0x3')]},'ratingType':{'type':Sequelize[_0x96f5('0x4')](_0x96f5('0x5'),_0x96f5('0x6')),'defaultValue':_0x96f5('0x5')},'ratingMessage':{'type':Sequelize[_0x96f5('0x7')]},'pathTranscript':{'type':Sequelize[_0x96f5('0x7')]},'mailTranscript':{'type':Sequelize[_0x96f5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x96f5('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x96f5('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x96f5('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x96f5('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x96f5('0x8')]},'deviceModel':{'type':Sequelize[_0x96f5('0x8')]},'deviceVendor':{'type':Sequelize[_0x96f5('0x8')]},'deviceType':{'type':Sequelize[_0x96f5('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x96f5('0x8')]},'formData':{'type':Sequelize[_0x96f5('0x7')](_0x96f5('0xa'))},'read1stAt':{'type':Sequelize[_0x96f5('0x9')]},'lastMsgAt':{'type':Sequelize[_0x96f5('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x96f5('0x4')]('in',_0x96f5('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x96f5('0x8')]},'customerPort':{'type':Sequelize[_0x96f5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x96f5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x96f5('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1e7198a..230163e 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 _0x150b=['json','limit','undefined','count','offset','set','then','destroy','stack','name','send','merge','body','contact','agent','interaction','index','map','rawAttributes','fieldName','type','key','getOptions','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','include','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','account','POST','follow','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','%s%d','agentAlias','System','customer','Visitor','ContactId','agentIdentifier','agent_alias','alias','fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','ChatInteractionId','includeAgent','push','rows','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','ChatWebsite','Owner','get','Account','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','downloadInteraction.ejs','transcript-','Chat','err','unlinkSync','rimraf','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x1bbe06,_0x1bec61){var _0x17e994=function(_0x16a929){while(--_0x16a929){_0x1bbe06['push'](_0x1bbe06['shift']());}};_0x17e994(++_0x1bec61);}(_0x150b,0x184));var _0xb150=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x150b[_0x591e16];return _0x543b35;};'use strict';var rimraf=require(_0xb150('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb150('0x1'));var Mustache=require('mustache');var util=require(_0xb150('0x2'));var path=require(_0xb150('0x3'));var ejs=require(_0xb150('0x4'));var fs=require('fs');var _=require(_0xb150('0x5'));var Redis=require(_0xb150('0x6'));var interaction=require(_0xb150('0x7'));var qs=require(_0xb150('0x8'));var pdf=require(_0xb150('0x9'));var logger=require(_0xb150('0xa'))('api');var config=require(_0xb150('0xb'));var db=require('../../mysqldb')['db'];config[_0xb150('0xc')]=_['defaults'](config[_0xb150('0xc')],{'host':_0xb150('0xd'),'port':0x18eb});var socket=require(_0xb150('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb150('0xf')](socket);var jayson=require(_0xb150('0x10'));var client=jayson[_0xb150('0x11')][_0xb150('0x12')]({'port':0x232b});var client9004=jayson[_0xb150('0x11')][_0xb150('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x97560d,_0x1173ff,_0x82c82d,_0x14a7aa){return new BPromise(function(_0x32ce64,_0x168cb5){var _0x539540=_0x14a7aa||client;return _0x539540[_0xb150('0x13')](_0x97560d,_0x82c82d)['then'](function(_0x2f6bae){logger[_0xb150('0x14')](_0xb150('0x15'),_0x1173ff,_0xb150('0x16'));logger[_0xb150('0x17')](_0xb150('0x18'),_0x1173ff,'request\x20sent',JSON[_0xb150('0x19')](_0x2f6bae));if(_0x2f6bae[_0xb150('0x1a')]){if(_0x2f6bae[_0xb150('0x1a')][_0xb150('0x1b')]===0x1f4){logger[_0xb150('0x1a')](_0xb150('0x15'),_0x1173ff,_0x2f6bae['error']['message']);return _0x168cb5(_0x2f6bae[_0xb150('0x1a')][_0xb150('0x1c')]);}logger['error'](_0xb150('0x15'),_0x1173ff,_0x2f6bae[_0xb150('0x1a')][_0xb150('0x1c')]);return _0x32ce64(_0x2f6bae['error'][_0xb150('0x1c')]);}else{logger[_0xb150('0x14')](_0xb150('0x15'),_0x1173ff,'request\x20sent');_0x32ce64(_0x2f6bae[_0xb150('0x1d')]['message']);}})[_0xb150('0x1e')](function(_0x12d03c){logger[_0xb150('0x1a')](_0xb150('0x15'),_0x1173ff,_0x12d03c);_0x168cb5(_0x12d03c);});});}function respondWithStatusCode(_0x507346,_0x400c48){_0x400c48=_0x400c48||0xcc;return function(_0x5282c8){if(_0x5282c8){return _0x507346[_0xb150('0x1f')](_0x400c48);}return _0x507346[_0xb150('0x20')](_0x400c48)[_0xb150('0x21')]();};}function respondWithResult(_0x3af25f,_0x39bc7d){_0x39bc7d=_0x39bc7d||0xc8;return function(_0x4b786d){if(_0x4b786d){return _0x3af25f['status'](_0x39bc7d)[_0xb150('0x22')](_0x4b786d);}};}function respondWithFilteredResult(_0x19b3a4,_0x12e909){return function(_0x2a73d7){if(_0x2a73d7){var _0x1cbcbd=typeof _0x12e909['offset']==='undefined'&&typeof _0x12e909[_0xb150('0x23')]===_0xb150('0x24');var _0x5d5aea=_0x2a73d7[_0xb150('0x25')];var _0x1a5c92=_0x1cbcbd?0x0:_0x12e909[_0xb150('0x26')];var _0x8de40f=_0x1cbcbd?_0x2a73d7[_0xb150('0x25')]:_0x12e909[_0xb150('0x26')]+_0x12e909[_0xb150('0x23')];var _0x58e5d4;if(_0x8de40f>=_0x5d5aea){_0x8de40f=_0x5d5aea;_0x58e5d4=0xc8;}else{_0x58e5d4=0xce;}_0x19b3a4['status'](_0x58e5d4);return _0x19b3a4[_0xb150('0x27')]('Content-Range',_0x1a5c92+'-'+_0x8de40f+'/'+_0x5d5aea)['json'](_0x2a73d7);}return null;};}function saveUpdates(_0x47fefc){return function(_0x61be45){if(_0x61be45){return _0x61be45['update'](_0x47fefc)[_0xb150('0x28')](function(_0xc106ae){return _0xc106ae;});}return null;};}function removeEntity(_0x32b1e7){return function(_0x2f5894){if(_0x2f5894){return _0x2f5894[_0xb150('0x29')]()['then'](function(){_0x32b1e7[_0xb150('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d932){return function(_0x26728c){if(!_0x26728c){_0x40d932[_0xb150('0x1f')](0x194);}return _0x26728c;};}function handleError(_0x6a9410,_0x2e60ce){_0x2e60ce=_0x2e60ce||0x1f4;return function(_0x29115e){logger[_0xb150('0x1a')](_0x29115e[_0xb150('0x2a')]);if(_0x29115e[_0xb150('0x2b')]){delete _0x29115e['name'];}_0x6a9410[_0xb150('0x20')](_0x2e60ce)[_0xb150('0x2c')](_0x29115e);};}function getMustacheRender(_0x3dcac5,_0x1f111e){return Mustache['render'](_0x3dcac5,_[_0xb150('0x2d')](_0x1f111e[_0xb150('0x2e')],{'contact':_0x1f111e[_0xb150('0x2f')],'message':_0x1f111e['message'],'agent':_0x1f111e[_0xb150('0x30')],'interaction':_0x1f111e[_0xb150('0x31')],'account':_0x1f111e['account']}))||'';}exports[_0xb150('0x32')]=function(_0x36def2,_0x5f15a4){var _0x37c80a={};var _0x58ee37=_[_0xb150('0x33')](db['ChatInteraction'][_0xb150('0x34')],function(_0x28f7ee){return{'name':_0x28f7ee[_0xb150('0x35')],'type':_0x28f7ee[_0xb150('0x36')][_0xb150('0x37')]};});_0x37c80a=qs[_0xb150('0x38')](_0x58ee37,_0x36def2);return interaction['findAll'](_0xb150('0x39'),_0x36def2[_0xb150('0x3a')],_0x36def2[_0xb150('0x3b')],_0x37c80a,_0x58ee37)[_0xb150('0x28')](respondWithFilteredResult(_0x5f15a4,_0x37c80a))[_0xb150('0x1e')](handleError(_0x5f15a4,null));};exports[_0xb150('0x3c')]=function(_0x256d70,_0x25795f){var _0xd2ff84={'raw':![],'where':{'id':_0x256d70[_0xb150('0x3d')]['id']}},_0x171e24={};_0x171e24[_0xb150('0x3e')]=_[_0xb150('0x3f')](db[_0xb150('0x40')][_0xb150('0x34')]);_0x171e24[_0xb150('0x3a')]=_[_0xb150('0x3f')](_0x256d70[_0xb150('0x3a')]);_0x171e24['filters']=_[_0xb150('0x41')](_0x171e24[_0xb150('0x3e')],_0x171e24[_0xb150('0x3a')]);_0xd2ff84[_0xb150('0x42')]=_['intersection'](_0x171e24[_0xb150('0x3e')],qs[_0xb150('0x43')](_0x256d70[_0xb150('0x3a')][_0xb150('0x43')]));_0xd2ff84['attributes']=_0xd2ff84[_0xb150('0x42')][_0xb150('0x44')]?_0xd2ff84['attributes']:_0x171e24[_0xb150('0x3e')];if(_0x256d70['query'][_0xb150('0x45')]){_0xd2ff84[_0xb150('0x46')]=[{'all':!![]}];}_0xd2ff84=_[_0xb150('0x2d')]({},_0xd2ff84,_0x256d70[_0xb150('0x47')]);return db[_0xb150('0x40')][_0xb150('0x48')](_0xd2ff84)[_0xb150('0x28')](handleEntityNotFound(_0x25795f,null))[_0xb150('0x28')](respondWithResult(_0x25795f,null))['catch'](handleError(_0x25795f,null));};exports[_0xb150('0x49')]=function(_0x256ea7,_0x10e549){return db[_0xb150('0x40')][_0xb150('0x49')](_0x256ea7['body'],{})[_0xb150('0x28')](respondWithResult(_0x10e549,0xc9))[_0xb150('0x1e')](handleError(_0x10e549,null));};exports[_0xb150('0x4a')]=function(_0x4b8c63,_0x5b1e88){if(_0x4b8c63[_0xb150('0x2e')]['id']){delete _0x4b8c63[_0xb150('0x2e')]['id'];}return db[_0xb150('0x40')][_0xb150('0x48')]({'where':{'id':_0x4b8c63[_0xb150('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b1e88,null))[_0xb150('0x28')](saveUpdates(_0x4b8c63[_0xb150('0x2e')],null))[_0xb150('0x28')](respondWithResult(_0x5b1e88,null))[_0xb150('0x1e')](handleError(_0x5b1e88,null));};exports['destroy']=function(_0x1e2584,_0x516ac2){return db['ChatInteraction'][_0xb150('0x48')]({'where':{'id':_0x1e2584[_0xb150('0x3d')]['id']}})['then'](handleEntityNotFound(_0x516ac2,null))['then'](removeEntity(_0x516ac2,null))[_0xb150('0x1e')](handleError(_0x516ac2,null));};exports[_0xb150('0x4b')]=function(_0x46dbb9,_0x1963bd){return db[_0xb150('0x40')]['describe']()['then'](respondWithResult(_0x1963bd,null))[_0xb150('0x1e')](handleError(_0x1963bd,null));};exports[_0xb150('0x4c')]=function(_0x10a0e6,_0x44c4eb){var _0x5ba470=_0x10a0e6['params']['id'];var _0x570e24;var _0x28fb0e;var _0x31065d;return db[_0xb150('0x40')][_0xb150('0x4d')]({'where':{'id':_0x5ba470}})[_0xb150('0x28')](function(_0xeee63e){_0x570e24=_0xeee63e;return db['ChatWebsite']['findOne']({'where':{'id':_0xeee63e[_0xb150('0x4e')]},'attributes':['id','vidaooApiKey',_0xb150('0x4f'),_0xb150('0x50'),_0xb150('0x51'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x595425){if(_0x595425&&_0x595425[_0xb150('0x52')]&&_0x595425[_0xb150('0x4f')]){_0x28fb0e=_0x595425;var _0x29cb5c={'interaction':{'id':_0x5ba470},'agent':{'id':_0x10a0e6[_0xb150('0x3b')]['id'],'name':_0x10a0e6[_0xb150('0x3b')][_0xb150('0x2b')],'fullname':_0x10a0e6[_0xb150('0x3b')]['fullname'],'email':_0x10a0e6[_0xb150('0x3b')][_0xb150('0x53')]},'contact':_0x10a0e6[_0xb150('0x2e')][_0xb150('0x2f')],'account':_0x10a0e6[_0xb150('0x2e')][_0xb150('0x54')]};var _0x5699dc={'rejectUnauthorized':![],'method':_0xb150('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x595425['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x10a0e6[_0xb150('0x3b')][_0xb150('0x53')]],'buttons':null,'topic':_0x28fb0e[_0xb150('0x50')],'note':_['isNull'](_0x28fb0e[_0xb150('0x51')])?null:getMustacheRender(_0x28fb0e['vidaooNote'],_0x29cb5c),'metadata':null},'redirect':_0xb150('0x56'),'json':!![]};try{if(!_[_0xb150('0x57')](_0x28fb0e[_0xb150('0x58')])){var _0x1820bc=getMustacheRender(_0x28fb0e[_0xb150('0x58')],_0x29cb5c);var _0x2cbbd0=JSON['parse'](_0x1820bc);_0x5699dc[_0xb150('0x2e')][_0xb150('0x59')]=_0x2cbbd0;}}catch(_0x10e003){throw new db[(_0xb150('0x5a'))][(_0xb150('0x5b'))](_0xb150('0x5c'));}return rp(_0x5699dc);}else{throw new db[(_0xb150('0x5a'))][(_0xb150('0x5b'))](_0xb150('0x5d'));}})[_0xb150('0x28')](function(_0x3223d3){_0x31065d=_0x3223d3;if(_0x31065d['id']){var _0x4d1eb2={'body':_0x31065d[_0xb150('0x5e')],'ChatWebsiteId':_0x28fb0e['id'],'ChatInteractionId':_0x570e24['id'],'direction':_0xb150('0x5f'),'UserId':_0x10a0e6['user']['id']};return db[_0xb150('0x60')]['create'](_0x4d1eb2,{});}else{throw new db[(_0xb150('0x5a'))][(_0xb150('0x5b'))](_0xb150('0x61'));}})[_0xb150('0x28')](function(){return _0x570e24[_0xb150('0x62')]({'vidaooSessionId':_0x31065d['id']});})[_0xb150('0x28')](respondWithResult(_0x44c4eb,null))['catch'](handleError(_0x44c4eb,null));};exports[_0xb150('0x63')]=function(_0x1c974d,_0x4d0ba4){if(_0x1c974d[_0xb150('0x2e')]['id']){delete _0x1c974d['body']['id'];}return db[_0xb150('0x40')][_0xb150('0x48')]({'where':{'id':_0x1c974d[_0xb150('0x3d')]['id']},'include':[{'model':db[_0xb150('0x64')],'as':_0xb150('0x65')}]})[_0xb150('0x28')](handleEntityNotFound(_0x4d0ba4,null))[_0xb150('0x28')](saveUpdates(_0x1c974d[_0xb150('0x2e')],null))['then'](respondWithResult(_0x4d0ba4,null))['catch'](handleError(_0x4d0ba4,null));};exports[_0xb150('0x66')]=function(_0x4deaf0,_0xb43ea0){if(_0x4deaf0[_0xb150('0x2e')]['id']){delete _0x4deaf0[_0xb150('0x2e')]['id'];}return db[_0xb150('0x40')][_0xb150('0x48')]({'where':{'id':_0x4deaf0[_0xb150('0x3d')]['id']}})['then'](function(_0x23f5c6){if(!_0x23f5c6){logger[_0xb150('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb150('0x66'),0x194,_0xb150('0x67'));_0xb43ea0['sendStatus'](0x194);}else{if(_0x23f5c6[_0xb150('0x68')]){throw new db[(_0xb150('0x5a'))][(_0xb150('0x5b'))]('Interaction\x20already\x20assigned');}}return _0x23f5c6;})['then'](function(_0x19ad9e){if(_0x19ad9e){return _0x19ad9e['update']({'closed':_0x4deaf0[_0xb150('0x2e')][_0xb150('0x69')],'disposition':_0x4deaf0[_0xb150('0x2e')]['disposition']})[_0xb150('0x28')](function(_0x38c9eb){return _0x38c9eb;});}})[_0xb150('0x28')](function(){return respondWithRpcPromise('AbandonInteraction',_0xb150('0x66'),_0x4deaf0[_0xb150('0x2e')],client9004);})['then'](respondWithResult(_0xb43ea0,null))[_0xb150('0x1e')](handleError(_0xb43ea0,null));};exports[_0xb150('0x6a')]=function(_0x3d5202,_0x8c4e84){_0x3d5202[_0xb150('0x2e')][_0xb150('0x2b')]=_0x3d5202[_0xb150('0x6b')][_0xb150('0x6c')];_0x3d5202['body'][_0xb150('0x6d')]=_0x3d5202[_0xb150('0x6b')][_0xb150('0x6e')];_0x3d5202[_0xb150('0x2e')][_0xb150('0x36')]=_0x3d5202['file']['mimetype'];return db[_0xb150('0x6f')][_0xb150('0x49')](_0x3d5202['body'])[_0xb150('0x28')](respondWithResult(_0x8c4e84,0xc9))['catch'](handleError(_0x8c4e84,null));};exports[_0xb150('0x70')]=function(_0x39a101,_0x1b0a56){return db[_0xb150('0x40')][_0xb150('0x4d')]({'where':{'id':_0x39a101[_0xb150('0x3d')]['id']},'raw':!![]})[_0xb150('0x28')](handleEntityNotFound(_0x1b0a56,null))[_0xb150('0x28')](function(_0x360ced){if(_0x360ced){if(_0x360ced[_0xb150('0x69')]){return _0x1b0a56[_0xb150('0x20')](0x193)[_0xb150('0x22')]({'status':0x193,'message':_0xb150('0x71')});}return db[_0xb150('0x6f')][_0xb150('0x4d')]({'where':{'id':_0x39a101[_0xb150('0x3a')][_0xb150('0x72')]},'raw':!![]})[_0xb150('0x28')](handleEntityNotFound(_0x1b0a56,null));}})[_0xb150('0x28')](function(_0x57b81f){if(_0x57b81f){var _0x4731c9=_0x57b81f[_0xb150('0x73')]!==null;var _0x2960f4=path[_0xb150('0x74')](config[_0xb150('0x75')],'server/files/attachments/');if(_0x4731c9){_0x2960f4=path[_0xb150('0x74')](_0x2960f4,_0xb150('0x76'));}var _0x5c97a0=path['join'](_0x2960f4,_0x57b81f[_0xb150('0x6d')]);return _0x1b0a56['download'](_0x5c97a0);}})['catch'](handleError(_0x1b0a56,null));};exports[_0xb150('0x77')]=function(_0x146f57,_0x4914c){var _0x27b93f=null;var _0x2fdbad=null;var _0x55ffeb=null;if(_0x146f57[_0xb150('0x2e')]['id']){delete _0x146f57[_0xb150('0x2e')]['id'];}if(_0x146f57[_0xb150('0x2e')]['mailTranscript']){_0x55ffeb=path[_0xb150('0x74')](config[_0xb150('0x75')],_0xb150('0x78'),util[_0xb150('0x79')](_0xb150('0x7a'),Date[_0xb150('0x7b')]()));_0x146f57[_0xb150('0x2e')]['pathTranscript']=_0x55ffeb;}return db[_0xb150('0x40')][_0xb150('0x48')]({'where':{'id':_0x146f57[_0xb150('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xb150('0x7c'),'include':[{'model':db[_0xb150('0x7d')],'as':_0xb150('0x7d')}]}]})[_0xb150('0x28')](handleEntityNotFound(_0x4914c,null))['then'](saveUpdates(_0x146f57[_0xb150('0x2e')],null))[_0xb150('0x28')](function(_0x3be68b){if(_0x3be68b){_0x27b93f=_0x3be68b;return db['ChatWebsite'][_0xb150('0x48')]({'where':{'id':_0x27b93f[_0xb150('0x4e')]}});}})[_0xb150('0x28')](function(_0x3dcc7d){if(_0x3dcc7d){_0x2fdbad=_0x3dcc7d;return db['CmContact'][_0xb150('0x48')]({'where':{'id':_0x27b93f['ContactId']}});}})[_0xb150('0x28')](function(_0x138cbb){if(_0x138cbb){if(_0x55ffeb){var _0x3b2b47=null;for(var _0x18d636=0x1;_0x18d636<_0x27b93f[_0xb150('0x7c')]['length'];++_0x18d636){_0x3b2b47=_0x27b93f[_0xb150('0x7c')][_0x18d636];var _0xe70e0f=_0x3b2b47['UserId']?util[_0xb150('0x79')](_0xb150('0x7e'),_0x2fdbad[_0xb150('0x7f')],_0x3b2b47[_0xb150('0x68')]):_0xb150('0x80');var _0x3803b9=_0x146f57[_0xb150('0x2e')][_0xb150('0x81')]||util[_0xb150('0x79')]('%s%d',_0xb150('0x82'),_0x3b2b47[_0xb150('0x83')]);switch(_0x2fdbad[_0xb150('0x84')]){case'website_alias':_0xe70e0f=_0x3b2b47['UserId']?util[_0xb150('0x79')](_0xb150('0x7e'),_0x2fdbad[_0xb150('0x7f')],_0x3b2b47[_0xb150('0x68')]):_0xb150('0x80');break;case _0xb150('0x85'):_0xe70e0f=_0x3b2b47[_0xb150('0x68')]?_0x3b2b47[_0xb150('0x7d')][_0xb150('0x86')]||_0x3b2b47['User'][_0xb150('0x87')]:_0xb150('0x80');break;case'agent_fullname':_0xe70e0f=_0x3b2b47[_0xb150('0x68')]?_0x3b2b47[_0xb150('0x7d')][_0xb150('0x87')]:_0xb150('0x80');break;default:_0xe70e0f=_0x3b2b47['UserId']?util['format'](_0xb150('0x7e'),_0x2fdbad[_0xb150('0x7f')],_0x3b2b47[_0xb150('0x68')]):_0xb150('0x80');}var _0x10fc46=util[_0xb150('0x79')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3b2b47['createdAt'])['format'](_0xb150('0x88')),_0x3b2b47[_0xb150('0x89')]==='in'?_0x3803b9:_0xe70e0f,_0x3b2b47[_0xb150('0x2e')]);if(!_0x3b2b47[_0xb150('0x8a')]){fs[_0xb150('0x8b')](_0x55ffeb,_0x10fc46);}}return db['MailAccount'][_0xb150('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb150('0x8c'),'raw':!![],'include':[{'model':db[_0xb150('0x8d')],'as':_0xb150('0x8d'),'raw':!![]}]}]});}}})[_0xb150('0x28')](function(_0x340203){if(!_0x340203||!_0x340203[_0xb150('0x8c')]||!_0x146f57[_0xb150('0x2e')])return _0x27b93f;var _0x559be4=_0x340203[_0xb150('0x8e')]();return respondWithRpcPromise(_0xb150('0x8f'),_0xb150('0x90'),{'account':_0x559be4,'message':{'from':util[_0xb150('0x79')](_0xb150('0x91'),_0x340203[_0xb150('0x2b')],_0x340203[_0xb150('0x53')]||_0x340203[_0xb150('0x8c')][_0xb150('0x3b')]),'to':_0x146f57['body'][_0xb150('0x92')],'subject':_0xb150('0x93'),'text':util[_0xb150('0x79')](_0xb150('0x94'),_0x146f57[_0xb150('0x2e')][_0xb150('0x92')]),'attachments':[{'path':_0x55ffeb}]}})['then'](function(){return _0x27b93f;})[_0xb150('0x1e')](function(_0x485028){logger['error'](_0x485028);});})[_0xb150('0x28')](respondWithStatusCode(_0x4914c,0xc8))[_0xb150('0x1e')](handleError(_0x4914c,null));};exports[_0xb150('0x95')]=function(_0x382f9c,_0x2a6f4f){return db[_0xb150('0x60')]['find']({'where':{'id':_0x382f9c[_0xb150('0x3d')]['id']}})[_0xb150('0x28')](handleEntityNotFound(_0x2a6f4f,null))[_0xb150('0x28')](function(_0x28d7bd){if(_0x28d7bd){return _0x28d7bd[_0xb150('0x95')](_0x382f9c[_0xb150('0x2e')][_0xb150('0x96')],_[_0xb150('0x97')](_0x382f9c[_0xb150('0x2e')],[_0xb150('0x96'),'id'])||{});}})[_0xb150('0x28')](respondWithResult(_0x2a6f4f,null))[_0xb150('0x1e')](handleError(_0x2a6f4f,null));};exports[_0xb150('0x98')]=function(_0x4a46e8,_0x1fa2fd){var _0x2e89cb={'raw':![],'where':{}};var _0x23625b={};var _0x2ec168={'count':0x0,'rows':[]};return db[_0xb150('0x40')][_0xb150('0x4d')]({'where':{'id':_0x4a46e8[_0xb150('0x3d')]['id']}})[_0xb150('0x28')](handleEntityNotFound(_0x1fa2fd,null))[_0xb150('0x28')](function(_0x147224){if(_0x147224){_0x23625b['model']=_[_0xb150('0x3f')](db[_0xb150('0x60')][_0xb150('0x34')]);_0x23625b[_0xb150('0x3a')]=_[_0xb150('0x3f')](_0x4a46e8[_0xb150('0x3a')]);_0x23625b[_0xb150('0x99')]=_['intersection'](_0x23625b[_0xb150('0x3e')],_0x23625b[_0xb150('0x3a')]);_0x2e89cb[_0xb150('0x42')]=_[_0xb150('0x41')](_0x23625b[_0xb150('0x3e')],qs[_0xb150('0x43')](_0x4a46e8[_0xb150('0x3a')][_0xb150('0x43')]));_0x2e89cb[_0xb150('0x42')]=_0x2e89cb[_0xb150('0x42')][_0xb150('0x44')]?_0x2e89cb[_0xb150('0x42')]:_0x23625b[_0xb150('0x3e')];if(!_0x4a46e8[_0xb150('0x3a')][_0xb150('0x9a')](_0xb150('0x9b'))){_0x2e89cb[_0xb150('0x23')]=qs[_0xb150('0x23')](_0x4a46e8[_0xb150('0x3a')][_0xb150('0x23')]);_0x2e89cb['offset']=qs[_0xb150('0x26')](_0x4a46e8[_0xb150('0x3a')][_0xb150('0x26')]);}_0x2e89cb[_0xb150('0x9c')]=qs[_0xb150('0x9d')](_0x4a46e8[_0xb150('0x3a')][_0xb150('0x9d')]);_0x2e89cb[_0xb150('0x9e')]=qs[_0xb150('0x99')](_[_0xb150('0x9f')](_0x4a46e8[_0xb150('0x3a')],_0x23625b[_0xb150('0x99')]));_0x2e89cb[_0xb150('0x9e')]['ChatInteractionId']=_0x147224['id'];if(_0x4a46e8[_0xb150('0x3a')][_0xb150('0xa0')]){_0x2e89cb[_0xb150('0x9e')]=_['merge'](_0x2e89cb[_0xb150('0x9e')],{'$or':_[_0xb150('0x33')](_0x2e89cb[_0xb150('0x42')],function(_0x4fb42a){var _0x268681={};_0x268681[_0x4fb42a]={'$like':'%'+_0x4a46e8[_0xb150('0x3a')][_0xb150('0xa0')]+'%'};return _0x268681;})});}if(_0x4a46e8[_0xb150('0x3a')][_0xb150('0xa1')]){var _0x31c137=_0x4a46e8[_0xb150('0x3a')]['$gte'][_0xb150('0xa2')](',');var _0x434a1a={};_0x434a1a[_0x31c137[0x0]]={'$gte':moment(_0x31c137[0x1])[_0xb150('0x79')](_0xb150('0xa3'))};_0x2e89cb[_0xb150('0x9e')]=_[_0xb150('0x2d')](_0x2e89cb[_0xb150('0x9e')],_0x434a1a);}_0x2e89cb=_[_0xb150('0x2d')]({},_0x2e89cb,_0x4a46e8['options']);return db[_0xb150('0x60')][_0xb150('0x25')]({'where':_0x2e89cb[_0xb150('0x9e')]})[_0xb150('0x28')](function(_0x4c3069){_0x2ec168[_0xb150('0x25')]=_0x4c3069;if(_0x4a46e8[_0xb150('0x3a')][_0xb150('0x45')]){_0x2e89cb[_0xb150('0x46')]=[{'all':!![]}];}return db[_0xb150('0x60')][_0xb150('0xa4')](_0x2e89cb);})['then'](function(_0x4977b6){_0x2ec168['rows']=_0x4977b6;return _0x2ec168;});}})[_0xb150('0x28')](respondWithFilteredResult(_0x1fa2fd,_0x2e89cb))[_0xb150('0x1e')](handleError(_0x1fa2fd,null));};exports[_0xb150('0xa5')]=function(_0x4e92af,_0x30ab1b){var _0x3177db={'where':{}},_0x54ffdc={},_0xc4c40={'count':0x0,'rows':[]};return db[_0xb150('0x40')][_0xb150('0x4d')]({'where':{'id':_0x4e92af[_0xb150('0x3d')]['id']}})[_0xb150('0x28')](handleEntityNotFound(_0x30ab1b,null))[_0xb150('0x28')](function(_0x465985){if(_0x465985){_0x54ffdc[_0xb150('0x3e')]=_[_0xb150('0x3f')](db['ChatMessage']['rawAttributes']);_0x54ffdc[_0xb150('0x3a')]=_[_0xb150('0x3f')](_0x4e92af[_0xb150('0x3a')]);_0x54ffdc[_0xb150('0x99')]=_[_0xb150('0x41')](_0x54ffdc['model'],_0x54ffdc[_0xb150('0x3a')]);_0x3177db[_0xb150('0x42')]=_[_0xb150('0x41')](_0x54ffdc[_0xb150('0x3e')],qs['fields'](_0x4e92af[_0xb150('0x3a')][_0xb150('0x43')]));_0x3177db['attributes']=_0x3177db[_0xb150('0x42')][_0xb150('0x44')]?_0x3177db[_0xb150('0x42')]:_0x54ffdc[_0xb150('0x3e')];if(!_0x4e92af[_0xb150('0x3a')][_0xb150('0x9a')](_0xb150('0x9b'))){_0x3177db[_0xb150('0x23')]=qs[_0xb150('0x23')](_0x4e92af[_0xb150('0x3a')][_0xb150('0x23')]);_0x3177db['offset']=qs[_0xb150('0x26')](_0x4e92af[_0xb150('0x3a')][_0xb150('0x26')]);}_0x3177db[_0xb150('0x9c')]=qs['sort'](_0x4e92af[_0xb150('0x3a')][_0xb150('0x9d')]);_0x3177db[_0xb150('0x9e')]=qs[_0xb150('0x99')](_['pick'](_0x4e92af[_0xb150('0x3a')],_0x54ffdc[_0xb150('0x99')]));_0x3177db[_0xb150('0x9e')][_0xb150('0xa6')]=_0x465985['id'];if(_0x4e92af[_0xb150('0x3a')][_0xb150('0xa0')]){_0x3177db[_0xb150('0x9e')]=_[_0xb150('0x2d')](_0x3177db[_0xb150('0x9e')],{'$or':_[_0xb150('0x33')](_0x3177db[_0xb150('0x42')],function(_0x44efed){var _0x5c843c={};_0x5c843c[_0x44efed]={'$like':'%'+_0x4e92af['query'][_0xb150('0xa0')]+'%'};return _0x5c843c;})});}_0x3177db[_0xb150('0x9e')][_0xb150('0x8a')]=![];if(_0x4e92af[_0xb150('0x3a')]['id']){_0x3177db[_0xb150('0x9e')]['id']={'$gt':_0x4e92af[_0xb150('0x3a')]['id']};}_0x3177db=_['merge']({},_0x3177db,_0x4e92af[_0xb150('0x47')]);return db[_0xb150('0x60')]['count']({'where':_0x3177db[_0xb150('0x9e')]})['then'](function(_0x460c4f){_0xc4c40['count']=_0x460c4f;_0x3177db[_0xb150('0x46')]=[];if(_0x4e92af['query'][_0xb150('0xa7')]){_0x3177db[_0xb150('0x46')][_0xb150('0xa8')]({'model':db[_0xb150('0x7d')],'as':_0xb150('0x7d'),'attributes':['id',_0xb150('0x87'),_0xb150('0x86')]});}if(_0x4e92af[_0xb150('0x3a')][_0xb150('0x45')]){_0x3177db[_0xb150('0x46')]=[{'all':!![]}];}return db[_0xb150('0x60')][_0xb150('0xa4')](_0x3177db);})['then'](function(_0x2660de){_0xc4c40[_0xb150('0xa9')]=_0x2660de;return _0xc4c40;});}})[_0xb150('0x28')](respondWithFilteredResult(_0x30ab1b,_0x3177db))[_0xb150('0x1e')](handleError(_0x30ab1b,null));};exports[_0xb150('0xaa')]=function(_0x54f61d,_0x5c9ce0){return db[_0xb150('0x40')][_0xb150('0x48')]({'where':{'id':_0x54f61d[_0xb150('0x3d')]['id']}})[_0xb150('0x28')](handleEntityNotFound(_0x5c9ce0,null))['then'](function(_0x46c427){if(_0x46c427){return _0x46c427[_0xb150('0xab')](_0x54f61d[_0xb150('0x2e')][_0xb150('0x96')],_[_0xb150('0x97')](_0x54f61d[_0xb150('0x2e')],[_0xb150('0x96'),'id'])||{})['spread'](function(){return db[_0xb150('0xac')][_0xb150('0xa4')]({'attributes':['id',_0xb150('0x2b'),_0xb150('0xad')],'where':{'id':_0x54f61d['body'][_0xb150('0x96')]}});})[_0xb150('0x28')](function(_0x5b4d26){socket[_0xb150('0xae')](_0xb150('0xaf'),{'id':Number(_0x54f61d[_0xb150('0x3d')]['id']),'tags':_0x5b4d26||[]});return{'id':Number(_0x54f61d['params']['id']),'tags':_0x5b4d26||[]};});}})[_0xb150('0x28')](respondWithResult(_0x5c9ce0,null))[_0xb150('0x1e')](handleError(_0x5c9ce0,null));};exports[_0xb150('0xb0')]=function(_0x1f4666,_0x4b0e6b){return db[_0xb150('0x40')]['find']({'where':{'id':_0x1f4666[_0xb150('0x3d')]['id']}})[_0xb150('0x28')](handleEntityNotFound(_0x4b0e6b,null))[_0xb150('0x28')](function(_0x2b404a){if(_0x2b404a){return _0x2b404a[_0xb150('0xb0')](_0x1f4666[_0xb150('0x3a')][_0xb150('0x96')]);}})['then'](respondWithStatusCode(_0x4b0e6b,null))['catch'](handleError(_0x4b0e6b,null));};exports[_0xb150('0xb1')]=function(_0x29c1fd,_0x36664e){var _0x2de521=moment()[_0xb150('0xb2')]()[_0xb150('0xb3')]();var _0x2d07ce=path['join'](config[_0xb150('0x75')],_0xb150('0xb4'),_0xb150('0xb5'),_0xb150('0xb6'));var _0x20dfbb=path[_0xb150('0x74')](config[_0xb150('0x75')],_0xb150('0xb4'),'files',_0xb150('0xb7'));var _0x3454c4=path[_0xb150('0x74')](_0x2d07ce,_0x2de521);var _0xd9a80a=util[_0xb150('0x79')](_0xb150('0xb8'),_0x29c1fd[_0xb150('0x3d')]['id'],_0x2de521);var _0x16a970=path[_0xb150('0x74')](_0x2d07ce,_0xd9a80a);var _0x5b936f=[];_0x5b936f[_0xb150('0xa8')]({'model':db[_0xb150('0x7d')],'as':'User','attributes':['id',_0xb150('0x87')],'raw':!![]});_0x5b936f[_0xb150('0xa8')]({'model':db['CmContact'],'as':_0xb150('0x65'),'attributes':['id',_0xb150('0xb9'),_0xb150('0xba')],'raw':!![]});if(_0x29c1fd[_0xb150('0x3a')][_0xb150('0xb7')]){_0x5b936f['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1510d3=[{'model':db[_0xb150('0x60')],'as':_0xb150('0x7c'),'attributes':['id',_0xb150('0x2e'),_0xb150('0xbb'),'direction','secret','read'],'include':_0x5b936f}];_0x1510d3[_0xb150('0xa8')]({'model':db[_0xb150('0xbc')],'as':'Account','attributes':['id',_0xb150('0x2b')]});_0x1510d3[_0xb150('0xa8')]({'model':db[_0xb150('0x7d')],'as':_0xb150('0xbd'),'attributes':['id','fullname']});return db['ChatInteraction']['find']({'where':{'id':_0x29c1fd[_0xb150('0x3d')]['id']},'include':_0x1510d3})['then'](handleEntityNotFound(_0x36664e,null))[_0xb150('0x28')](function(_0xedab04){if(_0xedab04){var _0x4c6062=_0xedab04[_0xb150('0xbe')]({'plain':!![]});fs['mkdirSync'](_0x3454c4);var _0x156eee={'channel':'Chat','account':_0x4c6062[_0xb150('0xbf')][_0xb150('0x2b')],'agent':_0x4c6062[_0xb150('0xbd')]?_0x4c6062[_0xb150('0xbd')]['fullname']:'N.A.','createdAt':moment(_0x4c6062[_0xb150('0xbb')])[_0xb150('0x79')](_0xb150('0xa3'))[_0xb150('0xb3')](),'closedAt':_0x4c6062['closed']?moment(_0x4c6062[_0xb150('0xc0')])[_0xb150('0x79')](_0xb150('0xa3'))[_0xb150('0xb3')]():'','disposition':_0x4c6062['disposition'],'chatInfo':{'browser':_0x4c6062['browserName'],'os':_0x4c6062[_0xb150('0xc1')],'referer':_0x4c6062[_0xb150('0xc2')],'customerIp':_0x4c6062[_0xb150('0xc3')],'customerPort':_0x4c6062[_0xb150('0xc4')]?_0x4c6062['customerPort']:_0xb150('0xc5')},'messages':_(_0x4c6062['Messages'])[_0xb150('0xc6')]()[_0xb150('0xa0')]({'secret':![]})[_0xb150('0x33')](function(_0x2d6371){if(_0x2d6371['Attachment']){var _0x51acda=path[_0xb150('0x74')](_0x20dfbb,_0x2d6371['Attachment'][_0xb150('0x6d')]);if(fs[_0xb150('0xc7')](_0x51acda)){fs[_0xb150('0xc8')](_0x51acda)[_0xb150('0xc9')](fs[_0xb150('0xca')](path[_0xb150('0x74')](_0x3454c4,_0x2d6371[_0xb150('0x6f')][_0xb150('0x6d')])));}}return{'date':moment(_0x2d6371[_0xb150('0xbb')])['format'](_0xb150('0xa3'))[_0xb150('0xb3')](),'sender':_0x2d6371[_0xb150('0x89')]===_0xb150('0x5f')?_0x2d6371['User']?_0x2d6371[_0xb150('0x7d')][_0xb150('0x87')]:_0xb150('0x80'):_0x2d6371[_0xb150('0x65')][_0xb150('0xb9')]+(_0x2d6371[_0xb150('0x65')][_0xb150('0xba')]?'\x20'+_0x2d6371['Contact'][_0xb150('0xba')]:''),'body':_0x2d6371[_0xb150('0x6f')]?_0x2d6371[_0xb150('0x6f')][_0xb150('0x6d')]:_0x2d6371[_0xb150('0x2e')],'direction':_0x2d6371[_0xb150('0x89')]==='out'?'A':'C','secret':_0x2d6371[_0xb150('0x8a')],'read':_0x2d6371[_0xb150('0xcb')],'attachment':_0x2d6371['Attachment']};})[_0xb150('0xcc')]()};return ejs[_0xb150('0xcd')](path[_0xb150('0x74')](config['root'],'server','views',_0xb150('0xce')),{'interaction':_0x156eee})[_0xb150('0x28')](function(_0x1a6fa0){var _0x5b3139=path[_0xb150('0x74')](_0x3454c4,_0xb150('0xcf')+_0x4c6062['id']+'-'+_0x2de521+'.pdf');var _0x423068={'path':_0x5b3139,'channel':_0xb150('0xd0'),'interactionId':_0x4c6062['id']};return pdf['createPdfFromHTML'](_0x1a6fa0,_0x423068);})[_0xb150('0x28')](function(){return new Promise(function(_0xb6716f,_0x5eccd8){zipdir(_0x3454c4,{'saveTo':_0x16a970},function(_0x5771ad,_0x1eee50){if(_0x5771ad)return _0x5eccd8(_0x5771ad);return _0xb6716f(_0x1eee50);});})[_0xb150('0x28')](function(){return new BPromise(function(_0x3589ad,_0x58bd55){rimraf(_0x3454c4,function(_0x7a873c){if(_0x7a873c)_0x58bd55(_0x7a873c);return _0x3589ad();});});})[_0xb150('0x28')](function(){return _0x36664e['download'](_0x16a970,_0xd9a80a,function(_0x1f00e3){if(_0x1f00e3){logger[_0xb150('0x1a')](_0xb150('0xd1'),_0x1f00e3);}else{fs[_0xb150('0xd2')](_0x16a970);}});});});}else{return _0x36664e[_0xb150('0x1f')](0xc8);}})[_0xb150('0x1e')](handleError(_0x36664e,null));}; \ No newline at end of file +var _0x05af=['MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','\x22%s\x22\x20<%s>','mailTranscript','addMessage','ids','omit','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','ChatInteractionId','includeAgent','push','setTags','spread','chatInteractionTags:save','removeTags','unix','toString','server','files','transcript-%d-%s.zip','firstName','attachments','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','jayson/promise','http','client','request','then','info','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','destroy','stack','name','render','merge','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','query','show','params','keys','filters','intersection','model','attributes','length','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','entity\x20not\x20found','ValidationError','closed','disposition','attachmentUpload','file','originalname','basename','filename','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsiteId','CmContact','ContactId','Messages','UserId','agentAlias','customer','%s%d','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync'];(function(_0x5ad244,_0x25759c){var _0x3bc5a7=function(_0x105bda){while(--_0x105bda){_0x5ad244['push'](_0x5ad244['shift']());}};_0x3bc5a7(++_0x25759c);}(_0x05af,0x1de));var _0xf05a=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x05af[_0x2440fe];return _0x5cf734;};'use strict';var rimraf=require(_0xf05a('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf05a('0x1'));var moment=require(_0xf05a('0x2'));var BPromise=require(_0xf05a('0x3'));var Mustache=require(_0xf05a('0x4'));var util=require(_0xf05a('0x5'));var path=require(_0xf05a('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf05a('0x7'));var Redis=require('ioredis');var interaction=require(_0xf05a('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xf05a('0x9'));var logger=require(_0xf05a('0xa'))('api');var config=require(_0xf05a('0xb'));var db=require(_0xf05a('0xc'))['db'];config[_0xf05a('0xd')]=_[_0xf05a('0xe')](config['redis'],{'host':_0xf05a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf05a('0xd')]));require(_0xf05a('0x10'))['register'](socket);var jayson=require(_0xf05a('0x11'));var client=jayson['client'][_0xf05a('0x12')]({'port':0x232b});var client9004=jayson[_0xf05a('0x13')][_0xf05a('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x9e4d96,_0x2263fc,_0x543738,_0x1ff789){return new BPromise(function(_0x4e1d26,_0x260966){var _0x5efe8e=_0x1ff789||client;return _0x5efe8e[_0xf05a('0x14')](_0x9e4d96,_0x543738)[_0xf05a('0x15')](function(_0x282e30){logger[_0xf05a('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2263fc,_0xf05a('0x17'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2263fc,_0xf05a('0x17'),JSON['stringify'](_0x282e30));if(_0x282e30['error']){if(_0x282e30[_0xf05a('0x18')][_0xf05a('0x19')]===0x1f4){logger[_0xf05a('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x2263fc,_0x282e30[_0xf05a('0x18')][_0xf05a('0x1a')]);return _0x260966(_0x282e30[_0xf05a('0x18')][_0xf05a('0x1a')]);}logger[_0xf05a('0x18')](_0xf05a('0x1b'),_0x2263fc,_0x282e30[_0xf05a('0x18')]['message']);return _0x4e1d26(_0x282e30[_0xf05a('0x18')]['message']);}else{logger[_0xf05a('0x16')](_0xf05a('0x1b'),_0x2263fc,'request\x20sent');_0x4e1d26(_0x282e30[_0xf05a('0x1c')][_0xf05a('0x1a')]);}})[_0xf05a('0x1d')](function(_0xca8bfe){logger['error'](_0xf05a('0x1b'),_0x2263fc,_0xca8bfe);_0x260966(_0xca8bfe);});});}function respondWithStatusCode(_0x356f05,_0x4b67c0){_0x4b67c0=_0x4b67c0||0xcc;return function(_0x9c2aa3){if(_0x9c2aa3){return _0x356f05[_0xf05a('0x1e')](_0x4b67c0);}return _0x356f05[_0xf05a('0x1f')](_0x4b67c0)[_0xf05a('0x20')]();};}function respondWithResult(_0x3a11bf,_0x3fe443){_0x3fe443=_0x3fe443||0xc8;return function(_0x20242f){if(_0x20242f){return _0x3a11bf[_0xf05a('0x1f')](_0x3fe443)['json'](_0x20242f);}};}function respondWithFilteredResult(_0x172285,_0x1a4761){return function(_0x2ac8bd){if(_0x2ac8bd){var _0x33888f=typeof _0x1a4761[_0xf05a('0x21')]===_0xf05a('0x22')&&typeof _0x1a4761[_0xf05a('0x23')]===_0xf05a('0x22');var _0x26975e=_0x2ac8bd[_0xf05a('0x24')];var _0x5a89b4=_0x33888f?0x0:_0x1a4761[_0xf05a('0x21')];var _0x13dcff=_0x33888f?_0x2ac8bd[_0xf05a('0x24')]:_0x1a4761[_0xf05a('0x21')]+_0x1a4761[_0xf05a('0x23')];var _0x459633;if(_0x13dcff>=_0x26975e){_0x13dcff=_0x26975e;_0x459633=0xc8;}else{_0x459633=0xce;}_0x172285[_0xf05a('0x1f')](_0x459633);return _0x172285['set'](_0xf05a('0x25'),_0x5a89b4+'-'+_0x13dcff+'/'+_0x26975e)[_0xf05a('0x26')](_0x2ac8bd);}return null;};}function saveUpdates(_0xd84d35){return function(_0x4c7400){if(_0x4c7400){return _0x4c7400[_0xf05a('0x27')](_0xd84d35)[_0xf05a('0x15')](function(_0xd358f4){return _0xd358f4;});}return null;};}function removeEntity(_0x3440e3){return function(_0x3d4496){if(_0x3d4496){return _0x3d4496[_0xf05a('0x28')]()['then'](function(){_0x3440e3[_0xf05a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x464eb1){return function(_0x51ddef){if(!_0x51ddef){_0x464eb1[_0xf05a('0x1e')](0x194);}return _0x51ddef;};}function handleError(_0x6204e4,_0x33cc15){_0x33cc15=_0x33cc15||0x1f4;return function(_0x38abfa){logger[_0xf05a('0x18')](_0x38abfa[_0xf05a('0x29')]);if(_0x38abfa[_0xf05a('0x2a')]){delete _0x38abfa[_0xf05a('0x2a')];}_0x6204e4[_0xf05a('0x1f')](_0x33cc15)['send'](_0x38abfa);};}function getMustacheRender(_0x3e28b5,_0x71858a){return Mustache[_0xf05a('0x2b')](_0x3e28b5,_[_0xf05a('0x2c')](_0x71858a[_0xf05a('0x2d')],{'contact':_0x71858a['contact'],'message':_0x71858a[_0xf05a('0x1a')],'agent':_0x71858a[_0xf05a('0x2e')],'interaction':_0x71858a[_0xf05a('0x2f')],'account':_0x71858a[_0xf05a('0x30')]}))||'';}exports[_0xf05a('0x31')]=function(_0x5bb2b3,_0x5a5644){var _0xca4f70={};var _0x53ba9d=_[_0xf05a('0x32')](db[_0xf05a('0x33')][_0xf05a('0x34')],function(_0x15e048){return{'name':_0x15e048[_0xf05a('0x35')],'type':_0x15e048[_0xf05a('0x36')]['key']};});_0xca4f70=qs[_0xf05a('0x37')](_0x53ba9d,_0x5bb2b3);return interaction[_0xf05a('0x38')]('chat',_0x5bb2b3[_0xf05a('0x39')],_0x5bb2b3['user'],_0xca4f70,_0x53ba9d)[_0xf05a('0x15')](respondWithFilteredResult(_0x5a5644,_0xca4f70))['catch'](handleError(_0x5a5644,null));};exports[_0xf05a('0x3a')]=function(_0x4cf70b,_0x18e14b){var _0x39ce51={'raw':![],'where':{'id':_0x4cf70b[_0xf05a('0x3b')]['id']}},_0x46fbde={};_0x46fbde['model']=_[_0xf05a('0x3c')](db[_0xf05a('0x33')]['rawAttributes']);_0x46fbde[_0xf05a('0x39')]=_[_0xf05a('0x3c')](_0x4cf70b[_0xf05a('0x39')]);_0x46fbde[_0xf05a('0x3d')]=_[_0xf05a('0x3e')](_0x46fbde['model'],_0x46fbde[_0xf05a('0x39')]);_0x39ce51['attributes']=_[_0xf05a('0x3e')](_0x46fbde[_0xf05a('0x3f')],qs['fields'](_0x4cf70b[_0xf05a('0x39')]['fields']));_0x39ce51[_0xf05a('0x40')]=_0x39ce51[_0xf05a('0x40')][_0xf05a('0x41')]?_0x39ce51[_0xf05a('0x40')]:_0x46fbde['model'];if(_0x4cf70b['query']['includeAll']){_0x39ce51[_0xf05a('0x42')]=[{'all':!![]}];}_0x39ce51=_[_0xf05a('0x2c')]({},_0x39ce51,_0x4cf70b[_0xf05a('0x43')]);return db[_0xf05a('0x33')][_0xf05a('0x44')](_0x39ce51)[_0xf05a('0x15')](handleEntityNotFound(_0x18e14b,null))[_0xf05a('0x15')](respondWithResult(_0x18e14b,null))[_0xf05a('0x1d')](handleError(_0x18e14b,null));};exports['create']=function(_0x323de0,_0x4dc6f1){return db['ChatInteraction'][_0xf05a('0x45')](_0x323de0['body'],{})[_0xf05a('0x15')](respondWithResult(_0x4dc6f1,0xc9))[_0xf05a('0x1d')](handleError(_0x4dc6f1,null));};exports[_0xf05a('0x27')]=function(_0x3affca,_0x25ad74){if(_0x3affca[_0xf05a('0x2d')]['id']){delete _0x3affca['body']['id'];}return db[_0xf05a('0x33')]['find']({'where':{'id':_0x3affca[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0x25ad74,null))['then'](saveUpdates(_0x3affca[_0xf05a('0x2d')],null))[_0xf05a('0x15')](respondWithResult(_0x25ad74,null))[_0xf05a('0x1d')](handleError(_0x25ad74,null));};exports['destroy']=function(_0x244d21,_0x2ff9ce){return db['ChatInteraction'][_0xf05a('0x44')]({'where':{'id':_0x244d21[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0x2ff9ce,null))['then'](removeEntity(_0x2ff9ce,null))[_0xf05a('0x1d')](handleError(_0x2ff9ce,null));};exports[_0xf05a('0x46')]=function(_0x110025,_0x423972){return db['ChatInteraction'][_0xf05a('0x46')]()[_0xf05a('0x15')](respondWithResult(_0x423972,null))['catch'](handleError(_0x423972,null));};exports[_0xf05a('0x47')]=function(_0x25fa32,_0x3dfc74){var _0x4c9138=_0x25fa32[_0xf05a('0x3b')]['id'];var _0xc269c2;var _0x7bf4aa;var _0x5b812b;return db[_0xf05a('0x33')][_0xf05a('0x48')]({'where':{'id':_0x4c9138}})[_0xf05a('0x15')](function(_0xb05a29){_0xc269c2=_0xb05a29;return db[_0xf05a('0x49')][_0xf05a('0x48')]({'where':{'id':_0xb05a29['ChatWebsiteId']},'attributes':['id',_0xf05a('0x4a'),'vidaooEscalation',_0xf05a('0x4b'),'vidaooNote',_0xf05a('0x4c')],'raw':!![]});})[_0xf05a('0x15')](function(_0x9bc005){if(_0x9bc005&&_0x9bc005['vidaooApiKey']&&_0x9bc005[_0xf05a('0x4d')]){_0x7bf4aa=_0x9bc005;var _0x453db8={'interaction':{'id':_0x4c9138},'agent':{'id':_0x25fa32[_0xf05a('0x4e')]['id'],'name':_0x25fa32[_0xf05a('0x4e')][_0xf05a('0x2a')],'fullname':_0x25fa32[_0xf05a('0x4e')][_0xf05a('0x4f')],'email':_0x25fa32[_0xf05a('0x4e')][_0xf05a('0x50')]},'contact':_0x25fa32[_0xf05a('0x2d')]['contact'],'account':_0x25fa32[_0xf05a('0x2d')][_0xf05a('0x30')]};var _0x1b4de6={'rejectUnauthorized':![],'method':_0xf05a('0x51'),'url':_0xf05a('0x52'),'headers':{'X-APIKEY':_0x9bc005[_0xf05a('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x25fa32[_0xf05a('0x4e')][_0xf05a('0x50')]],'buttons':null,'topic':_0x7bf4aa[_0xf05a('0x4b')],'note':_[_0xf05a('0x53')](_0x7bf4aa[_0xf05a('0x54')])?null:getMustacheRender(_0x7bf4aa[_0xf05a('0x54')],_0x453db8),'metadata':null},'redirect':_0xf05a('0x55'),'json':!![]};try{if(!_['isNull'](_0x7bf4aa[_0xf05a('0x4c')])){var _0x2b2ecc=getMustacheRender(_0x7bf4aa[_0xf05a('0x4c')],_0x453db8);var _0xaa097e=JSON['parse'](_0x2b2ecc);_0x1b4de6[_0xf05a('0x2d')][_0xf05a('0x56')]=_0xaa097e;}}catch(_0x1d0b6f){throw new db[(_0xf05a('0x57'))]['ValidationError'](_0xf05a('0x58'));}return rp(_0x1b4de6);}else{throw new db[(_0xf05a('0x57'))]['ValidationError'](_0xf05a('0x59'));}})[_0xf05a('0x15')](function(_0xdeb65c){_0x5b812b=_0xdeb65c;if(_0x5b812b['id']){var _0x363efc={'body':_0x5b812b[_0xf05a('0x5a')],'ChatWebsiteId':_0x7bf4aa['id'],'ChatInteractionId':_0xc269c2['id'],'direction':'out','UserId':_0x25fa32['user']['id']};return db[_0xf05a('0x5b')][_0xf05a('0x45')](_0x363efc,{});}else{throw new db['Sequelize']['ValidationError'](_0xf05a('0x5c'));}})[_0xf05a('0x15')](function(){return _0xc269c2['updateAttributes']({'vidaooSessionId':_0x5b812b['id']});})[_0xf05a('0x15')](respondWithResult(_0x3dfc74,null))[_0xf05a('0x1d')](handleError(_0x3dfc74,null));};exports[_0xf05a('0x5d')]=function(_0x3f2e3e,_0x251816){if(_0x3f2e3e['body']['id']){delete _0x3f2e3e[_0xf05a('0x2d')]['id'];}return db[_0xf05a('0x33')][_0xf05a('0x44')]({'where':{'id':_0x3f2e3e[_0xf05a('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':_0xf05a('0x5e')}]})[_0xf05a('0x15')](handleEntityNotFound(_0x251816,null))[_0xf05a('0x15')](saveUpdates(_0x3f2e3e[_0xf05a('0x2d')],null))[_0xf05a('0x15')](respondWithResult(_0x251816,null))[_0xf05a('0x1d')](handleError(_0x251816,null));};exports[_0xf05a('0x5f')]=function(_0x50e262,_0x349c8e){if(_0x50e262[_0xf05a('0x2d')]['id']){delete _0x50e262[_0xf05a('0x2d')]['id'];}return db[_0xf05a('0x33')]['find']({'where':{'id':_0x50e262[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](function(_0x5464e7){if(!_0x5464e7){logger[_0xf05a('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf05a('0x5f'),0x194,_0xf05a('0x60'));_0x349c8e[_0xf05a('0x1e')](0x194);}else{if(_0x5464e7['UserId']){throw new db[(_0xf05a('0x57'))][(_0xf05a('0x61'))]('Interaction\x20already\x20assigned');}}return _0x5464e7;})['then'](function(_0x43a9ae){if(_0x43a9ae){return _0x43a9ae[_0xf05a('0x27')]({'closed':_0x50e262[_0xf05a('0x2d')][_0xf05a('0x62')],'disposition':_0x50e262[_0xf05a('0x2d')][_0xf05a('0x63')]})[_0xf05a('0x15')](function(_0x1279dc){return _0x1279dc;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xf05a('0x5f'),_0x50e262[_0xf05a('0x2d')],client9004);})[_0xf05a('0x15')](respondWithResult(_0x349c8e,null))[_0xf05a('0x1d')](handleError(_0x349c8e,null));};exports[_0xf05a('0x64')]=function(_0x1c7d2e,_0x22d976){_0x1c7d2e[_0xf05a('0x2d')][_0xf05a('0x2a')]=_0x1c7d2e[_0xf05a('0x65')][_0xf05a('0x66')];_0x1c7d2e[_0xf05a('0x2d')][_0xf05a('0x67')]=_0x1c7d2e[_0xf05a('0x65')][_0xf05a('0x68')];_0x1c7d2e[_0xf05a('0x2d')][_0xf05a('0x36')]=_0x1c7d2e[_0xf05a('0x65')]['mimetype'];return db['Attachment'][_0xf05a('0x45')](_0x1c7d2e[_0xf05a('0x2d')])[_0xf05a('0x15')](respondWithResult(_0x22d976,0xc9))[_0xf05a('0x1d')](handleError(_0x22d976,null));};exports[_0xf05a('0x69')]=function(_0x5b77e7,_0xb64110){return db[_0xf05a('0x33')][_0xf05a('0x48')]({'where':{'id':_0x5b77e7['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xb64110,null))[_0xf05a('0x15')](function(_0x15bc55){if(_0x15bc55){if(_0x15bc55[_0xf05a('0x62')]){return _0xb64110[_0xf05a('0x1f')](0x193)['json']({'status':0x193,'message':_0xf05a('0x6a')});}return db[_0xf05a('0x6b')][_0xf05a('0x48')]({'where':{'id':_0x5b77e7['query'][_0xf05a('0x6c')]},'raw':!![]})[_0xf05a('0x15')](handleEntityNotFound(_0xb64110,null));}})[_0xf05a('0x15')](function(_0x24eb13){if(_0x24eb13){var _0x3eab95=_0x24eb13[_0xf05a('0x6d')]!==null;var _0x3d6de8=path[_0xf05a('0x6e')](config[_0xf05a('0x6f')],_0xf05a('0x70'));if(_0x3eab95){_0x3d6de8=path['join'](_0x3d6de8,_0xf05a('0x71'));}var _0x2701ff=path[_0xf05a('0x6e')](_0x3d6de8,_0x24eb13[_0xf05a('0x67')]);return _0xb64110[_0xf05a('0x72')](_0x2701ff);}})[_0xf05a('0x1d')](handleError(_0xb64110,null));};exports[_0xf05a('0x73')]=function(_0x284d5a,_0x489f2c){var _0xc61f08=null;var _0x58bacd=null;var _0x310884=null;if(_0x284d5a['body']['id']){delete _0x284d5a['body']['id'];}if(_0x284d5a[_0xf05a('0x2d')]['mailTranscript']){_0x310884=path[_0xf05a('0x6e')](config['root'],_0xf05a('0x74'),util[_0xf05a('0x75')](_0xf05a('0x76'),Date[_0xf05a('0x77')]()));_0x284d5a[_0xf05a('0x2d')][_0xf05a('0x78')]=_0x310884;}return db[_0xf05a('0x33')][_0xf05a('0x44')]({'where':{'id':_0x284d5a['params']['id']},'include':[{'model':db[_0xf05a('0x5b')],'as':'Messages','include':[{'model':db[_0xf05a('0x79')],'as':_0xf05a('0x79')}]}]})[_0xf05a('0x15')](handleEntityNotFound(_0x489f2c,null))['then'](saveUpdates(_0x284d5a['body'],null))[_0xf05a('0x15')](function(_0x4e671d){if(_0x4e671d){_0xc61f08=_0x4e671d;return db['ChatWebsite'][_0xf05a('0x44')]({'where':{'id':_0xc61f08[_0xf05a('0x7a')]}});}})[_0xf05a('0x15')](function(_0x3fc209){if(_0x3fc209){_0x58bacd=_0x3fc209;return db[_0xf05a('0x7b')]['find']({'where':{'id':_0xc61f08[_0xf05a('0x7c')]}});}})[_0xf05a('0x15')](function(_0x24fe28){if(_0x24fe28){if(_0x310884){var _0x73aef2=null;for(var _0x49da7d=0x1;_0x49da7d<_0xc61f08[_0xf05a('0x7d')][_0xf05a('0x41')];++_0x49da7d){_0x73aef2=_0xc61f08[_0xf05a('0x7d')][_0x49da7d];var _0x266a87=_0x73aef2[_0xf05a('0x7e')]?util['format']('%s%d',_0x58bacd[_0xf05a('0x7f')],_0x73aef2[_0xf05a('0x7e')]):'System';var _0x49a2e8=_0x284d5a['body'][_0xf05a('0x80')]||util['format'](_0xf05a('0x81'),'Visitor',_0x73aef2[_0xf05a('0x7c')]);switch(_0x58bacd['agentIdentifier']){case'website_alias':_0x266a87=_0x73aef2[_0xf05a('0x7e')]?util[_0xf05a('0x75')](_0xf05a('0x81'),_0x58bacd[_0xf05a('0x7f')],_0x73aef2['UserId']):_0xf05a('0x82');break;case _0xf05a('0x83'):_0x266a87=_0x73aef2['UserId']?_0x73aef2[_0xf05a('0x79')][_0xf05a('0x84')]||_0x73aef2[_0xf05a('0x79')][_0xf05a('0x4f')]:'System';break;case _0xf05a('0x85'):_0x266a87=_0x73aef2[_0xf05a('0x7e')]?_0x73aef2[_0xf05a('0x79')][_0xf05a('0x4f')]:_0xf05a('0x82');break;default:_0x266a87=_0x73aef2['UserId']?util[_0xf05a('0x75')](_0xf05a('0x81'),_0x58bacd[_0xf05a('0x7f')],_0x73aef2[_0xf05a('0x7e')]):_0xf05a('0x82');}var _0x48e0be=util[_0xf05a('0x75')](_0xf05a('0x86'),moment(_0x73aef2[_0xf05a('0x87')])[_0xf05a('0x75')](_0xf05a('0x88')),_0x73aef2[_0xf05a('0x89')]==='in'?_0x49a2e8:_0x266a87,_0x73aef2[_0xf05a('0x2d')]);if(!_0x73aef2[_0xf05a('0x8a')]){fs[_0xf05a('0x8b')](_0x310884,_0x48e0be);}}return db[_0xf05a('0x8c')][_0xf05a('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xf05a('0x8d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf05a('0x8e')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xf05a('0x15')](function(_0x272084){if(!_0x272084||!_0x272084[_0xf05a('0x8f')]||!_0x284d5a['body'])return _0xc61f08;var _0x443110=_0x272084[_0xf05a('0x90')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x443110,'message':{'from':util[_0xf05a('0x75')](_0xf05a('0x91'),_0x272084['name'],_0x272084[_0xf05a('0x50')]||_0x272084['Smtp'][_0xf05a('0x4e')]),'to':_0x284d5a['body'][_0xf05a('0x92')],'subject':'Mail\x20Transcript','text':util[_0xf05a('0x75')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x284d5a[_0xf05a('0x2d')][_0xf05a('0x92')]),'attachments':[{'path':_0x310884}]}})[_0xf05a('0x15')](function(){return _0xc61f08;})[_0xf05a('0x1d')](function(_0x44cc07){logger[_0xf05a('0x18')](_0x44cc07);});})[_0xf05a('0x15')](respondWithStatusCode(_0x489f2c,0xc8))[_0xf05a('0x1d')](handleError(_0x489f2c,null));};exports[_0xf05a('0x93')]=function(_0x1a55f0,_0x389cc3){return db[_0xf05a('0x5b')][_0xf05a('0x44')]({'where':{'id':_0x1a55f0[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0x389cc3,null))[_0xf05a('0x15')](function(_0x4bfb1d){if(_0x4bfb1d){return _0x4bfb1d[_0xf05a('0x93')](_0x1a55f0['body'][_0xf05a('0x94')],_[_0xf05a('0x95')](_0x1a55f0['body'],[_0xf05a('0x94'),'id'])||{});}})['then'](respondWithResult(_0x389cc3,null))['catch'](handleError(_0x389cc3,null));};exports[_0xf05a('0x96')]=function(_0xbdd398,_0x3337d3){var _0x27c723={'raw':![],'where':{}};var _0x3aa830={};var _0x2bfa97={'count':0x0,'rows':[]};return db[_0xf05a('0x33')][_0xf05a('0x48')]({'where':{'id':_0xbdd398[_0xf05a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3337d3,null))[_0xf05a('0x15')](function(_0x3892dc){if(_0x3892dc){_0x3aa830[_0xf05a('0x3f')]=_['keys'](db[_0xf05a('0x5b')][_0xf05a('0x34')]);_0x3aa830[_0xf05a('0x39')]=_[_0xf05a('0x3c')](_0xbdd398[_0xf05a('0x39')]);_0x3aa830['filters']=_['intersection'](_0x3aa830[_0xf05a('0x3f')],_0x3aa830[_0xf05a('0x39')]);_0x27c723[_0xf05a('0x40')]=_[_0xf05a('0x3e')](_0x3aa830['model'],qs[_0xf05a('0x97')](_0xbdd398['query'][_0xf05a('0x97')]));_0x27c723[_0xf05a('0x40')]=_0x27c723['attributes']['length']?_0x27c723[_0xf05a('0x40')]:_0x3aa830[_0xf05a('0x3f')];if(!_0xbdd398[_0xf05a('0x39')][_0xf05a('0x98')](_0xf05a('0x99'))){_0x27c723['limit']=qs[_0xf05a('0x23')](_0xbdd398[_0xf05a('0x39')][_0xf05a('0x23')]);_0x27c723[_0xf05a('0x21')]=qs['offset'](_0xbdd398['query'][_0xf05a('0x21')]);}_0x27c723[_0xf05a('0x9a')]=qs[_0xf05a('0x9b')](_0xbdd398['query']['sort']);_0x27c723[_0xf05a('0x9c')]=qs['filters'](_[_0xf05a('0x9d')](_0xbdd398[_0xf05a('0x39')],_0x3aa830[_0xf05a('0x3d')]));_0x27c723['where']['ChatInteractionId']=_0x3892dc['id'];if(_0xbdd398[_0xf05a('0x39')][_0xf05a('0x9e')]){_0x27c723[_0xf05a('0x9c')]=_[_0xf05a('0x2c')](_0x27c723[_0xf05a('0x9c')],{'$or':_[_0xf05a('0x32')](_0x27c723[_0xf05a('0x40')],function(_0x3996dd){var _0x441738={};_0x441738[_0x3996dd]={'$like':'%'+_0xbdd398[_0xf05a('0x39')]['filter']+'%'};return _0x441738;})});}if(_0xbdd398[_0xf05a('0x39')][_0xf05a('0x9f')]){var _0xe5224d=_0xbdd398[_0xf05a('0x39')][_0xf05a('0x9f')]['split'](',');var _0x51b6a5={};_0x51b6a5[_0xe5224d[0x0]]={'$gte':moment(_0xe5224d[0x1])[_0xf05a('0x75')](_0xf05a('0xa0'))};_0x27c723[_0xf05a('0x9c')]=_[_0xf05a('0x2c')](_0x27c723[_0xf05a('0x9c')],_0x51b6a5);}_0x27c723=_['merge']({},_0x27c723,_0xbdd398[_0xf05a('0x43')]);return db[_0xf05a('0x5b')][_0xf05a('0x24')]({'where':_0x27c723[_0xf05a('0x9c')]})[_0xf05a('0x15')](function(_0x5d451f){_0x2bfa97['count']=_0x5d451f;if(_0xbdd398[_0xf05a('0x39')][_0xf05a('0xa1')]){_0x27c723[_0xf05a('0x42')]=[{'all':!![]}];}return db[_0xf05a('0x5b')]['findAll'](_0x27c723);})[_0xf05a('0x15')](function(_0x1c2116){_0x2bfa97[_0xf05a('0xa2')]=_0x1c2116;return _0x2bfa97;});}})[_0xf05a('0x15')](respondWithFilteredResult(_0x3337d3,_0x27c723))[_0xf05a('0x1d')](handleError(_0x3337d3,null));};exports[_0xf05a('0xa3')]=function(_0x191ab2,_0x309ff8){var _0x2aef90={'where':{}},_0x4e6bf0={},_0x1fd288={'count':0x0,'rows':[]};return db[_0xf05a('0x33')][_0xf05a('0x48')]({'where':{'id':_0x191ab2[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0x309ff8,null))[_0xf05a('0x15')](function(_0x1f4ab7){if(_0x1f4ab7){_0x4e6bf0['model']=_[_0xf05a('0x3c')](db[_0xf05a('0x5b')][_0xf05a('0x34')]);_0x4e6bf0['query']=_[_0xf05a('0x3c')](_0x191ab2[_0xf05a('0x39')]);_0x4e6bf0[_0xf05a('0x3d')]=_[_0xf05a('0x3e')](_0x4e6bf0['model'],_0x4e6bf0[_0xf05a('0x39')]);_0x2aef90['attributes']=_[_0xf05a('0x3e')](_0x4e6bf0[_0xf05a('0x3f')],qs[_0xf05a('0x97')](_0x191ab2[_0xf05a('0x39')][_0xf05a('0x97')]));_0x2aef90[_0xf05a('0x40')]=_0x2aef90['attributes'][_0xf05a('0x41')]?_0x2aef90[_0xf05a('0x40')]:_0x4e6bf0[_0xf05a('0x3f')];if(!_0x191ab2[_0xf05a('0x39')]['hasOwnProperty']('nolimit')){_0x2aef90['limit']=qs[_0xf05a('0x23')](_0x191ab2[_0xf05a('0x39')]['limit']);_0x2aef90[_0xf05a('0x21')]=qs[_0xf05a('0x21')](_0x191ab2['query']['offset']);}_0x2aef90['order']=qs['sort'](_0x191ab2[_0xf05a('0x39')][_0xf05a('0x9b')]);_0x2aef90[_0xf05a('0x9c')]=qs[_0xf05a('0x3d')](_[_0xf05a('0x9d')](_0x191ab2[_0xf05a('0x39')],_0x4e6bf0[_0xf05a('0x3d')]));_0x2aef90[_0xf05a('0x9c')][_0xf05a('0xa4')]=_0x1f4ab7['id'];if(_0x191ab2[_0xf05a('0x39')][_0xf05a('0x9e')]){_0x2aef90[_0xf05a('0x9c')]=_['merge'](_0x2aef90['where'],{'$or':_[_0xf05a('0x32')](_0x2aef90[_0xf05a('0x40')],function(_0x5ce0ed){var _0x166811={};_0x166811[_0x5ce0ed]={'$like':'%'+_0x191ab2[_0xf05a('0x39')][_0xf05a('0x9e')]+'%'};return _0x166811;})});}_0x2aef90['where']['secret']=![];if(_0x191ab2[_0xf05a('0x39')]['id']){_0x2aef90[_0xf05a('0x9c')]['id']={'$gt':_0x191ab2[_0xf05a('0x39')]['id']};}_0x2aef90=_[_0xf05a('0x2c')]({},_0x2aef90,_0x191ab2['options']);return db['ChatMessage'][_0xf05a('0x24')]({'where':_0x2aef90[_0xf05a('0x9c')]})['then'](function(_0x5b36cf){_0x1fd288[_0xf05a('0x24')]=_0x5b36cf;_0x2aef90['include']=[];if(_0x191ab2[_0xf05a('0x39')][_0xf05a('0xa5')]){_0x2aef90['include'][_0xf05a('0xa6')]({'model':db[_0xf05a('0x79')],'as':_0xf05a('0x79'),'attributes':['id','fullname','alias']});}if(_0x191ab2[_0xf05a('0x39')][_0xf05a('0xa1')]){_0x2aef90[_0xf05a('0x42')]=[{'all':!![]}];}return db[_0xf05a('0x5b')][_0xf05a('0x38')](_0x2aef90);})[_0xf05a('0x15')](function(_0x3813fb){_0x1fd288[_0xf05a('0xa2')]=_0x3813fb;return _0x1fd288;});}})[_0xf05a('0x15')](respondWithFilteredResult(_0x309ff8,_0x2aef90))[_0xf05a('0x1d')](handleError(_0x309ff8,null));};exports['addTags']=function(_0x578396,_0x3d2c15){return db[_0xf05a('0x33')]['find']({'where':{'id':_0x578396[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0x3d2c15,null))['then'](function(_0x32a521){if(_0x32a521){return _0x32a521[_0xf05a('0xa7')](_0x578396['body'][_0xf05a('0x94')],_[_0xf05a('0x95')](_0x578396[_0xf05a('0x2d')],[_0xf05a('0x94'),'id'])||{})[_0xf05a('0xa8')](function(){return db['Tag'][_0xf05a('0x38')]({'attributes':['id',_0xf05a('0x2a'),'color'],'where':{'id':_0x578396[_0xf05a('0x2d')][_0xf05a('0x94')]}});})[_0xf05a('0x15')](function(_0x15a9aa){socket['emit'](_0xf05a('0xa9'),{'id':Number(_0x578396['params']['id']),'tags':_0x15a9aa||[]});return{'id':Number(_0x578396[_0xf05a('0x3b')]['id']),'tags':_0x15a9aa||[]};});}})[_0xf05a('0x15')](respondWithResult(_0x3d2c15,null))[_0xf05a('0x1d')](handleError(_0x3d2c15,null));};exports['removeTags']=function(_0x53dbc1,_0xc343cc){return db['ChatInteraction'][_0xf05a('0x44')]({'where':{'id':_0x53dbc1[_0xf05a('0x3b')]['id']}})[_0xf05a('0x15')](handleEntityNotFound(_0xc343cc,null))[_0xf05a('0x15')](function(_0x3b4b91){if(_0x3b4b91){return _0x3b4b91[_0xf05a('0xaa')](_0x53dbc1[_0xf05a('0x39')][_0xf05a('0x94')]);}})[_0xf05a('0x15')](respondWithStatusCode(_0xc343cc,null))[_0xf05a('0x1d')](handleError(_0xc343cc,null));};exports['download']=function(_0x43c6e0,_0x289691){var _0x45c193=moment()[_0xf05a('0xab')]()[_0xf05a('0xac')]();var _0x471437=path[_0xf05a('0x6e')](config['root'],_0xf05a('0xad'),_0xf05a('0xae'),'tmp');var _0x3b6ed8=path[_0xf05a('0x6e')](config[_0xf05a('0x6f')],'server',_0xf05a('0xae'),'attachments');var _0x3617c6=path[_0xf05a('0x6e')](_0x471437,_0x45c193);var _0x53446d=util[_0xf05a('0x75')](_0xf05a('0xaf'),_0x43c6e0[_0xf05a('0x3b')]['id'],_0x45c193);var _0x109f00=path['join'](_0x471437,_0x53446d);var _0x32e60e=[];_0x32e60e[_0xf05a('0xa6')]({'model':db['User'],'as':_0xf05a('0x79'),'attributes':['id',_0xf05a('0x4f')],'raw':!![]});_0x32e60e[_0xf05a('0xa6')]({'model':db[_0xf05a('0x7b')],'as':_0xf05a('0x5e'),'attributes':['id',_0xf05a('0xb0'),'lastName'],'raw':!![]});if(_0x43c6e0[_0xf05a('0x39')][_0xf05a('0xb1')]){_0x32e60e[_0xf05a('0xa6')]({'model':db[_0xf05a('0x6b')],'as':_0xf05a('0x6b'),'raw':!![]});}var _0x20aeb8=[{'model':db[_0xf05a('0x5b')],'as':_0xf05a('0x7d'),'attributes':['id','body','createdAt',_0xf05a('0x89'),_0xf05a('0x8a'),_0xf05a('0xb2')],'include':_0x32e60e}];_0x20aeb8[_0xf05a('0xa6')]({'model':db['ChatWebsite'],'as':_0xf05a('0xb3'),'attributes':['id',_0xf05a('0x2a')]});_0x20aeb8[_0xf05a('0xa6')]({'model':db['User'],'as':_0xf05a('0xb4'),'attributes':['id',_0xf05a('0x4f')]});return db[_0xf05a('0x33')]['find']({'where':{'id':_0x43c6e0[_0xf05a('0x3b')]['id']},'include':_0x20aeb8})[_0xf05a('0x15')](handleEntityNotFound(_0x289691,null))[_0xf05a('0x15')](function(_0x3af7cd){if(_0x3af7cd){var _0xb6b969=_0x3af7cd[_0xf05a('0xb5')]({'plain':!![]});fs[_0xf05a('0xb6')](_0x3617c6);var _0xe70e48={'channel':_0xf05a('0xb7'),'account':_0xb6b969['Account'][_0xf05a('0x2a')],'agent':_0xb6b969['Owner']?_0xb6b969['Owner'][_0xf05a('0x4f')]:'N.A.','createdAt':moment(_0xb6b969['createdAt'])[_0xf05a('0x75')](_0xf05a('0xa0'))['toString'](),'closedAt':_0xb6b969['closed']?moment(_0xb6b969[_0xf05a('0xb8')])[_0xf05a('0x75')](_0xf05a('0xa0'))[_0xf05a('0xac')]():'','disposition':_0xb6b969[_0xf05a('0x63')],'chatInfo':{'browser':_0xb6b969[_0xf05a('0xb9')],'os':_0xb6b969[_0xf05a('0xba')],'referer':_0xb6b969[_0xf05a('0xbb')],'customerIp':_0xb6b969['customerIp'],'customerPort':_0xb6b969[_0xf05a('0xbc')]?_0xb6b969[_0xf05a('0xbc')]:_0xf05a('0xbd')},'messages':_(_0xb6b969[_0xf05a('0x7d')])[_0xf05a('0xbe')]()[_0xf05a('0x9e')]({'secret':![]})['map'](function(_0x428175){if(_0x428175[_0xf05a('0x6b')]){var _0x300e84=path[_0xf05a('0x6e')](_0x3b6ed8,_0x428175[_0xf05a('0x6b')][_0xf05a('0x67')]);if(fs[_0xf05a('0xbf')](_0x300e84)){fs[_0xf05a('0xc0')](_0x300e84)[_0xf05a('0xc1')](fs[_0xf05a('0xc2')](path[_0xf05a('0x6e')](_0x3617c6,_0x428175[_0xf05a('0x6b')][_0xf05a('0x67')])));}}return{'date':moment(_0x428175[_0xf05a('0x87')])['format'](_0xf05a('0xa0'))[_0xf05a('0xac')](),'sender':_0x428175['direction']===_0xf05a('0xc3')?_0x428175[_0xf05a('0x79')]?_0x428175[_0xf05a('0x79')][_0xf05a('0x4f')]:_0xf05a('0x82'):_0x428175[_0xf05a('0x5e')][_0xf05a('0xb0')]+(_0x428175[_0xf05a('0x5e')][_0xf05a('0xc4')]?'\x20'+_0x428175[_0xf05a('0x5e')][_0xf05a('0xc4')]:''),'body':_0x428175[_0xf05a('0x6b')]?_0x428175['Attachment'][_0xf05a('0x67')]:_0x428175[_0xf05a('0x2d')],'direction':_0x428175[_0xf05a('0x89')]===_0xf05a('0xc3')?'A':'C','secret':_0x428175[_0xf05a('0x8a')],'read':_0x428175[_0xf05a('0xb2')],'attachment':_0x428175[_0xf05a('0x6b')]};})[_0xf05a('0xc5')]()};return ejs[_0xf05a('0xc6')](path['join'](config[_0xf05a('0x6f')],_0xf05a('0xad'),_0xf05a('0xc7'),_0xf05a('0xc8')),{'interaction':_0xe70e48})['then'](function(_0x413ea4){var _0x1eb67a=path[_0xf05a('0x6e')](_0x3617c6,_0xf05a('0xc9')+_0xb6b969['id']+'-'+_0x45c193+_0xf05a('0xca'));var _0x2b44e7={'path':_0x1eb67a,'channel':_0xf05a('0xb7'),'interactionId':_0xb6b969['id']};return pdf[_0xf05a('0xcb')](_0x413ea4,_0x2b44e7);})[_0xf05a('0x15')](function(){return new Promise(function(_0x59efef,_0x1fdf82){zipdir(_0x3617c6,{'saveTo':_0x109f00},function(_0x2de905,_0x27c648){if(_0x2de905)return _0x1fdf82(_0x2de905);return _0x59efef(_0x27c648);});})[_0xf05a('0x15')](function(){return new BPromise(function(_0x448774,_0x34bf9a){rimraf(_0x3617c6,function(_0x497f5f){if(_0x497f5f)_0x34bf9a(_0x497f5f);return _0x448774();});});})[_0xf05a('0x15')](function(){return _0x289691[_0xf05a('0x72')](_0x109f00,_0x53446d,function(_0x1868cb){if(_0x1868cb){logger['error'](_0xf05a('0xcc'),_0x1868cb);}else{fs[_0xf05a('0xcd')](_0x109f00);}});});});}else{return _0x289691[_0xf05a('0x1e')](0xc8);}})[_0xf05a('0x1d')](handleError(_0x289691,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 5a4b36b..4ea2da4 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 _0x8f80=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0x3a4a2a,_0x5ad762){var _0x4789f2=function(_0x1a1143){while(--_0x1a1143){_0x3a4a2a['push'](_0x3a4a2a['shift']());}};_0x4789f2(++_0x5ad762);}(_0x8f80,0x1e5));var _0x08f8=function(_0x4851a3,_0x1c2477){_0x4851a3=_0x4851a3-0x0;var _0x412591=_0x8f80[_0x4851a3];return _0x412591;};'use strict';var EventEmitter=require(_0x08f8('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x08f8('0x1')];var ChatMessage=require(_0x08f8('0x2'))['db'][_0x08f8('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x08f8('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x08f8('0x5'),'afterDestroy':_0x08f8('0x6')};function emitEvent(_0x2a0ffe){return function(_0x484a1e,_0x3b3f98,_0xcc3b7a){_0x484a1e[_0x08f8('0x7')]({'attributes':['id'],'raw':!![]})[_0x08f8('0x8')](function(_0x40f175){_0x484a1e['setDataValue'](_0x08f8('0x9'),_0x40f175[_0x08f8('0xa')](function(_0x46c9f5){return{'id':_0x46c9f5['id']};}));return ChatMessage[_0x08f8('0xb')]({'where':{'ChatInteractionId':_0x484a1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x08f8('0x8')](function(_0x1d0c66){_0x484a1e['setDataValue'](_0x08f8('0xc'),_0x1d0c66[_0x08f8('0xd')]);ChatInteractionEvents['emit'](_0x2a0ffe+':'+_0x484a1e['id'],_0x484a1e);ChatInteractionEvents[_0x08f8('0xe')](_0x2a0ffe,_0x484a1e);_0xcc3b7a(null);})[_0x08f8('0xf')](_0xcc3b7a(null));};}for(var e in events){if(events[_0x08f8('0x10')](e)){var event=events[e];ChatInteraction[_0x08f8('0x11')](e,emitEvent(event));}}module[_0x08f8('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xa5af=['setDataValue','map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x2b048e,_0x5abd64){var _0x2f5d57=function(_0x377a1a){while(--_0x377a1a){_0x2b048e['push'](_0x2b048e['shift']());}};_0x2f5d57(++_0x5abd64);}(_0xa5af,0xf7));var _0xfa5a=function(_0x348558,_0x27f9b4){_0x348558=_0x348558-0x0;var _0x14f0aa=_0xa5af[_0x348558];return _0x14f0aa;};'use strict';var EventEmitter=require(_0xfa5a('0x0'));var ChatInteraction=require(_0xfa5a('0x1'))['db'][_0xfa5a('0x2')];var ChatMessage=require(_0xfa5a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfa5a('0x3')](0x0);var events={'afterCreate':_0xfa5a('0x4'),'afterUpdate':_0xfa5a('0x5'),'afterDestroy':_0xfa5a('0x6')};function emitEvent(_0x3f204c){return function(_0x5ad5f8,_0x5a99b3,_0x1b652d){_0x5ad5f8[_0xfa5a('0x7')]({'attributes':['id'],'raw':!![]})[_0xfa5a('0x8')](function(_0x8f7f5e){_0x5ad5f8[_0xfa5a('0x9')]('Users',_0x8f7f5e[_0xfa5a('0xa')](function(_0xdb6ce0){return{'id':_0xdb6ce0['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ad5f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5f13e3){_0x5ad5f8[_0xfa5a('0x9')]('unreadMessages',_0x5f13e3[_0xfa5a('0xb')]);ChatInteractionEvents[_0xfa5a('0xc')](_0x3f204c+':'+_0x5ad5f8['id'],_0x5ad5f8);ChatInteractionEvents['emit'](_0x3f204c,_0x5ad5f8);_0x1b652d(null);})[_0xfa5a('0xd')](_0x1b652d(null));};}for(var e in events){if(events[_0xfa5a('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xfa5a('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 1f7dad6..80333e4 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 _0x5cd8=['moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x160375,_0x2a5076){var _0x18ae3a=function(_0x59289e){while(--_0x59289e){_0x160375['push'](_0x160375['shift']());}};_0x18ae3a(++_0x2a5076);}(_0x5cd8,0x10c));var _0x85cd=function(_0x1de9d7,_0x60a24a){_0x1de9d7=_0x1de9d7-0x0;var _0x28acb0=_0x5cd8[_0x1de9d7];return _0x28acb0;};'use strict';var _=require(_0x85cd('0x0'));var util=require('util');var logger=require(_0x85cd('0x1'))('api');var moment=require(_0x85cd('0x2'));var BPromise=require('bluebird');var rp=require(_0x85cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85cd('0x4'));var attributes=require(_0x85cd('0x5'));module[_0x85cd('0x6')]=function(_0x23fb4b,_0x1429b1){return _0x23fb4b[_0x85cd('0x7')](_0x85cd('0x8'),attributes,{'tableName':_0x85cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ac95a,_0x21efeb,_0x4f044c){if(_0x3ac95a['changed'](_0x85cd('0xa'))){_0x3ac95a[_0x85cd('0xb')]=moment()[_0x85cd('0xc')](_0x85cd('0xd'));}_0x4f044c(null,_0x3ac95a);}},'charset':'utf8mb4','collate':_0x85cd('0xe')});}; \ No newline at end of file +var _0xa2bd=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x401ec9,_0x77c73f){var _0x8ef3a1=function(_0x171c3c){while(--_0x171c3c){_0x401ec9['push'](_0x401ec9['shift']());}};_0x8ef3a1(++_0x77c73f);}(_0xa2bd,0x1ca));var _0xda2b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa2bd[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xda2b('0x0'));var util=require(_0xda2b('0x1'));var logger=require(_0xda2b('0x2'))(_0xda2b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda2b('0x4'));var fs=require('fs');var path=require(_0xda2b('0x5'));var rimraf=require('rimraf');var config=require(_0xda2b('0x6'));var attributes=require(_0xda2b('0x7'));module[_0xda2b('0x8')]=function(_0x5e0b0a,_0x5466df){return _0x5e0b0a[_0xda2b('0x9')](_0xda2b('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x164840,_0x17ebaf,_0x2c2805){if(_0x164840[_0xda2b('0xb')](_0xda2b('0xc'))){_0x164840[_0xda2b('0xd')]=moment()[_0xda2b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2c2805(null,_0x164840);}},'charset':'utf8mb4','collate':_0xda2b('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 3191a1e..3c5e260 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 _0x6578=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x6578,0x1d2));var _0x8657=function(_0x1f9bfb,_0x4c19c2){_0x1f9bfb=_0x1f9bfb-0x0;var _0x315ba3=_0x6578[_0x1f9bfb];return _0x315ba3;};'use strict';var _=require(_0x8657('0x0'));var util=require(_0x8657('0x1'));var moment=require(_0x8657('0x2'));var BPromise=require(_0x8657('0x3'));var rs=require(_0x8657('0x4'));var fs=require('fs');var Redis=require(_0x8657('0x5'));var db=require(_0x8657('0x6'))['db'];var utils=require(_0x8657('0x7'));var logger=require(_0x8657('0x8'))(_0x8657('0x9'));var config=require(_0x8657('0xa'));var jayson=require(_0x8657('0xb'));var client=jayson[_0x8657('0xc')][_0x8657('0xd')]({'port':0x232a});config['redis']=_[_0x8657('0xe')](config['redis'],{'host':_0x8657('0xf'),'port':0x18eb});var socket=require(_0x8657('0x10'))(new Redis(config[_0x8657('0x11')]));require(_0x8657('0x12'))['register'](socket);function respondWithRpcPromise(_0x1df80a,_0x1be036,_0x4d6be4){return new BPromise(function(_0x5dbeaf,_0x1c858d){return client[_0x8657('0x13')](_0x1df80a,_0x4d6be4)[_0x8657('0x14')](function(_0x538367){logger[_0x8657('0x15')](_0x8657('0x16'),_0x1be036,_0x8657('0x17'));logger[_0x8657('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1be036,_0x8657('0x17'),JSON[_0x8657('0x19')](_0x538367));if(_0x538367[_0x8657('0x1a')]){if(_0x538367[_0x8657('0x1a')]['code']===0x1f4){logger[_0x8657('0x1a')](_0x8657('0x16'),_0x1be036,_0x538367['error']['message']);return _0x1c858d(_0x538367[_0x8657('0x1a')][_0x8657('0x1b')]);}logger['error'](_0x8657('0x16'),_0x1be036,_0x538367[_0x8657('0x1a')][_0x8657('0x1b')]);return _0x5dbeaf(_0x538367[_0x8657('0x1a')][_0x8657('0x1b')]);}else{logger['info'](_0x8657('0x16'),_0x1be036,_0x8657('0x17'));_0x5dbeaf(_0x538367['result'][_0x8657('0x1b')]);}})[_0x8657('0x1c')](function(_0x346681){logger[_0x8657('0x1a')](_0x8657('0x16'),_0x1be036,_0x346681);_0x1c858d(_0x346681);});});}exports['UpdateChatInteraction']=function(_0x8c03e2){var _0x265073=this;return new Promise(function(_0x397643,_0x2e5797){return db[_0x8657('0x1d')][_0x8657('0x1e')](_0x8c03e2['body'],{'raw':_0x8c03e2[_0x8657('0x1f')]?_0x8c03e2[_0x8657('0x1f')][_0x8657('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8c03e2[_0x8657('0x1f')]?_0x8c03e2[_0x8657('0x1f')][_0x8657('0x21')]||null:null,'attributes':_0x8c03e2['options']?_0x8c03e2[_0x8657('0x1f')][_0x8657('0x22')]||null:null,'limit':_0x8c03e2[_0x8657('0x1f')]?_0x8c03e2[_0x8657('0x1f')][_0x8657('0x23')]||null:null})[_0x8657('0x14')](function(_0x4c97b3){logger[_0x8657('0x15')](_0x8657('0x24'),_0x8c03e2);logger[_0x8657('0x18')]('UpdateChatInteraction',_0x8c03e2,JSON[_0x8657('0x19')](_0x4c97b3));_0x397643(_0x4c97b3);})[_0x8657('0x1c')](function(_0x31f201){logger['error'](_0x8657('0x24'),_0x31f201[_0x8657('0x1b')],_0x8c03e2);_0x2e5797(_0x265073[_0x8657('0x1a')](0x1f4,_0x31f201[_0x8657('0x1b')]));});});};exports[_0x8657('0x25')]=function(_0x4497dd){return new Promise(function(_0x1aa404,_0x5640e4){return db[_0x8657('0x1d')][_0x8657('0x26')]({'where':_0x4497dd[_0x8657('0x1f')]?_0x4497dd[_0x8657('0x1f')][_0x8657('0x21')]||null:null})[_0x8657('0x14')](function(_0x1cbbb4){if(_0x1cbbb4){return _0x1cbbb4[_0x8657('0x27')](_0x4497dd[_0x8657('0x28')][_0x8657('0x29')],_['omit'](_0x4497dd['body'],[_0x8657('0x29'),'id'])||{});}})['spread'](function(_0x5edd29){logger[_0x8657('0x15')]('AddTags',_0x4497dd);logger['debug'](_0x8657('0x2a'),_0x4497dd,JSON[_0x8657('0x19')](_0x5edd29));_0x1aa404(_0x5edd29);})[_0x8657('0x1c')](function(_0x345d0e){logger['error']('AddTags',_0x345d0e[_0x8657('0x1b')],_0x4497dd);_0x5640e4(_this[_0x8657('0x1a')](0x1f4,_0x345d0e[_0x8657('0x1b')]));});});}; \ No newline at end of file +var _0x1230=['request\x20sent','debug','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','limit','AddTagsToChatInteraction','find','addTags','body','ids','spread','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x4c0006,_0x44bcf6){var _0x16c4c6=function(_0x3716e7){while(--_0x3716e7){_0x4c0006['push'](_0x4c0006['shift']());}};_0x16c4c6(++_0x44bcf6);}(_0x1230,0x1ce));var _0x0123=function(_0x2f055f,_0xf2e2a5){_0x2f055f=_0x2f055f-0x0;var _0x4c78e9=_0x1230[_0x2f055f];return _0x4c78e9;};'use strict';var _=require(_0x0123('0x0'));var util=require(_0x0123('0x1'));var moment=require(_0x0123('0x2'));var BPromise=require(_0x0123('0x3'));var rs=require(_0x0123('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0123('0x5'));var logger=require('../../config/logger')(_0x0123('0x6'));var config=require(_0x0123('0x7'));var jayson=require(_0x0123('0x8'));var client=jayson[_0x0123('0x9')]['http']({'port':0x232a});config[_0x0123('0xa')]=_['defaults'](config[_0x0123('0xa')],{'host':_0x0123('0xb'),'port':0x18eb});var socket=require(_0x0123('0xc'))(new Redis(config[_0x0123('0xa')]));require(_0x0123('0xd'))[_0x0123('0xe')](socket);function respondWithRpcPromise(_0x135ed8,_0x327e5a,_0x2b0071){return new BPromise(function(_0x467bef,_0x4703a7){return client[_0x0123('0xf')](_0x135ed8,_0x2b0071)[_0x0123('0x10')](function(_0x6c1e9){logger[_0x0123('0x11')](_0x0123('0x12'),_0x327e5a,_0x0123('0x13'));logger[_0x0123('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x327e5a,_0x0123('0x13'),JSON[_0x0123('0x15')](_0x6c1e9));if(_0x6c1e9[_0x0123('0x16')]){if(_0x6c1e9['error']['code']===0x1f4){logger[_0x0123('0x16')](_0x0123('0x12'),_0x327e5a,_0x6c1e9[_0x0123('0x16')][_0x0123('0x17')]);return _0x4703a7(_0x6c1e9[_0x0123('0x16')]['message']);}logger[_0x0123('0x16')](_0x0123('0x12'),_0x327e5a,_0x6c1e9[_0x0123('0x16')][_0x0123('0x17')]);return _0x467bef(_0x6c1e9['error'][_0x0123('0x17')]);}else{logger['info'](_0x0123('0x12'),_0x327e5a,_0x0123('0x13'));_0x467bef(_0x6c1e9[_0x0123('0x18')][_0x0123('0x17')]);}})[_0x0123('0x19')](function(_0x2a65c9){logger[_0x0123('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x327e5a,_0x2a65c9);_0x4703a7(_0x2a65c9);});});}exports[_0x0123('0x1a')]=function(_0x5f42f7){var _0x29992e=this;return new Promise(function(_0x2a0b16,_0x63fc7b){return db[_0x0123('0x1b')][_0x0123('0x1c')](_0x5f42f7['body'],{'raw':_0x5f42f7['options']?_0x5f42f7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f42f7[_0x0123('0x1d')]?_0x5f42f7[_0x0123('0x1d')]['where']||null:null,'attributes':_0x5f42f7[_0x0123('0x1d')]?_0x5f42f7[_0x0123('0x1d')]['attributes']||null:null,'limit':_0x5f42f7['options']?_0x5f42f7[_0x0123('0x1d')][_0x0123('0x1e')]||null:null})[_0x0123('0x10')](function(_0x13e46e){logger[_0x0123('0x11')](_0x0123('0x1a'),_0x5f42f7);logger[_0x0123('0x14')](_0x0123('0x1a'),_0x5f42f7,JSON['stringify'](_0x13e46e));_0x2a0b16(_0x13e46e);})[_0x0123('0x19')](function(_0x1a851f){logger['error'](_0x0123('0x1a'),_0x1a851f[_0x0123('0x17')],_0x5f42f7);_0x63fc7b(_0x29992e[_0x0123('0x16')](0x1f4,_0x1a851f[_0x0123('0x17')]));});});};exports[_0x0123('0x1f')]=function(_0x43fecc){return new Promise(function(_0x3af059,_0x473a0b){return db['ChatInteraction'][_0x0123('0x20')]({'where':_0x43fecc['options']?_0x43fecc[_0x0123('0x1d')]['where']||null:null})[_0x0123('0x10')](function(_0x329e11){if(_0x329e11){return _0x329e11[_0x0123('0x21')](_0x43fecc[_0x0123('0x22')][_0x0123('0x23')],_['omit'](_0x43fecc[_0x0123('0x22')],[_0x0123('0x23'),'id'])||{});}})[_0x0123('0x24')](function(_0x54fbfb){logger[_0x0123('0x11')]('AddTags',_0x43fecc);logger[_0x0123('0x14')]('AddTags',_0x43fecc,JSON[_0x0123('0x15')](_0x54fbfb));_0x3af059(_0x54fbfb);})[_0x0123('0x19')](function(_0x3ec612){logger[_0x0123('0x16')]('AddTags',_0x3ec612['message'],_0x43fecc);_0x473a0b(_this[_0x0123('0x16')](0x1f4,_0x3ec612[_0x0123('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 85c2c63..7524a4f 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 _0x4843=['./chatInteraction.events','save','remove'];(function(_0x39b793,_0xe18eae){var _0x112de8=function(_0x2fe6d7){while(--_0x2fe6d7){_0x39b793['push'](_0x39b793['shift']());}};_0x112de8(++_0xe18eae);}(_0x4843,0x7e));var _0x3484=function(_0x3812b5,_0x234562){_0x3812b5=_0x3812b5-0x0;var _0x4b0b2=_0x4843[_0x3812b5];return _0x4b0b2;};'use strict';var ChatInteractionEvents=require(_0x3484('0x0'));var events=[_0x3484('0x1'),_0x3484('0x2'),'update'];function createListener(_0x2f44fd,_0x42e2a9){return function(_0x5277b0){_0x42e2a9['emit'](_0x2f44fd,_0x5277b0);};}function removeListener(_0x2c18cd,_0x13e752){return function(){ChatInteractionEvents['removeListener'](_0x2c18cd,_0x13e752);};}exports['register']=function(_0x547fb4){for(var _0x57201f=0x0,_0x3c55e4=events['length'];_0x57201f<_0x3c55e4;_0x57201f++){var _0x53b468=events[_0x57201f];var _0x2e434d=createListener('chatInteraction:'+_0x53b468,_0x547fb4);ChatInteractionEvents['on'](_0x53b468,_0x2e434d);}}; \ No newline at end of file +var _0x4398=['register','length','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x43cb78,_0x43b90d){var _0x3a05ae=function(_0x4440dc){while(--_0x4440dc){_0x43cb78['push'](_0x43cb78['shift']());}};_0x3a05ae(++_0x43b90d);}(_0x4398,0x14b));var _0x8439=function(_0x1a3572,_0x5b7ce7){_0x1a3572=_0x1a3572-0x0;var _0x1a2d35=_0x4398[_0x1a3572];return _0x1a2d35;};'use strict';var ChatInteractionEvents=require(_0x8439('0x0'));var events=['save',_0x8439('0x1'),_0x8439('0x2')];function createListener(_0x1df4bc,_0x40259e){return function(_0x3ae374){_0x40259e[_0x8439('0x3')](_0x1df4bc,_0x3ae374);};}function removeListener(_0x165866,_0x349e1a){return function(){ChatInteractionEvents[_0x8439('0x4')](_0x165866,_0x349e1a);};}exports[_0x8439('0x5')]=function(_0x1eb765){for(var _0x19345b=0x0,_0x1a24f2=events[_0x8439('0x6')];_0x19345b<_0x1a24f2;_0x19345b++){var _0x509809=events[_0x19345b];var _0x1e5fba=createListener(_0x8439('0x7')+_0x509809,_0x1eb765);ChatInteractionEvents['on'](_0x509809,_0x1e5fba);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4ea1ab2..2534613 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 _0xf204=['/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','server/files/attachments/','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','isAuthenticated','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xf204,0x79));var _0x4f20=function(_0x56ffb4,_0xe7da83){_0x56ffb4=_0x56ffb4-0x0;var _0x86f6d3=_0xf204[_0x56ffb4];return _0x86f6d3;};'use strict';var multer=require(_0x4f20('0x0'));var util=require('util');var path=require(_0x4f20('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f20('0x2'));var router=express[_0x4f20('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f20('0x5'));var controller=require(_0x4f20('0x6'));router[_0x4f20('0x7')]('/',auth['isAuthenticated'](),controller[_0x4f20('0x8')]);router['get']('/describe',auth[_0x4f20('0x9')](),controller['describe']);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0x4f20('0xa')]);router[_0x4f20('0x7')](_0x4f20('0xb'),auth[_0x4f20('0xc')](),controller[_0x4f20('0xd')]);router[_0x4f20('0x7')](_0x4f20('0xe'),auth[_0x4f20('0x9')](),controller[_0x4f20('0xf')]);router['get'](_0x4f20('0x10'),auth[_0x4f20('0xc')](),controller[_0x4f20('0x11')]);router['get'](_0x4f20('0x12'),auth['isAuthenticated'](),controller[_0x4f20('0x13')]);router['post']('/',auth[_0x4f20('0x9')](),controller['create']);router[_0x4f20('0x14')](_0x4f20('0x15'),auth[_0x4f20('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4f20('0x16')]({'destination':function(_0x718ce9,_0x2a870f,_0xf28f06){_0xf28f06(null,path['join'](config['root'],_0x4f20('0x17')));},'filename':function(_0x15fc01,_0x529627,_0x71c0b){_0x71c0b(null,util['format'](_0x4f20('0x18'),Date['now'](),_0x529627[_0x4f20('0x19')][_0x4f20('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x4f20('0x1b'),upload[_0x4f20('0x1c')](_0x4f20('0x1d')),controller[_0x4f20('0x1e')]);router['post'](_0x4f20('0xe'),auth[_0x4f20('0xc')](),controller[_0x4f20('0x1f')]);router[_0x4f20('0x14')](_0x4f20('0x20'),auth[_0x4f20('0x9')](),interaction[_0x4f20('0x21')](_0x4f20('0x22'),_0x4f20('0x23')),controller[_0x4f20('0x24')]);router[_0x4f20('0x25')](_0x4f20('0x26'),auth[_0x4f20('0x9')](),interaction[_0x4f20('0x21')](_0x4f20('0x22'),_0x4f20('0x27')),controller['update']);router[_0x4f20('0x25')](_0x4f20('0x28'),controller[_0x4f20('0x29')]);router['put'](_0x4f20('0x2a'),auth[_0x4f20('0xc')](),controller[_0x4f20('0x2b')]);router[_0x4f20('0x25')]('/:id/close',controller[_0x4f20('0x2c')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x4f20('0x21')]('chat','chatinteraction:destroy'),controller['destroy']);router['delete'](_0x4f20('0x20'),auth[_0x4f20('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x9ac6=['/:id/tags','tracked','chat','chatinteraction:update','update','put','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload'];(function(_0x551336,_0x298cbe){var _0x304c3a=function(_0x324c4d){while(--_0x324c4d){_0x551336['push'](_0x551336['shift']());}};_0x304c3a(++_0x298cbe);}(_0x9ac6,0xe7));var _0x69ac=function(_0x2ae93a,_0x4e9ea9){_0x2ae93a=_0x2ae93a-0x0;var _0x2e5ac0=_0x9ac6[_0x2ae93a];return _0x2e5ac0;};'use strict';var multer=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var path=require('path');var timeout=require(_0x69ac('0x2'));var express=require(_0x69ac('0x3'));var router=express[_0x69ac('0x4')]();var fs_extra=require(_0x69ac('0x5'));var auth=require(_0x69ac('0x6'));var interaction=require(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var controller=require(_0x69ac('0x9'));router['get']('/',auth[_0x69ac('0xa')](),controller[_0x69ac('0xb')]);router['get'](_0x69ac('0xc'),auth[_0x69ac('0xa')](),controller['describe']);router[_0x69ac('0xd')](_0x69ac('0xe'),auth[_0x69ac('0xf')](),controller['show']);router[_0x69ac('0xd')](_0x69ac('0x10'),auth[_0x69ac('0xf')](),controller[_0x69ac('0x11')]);router[_0x69ac('0xd')](_0x69ac('0x12'),auth['isAuthenticated'](),controller[_0x69ac('0x13')]);router[_0x69ac('0xd')](_0x69ac('0x14'),auth[_0x69ac('0xf')](),controller[_0x69ac('0x15')]);router[_0x69ac('0xd')]('/:id/download',auth['isAuthenticated'](),controller[_0x69ac('0x16')]);router[_0x69ac('0x17')]('/',auth['isAuthenticated'](),controller[_0x69ac('0x18')]);router[_0x69ac('0x17')](_0x69ac('0x19'),auth[_0x69ac('0xa')](),controller[_0x69ac('0x1a')]);var upload=multer({'storage':multer[_0x69ac('0x1b')]({'destination':function(_0x5ebc8e,_0x1d3cd7,_0x12f475){_0x12f475(null,path[_0x69ac('0x1c')](config[_0x69ac('0x1d')],_0x69ac('0x1e')));},'filename':function(_0x39f424,_0x2c9afb,_0x272aa0){_0x272aa0(null,util[_0x69ac('0x1f')](_0x69ac('0x20'),Date[_0x69ac('0x21')](),_0x2c9afb[_0x69ac('0x22')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x69ac('0x17')](_0x69ac('0x23'),upload[_0x69ac('0x24')](_0x69ac('0x25')),controller[_0x69ac('0x26')]);router[_0x69ac('0x17')](_0x69ac('0x12'),auth[_0x69ac('0xf')](),controller['addMessage']);router[_0x69ac('0x17')](_0x69ac('0x27'),auth[_0x69ac('0xa')](),interaction[_0x69ac('0x28')](_0x69ac('0x29'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0x69ac('0xe'),auth[_0x69ac('0xa')](),interaction[_0x69ac('0x28')](_0x69ac('0x29'),_0x69ac('0x2a')),controller[_0x69ac('0x2b')]);router[_0x69ac('0x2c')]('/:id/custom_update',controller[_0x69ac('0x2d')]);router['put'](_0x69ac('0x2e'),auth[_0x69ac('0xf')](),controller['abandon']);router[_0x69ac('0x2c')](_0x69ac('0x2f'),controller[_0x69ac('0x30')]);router[_0x69ac('0x31')](_0x69ac('0xe'),auth[_0x69ac('0xa')](),interaction[_0x69ac('0x28')](_0x69ac('0x29'),_0x69ac('0x32')),controller[_0x69ac('0x33')]);router[_0x69ac('0x31')]('/:id/tags',auth[_0x69ac('0xa')](),controller[_0x69ac('0x34')]);module[_0x69ac('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index bcda1e1..5b6592d 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 _0x6945=['sequelize','BOOLEAN','INTEGER'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6945,0xd8));var _0x5694=function(_0xc76c2f,_0x6c9f0a){_0xc76c2f=_0xc76c2f-0x0;var _0x224e6c=_0x6945[_0xc76c2f];return _0x224e6c;};'use strict';var Sequelize=require(_0x5694('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5694('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5694('0x2')]}}; \ No newline at end of file +var _0x5ffc=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x394688,_0x7942f0){var _0x311dad=function(_0x334dd6){while(--_0x334dd6){_0x394688['push'](_0x394688['shift']());}};_0x311dad(++_0x7942f0);}(_0x5ffc,0x16a));var _0xc5ff=function(_0x4227f7,_0x5e2633){_0x4227f7=_0x4227f7-0x0;var _0x4d394e=_0x5ffc[_0x4227f7];return _0x4d394e;};'use strict';var Sequelize=require(_0xc5ff('0x0'));module[_0xc5ff('0x1')]={'body':{'type':Sequelize[_0xc5ff('0x2')](_0xc5ff('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc5ff('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index fc02a4b..db035ed 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 _0xcd0a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','push','role','user','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x19e0ef,_0x287dd1){var _0x1c022f=function(_0x580d50){while(--_0x580d50){_0x19e0ef['push'](_0x19e0ef['shift']());}};_0x1c022f(++_0x287dd1);}(_0xcd0a,0xcb));var _0xacd0=function(_0x3e5f0f,_0xe22b5e){_0x3e5f0f=_0x3e5f0f-0x0;var _0x38b2cb=_0xcd0a[_0x3e5f0f];return _0x38b2cb;};'use strict';var emlformat=require(_0xacd0('0x0'));var rimraf=require(_0xacd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacd0('0x2'));var rp=require(_0xacd0('0x3'));var moment=require(_0xacd0('0x4'));var BPromise=require(_0xacd0('0x5'));var Mustache=require(_0xacd0('0x6'));var util=require(_0xacd0('0x7'));var path=require(_0xacd0('0x8'));var sox=require(_0xacd0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacd0('0xa'));var _=require(_0xacd0('0xb'));var squel=require(_0xacd0('0xc'));var crypto=require(_0xacd0('0xd'));var jsforce=require(_0xacd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xacd0('0xf'));var querystring=require('querystring');var Papa=require(_0xacd0('0x10'));var Redis=require('ioredis');var authService=require(_0xacd0('0x11'));var qs=require(_0xacd0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacd0('0x13'));var logger=require('../../config/logger')(_0xacd0('0x14'));var utils=require(_0xacd0('0x15'));var config=require(_0xacd0('0x16'));var licenseUtil=require(_0xacd0('0x17'));var db=require(_0xacd0('0x18'))['db'];config[_0xacd0('0x19')]=_[_0xacd0('0x1a')](config[_0xacd0('0x19')],{'host':_0xacd0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacd0('0x19')]));require(_0xacd0('0x1c'))[_0xacd0('0x1d')](socket);function respondWithStatusCode(_0x1fabcb,_0x3154e5){_0x3154e5=_0x3154e5||0xcc;return function(_0x3dbbdb){if(_0x3dbbdb){return _0x1fabcb[_0xacd0('0x1e')](_0x3154e5);}return _0x1fabcb[_0xacd0('0x1f')](_0x3154e5)['end']();};}function respondWithResult(_0x5d4af6,_0x44c69b){_0x44c69b=_0x44c69b||0xc8;return function(_0x54dc6){if(_0x54dc6){return _0x5d4af6[_0xacd0('0x1f')](_0x44c69b)[_0xacd0('0x20')](_0x54dc6);}};}function respondWithFilteredResult(_0x312bc0,_0x316eb4){return function(_0x295003){if(_0x295003){var _0x46d4ea=typeof _0x316eb4[_0xacd0('0x21')]==='undefined'&&typeof _0x316eb4['limit']===_0xacd0('0x22');var _0x41e8e2=_0x295003[_0xacd0('0x23')];var _0x4a3ebb=_0x46d4ea?0x0:_0x316eb4[_0xacd0('0x21')];var _0x14c0c7=_0x46d4ea?_0x295003[_0xacd0('0x23')]:_0x316eb4[_0xacd0('0x21')]+_0x316eb4['limit'];var _0x2b4bd5;if(_0x14c0c7>=_0x41e8e2){_0x14c0c7=_0x41e8e2;_0x2b4bd5=0xc8;}else{_0x2b4bd5=0xce;}_0x312bc0[_0xacd0('0x1f')](_0x2b4bd5);return _0x312bc0[_0xacd0('0x24')](_0xacd0('0x25'),_0x4a3ebb+'-'+_0x14c0c7+'/'+_0x41e8e2)['json'](_0x295003);}return null;};}function patchUpdates(_0x489da5){return function(_0x4009a4){try{jsonpatch[_0xacd0('0x26')](_0x4009a4,_0x489da5,!![]);}catch(_0x193dde){return BPromise['reject'](_0x193dde);}return _0x4009a4[_0xacd0('0x27')]();};}function saveUpdates(_0x18e076,_0xf071d9){return function(_0x3208e8){if(_0x3208e8){return _0x3208e8[_0xacd0('0x28')](_0x18e076)[_0xacd0('0x29')](function(_0x59f589){return _0x59f589;});}return null;};}function removeEntity(_0x44889e,_0xaa391e){return function(_0x753ffc){if(_0x753ffc){return _0x753ffc[_0xacd0('0x2a')]()[_0xacd0('0x29')](function(){_0x44889e['status'](0xcc)[_0xacd0('0x2b')]();});}};}function handleEntityNotFound(_0x500a80,_0xea13e5){return function(_0x2eddd4){if(!_0x2eddd4){_0x500a80[_0xacd0('0x1e')](0x194);}return _0x2eddd4;};}function handleError(_0x36bc09,_0xcce101){_0xcce101=_0xcce101||0x1f4;return function(_0x4b6c82){logger['error'](_0x4b6c82[_0xacd0('0x2c')]);if(_0x4b6c82[_0xacd0('0x2d')]){delete _0x4b6c82['name'];}_0x36bc09['status'](_0xcce101)[_0xacd0('0x2e')](_0x4b6c82);};}exports[_0xacd0('0x2f')]=function(_0x8956bd,_0x439b55){var _0x1eada1={},_0x5c3caa={},_0x2c3cc7={'count':0x0,'rows':[]};var _0x395773=_[_0xacd0('0x30')](db[_0xacd0('0x31')][_0xacd0('0x32')],function(_0x244d06){return{'name':_0x244d06[_0xacd0('0x33')],'type':_0x244d06[_0xacd0('0x34')]['key']};});_0x5c3caa[_0xacd0('0x35')]=_[_0xacd0('0x30')](_0x395773,_0xacd0('0x2d'));_0x5c3caa[_0xacd0('0x36')]=_[_0xacd0('0x37')](_0x8956bd[_0xacd0('0x36')]);_0x5c3caa['filters']=_[_0xacd0('0x38')](_0x5c3caa[_0xacd0('0x35')],_0x5c3caa['query']);_0x1eada1[_0xacd0('0x39')]=_['intersection'](_0x5c3caa['model'],qs[_0xacd0('0x3a')](_0x8956bd[_0xacd0('0x36')][_0xacd0('0x3a')]));_0x1eada1[_0xacd0('0x39')]=_0x1eada1['attributes'][_0xacd0('0x3b')]?_0x1eada1['attributes']:_0x5c3caa['model'];if(!_0x8956bd[_0xacd0('0x36')][_0xacd0('0x3c')](_0xacd0('0x3d'))){_0x1eada1[_0xacd0('0x3e')]=qs[_0xacd0('0x3e')](_0x8956bd['query'][_0xacd0('0x3e')]);_0x1eada1['offset']=qs['offset'](_0x8956bd[_0xacd0('0x36')][_0xacd0('0x21')]);}_0x1eada1[_0xacd0('0x3f')]=qs[_0xacd0('0x40')](_0x8956bd[_0xacd0('0x36')][_0xacd0('0x40')]);_0x1eada1[_0xacd0('0x41')]=qs[_0xacd0('0x42')](_[_0xacd0('0x43')](_0x8956bd[_0xacd0('0x36')],_0x5c3caa[_0xacd0('0x42')]),_0x395773);if(_0x8956bd[_0xacd0('0x36')][_0xacd0('0x44')]){_0x1eada1['where']=_[_0xacd0('0x45')](_0x1eada1[_0xacd0('0x41')],{'$or':_[_0xacd0('0x30')](_0x395773,function(_0x2fc4f){if(_0x2fc4f[_0xacd0('0x34')]!==_0xacd0('0x46')){var _0x3c0626={};_0x3c0626[_0x2fc4f['name']]={'$like':'%'+_0x8956bd[_0xacd0('0x36')][_0xacd0('0x44')]+'%'};return _0x3c0626;}})});}_0x1eada1=_[_0xacd0('0x45')]({},_0x1eada1,_0x8956bd[_0xacd0('0x47')]);var _0x4f43ff={'where':_0x1eada1[_0xacd0('0x41')]};return db[_0xacd0('0x31')][_0xacd0('0x23')](_0x4f43ff)['then'](function(_0x5515b7){_0x2c3cc7[_0xacd0('0x23')]=_0x5515b7;if(_0x8956bd[_0xacd0('0x36')][_0xacd0('0x48')]){_0x1eada1[_0xacd0('0x49')]=[{'all':!![]}];}return db[_0xacd0('0x31')][_0xacd0('0x4a')](_0x1eada1);})[_0xacd0('0x29')](function(_0x3e64a5){_0x2c3cc7[_0xacd0('0x4b')]=_0x3e64a5;return _0x2c3cc7;})['then'](respondWithFilteredResult(_0x439b55,_0x1eada1))[_0xacd0('0x4c')](handleError(_0x439b55,null));};exports[_0xacd0('0x4d')]=function(_0x5c13c1,_0x508532){var _0x355707={'raw':!![],'where':{'id':_0x5c13c1['params']['id']}},_0x43e9bc={};_0x43e9bc[_0xacd0('0x35')]=_[_0xacd0('0x37')](db['ChatInternalMessage'][_0xacd0('0x32')]);_0x43e9bc[_0xacd0('0x36')]=_[_0xacd0('0x37')](_0x5c13c1[_0xacd0('0x36')]);_0x43e9bc[_0xacd0('0x42')]=_[_0xacd0('0x38')](_0x43e9bc[_0xacd0('0x35')],_0x43e9bc[_0xacd0('0x36')]);_0x355707[_0xacd0('0x39')]=_[_0xacd0('0x38')](_0x43e9bc['model'],qs[_0xacd0('0x3a')](_0x5c13c1[_0xacd0('0x36')]['fields']));_0x355707['attributes']=_0x355707[_0xacd0('0x39')][_0xacd0('0x3b')]?_0x355707['attributes']:_0x43e9bc['model'];if(_0x5c13c1[_0xacd0('0x36')][_0xacd0('0x48')]){_0x355707[_0xacd0('0x49')]=[{'all':!![]}];}_0x355707=_[_0xacd0('0x45')]({},_0x355707,_0x5c13c1[_0xacd0('0x47')]);return db['ChatInternalMessage'][_0xacd0('0x4e')](_0x355707)['then'](handleEntityNotFound(_0x508532,null))[_0xacd0('0x29')](respondWithResult(_0x508532,null))[_0xacd0('0x4c')](handleError(_0x508532,null));};exports[_0xacd0('0x4f')]=function(_0x37ab29,_0x54f0d7){return db[_0xacd0('0x31')][_0xacd0('0x4f')](_0x37ab29['body'],{})[_0xacd0('0x29')](respondWithResult(_0x54f0d7,0xc9))['catch'](handleError(_0x54f0d7,null));};exports[_0xacd0('0x28')]=function(_0x12c9b5,_0x1866f4){if(_0x12c9b5[_0xacd0('0x50')]['id']){delete _0x12c9b5[_0xacd0('0x50')]['id'];}return db[_0xacd0('0x31')][_0xacd0('0x4e')]({'where':{'id':_0x12c9b5['params']['id']}})['then'](handleEntityNotFound(_0x1866f4,null))[_0xacd0('0x29')](saveUpdates(_0x12c9b5[_0xacd0('0x50')],null))['then'](respondWithResult(_0x1866f4,null))[_0xacd0('0x4c')](handleError(_0x1866f4,null));};exports[_0xacd0('0x2a')]=function(_0x5b1a72,_0x3a14f1){return db[_0xacd0('0x31')]['find']({'where':{'id':_0x5b1a72[_0xacd0('0x51')]['id']}})[_0xacd0('0x29')](handleEntityNotFound(_0x3a14f1,null))['then'](removeEntity(_0x3a14f1,null))[_0xacd0('0x4c')](handleError(_0x3a14f1,null));};exports['describe']=function(_0xf06bb8,_0x3a6890){return db['ChatInternalMessage'][_0xacd0('0x52')]()[_0xacd0('0x29')](respondWithResult(_0x3a6890,null))['catch'](handleError(_0x3a6890,null));};function wrapUser(_0x2c4c1e){return function(_0x951b7e){var _0x410b8b=_0x2c4c1e[_0xacd0('0x53')]({'plain':!![]});_0x410b8b[_0xacd0('0x54')]=[];if(_0x951b7e){_0x410b8b[_0xacd0('0x55')]=_0x951b7e[_0xacd0('0x56')];_0x410b8b['lastMessage']=_0x951b7e;}else{_0x410b8b[_0xacd0('0x55')]=moment(0x0)[_0xacd0('0x57')](_0xacd0('0x58'));_0x410b8b[_0xacd0('0x59')]={};}return _0x410b8b;};}exports[_0xacd0('0x5a')]=function(_0x1bf76f,_0x505567,_0x388912){var _0x1d7dae=[];return db[_0xacd0('0x5b')][_0xacd0('0x4a')]({'where':{'role':[_0xacd0('0x5c'),'admin','user']},'attributes':['id',_0xacd0('0x5d'),_0xacd0('0x2d'),'role','userpic',_0xacd0('0x5e'),_0xacd0('0x5f'),_0xacd0('0x60'),_0xacd0('0x61'),'showWebBar'],'order':qs[_0xacd0('0x40')](_0xacd0('0x62')),'include':[{'model':db[_0xacd0('0x63')],'as':_0xacd0('0x64'),'attributes':['id','name',_0xacd0('0x34')],'through':{'attributes':[]}}]})[_0xacd0('0x29')](function(_0x34ef96){if(_0x34ef96){var _0x3e6cf1=_0x1bf76f['user'][_0xacd0('0x53')]({'plain':!![]});if(!_0x3e6cf1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e6cf1['role']==='user'){return db[_0xacd0('0x65')][_0xacd0('0x4e')]({'where':{'name':_0xacd0('0x66'),'userProfileId':_0x3e6cf1[_0xacd0('0x67')]},'raw':!![]})['then'](function(_0x4b6ecc){if(_0x4b6ecc){if(_0x4b6ecc[_0xacd0('0x68')]===0x0){return db['UserProfileResource'][_0xacd0('0x4a')]({'where':{'sectionId':_0x4b6ecc['id']},'raw':!![]})['then'](function(_0x4faa2d){var _0xb3a352=[];if(_['isEmpty'](_0x4faa2d)){_0xb3a352=_[_0xacd0('0x44')](_0x34ef96,function(_0x186a1d){if(_0x186a1d['role']!==_0xacd0('0x5c')){return _0x186a1d;}});return _0xb3a352;}else{for(var _0x31885a=0x0;_0x31885a<_0x34ef96[_0xacd0('0x3b')];_0x31885a++){var _0x64c7c6=_0x34ef96[_0x31885a];if(_0x64c7c6['role']==='agent'){var _0x34074a=_[_0xacd0('0x4e')](_0x4faa2d,function(_0x5d2db8){return _0x5d2db8['resourceId']===_0x64c7c6['id'];});if(_0x34074a)_0xb3a352['push'](_0x64c7c6);}else{_0xb3a352[_0xacd0('0x69')](_0x64c7c6);}}return _0xb3a352;}});}else{return _0x34ef96;}}else{var _0x2a52fc=_[_0xacd0('0x44')](_0x34ef96,function(_0x516c5a){if(_0x516c5a[_0xacd0('0x6a')]!==_0xacd0('0x5c')){return _0x516c5a;}});return _0x2a52fc;}});}else{return _0x34ef96;}}})['then'](function(_0x5ef3d2){var _0x38a050=[];if(_0x5ef3d2){_0x1d7dae=_0x5ef3d2;for(var _0x4edd5c=0x0;_0x4edd5c<_0x5ef3d2[_0xacd0('0x3b')];_0x4edd5c+=0x1){_0x1d7dae[_0x4edd5c][_0xacd0('0x54')]=[];_0x38a050[_0xacd0('0x69')](db[_0xacd0('0x31')]['find']({'where':{'FromId':[_0x1bf76f[_0xacd0('0x6b')]['id'],_0x5ef3d2[_0x4edd5c]['id']],'ToId':[_0x1bf76f[_0xacd0('0x6b')]['id'],_0x5ef3d2[_0x4edd5c]['id']],'ChatGroupId':null},'attributes':['id',_0xacd0('0x56'),'FromId',_0xacd0('0x6c'),_0xacd0('0x6d'),_0xacd0('0x50')],'order':qs[_0xacd0('0x40')](_0xacd0('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5ef3d2[_0x4edd5c])));}return BPromise[_0xacd0('0x6f')](_0x38a050);}return[];})['then'](function(_0x13722f){return{'rows':_0x13722f,'count':_0x13722f[_0xacd0('0x3b')]};})['then'](respondWithResult(_0x505567,null))[_0xacd0('0x4c')](handleError(_0x505567,null));}; \ No newline at end of file +var _0x1154=['./chatInternalMessage.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','merge','where','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x1aada2,_0x36f5cc){var _0x5d8ae3=function(_0x396f6f){while(--_0x396f6f){_0x1aada2['push'](_0x1aada2['shift']());}};_0x5d8ae3(++_0x36f5cc);}(_0x1154,0x1f0));var _0x4115=function(_0x110633,_0x1d8099){_0x110633=_0x110633-0x0;var _0x5d4b68=_0x1154[_0x110633];return _0x5d4b68;};'use strict';var emlformat=require(_0x4115('0x0'));var rimraf=require(_0x4115('0x1'));var zipdir=require(_0x4115('0x2'));var jsonpatch=require(_0x4115('0x3'));var rp=require(_0x4115('0x4'));var moment=require(_0x4115('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4115('0x6'));var util=require(_0x4115('0x7'));var path=require('path');var sox=require(_0x4115('0x8'));var csv=require(_0x4115('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4115('0xa'));var _=require('lodash');var squel=require(_0x4115('0xb'));var crypto=require(_0x4115('0xc'));var jsforce=require(_0x4115('0xd'));var deskjs=require(_0x4115('0xe'));var toCsv=require(_0x4115('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4115('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4115('0x10'));var as=require(_0x4115('0x11'));var hardwareService=require(_0x4115('0x12'));var logger=require(_0x4115('0x13'))(_0x4115('0x14'));var utils=require('../../config/utils');var config=require(_0x4115('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4115('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4115('0x17')]));require(_0x4115('0x18'))['register'](socket);function respondWithStatusCode(_0x1492c0,_0x2e2780){_0x2e2780=_0x2e2780||0xcc;return function(_0x49333d){if(_0x49333d){return _0x1492c0['sendStatus'](_0x2e2780);}return _0x1492c0[_0x4115('0x19')](_0x2e2780)[_0x4115('0x1a')]();};}function respondWithResult(_0x50a398,_0x12564b){_0x12564b=_0x12564b||0xc8;return function(_0x3060d0){if(_0x3060d0){return _0x50a398['status'](_0x12564b)[_0x4115('0x1b')](_0x3060d0);}};}function respondWithFilteredResult(_0x3aaa79,_0x176d5f){return function(_0x1de6d8){if(_0x1de6d8){var _0x2f41f0=typeof _0x176d5f[_0x4115('0x1c')]===_0x4115('0x1d')&&typeof _0x176d5f['limit']==='undefined';var _0x19fade=_0x1de6d8[_0x4115('0x1e')];var _0x2d557a=_0x2f41f0?0x0:_0x176d5f[_0x4115('0x1c')];var _0x5a308a=_0x2f41f0?_0x1de6d8[_0x4115('0x1e')]:_0x176d5f['offset']+_0x176d5f[_0x4115('0x1f')];var _0x321502;if(_0x5a308a>=_0x19fade){_0x5a308a=_0x19fade;_0x321502=0xc8;}else{_0x321502=0xce;}_0x3aaa79['status'](_0x321502);return _0x3aaa79[_0x4115('0x20')](_0x4115('0x21'),_0x2d557a+'-'+_0x5a308a+'/'+_0x19fade)[_0x4115('0x1b')](_0x1de6d8);}return null;};}function patchUpdates(_0x55df09){return function(_0x53d798){try{jsonpatch[_0x4115('0x22')](_0x53d798,_0x55df09,!![]);}catch(_0x352f8f){return BPromise[_0x4115('0x23')](_0x352f8f);}return _0x53d798[_0x4115('0x24')]();};}function saveUpdates(_0x2a36af,_0x2585e9){return function(_0x1de6de){if(_0x1de6de){return _0x1de6de['update'](_0x2a36af)[_0x4115('0x25')](function(_0x1fa878){return _0x1fa878;});}return null;};}function removeEntity(_0xba0de,_0xd4b5db){return function(_0x5d3283){if(_0x5d3283){return _0x5d3283[_0x4115('0x26')]()[_0x4115('0x25')](function(){_0xba0de[_0x4115('0x19')](0xcc)[_0x4115('0x1a')]();});}};}function handleEntityNotFound(_0x4bdf6e,_0x16f772){return function(_0x5842a4){if(!_0x5842a4){_0x4bdf6e[_0x4115('0x27')](0x194);}return _0x5842a4;};}function handleError(_0x255614,_0x4f262d){_0x4f262d=_0x4f262d||0x1f4;return function(_0x532f3d){logger['error'](_0x532f3d['stack']);if(_0x532f3d['name']){delete _0x532f3d[_0x4115('0x28')];}_0x255614[_0x4115('0x19')](_0x4f262d)[_0x4115('0x29')](_0x532f3d);};}exports[_0x4115('0x2a')]=function(_0x45408a,_0x4e7620){var _0x2c745a={},_0x22bcd1={},_0x2f10bd={'count':0x0,'rows':[]};var _0x51734f=_['map'](db[_0x4115('0x2b')][_0x4115('0x2c')],function(_0x18bed0){return{'name':_0x18bed0[_0x4115('0x2d')],'type':_0x18bed0[_0x4115('0x2e')][_0x4115('0x2f')]};});_0x22bcd1[_0x4115('0x30')]=_[_0x4115('0x31')](_0x51734f,_0x4115('0x28'));_0x22bcd1[_0x4115('0x32')]=_[_0x4115('0x33')](_0x45408a[_0x4115('0x32')]);_0x22bcd1[_0x4115('0x34')]=_[_0x4115('0x35')](_0x22bcd1[_0x4115('0x30')],_0x22bcd1['query']);_0x2c745a[_0x4115('0x36')]=_[_0x4115('0x35')](_0x22bcd1[_0x4115('0x30')],qs[_0x4115('0x37')](_0x45408a[_0x4115('0x32')]['fields']));_0x2c745a[_0x4115('0x36')]=_0x2c745a[_0x4115('0x36')][_0x4115('0x38')]?_0x2c745a[_0x4115('0x36')]:_0x22bcd1[_0x4115('0x30')];if(!_0x45408a[_0x4115('0x32')][_0x4115('0x39')]('nolimit')){_0x2c745a[_0x4115('0x1f')]=qs[_0x4115('0x1f')](_0x45408a[_0x4115('0x32')][_0x4115('0x1f')]);_0x2c745a['offset']=qs[_0x4115('0x1c')](_0x45408a[_0x4115('0x32')][_0x4115('0x1c')]);}_0x2c745a['order']=qs['sort'](_0x45408a[_0x4115('0x32')]['sort']);_0x2c745a['where']=qs[_0x4115('0x34')](_[_0x4115('0x3a')](_0x45408a['query'],_0x22bcd1['filters']),_0x51734f);if(_0x45408a[_0x4115('0x32')][_0x4115('0x3b')]){_0x2c745a['where']=_[_0x4115('0x3c')](_0x2c745a['where'],{'$or':_['map'](_0x51734f,function(_0x1b2c53){if(_0x1b2c53[_0x4115('0x2e')]!=='VIRTUAL'){var _0x1659e8={};_0x1659e8[_0x1b2c53[_0x4115('0x28')]]={'$like':'%'+_0x45408a[_0x4115('0x32')][_0x4115('0x3b')]+'%'};return _0x1659e8;}})});}_0x2c745a=_[_0x4115('0x3c')]({},_0x2c745a,_0x45408a['options']);var _0x5c7a69={'where':_0x2c745a[_0x4115('0x3d')]};return db['ChatInternalMessage']['count'](_0x5c7a69)[_0x4115('0x25')](function(_0x4912f9){_0x2f10bd[_0x4115('0x1e')]=_0x4912f9;if(_0x45408a[_0x4115('0x32')][_0x4115('0x3e')]){_0x2c745a[_0x4115('0x3f')]=[{'all':!![]}];}return db[_0x4115('0x2b')][_0x4115('0x40')](_0x2c745a);})['then'](function(_0x263216){_0x2f10bd['rows']=_0x263216;return _0x2f10bd;})[_0x4115('0x25')](respondWithFilteredResult(_0x4e7620,_0x2c745a))[_0x4115('0x41')](handleError(_0x4e7620,null));};exports['show']=function(_0x4fa2e0,_0x1c87ca){var _0x1813f2={'raw':!![],'where':{'id':_0x4fa2e0[_0x4115('0x42')]['id']}},_0xbe5ae6={};_0xbe5ae6['model']=_[_0x4115('0x33')](db[_0x4115('0x2b')][_0x4115('0x2c')]);_0xbe5ae6[_0x4115('0x32')]=_[_0x4115('0x33')](_0x4fa2e0[_0x4115('0x32')]);_0xbe5ae6[_0x4115('0x34')]=_['intersection'](_0xbe5ae6[_0x4115('0x30')],_0xbe5ae6['query']);_0x1813f2[_0x4115('0x36')]=_['intersection'](_0xbe5ae6[_0x4115('0x30')],qs[_0x4115('0x37')](_0x4fa2e0[_0x4115('0x32')]['fields']));_0x1813f2[_0x4115('0x36')]=_0x1813f2[_0x4115('0x36')][_0x4115('0x38')]?_0x1813f2[_0x4115('0x36')]:_0xbe5ae6['model'];if(_0x4fa2e0[_0x4115('0x32')][_0x4115('0x3e')]){_0x1813f2[_0x4115('0x3f')]=[{'all':!![]}];}_0x1813f2=_[_0x4115('0x3c')]({},_0x1813f2,_0x4fa2e0['options']);return db['ChatInternalMessage'][_0x4115('0x43')](_0x1813f2)[_0x4115('0x25')](handleEntityNotFound(_0x1c87ca,null))[_0x4115('0x25')](respondWithResult(_0x1c87ca,null))['catch'](handleError(_0x1c87ca,null));};exports[_0x4115('0x44')]=function(_0x51641d,_0x22209a){return db[_0x4115('0x2b')][_0x4115('0x44')](_0x51641d['body'],{})['then'](respondWithResult(_0x22209a,0xc9))[_0x4115('0x41')](handleError(_0x22209a,null));};exports['update']=function(_0x2a5dcd,_0x14be56){if(_0x2a5dcd[_0x4115('0x45')]['id']){delete _0x2a5dcd[_0x4115('0x45')]['id'];}return db[_0x4115('0x2b')][_0x4115('0x43')]({'where':{'id':_0x2a5dcd[_0x4115('0x42')]['id']}})[_0x4115('0x25')](handleEntityNotFound(_0x14be56,null))[_0x4115('0x25')](saveUpdates(_0x2a5dcd['body'],null))[_0x4115('0x25')](respondWithResult(_0x14be56,null))['catch'](handleError(_0x14be56,null));};exports[_0x4115('0x26')]=function(_0x59be34,_0xb52c9){return db[_0x4115('0x2b')][_0x4115('0x43')]({'where':{'id':_0x59be34[_0x4115('0x42')]['id']}})[_0x4115('0x25')](handleEntityNotFound(_0xb52c9,null))[_0x4115('0x25')](removeEntity(_0xb52c9,null))[_0x4115('0x41')](handleError(_0xb52c9,null));};exports[_0x4115('0x46')]=function(_0x19cdd0,_0x3b961a){return db[_0x4115('0x2b')]['describe']()[_0x4115('0x25')](respondWithResult(_0x3b961a,null))[_0x4115('0x41')](handleError(_0x3b961a,null));};function wrapUser(_0x35702e){return function(_0x468123){var _0x2115c6=_0x35702e[_0x4115('0x47')]({'plain':!![]});_0x2115c6[_0x4115('0x48')]=[];if(_0x468123){_0x2115c6['lastMessageAt']=_0x468123['createdAt'];_0x2115c6[_0x4115('0x49')]=_0x468123;}else{_0x2115c6[_0x4115('0x4a')]=moment(0x0)[_0x4115('0x4b')](_0x4115('0x4c'));_0x2115c6[_0x4115('0x49')]={};}return _0x2115c6;};}exports[_0x4115('0x4d')]=function(_0x401628,_0x3ab913,_0x107aed){var _0x564065=[];return db[_0x4115('0x4e')]['findAll']({'where':{'role':[_0x4115('0x4f'),'admin','user']},'attributes':['id',_0x4115('0x50'),_0x4115('0x28'),_0x4115('0x51'),_0x4115('0x52'),_0x4115('0x53'),_0x4115('0x54'),_0x4115('0x55'),_0x4115('0x56'),_0x4115('0x57')],'order':qs[_0x4115('0x58')](_0x4115('0x59')),'include':[{'model':db[_0x4115('0x5a')],'as':_0x4115('0x5b'),'attributes':['id',_0x4115('0x28'),_0x4115('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x18c011){if(_0x18c011){var _0x477fd5=_0x401628[_0x4115('0x5c')][_0x4115('0x47')]({'plain':!![]});if(!_0x477fd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x477fd5[_0x4115('0x51')]===_0x4115('0x5c')){return db[_0x4115('0x5d')][_0x4115('0x43')]({'where':{'name':_0x4115('0x5e'),'userProfileId':_0x477fd5[_0x4115('0x5f')]},'raw':!![]})['then'](function(_0x925fd6){if(_0x925fd6){if(_0x925fd6[_0x4115('0x60')]===0x0){return db[_0x4115('0x61')]['findAll']({'where':{'sectionId':_0x925fd6['id']},'raw':!![]})['then'](function(_0x589e5c){var _0x366e10=[];if(_['isEmpty'](_0x589e5c)){_0x366e10=_[_0x4115('0x3b')](_0x18c011,function(_0xede7e3){if(_0xede7e3['role']!=='agent'){return _0xede7e3;}});return _0x366e10;}else{for(var _0x2e3ee0=0x0;_0x2e3ee0<_0x18c011[_0x4115('0x38')];_0x2e3ee0++){var _0x2e8fd4=_0x18c011[_0x2e3ee0];if(_0x2e8fd4[_0x4115('0x51')]===_0x4115('0x4f')){var _0x502aad=_['find'](_0x589e5c,function(_0x4bbb15){return _0x4bbb15[_0x4115('0x62')]===_0x2e8fd4['id'];});if(_0x502aad)_0x366e10['push'](_0x2e8fd4);}else{_0x366e10[_0x4115('0x63')](_0x2e8fd4);}}return _0x366e10;}});}else{return _0x18c011;}}else{var _0x48da19=_[_0x4115('0x3b')](_0x18c011,function(_0x11ee4b){if(_0x11ee4b[_0x4115('0x51')]!==_0x4115('0x4f')){return _0x11ee4b;}});return _0x48da19;}});}else{return _0x18c011;}}})[_0x4115('0x25')](function(_0x3ba47a){var _0x4699af=[];if(_0x3ba47a){_0x564065=_0x3ba47a;for(var _0x459bd6=0x0;_0x459bd6<_0x3ba47a[_0x4115('0x38')];_0x459bd6+=0x1){_0x564065[_0x459bd6]['messages']=[];_0x4699af['push'](db['ChatInternalMessage'][_0x4115('0x43')]({'where':{'FromId':[_0x401628[_0x4115('0x5c')]['id'],_0x3ba47a[_0x459bd6]['id']],'ToId':[_0x401628[_0x4115('0x5c')]['id'],_0x3ba47a[_0x459bd6]['id']],'ChatGroupId':null},'attributes':['id',_0x4115('0x64'),'FromId','ToId',_0x4115('0x65'),_0x4115('0x45')],'order':qs[_0x4115('0x58')](_0x4115('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4115('0x25')](wrapUser(_0x3ba47a[_0x459bd6])));}return BPromise[_0x4115('0x67')](_0x4699af);}return[];})[_0x4115('0x25')](function(_0x3e9903){return{'rows':_0x3e9903,'count':_0x3e9903[_0x4115('0x38')]};})['then'](respondWithResult(_0x3ab913,null))['catch'](handleError(_0x3ab913,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 8f2a5af..aceea51 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 _0xc5e5=['emit','hasOwnProperty','hook','ChatInternalMessage','save','update','remove'];(function(_0x2957b5,_0x362e07){var _0x467cef=function(_0x263f53){while(--_0x263f53){_0x2957b5['push'](_0x2957b5['shift']());}};_0x467cef(++_0x362e07);}(_0xc5e5,0xdc));var _0x5c5e=function(_0x134e69,_0x3b1a0d){_0x134e69=_0x134e69-0x0;var _0x1dca83=_0xc5e5[_0x134e69];return _0x1dca83;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x5c5e('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c5e('0x1'),'afterUpdate':_0x5c5e('0x2'),'afterDestroy':_0x5c5e('0x3')};function emitEvent(_0x32d8f5){return function(_0x49029d,_0x41ee97,_0x42c1c2){ChatInternalMessageEvents[_0x5c5e('0x4')](_0x32d8f5+':'+_0x49029d['id'],_0x49029d);ChatInternalMessageEvents['emit'](_0x32d8f5,_0x49029d);_0x42c1c2(null);};}for(var e in events){if(events[_0x5c5e('0x5')](e)){var event=events[e];ChatInternalMessage[_0x5c5e('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xa1d0=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','save'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa1d0,0x1a4));var _0x0a1d=function(_0x5db3b4,_0x17bc65){_0x5db3b4=_0x5db3b4-0x0;var _0x5e621e=_0xa1d0[_0x5db3b4];return _0x5e621e;};'use strict';var EventEmitter=require(_0x0a1d('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x0a1d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a1d('0x2'),'afterUpdate':_0x0a1d('0x3'),'afterDestroy':_0x0a1d('0x4')};function emitEvent(_0x1203c0){return function(_0x15e254,_0x2d2b14,_0x12ea98){ChatInternalMessageEvents[_0x0a1d('0x5')](_0x1203c0+':'+_0x15e254['id'],_0x15e254);ChatInternalMessageEvents[_0x0a1d('0x5')](_0x1203c0,_0x15e254);_0x12ea98(null);};}for(var e in events){if(events[_0x0a1d('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0a1d('0x7')](e,emitEvent(event));}}module[_0x0a1d('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index e653bf4..037544f 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 _0x6d04=['utf8mb4','lodash','util','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x18bd60,_0x2c4528){var _0x2e167e=function(_0x5a00a5){while(--_0x5a00a5){_0x18bd60['push'](_0x18bd60['shift']());}};_0x2e167e(++_0x2c4528);}(_0x6d04,0xdd));var _0x46d0=function(_0x16d5b7,_0x14b1ad){_0x16d5b7=_0x16d5b7-0x0;var _0x5b8871=_0x6d04[_0x16d5b7];return _0x5b8871;};'use strict';var _=require(_0x46d0('0x0'));var util=require(_0x46d0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x46d0('0x2'));var rp=require(_0x46d0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46d0('0x4'));var config=require(_0x46d0('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x46d0('0x6')]=function(_0x291499,_0x291cff){return _0x291499[_0x46d0('0x7')](_0x46d0('0x8'),attributes,{'tableName':_0x46d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46d0('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xac51=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xac51,0x1ae));var _0x1ac5=function(_0x20b4c9,_0x4126fc){_0x20b4c9=_0x20b4c9-0x0;var _0x4aba9f=_0xac51[_0x20b4c9];return _0x4aba9f;};'use strict';var _=require(_0x1ac5('0x0'));var util=require(_0x1ac5('0x1'));var logger=require(_0x1ac5('0x2'))('api');var moment=require(_0x1ac5('0x3'));var BPromise=require(_0x1ac5('0x4'));var rp=require(_0x1ac5('0x5'));var fs=require('fs');var path=require(_0x1ac5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ac5('0x7'));module[_0x1ac5('0x8')]=function(_0xf3a54a,_0x2473d3){return _0xf3a54a['define'](_0x1ac5('0x9'),attributes,{'tableName':_0x1ac5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ac5('0xb'),'collate':_0x1ac5('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 057a52b..bf79408 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 _0xf150=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1757f2,_0x1b09fa){var _0x5e7212=function(_0x4f1794){while(--_0x4f1794){_0x1757f2['push'](_0x1757f2['shift']());}};_0x5e7212(++_0x1b09fa);}(_0xf150,0x196));var _0x0f15=function(_0x21a276,_0x4076e8){_0x21a276=_0x21a276-0x0;var _0x27ea9f=_0xf150[_0x21a276];return _0x27ea9f;};'use strict';var _=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var moment=require(_0x0f15('0x2'));var BPromise=require(_0x0f15('0x3'));var rs=require(_0x0f15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f15('0x5'));var logger=require(_0x0f15('0x6'))(_0x0f15('0x7'));var config=require(_0x0f15('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f15('0x9')][_0x0f15('0xa')]({'port':0x232a});config['redis']=_[_0x0f15('0xb')](config['redis'],{'host':_0x0f15('0xc'),'port':0x18eb});var socket=require(_0x0f15('0xd'))(new Redis(config[_0x0f15('0xe')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x53bc83,_0x378b60,_0x55788d){return new BPromise(function(_0x55e0db,_0xbe86d6){return client[_0x0f15('0xf')](_0x53bc83,_0x55788d)[_0x0f15('0x10')](function(_0x465f28){logger[_0x0f15('0x11')](_0x0f15('0x12'),_0x378b60,_0x0f15('0x13'));logger[_0x0f15('0x14')](_0x0f15('0x15'),_0x378b60,_0x0f15('0x13'),JSON[_0x0f15('0x16')](_0x465f28));if(_0x465f28[_0x0f15('0x17')]){if(_0x465f28[_0x0f15('0x17')][_0x0f15('0x18')]===0x1f4){logger[_0x0f15('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x378b60,_0x465f28[_0x0f15('0x17')][_0x0f15('0x19')]);return _0xbe86d6(_0x465f28[_0x0f15('0x17')]['message']);}logger[_0x0f15('0x17')](_0x0f15('0x12'),_0x378b60,_0x465f28['error'][_0x0f15('0x19')]);return _0x55e0db(_0x465f28[_0x0f15('0x17')][_0x0f15('0x19')]);}else{logger['info'](_0x0f15('0x12'),_0x378b60,_0x0f15('0x13'));_0x55e0db(_0x465f28['result'][_0x0f15('0x19')]);}})[_0x0f15('0x1a')](function(_0x34ed58){logger[_0x0f15('0x17')](_0x0f15('0x12'),_0x378b60,_0x34ed58);_0xbe86d6(_0x34ed58);});});} \ No newline at end of file +var _0xf986=['../../mysqldb','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4cda06,_0x3cb29c){var _0x48f3fa=function(_0x21f3a6){while(--_0x21f3a6){_0x4cda06['push'](_0x4cda06['shift']());}};_0x48f3fa(++_0x3cb29c);}(_0xf986,0x163));var _0x6f98=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf986[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x6f98('0x0'));var util=require(_0x6f98('0x1'));var moment=require(_0x6f98('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f98('0x3'));var fs=require('fs');var Redis=require(_0x6f98('0x4'));var db=require(_0x6f98('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6f98('0x6')][_0x6f98('0x7')]({'port':0x232a});config['redis']=_[_0x6f98('0x8')](config[_0x6f98('0x9')],{'host':_0x6f98('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f98('0x9')]));require(_0x6f98('0xb'))[_0x6f98('0xc')](socket);function respondWithRpcPromise(_0xd358bc,_0x257d98,_0x322ce7){return new BPromise(function(_0x4b84a2,_0x10e14a){return client[_0x6f98('0xd')](_0xd358bc,_0x322ce7)[_0x6f98('0xe')](function(_0xadf22a){logger[_0x6f98('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x257d98,'request\x20sent');logger['debug'](_0x6f98('0x10'),_0x257d98,_0x6f98('0x11'),JSON['stringify'](_0xadf22a));if(_0xadf22a[_0x6f98('0x12')]){if(_0xadf22a[_0x6f98('0x12')][_0x6f98('0x13')]===0x1f4){logger[_0x6f98('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x257d98,_0xadf22a[_0x6f98('0x12')][_0x6f98('0x14')]);return _0x10e14a(_0xadf22a[_0x6f98('0x12')]['message']);}logger[_0x6f98('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x257d98,_0xadf22a[_0x6f98('0x12')]['message']);return _0x4b84a2(_0xadf22a[_0x6f98('0x12')][_0x6f98('0x14')]);}else{logger[_0x6f98('0xf')](_0x6f98('0x15'),_0x257d98,_0x6f98('0x11'));_0x4b84a2(_0xadf22a[_0x6f98('0x16')][_0x6f98('0x14')]);}})[_0x6f98('0x17')](function(_0x5d23f8){logger[_0x6f98('0x12')](_0x6f98('0x15'),_0x257d98,_0x5d23f8);_0x10e14a(_0x5d23f8);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index a81de2a..531c78e 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 _0x9b0a=['save','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0x9b0a,0x19f));var _0xa9b0=function(_0x3c4f93,_0x24be5c){_0x3c4f93=_0x3c4f93-0x0;var _0x56d097=_0x9b0a[_0x3c4f93];return _0x56d097;};'use strict';var ChatInternalMessageEvents=require(_0xa9b0('0x0'));var events=[_0xa9b0('0x1'),'remove',_0xa9b0('0x2')];function createListener(_0x397460,_0x3e6a78){return function(_0x358660){_0x3e6a78[_0xa9b0('0x3')](_0x397460,_0x358660);};}function removeListener(_0x58a1d7,_0x33358f){return function(){ChatInternalMessageEvents[_0xa9b0('0x4')](_0x58a1d7,_0x33358f);};}exports[_0xa9b0('0x5')]=function(_0x17c16a){for(var _0x4f0a47=0x0,_0x2c4298=events[_0xa9b0('0x6')];_0x4f0a47<_0x2c4298;_0x4f0a47++){var _0x162027=events[_0x4f0a47];var _0x355a5e=createListener(_0xa9b0('0x7')+_0x162027,_0x17c16a);ChatInternalMessageEvents['on'](_0x162027,_0x355a5e);}}; \ No newline at end of file +var _0xb150=['save','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xb150,0xcc));var _0x0b15=function(_0x204154,_0x3351e8){_0x204154=_0x204154-0x0;var _0x3ec92f=_0xb150[_0x204154];return _0x3ec92f;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x0b15('0x0'),'remove','update'];function createListener(_0x33db53,_0x4fd903){return function(_0x337c13){_0x4fd903[_0x0b15('0x1')](_0x33db53,_0x337c13);};}function removeListener(_0x50a99f,_0x95a113){return function(){ChatInternalMessageEvents[_0x0b15('0x2')](_0x50a99f,_0x95a113);};}exports[_0x0b15('0x3')]=function(_0x1e1bfe){for(var _0x479454=0x0,_0x5d5eb5=events[_0x0b15('0x4')];_0x479454<_0x5d5eb5;_0x479454++){var _0xf4d7a=events[_0x479454];var _0x13c9da=createListener(_0x0b15('0x5')+_0xf4d7a,_0x1e1bfe);ChatInternalMessageEvents['on'](_0xf4d7a,_0x13c9da);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e87e196..85522f6 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 _0x7e8e=['put','update','delete','destroy','multer','path','connect-timeout','Router','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','/users','/:id','show','create'];(function(_0x3b62c6,_0x19a5b4){var _0x2d4641=function(_0x17e56d){while(--_0x17e56d){_0x3b62c6['push'](_0x3b62c6['shift']());}};_0x2d4641(++_0x19a5b4);}(_0x7e8e,0x1be));var _0xe7e8=function(_0x2fe5a8,_0x36dfc3){_0x2fe5a8=_0x2fe5a8-0x0;var _0x5cf27c=_0x7e8e[_0x2fe5a8];return _0x5cf27c;};'use strict';var multer=require(_0xe7e8('0x0'));var util=require('util');var path=require(_0xe7e8('0x1'));var timeout=require(_0xe7e8('0x2'));var express=require('express');var router=express[_0xe7e8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe7e8('0x4'));router['get']('/',auth[_0xe7e8('0x5')](),controller[_0xe7e8('0x6')]);router[_0xe7e8('0x7')](_0xe7e8('0x8'),auth[_0xe7e8('0x5')](),controller['describe']);router[_0xe7e8('0x7')](_0xe7e8('0x9'),auth[_0xe7e8('0x5')](),controller['getUsers']);router[_0xe7e8('0x7')](_0xe7e8('0xa'),auth[_0xe7e8('0x5')](),controller[_0xe7e8('0xb')]);router['post']('/',auth[_0xe7e8('0x5')](),controller[_0xe7e8('0xc')]);router[_0xe7e8('0xd')](_0xe7e8('0xa'),controller[_0xe7e8('0xe')]);router[_0xe7e8('0xf')](_0xe7e8('0xa'),auth[_0xe7e8('0x5')](),controller[_0xe7e8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcd41=['../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','connect-timeout','Router'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xcd41,0x152));var _0x1cd4=function(_0x43f9e1,_0x53cce9){_0x43f9e1=_0x43f9e1-0x0;var _0x233901=_0xcd41[_0x43f9e1];return _0x233901;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1cd4('0x0'));var express=require('express');var router=express[_0x1cd4('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x1cd4('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x1cd4('0x3'));var controller=require(_0x1cd4('0x4'));router[_0x1cd4('0x5')]('/',auth[_0x1cd4('0x6')](),controller[_0x1cd4('0x7')]);router['get'](_0x1cd4('0x8'),auth['isAuthenticated'](),controller[_0x1cd4('0x9')]);router[_0x1cd4('0x5')](_0x1cd4('0xa'),auth['isAuthenticated'](),controller[_0x1cd4('0xb')]);router[_0x1cd4('0x5')](_0x1cd4('0xc'),auth['isAuthenticated'](),controller[_0x1cd4('0xd')]);router[_0x1cd4('0xe')]('/',auth[_0x1cd4('0x6')](),controller[_0x1cd4('0xf')]);router['put'](_0x1cd4('0xc'),controller[_0x1cd4('0x10')]);router[_0x1cd4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1cd4('0x12')]);module[_0x1cd4('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 80ffba8..082929c 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 _0xa249=['BOOLEAN','ENUM','out','sequelize','exports','medium'];(function(_0x3ae3aa,_0x5cbfaa){var _0x2a9dd7=function(_0x4b1b8b){while(--_0x4b1b8b){_0x3ae3aa['push'](_0x3ae3aa['shift']());}};_0x2a9dd7(++_0x5cbfaa);}(_0xa249,0x183));var _0x9a24=function(_0x45102d,_0x15181b){_0x45102d=_0x45102d-0x0;var _0x2f7397=_0xa249[_0x45102d];return _0x2f7397;};'use strict';var Sequelize=require(_0x9a24('0x0'));module[_0x9a24('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9a24('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9a24('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a24('0x4')]('in','out'),'defaultValue':_0x9a24('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x065e=['ENUM','DATE','STRING','sequelize','BOOLEAN'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x065e,0x1a7));var _0xe065=function(_0x2ff90e,_0xdae85f){_0x2ff90e=_0x2ff90e-0x0;var _0x34b8cf=_0x065e[_0x2ff90e];return _0x34b8cf;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe065('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe065('0x3')]},'providerName':{'type':Sequelize[_0xe065('0x4')]},'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 9d127c0..211246a 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 _0x62e6=['chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','chat','rejectMessage','sequelize','User','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','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','end','status','json','offset','limit','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','ChatMessage','count','includeAll','rows','show','keys','length','find','create','body','params','describe'];(function(_0x12005c,_0x56ef39){var _0x17c59d=function(_0x298fad){while(--_0x298fad){_0x12005c['push'](_0x12005c['shift']());}};_0x17c59d(++_0x56ef39);}(_0x62e6,0x1a5));var _0x662e=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x62e6[_0x541095];return _0x5a2c40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x662e('0x0'));var zipdir=require(_0x662e('0x1'));var jsonpatch=require(_0x662e('0x2'));var rp=require(_0x662e('0x3'));var moment=require(_0x662e('0x4'));var BPromise=require(_0x662e('0x5'));var Mustache=require(_0x662e('0x6'));var util=require('util');var path=require(_0x662e('0x7'));var sox=require(_0x662e('0x8'));var csv=require(_0x662e('0x9'));var ejs=require(_0x662e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x662e('0xb'));var squel=require(_0x662e('0xc'));var crypto=require('crypto');var jsforce=require(_0x662e('0xd'));var deskjs=require(_0x662e('0xe'));var toCsv=require(_0x662e('0x9'));var querystring=require(_0x662e('0xf'));var Papa=require(_0x662e('0x10'));var Redis=require(_0x662e('0x11'));var authService=require(_0x662e('0x12'));var qs=require(_0x662e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x662e('0x14'));var logger=require(_0x662e('0x15'))(_0x662e('0x16'));var utils=require(_0x662e('0x17'));var config=require(_0x662e('0x18'));var licenseUtil=require(_0x662e('0x19'));var db=require(_0x662e('0x1a'))['db'];config[_0x662e('0x1b')]=_[_0x662e('0x1c')](config[_0x662e('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x662e('0x1d'))(new Redis(config[_0x662e('0x1b')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x662e('0x1e'));var client=jayson[_0x662e('0x1f')][_0x662e('0x20')]({'port':0x232c});var client9002=jayson[_0x662e('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e7e29,_0x3c61c1,_0x5dd4f7,_0x2e714a){return new BPromise(function(_0x17c015,_0x1797b8){var _0x4844c9=_0x2e714a||client;return _0x4844c9[_0x662e('0x21')](_0x3e7e29,_0x5dd4f7)[_0x662e('0x22')](function(_0x1a46e3){logger[_0x662e('0x23')](_0x662e('0x24'),_0x3c61c1,_0x662e('0x25'));logger['debug'](_0x662e('0x26'),_0x3c61c1,'request\x20sent',JSON[_0x662e('0x27')](_0x1a46e3));if(_0x1a46e3[_0x662e('0x28')]){if(_0x1a46e3['error'][_0x662e('0x29')]===0x1f4){logger['error'](_0x662e('0x24'),_0x3c61c1,_0x1a46e3[_0x662e('0x28')]['message']);return _0x1797b8(_0x1a46e3[_0x662e('0x28')][_0x662e('0x2a')]);}logger[_0x662e('0x28')](_0x662e('0x24'),_0x3c61c1,_0x1a46e3[_0x662e('0x28')][_0x662e('0x2a')]);return _0x17c015(_0x1a46e3[_0x662e('0x28')][_0x662e('0x2a')]);}else{logger[_0x662e('0x23')](_0x662e('0x24'),_0x3c61c1,_0x662e('0x25'));_0x17c015(_0x1a46e3[_0x662e('0x2b')][_0x662e('0x2a')]);}})[_0x662e('0x2c')](function(_0x25fa43){logger[_0x662e('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3c61c1,_0x25fa43);_0x1797b8(_0x25fa43);});});}function respondWithStatusCode(_0x2e9e26,_0x345030){_0x345030=_0x345030||0xcc;return function(_0x3384d4){if(_0x3384d4){return _0x2e9e26['sendStatus'](_0x345030);}return _0x2e9e26['status'](_0x345030)[_0x662e('0x2d')]();};}function respondWithResult(_0xfee25b,_0x39d2bb){_0x39d2bb=_0x39d2bb||0xc8;return function(_0x446c11){if(_0x446c11){return _0xfee25b[_0x662e('0x2e')](_0x39d2bb)[_0x662e('0x2f')](_0x446c11);}};}function respondWithFilteredResult(_0x6a8747,_0x2e9f81){return function(_0xd1abe3){if(_0xd1abe3){var _0x275583=typeof _0x2e9f81[_0x662e('0x30')]==='undefined'&&typeof _0x2e9f81[_0x662e('0x31')]==='undefined';var _0x23bcda=_0xd1abe3['count'];var _0x22f14a=_0x275583?0x0:_0x2e9f81['offset'];var _0x4243fe=_0x275583?_0xd1abe3['count']:_0x2e9f81[_0x662e('0x30')]+_0x2e9f81[_0x662e('0x31')];var _0xaac0cc;if(_0x4243fe>=_0x23bcda){_0x4243fe=_0x23bcda;_0xaac0cc=0xc8;}else{_0xaac0cc=0xce;}_0x6a8747['status'](_0xaac0cc);return _0x6a8747['set']('Content-Range',_0x22f14a+'-'+_0x4243fe+'/'+_0x23bcda)[_0x662e('0x2f')](_0xd1abe3);}return null;};}function patchUpdates(_0x3caf87){return function(_0x5612d1){try{jsonpatch[_0x662e('0x32')](_0x5612d1,_0x3caf87,!![]);}catch(_0x2fb7a2){return BPromise[_0x662e('0x33')](_0x2fb7a2);}return _0x5612d1[_0x662e('0x34')]();};}function saveUpdates(_0x148b16,_0x47c4b5){return function(_0x480a87){if(_0x480a87){return _0x480a87[_0x662e('0x35')](_0x148b16)[_0x662e('0x22')](function(_0x34ffb1){return _0x34ffb1;});}return null;};}function removeEntity(_0x25e7f5,_0x5e481a){return function(_0x14d262){if(_0x14d262){return _0x14d262[_0x662e('0x36')]()[_0x662e('0x22')](function(){_0x25e7f5['status'](0xcc)[_0x662e('0x2d')]();});}};}function handleEntityNotFound(_0xceebbc,_0x7b1a71){return function(_0x532f57){if(!_0x532f57){_0xceebbc[_0x662e('0x37')](0x194);}return _0x532f57;};}function handleError(_0x110caf,_0x4709c8){_0x4709c8=_0x4709c8||0x1f4;return function(_0x54bcdd){logger[_0x662e('0x28')](_0x54bcdd[_0x662e('0x38')]);if(_0x54bcdd[_0x662e('0x39')]){delete _0x54bcdd[_0x662e('0x39')];}_0x110caf[_0x662e('0x2e')](_0x4709c8)[_0x662e('0x3a')](_0x54bcdd);};}exports[_0x662e('0x3b')]=function(_0x142454,_0x19cdc8){var _0x3e07ef={},_0x1daf2f={},_0x114d1c={'count':0x0,'rows':[]};var _0x2f5fbb=_[_0x662e('0x3c')](db['ChatMessage'][_0x662e('0x3d')],function(_0x978f20){return{'name':_0x978f20[_0x662e('0x3e')],'type':_0x978f20['type']['key']};});_0x1daf2f[_0x662e('0x3f')]=_[_0x662e('0x3c')](_0x2f5fbb,_0x662e('0x39'));_0x1daf2f['query']=_['keys'](_0x142454[_0x662e('0x40')]);_0x1daf2f[_0x662e('0x41')]=_[_0x662e('0x42')](_0x1daf2f[_0x662e('0x3f')],_0x1daf2f[_0x662e('0x40')]);_0x3e07ef['attributes']=_['intersection'](_0x1daf2f['model'],qs[_0x662e('0x43')](_0x142454[_0x662e('0x40')][_0x662e('0x43')]));_0x3e07ef[_0x662e('0x44')]=_0x3e07ef['attributes']['length']?_0x3e07ef['attributes']:_0x1daf2f[_0x662e('0x3f')];if(!_0x142454['query'][_0x662e('0x45')](_0x662e('0x46'))){_0x3e07ef[_0x662e('0x31')]=qs[_0x662e('0x31')](_0x142454[_0x662e('0x40')][_0x662e('0x31')]);_0x3e07ef['offset']=qs[_0x662e('0x30')](_0x142454[_0x662e('0x40')][_0x662e('0x30')]);}_0x3e07ef[_0x662e('0x47')]=qs[_0x662e('0x48')](_0x142454[_0x662e('0x40')][_0x662e('0x48')]);_0x3e07ef[_0x662e('0x49')]=qs[_0x662e('0x41')](_[_0x662e('0x4a')](_0x142454[_0x662e('0x40')],_0x1daf2f['filters']),_0x2f5fbb);if(_0x142454[_0x662e('0x40')]['filter']){_0x3e07ef['where']=_['merge'](_0x3e07ef[_0x662e('0x49')],{'$or':_[_0x662e('0x3c')](_0x2f5fbb,function(_0x13b8a5){if(_0x13b8a5[_0x662e('0x4b')]!==_0x662e('0x4c')){var _0x482b13={};_0x482b13[_0x13b8a5[_0x662e('0x39')]]={'$like':'%'+_0x142454['query']['filter']+'%'};return _0x482b13;}})});}_0x3e07ef=_[_0x662e('0x4d')]({},_0x3e07ef,_0x142454[_0x662e('0x4e')]);var _0x177b33={'where':_0x3e07ef[_0x662e('0x49')]};return db[_0x662e('0x4f')][_0x662e('0x50')](_0x177b33)['then'](function(_0x2067b5){_0x114d1c[_0x662e('0x50')]=_0x2067b5;if(_0x142454['query'][_0x662e('0x51')]){_0x3e07ef['include']=[{'all':!![]}];}return db[_0x662e('0x4f')]['findAll'](_0x3e07ef);})['then'](function(_0x5ce27f){_0x114d1c[_0x662e('0x52')]=_0x5ce27f;return _0x114d1c;})['then'](respondWithFilteredResult(_0x19cdc8,_0x3e07ef))[_0x662e('0x2c')](handleError(_0x19cdc8,null));};exports[_0x662e('0x53')]=function(_0x10be7e,_0x1210de){var _0x44a1a4={'raw':!![],'where':{'id':_0x10be7e['params']['id']}},_0x185a04={};_0x185a04[_0x662e('0x3f')]=_['keys'](db[_0x662e('0x4f')][_0x662e('0x3d')]);_0x185a04[_0x662e('0x40')]=_[_0x662e('0x54')](_0x10be7e['query']);_0x185a04['filters']=_['intersection'](_0x185a04['model'],_0x185a04['query']);_0x44a1a4[_0x662e('0x44')]=_['intersection'](_0x185a04[_0x662e('0x3f')],qs[_0x662e('0x43')](_0x10be7e['query'][_0x662e('0x43')]));_0x44a1a4[_0x662e('0x44')]=_0x44a1a4['attributes'][_0x662e('0x55')]?_0x44a1a4[_0x662e('0x44')]:_0x185a04['model'];if(_0x10be7e[_0x662e('0x40')]['includeAll']){_0x44a1a4['include']=[{'all':!![]}];}_0x44a1a4=_[_0x662e('0x4d')]({},_0x44a1a4,_0x10be7e[_0x662e('0x4e')]);return db[_0x662e('0x4f')][_0x662e('0x56')](_0x44a1a4)[_0x662e('0x22')](handleEntityNotFound(_0x1210de,null))[_0x662e('0x22')](respondWithResult(_0x1210de,null))['catch'](handleError(_0x1210de,null));};exports[_0x662e('0x57')]=function(_0x5cb396,_0x2fee56){return db['ChatMessage'][_0x662e('0x57')](_0x5cb396[_0x662e('0x58')],{})[_0x662e('0x22')](respondWithResult(_0x2fee56,0xc9))[_0x662e('0x2c')](handleError(_0x2fee56,null));};exports[_0x662e('0x35')]=function(_0x13678f,_0x45f41f){if(_0x13678f[_0x662e('0x58')]['id']){delete _0x13678f[_0x662e('0x58')]['id'];}return db[_0x662e('0x4f')]['find']({'where':{'id':_0x13678f[_0x662e('0x59')]['id']}})['then'](handleEntityNotFound(_0x45f41f,null))['then'](saveUpdates(_0x13678f[_0x662e('0x58')],null))['then'](respondWithResult(_0x45f41f,null))[_0x662e('0x2c')](handleError(_0x45f41f,null));};exports[_0x662e('0x36')]=function(_0x4019b0,_0xf5a84a){return db['ChatMessage'][_0x662e('0x56')]({'where':{'id':_0x4019b0['params']['id']}})[_0x662e('0x22')](handleEntityNotFound(_0xf5a84a,null))[_0x662e('0x22')](removeEntity(_0xf5a84a,null))[_0x662e('0x2c')](handleError(_0xf5a84a,null));};exports['describe']=function(_0x1d1142,_0x38ce8b){return db['ChatMessage'][_0x662e('0x5a')]()['then'](respondWithResult(_0x38ce8b,null))[_0x662e('0x2c')](handleError(_0x38ce8b,null));};var interaction_log=require(_0x662e('0x15'))(_0x662e('0x5b'));exports[_0x662e('0x5c')]=function(_0x3bcdff,_0x452260,_0x41c19b){var _0x871051={'agent':{},'channel':'chat'};if(_0x3bcdff[_0x662e('0x58')]['id']){delete _0x3bcdff[_0x662e('0x58')]['id'];}_0x3bcdff['body'][_0x662e('0x5d')]=!![];_0x3bcdff[_0x662e('0x58')][_0x662e('0x5e')]=moment()[_0x662e('0x5f')](_0x662e('0x60'));_0x3bcdff['body'][_0x662e('0x61')]=_0x3bcdff[_0x662e('0x58')][_0x662e('0x61')]||_0x3bcdff[_0x662e('0x62')]['id'];_0x871051[_0x662e('0x63')]['id']=_0x3bcdff['body'][_0x662e('0x61')];return db['ChatMessage'][_0x662e('0x56')]({'where':{'id':_0x3bcdff[_0x662e('0x59')]['id'],'UserId':null}})[_0x662e('0x22')](handleEntityNotFound(_0x452260,null))[_0x662e('0x22')](saveUpdates(_0x3bcdff[_0x662e('0x58')],null))[_0x662e('0x22')](function(_0x481061){if(_0x481061){_0x871051[_0x662e('0x2a')]=_0x481061[_0x662e('0x64')]({'plain':!![]});return db[_0x662e('0x65')]['find']({'where':{'id':_0x481061[_0x662e('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x452260,null))[_0x662e('0x22')](function(_0x10599a){if(_0x10599a){return _0x10599a[_0x662e('0x35')]({'UserId':_0x3bcdff[_0x662e('0x58')][_0x662e('0x61')],'read1stAt':_[_0x662e('0x67')](_0x10599a['read1stAt'])?moment()[_0x662e('0x5f')](_0x662e('0x60')):undefined});}return null;})[_0x662e('0x22')](function(_0x2c5dc1){if(_0x2c5dc1){_0x871051[_0x662e('0x68')]=_0x2c5dc1[_0x662e('0x64')]({'plain':!![]});interaction_log['info'](_0x662e('0x69'),_0x3bcdff['user']['id'],_0x3bcdff[_0x662e('0x62')][_0x662e('0x39')],_0x3bcdff[_0x662e('0x62')][_0x662e('0x6a')],_0x871051[_0x662e('0x68')]['id'],_0x3bcdff[_0x662e('0x58')]?JSON[_0x662e('0x27')](_0x3bcdff['body']):_0x662e('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x871051);}return null;})[_0x662e('0x22')](function(_0x405dca){var _0xb76c24=_0x662e('0x6c')+_0x405dca['message']['ContactId'];return db['sequelize'][_0x662e('0x40')](_0xb76c24,{'type':db[_0x662e('0x6d')][_0x662e('0x6e')][_0x662e('0x6f')],'raw':!![]})[_0x662e('0x22')](function(_0xb8f58d){return _0xb8f58d;});})[_0x662e('0x22')](function(_0x43483a){if(_0x43483a){_0x871051[_0x662e('0x2a')][_0x662e('0x70')]=_0x43483a[0x0];if(!_0x3bcdff[_0x662e('0x58')]['UserId'])return;return db['User'][_0x662e('0x56')]({'where':{'id':_0x3bcdff['body'][_0x662e('0x61')],'role':_0x662e('0x63')},'attributes':['id',_0x662e('0x39'),_0x662e('0x71'),_0x662e('0x72'),'internal'],'raw':!![]});}return null;})[_0x662e('0x22')](function(_0x4d63d1){if(!_0x4d63d1)return null;_0x871051[_0x662e('0x2a')]['agent']=_0x4d63d1;return _0x871051;})['then'](function(_0x274433){if(_0x274433){if(_0x3bcdff['body']['manual']){_0x871051[_0x662e('0x2a')][_0x662e('0x73')]=util[_0x662e('0x5f')]('SIP/%s',_0x3bcdff[_0x662e('0x62')][_0x662e('0x39')]);_0x871051[_0x662e('0x2a')][_0x662e('0x74')]=_0x871051['channel'];_0x871051[_0x662e('0x2a')][_0x662e('0x75')]=_0x871051['channel'];_0x871051['message'][_0x662e('0x76')]='accept';return respondWithRpcPromise(_0x662e('0x77'),_0x662e('0x77'),{'event':_0x662e('0x78'),'message':_['merge'](_0x871051[_0x662e('0x2a')],JSON[_0x662e('0x79')](_0x871051[_0x662e('0x68')]['formData']))},client9002)[_0x662e('0x22')](function(){return _0x871051;});}return _0x871051;}return null;})[_0x662e('0x22')](respondWithResult(_0x452260,null))[_0x662e('0x2c')](handleError(_0x452260,null));};var interaction_log=require(_0x662e('0x15'))(_0x662e('0x5b'));exports[_0x662e('0x33')]=function(_0x3defb9,_0x51119e,_0x1920c8){var _0x26bcc6={'agent':{},'channel':_0x662e('0x7a')};if(_0x3defb9[_0x662e('0x58')]['id']){delete _0x3defb9[_0x662e('0x58')]['id'];}_0x3defb9['body'][_0x662e('0x61')]=_0x3defb9[_0x662e('0x58')]['UserId']||_0x3defb9[_0x662e('0x62')]['id'];_0x26bcc6[_0x662e('0x63')]['id']=_0x3defb9[_0x662e('0x58')]['UserId'];return db[_0x662e('0x4f')]['find']({'where':{'id':_0x3defb9[_0x662e('0x59')]['id'],'UserId':null}})[_0x662e('0x22')](handleEntityNotFound(_0x51119e,null))[_0x662e('0x22')](function(_0x403527){if(_0x403527){_0x26bcc6[_0x662e('0x2a')]=_0x403527[_0x662e('0x64')]({'plain':!![]});return db[_0x662e('0x65')][_0x662e('0x56')]({'where':{'id':_0x403527[_0x662e('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x51119e,null))[_0x662e('0x22')](function(_0x20c8a2){if(_0x20c8a2){_0x26bcc6[_0x662e('0x68')]=_0x20c8a2[_0x662e('0x64')]({'plain':!![]});interaction_log[_0x662e('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3defb9['user']['id'],_0x3defb9['user'][_0x662e('0x39')],_0x3defb9[_0x662e('0x62')][_0x662e('0x6a')],_0x26bcc6['interaction']['id'],_0x3defb9[_0x662e('0x58')]?JSON[_0x662e('0x27')](_0x3defb9['body']):_0x662e('0x6b'));return respondWithRpcPromise('RejectMessage',_0x662e('0x7b'),_0x26bcc6);}return null;})[_0x662e('0x22')](function(_0x5c2222){var _0x57f537=_0x662e('0x6c')+_0x5c2222[_0x662e('0x2a')]['ContactId'];return db[_0x662e('0x7c')][_0x662e('0x40')](_0x57f537,{'type':db[_0x662e('0x6d')][_0x662e('0x6e')][_0x662e('0x6f')],'raw':!![]})[_0x662e('0x22')](function(_0x53b71b){return _0x53b71b;});})[_0x662e('0x22')](function(_0x58660a){if(_0x58660a){_0x26bcc6[_0x662e('0x2a')][_0x662e('0x70')]=_0x58660a[0x0];if(!_0x3defb9[_0x662e('0x58')][_0x662e('0x61')])return;return db[_0x662e('0x7d')][_0x662e('0x56')]({'where':{'id':_0x3defb9[_0x662e('0x58')][_0x662e('0x61')],'role':'agent'},'attributes':['id',_0x662e('0x39'),_0x662e('0x71'),_0x662e('0x72'),'internal'],'raw':!![]});}return null;})[_0x662e('0x22')](function(_0x21b6c6){if(!_0x21b6c6)return null;_0x26bcc6[_0x662e('0x2a')][_0x662e('0x63')]=_0x21b6c6;return _0x26bcc6;})[_0x662e('0x22')](function(_0x418280){if(_0x418280){_0x418280[_0x662e('0x2a')][_0x662e('0x73')]=util['format']('SIP/%s',_0x3defb9[_0x662e('0x62')][_0x662e('0x39')]);_0x418280[_0x662e('0x2a')]['channel']=_0x26bcc6[_0x662e('0x74')];_0x418280[_0x662e('0x2a')][_0x662e('0x75')]=_0x26bcc6['channel'];_0x418280[_0x662e('0x2a')][_0x662e('0x76')]=_0x662e('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':_0x662e('0x7e'),'message':_[_0x662e('0x4d')](_0x26bcc6['message'],JSON[_0x662e('0x79')](_0x26bcc6[_0x662e('0x68')][_0x662e('0x7f')]))},client9002);return _0x26bcc6;}return null;})[_0x662e('0x22')](respondWithResult(_0x51119e,null))['catch'](handleError(_0x51119e,null));}; \ No newline at end of file +var _0x5557=['create','body','params','describe','chat-interactions','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','internal','manual','motionChannel','channel','event','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','Sequelize','SELECT','email','interface','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message','ChatMessage,\x20%s,\x20%s','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','rows','length','includeAll','options','find'];(function(_0x403eeb,_0x396419){var _0x1b8342=function(_0xf2cef7){while(--_0xf2cef7){_0x403eeb['push'](_0x403eeb['shift']());}};_0x1b8342(++_0x396419);}(_0x5557,0x132));var _0x7555=function(_0x7818b1,_0x505da9){_0x7818b1=_0x7818b1-0x0;var _0x15e2f1=_0x5557[_0x7818b1];return _0x15e2f1;};'use strict';var emlformat=require(_0x7555('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7555('0x1'));var jsonpatch=require(_0x7555('0x2'));var rp=require(_0x7555('0x3'));var moment=require(_0x7555('0x4'));var BPromise=require(_0x7555('0x5'));var Mustache=require('mustache');var util=require(_0x7555('0x6'));var path=require('path');var sox=require(_0x7555('0x7'));var csv=require(_0x7555('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7555('0x9'));var _=require(_0x7555('0xa'));var squel=require(_0x7555('0xb'));var crypto=require(_0x7555('0xc'));var jsforce=require(_0x7555('0xd'));var deskjs=require(_0x7555('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7555('0xf'));var Papa=require(_0x7555('0x10'));var Redis=require(_0x7555('0x11'));var authService=require(_0x7555('0x12'));var qs=require(_0x7555('0x13'));var as=require(_0x7555('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7555('0x15'))('api');var utils=require(_0x7555('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7555('0x17'));var db=require(_0x7555('0x18'))['db'];config[_0x7555('0x19')]=_[_0x7555('0x1a')](config[_0x7555('0x19')],{'host':_0x7555('0x1b'),'port':0x18eb});var socket=require(_0x7555('0x1c'))(new Redis(config['redis']));require(_0x7555('0x1d'))[_0x7555('0x1e')](socket);var jayson=require(_0x7555('0x1f'));var client=jayson[_0x7555('0x20')][_0x7555('0x21')]({'port':0x232c});var client9002=jayson[_0x7555('0x20')][_0x7555('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5b59cf,_0x26da90,_0x49d3a5,_0x154c90){return new BPromise(function(_0x58e236,_0x241984){var _0x5344e5=_0x154c90||client;return _0x5344e5[_0x7555('0x22')](_0x5b59cf,_0x49d3a5)[_0x7555('0x23')](function(_0x48742e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x26da90,_0x7555('0x24'));logger[_0x7555('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x26da90,'request\x20sent',JSON[_0x7555('0x26')](_0x48742e));if(_0x48742e['error']){if(_0x48742e[_0x7555('0x27')]['code']===0x1f4){logger[_0x7555('0x27')]('ChatMessage,\x20%s,\x20%s',_0x26da90,_0x48742e[_0x7555('0x27')][_0x7555('0x28')]);return _0x241984(_0x48742e[_0x7555('0x27')][_0x7555('0x28')]);}logger[_0x7555('0x27')](_0x7555('0x29'),_0x26da90,_0x48742e[_0x7555('0x27')]['message']);return _0x58e236(_0x48742e[_0x7555('0x27')][_0x7555('0x28')]);}else{logger[_0x7555('0x2a')](_0x7555('0x29'),_0x26da90,_0x7555('0x24'));_0x58e236(_0x48742e['result']['message']);}})[_0x7555('0x2b')](function(_0x4f44a4){logger[_0x7555('0x27')](_0x7555('0x29'),_0x26da90,_0x4f44a4);_0x241984(_0x4f44a4);});});}function respondWithStatusCode(_0xc13c18,_0x11845e){_0x11845e=_0x11845e||0xcc;return function(_0x213256){if(_0x213256){return _0xc13c18[_0x7555('0x2c')](_0x11845e);}return _0xc13c18['status'](_0x11845e)[_0x7555('0x2d')]();};}function respondWithResult(_0x5ce815,_0x430e2d){_0x430e2d=_0x430e2d||0xc8;return function(_0x521fd0){if(_0x521fd0){return _0x5ce815[_0x7555('0x2e')](_0x430e2d)[_0x7555('0x2f')](_0x521fd0);}};}function respondWithFilteredResult(_0x4856d6,_0x40bca3){return function(_0x57be45){if(_0x57be45){var _0x13d396=typeof _0x40bca3[_0x7555('0x30')]===_0x7555('0x31')&&typeof _0x40bca3[_0x7555('0x32')]===_0x7555('0x31');var _0x509e26=_0x57be45[_0x7555('0x33')];var _0x2cd797=_0x13d396?0x0:_0x40bca3[_0x7555('0x30')];var _0x5115a9=_0x13d396?_0x57be45[_0x7555('0x33')]:_0x40bca3[_0x7555('0x30')]+_0x40bca3[_0x7555('0x32')];var _0x4508d8;if(_0x5115a9>=_0x509e26){_0x5115a9=_0x509e26;_0x4508d8=0xc8;}else{_0x4508d8=0xce;}_0x4856d6[_0x7555('0x2e')](_0x4508d8);return _0x4856d6[_0x7555('0x34')](_0x7555('0x35'),_0x2cd797+'-'+_0x5115a9+'/'+_0x509e26)[_0x7555('0x2f')](_0x57be45);}return null;};}function patchUpdates(_0x412eb3){return function(_0x425a87){try{jsonpatch[_0x7555('0x36')](_0x425a87,_0x412eb3,!![]);}catch(_0x99d749){return BPromise[_0x7555('0x37')](_0x99d749);}return _0x425a87['save']();};}function saveUpdates(_0x209fbb,_0x504aa8){return function(_0x332955){if(_0x332955){return _0x332955[_0x7555('0x38')](_0x209fbb)['then'](function(_0x1109a7){return _0x1109a7;});}return null;};}function removeEntity(_0x5cec44,_0x4f8df7){return function(_0x3f400d){if(_0x3f400d){return _0x3f400d[_0x7555('0x39')]()[_0x7555('0x23')](function(){_0x5cec44[_0x7555('0x2e')](0xcc)[_0x7555('0x2d')]();});}};}function handleEntityNotFound(_0x1dfb31,_0x2b1f50){return function(_0x3a3466){if(!_0x3a3466){_0x1dfb31['sendStatus'](0x194);}return _0x3a3466;};}function handleError(_0x15f860,_0x560847){_0x560847=_0x560847||0x1f4;return function(_0x4c05f0){logger[_0x7555('0x27')](_0x4c05f0[_0x7555('0x3a')]);if(_0x4c05f0[_0x7555('0x3b')]){delete _0x4c05f0[_0x7555('0x3b')];}_0x15f860[_0x7555('0x2e')](_0x560847)[_0x7555('0x3c')](_0x4c05f0);};}exports[_0x7555('0x3d')]=function(_0x289e2f,_0x2f0435){var _0x20042e={},_0x39749a={},_0x5245c8={'count':0x0,'rows':[]};var _0x178290=_[_0x7555('0x3e')](db[_0x7555('0x3f')][_0x7555('0x40')],function(_0x161b75){return{'name':_0x161b75['fieldName'],'type':_0x161b75[_0x7555('0x41')][_0x7555('0x42')]};});_0x39749a[_0x7555('0x43')]=_[_0x7555('0x3e')](_0x178290,'name');_0x39749a[_0x7555('0x44')]=_[_0x7555('0x45')](_0x289e2f[_0x7555('0x44')]);_0x39749a[_0x7555('0x46')]=_[_0x7555('0x47')](_0x39749a[_0x7555('0x43')],_0x39749a['query']);_0x20042e[_0x7555('0x48')]=_['intersection'](_0x39749a[_0x7555('0x43')],qs[_0x7555('0x49')](_0x289e2f['query'][_0x7555('0x49')]));_0x20042e[_0x7555('0x48')]=_0x20042e[_0x7555('0x48')]['length']?_0x20042e[_0x7555('0x48')]:_0x39749a[_0x7555('0x43')];if(!_0x289e2f[_0x7555('0x44')][_0x7555('0x4a')]('nolimit')){_0x20042e[_0x7555('0x32')]=qs[_0x7555('0x32')](_0x289e2f[_0x7555('0x44')][_0x7555('0x32')]);_0x20042e[_0x7555('0x30')]=qs['offset'](_0x289e2f[_0x7555('0x44')][_0x7555('0x30')]);}_0x20042e[_0x7555('0x4b')]=qs[_0x7555('0x4c')](_0x289e2f[_0x7555('0x44')]['sort']);_0x20042e[_0x7555('0x4d')]=qs[_0x7555('0x46')](_['pick'](_0x289e2f['query'],_0x39749a[_0x7555('0x46')]),_0x178290);if(_0x289e2f[_0x7555('0x44')][_0x7555('0x4e')]){_0x20042e[_0x7555('0x4d')]=_[_0x7555('0x4f')](_0x20042e['where'],{'$or':_[_0x7555('0x3e')](_0x178290,function(_0x169ab5){if(_0x169ab5[_0x7555('0x41')]!==_0x7555('0x50')){var _0x425b1d={};_0x425b1d[_0x169ab5['name']]={'$like':'%'+_0x289e2f[_0x7555('0x44')][_0x7555('0x4e')]+'%'};return _0x425b1d;}})});}_0x20042e=_[_0x7555('0x4f')]({},_0x20042e,_0x289e2f['options']);var _0x112aa4={'where':_0x20042e[_0x7555('0x4d')]};return db[_0x7555('0x3f')][_0x7555('0x33')](_0x112aa4)[_0x7555('0x23')](function(_0x25d86b){_0x5245c8[_0x7555('0x33')]=_0x25d86b;if(_0x289e2f[_0x7555('0x44')]['includeAll']){_0x20042e[_0x7555('0x51')]=[{'all':!![]}];}return db[_0x7555('0x3f')]['findAll'](_0x20042e);})[_0x7555('0x23')](function(_0x584911){_0x5245c8[_0x7555('0x52')]=_0x584911;return _0x5245c8;})[_0x7555('0x23')](respondWithFilteredResult(_0x2f0435,_0x20042e))[_0x7555('0x2b')](handleError(_0x2f0435,null));};exports['show']=function(_0x17bb90,_0x3dcdec){var _0x49f46e={'raw':!![],'where':{'id':_0x17bb90['params']['id']}},_0x181352={};_0x181352[_0x7555('0x43')]=_[_0x7555('0x45')](db[_0x7555('0x3f')][_0x7555('0x40')]);_0x181352[_0x7555('0x44')]=_[_0x7555('0x45')](_0x17bb90[_0x7555('0x44')]);_0x181352[_0x7555('0x46')]=_[_0x7555('0x47')](_0x181352[_0x7555('0x43')],_0x181352['query']);_0x49f46e[_0x7555('0x48')]=_['intersection'](_0x181352[_0x7555('0x43')],qs[_0x7555('0x49')](_0x17bb90[_0x7555('0x44')][_0x7555('0x49')]));_0x49f46e['attributes']=_0x49f46e['attributes'][_0x7555('0x53')]?_0x49f46e[_0x7555('0x48')]:_0x181352[_0x7555('0x43')];if(_0x17bb90[_0x7555('0x44')][_0x7555('0x54')]){_0x49f46e[_0x7555('0x51')]=[{'all':!![]}];}_0x49f46e=_[_0x7555('0x4f')]({},_0x49f46e,_0x17bb90[_0x7555('0x55')]);return db[_0x7555('0x3f')][_0x7555('0x56')](_0x49f46e)[_0x7555('0x23')](handleEntityNotFound(_0x3dcdec,null))[_0x7555('0x23')](respondWithResult(_0x3dcdec,null))[_0x7555('0x2b')](handleError(_0x3dcdec,null));};exports[_0x7555('0x57')]=function(_0x477e30,_0xb55642){return db[_0x7555('0x3f')][_0x7555('0x57')](_0x477e30[_0x7555('0x58')],{})[_0x7555('0x23')](respondWithResult(_0xb55642,0xc9))[_0x7555('0x2b')](handleError(_0xb55642,null));};exports['update']=function(_0x522d32,_0x1d453a){if(_0x522d32[_0x7555('0x58')]['id']){delete _0x522d32[_0x7555('0x58')]['id'];}return db[_0x7555('0x3f')][_0x7555('0x56')]({'where':{'id':_0x522d32[_0x7555('0x59')]['id']}})[_0x7555('0x23')](handleEntityNotFound(_0x1d453a,null))[_0x7555('0x23')](saveUpdates(_0x522d32[_0x7555('0x58')],null))[_0x7555('0x23')](respondWithResult(_0x1d453a,null))[_0x7555('0x2b')](handleError(_0x1d453a,null));};exports['destroy']=function(_0x321424,_0x2e8dbd){return db[_0x7555('0x3f')][_0x7555('0x56')]({'where':{'id':_0x321424[_0x7555('0x59')]['id']}})[_0x7555('0x23')](handleEntityNotFound(_0x2e8dbd,null))[_0x7555('0x23')](removeEntity(_0x2e8dbd,null))[_0x7555('0x2b')](handleError(_0x2e8dbd,null));};exports[_0x7555('0x5a')]=function(_0x36eb13,_0x2c9cca){return db[_0x7555('0x3f')]['describe']()[_0x7555('0x23')](respondWithResult(_0x2c9cca,null))[_0x7555('0x2b')](handleError(_0x2c9cca,null));};var interaction_log=require('../../config/logger')(_0x7555('0x5b'));exports['accept']=function(_0x50ebca,_0x134cad,_0x48ec52){var _0x1b2c77={'agent':{},'channel':'chat'};if(_0x50ebca[_0x7555('0x58')]['id']){delete _0x50ebca[_0x7555('0x58')]['id'];}_0x50ebca[_0x7555('0x58')][_0x7555('0x5c')]=!![];_0x50ebca[_0x7555('0x58')]['readAt']=moment()[_0x7555('0x5d')](_0x7555('0x5e'));_0x50ebca[_0x7555('0x58')]['UserId']=_0x50ebca['body'][_0x7555('0x5f')]||_0x50ebca[_0x7555('0x60')]['id'];_0x1b2c77[_0x7555('0x61')]['id']=_0x50ebca['body'][_0x7555('0x5f')];return db[_0x7555('0x3f')][_0x7555('0x56')]({'where':{'id':_0x50ebca[_0x7555('0x59')]['id'],'UserId':null}})[_0x7555('0x23')](handleEntityNotFound(_0x134cad,null))[_0x7555('0x23')](saveUpdates(_0x50ebca['body'],null))['then'](function(_0x16bc00){if(_0x16bc00){_0x1b2c77[_0x7555('0x28')]=_0x16bc00['get']({'plain':!![]});return db[_0x7555('0x62')][_0x7555('0x56')]({'where':{'id':_0x16bc00[_0x7555('0x63')]}});}return null;})[_0x7555('0x23')](handleEntityNotFound(_0x134cad,null))['then'](function(_0x198bf7){if(_0x198bf7){return _0x198bf7[_0x7555('0x38')]({'UserId':_0x50ebca[_0x7555('0x58')][_0x7555('0x5f')],'read1stAt':_['isNil'](_0x198bf7[_0x7555('0x64')])?moment()['format'](_0x7555('0x5e')):undefined});}return null;})[_0x7555('0x23')](function(_0x236a39){if(_0x236a39){_0x1b2c77[_0x7555('0x65')]=_0x236a39[_0x7555('0x66')]({'plain':!![]});interaction_log['info'](_0x7555('0x67'),_0x50ebca[_0x7555('0x60')]['id'],_0x50ebca['user']['name'],_0x50ebca[_0x7555('0x60')][_0x7555('0x68')],_0x1b2c77[_0x7555('0x65')]['id'],_0x50ebca[_0x7555('0x58')]?JSON[_0x7555('0x26')](_0x50ebca[_0x7555('0x58')]):_0x7555('0x69'));return respondWithRpcPromise('AcceptMessage',_0x7555('0x6a'),_0x1b2c77);}return null;})['then'](function(_0x4df84e){var _0x37b37b=_0x7555('0x6b')+_0x4df84e['message']['ContactId'];return db[_0x7555('0x6c')][_0x7555('0x44')](_0x37b37b,{'type':db['Sequelize'][_0x7555('0x6d')]['SELECT'],'raw':!![]})[_0x7555('0x23')](function(_0x3fa07d){return _0x3fa07d;});})[_0x7555('0x23')](function(_0xa49729){if(_0xa49729){_0x1b2c77[_0x7555('0x28')][_0x7555('0x6e')]=_0xa49729[0x0];if(!_0x50ebca[_0x7555('0x58')][_0x7555('0x5f')])return;return db[_0x7555('0x6f')][_0x7555('0x56')]({'where':{'id':_0x50ebca[_0x7555('0x58')][_0x7555('0x5f')],'role':_0x7555('0x61')},'attributes':['id','name',_0x7555('0x70'),'email',_0x7555('0x71')],'raw':!![]});}return null;})[_0x7555('0x23')](function(_0x1732e3){if(!_0x1732e3)return null;_0x1b2c77[_0x7555('0x28')][_0x7555('0x61')]=_0x1732e3;return _0x1b2c77;})['then'](function(_0x67640b){if(_0x67640b){if(_0x50ebca[_0x7555('0x58')][_0x7555('0x72')]){_0x1b2c77[_0x7555('0x28')]['interface']=util[_0x7555('0x5d')]('SIP/%s',_0x50ebca[_0x7555('0x60')]['name']);_0x1b2c77[_0x7555('0x28')]['channel']=_0x1b2c77['channel'];_0x1b2c77[_0x7555('0x28')][_0x7555('0x73')]=_0x1b2c77[_0x7555('0x74')];_0x1b2c77['message'][_0x7555('0x75')]=_0x7555('0x76');return respondWithRpcPromise(_0x7555('0x77'),_0x7555('0x77'),{'event':'acceptmessage','message':_[_0x7555('0x4f')](_0x1b2c77[_0x7555('0x28')],JSON[_0x7555('0x78')](_0x1b2c77['interaction'][_0x7555('0x79')]))},client9002)[_0x7555('0x23')](function(){return _0x1b2c77;});}return _0x1b2c77;}return null;})[_0x7555('0x23')](respondWithResult(_0x134cad,null))[_0x7555('0x2b')](handleError(_0x134cad,null));};var interaction_log=require(_0x7555('0x15'))(_0x7555('0x5b'));exports[_0x7555('0x37')]=function(_0x2f6137,_0x12b4b3,_0x52e0b9){var _0x4d74e4={'agent':{},'channel':'chat'};if(_0x2f6137[_0x7555('0x58')]['id']){delete _0x2f6137['body']['id'];}_0x2f6137[_0x7555('0x58')][_0x7555('0x5f')]=_0x2f6137[_0x7555('0x58')]['UserId']||_0x2f6137[_0x7555('0x60')]['id'];_0x4d74e4[_0x7555('0x61')]['id']=_0x2f6137['body']['UserId'];return db[_0x7555('0x3f')][_0x7555('0x56')]({'where':{'id':_0x2f6137['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12b4b3,null))[_0x7555('0x23')](function(_0x4eb997){if(_0x4eb997){_0x4d74e4[_0x7555('0x28')]=_0x4eb997[_0x7555('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x7555('0x56')]({'where':{'id':_0x4eb997[_0x7555('0x63')]}});}return null;})[_0x7555('0x23')](handleEntityNotFound(_0x12b4b3,null))[_0x7555('0x23')](function(_0x1995e0){if(_0x1995e0){_0x4d74e4['interaction']=_0x1995e0['get']({'plain':!![]});interaction_log[_0x7555('0x2a')](_0x7555('0x7a'),_0x2f6137[_0x7555('0x60')]['id'],_0x2f6137[_0x7555('0x60')][_0x7555('0x3b')],_0x2f6137[_0x7555('0x60')]['role'],_0x4d74e4['interaction']['id'],_0x2f6137[_0x7555('0x58')]?JSON[_0x7555('0x26')](_0x2f6137[_0x7555('0x58')]):_0x7555('0x69'));return respondWithRpcPromise(_0x7555('0x7b'),'rejectMessage',_0x4d74e4);}return null;})[_0x7555('0x23')](function(_0x769e6f){var _0x12bfe5=_0x7555('0x6b')+_0x769e6f[_0x7555('0x28')][_0x7555('0x7c')];return db[_0x7555('0x6c')][_0x7555('0x44')](_0x12bfe5,{'type':db[_0x7555('0x7d')][_0x7555('0x6d')][_0x7555('0x7e')],'raw':!![]})[_0x7555('0x23')](function(_0x37d6d8){return _0x37d6d8;});})[_0x7555('0x23')](function(_0x307cdc){if(_0x307cdc){_0x4d74e4['message'][_0x7555('0x6e')]=_0x307cdc[0x0];if(!_0x2f6137[_0x7555('0x58')][_0x7555('0x5f')])return;return db['User'][_0x7555('0x56')]({'where':{'id':_0x2f6137[_0x7555('0x58')][_0x7555('0x5f')],'role':'agent'},'attributes':['id','name',_0x7555('0x70'),_0x7555('0x7f'),_0x7555('0x71')],'raw':!![]});}return null;})['then'](function(_0x45dc06){if(!_0x45dc06)return null;_0x4d74e4[_0x7555('0x28')][_0x7555('0x61')]=_0x45dc06;return _0x4d74e4;})[_0x7555('0x23')](function(_0x1e5c08){if(_0x1e5c08){_0x1e5c08[_0x7555('0x28')][_0x7555('0x80')]=util[_0x7555('0x5d')](_0x7555('0x81'),_0x2f6137['user'][_0x7555('0x3b')]);_0x1e5c08[_0x7555('0x28')][_0x7555('0x74')]=_0x4d74e4[_0x7555('0x74')];_0x1e5c08[_0x7555('0x28')][_0x7555('0x73')]=_0x4d74e4['channel'];_0x1e5c08[_0x7555('0x28')][_0x7555('0x75')]=_0x7555('0x37');respondWithRpcPromise(_0x7555('0x77'),_0x7555('0x77'),{'event':_0x7555('0x82'),'message':_[_0x7555('0x4f')](_0x4d74e4[_0x7555('0x28')],JSON['parse'](_0x4d74e4[_0x7555('0x65')][_0x7555('0x79')]))},client9002);return _0x4d74e4;}return null;})[_0x7555('0x23')](respondWithResult(_0x12b4b3,null))[_0x7555('0x2b')](handleError(_0x12b4b3,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 54b067b..7d9a6f5 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 _0xc0cc=['save','update','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x530e80,_0x4daf58){var _0x1ed2bd=function(_0x339cfb){while(--_0x339cfb){_0x530e80['push'](_0x530e80['shift']());}};_0x1ed2bd(++_0x4daf58);}(_0xc0cc,0x191));var _0xcc0c=function(_0x576af4,_0x109e2e){_0x576af4=_0x576af4-0x0;var _0x20b66e=_0xc0cc[_0x576af4];return _0x20b66e;};'use strict';var EventEmitter=require(_0xcc0c('0x0'));var ChatMessage=require(_0xcc0c('0x1'))['db'][_0xcc0c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcc0c('0x3')](0x0);var events={'afterCreate':_0xcc0c('0x4'),'afterUpdate':_0xcc0c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x155961){return function(_0xc82d9e,_0x37c5bf,_0x507922){ChatMessageEvents[_0xcc0c('0x6')](_0x155961+':'+_0xc82d9e['id'],_0xc82d9e);ChatMessageEvents['emit'](_0x155961,_0xc82d9e);_0x507922(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xcc0c('0x7')](e,emitEvent(event));}}module[_0xcc0c('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x8221=['remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x20dbb3,_0x4deb84){var _0x36b458=function(_0x2d053f){while(--_0x2d053f){_0x20dbb3['push'](_0x20dbb3['shift']());}};_0x36b458(++_0x4deb84);}(_0x8221,0x1bd));var _0x1822=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x8221[_0x162780];return _0x1ea2dc;};'use strict';var EventEmitter=require(_0x1822('0x0'));var ChatMessage=require(_0x1822('0x1'))['db'][_0x1822('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1822('0x3')](0x0);var events={'afterCreate':_0x1822('0x4'),'afterUpdate':'update','afterDestroy':_0x1822('0x5')};function emitEvent(_0xf91f9c){return function(_0x4c9fca,_0x286677,_0x2abeb6){ChatMessageEvents[_0x1822('0x6')](_0xf91f9c+':'+_0x4c9fca['id'],_0x4c9fca);ChatMessageEvents['emit'](_0xf91f9c,_0x4c9fca);_0x2abeb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1822('0x7')](e,emitEvent(event));}}module[_0x1822('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 62bc405..fdc8f0f 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 _0xa022=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x3161f4,_0x8e7b45){var _0x1b2b59=function(_0x2adbfd){while(--_0x2adbfd){_0x3161f4['push'](_0x3161f4['shift']());}};_0x1b2b59(++_0x8e7b45);}(_0xa022,0x1e7));var _0x2a02=function(_0x222d9a,_0x1f6349){_0x222d9a=_0x222d9a-0x0;var _0xa9f067=_0xa022[_0x222d9a];return _0xa9f067;};'use strict';var _=require(_0x2a02('0x0'));var util=require(_0x2a02('0x1'));var logger=require(_0x2a02('0x2'))(_0x2a02('0x3'));var moment=require(_0x2a02('0x4'));var BPromise=require(_0x2a02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2a02('0x6'));var config=require(_0x2a02('0x7'));var attributes=require('./chatMessage.attributes');module[_0x2a02('0x8')]=function(_0x497963,_0x14089f){return _0x497963[_0x2a02('0x9')](_0x2a02('0xa'),attributes,{'tableName':_0x2a02('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x2a02('0xc')],'type':_0x2a02('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36249c,_0x5c700e,_0x3f549d){var _0x471e27=_0x497963[_0x2a02('0xe')];var _0x4e81fc=_0x36249c['get']({'plain':!![]});if(_0x4e81fc[_0x2a02('0xf')][_0x2a02('0x10')]()==='in'||_0x4e81fc[_0x2a02('0xf')][_0x2a02('0x10')]()===_0x2a02('0x11')&&!_0x4e81fc['secret']&&!_[_0x2a02('0x12')](_0x4e81fc[_0x2a02('0x13')])){_0x471e27[_0x2a02('0x14')][_0x2a02('0x15')]({'where':{'id':_0x4e81fc[_0x2a02('0x16')]}})[_0x2a02('0x17')](function(_0x540cfd){if(_0x540cfd){_0x540cfd[_0x2a02('0x18')]({'lastMsgAt':_0x4e81fc[_0x2a02('0x19')],'lastMsgDirection':_0x4e81fc[_0x2a02('0xf')][_0x2a02('0x10')]()});}})[_0x2a02('0x1a')](function(_0x3139f0){console[_0x2a02('0x1b')](_0x3139f0);});}_0x3f549d();}},'charset':_0x2a02('0x1c'),'collate':_0x2a02('0x1d')});}; \ No newline at end of file +var _0x4853=['api','moment','bluebird','request-promise','path','rimraf','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','UserId','ChatInteraction','findOne','catch','error','util'];(function(_0x1d7907,_0x131382){var _0x4656fa=function(_0x440fd6){while(--_0x440fd6){_0x1d7907['push'](_0x1d7907['shift']());}};_0x4656fa(++_0x131382);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x3485('0x0'));var logger=require('../../config/logger')(_0x3485('0x1'));var moment=require(_0x3485('0x2'));var BPromise=require(_0x3485('0x3'));var rp=require(_0x3485('0x4'));var fs=require('fs');var path=require(_0x3485('0x5'));var rimraf=require(_0x3485('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x249d2c,_0x7512e3){return _0x249d2c[_0x3485('0x7')](_0x3485('0x8'),attributes,{'tableName':_0x3485('0x9'),'paranoid':![],'indexes':[{'name':_0x3485('0xa'),'fields':[_0x3485('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x386f6b,_0x302f8c,_0x2d18a6){var _0x876b94=_0x249d2c[_0x3485('0xc')];var _0x466c62=_0x386f6b[_0x3485('0xd')]({'plain':!![]});if(_0x466c62[_0x3485('0xe')][_0x3485('0xf')]()==='in'||_0x466c62['direction'][_0x3485('0xf')]()===_0x3485('0x10')&&!_0x466c62['secret']&&!_['isNil'](_0x466c62[_0x3485('0x11')])){_0x876b94[_0x3485('0x12')][_0x3485('0x13')]({'where':{'id':_0x466c62['ChatInteractionId']}})['then'](function(_0x4dcbd8){if(_0x4dcbd8){_0x4dcbd8['update']({'lastMsgAt':_0x466c62['createdAt'],'lastMsgDirection':_0x466c62[_0x3485('0xe')][_0x3485('0xf')]()});}})[_0x3485('0x14')](function(_0x5e792d){console[_0x3485('0x15')](_0x5e792d);});}_0x2d18a6();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 1a8daff..c4249ec 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 _0x942d=['redis','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x942d,0xb0));var _0xd942=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x942d[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xd942('0x0'));var util=require('util');var moment=require(_0xd942('0x1'));var BPromise=require('bluebird');var rs=require(_0xd942('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd942('0x3'))['db'];var utils=require(_0xd942('0x4'));var logger=require(_0xd942('0x5'))('rpc');var config=require(_0xd942('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd942('0x7')][_0xd942('0x8')]({'port':0x232a});config['redis']=_[_0xd942('0x9')](config[_0xd942('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd942('0xb'))(new Redis(config[_0xd942('0xa')]));require('./chatMessage.socket')[_0xd942('0xc')](socket);function respondWithRpcPromise(_0x181453,_0x56b029,_0x206f3f){return new BPromise(function(_0x908be7,_0x1a6fe3){return client[_0xd942('0xd')](_0x181453,_0x206f3f)[_0xd942('0xe')](function(_0xc1bf92){logger[_0xd942('0xf')](_0xd942('0x10'),_0x56b029,_0xd942('0x11'));logger[_0xd942('0x12')](_0xd942('0x13'),_0x56b029,_0xd942('0x11'),JSON[_0xd942('0x14')](_0xc1bf92));if(_0xc1bf92[_0xd942('0x15')]){if(_0xc1bf92['error'][_0xd942('0x16')]===0x1f4){logger['error'](_0xd942('0x10'),_0x56b029,_0xc1bf92[_0xd942('0x15')][_0xd942('0x17')]);return _0x1a6fe3(_0xc1bf92['error'][_0xd942('0x17')]);}logger[_0xd942('0x15')](_0xd942('0x10'),_0x56b029,_0xc1bf92[_0xd942('0x15')][_0xd942('0x17')]);return _0x908be7(_0xc1bf92[_0xd942('0x15')][_0xd942('0x17')]);}else{logger[_0xd942('0xf')](_0xd942('0x10'),_0x56b029,'request\x20sent');_0x908be7(_0xc1bf92[_0xd942('0x18')]['message']);}})[_0xd942('0x19')](function(_0x33faaf){logger[_0xd942('0x15')](_0xd942('0x10'),_0x56b029,_0x33faaf);_0x1a6fe3(_0x33faaf);});});}exports['CreateChatMessage']=function(_0x3e51d0){var _0x406461=this;return new Promise(function(_0xc1f68f,_0x5309b7){return db[_0xd942('0x1a')]['create'](_0x3e51d0[_0xd942('0x1b')],{'raw':_0x3e51d0[_0xd942('0x1c')]?_0x3e51d0[_0xd942('0x1c')][_0xd942('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xb08e06){logger[_0xd942('0xf')](_0xd942('0x1e'),_0x3e51d0);logger[_0xd942('0x12')](_0xd942('0x1e'),_0x3e51d0,JSON['stringify'](_0xb08e06));_0xc1f68f(_0xb08e06);})[_0xd942('0x19')](function(_0x39781d){logger[_0xd942('0x15')](_0xd942('0x1e'),_0x39781d[_0xd942('0x17')],_0x3e51d0);_0x5309b7(_0x406461[_0xd942('0x15')](0x1f4,_0x39781d['message']));});});}; \ No newline at end of file +var _0x16ce=['options','raw','CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','ChatMessage','create'];(function(_0x50d828,_0x9bdce8){var _0x4d8696=function(_0x10c37e){while(--_0x10c37e){_0x50d828['push'](_0x50d828['shift']());}};_0x4d8696(++_0x9bdce8);}(_0x16ce,0xfb));var _0xe16c=function(_0x599e0c,_0x1d71f5){_0x599e0c=_0x599e0c-0x0;var _0x9cbfb3=_0x16ce[_0x599e0c];return _0x9cbfb3;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});config[_0xe16c('0x9')]=_[_0xe16c('0xa')](config[_0xe16c('0x9')],{'host':_0xe16c('0xb'),'port':0x18eb});var socket=require(_0xe16c('0xc'))(new Redis(config[_0xe16c('0x9')]));require('./chatMessage.socket')[_0xe16c('0xd')](socket);function respondWithRpcPromise(_0x1dfa84,_0x3cc96b,_0x2e59ad){return new BPromise(function(_0x1b7da7,_0x280e21){return client[_0xe16c('0xe')](_0x1dfa84,_0x2e59ad)[_0xe16c('0xf')](function(_0x1b460c){logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,'request\x20sent');logger[_0xe16c('0x12')](_0xe16c('0x13'),_0x3cc96b,_0xe16c('0x14'),JSON[_0xe16c('0x15')](_0x1b460c));if(_0x1b460c['error']){if(_0x1b460c['error'][_0xe16c('0x16')]===0x1f4){logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x280e21(_0x1b460c[_0xe16c('0x17')]['message']);}logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x1b7da7(_0x1b460c[_0xe16c('0x17')][_0xe16c('0x18')]);}else{logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,_0xe16c('0x14'));_0x1b7da7(_0x1b460c['result'][_0xe16c('0x18')]);}})[_0xe16c('0x19')](function(_0x22fe04){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3cc96b,_0x22fe04);_0x280e21(_0x22fe04);});});}exports['CreateChatMessage']=function(_0x30e657){var _0x23fe64=this;return new Promise(function(_0x611939,_0xfc18a6){return db[_0xe16c('0x1a')][_0xe16c('0x1b')](_0x30e657['body'],{'raw':_0x30e657[_0xe16c('0x1c')]?_0x30e657[_0xe16c('0x1c')][_0xe16c('0x1d')]===undefined?!![]:![]:!![]})[_0xe16c('0xf')](function(_0x5a88ed){logger[_0xe16c('0x10')](_0xe16c('0x1e'),_0x30e657);logger[_0xe16c('0x12')](_0xe16c('0x1e'),_0x30e657,JSON[_0xe16c('0x15')](_0x5a88ed));_0x611939(_0x5a88ed);})[_0xe16c('0x19')](function(_0x1d888d){logger[_0xe16c('0x17')]('CreateChatMessage',_0x1d888d[_0xe16c('0x18')],_0x30e657);_0xfc18a6(_0x23fe64[_0xe16c('0x17')](0x1f4,_0x1d888d['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index d1030f0..84b489f 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 _0x0dee=['chatMessage:','./chatMessage.events','save','update','removeListener','length'];(function(_0x38569a,_0x467a4d){var _0x3980ac=function(_0x388233){while(--_0x388233){_0x38569a['push'](_0x38569a['shift']());}};_0x3980ac(++_0x467a4d);}(_0x0dee,0xf7));var _0xe0de=function(_0x7dfa9b,_0x1707bc){_0x7dfa9b=_0x7dfa9b-0x0;var _0x315ee9=_0x0dee[_0x7dfa9b];return _0x315ee9;};'use strict';var ChatMessageEvents=require(_0xe0de('0x0'));var events=[_0xe0de('0x1'),'remove',_0xe0de('0x2')];function createListener(_0x584824,_0x30c586){return function(_0x41edf0){_0x30c586['emit'](_0x584824,_0x41edf0);};}function removeListener(_0x2df224,_0x345364){return function(){ChatMessageEvents[_0xe0de('0x3')](_0x2df224,_0x345364);};}exports['register']=function(_0x2fc94c){for(var _0x4957d7=0x0,_0xfe1fd9=events[_0xe0de('0x4')];_0x4957d7<_0xfe1fd9;_0x4957d7++){var _0x349fd2=events[_0x4957d7];var _0x5b644c=createListener(_0xe0de('0x5')+_0x349fd2,_0x2fc94c);ChatMessageEvents['on'](_0x349fd2,_0x5b644c);}}; \ No newline at end of file +var _0xc18a=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xc18a,0x1cf));var _0xac18=function(_0x31bc18,_0x13e195){_0x31bc18=_0x31bc18-0x0;var _0x46d54b=_0xc18a[_0x31bc18];return _0x46d54b;};'use strict';var ChatMessageEvents=require(_0xac18('0x0'));var events=[_0xac18('0x1'),_0xac18('0x2'),_0xac18('0x3')];function createListener(_0x48266f,_0x3a3e96){return function(_0x2651c2){_0x3a3e96[_0xac18('0x4')](_0x48266f,_0x2651c2);};}function removeListener(_0x3da5f5,_0x42f646){return function(){ChatMessageEvents[_0xac18('0x5')](_0x3da5f5,_0x42f646);};}exports[_0xac18('0x6')]=function(_0x395493){for(var _0x49136f=0x0,_0xab6cb=events[_0xac18('0x7')];_0x49136f<_0xab6cb;_0x49136f++){var _0x542a9=events[_0x49136f];var _0x2bf4b8=createListener(_0xac18('0x8')+_0x542a9,_0x395493);ChatMessageEvents['on'](_0x542a9,_0x2bf4b8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c34ba84..e3e30a3 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 _0xbfd4=['index','/describe','/:id','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated'];(function(_0x411564,_0x3d7acd){var _0xdaf903=function(_0x4e5958){while(--_0x4e5958){_0x411564['push'](_0x411564['shift']());}};_0xdaf903(++_0x3d7acd);}(_0xbfd4,0xab));var _0x4bfd=function(_0x55d8f0,_0x1430f5){_0x55d8f0=_0x55d8f0-0x0;var _0x5c0743=_0xbfd4[_0x55d8f0];return _0x5c0743;};'use strict';var multer=require(_0x4bfd('0x0'));var util=require(_0x4bfd('0x1'));var path=require(_0x4bfd('0x2'));var timeout=require(_0x4bfd('0x3'));var express=require(_0x4bfd('0x4'));var router=express['Router']();var fs_extra=require(_0x4bfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4bfd('0x6'));var config=require(_0x4bfd('0x7'));var controller=require(_0x4bfd('0x8'));router[_0x4bfd('0x9')]('/',auth[_0x4bfd('0xa')](),controller[_0x4bfd('0xb')]);router[_0x4bfd('0x9')](_0x4bfd('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4bfd('0x9')](_0x4bfd('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4bfd('0xe')]('/',auth[_0x4bfd('0xa')](),interaction[_0x4bfd('0xf')](_0x4bfd('0x10'),'chatmessage:create'),controller[_0x4bfd('0x11')]);router[_0x4bfd('0x12')](_0x4bfd('0xd'),controller[_0x4bfd('0x13')]);router[_0x4bfd('0x12')](_0x4bfd('0x14'),auth['isAuthenticated'](),controller[_0x4bfd('0x15')]);router[_0x4bfd('0x12')](_0x4bfd('0x16'),auth['isAuthenticated'](),controller[_0x4bfd('0x17')]);router[_0x4bfd('0x18')](_0x4bfd('0xd'),auth[_0x4bfd('0xa')](),controller[_0x4bfd('0x19')]);module['exports']=router; \ No newline at end of file +var _0xa7da=['../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','describe','/:id','show','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x10482c,_0x3cf4fa){var _0x8362fa=function(_0x2b0132){while(--_0x2b0132){_0x10482c['push'](_0x10482c['shift']());}};_0x8362fa(++_0x3cf4fa);}(_0xa7da,0x123));var _0xaa7d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa7da[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xaa7d('0x0'));var util=require(_0xaa7d('0x1'));var path=require(_0xaa7d('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa7d('0x3'));var router=express[_0xaa7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa7d('0x5'));var interaction=require(_0xaa7d('0x6'));var config=require(_0xaa7d('0x7'));var controller=require(_0xaa7d('0x8'));router['get']('/',auth[_0xaa7d('0x9')](),controller[_0xaa7d('0xa')]);router[_0xaa7d('0xb')]('/describe',auth[_0xaa7d('0x9')](),controller[_0xaa7d('0xc')]);router[_0xaa7d('0xb')](_0xaa7d('0xd'),auth['isAuthenticated'](),controller[_0xaa7d('0xe')]);router['post']('/',auth[_0xaa7d('0x9')](),interaction['tracked'](_0xaa7d('0xf'),_0xaa7d('0x10')),controller[_0xaa7d('0x11')]);router[_0xaa7d('0x12')](_0xaa7d('0xd'),controller[_0xaa7d('0x13')]);router[_0xaa7d('0x12')](_0xaa7d('0x14'),auth['isAuthenticated'](),controller[_0xaa7d('0x15')]);router['put'](_0xaa7d('0x16'),auth[_0xaa7d('0x9')](),controller[_0xaa7d('0x17')]);router[_0xaa7d('0x18')]('/:id',auth[_0xaa7d('0x9')](),controller[_0xaa7d('0x19')]);module[_0xaa7d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index e73b3ee..1a907bb 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x6eeea3,_0x27e478){var _0x2715fc=function(_0x5e4df6){while(--_0x5e4df6){_0x6eeea3['push'](_0x6eeea3['shift']());}};_0x2715fc(++_0x27e478);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e41db,_0x38d213){_0x1e41db=_0x1e41db-0x0;var _0x11b1ac=_0x5f2f[_0x1e41db];return _0x11b1ac;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x2714eb,_0x554280){var _0x1da83d=function(_0x16eca6){while(--_0x16eca6){_0x2714eb['push'](_0x2714eb['shift']());}};_0x1da83d(++_0x554280);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('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 4e16e5d..9b4779b 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(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7a54,0x106));var _0x47a5=function(_0x44ca3d,_0x2b0732){_0x44ca3d=_0x44ca3d-0x0;var _0x10f601=_0x7a54[_0x44ca3d];return _0x10f601;};'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(_0x1fc04a,_0x199982){var _0xbe31ad=function(_0x5537dc){while(--_0x5537dc){_0x1fc04a['push'](_0x1fc04a['shift']());}};_0xbe31ad(++_0x199982);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];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 4946bad..845f378 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 _0xea98=['ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xea98,0x19e));var _0x8ea9=function(_0x25e947,_0x5ef1a5){_0x25e947=_0x25e947-0x0;var _0x25184=_0xea98[_0x25e947];return _0x25184;};'use strict';var EventEmitter=require(_0x8ea9('0x0'));var ChatOfflineMessage=require(_0x8ea9('0x1'))['db'][_0x8ea9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ea9('0x3'),'afterUpdate':'update','afterDestroy':_0x8ea9('0x4')};function emitEvent(_0x539f03){return function(_0x5bf1a5,_0x178b2e,_0x2afee8){ChatOfflineMessageEvents[_0x8ea9('0x5')](_0x539f03+':'+_0x5bf1a5['id'],_0x5bf1a5);ChatOfflineMessageEvents[_0x8ea9('0x5')](_0x539f03,_0x5bf1a5);_0x2afee8(null);};}for(var e in events){if(events[_0x8ea9('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x8ea9('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xd4f7=['events','setMaxListeners','save','update','emit','hook','exports'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0xd4f7,0x8c));var _0x7d4f=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xd4f7[_0x492af5];return _0x59f529;};'use strict';var EventEmitter=require(_0x7d4f('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7d4f('0x1')](0x0);var events={'afterCreate':_0x7d4f('0x2'),'afterUpdate':_0x7d4f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b4844){return function(_0x5dd1ed,_0x1d0a46,_0x4d0d59){ChatOfflineMessageEvents[_0x7d4f('0x4')](_0x2b4844+':'+_0x5dd1ed['id'],_0x5dd1ed);ChatOfflineMessageEvents[_0x7d4f('0x4')](_0x2b4844,_0x5dd1ed);_0x4d0d59(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x7d4f('0x5')](e,emitEvent(event));}}module[_0x7d4f('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 038c9f3..98aa264 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 _0xa72c=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0x123d2c,_0x23715c){var _0x6830fb=function(_0x42a45e){while(--_0x42a45e){_0x123d2c['push'](_0x123d2c['shift']());}};_0x6830fb(++_0x23715c);}(_0xa72c,0xca));var _0xca72=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xa72c[_0x2ae2ad];return _0x26dbd7;};'use strict';var attributes=require(_0xca72('0x0'));module['exports']=function(_0x4f7b7e){return _0x4f7b7e[_0xca72('0x1')](_0xca72('0x2'),attributes,{'tableName':_0xca72('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca72('0x4'),'collate':_0xca72('0x5')});}; \ No newline at end of file +var _0x1a63=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x40ab54,_0x486321){var _0x2cd51f=function(_0x162971){while(--_0x162971){_0x40ab54['push'](_0x40ab54['shift']());}};_0x2cd51f(++_0x486321);}(_0x1a63,0xf7));var _0x31a6=function(_0x1a9cdb,_0x5ac842){_0x1a9cdb=_0x1a9cdb-0x0;var _0x42d97f=_0x1a63[_0x1a9cdb];return _0x42d97f;};'use strict';var attributes=require(_0x31a6('0x0'));module['exports']=function(_0x349234){return _0x349234[_0x31a6('0x1')](_0x31a6('0x2'),attributes,{'tableName':_0x31a6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x31a6('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 372bebb..973f10b 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 _0x4b1f=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0x4b1f,0x195));var _0xf4b1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4b1f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var moment=require('moment');var BPromise=require(_0xf4b1('0x2'));var rs=require(_0xf4b1('0x3'));var fs=require('fs');var Redis=require(_0xf4b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4b1('0x5'));var logger=require(_0xf4b1('0x6'))(_0xf4b1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf4b1('0x8')][_0xf4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x310db5,_0x3b9c78,_0x1abfc7){return new BPromise(function(_0x50738c,_0x59cf77){return client['request'](_0x310db5,_0x1abfc7)[_0xf4b1('0xa')](function(_0x53a786){logger[_0xf4b1('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b9c78,'request\x20sent');logger[_0xf4b1('0xc')](_0xf4b1('0xd'),_0x3b9c78,_0xf4b1('0xe'),JSON[_0xf4b1('0xf')](_0x53a786));if(_0x53a786[_0xf4b1('0x10')]){if(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x11')]===0x1f4){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);return _0x59cf77(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3b9c78,_0x53a786[_0xf4b1('0x10')]['message']);return _0x50738c(_0x53a786['error'][_0xf4b1('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3b9c78,_0xf4b1('0xe'));_0x50738c(_0x53a786['result']['message']);}})['catch'](function(_0x5cb2a1){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x5cb2a1);_0x59cf77(_0x5cb2a1);});});} \ No newline at end of file +var _0xb5fc=['client','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x590d49,_0x130f80){var _0x1ca79b=function(_0x35e777){while(--_0x35e777){_0x590d49['push'](_0x590d49['shift']());}};_0x1ca79b(++_0x130f80);}(_0xb5fc,0x71));var _0xcb5f=function(_0x233425,_0x4a8a59){_0x233425=_0x233425-0x0;var _0xd87764=_0xb5fc[_0x233425];return _0xd87764;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb5f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb5f('0x1'))['db'];var utils=require(_0xcb5f('0x2'));var logger=require(_0xcb5f('0x3'))(_0xcb5f('0x4'));var config=require(_0xcb5f('0x5'));var jayson=require(_0xcb5f('0x6'));var client=jayson[_0xcb5f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13abe7,_0x48cfe1,_0x1dfeb0){return new BPromise(function(_0x29308d,_0x36535f){return client[_0xcb5f('0x8')](_0x13abe7,_0x1dfeb0)['then'](function(_0x2165f6){logger[_0xcb5f('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48cfe1,_0xcb5f('0xa'));logger[_0xcb5f('0xb')](_0xcb5f('0xc'),_0x48cfe1,_0xcb5f('0xa'),JSON[_0xcb5f('0xd')](_0x2165f6));if(_0x2165f6[_0xcb5f('0xe')]){if(_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0xf')]===0x1f4){logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);return _0x36535f(_0x2165f6['error'][_0xcb5f('0x11')]);}logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);return _0x29308d(_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x48cfe1,_0xcb5f('0xa'));_0x29308d(_0x2165f6[_0xcb5f('0x12')][_0xcb5f('0x11')]);}})[_0xcb5f('0x13')](function(_0x3909be){logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x3909be);_0x36535f(_0x3909be);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1f315d0..69de8a8 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 _0x697a=['isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get'];(function(_0x3fcedb,_0x19e410){var _0x25a1b2=function(_0x14d5c3){while(--_0x14d5c3){_0x3fcedb['push'](_0x3fcedb['shift']());}};_0x25a1b2(++_0x19e410);}(_0x697a,0x106));var _0xa697=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x697a[_0x238671];return _0x474844;};'use strict';var multer=require(_0xa697('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa697('0x1'));var express=require(_0xa697('0x2'));var router=express[_0xa697('0x3')]();var fs_extra=require(_0xa697('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa697('0x5'));var config=require('../../config/environment');var controller=require(_0xa697('0x6'));router[_0xa697('0x7')]('/',auth[_0xa697('0x8')](),controller['index']);router['get'](_0xa697('0x9'),auth[_0xa697('0x8')](),controller[_0xa697('0xa')]);router[_0xa697('0x7')](_0xa697('0xb'),auth['isAuthenticated'](),controller[_0xa697('0xc')]);router[_0xa697('0xd')]('/',auth['isAuthenticated'](),controller[_0xa697('0xe')]);router[_0xa697('0xf')]('/:id',auth[_0xa697('0x8')](),controller['update']);router[_0xa697('0x10')]('/:id',auth[_0xa697('0x8')](),controller[_0xa697('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa923=['create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post'];(function(_0x483225,_0x134cbd){var _0x21c51b=function(_0x23dd0e){while(--_0x23dd0e){_0x483225['push'](_0x483225['shift']());}};_0x21c51b(++_0x134cbd);}(_0xa923,0xe2));var _0x3a92=function(_0x295557,_0x548d1d){_0x295557=_0x295557-0x0;var _0x251ba3=_0xa923[_0x295557];return _0x251ba3;};'use strict';var multer=require(_0x3a92('0x0'));var util=require(_0x3a92('0x1'));var path=require('path');var timeout=require(_0x3a92('0x2'));var express=require(_0x3a92('0x3'));var router=express[_0x3a92('0x4')]();var fs_extra=require(_0x3a92('0x5'));var auth=require(_0x3a92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a92('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x3a92('0x8')]('/',auth[_0x3a92('0x9')](),controller['index']);router['get']('/describe',auth[_0x3a92('0x9')](),controller['describe']);router[_0x3a92('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3a92('0xa')]);router[_0x3a92('0xb')]('/',auth[_0x3a92('0x9')](),controller[_0x3a92('0xc')]);router[_0x3a92('0xd')](_0x3a92('0xe'),auth[_0x3a92('0x9')](),controller['update']);router['delete'](_0x3a92('0xe'),auth[_0x3a92('0x9')](),controller[_0x3a92('0xf')]);module[_0x3a92('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0cdbd16..4352c98 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 _0xf2bc=['sequelize','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xf2bc,0x114));var _0xcf2b=function(_0x17b23c,_0x423472){_0x17b23c=_0x17b23c-0x0;var _0x3af1b4=_0xf2bc[_0x17b23c];return _0x3af1b4;};'use strict';var Sequelize=require(_0xcf2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xcf2b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcf2b('0x2')]('mouseOver',_0xcf2b('0x3')),'defaultValue':_0xcf2b('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcf2b('0x5')]}}; \ No newline at end of file +var _0xdf73=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x3e07f5,_0x399410){var _0x22d810=function(_0x36c4b2){while(--_0x36c4b2){_0x3e07f5['push'](_0x3e07f5['shift']());}};_0x22d810(++_0x399410);}(_0xdf73,0x155));var _0x3df7=function(_0x2da978,_0xe13cb6){_0x2da978=_0x2da978-0x0;var _0x3785d6=_0xdf73[_0x2da978];return _0x3785d6;};'use strict';var Sequelize=require(_0x3df7('0x0'));module[_0x3df7('0x1')]={'name':{'type':Sequelize[_0x3df7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3df7('0x3'),_0x3df7('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3df7('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index f6331ca..1e99342 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 _0xa1db=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2562a3,_0x4dce46){var _0x254507=function(_0x1a1bdb){while(--_0x1a1bdb){_0x2562a3['push'](_0x2562a3['shift']());}};_0x254507(++_0x4dce46);}(_0xa1db,0xb0));var _0xba1d=function(_0x3d03e4,_0x2b855c){_0x3d03e4=_0x3d03e4-0x0;var _0x227fea=_0xa1db[_0x3d03e4];return _0x227fea;};'use strict';var emlformat=require(_0xba1d('0x0'));var rimraf=require(_0xba1d('0x1'));var zipdir=require(_0xba1d('0x2'));var jsonpatch=require(_0xba1d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba1d('0x4'));var Mustache=require(_0xba1d('0x5'));var util=require('util');var path=require(_0xba1d('0x6'));var sox=require(_0xba1d('0x7'));var csv=require(_0xba1d('0x8'));var ejs=require(_0xba1d('0x9'));var fs=require('fs');var fs_extra=require(_0xba1d('0xa'));var _=require(_0xba1d('0xb'));var squel=require(_0xba1d('0xc'));var crypto=require(_0xba1d('0xd'));var jsforce=require(_0xba1d('0xe'));var deskjs=require(_0xba1d('0xf'));var toCsv=require(_0xba1d('0x8'));var querystring=require(_0xba1d('0x10'));var Papa=require(_0xba1d('0x11'));var Redis=require('ioredis');var authService=require(_0xba1d('0x12'));var qs=require(_0xba1d('0x13'));var as=require(_0xba1d('0x14'));var hardwareService=require(_0xba1d('0x15'));var logger=require(_0xba1d('0x16'))(_0xba1d('0x17'));var utils=require(_0xba1d('0x18'));var config=require(_0xba1d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xba1d('0x1a'))['db'];function respondWithStatusCode(_0x8ea64,_0x981e77){_0x981e77=_0x981e77||0xcc;return function(_0x1c771f){if(_0x1c771f){return _0x8ea64[_0xba1d('0x1b')](_0x981e77);}return _0x8ea64['status'](_0x981e77)['end']();};}function respondWithResult(_0x2db5ae,_0x36af42){_0x36af42=_0x36af42||0xc8;return function(_0x1b2c83){if(_0x1b2c83){return _0x2db5ae[_0xba1d('0x1c')](_0x36af42)[_0xba1d('0x1d')](_0x1b2c83);}};}function respondWithFilteredResult(_0x126602,_0x5da25d){return function(_0x47f4d7){if(_0x47f4d7){var _0x2c1dcc=typeof _0x5da25d[_0xba1d('0x1e')]===_0xba1d('0x1f')&&typeof _0x5da25d['limit']===_0xba1d('0x1f');var _0x59180c=_0x47f4d7[_0xba1d('0x20')];var _0x1fbc30=_0x2c1dcc?0x0:_0x5da25d[_0xba1d('0x1e')];var _0x4179e2=_0x2c1dcc?_0x47f4d7['count']:_0x5da25d[_0xba1d('0x1e')]+_0x5da25d[_0xba1d('0x21')];var _0x34149b;if(_0x4179e2>=_0x59180c){_0x4179e2=_0x59180c;_0x34149b=0xc8;}else{_0x34149b=0xce;}_0x126602[_0xba1d('0x1c')](_0x34149b);return _0x126602[_0xba1d('0x22')](_0xba1d('0x23'),_0x1fbc30+'-'+_0x4179e2+'/'+_0x59180c)['json'](_0x47f4d7);}return null;};}function patchUpdates(_0xf438ab){return function(_0x3a6158){try{jsonpatch[_0xba1d('0x24')](_0x3a6158,_0xf438ab,!![]);}catch(_0x39b8de){return BPromise[_0xba1d('0x25')](_0x39b8de);}return _0x3a6158[_0xba1d('0x26')]();};}function saveUpdates(_0x1b02d6,_0x278161){return function(_0x27d37c){if(_0x27d37c){return _0x27d37c['update'](_0x1b02d6)[_0xba1d('0x27')](function(_0x9b939b){return _0x9b939b;});}return null;};}function removeEntity(_0x44eb3a,_0x588839){return function(_0x383d61){if(_0x383d61){return _0x383d61[_0xba1d('0x28')]()[_0xba1d('0x27')](function(){_0x44eb3a[_0xba1d('0x1c')](0xcc)[_0xba1d('0x29')]();});}};}function handleEntityNotFound(_0x8aae1c,_0x628825){return function(_0x8e9606){if(!_0x8e9606){_0x8aae1c['sendStatus'](0x194);}return _0x8e9606;};}function handleError(_0x47efda,_0x2c9b74){_0x2c9b74=_0x2c9b74||0x1f4;return function(_0x5c0e7b){logger[_0xba1d('0x2a')](_0x5c0e7b['stack']);if(_0x5c0e7b['name']){delete _0x5c0e7b['name'];}_0x47efda[_0xba1d('0x1c')](_0x2c9b74)[_0xba1d('0x2b')](_0x5c0e7b);};}exports[_0xba1d('0x2c')]=function(_0x1501aa,_0x245f50){var _0x4c6a1e={'raw':!![],'where':{'id':_0x1501aa[_0xba1d('0x2d')]['id']}},_0x45bc8d={};_0x45bc8d[_0xba1d('0x2e')]=_[_0xba1d('0x2f')](db[_0xba1d('0x30')][_0xba1d('0x31')]);_0x45bc8d['query']=_[_0xba1d('0x2f')](_0x1501aa[_0xba1d('0x32')]);_0x45bc8d[_0xba1d('0x33')]=_[_0xba1d('0x34')](_0x45bc8d[_0xba1d('0x2e')],_0x45bc8d[_0xba1d('0x32')]);_0x4c6a1e[_0xba1d('0x35')]=_['intersection'](_0x45bc8d[_0xba1d('0x2e')],qs['fields'](_0x1501aa[_0xba1d('0x32')][_0xba1d('0x36')]));_0x4c6a1e['attributes']=_0x4c6a1e['attributes']['length']?_0x4c6a1e[_0xba1d('0x35')]:_0x45bc8d[_0xba1d('0x2e')];if(_0x1501aa[_0xba1d('0x32')][_0xba1d('0x37')]){_0x4c6a1e[_0xba1d('0x38')]=[{'all':!![]}];}_0x4c6a1e=_[_0xba1d('0x39')]({},_0x4c6a1e,_0x1501aa[_0xba1d('0x3a')]);return db['ChatProactiveAction'][_0xba1d('0x3b')](_0x4c6a1e)[_0xba1d('0x27')](handleEntityNotFound(_0x245f50,null))['then'](respondWithResult(_0x245f50,null))[_0xba1d('0x3c')](handleError(_0x245f50,null));};exports[_0xba1d('0x3d')]=function(_0x423de0,_0x3f86da){return db['ChatProactiveAction'][_0xba1d('0x3d')](_0x423de0[_0xba1d('0x3e')],{})['then'](respondWithResult(_0x3f86da,0xc9))[_0xba1d('0x3c')](handleError(_0x3f86da,null));};exports['update']=function(_0x445417,_0x2ad905){if(_0x445417[_0xba1d('0x3e')]['id']){delete _0x445417[_0xba1d('0x3e')]['id'];}return db['ChatProactiveAction'][_0xba1d('0x3b')]({'where':{'id':_0x445417[_0xba1d('0x2d')]['id']}})[_0xba1d('0x27')](handleEntityNotFound(_0x2ad905,null))[_0xba1d('0x27')](saveUpdates(_0x445417[_0xba1d('0x3e')],null))[_0xba1d('0x27')](respondWithResult(_0x2ad905,null))['catch'](handleError(_0x2ad905,null));};exports[_0xba1d('0x28')]=function(_0x5c8fa2,_0x3f1c4a){return db[_0xba1d('0x30')]['find']({'where':{'id':_0x5c8fa2[_0xba1d('0x2d')]['id']}})[_0xba1d('0x27')](handleEntityNotFound(_0x3f1c4a,null))[_0xba1d('0x27')](removeEntity(_0x3f1c4a,null))['catch'](handleError(_0x3f1c4a,null));}; \ No newline at end of file +var _0x0bde=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','stack','name','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','find','catch','create','ChatProactiveAction','body','update','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x227944,_0x2a00e5){var _0x3d884d=function(_0x121139){while(--_0x121139){_0x227944['push'](_0x227944['shift']());}};_0x3d884d(++_0x2a00e5);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require('request-promise');var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var Redis=require('ioredis');var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bd('0x14'));var logger=require('../../config/logger')(_0xe0bd('0x15'));var utils=require(_0xe0bd('0x16'));var config=require(_0xe0bd('0x17'));var licenseUtil=require(_0xe0bd('0x18'));var db=require(_0xe0bd('0x19'))['db'];function respondWithStatusCode(_0x16c3a9,_0x1905b2){_0x1905b2=_0x1905b2||0xcc;return function(_0x500a9e){if(_0x500a9e){return _0x16c3a9[_0xe0bd('0x1a')](_0x1905b2);}return _0x16c3a9[_0xe0bd('0x1b')](_0x1905b2)[_0xe0bd('0x1c')]();};}function respondWithResult(_0x5c76f1,_0x479438){_0x479438=_0x479438||0xc8;return function(_0x48afde){if(_0x48afde){return _0x5c76f1[_0xe0bd('0x1b')](_0x479438)[_0xe0bd('0x1d')](_0x48afde);}};}function respondWithFilteredResult(_0x3f5ef7,_0x3042e1){return function(_0x361429){if(_0x361429){var _0x302f5f=typeof _0x3042e1[_0xe0bd('0x1e')]===_0xe0bd('0x1f')&&typeof _0x3042e1['limit']==='undefined';var _0x2d2ba3=_0x361429[_0xe0bd('0x20')];var _0x1c4533=_0x302f5f?0x0:_0x3042e1[_0xe0bd('0x1e')];var _0xa6be32=_0x302f5f?_0x361429[_0xe0bd('0x20')]:_0x3042e1['offset']+_0x3042e1['limit'];var _0x29bd21;if(_0xa6be32>=_0x2d2ba3){_0xa6be32=_0x2d2ba3;_0x29bd21=0xc8;}else{_0x29bd21=0xce;}_0x3f5ef7[_0xe0bd('0x1b')](_0x29bd21);return _0x3f5ef7[_0xe0bd('0x21')](_0xe0bd('0x22'),_0x1c4533+'-'+_0xa6be32+'/'+_0x2d2ba3)[_0xe0bd('0x1d')](_0x361429);}return null;};}function patchUpdates(_0x154480){return function(_0x3dbd98){try{jsonpatch['apply'](_0x3dbd98,_0x154480,!![]);}catch(_0x5ad8bf){return BPromise[_0xe0bd('0x23')](_0x5ad8bf);}return _0x3dbd98[_0xe0bd('0x24')]();};}function saveUpdates(_0x3927ab,_0xdcb789){return function(_0x290c1e){if(_0x290c1e){return _0x290c1e['update'](_0x3927ab)[_0xe0bd('0x25')](function(_0x4795ac){return _0x4795ac;});}return null;};}function removeEntity(_0x242cbe,_0x296f64){return function(_0x3f24b6){if(_0x3f24b6){return _0x3f24b6['destroy']()[_0xe0bd('0x25')](function(){_0x242cbe[_0xe0bd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ca10,_0x5e6496){return function(_0x2debcb){if(!_0x2debcb){_0x41ca10['sendStatus'](0x194);}return _0x2debcb;};}function handleError(_0x198a1c,_0x72e284){_0x72e284=_0x72e284||0x1f4;return function(_0x3c851d){logger['error'](_0x3c851d[_0xe0bd('0x26')]);if(_0x3c851d['name']){delete _0x3c851d[_0xe0bd('0x27')];}_0x198a1c[_0xe0bd('0x1b')](_0x72e284)['send'](_0x3c851d);};}exports['show']=function(_0x273b95,_0x3789a1){var _0x441475={'raw':!![],'where':{'id':_0x273b95[_0xe0bd('0x28')]['id']}},_0x23a317={};_0x23a317[_0xe0bd('0x29')]=_[_0xe0bd('0x2a')](db['ChatProactiveAction'][_0xe0bd('0x2b')]);_0x23a317[_0xe0bd('0x2c')]=_[_0xe0bd('0x2a')](_0x273b95[_0xe0bd('0x2c')]);_0x23a317[_0xe0bd('0x2d')]=_[_0xe0bd('0x2e')](_0x23a317['model'],_0x23a317[_0xe0bd('0x2c')]);_0x441475[_0xe0bd('0x2f')]=_[_0xe0bd('0x2e')](_0x23a317[_0xe0bd('0x29')],qs[_0xe0bd('0x30')](_0x273b95[_0xe0bd('0x2c')][_0xe0bd('0x30')]));_0x441475[_0xe0bd('0x2f')]=_0x441475['attributes']['length']?_0x441475[_0xe0bd('0x2f')]:_0x23a317[_0xe0bd('0x29')];if(_0x273b95[_0xe0bd('0x2c')][_0xe0bd('0x31')]){_0x441475[_0xe0bd('0x32')]=[{'all':!![]}];}_0x441475=_['merge']({},_0x441475,_0x273b95['options']);return db['ChatProactiveAction'][_0xe0bd('0x33')](_0x441475)[_0xe0bd('0x25')](handleEntityNotFound(_0x3789a1,null))[_0xe0bd('0x25')](respondWithResult(_0x3789a1,null))[_0xe0bd('0x34')](handleError(_0x3789a1,null));};exports[_0xe0bd('0x35')]=function(_0x3df4c8,_0x4b48f5){return db[_0xe0bd('0x36')][_0xe0bd('0x35')](_0x3df4c8[_0xe0bd('0x37')],{})['then'](respondWithResult(_0x4b48f5,0xc9))[_0xe0bd('0x34')](handleError(_0x4b48f5,null));};exports[_0xe0bd('0x38')]=function(_0x4e56d9,_0x193f94){if(_0x4e56d9[_0xe0bd('0x37')]['id']){delete _0x4e56d9[_0xe0bd('0x37')]['id'];}return db['ChatProactiveAction'][_0xe0bd('0x33')]({'where':{'id':_0x4e56d9['params']['id']}})[_0xe0bd('0x25')](handleEntityNotFound(_0x193f94,null))[_0xe0bd('0x25')](saveUpdates(_0x4e56d9[_0xe0bd('0x37')],null))[_0xe0bd('0x25')](respondWithResult(_0x193f94,null))['catch'](handleError(_0x193f94,null));};exports[_0xe0bd('0x39')]=function(_0x184ac4,_0x7f9272){return db['ChatProactiveAction']['find']({'where':{'id':_0x184ac4[_0xe0bd('0x28')]['id']}})[_0xe0bd('0x25')](handleEntityNotFound(_0x7f9272,null))[_0xe0bd('0x25')](removeEntity(_0x7f9272,null))['catch'](handleError(_0x7f9272,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f6aad6d..bacece3 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 _0x399c=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x5a5e47,_0x144051){var _0x5ec6cc=function(_0x1b75ae){while(--_0x1b75ae){_0x5a5e47['push'](_0x5a5e47['shift']());}};_0x5ec6cc(++_0x144051);}(_0x399c,0x19f));var _0xc399=function(_0x342a3f,_0x117d04){_0x342a3f=_0x342a3f-0x0;var _0x25f639=_0x399c[_0x342a3f];return _0x25f639;};'use strict';var _=require(_0xc399('0x0'));var util=require(_0xc399('0x1'));var logger=require(_0xc399('0x2'))(_0xc399('0x3'));var moment=require(_0xc399('0x4'));var BPromise=require(_0xc399('0x5'));var rp=require(_0xc399('0x6'));var fs=require('fs');var path=require(_0xc399('0x7'));var rimraf=require('rimraf');var config=require(_0xc399('0x8'));var attributes=require(_0xc399('0x9'));module['exports']=function(_0xf4730f,_0xf880b4){return _0xf4730f[_0xc399('0xa')](_0xc399('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c12=['define','chat_proactive_actions','lodash','../../config/logger','api','moment','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x11add7,_0x2175d8){var _0x109ec9=function(_0x5037dd){while(--_0x5037dd){_0x11add7['push'](_0x11add7['shift']());}};_0x109ec9(++_0x2175d8);}(_0x6c12,0x158));var _0x26c1=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x6c12[_0x2998db];return _0x115fea;};'use strict';var _=require(_0x26c1('0x0'));var util=require('util');var logger=require(_0x26c1('0x1'))(_0x26c1('0x2'));var moment=require(_0x26c1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x26c1('0x4'));var attributes=require(_0x26c1('0x5'));module[_0x26c1('0x6')]=function(_0x24f7ab,_0x103bd7){return _0x24f7ab[_0x26c1('0x7')]('ChatProactiveAction',attributes,{'tableName':_0x26c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index c18705e..ad80fda 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 _0xd7a8=['jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xd7a8,0x16c));var _0x8d7a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd7a8[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x8d7a('0x0'));var util=require(_0x8d7a('0x1'));var moment=require(_0x8d7a('0x2'));var BPromise=require(_0x8d7a('0x3'));var rs=require(_0x8d7a('0x4'));var fs=require('fs');var Redis=require(_0x8d7a('0x5'));var db=require(_0x8d7a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d7a('0x7'))(_0x8d7a('0x8'));var config=require(_0x8d7a('0x9'));var jayson=require(_0x8d7a('0xa'));var client=jayson['client'][_0x8d7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3376cc,_0x3cdc98,_0x4b9124){return new BPromise(function(_0x4d5e51,_0x357b40){return client[_0x8d7a('0xc')](_0x3376cc,_0x4b9124)['then'](function(_0x57296c){logger[_0x8d7a('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cdc98,_0x8d7a('0xe'));logger[_0x8d7a('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3cdc98,_0x8d7a('0xe'),JSON[_0x8d7a('0x10')](_0x57296c));if(_0x57296c[_0x8d7a('0x11')]){if(_0x57296c[_0x8d7a('0x11')][_0x8d7a('0x12')]===0x1f4){logger[_0x8d7a('0x11')](_0x8d7a('0x13'),_0x3cdc98,_0x57296c[_0x8d7a('0x11')]['message']);return _0x357b40(_0x57296c[_0x8d7a('0x11')][_0x8d7a('0x14')]);}logger[_0x8d7a('0x11')](_0x8d7a('0x13'),_0x3cdc98,_0x57296c[_0x8d7a('0x11')][_0x8d7a('0x14')]);return _0x4d5e51(_0x57296c['error'][_0x8d7a('0x14')]);}else{logger[_0x8d7a('0xd')](_0x8d7a('0x13'),_0x3cdc98,_0x8d7a('0xe'));_0x4d5e51(_0x57296c['result']['message']);}})[_0x8d7a('0x15')](function(_0x1fd858){logger[_0x8d7a('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cdc98,_0x1fd858);_0x357b40(_0x1fd858);});});} \ No newline at end of file +var _0x4c67=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36409b,_0x1e6d2d){var _0x3099e0=function(_0x8442f1){while(--_0x8442f1){_0x36409b['push'](_0x36409b['shift']());}};_0x3099e0(++_0x1e6d2d);}(_0x4c67,0x1cd));var _0x74c6=function(_0x55cd85,_0x176b6f){_0x55cd85=_0x55cd85-0x0;var _0x6e1010=_0x4c67[_0x55cd85];return _0x6e1010;};'use strict';var _=require(_0x74c6('0x0'));var util=require(_0x74c6('0x1'));var moment=require(_0x74c6('0x2'));var BPromise=require(_0x74c6('0x3'));var rs=require(_0x74c6('0x4'));var fs=require('fs');var Redis=require(_0x74c6('0x5'));var db=require(_0x74c6('0x6'))['db'];var utils=require(_0x74c6('0x7'));var logger=require(_0x74c6('0x8'))(_0x74c6('0x9'));var config=require(_0x74c6('0xa'));var jayson=require(_0x74c6('0xb'));var client=jayson[_0x74c6('0xc')][_0x74c6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xf3a76e,_0x5d446c,_0x13a36d){return new BPromise(function(_0x3973d8,_0x36a3df){return client[_0x74c6('0xe')](_0xf3a76e,_0x13a36d)[_0x74c6('0xf')](function(_0x328138){logger['info'](_0x74c6('0x10'),_0x5d446c,'request\x20sent');logger[_0x74c6('0x11')](_0x74c6('0x12'),_0x5d446c,_0x74c6('0x13'),JSON['stringify'](_0x328138));if(_0x328138[_0x74c6('0x14')]){if(_0x328138['error'][_0x74c6('0x15')]===0x1f4){logger[_0x74c6('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d446c,_0x328138[_0x74c6('0x14')][_0x74c6('0x16')]);return _0x36a3df(_0x328138[_0x74c6('0x14')]['message']);}logger[_0x74c6('0x14')](_0x74c6('0x10'),_0x5d446c,_0x328138[_0x74c6('0x14')]['message']);return _0x3973d8(_0x328138[_0x74c6('0x14')]['message']);}else{logger[_0x74c6('0x17')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d446c,_0x74c6('0x13'));_0x3973d8(_0x328138[_0x74c6('0x18')][_0x74c6('0x16')]);}})[_0x74c6('0x19')](function(_0x421fb4){logger['error'](_0x74c6('0x10'),_0x5d446c,_0x421fb4);_0x36a3df(_0x421fb4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4bb729a..4ff7aa7 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 _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x28c752,_0x238454){var _0x30cd6c=function(_0x4c71be){while(--_0x4c71be){_0x28c752['push'](_0x28c752['shift']());}};_0x30cd6c(++_0x238454);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x46dcaf,_0x57a5e8){_0x46dcaf=_0x46dcaf-0x0;var _0x2aeb55=_0x3eea[_0x46dcaf];return _0x2aeb55;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router; \ No newline at end of file +var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x5ced8b,_0x5f0335){var _0x535973=function(_0x44bf74){while(--_0x44bf74){_0x5ced8b['push'](_0x5ced8b['shift']());}};_0x535973(++_0x5f0335);}(_0xeec6,0x1c2));var _0x6eec=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xeec6[_0x13fd59];return _0x2e6ce7;};'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'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a08e5a6..058fcda 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 _0x441a=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x56a715,_0x1ba2c3){var _0x12e87b=function(_0x46c10c){while(--_0x46c10c){_0x56a715['push'](_0x56a715['shift']());}};_0x12e87b(++_0x1ba2c3);}(_0x441a,0x1d5));var _0xa441=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x441a[_0x365be9];return _0x185c12;};'use strict';var Sequelize=require(_0xa441('0x0'));module[_0xa441('0x1')]={'name':{'type':Sequelize[_0xa441('0x2')],'unique':_0xa441('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa441('0x2')]},'timeout':{'type':Sequelize[_0xa441('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa441('0x5')](_0xa441('0x6'),_0xa441('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x1ee8=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x62c4dc,_0x2b3a85){var _0x23cc7c=function(_0x23a4be){while(--_0x23a4be){_0x62c4dc['push'](_0x62c4dc['shift']());}};_0x23cc7c(++_0x2b3a85);}(_0x1ee8,0xc8));var _0x81ee=function(_0x523cb4,_0x4b3851){_0x523cb4=_0x523cb4-0x0;var _0x53f3f3=_0x1ee8[_0x523cb4];return _0x53f3f3;};'use strict';var Sequelize=require(_0x81ee('0x0'));module[_0x81ee('0x1')]={'name':{'type':Sequelize[_0x81ee('0x2')],'unique':_0x81ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81ee('0x2')]},'timeout':{'type':Sequelize[_0x81ee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81ee('0x5')](_0x81ee('0x6'),_0x81ee('0x7'),_0x81ee('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0088247..4c57e1d 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 _0xba1a=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','include','findAll','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','User','agent','updatedAt','createdAt','format','SIP','Team','getTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','offset','undefined','limit','count','set','Content-Range','json','reject','destroy','ChatQueues','UserProfileResource','status','end','stack','name','send','index','map','ChatQueue','rawAttributes','key'];(function(_0x263e92,_0x5a7a94){var _0x399bfe=function(_0x486d6b){while(--_0x486d6b){_0x263e92['push'](_0x263e92['shift']());}};_0x399bfe(++_0x5a7a94);}(_0xba1a,0x193));var _0xaba1=function(_0x138543,_0x29304a){_0x138543=_0x138543-0x0;var _0xf32c85=_0xba1a[_0x138543];return _0xf32c85;};'use strict';var emlformat=require(_0xaba1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaba1('0x1'));var rp=require(_0xaba1('0x2'));var moment=require(_0xaba1('0x3'));var BPromise=require(_0xaba1('0x4'));var Mustache=require(_0xaba1('0x5'));var util=require(_0xaba1('0x6'));var path=require(_0xaba1('0x7'));var sox=require(_0xaba1('0x8'));var csv=require(_0xaba1('0x9'));var ejs=require(_0xaba1('0xa'));var fs=require('fs');var fs_extra=require(_0xaba1('0xb'));var _=require(_0xaba1('0xc'));var squel=require(_0xaba1('0xd'));var crypto=require(_0xaba1('0xe'));var jsforce=require(_0xaba1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaba1('0x10'));var Redis=require(_0xaba1('0x11'));var authService=require(_0xaba1('0x12'));var qs=require(_0xaba1('0x13'));var as=require(_0xaba1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaba1('0x15'))('api');var utils=require(_0xaba1('0x16'));var config=require(_0xaba1('0x17'));var licenseUtil=require(_0xaba1('0x18'));var db=require(_0xaba1('0x19'))['db'];config[_0xaba1('0x1a')]=_[_0xaba1('0x1b')](config[_0xaba1('0x1a')],{'host':_0xaba1('0x1c'),'port':0x18eb});var socket=require(_0xaba1('0x1d'))(new Redis(config['redis']));require(_0xaba1('0x1e'))[_0xaba1('0x1f')](socket);var jayson=require(_0xaba1('0x20'));var client=jayson[_0xaba1('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x808150,_0x3b3650,_0x1d53d1,_0x4e311a){return new BPromise(function(_0x1f9eca,_0xbdde2e){var _0x180386=_0x4e311a||client;return _0x180386[_0xaba1('0x22')](_0x808150,_0x1d53d1)[_0xaba1('0x23')](function(_0x23796d){logger['info'](_0xaba1('0x24'),_0x3b3650,_0xaba1('0x25'));logger['debug'](_0xaba1('0x26'),_0x3b3650,_0xaba1('0x25'),JSON[_0xaba1('0x27')](_0x23796d));if(_0x23796d[_0xaba1('0x28')]){if(_0x23796d[_0xaba1('0x28')][_0xaba1('0x29')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3b3650,_0x23796d['error']['message']);return _0xbdde2e(_0x23796d[_0xaba1('0x28')][_0xaba1('0x2a')]);}logger[_0xaba1('0x28')](_0xaba1('0x24'),_0x3b3650,_0x23796d[_0xaba1('0x28')][_0xaba1('0x2a')]);return _0x1f9eca(_0x23796d[_0xaba1('0x28')]['message']);}else{logger[_0xaba1('0x2b')]('ChatQueue,\x20%s,\x20%s',_0x3b3650,_0xaba1('0x25'));_0x1f9eca(_0x23796d[_0xaba1('0x2c')][_0xaba1('0x2a')]);}})[_0xaba1('0x2d')](function(_0x5d5f60){logger[_0xaba1('0x28')](_0xaba1('0x24'),_0x3b3650,_0x5d5f60);_0xbdde2e(_0x5d5f60);});});}function respondWithStatusCode(_0x11a868,_0x27b512){_0x27b512=_0x27b512||0xcc;return function(_0x30a2de){if(_0x30a2de){return _0x11a868[_0xaba1('0x2e')](_0x27b512);}return _0x11a868['status'](_0x27b512)['end']();};}function respondWithResult(_0x41dca5,_0x4afbc8){_0x4afbc8=_0x4afbc8||0xc8;return function(_0x325da0){if(_0x325da0){return _0x41dca5['status'](_0x4afbc8)['json'](_0x325da0);}};}function respondWithFilteredResult(_0x554b35,_0x73485b){return function(_0xb43cd4){if(_0xb43cd4){var _0x2ccca0=typeof _0x73485b[_0xaba1('0x2f')]===_0xaba1('0x30')&&typeof _0x73485b[_0xaba1('0x31')]==='undefined';var _0x48d218=_0xb43cd4[_0xaba1('0x32')];var _0x5c9c34=_0x2ccca0?0x0:_0x73485b[_0xaba1('0x2f')];var _0x4ca1ad=_0x2ccca0?_0xb43cd4[_0xaba1('0x32')]:_0x73485b['offset']+_0x73485b[_0xaba1('0x31')];var _0x20e6de;if(_0x4ca1ad>=_0x48d218){_0x4ca1ad=_0x48d218;_0x20e6de=0xc8;}else{_0x20e6de=0xce;}_0x554b35['status'](_0x20e6de);return _0x554b35[_0xaba1('0x33')](_0xaba1('0x34'),_0x5c9c34+'-'+_0x4ca1ad+'/'+_0x48d218)[_0xaba1('0x35')](_0xb43cd4);}return null;};}function patchUpdates(_0x2ad044){return function(_0x271abe){try{jsonpatch['apply'](_0x271abe,_0x2ad044,!![]);}catch(_0x35e850){return BPromise[_0xaba1('0x36')](_0x35e850);}return _0x271abe['save']();};}function saveUpdates(_0xfc4f17,_0x5d615f){return function(_0x59fbe1){if(_0x59fbe1){return _0x59fbe1['update'](_0xfc4f17)[_0xaba1('0x23')](function(_0x2139e9){return _0x2139e9;});}return null;};}function removeEntity(_0xfdc985,_0x2a05dc){return function(_0x553c8e){if(_0x553c8e){return _0x553c8e[_0xaba1('0x37')]()['then'](function(){var _0x21e436=_0x553c8e['get']({'plain':!![]});var _0x554de9=_0xaba1('0x38');return db[_0xaba1('0x39')][_0xaba1('0x37')]({'where':{'type':_0x554de9,'resourceId':_0x21e436['id']}})[_0xaba1('0x23')](function(){return _0x553c8e;});})[_0xaba1('0x23')](function(){_0xfdc985[_0xaba1('0x3a')](0xcc)[_0xaba1('0x3b')]();});}};}function handleEntityNotFound(_0xbe02df,_0x5cef0c){return function(_0x2c310c){if(!_0x2c310c){_0xbe02df[_0xaba1('0x2e')](0x194);}return _0x2c310c;};}function handleError(_0x2ae4bf,_0x41d939){_0x41d939=_0x41d939||0x1f4;return function(_0x1e09e4){logger[_0xaba1('0x28')](_0x1e09e4[_0xaba1('0x3c')]);if(_0x1e09e4['name']){delete _0x1e09e4[_0xaba1('0x3d')];}_0x2ae4bf[_0xaba1('0x3a')](_0x41d939)[_0xaba1('0x3e')](_0x1e09e4);};}exports[_0xaba1('0x3f')]=function(_0x489f57,_0x29705b){var _0x394a18={},_0xcc61ce={},_0x1783ba={'count':0x0,'rows':[]};var _0x547c99=_[_0xaba1('0x40')](db[_0xaba1('0x41')][_0xaba1('0x42')],function(_0xb2623a){return{'name':_0xb2623a['fieldName'],'type':_0xb2623a['type'][_0xaba1('0x43')]};});_0xcc61ce['model']=_[_0xaba1('0x40')](_0x547c99,_0xaba1('0x3d'));_0xcc61ce[_0xaba1('0x44')]=_[_0xaba1('0x45')](_0x489f57[_0xaba1('0x44')]);_0xcc61ce[_0xaba1('0x46')]=_[_0xaba1('0x47')](_0xcc61ce[_0xaba1('0x48')],_0xcc61ce[_0xaba1('0x44')]);_0x394a18['attributes']=_[_0xaba1('0x47')](_0xcc61ce['model'],qs[_0xaba1('0x49')](_0x489f57[_0xaba1('0x44')][_0xaba1('0x49')]));_0x394a18[_0xaba1('0x4a')]=_0x394a18[_0xaba1('0x4a')][_0xaba1('0x4b')]?_0x394a18[_0xaba1('0x4a')]:_0xcc61ce['model'];if(!_0x489f57[_0xaba1('0x44')][_0xaba1('0x4c')](_0xaba1('0x4d'))){_0x394a18[_0xaba1('0x31')]=qs[_0xaba1('0x31')](_0x489f57[_0xaba1('0x44')][_0xaba1('0x31')]);_0x394a18[_0xaba1('0x2f')]=qs['offset'](_0x489f57[_0xaba1('0x44')][_0xaba1('0x2f')]);}_0x394a18[_0xaba1('0x4e')]=qs['sort'](_0x489f57['query'][_0xaba1('0x4f')]);_0x394a18['where']=qs[_0xaba1('0x46')](_[_0xaba1('0x50')](_0x489f57[_0xaba1('0x44')],_0xcc61ce['filters']),_0x547c99);if(_0x489f57['query'][_0xaba1('0x51')]){_0x394a18[_0xaba1('0x52')]=_[_0xaba1('0x53')](_0x394a18[_0xaba1('0x52')],{'$or':_['map'](_0x547c99,function(_0x588462){if(_0x588462[_0xaba1('0x54')]!=='VIRTUAL'){var _0x2b9e5c={};_0x2b9e5c[_0x588462['name']]={'$like':'%'+_0x489f57[_0xaba1('0x44')][_0xaba1('0x51')]+'%'};return _0x2b9e5c;}})});}_0x394a18=_['merge']({},_0x394a18,_0x489f57[_0xaba1('0x55')]);var _0x1b1701={'where':_0x394a18[_0xaba1('0x52')]};return db['ChatQueue'][_0xaba1('0x32')](_0x1b1701)[_0xaba1('0x23')](function(_0x5b8d2d){_0x1783ba[_0xaba1('0x32')]=_0x5b8d2d;if(_0x489f57[_0xaba1('0x44')]['includeAll']){_0x394a18[_0xaba1('0x56')]=[{'all':!![]}];}return db[_0xaba1('0x41')][_0xaba1('0x57')](_0x394a18);})['then'](function(_0x658634){_0x1783ba[_0xaba1('0x58')]=_0x658634;return _0x1783ba;})[_0xaba1('0x23')](respondWithFilteredResult(_0x29705b,_0x394a18))[_0xaba1('0x2d')](handleError(_0x29705b,null));};exports[_0xaba1('0x59')]=function(_0xb4acfe,_0x4aec51){var _0x55c4da={'raw':!![],'where':{'id':_0xb4acfe[_0xaba1('0x5a')]['id']}},_0x5cf9d9={};_0x5cf9d9[_0xaba1('0x48')]=_[_0xaba1('0x45')](db[_0xaba1('0x41')][_0xaba1('0x42')]);_0x5cf9d9[_0xaba1('0x44')]=_[_0xaba1('0x45')](_0xb4acfe[_0xaba1('0x44')]);_0x5cf9d9[_0xaba1('0x46')]=_[_0xaba1('0x47')](_0x5cf9d9[_0xaba1('0x48')],_0x5cf9d9['query']);_0x55c4da[_0xaba1('0x4a')]=_[_0xaba1('0x47')](_0x5cf9d9['model'],qs['fields'](_0xb4acfe[_0xaba1('0x44')][_0xaba1('0x49')]));_0x55c4da[_0xaba1('0x4a')]=_0x55c4da['attributes'][_0xaba1('0x4b')]?_0x55c4da['attributes']:_0x5cf9d9[_0xaba1('0x48')];if(_0xb4acfe[_0xaba1('0x44')][_0xaba1('0x5b')]){_0x55c4da[_0xaba1('0x56')]=[{'all':!![]}];}_0x55c4da=_[_0xaba1('0x53')]({},_0x55c4da,_0xb4acfe['options']);return db[_0xaba1('0x41')][_0xaba1('0x5c')](_0x55c4da)[_0xaba1('0x23')](handleEntityNotFound(_0x4aec51,null))[_0xaba1('0x23')](respondWithResult(_0x4aec51,null))['catch'](handleError(_0x4aec51,null));};exports[_0xaba1('0x5d')]=function(_0x41cde3,_0x5943fc){return db[_0xaba1('0x41')][_0xaba1('0x5d')](_0x41cde3[_0xaba1('0x5e')],{})[_0xaba1('0x23')](function(_0x16a6f6){var _0xb4b5ae=_0x41cde3[_0xaba1('0x5f')]['get']({'plain':!![]});if(!_0xb4b5ae)throw new Error(_0xaba1('0x60'));if(_0xb4b5ae[_0xaba1('0x61')]===_0xaba1('0x5f')){var _0x473b4c=_0x16a6f6[_0xaba1('0x62')]({'plain':!![]});var _0x3eb7a8=_0xaba1('0x38');return db[_0xaba1('0x63')][_0xaba1('0x5c')]({'where':{'name':_0x3eb7a8,'userProfileId':_0xb4b5ae[_0xaba1('0x64')]},'raw':!![]})['then'](function(_0x72829f){if(_0x72829f&&_0x72829f[_0xaba1('0x65')]===0x0){return db[_0xaba1('0x39')][_0xaba1('0x5d')]({'name':_0x473b4c[_0xaba1('0x3d')],'resourceId':_0x473b4c['id'],'type':_0x72829f[_0xaba1('0x3d')],'sectionId':_0x72829f['id']},{})[_0xaba1('0x23')](function(){return _0x16a6f6;});}else{return _0x16a6f6;}})[_0xaba1('0x2d')](function(_0x2339eb){logger['error'](_0xaba1('0x66'),_0x2339eb);throw _0x2339eb;});}return _0x16a6f6;})[_0xaba1('0x23')](respondWithResult(_0x5943fc,0xc9))[_0xaba1('0x2d')](handleError(_0x5943fc,null));};exports[_0xaba1('0x67')]=function(_0x1ce00e,_0x113d07){if(_0x1ce00e[_0xaba1('0x5e')]['id']){delete _0x1ce00e[_0xaba1('0x5e')]['id'];}return db[_0xaba1('0x41')][_0xaba1('0x5c')]({'where':{'id':_0x1ce00e[_0xaba1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x113d07,null))[_0xaba1('0x23')](saveUpdates(_0x1ce00e['body'],null))[_0xaba1('0x23')](respondWithResult(_0x113d07,null))[_0xaba1('0x2d')](handleError(_0x113d07,null));};exports[_0xaba1('0x37')]=function(_0x12ef96,_0xa1d802){return db[_0xaba1('0x41')]['find']({'where':{'id':_0x12ef96[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](handleEntityNotFound(_0xa1d802,null))[_0xaba1('0x23')](removeEntity(_0xa1d802,null))[_0xaba1('0x2d')](handleError(_0xa1d802,null));};exports[_0xaba1('0x68')]=function(_0xad19a4,_0x4486b2){return db[_0xaba1('0x41')][_0xaba1('0x68')]()[_0xaba1('0x23')](respondWithResult(_0x4486b2,null))[_0xaba1('0x2d')](handleError(_0x4486b2,null));};exports['getMembers']=function(_0x44e778,_0x2d2199,_0x166a04){var _0x4b76e6={'raw':!![],'where':{}},_0x7beeba={},_0x279aa3;return db[_0xaba1('0x41')][_0xaba1('0x69')]({'where':{'id':_0x44e778[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](handleEntityNotFound(_0x2d2199,null))[_0xaba1('0x23')](function(_0x24b2f1){if(_0x24b2f1){_0x279aa3=_0x24b2f1['get']({'plain':!![]});_0x7beeba[_0xaba1('0x48')]=_[_0xaba1('0x45')](db['UserChatQueue'][_0xaba1('0x42')]);_0x7beeba[_0xaba1('0x44')]=_['keys'](_0x44e778[_0xaba1('0x44')]);_0x7beeba[_0xaba1('0x46')]=_[_0xaba1('0x47')](_0x7beeba[_0xaba1('0x48')],_0x7beeba[_0xaba1('0x44')]);_0x4b76e6[_0xaba1('0x4a')]=_[_0xaba1('0x47')](_0x7beeba[_0xaba1('0x48')],qs['fields'](_0x44e778[_0xaba1('0x44')]['fields']));_0x4b76e6[_0xaba1('0x4a')]=_0x4b76e6[_0xaba1('0x4a')]['length']?_0x4b76e6[_0xaba1('0x4a')]:_0x7beeba[_0xaba1('0x48')];if(!_0x44e778[_0xaba1('0x44')][_0xaba1('0x4c')](_0xaba1('0x4d'))){_0x4b76e6[_0xaba1('0x31')]=qs[_0xaba1('0x31')](_0x44e778[_0xaba1('0x44')][_0xaba1('0x31')]);_0x4b76e6[_0xaba1('0x2f')]=qs['offset'](_0x44e778['query'][_0xaba1('0x2f')]);}_0x4b76e6['order']=qs['sort'](_0x44e778[_0xaba1('0x44')][_0xaba1('0x4f')]);_0x4b76e6['where']=qs[_0xaba1('0x46')](_[_0xaba1('0x50')](_0x44e778[_0xaba1('0x44')],_0x7beeba[_0xaba1('0x46')]));_0x4b76e6[_0xaba1('0x52')]['ChatQueueId']=_0x24b2f1['id'];if(_0x44e778[_0xaba1('0x44')][_0xaba1('0x51')]){_0x4b76e6['where']=_[_0xaba1('0x53')](_0x4b76e6[_0xaba1('0x52')],{'$or':_[_0xaba1('0x40')](_0x4b76e6['attributes'],function(_0x1ad9a0){var _0x4c2738={};_0x4c2738[_0x1ad9a0]={'$like':'%'+_0x44e778[_0xaba1('0x44')][_0xaba1('0x51')]+'%'};return _0x4c2738;})});}_0x4b76e6=_[_0xaba1('0x53')]({},_0x4b76e6,_0x44e778[_0xaba1('0x55')]);return db[_0xaba1('0x6a')][_0xaba1('0x57')](_0x4b76e6);}})['then'](function(_0xf8c160){if(_0xf8c160){return db[_0xaba1('0x6b')]['findAndCountAll']({'where':{'id':_['map'](_0xf8c160,'UserId'),'role':_0xaba1('0x6c')},'attributes':['id',_0xaba1('0x3d'),'chatPause',_0xaba1('0x6d'),_0xaba1('0x6e')]});}})[_0xaba1('0x23')](function(_0x7513f2){if(_0x7513f2){return{'count':_0x7513f2[_0xaba1('0x32')],'rows':_[_0xaba1('0x40')](_0x7513f2[_0xaba1('0x58')],function(_0x4352f9){return{'membername':_0x4352f9[_0xaba1('0x3d')],'UserId':_0x4352f9['id'],'queue_name':_0x279aa3[_0xaba1('0x3d')],'ChatQueueId':_0x279aa3['id'],'interface':util[_0xaba1('0x6f')]('%s/%s',_0xaba1('0x70'),_0x4352f9[_0xaba1('0x3d')]),'penalty':0x0,'paused':_0x4352f9['chatPause'],'createdAt':_0x4352f9[_0xaba1('0x6e')],'updatedAt':_0x4352f9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xaba1('0x23')](respondWithFilteredResult(_0x2d2199,_0x4b76e6))['catch'](handleError(_0x2d2199,null));};exports['getTeams']=function(_0x2a50ef,_0x277e7f,_0x4042e3){var _0x1b3d42={};var _0x3c6010={};var _0x2f38ec;var _0xbc3534;return db[_0xaba1('0x41')][_0xaba1('0x69')]({'where':{'id':_0x2a50ef[_0xaba1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x277e7f,null))[_0xaba1('0x23')](function(_0x260e8d){if(_0x260e8d){_0x2f38ec=_0x260e8d;_0x3c6010['model']=_['keys'](db[_0xaba1('0x71')][_0xaba1('0x42')]);_0x3c6010[_0xaba1('0x44')]=_[_0xaba1('0x45')](_0x2a50ef['query']);_0x3c6010[_0xaba1('0x46')]=_[_0xaba1('0x47')](_0x3c6010['model'],_0x3c6010[_0xaba1('0x44')]);_0x1b3d42[_0xaba1('0x4a')]=_['intersection'](_0x3c6010[_0xaba1('0x48')],qs[_0xaba1('0x49')](_0x2a50ef[_0xaba1('0x44')][_0xaba1('0x49')]));_0x1b3d42['attributes']=_0x1b3d42[_0xaba1('0x4a')][_0xaba1('0x4b')]?_0x1b3d42[_0xaba1('0x4a')]:_0x3c6010[_0xaba1('0x48')];_0x1b3d42[_0xaba1('0x4e')]=qs[_0xaba1('0x4f')](_0x2a50ef[_0xaba1('0x44')][_0xaba1('0x4f')]);_0x1b3d42[_0xaba1('0x52')]=qs[_0xaba1('0x46')](_[_0xaba1('0x50')](_0x2a50ef[_0xaba1('0x44')],_0x3c6010['filters']));if(_0x2a50ef[_0xaba1('0x44')][_0xaba1('0x51')]){_0x1b3d42[_0xaba1('0x52')]=_[_0xaba1('0x53')](_0x1b3d42[_0xaba1('0x52')],{'$or':_[_0xaba1('0x40')](_0x1b3d42[_0xaba1('0x4a')],function(_0x50a326){var _0x5023ea={};_0x5023ea[_0x50a326]={'$like':'%'+_0x2a50ef[_0xaba1('0x44')]['filter']+'%'};return _0x5023ea;})});}_0x1b3d42=_[_0xaba1('0x53')]({},_0x1b3d42,_0x2a50ef[_0xaba1('0x55')]);return _0x2f38ec[_0xaba1('0x72')](_0x1b3d42);}})[_0xaba1('0x23')](function(_0x1d9581){if(_0x1d9581){_0xbc3534=_0x1d9581[_0xaba1('0x4b')];if(!_0x2a50ef[_0xaba1('0x44')][_0xaba1('0x4c')](_0xaba1('0x4d'))){_0x1b3d42[_0xaba1('0x31')]=qs[_0xaba1('0x31')](_0x2a50ef['query'][_0xaba1('0x31')]);_0x1b3d42[_0xaba1('0x2f')]=qs['offset'](_0x2a50ef[_0xaba1('0x44')][_0xaba1('0x2f')]);}return _0x2f38ec['getTeams'](_0x1b3d42);}})['then'](function(_0x5d2da9){if(_0x5d2da9){return _0x5d2da9?{'count':_0xbc3534,'rows':_0x5d2da9}:null;}})['then'](respondWithResult(_0x277e7f,null))[_0xaba1('0x2d')](handleError(_0x277e7f,null));};exports['addTeams']=function(_0x5c0089,_0xe93bd2,_0xf87687){var _0x4d52ac=_0x5c0089[_0xaba1('0x5e')][_0xaba1('0x73')];return db[_0xaba1('0x71')][_0xaba1('0x57')]({'where':{'id':_0x4d52ac},'attributes':['id'],'include':[{'model':db[_0xaba1('0x6b')],'as':_0xaba1('0x74'),'attributes':['id',_0xaba1('0x3d'),_0xaba1('0x75'),_0xaba1('0x76'),_0xaba1('0x77')],'raw':!![]}]})[_0xaba1('0x23')](function(_0x4fc246){if(_0x4fc246){var _0x330828=_['flatMap'](_0x4fc246,function(_0x40b6f0){var _0x4a809e=_0x40b6f0[_0xaba1('0x62')]({'plain':!![]});return _0x4a809e[_0xaba1('0x74')];});return db[_0xaba1('0x41')][_0xaba1('0x5c')]({'where':{'id':_0x5c0089[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](function(_0x3cac25){return db[_0xaba1('0x78')][_0xaba1('0x79')](function(_0x405439){return _0x3cac25[_0xaba1('0x7a')](_0x4d52ac,{'transaction':_0x405439})[_0xaba1('0x23')](function(){return BPromise[_0xaba1('0x7b')](_0x330828,function(_0x2c8693){return db[_0xaba1('0x6a')][_0xaba1('0x7c')]({'where':{'UserId':_0x2c8693['id'],'ChatQueueId':_0x5c0089[_0xaba1('0x5a')]['id']},'transaction':_0x405439});});})[_0xaba1('0x23')](function(){_0x330828[_0xaba1('0x7d')](function(_0x14d372){socket[_0xaba1('0x7e')](_0xaba1('0x7f'),{'UserId':_0x14d372['id'],'ChatQueueId':_0x3cac25['id']});});});});});}})[_0xaba1('0x23')](respondWithStatusCode(_0xe93bd2,null))[_0xaba1('0x2d')](handleError(_0xe93bd2,null));};exports[_0xaba1('0x80')]=function(_0x4a395c,_0x3fa053,_0x4a3dd9){return db[_0xaba1('0x71')][_0xaba1('0x57')]({'where':{'id':_0x4a395c[_0xaba1('0x44')][_0xaba1('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaba1('0x74'),'attributes':['id'],'raw':!![]}]})[_0xaba1('0x23')](handleEntityNotFound(_0x3fa053,null))['then'](function(_0x1970d3){var _0x5d0951=_[_0xaba1('0x40')](_0x1970d3,'id');var _0x218d87=[];var _0x32b1e3=[];var _0x59d52c=squel[_0xaba1('0x81')]();_0x59d52c[_0xaba1('0x82')](_0xaba1('0x83'))[_0xaba1('0x84')](_0xaba1('0x85'),'tq')[_0xaba1('0x86')](_0xaba1('0x87'),'ut',_0xaba1('0x88'))[_0xaba1('0x52')](_0xaba1('0x89'),_0x4a395c[_0xaba1('0x5a')]['id']);for(var _0x3dc80b=0x0;_0x3dc80b<_0x1970d3['length'];_0x3dc80b+=0x1){let _0x1ee692=_0x1970d3[_0x3dc80b];for(var _0x3df737=0x0;_0x3df737<_0x1ee692['Agents'][_0xaba1('0x4b')];_0x3df737+=0x1){let _0x44c9f6=_0x1ee692[_0xaba1('0x74')][_0x3df737];var _0x35b489=_0x59d52c[_0xaba1('0x8a')]();_0x35b489[_0xaba1('0x52')](_0xaba1('0x8b'),_0x44c9f6['id']);_0x32b1e3[_0xaba1('0x8c')](db[_0xaba1('0x78')]['query'](_0x35b489['toString'](),{'type':db['sequelize'][_0xaba1('0x8d')][_0xaba1('0x8e')]})[_0xaba1('0x23')](function(_0x34d9c1){if(_0x34d9c1[_0xaba1('0x4b')]===0x1){return _0x44c9f6['id'];}else{var _0x1499f2=_[_0xaba1('0x8f')](_[_0xaba1('0x40')](_0x34d9c1,_0xaba1('0x90')),function(_0x56b84b){return _[_0xaba1('0x91')](_0x5d0951,_0x56b84b);});if(_0x1499f2){return _0x44c9f6['id'];}}}));}}return BPromise[_0xaba1('0x92')](_0x32b1e3)[_0xaba1('0x23')](function(_0x5c2be6){_0x218d87=_(_0x218d87)[_0xaba1('0x93')](_0x5c2be6)[_0xaba1('0x94')]()['value']();return db[_0xaba1('0x41')][_0xaba1('0x5c')]({'where':{'id':_0x4a395c[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](function(_0x5e07f7){return db[_0xaba1('0x78')][_0xaba1('0x79')](function(_0x42841d){return _0x5e07f7[_0xaba1('0x80')](_0x4a395c['query'][_0xaba1('0x73')],{'transaction':_0x42841d})[_0xaba1('0x23')](function(){if(!_[_0xaba1('0x95')](_0x218d87)){return _0x5e07f7[_0xaba1('0x96')](_0x218d87,{'transaction':_0x42841d});}})[_0xaba1('0x23')](function(){_0x218d87[_0xaba1('0x7d')](function(_0xa994c){socket[_0xaba1('0x7e')](_0xaba1('0x97'),{'UserId':_0xa994c,'ChatQueueId':_0x5e07f7['id']});});});});});});})[_0xaba1('0x23')](respondWithStatusCode(_0x3fa053,null))[_0xaba1('0x2d')](handleError(_0x3fa053,null));};exports[_0xaba1('0x98')]=function(_0x1cbb34,_0x1d7c81,_0x2e0174){return db[_0xaba1('0x41')][_0xaba1('0x5c')]({'where':{'id':_0x1cbb34['params']['id']}})['then'](handleEntityNotFound(_0x1d7c81,null))['then'](function(_0x5146c3){if(_0x5146c3){return _0x5146c3[_0xaba1('0x98')](_0x1cbb34[_0xaba1('0x5e')][_0xaba1('0x73')],_[_0xaba1('0x99')](_0x1cbb34['body'],[_0xaba1('0x73'),'id'])||{})[_0xaba1('0x9a')](function(_0x1c5e7c){for(var _0x5ec9bc=0x0;_0x5ec9bc<_0x1cbb34[_0xaba1('0x5e')]['ids'][_0xaba1('0x4b')];_0x5ec9bc+=0x1){socket[_0xaba1('0x7e')](_0xaba1('0x7f'),{'UserId':Number(_0x1cbb34[_0xaba1('0x5e')][_0xaba1('0x73')][_0x5ec9bc]),'ChatQueueId':Number(_0x1cbb34['params']['id'])});}return _0x1c5e7c;});}})[_0xaba1('0x23')](respondWithResult(_0x1d7c81,null))[_0xaba1('0x2d')](handleError(_0x1d7c81,null));};exports[_0xaba1('0x96')]=function(_0x177fa7,_0x5b0bdd,_0x2653db){return db[_0xaba1('0x41')][_0xaba1('0x5c')]({'where':{'id':_0x177fa7[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](handleEntityNotFound(_0x5b0bdd,null))[_0xaba1('0x23')](function(_0x55bb25){if(_0x55bb25){return _0x55bb25[_0xaba1('0x96')](_0x177fa7['query'][_0xaba1('0x73')])[_0xaba1('0x23')](function(){if(_[_0xaba1('0x9b')](_0x177fa7[_0xaba1('0x44')][_0xaba1('0x73')])){for(var _0x428078=0x0;_0x428078<_0x177fa7[_0xaba1('0x44')][_0xaba1('0x73')][_0xaba1('0x4b')];_0x428078+=0x1){socket[_0xaba1('0x7e')](_0xaba1('0x97'),{'UserId':Number(_0x177fa7['query'][_0xaba1('0x73')][_0x428078]),'ChatQueueId':Number(_0x177fa7[_0xaba1('0x5a')]['id'])});}}else{socket[_0xaba1('0x7e')](_0xaba1('0x97'),{'UserId':Number(_0x177fa7[_0xaba1('0x44')][_0xaba1('0x73')]),'ChatQueueId':Number(_0x177fa7[_0xaba1('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b0bdd,null))[_0xaba1('0x2d')](handleError(_0x5b0bdd,null));};exports['getAgents']=function(_0xd03f7,_0x577e57,_0x44b858){var _0x3181fb={};var _0x53d802={};var _0x55116c;var _0x3a97ef;return db[_0xaba1('0x41')]['findOne']({'where':{'id':_0xd03f7[_0xaba1('0x5a')]['id']}})[_0xaba1('0x23')](handleEntityNotFound(_0x577e57,null))[_0xaba1('0x23')](function(_0x8b8b20){if(_0x8b8b20){_0x55116c=_0x8b8b20;_0x53d802[_0xaba1('0x48')]=_[_0xaba1('0x45')](db[_0xaba1('0x6b')][_0xaba1('0x42')]);_0x53d802[_0xaba1('0x44')]=_[_0xaba1('0x45')](_0xd03f7[_0xaba1('0x44')]);_0x53d802[_0xaba1('0x46')]=_[_0xaba1('0x47')](_0x53d802[_0xaba1('0x48')],_0x53d802[_0xaba1('0x44')]);_0x3181fb['attributes']=_[_0xaba1('0x47')](_0x53d802[_0xaba1('0x48')],qs[_0xaba1('0x49')](_0xd03f7[_0xaba1('0x44')]['fields']));_0x3181fb[_0xaba1('0x4a')]=_0x3181fb[_0xaba1('0x4a')]['length']?_0x3181fb[_0xaba1('0x4a')]:_0x53d802[_0xaba1('0x48')];_0x3181fb['order']=qs[_0xaba1('0x4f')](_0xd03f7[_0xaba1('0x44')][_0xaba1('0x4f')]);_0x3181fb[_0xaba1('0x52')]=qs[_0xaba1('0x46')](_['pick'](_0xd03f7[_0xaba1('0x44')],_0x53d802[_0xaba1('0x46')]));if(_0xd03f7[_0xaba1('0x44')][_0xaba1('0x51')]){_0x3181fb[_0xaba1('0x52')]=_['merge'](_0x3181fb[_0xaba1('0x52')],{'$or':_[_0xaba1('0x40')](_0x3181fb['attributes'],function(_0x2c933a){var _0x2c2365={};_0x2c2365[_0x2c933a]={'$like':'%'+_0xd03f7[_0xaba1('0x44')][_0xaba1('0x51')]+'%'};return _0x2c2365;})});}_0x3181fb=_['merge']({},_0x3181fb,_0xd03f7[_0xaba1('0x55')]);return _0x55116c['getAgents'](_0x3181fb);}})[_0xaba1('0x23')](function(_0x12f711){if(_0x12f711){_0x3a97ef=_0x12f711[_0xaba1('0x4b')];if(!_0xd03f7['query'][_0xaba1('0x4c')](_0xaba1('0x4d'))){_0x3181fb['limit']=qs[_0xaba1('0x31')](_0xd03f7[_0xaba1('0x44')]['limit']);_0x3181fb['offset']=qs[_0xaba1('0x2f')](_0xd03f7[_0xaba1('0x44')]['offset']);}return _0x55116c[_0xaba1('0x9c')](_0x3181fb);}})[_0xaba1('0x23')](function(_0x3943c5){if(_0x3943c5){return _0x3943c5?{'count':_0x3a97ef,'rows':_0x3943c5}:null;}})[_0xaba1('0x23')](respondWithResult(_0x577e57,null))['catch'](handleError(_0x577e57,null));}; \ No newline at end of file +var _0xfdad=['agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','ids','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueue,\x20%s,\x20%s','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId'];(function(_0x276ea1,_0x3e3b44){var _0x67c56f=function(_0x49f9b8){while(--_0x49f9b8){_0x276ea1['push'](_0x276ea1['shift']());}};_0x67c56f(++_0x3e3b44);}(_0xfdad,0x164));var _0xdfda=function(_0x201428,_0x677f88){_0x201428=_0x201428-0x0;var _0x1d68a3=_0xfdad[_0x201428];return _0x1d68a3;};'use strict';var emlformat=require(_0xdfda('0x0'));var rimraf=require(_0xdfda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfda('0x2'));var rp=require(_0xdfda('0x3'));var moment=require('moment');var BPromise=require(_0xdfda('0x4'));var Mustache=require(_0xdfda('0x5'));var util=require(_0xdfda('0x6'));var path=require('path');var sox=require(_0xdfda('0x7'));var csv=require(_0xdfda('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfda('0x9'));var _=require(_0xdfda('0xa'));var squel=require(_0xdfda('0xb'));var crypto=require(_0xdfda('0xc'));var jsforce=require(_0xdfda('0xd'));var deskjs=require(_0xdfda('0xe'));var toCsv=require(_0xdfda('0x8'));var querystring=require(_0xdfda('0xf'));var Papa=require(_0xdfda('0x10'));var Redis=require(_0xdfda('0x11'));var authService=require(_0xdfda('0x12'));var qs=require(_0xdfda('0x13'));var as=require(_0xdfda('0x14'));var hardwareService=require(_0xdfda('0x15'));var logger=require(_0xdfda('0x16'))(_0xdfda('0x17'));var utils=require('../../config/utils');var config=require(_0xdfda('0x18'));var licenseUtil=require(_0xdfda('0x19'));var db=require(_0xdfda('0x1a'))['db'];config[_0xdfda('0x1b')]=_[_0xdfda('0x1c')](config['redis'],{'host':_0xdfda('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfda('0x1e'))[_0xdfda('0x1f')](socket);var jayson=require(_0xdfda('0x20'));var client=jayson['client'][_0xdfda('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56020a,_0x4064f2,_0xf250d0,_0x19d124){return new BPromise(function(_0x3fe8ff,_0x55b626){var _0x5baf98=_0x19d124||client;return _0x5baf98[_0xdfda('0x22')](_0x56020a,_0xf250d0)[_0xdfda('0x23')](function(_0xd3457f){logger[_0xdfda('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4064f2,_0xdfda('0x25'));logger[_0xdfda('0x26')](_0xdfda('0x27'),_0x4064f2,_0xdfda('0x25'),JSON['stringify'](_0xd3457f));if(_0xd3457f[_0xdfda('0x28')]){if(_0xd3457f[_0xdfda('0x28')][_0xdfda('0x29')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4064f2,_0xd3457f['error'][_0xdfda('0x2a')]);return _0x55b626(_0xd3457f['error'][_0xdfda('0x2a')]);}logger[_0xdfda('0x28')](_0xdfda('0x2b'),_0x4064f2,_0xd3457f[_0xdfda('0x28')][_0xdfda('0x2a')]);return _0x3fe8ff(_0xd3457f['error'][_0xdfda('0x2a')]);}else{logger[_0xdfda('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4064f2,_0xdfda('0x25'));_0x3fe8ff(_0xd3457f['result']['message']);}})['catch'](function(_0xb2628c){logger[_0xdfda('0x28')](_0xdfda('0x2b'),_0x4064f2,_0xb2628c);_0x55b626(_0xb2628c);});});}function respondWithStatusCode(_0x483ce6,_0x23be54){_0x23be54=_0x23be54||0xcc;return function(_0x55b0e6){if(_0x55b0e6){return _0x483ce6[_0xdfda('0x2c')](_0x23be54);}return _0x483ce6[_0xdfda('0x2d')](_0x23be54)[_0xdfda('0x2e')]();};}function respondWithResult(_0x1d2ed0,_0x3f8534){_0x3f8534=_0x3f8534||0xc8;return function(_0xb4eac1){if(_0xb4eac1){return _0x1d2ed0[_0xdfda('0x2d')](_0x3f8534)[_0xdfda('0x2f')](_0xb4eac1);}};}function respondWithFilteredResult(_0x499438,_0x244799){return function(_0x57331a){if(_0x57331a){var _0x1e0f8f=typeof _0x244799['offset']===_0xdfda('0x30')&&typeof _0x244799[_0xdfda('0x31')]==='undefined';var _0x313228=_0x57331a[_0xdfda('0x32')];var _0x4351f6=_0x1e0f8f?0x0:_0x244799['offset'];var _0x29e8ac=_0x1e0f8f?_0x57331a[_0xdfda('0x32')]:_0x244799['offset']+_0x244799[_0xdfda('0x31')];var _0x5645a9;if(_0x29e8ac>=_0x313228){_0x29e8ac=_0x313228;_0x5645a9=0xc8;}else{_0x5645a9=0xce;}_0x499438[_0xdfda('0x2d')](_0x5645a9);return _0x499438[_0xdfda('0x33')](_0xdfda('0x34'),_0x4351f6+'-'+_0x29e8ac+'/'+_0x313228)[_0xdfda('0x2f')](_0x57331a);}return null;};}function patchUpdates(_0x19751a){return function(_0x1f244f){try{jsonpatch['apply'](_0x1f244f,_0x19751a,!![]);}catch(_0x1addf5){return BPromise['reject'](_0x1addf5);}return _0x1f244f['save']();};}function saveUpdates(_0x140aaa,_0x44a521){return function(_0x137031){if(_0x137031){return _0x137031['update'](_0x140aaa)['then'](function(_0x976db4){return _0x976db4;});}return null;};}function removeEntity(_0x5386ec,_0xcc78f1){return function(_0x378890){if(_0x378890){return _0x378890[_0xdfda('0x35')]()[_0xdfda('0x23')](function(){var _0x437618=_0x378890[_0xdfda('0x36')]({'plain':!![]});var _0x8b3916=_0xdfda('0x37');return db[_0xdfda('0x38')][_0xdfda('0x35')]({'where':{'type':_0x8b3916,'resourceId':_0x437618['id']}})['then'](function(){return _0x378890;});})[_0xdfda('0x23')](function(){_0x5386ec[_0xdfda('0x2d')](0xcc)[_0xdfda('0x2e')]();});}};}function handleEntityNotFound(_0x189523,_0x3012fa){return function(_0x463032){if(!_0x463032){_0x189523[_0xdfda('0x2c')](0x194);}return _0x463032;};}function handleError(_0x2a74c4,_0x4cb9db){_0x4cb9db=_0x4cb9db||0x1f4;return function(_0x55903c){logger[_0xdfda('0x28')](_0x55903c[_0xdfda('0x39')]);if(_0x55903c[_0xdfda('0x3a')]){delete _0x55903c[_0xdfda('0x3a')];}_0x2a74c4[_0xdfda('0x2d')](_0x4cb9db)[_0xdfda('0x3b')](_0x55903c);};}exports[_0xdfda('0x3c')]=function(_0x35ef0f,_0x112c08){var _0x445311={},_0x52dcbf={},_0x26717d={'count':0x0,'rows':[]};var _0x1bfa0a=_[_0xdfda('0x3d')](db[_0xdfda('0x3e')][_0xdfda('0x3f')],function(_0xf51df3){return{'name':_0xf51df3[_0xdfda('0x40')],'type':_0xf51df3[_0xdfda('0x41')][_0xdfda('0x42')]};});_0x52dcbf[_0xdfda('0x43')]=_[_0xdfda('0x3d')](_0x1bfa0a,_0xdfda('0x3a'));_0x52dcbf[_0xdfda('0x44')]=_['keys'](_0x35ef0f[_0xdfda('0x44')]);_0x52dcbf[_0xdfda('0x45')]=_[_0xdfda('0x46')](_0x52dcbf[_0xdfda('0x43')],_0x52dcbf[_0xdfda('0x44')]);_0x445311[_0xdfda('0x47')]=_['intersection'](_0x52dcbf[_0xdfda('0x43')],qs[_0xdfda('0x48')](_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x48')]));_0x445311[_0xdfda('0x47')]=_0x445311[_0xdfda('0x47')][_0xdfda('0x49')]?_0x445311[_0xdfda('0x47')]:_0x52dcbf[_0xdfda('0x43')];if(!_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x4a')](_0xdfda('0x4b'))){_0x445311['limit']=qs[_0xdfda('0x31')](_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x31')]);_0x445311[_0xdfda('0x4c')]=qs[_0xdfda('0x4c')](_0x35ef0f['query']['offset']);}_0x445311[_0xdfda('0x4d')]=qs[_0xdfda('0x4e')](_0x35ef0f['query']['sort']);_0x445311[_0xdfda('0x4f')]=qs[_0xdfda('0x45')](_[_0xdfda('0x50')](_0x35ef0f['query'],_0x52dcbf[_0xdfda('0x45')]),_0x1bfa0a);if(_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x51')]){_0x445311[_0xdfda('0x4f')]=_[_0xdfda('0x52')](_0x445311['where'],{'$or':_['map'](_0x1bfa0a,function(_0x2357a3){if(_0x2357a3[_0xdfda('0x41')]!==_0xdfda('0x53')){var _0x30d443={};_0x30d443[_0x2357a3[_0xdfda('0x3a')]]={'$like':'%'+_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x51')]+'%'};return _0x30d443;}})});}_0x445311=_['merge']({},_0x445311,_0x35ef0f[_0xdfda('0x54')]);var _0x5238db={'where':_0x445311[_0xdfda('0x4f')]};return db[_0xdfda('0x3e')][_0xdfda('0x32')](_0x5238db)[_0xdfda('0x23')](function(_0x8cb292){_0x26717d['count']=_0x8cb292;if(_0x35ef0f[_0xdfda('0x44')][_0xdfda('0x55')]){_0x445311[_0xdfda('0x56')]=[{'all':!![]}];}return db[_0xdfda('0x3e')]['findAll'](_0x445311);})[_0xdfda('0x23')](function(_0x2fb758){_0x26717d[_0xdfda('0x57')]=_0x2fb758;return _0x26717d;})['then'](respondWithFilteredResult(_0x112c08,_0x445311))[_0xdfda('0x58')](handleError(_0x112c08,null));};exports[_0xdfda('0x59')]=function(_0x5c2c87,_0x3f5c8a){var _0x8f837={'raw':!![],'where':{'id':_0x5c2c87[_0xdfda('0x5a')]['id']}},_0x302056={};_0x302056['model']=_[_0xdfda('0x5b')](db['ChatQueue']['rawAttributes']);_0x302056[_0xdfda('0x44')]=_[_0xdfda('0x5b')](_0x5c2c87[_0xdfda('0x44')]);_0x302056[_0xdfda('0x45')]=_[_0xdfda('0x46')](_0x302056[_0xdfda('0x43')],_0x302056['query']);_0x8f837['attributes']=_[_0xdfda('0x46')](_0x302056['model'],qs[_0xdfda('0x48')](_0x5c2c87['query'][_0xdfda('0x48')]));_0x8f837[_0xdfda('0x47')]=_0x8f837[_0xdfda('0x47')][_0xdfda('0x49')]?_0x8f837['attributes']:_0x302056[_0xdfda('0x43')];if(_0x5c2c87[_0xdfda('0x44')][_0xdfda('0x55')]){_0x8f837[_0xdfda('0x56')]=[{'all':!![]}];}_0x8f837=_[_0xdfda('0x52')]({},_0x8f837,_0x5c2c87['options']);return db[_0xdfda('0x3e')][_0xdfda('0x5c')](_0x8f837)['then'](handleEntityNotFound(_0x3f5c8a,null))[_0xdfda('0x23')](respondWithResult(_0x3f5c8a,null))['catch'](handleError(_0x3f5c8a,null));};exports[_0xdfda('0x5d')]=function(_0x5856df,_0x1c1caa){return db[_0xdfda('0x3e')][_0xdfda('0x5d')](_0x5856df[_0xdfda('0x5e')],{})[_0xdfda('0x23')](function(_0x12372d){var _0x4a0755=_0x5856df[_0xdfda('0x5f')][_0xdfda('0x36')]({'plain':!![]});if(!_0x4a0755)throw new Error(_0xdfda('0x60'));if(_0x4a0755['role']===_0xdfda('0x5f')){var _0xc4758b=_0x12372d[_0xdfda('0x36')]({'plain':!![]});var _0x5e9c60=_0xdfda('0x37');return db[_0xdfda('0x61')][_0xdfda('0x5c')]({'where':{'name':_0x5e9c60,'userProfileId':_0x4a0755[_0xdfda('0x62')]},'raw':!![]})[_0xdfda('0x23')](function(_0x2da80f){if(_0x2da80f&&_0x2da80f['autoAssociation']===0x0){return db['UserProfileResource'][_0xdfda('0x5d')]({'name':_0xc4758b['name'],'resourceId':_0xc4758b['id'],'type':_0x2da80f[_0xdfda('0x3a')],'sectionId':_0x2da80f['id']},{})['then'](function(){return _0x12372d;});}else{return _0x12372d;}})['catch'](function(_0x5de8d7){logger['error'](_0xdfda('0x63'),_0x5de8d7);throw _0x5de8d7;});}return _0x12372d;})[_0xdfda('0x23')](respondWithResult(_0x1c1caa,0xc9))['catch'](handleError(_0x1c1caa,null));};exports[_0xdfda('0x64')]=function(_0x5c4c8f,_0x51974c){if(_0x5c4c8f[_0xdfda('0x5e')]['id']){delete _0x5c4c8f[_0xdfda('0x5e')]['id'];}return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x5c4c8f[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x51974c,null))[_0xdfda('0x23')](saveUpdates(_0x5c4c8f[_0xdfda('0x5e')],null))['then'](respondWithResult(_0x51974c,null))[_0xdfda('0x58')](handleError(_0x51974c,null));};exports[_0xdfda('0x35')]=function(_0x5b7356,_0x5a56e3){return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x5b7356[_0xdfda('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5a56e3,null))[_0xdfda('0x23')](removeEntity(_0x5a56e3,null))[_0xdfda('0x58')](handleError(_0x5a56e3,null));};exports[_0xdfda('0x65')]=function(_0x44ef74,_0x409fa5){return db['ChatQueue'][_0xdfda('0x65')]()['then'](respondWithResult(_0x409fa5,null))[_0xdfda('0x58')](handleError(_0x409fa5,null));};exports[_0xdfda('0x66')]=function(_0x3a13ee,_0x57a686,_0x2c8924){var _0x141045={'raw':!![],'where':{}},_0x1b2d29={},_0x3fb84d;return db['ChatQueue'][_0xdfda('0x67')]({'where':{'id':_0x3a13ee[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x57a686,null))[_0xdfda('0x23')](function(_0x536692){if(_0x536692){_0x3fb84d=_0x536692[_0xdfda('0x36')]({'plain':!![]});_0x1b2d29[_0xdfda('0x43')]=_['keys'](db[_0xdfda('0x68')][_0xdfda('0x3f')]);_0x1b2d29[_0xdfda('0x44')]=_[_0xdfda('0x5b')](_0x3a13ee[_0xdfda('0x44')]);_0x1b2d29[_0xdfda('0x45')]=_[_0xdfda('0x46')](_0x1b2d29[_0xdfda('0x43')],_0x1b2d29[_0xdfda('0x44')]);_0x141045['attributes']=_[_0xdfda('0x46')](_0x1b2d29['model'],qs[_0xdfda('0x48')](_0x3a13ee[_0xdfda('0x44')]['fields']));_0x141045[_0xdfda('0x47')]=_0x141045[_0xdfda('0x47')][_0xdfda('0x49')]?_0x141045[_0xdfda('0x47')]:_0x1b2d29[_0xdfda('0x43')];if(!_0x3a13ee['query'][_0xdfda('0x4a')](_0xdfda('0x4b'))){_0x141045[_0xdfda('0x31')]=qs[_0xdfda('0x31')](_0x3a13ee['query'][_0xdfda('0x31')]);_0x141045['offset']=qs[_0xdfda('0x4c')](_0x3a13ee[_0xdfda('0x44')][_0xdfda('0x4c')]);}_0x141045[_0xdfda('0x4d')]=qs['sort'](_0x3a13ee['query']['sort']);_0x141045[_0xdfda('0x4f')]=qs[_0xdfda('0x45')](_['pick'](_0x3a13ee[_0xdfda('0x44')],_0x1b2d29['filters']));_0x141045[_0xdfda('0x4f')]['ChatQueueId']=_0x536692['id'];if(_0x3a13ee[_0xdfda('0x44')][_0xdfda('0x51')]){_0x141045['where']=_[_0xdfda('0x52')](_0x141045[_0xdfda('0x4f')],{'$or':_[_0xdfda('0x3d')](_0x141045['attributes'],function(_0x34b6cc){var _0x1f8c35={};_0x1f8c35[_0x34b6cc]={'$like':'%'+_0x3a13ee[_0xdfda('0x44')][_0xdfda('0x51')]+'%'};return _0x1f8c35;})});}_0x141045=_[_0xdfda('0x52')]({},_0x141045,_0x3a13ee[_0xdfda('0x54')]);return db[_0xdfda('0x68')][_0xdfda('0x69')](_0x141045);}})['then'](function(_0x1afa02){if(_0x1afa02){return db[_0xdfda('0x6a')][_0xdfda('0x6b')]({'where':{'id':_[_0xdfda('0x3d')](_0x1afa02,_0xdfda('0x6c')),'role':_0xdfda('0x6d')},'attributes':['id',_0xdfda('0x3a'),_0xdfda('0x6e'),_0xdfda('0x6f'),_0xdfda('0x70')]});}})['then'](function(_0x35187d){if(_0x35187d){return{'count':_0x35187d[_0xdfda('0x32')],'rows':_[_0xdfda('0x3d')](_0x35187d[_0xdfda('0x57')],function(_0x3c075b){return{'membername':_0x3c075b[_0xdfda('0x3a')],'UserId':_0x3c075b['id'],'queue_name':_0x3fb84d[_0xdfda('0x3a')],'ChatQueueId':_0x3fb84d['id'],'interface':util[_0xdfda('0x71')](_0xdfda('0x72'),'SIP',_0x3c075b[_0xdfda('0x3a')]),'penalty':0x0,'paused':_0x3c075b[_0xdfda('0x6e')],'createdAt':_0x3c075b[_0xdfda('0x70')],'updatedAt':_0x3c075b[_0xdfda('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdfda('0x23')](respondWithFilteredResult(_0x57a686,_0x141045))['catch'](handleError(_0x57a686,null));};exports[_0xdfda('0x73')]=function(_0x34ec86,_0x1f73e1,_0x54181c){var _0x314cc8={};var _0x34cc0a={};var _0x164fef;var _0x29d3e4;return db['ChatQueue'][_0xdfda('0x67')]({'where':{'id':_0x34ec86[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x1f73e1,null))[_0xdfda('0x23')](function(_0x31c727){if(_0x31c727){_0x164fef=_0x31c727;_0x34cc0a[_0xdfda('0x43')]=_[_0xdfda('0x5b')](db[_0xdfda('0x74')][_0xdfda('0x3f')]);_0x34cc0a[_0xdfda('0x44')]=_[_0xdfda('0x5b')](_0x34ec86[_0xdfda('0x44')]);_0x34cc0a[_0xdfda('0x45')]=_['intersection'](_0x34cc0a[_0xdfda('0x43')],_0x34cc0a['query']);_0x314cc8['attributes']=_[_0xdfda('0x46')](_0x34cc0a['model'],qs['fields'](_0x34ec86['query'][_0xdfda('0x48')]));_0x314cc8[_0xdfda('0x47')]=_0x314cc8['attributes'][_0xdfda('0x49')]?_0x314cc8[_0xdfda('0x47')]:_0x34cc0a[_0xdfda('0x43')];_0x314cc8[_0xdfda('0x4d')]=qs[_0xdfda('0x4e')](_0x34ec86[_0xdfda('0x44')]['sort']);_0x314cc8[_0xdfda('0x4f')]=qs['filters'](_['pick'](_0x34ec86[_0xdfda('0x44')],_0x34cc0a['filters']));if(_0x34ec86[_0xdfda('0x44')]['filter']){_0x314cc8[_0xdfda('0x4f')]=_[_0xdfda('0x52')](_0x314cc8[_0xdfda('0x4f')],{'$or':_[_0xdfda('0x3d')](_0x314cc8[_0xdfda('0x47')],function(_0x46ac4f){var _0xfa8088={};_0xfa8088[_0x46ac4f]={'$like':'%'+_0x34ec86['query']['filter']+'%'};return _0xfa8088;})});}_0x314cc8=_['merge']({},_0x314cc8,_0x34ec86[_0xdfda('0x54')]);return _0x164fef['getTeams'](_0x314cc8);}})[_0xdfda('0x23')](function(_0x430641){if(_0x430641){_0x29d3e4=_0x430641[_0xdfda('0x49')];if(!_0x34ec86['query'][_0xdfda('0x4a')](_0xdfda('0x4b'))){_0x314cc8[_0xdfda('0x31')]=qs[_0xdfda('0x31')](_0x34ec86[_0xdfda('0x44')][_0xdfda('0x31')]);_0x314cc8[_0xdfda('0x4c')]=qs[_0xdfda('0x4c')](_0x34ec86['query']['offset']);}return _0x164fef[_0xdfda('0x73')](_0x314cc8);}})[_0xdfda('0x23')](function(_0x3f7843){if(_0x3f7843){return _0x3f7843?{'count':_0x29d3e4,'rows':_0x3f7843}:null;}})[_0xdfda('0x23')](respondWithResult(_0x1f73e1,null))[_0xdfda('0x58')](handleError(_0x1f73e1,null));};exports[_0xdfda('0x75')]=function(_0x344d85,_0x196c6c,_0x5711e3){var _0x1e5cca=_0x344d85['body']['ids'];return db[_0xdfda('0x74')][_0xdfda('0x69')]({'where':{'id':_0x1e5cca},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdfda('0x76'),'attributes':['id',_0xdfda('0x3a'),'online','voicePause',_0xdfda('0x77')],'raw':!![]}]})[_0xdfda('0x23')](function(_0x216e05){if(_0x216e05){var _0x2e2b95=_[_0xdfda('0x78')](_0x216e05,function(_0x4402d7){var _0x58cf47=_0x4402d7[_0xdfda('0x36')]({'plain':!![]});return _0x58cf47[_0xdfda('0x76')];});return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x344d85[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](function(_0x2ed2ff){return db[_0xdfda('0x79')][_0xdfda('0x7a')](function(_0x46a549){return _0x2ed2ff[_0xdfda('0x75')](_0x1e5cca,{'transaction':_0x46a549})[_0xdfda('0x23')](function(){return BPromise[_0xdfda('0x7b')](_0x2e2b95,function(_0x45ca54){return db[_0xdfda('0x68')][_0xdfda('0x7c')]({'where':{'UserId':_0x45ca54['id'],'ChatQueueId':_0x344d85[_0xdfda('0x5a')]['id']},'transaction':_0x46a549});});})[_0xdfda('0x23')](function(){_0x2e2b95[_0xdfda('0x7d')](function(_0x29ab78){socket['emit']('userChatQueue:save',{'UserId':_0x29ab78['id'],'ChatQueueId':_0x2ed2ff['id']});});});});});}})[_0xdfda('0x23')](respondWithStatusCode(_0x196c6c,null))['catch'](handleError(_0x196c6c,null));};exports[_0xdfda('0x7e')]=function(_0x191654,_0x330010,_0x2ffc15){return db[_0xdfda('0x74')][_0xdfda('0x69')]({'where':{'id':_0x191654[_0xdfda('0x44')][_0xdfda('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xdfda('0x6a')],'as':_0xdfda('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x330010,null))[_0xdfda('0x23')](function(_0x1edf2d){var _0x22511c=_['map'](_0x1edf2d,'id');var _0x748e5d=[];var _0x330e4f=[];var _0x150178=squel[_0xdfda('0x80')]();_0x150178[_0xdfda('0x81')]('tq.TeamId')[_0xdfda('0x82')]('team_has_chat_queues','tq')[_0xdfda('0x83')]('user_has_teams','ut',_0xdfda('0x84'))[_0xdfda('0x4f')]('ChatQueueId\x20=\x20?',_0x191654['params']['id']);for(var _0x10bf24=0x0;_0x10bf24<_0x1edf2d[_0xdfda('0x49')];_0x10bf24+=0x1){let _0x5885c4=_0x1edf2d[_0x10bf24];for(var _0x25dc4a=0x0;_0x25dc4a<_0x5885c4[_0xdfda('0x76')]['length'];_0x25dc4a+=0x1){let _0x171e4d=_0x5885c4[_0xdfda('0x76')][_0x25dc4a];var _0x218e2e=_0x150178[_0xdfda('0x85')]();_0x218e2e[_0xdfda('0x4f')](_0xdfda('0x86'),_0x171e4d['id']);_0x330e4f[_0xdfda('0x87')](db[_0xdfda('0x79')][_0xdfda('0x44')](_0x218e2e[_0xdfda('0x88')](),{'type':db[_0xdfda('0x79')][_0xdfda('0x89')][_0xdfda('0x8a')]})[_0xdfda('0x23')](function(_0x446a76){if(_0x446a76[_0xdfda('0x49')]===0x1){return _0x171e4d['id'];}else{var _0x3cb34e=_[_0xdfda('0x8b')](_['map'](_0x446a76,_0xdfda('0x8c')),function(_0x2c84d1){return _[_0xdfda('0x8d')](_0x22511c,_0x2c84d1);});if(_0x3cb34e){return _0x171e4d['id'];}}}));}}return BPromise[_0xdfda('0x8e')](_0x330e4f)[_0xdfda('0x23')](function(_0x48d05c){_0x748e5d=_(_0x748e5d)[_0xdfda('0x8f')](_0x48d05c)[_0xdfda('0x90')]()[_0xdfda('0x91')]();return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x191654[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](function(_0x1f41be){return db[_0xdfda('0x79')][_0xdfda('0x7a')](function(_0x4ac5d0){return _0x1f41be[_0xdfda('0x7e')](_0x191654[_0xdfda('0x44')][_0xdfda('0x7f')],{'transaction':_0x4ac5d0})[_0xdfda('0x23')](function(){if(!_[_0xdfda('0x92')](_0x748e5d)){return _0x1f41be[_0xdfda('0x93')](_0x748e5d,{'transaction':_0x4ac5d0});}})[_0xdfda('0x23')](function(){_0x748e5d['forEach'](function(_0x8a74f9){socket[_0xdfda('0x94')](_0xdfda('0x95'),{'UserId':_0x8a74f9,'ChatQueueId':_0x1f41be['id']});});});});});});})[_0xdfda('0x23')](respondWithStatusCode(_0x330010,null))[_0xdfda('0x58')](handleError(_0x330010,null));};exports['addAgents']=function(_0x7ad3ca,_0x24e9b0,_0xefa90a){return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x7ad3ca[_0xdfda('0x5a')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x24e9b0,null))['then'](function(_0x20f067){if(_0x20f067){return _0x20f067['addAgents'](_0x7ad3ca['body']['ids'],_[_0xdfda('0x96')](_0x7ad3ca[_0xdfda('0x5e')],[_0xdfda('0x7f'),'id'])||{})[_0xdfda('0x97')](function(_0x4d030b){for(var _0x52c1d4=0x0;_0x52c1d4<_0x7ad3ca[_0xdfda('0x5e')][_0xdfda('0x7f')][_0xdfda('0x49')];_0x52c1d4+=0x1){socket['emit'](_0xdfda('0x98'),{'UserId':Number(_0x7ad3ca[_0xdfda('0x5e')][_0xdfda('0x7f')][_0x52c1d4]),'ChatQueueId':Number(_0x7ad3ca[_0xdfda('0x5a')]['id'])});}return _0x4d030b;});}})['then'](respondWithResult(_0x24e9b0,null))[_0xdfda('0x58')](handleError(_0x24e9b0,null));};exports[_0xdfda('0x93')]=function(_0x47ed25,_0x52b871,_0x5e2e44){return db[_0xdfda('0x3e')][_0xdfda('0x5c')]({'where':{'id':_0x47ed25['params']['id']}})['then'](handleEntityNotFound(_0x52b871,null))[_0xdfda('0x23')](function(_0x27770d){if(_0x27770d){return _0x27770d['removeAgents'](_0x47ed25['query'][_0xdfda('0x7f')])[_0xdfda('0x23')](function(){if(_[_0xdfda('0x99')](_0x47ed25[_0xdfda('0x44')][_0xdfda('0x7f')])){for(var _0x208daf=0x0;_0x208daf<_0x47ed25[_0xdfda('0x44')][_0xdfda('0x7f')]['length'];_0x208daf+=0x1){socket[_0xdfda('0x94')]('userChatQueue:remove',{'UserId':Number(_0x47ed25[_0xdfda('0x44')][_0xdfda('0x7f')][_0x208daf]),'ChatQueueId':Number(_0x47ed25[_0xdfda('0x5a')]['id'])});}}else{socket[_0xdfda('0x94')]('userChatQueue:remove',{'UserId':Number(_0x47ed25[_0xdfda('0x44')][_0xdfda('0x7f')]),'ChatQueueId':Number(_0x47ed25[_0xdfda('0x5a')]['id'])});}});}})[_0xdfda('0x23')](respondWithStatusCode(_0x52b871,null))[_0xdfda('0x58')](handleError(_0x52b871,null));};exports[_0xdfda('0x9a')]=function(_0x35834c,_0x152eee,_0x181ae8){var _0x482fb6={};var _0x475aa1={};var _0x2a6bd7;var _0xa50fac;return db[_0xdfda('0x3e')][_0xdfda('0x67')]({'where':{'id':_0x35834c[_0xdfda('0x5a')]['id']}})['then'](handleEntityNotFound(_0x152eee,null))[_0xdfda('0x23')](function(_0x26735c){if(_0x26735c){_0x2a6bd7=_0x26735c;_0x475aa1['model']=_[_0xdfda('0x5b')](db[_0xdfda('0x6a')][_0xdfda('0x3f')]);_0x475aa1[_0xdfda('0x44')]=_[_0xdfda('0x5b')](_0x35834c[_0xdfda('0x44')]);_0x475aa1['filters']=_[_0xdfda('0x46')](_0x475aa1[_0xdfda('0x43')],_0x475aa1[_0xdfda('0x44')]);_0x482fb6[_0xdfda('0x47')]=_[_0xdfda('0x46')](_0x475aa1[_0xdfda('0x43')],qs[_0xdfda('0x48')](_0x35834c[_0xdfda('0x44')][_0xdfda('0x48')]));_0x482fb6[_0xdfda('0x47')]=_0x482fb6[_0xdfda('0x47')][_0xdfda('0x49')]?_0x482fb6[_0xdfda('0x47')]:_0x475aa1['model'];_0x482fb6[_0xdfda('0x4d')]=qs[_0xdfda('0x4e')](_0x35834c[_0xdfda('0x44')][_0xdfda('0x4e')]);_0x482fb6[_0xdfda('0x4f')]=qs[_0xdfda('0x45')](_[_0xdfda('0x50')](_0x35834c[_0xdfda('0x44')],_0x475aa1['filters']));if(_0x35834c['query']['filter']){_0x482fb6[_0xdfda('0x4f')]=_['merge'](_0x482fb6[_0xdfda('0x4f')],{'$or':_[_0xdfda('0x3d')](_0x482fb6[_0xdfda('0x47')],function(_0xd5fb1c){var _0x4360ff={};_0x4360ff[_0xd5fb1c]={'$like':'%'+_0x35834c[_0xdfda('0x44')][_0xdfda('0x51')]+'%'};return _0x4360ff;})});}_0x482fb6=_[_0xdfda('0x52')]({},_0x482fb6,_0x35834c[_0xdfda('0x54')]);return _0x2a6bd7[_0xdfda('0x9a')](_0x482fb6);}})[_0xdfda('0x23')](function(_0x5674c5){if(_0x5674c5){_0xa50fac=_0x5674c5[_0xdfda('0x49')];if(!_0x35834c[_0xdfda('0x44')]['hasOwnProperty']('nolimit')){_0x482fb6[_0xdfda('0x31')]=qs[_0xdfda('0x31')](_0x35834c[_0xdfda('0x44')]['limit']);_0x482fb6[_0xdfda('0x4c')]=qs[_0xdfda('0x4c')](_0x35834c[_0xdfda('0x44')][_0xdfda('0x4c')]);}return _0x2a6bd7['getAgents'](_0x482fb6);}})[_0xdfda('0x23')](function(_0x168ed9){if(_0x168ed9){return _0x168ed9?{'count':_0xa50fac,'rows':_0x168ed9}:null;}})['then'](respondWithResult(_0x152eee,null))[_0xdfda('0x58')](handleError(_0x152eee,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index fa2aabd..2a508f0 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 _0x9cb8=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9cb8,0x155));var _0x89cb=function(_0x35ae91,_0x3308ab){_0x35ae91=_0x35ae91-0x0;var _0x19b5ba=_0x9cb8[_0x35ae91];return _0x19b5ba;};'use strict';var EventEmitter=require(_0x89cb('0x0'));var ChatQueue=require(_0x89cb('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x89cb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x89cb('0x3'),'afterDestroy':_0x89cb('0x4')};function emitEvent(_0x5cb1ab){return function(_0x108431,_0x299c2d,_0x4d95e3){ChatQueueEvents['emit'](_0x5cb1ab+':'+_0x108431['id'],_0x108431);ChatQueueEvents['emit'](_0x5cb1ab,_0x108431);_0x4d95e3(null);};}for(var e in events){if(events[_0x89cb('0x5')](e)){var event=events[e];ChatQueue[_0x89cb('0x6')](e,emitEvent(event));}}module[_0x89cb('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xb784=['hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0xb784,0x8f));var _0x4b78=function(_0x28d645,_0x40dd0d){_0x28d645=_0x28d645-0x0;var _0x3f25c3=_0xb784[_0x28d645];return _0x3f25c3;};'use strict';var EventEmitter=require(_0x4b78('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4b78('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4b78('0x2')](0x0);var events={'afterCreate':_0x4b78('0x3'),'afterUpdate':_0x4b78('0x4'),'afterDestroy':_0x4b78('0x5')};function emitEvent(_0x1fcf70){return function(_0x174bb6,_0x22677b,_0x4e1b65){ChatQueueEvents[_0x4b78('0x6')](_0x1fcf70+':'+_0x174bb6['id'],_0x174bb6);ChatQueueEvents[_0x4b78('0x6')](_0x1fcf70,_0x174bb6);_0x4e1b65(null);};}for(var e in events){if(events[_0x4b78('0x7')](e)){var event=events[e];ChatQueue[_0x4b78('0x8')](e,emitEvent(event));}}module[_0x4b78('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cb4ba6e..07eea20 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 _0x6af2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x28534b,_0x301a5e){var _0x126035=function(_0x129484){while(--_0x129484){_0x28534b['push'](_0x28534b['shift']());}};_0x126035(++_0x301a5e);}(_0x6af2,0x9c));var _0x26af=function(_0x33a984,_0x392a3c){_0x33a984=_0x33a984-0x0;var _0x4f2e0b=_0x6af2[_0x33a984];return _0x4f2e0b;};'use strict';var _=require(_0x26af('0x0'));var util=require(_0x26af('0x1'));var logger=require(_0x26af('0x2'))(_0x26af('0x3'));var moment=require(_0x26af('0x4'));var BPromise=require(_0x26af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26af('0x6'));var rimraf=require(_0x26af('0x7'));var config=require('../../config/environment');var attributes=require(_0x26af('0x8'));module[_0x26af('0x9')]=function(_0x46f61f,_0x1525c4){return _0x46f61f[_0x26af('0xa')](_0x26af('0xb'),attributes,{'tableName':_0x26af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc979=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc979,0x1ef));var _0x9c97=function(_0x3c3210,_0x5356d0){_0x3c3210=_0x3c3210-0x0;var _0xa13f7f=_0xc979[_0x3c3210];return _0xa13f7f;};'use strict';var _=require(_0x9c97('0x0'));var util=require(_0x9c97('0x1'));var logger=require(_0x9c97('0x2'))(_0x9c97('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c97('0x4'));var fs=require('fs');var path=require(_0x9c97('0x5'));var rimraf=require(_0x9c97('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c97('0x7'));module[_0x9c97('0x8')]=function(_0x6b98c8,_0x28f1f8){return _0x6b98c8['define'](_0x9c97('0x9'),attributes,{'tableName':_0x9c97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 3e70157..1abedf8 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 _0x3670=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','model','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b45de,_0x2e5b2e){var _0x596120=function(_0x35c8b1){while(--_0x35c8b1){_0x2b45de['push'](_0x2b45de['shift']());}};_0x596120(++_0x2e5b2e);}(_0x3670,0x16c));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0367('0x0'));var moment=require(_0x0367('0x1'));var BPromise=require(_0x0367('0x2'));var rs=require(_0x0367('0x3'));var fs=require('fs');var Redis=require(_0x0367('0x4'));var db=require(_0x0367('0x5'))['db'];var utils=require(_0x0367('0x6'));var logger=require('../../config/logger')(_0x0367('0x7'));var config=require(_0x0367('0x8'));var jayson=require(_0x0367('0x9'));var client=jayson[_0x0367('0xa')][_0x0367('0xb')]({'port':0x232a});config[_0x0367('0xc')]=_[_0x0367('0xd')](config[_0x0367('0xc')],{'host':_0x0367('0xe'),'port':0x18eb});var socket=require(_0x0367('0xf'))(new Redis(config[_0x0367('0xc')]));require(_0x0367('0x10'))[_0x0367('0x11')](socket);function respondWithRpcPromise(_0x27d570,_0x412c44,_0x2036c0){return new BPromise(function(_0x5437d0,_0x323471){return client['request'](_0x27d570,_0x2036c0)[_0x0367('0x12')](function(_0x23f4c8){logger[_0x0367('0x13')](_0x0367('0x14'),_0x412c44,_0x0367('0x15'));logger[_0x0367('0x16')](_0x0367('0x17'),_0x412c44,_0x0367('0x15'),JSON['stringify'](_0x23f4c8));if(_0x23f4c8[_0x0367('0x18')]){if(_0x23f4c8[_0x0367('0x18')]['code']===0x1f4){logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8[_0x0367('0x18')]['message']);return _0x323471(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8['error']['message']);return _0x5437d0(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}else{logger[_0x0367('0x13')]('ChatQueue,\x20%s,\x20%s',_0x412c44,'request\x20sent');_0x5437d0(_0x23f4c8[_0x0367('0x1a')][_0x0367('0x19')]);}})[_0x0367('0x1b')](function(_0x383217){logger['error'](_0x0367('0x14'),_0x412c44,_0x383217);_0x323471(_0x383217);});});}exports[_0x0367('0x1c')]=function(_0x14ddf2){var _0x2f8d0d=this;return new Promise(function(_0x50551d,_0x5de2fd){return db[_0x0367('0x1d')][_0x0367('0x1e')]({'raw':_0x14ddf2['options']?_0x14ddf2['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x22')]||null:null,'limit':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2['options']['limit']||null:null,'include':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x23')]?_['map'](_0x14ddf2['options'][_0x0367('0x23')],function(_0x520a84){return{'model':db[_0x520a84[_0x0367('0x24')]],'as':_0x520a84['as'],'attributes':_0x520a84[_0x0367('0x22')],'include':_0x520a84[_0x0367('0x23')]?_[_0x0367('0x25')](_0x520a84[_0x0367('0x23')],function(_0x5c2905){return{'model':db[_0x5c2905[_0x0367('0x24')]],'as':_0x5c2905['as'],'attributes':_0x5c2905[_0x0367('0x22')],'include':_0x5c2905[_0x0367('0x23')]?_[_0x0367('0x25')](_0x5c2905['include'],function(_0x2ed10e){return{'model':db[_0x2ed10e[_0x0367('0x24')]],'as':_0x2ed10e['as'],'attributes':_0x2ed10e[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46461f){logger[_0x0367('0x13')]('GetChatQueue',_0x14ddf2);logger[_0x0367('0x16')](_0x0367('0x1c'),_0x14ddf2,JSON[_0x0367('0x26')](_0x46461f));_0x50551d(_0x46461f);})[_0x0367('0x1b')](function(_0x382370){logger['error'](_0x0367('0x1c'),_0x382370['message'],_0x14ddf2);_0x5de2fd(_0x2f8d0d[_0x0367('0x18')](0x1f4,_0x382370[_0x0367('0x19')]));});});};exports[_0x0367('0x27')]=function(_0xb6ab1b){var _0x16265a=this;return new Promise(function(_0x157dd2,_0x4edac8){return db[_0x0367('0x1d')][_0x0367('0x28')]({'raw':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')]['attributes']||null:null,'include':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x23')]?_[_0x0367('0x25')](_0xb6ab1b[_0x0367('0x20')]['include'],function(_0x33395f){return{'model':db[_0x33395f['model']],'as':_0x33395f['as'],'attributes':_0x33395f['attributes'],'include':_0x33395f[_0x0367('0x23')]?_[_0x0367('0x25')](_0x33395f[_0x0367('0x23')],function(_0x843a58){return{'model':db[_0x843a58['model']],'as':_0x843a58['as'],'attributes':_0x843a58[_0x0367('0x22')],'include':_0x843a58[_0x0367('0x23')]?_[_0x0367('0x25')](_0x843a58[_0x0367('0x23')],function(_0x5d60c3){return{'model':db[_0x5d60c3['model']],'as':_0x5d60c3['as'],'attributes':_0x5d60c3[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0367('0x12')](function(_0x2d4a0b){logger[_0x0367('0x13')](_0x0367('0x27'),_0xb6ab1b);logger[_0x0367('0x16')](_0x0367('0x27'),_0xb6ab1b,JSON['stringify'](_0x2d4a0b));_0x157dd2(_0x2d4a0b);})['catch'](function(_0x2f4660){logger[_0x0367('0x18')](_0x0367('0x27'),_0x2f4660[_0x0367('0x19')],_0xb6ab1b);_0x4edac8(_0x16265a[_0x0367('0x18')](0x1f4,_0x2f4660[_0x0367('0x19')]));});});}; \ No newline at end of file +var _0x5ed0=['debug','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x38b676,_0x20789c){var _0x134a56=function(_0x53158a){while(--_0x53158a){_0x38b676['push'](_0x38b676['shift']());}};_0x134a56(++_0x20789c);}(_0x5ed0,0xcb));var _0x05ed=function(_0x1aea88,_0x5db37b){_0x1aea88=_0x1aea88-0x0;var _0x2c0309=_0x5ed0[_0x1aea88];return _0x2c0309;};'use strict';var _=require('lodash');var util=require(_0x05ed('0x0'));var moment=require(_0x05ed('0x1'));var BPromise=require(_0x05ed('0x2'));var rs=require(_0x05ed('0x3'));var fs=require('fs');var Redis=require(_0x05ed('0x4'));var db=require(_0x05ed('0x5'))['db'];var utils=require(_0x05ed('0x6'));var logger=require(_0x05ed('0x7'))('rpc');var config=require(_0x05ed('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05ed('0x9')]({'port':0x232a});config[_0x05ed('0xa')]=_[_0x05ed('0xb')](config[_0x05ed('0xa')],{'host':_0x05ed('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ed('0xa')]));require('./chatQueue.socket')[_0x05ed('0xd')](socket);function respondWithRpcPromise(_0x1f64ac,_0x4dd2e4,_0x8a6298){return new BPromise(function(_0x1c6502,_0x4fdba5){return client[_0x05ed('0xe')](_0x1f64ac,_0x8a6298)[_0x05ed('0xf')](function(_0x18954b){logger[_0x05ed('0x10')](_0x05ed('0x11'),_0x4dd2e4,_0x05ed('0x12'));logger[_0x05ed('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4dd2e4,'request\x20sent',JSON['stringify'](_0x18954b));if(_0x18954b[_0x05ed('0x14')]){if(_0x18954b[_0x05ed('0x14')][_0x05ed('0x15')]===0x1f4){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);return _0x4fdba5(_0x18954b[_0x05ed('0x14')]['message']);}logger[_0x05ed('0x14')](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')]['message']);return _0x1c6502(_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);}else{logger['info'](_0x05ed('0x11'),_0x4dd2e4,'request\x20sent');_0x1c6502(_0x18954b[_0x05ed('0x17')][_0x05ed('0x16')]);}})[_0x05ed('0x18')](function(_0x519124){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x519124);_0x4fdba5(_0x519124);});});}exports[_0x05ed('0x19')]=function(_0x28de40){var _0x1bdf4d=this;return new Promise(function(_0x397a45,_0x3b023c){return db[_0x05ed('0x1a')]['findAll']({'raw':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x28de40['options']?_0x28de40[_0x05ed('0x1b')]['where']||null:null,'attributes':_0x28de40[_0x05ed('0x1b')]?_0x28de40['options']['attributes']||null:null,'limit':_0x28de40['options']?_0x28de40['options'][_0x05ed('0x1d')]||null:null,'include':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1e')]?_['map'](_0x28de40['options'][_0x05ed('0x1e')],function(_0x307321){return{'model':db[_0x307321[_0x05ed('0x1f')]],'as':_0x307321['as'],'attributes':_0x307321[_0x05ed('0x20')],'include':_0x307321[_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x307321[_0x05ed('0x1e')],function(_0x141c8f){return{'model':db[_0x141c8f[_0x05ed('0x1f')]],'as':_0x141c8f['as'],'attributes':_0x141c8f['attributes'],'include':_0x141c8f['include']?_['map'](_0x141c8f[_0x05ed('0x1e')],function(_0x5854cc){return{'model':db[_0x5854cc[_0x05ed('0x1f')]],'as':_0x5854cc['as'],'attributes':_0x5854cc[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x4db7f4){logger['info'](_0x05ed('0x19'),_0x28de40);logger['debug'](_0x05ed('0x19'),_0x28de40,JSON[_0x05ed('0x22')](_0x4db7f4));_0x397a45(_0x4db7f4);})[_0x05ed('0x18')](function(_0x7644f0){logger[_0x05ed('0x14')](_0x05ed('0x19'),_0x7644f0['message'],_0x28de40);_0x3b023c(_0x1bdf4d['error'](0x1f4,_0x7644f0[_0x05ed('0x16')]));});});};exports[_0x05ed('0x23')]=function(_0x409588){var _0x1c7759=this;return new Promise(function(_0x1668ba,_0x3e95ad){return db[_0x05ed('0x1a')][_0x05ed('0x24')]({'raw':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x409588['options']?_0x409588['options']['where']||null:null,'attributes':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')]['attributes']||null:null,'include':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')],function(_0x3454f7){return{'model':db[_0x3454f7[_0x05ed('0x1f')]],'as':_0x3454f7['as'],'attributes':_0x3454f7[_0x05ed('0x20')],'include':_0x3454f7[_0x05ed('0x1e')]?_['map'](_0x3454f7['include'],function(_0x3f8f26){return{'model':db[_0x3f8f26[_0x05ed('0x1f')]],'as':_0x3f8f26['as'],'attributes':_0x3f8f26['attributes'],'include':_0x3f8f26['include']?_[_0x05ed('0x21')](_0x3f8f26[_0x05ed('0x1e')],function(_0x30d771){return{'model':db[_0x30d771[_0x05ed('0x1f')]],'as':_0x30d771['as'],'attributes':_0x30d771[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x46b118){logger[_0x05ed('0x10')](_0x05ed('0x23'),_0x409588);logger[_0x05ed('0x13')](_0x05ed('0x23'),_0x409588,JSON[_0x05ed('0x22')](_0x46b118));_0x1668ba(_0x46b118);})[_0x05ed('0x18')](function(_0x1ec847){logger['error'](_0x05ed('0x23'),_0x1ec847[_0x05ed('0x16')],_0x409588);_0x3e95ad(_0x1c7759[_0x05ed('0x14')](0x1f4,_0x1ec847[_0x05ed('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4194e4a..437632c 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 _0x34e5=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0x4d1d1c,_0x3c4de7){var _0x26e951=function(_0x2fdbdf){while(--_0x2fdbdf){_0x4d1d1c['push'](_0x4d1d1c['shift']());}};_0x26e951(++_0x3c4de7);}(_0x34e5,0x172));var _0x534e=function(_0xdb8d93,_0x3f39df){_0xdb8d93=_0xdb8d93-0x0;var _0x1e93ec=_0x34e5[_0xdb8d93];return _0x1e93ec;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x534e('0x0'),'remove',_0x534e('0x1')];function createListener(_0x467e3e,_0x425ae8){return function(_0x246650){_0x425ae8[_0x534e('0x2')](_0x467e3e,_0x246650);};}function removeListener(_0x50b790,_0x11a158){return function(){ChatQueueEvents[_0x534e('0x3')](_0x50b790,_0x11a158);};}exports[_0x534e('0x4')]=function(_0x117f0c){for(var _0x436a92=0x0,_0x2d0370=events[_0x534e('0x5')];_0x436a92<_0x2d0370;_0x436a92++){var _0x5620d4=events[_0x436a92];var _0x24d562=createListener(_0x534e('0x6')+_0x5620d4,_0x117f0c);ChatQueueEvents['on'](_0x5620d4,_0x24d562);}}; \ No newline at end of file +var _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x23ff19,_0x3ed90f){var _0x540d87=function(_0x2949ef){while(--_0x2949ef){_0x23ff19['push'](_0x23ff19['shift']());}};_0x540d87(++_0x3ed90f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x4b84[_0x33c9f8];return _0x2d7004;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index fd33e35..e37af60 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x108565,_0x465d80){var _0x5a97d3=function(_0x2e73ab){while(--_0x2e73ab){_0x108565['push'](_0x108565['shift']());}};_0x5a97d3(++_0x465d80);}(_0xe14b,0x93));var _0xbe14=function(_0xd0cbe6,_0x2c8b7e){_0xd0cbe6=_0xd0cbe6-0x0;var _0x2111e2=_0xe14b[_0xd0cbe6];return _0x2111e2;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x39f9de,_0x4cee1c){var _0x5dca4d=function(_0x3e9b04){while(--_0x3e9b04){_0x39f9de['push'](_0x39f9de['shift']());}};_0x5dca4d(++_0x4cee1c);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ce671cf..20e2ff1 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 _0x24c5=['exports','STRING','DATE','sequelize'];(function(_0x4a79bd,_0x3f7827){var _0x26fd6a=function(_0x193ee6){while(--_0x193ee6){_0x4a79bd['push'](_0x4a79bd['shift']());}};_0x26fd6a(++_0x3f7827);}(_0x24c5,0x163));var _0x524c=function(_0x5f548e,_0x15898e){_0x5f548e=_0x5f548e-0x0;var _0x33102c=_0x24c5[_0x5f548e];return _0x33102c;};'use strict';var moment=require('moment');var Sequelize=require(_0x524c('0x0'));module[_0x524c('0x1')]={'uniqueid':{'type':Sequelize[_0x524c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x524c('0x3')]},'leaveAt':{'type':Sequelize[_0x524c('0x3')]},'acceptAt':{'type':Sequelize[_0x524c('0x3')]},'exitAt':{'type':Sequelize[_0x524c('0x3')]},'reason':{'type':Sequelize[_0x524c('0x2')]}}; \ No newline at end of file +var _0xde4e=['STRING','DATE','moment','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xde4e,0x1ec));var _0xede4=function(_0x314115,_0x384810){_0x314115=_0x314115-0x0;var _0x41fecf=_0xde4e[_0x314115];return _0x41fecf;};'use strict';var moment=require(_0xede4('0x0'));var Sequelize=require(_0xede4('0x1'));module[_0xede4('0x2')]={'uniqueid':{'type':Sequelize[_0xede4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xede4('0x3')]},'joinAt':{'type':Sequelize[_0xede4('0x4')]},'leaveAt':{'type':Sequelize[_0xede4('0x4')]},'acceptAt':{'type':Sequelize[_0xede4('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xede4('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index decd78d..2bef246 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 _0xe5e0=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x5eb7f9,_0xe8a4bb){_0x5eb7f9=_0x5eb7f9-0x0;var _0x52fdea=_0xe5e0[_0x5eb7f9];return _0x52fdea;};'use strict';var emlformat=require(_0x0e5e('0x0'));var rimraf=require(_0x0e5e('0x1'));var zipdir=require(_0x0e5e('0x2'));var jsonpatch=require(_0x0e5e('0x3'));var rp=require(_0x0e5e('0x4'));var moment=require(_0x0e5e('0x5'));var BPromise=require(_0x0e5e('0x6'));var Mustache=require(_0x0e5e('0x7'));var util=require(_0x0e5e('0x8'));var path=require('path');var sox=require(_0x0e5e('0x9'));var csv=require(_0x0e5e('0xa'));var ejs=require(_0x0e5e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e5e('0xc'));var squel=require(_0x0e5e('0xd'));var crypto=require(_0x0e5e('0xe'));var jsforce=require(_0x0e5e('0xf'));var deskjs=require(_0x0e5e('0x10'));var toCsv=require(_0x0e5e('0xa'));var querystring=require(_0x0e5e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e5e('0x12'));var as=require(_0x0e5e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e5e('0x14'));var utils=require(_0x0e5e('0x15'));var config=require(_0x0e5e('0x16'));var licenseUtil=require(_0x0e5e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275cd5,_0x322cdf){_0x322cdf=_0x322cdf||0xcc;return function(_0x5c0900){if(_0x5c0900){return _0x275cd5[_0x0e5e('0x18')](_0x322cdf);}return _0x275cd5[_0x0e5e('0x19')](_0x322cdf)[_0x0e5e('0x1a')]();};}function respondWithResult(_0x50c0a3,_0x731afc){_0x731afc=_0x731afc||0xc8;return function(_0x2353b3){if(_0x2353b3){return _0x50c0a3[_0x0e5e('0x19')](_0x731afc)[_0x0e5e('0x1b')](_0x2353b3);}};}function respondWithFilteredResult(_0x19d3a1,_0x1ef0be){return function(_0x5dedc5){if(_0x5dedc5){var _0x20a35f=typeof _0x1ef0be[_0x0e5e('0x1c')]===_0x0e5e('0x1d')&&typeof _0x1ef0be[_0x0e5e('0x1e')]===_0x0e5e('0x1d');var _0x550dda=_0x5dedc5[_0x0e5e('0x1f')];var _0x2efa7f=_0x20a35f?0x0:_0x1ef0be['offset'];var _0x29597b=_0x20a35f?_0x5dedc5[_0x0e5e('0x1f')]:_0x1ef0be['offset']+_0x1ef0be[_0x0e5e('0x1e')];var _0x3b80f8;if(_0x29597b>=_0x550dda){_0x29597b=_0x550dda;_0x3b80f8=0xc8;}else{_0x3b80f8=0xce;}_0x19d3a1['status'](_0x3b80f8);return _0x19d3a1[_0x0e5e('0x20')](_0x0e5e('0x21'),_0x2efa7f+'-'+_0x29597b+'/'+_0x550dda)[_0x0e5e('0x1b')](_0x5dedc5);}return null;};}function patchUpdates(_0x56dcc9){return function(_0x4f468f){try{jsonpatch[_0x0e5e('0x22')](_0x4f468f,_0x56dcc9,!![]);}catch(_0x1b0588){return BPromise[_0x0e5e('0x23')](_0x1b0588);}return _0x4f468f[_0x0e5e('0x24')]();};}function saveUpdates(_0x2c3c01,_0x44b8b9){return function(_0x2588fa){if(_0x2588fa){return _0x2588fa[_0x0e5e('0x25')](_0x2c3c01)[_0x0e5e('0x26')](function(_0x33b27e){return _0x33b27e;});}return null;};}function removeEntity(_0x523c30,_0x742ee8){return function(_0x2321f9){if(_0x2321f9){return _0x2321f9[_0x0e5e('0x27')]()[_0x0e5e('0x26')](function(){_0x523c30[_0x0e5e('0x19')](0xcc)[_0x0e5e('0x1a')]();});}};}function handleEntityNotFound(_0x46cbd7,_0x4b53ca){return function(_0x1b19f0){if(!_0x1b19f0){_0x46cbd7['sendStatus'](0x194);}return _0x1b19f0;};}function handleError(_0x2750b0,_0x2f789a){_0x2f789a=_0x2f789a||0x1f4;return function(_0x5e3a60){logger[_0x0e5e('0x28')](_0x5e3a60[_0x0e5e('0x29')]);if(_0x5e3a60[_0x0e5e('0x2a')]){delete _0x5e3a60['name'];}_0x2750b0[_0x0e5e('0x19')](_0x2f789a)['send'](_0x5e3a60);};}exports[_0x0e5e('0x2b')]=function(_0x2d5cc0,_0x149209){var _0x4eb0d6={},_0x38930f={},_0x7a118={'count':0x0,'rows':[]};var _0x37a2d0=_[_0x0e5e('0x2c')](db[_0x0e5e('0x2d')][_0x0e5e('0x2e')],function(_0x3ea522){return{'name':_0x3ea522['fieldName'],'type':_0x3ea522[_0x0e5e('0x2f')][_0x0e5e('0x30')]};});_0x38930f[_0x0e5e('0x31')]=_[_0x0e5e('0x2c')](_0x37a2d0,'name');_0x38930f['query']=_['keys'](_0x2d5cc0['query']);_0x38930f[_0x0e5e('0x32')]=_['intersection'](_0x38930f[_0x0e5e('0x31')],_0x38930f[_0x0e5e('0x33')]);_0x4eb0d6[_0x0e5e('0x34')]=_['intersection'](_0x38930f[_0x0e5e('0x31')],qs['fields'](_0x2d5cc0['query'][_0x0e5e('0x35')]));_0x4eb0d6[_0x0e5e('0x34')]=_0x4eb0d6[_0x0e5e('0x34')][_0x0e5e('0x36')]?_0x4eb0d6[_0x0e5e('0x34')]:_0x38930f['model'];if(!_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x37')](_0x0e5e('0x38'))){_0x4eb0d6[_0x0e5e('0x1e')]=qs[_0x0e5e('0x1e')](_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x1e')]);_0x4eb0d6[_0x0e5e('0x1c')]=qs[_0x0e5e('0x1c')](_0x2d5cc0['query'][_0x0e5e('0x1c')]);}_0x4eb0d6[_0x0e5e('0x39')]=qs[_0x0e5e('0x3a')](_0x2d5cc0[_0x0e5e('0x33')]['sort']);_0x4eb0d6[_0x0e5e('0x3b')]=qs['filters'](_[_0x0e5e('0x3c')](_0x2d5cc0[_0x0e5e('0x33')],_0x38930f[_0x0e5e('0x32')]),_0x37a2d0);if(_0x2d5cc0['query'][_0x0e5e('0x3d')]){_0x4eb0d6[_0x0e5e('0x3b')]=_[_0x0e5e('0x3e')](_0x4eb0d6['where'],{'$or':_['map'](_0x37a2d0,function(_0x392a37){if(_0x392a37[_0x0e5e('0x2f')]!==_0x0e5e('0x3f')){var _0x5e6600={};_0x5e6600[_0x392a37[_0x0e5e('0x2a')]]={'$like':'%'+_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x3d')]+'%'};return _0x5e6600;}})});}_0x4eb0d6=_[_0x0e5e('0x3e')]({},_0x4eb0d6,_0x2d5cc0[_0x0e5e('0x40')]);var _0x5d25f6={'where':_0x4eb0d6[_0x0e5e('0x3b')]};return db[_0x0e5e('0x2d')][_0x0e5e('0x1f')](_0x5d25f6)[_0x0e5e('0x26')](function(_0xb0953f){_0x7a118[_0x0e5e('0x1f')]=_0xb0953f;if(_0x2d5cc0['query'][_0x0e5e('0x41')]){_0x4eb0d6[_0x0e5e('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0e5e('0x43')](_0x4eb0d6);})[_0x0e5e('0x26')](function(_0x5271fb){_0x7a118[_0x0e5e('0x44')]=_0x5271fb;return _0x7a118;})[_0x0e5e('0x26')](respondWithFilteredResult(_0x149209,_0x4eb0d6))['catch'](handleError(_0x149209,null));};exports[_0x0e5e('0x45')]=function(_0x5570b6,_0x1aeaad){var _0x29fd38={'raw':!![],'where':{'id':_0x5570b6[_0x0e5e('0x46')]['id']}},_0x31223b={};_0x31223b[_0x0e5e('0x31')]=_[_0x0e5e('0x47')](db[_0x0e5e('0x2d')][_0x0e5e('0x2e')]);_0x31223b[_0x0e5e('0x33')]=_[_0x0e5e('0x47')](_0x5570b6[_0x0e5e('0x33')]);_0x31223b['filters']=_[_0x0e5e('0x48')](_0x31223b['model'],_0x31223b['query']);_0x29fd38[_0x0e5e('0x34')]=_[_0x0e5e('0x48')](_0x31223b[_0x0e5e('0x31')],qs[_0x0e5e('0x35')](_0x5570b6[_0x0e5e('0x33')][_0x0e5e('0x35')]));_0x29fd38[_0x0e5e('0x34')]=_0x29fd38['attributes'][_0x0e5e('0x36')]?_0x29fd38[_0x0e5e('0x34')]:_0x31223b[_0x0e5e('0x31')];if(_0x5570b6[_0x0e5e('0x33')]['includeAll']){_0x29fd38[_0x0e5e('0x42')]=[{'all':!![]}];}_0x29fd38=_[_0x0e5e('0x3e')]({},_0x29fd38,_0x5570b6[_0x0e5e('0x40')]);return db[_0x0e5e('0x2d')]['find'](_0x29fd38)['then'](handleEntityNotFound(_0x1aeaad,null))['then'](respondWithResult(_0x1aeaad,null))[_0x0e5e('0x49')](handleError(_0x1aeaad,null));};exports['create']=function(_0x15a57c,_0x1d9995){return db['ChatQueueReport'][_0x0e5e('0x4a')](_0x15a57c[_0x0e5e('0x4b')],{})[_0x0e5e('0x26')](respondWithResult(_0x1d9995,0xc9))[_0x0e5e('0x49')](handleError(_0x1d9995,null));};exports[_0x0e5e('0x25')]=function(_0x2eb6d9,_0x13098a){if(_0x2eb6d9[_0x0e5e('0x4b')]['id']){delete _0x2eb6d9[_0x0e5e('0x4b')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2eb6d9[_0x0e5e('0x46')]['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x13098a,null))[_0x0e5e('0x26')](saveUpdates(_0x2eb6d9[_0x0e5e('0x4b')],null))['then'](respondWithResult(_0x13098a,null))[_0x0e5e('0x49')](handleError(_0x13098a,null));};exports[_0x0e5e('0x27')]=function(_0x4cd35a,_0x2b9bc2){return db[_0x0e5e('0x2d')][_0x0e5e('0x4c')]({'where':{'id':_0x4cd35a[_0x0e5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b9bc2,null))[_0x0e5e('0x26')](removeEntity(_0x2b9bc2,null))['catch'](handleError(_0x2b9bc2,null));};exports[_0x0e5e('0x4d')]=function(_0x4af255,_0x5b6dcd){return db[_0x0e5e('0x2d')][_0x0e5e('0x4d')]()[_0x0e5e('0x26')](respondWithResult(_0x5b6dcd,null))['catch'](handleError(_0x5b6dcd,null));}; \ No newline at end of file +var _0x81c6=['includeAll','include','findAll','rows','catch','show','keys','fields','length','create','body','find','params','describe','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','end','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','ChatQueueReport'];(function(_0x3b887e,_0x2f1318){var _0x22c0f4=function(_0x4bc632){while(--_0x4bc632){_0x3b887e['push'](_0x3b887e['shift']());}};_0x22c0f4(++_0x2f1318);}(_0x81c6,0x1d5));var _0x681c=function(_0x36a4f9,_0x3f5506){_0x36a4f9=_0x36a4f9-0x0;var _0x479588=_0x81c6[_0x36a4f9];return _0x479588;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x681c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x681c('0x1'));var BPromise=require(_0x681c('0x2'));var Mustache=require(_0x681c('0x3'));var util=require('util');var path=require(_0x681c('0x4'));var sox=require(_0x681c('0x5'));var csv=require(_0x681c('0x6'));var ejs=require(_0x681c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x681c('0x8'));var squel=require(_0x681c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x681c('0xa'));var toCsv=require(_0x681c('0x6'));var querystring=require(_0x681c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x681c('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x681c('0xd'));var hardwareService=require(_0x681c('0xe'));var logger=require(_0x681c('0xf'))(_0x681c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x681c('0x11'));var db=require(_0x681c('0x12'))['db'];function respondWithStatusCode(_0x2d379b,_0x50cae8){_0x50cae8=_0x50cae8||0xcc;return function(_0x2e4651){if(_0x2e4651){return _0x2d379b['sendStatus'](_0x50cae8);}return _0x2d379b[_0x681c('0x13')](_0x50cae8)['end']();};}function respondWithResult(_0x2c059e,_0x27c3a2){_0x27c3a2=_0x27c3a2||0xc8;return function(_0xe8bb4d){if(_0xe8bb4d){return _0x2c059e[_0x681c('0x13')](_0x27c3a2)[_0x681c('0x14')](_0xe8bb4d);}};}function respondWithFilteredResult(_0x2bc3fb,_0x50a4ec){return function(_0x2b0939){if(_0x2b0939){var _0x1135c9=typeof _0x50a4ec[_0x681c('0x15')]===_0x681c('0x16')&&typeof _0x50a4ec[_0x681c('0x17')]===_0x681c('0x16');var _0x4e7df2=_0x2b0939[_0x681c('0x18')];var _0x42f506=_0x1135c9?0x0:_0x50a4ec[_0x681c('0x15')];var _0x42304f=_0x1135c9?_0x2b0939['count']:_0x50a4ec[_0x681c('0x15')]+_0x50a4ec[_0x681c('0x17')];var _0x54d27f;if(_0x42304f>=_0x4e7df2){_0x42304f=_0x4e7df2;_0x54d27f=0xc8;}else{_0x54d27f=0xce;}_0x2bc3fb[_0x681c('0x13')](_0x54d27f);return _0x2bc3fb['set'](_0x681c('0x19'),_0x42f506+'-'+_0x42304f+'/'+_0x4e7df2)[_0x681c('0x14')](_0x2b0939);}return null;};}function patchUpdates(_0x11d68d){return function(_0x33c495){try{jsonpatch[_0x681c('0x1a')](_0x33c495,_0x11d68d,!![]);}catch(_0x51d626){return BPromise['reject'](_0x51d626);}return _0x33c495['save']();};}function saveUpdates(_0x2e5331,_0x39c8b7){return function(_0x3adfe3){if(_0x3adfe3){return _0x3adfe3[_0x681c('0x1b')](_0x2e5331)[_0x681c('0x1c')](function(_0x29f3fa){return _0x29f3fa;});}return null;};}function removeEntity(_0x415a0a,_0x3d0297){return function(_0x1b3d2b){if(_0x1b3d2b){return _0x1b3d2b[_0x681c('0x1d')]()[_0x681c('0x1c')](function(){_0x415a0a[_0x681c('0x13')](0xcc)[_0x681c('0x1e')]();});}};}function handleEntityNotFound(_0x218410,_0x3237ed){return function(_0x228f59){if(!_0x228f59){_0x218410['sendStatus'](0x194);}return _0x228f59;};}function handleError(_0x11063b,_0x5705a7){_0x5705a7=_0x5705a7||0x1f4;return function(_0x5f8d64){logger['error'](_0x5f8d64['stack']);if(_0x5f8d64[_0x681c('0x1f')]){delete _0x5f8d64[_0x681c('0x1f')];}_0x11063b[_0x681c('0x13')](_0x5705a7)[_0x681c('0x20')](_0x5f8d64);};}exports['index']=function(_0x3b1031,_0x39fca3){var _0x2fde4b={},_0x936fce={},_0x147cda={'count':0x0,'rows':[]};var _0x204006=_[_0x681c('0x21')](db['ChatQueueReport'][_0x681c('0x22')],function(_0x390be5){return{'name':_0x390be5[_0x681c('0x23')],'type':_0x390be5['type'][_0x681c('0x24')]};});_0x936fce[_0x681c('0x25')]=_[_0x681c('0x21')](_0x204006,'name');_0x936fce[_0x681c('0x26')]=_['keys'](_0x3b1031['query']);_0x936fce[_0x681c('0x27')]=_[_0x681c('0x28')](_0x936fce[_0x681c('0x25')],_0x936fce['query']);_0x2fde4b[_0x681c('0x29')]=_['intersection'](_0x936fce[_0x681c('0x25')],qs['fields'](_0x3b1031['query']['fields']));_0x2fde4b[_0x681c('0x29')]=_0x2fde4b[_0x681c('0x29')]['length']?_0x2fde4b[_0x681c('0x29')]:_0x936fce['model'];if(!_0x3b1031['query'][_0x681c('0x2a')]('nolimit')){_0x2fde4b[_0x681c('0x17')]=qs[_0x681c('0x17')](_0x3b1031[_0x681c('0x26')]['limit']);_0x2fde4b['offset']=qs[_0x681c('0x15')](_0x3b1031[_0x681c('0x26')]['offset']);}_0x2fde4b[_0x681c('0x2b')]=qs[_0x681c('0x2c')](_0x3b1031[_0x681c('0x26')]['sort']);_0x2fde4b[_0x681c('0x2d')]=qs[_0x681c('0x27')](_['pick'](_0x3b1031[_0x681c('0x26')],_0x936fce[_0x681c('0x27')]),_0x204006);if(_0x3b1031[_0x681c('0x26')][_0x681c('0x2e')]){_0x2fde4b[_0x681c('0x2d')]=_['merge'](_0x2fde4b['where'],{'$or':_[_0x681c('0x21')](_0x204006,function(_0x373f33){if(_0x373f33['type']!==_0x681c('0x2f')){var _0x183f13={};_0x183f13[_0x373f33['name']]={'$like':'%'+_0x3b1031[_0x681c('0x26')][_0x681c('0x2e')]+'%'};return _0x183f13;}})});}_0x2fde4b=_[_0x681c('0x30')]({},_0x2fde4b,_0x3b1031[_0x681c('0x31')]);var _0x3b258b={'where':_0x2fde4b[_0x681c('0x2d')]};return db[_0x681c('0x32')][_0x681c('0x18')](_0x3b258b)[_0x681c('0x1c')](function(_0x1ece6f){_0x147cda['count']=_0x1ece6f;if(_0x3b1031[_0x681c('0x26')][_0x681c('0x33')]){_0x2fde4b[_0x681c('0x34')]=[{'all':!![]}];}return db[_0x681c('0x32')][_0x681c('0x35')](_0x2fde4b);})[_0x681c('0x1c')](function(_0x542c02){_0x147cda[_0x681c('0x36')]=_0x542c02;return _0x147cda;})[_0x681c('0x1c')](respondWithFilteredResult(_0x39fca3,_0x2fde4b))[_0x681c('0x37')](handleError(_0x39fca3,null));};exports[_0x681c('0x38')]=function(_0x30abe8,_0x5dd2f4){var _0x2143a9={'raw':!![],'where':{'id':_0x30abe8['params']['id']}},_0x5d7031={};_0x5d7031[_0x681c('0x25')]=_[_0x681c('0x39')](db[_0x681c('0x32')][_0x681c('0x22')]);_0x5d7031['query']=_[_0x681c('0x39')](_0x30abe8['query']);_0x5d7031['filters']=_[_0x681c('0x28')](_0x5d7031[_0x681c('0x25')],_0x5d7031[_0x681c('0x26')]);_0x2143a9[_0x681c('0x29')]=_[_0x681c('0x28')](_0x5d7031[_0x681c('0x25')],qs['fields'](_0x30abe8[_0x681c('0x26')][_0x681c('0x3a')]));_0x2143a9['attributes']=_0x2143a9['attributes'][_0x681c('0x3b')]?_0x2143a9['attributes']:_0x5d7031[_0x681c('0x25')];if(_0x30abe8['query']['includeAll']){_0x2143a9['include']=[{'all':!![]}];}_0x2143a9=_[_0x681c('0x30')]({},_0x2143a9,_0x30abe8[_0x681c('0x31')]);return db[_0x681c('0x32')]['find'](_0x2143a9)[_0x681c('0x1c')](handleEntityNotFound(_0x5dd2f4,null))[_0x681c('0x1c')](respondWithResult(_0x5dd2f4,null))['catch'](handleError(_0x5dd2f4,null));};exports[_0x681c('0x3c')]=function(_0x17bb48,_0x15d1c0){return db[_0x681c('0x32')]['create'](_0x17bb48[_0x681c('0x3d')],{})['then'](respondWithResult(_0x15d1c0,0xc9))[_0x681c('0x37')](handleError(_0x15d1c0,null));};exports[_0x681c('0x1b')]=function(_0xa56f20,_0x5731f0){if(_0xa56f20[_0x681c('0x3d')]['id']){delete _0xa56f20[_0x681c('0x3d')]['id'];}return db[_0x681c('0x32')][_0x681c('0x3e')]({'where':{'id':_0xa56f20[_0x681c('0x3f')]['id']}})[_0x681c('0x1c')](handleEntityNotFound(_0x5731f0,null))[_0x681c('0x1c')](saveUpdates(_0xa56f20[_0x681c('0x3d')],null))[_0x681c('0x1c')](respondWithResult(_0x5731f0,null))[_0x681c('0x37')](handleError(_0x5731f0,null));};exports[_0x681c('0x1d')]=function(_0x37bdf6,_0x4cae41){return db[_0x681c('0x32')][_0x681c('0x3e')]({'where':{'id':_0x37bdf6['params']['id']}})[_0x681c('0x1c')](handleEntityNotFound(_0x4cae41,null))[_0x681c('0x1c')](removeEntity(_0x4cae41,null))['catch'](handleError(_0x4cae41,null));};exports[_0x681c('0x40')]=function(_0x5e58bf,_0x38daf8){return db[_0x681c('0x32')][_0x681c('0x40')]()['then'](respondWithResult(_0x38daf8,null))[_0x681c('0x37')](handleError(_0x38daf8,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 86f1d9d..762022d 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30e936,_0x35686e){var _0x4e63b5=function(_0x267fd2){while(--_0x267fd2){_0x30e936['push'](_0x30e936['shift']());}};_0x4e63b5(++_0x35686e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3bec61,_0x3a04b8){var _0x4bf6d2=function(_0x51e312){while(--_0x51e312){_0x3bec61['push'](_0x3bec61['shift']());}};_0x4bf6d2(++_0x3a04b8);}(_0xe706,0xa3));var _0x6e70=function(_0x38d92b,_0x1be181){_0x38d92b=_0x38d92b-0x0;var _0x56c746=_0xe706[_0x38d92b];return _0x56c746;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 570f8ad..b4e6193 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 _0x983a=['ChatQueueReport','create','body','options','CreateChatQueueReport','stringify','catch','update','raw','where','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x983a,0x100));var _0xa983=function(_0x287f3f,_0x38969b){_0x287f3f=_0x287f3f-0x0;var _0xc8f0ab=_0x983a[_0x287f3f];return _0xc8f0ab;};'use strict';var _=require(_0xa983('0x0'));var util=require(_0xa983('0x1'));var moment=require(_0xa983('0x2'));var BPromise=require(_0xa983('0x3'));var rs=require(_0xa983('0x4'));var fs=require('fs');var Redis=require(_0xa983('0x5'));var db=require(_0xa983('0x6'))['db'];var utils=require(_0xa983('0x7'));var logger=require(_0xa983('0x8'))('rpc');var config=require(_0xa983('0x9'));var jayson=require(_0xa983('0xa'));var client=jayson[_0xa983('0xb')][_0xa983('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9ad52a,_0x3a6956,_0x3ff6a5){return new BPromise(function(_0x5e610b,_0x4e89a9){return client[_0xa983('0xd')](_0x9ad52a,_0x3ff6a5)[_0xa983('0xe')](function(_0x340898){logger[_0xa983('0xf')](_0xa983('0x10'),_0x3a6956,'request\x20sent');logger[_0xa983('0x11')](_0xa983('0x12'),_0x3a6956,_0xa983('0x13'),JSON['stringify'](_0x340898));if(_0x340898[_0xa983('0x14')]){if(_0x340898[_0xa983('0x14')][_0xa983('0x15')]===0x1f4){logger[_0xa983('0x14')](_0xa983('0x10'),_0x3a6956,_0x340898['error'][_0xa983('0x16')]);return _0x4e89a9(_0x340898[_0xa983('0x14')][_0xa983('0x16')]);}logger[_0xa983('0x14')](_0xa983('0x10'),_0x3a6956,_0x340898[_0xa983('0x14')][_0xa983('0x16')]);return _0x5e610b(_0x340898[_0xa983('0x14')][_0xa983('0x16')]);}else{logger[_0xa983('0xf')](_0xa983('0x10'),_0x3a6956,_0xa983('0x13'));_0x5e610b(_0x340898[_0xa983('0x17')][_0xa983('0x16')]);}})['catch'](function(_0x775b06){logger[_0xa983('0x14')](_0xa983('0x10'),_0x3a6956,_0x775b06);_0x4e89a9(_0x775b06);});});}exports['CreateChatQueueReport']=function(_0x295b47){var _0xfd75d1=this;return new Promise(function(_0x2dbfb8,_0x19a62c){return db[_0xa983('0x18')][_0xa983('0x19')](_0x295b47[_0xa983('0x1a')],{'raw':_0x295b47['options']?_0x295b47[_0xa983('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x470447){logger[_0xa983('0xf')]('CreateChatQueueReport',_0x295b47);logger['debug'](_0xa983('0x1c'),_0x295b47,JSON[_0xa983('0x1d')](_0x470447));_0x2dbfb8(_0x470447);})[_0xa983('0x1e')](function(_0x5e92a8){logger[_0xa983('0x14')](_0xa983('0x1c'),_0x5e92a8[_0xa983('0x16')],_0x295b47);_0x19a62c(_0xfd75d1[_0xa983('0x14')](0x1f4,_0x5e92a8['message']));});});};exports['UpdateChatQueueReport']=function(_0x3b5dfd){var _0x5d05a9=this;return new Promise(function(_0x28a521,_0x55e6d8){return db['ChatQueueReport'][_0xa983('0x1f')](_0x3b5dfd[_0xa983('0x1a')],{'raw':_0x3b5dfd[_0xa983('0x1b')]?_0x3b5dfd['options'][_0xa983('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b5dfd[_0xa983('0x1b')]?_0x3b5dfd[_0xa983('0x1b')][_0xa983('0x21')]||null:null,'attributes':_0x3b5dfd[_0xa983('0x1b')]?_0x3b5dfd['options']['attributes']||null:null,'limit':_0x3b5dfd[_0xa983('0x1b')]?_0x3b5dfd[_0xa983('0x1b')]['limit']||null:null})['then'](function(_0x16d199){logger['info'](_0xa983('0x22'),_0x3b5dfd);logger[_0xa983('0x11')]('UpdateChatQueueReport',_0x3b5dfd,JSON[_0xa983('0x1d')](_0x16d199));_0x28a521(_0x16d199);})[_0xa983('0x1e')](function(_0x520ccf){logger[_0xa983('0x14')](_0xa983('0x22'),_0x520ccf['message'],_0x3b5dfd);_0x55e6d8(_0x5d05a9[_0xa983('0x14')](0x1f4,_0x520ccf[_0xa983('0x16')]));});});}; \ No newline at end of file +var _0xe5a9=['code','message','info','result','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','UpdateChatQueueReport','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xe5a9,0x9e));var _0x9e5a=function(_0x261b1f,_0x594b1f){_0x261b1f=_0x261b1f-0x0;var _0x56529a=_0xe5a9[_0x261b1f];return _0x56529a;};'use strict';var _=require('lodash');var util=require(_0x9e5a('0x0'));var moment=require(_0x9e5a('0x1'));var BPromise=require(_0x9e5a('0x2'));var rs=require(_0x9e5a('0x3'));var fs=require('fs');var Redis=require(_0x9e5a('0x4'));var db=require(_0x9e5a('0x5'))['db'];var utils=require(_0x9e5a('0x6'));var logger=require('../../config/logger')(_0x9e5a('0x7'));var config=require(_0x9e5a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24ec01,_0x13029f,_0x41f12c){return new BPromise(function(_0x4a57bb,_0x19b3d7){return client[_0x9e5a('0x9')](_0x24ec01,_0x41f12c)[_0x9e5a('0xa')](function(_0x325b5c){logger['info'](_0x9e5a('0xb'),_0x13029f,_0x9e5a('0xc'));logger[_0x9e5a('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x13029f,'request\x20sent',JSON[_0x9e5a('0xe')](_0x325b5c));if(_0x325b5c['error']){if(_0x325b5c[_0x9e5a('0xf')][_0x9e5a('0x10')]===0x1f4){logger[_0x9e5a('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x13029f,_0x325b5c[_0x9e5a('0xf')][_0x9e5a('0x11')]);return _0x19b3d7(_0x325b5c[_0x9e5a('0xf')]['message']);}logger[_0x9e5a('0xf')](_0x9e5a('0xb'),_0x13029f,_0x325b5c['error'][_0x9e5a('0x11')]);return _0x4a57bb(_0x325b5c[_0x9e5a('0xf')][_0x9e5a('0x11')]);}else{logger[_0x9e5a('0x12')](_0x9e5a('0xb'),_0x13029f,_0x9e5a('0xc'));_0x4a57bb(_0x325b5c[_0x9e5a('0x13')][_0x9e5a('0x11')]);}})[_0x9e5a('0x14')](function(_0x36536e){logger[_0x9e5a('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x13029f,_0x36536e);_0x19b3d7(_0x36536e);});});}exports['CreateChatQueueReport']=function(_0x108965){var _0x236ddf=this;return new Promise(function(_0x3e0714,_0x5c2829){return db[_0x9e5a('0x15')][_0x9e5a('0x16')](_0x108965[_0x9e5a('0x17')],{'raw':_0x108965['options']?_0x108965[_0x9e5a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9e5a('0xa')](function(_0xf3b052){logger['info']('CreateChatQueueReport',_0x108965);logger[_0x9e5a('0xd')](_0x9e5a('0x19'),_0x108965,JSON[_0x9e5a('0xe')](_0xf3b052));_0x3e0714(_0xf3b052);})[_0x9e5a('0x14')](function(_0x2ac1a1){logger['error']('CreateChatQueueReport',_0x2ac1a1[_0x9e5a('0x11')],_0x108965);_0x5c2829(_0x236ddf['error'](0x1f4,_0x2ac1a1[_0x9e5a('0x11')]));});});};exports[_0x9e5a('0x1a')]=function(_0x343662){var _0x5d9de8=this;return new Promise(function(_0x53c94f,_0x160373){return db[_0x9e5a('0x15')]['update'](_0x343662[_0x9e5a('0x17')],{'raw':_0x343662[_0x9e5a('0x18')]?_0x343662[_0x9e5a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x343662[_0x9e5a('0x18')]?_0x343662[_0x9e5a('0x18')][_0x9e5a('0x1b')]||null:null,'attributes':_0x343662['options']?_0x343662[_0x9e5a('0x18')][_0x9e5a('0x1c')]||null:null,'limit':_0x343662[_0x9e5a('0x18')]?_0x343662['options']['limit']||null:null})[_0x9e5a('0xa')](function(_0x43da83){logger[_0x9e5a('0x12')](_0x9e5a('0x1a'),_0x343662);logger['debug'](_0x9e5a('0x1a'),_0x343662,JSON[_0x9e5a('0xe')](_0x43da83));_0x53c94f(_0x43da83);})[_0x9e5a('0x14')](function(_0xb5f88d){logger[_0x9e5a('0xf')](_0x9e5a('0x1a'),_0xb5f88d['message'],_0x343662);_0x160373(_0x5d9de8['error'](0x1f4,_0xb5f88d['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index c9d1823..988fb72 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 _0x0b44=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','post','create','put','/:id','update'];(function(_0x553703,_0x11a3a7){var _0x42b8af=function(_0x532b60){while(--_0x532b60){_0x553703['push'](_0x553703['shift']());}};_0x42b8af(++_0x11a3a7);}(_0x0b44,0x1e2));var _0x40b4=function(_0x50b67d,_0x326fbe){_0x50b67d=_0x50b67d-0x0;var _0x54f773=_0x0b44[_0x50b67d];return _0x54f773;};'use strict';var multer=require(_0x40b4('0x0'));var util=require('util');var path=require(_0x40b4('0x1'));var timeout=require(_0x40b4('0x2'));var express=require(_0x40b4('0x3'));var router=express[_0x40b4('0x4')]();var fs_extra=require(_0x40b4('0x5'));var auth=require(_0x40b4('0x6'));var interaction=require(_0x40b4('0x7'));var config=require(_0x40b4('0x8'));var controller=require(_0x40b4('0x9'));router[_0x40b4('0xa')]('/',auth[_0x40b4('0xb')](),controller['index']);router[_0x40b4('0xa')]('/describe',auth[_0x40b4('0xb')](),controller[_0x40b4('0xc')]);router[_0x40b4('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x40b4('0xd')]('/',auth['isAuthenticated'](),controller[_0x40b4('0xe')]);router[_0x40b4('0xf')](_0x40b4('0x10'),auth[_0x40b4('0xb')](),controller[_0x40b4('0x11')]);router['delete'](_0x40b4('0x10'),auth['isAuthenticated'](),controller[_0x40b4('0x12')]);module[_0x40b4('0x13')]=router; \ No newline at end of file +var _0xd0fc=['create','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xd0fc,0x1a7));var _0xcd0f=function(_0x287f7d,_0x413df4){_0x287f7d=_0x287f7d-0x0;var _0x2eb773=_0xd0fc[_0x287f7d];return _0x2eb773;};'use strict';var multer=require(_0xcd0f('0x0'));var util=require(_0xcd0f('0x1'));var path=require(_0xcd0f('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd0f('0x3'));var router=express[_0xcd0f('0x4')]();var fs_extra=require(_0xcd0f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd0f('0x6'));var config=require(_0xcd0f('0x7'));var controller=require(_0xcd0f('0x8'));router[_0xcd0f('0x9')]('/',auth['isAuthenticated'](),controller[_0xcd0f('0xa')]);router['get'](_0xcd0f('0xb'),auth[_0xcd0f('0xc')](),controller[_0xcd0f('0xd')]);router[_0xcd0f('0x9')](_0xcd0f('0xe'),auth[_0xcd0f('0xc')](),controller[_0xcd0f('0xf')]);router[_0xcd0f('0x10')]('/',auth[_0xcd0f('0xc')](),controller[_0xcd0f('0x11')]);router['put'](_0xcd0f('0xe'),auth[_0xcd0f('0xc')](),controller['update']);router['delete'](_0xcd0f('0xe'),auth[_0xcd0f('0xc')](),controller[_0xcd0f('0x12')]);module[_0xcd0f('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 b72b34a..55398d1 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5054da,_0x217daf){var _0x76c47b=function(_0x2fedc8){while(--_0x2fedc8){_0x5054da['push'](_0x5054da['shift']());}};_0x76c47b(++_0x217daf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3e5e03,_0x2fac27){var _0x45279e=function(_0xb0f1c8){while(--_0xb0f1c8){_0x3e5e03['push'](_0x3e5e03['shift']());}};_0x45279e(++_0x2fac27);}(_0x54ef,0x112));var _0xf54e=function(_0x4ba848,_0x1adb39){_0x4ba848=_0x4ba848-0x0;var _0x48f292=_0x54ef[_0x4ba848];return _0x48f292;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index cbd18c5..7d56324 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 _0x9147=['create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','index','map','ChatTransferReport','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch'];(function(_0x203dae,_0x2cf314){var _0x4db8c5=function(_0x201ed){while(--_0x201ed){_0x203dae['push'](_0x203dae['shift']());}};_0x4db8c5(++_0x2cf314);}(_0x9147,0x1d3));var _0x7914=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x9147[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0x7914('0x0'));var rimraf=require(_0x7914('0x1'));var zipdir=require(_0x7914('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7914('0x3'));var moment=require(_0x7914('0x4'));var BPromise=require(_0x7914('0x5'));var Mustache=require(_0x7914('0x6'));var util=require(_0x7914('0x7'));var path=require('path');var sox=require(_0x7914('0x8'));var csv=require('to-csv');var ejs=require(_0x7914('0x9'));var fs=require('fs');var fs_extra=require(_0x7914('0xa'));var _=require(_0x7914('0xb'));var squel=require('squel');var crypto=require(_0x7914('0xc'));var jsforce=require(_0x7914('0xd'));var deskjs=require(_0x7914('0xe'));var toCsv=require(_0x7914('0xf'));var querystring=require(_0x7914('0x10'));var Papa=require(_0x7914('0x11'));var Redis=require(_0x7914('0x12'));var authService=require(_0x7914('0x13'));var qs=require(_0x7914('0x14'));var as=require(_0x7914('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7914('0x16'))(_0x7914('0x17'));var utils=require('../../config/utils');var config=require(_0x7914('0x18'));var licenseUtil=require(_0x7914('0x19'));var db=require(_0x7914('0x1a'))['db'];function respondWithStatusCode(_0xd9e4bc,_0x19a065){_0x19a065=_0x19a065||0xcc;return function(_0x17789f){if(_0x17789f){return _0xd9e4bc['sendStatus'](_0x19a065);}return _0xd9e4bc[_0x7914('0x1b')](_0x19a065)[_0x7914('0x1c')]();};}function respondWithResult(_0x18a515,_0x2d3bde){_0x2d3bde=_0x2d3bde||0xc8;return function(_0x38f970){if(_0x38f970){return _0x18a515[_0x7914('0x1b')](_0x2d3bde)[_0x7914('0x1d')](_0x38f970);}};}function respondWithFilteredResult(_0x5be0da,_0x5a6a62){return function(_0x441fde){if(_0x441fde){var _0x540d94=typeof _0x5a6a62['offset']===_0x7914('0x1e')&&typeof _0x5a6a62[_0x7914('0x1f')]===_0x7914('0x1e');var _0x254d6a=_0x441fde['count'];var _0x273dad=_0x540d94?0x0:_0x5a6a62[_0x7914('0x20')];var _0x3bde1c=_0x540d94?_0x441fde[_0x7914('0x21')]:_0x5a6a62[_0x7914('0x20')]+_0x5a6a62[_0x7914('0x1f')];var _0x2f7367;if(_0x3bde1c>=_0x254d6a){_0x3bde1c=_0x254d6a;_0x2f7367=0xc8;}else{_0x2f7367=0xce;}_0x5be0da[_0x7914('0x1b')](_0x2f7367);return _0x5be0da[_0x7914('0x22')](_0x7914('0x23'),_0x273dad+'-'+_0x3bde1c+'/'+_0x254d6a)[_0x7914('0x1d')](_0x441fde);}return null;};}function patchUpdates(_0x3d3cbc){return function(_0x101410){try{jsonpatch[_0x7914('0x24')](_0x101410,_0x3d3cbc,!![]);}catch(_0x4ca868){return BPromise['reject'](_0x4ca868);}return _0x101410[_0x7914('0x25')]();};}function saveUpdates(_0xe593c6,_0x3da896){return function(_0x29f105){if(_0x29f105){return _0x29f105['update'](_0xe593c6)[_0x7914('0x26')](function(_0x4be7ea){return _0x4be7ea;});}return null;};}function removeEntity(_0x4e1a5f,_0x3e1b61){return function(_0x4b4e81){if(_0x4b4e81){return _0x4b4e81[_0x7914('0x27')]()['then'](function(){_0x4e1a5f[_0x7914('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598c49,_0x2c651e){return function(_0x1eac97){if(!_0x1eac97){_0x598c49[_0x7914('0x28')](0x194);}return _0x1eac97;};}function handleError(_0x1bc71d,_0x5c7a74){_0x5c7a74=_0x5c7a74||0x1f4;return function(_0x3d6f0b){logger[_0x7914('0x29')](_0x3d6f0b['stack']);if(_0x3d6f0b[_0x7914('0x2a')]){delete _0x3d6f0b[_0x7914('0x2a')];}_0x1bc71d[_0x7914('0x1b')](_0x5c7a74)['send'](_0x3d6f0b);};}exports[_0x7914('0x2b')]=function(_0x1e606f,_0x2eba8c){var _0x209448={},_0x287b87={},_0x450e2e={'count':0x0,'rows':[]};var _0x17e951=_[_0x7914('0x2c')](db[_0x7914('0x2d')]['rawAttributes'],function(_0x22b138){return{'name':_0x22b138['fieldName'],'type':_0x22b138[_0x7914('0x2e')][_0x7914('0x2f')]};});_0x287b87['model']=_[_0x7914('0x2c')](_0x17e951,'name');_0x287b87[_0x7914('0x30')]=_['keys'](_0x1e606f[_0x7914('0x30')]);_0x287b87['filters']=_[_0x7914('0x31')](_0x287b87[_0x7914('0x32')],_0x287b87['query']);_0x209448[_0x7914('0x33')]=_[_0x7914('0x31')](_0x287b87['model'],qs[_0x7914('0x34')](_0x1e606f[_0x7914('0x30')]['fields']));_0x209448[_0x7914('0x33')]=_0x209448[_0x7914('0x33')][_0x7914('0x35')]?_0x209448[_0x7914('0x33')]:_0x287b87['model'];if(!_0x1e606f[_0x7914('0x30')][_0x7914('0x36')](_0x7914('0x37'))){_0x209448['limit']=qs[_0x7914('0x1f')](_0x1e606f[_0x7914('0x30')][_0x7914('0x1f')]);_0x209448[_0x7914('0x20')]=qs['offset'](_0x1e606f['query']['offset']);}_0x209448[_0x7914('0x38')]=qs[_0x7914('0x39')](_0x1e606f[_0x7914('0x30')]['sort']);_0x209448['where']=qs[_0x7914('0x3a')](_[_0x7914('0x3b')](_0x1e606f[_0x7914('0x30')],_0x287b87[_0x7914('0x3a')]),_0x17e951);if(_0x1e606f[_0x7914('0x30')]['filter']){_0x209448[_0x7914('0x3c')]=_['merge'](_0x209448[_0x7914('0x3c')],{'$or':_['map'](_0x17e951,function(_0x32099a){if(_0x32099a[_0x7914('0x2e')]!=='VIRTUAL'){var _0x2e229c={};_0x2e229c[_0x32099a[_0x7914('0x2a')]]={'$like':'%'+_0x1e606f['query'][_0x7914('0x3d')]+'%'};return _0x2e229c;}})});}_0x209448=_[_0x7914('0x3e')]({},_0x209448,_0x1e606f[_0x7914('0x3f')]);var _0xc9e178={'where':_0x209448['where']};return db[_0x7914('0x2d')][_0x7914('0x21')](_0xc9e178)[_0x7914('0x26')](function(_0x28511d){_0x450e2e[_0x7914('0x21')]=_0x28511d;if(_0x1e606f[_0x7914('0x30')][_0x7914('0x40')]){_0x209448[_0x7914('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x7914('0x42')](_0x209448);})[_0x7914('0x26')](function(_0x82a15d){_0x450e2e[_0x7914('0x43')]=_0x82a15d;return _0x450e2e;})['then'](respondWithFilteredResult(_0x2eba8c,_0x209448))['catch'](handleError(_0x2eba8c,null));};exports[_0x7914('0x44')]=function(_0x1c173c,_0x47da2f){var _0x4e32dc={'raw':!![],'where':{'id':_0x1c173c['params']['id']}},_0x5a4e88={};_0x5a4e88['model']=_['keys'](db[_0x7914('0x2d')][_0x7914('0x45')]);_0x5a4e88['query']=_['keys'](_0x1c173c[_0x7914('0x30')]);_0x5a4e88['filters']=_[_0x7914('0x31')](_0x5a4e88[_0x7914('0x32')],_0x5a4e88['query']);_0x4e32dc[_0x7914('0x33')]=_[_0x7914('0x31')](_0x5a4e88['model'],qs[_0x7914('0x34')](_0x1c173c[_0x7914('0x30')][_0x7914('0x34')]));_0x4e32dc[_0x7914('0x33')]=_0x4e32dc[_0x7914('0x33')]['length']?_0x4e32dc[_0x7914('0x33')]:_0x5a4e88[_0x7914('0x32')];if(_0x1c173c['query'][_0x7914('0x40')]){_0x4e32dc[_0x7914('0x41')]=[{'all':!![]}];}_0x4e32dc=_[_0x7914('0x3e')]({},_0x4e32dc,_0x1c173c[_0x7914('0x3f')]);return db[_0x7914('0x2d')][_0x7914('0x46')](_0x4e32dc)[_0x7914('0x26')](handleEntityNotFound(_0x47da2f,null))['then'](respondWithResult(_0x47da2f,null))[_0x7914('0x47')](handleError(_0x47da2f,null));};exports[_0x7914('0x48')]=function(_0x2fecee,_0xd84b66){return db[_0x7914('0x2d')][_0x7914('0x48')](_0x2fecee[_0x7914('0x49')],{})[_0x7914('0x26')](respondWithResult(_0xd84b66,0xc9))[_0x7914('0x47')](handleError(_0xd84b66,null));};exports[_0x7914('0x4a')]=function(_0xe24291,_0x1486ed){if(_0xe24291[_0x7914('0x49')]['id']){delete _0xe24291[_0x7914('0x49')]['id'];}return db[_0x7914('0x2d')][_0x7914('0x46')]({'where':{'id':_0xe24291['params']['id']}})['then'](handleEntityNotFound(_0x1486ed,null))[_0x7914('0x26')](saveUpdates(_0xe24291['body'],null))[_0x7914('0x26')](respondWithResult(_0x1486ed,null))['catch'](handleError(_0x1486ed,null));};exports[_0x7914('0x27')]=function(_0x43002b,_0x17e1b9){return db[_0x7914('0x2d')][_0x7914('0x46')]({'where':{'id':_0x43002b[_0x7914('0x4b')]['id']}})[_0x7914('0x26')](handleEntityNotFound(_0x17e1b9,null))[_0x7914('0x26')](removeEntity(_0x17e1b9,null))[_0x7914('0x47')](handleError(_0x17e1b9,null));};exports[_0x7914('0x4c')]=function(_0x2a5393,_0x358a1e){return db[_0x7914('0x2d')][_0x7914('0x4c')]()[_0x7914('0x26')](respondWithResult(_0x358a1e,null))[_0x7914('0x47')](handleError(_0x358a1e,null));}; \ No newline at end of file +var _0x36df=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','ChatTransferReport','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x5dcc2e,_0x4c34fe){var _0x1aa7b7=function(_0x46f75d){while(--_0x46f75d){_0x5dcc2e['push'](_0x5dcc2e['shift']());}};_0x1aa7b7(++_0x4c34fe);}(_0x36df,0xd7));var _0xf36d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x36df[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xf36d('0x0'));var rimraf=require(_0xf36d('0x1'));var zipdir=require(_0xf36d('0x2'));var jsonpatch=require(_0xf36d('0x3'));var rp=require(_0xf36d('0x4'));var moment=require(_0xf36d('0x5'));var BPromise=require(_0xf36d('0x6'));var Mustache=require(_0xf36d('0x7'));var util=require('util');var path=require(_0xf36d('0x8'));var sox=require('sox');var csv=require(_0xf36d('0x9'));var ejs=require(_0xf36d('0xa'));var fs=require('fs');var fs_extra=require(_0xf36d('0xb'));var _=require(_0xf36d('0xc'));var squel=require('squel');var crypto=require(_0xf36d('0xd'));var jsforce=require(_0xf36d('0xe'));var deskjs=require(_0xf36d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf36d('0x10'));var Redis=require('ioredis');var authService=require(_0xf36d('0x11'));var qs=require(_0xf36d('0x12'));var as=require(_0xf36d('0x13'));var hardwareService=require(_0xf36d('0x14'));var logger=require(_0xf36d('0x15'))(_0xf36d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf36d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a2998,_0x4f4116){_0x4f4116=_0x4f4116||0xcc;return function(_0x2b368a){if(_0x2b368a){return _0x2a2998[_0xf36d('0x18')](_0x4f4116);}return _0x2a2998[_0xf36d('0x19')](_0x4f4116)[_0xf36d('0x1a')]();};}function respondWithResult(_0x191fcc,_0x1a8068){_0x1a8068=_0x1a8068||0xc8;return function(_0x175544){if(_0x175544){return _0x191fcc[_0xf36d('0x19')](_0x1a8068)[_0xf36d('0x1b')](_0x175544);}};}function respondWithFilteredResult(_0x55b326,_0x18bc19){return function(_0x4e433b){if(_0x4e433b){var _0x3c4f38=typeof _0x18bc19[_0xf36d('0x1c')]===_0xf36d('0x1d')&&typeof _0x18bc19['limit']===_0xf36d('0x1d');var _0x568e77=_0x4e433b[_0xf36d('0x1e')];var _0x8a9e10=_0x3c4f38?0x0:_0x18bc19[_0xf36d('0x1c')];var _0x55b6c2=_0x3c4f38?_0x4e433b[_0xf36d('0x1e')]:_0x18bc19[_0xf36d('0x1c')]+_0x18bc19[_0xf36d('0x1f')];var _0x2f47a0;if(_0x55b6c2>=_0x568e77){_0x55b6c2=_0x568e77;_0x2f47a0=0xc8;}else{_0x2f47a0=0xce;}_0x55b326[_0xf36d('0x19')](_0x2f47a0);return _0x55b326[_0xf36d('0x20')](_0xf36d('0x21'),_0x8a9e10+'-'+_0x55b6c2+'/'+_0x568e77)['json'](_0x4e433b);}return null;};}function patchUpdates(_0x14d666){return function(_0x4c0271){try{jsonpatch[_0xf36d('0x22')](_0x4c0271,_0x14d666,!![]);}catch(_0x5613b1){return BPromise[_0xf36d('0x23')](_0x5613b1);}return _0x4c0271[_0xf36d('0x24')]();};}function saveUpdates(_0x19b886,_0x454388){return function(_0x4373c4){if(_0x4373c4){return _0x4373c4[_0xf36d('0x25')](_0x19b886)[_0xf36d('0x26')](function(_0x5f4fff){return _0x5f4fff;});}return null;};}function removeEntity(_0x34410d,_0x4d9db2){return function(_0x56eaee){if(_0x56eaee){return _0x56eaee[_0xf36d('0x27')]()[_0xf36d('0x26')](function(){_0x34410d[_0xf36d('0x19')](0xcc)[_0xf36d('0x1a')]();});}};}function handleEntityNotFound(_0x4b632f,_0x50ce0d){return function(_0xa07e40){if(!_0xa07e40){_0x4b632f[_0xf36d('0x18')](0x194);}return _0xa07e40;};}function handleError(_0x2f680f,_0x338bb9){_0x338bb9=_0x338bb9||0x1f4;return function(_0x45fc92){logger['error'](_0x45fc92[_0xf36d('0x28')]);if(_0x45fc92[_0xf36d('0x29')]){delete _0x45fc92[_0xf36d('0x29')];}_0x2f680f['status'](_0x338bb9)[_0xf36d('0x2a')](_0x45fc92);};}exports['index']=function(_0x34a0c0,_0x53d6b0){var _0x57509f={},_0x16c6db={},_0x3418e0={'count':0x0,'rows':[]};var _0x437a4f=_['map'](db['ChatTransferReport'][_0xf36d('0x2b')],function(_0xfc6612){return{'name':_0xfc6612[_0xf36d('0x2c')],'type':_0xfc6612[_0xf36d('0x2d')][_0xf36d('0x2e')]};});_0x16c6db['model']=_[_0xf36d('0x2f')](_0x437a4f,_0xf36d('0x29'));_0x16c6db[_0xf36d('0x30')]=_[_0xf36d('0x31')](_0x34a0c0[_0xf36d('0x30')]);_0x16c6db['filters']=_[_0xf36d('0x32')](_0x16c6db[_0xf36d('0x33')],_0x16c6db[_0xf36d('0x30')]);_0x57509f['attributes']=_[_0xf36d('0x32')](_0x16c6db['model'],qs['fields'](_0x34a0c0[_0xf36d('0x30')][_0xf36d('0x34')]));_0x57509f[_0xf36d('0x35')]=_0x57509f['attributes'][_0xf36d('0x36')]?_0x57509f[_0xf36d('0x35')]:_0x16c6db[_0xf36d('0x33')];if(!_0x34a0c0[_0xf36d('0x30')][_0xf36d('0x37')](_0xf36d('0x38'))){_0x57509f[_0xf36d('0x1f')]=qs[_0xf36d('0x1f')](_0x34a0c0['query']['limit']);_0x57509f[_0xf36d('0x1c')]=qs['offset'](_0x34a0c0['query'][_0xf36d('0x1c')]);}_0x57509f[_0xf36d('0x39')]=qs[_0xf36d('0x3a')](_0x34a0c0['query'][_0xf36d('0x3a')]);_0x57509f[_0xf36d('0x3b')]=qs[_0xf36d('0x3c')](_[_0xf36d('0x3d')](_0x34a0c0[_0xf36d('0x30')],_0x16c6db['filters']),_0x437a4f);if(_0x34a0c0['query']['filter']){_0x57509f[_0xf36d('0x3b')]=_['merge'](_0x57509f[_0xf36d('0x3b')],{'$or':_[_0xf36d('0x2f')](_0x437a4f,function(_0x5bd268){if(_0x5bd268[_0xf36d('0x2d')]!==_0xf36d('0x3e')){var _0x1601c0={};_0x1601c0[_0x5bd268[_0xf36d('0x29')]]={'$like':'%'+_0x34a0c0[_0xf36d('0x30')]['filter']+'%'};return _0x1601c0;}})});}_0x57509f=_[_0xf36d('0x3f')]({},_0x57509f,_0x34a0c0[_0xf36d('0x40')]);var _0x51b380={'where':_0x57509f['where']};return db[_0xf36d('0x41')][_0xf36d('0x1e')](_0x51b380)['then'](function(_0x334bac){_0x3418e0['count']=_0x334bac;if(_0x34a0c0[_0xf36d('0x30')][_0xf36d('0x42')]){_0x57509f[_0xf36d('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xf36d('0x44')](_0x57509f);})[_0xf36d('0x26')](function(_0x52f21a){_0x3418e0[_0xf36d('0x45')]=_0x52f21a;return _0x3418e0;})[_0xf36d('0x26')](respondWithFilteredResult(_0x53d6b0,_0x57509f))['catch'](handleError(_0x53d6b0,null));};exports[_0xf36d('0x46')]=function(_0x142a73,_0x32d06f){var _0x220a9c={'raw':!![],'where':{'id':_0x142a73[_0xf36d('0x47')]['id']}},_0x5cd1da={};_0x5cd1da[_0xf36d('0x33')]=_[_0xf36d('0x31')](db[_0xf36d('0x41')][_0xf36d('0x2b')]);_0x5cd1da[_0xf36d('0x30')]=_[_0xf36d('0x31')](_0x142a73[_0xf36d('0x30')]);_0x5cd1da[_0xf36d('0x3c')]=_[_0xf36d('0x32')](_0x5cd1da['model'],_0x5cd1da[_0xf36d('0x30')]);_0x220a9c[_0xf36d('0x35')]=_[_0xf36d('0x32')](_0x5cd1da[_0xf36d('0x33')],qs[_0xf36d('0x34')](_0x142a73[_0xf36d('0x30')][_0xf36d('0x34')]));_0x220a9c[_0xf36d('0x35')]=_0x220a9c[_0xf36d('0x35')][_0xf36d('0x36')]?_0x220a9c['attributes']:_0x5cd1da[_0xf36d('0x33')];if(_0x142a73[_0xf36d('0x30')][_0xf36d('0x42')]){_0x220a9c['include']=[{'all':!![]}];}_0x220a9c=_[_0xf36d('0x3f')]({},_0x220a9c,_0x142a73[_0xf36d('0x40')]);return db[_0xf36d('0x41')][_0xf36d('0x48')](_0x220a9c)['then'](handleEntityNotFound(_0x32d06f,null))[_0xf36d('0x26')](respondWithResult(_0x32d06f,null))['catch'](handleError(_0x32d06f,null));};exports[_0xf36d('0x49')]=function(_0x1e2907,_0x2c3e0c){return db[_0xf36d('0x41')]['create'](_0x1e2907[_0xf36d('0x4a')],{})[_0xf36d('0x26')](respondWithResult(_0x2c3e0c,0xc9))[_0xf36d('0x4b')](handleError(_0x2c3e0c,null));};exports[_0xf36d('0x25')]=function(_0x21fc7e,_0xefdf3c){if(_0x21fc7e[_0xf36d('0x4a')]['id']){delete _0x21fc7e['body']['id'];}return db[_0xf36d('0x41')][_0xf36d('0x48')]({'where':{'id':_0x21fc7e[_0xf36d('0x47')]['id']}})[_0xf36d('0x26')](handleEntityNotFound(_0xefdf3c,null))['then'](saveUpdates(_0x21fc7e[_0xf36d('0x4a')],null))['then'](respondWithResult(_0xefdf3c,null))[_0xf36d('0x4b')](handleError(_0xefdf3c,null));};exports[_0xf36d('0x27')]=function(_0x530867,_0x20bff7){return db[_0xf36d('0x41')]['find']({'where':{'id':_0x530867[_0xf36d('0x47')]['id']}})['then'](handleEntityNotFound(_0x20bff7,null))[_0xf36d('0x26')](removeEntity(_0x20bff7,null))[_0xf36d('0x4b')](handleError(_0x20bff7,null));};exports['describe']=function(_0x565385,_0x328b9b){return db[_0xf36d('0x41')][_0xf36d('0x4c')]()['then'](respondWithResult(_0x328b9b,null))[_0xf36d('0x4b')](handleError(_0x328b9b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 70ed1c1..29d0a38 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 _0xa4e5=['../../config/logger','api','moment','bluebird','request-promise','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x99583f,_0x4466cc){var _0x27f9d6=function(_0x53c639){while(--_0x53c639){_0x99583f['push'](_0x99583f['shift']());}};_0x27f9d6(++_0x4466cc);}(_0xa4e5,0x1b8));var _0x5a4e=function(_0x4ceca3,_0x56e3c4){_0x4ceca3=_0x4ceca3-0x0;var _0x5dd7c7=_0xa4e5[_0x4ceca3];return _0x5dd7c7;};'use strict';var _=require(_0x5a4e('0x0'));var util=require(_0x5a4e('0x1'));var logger=require(_0x5a4e('0x2'))(_0x5a4e('0x3'));var moment=require(_0x5a4e('0x4'));var BPromise=require(_0x5a4e('0x5'));var rp=require(_0x5a4e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a4e('0x7'));module[_0x5a4e('0x8')]=function(_0x1270ae,_0x2856a6){return _0x1270ae[_0x5a4e('0x9')](_0x5a4e('0xa'),attributes,{'tableName':_0x5a4e('0xb'),'paranoid':![],'indexes':[{'name':_0x5a4e('0xc'),'fields':[_0x5a4e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a5b=['report_chat_transfer','uniqueid','lodash','util','api','bluebird','request-promise','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x9a5b,0xff));var _0xb9a5=function(_0x4ac34e,_0x2cbe6b){_0x4ac34e=_0x4ac34e-0x0;var _0x2da383=_0x9a5b[_0x4ac34e];return _0x2da383;};'use strict';var _=require(_0xb9a5('0x0'));var util=require(_0xb9a5('0x1'));var logger=require('../../config/logger')(_0xb9a5('0x2'));var moment=require('moment');var BPromise=require(_0xb9a5('0x3'));var rp=require(_0xb9a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb9a5('0x5'));module[_0xb9a5('0x6')]=function(_0x13cbf4,_0x5691f9){return _0x13cbf4[_0xb9a5('0x7')](_0xb9a5('0x8'),attributes,{'tableName':_0xb9a5('0x9'),'paranoid':![],'indexes':[{'name':_0xb9a5('0xa'),'fields':[_0xb9a5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 566c454..75e7cca 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 _0x0097=['ChatTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0xb281ac,_0x46fc25){var _0x21230a=function(_0x3d075c){while(--_0x3d075c){_0xb281ac['push'](_0xb281ac['shift']());}};_0x21230a(++_0x46fc25);}(_0x0097,0x83));var _0x7009=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0097[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7009('0x0'));var moment=require(_0x7009('0x1'));var BPromise=require(_0x7009('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7009('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7009('0x4'))('rpc');var config=require(_0x7009('0x5'));var jayson=require(_0x7009('0x6'));var client=jayson[_0x7009('0x7')][_0x7009('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1334a8,_0x70df48,_0x18328e){return new BPromise(function(_0x1d4110,_0x45552a){return client['request'](_0x1334a8,_0x18328e)[_0x7009('0x9')](function(_0x310ea8){logger[_0x7009('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x70df48,'request\x20sent');logger[_0x7009('0xb')](_0x7009('0xc'),_0x70df48,'request\x20sent',JSON[_0x7009('0xd')](_0x310ea8));if(_0x310ea8['error']){if(_0x310ea8['error'][_0x7009('0xe')]===0x1f4){logger[_0x7009('0xf')](_0x7009('0x10'),_0x70df48,_0x310ea8[_0x7009('0xf')]['message']);return _0x45552a(_0x310ea8[_0x7009('0xf')][_0x7009('0x11')]);}logger['error'](_0x7009('0x10'),_0x70df48,_0x310ea8[_0x7009('0xf')][_0x7009('0x11')]);return _0x1d4110(_0x310ea8['error'][_0x7009('0x11')]);}else{logger[_0x7009('0xa')](_0x7009('0x10'),_0x70df48,_0x7009('0x12'));_0x1d4110(_0x310ea8[_0x7009('0x13')][_0x7009('0x11')]);}})[_0x7009('0x14')](function(_0x5a36b1){logger[_0x7009('0xf')](_0x7009('0x10'),_0x70df48,_0x5a36b1);_0x45552a(_0x5a36b1);});});} \ No newline at end of file +var _0xa594=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x34b564,_0x560b6c){var _0xb48828=function(_0x4c15d9){while(--_0x4c15d9){_0x34b564['push'](_0x34b564['shift']());}};_0xb48828(++_0x560b6c);}(_0xa594,0x1f0));var _0x4a59=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0xa594[_0x560448];return _0x550276;};'use strict';var _=require(_0x4a59('0x0'));var util=require(_0x4a59('0x1'));var moment=require(_0x4a59('0x2'));var BPromise=require(_0x4a59('0x3'));var rs=require(_0x4a59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a59('0x5'))['db'];var utils=require(_0x4a59('0x6'));var logger=require('../../config/logger')(_0x4a59('0x7'));var config=require(_0x4a59('0x8'));var jayson=require(_0x4a59('0x9'));var client=jayson[_0x4a59('0xa')][_0x4a59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x493e35,_0x462ce1,_0x537062){return new BPromise(function(_0x3488ab,_0x34f077){return client[_0x4a59('0xc')](_0x493e35,_0x537062)[_0x4a59('0xd')](function(_0x45f6b9){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x462ce1,_0x4a59('0xe'));logger[_0x4a59('0xf')](_0x4a59('0x10'),_0x462ce1,'request\x20sent',JSON[_0x4a59('0x11')](_0x45f6b9));if(_0x45f6b9[_0x4a59('0x12')]){if(_0x45f6b9[_0x4a59('0x12')]['code']===0x1f4){logger[_0x4a59('0x12')](_0x4a59('0x13'),_0x462ce1,_0x45f6b9[_0x4a59('0x12')][_0x4a59('0x14')]);return _0x34f077(_0x45f6b9[_0x4a59('0x12')]['message']);}logger[_0x4a59('0x12')](_0x4a59('0x13'),_0x462ce1,_0x45f6b9[_0x4a59('0x12')][_0x4a59('0x14')]);return _0x3488ab(_0x45f6b9[_0x4a59('0x12')][_0x4a59('0x14')]);}else{logger[_0x4a59('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x462ce1,'request\x20sent');_0x3488ab(_0x45f6b9[_0x4a59('0x16')]['message']);}})[_0x4a59('0x17')](function(_0x34ef54){logger[_0x4a59('0x12')](_0x4a59('0x13'),_0x462ce1,_0x34ef54);_0x34f077(_0x34ef54);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 50e12b5..0310219 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 _0x188c=['/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/describe'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x188c,0xc6));var _0xc188=function(_0x163eda,_0x4038dc){_0x163eda=_0x163eda-0x0;var _0x344833=_0x188c[_0x163eda];return _0x344833;};'use strict';var multer=require(_0xc188('0x0'));var util=require('util');var path=require(_0xc188('0x1'));var timeout=require(_0xc188('0x2'));var express=require(_0xc188('0x3'));var router=express['Router']();var fs_extra=require(_0xc188('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc188('0x5'));var config=require(_0xc188('0x6'));var controller=require(_0xc188('0x7'));router['get']('/',auth[_0xc188('0x8')](),controller['index']);router[_0xc188('0x9')](_0xc188('0xa'),auth[_0xc188('0x8')](),controller['describe']);router[_0xc188('0x9')](_0xc188('0xb'),auth['isAuthenticated'](),controller[_0xc188('0xc')]);router[_0xc188('0xd')]('/',auth['isAuthenticated'](),controller[_0xc188('0xe')]);router[_0xc188('0xf')](_0xc188('0xb'),auth[_0xc188('0x8')](),controller[_0xc188('0x10')]);router['delete'](_0xc188('0xb'),auth[_0xc188('0x8')](),controller[_0xc188('0x11')]);module[_0xc188('0x12')]=router; \ No newline at end of file +var _0x6b93=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','describe','post'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x6b93,0x1cf));var _0x36b9=function(_0x4abbba,_0x4e355c){_0x4abbba=_0x4abbba-0x0;var _0x5f1bfb=_0x6b93[_0x4abbba];return _0x5f1bfb;};'use strict';var multer=require(_0x36b9('0x0'));var util=require(_0x36b9('0x1'));var path=require(_0x36b9('0x2'));var timeout=require(_0x36b9('0x3'));var express=require(_0x36b9('0x4'));var router=express[_0x36b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36b9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x36b9('0x7'));var controller=require(_0x36b9('0x8'));router['get']('/',auth[_0x36b9('0x9')](),controller['index']);router['get']('/describe',auth[_0x36b9('0x9')](),controller[_0x36b9('0xa')]);router['get']('/:id',auth[_0x36b9('0x9')](),controller['show']);router[_0x36b9('0xb')]('/',auth[_0x36b9('0x9')](),controller[_0x36b9('0xc')]);router[_0x36b9('0xd')](_0x36b9('0xe'),auth[_0x36b9('0x9')](),controller[_0x36b9('0xf')]);router[_0x36b9('0x10')](_0x36b9('0xe'),auth['isAuthenticated'](),controller[_0x36b9('0x11')]);module[_0x36b9('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 22a88eb..ff31090 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 _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','INTEGER','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}}; \ No newline at end of file +var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x6d11d9,_0x179ae0){_0x6d11d9=_0x6d11d9-0x0;var _0x1d2fdd=_0x2750[_0x6d11d9];return _0x1d2fdd;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b199f0f..2e796c3 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 _0xd394=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','get','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','Pause','mandatoryDispositionPause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','nolimit','removeDispositions','addAnswer','CannedAnswer','removeAnswers','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','updatedAt','DESC','Applications','account','applications','list','priority','defaults','ListId','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','utf8','render','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','transaction','Attachment','bulkCreate','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','Command','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','getSnippet','Interval','getLicense','virtual','License','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','origin','3.1.0','remote','stringify','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','sequelize','ISOLATION_LEVELS','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd394,0x104));var _0x4d39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd394[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x4d39('0x0'));var Mustache=require(_0x4d39('0x1'));var util=require(_0x4d39('0x2'));var path=require(_0x4d39('0x3'));var ejs=require(_0x4d39('0x4'));var fs=require('fs');var fs_extra=require(_0x4d39('0x5'));var _=require(_0x4d39('0x6'));var querystring=require('querystring');var Redis=require(_0x4d39('0x7'));var qs=require(_0x4d39('0x8'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var url=require('url');var db=require(_0x4d39('0x9'))['db'];config[_0x4d39('0xa')]=_['defaults'](config[_0x4d39('0xa')],{'host':_0x4d39('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d39('0xa')]));require(_0x4d39('0xc'))[_0x4d39('0xd')](socket);var htmlToText=require(_0x4d39('0xe'));var jayson=require(_0x4d39('0xf'));var client=jayson[_0x4d39('0x10')]['http']({'port':0x232c});var client9002=jayson[_0x4d39('0x10')][_0x4d39('0x11')]({'port':0x232a});var client9003=jayson[_0x4d39('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x4d39('0x10')][_0x4d39('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x3a96ea,_0x2c844b,_0x2b9176,_0x17a007){return new BPromise(function(_0x9ac852,_0x3aac33){var _0x115ef1=_0x17a007||client;return _0x115ef1[_0x4d39('0x12')](_0x3a96ea,_0x2b9176)[_0x4d39('0x13')](function(_0x582ee8){logger[_0x4d39('0x14')](_0x4d39('0x15'),_0x2c844b,_0x4d39('0x16'));logger[_0x4d39('0x17')](_0x4d39('0x18'),_0x2c844b,_0x4d39('0x16'),JSON['stringify'](_0x582ee8));if(_0x582ee8[_0x4d39('0x19')]){if(_0x582ee8[_0x4d39('0x19')]['code']===0x1f4){logger[_0x4d39('0x19')](_0x4d39('0x15'),_0x2c844b,_0x582ee8[_0x4d39('0x19')][_0x4d39('0x1a')]);return _0x3aac33(_0x582ee8[_0x4d39('0x19')][_0x4d39('0x1a')]);}logger[_0x4d39('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2c844b,_0x582ee8[_0x4d39('0x19')][_0x4d39('0x1a')]);return _0x9ac852(_0x582ee8[_0x4d39('0x19')][_0x4d39('0x1a')]);}else{logger['info'](_0x4d39('0x15'),_0x2c844b,_0x4d39('0x16'));_0x9ac852(_0x582ee8[_0x4d39('0x1b')][_0x4d39('0x1a')]);}})[_0x4d39('0x1c')](function(_0xba4ba5){logger[_0x4d39('0x19')](_0x4d39('0x15'),_0x2c844b,_0xba4ba5);_0x3aac33(_0xba4ba5);});});}function respondWithStatusCode(_0x2b96b8,_0x6fbca7){_0x6fbca7=_0x6fbca7||0xcc;return function(_0x344152){if(_0x344152){return _0x2b96b8[_0x4d39('0x1d')](_0x6fbca7);}return _0x2b96b8[_0x4d39('0x1e')](_0x6fbca7)[_0x4d39('0x1f')]();};}function respondWithResult(_0x696d2c,_0x256177){_0x256177=_0x256177||0xc8;return function(_0x488158){if(_0x488158){return _0x696d2c['status'](_0x256177)[_0x4d39('0x20')](_0x488158);}};}function respondWithFilteredResult(_0x4056df,_0x22815a){return function(_0x22cd1f){if(_0x22cd1f){var _0x22bde7=typeof _0x22815a[_0x4d39('0x21')]===_0x4d39('0x22')&&typeof _0x22815a[_0x4d39('0x23')]==='undefined';var _0x171991=_0x22cd1f[_0x4d39('0x24')];var _0x3d6aaa=_0x22bde7?0x0:_0x22815a[_0x4d39('0x21')];var _0x17b5e1=_0x22bde7?_0x22cd1f[_0x4d39('0x24')]:_0x22815a[_0x4d39('0x21')]+_0x22815a[_0x4d39('0x23')];var _0x48daf6;if(_0x17b5e1>=_0x171991){_0x17b5e1=_0x171991;_0x48daf6=0xc8;}else{_0x48daf6=0xce;}_0x4056df[_0x4d39('0x1e')](_0x48daf6);return _0x4056df['set'](_0x4d39('0x25'),_0x3d6aaa+'-'+_0x17b5e1+'/'+_0x171991)[_0x4d39('0x20')](_0x22cd1f);}return null;};}function saveUpdates(_0x26f50a){return function(_0x36b572){if(_0x36b572){return _0x36b572['update'](_0x26f50a)[_0x4d39('0x13')](function(_0x24d194){return _0x24d194;});}return null;};}function removeEntity(_0x5ac715){return function(_0x5aaafa){if(_0x5aaafa){return _0x5aaafa[_0x4d39('0x26')]()[_0x4d39('0x13')](function(){var _0x43910a=_0x5aaafa[_0x4d39('0x27')]({'plain':!![]});var _0x3a9a92='ChatWebsites';return db[_0x4d39('0x28')][_0x4d39('0x26')]({'where':{'type':_0x3a9a92,'resourceId':_0x43910a['id']}})[_0x4d39('0x13')](function(){return _0x5aaafa;});})[_0x4d39('0x13')](function(){_0x5ac715[_0x4d39('0x1e')](0xcc)[_0x4d39('0x1f')]();});}};}function handleEntityNotFound(_0x141959){return function(_0x2e1c8b){if(!_0x2e1c8b){_0x141959[_0x4d39('0x1d')](0x194);}return _0x2e1c8b;};}function handleError(_0xaad581,_0x302b4e){_0x302b4e=_0x302b4e||0x1f4;return function(_0x56d551){logger[_0x4d39('0x19')](_0x56d551[_0x4d39('0x29')]);if(_0x56d551[_0x4d39('0x2a')]){delete _0x56d551[_0x4d39('0x2a')];}_0xaad581['status'](_0x302b4e)[_0x4d39('0x2b')](_0x56d551);};}exports[_0x4d39('0x2c')]=function(_0x17d23e,_0xfc1a){var _0x5976a7={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4815cc={},_0x3ea46e={'count':0x0,'rows':[]};var _0x316cec=_[_0x4d39('0x2d')](db[_0x4d39('0x2e')][_0x4d39('0x2f')],function(_0x7e8261){return{'name':_0x7e8261[_0x4d39('0x30')],'type':_0x7e8261[_0x4d39('0x31')][_0x4d39('0x32')]};});_0x4815cc[_0x4d39('0x33')]=_[_0x4d39('0x2d')](_0x316cec,_0x4d39('0x2a'));_0x4815cc['query']=_[_0x4d39('0x34')](_0x17d23e[_0x4d39('0x35')]);_0x4815cc[_0x4d39('0x36')]=_['intersection'](_0x4815cc[_0x4d39('0x33')],_0x4815cc[_0x4d39('0x35')]);_0x5976a7[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x4815cc[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0x17d23e['query'][_0x4d39('0x39')]));_0x5976a7[_0x4d39('0x37')]=_0x5976a7[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x5976a7[_0x4d39('0x37')]:_0x4815cc[_0x4d39('0x33')];if(!_0x17d23e[_0x4d39('0x35')][_0x4d39('0x3b')]('nolimit')){_0x5976a7['limit']=qs['limit'](_0x17d23e[_0x4d39('0x35')][_0x4d39('0x23')]);_0x5976a7[_0x4d39('0x21')]=qs['offset'](_0x17d23e['query'][_0x4d39('0x21')]);}_0x5976a7[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0x17d23e[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x5976a7[_0x4d39('0x3e')]=qs['filters'](_[_0x4d39('0x3f')](_0x17d23e[_0x4d39('0x35')],_0x4815cc[_0x4d39('0x36')]),_0x316cec);if(_0x17d23e[_0x4d39('0x35')][_0x4d39('0x40')]){_0x5976a7['where']=_[_0x4d39('0x41')](_0x5976a7[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x2d')](_0x316cec,function(_0x5cf1f1){if(_0x5cf1f1['type']!==_0x4d39('0x42')){var _0xd9cd9b={};_0xd9cd9b[_0x5cf1f1[_0x4d39('0x2a')]]={'$like':'%'+_0x17d23e['query'][_0x4d39('0x40')]+'%'};return _0xd9cd9b;}})});}_0x5976a7=_[_0x4d39('0x41')]({},_0x5976a7,_0x17d23e[_0x4d39('0x43')]);var _0x43a916={'where':_0x5976a7[_0x4d39('0x3e')]};return db['ChatWebsite']['count'](_0x43a916)[_0x4d39('0x13')](function(_0x2b88ac){_0x3ea46e[_0x4d39('0x24')]=_0x2b88ac;if(_0x17d23e['query'][_0x4d39('0x44')]){_0x5976a7[_0x4d39('0x45')]=[{'all':!![]}];}return db[_0x4d39('0x2e')][_0x4d39('0x46')](_0x5976a7);})[_0x4d39('0x13')](function(_0x112ddd){_0x3ea46e[_0x4d39('0x47')]=_0x112ddd;return _0x3ea46e;})['then'](respondWithFilteredResult(_0xfc1a,_0x5976a7))[_0x4d39('0x1c')](handleError(_0xfc1a,null));};exports['show']=function(_0xdf1a4,_0x35939a){var _0x21013a={'raw':![],'where':{'id':_0xdf1a4['params']['id']},'include':[{'model':db[_0x4d39('0x48')],'as':_0x4d39('0x49')}]},_0x1b8162={};_0x1b8162[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x2e')][_0x4d39('0x2f')]);_0x1b8162[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0xdf1a4[_0x4d39('0x35')]);_0x1b8162[_0x4d39('0x36')]=_['intersection'](_0x1b8162[_0x4d39('0x33')],_0x1b8162[_0x4d39('0x35')]);_0x21013a[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x1b8162['model'],qs[_0x4d39('0x39')](_0xdf1a4[_0x4d39('0x35')][_0x4d39('0x39')]));_0x21013a[_0x4d39('0x37')]=_0x21013a['attributes'][_0x4d39('0x3a')]?_0x21013a[_0x4d39('0x37')]:_0x1b8162[_0x4d39('0x33')];if(_0xdf1a4[_0x4d39('0x35')]['includeAll']){_0x21013a[_0x4d39('0x45')]=[{'all':!![]}];}_0x21013a=_[_0x4d39('0x41')]({},_0x21013a,_0xdf1a4['options']);return db['ChatWebsite'][_0x4d39('0x4a')](_0x21013a)[_0x4d39('0x13')](handleEntityNotFound(_0x35939a,null))[_0x4d39('0x13')](respondWithResult(_0x35939a,null))[_0x4d39('0x1c')](handleError(_0x35939a,null));};exports['create']=function(_0x1e2f3e,_0x4ff006){return db[_0x4d39('0x2e')]['create'](_0x1e2f3e[_0x4d39('0x4b')],{})['then'](function(_0x2aee3f){var _0x480efd=_0x1e2f3e[_0x4d39('0x4c')][_0x4d39('0x27')]({'plain':!![]});if(!_0x480efd)throw new Error(_0x4d39('0x4d'));if(_0x480efd['role']===_0x4d39('0x4c')){var _0x3d9891=_0x2aee3f[_0x4d39('0x27')]({'plain':!![]});var _0x42b949=_0x4d39('0x4e');return db[_0x4d39('0x4f')][_0x4d39('0x4a')]({'where':{'name':_0x42b949,'userProfileId':_0x480efd[_0x4d39('0x50')]},'raw':!![]})['then'](function(_0x2df899){if(_0x2df899&&_0x2df899[_0x4d39('0x51')]===0x0){return db[_0x4d39('0x28')][_0x4d39('0x52')]({'name':_0x3d9891[_0x4d39('0x2a')],'resourceId':_0x3d9891['id'],'type':_0x2df899[_0x4d39('0x2a')],'sectionId':_0x2df899['id']},{})['then'](function(){return _0x2aee3f;});}else{return _0x2aee3f;}})[_0x4d39('0x1c')](function(_0x451ab1){logger['error'](_0x4d39('0x53'),_0x451ab1);throw _0x451ab1;});}return _0x2aee3f;})[_0x4d39('0x13')](respondWithResult(_0x4ff006,0xc9))[_0x4d39('0x1c')](handleError(_0x4ff006,null));};exports[_0x4d39('0x54')]=function(_0x109425,_0x5a0720){if(_0x109425[_0x4d39('0x4b')]['id']){delete _0x109425[_0x4d39('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x109425[_0x4d39('0x55')]['id']},'include':[{'model':db[_0x4d39('0x48')],'as':_0x4d39('0x49')}]})[_0x4d39('0x13')](handleEntityNotFound(_0x5a0720,null))[_0x4d39('0x13')](saveUpdates(_0x109425[_0x4d39('0x4b')],null))[_0x4d39('0x13')](respondWithResult(_0x5a0720,null))['catch'](handleError(_0x5a0720,null));};exports[_0x4d39('0x26')]=function(_0x149712,_0x1fdbbd){return db['ChatWebsite']['find']({'where':{'id':_0x149712[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x1fdbbd,null))['then'](removeEntity(_0x1fdbbd,null))[_0x4d39('0x1c')](handleError(_0x1fdbbd,null));};exports[_0x4d39('0x56')]=function(_0x603ce4,_0x3922e5){return db[_0x4d39('0x2e')][_0x4d39('0x56')]()[_0x4d39('0x13')](respondWithResult(_0x3922e5,null))[_0x4d39('0x1c')](handleError(_0x3922e5,null));};exports[_0x4d39('0x57')]=function(_0x4d4426,_0x56b798){if(_0x4d4426[_0x4d39('0x4b')]['id']){delete _0x4d4426['body']['id'];}return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x4d4426[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x56b798,null))[_0x4d39('0x13')](function(_0x54df97){if(_0x54df97){_0x4d4426[_0x4d39('0x4b')][_0x4d39('0x58')]=_0x54df97['id'];return db[_0x4d39('0x59')][_0x4d39('0x52')](_0x4d4426[_0x4d39('0x4b')]);}})[_0x4d39('0x13')](respondWithResult(_0x56b798,null))[_0x4d39('0x1c')](handleError(_0x56b798,null));};exports['getDispositions']=function(_0x5c01c6,_0xc06a75){var _0x1a8ca9={'raw':![],'where':{}};var _0x3999e7={};var _0x30f9cf={'count':0x0,'rows':[]};return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0x5c01c6['params']['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0xc06a75,null))[_0x4d39('0x13')](function(_0x55a873){if(_0x55a873){_0x3999e7[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x59')]['rawAttributes']);_0x3999e7[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x5c01c6['query']);_0x3999e7[_0x4d39('0x36')]=_[_0x4d39('0x38')](_0x3999e7[_0x4d39('0x33')],_0x3999e7[_0x4d39('0x35')]);_0x1a8ca9['attributes']=_[_0x4d39('0x38')](_0x3999e7['model'],qs[_0x4d39('0x39')](_0x5c01c6[_0x4d39('0x35')][_0x4d39('0x39')]));_0x1a8ca9[_0x4d39('0x37')]=_0x1a8ca9[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x1a8ca9[_0x4d39('0x37')]:_0x3999e7['model'];if(!_0x5c01c6['query'][_0x4d39('0x3b')](_0x4d39('0x5b'))){_0x1a8ca9[_0x4d39('0x23')]=qs[_0x4d39('0x23')](_0x5c01c6[_0x4d39('0x35')]['limit']);_0x1a8ca9['offset']=qs['offset'](_0x5c01c6['query'][_0x4d39('0x21')]);}_0x1a8ca9[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0x5c01c6[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x1a8ca9['where']=qs['filters'](_['pick'](_0x5c01c6[_0x4d39('0x35')],_0x3999e7[_0x4d39('0x36')]));_0x1a8ca9[_0x4d39('0x3e')][_0x4d39('0x58')]=_0x55a873['id'];if(_0x5c01c6[_0x4d39('0x35')][_0x4d39('0x40')]){_0x1a8ca9['where']=_[_0x4d39('0x41')](_0x1a8ca9[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x2d')](_0x1a8ca9[_0x4d39('0x37')],function(_0x45bd60){var _0x9d6077={};_0x9d6077[_0x45bd60]={'$like':'%'+_0x5c01c6['query'][_0x4d39('0x40')]+'%'};return _0x9d6077;})});}_0x1a8ca9=_[_0x4d39('0x41')]({},_0x1a8ca9,_0x5c01c6[_0x4d39('0x43')]);return db[_0x4d39('0x59')]['count']({'where':_0x1a8ca9[_0x4d39('0x3e')]})['then'](function(_0xe6bbe5){_0x30f9cf[_0x4d39('0x24')]=_0xe6bbe5;if(_0x5c01c6[_0x4d39('0x35')][_0x4d39('0x44')]){_0x1a8ca9[_0x4d39('0x45')]=[{'all':!![]}];}return db[_0x4d39('0x59')]['findAll'](_0x1a8ca9);})[_0x4d39('0x13')](function(_0x34ea59){_0x30f9cf[_0x4d39('0x47')]=_0x34ea59;return _0x30f9cf;});}})[_0x4d39('0x13')](respondWithFilteredResult(_0xc06a75,_0x1a8ca9))[_0x4d39('0x1c')](handleError(_0xc06a75,null));};exports[_0x4d39('0x5c')]=function(_0x46b6db,_0x15b26b){return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x46b6db[_0x4d39('0x55')]['id']}})['then'](handleEntityNotFound(_0x15b26b,null))['then'](function(_0x4cc844){if(_0x4cc844){return _0x4cc844[_0x4d39('0x5c')](_0x46b6db[_0x4d39('0x35')]['ids']);}})[_0x4d39('0x13')](respondWithStatusCode(_0x15b26b,null))[_0x4d39('0x1c')](handleError(_0x15b26b,null));};exports[_0x4d39('0x5d')]=function(_0x404217,_0x4f8986){if(_0x404217['body']['id']){delete _0x404217[_0x4d39('0x4b')]['id'];}return db[_0x4d39('0x2e')]['find']({'where':{'id':_0x404217[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x4f8986,null))[_0x4d39('0x13')](function(_0x5d7246){if(_0x5d7246){_0x404217[_0x4d39('0x4b')]['ChatWebsiteId']=_0x5d7246['id'];return db[_0x4d39('0x5e')]['create'](_0x404217[_0x4d39('0x4b')]);}})[_0x4d39('0x13')](respondWithResult(_0x4f8986,null))[_0x4d39('0x1c')](handleError(_0x4f8986,null));};exports['getAnswers']=function(_0x3a3e8d,_0x346a65){var _0x80245e={'raw':![],'where':{}};var _0x313f82={};var _0x2d9556={'count':0x0,'rows':[]};return db[_0x4d39('0x2e')]['findOne']({'where':{'id':_0x3a3e8d[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x346a65,null))[_0x4d39('0x13')](function(_0x459b2a){if(_0x459b2a){_0x313f82[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x5e')][_0x4d39('0x2f')]);_0x313f82[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x3a3e8d[_0x4d39('0x35')]);_0x313f82['filters']=_['intersection'](_0x313f82[_0x4d39('0x33')],_0x313f82['query']);_0x80245e[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x313f82[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0x3a3e8d[_0x4d39('0x35')]['fields']));_0x80245e[_0x4d39('0x37')]=_0x80245e[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x80245e[_0x4d39('0x37')]:_0x313f82[_0x4d39('0x33')];if(!_0x3a3e8d[_0x4d39('0x35')][_0x4d39('0x3b')](_0x4d39('0x5b'))){_0x80245e['limit']=qs[_0x4d39('0x23')](_0x3a3e8d[_0x4d39('0x35')][_0x4d39('0x23')]);_0x80245e[_0x4d39('0x21')]=qs[_0x4d39('0x21')](_0x3a3e8d['query']['offset']);}_0x80245e[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0x3a3e8d['query'][_0x4d39('0x3d')]);_0x80245e[_0x4d39('0x3e')]=qs['filters'](_[_0x4d39('0x3f')](_0x3a3e8d['query'],_0x313f82['filters']));_0x80245e[_0x4d39('0x3e')]['ChatWebsiteId']=_0x459b2a['id'];if(_0x3a3e8d[_0x4d39('0x35')]['filter']){_0x80245e['where']=_['merge'](_0x80245e[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x2d')](_0x80245e[_0x4d39('0x37')],function(_0x3bfe69){var _0x498740={};_0x498740[_0x3bfe69]={'$like':'%'+_0x3a3e8d[_0x4d39('0x35')]['filter']+'%'};return _0x498740;})});}_0x80245e=_[_0x4d39('0x41')]({},_0x80245e,_0x3a3e8d[_0x4d39('0x43')]);return db[_0x4d39('0x5e')]['count']({'where':_0x80245e['where']})[_0x4d39('0x13')](function(_0x5a2e70){_0x2d9556[_0x4d39('0x24')]=_0x5a2e70;if(_0x3a3e8d[_0x4d39('0x35')][_0x4d39('0x44')]){_0x80245e[_0x4d39('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4d39('0x46')](_0x80245e);})[_0x4d39('0x13')](function(_0x3e1a54){_0x2d9556[_0x4d39('0x47')]=_0x3e1a54;return _0x2d9556;});}})['then'](respondWithFilteredResult(_0x346a65,_0x80245e))[_0x4d39('0x1c')](handleError(_0x346a65,null));};exports[_0x4d39('0x5f')]=function(_0x4881f3,_0xf1b8e3){return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x4881f3[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0xf1b8e3,null))['then'](function(_0x5e3e16){if(_0x5e3e16){return _0x5e3e16[_0x4d39('0x5f')](_0x4881f3[_0x4d39('0x35')]['ids']);}})[_0x4d39('0x13')](respondWithStatusCode(_0xf1b8e3,null))['catch'](handleError(_0xf1b8e3,null));};exports['addLogo']=function(_0x4ccd8b,_0x60740b){_0x4ccd8b[_0x4d39('0x4b')][_0x4d39('0x60')]=_0x4ccd8b[_0x4d39('0x61')]['filename'];return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x4ccd8b[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x60740b,null))[_0x4d39('0x13')](saveUpdates(_0x4ccd8b['body'],null))[_0x4d39('0x13')](respondWithResult(_0x60740b,null))[_0x4d39('0x1c')](handleError(_0x60740b,null));};exports[_0x4d39('0x62')]=function(_0xa2a3e4,_0x15b7c0){_0xa2a3e4[_0x4d39('0x4b')][_0x4d39('0x63')]=_0xa2a3e4['file']['filename'];return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0xa2a3e4[_0x4d39('0x55')]['id']}})['then'](handleEntityNotFound(_0x15b7c0,null))[_0x4d39('0x13')](saveUpdates(_0xa2a3e4[_0x4d39('0x4b')],null))[_0x4d39('0x13')](respondWithResult(_0x15b7c0,null))[_0x4d39('0x1c')](handleError(_0x15b7c0,null));};exports['addCustomerAvatar']=function(_0x179bd9,_0x39627b){_0x179bd9[_0x4d39('0x4b')][_0x4d39('0x64')]=_0x179bd9[_0x4d39('0x61')][_0x4d39('0x65')];return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x179bd9[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x39627b,null))[_0x4d39('0x13')](saveUpdates(_0x179bd9[_0x4d39('0x4b')],null))['then'](respondWithResult(_0x39627b,null))[_0x4d39('0x1c')](handleError(_0x39627b,null));};exports['addSystemAvatar']=function(_0x5d781a,_0x4dc06a){_0x5d781a[_0x4d39('0x4b')][_0x4d39('0x66')]=_0x5d781a[_0x4d39('0x61')][_0x4d39('0x65')];return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x5d781a[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x4dc06a,null))[_0x4d39('0x13')](saveUpdates(_0x5d781a['body'],null))[_0x4d39('0x13')](respondWithResult(_0x4dc06a,null))[_0x4d39('0x1c')](handleError(_0x4dc06a,null));};exports[_0x4d39('0x67')]=function(_0x17425e,_0x547709){var _0x41ea42=path[_0x4d39('0x68')](config[_0x4d39('0x69')],'server/files/images/logos/default_logo.svg');var _0x25fd67={'where':{'id':_0x17425e['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1c1593=![];return require(_0x4d39('0x6a'))['getLicense']()[_0x4d39('0x13')](function(_0x330afa){if(_0x330afa){_0x1c1593=_0x330afa[_0x4d39('0x6b')];}})['then'](function(){return db[_0x4d39('0x2e')]['find'](_0x25fd67);})['then'](handleEntityNotFound(_0x547709,null))[_0x4d39('0x13')](function(_0x57e2e6){if(_0x57e2e6){if(!_[_0x4d39('0x6c')](_0x57e2e6[_0x4d39('0x60')])){if(fs[_0x4d39('0x6d')](path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0x6e'),_0x57e2e6[_0x4d39('0x60')]))&&_0x1c1593){_0x41ea42=path['join'](config[_0x4d39('0x69')],'server/files/images/logos/',_0x57e2e6[_0x4d39('0x60')]);}}return _0x547709['download'](_0x41ea42);}})[_0x4d39('0x1c')](handleError(_0x547709,null));};exports[_0x4d39('0x6f')]=function(_0x374b6d,_0x564fc8){var _0x49688d=path['join'](config[_0x4d39('0x69')],'server/files/images/avatars/default_avatar.png');var _0x321549={'where':{'id':_0x374b6d['params']['id']},'attributes':['id',_0x4d39('0x63')],'raw':!![]};return db[_0x4d39('0x2e')]['find'](_0x321549)[_0x4d39('0x13')](handleEntityNotFound(_0x564fc8,null))[_0x4d39('0x13')](function(_0x2e0e1c){if(_0x2e0e1c){if(!_[_0x4d39('0x6c')](_0x2e0e1c[_0x4d39('0x63')])){if(fs[_0x4d39('0x6d')](path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0x70'),_0x2e0e1c[_0x4d39('0x63')]))){_0x49688d=path[_0x4d39('0x68')](config['root'],_0x4d39('0x70'),_0x2e0e1c['agentAvatar']);}}return _0x564fc8['download'](_0x49688d);}})[_0x4d39('0x1c')](handleError(_0x564fc8,null));};exports[_0x4d39('0x71')]=function(_0x203d3a,_0x5ea6ed){var _0x175005=path['join'](config[_0x4d39('0x69')],_0x4d39('0x72'));var _0x19115b={'where':{'id':_0x203d3a[_0x4d39('0x55')]['id']},'attributes':['id','customerAvatar',_0x4d39('0x73')],'raw':!![]};return db['ChatWebsite'][_0x4d39('0x4a')](_0x19115b)[_0x4d39('0x13')](handleEntityNotFound(_0x5ea6ed,null))['then'](function(_0x4d2f21){if(_0x4d2f21){if(!_[_0x4d39('0x6c')](_0x4d2f21['customerAvatar'])){if(fs[_0x4d39('0x6d')](path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0x70'),_0x4d2f21[_0x4d39('0x64')]))&&_0x4d2f21[_0x4d39('0x73')]){_0x175005=path['join'](config[_0x4d39('0x69')],'server/files/images/avatars/',_0x4d2f21[_0x4d39('0x64')]);}}return _0x5ea6ed[_0x4d39('0x74')](_0x175005);}})['catch'](handleError(_0x5ea6ed,null));};exports[_0x4d39('0x75')]=function(_0x1194b8,_0x5cc91d){var _0x42eb19=path['join'](config['root'],_0x4d39('0x76'));var _0x49a18={'where':{'id':_0x1194b8[_0x4d39('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x49a18)[_0x4d39('0x13')](handleEntityNotFound(_0x5cc91d,null))[_0x4d39('0x13')](function(_0x140d9a){if(_0x140d9a){if(!_[_0x4d39('0x6c')](_0x140d9a[_0x4d39('0x66')])){if(fs[_0x4d39('0x6d')](path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0x70'),_0x140d9a['systemAvatar']))){_0x42eb19=path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0x70'),_0x140d9a['systemAvatar']);}}return _0x5cc91d[_0x4d39('0x74')](_0x42eb19);}})[_0x4d39('0x1c')](handleError(_0x5cc91d,null));};exports[_0x4d39('0x77')]=function(_0x52c581,_0x473de5){var _0x1438fb=require('user-agent-parser');var _0x266210=new _0x1438fb();var _0x2a8d96=_0x266210[_0x4d39('0x78')](_0x52c581[_0x4d39('0x79')]['user-agent'])['getResult']();var _0x4baf13={'body':_0x52c581[_0x4d39('0x4b')],'channel':_0x4d39('0x7a')};var _0x20e955=[];var _0x3dc18f=[];var _0x27ba92={};var _0x27cb15=![];return db[_0x4d39('0x7b')][_0x4d39('0x56')]()[_0x4d39('0x13')](function(_0x172e72){if(!_0x172e72){throw new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0x7e'));}_0x20e955=_[_0x4d39('0x7f')](_[_0x4d39('0x34')](_0x172e72),[_0x4d39('0x80'),'updatedAt']);_0x3dc18f=_[_0x4d39('0x7f')](_[_0x4d39('0x34')](_0x172e72),['createdAt','updatedAt',_0x4d39('0x81'),'ListId']);if(_0x52c581[_0x4d39('0x4b')]['id']){delete _0x52c581[_0x4d39('0x4b')]['id'];}if(_[_0x4d39('0x6c')](_0x52c581[_0x4d39('0x4b')][_0x4d39('0x82')])){throw new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x4d39('0x6c')](_0x52c581[_0x4d39('0x4b')][_0x4d39('0x4b')])||_0x52c581['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x4d39('0x83'));}if(_['isNil'](_0x52c581[_0x4d39('0x4b')]['mapKey'])){throw new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0x84')+_0x3dc18f);}if(!_[_0x4d39('0x85')](_0x3dc18f,_0x52c581[_0x4d39('0x4b')][_0x4d39('0x86')])){throw new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0x87')+_0x3dc18f);}_0x27ba92[_0x52c581[_0x4d39('0x4b')][_0x4d39('0x86')]]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0x82')];})[_0x4d39('0x13')](function(){return db['ChatWebsite'][_0x4d39('0x4a')]({'where':{'id':_0x52c581[_0x4d39('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x4d39('0x88'),'include':[{'model':db[_0x4d39('0x7b')],'as':_0x4d39('0x89'),'where':_0x27ba92,'limit':0x1,'order':[[_0x4d39('0x8a'),_0x4d39('0x8b')]]}]},{'model':db['ChatApplication'],'as':_0x4d39('0x8c')}]});})[_0x4d39('0x13')](handleEntityNotFound(_0x473de5,null))[_0x4d39('0x13')](function(_0x2f4f47){if(_0x2f4f47&&_0x2f4f47['List']){_0x4baf13[_0x4d39('0x8d')]=_0x2f4f47;_0x4baf13[_0x4d39('0x8e')]=_0x2f4f47['Applications'];_0x4baf13[_0x4d39('0x8f')]=_0x2f4f47[_0x4d39('0x88')];_0x4baf13[_0x4d39('0x8e')]=_['orderBy'](_0x4baf13['applications'],[_0x4d39('0x90')],['asc']);if(_0x4baf13['account'][_0x4d39('0x8c')]){delete _0x4baf13[_0x4d39('0x8d')][_0x4d39('0x8c')];}if(_0x4baf13[_0x4d39('0x8d')][_0x4d39('0x88')]&&_0x4baf13['account'][_0x4d39('0x88')][_0x4d39('0x89')]['length']){return _0x4baf13['account']['List'][_0x4d39('0x89')][0x0];}var _0x4fe906=_[_0x4d39('0x91')](_0x52c581[_0x4d39('0x4b')],{'firstName':_0x52c581[_0x4d39('0x4b')][_0x4d39('0x82')],'ListId':_0x2f4f47[_0x4d39('0x92')]});_0x4fe906[_0x52c581[_0x4d39('0x4b')][_0x4d39('0x86')]]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0x82')];return db[_0x4d39('0x7b')][_0x4d39('0x52')](_0x4fe906,{'fields':_0x20e955,'raw':!![]});}})[_0x4d39('0x13')](handleEntityNotFound(_0x473de5,null))[_0x4d39('0x13')](function(_0x341945){_0x4baf13['contact']=_0x341945;var _0x110e45=_0x52c581[_0x4d39('0x4b')]['customerIp'];if(_0x52c581[_0x4d39('0x79')]['cf-connecting-ip']){_0x110e45=_0x52c581[_0x4d39('0x79')][_0x4d39('0x93')];}else if(_0x52c581[_0x4d39('0x79')][_0x4d39('0x94')]){_0x110e45=_[_0x4d39('0x95')](_0x52c581[_0x4d39('0x79')]['x-forwarded-for'][_0x4d39('0x96')](','));}if(_0x341945){var _0x41feed={'ContactId':_0x341945['id'],'ChatWebsiteId':_0x52c581[_0x4d39('0x55')]['id'],'from':(_0x341945[_0x4d39('0x97')]||'')+'\x20'+(_0x341945[_0x4d39('0x98')]||''),'customerIp':_0x110e45,'customerPort':_0x52c581[_0x4d39('0x79')][_0x4d39('0x99')]?_0x52c581['headers'][_0x4d39('0x99')]:null,'referer':_0x52c581[_0x4d39('0x4b')]['referer'],'browserName':_0x2a8d96[_0x4d39('0x9a')][_0x4d39('0x2a')]&&_0x2a8d96['browser'][_0x4d39('0x9b')]?util[_0x4d39('0x9c')](_0x4d39('0x9d'),_0x2a8d96[_0x4d39('0x9a')][_0x4d39('0x2a')],_0x2a8d96[_0x4d39('0x9a')]['version']):_0x4d39('0x9e'),'browserVersion':_0x2a8d96[_0x4d39('0x9a')][_0x4d39('0x9b')]||_0x4d39('0x9e'),'osName':util[_0x4d39('0x9c')](_0x4d39('0x9d'),_0x2a8d96['os']['name'],_0x2a8d96['os'][_0x4d39('0x9b')]),'osVersion':_0x2a8d96['os'][_0x4d39('0x9b')],'deviceModel':_0x2a8d96[_0x4d39('0x9f')][_0x4d39('0x33')]&&_0x2a8d96[_0x4d39('0x9f')]['vendor']?util[_0x4d39('0x9c')](_0x4d39('0xa0'),_0x2a8d96[_0x4d39('0x9f')][_0x4d39('0x33')],_0x2a8d96[_0x4d39('0x9f')][_0x4d39('0xa1')],_0x2a8d96[_0x4d39('0x9f')]['type']):null,'deviceVendor':_0x2a8d96[_0x4d39('0x9f')][_0x4d39('0xa1')],'deviceType':_0x2a8d96[_0x4d39('0x9f')][_0x4d39('0x31')],'formData':JSON['stringify'](_0x52c581[_0x4d39('0x4b')])};var _0x490225={'ChatWebsiteId':_0x52c581[_0x4d39('0x55')]['id'],'closed':![]};if(_0x52c581[_0x4d39('0x4b')]['threadId']){_0x490225[_0x4d39('0xa2')]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa2')];return db[_0x4d39('0xa3')]['find']({'where':_0x490225})[_0x4d39('0x13')](function(_0x33eec4){if(_0x33eec4){return[_0x33eec4,![]];}_0x41feed[_0x4d39('0xa2')]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa2')];_0x41feed[_0x4d39('0xa4')]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa4')];return db['ChatInteraction'][_0x4d39('0x52')](_0x41feed)[_0x4d39('0x13')](function(_0x4a6dcf){return[_0x4a6dcf,!![]];});});}_0x490225[_0x4d39('0xa5')]=_0x341945['id'];if(_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa6')]&&_0x52c581[_0x4d39('0x4b')]['interaction']['id']){_0x490225['id']=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa6')]['id'];return db[_0x4d39('0xa3')][_0x4d39('0x4a')]({'where':_0x490225})['then'](function(_0x57a43d){if(_0x57a43d){return[_0x57a43d,![]];}return db[_0x4d39('0xa3')]['create'](_0x41feed)[_0x4d39('0x13')](function(_0xe7a567){return[_0xe7a567,!![]];});});}return db[_0x4d39('0xa3')][_0x4d39('0x52')](_0x41feed)[_0x4d39('0x13')](function(_0xbdef40){return[_0xbdef40,!![]];});}})[_0x4d39('0xa7')](function(_0xbb6194,_0x403c28){if(_0xbb6194){_0x27cb15=_0x403c28;if(!_0x403c28){var _0x564443={'from':(_0x4baf13['contact'][_0x4d39('0x97')]||'')+'\x20'+(_0x4baf13[_0x4d39('0xa8')][_0x4d39('0x98')]||'')};if(_0x52c581['body'][_0x4d39('0xa2')]&&_0x52c581['body']['messageId']&&_0x52c581['body']['threadId']!=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa9')]){_0x564443[_0x4d39('0xa2')]=_0x52c581[_0x4d39('0x4b')][_0x4d39('0xa9')];}return _0xbb6194[_0x4d39('0x54')](_0x564443);}else{return _0xbb6194;}}})['then'](function(_0x2bd453){_0x4baf13['interaction']=_0x2bd453[_0x4d39('0x27')]({'plain':!![]});_0x4baf13[_0x4d39('0xa6')]['created']=_0x27cb15;if(_0x4baf13[_0x4d39('0xa6')][_0x4d39('0xaa')]){if(_0x4baf13[_0x4d39('0x8d')][_0x4d39('0xab')]){_0x4baf13[_0x4d39('0x8e')][_0x4d39('0xac')]({'id':0x0,'priority':_0x4baf13['applications']['length']+0x1,'app':'close','appdata':_0x4d39('0xad'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x52c581['body']['body'],'ChatWebsiteId':_0x52c581[_0x4d39('0x55')]['id'],'ChatInteractionId':_0x2bd453['id'],'direction':'in','ContactId':_0x4baf13[_0x4d39('0xa8')]['id'],'AttachmentId':_0x52c581[_0x4d39('0x4b')][_0x4d39('0xae')]});})[_0x4d39('0x13')](function(_0x54079a){_0x4baf13[_0x4d39('0x1a')]=_0x54079a;if(_0x4baf13[_0x4d39('0xa6')][_0x4d39('0xaf')]){return db[_0x4d39('0xb0')]['find']({'attributes':['id',_0x4d39('0x2a')],'where':{'id':_0x4baf13[_0x4d39('0xa6')]['UserId']}})['then'](function(_0x222f2e){if(_0x222f2e){_0x4baf13[_0x4d39('0x8e')][_0x4d39('0xb1')]({'id':0x0,'priority':0x0,'app':_0x4d39('0xb2'),'appdata':_0x222f2e[_0x4d39('0x2a')]+','+(_0x4baf13['account'][_0x4d39('0xb3')]||0xa),'interval':'*,*,*,*'});_0x4baf13[_0x4d39('0xb4')]=!![];}return respondWithRpcPromise('Start',_0x4d39('0xb5'),_0x4baf13);});}return respondWithRpcPromise(_0x4d39('0xb6'),_0x4d39('0xb5'),_0x4baf13);})['then'](function(_0xe5eba6){respondWithRpcPromise(_0x4d39('0xb7'),'EventManager',{'event':_0x4d39('0x77'),'message':_0xe5eba6},client9002);return _0xe5eba6;})[_0x4d39('0x13')](respondWithResult(_0x473de5,null))[_0x4d39('0x1c')](handleError(_0x473de5,null));};exports[_0x4d39('0xb8')]=function(_0x1b2442,_0x54b2ab){var _0x21112c,_0x5cb3b4,_0xa24a4b;var _0x3c7767=[];var _0x13417e={};var _0xd9a48e=_0x1b2442[_0x4d39('0xb9')]||[];var _0x4a5d56=[];var _0x495829;return db[_0x4d39('0x7b')][_0x4d39('0x56')]()[_0x4d39('0x13')](function(_0x561af){if(!_0x561af){throw new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0x7e'));}_0x3c7767=_[_0x4d39('0x7f')](_[_0x4d39('0x34')](_0x561af),[_0x4d39('0x80'),_0x4d39('0x8a'),_0x4d39('0x81'),'ListId']);if(_0x1b2442[_0x4d39('0x4b')]['id']){delete _0x1b2442[_0x4d39('0x4b')]['id'];}if(_[_0x4d39('0x6c')](_0x1b2442[_0x4d39('0x4b')]['from'])){throw _0x54b2ab[_0x4d39('0x1e')](0x1f4)[_0x4d39('0x2b')](new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0xba')));}if(_[_0x4d39('0x6c')](_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x4b')])||_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x4b')]===''){throw _0x54b2ab[_0x4d39('0x1e')](0x1f4)[_0x4d39('0x2b')](new db[(_0x4d39('0x7c'))]['ValidationError'](_0x4d39('0x83')));}if(_['isNil'](_0x1b2442[_0x4d39('0x4b')]['mapKeyOffline'])){throw _0x54b2ab[_0x4d39('0x1e')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x4d39('0xbb')+_0x3c7767));}if(!_['includes'](_0x3c7767,_0x1b2442[_0x4d39('0x4b')][_0x4d39('0xbc')])){throw _0x54b2ab[_0x4d39('0x1e')](0x1f4)[_0x4d39('0x2b')](new db[(_0x4d39('0x7c'))][(_0x4d39('0x7d'))](_0x4d39('0xbd')+_0x3c7767));}_0x13417e[_0x1b2442['body'][_0x4d39('0xbc')]]=_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x82')];})[_0x4d39('0x13')](function(){return db['ChatWebsite'][_0x4d39('0x4a')]({'where':{'id':_0x1b2442[_0x4d39('0x55')]['id']},'include':[{'model':db[_0x4d39('0xbe')],'as':_0x4d39('0x88')},{'model':db[_0x4d39('0xbf')],'as':'MailAccount'}]});})[_0x4d39('0x13')](handleEntityNotFound(_0x54b2ab,null))[_0x4d39('0x13')](function(_0x493ba4){if(_0x493ba4&&_0x493ba4['List']){_0x5cb3b4=_0x493ba4;var _0xba839=_[_0x4d39('0x91')](_0x1b2442['body'],{'firstName':_0x1b2442['body'][_0x4d39('0x82')],'phone':_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x82')],'ListId':_0x493ba4[_0x4d39('0x92')]});_0xba839[_0x1b2442[_0x4d39('0x4b')][_0x4d39('0xbc')]]=_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x82')];return db[_0x4d39('0x7b')]['findOrCreate']({'where':_0x13417e,'defaults':_0xba839});}})[_0x4d39('0xa7')](function(_0x3edd68){if(_0x3edd68){_0xa24a4b=_0x3edd68;var _0x390416=fs[_0x4d39('0xc0')](path['join'](config[_0x4d39('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x4d39('0xc1'));var _0x21c18f=ejs[_0x4d39('0xc2')](_0x390416,{'body':_['toPairs'](_0x1b2442[_0x4d39('0x4b')][_0x4d39('0x4b')]),'bodyTitle':_0x5cb3b4['offlineMessageBody']});return db[_0x4d39('0xc3')][_0x4d39('0x52')]({'body':_0x21c18f,'plainBody':htmlToText[_0x4d39('0xc4')](_0x21c18f),'ContactId':_0x3edd68['id'],'ChatWebsiteId':_0x5cb3b4['id']});}})['then'](function(_0x250e82){_0x495829=_0x250e82;if(_0xd9a48e[_0x4d39('0x3a')]){var _0x44060a=_0xd9a48e['map'](function(_0x59aae9){return{'name':_0x59aae9[_0x4d39('0xc5')],'basename':_0x59aae9[_0x4d39('0x65')],'type':_0x59aae9[_0x4d39('0xc6')],'ChatOfflineMessageId':_0x250e82['id']};});_0x4a5d56=_0x44060a[_0x4d39('0x2d')](_0x2dc435=>{var _0x2cc8f7={'filename':_0x2dc435[_0x4d39('0x2a')],'path':path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0xc7'),_0x4d39('0xb9'),_0x4d39('0xc8'),'offline-chat',_0x2dc435['basename'])};return _0x2cc8f7;});if(!_0x5cb3b4['openNewInteraction']){return db['sequelize'][_0x4d39('0xc9')](function(_0x59a048){return db[_0x4d39('0xca')][_0x4d39('0xcb')](_0x44060a,{'transaction':_0x59a048});});}}})[_0x4d39('0x13')](function(){if(_0x495829){_0x21112c=_0x495829;return db[_0x4d39('0xbf')][_0x4d39('0x5a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4d39('0xcc'),'raw':!![],'include':[{'model':db[_0x4d39('0xcd')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x4d39('0x13')](function(_0x57c323){if(_0x57c323&&_0x57c323[_0x4d39('0xcc')]&&_0x5cb3b4['forwardOffline']&&_0x5cb3b4['forwardOfflineAddress']){var _0x21151a=_0x57c323[_0x4d39('0xce')]();return respondWithRpcPromise('SendMail',_0x4d39('0xcf'),{'account':_0x21151a,'message':{'from':util[_0x4d39('0x9c')](_0x4d39('0xd0'),_0x57c323[_0x4d39('0x2a')],_0x57c323['email']||_0x57c323[_0x4d39('0xcc')][_0x4d39('0x4c')]),'to':_0x5cb3b4[_0x4d39('0xd1')],'subject':_0x5cb3b4['offlineMessageSubject'],'html':_0x21112c['body'],'attachments':_0x4a5d56}},client9003)[_0x4d39('0x13')](function(){return _0x21112c;})[_0x4d39('0x1c')](function(_0x542319){logger[_0x4d39('0x19')](_0x542319);});}})[_0x4d39('0x13')](function(){if(_0x5cb3b4&&_0x5cb3b4[_0x4d39('0xd2')]&&_0x5cb3b4[_0x4d39('0xd3')]){var _0x101a2b=[];if(_0xd9a48e[_0x4d39('0x3a')]){_0x101a2b=_0xd9a48e[_0x4d39('0x2d')](function(_0x4d0a6e){return{'name':_0x4d0a6e[_0x4d39('0xc5')],'basename':_0x4d0a6e[_0x4d39('0x65')],'type':_0x4d0a6e[_0x4d39('0xc6')],'ChatOfflineMessageId':_0x495829['id']};});}var _0x39a1a4;if(!_[_0x4d39('0x6c')](_0x5cb3b4['subjectOffline'])){var _0x4fc2ca=_[_0x4d39('0x2d')](_0x1b2442[_0x4d39('0x4b')],function(_0x283dbd){return _0x283dbd;});var _0x276554=_[_0x4d39('0xd4')](_0x4fc2ca)[0x0];var _0x1a2c20=_['mapValues'](_0x276554,function(_0x4f4241){return _0x4f4241;});_0x39a1a4=_0x1a2c20[0x1][_0x5cb3b4[_0x4d39('0xd5')]];}var _0x5da198={'from':_0xa24a4b[_0x4d39('0xd6')],'firstName':_0xa24a4b['firstName'],'lastName':_0xa24a4b['lastName'],'mapKey':_0x4d39('0xd6'),'message':{'from':_0xa24a4b[_0x4d39('0xd6')],'to':_0x5cb3b4['MailAccount'][_0x4d39('0xd6')],'cc':'','subject':_[_0x4d39('0x6c')](_0x39a1a4)?_0x5cb3b4[_0x4d39('0xd7')]:_0x39a1a4,'messageId':'','sentAt':new Date(),'attach':_0x101a2b[_0x4d39('0x3a')],'attachments':_0x101a2b,'originChannel':_0x4d39('0xd8'),'ChatWebsiteId':_0x5cb3b4['id'],'ChatOfflineMessageId':_0x21112c['id'],'originTo':_0x5cb3b4[_0x4d39('0xbf')][_0x4d39('0xd6')]},'body':_0x21112c['body']};var _0xb98304={'account':{'id':_0x5cb3b4[_0x4d39('0xd3')]},'body':_0x5da198,'log':_0x4d39('0xd9')};return respondWithRpcPromise('NotifyMailAccount',_0x4d39('0xda'),_0xb98304,client9001)[_0x4d39('0x13')](function(){return _0x21112c;})['catch'](function(_0x4acad7){logger[_0x4d39('0x19')](_0x4acad7);});}return;})[_0x4d39('0x13')](function(){if(_0x21112c){return _0x21112c;}})['then'](respondWithResult(_0x54b2ab,null))['catch'](function(_0x315274){logger[_0x4d39('0x19')](_0x4d39('0x1c'),_0x315274);for(var _0x45ff19 of _0xd9a48e){var _0x8746a8=path[_0x4d39('0x68')](config[_0x4d39('0x69')],_0x4d39('0xc7'),_0x4d39('0xb9'),_0x4d39('0xc8'),_0x4d39('0xdb'),_0x45ff19[_0x4d39('0x65')]);fs_extra[_0x4d39('0xdc')](_0x8746a8)[_0x4d39('0x1c')](function(_0x5bc606){logger[_0x4d39('0x19')](_0x4d39('0xdd'),_0x8746a8,_0x5bc606);});}});};exports['addInteraction']=function(_0x1d041f,_0x2b7402){return db[_0x4d39('0xa3')][_0x4d39('0x4a')]({'where':{'id':_0x1d041f[_0x4d39('0x55')]['id']}})['then'](handleEntityNotFound(_0x2b7402,null))['then'](function(_0x5b48d6){if(_0x5b48d6){return _0x5b48d6[_0x4d39('0xde')](_0x1d041f[_0x4d39('0x4b')][_0x4d39('0xdf')],_[_0x4d39('0xe0')](_0x1d041f['body'],[_0x4d39('0xdf'),'id'])||{});}})['then'](respondWithResult(_0x2b7402,null))[_0x4d39('0x1c')](handleError(_0x2b7402,null));};exports[_0x4d39('0xe1')]=function(_0xa2e623,_0x287143){var _0x4d6c96={'raw':![],'where':{}};var _0x183d3a={};var _0x46ebd2={'count':0x0,'rows':[]};return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0xa2e623[_0x4d39('0x55')]['id']}})['then'](handleEntityNotFound(_0x287143,null))[_0x4d39('0x13')](function(_0x4ac37c){if(_0x4ac37c){_0x183d3a[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0xa3')][_0x4d39('0x2f')]);_0x183d3a[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0xa2e623[_0x4d39('0x35')]);_0x183d3a['filters']=_[_0x4d39('0x38')](_0x183d3a['model'],_0x183d3a[_0x4d39('0x35')]);_0x4d6c96['attributes']=_[_0x4d39('0x38')](_0x183d3a[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0xa2e623[_0x4d39('0x35')]['fields']));_0x4d6c96[_0x4d39('0x37')]=_0x4d6c96['attributes']['length']?_0x4d6c96[_0x4d39('0x37')]:_0x183d3a['model'];if(!_0xa2e623['query']['hasOwnProperty'](_0x4d39('0x5b'))){_0x4d6c96[_0x4d39('0x23')]=qs[_0x4d39('0x23')](_0xa2e623['query'][_0x4d39('0x23')]);_0x4d6c96['offset']=qs[_0x4d39('0x21')](_0xa2e623[_0x4d39('0x35')][_0x4d39('0x21')]);}_0x4d6c96[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0xa2e623['query'][_0x4d39('0x3d')]);_0x4d6c96['where']=qs[_0x4d39('0x36')](_[_0x4d39('0x3f')](_0xa2e623['query'],_0x183d3a[_0x4d39('0x36')]));_0x4d6c96[_0x4d39('0x3e')][_0x4d39('0x58')]=_0x4ac37c['id'];if(_0xa2e623[_0x4d39('0x35')]['filter']){_0x4d6c96['where']=_[_0x4d39('0x41')](_0x4d6c96[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x2d')](_0x4d6c96[_0x4d39('0x37')],function(_0x2031c3){var _0x4d43cf={};_0x4d43cf[_0x2031c3]={'$like':'%'+_0xa2e623[_0x4d39('0x35')][_0x4d39('0x40')]+'%'};return _0x4d43cf;})});}_0x4d6c96=_[_0x4d39('0x41')]({},_0x4d6c96,_0xa2e623[_0x4d39('0x43')]);return db[_0x4d39('0xa3')][_0x4d39('0x24')]({'where':_0x4d6c96[_0x4d39('0x3e')]})[_0x4d39('0x13')](function(_0x143ffd){_0x46ebd2['count']=_0x143ffd;if(_0xa2e623['query'][_0x4d39('0x44')]){_0x4d6c96[_0x4d39('0x45')]=[{'model':db[_0x4d39('0x7b')],'as':_0x4d39('0xe2'),'required':![]},{'model':db['User'],'as':_0x4d39('0xe3'),'attributes':[_0x4d39('0x2a'),_0x4d39('0xe4'),_0x4d39('0xe5')],'required':![]},{'model':db['Tag'],'as':_0x4d39('0xe6'),'attributes':['id',_0x4d39('0x2a'),_0x4d39('0xe7')],'where':_0xa2e623[_0x4d39('0x35')]['tag']?{'id':_0xa2e623[_0x4d39('0x35')]['tag']}:undefined,'required':_0xa2e623[_0x4d39('0x35')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x4d39('0x46')](_0x4d6c96);})['then'](function(_0x361b51){_0x46ebd2[_0x4d39('0x47')]=_0x361b51;return _0x46ebd2;});}})[_0x4d39('0x13')](respondWithFilteredResult(_0x287143,_0x4d6c96))['catch'](handleError(_0x287143,null));};function iftimePromise(_0x20c4f4,_0x5aa1f1){return respondWithRpcPromise(_0x4d39('0xe8'),'getSnippet',{'command':_0x5aa1f1['timezone']?util[_0x4d39('0x9c')](_0x4d39('0xe9'),_0x20c4f4[_0x4d39('0xea')],_0x5aa1f1['timezone']):util['format']('iftime\x20%s',_0x20c4f4[_0x4d39('0xea')])},client9002)[_0x4d39('0x13')](function(_0x42a0e5){var _0x562f35=_0x42a0e5&&_0x42a0e5[_0x4d39('0xeb')](_0x4d39('0xec'))>=0x0?!![]:![];logger[_0x4d39('0x14')](_0x4d39('0xed'),_0x5aa1f1['id'],_0x20c4f4['id'],_0x20c4f4[_0x4d39('0xea')],_0x562f35?_0x4d39('0xee'):_0x4d39('0xef'),_0x5aa1f1[_0x4d39('0xf0')]?_0x5aa1f1[_0x4d39('0xf0')]:_0x4d39('0xf1'));return _0x562f35;})[_0x4d39('0x1c')](function(_0x297a51){logger[_0x4d39('0x19')](_0x4d39('0xed'),_0x5aa1f1['id'],_0x20c4f4['id'],_0x20c4f4[_0x4d39('0xea')],util[_0x4d39('0xf2')](_0x297a51,{'showHidden':![],'depth':null}),_0x5aa1f1['timezone']?_0x5aa1f1['timezone']:_0x4d39('0xf1'));return![];});}exports[_0x4d39('0xf3')]=function(_0x1e98ed,_0x33dcb5){var _0x470ca5=0x0;var _0xbaa8ba=0x0;var _0x45d76d=![];var _0x23cee4;var _0x34d19c;return db['ChatWebsite'][_0x4d39('0x4a')]({'where':{'id':_0x1e98ed[_0x4d39('0x55')]['id']},'include':[{'model':db['Interval'],'as':_0x4d39('0xf4'),'include':[{'model':db[_0x4d39('0xf4')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x33dcb5,null))['then'](function(_0x5246ca){if(_0x5246ca){_0x23cee4=_0x5246ca;return _0x5246ca['getProactiveActions']({'raw':!![]});}})[_0x4d39('0x13')](function(_0x54d929){if(_0x23cee4){if(_0x54d929){_0x34d19c=_0x54d929;}}return require(_0x4d39('0x6a'))[_0x4d39('0xf5')]();})['then'](function(_0x3579fa){if(_0x3579fa){_0xbaa8ba=_0x3579fa[_0x4d39('0xf6')];_0x45d76d=_0x3579fa[_0x4d39('0x6b')];}})['then'](function(){return db[_0x4d39('0xa3')]['count']({'where':{'closed':![]}});})[_0x4d39('0x13')](function(_0x2d818e){_0x470ca5=_0x2d818e;if(_0xbaa8ba&&_0x2d818e>_0xbaa8ba){return db[_0x4d39('0xf7')]['findOne']({'where':{'id':0x1}})[_0x4d39('0x13')](function(_0x19fee4){if(_0x19fee4){_0x19fee4[_0x4d39('0xf8')](_0x4d39('0xf9'));}});}})[_0x4d39('0x13')](function(){if(_0x23cee4['Interval']&&_0x23cee4[_0x4d39('0xf4')][_0x4d39('0xfa')]){var _0x2bf6bf=[];for(var _0x6a63a6=0x0;_0x6a63a6<_0x23cee4[_0x4d39('0xf4')][_0x4d39('0xfa')]['length'];_0x6a63a6++){var _0x5f2bfa=_0x23cee4[_0x4d39('0xf4')]['Intervals'][_0x6a63a6][_0x4d39('0x27')]({'plain':!![]});_0x2bf6bf[_0x4d39('0xac')](iftimePromise(_0x5f2bfa,_0x23cee4));}return BPromise[_0x4d39('0xfb')](_0x2bf6bf)[_0x4d39('0x13')](function(_0xef46fc){return _['some'](_0xef46fc);});}else{return!![];}})['then'](function(_0x325189){var _0x4c0ce3=fs['readFileSync'](path['join'](config[_0x4d39('0x69')],_0x4d39('0xfc')),_0x4d39('0xc1'));var _0x5eeba7=new url['URL'](_0x23cee4['address'])[_0x4d39('0xfd')];var _0x5459a3=_0x4d39('0xfe');var _0x3403ff=![];var _0x358a80={'chatVersion':_0x5459a3,'chatWebsiteAddressOrigin':_0x5eeba7,'remote':_0x23cee4[_0x4d39('0xff')],'query':querystring[_0x4d39('0x100')](_[_0x4d39('0x41')](_0x23cee4[_0x4d39('0x27')]({'plain':!![]}),{'customerIp':_0x1e98ed[_0x4d39('0x79')]['x-forwarded-for']||_0x1e98ed[_0x4d39('0x79')][_0x4d39('0x101')]||_0x1e98ed[_0x4d39('0x102')][_0x4d39('0x103')]||_0x1e98ed['ip'],'referer':_0x1e98ed[_0x4d39('0x79')][_0x4d39('0x104')],'openedInteractions':_0x470ca5,'maxInteractions':_0xbaa8ba,'virtual':_0x45d76d[_0x4d39('0xf6')],'online':_0x325189,'custom':_0x45d76d}))[_0x4d39('0x105')](/'/g,'\x5c\x27')};_0x33dcb5[_0x4d39('0x2b')](ejs['render'](Mustache[_0x4d39('0xc2')](_0x4c0ce3,_0x358a80),{'proactiveActions':_0x34d19c,'alignment':_0x23cee4[_0x4d39('0x106')],'verticalAlignment':_0x23cee4[_0x4d39('0x107')],'div_color':_0x23cee4[_0x4d39('0xe7')],'labelText':_0x23cee4[_0x4d39('0x108')],'text_color':_0x23cee4[_0x4d39('0x109')],'text_button_color':_0x23cee4['textButtonColor'],'button_color':_0x23cee4[_0x4d39('0x10a')],'background_color':_0x23cee4[_0x4d39('0x10b')],'hideWhenOffline':_0x23cee4['hideWhenOffline'],'intervalId':_0x23cee4['IntervalId'],'isDevelopment':_0x3403ff,'chatVersion':_0x5459a3}));})[_0x4d39('0x1c')](handleError(_0x33dcb5,null));};exports[_0x4d39('0x10c')]=function(_0x1f6ced,_0x5f0d7a){var _0x49ef0e=_0x1f6ced['params']['id'];var _0x1f4374=_0x1f6ced[_0x4d39('0x4b')];var _0x1391ea=0xc8;var _0xc09cbe=null;return db[_0x4d39('0x10d')]['transaction']({'isolationLevel':db[_0x4d39('0x10d')]['Transaction'][_0x4d39('0x10e')]['READ_COMMITTED']},function(_0x4afb59){return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0x49ef0e},'transaction':_0x4afb59})[_0x4d39('0x13')](function(_0x244661){if(_0x244661){return db[_0x4d39('0x10f')]['destroy']({'where':{'ChatWebsiteId':_0x49ef0e},'transaction':_0x4afb59})[_0x4d39('0x13')](function(){var _0x53275d=_[_0x4d39('0x2d')](_0x1f4374,function(_0x3a789e){_0x3a789e[_0x4d39('0x58')]=_0x49ef0e;return _0x3a789e;});return db[_0x4d39('0x10f')]['bulkCreate'](_0x53275d,{'transaction':_0x4afb59});});}else{_0x1391ea=0x194;_0xc09cbe=[];}});})[_0x4d39('0x13')](function(){if(_0x1391ea!==0x194){return db[_0x4d39('0x10f')][_0x4d39('0x110')]({'where':{'ChatWebsiteId':_0x49ef0e},'order':'priority'})[_0x4d39('0x13')](function(_0x58f5d3){_0xc09cbe=_0x58f5d3;});}})[_0x4d39('0x1c')](function(_0x1ab37b){_0x1391ea=0x1f4;logger['error'](_0x1ab37b[_0x4d39('0x29')]);if(_0x1ab37b[_0x4d39('0x2a')]){delete _0x1ab37b[_0x4d39('0x2a')];}_0xc09cbe=_0x1ab37b;})['finally'](function(){if(_0xc09cbe===null){_0x5f0d7a[_0x4d39('0x1d')](_0x1391ea);}else{if(_0x1391ea===0x1f4){_0x5f0d7a['status'](_0x1391ea)[_0x4d39('0x2b')](_0xc09cbe);}else{_0x5f0d7a[_0x4d39('0x1e')](_0x1391ea)[_0x4d39('0x20')](_0xc09cbe);}}});};exports[_0x4d39('0x111')]=function(_0x3e7085,_0x26d30a){var _0x30f07b={};var _0x488d18={};var _0x3406c0;var _0x3f46ad;return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0x3e7085['params']['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x26d30a,null))[_0x4d39('0x13')](function(_0x2a1541){if(_0x2a1541){_0x3406c0=_0x2a1541;_0x488d18[_0x4d39('0x33')]=_[_0x4d39('0x34')](db['ChatApplication'][_0x4d39('0x2f')]);_0x488d18[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x3e7085[_0x4d39('0x35')]);_0x488d18['filters']=_[_0x4d39('0x38')](_0x488d18['model'],_0x488d18[_0x4d39('0x35')]);_0x30f07b['attributes']=_['intersection'](_0x488d18[_0x4d39('0x33')],qs['fields'](_0x3e7085['query'][_0x4d39('0x39')]));_0x30f07b[_0x4d39('0x37')]=_0x30f07b[_0x4d39('0x37')]['length']?_0x30f07b[_0x4d39('0x37')]:_0x488d18[_0x4d39('0x33')];_0x30f07b[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0x3e7085[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x30f07b[_0x4d39('0x3e')]=qs['filters'](_[_0x4d39('0x3f')](_0x3e7085[_0x4d39('0x35')],_0x488d18[_0x4d39('0x36')]));if(_0x3e7085['query'][_0x4d39('0x40')]){_0x30f07b['where']=_[_0x4d39('0x41')](_0x30f07b['where'],{'$or':_[_0x4d39('0x2d')](_0x30f07b[_0x4d39('0x37')],function(_0x36d346){var _0x527cee={};_0x527cee[_0x36d346]={'$like':'%'+_0x3e7085[_0x4d39('0x35')][_0x4d39('0x40')]+'%'};return _0x527cee;})});}_0x30f07b=_[_0x4d39('0x41')]({},_0x30f07b,_0x3e7085[_0x4d39('0x43')]);return _0x3406c0['getApplications'](_0x30f07b);}})[_0x4d39('0x13')](function(_0x7ac915){if(_0x7ac915){_0x3f46ad=_0x7ac915[_0x4d39('0x3a')];if(!_0x3e7085[_0x4d39('0x35')][_0x4d39('0x3b')]('nolimit')){_0x30f07b[_0x4d39('0x23')]=qs[_0x4d39('0x23')](_0x3e7085[_0x4d39('0x35')]['limit']);_0x30f07b[_0x4d39('0x21')]=qs[_0x4d39('0x21')](_0x3e7085[_0x4d39('0x35')]['offset']);}return _0x3406c0[_0x4d39('0x111')](_0x30f07b);}})[_0x4d39('0x13')](function(_0x50d194){if(_0x50d194){return _0x50d194?{'count':_0x3f46ad,'rows':_0x50d194}:null;}})['then'](respondWithResult(_0x26d30a,null))['catch'](handleError(_0x26d30a,null));};exports[_0x4d39('0x112')]=function(_0x25c27e,_0x17c83c){return db[_0x4d39('0x113')][_0x4d39('0x4a')]({'where':{'id':_0x25c27e[_0x4d39('0x55')]['id']}})['then'](handleEntityNotFound(_0x17c83c,null))[_0x4d39('0x13')](function(_0x27a8e1){if(_0x27a8e1){return _0x27a8e1[_0x4d39('0x112')](_0x25c27e[_0x4d39('0x4b')][_0x4d39('0xdf')],_['omit'](_0x25c27e[_0x4d39('0x4b')],[_0x4d39('0xdf'),'id'])||{});}})[_0x4d39('0x13')](respondWithResult(_0x17c83c,null))[_0x4d39('0x1c')](handleError(_0x17c83c,null));};exports[_0x4d39('0x114')]=function(_0xa5fabf,_0xa75008){var _0x265ecf={};var _0x2f935b={};var _0x5deeee;var _0x35e92c;return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0xa5fabf[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0xa75008,null))['then'](function(_0x394800){if(_0x394800){_0x5deeee=_0x394800;_0x2f935b[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x115')]['rawAttributes']);_0x2f935b[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0xa5fabf[_0x4d39('0x35')]);_0x2f935b['filters']=_[_0x4d39('0x38')](_0x2f935b[_0x4d39('0x33')],_0x2f935b[_0x4d39('0x35')]);_0x265ecf[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x2f935b[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0xa5fabf['query']['fields']));_0x265ecf[_0x4d39('0x37')]=_0x265ecf[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x265ecf[_0x4d39('0x37')]:_0x2f935b['model'];_0x265ecf[_0x4d39('0x3c')]=qs[_0x4d39('0x3d')](_0xa5fabf[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x265ecf[_0x4d39('0x3e')]=qs['filters'](_[_0x4d39('0x3f')](_0xa5fabf[_0x4d39('0x35')],_0x2f935b[_0x4d39('0x36')]));if(_0xa5fabf[_0x4d39('0x35')][_0x4d39('0x40')]){_0x265ecf[_0x4d39('0x3e')]=_[_0x4d39('0x41')](_0x265ecf[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x2d')](_0x265ecf[_0x4d39('0x37')],function(_0x195ce5){var _0xaaf3c2={};_0xaaf3c2[_0x195ce5]={'$like':'%'+_0xa5fabf[_0x4d39('0x35')][_0x4d39('0x40')]+'%'};return _0xaaf3c2;})});}_0x265ecf=_[_0x4d39('0x41')]({},_0x265ecf,_0xa5fabf[_0x4d39('0x43')]);return _0x5deeee[_0x4d39('0x114')](_0x265ecf);}})[_0x4d39('0x13')](function(_0x99bba7){if(_0x99bba7){_0x35e92c=_0x99bba7[_0x4d39('0x3a')];if(!_0xa5fabf[_0x4d39('0x35')]['hasOwnProperty'](_0x4d39('0x5b'))){_0x265ecf[_0x4d39('0x23')]=qs['limit'](_0xa5fabf['query'][_0x4d39('0x23')]);_0x265ecf[_0x4d39('0x21')]=qs['offset'](_0xa5fabf[_0x4d39('0x35')][_0x4d39('0x21')]);}return _0x5deeee['getProactiveActions'](_0x265ecf);}})['then'](function(_0x3f2004){if(_0x3f2004){return _0x3f2004?{'count':_0x35e92c,'rows':_0x3f2004}:null;}})[_0x4d39('0x13')](respondWithResult(_0xa75008,null))[_0x4d39('0x1c')](handleError(_0xa75008,null));};exports['getFields']=function(_0x2d5576,_0x2c206b){var _0x4b7d32=_0x2d5576[_0x4d39('0x35')]['online']==='false'?_0x4d39('0x116'):_0x4d39('0x117');return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'attributes':['id',_0x4b7d32],'where':{'id':_0x2d5576[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x2c206b,null))[_0x4d39('0x13')](function(_0x4845c1){if(_0x4845c1){var _0x56a9e4=_0x4845c1[_0x4b7d32];var _0x2f4584=_0x56a9e4&&_0x56a9e4[_0x4d39('0x118')]?_0x56a9e4[_0x4d39('0x118')]:[];_0x2c206b[_0x4d39('0x2b')]({'fromKey':_[_0x4d39('0x6c')](_0x56a9e4[_0x4d39('0x119')])?undefined:_0x56a9e4[_0x4d39('0x119')],'count':_0x2f4584[_0x4d39('0x3a')],'rows':_0x2f4584});}})['catch'](handleError(_0x2c206b,null));};exports[_0x4d39('0x11a')]=function(_0x591fc,_0x5d54dd){var _0x3cac44={'raw':![],'where':{}};var _0x541f4e={};var _0x4d11eb={'count':0x0,'rows':[]};return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0x591fc[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x5d54dd,null))[_0x4d39('0x13')](function(_0x5e010e){if(_0x5e010e){_0x541f4e['model']=_[_0x4d39('0x34')](db[_0x4d39('0xc3')][_0x4d39('0x2f')]);_0x541f4e['query']=_['keys'](_0x591fc[_0x4d39('0x35')]);_0x541f4e[_0x4d39('0x36')]=_[_0x4d39('0x38')](_0x541f4e[_0x4d39('0x33')],_0x541f4e[_0x4d39('0x35')]);_0x3cac44[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x541f4e[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0x591fc[_0x4d39('0x35')][_0x4d39('0x39')]));_0x3cac44[_0x4d39('0x37')]=_0x3cac44[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x3cac44[_0x4d39('0x37')]:_0x541f4e['model'];if(!_0x591fc[_0x4d39('0x35')]['hasOwnProperty'](_0x4d39('0x5b'))){_0x3cac44['limit']=qs[_0x4d39('0x23')](_0x591fc[_0x4d39('0x35')][_0x4d39('0x23')]);_0x3cac44[_0x4d39('0x21')]=qs[_0x4d39('0x21')](_0x591fc[_0x4d39('0x35')]['offset']);}_0x3cac44['order']=qs['sort'](_0x591fc[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x3cac44[_0x4d39('0x3e')]=qs['filters'](_[_0x4d39('0x3f')](_0x591fc[_0x4d39('0x35')],_0x541f4e['filters']));_0x3cac44['where'][_0x4d39('0x58')]=_0x5e010e['id'];if(_0x591fc[_0x4d39('0x35')][_0x4d39('0x40')]){_0x3cac44[_0x4d39('0x3e')]=_[_0x4d39('0x41')](_0x3cac44['where'],{'$or':_[_0x4d39('0x2d')](_0x3cac44['attributes'],function(_0x39f572){var _0x44a388={};_0x44a388[_0x39f572]={'$like':'%'+_0x591fc[_0x4d39('0x35')][_0x4d39('0x40')]+'%'};return _0x44a388;})});}_0x3cac44=_[_0x4d39('0x41')]({},_0x3cac44,_0x591fc[_0x4d39('0x43')]);return db['ChatOfflineMessage'][_0x4d39('0x24')]({'where':_0x3cac44[_0x4d39('0x3e')]})[_0x4d39('0x13')](function(_0x209733){_0x4d11eb['count']=_0x209733;if(_0x591fc['query']['includeAll']){_0x3cac44['include']=[{'all':!![]}];}else{_0x3cac44['include']=[{'model':db['CmContact'],'as':_0x4d39('0xe2'),'required':![]},{'model':db[_0x4d39('0xca')],'as':_0x4d39('0x11b'),'required':![]}];}return db['ChatOfflineMessage'][_0x4d39('0x46')](_0x3cac44);})[_0x4d39('0x13')](function(_0x2272de){_0x4d11eb[_0x4d39('0x47')]=_0x2272de;return _0x4d11eb;});}})[_0x4d39('0x13')](respondWithFilteredResult(_0x5d54dd,_0x3cac44))['catch'](handleError(_0x5d54dd,null));};exports[_0x4d39('0x11c')]=function(_0x13cc0c,_0x83a0fb){return db[_0x4d39('0x2e')][_0x4d39('0x4a')]({'where':{'id':_0x13cc0c[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x83a0fb,null))[_0x4d39('0x13')](function(_0x32c4f4){if(_0x32c4f4){return _0x32c4f4[_0x4d39('0x11c')](_0x13cc0c[_0x4d39('0x4b')][_0x4d39('0xdf')],_['omit'](_0x13cc0c[_0x4d39('0x4b')],[_0x4d39('0xdf'),'id'])||{})[_0x4d39('0xa7')](function(_0x3142a4){for(var _0x1c1077=0x0;_0x1c1077<_0x13cc0c[_0x4d39('0x4b')]['ids'][_0x4d39('0x3a')];_0x1c1077+=0x1){socket[_0x4d39('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x13cc0c['body'][_0x4d39('0xdf')][_0x1c1077]),'ChatWebsiteId':Number(_0x13cc0c[_0x4d39('0x55')]['id'])});}return _0x3142a4;});}})[_0x4d39('0x13')](respondWithResult(_0x83a0fb,null))[_0x4d39('0x1c')](handleError(_0x83a0fb,null));};exports['removeAgents']=function(_0x4ec6d7,_0x365e88){return db[_0x4d39('0x2e')]['find']({'where':{'id':_0x4ec6d7[_0x4d39('0x55')]['id']}})[_0x4d39('0x13')](handleEntityNotFound(_0x365e88,null))[_0x4d39('0x13')](function(_0x5982de){if(_0x5982de){return _0x5982de['removeAgents'](_0x4ec6d7[_0x4d39('0x35')][_0x4d39('0xdf')])[_0x4d39('0x13')](function(){if(_[_0x4d39('0x11e')](_0x4ec6d7[_0x4d39('0x35')][_0x4d39('0xdf')])){for(var _0x4baecb=0x0;_0x4baecb<_0x4ec6d7[_0x4d39('0x35')]['ids'][_0x4d39('0x3a')];_0x4baecb+=0x1){socket[_0x4d39('0x11d')](_0x4d39('0x11f'),{'UserId':Number(_0x4ec6d7['query']['ids'][_0x4baecb]),'ChatWebsiteId':Number(_0x4ec6d7[_0x4d39('0x55')]['id'])});}}else{socket[_0x4d39('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x4ec6d7[_0x4d39('0x35')][_0x4d39('0xdf')]),'ChatWebsiteId':Number(_0x4ec6d7['params']['id'])});}});}})[_0x4d39('0x13')](respondWithStatusCode(_0x365e88,null))[_0x4d39('0x1c')](handleError(_0x365e88,null));};exports[_0x4d39('0x120')]=function(_0x6eacf1,_0x18f5a2){var _0x52dfed={};var _0x505a1c={};var _0x2e3f66;var _0x14a864;return db[_0x4d39('0x2e')][_0x4d39('0x5a')]({'where':{'id':_0x6eacf1['params']['id']}})['then'](handleEntityNotFound(_0x18f5a2,null))[_0x4d39('0x13')](function(_0x36d87d){if(_0x36d87d){_0x2e3f66=_0x36d87d;_0x505a1c[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0xb0')][_0x4d39('0x2f')]);_0x505a1c[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x6eacf1[_0x4d39('0x35')]);_0x505a1c[_0x4d39('0x36')]=_['intersection'](_0x505a1c[_0x4d39('0x33')],_0x505a1c['query']);_0x52dfed[_0x4d39('0x37')]=_[_0x4d39('0x38')](_0x505a1c[_0x4d39('0x33')],qs[_0x4d39('0x39')](_0x6eacf1['query']['fields']));_0x52dfed[_0x4d39('0x37')]=_0x52dfed[_0x4d39('0x37')][_0x4d39('0x3a')]?_0x52dfed[_0x4d39('0x37')]:_0x505a1c[_0x4d39('0x33')];_0x52dfed['order']=qs[_0x4d39('0x3d')](_0x6eacf1[_0x4d39('0x35')]['sort']);_0x52dfed['where']=qs[_0x4d39('0x36')](_['pick'](_0x6eacf1[_0x4d39('0x35')],_0x505a1c['filters']));if(_0x6eacf1[_0x4d39('0x35')]['filter']){_0x52dfed[_0x4d39('0x3e')]=_[_0x4d39('0x41')](_0x52dfed['where'],{'$or':_[_0x4d39('0x2d')](_0x52dfed[_0x4d39('0x37')],function(_0x6acc88){var _0x2d6294={};_0x2d6294[_0x6acc88]={'$like':'%'+_0x6eacf1['query'][_0x4d39('0x40')]+'%'};return _0x2d6294;})});}_0x52dfed=_[_0x4d39('0x41')]({},_0x52dfed,_0x6eacf1['options']);return _0x2e3f66[_0x4d39('0x120')](_0x52dfed);}})[_0x4d39('0x13')](function(_0x4709ed){if(_0x4709ed){_0x14a864=_0x4709ed[_0x4d39('0x3a')];if(!_0x6eacf1[_0x4d39('0x35')]['hasOwnProperty'](_0x4d39('0x5b'))){_0x52dfed['limit']=qs['limit'](_0x6eacf1[_0x4d39('0x35')][_0x4d39('0x23')]);_0x52dfed[_0x4d39('0x21')]=qs[_0x4d39('0x21')](_0x6eacf1['query']['offset']);}return _0x2e3f66['getAgents'](_0x52dfed);}})[_0x4d39('0x13')](function(_0x59ae55){if(_0x59ae55){return _0x59ae55?{'count':_0x14a864,'rows':_0x59ae55}:null;}})[_0x4d39('0x13')](respondWithResult(_0x18f5a2,null))['catch'](handleError(_0x18f5a2,null));}; \ No newline at end of file +var _0x5003=['toPairs','ChatOfflineMessage','fromString','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','Contact','Owner','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','Intervals','License','increment','all','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','virtual','replace','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getProactiveActions','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','bluebird','mustache','fs-extra','lodash','querystring','ioredis','api','../../config/environment','url','../../mysqldb','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','Disposition','findOne','order','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','headers','user-agent','getResult','chat','ValidationError','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','Applications','account','applications','list','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render'];(function(_0x52ea5e,_0x3dfc55){var _0x496dbf=function(_0x3703d2){while(--_0x3703d2){_0x52ea5e['push'](_0x52ea5e['shift']());}};_0x496dbf(++_0x3dfc55);}(_0x5003,0x191));var _0x3500=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5003[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x3500('0x0'));var Mustache=require(_0x3500('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3500('0x2'));var _=require(_0x3500('0x3'));var querystring=require(_0x3500('0x4'));var Redis=require(_0x3500('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3500('0x6'));var config=require(_0x3500('0x7'));var url=require(_0x3500('0x8'));var db=require(_0x3500('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x3500('0xa'),'port':0x18eb});var socket=require(_0x3500('0xb'))(new Redis(config[_0x3500('0xc')]));require(_0x3500('0xd'))[_0x3500('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x3500('0xf'));var client=jayson[_0x3500('0x10')][_0x3500('0x11')]({'port':0x232c});var client9002=jayson[_0x3500('0x10')][_0x3500('0x11')]({'port':0x232a});var client9003=jayson[_0x3500('0x10')][_0x3500('0x11')]({'port':0x232b});var client9001=jayson[_0x3500('0x10')][_0x3500('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x4fc172,_0x9ad645,_0x6aceda,_0x74f43a){return new BPromise(function(_0x1ea157,_0x36da3d){var _0x93d904=_0x74f43a||client;return _0x93d904[_0x3500('0x12')](_0x4fc172,_0x6aceda)[_0x3500('0x13')](function(_0xd2f983){logger[_0x3500('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x9ad645,_0x3500('0x15'));logger[_0x3500('0x16')](_0x3500('0x17'),_0x9ad645,_0x3500('0x15'),JSON[_0x3500('0x18')](_0xd2f983));if(_0xd2f983[_0x3500('0x19')]){if(_0xd2f983[_0x3500('0x19')][_0x3500('0x1a')]===0x1f4){logger['error'](_0x3500('0x1b'),_0x9ad645,_0xd2f983[_0x3500('0x19')][_0x3500('0x1c')]);return _0x36da3d(_0xd2f983['error']['message']);}logger[_0x3500('0x19')](_0x3500('0x1b'),_0x9ad645,_0xd2f983[_0x3500('0x19')][_0x3500('0x1c')]);return _0x1ea157(_0xd2f983[_0x3500('0x19')]['message']);}else{logger[_0x3500('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x9ad645,_0x3500('0x15'));_0x1ea157(_0xd2f983['result']['message']);}})[_0x3500('0x1d')](function(_0xf6e510){logger[_0x3500('0x19')](_0x3500('0x1b'),_0x9ad645,_0xf6e510);_0x36da3d(_0xf6e510);});});}function respondWithStatusCode(_0x574584,_0x57d71b){_0x57d71b=_0x57d71b||0xcc;return function(_0x1cb5d8){if(_0x1cb5d8){return _0x574584['sendStatus'](_0x57d71b);}return _0x574584[_0x3500('0x1e')](_0x57d71b)['end']();};}function respondWithResult(_0x1df317,_0x12cb92){_0x12cb92=_0x12cb92||0xc8;return function(_0x2e7bdf){if(_0x2e7bdf){return _0x1df317['status'](_0x12cb92)['json'](_0x2e7bdf);}};}function respondWithFilteredResult(_0x5f0b16,_0x996365){return function(_0x543a26){if(_0x543a26){var _0x68004e=typeof _0x996365[_0x3500('0x1f')]===_0x3500('0x20')&&typeof _0x996365['limit']==='undefined';var _0x19344e=_0x543a26['count'];var _0x349d27=_0x68004e?0x0:_0x996365['offset'];var _0x158fca=_0x68004e?_0x543a26[_0x3500('0x21')]:_0x996365[_0x3500('0x1f')]+_0x996365[_0x3500('0x22')];var _0xe76016;if(_0x158fca>=_0x19344e){_0x158fca=_0x19344e;_0xe76016=0xc8;}else{_0xe76016=0xce;}_0x5f0b16[_0x3500('0x1e')](_0xe76016);return _0x5f0b16[_0x3500('0x23')](_0x3500('0x24'),_0x349d27+'-'+_0x158fca+'/'+_0x19344e)[_0x3500('0x25')](_0x543a26);}return null;};}function saveUpdates(_0x16f0ed){return function(_0x4a7b6d){if(_0x4a7b6d){return _0x4a7b6d[_0x3500('0x26')](_0x16f0ed)[_0x3500('0x13')](function(_0x506232){return _0x506232;});}return null;};}function removeEntity(_0x5529ff){return function(_0x1c7458){if(_0x1c7458){return _0x1c7458[_0x3500('0x27')]()[_0x3500('0x13')](function(){var _0x334b66=_0x1c7458[_0x3500('0x28')]({'plain':!![]});var _0xbdf60c=_0x3500('0x29');return db[_0x3500('0x2a')]['destroy']({'where':{'type':_0xbdf60c,'resourceId':_0x334b66['id']}})[_0x3500('0x13')](function(){return _0x1c7458;});})['then'](function(){_0x5529ff[_0x3500('0x1e')](0xcc)[_0x3500('0x2b')]();});}};}function handleEntityNotFound(_0x3fae1b){return function(_0x28d345){if(!_0x28d345){_0x3fae1b[_0x3500('0x2c')](0x194);}return _0x28d345;};}function handleError(_0xf1b732,_0x1c3a19){_0x1c3a19=_0x1c3a19||0x1f4;return function(_0x3077fc){logger[_0x3500('0x19')](_0x3077fc[_0x3500('0x2d')]);if(_0x3077fc[_0x3500('0x2e')]){delete _0x3077fc[_0x3500('0x2e')];}_0xf1b732[_0x3500('0x1e')](_0x1c3a19)['send'](_0x3077fc);};}exports[_0x3500('0x2f')]=function(_0x2ade23,_0x5e65a7){var _0x1719cd={'include':[{'model':db[_0x3500('0x30')],'as':_0x3500('0x31')}]},_0x2959c8={},_0xe72e3c={'count':0x0,'rows':[]};var _0x23a4dd=_['map'](db[_0x3500('0x32')][_0x3500('0x33')],function(_0x34679e){return{'name':_0x34679e[_0x3500('0x34')],'type':_0x34679e[_0x3500('0x35')][_0x3500('0x36')]};});_0x2959c8[_0x3500('0x37')]=_[_0x3500('0x38')](_0x23a4dd,'name');_0x2959c8[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x2ade23[_0x3500('0x39')]);_0x2959c8[_0x3500('0x3b')]=_[_0x3500('0x3c')](_0x2959c8[_0x3500('0x37')],_0x2959c8[_0x3500('0x39')]);_0x1719cd[_0x3500('0x3d')]=_['intersection'](_0x2959c8['model'],qs['fields'](_0x2ade23['query']['fields']));_0x1719cd[_0x3500('0x3d')]=_0x1719cd['attributes'][_0x3500('0x3e')]?_0x1719cd['attributes']:_0x2959c8[_0x3500('0x37')];if(!_0x2ade23[_0x3500('0x39')][_0x3500('0x3f')](_0x3500('0x40'))){_0x1719cd[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x2ade23[_0x3500('0x39')][_0x3500('0x22')]);_0x1719cd[_0x3500('0x1f')]=qs[_0x3500('0x1f')](_0x2ade23[_0x3500('0x39')]['offset']);}_0x1719cd['order']=qs['sort'](_0x2ade23[_0x3500('0x39')][_0x3500('0x41')]);_0x1719cd['where']=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x2ade23[_0x3500('0x39')],_0x2959c8[_0x3500('0x3b')]),_0x23a4dd);if(_0x2ade23[_0x3500('0x39')][_0x3500('0x43')]){_0x1719cd[_0x3500('0x44')]=_['merge'](_0x1719cd[_0x3500('0x44')],{'$or':_['map'](_0x23a4dd,function(_0x3d2656){if(_0x3d2656[_0x3500('0x35')]!==_0x3500('0x45')){var _0x3bc88c={};_0x3bc88c[_0x3d2656[_0x3500('0x2e')]]={'$like':'%'+_0x2ade23['query'][_0x3500('0x43')]+'%'};return _0x3bc88c;}})});}_0x1719cd=_[_0x3500('0x46')]({},_0x1719cd,_0x2ade23[_0x3500('0x47')]);var _0x220b55={'where':_0x1719cd['where']};return db[_0x3500('0x32')][_0x3500('0x21')](_0x220b55)[_0x3500('0x13')](function(_0x2370fe){_0xe72e3c[_0x3500('0x21')]=_0x2370fe;if(_0x2ade23['query'][_0x3500('0x48')]){_0x1719cd[_0x3500('0x49')]=[{'all':!![]}];}return db[_0x3500('0x32')]['findAll'](_0x1719cd);})[_0x3500('0x13')](function(_0x34c4c9){_0xe72e3c['rows']=_0x34c4c9;return _0xe72e3c;})[_0x3500('0x13')](respondWithFilteredResult(_0x5e65a7,_0x1719cd))[_0x3500('0x1d')](handleError(_0x5e65a7,null));};exports['show']=function(_0x115840,_0x286f77){var _0x26b82b={'raw':![],'where':{'id':_0x115840['params']['id']},'include':[{'model':db[_0x3500('0x30')],'as':_0x3500('0x31')}]},_0x36c4c3={};_0x36c4c3['model']=_['keys'](db[_0x3500('0x32')][_0x3500('0x33')]);_0x36c4c3[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x115840[_0x3500('0x39')]);_0x36c4c3['filters']=_[_0x3500('0x3c')](_0x36c4c3['model'],_0x36c4c3[_0x3500('0x39')]);_0x26b82b[_0x3500('0x3d')]=_[_0x3500('0x3c')](_0x36c4c3[_0x3500('0x37')],qs[_0x3500('0x4a')](_0x115840['query']['fields']));_0x26b82b['attributes']=_0x26b82b[_0x3500('0x3d')][_0x3500('0x3e')]?_0x26b82b[_0x3500('0x3d')]:_0x36c4c3['model'];if(_0x115840[_0x3500('0x39')]['includeAll']){_0x26b82b[_0x3500('0x49')]=[{'all':!![]}];}_0x26b82b=_[_0x3500('0x46')]({},_0x26b82b,_0x115840[_0x3500('0x47')]);return db[_0x3500('0x32')][_0x3500('0x4b')](_0x26b82b)[_0x3500('0x13')](handleEntityNotFound(_0x286f77,null))[_0x3500('0x13')](respondWithResult(_0x286f77,null))[_0x3500('0x1d')](handleError(_0x286f77,null));};exports['create']=function(_0x2d0b3e,_0x113057){return db[_0x3500('0x32')][_0x3500('0x4c')](_0x2d0b3e[_0x3500('0x4d')],{})[_0x3500('0x13')](function(_0x4dc64a){var _0x59b017=_0x2d0b3e[_0x3500('0x4e')]['get']({'plain':!![]});if(!_0x59b017)throw new Error(_0x3500('0x4f'));if(_0x59b017[_0x3500('0x50')]===_0x3500('0x4e')){var _0x42e3f1=_0x4dc64a['get']({'plain':!![]});var _0x34447c='ChatWebsites';return db[_0x3500('0x51')]['find']({'where':{'name':_0x34447c,'userProfileId':_0x59b017['userProfileId']},'raw':!![]})[_0x3500('0x13')](function(_0x397d6b){if(_0x397d6b&&_0x397d6b[_0x3500('0x52')]===0x0){return db[_0x3500('0x2a')]['create']({'name':_0x42e3f1[_0x3500('0x2e')],'resourceId':_0x42e3f1['id'],'type':_0x397d6b[_0x3500('0x2e')],'sectionId':_0x397d6b['id']},{})[_0x3500('0x13')](function(){return _0x4dc64a;});}else{return _0x4dc64a;}})[_0x3500('0x1d')](function(_0x382cef){logger[_0x3500('0x19')](_0x3500('0x53'),_0x382cef);throw _0x382cef;});}return _0x4dc64a;})[_0x3500('0x13')](respondWithResult(_0x113057,0xc9))[_0x3500('0x1d')](handleError(_0x113057,null));};exports['update']=function(_0x5c3c99,_0x7c3237){if(_0x5c3c99[_0x3500('0x4d')]['id']){delete _0x5c3c99[_0x3500('0x4d')]['id'];}return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x5c3c99[_0x3500('0x54')]['id']},'include':[{'model':db[_0x3500('0x30')],'as':_0x3500('0x31')}]})[_0x3500('0x13')](handleEntityNotFound(_0x7c3237,null))[_0x3500('0x13')](saveUpdates(_0x5c3c99[_0x3500('0x4d')],null))['then'](respondWithResult(_0x7c3237,null))[_0x3500('0x1d')](handleError(_0x7c3237,null));};exports[_0x3500('0x27')]=function(_0x1a781b,_0x10a695){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x1a781b[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x10a695,null))[_0x3500('0x13')](removeEntity(_0x10a695,null))[_0x3500('0x1d')](handleError(_0x10a695,null));};exports[_0x3500('0x55')]=function(_0x5e0c68,_0x1e6e6c){return db[_0x3500('0x32')][_0x3500('0x55')]()[_0x3500('0x13')](respondWithResult(_0x1e6e6c,null))[_0x3500('0x1d')](handleError(_0x1e6e6c,null));};exports['addDisposition']=function(_0x34276e,_0x2783f4){if(_0x34276e[_0x3500('0x4d')]['id']){delete _0x34276e[_0x3500('0x4d')]['id'];}return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x34276e[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x2783f4,null))['then'](function(_0xf692f9){if(_0xf692f9){_0x34276e['body']['ChatWebsiteId']=_0xf692f9['id'];return db[_0x3500('0x56')][_0x3500('0x4c')](_0x34276e[_0x3500('0x4d')]);}})[_0x3500('0x13')](respondWithResult(_0x2783f4,null))[_0x3500('0x1d')](handleError(_0x2783f4,null));};exports['getDispositions']=function(_0x4e3e4d,_0x23c48d){var _0x10c47d={'raw':![],'where':{}};var _0x5d8d63={};var _0x45806d={'count':0x0,'rows':[]};return db[_0x3500('0x32')][_0x3500('0x57')]({'where':{'id':_0x4e3e4d[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x23c48d,null))[_0x3500('0x13')](function(_0x8b4650){if(_0x8b4650){_0x5d8d63['model']=_[_0x3500('0x3a')](db[_0x3500('0x56')][_0x3500('0x33')]);_0x5d8d63[_0x3500('0x39')]=_['keys'](_0x4e3e4d[_0x3500('0x39')]);_0x5d8d63[_0x3500('0x3b')]=_['intersection'](_0x5d8d63[_0x3500('0x37')],_0x5d8d63[_0x3500('0x39')]);_0x10c47d[_0x3500('0x3d')]=_[_0x3500('0x3c')](_0x5d8d63[_0x3500('0x37')],qs[_0x3500('0x4a')](_0x4e3e4d['query']['fields']));_0x10c47d[_0x3500('0x3d')]=_0x10c47d[_0x3500('0x3d')][_0x3500('0x3e')]?_0x10c47d[_0x3500('0x3d')]:_0x5d8d63['model'];if(!_0x4e3e4d[_0x3500('0x39')][_0x3500('0x3f')](_0x3500('0x40'))){_0x10c47d[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x4e3e4d[_0x3500('0x39')][_0x3500('0x22')]);_0x10c47d['offset']=qs[_0x3500('0x1f')](_0x4e3e4d[_0x3500('0x39')][_0x3500('0x1f')]);}_0x10c47d[_0x3500('0x58')]=qs[_0x3500('0x41')](_0x4e3e4d[_0x3500('0x39')][_0x3500('0x41')]);_0x10c47d[_0x3500('0x44')]=qs['filters'](_['pick'](_0x4e3e4d[_0x3500('0x39')],_0x5d8d63['filters']));_0x10c47d[_0x3500('0x44')][_0x3500('0x59')]=_0x8b4650['id'];if(_0x4e3e4d[_0x3500('0x39')][_0x3500('0x43')]){_0x10c47d[_0x3500('0x44')]=_[_0x3500('0x46')](_0x10c47d[_0x3500('0x44')],{'$or':_[_0x3500('0x38')](_0x10c47d[_0x3500('0x3d')],function(_0x554d74){var _0x3e8123={};_0x3e8123[_0x554d74]={'$like':'%'+_0x4e3e4d[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0x3e8123;})});}_0x10c47d=_[_0x3500('0x46')]({},_0x10c47d,_0x4e3e4d[_0x3500('0x47')]);return db['Disposition'][_0x3500('0x21')]({'where':_0x10c47d['where']})[_0x3500('0x13')](function(_0x2cf347){_0x45806d['count']=_0x2cf347;if(_0x4e3e4d[_0x3500('0x39')][_0x3500('0x48')]){_0x10c47d[_0x3500('0x49')]=[{'all':!![]}];}return db[_0x3500('0x56')]['findAll'](_0x10c47d);})['then'](function(_0x58024e){_0x45806d[_0x3500('0x5a')]=_0x58024e;return _0x45806d;});}})[_0x3500('0x13')](respondWithFilteredResult(_0x23c48d,_0x10c47d))[_0x3500('0x1d')](handleError(_0x23c48d,null));};exports[_0x3500('0x5b')]=function(_0x51fda7,_0xe1263e){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x51fda7['params']['id']}})[_0x3500('0x13')](handleEntityNotFound(_0xe1263e,null))[_0x3500('0x13')](function(_0xb7e41e){if(_0xb7e41e){return _0xb7e41e[_0x3500('0x5b')](_0x51fda7['query'][_0x3500('0x5c')]);}})[_0x3500('0x13')](respondWithStatusCode(_0xe1263e,null))[_0x3500('0x1d')](handleError(_0xe1263e,null));};exports[_0x3500('0x5d')]=function(_0x104756,_0x1a0c5d){if(_0x104756[_0x3500('0x4d')]['id']){delete _0x104756[_0x3500('0x4d')]['id'];}return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x104756[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x1a0c5d,null))[_0x3500('0x13')](function(_0xefe6be){if(_0xefe6be){_0x104756[_0x3500('0x4d')][_0x3500('0x59')]=_0xefe6be['id'];return db['CannedAnswer'][_0x3500('0x4c')](_0x104756[_0x3500('0x4d')]);}})[_0x3500('0x13')](respondWithResult(_0x1a0c5d,null))[_0x3500('0x1d')](handleError(_0x1a0c5d,null));};exports[_0x3500('0x5e')]=function(_0x466b0c,_0x1b81dc){var _0x282d63={'raw':![],'where':{}};var _0x1aa346={};var _0x3facc5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3500('0x57')]({'where':{'id':_0x466b0c[_0x3500('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b81dc,null))[_0x3500('0x13')](function(_0x1d4778){if(_0x1d4778){_0x1aa346['model']=_['keys'](db[_0x3500('0x5f')][_0x3500('0x33')]);_0x1aa346[_0x3500('0x39')]=_['keys'](_0x466b0c[_0x3500('0x39')]);_0x1aa346[_0x3500('0x3b')]=_['intersection'](_0x1aa346[_0x3500('0x37')],_0x1aa346[_0x3500('0x39')]);_0x282d63[_0x3500('0x3d')]=_[_0x3500('0x3c')](_0x1aa346[_0x3500('0x37')],qs[_0x3500('0x4a')](_0x466b0c[_0x3500('0x39')][_0x3500('0x4a')]));_0x282d63[_0x3500('0x3d')]=_0x282d63[_0x3500('0x3d')][_0x3500('0x3e')]?_0x282d63[_0x3500('0x3d')]:_0x1aa346[_0x3500('0x37')];if(!_0x466b0c[_0x3500('0x39')][_0x3500('0x3f')]('nolimit')){_0x282d63[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x466b0c[_0x3500('0x39')][_0x3500('0x22')]);_0x282d63[_0x3500('0x1f')]=qs[_0x3500('0x1f')](_0x466b0c[_0x3500('0x39')][_0x3500('0x1f')]);}_0x282d63[_0x3500('0x58')]=qs[_0x3500('0x41')](_0x466b0c[_0x3500('0x39')][_0x3500('0x41')]);_0x282d63['where']=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x466b0c['query'],_0x1aa346[_0x3500('0x3b')]));_0x282d63['where'][_0x3500('0x59')]=_0x1d4778['id'];if(_0x466b0c[_0x3500('0x39')][_0x3500('0x43')]){_0x282d63[_0x3500('0x44')]=_[_0x3500('0x46')](_0x282d63['where'],{'$or':_[_0x3500('0x38')](_0x282d63['attributes'],function(_0x35261b){var _0x4acf2a={};_0x4acf2a[_0x35261b]={'$like':'%'+_0x466b0c[_0x3500('0x39')]['filter']+'%'};return _0x4acf2a;})});}_0x282d63=_[_0x3500('0x46')]({},_0x282d63,_0x466b0c[_0x3500('0x47')]);return db['CannedAnswer'][_0x3500('0x21')]({'where':_0x282d63['where']})['then'](function(_0xe5f0a8){_0x3facc5[_0x3500('0x21')]=_0xe5f0a8;if(_0x466b0c['query']['includeAll']){_0x282d63[_0x3500('0x49')]=[{'all':!![]}];}return db[_0x3500('0x5f')][_0x3500('0x60')](_0x282d63);})[_0x3500('0x13')](function(_0x173248){_0x3facc5[_0x3500('0x5a')]=_0x173248;return _0x3facc5;});}})[_0x3500('0x13')](respondWithFilteredResult(_0x1b81dc,_0x282d63))[_0x3500('0x1d')](handleError(_0x1b81dc,null));};exports[_0x3500('0x61')]=function(_0x160396,_0x5d267b){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x160396[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x5d267b,null))['then'](function(_0x5a7dd5){if(_0x5a7dd5){return _0x5a7dd5[_0x3500('0x61')](_0x160396[_0x3500('0x39')][_0x3500('0x5c')]);}})[_0x3500('0x13')](respondWithStatusCode(_0x5d267b,null))[_0x3500('0x1d')](handleError(_0x5d267b,null));};exports[_0x3500('0x62')]=function(_0x580c2d,_0x5cb125){_0x580c2d[_0x3500('0x4d')][_0x3500('0x63')]=_0x580c2d[_0x3500('0x64')][_0x3500('0x65')];return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x580c2d[_0x3500('0x54')]['id']}})['then'](handleEntityNotFound(_0x5cb125,null))['then'](saveUpdates(_0x580c2d['body'],null))[_0x3500('0x13')](respondWithResult(_0x5cb125,null))[_0x3500('0x1d')](handleError(_0x5cb125,null));};exports[_0x3500('0x66')]=function(_0x4ef03c,_0x164e1b){_0x4ef03c[_0x3500('0x4d')]['agentAvatar']=_0x4ef03c[_0x3500('0x64')][_0x3500('0x65')];return db[_0x3500('0x32')]['find']({'where':{'id':_0x4ef03c['params']['id']}})['then'](handleEntityNotFound(_0x164e1b,null))[_0x3500('0x13')](saveUpdates(_0x4ef03c[_0x3500('0x4d')],null))[_0x3500('0x13')](respondWithResult(_0x164e1b,null))['catch'](handleError(_0x164e1b,null));};exports[_0x3500('0x67')]=function(_0x51fabd,_0x1bc752){_0x51fabd[_0x3500('0x4d')][_0x3500('0x68')]=_0x51fabd[_0x3500('0x64')]['filename'];return db['ChatWebsite'][_0x3500('0x4b')]({'where':{'id':_0x51fabd['params']['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x1bc752,null))['then'](saveUpdates(_0x51fabd[_0x3500('0x4d')],null))[_0x3500('0x13')](respondWithResult(_0x1bc752,null))[_0x3500('0x1d')](handleError(_0x1bc752,null));};exports[_0x3500('0x69')]=function(_0x5d4a21,_0x58d83b){_0x5d4a21[_0x3500('0x4d')]['systemAvatar']=_0x5d4a21['file'][_0x3500('0x65')];return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x5d4a21[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x58d83b,null))[_0x3500('0x13')](saveUpdates(_0x5d4a21[_0x3500('0x4d')],null))[_0x3500('0x13')](respondWithResult(_0x58d83b,null))[_0x3500('0x1d')](handleError(_0x58d83b,null));};exports[_0x3500('0x6a')]=function(_0x36dea7,_0x5a23ee){var _0x1d91b8=path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0x6d'));var _0x5bc48d={'where':{'id':_0x36dea7['params']['id']},'attributes':['id',_0x3500('0x63')],'raw':!![]};var _0x5cf089=![];return require(_0x3500('0x6e'))[_0x3500('0x6f')]()[_0x3500('0x13')](function(_0x455df2){if(_0x455df2){_0x5cf089=_0x455df2[_0x3500('0x70')];}})[_0x3500('0x13')](function(){return db[_0x3500('0x32')]['find'](_0x5bc48d);})[_0x3500('0x13')](handleEntityNotFound(_0x5a23ee,null))[_0x3500('0x13')](function(_0x246f80){if(_0x246f80){if(!_[_0x3500('0x71')](_0x246f80[_0x3500('0x63')])){if(fs[_0x3500('0x72')](path[_0x3500('0x6b')](config['root'],'server/files/images/logos/',_0x246f80[_0x3500('0x63')]))&&_0x5cf089){_0x1d91b8=path['join'](config[_0x3500('0x6c')],_0x3500('0x73'),_0x246f80['sitepic']);}}return _0x5a23ee[_0x3500('0x74')](_0x1d91b8);}})[_0x3500('0x1d')](handleError(_0x5a23ee,null));};exports['getAvatar']=function(_0x57c094,_0x3bcb96){var _0x5ef27d=path[_0x3500('0x6b')](config[_0x3500('0x6c')],'server/files/images/avatars/default_avatar.png');var _0xa12e3c={'where':{'id':_0x57c094[_0x3500('0x54')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3500('0x32')][_0x3500('0x4b')](_0xa12e3c)[_0x3500('0x13')](handleEntityNotFound(_0x3bcb96,null))[_0x3500('0x13')](function(_0x105d70){if(_0x105d70){if(!_[_0x3500('0x71')](_0x105d70[_0x3500('0x75')])){if(fs[_0x3500('0x72')](path[_0x3500('0x6b')](config['root'],_0x3500('0x76'),_0x105d70['agentAvatar']))){_0x5ef27d=path[_0x3500('0x6b')](config['root'],_0x3500('0x76'),_0x105d70[_0x3500('0x75')]);}}return _0x3bcb96['download'](_0x5ef27d);}})[_0x3500('0x1d')](handleError(_0x3bcb96,null));};exports['getCustomerAvatar']=function(_0x5d1bfb,_0x568789){var _0x48beab=path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0x77'));var _0x2e4f46={'where':{'id':_0x5d1bfb[_0x3500('0x54')]['id']},'attributes':['id',_0x3500('0x68'),_0x3500('0x78')],'raw':!![]};return db['ChatWebsite'][_0x3500('0x4b')](_0x2e4f46)[_0x3500('0x13')](handleEntityNotFound(_0x568789,null))[_0x3500('0x13')](function(_0x37bf92){if(_0x37bf92){if(!_[_0x3500('0x71')](_0x37bf92[_0x3500('0x68')])){if(fs[_0x3500('0x72')](path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0x76'),_0x37bf92['customerAvatar']))&&_0x37bf92[_0x3500('0x78')]){_0x48beab=path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0x76'),_0x37bf92[_0x3500('0x68')]);}}return _0x568789['download'](_0x48beab);}})[_0x3500('0x1d')](handleError(_0x568789,null));};exports[_0x3500('0x79')]=function(_0xb1cf0,_0x2d0b3c){var _0x14d9b2=path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0x7a'));var _0x49fa20={'where':{'id':_0xb1cf0[_0x3500('0x54')]['id']},'attributes':['id',_0x3500('0x7b')],'raw':!![]};return db[_0x3500('0x32')][_0x3500('0x4b')](_0x49fa20)[_0x3500('0x13')](handleEntityNotFound(_0x2d0b3c,null))[_0x3500('0x13')](function(_0x5d2cf7){if(_0x5d2cf7){if(!_['isNil'](_0x5d2cf7[_0x3500('0x7b')])){if(fs['existsSync'](path[_0x3500('0x6b')](config['root'],_0x3500('0x76'),_0x5d2cf7[_0x3500('0x7b')]))){_0x14d9b2=path['join'](config[_0x3500('0x6c')],_0x3500('0x76'),_0x5d2cf7[_0x3500('0x7b')]);}}return _0x2d0b3c['download'](_0x14d9b2);}})[_0x3500('0x1d')](handleError(_0x2d0b3c,null));};exports['notify']=function(_0x192f0b,_0x2acc29){var _0x26e05e=require('user-agent-parser');var _0x49f0a0=new _0x26e05e();var _0x3e533d=_0x49f0a0[_0x3500('0x7c')](_0x192f0b[_0x3500('0x7d')][_0x3500('0x7e')])[_0x3500('0x7f')]();var _0x16a963={'body':_0x192f0b['body'],'channel':_0x3500('0x80')};var _0x5a1066=[];var _0x7360c0=[];var _0xc32eaf={};var _0x596782=![];return db['CmContact']['describe']()[_0x3500('0x13')](function(_0x1844d0){if(!_0x1844d0){throw new db['Sequelize'][(_0x3500('0x81'))]('no\x20available\x20attributes');}_0x5a1066=_['difference'](_[_0x3500('0x3a')](_0x1844d0),[_0x3500('0x82'),_0x3500('0x83')]);_0x7360c0=_['difference'](_[_0x3500('0x3a')](_0x1844d0),['createdAt','updatedAt','CompanyId',_0x3500('0x84')]);if(_0x192f0b[_0x3500('0x4d')]['id']){delete _0x192f0b[_0x3500('0x4d')]['id'];}if(_['isNil'](_0x192f0b['body'][_0x3500('0x85')])){throw new db[(_0x3500('0x86'))][(_0x3500('0x81'))](_0x3500('0x87'));}if(_['isNil'](_0x192f0b['body'][_0x3500('0x4d')])||_0x192f0b[_0x3500('0x4d')]['body']===''){throw new db[(_0x3500('0x86'))][(_0x3500('0x81'))](_0x3500('0x88'));}if(_[_0x3500('0x71')](_0x192f0b[_0x3500('0x4d')][_0x3500('0x89')])){throw new db[(_0x3500('0x86'))][(_0x3500('0x81'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7360c0);}if(!_[_0x3500('0x8a')](_0x7360c0,_0x192f0b[_0x3500('0x4d')][_0x3500('0x89')])){throw new db['Sequelize'][(_0x3500('0x81'))](_0x3500('0x8b')+_0x7360c0);}_0xc32eaf[_0x192f0b['body'][_0x3500('0x89')]]=_0x192f0b['body'][_0x3500('0x85')];})['then'](function(){return db[_0x3500('0x32')]['find']({'where':{'id':_0x192f0b[_0x3500('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x3500('0x8c'),'include':[{'model':db[_0x3500('0x8d')],'as':_0x3500('0x8e'),'where':_0xc32eaf,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x3500('0x8f')}]});})[_0x3500('0x13')](handleEntityNotFound(_0x2acc29,null))['then'](function(_0x2043e9){if(_0x2043e9&&_0x2043e9['List']){_0x16a963[_0x3500('0x90')]=_0x2043e9;_0x16a963[_0x3500('0x91')]=_0x2043e9[_0x3500('0x8f')];_0x16a963[_0x3500('0x92')]=_0x2043e9[_0x3500('0x8c')];_0x16a963[_0x3500('0x91')]=_['orderBy'](_0x16a963['applications'],['priority'],[_0x3500('0x93')]);if(_0x16a963[_0x3500('0x90')]['Applications']){delete _0x16a963[_0x3500('0x90')][_0x3500('0x8f')];}if(_0x16a963[_0x3500('0x90')]['List']&&_0x16a963[_0x3500('0x90')][_0x3500('0x8c')][_0x3500('0x8e')]['length']){return _0x16a963[_0x3500('0x90')]['List'][_0x3500('0x8e')][0x0];}var _0x5be95c=_[_0x3500('0x94')](_0x192f0b[_0x3500('0x4d')],{'firstName':_0x192f0b['body']['from'],'ListId':_0x2043e9[_0x3500('0x84')]});_0x5be95c[_0x192f0b[_0x3500('0x4d')][_0x3500('0x89')]]=_0x192f0b[_0x3500('0x4d')][_0x3500('0x85')];return db[_0x3500('0x8d')][_0x3500('0x4c')](_0x5be95c,{'fields':_0x5a1066,'raw':!![]});}})['then'](handleEntityNotFound(_0x2acc29,null))[_0x3500('0x13')](function(_0x467a87){_0x16a963[_0x3500('0x95')]=_0x467a87;var _0x6357ad=_0x192f0b[_0x3500('0x4d')][_0x3500('0x96')];if(_0x192f0b['headers'][_0x3500('0x97')]){_0x6357ad=_0x192f0b['headers'][_0x3500('0x97')];}else if(_0x192f0b[_0x3500('0x7d')]['x-forwarded-for']){_0x6357ad=_['first'](_0x192f0b['headers'][_0x3500('0x98')]['split'](','));}if(_0x467a87){var _0x14b21c={'ContactId':_0x467a87['id'],'ChatWebsiteId':_0x192f0b[_0x3500('0x54')]['id'],'from':(_0x467a87[_0x3500('0x99')]||'')+'\x20'+(_0x467a87[_0x3500('0x9a')]||''),'customerIp':_0x6357ad,'customerPort':_0x192f0b['headers'][_0x3500('0x9b')]?_0x192f0b['headers'][_0x3500('0x9b')]:null,'referer':_0x192f0b[_0x3500('0x4d')][_0x3500('0x9c')],'browserName':_0x3e533d['browser'][_0x3500('0x2e')]&&_0x3e533d[_0x3500('0x9d')]['version']?util[_0x3500('0x9e')]('%s\x20%s',_0x3e533d['browser'][_0x3500('0x2e')],_0x3e533d[_0x3500('0x9d')][_0x3500('0x9f')]):'unknown','browserVersion':_0x3e533d['browser'][_0x3500('0x9f')]||_0x3500('0xa0'),'osName':util[_0x3500('0x9e')](_0x3500('0xa1'),_0x3e533d['os'][_0x3500('0x2e')],_0x3e533d['os'][_0x3500('0x9f')]),'osVersion':_0x3e533d['os'][_0x3500('0x9f')],'deviceModel':_0x3e533d[_0x3500('0xa2')]['model']&&_0x3e533d[_0x3500('0xa2')][_0x3500('0xa3')]?util[_0x3500('0x9e')](_0x3500('0xa4'),_0x3e533d['device'][_0x3500('0x37')],_0x3e533d[_0x3500('0xa2')][_0x3500('0xa3')],_0x3e533d[_0x3500('0xa2')]['type']):null,'deviceVendor':_0x3e533d[_0x3500('0xa2')][_0x3500('0xa3')],'deviceType':_0x3e533d[_0x3500('0xa2')]['type'],'formData':JSON[_0x3500('0x18')](_0x192f0b['body'])};var _0x138fb6={'ChatWebsiteId':_0x192f0b[_0x3500('0x54')]['id'],'closed':![]};if(_0x192f0b['body'][_0x3500('0xa5')]){_0x138fb6['threadId']=_0x192f0b[_0x3500('0x4d')][_0x3500('0xa5')];return db[_0x3500('0xa6')][_0x3500('0x4b')]({'where':_0x138fb6})[_0x3500('0x13')](function(_0x59cc73){if(_0x59cc73){return[_0x59cc73,![]];}_0x14b21c['threadId']=_0x192f0b[_0x3500('0x4d')][_0x3500('0xa5')];_0x14b21c[_0x3500('0xa7')]=_0x192f0b[_0x3500('0x4d')]['externalUrl'];return db['ChatInteraction']['create'](_0x14b21c)[_0x3500('0x13')](function(_0x31223c){return[_0x31223c,!![]];});});}_0x138fb6[_0x3500('0xa8')]=_0x467a87['id'];if(_0x192f0b[_0x3500('0x4d')][_0x3500('0xa9')]&&_0x192f0b[_0x3500('0x4d')][_0x3500('0xa9')]['id']){_0x138fb6['id']=_0x192f0b[_0x3500('0x4d')][_0x3500('0xa9')]['id'];return db[_0x3500('0xa6')][_0x3500('0x4b')]({'where':_0x138fb6})[_0x3500('0x13')](function(_0x139405){if(_0x139405){return[_0x139405,![]];}return db[_0x3500('0xa6')][_0x3500('0x4c')](_0x14b21c)[_0x3500('0x13')](function(_0x2aeaf0){return[_0x2aeaf0,!![]];});});}return db[_0x3500('0xa6')][_0x3500('0x4c')](_0x14b21c)[_0x3500('0x13')](function(_0x44f423){return[_0x44f423,!![]];});}})[_0x3500('0xaa')](function(_0x5166f7,_0x1c8b42){if(_0x5166f7){_0x596782=_0x1c8b42;if(!_0x1c8b42){var _0x6b2a10={'from':(_0x16a963['contact'][_0x3500('0x99')]||'')+'\x20'+(_0x16a963[_0x3500('0x95')][_0x3500('0x9a')]||'')};if(_0x192f0b[_0x3500('0x4d')][_0x3500('0xa5')]&&_0x192f0b[_0x3500('0x4d')]['messageId']&&_0x192f0b['body'][_0x3500('0xa5')]!=_0x192f0b['body']['messageId']){_0x6b2a10[_0x3500('0xa5')]=_0x192f0b[_0x3500('0x4d')][_0x3500('0xab')];}return _0x5166f7['update'](_0x6b2a10);}else{return _0x5166f7;}}})[_0x3500('0x13')](function(_0x5d8231){_0x16a963['interaction']=_0x5d8231[_0x3500('0x28')]({'plain':!![]});_0x16a963[_0x3500('0xa9')][_0x3500('0xac')]=_0x596782;if(_0x16a963['interaction'][_0x3500('0xac')]){if(_0x16a963[_0x3500('0x90')][_0x3500('0xad')]){_0x16a963[_0x3500('0x91')][_0x3500('0xae')]({'id':0x0,'priority':_0x16a963['applications'][_0x3500('0x3e')]+0x1,'app':_0x3500('0xaf'),'appdata':_0x3500('0xb0'),'interval':'*,*,*,*'});}}return db[_0x3500('0xb1')][_0x3500('0x4c')]({'body':_0x192f0b[_0x3500('0x4d')]['body'],'ChatWebsiteId':_0x192f0b[_0x3500('0x54')]['id'],'ChatInteractionId':_0x5d8231['id'],'direction':'in','ContactId':_0x16a963[_0x3500('0x95')]['id'],'AttachmentId':_0x192f0b[_0x3500('0x4d')][_0x3500('0xb2')]});})['then'](function(_0x4b6ebb){_0x16a963[_0x3500('0x1c')]=_0x4b6ebb;if(_0x16a963[_0x3500('0xa9')][_0x3500('0xb3')]){return db[_0x3500('0xb4')][_0x3500('0x4b')]({'attributes':['id','name'],'where':{'id':_0x16a963[_0x3500('0xa9')][_0x3500('0xb3')]}})[_0x3500('0x13')](function(_0x101b71){if(_0x101b71){_0x16a963['applications'][_0x3500('0xb5')]({'id':0x0,'priority':0x0,'app':_0x3500('0xb6'),'appdata':_0x101b71[_0x3500('0x2e')]+','+(_0x16a963[_0x3500('0x90')][_0x3500('0xb7')]||0xa),'interval':_0x3500('0xb8')});_0x16a963[_0x3500('0xb9')]=!![];}return respondWithRpcPromise(_0x3500('0xba'),'startRouting',_0x16a963);});}return respondWithRpcPromise('Start',_0x3500('0xbb'),_0x16a963);})[_0x3500('0x13')](function(_0x5bb738){respondWithRpcPromise(_0x3500('0xbc'),_0x3500('0xbc'),{'event':'notify','message':_0x5bb738},client9002);return _0x5bb738;})[_0x3500('0x13')](respondWithResult(_0x2acc29,null))['catch'](handleError(_0x2acc29,null));};exports[_0x3500('0xbd')]=function(_0x442b47,_0x2f9aee){var _0x2c27e6,_0x1aba65,_0x164b35;var _0x28f866=[];var _0xab1261={};var _0x15bdd5=_0x442b47[_0x3500('0xbe')]||[];var _0x3d4685=[];var _0x581dcf;return db[_0x3500('0x8d')][_0x3500('0x55')]()[_0x3500('0x13')](function(_0x3b978f){if(!_0x3b978f){throw new db[(_0x3500('0x86'))][(_0x3500('0x81'))]('no\x20available\x20attributes');}_0x28f866=_[_0x3500('0xbf')](_[_0x3500('0x3a')](_0x3b978f),['createdAt',_0x3500('0x83'),_0x3500('0xc0'),'ListId']);if(_0x442b47['body']['id']){delete _0x442b47[_0x3500('0x4d')]['id'];}if(_[_0x3500('0x71')](_0x442b47[_0x3500('0x4d')]['from'])){throw _0x2f9aee[_0x3500('0x1e')](0x1f4)[_0x3500('0xc1')](new db[(_0x3500('0x86'))][(_0x3500('0x81'))](_0x3500('0x87')));}if(_[_0x3500('0x71')](_0x442b47[_0x3500('0x4d')][_0x3500('0x4d')])||_0x442b47[_0x3500('0x4d')][_0x3500('0x4d')]===''){throw _0x2f9aee['status'](0x1f4)[_0x3500('0xc1')](new db[(_0x3500('0x86'))][(_0x3500('0x81'))](_0x3500('0x88')));}if(_[_0x3500('0x71')](_0x442b47['body']['mapKeyOffline'])){throw _0x2f9aee[_0x3500('0x1e')](0x1f4)[_0x3500('0xc1')](new db['Sequelize'][(_0x3500('0x81'))](_0x3500('0xc2')+_0x28f866));}if(!_['includes'](_0x28f866,_0x442b47['body'][_0x3500('0xc3')])){throw _0x2f9aee[_0x3500('0x1e')](0x1f4)['send'](new db[(_0x3500('0x86'))][(_0x3500('0x81'))](_0x3500('0xc4')+_0x28f866));}_0xab1261[_0x442b47[_0x3500('0x4d')][_0x3500('0xc3')]]=_0x442b47[_0x3500('0x4d')][_0x3500('0x85')];})[_0x3500('0x13')](function(){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x442b47['params']['id']},'include':[{'model':db[_0x3500('0xc5')],'as':_0x3500('0x8c')},{'model':db['MailAccount'],'as':_0x3500('0xc6')}]});})[_0x3500('0x13')](handleEntityNotFound(_0x2f9aee,null))[_0x3500('0x13')](function(_0x240dc6){if(_0x240dc6&&_0x240dc6[_0x3500('0x8c')]){_0x1aba65=_0x240dc6;var _0x4b5faa=_[_0x3500('0x94')](_0x442b47[_0x3500('0x4d')],{'firstName':_0x442b47[_0x3500('0x4d')]['from'],'phone':_0x442b47['body'][_0x3500('0x85')],'ListId':_0x240dc6[_0x3500('0x84')]});_0x4b5faa[_0x442b47[_0x3500('0x4d')]['mapKeyOffline']]=_0x442b47[_0x3500('0x4d')][_0x3500('0x85')];return db[_0x3500('0x8d')][_0x3500('0xc7')]({'where':_0xab1261,'defaults':_0x4b5faa});}})['spread'](function(_0x275dcf){if(_0x275dcf){_0x164b35=_0x275dcf;var _0x243d0a=fs['readFileSync'](path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0xc8')),_0x3500('0xc9'));var _0x591733=ejs[_0x3500('0xca')](_0x243d0a,{'body':_[_0x3500('0xcb')](_0x442b47['body'][_0x3500('0x4d')]),'bodyTitle':_0x1aba65['offlineMessageBody']});return db[_0x3500('0xcc')]['create']({'body':_0x591733,'plainBody':htmlToText[_0x3500('0xcd')](_0x591733),'ContactId':_0x275dcf['id'],'ChatWebsiteId':_0x1aba65['id']});}})[_0x3500('0x13')](function(_0x29619c){_0x581dcf=_0x29619c;if(_0x15bdd5['length']){var _0x44132e=_0x15bdd5[_0x3500('0x38')](function(_0x10c926){return{'name':_0x10c926['originalname'],'basename':_0x10c926[_0x3500('0x65')],'type':_0x10c926['mimetype'],'ChatOfflineMessageId':_0x29619c['id']};});_0x3d4685=_0x44132e[_0x3500('0x38')](_0x17084c=>{var _0x1022a6={'filename':_0x17084c[_0x3500('0x2e')],'path':path[_0x3500('0x6b')](config[_0x3500('0x6c')],'server',_0x3500('0xbe'),_0x3500('0xce'),_0x3500('0xcf'),_0x17084c[_0x3500('0xd0')])};return _0x1022a6;});if(!_0x1aba65[_0x3500('0xd1')]){return db[_0x3500('0xd2')]['transaction'](function(_0x2a3c1d){return db[_0x3500('0xd3')][_0x3500('0xd4')](_0x44132e,{'transaction':_0x2a3c1d});});}}})[_0x3500('0x13')](function(){if(_0x581dcf){_0x2c27e6=_0x581dcf;return db[_0x3500('0xc6')][_0x3500('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0x3500('0xd5')],'as':_0x3500('0xd6'),'raw':!![],'include':[{'model':db[_0x3500('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x3500('0x13')](function(_0x30aed7){if(_0x30aed7&&_0x30aed7[_0x3500('0xd6')]&&_0x1aba65[_0x3500('0xd8')]&&_0x1aba65[_0x3500('0xd9')]){var _0x400a0b=_0x30aed7[_0x3500('0xda')]();return respondWithRpcPromise('SendMail',_0x3500('0xdb'),{'account':_0x400a0b,'message':{'from':util[_0x3500('0x9e')]('\x22%s\x22\x20<%s>',_0x30aed7[_0x3500('0x2e')],_0x30aed7[_0x3500('0xdc')]||_0x30aed7[_0x3500('0xd6')][_0x3500('0x4e')]),'to':_0x1aba65[_0x3500('0xd9')],'subject':_0x1aba65[_0x3500('0xdd')],'html':_0x2c27e6['body'],'attachments':_0x3d4685}},client9003)[_0x3500('0x13')](function(){return _0x2c27e6;})['catch'](function(_0x470086){logger[_0x3500('0x19')](_0x470086);});}})[_0x3500('0x13')](function(){if(_0x1aba65&&_0x1aba65[_0x3500('0xd1')]&&_0x1aba65[_0x3500('0xde')]){var _0x3190c7=[];if(_0x15bdd5[_0x3500('0x3e')]){_0x3190c7=_0x15bdd5['map'](function(_0x4a187f){return{'name':_0x4a187f[_0x3500('0xdf')],'basename':_0x4a187f[_0x3500('0x65')],'type':_0x4a187f['mimetype'],'ChatOfflineMessageId':_0x581dcf['id']};});}var _0x3af54d;if(!_[_0x3500('0x71')](_0x1aba65[_0x3500('0xe0')])){var _0x53e8cf=_[_0x3500('0x38')](_0x442b47[_0x3500('0x4d')],function(_0x45c467){return _0x45c467;});var _0x511eae=_[_0x3500('0xe1')](_0x53e8cf)[0x0];var _0x11855e=_[_0x3500('0xe2')](_0x511eae,function(_0x4ccedd){return _0x4ccedd;});_0x3af54d=_0x11855e[0x1][_0x1aba65[_0x3500('0xe0')]];}var _0x1ce044={'from':_0x164b35['email'],'firstName':_0x164b35[_0x3500('0x99')],'lastName':_0x164b35[_0x3500('0x9a')],'mapKey':_0x3500('0xdc'),'message':{'from':_0x164b35[_0x3500('0xdc')],'to':_0x1aba65[_0x3500('0xc6')]['email'],'cc':'','subject':_[_0x3500('0x71')](_0x3af54d)?_0x1aba65[_0x3500('0xdd')]:_0x3af54d,'messageId':'','sentAt':new Date(),'attach':_0x3190c7[_0x3500('0x3e')],'attachments':_0x3190c7,'originChannel':_0x3500('0xe3'),'ChatWebsiteId':_0x1aba65['id'],'ChatOfflineMessageId':_0x2c27e6['id'],'originTo':_0x1aba65[_0x3500('0xc6')]['email']},'body':_0x2c27e6[_0x3500('0x4d')]};var _0x1fc144={'account':{'id':_0x1aba65[_0x3500('0xde')]},'body':_0x1ce044,'log':_0x3500('0xe4')};return respondWithRpcPromise(_0x3500('0xe4'),_0x3500('0xe5'),_0x1fc144,client9001)[_0x3500('0x13')](function(){return _0x2c27e6;})[_0x3500('0x1d')](function(_0x107067){logger[_0x3500('0x19')](_0x107067);});}return;})['then'](function(){if(_0x2c27e6){return _0x2c27e6;}})[_0x3500('0x13')](respondWithResult(_0x2f9aee,null))['catch'](function(_0x466240){logger[_0x3500('0x19')](_0x3500('0x1d'),_0x466240);for(var _0x5a73ff of _0x15bdd5){var _0x49eae0=path[_0x3500('0x6b')](config[_0x3500('0x6c')],_0x3500('0xe6'),'files',_0x3500('0xce'),_0x3500('0xcf'),_0x5a73ff[_0x3500('0x65')]);fs_extra[_0x3500('0xe7')](_0x49eae0)['catch'](function(_0x2fd03a){logger[_0x3500('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x49eae0,_0x2fd03a);});}});};exports['addInteraction']=function(_0x1ba60c,_0x112c3f){return db[_0x3500('0xa6')][_0x3500('0x4b')]({'where':{'id':_0x1ba60c[_0x3500('0x54')]['id']}})['then'](handleEntityNotFound(_0x112c3f,null))[_0x3500('0x13')](function(_0x2ff6b2){if(_0x2ff6b2){return _0x2ff6b2[_0x3500('0xe8')](_0x1ba60c['body'][_0x3500('0x5c')],_[_0x3500('0xe9')](_0x1ba60c[_0x3500('0x4d')],[_0x3500('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x112c3f,null))[_0x3500('0x1d')](handleError(_0x112c3f,null));};exports[_0x3500('0xea')]=function(_0x5aca91,_0x235a64){var _0x3b3488={'raw':![],'where':{}};var _0x475381={};var _0xe03a89={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3500('0x57')]({'where':{'id':_0x5aca91[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x235a64,null))[_0x3500('0x13')](function(_0x50626d){if(_0x50626d){_0x475381[_0x3500('0x37')]=_['keys'](db[_0x3500('0xa6')][_0x3500('0x33')]);_0x475381['query']=_[_0x3500('0x3a')](_0x5aca91[_0x3500('0x39')]);_0x475381[_0x3500('0x3b')]=_['intersection'](_0x475381[_0x3500('0x37')],_0x475381[_0x3500('0x39')]);_0x3b3488[_0x3500('0x3d')]=_['intersection'](_0x475381[_0x3500('0x37')],qs['fields'](_0x5aca91[_0x3500('0x39')]['fields']));_0x3b3488['attributes']=_0x3b3488[_0x3500('0x3d')][_0x3500('0x3e')]?_0x3b3488[_0x3500('0x3d')]:_0x475381[_0x3500('0x37')];if(!_0x5aca91['query']['hasOwnProperty'](_0x3500('0x40'))){_0x3b3488[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x5aca91['query']['limit']);_0x3b3488['offset']=qs[_0x3500('0x1f')](_0x5aca91['query']['offset']);}_0x3b3488[_0x3500('0x58')]=qs[_0x3500('0x41')](_0x5aca91['query'][_0x3500('0x41')]);_0x3b3488['where']=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x5aca91['query'],_0x475381[_0x3500('0x3b')]));_0x3b3488['where'][_0x3500('0x59')]=_0x50626d['id'];if(_0x5aca91[_0x3500('0x39')][_0x3500('0x43')]){_0x3b3488[_0x3500('0x44')]=_[_0x3500('0x46')](_0x3b3488['where'],{'$or':_[_0x3500('0x38')](_0x3b3488[_0x3500('0x3d')],function(_0x1225c5){var _0x523e5a={};_0x523e5a[_0x1225c5]={'$like':'%'+_0x5aca91[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0x523e5a;})});}_0x3b3488=_['merge']({},_0x3b3488,_0x5aca91['options']);return db['ChatInteraction']['count']({'where':_0x3b3488[_0x3500('0x44')]})[_0x3500('0x13')](function(_0x12d081){_0xe03a89[_0x3500('0x21')]=_0x12d081;if(_0x5aca91[_0x3500('0x39')]['includeAll']){_0x3b3488[_0x3500('0x49')]=[{'model':db[_0x3500('0x8d')],'as':_0x3500('0xeb'),'required':![]},{'model':db['User'],'as':_0x3500('0xec'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x3500('0xed')],'as':_0x3500('0xee'),'attributes':['id',_0x3500('0x2e'),'color'],'where':_0x5aca91[_0x3500('0x39')][_0x3500('0xef')]?{'id':_0x5aca91[_0x3500('0x39')][_0x3500('0xef')]}:undefined,'required':_0x5aca91['query'][_0x3500('0xef')]?!![]:![]}];}return db[_0x3500('0xa6')][_0x3500('0x60')](_0x3b3488);})[_0x3500('0x13')](function(_0x33b083){_0xe03a89[_0x3500('0x5a')]=_0x33b083;return _0xe03a89;});}})[_0x3500('0x13')](respondWithFilteredResult(_0x235a64,_0x3b3488))[_0x3500('0x1d')](handleError(_0x235a64,null));};function iftimePromise(_0x18f2ae,_0x50c6b4){return respondWithRpcPromise(_0x3500('0xf0'),_0x3500('0xf1'),{'command':_0x50c6b4['timezone']?util[_0x3500('0x9e')](_0x3500('0xf2'),_0x18f2ae[_0x3500('0xf3')],_0x50c6b4[_0x3500('0xf4')]):util[_0x3500('0x9e')](_0x3500('0xf5'),_0x18f2ae['interval'])},client9002)[_0x3500('0x13')](function(_0x531a2c){var _0x34f4c7=_0x531a2c&&_0x531a2c[_0x3500('0xf6')]('true')>=0x0?!![]:![];logger[_0x3500('0x14')](_0x3500('0xf7'),_0x50c6b4['id'],_0x18f2ae['id'],_0x18f2ae['interval'],_0x34f4c7?'ONLINE':'OFFLINE',_0x50c6b4[_0x3500('0xf4')]?_0x50c6b4['timezone']:_0x3500('0xf8'));return _0x34f4c7;})[_0x3500('0x1d')](function(_0x3c50cc){logger[_0x3500('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x50c6b4['id'],_0x18f2ae['id'],_0x18f2ae['interval'],util[_0x3500('0xf9')](_0x3c50cc,{'showHidden':![],'depth':null}),_0x50c6b4[_0x3500('0xf4')]?_0x50c6b4[_0x3500('0xf4')]:'No\x20timezone');return![];});}exports[_0x3500('0xf1')]=function(_0x35ecbe,_0x113fd7){var _0x448314=0x0;var _0x54902e=0x0;var _0x21d36f=![];var _0x225e1a;var _0x3160af;return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x35ecbe['params']['id']},'include':[{'model':db[_0x3500('0xfa')],'as':_0x3500('0xfa'),'include':[{'model':db[_0x3500('0xfa')],'as':_0x3500('0xfb'),'attributes':['id',_0x3500('0xf3')],'raw':!![]}]}]})[_0x3500('0x13')](handleEntityNotFound(_0x113fd7,null))[_0x3500('0x13')](function(_0x2ed2c1){if(_0x2ed2c1){_0x225e1a=_0x2ed2c1;return _0x2ed2c1['getProactiveActions']({'raw':!![]});}})[_0x3500('0x13')](function(_0xcfb77f){if(_0x225e1a){if(_0xcfb77f){_0x3160af=_0xcfb77f;}}return require(_0x3500('0x6e'))[_0x3500('0x6f')]();})[_0x3500('0x13')](function(_0x5ac904){if(_0x5ac904){_0x54902e=_0x5ac904['virtual'];_0x21d36f=_0x5ac904[_0x3500('0x70')];}})['then'](function(){return db[_0x3500('0xa6')]['count']({'where':{'closed':![]}});})[_0x3500('0x13')](function(_0xbb795c){_0x448314=_0xbb795c;if(_0x54902e&&_0xbb795c>_0x54902e){return db[_0x3500('0xfc')][_0x3500('0x57')]({'where':{'id':0x1}})[_0x3500('0x13')](function(_0x7c2e2a){if(_0x7c2e2a){_0x7c2e2a[_0x3500('0xfd')]('chatLicenseExceeded');}});}})[_0x3500('0x13')](function(){if(_0x225e1a['Interval']&&_0x225e1a[_0x3500('0xfa')][_0x3500('0xfb')]){var _0x157791=[];for(var _0x3d6454=0x0;_0x3d6454<_0x225e1a[_0x3500('0xfa')]['Intervals'][_0x3500('0x3e')];_0x3d6454++){var _0x2e20a5=_0x225e1a[_0x3500('0xfa')]['Intervals'][_0x3d6454][_0x3500('0x28')]({'plain':!![]});_0x157791[_0x3500('0xae')](iftimePromise(_0x2e20a5,_0x225e1a));}return BPromise[_0x3500('0xfe')](_0x157791)['then'](function(_0x5d3f4a){return _[_0x3500('0xff')](_0x5d3f4a);});}else{return!![];}})[_0x3500('0x13')](function(_0x3b3e57){var _0x2a9267=fs[_0x3500('0x100')](path[_0x3500('0x6b')](config['root'],_0x3500('0x101')),_0x3500('0xc9'));var _0x416539=new url[(_0x3500('0x102'))](_0x225e1a[_0x3500('0x103')])[_0x3500('0x104')];var _0xbcb2c7=_0x3500('0x105');var _0x1efc29=![];var _0x88a582={'chatVersion':_0xbcb2c7,'chatWebsiteAddressOrigin':_0x416539,'remote':_0x225e1a[_0x3500('0x106')],'query':querystring[_0x3500('0x18')](_['merge'](_0x225e1a['get']({'plain':!![]}),{'customerIp':_0x35ecbe[_0x3500('0x7d')][_0x3500('0x98')]||_0x35ecbe['headers'][_0x3500('0x107')]||_0x35ecbe[_0x3500('0x108')]['remoteAddress']||_0x35ecbe['ip'],'referer':_0x35ecbe['headers']['referer'],'openedInteractions':_0x448314,'maxInteractions':_0x54902e,'virtual':_0x21d36f[_0x3500('0x109')],'online':_0x3b3e57,'custom':_0x21d36f}))[_0x3500('0x10a')](/'/g,'\x5c\x27')};_0x113fd7['send'](ejs[_0x3500('0xca')](Mustache[_0x3500('0xca')](_0x2a9267,_0x88a582),{'proactiveActions':_0x3160af,'alignment':_0x225e1a['alignment'],'verticalAlignment':_0x225e1a[_0x3500('0x10b')],'div_color':_0x225e1a[_0x3500('0x10c')],'labelText':_0x225e1a[_0x3500('0x10d')],'text_color':_0x225e1a[_0x3500('0x10e')],'text_button_color':_0x225e1a[_0x3500('0x10f')],'button_color':_0x225e1a[_0x3500('0x110')],'background_color':_0x225e1a[_0x3500('0x111')],'hideWhenOffline':_0x225e1a[_0x3500('0x112')],'intervalId':_0x225e1a[_0x3500('0x113')],'isDevelopment':_0x1efc29,'chatVersion':_0xbcb2c7}));})[_0x3500('0x1d')](handleError(_0x113fd7,null));};exports[_0x3500('0x114')]=function(_0x2b1b28,_0x342f1d){var _0x3d456b=_0x2b1b28['params']['id'];var _0x38f748=_0x2b1b28[_0x3500('0x4d')];var _0x4e3e78=0xc8;var _0x8fe050=null;return db[_0x3500('0xd2')][_0x3500('0x115')]({'isolationLevel':db['sequelize'][_0x3500('0x116')][_0x3500('0x117')][_0x3500('0x118')]},function(_0x5a06ea){return db[_0x3500('0x32')][_0x3500('0x57')]({'where':{'id':_0x3d456b},'transaction':_0x5a06ea})['then'](function(_0x2fdf56){if(_0x2fdf56){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x3d456b},'transaction':_0x5a06ea})[_0x3500('0x13')](function(){var _0x4c7987=_['map'](_0x38f748,function(_0x2e4d8d){_0x2e4d8d[_0x3500('0x59')]=_0x3d456b;return _0x2e4d8d;});return db[_0x3500('0x119')]['bulkCreate'](_0x4c7987,{'transaction':_0x5a06ea});});}else{_0x4e3e78=0x194;_0x8fe050=[];}});})['then'](function(){if(_0x4e3e78!==0x194){return db[_0x3500('0x119')][_0x3500('0x11a')]({'where':{'ChatWebsiteId':_0x3d456b},'order':_0x3500('0x11b')})['then'](function(_0x4a9f66){_0x8fe050=_0x4a9f66;});}})['catch'](function(_0x48bfc4){_0x4e3e78=0x1f4;logger[_0x3500('0x19')](_0x48bfc4[_0x3500('0x2d')]);if(_0x48bfc4[_0x3500('0x2e')]){delete _0x48bfc4[_0x3500('0x2e')];}_0x8fe050=_0x48bfc4;})['finally'](function(){if(_0x8fe050===null){_0x342f1d[_0x3500('0x2c')](_0x4e3e78);}else{if(_0x4e3e78===0x1f4){_0x342f1d[_0x3500('0x1e')](_0x4e3e78)[_0x3500('0xc1')](_0x8fe050);}else{_0x342f1d['status'](_0x4e3e78)['json'](_0x8fe050);}}});};exports[_0x3500('0x11c')]=function(_0x25c3ef,_0x3d3a01){var _0x53a272={};var _0x10553e={};var _0x1a7a88;var _0x240c45;return db[_0x3500('0x32')][_0x3500('0x57')]({'where':{'id':_0x25c3ef[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x3d3a01,null))[_0x3500('0x13')](function(_0x415d30){if(_0x415d30){_0x1a7a88=_0x415d30;_0x10553e[_0x3500('0x37')]=_['keys'](db[_0x3500('0x119')][_0x3500('0x33')]);_0x10553e[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x25c3ef[_0x3500('0x39')]);_0x10553e[_0x3500('0x3b')]=_[_0x3500('0x3c')](_0x10553e[_0x3500('0x37')],_0x10553e[_0x3500('0x39')]);_0x53a272[_0x3500('0x3d')]=_[_0x3500('0x3c')](_0x10553e[_0x3500('0x37')],qs['fields'](_0x25c3ef[_0x3500('0x39')][_0x3500('0x4a')]));_0x53a272[_0x3500('0x3d')]=_0x53a272['attributes'][_0x3500('0x3e')]?_0x53a272[_0x3500('0x3d')]:_0x10553e[_0x3500('0x37')];_0x53a272['order']=qs[_0x3500('0x41')](_0x25c3ef[_0x3500('0x39')][_0x3500('0x41')]);_0x53a272[_0x3500('0x44')]=qs[_0x3500('0x3b')](_['pick'](_0x25c3ef[_0x3500('0x39')],_0x10553e['filters']));if(_0x25c3ef[_0x3500('0x39')]['filter']){_0x53a272['where']=_[_0x3500('0x46')](_0x53a272['where'],{'$or':_['map'](_0x53a272['attributes'],function(_0x39becc){var _0x54063f={};_0x54063f[_0x39becc]={'$like':'%'+_0x25c3ef[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0x54063f;})});}_0x53a272=_[_0x3500('0x46')]({},_0x53a272,_0x25c3ef[_0x3500('0x47')]);return _0x1a7a88[_0x3500('0x11c')](_0x53a272);}})[_0x3500('0x13')](function(_0x2f610e){if(_0x2f610e){_0x240c45=_0x2f610e[_0x3500('0x3e')];if(!_0x25c3ef[_0x3500('0x39')]['hasOwnProperty'](_0x3500('0x40'))){_0x53a272[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x25c3ef['query'][_0x3500('0x22')]);_0x53a272[_0x3500('0x1f')]=qs['offset'](_0x25c3ef[_0x3500('0x39')]['offset']);}return _0x1a7a88['getApplications'](_0x53a272);}})['then'](function(_0x58f5df){if(_0x58f5df){return _0x58f5df?{'count':_0x240c45,'rows':_0x58f5df}:null;}})[_0x3500('0x13')](respondWithResult(_0x3d3a01,null))['catch'](handleError(_0x3d3a01,null));};exports[_0x3500('0x11d')]=function(_0xbee178,_0x2121ae){return db['chatProactiveAction']['find']({'where':{'id':_0xbee178[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x2121ae,null))[_0x3500('0x13')](function(_0x205e39){if(_0x205e39){return _0x205e39[_0x3500('0x11d')](_0xbee178[_0x3500('0x4d')]['ids'],_[_0x3500('0xe9')](_0xbee178[_0x3500('0x4d')],[_0x3500('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x2121ae,null))[_0x3500('0x1d')](handleError(_0x2121ae,null));};exports['getProactiveActions']=function(_0x5d509e,_0x12fe4d){var _0x346704={};var _0xad7ed4={};var _0x4f6c88;var _0x4c02dc;return db[_0x3500('0x32')]['findOne']({'where':{'id':_0x5d509e[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x12fe4d,null))['then'](function(_0x81e76b){if(_0x81e76b){_0x4f6c88=_0x81e76b;_0xad7ed4[_0x3500('0x37')]=_[_0x3500('0x3a')](db[_0x3500('0x11e')]['rawAttributes']);_0xad7ed4[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x5d509e[_0x3500('0x39')]);_0xad7ed4['filters']=_[_0x3500('0x3c')](_0xad7ed4[_0x3500('0x37')],_0xad7ed4[_0x3500('0x39')]);_0x346704['attributes']=_['intersection'](_0xad7ed4['model'],qs[_0x3500('0x4a')](_0x5d509e[_0x3500('0x39')][_0x3500('0x4a')]));_0x346704[_0x3500('0x3d')]=_0x346704[_0x3500('0x3d')][_0x3500('0x3e')]?_0x346704[_0x3500('0x3d')]:_0xad7ed4[_0x3500('0x37')];_0x346704[_0x3500('0x58')]=qs['sort'](_0x5d509e['query'][_0x3500('0x41')]);_0x346704[_0x3500('0x44')]=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x5d509e[_0x3500('0x39')],_0xad7ed4['filters']));if(_0x5d509e[_0x3500('0x39')][_0x3500('0x43')]){_0x346704[_0x3500('0x44')]=_[_0x3500('0x46')](_0x346704['where'],{'$or':_['map'](_0x346704['attributes'],function(_0x5e7636){var _0xc0201={};_0xc0201[_0x5e7636]={'$like':'%'+_0x5d509e[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0xc0201;})});}_0x346704=_['merge']({},_0x346704,_0x5d509e[_0x3500('0x47')]);return _0x4f6c88[_0x3500('0x11f')](_0x346704);}})[_0x3500('0x13')](function(_0x34b9e7){if(_0x34b9e7){_0x4c02dc=_0x34b9e7['length'];if(!_0x5d509e[_0x3500('0x39')][_0x3500('0x3f')](_0x3500('0x40'))){_0x346704['limit']=qs[_0x3500('0x22')](_0x5d509e[_0x3500('0x39')][_0x3500('0x22')]);_0x346704[_0x3500('0x1f')]=qs[_0x3500('0x1f')](_0x5d509e['query'][_0x3500('0x1f')]);}return _0x4f6c88[_0x3500('0x11f')](_0x346704);}})[_0x3500('0x13')](function(_0x17348b){if(_0x17348b){return _0x17348b?{'count':_0x4c02dc,'rows':_0x17348b}:null;}})[_0x3500('0x13')](respondWithResult(_0x12fe4d,null))[_0x3500('0x1d')](handleError(_0x12fe4d,null));};exports[_0x3500('0x120')]=function(_0x373016,_0x3fe7df){var _0x510fa5=_0x373016['query'][_0x3500('0x121')]==='false'?_0x3500('0x122'):_0x3500('0x123');return db['ChatWebsite']['find']({'attributes':['id',_0x510fa5],'where':{'id':_0x373016[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x3fe7df,null))[_0x3500('0x13')](function(_0x17f3a4){if(_0x17f3a4){var _0x388e79=_0x17f3a4[_0x510fa5];var _0x11c106=_0x388e79&&_0x388e79['items']?_0x388e79[_0x3500('0x124')]:[];_0x3fe7df[_0x3500('0xc1')]({'fromKey':_['isNil'](_0x388e79[_0x3500('0x125')])?undefined:_0x388e79[_0x3500('0x125')],'count':_0x11c106[_0x3500('0x3e')],'rows':_0x11c106});}})['catch'](handleError(_0x3fe7df,null));};exports[_0x3500('0x126')]=function(_0x9e1c7d,_0xdc6977){var _0x2ea44c={'raw':![],'where':{}};var _0x5b99d5={};var _0x2b28d3={'count':0x0,'rows':[]};return db[_0x3500('0x32')][_0x3500('0x57')]({'where':{'id':_0x9e1c7d[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0xdc6977,null))['then'](function(_0x38738a){if(_0x38738a){_0x5b99d5[_0x3500('0x37')]=_[_0x3500('0x3a')](db[_0x3500('0xcc')]['rawAttributes']);_0x5b99d5[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x9e1c7d[_0x3500('0x39')]);_0x5b99d5[_0x3500('0x3b')]=_[_0x3500('0x3c')](_0x5b99d5['model'],_0x5b99d5[_0x3500('0x39')]);_0x2ea44c[_0x3500('0x3d')]=_[_0x3500('0x3c')](_0x5b99d5[_0x3500('0x37')],qs[_0x3500('0x4a')](_0x9e1c7d[_0x3500('0x39')]['fields']));_0x2ea44c[_0x3500('0x3d')]=_0x2ea44c['attributes'][_0x3500('0x3e')]?_0x2ea44c['attributes']:_0x5b99d5[_0x3500('0x37')];if(!_0x9e1c7d[_0x3500('0x39')]['hasOwnProperty'](_0x3500('0x40'))){_0x2ea44c[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x9e1c7d['query'][_0x3500('0x22')]);_0x2ea44c[_0x3500('0x1f')]=qs['offset'](_0x9e1c7d[_0x3500('0x39')][_0x3500('0x1f')]);}_0x2ea44c[_0x3500('0x58')]=qs[_0x3500('0x41')](_0x9e1c7d[_0x3500('0x39')][_0x3500('0x41')]);_0x2ea44c[_0x3500('0x44')]=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x9e1c7d[_0x3500('0x39')],_0x5b99d5[_0x3500('0x3b')]));_0x2ea44c[_0x3500('0x44')]['ChatWebsiteId']=_0x38738a['id'];if(_0x9e1c7d[_0x3500('0x39')][_0x3500('0x43')]){_0x2ea44c[_0x3500('0x44')]=_[_0x3500('0x46')](_0x2ea44c['where'],{'$or':_[_0x3500('0x38')](_0x2ea44c[_0x3500('0x3d')],function(_0x277350){var _0xd727c6={};_0xd727c6[_0x277350]={'$like':'%'+_0x9e1c7d[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0xd727c6;})});}_0x2ea44c=_['merge']({},_0x2ea44c,_0x9e1c7d[_0x3500('0x47')]);return db['ChatOfflineMessage'][_0x3500('0x21')]({'where':_0x2ea44c[_0x3500('0x44')]})[_0x3500('0x13')](function(_0x365fe1){_0x2b28d3[_0x3500('0x21')]=_0x365fe1;if(_0x9e1c7d['query'][_0x3500('0x48')]){_0x2ea44c[_0x3500('0x49')]=[{'all':!![]}];}else{_0x2ea44c[_0x3500('0x49')]=[{'model':db[_0x3500('0x8d')],'as':'Contact','required':![]},{'model':db[_0x3500('0xd3')],'as':_0x3500('0x127'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x2ea44c);})[_0x3500('0x13')](function(_0x59ebf){_0x2b28d3['rows']=_0x59ebf;return _0x2b28d3;});}})[_0x3500('0x13')](respondWithFilteredResult(_0xdc6977,_0x2ea44c))['catch'](handleError(_0xdc6977,null));};exports['addAgents']=function(_0x109344,_0x2cc5f1){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x109344['params']['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x2cc5f1,null))[_0x3500('0x13')](function(_0x1390ca){if(_0x1390ca){return _0x1390ca[_0x3500('0x128')](_0x109344['body'][_0x3500('0x5c')],_[_0x3500('0xe9')](_0x109344[_0x3500('0x4d')],[_0x3500('0x5c'),'id'])||{})[_0x3500('0xaa')](function(_0x2b0098){for(var _0x337547=0x0;_0x337547<_0x109344['body'][_0x3500('0x5c')]['length'];_0x337547+=0x1){socket['emit'](_0x3500('0x129'),{'UserId':Number(_0x109344['body'][_0x3500('0x5c')][_0x337547]),'ChatWebsiteId':Number(_0x109344[_0x3500('0x54')]['id'])});}return _0x2b0098;});}})[_0x3500('0x13')](respondWithResult(_0x2cc5f1,null))[_0x3500('0x1d')](handleError(_0x2cc5f1,null));};exports['removeAgents']=function(_0x5efc01,_0x3872e2){return db[_0x3500('0x32')][_0x3500('0x4b')]({'where':{'id':_0x5efc01[_0x3500('0x54')]['id']}})['then'](handleEntityNotFound(_0x3872e2,null))[_0x3500('0x13')](function(_0x5004c0){if(_0x5004c0){return _0x5004c0[_0x3500('0x12a')](_0x5efc01[_0x3500('0x39')][_0x3500('0x5c')])[_0x3500('0x13')](function(){if(_[_0x3500('0x12b')](_0x5efc01[_0x3500('0x39')][_0x3500('0x5c')])){for(var _0x49d893=0x0;_0x49d893<_0x5efc01[_0x3500('0x39')][_0x3500('0x5c')][_0x3500('0x3e')];_0x49d893+=0x1){socket[_0x3500('0x12c')]('userChatWebsite:remove',{'UserId':Number(_0x5efc01[_0x3500('0x39')]['ids'][_0x49d893]),'ChatWebsiteId':Number(_0x5efc01[_0x3500('0x54')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x5efc01[_0x3500('0x39')][_0x3500('0x5c')]),'ChatWebsiteId':Number(_0x5efc01['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3872e2,null))['catch'](handleError(_0x3872e2,null));};exports['getAgents']=function(_0x3b5fa4,_0x372556){var _0x3c29d0={};var _0x46006f={};var _0xd05492;var _0x388f07;return db['ChatWebsite']['findOne']({'where':{'id':_0x3b5fa4[_0x3500('0x54')]['id']}})[_0x3500('0x13')](handleEntityNotFound(_0x372556,null))[_0x3500('0x13')](function(_0x575193){if(_0x575193){_0xd05492=_0x575193;_0x46006f[_0x3500('0x37')]=_['keys'](db[_0x3500('0xb4')]['rawAttributes']);_0x46006f['query']=_[_0x3500('0x3a')](_0x3b5fa4['query']);_0x46006f[_0x3500('0x3b')]=_['intersection'](_0x46006f['model'],_0x46006f[_0x3500('0x39')]);_0x3c29d0[_0x3500('0x3d')]=_['intersection'](_0x46006f[_0x3500('0x37')],qs['fields'](_0x3b5fa4[_0x3500('0x39')][_0x3500('0x4a')]));_0x3c29d0[_0x3500('0x3d')]=_0x3c29d0[_0x3500('0x3d')][_0x3500('0x3e')]?_0x3c29d0[_0x3500('0x3d')]:_0x46006f[_0x3500('0x37')];_0x3c29d0[_0x3500('0x58')]=qs['sort'](_0x3b5fa4[_0x3500('0x39')]['sort']);_0x3c29d0[_0x3500('0x44')]=qs[_0x3500('0x3b')](_[_0x3500('0x42')](_0x3b5fa4[_0x3500('0x39')],_0x46006f[_0x3500('0x3b')]));if(_0x3b5fa4[_0x3500('0x39')][_0x3500('0x43')]){_0x3c29d0['where']=_[_0x3500('0x46')](_0x3c29d0[_0x3500('0x44')],{'$or':_[_0x3500('0x38')](_0x3c29d0['attributes'],function(_0x21b3af){var _0x5d8d3b={};_0x5d8d3b[_0x21b3af]={'$like':'%'+_0x3b5fa4[_0x3500('0x39')][_0x3500('0x43')]+'%'};return _0x5d8d3b;})});}_0x3c29d0=_[_0x3500('0x46')]({},_0x3c29d0,_0x3b5fa4[_0x3500('0x47')]);return _0xd05492[_0x3500('0x12d')](_0x3c29d0);}})[_0x3500('0x13')](function(_0x570a14){if(_0x570a14){_0x388f07=_0x570a14[_0x3500('0x3e')];if(!_0x3b5fa4[_0x3500('0x39')][_0x3500('0x3f')](_0x3500('0x40'))){_0x3c29d0[_0x3500('0x22')]=qs[_0x3500('0x22')](_0x3b5fa4[_0x3500('0x39')][_0x3500('0x22')]);_0x3c29d0[_0x3500('0x1f')]=qs['offset'](_0x3b5fa4[_0x3500('0x39')]['offset']);}return _0xd05492[_0x3500('0x12d')](_0x3c29d0);}})[_0x3500('0x13')](function(_0x44ad69){if(_0x44ad69){return _0x44ad69?{'count':_0x388f07,'rows':_0x44ad69}:null;}})[_0x3500('0x13')](respondWithResult(_0x372556,null))[_0x3500('0x1d')](handleError(_0x372556,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b83b022..de398d3 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 _0x8a28=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8a28,0xfd));var _0x88a2=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8a28[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0x88a2('0x0'));var ChatWebsite=require(_0x88a2('0x1'))['db'][_0x88a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x88a2('0x3')](0x0);var events={'afterCreate':_0x88a2('0x4'),'afterUpdate':_0x88a2('0x5'),'afterDestroy':_0x88a2('0x6')};function emitEvent(_0x3fc89d){return function(_0x5d5b92,_0x2f482e,_0x238f2a){ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d+':'+_0x5d5b92['id'],_0x5d5b92);ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d,_0x5d5b92);_0x238f2a(null);};}for(var e in events){if(events[_0x88a2('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x88a2('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa13d=['update','emit','hook','exports','events','ChatWebsite','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa13d,0x154));var _0xda13=function(_0x4c8f8c,_0x126298){_0x4c8f8c=_0x4c8f8c-0x0;var _0x57bfeb=_0xa13d[_0x4c8f8c];return _0x57bfeb;};'use strict';var EventEmitter=require(_0xda13('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xda13('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xda13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xda13('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3a3d87){return function(_0x208aa8,_0x56837b,_0x5b00af){ChatWebsiteEvents[_0xda13('0x4')](_0x3a3d87+':'+_0x208aa8['id'],_0x208aa8);ChatWebsiteEvents[_0xda13('0x4')](_0x3a3d87,_0x208aa8);_0x5b00af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xda13('0x5')](e,emitEvent(event));}}module[_0xda13('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 54d6a95..1c91dc0 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 _0xa51e=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x99e061,_0x4f1628){var _0x4f9ea3=function(_0x28f38c){while(--_0x28f38c){_0x99e061['push'](_0x99e061['shift']());}};_0x4f9ea3(++_0x4f1628);}(_0xa51e,0xd8));var _0xea51=function(_0x3f7e42,_0x47fafe){_0x3f7e42=_0x3f7e42-0x0;var _0x3bfbe8=_0xa51e[_0x3f7e42];return _0x3bfbe8;};'use strict';var _=require(_0xea51('0x0'));var util=require(_0xea51('0x1'));var logger=require(_0xea51('0x2'))('api');var moment=require(_0xea51('0x3'));var BPromise=require(_0xea51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea51('0x5'));var rimraf=require(_0xea51('0x6'));var config=require(_0xea51('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xea51('0x8')]=function(_0x1dce87,_0x3f95b8){return _0x1dce87[_0xea51('0x9')](_0xea51('0xa'),attributes,{'tableName':_0xea51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2446=['moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x2446,0x8c));var _0x6244=function(_0x4458eb,_0x42b851){_0x4458eb=_0x4458eb-0x0;var _0x3278bf=_0x2446[_0x4458eb];return _0x3278bf;};'use strict';var _=require(_0x6244('0x0'));var util=require(_0x6244('0x1'));var logger=require(_0x6244('0x2'))('api');var moment=require(_0x6244('0x3'));var BPromise=require('bluebird');var rp=require(_0x6244('0x4'));var fs=require('fs');var path=require(_0x6244('0x5'));var rimraf=require('rimraf');var config=require(_0x6244('0x6'));var attributes=require(_0x6244('0x7'));module[_0x6244('0x8')]=function(_0x4cc5fd,_0xa9ed2e){return _0x4cc5fd['define'](_0x6244('0x9'),attributes,{'tableName':_0x6244('0xa'),'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 784b38c..f90928b 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 _0xd77e=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x5aedc7,_0x102a15){var _0x54a4ce=function(_0x260b2f){while(--_0x260b2f){_0x5aedc7['push'](_0x5aedc7['shift']());}};_0x54a4ce(++_0x102a15);}(_0xd77e,0x175));var _0xed77=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd77e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xed77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed77('0x1'));var fs=require('fs');var Redis=require(_0xed77('0x2'));var db=require(_0xed77('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xed77('0x4'))('rpc');var config=require(_0xed77('0x5'));var jayson=require(_0xed77('0x6'));var client=jayson[_0xed77('0x7')]['http']({'port':0x232a});config[_0xed77('0x8')]=_[_0xed77('0x9')](config[_0xed77('0x8')],{'host':_0xed77('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed77('0x8')]));require(_0xed77('0xb'))[_0xed77('0xc')](socket);function respondWithRpcPromise(_0x280ee6,_0x513cd1,_0x2b702a){return new BPromise(function(_0x21127b,_0x21adc8){return client[_0xed77('0xd')](_0x280ee6,_0x2b702a)[_0xed77('0xe')](function(_0x21170d){logger['info'](_0xed77('0xf'),_0x513cd1,_0xed77('0x10'));logger[_0xed77('0x11')](_0xed77('0x12'),_0x513cd1,_0xed77('0x10'),JSON[_0xed77('0x13')](_0x21170d));if(_0x21170d['error']){if(_0x21170d['error'][_0xed77('0x14')]===0x1f4){logger['error'](_0xed77('0xf'),_0x513cd1,_0x21170d[_0xed77('0x15')]['message']);return _0x21adc8(_0x21170d[_0xed77('0x15')][_0xed77('0x16')]);}logger[_0xed77('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x513cd1,_0x21170d[_0xed77('0x15')][_0xed77('0x16')]);return _0x21127b(_0x21170d[_0xed77('0x15')]['message']);}else{logger[_0xed77('0x17')](_0xed77('0xf'),_0x513cd1,_0xed77('0x10'));_0x21127b(_0x21170d[_0xed77('0x18')][_0xed77('0x16')]);}})[_0xed77('0x19')](function(_0x11ee4d){logger[_0xed77('0x15')](_0xed77('0xf'),_0x513cd1,_0x11ee4d);_0x21adc8(_0x11ee4d);});});} \ No newline at end of file +var _0x7a99=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x1aa853,_0x50501f){var _0x35bc07=function(_0xf6a4e7){while(--_0xf6a4e7){_0x1aa853['push'](_0x1aa853['shift']());}};_0x35bc07(++_0x50501f);}(_0x7a99,0x19b));var _0x97a9=function(_0x2863d7,_0x29f43){_0x2863d7=_0x2863d7-0x0;var _0x32ff01=_0x7a99[_0x2863d7];return _0x32ff01;};'use strict';var _=require(_0x97a9('0x0'));var util=require('util');var moment=require(_0x97a9('0x1'));var BPromise=require(_0x97a9('0x2'));var rs=require(_0x97a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x97a9('0x5'))(_0x97a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x97a9('0x7'));var client=jayson[_0x97a9('0x8')][_0x97a9('0x9')]({'port':0x232a});config[_0x97a9('0xa')]=_['defaults'](config['redis'],{'host':_0x97a9('0xb'),'port':0x18eb});var socket=require(_0x97a9('0xc'))(new Redis(config['redis']));require(_0x97a9('0xd'))[_0x97a9('0xe')](socket);function respondWithRpcPromise(_0x567667,_0x3dd76c,_0x6a6ce8){return new BPromise(function(_0xe7a35f,_0x2acbcb){return client[_0x97a9('0xf')](_0x567667,_0x6a6ce8)['then'](function(_0x157664){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3dd76c,_0x97a9('0x10'));logger[_0x97a9('0x11')](_0x97a9('0x12'),_0x3dd76c,_0x97a9('0x10'),JSON['stringify'](_0x157664));if(_0x157664[_0x97a9('0x13')]){if(_0x157664[_0x97a9('0x13')]['code']===0x1f4){logger[_0x97a9('0x13')](_0x97a9('0x14'),_0x3dd76c,_0x157664[_0x97a9('0x13')]['message']);return _0x2acbcb(_0x157664['error']['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3dd76c,_0x157664[_0x97a9('0x13')][_0x97a9('0x15')]);return _0xe7a35f(_0x157664[_0x97a9('0x13')][_0x97a9('0x15')]);}else{logger['info'](_0x97a9('0x14'),_0x3dd76c,_0x97a9('0x10'));_0xe7a35f(_0x157664[_0x97a9('0x16')][_0x97a9('0x15')]);}})['catch'](function(_0x37a6bd){logger[_0x97a9('0x13')](_0x97a9('0x14'),_0x3dd76c,_0x37a6bd);_0x2acbcb(_0x37a6bd);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index b2cbec7..ba1b38b 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 _0x50d0=['save','remove','update','emit','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x50d0,0xa7));var _0x050d=function(_0x35b2c9,_0x50eb79){_0x35b2c9=_0x35b2c9-0x0;var _0xb2f40d=_0x50d0[_0x35b2c9];return _0xb2f40d;};'use strict';var ChatWebsiteEvents=require(_0x050d('0x0'));var events=[_0x050d('0x1'),_0x050d('0x2'),_0x050d('0x3')];function createListener(_0x114095,_0x17e0de){return function(_0x5042fe){_0x17e0de[_0x050d('0x4')](_0x114095,_0x5042fe);};}function removeListener(_0x58be5a,_0x7b9ed3){return function(){ChatWebsiteEvents['removeListener'](_0x58be5a,_0x7b9ed3);};}exports[_0x050d('0x5')]=function(_0x4db9f4){for(var _0x16db96=0x0,_0x5e3fc0=events[_0x050d('0x6')];_0x16db96<_0x5e3fc0;_0x16db96++){var _0x19d6dd=events[_0x16db96];var _0x241af9=createListener(_0x050d('0x7')+_0x19d6dd,_0x4db9f4);ChatWebsiteEvents['on'](_0x19d6dd,_0x241af9);}}; \ No newline at end of file +var _0x3ce0=['chatWebsite:','./chatWebsite.events','save','remove','update','length'];(function(_0x386597,_0x3e27c3){var _0x1ac397=function(_0x41bea5){while(--_0x41bea5){_0x386597['push'](_0x386597['shift']());}};_0x1ac397(++_0x3e27c3);}(_0x3ce0,0x145));var _0x03ce=function(_0x52efe5,_0x5f40e8){_0x52efe5=_0x52efe5-0x0;var _0x545866=_0x3ce0[_0x52efe5];return _0x545866;};'use strict';var ChatWebsiteEvents=require(_0x03ce('0x0'));var events=[_0x03ce('0x1'),_0x03ce('0x2'),_0x03ce('0x3')];function createListener(_0x415584,_0x4a3de4){return function(_0x2e9280){_0x4a3de4['emit'](_0x415584,_0x2e9280);};}function removeListener(_0x448f1b,_0x13e265){return function(){ChatWebsiteEvents['removeListener'](_0x448f1b,_0x13e265);};}exports['register']=function(_0x2b4649){for(var _0x2ce99b=0x0,_0x5a510e=events[_0x03ce('0x4')];_0x2ce99b<_0x5a510e;_0x2ce99b++){var _0xdb22e4=events[_0x2ce99b];var _0x465bdc=createListener(_0x03ce('0x5')+_0xdb22e4,_0x2b4649);ChatWebsiteEvents['on'](_0xdb22e4,_0x465bdc);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 3ea22cd..ee573c4 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 _0xca10=['fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','root','format','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','any','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router'];(function(_0x2df13f,_0x3a3921){var _0x5c8a3f=function(_0x38aba4){while(--_0x38aba4){_0x2df13f['push'](_0x2df13f['shift']());}};_0x5c8a3f(++_0x3a3921);}(_0xca10,0x199));var _0x0ca1=function(_0x31fb63,_0x3d54fa){_0x31fb63=_0x31fb63-0x0;var _0x569704=_0xca10[_0x31fb63];return _0x569704;};'use strict';var multer=require(_0x0ca1('0x0'));var util=require('util');var path=require(_0x0ca1('0x1'));var timeout=require(_0x0ca1('0x2'));var express=require(_0x0ca1('0x3'));var router=express[_0x0ca1('0x4')]();var fs_extra=require(_0x0ca1('0x5'));var auth=require(_0x0ca1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0ca1('0x7'));var controller=require(_0x0ca1('0x8'));router['get']('/',auth[_0x0ca1('0x9')](),controller['index']);router[_0x0ca1('0xa')](_0x0ca1('0xb'),auth[_0x0ca1('0x9')](),controller[_0x0ca1('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0xd')]);router[_0x0ca1('0xa')](_0x0ca1('0xe'),auth[_0x0ca1('0x9')](),controller[_0x0ca1('0xf')]);router['get'](_0x0ca1('0x10'),controller[_0x0ca1('0x11')]);router['get'](_0x0ca1('0x12'),controller[_0x0ca1('0x13')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x0ca1('0xa')]('/:id/system_avatar',controller[_0x0ca1('0x14')]);router['get']('/:id/interactions',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x15')]);router[_0x0ca1('0xa')](_0x0ca1('0x16'),controller[_0x0ca1('0x17')]);router['get'](_0x0ca1('0x18'),auth['isAuthenticated'](),controller[_0x0ca1('0x19')]);router['get']('/:id/proactive_actions',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x1a')]);router[_0x0ca1('0xa')]('/:id/fields',controller[_0x0ca1('0x1b')]);router[_0x0ca1('0xa')](_0x0ca1('0x1c'),auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x1d')]);router[_0x0ca1('0xa')](_0x0ca1('0x1e'),auth[_0x0ca1('0x9')](),controller['getAgents']);router[_0x0ca1('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ca1('0x1f')]('/:id/dispositions',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x20')]);router[_0x0ca1('0x1f')](_0x0ca1('0xe'),auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x21')]);var upload=multer({'storage':multer[_0x0ca1('0x22')]({'destination':function(_0x3b7461,_0x46f39f,_0x511510){_0x511510(null,path[_0x0ca1('0x23')](config['root'],'server/files/images/logos/'));},'filename':function(_0x59410a,_0x17edaf,_0x1480d9){_0x1480d9(null,util['format'](_0x0ca1('0x24'),Date[_0x0ca1('0x25')](),_0x17edaf[_0x0ca1('0x26')]));}})});router['post'](_0x0ca1('0x10'),upload[_0x0ca1('0x27')](_0x0ca1('0x28')),controller[_0x0ca1('0x29')]);var upload=multer({'storage':multer[_0x0ca1('0x22')]({'destination':function(_0x1829c2,_0xd61aa4,_0x2d9723){_0x2d9723(null,path[_0x0ca1('0x23')](config['root'],_0x0ca1('0x2a')));},'filename':function(_0x233de1,_0x32b24f,_0x591c49){_0x591c49(null,util['format']('%s-%s',Date['now'](),_0x32b24f[_0x0ca1('0x26')]));}})});router['post'](_0x0ca1('0x12'),upload[_0x0ca1('0x27')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2930b8,_0x39c318,_0x41196b){_0x41196b(null,path[_0x0ca1('0x23')](config[_0x0ca1('0x2b')],_0x0ca1('0x2a')));},'filename':function(_0x5dab22,_0x102328,_0x5979c6){_0x5979c6(null,util[_0x0ca1('0x2c')](_0x0ca1('0x24'),Date['now'](),_0x102328[_0x0ca1('0x26')]));}})});router[_0x0ca1('0x1f')](_0x0ca1('0x2d'),upload['single'](_0x0ca1('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x0ca1('0x22')]({'destination':function(_0x4bf7f4,_0x6ea00e,_0x59e7df){_0x59e7df(null,path['join'](config[_0x0ca1('0x2b')],_0x0ca1('0x2a')));},'filename':function(_0x40f753,_0xdf7b28,_0x31af09){_0x31af09(null,util[_0x0ca1('0x2c')](_0x0ca1('0x24'),Date[_0x0ca1('0x25')](),_0xdf7b28[_0x0ca1('0x26')]));}})});router[_0x0ca1('0x1f')](_0x0ca1('0x2e'),upload[_0x0ca1('0x27')]('file'),controller[_0x0ca1('0x2f')]);router['post']('/:id/notify',controller[_0x0ca1('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x0ca1('0x22')]({'destination':function(_0x4d71bb,_0x1d7e79,_0x36ef72){const _0xfc06b=path['join'](config[_0x0ca1('0x2b')],_0x0ca1('0x31'),_0x0ca1('0x32'),_0x0ca1('0x33'));fs_extra[_0x0ca1('0x34')](_0xfc06b,function(){_0x36ef72(null,_0xfc06b);});},'filename':function(_0x27b1ac,_0x321fc7,_0x4fb2cc){const _0x15ca4f=_0x321fc7[_0x0ca1('0x26')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x358e15=path[_0x0ca1('0x35')](_0x15ca4f);const _0x323e42=Date[_0x0ca1('0x25')]()+'-'+_0x15ca4f['replace'](_0x358e15,'')+_0x358e15;_0x4fb2cc(null,_0x323e42);}})});router[_0x0ca1('0x1f')]('/:id/offline',offlineUploadMulter[_0x0ca1('0x36')](),controller[_0x0ca1('0x37')]);router[_0x0ca1('0x1f')](_0x0ca1('0x38'),auth[_0x0ca1('0x9')](),controller['addInteraction']);router[_0x0ca1('0x1f')](_0x0ca1('0x18'),auth['isAuthenticated'](),controller[_0x0ca1('0x39')]);router[_0x0ca1('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x0ca1('0x3a')]);router[_0x0ca1('0x1f')](_0x0ca1('0x1e'),auth['isAuthenticated'](),controller[_0x0ca1('0x3b')]);router[_0x0ca1('0x3c')](_0x0ca1('0x3d'),auth['isAuthenticated'](),controller[_0x0ca1('0x3e')]);router['delete']('/:id',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x3f')]);router[_0x0ca1('0x40')]('/:id/dispositions',auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x41')]);router[_0x0ca1('0x40')](_0x0ca1('0xe'),auth[_0x0ca1('0x9')](),controller[_0x0ca1('0x42')]);router[_0x0ca1('0x40')](_0x0ca1('0x1e'),auth['isAuthenticated'](),controller[_0x0ca1('0x43')]);module[_0x0ca1('0x44')]=router; \ No newline at end of file +var _0x71d1=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','replace','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition'];(function(_0x567976,_0x4efa92){var _0x43872=function(_0x1789f8){while(--_0x1789f8){_0x567976['push'](_0x567976['shift']());}};_0x43872(++_0x4efa92);}(_0x71d1,0x179));var _0x171d=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0x71d1[_0x2fd160];return _0x5c2031;};'use strict';var multer=require('multer');var util=require(_0x171d('0x0'));var path=require(_0x171d('0x1'));var timeout=require(_0x171d('0x2'));var express=require(_0x171d('0x3'));var router=express[_0x171d('0x4')]();var fs_extra=require(_0x171d('0x5'));var auth=require(_0x171d('0x6'));var interaction=require(_0x171d('0x7'));var config=require(_0x171d('0x8'));var controller=require('./chatWebsite.controller');router[_0x171d('0x9')]('/',auth['isAuthenticated'](),controller[_0x171d('0xa')]);router['get'](_0x171d('0xb'),auth[_0x171d('0xc')](),controller[_0x171d('0xd')]);router[_0x171d('0x9')](_0x171d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x171d('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x171d('0xf')]);router['get'](_0x171d('0x10'),auth[_0x171d('0xc')](),controller[_0x171d('0x11')]);router['get']('/:id/logo',controller[_0x171d('0x12')]);router[_0x171d('0x9')]('/:id/avatar',controller[_0x171d('0x13')]);router[_0x171d('0x9')](_0x171d('0x14'),controller['getCustomerAvatar']);router['get'](_0x171d('0x15'),controller['getSystemAvatar']);router['get'](_0x171d('0x16'),auth['isAuthenticated'](),controller[_0x171d('0x17')]);router[_0x171d('0x9')]('/:id/snippet',controller[_0x171d('0x18')]);router[_0x171d('0x9')](_0x171d('0x19'),auth[_0x171d('0xc')](),controller[_0x171d('0x1a')]);router[_0x171d('0x9')](_0x171d('0x1b'),auth[_0x171d('0xc')](),controller[_0x171d('0x1c')]);router['get']('/:id/fields',controller[_0x171d('0x1d')]);router[_0x171d('0x9')](_0x171d('0x1e'),auth[_0x171d('0xc')](),controller[_0x171d('0x1f')]);router[_0x171d('0x9')](_0x171d('0x20'),auth[_0x171d('0xc')](),controller[_0x171d('0x21')]);router[_0x171d('0x22')]('/',auth[_0x171d('0xc')](),controller[_0x171d('0x23')]);router[_0x171d('0x22')]('/:id/dispositions',auth[_0x171d('0xc')](),controller[_0x171d('0x24')]);router['post'](_0x171d('0x10'),auth[_0x171d('0xc')](),controller[_0x171d('0x25')]);var upload=multer({'storage':multer[_0x171d('0x26')]({'destination':function(_0x127b60,_0x3d073e,_0x599898){_0x599898(null,path[_0x171d('0x27')](config[_0x171d('0x28')],_0x171d('0x29')));},'filename':function(_0x35e4b6,_0x58d4f6,_0x4e653b){_0x4e653b(null,util[_0x171d('0x2a')](_0x171d('0x2b'),Date[_0x171d('0x2c')](),_0x58d4f6[_0x171d('0x2d')]));}})});router[_0x171d('0x22')](_0x171d('0x2e'),upload[_0x171d('0x2f')](_0x171d('0x30')),controller[_0x171d('0x31')]);var upload=multer({'storage':multer[_0x171d('0x26')]({'destination':function(_0x31febe,_0x28e1ba,_0x1827ad){_0x1827ad(null,path[_0x171d('0x27')](config['root'],_0x171d('0x32')));},'filename':function(_0x525a69,_0x5b9331,_0x2f3368){_0x2f3368(null,util[_0x171d('0x2a')](_0x171d('0x2b'),Date['now'](),_0x5b9331[_0x171d('0x2d')]));}})});router[_0x171d('0x22')]('/:id/avatar',upload[_0x171d('0x2f')]('file'),controller[_0x171d('0x33')]);var upload=multer({'storage':multer[_0x171d('0x26')]({'destination':function(_0xd96e8d,_0x89d59b,_0x2bd127){_0x2bd127(null,path[_0x171d('0x27')](config[_0x171d('0x28')],_0x171d('0x32')));},'filename':function(_0x5ee8e5,_0x19ab21,_0x534fc8){_0x534fc8(null,util['format'](_0x171d('0x2b'),Date[_0x171d('0x2c')](),_0x19ab21[_0x171d('0x2d')]));}})});router[_0x171d('0x22')](_0x171d('0x14'),upload[_0x171d('0x2f')](_0x171d('0x30')),controller[_0x171d('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xbbff4f,_0x152772,_0x274357){_0x274357(null,path['join'](config[_0x171d('0x28')],_0x171d('0x32')));},'filename':function(_0x122d48,_0xd24bea,_0x251416){_0x251416(null,util[_0x171d('0x2a')](_0x171d('0x2b'),Date[_0x171d('0x2c')](),_0xd24bea[_0x171d('0x2d')]));}})});router[_0x171d('0x22')](_0x171d('0x15'),upload[_0x171d('0x2f')](_0x171d('0x30')),controller[_0x171d('0x35')]);router[_0x171d('0x22')](_0x171d('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x171d('0x26')]({'destination':function(_0x34994e,_0x543856,_0x547e23){const _0x71be0e=path['join'](config[_0x171d('0x28')],_0x171d('0x37'),'attachments','offline-chat');fs_extra['ensureDir'](_0x71be0e,function(){_0x547e23(null,_0x71be0e);});},'filename':function(_0x5152b1,_0x1083da,_0x3d0e78){const _0x2867e7=_0x1083da[_0x171d('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x587308=path['extname'](_0x2867e7);const _0x410490=Date[_0x171d('0x2c')]()+'-'+_0x2867e7[_0x171d('0x38')](_0x587308,'')+_0x587308;_0x3d0e78(null,_0x410490);}})});router[_0x171d('0x22')](_0x171d('0x39'),offlineUploadMulter[_0x171d('0x3a')](),controller[_0x171d('0x3b')]);router[_0x171d('0x22')](_0x171d('0x16'),auth[_0x171d('0xc')](),controller['addInteraction']);router[_0x171d('0x22')](_0x171d('0x19'),auth[_0x171d('0xc')](),controller[_0x171d('0x3c')]);router[_0x171d('0x22')](_0x171d('0x1b'),auth['isAuthenticated'](),controller[_0x171d('0x3d')]);router['post'](_0x171d('0x20'),auth[_0x171d('0xc')](),controller[_0x171d('0x3e')]);router[_0x171d('0x3f')]('/:id',auth[_0x171d('0xc')](),controller[_0x171d('0x40')]);router[_0x171d('0x41')](_0x171d('0xe'),auth[_0x171d('0xc')](),controller[_0x171d('0x42')]);router[_0x171d('0x41')]('/:id/dispositions',auth[_0x171d('0xc')](),controller[_0x171d('0x43')]);router['delete'](_0x171d('0x10'),auth[_0x171d('0xc')](),controller[_0x171d('0x44')]);router[_0x171d('0x41')](_0x171d('0x20'),auth[_0x171d('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3ddafff..6379b8d 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 _0x560c=['express','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','use','beaver-logger/server'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0x560c,0x185));var _0xc560=function(_0x4776a0,_0xb4f50d){_0x4776a0=_0x4776a0-0x0;var _0x22900d=_0x560c[_0x4776a0];return _0x22900d;};var beaverLogger=require(_0xc560('0x0'));var express=require(_0xc560('0x1'));var auth=require(_0xc560('0x2'));var config=require(_0xc560('0x3'));var router=express['Router']();var isProduction=config[_0xc560('0x4')]===_0xc560('0x5')||![];function clientSideLogs(_0x1a0fad,_0x4d5131,_0x1f0b00){var _0x30490d=_0x1a0fad[_0xc560('0x6')][_0xc560('0x7')](_0xc560('0x8'));if(!_0x30490d){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x30490d,'enableCors':!isProduction})(_0x1a0fad,_0x4d5131,_0x1f0b00);}router[_0xc560('0x9')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xcbd8=['express','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x589a91,_0x116112){var _0x278242=function(_0x166d88){while(--_0x166d88){_0x589a91['push'](_0x589a91['shift']());}};_0x278242(++_0x116112);}(_0xcbd8,0xb5));var _0x8cbd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcbd8[_0x501510];return _0x1e6ee5;};var beaverLogger=require(_0x8cbd('0x0'));var express=require(_0x8cbd('0x1'));var auth=require(_0x8cbd('0x2'));var config=require(_0x8cbd('0x3'));var router=express['Router']();var isProduction=config[_0x8cbd('0x4')]===_0x8cbd('0x5')||![];function clientSideLogs(_0x6d686a,_0x11de80,_0x3fe321){var _0x372d58=_0x6d686a[_0x8cbd('0x6')][_0x8cbd('0x7')](_0x8cbd('0x8'));if(!_0x372d58){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x8cbd('0x9')]({'uri':_0x8cbd('0xa'),'logger':_0x372d58,'enableCors':!isProduction})(_0x6d686a,_0x11de80,_0x3fe321);}router[_0x8cbd('0xb')](auth[_0x8cbd('0xc')](),clientSideLogs);module[_0x8cbd('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index a0c9034..62e49cc 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 _0x0a02=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xe09416,_0x40eeed){var _0x664cfb=function(_0x30473f){while(--_0x30473f){_0xe09416['push'](_0xe09416['shift']());}};_0x664cfb(++_0x40eeed);}(_0x0a02,0xe1));var _0x20a0=function(_0x16d6a2,_0x266958){_0x16d6a2=_0x16d6a2-0x0;var _0x681283=_0x0a02[_0x16d6a2];return _0x681283;};'use strict';var Sequelize=require(_0x20a0('0x0'));module[_0x20a0('0x1')]={'name':{'type':Sequelize[_0x20a0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google',_0x20a0('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x20a0('0x4')](_0x20a0('0x5'),_0x20a0('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x20a0('0x7')},'data3':{'type':Sequelize[_0x20a0('0x2')],'comment':_0x20a0('0x8')},'data4':{'type':Sequelize[_0x20a0('0x2')],'comment':_0x20a0('0x9')},'data5':{'type':Sequelize[_0x20a0('0xa')],'comment':_0x20a0('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x20a0('0xa')],'comment':_0x20a0('0xc')}}; \ No newline at end of file +var _0x2bb6=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM'];(function(_0xd341b,_0x3100ba){var _0x86bd5a=function(_0x325140){while(--_0x325140){_0xd341b['push'](_0xd341b['shift']());}};_0x86bd5a(++_0x3100ba);}(_0x2bb6,0x6c));var _0x62bb=function(_0x769dd2,_0x51c569){_0x769dd2=_0x769dd2-0x0;var _0x103980=_0x2bb6[_0x769dd2];return _0x103980;};'use strict';var Sequelize=require(_0x62bb('0x0'));module[_0x62bb('0x1')]={'name':{'type':Sequelize[_0x62bb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x62bb('0x3')]('AmazonAWS','Google',_0x62bb('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x62bb('0x5'),_0x62bb('0x6'))},'data1':{'type':Sequelize[_0x62bb('0x2')],'comment':_0x62bb('0x7')},'data2':{'type':Sequelize[_0x62bb('0x2')],'comment':_0x62bb('0x8')},'data3':{'type':Sequelize[_0x62bb('0x2')],'comment':_0x62bb('0x9')},'data4':{'type':Sequelize[_0x62bb('0x2')],'comment':_0x62bb('0xa')},'data5':{'type':Sequelize[_0x62bb('0xb')],'comment':_0x62bb('0xc')},'data6':{'type':Sequelize[_0x62bb('0xb')],'comment':_0x62bb('0xd')},'data7':{'type':Sequelize[_0x62bb('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 581c5ea..f071366 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 _0x8a7c=['data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','status','end','undefined','count','offset','set','Content-Range','json','update','then','destroy','sendStatus','name','send','padEnd','map','CloudProvider','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','nolimit','limit','filters','merge','where','filter','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token'];(function(_0x3efc8a,_0x577444){var _0x288cda=function(_0x24adea){while(--_0x24adea){_0x3efc8a['push'](_0x3efc8a['shift']());}};_0x288cda(++_0x577444);}(_0x8a7c,0x1da));var _0xc8a7=function(_0x4dfec6,_0x147b0d){_0x4dfec6=_0x4dfec6-0x0;var _0x5953d4=_0x8a7c[_0x4dfec6];return _0x5953d4;};'use strict';var _=require(_0xc8a7('0x0'));var Redis=require('ioredis');var qs=require(_0xc8a7('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xc8a7('0x2'));var logger=require(_0xc8a7('0x3'))(_0xc8a7('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc8a7('0x5'));config[_0xc8a7('0x6')]=_[_0xc8a7('0x7')](config[_0xc8a7('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5b01da,_0x2a29bd){_0x2a29bd=_0x2a29bd||0xcc;return function(_0x52f166){if(_0x52f166){return _0x5b01da['sendStatus'](_0x2a29bd);}return _0x5b01da[_0xc8a7('0x8')](_0x2a29bd)[_0xc8a7('0x9')]();};}function respondWithResult(_0x24b20d,_0x187bf1){_0x187bf1=_0x187bf1||0xc8;return function(_0x1f293a){if(_0x1f293a){return _0x24b20d[_0xc8a7('0x8')](_0x187bf1)['json'](_0x1f293a);}};}function respondWithFilteredResult(_0x445ba9,_0x32eae0){return function(_0x1ec0a0){if(_0x1ec0a0){var _0x1e4e47=typeof _0x32eae0['offset']==='undefined'&&typeof _0x32eae0['limit']===_0xc8a7('0xa');var _0x33f7ca=_0x1ec0a0[_0xc8a7('0xb')];var _0x54c968=_0x1e4e47?0x0:_0x32eae0[_0xc8a7('0xc')];var _0x5958f5=_0x1e4e47?_0x1ec0a0['count']:_0x32eae0[_0xc8a7('0xc')]+_0x32eae0['limit'];var _0x31a3aa;if(_0x5958f5>=_0x33f7ca){_0x5958f5=_0x33f7ca;_0x31a3aa=0xc8;}else{_0x31a3aa=0xce;}_0x445ba9[_0xc8a7('0x8')](_0x31a3aa);return _0x445ba9[_0xc8a7('0xd')](_0xc8a7('0xe'),_0x54c968+'-'+_0x5958f5+'/'+_0x33f7ca)[_0xc8a7('0xf')](_0x1ec0a0);}return null;};}function saveUpdates(_0x4e9358){return function(_0x332aaf){if(_0x332aaf){return _0x332aaf[_0xc8a7('0x10')](_0x4e9358)[_0xc8a7('0x11')](function(_0x1f70c9){return _0x1f70c9;});}return null;};}function removeEntity(_0xbb5d96){return function(_0x67b338){if(_0x67b338){return _0x67b338[_0xc8a7('0x12')]()[_0xc8a7('0x11')](function(){_0xbb5d96[_0xc8a7('0x8')](0xcc)[_0xc8a7('0x9')]();});}};}function handleEntityNotFound(_0x4ebad4){return function(_0x16263b){if(!_0x16263b){_0x4ebad4[_0xc8a7('0x13')](0x194);}return _0x16263b;};}function handleError(_0x420348,_0x4750ed){_0x4750ed=_0x4750ed||0x1f4;return function(_0x115b41){logger['error'](_0x115b41['stack']);if(_0x115b41['name']){delete _0x115b41[_0xc8a7('0x14')];}_0x420348[_0xc8a7('0x8')](_0x4750ed)[_0xc8a7('0x15')](_0x115b41);};}function maskClientSecret(_0x1e0295){return _[_0xc8a7('0x16')](_0x1e0295['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x141c9c,_0x4247b5){var _0x215a51={},_0x10cd9d={},_0x4aec7a={'count':0x0,'rows':[]};var _0x37d575=_[_0xc8a7('0x17')](db[_0xc8a7('0x18')][_0xc8a7('0x19')],function(_0xdf5985){return{'name':_0xdf5985[_0xc8a7('0x1a')],'type':_0xdf5985['type'][_0xc8a7('0x1b')]};});_0x10cd9d['model']=_[_0xc8a7('0x17')](_0x37d575,_0xc8a7('0x14'));_0x10cd9d[_0xc8a7('0x1c')]=_[_0xc8a7('0x1d')](_0x141c9c[_0xc8a7('0x1c')]);_0x10cd9d['filters']=_[_0xc8a7('0x1e')](_0x10cd9d['model'],_0x10cd9d[_0xc8a7('0x1c')]);_0x215a51[_0xc8a7('0x1f')]=_[_0xc8a7('0x1e')](_0x10cd9d[_0xc8a7('0x20')],qs[_0xc8a7('0x21')](_0x141c9c[_0xc8a7('0x1c')]['fields']));_0x215a51['attributes']=_0x215a51['attributes'][_0xc8a7('0x22')]?_0x215a51['attributes']:_0x10cd9d[_0xc8a7('0x20')];if(!_0x141c9c[_0xc8a7('0x1c')]['hasOwnProperty'](_0xc8a7('0x23'))){_0x215a51[_0xc8a7('0x24')]=qs[_0xc8a7('0x24')](_0x141c9c['query']['limit']);_0x215a51[_0xc8a7('0xc')]=qs['offset'](_0x141c9c[_0xc8a7('0x1c')][_0xc8a7('0xc')]);}_0x215a51['order']=qs['sort'](_0x141c9c[_0xc8a7('0x1c')]['sort']);_0x215a51['where']=qs[_0xc8a7('0x25')](_['pick'](_0x141c9c[_0xc8a7('0x1c')],_0x10cd9d[_0xc8a7('0x25')]),_0x37d575);if(_0x141c9c['query']['filter']){_0x215a51['where']=_[_0xc8a7('0x26')](_0x215a51[_0xc8a7('0x27')],{'$or':_[_0xc8a7('0x17')](_0x37d575,function(_0x1f0c9f){if(_0x1f0c9f['type']!=='VIRTUAL'){var _0x549dc2={};_0x549dc2[_0x1f0c9f['name']]={'$like':'%'+_0x141c9c[_0xc8a7('0x1c')][_0xc8a7('0x28')]+'%'};return _0x549dc2;}})});}_0x215a51=_[_0xc8a7('0x26')]({},_0x215a51,_0x141c9c[_0xc8a7('0x29')]);var _0x40d3e5={'where':_0x215a51[_0xc8a7('0x27')]};return db['CloudProvider'][_0xc8a7('0xb')](_0x40d3e5)[_0xc8a7('0x11')](function(_0x49064a){_0x4aec7a[_0xc8a7('0xb')]=_0x49064a;if(_0x141c9c[_0xc8a7('0x1c')]['includeAll']){_0x215a51[_0xc8a7('0x2a')]=[{'all':!![]}];}return db[_0xc8a7('0x18')][_0xc8a7('0x2b')](_0x215a51);})[_0xc8a7('0x11')](function(_0x49efda){_0x4aec7a[_0xc8a7('0x2c')]=_[_0xc8a7('0x17')](_0x49efda,function(_0x748ffa){if(_0x748ffa[_0xc8a7('0x2d')]===_0xc8a7('0x2e')){var _0x4e06e5=encryptor[_0xc8a7('0x2f')](_0x748ffa[_0xc8a7('0x30')]);_0x748ffa[_0xc8a7('0x30')]=maskClientSecret(_0x4e06e5);}return _0x748ffa;});return _0x4aec7a;})[_0xc8a7('0x11')](respondWithFilteredResult(_0x4247b5,_0x215a51))[_0xc8a7('0x31')](handleError(_0x4247b5,null));};exports[_0xc8a7('0x32')]=function(_0x23fb23,_0x1feb09){var _0x366899={'raw':!![],'where':{'id':_0x23fb23[_0xc8a7('0x33')]['id']}},_0x4c4e00={};_0x4c4e00['model']=_['keys'](db[_0xc8a7('0x18')][_0xc8a7('0x19')]);_0x4c4e00[_0xc8a7('0x1c')]=_[_0xc8a7('0x1d')](_0x23fb23[_0xc8a7('0x1c')]);_0x4c4e00[_0xc8a7('0x25')]=_[_0xc8a7('0x1e')](_0x4c4e00[_0xc8a7('0x20')],_0x4c4e00[_0xc8a7('0x1c')]);_0x366899[_0xc8a7('0x1f')]=_[_0xc8a7('0x1e')](_0x4c4e00['model'],qs[_0xc8a7('0x21')](_0x23fb23[_0xc8a7('0x1c')]['fields']));_0x366899[_0xc8a7('0x1f')]=_0x366899[_0xc8a7('0x1f')]['length']?_0x366899['attributes']:_0x4c4e00[_0xc8a7('0x20')];if(_0x23fb23['query'][_0xc8a7('0x34')]){_0x366899[_0xc8a7('0x2a')]=[{'all':!![]}];}_0x366899=_[_0xc8a7('0x26')]({},_0x366899,_0x23fb23['options']);return db[_0xc8a7('0x18')][_0xc8a7('0x35')](_0x366899)[_0xc8a7('0x11')](handleEntityNotFound(_0x1feb09,null))[_0xc8a7('0x11')](function(_0x339555){if(_0x339555[_0xc8a7('0x2d')]===_0xc8a7('0x2e')){var _0x3ccbb3=encryptor[_0xc8a7('0x2f')](_0x339555[_0xc8a7('0x30')]);_0x339555[_0xc8a7('0x30')]=maskClientSecret(_0x3ccbb3);}return _0x339555;})['then'](respondWithResult(_0x1feb09,null))[_0xc8a7('0x31')](handleError(_0x1feb09,null));};exports[_0xc8a7('0x36')]=function(_0xa1c0f2,_0x11d308){if(!_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x14')])throw new Error(_0xc8a7('0x38'));if(!_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x2d')])throw new Error(_0xc8a7('0x39'));var _0x1b308f=db[_0xc8a7('0x18')][_0xc8a7('0x19')][_0xc8a7('0x2d')][_0xc8a7('0x3a')];if(!_0x1b308f[_0xc8a7('0x3b')](_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x2d')]))throw new Error(_0xc8a7('0x3c')+_0x1b308f[_0xc8a7('0x3d')](',\x20'));if(_0xa1c0f2['body'][_0xc8a7('0x2d')]===_0xc8a7('0x2e')&&_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x30')]){_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x30')]=encryptor[_0xc8a7('0x3e')](_0xa1c0f2[_0xc8a7('0x37')][_0xc8a7('0x30')]);}return db['CloudProvider']['create'](_0xa1c0f2[_0xc8a7('0x37')],{})[_0xc8a7('0x11')](respondWithResult(_0x11d308,0xc9))[_0xc8a7('0x31')](handleError(_0x11d308,null));};exports[_0xc8a7('0x10')]=function(_0x47e3b8,_0x5634d5){if(_0x47e3b8['body']['id']){delete _0x47e3b8[_0xc8a7('0x37')]['id'];}return db[_0xc8a7('0x18')][_0xc8a7('0x35')]({'where':{'id':_0x47e3b8[_0xc8a7('0x33')]['id']}})[_0xc8a7('0x11')](handleEntityNotFound(_0x5634d5,null))[_0xc8a7('0x11')](function(_0x1e056b){if(_0x1e056b[_0xc8a7('0x2d')]==='MicrosoftAzure'&&_0x47e3b8['body']['data3']){_0x47e3b8[_0xc8a7('0x37')][_0xc8a7('0x30')]=encryptor[_0xc8a7('0x3e')](_0x47e3b8[_0xc8a7('0x37')][_0xc8a7('0x30')]);}return _0x1e056b;})[_0xc8a7('0x11')](saveUpdates(_0x47e3b8['body'],null))[_0xc8a7('0x11')](respondWithResult(_0x5634d5,null))[_0xc8a7('0x31')](handleError(_0x5634d5,null));};exports[_0xc8a7('0x12')]=function(_0x1c85c1,_0x22712c){return db['CloudProvider'][_0xc8a7('0x35')]({'where':{'id':_0x1c85c1[_0xc8a7('0x33')]['id']}})[_0xc8a7('0x11')](handleEntityNotFound(_0x22712c,null))['then'](removeEntity(_0x22712c,null))[_0xc8a7('0x31')](handleError(_0x22712c,null));};exports[_0xc8a7('0x3f')]=function(_0x30729e,_0x1ea0dc){return db[_0xc8a7('0x18')][_0xc8a7('0x40')]({'where':{'id':_0x30729e[_0xc8a7('0x33')]['id']},'raw':!![]})[_0xc8a7('0x11')](function(_0x2e3771){if(!_0x2e3771)return _0x1ea0dc[_0xc8a7('0x13')](0x194);return{'url':oauth[_0xc8a7('0x41')](_0x2e3771,_0x30729e[_0xc8a7('0x42')]['id'])};})[_0xc8a7('0x11')](respondWithResult(_0x1ea0dc,null))[_0xc8a7('0x31')](handleError(_0x1ea0dc,null));};exports['oauth2MicrosoftCallback']=function(_0x5954b9,_0xbdbf1a){var _0x189f2b=_0x5954b9['body'];var _0x41a6cb;var _0x3d5ea8;if(_0x189f2b[_0xc8a7('0x43')])throw _0x189f2b;redis[_0xc8a7('0x44')](_0x189f2b[_0xc8a7('0x45')])[_0xc8a7('0x11')](function(_0x17cc18){if(!_0x17cc18)throw new Error(_0xc8a7('0x46'));_0x41a6cb=JSON[_0xc8a7('0x47')](_0x17cc18);var _0x6d711a=Buffer[_0xc8a7('0x48')](_0x189f2b['state'],_0xc8a7('0x49'))[_0xc8a7('0x4a')](_0xc8a7('0x4b'));_0x3d5ea8=JSON['parse'](_0x6d711a);if(!oauth[_0xc8a7('0x4c')](_0x189f2b[_0xc8a7('0x4d')],_0x41a6cb['oauth2Claims']))throw new Error(_0xc8a7('0x4e'));redis[_0xc8a7('0x4f')](_0x189f2b[_0xc8a7('0x45')]);return oauth[_0xc8a7('0x50')](_0x189f2b[_0xc8a7('0x51')],_0x41a6cb);})[_0xc8a7('0x11')](function(_0x432047){_0x41a6cb[_0xc8a7('0x52')]=_0x432047[_0xc8a7('0x53')];_0x41a6cb['data6']=_0x432047['refresh_token'];return db['CloudProvider'][_0xc8a7('0x10')]({'data5':_0x41a6cb[_0xc8a7('0x52')],'data6':_0x41a6cb[_0xc8a7('0x54')]},{'where':{'id':_0x41a6cb['id']}});})[_0xc8a7('0x11')](function(){oauth[_0xc8a7('0x55')](_0x41a6cb);socket[_0xc8a7('0x56')](_0xc8a7('0x57'),{'id':_0x3d5ea8['id']});return;})[_0xc8a7('0x11')](respondWithStatusCode(_0xbdbf1a,null))[_0xc8a7('0x31')](function(_0x56f6ae){if(_0x3d5ea8){socket[_0xc8a7('0x56')](_0xc8a7('0x58'),{'id':_0x3d5ea8['id']});}if(!_0x41a6cb){logger[_0xc8a7('0x43')](_0xc8a7('0x59'),_0x56f6ae);return _0xbdbf1a[_0xc8a7('0x8')](0x1f4)['send'](_0x56f6ae[_0xc8a7('0x5a')]);}logger[_0xc8a7('0x43')](_0xc8a7('0x5b'),_0x41a6cb['id'],JSON[_0xc8a7('0x5c')](_0x56f6ae));});}; \ No newline at end of file +var _0x5d5d=['attributes','intersection','query','fields','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','service','MicrosoftAzure','decryptString','show','find','data3','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','CloudProvider','update','findOne','params','sendStatus','generateMicrosoftAuthorizationUrl','catch','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','Content-Range','then','destroy','end','stack','name','send','padEnd','slice','index','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x18c40d,_0x37e964){var _0x147016=function(_0x41002f){while(--_0x41002f){_0x18c40d['push'](_0x18c40d['shift']());}};_0x147016(++_0x37e964);}(_0x5d5d,0x1be));var _0xd5d5=function(_0x539554,_0x48ab5c){_0x539554=_0x539554-0x0;var _0x266cd5=_0x5d5d[_0x539554];return _0x266cd5;};'use strict';var _=require(_0xd5d5('0x0'));var Redis=require(_0xd5d5('0x1'));var qs=require(_0xd5d5('0x2'));var encryptor=require(_0xd5d5('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xd5d5('0x4'));var db=require(_0xd5d5('0x5'))['db'];var oauth=require(_0xd5d5('0x6'));config[_0xd5d5('0x7')]=_[_0xd5d5('0x8')](config[_0xd5d5('0x7')],{'host':_0xd5d5('0x9'),'port':0x18eb});var socket=require(_0xd5d5('0xa'))(new Redis(config[_0xd5d5('0x7')]));var redis=new Redis(config[_0xd5d5('0x7')]);function respondWithStatusCode(_0x5f1d66,_0x5aed2d){_0x5aed2d=_0x5aed2d||0xcc;return function(_0x4d5e97){if(_0x4d5e97){return _0x5f1d66['sendStatus'](_0x5aed2d);}return _0x5f1d66[_0xd5d5('0xb')](_0x5aed2d)['end']();};}function respondWithResult(_0x58a122,_0x245188){_0x245188=_0x245188||0xc8;return function(_0x1e4d46){if(_0x1e4d46){return _0x58a122['status'](_0x245188)[_0xd5d5('0xc')](_0x1e4d46);}};}function respondWithFilteredResult(_0x473f9c,_0x2d332b){return function(_0x3fdb11){if(_0x3fdb11){var _0x1813e2=typeof _0x2d332b[_0xd5d5('0xd')]===_0xd5d5('0xe')&&typeof _0x2d332b[_0xd5d5('0xf')]==='undefined';var _0x21b34d=_0x3fdb11[_0xd5d5('0x10')];var _0x5b7d92=_0x1813e2?0x0:_0x2d332b['offset'];var _0x30e47f=_0x1813e2?_0x3fdb11['count']:_0x2d332b[_0xd5d5('0xd')]+_0x2d332b[_0xd5d5('0xf')];var _0xfe378f;if(_0x30e47f>=_0x21b34d){_0x30e47f=_0x21b34d;_0xfe378f=0xc8;}else{_0xfe378f=0xce;}_0x473f9c['status'](_0xfe378f);return _0x473f9c['set'](_0xd5d5('0x11'),_0x5b7d92+'-'+_0x30e47f+'/'+_0x21b34d)['json'](_0x3fdb11);}return null;};}function saveUpdates(_0x2352b8){return function(_0x1701cc){if(_0x1701cc){return _0x1701cc['update'](_0x2352b8)[_0xd5d5('0x12')](function(_0x63af0a){return _0x63af0a;});}return null;};}function removeEntity(_0x4c6b2b){return function(_0x1ea93a){if(_0x1ea93a){return _0x1ea93a[_0xd5d5('0x13')]()[_0xd5d5('0x12')](function(){_0x4c6b2b[_0xd5d5('0xb')](0xcc)[_0xd5d5('0x14')]();});}};}function handleEntityNotFound(_0x33a7e1){return function(_0x3e5114){if(!_0x3e5114){_0x33a7e1['sendStatus'](0x194);}return _0x3e5114;};}function handleError(_0x40d40b,_0xd5e45b){_0xd5e45b=_0xd5e45b||0x1f4;return function(_0x488d85){logger['error'](_0x488d85[_0xd5d5('0x15')]);if(_0x488d85[_0xd5d5('0x16')]){delete _0x488d85[_0xd5d5('0x16')];}_0x40d40b[_0xd5d5('0xb')](_0xd5e45b)[_0xd5d5('0x17')](_0x488d85);};}function maskClientSecret(_0x5d0486){return _[_0xd5d5('0x18')](_0x5d0486[_0xd5d5('0x19')](0x0,0x3),0x14,'*');}exports[_0xd5d5('0x1a')]=function(_0x2d3e6a,_0x4ea124){var _0x9ce974={},_0x3865c8={},_0x423277={'count':0x0,'rows':[]};var _0x5363ef=_['map'](db['CloudProvider'][_0xd5d5('0x1b')],function(_0xabb424){return{'name':_0xabb424[_0xd5d5('0x1c')],'type':_0xabb424[_0xd5d5('0x1d')][_0xd5d5('0x1e')]};});_0x3865c8[_0xd5d5('0x1f')]=_[_0xd5d5('0x20')](_0x5363ef,_0xd5d5('0x16'));_0x3865c8['query']=_[_0xd5d5('0x21')](_0x2d3e6a['query']);_0x3865c8['filters']=_['intersection'](_0x3865c8[_0xd5d5('0x1f')],_0x3865c8['query']);_0x9ce974[_0xd5d5('0x22')]=_[_0xd5d5('0x23')](_0x3865c8[_0xd5d5('0x1f')],qs['fields'](_0x2d3e6a[_0xd5d5('0x24')][_0xd5d5('0x25')]));_0x9ce974[_0xd5d5('0x22')]=_0x9ce974[_0xd5d5('0x22')]['length']?_0x9ce974[_0xd5d5('0x22')]:_0x3865c8[_0xd5d5('0x1f')];if(!_0x2d3e6a['query']['hasOwnProperty'](_0xd5d5('0x26'))){_0x9ce974['limit']=qs['limit'](_0x2d3e6a['query'][_0xd5d5('0xf')]);_0x9ce974[_0xd5d5('0xd')]=qs['offset'](_0x2d3e6a[_0xd5d5('0x24')]['offset']);}_0x9ce974[_0xd5d5('0x27')]=qs[_0xd5d5('0x28')](_0x2d3e6a[_0xd5d5('0x24')][_0xd5d5('0x28')]);_0x9ce974[_0xd5d5('0x29')]=qs[_0xd5d5('0x2a')](_[_0xd5d5('0x2b')](_0x2d3e6a['query'],_0x3865c8[_0xd5d5('0x2a')]),_0x5363ef);if(_0x2d3e6a[_0xd5d5('0x24')]['filter']){_0x9ce974[_0xd5d5('0x29')]=_['merge'](_0x9ce974[_0xd5d5('0x29')],{'$or':_[_0xd5d5('0x20')](_0x5363ef,function(_0x420061){if(_0x420061['type']!==_0xd5d5('0x2c')){var _0x492985={};_0x492985[_0x420061[_0xd5d5('0x16')]]={'$like':'%'+_0x2d3e6a[_0xd5d5('0x24')][_0xd5d5('0x2d')]+'%'};return _0x492985;}})});}_0x9ce974=_[_0xd5d5('0x2e')]({},_0x9ce974,_0x2d3e6a[_0xd5d5('0x2f')]);var _0x3b481c={'where':_0x9ce974[_0xd5d5('0x29')]};return db['CloudProvider'][_0xd5d5('0x10')](_0x3b481c)[_0xd5d5('0x12')](function(_0x2e244c){_0x423277[_0xd5d5('0x10')]=_0x2e244c;if(_0x2d3e6a[_0xd5d5('0x24')][_0xd5d5('0x30')]){_0x9ce974[_0xd5d5('0x31')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x9ce974);})['then'](function(_0x32aea2){_0x423277['rows']=_[_0xd5d5('0x20')](_0x32aea2,function(_0x898840){if(_0x898840[_0xd5d5('0x32')]===_0xd5d5('0x33')){var _0x1308a5=encryptor[_0xd5d5('0x34')](_0x898840['data3']);_0x898840['data3']=maskClientSecret(_0x1308a5);}return _0x898840;});return _0x423277;})[_0xd5d5('0x12')](respondWithFilteredResult(_0x4ea124,_0x9ce974))['catch'](handleError(_0x4ea124,null));};exports[_0xd5d5('0x35')]=function(_0x2ea6b2,_0x1d977a){var _0x24c024={'raw':!![],'where':{'id':_0x2ea6b2['params']['id']}},_0x580c68={};_0x580c68['model']=_[_0xd5d5('0x21')](db['CloudProvider']['rawAttributes']);_0x580c68[_0xd5d5('0x24')]=_[_0xd5d5('0x21')](_0x2ea6b2['query']);_0x580c68[_0xd5d5('0x2a')]=_['intersection'](_0x580c68[_0xd5d5('0x1f')],_0x580c68[_0xd5d5('0x24')]);_0x24c024[_0xd5d5('0x22')]=_[_0xd5d5('0x23')](_0x580c68[_0xd5d5('0x1f')],qs[_0xd5d5('0x25')](_0x2ea6b2['query'][_0xd5d5('0x25')]));_0x24c024[_0xd5d5('0x22')]=_0x24c024['attributes']['length']?_0x24c024[_0xd5d5('0x22')]:_0x580c68[_0xd5d5('0x1f')];if(_0x2ea6b2[_0xd5d5('0x24')][_0xd5d5('0x30')]){_0x24c024[_0xd5d5('0x31')]=[{'all':!![]}];}_0x24c024=_['merge']({},_0x24c024,_0x2ea6b2['options']);return db['CloudProvider'][_0xd5d5('0x36')](_0x24c024)[_0xd5d5('0x12')](handleEntityNotFound(_0x1d977a,null))['then'](function(_0x4f820a){if(_0x4f820a[_0xd5d5('0x32')]===_0xd5d5('0x33')){var _0x185a7a=encryptor[_0xd5d5('0x34')](_0x4f820a[_0xd5d5('0x37')]);_0x4f820a[_0xd5d5('0x37')]=maskClientSecret(_0x185a7a);}return _0x4f820a;})[_0xd5d5('0x12')](respondWithResult(_0x1d977a,null))['catch'](handleError(_0x1d977a,null));};exports[_0xd5d5('0x38')]=function(_0x5e7262,_0x28a1b1){if(!_0x5e7262['body'][_0xd5d5('0x16')])throw new Error(_0xd5d5('0x39'));if(!_0x5e7262[_0xd5d5('0x3a')][_0xd5d5('0x32')])throw new Error(_0xd5d5('0x3b'));var _0x30e1aa=db['CloudProvider']['rawAttributes'][_0xd5d5('0x32')][_0xd5d5('0x3c')];if(!_0x30e1aa[_0xd5d5('0x3d')](_0x5e7262[_0xd5d5('0x3a')][_0xd5d5('0x32')]))throw new Error(_0xd5d5('0x3e')+_0x30e1aa[_0xd5d5('0x3f')](',\x20'));if(_0x5e7262[_0xd5d5('0x3a')]['service']===_0xd5d5('0x33')&&_0x5e7262['body'][_0xd5d5('0x37')]){_0x5e7262[_0xd5d5('0x3a')][_0xd5d5('0x37')]=encryptor[_0xd5d5('0x40')](_0x5e7262[_0xd5d5('0x3a')][_0xd5d5('0x37')]);}return db[_0xd5d5('0x41')][_0xd5d5('0x38')](_0x5e7262[_0xd5d5('0x3a')],{})[_0xd5d5('0x12')](respondWithResult(_0x28a1b1,0xc9))['catch'](handleError(_0x28a1b1,null));};exports[_0xd5d5('0x42')]=function(_0x3a234a,_0x50f31b){if(_0x3a234a[_0xd5d5('0x3a')]['id']){delete _0x3a234a[_0xd5d5('0x3a')]['id'];}return db['CloudProvider'][_0xd5d5('0x36')]({'where':{'id':_0x3a234a['params']['id']}})[_0xd5d5('0x12')](handleEntityNotFound(_0x50f31b,null))[_0xd5d5('0x12')](function(_0x35f1c3){if(_0x35f1c3[_0xd5d5('0x32')]===_0xd5d5('0x33')&&_0x3a234a[_0xd5d5('0x3a')][_0xd5d5('0x37')]){_0x3a234a[_0xd5d5('0x3a')][_0xd5d5('0x37')]=encryptor[_0xd5d5('0x40')](_0x3a234a['body']['data3']);}return _0x35f1c3;})[_0xd5d5('0x12')](saveUpdates(_0x3a234a['body'],null))[_0xd5d5('0x12')](respondWithResult(_0x50f31b,null))['catch'](handleError(_0x50f31b,null));};exports[_0xd5d5('0x13')]=function(_0x2c5fcd,_0x30f6e3){return db['CloudProvider'][_0xd5d5('0x36')]({'where':{'id':_0x2c5fcd['params']['id']}})[_0xd5d5('0x12')](handleEntityNotFound(_0x30f6e3,null))['then'](removeEntity(_0x30f6e3,null))['catch'](handleError(_0x30f6e3,null));};exports['oauth2MicrosoftAuthorize']=function(_0xc1cea4,_0x2f6a7f){return db[_0xd5d5('0x41')][_0xd5d5('0x43')]({'where':{'id':_0xc1cea4[_0xd5d5('0x44')]['id']},'raw':!![]})[_0xd5d5('0x12')](function(_0x51f680){if(!_0x51f680)return _0x2f6a7f[_0xd5d5('0x45')](0x194);return{'url':oauth[_0xd5d5('0x46')](_0x51f680,_0xc1cea4['user']['id'])};})[_0xd5d5('0x12')](respondWithResult(_0x2f6a7f,null))[_0xd5d5('0x47')](handleError(_0x2f6a7f,null));};exports[_0xd5d5('0x48')]=function(_0x2378dc,_0x4ad572){var _0x6da589=_0x2378dc[_0xd5d5('0x3a')];var _0x3be423;var _0x357e77;if(_0x6da589['error'])throw _0x6da589;redis[_0xd5d5('0x49')](_0x6da589['state'])[_0xd5d5('0x12')](function(_0xf500d9){if(!_0xf500d9)throw new Error(_0xd5d5('0x4a'));_0x3be423=JSON[_0xd5d5('0x4b')](_0xf500d9);var _0x2671f6=Buffer[_0xd5d5('0x4c')](_0x6da589[_0xd5d5('0x4d')],_0xd5d5('0x4e'))['toString'](_0xd5d5('0x4f'));_0x357e77=JSON[_0xd5d5('0x4b')](_0x2671f6);if(!oauth[_0xd5d5('0x50')](_0x6da589[_0xd5d5('0x51')],_0x3be423[_0xd5d5('0x52')]))throw new Error(_0xd5d5('0x53'));redis[_0xd5d5('0x54')](_0x6da589[_0xd5d5('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x6da589[_0xd5d5('0x55')],_0x3be423);})['then'](function(_0x1a7f6f){_0x3be423[_0xd5d5('0x56')]=_0x1a7f6f[_0xd5d5('0x57')];_0x3be423[_0xd5d5('0x58')]=_0x1a7f6f[_0xd5d5('0x59')];return db[_0xd5d5('0x41')][_0xd5d5('0x42')]({'data5':_0x3be423[_0xd5d5('0x56')],'data6':_0x3be423[_0xd5d5('0x58')]},{'where':{'id':_0x3be423['id']}});})[_0xd5d5('0x12')](function(){oauth[_0xd5d5('0x5a')](_0x3be423);socket[_0xd5d5('0x5b')](_0xd5d5('0x5c'),{'id':_0x357e77['id']});return;})['then'](respondWithStatusCode(_0x4ad572,null))[_0xd5d5('0x47')](function(_0x318e61){if(_0x357e77){socket[_0xd5d5('0x5b')]('microsoftAuthorization:error',{'id':_0x357e77['id']});}if(!_0x3be423){logger[_0xd5d5('0x5d')](_0xd5d5('0x5e'),_0x318e61);return _0x4ad572[_0xd5d5('0xb')](0x1f4)[_0xd5d5('0x17')](_0x318e61['message']);}logger[_0xd5d5('0x5d')](_0xd5d5('0x5f'),_0x3be423['id'],JSON['stringify'](_0x318e61));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 08dcd99..3e96324 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 _0x2cd1=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x196064,_0x4a8ed4){var _0x266e4b=function(_0x24cb92){while(--_0x24cb92){_0x196064['push'](_0x196064['shift']());}};_0x266e4b(++_0x4a8ed4);}(_0x2cd1,0xf7));var _0x12cd=function(_0x294fad,_0x20c315){_0x294fad=_0x294fad-0x0;var _0x11ef20=_0x2cd1[_0x294fad];return _0x11ef20;};'use strict';var _=require(_0x12cd('0x0'));var util=require(_0x12cd('0x1'));var logger=require(_0x12cd('0x2'))(_0x12cd('0x3'));var moment=require('moment');var BPromise=require(_0x12cd('0x4'));var rp=require(_0x12cd('0x5'));var fs=require('fs');var path=require(_0x12cd('0x6'));var rimraf=require(_0x12cd('0x7'));var config=require('../../config/environment');var attributes=require(_0x12cd('0x8'));module[_0x12cd('0x9')]=function(_0x40a60c,_0x2b67cb){return _0x40a60c[_0x12cd('0xa')](_0x12cd('0xb'),attributes,{'tableName':_0x12cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4424=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dbba2,_0x58ec32){var _0x4acd23=function(_0x93e09f){while(--_0x93e09f){_0x3dbba2['push'](_0x3dbba2['shift']());}};_0x4acd23(++_0x58ec32);}(_0x4424,0x157));var _0x4442=function(_0x54a1b9,_0x1433e4){_0x54a1b9=_0x54a1b9-0x0;var _0x10fa2f=_0x4424[_0x54a1b9];return _0x10fa2f;};'use strict';var _=require(_0x4442('0x0'));var util=require(_0x4442('0x1'));var logger=require('../../config/logger')(_0x4442('0x2'));var moment=require(_0x4442('0x3'));var BPromise=require(_0x4442('0x4'));var rp=require(_0x4442('0x5'));var fs=require('fs');var path=require(_0x4442('0x6'));var rimraf=require(_0x4442('0x7'));var config=require(_0x4442('0x8'));var attributes=require(_0x4442('0x9'));module[_0x4442('0xa')]=function(_0x3971c4,_0x353935){return _0x3971c4['define'](_0x4442('0xb'),attributes,{'tableName':_0x4442('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index c483e40..140f931 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 _0xe65d=['response_mode','form_post','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','audience','unix','exp','resolve','then','data3','findOne','decryptString','POST','data5','access_token','data6','refresh_token','CloudProvider','error','authorization_code','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xe65d,0x71));var _0xde65=function(_0x51f4d7,_0x2b6f20){_0x51f4d7=_0x51f4d7-0x0;var _0x3ee8d3=_0xe65d[_0x51f4d7];return _0x3ee8d3;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xde65('0x0'));var moment=require('moment');var Redis=require(_0xde65('0x1'));var rp=require(_0xde65('0x2'));var util=require(_0xde65('0x3'));var encryptor=require(_0xde65('0x4'));var config=require(_0xde65('0x5'));var logger=require(_0xde65('0x6'))(_0xde65('0x7'));var schedule=require(_0xde65('0x8'));var db=require(_0xde65('0x9'))['db'];config[_0xde65('0xa')]=_['defaults'](config[_0xde65('0xa')],{'host':_0xde65('0xb'),'port':0x18eb});var redis=new Redis(config[_0xde65('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xde65('0xc'),_0xde65('0xd'),'email',_0xde65('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xde65('0xf'),_0xde65('0x10')],'Dynamics365':[_0xde65('0xc'),_0xde65('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xde65('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xde65('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d0aac){var _0xa00332=_[_0xde65('0x13')](AZURE_AUTH_SCOPES[_0x2d0aac['type']]);if(_0x2d0aac[_0xde65('0x14')]===_0xde65('0x15'))_0xa00332['push'](_0x2d0aac[_0xde65('0x16')]+'/.default');return _0xa00332[_0xde65('0x17')]('\x20');}function getAccessTokenScope(_0x292bbe){if(_0x292bbe[_0xde65('0x14')]===_0xde65('0x18'))return _0xde65('0x19');if(_0x292bbe[_0xde65('0x14')]==='Dynamics365')return _0x292bbe[_0xde65('0x16')]+_0xde65('0x1a');}function generateMicrosoftAuthorizationUrl(_0x171cf7,_0x33a790){var _0x34f0aa=MICROSOFT_AUTH_URL[_0xde65('0x1b')](_0xde65('0x1c'),_0x171cf7['data2']);var _0x2af4cc=[_0xde65('0x1d'),_0xde65('0x1e')];var _0xbcc102=Buffer[_0xde65('0x1f')](JSON[_0xde65('0x20')]({'id':_0x33a790}))[_0xde65('0x21')](_0xde65('0x22'));var _0x2ae417=crypto[_0xde65('0x23')](0x10)[_0xde65('0x21')](_0xde65('0x24'));var _0x30f274=getAuthorizationScopes(_0x171cf7);var _0x497fd0=[{'key':_0xde65('0x25'),'value':_0x171cf7[_0xde65('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x2af4cc[_0xde65('0x17')]('\x20'))},{'key':_0xde65('0x27'),'value':_0x171cf7[_0xde65('0x28')]},{'key':_0xde65('0x29'),'value':_0xde65('0x2a')},{'key':'scope','value':encodeURIComponent(_0x30f274)},{'key':'state','value':_0xbcc102},{'key':_0xde65('0x2b'),'value':_0x2ae417},{'key':_0xde65('0x2c'),'value':_0xde65('0x2d')}];var _0x4c9f99=_0x34f0aa+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xde65('0x13')](_0x497fd0,function(_0x16e2be){return _0x16e2be[_0xde65('0x2e')]+'='+_0x16e2be[_0xde65('0x2f')];})[_0xde65('0x17')]('&');_0x171cf7[_0xde65('0x30')]={'issuer':_0x34f0aa[_0xde65('0x1b')](_0xde65('0x31'),''),'audience':_0x171cf7[_0xde65('0x26')],'state':_0xbcc102,'nonce':_0x2ae417};redis[_0xde65('0x32')](_0xbcc102,JSON[_0xde65('0x20')](_0x171cf7));return _0x4c9f99;}function isValidIdToken(_0x282de1,_0x1a6219){try{var _0x3791e5=jwt[_0xde65('0x33')](_0x282de1,{'complete':!![]});var _0x385d7b=_0x3791e5[_0xde65('0x34')];if(_0x385d7b[_0xde65('0x35')]!==_0x1a6219[_0xde65('0x36')])return![];if(_0x385d7b['aud']!==_0x1a6219[_0xde65('0x37')])return![];if(_0x385d7b[_0xde65('0x2b')]!==_0x1a6219[_0xde65('0x2b')])return![];if(moment()['isAfter'](moment[_0xde65('0x38')](_0x385d7b[_0xde65('0x39')])))return![];return!![];}catch(_0x50c6cf){throw _0x50c6cf;}}function refreshOauth2MicrosoftAccessToken(_0x1792a5){return Promise[_0xde65('0x3a')]()[_0xde65('0x3b')](function(){if(_0x1792a5[_0xde65('0x3c')])return _0x1792a5;return db['CloudProvider'][_0xde65('0x3d')]({'where':{'id':_0x1792a5['id']},'raw':!![]});})[_0xde65('0x3b')](function(_0xef5b62){var _0x159169={'grant_type':'refresh_token','refresh_token':_0xef5b62['data6'],'scope':getAccessTokenScope(_0xef5b62),'redirect_uri':_0xef5b62['data4'],'client_id':_0xef5b62['data1'],'client_secret':encryptor[_0xde65('0x3e')](_0xef5b62['data3'])};var _0x2bae0e={'method':_0xde65('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xde65('0x1b')]('{TENANT_ID}',_0xef5b62['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x159169,'json':!![]};return rp(_0x2bae0e);})['then'](function(_0x23dbed){_0x1792a5[_0xde65('0x40')]=_0x23dbed[_0xde65('0x41')];_0x1792a5[_0xde65('0x42')]=_0x23dbed[_0xde65('0x43')];return db[_0xde65('0x44')]['update']({'data5':_0x1792a5[_0xde65('0x40')],'data6':_0x1792a5[_0xde65('0x42')]},{'where':{'id':_0x1792a5['id']}});})[_0xde65('0x3b')](function(){return _0x1792a5;})['catch'](function(_0x2ff9a9){logger[_0xde65('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1792a5['id'],_0x2ff9a9);});}function getOauth2MicrosoftAccessToken(_0x142c42,_0x6addba){var _0x177b3d={'grant_type':_0xde65('0x46'),'code':_0x142c42,'scope':getAccessTokenScope(_0x6addba),'redirect_uri':_0x6addba[_0xde65('0x28')],'client_id':_0x6addba[_0xde65('0x26')],'client_secret':encryptor[_0xde65('0x3e')](_0x6addba['data3'])};var _0x454f5b={'method':_0xde65('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xde65('0x1c'),_0x6addba['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x177b3d,'json':!![]};return rp(_0x454f5b);}function startRefreshInterval(_0x5c1582){var _0x55b2c3=schedule['intervals'];if(_0x55b2c3[_0x5c1582['id']])clearInterval(_0x55b2c3[_0x5c1582['id']]);_0x55b2c3[_0x5c1582['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xde65('0x47')](this,{'id':_0x5c1582['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x55b2c3;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xde65('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x85e753){var _0x26c88f=_0x85e753['map'](function(_0x2a5647){return refreshOauth2MicrosoftAccessToken(_0x2a5647)['then'](function(_0x5113be){startRefreshInterval(_0x5113be);});});return Promise[_0xde65('0x49')](_0x26c88f);})[_0xde65('0x4a')](function(_0x16d3f2){var _0x10f137=_0x16d3f2?util['inspect'](_0x16d3f2,{'showHidden':![],'depth':null}):'';logger[_0xde65('0x45')](_0xde65('0x4b'),_0x10f137);});}module[_0xde65('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xfcb0=['issuer','aud','audience','nonce','unix','resolve','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','update','catch','error','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','ioredis','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','type','Dynamics365','push','data7','/.default','join','data2','from','stringify','toString','base64','randomBytes','hex','client_id','data1','data4','response_mode','scope','state','prompt','login','map','key','oauth2Claims','replace','set','decode','payload','iss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcb0,0xfe));var _0x0fcb=function(_0x106058,_0x373fca){_0x106058=_0x106058-0x0;var _0x3f03ba=_0xfcb0[_0x106058];return _0x3f03ba;};'use strict';var _=require(_0x0fcb('0x0'));var crypto=require('crypto');var jwt=require(_0x0fcb('0x1'));var moment=require('moment');var Redis=require(_0x0fcb('0x2'));var rp=require('request-promise');var util=require(_0x0fcb('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x0fcb('0x4'));var logger=require(_0x0fcb('0x5'))(_0x0fcb('0x6'));var schedule=require(_0x0fcb('0x7'));var db=require(_0x0fcb('0x8'))['db'];config[_0x0fcb('0x9')]=_[_0x0fcb('0xa')](config[_0x0fcb('0x9')],{'host':_0x0fcb('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x0fcb('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0fcb('0xd'),_0x0fcb('0xe'),_0x0fcb('0xf'),_0x0fcb('0x10'),_0x0fcb('0x11'),_0x0fcb('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0x0fcb('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x0fcb('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x0fcb('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1d636a){var _0xdc3f8b=_['map'](AZURE_AUTH_SCOPES[_0x1d636a[_0x0fcb('0x15')]]);if(_0x1d636a['type']===_0x0fcb('0x16'))_0xdc3f8b[_0x0fcb('0x17')](_0x1d636a[_0x0fcb('0x18')]+_0x0fcb('0x19'));return _0xdc3f8b[_0x0fcb('0x1a')]('\x20');}function getAccessTokenScope(_0x51a377){if(_0x51a377[_0x0fcb('0x15')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x51a377[_0x0fcb('0x15')]===_0x0fcb('0x16'))return _0x51a377[_0x0fcb('0x18')]+_0x0fcb('0x19');}function generateMicrosoftAuthorizationUrl(_0xa39800,_0x5bbdb1){var _0x564d1b=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0xa39800[_0x0fcb('0x1b')]);var _0x33dcea=['code','id_token'];var _0xe12d08=Buffer[_0x0fcb('0x1c')](JSON[_0x0fcb('0x1d')]({'id':_0x5bbdb1}))[_0x0fcb('0x1e')](_0x0fcb('0x1f'));var _0x421da1=crypto[_0x0fcb('0x20')](0x10)['toString'](_0x0fcb('0x21'));var _0x178b27=getAuthorizationScopes(_0xa39800);var _0x482af0=[{'key':_0x0fcb('0x22'),'value':_0xa39800[_0x0fcb('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x33dcea[_0x0fcb('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0xa39800[_0x0fcb('0x24')]},{'key':_0x0fcb('0x25'),'value':'form_post'},{'key':_0x0fcb('0x26'),'value':encodeURIComponent(_0x178b27)},{'key':_0x0fcb('0x27'),'value':_0xe12d08},{'key':'nonce','value':_0x421da1},{'key':_0x0fcb('0x28'),'value':_0x0fcb('0x29')}];var _0x3dc4ad=_0x564d1b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0fcb('0x2a')](_0x482af0,function(_0x2e34ea){return _0x2e34ea[_0x0fcb('0x2b')]+'='+_0x2e34ea['value'];})[_0x0fcb('0x1a')]('&');_0xa39800[_0x0fcb('0x2c')]={'issuer':_0x564d1b[_0x0fcb('0x2d')]('oauth2/',''),'audience':_0xa39800[_0x0fcb('0x23')],'state':_0xe12d08,'nonce':_0x421da1};redis[_0x0fcb('0x2e')](_0xe12d08,JSON[_0x0fcb('0x1d')](_0xa39800));return _0x3dc4ad;}function isValidIdToken(_0x5f0812,_0x1b0171){try{var _0x7f8b71=jwt[_0x0fcb('0x2f')](_0x5f0812,{'complete':!![]});var _0x3eb1e7=_0x7f8b71[_0x0fcb('0x30')];if(_0x3eb1e7[_0x0fcb('0x31')]!==_0x1b0171[_0x0fcb('0x32')])return![];if(_0x3eb1e7[_0x0fcb('0x33')]!==_0x1b0171[_0x0fcb('0x34')])return![];if(_0x3eb1e7[_0x0fcb('0x35')]!==_0x1b0171[_0x0fcb('0x35')])return![];if(moment()['isAfter'](moment[_0x0fcb('0x36')](_0x3eb1e7['exp'])))return![];return!![];}catch(_0x1e28c1){throw _0x1e28c1;}}function refreshOauth2MicrosoftAccessToken(_0xd3f5b6){return Promise[_0x0fcb('0x37')]()['then'](function(){if(_0xd3f5b6[_0x0fcb('0x38')])return _0xd3f5b6;return db[_0x0fcb('0x39')][_0x0fcb('0x3a')]({'where':{'id':_0xd3f5b6['id']},'raw':!![]});})['then'](function(_0x2fa97a){var _0x5527c5={'grant_type':_0x0fcb('0x3b'),'refresh_token':_0x2fa97a[_0x0fcb('0x3c')],'scope':getAccessTokenScope(_0x2fa97a),'redirect_uri':_0x2fa97a['data4'],'client_id':_0x2fa97a[_0x0fcb('0x23')],'client_secret':encryptor[_0x0fcb('0x3d')](_0x2fa97a[_0x0fcb('0x38')])};var _0x1a3480={'method':_0x0fcb('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x0fcb('0x3f'),_0x2fa97a[_0x0fcb('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5527c5,'json':!![]};return rp(_0x1a3480);})[_0x0fcb('0x40')](function(_0x3847ea){_0xd3f5b6[_0x0fcb('0x41')]=_0x3847ea['access_token'];_0xd3f5b6['data6']=_0x3847ea['refresh_token'];return db[_0x0fcb('0x39')][_0x0fcb('0x42')]({'data5':_0xd3f5b6[_0x0fcb('0x41')],'data6':_0xd3f5b6[_0x0fcb('0x3c')]},{'where':{'id':_0xd3f5b6['id']}});})['then'](function(){return _0xd3f5b6;})[_0x0fcb('0x43')](function(_0x4cf189){logger[_0x0fcb('0x44')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xd3f5b6['id'],_0x4cf189);});}function getOauth2MicrosoftAccessToken(_0x1ab871,_0x2788c1){var _0x27e8b2={'grant_type':_0x0fcb('0x45'),'code':_0x1ab871,'scope':getAccessTokenScope(_0x2788c1),'redirect_uri':_0x2788c1[_0x0fcb('0x24')],'client_id':_0x2788c1[_0x0fcb('0x23')],'client_secret':encryptor[_0x0fcb('0x3d')](_0x2788c1['data3'])};var _0x2fd0cf={'method':_0x0fcb('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x0fcb('0x2d')]('{TENANT_ID}',_0x2788c1[_0x0fcb('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x27e8b2,'json':!![]};return rp(_0x2fd0cf);}function startRefreshInterval(_0x848a1f){var _0x5e8223=schedule[_0x0fcb('0x46')];if(_0x5e8223[_0x848a1f['id']])clearInterval(_0x5e8223[_0x848a1f['id']]);_0x5e8223[_0x848a1f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0fcb('0x47')](this,{'id':_0x848a1f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x0fcb('0x46')]=_0x5e8223;}function startAllRefreshIntervals(){return db[_0x0fcb('0x39')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0fcb('0x40')](function(_0x4b73fd){var _0x4a5783=_0x4b73fd[_0x0fcb('0x2a')](function(_0x3c87f0){return refreshOauth2MicrosoftAccessToken(_0x3c87f0)[_0x0fcb('0x40')](function(_0x5f3376){startRefreshInterval(_0x5f3376);});});return Promise[_0x0fcb('0x48')](_0x4a5783);})['catch'](function(_0x3b6cff){var _0x5d93cc=_0x3b6cff?util[_0x0fcb('0x49')](_0x3b6cff,{'showHidden':![],'depth':null}):'';logger['error'](_0x0fcb('0x4a'),_0x5d93cc);});}module[_0x0fcb('0x4b')]={'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 fed10ce..75bedde 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 _0x3fc6=['http','request','then','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x3fc6,0x115));var _0x63fc=function(_0x7cdca9,_0x2242ab){_0x7cdca9=_0x7cdca9-0x0;var _0x397b29=_0x3fc6[_0x7cdca9];return _0x397b29;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var moment=require(_0x63fc('0x1'));var BPromise=require(_0x63fc('0x2'));var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x63fc('0x5'));var logger=require(_0x63fc('0x6'))(_0x63fc('0x7'));var config=require('../../config/environment');var jayson=require(_0x63fc('0x8'));var client=jayson['client'][_0x63fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7f72,_0x3e8157,_0x571ab6){return new BPromise(function(_0x3ec832,_0xffe000){return client[_0x63fc('0xa')](_0x1c7f72,_0x571ab6)[_0x63fc('0xb')](function(_0x32749b){logger['info'](_0x63fc('0xc'),_0x3e8157,'request\x20sent');logger['debug'](_0x63fc('0xd'),_0x3e8157,_0x63fc('0xe'),JSON[_0x63fc('0xf')](_0x32749b));if(_0x32749b[_0x63fc('0x10')]){if(_0x32749b[_0x63fc('0x10')][_0x63fc('0x11')]===0x1f4){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x32749b['error'][_0x63fc('0x12')]);return _0xffe000(_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);}logger['error'](_0x63fc('0xc'),_0x3e8157,_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);return _0x3ec832(_0x32749b['error'][_0x63fc('0x12')]);}else{logger[_0x63fc('0x13')](_0x63fc('0xc'),_0x3e8157,_0x63fc('0xe'));_0x3ec832(_0x32749b[_0x63fc('0x14')][_0x63fc('0x12')]);}})[_0x63fc('0x15')](function(_0x19a3f2){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x19a3f2);_0xffe000(_0x19a3f2);});});} \ No newline at end of file +var _0xd906=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','moment'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xd906,0x6b));var _0x6d90=function(_0x13bd98,_0x39bddb){_0x13bd98=_0x13bd98-0x0;var _0x224816=_0xd906[_0x13bd98];return _0x224816;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6d90('0x0'));var BPromise=require(_0x6d90('0x1'));var rs=require(_0x6d90('0x2'));var fs=require('fs');var Redis=require(_0x6d90('0x3'));var db=require(_0x6d90('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d90('0x5'))(_0x6d90('0x6'));var config=require(_0x6d90('0x7'));var jayson=require(_0x6d90('0x8'));var client=jayson['client'][_0x6d90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19eb61,_0xd120f6,_0x160c7d){return new BPromise(function(_0x219737,_0x5d0ed4){return client['request'](_0x19eb61,_0x160c7d)['then'](function(_0x41c0a3){logger[_0x6d90('0xa')](_0x6d90('0xb'),_0xd120f6,_0x6d90('0xc'));logger[_0x6d90('0xd')](_0x6d90('0xe'),_0xd120f6,_0x6d90('0xc'),JSON['stringify'](_0x41c0a3));if(_0x41c0a3[_0x6d90('0xf')]){if(_0x41c0a3['error'][_0x6d90('0x10')]===0x1f4){logger['error'](_0x6d90('0xb'),_0xd120f6,_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);return _0x5d0ed4(_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);}logger[_0x6d90('0xf')](_0x6d90('0xb'),_0xd120f6,_0x41c0a3[_0x6d90('0xf')]['message']);return _0x219737(_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);}else{logger[_0x6d90('0xa')](_0x6d90('0xb'),_0xd120f6,_0x6d90('0xc'));_0x219737(_0x41c0a3['result'][_0x6d90('0x11')]);}})['catch'](function(_0x379439){logger['error'](_0x6d90('0xb'),_0xd120f6,_0x379439);_0x5d0ed4(_0x379439);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5ef21f7..33340b6 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x2c82cf,_0x360cf9){var _0x1fa548=function(_0x4d23d2){while(--_0x4d23d2){_0x2c82cf['push'](_0x2c82cf['shift']());}};_0x1fa548(++_0x360cf9);}(_0x2ef3,0xba));var _0x32ef=function(_0x947e0d,_0x3f7551){_0x947e0d=_0x947e0d-0x0;var _0x3db181=_0x2ef3[_0x947e0d];return _0x3db181;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x58ba5d,_0x447c80){var _0x193fab=function(_0x3c357d){while(--_0x3c357d){_0x58ba5d['push'](_0x58ba5d['shift']());}};_0x193fab(++_0x447c80);}(_0xdb28,0x106));var _0x8db2=function(_0x5880ef,_0x40816c){_0x5880ef=_0x5880ef-0x0;var _0x13f7cb=_0xdb28[_0x5880ef];return _0x13f7cb;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 17ecf77..c024935 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 _0xb0c9=['sequelize','exports','STRING','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x21bbfc,_0x511146){_0x21bbfc=_0x21bbfc-0x0;var _0x1fce1c=_0xb0c9[_0x21bbfc];return _0x1fce1c;};'use strict';var Sequelize=require(_0x9b0c('0x0'));module[_0x9b0c('0x1')]={'name':{'type':Sequelize[_0x9b0c('0x2')],'unique':_0x9b0c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9b0c('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x9b0c('0x2')]},'phone':{'type':Sequelize[_0x9b0c('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9b0c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9b0c('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9b0c('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9b0c('0x2')]},'sStreet':{'type':Sequelize[_0x9b0c('0x2')]},'sPostalCode':{'type':Sequelize[_0x9b0c('0x2')]},'sCity':{'type':Sequelize[_0x9b0c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9b0c('0x2')]}}; \ No newline at end of file +var _0xab28=['name','sequelize','exports','STRING'];(function(_0x1c5fed,_0x5b2115){var _0x25c8e3=function(_0x3e6a29){while(--_0x3e6a29){_0x1c5fed['push'](_0x1c5fed['shift']());}};_0x25c8e3(++_0x5b2115);}(_0xab28,0x15d));var _0x8ab2=function(_0x453378,_0x2f360c){_0x453378=_0x453378-0x0;var _0xab3d9e=_0xab28[_0x453378];return _0xab3d9e;};'use strict';var Sequelize=require(_0x8ab2('0x0'));module[_0x8ab2('0x1')]={'name':{'type':Sequelize[_0x8ab2('0x2')],'unique':_0x8ab2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x8ab2('0x2')]},'website':{'type':Sequelize[_0x8ab2('0x2')]},'phone':{'type':Sequelize[_0x8ab2('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8ab2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8ab2('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8ab2('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x8ab2('0x2')]},'sPostalCode':{'type':Sequelize[_0x8ab2('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8ab2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2283c80..acd11eb 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 _0x342c=['map','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','CmCompany','includeAll','catch','show','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','filter'];(function(_0x431b0b,_0x4c92e6){var _0x33f529=function(_0x52d4b4){while(--_0x52d4b4){_0x431b0b['push'](_0x431b0b['shift']());}};_0x33f529(++_0x4c92e6);}(_0x342c,0x100));var _0xc342=function(_0x3a9178,_0x10b741){_0x3a9178=_0x3a9178-0x0;var _0xf4dc86=_0x342c[_0x3a9178];return _0xf4dc86;};'use strict';var emlformat=require(_0xc342('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc342('0x1'));var rp=require(_0xc342('0x2'));var moment=require('moment');var BPromise=require(_0xc342('0x3'));var Mustache=require('mustache');var util=require(_0xc342('0x4'));var path=require(_0xc342('0x5'));var sox=require(_0xc342('0x6'));var csv=require(_0xc342('0x7'));var ejs=require(_0xc342('0x8'));var fs=require('fs');var fs_extra=require(_0xc342('0x9'));var _=require('lodash');var squel=require(_0xc342('0xa'));var crypto=require('crypto');var jsforce=require(_0xc342('0xb'));var deskjs=require(_0xc342('0xc'));var toCsv=require(_0xc342('0x7'));var querystring=require(_0xc342('0xd'));var Papa=require(_0xc342('0xe'));var Redis=require(_0xc342('0xf'));var authService=require(_0xc342('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc342('0x11'));var hardwareService=require(_0xc342('0x12'));var logger=require(_0xc342('0x13'))('api');var utils=require(_0xc342('0x14'));var config=require(_0xc342('0x15'));var licenseUtil=require(_0xc342('0x16'));var db=require(_0xc342('0x17'))['db'];function respondWithStatusCode(_0x2eeb1b,_0x4a587b){_0x4a587b=_0x4a587b||0xcc;return function(_0x54149d){if(_0x54149d){return _0x2eeb1b['sendStatus'](_0x4a587b);}return _0x2eeb1b[_0xc342('0x18')](_0x4a587b)[_0xc342('0x19')]();};}function respondWithResult(_0x42c37a,_0x481097){_0x481097=_0x481097||0xc8;return function(_0x41e8fb){if(_0x41e8fb){return _0x42c37a[_0xc342('0x18')](_0x481097)[_0xc342('0x1a')](_0x41e8fb);}};}function respondWithFilteredResult(_0x591786,_0x917ecd){return function(_0x2f897e){if(_0x2f897e){var _0x304165=typeof _0x917ecd[_0xc342('0x1b')]===_0xc342('0x1c')&&typeof _0x917ecd['limit']===_0xc342('0x1c');var _0x50274f=_0x2f897e[_0xc342('0x1d')];var _0x23e212=_0x304165?0x0:_0x917ecd[_0xc342('0x1b')];var _0x4ee872=_0x304165?_0x2f897e[_0xc342('0x1d')]:_0x917ecd[_0xc342('0x1b')]+_0x917ecd['limit'];var _0x49eb1c;if(_0x4ee872>=_0x50274f){_0x4ee872=_0x50274f;_0x49eb1c=0xc8;}else{_0x49eb1c=0xce;}_0x591786['status'](_0x49eb1c);return _0x591786[_0xc342('0x1e')](_0xc342('0x1f'),_0x23e212+'-'+_0x4ee872+'/'+_0x50274f)[_0xc342('0x1a')](_0x2f897e);}return null;};}function patchUpdates(_0x563830){return function(_0x8c020e){try{jsonpatch['apply'](_0x8c020e,_0x563830,!![]);}catch(_0xecfe17){return BPromise[_0xc342('0x20')](_0xecfe17);}return _0x8c020e[_0xc342('0x21')]();};}function saveUpdates(_0x583b4c,_0x42dfef){return function(_0x419f53){if(_0x419f53){return _0x419f53[_0xc342('0x22')](_0x583b4c)[_0xc342('0x23')](function(_0x76518d){return _0x76518d;});}return null;};}function removeEntity(_0x139dd2,_0x2bc273){return function(_0x2e0202){if(_0x2e0202){return _0x2e0202[_0xc342('0x24')]()['then'](function(){var _0x4faac1=_0x2e0202[_0xc342('0x25')]({'plain':!![]});var _0x591ec7=_0xc342('0x26');return db[_0xc342('0x27')]['destroy']({'where':{'type':_0x591ec7,'resourceId':_0x4faac1['id']}})[_0xc342('0x23')](function(){return _0x2e0202;});})[_0xc342('0x23')](function(){_0x139dd2['status'](0xcc)[_0xc342('0x19')]();});}};}function handleEntityNotFound(_0x24e72f,_0x5c4622){return function(_0x157bd8){if(!_0x157bd8){_0x24e72f[_0xc342('0x28')](0x194);}return _0x157bd8;};}function handleError(_0x50d988,_0x4a6146){_0x4a6146=_0x4a6146||0x1f4;return function(_0x20e491){logger['error'](_0x20e491[_0xc342('0x29')]);if(_0x20e491[_0xc342('0x2a')]){delete _0x20e491[_0xc342('0x2a')];}_0x50d988[_0xc342('0x18')](_0x4a6146)[_0xc342('0x2b')](_0x20e491);};}exports['index']=function(_0x20598e,_0x30e28e){var _0x17c626={},_0x31eca8={},_0x5a8a74={'count':0x0,'rows':[]};return db['CmCompany'][_0xc342('0x2c')]()[_0xc342('0x23')](function(_0x4aa970){_0x31eca8[_0xc342('0x2d')]=_[_0xc342('0x2e')](_0x4aa970);_0x31eca8[_0xc342('0x2f')]=_['keys'](_0x20598e['query']);_0x31eca8[_0xc342('0x30')]=_[_0xc342('0x31')](_0x31eca8[_0xc342('0x2d')],_0x31eca8[_0xc342('0x2f')]);_0x17c626[_0xc342('0x32')]=_[_0xc342('0x31')](_0x31eca8[_0xc342('0x2d')],qs[_0xc342('0x33')](_0x20598e[_0xc342('0x2f')][_0xc342('0x33')]));_0x17c626[_0xc342('0x32')]=_0x17c626['attributes'][_0xc342('0x34')]?_0x17c626[_0xc342('0x32')]:_0x31eca8[_0xc342('0x2d')];if(!_0x20598e['query'][_0xc342('0x35')](_0xc342('0x36'))){_0x17c626[_0xc342('0x37')]=qs[_0xc342('0x37')](_0x20598e[_0xc342('0x2f')][_0xc342('0x37')]);_0x17c626[_0xc342('0x1b')]=qs[_0xc342('0x1b')](_0x20598e['query'][_0xc342('0x1b')]);}_0x17c626[_0xc342('0x38')]=qs[_0xc342('0x39')](_0x20598e['query'][_0xc342('0x39')]);_0x17c626[_0xc342('0x3a')]=qs[_0xc342('0x30')](_[_0xc342('0x3b')](_0x20598e['query'],_0x31eca8[_0xc342('0x30')]),_0x4aa970);if(_0x20598e[_0xc342('0x2f')]['filter']){_0x17c626[_0xc342('0x3a')]=_[_0xc342('0x3c')](_0x17c626[_0xc342('0x3a')],{'$or':_['map'](_0x17c626[_0xc342('0x32')],function(_0x56261d){var _0xbccaa7={};_0xbccaa7[_0x56261d]={'$like':'%'+_0x20598e['query']['filter']+'%'};return _0xbccaa7;})});}_0x17c626=_['merge']({},_0x17c626,_0x20598e['options']);var _0x592088={'where':_0x17c626[_0xc342('0x3a')]};return db[_0xc342('0x3d')][_0xc342('0x1d')](_0x592088)['then'](function(_0xe262fa){_0x5a8a74['count']=_0xe262fa;if(_0x20598e['query'][_0xc342('0x3e')]){_0x17c626['include']=[{'all':!![]}];}return db[_0xc342('0x3d')]['findAll'](_0x17c626);})[_0xc342('0x23')](function(_0x549027){_0x5a8a74['rows']=_0x549027;return _0x5a8a74;})[_0xc342('0x23')](respondWithFilteredResult(_0x30e28e,_0x17c626))[_0xc342('0x3f')](handleError(_0x30e28e,null));})[_0xc342('0x3f')](handleError(_0x30e28e,null));};exports[_0xc342('0x40')]=function(_0x551ed1,_0xb286f5){var _0x3b8262={'raw':![],'where':{'id':_0x551ed1[_0xc342('0x41')]['id']}},_0x43fd26={};_0x43fd26[_0xc342('0x2d')]=_['keys'](db[_0xc342('0x3d')][_0xc342('0x42')]);_0x43fd26[_0xc342('0x2f')]=_[_0xc342('0x2e')](_0x551ed1[_0xc342('0x2f')]);_0x43fd26[_0xc342('0x30')]=_[_0xc342('0x31')](_0x43fd26[_0xc342('0x2d')],_0x43fd26[_0xc342('0x2f')]);_0x3b8262['attributes']=_[_0xc342('0x31')](_0x43fd26[_0xc342('0x2d')],qs['fields'](_0x551ed1['query'][_0xc342('0x33')]));_0x3b8262[_0xc342('0x32')]=_0x3b8262[_0xc342('0x32')][_0xc342('0x34')]?_0x3b8262['attributes']:_0x43fd26[_0xc342('0x2d')];if(_0x551ed1['query']['includeAll']){_0x3b8262[_0xc342('0x43')]=[{'all':!![]}];}_0x3b8262=_[_0xc342('0x3c')]({},_0x3b8262,_0x551ed1[_0xc342('0x44')]);return db[_0xc342('0x3d')][_0xc342('0x45')](_0x3b8262)['then'](handleEntityNotFound(_0xb286f5,null))[_0xc342('0x23')](respondWithResult(_0xb286f5,null))['catch'](handleError(_0xb286f5,null));};exports[_0xc342('0x46')]=function(_0x2a9147,_0x3b85f1){return db[_0xc342('0x3d')][_0xc342('0x46')](_0x2a9147[_0xc342('0x47')],{})[_0xc342('0x23')](function(_0x1b20c2){var _0x2cb9f3=_0x2a9147[_0xc342('0x48')][_0xc342('0x25')]({'plain':!![]});if(!_0x2cb9f3)throw new Error(_0xc342('0x49'));if(_0x2cb9f3[_0xc342('0x4a')]===_0xc342('0x48')){var _0x4d8608=_0x1b20c2[_0xc342('0x25')]({'plain':!![]});var _0xe75dec=_0xc342('0x26');return db['UserProfileSection'][_0xc342('0x45')]({'where':{'name':_0xe75dec,'userProfileId':_0x2cb9f3['userProfileId']},'raw':!![]})[_0xc342('0x23')](function(_0x108170){if(_0x108170&&_0x108170['autoAssociation']===0x0){return db[_0xc342('0x27')][_0xc342('0x46')]({'name':_0x4d8608[_0xc342('0x2a')],'resourceId':_0x4d8608['id'],'type':_0x108170[_0xc342('0x2a')],'sectionId':_0x108170['id']},{})[_0xc342('0x23')](function(){return _0x1b20c2;});}else{return _0x1b20c2;}})[_0xc342('0x3f')](function(_0x59012e){logger[_0xc342('0x4b')](_0xc342('0x4c'),_0x59012e);throw _0x59012e;});}return _0x1b20c2;})[_0xc342('0x23')](respondWithResult(_0x3b85f1,0xc9))[_0xc342('0x3f')](handleError(_0x3b85f1,null));};exports[_0xc342('0x22')]=function(_0x1395f7,_0x3fba32){if(_0x1395f7[_0xc342('0x47')]['id']){delete _0x1395f7[_0xc342('0x47')]['id'];}return db['CmCompany'][_0xc342('0x45')]({'where':{'id':_0x1395f7[_0xc342('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fba32,null))[_0xc342('0x23')](saveUpdates(_0x1395f7[_0xc342('0x47')],null))['then'](respondWithResult(_0x3fba32,null))['catch'](handleError(_0x3fba32,null));};exports[_0xc342('0x24')]=function(_0x2dfde0,_0x24bf10){return db[_0xc342('0x3d')][_0xc342('0x45')]({'where':{'id':_0x2dfde0[_0xc342('0x41')]['id']}})[_0xc342('0x23')](handleEntityNotFound(_0x24bf10,null))[_0xc342('0x23')](removeEntity(_0x24bf10,null))[_0xc342('0x3f')](handleError(_0x24bf10,null));};exports['describe']=function(_0x5f1bb1,_0xd92631){return db['CmCompany'][_0xc342('0x2c')]()[_0xc342('0x23')](respondWithResult(_0xd92631,null))[_0xc342('0x3f')](handleError(_0xd92631,null));};exports[_0xc342('0x4d')]=function(_0x5460e3,_0x50eaf8,_0x191ca9){return db[_0xc342('0x4e')][_0xc342('0x45')]({'where':{'id':_0x5460e3[_0xc342('0x41')]['id']}})[_0xc342('0x23')](handleEntityNotFound(_0x50eaf8,null))[_0xc342('0x23')](function(_0x411dce){if(_0x411dce){return _0x411dce[_0xc342('0x4d')](_0x5460e3[_0xc342('0x47')]['ids'],_[_0xc342('0x4f')](_0x5460e3[_0xc342('0x47')],[_0xc342('0x50'),'id'])||{});}})[_0xc342('0x23')](respondWithResult(_0x50eaf8,null))[_0xc342('0x3f')](handleError(_0x50eaf8,null));};exports[_0xc342('0x51')]=function(_0x4c0577,_0x25e481,_0x1a1dc3){var _0x3d5eb6={};var _0x16cfbc={};var _0x4a5ad3;var _0x470cfe;return db[_0xc342('0x3d')][_0xc342('0x52')]({'where':{'id':_0x4c0577[_0xc342('0x41')]['id']}})[_0xc342('0x23')](handleEntityNotFound(_0x25e481,null))[_0xc342('0x23')](function(_0x5c1ba9){if(_0x5c1ba9){_0x4a5ad3=_0x5c1ba9;_0x16cfbc['model']=_['keys'](db[_0xc342('0x4e')][_0xc342('0x42')]);_0x16cfbc[_0xc342('0x2f')]=_[_0xc342('0x2e')](_0x4c0577['query']);_0x16cfbc[_0xc342('0x30')]=_[_0xc342('0x31')](_0x16cfbc[_0xc342('0x2d')],_0x16cfbc[_0xc342('0x2f')]);_0x3d5eb6[_0xc342('0x32')]=_[_0xc342('0x31')](_0x16cfbc[_0xc342('0x2d')],qs['fields'](_0x4c0577['query'][_0xc342('0x33')]));_0x3d5eb6[_0xc342('0x32')]=_0x3d5eb6['attributes'][_0xc342('0x34')]?_0x3d5eb6['attributes']:_0x16cfbc['model'];_0x3d5eb6['order']=qs['sort'](_0x4c0577['query'][_0xc342('0x39')]);_0x3d5eb6[_0xc342('0x3a')]=qs[_0xc342('0x30')](_[_0xc342('0x3b')](_0x4c0577[_0xc342('0x2f')],_0x16cfbc['filters']));if(_0x4c0577[_0xc342('0x2f')][_0xc342('0x53')]){_0x3d5eb6['where']=_['merge'](_0x3d5eb6[_0xc342('0x3a')],{'$or':_[_0xc342('0x54')](_0x3d5eb6[_0xc342('0x32')],function(_0x5f056f){var _0x22964b={};_0x22964b[_0x5f056f]={'$like':'%'+_0x4c0577[_0xc342('0x2f')][_0xc342('0x53')]+'%'};return _0x22964b;})});}_0x3d5eb6=_[_0xc342('0x3c')]({},_0x3d5eb6,_0x4c0577[_0xc342('0x44')]);return _0x4a5ad3[_0xc342('0x51')](_0x3d5eb6);}})[_0xc342('0x23')](function(_0x55a7e3){if(_0x55a7e3){_0x470cfe=_0x55a7e3['length'];if(!_0x4c0577['query'][_0xc342('0x35')](_0xc342('0x36'))){_0x3d5eb6['limit']=qs[_0xc342('0x37')](_0x4c0577['query'][_0xc342('0x37')]);_0x3d5eb6[_0xc342('0x1b')]=qs[_0xc342('0x1b')](_0x4c0577['query']['offset']);}return _0x4a5ad3[_0xc342('0x51')](_0x3d5eb6);}})[_0xc342('0x23')](function(_0x5bda0f){if(_0x5bda0f){return _0x5bda0f?{'count':_0x470cfe,'rows':_0x5bda0f}:null;}})['then'](respondWithResult(_0x25e481,null))['catch'](handleError(_0x25e481,null));}; \ No newline at end of file +var _0x5ebf=['update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','CmCompany','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','order','map','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5ebf,0x13a));var _0xf5eb=function(_0x459503,_0x2140c6){_0x459503=_0x459503-0x0;var _0x343233=_0x5ebf[_0x459503];return _0x343233;};'use strict';var emlformat=require(_0xf5eb('0x0'));var rimraf=require(_0xf5eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5eb('0x2'));var rp=require(_0xf5eb('0x3'));var moment=require(_0xf5eb('0x4'));var BPromise=require(_0xf5eb('0x5'));var Mustache=require(_0xf5eb('0x6'));var util=require(_0xf5eb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf5eb('0x8'));var ejs=require(_0xf5eb('0x9'));var fs=require('fs');var fs_extra=require(_0xf5eb('0xa'));var _=require(_0xf5eb('0xb'));var squel=require(_0xf5eb('0xc'));var crypto=require(_0xf5eb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf5eb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf5eb('0xf'));var Papa=require('papaparse');var Redis=require(_0xf5eb('0x10'));var authService=require(_0xf5eb('0x11'));var qs=require(_0xf5eb('0x12'));var as=require(_0xf5eb('0x13'));var hardwareService=require(_0xf5eb('0x14'));var logger=require(_0xf5eb('0x15'))(_0xf5eb('0x16'));var utils=require(_0xf5eb('0x17'));var config=require(_0xf5eb('0x18'));var licenseUtil=require(_0xf5eb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6078e5,_0x2ae3b8){_0x2ae3b8=_0x2ae3b8||0xcc;return function(_0x19248e){if(_0x19248e){return _0x6078e5[_0xf5eb('0x1a')](_0x2ae3b8);}return _0x6078e5[_0xf5eb('0x1b')](_0x2ae3b8)[_0xf5eb('0x1c')]();};}function respondWithResult(_0x3bd6d0,_0x1b732e){_0x1b732e=_0x1b732e||0xc8;return function(_0x1d9249){if(_0x1d9249){return _0x3bd6d0[_0xf5eb('0x1b')](_0x1b732e)[_0xf5eb('0x1d')](_0x1d9249);}};}function respondWithFilteredResult(_0x52d8b3,_0x1cc986){return function(_0x353093){if(_0x353093){var _0x48fa45=typeof _0x1cc986[_0xf5eb('0x1e')]===_0xf5eb('0x1f')&&typeof _0x1cc986['limit']===_0xf5eb('0x1f');var _0x19e6ea=_0x353093['count'];var _0x28c00b=_0x48fa45?0x0:_0x1cc986[_0xf5eb('0x1e')];var _0x108120=_0x48fa45?_0x353093[_0xf5eb('0x20')]:_0x1cc986['offset']+_0x1cc986[_0xf5eb('0x21')];var _0x5def04;if(_0x108120>=_0x19e6ea){_0x108120=_0x19e6ea;_0x5def04=0xc8;}else{_0x5def04=0xce;}_0x52d8b3[_0xf5eb('0x1b')](_0x5def04);return _0x52d8b3[_0xf5eb('0x22')](_0xf5eb('0x23'),_0x28c00b+'-'+_0x108120+'/'+_0x19e6ea)[_0xf5eb('0x1d')](_0x353093);}return null;};}function patchUpdates(_0xa348a1){return function(_0x460731){try{jsonpatch[_0xf5eb('0x24')](_0x460731,_0xa348a1,!![]);}catch(_0x468048){return BPromise[_0xf5eb('0x25')](_0x468048);}return _0x460731['save']();};}function saveUpdates(_0x95d09e,_0x205670){return function(_0x1e9220){if(_0x1e9220){return _0x1e9220[_0xf5eb('0x26')](_0x95d09e)[_0xf5eb('0x27')](function(_0x4b0473){return _0x4b0473;});}return null;};}function removeEntity(_0x4c5687,_0x1750cf){return function(_0x18cdea){if(_0x18cdea){return _0x18cdea[_0xf5eb('0x28')]()['then'](function(){var _0x276420=_0x18cdea[_0xf5eb('0x29')]({'plain':!![]});var _0x129378=_0xf5eb('0x2a');return db[_0xf5eb('0x2b')][_0xf5eb('0x28')]({'where':{'type':_0x129378,'resourceId':_0x276420['id']}})[_0xf5eb('0x27')](function(){return _0x18cdea;});})[_0xf5eb('0x27')](function(){_0x4c5687['status'](0xcc)[_0xf5eb('0x1c')]();});}};}function handleEntityNotFound(_0x5d440f,_0x4b5801){return function(_0x5e95b6){if(!_0x5e95b6){_0x5d440f[_0xf5eb('0x1a')](0x194);}return _0x5e95b6;};}function handleError(_0x9d7a02,_0x8fd86b){_0x8fd86b=_0x8fd86b||0x1f4;return function(_0x440e0a){logger[_0xf5eb('0x2c')](_0x440e0a[_0xf5eb('0x2d')]);if(_0x440e0a['name']){delete _0x440e0a[_0xf5eb('0x2e')];}_0x9d7a02['status'](_0x8fd86b)[_0xf5eb('0x2f')](_0x440e0a);};}exports[_0xf5eb('0x30')]=function(_0x1a5b68,_0x166428){var _0x5bd3a4={},_0x22797c={},_0x33fc4d={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xf5eb('0x27')](function(_0x1c1946){_0x22797c[_0xf5eb('0x31')]=_[_0xf5eb('0x32')](_0x1c1946);_0x22797c['query']=_['keys'](_0x1a5b68[_0xf5eb('0x33')]);_0x22797c[_0xf5eb('0x34')]=_[_0xf5eb('0x35')](_0x22797c[_0xf5eb('0x31')],_0x22797c[_0xf5eb('0x33')]);_0x5bd3a4['attributes']=_[_0xf5eb('0x35')](_0x22797c[_0xf5eb('0x31')],qs[_0xf5eb('0x36')](_0x1a5b68['query']['fields']));_0x5bd3a4[_0xf5eb('0x37')]=_0x5bd3a4['attributes'][_0xf5eb('0x38')]?_0x5bd3a4[_0xf5eb('0x37')]:_0x22797c[_0xf5eb('0x31')];if(!_0x1a5b68[_0xf5eb('0x33')][_0xf5eb('0x39')]('nolimit')){_0x5bd3a4[_0xf5eb('0x21')]=qs[_0xf5eb('0x21')](_0x1a5b68[_0xf5eb('0x33')]['limit']);_0x5bd3a4[_0xf5eb('0x1e')]=qs['offset'](_0x1a5b68[_0xf5eb('0x33')]['offset']);}_0x5bd3a4['order']=qs[_0xf5eb('0x3a')](_0x1a5b68[_0xf5eb('0x33')][_0xf5eb('0x3a')]);_0x5bd3a4[_0xf5eb('0x3b')]=qs[_0xf5eb('0x34')](_[_0xf5eb('0x3c')](_0x1a5b68[_0xf5eb('0x33')],_0x22797c[_0xf5eb('0x34')]),_0x1c1946);if(_0x1a5b68['query']['filter']){_0x5bd3a4[_0xf5eb('0x3b')]=_[_0xf5eb('0x3d')](_0x5bd3a4[_0xf5eb('0x3b')],{'$or':_['map'](_0x5bd3a4[_0xf5eb('0x37')],function(_0x2a5337){var _0x4e382d={};_0x4e382d[_0x2a5337]={'$like':'%'+_0x1a5b68[_0xf5eb('0x33')][_0xf5eb('0x3e')]+'%'};return _0x4e382d;})});}_0x5bd3a4=_[_0xf5eb('0x3d')]({},_0x5bd3a4,_0x1a5b68[_0xf5eb('0x3f')]);var _0x371d96={'where':_0x5bd3a4[_0xf5eb('0x3b')]};return db['CmCompany'][_0xf5eb('0x20')](_0x371d96)[_0xf5eb('0x27')](function(_0x10af93){_0x33fc4d[_0xf5eb('0x20')]=_0x10af93;if(_0x1a5b68['query'][_0xf5eb('0x40')]){_0x5bd3a4[_0xf5eb('0x41')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x5bd3a4);})[_0xf5eb('0x27')](function(_0x4f4cec){_0x33fc4d[_0xf5eb('0x42')]=_0x4f4cec;return _0x33fc4d;})[_0xf5eb('0x27')](respondWithFilteredResult(_0x166428,_0x5bd3a4))[_0xf5eb('0x43')](handleError(_0x166428,null));})[_0xf5eb('0x43')](handleError(_0x166428,null));};exports[_0xf5eb('0x44')]=function(_0x396f0c,_0x104009){var _0x58ad0f={'raw':![],'where':{'id':_0x396f0c[_0xf5eb('0x45')]['id']}},_0x277c16={};_0x277c16[_0xf5eb('0x31')]=_['keys'](db[_0xf5eb('0x46')]['rawAttributes']);_0x277c16[_0xf5eb('0x33')]=_[_0xf5eb('0x32')](_0x396f0c[_0xf5eb('0x33')]);_0x277c16['filters']=_[_0xf5eb('0x35')](_0x277c16[_0xf5eb('0x31')],_0x277c16[_0xf5eb('0x33')]);_0x58ad0f[_0xf5eb('0x37')]=_['intersection'](_0x277c16[_0xf5eb('0x31')],qs[_0xf5eb('0x36')](_0x396f0c[_0xf5eb('0x33')][_0xf5eb('0x36')]));_0x58ad0f[_0xf5eb('0x37')]=_0x58ad0f['attributes'][_0xf5eb('0x38')]?_0x58ad0f[_0xf5eb('0x37')]:_0x277c16[_0xf5eb('0x31')];if(_0x396f0c['query'][_0xf5eb('0x40')]){_0x58ad0f[_0xf5eb('0x41')]=[{'all':!![]}];}_0x58ad0f=_['merge']({},_0x58ad0f,_0x396f0c[_0xf5eb('0x3f')]);return db[_0xf5eb('0x46')][_0xf5eb('0x47')](_0x58ad0f)[_0xf5eb('0x27')](handleEntityNotFound(_0x104009,null))['then'](respondWithResult(_0x104009,null))['catch'](handleError(_0x104009,null));};exports['create']=function(_0x2fc514,_0x570e4f){return db['CmCompany'][_0xf5eb('0x48')](_0x2fc514['body'],{})['then'](function(_0x1b797b){var _0x64006d=_0x2fc514[_0xf5eb('0x49')][_0xf5eb('0x29')]({'plain':!![]});if(!_0x64006d)throw new Error(_0xf5eb('0x4a'));if(_0x64006d[_0xf5eb('0x4b')]===_0xf5eb('0x49')){var _0x5a343f=_0x1b797b[_0xf5eb('0x29')]({'plain':!![]});var _0x1ee29d=_0xf5eb('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x1ee29d,'userProfileId':_0x64006d['userProfileId']},'raw':!![]})[_0xf5eb('0x27')](function(_0x4c52e0){if(_0x4c52e0&&_0x4c52e0['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5eb('0x48')]({'name':_0x5a343f[_0xf5eb('0x2e')],'resourceId':_0x5a343f['id'],'type':_0x4c52e0[_0xf5eb('0x2e')],'sectionId':_0x4c52e0['id']},{})[_0xf5eb('0x27')](function(){return _0x1b797b;});}else{return _0x1b797b;}})[_0xf5eb('0x43')](function(_0x574fa){logger[_0xf5eb('0x2c')](_0xf5eb('0x4c'),_0x574fa);throw _0x574fa;});}return _0x1b797b;})['then'](respondWithResult(_0x570e4f,0xc9))[_0xf5eb('0x43')](handleError(_0x570e4f,null));};exports[_0xf5eb('0x26')]=function(_0x37cfc3,_0x46e07b){if(_0x37cfc3[_0xf5eb('0x4d')]['id']){delete _0x37cfc3[_0xf5eb('0x4d')]['id'];}return db[_0xf5eb('0x46')][_0xf5eb('0x47')]({'where':{'id':_0x37cfc3[_0xf5eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x46e07b,null))[_0xf5eb('0x27')](saveUpdates(_0x37cfc3[_0xf5eb('0x4d')],null))[_0xf5eb('0x27')](respondWithResult(_0x46e07b,null))[_0xf5eb('0x43')](handleError(_0x46e07b,null));};exports[_0xf5eb('0x28')]=function(_0x335f43,_0x502dc6){return db[_0xf5eb('0x46')][_0xf5eb('0x47')]({'where':{'id':_0x335f43[_0xf5eb('0x45')]['id']}})[_0xf5eb('0x27')](handleEntityNotFound(_0x502dc6,null))[_0xf5eb('0x27')](removeEntity(_0x502dc6,null))['catch'](handleError(_0x502dc6,null));};exports[_0xf5eb('0x4e')]=function(_0x300be9,_0x3052dd){return db[_0xf5eb('0x46')][_0xf5eb('0x4e')]()['then'](respondWithResult(_0x3052dd,null))[_0xf5eb('0x43')](handleError(_0x3052dd,null));};exports[_0xf5eb('0x4f')]=function(_0x8e12aa,_0x83846c,_0x3a4ca5){return db[_0xf5eb('0x50')]['find']({'where':{'id':_0x8e12aa[_0xf5eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x83846c,null))[_0xf5eb('0x27')](function(_0x18f7ea){if(_0x18f7ea){return _0x18f7ea['addContacts'](_0x8e12aa[_0xf5eb('0x4d')]['ids'],_[_0xf5eb('0x51')](_0x8e12aa[_0xf5eb('0x4d')],['ids','id'])||{});}})[_0xf5eb('0x27')](respondWithResult(_0x83846c,null))['catch'](handleError(_0x83846c,null));};exports[_0xf5eb('0x52')]=function(_0x46c659,_0x5b070b,_0x513d0e){var _0x32cc25={};var _0x52260c={};var _0x10a6cb;var _0xb8c1e7;return db[_0xf5eb('0x46')][_0xf5eb('0x53')]({'where':{'id':_0x46c659['params']['id']}})[_0xf5eb('0x27')](handleEntityNotFound(_0x5b070b,null))[_0xf5eb('0x27')](function(_0x230d24){if(_0x230d24){_0x10a6cb=_0x230d24;_0x52260c[_0xf5eb('0x31')]=_[_0xf5eb('0x32')](db[_0xf5eb('0x50')][_0xf5eb('0x54')]);_0x52260c[_0xf5eb('0x33')]=_[_0xf5eb('0x32')](_0x46c659[_0xf5eb('0x33')]);_0x52260c['filters']=_[_0xf5eb('0x35')](_0x52260c[_0xf5eb('0x31')],_0x52260c['query']);_0x32cc25['attributes']=_[_0xf5eb('0x35')](_0x52260c[_0xf5eb('0x31')],qs[_0xf5eb('0x36')](_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x36')]));_0x32cc25[_0xf5eb('0x37')]=_0x32cc25[_0xf5eb('0x37')][_0xf5eb('0x38')]?_0x32cc25[_0xf5eb('0x37')]:_0x52260c['model'];_0x32cc25[_0xf5eb('0x55')]=qs[_0xf5eb('0x3a')](_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x3a')]);_0x32cc25[_0xf5eb('0x3b')]=qs['filters'](_[_0xf5eb('0x3c')](_0x46c659[_0xf5eb('0x33')],_0x52260c[_0xf5eb('0x34')]));if(_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x3e')]){_0x32cc25[_0xf5eb('0x3b')]=_['merge'](_0x32cc25['where'],{'$or':_[_0xf5eb('0x56')](_0x32cc25[_0xf5eb('0x37')],function(_0x4be8f9){var _0x332069={};_0x332069[_0x4be8f9]={'$like':'%'+_0x46c659['query'][_0xf5eb('0x3e')]+'%'};return _0x332069;})});}_0x32cc25=_[_0xf5eb('0x3d')]({},_0x32cc25,_0x46c659[_0xf5eb('0x3f')]);return _0x10a6cb[_0xf5eb('0x52')](_0x32cc25);}})[_0xf5eb('0x27')](function(_0x3b6278){if(_0x3b6278){_0xb8c1e7=_0x3b6278['length'];if(!_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x39')](_0xf5eb('0x57'))){_0x32cc25[_0xf5eb('0x21')]=qs[_0xf5eb('0x21')](_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x21')]);_0x32cc25['offset']=qs['offset'](_0x46c659[_0xf5eb('0x33')][_0xf5eb('0x1e')]);}return _0x10a6cb['getContacts'](_0x32cc25);}})[_0xf5eb('0x27')](function(_0x3846ca){if(_0x3846ca){return _0x3846ca?{'count':_0xb8c1e7,'rows':_0x3846ca}:null;}})[_0xf5eb('0x27')](respondWithResult(_0x5b070b,null))[_0xf5eb('0x43')](handleError(_0x5b070b,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 23a50bf..4c38420 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 _0x1060=['bluebird','request-promise','path','define','cm_companies','lodash','util','api','moment'];(function(_0x590d67,_0x48259f){var _0x33894f=function(_0x5b223d){while(--_0x5b223d){_0x590d67['push'](_0x590d67['shift']());}};_0x33894f(++_0x48259f);}(_0x1060,0xf8));var _0x0106=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x1060[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x0106('0x0'));var util=require(_0x0106('0x1'));var logger=require('../../config/logger')(_0x0106('0x2'));var moment=require(_0x0106('0x3'));var BPromise=require(_0x0106('0x4'));var rp=require(_0x0106('0x5'));var fs=require('fs');var path=require(_0x0106('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x309c71,_0x56b560){return _0x309c71[_0x0106('0x7')]('CmCompany',attributes,{'tableName':_0x0106('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea53=['moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api'];(function(_0x41df11,_0xfdfbe1){var _0x459ef5=function(_0x12c1a8){while(--_0x12c1a8){_0x41df11['push'](_0x41df11['shift']());}};_0x459ef5(++_0xfdfbe1);}(_0xea53,0x100));var _0x3ea5=function(_0x4c7429,_0x41d7e2){_0x4c7429=_0x4c7429-0x0;var _0xc03ebe=_0xea53[_0x4c7429];return _0xc03ebe;};'use strict';var _=require(_0x3ea5('0x0'));var util=require(_0x3ea5('0x1'));var logger=require(_0x3ea5('0x2'))(_0x3ea5('0x3'));var moment=require(_0x3ea5('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ea5('0x5'));var fs=require('fs');var path=require(_0x3ea5('0x6'));var rimraf=require(_0x3ea5('0x7'));var config=require(_0x3ea5('0x8'));var attributes=require(_0x3ea5('0x9'));module[_0x3ea5('0xa')]=function(_0x4c6ba0,_0x84c741){return _0x4c6ba0['define'](_0x3ea5('0xb'),attributes,{'tableName':_0x3ea5('0xc'),'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 c4be78d..9b90c07 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 _0x5fc2=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x556b80,_0x4a5009){var _0x1c1ece=function(_0x29abb0){while(--_0x29abb0){_0x556b80['push'](_0x556b80['shift']());}};_0x1c1ece(++_0x4a5009);}(_0x5fc2,0x106));var _0x25fc=function(_0x2d05fa,_0x372364){_0x2d05fa=_0x2d05fa-0x0;var _0x10ae61=_0x5fc2[_0x2d05fa];return _0x10ae61;};'use strict';var _=require(_0x25fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25fc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25fc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x25fc('0x3'));var logger=require(_0x25fc('0x4'))('rpc');var config=require(_0x25fc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x25fc('0x6')][_0x25fc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d5ff7,_0x5bc37f,_0x5d5a95){return new BPromise(function(_0x4d5390,_0x30bf86){return client[_0x25fc('0x8')](_0x5d5ff7,_0x5d5a95)[_0x25fc('0x9')](function(_0x2d6254){logger[_0x25fc('0xa')](_0x25fc('0xb'),_0x5bc37f,_0x25fc('0xc'));logger[_0x25fc('0xd')](_0x25fc('0xe'),_0x5bc37f,_0x25fc('0xc'),JSON[_0x25fc('0xf')](_0x2d6254));if(_0x2d6254['error']){if(_0x2d6254[_0x25fc('0x10')][_0x25fc('0x11')]===0x1f4){logger['error'](_0x25fc('0xb'),_0x5bc37f,_0x2d6254['error']['message']);return _0x30bf86(_0x2d6254[_0x25fc('0x10')][_0x25fc('0x12')]);}logger['error'](_0x25fc('0xb'),_0x5bc37f,_0x2d6254['error'][_0x25fc('0x12')]);return _0x4d5390(_0x2d6254[_0x25fc('0x10')]['message']);}else{logger[_0x25fc('0xa')](_0x25fc('0xb'),_0x5bc37f,_0x25fc('0xc'));_0x4d5390(_0x2d6254[_0x25fc('0x13')][_0x25fc('0x12')]);}})[_0x25fc('0x14')](function(_0x32fce9){logger['error'](_0x25fc('0xb'),_0x5bc37f,_0x32fce9);_0x30bf86(_0x32fce9);});});} \ No newline at end of file +var _0x7064=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x3bfd25,_0x36c09f){var _0x34d12f=function(_0xf64932){while(--_0xf64932){_0x3bfd25['push'](_0x3bfd25['shift']());}};_0x34d12f(++_0x36c09f);}(_0x7064,0x105));var _0x4706=function(_0x540f48,_0x8be529){_0x540f48=_0x540f48-0x0;var _0x3a54d9=_0x7064[_0x540f48];return _0x3a54d9;};'use strict';var _=require(_0x4706('0x0'));var util=require(_0x4706('0x1'));var moment=require('moment');var BPromise=require(_0x4706('0x2'));var rs=require(_0x4706('0x3'));var fs=require('fs');var Redis=require(_0x4706('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4706('0x5'));var config=require(_0x4706('0x6'));var jayson=require(_0x4706('0x7'));var client=jayson[_0x4706('0x8')][_0x4706('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2afe15,_0x34d515,_0x2e2976){return new BPromise(function(_0x2f3c94,_0x85b43e){return client[_0x4706('0xa')](_0x2afe15,_0x2e2976)[_0x4706('0xb')](function(_0x26c522){logger[_0x4706('0xc')](_0x4706('0xd'),_0x34d515,_0x4706('0xe'));logger[_0x4706('0xf')](_0x4706('0x10'),_0x34d515,_0x4706('0xe'),JSON[_0x4706('0x11')](_0x26c522));if(_0x26c522[_0x4706('0x12')]){if(_0x26c522[_0x4706('0x12')][_0x4706('0x13')]===0x1f4){logger[_0x4706('0x12')]('CmCompany,\x20%s,\x20%s',_0x34d515,_0x26c522[_0x4706('0x12')][_0x4706('0x14')]);return _0x85b43e(_0x26c522[_0x4706('0x12')][_0x4706('0x14')]);}logger[_0x4706('0x12')](_0x4706('0xd'),_0x34d515,_0x26c522['error'][_0x4706('0x14')]);return _0x2f3c94(_0x26c522[_0x4706('0x12')][_0x4706('0x14')]);}else{logger[_0x4706('0xc')](_0x4706('0xd'),_0x34d515,'request\x20sent');_0x2f3c94(_0x26c522[_0x4706('0x15')][_0x4706('0x14')]);}})[_0x4706('0x16')](function(_0x3e51ff){logger[_0x4706('0x12')]('CmCompany,\x20%s,\x20%s',_0x34d515,_0x3e51ff);_0x85b43e(_0x3e51ff);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8db27f8..b0f844d 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 _0x7a01=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','describe','show','/:id/contacts','post','addContacts','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5b3b3d,_0x225fd9){var _0x29ae6a=function(_0x1ed5b1){while(--_0x1ed5b1){_0x5b3b3d['push'](_0x5b3b3d['shift']());}};_0x29ae6a(++_0x225fd9);}(_0x7a01,0x19f));var _0x17a0=function(_0x4f5012,_0x5b13f7){_0x4f5012=_0x4f5012-0x0;var _0x2af057=_0x7a01[_0x4f5012];return _0x2af057;};'use strict';var multer=require(_0x17a0('0x0'));var util=require(_0x17a0('0x1'));var path=require(_0x17a0('0x2'));var timeout=require(_0x17a0('0x3'));var express=require('express');var router=express[_0x17a0('0x4')]();var fs_extra=require(_0x17a0('0x5'));var auth=require(_0x17a0('0x6'));var interaction=require(_0x17a0('0x7'));var config=require(_0x17a0('0x8'));var controller=require(_0x17a0('0x9'));router['get']('/',auth[_0x17a0('0xa')](),controller['index']);router[_0x17a0('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x17a0('0xc')]);router['get']('/:id',auth[_0x17a0('0xa')](),controller[_0x17a0('0xd')]);router[_0x17a0('0xb')](_0x17a0('0xe'),auth[_0x17a0('0xa')](),controller['getContacts']);router[_0x17a0('0xf')]('/',auth[_0x17a0('0xa')](),controller['create']);router['post'](_0x17a0('0xe'),auth['isAuthenticated'](),controller[_0x17a0('0x10')]);router[_0x17a0('0x11')]('/:id',auth[_0x17a0('0xa')](),controller[_0x17a0('0x12')]);router[_0x17a0('0x13')]('/:id',auth[_0x17a0('0xa')](),controller[_0x17a0('0x14')]);module[_0x17a0('0x15')]=router; \ No newline at end of file +var _0xc06e=['/:id/contacts','getContacts','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xc06e,0x14a));var _0xec06=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0xc06e[_0x1ee351];return _0x245aaf;};'use strict';var multer=require('multer');var util=require(_0xec06('0x0'));var path=require(_0xec06('0x1'));var timeout=require(_0xec06('0x2'));var express=require(_0xec06('0x3'));var router=express['Router']();var fs_extra=require(_0xec06('0x4'));var auth=require(_0xec06('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xec06('0x6')]('/',auth[_0xec06('0x7')](),controller['index']);router[_0xec06('0x6')](_0xec06('0x8'),auth[_0xec06('0x7')](),controller[_0xec06('0x9')]);router[_0xec06('0x6')](_0xec06('0xa'),auth['isAuthenticated'](),controller[_0xec06('0xb')]);router['get'](_0xec06('0xc'),auth[_0xec06('0x7')](),controller[_0xec06('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/contacts',auth[_0xec06('0x7')](),controller['addContacts']);router[_0xec06('0xe')]('/:id',auth[_0xec06('0x7')](),controller[_0xec06('0xf')]);router[_0xec06('0x10')](_0xec06('0xa'),auth[_0xec06('0x7')](),controller[_0xec06('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index f50ba8d..222e05c 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 _0xa650=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0x1f104c,_0x583642){var _0x447a68=function(_0x1b475e){while(--_0x1b475e){_0x1f104c['push'](_0x1f104c['shift']());}};_0x447a68(++_0x583642);}(_0xa650,0x1df));var _0x0a65=function(_0x29c695,_0x371ea4){_0x29c695=_0x29c695-0x0;var _0x30a26b=_0xa650[_0x29c695];return _0x30a26b;};'use strict';var _=require(_0x0a65('0x0'));var Sequelize=require(_0x0a65('0x1'));module[_0x0a65('0x2')]={'firstName':{'type':Sequelize[_0x0a65('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0a65('0x3')]},'street':{'type':Sequelize[_0x0a65('0x3')]},'postalCode':{'type':Sequelize[_0x0a65('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0a65('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0a65('0x3')]},'description':{'type':Sequelize[_0x0a65('0x4')]},'phone':{'type':Sequelize[_0x0a65('0x3')]},'mobile':{'type':Sequelize[_0x0a65('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0a65('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0a65('0x3')]},'skype':{'type':Sequelize[_0x0a65('0x3')]},'teams':{'type':Sequelize[_0x0a65('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x0a65('0x3')]},'telegram':{'type':Sequelize[_0x0a65('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0a65('0x5')](0x2)[_0x0a65('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0a65('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x0a65('0x5')]}}; \ No newline at end of file +var _0x7094=['STRING','TEXT','INTEGER','DATE','lodash','sequelize'];(function(_0x1e502f,_0x42063c){var _0x573fb4=function(_0x54d410){while(--_0x54d410){_0x1e502f['push'](_0x1e502f['shift']());}};_0x573fb4(++_0x42063c);}(_0x7094,0x12a));var _0x4709=function(_0xf35753,_0x50665c){_0xf35753=_0xf35753-0x0;var _0x5d7381=_0x7094[_0xf35753];return _0x5d7381;};'use strict';var _=require(_0x4709('0x0'));var Sequelize=require(_0x4709('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4709('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4709('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4709('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4709('0x2')]},'description':{'type':Sequelize[_0x4709('0x3')]},'phone':{'type':Sequelize[_0x4709('0x2')]},'mobile':{'type':Sequelize[_0x4709('0x2')]},'fax':{'type':Sequelize[_0x4709('0x2')]},'email':{'type':Sequelize[_0x4709('0x2')]},'url':{'type':Sequelize[_0x4709('0x2')]},'facebook':{'type':Sequelize[_0x4709('0x2')]},'fb_data':{'type':Sequelize[_0x4709('0x2')]},'twitter':{'type':Sequelize[_0x4709('0x2')]},'skype':{'type':Sequelize[_0x4709('0x2')]},'teams':{'type':Sequelize[_0x4709('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4709('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x4709('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x4709('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4709('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x4709('0x2')]},'utcOffset':{'type':Sequelize[_0x4709('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 973668e..6470808 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(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 f294151..e0a0b4c 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 _0x90cd=['exports','events','CmContact','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x90cd,0x1c1));var _0xd90c=function(_0x3a2981,_0x292733){_0x3a2981=_0x3a2981-0x0;var _0x190dff=_0x90cd[_0x3a2981];return _0x190dff;};'use strict';var EventEmitter=require(_0xd90c('0x0'));var CmContact=require('../../mysqldb')['db'][_0xd90c('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xd90c('0x2')](0x0);var events={'afterCreate':_0xd90c('0x3'),'afterUpdate':_0xd90c('0x4'),'afterDestroy':_0xd90c('0x5')};function emitEvent(_0x2e4a6d){return function(_0x45dea9,_0x1132b3,_0x3a64ac){CmContactEvents['emit'](_0x2e4a6d+':'+_0x45dea9['id'],_0x45dea9);CmContactEvents['emit'](_0x2e4a6d,_0x45dea9);_0x3a64ac(null);};}for(var e in events){if(events[_0xd90c('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xd90c('0x7')]=CmContactEvents; \ No newline at end of file +var _0xefa5=['CmContact','save','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0xf8a63a,_0x2235cf){var _0x1aace6=function(_0x4ae1b1){while(--_0x4ae1b1){_0xf8a63a['push'](_0xf8a63a['shift']());}};_0x1aace6(++_0x2235cf);}(_0xefa5,0xc3));var _0x5efa=function(_0x5f2c5f,_0x76561d){_0x5f2c5f=_0x5f2c5f-0x0;var _0x44cd63=_0xefa5[_0x5f2c5f];return _0x44cd63;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x5efa('0x0'))['db'][_0x5efa('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5efa('0x2'),'afterUpdate':'update','afterDestroy':_0x5efa('0x3')};function emitEvent(_0x344000){return function(_0x16b424,_0xbfcf49,_0x938b5){CmContactEvents['emit'](_0x344000+':'+_0x16b424['id'],_0x16b424);CmContactEvents[_0x5efa('0x4')](_0x344000,_0x16b424);_0x938b5(null);};}for(var e in events){if(events[_0x5efa('0x5')](e)){var event=events[e];CmContact[_0x5efa('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index f19cf36..bd77d8d 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 _0x1e33=['dialCheckDuplicateType','CmList','length','get','always','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','onlyIfOpen','models','destroy','ContactId','CampaignId','push','all','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','cm_contacts','phone','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','findOne','then','isNil','dialTimezone','timezones','utcOffset','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','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound'];(function(_0x1ecbdf,_0x5b6902){var _0x1eda2f=function(_0x545c77){while(--_0x545c77){_0x1ecbdf['push'](_0x1ecbdf['shift']());}};_0x1eda2f(++_0x5b6902);}(_0x1e33,0x174));var _0x31e3=function(_0x61f7b7,_0x9926ec){_0x61f7b7=_0x61f7b7-0x0;var _0x2e7f25=_0x1e33[_0x61f7b7];return _0x2e7f25;};'use strict';var _=require(_0x31e3('0x0'));var util=require(_0x31e3('0x1'));var logger=require(_0x31e3('0x2'))(_0x31e3('0x3'));var moment=require(_0x31e3('0x4'));var BPromise=require(_0x31e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31e3('0x6'));var rimraf=require(_0x31e3('0x7'));var config=require(_0x31e3('0x8'));var shared=require(_0x31e3('0x9'));var attributes=require(_0x31e3('0xa'));module['exports']=function(_0x6187ca,_0x3d95a2){return _0x6187ca[_0x31e3('0xb')]('CmContact',attributes,{'tableName':_0x31e3('0xc'),'paranoid':!![],'indexes':[{'name':_0x31e3('0xd'),'fields':[_0x31e3('0xd')]},{'name':'fti_cm_contacts','fields':['firstName','lastName','phone',_0x31e3('0xe'),_0x31e3('0xf'),_0x31e3('0x10')],'type':_0x31e3('0x11')}],'timestamps':!![],'charset':_0x31e3('0x12'),'collate':_0x31e3('0x13'),'hooks':{'afterCreate':function(_0x8b50f1,_0x56d109,_0x4335f1){var _0x5d38a8=_0x6187ca['models'];var _0x89119f=_0x8b50f1['get']({'plain':!![]});function _0x34722b(){return function(_0x52969c){logger[_0x31e3('0x14')](_0x31e3('0x15'),_0x31e3('0x16'),util[_0x31e3('0x17')](_0x52969c,{'showHidden':![],'depth':null}));};}function _0x11d6b0(_0x2dadd1,_0x38b6ed){var _0x1d0aab=_0x38b6ed[_0x31e3('0x18')]?_0x38b6ed[_0x31e3('0x18')]:moment()[_0x31e3('0x19')](_0x31e3('0x1a'));return new BPromise(function(_0x1aeeed,_0x445155){if(_['isNil'](_0x38b6ed['dialTimezone'])){_0x1aeeed({'ret':_0x1d0aab});}else{_0x5d38a8['VoiceQueue'][_0x31e3('0x1b')]({'where':{'id':_0x2dadd1['id']}})[_0x31e3('0x1c')](function(_0x5ef076){if(!_[_0x31e3('0x1d')](_0x5ef076)){var _0x53b351=_0x5ef076[_0x31e3('0x1e')];if(!_['isNil'](_0x53b351)){var _0x3a61c9=shared[_0x31e3('0x1f')];var _0x1505f5=_0x3a61c9[_0x53b351];var _0x15c9df=_0x3a61c9[_0x38b6ed[_0x31e3('0x1e')]];if(!_[_0x31e3('0x1d')](_0x1505f5)&&!_[_0x31e3('0x1d')](_0x15c9df)){var _0x25b7ee=_0x1505f5[_0x31e3('0x20')]-_0x15c9df[_0x31e3('0x20')];_0x1d0aab=_0x38b6ed[_0x31e3('0x18')]?_0x38b6ed[_0x31e3('0x18')]:moment();var _0x53b90f=moment(_0x1d0aab)['add'](_0x25b7ee,_0x31e3('0x21'));_0x1aeeed({'ret':_0x53b90f[_0x31e3('0x19')](_0x31e3('0x1a'))});}else _0x1aeeed({'ret':_0x1d0aab});}else _0x1aeeed({'ret':_0x1d0aab});}else{_0x1aeeed({'ret':_0x1d0aab});}});}});return 0xa;}var _0x162f7e=function(_0x319822){return new BPromise(function(_0x3b8f31,_0x1f7149){_0x11d6b0(_0x319822,_0x89119f)[_0x31e3('0x1c')](function(_0x390ed4){_0x89119f[_0x31e3('0x18')]=_0x390ed4[_0x31e3('0x22')];_0x5d38a8[_0x31e3('0x23')]['findOne']({'where':{'phone':_0x89119f['phone'],'VoiceQueueId':_0x319822['id']}})['then'](function(_0x3daa8a){if(!_[_0x31e3('0x1d')](_0x3daa8a)){throw new Error(_0x31e3('0x24')+_0x89119f['phone']+_0x31e3('0x25')+_0x319822['id']);}return _0x5d38a8[_0x31e3('0x23')][_0x31e3('0x26')]({'phone':_0x89119f[_0x31e3('0xd')],'ContactId':_0x89119f['id'],'ListId':_0x89119f[_0x31e3('0x27')],'priority':_0x89119f[_0x31e3('0x28')]?_0x89119f['priority']:0x2,'scheduledat':_0x89119f[_0x31e3('0x18')]?_0x89119f[_0x31e3('0x18')]:moment()[_0x31e3('0x19')](_0x31e3('0x1a')),'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f[_0x31e3('0x29')]?_0x89119f[_0x31e3('0x29')]:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'VoiceQueueId':_0x319822['id']});})[_0x31e3('0x2a')](function(_0x3dd910){_0x1f7149(_0x3dd910);});});});};var _0x16978a=function(_0x579a8a){return new BPromise(function(_0x33bf31,_0x27a080){_0x11d6b0(_0x579a8a,_0x89119f)['then'](function(_0x41a7ff){_0x89119f[_0x31e3('0x18')]=_0x41a7ff[_0x31e3('0x22')];_0x5d38a8[_0x31e3('0x23')][_0x31e3('0x1b')]({'where':{'phone':_0x89119f[_0x31e3('0xd')],'VoiceQueueId':_0x579a8a['id']}})[_0x31e3('0x1c')](function(_0x5818d4){if(!_['isNil'](_0x5818d4)){throw new Error(_0x31e3('0x24')+_0x89119f[_0x31e3('0xd')]+_0x31e3('0x2b')+_0x579a8a['id']);}return _0x5d38a8[_0x31e3('0x2c')]['findOne']({'where':{'calleridnum':_0x89119f[_0x31e3('0xd')],'VoiceQueueId':_0x579a8a['id']}});})['then'](function(_0x4b74be){if(!_['isNil'](_0x4b74be)){throw new Error(_0x31e3('0x2d')+_0x89119f['phone']+_0x31e3('0x2e')+_0x579a8a['id']);}return _0x5d38a8['CmHopper'][_0x31e3('0x26')]({'phone':_0x89119f[_0x31e3('0xd')],'ContactId':_0x89119f['id'],'ListId':_0x89119f[_0x31e3('0x27')],'priority':_0x89119f[_0x31e3('0x28')]?_0x89119f[_0x31e3('0x28')]:0x2,'scheduledat':_0x89119f[_0x31e3('0x18')]?_0x89119f[_0x31e3('0x18')]:moment()['format'](_0x31e3('0x1a')),'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f[_0x31e3('0x29')]?_0x89119f['callbackUniqueid']:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'VoiceQueueId':_0x579a8a['id']});})[_0x31e3('0x2a')](function(_0x19eeda){_0x27a080(_0x19eeda);});});});};function _0x2475be(){return function(_0x40680a){logger['error']('cmContact','afterCreate',util[_0x31e3('0x17')](_0x40680a,{'showHidden':![],'depth':null}));};}function _0x2d23bf(_0x4721f9,_0x55603b){var _0x381f25=_0x55603b[_0x31e3('0x18')]?_0x55603b[_0x31e3('0x18')]:moment()[_0x31e3('0x19')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2b83c4,_0x47408b){if(_[_0x31e3('0x1d')](_0x55603b[_0x31e3('0x1e')])){_0x2b83c4({'ret':_0x381f25});}else{_0x5d38a8['Campaign']['findOne']({'where':{'id':_0x4721f9['id']}})[_0x31e3('0x1c')](function(_0x49e83d){if(!_['isNil'](_0x49e83d)){var _0x5d7eb6=_0x49e83d[_0x31e3('0x1e')];if(!_['isNil'](_0x5d7eb6)){var _0xbf9121=shared[_0x31e3('0x1f')];var _0x4b3c7f=_0xbf9121[_0x5d7eb6];var _0x5de104=_0xbf9121[_0x55603b[_0x31e3('0x1e')]];if(!_[_0x31e3('0x1d')](_0x4b3c7f)&&!_[_0x31e3('0x1d')](_0x5de104)){var _0x4144d2=_0x4b3c7f['utcOffset']-_0x5de104['utcOffset'];_0x381f25=_0x55603b[_0x31e3('0x18')]?_0x55603b[_0x31e3('0x18')]:moment();var _0x47418e=moment(_0x381f25)[_0x31e3('0x2f')](_0x4144d2,'minutes');_0x2b83c4({'ret':_0x47418e[_0x31e3('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2b83c4({'ret':_0x381f25});}else _0x2b83c4({'ret':_0x381f25});}else{_0x2b83c4({'ret':_0x381f25});}});}});return 0xa;}var _0x4c9c9e=function(_0x5ecb96){return new BPromise(function(_0x2e8229,_0x592dd1){_0x2d23bf(_0x5ecb96,_0x89119f)[_0x31e3('0x1c')](function(_0x56074c){_0x89119f['scheduledat']=_0x56074c[_0x31e3('0x22')];_0x5d38a8[_0x31e3('0x23')][_0x31e3('0x1b')]({'where':{'phone':_0x89119f[_0x31e3('0xd')],'CampaignId':_0x5ecb96['id']}})['then'](function(_0x3582c8){if(!_[_0x31e3('0x1d')](_0x3582c8)){throw new Error(_0x31e3('0x24')+_0x89119f[_0x31e3('0xd')]+_0x31e3('0x30')+_0x5ecb96['id']);}return _0x5d38a8['CmHopper'][_0x31e3('0x26')]({'phone':_0x89119f[_0x31e3('0xd')],'ContactId':_0x89119f['id'],'ListId':_0x89119f['ListId'],'priority':_0x89119f['priority']?_0x89119f[_0x31e3('0x28')]:0x2,'scheduledat':_0x89119f[_0x31e3('0x18')]?_0x89119f[_0x31e3('0x18')]:moment()[_0x31e3('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f[_0x31e3('0x29')]?_0x89119f[_0x31e3('0x29')]:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'CampaignId':_0x5ecb96['id']});})['catch'](function(_0x18a03c){_0x592dd1(_0x18a03c);});});});};var _0x1e8202=function(_0x5854f2){return new BPromise(function(_0x195cd0,_0x3a9ae6){_0x2d23bf(_0x5854f2,_0x89119f)[_0x31e3('0x1c')](function(_0x4ba8be){_0x89119f[_0x31e3('0x18')]=_0x4ba8be['ret'];_0x5d38a8[_0x31e3('0x23')][_0x31e3('0x1b')]({'where':{'phone':_0x89119f[_0x31e3('0xd')],'CampaignId':_0x5854f2['id']}})[_0x31e3('0x1c')](function(_0x299eac){if(!_[_0x31e3('0x1d')](_0x299eac)){throw new Error('cmContact,\x20afterCreate\x20'+_0x89119f[_0x31e3('0xd')]+_0x31e3('0x31')+_0x5854f2['id']);}return _0x5d38a8[_0x31e3('0x2c')]['findOne']({'where':{'calleridnum':_0x89119f['phone'],'CampaignId':_0x5854f2['id']}});})[_0x31e3('0x1c')](function(_0x1f3aa2){if(!_[_0x31e3('0x1d')](_0x1f3aa2)){throw new Error(_0x31e3('0x2d')+_0x89119f[_0x31e3('0xd')]+_0x31e3('0x32')+_0x5854f2['id']);}return _0x5d38a8[_0x31e3('0x23')][_0x31e3('0x26')]({'phone':_0x89119f[_0x31e3('0xd')],'ContactId':_0x89119f['id'],'ListId':_0x89119f['ListId'],'priority':_0x89119f['priority']?_0x89119f[_0x31e3('0x28')]:0x2,'scheduledat':_0x89119f['scheduledat']?_0x89119f['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f['callbackUniqueid']?_0x89119f[_0x31e3('0x29')]:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'CampaignId':_0x5854f2['id']});})[_0x31e3('0x2a')](function(_0xd41f37){_0x3a9ae6(_0xd41f37);});});});};if(_0x89119f['ListId']){_0x5d38a8[_0x31e3('0x33')][_0x31e3('0x34')]({'where':{'type':_0x31e3('0x35')},'attributes':['id',_0x31e3('0x36'),'dialTimezone'],'include':[{'model':_0x5d38a8[_0x31e3('0x37')],'as':'Lists','where':{'id':_0x89119f[_0x31e3('0x27')]}}]})[_0x31e3('0x1c')](function(_0x11522f){if(_0x11522f){var _0x449fcf=[];for(var _0xa86038=0x0,_0x5e3ba6;_0xa86038<_0x11522f[_0x31e3('0x38')];_0xa86038+=0x1){_0x5e3ba6=_0x11522f[_0xa86038][_0x31e3('0x39')]({'plain':!![]});switch(_0x5e3ba6[_0x31e3('0x36')]){case _0x31e3('0x3a'):_0x16978a(_0x5e3ba6)[_0x31e3('0x2a')](_0x34722b());break;case'onlyIfOpen':_0x162f7e(_0x5e3ba6)['catch'](_0x34722b());break;default:_0x2d23bf(_0x5e3ba6,_0x89119f)[_0x31e3('0x1c')](function(_0x41f392){_0x89119f[_0x31e3('0x18')]=_0x41f392['ret'];_0x5d38a8['CmHopper']['create']({'phone':_0x89119f['phone'],'ContactId':_0x89119f['id'],'ListId':_0x89119f['ListId'],'scheduledat':_0x89119f[_0x31e3('0x18')]?_0x89119f[_0x31e3('0x18')]:moment()[_0x31e3('0x19')](_0x31e3('0x1a')),'priority':_0x89119f[_0x31e3('0x28')]?_0x89119f[_0x31e3('0x28')]:0x2,'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f[_0x31e3('0x29')]?_0x89119f['callbackUniqueid']:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'VoiceQueueId':_0x5e3ba6['id']})[_0x31e3('0x2a')](_0x34722b());});}}}})['then'](function(){return _0x5d38a8[_0x31e3('0x33')]['findAll']({'where':{'type':_0x31e3('0x35')},'attributes':['id'],'include':[{'model':_0x5d38a8[_0x31e3('0x37')],'as':'BlackLists','where':{'id':_0x89119f[_0x31e3('0x27')]}}]})[_0x31e3('0x1c')](function(_0x50f46d){if(_0x50f46d){var _0x4f1515=[];for(var _0x26a157=0x0,_0x3fa9a5;_0x26a157<_0x50f46d['length'];_0x26a157+=0x1){_0x3fa9a5=_0x50f46d[_0x26a157][_0x31e3('0x39')]({'plain':!![]});_0x5d38a8[_0x31e3('0x3b')]['create']({'phone':_0x89119f['phone'],'ContactId':_0x89119f['id'],'ListId':_0x89119f[_0x31e3('0x27')],'VoiceQueueId':_0x3fa9a5['id']})['catch'](function(_0x311783){logger[_0x31e3('0x14')](_0x31e3('0x3c'),_0x31e3('0x16'),_0x311783[_0x31e3('0x3d')]);});}}});})[_0x31e3('0x1c')](function(){return _0x5d38a8[_0x31e3('0x3e')][_0x31e3('0x34')]({'attributes':['id','dialCheckDuplicateType',_0x31e3('0x1e')],'include':[{'model':_0x5d38a8[_0x31e3('0x37')],'as':_0x31e3('0x3f'),'where':{'id':_0x89119f[_0x31e3('0x27')]}}]})[_0x31e3('0x1c')](function(_0x2cea4e){if(_0x2cea4e){var _0x20375c=[];for(var _0xae569=0x0,_0x4fc379;_0xae569<_0x2cea4e[_0x31e3('0x38')];_0xae569+=0x1){_0x4fc379=_0x2cea4e[_0xae569][_0x31e3('0x39')]({'plain':!![]});switch(_0x4fc379[_0x31e3('0x36')]){case _0x31e3('0x3a'):_0x1e8202(_0x4fc379)[_0x31e3('0x2a')](_0x2475be());break;case _0x31e3('0x40'):_0x4c9c9e(_0x4fc379)[_0x31e3('0x2a')](_0x2475be());break;default:_0x5d38a8[_0x31e3('0x23')][_0x31e3('0x26')]({'phone':_0x89119f[_0x31e3('0xd')],'ContactId':_0x89119f['id'],'ListId':_0x89119f[_0x31e3('0x27')],'scheduledat':_0x89119f[_0x31e3('0x18')]?_0x89119f[_0x31e3('0x18')]:moment()[_0x31e3('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x89119f[_0x31e3('0x28')]?_0x89119f[_0x31e3('0x28')]:0x2,'callback':_0x89119f[_0x31e3('0x29')]?!![]:![],'callbackuniqueid':_0x89119f[_0x31e3('0x29')]?_0x89119f[_0x31e3('0x29')]:undefined,'callbackat':_0x89119f[_0x31e3('0x29')]?moment()[_0x31e3('0x19')](_0x31e3('0x1a')):undefined,'CampaignId':_0x4fc379['id']})[_0x31e3('0x2a')](_0x2475be());}}}});})[_0x31e3('0x1c')](function(){return _0x5d38a8['Campaign'][_0x31e3('0x34')]({'attributes':['id'],'include':[{'model':_0x5d38a8[_0x31e3('0x37')],'as':'BlackLists','where':{'id':_0x89119f['ListId']}}]})[_0x31e3('0x1c')](function(_0x5de9ed){if(_0x5de9ed){var _0x464d3e=[];for(var _0x4f3f1a=0x0,_0x27c13a;_0x4f3f1a<_0x5de9ed[_0x31e3('0x38')];_0x4f3f1a+=0x1){_0x27c13a=_0x5de9ed[_0x4f3f1a][_0x31e3('0x39')]({'plain':!![]});_0x5d38a8[_0x31e3('0x3b')][_0x31e3('0x26')]({'phone':_0x89119f['phone'],'ContactId':_0x89119f['id'],'ListId':_0x89119f[_0x31e3('0x27')],'CampaignId':_0x27c13a['id']})[_0x31e3('0x2a')](function(_0x341fb9){logger[_0x31e3('0x14')]('cmContact,\x20%s,\x20%s',_0x31e3('0x16'),_0x341fb9[_0x31e3('0x3d')]);});}}});})[_0x31e3('0x1c')](function(){_0x4335f1();})[_0x31e3('0x2a')](function(_0x1f3c10){logger[_0x31e3('0x14')](_0x31e3('0x3c'),_0x31e3('0x16'),_0x1f3c10[_0x31e3('0x3d')]);_0x4335f1(_0x1f3c10);});}else{_0x4335f1(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x1bf295,_0x2d227a,_0x337ed9){var _0x171f8c=_0x6187ca[_0x31e3('0x41')];var _0x594bba=_0x1bf295[_0x31e3('0x39')]({'plain':!![]});return _0x171f8c['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x594bba['ListId'],'ContactId':_0x594bba['id']}})[_0x31e3('0x1c')](function(_0x447fb1){if(!_['isEmpty'](_0x447fb1)){var _0x575a8e=[];for(var _0x10cbcb=0x0;_0x10cbcb<_0x447fb1[_0x31e3('0x38')];_0x10cbcb+=0x1){var _0x548968=_0x171f8c[_0x31e3('0x23')][_0x31e3('0x42')]({'where':{'ListId':_0x447fb1[_0x10cbcb]['ListId'],'ContactId':_0x447fb1[_0x10cbcb][_0x31e3('0x43')],'VoiceQueueId':_0x447fb1[_0x10cbcb]['VoiceQueueId'],'CampaignId':_0x447fb1[_0x10cbcb][_0x31e3('0x44')]}});_0x575a8e[_0x31e3('0x45')](_0x548968);}return BPromise[_0x31e3('0x46')](_0x575a8e);}})[_0x31e3('0x1c')](function(_0x3cd0d2){logger['info']('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x3cd0d2,{'showHidden':![],'depth':null}));_0x337ed9();})[_0x31e3('0x2a')](function(_0x48e507){logger[_0x31e3('0x14')]('[CmContact][afterDestroy][Error]',util[_0x31e3('0x17')](_0x48e507,{'showHidden':![],'depth':null}));_0x337ed9(_0x48e507);});}}});}; \ No newline at end of file +var _0x9e2b=['format','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','inspect','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','length','get','always','onlyIfOpen','outbound','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','List\x20not\x20found','models','isEmpty','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','afterCreate','scheduledat'];(function(_0x1efc8c,_0x46e5ef){var _0x2f2ace=function(_0x1623a4){while(--_0x1623a4){_0x1efc8c['push'](_0x1efc8c['shift']());}};_0x2f2ace(++_0x46e5ef);}(_0x9e2b,0x19f));var _0xb9e2=function(_0x24ce09,_0x219531){_0x24ce09=_0x24ce09-0x0;var _0x2acc72=_0x9e2b[_0x24ce09];return _0x2acc72;};'use strict';var _=require(_0xb9e2('0x0'));var util=require(_0xb9e2('0x1'));var logger=require('../../config/logger')(_0xb9e2('0x2'));var moment=require(_0xb9e2('0x3'));var BPromise=require(_0xb9e2('0x4'));var rp=require(_0xb9e2('0x5'));var fs=require('fs');var path=require(_0xb9e2('0x6'));var rimraf=require(_0xb9e2('0x7'));var config=require(_0xb9e2('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0xb9e2('0x9'));module['exports']=function(_0x44f4c9,_0x5c5e83){return _0x44f4c9[_0xb9e2('0xa')](_0xb9e2('0xb'),attributes,{'tableName':_0xb9e2('0xc'),'paranoid':!![],'indexes':[{'name':_0xb9e2('0xd'),'fields':[_0xb9e2('0xd')]},{'name':'fti_cm_contacts','fields':[_0xb9e2('0xe'),_0xb9e2('0xf'),_0xb9e2('0xd'),_0xb9e2('0x10'),_0xb9e2('0x11'),_0xb9e2('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xb9e2('0x13'),'collate':_0xb9e2('0x14'),'hooks':{'afterCreate':function(_0x57b4ac,_0x205ef8,_0x65c851){var _0x144986=_0x44f4c9['models'];var _0x2bcf0b=_0x57b4ac['get']({'plain':!![]});function _0x44c28c(){return function(_0x5c6b5e){logger['error']('cmContact',_0xb9e2('0x15'),util['inspect'](_0x5c6b5e,{'showHidden':![],'depth':null}));};}function _0x325e30(_0xb3c001,_0x44d80b){var _0x4ca369=_0x44d80b[_0xb9e2('0x16')]?_0x44d80b[_0xb9e2('0x16')]:moment()[_0xb9e2('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x3bdfe5,_0x20da83){if(_[_0xb9e2('0x18')](_0x44d80b[_0xb9e2('0x19')])){_0x3bdfe5({'ret':_0x4ca369});}else{_0x144986[_0xb9e2('0x1a')][_0xb9e2('0x1b')]({'where':{'id':_0xb3c001['id']}})[_0xb9e2('0x1c')](function(_0x4fdcfa){if(!_['isNil'](_0x4fdcfa)){var _0x282b40=_0x4fdcfa[_0xb9e2('0x19')];if(!_['isNil'](_0x282b40)){var _0x37b332=shared[_0xb9e2('0x1d')];var _0x290b7b=_0x37b332[_0x282b40];var _0x1a098c=_0x37b332[_0x44d80b[_0xb9e2('0x19')]];if(!_[_0xb9e2('0x18')](_0x290b7b)&&!_[_0xb9e2('0x18')](_0x1a098c)){var _0x403624=_0x290b7b[_0xb9e2('0x1e')]-_0x1a098c['utcOffset'];_0x4ca369=_0x44d80b[_0xb9e2('0x16')]?_0x44d80b['scheduledat']:moment();var _0x29d6d0=moment(_0x4ca369)['add'](_0x403624,_0xb9e2('0x1f'));_0x3bdfe5({'ret':_0x29d6d0[_0xb9e2('0x17')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3bdfe5({'ret':_0x4ca369});}else _0x3bdfe5({'ret':_0x4ca369});}else{_0x3bdfe5({'ret':_0x4ca369});}});}});return 0xa;}var _0x1916ee=function(_0x227536){return new BPromise(function(_0x2c0609,_0x6238fd){_0x325e30(_0x227536,_0x2bcf0b)[_0xb9e2('0x1c')](function(_0x456d47){_0x2bcf0b[_0xb9e2('0x16')]=_0x456d47[_0xb9e2('0x20')];_0x144986['CmHopper']['findOne']({'where':{'phone':_0x2bcf0b[_0xb9e2('0xd')],'VoiceQueueId':_0x227536['id']}})[_0xb9e2('0x1c')](function(_0x2ec9ad){if(!_[_0xb9e2('0x18')](_0x2ec9ad)){throw new Error(_0xb9e2('0x21')+_0x2bcf0b[_0xb9e2('0xd')]+_0xb9e2('0x22')+_0x227536['id']);}return _0x144986[_0xb9e2('0x23')]['create']({'phone':_0x2bcf0b['phone'],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'priority':_0x2bcf0b[_0xb9e2('0x25')]?_0x2bcf0b[_0xb9e2('0x25')]:0x2,'scheduledat':_0x2bcf0b['scheduledat']?_0x2bcf0b[_0xb9e2('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2bcf0b[_0xb9e2('0x26')]?!![]:![],'callbackuniqueid':_0x2bcf0b[_0xb9e2('0x26')]?_0x2bcf0b[_0xb9e2('0x26')]:undefined,'callbackat':_0x2bcf0b[_0xb9e2('0x26')]?moment()[_0xb9e2('0x17')](_0xb9e2('0x27')):undefined,'VoiceQueueId':_0x227536['id']});})[_0xb9e2('0x28')](function(_0x4f4350){_0x6238fd(_0x4f4350);});});});};var _0xb90263=function(_0x46fa4c){return new BPromise(function(_0x5aa44f,_0x46fd23){_0x325e30(_0x46fa4c,_0x2bcf0b)[_0xb9e2('0x1c')](function(_0x2b2ae5){_0x2bcf0b[_0xb9e2('0x16')]=_0x2b2ae5[_0xb9e2('0x20')];_0x144986['CmHopper'][_0xb9e2('0x1b')]({'where':{'phone':_0x2bcf0b[_0xb9e2('0xd')],'VoiceQueueId':_0x46fa4c['id']}})[_0xb9e2('0x1c')](function(_0x2b4e0c){if(!_['isNil'](_0x2b4e0c)){throw new Error(_0xb9e2('0x21')+_0x2bcf0b[_0xb9e2('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x46fa4c['id']);}return _0x144986['CmHopperFinal'][_0xb9e2('0x1b')]({'where':{'calleridnum':_0x2bcf0b['phone'],'VoiceQueueId':_0x46fa4c['id']}});})[_0xb9e2('0x1c')](function(_0x10c789){if(!_[_0xb9e2('0x18')](_0x10c789)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2bcf0b[_0xb9e2('0xd')]+_0xb9e2('0x29')+_0x46fa4c['id']);}return _0x144986[_0xb9e2('0x23')]['create']({'phone':_0x2bcf0b[_0xb9e2('0xd')],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b['ListId'],'priority':_0x2bcf0b[_0xb9e2('0x25')]?_0x2bcf0b[_0xb9e2('0x25')]:0x2,'scheduledat':_0x2bcf0b['scheduledat']?_0x2bcf0b[_0xb9e2('0x16')]:moment()[_0xb9e2('0x17')](_0xb9e2('0x27')),'callback':_0x2bcf0b[_0xb9e2('0x26')]?!![]:![],'callbackuniqueid':_0x2bcf0b['callbackUniqueid']?_0x2bcf0b[_0xb9e2('0x26')]:undefined,'callbackat':_0x2bcf0b[_0xb9e2('0x26')]?moment()[_0xb9e2('0x17')](_0xb9e2('0x27')):undefined,'VoiceQueueId':_0x46fa4c['id']});})[_0xb9e2('0x28')](function(_0x4655b9){_0x46fd23(_0x4655b9);});});});};function _0x491fd4(){return function(_0x42f32d){logger[_0xb9e2('0x2a')]('cmContact',_0xb9e2('0x15'),util[_0xb9e2('0x2b')](_0x42f32d,{'showHidden':![],'depth':null}));};}function _0xbbfc0f(_0xcdeae8,_0x362361){var _0x1fda36=_0x362361[_0xb9e2('0x16')]?_0x362361[_0xb9e2('0x16')]:moment()[_0xb9e2('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x46162,_0x4a82fb){if(_[_0xb9e2('0x18')](_0x362361[_0xb9e2('0x19')])){_0x46162({'ret':_0x1fda36});}else{_0x144986['Campaign'][_0xb9e2('0x1b')]({'where':{'id':_0xcdeae8['id']}})[_0xb9e2('0x1c')](function(_0x2aa80a){if(!_['isNil'](_0x2aa80a)){var _0x3c41aa=_0x2aa80a[_0xb9e2('0x19')];if(!_[_0xb9e2('0x18')](_0x3c41aa)){var _0xcf6b9c=shared['timezones'];var _0x3fdead=_0xcf6b9c[_0x3c41aa];var _0x50ed77=_0xcf6b9c[_0x362361[_0xb9e2('0x19')]];if(!_[_0xb9e2('0x18')](_0x3fdead)&&!_['isNil'](_0x50ed77)){var _0x1eaeae=_0x3fdead[_0xb9e2('0x1e')]-_0x50ed77['utcOffset'];_0x1fda36=_0x362361[_0xb9e2('0x16')]?_0x362361[_0xb9e2('0x16')]:moment();var _0x4fb3c2=moment(_0x1fda36)[_0xb9e2('0x2c')](_0x1eaeae,'minutes');_0x46162({'ret':_0x4fb3c2['format'](_0xb9e2('0x27'))});}else _0x46162({'ret':_0x1fda36});}else _0x46162({'ret':_0x1fda36});}else{_0x46162({'ret':_0x1fda36});}});}});return 0xa;}var _0x33938d=function(_0x5bd099){return new BPromise(function(_0x416d40,_0x291537){_0xbbfc0f(_0x5bd099,_0x2bcf0b)['then'](function(_0x61b4cd){_0x2bcf0b['scheduledat']=_0x61b4cd[_0xb9e2('0x20')];_0x144986[_0xb9e2('0x23')][_0xb9e2('0x1b')]({'where':{'phone':_0x2bcf0b['phone'],'CampaignId':_0x5bd099['id']}})[_0xb9e2('0x1c')](function(_0x376b40){if(!_[_0xb9e2('0x18')](_0x376b40)){throw new Error(_0xb9e2('0x21')+_0x2bcf0b['phone']+_0xb9e2('0x2d')+_0x5bd099['id']);}return _0x144986[_0xb9e2('0x23')][_0xb9e2('0x2e')]({'phone':_0x2bcf0b[_0xb9e2('0xd')],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b['ListId'],'priority':_0x2bcf0b['priority']?_0x2bcf0b[_0xb9e2('0x25')]:0x2,'scheduledat':_0x2bcf0b[_0xb9e2('0x16')]?_0x2bcf0b['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2bcf0b[_0xb9e2('0x26')]?!![]:![],'callbackuniqueid':_0x2bcf0b[_0xb9e2('0x26')]?_0x2bcf0b[_0xb9e2('0x26')]:undefined,'callbackat':_0x2bcf0b[_0xb9e2('0x26')]?moment()['format'](_0xb9e2('0x27')):undefined,'CampaignId':_0x5bd099['id']});})[_0xb9e2('0x28')](function(_0x38240b){_0x291537(_0x38240b);});});});};var _0x1b120b=function(_0x2466fe){return new BPromise(function(_0x20aebc,_0x3d29e0){_0xbbfc0f(_0x2466fe,_0x2bcf0b)['then'](function(_0x158575){_0x2bcf0b[_0xb9e2('0x16')]=_0x158575['ret'];_0x144986[_0xb9e2('0x23')][_0xb9e2('0x1b')]({'where':{'phone':_0x2bcf0b[_0xb9e2('0xd')],'CampaignId':_0x2466fe['id']}})[_0xb9e2('0x1c')](function(_0x3a4219){if(!_[_0xb9e2('0x18')](_0x3a4219)){throw new Error(_0xb9e2('0x21')+_0x2bcf0b[_0xb9e2('0xd')]+_0xb9e2('0x2f')+_0x2466fe['id']);}return _0x144986['CmHopperFinal'][_0xb9e2('0x1b')]({'where':{'calleridnum':_0x2bcf0b[_0xb9e2('0xd')],'CampaignId':_0x2466fe['id']}});})[_0xb9e2('0x1c')](function(_0x1f8366){if(!_[_0xb9e2('0x18')](_0x1f8366)){throw new Error(_0xb9e2('0x30')+_0x2bcf0b[_0xb9e2('0xd')]+_0xb9e2('0x31')+_0x2466fe['id']);}return _0x144986[_0xb9e2('0x23')][_0xb9e2('0x2e')]({'phone':_0x2bcf0b['phone'],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'priority':_0x2bcf0b[_0xb9e2('0x25')]?_0x2bcf0b['priority']:0x2,'scheduledat':_0x2bcf0b[_0xb9e2('0x16')]?_0x2bcf0b[_0xb9e2('0x16')]:moment()[_0xb9e2('0x17')](_0xb9e2('0x27')),'callback':_0x2bcf0b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2bcf0b['callbackUniqueid']?_0x2bcf0b[_0xb9e2('0x26')]:undefined,'callbackat':_0x2bcf0b['callbackUniqueid']?moment()['format'](_0xb9e2('0x27')):undefined,'CampaignId':_0x2466fe['id']});})['catch'](function(_0x55cd75){_0x3d29e0(_0x55cd75);});});});};if(_0x2bcf0b['ListId']){_0x144986[_0xb9e2('0x1a')][_0xb9e2('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0xb9e2('0x33'),_0xb9e2('0x19')],'include':[{'model':_0x144986['CmList'],'as':'Lists','where':{'id':_0x2bcf0b[_0xb9e2('0x24')]}}]})[_0xb9e2('0x1c')](function(_0x1d8d47){if(_0x1d8d47){var _0x11a4e3=[];for(var _0x1a5faf=0x0,_0x4816e5;_0x1a5faf<_0x1d8d47[_0xb9e2('0x34')];_0x1a5faf+=0x1){_0x4816e5=_0x1d8d47[_0x1a5faf][_0xb9e2('0x35')]({'plain':!![]});switch(_0x4816e5[_0xb9e2('0x33')]){case _0xb9e2('0x36'):_0xb90263(_0x4816e5)[_0xb9e2('0x28')](_0x44c28c());break;case _0xb9e2('0x37'):_0x1916ee(_0x4816e5)[_0xb9e2('0x28')](_0x44c28c());break;default:_0xbbfc0f(_0x4816e5,_0x2bcf0b)[_0xb9e2('0x1c')](function(_0x42b330){_0x2bcf0b[_0xb9e2('0x16')]=_0x42b330[_0xb9e2('0x20')];_0x144986['CmHopper'][_0xb9e2('0x2e')]({'phone':_0x2bcf0b[_0xb9e2('0xd')],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'scheduledat':_0x2bcf0b[_0xb9e2('0x16')]?_0x2bcf0b[_0xb9e2('0x16')]:moment()['format'](_0xb9e2('0x27')),'priority':_0x2bcf0b[_0xb9e2('0x25')]?_0x2bcf0b[_0xb9e2('0x25')]:0x2,'callback':_0x2bcf0b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2bcf0b[_0xb9e2('0x26')]?_0x2bcf0b['callbackUniqueid']:undefined,'callbackat':_0x2bcf0b[_0xb9e2('0x26')]?moment()[_0xb9e2('0x17')](_0xb9e2('0x27')):undefined,'VoiceQueueId':_0x4816e5['id']})[_0xb9e2('0x28')](_0x44c28c());});}}}})['then'](function(){return _0x144986['VoiceQueue'][_0xb9e2('0x32')]({'where':{'type':_0xb9e2('0x38')},'attributes':['id'],'include':[{'model':_0x144986[_0xb9e2('0x39')],'as':_0xb9e2('0x3a'),'where':{'id':_0x2bcf0b['ListId']}}]})['then'](function(_0x3faf6d){if(_0x3faf6d){var _0x4615d7=[];for(var _0x1d6607=0x0,_0xc4b763;_0x1d6607<_0x3faf6d['length'];_0x1d6607+=0x1){_0xc4b763=_0x3faf6d[_0x1d6607][_0xb9e2('0x35')]({'plain':!![]});_0x144986[_0xb9e2('0x3b')]['create']({'phone':_0x2bcf0b['phone'],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'VoiceQueueId':_0xc4b763['id']})[_0xb9e2('0x28')](function(_0x20bae6){logger[_0xb9e2('0x2a')](_0xb9e2('0x3c'),_0xb9e2('0x15'),_0x20bae6[_0xb9e2('0x3d')]);});}}});})[_0xb9e2('0x1c')](function(){return _0x144986[_0xb9e2('0x3e')][_0xb9e2('0x32')]({'attributes':['id',_0xb9e2('0x33'),_0xb9e2('0x19')],'include':[{'model':_0x144986[_0xb9e2('0x39')],'as':_0xb9e2('0x3f'),'where':{'id':_0x2bcf0b[_0xb9e2('0x24')]}}]})['then'](function(_0x4ca0bc){if(_0x4ca0bc){var _0x3376d4=[];for(var _0x278349=0x0,_0x55abe3;_0x278349<_0x4ca0bc[_0xb9e2('0x34')];_0x278349+=0x1){_0x55abe3=_0x4ca0bc[_0x278349][_0xb9e2('0x35')]({'plain':!![]});switch(_0x55abe3[_0xb9e2('0x33')]){case'always':_0x1b120b(_0x55abe3)[_0xb9e2('0x28')](_0x491fd4());break;case _0xb9e2('0x37'):_0x33938d(_0x55abe3)[_0xb9e2('0x28')](_0x491fd4());break;default:_0x144986[_0xb9e2('0x23')][_0xb9e2('0x2e')]({'phone':_0x2bcf0b[_0xb9e2('0xd')],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'scheduledat':_0x2bcf0b[_0xb9e2('0x16')]?_0x2bcf0b['scheduledat']:moment()[_0xb9e2('0x17')](_0xb9e2('0x27')),'priority':_0x2bcf0b[_0xb9e2('0x25')]?_0x2bcf0b[_0xb9e2('0x25')]:0x2,'callback':_0x2bcf0b[_0xb9e2('0x26')]?!![]:![],'callbackuniqueid':_0x2bcf0b[_0xb9e2('0x26')]?_0x2bcf0b[_0xb9e2('0x26')]:undefined,'callbackat':_0x2bcf0b['callbackUniqueid']?moment()[_0xb9e2('0x17')](_0xb9e2('0x27')):undefined,'CampaignId':_0x55abe3['id']})[_0xb9e2('0x28')](_0x491fd4());}}}});})['then'](function(){return _0x144986['Campaign'][_0xb9e2('0x32')]({'attributes':['id'],'include':[{'model':_0x144986[_0xb9e2('0x39')],'as':_0xb9e2('0x3a'),'where':{'id':_0x2bcf0b[_0xb9e2('0x24')]}}]})['then'](function(_0x1e3c0f){if(_0x1e3c0f){var _0x4f6327=[];for(var _0x2b548c=0x0,_0x5569f0;_0x2b548c<_0x1e3c0f['length'];_0x2b548c+=0x1){_0x5569f0=_0x1e3c0f[_0x2b548c][_0xb9e2('0x35')]({'plain':!![]});_0x144986['CmHopperBlack']['create']({'phone':_0x2bcf0b[_0xb9e2('0xd')],'ContactId':_0x2bcf0b['id'],'ListId':_0x2bcf0b[_0xb9e2('0x24')],'CampaignId':_0x5569f0['id']})['catch'](function(_0x1f6038){logger[_0xb9e2('0x2a')]('cmContact,\x20%s,\x20%s','afterCreate',_0x1f6038[_0xb9e2('0x3d')]);});}}});})['then'](function(){_0x65c851();})['catch'](function(_0x34381b){logger[_0xb9e2('0x2a')](_0xb9e2('0x3c'),_0xb9e2('0x15'),_0x34381b['message']);_0x65c851(_0x34381b);});}else{_0x65c851(new Error(_0xb9e2('0x40')));}},'afterDestroy':function(_0x561627,_0x396ac6,_0x27efd4){var _0x54e3fb=_0x44f4c9[_0xb9e2('0x41')];var _0xf6c153=_0x561627[_0xb9e2('0x35')]({'plain':!![]});return _0x54e3fb[_0xb9e2('0x23')][_0xb9e2('0x32')]({'raw':!![],'where':{'ListId':_0xf6c153[_0xb9e2('0x24')],'ContactId':_0xf6c153['id']}})[_0xb9e2('0x1c')](function(_0x131965){if(!_[_0xb9e2('0x42')](_0x131965)){var _0x57b393=[];for(var _0x16b202=0x0;_0x16b202<_0x131965[_0xb9e2('0x34')];_0x16b202+=0x1){var _0x2c850a=_0x54e3fb[_0xb9e2('0x23')]['destroy']({'where':{'ListId':_0x131965[_0x16b202][_0xb9e2('0x24')],'ContactId':_0x131965[_0x16b202][_0xb9e2('0x43')],'VoiceQueueId':_0x131965[_0x16b202][_0xb9e2('0x44')],'CampaignId':_0x131965[_0x16b202]['CampaignId']}});_0x57b393[_0xb9e2('0x45')](_0x2c850a);}return BPromise[_0xb9e2('0x46')](_0x57b393);}})[_0xb9e2('0x1c')](function(_0x5f5da1){logger[_0xb9e2('0x47')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x5f5da1,{'showHidden':![],'depth':null}));_0x27efd4();})[_0xb9e2('0x28')](function(_0x2f4292){logger[_0xb9e2('0x2a')](_0xb9e2('0x48'),util[_0xb9e2('0x2b')](_0x2f4292,{'showHidden':![],'depth':null}));_0x27efd4(_0x2f4292);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 62e8d94..f99be99 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(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x56be29,_0x45449a){var _0x24c742=function(_0x3f7072){while(--_0x3f7072){_0x56be29['push'](_0x56be29['shift']());}};_0x24c742(++_0x45449a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 563b3b4..ee7ad88 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 _0x2121=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x34a5a6,_0x191edc){var _0x459517=function(_0x31af90){while(--_0x31af90){_0x34a5a6['push'](_0x34a5a6['shift']());}};_0x459517(++_0x191edc);}(_0x2121,0x1b4));var _0x1212=function(_0x5e1f92,_0x40e49e){_0x5e1f92=_0x5e1f92-0x0;var _0xfb3aa3=_0x2121[_0x5e1f92];return _0xfb3aa3;};'use strict';var Sequelize=require(_0x1212('0x0'));module[_0x1212('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1212('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1212('0x3')],'defaultValue':_0x1212('0x4')},'OrderBy':{'type':Sequelize[_0x1212('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x1212('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x89c3=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x145e9e,_0x2e6dd4){var _0x2264c2=function(_0x57d209){while(--_0x57d209){_0x145e9e['push'](_0x145e9e['shift']());}};_0x2264c2(++_0x2e6dd4);}(_0x89c3,0xff));var _0x389c=function(_0x193f84,_0x3e2dca){_0x193f84=_0x193f84-0x0;var _0xb1263b=_0x89c3[_0x193f84];return _0xb1263b;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'CmContactId':{'type':Sequelize[_0x389c('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x389c('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x389c('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x389c('0x3')],'defaultValue':_0x389c('0x4')},'OrderBy':{'type':Sequelize[_0x389c('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'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 252ef15..65eada8 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 _0x0bc2=['map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','count','limit','set','apply','reject','save','update','destroy','then','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send'];(function(_0x1e2f7c,_0x25e144){var _0x3ebe03=function(_0x4d0160){while(--_0x4d0160){_0x1e2f7c['push'](_0x1e2f7c['shift']());}};_0x3ebe03(++_0x25e144);}(_0x0bc2,0xcb));var _0x20bc=function(_0x4a489e,_0x408794){_0x4a489e=_0x4a489e-0x0;var _0x1d50c8=_0x0bc2[_0x4a489e];return _0x1d50c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20bc('0x0'));var zipdir=require(_0x20bc('0x1'));var jsonpatch=require(_0x20bc('0x2'));var rp=require(_0x20bc('0x3'));var moment=require(_0x20bc('0x4'));var BPromise=require(_0x20bc('0x5'));var Mustache=require(_0x20bc('0x6'));var util=require(_0x20bc('0x7'));var path=require(_0x20bc('0x8'));var sox=require(_0x20bc('0x9'));var csv=require(_0x20bc('0xa'));var ejs=require(_0x20bc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20bc('0xc'));var squel=require('squel');var crypto=require(_0x20bc('0xd'));var jsforce=require(_0x20bc('0xe'));var deskjs=require(_0x20bc('0xf'));var toCsv=require(_0x20bc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x20bc('0x11'));var as=require(_0x20bc('0x12'));var hardwareService=require(_0x20bc('0x13'));var logger=require(_0x20bc('0x14'))('api');var utils=require(_0x20bc('0x15'));var config=require(_0x20bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fa171,_0x165e4e){_0x165e4e=_0x165e4e||0xcc;return function(_0x4dd338){if(_0x4dd338){return _0x1fa171['sendStatus'](_0x165e4e);}return _0x1fa171[_0x20bc('0x17')](_0x165e4e)[_0x20bc('0x18')]();};}function respondWithResult(_0x45358b,_0x262490){_0x262490=_0x262490||0xc8;return function(_0x3ee736){if(_0x3ee736){return _0x45358b[_0x20bc('0x17')](_0x262490)[_0x20bc('0x19')](_0x3ee736);}};}function respondWithFilteredResult(_0x4cece1,_0x13e571){return function(_0x2edb51){if(_0x2edb51){var _0x5bb47b=typeof _0x13e571[_0x20bc('0x1a')]==='undefined'&&typeof _0x13e571['limit']==='undefined';var _0x2c3724=_0x2edb51[_0x20bc('0x1b')];var _0xa2c257=_0x5bb47b?0x0:_0x13e571[_0x20bc('0x1a')];var _0x508549=_0x5bb47b?_0x2edb51[_0x20bc('0x1b')]:_0x13e571['offset']+_0x13e571[_0x20bc('0x1c')];var _0x136ac0;if(_0x508549>=_0x2c3724){_0x508549=_0x2c3724;_0x136ac0=0xc8;}else{_0x136ac0=0xce;}_0x4cece1[_0x20bc('0x17')](_0x136ac0);return _0x4cece1[_0x20bc('0x1d')]('Content-Range',_0xa2c257+'-'+_0x508549+'/'+_0x2c3724)['json'](_0x2edb51);}return null;};}function patchUpdates(_0xb08b06){return function(_0xf80def){try{jsonpatch[_0x20bc('0x1e')](_0xf80def,_0xb08b06,!![]);}catch(_0x21e58f){return BPromise[_0x20bc('0x1f')](_0x21e58f);}return _0xf80def[_0x20bc('0x20')]();};}function saveUpdates(_0x313b08,_0x1d44a0){return function(_0x479eb7){if(_0x479eb7){return _0x479eb7[_0x20bc('0x21')](_0x313b08)['then'](function(_0x3f6cd8){return _0x3f6cd8;});}return null;};}function removeEntity(_0x388dfb,_0x2bd323){return function(_0x499f41){if(_0x499f41){return _0x499f41[_0x20bc('0x22')]()[_0x20bc('0x23')](function(){var _0x249873=_0x499f41['get']({'plain':!![]});var _0x33db20=_0x20bc('0x24');return db[_0x20bc('0x25')]['destroy']({'where':{'type':_0x33db20,'resourceId':_0x249873['id']}})['then'](function(){return _0x499f41;});})[_0x20bc('0x23')](function(){_0x388dfb[_0x20bc('0x17')](0xcc)[_0x20bc('0x18')]();});}};}function handleEntityNotFound(_0x1780b8,_0xfc8ff6){return function(_0x2dd171){if(!_0x2dd171){_0x1780b8[_0x20bc('0x26')](0x194);}return _0x2dd171;};}function handleError(_0x3dcfb5,_0x4dd2fe){_0x4dd2fe=_0x4dd2fe||0x1f4;return function(_0x32ca71){logger[_0x20bc('0x27')](_0x32ca71[_0x20bc('0x28')]);if(_0x32ca71['name']){delete _0x32ca71[_0x20bc('0x29')];}_0x3dcfb5[_0x20bc('0x17')](_0x4dd2fe)[_0x20bc('0x2a')](_0x32ca71);};}exports['index']=function(_0x139f81,_0x35160c){var _0x36d7a6={},_0x1a5963={},_0x318c29={'count':0x0,'rows':[]};var _0x554597=_[_0x20bc('0x2b')](db[_0x20bc('0x2c')][_0x20bc('0x2d')],function(_0x3af7df){return{'name':_0x3af7df[_0x20bc('0x2e')],'type':_0x3af7df[_0x20bc('0x2f')][_0x20bc('0x30')]};});_0x1a5963[_0x20bc('0x31')]=_[_0x20bc('0x2b')](_0x554597,_0x20bc('0x29'));_0x1a5963[_0x20bc('0x32')]=_[_0x20bc('0x33')](_0x139f81['query']);_0x1a5963['filters']=_[_0x20bc('0x34')](_0x1a5963['model'],_0x1a5963['query']);_0x36d7a6['attributes']=_[_0x20bc('0x34')](_0x1a5963[_0x20bc('0x31')],qs[_0x20bc('0x35')](_0x139f81[_0x20bc('0x32')][_0x20bc('0x35')]));_0x36d7a6[_0x20bc('0x36')]=_0x36d7a6[_0x20bc('0x36')][_0x20bc('0x37')]?_0x36d7a6['attributes']:_0x1a5963[_0x20bc('0x31')];if(!_0x139f81[_0x20bc('0x32')][_0x20bc('0x38')](_0x20bc('0x39'))){_0x36d7a6['limit']=qs[_0x20bc('0x1c')](_0x139f81['query']['limit']);_0x36d7a6[_0x20bc('0x1a')]=qs['offset'](_0x139f81[_0x20bc('0x32')][_0x20bc('0x1a')]);}_0x36d7a6[_0x20bc('0x3a')]=qs[_0x20bc('0x3b')](_0x139f81[_0x20bc('0x32')][_0x20bc('0x3b')]);_0x36d7a6[_0x20bc('0x3c')]=qs['filters'](_[_0x20bc('0x3d')](_0x139f81['query'],_0x1a5963['filters']),_0x554597);if(_0x139f81[_0x20bc('0x32')][_0x20bc('0x3e')]){_0x36d7a6[_0x20bc('0x3c')]=_[_0x20bc('0x3f')](_0x36d7a6[_0x20bc('0x3c')],{'$or':_['map'](_0x554597,function(_0x12682d){if(_0x12682d[_0x20bc('0x2f')]!==_0x20bc('0x40')){var _0x27dfa1={};_0x27dfa1[_0x12682d[_0x20bc('0x29')]]={'$like':'%'+_0x139f81['query'][_0x20bc('0x3e')]+'%'};return _0x27dfa1;}})});}_0x36d7a6=_[_0x20bc('0x3f')]({},_0x36d7a6,_0x139f81[_0x20bc('0x41')]);var _0x5bb68e={'where':_0x36d7a6[_0x20bc('0x3c')]};return db['CmContactHasItem'][_0x20bc('0x1b')](_0x5bb68e)[_0x20bc('0x23')](function(_0x2a66ab){_0x318c29[_0x20bc('0x1b')]=_0x2a66ab;if(_0x139f81['query'][_0x20bc('0x42')]){_0x36d7a6['include']=[{'all':!![]}];}return db[_0x20bc('0x2c')][_0x20bc('0x43')](_0x36d7a6);})[_0x20bc('0x23')](function(_0x578ed0){_0x318c29[_0x20bc('0x44')]=_0x578ed0;return _0x318c29;})[_0x20bc('0x23')](respondWithFilteredResult(_0x35160c,_0x36d7a6))[_0x20bc('0x45')](handleError(_0x35160c,null));};exports[_0x20bc('0x46')]=function(_0x254a66,_0x3f8eb3){var _0x334084={'raw':!![],'where':{'id':_0x254a66[_0x20bc('0x47')]['id']}},_0x4c4d73={};_0x4c4d73['model']=_[_0x20bc('0x33')](db['CmContactHasItem'][_0x20bc('0x2d')]);_0x4c4d73[_0x20bc('0x32')]=_[_0x20bc('0x33')](_0x254a66[_0x20bc('0x32')]);_0x4c4d73[_0x20bc('0x48')]=_[_0x20bc('0x34')](_0x4c4d73['model'],_0x4c4d73[_0x20bc('0x32')]);_0x334084[_0x20bc('0x36')]=_[_0x20bc('0x34')](_0x4c4d73[_0x20bc('0x31')],qs[_0x20bc('0x35')](_0x254a66[_0x20bc('0x32')][_0x20bc('0x35')]));_0x334084[_0x20bc('0x36')]=_0x334084[_0x20bc('0x36')][_0x20bc('0x37')]?_0x334084['attributes']:_0x4c4d73[_0x20bc('0x31')];if(_0x254a66[_0x20bc('0x32')][_0x20bc('0x42')]){_0x334084['include']=[{'all':!![]}];}_0x334084=_[_0x20bc('0x3f')]({},_0x334084,_0x254a66[_0x20bc('0x41')]);return db[_0x20bc('0x2c')][_0x20bc('0x49')](_0x334084)[_0x20bc('0x23')](handleEntityNotFound(_0x3f8eb3,null))[_0x20bc('0x23')](respondWithResult(_0x3f8eb3,null))['catch'](handleError(_0x3f8eb3,null));};exports[_0x20bc('0x4a')]=function(_0x6b9f22,_0x3e5ac9){return db[_0x20bc('0x2c')][_0x20bc('0x4a')](_0x6b9f22[_0x20bc('0x4b')],{})[_0x20bc('0x23')](function(_0x1be677){var _0x17bd26=_0x6b9f22[_0x20bc('0x4c')]['get']({'plain':!![]});if(!_0x17bd26)throw new Error(_0x20bc('0x4d'));if(_0x17bd26['role']===_0x20bc('0x4c')){var _0x56bad0=_0x1be677[_0x20bc('0x4e')]({'plain':!![]});var _0x5977b='CmContactHasItems';return db['UserProfileSection'][_0x20bc('0x49')]({'where':{'name':_0x5977b,'userProfileId':_0x17bd26[_0x20bc('0x4f')]},'raw':!![]})[_0x20bc('0x23')](function(_0x25faba){if(_0x25faba&&_0x25faba[_0x20bc('0x50')]===0x0){return db['UserProfileResource'][_0x20bc('0x4a')]({'name':_0x56bad0[_0x20bc('0x29')],'resourceId':_0x56bad0['id'],'type':_0x25faba[_0x20bc('0x29')],'sectionId':_0x25faba['id']},{})['then'](function(){return _0x1be677;});}else{return _0x1be677;}})[_0x20bc('0x45')](function(_0x464203){logger[_0x20bc('0x27')](_0x20bc('0x51'),_0x464203);throw _0x464203;});}return _0x1be677;})[_0x20bc('0x23')](respondWithResult(_0x3e5ac9,0xc9))['catch'](handleError(_0x3e5ac9,null));};exports[_0x20bc('0x21')]=function(_0x472906,_0xbfd79f){if(_0x472906[_0x20bc('0x4b')]['id']){delete _0x472906[_0x20bc('0x4b')]['id'];}return db[_0x20bc('0x2c')][_0x20bc('0x49')]({'where':{'id':_0x472906[_0x20bc('0x47')]['id']}})[_0x20bc('0x23')](handleEntityNotFound(_0xbfd79f,null))[_0x20bc('0x23')](saveUpdates(_0x472906['body'],null))['then'](respondWithResult(_0xbfd79f,null))[_0x20bc('0x45')](handleError(_0xbfd79f,null));};exports[_0x20bc('0x22')]=function(_0x22ea7e,_0x519da6){return db[_0x20bc('0x2c')][_0x20bc('0x49')]({'where':{'id':_0x22ea7e[_0x20bc('0x47')]['id']}})[_0x20bc('0x23')](handleEntityNotFound(_0x519da6,null))[_0x20bc('0x23')](removeEntity(_0x519da6,null))[_0x20bc('0x45')](handleError(_0x519da6,null));}; \ No newline at end of file +var _0x5beb=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware'];(function(_0xa3de2b,_0x27c03d){var _0x317195=function(_0x692194){while(--_0x692194){_0xa3de2b['push'](_0xa3de2b['shift']());}};_0x317195(++_0x27c03d);}(_0x5beb,0x98));var _0xb5be=function(_0xfb2cd8,_0x2b9990){_0xfb2cd8=_0xfb2cd8-0x0;var _0x420691=_0x5beb[_0xfb2cd8];return _0x420691;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5be('0x0'));var zipdir=require(_0xb5be('0x1'));var jsonpatch=require(_0xb5be('0x2'));var rp=require(_0xb5be('0x3'));var moment=require(_0xb5be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb5be('0x5'));var util=require(_0xb5be('0x6'));var path=require(_0xb5be('0x7'));var sox=require(_0xb5be('0x8'));var csv=require(_0xb5be('0x9'));var ejs=require(_0xb5be('0xa'));var fs=require('fs');var fs_extra=require(_0xb5be('0xb'));var _=require(_0xb5be('0xc'));var squel=require(_0xb5be('0xd'));var crypto=require(_0xb5be('0xe'));var jsforce=require(_0xb5be('0xf'));var deskjs=require(_0xb5be('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb5be('0x11'));var Papa=require(_0xb5be('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5be('0x13'));var logger=require(_0xb5be('0x14'))(_0xb5be('0x15'));var utils=require(_0xb5be('0x16'));var config=require(_0xb5be('0x17'));var licenseUtil=require(_0xb5be('0x18'));var db=require(_0xb5be('0x19'))['db'];function respondWithStatusCode(_0x338c80,_0x486a63){_0x486a63=_0x486a63||0xcc;return function(_0x4776d0){if(_0x4776d0){return _0x338c80[_0xb5be('0x1a')](_0x486a63);}return _0x338c80['status'](_0x486a63)[_0xb5be('0x1b')]();};}function respondWithResult(_0x3e31ba,_0x2600db){_0x2600db=_0x2600db||0xc8;return function(_0xcead79){if(_0xcead79){return _0x3e31ba['status'](_0x2600db)[_0xb5be('0x1c')](_0xcead79);}};}function respondWithFilteredResult(_0x30e5fb,_0x393342){return function(_0x2ff114){if(_0x2ff114){var _0x2dabf1=typeof _0x393342['offset']==='undefined'&&typeof _0x393342['limit']===_0xb5be('0x1d');var _0x101eb6=_0x2ff114[_0xb5be('0x1e')];var _0x37f755=_0x2dabf1?0x0:_0x393342['offset'];var _0x246af0=_0x2dabf1?_0x2ff114['count']:_0x393342[_0xb5be('0x1f')]+_0x393342['limit'];var _0x197ad6;if(_0x246af0>=_0x101eb6){_0x246af0=_0x101eb6;_0x197ad6=0xc8;}else{_0x197ad6=0xce;}_0x30e5fb[_0xb5be('0x20')](_0x197ad6);return _0x30e5fb[_0xb5be('0x21')](_0xb5be('0x22'),_0x37f755+'-'+_0x246af0+'/'+_0x101eb6)[_0xb5be('0x1c')](_0x2ff114);}return null;};}function patchUpdates(_0x39cb16){return function(_0x387870){try{jsonpatch[_0xb5be('0x23')](_0x387870,_0x39cb16,!![]);}catch(_0x3aee5a){return BPromise[_0xb5be('0x24')](_0x3aee5a);}return _0x387870[_0xb5be('0x25')]();};}function saveUpdates(_0x1cf3eb,_0x5a57d4){return function(_0x346aa8){if(_0x346aa8){return _0x346aa8[_0xb5be('0x26')](_0x1cf3eb)[_0xb5be('0x27')](function(_0x5b0f72){return _0x5b0f72;});}return null;};}function removeEntity(_0xfc3acc,_0x50046e){return function(_0x55ed5d){if(_0x55ed5d){return _0x55ed5d[_0xb5be('0x28')]()['then'](function(){var _0xeb9487=_0x55ed5d['get']({'plain':!![]});var _0x5b38d5=_0xb5be('0x29');return db[_0xb5be('0x2a')][_0xb5be('0x28')]({'where':{'type':_0x5b38d5,'resourceId':_0xeb9487['id']}})[_0xb5be('0x27')](function(){return _0x55ed5d;});})[_0xb5be('0x27')](function(){_0xfc3acc[_0xb5be('0x20')](0xcc)[_0xb5be('0x1b')]();});}};}function handleEntityNotFound(_0x2635eb,_0xddfb5e){return function(_0x72c823){if(!_0x72c823){_0x2635eb[_0xb5be('0x1a')](0x194);}return _0x72c823;};}function handleError(_0x352ee5,_0xfe2daa){_0xfe2daa=_0xfe2daa||0x1f4;return function(_0x3a1853){logger[_0xb5be('0x2b')](_0x3a1853[_0xb5be('0x2c')]);if(_0x3a1853['name']){delete _0x3a1853[_0xb5be('0x2d')];}_0x352ee5[_0xb5be('0x20')](_0xfe2daa)[_0xb5be('0x2e')](_0x3a1853);};}exports[_0xb5be('0x2f')]=function(_0x5f44af,_0x41b4ef){var _0x4710d3={},_0x2f732a={},_0x5e1c98={'count':0x0,'rows':[]};var _0x13acbe=_[_0xb5be('0x30')](db[_0xb5be('0x31')][_0xb5be('0x32')],function(_0x56f3cb){return{'name':_0x56f3cb[_0xb5be('0x33')],'type':_0x56f3cb[_0xb5be('0x34')][_0xb5be('0x35')]};});_0x2f732a[_0xb5be('0x36')]=_[_0xb5be('0x30')](_0x13acbe,_0xb5be('0x2d'));_0x2f732a[_0xb5be('0x37')]=_['keys'](_0x5f44af[_0xb5be('0x37')]);_0x2f732a[_0xb5be('0x38')]=_[_0xb5be('0x39')](_0x2f732a['model'],_0x2f732a[_0xb5be('0x37')]);_0x4710d3[_0xb5be('0x3a')]=_[_0xb5be('0x39')](_0x2f732a[_0xb5be('0x36')],qs[_0xb5be('0x3b')](_0x5f44af[_0xb5be('0x37')]['fields']));_0x4710d3['attributes']=_0x4710d3[_0xb5be('0x3a')][_0xb5be('0x3c')]?_0x4710d3[_0xb5be('0x3a')]:_0x2f732a[_0xb5be('0x36')];if(!_0x5f44af[_0xb5be('0x37')][_0xb5be('0x3d')](_0xb5be('0x3e'))){_0x4710d3[_0xb5be('0x3f')]=qs['limit'](_0x5f44af[_0xb5be('0x37')]['limit']);_0x4710d3[_0xb5be('0x1f')]=qs[_0xb5be('0x1f')](_0x5f44af[_0xb5be('0x37')][_0xb5be('0x1f')]);}_0x4710d3['order']=qs['sort'](_0x5f44af['query'][_0xb5be('0x40')]);_0x4710d3[_0xb5be('0x41')]=qs['filters'](_[_0xb5be('0x42')](_0x5f44af[_0xb5be('0x37')],_0x2f732a[_0xb5be('0x38')]),_0x13acbe);if(_0x5f44af[_0xb5be('0x37')][_0xb5be('0x43')]){_0x4710d3['where']=_[_0xb5be('0x44')](_0x4710d3[_0xb5be('0x41')],{'$or':_[_0xb5be('0x30')](_0x13acbe,function(_0x46372a){if(_0x46372a[_0xb5be('0x34')]!==_0xb5be('0x45')){var _0x52887d={};_0x52887d[_0x46372a['name']]={'$like':'%'+_0x5f44af[_0xb5be('0x37')][_0xb5be('0x43')]+'%'};return _0x52887d;}})});}_0x4710d3=_[_0xb5be('0x44')]({},_0x4710d3,_0x5f44af[_0xb5be('0x46')]);var _0x2e8119={'where':_0x4710d3[_0xb5be('0x41')]};return db[_0xb5be('0x31')]['count'](_0x2e8119)[_0xb5be('0x27')](function(_0x179c22){_0x5e1c98[_0xb5be('0x1e')]=_0x179c22;if(_0x5f44af[_0xb5be('0x37')][_0xb5be('0x47')]){_0x4710d3[_0xb5be('0x48')]=[{'all':!![]}];}return db[_0xb5be('0x31')]['findAll'](_0x4710d3);})[_0xb5be('0x27')](function(_0x33a911){_0x5e1c98[_0xb5be('0x49')]=_0x33a911;return _0x5e1c98;})[_0xb5be('0x27')](respondWithFilteredResult(_0x41b4ef,_0x4710d3))['catch'](handleError(_0x41b4ef,null));};exports[_0xb5be('0x4a')]=function(_0x34b23e,_0x5d8ae1){var _0x58f79d={'raw':!![],'where':{'id':_0x34b23e[_0xb5be('0x4b')]['id']}},_0x3fded8={};_0x3fded8[_0xb5be('0x36')]=_['keys'](db[_0xb5be('0x31')]['rawAttributes']);_0x3fded8[_0xb5be('0x37')]=_[_0xb5be('0x4c')](_0x34b23e[_0xb5be('0x37')]);_0x3fded8['filters']=_[_0xb5be('0x39')](_0x3fded8[_0xb5be('0x36')],_0x3fded8[_0xb5be('0x37')]);_0x58f79d[_0xb5be('0x3a')]=_[_0xb5be('0x39')](_0x3fded8[_0xb5be('0x36')],qs[_0xb5be('0x3b')](_0x34b23e[_0xb5be('0x37')]['fields']));_0x58f79d['attributes']=_0x58f79d['attributes']['length']?_0x58f79d[_0xb5be('0x3a')]:_0x3fded8[_0xb5be('0x36')];if(_0x34b23e[_0xb5be('0x37')]['includeAll']){_0x58f79d[_0xb5be('0x48')]=[{'all':!![]}];}_0x58f79d=_['merge']({},_0x58f79d,_0x34b23e[_0xb5be('0x46')]);return db[_0xb5be('0x31')][_0xb5be('0x4d')](_0x58f79d)[_0xb5be('0x27')](handleEntityNotFound(_0x5d8ae1,null))[_0xb5be('0x27')](respondWithResult(_0x5d8ae1,null))[_0xb5be('0x4e')](handleError(_0x5d8ae1,null));};exports[_0xb5be('0x4f')]=function(_0x563e28,_0x489460){return db[_0xb5be('0x31')][_0xb5be('0x4f')](_0x563e28[_0xb5be('0x50')],{})[_0xb5be('0x27')](function(_0x4749af){var _0x873ab8=_0x563e28[_0xb5be('0x51')][_0xb5be('0x52')]({'plain':!![]});if(!_0x873ab8)throw new Error(_0xb5be('0x53'));if(_0x873ab8['role']===_0xb5be('0x51')){var _0x4e9de7=_0x4749af['get']({'plain':!![]});var _0x4da626=_0xb5be('0x29');return db[_0xb5be('0x54')]['find']({'where':{'name':_0x4da626,'userProfileId':_0x873ab8['userProfileId']},'raw':!![]})['then'](function(_0x8aac0c){if(_0x8aac0c&&_0x8aac0c['autoAssociation']===0x0){return db[_0xb5be('0x2a')]['create']({'name':_0x4e9de7['name'],'resourceId':_0x4e9de7['id'],'type':_0x8aac0c['name'],'sectionId':_0x8aac0c['id']},{})[_0xb5be('0x27')](function(){return _0x4749af;});}else{return _0x4749af;}})['catch'](function(_0x203ff3){logger[_0xb5be('0x2b')](_0xb5be('0x55'),_0x203ff3);throw _0x203ff3;});}return _0x4749af;})[_0xb5be('0x27')](respondWithResult(_0x489460,0xc9))[_0xb5be('0x4e')](handleError(_0x489460,null));};exports[_0xb5be('0x26')]=function(_0x4fcdbc,_0x5e97c1){if(_0x4fcdbc[_0xb5be('0x50')]['id']){delete _0x4fcdbc[_0xb5be('0x50')]['id'];}return db[_0xb5be('0x31')][_0xb5be('0x4d')]({'where':{'id':_0x4fcdbc[_0xb5be('0x4b')]['id']}})[_0xb5be('0x27')](handleEntityNotFound(_0x5e97c1,null))[_0xb5be('0x27')](saveUpdates(_0x4fcdbc['body'],null))[_0xb5be('0x27')](respondWithResult(_0x5e97c1,null))[_0xb5be('0x4e')](handleError(_0x5e97c1,null));};exports['destroy']=function(_0x5128cc,_0x1e8cdc){return db[_0xb5be('0x31')][_0xb5be('0x4d')]({'where':{'id':_0x5128cc['params']['id']}})[_0xb5be('0x27')](handleEntityNotFound(_0x1e8cdc,null))['then'](removeEntity(_0x1e8cdc,null))[_0xb5be('0x4e')](handleError(_0x1e8cdc,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index f02aa4b..b747ca7 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 _0x6abb=['path','rimraf','../../config/environment','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b71b5,_0xf5805b){var _0x1271a0=function(_0x43f81f){while(--_0x43f81f){_0x5b71b5['push'](_0x5b71b5['shift']());}};_0x1271a0(++_0xf5805b);}(_0x6abb,0xba));var _0xb6ab=function(_0x2744e8,_0x331d61){_0x2744e8=_0x2744e8-0x0;var _0x27b0f3=_0x6abb[_0x2744e8];return _0x27b0f3;};'use strict';var _=require(_0xb6ab('0x0'));var util=require(_0xb6ab('0x1'));var logger=require(_0xb6ab('0x2'))(_0xb6ab('0x3'));var moment=require(_0xb6ab('0x4'));var BPromise=require(_0xb6ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6ab('0x6'));var rimraf=require(_0xb6ab('0x7'));var config=require(_0xb6ab('0x8'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x284415,_0x4386fe){return _0x284415[_0xb6ab('0x9')](_0xb6ab('0xa'),attributes,{'tableName':_0xb6ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94be=['request-promise','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','api','moment'];(function(_0x2bfa06,_0x351e03){var _0x58811b=function(_0x624504){while(--_0x624504){_0x2bfa06['push'](_0x2bfa06['shift']());}};_0x58811b(++_0x351e03);}(_0x94be,0x125));var _0xe94b=function(_0x461ab7,_0x396964){_0x461ab7=_0x461ab7-0x0;var _0x4f9c3c=_0x94be[_0x461ab7];return _0x4f9c3c;};'use strict';var _=require(_0xe94b('0x0'));var util=require(_0xe94b('0x1'));var logger=require('../../config/logger')(_0xe94b('0x2'));var moment=require(_0xe94b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe94b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe94b('0x5'));var attributes=require(_0xe94b('0x6'));module[_0xe94b('0x7')]=function(_0x144cb3,_0x12a4e7){return _0x144cb3[_0xe94b('0x8')](_0xe94b('0x9'),attributes,{'tableName':_0xe94b('0xa'),'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 435dc3a..ace4ce8 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 _0x83e6=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch'];(function(_0x37985e,_0x4c8cbe){var _0x5dd561=function(_0x42f1c0){while(--_0x42f1c0){_0x37985e['push'](_0x37985e['shift']());}};_0x5dd561(++_0x4c8cbe);}(_0x83e6,0xb4));var _0x683e=function(_0x3e7818,_0xa326f8){_0x3e7818=_0x3e7818-0x0;var _0x216f7e=_0x83e6[_0x3e7818];return _0x216f7e;};'use strict';var _=require('lodash');var util=require(_0x683e('0x0'));var moment=require(_0x683e('0x1'));var BPromise=require('bluebird');var rs=require(_0x683e('0x2'));var fs=require('fs');var Redis=require(_0x683e('0x3'));var db=require(_0x683e('0x4'))['db'];var utils=require(_0x683e('0x5'));var logger=require(_0x683e('0x6'))(_0x683e('0x7'));var config=require(_0x683e('0x8'));var jayson=require(_0x683e('0x9'));var client=jayson[_0x683e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x373fdd,_0x1deb53,_0x22cb49){return new BPromise(function(_0x57bc82,_0x2115a0){return client[_0x683e('0xb')](_0x373fdd,_0x22cb49)['then'](function(_0x54d69e){logger['info'](_0x683e('0xc'),_0x1deb53,_0x683e('0xd'));logger[_0x683e('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x1deb53,'request\x20sent',JSON[_0x683e('0xf')](_0x54d69e));if(_0x54d69e[_0x683e('0x10')]){if(_0x54d69e['error']['code']===0x1f4){logger[_0x683e('0x10')](_0x683e('0xc'),_0x1deb53,_0x54d69e[_0x683e('0x10')][_0x683e('0x11')]);return _0x2115a0(_0x54d69e[_0x683e('0x10')][_0x683e('0x11')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x1deb53,_0x54d69e['error'][_0x683e('0x11')]);return _0x57bc82(_0x54d69e[_0x683e('0x10')][_0x683e('0x11')]);}else{logger[_0x683e('0x12')](_0x683e('0xc'),_0x1deb53,_0x683e('0xd'));_0x57bc82(_0x54d69e['result'][_0x683e('0x11')]);}})[_0x683e('0x13')](function(_0x2ea39c){logger[_0x683e('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x1deb53,_0x2ea39c);_0x2115a0(_0x2ea39c);});});} \ No newline at end of file +var _0x9a43=['CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent'];(function(_0x54080c,_0x2b5537){var _0x37b3a7=function(_0xb85a85){while(--_0xb85a85){_0x54080c['push'](_0x54080c['shift']());}};_0x37b3a7(++_0x2b5537);}(_0x9a43,0x15a));var _0x39a4=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0x9a43[_0x3c9a89];return _0x1eb47b;};'use strict';var _=require('lodash');var util=require(_0x39a4('0x0'));var moment=require(_0x39a4('0x1'));var BPromise=require(_0x39a4('0x2'));var rs=require(_0x39a4('0x3'));var fs=require('fs');var Redis=require(_0x39a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39a4('0x5'));var config=require(_0x39a4('0x6'));var jayson=require(_0x39a4('0x7'));var client=jayson['client'][_0x39a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42e557,_0x574013,_0x13572a){return new BPromise(function(_0x29373b,_0x18e681){return client[_0x39a4('0x9')](_0x42e557,_0x13572a)[_0x39a4('0xa')](function(_0x423064){logger[_0x39a4('0xb')](_0x39a4('0xc'),_0x574013,_0x39a4('0xd'));logger['debug'](_0x39a4('0xe'),_0x574013,'request\x20sent',JSON[_0x39a4('0xf')](_0x423064));if(_0x423064['error']){if(_0x423064[_0x39a4('0x10')][_0x39a4('0x11')]===0x1f4){logger[_0x39a4('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x574013,_0x423064[_0x39a4('0x10')]['message']);return _0x18e681(_0x423064[_0x39a4('0x10')][_0x39a4('0x12')]);}logger[_0x39a4('0x10')](_0x39a4('0xc'),_0x574013,_0x423064[_0x39a4('0x10')][_0x39a4('0x12')]);return _0x29373b(_0x423064[_0x39a4('0x10')]['message']);}else{logger[_0x39a4('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x574013,_0x39a4('0xd'));_0x29373b(_0x423064[_0x39a4('0x13')][_0x39a4('0x12')]);}})['catch'](function(_0x222711){logger[_0x39a4('0x10')](_0x39a4('0xc'),_0x574013,_0x222711);_0x18e681(_0x222711);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 7ea3c3f..1004b64 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 _0x3c1c=['show','post','create','put','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','index','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c1c,0xb1));var _0xc3c1=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0x3c1c[_0x2ce9c3];return _0x109b3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3c1('0x0'));var timeout=require(_0xc3c1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3c1('0x2'));var auth=require(_0xc3c1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc3c1('0x4'));var controller=require(_0xc3c1('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc3c1('0x6')]);router[_0xc3c1('0x7')](_0xc3c1('0x8'),auth[_0xc3c1('0x9')](),controller[_0xc3c1('0xa')]);router[_0xc3c1('0xb')]('/',auth[_0xc3c1('0x9')](),controller[_0xc3c1('0xc')]);router[_0xc3c1('0xd')]('/:id',auth[_0xc3c1('0x9')](),controller['update']);router[_0xc3c1('0xe')]('/:id',auth[_0xc3c1('0x9')](),controller[_0xc3c1('0xf')]);module[_0xc3c1('0x10')]=router; \ No newline at end of file +var _0x8192=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x54fa55,_0x852248){var _0x559bc4=function(_0x2fcefc){while(--_0x2fcefc){_0x54fa55['push'](_0x54fa55['shift']());}};_0x559bc4(++_0x852248);}(_0x8192,0x82));var _0x2819=function(_0x8c0304,_0x3a197c){_0x8c0304=_0x8c0304-0x0;var _0x1a9382=_0x8192[_0x8c0304];return _0x1a9382;};'use strict';var multer=require(_0x2819('0x0'));var util=require(_0x2819('0x1'));var path=require(_0x2819('0x2'));var timeout=require(_0x2819('0x3'));var express=require(_0x2819('0x4'));var router=express['Router']();var fs_extra=require(_0x2819('0x5'));var auth=require(_0x2819('0x6'));var interaction=require(_0x2819('0x7'));var config=require(_0x2819('0x8'));var controller=require(_0x2819('0x9'));router[_0x2819('0xa')]('/',auth[_0x2819('0xb')](),controller[_0x2819('0xc')]);router['get'](_0x2819('0xd'),auth[_0x2819('0xb')](),controller[_0x2819('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2819('0xf')]);router[_0x2819('0x10')](_0x2819('0xd'),auth[_0x2819('0xb')](),controller[_0x2819('0x11')]);router[_0x2819('0x12')](_0x2819('0xd'),auth[_0x2819('0xb')](),controller[_0x2819('0x13')]);module[_0x2819('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 680f1e0..019a6bc 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 _0x0aa7=['name','TEXT','long','type','select','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','alias'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0aa7,0x116));var _0x70aa=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x0aa7[_0x19b84f];return _0x18067b;};'use strict';var Sequelize=require(_0x70aa('0x0'));var _=require(_0x70aa('0x1'));module[_0x70aa('0x2')]={'name':{'type':Sequelize[_0x70aa('0x3')],'get':function(_0x1e55c5){return this[_0x70aa('0x4')]('alias');}},'alias':{'type':Sequelize[_0x70aa('0x5')],'allowNull':![],'set':function(_0x458a66){this['setDataValue'](_0x70aa('0x6'),_0x458a66?_0x458a66:this[_0x70aa('0x4')](_0x70aa('0x7')));}},'type':{'type':Sequelize[_0x70aa('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x70aa('0x8')](_0x70aa('0x9')),'get':function(){if(this[_0x70aa('0x4')](_0x70aa('0xa'))===_0x70aa('0xb')){return JSON['parse'](this[_0x70aa('0x4')](_0x70aa('0xc')));}else{return this[_0x70aa('0x4')](_0x70aa('0xc'));}},'set':function(_0x18db5e){if(Array[_0x70aa('0xd')](_0x18db5e)){this[_0x70aa('0xe')]('values',JSON[_0x70aa('0xf')](_0x18db5e));}else{this[_0x70aa('0xe')](_0x70aa('0xc'),_0x18db5e);}}},'required':{'type':Sequelize[_0x70aa('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x70aa('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x70aa('0x11')](_0x70aa('0x12'))}}; \ No newline at end of file +var _0xd4ba=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','STRING','TEXT','long','type','parse','values','isArray','BOOLEAN','ENUM','voice'];(function(_0x1c8181,_0x424b01){var _0x3d1cb=function(_0x270e8e){while(--_0x270e8e){_0x1c8181['push'](_0x1c8181['shift']());}};_0x3d1cb(++_0x424b01);}(_0xd4ba,0x88));var _0xad4b=function(_0x5d1092,_0x57b1af){_0x5d1092=_0x5d1092-0x0;var _0x23511b=_0xd4ba[_0x5d1092];return _0x23511b;};'use strict';var Sequelize=require(_0xad4b('0x0'));var _=require(_0xad4b('0x1'));module[_0xad4b('0x2')]={'name':{'type':Sequelize[_0xad4b('0x3')],'get':function(_0x517324){return this[_0xad4b('0x4')](_0xad4b('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2ccdc5){this[_0xad4b('0x6')]('alias',_0x2ccdc5?_0x2ccdc5:this[_0xad4b('0x4')]('name'));}},'type':{'type':Sequelize[_0xad4b('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xad4b('0x8')](_0xad4b('0x9')),'get':function(){if(this['getDataValue'](_0xad4b('0xa'))==='select'){return JSON[_0xad4b('0xb')](this[_0xad4b('0x4')]('values'));}else{return this[_0xad4b('0x4')](_0xad4b('0xc'));}},'set':function(_0x41a4ac){if(Array[_0xad4b('0xd')](_0x41a4ac)){this['setDataValue']('values',JSON['stringify'](_0x41a4ac));}else{this['setDataValue'](_0xad4b('0xc'),_0x41a4ac);}}},'required':{'type':Sequelize[_0xad4b('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xad4b('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xad4b('0xf')](_0xad4b('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 610989d..f3a4778 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 _0xbff2=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','body','find','params','create','Sequelize','type','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','model'];(function(_0x4c05f4,_0x1acaa7){var _0x4b2a17=function(_0x5d171c){while(--_0x5d171c){_0x4c05f4['push'](_0x4c05f4['shift']());}};_0x4b2a17(++_0x1acaa7);}(_0xbff2,0x10e));var _0x2bff=function(_0x51bfe2,_0x341912){_0x51bfe2=_0x51bfe2-0x0;var _0x72fd5f=_0xbff2[_0x51bfe2];return _0x72fd5f;};'use strict';var emlformat=require(_0x2bff('0x0'));var rimraf=require(_0x2bff('0x1'));var zipdir=require(_0x2bff('0x2'));var jsonpatch=require(_0x2bff('0x3'));var rp=require(_0x2bff('0x4'));var moment=require(_0x2bff('0x5'));var BPromise=require(_0x2bff('0x6'));var Mustache=require(_0x2bff('0x7'));var util=require(_0x2bff('0x8'));var path=require('path');var sox=require(_0x2bff('0x9'));var csv=require(_0x2bff('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2bff('0xb'));var crypto=require(_0x2bff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2bff('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2bff('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2bff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bff('0x10'))(_0x2bff('0x11'));var utils=require('../../config/utils');var config=require(_0x2bff('0x12'));var licenseUtil=require(_0x2bff('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47f83e,_0x1498e0){_0x1498e0=_0x1498e0||0xcc;return function(_0x2ff7ec){if(_0x2ff7ec){return _0x47f83e['sendStatus'](_0x1498e0);}return _0x47f83e[_0x2bff('0x14')](_0x1498e0)[_0x2bff('0x15')]();};}function respondWithResult(_0x48f9f8,_0x3d3e90){_0x3d3e90=_0x3d3e90||0xc8;return function(_0x3e8399){if(_0x3e8399){return _0x48f9f8[_0x2bff('0x14')](_0x3d3e90)[_0x2bff('0x16')](_0x3e8399);}};}function respondWithFilteredResult(_0x5cf3c1,_0x34b079){return function(_0x348105){if(_0x348105){var _0x25f978=typeof _0x34b079[_0x2bff('0x17')]===_0x2bff('0x18')&&typeof _0x34b079[_0x2bff('0x19')]==='undefined';var _0x19ff4a=_0x348105[_0x2bff('0x1a')];var _0xf7b7b6=_0x25f978?0x0:_0x34b079['offset'];var _0x3886d0=_0x25f978?_0x348105[_0x2bff('0x1a')]:_0x34b079['offset']+_0x34b079[_0x2bff('0x19')];var _0x13406a;if(_0x3886d0>=_0x19ff4a){_0x3886d0=_0x19ff4a;_0x13406a=0xc8;}else{_0x13406a=0xce;}_0x5cf3c1[_0x2bff('0x14')](_0x13406a);return _0x5cf3c1['set']('Content-Range',_0xf7b7b6+'-'+_0x3886d0+'/'+_0x19ff4a)[_0x2bff('0x16')](_0x348105);}return null;};}function patchUpdates(_0x1f3bd9){return function(_0x52d07d){try{jsonpatch[_0x2bff('0x1b')](_0x52d07d,_0x1f3bd9,!![]);}catch(_0x49e763){return BPromise['reject'](_0x49e763);}return _0x52d07d[_0x2bff('0x1c')]();};}function saveUpdates(_0x26c836,_0xd751ab){return function(_0x2a446b){if(_0x2a446b){return _0x2a446b[_0x2bff('0x1d')](_0x26c836)[_0x2bff('0x1e')](function(_0x33ab51){return _0x33ab51;});}return null;};}function removeEntity(_0x429fb5,_0x290933){return function(_0x42c9c2){if(_0x42c9c2){return _0x42c9c2[_0x2bff('0x1f')]()[_0x2bff('0x1e')](function(){_0x429fb5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29062d,_0x314717){return function(_0x4c6a91){if(!_0x4c6a91){_0x29062d[_0x2bff('0x20')](0x194);}return _0x4c6a91;};}function handleError(_0x52768a,_0x11f5b8){_0x11f5b8=_0x11f5b8||0x1f4;return function(_0x59147b){logger[_0x2bff('0x21')](_0x59147b[_0x2bff('0x22')]);if(_0x59147b['name']){delete _0x59147b[_0x2bff('0x23')];}_0x52768a[_0x2bff('0x14')](_0x11f5b8)[_0x2bff('0x24')](_0x59147b);};}exports[_0x2bff('0x25')]=function(_0x2204ad,_0x354d1c){var _0x5a93fa={},_0x5c2b38={},_0x5e8c69={'count':0x0,'rows':[]};var _0x3e4b7e=_[_0x2bff('0x26')](db[_0x2bff('0x27')][_0x2bff('0x28')],function(_0x3558e4){return{'name':_0x3558e4['fieldName'],'type':_0x3558e4['type']['key']};});_0x5c2b38[_0x2bff('0x29')]=_['differenceBy'](_['map'](_0x3e4b7e,'name'),[_0x2bff('0x23')]);_0x5c2b38[_0x2bff('0x2a')]=_[_0x2bff('0x2b')](_0x2204ad[_0x2bff('0x2a')]);_0x5c2b38[_0x2bff('0x2c')]=_[_0x2bff('0x2d')](_0x5c2b38[_0x2bff('0x29')],_0x5c2b38[_0x2bff('0x2a')]);_0x5a93fa[_0x2bff('0x2e')]=_[_0x2bff('0x2d')](_0x5c2b38[_0x2bff('0x29')],qs[_0x2bff('0x2f')](_0x2204ad[_0x2bff('0x2a')][_0x2bff('0x2f')]));_0x5a93fa['attributes']=_0x5a93fa[_0x2bff('0x2e')][_0x2bff('0x30')]?_0x5a93fa[_0x2bff('0x2e')]:_0x5c2b38['model'];if(!_0x2204ad[_0x2bff('0x2a')]['hasOwnProperty'](_0x2bff('0x31'))){_0x5a93fa[_0x2bff('0x19')]=qs[_0x2bff('0x19')](_0x2204ad[_0x2bff('0x2a')][_0x2bff('0x19')]);_0x5a93fa['offset']=qs[_0x2bff('0x17')](_0x2204ad[_0x2bff('0x2a')][_0x2bff('0x17')]);}_0x5a93fa[_0x2bff('0x32')]=qs['sort'](_0x2204ad[_0x2bff('0x2a')]['sort']);_0x5a93fa['where']=qs[_0x2bff('0x2c')](_['pick'](_0x2204ad['query'],_0x5c2b38[_0x2bff('0x2c')]),_0x3e4b7e);if(_0x2204ad[_0x2bff('0x2a')][_0x2bff('0x33')]){_0x5a93fa[_0x2bff('0x34')]=_['merge'](_0x5a93fa[_0x2bff('0x34')],{'$or':_[_0x2bff('0x26')](_0x3e4b7e,function(_0x9fa777){if(_0x9fa777['type']!==_0x2bff('0x35')){var _0x2fbabe={};_0x2fbabe[_0x9fa777[_0x2bff('0x23')]]={'$like':'%'+_0x2204ad[_0x2bff('0x2a')]['filter']+'%'};return _0x2fbabe;}})});}_0x5a93fa=_[_0x2bff('0x36')]({},_0x5a93fa,_0x2204ad[_0x2bff('0x37')]);var _0x5f13b5={'where':_0x5a93fa[_0x2bff('0x34')]};return db[_0x2bff('0x27')][_0x2bff('0x1a')](_0x5f13b5)[_0x2bff('0x1e')](function(_0x33935c){_0x5e8c69[_0x2bff('0x1a')]=_0x33935c;if(_0x2204ad[_0x2bff('0x2a')][_0x2bff('0x38')]){_0x5a93fa[_0x2bff('0x39')]=[{'all':!![]}];}return db[_0x2bff('0x27')][_0x2bff('0x3a')](_0x5a93fa);})[_0x2bff('0x1e')](function(_0xf4396e){_0x5e8c69[_0x2bff('0x3b')]=_0xf4396e;return _0x5e8c69;})[_0x2bff('0x1e')](respondWithFilteredResult(_0x354d1c,_0x5a93fa))[_0x2bff('0x3c')](handleError(_0x354d1c,null));};exports[_0x2bff('0x3d')]=function(_0x800a76,_0x14be36){var _0x1369a9={'raw':!![],'where':{'id':_0x800a76['params']['id']}},_0x390762={};_0x390762[_0x2bff('0x29')]=_[_0x2bff('0x2b')](db[_0x2bff('0x27')][_0x2bff('0x28')]);_0x390762[_0x2bff('0x2a')]=_[_0x2bff('0x2b')](_0x800a76[_0x2bff('0x2a')]);_0x390762[_0x2bff('0x2c')]=_[_0x2bff('0x2d')](_0x390762['model'],_0x390762['query']);_0x1369a9[_0x2bff('0x2e')]=_[_0x2bff('0x2d')](_0x390762[_0x2bff('0x29')],qs[_0x2bff('0x2f')](_0x800a76['query'][_0x2bff('0x2f')]));_0x1369a9[_0x2bff('0x2e')]=_0x1369a9[_0x2bff('0x2e')][_0x2bff('0x30')]?_0x1369a9[_0x2bff('0x2e')]:_0x390762['model'];if(_0x800a76[_0x2bff('0x2a')]['includeAll']){_0x1369a9[_0x2bff('0x39')]=[{'all':!![]}];}_0x1369a9=_[_0x2bff('0x36')]({},_0x1369a9,_0x800a76[_0x2bff('0x37')]);return db[_0x2bff('0x27')]['find'](_0x1369a9)['then'](handleEntityNotFound(_0x14be36,null))['then'](respondWithResult(_0x14be36,null))['catch'](handleError(_0x14be36,null));};exports[_0x2bff('0x1d')]=function(_0x2ffb29,_0x37b784){if(_0x2ffb29['body']['id']){delete _0x2ffb29[_0x2bff('0x3e')]['id'];}return db[_0x2bff('0x27')][_0x2bff('0x3f')]({'where':{'id':_0x2ffb29[_0x2bff('0x40')]['id']}})[_0x2bff('0x1e')](handleEntityNotFound(_0x37b784,null))[_0x2bff('0x1e')](saveUpdates(_0x2ffb29['body'],null))[_0x2bff('0x1e')](respondWithResult(_0x37b784,null))[_0x2bff('0x3c')](handleError(_0x37b784,null));};exports[_0x2bff('0x1f')]=function(_0xc44470,_0x293efb){return db[_0x2bff('0x27')][_0x2bff('0x3f')]({'where':{'id':_0xc44470['params']['id']}})[_0x2bff('0x1e')](handleEntityNotFound(_0x293efb,null))['then'](removeEntity(_0x293efb,null))[_0x2bff('0x3c')](handleError(_0x293efb,null));};exports[_0x2bff('0x41')]=function(_0x14e9bb,_0x4d650c){var _0x9ea4fc;return db['sequelize']['transaction'](function(_0x21ec1f){return db[_0x2bff('0x27')][_0x2bff('0x41')](_0x14e9bb['body'],{'transaction':_0x21ec1f})[_0x2bff('0x1e')](function(_0x4ac6b5){_0x9ea4fc=_0x4ac6b5;var _0x454e00={'type':db[_0x2bff('0x42')]['TEXT'],'transaction':_0x21ec1f};switch(_0x14e9bb['body'][_0x2bff('0x43')]){case _0x2bff('0x44'):_0x454e00[_0x2bff('0x43')]=db[_0x2bff('0x42')][_0x2bff('0x45')];break;case'number':_0x454e00[_0x2bff('0x43')]=db[_0x2bff('0x42')][_0x2bff('0x46')];break;case _0x2bff('0x47'):_0x454e00['type']=db[_0x2bff('0x42')][_0x2bff('0x48')];_0x454e00[_0x2bff('0x49')]=![];break;default:}return db['sequelize'][_0x2bff('0x4a')][_0x2bff('0x4b')]('cm_contacts',util[_0x2bff('0x4c')](_0x2bff('0x4d'),_0x9ea4fc['id']),_0x454e00);})[_0x2bff('0x1e')](function(){return _0x9ea4fc;});})['then'](respondWithResult(_0x4d650c,0xc9))['catch'](handleError(_0x4d650c,null));}; \ No newline at end of file +var _0x2d6e=['switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../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','save','update','then','end','error','stack','name','send','index','CmCustomField','fieldName','type','key','differenceBy','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','include','show','keys','rawAttributes','body','find','params','destroy','transaction','create','text','Sequelize','TEXT','number','INTEGER'];(function(_0x436b6e,_0x30ccab){var _0x3fe68d=function(_0x4cc0a9){while(--_0x4cc0a9){_0x436b6e['push'](_0x436b6e['shift']());}};_0x3fe68d(++_0x30ccab);}(_0x2d6e,0xb3));var _0xe2d6=function(_0x5db269,_0x3df0ad){_0x5db269=_0x5db269-0x0;var _0x1f5787=_0x2d6e[_0x5db269];return _0x1f5787;};'use strict';var emlformat=require(_0xe2d6('0x0'));var rimraf=require(_0xe2d6('0x1'));var zipdir=require(_0xe2d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2d6('0x3'));var moment=require(_0xe2d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2d6('0x5'));var util=require(_0xe2d6('0x6'));var path=require(_0xe2d6('0x7'));var sox=require(_0xe2d6('0x8'));var csv=require(_0xe2d6('0x9'));var ejs=require(_0xe2d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2d6('0xb'));var squel=require(_0xe2d6('0xc'));var crypto=require('crypto');var jsforce=require(_0xe2d6('0xd'));var deskjs=require(_0xe2d6('0xe'));var toCsv=require(_0xe2d6('0x9'));var querystring=require(_0xe2d6('0xf'));var Papa=require(_0xe2d6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2d6('0x11'));var hardwareService=require(_0xe2d6('0x12'));var logger=require(_0xe2d6('0x13'))(_0xe2d6('0x14'));var utils=require(_0xe2d6('0x15'));var config=require(_0xe2d6('0x16'));var licenseUtil=require(_0xe2d6('0x17'));var db=require(_0xe2d6('0x18'))['db'];function respondWithStatusCode(_0x240d05,_0x5c9cbd){_0x5c9cbd=_0x5c9cbd||0xcc;return function(_0x596573){if(_0x596573){return _0x240d05[_0xe2d6('0x19')](_0x5c9cbd);}return _0x240d05[_0xe2d6('0x1a')](_0x5c9cbd)['end']();};}function respondWithResult(_0x1e2c96,_0x2d0820){_0x2d0820=_0x2d0820||0xc8;return function(_0x39b468){if(_0x39b468){return _0x1e2c96[_0xe2d6('0x1a')](_0x2d0820)[_0xe2d6('0x1b')](_0x39b468);}};}function respondWithFilteredResult(_0x2b9d5e,_0x11db4f){return function(_0xae67a){if(_0xae67a){var _0x57e6c0=typeof _0x11db4f[_0xe2d6('0x1c')]===_0xe2d6('0x1d')&&typeof _0x11db4f['limit']==='undefined';var _0x1298bf=_0xae67a[_0xe2d6('0x1e')];var _0x12fdd2=_0x57e6c0?0x0:_0x11db4f['offset'];var _0x50e43a=_0x57e6c0?_0xae67a[_0xe2d6('0x1e')]:_0x11db4f[_0xe2d6('0x1c')]+_0x11db4f[_0xe2d6('0x1f')];var _0x48795e;if(_0x50e43a>=_0x1298bf){_0x50e43a=_0x1298bf;_0x48795e=0xc8;}else{_0x48795e=0xce;}_0x2b9d5e[_0xe2d6('0x1a')](_0x48795e);return _0x2b9d5e['set'](_0xe2d6('0x20'),_0x12fdd2+'-'+_0x50e43a+'/'+_0x1298bf)[_0xe2d6('0x1b')](_0xae67a);}return null;};}function patchUpdates(_0x36abdd){return function(_0x49347b){try{jsonpatch[_0xe2d6('0x21')](_0x49347b,_0x36abdd,!![]);}catch(_0xcd2f67){return BPromise[_0xe2d6('0x22')](_0xcd2f67);}return _0x49347b[_0xe2d6('0x23')]();};}function saveUpdates(_0x401491,_0x1689b9){return function(_0x20ee14){if(_0x20ee14){return _0x20ee14[_0xe2d6('0x24')](_0x401491)[_0xe2d6('0x25')](function(_0x2e7e68){return _0x2e7e68;});}return null;};}function removeEntity(_0x378877,_0x2e8063){return function(_0xc0d58f){if(_0xc0d58f){return _0xc0d58f['destroy']()[_0xe2d6('0x25')](function(){_0x378877[_0xe2d6('0x1a')](0xcc)[_0xe2d6('0x26')]();});}};}function handleEntityNotFound(_0x2d2ffb,_0x42e38d){return function(_0xa6dfd0){if(!_0xa6dfd0){_0x2d2ffb[_0xe2d6('0x19')](0x194);}return _0xa6dfd0;};}function handleError(_0x59f329,_0x5f242b){_0x5f242b=_0x5f242b||0x1f4;return function(_0xfb8e92){logger[_0xe2d6('0x27')](_0xfb8e92[_0xe2d6('0x28')]);if(_0xfb8e92[_0xe2d6('0x29')]){delete _0xfb8e92[_0xe2d6('0x29')];}_0x59f329[_0xe2d6('0x1a')](_0x5f242b)[_0xe2d6('0x2a')](_0xfb8e92);};}exports[_0xe2d6('0x2b')]=function(_0x62f992,_0x315402){var _0x821d56={},_0x1916c3={},_0x51ae2d={'count':0x0,'rows':[]};var _0x128d33=_['map'](db[_0xe2d6('0x2c')]['rawAttributes'],function(_0x31956a){return{'name':_0x31956a[_0xe2d6('0x2d')],'type':_0x31956a[_0xe2d6('0x2e')][_0xe2d6('0x2f')]};});_0x1916c3['model']=_[_0xe2d6('0x30')](_[_0xe2d6('0x31')](_0x128d33,_0xe2d6('0x29')),[_0xe2d6('0x29')]);_0x1916c3['query']=_['keys'](_0x62f992[_0xe2d6('0x32')]);_0x1916c3[_0xe2d6('0x33')]=_[_0xe2d6('0x34')](_0x1916c3[_0xe2d6('0x35')],_0x1916c3[_0xe2d6('0x32')]);_0x821d56[_0xe2d6('0x36')]=_['intersection'](_0x1916c3[_0xe2d6('0x35')],qs[_0xe2d6('0x37')](_0x62f992[_0xe2d6('0x32')]['fields']));_0x821d56[_0xe2d6('0x36')]=_0x821d56[_0xe2d6('0x36')][_0xe2d6('0x38')]?_0x821d56[_0xe2d6('0x36')]:_0x1916c3[_0xe2d6('0x35')];if(!_0x62f992[_0xe2d6('0x32')]['hasOwnProperty'](_0xe2d6('0x39'))){_0x821d56[_0xe2d6('0x1f')]=qs['limit'](_0x62f992[_0xe2d6('0x32')][_0xe2d6('0x1f')]);_0x821d56['offset']=qs[_0xe2d6('0x1c')](_0x62f992[_0xe2d6('0x32')][_0xe2d6('0x1c')]);}_0x821d56[_0xe2d6('0x3a')]=qs[_0xe2d6('0x3b')](_0x62f992[_0xe2d6('0x32')][_0xe2d6('0x3b')]);_0x821d56[_0xe2d6('0x3c')]=qs['filters'](_['pick'](_0x62f992[_0xe2d6('0x32')],_0x1916c3[_0xe2d6('0x33')]),_0x128d33);if(_0x62f992[_0xe2d6('0x32')]['filter']){_0x821d56['where']=_[_0xe2d6('0x3d')](_0x821d56['where'],{'$or':_[_0xe2d6('0x31')](_0x128d33,function(_0x22beb9){if(_0x22beb9[_0xe2d6('0x2e')]!==_0xe2d6('0x3e')){var _0x1bff96={};_0x1bff96[_0x22beb9[_0xe2d6('0x29')]]={'$like':'%'+_0x62f992[_0xe2d6('0x32')]['filter']+'%'};return _0x1bff96;}})});}_0x821d56=_[_0xe2d6('0x3d')]({},_0x821d56,_0x62f992[_0xe2d6('0x3f')]);var _0xa2ac15={'where':_0x821d56[_0xe2d6('0x3c')]};return db[_0xe2d6('0x2c')][_0xe2d6('0x1e')](_0xa2ac15)[_0xe2d6('0x25')](function(_0xd09a30){_0x51ae2d[_0xe2d6('0x1e')]=_0xd09a30;if(_0x62f992[_0xe2d6('0x32')]['includeAll']){_0x821d56[_0xe2d6('0x40')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x821d56);})[_0xe2d6('0x25')](function(_0x565758){_0x51ae2d['rows']=_0x565758;return _0x51ae2d;})[_0xe2d6('0x25')](respondWithFilteredResult(_0x315402,_0x821d56))['catch'](handleError(_0x315402,null));};exports[_0xe2d6('0x41')]=function(_0xa2bca3,_0x344c25){var _0x49763f={'raw':!![],'where':{'id':_0xa2bca3['params']['id']}},_0x514e25={};_0x514e25[_0xe2d6('0x35')]=_[_0xe2d6('0x42')](db[_0xe2d6('0x2c')][_0xe2d6('0x43')]);_0x514e25[_0xe2d6('0x32')]=_[_0xe2d6('0x42')](_0xa2bca3['query']);_0x514e25[_0xe2d6('0x33')]=_[_0xe2d6('0x34')](_0x514e25['model'],_0x514e25[_0xe2d6('0x32')]);_0x49763f[_0xe2d6('0x36')]=_[_0xe2d6('0x34')](_0x514e25['model'],qs['fields'](_0xa2bca3[_0xe2d6('0x32')][_0xe2d6('0x37')]));_0x49763f[_0xe2d6('0x36')]=_0x49763f['attributes'][_0xe2d6('0x38')]?_0x49763f[_0xe2d6('0x36')]:_0x514e25['model'];if(_0xa2bca3[_0xe2d6('0x32')]['includeAll']){_0x49763f['include']=[{'all':!![]}];}_0x49763f=_[_0xe2d6('0x3d')]({},_0x49763f,_0xa2bca3[_0xe2d6('0x3f')]);return db[_0xe2d6('0x2c')]['find'](_0x49763f)[_0xe2d6('0x25')](handleEntityNotFound(_0x344c25,null))[_0xe2d6('0x25')](respondWithResult(_0x344c25,null))['catch'](handleError(_0x344c25,null));};exports[_0xe2d6('0x24')]=function(_0x28fc08,_0x256ecd){if(_0x28fc08[_0xe2d6('0x44')]['id']){delete _0x28fc08[_0xe2d6('0x44')]['id'];}return db['CmCustomField'][_0xe2d6('0x45')]({'where':{'id':_0x28fc08[_0xe2d6('0x46')]['id']}})[_0xe2d6('0x25')](handleEntityNotFound(_0x256ecd,null))[_0xe2d6('0x25')](saveUpdates(_0x28fc08['body'],null))[_0xe2d6('0x25')](respondWithResult(_0x256ecd,null))['catch'](handleError(_0x256ecd,null));};exports[_0xe2d6('0x47')]=function(_0x3b54bd,_0x5977c1){return db[_0xe2d6('0x2c')][_0xe2d6('0x45')]({'where':{'id':_0x3b54bd['params']['id']}})[_0xe2d6('0x25')](handleEntityNotFound(_0x5977c1,null))['then'](removeEntity(_0x5977c1,null))['catch'](handleError(_0x5977c1,null));};exports['create']=function(_0x18b390,_0x92fb89){var _0x20b43d;return db['sequelize'][_0xe2d6('0x48')](function(_0x59e307){return db[_0xe2d6('0x2c')][_0xe2d6('0x49')](_0x18b390['body'],{'transaction':_0x59e307})[_0xe2d6('0x25')](function(_0x4f9f04){_0x20b43d=_0x4f9f04;var _0x43d920={'type':db['Sequelize']['TEXT'],'transaction':_0x59e307};switch(_0x18b390[_0xe2d6('0x44')]['type']){case _0xe2d6('0x4a'):_0x43d920[_0xe2d6('0x2e')]=db[_0xe2d6('0x4b')][_0xe2d6('0x4c')];break;case _0xe2d6('0x4d'):_0x43d920['type']=db[_0xe2d6('0x4b')][_0xe2d6('0x4e')];break;case _0xe2d6('0x4f'):_0x43d920[_0xe2d6('0x2e')]=db[_0xe2d6('0x4b')][_0xe2d6('0x50')];_0x43d920['defaultValue']=![];break;default:}return db[_0xe2d6('0x51')][_0xe2d6('0x52')][_0xe2d6('0x53')](_0xe2d6('0x54'),util[_0xe2d6('0x55')]('cf_%d',_0x20b43d['id']),_0x43d920);})[_0xe2d6('0x25')](function(){return _0x20b43d;});})[_0xe2d6('0x25')](respondWithResult(_0x92fb89,0xc9))['catch'](handleError(_0x92fb89,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f03ae5c..da9aa2e 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 _0x25c4=['api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x4e369b,_0x2b126c){var _0x4af7d1=function(_0x127558){while(--_0x127558){_0x4e369b['push'](_0x4e369b['shift']());}};_0x4af7d1(++_0x2b126c);}(_0x25c4,0x183));var _0x425c=function(_0x479f47,_0x3d619a){_0x479f47=_0x479f47-0x0;var _0xc3fac2=_0x25c4[_0x479f47];return _0xc3fac2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x425c('0x0'));var moment=require(_0x425c('0x1'));var BPromise=require(_0x425c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425c('0x3'));var rimraf=require(_0x425c('0x4'));var config=require(_0x425c('0x5'));var attributes=require(_0x425c('0x6'));module[_0x425c('0x7')]=function(_0x2d7479,_0x10ce77){return _0x2d7479[_0x425c('0x8')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac36=['path','rimraf','../../config/environment','exports','define','CmCustomField','util','api','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac36,0x114));var _0x6ac3=function(_0x4e8e61,_0x510bdd){_0x4e8e61=_0x4e8e61-0x0;var _0x362dbc=_0xac36[_0x4e8e61];return _0x362dbc;};'use strict';var _=require('lodash');var util=require(_0x6ac3('0x0'));var logger=require('../../config/logger')(_0x6ac3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ac3('0x2'));var fs=require('fs');var path=require(_0x6ac3('0x3'));var rimraf=require(_0x6ac3('0x4'));var config=require(_0x6ac3('0x5'));var attributes=require('./cmCustomField.attributes');module[_0x6ac3('0x6')]=function(_0x4177be,_0x27f0fc){return _0x4177be[_0x6ac3('0x7')](_0x6ac3('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index c3f1c9c..c0ca27c 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 _0xbdaf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','code','CmCustomField,\x20%s,\x20%s','message','bluebird','randomstring'];(function(_0x25ad6a,_0x731fc0){var _0x349e43=function(_0x5893ee){while(--_0x5893ee){_0x25ad6a['push'](_0x25ad6a['shift']());}};_0x349e43(++_0x731fc0);}(_0xbdaf,0x1ae));var _0xfbda=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xbdaf[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfbda('0x0'));var rs=require(_0xfbda('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbda('0x2'));var logger=require(_0xfbda('0x3'))(_0xfbda('0x4'));var config=require(_0xfbda('0x5'));var jayson=require(_0xfbda('0x6'));var client=jayson[_0xfbda('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5789,_0x1f1a19,_0x281784){return new BPromise(function(_0x3816b2,_0x204fe9){return client[_0xfbda('0x8')](_0x4d5789,_0x281784)['then'](function(_0x5202a3){logger[_0xfbda('0x9')]('CmCustomField,\x20%s,\x20%s',_0x1f1a19,_0xfbda('0xa'));logger[_0xfbda('0xb')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1f1a19,_0xfbda('0xa'),JSON['stringify'](_0x5202a3));if(_0x5202a3[_0xfbda('0xc')]){if(_0x5202a3[_0xfbda('0xc')][_0xfbda('0xd')]===0x1f4){logger[_0xfbda('0xc')](_0xfbda('0xe'),_0x1f1a19,_0x5202a3['error'][_0xfbda('0xf')]);return _0x204fe9(_0x5202a3[_0xfbda('0xc')][_0xfbda('0xf')]);}logger[_0xfbda('0xc')](_0xfbda('0xe'),_0x1f1a19,_0x5202a3[_0xfbda('0xc')][_0xfbda('0xf')]);return _0x3816b2(_0x5202a3[_0xfbda('0xc')][_0xfbda('0xf')]);}else{logger[_0xfbda('0x9')](_0xfbda('0xe'),_0x1f1a19,_0xfbda('0xa'));_0x3816b2(_0x5202a3['result'][_0xfbda('0xf')]);}})['catch'](function(_0x5e80dd){logger[_0xfbda('0xc')](_0xfbda('0xe'),_0x1f1a19,_0x5e80dd);_0x204fe9(_0x5e80dd);});});} \ No newline at end of file +var _0x7e13=['message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x33fe98,_0x4c43b6){var _0x347952=function(_0x42b834){while(--_0x42b834){_0x33fe98['push'](_0x33fe98['shift']());}};_0x347952(++_0x4c43b6);}(_0x7e13,0x173));var _0x37e1=function(_0xe42011,_0x45e2f8){_0xe42011=_0xe42011-0x0;var _0x1b4619=_0x7e13[_0xe42011];return _0x1b4619;};'use strict';var _=require(_0x37e1('0x0'));var util=require(_0x37e1('0x1'));var moment=require(_0x37e1('0x2'));var BPromise=require(_0x37e1('0x3'));var rs=require(_0x37e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37e1('0x5'))(_0x37e1('0x6'));var config=require(_0x37e1('0x7'));var jayson=require(_0x37e1('0x8'));var client=jayson[_0x37e1('0x9')][_0x37e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46811f,_0x51ffd8,_0x404f48){return new BPromise(function(_0x2b2e41,_0x5db99d){return client[_0x37e1('0xb')](_0x46811f,_0x404f48)[_0x37e1('0xc')](function(_0x3c53be){logger[_0x37e1('0xd')](_0x37e1('0xe'),_0x51ffd8,'request\x20sent');logger[_0x37e1('0xf')](_0x37e1('0x10'),_0x51ffd8,'request\x20sent',JSON[_0x37e1('0x11')](_0x3c53be));if(_0x3c53be['error']){if(_0x3c53be['error'][_0x37e1('0x12')]===0x1f4){logger['error'](_0x37e1('0xe'),_0x51ffd8,_0x3c53be[_0x37e1('0x13')][_0x37e1('0x14')]);return _0x5db99d(_0x3c53be[_0x37e1('0x13')][_0x37e1('0x14')]);}logger['error'](_0x37e1('0xe'),_0x51ffd8,_0x3c53be['error'][_0x37e1('0x14')]);return _0x2b2e41(_0x3c53be[_0x37e1('0x13')][_0x37e1('0x14')]);}else{logger[_0x37e1('0xd')](_0x37e1('0xe'),_0x51ffd8,_0x37e1('0x15'));_0x2b2e41(_0x3c53be['result'][_0x37e1('0x14')]);}})[_0x37e1('0x16')](function(_0x4fa26e){logger[_0x37e1('0x13')](_0x37e1('0xe'),_0x51ffd8,_0x4fa26e);_0x5db99d(_0x4fa26e);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 560f812..e150384 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 _0xbd3c=['path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','multer','util'];(function(_0x2caa8b,_0x3213ab){var _0x4d3644=function(_0x271c96){while(--_0x271c96){_0x2caa8b['push'](_0x2caa8b['shift']());}};_0x4d3644(++_0x3213ab);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x3fdf02,_0x3baf28){_0x3fdf02=_0x3fdf02-0x0;var _0x8d63b8=_0xbd3c[_0x3fdf02];return _0x8d63b8;};'use strict';var multer=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var path=require(_0xcbd3('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbd3('0x3'));var router=express[_0xcbd3('0x4')]();var fs_extra=require(_0xcbd3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcbd3('0x6'));var controller=require('./cmCustomField.controller');router[_0xcbd3('0x7')]('/',auth[_0xcbd3('0x8')](),controller['index']);router[_0xcbd3('0x7')](_0xcbd3('0x9'),auth[_0xcbd3('0x8')](),controller['show']);router[_0xcbd3('0xa')]('/',auth[_0xcbd3('0x8')](),controller[_0xcbd3('0xb')]);router[_0xcbd3('0xc')](_0xcbd3('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xcbd3('0xd')](_0xcbd3('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc949=['create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x29784b,_0x42a97c){var _0x30ad1b=function(_0x4922d0){while(--_0x4922d0){_0x29784b['push'](_0x29784b['shift']());}};_0x30ad1b(++_0x42a97c);}(_0xc949,0x181));var _0x9c94=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc949[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0xd')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['delete'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);module[_0x9c94('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 9a62fa8..e0405e9 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 _0x165a=['contactListQueue','moment','sequelize','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x1e359f,_0x5e5ec9){var _0x37754d=function(_0x286c15){while(--_0x286c15){_0x1e359f['push'](_0x1e359f['shift']());}};_0x37754d(++_0x5e5ec9);}(_0x165a,0xc7));var _0xa165=function(_0x4ddec9,_0x2bb67e){_0x4ddec9=_0x4ddec9-0x0;var _0x3785b6=_0x165a[_0x4ddec9];return _0x3785b6;};'use strict';var moment=require(_0xa165('0x0'));var Sequelize=require(_0xa165('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa165('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa165('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xa165('0x4')](_0xa165('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa165('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa165('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa165('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa165('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa165('0x6')],'unique':_0xa165('0x8')},'ListId':{'type':Sequelize[_0xa165('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xa165('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xa165('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xa165('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa165('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa165('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa165('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa165('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd35d=['DATE','UNSIGNED','contactListQueue','STRING','exports','format','INTEGER','BOOLEAN'];(function(_0x3074da,_0x50b231){var _0x607d7=function(_0x56e6b2){while(--_0x56e6b2){_0x3074da['push'](_0x3074da['shift']());}};_0x607d7(++_0x50b231);}(_0xd35d,0xd4));var _0xdd35=function(_0x11ec6c,_0x1a8169){_0x11ec6c=_0x11ec6c-0x0;var _0xb59506=_0xd35d[_0x11ec6c];return _0xb59506;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xdd35('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xdd35('0x1')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd35('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdd35('0x2')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdd35('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd35('0x4')]},'priority':{'type':Sequelize[_0xdd35('0x2')](0x2)[_0xdd35('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdd35('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xdd35('0x2')],'unique':_0xdd35('0x6')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xdd35('0x2')],'unique':_0xdd35('0x6')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xdd35('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd35('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdd35('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0xdd35('0x4')],'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 28439d9..2adcc38 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 _0xfc76=['destroy','end','getPreview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','List','dialActive','getPreviewRecall','transaction','Company','CmList','Queue','getOpenContacts','getVoiceQueues','outbound','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','timezones','json','getTimezone','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','index','map','CmHopper','rawAttributes','fieldName','key','model','keys','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc76,0xb5));var _0x6fc7=function(_0x56f125,_0x3816ce){_0x56f125=_0x56f125-0x0;var _0x56b35d=_0xfc76[_0x56f125];return _0x56b35d;};'use strict';var moment=require('moment');var _=require(_0x6fc7('0x0'));var qs=require(_0x6fc7('0x1'));var logger=require(_0x6fc7('0x2'))(_0x6fc7('0x3'));var shared=require(_0x6fc7('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x316cc4,_0x40d212){_0x40d212=_0x40d212||0xc8;return function(_0x51280c){if(_0x51280c){return _0x316cc4[_0x6fc7('0x5')](_0x40d212)['json'](_0x51280c);}};}function respondWithFilteredResult(_0xe8177b,_0x82a35a){return function(_0x385a5a){if(_0x385a5a){var _0x4da7c3=typeof _0x82a35a[_0x6fc7('0x6')]===_0x6fc7('0x7')&&typeof _0x82a35a[_0x6fc7('0x8')]===_0x6fc7('0x7');var _0x36cb16=_0x385a5a[_0x6fc7('0x9')];var _0x4de75e=_0x4da7c3?0x0:_0x82a35a[_0x6fc7('0x6')];var _0x61730a=_0x4da7c3?_0x385a5a[_0x6fc7('0x9')]:_0x82a35a[_0x6fc7('0x6')]+_0x82a35a[_0x6fc7('0x8')];var _0x3c067c;if(_0x61730a>=_0x36cb16){_0x61730a=_0x36cb16;_0x3c067c=0xc8;}else{_0x3c067c=0xce;}_0xe8177b['status'](_0x3c067c);return _0xe8177b[_0x6fc7('0xa')](_0x6fc7('0xb'),_0x4de75e+'-'+_0x61730a+'/'+_0x36cb16)['json'](_0x385a5a);}return null;};}function saveUpdates(_0x433adc,_0x2c32b8){return function(_0x5f438d){if(_0x5f438d){return _0x5f438d[_0x6fc7('0xc')](_0x433adc)[_0x6fc7('0xd')](function(_0x4af729){return _0x4af729;});}return null;};}function handleEntityNotFound(_0x44d8e0,_0x3c107f){return function(_0x10a482){if(!_0x10a482){_0x44d8e0['sendStatus'](0x194);}return _0x10a482;};}function handleError(_0x556e28,_0xbb4a3e){_0xbb4a3e=_0xbb4a3e||0x1f4;return function(_0x45d585){logger['error'](_0x45d585[_0x6fc7('0xe')]);if(_0x45d585[_0x6fc7('0xf')]){delete _0x45d585[_0x6fc7('0xf')];}_0x556e28[_0x6fc7('0x5')](_0xbb4a3e)['send'](_0x45d585);};}exports[_0x6fc7('0x10')]=function(_0x69ea70,_0x280c69){var _0x62ec76={},_0x12be21={},_0x4258f0={'count':0x0,'rows':[]};var _0x59bb98=_[_0x6fc7('0x11')](db[_0x6fc7('0x12')][_0x6fc7('0x13')],function(_0x3bd771){return{'name':_0x3bd771[_0x6fc7('0x14')],'type':_0x3bd771['type'][_0x6fc7('0x15')]};});_0x12be21[_0x6fc7('0x16')]=_['map'](_0x59bb98,_0x6fc7('0xf'));_0x12be21['query']=_[_0x6fc7('0x17')](_0x69ea70['query']);_0x12be21[_0x6fc7('0x18')]=_[_0x6fc7('0x19')](_0x12be21[_0x6fc7('0x16')],_0x12be21['query']);_0x12be21[_0x6fc7('0x18')]=_['concat'](_0x12be21[_0x6fc7('0x18')],[_0x6fc7('0x1a'),_0x6fc7('0x1b'),_0x6fc7('0x1c'),_0x6fc7('0x1d'),_0x6fc7('0x1e'),_0x6fc7('0x1f'),_0x6fc7('0x20'),_0x6fc7('0x21'),_0x6fc7('0x22'),_0x6fc7('0x23'),_0x6fc7('0x24'),_0x6fc7('0x25'),_0x6fc7('0x26'),_0x6fc7('0x27'),'$notLike',_0x6fc7('0x28'),_0x6fc7('0x29'),_0x6fc7('0x27'),_0x6fc7('0x2a'),'$contains',_0x6fc7('0x2b'),_0x6fc7('0x2c')]);_0x62ec76[_0x6fc7('0x2d')]=_[_0x6fc7('0x19')](_0x12be21[_0x6fc7('0x16')],qs[_0x6fc7('0x2e')](_0x69ea70[_0x6fc7('0x2f')][_0x6fc7('0x2e')]));_0x62ec76['attributes']=_0x62ec76['attributes'][_0x6fc7('0x30')]?_0x62ec76[_0x6fc7('0x2d')]:_0x12be21[_0x6fc7('0x16')];if(!_0x69ea70[_0x6fc7('0x2f')][_0x6fc7('0x31')](_0x6fc7('0x32'))){_0x62ec76['limit']=qs[_0x6fc7('0x8')](_0x69ea70[_0x6fc7('0x2f')][_0x6fc7('0x8')]);_0x62ec76[_0x6fc7('0x6')]=qs['offset'](_0x69ea70['query']['offset']);}_0x62ec76[_0x6fc7('0x33')]=qs[_0x6fc7('0x34')](_0x69ea70[_0x6fc7('0x2f')][_0x6fc7('0x34')]);_0x62ec76[_0x6fc7('0x35')]=qs[_0x6fc7('0x18')](_[_0x6fc7('0x36')](_0x69ea70[_0x6fc7('0x2f')],_0x12be21[_0x6fc7('0x18')]),_0x59bb98);if(_0x69ea70['query'][_0x6fc7('0x37')]){_0x62ec76['where']=_[_0x6fc7('0x38')](_0x62ec76[_0x6fc7('0x35')],{'$or':_[_0x6fc7('0x11')](_0x59bb98,function(_0x24bb23){if(_0x24bb23['type']!==_0x6fc7('0x39')){var _0x3245a8={};_0x3245a8[_0x24bb23[_0x6fc7('0xf')]]={'$like':'%'+_0x69ea70[_0x6fc7('0x2f')]['filter']+'%'};return _0x3245a8;}})});}_0x62ec76=_[_0x6fc7('0x38')]({},_0x62ec76,_0x69ea70['options']);var _0xec700a={'where':_0x62ec76['where']};return db['CmHopper']['count'](_0xec700a)[_0x6fc7('0xd')](function(_0x516580){_0x4258f0[_0x6fc7('0x9')]=_0x516580;if(_0x69ea70[_0x6fc7('0x2f')][_0x6fc7('0x3a')]){_0x62ec76[_0x6fc7('0x3b')]=[{'all':!![]}];}return db[_0x6fc7('0x12')][_0x6fc7('0x3c')](_0x62ec76);})[_0x6fc7('0xd')](function(_0x2990af){_0x4258f0[_0x6fc7('0x3d')]=_0x2990af;return _0x4258f0;})[_0x6fc7('0xd')](respondWithFilteredResult(_0x280c69,_0x62ec76))[_0x6fc7('0x3e')](handleError(_0x280c69,null));};exports[_0x6fc7('0x3f')]=function(_0x3c652e,_0xe46d5){var _0x3ac76e={'raw':!![],'where':{'id':_0x3c652e[_0x6fc7('0x40')]['id']}},_0x3be13b={};_0x3be13b[_0x6fc7('0x16')]=_['keys'](db['CmHopper'][_0x6fc7('0x13')]);_0x3be13b[_0x6fc7('0x2f')]=_[_0x6fc7('0x17')](_0x3c652e[_0x6fc7('0x2f')]);_0x3be13b['filters']=_[_0x6fc7('0x19')](_0x3be13b[_0x6fc7('0x16')],_0x3be13b[_0x6fc7('0x2f')]);_0x3ac76e[_0x6fc7('0x2d')]=_[_0x6fc7('0x19')](_0x3be13b[_0x6fc7('0x16')],qs[_0x6fc7('0x2e')](_0x3c652e[_0x6fc7('0x2f')][_0x6fc7('0x2e')]));_0x3ac76e[_0x6fc7('0x2d')]=_0x3ac76e[_0x6fc7('0x2d')][_0x6fc7('0x30')]?_0x3ac76e['attributes']:_0x3be13b[_0x6fc7('0x16')];if(_0x3c652e[_0x6fc7('0x2f')]['includeAll']){_0x3ac76e[_0x6fc7('0x3b')]=[{'all':!![]}];}_0x3ac76e=_[_0x6fc7('0x38')]({},_0x3ac76e,_0x3c652e[_0x6fc7('0x41')]);return db[_0x6fc7('0x12')][_0x6fc7('0x42')](_0x3ac76e)[_0x6fc7('0xd')](handleEntityNotFound(_0xe46d5,null))[_0x6fc7('0xd')](respondWithResult(_0xe46d5,null))[_0x6fc7('0x3e')](handleError(_0xe46d5,null));};exports[_0x6fc7('0x43')]=function(_0x1a727d,_0x49bfe6){return db[_0x6fc7('0x12')][_0x6fc7('0x43')](_0x1a727d['body'],{})['then'](respondWithResult(_0x49bfe6,0xc9))[_0x6fc7('0x3e')](handleError(_0x49bfe6,null));};exports[_0x6fc7('0xc')]=function(_0x4496e4,_0x554a48){if(_0x4496e4[_0x6fc7('0x44')]['id']){delete _0x4496e4[_0x6fc7('0x44')]['id'];}return db['CmHopper'][_0x6fc7('0x42')]({'where':{'id':_0x4496e4[_0x6fc7('0x40')]['id']}})[_0x6fc7('0xd')](handleEntityNotFound(_0x554a48,null))[_0x6fc7('0xd')](saveUpdates(_0x4496e4[_0x6fc7('0x44')],null))[_0x6fc7('0xd')](respondWithResult(_0x554a48,null))[_0x6fc7('0x3e')](handleError(_0x554a48,null));};exports[_0x6fc7('0x45')]=function(_0x357d7a,_0x24df1f){return db[_0x6fc7('0x12')]['describe']()['then'](respondWithResult(_0x24df1f,null))['catch'](handleError(_0x24df1f,null));};exports['destroy']=function(_0x22a0c5,_0x5d4d40){var _0x3357f9;var _0x25e671=_0x22a0c5[_0x6fc7('0x40')]['id'];return db[_0x6fc7('0x12')][_0x6fc7('0x42')]({'where':{'id':_0x22a0c5[_0x6fc7('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d4d40,null))[_0x6fc7('0xd')](function(_0x2ac05d){if(_0x2ac05d){return _0x2ac05d['destroy']()[_0x6fc7('0xd')](function(_0x24bf3e){return _0x24bf3e;});}})[_0x6fc7('0xd')](function(_0x334256){_0x3357f9=_0x334256;if(_0x334256){if(_0x334256[_0x6fc7('0x46')]||_0x334256[_0x6fc7('0x47')]){return db[_0x334256[_0x6fc7('0x46')]?_0x6fc7('0x48'):_0x6fc7('0x49')][_0x6fc7('0x42')]({'where':{'id':_0x334256['VoiceQueueId']?_0x334256[_0x6fc7('0x46')]:_0x334256[_0x6fc7('0x47')]},'attributes':['id',_0x6fc7('0xf')],'raw':!![]});}}})['then'](function(_0x44105e){var _0x4bb441={};if(_0x44105e){_[_0x6fc7('0x38')](_0x4bb441,_['omit'](_0x3357f9[_0x6fc7('0x4a')],[_0x6fc7('0x4b'),_0x6fc7('0x4c'),'id']));_0x4bb441[_0x6fc7('0x4d')]=0x15;_0x4bb441[_0x6fc7('0x4e')]=_0x6fc7('0x4f');_0x4bb441[_0x6fc7('0x50')]=_0x44105e[_0x6fc7('0xf')];_0x4bb441['membername']=_0x22a0c5[_0x6fc7('0x51')][_0x6fc7('0xf')];_0x4bb441[_0x6fc7('0x52')]=_0x22a0c5[_0x6fc7('0x51')]['id'];_0x4bb441[_0x6fc7('0x4f')]=!![];_0x4bb441['deletedat']=moment()[_0x6fc7('0x53')](_0x6fc7('0x54'));_0x4bb441[_0x6fc7('0x55')]=_0x3357f9[_0x6fc7('0x56')];_0x4bb441[_0x6fc7('0x57')]=_0x3357f9[_0x6fc7('0x46')]?_0x6fc7('0x58'):_0x6fc7('0x59');return db[_0x6fc7('0x5a')][_0x6fc7('0x42')]({'where':{'id':_0x4bb441[_0x6fc7('0x5b')]},'attributes':['firstName',_0x6fc7('0x5c')]})[_0x6fc7('0xd')](function(_0x27aa59){if(!_[_0x6fc7('0x5d')](_0x5d4d40)&&!_[_0x6fc7('0x5d')](_0x27aa59[_0x6fc7('0x5e')])){_0x4bb441[_0x6fc7('0x5f')]=_0x27aa59[_0x6fc7('0x5e')];if(!_['isNil'](_0x27aa59[_0x6fc7('0x5c')])){_0x4bb441['calleridname']+='\x20'+_0x27aa59['lastName'];}}})['finally'](function(){return db[_0x6fc7('0x60')][_0x6fc7('0x43')](_0x4bb441);});}})[_0x6fc7('0xd')](function(_0x4a166c){return db['CmHopperAdditionalPhone'][_0x6fc7('0x61')]({'where':{'CmHopperId':_0x25e671}});})['then'](function(){return _0x5d4d40[_0x6fc7('0x5')](0xcc)[_0x6fc7('0x62')]();})[_0x6fc7('0x3e')](handleError(_0x5d4d40,null));};exports[_0x6fc7('0x63')]=function(_0x389b31,_0x376047){var _0x26fb83=[];return db[_0x6fc7('0x5a')][_0x6fc7('0x45')]()[_0x6fc7('0xd')](function(_0x5642df){_0x26fb83=_[_0x6fc7('0x17')](_0x5642df);return _0x389b31[_0x6fc7('0x51')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x6fc7('0x64'),_0x6fc7('0x65')],'raw':!![]});})[_0x6fc7('0xd')](function(_0x2852ff){if(_0x2852ff&&_0x2852ff[_0x6fc7('0x30')]){return db[_0x6fc7('0x66')]['transaction'](function(_0x17c6c5){var _0x33e02b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6fc7('0x11')](_0x2852ff,'id')},'$or':[{'UserId':null},{'UserId':_0x389b31[_0x6fc7('0x51')]['id']}]};var _0xe5c9f0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2852ff)[_0x6fc7('0x37')]([_0x6fc7('0x65'),0x0])[_0x6fc7('0x11')]('id')[_0x6fc7('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x389b31[_0x6fc7('0x51')]['id']}]};var _0x287604={'$or':[_0x33e02b,_0xe5c9f0]};var _0xbeec61=[];if(_0x389b31['body'][_0x6fc7('0x68')]&&_0x389b31[_0x6fc7('0x44')][_0x6fc7('0x68')]==='prev'){if(!_['isEmpty'](_0x389b31[_0x6fc7('0x44')][_0x6fc7('0x69')])){_0x287604['id']={'$in':_0x389b31[_0x6fc7('0x44')][_0x6fc7('0x69')]};}_0xbeec61=[[_0x6fc7('0x6a'),_0x6fc7('0x6b')],['scheduledAt',_0x2852ff[0x0][_0x6fc7('0x64')]==='ASC'?_0x6fc7('0x6c'):_0x6fc7('0x6b')],db['sequelize'][_0x6fc7('0x6d')](_0x6fc7('0x6e')),['id',_0x6fc7('0x6c')]];}else{if(!_[_0x6fc7('0x6f')](_0x389b31[_0x6fc7('0x44')][_0x6fc7('0x69')])){_0x287604['id']={'$notIn':_0x389b31['body']['hopperIds']};}_0xbeec61=[[_0x6fc7('0x6a'),'DESC'],[_0x6fc7('0x70'),_0x2852ff[0x0]['dialOrderByScheduledAt']],db[_0x6fc7('0x66')][_0x6fc7('0x6d')](_0x6fc7('0x71')),['id',_0x6fc7('0x6b')]];}return db[_0x6fc7('0x12')][_0x6fc7('0x72')]({'attributes':['id',_0x6fc7('0x73'),_0x6fc7('0x56'),_0x6fc7('0x74')],'where':_0x287604,'order':_0xbeec61,'transaction':_0x17c6c5,'lock':_0x17c6c5[_0x6fc7('0x75')][_0x6fc7('0x76')],'include':[{'model':db[_0x6fc7('0x5a')],'as':_0x6fc7('0x77'),'attributes':_0x26fb83,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0x6fc7('0x78'),'attributes':['id',_0x6fc7('0xf')]},{'model':db[_0x6fc7('0x48')],'as':'Queue','attributes':['id','name',_0x6fc7('0x79')]}]})[_0x6fc7('0xd')](function(_0x57c69b){if(_0x57c69b){return _0x57c69b[_0x6fc7('0xc')]({'UserId':_0x389b31[_0x6fc7('0x51')]['id']},{'transaction':_0x17c6c5});}});});}})[_0x6fc7('0xd')](handleEntityNotFound(_0x376047,null))[_0x6fc7('0xd')](respondWithResult(_0x376047,null))['catch'](handleError(_0x376047,null));};exports[_0x6fc7('0x7a')]=function(_0x52873a,_0x52508f,_0xcee3db){var _0x148c69=[];var _0x681873=_0x52873a[_0x6fc7('0x40')]['id'];var _0x5755b6=_0x52873a[_0x6fc7('0x51')]['id'];return db['CmContact']['describe']()[_0x6fc7('0xd')](function(_0x351919){_0x148c69=_[_0x6fc7('0x17')](_0x351919);return db[_0x6fc7('0x66')][_0x6fc7('0x7b')](function(_0x5109b0){const _0x265cb2={'id':_0x681873};return db[_0x6fc7('0x12')][_0x6fc7('0x72')]({'attributes':['id',_0x6fc7('0x73'),'recallme'],'where':_0x265cb2,'transaction':_0x5109b0,'lock':_0x5109b0[_0x6fc7('0x75')][_0x6fc7('0x76')],'include':[{'model':db[_0x6fc7('0x5a')],'as':'Contact','attributes':_0x148c69,'include':[{'model':db['CmCompany'],'as':_0x6fc7('0x7c'),'attributes':['id',_0x6fc7('0xf')]}]},{'model':db[_0x6fc7('0x7d')],'as':_0x6fc7('0x78'),'attributes':['id',_0x6fc7('0xf')]},{'model':db[_0x6fc7('0x48')],'as':_0x6fc7('0x7e'),'attributes':['id',_0x6fc7('0xf'),_0x6fc7('0x79')]}]})[_0x6fc7('0xd')](function(_0x5cdb17){if(_0x5cdb17){return _0x5cdb17[_0x6fc7('0xc')]({'UserId':_0x5755b6},{'transaction':_0x5109b0});}});});})[_0x6fc7('0xd')](handleEntityNotFound(_0x52508f,null))['then'](respondWithResult(_0x52508f,null))[_0x6fc7('0x3e')](handleError(_0x52508f,null));};exports[_0x6fc7('0x7f')]=function(_0xa4384d,_0x17f059){return _0xa4384d['user'][_0x6fc7('0x80')]({'where':{'type':_0x6fc7('0x81'),'dialActive':!![],'dialMethod':_0x6fc7('0x82')},'attributes':['id'],'raw':!![]})[_0x6fc7('0xd')](function(_0x50134d){if(_0x50134d&&_0x50134d[_0x6fc7('0x30')]){return db[_0x6fc7('0x12')][_0x6fc7('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6fc7('0x53')](_0x6fc7('0x54'))},'VoiceQueueId':{'$in':_[_0x6fc7('0x11')](_0x50134d,'id')},'$or':[{'UserId':null},{'UserId':_0xa4384d[_0x6fc7('0x51')]['id']}]}});}return 0x0;})[_0x6fc7('0xd')](function(_0x2716de){if(!_['isNil'](_0x2716de)&&_[_0x6fc7('0x83')](_0x2716de)){return _0x17f059['status'](0xc8)['json']({'contacts':_0x2716de});}else{logger[_0x6fc7('0x84')](_0x6fc7('0x85'),'getOpenContacts',0x194,_0x6fc7('0x86'));_0x17f059[_0x6fc7('0x87')](0x194);}})[_0x6fc7('0x3e')](handleError(_0x17f059,null));};exports['getTimezones']=function(_0x2975d3,_0x29d9bc){var _0x4e34a2=shared[_0x6fc7('0x88')];var _0x209e66=[];_[_0x6fc7('0x11')](_0x4e34a2,function(_0xae380a){_0x209e66['push']({'id':_0xae380a[_0x6fc7('0xf')],'name':_0xae380a[_0x6fc7('0xf')],'utcOffset':_0xae380a['utcOffset']});});return _0x29d9bc['status'](0xc8)[_0x6fc7('0x89')]({'tz':_0x209e66});};exports[_0x6fc7('0x8a')]=function(_0x21fa82,_0x502fe3){var _0x58c6f1=shared[_0x6fc7('0x88')];var _0x40f459={};if(!_[_0x6fc7('0x5d')](_0x58c6f1[_0x21fa82[_0x6fc7('0x44')]['id']]))_0x40f459=_0x58c6f1[_0x21fa82[_0x6fc7('0x44')]['id']];return _0x502fe3['status'](0xc8)['json'](_0x40f459);}; \ No newline at end of file +var _0xfa2b=['COALESCE(CmHopper.UserId,\x200)\x20DESC','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','utcOffset','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','update','sendStatus','stack','send','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','concat','$or','$gte','$lte','$ne','$eq','$not','$between','$in','$notIn','$notLike','$iLike','$like','$contains','$any','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopper','then','includeAll','include','rows','show','params','keys','fields','find','catch','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','createdAt','updatedAt','statedesc','deleted','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','user','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC'];(function(_0x136a67,_0x50cc82){var _0x4d3ed2=function(_0x2442fe){while(--_0x2442fe){_0x136a67['push'](_0x136a67['shift']());}};_0x4d3ed2(++_0x50cc82);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x1809ef,_0x4dcecf){_0x1809ef=_0x1809ef-0x0;var _0x13af5d=_0xfa2b[_0x1809ef];return _0x13af5d;};'use strict';var moment=require(_0xbfa2('0x0'));var _=require(_0xbfa2('0x1'));var qs=require(_0xbfa2('0x2'));var logger=require(_0xbfa2('0x3'))(_0xbfa2('0x4'));var shared=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];function respondWithResult(_0x1103cf,_0x116ab4){_0x116ab4=_0x116ab4||0xc8;return function(_0x43f8d9){if(_0x43f8d9){return _0x1103cf[_0xbfa2('0x7')](_0x116ab4)[_0xbfa2('0x8')](_0x43f8d9);}};}function respondWithFilteredResult(_0x12d71e,_0x237a99){return function(_0x26ed93){if(_0x26ed93){var _0x26e9bf=typeof _0x237a99['offset']===_0xbfa2('0x9')&&typeof _0x237a99['limit']===_0xbfa2('0x9');var _0x22e6fe=_0x26ed93[_0xbfa2('0xa')];var _0x1b990a=_0x26e9bf?0x0:_0x237a99[_0xbfa2('0xb')];var _0xbea357=_0x26e9bf?_0x26ed93[_0xbfa2('0xa')]:_0x237a99[_0xbfa2('0xb')]+_0x237a99[_0xbfa2('0xc')];var _0x4e0f1e;if(_0xbea357>=_0x22e6fe){_0xbea357=_0x22e6fe;_0x4e0f1e=0xc8;}else{_0x4e0f1e=0xce;}_0x12d71e['status'](_0x4e0f1e);return _0x12d71e['set'](_0xbfa2('0xd'),_0x1b990a+'-'+_0xbea357+'/'+_0x22e6fe)[_0xbfa2('0x8')](_0x26ed93);}return null;};}function saveUpdates(_0x62b1e9,_0x829a72){return function(_0x137e0d){if(_0x137e0d){return _0x137e0d[_0xbfa2('0xe')](_0x62b1e9)['then'](function(_0x324930){return _0x324930;});}return null;};}function handleEntityNotFound(_0xaf815f,_0x458653){return function(_0x445598){if(!_0x445598){_0xaf815f[_0xbfa2('0xf')](0x194);}return _0x445598;};}function handleError(_0x4e799a,_0xa988cc){_0xa988cc=_0xa988cc||0x1f4;return function(_0x47db68){logger['error'](_0x47db68[_0xbfa2('0x10')]);if(_0x47db68['name']){delete _0x47db68['name'];}_0x4e799a[_0xbfa2('0x7')](_0xa988cc)[_0xbfa2('0x11')](_0x47db68);};}exports['index']=function(_0xb9b6a3,_0x12627a){var _0x28fe6f={},_0x4088c5={},_0x37aed6={'count':0x0,'rows':[]};var _0xea9286=_[_0xbfa2('0x12')](db['CmHopper'][_0xbfa2('0x13')],function(_0x100bfa){return{'name':_0x100bfa[_0xbfa2('0x14')],'type':_0x100bfa['type'][_0xbfa2('0x15')]};});_0x4088c5[_0xbfa2('0x16')]=_['map'](_0xea9286,_0xbfa2('0x17'));_0x4088c5['query']=_['keys'](_0xb9b6a3[_0xbfa2('0x18')]);_0x4088c5[_0xbfa2('0x19')]=_[_0xbfa2('0x1a')](_0x4088c5[_0xbfa2('0x16')],_0x4088c5['query']);_0x4088c5['filters']=_[_0xbfa2('0x1b')](_0x4088c5[_0xbfa2('0x19')],['$and',_0xbfa2('0x1c'),'$gt',_0xbfa2('0x1d'),'$lt',_0xbfa2('0x1e'),_0xbfa2('0x1f'),_0xbfa2('0x20'),_0xbfa2('0x21'),_0xbfa2('0x22'),'$notBetween',_0xbfa2('0x23'),_0xbfa2('0x24'),'$like',_0xbfa2('0x25'),_0xbfa2('0x26'),'$notILike',_0xbfa2('0x27'),'$overlap',_0xbfa2('0x28'),'$contained',_0xbfa2('0x29')]);_0x28fe6f[_0xbfa2('0x2a')]=_[_0xbfa2('0x1a')](_0x4088c5[_0xbfa2('0x16')],qs['fields'](_0xb9b6a3[_0xbfa2('0x18')]['fields']));_0x28fe6f[_0xbfa2('0x2a')]=_0x28fe6f[_0xbfa2('0x2a')][_0xbfa2('0x2b')]?_0x28fe6f['attributes']:_0x4088c5[_0xbfa2('0x16')];if(!_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0x2c')]('nolimit')){_0x28fe6f['limit']=qs['limit'](_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0xc')]);_0x28fe6f['offset']=qs[_0xbfa2('0xb')](_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0xb')]);}_0x28fe6f[_0xbfa2('0x2d')]=qs['sort'](_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0x2e')]);_0x28fe6f['where']=qs[_0xbfa2('0x19')](_[_0xbfa2('0x2f')](_0xb9b6a3[_0xbfa2('0x18')],_0x4088c5[_0xbfa2('0x19')]),_0xea9286);if(_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0x30')]){_0x28fe6f[_0xbfa2('0x31')]=_[_0xbfa2('0x32')](_0x28fe6f[_0xbfa2('0x31')],{'$or':_['map'](_0xea9286,function(_0x79c2bd){if(_0x79c2bd['type']!==_0xbfa2('0x33')){var _0x57c93c={};_0x57c93c[_0x79c2bd[_0xbfa2('0x17')]]={'$like':'%'+_0xb9b6a3[_0xbfa2('0x18')][_0xbfa2('0x30')]+'%'};return _0x57c93c;}})});}_0x28fe6f=_[_0xbfa2('0x32')]({},_0x28fe6f,_0xb9b6a3[_0xbfa2('0x34')]);var _0x4fa12c={'where':_0x28fe6f[_0xbfa2('0x31')]};return db[_0xbfa2('0x35')][_0xbfa2('0xa')](_0x4fa12c)[_0xbfa2('0x36')](function(_0xa6f846){_0x37aed6['count']=_0xa6f846;if(_0xb9b6a3['query'][_0xbfa2('0x37')]){_0x28fe6f[_0xbfa2('0x38')]=[{'all':!![]}];}return db[_0xbfa2('0x35')]['findAll'](_0x28fe6f);})['then'](function(_0x44da05){_0x37aed6[_0xbfa2('0x39')]=_0x44da05;return _0x37aed6;})['then'](respondWithFilteredResult(_0x12627a,_0x28fe6f))['catch'](handleError(_0x12627a,null));};exports[_0xbfa2('0x3a')]=function(_0x1fd877,_0x5af87e){var _0x3708ea={'raw':!![],'where':{'id':_0x1fd877[_0xbfa2('0x3b')]['id']}},_0x2803b6={};_0x2803b6[_0xbfa2('0x16')]=_[_0xbfa2('0x3c')](db[_0xbfa2('0x35')][_0xbfa2('0x13')]);_0x2803b6[_0xbfa2('0x18')]=_[_0xbfa2('0x3c')](_0x1fd877[_0xbfa2('0x18')]);_0x2803b6[_0xbfa2('0x19')]=_[_0xbfa2('0x1a')](_0x2803b6[_0xbfa2('0x16')],_0x2803b6[_0xbfa2('0x18')]);_0x3708ea[_0xbfa2('0x2a')]=_[_0xbfa2('0x1a')](_0x2803b6[_0xbfa2('0x16')],qs['fields'](_0x1fd877[_0xbfa2('0x18')][_0xbfa2('0x3d')]));_0x3708ea[_0xbfa2('0x2a')]=_0x3708ea[_0xbfa2('0x2a')][_0xbfa2('0x2b')]?_0x3708ea[_0xbfa2('0x2a')]:_0x2803b6['model'];if(_0x1fd877[_0xbfa2('0x18')]['includeAll']){_0x3708ea[_0xbfa2('0x38')]=[{'all':!![]}];}_0x3708ea=_[_0xbfa2('0x32')]({},_0x3708ea,_0x1fd877['options']);return db[_0xbfa2('0x35')][_0xbfa2('0x3e')](_0x3708ea)[_0xbfa2('0x36')](handleEntityNotFound(_0x5af87e,null))[_0xbfa2('0x36')](respondWithResult(_0x5af87e,null))[_0xbfa2('0x3f')](handleError(_0x5af87e,null));};exports['create']=function(_0x44d0a6,_0x76bc9f){return db[_0xbfa2('0x35')][_0xbfa2('0x40')](_0x44d0a6[_0xbfa2('0x41')],{})[_0xbfa2('0x36')](respondWithResult(_0x76bc9f,0xc9))[_0xbfa2('0x3f')](handleError(_0x76bc9f,null));};exports[_0xbfa2('0xe')]=function(_0x4a43f8,_0x20eb6e){if(_0x4a43f8[_0xbfa2('0x41')]['id']){delete _0x4a43f8['body']['id'];}return db[_0xbfa2('0x35')][_0xbfa2('0x3e')]({'where':{'id':_0x4a43f8[_0xbfa2('0x3b')]['id']}})[_0xbfa2('0x36')](handleEntityNotFound(_0x20eb6e,null))[_0xbfa2('0x36')](saveUpdates(_0x4a43f8[_0xbfa2('0x41')],null))[_0xbfa2('0x36')](respondWithResult(_0x20eb6e,null))[_0xbfa2('0x3f')](handleError(_0x20eb6e,null));};exports[_0xbfa2('0x42')]=function(_0x59d61b,_0x3d98d4){return db[_0xbfa2('0x35')][_0xbfa2('0x42')]()['then'](respondWithResult(_0x3d98d4,null))['catch'](handleError(_0x3d98d4,null));};exports[_0xbfa2('0x43')]=function(_0x51fd07,_0x457a15){var _0x29f0ef;var _0x4ef203=_0x51fd07[_0xbfa2('0x3b')]['id'];return db[_0xbfa2('0x35')][_0xbfa2('0x3e')]({'where':{'id':_0x51fd07['params']['id']}})[_0xbfa2('0x36')](handleEntityNotFound(_0x457a15,null))['then'](function(_0x378b18){if(_0x378b18){return _0x378b18[_0xbfa2('0x43')]()['then'](function(_0x3f8e7c){return _0x3f8e7c;});}})['then'](function(_0x40eba9){_0x29f0ef=_0x40eba9;if(_0x40eba9){if(_0x40eba9['VoiceQueueId']||_0x40eba9[_0xbfa2('0x44')]){return db[_0x40eba9[_0xbfa2('0x45')]?_0xbfa2('0x46'):_0xbfa2('0x47')][_0xbfa2('0x3e')]({'where':{'id':_0x40eba9['VoiceQueueId']?_0x40eba9['VoiceQueueId']:_0x40eba9['CampaignId']},'attributes':['id',_0xbfa2('0x17')],'raw':!![]});}}})[_0xbfa2('0x36')](function(_0x221f5a){var _0x4d5271={};if(_0x221f5a){_[_0xbfa2('0x32')](_0x4d5271,_[_0xbfa2('0x48')](_0x29f0ef['dataValues'],[_0xbfa2('0x49'),_0xbfa2('0x4a'),'id']));_0x4d5271['state']=0x15;_0x4d5271[_0xbfa2('0x4b')]=_0xbfa2('0x4c');_0x4d5271['campaign']=_0x221f5a['name'];_0x4d5271[_0xbfa2('0x4d')]=_0x51fd07['user'][_0xbfa2('0x17')];_0x4d5271[_0xbfa2('0x4e')]=_0x51fd07['user']['id'];_0x4d5271[_0xbfa2('0x4c')]=!![];_0x4d5271[_0xbfa2('0x4f')]=moment()[_0xbfa2('0x50')](_0xbfa2('0x51'));_0x4d5271[_0xbfa2('0x52')]=_0x29f0ef[_0xbfa2('0x53')];_0x4d5271[_0xbfa2('0x54')]=_0x29f0ef[_0xbfa2('0x45')]?_0xbfa2('0x55'):_0xbfa2('0x56');return db[_0xbfa2('0x57')][_0xbfa2('0x3e')]({'where':{'id':_0x4d5271[_0xbfa2('0x58')]},'attributes':[_0xbfa2('0x59'),'lastName']})[_0xbfa2('0x36')](function(_0x4e43c7){if(!_[_0xbfa2('0x5a')](_0x457a15)&&!_[_0xbfa2('0x5a')](_0x4e43c7[_0xbfa2('0x59')])){_0x4d5271[_0xbfa2('0x5b')]=_0x4e43c7[_0xbfa2('0x59')];if(!_[_0xbfa2('0x5a')](_0x4e43c7[_0xbfa2('0x5c')])){_0x4d5271[_0xbfa2('0x5b')]+='\x20'+_0x4e43c7[_0xbfa2('0x5c')];}}})[_0xbfa2('0x5d')](function(){return db[_0xbfa2('0x5e')]['create'](_0x4d5271);});}})[_0xbfa2('0x36')](function(_0x44e433){return db[_0xbfa2('0x5f')][_0xbfa2('0x43')]({'where':{'CmHopperId':_0x4ef203}});})['then'](function(){return _0x457a15[_0xbfa2('0x7')](0xcc)[_0xbfa2('0x60')]();})[_0xbfa2('0x3f')](handleError(_0x457a15,null));};exports[_0xbfa2('0x61')]=function(_0x2f7666,_0x49f224){var _0x3a7fc7=[];return db[_0xbfa2('0x57')][_0xbfa2('0x42')]()[_0xbfa2('0x36')](function(_0x3b8c77){_0x3a7fc7=_[_0xbfa2('0x3c')](_0x3b8c77);return _0x2f7666['user'][_0xbfa2('0x62')]({'where':{'type':_0xbfa2('0x63'),'dialActive':!![],'dialMethod':_0xbfa2('0x64')},'attributes':['id',_0xbfa2('0x65'),_0xbfa2('0x66')],'raw':!![]});})['then'](function(_0x5d0b6e){if(_0x5d0b6e&&_0x5d0b6e['length']){return db[_0xbfa2('0x67')][_0xbfa2('0x68')](function(_0x3c337d){var _0x12e182={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xbfa2('0x12')](_0x5d0b6e,'id')},'$or':[{'UserId':null},{'UserId':_0x2f7666[_0xbfa2('0x69')]['id']}]};var _0x15c172={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5d0b6e)['filter']([_0xbfa2('0x66'),0x0])[_0xbfa2('0x12')]('id')[_0xbfa2('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x2f7666[_0xbfa2('0x69')]['id']}]};var _0x5019c7={'$or':[_0x12e182,_0x15c172]};var _0x433448=[];if(_0x2f7666[_0xbfa2('0x41')]['direction']&&_0x2f7666[_0xbfa2('0x41')][_0xbfa2('0x6b')]===_0xbfa2('0x6c')){if(!_[_0xbfa2('0x6d')](_0x2f7666['body']['hopperIds'])){_0x5019c7['id']={'$in':_0x2f7666[_0xbfa2('0x41')][_0xbfa2('0x6e')]};}_0x433448=[[_0xbfa2('0x6f'),_0xbfa2('0x70')],[_0xbfa2('0x71'),_0x5d0b6e[0x0]['dialOrderByScheduledAt']===_0xbfa2('0x70')?_0xbfa2('0x72'):_0xbfa2('0x70')],db['sequelize'][_0xbfa2('0x73')](_0xbfa2('0x74')),['id',_0xbfa2('0x72')]];}else{if(!_[_0xbfa2('0x6d')](_0x2f7666['body']['hopperIds'])){_0x5019c7['id']={'$notIn':_0x2f7666[_0xbfa2('0x41')]['hopperIds']};}_0x433448=[[_0xbfa2('0x6f'),_0xbfa2('0x72')],[_0xbfa2('0x71'),_0x5d0b6e[0x0][_0xbfa2('0x65')]],db[_0xbfa2('0x67')]['literal'](_0xbfa2('0x75')),['id',_0xbfa2('0x70')]];}return db[_0xbfa2('0x35')]['findOne']({'attributes':['id','scheduledat',_0xbfa2('0x53'),'recallme'],'where':_0x5019c7,'order':_0x433448,'transaction':_0x3c337d,'lock':_0x3c337d['LOCK']['UPDATE'],'include':[{'model':db[_0xbfa2('0x57')],'as':'Contact','attributes':_0x3a7fc7,'include':[{'model':db[_0xbfa2('0x76')],'as':_0xbfa2('0x77'),'attributes':['id',_0xbfa2('0x17')]}]},{'model':db[_0xbfa2('0x78')],'as':_0xbfa2('0x79'),'attributes':['id',_0xbfa2('0x17')]},{'model':db[_0xbfa2('0x46')],'as':_0xbfa2('0x7a'),'attributes':['id',_0xbfa2('0x17'),_0xbfa2('0x7b')]}]})[_0xbfa2('0x36')](function(_0x46636f){if(_0x46636f){return _0x46636f[_0xbfa2('0xe')]({'UserId':_0x2f7666[_0xbfa2('0x69')]['id']},{'transaction':_0x3c337d});}});});}})[_0xbfa2('0x36')](handleEntityNotFound(_0x49f224,null))[_0xbfa2('0x36')](respondWithResult(_0x49f224,null))[_0xbfa2('0x3f')](handleError(_0x49f224,null));};exports[_0xbfa2('0x7c')]=function(_0x3ddd98,_0x2279c9,_0x40a162){var _0x31bab8=[];var _0x4d94a4=_0x3ddd98['params']['id'];var _0x3f2bd3=_0x3ddd98[_0xbfa2('0x69')]['id'];return db[_0xbfa2('0x57')][_0xbfa2('0x42')]()[_0xbfa2('0x36')](function(_0x5d384c){_0x31bab8=_[_0xbfa2('0x3c')](_0x5d384c);return db[_0xbfa2('0x67')]['transaction'](function(_0x320fbc){const _0x52a7f0={'id':_0x4d94a4};return db[_0xbfa2('0x35')][_0xbfa2('0x7d')]({'attributes':['id',_0xbfa2('0x7e'),_0xbfa2('0x7f')],'where':_0x52a7f0,'transaction':_0x320fbc,'lock':_0x320fbc[_0xbfa2('0x80')][_0xbfa2('0x81')],'include':[{'model':db[_0xbfa2('0x57')],'as':_0xbfa2('0x82'),'attributes':_0x31bab8,'include':[{'model':db[_0xbfa2('0x76')],'as':'Company','attributes':['id',_0xbfa2('0x17')]}]},{'model':db[_0xbfa2('0x78')],'as':'List','attributes':['id',_0xbfa2('0x17')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0xbfa2('0x17'),_0xbfa2('0x7b')]}]})[_0xbfa2('0x36')](function(_0x44e251){if(_0x44e251){return _0x44e251['update']({'UserId':_0x3f2bd3},{'transaction':_0x320fbc});}});});})[_0xbfa2('0x36')](handleEntityNotFound(_0x2279c9,null))['then'](respondWithResult(_0x2279c9,null))[_0xbfa2('0x3f')](handleError(_0x2279c9,null));};exports[_0xbfa2('0x83')]=function(_0x205243,_0x269cf4){return _0x205243[_0xbfa2('0x69')][_0xbfa2('0x62')]({'where':{'type':_0xbfa2('0x63'),'dialActive':!![],'dialMethod':_0xbfa2('0x64')},'attributes':['id'],'raw':!![]})[_0xbfa2('0x36')](function(_0xa4df7f){if(_0xa4df7f&&_0xa4df7f['length']){return db[_0xbfa2('0x35')][_0xbfa2('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbfa2('0x50')](_0xbfa2('0x51'))},'VoiceQueueId':{'$in':_[_0xbfa2('0x12')](_0xa4df7f,'id')},'$or':[{'UserId':null},{'UserId':_0x205243[_0xbfa2('0x69')]['id']}]}});}return 0x0;})['then'](function(_0xa4feb9){if(!_[_0xbfa2('0x5a')](_0xa4feb9)&&_[_0xbfa2('0x84')](_0xa4feb9)){return _0x269cf4[_0xbfa2('0x7')](0xc8)['json']({'contacts':_0xa4feb9});}else{logger['error'](_0xbfa2('0x85'),_0xbfa2('0x83'),0x194,_0xbfa2('0x86'));_0x269cf4[_0xbfa2('0xf')](0x194);}})[_0xbfa2('0x3f')](handleError(_0x269cf4,null));};exports[_0xbfa2('0x87')]=function(_0x138df1,_0x27d898){var _0x1743fc=shared['timezones'];var _0x5a6d77=[];_[_0xbfa2('0x12')](_0x1743fc,function(_0x391002){_0x5a6d77['push']({'id':_0x391002[_0xbfa2('0x17')],'name':_0x391002['name'],'utcOffset':_0x391002[_0xbfa2('0x88')]});});return _0x27d898[_0xbfa2('0x7')](0xc8)[_0xbfa2('0x8')]({'tz':_0x5a6d77});};exports[_0xbfa2('0x89')]=function(_0x3a4a44,_0x4b1422){var _0x509677=shared[_0xbfa2('0x8a')];var _0x51c5b2={};if(!_[_0xbfa2('0x5a')](_0x509677[_0x3a4a44[_0xbfa2('0x41')]['id']]))_0x51c5b2=_0x509677[_0x3a4a44['body']['id']];return _0x4b1422[_0xbfa2('0x7')](0xc8)['json'](_0x51c5b2);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ccd718c..d96fe5a 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x5aa373,_0x54c7f4){var _0x590e8e=function(_0x505e62){while(--_0x505e62){_0x5aa373['push'](_0x5aa373['shift']());}};_0x590e8e(++_0x54c7f4);}(_0x187d,0x93));var _0xd187=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x187d[_0x4154a6];return _0x3b2786;};'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':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x416569,_0x1d0fd9){var _0x443b79=function(_0x51d0c7){while(--_0x51d0c7){_0x416569['push'](_0x416569['shift']());}};_0x443b79(++_0x1d0fd9);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 234eb77..1a1414f 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 _0xa968=['error','message','ShowCmHopper','then','info','create','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','LOCK','UPDATE','Contact','User','length','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','order','UserId','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','\x20MINUTE','name','voicePause','CmList','List','lodash','util','moment','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetCmHopper','stringify','catch'];(function(_0x38f6b3,_0x192551){var _0x534a41=function(_0x250f37){while(--_0x250f37){_0x38f6b3['push'](_0x38f6b3['shift']());}};_0x534a41(++_0x192551);}(_0xa968,0x120));var _0x8a96=function(_0x5e8ac2,_0x5b0ff4){_0x5e8ac2=_0x5e8ac2-0x0;var _0x296511=_0xa968[_0x5e8ac2];return _0x296511;};'use strict';var _=require(_0x8a96('0x0'));var util=require(_0x8a96('0x1'));var moment=require(_0x8a96('0x2'));var BPromise=require('bluebird');var db=require(_0x8a96('0x3'))['db'];var logger=require(_0x8a96('0x4'))(_0x8a96('0x5'));exports['GetCmHopper']=function(_0x2d86c8){var _0x387184=this;return new Promise(function(_0x2362b8,_0x41227b){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'raw':_0x2d86c8['options']?_0x2d86c8[_0x8a96('0x8')][_0x8a96('0x9')]===undefined?!![]:![]:!![],'where':_0x2d86c8['options']?_0x2d86c8['options'][_0x8a96('0xa')]||null:null,'attributes':_0x2d86c8[_0x8a96('0x8')]?_0x2d86c8[_0x8a96('0x8')][_0x8a96('0xb')]||null:null,'limit':_0x2d86c8[_0x8a96('0x8')]?_0x2d86c8[_0x8a96('0x8')][_0x8a96('0xc')]||null:null,'include':_0x2d86c8[_0x8a96('0x8')]?_0x2d86c8['options'][_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x2d86c8[_0x8a96('0x8')][_0x8a96('0xd')],function(_0x4053e8){return{'model':db[_0x4053e8[_0x8a96('0xf')]],'as':_0x4053e8['as'],'attributes':_0x4053e8[_0x8a96('0xb')],'include':_0x4053e8['include']?_['map'](_0x4053e8[_0x8a96('0xd')],function(_0x5ec665){return{'model':db[_0x5ec665[_0x8a96('0xf')]],'as':_0x5ec665['as'],'attributes':_0x5ec665['attributes'],'include':_0x5ec665['include']?_[_0x8a96('0xe')](_0x5ec665['include'],function(_0x30e7d0){return{'model':db[_0x30e7d0[_0x8a96('0xf')]],'as':_0x30e7d0['as'],'attributes':_0x30e7d0[_0x8a96('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b865a){logger['info']('GetCmHopper',_0x2d86c8);logger[_0x8a96('0x10')](_0x8a96('0x11'),_0x2d86c8,JSON[_0x8a96('0x12')](_0x9b865a));_0x2362b8(_0x9b865a);})[_0x8a96('0x13')](function(_0x4fe652){logger[_0x8a96('0x14')](_0x8a96('0x11'),_0x4fe652[_0x8a96('0x15')],_0x2d86c8);_0x41227b(_0x387184[_0x8a96('0x14')](0x1f4,_0x4fe652[_0x8a96('0x15')]));});});};exports[_0x8a96('0x16')]=function(_0x4392dd){var _0x12fdc2=this;return new Promise(function(_0x2b9af6,_0x2373dd){return db[_0x8a96('0x6')]['find']({'raw':_0x4392dd['options']?_0x4392dd['options']['raw']===undefined?!![]:![]:!![],'where':_0x4392dd[_0x8a96('0x8')]?_0x4392dd[_0x8a96('0x8')][_0x8a96('0xa')]||null:null,'attributes':_0x4392dd[_0x8a96('0x8')]?_0x4392dd['options'][_0x8a96('0xb')]||null:null,'include':_0x4392dd[_0x8a96('0x8')]?_0x4392dd[_0x8a96('0x8')][_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x4392dd[_0x8a96('0x8')]['include'],function(_0x569666){return{'model':db[_0x569666[_0x8a96('0xf')]],'as':_0x569666['as'],'attributes':_0x569666[_0x8a96('0xb')],'include':_0x569666['include']?_[_0x8a96('0xe')](_0x569666[_0x8a96('0xd')],function(_0x2562ec){return{'model':db[_0x2562ec[_0x8a96('0xf')]],'as':_0x2562ec['as'],'attributes':_0x2562ec[_0x8a96('0xb')],'include':_0x2562ec[_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x2562ec[_0x8a96('0xd')],function(_0x4d0a4a){return{'model':db[_0x4d0a4a[_0x8a96('0xf')]],'as':_0x4d0a4a['as'],'attributes':_0x4d0a4a[_0x8a96('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8a96('0x17')](function(_0x3cf203){logger[_0x8a96('0x18')]('ShowCmHopper',_0x4392dd);logger[_0x8a96('0x10')]('ShowCmHopper',_0x4392dd,JSON[_0x8a96('0x12')](_0x3cf203));_0x2b9af6(_0x3cf203);})[_0x8a96('0x13')](function(_0x188200){logger[_0x8a96('0x14')](_0x8a96('0x16'),_0x188200[_0x8a96('0x15')],_0x4392dd);_0x2373dd(_0x12fdc2[_0x8a96('0x14')](0x1f4,_0x188200[_0x8a96('0x15')]));});});};exports['CreateCmHopper']=function(_0x262d24){var _0x4b90b7=this;return new Promise(function(_0x361e8b,_0x49d2db){return db['CmHopper'][_0x8a96('0x19')](_0x262d24[_0x8a96('0x1a')],{'raw':_0x262d24['options']?_0x262d24['options'][_0x8a96('0x9')]===undefined?!![]:![]:!![]})[_0x8a96('0x17')](function(_0x2f1911){logger[_0x8a96('0x18')](_0x8a96('0x1b'),_0x262d24);logger[_0x8a96('0x10')](_0x8a96('0x1b'),_0x262d24,JSON['stringify'](_0x2f1911));_0x361e8b(_0x2f1911);})[_0x8a96('0x13')](function(_0x3bb317){logger['error'](_0x8a96('0x1b'),_0x3bb317[_0x8a96('0x15')],_0x262d24);_0x49d2db(_0x4b90b7['error'](0x1f4,_0x3bb317[_0x8a96('0x15')]));});});};exports[_0x8a96('0x1c')]=function(_0x171860){var _0x4e5a8a=this;return new Promise(function(_0x581098,_0x375a9c){return db[_0x8a96('0x6')]['update'](_0x171860[_0x8a96('0x1a')],{'raw':_0x171860[_0x8a96('0x8')]?_0x171860[_0x8a96('0x8')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x171860[_0x8a96('0x8')]?_0x171860['options'][_0x8a96('0xa')]||null:null,'attributes':_0x171860['options']?_0x171860[_0x8a96('0x8')][_0x8a96('0xb')]||null:null,'limit':_0x171860['options']?_0x171860[_0x8a96('0x8')][_0x8a96('0xc')]||null:null})[_0x8a96('0x17')](function(_0x187382){logger[_0x8a96('0x18')](_0x8a96('0x1c'),_0x171860);logger[_0x8a96('0x18')](_0x8a96('0x1d'),JSON[_0x8a96('0x12')](_0x171860[_0x8a96('0x8')][_0x8a96('0xa')]),_0x171860[_0x8a96('0x1a')][_0x8a96('0x1e')]);logger[_0x8a96('0x10')]('UpdateCmHopper',_0x171860,JSON[_0x8a96('0x12')](_0x187382));_0x581098(_0x187382);})[_0x8a96('0x13')](function(_0x5b321f){logger[_0x8a96('0x14')](_0x8a96('0x1c'),_0x5b321f[_0x8a96('0x15')],_0x171860);_0x375a9c(_0x4e5a8a['error'](0x1f4,_0x5b321f['message']));});});};exports[_0x8a96('0x1f')]=function(_0x1f2776){var _0x51231f=this;return new Promise(function(_0x4d77dd,_0x47dbfb){return db[_0x8a96('0x6')][_0x8a96('0x20')]({'where':_0x1f2776['options']?_0x1f2776[_0x8a96('0x8')][_0x8a96('0xa')]||null:null})[_0x8a96('0x17')](function(_0x5cc692){logger['info'](_0x8a96('0x1f'),_0x1f2776);logger[_0x8a96('0x10')]('DestroyCmHopper',_0x1f2776,JSON[_0x8a96('0x12')](_0x5cc692));_0x4d77dd(_0x5cc692);})[_0x8a96('0x13')](function(_0x19a11f){logger[_0x8a96('0x14')](_0x8a96('0x1f'),_0x19a11f[_0x8a96('0x15')],_0x1f2776);_0x47dbfb(_0x51231f[_0x8a96('0x14')](0x1f4,_0x19a11f[_0x8a96('0x15')]));});});};exports[_0x8a96('0x21')]=function(_0x1e1368){var _0x3512b0=this;return new Promise(function(_0x572468,_0x2bdcf4){return db[_0x8a96('0x22')]['describe']()[_0x8a96('0x17')](function(_0x4cc5e4){return db[_0x8a96('0x23')][_0x8a96('0x24')](function(_0x2358bb){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'where':_0x1e1368[_0x8a96('0x8')]?_0x1e1368['options']['where']||null:null,'attributes':_0x1e1368[_0x8a96('0x8')]?_0x1e1368[_0x8a96('0x8')][_0x8a96('0xb')]||null:null,'limit':_0x1e1368[_0x8a96('0x8')]?_0x1e1368['options'][_0x8a96('0xc')]||null:null,'order':_0x1e1368[_0x8a96('0x8')]?_0x1e1368[_0x8a96('0x8')]['order']||null:null,'transaction':_0x2358bb,'lock':_0x2358bb[_0x8a96('0x25')][_0x8a96('0x26')],'include':[{'model':db[_0x8a96('0x22')],'as':_0x8a96('0x27'),'attributes':_['keys'](_0x4cc5e4)},{'model':db[_0x8a96('0x28')],'as':'Agent','attributes':['id','name','voicePause']}]})['then'](function(_0x2e4fff){var _0x2971d6=[];var _0x39d1b5=[];for(var _0x4a293e=0x0;_0x4a293e<_0x2e4fff[_0x8a96('0x29')];_0x4a293e+=0x1){var _0x44bd45=_0x2e4fff[_0x4a293e]['UserId'];if(_0x44bd45===null){_0x2971d6[_0x8a96('0x2a')](_0x2e4fff[_0x4a293e]['update'](_0x1e1368[_0x8a96('0x1a')],{'transaction':_0x2358bb}));}else if(!_0x39d1b5['includes'](_0x44bd45)){_0x39d1b5[_0x8a96('0x2a')](_0x44bd45);_0x2971d6[_0x8a96('0x2a')](_0x2e4fff[_0x4a293e][_0x8a96('0x2b')](_0x1e1368[_0x8a96('0x1a')],{'transaction':_0x2358bb}));}}return BPromise[_0x8a96('0x2c')](_0x2971d6);});})[_0x8a96('0x17')](function(_0x172bc1){logger[_0x8a96('0x18')](_0x8a96('0x21'),_0x1e1368);if(_0x172bc1[_0x8a96('0x29')]>0x0){logger[_0x8a96('0x18')](_0x8a96('0x2d'),_0x172bc1[0x0][_0x8a96('0x2e')]['id'],_0x172bc1[0x0][_0x8a96('0x2e')]['ContactId'],_0x172bc1[0x0][_0x8a96('0x2e')][_0x8a96('0x1e')]);}logger['debug']('GetContactDialer',_0x1e1368,JSON[_0x8a96('0x12')](_0x172bc1));_0x572468(_0x172bc1);})['catch'](function(_0x49cd73){logger[_0x8a96('0x14')](_0x8a96('0x21'),_0x49cd73[_0x8a96('0x15')],_0x1e1368);_0x2bdcf4(_0x3512b0[_0x8a96('0x14')](0x1f4,_0x49cd73[_0x8a96('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x385844){var _0x4ff61e=this;return new Promise(function(_0x51dfaf,_0x1915d6){return db[_0x8a96('0x23')][_0x8a96('0x24')](function(_0x1b3112){return db[_0x8a96('0x2f')][_0x8a96('0x19')](_0x385844['body'],{'raw':_0x385844[_0x8a96('0x8')]?_0x385844[_0x8a96('0x8')][_0x8a96('0x9')]===undefined?!![]:![]:!![],'transaction':_0x1b3112})[_0x8a96('0x17')](function(){logger[_0x8a96('0x18')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8a96('0x12')](_0x385844[_0x8a96('0x8')][_0x8a96('0xa')]),_0x385844['options']['where'][_0x8a96('0x1e')]);return db['CmHopper'][_0x8a96('0x20')]({'where':_0x385844[_0x8a96('0x8')]?_0x385844[_0x8a96('0x8')]['where']||null:null,'transaction':_0x1b3112});});})[_0x8a96('0x17')](function(_0x55e07e){logger[_0x8a96('0x18')](_0x8a96('0x30'),_0x385844);logger[_0x8a96('0x10')](_0x8a96('0x30'),_0x385844,JSON[_0x8a96('0x12')](_0x55e07e));_0x51dfaf(_0x55e07e);})[_0x8a96('0x13')](function(_0x477977){logger['error']('MoveContactManagedDialer',_0x477977[_0x8a96('0x15')],_0x385844);_0x1915d6(_0x4ff61e[_0x8a96('0x14')](0x1f4,_0x477977[_0x8a96('0x15')]));});});};exports[_0x8a96('0x31')]=function(_0x3d806c){var _0x261a6d=this;return new Promise(function(_0x51999e,_0x3ee7db){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'raw':_0x3d806c[_0x8a96('0x8')]?_0x3d806c[_0x8a96('0x8')][_0x8a96('0x9')]===undefined?!![]:![]:!![],'where':_0x3d806c[_0x8a96('0x8')]?_0x3d806c[_0x8a96('0x8')][_0x8a96('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8a96('0x32'),db[_0x8a96('0x23')]['fn']('IF',db[_0x8a96('0x23')][_0x8a96('0x33')](_0x8a96('0x34')+util[_0x8a96('0x35')]('\x22%s\x22',moment()[_0x8a96('0x35')](_0x8a96('0x36')))+_0x8a96('0x37')))),_0x8a96('0x38')]]})[_0x8a96('0x17')](function(_0x3e7f24){logger[_0x8a96('0x18')](_0x8a96('0x31'),_0x3d806c);logger[_0x8a96('0x10')]('CountReScheduled',_0x3d806c,JSON['stringify'](_0x3e7f24));_0x51999e(_0x3e7f24);})[_0x8a96('0x13')](function(_0xd41b53){logger[_0x8a96('0x14')](_0x8a96('0x31'),_0xd41b53[_0x8a96('0x15')],_0x3d806c);_0x3ee7db(_0x261a6d[_0x8a96('0x14')](0x1f4,_0xd41b53[_0x8a96('0x15')]));});});};exports[_0x8a96('0x39')]=function(_0x47524b){var _0x62a2de=this;return new Promise(function(_0x25b8d4,_0x56f3ae){return db[_0x8a96('0x22')][_0x8a96('0x3a')]()[_0x8a96('0x17')](function(){return db['sequelize'][_0x8a96('0x24')](function(_0x510895){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'where':_0x47524b[_0x8a96('0x8')]?_0x47524b[_0x8a96('0x8')][_0x8a96('0xa')]||null:null,'attributes':_0x47524b[_0x8a96('0x8')]?_0x47524b['options'][_0x8a96('0xb')]||null:null,'limit':0x1,'order':_0x47524b['options']?_0x47524b[_0x8a96('0x8')][_0x8a96('0x3b')]||null:null,'group':db[_0x8a96('0x6')][_0x8a96('0x3c')],'transaction':_0x510895,'lock':_0x510895['LOCK'][_0x8a96('0x26')],'include':_0x47524b[_0x8a96('0x8')]?_0x47524b[_0x8a96('0x8')][_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x47524b[_0x8a96('0x8')][_0x8a96('0xd')],function(_0x4e6d89){return{'model':db[_0x4e6d89[_0x8a96('0xf')]],'as':_0x4e6d89['as'],'attributes':_0x4e6d89[_0x8a96('0xb')],'include':_0x4e6d89['include']?_[_0x8a96('0xe')](_0x4e6d89[_0x8a96('0xd')],function(_0x5c849b){return{'model':db[_0x5c849b[_0x8a96('0xf')]],'as':_0x5c849b['as'],'attributes':_0x5c849b[_0x8a96('0xb')],'include':_0x5c849b[_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x5c849b[_0x8a96('0xd')],function(_0x22e692){return{'model':db[_0x22e692['model']],'as':_0x22e692['as'],'attributes':_0x22e692['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a96('0x17')](function(_0x5e1f7e){var _0x53bd6b=[];for(var _0x568d88=0x0;_0x568d88<_0x5e1f7e[_0x8a96('0x29')];_0x568d88+=0x1){_0x53bd6b[_0x8a96('0x2a')](_0x5e1f7e[_0x568d88][_0x8a96('0x2b')](_0x47524b[_0x8a96('0x1a')],{'transaction':_0x510895}));}return BPromise[_0x8a96('0x2c')](_0x53bd6b);});})[_0x8a96('0x17')](function(_0x3bfcb9){logger[_0x8a96('0x18')](_0x8a96('0x39'),_0x47524b);logger[_0x8a96('0x10')](_0x8a96('0x39'),_0x47524b,JSON[_0x8a96('0x12')](_0x3bfcb9));_0x25b8d4(_0x3bfcb9);})[_0x8a96('0x13')](function(_0x289146){logger[_0x8a96('0x14')](_0x8a96('0x39'),_0x289146[_0x8a96('0x15')],_0x47524b);_0x56f3ae(_0x62a2de[_0x8a96('0x14')](0x1f4,_0x289146['message']));});});});};exports[_0x8a96('0x3d')]=function(_0x120071){var _0x35fd0a=this;return new Promise(function(_0x47fd81,_0x16683a){db[_0x8a96('0x22')][_0x8a96('0x3a')]()[_0x8a96('0x17')](function(_0x225397){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'raw':_0x120071[_0x8a96('0x8')]?_0x120071[_0x8a96('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x120071[_0x8a96('0x8')]?_0x120071[_0x8a96('0x8')][_0x8a96('0xa')]||null:null,'attributes':_0x120071[_0x8a96('0x8')]?_0x120071[_0x8a96('0x8')][_0x8a96('0xb')]||null:null,'limit':_0x120071[_0x8a96('0x8')]?_0x120071['options'][_0x8a96('0xc')]||null:null,'include':_0x120071[_0x8a96('0x8')]?_0x120071[_0x8a96('0x8')][_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x120071[_0x8a96('0x8')]['include'],function(_0x4b3ec1){return{'model':db[_0x4b3ec1[_0x8a96('0xf')]],'as':_0x4b3ec1['as'],'attributes':_0x4b3ec1['as']===_0x8a96('0x27')?_[_0x8a96('0x3e')](_0x225397):_0x4b3ec1[_0x8a96('0xb')],'include':_0x4b3ec1[_0x8a96('0xd')]?_['map'](_0x4b3ec1[_0x8a96('0xd')],function(_0x14ef85){return{'model':db[_0x14ef85[_0x8a96('0xf')]],'as':_0x14ef85['as'],'attributes':_0x14ef85[_0x8a96('0xb')],'include':_0x14ef85[_0x8a96('0xd')]?_[_0x8a96('0xe')](_0x14ef85[_0x8a96('0xd')],function(_0x34ed8a){return{'model':db[_0x34ed8a[_0x8a96('0xf')]],'as':_0x34ed8a['as'],'attributes':_0x34ed8a[_0x8a96('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8a96('0x17')](function(_0x5af020){logger[_0x8a96('0x18')](_0x8a96('0x11'),_0x120071);logger[_0x8a96('0x10')]('GetCmHopper',_0x120071,JSON[_0x8a96('0x12')](_0x5af020));_0x47fd81(_0x5af020);})['catch'](function(_0x4dc36f){logger[_0x8a96('0x14')]('GetCmHopper',_0x4dc36f[_0x8a96('0x15')],_0x120071);_0x16683a(_0x35fd0a[_0x8a96('0x14')](0x1f4,_0x4dc36f[_0x8a96('0x15')]));});});});};exports[_0x8a96('0x3f')]=function(_0x5f0a46){var _0x54e2e3=this;return new Promise(function(_0x5e0064,_0x33916d){return db[_0x8a96('0x22')][_0x8a96('0x40')]({'raw':!![],'where':{'phone':_0x5f0a46[_0x8a96('0x8')][_0x8a96('0xa')]['phone']},'attributes':['id',_0x8a96('0x41')],'order':[['id',_0x8a96('0x42')]]})['then'](function(_0x30f77a){logger[_0x8a96('0x18')](_0x8a96('0x43'),_0x5f0a46);logger[_0x8a96('0x10')](_0x8a96('0x43'),_0x5f0a46,JSON[_0x8a96('0x12')](_0x30f77a));_0x5e0064(_0x30f77a);})['catch'](function(_0x1dd429){logger[_0x8a96('0x14')](_0x8a96('0x43'),_0x1dd429[_0x8a96('0x15')],_0x5f0a46);_0x33916d(_0x54e2e3['error'](0x1f4,_0x1dd429[_0x8a96('0x15')]));});});};exports[_0x8a96('0x44')]=function(_0x29fd2b){var _0x3ded76=this;return new Promise(function(_0x460a99,_0x355e9e){return db[_0x8a96('0x23')]['transaction'](function(_0x3e2f80){var _0x196dd0=_0x29fd2b['options']&&_0x29fd2b[_0x8a96('0x8')][_0x8a96('0xa')]?_0x29fd2b[_0x8a96('0x8')][_0x8a96('0xa')]:{};return db[_0x8a96('0x6')][_0x8a96('0x2b')](_0x29fd2b[_0x8a96('0x1a')],{'where':_0x196dd0,'transaction':_0x3e2f80})[_0x8a96('0x17')](function(_0x1520c1){logger[_0x8a96('0x18')]('ResetActiveCalls',_0x29fd2b);logger[_0x8a96('0x10')](_0x8a96('0x44'),_0x29fd2b,JSON['stringify'](_0x1520c1));_0x460a99(_0x1520c1);})[_0x8a96('0x13')](function(_0x58e637){logger[_0x8a96('0x14')](_0x8a96('0x44'),_0x58e637[_0x8a96('0x15')],_0x29fd2b);_0x355e9e(_0x3ded76[_0x8a96('0x14')](0x1f4,_0x58e637[_0x8a96('0x15')]));});});});};exports[_0x8a96('0x45')]=function(_0x3c7efb){var _0x314bd1=this;var _0x4a1b81=_0x3c7efb[_0x8a96('0x1a')][_0x8a96('0xa')][_0x8a96('0x46')];var _0x3a9081=_0x3c7efb[_0x8a96('0x1a')][_0x8a96('0xa')]['interval'];var _0x377e2a=_0x3c7efb[_0x8a96('0x1a')]['where'][_0x8a96('0x47')];return new Promise(function(_0x5a4251,_0x3c06cd){return db[_0x8a96('0x6')][_0x8a96('0x7')]({'where':{'voiceQueueId':{'$in':_0x4a1b81},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x8a96('0x33')]('NOW()\x20+\x20INTERVAL\x20'+_0x3a9081+_0x8a96('0x48')),'$gt':db['sequelize'][_0x8a96('0x33')]('NOW()')}},'UserId':{'$in':_0x377e2a}},'include':[{'model':db[_0x8a96('0x22')],'as':_0x8a96('0x27')},{'model':db['User'],'as':'Agent','attributes':['id',_0x8a96('0x49'),_0x8a96('0x4a')]},{'model':db[_0x8a96('0x4b')],'as':_0x8a96('0x4c')}]})[_0x8a96('0x17')](function(_0x584fd3){if(_0x584fd3[_0x8a96('0x29')]>0x0){return db[_0x8a96('0x23')][_0x8a96('0x24')](function(_0x33ccce){return db[_0x8a96('0x6')][_0x8a96('0x2b')]({'recallmeNotifiedDate':db[_0x8a96('0x23')][_0x8a96('0x33')]('NOW()')},{'where':{'id':{'$in':_[_0x8a96('0xe')](_0x584fd3,'id')}},'transaction':_0x33ccce})['then'](function(){_0x5a4251(_0x584fd3);})['catch'](function(_0x372cee){logger[_0x8a96('0x14')](_0x8a96('0x45'),_0x372cee[_0x8a96('0x15')],_0x3c7efb);_0x3c06cd(_0x314bd1['error'](0x1f4,_0x372cee['message']));});})['catch'](function(_0x402f40){logger[_0x8a96('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x402f40['message'],_0x3c7efb);_0x3c06cd(_0x314bd1[_0x8a96('0x14')](0x1f4,_0x402f40[_0x8a96('0x15')]));});}else{_0x5a4251(_0x584fd3);}});});}; \ No newline at end of file +var _0x1a12=['keys','Agent','name','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','sequelize','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','length','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','where','attributes','include','model','map','then','info','stringify','catch','error','message','find','raw','ShowCmHopper','debug','CreateCmHopper','body','UpdateCmHopper','update','limit','DestroyCmHopper','GetContactDialer','describe','transaction','findAll','order','LOCK','UPDATE','CmContact'];(function(_0x4e2d83,_0x339b19){var _0x352511=function(_0x5a2e69){while(--_0x5a2e69){_0x4e2d83['push'](_0x4e2d83['shift']());}};_0x352511(++_0x339b19);}(_0x1a12,0x80));var _0x21a1=function(_0x215ba5,_0x2ad099){_0x215ba5=_0x215ba5-0x0;var _0x445d70=_0x1a12[_0x215ba5];return _0x445d70;};'use strict';var _=require(_0x21a1('0x0'));var util=require(_0x21a1('0x1'));var moment=require(_0x21a1('0x2'));var BPromise=require(_0x21a1('0x3'));var db=require(_0x21a1('0x4'))['db'];var logger=require(_0x21a1('0x5'))('rpc');exports[_0x21a1('0x6')]=function(_0x544440){var _0x29a3c7=this;return new Promise(function(_0x485889,_0xd0d22a){return db[_0x21a1('0x7')]['findAll']({'raw':_0x544440[_0x21a1('0x8')]?_0x544440[_0x21a1('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x544440['options']?_0x544440[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x544440[_0x21a1('0x8')]?_0x544440[_0x21a1('0x8')][_0x21a1('0xa')]||null:null,'limit':_0x544440[_0x21a1('0x8')]?_0x544440['options']['limit']||null:null,'include':_0x544440[_0x21a1('0x8')]?_0x544440[_0x21a1('0x8')]['include']?_['map'](_0x544440[_0x21a1('0x8')][_0x21a1('0xb')],function(_0x15e2f9){return{'model':db[_0x15e2f9[_0x21a1('0xc')]],'as':_0x15e2f9['as'],'attributes':_0x15e2f9[_0x21a1('0xa')],'include':_0x15e2f9[_0x21a1('0xb')]?_[_0x21a1('0xd')](_0x15e2f9[_0x21a1('0xb')],function(_0x29bff6){return{'model':db[_0x29bff6['model']],'as':_0x29bff6['as'],'attributes':_0x29bff6[_0x21a1('0xa')],'include':_0x29bff6[_0x21a1('0xb')]?_[_0x21a1('0xd')](_0x29bff6['include'],function(_0x2227fb){return{'model':db[_0x2227fb[_0x21a1('0xc')]],'as':_0x2227fb['as'],'attributes':_0x2227fb[_0x21a1('0xa')]};}):[]};}):[]};}):[]:[]})[_0x21a1('0xe')](function(_0x1ec3c3){logger[_0x21a1('0xf')]('GetCmHopper',_0x544440);logger['debug'](_0x21a1('0x6'),_0x544440,JSON[_0x21a1('0x10')](_0x1ec3c3));_0x485889(_0x1ec3c3);})[_0x21a1('0x11')](function(_0x1bde99){logger[_0x21a1('0x12')](_0x21a1('0x6'),_0x1bde99[_0x21a1('0x13')],_0x544440);_0xd0d22a(_0x29a3c7[_0x21a1('0x12')](0x1f4,_0x1bde99[_0x21a1('0x13')]));});});};exports['ShowCmHopper']=function(_0x157aed){var _0x3680d6=this;return new Promise(function(_0x2aa800,_0x284acd){return db['CmHopper'][_0x21a1('0x14')]({'raw':_0x157aed[_0x21a1('0x8')]?_0x157aed[_0x21a1('0x8')][_0x21a1('0x15')]===undefined?!![]:![]:!![],'where':_0x157aed['options']?_0x157aed[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x157aed[_0x21a1('0x8')]?_0x157aed[_0x21a1('0x8')][_0x21a1('0xa')]||null:null,'include':_0x157aed[_0x21a1('0x8')]?_0x157aed[_0x21a1('0x8')][_0x21a1('0xb')]?_['map'](_0x157aed['options']['include'],function(_0x5561f4){return{'model':db[_0x5561f4[_0x21a1('0xc')]],'as':_0x5561f4['as'],'attributes':_0x5561f4[_0x21a1('0xa')],'include':_0x5561f4[_0x21a1('0xb')]?_['map'](_0x5561f4[_0x21a1('0xb')],function(_0x40ec13){return{'model':db[_0x40ec13[_0x21a1('0xc')]],'as':_0x40ec13['as'],'attributes':_0x40ec13['attributes'],'include':_0x40ec13[_0x21a1('0xb')]?_[_0x21a1('0xd')](_0x40ec13[_0x21a1('0xb')],function(_0x28cee1){return{'model':db[_0x28cee1['model']],'as':_0x28cee1['as'],'attributes':_0x28cee1[_0x21a1('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35d7ca){logger[_0x21a1('0xf')](_0x21a1('0x16'),_0x157aed);logger[_0x21a1('0x17')](_0x21a1('0x16'),_0x157aed,JSON[_0x21a1('0x10')](_0x35d7ca));_0x2aa800(_0x35d7ca);})[_0x21a1('0x11')](function(_0x18c09c){logger['error'](_0x21a1('0x16'),_0x18c09c[_0x21a1('0x13')],_0x157aed);_0x284acd(_0x3680d6[_0x21a1('0x12')](0x1f4,_0x18c09c[_0x21a1('0x13')]));});});};exports[_0x21a1('0x18')]=function(_0x4fb79b){var _0xcfbfac=this;return new Promise(function(_0x3eeeb4,_0x33769e){return db[_0x21a1('0x7')]['create'](_0x4fb79b[_0x21a1('0x19')],{'raw':_0x4fb79b['options']?_0x4fb79b[_0x21a1('0x8')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x501c66){logger[_0x21a1('0xf')]('CreateCmHopper',_0x4fb79b);logger[_0x21a1('0x17')](_0x21a1('0x18'),_0x4fb79b,JSON[_0x21a1('0x10')](_0x501c66));_0x3eeeb4(_0x501c66);})[_0x21a1('0x11')](function(_0x1cb852){logger[_0x21a1('0x12')](_0x21a1('0x18'),_0x1cb852['message'],_0x4fb79b);_0x33769e(_0xcfbfac['error'](0x1f4,_0x1cb852['message']));});});};exports[_0x21a1('0x1a')]=function(_0x1f7d33){var _0x389f26=this;return new Promise(function(_0x254ac6,_0x2f816b){return db[_0x21a1('0x7')][_0x21a1('0x1b')](_0x1f7d33[_0x21a1('0x19')],{'raw':_0x1f7d33['options']?_0x1f7d33['options'][_0x21a1('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f7d33[_0x21a1('0x8')]?_0x1f7d33[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x1f7d33[_0x21a1('0x8')]?_0x1f7d33[_0x21a1('0x8')][_0x21a1('0xa')]||null:null,'limit':_0x1f7d33[_0x21a1('0x8')]?_0x1f7d33[_0x21a1('0x8')][_0x21a1('0x1c')]||null:null})[_0x21a1('0xe')](function(_0x4a5d98){logger[_0x21a1('0xf')]('UpdateCmHopper',_0x1f7d33);logger[_0x21a1('0xf')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x21a1('0x10')](_0x1f7d33[_0x21a1('0x8')][_0x21a1('0x9')]),_0x1f7d33[_0x21a1('0x19')]['active']);logger[_0x21a1('0x17')](_0x21a1('0x1a'),_0x1f7d33,JSON['stringify'](_0x4a5d98));_0x254ac6(_0x4a5d98);})[_0x21a1('0x11')](function(_0x39532b){logger[_0x21a1('0x12')](_0x21a1('0x1a'),_0x39532b[_0x21a1('0x13')],_0x1f7d33);_0x2f816b(_0x389f26[_0x21a1('0x12')](0x1f4,_0x39532b['message']));});});};exports[_0x21a1('0x1d')]=function(_0x5ea743){var _0x35ff18=this;return new Promise(function(_0x27f2d6,_0x3feb72){return db[_0x21a1('0x7')]['destroy']({'where':_0x5ea743[_0x21a1('0x8')]?_0x5ea743['options'][_0x21a1('0x9')]||null:null})[_0x21a1('0xe')](function(_0xe5c8d3){logger[_0x21a1('0xf')](_0x21a1('0x1d'),_0x5ea743);logger[_0x21a1('0x17')]('DestroyCmHopper',_0x5ea743,JSON[_0x21a1('0x10')](_0xe5c8d3));_0x27f2d6(_0xe5c8d3);})[_0x21a1('0x11')](function(_0x13cd2b){logger['error']('DestroyCmHopper',_0x13cd2b[_0x21a1('0x13')],_0x5ea743);_0x3feb72(_0x35ff18['error'](0x1f4,_0x13cd2b[_0x21a1('0x13')]));});});};exports[_0x21a1('0x1e')]=function(_0x584f45){var _0x23ebbc=this;return new Promise(function(_0x87db61,_0x37457e){return db['CmContact'][_0x21a1('0x1f')]()[_0x21a1('0xe')](function(_0x57fb39){return db['sequelize'][_0x21a1('0x20')](function(_0x468c5b){return db[_0x21a1('0x7')][_0x21a1('0x21')]({'where':_0x584f45['options']?_0x584f45[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x584f45[_0x21a1('0x8')]?_0x584f45['options'][_0x21a1('0xa')]||null:null,'limit':_0x584f45[_0x21a1('0x8')]?_0x584f45[_0x21a1('0x8')][_0x21a1('0x1c')]||null:null,'order':_0x584f45[_0x21a1('0x8')]?_0x584f45[_0x21a1('0x8')][_0x21a1('0x22')]||null:null,'transaction':_0x468c5b,'lock':_0x468c5b[_0x21a1('0x23')][_0x21a1('0x24')],'include':[{'model':db[_0x21a1('0x25')],'as':'Contact','attributes':_[_0x21a1('0x26')](_0x57fb39)},{'model':db['User'],'as':_0x21a1('0x27'),'attributes':['id',_0x21a1('0x28'),_0x21a1('0x29')]}]})[_0x21a1('0xe')](function(_0x351517){var _0x15ac4=[];var _0x5d2154=[];for(var _0x5931a9=0x0;_0x5931a9<_0x351517['length'];_0x5931a9+=0x1){var _0x1c8f05=_0x351517[_0x5931a9][_0x21a1('0x2a')];if(_0x1c8f05===null){_0x15ac4[_0x21a1('0x2b')](_0x351517[_0x5931a9][_0x21a1('0x1b')](_0x584f45[_0x21a1('0x19')],{'transaction':_0x468c5b}));}else if(!_0x5d2154[_0x21a1('0x2c')](_0x1c8f05)){_0x5d2154['push'](_0x1c8f05);_0x15ac4[_0x21a1('0x2b')](_0x351517[_0x5931a9][_0x21a1('0x1b')](_0x584f45[_0x21a1('0x19')],{'transaction':_0x468c5b}));}}return BPromise[_0x21a1('0x2d')](_0x15ac4);});})[_0x21a1('0xe')](function(_0x23f9e5){logger['info']('GetContactDialer',_0x584f45);if(_0x23f9e5['length']>0x0){logger['info'](_0x21a1('0x2e'),_0x23f9e5[0x0][_0x21a1('0x2f')]['id'],_0x23f9e5[0x0][_0x21a1('0x2f')][_0x21a1('0x30')],_0x23f9e5[0x0][_0x21a1('0x2f')][_0x21a1('0x31')]);}logger[_0x21a1('0x17')]('GetContactDialer',_0x584f45,JSON[_0x21a1('0x10')](_0x23f9e5));_0x87db61(_0x23f9e5);})['catch'](function(_0xa276f4){logger[_0x21a1('0x12')](_0x21a1('0x1e'),_0xa276f4['message'],_0x584f45);_0x37457e(_0x23ebbc[_0x21a1('0x12')](0x1f4,_0xa276f4[_0x21a1('0x13')]));});});});};exports[_0x21a1('0x32')]=function(_0x54e9f1){var _0x439c08=this;return new Promise(function(_0x32c4a2,_0x3db239){return db[_0x21a1('0x33')][_0x21a1('0x20')](function(_0x4b111e){return db[_0x21a1('0x34')][_0x21a1('0x35')](_0x54e9f1[_0x21a1('0x19')],{'raw':_0x54e9f1[_0x21a1('0x8')]?_0x54e9f1[_0x21a1('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4b111e})[_0x21a1('0xe')](function(){logger[_0x21a1('0xf')](_0x21a1('0x36'),JSON[_0x21a1('0x10')](_0x54e9f1['options']['where']),_0x54e9f1[_0x21a1('0x8')][_0x21a1('0x9')]['active']);return db['CmHopper'][_0x21a1('0x37')]({'where':_0x54e9f1[_0x21a1('0x8')]?_0x54e9f1[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'transaction':_0x4b111e});});})['then'](function(_0x6b96e8){logger[_0x21a1('0xf')](_0x21a1('0x32'),_0x54e9f1);logger['debug'](_0x21a1('0x32'),_0x54e9f1,JSON[_0x21a1('0x10')](_0x6b96e8));_0x32c4a2(_0x6b96e8);})[_0x21a1('0x11')](function(_0x40fe8d){logger[_0x21a1('0x12')](_0x21a1('0x32'),_0x40fe8d['message'],_0x54e9f1);_0x3db239(_0x439c08['error'](0x1f4,_0x40fe8d[_0x21a1('0x13')]));});});};exports[_0x21a1('0x38')]=function(_0x5d3ef4){var _0x23110f=this;return new Promise(function(_0x2eeaac,_0x4594ae){return db['CmHopper']['findAll']({'raw':_0x5d3ef4['options']?_0x5d3ef4[_0x21a1('0x8')][_0x21a1('0x15')]===undefined?!![]:![]:!![],'where':_0x5d3ef4[_0x21a1('0x8')]?_0x5d3ef4[_0x21a1('0x8')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x21a1('0x39'),db[_0x21a1('0x33')]['fn']('IF',db[_0x21a1('0x33')][_0x21a1('0x3a')](_0x21a1('0x3b')+util['format'](_0x21a1('0x3c'),moment()[_0x21a1('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x21a1('0x3e')))),_0x21a1('0x3f')]]})[_0x21a1('0xe')](function(_0x561625){logger['info'](_0x21a1('0x38'),_0x5d3ef4);logger[_0x21a1('0x17')](_0x21a1('0x38'),_0x5d3ef4,JSON[_0x21a1('0x10')](_0x561625));_0x2eeaac(_0x561625);})[_0x21a1('0x11')](function(_0x212adf){logger[_0x21a1('0x12')](_0x21a1('0x38'),_0x212adf[_0x21a1('0x13')],_0x5d3ef4);_0x4594ae(_0x23110f[_0x21a1('0x12')](0x1f4,_0x212adf[_0x21a1('0x13')]));});});};exports[_0x21a1('0x40')]=function(_0x16f15a){var _0x398474=this;return new Promise(function(_0x14c01c,_0x5e8352){return db[_0x21a1('0x25')][_0x21a1('0x1f')]()[_0x21a1('0xe')](function(){return db[_0x21a1('0x33')]['transaction'](function(_0xdc5907){return db[_0x21a1('0x7')][_0x21a1('0x21')]({'where':_0x16f15a['options']?_0x16f15a[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x16f15a[_0x21a1('0x8')]?_0x16f15a[_0x21a1('0x8')][_0x21a1('0xa')]||null:null,'limit':0x1,'order':_0x16f15a[_0x21a1('0x8')]?_0x16f15a[_0x21a1('0x8')][_0x21a1('0x22')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0xdc5907,'lock':_0xdc5907[_0x21a1('0x23')][_0x21a1('0x24')],'include':_0x16f15a[_0x21a1('0x8')]?_0x16f15a[_0x21a1('0x8')][_0x21a1('0xb')]?_[_0x21a1('0xd')](_0x16f15a['options'][_0x21a1('0xb')],function(_0x2b44e3){return{'model':db[_0x2b44e3['model']],'as':_0x2b44e3['as'],'attributes':_0x2b44e3[_0x21a1('0xa')],'include':_0x2b44e3[_0x21a1('0xb')]?_[_0x21a1('0xd')](_0x2b44e3['include'],function(_0x127ead){return{'model':db[_0x127ead['model']],'as':_0x127ead['as'],'attributes':_0x127ead[_0x21a1('0xa')],'include':_0x127ead['include']?_[_0x21a1('0xd')](_0x127ead[_0x21a1('0xb')],function(_0x234bf6){return{'model':db[_0x234bf6['model']],'as':_0x234bf6['as'],'attributes':_0x234bf6['attributes']};}):[]};}):[]};}):[]:[]})[_0x21a1('0xe')](function(_0x3a55f4){var _0x3fee65=[];for(var _0x3ec881=0x0;_0x3ec881<_0x3a55f4['length'];_0x3ec881+=0x1){_0x3fee65[_0x21a1('0x2b')](_0x3a55f4[_0x3ec881][_0x21a1('0x1b')](_0x16f15a[_0x21a1('0x19')],{'transaction':_0xdc5907}));}return BPromise[_0x21a1('0x2d')](_0x3fee65);});})[_0x21a1('0xe')](function(_0x3e4dde){logger['info'](_0x21a1('0x40'),_0x16f15a);logger['debug'](_0x21a1('0x40'),_0x16f15a,JSON[_0x21a1('0x10')](_0x3e4dde));_0x14c01c(_0x3e4dde);})[_0x21a1('0x11')](function(_0x281dcb){logger[_0x21a1('0x12')]('GetContactRecallMe',_0x281dcb['message'],_0x16f15a);_0x5e8352(_0x398474['error'](0x1f4,_0x281dcb[_0x21a1('0x13')]));});});});};exports[_0x21a1('0x41')]=function(_0x5cd8ca){var _0x3d2fec=this;return new Promise(function(_0x307263,_0x4182d3){db[_0x21a1('0x25')]['describe']()[_0x21a1('0xe')](function(_0x315c15){return db[_0x21a1('0x7')][_0x21a1('0x21')]({'raw':_0x5cd8ca['options']?_0x5cd8ca[_0x21a1('0x8')][_0x21a1('0x15')]===undefined?!![]:![]:!![],'where':_0x5cd8ca[_0x21a1('0x8')]?_0x5cd8ca[_0x21a1('0x8')][_0x21a1('0x9')]||null:null,'attributes':_0x5cd8ca[_0x21a1('0x8')]?_0x5cd8ca[_0x21a1('0x8')][_0x21a1('0xa')]||null:null,'limit':_0x5cd8ca[_0x21a1('0x8')]?_0x5cd8ca['options'][_0x21a1('0x1c')]||null:null,'include':_0x5cd8ca[_0x21a1('0x8')]?_0x5cd8ca[_0x21a1('0x8')][_0x21a1('0xb')]?_['map'](_0x5cd8ca[_0x21a1('0x8')][_0x21a1('0xb')],function(_0x2a6865){return{'model':db[_0x2a6865[_0x21a1('0xc')]],'as':_0x2a6865['as'],'attributes':_0x2a6865['as']===_0x21a1('0x42')?_[_0x21a1('0x26')](_0x315c15):_0x2a6865[_0x21a1('0xa')],'include':_0x2a6865[_0x21a1('0xb')]?_['map'](_0x2a6865[_0x21a1('0xb')],function(_0x3753c8){return{'model':db[_0x3753c8[_0x21a1('0xc')]],'as':_0x3753c8['as'],'attributes':_0x3753c8[_0x21a1('0xa')],'include':_0x3753c8['include']?_[_0x21a1('0xd')](_0x3753c8[_0x21a1('0xb')],function(_0x3729e9){return{'model':db[_0x3729e9[_0x21a1('0xc')]],'as':_0x3729e9['as'],'attributes':_0x3729e9[_0x21a1('0xa')]};}):[]};}):[]};}):[]:[]})[_0x21a1('0xe')](function(_0x42cc38){logger[_0x21a1('0xf')]('GetCmHopper',_0x5cd8ca);logger[_0x21a1('0x17')](_0x21a1('0x6'),_0x5cd8ca,JSON[_0x21a1('0x10')](_0x42cc38));_0x307263(_0x42cc38);})[_0x21a1('0x11')](function(_0x3c22ea){logger[_0x21a1('0x12')](_0x21a1('0x6'),_0x3c22ea[_0x21a1('0x13')],_0x5cd8ca);_0x4182d3(_0x3d2fec[_0x21a1('0x12')](0x1f4,_0x3c22ea[_0x21a1('0x13')]));});});});};exports[_0x21a1('0x43')]=function(_0x448f91){var _0x18207b=this;return new Promise(function(_0x5ad8da,_0x2b04d0){return db[_0x21a1('0x25')][_0x21a1('0x44')]({'raw':!![],'where':{'phone':_0x448f91[_0x21a1('0x8')]['where'][_0x21a1('0x45')]},'attributes':['id',_0x21a1('0x46')],'order':[['id',_0x21a1('0x47')]]})['then'](function(_0x24ae70){logger[_0x21a1('0xf')](_0x21a1('0x48'),_0x448f91);logger[_0x21a1('0x17')](_0x21a1('0x48'),_0x448f91,JSON['stringify'](_0x24ae70));_0x5ad8da(_0x24ae70);})[_0x21a1('0x11')](function(_0x79e0e9){logger[_0x21a1('0x12')](_0x21a1('0x48'),_0x79e0e9[_0x21a1('0x13')],_0x448f91);_0x2b04d0(_0x18207b[_0x21a1('0x12')](0x1f4,_0x79e0e9['message']));});});};exports['ResetActiveCalls']=function(_0x4ffa6e){var _0x5882b0=this;return new Promise(function(_0x564cc1,_0x284d80){return db[_0x21a1('0x33')][_0x21a1('0x20')](function(_0x5bb48b){var _0x33a777=_0x4ffa6e[_0x21a1('0x8')]&&_0x4ffa6e['options'][_0x21a1('0x9')]?_0x4ffa6e[_0x21a1('0x8')][_0x21a1('0x9')]:{};return db[_0x21a1('0x7')]['update'](_0x4ffa6e[_0x21a1('0x19')],{'where':_0x33a777,'transaction':_0x5bb48b})['then'](function(_0x428ed5){logger[_0x21a1('0xf')]('ResetActiveCalls',_0x4ffa6e);logger[_0x21a1('0x17')](_0x21a1('0x49'),_0x4ffa6e,JSON[_0x21a1('0x10')](_0x428ed5));_0x564cc1(_0x428ed5);})['catch'](function(_0x134e87){logger[_0x21a1('0x12')](_0x21a1('0x49'),_0x134e87[_0x21a1('0x13')],_0x4ffa6e);_0x284d80(_0x5882b0[_0x21a1('0x12')](0x1f4,_0x134e87[_0x21a1('0x13')]));});});});};exports[_0x21a1('0x4a')]=function(_0x26781c){var _0x21fa37=this;var _0x4bb94e=_0x26781c['body'][_0x21a1('0x9')][_0x21a1('0x4b')];var _0x1785bf=_0x26781c[_0x21a1('0x19')][_0x21a1('0x9')][_0x21a1('0x4c')];var _0x203aa3=_0x26781c[_0x21a1('0x19')][_0x21a1('0x9')]['availableAgentsIds'];return new Promise(function(_0x374fcf,_0x33a7f3){return db[_0x21a1('0x7')][_0x21a1('0x21')]({'where':{'voiceQueueId':{'$in':_0x4bb94e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x21a1('0x3a')](_0x21a1('0x4d')+_0x1785bf+_0x21a1('0x4e')),'$gt':db[_0x21a1('0x33')][_0x21a1('0x3a')](_0x21a1('0x4f'))}},'UserId':{'$in':_0x203aa3}},'include':[{'model':db[_0x21a1('0x25')],'as':_0x21a1('0x42')},{'model':db[_0x21a1('0x50')],'as':'Agent','attributes':['id',_0x21a1('0x28'),_0x21a1('0x29')]},{'model':db[_0x21a1('0x51')],'as':'List'}]})['then'](function(_0x2c0b03){if(_0x2c0b03[_0x21a1('0x52')]>0x0){return db[_0x21a1('0x33')][_0x21a1('0x20')](function(_0x2998a0){return db[_0x21a1('0x7')][_0x21a1('0x1b')]({'recallmeNotifiedDate':db['sequelize'][_0x21a1('0x3a')](_0x21a1('0x4f'))},{'where':{'id':{'$in':_['map'](_0x2c0b03,'id')}},'transaction':_0x2998a0})['then'](function(){_0x374fcf(_0x2c0b03);})[_0x21a1('0x11')](function(_0x44cb8e){logger[_0x21a1('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x44cb8e['message'],_0x26781c);_0x33a7f3(_0x21fa37[_0x21a1('0x12')](0x1f4,_0x44cb8e[_0x21a1('0x13')]));});})[_0x21a1('0x11')](function(_0x5d586c){logger[_0x21a1('0x12')](_0x21a1('0x4a'),_0x5d586c[_0x21a1('0x13')],_0x26781c);_0x33a7f3(_0x21fa37['error'](0x1f4,_0x5d586c[_0x21a1('0x13')]));});}else{_0x374fcf(_0x2c0b03);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 73ddcc2..cb5f0cd 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 _0xa61f=['/:id','update','delete','destroy','exports','Router','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','getPreviewRecall','create','post','/preview','getPreview','/timezone','getTimezone','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa61f,0x165));var _0xfa61=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa61f[_0x53ccf2];return _0x5a2964;};'use strict';var express=require('express');var router=express[_0xfa61('0x0')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router['get']('/',auth[_0xfa61('0x1')](),controller[_0xfa61('0x2')]);router[_0xfa61('0x3')](_0xfa61('0x4'),auth[_0xfa61('0x1')](),controller['describe']);router[_0xfa61('0x3')](_0xfa61('0x5'),auth[_0xfa61('0x1')](),controller[_0xfa61('0x6')]);router[_0xfa61('0x3')](_0xfa61('0x7'),auth['isAuthenticated'](),controller[_0xfa61('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/previewrecall',auth[_0xfa61('0x1')](),controller[_0xfa61('0x9')]);router['post']('/',auth[_0xfa61('0x1')](),controller[_0xfa61('0xa')]);router[_0xfa61('0xb')](_0xfa61('0xc'),auth[_0xfa61('0x1')](),controller[_0xfa61('0xd')]);router['post'](_0xfa61('0xe'),auth[_0xfa61('0x1')](),controller[_0xfa61('0xf')]);router[_0xfa61('0x10')](_0xfa61('0x11'),auth[_0xfa61('0x1')](),controller[_0xfa61('0x12')]);router[_0xfa61('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfa61('0x14')]);module[_0xfa61('0x15')]=router; \ No newline at end of file +var _0x76b8=['/preview','getPreview','/timezone','put','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','getOpenContacts','/:id','show','post','create'];(function(_0x3170e1,_0x484124){var _0x4999f7=function(_0x2a79b5){while(--_0x2a79b5){_0x3170e1['push'](_0x3170e1['shift']());}};_0x4999f7(++_0x484124);}(_0x76b8,0x120));var _0x876b=function(_0xfb8e9c,_0x4bfaec){_0xfb8e9c=_0xfb8e9c-0x0;var _0x432968=_0x76b8[_0xfb8e9c];return _0x432968;};'use strict';var express=require('express');var router=express[_0x876b('0x0')]();var auth=require(_0x876b('0x1'));var controller=require(_0x876b('0x2'));router[_0x876b('0x3')]('/',auth[_0x876b('0x4')](),controller['index']);router[_0x876b('0x3')](_0x876b('0x5'),auth[_0x876b('0x4')](),controller[_0x876b('0x6')]);router[_0x876b('0x3')]('/opencontacts',auth[_0x876b('0x4')](),controller[_0x876b('0x7')]);router['get']('/timezones',auth['isAuthenticated'](),controller['getTimezones']);router[_0x876b('0x3')](_0x876b('0x8'),auth[_0x876b('0x4')](),controller[_0x876b('0x9')]);router['get']('/:id/previewrecall',auth[_0x876b('0x4')](),controller['getPreviewRecall']);router[_0x876b('0xa')]('/',auth[_0x876b('0x4')](),controller[_0x876b('0xb')]);router['post'](_0x876b('0xc'),auth[_0x876b('0x4')](),controller[_0x876b('0xd')]);router[_0x876b('0xa')](_0x876b('0xe'),auth[_0x876b('0x4')](),controller['getTimezone']);router[_0x876b('0xf')](_0x876b('0x8'),auth['isAuthenticated'](),controller[_0x876b('0x10')]);router[_0x876b('0x11')](_0x876b('0x8'),auth[_0x876b('0x4')](),controller[_0x876b('0x12')]);module[_0x876b('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index d4b4b5e..e9eba7d 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 _0xa678=['format','sequelize','exports','INTEGER','STRING','DATE'];(function(_0xb179b5,_0x3601bf){var _0x4088a7=function(_0x41a21f){while(--_0x41a21f){_0xb179b5['push'](_0xb179b5['shift']());}};_0x4088a7(++_0x3601bf);}(_0xa678,0x127));var _0x8a67=function(_0x427431,_0x301d23){_0x427431=_0x427431-0x0;var _0xc74fc7=_0xa678[_0x427431];return _0xc74fc7;};'use strict';var moment=require('moment');var Sequelize=require(_0x8a67('0x0'));module[_0x8a67('0x1')]={'CmHopperId':{'type':Sequelize[_0x8a67('0x2')]},'phone':{'type':Sequelize[_0x8a67('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':moment()[_0x8a67('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8a67('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8a67('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8a67('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8a67('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8a67('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbe49=['STRING','format','moment','exports','INTEGER'];(function(_0x1eb613,_0x36474f){var _0x46b625=function(_0x1a25f9){while(--_0x1a25f9){_0x1eb613['push'](_0x1eb613['shift']());}};_0x46b625(++_0x36474f);}(_0xbe49,0x1c4));var _0x9be4=function(_0x2cd821,_0x32f974){_0x2cd821=_0x2cd821-0x0;var _0x4a4b83=_0xbe49[_0x2cd821];return _0x4a4b83;};'use strict';var moment=require(_0x9be4('0x0'));var Sequelize=require('sequelize');module[_0x9be4('0x1')]={'CmHopperId':{'type':Sequelize[_0x9be4('0x2')]},'phone':{'type':Sequelize[_0x9be4('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9be4('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9be4('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index b6f8ac3..d3eb3fe 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 _0xd3fe=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','get','CmHopperAdditionalPhones','destroy','end','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key'];(function(_0x4a6fca,_0x26605d){var _0x7ed9b=function(_0x980f22){while(--_0x980f22){_0x4a6fca['push'](_0x4a6fca['shift']());}};_0x7ed9b(++_0x26605d);}(_0xd3fe,0x13d));var _0xed3f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd3fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xed3f('0x0'));var rimraf=require(_0xed3f('0x1'));var zipdir=require(_0xed3f('0x2'));var jsonpatch=require(_0xed3f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xed3f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed3f('0x5'));var csv=require(_0xed3f('0x6'));var ejs=require(_0xed3f('0x7'));var fs=require('fs');var fs_extra=require(_0xed3f('0x8'));var _=require('lodash');var squel=require(_0xed3f('0x9'));var crypto=require(_0xed3f('0xa'));var jsforce=require(_0xed3f('0xb'));var deskjs=require(_0xed3f('0xc'));var toCsv=require(_0xed3f('0x6'));var querystring=require(_0xed3f('0xd'));var Papa=require('papaparse');var Redis=require(_0xed3f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed3f('0xf'));var hardwareService=require(_0xed3f('0x10'));var logger=require(_0xed3f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xed3f('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc8bed,_0x5b8376){_0x5b8376=_0x5b8376||0xcc;return function(_0xa6fc2){if(_0xa6fc2){return _0xc8bed[_0xed3f('0x13')](_0x5b8376);}return _0xc8bed[_0xed3f('0x14')](_0x5b8376)['end']();};}function respondWithResult(_0x40e5b5,_0x348545){_0x348545=_0x348545||0xc8;return function(_0x582341){if(_0x582341){return _0x40e5b5[_0xed3f('0x14')](_0x348545)[_0xed3f('0x15')](_0x582341);}};}function respondWithFilteredResult(_0x3c60a2,_0x290993){return function(_0xcbaaa){if(_0xcbaaa){var _0x4612d7=typeof _0x290993[_0xed3f('0x16')]===_0xed3f('0x17')&&typeof _0x290993[_0xed3f('0x18')]===_0xed3f('0x17');var _0x3be0d8=_0xcbaaa['count'];var _0x522ce2=_0x4612d7?0x0:_0x290993[_0xed3f('0x16')];var _0xc9703b=_0x4612d7?_0xcbaaa[_0xed3f('0x19')]:_0x290993[_0xed3f('0x16')]+_0x290993[_0xed3f('0x18')];var _0x3301f3;if(_0xc9703b>=_0x3be0d8){_0xc9703b=_0x3be0d8;_0x3301f3=0xc8;}else{_0x3301f3=0xce;}_0x3c60a2[_0xed3f('0x14')](_0x3301f3);return _0x3c60a2[_0xed3f('0x1a')]('Content-Range',_0x522ce2+'-'+_0xc9703b+'/'+_0x3be0d8)[_0xed3f('0x15')](_0xcbaaa);}return null;};}function patchUpdates(_0x4d9140){return function(_0x1eac0c){try{jsonpatch[_0xed3f('0x1b')](_0x1eac0c,_0x4d9140,!![]);}catch(_0x5579a5){return BPromise[_0xed3f('0x1c')](_0x5579a5);}return _0x1eac0c['save']();};}function saveUpdates(_0xd82ba0,_0x11af6b){return function(_0x5deb78){if(_0x5deb78){return _0x5deb78['update'](_0xd82ba0)[_0xed3f('0x1d')](function(_0x1738e9){return _0x1738e9;});}return null;};}function removeEntity(_0x6bb024,_0x481468){return function(_0x4ec0ea){if(_0x4ec0ea){return _0x4ec0ea['destroy']()[_0xed3f('0x1d')](function(){var _0xc6a2a9=_0x4ec0ea[_0xed3f('0x1e')]({'plain':!![]});var _0x22126c=_0xed3f('0x1f');return db['UserProfileResource'][_0xed3f('0x20')]({'where':{'type':_0x22126c,'resourceId':_0xc6a2a9['id']}})['then'](function(){return _0x4ec0ea;});})[_0xed3f('0x1d')](function(){_0x6bb024['status'](0xcc)[_0xed3f('0x21')]();});}};}function handleEntityNotFound(_0x5aae3a,_0x3dac06){return function(_0x515ca9){if(!_0x515ca9){_0x5aae3a[_0xed3f('0x13')](0x194);}return _0x515ca9;};}function handleError(_0x614881,_0x4a3ad8){_0x4a3ad8=_0x4a3ad8||0x1f4;return function(_0x26ffd4){logger[_0xed3f('0x22')](_0x26ffd4['stack']);if(_0x26ffd4[_0xed3f('0x23')]){delete _0x26ffd4[_0xed3f('0x23')];}_0x614881['status'](_0x4a3ad8)['send'](_0x26ffd4);};}exports[_0xed3f('0x24')]=function(_0xfc315e,_0x4c45e8){var _0xbb5e7c={},_0x1a0620={},_0x291d60={'count':0x0,'rows':[]};var _0x474b7b=_[_0xed3f('0x25')](db[_0xed3f('0x26')][_0xed3f('0x27')],function(_0x5f5a81){return{'name':_0x5f5a81[_0xed3f('0x28')],'type':_0x5f5a81[_0xed3f('0x29')][_0xed3f('0x2a')]};});_0x1a0620[_0xed3f('0x2b')]=_[_0xed3f('0x25')](_0x474b7b,_0xed3f('0x23'));_0x1a0620[_0xed3f('0x2c')]=_[_0xed3f('0x2d')](_0xfc315e['query']);_0x1a0620[_0xed3f('0x2e')]=_[_0xed3f('0x2f')](_0x1a0620[_0xed3f('0x2b')],_0x1a0620['query']);_0xbb5e7c[_0xed3f('0x30')]=_[_0xed3f('0x2f')](_0x1a0620[_0xed3f('0x2b')],qs['fields'](_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x31')]));_0xbb5e7c[_0xed3f('0x30')]=_0xbb5e7c[_0xed3f('0x30')][_0xed3f('0x32')]?_0xbb5e7c[_0xed3f('0x30')]:_0x1a0620[_0xed3f('0x2b')];if(!_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x33')](_0xed3f('0x34'))){_0xbb5e7c[_0xed3f('0x18')]=qs['limit'](_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x18')]);_0xbb5e7c[_0xed3f('0x16')]=qs[_0xed3f('0x16')](_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x16')]);}_0xbb5e7c[_0xed3f('0x35')]=qs[_0xed3f('0x36')](_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x36')]);_0xbb5e7c[_0xed3f('0x37')]=qs[_0xed3f('0x2e')](_['pick'](_0xfc315e['query'],_0x1a0620[_0xed3f('0x2e')]),_0x474b7b);if(_0xfc315e['query'][_0xed3f('0x38')]){_0xbb5e7c[_0xed3f('0x37')]=_[_0xed3f('0x39')](_0xbb5e7c[_0xed3f('0x37')],{'$or':_[_0xed3f('0x25')](_0x474b7b,function(_0xccacd0){if(_0xccacd0[_0xed3f('0x29')]!==_0xed3f('0x3a')){var _0x353cf3={};_0x353cf3[_0xccacd0[_0xed3f('0x23')]]={'$like':'%'+_0xfc315e[_0xed3f('0x2c')][_0xed3f('0x38')]+'%'};return _0x353cf3;}})});}_0xbb5e7c=_[_0xed3f('0x39')]({},_0xbb5e7c,_0xfc315e[_0xed3f('0x3b')]);var _0x347b66={'where':_0xbb5e7c[_0xed3f('0x37')]};return db[_0xed3f('0x26')][_0xed3f('0x19')](_0x347b66)[_0xed3f('0x1d')](function(_0x3e5d0e){_0x291d60[_0xed3f('0x19')]=_0x3e5d0e;if(_0xfc315e[_0xed3f('0x2c')]['includeAll']){_0xbb5e7c[_0xed3f('0x3c')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xed3f('0x3d')](_0xbb5e7c);})[_0xed3f('0x1d')](function(_0x1d5e44){_0x291d60[_0xed3f('0x3e')]=_0x1d5e44;return _0x291d60;})[_0xed3f('0x1d')](respondWithFilteredResult(_0x4c45e8,_0xbb5e7c))[_0xed3f('0x3f')](handleError(_0x4c45e8,null));};exports[_0xed3f('0x40')]=function(_0x5491ee,_0x34188a){var _0x343bbf={'raw':!![],'where':{'id':_0x5491ee['params']['id']}},_0x27dc77={};_0x27dc77[_0xed3f('0x2b')]=_[_0xed3f('0x2d')](db[_0xed3f('0x26')][_0xed3f('0x27')]);_0x27dc77[_0xed3f('0x2c')]=_[_0xed3f('0x2d')](_0x5491ee['query']);_0x27dc77[_0xed3f('0x2e')]=_[_0xed3f('0x2f')](_0x27dc77[_0xed3f('0x2b')],_0x27dc77['query']);_0x343bbf[_0xed3f('0x30')]=_['intersection'](_0x27dc77['model'],qs[_0xed3f('0x31')](_0x5491ee[_0xed3f('0x2c')]['fields']));_0x343bbf[_0xed3f('0x30')]=_0x343bbf[_0xed3f('0x30')][_0xed3f('0x32')]?_0x343bbf[_0xed3f('0x30')]:_0x27dc77[_0xed3f('0x2b')];if(_0x5491ee[_0xed3f('0x2c')]['includeAll']){_0x343bbf[_0xed3f('0x3c')]=[{'all':!![]}];}_0x343bbf=_['merge']({},_0x343bbf,_0x5491ee[_0xed3f('0x3b')]);return db[_0xed3f('0x26')][_0xed3f('0x41')](_0x343bbf)['then'](handleEntityNotFound(_0x34188a,null))[_0xed3f('0x1d')](respondWithResult(_0x34188a,null))[_0xed3f('0x3f')](handleError(_0x34188a,null));};exports[_0xed3f('0x42')]=function(_0x5ce97c,_0x3407f8){return db[_0xed3f('0x26')][_0xed3f('0x42')](_0x5ce97c[_0xed3f('0x43')],{})[_0xed3f('0x1d')](function(_0x2cf29b){var _0x10b522=_0x5ce97c[_0xed3f('0x44')][_0xed3f('0x1e')]({'plain':!![]});if(!_0x10b522)throw new Error(_0xed3f('0x45'));if(_0x10b522['role']===_0xed3f('0x44')){var _0x3856a4=_0x2cf29b[_0xed3f('0x1e')]({'plain':!![]});var _0x4149ea='CmHopperAdditionalPhones';return db['UserProfileSection'][_0xed3f('0x41')]({'where':{'name':_0x4149ea,'userProfileId':_0x10b522[_0xed3f('0x46')]},'raw':!![]})[_0xed3f('0x1d')](function(_0x68cb33){if(_0x68cb33&&_0x68cb33['autoAssociation']===0x0){return db[_0xed3f('0x47')]['create']({'name':_0x3856a4['name'],'resourceId':_0x3856a4['id'],'type':_0x68cb33['name'],'sectionId':_0x68cb33['id']},{})[_0xed3f('0x1d')](function(){return _0x2cf29b;});}else{return _0x2cf29b;}})[_0xed3f('0x3f')](function(_0x43e450){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43e450);throw _0x43e450;});}return _0x2cf29b;})[_0xed3f('0x1d')](respondWithResult(_0x3407f8,0xc9))['catch'](handleError(_0x3407f8,null));};exports['update']=function(_0x245dca,_0x517c84){if(_0x245dca[_0xed3f('0x43')]['id']){delete _0x245dca[_0xed3f('0x43')]['id'];}return db[_0xed3f('0x26')][_0xed3f('0x41')]({'where':{'id':_0x245dca['params']['id']}})[_0xed3f('0x1d')](handleEntityNotFound(_0x517c84,null))[_0xed3f('0x1d')](saveUpdates(_0x245dca[_0xed3f('0x43')],null))[_0xed3f('0x1d')](respondWithResult(_0x517c84,null))[_0xed3f('0x3f')](handleError(_0x517c84,null));};exports[_0xed3f('0x20')]=function(_0x13a406,_0x577d1d){return db['CmHopperAdditionalPhone'][_0xed3f('0x41')]({'where':{'id':_0x13a406['params']['id']}})[_0xed3f('0x1d')](handleEntityNotFound(_0x577d1d,null))[_0xed3f('0x1d')](removeEntity(_0x577d1d,null))[_0xed3f('0x3f')](handleError(_0x577d1d,null));}; \ No newline at end of file +var _0x068f=['update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','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','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x068f,0x186));var _0xf068=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x068f[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xf068('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf068('0x1'));var rp=require(_0xf068('0x2'));var moment=require(_0xf068('0x3'));var BPromise=require(_0xf068('0x4'));var Mustache=require(_0xf068('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf068('0x6'));var csv=require(_0xf068('0x7'));var ejs=require(_0xf068('0x8'));var fs=require('fs');var fs_extra=require(_0xf068('0x9'));var _=require(_0xf068('0xa'));var squel=require(_0xf068('0xb'));var crypto=require(_0xf068('0xc'));var jsforce=require(_0xf068('0xd'));var deskjs=require(_0xf068('0xe'));var toCsv=require(_0xf068('0x7'));var querystring=require(_0xf068('0xf'));var Papa=require(_0xf068('0x10'));var Redis=require(_0xf068('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf068('0x12'));var as=require(_0xf068('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf068('0x14'));var utils=require(_0xf068('0x15'));var config=require(_0xf068('0x16'));var licenseUtil=require(_0xf068('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4e2a,_0x5415f6){_0x5415f6=_0x5415f6||0xcc;return function(_0x5ad34f){if(_0x5ad34f){return _0x5e4e2a['sendStatus'](_0x5415f6);}return _0x5e4e2a[_0xf068('0x18')](_0x5415f6)[_0xf068('0x19')]();};}function respondWithResult(_0x4649f9,_0x20f9a0){_0x20f9a0=_0x20f9a0||0xc8;return function(_0x40e84a){if(_0x40e84a){return _0x4649f9[_0xf068('0x18')](_0x20f9a0)[_0xf068('0x1a')](_0x40e84a);}};}function respondWithFilteredResult(_0x35812f,_0x456473){return function(_0x4da1fd){if(_0x4da1fd){var _0x51c8e3=typeof _0x456473[_0xf068('0x1b')]===_0xf068('0x1c')&&typeof _0x456473['limit']==='undefined';var _0x3c0961=_0x4da1fd[_0xf068('0x1d')];var _0x4007ff=_0x51c8e3?0x0:_0x456473[_0xf068('0x1b')];var _0x3c9c53=_0x51c8e3?_0x4da1fd[_0xf068('0x1d')]:_0x456473[_0xf068('0x1b')]+_0x456473[_0xf068('0x1e')];var _0x4f0dfa;if(_0x3c9c53>=_0x3c0961){_0x3c9c53=_0x3c0961;_0x4f0dfa=0xc8;}else{_0x4f0dfa=0xce;}_0x35812f['status'](_0x4f0dfa);return _0x35812f[_0xf068('0x1f')](_0xf068('0x20'),_0x4007ff+'-'+_0x3c9c53+'/'+_0x3c0961)[_0xf068('0x1a')](_0x4da1fd);}return null;};}function patchUpdates(_0x10ff2c){return function(_0x213900){try{jsonpatch[_0xf068('0x21')](_0x213900,_0x10ff2c,!![]);}catch(_0x12fade){return BPromise['reject'](_0x12fade);}return _0x213900[_0xf068('0x22')]();};}function saveUpdates(_0x40db2f,_0x35707d){return function(_0x1d864d){if(_0x1d864d){return _0x1d864d[_0xf068('0x23')](_0x40db2f)['then'](function(_0x45825e){return _0x45825e;});}return null;};}function removeEntity(_0x3e1126,_0x2e7b03){return function(_0x4d0c3e){if(_0x4d0c3e){return _0x4d0c3e[_0xf068('0x24')]()[_0xf068('0x25')](function(){var _0x46b48d=_0x4d0c3e[_0xf068('0x26')]({'plain':!![]});var _0x53e7fd='CmHopperAdditionalPhones';return db[_0xf068('0x27')][_0xf068('0x24')]({'where':{'type':_0x53e7fd,'resourceId':_0x46b48d['id']}})[_0xf068('0x25')](function(){return _0x4d0c3e;});})['then'](function(){_0x3e1126[_0xf068('0x18')](0xcc)[_0xf068('0x19')]();});}};}function handleEntityNotFound(_0x1723cf,_0x454f3c){return function(_0x168d77){if(!_0x168d77){_0x1723cf[_0xf068('0x28')](0x194);}return _0x168d77;};}function handleError(_0x4c6f37,_0x3ffd9e){_0x3ffd9e=_0x3ffd9e||0x1f4;return function(_0x3314a5){logger[_0xf068('0x29')](_0x3314a5[_0xf068('0x2a')]);if(_0x3314a5[_0xf068('0x2b')]){delete _0x3314a5[_0xf068('0x2b')];}_0x4c6f37[_0xf068('0x18')](_0x3ffd9e)[_0xf068('0x2c')](_0x3314a5);};}exports[_0xf068('0x2d')]=function(_0x22244c,_0x11ae8b){var _0x3a6357={},_0x4fa366={},_0x5a5c42={'count':0x0,'rows':[]};var _0x1d2102=_[_0xf068('0x2e')](db[_0xf068('0x2f')]['rawAttributes'],function(_0x2bab64){return{'name':_0x2bab64[_0xf068('0x30')],'type':_0x2bab64[_0xf068('0x31')][_0xf068('0x32')]};});_0x4fa366[_0xf068('0x33')]=_[_0xf068('0x2e')](_0x1d2102,_0xf068('0x2b'));_0x4fa366['query']=_[_0xf068('0x34')](_0x22244c[_0xf068('0x35')]);_0x4fa366[_0xf068('0x36')]=_['intersection'](_0x4fa366[_0xf068('0x33')],_0x4fa366[_0xf068('0x35')]);_0x3a6357[_0xf068('0x37')]=_[_0xf068('0x38')](_0x4fa366[_0xf068('0x33')],qs[_0xf068('0x39')](_0x22244c[_0xf068('0x35')][_0xf068('0x39')]));_0x3a6357[_0xf068('0x37')]=_0x3a6357[_0xf068('0x37')]['length']?_0x3a6357[_0xf068('0x37')]:_0x4fa366[_0xf068('0x33')];if(!_0x22244c[_0xf068('0x35')][_0xf068('0x3a')](_0xf068('0x3b'))){_0x3a6357[_0xf068('0x1e')]=qs['limit'](_0x22244c[_0xf068('0x35')][_0xf068('0x1e')]);_0x3a6357[_0xf068('0x1b')]=qs[_0xf068('0x1b')](_0x22244c['query'][_0xf068('0x1b')]);}_0x3a6357[_0xf068('0x3c')]=qs[_0xf068('0x3d')](_0x22244c['query']['sort']);_0x3a6357[_0xf068('0x3e')]=qs[_0xf068('0x36')](_['pick'](_0x22244c[_0xf068('0x35')],_0x4fa366[_0xf068('0x36')]),_0x1d2102);if(_0x22244c['query']['filter']){_0x3a6357[_0xf068('0x3e')]=_['merge'](_0x3a6357[_0xf068('0x3e')],{'$or':_[_0xf068('0x2e')](_0x1d2102,function(_0x44f451){if(_0x44f451[_0xf068('0x31')]!==_0xf068('0x3f')){var _0x4de830={};_0x4de830[_0x44f451[_0xf068('0x2b')]]={'$like':'%'+_0x22244c['query']['filter']+'%'};return _0x4de830;}})});}_0x3a6357=_[_0xf068('0x40')]({},_0x3a6357,_0x22244c[_0xf068('0x41')]);var _0x7375ac={'where':_0x3a6357['where']};return db[_0xf068('0x2f')][_0xf068('0x1d')](_0x7375ac)['then'](function(_0x5c51db){_0x5a5c42[_0xf068('0x1d')]=_0x5c51db;if(_0x22244c['query'][_0xf068('0x42')]){_0x3a6357[_0xf068('0x43')]=[{'all':!![]}];}return db[_0xf068('0x2f')][_0xf068('0x44')](_0x3a6357);})[_0xf068('0x25')](function(_0x5cc3b6){_0x5a5c42[_0xf068('0x45')]=_0x5cc3b6;return _0x5a5c42;})['then'](respondWithFilteredResult(_0x11ae8b,_0x3a6357))[_0xf068('0x46')](handleError(_0x11ae8b,null));};exports[_0xf068('0x47')]=function(_0x58157a,_0x5a9ab8){var _0x333e04={'raw':!![],'where':{'id':_0x58157a[_0xf068('0x48')]['id']}},_0x1029ab={};_0x1029ab[_0xf068('0x33')]=_[_0xf068('0x34')](db['CmHopperAdditionalPhone'][_0xf068('0x49')]);_0x1029ab[_0xf068('0x35')]=_[_0xf068('0x34')](_0x58157a[_0xf068('0x35')]);_0x1029ab[_0xf068('0x36')]=_[_0xf068('0x38')](_0x1029ab[_0xf068('0x33')],_0x1029ab['query']);_0x333e04[_0xf068('0x37')]=_['intersection'](_0x1029ab[_0xf068('0x33')],qs[_0xf068('0x39')](_0x58157a[_0xf068('0x35')][_0xf068('0x39')]));_0x333e04['attributes']=_0x333e04['attributes'][_0xf068('0x4a')]?_0x333e04[_0xf068('0x37')]:_0x1029ab['model'];if(_0x58157a['query'][_0xf068('0x42')]){_0x333e04['include']=[{'all':!![]}];}_0x333e04=_['merge']({},_0x333e04,_0x58157a[_0xf068('0x41')]);return db[_0xf068('0x2f')][_0xf068('0x4b')](_0x333e04)[_0xf068('0x25')](handleEntityNotFound(_0x5a9ab8,null))[_0xf068('0x25')](respondWithResult(_0x5a9ab8,null))[_0xf068('0x46')](handleError(_0x5a9ab8,null));};exports[_0xf068('0x4c')]=function(_0x372fa9,_0x522034){return db[_0xf068('0x2f')][_0xf068('0x4c')](_0x372fa9[_0xf068('0x4d')],{})[_0xf068('0x25')](function(_0x280252){var _0x1220f9=_0x372fa9[_0xf068('0x4e')][_0xf068('0x26')]({'plain':!![]});if(!_0x1220f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1220f9[_0xf068('0x4f')]===_0xf068('0x4e')){var _0x48bdad=_0x280252[_0xf068('0x26')]({'plain':!![]});var _0x4b42fb=_0xf068('0x50');return db[_0xf068('0x51')][_0xf068('0x4b')]({'where':{'name':_0x4b42fb,'userProfileId':_0x1220f9[_0xf068('0x52')]},'raw':!![]})[_0xf068('0x25')](function(_0x31a77c){if(_0x31a77c&&_0x31a77c[_0xf068('0x53')]===0x0){return db[_0xf068('0x27')][_0xf068('0x4c')]({'name':_0x48bdad[_0xf068('0x2b')],'resourceId':_0x48bdad['id'],'type':_0x31a77c[_0xf068('0x2b')],'sectionId':_0x31a77c['id']},{})[_0xf068('0x25')](function(){return _0x280252;});}else{return _0x280252;}})[_0xf068('0x46')](function(_0x286115){logger['error'](_0xf068('0x54'),_0x286115);throw _0x286115;});}return _0x280252;})[_0xf068('0x25')](respondWithResult(_0x522034,0xc9))[_0xf068('0x46')](handleError(_0x522034,null));};exports['update']=function(_0x24036d,_0x2ad886){if(_0x24036d['body']['id']){delete _0x24036d['body']['id'];}return db[_0xf068('0x2f')]['find']({'where':{'id':_0x24036d[_0xf068('0x48')]['id']}})[_0xf068('0x25')](handleEntityNotFound(_0x2ad886,null))[_0xf068('0x25')](saveUpdates(_0x24036d[_0xf068('0x4d')],null))[_0xf068('0x25')](respondWithResult(_0x2ad886,null))[_0xf068('0x46')](handleError(_0x2ad886,null));};exports[_0xf068('0x24')]=function(_0x31c420,_0x5868f3){return db[_0xf068('0x2f')][_0xf068('0x4b')]({'where':{'id':_0x31c420[_0xf068('0x48')]['id']}})['then'](handleEntityNotFound(_0x5868f3,null))[_0xf068('0x25')](removeEntity(_0x5868f3,null))['catch'](handleError(_0x5868f3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 7bd8911..3097306 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 _0xabee=['util','../../config/logger','moment','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','lodash'];(function(_0x2e959b,_0x65a346){var _0x539d0b=function(_0x2396a1){while(--_0x2396a1){_0x2e959b['push'](_0x2e959b['shift']());}};_0x539d0b(++_0x65a346);}(_0xabee,0x1df));var _0xeabe=function(_0x36d14b,_0x1ba5eb){_0x36d14b=_0x36d14b-0x0;var _0x4be643=_0xabee[_0x36d14b];return _0x4be643;};'use strict';var _=require(_0xeabe('0x0'));var util=require(_0xeabe('0x1'));var logger=require(_0xeabe('0x2'))('api');var moment=require(_0xeabe('0x3'));var BPromise=require('bluebird');var rp=require(_0xeabe('0x4'));var fs=require('fs');var path=require(_0xeabe('0x5'));var rimraf=require(_0xeabe('0x6'));var config=require('../../config/environment');var attributes=require(_0xeabe('0x7'));module[_0xeabe('0x8')]=function(_0xaecc75,_0x4aace6){return _0xaecc75[_0xeabe('0x9')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99b8=['CmHopperAdditionalPhone','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x4182dd,_0x2500f0){var _0x343ea5=function(_0x2e7ac3){while(--_0x2e7ac3){_0x4182dd['push'](_0x4182dd['shift']());}};_0x343ea5(++_0x2500f0);}(_0x99b8,0xb5));var _0x899b=function(_0x34c2ff,_0x2dd0bc){_0x34c2ff=_0x34c2ff-0x0;var _0x44f8c3=_0x99b8[_0x34c2ff];return _0x44f8c3;};'use strict';var _=require(_0x899b('0x0'));var util=require(_0x899b('0x1'));var logger=require(_0x899b('0x2'))(_0x899b('0x3'));var moment=require(_0x899b('0x4'));var BPromise=require(_0x899b('0x5'));var rp=require(_0x899b('0x6'));var fs=require('fs');var path=require(_0x899b('0x7'));var rimraf=require('rimraf');var config=require(_0x899b('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x899b('0x9')]=function(_0x1ecb86,_0x3a450a){return _0x1ecb86[_0x899b('0xa')](_0x899b('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','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 a6833ac..7390104 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 _0x627d=['dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','ASC','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countnoanswerretry'];(function(_0x268094,_0x2a9545){var _0x2f1e79=function(_0x5dc607){while(--_0x5dc607){_0x268094['push'](_0x268094['shift']());}};_0x2f1e79(++_0x2a9545);}(_0x627d,0xc6));var _0xd627=function(_0x435bf6,_0x3ebd27){_0x435bf6=_0x435bf6-0x0;var _0x2a9d9c=_0x627d[_0x435bf6];return _0x2a9d9c;};'use strict';var _=require('lodash');var util=require(_0xd627('0x0'));var moment=require(_0xd627('0x1'));var BPromise=require('bluebird');var rs=require(_0xd627('0x2'));var fs=require('fs');var Redis=require(_0xd627('0x3'));var db=require(_0xd627('0x4'))['db'];var utils=require(_0xd627('0x5'));var logger=require(_0xd627('0x6'))(_0xd627('0x7'));var config=require(_0xd627('0x8'));var jayson=require(_0xd627('0x9'));var client=jayson['client'][_0xd627('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f50ff,_0x257dc0,_0x4a302c){return new BPromise(function(_0x5f4054,_0x3f8fea){return client[_0xd627('0xb')](_0x2f50ff,_0x4a302c)['then'](function(_0x22c522){logger[_0xd627('0xc')](_0xd627('0xd'),_0x257dc0,_0xd627('0xe'));logger[_0xd627('0xf')](_0xd627('0x10'),_0x257dc0,_0xd627('0xe'),JSON[_0xd627('0x11')](_0x22c522));if(_0x22c522[_0xd627('0x12')]){if(_0x22c522[_0xd627('0x12')]['code']===0x1f4){logger[_0xd627('0x12')](_0xd627('0xd'),_0x257dc0,_0x22c522[_0xd627('0x12')][_0xd627('0x13')]);return _0x3f8fea(_0x22c522[_0xd627('0x12')][_0xd627('0x13')]);}logger[_0xd627('0x12')](_0xd627('0xd'),_0x257dc0,_0x22c522['error'][_0xd627('0x13')]);return _0x5f4054(_0x22c522[_0xd627('0x12')]['message']);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x257dc0,_0xd627('0xe'));_0x5f4054(_0x22c522[_0xd627('0x14')]['message']);}})[_0xd627('0x15')](function(_0x2a0983){logger[_0xd627('0x12')](_0xd627('0xd'),_0x257dc0,_0x2a0983);_0x3f8fea(_0x2a0983);});});}exports[_0xd627('0x16')]=function(_0x63e76){var _0x49e466=this;return new Promise(function(_0x4a0ba2,_0x3b76f5){return db[_0xd627('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x63e76[_0xd627('0x18')][_0xd627('0x19')],'ListId':_0x63e76[_0xd627('0x18')][_0xd627('0x1a')],'VoiceQueueId':_0x63e76[_0xd627('0x18')][_0xd627('0x1b')]===undefined?null:_0x63e76[_0xd627('0x18')][_0xd627('0x1b')],'CampaignId':_0x63e76['body'][_0xd627('0x1c')]===undefined?null:_0x63e76['body']['CampaignId']}})[_0xd627('0x1d')](function(_0x433bac){if(_0x433bac!=null){return db[_0xd627('0x1e')][_0xd627('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x433bac['id'],'OrderBy':{'$gt':_0x433bac[_0xd627('0x20')]}},'order':[[_0xd627('0x20'),'ASC']]})[_0xd627('0x1d')](function(_0x5a2e76){var _0x51cd4e=0x0;if(_0x5a2e76){if(_0x5a2e76[_0xd627('0x21')]+_0x5a2e76[_0xd627('0x22')]+_0x5a2e76['countnoanswerretry']+_0x5a2e76[_0xd627('0x23')]+_0x5a2e76[_0xd627('0x24')]+_0x5a2e76[_0xd627('0x25')]+_0x5a2e76[_0xd627('0x26')]+_0x5a2e76[_0xd627('0x27')]<_0x63e76[_0xd627('0x28')]['dialGlobalMaxRetry'])_0x51cd4e=0x1;_0x4a0ba2({'additional':_0x51cd4e});}else{return db['CmHopperAdditionalPhone'][_0xd627('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x433bac['id']},'order':[[_0xd627('0x20'),'ASC']]})[_0xd627('0x1d')](function(_0x1efc92){var _0x3175f2=0x0;if(_0x1efc92){if(_0x1efc92['countbusyretry']+_0x1efc92[_0xd627('0x22')]+_0x1efc92[_0xd627('0x29')]+_0x1efc92[_0xd627('0x23')]+_0x1efc92[_0xd627('0x24')]+_0x1efc92[_0xd627('0x25')]+_0x1efc92['countmachineretry']+_0x1efc92[_0xd627('0x27')]<_0x63e76[_0xd627('0x28')][_0xd627('0x2a')])_0x3175f2=0x1;_0x4a0ba2({'additional':_0x3175f2});}else{_0x4a0ba2({'additional':0x0});}})[_0xd627('0x15')](function(_0x3a3984){logger[_0xd627('0x12')]('VerifyAdditionalPhones',_0x3a3984[_0xd627('0x13')]);_0x3b76f5(_0x49e466[_0xd627('0x12')](0x1f4,_0x3a3984['message']));});}})[_0xd627('0x15')](function(_0x401b8a){logger[_0xd627('0x12')](_0xd627('0x16'),_0x401b8a['message']);_0x3b76f5(_0x49e466[_0xd627('0x12')](0x1f4,_0x401b8a[_0xd627('0x13')]));});}else _0x4a0ba2({'additional':0x0});});});};exports[_0xd627('0x2b')]=function(_0x30d1c7){var _0x5e87bf=this;return new Promise(function(_0x46f909,_0x11202a){return db['CmHopper'][_0xd627('0x1f')]({'raw':!![],'where':{'ContactId':_0x30d1c7[_0xd627('0x18')][_0xd627('0x19')],'ListId':_0x30d1c7[_0xd627('0x18')][_0xd627('0x1a')],'VoiceQueueId':_0x30d1c7['body'][_0xd627('0x1b')]===undefined?null:_0x30d1c7[_0xd627('0x18')][_0xd627('0x1b')],'CampaignId':_0x30d1c7[_0xd627('0x18')][_0xd627('0x1c')]===undefined?null:_0x30d1c7[_0xd627('0x18')][_0xd627('0x1c')]}})['then'](function(_0x990bbe){if(_0x990bbe!=null){return db[_0xd627('0x1e')][_0xd627('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x990bbe['id'],'OrderBy':{'$gte':_0x990bbe[_0xd627('0x20')]}},'order':[['OrderBy','ASC']]})[_0xd627('0x1d')](function(_0x5c0754){if(_0x5c0754)return activateAdditionalPhone(_0x990bbe,_0x30d1c7[_0xd627('0x18')],_0x5c0754,_0x30d1c7[_0xd627('0x2c')],_0x30d1c7[_0xd627('0x2d')])[_0xd627('0x1d')](function(_0x10d2d6){_0x46f909(_0x10d2d6);});else{return db[_0xd627('0x1e')][_0xd627('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x990bbe['id']},'order':[['OrderBy',_0xd627('0x2e')]]})['then'](function(_0x3c6f85){if(_0x3c6f85)return activateAdditionalPhone(_0x990bbe,_0x30d1c7[_0xd627('0x18')],_0x3c6f85,_0x30d1c7[_0xd627('0x2c')],_0x30d1c7[_0xd627('0x2d')])[_0xd627('0x1d')](function(_0x2a5348){_0x46f909(_0x2a5348);});else{_0x46f909({'id':_0x990bbe['id'],'phone':''});}})['catch'](function(_0x51b7eb){logger['error']('VerifyAdditionalPhones',_0x51b7eb[_0xd627('0x13')]);_0x11202a(_0x5e87bf[_0xd627('0x12')](0x1f4,_0x51b7eb[_0xd627('0x13')]));});}})[_0xd627('0x15')](function(_0x22c300){logger['error'](_0xd627('0x16'),_0x22c300[_0xd627('0x13')]);_0x11202a(_0x5e87bf[_0xd627('0x12')](0x1f4,_0x22c300['message']));});}else _0x46f909(0x1);});});};function activateAdditionalPhone(_0x56d7d6,_0x59c3da,_0x3082aa,_0x28e353,_0x253fd4){return new Promise(function(_0x4dbaf7,_0x4021be){var _0x777f54;if(_['isNil'](_0x3082aa[_0xd627('0x2f')])){_0x3082aa['scheduledat']=moment();}if(moment()>moment(_0x3082aa['scheduledat'])){_0x777f54=moment()[_0xd627('0x30')](_0x253fd4||0x3,_0xd627('0x31'));}else{if(_0x3082aa['OrderBy']==0x0){_0x777f54=moment(_0x3082aa[_0xd627('0x2f')]);}else{_0x777f54=moment()[_0xd627('0x30')](_0x253fd4||0x3,_0xd627('0x31'));}}if(_[_0xd627('0x32')](_0x777f54)){_0x777f54=moment()[_0xd627('0x30')](_0x253fd4||0x3,'minutes');}var _0x56bad3={'phone':_0x56d7d6[_0xd627('0x33')],'active':0x0,'OrderBy':_['isNil'](_0x56d7d6[_0xd627('0x20')])?0x0:_0x56d7d6[_0xd627('0x20')],'scheduledat':moment()[_0xd627('0x30')](_0x28e353||0x1,'minutes'),'countbusyretry':_0x59c3da[_0xd627('0x21')],'countcongestionretry':_0x59c3da[_0xd627('0x22')],'countnoanswerretry':_0x59c3da[_0xd627('0x29')],'countnosuchnumberretry':_0x59c3da[_0xd627('0x23')],'countdropretry':_0x59c3da[_0xd627('0x24')],'countabandonedretry':_0x59c3da[_0xd627('0x25')],'countmachineretry':_0x59c3da[_0xd627('0x26')],'countagentrejectretry':_0x59c3da[_0xd627('0x27')],'createdAt':_0x59c3da['createdAt'],'updatedAt':_0x59c3da['updatedAt']};var _0x34a66e={'CmHopperId':_0x56d7d6['id'],'phone':_0x3082aa[_0xd627('0x33')],'active':0x0,'OrderBy':_[_0xd627('0x32')](_0x3082aa[_0xd627('0x20')])?0x0:_0x3082aa[_0xd627('0x20')],'scheduledat':_0x777f54,'countbusyretry':_0x3082aa[_0xd627('0x21')],'countcongestionretry':_0x3082aa[_0xd627('0x22')],'countnoanswerretry':_0x3082aa[_0xd627('0x29')],'countnosuchnumberretry':_0x3082aa[_0xd627('0x23')],'countdropretry':_0x3082aa[_0xd627('0x24')],'countabandonedretry':_0x3082aa[_0xd627('0x25')],'countmachineretry':_0x3082aa[_0xd627('0x26')],'countagentrejectretry':_0x3082aa[_0xd627('0x27')],'createdAt':_0x3082aa[_0xd627('0x34')],'updatedAt':_0x3082aa[_0xd627('0x35')]};return db[_0xd627('0x36')][_0xd627('0x37')](function(_0x288006){return db[_0xd627('0x1e')][_0xd627('0x38')](_0x56bad3,{'where':{'id':_0x3082aa['id']}},{'transaction':_0x288006})[_0xd627('0x1d')](function(){return db['CmHopper'][_0xd627('0x38')](_0x34a66e,{'where':{'id':_0x56d7d6['id']}},{'transaction':_0x288006});});})[_0xd627('0x1d')](function(_0x317020){_0x4dbaf7({'id':_0x56d7d6['id'],'phone':_0x3082aa[_0xd627('0x33')]});})[_0xd627('0x15')](function(_0x4aa937){logger[_0xd627('0x12')](_0xd627('0x39'),_0x4aa937['message']);_0x4021be({'error':_0x4aa937[_0xd627('0x13')]});});});}exports[_0xd627('0x3a')]=function(_0x1296b7){var _0x3e7e3c=this;return new Promise(function(_0x3bc3c4,_0x208f37){return db[_0xd627('0x17')][_0xd627('0x38')](_0x1296b7[_0xd627('0x18')][_0xd627('0x3b')],{'where':{'id':_0x1296b7['body']['id']}})[_0xd627('0x1d')](function(_0x2194c0){_0x3bc3c4(_0x2194c0);})[_0xd627('0x15')](function(_0x54d925){logger['error']('IncrementPreviewCounters',_0x54d925[_0xd627('0x13')]);_0x208f37(_0x3e7e3c[_0xd627('0x12')](0x1f4,_0x54d925[_0xd627('0x13')]));});});}; \ No newline at end of file +var _0xb863=['then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','VoiceQueueId','CampaignId','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','entity','countbusyretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','ContactId','ListId','CmHopperAdditionalPhone','duration','isNil','scheduledat','minutes','add','countdropretry','createdAt','updatedAt','phone','sequelize','update','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb863,0x65));var _0x3b86=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb863[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x3b86('0x0'));var moment=require(_0x3b86('0x1'));var BPromise=require(_0x3b86('0x2'));var rs=require(_0x3b86('0x3'));var fs=require('fs');var Redis=require(_0x3b86('0x4'));var db=require(_0x3b86('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3b86('0x6'));var jayson=require(_0x3b86('0x7'));var client=jayson[_0x3b86('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc68743,_0x4035ac,_0x333720){return new BPromise(function(_0xe7139,_0x4a7ab5){return client['request'](_0xc68743,_0x333720)[_0x3b86('0x9')](function(_0x3ad7d2){logger[_0x3b86('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4035ac,_0x3b86('0xb'));logger[_0x3b86('0xc')](_0x3b86('0xd'),_0x4035ac,'request\x20sent',JSON[_0x3b86('0xe')](_0x3ad7d2));if(_0x3ad7d2[_0x3b86('0xf')]){if(_0x3ad7d2[_0x3b86('0xf')][_0x3b86('0x10')]===0x1f4){logger[_0x3b86('0xf')](_0x3b86('0x11'),_0x4035ac,_0x3ad7d2[_0x3b86('0xf')]['message']);return _0x4a7ab5(_0x3ad7d2[_0x3b86('0xf')][_0x3b86('0x12')]);}logger[_0x3b86('0xf')](_0x3b86('0x11'),_0x4035ac,_0x3ad7d2[_0x3b86('0xf')][_0x3b86('0x12')]);return _0xe7139(_0x3ad7d2['error'][_0x3b86('0x12')]);}else{logger[_0x3b86('0xa')](_0x3b86('0x11'),_0x4035ac,_0x3b86('0xb'));_0xe7139(_0x3ad7d2[_0x3b86('0x13')][_0x3b86('0x12')]);}})[_0x3b86('0x14')](function(_0x11e69d){logger['error'](_0x3b86('0x11'),_0x4035ac,_0x11e69d);_0x4a7ab5(_0x11e69d);});});}exports[_0x3b86('0x15')]=function(_0x971119){var _0x2aeee0=this;return new Promise(function(_0x23abcd,_0x164078){return db[_0x3b86('0x16')][_0x3b86('0x17')]({'raw':!![],'where':{'ContactId':_0x971119[_0x3b86('0x18')]['ContactId'],'ListId':_0x971119[_0x3b86('0x18')]['ListId'],'VoiceQueueId':_0x971119[_0x3b86('0x18')][_0x3b86('0x19')]===undefined?null:_0x971119[_0x3b86('0x18')][_0x3b86('0x19')],'CampaignId':_0x971119[_0x3b86('0x18')]['CampaignId']===undefined?null:_0x971119[_0x3b86('0x18')][_0x3b86('0x1a')]}})['then'](function(_0x1a8622){if(_0x1a8622!=null){return db['CmHopperAdditionalPhone'][_0x3b86('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1a8622['id'],'OrderBy':{'$gt':_0x1a8622['OrderBy']}},'order':[[_0x3b86('0x1b'),_0x3b86('0x1c')]]})[_0x3b86('0x9')](function(_0x1d663e){var _0x435dde=0x0;if(_0x1d663e){if(_0x1d663e['countbusyretry']+_0x1d663e[_0x3b86('0x1d')]+_0x1d663e[_0x3b86('0x1e')]+_0x1d663e[_0x3b86('0x1f')]+_0x1d663e['countdropretry']+_0x1d663e['countabandonedretry']+_0x1d663e[_0x3b86('0x20')]+_0x1d663e['countagentrejectretry']<_0x971119[_0x3b86('0x21')]['dialGlobalMaxRetry'])_0x435dde=0x1;_0x23abcd({'additional':_0x435dde});}else{return db['CmHopperAdditionalPhone'][_0x3b86('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1a8622['id']},'order':[[_0x3b86('0x1b'),'ASC']]})[_0x3b86('0x9')](function(_0x4a569){var _0x464abd=0x0;if(_0x4a569){if(_0x4a569[_0x3b86('0x22')]+_0x4a569[_0x3b86('0x1d')]+_0x4a569[_0x3b86('0x1e')]+_0x4a569['countnosuchnumberretry']+_0x4a569['countdropretry']+_0x4a569[_0x3b86('0x23')]+_0x4a569[_0x3b86('0x20')]+_0x4a569[_0x3b86('0x24')]<_0x971119[_0x3b86('0x21')][_0x3b86('0x25')])_0x464abd=0x1;_0x23abcd({'additional':_0x464abd});}else{_0x23abcd({'additional':0x0});}})['catch'](function(_0xc57af4){logger[_0x3b86('0xf')](_0x3b86('0x15'),_0xc57af4[_0x3b86('0x12')]);_0x164078(_0x2aeee0[_0x3b86('0xf')](0x1f4,_0xc57af4[_0x3b86('0x12')]));});}})['catch'](function(_0x1a8134){logger[_0x3b86('0xf')](_0x3b86('0x15'),_0x1a8134['message']);_0x164078(_0x2aeee0[_0x3b86('0xf')](0x1f4,_0x1a8134[_0x3b86('0x12')]));});}else _0x23abcd({'additional':0x0});});});};exports[_0x3b86('0x26')]=function(_0x212c8f){var _0x517c67=this;return new Promise(function(_0x7df917,_0xc7d0d8){return db[_0x3b86('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x212c8f[_0x3b86('0x18')][_0x3b86('0x27')],'ListId':_0x212c8f[_0x3b86('0x18')][_0x3b86('0x28')],'VoiceQueueId':_0x212c8f[_0x3b86('0x18')][_0x3b86('0x19')]===undefined?null:_0x212c8f[_0x3b86('0x18')][_0x3b86('0x19')],'CampaignId':_0x212c8f['body'][_0x3b86('0x1a')]===undefined?null:_0x212c8f[_0x3b86('0x18')][_0x3b86('0x1a')]}})[_0x3b86('0x9')](function(_0x8f7beb){if(_0x8f7beb!=null){return db[_0x3b86('0x29')][_0x3b86('0x17')]({'raw':!![],'where':{'CmHopperId':_0x8f7beb['id'],'OrderBy':{'$gte':_0x8f7beb[_0x3b86('0x1b')]}},'order':[[_0x3b86('0x1b'),'ASC']]})['then'](function(_0x2cb617){if(_0x2cb617)return activateAdditionalPhone(_0x8f7beb,_0x212c8f[_0x3b86('0x18')],_0x2cb617,_0x212c8f[_0x3b86('0x2a')],_0x212c8f['waitTime'])[_0x3b86('0x9')](function(_0xe46ec4){_0x7df917(_0xe46ec4);});else{return db[_0x3b86('0x29')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x8f7beb['id']},'order':[[_0x3b86('0x1b'),_0x3b86('0x1c')]]})[_0x3b86('0x9')](function(_0x5ed215){if(_0x5ed215)return activateAdditionalPhone(_0x8f7beb,_0x212c8f['body'],_0x5ed215,_0x212c8f[_0x3b86('0x2a')],_0x212c8f['waitTime'])[_0x3b86('0x9')](function(_0x36f20b){_0x7df917(_0x36f20b);});else{_0x7df917({'id':_0x8f7beb['id'],'phone':''});}})[_0x3b86('0x14')](function(_0x3d40fb){logger[_0x3b86('0xf')](_0x3b86('0x15'),_0x3d40fb[_0x3b86('0x12')]);_0xc7d0d8(_0x517c67['error'](0x1f4,_0x3d40fb[_0x3b86('0x12')]));});}})['catch'](function(_0x5bfcbf){logger[_0x3b86('0xf')]('VerifyAdditionalPhones',_0x5bfcbf['message']);_0xc7d0d8(_0x517c67['error'](0x1f4,_0x5bfcbf[_0x3b86('0x12')]));});}else _0x7df917(0x1);});});};function activateAdditionalPhone(_0x75a7cd,_0x7ca27c,_0x55a9a1,_0x432905,_0x4b6687){return new Promise(function(_0x3c593f,_0x9fce3a){var _0x4d2a86;if(_[_0x3b86('0x2b')](_0x55a9a1[_0x3b86('0x2c')])){_0x55a9a1['scheduledat']=moment();}if(moment()>moment(_0x55a9a1[_0x3b86('0x2c')])){_0x4d2a86=moment()['add'](_0x4b6687||0x3,_0x3b86('0x2d'));}else{if(_0x55a9a1['OrderBy']==0x0){_0x4d2a86=moment(_0x55a9a1[_0x3b86('0x2c')]);}else{_0x4d2a86=moment()[_0x3b86('0x2e')](_0x4b6687||0x3,_0x3b86('0x2d'));}}if(_['isNil'](_0x4d2a86)){_0x4d2a86=moment()[_0x3b86('0x2e')](_0x4b6687||0x3,_0x3b86('0x2d'));}var _0x17f9bc={'phone':_0x75a7cd['phone'],'active':0x0,'OrderBy':_[_0x3b86('0x2b')](_0x75a7cd[_0x3b86('0x1b')])?0x0:_0x75a7cd[_0x3b86('0x1b')],'scheduledat':moment()['add'](_0x432905||0x1,_0x3b86('0x2d')),'countbusyretry':_0x7ca27c['countbusyretry'],'countcongestionretry':_0x7ca27c[_0x3b86('0x1d')],'countnoanswerretry':_0x7ca27c[_0x3b86('0x1e')],'countnosuchnumberretry':_0x7ca27c[_0x3b86('0x1f')],'countdropretry':_0x7ca27c[_0x3b86('0x2f')],'countabandonedretry':_0x7ca27c['countabandonedretry'],'countmachineretry':_0x7ca27c[_0x3b86('0x20')],'countagentrejectretry':_0x7ca27c[_0x3b86('0x24')],'createdAt':_0x7ca27c[_0x3b86('0x30')],'updatedAt':_0x7ca27c[_0x3b86('0x31')]};var _0x144665={'CmHopperId':_0x75a7cd['id'],'phone':_0x55a9a1[_0x3b86('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x55a9a1[_0x3b86('0x1b')])?0x0:_0x55a9a1[_0x3b86('0x1b')],'scheduledat':_0x4d2a86,'countbusyretry':_0x55a9a1[_0x3b86('0x22')],'countcongestionretry':_0x55a9a1[_0x3b86('0x1d')],'countnoanswerretry':_0x55a9a1[_0x3b86('0x1e')],'countnosuchnumberretry':_0x55a9a1[_0x3b86('0x1f')],'countdropretry':_0x55a9a1[_0x3b86('0x2f')],'countabandonedretry':_0x55a9a1[_0x3b86('0x23')],'countmachineretry':_0x55a9a1[_0x3b86('0x20')],'countagentrejectretry':_0x55a9a1[_0x3b86('0x24')],'createdAt':_0x55a9a1[_0x3b86('0x30')],'updatedAt':_0x55a9a1[_0x3b86('0x31')]};return db[_0x3b86('0x33')]['transaction'](function(_0x49226e){return db[_0x3b86('0x29')][_0x3b86('0x34')](_0x17f9bc,{'where':{'id':_0x55a9a1['id']}},{'transaction':_0x49226e})[_0x3b86('0x9')](function(){return db[_0x3b86('0x16')][_0x3b86('0x34')](_0x144665,{'where':{'id':_0x75a7cd['id']}},{'transaction':_0x49226e});});})[_0x3b86('0x9')](function(_0x89c8ab){_0x3c593f({'id':_0x75a7cd['id'],'phone':_0x55a9a1[_0x3b86('0x32')]});})[_0x3b86('0x14')](function(_0x46fb8e){logger['error']('activateAdditionalPhone',_0x46fb8e[_0x3b86('0x12')]);_0x9fce3a({'error':_0x46fb8e[_0x3b86('0x12')]});});});}exports[_0x3b86('0x35')]=function(_0x3965f2){var _0x5cf29a=this;return new Promise(function(_0x273934,_0xda76e5){return db[_0x3b86('0x16')][_0x3b86('0x34')](_0x3965f2[_0x3b86('0x18')][_0x3b86('0x36')],{'where':{'id':_0x3965f2[_0x3b86('0x18')]['id']}})[_0x3b86('0x9')](function(_0xf75b69){_0x273934(_0xf75b69);})[_0x3b86('0x14')](function(_0x159ff6){logger['error']('IncrementPreviewCounters',_0x159ff6['message']);_0xda76e5(_0x5cf29a[_0x3b86('0xf')](0x1f4,_0x159ff6[_0x3b86('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2d64530..d7e6303 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 _0x7f93=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x170731,_0x390994){var _0x5f0b76=function(_0xd67ce7){while(--_0xd67ce7){_0x170731['push'](_0x170731['shift']());}};_0x5f0b76(++_0x390994);}(_0x7f93,0x1a6));var _0x37f9=function(_0x3beb1d,_0x241c2f){_0x3beb1d=_0x3beb1d-0x0;var _0x57bc3a=_0x7f93[_0x3beb1d];return _0x57bc3a;};'use strict';var multer=require(_0x37f9('0x0'));var util=require(_0x37f9('0x1'));var path=require('path');var timeout=require(_0x37f9('0x2'));var express=require(_0x37f9('0x3'));var router=express[_0x37f9('0x4')]();var fs_extra=require(_0x37f9('0x5'));var auth=require(_0x37f9('0x6'));var interaction=require(_0x37f9('0x7'));var config=require(_0x37f9('0x8'));var controller=require(_0x37f9('0x9'));router[_0x37f9('0xa')]('/',auth[_0x37f9('0xb')](),controller[_0x37f9('0xc')]);router['get'](_0x37f9('0xd'),auth[_0x37f9('0xb')](),controller[_0x37f9('0xe')]);router[_0x37f9('0xf')]('/',auth['isAuthenticated'](),controller[_0x37f9('0x10')]);router['put']('/:id',auth[_0x37f9('0xb')](),controller[_0x37f9('0x11')]);router[_0x37f9('0x12')](_0x37f9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x37f9('0x13')]=router; \ No newline at end of file +var _0x9c3c=['../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xbb9b40,_0x51b63a){var _0x4cd1b3=function(_0x4c0343){while(--_0x4c0343){_0xbb9b40['push'](_0xbb9b40['shift']());}};_0x4cd1b3(++_0x51b63a);}(_0x9c3c,0x1c1));var _0xc9c3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9c3c[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xc9c3('0x0'));var util=require('util');var path=require(_0xc9c3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9c3('0x2'));var router=express[_0xc9c3('0x3')]();var fs_extra=require(_0xc9c3('0x4'));var auth=require(_0xc9c3('0x5'));var interaction=require(_0xc9c3('0x6'));var config=require(_0xc9c3('0x7'));var controller=require(_0xc9c3('0x8'));router['get']('/',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xa')]);router[_0xc9c3('0xb')](_0xc9c3('0xc'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xd')]);router[_0xc9c3('0xe')]('/',auth[_0xc9c3('0x9')](),controller['create']);router[_0xc9c3('0xf')]('/:id',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x10')]);router[_0xc9c3('0x11')](_0xc9c3('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9c3('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 2fc7e45..ab0fb05 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 _0x7070=['INTEGER','contactListQueue','exports'];(function(_0x42076e,_0x10969a){var _0x3a7971=function(_0x89393f){while(--_0x89393f){_0x42076e['push'](_0x42076e['shift']());}};_0x3a7971(++_0x10969a);}(_0x7070,0xa4));var _0x0707=function(_0x2d4835,_0x1f51c9){_0x2d4835=_0x2d4835-0x0;var _0x24d828=_0x7070[_0x2d4835];return _0x24d828;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0707('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0707('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x0707('0x1')],'unique':_0x0707('0x2')},'VoiceQueueId':{'type':Sequelize[_0x0707('0x1')],'unique':_0x0707('0x2')}}; \ No newline at end of file +var _0x031f=['INTEGER','contactListQueue','moment','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x031f,0x1c2));var _0xf031=function(_0x2428d8,_0x52169f){_0x2428d8=_0x2428d8-0x0;var _0x4908cb=_0x031f[_0x2428d8];return _0x4908cb;};'use strict';var moment=require(_0xf031('0x0'));var Sequelize=require('sequelize');module[_0xf031('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf031('0x2')],'unique':_0xf031('0x3')},'ListId':{'type':Sequelize[_0xf031('0x2')],'unique':_0xf031('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf031('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 1d0ff53..a8d9083 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 _0x3953=['limit','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count'];(function(_0x59fc89,_0x31726b){var _0x202763=function(_0x2b6894){while(--_0x2b6894){_0x59fc89['push'](_0x59fc89['shift']());}};_0x202763(++_0x31726b);}(_0x3953,0x16f));var _0x3395=function(_0x581800,_0xa82cc7){_0x581800=_0x581800-0x0;var _0x32c203=_0x3953[_0x581800];return _0x32c203;};'use strict';var emlformat=require(_0x3395('0x0'));var rimraf=require(_0x3395('0x1'));var zipdir=require(_0x3395('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3395('0x3'));var moment=require(_0x3395('0x4'));var BPromise=require(_0x3395('0x5'));var Mustache=require(_0x3395('0x6'));var util=require(_0x3395('0x7'));var path=require(_0x3395('0x8'));var sox=require(_0x3395('0x9'));var csv=require('to-csv');var ejs=require(_0x3395('0xa'));var fs=require('fs');var fs_extra=require(_0x3395('0xb'));var _=require(_0x3395('0xc'));var squel=require('squel');var crypto=require(_0x3395('0xd'));var jsforce=require(_0x3395('0xe'));var deskjs=require(_0x3395('0xf'));var toCsv=require(_0x3395('0x10'));var querystring=require(_0x3395('0x11'));var Papa=require(_0x3395('0x12'));var Redis=require(_0x3395('0x13'));var authService=require(_0x3395('0x14'));var qs=require(_0x3395('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3395('0x16'))('api');var utils=require(_0x3395('0x17'));var config=require(_0x3395('0x18'));var licenseUtil=require(_0x3395('0x19'));var db=require(_0x3395('0x1a'))['db'];function respondWithStatusCode(_0x230df0,_0xaa0e3f){_0xaa0e3f=_0xaa0e3f||0xcc;return function(_0x17a02d){if(_0x17a02d){return _0x230df0[_0x3395('0x1b')](_0xaa0e3f);}return _0x230df0['status'](_0xaa0e3f)[_0x3395('0x1c')]();};}function respondWithResult(_0x28876c,_0x2afaf8){_0x2afaf8=_0x2afaf8||0xc8;return function(_0x4d066e){if(_0x4d066e){return _0x28876c['status'](_0x2afaf8)[_0x3395('0x1d')](_0x4d066e);}};}function respondWithFilteredResult(_0x458005,_0x2eefb9){return function(_0x11cb60){if(_0x11cb60){var _0x307481=typeof _0x2eefb9[_0x3395('0x1e')]===_0x3395('0x1f')&&typeof _0x2eefb9['limit']===_0x3395('0x1f');var _0x31c535=_0x11cb60[_0x3395('0x20')];var _0x4a5057=_0x307481?0x0:_0x2eefb9['offset'];var _0x2e89c9=_0x307481?_0x11cb60['count']:_0x2eefb9[_0x3395('0x1e')]+_0x2eefb9[_0x3395('0x21')];var _0x3f8e9d;if(_0x2e89c9>=_0x31c535){_0x2e89c9=_0x31c535;_0x3f8e9d=0xc8;}else{_0x3f8e9d=0xce;}_0x458005[_0x3395('0x22')](_0x3f8e9d);return _0x458005[_0x3395('0x23')](_0x3395('0x24'),_0x4a5057+'-'+_0x2e89c9+'/'+_0x31c535)[_0x3395('0x1d')](_0x11cb60);}return null;};}function patchUpdates(_0x259e41){return function(_0x166405){try{jsonpatch[_0x3395('0x25')](_0x166405,_0x259e41,!![]);}catch(_0x3c6637){return BPromise[_0x3395('0x26')](_0x3c6637);}return _0x166405['save']();};}function saveUpdates(_0x5747da,_0x4113ca){return function(_0xde4c8){if(_0xde4c8){return _0xde4c8[_0x3395('0x27')](_0x5747da)[_0x3395('0x28')](function(_0x6fb2d0){return _0x6fb2d0;});}return null;};}function removeEntity(_0x1682f9,_0x100e08){return function(_0x522f2b){if(_0x522f2b){return _0x522f2b[_0x3395('0x29')]()['then'](function(){_0x1682f9[_0x3395('0x22')](0xcc)[_0x3395('0x1c')]();});}};}function handleEntityNotFound(_0x5807bd,_0x36ee99){return function(_0x2dd759){if(!_0x2dd759){_0x5807bd[_0x3395('0x1b')](0x194);}return _0x2dd759;};}function handleError(_0xf647c8,_0x95bdd6){_0x95bdd6=_0x95bdd6||0x1f4;return function(_0x3464d8){logger[_0x3395('0x2a')](_0x3464d8[_0x3395('0x2b')]);if(_0x3464d8[_0x3395('0x2c')]){delete _0x3464d8[_0x3395('0x2c')];}_0xf647c8[_0x3395('0x22')](_0x95bdd6)['send'](_0x3464d8);};}exports[_0x3395('0x2d')]=function(_0x4d2a1b,_0x3390c3){var _0x2cd4b1={},_0x5d60da={},_0x1ae1a6={'count':0x0,'rows':[]};var _0x208f0b=_['map'](db[_0x3395('0x2e')][_0x3395('0x2f')],function(_0x462ff4){return{'name':_0x462ff4[_0x3395('0x30')],'type':_0x462ff4[_0x3395('0x31')][_0x3395('0x32')]};});_0x5d60da[_0x3395('0x33')]=_[_0x3395('0x34')](_0x208f0b,_0x3395('0x2c'));_0x5d60da[_0x3395('0x35')]=_[_0x3395('0x36')](_0x4d2a1b[_0x3395('0x35')]);_0x5d60da['filters']=_[_0x3395('0x37')](_0x5d60da['model'],_0x5d60da['query']);_0x2cd4b1[_0x3395('0x38')]=_[_0x3395('0x37')](_0x5d60da[_0x3395('0x33')],qs[_0x3395('0x39')](_0x4d2a1b[_0x3395('0x35')][_0x3395('0x39')]));_0x2cd4b1[_0x3395('0x38')]=_0x2cd4b1['attributes'][_0x3395('0x3a')]?_0x2cd4b1[_0x3395('0x38')]:_0x5d60da[_0x3395('0x33')];if(!_0x4d2a1b[_0x3395('0x35')][_0x3395('0x3b')](_0x3395('0x3c'))){_0x2cd4b1[_0x3395('0x21')]=qs[_0x3395('0x21')](_0x4d2a1b[_0x3395('0x35')][_0x3395('0x21')]);_0x2cd4b1[_0x3395('0x1e')]=qs[_0x3395('0x1e')](_0x4d2a1b['query'][_0x3395('0x1e')]);}_0x2cd4b1[_0x3395('0x3d')]=qs[_0x3395('0x3e')](_0x4d2a1b['query'][_0x3395('0x3e')]);_0x2cd4b1[_0x3395('0x3f')]=qs[_0x3395('0x40')](_[_0x3395('0x41')](_0x4d2a1b[_0x3395('0x35')],_0x5d60da[_0x3395('0x40')]),_0x208f0b);if(_0x4d2a1b[_0x3395('0x35')]['filter']){_0x2cd4b1[_0x3395('0x3f')]=_[_0x3395('0x42')](_0x2cd4b1['where'],{'$or':_[_0x3395('0x34')](_0x208f0b,function(_0x27fc38){if(_0x27fc38[_0x3395('0x31')]!==_0x3395('0x43')){var _0x2b6333={};_0x2b6333[_0x27fc38[_0x3395('0x2c')]]={'$like':'%'+_0x4d2a1b['query'][_0x3395('0x44')]+'%'};return _0x2b6333;}})});}_0x2cd4b1=_[_0x3395('0x42')]({},_0x2cd4b1,_0x4d2a1b['options']);var _0x2aa7f3={'where':_0x2cd4b1[_0x3395('0x3f')]};return db[_0x3395('0x2e')][_0x3395('0x20')](_0x2aa7f3)[_0x3395('0x28')](function(_0x16b7cc){_0x1ae1a6['count']=_0x16b7cc;if(_0x4d2a1b[_0x3395('0x35')][_0x3395('0x45')]){_0x2cd4b1[_0x3395('0x46')]=[{'all':!![]}];}return db[_0x3395('0x2e')][_0x3395('0x47')](_0x2cd4b1);})[_0x3395('0x28')](function(_0x1ec1e7){_0x1ae1a6[_0x3395('0x48')]=_0x1ec1e7;return _0x1ae1a6;})[_0x3395('0x28')](respondWithFilteredResult(_0x3390c3,_0x2cd4b1))['catch'](handleError(_0x3390c3,null));};exports[_0x3395('0x49')]=function(_0x21ffae,_0x192592){var _0x310a0c={'raw':!![],'where':{'id':_0x21ffae[_0x3395('0x4a')]['id']}},_0x94a45c={};_0x94a45c[_0x3395('0x33')]=_[_0x3395('0x36')](db[_0x3395('0x2e')]['rawAttributes']);_0x94a45c[_0x3395('0x35')]=_['keys'](_0x21ffae[_0x3395('0x35')]);_0x94a45c['filters']=_['intersection'](_0x94a45c[_0x3395('0x33')],_0x94a45c[_0x3395('0x35')]);_0x310a0c[_0x3395('0x38')]=_['intersection'](_0x94a45c['model'],qs[_0x3395('0x39')](_0x21ffae[_0x3395('0x35')][_0x3395('0x39')]));_0x310a0c[_0x3395('0x38')]=_0x310a0c[_0x3395('0x38')]['length']?_0x310a0c['attributes']:_0x94a45c['model'];if(_0x21ffae[_0x3395('0x35')][_0x3395('0x45')]){_0x310a0c['include']=[{'all':!![]}];}_0x310a0c=_[_0x3395('0x42')]({},_0x310a0c,_0x21ffae[_0x3395('0x4b')]);return db['CmHopperBlack'][_0x3395('0x4c')](_0x310a0c)['then'](handleEntityNotFound(_0x192592,null))[_0x3395('0x28')](respondWithResult(_0x192592,null))['catch'](handleError(_0x192592,null));};exports['update']=function(_0x2d78b8,_0x1332f4){if(_0x2d78b8[_0x3395('0x4d')]['id']){delete _0x2d78b8[_0x3395('0x4d')]['id'];}return db[_0x3395('0x2e')][_0x3395('0x4c')]({'where':{'id':_0x2d78b8['params']['id']}})[_0x3395('0x28')](handleEntityNotFound(_0x1332f4,null))['then'](saveUpdates(_0x2d78b8['body'],null))[_0x3395('0x28')](respondWithResult(_0x1332f4,null))[_0x3395('0x4e')](handleError(_0x1332f4,null));};exports['destroy']=function(_0x109c63,_0x116db2){return db[_0x3395('0x2e')][_0x3395('0x4c')]({'where':{'id':_0x109c63[_0x3395('0x4a')]['id']}})[_0x3395('0x28')](handleEntityNotFound(_0x116db2,null))['then'](removeEntity(_0x116db2,null))[_0x3395('0x4e')](handleError(_0x116db2,null));};exports[_0x3395('0x4f')]=function(_0x33afab,_0x2709cc){return db[_0x3395('0x2e')][_0x3395('0x4f')]()['then'](respondWithResult(_0x2709cc,null))[_0x3395('0x4e')](handleError(_0x2709cc,null));}; \ No newline at end of file +var _0x3a18=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','CmHopperBlack','findAll','rows','catch','params','rawAttributes','options','body','find','describe','eml-format','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x2a9eb7,_0x36a58d){var _0x5a5807=function(_0x5c6264){while(--_0x5c6264){_0x2a9eb7['push'](_0x2a9eb7['shift']());}};_0x5a5807(++_0x36a58d);}(_0x3a18,0x104));var _0x83a1=function(_0x36a19b,_0x1f6d56){_0x36a19b=_0x36a19b-0x0;var _0x2a19b4=_0x3a18[_0x36a19b];return _0x2a19b4;};'use strict';var emlformat=require(_0x83a1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83a1('0x1'));var Mustache=require(_0x83a1('0x2'));var util=require('util');var path=require(_0x83a1('0x3'));var sox=require(_0x83a1('0x4'));var csv=require('to-csv');var ejs=require(_0x83a1('0x5'));var fs=require('fs');var fs_extra=require(_0x83a1('0x6'));var _=require(_0x83a1('0x7'));var squel=require(_0x83a1('0x8'));var crypto=require('crypto');var jsforce=require(_0x83a1('0x9'));var deskjs=require(_0x83a1('0xa'));var toCsv=require(_0x83a1('0xb'));var querystring=require(_0x83a1('0xc'));var Papa=require(_0x83a1('0xd'));var Redis=require('ioredis');var authService=require(_0x83a1('0xe'));var qs=require(_0x83a1('0xf'));var as=require(_0x83a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x83a1('0x11'));var utils=require(_0x83a1('0x12'));var config=require(_0x83a1('0x13'));var licenseUtil=require(_0x83a1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38ca56,_0xadd399){_0xadd399=_0xadd399||0xcc;return function(_0x46c67c){if(_0x46c67c){return _0x38ca56[_0x83a1('0x15')](_0xadd399);}return _0x38ca56[_0x83a1('0x16')](_0xadd399)[_0x83a1('0x17')]();};}function respondWithResult(_0x1490a7,_0x3162fa){_0x3162fa=_0x3162fa||0xc8;return function(_0x50c591){if(_0x50c591){return _0x1490a7['status'](_0x3162fa)[_0x83a1('0x18')](_0x50c591);}};}function respondWithFilteredResult(_0x2c112f,_0x5a5c8b){return function(_0x273aa9){if(_0x273aa9){var _0x399494=typeof _0x5a5c8b[_0x83a1('0x19')]===_0x83a1('0x1a')&&typeof _0x5a5c8b['limit']===_0x83a1('0x1a');var _0x3f1944=_0x273aa9[_0x83a1('0x1b')];var _0x2b20ca=_0x399494?0x0:_0x5a5c8b[_0x83a1('0x19')];var _0x2b7db2=_0x399494?_0x273aa9[_0x83a1('0x1b')]:_0x5a5c8b[_0x83a1('0x19')]+_0x5a5c8b[_0x83a1('0x1c')];var _0x3ca8dd;if(_0x2b7db2>=_0x3f1944){_0x2b7db2=_0x3f1944;_0x3ca8dd=0xc8;}else{_0x3ca8dd=0xce;}_0x2c112f['status'](_0x3ca8dd);return _0x2c112f[_0x83a1('0x1d')]('Content-Range',_0x2b20ca+'-'+_0x2b7db2+'/'+_0x3f1944)[_0x83a1('0x18')](_0x273aa9);}return null;};}function patchUpdates(_0x133b26){return function(_0x1570f7){try{jsonpatch['apply'](_0x1570f7,_0x133b26,!![]);}catch(_0x3e68dd){return BPromise[_0x83a1('0x1e')](_0x3e68dd);}return _0x1570f7['save']();};}function saveUpdates(_0x5b566a,_0x464c3d){return function(_0x1096e8){if(_0x1096e8){return _0x1096e8['update'](_0x5b566a)[_0x83a1('0x1f')](function(_0x335d8f){return _0x335d8f;});}return null;};}function removeEntity(_0xe7825a,_0x56f673){return function(_0x226561){if(_0x226561){return _0x226561[_0x83a1('0x20')]()[_0x83a1('0x1f')](function(){_0xe7825a[_0x83a1('0x16')](0xcc)[_0x83a1('0x17')]();});}};}function handleEntityNotFound(_0x26116c,_0x484361){return function(_0x55c813){if(!_0x55c813){_0x26116c[_0x83a1('0x15')](0x194);}return _0x55c813;};}function handleError(_0x3f26e8,_0x5b552d){_0x5b552d=_0x5b552d||0x1f4;return function(_0x3727ec){logger[_0x83a1('0x21')](_0x3727ec[_0x83a1('0x22')]);if(_0x3727ec[_0x83a1('0x23')]){delete _0x3727ec[_0x83a1('0x23')];}_0x3f26e8['status'](_0x5b552d)[_0x83a1('0x24')](_0x3727ec);};}exports['index']=function(_0x419ec7,_0x401b68){var _0x3349b3={},_0x25258a={},_0x54442a={'count':0x0,'rows':[]};var _0xcbfede=_[_0x83a1('0x25')](db['CmHopperBlack']['rawAttributes'],function(_0x559899){return{'name':_0x559899[_0x83a1('0x26')],'type':_0x559899[_0x83a1('0x27')][_0x83a1('0x28')]};});_0x25258a[_0x83a1('0x29')]=_[_0x83a1('0x25')](_0xcbfede,_0x83a1('0x23'));_0x25258a[_0x83a1('0x2a')]=_[_0x83a1('0x2b')](_0x419ec7[_0x83a1('0x2a')]);_0x25258a[_0x83a1('0x2c')]=_['intersection'](_0x25258a[_0x83a1('0x29')],_0x25258a[_0x83a1('0x2a')]);_0x3349b3[_0x83a1('0x2d')]=_[_0x83a1('0x2e')](_0x25258a[_0x83a1('0x29')],qs[_0x83a1('0x2f')](_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x2f')]));_0x3349b3['attributes']=_0x3349b3[_0x83a1('0x2d')][_0x83a1('0x30')]?_0x3349b3['attributes']:_0x25258a['model'];if(!_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x31')](_0x83a1('0x32'))){_0x3349b3['limit']=qs[_0x83a1('0x1c')](_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x1c')]);_0x3349b3[_0x83a1('0x19')]=qs[_0x83a1('0x19')](_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x19')]);}_0x3349b3[_0x83a1('0x33')]=qs[_0x83a1('0x34')](_0x419ec7[_0x83a1('0x2a')]['sort']);_0x3349b3[_0x83a1('0x35')]=qs[_0x83a1('0x2c')](_['pick'](_0x419ec7[_0x83a1('0x2a')],_0x25258a[_0x83a1('0x2c')]),_0xcbfede);if(_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x36')]){_0x3349b3[_0x83a1('0x35')]=_[_0x83a1('0x37')](_0x3349b3['where'],{'$or':_[_0x83a1('0x25')](_0xcbfede,function(_0x2eabb0){if(_0x2eabb0['type']!=='VIRTUAL'){var _0x2c47ca={};_0x2c47ca[_0x2eabb0['name']]={'$like':'%'+_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x36')]+'%'};return _0x2c47ca;}})});}_0x3349b3=_[_0x83a1('0x37')]({},_0x3349b3,_0x419ec7['options']);var _0x22af5c={'where':_0x3349b3[_0x83a1('0x35')]};return db['CmHopperBlack'][_0x83a1('0x1b')](_0x22af5c)[_0x83a1('0x1f')](function(_0x5e0f1a){_0x54442a['count']=_0x5e0f1a;if(_0x419ec7[_0x83a1('0x2a')][_0x83a1('0x38')]){_0x3349b3[_0x83a1('0x39')]=[{'all':!![]}];}return db[_0x83a1('0x3a')][_0x83a1('0x3b')](_0x3349b3);})[_0x83a1('0x1f')](function(_0x249601){_0x54442a[_0x83a1('0x3c')]=_0x249601;return _0x54442a;})[_0x83a1('0x1f')](respondWithFilteredResult(_0x401b68,_0x3349b3))[_0x83a1('0x3d')](handleError(_0x401b68,null));};exports['show']=function(_0xb247b3,_0x159c2f){var _0x44df70={'raw':!![],'where':{'id':_0xb247b3[_0x83a1('0x3e')]['id']}},_0x385480={};_0x385480[_0x83a1('0x29')]=_[_0x83a1('0x2b')](db['CmHopperBlack'][_0x83a1('0x3f')]);_0x385480[_0x83a1('0x2a')]=_[_0x83a1('0x2b')](_0xb247b3[_0x83a1('0x2a')]);_0x385480[_0x83a1('0x2c')]=_[_0x83a1('0x2e')](_0x385480[_0x83a1('0x29')],_0x385480[_0x83a1('0x2a')]);_0x44df70[_0x83a1('0x2d')]=_[_0x83a1('0x2e')](_0x385480['model'],qs['fields'](_0xb247b3['query'][_0x83a1('0x2f')]));_0x44df70['attributes']=_0x44df70[_0x83a1('0x2d')][_0x83a1('0x30')]?_0x44df70[_0x83a1('0x2d')]:_0x385480[_0x83a1('0x29')];if(_0xb247b3[_0x83a1('0x2a')][_0x83a1('0x38')]){_0x44df70[_0x83a1('0x39')]=[{'all':!![]}];}_0x44df70=_[_0x83a1('0x37')]({},_0x44df70,_0xb247b3[_0x83a1('0x40')]);return db[_0x83a1('0x3a')]['find'](_0x44df70)[_0x83a1('0x1f')](handleEntityNotFound(_0x159c2f,null))[_0x83a1('0x1f')](respondWithResult(_0x159c2f,null))['catch'](handleError(_0x159c2f,null));};exports['update']=function(_0x1dfb4a,_0x230946){if(_0x1dfb4a[_0x83a1('0x41')]['id']){delete _0x1dfb4a[_0x83a1('0x41')]['id'];}return db[_0x83a1('0x3a')][_0x83a1('0x42')]({'where':{'id':_0x1dfb4a[_0x83a1('0x3e')]['id']}})[_0x83a1('0x1f')](handleEntityNotFound(_0x230946,null))[_0x83a1('0x1f')](saveUpdates(_0x1dfb4a['body'],null))[_0x83a1('0x1f')](respondWithResult(_0x230946,null))[_0x83a1('0x3d')](handleError(_0x230946,null));};exports[_0x83a1('0x20')]=function(_0x313b08,_0xbd7721){return db[_0x83a1('0x3a')][_0x83a1('0x42')]({'where':{'id':_0x313b08[_0x83a1('0x3e')]['id']}})[_0x83a1('0x1f')](handleEntityNotFound(_0xbd7721,null))[_0x83a1('0x1f')](removeEntity(_0xbd7721,null))[_0x83a1('0x3d')](handleError(_0xbd7721,null));};exports[_0x83a1('0x43')]=function(_0x554a33,_0xd57386){return db[_0x83a1('0x3a')][_0x83a1('0x43')]()[_0x83a1('0x1f')](respondWithResult(_0xd57386,null))['catch'](handleError(_0xd57386,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index e91fcc0..4239ad9 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 _0x7407=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x8b12db,_0xc19721){var _0x342db5=function(_0x2d1dc0){while(--_0x2d1dc0){_0x8b12db['push'](_0x8b12db['shift']());}};_0x342db5(++_0xc19721);}(_0x7407,0x131));var _0x7740=function(_0x5bc9c2,_0x406371){_0x5bc9c2=_0x5bc9c2-0x0;var _0x19308a=_0x7407[_0x5bc9c2];return _0x19308a;};'use strict';var _=require(_0x7740('0x0'));var util=require(_0x7740('0x1'));var logger=require(_0x7740('0x2'))(_0x7740('0x3'));var moment=require(_0x7740('0x4'));var BPromise=require(_0x7740('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7740('0x6'));var rimraf=require(_0x7740('0x7'));var config=require(_0x7740('0x8'));var attributes=require(_0x7740('0x9'));module[_0x7740('0xa')]=function(_0x26bd62,_0x11b1d2){return _0x26bd62[_0x7740('0xb')](_0x7740('0xc'),attributes,{'tableName':_0x7740('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec22=['CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','path','rimraf','./cmHopperBlack.attributes','exports','define'];(function(_0x3633be,_0x190e56){var _0x45326d=function(_0x49e1c6){while(--_0x49e1c6){_0x3633be['push'](_0x3633be['shift']());}};_0x45326d(++_0x190e56);}(_0xec22,0x136));var _0x2ec2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xec22[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x2ec2('0x0'));var logger=require(_0x2ec2('0x1'))(_0x2ec2('0x2'));var moment=require(_0x2ec2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ec2('0x4'));var rimraf=require(_0x2ec2('0x5'));var config=require('../../config/environment');var attributes=require(_0x2ec2('0x6'));module[_0x2ec2('0x7')]=function(_0x232ee4,_0x5631dc){return _0x232ee4[_0x2ec2('0x8')](_0x2ec2('0x9'),attributes,{'tableName':_0x2ec2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4006cc9..22df5bc 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 _0x0c8e=['message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa12c8a,_0x454c32){var _0x37997a=function(_0x82ea24){while(--_0x82ea24){_0xa12c8a['push'](_0xa12c8a['shift']());}};_0x37997a(++_0x454c32);}(_0x0c8e,0x1bf));var _0xe0c8=function(_0x12a177,_0x1860ae){_0x12a177=_0x12a177-0x0;var _0x37adb5=_0x0c8e[_0x12a177];return _0x37adb5;};'use strict';var _=require(_0xe0c8('0x0'));var util=require(_0xe0c8('0x1'));var moment=require(_0xe0c8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0c8('0x4'));var logger=require(_0xe0c8('0x5'))(_0xe0c8('0x6'));var config=require(_0xe0c8('0x7'));var jayson=require(_0xe0c8('0x8'));var client=jayson[_0xe0c8('0x9')][_0xe0c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29d141,_0x565e68,_0x5bef47){return new BPromise(function(_0xdf361,_0x398be5){return client[_0xe0c8('0xb')](_0x29d141,_0x5bef47)[_0xe0c8('0xc')](function(_0xf30d2d){logger[_0xe0c8('0xd')](_0xe0c8('0xe'),_0x565e68,_0xe0c8('0xf'));logger[_0xe0c8('0x10')](_0xe0c8('0x11'),_0x565e68,'request\x20sent',JSON[_0xe0c8('0x12')](_0xf30d2d));if(_0xf30d2d[_0xe0c8('0x13')]){if(_0xf30d2d[_0xe0c8('0x13')][_0xe0c8('0x14')]===0x1f4){logger[_0xe0c8('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x565e68,_0xf30d2d[_0xe0c8('0x13')][_0xe0c8('0x15')]);return _0x398be5(_0xf30d2d[_0xe0c8('0x13')][_0xe0c8('0x15')]);}logger[_0xe0c8('0x13')](_0xe0c8('0xe'),_0x565e68,_0xf30d2d[_0xe0c8('0x13')][_0xe0c8('0x15')]);return _0xdf361(_0xf30d2d[_0xe0c8('0x13')][_0xe0c8('0x15')]);}else{logger[_0xe0c8('0xd')](_0xe0c8('0xe'),_0x565e68,_0xe0c8('0xf'));_0xdf361(_0xf30d2d[_0xe0c8('0x16')][_0xe0c8('0x15')]);}})[_0xe0c8('0x17')](function(_0x5af38b){logger[_0xe0c8('0x13')](_0xe0c8('0xe'),_0x565e68,_0x5af38b);_0x398be5(_0x5af38b);});});}exports[_0xe0c8('0x18')]=function(_0x2314c4){var _0x2aab89=this;return new Promise(function(_0x335c04,_0x34657f){return db[_0xe0c8('0x19')][_0xe0c8('0x1a')]({'raw':_0x2314c4[_0xe0c8('0x1b')]?_0x2314c4[_0xe0c8('0x1b')][_0xe0c8('0x1c')]===undefined?!![]:![]:!![],'where':_0x2314c4[_0xe0c8('0x1b')]?_0x2314c4['options']['where']||null:null,'attributes':_0x2314c4['options']?_0x2314c4[_0xe0c8('0x1b')][_0xe0c8('0x1d')]||null:null,'limit':_0x2314c4[_0xe0c8('0x1b')]?_0x2314c4[_0xe0c8('0x1b')][_0xe0c8('0x1e')]||null:null,'include':_0x2314c4[_0xe0c8('0x1b')]?_0x2314c4[_0xe0c8('0x1b')][_0xe0c8('0x1f')]?_[_0xe0c8('0x20')](_0x2314c4['options'][_0xe0c8('0x1f')],function(_0x54c64f){return{'model':db[_0x54c64f['model']],'as':_0x54c64f['as'],'attributes':_0x54c64f[_0xe0c8('0x1d')],'include':_0x54c64f['include']?_[_0xe0c8('0x20')](_0x54c64f[_0xe0c8('0x1f')],function(_0x183ec8){return{'model':db[_0x183ec8[_0xe0c8('0x21')]],'as':_0x183ec8['as'],'attributes':_0x183ec8[_0xe0c8('0x1d')],'include':_0x183ec8[_0xe0c8('0x1f')]?_['map'](_0x183ec8[_0xe0c8('0x1f')],function(_0x2ac55d){return{'model':db[_0x2ac55d['model']],'as':_0x2ac55d['as'],'attributes':_0x2ac55d[_0xe0c8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b72f3){logger['info'](_0xe0c8('0x18'),_0x2314c4);logger[_0xe0c8('0x10')]('GetCmHopperBlack',_0x2314c4,JSON[_0xe0c8('0x12')](_0x3b72f3));_0x335c04(_0x3b72f3);})[_0xe0c8('0x17')](function(_0x57f97c){logger[_0xe0c8('0x13')](_0xe0c8('0x18'),_0x57f97c[_0xe0c8('0x15')],_0x2314c4);_0x34657f(_0x2aab89[_0xe0c8('0x13')](0x1f4,_0x57f97c['message']));});});};exports['UpdateCmHopperBlack']=function(_0x1670c1){var _0x44795e=this;return new Promise(function(_0x5bca05,_0x524d40){return db['CmHopperBlack']['update'](_0x1670c1[_0xe0c8('0x22')],{'raw':_0x1670c1[_0xe0c8('0x1b')]?_0x1670c1[_0xe0c8('0x1b')][_0xe0c8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1670c1[_0xe0c8('0x1b')]?_0x1670c1[_0xe0c8('0x1b')][_0xe0c8('0x23')]||null:null,'attributes':_0x1670c1[_0xe0c8('0x1b')]?_0x1670c1[_0xe0c8('0x1b')]['attributes']||null:null,'limit':_0x1670c1[_0xe0c8('0x1b')]?_0x1670c1[_0xe0c8('0x1b')][_0xe0c8('0x1e')]||null:null})[_0xe0c8('0xc')](function(_0x5dda7a){logger[_0xe0c8('0xd')](_0xe0c8('0x24'),_0x1670c1);logger[_0xe0c8('0x10')](_0xe0c8('0x24'),_0x1670c1,JSON[_0xe0c8('0x12')](_0x5dda7a));_0x5bca05(_0x5dda7a);})[_0xe0c8('0x17')](function(_0x16ceeb){logger[_0xe0c8('0x13')]('UpdateCmHopperBlack',_0x16ceeb[_0xe0c8('0x15')],_0x1670c1);_0x524d40(_0x44795e[_0xe0c8('0x13')](0x1f4,_0x16ceeb[_0xe0c8('0x15')]));});});};exports[_0xe0c8('0x25')]=function(_0x37fa55){var _0x3b7962=this;return new Promise(function(_0x3aead3,_0x1c1805){return db[_0xe0c8('0x19')][_0xe0c8('0x26')]({'where':_0x37fa55[_0xe0c8('0x1b')]?_0x37fa55['options']['where']||null:null})['then'](function(_0x321dd0){logger['info']('DestroyCmHopperBlack',_0x37fa55);logger['debug']('DestroyCmHopperBlack',_0x37fa55,JSON[_0xe0c8('0x12')](_0x321dd0));_0x3aead3(_0x321dd0);})['catch'](function(_0x19d693){logger[_0xe0c8('0x13')](_0xe0c8('0x25'),_0x19d693[_0xe0c8('0x15')],_0x37fa55);_0x1c1805(_0x3b7962['error'](0x1f4,_0x19d693['message']));});});}; \ No newline at end of file +var _0xd3bb=['jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','destroy','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0xd3bb,0xb1));var _0xbd3b=function(_0x86e4e5,_0x54dc3f){_0x86e4e5=_0x86e4e5-0x0;var _0x236ca7=_0xd3bb[_0x86e4e5];return _0x236ca7;};'use strict';var _=require('lodash');var util=require(_0xbd3b('0x0'));var moment=require(_0xbd3b('0x1'));var BPromise=require(_0xbd3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd3b('0x3'));var db=require(_0xbd3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd3b('0x5'))(_0xbd3b('0x6'));var config=require(_0xbd3b('0x7'));var jayson=require(_0xbd3b('0x8'));var client=jayson['client'][_0xbd3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e9b6e,_0x47c9cb,_0x15c54e){return new BPromise(function(_0x58d2a8,_0xd6d00d){return client[_0xbd3b('0xa')](_0x1e9b6e,_0x15c54e)[_0xbd3b('0xb')](function(_0x4672cd){logger[_0xbd3b('0xc')](_0xbd3b('0xd'),_0x47c9cb,_0xbd3b('0xe'));logger[_0xbd3b('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x47c9cb,_0xbd3b('0xe'),JSON[_0xbd3b('0x10')](_0x4672cd));if(_0x4672cd[_0xbd3b('0x11')]){if(_0x4672cd[_0xbd3b('0x11')][_0xbd3b('0x12')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x47c9cb,_0x4672cd['error']['message']);return _0xd6d00d(_0x4672cd[_0xbd3b('0x11')][_0xbd3b('0x13')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x47c9cb,_0x4672cd[_0xbd3b('0x11')][_0xbd3b('0x13')]);return _0x58d2a8(_0x4672cd['error']['message']);}else{logger[_0xbd3b('0xc')](_0xbd3b('0xd'),_0x47c9cb,_0xbd3b('0xe'));_0x58d2a8(_0x4672cd[_0xbd3b('0x14')]['message']);}})[_0xbd3b('0x15')](function(_0x17c0f2){logger['error'](_0xbd3b('0xd'),_0x47c9cb,_0x17c0f2);_0xd6d00d(_0x17c0f2);});});}exports['GetCmHopperBlack']=function(_0x480045){var _0x3a080a=this;return new Promise(function(_0x5f0a8b,_0x5bfd2a){return db[_0xbd3b('0x16')][_0xbd3b('0x17')]({'raw':_0x480045['options']?_0x480045[_0xbd3b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x480045['options']?_0x480045[_0xbd3b('0x18')][_0xbd3b('0x19')]||null:null,'attributes':_0x480045[_0xbd3b('0x18')]?_0x480045[_0xbd3b('0x18')][_0xbd3b('0x1a')]||null:null,'limit':_0x480045[_0xbd3b('0x18')]?_0x480045['options'][_0xbd3b('0x1b')]||null:null,'include':_0x480045[_0xbd3b('0x18')]?_0x480045[_0xbd3b('0x18')][_0xbd3b('0x1c')]?_[_0xbd3b('0x1d')](_0x480045[_0xbd3b('0x18')][_0xbd3b('0x1c')],function(_0x4d1078){return{'model':db[_0x4d1078[_0xbd3b('0x1e')]],'as':_0x4d1078['as'],'attributes':_0x4d1078[_0xbd3b('0x1a')],'include':_0x4d1078[_0xbd3b('0x1c')]?_['map'](_0x4d1078[_0xbd3b('0x1c')],function(_0x41db8e){return{'model':db[_0x41db8e[_0xbd3b('0x1e')]],'as':_0x41db8e['as'],'attributes':_0x41db8e[_0xbd3b('0x1a')],'include':_0x41db8e[_0xbd3b('0x1c')]?_[_0xbd3b('0x1d')](_0x41db8e[_0xbd3b('0x1c')],function(_0x26a195){return{'model':db[_0x26a195['model']],'as':_0x26a195['as'],'attributes':_0x26a195[_0xbd3b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbd3b('0xb')](function(_0x452ecc){logger['info']('GetCmHopperBlack',_0x480045);logger['debug'](_0xbd3b('0x1f'),_0x480045,JSON[_0xbd3b('0x10')](_0x452ecc));_0x5f0a8b(_0x452ecc);})[_0xbd3b('0x15')](function(_0x50dc79){logger['error'](_0xbd3b('0x1f'),_0x50dc79[_0xbd3b('0x13')],_0x480045);_0x5bfd2a(_0x3a080a['error'](0x1f4,_0x50dc79[_0xbd3b('0x13')]));});});};exports[_0xbd3b('0x20')]=function(_0x5dbc85){var _0x293bf6=this;return new Promise(function(_0x531a80,_0x3f9e2d){return db[_0xbd3b('0x16')][_0xbd3b('0x21')](_0x5dbc85['body'],{'raw':_0x5dbc85['options']?_0x5dbc85[_0xbd3b('0x18')][_0xbd3b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dbc85[_0xbd3b('0x18')]?_0x5dbc85[_0xbd3b('0x18')][_0xbd3b('0x19')]||null:null,'attributes':_0x5dbc85[_0xbd3b('0x18')]?_0x5dbc85[_0xbd3b('0x18')][_0xbd3b('0x1a')]||null:null,'limit':_0x5dbc85[_0xbd3b('0x18')]?_0x5dbc85[_0xbd3b('0x18')]['limit']||null:null})['then'](function(_0xaffffa){logger[_0xbd3b('0xc')](_0xbd3b('0x20'),_0x5dbc85);logger['debug']('UpdateCmHopperBlack',_0x5dbc85,JSON[_0xbd3b('0x10')](_0xaffffa));_0x531a80(_0xaffffa);})[_0xbd3b('0x15')](function(_0x164681){logger[_0xbd3b('0x11')](_0xbd3b('0x20'),_0x164681[_0xbd3b('0x13')],_0x5dbc85);_0x3f9e2d(_0x293bf6[_0xbd3b('0x11')](0x1f4,_0x164681[_0xbd3b('0x13')]));});});};exports[_0xbd3b('0x23')]=function(_0x52dd22){var _0xe11a37=this;return new Promise(function(_0x4bd551,_0x59276f){return db[_0xbd3b('0x16')][_0xbd3b('0x24')]({'where':_0x52dd22['options']?_0x52dd22[_0xbd3b('0x18')][_0xbd3b('0x19')]||null:null})['then'](function(_0x538204){logger[_0xbd3b('0xc')](_0xbd3b('0x23'),_0x52dd22);logger[_0xbd3b('0xf')](_0xbd3b('0x23'),_0x52dd22,JSON[_0xbd3b('0x10')](_0x538204));_0x4bd551(_0x538204);})[_0xbd3b('0x15')](function(_0x469da3){logger[_0xbd3b('0x11')](_0xbd3b('0x23'),_0x469da3[_0xbd3b('0x13')],_0x52dd22);_0x59276f(_0xe11a37[_0xbd3b('0x11')](0x1f4,_0x469da3[_0xbd3b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 08ea89e..21d8a3b 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 _0x11e5=['update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','put'];(function(_0x2f0feb,_0x360a80){var _0x2ba7f2=function(_0x481fb2){while(--_0x481fb2){_0x2f0feb['push'](_0x2f0feb['shift']());}};_0x2ba7f2(++_0x360a80);}(_0x11e5,0x8b));var _0x511e=function(_0x213508,_0x5f3ff0){_0x213508=_0x213508-0x0;var _0x1b0363=_0x11e5[_0x213508];return _0x1b0363;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0x9')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0xd')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xe')]);router[_0x511e('0xf')](_0x511e('0xb'),auth['isAuthenticated'](),controller[_0x511e('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd101=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd101,0xc1));var _0x1d10=function(_0x1a4ab2,_0x4a641b){_0x1a4ab2=_0x1a4ab2-0x0;var _0x1576ef=_0xd101[_0x1a4ab2];return _0x1576ef;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./cmHopperBlack.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0x9')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x10')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')](_0x1d10('0xe'),auth['isAuthenticated'](),controller[_0x1d10('0x13')]);module[_0x1d10('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 0f8599b..79a22fc 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 _0xde24=['INTEGER','STRING','DATE','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde24,0xad));var _0x4de2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde24[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4de2('0x0'));var moment=require(_0x4de2('0x1'));module[_0x4de2('0x2')]={'state':{'type':Sequelize[_0x4de2('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4de2('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4de2('0x4')]},'calleridname':{'type':Sequelize[_0x4de2('0x4')]},'starttime':{'type':Sequelize[_0x4de2('0x5')]},'responsetime':{'type':Sequelize[_0x4de2('0x5')]},'answertime':{'type':Sequelize[_0x4de2('0x5')]},'droptime':{'type':Sequelize[_0x4de2('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4de2('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x4de2('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4de2('0x4')]},'dispositionat':{'type':Sequelize[_0x4de2('0x5')],'set':function(_0x4a8cbd){var _0xa0b05c=this['getDataValue'](_0x4de2('0x6'));if(_0xa0b05c&&_0x4a8cbd){this[_0x4de2('0x7')]('followuptime',moment(_0x4a8cbd)[_0x4de2('0x8')](moment(_0xa0b05c),_0x4de2('0x9')));}}},'amd':{'type':Sequelize[_0x4de2('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4de2('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4de2('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x4de2('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4de2('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4de2('0x5')]},'deleted':{'type':Sequelize[_0x4de2('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x4de2('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4de2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2e16=['setDataValue','followuptime','BOOLEAN','sequelize','exports','INTEGER','DATE','STRING','endtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e16,0x198));var _0x62e1=function(_0x4e107a,_0x229ebc){_0x4e107a=_0x4e107a-0x0;var _0x5774f1=_0x2e16[_0x4e107a];return _0x5774f1;};'use strict';var Sequelize=require(_0x62e1('0x0'));var moment=require('moment');module[_0x62e1('0x1')]={'state':{'type':Sequelize[_0x62e1('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x62e1('0x3')]},'countbusyretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x62e1('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x62e1('0x4')]},'originatecalleridname':{'type':Sequelize[_0x62e1('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x62e1('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x62e1('0x3')]},'answertime':{'type':Sequelize[_0x62e1('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x62e1('0x3')]},'ringtime':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x62e1('0x4')]},'campaigntype':{'type':Sequelize[_0x62e1('0x4')]},'membername':{'type':Sequelize[_0x62e1('0x4')]},'reason':{'type':Sequelize[_0x62e1('0x4')]},'disposition':{'type':Sequelize[_0x62e1('0x4')]},'secondDisposition':{'type':Sequelize[_0x62e1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x587716){var _0x2547f3=this['getDataValue'](_0x62e1('0x5'));if(_0x2547f3&&_0x587716){this[_0x62e1('0x6')](_0x62e1('0x7'),moment(_0x587716)['diff'](moment(_0x2547f3),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x62e1('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x62e1('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x62e1('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x62e1('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x62e1('0x3')]},'recallme':{'type':Sequelize[_0x62e1('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x62e1('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x62e1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 3b49c43..572b96e 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 _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0xcfe9cb,_0x427934){var _0x163cd3=function(_0x4ee5cf){while(--_0x4ee5cf){_0xcfe9cb['push'](_0xcfe9cb['shift']());}};_0x163cd3(++_0x427934);}(_0x4c60,0xc1));var _0x04c6=function(_0x5bb921,_0x28ab05){_0x5bb921=_0x5bb921-0x0;var _0x2884e9=_0x4c60[_0x5bb921];return _0x2884e9;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['CmHopperFinal'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['CmHopperFinal'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));}; \ No newline at end of file +var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x1c1f31,_0x57bce4){var _0x12f677=function(_0x2dcdda){while(--_0x2dcdda){_0x1c1f31['push'](_0x1c1f31['shift']());}};_0x12f677(++_0x57bce4);}(_0xd117,0x182));var _0x7d11=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xd117[_0x29bf80];return _0x932096;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c7a98f0..86a8266 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 _0x0b74=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','./cmHopperFinal.attributes'];(function(_0x469ec6,_0x44e5b6){var _0x3bf59a=function(_0x37fa73){while(--_0x37fa73){_0x469ec6['push'](_0x469ec6['shift']());}};_0x3bf59a(++_0x44e5b6);}(_0x0b74,0x13d));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x40b7('0x0'));var util=require(_0x40b7('0x1'));var logger=require(_0x40b7('0x2'))(_0x40b7('0x3'));var moment=require(_0x40b7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x40b7('0x5'));var rimraf=require(_0x40b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x40b7('0x7'));module['exports']=function(_0x569598,_0xf13a7a){return _0x569598[_0x40b7('0x8')](_0x40b7('0x9'),attributes,{'tableName':_0x40b7('0xa'),'paranoid':![],'indexes':[{'name':_0x40b7('0xb'),'fields':[_0x40b7('0xb')]},{'name':_0x40b7('0xc'),'fields':[_0x40b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bb7=['bluebird','path','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x34d22d,_0x4aef5b){var _0x30ef06=function(_0x555ba6){while(--_0x555ba6){_0x34d22d['push'](_0x34d22d['shift']());}};_0x30ef06(++_0x4aef5b);}(_0x4bb7,0x1bb));var _0x74bb=function(_0x45cc04,_0x1df248){_0x45cc04=_0x45cc04-0x0;var _0xbae3ea=_0x4bb7[_0x45cc04];return _0xbae3ea;};'use strict';var _=require(_0x74bb('0x0'));var util=require(_0x74bb('0x1'));var logger=require(_0x74bb('0x2'))(_0x74bb('0x3'));var moment=require(_0x74bb('0x4'));var BPromise=require(_0x74bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74bb('0x6'));var rimraf=require('rimraf');var config=require(_0x74bb('0x7'));var attributes=require(_0x74bb('0x8'));module[_0x74bb('0x9')]=function(_0x21f6b4,_0x19ccfb){return _0x21f6b4['define'](_0x74bb('0xa'),attributes,{'tableName':_0x74bb('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x74bb('0xc')]},{'name':_0x74bb('0xd'),'fields':[_0x74bb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index cbe4bdd..327748c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x537620,_0x49f307){var _0x383367=function(_0x2c3509){while(--_0x2c3509){_0x537620['push'](_0x537620['shift']());}};_0x383367(++_0x49f307);}(_0xb10b,0x12a));var _0xbb10=function(_0x448a56,_0x3cd4d1){_0x448a56=_0x448a56-0x0;var _0x1ba466=_0xb10b[_0x448a56];return _0x1ba466;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x182c76,_0x17ada5){var _0x1e9c1e=function(_0x339fe5){while(--_0x339fe5){_0x182c76['push'](_0x182c76['shift']());}};_0x1e9c1e(++_0x17ada5);}(_0x7a54,0x106));var _0x47a5=function(_0xfaa5a8,_0xff70f5){_0xfaa5a8=_0xfaa5a8-0x0;var _0x1abb87=_0x7a54[_0xfaa5a8];return _0x1abb87;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index b6df03c..f274469 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 _0x1aac=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','/describe','describe','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x1aac,0xca));var _0xc1aa=function(_0xd5d7da,_0x458d3f){_0xd5d7da=_0xd5d7da-0x0;var _0x4b3762=_0x1aac[_0xd5d7da];return _0x4b3762;};'use strict';var multer=require(_0xc1aa('0x0'));var util=require(_0xc1aa('0x1'));var path=require(_0xc1aa('0x2'));var timeout=require(_0xc1aa('0x3'));var express=require(_0xc1aa('0x4'));var router=express[_0xc1aa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc1aa('0x6'));var interaction=require(_0xc1aa('0x7'));var config=require(_0xc1aa('0x8'));var controller=require(_0xc1aa('0x9'));router['get']('/',auth[_0xc1aa('0xa')](),controller['index']);router['get'](_0xc1aa('0xb'),auth[_0xc1aa('0xa')](),controller[_0xc1aa('0xc')]);router['get']('/:id',auth[_0xc1aa('0xa')](),controller['show']);router[_0xc1aa('0xd')](_0xc1aa('0xe'),auth['isAuthenticated'](),controller[_0xc1aa('0xf')]);router[_0xc1aa('0xd')]('/campaign/countAttributes/:id',auth[_0xc1aa('0xa')](),controller[_0xc1aa('0x10')]);router[_0xc1aa('0x11')](_0xc1aa('0x12'),auth[_0xc1aa('0xa')](),controller[_0xc1aa('0x13')]);router[_0xc1aa('0x11')](_0xc1aa('0x14'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc1aa('0x11')](_0xc1aa('0x15'),auth[_0xc1aa('0xa')](),controller[_0xc1aa('0x16')]);router['put'](_0xc1aa('0x17'),auth['isAuthenticated'](),controller[_0xc1aa('0x18')]);module[_0xc1aa('0x19')]=router; \ No newline at end of file +var _0xe091=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3fe149,_0x54f2f0){var _0x9932e2=function(_0x38291a){while(--_0x38291a){_0x3fe149['push'](_0x3fe149['shift']());}};_0x9932e2(++_0x54f2f0);}(_0xe091,0x1ad));var _0x1e09=function(_0x47436d,_0x752fa3){_0x47436d=_0x47436d-0x0;var _0x133770=_0xe091[_0x47436d];return _0x133770;};'use strict';var multer=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var path=require(_0x1e09('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e09('0x3'));var router=express[_0x1e09('0x4')]();var fs_extra=require(_0x1e09('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e09('0x6'));var config=require(_0x1e09('0x7'));var controller=require(_0x1e09('0x8'));router[_0x1e09('0x9')]('/',auth[_0x1e09('0xa')](),controller[_0x1e09('0xb')]);router[_0x1e09('0x9')](_0x1e09('0xc'),auth['isAuthenticated'](),controller[_0x1e09('0xd')]);router[_0x1e09('0x9')](_0x1e09('0xe'),auth[_0x1e09('0xa')](),controller[_0x1e09('0xf')]);router[_0x1e09('0x9')]('/voice/queue/countAttributes/:id',auth[_0x1e09('0xa')](),controller[_0x1e09('0x10')]);router['get'](_0x1e09('0x11'),auth[_0x1e09('0xa')](),controller[_0x1e09('0x12')]);router['post'](_0x1e09('0x13'),auth['isAuthenticated'](),controller[_0x1e09('0x14')]);router[_0x1e09('0x15')](_0x1e09('0x16'),auth[_0x1e09('0xa')](),controller[_0x1e09('0x17')]);router[_0x1e09('0x15')](_0x1e09('0x18'),auth['isAuthenticated'](),controller[_0x1e09('0x19')]);router[_0x1e09('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x1e09('0x1b')]);module[_0x1e09('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 8408fae..606b3d7 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 _0x052d=['DATE','INTEGER','STRING','BOOLEAN','sequelize','exports'];(function(_0x4821a4,_0x2aa030){var _0x40fe2a=function(_0x3bf760){while(--_0x3bf760){_0x4821a4['push'](_0x4821a4['shift']());}};_0x40fe2a(++_0x2aa030);}(_0x052d,0xee));var _0xd052=function(_0x4ab7a5,_0x35eb99){_0x4ab7a5=_0x4ab7a5-0x0;var _0x5f5013=_0x052d[_0x4ab7a5];return _0x5f5013;};'use strict';var Sequelize=require(_0xd052('0x0'));module[_0xd052('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd052('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd052('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xd052('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd052('0x4')]},'calleridname':{'type':Sequelize[_0xd052('0x4')]},'starttime':{'type':Sequelize[_0xd052('0x2')]},'responsetime':{'type':Sequelize[_0xd052('0x2')]},'answertime':{'type':Sequelize[_0xd052('0x2')]},'droptime':{'type':Sequelize[_0xd052('0x2')]},'endtime':{'type':Sequelize[_0xd052('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd052('0x4')]},'campaign':{'type':Sequelize[_0xd052('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xd052('0x4')]},'amd':{'type':Sequelize[_0xd052('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd052('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd052('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd052('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd052('0x2')]},'recallme':{'type':Sequelize[_0xd052('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xd052('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd052('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa54c=['STRING','DATE','BOOLEAN','INTEGER'];(function(_0x473ab8,_0x111267){var _0x45fbc5=function(_0x5bc60f){while(--_0x5bc60f){_0x473ab8['push'](_0x473ab8['shift']());}};_0x45fbc5(++_0x111267);}(_0xa54c,0xcf));var _0xca54=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa54c[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xca54('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xca54('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xca54('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xca54('0x1')]},'originatecalleridname':{'type':Sequelize[_0xca54('0x1')]},'calleridnum':{'type':Sequelize[_0xca54('0x1')]},'calleridname':{'type':Sequelize[_0xca54('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xca54('0x2')]},'answertime':{'type':Sequelize[_0xca54('0x2')]},'droptime':{'type':Sequelize[_0xca54('0x2')]},'endtime':{'type':Sequelize[_0xca54('0x2')]},'ringtime':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xca54('0x1')]},'campaign':{'type':Sequelize[_0xca54('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xca54('0x1')]},'reason':{'type':Sequelize[_0xca54('0x1')]},'amd':{'type':Sequelize[_0xca54('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0xca54('0x3')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xca54('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xca54('0x2')]},'recallme':{'type':Sequelize[_0xca54('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xca54('0x2')]},'edited':{'type':Sequelize[_0xca54('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xca54('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xca54('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 1248ddc..c15eb2d 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 _0x3524=['uniqueid','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','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','status','end','json','undefined','limit','offset','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','length','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','create','body','describe'];(function(_0x6c0b0a,_0x496391){var _0x5f456a=function(_0x5ae918){while(--_0x5ae918){_0x6c0b0a['push'](_0x6c0b0a['shift']());}};_0x5f456a(++_0x496391);}(_0x3524,0x95));var _0x4352=function(_0x193dc0,_0x7fc1b4){_0x193dc0=_0x193dc0-0x0;var _0x207b6d=_0x3524[_0x193dc0];return _0x207b6d;};'use strict';var emlformat=require(_0x4352('0x0'));var rimraf=require(_0x4352('0x1'));var zipdir=require(_0x4352('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4352('0x3'));var moment=require('moment');var BPromise=require(_0x4352('0x4'));var Mustache=require(_0x4352('0x5'));var util=require(_0x4352('0x6'));var path=require('path');var sox=require(_0x4352('0x7'));var csv=require(_0x4352('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4352('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4352('0xa'));var jsforce=require(_0x4352('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4352('0xc'));var Papa=require(_0x4352('0xd'));var Redis=require(_0x4352('0xe'));var authService=require(_0x4352('0xf'));var qs=require(_0x4352('0x10'));var as=require(_0x4352('0x11'));var hardwareService=require(_0x4352('0x12'));var logger=require('../../config/logger')(_0x4352('0x13'));var utils=require(_0x4352('0x14'));var config=require(_0x4352('0x15'));var licenseUtil=require(_0x4352('0x16'));var db=require(_0x4352('0x17'))['db'];function respondWithStatusCode(_0x34c615,_0x787243){_0x787243=_0x787243||0xcc;return function(_0x183e8b){if(_0x183e8b){return _0x34c615['sendStatus'](_0x787243);}return _0x34c615[_0x4352('0x18')](_0x787243)[_0x4352('0x19')]();};}function respondWithResult(_0x42e8f6,_0x17cee8){_0x17cee8=_0x17cee8||0xc8;return function(_0x3087f9){if(_0x3087f9){return _0x42e8f6[_0x4352('0x18')](_0x17cee8)[_0x4352('0x1a')](_0x3087f9);}};}function respondWithFilteredResult(_0x565319,_0x10ec2e){return function(_0x549a84){if(_0x549a84){var _0x15ade8=typeof _0x10ec2e['offset']===_0x4352('0x1b')&&typeof _0x10ec2e[_0x4352('0x1c')]===_0x4352('0x1b');var _0x2e337e=_0x549a84['count'];var _0x4fb8f5=_0x15ade8?0x0:_0x10ec2e[_0x4352('0x1d')];var _0x513a53=_0x15ade8?_0x549a84[_0x4352('0x1e')]:_0x10ec2e[_0x4352('0x1d')]+_0x10ec2e[_0x4352('0x1c')];var _0x1ff62a;if(_0x513a53>=_0x2e337e){_0x513a53=_0x2e337e;_0x1ff62a=0xc8;}else{_0x1ff62a=0xce;}_0x565319['status'](_0x1ff62a);return _0x565319['set']('Content-Range',_0x4fb8f5+'-'+_0x513a53+'/'+_0x2e337e)[_0x4352('0x1a')](_0x549a84);}return null;};}function patchUpdates(_0x2edfaa){return function(_0x53b073){try{jsonpatch[_0x4352('0x1f')](_0x53b073,_0x2edfaa,!![]);}catch(_0x5a4505){return BPromise[_0x4352('0x20')](_0x5a4505);}return _0x53b073[_0x4352('0x21')]();};}function saveUpdates(_0x471429,_0x5663fd){return function(_0x14e295){if(_0x14e295){return _0x14e295[_0x4352('0x22')](_0x471429)[_0x4352('0x23')](function(_0x3b689b){return _0x3b689b;});}return null;};}function removeEntity(_0x4f37e8,_0xd7a3f){return function(_0x4f85bc){if(_0x4f85bc){return _0x4f85bc[_0x4352('0x24')]()['then'](function(){_0x4f37e8[_0x4352('0x18')](0xcc)[_0x4352('0x19')]();});}};}function handleEntityNotFound(_0x59271a,_0x4868ef){return function(_0x1ab25f){if(!_0x1ab25f){_0x59271a[_0x4352('0x25')](0x194);}return _0x1ab25f;};}function handleError(_0x51561e,_0x23bffb){_0x23bffb=_0x23bffb||0x1f4;return function(_0x5ee6e8){logger['error'](_0x5ee6e8[_0x4352('0x26')]);if(_0x5ee6e8['name']){delete _0x5ee6e8[_0x4352('0x27')];}_0x51561e[_0x4352('0x18')](_0x23bffb)[_0x4352('0x28')](_0x5ee6e8);};}exports['index']=function(_0x383a1d,_0x3f18e7){var _0x370164={},_0xb0e613={},_0x505da0={'count':0x0,'rows':[]};var _0x17471d=_[_0x4352('0x29')](db[_0x4352('0x2a')][_0x4352('0x2b')],function(_0x901999){return{'name':_0x901999[_0x4352('0x2c')],'type':_0x901999[_0x4352('0x2d')][_0x4352('0x2e')]};});_0xb0e613[_0x4352('0x2f')]=_[_0x4352('0x29')](_0x17471d,_0x4352('0x27'));_0xb0e613['query']=_[_0x4352('0x30')](_0x383a1d[_0x4352('0x31')]);_0xb0e613['filters']=_['intersection'](_0xb0e613[_0x4352('0x2f')],_0xb0e613[_0x4352('0x31')]);_0x370164['attributes']=_[_0x4352('0x32')](_0xb0e613['model'],qs['fields'](_0x383a1d[_0x4352('0x31')][_0x4352('0x33')]));_0x370164['attributes']=_0x370164['attributes'][_0x4352('0x34')]?_0x370164['attributes']:_0xb0e613[_0x4352('0x2f')];if(!_0x383a1d[_0x4352('0x31')]['hasOwnProperty'](_0x4352('0x35'))){_0x370164['limit']=qs[_0x4352('0x1c')](_0x383a1d[_0x4352('0x31')]['limit']);_0x370164[_0x4352('0x1d')]=qs['offset'](_0x383a1d[_0x4352('0x31')][_0x4352('0x1d')]);}_0x370164['order']=qs[_0x4352('0x36')](_0x383a1d['query']['sort']);_0x370164[_0x4352('0x37')]=qs[_0x4352('0x38')](_[_0x4352('0x39')](_0x383a1d[_0x4352('0x31')],_0xb0e613[_0x4352('0x38')]),_0x17471d);if(_0x383a1d[_0x4352('0x31')]['filter']){_0x370164[_0x4352('0x37')]=_[_0x4352('0x3a')](_0x370164[_0x4352('0x37')],{'$or':_[_0x4352('0x29')](_0x17471d,function(_0x23927b){if(_0x23927b['type']!=='VIRTUAL'){var _0x2db71b={};_0x2db71b[_0x23927b[_0x4352('0x27')]]={'$like':'%'+_0x383a1d[_0x4352('0x31')][_0x4352('0x3b')]+'%'};return _0x2db71b;}})});}_0x370164=_[_0x4352('0x3a')]({},_0x370164,_0x383a1d[_0x4352('0x3c')]);var _0x1ac445={'where':_0x370164['where']};return db[_0x4352('0x2a')]['count'](_0x1ac445)[_0x4352('0x23')](function(_0x1a8624){_0x505da0[_0x4352('0x1e')]=_0x1a8624;if(_0x383a1d[_0x4352('0x31')][_0x4352('0x3d')]){_0x370164[_0x4352('0x3e')]=[{'all':!![]}];}return db[_0x4352('0x2a')][_0x4352('0x3f')](_0x370164);})['then'](function(_0x38327b){_0x505da0[_0x4352('0x40')]=_0x38327b;return _0x505da0;})[_0x4352('0x23')](respondWithFilteredResult(_0x3f18e7,_0x370164))[_0x4352('0x41')](handleError(_0x3f18e7,null));};exports[_0x4352('0x42')]=function(_0x44f9a1,_0xa00378){var _0x42d782={'raw':!![],'where':{'id':_0x44f9a1[_0x4352('0x43')]['id']}},_0x25e6d8={};_0x25e6d8[_0x4352('0x2f')]=_[_0x4352('0x30')](db[_0x4352('0x2a')][_0x4352('0x2b')]);_0x25e6d8[_0x4352('0x31')]=_[_0x4352('0x30')](_0x44f9a1[_0x4352('0x31')]);_0x25e6d8[_0x4352('0x38')]=_['intersection'](_0x25e6d8[_0x4352('0x2f')],_0x25e6d8[_0x4352('0x31')]);_0x42d782['attributes']=_[_0x4352('0x32')](_0x25e6d8['model'],qs[_0x4352('0x33')](_0x44f9a1[_0x4352('0x31')][_0x4352('0x33')]));_0x42d782['attributes']=_0x42d782[_0x4352('0x44')]['length']?_0x42d782[_0x4352('0x44')]:_0x25e6d8[_0x4352('0x2f')];if(_0x44f9a1['query'][_0x4352('0x3d')]){_0x42d782[_0x4352('0x3e')]=[{'all':!![]}];}_0x42d782=_[_0x4352('0x3a')]({},_0x42d782,_0x44f9a1[_0x4352('0x3c')]);return db[_0x4352('0x2a')][_0x4352('0x45')](_0x42d782)[_0x4352('0x23')](handleEntityNotFound(_0xa00378,null))[_0x4352('0x23')](respondWithResult(_0xa00378,null))['catch'](handleError(_0xa00378,null));};exports[_0x4352('0x46')]=function(_0x43ad77,_0x3c99fa){return db['CmHopperHistory']['create'](_0x43ad77[_0x4352('0x47')],{})['then'](respondWithResult(_0x3c99fa,0xc9))[_0x4352('0x41')](handleError(_0x3c99fa,null));};exports[_0x4352('0x48')]=function(_0x93e12d,_0x7e29b2){return db['CmHopperHistory'][_0x4352('0x48')]()[_0x4352('0x23')](respondWithResult(_0x7e29b2,null))[_0x4352('0x41')](handleError(_0x7e29b2,null));};exports[_0x4352('0x22')]=function(_0x7f4633,_0x177490){if(_0x7f4633[_0x4352('0x47')][_0x4352('0x49')]){delete _0x7f4633[_0x4352('0x47')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x7f4633['params']['id']}})[_0x4352('0x23')](handleEntityNotFound(_0x177490,null))[_0x4352('0x23')](saveUpdates(_0x7f4633[_0x4352('0x47')],null))[_0x4352('0x23')](respondWithResult(_0x177490,null))[_0x4352('0x41')](handleError(_0x177490,null));}; \ No newline at end of file +var _0x3e72=['request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','destroy','then','stack','name','send','map','fieldName','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','CmHopperHistory','includeAll','include','rows','show','params','keys','rawAttributes','intersection','length','find','catch','create','describe','update','body','uniqueid','eml-format','rimraf'];(function(_0x5adde9,_0x1ab2c2){var _0x5509fe=function(_0x293518){while(--_0x293518){_0x5adde9['push'](_0x5adde9['shift']());}};_0x5509fe(++_0x1ab2c2);}(_0x3e72,0x126));var _0x23e7=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x3e72[_0x4f3b2d];return _0x3dddfa;};'use strict';var emlformat=require(_0x23e7('0x0'));var rimraf=require(_0x23e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23e7('0x2'));var moment=require(_0x23e7('0x3'));var BPromise=require(_0x23e7('0x4'));var Mustache=require(_0x23e7('0x5'));var util=require('util');var path=require(_0x23e7('0x6'));var sox=require(_0x23e7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23e7('0x8'));var _=require('lodash');var squel=require(_0x23e7('0x9'));var crypto=require(_0x23e7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x23e7('0xb'));var toCsv=require(_0x23e7('0xc'));var querystring=require(_0x23e7('0xd'));var Papa=require('papaparse');var Redis=require(_0x23e7('0xe'));var authService=require(_0x23e7('0xf'));var qs=require(_0x23e7('0x10'));var as=require(_0x23e7('0x11'));var hardwareService=require(_0x23e7('0x12'));var logger=require(_0x23e7('0x13'))(_0x23e7('0x14'));var utils=require(_0x23e7('0x15'));var config=require(_0x23e7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x23e7('0x17'))['db'];function respondWithStatusCode(_0x5450d3,_0x486c85){_0x486c85=_0x486c85||0xcc;return function(_0x51e516){if(_0x51e516){return _0x5450d3['sendStatus'](_0x486c85);}return _0x5450d3['status'](_0x486c85)['end']();};}function respondWithResult(_0x38817c,_0x3d9f5b){_0x3d9f5b=_0x3d9f5b||0xc8;return function(_0x3308de){if(_0x3308de){return _0x38817c['status'](_0x3d9f5b)[_0x23e7('0x18')](_0x3308de);}};}function respondWithFilteredResult(_0x3c88d5,_0x1fd670){return function(_0x590540){if(_0x590540){var _0x421fc7=typeof _0x1fd670[_0x23e7('0x19')]===_0x23e7('0x1a')&&typeof _0x1fd670[_0x23e7('0x1b')]===_0x23e7('0x1a');var _0x3dd77d=_0x590540[_0x23e7('0x1c')];var _0x1f650d=_0x421fc7?0x0:_0x1fd670[_0x23e7('0x19')];var _0x483d61=_0x421fc7?_0x590540[_0x23e7('0x1c')]:_0x1fd670[_0x23e7('0x19')]+_0x1fd670[_0x23e7('0x1b')];var _0x89318c;if(_0x483d61>=_0x3dd77d){_0x483d61=_0x3dd77d;_0x89318c=0xc8;}else{_0x89318c=0xce;}_0x3c88d5[_0x23e7('0x1d')](_0x89318c);return _0x3c88d5[_0x23e7('0x1e')](_0x23e7('0x1f'),_0x1f650d+'-'+_0x483d61+'/'+_0x3dd77d)[_0x23e7('0x18')](_0x590540);}return null;};}function patchUpdates(_0x52945c){return function(_0x170b08){try{jsonpatch[_0x23e7('0x20')](_0x170b08,_0x52945c,!![]);}catch(_0x5816a1){return BPromise[_0x23e7('0x21')](_0x5816a1);}return _0x170b08['save']();};}function saveUpdates(_0x38cfea,_0x41dc62){return function(_0x4ab5d2){if(_0x4ab5d2){return _0x4ab5d2['update'](_0x38cfea)['then'](function(_0x43d2e3){return _0x43d2e3;});}return null;};}function removeEntity(_0x2e33a7,_0x5098be){return function(_0x3085ad){if(_0x3085ad){return _0x3085ad[_0x23e7('0x22')]()[_0x23e7('0x23')](function(){_0x2e33a7[_0x23e7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x615f32,_0x2df69a){return function(_0x484fd6){if(!_0x484fd6){_0x615f32['sendStatus'](0x194);}return _0x484fd6;};}function handleError(_0x26dfb6,_0x4daf95){_0x4daf95=_0x4daf95||0x1f4;return function(_0x5560c6){logger['error'](_0x5560c6[_0x23e7('0x24')]);if(_0x5560c6[_0x23e7('0x25')]){delete _0x5560c6[_0x23e7('0x25')];}_0x26dfb6[_0x23e7('0x1d')](_0x4daf95)[_0x23e7('0x26')](_0x5560c6);};}exports['index']=function(_0x3abdec,_0x499b3e){var _0x278f29={},_0x21f33b={},_0x11e2cd={'count':0x0,'rows':[]};var _0x327795=_[_0x23e7('0x27')](db['CmHopperHistory']['rawAttributes'],function(_0x494433){return{'name':_0x494433[_0x23e7('0x28')],'type':_0x494433['type'][_0x23e7('0x29')]};});_0x21f33b[_0x23e7('0x2a')]=_[_0x23e7('0x27')](_0x327795,_0x23e7('0x25'));_0x21f33b[_0x23e7('0x2b')]=_['keys'](_0x3abdec[_0x23e7('0x2b')]);_0x21f33b[_0x23e7('0x2c')]=_['intersection'](_0x21f33b[_0x23e7('0x2a')],_0x21f33b[_0x23e7('0x2b')]);_0x278f29[_0x23e7('0x2d')]=_['intersection'](_0x21f33b[_0x23e7('0x2a')],qs[_0x23e7('0x2e')](_0x3abdec['query'][_0x23e7('0x2e')]));_0x278f29[_0x23e7('0x2d')]=_0x278f29[_0x23e7('0x2d')]['length']?_0x278f29[_0x23e7('0x2d')]:_0x21f33b[_0x23e7('0x2a')];if(!_0x3abdec['query'][_0x23e7('0x2f')](_0x23e7('0x30'))){_0x278f29[_0x23e7('0x1b')]=qs['limit'](_0x3abdec['query'][_0x23e7('0x1b')]);_0x278f29['offset']=qs[_0x23e7('0x19')](_0x3abdec[_0x23e7('0x2b')][_0x23e7('0x19')]);}_0x278f29['order']=qs['sort'](_0x3abdec[_0x23e7('0x2b')][_0x23e7('0x31')]);_0x278f29[_0x23e7('0x32')]=qs[_0x23e7('0x2c')](_[_0x23e7('0x33')](_0x3abdec[_0x23e7('0x2b')],_0x21f33b[_0x23e7('0x2c')]),_0x327795);if(_0x3abdec[_0x23e7('0x2b')][_0x23e7('0x34')]){_0x278f29[_0x23e7('0x32')]=_['merge'](_0x278f29[_0x23e7('0x32')],{'$or':_[_0x23e7('0x27')](_0x327795,function(_0x53fa1b){if(_0x53fa1b[_0x23e7('0x35')]!==_0x23e7('0x36')){var _0x9a76f3={};_0x9a76f3[_0x53fa1b[_0x23e7('0x25')]]={'$like':'%'+_0x3abdec[_0x23e7('0x2b')][_0x23e7('0x34')]+'%'};return _0x9a76f3;}})});}_0x278f29=_[_0x23e7('0x37')]({},_0x278f29,_0x3abdec[_0x23e7('0x38')]);var _0x52f33a={'where':_0x278f29[_0x23e7('0x32')]};return db[_0x23e7('0x39')][_0x23e7('0x1c')](_0x52f33a)[_0x23e7('0x23')](function(_0x4dfb3e){_0x11e2cd['count']=_0x4dfb3e;if(_0x3abdec['query'][_0x23e7('0x3a')]){_0x278f29[_0x23e7('0x3b')]=[{'all':!![]}];}return db[_0x23e7('0x39')]['findAll'](_0x278f29);})[_0x23e7('0x23')](function(_0x18af91){_0x11e2cd[_0x23e7('0x3c')]=_0x18af91;return _0x11e2cd;})[_0x23e7('0x23')](respondWithFilteredResult(_0x499b3e,_0x278f29))['catch'](handleError(_0x499b3e,null));};exports[_0x23e7('0x3d')]=function(_0xf65493,_0x58cd77){var _0x195123={'raw':!![],'where':{'id':_0xf65493[_0x23e7('0x3e')]['id']}},_0x519c16={};_0x519c16[_0x23e7('0x2a')]=_[_0x23e7('0x3f')](db['CmHopperHistory'][_0x23e7('0x40')]);_0x519c16[_0x23e7('0x2b')]=_[_0x23e7('0x3f')](_0xf65493[_0x23e7('0x2b')]);_0x519c16[_0x23e7('0x2c')]=_['intersection'](_0x519c16[_0x23e7('0x2a')],_0x519c16[_0x23e7('0x2b')]);_0x195123[_0x23e7('0x2d')]=_[_0x23e7('0x41')](_0x519c16['model'],qs[_0x23e7('0x2e')](_0xf65493[_0x23e7('0x2b')][_0x23e7('0x2e')]));_0x195123[_0x23e7('0x2d')]=_0x195123[_0x23e7('0x2d')][_0x23e7('0x42')]?_0x195123['attributes']:_0x519c16[_0x23e7('0x2a')];if(_0xf65493[_0x23e7('0x2b')]['includeAll']){_0x195123[_0x23e7('0x3b')]=[{'all':!![]}];}_0x195123=_[_0x23e7('0x37')]({},_0x195123,_0xf65493['options']);return db['CmHopperHistory'][_0x23e7('0x43')](_0x195123)['then'](handleEntityNotFound(_0x58cd77,null))[_0x23e7('0x23')](respondWithResult(_0x58cd77,null))[_0x23e7('0x44')](handleError(_0x58cd77,null));};exports[_0x23e7('0x45')]=function(_0xdb7f52,_0x1ff9f7){return db[_0x23e7('0x39')]['create'](_0xdb7f52['body'],{})[_0x23e7('0x23')](respondWithResult(_0x1ff9f7,0xc9))[_0x23e7('0x44')](handleError(_0x1ff9f7,null));};exports[_0x23e7('0x46')]=function(_0x5b38f2,_0x2b563e){return db[_0x23e7('0x39')]['describe']()[_0x23e7('0x23')](respondWithResult(_0x2b563e,null))[_0x23e7('0x44')](handleError(_0x2b563e,null));};exports[_0x23e7('0x47')]=function(_0x338f81,_0x558864){if(_0x338f81[_0x23e7('0x48')][_0x23e7('0x49')]){delete _0x338f81[_0x23e7('0x48')][_0x23e7('0x49')];}return db[_0x23e7('0x39')][_0x23e7('0x43')]({'where':{'uniqueid':_0x338f81['params']['id']}})['then'](handleEntityNotFound(_0x558864,null))['then'](saveUpdates(_0x338f81[_0x23e7('0x48')],null))[_0x23e7('0x23')](respondWithResult(_0x558864,null))[_0x23e7('0x44')](handleError(_0x558864,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 191ccda..ec3e11e 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 _0x86dc=['api','moment','bluebird','request-promise','rimraf','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0xf1976a,_0x318e87){var _0x48db3c=function(_0x88fb33){while(--_0x88fb33){_0xf1976a['push'](_0xf1976a['shift']());}};_0x48db3c(++_0x318e87);}(_0x86dc,0x13e));var _0xc86d=function(_0x40d2b3,_0xbd06ff){_0x40d2b3=_0x40d2b3-0x0;var _0x35cf95=_0x86dc[_0x40d2b3];return _0x35cf95;};'use strict';var _=require(_0xc86d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc86d('0x1'));var moment=require(_0xc86d('0x2'));var BPromise=require(_0xc86d('0x3'));var rp=require(_0xc86d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc86d('0x5'));var config=require('../../config/environment');var attributes=require(_0xc86d('0x6'));module['exports']=function(_0x4fef24,_0x1383ad){return _0x4fef24[_0xc86d('0x7')]('CmHopperHistory',attributes,{'tableName':_0xc86d('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xc86d('0x9')]},{'name':_0xc86d('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6c0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger'];(function(_0x2e397f,_0x41b105){var _0x24ef43=function(_0x552194){while(--_0x552194){_0x2e397f['push'](_0x2e397f['shift']());}};_0x24ef43(++_0x41b105);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xc6c0[_0x3cc9d9];return _0x1a425d;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var logger=require(_0x0c6c('0x1'))(_0x0c6c('0x2'));var moment=require(_0x0c6c('0x3'));var BPromise=require(_0x0c6c('0x4'));var rp=require(_0x0c6c('0x5'));var fs=require('fs');var path=require(_0x0c6c('0x6'));var rimraf=require(_0x0c6c('0x7'));var config=require(_0x0c6c('0x8'));var attributes=require(_0x0c6c('0x9'));module[_0x0c6c('0xa')]=function(_0x493c56,_0x526739){return _0x493c56[_0x0c6c('0xb')](_0x0c6c('0xc'),attributes,{'tableName':_0x0c6c('0xd'),'paranoid':![],'indexes':[{'name':_0x0c6c('0xe'),'fields':[_0x0c6c('0xe')]},{'name':_0x0c6c('0xf'),'fields':[_0x0c6c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 1898cfe..25224e5 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 _0x870d=['`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','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','findAll','campaign','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','catch','AvgHandleTime','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x1e3c13,_0x533698){var _0x5f2497=function(_0x49da54){while(--_0x49da54){_0x1e3c13['push'](_0x1e3c13['shift']());}};_0x5f2497(++_0x533698);}(_0x870d,0x124));var _0xd870=function(_0x72f13e,_0x196b1b){_0x72f13e=_0x72f13e-0x0;var _0x14d610=_0x870d[_0x72f13e];return _0x14d610;};'use strict';var _=require(_0xd870('0x0'));var util=require(_0xd870('0x1'));var moment=require(_0xd870('0x2'));var BPromise=require(_0xd870('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd870('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd870('0x5'))('rpc');var config=require(_0xd870('0x6'));var jayson=require(_0xd870('0x7'));var client=jayson['client'][_0xd870('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x906978,_0x52f730,_0x5a0345){return new BPromise(function(_0x39a9c4,_0x3bbbd0){return client[_0xd870('0x9')](_0x906978,_0x5a0345)[_0xd870('0xa')](function(_0x75db89){logger[_0xd870('0xb')](_0xd870('0xc'),_0x52f730,'request\x20sent');logger[_0xd870('0xd')](_0xd870('0xe'),_0x52f730,_0xd870('0xf'),JSON[_0xd870('0x10')](_0x75db89));if(_0x75db89[_0xd870('0x11')]){if(_0x75db89[_0xd870('0x11')][_0xd870('0x12')]===0x1f4){logger[_0xd870('0x11')](_0xd870('0xc'),_0x52f730,_0x75db89[_0xd870('0x11')][_0xd870('0x13')]);return _0x3bbbd0(_0x75db89['error']['message']);}logger[_0xd870('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x52f730,_0x75db89['error'][_0xd870('0x13')]);return _0x39a9c4(_0x75db89[_0xd870('0x11')][_0xd870('0x13')]);}else{logger[_0xd870('0xb')](_0xd870('0xc'),_0x52f730,_0xd870('0xf'));_0x39a9c4(_0x75db89[_0xd870('0x14')]['message']);}})['catch'](function(_0x33529d){logger[_0xd870('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x52f730,_0x33529d);_0x3bbbd0(_0x33529d);});});}exports[_0xd870('0x15')]=function(_0x2b9d0b){var _0x275e36=this;return new Promise(function(_0x2e1af0,_0xd7e1a2){return db[_0xd870('0x16')][_0xd870('0x17')](_0x2b9d0b[_0xd870('0x18')],{'raw':_0x2b9d0b[_0xd870('0x19')]?_0x2b9d0b[_0xd870('0x19')][_0xd870('0x1a')]===undefined?!![]:![]:!![]})[_0xd870('0xa')](function(_0x373b83){logger['info'](_0xd870('0x15'),_0x2b9d0b);logger['debug'](_0xd870('0x15'),_0x2b9d0b,JSON[_0xd870('0x10')](_0x373b83));_0x2e1af0(_0x373b83);})[_0xd870('0x1b')](function(_0x3c9a54){logger[_0xd870('0x11')](_0xd870('0x15'),_0x3c9a54[_0xd870('0x13')],_0x2b9d0b);_0xd7e1a2(_0x275e36['error'](0x1f4,_0x3c9a54[_0xd870('0x13')]));});});};exports[_0xd870('0x1c')]=function(_0x503870){var _0xe8430c=this;return new Promise(function(_0x73ab23,_0x1bb29c){return db[_0xd870('0x16')]['findAll']({'raw':_0x503870['options']?_0x503870[_0xd870('0x19')][_0xd870('0x1a')]===undefined?!![]:![]:!![],'where':_0x503870[_0xd870('0x19')]?_0x503870['options'][_0xd870('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')][_0xd870('0x20')]('id')),_0xd870('0x21')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x23')))),_0xd870('0x24')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xd870('0x25')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x26')))),_0xd870('0x27')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x28'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0xd870('0x28'),db['sequelize']['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x29')))),_0xd870('0x2a')]]})[_0xd870('0xa')](function(_0x3dfd7e){logger[_0xd870('0xb')](_0xd870('0x1c'),_0x503870);logger[_0xd870('0xd')](_0xd870('0x1c'),_0x503870,JSON['stringify'](_0x3dfd7e));_0x73ab23(_0x3dfd7e);})[_0xd870('0x1b')](function(_0x338718){logger[_0xd870('0x11')](_0xd870('0x1c'),_0x338718[_0xd870('0x13')],_0x503870);_0x1bb29c(_0xe8430c[_0xd870('0x11')](0x1f4,_0x338718[_0xd870('0x13')]));});});};exports[_0xd870('0x2b')]=function(_0x44c994){var _0x92fcfb=this;return new Promise(function(_0x4b99ff,_0x237b56){return db[_0xd870('0x16')]['findAll']({'raw':_0x44c994[_0xd870('0x19')]?_0x44c994[_0xd870('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44c994[_0xd870('0x19')]?_0x44c994[_0xd870('0x19')][_0xd870('0x1d')]||null:null,'attributes':[['campaign',_0xd870('0x2c')],[db[_0xd870('0x1f')]['fn']('COUNT',db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')]['literal'](_0xd870('0x2d')))),_0xd870('0x2e')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')]['literal'](_0xd870('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0xd870('0x1f')]['fn']('COUNT',db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x23')))),'outboundAnswerCallsDay'],[db[_0xd870('0x1f')]['fn']('COUNT',db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x30')))),_0xd870('0x31')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db['sequelize'][_0xd870('0x22')](_0xd870('0x32')))),_0xd870('0x33')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x34')))),_0xd870('0x35')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x36')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0xd870('0x37')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0xd870('0x38')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x39')))),_0xd870('0x3a')],[db[_0xd870('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x3b')))),_0xd870('0x3c')],[db[_0xd870('0x1f')]['fn']('COUNT',db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x3d')))),_0xd870('0x3a')],[db[_0xd870('0x1f')]['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')]['fn']('IF',db[_0xd870('0x1f')][_0xd870('0x22')](_0xd870('0x3e')))),_0xd870('0x3f')]],'group':['campaign']})['then'](function(_0x1ea779){logger[_0xd870('0xb')](_0xd870('0x2b'),_0x44c994);logger['debug'](_0xd870('0x2b'),_0x44c994,JSON['stringify'](_0x1ea779));_0x4b99ff(_0x1ea779);})[_0xd870('0x1b')](function(_0x2c10b2){logger[_0xd870('0x11')]('GetVoiceQueueHopperHistory',_0x2c10b2[_0xd870('0x13')],_0x44c994);_0x237b56(_0x92fcfb[_0xd870('0x11')](0x1f4,_0x2c10b2['message']));});});};exports['GetCampaignHopperHistory']=function(_0x24b6f6){var _0x4c4dab=this;return new Promise(function(_0x18ac02,_0x5242cc){return db[_0xd870('0x16')][_0xd870('0x40')]({'raw':_0x24b6f6['options']?_0x24b6f6['options'][_0xd870('0x1a')]===undefined?!![]:![]:!![],'where':_0x24b6f6[_0xd870('0x19')]?_0x24b6f6['options'][_0xd870('0x1d')]||null:null,'attributes':[[_0xd870('0x41'),'name'],[db['sequelize']['fn'](_0xd870('0x1e'),db[_0xd870('0x1f')][_0xd870('0x20')]('id')),'ivrTotalCallsDays'],[db[_0xd870('0x1f')]['fn']('COUNT',db[_0xd870('0x1f')]['fn']('IF',db['sequelize'][_0xd870('0x22')](_0xd870('0x23')))),_0xd870('0x42')]],'group':[_0xd870('0x41')]})[_0xd870('0xa')](function(_0x185cbc){logger[_0xd870('0xb')](_0xd870('0x43'),_0x24b6f6);logger[_0xd870('0xd')]('GetCampaignHopperHistory',_0x24b6f6,JSON[_0xd870('0x10')](_0x185cbc));_0x18ac02(_0x185cbc);})[_0xd870('0x1b')](function(_0x7e172d){logger[_0xd870('0x11')](_0xd870('0x43'),_0x7e172d[_0xd870('0x13')],_0x24b6f6);_0x5242cc(_0x4c4dab['error'](0x1f4,_0x7e172d[_0xd870('0x13')]));});});}; \ No newline at end of file +var _0xa403=['predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','raw','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','stringify','where','sequelize','col'];(function(_0x5c7e21,_0x330300){var _0x53b81c=function(_0x973314){while(--_0x973314){_0x5c7e21['push'](_0x5c7e21['shift']());}};_0x53b81c(++_0x330300);}(_0xa403,0x1f2));var _0x3a40=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xa403[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require('lodash');var util=require(_0x3a40('0x0'));var moment=require(_0x3a40('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a40('0x2'));var fs=require('fs');var Redis=require(_0x3a40('0x3'));var db=require(_0x3a40('0x4'))['db'];var utils=require(_0x3a40('0x5'));var logger=require(_0x3a40('0x6'))(_0x3a40('0x7'));var config=require(_0x3a40('0x8'));var jayson=require(_0x3a40('0x9'));var client=jayson[_0x3a40('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a24ff,_0x5c0823,_0x42245f){return new BPromise(function(_0x58b46b,_0x3fcda8){return client['request'](_0x1a24ff,_0x42245f)[_0x3a40('0xb')](function(_0x2045b5){logger['info'](_0x3a40('0xc'),_0x5c0823,_0x3a40('0xd'));logger[_0x3a40('0xe')](_0x3a40('0xf'),_0x5c0823,_0x3a40('0xd'),JSON['stringify'](_0x2045b5));if(_0x2045b5[_0x3a40('0x10')]){if(_0x2045b5[_0x3a40('0x10')][_0x3a40('0x11')]===0x1f4){logger[_0x3a40('0x10')](_0x3a40('0xc'),_0x5c0823,_0x2045b5[_0x3a40('0x10')][_0x3a40('0x12')]);return _0x3fcda8(_0x2045b5['error'][_0x3a40('0x12')]);}logger[_0x3a40('0x10')](_0x3a40('0xc'),_0x5c0823,_0x2045b5['error'][_0x3a40('0x12')]);return _0x58b46b(_0x2045b5[_0x3a40('0x10')][_0x3a40('0x12')]);}else{logger[_0x3a40('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x5c0823,_0x3a40('0xd'));_0x58b46b(_0x2045b5[_0x3a40('0x14')][_0x3a40('0x12')]);}})[_0x3a40('0x15')](function(_0x20ac05){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x5c0823,_0x20ac05);_0x3fcda8(_0x20ac05);});});}exports[_0x3a40('0x16')]=function(_0x44b0fd){var _0x3032b1=this;return new Promise(function(_0x2da0dd,_0x54cc0f){return db[_0x3a40('0x17')][_0x3a40('0x18')](_0x44b0fd['body'],{'raw':_0x44b0fd[_0x3a40('0x19')]?_0x44b0fd['options']['raw']===undefined?!![]:![]:!![]})[_0x3a40('0xb')](function(_0x51f24b){logger['info'](_0x3a40('0x16'),_0x44b0fd);logger[_0x3a40('0xe')]('CreateCmHopperHistory',_0x44b0fd,JSON[_0x3a40('0x1a')](_0x51f24b));_0x2da0dd(_0x51f24b);})[_0x3a40('0x15')](function(_0x36af56){logger[_0x3a40('0x10')](_0x3a40('0x16'),_0x36af56['message'],_0x44b0fd);_0x54cc0f(_0x3032b1[_0x3a40('0x10')](0x1f4,_0x36af56[_0x3a40('0x12')]));});});};exports['AvgHandleTime']=function(_0x2d8f3f){var _0x484bcf=this;return new Promise(function(_0x4b6496,_0xf9ba4d){return db[_0x3a40('0x17')]['findAll']({'raw':_0x2d8f3f[_0x3a40('0x19')]?_0x2d8f3f['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d8f3f[_0x3a40('0x19')]?_0x2d8f3f[_0x3a40('0x19')][_0x3a40('0x1b')]||null:null,'attributes':[[db[_0x3a40('0x1c')]['fn']('COUNT',db['sequelize'][_0x3a40('0x1d')]('id')),_0x3a40('0x1e')],[db[_0x3a40('0x1c')]['fn']('COUNT',db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x22')))),_0x3a40('0x23')],[db['sequelize']['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x24')))),_0x3a40('0x25')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x26'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x27')))),'predictiveIntervalAvgTalktime']]})[_0x3a40('0xb')](function(_0x4fe107){logger[_0x3a40('0x13')](_0x3a40('0x28'),_0x2d8f3f);logger[_0x3a40('0xe')](_0x3a40('0x28'),_0x2d8f3f,JSON[_0x3a40('0x1a')](_0x4fe107));_0x4b6496(_0x4fe107);})[_0x3a40('0x15')](function(_0xe1f54e){logger[_0x3a40('0x10')]('AvgHandleTime',_0xe1f54e['message'],_0x2d8f3f);_0xf9ba4d(_0x484bcf[_0x3a40('0x10')](0x1f4,_0xe1f54e['message']));});});};exports[_0x3a40('0x29')]=function(_0x1826b5){var _0x3d7b1a=this;return new Promise(function(_0x81527c,_0x1710b4){return db['CmHopperHistory'][_0x3a40('0x2a')]({'raw':_0x1826b5[_0x3a40('0x19')]?_0x1826b5['options'][_0x3a40('0x2b')]===undefined?!![]:![]:!![],'where':_0x1826b5[_0x3a40('0x19')]?_0x1826b5[_0x3a40('0x19')][_0x3a40('0x1b')]||null:null,'attributes':[['campaign',_0x3a40('0x2c')],[db['sequelize']['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x2d')))),_0x3a40('0x2e')],[db[_0x3a40('0x1c')]['fn']('COUNT',db[_0x3a40('0x1c')]['fn']('IF',db['sequelize'][_0x3a40('0x1f')]('`state`\x20=\x203,\x201,\x20null'))),_0x3a40('0x2f')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x3a40('0x30')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db['sequelize']['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x31')))),_0x3a40('0x32')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x33')))),'outboundCongestionCallsDay'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')]['literal'](_0x3a40('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x35')))),_0x3a40('0x36')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x3a40('0x1f')](_0x3a40('0x37')))),_0x3a40('0x38')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db['sequelize'][_0x3a40('0x1f')](_0x3a40('0x39')))),_0x3a40('0x3a')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db['sequelize'][_0x3a40('0x1f')](_0x3a40('0x3b')))),_0x3a40('0x3c')],[db['sequelize']['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x3d')))),_0x3a40('0x3c')],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x3e')))),'outboundReCallsDay']],'group':[_0x3a40('0x3f')]})[_0x3a40('0xb')](function(_0x51e812){logger[_0x3a40('0x13')](_0x3a40('0x29'),_0x1826b5);logger[_0x3a40('0xe')](_0x3a40('0x29'),_0x1826b5,JSON[_0x3a40('0x1a')](_0x51e812));_0x81527c(_0x51e812);})[_0x3a40('0x15')](function(_0x55649a){logger[_0x3a40('0x10')](_0x3a40('0x29'),_0x55649a[_0x3a40('0x12')],_0x1826b5);_0x1710b4(_0x3d7b1a[_0x3a40('0x10')](0x1f4,_0x55649a[_0x3a40('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x1fb129){var _0x2c8555=this;return new Promise(function(_0x5b2cf7,_0x14f87a){return db[_0x3a40('0x17')][_0x3a40('0x2a')]({'raw':_0x1fb129[_0x3a40('0x19')]?_0x1fb129[_0x3a40('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1fb129['options']?_0x1fb129['options']['where']||null:null,'attributes':[[_0x3a40('0x3f'),'name'],[db[_0x3a40('0x1c')]['fn'](_0x3a40('0x21'),db['sequelize'][_0x3a40('0x1d')]('id')),_0x3a40('0x40')],[db['sequelize']['fn'](_0x3a40('0x21'),db[_0x3a40('0x1c')]['fn']('IF',db[_0x3a40('0x1c')][_0x3a40('0x1f')](_0x3a40('0x20')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x3a40('0xb')](function(_0x5be91a){logger[_0x3a40('0x13')]('GetCampaignHopperHistory',_0x1fb129);logger[_0x3a40('0xe')](_0x3a40('0x41'),_0x1fb129,JSON[_0x3a40('0x1a')](_0x5be91a));_0x5b2cf7(_0x5be91a);})[_0x3a40('0x15')](function(_0x548a7b){logger['error'](_0x3a40('0x41'),_0x548a7b[_0x3a40('0x12')],_0x1fb129);_0x14f87a(_0x2c8555[_0x3a40('0x10')](0x1f4,_0x548a7b[_0x3a40('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3f9f665..0b40a24 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 _0x8a18=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2ae6ee,_0x16805a){var _0x17653b=function(_0x299fc8){while(--_0x299fc8){_0x2ae6ee['push'](_0x2ae6ee['shift']());}};_0x17653b(++_0x16805a);}(_0x8a18,0x118));var _0x88a1=function(_0xe38f7d,_0x5f42b9){_0xe38f7d=_0xe38f7d-0x0;var _0x4dee03=_0x8a18[_0xe38f7d];return _0x4dee03;};'use strict';var multer=require(_0x88a1('0x0'));var util=require(_0x88a1('0x1'));var path=require(_0x88a1('0x2'));var timeout=require(_0x88a1('0x3'));var express=require(_0x88a1('0x4'));var router=express[_0x88a1('0x5')]();var fs_extra=require(_0x88a1('0x6'));var auth=require(_0x88a1('0x7'));var interaction=require(_0x88a1('0x8'));var config=require(_0x88a1('0x9'));var controller=require(_0x88a1('0xa'));router['get']('/',auth[_0x88a1('0xb')](),controller[_0x88a1('0xc')]);router['get'](_0x88a1('0xd'),auth['isAuthenticated'](),controller[_0x88a1('0xe')]);router[_0x88a1('0xf')](_0x88a1('0x10'),auth[_0x88a1('0xb')](),controller[_0x88a1('0x11')]);router[_0x88a1('0x12')]('/',auth[_0x88a1('0xb')](),controller[_0x88a1('0x13')]);router['put']('/:id',auth[_0x88a1('0xb')](),controller[_0x88a1('0x14')]);module[_0x88a1('0x15')]=router; \ No newline at end of file +var _0x27cc=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show','create','put','update','exports','multer','util'];(function(_0x15edff,_0x2f7ea5){var _0x2ed0ed=function(_0x325016){while(--_0x325016){_0x15edff['push'](_0x15edff['shift']());}};_0x2ed0ed(++_0x2f7ea5);}(_0x27cc,0xd6));var _0xc27c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x27cc[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xc27c('0x0'));var util=require(_0xc27c('0x1'));var path=require(_0xc27c('0x2'));var timeout=require(_0xc27c('0x3'));var express=require(_0xc27c('0x4'));var router=express[_0xc27c('0x5')]();var fs_extra=require(_0xc27c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc27c('0x7'));var config=require('../../config/environment');var controller=require(_0xc27c('0x8'));router[_0xc27c('0x9')]('/',auth[_0xc27c('0xa')](),controller['index']);router[_0xc27c('0x9')](_0xc27c('0xb'),auth[_0xc27c('0xa')](),controller[_0xc27c('0xc')]);router[_0xc27c('0x9')]('/:id',auth[_0xc27c('0xa')](),controller[_0xc27c('0xd')]);router['post']('/',auth[_0xc27c('0xa')](),controller[_0xc27c('0xe')]);router[_0xc27c('0xf')]('/:id',auth[_0xc27c('0xa')](),controller[_0xc27c('0x10')]);module[_0xc27c('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 e895356..c85a14c 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 _0x24cd=['exports','name','STRING','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x24cd,0x83));var _0xd24c=function(_0x3c9ee7,_0x5ea39c){_0x3c9ee7=_0x3c9ee7-0x0;var _0x2bde5c=_0x24cd[_0x3c9ee7];return _0x2bde5c;};'use strict';var Sequelize=require(_0xd24c('0x0'));module[_0xd24c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd24c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xd24c('0x3')]}}; \ No newline at end of file +var _0xc7e9=['exports','name','STRING','sequelize'];(function(_0x27a66d,_0x45bdce){var _0x2f4fa0=function(_0x4b7ef7){while(--_0x4b7ef7){_0x27a66d['push'](_0x27a66d['shift']());}};_0x2f4fa0(++_0x45bdce);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xc7e9[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0x9c7e('0x0'));module[_0x9c7e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c7e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c7e('0x3')]},'dialPrefix':{'type':Sequelize[_0x9c7e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ea07c92..0f4f1cb 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 _0x8a4b=['VIRTUAL','filter','CmList','includeAll','include','rows','catch','show','params','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','pick','findAll','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','alias','item','ItemTypeId\x20=\x20?','additionalPhone_','description','cm_contact_has_items','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','Lists','UserProfileResource','sendStatus','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','offset','order','sort','where','merge'];(function(_0x6ab3ca,_0x45b406){var _0x5e5eb3=function(_0x4fa309){while(--_0x4fa309){_0x6ab3ca['push'](_0x6ab3ca['shift']());}};_0x5e5eb3(++_0x45b406);}(_0x8a4b,0x1b4));var _0xb8a4=function(_0x45a4e0,_0x345f4d){_0x45a4e0=_0x45a4e0-0x0;var _0x43f49d=_0x8a4b[_0x45a4e0];return _0x43f49d;};'use strict';var emlformat=require(_0xb8a4('0x0'));var rimraf=require(_0xb8a4('0x1'));var zipdir=require(_0xb8a4('0x2'));var jsonpatch=require(_0xb8a4('0x3'));var rp=require('request-promise');var moment=require(_0xb8a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb8a4('0x5'));var util=require(_0xb8a4('0x6'));var path=require(_0xb8a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8a4('0x8'));var _=require('lodash');var squel=require(_0xb8a4('0x9'));var crypto=require(_0xb8a4('0xa'));var jsforce=require(_0xb8a4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb8a4('0xc'));var querystring=require(_0xb8a4('0xd'));var Papa=require(_0xb8a4('0xe'));var Redis=require(_0xb8a4('0xf'));var authService=require(_0xb8a4('0x10'));var qs=require(_0xb8a4('0x11'));var as=require(_0xb8a4('0x12'));var hardwareService=require(_0xb8a4('0x13'));var logger=require(_0xb8a4('0x14'))(_0xb8a4('0x15'));var utils=require(_0xb8a4('0x16'));var config=require(_0xb8a4('0x17'));var licenseUtil=require(_0xb8a4('0x18'));var db=require(_0xb8a4('0x19'))['db'];var csv_results;config[_0xb8a4('0x1a')]=_['defaults'](config[_0xb8a4('0x1a')],{'host':_0xb8a4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb8a4('0x1c'))[_0xb8a4('0x1d')](socket);function respondWithStatusCode(_0x39d881,_0x463fa4){_0x463fa4=_0x463fa4||0xcc;return function(_0x1f0d1c){if(_0x1f0d1c){return _0x39d881['sendStatus'](_0x463fa4);}return _0x39d881[_0xb8a4('0x1e')](_0x463fa4)[_0xb8a4('0x1f')]();};}function respondWithResult(_0x46d9da,_0x4767c2){_0x4767c2=_0x4767c2||0xc8;return function(_0xaa1445){if(_0xaa1445){return _0x46d9da['status'](_0x4767c2)[_0xb8a4('0x20')](_0xaa1445);}};}function respondWithFilteredResult(_0x156516,_0x309a2b){return function(_0x32c542){if(_0x32c542){var _0x19973e=typeof _0x309a2b['offset']===_0xb8a4('0x21')&&typeof _0x309a2b[_0xb8a4('0x22')]===_0xb8a4('0x21');var _0x4c972f=_0x32c542[_0xb8a4('0x23')];var _0x1bc4a9=_0x19973e?0x0:_0x309a2b['offset'];var _0x219e2b=_0x19973e?_0x32c542[_0xb8a4('0x23')]:_0x309a2b['offset']+_0x309a2b['limit'];var _0x41aa10;if(_0x219e2b>=_0x4c972f){_0x219e2b=_0x4c972f;_0x41aa10=0xc8;}else{_0x41aa10=0xce;}_0x156516[_0xb8a4('0x1e')](_0x41aa10);return _0x156516[_0xb8a4('0x24')](_0xb8a4('0x25'),_0x1bc4a9+'-'+_0x219e2b+'/'+_0x4c972f)[_0xb8a4('0x20')](_0x32c542);}return null;};}function patchUpdates(_0x1222d7){return function(_0x112e38){try{jsonpatch[_0xb8a4('0x26')](_0x112e38,_0x1222d7,!![]);}catch(_0x4457db){return BPromise[_0xb8a4('0x27')](_0x4457db);}return _0x112e38[_0xb8a4('0x28')]();};}function saveUpdates(_0x678525,_0x5ef1a4){return function(_0x55af08){if(_0x55af08){return _0x55af08[_0xb8a4('0x29')](_0x678525)['then'](function(_0x30e10f){return _0x30e10f;});}return null;};}function removeEntity(_0x54702e,_0x3dba9b){return function(_0x3638ba){if(_0x3638ba){return _0x3638ba['destroy']()[_0xb8a4('0x2a')](function(){var _0xdfe08c=_0x3638ba['get']({'plain':!![]});var _0x46c921=_0xb8a4('0x2b');return db[_0xb8a4('0x2c')]['destroy']({'where':{'type':_0x46c921,'resourceId':_0xdfe08c['id']}})[_0xb8a4('0x2a')](function(){return _0x3638ba;});})[_0xb8a4('0x2a')](function(){_0x54702e[_0xb8a4('0x1e')](0xcc)[_0xb8a4('0x1f')]();});}};}function handleEntityNotFound(_0x30c7db,_0x3e131b){return function(_0x3bf776){if(!_0x3bf776){_0x30c7db[_0xb8a4('0x2d')](0x194);}return _0x3bf776;};}function handleError(_0x41833e,_0x3248fd){_0x3248fd=_0x3248fd||0x1f4;return function(_0x4f4e52){logger[_0xb8a4('0x2e')](_0x4f4e52[_0xb8a4('0x2f')]);if(_0x4f4e52[_0xb8a4('0x30')]){delete _0x4f4e52[_0xb8a4('0x30')];}_0x41833e['status'](_0x3248fd)[_0xb8a4('0x31')](_0x4f4e52);};}exports['index']=function(_0x36a711,_0x327e59){var _0x45b33b={},_0x4c771c={},_0x35e7c9={'count':0x0,'rows':[]};var _0x2563c4=_[_0xb8a4('0x32')](db['CmList'][_0xb8a4('0x33')],function(_0x15affa){return{'name':_0x15affa['fieldName'],'type':_0x15affa[_0xb8a4('0x34')][_0xb8a4('0x35')]};});_0x4c771c['model']=_['map'](_0x2563c4,'name');_0x4c771c[_0xb8a4('0x36')]=_[_0xb8a4('0x37')](_0x36a711[_0xb8a4('0x36')]);_0x4c771c[_0xb8a4('0x38')]=_['intersection'](_0x4c771c['model'],_0x4c771c['query']);_0x45b33b[_0xb8a4('0x39')]=_[_0xb8a4('0x3a')](_0x4c771c[_0xb8a4('0x3b')],qs['fields'](_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x3c')]));_0x45b33b[_0xb8a4('0x39')]=_0x45b33b[_0xb8a4('0x39')][_0xb8a4('0x3d')]?_0x45b33b[_0xb8a4('0x39')]:_0x4c771c[_0xb8a4('0x3b')];if(!_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x3e')]('nolimit')){_0x45b33b[_0xb8a4('0x22')]=qs[_0xb8a4('0x22')](_0x36a711['query'][_0xb8a4('0x22')]);_0x45b33b[_0xb8a4('0x3f')]=qs[_0xb8a4('0x3f')](_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x3f')]);}_0x45b33b[_0xb8a4('0x40')]=qs[_0xb8a4('0x41')](_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x41')]);_0x45b33b[_0xb8a4('0x42')]=qs['filters'](_['pick'](_0x36a711[_0xb8a4('0x36')],_0x4c771c[_0xb8a4('0x38')]),_0x2563c4);if(_0x36a711['query']['filter']){_0x45b33b[_0xb8a4('0x42')]=_[_0xb8a4('0x43')](_0x45b33b[_0xb8a4('0x42')],{'$or':_['map'](_0x2563c4,function(_0x1d0849){if(_0x1d0849['type']!==_0xb8a4('0x44')){var _0x1f3193={};_0x1f3193[_0x1d0849[_0xb8a4('0x30')]]={'$like':'%'+_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x45')]+'%'};return _0x1f3193;}})});}_0x45b33b=_['merge']({},_0x45b33b,_0x36a711['options']);var _0x465038={'where':_0x45b33b['where']};return db[_0xb8a4('0x46')]['count'](_0x465038)[_0xb8a4('0x2a')](function(_0x2d3eba){_0x35e7c9[_0xb8a4('0x23')]=_0x2d3eba;if(_0x36a711[_0xb8a4('0x36')][_0xb8a4('0x47')]){_0x45b33b[_0xb8a4('0x48')]=[{'all':!![]}];}return db[_0xb8a4('0x46')]['findAll'](_0x45b33b);})[_0xb8a4('0x2a')](function(_0x3fd80b){_0x35e7c9[_0xb8a4('0x49')]=_0x3fd80b;return _0x35e7c9;})[_0xb8a4('0x2a')](respondWithFilteredResult(_0x327e59,_0x45b33b))[_0xb8a4('0x4a')](handleError(_0x327e59,null));};exports[_0xb8a4('0x4b')]=function(_0x328d5d,_0x1b5922){var _0x1b2ae1={'raw':![],'where':{'id':_0x328d5d[_0xb8a4('0x4c')]['id']}},_0x55c607={};_0x55c607[_0xb8a4('0x3b')]=_[_0xb8a4('0x37')](db[_0xb8a4('0x46')]['rawAttributes']);_0x55c607[_0xb8a4('0x36')]=_['keys'](_0x328d5d[_0xb8a4('0x36')]);_0x55c607[_0xb8a4('0x38')]=_[_0xb8a4('0x3a')](_0x55c607[_0xb8a4('0x3b')],_0x55c607[_0xb8a4('0x36')]);_0x1b2ae1[_0xb8a4('0x39')]=_[_0xb8a4('0x3a')](_0x55c607['model'],qs['fields'](_0x328d5d[_0xb8a4('0x36')]['fields']));_0x1b2ae1[_0xb8a4('0x39')]=_0x1b2ae1[_0xb8a4('0x39')]['length']?_0x1b2ae1[_0xb8a4('0x39')]:_0x55c607[_0xb8a4('0x3b')];if(_0x328d5d[_0xb8a4('0x36')][_0xb8a4('0x47')]){_0x1b2ae1['include']=[{'all':!![]}];}_0x1b2ae1=_[_0xb8a4('0x43')]({},_0x1b2ae1,_0x328d5d[_0xb8a4('0x4d')]);return db[_0xb8a4('0x46')][_0xb8a4('0x4e')](_0x1b2ae1)[_0xb8a4('0x2a')](handleEntityNotFound(_0x1b5922,null))[_0xb8a4('0x2a')](respondWithResult(_0x1b5922,null))[_0xb8a4('0x4a')](handleError(_0x1b5922,null));};exports[_0xb8a4('0x4f')]=function(_0x41d7ff,_0x4cf392){return db[_0xb8a4('0x46')][_0xb8a4('0x4f')](_0x41d7ff[_0xb8a4('0x50')],{})[_0xb8a4('0x2a')](function(_0x10adc0){var _0x28b1a9=_0x41d7ff[_0xb8a4('0x51')]['get']({'plain':!![]});if(!_0x28b1a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28b1a9[_0xb8a4('0x52')]==='user'){var _0x4c1476=_0x10adc0['get']({'plain':!![]});var _0x2f6235=_0xb8a4('0x2b');return db['UserProfileSection'][_0xb8a4('0x4e')]({'where':{'name':_0x2f6235,'userProfileId':_0x28b1a9[_0xb8a4('0x53')]},'raw':!![]})['then'](function(_0x54a708){if(_0x54a708&&_0x54a708[_0xb8a4('0x54')]===0x0){return db[_0xb8a4('0x2c')]['create']({'name':_0x4c1476['name'],'resourceId':_0x4c1476['id'],'type':_0x54a708[_0xb8a4('0x30')],'sectionId':_0x54a708['id']},{})[_0xb8a4('0x2a')](function(){return _0x10adc0;});}else{return _0x10adc0;}})[_0xb8a4('0x4a')](function(_0x2af6e0){logger[_0xb8a4('0x2e')](_0xb8a4('0x55'),_0x2af6e0);throw _0x2af6e0;});}return _0x10adc0;})[_0xb8a4('0x2a')](respondWithResult(_0x4cf392,0xc9))[_0xb8a4('0x4a')](handleError(_0x4cf392,null));};exports[_0xb8a4('0x29')]=function(_0x1b4fb0,_0x215cc7){if(_0x1b4fb0[_0xb8a4('0x50')]['id']){delete _0x1b4fb0['body']['id'];}return db[_0xb8a4('0x46')]['find']({'where':{'id':_0x1b4fb0[_0xb8a4('0x4c')]['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x215cc7,null))[_0xb8a4('0x2a')](saveUpdates(_0x1b4fb0[_0xb8a4('0x50')],null))['then'](respondWithResult(_0x215cc7,null))['catch'](handleError(_0x215cc7,null));};exports[_0xb8a4('0x56')]=function(_0x5a93c5,_0x46115a){return db[_0xb8a4('0x46')][_0xb8a4('0x4e')]({'where':{'id':_0x5a93c5['params']['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x46115a,null))[_0xb8a4('0x2a')](removeEntity(_0x46115a,null))['catch'](handleError(_0x46115a,null));};exports[_0xb8a4('0x57')]=function(_0x5625fd,_0x11dd29){return db[_0xb8a4('0x46')]['describe']()[_0xb8a4('0x2a')](respondWithResult(_0x11dd29,null))[_0xb8a4('0x4a')](handleError(_0x11dd29,null));};exports[_0xb8a4('0x58')]=function(_0x2d39eb,_0x60e5e3,_0x944312){if(_0x2d39eb[_0xb8a4('0x50')]['id']){delete _0x2d39eb[_0xb8a4('0x50')]['id'];}return db[_0xb8a4('0x46')][_0xb8a4('0x4e')]({'where':{'id':_0x2d39eb[_0xb8a4('0x4c')]['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x60e5e3,null))[_0xb8a4('0x2a')](function(_0x5c99e6){if(_0x5c99e6){_0x2d39eb[_0xb8a4('0x50')][_0xb8a4('0x59')]=_0x5c99e6['id'];return db[_0xb8a4('0x5a')][_0xb8a4('0x4f')](_0x2d39eb[_0xb8a4('0x50')]);}})[_0xb8a4('0x2a')](respondWithResult(_0x60e5e3,null))[_0xb8a4('0x4a')](handleError(_0x60e5e3,null));};exports[_0xb8a4('0x5b')]=function(_0x25c88c,_0x7237eb,_0x4e0f50){var _0x4b1c19={'raw':![],'where':{}};var _0x25f59e={};var _0x112459={'count':0x0,'rows':[]};return db['CmList'][_0xb8a4('0x5c')]({'where':{'id':_0x25c88c[_0xb8a4('0x4c')]['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x7237eb,null))[_0xb8a4('0x2a')](function(_0x4ea3e2){if(_0x4ea3e2){_0x25f59e['model']=_[_0xb8a4('0x37')](db[_0xb8a4('0x5a')]['rawAttributes']);_0x25f59e['query']=_[_0xb8a4('0x37')](_0x25c88c[_0xb8a4('0x36')]);_0x25f59e[_0xb8a4('0x38')]=_[_0xb8a4('0x3a')](_0x25f59e[_0xb8a4('0x3b')],_0x25f59e[_0xb8a4('0x36')]);_0x4b1c19['attributes']=_[_0xb8a4('0x3a')](_0x25f59e[_0xb8a4('0x3b')],qs[_0xb8a4('0x3c')](_0x25c88c['query'][_0xb8a4('0x3c')]));_0x4b1c19[_0xb8a4('0x39')]=_0x4b1c19[_0xb8a4('0x39')][_0xb8a4('0x3d')]?_0x4b1c19[_0xb8a4('0x39')]:_0x25f59e['model'];if(!_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x3e')](_0xb8a4('0x5d'))){_0x4b1c19['limit']=qs[_0xb8a4('0x22')](_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x22')]);_0x4b1c19[_0xb8a4('0x3f')]=qs[_0xb8a4('0x3f')](_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x3f')]);}_0x4b1c19[_0xb8a4('0x40')]=qs['sort'](_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x41')]);_0x4b1c19['where']=qs[_0xb8a4('0x38')](_[_0xb8a4('0x5e')](_0x25c88c[_0xb8a4('0x36')],_0x25f59e[_0xb8a4('0x38')]));_0x4b1c19[_0xb8a4('0x42')]['ListId']=_0x4ea3e2['id'];if(_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x45')]){_0x4b1c19[_0xb8a4('0x42')]=_[_0xb8a4('0x43')](_0x4b1c19[_0xb8a4('0x42')],{'$or':_[_0xb8a4('0x32')](_0x4b1c19[_0xb8a4('0x39')],function(_0x1a308c){var _0x43f07c={};_0x43f07c[_0x1a308c]={'$like':'%'+_0x25c88c['query'][_0xb8a4('0x45')]+'%'};return _0x43f07c;})});}_0x4b1c19=_[_0xb8a4('0x43')]({},_0x4b1c19,_0x25c88c[_0xb8a4('0x4d')]);return db['Disposition'][_0xb8a4('0x23')]({'where':_0x4b1c19[_0xb8a4('0x42')]})[_0xb8a4('0x2a')](function(_0x2363fa){_0x112459[_0xb8a4('0x23')]=_0x2363fa;if(_0x25c88c[_0xb8a4('0x36')][_0xb8a4('0x47')]){_0x4b1c19['include']=[{'all':!![]}];}return db['Disposition'][_0xb8a4('0x5f')](_0x4b1c19);})['then'](function(_0xcb489){_0x112459[_0xb8a4('0x49')]=_0xcb489;return _0x112459;});}})[_0xb8a4('0x2a')](respondWithFilteredResult(_0x7237eb,_0x4b1c19))['catch'](handleError(_0x7237eb,null));};exports[_0xb8a4('0x60')]=function(_0x4c3b05,_0x485c22,_0x5c6574){return db['CmList'][_0xb8a4('0x4e')]({'where':{'id':_0x4c3b05[_0xb8a4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x485c22,null))[_0xb8a4('0x2a')](function(_0x27dfd8){if(_0x27dfd8){return _0x27dfd8[_0xb8a4('0x60')](_0x4c3b05[_0xb8a4('0x36')][_0xb8a4('0x61')]);}})['then'](respondWithStatusCode(_0x485c22,null))[_0xb8a4('0x4a')](handleError(_0x485c22,null));};exports[_0xb8a4('0x62')]=function(_0x1cfa38,_0x1f0db7,_0x3554ca){return db[_0xb8a4('0x46')]['find']({'where':{'id':_0x1cfa38['params']['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x1f0db7,null))[_0xb8a4('0x2a')](function(_0x3c7d41){if(_0x3c7d41){var _0x821a2c=[];var _0x4ed122={'success':[],'errors':[]};return db[_0xb8a4('0x63')][_0xb8a4('0x57')]()['then'](function(_0x35d996){if(_0x1cfa38[_0xb8a4('0x50')]['tags']&&_[_0xb8a4('0x64')](_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x65')])){if(_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x65')][_0xb8a4('0x3d')]){_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x65')]=_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x65')]['join'](';')+';';}else{_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x65')]=null;}}else{_0x1cfa38[_0xb8a4('0x50')]['tags']=null;}if(_0x1cfa38['body']&&_[_0xb8a4('0x64')](_0x1cfa38[_0xb8a4('0x50')])){for(var _0x430842=0x0;_0x430842<_0x1cfa38[_0xb8a4('0x50')][_0xb8a4('0x3d')];_0x430842+=0x1){_0x1cfa38['body'][_0x430842]['ListId']=_0x1cfa38[_0xb8a4('0x4c')]['id'];_0x821a2c[_0xb8a4('0x66')](_0x1cfa38[_0xb8a4('0x50')][_0x430842]);}return BPromise[_0xb8a4('0x67')](_0x821a2c,function(_0x5e0233){return db[_0xb8a4('0x63')][_0xb8a4('0x4f')](_[_0xb8a4('0x68')](_0x5e0233,['ids','id'])||{},{'fields':_['keys'](_0x35d996),'raw':!![]})[_0xb8a4('0x2a')](function(_0xffdb82){_0x4ed122[_0xb8a4('0x69')][_0xb8a4('0x66')](_0xffdb82[_0xb8a4('0x6a')]);})[_0xb8a4('0x4a')](function(_0x4042d2){_0x4ed122[_0xb8a4('0x6b')][_0xb8a4('0x66')]({'data':_0x5e0233,'error':_0x4042d2[_0xb8a4('0x6c')]});});})['then'](function(_0x23b055){return _0x4ed122;})[_0xb8a4('0x4a')](function(_0x773a9f){return _0x773a9f;});}else{_0x1f0db7[_0xb8a4('0x1e')](0x190)[_0xb8a4('0x20')]({'message':_0xb8a4('0x6d')});}});}})['then'](respondWithResult(_0x1f0db7,null))[_0xb8a4('0x4a')](handleError(_0x1f0db7,null));};exports[_0xb8a4('0x6e')]=function(_0x57f9d7,_0x38cb53,_0x4bbdff){var _0x5c4c6a;return db[_0xb8a4('0x46')][_0xb8a4('0x4e')]({'where':{'id':_0x57f9d7[_0xb8a4('0x4c')]['id']},'include':[{'model':db[_0xb8a4('0x6f')],'as':_0xb8a4('0x70')}]})[_0xb8a4('0x2a')](handleEntityNotFound(_0x38cb53,null))[_0xb8a4('0x2a')](function(_0x32d7c9){if(_0x32d7c9){_0x5c4c6a=_0x32d7c9;return db[_0xb8a4('0x63')][_0xb8a4('0x33')];}})[_0xb8a4('0x2a')](function(_0x2cc812){if(_0x2cc812){var _0x4237bb={};var _0x81b90a={};_0x81b90a[_0xb8a4('0x3b')]=_[_0xb8a4('0x71')](_['keys'](_0x2cc812),_['map'](_0x5c4c6a[_0xb8a4('0x70')],function(_0x891206){return util[_0xb8a4('0x72')](_0xb8a4('0x73'),_0x891206['id']);}));_0x81b90a[_0xb8a4('0x36')]=_[_0xb8a4('0x37')](_0x57f9d7['query']);_0x81b90a[_0xb8a4('0x38')]=_[_0xb8a4('0x3a')](_0x81b90a[_0xb8a4('0x3b')],_0x81b90a[_0xb8a4('0x36')]);_0x4237bb[_0xb8a4('0x39')]=_[_0xb8a4('0x3a')](_0x81b90a[_0xb8a4('0x3b')],qs['fields'](_0x57f9d7[_0xb8a4('0x36')]['fields']));_0x4237bb[_0xb8a4('0x39')]=_0x4237bb[_0xb8a4('0x39')][_0xb8a4('0x3d')]?_0x4237bb[_0xb8a4('0x39')]:_0x81b90a[_0xb8a4('0x3b')];if(!_0x57f9d7[_0xb8a4('0x36')][_0xb8a4('0x3e')](_0xb8a4('0x5d'))){_0x4237bb[_0xb8a4('0x22')]=qs['limit'](_0x57f9d7[_0xb8a4('0x36')]['limit']);_0x4237bb[_0xb8a4('0x3f')]=qs[_0xb8a4('0x3f')](_0x57f9d7[_0xb8a4('0x36')][_0xb8a4('0x3f')]);}_0x4237bb['order']=qs[_0xb8a4('0x41')](_0x57f9d7['query'][_0xb8a4('0x41')]);_0x4237bb['where']=qs['filters'](_[_0xb8a4('0x5e')](_0x57f9d7[_0xb8a4('0x36')],_0x81b90a[_0xb8a4('0x38')]));_0x4237bb[_0xb8a4('0x74')]=!![];if(_0x57f9d7[_0xb8a4('0x36')]['filter']){_0x4237bb[_0xb8a4('0x42')]=_[_0xb8a4('0x43')](_0x4237bb['where'],{'$or':_[_0xb8a4('0x32')](_0x4237bb[_0xb8a4('0x39')],function(_0x536c87){var _0x2d30fb={};_0x2d30fb[_0x536c87]={'$like':'%'+_0x57f9d7[_0xb8a4('0x36')][_0xb8a4('0x45')]+'%'};return _0x2d30fb;})});}_0x4237bb=_[_0xb8a4('0x43')]({},_0x4237bb,_0x57f9d7[_0xb8a4('0x4d')]);return _0x5c4c6a[_0xb8a4('0x6e')](_0x4237bb);}})[_0xb8a4('0x2a')](respondWithResult(_0x38cb53,null))[_0xb8a4('0x4a')](handleError(_0x38cb53,null));};exports[_0xb8a4('0x75')]=function(_0x385e4c,_0x4e3603,_0x152abc){var _0x34dfa1;var _0x10da8f;var _0x4919e5;var _0x89c881=_0x385e4c[_0xb8a4('0x4c')]['id'];csv_results=[];return db[_0xb8a4('0x76')][_0xb8a4('0x5f')]({'attributes':['id','name'],'raw':!![],'order':[_0xb8a4('0x77')]})[_0xb8a4('0x2a')](function(_0x1a2b7e){_0x34dfa1=_0x1a2b7e;var _0x588279=_['keys'](db[_0xb8a4('0x63')]['rawAttributes']);return db[_0xb8a4('0x6f')]['findAll']({'raw':!![],'attributes':['id','alias']})[_0xb8a4('0x2a')](function(_0x259855){_0x10da8f=_0x259855;var _0x516ee3=squel[_0xb8a4('0x78')]()[_0xb8a4('0x3c')](_0x588279)[_0xb8a4('0x79')](_0xb8a4('0x7a'),'c')[_0xb8a4('0x42')](_0xb8a4('0x7b'),_0x89c881)[_0xb8a4('0x42')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x529dad=0x0;_0x529dad<_0x10da8f['length'];_0x529dad++){_0x516ee3[_0xb8a4('0x7c')](_0xb8a4('0x7d')+_0x10da8f[_0x529dad]['id'],'customField_'+_0x10da8f[_0x529dad][_0xb8a4('0x7e')]);}for(var _0x529dad=0x0;_0x529dad<_0x34dfa1[_0xb8a4('0x3d')];_0x529dad++){_0x516ee3[_0xb8a4('0x7c')](squel[_0xb8a4('0x78')]()[_0xb8a4('0x7c')](_0xb8a4('0x7f'))[_0xb8a4('0x79')]('cm_contact_has_items')[_0xb8a4('0x42')](_0xb8a4('0x80'),_0x34dfa1[_0x529dad]['id'])[_0xb8a4('0x42')]('CmContactId\x20=\x20c.id'),_0xb8a4('0x81')+_0x34dfa1[_0x529dad][_0xb8a4('0x30')]);_0x516ee3[_0xb8a4('0x7c')](squel[_0xb8a4('0x78')]()[_0xb8a4('0x7c')](_0xb8a4('0x82'))[_0xb8a4('0x79')](_0xb8a4('0x83'))[_0xb8a4('0x42')]('ItemTypeId\x20=\x20?',_0x34dfa1[_0x529dad]['id'])['where'](_0xb8a4('0x84')),_0xb8a4('0x85')+_0x34dfa1[_0x529dad][_0xb8a4('0x30')]);}var _0x44c9e2=[];_0x44c9e2['push'](_0x516ee3[_0xb8a4('0x86')]());BPromise[_0xb8a4('0x67')](_0x44c9e2,handleQuery)[_0xb8a4('0x2a')](function(_0x79dc9e){handleQuery(_0x516ee3[_0xb8a4('0x86')]());var _0x26b8a8=csv_results[0x0];if(!_[_0xb8a4('0x87')](_0x26b8a8)){var _0x1f1b74=toCsv(_0x26b8a8);var _0x54edd2=Date[_0xb8a4('0x88')]();fs[_0xb8a4('0x89')](util[_0xb8a4('0x72')]('/tmp/list_%d_%s.csv',_0x89c881,_0x54edd2),_0x1f1b74);_0x4e3603[_0xb8a4('0x8a')](_0xb8a4('0x8b'),_0xb8a4('0x8c')+util[_0xb8a4('0x72')](_0xb8a4('0x8d'),_0x89c881,_0x54edd2));_0x4e3603[_0xb8a4('0x8a')](_0xb8a4('0x8e'),'text/csv');return _0x4e3603['download'](util[_0xb8a4('0x72')](_0xb8a4('0x8f'),_0x89c881,_0x54edd2));}else{return _0x4e3603[_0xb8a4('0x2d')](0xcc);}});});});};exports['addCustomField']=function(_0x132d20,_0x414cfa,_0x3cd291){var _0x166127;delete _0x132d20['body']['id'];return db[_0xb8a4('0x46')][_0xb8a4('0x5c')]({'where':{'id':_0x132d20[_0xb8a4('0x4c')]['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x414cfa,null))['then'](function(_0x58275a){if(_0x58275a){return db[_0xb8a4('0x90')][_0xb8a4('0x91')](function(_0x5723f3){return db[_0xb8a4('0x6f')]['create'](_0x132d20['body'],{'transaction':_0x5723f3})['then'](function(_0x4834f6){_0x166127=_0x4834f6;return _0x58275a[_0xb8a4('0x92')](_0x4834f6,{'transaction':_0x5723f3});})[_0xb8a4('0x2a')](function(){var _0x1a87df={'type':db[_0xb8a4('0x93')]['TEXT'],'transaction':_0x5723f3};switch(_0x132d20[_0xb8a4('0x50')][_0xb8a4('0x34')]){case _0xb8a4('0x94'):_0x1a87df['type']=db[_0xb8a4('0x93')][_0xb8a4('0x95')];break;case _0xb8a4('0x96'):_0x1a87df[_0xb8a4('0x34')]=db[_0xb8a4('0x93')][_0xb8a4('0x97')];break;case'switch':_0x1a87df[_0xb8a4('0x34')]=db['Sequelize'][_0xb8a4('0x98')];_0x1a87df[_0xb8a4('0x99')]=![];break;default:}return db[_0xb8a4('0x90')][_0xb8a4('0x9a')][_0xb8a4('0x9b')](_0xb8a4('0x7a'),util[_0xb8a4('0x72')](_0xb8a4('0x9c'),_0x166127['id']),_0x1a87df);})['then'](function(){return _0x166127;});});}})['then'](respondWithResult(_0x414cfa,null))['catch'](handleError(_0x414cfa,null));};exports['getCustomFields']=function(_0x15e22d,_0x1c8ec5,_0x557165){var _0x1e6391={};var _0x2e5ef8={};var _0x3673d8;var _0x257ea9;return db['CmList'][_0xb8a4('0x5c')]({'where':{'id':_0x15e22d['params']['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x1c8ec5,null))[_0xb8a4('0x2a')](function(_0x7de826){if(_0x7de826){_0x3673d8=_0x7de826;_0x2e5ef8[_0xb8a4('0x3b')]=_[_0xb8a4('0x37')](db[_0xb8a4('0x6f')][_0xb8a4('0x33')]);_0x2e5ef8[_0xb8a4('0x36')]=_[_0xb8a4('0x37')](_0x15e22d['query']);_0x2e5ef8['filters']=_[_0xb8a4('0x3a')](_0x2e5ef8[_0xb8a4('0x3b')],_0x2e5ef8[_0xb8a4('0x36')]);_0x1e6391[_0xb8a4('0x39')]=_[_0xb8a4('0x3a')](_0x2e5ef8[_0xb8a4('0x3b')],qs[_0xb8a4('0x3c')](_0x15e22d[_0xb8a4('0x36')][_0xb8a4('0x3c')]));_0x1e6391[_0xb8a4('0x39')]=_0x1e6391[_0xb8a4('0x39')][_0xb8a4('0x3d')]?_0x1e6391['attributes']:_0x2e5ef8[_0xb8a4('0x3b')];_0x1e6391[_0xb8a4('0x40')]=qs[_0xb8a4('0x41')](_0x15e22d[_0xb8a4('0x36')][_0xb8a4('0x41')]);_0x1e6391['where']=qs[_0xb8a4('0x38')](_[_0xb8a4('0x5e')](_0x15e22d[_0xb8a4('0x36')],_0x2e5ef8[_0xb8a4('0x38')]));_0x1e6391['where']=_[_0xb8a4('0x43')](_0x1e6391[_0xb8a4('0x42')],{'$or':[{'ListId':_0x7de826['id']},{'ListId':null}]});if(_0x15e22d[_0xb8a4('0x36')][_0xb8a4('0x45')]){_0x1e6391[_0xb8a4('0x42')]=_[_0xb8a4('0x43')](_0x1e6391[_0xb8a4('0x42')],{'$or':_[_0xb8a4('0x32')](_0x1e6391['attributes'],function(_0x22ba7b){var _0x50d226={};_0x50d226[_0x22ba7b]={'$like':'%'+_0x15e22d[_0xb8a4('0x36')][_0xb8a4('0x45')]+'%'};return _0x50d226;})});}_0x1e6391=_[_0xb8a4('0x43')]({},_0x1e6391,_0x15e22d['options']);return db[_0xb8a4('0x6f')][_0xb8a4('0x9d')](_0x1e6391);}})['then'](respondWithResult(_0x1c8ec5,null))[_0xb8a4('0x4a')](handleError(_0x1c8ec5,null));};exports[_0xb8a4('0x9e')]=function(_0x20ee0b,_0x16723e){return db[_0xb8a4('0x6f')][_0xb8a4('0x9d')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x16723e,null))['then'](function(_0x2c4679){return _0x2c4679;})[_0xb8a4('0x2a')](respondWithResult(_0x16723e,null))['catch'](handleError(_0x16723e,null));};exports[_0xb8a4('0x9f')]=function(_0xaba407,_0x1ff1a9,_0x4a6f67){return db[_0xb8a4('0x46')][_0xb8a4('0x4e')]({'where':{'id':_0xaba407[_0xb8a4('0x4c')]['id']}})[_0xb8a4('0x2a')](handleEntityNotFound(_0x1ff1a9,null))['then'](function(_0x9f4ba3){if(_0x9f4ba3){return _0x9f4ba3[_0xb8a4('0x9f')](_0xaba407['body'][_0xb8a4('0x61')],_[_0xb8a4('0x68')](_0xaba407[_0xb8a4('0x50')],['ids','id'])||{})[_0xb8a4('0xa0')](function(_0x2a5ae9){for(var _0xebadbf=0x0;_0xebadbf<_0xaba407[_0xb8a4('0x50')][_0xb8a4('0x61')]['length'];_0xebadbf+=0x1){socket[_0xb8a4('0xa1')](_0xb8a4('0xa2'),{'UserId':Number(_0xaba407[_0xb8a4('0x50')][_0xb8a4('0x61')][_0xebadbf]),'CmListId':Number(_0xaba407[_0xb8a4('0x4c')]['id'])});}return _0x2a5ae9;});}})[_0xb8a4('0x2a')](respondWithResult(_0x1ff1a9,null))[_0xb8a4('0x4a')](handleError(_0x1ff1a9,null));};exports[_0xb8a4('0xa3')]=function(_0x539c1b,_0x594d22,_0x1aafa6){return db[_0xb8a4('0x46')][_0xb8a4('0x4e')]({'where':{'id':_0x539c1b[_0xb8a4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x594d22,null))[_0xb8a4('0x2a')](function(_0x240964){if(_0x240964){return _0x240964[_0xb8a4('0xa3')](_0x539c1b[_0xb8a4('0x36')][_0xb8a4('0x61')])[_0xb8a4('0x2a')](function(){if(_[_0xb8a4('0x64')](_0x539c1b['query'][_0xb8a4('0x61')])){for(var _0x47320d=0x0;_0x47320d<_0x539c1b[_0xb8a4('0x36')][_0xb8a4('0x61')][_0xb8a4('0x3d')];_0x47320d+=0x1){socket[_0xb8a4('0xa1')]('userCmList:remove',{'UserId':Number(_0x539c1b[_0xb8a4('0x36')][_0xb8a4('0x61')][_0x47320d]),'CmListId':Number(_0x539c1b['params']['id'])});}}else{socket[_0xb8a4('0xa1')](_0xb8a4('0xa4'),{'UserId':Number(_0x539c1b['query'][_0xb8a4('0x61')]),'CmListId':Number(_0x539c1b[_0xb8a4('0x4c')]['id'])});}});}})[_0xb8a4('0x2a')](respondWithStatusCode(_0x594d22,null))[_0xb8a4('0x4a')](handleError(_0x594d22,null));};exports[_0xb8a4('0xa5')]=function(_0xabd28b,_0xbd489b,_0x197a20){var _0x4ecee2={};var _0x42ab01={};var _0x38308c;var _0x5ad0ed;return db[_0xb8a4('0x46')][_0xb8a4('0x5c')]({'where':{'id':_0xabd28b[_0xb8a4('0x4c')]['id']}})['then'](handleEntityNotFound(_0xbd489b,null))[_0xb8a4('0x2a')](function(_0xb1db15){if(_0xb1db15){_0x38308c=_0xb1db15;_0x42ab01[_0xb8a4('0x3b')]=_['keys'](db[_0xb8a4('0xa6')]['rawAttributes']);_0x42ab01[_0xb8a4('0x36')]=_[_0xb8a4('0x37')](_0xabd28b[_0xb8a4('0x36')]);_0x42ab01[_0xb8a4('0x38')]=_[_0xb8a4('0x3a')](_0x42ab01[_0xb8a4('0x3b')],_0x42ab01[_0xb8a4('0x36')]);_0x4ecee2[_0xb8a4('0x39')]=_[_0xb8a4('0x3a')](_0x42ab01[_0xb8a4('0x3b')],qs[_0xb8a4('0x3c')](_0xabd28b[_0xb8a4('0x36')][_0xb8a4('0x3c')]));_0x4ecee2['attributes']=_0x4ecee2[_0xb8a4('0x39')][_0xb8a4('0x3d')]?_0x4ecee2[_0xb8a4('0x39')]:_0x42ab01[_0xb8a4('0x3b')];_0x4ecee2['order']=qs['sort'](_0xabd28b[_0xb8a4('0x36')]['sort']);_0x4ecee2[_0xb8a4('0x42')]=qs[_0xb8a4('0x38')](_[_0xb8a4('0x5e')](_0xabd28b['query'],_0x42ab01[_0xb8a4('0x38')]));if(_0xabd28b[_0xb8a4('0x36')][_0xb8a4('0x45')]){_0x4ecee2[_0xb8a4('0x42')]=_['merge'](_0x4ecee2['where'],{'$or':_[_0xb8a4('0x32')](_0x4ecee2[_0xb8a4('0x39')],function(_0xe293fc){var _0x2bee0f={};_0x2bee0f[_0xe293fc]={'$like':'%'+_0xabd28b[_0xb8a4('0x36')][_0xb8a4('0x45')]+'%'};return _0x2bee0f;})});}_0x4ecee2=_[_0xb8a4('0x43')]({},_0x4ecee2,_0xabd28b[_0xb8a4('0x4d')]);return _0x38308c['getAgents'](_0x4ecee2);}})[_0xb8a4('0x2a')](function(_0x172d89){if(_0x172d89){_0x5ad0ed=_0x172d89[_0xb8a4('0x3d')];if(!_0xabd28b[_0xb8a4('0x36')][_0xb8a4('0x3e')]('nolimit')){_0x4ecee2[_0xb8a4('0x22')]=qs[_0xb8a4('0x22')](_0xabd28b[_0xb8a4('0x36')][_0xb8a4('0x22')]);_0x4ecee2[_0xb8a4('0x3f')]=qs[_0xb8a4('0x3f')](_0xabd28b[_0xb8a4('0x36')]['offset']);}return _0x38308c[_0xb8a4('0xa5')](_0x4ecee2);}})['then'](function(_0x28380e){if(_0x28380e){return _0x28380e?{'count':_0x5ad0ed,'rows':_0x28380e}:null;}})['then'](respondWithResult(_0xbd489b,null))['catch'](handleError(_0xbd489b,null));};function handleQuery(_0x3f6fe5){logger[_0xb8a4('0xa7')](_0x3f6fe5);return db[_0xb8a4('0x90')][_0xb8a4('0x36')](_0x3f6fe5)['spread'](function(_0x581f1d){csv_results[_0xb8a4('0x66')](_0x581f1d);})['catch'](function(_0x3f5679){logger[_0xb8a4('0x2e')](_0x3f5679[_0xb8a4('0x6c')]);});} \ No newline at end of file +var _0x120d=['moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','update','then','destroy','get','Lists','UserProfileResource','error','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','CmList','includeAll','include','findAll','rows','catch','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','removeDispositions','ids','addContacts','tags','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','concat','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','from','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','userCmList:save','isArray','emit','userCmList:remove','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x30ca1d,_0x2d55d7){var _0x2736f4=function(_0x28f0e1){while(--_0x28f0e1){_0x30ca1d['push'](_0x30ca1d['shift']());}};_0x2736f4(++_0x2d55d7);}(_0x120d,0x140));var _0xd120=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x120d[_0x47df54];return _0x261b87;};'use strict';var emlformat=require(_0xd120('0x0'));var rimraf=require(_0xd120('0x1'));var zipdir=require(_0xd120('0x2'));var jsonpatch=require(_0xd120('0x3'));var rp=require('request-promise');var moment=require(_0xd120('0x4'));var BPromise=require(_0xd120('0x5'));var Mustache=require(_0xd120('0x6'));var util=require('util');var path=require(_0xd120('0x7'));var sox=require(_0xd120('0x8'));var csv=require(_0xd120('0x9'));var ejs=require(_0xd120('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd120('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd120('0xc'));var toCsv=require(_0xd120('0x9'));var querystring=require(_0xd120('0xd'));var Papa=require(_0xd120('0xe'));var Redis=require('ioredis');var authService=require(_0xd120('0xf'));var qs=require(_0xd120('0x10'));var as=require(_0xd120('0x11'));var hardwareService=require(_0xd120('0x12'));var logger=require('../../config/logger')(_0xd120('0x13'));var utils=require(_0xd120('0x14'));var config=require(_0xd120('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd120('0x16'))['db'];var csv_results;config['redis']=_[_0xd120('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd120('0x18'))(new Redis(config[_0xd120('0x19')]));require('./cmList.socket')[_0xd120('0x1a')](socket);function respondWithStatusCode(_0x33d417,_0x93c9c0){_0x93c9c0=_0x93c9c0||0xcc;return function(_0xe2fe86){if(_0xe2fe86){return _0x33d417[_0xd120('0x1b')](_0x93c9c0);}return _0x33d417[_0xd120('0x1c')](_0x93c9c0)[_0xd120('0x1d')]();};}function respondWithResult(_0x32192f,_0x5ba4a8){_0x5ba4a8=_0x5ba4a8||0xc8;return function(_0x9aaedd){if(_0x9aaedd){return _0x32192f[_0xd120('0x1c')](_0x5ba4a8)[_0xd120('0x1e')](_0x9aaedd);}};}function respondWithFilteredResult(_0x265854,_0x27a208){return function(_0x522e14){if(_0x522e14){var _0x4d0520=typeof _0x27a208['offset']==='undefined'&&typeof _0x27a208[_0xd120('0x1f')]===_0xd120('0x20');var _0x18ef2c=_0x522e14[_0xd120('0x21')];var _0x56f7a7=_0x4d0520?0x0:_0x27a208[_0xd120('0x22')];var _0x4bfa9d=_0x4d0520?_0x522e14[_0xd120('0x21')]:_0x27a208[_0xd120('0x22')]+_0x27a208[_0xd120('0x1f')];var _0x58f97b;if(_0x4bfa9d>=_0x18ef2c){_0x4bfa9d=_0x18ef2c;_0x58f97b=0xc8;}else{_0x58f97b=0xce;}_0x265854[_0xd120('0x1c')](_0x58f97b);return _0x265854[_0xd120('0x23')]('Content-Range',_0x56f7a7+'-'+_0x4bfa9d+'/'+_0x18ef2c)[_0xd120('0x1e')](_0x522e14);}return null;};}function patchUpdates(_0x1262a2){return function(_0xe17edf){try{jsonpatch[_0xd120('0x24')](_0xe17edf,_0x1262a2,!![]);}catch(_0x384454){return BPromise['reject'](_0x384454);}return _0xe17edf[_0xd120('0x25')]();};}function saveUpdates(_0x2da038,_0x19564d){return function(_0x14301d){if(_0x14301d){return _0x14301d[_0xd120('0x26')](_0x2da038)[_0xd120('0x27')](function(_0x10ffec){return _0x10ffec;});}return null;};}function removeEntity(_0xd6883d,_0x10cae3){return function(_0x2e2b52){if(_0x2e2b52){return _0x2e2b52[_0xd120('0x28')]()[_0xd120('0x27')](function(){var _0x4ea26f=_0x2e2b52[_0xd120('0x29')]({'plain':!![]});var _0x2b4bca=_0xd120('0x2a');return db[_0xd120('0x2b')][_0xd120('0x28')]({'where':{'type':_0x2b4bca,'resourceId':_0x4ea26f['id']}})[_0xd120('0x27')](function(){return _0x2e2b52;});})[_0xd120('0x27')](function(){_0xd6883d[_0xd120('0x1c')](0xcc)[_0xd120('0x1d')]();});}};}function handleEntityNotFound(_0x25cb1b,_0x5f2e35){return function(_0x3626fd){if(!_0x3626fd){_0x25cb1b[_0xd120('0x1b')](0x194);}return _0x3626fd;};}function handleError(_0x4205db,_0x4bb751){_0x4bb751=_0x4bb751||0x1f4;return function(_0x22d483){logger[_0xd120('0x2c')](_0x22d483['stack']);if(_0x22d483['name']){delete _0x22d483['name'];}_0x4205db['status'](_0x4bb751)['send'](_0x22d483);};}exports[_0xd120('0x2d')]=function(_0x1f1b2b,_0x56d02b){var _0x48d303={},_0x61cb26={},_0x298705={'count':0x0,'rows':[]};var _0x56af08=_[_0xd120('0x2e')](db['CmList'][_0xd120('0x2f')],function(_0x217425){return{'name':_0x217425[_0xd120('0x30')],'type':_0x217425[_0xd120('0x31')]['key']};});_0x61cb26[_0xd120('0x32')]=_['map'](_0x56af08,_0xd120('0x33'));_0x61cb26[_0xd120('0x34')]=_[_0xd120('0x35')](_0x1f1b2b[_0xd120('0x34')]);_0x61cb26[_0xd120('0x36')]=_[_0xd120('0x37')](_0x61cb26['model'],_0x61cb26[_0xd120('0x34')]);_0x48d303[_0xd120('0x38')]=_[_0xd120('0x37')](_0x61cb26[_0xd120('0x32')],qs[_0xd120('0x39')](_0x1f1b2b[_0xd120('0x34')][_0xd120('0x39')]));_0x48d303['attributes']=_0x48d303[_0xd120('0x38')][_0xd120('0x3a')]?_0x48d303['attributes']:_0x61cb26['model'];if(!_0x1f1b2b['query'][_0xd120('0x3b')](_0xd120('0x3c'))){_0x48d303[_0xd120('0x1f')]=qs[_0xd120('0x1f')](_0x1f1b2b[_0xd120('0x34')][_0xd120('0x1f')]);_0x48d303[_0xd120('0x22')]=qs[_0xd120('0x22')](_0x1f1b2b['query'][_0xd120('0x22')]);}_0x48d303[_0xd120('0x3d')]=qs[_0xd120('0x3e')](_0x1f1b2b[_0xd120('0x34')][_0xd120('0x3e')]);_0x48d303[_0xd120('0x3f')]=qs[_0xd120('0x36')](_[_0xd120('0x40')](_0x1f1b2b[_0xd120('0x34')],_0x61cb26[_0xd120('0x36')]),_0x56af08);if(_0x1f1b2b[_0xd120('0x34')]['filter']){_0x48d303[_0xd120('0x3f')]=_[_0xd120('0x41')](_0x48d303[_0xd120('0x3f')],{'$or':_[_0xd120('0x2e')](_0x56af08,function(_0x5d62ca){if(_0x5d62ca[_0xd120('0x31')]!=='VIRTUAL'){var _0x449b22={};_0x449b22[_0x5d62ca[_0xd120('0x33')]]={'$like':'%'+_0x1f1b2b['query'][_0xd120('0x42')]+'%'};return _0x449b22;}})});}_0x48d303=_[_0xd120('0x41')]({},_0x48d303,_0x1f1b2b['options']);var _0x3c6bee={'where':_0x48d303[_0xd120('0x3f')]};return db[_0xd120('0x43')]['count'](_0x3c6bee)[_0xd120('0x27')](function(_0x2c6004){_0x298705[_0xd120('0x21')]=_0x2c6004;if(_0x1f1b2b[_0xd120('0x34')][_0xd120('0x44')]){_0x48d303[_0xd120('0x45')]=[{'all':!![]}];}return db[_0xd120('0x43')][_0xd120('0x46')](_0x48d303);})['then'](function(_0x348b7c){_0x298705[_0xd120('0x47')]=_0x348b7c;return _0x298705;})[_0xd120('0x27')](respondWithFilteredResult(_0x56d02b,_0x48d303))[_0xd120('0x48')](handleError(_0x56d02b,null));};exports['show']=function(_0x5f2370,_0x451296){var _0xf94c08={'raw':![],'where':{'id':_0x5f2370['params']['id']}},_0x211327={};_0x211327[_0xd120('0x32')]=_[_0xd120('0x35')](db[_0xd120('0x43')][_0xd120('0x2f')]);_0x211327[_0xd120('0x34')]=_['keys'](_0x5f2370[_0xd120('0x34')]);_0x211327[_0xd120('0x36')]=_[_0xd120('0x37')](_0x211327[_0xd120('0x32')],_0x211327[_0xd120('0x34')]);_0xf94c08[_0xd120('0x38')]=_[_0xd120('0x37')](_0x211327['model'],qs[_0xd120('0x39')](_0x5f2370['query']['fields']));_0xf94c08[_0xd120('0x38')]=_0xf94c08[_0xd120('0x38')][_0xd120('0x3a')]?_0xf94c08[_0xd120('0x38')]:_0x211327[_0xd120('0x32')];if(_0x5f2370['query'][_0xd120('0x44')]){_0xf94c08[_0xd120('0x45')]=[{'all':!![]}];}_0xf94c08=_[_0xd120('0x41')]({},_0xf94c08,_0x5f2370[_0xd120('0x49')]);return db[_0xd120('0x43')]['find'](_0xf94c08)[_0xd120('0x27')](handleEntityNotFound(_0x451296,null))[_0xd120('0x27')](respondWithResult(_0x451296,null))[_0xd120('0x48')](handleError(_0x451296,null));};exports['create']=function(_0x22b288,_0x484d6d){return db['CmList'][_0xd120('0x4a')](_0x22b288['body'],{})[_0xd120('0x27')](function(_0x172d2e){var _0x5a15cf=_0x22b288[_0xd120('0x4b')][_0xd120('0x29')]({'plain':!![]});if(!_0x5a15cf)throw new Error(_0xd120('0x4c'));if(_0x5a15cf[_0xd120('0x4d')]===_0xd120('0x4b')){var _0x3662ab=_0x172d2e['get']({'plain':!![]});var _0x347443='Lists';return db[_0xd120('0x4e')][_0xd120('0x4f')]({'where':{'name':_0x347443,'userProfileId':_0x5a15cf[_0xd120('0x50')]},'raw':!![]})['then'](function(_0x1fa42b){if(_0x1fa42b&&_0x1fa42b[_0xd120('0x51')]===0x0){return db['UserProfileResource'][_0xd120('0x4a')]({'name':_0x3662ab[_0xd120('0x33')],'resourceId':_0x3662ab['id'],'type':_0x1fa42b['name'],'sectionId':_0x1fa42b['id']},{})[_0xd120('0x27')](function(){return _0x172d2e;});}else{return _0x172d2e;}})['catch'](function(_0x16ac86){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16ac86);throw _0x16ac86;});}return _0x172d2e;})[_0xd120('0x27')](respondWithResult(_0x484d6d,0xc9))[_0xd120('0x48')](handleError(_0x484d6d,null));};exports['update']=function(_0x44ddfe,_0x1d0488){if(_0x44ddfe[_0xd120('0x52')]['id']){delete _0x44ddfe['body']['id'];}return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x44ddfe[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x1d0488,null))['then'](saveUpdates(_0x44ddfe[_0xd120('0x52')],null))[_0xd120('0x27')](respondWithResult(_0x1d0488,null))[_0xd120('0x48')](handleError(_0x1d0488,null));};exports[_0xd120('0x28')]=function(_0x5e5ad4,_0x599b5a){return db[_0xd120('0x43')]['find']({'where':{'id':_0x5e5ad4[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x599b5a,null))['then'](removeEntity(_0x599b5a,null))['catch'](handleError(_0x599b5a,null));};exports[_0xd120('0x54')]=function(_0x47211a,_0x32ee7d){return db[_0xd120('0x43')][_0xd120('0x54')]()[_0xd120('0x27')](respondWithResult(_0x32ee7d,null))['catch'](handleError(_0x32ee7d,null));};exports[_0xd120('0x55')]=function(_0x3ed7a0,_0x375ec5,_0x49dcbe){if(_0x3ed7a0[_0xd120('0x52')]['id']){delete _0x3ed7a0[_0xd120('0x52')]['id'];}return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x3ed7a0[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x375ec5,null))[_0xd120('0x27')](function(_0x32ba89){if(_0x32ba89){_0x3ed7a0['body'][_0xd120('0x56')]=_0x32ba89['id'];return db['Disposition']['create'](_0x3ed7a0[_0xd120('0x52')]);}})['then'](respondWithResult(_0x375ec5,null))[_0xd120('0x48')](handleError(_0x375ec5,null));};exports[_0xd120('0x57')]=function(_0xc4249,_0x4cf1df,_0x5bdb69){var _0x29baa4={'raw':![],'where':{}};var _0x4d6e3d={};var _0x29ff1d={'count':0x0,'rows':[]};return db[_0xd120('0x43')][_0xd120('0x58')]({'where':{'id':_0xc4249['params']['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x4cf1df,null))[_0xd120('0x27')](function(_0x748550){if(_0x748550){_0x4d6e3d[_0xd120('0x32')]=_[_0xd120('0x35')](db['Disposition'][_0xd120('0x2f')]);_0x4d6e3d['query']=_['keys'](_0xc4249[_0xd120('0x34')]);_0x4d6e3d[_0xd120('0x36')]=_[_0xd120('0x37')](_0x4d6e3d[_0xd120('0x32')],_0x4d6e3d['query']);_0x29baa4['attributes']=_[_0xd120('0x37')](_0x4d6e3d[_0xd120('0x32')],qs[_0xd120('0x39')](_0xc4249[_0xd120('0x34')]['fields']));_0x29baa4[_0xd120('0x38')]=_0x29baa4[_0xd120('0x38')]['length']?_0x29baa4[_0xd120('0x38')]:_0x4d6e3d[_0xd120('0x32')];if(!_0xc4249[_0xd120('0x34')]['hasOwnProperty']('nolimit')){_0x29baa4[_0xd120('0x1f')]=qs[_0xd120('0x1f')](_0xc4249[_0xd120('0x34')][_0xd120('0x1f')]);_0x29baa4[_0xd120('0x22')]=qs[_0xd120('0x22')](_0xc4249[_0xd120('0x34')]['offset']);}_0x29baa4[_0xd120('0x3d')]=qs[_0xd120('0x3e')](_0xc4249[_0xd120('0x34')][_0xd120('0x3e')]);_0x29baa4[_0xd120('0x3f')]=qs[_0xd120('0x36')](_[_0xd120('0x40')](_0xc4249[_0xd120('0x34')],_0x4d6e3d[_0xd120('0x36')]));_0x29baa4[_0xd120('0x3f')][_0xd120('0x56')]=_0x748550['id'];if(_0xc4249['query'][_0xd120('0x42')]){_0x29baa4[_0xd120('0x3f')]=_[_0xd120('0x41')](_0x29baa4[_0xd120('0x3f')],{'$or':_[_0xd120('0x2e')](_0x29baa4[_0xd120('0x38')],function(_0x119df3){var _0x24f35b={};_0x24f35b[_0x119df3]={'$like':'%'+_0xc4249[_0xd120('0x34')]['filter']+'%'};return _0x24f35b;})});}_0x29baa4=_[_0xd120('0x41')]({},_0x29baa4,_0xc4249[_0xd120('0x49')]);return db[_0xd120('0x59')][_0xd120('0x21')]({'where':_0x29baa4['where']})['then'](function(_0x16489e){_0x29ff1d[_0xd120('0x21')]=_0x16489e;if(_0xc4249[_0xd120('0x34')][_0xd120('0x44')]){_0x29baa4[_0xd120('0x45')]=[{'all':!![]}];}return db[_0xd120('0x59')]['findAll'](_0x29baa4);})[_0xd120('0x27')](function(_0x505ab9){_0x29ff1d[_0xd120('0x47')]=_0x505ab9;return _0x29ff1d;});}})['then'](respondWithFilteredResult(_0x4cf1df,_0x29baa4))[_0xd120('0x48')](handleError(_0x4cf1df,null));};exports['removeDispositions']=function(_0x5c2999,_0x1eb15e,_0xb591f9){return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x5c2999[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x1eb15e,null))[_0xd120('0x27')](function(_0x2fce00){if(_0x2fce00){return _0x2fce00[_0xd120('0x5a')](_0x5c2999['query'][_0xd120('0x5b')]);}})[_0xd120('0x27')](respondWithStatusCode(_0x1eb15e,null))[_0xd120('0x48')](handleError(_0x1eb15e,null));};exports[_0xd120('0x5c')]=function(_0x4dfc22,_0x43cf97,_0x4b27ca){return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x4dfc22[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x43cf97,null))['then'](function(_0x41c517){if(_0x41c517){var _0x5ae78e=[];var _0x5da7f3={'success':[],'errors':[]};return db['CmContact'][_0xd120('0x54')]()[_0xd120('0x27')](function(_0x39fcb3){if(_0x4dfc22[_0xd120('0x52')]['tags']&&_['isArray'](_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')])){if(_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')][_0xd120('0x3a')]){_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')]=_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')][_0xd120('0x5e')](';')+';';}else{_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')]=null;}}else{_0x4dfc22[_0xd120('0x52')][_0xd120('0x5d')]=null;}if(_0x4dfc22[_0xd120('0x52')]&&_['isArray'](_0x4dfc22[_0xd120('0x52')])){for(var _0x56777e=0x0;_0x56777e<_0x4dfc22[_0xd120('0x52')][_0xd120('0x3a')];_0x56777e+=0x1){_0x4dfc22['body'][_0x56777e][_0xd120('0x56')]=_0x4dfc22[_0xd120('0x53')]['id'];_0x5ae78e['push'](_0x4dfc22['body'][_0x56777e]);}return BPromise[_0xd120('0x5f')](_0x5ae78e,function(_0x58de79){return db['CmContact']['create'](_[_0xd120('0x60')](_0x58de79,['ids','id'])||{},{'fields':_[_0xd120('0x35')](_0x39fcb3),'raw':!![]})[_0xd120('0x27')](function(_0x2b80a3){_0x5da7f3[_0xd120('0x61')][_0xd120('0x62')](_0x2b80a3[_0xd120('0x63')]);})[_0xd120('0x48')](function(_0x281d21){_0x5da7f3[_0xd120('0x64')][_0xd120('0x62')]({'data':_0x58de79,'error':_0x281d21[_0xd120('0x65')]});});})['then'](function(_0x41744d){return _0x5da7f3;})[_0xd120('0x48')](function(_0x8949b4){return _0x8949b4;});}else{_0x43cf97[_0xd120('0x1c')](0x190)['json']({'message':_0xd120('0x66')});}});}})[_0xd120('0x27')](respondWithResult(_0x43cf97,null))[_0xd120('0x48')](handleError(_0x43cf97,null));};exports[_0xd120('0x67')]=function(_0x35d4bb,_0x3d671f,_0x53a270){var _0x592243;return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x35d4bb[_0xd120('0x53')]['id']},'include':[{'model':db[_0xd120('0x68')],'as':_0xd120('0x69')}]})[_0xd120('0x27')](handleEntityNotFound(_0x3d671f,null))[_0xd120('0x27')](function(_0x4d53cf){if(_0x4d53cf){_0x592243=_0x4d53cf;return db[_0xd120('0x6a')]['rawAttributes'];}})[_0xd120('0x27')](function(_0x408698){if(_0x408698){var _0x537e23={};var _0x50a539={};_0x50a539[_0xd120('0x32')]=_[_0xd120('0x6b')](_[_0xd120('0x35')](_0x408698),_['map'](_0x592243[_0xd120('0x69')],function(_0x4a59db){return util[_0xd120('0x6c')](_0xd120('0x6d'),_0x4a59db['id']);}));_0x50a539[_0xd120('0x34')]=_[_0xd120('0x35')](_0x35d4bb[_0xd120('0x34')]);_0x50a539[_0xd120('0x36')]=_[_0xd120('0x37')](_0x50a539['model'],_0x50a539[_0xd120('0x34')]);_0x537e23[_0xd120('0x38')]=_[_0xd120('0x37')](_0x50a539['model'],qs[_0xd120('0x39')](_0x35d4bb['query'][_0xd120('0x39')]));_0x537e23[_0xd120('0x38')]=_0x537e23[_0xd120('0x38')][_0xd120('0x3a')]?_0x537e23[_0xd120('0x38')]:_0x50a539[_0xd120('0x32')];if(!_0x35d4bb[_0xd120('0x34')][_0xd120('0x3b')](_0xd120('0x3c'))){_0x537e23[_0xd120('0x1f')]=qs['limit'](_0x35d4bb['query'][_0xd120('0x1f')]);_0x537e23[_0xd120('0x22')]=qs['offset'](_0x35d4bb['query'][_0xd120('0x22')]);}_0x537e23[_0xd120('0x3d')]=qs[_0xd120('0x3e')](_0x35d4bb['query']['sort']);_0x537e23['where']=qs['filters'](_[_0xd120('0x40')](_0x35d4bb['query'],_0x50a539['filters']));_0x537e23['raw']=!![];if(_0x35d4bb['query']['filter']){_0x537e23[_0xd120('0x3f')]=_[_0xd120('0x41')](_0x537e23[_0xd120('0x3f')],{'$or':_[_0xd120('0x2e')](_0x537e23['attributes'],function(_0x278e1c){var _0x5ce071={};_0x5ce071[_0x278e1c]={'$like':'%'+_0x35d4bb[_0xd120('0x34')][_0xd120('0x42')]+'%'};return _0x5ce071;})});}_0x537e23=_[_0xd120('0x41')]({},_0x537e23,_0x35d4bb[_0xd120('0x49')]);return _0x592243['getContacts'](_0x537e23);}})[_0xd120('0x27')](respondWithResult(_0x3d671f,null))[_0xd120('0x48')](handleError(_0x3d671f,null));};exports[_0xd120('0x6e')]=function(_0x417737,_0x1c93b3,_0x8f2606){var _0x2fef66;var _0x5c6d01;var _0x3b0d93;var _0x59a078=_0x417737['params']['id'];csv_results=[];return db[_0xd120('0x6f')][_0xd120('0x46')]({'attributes':['id',_0xd120('0x33')],'raw':!![],'order':[_0xd120('0x70')]})[_0xd120('0x27')](function(_0x32b2a5){_0x2fef66=_0x32b2a5;var _0x5f2aa0=_[_0xd120('0x35')](db[_0xd120('0x6a')][_0xd120('0x2f')]);return db['CmCustomField'][_0xd120('0x46')]({'raw':!![],'attributes':['id',_0xd120('0x71')]})['then'](function(_0x2bae79){_0x5c6d01=_0x2bae79;var _0x3c7427=squel[_0xd120('0x72')]()[_0xd120('0x39')](_0x5f2aa0)['from'](_0xd120('0x73'),'c')[_0xd120('0x3f')]('c.ListId\x20=\x20?',_0x59a078)['where'](_0xd120('0x74'))[_0xd120('0x75')]();for(var _0x2d54a6=0x0;_0x2d54a6<_0x5c6d01[_0xd120('0x3a')];_0x2d54a6++){_0x3c7427[_0xd120('0x76')](_0xd120('0x77')+_0x5c6d01[_0x2d54a6]['id'],_0xd120('0x78')+_0x5c6d01[_0x2d54a6]['alias']);}for(var _0x2d54a6=0x0;_0x2d54a6<_0x2fef66['length'];_0x2d54a6++){_0x3c7427[_0xd120('0x76')](squel[_0xd120('0x72')]()[_0xd120('0x76')](_0xd120('0x79'))[_0xd120('0x7a')](_0xd120('0x7b'))['where']('ItemTypeId\x20=\x20?',_0x2fef66[_0x2d54a6]['id'])[_0xd120('0x3f')](_0xd120('0x7c')),_0xd120('0x7d')+_0x2fef66[_0x2d54a6][_0xd120('0x33')]);_0x3c7427[_0xd120('0x76')](squel[_0xd120('0x72')]()[_0xd120('0x76')](_0xd120('0x7e'))[_0xd120('0x7a')](_0xd120('0x7b'))['where'](_0xd120('0x7f'),_0x2fef66[_0x2d54a6]['id'])['where']('CmContactId\x20=\x20c.id'),_0xd120('0x80')+_0x2fef66[_0x2d54a6][_0xd120('0x33')]);}var _0x43751c=[];_0x43751c['push'](_0x3c7427[_0xd120('0x81')]());BPromise[_0xd120('0x5f')](_0x43751c,handleQuery)[_0xd120('0x27')](function(_0x19b1a5){handleQuery(_0x3c7427[_0xd120('0x81')]());var _0x526162=csv_results[0x0];if(!_['isEmpty'](_0x526162)){var _0x560b08=toCsv(_0x526162);var _0x5c78e6=Date[_0xd120('0x82')]();fs[_0xd120('0x83')](util[_0xd120('0x6c')](_0xd120('0x84'),_0x59a078,_0x5c78e6),_0x560b08);_0x1c93b3[_0xd120('0x85')](_0xd120('0x86'),'attachment;\x20filename='+util['format'](_0xd120('0x87'),_0x59a078,_0x5c78e6));_0x1c93b3[_0xd120('0x85')](_0xd120('0x88'),_0xd120('0x89'));return _0x1c93b3[_0xd120('0x8a')](util[_0xd120('0x6c')](_0xd120('0x84'),_0x59a078,_0x5c78e6));}else{return _0x1c93b3['sendStatus'](0xcc);}});});});};exports[_0xd120('0x8b')]=function(_0x4684db,_0x27a58a,_0x3f6497){var _0x487656;delete _0x4684db[_0xd120('0x52')]['id'];return db[_0xd120('0x43')][_0xd120('0x58')]({'where':{'id':_0x4684db[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x27a58a,null))[_0xd120('0x27')](function(_0x134eb9){if(_0x134eb9){return db[_0xd120('0x8c')]['transaction'](function(_0x504bc8){return db[_0xd120('0x68')][_0xd120('0x4a')](_0x4684db[_0xd120('0x52')],{'transaction':_0x504bc8})[_0xd120('0x27')](function(_0x68d7dd){_0x487656=_0x68d7dd;return _0x134eb9[_0xd120('0x8d')](_0x68d7dd,{'transaction':_0x504bc8});})[_0xd120('0x27')](function(){var _0x41ae5c={'type':db[_0xd120('0x8e')][_0xd120('0x8f')],'transaction':_0x504bc8};switch(_0x4684db[_0xd120('0x52')][_0xd120('0x31')]){case _0xd120('0x90'):_0x41ae5c[_0xd120('0x31')]=db[_0xd120('0x8e')]['TEXT'];break;case _0xd120('0x91'):_0x41ae5c[_0xd120('0x31')]=db[_0xd120('0x8e')][_0xd120('0x92')];break;case _0xd120('0x93'):_0x41ae5c[_0xd120('0x31')]=db[_0xd120('0x8e')]['BOOLEAN'];_0x41ae5c[_0xd120('0x94')]=![];break;default:}return db[_0xd120('0x8c')][_0xd120('0x95')][_0xd120('0x96')](_0xd120('0x73'),util[_0xd120('0x6c')](_0xd120('0x97'),_0x487656['id']),_0x41ae5c);})['then'](function(){return _0x487656;});});}})[_0xd120('0x27')](respondWithResult(_0x27a58a,null))[_0xd120('0x48')](handleError(_0x27a58a,null));};exports[_0xd120('0x98')]=function(_0x4fc0fe,_0x359cbb,_0x4acbd5){var _0x1e7590={};var _0x119fb3={};var _0x5dc219;var _0x299733;return db['CmList'][_0xd120('0x58')]({'where':{'id':_0x4fc0fe[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x359cbb,null))[_0xd120('0x27')](function(_0x12a339){if(_0x12a339){_0x5dc219=_0x12a339;_0x119fb3[_0xd120('0x32')]=_['keys'](db[_0xd120('0x68')][_0xd120('0x2f')]);_0x119fb3[_0xd120('0x34')]=_[_0xd120('0x35')](_0x4fc0fe[_0xd120('0x34')]);_0x119fb3[_0xd120('0x36')]=_['intersection'](_0x119fb3[_0xd120('0x32')],_0x119fb3[_0xd120('0x34')]);_0x1e7590[_0xd120('0x38')]=_['intersection'](_0x119fb3[_0xd120('0x32')],qs[_0xd120('0x39')](_0x4fc0fe[_0xd120('0x34')]['fields']));_0x1e7590[_0xd120('0x38')]=_0x1e7590[_0xd120('0x38')][_0xd120('0x3a')]?_0x1e7590[_0xd120('0x38')]:_0x119fb3[_0xd120('0x32')];_0x1e7590[_0xd120('0x3d')]=qs[_0xd120('0x3e')](_0x4fc0fe['query'][_0xd120('0x3e')]);_0x1e7590[_0xd120('0x3f')]=qs[_0xd120('0x36')](_['pick'](_0x4fc0fe[_0xd120('0x34')],_0x119fb3[_0xd120('0x36')]));_0x1e7590['where']=_[_0xd120('0x41')](_0x1e7590[_0xd120('0x3f')],{'$or':[{'ListId':_0x12a339['id']},{'ListId':null}]});if(_0x4fc0fe['query'][_0xd120('0x42')]){_0x1e7590[_0xd120('0x3f')]=_['merge'](_0x1e7590[_0xd120('0x3f')],{'$or':_[_0xd120('0x2e')](_0x1e7590['attributes'],function(_0x30b462){var _0x354078={};_0x354078[_0x30b462]={'$like':'%'+_0x4fc0fe[_0xd120('0x34')]['filter']+'%'};return _0x354078;})});}_0x1e7590=_[_0xd120('0x41')]({},_0x1e7590,_0x4fc0fe[_0xd120('0x49')]);return db[_0xd120('0x68')]['findAndCountAll'](_0x1e7590);}})[_0xd120('0x27')](respondWithResult(_0x359cbb,null))[_0xd120('0x48')](handleError(_0x359cbb,null));};exports[_0xd120('0x99')]=function(_0x455e37,_0x2a8358){return db[_0xd120('0x68')]['findAndCountAll']({'where':{'ListId':null}})[_0xd120('0x27')](handleEntityNotFound(_0x2a8358,null))[_0xd120('0x27')](function(_0x513896){return _0x513896;})['then'](respondWithResult(_0x2a8358,null))[_0xd120('0x48')](handleError(_0x2a8358,null));};exports[_0xd120('0x9a')]=function(_0x1a47f6,_0x4be98e,_0x2d2e59){return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x1a47f6[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x4be98e,null))['then'](function(_0x27edae){if(_0x27edae){return _0x27edae['addAgents'](_0x1a47f6['body'][_0xd120('0x5b')],_[_0xd120('0x60')](_0x1a47f6[_0xd120('0x52')],[_0xd120('0x5b'),'id'])||{})[_0xd120('0x9b')](function(_0x444ed8){for(var _0x4b2082=0x0;_0x4b2082<_0x1a47f6['body'][_0xd120('0x5b')]['length'];_0x4b2082+=0x1){socket['emit'](_0xd120('0x9c'),{'UserId':Number(_0x1a47f6[_0xd120('0x52')][_0xd120('0x5b')][_0x4b2082]),'CmListId':Number(_0x1a47f6['params']['id'])});}return _0x444ed8;});}})['then'](respondWithResult(_0x4be98e,null))[_0xd120('0x48')](handleError(_0x4be98e,null));};exports['removeAgents']=function(_0x3fb465,_0x1406f0,_0x30c742){return db[_0xd120('0x43')][_0xd120('0x4f')]({'where':{'id':_0x3fb465[_0xd120('0x53')]['id']}})['then'](handleEntityNotFound(_0x1406f0,null))[_0xd120('0x27')](function(_0x36ee5a){if(_0x36ee5a){return _0x36ee5a['removeAgents'](_0x3fb465['query']['ids'])[_0xd120('0x27')](function(){if(_[_0xd120('0x9d')](_0x3fb465[_0xd120('0x34')][_0xd120('0x5b')])){for(var _0x127335=0x0;_0x127335<_0x3fb465[_0xd120('0x34')]['ids']['length'];_0x127335+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x3fb465[_0xd120('0x34')][_0xd120('0x5b')][_0x127335]),'CmListId':Number(_0x3fb465[_0xd120('0x53')]['id'])});}}else{socket[_0xd120('0x9e')](_0xd120('0x9f'),{'UserId':Number(_0x3fb465['query'][_0xd120('0x5b')]),'CmListId':Number(_0x3fb465[_0xd120('0x53')]['id'])});}});}})[_0xd120('0x27')](respondWithStatusCode(_0x1406f0,null))[_0xd120('0x48')](handleError(_0x1406f0,null));};exports[_0xd120('0xa0')]=function(_0x232b74,_0x24882b,_0x148023){var _0x55e44e={};var _0xf23bd9={};var _0x150b06;var _0x54ea2f;return db[_0xd120('0x43')][_0xd120('0x58')]({'where':{'id':_0x232b74[_0xd120('0x53')]['id']}})[_0xd120('0x27')](handleEntityNotFound(_0x24882b,null))[_0xd120('0x27')](function(_0x4a2f87){if(_0x4a2f87){_0x150b06=_0x4a2f87;_0xf23bd9[_0xd120('0x32')]=_[_0xd120('0x35')](db['User'][_0xd120('0x2f')]);_0xf23bd9['query']=_[_0xd120('0x35')](_0x232b74[_0xd120('0x34')]);_0xf23bd9[_0xd120('0x36')]=_[_0xd120('0x37')](_0xf23bd9[_0xd120('0x32')],_0xf23bd9[_0xd120('0x34')]);_0x55e44e[_0xd120('0x38')]=_[_0xd120('0x37')](_0xf23bd9[_0xd120('0x32')],qs[_0xd120('0x39')](_0x232b74['query']['fields']));_0x55e44e[_0xd120('0x38')]=_0x55e44e['attributes']['length']?_0x55e44e[_0xd120('0x38')]:_0xf23bd9['model'];_0x55e44e['order']=qs[_0xd120('0x3e')](_0x232b74[_0xd120('0x34')][_0xd120('0x3e')]);_0x55e44e['where']=qs[_0xd120('0x36')](_[_0xd120('0x40')](_0x232b74[_0xd120('0x34')],_0xf23bd9['filters']));if(_0x232b74[_0xd120('0x34')][_0xd120('0x42')]){_0x55e44e[_0xd120('0x3f')]=_['merge'](_0x55e44e[_0xd120('0x3f')],{'$or':_[_0xd120('0x2e')](_0x55e44e[_0xd120('0x38')],function(_0x5d98b8){var _0x332142={};_0x332142[_0x5d98b8]={'$like':'%'+_0x232b74[_0xd120('0x34')]['filter']+'%'};return _0x332142;})});}_0x55e44e=_[_0xd120('0x41')]({},_0x55e44e,_0x232b74[_0xd120('0x49')]);return _0x150b06[_0xd120('0xa0')](_0x55e44e);}})[_0xd120('0x27')](function(_0x4e33d9){if(_0x4e33d9){_0x54ea2f=_0x4e33d9['length'];if(!_0x232b74[_0xd120('0x34')][_0xd120('0x3b')]('nolimit')){_0x55e44e['limit']=qs[_0xd120('0x1f')](_0x232b74[_0xd120('0x34')][_0xd120('0x1f')]);_0x55e44e['offset']=qs[_0xd120('0x22')](_0x232b74['query']['offset']);}return _0x150b06[_0xd120('0xa0')](_0x55e44e);}})[_0xd120('0x27')](function(_0x315e38){if(_0x315e38){return _0x315e38?{'count':_0x54ea2f,'rows':_0x315e38}:null;}})[_0xd120('0x27')](respondWithResult(_0x24882b,null))[_0xd120('0x48')](handleError(_0x24882b,null));};function handleQuery(_0x173492){logger[_0xd120('0xa1')](_0x173492);return db[_0xd120('0x8c')][_0xd120('0x34')](_0x173492)[_0xd120('0x9b')](function(_0x5a0766){csv_results[_0xd120('0x62')](_0x5a0766);})[_0xd120('0x48')](function(_0x72a78f){logger[_0xd120('0x2c')](_0x72a78f['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index f3e13af..6ff61a0 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(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x5fc3[_0x3cc9d9];return _0x1a425d;};'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(_0x9b7a2e,_0x31f874){var _0x2e308f=function(_0x47a1d9){while(--_0x47a1d9){_0x9b7a2e['push'](_0x9b7a2e['shift']());}};_0x2e308f(++_0x31f874);}(_0x814b,0x1a2));var _0xb814=function(_0x269e23,_0x14d11c){_0x269e23=_0x269e23-0x0;var _0x69ad53=_0x814b[_0x269e23];return _0x69ad53;};'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 5c07816..5fd0a13 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 _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe14d,0x1ee));var _0xde14=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xe14d[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('CmList',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x2bbbf6,_0x3df6dd){var _0x39a8cb=function(_0x28f22f){while(--_0x28f22f){_0x2bbbf6['push'](_0x2bbbf6['shift']());}};_0x39a8cb(++_0x3df6dd);}(_0xf109,0xce));var _0x9f10=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xf109[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'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 267136e..532c946 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 _0xb098=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x15c44b,_0x55ec74){var _0x5da6ff=function(_0xd6fe8){while(--_0xd6fe8){_0x15c44b['push'](_0x15c44b['shift']());}};_0x5da6ff(++_0x55ec74);}(_0xb098,0xb0));var _0x8b09=function(_0xa8190c,_0x49dd3d){_0xa8190c=_0xa8190c-0x0;var _0xf57bde=_0xb098[_0xa8190c];return _0xf57bde;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b09('0x0'));var BPromise=require(_0x8b09('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b09('0x2'));var db=require(_0x8b09('0x3'))['db'];var utils=require(_0x8b09('0x4'));var logger=require(_0x8b09('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b09('0x6'));var client=jayson['client'][_0x8b09('0x7')]({'port':0x232a});config[_0x8b09('0x8')]=_[_0x8b09('0x9')](config[_0x8b09('0x8')],{'host':_0x8b09('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x8b09('0xb')](socket);function respondWithRpcPromise(_0x26880d,_0x18c644,_0x2fd6fe){return new BPromise(function(_0x5d02fb,_0x33d233){return client[_0x8b09('0xc')](_0x26880d,_0x2fd6fe)['then'](function(_0x3d1260){logger[_0x8b09('0xd')](_0x8b09('0xe'),_0x18c644,_0x8b09('0xf'));logger['debug'](_0x8b09('0x10'),_0x18c644,'request\x20sent',JSON[_0x8b09('0x11')](_0x3d1260));if(_0x3d1260[_0x8b09('0x12')]){if(_0x3d1260[_0x8b09('0x12')]['code']===0x1f4){logger['error'](_0x8b09('0xe'),_0x18c644,_0x3d1260['error'][_0x8b09('0x13')]);return _0x33d233(_0x3d1260[_0x8b09('0x12')][_0x8b09('0x13')]);}logger[_0x8b09('0x12')](_0x8b09('0xe'),_0x18c644,_0x3d1260[_0x8b09('0x12')][_0x8b09('0x13')]);return _0x5d02fb(_0x3d1260[_0x8b09('0x12')][_0x8b09('0x13')]);}else{logger[_0x8b09('0xd')](_0x8b09('0xe'),_0x18c644,_0x8b09('0xf'));_0x5d02fb(_0x3d1260[_0x8b09('0x14')][_0x8b09('0x13')]);}})[_0x8b09('0x15')](function(_0x348d84){logger[_0x8b09('0x12')](_0x8b09('0xe'),_0x18c644,_0x348d84);_0x33d233(_0x348d84);});});} \ No newline at end of file +var _0xc988=['lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xc988,0x1c2));var _0x8c98=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc988[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x8c98('0x0'));var util=require(_0x8c98('0x1'));var moment=require('moment');var BPromise=require(_0x8c98('0x2'));var rs=require(_0x8c98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c98('0x4'));var logger=require(_0x8c98('0x5'))(_0x8c98('0x6'));var config=require(_0x8c98('0x7'));var jayson=require(_0x8c98('0x8'));var client=jayson[_0x8c98('0x9')][_0x8c98('0xa')]({'port':0x232a});config[_0x8c98('0xb')]=_[_0x8c98('0xc')](config[_0x8c98('0xb')],{'host':_0x8c98('0xd'),'port':0x18eb});var socket=require(_0x8c98('0xe'))(new Redis(config['redis']));require(_0x8c98('0xf'))['register'](socket);function respondWithRpcPromise(_0xa4f9d,_0x24b2b4,_0x4b9c76){return new BPromise(function(_0x514fc4,_0x53a328){return client['request'](_0xa4f9d,_0x4b9c76)[_0x8c98('0x10')](function(_0x53ebe4){logger[_0x8c98('0x11')](_0x8c98('0x12'),_0x24b2b4,_0x8c98('0x13'));logger['debug'](_0x8c98('0x14'),_0x24b2b4,_0x8c98('0x13'),JSON[_0x8c98('0x15')](_0x53ebe4));if(_0x53ebe4[_0x8c98('0x16')]){if(_0x53ebe4[_0x8c98('0x16')][_0x8c98('0x17')]===0x1f4){logger[_0x8c98('0x16')](_0x8c98('0x12'),_0x24b2b4,_0x53ebe4[_0x8c98('0x16')][_0x8c98('0x18')]);return _0x53a328(_0x53ebe4[_0x8c98('0x16')][_0x8c98('0x18')]);}logger['error'](_0x8c98('0x12'),_0x24b2b4,_0x53ebe4[_0x8c98('0x16')][_0x8c98('0x18')]);return _0x514fc4(_0x53ebe4[_0x8c98('0x16')][_0x8c98('0x18')]);}else{logger[_0x8c98('0x11')](_0x8c98('0x12'),_0x24b2b4,'request\x20sent');_0x514fc4(_0x53ebe4['result'][_0x8c98('0x18')]);}})['catch'](function(_0x8be3c3){logger['error'](_0x8c98('0x12'),_0x24b2b4,_0x8be3c3);_0x53a328(_0x8be3c3);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index db816e6..4b682c5 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 _0x38e9=['save','remove','update','emit','register','./cmList.events'];(function(_0x4fe72b,_0x3f3d57){var _0x293f2c=function(_0x4afde7){while(--_0x4afde7){_0x4fe72b['push'](_0x4fe72b['shift']());}};_0x293f2c(++_0x3f3d57);}(_0x38e9,0xef));var _0x938e=function(_0x829616,_0x5d9318){_0x829616=_0x829616-0x0;var _0x35857a=_0x38e9[_0x829616];return _0x35857a;};'use strict';var CmListEvents=require(_0x938e('0x0'));var events=[_0x938e('0x1'),_0x938e('0x2'),_0x938e('0x3')];function createListener(_0x315ca2,_0x334bae){return function(_0x3e2206){_0x334bae[_0x938e('0x4')](_0x315ca2,_0x3e2206);};}function removeListener(_0x13f7e5,_0x2832c){return function(){CmListEvents['removeListener'](_0x13f7e5,_0x2832c);};}exports[_0x938e('0x5')]=function(_0x2e2820){for(var _0x149bd3=0x0,_0x5d4c7c=events['length'];_0x149bd3<_0x5d4c7c;_0x149bd3++){var _0x5672cb=events[_0x149bd3];var _0x2a19c1=createListener('cmList:'+_0x5672cb,_0x2e2820);CmListEvents['on'](_0x5672cb,_0x2a19c1);}}; \ No newline at end of file +var _0xdee6=['remove','emit','removeListener','register','./cmList.events','save'];(function(_0x123ff8,_0x2b9a42){var _0x2d8b5e=function(_0x970b6f){while(--_0x970b6f){_0x123ff8['push'](_0x123ff8['shift']());}};_0x2d8b5e(++_0x2b9a42);}(_0xdee6,0x9a));var _0x6dee=function(_0x173514,_0x5829c2){_0x173514=_0x173514-0x0;var _0x422d0e=_0xdee6[_0x173514];return _0x422d0e;};'use strict';var CmListEvents=require(_0x6dee('0x0'));var events=[_0x6dee('0x1'),_0x6dee('0x2'),'update'];function createListener(_0x37aa8c,_0x125aa0){return function(_0x413850){_0x125aa0[_0x6dee('0x3')](_0x37aa8c,_0x413850);};}function removeListener(_0x522b6b,_0x4816b1){return function(){CmListEvents[_0x6dee('0x4')](_0x522b6b,_0x4816b1);};}exports[_0x6dee('0x5')]=function(_0x244c24){for(var _0x322a72=0x0,_0x10ad06=events['length'];_0x322a72<_0x10ad06;_0x322a72++){var _0x3fd229=events[_0x322a72];var _0x4f7d85=createListener('cmList:'+_0x3fd229,_0x244c24);CmListEvents['on'](_0x3fd229,_0x4f7d85);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index bd6259d..32da166 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 _0x27df=['/:id/users','getAgents','post','addContacts','/:id/fields','addCustomField','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','isAuthenticated','index','get','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x435fe9,_0x3555ae){var _0xe0c366=function(_0x3d1fb4){while(--_0x3d1fb4){_0x435fe9['push'](_0x435fe9['shift']());}};_0xe0c366(++_0x3555ae);}(_0x27df,0x16a));var _0xf27d=function(_0x30ea2d,_0x2f6def){_0x30ea2d=_0x30ea2d-0x0;var _0x3b3af9=_0x27df[_0x30ea2d];return _0x3b3af9;};'use strict';var multer=require(_0xf27d('0x0'));var util=require(_0xf27d('0x1'));var path=require(_0xf27d('0x2'));var timeout=require(_0xf27d('0x3'));var express=require(_0xf27d('0x4'));var router=express['Router']();var fs_extra=require(_0xf27d('0x5'));var auth=require(_0xf27d('0x6'));var interaction=require(_0xf27d('0x7'));var config=require('../../config/environment');var controller=require(_0xf27d('0x8'));router['get']('/',auth[_0xf27d('0x9')](),controller[_0xf27d('0xa')]);router[_0xf27d('0xb')](_0xf27d('0xc'),auth['isAuthenticated'](),controller[_0xf27d('0xd')]);router[_0xf27d('0xb')](_0xf27d('0xe'),auth[_0xf27d('0x9')](),controller[_0xf27d('0xf')]);router[_0xf27d('0xb')](_0xf27d('0x10'),auth[_0xf27d('0x9')](),controller[_0xf27d('0x11')]);router[_0xf27d('0xb')](_0xf27d('0x12'),auth[_0xf27d('0x9')](),controller[_0xf27d('0x13')]);router['get'](_0xf27d('0x14'),auth[_0xf27d('0x9')](),controller[_0xf27d('0x15')]);router['get'](_0xf27d('0x16'),auth['isAuthenticated'](),controller['getContactsCsv']);router['get']('/:id/fields',auth[_0xf27d('0x9')](),controller['getCustomFields']);router[_0xf27d('0xb')](_0xf27d('0x17'),auth[_0xf27d('0x9')](),controller[_0xf27d('0x18')]);router[_0xf27d('0x19')]('/',auth[_0xf27d('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0xf27d('0x9')](),controller['addDisposition']);router[_0xf27d('0x19')]('/:id/contacts',auth[_0xf27d('0x9')](),controller[_0xf27d('0x1a')]);router[_0xf27d('0x19')](_0xf27d('0x1b'),auth['isAuthenticated'](),controller[_0xf27d('0x1c')]);router['post'](_0xf27d('0x17'),auth[_0xf27d('0x9')](),controller['addAgents']);router[_0xf27d('0x1d')](_0xf27d('0x10'),auth['isAuthenticated'](),controller[_0xf27d('0x1e')]);router[_0xf27d('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xf27d('0x1f')]('/:id/dispositions',auth[_0xf27d('0x9')](),controller[_0xf27d('0x20')]);router[_0xf27d('0x1f')](_0xf27d('0x17'),auth[_0xf27d('0x9')](),controller[_0xf27d('0x21')]);module[_0xf27d('0x22')]=router; \ No newline at end of file +var _0x93ea=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer'];(function(_0x25d43e,_0x2f586d){var _0x2115f2=function(_0x11e70a){while(--_0x11e70a){_0x25d43e['push'](_0x25d43e['shift']());}};_0x2115f2(++_0x2f586d);}(_0x93ea,0x131));var _0xa93e=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0x93ea[_0x4ab99];return _0x29e39c;};'use strict';var multer=require(_0xa93e('0x0'));var util=require(_0xa93e('0x1'));var path=require('path');var timeout=require(_0xa93e('0x2'));var express=require(_0xa93e('0x3'));var router=express['Router']();var fs_extra=require(_0xa93e('0x4'));var auth=require(_0xa93e('0x5'));var interaction=require(_0xa93e('0x6'));var config=require(_0xa93e('0x7'));var controller=require(_0xa93e('0x8'));router[_0xa93e('0x9')]('/',auth[_0xa93e('0xa')](),controller[_0xa93e('0xb')]);router[_0xa93e('0x9')](_0xa93e('0xc'),auth[_0xa93e('0xa')](),controller['describe']);router[_0xa93e('0x9')](_0xa93e('0xd'),auth['isAuthenticated'](),controller['getGlobalCustomFields']);router[_0xa93e('0x9')]('/:id',auth[_0xa93e('0xa')](),controller['show']);router[_0xa93e('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa93e('0xe')]);router[_0xa93e('0x9')](_0xa93e('0xf'),auth['isAuthenticated'](),controller[_0xa93e('0x10')]);router[_0xa93e('0x9')](_0xa93e('0x11'),auth[_0xa93e('0xa')](),controller['getContactsCsv']);router[_0xa93e('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0xa93e('0x9')](_0xa93e('0x12'),auth[_0xa93e('0xa')](),controller[_0xa93e('0x13')]);router[_0xa93e('0x14')]('/',auth['isAuthenticated'](),controller[_0xa93e('0x15')]);router[_0xa93e('0x14')](_0xa93e('0x16'),auth['isAuthenticated'](),controller[_0xa93e('0x17')]);router[_0xa93e('0x14')](_0xa93e('0xf'),auth['isAuthenticated'](),controller[_0xa93e('0x18')]);router['post']('/:id/fields',auth[_0xa93e('0xa')](),controller[_0xa93e('0x19')]);router[_0xa93e('0x14')](_0xa93e('0x12'),auth[_0xa93e('0xa')](),controller[_0xa93e('0x1a')]);router[_0xa93e('0x1b')](_0xa93e('0x1c'),auth['isAuthenticated'](),controller[_0xa93e('0x1d')]);router[_0xa93e('0x1e')](_0xa93e('0x1c'),auth[_0xa93e('0xa')](),controller[_0xa93e('0x1f')]);router['delete'](_0xa93e('0x16'),auth[_0xa93e('0xa')](),controller[_0xa93e('0x20')]);router['delete'](_0xa93e('0x12'),auth[_0xa93e('0xa')](),controller[_0xa93e('0x21')]);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 fa89d01..78ac725 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 _0x1f0f=['sequelize','exports','field','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f0f,0x1b8));var _0xf1f0=function(_0x1963c4,_0x57abbe){_0x1963c4=_0x1963c4-0x0;var _0x91ecac=_0x1f0f[_0x1963c4];return _0x91ecac;};'use strict';var Sequelize=require(_0xf1f0('0x0'));module[_0xf1f0('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x280db3){return this['getDataValue'](_0xf1f0('0x2'));}},'field':{'type':Sequelize[_0xf1f0('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xf1f0('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xf1f0('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x99f0=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x192f9e,_0x2f2243){var _0xa4ca85=function(_0x20e383){while(--_0x20e383){_0x192f9e['push'](_0x192f9e['shift']());}};_0xa4ca85(++_0x2f2243);}(_0x99f0,0xb8));var _0x099f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x99f0[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x099f('0x0'));module[_0x099f('0x1')]={'name':{'type':Sequelize[_0x099f('0x2')],'get':function(_0x1cab35){return this[_0x099f('0x3')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x099f('0x4')],'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 5c4a4e7..0131330 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(_0x18c506,_0x41a684){var _0x16d788=function(_0x2f859f){while(--_0x2f859f){_0x18c506['push'](_0x18c506['shift']());}};_0x16d788(++_0x41a684);}(_0x7a54,0x106));var _0x47a5=function(_0x173dce,_0x224f37){_0x173dce=_0x173dce-0x0;var _0xa2506f=_0x7a54[_0x173dce];return _0xa2506f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x500ecf,_0x52a959){var _0x4e97c9=function(_0x5bb5ac){while(--_0x5bb5ac){_0x500ecf['push'](_0x500ecf['shift']());}};_0x4e97c9(++_0x52a959);}(_0x7a54,0x106));var _0x47a5=function(_0x46a582,_0x38b82e){_0x46a582=_0x46a582-0x0;var _0x5465e8=_0x7a54[_0x46a582];return _0x5465e8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 5f7c78c..2f28a33 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 _0xd13e=['rimraf','../../config/environment','exports','define','Condition','util','../../config/logger','moment','request-promise'];(function(_0x993c87,_0x314479){var _0x3806e0=function(_0x5091c2){while(--_0x5091c2){_0x993c87['push'](_0x993c87['shift']());}};_0x3806e0(++_0x314479);}(_0xd13e,0x164));var _0xed13=function(_0x118359,_0x611f0e){_0x118359=_0x118359-0x0;var _0x3e7b79=_0xd13e[_0x118359];return _0x3e7b79;};'use strict';var _=require('lodash');var util=require(_0xed13('0x0'));var logger=require(_0xed13('0x1'))('api');var moment=require(_0xed13('0x2'));var BPromise=require('bluebird');var rp=require(_0xed13('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed13('0x4'));var config=require(_0xed13('0x5'));var attributes=require('./condition.attributes');module[_0xed13('0x6')]=function(_0x4a9f25,_0x48c2a9){return _0x4a9f25[_0xed13('0x7')](_0xed13('0x8'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc01e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','util'];(function(_0x58a600,_0x1f1e79){var _0xc656ef=function(_0x3e5e6b){while(--_0x3e5e6b){_0x58a600['push'](_0x58a600['shift']());}};_0xc656ef(++_0x1f1e79);}(_0xc01e,0x83));var _0xec01=function(_0xf5b5ff,_0x503a3f){_0xf5b5ff=_0xf5b5ff-0x0;var _0x4e032a=_0xc01e[_0xf5b5ff];return _0x4e032a;};'use strict';var _=require('lodash');var util=require(_0xec01('0x0'));var logger=require('../../config/logger')(_0xec01('0x1'));var moment=require(_0xec01('0x2'));var BPromise=require(_0xec01('0x3'));var rp=require(_0xec01('0x4'));var fs=require('fs');var path=require(_0xec01('0x5'));var rimraf=require(_0xec01('0x6'));var config=require(_0xec01('0x7'));var attributes=require(_0xec01('0x8'));module[_0xec01('0x9')]=function(_0x3737bf,_0x328070){return _0x3737bf[_0xec01('0xa')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 567f2b3..61a77dd 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 _0x35a8=['../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x42c876,_0xbc454b){var _0x3d46ef=function(_0x298f17){while(--_0x298f17){_0x42c876['push'](_0x42c876['shift']());}};_0x3d46ef(++_0xbc454b);}(_0x35a8,0xaf));var _0x835a=function(_0x2a7d1c,_0x1994e7){_0x2a7d1c=_0x2a7d1c-0x0;var _0x4b3f8d=_0x35a8[_0x2a7d1c];return _0x4b3f8d;};'use strict';var _=require(_0x835a('0x0'));var util=require(_0x835a('0x1'));var moment=require(_0x835a('0x2'));var BPromise=require('bluebird');var rs=require(_0x835a('0x3'));var fs=require('fs');var Redis=require(_0x835a('0x4'));var db=require(_0x835a('0x5'))['db'];var utils=require(_0x835a('0x6'));var logger=require(_0x835a('0x7'))(_0x835a('0x8'));var config=require(_0x835a('0x9'));var jayson=require(_0x835a('0xa'));var client=jayson[_0x835a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b0cd,_0x3379ce,_0x3f0668){return new BPromise(function(_0x44d4c0,_0x57a6da){return client['request'](_0x48b0cd,_0x3f0668)[_0x835a('0xc')](function(_0x2bf8ef){logger[_0x835a('0xd')](_0x835a('0xe'),_0x3379ce,'request\x20sent');logger[_0x835a('0xf')](_0x835a('0x10'),_0x3379ce,_0x835a('0x11'),JSON[_0x835a('0x12')](_0x2bf8ef));if(_0x2bf8ef[_0x835a('0x13')]){if(_0x2bf8ef[_0x835a('0x13')][_0x835a('0x14')]===0x1f4){logger[_0x835a('0x13')]('Condition,\x20%s,\x20%s',_0x3379ce,_0x2bf8ef[_0x835a('0x13')][_0x835a('0x15')]);return _0x57a6da(_0x2bf8ef[_0x835a('0x13')]['message']);}logger['error'](_0x835a('0xe'),_0x3379ce,_0x2bf8ef[_0x835a('0x13')][_0x835a('0x15')]);return _0x44d4c0(_0x2bf8ef['error'][_0x835a('0x15')]);}else{logger[_0x835a('0xd')](_0x835a('0xe'),_0x3379ce,'request\x20sent');_0x44d4c0(_0x2bf8ef['result'][_0x835a('0x15')]);}})[_0x835a('0x16')](function(_0x33efd2){logger[_0x835a('0x13')]('Condition,\x20%s,\x20%s',_0x3379ce,_0x33efd2);_0x57a6da(_0x33efd2);});});} \ No newline at end of file +var _0xf5e5=['stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x3d7c97,_0x5a68b2){var _0x1a3a5b=function(_0x4886d2){while(--_0x4886d2){_0x3d7c97['push'](_0x3d7c97['shift']());}};_0x1a3a5b(++_0x5a68b2);}(_0xf5e5,0x7d));var _0x5f5e=function(_0x519401,_0x3c39ab){_0x519401=_0x519401-0x0;var _0x11e911=_0xf5e5[_0x519401];return _0x11e911;};'use strict';var _=require('lodash');var util=require(_0x5f5e('0x0'));var moment=require('moment');var BPromise=require(_0x5f5e('0x1'));var rs=require(_0x5f5e('0x2'));var fs=require('fs');var Redis=require(_0x5f5e('0x3'));var db=require(_0x5f5e('0x4'))['db'];var utils=require(_0x5f5e('0x5'));var logger=require('../../config/logger')(_0x5f5e('0x6'));var config=require(_0x5f5e('0x7'));var jayson=require(_0x5f5e('0x8'));var client=jayson[_0x5f5e('0x9')][_0x5f5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e671,_0x3f9232,_0xb8fb35){return new BPromise(function(_0x1452b5,_0x5576f0){return client[_0x5f5e('0xb')](_0x10e671,_0xb8fb35)['then'](function(_0x7d9f0d){logger[_0x5f5e('0xc')](_0x5f5e('0xd'),_0x3f9232,_0x5f5e('0xe'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x3f9232,_0x5f5e('0xe'),JSON[_0x5f5e('0xf')](_0x7d9f0d));if(_0x7d9f0d['error']){if(_0x7d9f0d[_0x5f5e('0x10')][_0x5f5e('0x11')]===0x1f4){logger[_0x5f5e('0x10')](_0x5f5e('0xd'),_0x3f9232,_0x7d9f0d[_0x5f5e('0x10')][_0x5f5e('0x12')]);return _0x5576f0(_0x7d9f0d[_0x5f5e('0x10')]['message']);}logger[_0x5f5e('0x10')](_0x5f5e('0xd'),_0x3f9232,_0x7d9f0d[_0x5f5e('0x10')][_0x5f5e('0x12')]);return _0x1452b5(_0x7d9f0d['error']['message']);}else{logger[_0x5f5e('0xc')](_0x5f5e('0xd'),_0x3f9232,_0x5f5e('0xe'));_0x1452b5(_0x7d9f0d[_0x5f5e('0x13')][_0x5f5e('0x12')]);}})['catch'](function(_0x34b50c){logger[_0x5f5e('0x10')](_0x5f5e('0xd'),_0x3f9232,_0x34b50c);_0x5576f0(_0x34b50c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2669200..d828e95 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 _0x6b12=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','destroy','exports'];(function(_0x265ab5,_0x494f68){var _0x4936de=function(_0x3b95ac){while(--_0x3b95ac){_0x265ab5['push'](_0x265ab5['shift']());}};_0x4936de(++_0x494f68);}(_0x6b12,0x16b));var _0x26b1=function(_0x59f83b,_0x1f9133){_0x59f83b=_0x59f83b-0x0;var _0x2aedb3=_0x6b12[_0x59f83b];return _0x2aedb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x26b1('0x0'));var timeout=require(_0x26b1('0x1'));var express=require(_0x26b1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x26b1('0x3'));var interaction=require(_0x26b1('0x4'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x26b1('0x5')](_0x26b1('0x6'),auth[_0x26b1('0x7')](),controller[_0x26b1('0x8')]);router['delete']('/:id',auth[_0x26b1('0x7')](),controller[_0x26b1('0x9')]);module[_0x26b1('0xa')]=router; \ No newline at end of file +var _0x8dfb=['../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8dfb,0x187));var _0xb8df=function(_0x9a7d08,_0xe9048){_0x9a7d08=_0x9a7d08-0x0;var _0x58e6e8=_0x8dfb[_0x9a7d08];return _0x58e6e8;};'use strict';var multer=require(_0xb8df('0x0'));var util=require('util');var path=require(_0xb8df('0x1'));var timeout=require(_0xb8df('0x2'));var express=require('express');var router=express[_0xb8df('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb8df('0x4'));var config=require(_0xb8df('0x5'));var controller=require(_0xb8df('0x6'));router[_0xb8df('0x7')](_0xb8df('0x8'),auth[_0xb8df('0x9')](),controller[_0xb8df('0xa')]);router['delete']('/:id',auth[_0xb8df('0x9')](),controller[_0xb8df('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index b9455a1..50c4ba2 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 _0x305b=['INTEGER','sequelize','exports','STRING'];(function(_0x2cb642,_0x248ad5){var _0x346dad=function(_0x1905fb){while(--_0x1905fb){_0x2cb642['push'](_0x2cb642['shift']());}};_0x346dad(++_0x248ad5);}(_0x305b,0x81));var _0xb305=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x305b[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xb305('0x0'));module[_0xb305('0x1')]={'name':{'type':Sequelize[_0xb305('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xb305('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb305('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc35f=['exports','STRING','name','sequelize'];(function(_0x3af588,_0x28c263){var _0x46eca2=function(_0x249ea7){while(--_0x249ea7){_0x3af588['push'](_0x3af588['shift']());}};_0x46eca2(++_0x28c263);}(_0xc35f,0x117));var _0xfc35=function(_0x297df7,_0x3e986d){_0x297df7=_0x297df7-0x0;var _0x1e2bf5=_0xc35f[_0x297df7];return _0x1e2bf5;};'use strict';var Sequelize=require(_0xfc35('0x0'));module[_0xfc35('0x1')]={'name':{'type':Sequelize[_0xfc35('0x2')],'allowNull':![],'unique':_0xfc35('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xfc35('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 9724b46..ea2d371 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 _0x5c3c=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','get','destroy','error','stack','name','send','map','ContactItemType','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','findAll','rows','catch','params','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x370a24,_0x27d792){var _0xb0b9b4=function(_0x40ad5e){while(--_0x40ad5e){_0x370a24['push'](_0x370a24['shift']());}};_0xb0b9b4(++_0x27d792);}(_0x5c3c,0x132));var _0xc5c3=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5c3c[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){var _0x23e2fb=_0x38dd9e[_0xc5c3('0x24')]({'plain':!![]});var _0x38a3df='ContactItemTypes';return db['UserProfileResource'][_0xc5c3('0x25')]({'where':{'type':_0x38a3df,'resourceId':_0x23e2fb['id']}})[_0xc5c3('0x23')](function(){return _0x38dd9e;});})[_0xc5c3('0x23')](function(){_0x52d638[_0xc5c3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21efd6,_0x5176c4){return function(_0x2eacec){if(!_0x2eacec){_0x21efd6['sendStatus'](0x194);}return _0x2eacec;};}function handleError(_0x1da259,_0x40d341){_0x40d341=_0x40d341||0x1f4;return function(_0x4269eb){logger[_0xc5c3('0x26')](_0x4269eb[_0xc5c3('0x27')]);if(_0x4269eb[_0xc5c3('0x28')]){delete _0x4269eb[_0xc5c3('0x28')];}_0x1da259['status'](_0x40d341)[_0xc5c3('0x29')](_0x4269eb);};}exports['index']=function(_0xc4b134,_0x43ebfc){var _0x5b26e9={},_0x4daa8b={},_0x2e648f={'count':0x0,'rows':[]};var _0x46f149=_[_0xc5c3('0x2a')](db[_0xc5c3('0x2b')]['rawAttributes'],function(_0x3f9591){return{'name':_0x3f9591[_0xc5c3('0x2c')],'type':_0x3f9591[_0xc5c3('0x2d')][_0xc5c3('0x2e')]};});_0x4daa8b[_0xc5c3('0x2f')]=_[_0xc5c3('0x2a')](_0x46f149,_0xc5c3('0x28'));_0x4daa8b[_0xc5c3('0x30')]=_[_0xc5c3('0x31')](_0xc4b134['query']);_0x4daa8b[_0xc5c3('0x32')]=_[_0xc5c3('0x33')](_0x4daa8b[_0xc5c3('0x2f')],_0x4daa8b[_0xc5c3('0x30')]);_0x5b26e9[_0xc5c3('0x34')]=_[_0xc5c3('0x33')](_0x4daa8b[_0xc5c3('0x2f')],qs['fields'](_0xc4b134['query'][_0xc5c3('0x35')]));_0x5b26e9['attributes']=_0x5b26e9[_0xc5c3('0x34')][_0xc5c3('0x36')]?_0x5b26e9[_0xc5c3('0x34')]:_0x4daa8b[_0xc5c3('0x2f')];if(!_0xc4b134[_0xc5c3('0x30')]['hasOwnProperty'](_0xc5c3('0x37'))){_0x5b26e9[_0xc5c3('0x1a')]=qs['limit'](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x1a')]);_0x5b26e9[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x1c')]);}_0x5b26e9[_0xc5c3('0x38')]=qs[_0xc5c3('0x39')](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x39')]);_0x5b26e9['where']=qs[_0xc5c3('0x32')](_['pick'](_0xc4b134['query'],_0x4daa8b[_0xc5c3('0x32')]),_0x46f149);if(_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x3a')]){_0x5b26e9[_0xc5c3('0x3b')]=_[_0xc5c3('0x3c')](_0x5b26e9['where'],{'$or':_['map'](_0x46f149,function(_0x17e263){if(_0x17e263[_0xc5c3('0x2d')]!=='VIRTUAL'){var _0x3e12ee={};_0x3e12ee[_0x17e263['name']]={'$like':'%'+_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x3a')]+'%'};return _0x3e12ee;}})});}_0x5b26e9=_[_0xc5c3('0x3c')]({},_0x5b26e9,_0xc4b134['options']);var _0xca2b9a={'where':_0x5b26e9[_0xc5c3('0x3b')]};return db['ContactItemType'][_0xc5c3('0x1b')](_0xca2b9a)['then'](function(_0x33936c){_0x2e648f[_0xc5c3('0x1b')]=_0x33936c;if(_0xc4b134['query']['includeAll']){_0x5b26e9['include']=[{'all':!![]}];}return db[_0xc5c3('0x2b')][_0xc5c3('0x3d')](_0x5b26e9);})['then'](function(_0x1a8490){_0x2e648f[_0xc5c3('0x3e')]=_0x1a8490;return _0x2e648f;})[_0xc5c3('0x23')](respondWithFilteredResult(_0x43ebfc,_0x5b26e9))[_0xc5c3('0x3f')](handleError(_0x43ebfc,null));};exports['show']=function(_0x3688a9,_0x523fdf){var _0x585a3b={'raw':!![],'where':{'id':_0x3688a9[_0xc5c3('0x40')]['id']}},_0x1363fa={};_0x1363fa['model']=_[_0xc5c3('0x31')](db[_0xc5c3('0x2b')]['rawAttributes']);_0x1363fa[_0xc5c3('0x30')]=_['keys'](_0x3688a9[_0xc5c3('0x30')]);_0x1363fa[_0xc5c3('0x32')]=_['intersection'](_0x1363fa[_0xc5c3('0x2f')],_0x1363fa['query']);_0x585a3b[_0xc5c3('0x34')]=_[_0xc5c3('0x33')](_0x1363fa['model'],qs[_0xc5c3('0x35')](_0x3688a9[_0xc5c3('0x30')][_0xc5c3('0x35')]));_0x585a3b[_0xc5c3('0x34')]=_0x585a3b[_0xc5c3('0x34')][_0xc5c3('0x36')]?_0x585a3b['attributes']:_0x1363fa[_0xc5c3('0x2f')];if(_0x3688a9[_0xc5c3('0x30')][_0xc5c3('0x41')]){_0x585a3b[_0xc5c3('0x42')]=[{'all':!![]}];}_0x585a3b=_[_0xc5c3('0x3c')]({},_0x585a3b,_0x3688a9['options']);return db['ContactItemType'][_0xc5c3('0x43')](_0x585a3b)[_0xc5c3('0x23')](handleEntityNotFound(_0x523fdf,null))[_0xc5c3('0x23')](respondWithResult(_0x523fdf,null))['catch'](handleError(_0x523fdf,null));};exports[_0xc5c3('0x44')]=function(_0x65f720,_0x3a901f){return db[_0xc5c3('0x2b')][_0xc5c3('0x44')](_0x65f720[_0xc5c3('0x45')],{})[_0xc5c3('0x23')](function(_0x5ac7c8){var _0x259a4d=_0x65f720[_0xc5c3('0x46')][_0xc5c3('0x24')]({'plain':!![]});if(!_0x259a4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259a4d[_0xc5c3('0x47')]===_0xc5c3('0x46')){var _0x3b1bc2=_0x5ac7c8[_0xc5c3('0x24')]({'plain':!![]});var _0x21d480='ContactItemTypes';return db[_0xc5c3('0x48')]['find']({'where':{'name':_0x21d480,'userProfileId':_0x259a4d[_0xc5c3('0x49')]},'raw':!![]})['then'](function(_0x2f7a0a){if(_0x2f7a0a&&_0x2f7a0a[_0xc5c3('0x4a')]===0x0){return db[_0xc5c3('0x4b')][_0xc5c3('0x44')]({'name':_0x3b1bc2[_0xc5c3('0x28')],'resourceId':_0x3b1bc2['id'],'type':_0x2f7a0a['name'],'sectionId':_0x2f7a0a['id']},{})[_0xc5c3('0x23')](function(){return _0x5ac7c8;});}else{return _0x5ac7c8;}})[_0xc5c3('0x3f')](function(_0x348960){logger[_0xc5c3('0x26')](_0xc5c3('0x4c'),_0x348960);throw _0x348960;});}return _0x5ac7c8;})['then'](respondWithResult(_0x3a901f,0xc9))[_0xc5c3('0x3f')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x22')]=function(_0x24ef39,_0x4d1ff8){if(_0x24ef39[_0xc5c3('0x45')]['id']){delete _0x24ef39['body']['id'];}return db['ContactItemType'][_0xc5c3('0x43')]({'where':{'id':_0x24ef39[_0xc5c3('0x40')]['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x4d1ff8,null))[_0xc5c3('0x23')](saveUpdates(_0x24ef39[_0xc5c3('0x45')],null))[_0xc5c3('0x23')](respondWithResult(_0x4d1ff8,null))['catch'](handleError(_0x4d1ff8,null));};exports[_0xc5c3('0x25')]=function(_0x1ad3aa,_0x260f12){return db[_0xc5c3('0x2b')][_0xc5c3('0x43')]({'where':{'id':_0x1ad3aa[_0xc5c3('0x40')]['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x260f12,null))['then'](db['CmContactHasItem'][_0xc5c3('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1ad3aa[_0xc5c3('0x40')]['id']}}))['then'](removeEntity(_0x260f12,null))[_0xc5c3('0x3f')](handleError(_0x260f12,null));}; \ No newline at end of file +var _0xb44a=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContactHasItem','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','error','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0xb44a,0x1c2));var _0xab44=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0xb44a[_0x58de4a];return _0x178820;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){var _0x1d4a2f=_0x43f1c6['get']({'plain':!![]});var _0x2439f3='ContactItemTypes';return db[_0xab44('0x24')]['destroy']({'where':{'type':_0x2439f3,'resourceId':_0x1d4a2f['id']}})['then'](function(){return _0x43f1c6;});})[_0xab44('0x23')](function(){_0x11f0b[_0xab44('0x18')](0xcc)[_0xab44('0x17')]();});}};}function handleEntityNotFound(_0x4620ed,_0x132bf6){return function(_0x4e820c){if(!_0x4e820c){_0x4620ed[_0xab44('0x16')](0x194);}return _0x4e820c;};}function handleError(_0x5587fe,_0x5071f3){_0x5071f3=_0x5071f3||0x1f4;return function(_0x887b0d){logger[_0xab44('0x25')](_0x887b0d[_0xab44('0x26')]);if(_0x887b0d[_0xab44('0x27')]){delete _0x887b0d[_0xab44('0x27')];}_0x5587fe[_0xab44('0x18')](_0x5071f3)['send'](_0x887b0d);};}exports[_0xab44('0x28')]=function(_0x43a42d,_0x36f9b6){var _0x47e1be={},_0x54cac8={},_0x106d3a={'count':0x0,'rows':[]};var _0x5082e4=_['map'](db[_0xab44('0x29')][_0xab44('0x2a')],function(_0x160177){return{'name':_0x160177[_0xab44('0x2b')],'type':_0x160177[_0xab44('0x2c')][_0xab44('0x2d')]};});_0x54cac8[_0xab44('0x2e')]=_[_0xab44('0x2f')](_0x5082e4,_0xab44('0x27'));_0x54cac8[_0xab44('0x30')]=_[_0xab44('0x31')](_0x43a42d[_0xab44('0x30')]);_0x54cac8[_0xab44('0x32')]=_[_0xab44('0x33')](_0x54cac8['model'],_0x54cac8['query']);_0x47e1be[_0xab44('0x34')]=_[_0xab44('0x33')](_0x54cac8['model'],qs[_0xab44('0x35')](_0x43a42d[_0xab44('0x30')][_0xab44('0x35')]));_0x47e1be[_0xab44('0x34')]=_0x47e1be[_0xab44('0x34')][_0xab44('0x36')]?_0x47e1be[_0xab44('0x34')]:_0x54cac8[_0xab44('0x2e')];if(!_0x43a42d[_0xab44('0x30')][_0xab44('0x37')](_0xab44('0x38'))){_0x47e1be[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x43a42d[_0xab44('0x30')][_0xab44('0x1c')]);_0x47e1be[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x43a42d[_0xab44('0x30')]['offset']);}_0x47e1be[_0xab44('0x39')]=qs[_0xab44('0x3a')](_0x43a42d[_0xab44('0x30')][_0xab44('0x3a')]);_0x47e1be['where']=qs[_0xab44('0x32')](_[_0xab44('0x3b')](_0x43a42d[_0xab44('0x30')],_0x54cac8[_0xab44('0x32')]),_0x5082e4);if(_0x43a42d[_0xab44('0x30')]['filter']){_0x47e1be[_0xab44('0x3c')]=_[_0xab44('0x3d')](_0x47e1be[_0xab44('0x3c')],{'$or':_['map'](_0x5082e4,function(_0x3ef5ea){if(_0x3ef5ea[_0xab44('0x2c')]!==_0xab44('0x3e')){var _0xf80acf={};_0xf80acf[_0x3ef5ea[_0xab44('0x27')]]={'$like':'%'+_0x43a42d['query'][_0xab44('0x3f')]+'%'};return _0xf80acf;}})});}_0x47e1be=_['merge']({},_0x47e1be,_0x43a42d[_0xab44('0x40')]);var _0x4f2b94={'where':_0x47e1be['where']};return db['ContactItemType']['count'](_0x4f2b94)['then'](function(_0x120585){_0x106d3a[_0xab44('0x1d')]=_0x120585;if(_0x43a42d[_0xab44('0x30')][_0xab44('0x41')]){_0x47e1be[_0xab44('0x42')]=[{'all':!![]}];}return db[_0xab44('0x29')][_0xab44('0x43')](_0x47e1be);})[_0xab44('0x23')](function(_0x4429e6){_0x106d3a[_0xab44('0x44')]=_0x4429e6;return _0x106d3a;})['then'](respondWithFilteredResult(_0x36f9b6,_0x47e1be))[_0xab44('0x45')](handleError(_0x36f9b6,null));};exports[_0xab44('0x46')]=function(_0x3cb9fc,_0x9a6da5){var _0x54f603={'raw':!![],'where':{'id':_0x3cb9fc[_0xab44('0x47')]['id']}},_0x3e9a79={};_0x3e9a79[_0xab44('0x2e')]=_[_0xab44('0x31')](db[_0xab44('0x29')][_0xab44('0x2a')]);_0x3e9a79['query']=_['keys'](_0x3cb9fc[_0xab44('0x30')]);_0x3e9a79[_0xab44('0x32')]=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],_0x3e9a79[_0xab44('0x30')]);_0x54f603['attributes']=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],qs[_0xab44('0x35')](_0x3cb9fc[_0xab44('0x30')]['fields']));_0x54f603[_0xab44('0x34')]=_0x54f603[_0xab44('0x34')][_0xab44('0x36')]?_0x54f603['attributes']:_0x3e9a79[_0xab44('0x2e')];if(_0x3cb9fc[_0xab44('0x30')][_0xab44('0x41')]){_0x54f603[_0xab44('0x42')]=[{'all':!![]}];}_0x54f603=_['merge']({},_0x54f603,_0x3cb9fc[_0xab44('0x40')]);return db['ContactItemType'][_0xab44('0x48')](_0x54f603)[_0xab44('0x23')](handleEntityNotFound(_0x9a6da5,null))[_0xab44('0x23')](respondWithResult(_0x9a6da5,null))[_0xab44('0x45')](handleError(_0x9a6da5,null));};exports['create']=function(_0x328891,_0x5497a3){return db[_0xab44('0x29')][_0xab44('0x49')](_0x328891[_0xab44('0x4a')],{})[_0xab44('0x23')](function(_0x14bd54){var _0x4eeef0=_0x328891[_0xab44('0x4b')]['get']({'plain':!![]});if(!_0x4eeef0)throw new Error(_0xab44('0x4c'));if(_0x4eeef0[_0xab44('0x4d')]===_0xab44('0x4b')){var _0x50b705=_0x14bd54[_0xab44('0x4e')]({'plain':!![]});var _0x105a89=_0xab44('0x4f');return db[_0xab44('0x50')][_0xab44('0x48')]({'where':{'name':_0x105a89,'userProfileId':_0x4eeef0['userProfileId']},'raw':!![]})['then'](function(_0xe5302b){if(_0xe5302b&&_0xe5302b[_0xab44('0x51')]===0x0){return db[_0xab44('0x24')]['create']({'name':_0x50b705[_0xab44('0x27')],'resourceId':_0x50b705['id'],'type':_0xe5302b[_0xab44('0x27')],'sectionId':_0xe5302b['id']},{})[_0xab44('0x23')](function(){return _0x14bd54;});}else{return _0x14bd54;}})[_0xab44('0x45')](function(_0x4eb2eb){logger['error'](_0xab44('0x52'),_0x4eb2eb);throw _0x4eb2eb;});}return _0x14bd54;})[_0xab44('0x23')](respondWithResult(_0x5497a3,0xc9))[_0xab44('0x45')](handleError(_0x5497a3,null));};exports[_0xab44('0x22')]=function(_0x109f38,_0x2234c0){if(_0x109f38[_0xab44('0x4a')]['id']){delete _0x109f38[_0xab44('0x4a')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x109f38[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x2234c0,null))[_0xab44('0x23')](saveUpdates(_0x109f38[_0xab44('0x4a')],null))[_0xab44('0x23')](respondWithResult(_0x2234c0,null))[_0xab44('0x45')](handleError(_0x2234c0,null));};exports[_0xab44('0x53')]=function(_0x411bac,_0x1e606b){return db['ContactItemType'][_0xab44('0x48')]({'where':{'id':_0x411bac[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x1e606b,null))[_0xab44('0x23')](db[_0xab44('0x54')][_0xab44('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x411bac[_0xab44('0x47')]['id']}}))[_0xab44('0x23')](removeEntity(_0x1e606b,null))['catch'](handleError(_0x1e606b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index d0ef793..79104f5 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 _0x45cb=['./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x329aad,_0x2ac88f){var _0x222a3b=function(_0x2856f1){while(--_0x2856f1){_0x329aad['push'](_0x329aad['shift']());}};_0x222a3b(++_0x2ac88f);}(_0x45cb,0xb8));var _0xb45c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x45cb[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xb45c('0x0'));var util=require(_0xb45c('0x1'));var logger=require(_0xb45c('0x2'))(_0xb45c('0x3'));var moment=require(_0xb45c('0x4'));var BPromise=require(_0xb45c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb45c('0x6'));var rimraf=require('rimraf');var config=require(_0xb45c('0x7'));var attributes=require(_0xb45c('0x8'));module[_0xb45c('0x9')]=function(_0x48b582,_0x59d5ef){return _0x48b582[_0xb45c('0xa')]('ContactItemType',attributes,{'tableName':_0xb45c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x173e=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ContactItemType','lodash'];(function(_0x3b34eb,_0x2da788){var _0x17392f=function(_0x17496e){while(--_0x17496e){_0x3b34eb['push'](_0x3b34eb['shift']());}};_0x17392f(++_0x2da788);}(_0x173e,0xaf));var _0xe173=function(_0x29885a,_0xc575d6){_0x29885a=_0x29885a-0x0;var _0x5d4458=_0x173e[_0x29885a];return _0x5d4458;};'use strict';var _=require(_0xe173('0x0'));var util=require(_0xe173('0x1'));var logger=require(_0xe173('0x2'))(_0xe173('0x3'));var moment=require(_0xe173('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe173('0x5'));var rimraf=require(_0xe173('0x6'));var config=require(_0xe173('0x7'));var attributes=require('./contactItemType.attributes');module[_0xe173('0x8')]=function(_0x3c1134,_0x5595e8){return _0x3c1134[_0xe173('0x9')](_0xe173('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 7bb640d..07d341d 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 _0x2f68=['ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','debug'];(function(_0x4c2f3d,_0x5ac3f0){var _0xf55580=function(_0x1cef74){while(--_0x1cef74){_0x4c2f3d['push'](_0x4c2f3d['shift']());}};_0xf55580(++_0x5ac3f0);}(_0x2f68,0x9a));var _0x82f6=function(_0x141387,_0x57c6cc){_0x141387=_0x141387-0x0;var _0x528ff1=_0x2f68[_0x141387];return _0x528ff1;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});} \ No newline at end of file +var _0xb3f4=['jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3722b3,_0x18a764){var _0x4614ae=function(_0x522c8e){while(--_0x522c8e){_0x3722b3['push'](_0x3722b3['shift']());}};_0x4614ae(++_0x18a764);}(_0xb3f4,0x69));var _0x4b3f=function(_0xeb04d7,_0x594e19){_0xeb04d7=_0xeb04d7-0x0;var _0x2157e3=_0xb3f4[_0xeb04d7];return _0x2157e3;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var moment=require(_0x4b3f('0x2'));var BPromise=require(_0x4b3f('0x3'));var rs=require(_0x4b3f('0x4'));var fs=require('fs');var Redis=require(_0x4b3f('0x5'));var db=require(_0x4b3f('0x6'))['db'];var utils=require(_0x4b3f('0x7'));var logger=require('../../config/logger')(_0x4b3f('0x8'));var config=require(_0x4b3f('0x9'));var jayson=require(_0x4b3f('0xa'));var client=jayson[_0x4b3f('0xb')][_0x4b3f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3317b6,_0x418b93,_0x21ff6e){return new BPromise(function(_0x1d9cfd,_0x4765d1){return client[_0x4b3f('0xd')](_0x3317b6,_0x21ff6e)[_0x4b3f('0xe')](function(_0x18363e){logger['info'](_0x4b3f('0xf'),_0x418b93,_0x4b3f('0x10'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x418b93,'request\x20sent',JSON[_0x4b3f('0x11')](_0x18363e));if(_0x18363e[_0x4b3f('0x12')]){if(_0x18363e[_0x4b3f('0x12')][_0x4b3f('0x13')]===0x1f4){logger[_0x4b3f('0x12')](_0x4b3f('0xf'),_0x418b93,_0x18363e[_0x4b3f('0x12')][_0x4b3f('0x14')]);return _0x4765d1(_0x18363e[_0x4b3f('0x12')][_0x4b3f('0x14')]);}logger[_0x4b3f('0x12')](_0x4b3f('0xf'),_0x418b93,_0x18363e[_0x4b3f('0x12')]['message']);return _0x1d9cfd(_0x18363e[_0x4b3f('0x12')][_0x4b3f('0x14')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x418b93,'request\x20sent');_0x1d9cfd(_0x18363e[_0x4b3f('0x15')][_0x4b3f('0x14')]);}})[_0x4b3f('0x16')](function(_0x26a37f){logger[_0x4b3f('0x12')](_0x4b3f('0xf'),_0x418b93,_0x26a37f);_0x4765d1(_0x26a37f);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index c9a6d8d..86c6115 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 _0x7a2b=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post','put','update','delete','multer','util'];(function(_0x561bd8,_0x2458de){var _0x355db5=function(_0x2d221b){while(--_0x2d221b){_0x561bd8['push'](_0x561bd8['shift']());}};_0x355db5(++_0x2458de);}(_0x7a2b,0xb2));var _0xb7a2=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7a2b[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0xb7a2('0x0'));var util=require(_0xb7a2('0x1'));var path=require(_0xb7a2('0x2'));var timeout=require(_0xb7a2('0x3'));var express=require(_0xb7a2('0x4'));var router=express['Router']();var fs_extra=require(_0xb7a2('0x5'));var auth=require(_0xb7a2('0x6'));var interaction=require(_0xb7a2('0x7'));var config=require(_0xb7a2('0x8'));var controller=require(_0xb7a2('0x9'));router[_0xb7a2('0xa')]('/',auth[_0xb7a2('0xb')](),controller['index']);router['get'](_0xb7a2('0xc'),auth[_0xb7a2('0xb')](),controller[_0xb7a2('0xd')]);router[_0xb7a2('0xe')]('/',auth[_0xb7a2('0xb')](),controller['create']);router[_0xb7a2('0xf')](_0xb7a2('0xc'),auth[_0xb7a2('0xb')](),controller[_0xb7a2('0x10')]);router[_0xb7a2('0x11')](_0xb7a2('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd389=['put','/:id','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','post','create'];(function(_0x3af8fa,_0x183e73){var _0x56808e=function(_0x17af3a){while(--_0x17af3a){_0x3af8fa['push'](_0x3af8fa['shift']());}};_0x56808e(++_0x183e73);}(_0xd389,0xe1));var _0x9d38=function(_0x27815d,_0x10ac7d){_0x27815d=_0x27815d-0x0;var _0x4d4f59=_0xd389[_0x27815d];return _0x4d4f59;};'use strict';var multer=require('multer');var util=require(_0x9d38('0x0'));var path=require('path');var timeout=require(_0x9d38('0x1'));var express=require(_0x9d38('0x2'));var router=express[_0x9d38('0x3')]();var fs_extra=require(_0x9d38('0x4'));var auth=require(_0x9d38('0x5'));var interaction=require(_0x9d38('0x6'));var config=require(_0x9d38('0x7'));var controller=require(_0x9d38('0x8'));router[_0x9d38('0x9')]('/',auth[_0x9d38('0xa')](),controller[_0x9d38('0xb')]);router[_0x9d38('0x9')]('/:id',auth[_0x9d38('0xa')](),controller[_0x9d38('0xc')]);router[_0x9d38('0xd')]('/',auth[_0x9d38('0xa')](),controller[_0x9d38('0xe')]);router[_0x9d38('0xf')](_0x9d38('0x10'),auth[_0x9d38('0xa')](),controller['update']);router[_0x9d38('0x11')](_0x9d38('0x10'),auth[_0x9d38('0xa')](),controller[_0x9d38('0x12')]);module[_0x9d38('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6c1d294..1f98cd9 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x3142d2,_0x8943fa){var _0x1c56f0=function(_0x14bbaa){while(--_0x14bbaa){_0x3142d2['push'](_0x3142d2['shift']());}};_0x1c56f0(++_0x8943fa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x53d1b4,_0x32a040){var _0x246e07=function(_0x3d8b25){while(--_0x3d8b25){_0x53d1b4['push'](_0x53d1b4['shift']());}};_0x246e07(++_0x32a040);}(_0x757a,0xde));var _0xa757=function(_0x218d69,_0x116064){_0x218d69=_0x218d69-0x0;var _0x35f3bb=_0x757a[_0x218d69];return _0x35f3bb;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 5a1cf64..b7bdc33 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 _0xd9ce=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','role','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','type','map','query','filters','intersection','model'];(function(_0x120403,_0x27691f){var _0x272194=function(_0x560136){while(--_0x560136){_0x120403['push'](_0x120403['shift']());}};_0x272194(++_0x27691f);}(_0xd9ce,0x1c0));var _0xed9c=function(_0xa8f776,_0x420cbf){_0xa8f776=_0xa8f776-0x0;var _0x435961=_0xd9ce[_0xa8f776];return _0x435961;};'use strict';var emlformat=require(_0xed9c('0x0'));var rimraf=require(_0xed9c('0x1'));var zipdir=require(_0xed9c('0x2'));var jsonpatch=require(_0xed9c('0x3'));var rp=require(_0xed9c('0x4'));var moment=require(_0xed9c('0x5'));var BPromise=require(_0xed9c('0x6'));var Mustache=require(_0xed9c('0x7'));var util=require(_0xed9c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xed9c('0x9'));var ejs=require(_0xed9c('0xa'));var fs=require('fs');var fs_extra=require(_0xed9c('0xb'));var _=require(_0xed9c('0xc'));var squel=require(_0xed9c('0xd'));var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require(_0xed9c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xed9c('0x11'));var Papa=require(_0xed9c('0x12'));var Redis=require('ioredis');var authService=require(_0xed9c('0x13'));var qs=require(_0xed9c('0x14'));var as=require(_0xed9c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xed9c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xed9c('0x18'))['db'];config['redis']=_[_0xed9c('0x19')](config['redis'],{'host':_0xed9c('0x1a'),'port':0x18eb});var socket=require(_0xed9c('0x1b'))(new Redis(config[_0xed9c('0x1c')]));require(_0xed9c('0x1d'))[_0xed9c('0x1e')](socket);function respondWithStatusCode(_0x8dce52,_0x54118b){_0x54118b=_0x54118b||0xcc;return function(_0x1e0e67){if(_0x1e0e67){return _0x8dce52[_0xed9c('0x1f')](_0x54118b);}return _0x8dce52[_0xed9c('0x20')](_0x54118b)[_0xed9c('0x21')]();};}function respondWithResult(_0x445684,_0x21649c){_0x21649c=_0x21649c||0xc8;return function(_0x2a6d41){if(_0x2a6d41){return _0x445684[_0xed9c('0x20')](_0x21649c)['json'](_0x2a6d41);}};}function respondWithFilteredResult(_0x54770f,_0x12b901){return function(_0x5071b3){if(_0x5071b3){var _0x5a4263=typeof _0x12b901['offset']===_0xed9c('0x22')&&typeof _0x12b901[_0xed9c('0x23')]===_0xed9c('0x22');var _0x4d2904=_0x5071b3[_0xed9c('0x24')];var _0x5c5ad2=_0x5a4263?0x0:_0x12b901[_0xed9c('0x25')];var _0x4d5a54=_0x5a4263?_0x5071b3[_0xed9c('0x24')]:_0x12b901[_0xed9c('0x25')]+_0x12b901[_0xed9c('0x23')];var _0x4f24ab;if(_0x4d5a54>=_0x4d2904){_0x4d5a54=_0x4d2904;_0x4f24ab=0xc8;}else{_0x4f24ab=0xce;}_0x54770f[_0xed9c('0x20')](_0x4f24ab);return _0x54770f['set'](_0xed9c('0x26'),_0x5c5ad2+'-'+_0x4d5a54+'/'+_0x4d2904)[_0xed9c('0x27')](_0x5071b3);}return null;};}function patchUpdates(_0x131ab6){return function(_0x37ddbb){try{jsonpatch[_0xed9c('0x28')](_0x37ddbb,_0x131ab6,!![]);}catch(_0x1ab633){return BPromise['reject'](_0x1ab633);}return _0x37ddbb[_0xed9c('0x29')]();};}function saveUpdates(_0x36c5b9,_0x25aa45){return function(_0x39be4d){if(_0x39be4d){return _0x39be4d[_0xed9c('0x2a')](_0x36c5b9)[_0xed9c('0x2b')](function(_0x1353a8){return _0x1353a8;});}return null;};}function removeEntity(_0x4ddb14,_0x4d96b2){return function(_0x2f200c){if(_0x2f200c){return _0x2f200c[_0xed9c('0x2c')]()[_0xed9c('0x2b')](function(){var _0x37c81f=_0x2f200c['get']({'plain':!![]});var _0x20235c=_0xed9c('0x2d');return db[_0xed9c('0x2e')][_0xed9c('0x2c')]({'where':{'type':_0x20235c,'resourceId':_0x37c81f['id']}})[_0xed9c('0x2b')](function(){return _0x2f200c;});})[_0xed9c('0x2b')](function(){_0x4ddb14[_0xed9c('0x20')](0xcc)[_0xed9c('0x21')]();});}};}function handleEntityNotFound(_0x44f9b3,_0x10d651){return function(_0x3cac4d){if(!_0x3cac4d){_0x44f9b3['sendStatus'](0x194);}return _0x3cac4d;};}function handleError(_0x41aaa7,_0x3eb0ab){_0x3eb0ab=_0x3eb0ab||0x1f4;return function(_0x4ed59f){logger[_0xed9c('0x2f')](_0x4ed59f[_0xed9c('0x30')]);if(_0x4ed59f[_0xed9c('0x31')]){delete _0x4ed59f['name'];}_0x41aaa7['status'](_0x3eb0ab)[_0xed9c('0x32')](_0x4ed59f);};}exports[_0xed9c('0x33')]=function(_0x466d0d,_0x8f8bab){var _0x7dc318={},_0x581b21={},_0x1d37cc={'count':0x0,'rows':[]};var _0x2f6fe8=_['map'](db[_0xed9c('0x34')][_0xed9c('0x35')],function(_0x57360f){return{'name':_0x57360f['fieldName'],'type':_0x57360f[_0xed9c('0x36')]['key']};});_0x581b21['model']=_[_0xed9c('0x37')](_0x2f6fe8,_0xed9c('0x31'));_0x581b21[_0xed9c('0x38')]=_['keys'](_0x466d0d['query']);_0x581b21[_0xed9c('0x39')]=_[_0xed9c('0x3a')](_0x581b21[_0xed9c('0x3b')],_0x581b21[_0xed9c('0x38')]);_0x7dc318['attributes']=_[_0xed9c('0x3a')](_0x581b21['model'],qs[_0xed9c('0x3c')](_0x466d0d[_0xed9c('0x38')][_0xed9c('0x3c')]));_0x7dc318['attributes']=_0x7dc318[_0xed9c('0x3d')][_0xed9c('0x3e')]?_0x7dc318['attributes']:_0x581b21['model'];if(!_0x466d0d[_0xed9c('0x38')][_0xed9c('0x3f')](_0xed9c('0x40'))){_0x7dc318[_0xed9c('0x23')]=qs[_0xed9c('0x23')](_0x466d0d[_0xed9c('0x38')][_0xed9c('0x23')]);_0x7dc318[_0xed9c('0x25')]=qs[_0xed9c('0x25')](_0x466d0d['query']['offset']);}_0x7dc318[_0xed9c('0x41')]=qs['sort'](_0x466d0d[_0xed9c('0x38')][_0xed9c('0x42')]);_0x7dc318[_0xed9c('0x43')]=qs['filters'](_[_0xed9c('0x44')](_0x466d0d[_0xed9c('0x38')],_0x581b21[_0xed9c('0x39')]),_0x2f6fe8);if(_0x466d0d[_0xed9c('0x38')][_0xed9c('0x45')]){_0x7dc318['where']=_['merge'](_0x7dc318['where'],{'$or':_[_0xed9c('0x37')](_0x2f6fe8,function(_0x44fa23){if(_0x44fa23[_0xed9c('0x36')]!=='VIRTUAL'){var _0x17a1f4={};_0x17a1f4[_0x44fa23['name']]={'$like':'%'+_0x466d0d['query'][_0xed9c('0x45')]+'%'};return _0x17a1f4;}})});}_0x7dc318=_[_0xed9c('0x46')]({},_0x7dc318,_0x466d0d[_0xed9c('0x47')]);var _0x10a63d={'where':_0x7dc318['where']};return db[_0xed9c('0x34')][_0xed9c('0x24')](_0x10a63d)[_0xed9c('0x2b')](function(_0x49020b){_0x1d37cc[_0xed9c('0x24')]=_0x49020b;if(_0x466d0d['query'][_0xed9c('0x48')]){_0x7dc318[_0xed9c('0x49')]=[{'all':!![]}];}return db[_0xed9c('0x34')][_0xed9c('0x4a')](_0x7dc318);})[_0xed9c('0x2b')](function(_0x2f6ece){_0x1d37cc[_0xed9c('0x4b')]=_0x2f6ece;return _0x1d37cc;})[_0xed9c('0x2b')](respondWithFilteredResult(_0x8f8bab,_0x7dc318))[_0xed9c('0x4c')](handleError(_0x8f8bab,null));};exports[_0xed9c('0x4d')]=function(_0x29a2c5,_0x3eaa3c){var _0x5aed94={'raw':![],'where':{'id':_0x29a2c5[_0xed9c('0x4e')]['id']}},_0x59bcdb={};_0x59bcdb[_0xed9c('0x3b')]=_[_0xed9c('0x4f')](db['Dashboard'][_0xed9c('0x35')]);_0x59bcdb[_0xed9c('0x38')]=_[_0xed9c('0x4f')](_0x29a2c5[_0xed9c('0x38')]);_0x59bcdb[_0xed9c('0x39')]=_['intersection'](_0x59bcdb[_0xed9c('0x3b')],_0x59bcdb[_0xed9c('0x38')]);_0x5aed94['attributes']=_[_0xed9c('0x3a')](_0x59bcdb['model'],qs['fields'](_0x29a2c5[_0xed9c('0x38')][_0xed9c('0x3c')]));_0x5aed94[_0xed9c('0x3d')]=_0x5aed94[_0xed9c('0x3d')][_0xed9c('0x3e')]?_0x5aed94[_0xed9c('0x3d')]:_0x59bcdb[_0xed9c('0x3b')];if(_0x29a2c5[_0xed9c('0x38')][_0xed9c('0x48')]){_0x5aed94[_0xed9c('0x49')]=[{'all':!![]}];}_0x5aed94=_[_0xed9c('0x46')]({},_0x5aed94,_0x29a2c5[_0xed9c('0x47')]);return db[_0xed9c('0x34')][_0xed9c('0x50')](_0x5aed94)['then'](handleEntityNotFound(_0x3eaa3c,null))[_0xed9c('0x2b')](respondWithResult(_0x3eaa3c,null))[_0xed9c('0x4c')](handleError(_0x3eaa3c,null));};exports[_0xed9c('0x51')]=function(_0x2d37e6,_0x52b66f){return db['Dashboard'][_0xed9c('0x51')](_0x2d37e6['body'],{})[_0xed9c('0x2b')](function(_0x2c1ad4){var _0x331ab2=_0x2d37e6[_0xed9c('0x52')][_0xed9c('0x53')]({'plain':!![]});if(!_0x331ab2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x331ab2['role']===_0xed9c('0x52')){var _0x4e56d1=_0x2c1ad4['get']({'plain':!![]});var _0x544aee='CustomDashboards';return db[_0xed9c('0x54')][_0xed9c('0x50')]({'where':{'name':_0x544aee,'userProfileId':_0x331ab2['userProfileId']},'raw':!![]})[_0xed9c('0x2b')](function(_0x331b16){if(_0x331b16&&_0x331b16[_0xed9c('0x55')]===0x0){return db[_0xed9c('0x2e')]['create']({'name':_0x4e56d1[_0xed9c('0x31')],'resourceId':_0x4e56d1['id'],'type':_0x331b16[_0xed9c('0x31')],'sectionId':_0x331b16['id']},{})[_0xed9c('0x2b')](function(){return _0x2c1ad4;});}else{return _0x2c1ad4;}})[_0xed9c('0x4c')](function(_0x351202){logger[_0xed9c('0x2f')](_0xed9c('0x56'),_0x351202);throw _0x351202;});}return _0x2c1ad4;})[_0xed9c('0x2b')](respondWithResult(_0x52b66f,0xc9))[_0xed9c('0x4c')](handleError(_0x52b66f,null));};exports[_0xed9c('0x57')]=function(_0x20aa89,_0xc003fd){var _0x4daf36={'where':{'id':_0x20aa89[_0xed9c('0x4e')]['id']}},_0x4f0c8c={};_0x4f0c8c['model']=_[_0xed9c('0x4f')](db[_0xed9c('0x34')][_0xed9c('0x35')]);_0x4daf36[_0xed9c('0x3d')]=_['intersection'](_0x4f0c8c[_0xed9c('0x3b')],qs[_0xed9c('0x3c')](_0x20aa89[_0xed9c('0x38')]['fields']));_0x4daf36[_0xed9c('0x3d')]=_0x4daf36[_0xed9c('0x3d')][_0xed9c('0x3e')]?_0x4daf36[_0xed9c('0x3d')]:_0x4f0c8c[_0xed9c('0x3b')];if(_0x20aa89['query'][_0xed9c('0x48')]){_0x4daf36[_0xed9c('0x49')]=[{'all':!![]}];}_0x4daf36=_['merge']({},_0x4daf36,_0x20aa89['options']);return db[_0xed9c('0x34')]['find'](_0x4daf36)[_0xed9c('0x2b')](handleEntityNotFound(_0xc003fd,null))[_0xed9c('0x2b')](function(_0x8b19df){if(_0x8b19df){var _0x18bca6=_0x8b19df[_0xed9c('0x53')]({'plain':!![]});_0x18bca6=qs['omit'](_0x18bca6,['id',_0xed9c('0x58'),_0xed9c('0x59')]);_0x20aa89[_0xed9c('0x5a')]=_[_0xed9c('0x5b')](_0x20aa89[_0xed9c('0x5a')],['id','createdAt',_0xed9c('0x59')]);return db[_0xed9c('0x34')][_0xed9c('0x51')](_[_0xed9c('0x46')](_0x18bca6,_0x20aa89['body']),{'include':_0x20aa89[_0xed9c('0x38')][_0xed9c('0x48')]?[{'all':!![]}]:undefined})[_0xed9c('0x2b')](function(_0xe0a5a4){var _0x4be230=_0x20aa89[_0xed9c('0x52')]['get']({'plain':!![]});if(!_0x4be230)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4be230[_0xed9c('0x5c')]===_0xed9c('0x52')){var _0x3c7d5=_0xe0a5a4[_0xed9c('0x53')]({'plain':!![]});var _0x2b944d=_0xed9c('0x2d');return db[_0xed9c('0x54')][_0xed9c('0x50')]({'where':{'name':_0x2b944d,'userProfileId':_0x4be230[_0xed9c('0x5d')]},'raw':!![]})[_0xed9c('0x2b')](function(_0x29d134){if(_0x29d134&&_0x29d134[_0xed9c('0x55')]===0x0){return db[_0xed9c('0x2e')][_0xed9c('0x51')]({'name':_0x3c7d5[_0xed9c('0x31')],'resourceId':_0x3c7d5['id'],'type':_0x29d134[_0xed9c('0x31')],'sectionId':_0x29d134['id']},{})[_0xed9c('0x2b')](function(){return _0xe0a5a4;});}else{return _0xe0a5a4;}})[_0xed9c('0x4c')](function(_0x1893c7){logger[_0xed9c('0x2f')](_0xed9c('0x56'),_0x1893c7);throw _0x1893c7;});}return _0xe0a5a4;});}})['then'](respondWithResult(_0xc003fd,0xc9))['catch'](handleError(_0xc003fd,null));};exports[_0xed9c('0x2a')]=function(_0x2d1dcf,_0x23c88d){if(_0x2d1dcf[_0xed9c('0x5a')]['id']){delete _0x2d1dcf[_0xed9c('0x5a')]['id'];}return db[_0xed9c('0x34')]['find']({'where':{'id':_0x2d1dcf['params']['id']}})[_0xed9c('0x2b')](handleEntityNotFound(_0x23c88d,null))[_0xed9c('0x2b')](saveUpdates(_0x2d1dcf[_0xed9c('0x5a')],null))['then'](respondWithResult(_0x23c88d,null))[_0xed9c('0x4c')](handleError(_0x23c88d,null));};exports[_0xed9c('0x2c')]=function(_0x11b5c5,_0x3c3595){return db[_0xed9c('0x34')]['find']({'where':{'id':_0x11b5c5[_0xed9c('0x4e')]['id']}})[_0xed9c('0x2b')](handleEntityNotFound(_0x3c3595,null))[_0xed9c('0x2b')](removeEntity(_0x3c3595,null))[_0xed9c('0x4c')](handleError(_0x3c3595,null));};function widgetAttributes(_0x2d660d){try{switch(_0x2d660d[_0xed9c('0x36')]){case'iframe':return[{'name':_0xed9c('0x5e'),'value':_0x2d660d[_0xed9c('0x5e')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d[_0xed9c('0x5f')][0x0][_0xed9c('0x60')]:undefined)||_0xed9c('0x61')}];case _0xed9c('0x62'):return[{'name':_0xed9c('0x63'),'value':_0x2d660d[_0xed9c('0x63')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d['attrs'][0x0]?_0x2d660d['attrs'][0x0][_0xed9c('0x60')]:undefined)||''}];case'clock':return[{'name':_0xed9c('0x64'),'value':_0x2d660d[_0xed9c('0x64')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d['attrs'][0x0][_0xed9c('0x60')]:undefined)||'HH:mm:ss'},{'name':_0xed9c('0x65'),'value':_0x2d660d[_0xed9c('0x65')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x1]?_0x2d660d[_0xed9c('0x5f')][0x1][_0xed9c('0x60')]:undefined)||_0xed9c('0x66')},{'name':'attrFontSize','value':_0x2d660d[_0xed9c('0x67')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x2]?_0x2d660d[_0xed9c('0x5f')][0x2]['value']:undefined)||0xc}];case _0xed9c('0x68'):return[{'name':_0xed9c('0x69'),'value':_0x2d660d[_0xed9c('0x69')]||(_0x2d660d['attrs']&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d[_0xed9c('0x5f')][0x0][_0xed9c('0x60')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2d660d[_0xed9c('0x6a')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x1]?_0x2d660d['attrs'][0x1][_0xed9c('0x60')]:undefined)||[]},{'name':_0xed9c('0x67'),'value':_0x2d660d[_0xed9c('0x67')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x2]?_0x2d660d[_0xed9c('0x5f')][0x2][_0xed9c('0x60')]:undefined)||0x14},{'name':_0xed9c('0x6b'),'value':_0x2d660d[_0xed9c('0x6b')]||(_0x2d660d['attrs']&&_0x2d660d['attrs'][0x3]?_0x2d660d[_0xed9c('0x5f')][0x3][_0xed9c('0x60')]:undefined)||'voice'},{'name':_0xed9c('0x6c'),'value':_0x2d660d[_0xed9c('0x6c')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x4]?_0x2d660d[_0xed9c('0x5f')][0x4][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x6d'),'value':_0x2d660d[_0xed9c('0x6d')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x5]?_0x2d660d[_0xed9c('0x5f')][0x5][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x6e'),'value':_0x2d660d['attrSmsAccounts']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x6]?_0x2d660d[_0xed9c('0x5f')][0x6][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x6f'),'value':_0x2d660d[_0xed9c('0x6f')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x7]?_0x2d660d['attrs'][0x7][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x70'),'value':_0x2d660d[_0xed9c('0x70')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x8]?_0x2d660d[_0xed9c('0x5f')][0x8][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x71'),'value':_0x2d660d['attrChatWebsites']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x9]?_0x2d660d['attrs'][0x9][_0xed9c('0x60')]:undefined)||''}];case _0xed9c('0x72'):case'pie-chart':return[{'name':_0xed9c('0x73'),'value':_0x2d660d[_0xed9c('0x73')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d[_0xed9c('0x5f')][0x0][_0xed9c('0x60')]:undefined)||_0xed9c('0x74')},{'name':'attrSerie2','value':_0x2d660d[_0xed9c('0x75')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x1]?_0x2d660d[_0xed9c('0x5f')][0x1][_0xed9c('0x60')]:undefined)||null},{'name':_0xed9c('0x76'),'value':_0x2d660d['attrSerie3']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x2]?_0x2d660d[_0xed9c('0x5f')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x2d660d['attrVoiceQueues']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d['attrs'][0x3]?_0x2d660d['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x2d660d['attrChannel']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x4]?_0x2d660d[_0xed9c('0x5f')][0x4][_0xed9c('0x60')]:undefined)||'voice'},{'name':_0xed9c('0x6c'),'value':_0x2d660d[_0xed9c('0x6c')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x5]?_0x2d660d[_0xed9c('0x5f')][0x5][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x6d'),'value':_0x2d660d[_0xed9c('0x6d')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d['attrs'][0x6]?_0x2d660d['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2d660d['attrSmsAccounts']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x7]?_0x2d660d[_0xed9c('0x5f')][0x7][_0xed9c('0x60')]:undefined)||''},{'name':_0xed9c('0x6f'),'value':_0x2d660d[_0xed9c('0x6f')]||(_0x2d660d['attrs']&&_0x2d660d[_0xed9c('0x5f')][0x8]?_0x2d660d['attrs'][0x8]['value']:undefined)||''},{'name':_0xed9c('0x70'),'value':_0x2d660d['attrWhatsappAccounts']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x9]?_0x2d660d[_0xed9c('0x5f')][0x9][_0xed9c('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2d660d['attrChatWebsites']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0xa]?_0x2d660d[_0xed9c('0x5f')][0xa][_0xed9c('0x60')]:undefined)||''}];case'web-report':return[{'name':_0xed9c('0x77'),'type':_0x2d660d[_0xed9c('0x78')]||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d[_0xed9c('0x5f')][0x0]['type']:undefined)||null,'value':_0x2d660d['attrReport']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x0]?_0x2d660d[_0xed9c('0x5f')][0x0]['value']:undefined)||null},{'name':_0xed9c('0x79'),'value':_0x2d660d['attrRefresh']||(_0x2d660d[_0xed9c('0x5f')]&&_0x2d660d[_0xed9c('0x5f')][0x1]?_0x2d660d[_0xed9c('0x5f')][0x1][_0xed9c('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x5ce7bb){logger[_0xed9c('0x2f')](_0xed9c('0x7a'),JSON[_0xed9c('0x7b')](_0x5ce7bb));return[];}}exports['addItem']=function(_0x3b52ac,_0x4c21c6,_0x5093f4){if(_0x3b52ac[_0xed9c('0x5a')]['id']){delete _0x3b52ac['body']['id'];}return db[_0xed9c('0x34')]['find']({'where':{'id':_0x3b52ac[_0xed9c('0x4e')]['id']}})[_0xed9c('0x2b')](handleEntityNotFound(_0x4c21c6,null))['then'](function(_0x9e011f){if(_0x9e011f){_0x3b52ac[_0xed9c('0x5a')]['DashboardId']=_0x9e011f['id'];_0x3b52ac[_0xed9c('0x5a')][_0xed9c('0x5f')]=widgetAttributes(_0x3b52ac[_0xed9c('0x5a')]);return db[_0xed9c('0x7c')]['create'](_0x3b52ac[_0xed9c('0x5a')]);}})[_0xed9c('0x2b')](respondWithResult(_0x4c21c6,null))[_0xed9c('0x4c')](handleError(_0x4c21c6,null));};exports[_0xed9c('0x7d')]=function(_0x107255,_0x5d2ea3,_0x7dd8df){var _0x34f35f={};var _0x3cfcfc={};var _0xfd93a4;var _0x2a7feb;return db[_0xed9c('0x34')][_0xed9c('0x7e')]({'where':{'id':_0x107255[_0xed9c('0x4e')]['id']}})[_0xed9c('0x2b')](handleEntityNotFound(_0x5d2ea3,null))[_0xed9c('0x2b')](function(_0x5d0b93){if(_0x5d0b93){_0xfd93a4=_0x5d0b93;_0x3cfcfc[_0xed9c('0x3b')]=_[_0xed9c('0x4f')](db[_0xed9c('0x7c')][_0xed9c('0x35')]);_0x3cfcfc['query']=_[_0xed9c('0x4f')](_0x107255[_0xed9c('0x38')]);_0x3cfcfc[_0xed9c('0x39')]=_[_0xed9c('0x3a')](_0x3cfcfc['model'],_0x3cfcfc[_0xed9c('0x38')]);_0x34f35f[_0xed9c('0x3d')]=_[_0xed9c('0x3a')](_0x3cfcfc[_0xed9c('0x3b')],qs[_0xed9c('0x3c')](_0x107255[_0xed9c('0x38')][_0xed9c('0x3c')]));_0x34f35f['attributes']=_0x34f35f['attributes']['length']?_0x34f35f[_0xed9c('0x3d')]:_0x3cfcfc[_0xed9c('0x3b')];_0x34f35f[_0xed9c('0x41')]=qs['sort'](_0x107255[_0xed9c('0x38')][_0xed9c('0x42')]);_0x34f35f[_0xed9c('0x43')]=qs['filters'](_[_0xed9c('0x44')](_0x107255['query'],_0x3cfcfc[_0xed9c('0x39')]));if(_0x107255[_0xed9c('0x38')][_0xed9c('0x45')]){_0x34f35f[_0xed9c('0x43')]=_[_0xed9c('0x46')](_0x34f35f[_0xed9c('0x43')],{'$or':_[_0xed9c('0x37')](_0x34f35f[_0xed9c('0x3d')],function(_0x501674){var _0xe1a75d={};_0xe1a75d[_0x501674]={'$like':'%'+_0x107255['query']['filter']+'%'};return _0xe1a75d;})});}_0x34f35f=_[_0xed9c('0x46')]({},_0x34f35f,_0x107255['options']);return _0xfd93a4[_0xed9c('0x7d')](_0x34f35f);}})[_0xed9c('0x2b')](function(_0xb71a40){if(_0xb71a40){_0x2a7feb=_0xb71a40[_0xed9c('0x3e')];if(!_0x107255[_0xed9c('0x38')][_0xed9c('0x3f')]('nolimit')){_0x34f35f[_0xed9c('0x23')]=qs['limit'](_0x107255[_0xed9c('0x38')][_0xed9c('0x23')]);_0x34f35f[_0xed9c('0x25')]=qs[_0xed9c('0x25')](_0x107255[_0xed9c('0x38')][_0xed9c('0x25')]);}return _0xfd93a4['getItems'](_0x34f35f);}})[_0xed9c('0x2b')](function(_0xe33da8){if(_0xe33da8){return _0xe33da8?{'count':_0x2a7feb,'rows':_0xe33da8}:null;}})[_0xed9c('0x2b')](respondWithResult(_0x5d2ea3,null))[_0xed9c('0x4c')](handleError(_0x5d2ea3,null));}; \ No newline at end of file +var _0xaef3=['update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','sort','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','UserProfileResource','destroy','name','index','Dashboard','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','CustomDashboards','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xaef3,0xa5));var _0x3aef=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0xaef3[_0x2e58c7];return _0x26eb00;};'use strict';var emlformat=require(_0x3aef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3aef('0x1'));var jsonpatch=require(_0x3aef('0x2'));var rp=require(_0x3aef('0x3'));var moment=require(_0x3aef('0x4'));var BPromise=require(_0x3aef('0x5'));var Mustache=require(_0x3aef('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3aef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3aef('0x8'));var _=require(_0x3aef('0x9'));var squel=require(_0x3aef('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3aef('0xb'));var toCsv=require(_0x3aef('0x7'));var querystring=require(_0x3aef('0xc'));var Papa=require(_0x3aef('0xd'));var Redis=require(_0x3aef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3aef('0xf'));var as=require(_0x3aef('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3aef('0x11'))(_0x3aef('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3aef('0x13'))['db'];config[_0x3aef('0x14')]=_[_0x3aef('0x15')](config['redis'],{'host':_0x3aef('0x16'),'port':0x18eb});var socket=require(_0x3aef('0x17'))(new Redis(config[_0x3aef('0x14')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1de314,_0x1e4da6){_0x1e4da6=_0x1e4da6||0xcc;return function(_0x35850e){if(_0x35850e){return _0x1de314[_0x3aef('0x18')](_0x1e4da6);}return _0x1de314[_0x3aef('0x19')](_0x1e4da6)['end']();};}function respondWithResult(_0x230b6d,_0x29a06b){_0x29a06b=_0x29a06b||0xc8;return function(_0x2b993d){if(_0x2b993d){return _0x230b6d['status'](_0x29a06b)[_0x3aef('0x1a')](_0x2b993d);}};}function respondWithFilteredResult(_0xf31838,_0x1fc9ee){return function(_0x3b8011){if(_0x3b8011){var _0x90a93c=typeof _0x1fc9ee[_0x3aef('0x1b')]===_0x3aef('0x1c')&&typeof _0x1fc9ee['limit']==='undefined';var _0x48f85a=_0x3b8011[_0x3aef('0x1d')];var _0x3d7f82=_0x90a93c?0x0:_0x1fc9ee[_0x3aef('0x1b')];var _0x4958eb=_0x90a93c?_0x3b8011[_0x3aef('0x1d')]:_0x1fc9ee['offset']+_0x1fc9ee[_0x3aef('0x1e')];var _0x13cbb7;if(_0x4958eb>=_0x48f85a){_0x4958eb=_0x48f85a;_0x13cbb7=0xc8;}else{_0x13cbb7=0xce;}_0xf31838['status'](_0x13cbb7);return _0xf31838[_0x3aef('0x1f')](_0x3aef('0x20'),_0x3d7f82+'-'+_0x4958eb+'/'+_0x48f85a)[_0x3aef('0x1a')](_0x3b8011);}return null;};}function patchUpdates(_0x4caa1e){return function(_0x2bea94){try{jsonpatch[_0x3aef('0x21')](_0x2bea94,_0x4caa1e,!![]);}catch(_0x3402dd){return BPromise['reject'](_0x3402dd);}return _0x2bea94[_0x3aef('0x22')]();};}function saveUpdates(_0xc0c2b6,_0x419741){return function(_0x5d904){if(_0x5d904){return _0x5d904['update'](_0xc0c2b6)['then'](function(_0x18b16a){return _0x18b16a;});}return null;};}function removeEntity(_0x1858c9,_0x4b49f3){return function(_0x4d8c75){if(_0x4d8c75){return _0x4d8c75['destroy']()[_0x3aef('0x23')](function(){var _0x23958a=_0x4d8c75['get']({'plain':!![]});var _0x1fe164='CustomDashboards';return db[_0x3aef('0x24')][_0x3aef('0x25')]({'where':{'type':_0x1fe164,'resourceId':_0x23958a['id']}})['then'](function(){return _0x4d8c75;});})['then'](function(){_0x1858c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x98f5c0,_0x1151dd){return function(_0x17a2d5){if(!_0x17a2d5){_0x98f5c0[_0x3aef('0x18')](0x194);}return _0x17a2d5;};}function handleError(_0x39e503,_0x19dc3c){_0x19dc3c=_0x19dc3c||0x1f4;return function(_0x36ca07){logger['error'](_0x36ca07['stack']);if(_0x36ca07['name']){delete _0x36ca07[_0x3aef('0x26')];}_0x39e503[_0x3aef('0x19')](_0x19dc3c)['send'](_0x36ca07);};}exports[_0x3aef('0x27')]=function(_0x12cc8d,_0x39918){var _0x52c3ca={},_0x2c2796={},_0x591fa5={'count':0x0,'rows':[]};var _0x29dc05=_['map'](db[_0x3aef('0x28')]['rawAttributes'],function(_0x3d3155){return{'name':_0x3d3155[_0x3aef('0x29')],'type':_0x3d3155['type'][_0x3aef('0x2a')]};});_0x2c2796[_0x3aef('0x2b')]=_[_0x3aef('0x2c')](_0x29dc05,_0x3aef('0x26'));_0x2c2796[_0x3aef('0x2d')]=_[_0x3aef('0x2e')](_0x12cc8d[_0x3aef('0x2d')]);_0x2c2796[_0x3aef('0x2f')]=_[_0x3aef('0x30')](_0x2c2796[_0x3aef('0x2b')],_0x2c2796[_0x3aef('0x2d')]);_0x52c3ca[_0x3aef('0x31')]=_[_0x3aef('0x30')](_0x2c2796[_0x3aef('0x2b')],qs[_0x3aef('0x32')](_0x12cc8d[_0x3aef('0x2d')][_0x3aef('0x32')]));_0x52c3ca[_0x3aef('0x31')]=_0x52c3ca[_0x3aef('0x31')]['length']?_0x52c3ca[_0x3aef('0x31')]:_0x2c2796['model'];if(!_0x12cc8d[_0x3aef('0x2d')][_0x3aef('0x33')](_0x3aef('0x34'))){_0x52c3ca[_0x3aef('0x1e')]=qs['limit'](_0x12cc8d[_0x3aef('0x2d')]['limit']);_0x52c3ca['offset']=qs[_0x3aef('0x1b')](_0x12cc8d['query'][_0x3aef('0x1b')]);}_0x52c3ca[_0x3aef('0x35')]=qs['sort'](_0x12cc8d[_0x3aef('0x2d')]['sort']);_0x52c3ca[_0x3aef('0x36')]=qs[_0x3aef('0x2f')](_[_0x3aef('0x37')](_0x12cc8d[_0x3aef('0x2d')],_0x2c2796[_0x3aef('0x2f')]),_0x29dc05);if(_0x12cc8d[_0x3aef('0x2d')][_0x3aef('0x38')]){_0x52c3ca[_0x3aef('0x36')]=_[_0x3aef('0x39')](_0x52c3ca[_0x3aef('0x36')],{'$or':_[_0x3aef('0x2c')](_0x29dc05,function(_0x16acfe){if(_0x16acfe['type']!=='VIRTUAL'){var _0x3f2907={};_0x3f2907[_0x16acfe[_0x3aef('0x26')]]={'$like':'%'+_0x12cc8d['query']['filter']+'%'};return _0x3f2907;}})});}_0x52c3ca=_[_0x3aef('0x39')]({},_0x52c3ca,_0x12cc8d[_0x3aef('0x3a')]);var _0x3dfc8b={'where':_0x52c3ca[_0x3aef('0x36')]};return db[_0x3aef('0x28')][_0x3aef('0x1d')](_0x3dfc8b)[_0x3aef('0x23')](function(_0x2018fa){_0x591fa5['count']=_0x2018fa;if(_0x12cc8d[_0x3aef('0x2d')][_0x3aef('0x3b')]){_0x52c3ca[_0x3aef('0x3c')]=[{'all':!![]}];}return db[_0x3aef('0x28')][_0x3aef('0x3d')](_0x52c3ca);})[_0x3aef('0x23')](function(_0x3e2d2b){_0x591fa5[_0x3aef('0x3e')]=_0x3e2d2b;return _0x591fa5;})[_0x3aef('0x23')](respondWithFilteredResult(_0x39918,_0x52c3ca))[_0x3aef('0x3f')](handleError(_0x39918,null));};exports[_0x3aef('0x40')]=function(_0x2fd654,_0x5e7ad1){var _0x485fc3={'raw':![],'where':{'id':_0x2fd654[_0x3aef('0x41')]['id']}},_0x48a792={};_0x48a792[_0x3aef('0x2b')]=_['keys'](db[_0x3aef('0x28')]['rawAttributes']);_0x48a792[_0x3aef('0x2d')]=_[_0x3aef('0x2e')](_0x2fd654[_0x3aef('0x2d')]);_0x48a792[_0x3aef('0x2f')]=_[_0x3aef('0x30')](_0x48a792[_0x3aef('0x2b')],_0x48a792[_0x3aef('0x2d')]);_0x485fc3[_0x3aef('0x31')]=_['intersection'](_0x48a792['model'],qs[_0x3aef('0x32')](_0x2fd654[_0x3aef('0x2d')][_0x3aef('0x32')]));_0x485fc3[_0x3aef('0x31')]=_0x485fc3[_0x3aef('0x31')][_0x3aef('0x42')]?_0x485fc3[_0x3aef('0x31')]:_0x48a792[_0x3aef('0x2b')];if(_0x2fd654[_0x3aef('0x2d')][_0x3aef('0x3b')]){_0x485fc3[_0x3aef('0x3c')]=[{'all':!![]}];}_0x485fc3=_[_0x3aef('0x39')]({},_0x485fc3,_0x2fd654[_0x3aef('0x3a')]);return db[_0x3aef('0x28')]['find'](_0x485fc3)[_0x3aef('0x23')](handleEntityNotFound(_0x5e7ad1,null))['then'](respondWithResult(_0x5e7ad1,null))[_0x3aef('0x3f')](handleError(_0x5e7ad1,null));};exports[_0x3aef('0x43')]=function(_0x1def19,_0x148db6){return db[_0x3aef('0x28')][_0x3aef('0x43')](_0x1def19[_0x3aef('0x44')],{})[_0x3aef('0x23')](function(_0x3379ab){var _0x5543d7=_0x1def19[_0x3aef('0x45')][_0x3aef('0x46')]({'plain':!![]});if(!_0x5543d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5543d7['role']===_0x3aef('0x45')){var _0x58ce92=_0x3379ab[_0x3aef('0x46')]({'plain':!![]});var _0x2044c4=_0x3aef('0x47');return db[_0x3aef('0x48')][_0x3aef('0x49')]({'where':{'name':_0x2044c4,'userProfileId':_0x5543d7[_0x3aef('0x4a')]},'raw':!![]})[_0x3aef('0x23')](function(_0x30bd06){if(_0x30bd06&&_0x30bd06[_0x3aef('0x4b')]===0x0){return db[_0x3aef('0x24')][_0x3aef('0x43')]({'name':_0x58ce92['name'],'resourceId':_0x58ce92['id'],'type':_0x30bd06['name'],'sectionId':_0x30bd06['id']},{})[_0x3aef('0x23')](function(){return _0x3379ab;});}else{return _0x3379ab;}})[_0x3aef('0x3f')](function(_0x4df8c5){logger[_0x3aef('0x4c')](_0x3aef('0x4d'),_0x4df8c5);throw _0x4df8c5;});}return _0x3379ab;})[_0x3aef('0x23')](respondWithResult(_0x148db6,0xc9))[_0x3aef('0x3f')](handleError(_0x148db6,null));};exports[_0x3aef('0x4e')]=function(_0xa5a8bc,_0x467d2c){var _0x1e98f5={'where':{'id':_0xa5a8bc[_0x3aef('0x41')]['id']}},_0xf4d8d6={};_0xf4d8d6[_0x3aef('0x2b')]=_[_0x3aef('0x2e')](db['Dashboard'][_0x3aef('0x4f')]);_0x1e98f5[_0x3aef('0x31')]=_[_0x3aef('0x30')](_0xf4d8d6[_0x3aef('0x2b')],qs[_0x3aef('0x32')](_0xa5a8bc[_0x3aef('0x2d')]['fields']));_0x1e98f5[_0x3aef('0x31')]=_0x1e98f5['attributes']['length']?_0x1e98f5[_0x3aef('0x31')]:_0xf4d8d6[_0x3aef('0x2b')];if(_0xa5a8bc[_0x3aef('0x2d')][_0x3aef('0x3b')]){_0x1e98f5[_0x3aef('0x3c')]=[{'all':!![]}];}_0x1e98f5=_[_0x3aef('0x39')]({},_0x1e98f5,_0xa5a8bc[_0x3aef('0x3a')]);return db[_0x3aef('0x28')]['find'](_0x1e98f5)[_0x3aef('0x23')](handleEntityNotFound(_0x467d2c,null))[_0x3aef('0x23')](function(_0x4a9971){if(_0x4a9971){var _0x92b064=_0x4a9971[_0x3aef('0x46')]({'plain':!![]});_0x92b064=qs[_0x3aef('0x50')](_0x92b064,['id',_0x3aef('0x51'),_0x3aef('0x52')]);_0xa5a8bc[_0x3aef('0x44')]=_[_0x3aef('0x50')](_0xa5a8bc[_0x3aef('0x44')],['id','createdAt',_0x3aef('0x52')]);return db[_0x3aef('0x28')][_0x3aef('0x43')](_['merge'](_0x92b064,_0xa5a8bc[_0x3aef('0x44')]),{'include':_0xa5a8bc[_0x3aef('0x2d')][_0x3aef('0x3b')]?[{'all':!![]}]:undefined})[_0x3aef('0x23')](function(_0x2de7d4){var _0x4e5a59=_0xa5a8bc[_0x3aef('0x45')][_0x3aef('0x46')]({'plain':!![]});if(!_0x4e5a59)throw new Error(_0x3aef('0x53'));if(_0x4e5a59[_0x3aef('0x54')]==='user'){var _0x779391=_0x2de7d4[_0x3aef('0x46')]({'plain':!![]});var _0x3e4a03=_0x3aef('0x47');return db[_0x3aef('0x48')][_0x3aef('0x49')]({'where':{'name':_0x3e4a03,'userProfileId':_0x4e5a59[_0x3aef('0x4a')]},'raw':!![]})['then'](function(_0x56f777){if(_0x56f777&&_0x56f777[_0x3aef('0x4b')]===0x0){return db['UserProfileResource'][_0x3aef('0x43')]({'name':_0x779391[_0x3aef('0x26')],'resourceId':_0x779391['id'],'type':_0x56f777[_0x3aef('0x26')],'sectionId':_0x56f777['id']},{})[_0x3aef('0x23')](function(){return _0x2de7d4;});}else{return _0x2de7d4;}})[_0x3aef('0x3f')](function(_0x5b60f1){logger[_0x3aef('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b60f1);throw _0x5b60f1;});}return _0x2de7d4;});}})[_0x3aef('0x23')](respondWithResult(_0x467d2c,0xc9))[_0x3aef('0x3f')](handleError(_0x467d2c,null));};exports[_0x3aef('0x55')]=function(_0x28a58a,_0x48a59a){if(_0x28a58a[_0x3aef('0x44')]['id']){delete _0x28a58a['body']['id'];}return db['Dashboard'][_0x3aef('0x49')]({'where':{'id':_0x28a58a[_0x3aef('0x41')]['id']}})['then'](handleEntityNotFound(_0x48a59a,null))[_0x3aef('0x23')](saveUpdates(_0x28a58a['body'],null))['then'](respondWithResult(_0x48a59a,null))[_0x3aef('0x3f')](handleError(_0x48a59a,null));};exports[_0x3aef('0x25')]=function(_0x4cc4ba,_0x5912fd){return db[_0x3aef('0x28')]['find']({'where':{'id':_0x4cc4ba[_0x3aef('0x41')]['id']}})['then'](handleEntityNotFound(_0x5912fd,null))[_0x3aef('0x23')](removeEntity(_0x5912fd,null))[_0x3aef('0x3f')](handleError(_0x5912fd,null));};function widgetAttributes(_0x2bc9f6){try{switch(_0x2bc9f6['type']){case _0x3aef('0x56'):return[{'name':_0x3aef('0x57'),'value':_0x2bc9f6[_0x3aef('0x57')]||(_0x2bc9f6['attrs']&&_0x2bc9f6[_0x3aef('0x58')][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0][_0x3aef('0x59')]:undefined)||_0x3aef('0x5a')}];case _0x3aef('0x5b'):return[{'name':_0x3aef('0x5c'),'value':_0x2bc9f6[_0x3aef('0x5c')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0][_0x3aef('0x59')]:undefined)||''}];case _0x3aef('0x5d'):return[{'name':_0x3aef('0x5e'),'value':_0x2bc9f6[_0x3aef('0x5e')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6['attrs'][0x0]?_0x2bc9f6['attrs'][0x0][_0x3aef('0x59')]:undefined)||_0x3aef('0x5f')},{'name':_0x3aef('0x60'),'value':_0x2bc9f6['attrTimezone']||(_0x2bc9f6['attrs']&&_0x2bc9f6[_0x3aef('0x58')][0x1]?_0x2bc9f6['attrs'][0x1][_0x3aef('0x59')]:undefined)||_0x3aef('0x61')},{'name':_0x3aef('0x62'),'value':_0x2bc9f6[_0x3aef('0x62')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x2]?_0x2bc9f6[_0x3aef('0x58')][0x2]['value']:undefined)||0xc}];case _0x3aef('0x63'):return[{'name':_0x3aef('0x64'),'value':_0x2bc9f6[_0x3aef('0x64')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0][_0x3aef('0x59')]:undefined)||_0x3aef('0x65')},{'name':'attrVoiceQueues','value':_0x2bc9f6[_0x3aef('0x66')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x1]?_0x2bc9f6[_0x3aef('0x58')][0x1]['value']:undefined)||[]},{'name':_0x3aef('0x62'),'value':_0x2bc9f6[_0x3aef('0x62')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6['attrs'][0x2]?_0x2bc9f6[_0x3aef('0x58')][0x2]['value']:undefined)||0x14},{'name':_0x3aef('0x67'),'value':_0x2bc9f6[_0x3aef('0x67')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6['attrs'][0x3]?_0x2bc9f6['attrs'][0x3][_0x3aef('0x59')]:undefined)||_0x3aef('0x68')},{'name':_0x3aef('0x69'),'value':_0x2bc9f6['attrEmailAccounts']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x4]?_0x2bc9f6[_0x3aef('0x58')][0x4][_0x3aef('0x59')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2bc9f6[_0x3aef('0x6a')]||(_0x2bc9f6['attrs']&&_0x2bc9f6[_0x3aef('0x58')][0x5]?_0x2bc9f6[_0x3aef('0x58')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2bc9f6['attrSmsAccounts']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x6]?_0x2bc9f6[_0x3aef('0x58')][0x6]['value']:undefined)||''},{'name':_0x3aef('0x6b'),'value':_0x2bc9f6[_0x3aef('0x6b')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x7]?_0x2bc9f6[_0x3aef('0x58')][0x7][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x6c'),'value':_0x2bc9f6[_0x3aef('0x6c')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x8]?_0x2bc9f6['attrs'][0x8][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x6d'),'value':_0x2bc9f6[_0x3aef('0x6d')]||(_0x2bc9f6['attrs']&&_0x2bc9f6[_0x3aef('0x58')][0x9]?_0x2bc9f6[_0x3aef('0x58')][0x9][_0x3aef('0x59')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x3aef('0x6e'),'value':_0x2bc9f6['attrSerie1']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0][_0x3aef('0x59')]:undefined)||'total'},{'name':_0x3aef('0x6f'),'value':_0x2bc9f6[_0x3aef('0x6f')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x1]?_0x2bc9f6[_0x3aef('0x58')][0x1]['value']:undefined)||null},{'name':_0x3aef('0x70'),'value':_0x2bc9f6[_0x3aef('0x70')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x2]?_0x2bc9f6['attrs'][0x2][_0x3aef('0x59')]:undefined)||null},{'name':_0x3aef('0x66'),'value':_0x2bc9f6[_0x3aef('0x66')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x3]?_0x2bc9f6['attrs'][0x3][_0x3aef('0x59')]:undefined)||[]},{'name':_0x3aef('0x67'),'value':_0x2bc9f6['attrChannel']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x4]?_0x2bc9f6['attrs'][0x4][_0x3aef('0x59')]:undefined)||_0x3aef('0x68')},{'name':_0x3aef('0x69'),'value':_0x2bc9f6['attrEmailAccounts']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6['attrs'][0x5]?_0x2bc9f6[_0x3aef('0x58')][0x5][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x6a'),'value':_0x2bc9f6[_0x3aef('0x6a')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x6]?_0x2bc9f6[_0x3aef('0x58')][0x6][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x71'),'value':_0x2bc9f6['attrSmsAccounts']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x7]?_0x2bc9f6[_0x3aef('0x58')][0x7][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x6b'),'value':_0x2bc9f6[_0x3aef('0x6b')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x8]?_0x2bc9f6[_0x3aef('0x58')][0x8]['value']:undefined)||''},{'name':_0x3aef('0x6c'),'value':_0x2bc9f6[_0x3aef('0x6c')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x9]?_0x2bc9f6[_0x3aef('0x58')][0x9][_0x3aef('0x59')]:undefined)||''},{'name':_0x3aef('0x6d'),'value':_0x2bc9f6[_0x3aef('0x6d')]||(_0x2bc9f6['attrs']&&_0x2bc9f6['attrs'][0xa]?_0x2bc9f6[_0x3aef('0x58')][0xa][_0x3aef('0x59')]:undefined)||''}];case _0x3aef('0x72'):return[{'name':_0x3aef('0x73'),'type':_0x2bc9f6[_0x3aef('0x74')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6['attrs'][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0]['type']:undefined)||null,'value':_0x2bc9f6[_0x3aef('0x73')]||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x0]?_0x2bc9f6[_0x3aef('0x58')][0x0][_0x3aef('0x59')]:undefined)||null},{'name':'attrRefresh','value':_0x2bc9f6['attrRefresh']||(_0x2bc9f6[_0x3aef('0x58')]&&_0x2bc9f6[_0x3aef('0x58')][0x1]?_0x2bc9f6[_0x3aef('0x58')][0x1][_0x3aef('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x4272bd){logger['error'](_0x3aef('0x75'),JSON[_0x3aef('0x76')](_0x4272bd));return[];}}exports[_0x3aef('0x77')]=function(_0x300787,_0x55b40a,_0x15f92e){if(_0x300787[_0x3aef('0x44')]['id']){delete _0x300787['body']['id'];}return db[_0x3aef('0x28')][_0x3aef('0x49')]({'where':{'id':_0x300787[_0x3aef('0x41')]['id']}})['then'](handleEntityNotFound(_0x55b40a,null))[_0x3aef('0x23')](function(_0x1afe8c){if(_0x1afe8c){_0x300787['body'][_0x3aef('0x78')]=_0x1afe8c['id'];_0x300787[_0x3aef('0x44')][_0x3aef('0x58')]=widgetAttributes(_0x300787['body']);return db[_0x3aef('0x79')][_0x3aef('0x43')](_0x300787[_0x3aef('0x44')]);}})[_0x3aef('0x23')](respondWithResult(_0x55b40a,null))['catch'](handleError(_0x55b40a,null));};exports[_0x3aef('0x7a')]=function(_0x3816f7,_0x16bc80,_0x23decd){var _0x4ec4de={};var _0x1a0282={};var _0x5115e9;var _0x17a2e3;return db['Dashboard'][_0x3aef('0x7b')]({'where':{'id':_0x3816f7[_0x3aef('0x41')]['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x16bc80,null))[_0x3aef('0x23')](function(_0x43b9d4){if(_0x43b9d4){_0x5115e9=_0x43b9d4;_0x1a0282[_0x3aef('0x2b')]=_[_0x3aef('0x2e')](db['DashboardItem']['rawAttributes']);_0x1a0282[_0x3aef('0x2d')]=_[_0x3aef('0x2e')](_0x3816f7[_0x3aef('0x2d')]);_0x1a0282[_0x3aef('0x2f')]=_[_0x3aef('0x30')](_0x1a0282['model'],_0x1a0282['query']);_0x4ec4de[_0x3aef('0x31')]=_[_0x3aef('0x30')](_0x1a0282[_0x3aef('0x2b')],qs[_0x3aef('0x32')](_0x3816f7[_0x3aef('0x2d')][_0x3aef('0x32')]));_0x4ec4de[_0x3aef('0x31')]=_0x4ec4de[_0x3aef('0x31')][_0x3aef('0x42')]?_0x4ec4de[_0x3aef('0x31')]:_0x1a0282['model'];_0x4ec4de['order']=qs[_0x3aef('0x7c')](_0x3816f7[_0x3aef('0x2d')][_0x3aef('0x7c')]);_0x4ec4de[_0x3aef('0x36')]=qs['filters'](_['pick'](_0x3816f7[_0x3aef('0x2d')],_0x1a0282['filters']));if(_0x3816f7[_0x3aef('0x2d')][_0x3aef('0x38')]){_0x4ec4de[_0x3aef('0x36')]=_[_0x3aef('0x39')](_0x4ec4de[_0x3aef('0x36')],{'$or':_[_0x3aef('0x2c')](_0x4ec4de[_0x3aef('0x31')],function(_0x15e323){var _0x13de22={};_0x13de22[_0x15e323]={'$like':'%'+_0x3816f7[_0x3aef('0x2d')]['filter']+'%'};return _0x13de22;})});}_0x4ec4de=_[_0x3aef('0x39')]({},_0x4ec4de,_0x3816f7[_0x3aef('0x3a')]);return _0x5115e9[_0x3aef('0x7a')](_0x4ec4de);}})[_0x3aef('0x23')](function(_0x21c6f0){if(_0x21c6f0){_0x17a2e3=_0x21c6f0[_0x3aef('0x42')];if(!_0x3816f7[_0x3aef('0x2d')][_0x3aef('0x33')](_0x3aef('0x34'))){_0x4ec4de[_0x3aef('0x1e')]=qs[_0x3aef('0x1e')](_0x3816f7[_0x3aef('0x2d')][_0x3aef('0x1e')]);_0x4ec4de[_0x3aef('0x1b')]=qs[_0x3aef('0x1b')](_0x3816f7[_0x3aef('0x2d')]['offset']);}return _0x5115e9[_0x3aef('0x7a')](_0x4ec4de);}})[_0x3aef('0x23')](function(_0x2b2630){if(_0x2b2630){return _0x2b2630?{'count':_0x17a2e3,'rows':_0x2b2630}:null;}})[_0x3aef('0x23')](respondWithResult(_0x16bc80,null))[_0x3aef('0x3f')](handleError(_0x16bc80,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1208cca..db36741 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 _0xc00e=['hook','events','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x594701,_0x24cc33){var _0x5ca88f=function(_0x1ed82d){while(--_0x1ed82d){_0x594701['push'](_0x594701['shift']());}};_0x5ca88f(++_0x24cc33);}(_0xc00e,0xe1));var _0xec00=function(_0x501b6e,_0x5cda59){_0x501b6e=_0x501b6e-0x0;var _0x30fda8=_0xc00e[_0x501b6e];return _0x30fda8;};'use strict';var EventEmitter=require(_0xec00('0x0'));var Dashboard=require(_0xec00('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec00('0x2'),'afterUpdate':_0xec00('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5f370c){return function(_0x220520,_0x4ef140,_0x1015f1){DashboardEvents[_0xec00('0x4')](_0x5f370c+':'+_0x220520['id'],_0x220520);DashboardEvents[_0xec00('0x4')](_0x5f370c,_0x220520);_0x1015f1(null);};}for(var e in events){if(events[_0xec00('0x5')](e)){var event=events[e];Dashboard[_0xec00('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xe1f5=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x6822ce,_0x5f0f96){var _0xd92f58=function(_0x4335ab){while(--_0x4335ab){_0x6822ce['push'](_0x6822ce['shift']());}};_0xd92f58(++_0x5f0f96);}(_0xe1f5,0x1ec));var _0x5e1f=function(_0x541311,_0x451176){_0x541311=_0x541311-0x0;var _0x22f256=_0xe1f5[_0x541311];return _0x22f256;};'use strict';var EventEmitter=require(_0x5e1f('0x0'));var Dashboard=require(_0x5e1f('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e1f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e1f('0x3'),'afterDestroy':_0x5e1f('0x4')};function emitEvent(_0x299e6f){return function(_0x699087,_0x5730f1,_0xbf7d60){DashboardEvents[_0x5e1f('0x5')](_0x299e6f+':'+_0x699087['id'],_0x699087);DashboardEvents[_0x5e1f('0x5')](_0x299e6f,_0x699087);_0xbf7d60(null);};}for(var e in events){if(events[_0x5e1f('0x6')](e)){var event=events[e];Dashboard[_0x5e1f('0x7')](e,emitEvent(event));}}module[_0x5e1f('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index ce73681..40ee8ac 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 _0xd355=['./dashboard.attributes','exports','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x236906,_0x1c2803){var _0x21199e=function(_0x5eb347){while(--_0x5eb347){_0x236906['push'](_0x236906['shift']());}};_0x21199e(++_0x1c2803);}(_0xd355,0x1dd));var _0x5d35=function(_0x274584,_0x501942){_0x274584=_0x274584-0x0;var _0x3a068=_0xd355[_0x274584];return _0x3a068;};'use strict';var _=require(_0x5d35('0x0'));var util=require('util');var logger=require(_0x5d35('0x1'))(_0x5d35('0x2'));var moment=require(_0x5d35('0x3'));var BPromise=require(_0x5d35('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d35('0x5'));var rimraf=require(_0x5d35('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d35('0x7'));module[_0x5d35('0x8')]=function(_0x3532c5,_0x115fc8){return _0x3532c5['define'](_0x5d35('0x9'),attributes,{'tableName':_0x5d35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf403=['path','rimraf','../../config/environment','define','Dashboard','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x376e90,_0x1bd639){var _0x53395c=function(_0x1dc244){while(--_0x1dc244){_0x376e90['push'](_0x376e90['shift']());}};_0x53395c(++_0x1bd639);}(_0xf403,0x1d3));var _0x3f40=function(_0x250c34,_0x22f4e6){_0x250c34=_0x250c34-0x0;var _0x82d1d=_0xf403[_0x250c34];return _0x82d1d;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var logger=require(_0x3f40('0x1'))(_0x3f40('0x2'));var moment=require(_0x3f40('0x3'));var BPromise=require(_0x3f40('0x4'));var rp=require(_0x3f40('0x5'));var fs=require('fs');var path=require(_0x3f40('0x6'));var rimraf=require(_0x3f40('0x7'));var config=require(_0x3f40('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x33f742,_0x22d5e6){return _0x33f742[_0x3f40('0x9')](_0x3f40('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 108fd96..493ff16 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 _0x41e9=['socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x32f7c8,_0x552a11){var _0x488d57=function(_0x3fc170){while(--_0x3fc170){_0x32f7c8['push'](_0x32f7c8['shift']());}};_0x488d57(++_0x552a11);}(_0x41e9,0x99));var _0x941e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x41e9[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x941e('0x0'));var util=require(_0x941e('0x1'));var moment=require(_0x941e('0x2'));var BPromise=require(_0x941e('0x3'));var rs=require(_0x941e('0x4'));var fs=require('fs');var Redis=require(_0x941e('0x5'));var db=require(_0x941e('0x6'))['db'];var utils=require(_0x941e('0x7'));var logger=require(_0x941e('0x8'))('rpc');var config=require(_0x941e('0x9'));var jayson=require(_0x941e('0xa'));var client=jayson['client'][_0x941e('0xb')]({'port':0x232a});config[_0x941e('0xc')]=_[_0x941e('0xd')](config[_0x941e('0xc')],{'host':_0x941e('0xe'),'port':0x18eb});var socket=require(_0x941e('0xf'))(new Redis(config[_0x941e('0xc')]));require(_0x941e('0x10'))[_0x941e('0x11')](socket);function respondWithRpcPromise(_0x14b138,_0x17b4a9,_0x2afc89){return new BPromise(function(_0x104c71,_0x4e4252){return client[_0x941e('0x12')](_0x14b138,_0x2afc89)[_0x941e('0x13')](function(_0x4bbdec){logger[_0x941e('0x14')]('Dashboard,\x20%s,\x20%s',_0x17b4a9,_0x941e('0x15'));logger['debug'](_0x941e('0x16'),_0x17b4a9,_0x941e('0x15'),JSON['stringify'](_0x4bbdec));if(_0x4bbdec['error']){if(_0x4bbdec[_0x941e('0x17')][_0x941e('0x18')]===0x1f4){logger['error'](_0x941e('0x19'),_0x17b4a9,_0x4bbdec[_0x941e('0x17')][_0x941e('0x1a')]);return _0x4e4252(_0x4bbdec[_0x941e('0x17')][_0x941e('0x1a')]);}logger[_0x941e('0x17')]('Dashboard,\x20%s,\x20%s',_0x17b4a9,_0x4bbdec[_0x941e('0x17')][_0x941e('0x1a')]);return _0x104c71(_0x4bbdec[_0x941e('0x17')][_0x941e('0x1a')]);}else{logger[_0x941e('0x14')](_0x941e('0x19'),_0x17b4a9,_0x941e('0x15'));_0x104c71(_0x4bbdec['result']['message']);}})[_0x941e('0x1b')](function(_0x111365){logger[_0x941e('0x17')](_0x941e('0x19'),_0x17b4a9,_0x111365);_0x4e4252(_0x111365);});});} \ No newline at end of file +var _0x575f=['error','message','result','catch','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','code'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x575f,0x18a));var _0xf575=function(_0xd17fc8,_0x4ea958){_0xd17fc8=_0xd17fc8-0x0;var _0x5ce429=_0x575f[_0xd17fc8];return _0x5ce429;};'use strict';var _=require('lodash');var util=require(_0xf575('0x0'));var moment=require(_0xf575('0x1'));var BPromise=require(_0xf575('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf575('0x3'))(_0xf575('0x4'));var config=require(_0xf575('0x5'));var jayson=require(_0xf575('0x6'));var client=jayson[_0xf575('0x7')][_0xf575('0x8')]({'port':0x232a});config[_0xf575('0x9')]=_[_0xf575('0xa')](config['redis'],{'host':_0xf575('0xb'),'port':0x18eb});var socket=require(_0xf575('0xc'))(new Redis(config[_0xf575('0x9')]));require('./dashboard.socket')[_0xf575('0xd')](socket);function respondWithRpcPromise(_0x141ac2,_0x280eef,_0xf465ee){return new BPromise(function(_0xae364e,_0x3f2382){return client[_0xf575('0xe')](_0x141ac2,_0xf465ee)[_0xf575('0xf')](function(_0x1c6219){logger[_0xf575('0x10')](_0xf575('0x11'),_0x280eef,_0xf575('0x12'));logger[_0xf575('0x13')](_0xf575('0x14'),_0x280eef,_0xf575('0x12'),JSON['stringify'](_0x1c6219));if(_0x1c6219['error']){if(_0x1c6219['error'][_0xf575('0x15')]===0x1f4){logger['error'](_0xf575('0x11'),_0x280eef,_0x1c6219[_0xf575('0x16')][_0xf575('0x17')]);return _0x3f2382(_0x1c6219[_0xf575('0x16')][_0xf575('0x17')]);}logger[_0xf575('0x16')]('Dashboard,\x20%s,\x20%s',_0x280eef,_0x1c6219['error'][_0xf575('0x17')]);return _0xae364e(_0x1c6219['error'][_0xf575('0x17')]);}else{logger[_0xf575('0x10')](_0xf575('0x11'),_0x280eef,_0xf575('0x12'));_0xae364e(_0x1c6219[_0xf575('0x18')][_0xf575('0x17')]);}})[_0xf575('0x19')](function(_0x1c42c9){logger[_0xf575('0x16')]('Dashboard,\x20%s,\x20%s',_0x280eef,_0x1c42c9);_0x3f2382(_0x1c42c9);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6644788..0531489 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 _0xd796=['emit','removeListener','register','length','dashboard:','./dashboard.events','remove','update'];(function(_0x47b1a1,_0x13c095){var _0x35eb80=function(_0x5b4d2a){while(--_0x5b4d2a){_0x47b1a1['push'](_0x47b1a1['shift']());}};_0x35eb80(++_0x13c095);}(_0xd796,0x135));var _0x6d79=function(_0x5b6020,_0x5ddb48){_0x5b6020=_0x5b6020-0x0;var _0xb7ef55=_0xd796[_0x5b6020];return _0xb7ef55;};'use strict';var DashboardEvents=require(_0x6d79('0x0'));var events=['save',_0x6d79('0x1'),_0x6d79('0x2')];function createListener(_0x6af48b,_0x5d0cc9){return function(_0x202c47){_0x5d0cc9[_0x6d79('0x3')](_0x6af48b,_0x202c47);};}function removeListener(_0x3f7389,_0xbddeb7){return function(){DashboardEvents[_0x6d79('0x4')](_0x3f7389,_0xbddeb7);};}exports[_0x6d79('0x5')]=function(_0x5c28fb){for(var _0x33decd=0x0,_0x248026=events[_0x6d79('0x6')];_0x33decd<_0x248026;_0x33decd++){var _0x6babb4=events[_0x33decd];var _0x80a6db=createListener(_0x6d79('0x7')+_0x6babb4,_0x5c28fb);DashboardEvents['on'](_0x6babb4,_0x80a6db);}}; \ No newline at end of file +var _0x19fc=['./dashboard.events','save','remove','update','register','length'];(function(_0x15c10d,_0x247c0c){var _0x5c6871=function(_0x15d38a){while(--_0x15d38a){_0x15c10d['push'](_0x15c10d['shift']());}};_0x5c6871(++_0x247c0c);}(_0x19fc,0x174));var _0xc19f=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x19fc[_0x1a7846];return _0x48049;};'use strict';var DashboardEvents=require(_0xc19f('0x0'));var events=[_0xc19f('0x1'),_0xc19f('0x2'),_0xc19f('0x3')];function createListener(_0x4ed0ac,_0x4637e0){return function(_0x2ae4a7){_0x4637e0['emit'](_0x4ed0ac,_0x2ae4a7);};}function removeListener(_0x28328b,_0x327bb2){return function(){DashboardEvents['removeListener'](_0x28328b,_0x327bb2);};}exports[_0xc19f('0x4')]=function(_0x3fece7){for(var _0x3469d5=0x0,_0x3db080=events[_0xc19f('0x5')];_0x3469d5<_0x3db080;_0x3469d5++){var _0x3a6b93=events[_0x3469d5];var _0x4e719c=createListener('dashboard:'+_0x3a6b93,_0x3fece7);DashboardEvents['on'](_0x3a6b93,_0x4e719c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index df7fae9..f2c3c42 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 _0x60b8=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','clone','addItem','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60b8,0x159));var _0x860b=function(_0x2f5740,_0x2f099a){_0x2f5740=_0x2f5740-0x0;var _0x4a3b86=_0x60b8[_0x2f5740];return _0x4a3b86;};'use strict';var multer=require('multer');var util=require(_0x860b('0x0'));var path=require(_0x860b('0x1'));var timeout=require(_0x860b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x860b('0x3'));var auth=require(_0x860b('0x4'));var interaction=require(_0x860b('0x5'));var config=require(_0x860b('0x6'));var controller=require(_0x860b('0x7'));router[_0x860b('0x8')]('/',auth[_0x860b('0x9')](),controller[_0x860b('0xa')]);router[_0x860b('0x8')](_0x860b('0xb'),auth[_0x860b('0x9')](),controller[_0x860b('0xc')]);router[_0x860b('0x8')](_0x860b('0xd'),auth[_0x860b('0x9')](),controller[_0x860b('0xe')]);router[_0x860b('0xf')]('/',auth[_0x860b('0x9')](),controller['create']);router[_0x860b('0xf')]('/:id/clone',auth[_0x860b('0x9')](),controller[_0x860b('0x10')]);router['post'](_0x860b('0xd'),auth[_0x860b('0x9')](),controller[_0x860b('0x11')]);router[_0x860b('0x12')](_0x860b('0xb'),auth[_0x860b('0x9')](),controller[_0x860b('0x13')]);router[_0x860b('0x14')]('/:id',auth[_0x860b('0x9')](),controller[_0x860b('0x15')]);module[_0x860b('0x16')]=router; \ No newline at end of file +var _0xe3c1=['./dashboard.controller','get','/:id','isAuthenticated','show','getItems','post','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe3c1,0x148));var _0x1e3c=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xe3c1[_0xc69f39];return _0x93be41;};'use strict';var multer=require(_0x1e3c('0x0'));var util=require(_0x1e3c('0x1'));var path=require(_0x1e3c('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e3c('0x3'));var router=express[_0x1e3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1e3c('0x5'));var interaction=require(_0x1e3c('0x6'));var config=require(_0x1e3c('0x7'));var controller=require(_0x1e3c('0x8'));router[_0x1e3c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e3c('0x9')](_0x1e3c('0xa'),auth[_0x1e3c('0xb')](),controller[_0x1e3c('0xc')]);router[_0x1e3c('0x9')]('/:id/items',auth[_0x1e3c('0xb')](),controller[_0x1e3c('0xd')]);router[_0x1e3c('0xe')]('/',auth[_0x1e3c('0xb')](),controller['create']);router[_0x1e3c('0xe')](_0x1e3c('0xf'),auth[_0x1e3c('0xb')](),controller[_0x1e3c('0x10')]);router[_0x1e3c('0xe')](_0x1e3c('0x11'),auth[_0x1e3c('0xb')](),controller[_0x1e3c('0x12')]);router[_0x1e3c('0x13')](_0x1e3c('0xa'),auth[_0x1e3c('0xb')](),controller[_0x1e3c('0x14')]);router[_0x1e3c('0x15')](_0x1e3c('0xa'),auth['isAuthenticated'](),controller[_0x1e3c('0x16')]);module[_0x1e3c('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 282acbd..9605663 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 _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x1add90,_0x5465f7){var _0x1a246a=function(_0x142a3c){while(--_0x142a3c){_0x1add90['push'](_0x1add90['shift']());}};_0x1a246a(++_0x5465f7);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x40d9f1,_0x4fea73){_0x40d9f1=_0x40d9f1-0x0;var _0x15bc07=_0xc6ac[_0x40d9f1];return _0x15bc07;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x5af16a,_0x122cd8){var _0x363560=function(_0x492528){while(--_0x492528){_0x5af16a['push'](_0x5af16a['shift']());}};_0x363560(++_0x122cd8);}(_0x687b,0x14a));var _0xb687=function(_0x3ef1dc,_0x210a81){_0x3ef1dc=_0x3ef1dc-0x0;var _0x151f5f=_0x687b[_0x3ef1dc];return _0x151f5f;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'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 d770523..243c581 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 _0x872a=['destroy','error','name','send','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x872a,0x100));var _0xa872=function(_0x52e145,_0x12083d){_0x52e145=_0x52e145-0x0;var _0x396255=_0x872a[_0x52e145];return _0x396255;};'use strict';var emlformat=require(_0xa872('0x0'));var rimraf=require(_0xa872('0x1'));var zipdir=require(_0xa872('0x2'));var jsonpatch=require(_0xa872('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa872('0x4'));var util=require(_0xa872('0x5'));var path=require(_0xa872('0x6'));var sox=require(_0xa872('0x7'));var csv=require(_0xa872('0x8'));var ejs=require(_0xa872('0x9'));var fs=require('fs');var fs_extra=require(_0xa872('0xa'));var _=require('lodash');var squel=require(_0xa872('0xb'));var crypto=require(_0xa872('0xc'));var jsforce=require(_0xa872('0xd'));var deskjs=require(_0xa872('0xe'));var toCsv=require(_0xa872('0x8'));var querystring=require(_0xa872('0xf'));var Papa=require(_0xa872('0x10'));var Redis=require(_0xa872('0x11'));var authService=require(_0xa872('0x12'));var qs=require(_0xa872('0x13'));var as=require(_0xa872('0x14'));var hardwareService=require(_0xa872('0x15'));var logger=require(_0xa872('0x16'))(_0xa872('0x17'));var utils=require('../../config/utils');var config=require(_0xa872('0x18'));var licenseUtil=require(_0xa872('0x19'));var db=require(_0xa872('0x1a'))['db'];config['redis']=_[_0xa872('0x1b')](config[_0xa872('0x1c')],{'host':_0xa872('0x1d'),'port':0x18eb});var socket=require(_0xa872('0x1e'))(new Redis(config[_0xa872('0x1c')]));require('./dashboardItem.socket')[_0xa872('0x1f')](socket);function respondWithStatusCode(_0x5cd621,_0x3f1bd6){_0x3f1bd6=_0x3f1bd6||0xcc;return function(_0x2cb82e){if(_0x2cb82e){return _0x5cd621[_0xa872('0x20')](_0x3f1bd6);}return _0x5cd621[_0xa872('0x21')](_0x3f1bd6)['end']();};}function respondWithResult(_0x2619b1,_0xb8c0a2){_0xb8c0a2=_0xb8c0a2||0xc8;return function(_0x54a74e){if(_0x54a74e){return _0x2619b1[_0xa872('0x21')](_0xb8c0a2)[_0xa872('0x22')](_0x54a74e);}};}function respondWithFilteredResult(_0x3f5dc6,_0x5d68e4){return function(_0xa61ab3){if(_0xa61ab3){var _0x377107=typeof _0x5d68e4[_0xa872('0x23')]===_0xa872('0x24')&&typeof _0x5d68e4[_0xa872('0x25')]==='undefined';var _0x26cc07=_0xa61ab3['count'];var _0x28adef=_0x377107?0x0:_0x5d68e4['offset'];var _0x382146=_0x377107?_0xa61ab3['count']:_0x5d68e4[_0xa872('0x23')]+_0x5d68e4['limit'];var _0xe589b5;if(_0x382146>=_0x26cc07){_0x382146=_0x26cc07;_0xe589b5=0xc8;}else{_0xe589b5=0xce;}_0x3f5dc6[_0xa872('0x21')](_0xe589b5);return _0x3f5dc6['set'](_0xa872('0x26'),_0x28adef+'-'+_0x382146+'/'+_0x26cc07)[_0xa872('0x22')](_0xa61ab3);}return null;};}function patchUpdates(_0x5ad012){return function(_0x346466){try{jsonpatch[_0xa872('0x27')](_0x346466,_0x5ad012,!![]);}catch(_0x1b24f7){return BPromise[_0xa872('0x28')](_0x1b24f7);}return _0x346466[_0xa872('0x29')]();};}function saveUpdates(_0x28db80,_0x24c301){return function(_0x562988){if(_0x562988){return _0x562988[_0xa872('0x2a')](_0x28db80)[_0xa872('0x2b')](function(_0x28876a){return _0x28876a;});}return null;};}function removeEntity(_0x180dfb,_0x2cc427){return function(_0x2024ac){if(_0x2024ac){return _0x2024ac[_0xa872('0x2c')]()['then'](function(){_0x180dfb[_0xa872('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd475,_0x4053c0){return function(_0x1e24c7){if(!_0x1e24c7){_0x1dd475['sendStatus'](0x194);}return _0x1e24c7;};}function handleError(_0x149f8d,_0x7c7f13){_0x7c7f13=_0x7c7f13||0x1f4;return function(_0x25322d){logger[_0xa872('0x2d')](_0x25322d['stack']);if(_0x25322d[_0xa872('0x2e')]){delete _0x25322d['name'];}_0x149f8d['status'](_0x7c7f13)[_0xa872('0x2f')](_0x25322d);};}exports['show']=function(_0x215a61,_0x408bdf){var _0x45131d={'raw':![],'where':{'id':_0x215a61[_0xa872('0x30')]['id']}},_0x252831={};_0x252831['model']=_[_0xa872('0x31')](db[_0xa872('0x32')][_0xa872('0x33')]);_0x252831['query']=_[_0xa872('0x31')](_0x215a61[_0xa872('0x34')]);_0x252831[_0xa872('0x35')]=_[_0xa872('0x36')](_0x252831[_0xa872('0x37')],_0x252831[_0xa872('0x34')]);_0x45131d['attributes']=_[_0xa872('0x36')](_0x252831[_0xa872('0x37')],qs[_0xa872('0x38')](_0x215a61[_0xa872('0x34')]['fields']));_0x45131d[_0xa872('0x39')]=_0x45131d[_0xa872('0x39')][_0xa872('0x3a')]?_0x45131d[_0xa872('0x39')]:_0x252831[_0xa872('0x37')];if(_0x215a61[_0xa872('0x34')][_0xa872('0x3b')]){_0x45131d[_0xa872('0x3c')]=[{'all':!![]}];}_0x45131d=_[_0xa872('0x3d')]({},_0x45131d,_0x215a61[_0xa872('0x3e')]);return db[_0xa872('0x32')][_0xa872('0x3f')](_0x45131d)[_0xa872('0x2b')](handleEntityNotFound(_0x408bdf,null))[_0xa872('0x2b')](respondWithResult(_0x408bdf,null))[_0xa872('0x40')](handleError(_0x408bdf,null));};exports[_0xa872('0x2c')]=function(_0x2dfaff,_0x1e0d39){return db[_0xa872('0x32')]['find']({'where':{'id':_0x2dfaff['params']['id']}})['then'](handleEntityNotFound(_0x1e0d39,null))['then'](removeEntity(_0x1e0d39,null))[_0xa872('0x40')](handleError(_0x1e0d39,null));};function widgetAttributes(_0x113c70){try{switch(_0x113c70[_0xa872('0x41')]){case'iframe':return[{'name':_0xa872('0x42'),'value':_0x113c70[_0xa872('0x42')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||'https://'}];case _0xa872('0x45'):return[{'name':_0xa872('0x46'),'value':_0x113c70[_0xa872('0x46')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x47'):return[{'name':_0xa872('0x48'),'value':_0x113c70[_0xa872('0x48')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x49')},{'name':_0xa872('0x4a'),'value':_0x113c70['attrTimezone']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70['attrs'][0x1]['value']:undefined)||_0xa872('0x4b')},{'name':_0xa872('0x4c'),'value':_0x113c70[_0xa872('0x4c')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x2]?_0x113c70[_0xa872('0x43')][0x2][_0xa872('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0xa872('0x4d'),'value':_0x113c70['attrMetric']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x4e')},{'name':_0xa872('0x4f'),'value':_0x113c70[_0xa872('0x4f')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1]['value']:undefined)||[]},{'name':_0xa872('0x4c'),'value':_0x113c70['attrFontSize']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x2]?_0x113c70['attrs'][0x2][_0xa872('0x44')]:undefined)||0x14},{'name':_0xa872('0x50'),'value':_0x113c70['attrChannel']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x3]?_0x113c70[_0xa872('0x43')][0x3][_0xa872('0x44')]:undefined)||_0xa872('0x51')},{'name':'attrEmailAccounts','value':_0x113c70[_0xa872('0x52')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x4]?_0x113c70['attrs'][0x4][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x53'),'value':_0x113c70['attrFaxAccounts']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x5]?_0x113c70[_0xa872('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x113c70[_0xa872('0x54')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x6]?_0x113c70['attrs'][0x6][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x55'),'value':_0x113c70['attrOpenchannelAccounts']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x7]?_0x113c70['attrs'][0x7][_0xa872('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x113c70[_0xa872('0x56')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x8]?_0x113c70[_0xa872('0x43')][0x8][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x57'),'value':_0x113c70[_0xa872('0x57')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x9]?_0x113c70[_0xa872('0x43')][0x9][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x58'):case _0xa872('0x59'):return[{'name':_0xa872('0x5a'),'value':_0x113c70[_0xa872('0x5a')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x4e')},{'name':_0xa872('0x5b'),'value':_0x113c70['attrSerie2']||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1][_0xa872('0x44')]:undefined)||null},{'name':_0xa872('0x5c'),'value':_0x113c70[_0xa872('0x5c')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x2]?_0x113c70[_0xa872('0x43')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x113c70[_0xa872('0x4f')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x3]?_0x113c70[_0xa872('0x43')][0x3][_0xa872('0x44')]:undefined)||[]},{'name':_0xa872('0x50'),'value':_0x113c70[_0xa872('0x50')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x4]?_0x113c70['attrs'][0x4][_0xa872('0x44')]:undefined)||_0xa872('0x51')},{'name':_0xa872('0x52'),'value':_0x113c70[_0xa872('0x52')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x5]?_0x113c70['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x113c70[_0xa872('0x53')]||(_0x113c70['attrs']&&_0x113c70['attrs'][0x6]?_0x113c70[_0xa872('0x43')][0x6][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x54'),'value':_0x113c70[_0xa872('0x54')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x7]?_0x113c70[_0xa872('0x43')][0x7][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x55'),'value':_0x113c70[_0xa872('0x55')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x8]?_0x113c70[_0xa872('0x43')][0x8][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x56'),'value':_0x113c70[_0xa872('0x56')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x9]?_0x113c70[_0xa872('0x43')][0x9][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x57'),'value':_0x113c70[_0xa872('0x57')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0xa]?_0x113c70['attrs'][0xa][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x5d'):return[{'name':_0xa872('0x5e'),'type':_0x113c70[_0xa872('0x5f')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x41')]:undefined)||null,'value':_0x113c70['attrReport']||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||null},{'name':_0xa872('0x60'),'value':_0x113c70[_0xa872('0x60')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1][_0xa872('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x2f0403){logger[_0xa872('0x2d')]('widgetAttributes:\x20%s',JSON[_0xa872('0x61')](_0x2f0403));return[];}}exports['create']=function(_0x361739,_0x63b1a4){if(_0x361739[_0xa872('0x62')]){_0x361739[_0xa872('0x62')]['attrs']=widgetAttributes(_0x361739[_0xa872('0x62')]);}return db[_0xa872('0x32')][_0xa872('0x63')](_0x361739['body'],{})[_0xa872('0x2b')](respondWithResult(_0x63b1a4,0xc9))['catch'](handleError(_0x63b1a4,null));};exports[_0xa872('0x2a')]=function(_0x21a20b,_0x229ca4){if(_0x21a20b[_0xa872('0x62')]['id']){delete _0x21a20b[_0xa872('0x62')]['id'];}_0x21a20b[_0xa872('0x62')][_0xa872('0x43')]=widgetAttributes(_0x21a20b[_0xa872('0x62')]);return db[_0xa872('0x32')][_0xa872('0x3f')]({'where':{'id':_0x21a20b[_0xa872('0x30')]['id']}})[_0xa872('0x2b')](handleEntityNotFound(_0x229ca4,null))['then'](saveUpdates(_0x21a20b[_0xa872('0x62')],null))['then'](respondWithResult(_0x229ca4,null))[_0xa872('0x40')](handleError(_0x229ca4,null));}; \ No newline at end of file +var _0x9206=['util','path','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','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','show','params','model','keys','query','filters','intersection','attributes','includeAll','include','merge','options','DashboardItem','find','catch','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x416475,_0x456304){var _0x111146=function(_0x1793bd){while(--_0x1793bd){_0x416475['push'](_0x416475['shift']());}};_0x111146(++_0x456304);}(_0x9206,0x176));var _0x6920=function(_0x9cbf6e,_0x73457b){_0x9cbf6e=_0x9cbf6e-0x0;var _0x17f6c0=_0x9206[_0x9cbf6e];return _0x17f6c0;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];config['redis']=_['defaults'](config[_0x6920('0x1a')],{'host':_0x6920('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6920('0x1a')]));require(_0x6920('0x1c'))[_0x6920('0x1d')](socket);function respondWithStatusCode(_0x2c3a35,_0x17c6e9){_0x17c6e9=_0x17c6e9||0xcc;return function(_0x4b39c4){if(_0x4b39c4){return _0x2c3a35[_0x6920('0x1e')](_0x17c6e9);}return _0x2c3a35[_0x6920('0x1f')](_0x17c6e9)[_0x6920('0x20')]();};}function respondWithResult(_0xa64034,_0x289b73){_0x289b73=_0x289b73||0xc8;return function(_0x3e94ee){if(_0x3e94ee){return _0xa64034[_0x6920('0x1f')](_0x289b73)[_0x6920('0x21')](_0x3e94ee);}};}function respondWithFilteredResult(_0x11ce91,_0x2d04e7){return function(_0x462500){if(_0x462500){var _0x3d0059=typeof _0x2d04e7[_0x6920('0x22')]===_0x6920('0x23')&&typeof _0x2d04e7[_0x6920('0x24')]==='undefined';var _0x3a0c0c=_0x462500[_0x6920('0x25')];var _0x377e25=_0x3d0059?0x0:_0x2d04e7[_0x6920('0x22')];var _0xf4b5bd=_0x3d0059?_0x462500[_0x6920('0x25')]:_0x2d04e7[_0x6920('0x22')]+_0x2d04e7[_0x6920('0x24')];var _0xaf93ba;if(_0xf4b5bd>=_0x3a0c0c){_0xf4b5bd=_0x3a0c0c;_0xaf93ba=0xc8;}else{_0xaf93ba=0xce;}_0x11ce91[_0x6920('0x1f')](_0xaf93ba);return _0x11ce91[_0x6920('0x26')](_0x6920('0x27'),_0x377e25+'-'+_0xf4b5bd+'/'+_0x3a0c0c)[_0x6920('0x21')](_0x462500);}return null;};}function patchUpdates(_0x2dd788){return function(_0x1f68c5){try{jsonpatch[_0x6920('0x28')](_0x1f68c5,_0x2dd788,!![]);}catch(_0x1ae686){return BPromise[_0x6920('0x29')](_0x1ae686);}return _0x1f68c5[_0x6920('0x2a')]();};}function saveUpdates(_0x258986,_0x51cb24){return function(_0x1996f1){if(_0x1996f1){return _0x1996f1['update'](_0x258986)[_0x6920('0x2b')](function(_0x4dd08b){return _0x4dd08b;});}return null;};}function removeEntity(_0x72316a,_0x32a6ae){return function(_0x23e4cd){if(_0x23e4cd){return _0x23e4cd[_0x6920('0x2c')]()['then'](function(){_0x72316a[_0x6920('0x1f')](0xcc)[_0x6920('0x20')]();});}};}function handleEntityNotFound(_0x305129,_0x1ae78f){return function(_0x72e8bc){if(!_0x72e8bc){_0x305129[_0x6920('0x1e')](0x194);}return _0x72e8bc;};}function handleError(_0xdcc5e3,_0x38d0f6){_0x38d0f6=_0x38d0f6||0x1f4;return function(_0x400894){logger[_0x6920('0x2d')](_0x400894[_0x6920('0x2e')]);if(_0x400894[_0x6920('0x2f')]){delete _0x400894['name'];}_0xdcc5e3[_0x6920('0x1f')](_0x38d0f6)['send'](_0x400894);};}exports[_0x6920('0x30')]=function(_0x49534b,_0x31aa90){var _0x25e7ff={'raw':![],'where':{'id':_0x49534b[_0x6920('0x31')]['id']}},_0x595dfe={};_0x595dfe[_0x6920('0x32')]=_[_0x6920('0x33')](db['DashboardItem']['rawAttributes']);_0x595dfe[_0x6920('0x34')]=_['keys'](_0x49534b['query']);_0x595dfe[_0x6920('0x35')]=_[_0x6920('0x36')](_0x595dfe[_0x6920('0x32')],_0x595dfe[_0x6920('0x34')]);_0x25e7ff[_0x6920('0x37')]=_[_0x6920('0x36')](_0x595dfe[_0x6920('0x32')],qs['fields'](_0x49534b[_0x6920('0x34')]['fields']));_0x25e7ff[_0x6920('0x37')]=_0x25e7ff['attributes']['length']?_0x25e7ff[_0x6920('0x37')]:_0x595dfe[_0x6920('0x32')];if(_0x49534b[_0x6920('0x34')][_0x6920('0x38')]){_0x25e7ff[_0x6920('0x39')]=[{'all':!![]}];}_0x25e7ff=_[_0x6920('0x3a')]({},_0x25e7ff,_0x49534b[_0x6920('0x3b')]);return db[_0x6920('0x3c')][_0x6920('0x3d')](_0x25e7ff)[_0x6920('0x2b')](handleEntityNotFound(_0x31aa90,null))[_0x6920('0x2b')](respondWithResult(_0x31aa90,null))[_0x6920('0x3e')](handleError(_0x31aa90,null));};exports['destroy']=function(_0x2a69d3,_0x4c56be){return db[_0x6920('0x3c')][_0x6920('0x3d')]({'where':{'id':_0x2a69d3[_0x6920('0x31')]['id']}})['then'](handleEntityNotFound(_0x4c56be,null))[_0x6920('0x2b')](removeEntity(_0x4c56be,null))[_0x6920('0x3e')](handleError(_0x4c56be,null));};function widgetAttributes(_0x14f841){try{switch(_0x14f841[_0x6920('0x3f')]){case'iframe':return[{'name':_0x6920('0x40'),'value':_0x14f841[_0x6920('0x40')]||(_0x14f841['attrs']&&_0x14f841['attrs'][0x0]?_0x14f841[_0x6920('0x41')][0x0][_0x6920('0x42')]:undefined)||'https://'}];case _0x6920('0x43'):return[{'name':_0x6920('0x44'),'value':_0x14f841['attrPath']||(_0x14f841['attrs']&&_0x14f841[_0x6920('0x41')][0x0]?_0x14f841[_0x6920('0x41')][0x0][_0x6920('0x42')]:undefined)||''}];case _0x6920('0x45'):return[{'name':_0x6920('0x46'),'value':_0x14f841['attrHourFormat']||(_0x14f841['attrs']&&_0x14f841['attrs'][0x0]?_0x14f841[_0x6920('0x41')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x6920('0x47'),'value':_0x14f841[_0x6920('0x47')]||(_0x14f841['attrs']&&_0x14f841[_0x6920('0x41')][0x1]?_0x14f841['attrs'][0x1][_0x6920('0x42')]:undefined)||_0x6920('0x48')},{'name':_0x6920('0x49'),'value':_0x14f841[_0x6920('0x49')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841['attrs'][0x2]?_0x14f841['attrs'][0x2][_0x6920('0x42')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x14f841['attrMetric']||(_0x14f841['attrs']&&_0x14f841[_0x6920('0x41')][0x0]?_0x14f841[_0x6920('0x41')][0x0][_0x6920('0x42')]:undefined)||'total'},{'name':_0x6920('0x4a'),'value':_0x14f841[_0x6920('0x4a')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x1]?_0x14f841[_0x6920('0x41')][0x1][_0x6920('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x14f841[_0x6920('0x49')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x2]?_0x14f841[_0x6920('0x41')][0x2][_0x6920('0x42')]:undefined)||0x14},{'name':_0x6920('0x4b'),'value':_0x14f841[_0x6920('0x4b')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x3]?_0x14f841[_0x6920('0x41')][0x3][_0x6920('0x42')]:undefined)||_0x6920('0x4c')},{'name':'attrEmailAccounts','value':_0x14f841[_0x6920('0x4d')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841['attrs'][0x4]?_0x14f841['attrs'][0x4][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x4e'),'value':_0x14f841[_0x6920('0x4e')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x5]?_0x14f841['attrs'][0x5][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x4f'),'value':_0x14f841[_0x6920('0x4f')]||(_0x14f841['attrs']&&_0x14f841['attrs'][0x6]?_0x14f841[_0x6920('0x41')][0x6][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x50'),'value':_0x14f841[_0x6920('0x50')]||(_0x14f841['attrs']&&_0x14f841[_0x6920('0x41')][0x7]?_0x14f841[_0x6920('0x41')][0x7][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x51'),'value':_0x14f841[_0x6920('0x51')]||(_0x14f841['attrs']&&_0x14f841[_0x6920('0x41')][0x8]?_0x14f841[_0x6920('0x41')][0x8][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x52'),'value':_0x14f841[_0x6920('0x52')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x9]?_0x14f841[_0x6920('0x41')][0x9][_0x6920('0x42')]:undefined)||''}];case _0x6920('0x53'):case'pie-chart':return[{'name':_0x6920('0x54'),'value':_0x14f841[_0x6920('0x54')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x0]?_0x14f841[_0x6920('0x41')][0x0][_0x6920('0x42')]:undefined)||_0x6920('0x55')},{'name':'attrSerie2','value':_0x14f841[_0x6920('0x56')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x1]?_0x14f841[_0x6920('0x41')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x14f841['attrSerie3']||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x2]?_0x14f841[_0x6920('0x41')][0x2]['value']:undefined)||null},{'name':_0x6920('0x4a'),'value':_0x14f841[_0x6920('0x4a')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x3]?_0x14f841[_0x6920('0x41')][0x3][_0x6920('0x42')]:undefined)||[]},{'name':_0x6920('0x4b'),'value':_0x14f841['attrChannel']||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x4]?_0x14f841['attrs'][0x4][_0x6920('0x42')]:undefined)||_0x6920('0x4c')},{'name':_0x6920('0x4d'),'value':_0x14f841[_0x6920('0x4d')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841['attrs'][0x5]?_0x14f841[_0x6920('0x41')][0x5][_0x6920('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x14f841[_0x6920('0x4e')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841['attrs'][0x6]?_0x14f841['attrs'][0x6][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x4f'),'value':_0x14f841['attrSmsAccounts']||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x7]?_0x14f841[_0x6920('0x41')][0x7][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x50'),'value':_0x14f841[_0x6920('0x50')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841['attrs'][0x8]?_0x14f841[_0x6920('0x41')][0x8][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x51'),'value':_0x14f841[_0x6920('0x51')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x9]?_0x14f841[_0x6920('0x41')][0x9][_0x6920('0x42')]:undefined)||''},{'name':_0x6920('0x52'),'value':_0x14f841['attrChatWebsites']||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0xa]?_0x14f841[_0x6920('0x41')][0xa][_0x6920('0x42')]:undefined)||''}];case'web-report':return[{'name':_0x6920('0x57'),'type':_0x14f841[_0x6920('0x58')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x0]?_0x14f841[_0x6920('0x41')][0x0][_0x6920('0x3f')]:undefined)||null,'value':_0x14f841['attrReport']||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x0]?_0x14f841['attrs'][0x0][_0x6920('0x42')]:undefined)||null},{'name':_0x6920('0x59'),'value':_0x14f841[_0x6920('0x59')]||(_0x14f841[_0x6920('0x41')]&&_0x14f841[_0x6920('0x41')][0x1]?_0x14f841[_0x6920('0x41')][0x1][_0x6920('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x433905){logger[_0x6920('0x2d')](_0x6920('0x5a'),JSON[_0x6920('0x5b')](_0x433905));return[];}}exports[_0x6920('0x5c')]=function(_0x15b24d,_0x394a0b){if(_0x15b24d['body']){_0x15b24d[_0x6920('0x5d')][_0x6920('0x41')]=widgetAttributes(_0x15b24d[_0x6920('0x5d')]);}return db['DashboardItem'][_0x6920('0x5c')](_0x15b24d[_0x6920('0x5d')],{})[_0x6920('0x2b')](respondWithResult(_0x394a0b,0xc9))[_0x6920('0x3e')](handleError(_0x394a0b,null));};exports[_0x6920('0x5e')]=function(_0x56fd3b,_0xc12b4c){if(_0x56fd3b[_0x6920('0x5d')]['id']){delete _0x56fd3b[_0x6920('0x5d')]['id'];}_0x56fd3b['body'][_0x6920('0x41')]=widgetAttributes(_0x56fd3b['body']);return db['DashboardItem'][_0x6920('0x3d')]({'where':{'id':_0x56fd3b['params']['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0xc12b4c,null))[_0x6920('0x2b')](saveUpdates(_0x56fd3b['body'],null))['then'](respondWithResult(_0xc12b4c,null))[_0x6920('0x3e')](handleError(_0xc12b4c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 23b1afa..a1274d0 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 _0xf4cd=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xf4cd,0x16a));var _0xdf4c=function(_0x4316b1,_0xd2d5bc){_0x4316b1=_0x4316b1-0x0;var _0x303e6e=_0xf4cd[_0x4316b1];return _0x303e6e;};'use strict';var EventEmitter=require(_0xdf4c('0x0'));var DashboardItem=require(_0xdf4c('0x1'))['db'][_0xdf4c('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdf4c('0x3')](0x0);var events={'afterCreate':_0xdf4c('0x4'),'afterUpdate':_0xdf4c('0x5'),'afterDestroy':_0xdf4c('0x6')};function emitEvent(_0x5716fd){return function(_0x3d66a0,_0x59e1ae,_0x5a32f9){DashboardItemEvents[_0xdf4c('0x7')](_0x5716fd+':'+_0x3d66a0['id'],_0x3d66a0);DashboardItemEvents[_0xdf4c('0x7')](_0x5716fd,_0x3d66a0);_0x5a32f9(null);};}for(var e in events){if(events[_0xdf4c('0x8')](e)){var event=events[e];DashboardItem[_0xdf4c('0x9')](e,emitEvent(event));}}module[_0xdf4c('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x8e49=['setMaxListeners','emit','hasOwnProperty','hook','events','DashboardItem'];(function(_0x160ad4,_0x46f844){var _0x104500=function(_0xf18a39){while(--_0xf18a39){_0x160ad4['push'](_0x160ad4['shift']());}};_0x104500(++_0x46f844);}(_0x8e49,0xf4));var _0x98e4=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x8e49[_0x1c72b8];return _0x191114;};'use strict';var EventEmitter=require(_0x98e4('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x98e4('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x98e4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e6c3c){return function(_0xbe8ea3,_0x10505d,_0x504b71){DashboardItemEvents[_0x98e4('0x3')](_0x2e6c3c+':'+_0xbe8ea3['id'],_0xbe8ea3);DashboardItemEvents[_0x98e4('0x3')](_0x2e6c3c,_0xbe8ea3);_0x504b71(null);};}for(var e in events){if(events[_0x98e4('0x4')](e)){var event=events[e];DashboardItem[_0x98e4('0x5')](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 5c73557..4a5c1ce 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 _0x1b15=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x45fb8b,_0x37c90b){var _0x57552e=function(_0x230d9a){while(--_0x230d9a){_0x45fb8b['push'](_0x45fb8b['shift']());}};_0x57552e(++_0x37c90b);}(_0x1b15,0x81));var _0x51b1=function(_0x37208d,_0x72da3e){_0x37208d=_0x37208d-0x0;var _0x3f60c4=_0x1b15[_0x37208d];return _0x3f60c4;};'use strict';var _=require(_0x51b1('0x0'));var util=require(_0x51b1('0x1'));var logger=require(_0x51b1('0x2'))('api');var moment=require(_0x51b1('0x3'));var BPromise=require(_0x51b1('0x4'));var rp=require(_0x51b1('0x5'));var fs=require('fs');var path=require(_0x51b1('0x6'));var rimraf=require(_0x51b1('0x7'));var config=require(_0x51b1('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x51b1('0x9')]=function(_0x52f185,_0x16d0a4){return _0x52f185[_0x51b1('0xa')](_0x51b1('0xb'),attributes,{'tableName':_0x51b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ebe=['moment','bluebird','request-promise','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe5eb('0x0'));var logger=require(_0xe5eb('0x1'))(_0xe5eb('0x2'));var moment=require(_0xe5eb('0x3'));var BPromise=require(_0xe5eb('0x4'));var rp=require(_0xe5eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe5eb('0x6'));var attributes=require(_0xe5eb('0x7'));module[_0xe5eb('0x8')]=function(_0x1f7414,_0x3055ba){return _0x1f7414[_0xe5eb('0x9')](_0xe5eb('0xa'),attributes,{'tableName':_0xe5eb('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 57e6b8f..f6f5e21 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 _0x2a4e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x53b6ae,_0x3cb9f4){var _0x34f4b2=function(_0x4b3169){while(--_0x4b3169){_0x53b6ae['push'](_0x53b6ae['shift']());}};_0x34f4b2(++_0x3cb9f4);}(_0x2a4e,0x123));var _0xe2a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a4e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2a4('0x0'));var util=require(_0xe2a4('0x1'));var moment=require(_0xe2a4('0x2'));var BPromise=require(_0xe2a4('0x3'));var rs=require(_0xe2a4('0x4'));var fs=require('fs');var Redis=require(_0xe2a4('0x5'));var db=require(_0xe2a4('0x6'))['db'];var utils=require(_0xe2a4('0x7'));var logger=require(_0xe2a4('0x8'))(_0xe2a4('0x9'));var config=require(_0xe2a4('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe2a4('0xb')]({'port':0x232a});config[_0xe2a4('0xc')]=_[_0xe2a4('0xd')](config[_0xe2a4('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2a4('0xc')]));require(_0xe2a4('0xe'))['register'](socket);function respondWithRpcPromise(_0x47957f,_0x40bfcb,_0x338030){return new BPromise(function(_0x4a7f55,_0x256d2c){return client[_0xe2a4('0xf')](_0x47957f,_0x338030)['then'](function(_0x1b03e8){logger[_0xe2a4('0x10')](_0xe2a4('0x11'),_0x40bfcb,_0xe2a4('0x12'));logger[_0xe2a4('0x13')](_0xe2a4('0x14'),_0x40bfcb,'request\x20sent',JSON[_0xe2a4('0x15')](_0x1b03e8));if(_0x1b03e8[_0xe2a4('0x16')]){if(_0x1b03e8['error'][_0xe2a4('0x17')]===0x1f4){logger[_0xe2a4('0x16')](_0xe2a4('0x11'),_0x40bfcb,_0x1b03e8[_0xe2a4('0x16')][_0xe2a4('0x18')]);return _0x256d2c(_0x1b03e8[_0xe2a4('0x16')][_0xe2a4('0x18')]);}logger[_0xe2a4('0x16')](_0xe2a4('0x11'),_0x40bfcb,_0x1b03e8[_0xe2a4('0x16')]['message']);return _0x4a7f55(_0x1b03e8[_0xe2a4('0x16')][_0xe2a4('0x18')]);}else{logger[_0xe2a4('0x10')]('DashboardItem,\x20%s,\x20%s',_0x40bfcb,_0xe2a4('0x12'));_0x4a7f55(_0x1b03e8[_0xe2a4('0x19')][_0xe2a4('0x18')]);}})[_0xe2a4('0x1a')](function(_0x176682){logger['error'](_0xe2a4('0x11'),_0x40bfcb,_0x176682);_0x256d2c(_0x176682);});});} \ No newline at end of file +var _0x9475=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4544e5,_0x40e821){var _0x1a193c=function(_0x5cb810){while(--_0x5cb810){_0x4544e5['push'](_0x4544e5['shift']());}};_0x1a193c(++_0x40e821);}(_0x9475,0x85));var _0x5947=function(_0x3f9300,_0x2a69e5){_0x3f9300=_0x3f9300-0x0;var _0x37ddba=_0x9475[_0x3f9300];return _0x37ddba;};'use strict';var _=require(_0x5947('0x0'));var util=require(_0x5947('0x1'));var moment=require('moment');var BPromise=require(_0x5947('0x2'));var rs=require(_0x5947('0x3'));var fs=require('fs');var Redis=require(_0x5947('0x4'));var db=require(_0x5947('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5947('0x6'))(_0x5947('0x7'));var config=require(_0x5947('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5947('0x9')]({'port':0x232a});config[_0x5947('0xa')]=_['defaults'](config['redis'],{'host':_0x5947('0xb'),'port':0x18eb});var socket=require(_0x5947('0xc'))(new Redis(config[_0x5947('0xa')]));require(_0x5947('0xd'))[_0x5947('0xe')](socket);function respondWithRpcPromise(_0x3a6ec6,_0x23b1be,_0x3ea4ab){return new BPromise(function(_0x29b487,_0xb02f76){return client['request'](_0x3a6ec6,_0x3ea4ab)['then'](function(_0x59c6d1){logger[_0x5947('0xf')](_0x5947('0x10'),_0x23b1be,_0x5947('0x11'));logger['debug'](_0x5947('0x12'),_0x23b1be,_0x5947('0x11'),JSON[_0x5947('0x13')](_0x59c6d1));if(_0x59c6d1[_0x5947('0x14')]){if(_0x59c6d1[_0x5947('0x14')]['code']===0x1f4){logger[_0x5947('0x14')]('DashboardItem,\x20%s,\x20%s',_0x23b1be,_0x59c6d1[_0x5947('0x14')][_0x5947('0x15')]);return _0xb02f76(_0x59c6d1['error']['message']);}logger[_0x5947('0x14')]('DashboardItem,\x20%s,\x20%s',_0x23b1be,_0x59c6d1[_0x5947('0x14')]['message']);return _0x29b487(_0x59c6d1['error'][_0x5947('0x15')]);}else{logger[_0x5947('0xf')](_0x5947('0x10'),_0x23b1be,_0x5947('0x11'));_0x29b487(_0x59c6d1[_0x5947('0x16')][_0x5947('0x15')]);}})['catch'](function(_0x47f02b){logger[_0x5947('0x14')](_0x5947('0x10'),_0x23b1be,_0x47f02b);_0xb02f76(_0x47f02b);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 251b4a1..383a976 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 _0xa09f=['dashboardItem:','./dashboardItem.events','save','remove','update','removeListener','register','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa09f,0x1c1));var _0xfa09=function(_0x316e16,_0x2c2cd0){_0x316e16=_0x316e16-0x0;var _0x21950c=_0xa09f[_0x316e16];return _0x21950c;};'use strict';var DashboardItemEvents=require(_0xfa09('0x0'));var events=[_0xfa09('0x1'),_0xfa09('0x2'),_0xfa09('0x3')];function createListener(_0xf370dc,_0x289d23){return function(_0x418b2f){_0x289d23['emit'](_0xf370dc,_0x418b2f);};}function removeListener(_0x4375e6,_0x210201){return function(){DashboardItemEvents[_0xfa09('0x4')](_0x4375e6,_0x210201);};}exports[_0xfa09('0x5')]=function(_0x1d7502){for(var _0x461785=0x0,_0x60becc=events[_0xfa09('0x6')];_0x461785<_0x60becc;_0x461785++){var _0x20309d=events[_0x461785];var _0x4adb58=createListener(_0xfa09('0x7')+_0x20309d,_0x1d7502);DashboardItemEvents['on'](_0x20309d,_0x4adb58);}}; \ No newline at end of file +var _0xfcbc=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfcbc,0x107));var _0xcfcb=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xfcbc[_0x28394f];return _0x2618d2;};'use strict';var DashboardItemEvents=require(_0xcfcb('0x0'));var events=['save','remove','update'];function createListener(_0x46dd7a,_0x4c0bb3){return function(_0x213e5d){_0x4c0bb3[_0xcfcb('0x1')](_0x46dd7a,_0x213e5d);};}function removeListener(_0x1cd08a,_0x4f22ae){return function(){DashboardItemEvents[_0xcfcb('0x2')](_0x1cd08a,_0x4f22ae);};}exports[_0xcfcb('0x3')]=function(_0x4b5b93){for(var _0x1960e3=0x0,_0x422899=events[_0xcfcb('0x4')];_0x1960e3<_0x422899;_0x1960e3++){var _0x471576=events[_0x1960e3];var _0x496534=createListener(_0xcfcb('0x5')+_0x471576,_0x4b5b93);DashboardItemEvents['on'](_0x471576,_0x496534);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 27399ab..c3dcf4d 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 _0x22a6=['put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show'];(function(_0x2b9ac8,_0xf820cb){var _0x3ceea9=function(_0x407d34){while(--_0x407d34){_0x2b9ac8['push'](_0x2b9ac8['shift']());}};_0x3ceea9(++_0xf820cb);}(_0x22a6,0x1d4));var _0x622a=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x22a6[_0x4a96ca];return _0x2aed48;};'use strict';var multer=require(_0x622a('0x0'));var util=require(_0x622a('0x1'));var path=require(_0x622a('0x2'));var timeout=require(_0x622a('0x3'));var express=require('express');var router=express[_0x622a('0x4')]();var fs_extra=require(_0x622a('0x5'));var auth=require(_0x622a('0x6'));var interaction=require(_0x622a('0x7'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x622a('0x8')](_0x622a('0x9'),auth[_0x622a('0xa')](),controller[_0x622a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x622a('0xc')](_0x622a('0x9'),auth[_0x622a('0xa')](),controller['update']);router['delete'](_0x622a('0x9'),auth[_0x622a('0xa')](),controller[_0x622a('0xd')]);module[_0x622a('0xe')]=router; \ No newline at end of file +var _0xe113=['path','connect-timeout','express','Router','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','create','put','destroy','exports','util'];(function(_0xd44b94,_0x119a9a){var _0x313d40=function(_0x4a0df9){while(--_0x4a0df9){_0xd44b94['push'](_0xd44b94['shift']());}};_0x313d40(++_0x119a9a);}(_0xe113,0xd1));var _0x3e11=function(_0x3106ab,_0x51847c){_0x3106ab=_0x3106ab-0x0;var _0x821142=_0xe113[_0x3106ab];return _0x821142;};'use strict';var multer=require('multer');var util=require(_0x3e11('0x0'));var path=require(_0x3e11('0x1'));var timeout=require(_0x3e11('0x2'));var express=require(_0x3e11('0x3'));var router=express[_0x3e11('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e11('0x5'));var controller=require(_0x3e11('0x6'));router['get'](_0x3e11('0x7'),auth[_0x3e11('0x8')](),controller['show']);router[_0x3e11('0x9')]('/',auth['isAuthenticated'](),controller[_0x3e11('0xa')]);router[_0x3e11('0xb')](_0x3e11('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3e11('0x7'),auth[_0x3e11('0x8')](),controller[_0x3e11('0xc')]);module[_0x3e11('0xd')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 027403a..98eb6d2 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 _0xb2e8=['STRING','sequelize','exports','first','third'];(function(_0x14d9cf,_0x54a5a8){var _0x3decee=function(_0x42ac24){while(--_0x42ac24){_0x14d9cf['push'](_0x14d9cf['shift']());}};_0x3decee(++_0x54a5a8);}(_0xb2e8,0x1d2));var _0x8b2e=function(_0x514fdb,_0x30e786){_0x514fdb=_0x514fdb-0x0;var _0x441ca8=_0xb2e8[_0x514fdb];return _0x441ca8;};'use strict';var Sequelize=require(_0x8b2e('0x0'));module[_0x8b2e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x8b2e('0x2'),'second',_0x8b2e('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x8b2e('0x4')]}}; \ No newline at end of file +var _0xc41d=['second','sequelize','STRING','ENUM','first'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xc41d,0x100));var _0xdc41=function(_0xc2d263,_0xcee46e){_0xc2d263=_0xc2d263-0x0;var _0x29085d=_0xc41d[_0xc2d263];return _0x29085d;};'use strict';var Sequelize=require(_0xdc41('0x0'));module['exports']={'name':{'type':Sequelize[_0xdc41('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xdc41('0x2')](_0xdc41('0x3'),_0xdc41('0x4'),'third'),'allowNull':![],'defaultValue':_0xdc41('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 67fde4b..0ec950c 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 _0x0023=['options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','error','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','map','Disposition','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x0023,0x10a));var _0x3002=function(_0x4a5974,_0x17d46f){_0x4a5974=_0x4a5974-0x0;var _0xc26fef=_0x0023[_0x4a5974];return _0xc26fef;};'use strict';var emlformat=require(_0x3002('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3002('0x1'));var jsonpatch=require(_0x3002('0x2'));var rp=require(_0x3002('0x3'));var moment=require(_0x3002('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3002('0x5'));var util=require(_0x3002('0x6'));var path=require('path');var sox=require(_0x3002('0x7'));var csv=require('to-csv');var ejs=require(_0x3002('0x8'));var fs=require('fs');var fs_extra=require(_0x3002('0x9'));var _=require(_0x3002('0xa'));var squel=require(_0x3002('0xb'));var crypto=require(_0x3002('0xc'));var jsforce=require(_0x3002('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3002('0xe'));var querystring=require('querystring');var Papa=require(_0x3002('0xf'));var Redis=require(_0x3002('0x10'));var authService=require(_0x3002('0x11'));var qs=require(_0x3002('0x12'));var as=require(_0x3002('0x13'));var hardwareService=require(_0x3002('0x14'));var logger=require('../../config/logger')(_0x3002('0x15'));var utils=require(_0x3002('0x16'));var config=require(_0x3002('0x17'));var licenseUtil=require(_0x3002('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36834e,_0x723bc3){_0x723bc3=_0x723bc3||0xcc;return function(_0x10c7c2){if(_0x10c7c2){return _0x36834e[_0x3002('0x19')](_0x723bc3);}return _0x36834e[_0x3002('0x1a')](_0x723bc3)[_0x3002('0x1b')]();};}function respondWithResult(_0x2148b6,_0x318cfd){_0x318cfd=_0x318cfd||0xc8;return function(_0x2ec1f0){if(_0x2ec1f0){return _0x2148b6[_0x3002('0x1a')](_0x318cfd)[_0x3002('0x1c')](_0x2ec1f0);}};}function respondWithFilteredResult(_0x7a9a2c,_0x5391c8){return function(_0x1bc179){if(_0x1bc179){var _0x54c8fd=typeof _0x5391c8[_0x3002('0x1d')]==='undefined'&&typeof _0x5391c8['limit']===_0x3002('0x1e');var _0x5d12e7=_0x1bc179[_0x3002('0x1f')];var _0x4a75aa=_0x54c8fd?0x0:_0x5391c8['offset'];var _0x42367a=_0x54c8fd?_0x1bc179[_0x3002('0x1f')]:_0x5391c8[_0x3002('0x1d')]+_0x5391c8[_0x3002('0x20')];var _0x3894a2;if(_0x42367a>=_0x5d12e7){_0x42367a=_0x5d12e7;_0x3894a2=0xc8;}else{_0x3894a2=0xce;}_0x7a9a2c[_0x3002('0x1a')](_0x3894a2);return _0x7a9a2c['set'](_0x3002('0x21'),_0x4a75aa+'-'+_0x42367a+'/'+_0x5d12e7)['json'](_0x1bc179);}return null;};}function patchUpdates(_0x1a1105){return function(_0x335e9b){try{jsonpatch[_0x3002('0x22')](_0x335e9b,_0x1a1105,!![]);}catch(_0x5621d0){return BPromise[_0x3002('0x23')](_0x5621d0);}return _0x335e9b[_0x3002('0x24')]();};}function saveUpdates(_0x67c16,_0x4c144e){return function(_0x159a0e){if(_0x159a0e){return _0x159a0e[_0x3002('0x25')](_0x67c16)[_0x3002('0x26')](function(_0xe953f9){return _0xe953f9;});}return null;};}function removeEntity(_0x4d0ad6,_0xfaf37a){return function(_0x266af8){if(_0x266af8){return _0x266af8[_0x3002('0x27')]()[_0x3002('0x26')](function(){var _0x14cdb4=_0x266af8[_0x3002('0x28')]({'plain':!![]});var _0x338d0e=_0x3002('0x29');return db[_0x3002('0x2a')]['destroy']({'where':{'type':_0x338d0e,'resourceId':_0x14cdb4['id']}})[_0x3002('0x26')](function(){return _0x266af8;});})[_0x3002('0x26')](function(){_0x4d0ad6[_0x3002('0x1a')](0xcc)[_0x3002('0x1b')]();});}};}function handleEntityNotFound(_0x50675f,_0x11be1c){return function(_0x3f5298){if(!_0x3f5298){_0x50675f[_0x3002('0x19')](0x194);}return _0x3f5298;};}function handleError(_0x2bfd82,_0x2db746){_0x2db746=_0x2db746||0x1f4;return function(_0x2963ef){logger['error'](_0x2963ef[_0x3002('0x2b')]);if(_0x2963ef[_0x3002('0x2c')]){delete _0x2963ef[_0x3002('0x2c')];}_0x2bfd82[_0x3002('0x1a')](_0x2db746)[_0x3002('0x2d')](_0x2963ef);};}exports['index']=function(_0x15b687,_0x583ded){var _0x5a18b0={},_0x18c50e={},_0x122899={'count':0x0,'rows':[]};var _0x3c275b=_[_0x3002('0x2e')](db[_0x3002('0x2f')][_0x3002('0x30')],function(_0x100182){return{'name':_0x100182['fieldName'],'type':_0x100182[_0x3002('0x31')][_0x3002('0x32')]};});_0x18c50e['model']=_[_0x3002('0x2e')](_0x3c275b,'name');_0x18c50e[_0x3002('0x33')]=_[_0x3002('0x34')](_0x15b687[_0x3002('0x33')]);_0x18c50e[_0x3002('0x35')]=_['intersection'](_0x18c50e[_0x3002('0x36')],_0x18c50e[_0x3002('0x33')]);_0x5a18b0[_0x3002('0x37')]=_[_0x3002('0x38')](_0x18c50e[_0x3002('0x36')],qs['fields'](_0x15b687[_0x3002('0x33')][_0x3002('0x39')]));_0x5a18b0[_0x3002('0x37')]=_0x5a18b0[_0x3002('0x37')]['length']?_0x5a18b0[_0x3002('0x37')]:_0x18c50e['model'];if(!_0x15b687[_0x3002('0x33')][_0x3002('0x3a')](_0x3002('0x3b'))){_0x5a18b0['limit']=qs['limit'](_0x15b687[_0x3002('0x33')][_0x3002('0x20')]);_0x5a18b0[_0x3002('0x1d')]=qs[_0x3002('0x1d')](_0x15b687[_0x3002('0x33')][_0x3002('0x1d')]);}_0x5a18b0['order']=qs[_0x3002('0x3c')](_0x15b687['query'][_0x3002('0x3c')]);_0x5a18b0[_0x3002('0x3d')]=qs[_0x3002('0x35')](_[_0x3002('0x3e')](_0x15b687[_0x3002('0x33')],_0x18c50e[_0x3002('0x35')]),_0x3c275b);if(_0x15b687[_0x3002('0x33')][_0x3002('0x3f')]){_0x5a18b0[_0x3002('0x3d')]=_[_0x3002('0x40')](_0x5a18b0['where'],{'$or':_[_0x3002('0x2e')](_0x3c275b,function(_0x170301){if(_0x170301['type']!==_0x3002('0x41')){var _0x361172={};_0x361172[_0x170301[_0x3002('0x2c')]]={'$like':'%'+_0x15b687['query'][_0x3002('0x3f')]+'%'};return _0x361172;}})});}_0x5a18b0=_[_0x3002('0x40')]({},_0x5a18b0,_0x15b687[_0x3002('0x42')]);var _0x196939={'where':_0x5a18b0['where']};return db[_0x3002('0x2f')][_0x3002('0x1f')](_0x196939)[_0x3002('0x26')](function(_0x11594d){_0x122899[_0x3002('0x1f')]=_0x11594d;if(_0x15b687[_0x3002('0x33')][_0x3002('0x43')]){_0x5a18b0[_0x3002('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x3002('0x45')](_0x5a18b0);})[_0x3002('0x26')](function(_0x271d6d){_0x122899[_0x3002('0x46')]=_0x271d6d;return _0x122899;})[_0x3002('0x26')](respondWithFilteredResult(_0x583ded,_0x5a18b0))[_0x3002('0x47')](handleError(_0x583ded,null));};exports[_0x3002('0x48')]=function(_0x2bd4d3,_0x14c3c4){var _0x3bc9e7={'raw':!![],'where':{'id':_0x2bd4d3[_0x3002('0x49')]['id']}},_0x15f0cd={};_0x15f0cd[_0x3002('0x36')]=_[_0x3002('0x34')](db[_0x3002('0x2f')][_0x3002('0x30')]);_0x15f0cd[_0x3002('0x33')]=_[_0x3002('0x34')](_0x2bd4d3[_0x3002('0x33')]);_0x15f0cd[_0x3002('0x35')]=_[_0x3002('0x38')](_0x15f0cd[_0x3002('0x36')],_0x15f0cd['query']);_0x3bc9e7[_0x3002('0x37')]=_[_0x3002('0x38')](_0x15f0cd[_0x3002('0x36')],qs[_0x3002('0x39')](_0x2bd4d3[_0x3002('0x33')]['fields']));_0x3bc9e7[_0x3002('0x37')]=_0x3bc9e7['attributes'][_0x3002('0x4a')]?_0x3bc9e7['attributes']:_0x15f0cd['model'];if(_0x2bd4d3['query'][_0x3002('0x43')]){_0x3bc9e7['include']=[{'all':!![]}];}_0x3bc9e7=_[_0x3002('0x40')]({},_0x3bc9e7,_0x2bd4d3[_0x3002('0x42')]);return db[_0x3002('0x2f')]['find'](_0x3bc9e7)['then'](handleEntityNotFound(_0x14c3c4,null))[_0x3002('0x26')](respondWithResult(_0x14c3c4,null))[_0x3002('0x47')](handleError(_0x14c3c4,null));};exports[_0x3002('0x4b')]=function(_0x370cda,_0x37af8b){return db[_0x3002('0x2f')][_0x3002('0x4b')](_0x370cda[_0x3002('0x4c')],{})[_0x3002('0x26')](function(_0x4e6cb4){var _0x5cde3e=_0x370cda[_0x3002('0x4d')][_0x3002('0x28')]({'plain':!![]});if(!_0x5cde3e)throw new Error(_0x3002('0x4e'));if(_0x5cde3e[_0x3002('0x4f')]===_0x3002('0x4d')){var _0x5ae248=_0x4e6cb4[_0x3002('0x28')]({'plain':!![]});var _0x4a1f2c=_0x3002('0x29');return db['UserProfileSection'][_0x3002('0x50')]({'where':{'name':_0x4a1f2c,'userProfileId':_0x5cde3e[_0x3002('0x51')]},'raw':!![]})['then'](function(_0x465c1a){if(_0x465c1a&&_0x465c1a['autoAssociation']===0x0){return db['UserProfileResource'][_0x3002('0x4b')]({'name':_0x5ae248[_0x3002('0x2c')],'resourceId':_0x5ae248['id'],'type':_0x465c1a[_0x3002('0x2c')],'sectionId':_0x465c1a['id']},{})['then'](function(){return _0x4e6cb4;});}else{return _0x4e6cb4;}})[_0x3002('0x47')](function(_0x164e38){logger[_0x3002('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x164e38);throw _0x164e38;});}return _0x4e6cb4;})['then'](respondWithResult(_0x37af8b,0xc9))['catch'](handleError(_0x37af8b,null));};exports['update']=function(_0x7c729,_0x337209){if(_0x7c729[_0x3002('0x4c')]['id']){delete _0x7c729[_0x3002('0x4c')]['id'];}return db[_0x3002('0x2f')][_0x3002('0x50')]({'where':{'id':_0x7c729['params']['id']}})[_0x3002('0x26')](handleEntityNotFound(_0x337209,null))['then'](saveUpdates(_0x7c729[_0x3002('0x4c')],null))[_0x3002('0x26')](respondWithResult(_0x337209,null))[_0x3002('0x47')](handleError(_0x337209,null));};exports['destroy']=function(_0x349c38,_0x41238c){return db[_0x3002('0x2f')][_0x3002('0x50')]({'where':{'id':_0x349c38['params']['id']}})[_0x3002('0x26')](handleEntityNotFound(_0x41238c,null))[_0x3002('0x26')](removeEntity(_0x41238c,null))['catch'](handleError(_0x41238c,null));}; \ No newline at end of file +var _0x2144=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3ca115,_0x286520){var _0x1538bc=function(_0x2f891b){while(--_0x2f891b){_0x3ca115['push'](_0x3ca115['shift']());}};_0x1538bc(++_0x286520);}(_0x2144,0xfa));var _0x4214=function(_0x1a37b2,_0x584b3b){_0x1a37b2=_0x1a37b2-0x0;var _0x130c75=_0x2144[_0x1a37b2];return _0x130c75;};'use strict';var emlformat=require(_0x4214('0x0'));var rimraf=require(_0x4214('0x1'));var zipdir=require(_0x4214('0x2'));var jsonpatch=require(_0x4214('0x3'));var rp=require(_0x4214('0x4'));var moment=require(_0x4214('0x5'));var BPromise=require(_0x4214('0x6'));var Mustache=require(_0x4214('0x7'));var util=require(_0x4214('0x8'));var path=require(_0x4214('0x9'));var sox=require(_0x4214('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4214('0xb'));var _=require(_0x4214('0xc'));var squel=require(_0x4214('0xd'));var crypto=require(_0x4214('0xe'));var jsforce=require(_0x4214('0xf'));var deskjs=require(_0x4214('0x10'));var toCsv=require(_0x4214('0x11'));var querystring=require('querystring');var Papa=require(_0x4214('0x12'));var Redis=require('ioredis');var authService=require(_0x4214('0x13'));var qs=require(_0x4214('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4214('0x15'));var logger=require(_0x4214('0x16'))(_0x4214('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4214('0x18'));var db=require(_0x4214('0x19'))['db'];function respondWithStatusCode(_0x37b0db,_0x529f35){_0x529f35=_0x529f35||0xcc;return function(_0x7bc8df){if(_0x7bc8df){return _0x37b0db[_0x4214('0x1a')](_0x529f35);}return _0x37b0db['status'](_0x529f35)[_0x4214('0x1b')]();};}function respondWithResult(_0x32e60c,_0x521b94){_0x521b94=_0x521b94||0xc8;return function(_0x393288){if(_0x393288){return _0x32e60c[_0x4214('0x1c')](_0x521b94)[_0x4214('0x1d')](_0x393288);}};}function respondWithFilteredResult(_0x585ba6,_0x48019b){return function(_0x3f00d4){if(_0x3f00d4){var _0x1d540f=typeof _0x48019b[_0x4214('0x1e')]===_0x4214('0x1f')&&typeof _0x48019b[_0x4214('0x20')]===_0x4214('0x1f');var _0x3d5134=_0x3f00d4[_0x4214('0x21')];var _0x2b89f1=_0x1d540f?0x0:_0x48019b[_0x4214('0x1e')];var _0x5d8962=_0x1d540f?_0x3f00d4[_0x4214('0x21')]:_0x48019b['offset']+_0x48019b[_0x4214('0x20')];var _0x13c70f;if(_0x5d8962>=_0x3d5134){_0x5d8962=_0x3d5134;_0x13c70f=0xc8;}else{_0x13c70f=0xce;}_0x585ba6[_0x4214('0x1c')](_0x13c70f);return _0x585ba6[_0x4214('0x22')](_0x4214('0x23'),_0x2b89f1+'-'+_0x5d8962+'/'+_0x3d5134)[_0x4214('0x1d')](_0x3f00d4);}return null;};}function patchUpdates(_0x1e78ef){return function(_0xde10dd){try{jsonpatch[_0x4214('0x24')](_0xde10dd,_0x1e78ef,!![]);}catch(_0x4913d2){return BPromise[_0x4214('0x25')](_0x4913d2);}return _0xde10dd[_0x4214('0x26')]();};}function saveUpdates(_0x19fc97,_0x53ed82){return function(_0x435505){if(_0x435505){return _0x435505[_0x4214('0x27')](_0x19fc97)['then'](function(_0x3c434f){return _0x3c434f;});}return null;};}function removeEntity(_0x534e65,_0x51827e){return function(_0x28ee41){if(_0x28ee41){return _0x28ee41[_0x4214('0x28')]()[_0x4214('0x29')](function(){var _0xd07705=_0x28ee41[_0x4214('0x2a')]({'plain':!![]});var _0x31de80='Dispositions';return db[_0x4214('0x2b')][_0x4214('0x28')]({'where':{'type':_0x31de80,'resourceId':_0xd07705['id']}})[_0x4214('0x29')](function(){return _0x28ee41;});})[_0x4214('0x29')](function(){_0x534e65[_0x4214('0x1c')](0xcc)[_0x4214('0x1b')]();});}};}function handleEntityNotFound(_0x4d5547,_0x23cb25){return function(_0x2aa53e){if(!_0x2aa53e){_0x4d5547[_0x4214('0x1a')](0x194);}return _0x2aa53e;};}function handleError(_0x5daacd,_0x4e2ce4){_0x4e2ce4=_0x4e2ce4||0x1f4;return function(_0x3aa179){logger[_0x4214('0x2c')](_0x3aa179[_0x4214('0x2d')]);if(_0x3aa179['name']){delete _0x3aa179[_0x4214('0x2e')];}_0x5daacd['status'](_0x4e2ce4)[_0x4214('0x2f')](_0x3aa179);};}exports['index']=function(_0x467235,_0x4f786d){var _0x3e8faf={},_0x5f52e7={},_0xf0654={'count':0x0,'rows':[]};var _0x25bd45=_[_0x4214('0x30')](db[_0x4214('0x31')][_0x4214('0x32')],function(_0x54a000){return{'name':_0x54a000[_0x4214('0x33')],'type':_0x54a000[_0x4214('0x34')][_0x4214('0x35')]};});_0x5f52e7[_0x4214('0x36')]=_[_0x4214('0x30')](_0x25bd45,_0x4214('0x2e'));_0x5f52e7[_0x4214('0x37')]=_[_0x4214('0x38')](_0x467235[_0x4214('0x37')]);_0x5f52e7[_0x4214('0x39')]=_[_0x4214('0x3a')](_0x5f52e7[_0x4214('0x36')],_0x5f52e7['query']);_0x3e8faf[_0x4214('0x3b')]=_[_0x4214('0x3a')](_0x5f52e7[_0x4214('0x36')],qs[_0x4214('0x3c')](_0x467235[_0x4214('0x37')]['fields']));_0x3e8faf[_0x4214('0x3b')]=_0x3e8faf[_0x4214('0x3b')][_0x4214('0x3d')]?_0x3e8faf[_0x4214('0x3b')]:_0x5f52e7['model'];if(!_0x467235['query'][_0x4214('0x3e')](_0x4214('0x3f'))){_0x3e8faf[_0x4214('0x20')]=qs['limit'](_0x467235['query'][_0x4214('0x20')]);_0x3e8faf['offset']=qs['offset'](_0x467235[_0x4214('0x37')][_0x4214('0x1e')]);}_0x3e8faf[_0x4214('0x40')]=qs[_0x4214('0x41')](_0x467235[_0x4214('0x37')][_0x4214('0x41')]);_0x3e8faf['where']=qs['filters'](_[_0x4214('0x42')](_0x467235[_0x4214('0x37')],_0x5f52e7['filters']),_0x25bd45);if(_0x467235[_0x4214('0x37')][_0x4214('0x43')]){_0x3e8faf[_0x4214('0x44')]=_['merge'](_0x3e8faf[_0x4214('0x44')],{'$or':_[_0x4214('0x30')](_0x25bd45,function(_0x57411e){if(_0x57411e[_0x4214('0x34')]!==_0x4214('0x45')){var _0x3da7d7={};_0x3da7d7[_0x57411e['name']]={'$like':'%'+_0x467235[_0x4214('0x37')]['filter']+'%'};return _0x3da7d7;}})});}_0x3e8faf=_[_0x4214('0x46')]({},_0x3e8faf,_0x467235[_0x4214('0x47')]);var _0x4ba00f={'where':_0x3e8faf[_0x4214('0x44')]};return db[_0x4214('0x31')]['count'](_0x4ba00f)[_0x4214('0x29')](function(_0x36a93e){_0xf0654[_0x4214('0x21')]=_0x36a93e;if(_0x467235['query'][_0x4214('0x48')]){_0x3e8faf[_0x4214('0x49')]=[{'all':!![]}];}return db[_0x4214('0x31')][_0x4214('0x4a')](_0x3e8faf);})[_0x4214('0x29')](function(_0x18c496){_0xf0654[_0x4214('0x4b')]=_0x18c496;return _0xf0654;})[_0x4214('0x29')](respondWithFilteredResult(_0x4f786d,_0x3e8faf))['catch'](handleError(_0x4f786d,null));};exports['show']=function(_0x2056a3,_0x5e662e){var _0xf6d2d8={'raw':!![],'where':{'id':_0x2056a3[_0x4214('0x4c')]['id']}},_0x6e8be3={};_0x6e8be3['model']=_[_0x4214('0x38')](db['Disposition'][_0x4214('0x32')]);_0x6e8be3[_0x4214('0x37')]=_[_0x4214('0x38')](_0x2056a3[_0x4214('0x37')]);_0x6e8be3[_0x4214('0x39')]=_[_0x4214('0x3a')](_0x6e8be3[_0x4214('0x36')],_0x6e8be3[_0x4214('0x37')]);_0xf6d2d8[_0x4214('0x3b')]=_[_0x4214('0x3a')](_0x6e8be3[_0x4214('0x36')],qs[_0x4214('0x3c')](_0x2056a3['query'][_0x4214('0x3c')]));_0xf6d2d8[_0x4214('0x3b')]=_0xf6d2d8['attributes']['length']?_0xf6d2d8[_0x4214('0x3b')]:_0x6e8be3['model'];if(_0x2056a3['query'][_0x4214('0x48')]){_0xf6d2d8[_0x4214('0x49')]=[{'all':!![]}];}_0xf6d2d8=_[_0x4214('0x46')]({},_0xf6d2d8,_0x2056a3[_0x4214('0x47')]);return db[_0x4214('0x31')][_0x4214('0x4d')](_0xf6d2d8)[_0x4214('0x29')](handleEntityNotFound(_0x5e662e,null))[_0x4214('0x29')](respondWithResult(_0x5e662e,null))[_0x4214('0x4e')](handleError(_0x5e662e,null));};exports['create']=function(_0x54530b,_0x1bf709){return db[_0x4214('0x31')]['create'](_0x54530b[_0x4214('0x4f')],{})[_0x4214('0x29')](function(_0x1d80f1){var _0x4da321=_0x54530b[_0x4214('0x50')][_0x4214('0x2a')]({'plain':!![]});if(!_0x4da321)throw new Error(_0x4214('0x51'));if(_0x4da321[_0x4214('0x52')]===_0x4214('0x50')){var _0x3cd82f=_0x1d80f1[_0x4214('0x2a')]({'plain':!![]});var _0x56b0be=_0x4214('0x53');return db[_0x4214('0x54')][_0x4214('0x4d')]({'where':{'name':_0x56b0be,'userProfileId':_0x4da321[_0x4214('0x55')]},'raw':!![]})[_0x4214('0x29')](function(_0x3e897e){if(_0x3e897e&&_0x3e897e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3cd82f['name'],'resourceId':_0x3cd82f['id'],'type':_0x3e897e[_0x4214('0x2e')],'sectionId':_0x3e897e['id']},{})[_0x4214('0x29')](function(){return _0x1d80f1;});}else{return _0x1d80f1;}})['catch'](function(_0x194ba8){logger[_0x4214('0x2c')](_0x4214('0x56'),_0x194ba8);throw _0x194ba8;});}return _0x1d80f1;})[_0x4214('0x29')](respondWithResult(_0x1bf709,0xc9))[_0x4214('0x4e')](handleError(_0x1bf709,null));};exports[_0x4214('0x27')]=function(_0x2859fe,_0x1f1bf5){if(_0x2859fe['body']['id']){delete _0x2859fe[_0x4214('0x4f')]['id'];}return db['Disposition']['find']({'where':{'id':_0x2859fe[_0x4214('0x4c')]['id']}})[_0x4214('0x29')](handleEntityNotFound(_0x1f1bf5,null))['then'](saveUpdates(_0x2859fe[_0x4214('0x4f')],null))[_0x4214('0x29')](respondWithResult(_0x1f1bf5,null))['catch'](handleError(_0x1f1bf5,null));};exports[_0x4214('0x28')]=function(_0x42c54b,_0x179c7b){return db[_0x4214('0x31')][_0x4214('0x4d')]({'where':{'id':_0x42c54b[_0x4214('0x4c')]['id']}})[_0x4214('0x29')](handleEntityNotFound(_0x179c7b,null))[_0x4214('0x29')](removeEntity(_0x179c7b,null))[_0x4214('0x4e')](handleError(_0x179c7b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 77969f6..35e95d9 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 _0x1773=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x3545e9,_0x572206){var _0x3eac23=function(_0x5bc0fb){while(--_0x5bc0fb){_0x3545e9['push'](_0x3545e9['shift']());}};_0x3eac23(++_0x572206);}(_0x1773,0x96));var _0x3177=function(_0x5188e0,_0x5e1b09){_0x5188e0=_0x5188e0-0x0;var _0xd70786=_0x1773[_0x5188e0];return _0xd70786;};'use strict';var _=require('lodash');var util=require(_0x3177('0x0'));var logger=require(_0x3177('0x1'))('api');var moment=require(_0x3177('0x2'));var BPromise=require(_0x3177('0x3'));var rp=require(_0x3177('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3177('0x5'));var config=require(_0x3177('0x6'));var attributes=require(_0x3177('0x7'));module[_0x3177('0x8')]=function(_0x30908b,_0x147a10){return _0x30908b[_0x3177('0x9')](_0x3177('0xa'),attributes,{'tableName':_0x3177('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x3177('0xc')]},{'unique':!![],'name':_0x3177('0xd'),'fields':['name',_0x3177('0xe')]},{'unique':!![],'name':_0x3177('0xf'),'fields':[_0x3177('0x10'),_0x3177('0x11')]},{'unique':!![],'name':_0x3177('0x12'),'fields':[_0x3177('0x10'),_0x3177('0x13')]},{'unique':!![],'name':_0x3177('0x14'),'fields':[_0x3177('0x10'),_0x3177('0x15')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x3177('0x16')]},{'unique':!![],'name':_0x3177('0x17'),'fields':['name',_0x3177('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46f2=['request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird'];(function(_0x222dde,_0x29cc79){var _0x21bd98=function(_0x404bca){while(--_0x404bca){_0x222dde['push'](_0x222dde['shift']());}};_0x21bd98(++_0x29cc79);}(_0x46f2,0x133));var _0x246f=function(_0x335aec,_0x4754a5){_0x335aec=_0x335aec-0x0;var _0x29095f=_0x46f2[_0x335aec];return _0x29095f;};'use strict';var _=require(_0x246f('0x0'));var util=require(_0x246f('0x1'));var logger=require(_0x246f('0x2'))(_0x246f('0x3'));var moment=require('moment');var BPromise=require(_0x246f('0x4'));var rp=require(_0x246f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x246f('0x6'));var config=require(_0x246f('0x7'));var attributes=require(_0x246f('0x8'));module[_0x246f('0x9')]=function(_0x17b6e2,_0x281d90){return _0x17b6e2[_0x246f('0xa')]('Disposition',attributes,{'tableName':_0x246f('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x246f('0xc'),'fields':[_0x246f('0xd'),_0x246f('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0x246f('0xd'),_0x246f('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x246f('0xd'),_0x246f('0x10')]},{'unique':!![],'name':_0x246f('0x11'),'fields':[_0x246f('0xd'),_0x246f('0x12')]},{'unique':!![],'name':'name_fax','fields':['name',_0x246f('0x13')]},{'unique':!![],'name':_0x246f('0x14'),'fields':['name',_0x246f('0x15')]},{'unique':!![],'name':_0x246f('0x16'),'fields':['name',_0x246f('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 24b4bd7..7252373 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(_0x2baa7e,_0x1b1e93){var _0x419e8d=function(_0xbc73cd){while(--_0xbc73cd){_0x2baa7e['push'](_0x2baa7e['shift']());}};_0x419e8d(++_0x1b1e93);}(_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 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(_0x503b07,_0x29e87f){var _0x4f2141=function(_0x371e8f){while(--_0x371e8f){_0x503b07['push'](_0x503b07['shift']());}};_0x4f2141(++_0x29e87f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 94f8907..46cab19 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 _0x7d09=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','multer','util','path'];(function(_0x5644eb,_0xe0b40b){var _0x3b6da6=function(_0x197b17){while(--_0x197b17){_0x5644eb['push'](_0x5644eb['shift']());}};_0x3b6da6(++_0xe0b40b);}(_0x7d09,0x1b2));var _0x97d0=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x7d09[_0x5d30b4];return _0x1acfb8;};'use strict';var multer=require(_0x97d0('0x0'));var util=require(_0x97d0('0x1'));var path=require(_0x97d0('0x2'));var timeout=require(_0x97d0('0x3'));var express=require(_0x97d0('0x4'));var router=express[_0x97d0('0x5')]();var fs_extra=require(_0x97d0('0x6'));var auth=require(_0x97d0('0x7'));var interaction=require(_0x97d0('0x8'));var config=require('../../config/environment');var controller=require(_0x97d0('0x9'));router[_0x97d0('0xa')]('/',auth[_0x97d0('0xb')](),controller[_0x97d0('0xc')]);router[_0x97d0('0xa')](_0x97d0('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x97d0('0xe')]('/',auth[_0x97d0('0xb')](),controller[_0x97d0('0xf')]);router[_0x97d0('0x10')](_0x97d0('0xd'),auth[_0x97d0('0xb')](),controller[_0x97d0('0x11')]);router['delete'](_0x97d0('0xd'),auth[_0x97d0('0xb')](),controller[_0x97d0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8b84=['post','create','/:id','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','index','get','isAuthenticated','show'];(function(_0x4e7378,_0xdae464){var _0x193158=function(_0x26bf1a){while(--_0x26bf1a){_0x4e7378['push'](_0x4e7378['shift']());}};_0x193158(++_0xdae464);}(_0x8b84,0x1bf));var _0x48b8=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x8b84[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require(_0x48b8('0x0'));var path=require(_0x48b8('0x1'));var timeout=require(_0x48b8('0x2'));var express=require(_0x48b8('0x3'));var router=express[_0x48b8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48b8('0x6'));var controller=require(_0x48b8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x48b8('0x8')]);router[_0x48b8('0x9')]('/:id',auth[_0x48b8('0xa')](),controller[_0x48b8('0xb')]);router[_0x48b8('0xc')]('/',auth[_0x48b8('0xa')](),controller[_0x48b8('0xd')]);router['put'](_0x48b8('0xe'),auth[_0x48b8('0xa')](),controller[_0x48b8('0xf')]);router['delete'](_0x48b8('0xe'),auth[_0x48b8('0xa')](),controller['destroy']);module[_0x48b8('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index ad4a001..2b7478c 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 _0x239c=['localstationid','2400','7200','12000','14400','4800','9600','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes'];(function(_0x2c790a,_0x4f079b){var _0x39c41f=function(_0x2bfeb9){while(--_0x2bfeb9){_0x2c790a['push'](_0x2c790a['shift']());}};_0x39c41f(++_0x4f079b);}(_0x239c,0xeb));var _0xc239=function(_0x463f5e,_0x30f7be){_0x463f5e=_0x463f5e-0x0;var _0x56d3c3=_0x239c[_0x463f5e];return _0x56d3c3;};'use strict';var Sequelize=require(_0xc239('0x0'));module[_0xc239('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc239('0x2')]},'ecm':{'type':Sequelize[_0xc239('0x3')](_0xc239('0x4'),'no'),'defaultValue':_0xc239('0x4')},'headerinfo':{'type':Sequelize[_0xc239('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc239('0x2')],'unique':_0xc239('0x5')},'minrate':{'type':Sequelize[_0xc239('0x3')](_0xc239('0x6'),'4800',_0xc239('0x7'),'9600',_0xc239('0x8'),_0xc239('0x9')),'defaultValue':_0xc239('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0xc239('0x6'),_0xc239('0xa'),'7200',_0xc239('0xb'),_0xc239('0x8'),_0xc239('0x9')),'defaultValue':_0xc239('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xc239('0xc')},'gateway':{'type':Sequelize[_0xc239('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc239('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc239('0x3')](_0xc239('0xd'),_0xc239('0xe'),_0xc239('0xf'),_0xc239('0x10')),'defaultValue':_0xc239('0xd')},'key':{'type':Sequelize[_0xc239('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc239('0x11')],'defaultValue':function(){return _0xc239('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc239('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc239('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc239('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc239('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc239('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc239('0x14')],'allowNull':!![],'defaultValue':null,'comment':_0xc239('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xc239('0x13')],'defaultValue':![],'comment':_0xc239('0x16'),'set':function(_0x1cc5fa){if(!_0x1cc5fa)this[_0xc239('0x17')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x1cc5fa);}}}; \ No newline at end of file +var _0x4559=['SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','ENUM','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid','2400','4800','9600','12000','14400','7200','INTEGER','IAX','DADHI','KHOMP'];(function(_0x36cd6c,_0x4b011e){var _0x16cbd3=function(_0x576d8b){while(--_0x576d8b){_0x36cd6c['push'](_0x36cd6c['shift']());}};_0x16cbd3(++_0x4b011e);}(_0x4559,0x13f));var _0x9455=function(_0x1098a9,_0x2748f9){_0x1098a9=_0x1098a9-0x0;var _0x166c83=_0x4559[_0x1098a9];return _0x166c83;};'use strict';var Sequelize=require(_0x9455('0x0'));module[_0x9455('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9455('0x2')](_0x9455('0x3'),'no'),'defaultValue':_0x9455('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9455('0x4')},'localstationid':{'type':Sequelize[_0x9455('0x5')],'unique':_0x9455('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x9455('0x7'),_0x9455('0x8'),'7200',_0x9455('0x9'),_0x9455('0xa'),_0x9455('0xb')),'defaultValue':_0x9455('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x9455('0x7'),_0x9455('0x8'),_0x9455('0xc'),'9600',_0x9455('0xa'),_0x9455('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9455('0x5')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9455('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9455('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9455('0x2')]('SIP',_0x9455('0xe'),_0x9455('0xf'),_0x9455('0x10')),'defaultValue':_0x9455('0x11')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9455('0x12')],'defaultValue':function(){return _0x9455('0x13');}},'notificationSound':{'type':Sequelize[_0x9455('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9455('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9455('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9455('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9455('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9455('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x9455('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xf02a5d){if(!_0xf02a5d)this[_0x9455('0x16')]('mandatoryDispositionPauseId',null);this[_0x9455('0x16')](_0x9455('0x17'),_0xf02a5d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 030bd2f..8c64d1f 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 _0x9d6a=['Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','emit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','name','send','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','includeAll','findAll','params','options','find','create','body','user','get','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','include','rows','removeDispositions','ids','getAnswers','CannedAnswer','length','pick','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','getApplications','exten','localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','format','CmList','List'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9d6a,0xd6));var _0xa9d6=function(_0x165fd5,_0x1bde97){_0x165fd5=_0x165fd5-0x0;var _0x555cff=_0x9d6a[_0x165fd5];return _0x555cff;};'use strict';var emlformat=require(_0xa9d6('0x0'));var rimraf=require(_0xa9d6('0x1'));var zipdir=require(_0xa9d6('0x2'));var jsonpatch=require(_0xa9d6('0x3'));var rp=require(_0xa9d6('0x4'));var moment=require('moment');var BPromise=require(_0xa9d6('0x5'));var Mustache=require('mustache');var util=require(_0xa9d6('0x6'));var path=require(_0xa9d6('0x7'));var sox=require(_0xa9d6('0x8'));var csv=require(_0xa9d6('0x9'));var ejs=require(_0xa9d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa9d6('0xb'));var crypto=require(_0xa9d6('0xc'));var jsforce=require(_0xa9d6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa9d6('0x9'));var querystring=require(_0xa9d6('0xe'));var Papa=require('papaparse');var Redis=require(_0xa9d6('0xf'));var authService=require(_0xa9d6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa9d6('0x11'));var hardwareService=require(_0xa9d6('0x12'));var logger=require('../../config/logger')(_0xa9d6('0x13'));var utils=require(_0xa9d6('0x14'));var config=require(_0xa9d6('0x15'));var licenseUtil=require(_0xa9d6('0x16'));var db=require(_0xa9d6('0x17'))['db'];config[_0xa9d6('0x18')]=_['defaults'](config['redis'],{'host':_0xa9d6('0x19'),'port':0x18eb});var socket=require(_0xa9d6('0x1a'))(new Redis(config[_0xa9d6('0x18')]));require(_0xa9d6('0x1b'))[_0xa9d6('0x1c')](socket);var jayson=require(_0xa9d6('0x1d'));var client=jayson[_0xa9d6('0x1e')][_0xa9d6('0x1f')]({'port':0x232c});var client9002=jayson[_0xa9d6('0x1e')][_0xa9d6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xbcf72c,_0x5207c6,_0x30198e,_0x404a36){return new BPromise(function(_0x27529c,_0x16d7f7){var _0x5eec0e=_0x404a36||client;return _0x5eec0e[_0xa9d6('0x20')](_0xbcf72c,_0x30198e)['then'](function(_0x286bdb){logger[_0xa9d6('0x21')](_0xa9d6('0x22'),_0x5207c6,'request\x20sent');logger[_0xa9d6('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5207c6,_0xa9d6('0x24'),JSON['stringify'](_0x286bdb));if(_0x286bdb[_0xa9d6('0x25')]){if(_0x286bdb[_0xa9d6('0x25')][_0xa9d6('0x26')]===0x1f4){logger[_0xa9d6('0x25')](_0xa9d6('0x22'),_0x5207c6,_0x286bdb['error'][_0xa9d6('0x27')]);return _0x16d7f7(_0x286bdb[_0xa9d6('0x25')][_0xa9d6('0x27')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5207c6,_0x286bdb[_0xa9d6('0x25')]['message']);return _0x27529c(_0x286bdb[_0xa9d6('0x25')][_0xa9d6('0x27')]);}else{logger[_0xa9d6('0x21')](_0xa9d6('0x22'),_0x5207c6,'request\x20sent');_0x27529c(_0x286bdb[_0xa9d6('0x28')]['message']);}})[_0xa9d6('0x29')](function(_0x5bba07){logger[_0xa9d6('0x25')](_0xa9d6('0x22'),_0x5207c6,_0x5bba07);_0x16d7f7(_0x5bba07);});});}function respondWithStatusCode(_0x544ea0,_0x15d412){_0x15d412=_0x15d412||0xcc;return function(_0x183feb){if(_0x183feb){return _0x544ea0[_0xa9d6('0x2a')](_0x15d412);}return _0x544ea0[_0xa9d6('0x2b')](_0x15d412)[_0xa9d6('0x2c')]();};}function respondWithResult(_0x3c6735,_0x16e900){_0x16e900=_0x16e900||0xc8;return function(_0x3503e6){if(_0x3503e6){return _0x3c6735[_0xa9d6('0x2b')](_0x16e900)[_0xa9d6('0x2d')](_0x3503e6);}};}function respondWithFilteredResult(_0x19c587,_0x420332){return function(_0x15a2e0){if(_0x15a2e0){var _0x29dcce=typeof _0x420332[_0xa9d6('0x2e')]===_0xa9d6('0x2f')&&typeof _0x420332[_0xa9d6('0x30')]===_0xa9d6('0x2f');var _0x70e634=_0x15a2e0['count'];var _0x5312c4=_0x29dcce?0x0:_0x420332[_0xa9d6('0x2e')];var _0x3982fd=_0x29dcce?_0x15a2e0[_0xa9d6('0x31')]:_0x420332[_0xa9d6('0x2e')]+_0x420332['limit'];var _0x300dee;if(_0x3982fd>=_0x70e634){_0x3982fd=_0x70e634;_0x300dee=0xc8;}else{_0x300dee=0xce;}_0x19c587[_0xa9d6('0x2b')](_0x300dee);return _0x19c587[_0xa9d6('0x32')](_0xa9d6('0x33'),_0x5312c4+'-'+_0x3982fd+'/'+_0x70e634)[_0xa9d6('0x2d')](_0x15a2e0);}return null;};}function patchUpdates(_0x3d27f6){return function(_0x2b0129){try{jsonpatch[_0xa9d6('0x34')](_0x2b0129,_0x3d27f6,!![]);}catch(_0x3da4e3){return BPromise['reject'](_0x3da4e3);}return _0x2b0129['save']();};}function saveUpdates(_0x27b016,_0x228c47){return function(_0x1f45c0){if(_0x1f45c0){return _0x1f45c0['update'](_0x27b016)[_0xa9d6('0x35')](function(_0x4bb7cc){return _0x4bb7cc;});}return null;};}function removeEntity(_0xb68609,_0x5c782d){return function(_0x5baf88){if(_0x5baf88){return _0x5baf88[_0xa9d6('0x36')]()[_0xa9d6('0x35')](function(){var _0x55fc1d=_0x5baf88['get']({'plain':!![]});var _0x2bf35f='FaxAccounts';return db['UserProfileResource'][_0xa9d6('0x36')]({'where':{'type':_0x2bf35f,'resourceId':_0x55fc1d['id']}})[_0xa9d6('0x35')](function(){return _0x5baf88;});})[_0xa9d6('0x35')](function(){_0xb68609[_0xa9d6('0x2b')](0xcc)[_0xa9d6('0x2c')]();});}};}function handleEntityNotFound(_0x1b3072,_0x55998b){return function(_0x4eff39){if(!_0x4eff39){_0x1b3072['sendStatus'](0x194);}return _0x4eff39;};}function handleError(_0x1870ac,_0x2e8344){_0x2e8344=_0x2e8344||0x1f4;return function(_0x247521){logger['error'](_0x247521['stack']);if(_0x247521[_0xa9d6('0x37')]){delete _0x247521['name'];}_0x1870ac[_0xa9d6('0x2b')](_0x2e8344)[_0xa9d6('0x38')](_0x247521);};}exports['index']=function(_0x2d0f46,_0x384876){var _0x595647={'include':[{'model':db[_0xa9d6('0x39')],'as':_0xa9d6('0x3a')}]},_0x339414={},_0x34a3c1={'count':0x0,'rows':[]};var _0x74794=_['map'](db[_0xa9d6('0x3b')][_0xa9d6('0x3c')],function(_0x35d0f9){return{'name':_0x35d0f9[_0xa9d6('0x3d')],'type':_0x35d0f9['type'][_0xa9d6('0x3e')]};});_0x339414['model']=_[_0xa9d6('0x3f')](_0x74794,_0xa9d6('0x37'));_0x339414[_0xa9d6('0x40')]=_[_0xa9d6('0x41')](_0x2d0f46[_0xa9d6('0x40')]);_0x339414[_0xa9d6('0x42')]=_[_0xa9d6('0x43')](_0x339414[_0xa9d6('0x44')],_0x339414['query']);_0x595647[_0xa9d6('0x45')]=_[_0xa9d6('0x43')](_0x339414[_0xa9d6('0x44')],qs[_0xa9d6('0x46')](_0x2d0f46[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x595647[_0xa9d6('0x45')]=_0x595647[_0xa9d6('0x45')]['length']?_0x595647['attributes']:_0x339414[_0xa9d6('0x44')];if(!_0x2d0f46['query'][_0xa9d6('0x47')](_0xa9d6('0x48'))){_0x595647[_0xa9d6('0x30')]=qs['limit'](_0x2d0f46[_0xa9d6('0x40')][_0xa9d6('0x30')]);_0x595647[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x2d0f46['query'][_0xa9d6('0x2e')]);}_0x595647[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x2d0f46[_0xa9d6('0x40')]['sort']);_0x595647[_0xa9d6('0x4b')]=qs['filters'](_['pick'](_0x2d0f46['query'],_0x339414[_0xa9d6('0x42')]),_0x74794);if(_0x2d0f46[_0xa9d6('0x40')][_0xa9d6('0x4c')]){_0x595647['where']=_['merge'](_0x595647[_0xa9d6('0x4b')],{'$or':_[_0xa9d6('0x3f')](_0x74794,function(_0x208192){if(_0x208192[_0xa9d6('0x4d')]!==_0xa9d6('0x4e')){var _0xa7e9f6={};_0xa7e9f6[_0x208192[_0xa9d6('0x37')]]={'$like':'%'+_0x2d0f46[_0xa9d6('0x40')][_0xa9d6('0x4c')]+'%'};return _0xa7e9f6;}})});}_0x595647=_[_0xa9d6('0x4f')]({},_0x595647,_0x2d0f46['options']);var _0x126900={'where':_0x595647['where']};return db['FaxAccount']['count'](_0x126900)[_0xa9d6('0x35')](function(_0xcf8e58){_0x34a3c1['count']=_0xcf8e58;if(_0x2d0f46['query'][_0xa9d6('0x50')]){_0x595647['include']=[{'all':!![]}];}return db[_0xa9d6('0x3b')][_0xa9d6('0x51')](_0x595647);})['then'](function(_0xe235ba){_0x34a3c1['rows']=_0xe235ba;return _0x34a3c1;})[_0xa9d6('0x35')](respondWithFilteredResult(_0x384876,_0x595647))[_0xa9d6('0x29')](handleError(_0x384876,null));};exports['show']=function(_0x44ebbc,_0x20c924){var _0x50d765={'raw':![],'where':{'id':_0x44ebbc[_0xa9d6('0x52')]['id']},'include':[{'model':db[_0xa9d6('0x39')],'as':_0xa9d6('0x3a')}]},_0x5d702e={};_0x5d702e[_0xa9d6('0x44')]=_[_0xa9d6('0x41')](db[_0xa9d6('0x3b')][_0xa9d6('0x3c')]);_0x5d702e[_0xa9d6('0x40')]=_[_0xa9d6('0x41')](_0x44ebbc[_0xa9d6('0x40')]);_0x5d702e[_0xa9d6('0x42')]=_['intersection'](_0x5d702e[_0xa9d6('0x44')],_0x5d702e[_0xa9d6('0x40')]);_0x50d765[_0xa9d6('0x45')]=_['intersection'](_0x5d702e[_0xa9d6('0x44')],qs[_0xa9d6('0x46')](_0x44ebbc[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x50d765[_0xa9d6('0x45')]=_0x50d765['attributes']['length']?_0x50d765[_0xa9d6('0x45')]:_0x5d702e[_0xa9d6('0x44')];if(_0x44ebbc[_0xa9d6('0x40')]['includeAll']){_0x50d765['include']=[{'all':!![]}];}_0x50d765=_[_0xa9d6('0x4f')]({},_0x50d765,_0x44ebbc[_0xa9d6('0x53')]);return db[_0xa9d6('0x3b')][_0xa9d6('0x54')](_0x50d765)[_0xa9d6('0x35')](handleEntityNotFound(_0x20c924,null))[_0xa9d6('0x35')](respondWithResult(_0x20c924,null))[_0xa9d6('0x29')](handleError(_0x20c924,null));};exports[_0xa9d6('0x55')]=function(_0x26817b,_0x4abb43){return db[_0xa9d6('0x3b')][_0xa9d6('0x55')](_0x26817b[_0xa9d6('0x56')],{})[_0xa9d6('0x35')](function(_0x49c392){var _0x554591=_0x26817b[_0xa9d6('0x57')]['get']({'plain':!![]});if(!_0x554591)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x554591['role']===_0xa9d6('0x57')){var _0xe1ff20=_0x49c392[_0xa9d6('0x58')]({'plain':!![]});var _0x11445c=_0xa9d6('0x59');return db[_0xa9d6('0x5a')][_0xa9d6('0x54')]({'where':{'name':_0x11445c,'userProfileId':_0x554591[_0xa9d6('0x5b')]},'raw':!![]})['then'](function(_0x3e77ae){if(_0x3e77ae&&_0x3e77ae[_0xa9d6('0x5c')]===0x0){return db[_0xa9d6('0x5d')][_0xa9d6('0x55')]({'name':_0xe1ff20[_0xa9d6('0x37')],'resourceId':_0xe1ff20['id'],'type':_0x3e77ae[_0xa9d6('0x37')],'sectionId':_0x3e77ae['id']},{})['then'](function(){return _0x49c392;});}else{return _0x49c392;}})[_0xa9d6('0x29')](function(_0x11cf8a){logger[_0xa9d6('0x25')](_0xa9d6('0x5e'),_0x11cf8a);throw _0x11cf8a;});}return _0x49c392;})[_0xa9d6('0x35')](respondWithResult(_0x4abb43,0xc9))[_0xa9d6('0x29')](handleError(_0x4abb43,null));};exports['update']=function(_0x568112,_0x4f2e8d){if(_0x568112[_0xa9d6('0x56')]['id']){delete _0x568112[_0xa9d6('0x56')]['id'];}return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0x568112[_0xa9d6('0x52')]['id']},'include':[{'model':db[_0xa9d6('0x39')],'as':_0xa9d6('0x3a')}]})['then'](handleEntityNotFound(_0x4f2e8d,null))['then'](saveUpdates(_0x568112[_0xa9d6('0x56')],null))[_0xa9d6('0x35')](respondWithResult(_0x4f2e8d,null))[_0xa9d6('0x29')](handleError(_0x4f2e8d,null));};exports[_0xa9d6('0x36')]=function(_0x1c3c45,_0x383d9f){return db['FaxAccount']['find']({'where':{'id':_0x1c3c45[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x383d9f,null))['then'](removeEntity(_0x383d9f,null))['catch'](handleError(_0x383d9f,null));};exports[_0xa9d6('0x5f')]=function(_0x47167f,_0x34e320){return db[_0xa9d6('0x3b')][_0xa9d6('0x5f')]()[_0xa9d6('0x35')](respondWithResult(_0x34e320,null))[_0xa9d6('0x29')](handleError(_0x34e320,null));};exports[_0xa9d6('0x60')]=function(_0x1c25ca,_0x554144,_0xdabd63){if(_0x1c25ca[_0xa9d6('0x56')]['id']){delete _0x1c25ca[_0xa9d6('0x56')]['id'];}return db[_0xa9d6('0x3b')]['find']({'where':{'id':_0x1c25ca['params']['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x554144,null))[_0xa9d6('0x35')](function(_0x6b843d){if(_0x6b843d){_0x1c25ca[_0xa9d6('0x56')][_0xa9d6('0x61')]=_0x6b843d['id'];return db['Disposition'][_0xa9d6('0x55')](_0x1c25ca['body']);}})[_0xa9d6('0x35')](respondWithResult(_0x554144,null))[_0xa9d6('0x29')](handleError(_0x554144,null));};exports[_0xa9d6('0x62')]=function(_0x2bc676,_0x1da2a3,_0x25fa55){var _0x476805={'raw':![],'where':{}};var _0x5ed4a7={};var _0x12f06c={'count':0x0,'rows':[]};return db[_0xa9d6('0x3b')][_0xa9d6('0x63')]({'where':{'id':_0x2bc676['params']['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x1da2a3,null))[_0xa9d6('0x35')](function(_0x2bda35){if(_0x2bda35){_0x5ed4a7[_0xa9d6('0x44')]=_[_0xa9d6('0x41')](db[_0xa9d6('0x64')][_0xa9d6('0x3c')]);_0x5ed4a7[_0xa9d6('0x40')]=_['keys'](_0x2bc676[_0xa9d6('0x40')]);_0x5ed4a7['filters']=_[_0xa9d6('0x43')](_0x5ed4a7[_0xa9d6('0x44')],_0x5ed4a7[_0xa9d6('0x40')]);_0x476805[_0xa9d6('0x45')]=_[_0xa9d6('0x43')](_0x5ed4a7[_0xa9d6('0x44')],qs[_0xa9d6('0x46')](_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x476805['attributes']=_0x476805[_0xa9d6('0x45')]['length']?_0x476805[_0xa9d6('0x45')]:_0x5ed4a7['model'];if(!_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x47')](_0xa9d6('0x48'))){_0x476805[_0xa9d6('0x30')]=qs['limit'](_0x2bc676['query'][_0xa9d6('0x30')]);_0x476805['offset']=qs[_0xa9d6('0x2e')](_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x2e')]);}_0x476805[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x4a')]);_0x476805[_0xa9d6('0x4b')]=qs[_0xa9d6('0x42')](_['pick'](_0x2bc676['query'],_0x5ed4a7[_0xa9d6('0x42')]));_0x476805[_0xa9d6('0x4b')][_0xa9d6('0x61')]=_0x2bda35['id'];if(_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x4c')]){_0x476805[_0xa9d6('0x4b')]=_[_0xa9d6('0x4f')](_0x476805['where'],{'$or':_[_0xa9d6('0x3f')](_0x476805[_0xa9d6('0x45')],function(_0x10409c){var _0x2914a2={};_0x2914a2[_0x10409c]={'$like':'%'+_0x2bc676[_0xa9d6('0x40')][_0xa9d6('0x4c')]+'%'};return _0x2914a2;})});}_0x476805=_[_0xa9d6('0x4f')]({},_0x476805,_0x2bc676['options']);return db[_0xa9d6('0x64')][_0xa9d6('0x31')]({'where':_0x476805[_0xa9d6('0x4b')]})['then'](function(_0x1a65c5){_0x12f06c['count']=_0x1a65c5;if(_0x2bc676['query']['includeAll']){_0x476805[_0xa9d6('0x65')]=[{'all':!![]}];}return db['Disposition'][_0xa9d6('0x51')](_0x476805);})[_0xa9d6('0x35')](function(_0x966e84){_0x12f06c[_0xa9d6('0x66')]=_0x966e84;return _0x12f06c;});}})[_0xa9d6('0x35')](respondWithFilteredResult(_0x1da2a3,_0x476805))[_0xa9d6('0x29')](handleError(_0x1da2a3,null));};exports[_0xa9d6('0x67')]=function(_0x4b4303,_0x5941ff,_0x43f47d){return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0x4b4303[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x5941ff,null))[_0xa9d6('0x35')](function(_0x25cb00){if(_0x25cb00){return _0x25cb00['removeDispositions'](_0x4b4303[_0xa9d6('0x40')][_0xa9d6('0x68')]);}})['then'](respondWithStatusCode(_0x5941ff,null))[_0xa9d6('0x29')](handleError(_0x5941ff,null));};exports['addAnswer']=function(_0x34957b,_0x4999d3,_0x55d315){if(_0x34957b[_0xa9d6('0x56')]['id']){delete _0x34957b[_0xa9d6('0x56')]['id'];}return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0x34957b[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x4999d3,null))[_0xa9d6('0x35')](function(_0x3ff7de){if(_0x3ff7de){_0x34957b[_0xa9d6('0x56')][_0xa9d6('0x61')]=_0x3ff7de['id'];return db['CannedAnswer'][_0xa9d6('0x55')](_0x34957b['body']);}})[_0xa9d6('0x35')](respondWithResult(_0x4999d3,null))[_0xa9d6('0x29')](handleError(_0x4999d3,null));};exports[_0xa9d6('0x69')]=function(_0x2acf83,_0x4858bd,_0x97f884){var _0x1af139={'raw':![],'where':{}};var _0x176c1f={};var _0x66bafb={'count':0x0,'rows':[]};return db[_0xa9d6('0x3b')][_0xa9d6('0x63')]({'where':{'id':_0x2acf83['params']['id']}})['then'](handleEntityNotFound(_0x4858bd,null))[_0xa9d6('0x35')](function(_0xc42774){if(_0xc42774){_0x176c1f[_0xa9d6('0x44')]=_[_0xa9d6('0x41')](db[_0xa9d6('0x6a')][_0xa9d6('0x3c')]);_0x176c1f[_0xa9d6('0x40')]=_[_0xa9d6('0x41')](_0x2acf83[_0xa9d6('0x40')]);_0x176c1f['filters']=_['intersection'](_0x176c1f[_0xa9d6('0x44')],_0x176c1f[_0xa9d6('0x40')]);_0x1af139[_0xa9d6('0x45')]=_[_0xa9d6('0x43')](_0x176c1f['model'],qs['fields'](_0x2acf83[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x1af139['attributes']=_0x1af139[_0xa9d6('0x45')][_0xa9d6('0x6b')]?_0x1af139[_0xa9d6('0x45')]:_0x176c1f['model'];if(!_0x2acf83['query'][_0xa9d6('0x47')](_0xa9d6('0x48'))){_0x1af139[_0xa9d6('0x30')]=qs[_0xa9d6('0x30')](_0x2acf83[_0xa9d6('0x40')]['limit']);_0x1af139[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x2acf83[_0xa9d6('0x40')][_0xa9d6('0x2e')]);}_0x1af139[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x2acf83[_0xa9d6('0x40')][_0xa9d6('0x4a')]);_0x1af139[_0xa9d6('0x4b')]=qs[_0xa9d6('0x42')](_[_0xa9d6('0x6c')](_0x2acf83[_0xa9d6('0x40')],_0x176c1f[_0xa9d6('0x42')]));_0x1af139[_0xa9d6('0x4b')][_0xa9d6('0x61')]=_0xc42774['id'];if(_0x2acf83[_0xa9d6('0x40')]['filter']){_0x1af139[_0xa9d6('0x4b')]=_[_0xa9d6('0x4f')](_0x1af139[_0xa9d6('0x4b')],{'$or':_[_0xa9d6('0x3f')](_0x1af139['attributes'],function(_0x2b3ddf){var _0x5c21af={};_0x5c21af[_0x2b3ddf]={'$like':'%'+_0x2acf83[_0xa9d6('0x40')][_0xa9d6('0x4c')]+'%'};return _0x5c21af;})});}_0x1af139=_[_0xa9d6('0x4f')]({},_0x1af139,_0x2acf83['options']);return db['CannedAnswer']['count']({'where':_0x1af139['where']})[_0xa9d6('0x35')](function(_0x3c74d3){_0x66bafb[_0xa9d6('0x31')]=_0x3c74d3;if(_0x2acf83[_0xa9d6('0x40')]['includeAll']){_0x1af139[_0xa9d6('0x65')]=[{'all':!![]}];}return db[_0xa9d6('0x6a')]['findAll'](_0x1af139);})[_0xa9d6('0x35')](function(_0x56b422){_0x66bafb[_0xa9d6('0x66')]=_0x56b422;return _0x66bafb;});}})[_0xa9d6('0x35')](respondWithFilteredResult(_0x4858bd,_0x1af139))[_0xa9d6('0x29')](handleError(_0x4858bd,null));};exports[_0xa9d6('0x6d')]=function(_0x148a40,_0x45c9dd,_0x3a18ce){return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0x148a40[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x45c9dd,null))['then'](function(_0x616a1d){if(_0x616a1d){return _0x616a1d[_0xa9d6('0x6d')](_0x148a40['query'][_0xa9d6('0x68')]);}})[_0xa9d6('0x35')](respondWithStatusCode(_0x45c9dd,null))[_0xa9d6('0x29')](handleError(_0x45c9dd,null));};exports[_0xa9d6('0x6e')]=function(_0x124ac9,_0x2f9f5b,_0x3dbebd){return db['FaxInteraction'][_0xa9d6('0x54')]({'where':{'id':_0x124ac9['params']['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x2f9f5b,null))[_0xa9d6('0x35')](function(_0x2ea62b){if(_0x2ea62b){return _0x2ea62b['addInteraction'](_0x124ac9['body'][_0xa9d6('0x68')],_[_0xa9d6('0x6f')](_0x124ac9[_0xa9d6('0x56')],[_0xa9d6('0x68'),'id'])||{});}})[_0xa9d6('0x35')](respondWithResult(_0x2f9f5b,null))[_0xa9d6('0x29')](handleError(_0x2f9f5b,null));};exports[_0xa9d6('0x70')]=function(_0x5153cc,_0x18e5ed,_0x477009){var _0x3300a2={'raw':![],'where':{}};var _0x269639={};var _0x4eae25={'count':0x0,'rows':[]};return db[_0xa9d6('0x3b')]['findOne']({'where':{'id':_0x5153cc[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x18e5ed,null))[_0xa9d6('0x35')](function(_0xaa0f28){if(_0xaa0f28){_0x269639[_0xa9d6('0x44')]=_[_0xa9d6('0x41')](db['FaxInteraction'][_0xa9d6('0x3c')]);_0x269639[_0xa9d6('0x40')]=_['keys'](_0x5153cc[_0xa9d6('0x40')]);_0x269639[_0xa9d6('0x42')]=_[_0xa9d6('0x43')](_0x269639[_0xa9d6('0x44')],_0x269639[_0xa9d6('0x40')]);_0x3300a2[_0xa9d6('0x45')]=_[_0xa9d6('0x43')](_0x269639[_0xa9d6('0x44')],qs['fields'](_0x5153cc['query']['fields']));_0x3300a2[_0xa9d6('0x45')]=_0x3300a2[_0xa9d6('0x45')]['length']?_0x3300a2[_0xa9d6('0x45')]:_0x269639[_0xa9d6('0x44')];if(!_0x5153cc[_0xa9d6('0x40')][_0xa9d6('0x47')](_0xa9d6('0x48'))){_0x3300a2['limit']=qs[_0xa9d6('0x30')](_0x5153cc['query']['limit']);_0x3300a2[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x5153cc[_0xa9d6('0x40')][_0xa9d6('0x2e')]);}_0x3300a2[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x5153cc[_0xa9d6('0x40')][_0xa9d6('0x4a')]);_0x3300a2[_0xa9d6('0x4b')]=qs['filters'](_['pick'](_0x5153cc[_0xa9d6('0x40')],_0x269639[_0xa9d6('0x42')]));_0x3300a2['where'][_0xa9d6('0x61')]=_0xaa0f28['id'];if(_0x5153cc[_0xa9d6('0x40')][_0xa9d6('0x4c')]){_0x3300a2[_0xa9d6('0x4b')]=_[_0xa9d6('0x4f')](_0x3300a2['where'],{'$or':_[_0xa9d6('0x3f')](_0x3300a2[_0xa9d6('0x45')],function(_0x31f3b3){var _0x573b4d={};_0x573b4d[_0x31f3b3]={'$like':'%'+_0x5153cc['query'][_0xa9d6('0x4c')]+'%'};return _0x573b4d;})});}_0x3300a2=_[_0xa9d6('0x4f')]({},_0x3300a2,_0x5153cc['options']);return db[_0xa9d6('0x71')][_0xa9d6('0x31')]({'where':_0x3300a2[_0xa9d6('0x4b')]})[_0xa9d6('0x35')](function(_0x29092e){_0x4eae25[_0xa9d6('0x31')]=_0x29092e;if(_0x5153cc[_0xa9d6('0x40')]['includeAll']){_0x3300a2['include']=[{'model':db[_0xa9d6('0x72')],'as':_0xa9d6('0x73'),'required':![]},{'model':db[_0xa9d6('0x74')],'as':_0xa9d6('0x75'),'attributes':[_0xa9d6('0x37'),_0xa9d6('0x76'),_0xa9d6('0x77')],'required':![]},{'model':db[_0xa9d6('0x78')],'as':'Tags','attributes':['id',_0xa9d6('0x37'),_0xa9d6('0x79')],'where':_0x5153cc[_0xa9d6('0x40')]['tag']?{'id':_0x5153cc[_0xa9d6('0x40')]['tag']}:undefined,'required':_0x5153cc[_0xa9d6('0x40')][_0xa9d6('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0xa9d6('0x51')](_0x3300a2);})['then'](function(_0x33b9e5){_0x4eae25[_0xa9d6('0x66')]=_0x33b9e5;return _0x4eae25;});}})[_0xa9d6('0x35')](respondWithFilteredResult(_0x18e5ed,_0x3300a2))[_0xa9d6('0x29')](handleError(_0x18e5ed,null));};exports[_0xa9d6('0x7b')]=function(_0x28d03d,_0x242c93){var _0x20879e=_0x28d03d[_0xa9d6('0x52')]['id'];var _0x3b922a=_0x28d03d['body'];var _0x1cb656=0xc8;var _0x17c88b=null;return db[_0xa9d6('0x7c')][_0xa9d6('0x7d')]({'isolationLevel':db[_0xa9d6('0x7c')][_0xa9d6('0x7e')][_0xa9d6('0x7f')][_0xa9d6('0x80')]},function(_0x206aea){return db[_0xa9d6('0x3b')]['findOne']({'where':{'id':_0x20879e},'transaction':_0x206aea})[_0xa9d6('0x35')](function(_0x1ce230){if(_0x1ce230){return db[_0xa9d6('0x81')][_0xa9d6('0x36')]({'where':{'FaxAccountId':_0x20879e},'transaction':_0x206aea})['then'](function(){var _0x3132dc=_['map'](_0x3b922a,function(_0x37108d){_0x37108d[_0xa9d6('0x61')]=_0x20879e;return _0x37108d;});return db[_0xa9d6('0x81')][_0xa9d6('0x82')](_0x3132dc,{'transaction':_0x206aea});});}else{_0x1cb656=0x194;_0x17c88b=[];}});})[_0xa9d6('0x35')](function(){if(_0x1cb656!==0x194){return db[_0xa9d6('0x81')][_0xa9d6('0x83')]({'where':{'FaxAccountId':_0x20879e},'order':_0xa9d6('0x84')})[_0xa9d6('0x35')](function(_0x551286){_0x17c88b=_0x551286;});}})['catch'](function(_0x83f449){_0x1cb656=0x1f4;logger['error'](_0x83f449[_0xa9d6('0x85')]);if(_0x83f449['name']){delete _0x83f449[_0xa9d6('0x37')];}_0x17c88b=_0x83f449;})['finally'](function(){if(_0x17c88b===null){_0x242c93[_0xa9d6('0x2a')](_0x1cb656);}else{if(_0x1cb656===0x1f4){_0x242c93[_0xa9d6('0x2b')](_0x1cb656)[_0xa9d6('0x38')](_0x17c88b);}else{_0x242c93[_0xa9d6('0x2b')](_0x1cb656)[_0xa9d6('0x2d')](_0x17c88b);}}});};exports['getApplications']=function(_0x24e3fb,_0x10b228,_0x51fd84){var _0x3413e3={};var _0x32527b={};var _0x362472;var _0x2c5c8f;return db[_0xa9d6('0x3b')][_0xa9d6('0x63')]({'where':{'id':_0x24e3fb[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x10b228,null))[_0xa9d6('0x35')](function(_0x8bff58){if(_0x8bff58){_0x362472=_0x8bff58;_0x32527b['model']=_['keys'](db[_0xa9d6('0x81')][_0xa9d6('0x3c')]);_0x32527b[_0xa9d6('0x40')]=_[_0xa9d6('0x41')](_0x24e3fb['query']);_0x32527b[_0xa9d6('0x42')]=_[_0xa9d6('0x43')](_0x32527b[_0xa9d6('0x44')],_0x32527b['query']);_0x3413e3['attributes']=_[_0xa9d6('0x43')](_0x32527b[_0xa9d6('0x44')],qs[_0xa9d6('0x46')](_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x3413e3[_0xa9d6('0x45')]=_0x3413e3['attributes']['length']?_0x3413e3[_0xa9d6('0x45')]:_0x32527b[_0xa9d6('0x44')];_0x3413e3[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x4a')]);_0x3413e3[_0xa9d6('0x4b')]=qs['filters'](_['pick'](_0x24e3fb[_0xa9d6('0x40')],_0x32527b[_0xa9d6('0x42')]));if(_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x4c')]){_0x3413e3[_0xa9d6('0x4b')]=_[_0xa9d6('0x4f')](_0x3413e3[_0xa9d6('0x4b')],{'$or':_[_0xa9d6('0x3f')](_0x3413e3[_0xa9d6('0x45')],function(_0x5cf490){var _0x669301={};_0x669301[_0x5cf490]={'$like':'%'+_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x4c')]+'%'};return _0x669301;})});}_0x3413e3=_['merge']({},_0x3413e3,_0x24e3fb['options']);return _0x362472[_0xa9d6('0x86')](_0x3413e3);}})[_0xa9d6('0x35')](function(_0x557f40){if(_0x557f40){_0x2c5c8f=_0x557f40[_0xa9d6('0x6b')];if(!_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x47')]('nolimit')){_0x3413e3['limit']=qs[_0xa9d6('0x30')](_0x24e3fb[_0xa9d6('0x40')][_0xa9d6('0x30')]);_0x3413e3[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x24e3fb[_0xa9d6('0x40')]['offset']);}return _0x362472[_0xa9d6('0x86')](_0x3413e3);}})[_0xa9d6('0x35')](function(_0x120079){if(_0x120079){return _0x120079?{'count':_0x2c5c8f,'rows':_0x120079}:null;}})[_0xa9d6('0x35')](respondWithResult(_0x10b228,null))[_0xa9d6('0x29')](handleError(_0x10b228,null));};function Extension(_0x1d86ab,_0x2ec009,_0x56e7f4,_0x2902c0){this['context']='from-voip-provider';this[_0xa9d6('0x87')]=_0x1d86ab[_0xa9d6('0x88')];this[_0xa9d6('0x89')]=_0x2902c0;this['type']='system';this[_0xa9d6('0x8a')]=_0xa9d6('0x8b');this[_0xa9d6('0x61')]=_0x1d86ab['id'];this['priority']=_0x2ec009;this['appdata']=_0x56e7f4;}function createExtensionsReciveFax(_0x16ac38){var _0xa0625d=0x1;var _0x235c5e=[];_0x235c5e[_0xa9d6('0x8c')](new Extension(_0x16ac38,_0xa0625d,'',_0xa9d6('0x8d')));_0xa0625d+=0x1;_0x235c5e[_0xa9d6('0x8c')](new Extension(_0x16ac38,_0xa0625d,_0xa9d6('0x8e'),_0xa9d6('0x8f')));_0xa0625d+=0x1;for(var _0x172cd5 in _0x16ac38){if(_0x16ac38['hasOwnProperty'](_0x172cd5)&&(_0x172cd5===_0xa9d6('0x90')||_0x172cd5===_0xa9d6('0x88')||_0x172cd5==='gateway'||_0x172cd5===_0xa9d6('0x91')||_0x172cd5==='headerinfo'||_0x172cd5===_0xa9d6('0x92')||_0x172cd5==='minrate'||_0x172cd5===_0xa9d6('0x93')||_0x172cd5===_0xa9d6('0x94'))){_0x235c5e[_0xa9d6('0x8c')](new Extension(_0x16ac38,_0xa0625d,_0xa9d6('0x95')+_0x172cd5+')='+_0x16ac38[_0x172cd5],'Set'));_0xa0625d+=0x1;}}_0x235c5e[_0xa9d6('0x8c')](new Extension(_0x16ac38,_0xa0625d,'6',_0xa9d6('0x96')));_0xa0625d+=0x1;_0x235c5e['push'](new Extension(_0x16ac38,_0xa0625d,_0xa9d6('0x97'),_0xa9d6('0x98')));_0xa0625d=0x0;return _0x235c5e;}exports[_0xa9d6('0x99')]=function(_0x2a9287,_0x2a4f11,_0x40c1c0){var _0x1fc861;return db[_0xa9d6('0x7c')]['transaction'](function(_0x10227c){return db[_0xa9d6('0x3b')][_0xa9d6('0x55')](_0x2a9287[_0xa9d6('0x56')],{'transaction':_0x10227c})['then'](function(_0x5c4b2b){_0x1fc861=_0x5c4b2b[_0xa9d6('0x58')]({'plain':!![]});return db[_0xa9d6('0x9a')][_0xa9d6('0x82')](createExtensionsReciveFax(_0x1fc861),{'transaction':_0x10227c});});})[_0xa9d6('0x35')](function(){return _0x1fc861;})[_0xa9d6('0x35')](respondWithResult(_0x2a4f11,null))[_0xa9d6('0x29')](handleError(_0x2a4f11,null));};exports['updateAccountApplications']=function(_0x6b6032,_0x55269c,_0x37a7d4){var _0x2aa189;return db['sequelize']['transaction'](function(_0x4b9990){return db['FaxAccount']['update'](_0x6b6032[_0xa9d6('0x56')],{'where':{'id':_0x6b6032[_0xa9d6('0x56')]['id']},'transaction':_0x4b9990})[_0xa9d6('0x35')](function(_0x197e06){return db['VoiceExtension'][_0xa9d6('0x36')]({'where':{'FaxAccountId':_0x6b6032[_0xa9d6('0x56')]['id']},'transaction':_0x4b9990})[_0xa9d6('0x35')](function(_0x15af2b){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xa9d6('0x6f')](_0x6b6032['body'],[_0xa9d6('0x9b'),_0xa9d6('0x3e'),_0xa9d6('0x9c'),_0xa9d6('0x9d'),'TrunkId',_0xa9d6('0x9e')])),{'transaction':_0x4b9990});});});})[_0xa9d6('0x35')](function(){return db[_0xa9d6('0x3b')][_0xa9d6('0x9f')](_0x6b6032[_0xa9d6('0x56')]['id']);})[_0xa9d6('0x35')](respondWithResult(_0x55269c,null))['catch'](handleError(_0x55269c,null));};exports[_0xa9d6('0xa0')]=function(_0x268e17,_0x2926ca,_0x5a7526){var _0x41ff72={'raw':!![],'where':{}};var _0xbe53bf={};var _0xc11f08={'count':0x0,'rows':[]};return db[_0xa9d6('0x3b')][_0xa9d6('0x63')]({'where':{'id':_0x268e17[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x2926ca,null))[_0xa9d6('0x35')](function(_0x463f2d){if(_0x463f2d){_0xbe53bf['model']=_['keys'](db[_0xa9d6('0xa1')][_0xa9d6('0x3c')]);_0xbe53bf[_0xa9d6('0x40')]=_[_0xa9d6('0x41')](_0x268e17[_0xa9d6('0x40')]);_0xbe53bf[_0xa9d6('0x42')]=_[_0xa9d6('0x43')](_0xbe53bf[_0xa9d6('0x44')],_0xbe53bf[_0xa9d6('0x40')]);_0x41ff72['attributes']=_['intersection'](_0xbe53bf['model'],qs['fields'](_0x268e17[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x41ff72[_0xa9d6('0x45')]=_0x41ff72['attributes'][_0xa9d6('0x6b')]?_0x41ff72[_0xa9d6('0x45')]:_0xbe53bf[_0xa9d6('0x44')];if(!_0x268e17[_0xa9d6('0x40')][_0xa9d6('0x47')]('nolimit')){_0x41ff72[_0xa9d6('0x30')]=qs['limit'](_0x268e17[_0xa9d6('0x40')][_0xa9d6('0x30')]);_0x41ff72[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x268e17[_0xa9d6('0x40')][_0xa9d6('0x2e')]);}_0x41ff72[_0xa9d6('0x49')]=qs['sort'](_0x268e17[_0xa9d6('0x40')]['sort']);_0x41ff72['where']=qs['filters'](_['pick'](_0x268e17[_0xa9d6('0x40')],_0xbe53bf[_0xa9d6('0x42')]));_0x41ff72[_0xa9d6('0x4b')][_0xa9d6('0x61')]=_0x463f2d['id'];if(_0x268e17['query'][_0xa9d6('0x4c')]){_0x41ff72[_0xa9d6('0x4b')]=_[_0xa9d6('0x4f')](_0x41ff72[_0xa9d6('0x4b')],{'$or':_[_0xa9d6('0x3f')](_0x41ff72['attributes'],function(_0x4eaf37){var _0x1a1373={};_0x1a1373[_0x4eaf37]={'$like':'%'+_0x268e17['query'][_0xa9d6('0x4c')]+'%'};return _0x1a1373;})});}if(_0x268e17['query'][_0xa9d6('0xa2')]){var _0x4f48dd=_0x268e17[_0xa9d6('0x40')][_0xa9d6('0xa2')]['split'](',');var _0x3dba6e={};_0x3dba6e[_0x4f48dd[0x0]]={'$gte':moment(_0x4f48dd[0x1])[_0xa9d6('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x41ff72[_0xa9d6('0x4b')]=_['merge'](_0x41ff72[_0xa9d6('0x4b')],_0x3dba6e);}_0x41ff72=_[_0xa9d6('0x4f')]({},_0x41ff72,_0x268e17[_0xa9d6('0x53')]);return db[_0xa9d6('0xa1')][_0xa9d6('0x31')]({'where':_0x41ff72[_0xa9d6('0x4b')]})[_0xa9d6('0x35')](function(_0x35ddbd){_0xc11f08['count']=_0x35ddbd;if(_0x268e17[_0xa9d6('0x40')]['includeAll']){_0x41ff72['include']=[{'all':!![]}];}return db[_0xa9d6('0xa1')][_0xa9d6('0x51')](_0x41ff72);})[_0xa9d6('0x35')](function(_0x3c930a){_0xc11f08[_0xa9d6('0x66')]=_0x3c930a;return _0xc11f08;});}})['then'](respondWithFilteredResult(_0x2926ca,_0x41ff72))[_0xa9d6('0x29')](handleError(_0x2926ca,null));};exports['send']=function(_0xfa851a,_0x195cc3,_0x53bfc2){var _0x269537,_0x146943={},_0x232dbd;if(_0xfa851a[_0xa9d6('0x56')]['to']){_0x232dbd=_0xfa851a[_0xa9d6('0x56')]['to'][0x0];}return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0xfa851a[_0xa9d6('0x52')]['id']},'include':[{'model':db[_0xa9d6('0xa4')],'as':_0xa9d6('0xa5'),'include':[{'model':db[_0xa9d6('0x72')],'as':_0xa9d6('0xa6'),'where':{'fax':_0x232dbd},'limit':0x1,'order':[[_0xa9d6('0x9d'),_0xa9d6('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x195cc3,null))[_0xa9d6('0x35')](function(_0x6e44e5){_0x269537=_0x6e44e5;if(_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')]&&_0xfa851a['body'][_0xa9d6('0xa8')][_0xa9d6('0x6b')]){for(var _0x911fcf=0x0;_0x911fcf<_0xfa851a['body'][_0xa9d6('0xa8')][_0xa9d6('0x6b')];_0x911fcf+=0x1){_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][_0x911fcf]={'filename':_0xfa851a[_0xa9d6('0x56')]['attachments'][_0x911fcf]['name'],'id':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][_0x911fcf]['id'],'path':path['join'](config[_0xa9d6('0xa9')],_0xa9d6('0xaa'),_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][_0x911fcf]['basename'])};}}return respondWithRpcPromise(_0xa9d6('0xab'),_0xa9d6('0xab'),{'FaxAccountId':_['isNil'](_0xfa851a[_0xa9d6('0x52')]['id'])?undefined:_0xfa851a[_0xa9d6('0x52')]['id'],'path':_['isNil'](_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0][_0xa9d6('0x7')])?undefined:_0xfa851a['body'][_0xa9d6('0xa8')][0x0][_0xa9d6('0x7')],'fax':_['isNil'](_0xfa851a[_0xa9d6('0x56')]['to'][0x0])?undefined:_0xfa851a[_0xa9d6('0x56')]['to'][0x0]},client9002);})['then'](function(){if(_0x269537){if(_[_0xa9d6('0xac')](_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xad')])){_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xad')]=util[_0xa9d6('0xa3')](_0xa9d6('0xae'),_0x269537[_0xa9d6('0x37')],_0x269537[_0xa9d6('0xaf')]);}if(_0x269537['List']){if(_0x269537[_0xa9d6('0xa5')]['Contacts'][_0xa9d6('0x6b')]){return _0x269537[_0xa9d6('0xa5')]['Contacts'][0x0];}else{return db[_0xa9d6('0x72')][_0xa9d6('0x55')](_[_0xa9d6('0xb0')](_0xfa851a[_0xa9d6('0x56')],{'firstName':_0xfa851a['body']['to'][0x0],'phone':_0xfa851a[_0xa9d6('0x56')]['to'][0x0],'fax':_0xfa851a[_0xa9d6('0x56')]['to'][0x0],'ListId':_0x269537[_0xa9d6('0x9e')]}));}}else{throw new Error(_0xa9d6('0xb1'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xa9d6('0x35')](function(_0xa6f531){if(_0xa6f531){return db['FaxInteraction'][_0xa9d6('0x54')]({'where':{'ContactId':_0xa6f531['id'],'closed':![],'FaxAccountId':_0x269537['id']}})['then'](function(_0x1ee5bb){if(_0x1ee5bb){return[_0x1ee5bb,![]];}return db[_0xa9d6('0x71')][_0xa9d6('0x55')]({'UserId':_0xfa851a[_0xa9d6('0x57')]['id'],'ContactId':_0xa6f531['id'],'FaxAccountId':_0x269537['id'],'fax':_0xfa851a[_0xa9d6('0x56')]['to'][0x0],'firstMsgDirection':_0xa9d6('0xb2'),'Messages':[_[_0xa9d6('0x4f')](_0xfa851a[_0xa9d6('0x56')],{'read':![],'body':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0][_0xa9d6('0xb3')],'FaxAccountId':_0x269537['id'],'UserId':_0xfa851a['user']['id'],'ContactId':_0xa6f531['id'],'AttachmentId':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xa9d6('0xa1')],'as':_0xa9d6('0xb4')}]})['then'](function(_0x1aa3b5){return[_0x1aa3b5,!![]];});});}else{throw new Error(_0xa9d6('0xb5'));}})[_0xa9d6('0xb6')](function(_0x515f7a,_0xdf3d7a){if(_0xdf3d7a){return _0x515f7a;}return db['FaxMessage'][_0xa9d6('0x55')]({'direction':_0xa9d6('0xb2'),'read':![],'body':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0][_0xa9d6('0xb3')],'FaxAccountId':_0x269537['id'],'FaxInteractionId':_0x515f7a['id'],'UserId':_0xfa851a[_0xa9d6('0x57')]['id'],'ContactId':_0x515f7a[_0xa9d6('0xb7')],'AttachmentId':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0]['id']})[_0xa9d6('0x35')](function(_0x620a24){_0x515f7a['dataValues'][_0xa9d6('0xb4')]=[];_0x515f7a[_0xa9d6('0xb8')]['Messages'][_0xa9d6('0x8c')](_0x620a24[_0xa9d6('0xb8')]);return _0x515f7a;});})[_0xa9d6('0x35')](function(_0x35c0c2){respondWithRpcPromise(_0xa9d6('0xb9'),_0xa9d6('0xb9'),{'FaxAccountId':_['isNil'](_0xfa851a[_0xa9d6('0x52')]['id'])?undefined:_0xfa851a[_0xa9d6('0x52')]['id'],'path':_[_0xa9d6('0xac')](_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0][_0xa9d6('0x7')])?undefined:_0xfa851a[_0xa9d6('0x56')]['attachments'][0x0][_0xa9d6('0x7')],'fax':_[_0xa9d6('0xac')](_0xfa851a[_0xa9d6('0x56')]['to'][0x0])?undefined:_0xfa851a['body']['to'][0x0],'AttachmentId':_0xfa851a[_0xa9d6('0x56')][_0xa9d6('0xa8')][0x0]['id']},client9002)[_0xa9d6('0x35')](function(_0x5eaf65){logger[_0xa9d6('0x21')](_0xa9d6('0xba'),_0x5eaf65);})[_0xa9d6('0x29')](function(_0x142bce){logger[_0xa9d6('0x21')](_0xa9d6('0xba'),_0x142bce);});return _0x35c0c2;})['then'](respondWithResult(_0x195cc3,null))[_0xa9d6('0x29')](handleError(_0x195cc3,null));};exports[_0xa9d6('0xbb')]=function(_0x24bb9a,_0x576f7d,_0x5f339c){return db[_0xa9d6('0x3b')][_0xa9d6('0x54')]({'where':{'id':_0x24bb9a[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x576f7d,null))['then'](function(_0x44187c){if(_0x44187c){return _0x44187c[_0xa9d6('0xbb')](_0x24bb9a[_0xa9d6('0x56')]['ids'],_['omit'](_0x24bb9a[_0xa9d6('0x56')],[_0xa9d6('0x68'),'id'])||{})[_0xa9d6('0xb6')](function(_0x16406b){for(var _0x50f147=0x0;_0x50f147<_0x24bb9a[_0xa9d6('0x56')][_0xa9d6('0x68')][_0xa9d6('0x6b')];_0x50f147+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x24bb9a[_0xa9d6('0x56')][_0xa9d6('0x68')][_0x50f147]),'FaxAccountId':Number(_0x24bb9a[_0xa9d6('0x52')]['id'])});}return _0x16406b;});}})[_0xa9d6('0x35')](respondWithResult(_0x576f7d,null))[_0xa9d6('0x29')](handleError(_0x576f7d,null));};exports[_0xa9d6('0xbc')]=function(_0x4a4949,_0x369769,_0x152565){return db[_0xa9d6('0x3b')]['find']({'where':{'id':_0x4a4949[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x369769,null))[_0xa9d6('0x35')](function(_0x563491){if(_0x563491){return _0x563491[_0xa9d6('0xbc')](_0x4a4949['query'][_0xa9d6('0x68')])[_0xa9d6('0x35')](function(){if(_['isArray'](_0x4a4949['query'][_0xa9d6('0x68')])){for(var _0x2db670=0x0;_0x2db670<_0x4a4949[_0xa9d6('0x40')][_0xa9d6('0x68')][_0xa9d6('0x6b')];_0x2db670+=0x1){socket[_0xa9d6('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x4a4949[_0xa9d6('0x40')]['ids'][_0x2db670]),'FaxAccountId':Number(_0x4a4949[_0xa9d6('0x52')]['id'])});}}else{socket[_0xa9d6('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x4a4949[_0xa9d6('0x40')]['ids']),'FaxAccountId':Number(_0x4a4949[_0xa9d6('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x369769,null))['catch'](handleError(_0x369769,null));};exports['getAgents']=function(_0x50f0f0,_0x26043b,_0x150bc4){var _0x557605={};var _0x3e895f={};var _0x24b3d2;var _0x4bb264;return db[_0xa9d6('0x3b')][_0xa9d6('0x63')]({'where':{'id':_0x50f0f0[_0xa9d6('0x52')]['id']}})[_0xa9d6('0x35')](handleEntityNotFound(_0x26043b,null))[_0xa9d6('0x35')](function(_0x610047){if(_0x610047){_0x24b3d2=_0x610047;_0x3e895f['model']=_[_0xa9d6('0x41')](db[_0xa9d6('0x74')][_0xa9d6('0x3c')]);_0x3e895f[_0xa9d6('0x40')]=_['keys'](_0x50f0f0[_0xa9d6('0x40')]);_0x3e895f[_0xa9d6('0x42')]=_['intersection'](_0x3e895f[_0xa9d6('0x44')],_0x3e895f[_0xa9d6('0x40')]);_0x557605[_0xa9d6('0x45')]=_['intersection'](_0x3e895f[_0xa9d6('0x44')],qs[_0xa9d6('0x46')](_0x50f0f0[_0xa9d6('0x40')][_0xa9d6('0x46')]));_0x557605[_0xa9d6('0x45')]=_0x557605[_0xa9d6('0x45')][_0xa9d6('0x6b')]?_0x557605['attributes']:_0x3e895f[_0xa9d6('0x44')];_0x557605[_0xa9d6('0x49')]=qs[_0xa9d6('0x4a')](_0x50f0f0[_0xa9d6('0x40')][_0xa9d6('0x4a')]);_0x557605[_0xa9d6('0x4b')]=qs[_0xa9d6('0x42')](_[_0xa9d6('0x6c')](_0x50f0f0[_0xa9d6('0x40')],_0x3e895f['filters']));if(_0x50f0f0[_0xa9d6('0x40')][_0xa9d6('0x4c')]){_0x557605['where']=_[_0xa9d6('0x4f')](_0x557605[_0xa9d6('0x4b')],{'$or':_[_0xa9d6('0x3f')](_0x557605[_0xa9d6('0x45')],function(_0xd0d0a8){var _0x1e2ee0={};_0x1e2ee0[_0xd0d0a8]={'$like':'%'+_0x50f0f0[_0xa9d6('0x40')][_0xa9d6('0x4c')]+'%'};return _0x1e2ee0;})});}_0x557605=_[_0xa9d6('0x4f')]({},_0x557605,_0x50f0f0['options']);return _0x24b3d2['getAgents'](_0x557605);}})[_0xa9d6('0x35')](function(_0x3f279c){if(_0x3f279c){_0x4bb264=_0x3f279c['length'];if(!_0x50f0f0[_0xa9d6('0x40')]['hasOwnProperty'](_0xa9d6('0x48'))){_0x557605[_0xa9d6('0x30')]=qs[_0xa9d6('0x30')](_0x50f0f0['query'][_0xa9d6('0x30')]);_0x557605[_0xa9d6('0x2e')]=qs[_0xa9d6('0x2e')](_0x50f0f0['query'][_0xa9d6('0x2e')]);}return _0x24b3d2['getAgents'](_0x557605);}})[_0xa9d6('0x35')](function(_0x14f35a){if(_0x14f35a){return _0x14f35a?{'count':_0x4bb264,'rows':_0x14f35a}:null;}})['then'](respondWithResult(_0x26043b,null))[_0xa9d6('0x29')](handleError(_0x26043b,null));}; \ No newline at end of file +var _0x8412=['FaxApplication','bulkCreate','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','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','transaction','VoiceExtension','omit','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','DESC','attachments','join','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','get','FaxAccounts','UserProfileResource','end','stack','name','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','show','params','mandatoryDispositionPause','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','FaxAccountId','Disposition','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','Transaction'];(function(_0x2f96b6,_0x592500){var _0x48d7b4=function(_0x893ecc){while(--_0x893ecc){_0x2f96b6['push'](_0x2f96b6['shift']());}};_0x48d7b4(++_0x592500);}(_0x8412,0x104));var _0x2841=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0x8412[_0xacb1e2];return _0x463815;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2841('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2841('0x1'));var rp=require(_0x2841('0x2'));var moment=require(_0x2841('0x3'));var BPromise=require(_0x2841('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2841('0x5'));var sox=require(_0x2841('0x6'));var csv=require(_0x2841('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2841('0x8'));var _=require(_0x2841('0x9'));var squel=require(_0x2841('0xa'));var crypto=require(_0x2841('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2841('0xc'));var toCsv=require(_0x2841('0x7'));var querystring=require('querystring');var Papa=require(_0x2841('0xd'));var Redis=require(_0x2841('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2841('0xf'));var hardwareService=require(_0x2841('0x10'));var logger=require('../../config/logger')(_0x2841('0x11'));var utils=require('../../config/utils');var config=require(_0x2841('0x12'));var licenseUtil=require(_0x2841('0x13'));var db=require(_0x2841('0x14'))['db'];config['redis']=_[_0x2841('0x15')](config[_0x2841('0x16')],{'host':_0x2841('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2841('0x16')]));require(_0x2841('0x18'))[_0x2841('0x19')](socket);var jayson=require(_0x2841('0x1a'));var client=jayson['client'][_0x2841('0x1b')]({'port':0x232c});var client9002=jayson[_0x2841('0x1c')][_0x2841('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x47721f,_0x201adb,_0x1381b3,_0x242952){return new BPromise(function(_0x2c176d,_0x1de521){var _0x52850c=_0x242952||client;return _0x52850c[_0x2841('0x1d')](_0x47721f,_0x1381b3)['then'](function(_0x36e9e9){logger[_0x2841('0x1e')](_0x2841('0x1f'),_0x201adb,'request\x20sent');logger['debug'](_0x2841('0x20'),_0x201adb,_0x2841('0x21'),JSON[_0x2841('0x22')](_0x36e9e9));if(_0x36e9e9[_0x2841('0x23')]){if(_0x36e9e9[_0x2841('0x23')][_0x2841('0x24')]===0x1f4){logger[_0x2841('0x23')]('FaxAccount,\x20%s,\x20%s',_0x201adb,_0x36e9e9[_0x2841('0x23')][_0x2841('0x25')]);return _0x1de521(_0x36e9e9[_0x2841('0x23')][_0x2841('0x25')]);}logger[_0x2841('0x23')](_0x2841('0x1f'),_0x201adb,_0x36e9e9[_0x2841('0x23')]['message']);return _0x2c176d(_0x36e9e9[_0x2841('0x23')]['message']);}else{logger[_0x2841('0x1e')](_0x2841('0x1f'),_0x201adb,'request\x20sent');_0x2c176d(_0x36e9e9[_0x2841('0x26')][_0x2841('0x25')]);}})[_0x2841('0x27')](function(_0x15e22e){logger[_0x2841('0x23')](_0x2841('0x1f'),_0x201adb,_0x15e22e);_0x1de521(_0x15e22e);});});}function respondWithStatusCode(_0x2b48a8,_0x219114){_0x219114=_0x219114||0xcc;return function(_0x519673){if(_0x519673){return _0x2b48a8[_0x2841('0x28')](_0x219114);}return _0x2b48a8[_0x2841('0x29')](_0x219114)['end']();};}function respondWithResult(_0x58834b,_0x547eff){_0x547eff=_0x547eff||0xc8;return function(_0x3e06da){if(_0x3e06da){return _0x58834b['status'](_0x547eff)[_0x2841('0x2a')](_0x3e06da);}};}function respondWithFilteredResult(_0x150204,_0x4e4093){return function(_0x1b5657){if(_0x1b5657){var _0x1f9929=typeof _0x4e4093[_0x2841('0x2b')]===_0x2841('0x2c')&&typeof _0x4e4093[_0x2841('0x2d')]===_0x2841('0x2c');var _0x4d3bc2=_0x1b5657[_0x2841('0x2e')];var _0x4c608d=_0x1f9929?0x0:_0x4e4093[_0x2841('0x2b')];var _0x1f6726=_0x1f9929?_0x1b5657['count']:_0x4e4093['offset']+_0x4e4093['limit'];var _0x28c891;if(_0x1f6726>=_0x4d3bc2){_0x1f6726=_0x4d3bc2;_0x28c891=0xc8;}else{_0x28c891=0xce;}_0x150204[_0x2841('0x29')](_0x28c891);return _0x150204[_0x2841('0x2f')](_0x2841('0x30'),_0x4c608d+'-'+_0x1f6726+'/'+_0x4d3bc2)[_0x2841('0x2a')](_0x1b5657);}return null;};}function patchUpdates(_0x47e2ee){return function(_0x58f184){try{jsonpatch['apply'](_0x58f184,_0x47e2ee,!![]);}catch(_0xc7e045){return BPromise[_0x2841('0x31')](_0xc7e045);}return _0x58f184['save']();};}function saveUpdates(_0x3dab9b,_0xea2828){return function(_0xf77694){if(_0xf77694){return _0xf77694['update'](_0x3dab9b)['then'](function(_0x581a69){return _0x581a69;});}return null;};}function removeEntity(_0x43088f,_0x517059){return function(_0xfe05ba){if(_0xfe05ba){return _0xfe05ba[_0x2841('0x32')]()[_0x2841('0x33')](function(){var _0x22e150=_0xfe05ba[_0x2841('0x34')]({'plain':!![]});var _0x1e7758=_0x2841('0x35');return db[_0x2841('0x36')][_0x2841('0x32')]({'where':{'type':_0x1e7758,'resourceId':_0x22e150['id']}})[_0x2841('0x33')](function(){return _0xfe05ba;});})[_0x2841('0x33')](function(){_0x43088f[_0x2841('0x29')](0xcc)[_0x2841('0x37')]();});}};}function handleEntityNotFound(_0x5b08a1,_0xa88c65){return function(_0x391d8b){if(!_0x391d8b){_0x5b08a1[_0x2841('0x28')](0x194);}return _0x391d8b;};}function handleError(_0x50fd37,_0x38490a){_0x38490a=_0x38490a||0x1f4;return function(_0x26fb39){logger[_0x2841('0x23')](_0x26fb39[_0x2841('0x38')]);if(_0x26fb39['name']){delete _0x26fb39[_0x2841('0x39')];}_0x50fd37[_0x2841('0x29')](_0x38490a)['send'](_0x26fb39);};}exports[_0x2841('0x3a')]=function(_0x21c634,_0x4b9883){var _0x44894e={'include':[{'model':db[_0x2841('0x3b')],'as':'mandatoryDispositionPause'}]},_0x5cdeb2={},_0x6b0bae={'count':0x0,'rows':[]};var _0xf0af72=_[_0x2841('0x3c')](db[_0x2841('0x3d')][_0x2841('0x3e')],function(_0x5f22b7){return{'name':_0x5f22b7[_0x2841('0x3f')],'type':_0x5f22b7[_0x2841('0x40')][_0x2841('0x41')]};});_0x5cdeb2[_0x2841('0x42')]=_['map'](_0xf0af72,_0x2841('0x39'));_0x5cdeb2['query']=_[_0x2841('0x43')](_0x21c634[_0x2841('0x44')]);_0x5cdeb2[_0x2841('0x45')]=_[_0x2841('0x46')](_0x5cdeb2[_0x2841('0x42')],_0x5cdeb2[_0x2841('0x44')]);_0x44894e[_0x2841('0x47')]=_['intersection'](_0x5cdeb2[_0x2841('0x42')],qs[_0x2841('0x48')](_0x21c634[_0x2841('0x44')][_0x2841('0x48')]));_0x44894e[_0x2841('0x47')]=_0x44894e[_0x2841('0x47')][_0x2841('0x49')]?_0x44894e['attributes']:_0x5cdeb2['model'];if(!_0x21c634[_0x2841('0x44')][_0x2841('0x4a')](_0x2841('0x4b'))){_0x44894e[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x21c634[_0x2841('0x44')]['limit']);_0x44894e[_0x2841('0x2b')]=qs[_0x2841('0x2b')](_0x21c634['query']['offset']);}_0x44894e[_0x2841('0x4c')]=qs[_0x2841('0x4d')](_0x21c634[_0x2841('0x44')][_0x2841('0x4d')]);_0x44894e[_0x2841('0x4e')]=qs[_0x2841('0x45')](_['pick'](_0x21c634[_0x2841('0x44')],_0x5cdeb2[_0x2841('0x45')]),_0xf0af72);if(_0x21c634[_0x2841('0x44')][_0x2841('0x4f')]){_0x44894e['where']=_[_0x2841('0x50')](_0x44894e[_0x2841('0x4e')],{'$or':_[_0x2841('0x3c')](_0xf0af72,function(_0x374a17){if(_0x374a17[_0x2841('0x40')]!=='VIRTUAL'){var _0x1a7f1c={};_0x1a7f1c[_0x374a17['name']]={'$like':'%'+_0x21c634[_0x2841('0x44')][_0x2841('0x4f')]+'%'};return _0x1a7f1c;}})});}_0x44894e=_['merge']({},_0x44894e,_0x21c634['options']);var _0x4e3e1c={'where':_0x44894e[_0x2841('0x4e')]};return db[_0x2841('0x3d')][_0x2841('0x2e')](_0x4e3e1c)[_0x2841('0x33')](function(_0x3cf745){_0x6b0bae[_0x2841('0x2e')]=_0x3cf745;if(_0x21c634[_0x2841('0x44')][_0x2841('0x51')]){_0x44894e[_0x2841('0x52')]=[{'all':!![]}];}return db[_0x2841('0x3d')][_0x2841('0x53')](_0x44894e);})['then'](function(_0x29b850){_0x6b0bae['rows']=_0x29b850;return _0x6b0bae;})[_0x2841('0x33')](respondWithFilteredResult(_0x4b9883,_0x44894e))[_0x2841('0x27')](handleError(_0x4b9883,null));};exports[_0x2841('0x54')]=function(_0x5d67e3,_0x437fd9){var _0xee9b8e={'raw':![],'where':{'id':_0x5d67e3[_0x2841('0x55')]['id']},'include':[{'model':db[_0x2841('0x3b')],'as':_0x2841('0x56')}]},_0x52962e={};_0x52962e[_0x2841('0x42')]=_[_0x2841('0x43')](db[_0x2841('0x3d')][_0x2841('0x3e')]);_0x52962e[_0x2841('0x44')]=_['keys'](_0x5d67e3['query']);_0x52962e[_0x2841('0x45')]=_[_0x2841('0x46')](_0x52962e[_0x2841('0x42')],_0x52962e[_0x2841('0x44')]);_0xee9b8e[_0x2841('0x47')]=_[_0x2841('0x46')](_0x52962e[_0x2841('0x42')],qs[_0x2841('0x48')](_0x5d67e3[_0x2841('0x44')]['fields']));_0xee9b8e[_0x2841('0x47')]=_0xee9b8e['attributes']['length']?_0xee9b8e[_0x2841('0x47')]:_0x52962e['model'];if(_0x5d67e3[_0x2841('0x44')][_0x2841('0x51')]){_0xee9b8e[_0x2841('0x52')]=[{'all':!![]}];}_0xee9b8e=_['merge']({},_0xee9b8e,_0x5d67e3[_0x2841('0x57')]);return db[_0x2841('0x3d')][_0x2841('0x58')](_0xee9b8e)[_0x2841('0x33')](handleEntityNotFound(_0x437fd9,null))['then'](respondWithResult(_0x437fd9,null))[_0x2841('0x27')](handleError(_0x437fd9,null));};exports[_0x2841('0x59')]=function(_0x51c197,_0x2fd718){return db['FaxAccount'][_0x2841('0x59')](_0x51c197['body'],{})[_0x2841('0x33')](function(_0x36c407){var _0x51e32a=_0x51c197[_0x2841('0x5a')]['get']({'plain':!![]});if(!_0x51e32a)throw new Error(_0x2841('0x5b'));if(_0x51e32a[_0x2841('0x5c')]==='user'){var _0x4ee3b0=_0x36c407['get']({'plain':!![]});var _0x37fba5=_0x2841('0x35');return db[_0x2841('0x5d')][_0x2841('0x58')]({'where':{'name':_0x37fba5,'userProfileId':_0x51e32a['userProfileId']},'raw':!![]})[_0x2841('0x33')](function(_0x4925db){if(_0x4925db&&_0x4925db[_0x2841('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4ee3b0['name'],'resourceId':_0x4ee3b0['id'],'type':_0x4925db['name'],'sectionId':_0x4925db['id']},{})[_0x2841('0x33')](function(){return _0x36c407;});}else{return _0x36c407;}})[_0x2841('0x27')](function(_0x27bdb0){logger['error'](_0x2841('0x5f'),_0x27bdb0);throw _0x27bdb0;});}return _0x36c407;})['then'](respondWithResult(_0x2fd718,0xc9))[_0x2841('0x27')](handleError(_0x2fd718,null));};exports[_0x2841('0x60')]=function(_0x5ae299,_0x16f58a){if(_0x5ae299[_0x2841('0x61')]['id']){delete _0x5ae299['body']['id'];}return db[_0x2841('0x3d')]['find']({'where':{'id':_0x5ae299[_0x2841('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x2841('0x56')}]})['then'](handleEntityNotFound(_0x16f58a,null))['then'](saveUpdates(_0x5ae299[_0x2841('0x61')],null))['then'](respondWithResult(_0x16f58a,null))[_0x2841('0x27')](handleError(_0x16f58a,null));};exports[_0x2841('0x32')]=function(_0x315957,_0x8df151){return db['FaxAccount'][_0x2841('0x58')]({'where':{'id':_0x315957[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x8df151,null))[_0x2841('0x33')](removeEntity(_0x8df151,null))['catch'](handleError(_0x8df151,null));};exports['describe']=function(_0x18fc7f,_0x123c67){return db[_0x2841('0x3d')][_0x2841('0x62')]()[_0x2841('0x33')](respondWithResult(_0x123c67,null))[_0x2841('0x27')](handleError(_0x123c67,null));};exports[_0x2841('0x63')]=function(_0x278fe5,_0x48016d,_0x24a483){if(_0x278fe5[_0x2841('0x61')]['id']){delete _0x278fe5[_0x2841('0x61')]['id'];}return db[_0x2841('0x3d')][_0x2841('0x58')]({'where':{'id':_0x278fe5[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x48016d,null))['then'](function(_0x210b4a){if(_0x210b4a){_0x278fe5[_0x2841('0x61')][_0x2841('0x64')]=_0x210b4a['id'];return db[_0x2841('0x65')]['create'](_0x278fe5['body']);}})[_0x2841('0x33')](respondWithResult(_0x48016d,null))[_0x2841('0x27')](handleError(_0x48016d,null));};exports['getDispositions']=function(_0x56ad2a,_0x5790fa,_0xe560f0){var _0x323ded={'raw':![],'where':{}};var _0x58972b={};var _0x45c1c2={'count':0x0,'rows':[]};return db[_0x2841('0x3d')][_0x2841('0x66')]({'where':{'id':_0x56ad2a[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x5790fa,null))[_0x2841('0x33')](function(_0x128932){if(_0x128932){_0x58972b[_0x2841('0x42')]=_[_0x2841('0x43')](db[_0x2841('0x65')][_0x2841('0x3e')]);_0x58972b[_0x2841('0x44')]=_[_0x2841('0x43')](_0x56ad2a[_0x2841('0x44')]);_0x58972b['filters']=_['intersection'](_0x58972b[_0x2841('0x42')],_0x58972b[_0x2841('0x44')]);_0x323ded[_0x2841('0x47')]=_[_0x2841('0x46')](_0x58972b[_0x2841('0x42')],qs[_0x2841('0x48')](_0x56ad2a[_0x2841('0x44')][_0x2841('0x48')]));_0x323ded[_0x2841('0x47')]=_0x323ded[_0x2841('0x47')]['length']?_0x323ded['attributes']:_0x58972b[_0x2841('0x42')];if(!_0x56ad2a[_0x2841('0x44')]['hasOwnProperty'](_0x2841('0x4b'))){_0x323ded[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x56ad2a[_0x2841('0x44')][_0x2841('0x2d')]);_0x323ded[_0x2841('0x2b')]=qs[_0x2841('0x2b')](_0x56ad2a['query'][_0x2841('0x2b')]);}_0x323ded['order']=qs[_0x2841('0x4d')](_0x56ad2a[_0x2841('0x44')][_0x2841('0x4d')]);_0x323ded[_0x2841('0x4e')]=qs[_0x2841('0x45')](_[_0x2841('0x67')](_0x56ad2a[_0x2841('0x44')],_0x58972b[_0x2841('0x45')]));_0x323ded[_0x2841('0x4e')][_0x2841('0x64')]=_0x128932['id'];if(_0x56ad2a[_0x2841('0x44')][_0x2841('0x4f')]){_0x323ded['where']=_[_0x2841('0x50')](_0x323ded['where'],{'$or':_[_0x2841('0x3c')](_0x323ded[_0x2841('0x47')],function(_0x58b004){var _0x35f060={};_0x35f060[_0x58b004]={'$like':'%'+_0x56ad2a[_0x2841('0x44')][_0x2841('0x4f')]+'%'};return _0x35f060;})});}_0x323ded=_[_0x2841('0x50')]({},_0x323ded,_0x56ad2a[_0x2841('0x57')]);return db[_0x2841('0x65')]['count']({'where':_0x323ded[_0x2841('0x4e')]})['then'](function(_0x15128f){_0x45c1c2['count']=_0x15128f;if(_0x56ad2a[_0x2841('0x44')][_0x2841('0x51')]){_0x323ded[_0x2841('0x52')]=[{'all':!![]}];}return db[_0x2841('0x65')][_0x2841('0x53')](_0x323ded);})['then'](function(_0xa060ed){_0x45c1c2['rows']=_0xa060ed;return _0x45c1c2;});}})['then'](respondWithFilteredResult(_0x5790fa,_0x323ded))[_0x2841('0x27')](handleError(_0x5790fa,null));};exports[_0x2841('0x68')]=function(_0x3b701a,_0x12bba4,_0x43d275){return db['FaxAccount'][_0x2841('0x58')]({'where':{'id':_0x3b701a['params']['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x12bba4,null))[_0x2841('0x33')](function(_0x2a2794){if(_0x2a2794){return _0x2a2794[_0x2841('0x68')](_0x3b701a[_0x2841('0x44')][_0x2841('0x69')]);}})[_0x2841('0x33')](respondWithStatusCode(_0x12bba4,null))[_0x2841('0x27')](handleError(_0x12bba4,null));};exports[_0x2841('0x6a')]=function(_0x29675f,_0x10ca28,_0x27697e){if(_0x29675f[_0x2841('0x61')]['id']){delete _0x29675f[_0x2841('0x61')]['id'];}return db[_0x2841('0x3d')][_0x2841('0x58')]({'where':{'id':_0x29675f[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x10ca28,null))[_0x2841('0x33')](function(_0x44bef0){if(_0x44bef0){_0x29675f[_0x2841('0x61')][_0x2841('0x64')]=_0x44bef0['id'];return db[_0x2841('0x6b')][_0x2841('0x59')](_0x29675f['body']);}})[_0x2841('0x33')](respondWithResult(_0x10ca28,null))[_0x2841('0x27')](handleError(_0x10ca28,null));};exports[_0x2841('0x6c')]=function(_0x4a3eaa,_0x33a90d,_0x352a14){var _0x6c6ac3={'raw':![],'where':{}};var _0x4a7ba={};var _0x454aa1={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x4a3eaa[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x33a90d,null))[_0x2841('0x33')](function(_0x2a7cb7){if(_0x2a7cb7){_0x4a7ba[_0x2841('0x42')]=_[_0x2841('0x43')](db[_0x2841('0x6b')][_0x2841('0x3e')]);_0x4a7ba['query']=_[_0x2841('0x43')](_0x4a3eaa[_0x2841('0x44')]);_0x4a7ba[_0x2841('0x45')]=_[_0x2841('0x46')](_0x4a7ba[_0x2841('0x42')],_0x4a7ba['query']);_0x6c6ac3['attributes']=_[_0x2841('0x46')](_0x4a7ba[_0x2841('0x42')],qs[_0x2841('0x48')](_0x4a3eaa[_0x2841('0x44')]['fields']));_0x6c6ac3['attributes']=_0x6c6ac3['attributes'][_0x2841('0x49')]?_0x6c6ac3[_0x2841('0x47')]:_0x4a7ba[_0x2841('0x42')];if(!_0x4a3eaa['query'][_0x2841('0x4a')](_0x2841('0x4b'))){_0x6c6ac3[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x4a3eaa[_0x2841('0x44')]['limit']);_0x6c6ac3[_0x2841('0x2b')]=qs[_0x2841('0x2b')](_0x4a3eaa['query'][_0x2841('0x2b')]);}_0x6c6ac3[_0x2841('0x4c')]=qs['sort'](_0x4a3eaa['query'][_0x2841('0x4d')]);_0x6c6ac3[_0x2841('0x4e')]=qs[_0x2841('0x45')](_[_0x2841('0x67')](_0x4a3eaa[_0x2841('0x44')],_0x4a7ba[_0x2841('0x45')]));_0x6c6ac3[_0x2841('0x4e')][_0x2841('0x64')]=_0x2a7cb7['id'];if(_0x4a3eaa[_0x2841('0x44')][_0x2841('0x4f')]){_0x6c6ac3[_0x2841('0x4e')]=_[_0x2841('0x50')](_0x6c6ac3['where'],{'$or':_[_0x2841('0x3c')](_0x6c6ac3[_0x2841('0x47')],function(_0x3b9475){var _0x45a12f={};_0x45a12f[_0x3b9475]={'$like':'%'+_0x4a3eaa['query']['filter']+'%'};return _0x45a12f;})});}_0x6c6ac3=_['merge']({},_0x6c6ac3,_0x4a3eaa[_0x2841('0x57')]);return db['CannedAnswer']['count']({'where':_0x6c6ac3['where']})[_0x2841('0x33')](function(_0x3b9794){_0x454aa1[_0x2841('0x2e')]=_0x3b9794;if(_0x4a3eaa[_0x2841('0x44')][_0x2841('0x51')]){_0x6c6ac3[_0x2841('0x52')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x6c6ac3);})[_0x2841('0x33')](function(_0x103af9){_0x454aa1['rows']=_0x103af9;return _0x454aa1;});}})['then'](respondWithFilteredResult(_0x33a90d,_0x6c6ac3))[_0x2841('0x27')](handleError(_0x33a90d,null));};exports[_0x2841('0x6d')]=function(_0x238d10,_0x231db4,_0x228e25){return db[_0x2841('0x3d')][_0x2841('0x58')]({'where':{'id':_0x238d10[_0x2841('0x55')]['id']}})['then'](handleEntityNotFound(_0x231db4,null))[_0x2841('0x33')](function(_0x584f63){if(_0x584f63){return _0x584f63[_0x2841('0x6d')](_0x238d10[_0x2841('0x44')][_0x2841('0x69')]);}})['then'](respondWithStatusCode(_0x231db4,null))[_0x2841('0x27')](handleError(_0x231db4,null));};exports[_0x2841('0x6e')]=function(_0x20a1f0,_0x52ca66,_0x29d708){return db[_0x2841('0x6f')][_0x2841('0x58')]({'where':{'id':_0x20a1f0[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x52ca66,null))['then'](function(_0x1ba439){if(_0x1ba439){return _0x1ba439[_0x2841('0x6e')](_0x20a1f0[_0x2841('0x61')][_0x2841('0x69')],_['omit'](_0x20a1f0[_0x2841('0x61')],[_0x2841('0x69'),'id'])||{});}})[_0x2841('0x33')](respondWithResult(_0x52ca66,null))[_0x2841('0x27')](handleError(_0x52ca66,null));};exports[_0x2841('0x70')]=function(_0x507dc0,_0x2abcea,_0x4d0395){var _0x5738fc={'raw':![],'where':{}};var _0x26238d={};var _0x3405b9={'count':0x0,'rows':[]};return db[_0x2841('0x3d')][_0x2841('0x66')]({'where':{'id':_0x507dc0['params']['id']}})['then'](handleEntityNotFound(_0x2abcea,null))['then'](function(_0x2c8a5d){if(_0x2c8a5d){_0x26238d['model']=_['keys'](db['FaxInteraction'][_0x2841('0x3e')]);_0x26238d['query']=_[_0x2841('0x43')](_0x507dc0[_0x2841('0x44')]);_0x26238d[_0x2841('0x45')]=_[_0x2841('0x46')](_0x26238d['model'],_0x26238d[_0x2841('0x44')]);_0x5738fc[_0x2841('0x47')]=_[_0x2841('0x46')](_0x26238d[_0x2841('0x42')],qs[_0x2841('0x48')](_0x507dc0[_0x2841('0x44')][_0x2841('0x48')]));_0x5738fc['attributes']=_0x5738fc['attributes'][_0x2841('0x49')]?_0x5738fc['attributes']:_0x26238d[_0x2841('0x42')];if(!_0x507dc0['query']['hasOwnProperty']('nolimit')){_0x5738fc[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x507dc0[_0x2841('0x44')]['limit']);_0x5738fc[_0x2841('0x2b')]=qs[_0x2841('0x2b')](_0x507dc0[_0x2841('0x44')]['offset']);}_0x5738fc[_0x2841('0x4c')]=qs[_0x2841('0x4d')](_0x507dc0[_0x2841('0x44')]['sort']);_0x5738fc['where']=qs[_0x2841('0x45')](_[_0x2841('0x67')](_0x507dc0[_0x2841('0x44')],_0x26238d[_0x2841('0x45')]));_0x5738fc['where']['FaxAccountId']=_0x2c8a5d['id'];if(_0x507dc0['query']['filter']){_0x5738fc[_0x2841('0x4e')]=_['merge'](_0x5738fc['where'],{'$or':_[_0x2841('0x3c')](_0x5738fc[_0x2841('0x47')],function(_0x4f3e09){var _0x3af2be={};_0x3af2be[_0x4f3e09]={'$like':'%'+_0x507dc0['query'][_0x2841('0x4f')]+'%'};return _0x3af2be;})});}_0x5738fc=_[_0x2841('0x50')]({},_0x5738fc,_0x507dc0[_0x2841('0x57')]);return db[_0x2841('0x6f')][_0x2841('0x2e')]({'where':_0x5738fc[_0x2841('0x4e')]})[_0x2841('0x33')](function(_0x3c8054){_0x3405b9[_0x2841('0x2e')]=_0x3c8054;if(_0x507dc0[_0x2841('0x44')][_0x2841('0x51')]){_0x5738fc['include']=[{'model':db[_0x2841('0x71')],'as':_0x2841('0x72'),'required':![]},{'model':db[_0x2841('0x73')],'as':_0x2841('0x74'),'attributes':[_0x2841('0x39'),'fullname',_0x2841('0x75')],'required':![]},{'model':db[_0x2841('0x76')],'as':'Tags','attributes':['id','name',_0x2841('0x77')],'where':_0x507dc0[_0x2841('0x44')][_0x2841('0x78')]?{'id':_0x507dc0[_0x2841('0x44')][_0x2841('0x78')]}:undefined,'required':_0x507dc0[_0x2841('0x44')][_0x2841('0x78')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x5738fc);})[_0x2841('0x33')](function(_0x224c3e){_0x3405b9['rows']=_0x224c3e;return _0x3405b9;});}})[_0x2841('0x33')](respondWithFilteredResult(_0x2abcea,_0x5738fc))[_0x2841('0x27')](handleError(_0x2abcea,null));};exports[_0x2841('0x79')]=function(_0x2a0983,_0x4c274d){var _0x2c7387=_0x2a0983['params']['id'];var _0x1ca71b=_0x2a0983['body'];var _0x4099eb=0xc8;var _0x40af78=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2841('0x7a')][_0x2841('0x7b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x35a8c1){return db[_0x2841('0x3d')]['findOne']({'where':{'id':_0x2c7387},'transaction':_0x35a8c1})[_0x2841('0x33')](function(_0x32a4a9){if(_0x32a4a9){return db[_0x2841('0x7c')]['destroy']({'where':{'FaxAccountId':_0x2c7387},'transaction':_0x35a8c1})[_0x2841('0x33')](function(){var _0x1f181f=_[_0x2841('0x3c')](_0x1ca71b,function(_0x272672){_0x272672[_0x2841('0x64')]=_0x2c7387;return _0x272672;});return db[_0x2841('0x7c')][_0x2841('0x7d')](_0x1f181f,{'transaction':_0x35a8c1});});}else{_0x4099eb=0x194;_0x40af78=[];}});})[_0x2841('0x33')](function(){if(_0x4099eb!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x2c7387},'order':_0x2841('0x7e')})[_0x2841('0x33')](function(_0x44a98d){_0x40af78=_0x44a98d;});}})['catch'](function(_0x23abb1){_0x4099eb=0x1f4;logger[_0x2841('0x23')](_0x23abb1[_0x2841('0x38')]);if(_0x23abb1[_0x2841('0x39')]){delete _0x23abb1['name'];}_0x40af78=_0x23abb1;})[_0x2841('0x7f')](function(){if(_0x40af78===null){_0x4c274d[_0x2841('0x28')](_0x4099eb);}else{if(_0x4099eb===0x1f4){_0x4c274d['status'](_0x4099eb)[_0x2841('0x80')](_0x40af78);}else{_0x4c274d[_0x2841('0x29')](_0x4099eb)[_0x2841('0x2a')](_0x40af78);}}});};exports[_0x2841('0x81')]=function(_0x1d8784,_0x317d03,_0x457ba3){var _0xa3720e={};var _0x17edcb={};var _0xca24e6;var _0x575f35;return db[_0x2841('0x3d')]['findOne']({'where':{'id':_0x1d8784['params']['id']}})['then'](handleEntityNotFound(_0x317d03,null))['then'](function(_0x1205c0){if(_0x1205c0){_0xca24e6=_0x1205c0;_0x17edcb[_0x2841('0x42')]=_[_0x2841('0x43')](db['FaxApplication'][_0x2841('0x3e')]);_0x17edcb[_0x2841('0x44')]=_[_0x2841('0x43')](_0x1d8784['query']);_0x17edcb[_0x2841('0x45')]=_[_0x2841('0x46')](_0x17edcb[_0x2841('0x42')],_0x17edcb['query']);_0xa3720e[_0x2841('0x47')]=_[_0x2841('0x46')](_0x17edcb[_0x2841('0x42')],qs[_0x2841('0x48')](_0x1d8784[_0x2841('0x44')][_0x2841('0x48')]));_0xa3720e[_0x2841('0x47')]=_0xa3720e[_0x2841('0x47')][_0x2841('0x49')]?_0xa3720e[_0x2841('0x47')]:_0x17edcb[_0x2841('0x42')];_0xa3720e[_0x2841('0x4c')]=qs['sort'](_0x1d8784[_0x2841('0x44')]['sort']);_0xa3720e[_0x2841('0x4e')]=qs[_0x2841('0x45')](_['pick'](_0x1d8784[_0x2841('0x44')],_0x17edcb[_0x2841('0x45')]));if(_0x1d8784[_0x2841('0x44')][_0x2841('0x4f')]){_0xa3720e[_0x2841('0x4e')]=_[_0x2841('0x50')](_0xa3720e['where'],{'$or':_[_0x2841('0x3c')](_0xa3720e[_0x2841('0x47')],function(_0x4a855b){var _0x3954d4={};_0x3954d4[_0x4a855b]={'$like':'%'+_0x1d8784[_0x2841('0x44')][_0x2841('0x4f')]+'%'};return _0x3954d4;})});}_0xa3720e=_[_0x2841('0x50')]({},_0xa3720e,_0x1d8784['options']);return _0xca24e6[_0x2841('0x81')](_0xa3720e);}})[_0x2841('0x33')](function(_0x3f6119){if(_0x3f6119){_0x575f35=_0x3f6119[_0x2841('0x49')];if(!_0x1d8784['query'][_0x2841('0x4a')](_0x2841('0x4b'))){_0xa3720e[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x1d8784['query'][_0x2841('0x2d')]);_0xa3720e['offset']=qs['offset'](_0x1d8784[_0x2841('0x44')]['offset']);}return _0xca24e6[_0x2841('0x81')](_0xa3720e);}})[_0x2841('0x33')](function(_0x19037d){if(_0x19037d){return _0x19037d?{'count':_0x575f35,'rows':_0x19037d}:null;}})['then'](respondWithResult(_0x317d03,null))[_0x2841('0x27')](handleError(_0x317d03,null));};function Extension(_0xe32f5b,_0x5201b6,_0x2a4e10,_0x155dbb){this[_0x2841('0x82')]=_0x2841('0x83');this[_0x2841('0x84')]=_0xe32f5b[_0x2841('0x85')];this[_0x2841('0x86')]=_0x155dbb;this[_0x2841('0x40')]=_0x2841('0x87');this['description']=_0x2841('0x88');this[_0x2841('0x64')]=_0xe32f5b['id'];this['priority']=_0x5201b6;this[_0x2841('0x89')]=_0x2a4e10;}function createExtensionsReciveFax(_0x4872a4){var _0x431e70=0x1;var _0x3f29e3=[];_0x3f29e3[_0x2841('0x8a')](new Extension(_0x4872a4,_0x431e70,'',_0x2841('0x8b')));_0x431e70+=0x1;_0x3f29e3['push'](new Extension(_0x4872a4,_0x431e70,_0x2841('0x8c'),_0x2841('0x8d')));_0x431e70+=0x1;for(var _0x1fb9d3 in _0x4872a4){if(_0x4872a4['hasOwnProperty'](_0x1fb9d3)&&(_0x1fb9d3==='ecm'||_0x1fb9d3===_0x2841('0x85')||_0x1fb9d3===_0x2841('0x8e')||_0x1fb9d3===_0x2841('0x8f')||_0x1fb9d3===_0x2841('0x90')||_0x1fb9d3===_0x2841('0x91')||_0x1fb9d3===_0x2841('0x92')||_0x1fb9d3===_0x2841('0x93')||_0x1fb9d3==='t38timeout')){_0x3f29e3[_0x2841('0x8a')](new Extension(_0x4872a4,_0x431e70,'FAXOPT('+_0x1fb9d3+')='+_0x4872a4[_0x1fb9d3],_0x2841('0x8d')));_0x431e70+=0x1;}}_0x3f29e3[_0x2841('0x8a')](new Extension(_0x4872a4,_0x431e70,'6',_0x2841('0x94')));_0x431e70+=0x1;_0x3f29e3[_0x2841('0x8a')](new Extension(_0x4872a4,_0x431e70,_0x2841('0x95'),_0x2841('0x96')));_0x431e70=0x0;return _0x3f29e3;}exports[_0x2841('0x97')]=function(_0x583788,_0xacdbe6,_0x433031){var _0x4379dc;return db[_0x2841('0x7a')][_0x2841('0x98')](function(_0x3ffa48){return db['FaxAccount'][_0x2841('0x59')](_0x583788[_0x2841('0x61')],{'transaction':_0x3ffa48})[_0x2841('0x33')](function(_0x48bdc0){_0x4379dc=_0x48bdc0[_0x2841('0x34')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x4379dc),{'transaction':_0x3ffa48});});})[_0x2841('0x33')](function(){return _0x4379dc;})[_0x2841('0x33')](respondWithResult(_0xacdbe6,null))[_0x2841('0x27')](handleError(_0xacdbe6,null));};exports['updateAccountApplications']=function(_0x243760,_0x534685,_0x23811a){var _0x58b4d3;return db[_0x2841('0x7a')][_0x2841('0x98')](function(_0x15a8a3){return db[_0x2841('0x3d')][_0x2841('0x60')](_0x243760[_0x2841('0x61')],{'where':{'id':_0x243760[_0x2841('0x61')]['id']},'transaction':_0x15a8a3})[_0x2841('0x33')](function(_0xc649f9){return db['VoiceExtension'][_0x2841('0x32')]({'where':{'FaxAccountId':_0x243760[_0x2841('0x61')]['id']},'transaction':_0x15a8a3})[_0x2841('0x33')](function(_0x4eea74){return db[_0x2841('0x99')][_0x2841('0x7d')](createExtensionsReciveFax(_[_0x2841('0x9a')](_0x243760[_0x2841('0x61')],['tech',_0x2841('0x41'),_0x2841('0x9b'),_0x2841('0x9c'),'TrunkId',_0x2841('0x9d')])),{'transaction':_0x15a8a3});});});})['then'](function(){return db[_0x2841('0x3d')][_0x2841('0x9e')](_0x243760['body']['id']);})[_0x2841('0x33')](respondWithResult(_0x534685,null))[_0x2841('0x27')](handleError(_0x534685,null));};exports[_0x2841('0x9f')]=function(_0x4d07b3,_0x608a44,_0x429eb1){var _0xafe24c={'raw':!![],'where':{}};var _0x1ca58e={};var _0x584497={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2841('0x66')]({'where':{'id':_0x4d07b3[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x608a44,null))[_0x2841('0x33')](function(_0x54a3e8){if(_0x54a3e8){_0x1ca58e[_0x2841('0x42')]=_['keys'](db[_0x2841('0xa0')][_0x2841('0x3e')]);_0x1ca58e[_0x2841('0x44')]=_[_0x2841('0x43')](_0x4d07b3[_0x2841('0x44')]);_0x1ca58e['filters']=_['intersection'](_0x1ca58e[_0x2841('0x42')],_0x1ca58e[_0x2841('0x44')]);_0xafe24c[_0x2841('0x47')]=_[_0x2841('0x46')](_0x1ca58e['model'],qs['fields'](_0x4d07b3[_0x2841('0x44')]['fields']));_0xafe24c['attributes']=_0xafe24c[_0x2841('0x47')]['length']?_0xafe24c[_0x2841('0x47')]:_0x1ca58e[_0x2841('0x42')];if(!_0x4d07b3[_0x2841('0x44')]['hasOwnProperty']('nolimit')){_0xafe24c['limit']=qs[_0x2841('0x2d')](_0x4d07b3[_0x2841('0x44')][_0x2841('0x2d')]);_0xafe24c['offset']=qs[_0x2841('0x2b')](_0x4d07b3['query'][_0x2841('0x2b')]);}_0xafe24c[_0x2841('0x4c')]=qs[_0x2841('0x4d')](_0x4d07b3[_0x2841('0x44')]['sort']);_0xafe24c[_0x2841('0x4e')]=qs[_0x2841('0x45')](_[_0x2841('0x67')](_0x4d07b3[_0x2841('0x44')],_0x1ca58e[_0x2841('0x45')]));_0xafe24c[_0x2841('0x4e')][_0x2841('0x64')]=_0x54a3e8['id'];if(_0x4d07b3[_0x2841('0x44')]['filter']){_0xafe24c[_0x2841('0x4e')]=_[_0x2841('0x50')](_0xafe24c[_0x2841('0x4e')],{'$or':_['map'](_0xafe24c[_0x2841('0x47')],function(_0x3f7934){var _0x49a713={};_0x49a713[_0x3f7934]={'$like':'%'+_0x4d07b3[_0x2841('0x44')]['filter']+'%'};return _0x49a713;})});}if(_0x4d07b3[_0x2841('0x44')][_0x2841('0xa1')]){var _0x2fa3aa=_0x4d07b3['query']['$gte'][_0x2841('0xa2')](',');var _0x36e5eb={};_0x36e5eb[_0x2fa3aa[0x0]]={'$gte':moment(_0x2fa3aa[0x1])[_0x2841('0xa3')](_0x2841('0xa4'))};_0xafe24c[_0x2841('0x4e')]=_[_0x2841('0x50')](_0xafe24c[_0x2841('0x4e')],_0x36e5eb);}_0xafe24c=_[_0x2841('0x50')]({},_0xafe24c,_0x4d07b3[_0x2841('0x57')]);return db['FaxMessage'][_0x2841('0x2e')]({'where':_0xafe24c['where']})[_0x2841('0x33')](function(_0x3105d3){_0x584497['count']=_0x3105d3;if(_0x4d07b3[_0x2841('0x44')][_0x2841('0x51')]){_0xafe24c['include']=[{'all':!![]}];}return db[_0x2841('0xa0')][_0x2841('0x53')](_0xafe24c);})['then'](function(_0x4e216d){_0x584497['rows']=_0x4e216d;return _0x584497;});}})[_0x2841('0x33')](respondWithFilteredResult(_0x608a44,_0xafe24c))['catch'](handleError(_0x608a44,null));};exports[_0x2841('0x80')]=function(_0x1e16f0,_0x3c6528,_0x3ae71c){var _0x34d522,_0x331c48={},_0x301697;if(_0x1e16f0[_0x2841('0x61')]['to']){_0x301697=_0x1e16f0[_0x2841('0x61')]['to'][0x0];}return db['FaxAccount'][_0x2841('0x58')]({'where':{'id':_0x1e16f0[_0x2841('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2841('0x71')],'as':_0x2841('0xa5'),'where':{'fax':_0x301697},'limit':0x1,'order':[[_0x2841('0x9c'),_0x2841('0xa6')]]}]}]})[_0x2841('0x33')](handleEntityNotFound(_0x3c6528,null))[_0x2841('0x33')](function(_0x70637e){_0x34d522=_0x70637e;if(_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')]&&_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][_0x2841('0x49')]){for(var _0x4ef70f=0x0;_0x4ef70f<_0x1e16f0['body'][_0x2841('0xa7')]['length'];_0x4ef70f+=0x1){_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][_0x4ef70f]={'filename':_0x1e16f0[_0x2841('0x61')]['attachments'][_0x4ef70f][_0x2841('0x39')],'id':_0x1e16f0[_0x2841('0x61')]['attachments'][_0x4ef70f]['id'],'path':path[_0x2841('0xa8')](config['root'],_0x2841('0xa9'),_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][_0x4ef70f][_0x2841('0xaa')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x2841('0xab')](_0x1e16f0['params']['id'])?undefined:_0x1e16f0[_0x2841('0x55')]['id'],'path':_[_0x2841('0xab')](_0x1e16f0['body'][_0x2841('0xa7')][0x0][_0x2841('0x5')])?undefined:_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0][_0x2841('0x5')],'fax':_[_0x2841('0xab')](_0x1e16f0[_0x2841('0x61')]['to'][0x0])?undefined:_0x1e16f0['body']['to'][0x0]},client9002);})[_0x2841('0x33')](function(){if(_0x34d522){if(_[_0x2841('0xab')](_0x1e16f0[_0x2841('0x61')]['from'])){_0x1e16f0[_0x2841('0x61')][_0x2841('0xac')]=util['format'](_0x2841('0xad'),_0x34d522['name'],_0x34d522[_0x2841('0xae')]);}if(_0x34d522['List']){if(_0x34d522[_0x2841('0xaf')][_0x2841('0xa5')][_0x2841('0x49')]){return _0x34d522['List'][_0x2841('0xa5')][0x0];}else{return db[_0x2841('0x71')][_0x2841('0x59')](_['defaults'](_0x1e16f0[_0x2841('0x61')],{'firstName':_0x1e16f0['body']['to'][0x0],'phone':_0x1e16f0[_0x2841('0x61')]['to'][0x0],'fax':_0x1e16f0[_0x2841('0x61')]['to'][0x0],'ListId':_0x34d522[_0x2841('0x9d')]}));}}else{throw new Error(_0x2841('0xb0'));}}else{throw new Error(_0x2841('0xb1'));}})[_0x2841('0x33')](function(_0x41850b){if(_0x41850b){return db[_0x2841('0x6f')][_0x2841('0x58')]({'where':{'ContactId':_0x41850b['id'],'closed':![],'FaxAccountId':_0x34d522['id']}})['then'](function(_0x5ca379){if(_0x5ca379){return[_0x5ca379,![]];}return db['FaxInteraction']['create']({'UserId':_0x1e16f0['user']['id'],'ContactId':_0x41850b['id'],'FaxAccountId':_0x34d522['id'],'fax':_0x1e16f0[_0x2841('0x61')]['to'][0x0],'firstMsgDirection':_0x2841('0xb2'),'Messages':[_[_0x2841('0x50')](_0x1e16f0[_0x2841('0x61')],{'read':![],'body':_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0][_0x2841('0xb3')],'FaxAccountId':_0x34d522['id'],'UserId':_0x1e16f0[_0x2841('0x5a')]['id'],'ContactId':_0x41850b['id'],'AttachmentId':_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x2841('0xa0')],'as':_0x2841('0xb4')}]})[_0x2841('0x33')](function(_0x19268f){return[_0x19268f,!![]];});});}else{throw new Error(_0x2841('0xb5'));}})[_0x2841('0xb6')](function(_0xa188,_0x38ed80){if(_0x38ed80){return _0xa188;}return db[_0x2841('0xa0')][_0x2841('0x59')]({'direction':'out','read':![],'body':_0x1e16f0['body'][_0x2841('0xa7')][0x0][_0x2841('0xb3')],'FaxAccountId':_0x34d522['id'],'FaxInteractionId':_0xa188['id'],'UserId':_0x1e16f0[_0x2841('0x5a')]['id'],'ContactId':_0xa188['ContactId'],'AttachmentId':_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0]['id']})['then'](function(_0x19dfb1){_0xa188['dataValues'][_0x2841('0xb4')]=[];_0xa188[_0x2841('0xb7')][_0x2841('0xb4')]['push'](_0x19dfb1[_0x2841('0xb7')]);return _0xa188;});})[_0x2841('0x33')](function(_0x2a7f89){respondWithRpcPromise(_0x2841('0xb8'),_0x2841('0xb8'),{'FaxAccountId':_['isNil'](_0x1e16f0['params']['id'])?undefined:_0x1e16f0['params']['id'],'path':_['isNil'](_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0][_0x2841('0x5')])?undefined:_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0][_0x2841('0x5')],'fax':_['isNil'](_0x1e16f0[_0x2841('0x61')]['to'][0x0])?undefined:_0x1e16f0[_0x2841('0x61')]['to'][0x0],'AttachmentId':_0x1e16f0[_0x2841('0x61')][_0x2841('0xa7')][0x0]['id']},client9002)[_0x2841('0x33')](function(_0x3428ac){logger[_0x2841('0x1e')](_0x2841('0xb9'),_0x3428ac);})['catch'](function(_0x3b7233){logger[_0x2841('0x1e')](_0x2841('0xb9'),_0x3b7233);});return _0x2a7f89;})[_0x2841('0x33')](respondWithResult(_0x3c6528,null))[_0x2841('0x27')](handleError(_0x3c6528,null));};exports[_0x2841('0xba')]=function(_0x2e973c,_0x24759e,_0x5646a4){return db[_0x2841('0x3d')]['find']({'where':{'id':_0x2e973c[_0x2841('0x55')]['id']}})['then'](handleEntityNotFound(_0x24759e,null))[_0x2841('0x33')](function(_0x24b44f){if(_0x24b44f){return _0x24b44f[_0x2841('0xba')](_0x2e973c['body']['ids'],_['omit'](_0x2e973c['body'],['ids','id'])||{})[_0x2841('0xb6')](function(_0x594b03){for(var _0x7e78d8=0x0;_0x7e78d8<_0x2e973c['body'][_0x2841('0x69')][_0x2841('0x49')];_0x7e78d8+=0x1){socket[_0x2841('0xbb')]('userFaxAccount:save',{'UserId':Number(_0x2e973c[_0x2841('0x61')][_0x2841('0x69')][_0x7e78d8]),'FaxAccountId':Number(_0x2e973c[_0x2841('0x55')]['id'])});}return _0x594b03;});}})['then'](respondWithResult(_0x24759e,null))[_0x2841('0x27')](handleError(_0x24759e,null));};exports[_0x2841('0xbc')]=function(_0x1f8307,_0x47a202,_0x5a5cab){return db[_0x2841('0x3d')][_0x2841('0x58')]({'where':{'id':_0x1f8307[_0x2841('0x55')]['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x47a202,null))[_0x2841('0x33')](function(_0x1f819b){if(_0x1f819b){return _0x1f819b[_0x2841('0xbc')](_0x1f8307[_0x2841('0x44')][_0x2841('0x69')])[_0x2841('0x33')](function(){if(_[_0x2841('0xbd')](_0x1f8307[_0x2841('0x44')][_0x2841('0x69')])){for(var _0x2f4da9=0x0;_0x2f4da9<_0x1f8307[_0x2841('0x44')][_0x2841('0x69')][_0x2841('0x49')];_0x2f4da9+=0x1){socket[_0x2841('0xbb')](_0x2841('0xbe'),{'UserId':Number(_0x1f8307[_0x2841('0x44')][_0x2841('0x69')][_0x2f4da9]),'FaxAccountId':Number(_0x1f8307[_0x2841('0x55')]['id'])});}}else{socket[_0x2841('0xbb')](_0x2841('0xbe'),{'UserId':Number(_0x1f8307[_0x2841('0x44')]['ids']),'FaxAccountId':Number(_0x1f8307['params']['id'])});}});}})[_0x2841('0x33')](respondWithStatusCode(_0x47a202,null))['catch'](handleError(_0x47a202,null));};exports[_0x2841('0xbf')]=function(_0x2df45d,_0x1019ba,_0x1005c2){var _0x1e11a7={};var _0x58d270={};var _0x32e8cf;var _0x4a1f0a;return db['FaxAccount'][_0x2841('0x66')]({'where':{'id':_0x2df45d['params']['id']}})[_0x2841('0x33')](handleEntityNotFound(_0x1019ba,null))['then'](function(_0xfdeb4b){if(_0xfdeb4b){_0x32e8cf=_0xfdeb4b;_0x58d270[_0x2841('0x42')]=_[_0x2841('0x43')](db[_0x2841('0x73')]['rawAttributes']);_0x58d270[_0x2841('0x44')]=_[_0x2841('0x43')](_0x2df45d[_0x2841('0x44')]);_0x58d270[_0x2841('0x45')]=_[_0x2841('0x46')](_0x58d270['model'],_0x58d270['query']);_0x1e11a7['attributes']=_[_0x2841('0x46')](_0x58d270['model'],qs[_0x2841('0x48')](_0x2df45d[_0x2841('0x44')][_0x2841('0x48')]));_0x1e11a7[_0x2841('0x47')]=_0x1e11a7['attributes']['length']?_0x1e11a7[_0x2841('0x47')]:_0x58d270['model'];_0x1e11a7[_0x2841('0x4c')]=qs[_0x2841('0x4d')](_0x2df45d['query'][_0x2841('0x4d')]);_0x1e11a7[_0x2841('0x4e')]=qs[_0x2841('0x45')](_[_0x2841('0x67')](_0x2df45d['query'],_0x58d270[_0x2841('0x45')]));if(_0x2df45d[_0x2841('0x44')][_0x2841('0x4f')]){_0x1e11a7['where']=_[_0x2841('0x50')](_0x1e11a7[_0x2841('0x4e')],{'$or':_[_0x2841('0x3c')](_0x1e11a7[_0x2841('0x47')],function(_0x2e0b02){var _0xba818f={};_0xba818f[_0x2e0b02]={'$like':'%'+_0x2df45d[_0x2841('0x44')]['filter']+'%'};return _0xba818f;})});}_0x1e11a7=_[_0x2841('0x50')]({},_0x1e11a7,_0x2df45d[_0x2841('0x57')]);return _0x32e8cf[_0x2841('0xbf')](_0x1e11a7);}})[_0x2841('0x33')](function(_0x32a2b9){if(_0x32a2b9){_0x4a1f0a=_0x32a2b9['length'];if(!_0x2df45d[_0x2841('0x44')][_0x2841('0x4a')]('nolimit')){_0x1e11a7[_0x2841('0x2d')]=qs[_0x2841('0x2d')](_0x2df45d[_0x2841('0x44')][_0x2841('0x2d')]);_0x1e11a7[_0x2841('0x2b')]=qs[_0x2841('0x2b')](_0x2df45d['query'][_0x2841('0x2b')]);}return _0x32e8cf[_0x2841('0xbf')](_0x1e11a7);}})[_0x2841('0x33')](function(_0x32806b){if(_0x32806b){return _0x32806b?{'count':_0x4a1f0a,'rows':_0x32806b}:null;}})[_0x2841('0x33')](respondWithResult(_0x1019ba,null))[_0x2841('0x27')](handleError(_0x1019ba,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 2ea7b1a..c5b1691 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 _0x183e=['FaxAccount','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x45ec71,_0x31ca8b){var _0x386f82=function(_0x3023ce){while(--_0x3023ce){_0x45ec71['push'](_0x45ec71['shift']());}};_0x386f82(++_0x31ca8b);}(_0x183e,0x193));var _0xe183=function(_0x291626,_0x1687e8){_0x291626=_0x291626-0x0;var _0x532429=_0x183e[_0x291626];return _0x532429;};'use strict';var EventEmitter=require(_0xe183('0x0'));var FaxAccount=require(_0xe183('0x1'))['db'][_0xe183('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe183('0x3'),'afterUpdate':_0xe183('0x4'),'afterDestroy':_0xe183('0x5')};function emitEvent(_0x2866c5){return function(_0x3da57a,_0x267d2f,_0x548b59){FaxAccountEvents[_0xe183('0x6')](_0x2866c5+':'+_0x3da57a['id'],_0x3da57a);FaxAccountEvents[_0xe183('0x6')](_0x2866c5,_0x3da57a);_0x548b59(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe183('0x7')](e,emitEvent(event));}}module[_0xe183('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xc47a=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x827661,_0x1d8e22){var _0x5ca2bf=function(_0x3597b2){while(--_0x3597b2){_0x827661['push'](_0x827661['shift']());}};_0x5ca2bf(++_0x1d8e22);}(_0xc47a,0x1ab));var _0xac47=function(_0x15aefd,_0x4576d5){_0x15aefd=_0x15aefd-0x0;var _0x543da9=_0xc47a[_0x15aefd];return _0x543da9;};'use strict';var EventEmitter=require(_0xac47('0x0'));var FaxAccount=require(_0xac47('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xac47('0x2')](0x0);var events={'afterCreate':_0xac47('0x3'),'afterUpdate':_0xac47('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56293c){return function(_0x1274e3,_0x24ec7d,_0x13c8ae){FaxAccountEvents[_0xac47('0x5')](_0x56293c+':'+_0x1274e3['id'],_0x1274e3);FaxAccountEvents[_0xac47('0x5')](_0x56293c,_0x1274e3);_0x13c8ae(null);};}for(var e in events){if(events[_0xac47('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xac47('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 62b8e28..f505804 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 _0x5079=['FaxAccount','fax_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5ddd01,_0x3fe3dc){var _0x34a225=function(_0x1d4427){while(--_0x1d4427){_0x5ddd01['push'](_0x5ddd01['shift']());}};_0x34a225(++_0x3fe3dc);}(_0x5079,0x70));var _0x9507=function(_0x11160d,_0x413adc){_0x11160d=_0x11160d-0x0;var _0x21520a=_0x5079[_0x11160d];return _0x21520a;};'use strict';var _=require('lodash');var util=require(_0x9507('0x0'));var logger=require(_0x9507('0x1'))('api');var moment=require(_0x9507('0x2'));var BPromise=require(_0x9507('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9507('0x4'));var rimraf=require(_0x9507('0x5'));var config=require(_0x9507('0x6'));var attributes=require('./faxAccount.attributes');module[_0x9507('0x7')]=function(_0x21239e,_0x3aaf6b){return _0x21239e[_0x9507('0x8')](_0x9507('0x9'),attributes,{'tableName':_0x9507('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c25=['api','moment','bluebird','path','../../config/environment','exports','define','fax_accounts','lodash','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7c25,0x1b6));var _0x57c2=function(_0x189729,_0x5d3dc5){_0x189729=_0x189729-0x0;var _0x574f1f=_0x7c25[_0x189729];return _0x574f1f;};'use strict';var _=require(_0x57c2('0x0'));var util=require('util');var logger=require(_0x57c2('0x1'))(_0x57c2('0x2'));var moment=require(_0x57c2('0x3'));var BPromise=require(_0x57c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57c2('0x5'));var rimraf=require('rimraf');var config=require(_0x57c2('0x6'));var attributes=require('./faxAccount.attributes');module[_0x57c2('0x7')]=function(_0x5cec3d,_0x3ed237){return _0x5cec3d[_0x57c2('0x8')]('FaxAccount',attributes,{'tableName':_0x57c2('0x9'),'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 e83bb45..4de493c 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 _0x9de4=['Contacts','DESC','FaxApplication','get','Applications','list','applications','asc','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','map','attributes','include','model','then','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','createdAt','updatedAt','keys','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','List'];(function(_0x572d98,_0xeca432){var _0x40706a=function(_0x353812){while(--_0x353812){_0x572d98['push'](_0x572d98['shift']());}};_0x40706a(++_0xeca432);}(_0x9de4,0x76));var _0x49de=function(_0x2d7aec,_0x2831ad){_0x2d7aec=_0x2d7aec-0x0;var _0x1a647e=_0x9de4[_0x2d7aec];return _0x1a647e;};'use strict';var _=require('lodash');var util=require(_0x49de('0x0'));var moment=require(_0x49de('0x1'));var BPromise=require(_0x49de('0x2'));var rs=require(_0x49de('0x3'));var fs=require('fs');var Redis=require(_0x49de('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49de('0x5'))('rpc');var config=require(_0x49de('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49de('0x7')]({'port':0x232c});config[_0x49de('0x8')]=_[_0x49de('0x9')](config[_0x49de('0x8')],{'host':_0x49de('0xa'),'port':0x18eb});var socket=require(_0x49de('0xb'))(new Redis(config[_0x49de('0x8')]));require(_0x49de('0xc'))[_0x49de('0xd')](socket);function respondWithRpcPromise(_0x175012,_0xbbe3bc,_0x1c273c){return new BPromise(function(_0x9b9c18,_0x25119d){return client[_0x49de('0xe')](_0x175012,_0x1c273c)['then'](function(_0x4c120c){logger[_0x49de('0xf')](_0x49de('0x10'),_0xbbe3bc,_0x49de('0x11'));logger[_0x49de('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xbbe3bc,'request\x20sent',JSON[_0x49de('0x13')](_0x4c120c));if(_0x4c120c['error']){if(_0x4c120c[_0x49de('0x14')][_0x49de('0x15')]===0x1f4){logger[_0x49de('0x14')](_0x49de('0x10'),_0xbbe3bc,_0x4c120c['error']['message']);return _0x25119d(_0x4c120c[_0x49de('0x14')][_0x49de('0x16')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0xbbe3bc,_0x4c120c['error']['message']);return _0x9b9c18(_0x4c120c['error'][_0x49de('0x16')]);}else{logger[_0x49de('0xf')](_0x49de('0x10'),_0xbbe3bc,_0x49de('0x11'));_0x9b9c18(_0x4c120c['result'][_0x49de('0x16')]);}})[_0x49de('0x17')](function(_0x4c2baa){logger['error'](_0x49de('0x10'),_0xbbe3bc,_0x4c2baa);_0x25119d(_0x4c2baa);});});}exports[_0x49de('0x18')]=function(_0x5d1244){var _0x2b2c48=this;return new Promise(function(_0xf1a6a7,_0x1427a5){return db[_0x49de('0x19')][_0x49de('0x1a')]({'raw':_0x5d1244[_0x49de('0x1b')]?_0x5d1244[_0x49de('0x1b')][_0x49de('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d1244[_0x49de('0x1b')]?_0x5d1244[_0x49de('0x1b')][_0x49de('0x1d')]||null:null,'attributes':_0x5d1244['options']?_0x5d1244[_0x49de('0x1b')]['attributes']||null:null,'limit':_0x5d1244[_0x49de('0x1b')]?_0x5d1244['options']['limit']||null:null,'include':_0x5d1244[_0x49de('0x1b')]?_0x5d1244['options']['include']?_[_0x49de('0x1e')](_0x5d1244['options']['include'],function(_0x35e0b3){return{'model':db[_0x35e0b3['model']],'as':_0x35e0b3['as'],'attributes':_0x35e0b3[_0x49de('0x1f')],'include':_0x35e0b3[_0x49de('0x20')]?_[_0x49de('0x1e')](_0x35e0b3[_0x49de('0x20')],function(_0x260fa4){return{'model':db[_0x260fa4['model']],'as':_0x260fa4['as'],'attributes':_0x260fa4[_0x49de('0x1f')],'include':_0x260fa4[_0x49de('0x20')]?_[_0x49de('0x1e')](_0x260fa4[_0x49de('0x20')],function(_0x207635){return{'model':db[_0x207635[_0x49de('0x21')]],'as':_0x207635['as'],'attributes':_0x207635[_0x49de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x49de('0x22')](function(_0x56ff1a){logger[_0x49de('0xf')]('GetFaxAccount',_0x5d1244);logger[_0x49de('0x12')](_0x49de('0x18'),_0x5d1244,JSON[_0x49de('0x13')](_0x56ff1a));_0xf1a6a7(_0x56ff1a);})[_0x49de('0x17')](function(_0x5894cc){logger['error'](_0x49de('0x18'),_0x5894cc['message'],_0x5d1244);_0x1427a5(_0x2b2c48[_0x49de('0x14')](0x1f4,_0x5894cc[_0x49de('0x16')]));});});};exports[_0x49de('0x23')]=function(_0x56bc96,_0x2896d1,_0x1350d9){var _0x57551f=this;return new Promise(function(_0x48dc81,_0x178269){var _0xa305bf={'body':_0x56bc96[_0x49de('0x24')],'channel':_0x49de('0x25')};var _0x2c3915=[];var _0x44509d=[];var _0x40ca46={};return db[_0x49de('0x26')][_0x49de('0x27')]()[_0x49de('0x22')](function(_0x45fa05){if(!_0x45fa05){throw new db[(_0x49de('0x28'))][(_0x49de('0x29'))]('no\x20available\x20attributes');}_0x2c3915=_['difference'](_['keys'](_0x45fa05),[_0x49de('0x2a'),_0x49de('0x2b')]);_0x44509d=_['difference'](_[_0x49de('0x2c')](_0x45fa05),[_0x49de('0x2a'),_0x49de('0x2b'),_0x49de('0x2d'),_0x49de('0x2e')]);if(_0x56bc96[_0x49de('0x24')]['id']){delete _0x56bc96['body']['id'];}if(_['isNil'](_0x56bc96['body'][_0x49de('0x2f')])){throw new db['Sequelize']['ValidationError'](_0x49de('0x30'));}if(_[_0x49de('0x31')](_0x56bc96['body'][_0x49de('0x24')])||_0x56bc96[_0x49de('0x24')][_0x49de('0x24')]===''){throw new db['Sequelize']['ValidationError'](_0x49de('0x32'));}if(_[_0x49de('0x31')](_0x56bc96[_0x49de('0x24')][_0x49de('0x33')])){throw new db['Sequelize'][(_0x49de('0x29'))](_0x49de('0x34')+_0x44509d);}if(!_[_0x49de('0x35')](_0x44509d,_0x56bc96[_0x49de('0x24')]['mapKey'])){throw new db['Sequelize'][(_0x49de('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44509d);}_0x40ca46[_0x56bc96[_0x49de('0x24')][_0x49de('0x33')]]=_0x56bc96[_0x49de('0x24')][_0x49de('0x2f')];})[_0x49de('0x22')](function(){return db['FaxAccount'][_0x49de('0x36')]({'where':{'id':_0x56bc96[_0x49de('0x37')]['id']},'include':[{'model':db[_0x49de('0x38')],'as':_0x49de('0x39'),'include':[{'model':db[_0x49de('0x26')],'as':_0x49de('0x3a'),'where':_0x40ca46,'limit':0x1,'order':[[_0x49de('0x2b'),_0x49de('0x3b')]]}]},{'model':db[_0x49de('0x3c')],'as':'Applications'}]});})[_0x49de('0x22')](function(_0x333125){if(_0x333125&&_0x333125['List']){var _0x49373a=_0x333125[_0x49de('0x3d')]({'plain':!![]});_0xa305bf[_0x49de('0x37')]=_0x49373a;_0xa305bf['applications']=_0x49373a[_0x49de('0x3e')];_0xa305bf[_0x49de('0x3f')]=_0x49373a[_0x49de('0x39')];_0xa305bf[_0x49de('0x40')]=_['orderBy'](_0xa305bf[_0x49de('0x40')],['priority'],[_0x49de('0x41')]);if(_0xa305bf[_0x49de('0x37')][_0x49de('0x3e')]){delete _0xa305bf[_0x49de('0x37')][_0x49de('0x3e')];}if(_0xa305bf[_0x49de('0x37')][_0x49de('0x39')]&&_0xa305bf['account']['List'][_0x49de('0x3a')]['length']){return _0xa305bf[_0x49de('0x37')][_0x49de('0x39')]['Contacts'][0x0];}var _0xb2ea3c=_[_0x49de('0x9')](_0x56bc96[_0x49de('0x24')],{'firstName':_0x56bc96[_0x49de('0x24')][_0x49de('0x2f')],'ListId':_0x49373a[_0x49de('0x2e')]});_0xb2ea3c[_0x56bc96[_0x49de('0x24')][_0x49de('0x33')]]=_0x56bc96[_0x49de('0x24')][_0x49de('0x2f')];return db[_0x49de('0x26')][_0x49de('0x42')](_0xb2ea3c,{'fields':_0x2c3915,'raw':!![]});}})[_0x49de('0x22')](function(_0x4bc2ea){_0xa305bf[_0x49de('0x43')]=_0x4bc2ea;if(_0x4bc2ea){var _0x348224={'ContactId':_0x4bc2ea['id'],'FaxAccountId':_0x56bc96['account']['id'],'fax':_0x4bc2ea['fax']};return db[_0x49de('0x44')]['find']({'where':{'ContactId':_0x4bc2ea['id'],'closed':![],'FaxAccountId':_0x56bc96[_0x49de('0x37')]['id']}})[_0x49de('0x22')](function(_0x48bc84){if(_0x48bc84){return[_0x48bc84,![]];}return db[_0x49de('0x44')]['create'](_0x348224)['then'](function(_0x24c349){return[_0x24c349,!![]];});});}else{throw new Error(_0x49de('0x45'));}})[_0x49de('0x46')](function(_0x2b8751,_0x45d0a6){var _0x42fb1e=_0x2b8751[_0x49de('0x3d')]({'plain':!![]});if(_0x45d0a6){if(_0xa305bf[_0x49de('0x37')][_0x49de('0x47')]){_0xa305bf['applications'][_0x49de('0x48')]({'id':0x0,'priority':_0xa305bf['applications'][_0x49de('0x49')]+0x1,'app':_0x49de('0x4a'),'appdata':_0x49de('0x4b'),'interval':_0x49de('0x4c')});}_0x42fb1e[_0x49de('0x4d')]=!![];}else{_0x42fb1e[_0x49de('0x4d')]=![];}_0xa305bf[_0x49de('0x4e')]=_0x42fb1e;return db[_0x49de('0x4f')]['create']({'body':_0x56bc96['body'][_0x49de('0x24')],'FaxAccountId':_0x56bc96[_0x49de('0x37')]['id'],'FaxInteractionId':_0x2b8751['id'],'direction':'in','ContactId':_0x2b8751['ContactId'],'AttachmentId':_0x56bc96[_0x49de('0x24')][_0x49de('0x50')]});})[_0x49de('0x22')](function(_0x5af579){_0xa305bf[_0x49de('0x16')]=_0x5af579;if(_0xa305bf[_0x49de('0x4e')][_0x49de('0x51')]){return db['User'][_0x49de('0x36')]({'attributes':['id','name'],'where':{'id':_0xa305bf[_0x49de('0x4e')][_0x49de('0x51')]}})['then'](function(_0x1d01f8){if(_0x1d01f8){_0xa305bf[_0x49de('0x40')][_0x49de('0x52')]({'id':0x0,'priority':0x0,'app':_0x49de('0x53'),'appdata':_0x1d01f8[_0x49de('0x54')]+','+(_0xa305bf[_0x49de('0x37')][_0x49de('0x55')]||0xa),'interval':_0x49de('0x4c')});}return respondWithRpcPromise(_0x49de('0x56'),_0x49de('0x57'),_0xa305bf);});}return respondWithRpcPromise(_0x49de('0x56'),_0x49de('0x57'),_0xa305bf);})[_0x49de('0x22')](function(_0x5ead88){_0x48dc81(_0x5ead88);})['catch'](function(_0x287787){_0x178269(_0x57551f[_0x49de('0x14')](0x1f4,_0x287787[_0x49de('0x16')]));});});}; \ No newline at end of file +var _0x41c9=['push','applications','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','create','AttachmentId','User','find','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','model','map','fax','CmContact','describe','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','get','account','list','orderBy','asc','contact','FaxInteraction','Contact\x20not\x20found','spread'];(function(_0x552e09,_0x32eea9){var _0x3dd40a=function(_0x471747){while(--_0x471747){_0x552e09['push'](_0x552e09['shift']());}};_0x3dd40a(++_0x32eea9);}(_0x41c9,0x176));var _0x941c=function(_0x201aa6,_0x225b9e){_0x201aa6=_0x201aa6-0x0;var _0x1a1d00=_0x41c9[_0x201aa6];return _0x1a1d00;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x941c('0x0'));var BPromise=require(_0x941c('0x1'));var rs=require(_0x941c('0x2'));var fs=require('fs');var Redis=require(_0x941c('0x3'));var db=require(_0x941c('0x4'))['db'];var utils=require(_0x941c('0x5'));var logger=require('../../config/logger')(_0x941c('0x6'));var config=require(_0x941c('0x7'));var jayson=require(_0x941c('0x8'));var client=jayson[_0x941c('0x9')][_0x941c('0xa')]({'port':0x232c});config[_0x941c('0xb')]=_[_0x941c('0xc')](config[_0x941c('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x941c('0xb')]));require(_0x941c('0xd'))['register'](socket);function respondWithRpcPromise(_0x30d817,_0x1fdd45,_0x56f539){return new BPromise(function(_0x26e699,_0x3d190e){return client[_0x941c('0xe')](_0x30d817,_0x56f539)[_0x941c('0xf')](function(_0x19ec03){logger[_0x941c('0x10')](_0x941c('0x11'),_0x1fdd45,_0x941c('0x12'));logger[_0x941c('0x13')](_0x941c('0x14'),_0x1fdd45,'request\x20sent',JSON[_0x941c('0x15')](_0x19ec03));if(_0x19ec03['error']){if(_0x19ec03[_0x941c('0x16')][_0x941c('0x17')]===0x1f4){logger['error'](_0x941c('0x11'),_0x1fdd45,_0x19ec03[_0x941c('0x16')][_0x941c('0x18')]);return _0x3d190e(_0x19ec03[_0x941c('0x16')][_0x941c('0x18')]);}logger[_0x941c('0x16')](_0x941c('0x11'),_0x1fdd45,_0x19ec03[_0x941c('0x16')]['message']);return _0x26e699(_0x19ec03['error'][_0x941c('0x18')]);}else{logger[_0x941c('0x10')](_0x941c('0x11'),_0x1fdd45,_0x941c('0x12'));_0x26e699(_0x19ec03[_0x941c('0x19')][_0x941c('0x18')]);}})[_0x941c('0x1a')](function(_0x553680){logger[_0x941c('0x16')](_0x941c('0x11'),_0x1fdd45,_0x553680);_0x3d190e(_0x553680);});});}exports[_0x941c('0x1b')]=function(_0x343d64){var _0x59bfdc=this;return new Promise(function(_0x2ea786,_0x529665){return db[_0x941c('0x1c')][_0x941c('0x1d')]({'raw':_0x343d64[_0x941c('0x1e')]?_0x343d64[_0x941c('0x1e')][_0x941c('0x1f')]===undefined?!![]:![]:!![],'where':_0x343d64[_0x941c('0x1e')]?_0x343d64[_0x941c('0x1e')][_0x941c('0x20')]||null:null,'attributes':_0x343d64['options']?_0x343d64[_0x941c('0x1e')][_0x941c('0x21')]||null:null,'limit':_0x343d64[_0x941c('0x1e')]?_0x343d64[_0x941c('0x1e')]['limit']||null:null,'include':_0x343d64[_0x941c('0x1e')]?_0x343d64[_0x941c('0x1e')][_0x941c('0x22')]?_['map'](_0x343d64[_0x941c('0x1e')][_0x941c('0x22')],function(_0x554ab6){return{'model':db[_0x554ab6[_0x941c('0x23')]],'as':_0x554ab6['as'],'attributes':_0x554ab6[_0x941c('0x21')],'include':_0x554ab6[_0x941c('0x22')]?_[_0x941c('0x24')](_0x554ab6[_0x941c('0x22')],function(_0x5929d7){return{'model':db[_0x5929d7[_0x941c('0x23')]],'as':_0x5929d7['as'],'attributes':_0x5929d7[_0x941c('0x21')],'include':_0x5929d7['include']?_['map'](_0x5929d7[_0x941c('0x22')],function(_0x20d643){return{'model':db[_0x20d643[_0x941c('0x23')]],'as':_0x20d643['as'],'attributes':_0x20d643['attributes']};}):[]};}):[]};}):[]:[]})[_0x941c('0xf')](function(_0x5dda02){logger[_0x941c('0x10')]('GetFaxAccount',_0x343d64);logger['debug'](_0x941c('0x1b'),_0x343d64,JSON[_0x941c('0x15')](_0x5dda02));_0x2ea786(_0x5dda02);})[_0x941c('0x1a')](function(_0x235793){logger[_0x941c('0x16')](_0x941c('0x1b'),_0x235793[_0x941c('0x18')],_0x343d64);_0x529665(_0x59bfdc[_0x941c('0x16')](0x1f4,_0x235793[_0x941c('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x481d70,_0x421d6d,_0x1e00a2){var _0x82c9b6=this;return new Promise(function(_0x1241e9,_0x7ab123){var _0x2ef6c1={'body':_0x481d70['body'],'channel':_0x941c('0x25')};var _0x1fe69a=[];var _0x1b2080=[];var _0x481a96={};return db[_0x941c('0x26')][_0x941c('0x27')]()['then'](function(_0x5f3073){if(!_0x5f3073){throw new db['Sequelize'][(_0x941c('0x28'))]('no\x20available\x20attributes');}_0x1fe69a=_[_0x941c('0x29')](_[_0x941c('0x2a')](_0x5f3073),['createdAt',_0x941c('0x2b')]);_0x1b2080=_[_0x941c('0x29')](_['keys'](_0x5f3073),[_0x941c('0x2c'),_0x941c('0x2b'),_0x941c('0x2d'),_0x941c('0x2e')]);if(_0x481d70[_0x941c('0x2f')]['id']){delete _0x481d70[_0x941c('0x2f')]['id'];}if(_[_0x941c('0x30')](_0x481d70[_0x941c('0x2f')][_0x941c('0x31')])){throw new db['Sequelize'][(_0x941c('0x28'))](_0x941c('0x32'));}if(_[_0x941c('0x30')](_0x481d70[_0x941c('0x2f')][_0x941c('0x2f')])||_0x481d70[_0x941c('0x2f')][_0x941c('0x2f')]===''){throw new db['Sequelize'][(_0x941c('0x28'))](_0x941c('0x33'));}if(_[_0x941c('0x30')](_0x481d70[_0x941c('0x2f')][_0x941c('0x34')])){throw new db[(_0x941c('0x35'))][(_0x941c('0x28'))](_0x941c('0x36')+_0x1b2080);}if(!_[_0x941c('0x37')](_0x1b2080,_0x481d70[_0x941c('0x2f')][_0x941c('0x34')])){throw new db[(_0x941c('0x35'))][(_0x941c('0x28'))](_0x941c('0x38')+_0x1b2080);}_0x481a96[_0x481d70[_0x941c('0x2f')][_0x941c('0x34')]]=_0x481d70[_0x941c('0x2f')][_0x941c('0x31')];})[_0x941c('0xf')](function(){return db['FaxAccount']['find']({'where':{'id':_0x481d70['account']['id']},'include':[{'model':db[_0x941c('0x39')],'as':_0x941c('0x3a'),'include':[{'model':db[_0x941c('0x26')],'as':_0x941c('0x3b'),'where':_0x481a96,'limit':0x1,'order':[[_0x941c('0x2b'),_0x941c('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0x941c('0x3d')}]});})[_0x941c('0xf')](function(_0x35f95b){if(_0x35f95b&&_0x35f95b[_0x941c('0x3a')]){var _0x425369=_0x35f95b[_0x941c('0x3e')]({'plain':!![]});_0x2ef6c1[_0x941c('0x3f')]=_0x425369;_0x2ef6c1['applications']=_0x425369[_0x941c('0x3d')];_0x2ef6c1[_0x941c('0x40')]=_0x425369[_0x941c('0x3a')];_0x2ef6c1['applications']=_[_0x941c('0x41')](_0x2ef6c1['applications'],['priority'],[_0x941c('0x42')]);if(_0x2ef6c1[_0x941c('0x3f')]['Applications']){delete _0x2ef6c1['account'][_0x941c('0x3d')];}if(_0x2ef6c1['account'][_0x941c('0x3a')]&&_0x2ef6c1['account']['List']['Contacts']['length']){return _0x2ef6c1[_0x941c('0x3f')][_0x941c('0x3a')][_0x941c('0x3b')][0x0];}var _0x67954=_[_0x941c('0xc')](_0x481d70[_0x941c('0x2f')],{'firstName':_0x481d70[_0x941c('0x2f')][_0x941c('0x31')],'ListId':_0x425369['ListId']});_0x67954[_0x481d70[_0x941c('0x2f')][_0x941c('0x34')]]=_0x481d70[_0x941c('0x2f')][_0x941c('0x31')];return db[_0x941c('0x26')]['create'](_0x67954,{'fields':_0x1fe69a,'raw':!![]});}})[_0x941c('0xf')](function(_0x2fedfe){_0x2ef6c1[_0x941c('0x43')]=_0x2fedfe;if(_0x2fedfe){var _0xd2764e={'ContactId':_0x2fedfe['id'],'FaxAccountId':_0x481d70[_0x941c('0x3f')]['id'],'fax':_0x2fedfe[_0x941c('0x25')]};return db[_0x941c('0x44')]['find']({'where':{'ContactId':_0x2fedfe['id'],'closed':![],'FaxAccountId':_0x481d70[_0x941c('0x3f')]['id']}})[_0x941c('0xf')](function(_0x7e0a3d){if(_0x7e0a3d){return[_0x7e0a3d,![]];}return db[_0x941c('0x44')]['create'](_0xd2764e)[_0x941c('0xf')](function(_0x4f39d7){return[_0x4f39d7,!![]];});});}else{throw new Error(_0x941c('0x45'));}})[_0x941c('0x46')](function(_0x57be90,_0x3e05df){var _0x3b003f=_0x57be90[_0x941c('0x3e')]({'plain':!![]});if(_0x3e05df){if(_0x2ef6c1[_0x941c('0x3f')]['autoclose']){_0x2ef6c1['applications'][_0x941c('0x47')]({'id':0x0,'priority':_0x2ef6c1[_0x941c('0x48')]['length']+0x1,'app':_0x941c('0x49'),'appdata':_0x941c('0x4a'),'interval':_0x941c('0x4b')});}_0x3b003f[_0x941c('0x4c')]=!![];}else{_0x3b003f['created']=![];}_0x2ef6c1[_0x941c('0x4d')]=_0x3b003f;return db[_0x941c('0x4e')][_0x941c('0x4f')]({'body':_0x481d70[_0x941c('0x2f')][_0x941c('0x2f')],'FaxAccountId':_0x481d70[_0x941c('0x3f')]['id'],'FaxInteractionId':_0x57be90['id'],'direction':'in','ContactId':_0x57be90['ContactId'],'AttachmentId':_0x481d70[_0x941c('0x2f')][_0x941c('0x50')]});})[_0x941c('0xf')](function(_0x36dfe7){_0x2ef6c1['message']=_0x36dfe7;if(_0x2ef6c1['interaction']['UserId']){return db[_0x941c('0x51')][_0x941c('0x52')]({'attributes':['id',_0x941c('0x53')],'where':{'id':_0x2ef6c1[_0x941c('0x4d')]['UserId']}})[_0x941c('0xf')](function(_0x8e258c){if(_0x8e258c){_0x2ef6c1['applications'][_0x941c('0x54')]({'id':0x0,'priority':0x0,'app':_0x941c('0x55'),'appdata':_0x8e258c['name']+','+(_0x2ef6c1[_0x941c('0x3f')][_0x941c('0x56')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x941c('0x57'),_0x2ef6c1);});}return respondWithRpcPromise(_0x941c('0x58'),_0x941c('0x57'),_0x2ef6c1);})[_0x941c('0xf')](function(_0x2ed0f7){_0x1241e9(_0x2ed0f7);})['catch'](function(_0x2d285e){_0x7ab123(_0x82c9b6['error'](0x1f4,_0x2d285e[_0x941c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ca5baca..53071d5 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 _0xd173=['remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x198a3c,_0x221709){var _0x2e9a59=function(_0x42f786){while(--_0x42f786){_0x198a3c['push'](_0x198a3c['shift']());}};_0x2e9a59(++_0x221709);}(_0xd173,0x97));var _0x3d17=function(_0x20b233,_0x248ba9){_0x20b233=_0x20b233-0x0;var _0x4fe3e4=_0xd173[_0x20b233];return _0x4fe3e4;};'use strict';var FaxAccountEvents=require(_0x3d17('0x0'));var events=['save',_0x3d17('0x1'),_0x3d17('0x2')];function createListener(_0x2ddccf,_0x24a529){return function(_0x4dd22c){_0x24a529[_0x3d17('0x3')](_0x2ddccf,_0x4dd22c);};}function removeListener(_0x494f1f,_0x4b04eb){return function(){FaxAccountEvents[_0x3d17('0x4')](_0x494f1f,_0x4b04eb);};}exports[_0x3d17('0x5')]=function(_0x568ae1){for(var _0x4bd7ee=0x0,_0x307073=events[_0x3d17('0x6')];_0x4bd7ee<_0x307073;_0x4bd7ee++){var _0x3b535f=events[_0x4bd7ee];var _0x29251e=createListener(_0x3d17('0x7')+_0x3b535f,_0x568ae1);FaxAccountEvents['on'](_0x3b535f,_0x29251e);}}; \ No newline at end of file +var _0xadec=['length','faxAccount:','./faxAccount.events','save','remove','emit','removeListener','register'];(function(_0x21a5be,_0x5226a0){var _0x1a53a9=function(_0x3b66fc){while(--_0x3b66fc){_0x21a5be['push'](_0x21a5be['shift']());}};_0x1a53a9(++_0x5226a0);}(_0xadec,0x132));var _0xcade=function(_0x462729,_0x226b5a){_0x462729=_0x462729-0x0;var _0x107767=_0xadec[_0x462729];return _0x107767;};'use strict';var FaxAccountEvents=require(_0xcade('0x0'));var events=[_0xcade('0x1'),_0xcade('0x2'),'update'];function createListener(_0x1bf75d,_0x319bfd){return function(_0x2acf64){_0x319bfd[_0xcade('0x3')](_0x1bf75d,_0x2acf64);};}function removeListener(_0x21519f,_0x3ddb28){return function(){FaxAccountEvents[_0xcade('0x4')](_0x21519f,_0x3ddb28);};}exports[_0xcade('0x5')]=function(_0x1c7119){for(var _0xf1cba3=0x0,_0xb220a=events[_0xcade('0x6')];_0xf1cba3<_0xb220a;_0xf1cba3++){var _0x384317=events[_0xf1cba3];var _0x3fd08d=createListener(_0xcade('0x7')+_0x384317,_0x1c7119);FaxAccountEvents['on'](_0x384317,_0x3fd08d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1807870..e7e3479 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(_0x1cca28,_0x405423){var _0x4721a7=function(_0x2d797b){while(--_0x2d797b){_0x1cca28['push'](_0x1cca28['shift']());}};_0x4721a7(++_0x405423);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x5c52b2,_0x449e2b){var _0x2a4943=function(_0x44dc9d){while(--_0x44dc9d){_0x5c52b2['push'](_0x5c52b2['shift']());}};_0x2a4943(++_0x449e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 3b75f60..b2f7469 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 _0xc3c9=['TEXT','*,*,*,*','STRING','noop'];(function(_0x2be124,_0x1a11eb){var _0x5b6ed1=function(_0x2c552f){while(--_0x2c552f){_0x2be124['push'](_0x2be124['shift']());}};_0x5b6ed1(++_0x1a11eb);}(_0xc3c9,0x192));var _0x9c3c=function(_0x37e0c5,_0x46c212){_0x37e0c5=_0x37e0c5-0x0;var _0x22f40e=_0xc3c9[_0x37e0c5];return _0x22f40e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9c3c('0x0')],'allowNull':![],'defaultValue':_0x9c3c('0x1')},'appdata':{'type':Sequelize[_0x9c3c('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9c3c('0x3')}}; \ No newline at end of file +var _0xa1c3=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1c3,0x161));var _0x3a1c=function(_0x355b28,_0x5d24a2){_0x355b28=_0x355b28-0x0;var _0x525569=_0xa1c3[_0x355b28];return _0x525569;};'use strict';var Sequelize=require(_0x3a1c('0x0'));module[_0x3a1c('0x1')]={'priority':{'type':Sequelize[_0x3a1c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3a1c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3a1c('0x4')]()},'description':{'type':Sequelize[_0x3a1c('0x3')]},'interval':{'type':Sequelize[_0x3a1c('0x3')],'defaultValue':_0x3a1c('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3325605..4d1f57e 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 _0x24f5=['undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x369387,_0xe5dcc8){var _0x33b40f=function(_0x16377a){while(--_0x16377a){_0x369387['push'](_0x369387['shift']());}};_0x33b40f(++_0xe5dcc8);}(_0x24f5,0x79));var _0x524f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x24f5[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x524f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x524f('0x1'));var jsonpatch=require(_0x524f('0x2'));var rp=require(_0x524f('0x3'));var moment=require(_0x524f('0x4'));var BPromise=require(_0x524f('0x5'));var Mustache=require(_0x524f('0x6'));var util=require(_0x524f('0x7'));var path=require('path');var sox=require(_0x524f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x524f('0x9'));var _=require(_0x524f('0xa'));var squel=require('squel');var crypto=require(_0x524f('0xb'));var jsforce=require(_0x524f('0xc'));var deskjs=require(_0x524f('0xd'));var toCsv=require(_0x524f('0xe'));var querystring=require(_0x524f('0xf'));var Papa=require('papaparse');var Redis=require(_0x524f('0x10'));var authService=require(_0x524f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x524f('0x12'));var hardwareService=require(_0x524f('0x13'));var logger=require(_0x524f('0x14'))(_0x524f('0x15'));var utils=require('../../config/utils');var config=require(_0x524f('0x16'));var licenseUtil=require(_0x524f('0x17'));var db=require(_0x524f('0x18'))['db'];function respondWithStatusCode(_0x29f0fd,_0x5a7430){_0x5a7430=_0x5a7430||0xcc;return function(_0x4a2391){if(_0x4a2391){return _0x29f0fd['sendStatus'](_0x5a7430);}return _0x29f0fd[_0x524f('0x19')](_0x5a7430)[_0x524f('0x1a')]();};}function respondWithResult(_0x529d89,_0x41b856){_0x41b856=_0x41b856||0xc8;return function(_0x5d8cd8){if(_0x5d8cd8){return _0x529d89[_0x524f('0x19')](_0x41b856)[_0x524f('0x1b')](_0x5d8cd8);}};}function respondWithFilteredResult(_0x293f8e,_0x46cf2c){return function(_0x117a36){if(_0x117a36){var _0xee3eb3=typeof _0x46cf2c[_0x524f('0x1c')]===_0x524f('0x1d')&&typeof _0x46cf2c['limit']===_0x524f('0x1d');var _0x6bcb=_0x117a36['count'];var _0x53df3d=_0xee3eb3?0x0:_0x46cf2c[_0x524f('0x1c')];var _0x8756a3=_0xee3eb3?_0x117a36[_0x524f('0x1e')]:_0x46cf2c[_0x524f('0x1c')]+_0x46cf2c[_0x524f('0x1f')];var _0x59b223;if(_0x8756a3>=_0x6bcb){_0x8756a3=_0x6bcb;_0x59b223=0xc8;}else{_0x59b223=0xce;}_0x293f8e[_0x524f('0x19')](_0x59b223);return _0x293f8e[_0x524f('0x20')](_0x524f('0x21'),_0x53df3d+'-'+_0x8756a3+'/'+_0x6bcb)[_0x524f('0x1b')](_0x117a36);}return null;};}function patchUpdates(_0x2db514){return function(_0x3040a1){try{jsonpatch[_0x524f('0x22')](_0x3040a1,_0x2db514,!![]);}catch(_0x55fb5f){return BPromise['reject'](_0x55fb5f);}return _0x3040a1['save']();};}function saveUpdates(_0xcfb4e7,_0x2a915c){return function(_0x447c61){if(_0x447c61){return _0x447c61[_0x524f('0x23')](_0xcfb4e7)[_0x524f('0x24')](function(_0xbad1dd){return _0xbad1dd;});}return null;};}function removeEntity(_0x1197c9,_0x290817){return function(_0x140675){if(_0x140675){return _0x140675[_0x524f('0x25')]()[_0x524f('0x24')](function(){_0x1197c9['status'](0xcc)[_0x524f('0x1a')]();});}};}function handleEntityNotFound(_0x1465d4,_0x5668ee){return function(_0x2ab4ba){if(!_0x2ab4ba){_0x1465d4[_0x524f('0x26')](0x194);}return _0x2ab4ba;};}function handleError(_0xc60477,_0x306588){_0x306588=_0x306588||0x1f4;return function(_0x2e629c){logger[_0x524f('0x27')](_0x2e629c[_0x524f('0x28')]);if(_0x2e629c[_0x524f('0x29')]){delete _0x2e629c[_0x524f('0x29')];}_0xc60477[_0x524f('0x19')](_0x306588)[_0x524f('0x2a')](_0x2e629c);};}exports[_0x524f('0x2b')]=function(_0x1017b7,_0x510cb5){var _0x50efcb={},_0x583513={},_0x228685={'count':0x0,'rows':[]};var _0xb97a58=_[_0x524f('0x2c')](db[_0x524f('0x2d')]['rawAttributes'],function(_0x43b554){return{'name':_0x43b554[_0x524f('0x2e')],'type':_0x43b554[_0x524f('0x2f')][_0x524f('0x30')]};});_0x583513[_0x524f('0x31')]=_['map'](_0xb97a58,'name');_0x583513['query']=_[_0x524f('0x32')](_0x1017b7[_0x524f('0x33')]);_0x583513[_0x524f('0x34')]=_[_0x524f('0x35')](_0x583513[_0x524f('0x31')],_0x583513[_0x524f('0x33')]);_0x50efcb[_0x524f('0x36')]=_['intersection'](_0x583513['model'],qs[_0x524f('0x37')](_0x1017b7[_0x524f('0x33')][_0x524f('0x37')]));_0x50efcb[_0x524f('0x36')]=_0x50efcb[_0x524f('0x36')][_0x524f('0x38')]?_0x50efcb['attributes']:_0x583513[_0x524f('0x31')];if(!_0x1017b7[_0x524f('0x33')][_0x524f('0x39')](_0x524f('0x3a'))){_0x50efcb[_0x524f('0x1f')]=qs[_0x524f('0x1f')](_0x1017b7['query']['limit']);_0x50efcb[_0x524f('0x1c')]=qs[_0x524f('0x1c')](_0x1017b7[_0x524f('0x33')]['offset']);}_0x50efcb[_0x524f('0x3b')]=qs['sort'](_0x1017b7['query'][_0x524f('0x3c')]);_0x50efcb[_0x524f('0x3d')]=qs['filters'](_[_0x524f('0x3e')](_0x1017b7['query'],_0x583513[_0x524f('0x34')]),_0xb97a58);if(_0x1017b7[_0x524f('0x33')][_0x524f('0x3f')]){_0x50efcb['where']=_['merge'](_0x50efcb['where'],{'$or':_[_0x524f('0x2c')](_0xb97a58,function(_0x2d5778){if(_0x2d5778[_0x524f('0x2f')]!=='VIRTUAL'){var _0x36d160={};_0x36d160[_0x2d5778[_0x524f('0x29')]]={'$like':'%'+_0x1017b7[_0x524f('0x33')][_0x524f('0x3f')]+'%'};return _0x36d160;}})});}_0x50efcb=_[_0x524f('0x40')]({},_0x50efcb,_0x1017b7[_0x524f('0x41')]);var _0x3656f1={'where':_0x50efcb['where']};return db[_0x524f('0x2d')][_0x524f('0x1e')](_0x3656f1)[_0x524f('0x24')](function(_0x3ef250){_0x228685[_0x524f('0x1e')]=_0x3ef250;if(_0x1017b7[_0x524f('0x33')][_0x524f('0x42')]){_0x50efcb[_0x524f('0x43')]=[{'all':!![]}];}return db[_0x524f('0x2d')][_0x524f('0x44')](_0x50efcb);})[_0x524f('0x24')](function(_0x2885f0){_0x228685[_0x524f('0x45')]=_0x2885f0;return _0x228685;})[_0x524f('0x24')](respondWithFilteredResult(_0x510cb5,_0x50efcb))[_0x524f('0x46')](handleError(_0x510cb5,null));};exports['show']=function(_0x4775b8,_0x338e80){var _0x4f15c7={'raw':!![],'where':{'id':_0x4775b8[_0x524f('0x47')]['id']}},_0x4e690d={};_0x4e690d['model']=_[_0x524f('0x32')](db[_0x524f('0x2d')]['rawAttributes']);_0x4e690d[_0x524f('0x33')]=_[_0x524f('0x32')](_0x4775b8['query']);_0x4e690d['filters']=_[_0x524f('0x35')](_0x4e690d[_0x524f('0x31')],_0x4e690d[_0x524f('0x33')]);_0x4f15c7[_0x524f('0x36')]=_[_0x524f('0x35')](_0x4e690d['model'],qs[_0x524f('0x37')](_0x4775b8[_0x524f('0x33')]['fields']));_0x4f15c7['attributes']=_0x4f15c7[_0x524f('0x36')][_0x524f('0x38')]?_0x4f15c7[_0x524f('0x36')]:_0x4e690d[_0x524f('0x31')];if(_0x4775b8[_0x524f('0x33')][_0x524f('0x42')]){_0x4f15c7['include']=[{'all':!![]}];}_0x4f15c7=_['merge']({},_0x4f15c7,_0x4775b8[_0x524f('0x41')]);return db[_0x524f('0x2d')][_0x524f('0x48')](_0x4f15c7)[_0x524f('0x24')](handleEntityNotFound(_0x338e80,null))[_0x524f('0x24')](respondWithResult(_0x338e80,null))[_0x524f('0x46')](handleError(_0x338e80,null));};exports[_0x524f('0x49')]=function(_0x2942a4,_0x595910){return db['FaxApplication'][_0x524f('0x49')](_0x2942a4['body'],{})[_0x524f('0x24')](respondWithResult(_0x595910,0xc9))[_0x524f('0x46')](handleError(_0x595910,null));};exports['update']=function(_0x943431,_0x57d7cd){if(_0x943431[_0x524f('0x4a')]['id']){delete _0x943431['body']['id'];}return db[_0x524f('0x2d')][_0x524f('0x48')]({'where':{'id':_0x943431[_0x524f('0x47')]['id']}})[_0x524f('0x24')](handleEntityNotFound(_0x57d7cd,null))['then'](saveUpdates(_0x943431[_0x524f('0x4a')],null))[_0x524f('0x24')](respondWithResult(_0x57d7cd,null))[_0x524f('0x46')](handleError(_0x57d7cd,null));};exports[_0x524f('0x25')]=function(_0x10bc27,_0x5d7dd8){return db['FaxApplication'][_0x524f('0x48')]({'where':{'id':_0x10bc27[_0x524f('0x47')]['id']}})[_0x524f('0x24')](handleEntityNotFound(_0x5d7dd8,null))[_0x524f('0x24')](removeEntity(_0x5d7dd8,null))[_0x524f('0x46')](handleError(_0x5d7dd8,null));}; \ No newline at end of file +var _0x9dbc=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','name','send','index','map','FaxApplication','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0xd41286,_0x1251ce){var _0x3a771e=function(_0x832e01){while(--_0x832e01){_0xd41286['push'](_0xd41286['shift']());}};_0x3a771e(++_0x1251ce);}(_0x9dbc,0xe8));var _0xc9db=function(_0x3e0358,_0x11e9f4){_0x3e0358=_0x3e0358-0x0;var _0x1527d0=_0x9dbc[_0x3e0358];return _0x1527d0;};'use strict';var emlformat=require(_0xc9db('0x0'));var rimraf=require(_0xc9db('0x1'));var zipdir=require(_0xc9db('0x2'));var jsonpatch=require(_0xc9db('0x3'));var rp=require(_0xc9db('0x4'));var moment=require(_0xc9db('0x5'));var BPromise=require(_0xc9db('0x6'));var Mustache=require(_0xc9db('0x7'));var util=require('util');var path=require(_0xc9db('0x8'));var sox=require(_0xc9db('0x9'));var csv=require(_0xc9db('0xa'));var ejs=require(_0xc9db('0xb'));var fs=require('fs');var fs_extra=require(_0xc9db('0xc'));var _=require(_0xc9db('0xd'));var squel=require('squel');var crypto=require(_0xc9db('0xe'));var jsforce=require(_0xc9db('0xf'));var deskjs=require(_0xc9db('0x10'));var toCsv=require(_0xc9db('0xa'));var querystring=require('querystring');var Papa=require(_0xc9db('0x11'));var Redis=require('ioredis');var authService=require(_0xc9db('0x12'));var qs=require(_0xc9db('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9db('0x14'));var logger=require(_0xc9db('0x15'))('api');var utils=require(_0xc9db('0x16'));var config=require(_0xc9db('0x17'));var licenseUtil=require(_0xc9db('0x18'));var db=require(_0xc9db('0x19'))['db'];function respondWithStatusCode(_0x586d99,_0x389a47){_0x389a47=_0x389a47||0xcc;return function(_0x3d737d){if(_0x3d737d){return _0x586d99[_0xc9db('0x1a')](_0x389a47);}return _0x586d99[_0xc9db('0x1b')](_0x389a47)[_0xc9db('0x1c')]();};}function respondWithResult(_0x13c833,_0x49ad85){_0x49ad85=_0x49ad85||0xc8;return function(_0x2cd83e){if(_0x2cd83e){return _0x13c833['status'](_0x49ad85)[_0xc9db('0x1d')](_0x2cd83e);}};}function respondWithFilteredResult(_0x17f01e,_0x3bcd79){return function(_0x52954b){if(_0x52954b){var _0x1fc88c=typeof _0x3bcd79[_0xc9db('0x1e')]===_0xc9db('0x1f')&&typeof _0x3bcd79[_0xc9db('0x20')]===_0xc9db('0x1f');var _0x49b557=_0x52954b[_0xc9db('0x21')];var _0x3109b9=_0x1fc88c?0x0:_0x3bcd79[_0xc9db('0x1e')];var _0x360048=_0x1fc88c?_0x52954b[_0xc9db('0x21')]:_0x3bcd79[_0xc9db('0x1e')]+_0x3bcd79[_0xc9db('0x20')];var _0x1664df;if(_0x360048>=_0x49b557){_0x360048=_0x49b557;_0x1664df=0xc8;}else{_0x1664df=0xce;}_0x17f01e[_0xc9db('0x1b')](_0x1664df);return _0x17f01e['set'](_0xc9db('0x22'),_0x3109b9+'-'+_0x360048+'/'+_0x49b557)[_0xc9db('0x1d')](_0x52954b);}return null;};}function patchUpdates(_0x3390aa){return function(_0x383078){try{jsonpatch['apply'](_0x383078,_0x3390aa,!![]);}catch(_0x46f374){return BPromise[_0xc9db('0x23')](_0x46f374);}return _0x383078['save']();};}function saveUpdates(_0x1ca36b,_0x5b61bd){return function(_0x28a420){if(_0x28a420){return _0x28a420[_0xc9db('0x24')](_0x1ca36b)[_0xc9db('0x25')](function(_0x487b19){return _0x487b19;});}return null;};}function removeEntity(_0x525546,_0x561c47){return function(_0x5218d7){if(_0x5218d7){return _0x5218d7[_0xc9db('0x26')]()['then'](function(){_0x525546[_0xc9db('0x1b')](0xcc)[_0xc9db('0x1c')]();});}};}function handleEntityNotFound(_0x47d01f,_0x37373a){return function(_0x36b323){if(!_0x36b323){_0x47d01f['sendStatus'](0x194);}return _0x36b323;};}function handleError(_0x5a690d,_0x220083){_0x220083=_0x220083||0x1f4;return function(_0x2cc1e6){logger[_0xc9db('0x27')](_0x2cc1e6['stack']);if(_0x2cc1e6['name']){delete _0x2cc1e6[_0xc9db('0x28')];}_0x5a690d[_0xc9db('0x1b')](_0x220083)[_0xc9db('0x29')](_0x2cc1e6);};}exports[_0xc9db('0x2a')]=function(_0x237483,_0x5e2e7b){var _0x30e605={},_0x228c60={},_0x42e2f9={'count':0x0,'rows':[]};var _0x523484=_[_0xc9db('0x2b')](db[_0xc9db('0x2c')]['rawAttributes'],function(_0x1d0b7d){return{'name':_0x1d0b7d[_0xc9db('0x2d')],'type':_0x1d0b7d['type'][_0xc9db('0x2e')]};});_0x228c60[_0xc9db('0x2f')]=_[_0xc9db('0x2b')](_0x523484,'name');_0x228c60[_0xc9db('0x30')]=_[_0xc9db('0x31')](_0x237483['query']);_0x228c60[_0xc9db('0x32')]=_[_0xc9db('0x33')](_0x228c60['model'],_0x228c60[_0xc9db('0x30')]);_0x30e605[_0xc9db('0x34')]=_[_0xc9db('0x33')](_0x228c60[_0xc9db('0x2f')],qs[_0xc9db('0x35')](_0x237483['query']['fields']));_0x30e605['attributes']=_0x30e605['attributes'][_0xc9db('0x36')]?_0x30e605[_0xc9db('0x34')]:_0x228c60[_0xc9db('0x2f')];if(!_0x237483[_0xc9db('0x30')][_0xc9db('0x37')](_0xc9db('0x38'))){_0x30e605[_0xc9db('0x20')]=qs[_0xc9db('0x20')](_0x237483[_0xc9db('0x30')]['limit']);_0x30e605[_0xc9db('0x1e')]=qs['offset'](_0x237483[_0xc9db('0x30')][_0xc9db('0x1e')]);}_0x30e605[_0xc9db('0x39')]=qs[_0xc9db('0x3a')](_0x237483[_0xc9db('0x30')][_0xc9db('0x3a')]);_0x30e605[_0xc9db('0x3b')]=qs['filters'](_[_0xc9db('0x3c')](_0x237483[_0xc9db('0x30')],_0x228c60[_0xc9db('0x32')]),_0x523484);if(_0x237483['query']['filter']){_0x30e605[_0xc9db('0x3b')]=_[_0xc9db('0x3d')](_0x30e605[_0xc9db('0x3b')],{'$or':_[_0xc9db('0x2b')](_0x523484,function(_0x3891c0){if(_0x3891c0[_0xc9db('0x3e')]!==_0xc9db('0x3f')){var _0x40350f={};_0x40350f[_0x3891c0['name']]={'$like':'%'+_0x237483[_0xc9db('0x30')][_0xc9db('0x40')]+'%'};return _0x40350f;}})});}_0x30e605=_[_0xc9db('0x3d')]({},_0x30e605,_0x237483[_0xc9db('0x41')]);var _0x4ef303={'where':_0x30e605[_0xc9db('0x3b')]};return db['FaxApplication'][_0xc9db('0x21')](_0x4ef303)[_0xc9db('0x25')](function(_0x5c7fcc){_0x42e2f9[_0xc9db('0x21')]=_0x5c7fcc;if(_0x237483[_0xc9db('0x30')]['includeAll']){_0x30e605[_0xc9db('0x42')]=[{'all':!![]}];}return db[_0xc9db('0x2c')][_0xc9db('0x43')](_0x30e605);})[_0xc9db('0x25')](function(_0x366c26){_0x42e2f9[_0xc9db('0x44')]=_0x366c26;return _0x42e2f9;})[_0xc9db('0x25')](respondWithFilteredResult(_0x5e2e7b,_0x30e605))[_0xc9db('0x45')](handleError(_0x5e2e7b,null));};exports[_0xc9db('0x46')]=function(_0x53aa11,_0x36c5a3){var _0x59800e={'raw':!![],'where':{'id':_0x53aa11[_0xc9db('0x47')]['id']}},_0x3e12ef={};_0x3e12ef[_0xc9db('0x2f')]=_[_0xc9db('0x31')](db[_0xc9db('0x2c')][_0xc9db('0x48')]);_0x3e12ef[_0xc9db('0x30')]=_[_0xc9db('0x31')](_0x53aa11[_0xc9db('0x30')]);_0x3e12ef[_0xc9db('0x32')]=_[_0xc9db('0x33')](_0x3e12ef[_0xc9db('0x2f')],_0x3e12ef['query']);_0x59800e['attributes']=_[_0xc9db('0x33')](_0x3e12ef[_0xc9db('0x2f')],qs['fields'](_0x53aa11['query']['fields']));_0x59800e[_0xc9db('0x34')]=_0x59800e[_0xc9db('0x34')][_0xc9db('0x36')]?_0x59800e[_0xc9db('0x34')]:_0x3e12ef[_0xc9db('0x2f')];if(_0x53aa11['query'][_0xc9db('0x49')]){_0x59800e[_0xc9db('0x42')]=[{'all':!![]}];}_0x59800e=_['merge']({},_0x59800e,_0x53aa11[_0xc9db('0x41')]);return db[_0xc9db('0x2c')][_0xc9db('0x4a')](_0x59800e)[_0xc9db('0x25')](handleEntityNotFound(_0x36c5a3,null))['then'](respondWithResult(_0x36c5a3,null))[_0xc9db('0x45')](handleError(_0x36c5a3,null));};exports[_0xc9db('0x4b')]=function(_0x2da6cf,_0x132885){return db[_0xc9db('0x2c')]['create'](_0x2da6cf[_0xc9db('0x4c')],{})[_0xc9db('0x25')](respondWithResult(_0x132885,0xc9))[_0xc9db('0x45')](handleError(_0x132885,null));};exports[_0xc9db('0x24')]=function(_0x3f76bd,_0x473cef){if(_0x3f76bd[_0xc9db('0x4c')]['id']){delete _0x3f76bd[_0xc9db('0x4c')]['id'];}return db[_0xc9db('0x2c')][_0xc9db('0x4a')]({'where':{'id':_0x3f76bd[_0xc9db('0x47')]['id']}})[_0xc9db('0x25')](handleEntityNotFound(_0x473cef,null))[_0xc9db('0x25')](saveUpdates(_0x3f76bd[_0xc9db('0x4c')],null))['then'](respondWithResult(_0x473cef,null))['catch'](handleError(_0x473cef,null));};exports[_0xc9db('0x26')]=function(_0x3ca355,_0x5abcbc){return db[_0xc9db('0x2c')][_0xc9db('0x4a')]({'where':{'id':_0x3ca355[_0xc9db('0x47')]['id']}})[_0xc9db('0x25')](handleEntityNotFound(_0x5abcbc,null))[_0xc9db('0x25')](removeEntity(_0x5abcbc,null))[_0xc9db('0x45')](handleError(_0x5abcbc,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d5a0c12..38e250e 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 _0x8d98=['define','FaxApplication','fax_applications','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports'];(function(_0x1d888e,_0x14a772){var _0x5c66e2=function(_0x4fe8da){while(--_0x4fe8da){_0x1d888e['push'](_0x1d888e['shift']());}};_0x5c66e2(++_0x14a772);}(_0x8d98,0x117));var _0x88d9=function(_0x4be8a0,_0x4b3d38){_0x4be8a0=_0x4be8a0-0x0;var _0x1973ee=_0x8d98[_0x4be8a0];return _0x1973ee;};'use strict';var _=require(_0x88d9('0x0'));var util=require(_0x88d9('0x1'));var logger=require('../../config/logger')(_0x88d9('0x2'));var moment=require(_0x88d9('0x3'));var BPromise=require(_0x88d9('0x4'));var rp=require(_0x88d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x88d9('0x6'));var attributes=require(_0x88d9('0x7'));module[_0x88d9('0x8')]=function(_0x27ea5b,_0x3be558){return _0x27ea5b[_0x88d9('0x9')](_0x88d9('0xa'),attributes,{'tableName':_0x88d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x985a=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','./faxApplication.attributes','exports','FaxApplication','fax_applications'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x985a,0x183));var _0xa985=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x985a[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xa985('0x0'));var logger=require(_0xa985('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa985('0x2'));var fs=require('fs');var path=require(_0xa985('0x3'));var rimraf=require(_0xa985('0x4'));var config=require('../../config/environment');var attributes=require(_0xa985('0x5'));module[_0xa985('0x6')]=function(_0x353078,_0x3fdc04){return _0x353078['define'](_0xa985('0x7'),attributes,{'tableName':_0xa985('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa985('0x9'),'collate':_0xa985('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 73e2d3b..49a0311 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 _0x3ad5=['http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x44b115,_0x1a5b35){var _0x4e2797=function(_0x7a9dcf){while(--_0x7a9dcf){_0x44b115['push'](_0x44b115['shift']());}};_0x4e2797(++_0x1a5b35);}(_0x3ad5,0x151));var _0x53ad=function(_0x30fb67,_0x5363a6){_0x30fb67=_0x30fb67-0x0;var _0x384423=_0x3ad5[_0x30fb67];return _0x384423;};'use strict';var _=require(_0x53ad('0x0'));var util=require('util');var moment=require(_0x53ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ad('0x2'));var fs=require('fs');var Redis=require(_0x53ad('0x3'));var db=require(_0x53ad('0x4'))['db'];var utils=require(_0x53ad('0x5'));var logger=require(_0x53ad('0x6'))(_0x53ad('0x7'));var config=require(_0x53ad('0x8'));var jayson=require(_0x53ad('0x9'));var client=jayson[_0x53ad('0xa')][_0x53ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x326b5d,_0x1780dc,_0x522217){return new BPromise(function(_0x47b78d,_0x44e9dc){return client[_0x53ad('0xc')](_0x326b5d,_0x522217)[_0x53ad('0xd')](function(_0x15ce3b){logger[_0x53ad('0xe')](_0x53ad('0xf'),_0x1780dc,'request\x20sent');logger[_0x53ad('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1780dc,_0x53ad('0x11'),JSON[_0x53ad('0x12')](_0x15ce3b));if(_0x15ce3b['error']){if(_0x15ce3b['error'][_0x53ad('0x13')]===0x1f4){logger['error'](_0x53ad('0xf'),_0x1780dc,_0x15ce3b[_0x53ad('0x14')][_0x53ad('0x15')]);return _0x44e9dc(_0x15ce3b[_0x53ad('0x14')]['message']);}logger[_0x53ad('0x14')](_0x53ad('0xf'),_0x1780dc,_0x15ce3b['error'][_0x53ad('0x15')]);return _0x47b78d(_0x15ce3b[_0x53ad('0x14')]['message']);}else{logger[_0x53ad('0xe')](_0x53ad('0xf'),_0x1780dc,_0x53ad('0x11'));_0x47b78d(_0x15ce3b[_0x53ad('0x16')]['message']);}})[_0x53ad('0x17')](function(_0x4bdebc){logger[_0x53ad('0x14')](_0x53ad('0xf'),_0x1780dc,_0x4bdebc);_0x44e9dc(_0x4bdebc);});});}exports[_0x53ad('0x18')]=function(_0x497b48){var _0x4f45c9=this;return new Promise(function(_0x43bd47,_0x4d9bee){return db[_0x53ad('0x19')]['update'](_0x497b48['body'],{'raw':_0x497b48[_0x53ad('0x1a')]?_0x497b48[_0x53ad('0x1a')][_0x53ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x497b48[_0x53ad('0x1a')]?_0x497b48[_0x53ad('0x1a')][_0x53ad('0x1c')]||null:null,'attributes':_0x497b48['options']?_0x497b48[_0x53ad('0x1a')]['attributes']||null:null,'limit':_0x497b48['options']?_0x497b48[_0x53ad('0x1a')]['limit']||null:null})[_0x53ad('0xd')](function(_0x533a47){logger[_0x53ad('0xe')]('UpdateFaxApplication',_0x497b48);logger[_0x53ad('0x10')](_0x53ad('0x18'),_0x497b48,JSON['stringify'](_0x533a47));_0x43bd47(_0x533a47);})[_0x53ad('0x17')](function(_0x22b3e2){logger[_0x53ad('0x14')](_0x53ad('0x18'),_0x22b3e2[_0x53ad('0x15')],_0x497b48);_0x4d9bee(_0x4f45c9[_0x53ad('0x14')](0x1f4,_0x22b3e2[_0x53ad('0x15')]));});});}; \ No newline at end of file +var _0x0aae=['../../config/environment','client','http','request','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','body','options','where','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x470a5d,_0x230dfc){var _0x90f8b1=function(_0xf10630){while(--_0xf10630){_0x470a5d['push'](_0x470a5d['shift']());}};_0x90f8b1(++_0x230dfc);}(_0x0aae,0x119));var _0xe0aa=function(_0x1785ff,_0xce35a3){_0x1785ff=_0x1785ff-0x0;var _0x518fab=_0x0aae[_0x1785ff];return _0x518fab;};'use strict';var _=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var moment=require('moment');var BPromise=require(_0xe0aa('0x2'));var rs=require(_0xe0aa('0x3'));var fs=require('fs');var Redis=require(_0xe0aa('0x4'));var db=require(_0xe0aa('0x5'))['db'];var utils=require(_0xe0aa('0x6'));var logger=require(_0xe0aa('0x7'))(_0xe0aa('0x8'));var config=require(_0xe0aa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe0aa('0xa')][_0xe0aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c57b8,_0x14d1a2,_0x398b65){return new BPromise(function(_0x59e332,_0x22561a){return client[_0xe0aa('0xc')](_0x3c57b8,_0x398b65)['then'](function(_0x15c82b){logger[_0xe0aa('0xd')]('FaxApplication,\x20%s,\x20%s',_0x14d1a2,_0xe0aa('0xe'));logger[_0xe0aa('0xf')](_0xe0aa('0x10'),_0x14d1a2,_0xe0aa('0xe'),JSON['stringify'](_0x15c82b));if(_0x15c82b[_0xe0aa('0x11')]){if(_0x15c82b[_0xe0aa('0x11')]['code']===0x1f4){logger[_0xe0aa('0x11')]('FaxApplication,\x20%s,\x20%s',_0x14d1a2,_0x15c82b[_0xe0aa('0x11')][_0xe0aa('0x12')]);return _0x22561a(_0x15c82b[_0xe0aa('0x11')][_0xe0aa('0x12')]);}logger[_0xe0aa('0x11')](_0xe0aa('0x13'),_0x14d1a2,_0x15c82b[_0xe0aa('0x11')][_0xe0aa('0x12')]);return _0x59e332(_0x15c82b[_0xe0aa('0x11')][_0xe0aa('0x12')]);}else{logger['info'](_0xe0aa('0x13'),_0x14d1a2,'request\x20sent');_0x59e332(_0x15c82b[_0xe0aa('0x14')][_0xe0aa('0x12')]);}})[_0xe0aa('0x15')](function(_0x23758c){logger['error'](_0xe0aa('0x13'),_0x14d1a2,_0x23758c);_0x22561a(_0x23758c);});});}exports[_0xe0aa('0x16')]=function(_0x10e064){var _0x4ea5dd=this;return new Promise(function(_0x19fd57,_0x512449){return db[_0xe0aa('0x17')]['update'](_0x10e064[_0xe0aa('0x18')],{'raw':_0x10e064[_0xe0aa('0x19')]?_0x10e064['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10e064[_0xe0aa('0x19')]?_0x10e064['options'][_0xe0aa('0x1a')]||null:null,'attributes':_0x10e064[_0xe0aa('0x19')]?_0x10e064[_0xe0aa('0x19')]['attributes']||null:null,'limit':_0x10e064[_0xe0aa('0x19')]?_0x10e064['options']['limit']||null:null})[_0xe0aa('0x1b')](function(_0x3c8b18){logger[_0xe0aa('0xd')](_0xe0aa('0x16'),_0x10e064);logger[_0xe0aa('0xf')](_0xe0aa('0x16'),_0x10e064,JSON[_0xe0aa('0x1c')](_0x3c8b18));_0x19fd57(_0x3c8b18);})['catch'](function(_0x43a070){logger[_0xe0aa('0x11')](_0xe0aa('0x16'),_0x43a070[_0xe0aa('0x12')],_0x10e064);_0x512449(_0x4ea5dd[_0xe0aa('0x11')](0x1f4,_0x43a070['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1424545..2780ed7 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x5d010c,_0x468a09){var _0x320099=function(_0x4a0b46){while(--_0x4a0b46){_0x5d010c['push'](_0x5d010c['shift']());}};_0x320099(++_0x468a09);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file +var _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index aa2a804..35cfea6 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 _0xbc0d=['exports','BOOLEAN','STRING','ENUM','out','DATE','sequelize'];(function(_0x3fdbaf,_0x4044df){var _0x50389a=function(_0x5f216a){while(--_0x5f216a){_0x3fdbaf['push'](_0x3fdbaf['shift']());}};_0x50389a(++_0x4044df);}(_0xbc0d,0x15d));var _0xdbc0=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xbc0d[_0x3a07c1];return _0x2bbe15;};'use strict';var Sequelize=require(_0xdbc0('0x0'));module[_0xdbc0('0x1')]={'closed':{'type':Sequelize[_0xdbc0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdbc0('0x3')]},'note':{'type':Sequelize[_0xdbc0('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xdbc0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdbc0('0x4')]('in',_0xdbc0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdbc0('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xdbc0('0x4')]('in',_0xdbc0('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x75c3=['STRING','out','ENUM','sequelize','exports','DATE'];(function(_0x126121,_0x35e290){var _0x57d413=function(_0x54e83a){while(--_0x54e83a){_0x126121['push'](_0x126121['shift']());}};_0x57d413(++_0x35e290);}(_0x75c3,0x99));var _0x375c=function(_0x1a48e4,_0x26deff){_0x1a48e4=_0x1a48e4-0x0;var _0x2f062d=_0x75c3[_0x1a48e4];return _0x2f062d;};'use strict';var Sequelize=require(_0x375c('0x0'));module[_0x375c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x375c('0x2')]},'disposition':{'type':Sequelize[_0x375c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x375c('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x375c('0x2')]},'fax':{'type':Sequelize[_0x375c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x375c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x375c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x375c('0x5')]('in',_0x375c('0x4')),'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 f547634..09c612d 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 _0x0686=['end','json','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','destroy','describe','addMessage','ids','getMessages','findOne','FaxMessage','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','rows','addTags','Tag','findAll','color','emit','removeTags','download','unix','join','server','tmp','root','files','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','status'];(function(_0x14a65e,_0x5deaa8){var _0xdf1a9=function(_0x21eec4){while(--_0x21eec4){_0x14a65e['push'](_0x14a65e['shift']());}};_0xdf1a9(++_0x5deaa8);}(_0x0686,0x126));var _0x6068=function(_0x54def7,_0x4bf3ec){_0x54def7=_0x54def7-0x0;var _0x98fe2d=_0x0686[_0x54def7];return _0x98fe2d;};'use strict';var rimraf=require(_0x6068('0x0'));var zipdir=require(_0x6068('0x1'));var moment=require(_0x6068('0x2'));var BPromise=require('bluebird');var util=require(_0x6068('0x3'));var path=require(_0x6068('0x4'));var fs=require('fs');var _=require(_0x6068('0x5'));var Redis=require(_0x6068('0x6'));var interaction=require(_0x6068('0x7'));var qs=require(_0x6068('0x8'));var logger=require(_0x6068('0x9'))(_0x6068('0xa'));var config=require(_0x6068('0xb'));var db=require(_0x6068('0xc'))['db'];config['redis']=_[_0x6068('0xd')](config['redis'],{'host':_0x6068('0xe'),'port':0x18eb});var socket=require(_0x6068('0xf'))(new Redis(config[_0x6068('0x10')]));require(_0x6068('0x11'))[_0x6068('0x12')](socket);function respondWithStatusCode(_0x46d42a,_0x6a7af3){_0x6a7af3=_0x6a7af3||0xcc;return function(_0x9b6fa5){if(_0x9b6fa5){return _0x46d42a[_0x6068('0x13')](_0x6a7af3);}return _0x46d42a[_0x6068('0x14')](_0x6a7af3)[_0x6068('0x15')]();};}function respondWithResult(_0x562a9a,_0x3d02b6){_0x3d02b6=_0x3d02b6||0xc8;return function(_0x18d799){if(_0x18d799){return _0x562a9a[_0x6068('0x14')](_0x3d02b6)[_0x6068('0x16')](_0x18d799);}};}function respondWithFilteredResult(_0x4ea0c3,_0x3d41ba){return function(_0x512217){if(_0x512217){var _0x5e8dce=typeof _0x3d41ba[_0x6068('0x17')]===_0x6068('0x18')&&typeof _0x3d41ba[_0x6068('0x19')]==='undefined';var _0x5e28d9=_0x512217[_0x6068('0x1a')];var _0x253b2c=_0x5e8dce?0x0:_0x3d41ba['offset'];var _0x135d8c=_0x5e8dce?_0x512217[_0x6068('0x1a')]:_0x3d41ba['offset']+_0x3d41ba[_0x6068('0x19')];var _0xa8fd05;if(_0x135d8c>=_0x5e28d9){_0x135d8c=_0x5e28d9;_0xa8fd05=0xc8;}else{_0xa8fd05=0xce;}_0x4ea0c3[_0x6068('0x14')](_0xa8fd05);return _0x4ea0c3[_0x6068('0x1b')](_0x6068('0x1c'),_0x253b2c+'-'+_0x135d8c+'/'+_0x5e28d9)[_0x6068('0x16')](_0x512217);}return null;};}function saveUpdates(_0x499c1b){return function(_0xb21dde){if(_0xb21dde){return _0xb21dde['update'](_0x499c1b)[_0x6068('0x1d')](function(_0x13fb16){return _0x13fb16;});}return null;};}function removeEntity(_0x5617ed){return function(_0x2c224a){if(_0x2c224a){return _0x2c224a['destroy']()['then'](function(){_0x5617ed[_0x6068('0x14')](0xcc)[_0x6068('0x15')]();});}};}function handleEntityNotFound(_0x1a0eda){return function(_0x147fbb){if(!_0x147fbb){_0x1a0eda[_0x6068('0x13')](0x194);}return _0x147fbb;};}function handleError(_0x57a686,_0x16ca26){_0x16ca26=_0x16ca26||0x1f4;return function(_0x5babec){logger[_0x6068('0x1e')](_0x5babec[_0x6068('0x1f')]);if(_0x5babec[_0x6068('0x20')]){delete _0x5babec[_0x6068('0x20')];}_0x57a686[_0x6068('0x14')](_0x16ca26)[_0x6068('0x21')](_0x5babec);};}exports[_0x6068('0x22')]=function(_0x37f159,_0x2961de){var _0xcd86c3={};var _0xfb52b=_[_0x6068('0x23')](db[_0x6068('0x24')][_0x6068('0x25')],function(_0x34c05f){return{'name':_0x34c05f[_0x6068('0x26')],'type':_0x34c05f[_0x6068('0x27')]['key']};});_0xcd86c3=qs[_0x6068('0x28')](_0xfb52b,_0x37f159);return interaction['findAll']('fax',_0x37f159[_0x6068('0x29')],_0x37f159[_0x6068('0x2a')],_0xcd86c3,_0xfb52b)['then'](respondWithFilteredResult(_0x2961de,_0xcd86c3))[_0x6068('0x2b')](handleError(_0x2961de,null));};exports[_0x6068('0x2c')]=function(_0x2b52bb,_0x5f5c95){var _0x379eff={'raw':![],'where':{'id':_0x2b52bb[_0x6068('0x2d')]['id']}},_0x34980b={};_0x34980b[_0x6068('0x2e')]=_[_0x6068('0x2f')](db[_0x6068('0x24')][_0x6068('0x25')]);_0x34980b[_0x6068('0x29')]=_['keys'](_0x2b52bb[_0x6068('0x29')]);_0x34980b[_0x6068('0x30')]=_[_0x6068('0x31')](_0x34980b[_0x6068('0x2e')],_0x34980b['query']);_0x379eff[_0x6068('0x32')]=_[_0x6068('0x31')](_0x34980b['model'],qs[_0x6068('0x33')](_0x2b52bb[_0x6068('0x29')][_0x6068('0x33')]));_0x379eff[_0x6068('0x32')]=_0x379eff['attributes'][_0x6068('0x34')]?_0x379eff['attributes']:_0x34980b['model'];if(_0x2b52bb[_0x6068('0x29')][_0x6068('0x35')]){_0x379eff[_0x6068('0x36')]=[{'all':!![]}];}_0x379eff=_[_0x6068('0x37')]({},_0x379eff,_0x2b52bb[_0x6068('0x38')]);return db['FaxInteraction'][_0x6068('0x39')](_0x379eff)[_0x6068('0x1d')](handleEntityNotFound(_0x5f5c95,null))[_0x6068('0x1d')](respondWithResult(_0x5f5c95,null))['catch'](handleError(_0x5f5c95,null));};exports['create']=function(_0x2891a7,_0x2dea33){return db['FaxInteraction'][_0x6068('0x3a')](_0x2891a7[_0x6068('0x3b')],{})[_0x6068('0x1d')](respondWithResult(_0x2dea33,0xc9))[_0x6068('0x2b')](handleError(_0x2dea33,null));};exports[_0x6068('0x3c')]=function(_0x43d9fa,_0xe445c7){if(_0x43d9fa['body']['id']){delete _0x43d9fa[_0x6068('0x3b')]['id'];}return db['FaxInteraction'][_0x6068('0x39')]({'where':{'id':_0x43d9fa[_0x6068('0x2d')]['id']}})[_0x6068('0x1d')](handleEntityNotFound(_0xe445c7,null))[_0x6068('0x1d')](saveUpdates(_0x43d9fa['body'],null))[_0x6068('0x1d')](respondWithResult(_0xe445c7,null))[_0x6068('0x2b')](handleError(_0xe445c7,null));};exports[_0x6068('0x3d')]=function(_0x271f5b,_0x3a7dc2){return db[_0x6068('0x24')][_0x6068('0x39')]({'where':{'id':_0x271f5b[_0x6068('0x2d')]['id']}})[_0x6068('0x1d')](handleEntityNotFound(_0x3a7dc2,null))[_0x6068('0x1d')](removeEntity(_0x3a7dc2,null))[_0x6068('0x2b')](handleError(_0x3a7dc2,null));};exports['describe']=function(_0x238194,_0x2bc5d4){return db[_0x6068('0x24')][_0x6068('0x3e')]()[_0x6068('0x1d')](respondWithResult(_0x2bc5d4,null))[_0x6068('0x2b')](handleError(_0x2bc5d4,null));};exports[_0x6068('0x3f')]=function(_0x46fe6f,_0x95ce6a){return db['FaxMessage'][_0x6068('0x39')]({'where':{'id':_0x46fe6f[_0x6068('0x2d')]['id']}})[_0x6068('0x1d')](handleEntityNotFound(_0x95ce6a,null))[_0x6068('0x1d')](function(_0x21d08f){if(_0x21d08f){return _0x21d08f[_0x6068('0x3f')](_0x46fe6f['body']['ids'],_['omit'](_0x46fe6f[_0x6068('0x3b')],[_0x6068('0x40'),'id'])||{});}})[_0x6068('0x1d')](respondWithResult(_0x95ce6a,null))[_0x6068('0x2b')](handleError(_0x95ce6a,null));};exports[_0x6068('0x41')]=function(_0x3de789,_0x15aec7){var _0x2ef9b0={'raw':![],'where':{}};var _0x56fc21={};var _0x3e1831={'count':0x0,'rows':[]};return db[_0x6068('0x24')][_0x6068('0x42')]({'where':{'id':_0x3de789[_0x6068('0x2d')]['id']}})[_0x6068('0x1d')](handleEntityNotFound(_0x15aec7,null))['then'](function(_0x4f7122){if(_0x4f7122){_0x56fc21[_0x6068('0x2e')]=_['keys'](db[_0x6068('0x43')]['rawAttributes']);_0x56fc21[_0x6068('0x29')]=_[_0x6068('0x2f')](_0x3de789[_0x6068('0x29')]);_0x56fc21[_0x6068('0x30')]=_['intersection'](_0x56fc21['model'],_0x56fc21['query']);_0x2ef9b0[_0x6068('0x32')]=_[_0x6068('0x31')](_0x56fc21[_0x6068('0x2e')],qs[_0x6068('0x33')](_0x3de789[_0x6068('0x29')][_0x6068('0x33')]));_0x2ef9b0[_0x6068('0x32')]=_0x2ef9b0[_0x6068('0x32')][_0x6068('0x34')]?_0x2ef9b0['attributes']:_0x56fc21[_0x6068('0x2e')];if(!_0x3de789[_0x6068('0x29')][_0x6068('0x44')](_0x6068('0x45'))){_0x2ef9b0[_0x6068('0x19')]=qs[_0x6068('0x19')](_0x3de789[_0x6068('0x29')][_0x6068('0x19')]);_0x2ef9b0['offset']=qs[_0x6068('0x17')](_0x3de789[_0x6068('0x29')][_0x6068('0x17')]);}_0x2ef9b0[_0x6068('0x46')]=qs['sort'](_0x3de789[_0x6068('0x29')][_0x6068('0x47')]);_0x2ef9b0[_0x6068('0x48')]=qs[_0x6068('0x30')](_[_0x6068('0x49')](_0x3de789['query'],_0x56fc21[_0x6068('0x30')]));_0x2ef9b0[_0x6068('0x48')][_0x6068('0x4a')]=_0x4f7122['id'];if(_0x3de789[_0x6068('0x29')][_0x6068('0x4b')]){_0x2ef9b0[_0x6068('0x48')]=_[_0x6068('0x37')](_0x2ef9b0['where'],{'$or':_[_0x6068('0x23')](_0x2ef9b0[_0x6068('0x32')],function(_0x2d9cc0){var _0x3720a0={};_0x3720a0[_0x2d9cc0]={'$like':'%'+_0x3de789[_0x6068('0x29')]['filter']+'%'};return _0x3720a0;})});}if(_0x3de789[_0x6068('0x29')]['$gte']){var _0x60f55c=_0x3de789[_0x6068('0x29')][_0x6068('0x4c')]['split'](',');var _0x2f877b={};_0x2f877b[_0x60f55c[0x0]]={'$gte':moment(_0x60f55c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2ef9b0[_0x6068('0x48')]=_[_0x6068('0x37')](_0x2ef9b0['where'],_0x2f877b);}_0x2ef9b0=_[_0x6068('0x37')]({},_0x2ef9b0,_0x3de789[_0x6068('0x38')]);return db[_0x6068('0x43')]['count']({'where':_0x2ef9b0['where']})['then'](function(_0x4fc64e){_0x3e1831[_0x6068('0x1a')]=_0x4fc64e;if(_0x3de789[_0x6068('0x29')][_0x6068('0x35')]){_0x2ef9b0[_0x6068('0x36')]=[{'all':!![]}];}return db[_0x6068('0x43')]['findAll'](_0x2ef9b0);})['then'](function(_0x849642){_0x3e1831[_0x6068('0x4d')]=_0x849642;return _0x3e1831;});}})[_0x6068('0x1d')](respondWithFilteredResult(_0x15aec7,_0x2ef9b0))[_0x6068('0x2b')](handleError(_0x15aec7,null));};exports[_0x6068('0x4e')]=function(_0x347624,_0x1be669){return db[_0x6068('0x24')][_0x6068('0x39')]({'where':{'id':_0x347624[_0x6068('0x2d')]['id']}})[_0x6068('0x1d')](handleEntityNotFound(_0x1be669,null))[_0x6068('0x1d')](function(_0x3ed78a){if(_0x3ed78a){return _0x3ed78a['setTags'](_0x347624[_0x6068('0x3b')][_0x6068('0x40')],_['omit'](_0x347624[_0x6068('0x3b')],[_0x6068('0x40'),'id'])||{})['spread'](function(){return db[_0x6068('0x4f')][_0x6068('0x50')]({'attributes':['id',_0x6068('0x20'),_0x6068('0x51')],'where':{'id':_0x347624[_0x6068('0x3b')]['ids']}});})[_0x6068('0x1d')](function(_0x465fed){socket[_0x6068('0x52')]('faxInteractionTags:save',{'id':Number(_0x347624[_0x6068('0x2d')]['id']),'tags':_0x465fed||[]});return{'id':Number(_0x347624['params']['id']),'tags':_0x465fed||[]};});}})['then'](respondWithResult(_0x1be669,null))[_0x6068('0x2b')](handleError(_0x1be669,null));};exports[_0x6068('0x53')]=function(_0x76bfc9,_0x474646){return db[_0x6068('0x24')][_0x6068('0x39')]({'where':{'id':_0x76bfc9[_0x6068('0x2d')]['id']}})['then'](handleEntityNotFound(_0x474646,null))[_0x6068('0x1d')](function(_0x501c02){if(_0x501c02){return _0x501c02[_0x6068('0x53')](_0x76bfc9[_0x6068('0x29')][_0x6068('0x40')]);}})[_0x6068('0x1d')](respondWithStatusCode(_0x474646,null))['catch'](handleError(_0x474646,null));};exports[_0x6068('0x54')]=function(_0x54255a,_0x549732){var _0x3567af=moment()[_0x6068('0x55')]()['toString']();var _0x5bc5bb=path[_0x6068('0x56')](config['root'],_0x6068('0x57'),'files',_0x6068('0x58'));var _0x1d4dc7=path[_0x6068('0x56')](config[_0x6068('0x59')],_0x6068('0x57'),_0x6068('0x5a'),'attachments');var _0xf4159f=path[_0x6068('0x56')](_0x5bc5bb,_0x3567af);var _0x5a6d50=util['format'](_0x6068('0x5b'),_0x54255a[_0x6068('0x2d')]['id'],_0x3567af);var _0x5495a4=path[_0x6068('0x56')](_0x5bc5bb,_0x5a6d50);var _0x1273b2=[];_0x1273b2[_0x6068('0x5c')]({'model':db[_0x6068('0x5d')],'as':_0x6068('0x5d'),'raw':!![]});var _0x14bd56=[{'model':db[_0x6068('0x43')],'as':_0x6068('0x5e'),'attributes':['id',_0x6068('0x3b'),_0x6068('0x5f')],'include':_0x1273b2}];return db[_0x6068('0x24')][_0x6068('0x39')]({'where':{'id':_0x54255a[_0x6068('0x2d')]['id']},'include':_0x14bd56})['then'](handleEntityNotFound(_0x549732,null))[_0x6068('0x1d')](function(_0x2ed85b){if(_0x2ed85b&&_0x2ed85b['Messages']){var _0x391b9d=_0x2ed85b[_0x6068('0x60')]({'plain':!![]});fs[_0x6068('0x61')](_0xf4159f);for(var _0x828415=0x0;_0x828415<_0x391b9d['Messages'][_0x6068('0x34')];_0x828415++){var _0x50eab9=_0x391b9d[_0x6068('0x5e')][_0x828415][_0x6068('0x5d')];if(_0x50eab9){var _0x2a4cc6=path[_0x6068('0x56')](_0x1d4dc7,_0x50eab9[_0x6068('0x62')]);if(fs[_0x6068('0x63')](_0x2a4cc6)){fs['createReadStream'](_0x2a4cc6)[_0x6068('0x64')](fs['createWriteStream'](path['join'](_0xf4159f,_0x50eab9['basename'])));}}}return BPromise[_0x6068('0x65')]()['then'](function(){return new BPromise(function(_0x10833b,_0x59c8ed){zipdir(_0xf4159f,{'saveTo':_0x5495a4},function(_0x1fbfd9,_0x34df93){if(_0x1fbfd9)return _0x59c8ed(_0x1fbfd9);return _0x10833b(_0x34df93);});})[_0x6068('0x1d')](function(){return new BPromise(function(_0x5774a7,_0x3c2ff2){rimraf(_0xf4159f,function(_0x31ac43){if(_0x31ac43)_0x3c2ff2(_0x31ac43);return _0x5774a7();});});})[_0x6068('0x1d')](function(){return _0x549732[_0x6068('0x54')](_0x5495a4,_0x5a6d50,function(_0x3a37db){if(_0x3a37db){console[_0x6068('0x66')](_0x6068('0x67'),_0x3a37db);}else{fs[_0x6068('0x68')](_0x5495a4);}});});});}else{return _0x549732[_0x6068('0x13')](0xc8);}})[_0x6068('0x2b')](handleError(_0x549732,null));}; \ No newline at end of file +var _0x9fef=['Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','log','rimraf','bluebird','util','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','FaxInteraction','type','key','getOptions','fax','user','catch','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','options','create','body','params','find','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','toString','join','files','tmp','server','attachments','format','transcript-%d-%s.zip','push'];(function(_0x29b68f,_0x33106d){var _0x4e9de5=function(_0x5cf3af){while(--_0x5cf3af){_0x29b68f['push'](_0x29b68f['shift']());}};_0x4e9de5(++_0x33106d);}(_0x9fef,0x1ab));var _0xf9fe=function(_0x5cabac,_0x5ccb08){_0x5cabac=_0x5cabac-0x0;var _0x5f47b8=_0x9fef[_0x5cabac];return _0x5f47b8;};'use strict';var rimraf=require(_0xf9fe('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xf9fe('0x1'));var util=require(_0xf9fe('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xf9fe('0x3'));var Redis=require(_0xf9fe('0x4'));var interaction=require(_0xf9fe('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xf9fe('0x6'))(_0xf9fe('0x7'));var config=require(_0xf9fe('0x8'));var db=require(_0xf9fe('0x9'))['db'];config[_0xf9fe('0xa')]=_['defaults'](config[_0xf9fe('0xa')],{'host':_0xf9fe('0xb'),'port':0x18eb});var socket=require(_0xf9fe('0xc'))(new Redis(config[_0xf9fe('0xa')]));require(_0xf9fe('0xd'))[_0xf9fe('0xe')](socket);function respondWithStatusCode(_0x4763ae,_0x5c2849){_0x5c2849=_0x5c2849||0xcc;return function(_0xb6e408){if(_0xb6e408){return _0x4763ae[_0xf9fe('0xf')](_0x5c2849);}return _0x4763ae[_0xf9fe('0x10')](_0x5c2849)[_0xf9fe('0x11')]();};}function respondWithResult(_0x145ea2,_0x5db758){_0x5db758=_0x5db758||0xc8;return function(_0x47d3f1){if(_0x47d3f1){return _0x145ea2['status'](_0x5db758)[_0xf9fe('0x12')](_0x47d3f1);}};}function respondWithFilteredResult(_0xacb4cf,_0x3026a6){return function(_0x4c194e){if(_0x4c194e){var _0x149b55=typeof _0x3026a6[_0xf9fe('0x13')]===_0xf9fe('0x14')&&typeof _0x3026a6[_0xf9fe('0x15')]===_0xf9fe('0x14');var _0x4ca50a=_0x4c194e[_0xf9fe('0x16')];var _0x92e607=_0x149b55?0x0:_0x3026a6['offset'];var _0x4984ff=_0x149b55?_0x4c194e[_0xf9fe('0x16')]:_0x3026a6[_0xf9fe('0x13')]+_0x3026a6['limit'];var _0x237aa2;if(_0x4984ff>=_0x4ca50a){_0x4984ff=_0x4ca50a;_0x237aa2=0xc8;}else{_0x237aa2=0xce;}_0xacb4cf[_0xf9fe('0x10')](_0x237aa2);return _0xacb4cf['set'](_0xf9fe('0x17'),_0x92e607+'-'+_0x4984ff+'/'+_0x4ca50a)[_0xf9fe('0x12')](_0x4c194e);}return null;};}function saveUpdates(_0x338e84){return function(_0x5525b0){if(_0x5525b0){return _0x5525b0[_0xf9fe('0x18')](_0x338e84)[_0xf9fe('0x19')](function(_0x2fdd2b){return _0x2fdd2b;});}return null;};}function removeEntity(_0x15a7e0){return function(_0x48ba38){if(_0x48ba38){return _0x48ba38[_0xf9fe('0x1a')]()[_0xf9fe('0x19')](function(){_0x15a7e0[_0xf9fe('0x10')](0xcc)[_0xf9fe('0x11')]();});}};}function handleEntityNotFound(_0x53c7c4){return function(_0x3f010c){if(!_0x3f010c){_0x53c7c4['sendStatus'](0x194);}return _0x3f010c;};}function handleError(_0x327a9b,_0x55a9bb){_0x55a9bb=_0x55a9bb||0x1f4;return function(_0x31baf9){logger[_0xf9fe('0x1b')](_0x31baf9[_0xf9fe('0x1c')]);if(_0x31baf9[_0xf9fe('0x1d')]){delete _0x31baf9[_0xf9fe('0x1d')];}_0x327a9b['status'](_0x55a9bb)[_0xf9fe('0x1e')](_0x31baf9);};}exports[_0xf9fe('0x1f')]=function(_0x592174,_0x27aa13){var _0x42ccc0={};var _0x127eb7=_['map'](db[_0xf9fe('0x20')]['rawAttributes'],function(_0x35ab27){return{'name':_0x35ab27['fieldName'],'type':_0x35ab27[_0xf9fe('0x21')][_0xf9fe('0x22')]};});_0x42ccc0=qs[_0xf9fe('0x23')](_0x127eb7,_0x592174);return interaction['findAll'](_0xf9fe('0x24'),_0x592174['query'],_0x592174[_0xf9fe('0x25')],_0x42ccc0,_0x127eb7)['then'](respondWithFilteredResult(_0x27aa13,_0x42ccc0))[_0xf9fe('0x26')](handleError(_0x27aa13,null));};exports[_0xf9fe('0x27')]=function(_0xbaa8,_0x49204d){var _0xed14e7={'raw':![],'where':{'id':_0xbaa8['params']['id']}},_0x12466a={};_0x12466a[_0xf9fe('0x28')]=_[_0xf9fe('0x29')](db['FaxInteraction'][_0xf9fe('0x2a')]);_0x12466a[_0xf9fe('0x2b')]=_[_0xf9fe('0x29')](_0xbaa8[_0xf9fe('0x2b')]);_0x12466a[_0xf9fe('0x2c')]=_[_0xf9fe('0x2d')](_0x12466a[_0xf9fe('0x28')],_0x12466a[_0xf9fe('0x2b')]);_0xed14e7[_0xf9fe('0x2e')]=_[_0xf9fe('0x2d')](_0x12466a[_0xf9fe('0x28')],qs[_0xf9fe('0x2f')](_0xbaa8[_0xf9fe('0x2b')]['fields']));_0xed14e7[_0xf9fe('0x2e')]=_0xed14e7[_0xf9fe('0x2e')]['length']?_0xed14e7[_0xf9fe('0x2e')]:_0x12466a['model'];if(_0xbaa8[_0xf9fe('0x2b')][_0xf9fe('0x30')]){_0xed14e7['include']=[{'all':!![]}];}_0xed14e7=_[_0xf9fe('0x31')]({},_0xed14e7,_0xbaa8[_0xf9fe('0x32')]);return db[_0xf9fe('0x20')]['find'](_0xed14e7)['then'](handleEntityNotFound(_0x49204d,null))[_0xf9fe('0x19')](respondWithResult(_0x49204d,null))[_0xf9fe('0x26')](handleError(_0x49204d,null));};exports[_0xf9fe('0x33')]=function(_0x48beb5,_0x257ea9){return db[_0xf9fe('0x20')][_0xf9fe('0x33')](_0x48beb5['body'],{})['then'](respondWithResult(_0x257ea9,0xc9))[_0xf9fe('0x26')](handleError(_0x257ea9,null));};exports[_0xf9fe('0x18')]=function(_0x4e3014,_0x11861e){if(_0x4e3014['body']['id']){delete _0x4e3014[_0xf9fe('0x34')]['id'];}return db[_0xf9fe('0x20')]['find']({'where':{'id':_0x4e3014[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0x11861e,null))[_0xf9fe('0x19')](saveUpdates(_0x4e3014[_0xf9fe('0x34')],null))[_0xf9fe('0x19')](respondWithResult(_0x11861e,null))['catch'](handleError(_0x11861e,null));};exports['destroy']=function(_0x84ccdb,_0x1fec45){return db[_0xf9fe('0x20')][_0xf9fe('0x36')]({'where':{'id':_0x84ccdb[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0x1fec45,null))['then'](removeEntity(_0x1fec45,null))['catch'](handleError(_0x1fec45,null));};exports[_0xf9fe('0x37')]=function(_0x57333f,_0x369158){return db[_0xf9fe('0x20')]['describe']()[_0xf9fe('0x19')](respondWithResult(_0x369158,null))[_0xf9fe('0x26')](handleError(_0x369158,null));};exports[_0xf9fe('0x38')]=function(_0x28792c,_0x3f3bbe){return db[_0xf9fe('0x39')][_0xf9fe('0x36')]({'where':{'id':_0x28792c[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0x3f3bbe,null))['then'](function(_0x1fba1d){if(_0x1fba1d){return _0x1fba1d[_0xf9fe('0x38')](_0x28792c['body'][_0xf9fe('0x3a')],_[_0xf9fe('0x3b')](_0x28792c[_0xf9fe('0x34')],[_0xf9fe('0x3a'),'id'])||{});}})[_0xf9fe('0x19')](respondWithResult(_0x3f3bbe,null))[_0xf9fe('0x26')](handleError(_0x3f3bbe,null));};exports[_0xf9fe('0x3c')]=function(_0x16cfc7,_0x197f38){var _0x1d185d={'raw':![],'where':{}};var _0x7ce9ac={};var _0x3a0c0f={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xf9fe('0x3d')]({'where':{'id':_0x16cfc7[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0x197f38,null))['then'](function(_0x1f663e){if(_0x1f663e){_0x7ce9ac[_0xf9fe('0x28')]=_[_0xf9fe('0x29')](db[_0xf9fe('0x39')][_0xf9fe('0x2a')]);_0x7ce9ac[_0xf9fe('0x2b')]=_[_0xf9fe('0x29')](_0x16cfc7['query']);_0x7ce9ac[_0xf9fe('0x2c')]=_[_0xf9fe('0x2d')](_0x7ce9ac[_0xf9fe('0x28')],_0x7ce9ac[_0xf9fe('0x2b')]);_0x1d185d[_0xf9fe('0x2e')]=_[_0xf9fe('0x2d')](_0x7ce9ac[_0xf9fe('0x28')],qs[_0xf9fe('0x2f')](_0x16cfc7[_0xf9fe('0x2b')][_0xf9fe('0x2f')]));_0x1d185d['attributes']=_0x1d185d[_0xf9fe('0x2e')][_0xf9fe('0x3e')]?_0x1d185d[_0xf9fe('0x2e')]:_0x7ce9ac[_0xf9fe('0x28')];if(!_0x16cfc7[_0xf9fe('0x2b')][_0xf9fe('0x3f')](_0xf9fe('0x40'))){_0x1d185d[_0xf9fe('0x15')]=qs[_0xf9fe('0x15')](_0x16cfc7[_0xf9fe('0x2b')][_0xf9fe('0x15')]);_0x1d185d[_0xf9fe('0x13')]=qs[_0xf9fe('0x13')](_0x16cfc7['query']['offset']);}_0x1d185d['order']=qs[_0xf9fe('0x41')](_0x16cfc7['query'][_0xf9fe('0x41')]);_0x1d185d[_0xf9fe('0x42')]=qs[_0xf9fe('0x2c')](_[_0xf9fe('0x43')](_0x16cfc7['query'],_0x7ce9ac[_0xf9fe('0x2c')]));_0x1d185d[_0xf9fe('0x42')][_0xf9fe('0x44')]=_0x1f663e['id'];if(_0x16cfc7[_0xf9fe('0x2b')]['filter']){_0x1d185d[_0xf9fe('0x42')]=_[_0xf9fe('0x31')](_0x1d185d[_0xf9fe('0x42')],{'$or':_[_0xf9fe('0x45')](_0x1d185d[_0xf9fe('0x2e')],function(_0x1d1431){var _0x5644f2={};_0x5644f2[_0x1d1431]={'$like':'%'+_0x16cfc7[_0xf9fe('0x2b')]['filter']+'%'};return _0x5644f2;})});}if(_0x16cfc7[_0xf9fe('0x2b')][_0xf9fe('0x46')]){var _0x21059c=_0x16cfc7[_0xf9fe('0x2b')]['$gte'][_0xf9fe('0x47')](',');var _0x56e655={};_0x56e655[_0x21059c[0x0]]={'$gte':moment(_0x21059c[0x1])['format'](_0xf9fe('0x48'))};_0x1d185d['where']=_['merge'](_0x1d185d['where'],_0x56e655);}_0x1d185d=_[_0xf9fe('0x31')]({},_0x1d185d,_0x16cfc7['options']);return db[_0xf9fe('0x39')][_0xf9fe('0x16')]({'where':_0x1d185d['where']})[_0xf9fe('0x19')](function(_0x4a5c4f){_0x3a0c0f[_0xf9fe('0x16')]=_0x4a5c4f;if(_0x16cfc7['query'][_0xf9fe('0x30')]){_0x1d185d[_0xf9fe('0x49')]=[{'all':!![]}];}return db[_0xf9fe('0x39')][_0xf9fe('0x4a')](_0x1d185d);})[_0xf9fe('0x19')](function(_0x93c86f){_0x3a0c0f['rows']=_0x93c86f;return _0x3a0c0f;});}})[_0xf9fe('0x19')](respondWithFilteredResult(_0x197f38,_0x1d185d))['catch'](handleError(_0x197f38,null));};exports[_0xf9fe('0x4b')]=function(_0x3529f8,_0xd70a44){return db[_0xf9fe('0x20')][_0xf9fe('0x36')]({'where':{'id':_0x3529f8[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0xd70a44,null))[_0xf9fe('0x19')](function(_0x4eb473){if(_0x4eb473){return _0x4eb473[_0xf9fe('0x4c')](_0x3529f8[_0xf9fe('0x34')][_0xf9fe('0x3a')],_[_0xf9fe('0x3b')](_0x3529f8[_0xf9fe('0x34')],[_0xf9fe('0x3a'),'id'])||{})[_0xf9fe('0x4d')](function(){return db[_0xf9fe('0x4e')]['findAll']({'attributes':['id',_0xf9fe('0x1d'),_0xf9fe('0x4f')],'where':{'id':_0x3529f8[_0xf9fe('0x34')][_0xf9fe('0x3a')]}});})['then'](function(_0x4ec1f4){socket[_0xf9fe('0x50')](_0xf9fe('0x51'),{'id':Number(_0x3529f8['params']['id']),'tags':_0x4ec1f4||[]});return{'id':Number(_0x3529f8[_0xf9fe('0x35')]['id']),'tags':_0x4ec1f4||[]};});}})['then'](respondWithResult(_0xd70a44,null))[_0xf9fe('0x26')](handleError(_0xd70a44,null));};exports[_0xf9fe('0x52')]=function(_0x33bfda,_0x28aec1){return db[_0xf9fe('0x20')][_0xf9fe('0x36')]({'where':{'id':_0x33bfda[_0xf9fe('0x35')]['id']}})[_0xf9fe('0x19')](handleEntityNotFound(_0x28aec1,null))[_0xf9fe('0x19')](function(_0x370a47){if(_0x370a47){return _0x370a47['removeTags'](_0x33bfda[_0xf9fe('0x2b')][_0xf9fe('0x3a')]);}})['then'](respondWithStatusCode(_0x28aec1,null))[_0xf9fe('0x26')](handleError(_0x28aec1,null));};exports['download']=function(_0x1c3358,_0x2fa2b9){var _0x50af6d=moment()[_0xf9fe('0x53')]()[_0xf9fe('0x54')]();var _0x4349fb=path[_0xf9fe('0x55')](config['root'],'server',_0xf9fe('0x56'),_0xf9fe('0x57'));var _0x4cb6fe=path[_0xf9fe('0x55')](config['root'],_0xf9fe('0x58'),_0xf9fe('0x56'),_0xf9fe('0x59'));var _0x53e93f=path[_0xf9fe('0x55')](_0x4349fb,_0x50af6d);var _0x1895e9=util[_0xf9fe('0x5a')](_0xf9fe('0x5b'),_0x1c3358[_0xf9fe('0x35')]['id'],_0x50af6d);var _0x592040=path[_0xf9fe('0x55')](_0x4349fb,_0x1895e9);var _0x3be7bd=[];_0x3be7bd[_0xf9fe('0x5c')]({'model':db[_0xf9fe('0x5d')],'as':_0xf9fe('0x5d'),'raw':!![]});var _0x2114fb=[{'model':db[_0xf9fe('0x39')],'as':_0xf9fe('0x5e'),'attributes':['id','body',_0xf9fe('0x5f')],'include':_0x3be7bd}];return db[_0xf9fe('0x20')][_0xf9fe('0x36')]({'where':{'id':_0x1c3358[_0xf9fe('0x35')]['id']},'include':_0x2114fb})['then'](handleEntityNotFound(_0x2fa2b9,null))[_0xf9fe('0x19')](function(_0x42ce8a){if(_0x42ce8a&&_0x42ce8a[_0xf9fe('0x5e')]){var _0x4963b5=_0x42ce8a[_0xf9fe('0x60')]({'plain':!![]});fs[_0xf9fe('0x61')](_0x53e93f);for(var _0x1f3461=0x0;_0x1f3461<_0x4963b5[_0xf9fe('0x5e')][_0xf9fe('0x3e')];_0x1f3461++){var _0x281f4f=_0x4963b5[_0xf9fe('0x5e')][_0x1f3461][_0xf9fe('0x5d')];if(_0x281f4f){var _0x4377a5=path[_0xf9fe('0x55')](_0x4cb6fe,_0x281f4f[_0xf9fe('0x62')]);if(fs[_0xf9fe('0x63')](_0x4377a5)){fs[_0xf9fe('0x64')](_0x4377a5)['pipe'](fs[_0xf9fe('0x65')](path['join'](_0x53e93f,_0x281f4f[_0xf9fe('0x62')])));}}}return BPromise[_0xf9fe('0x66')]()[_0xf9fe('0x19')](function(){return new BPromise(function(_0x3fd4a4,_0x4afa23){zipdir(_0x53e93f,{'saveTo':_0x592040},function(_0x1c3065,_0x16221e){if(_0x1c3065)return _0x4afa23(_0x1c3065);return _0x3fd4a4(_0x16221e);});})[_0xf9fe('0x19')](function(){return new BPromise(function(_0x1b5f47,_0x448ae4){rimraf(_0x53e93f,function(_0x30993e){if(_0x30993e)_0x448ae4(_0x30993e);return _0x1b5f47();});});})['then'](function(){return _0x2fa2b9['download'](_0x592040,_0x1895e9,function(_0x42fa65){if(_0x42fa65){console[_0xf9fe('0x67')]('err',_0x42fa65);}else{fs['unlinkSync'](_0x592040);}});});});}else{return _0x2fa2b9[_0xf9fe('0xf')](0xc8);}})[_0xf9fe('0x26')](handleError(_0x2fa2b9,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 832b0fb..f97f58c 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 _0x9628=['remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x9628,0x197));var _0x8962=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x9628[_0x50007c];return _0x5c1ec7;};'use strict';var EventEmitter=require(_0x8962('0x0'));var FaxInteraction=require(_0x8962('0x1'))['db'][_0x8962('0x2')];var FaxMessage=require(_0x8962('0x1'))['db'][_0x8962('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8962('0x4')](0x0);var events={'afterCreate':_0x8962('0x5'),'afterUpdate':_0x8962('0x6'),'afterDestroy':_0x8962('0x7')};function emitEvent(_0x5aa54b){return function(_0x14e490,_0x25c4df,_0x52c24c){_0x14e490['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x12baba){_0x14e490[_0x8962('0x8')](_0x8962('0x9'),_0x12baba[_0x8962('0xa')](function(_0x2e60b0){return{'id':_0x2e60b0['id']};}));return FaxMessage[_0x8962('0xb')]({'where':{'FaxInteractionId':_0x14e490['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8962('0xc')](function(_0x2306a3){_0x14e490[_0x8962('0x8')](_0x8962('0xd'),_0x2306a3[_0x8962('0xe')]);FaxInteractionEvents[_0x8962('0xf')](_0x5aa54b+':'+_0x14e490['id'],_0x14e490);FaxInteractionEvents[_0x8962('0xf')](_0x5aa54b,_0x14e490);_0x52c24c(null);})['catch'](_0x52c24c(null));};}for(var e in events){if(events[_0x8962('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x8962('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0xd902=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0xd902,0x103));var _0x2d90=function(_0x3ab0f1,_0x31acba){_0x3ab0f1=_0x3ab0f1-0x0;var _0x2c2fb8=_0xd902[_0x3ab0f1];return _0x2c2fb8;};'use strict';var EventEmitter=require(_0x2d90('0x0'));var FaxInteraction=require(_0x2d90('0x1'))['db'][_0x2d90('0x2')];var FaxMessage=require(_0x2d90('0x1'))['db'][_0x2d90('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2d90('0x4')](0x0);var events={'afterCreate':_0x2d90('0x5'),'afterUpdate':_0x2d90('0x6'),'afterDestroy':_0x2d90('0x7')};function emitEvent(_0x4111da){return function(_0x501bdd,_0x2742e9,_0xa4ca57){_0x501bdd[_0x2d90('0x8')]({'attributes':['id'],'raw':!![]})[_0x2d90('0x9')](function(_0xa20c71){_0x501bdd[_0x2d90('0xa')](_0x2d90('0xb'),_0xa20c71[_0x2d90('0xc')](function(_0x550c95){return{'id':_0x550c95['id']};}));return FaxMessage[_0x2d90('0xd')]({'where':{'FaxInteractionId':_0x501bdd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2d90('0x9')](function(_0x3c9bd6){_0x501bdd[_0x2d90('0xa')](_0x2d90('0xe'),_0x3c9bd6['length']);FaxInteractionEvents[_0x2d90('0xf')](_0x4111da+':'+_0x501bdd['id'],_0x501bdd);FaxInteractionEvents[_0x2d90('0xf')](_0x4111da,_0x501bdd);_0xa4ca57(null);})[_0x2d90('0x10')](_0xa4ca57(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x2d90('0x11')](e,emitEvent(event));}}module[_0x2d90('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 84becbb..133fa64 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 _0x42db=['rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird'];(function(_0x25110a,_0x3b3852){var _0xe42822=function(_0x283a82){while(--_0x283a82){_0x25110a['push'](_0x25110a['shift']());}};_0xe42822(++_0x3b3852);}(_0x42db,0x65));var _0xb42d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x42db[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb42d('0x0'))(_0xb42d('0x1'));var moment=require(_0xb42d('0x2'));var BPromise=require(_0xb42d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb42d('0x4'));var config=require(_0xb42d('0x5'));var attributes=require(_0xb42d('0x6'));module[_0xb42d('0x7')]=function(_0x1b9ccd,_0x4f3478){return _0x1b9ccd[_0xb42d('0x8')](_0xb42d('0x9'),attributes,{'tableName':_0xb42d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3661e5,_0x5bbc0f,_0x34b9a9){if(_0x3661e5[_0xb42d('0xb')]('closed')){_0x3661e5[_0xb42d('0xc')]=moment()[_0xb42d('0xd')](_0xb42d('0xe'));}_0x34b9a9(null,_0x3661e5);}}});}; \ No newline at end of file +var _0x252e=['moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x12551a,_0x5af080){var _0x6f8fc0=function(_0xe92756){while(--_0xe92756){_0x12551a['push'](_0x12551a['shift']());}};_0x6f8fc0(++_0x5af080);}(_0x252e,0x74));var _0xe252=function(_0x4011bf,_0x5ad0fa){_0x4011bf=_0x4011bf-0x0;var _0x50435a=_0x252e[_0x4011bf];return _0x50435a;};'use strict';var _=require('lodash');var util=require(_0xe252('0x0'));var logger=require(_0xe252('0x1'))(_0xe252('0x2'));var moment=require(_0xe252('0x3'));var BPromise=require('bluebird');var rp=require(_0xe252('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe252('0x5'));var config=require(_0xe252('0x6'));var attributes=require(_0xe252('0x7'));module[_0xe252('0x8')]=function(_0x4cf61c,_0x16900b){return _0x4cf61c[_0xe252('0x9')](_0xe252('0xa'),attributes,{'tableName':_0xe252('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x453f0e,_0x5a710c,_0x1ecbfa){if(_0x453f0e[_0xe252('0xc')](_0xe252('0xd'))){_0x453f0e[_0xe252('0xe')]=moment()[_0xe252('0xf')](_0xe252('0x10'));}_0x1ecbfa(null,_0x453f0e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index f38d6f6..13df573 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 _0x96f2=['then','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','debug','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x34ccfa,_0x24e4ae){var _0x3f2f55=function(_0x2d1e65){while(--_0x2d1e65){_0x34ccfa['push'](_0x34ccfa['shift']());}};_0x3f2f55(++_0x24e4ae);}(_0x96f2,0x16a));var _0x296f=function(_0x3f28a4,_0x1ef9d0){_0x3f28a4=_0x3f28a4-0x0;var _0x359233=_0x96f2[_0x3f28a4];return _0x359233;};'use strict';var _=require(_0x296f('0x0'));var util=require(_0x296f('0x1'));var moment=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))(_0x296f('0x7'));var config=require('../../config/environment');var jayson=require(_0x296f('0x8'));var client=jayson['client'][_0x296f('0x9')]({'port':0x232a});config['redis']=_[_0x296f('0xa')](config[_0x296f('0xb')],{'host':_0x296f('0xc'),'port':0x18eb});var socket=require(_0x296f('0xd'))(new Redis(config[_0x296f('0xb')]));require(_0x296f('0xe'))[_0x296f('0xf')](socket);function respondWithRpcPromise(_0x165694,_0x4a7342,_0x2af78b){return new BPromise(function(_0x504b91,_0x3b8621){return client['request'](_0x165694,_0x2af78b)[_0x296f('0x10')](function(_0x56080d){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4a7342,_0x296f('0x11'));logger['debug'](_0x296f('0x12'),_0x4a7342,_0x296f('0x11'),JSON[_0x296f('0x13')](_0x56080d));if(_0x56080d['error']){if(_0x56080d[_0x296f('0x14')][_0x296f('0x15')]===0x1f4){logger[_0x296f('0x14')](_0x296f('0x16'),_0x4a7342,_0x56080d[_0x296f('0x14')][_0x296f('0x17')]);return _0x3b8621(_0x56080d[_0x296f('0x14')]['message']);}logger[_0x296f('0x14')](_0x296f('0x16'),_0x4a7342,_0x56080d[_0x296f('0x14')][_0x296f('0x17')]);return _0x504b91(_0x56080d[_0x296f('0x14')][_0x296f('0x17')]);}else{logger[_0x296f('0x18')](_0x296f('0x16'),_0x4a7342,'request\x20sent');_0x504b91(_0x56080d[_0x296f('0x19')]['message']);}})[_0x296f('0x1a')](function(_0x2e5f8c){logger[_0x296f('0x14')](_0x296f('0x16'),_0x4a7342,_0x2e5f8c);_0x3b8621(_0x2e5f8c);});});}exports[_0x296f('0x1b')]=function(_0x2ac205){var _0x4077fd=this;return new Promise(function(_0x2237d9,_0x5ab875){return db[_0x296f('0x1c')][_0x296f('0x1d')](_0x2ac205[_0x296f('0x1e')],{'raw':_0x2ac205[_0x296f('0x1f')]?_0x2ac205[_0x296f('0x1f')][_0x296f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ac205[_0x296f('0x1f')]?_0x2ac205['options'][_0x296f('0x21')]||null:null,'attributes':_0x2ac205[_0x296f('0x1f')]?_0x2ac205['options'][_0x296f('0x22')]||null:null,'limit':_0x2ac205[_0x296f('0x1f')]?_0x2ac205[_0x296f('0x1f')]['limit']||null:null})[_0x296f('0x10')](function(_0x3b8073){logger['info'](_0x296f('0x1b'),_0x2ac205);logger[_0x296f('0x23')](_0x296f('0x1b'),_0x2ac205,JSON['stringify'](_0x3b8073));_0x2237d9(_0x3b8073);})[_0x296f('0x1a')](function(_0x4396b3){logger['error']('UpdateFaxInteraction',_0x4396b3[_0x296f('0x17')],_0x2ac205);_0x5ab875(_0x4077fd[_0x296f('0x14')](0x1f4,_0x4396b3[_0x296f('0x17')]));});});};exports[_0x296f('0x24')]=function(_0x4ff89c){return new Promise(function(_0x366cc0,_0x2776a6){return db[_0x296f('0x1c')][_0x296f('0x25')]({'where':_0x4ff89c[_0x296f('0x1f')]?_0x4ff89c[_0x296f('0x1f')][_0x296f('0x21')]||null:null})[_0x296f('0x10')](function(_0x5211d8){if(_0x5211d8){return _0x5211d8[_0x296f('0x26')](_0x4ff89c[_0x296f('0x1e')][_0x296f('0x27')],_[_0x296f('0x28')](_0x4ff89c[_0x296f('0x1e')],[_0x296f('0x27'),'id'])||{});}})['spread'](function(_0x40d9c2){logger[_0x296f('0x18')](_0x296f('0x29'),_0x4ff89c);logger[_0x296f('0x23')](_0x296f('0x29'),_0x4ff89c,JSON['stringify'](_0x40d9c2));_0x366cc0(_0x40d9c2);})[_0x296f('0x1a')](function(_0x1bd306){logger[_0x296f('0x14')](_0x296f('0x29'),_0x1bd306['message'],_0x4ff89c);_0x2776a6(_this[_0x296f('0x14')](0x1f4,_0x1bd306[_0x296f('0x17')]));});});}; \ No newline at end of file +var _0xd9ee=['http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','update','body','options','raw','attributes','limit','then','debug','stringify','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xd9ee,0x138));var _0xed9e=function(_0x1a226a,_0x5c1ef0){_0x1a226a=_0x1a226a-0x0;var _0x540a6f=_0xd9ee[_0x1a226a];return _0x540a6f;};'use strict';var _=require(_0xed9e('0x0'));var util=require(_0xed9e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed9e('0x2'));var fs=require('fs');var Redis=require(_0xed9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed9e('0x4'));var config=require(_0xed9e('0x5'));var jayson=require(_0xed9e('0x6'));var client=jayson[_0xed9e('0x7')][_0xed9e('0x8')]({'port':0x232a});config[_0xed9e('0x9')]=_['defaults'](config[_0xed9e('0x9')],{'host':_0xed9e('0xa'),'port':0x18eb});var socket=require(_0xed9e('0xb'))(new Redis(config[_0xed9e('0x9')]));require(_0xed9e('0xc'))[_0xed9e('0xd')](socket);function respondWithRpcPromise(_0x11a813,_0x5d59e1,_0x36206b){return new BPromise(function(_0x31b096,_0x8eed36){return client[_0xed9e('0xe')](_0x11a813,_0x36206b)['then'](function(_0x1a2470){logger[_0xed9e('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x5d59e1,_0xed9e('0x10'));logger['debug'](_0xed9e('0x11'),_0x5d59e1,_0xed9e('0x10'),JSON['stringify'](_0x1a2470));if(_0x1a2470[_0xed9e('0x12')]){if(_0x1a2470[_0xed9e('0x12')]['code']===0x1f4){logger[_0xed9e('0x12')](_0xed9e('0x13'),_0x5d59e1,_0x1a2470[_0xed9e('0x12')][_0xed9e('0x14')]);return _0x8eed36(_0x1a2470[_0xed9e('0x12')][_0xed9e('0x14')]);}logger[_0xed9e('0x12')](_0xed9e('0x13'),_0x5d59e1,_0x1a2470[_0xed9e('0x12')]['message']);return _0x31b096(_0x1a2470[_0xed9e('0x12')][_0xed9e('0x14')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5d59e1,_0xed9e('0x10'));_0x31b096(_0x1a2470[_0xed9e('0x15')]['message']);}})['catch'](function(_0x3e5433){logger[_0xed9e('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x5d59e1,_0x3e5433);_0x8eed36(_0x3e5433);});});}exports[_0xed9e('0x16')]=function(_0x2f64b9){var _0x51fe3e=this;return new Promise(function(_0x1b1616,_0x221a67){return db['FaxInteraction'][_0xed9e('0x17')](_0x2f64b9[_0xed9e('0x18')],{'raw':_0x2f64b9['options']?_0x2f64b9[_0xed9e('0x19')][_0xed9e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f64b9[_0xed9e('0x19')]?_0x2f64b9['options']['where']||null:null,'attributes':_0x2f64b9[_0xed9e('0x19')]?_0x2f64b9['options'][_0xed9e('0x1b')]||null:null,'limit':_0x2f64b9[_0xed9e('0x19')]?_0x2f64b9[_0xed9e('0x19')][_0xed9e('0x1c')]||null:null})[_0xed9e('0x1d')](function(_0x3fbf14){logger[_0xed9e('0xf')]('UpdateFaxInteraction',_0x2f64b9);logger[_0xed9e('0x1e')](_0xed9e('0x16'),_0x2f64b9,JSON[_0xed9e('0x1f')](_0x3fbf14));_0x1b1616(_0x3fbf14);})['catch'](function(_0x2d8a06){logger['error'](_0xed9e('0x16'),_0x2d8a06[_0xed9e('0x14')],_0x2f64b9);_0x221a67(_0x51fe3e[_0xed9e('0x12')](0x1f4,_0x2d8a06[_0xed9e('0x14')]));});});};exports[_0xed9e('0x20')]=function(_0x55d35a){return new Promise(function(_0x4ca4af,_0x2d5c74){return db[_0xed9e('0x21')][_0xed9e('0x22')]({'where':_0x55d35a[_0xed9e('0x19')]?_0x55d35a[_0xed9e('0x19')][_0xed9e('0x23')]||null:null})[_0xed9e('0x1d')](function(_0x1a9df5){if(_0x1a9df5){return _0x1a9df5[_0xed9e('0x24')](_0x55d35a['body'][_0xed9e('0x25')],_[_0xed9e('0x26')](_0x55d35a[_0xed9e('0x18')],[_0xed9e('0x25'),'id'])||{});}})['spread'](function(_0x4e2437){logger[_0xed9e('0xf')](_0xed9e('0x27'),_0x55d35a);logger[_0xed9e('0x1e')](_0xed9e('0x27'),_0x55d35a,JSON[_0xed9e('0x1f')](_0x4e2437));_0x4ca4af(_0x4e2437);})['catch'](function(_0x24e940){logger[_0xed9e('0x12')]('AddTags',_0x24e940['message'],_0x55d35a);_0x2d5c74(_this[_0xed9e('0x12')](0x1f4,_0x24e940['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f583be9..c811566 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 _0xd8cd=['update','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x2766e8,_0x417954){var _0x11d652=function(_0x3d79ed){while(--_0x3d79ed){_0x2766e8['push'](_0x2766e8['shift']());}};_0x11d652(++_0x417954);}(_0xd8cd,0x1a7));var _0xdd8c=function(_0x3ce326,_0x896471){_0x3ce326=_0x3ce326-0x0;var _0x16d78c=_0xd8cd[_0x3ce326];return _0x16d78c;};'use strict';var FaxInteractionEvents=require(_0xdd8c('0x0'));var events=[_0xdd8c('0x1'),_0xdd8c('0x2'),_0xdd8c('0x3')];function createListener(_0x30a2e2,_0x387af7){return function(_0x3c6263){_0x387af7['emit'](_0x30a2e2,_0x3c6263);};}function removeListener(_0x457ce6,_0x2b5f30){return function(){FaxInteractionEvents['removeListener'](_0x457ce6,_0x2b5f30);};}exports[_0xdd8c('0x4')]=function(_0x2ed15f){for(var _0x23cef7=0x0,_0x5732ae=events['length'];_0x23cef7<_0x5732ae;_0x23cef7++){var _0x293d88=events[_0x23cef7];var _0x405b05=createListener(_0xdd8c('0x5')+_0x293d88,_0x2ed15f);FaxInteractionEvents['on'](_0x293d88,_0x405b05);}}; \ No newline at end of file +var _0xf5bc=['faxInteraction:','./faxInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf5bc,0x181));var _0xcf5b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf5bc[_0x3bf83f];return _0x22c4a9;};'use strict';var FaxInteractionEvents=require(_0xcf5b('0x0'));var events=[_0xcf5b('0x1'),'remove',_0xcf5b('0x2')];function createListener(_0x1e7068,_0x3fcac1){return function(_0x11e45c){_0x3fcac1[_0xcf5b('0x3')](_0x1e7068,_0x11e45c);};}function removeListener(_0x2a981b,_0x5476b4){return function(){FaxInteractionEvents[_0xcf5b('0x4')](_0x2a981b,_0x5476b4);};}exports[_0xcf5b('0x5')]=function(_0x125b08){for(var _0x341b86=0x0,_0x2c1607=events[_0xcf5b('0x6')];_0x341b86<_0x2c1607;_0x341b86++){var _0x364b79=events[_0x341b86];var _0x9ee919=createListener(_0xcf5b('0x7')+_0x364b79,_0x125b08);FaxInteractionEvents['on'](_0x364b79,_0x9ee919);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 03ee8bd..1a9eb9b 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 _0x59b0=['./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3b46b2,_0x5bed47){var _0x3f108d=function(_0x1a2c32){while(--_0x1a2c32){_0x3b46b2['push'](_0x3b46b2['shift']());}};_0x3f108d(++_0x5bed47);}(_0x59b0,0x190));var _0x059b=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x59b0[_0x2ca616];return _0x53155f;};'use strict';var multer=require(_0x059b('0x0'));var util=require(_0x059b('0x1'));var path=require(_0x059b('0x2'));var timeout=require(_0x059b('0x3'));var express=require(_0x059b('0x4'));var router=express[_0x059b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x059b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x059b('0x7'));var controller=require(_0x059b('0x8'));router[_0x059b('0x9')]('/',auth['isAuthenticated'](),controller[_0x059b('0xa')]);router['get'](_0x059b('0xb'),auth[_0x059b('0xc')](),controller[_0x059b('0xd')]);router['get'](_0x059b('0xe'),auth['isAuthenticated'](),controller[_0x059b('0xf')]);router[_0x059b('0x9')](_0x059b('0x10'),auth['isAuthenticated'](),controller[_0x059b('0x11')]);router['get'](_0x059b('0x12'),auth['isAuthenticated'](),controller[_0x059b('0x13')]);router[_0x059b('0x14')]('/',auth['isAuthenticated'](),controller[_0x059b('0x15')]);router[_0x059b('0x14')](_0x059b('0x10'),auth[_0x059b('0xc')](),controller[_0x059b('0x16')]);router[_0x059b('0x14')]('/:id/tags',auth[_0x059b('0xc')](),interaction[_0x059b('0x17')](_0x059b('0x18'),_0x059b('0x19')),controller[_0x059b('0x1a')]);router['put']('/:id',auth[_0x059b('0xc')](),interaction[_0x059b('0x17')](_0x059b('0x18'),_0x059b('0x1b')),controller[_0x059b('0x1c')]);router[_0x059b('0x1d')](_0x059b('0xe'),auth[_0x059b('0xc')](),interaction['tracked'](_0x059b('0x18'),_0x059b('0x1e')),controller[_0x059b('0x1f')]);router['delete'](_0x059b('0x20'),auth[_0x059b('0xc')](),controller[_0x059b('0x21')]);module['exports']=router; \ No newline at end of file +var _0xfae1=['put','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','create','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags'];(function(_0x12decd,_0xc24bce){var _0x2485a0=function(_0x4ca181){while(--_0x4ca181){_0x12decd['push'](_0x12decd['shift']());}};_0x2485a0(++_0xc24bce);}(_0xfae1,0x16e));var _0x1fae=function(_0x511efb,_0x3dcbd7){_0x511efb=_0x511efb-0x0;var _0xa423d2=_0xfae1[_0x511efb];return _0xa423d2;};'use strict';var multer=require(_0x1fae('0x0'));var util=require(_0x1fae('0x1'));var path=require(_0x1fae('0x2'));var timeout=require(_0x1fae('0x3'));var express=require(_0x1fae('0x4'));var router=express[_0x1fae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1fae('0x6'));var interaction=require(_0x1fae('0x7'));var config=require(_0x1fae('0x8'));var controller=require(_0x1fae('0x9'));router['get']('/',auth[_0x1fae('0xa')](),controller[_0x1fae('0xb')]);router[_0x1fae('0xc')](_0x1fae('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x1fae('0xc')](_0x1fae('0xe'),auth[_0x1fae('0xa')](),controller['show']);router['get']('/:id/messages',auth[_0x1fae('0xa')](),controller['getMessages']);router[_0x1fae('0xc')](_0x1fae('0xf'),auth[_0x1fae('0xa')](),controller[_0x1fae('0x10')]);router['post']('/',auth[_0x1fae('0xa')](),controller[_0x1fae('0x11')]);router[_0x1fae('0x12')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1fae('0x12')](_0x1fae('0x13'),auth[_0x1fae('0xa')](),interaction[_0x1fae('0x14')](_0x1fae('0x15'),_0x1fae('0x16')),controller[_0x1fae('0x17')]);router[_0x1fae('0x18')]('/:id',auth[_0x1fae('0xa')](),interaction[_0x1fae('0x14')](_0x1fae('0x15'),'faxinteraction:update'),controller[_0x1fae('0x19')]);router[_0x1fae('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x1fae('0x14')](_0x1fae('0x15'),_0x1fae('0x1b')),controller['destroy']);router[_0x1fae('0x1a')](_0x1fae('0x13'),auth['isAuthenticated'](),controller[_0x1fae('0x1c')]);module[_0x1fae('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index e7f4585..ac8d113 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 _0xd382=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x4976eb,_0x4b09d1){var _0x5dd7b2=function(_0x4556a2){while(--_0x4556a2){_0x4976eb['push'](_0x4976eb['shift']());}};_0x5dd7b2(++_0x4b09d1);}(_0xd382,0x1b6));var _0x2d38=function(_0x4f438b,_0x3c1a3c){_0x4f438b=_0x4f438b-0x0;var _0xdba339=_0xd382[_0x4f438b];return _0xdba339;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'body':{'type':Sequelize[_0x2d38('0x2')](_0x2d38('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2d38('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d38('0x5')]('in',_0x2d38('0x6')),'defaultValue':_0x2d38('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2d38('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2d38('0x7')]}}; \ No newline at end of file +var _0x2fed=['TEXT','medium','BOOLEAN','out','sequelize','exports'];(function(_0x527939,_0x32c1b2){var _0x3d21b3=function(_0x3c7e48){while(--_0x3c7e48){_0x527939['push'](_0x527939['shift']());}};_0x3d21b3(++_0x32c1b2);}(_0x2fed,0x7c));var _0xd2fe=function(_0x22249e,_0x59a2f3){_0x22249e=_0x22249e-0x0;var _0x4a9a30=_0x2fed[_0x22249e];return _0x4a9a30;};'use strict';var Sequelize=require(_0xd2fe('0x0'));module[_0xd2fe('0x1')]={'body':{'type':Sequelize[_0xd2fe('0x2')](_0xd2fe('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd2fe('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd2fe('0x5')),'defaultValue':_0xd2fe('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index c3b0966..8c723e3 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 _0x11ce=['role','null','rejectMessage','Sequelize','SELECT','motionChannel','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','basename','download','join','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','filter','where','merge','type','VIRTUAL','options','FaxMessage','includeAll','findAll','show','params','include','update','body','find','destroy','describe','../../config/logger','fax-interactions','accept','read','readAt','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x562834,_0x378a55){var _0x8b5be3=function(_0x1c88f6){while(--_0x1c88f6){_0x562834['push'](_0x562834['shift']());}};_0x8b5be3(++_0x378a55);}(_0x11ce,0x126));var _0xe11c=function(_0x422592,_0x4bb901){_0x422592=_0x422592-0x0;var _0x5b9b26=_0x11ce[_0x422592];return _0x5b9b26;};'use strict';var emlformat=require(_0xe11c('0x0'));var rimraf=require(_0xe11c('0x1'));var zipdir=require(_0xe11c('0x2'));var jsonpatch=require(_0xe11c('0x3'));var rp=require(_0xe11c('0x4'));var moment=require('moment');var BPromise=require(_0xe11c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe11c('0x6'));var sox=require(_0xe11c('0x7'));var csv=require(_0xe11c('0x8'));var ejs=require(_0xe11c('0x9'));var fs=require('fs');var fs_extra=require(_0xe11c('0xa'));var _=require('lodash');var squel=require(_0xe11c('0xb'));var crypto=require(_0xe11c('0xc'));var jsforce=require(_0xe11c('0xd'));var deskjs=require(_0xe11c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe11c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe11c('0x10'));var hardwareService=require(_0xe11c('0x11'));var logger=require('../../config/logger')(_0xe11c('0x12'));var utils=require('../../config/utils');var config=require(_0xe11c('0x13'));var licenseUtil=require(_0xe11c('0x14'));var db=require(_0xe11c('0x15'))['db'];config['redis']=_[_0xe11c('0x16')](config[_0xe11c('0x17')],{'host':_0xe11c('0x18'),'port':0x18eb});var socket=require(_0xe11c('0x19'))(new Redis(config[_0xe11c('0x17')]));require('./faxMessage.socket')[_0xe11c('0x1a')](socket);var jayson=require(_0xe11c('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe11c('0x1c')][_0xe11c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1de002,_0x2998b4,_0x1151b3,_0x88d391){return new BPromise(function(_0x844788,_0x5743b3){var _0x3de9ce=_0x88d391||client;return _0x3de9ce[_0xe11c('0x1e')](_0x1de002,_0x1151b3)[_0xe11c('0x1f')](function(_0x58d9cb){logger[_0xe11c('0x20')]('FaxMessage,\x20%s,\x20%s',_0x2998b4,_0xe11c('0x21'));logger[_0xe11c('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2998b4,_0xe11c('0x21'),JSON[_0xe11c('0x23')](_0x58d9cb));if(_0x58d9cb['error']){if(_0x58d9cb[_0xe11c('0x24')][_0xe11c('0x25')]===0x1f4){logger[_0xe11c('0x24')](_0xe11c('0x26'),_0x2998b4,_0x58d9cb[_0xe11c('0x24')]['message']);return _0x5743b3(_0x58d9cb[_0xe11c('0x24')][_0xe11c('0x27')]);}logger['error'](_0xe11c('0x26'),_0x2998b4,_0x58d9cb['error'][_0xe11c('0x27')]);return _0x844788(_0x58d9cb[_0xe11c('0x24')][_0xe11c('0x27')]);}else{logger[_0xe11c('0x20')](_0xe11c('0x26'),_0x2998b4,_0xe11c('0x21'));_0x844788(_0x58d9cb[_0xe11c('0x28')][_0xe11c('0x27')]);}})[_0xe11c('0x29')](function(_0x5322c7){logger[_0xe11c('0x24')](_0xe11c('0x26'),_0x2998b4,_0x5322c7);_0x5743b3(_0x5322c7);});});}function respondWithStatusCode(_0x527e2b,_0x203768){_0x203768=_0x203768||0xcc;return function(_0x521927){if(_0x521927){return _0x527e2b[_0xe11c('0x2a')](_0x203768);}return _0x527e2b[_0xe11c('0x2b')](_0x203768)['end']();};}function respondWithResult(_0x333fa4,_0x21bfda){_0x21bfda=_0x21bfda||0xc8;return function(_0x18d1f9){if(_0x18d1f9){return _0x333fa4[_0xe11c('0x2b')](_0x21bfda)['json'](_0x18d1f9);}};}function respondWithFilteredResult(_0x163f79,_0xef2e9f){return function(_0x53a6b2){if(_0x53a6b2){var _0x59e38b=typeof _0xef2e9f[_0xe11c('0x2c')]==='undefined'&&typeof _0xef2e9f[_0xe11c('0x2d')]===_0xe11c('0x2e');var _0x401706=_0x53a6b2['count'];var _0x3ebe32=_0x59e38b?0x0:_0xef2e9f[_0xe11c('0x2c')];var _0x54ed69=_0x59e38b?_0x53a6b2[_0xe11c('0x2f')]:_0xef2e9f['offset']+_0xef2e9f[_0xe11c('0x2d')];var _0xf4e644;if(_0x54ed69>=_0x401706){_0x54ed69=_0x401706;_0xf4e644=0xc8;}else{_0xf4e644=0xce;}_0x163f79[_0xe11c('0x2b')](_0xf4e644);return _0x163f79[_0xe11c('0x30')](_0xe11c('0x31'),_0x3ebe32+'-'+_0x54ed69+'/'+_0x401706)['json'](_0x53a6b2);}return null;};}function patchUpdates(_0x300f75){return function(_0x3dba52){try{jsonpatch[_0xe11c('0x32')](_0x3dba52,_0x300f75,!![]);}catch(_0x3646b0){return BPromise[_0xe11c('0x33')](_0x3646b0);}return _0x3dba52['save']();};}function saveUpdates(_0x5ca3f7,_0x4fef7b){return function(_0x41fac7){if(_0x41fac7){return _0x41fac7['update'](_0x5ca3f7)['then'](function(_0x4c987c){return _0x4c987c;});}return null;};}function removeEntity(_0x19d5e6,_0x2f8ee5){return function(_0x406ca7){if(_0x406ca7){return _0x406ca7['destroy']()[_0xe11c('0x1f')](function(){_0x19d5e6[_0xe11c('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x302caf,_0x23afcc){return function(_0x2434d4){if(!_0x2434d4){_0x302caf[_0xe11c('0x2a')](0x194);}return _0x2434d4;};}function handleError(_0x4995cf,_0x982c82){_0x982c82=_0x982c82||0x1f4;return function(_0x830c47){logger[_0xe11c('0x24')](_0x830c47[_0xe11c('0x34')]);if(_0x830c47[_0xe11c('0x35')]){delete _0x830c47[_0xe11c('0x35')];}_0x4995cf[_0xe11c('0x2b')](_0x982c82)['send'](_0x830c47);};}exports[_0xe11c('0x36')]=function(_0x2a194d,_0x2a842f){var _0x5cf4bc={},_0x98d3a1={},_0x16bf1f={'count':0x0,'rows':[]};var _0x2cf9e1=_[_0xe11c('0x37')](db['FaxMessage'][_0xe11c('0x38')],function(_0x5923f5){return{'name':_0x5923f5[_0xe11c('0x39')],'type':_0x5923f5['type']['key']};});_0x98d3a1[_0xe11c('0x3a')]=_['map'](_0x2cf9e1,_0xe11c('0x35'));_0x98d3a1[_0xe11c('0x3b')]=_[_0xe11c('0x3c')](_0x2a194d[_0xe11c('0x3b')]);_0x98d3a1[_0xe11c('0x3d')]=_[_0xe11c('0x3e')](_0x98d3a1[_0xe11c('0x3a')],_0x98d3a1[_0xe11c('0x3b')]);_0x5cf4bc[_0xe11c('0x3f')]=_['intersection'](_0x98d3a1['model'],qs[_0xe11c('0x40')](_0x2a194d['query'][_0xe11c('0x40')]));_0x5cf4bc[_0xe11c('0x3f')]=_0x5cf4bc[_0xe11c('0x3f')][_0xe11c('0x41')]?_0x5cf4bc['attributes']:_0x98d3a1['model'];if(!_0x2a194d[_0xe11c('0x3b')][_0xe11c('0x42')](_0xe11c('0x43'))){_0x5cf4bc[_0xe11c('0x2d')]=qs[_0xe11c('0x2d')](_0x2a194d[_0xe11c('0x3b')][_0xe11c('0x2d')]);_0x5cf4bc['offset']=qs[_0xe11c('0x2c')](_0x2a194d['query'][_0xe11c('0x2c')]);}_0x5cf4bc['order']=qs['sort'](_0x2a194d[_0xe11c('0x3b')]['sort']);_0x5cf4bc['where']=qs[_0xe11c('0x3d')](_['pick'](_0x2a194d[_0xe11c('0x3b')],_0x98d3a1[_0xe11c('0x3d')]),_0x2cf9e1);if(_0x2a194d[_0xe11c('0x3b')][_0xe11c('0x44')]){_0x5cf4bc[_0xe11c('0x45')]=_[_0xe11c('0x46')](_0x5cf4bc[_0xe11c('0x45')],{'$or':_[_0xe11c('0x37')](_0x2cf9e1,function(_0x59d3e0){if(_0x59d3e0[_0xe11c('0x47')]!==_0xe11c('0x48')){var _0x413eb8={};_0x413eb8[_0x59d3e0[_0xe11c('0x35')]]={'$like':'%'+_0x2a194d['query'][_0xe11c('0x44')]+'%'};return _0x413eb8;}})});}_0x5cf4bc=_[_0xe11c('0x46')]({},_0x5cf4bc,_0x2a194d[_0xe11c('0x49')]);var _0x4f3047={'where':_0x5cf4bc['where']};return db[_0xe11c('0x4a')][_0xe11c('0x2f')](_0x4f3047)[_0xe11c('0x1f')](function(_0x191b92){_0x16bf1f[_0xe11c('0x2f')]=_0x191b92;if(_0x2a194d[_0xe11c('0x3b')][_0xe11c('0x4b')]){_0x5cf4bc['include']=[{'all':!![]}];}return db['FaxMessage'][_0xe11c('0x4c')](_0x5cf4bc);})[_0xe11c('0x1f')](function(_0x4e0633){_0x16bf1f['rows']=_0x4e0633;return _0x16bf1f;})[_0xe11c('0x1f')](respondWithFilteredResult(_0x2a842f,_0x5cf4bc))['catch'](handleError(_0x2a842f,null));};exports[_0xe11c('0x4d')]=function(_0x3fce03,_0x1ce2ac){var _0x184136={'raw':!![],'where':{'id':_0x3fce03[_0xe11c('0x4e')]['id']}},_0x32e10e={};_0x32e10e[_0xe11c('0x3a')]=_[_0xe11c('0x3c')](db[_0xe11c('0x4a')][_0xe11c('0x38')]);_0x32e10e[_0xe11c('0x3b')]=_[_0xe11c('0x3c')](_0x3fce03[_0xe11c('0x3b')]);_0x32e10e[_0xe11c('0x3d')]=_['intersection'](_0x32e10e[_0xe11c('0x3a')],_0x32e10e[_0xe11c('0x3b')]);_0x184136[_0xe11c('0x3f')]=_[_0xe11c('0x3e')](_0x32e10e[_0xe11c('0x3a')],qs[_0xe11c('0x40')](_0x3fce03[_0xe11c('0x3b')][_0xe11c('0x40')]));_0x184136[_0xe11c('0x3f')]=_0x184136[_0xe11c('0x3f')][_0xe11c('0x41')]?_0x184136[_0xe11c('0x3f')]:_0x32e10e[_0xe11c('0x3a')];if(_0x3fce03[_0xe11c('0x3b')]['includeAll']){_0x184136[_0xe11c('0x4f')]=[{'all':!![]}];}_0x184136=_[_0xe11c('0x46')]({},_0x184136,_0x3fce03[_0xe11c('0x49')]);return db[_0xe11c('0x4a')]['find'](_0x184136)[_0xe11c('0x1f')](handleEntityNotFound(_0x1ce2ac,null))[_0xe11c('0x1f')](respondWithResult(_0x1ce2ac,null))[_0xe11c('0x29')](handleError(_0x1ce2ac,null));};exports[_0xe11c('0x50')]=function(_0x53b876,_0x3b545b){if(_0x53b876['body']['id']){delete _0x53b876[_0xe11c('0x51')]['id'];}return db[_0xe11c('0x4a')][_0xe11c('0x52')]({'where':{'id':_0x53b876['params']['id']}})[_0xe11c('0x1f')](handleEntityNotFound(_0x3b545b,null))['then'](saveUpdates(_0x53b876[_0xe11c('0x51')],null))[_0xe11c('0x1f')](respondWithResult(_0x3b545b,null))['catch'](handleError(_0x3b545b,null));};exports[_0xe11c('0x53')]=function(_0x5c9728,_0x4314ea){return db[_0xe11c('0x4a')][_0xe11c('0x52')]({'where':{'id':_0x5c9728[_0xe11c('0x4e')]['id']}})[_0xe11c('0x1f')](handleEntityNotFound(_0x4314ea,null))['then'](removeEntity(_0x4314ea,null))[_0xe11c('0x29')](handleError(_0x4314ea,null));};exports[_0xe11c('0x54')]=function(_0x54e1f8,_0x3bb176){return db[_0xe11c('0x4a')]['describe']()[_0xe11c('0x1f')](respondWithResult(_0x3bb176,null))[_0xe11c('0x29')](handleError(_0x3bb176,null));};var interaction_log=require(_0xe11c('0x55'))(_0xe11c('0x56'));exports[_0xe11c('0x57')]=function(_0x3341a3,_0x31bda1,_0x515575){var _0x11888b={'agent':{},'channel':'fax'};if(_0x3341a3[_0xe11c('0x51')]['id']){delete _0x3341a3[_0xe11c('0x51')]['id'];}_0x3341a3[_0xe11c('0x51')][_0xe11c('0x58')]=!![];_0x3341a3[_0xe11c('0x51')][_0xe11c('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3341a3['body'][_0xe11c('0x5a')]=_0x3341a3[_0xe11c('0x51')][_0xe11c('0x5a')]||_0x3341a3[_0xe11c('0x5b')]['id'];_0x11888b[_0xe11c('0x5c')]['id']=_0x3341a3[_0xe11c('0x51')][_0xe11c('0x5a')];return db[_0xe11c('0x4a')]['find']({'where':{'id':_0x3341a3[_0xe11c('0x4e')]['id'],'UserId':null}})[_0xe11c('0x1f')](handleEntityNotFound(_0x31bda1,null))[_0xe11c('0x1f')](saveUpdates(_0x3341a3[_0xe11c('0x51')],null))[_0xe11c('0x1f')](function(_0x64f4ad){if(_0x64f4ad){_0x11888b[_0xe11c('0x27')]=_0x64f4ad[_0xe11c('0x5d')]({'plain':!![]});return db[_0xe11c('0x5e')][_0xe11c('0x52')]({'where':{'id':_0x64f4ad[_0xe11c('0x5f')]}});}return null;})[_0xe11c('0x1f')](handleEntityNotFound(_0x31bda1,null))[_0xe11c('0x1f')](function(_0x3aeeb9){if(_0x3aeeb9){return _0x3aeeb9[_0xe11c('0x50')]({'UserId':_0x3341a3[_0xe11c('0x51')][_0xe11c('0x5a')],'read1stAt':_[_0xe11c('0x60')](_0x3aeeb9[_0xe11c('0x61')])?moment()[_0xe11c('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe11c('0x1f')](function(_0xf66b27){if(_0xf66b27){_0x11888b['interaction']=_0xf66b27[_0xe11c('0x5d')]({'plain':!![]});interaction_log['info'](_0xe11c('0x63'),_0x3341a3[_0xe11c('0x5b')]['id'],_0x3341a3[_0xe11c('0x5b')]['name'],_0x3341a3['user']['role'],_0x11888b[_0xe11c('0x64')]['id'],_0x3341a3[_0xe11c('0x51')]?JSON[_0xe11c('0x23')](_0x3341a3[_0xe11c('0x51')]):'null');return respondWithRpcPromise(_0xe11c('0x65'),_0xe11c('0x66'),_0x11888b);}return null;})[_0xe11c('0x1f')](function(_0x4be2cc){var _0x228633=_0xe11c('0x67')+_0x4be2cc[_0xe11c('0x27')][_0xe11c('0x68')];return db[_0xe11c('0x69')][_0xe11c('0x3b')](_0x228633,{'type':db['Sequelize'][_0xe11c('0x6a')]['SELECT'],'raw':!![]})[_0xe11c('0x1f')](function(_0x3d7b52){return _0x3d7b52;});})[_0xe11c('0x1f')](function(_0xf38605){if(_0xf38605){_0x11888b[_0xe11c('0x27')][_0xe11c('0x6b')]=_0xf38605[0x0];if(!_0x3341a3[_0xe11c('0x51')][_0xe11c('0x5a')])return;return db['User'][_0xe11c('0x52')]({'where':{'id':_0x3341a3[_0xe11c('0x51')]['UserId'],'role':_0xe11c('0x5c')},'attributes':['id',_0xe11c('0x35'),_0xe11c('0x6c'),_0xe11c('0x6d'),_0xe11c('0x6e')],'raw':!![]});}return null;})['then'](function(_0x675617){if(!_0x675617)return null;_0x11888b[_0xe11c('0x27')][_0xe11c('0x5c')]=_0x675617;return _0x11888b;})[_0xe11c('0x1f')](function(_0x5ec056){if(_0x5ec056){if(_0x3341a3[_0xe11c('0x51')][_0xe11c('0x6f')]){_0x11888b['message'][_0xe11c('0x70')]=util[_0xe11c('0x62')](_0xe11c('0x71'),_0x3341a3['user'][_0xe11c('0x35')]);_0x11888b[_0xe11c('0x27')][_0xe11c('0x72')]=_0x11888b[_0xe11c('0x72')];_0x11888b[_0xe11c('0x27')]['motionChannel']=_0x11888b[_0xe11c('0x72')];_0x11888b[_0xe11c('0x27')][_0xe11c('0x73')]=_0xe11c('0x57');return respondWithRpcPromise(_0xe11c('0x74'),_0xe11c('0x74'),{'event':_0xe11c('0x75'),'message':_0x11888b[_0xe11c('0x27')]},client9002)[_0xe11c('0x1f')](function(){return _0x11888b;});}return _0x11888b;}return null;})['then'](respondWithResult(_0x31bda1,null))[_0xe11c('0x29')](handleError(_0x31bda1,null));};var interaction_log=require(_0xe11c('0x55'))(_0xe11c('0x56'));exports[_0xe11c('0x33')]=function(_0x4f1f87,_0xc14c92,_0x5cb67c){var _0x413edc={'agent':{},'channel':_0xe11c('0x76')};if(_0x4f1f87[_0xe11c('0x51')]['id']){delete _0x4f1f87[_0xe11c('0x51')]['id'];}_0x4f1f87[_0xe11c('0x51')]['UserId']=_0x4f1f87[_0xe11c('0x51')]['UserId']||_0x4f1f87[_0xe11c('0x5b')]['id'];_0x413edc['agent']['id']=_0x4f1f87[_0xe11c('0x51')][_0xe11c('0x5a')];return db[_0xe11c('0x4a')]['find']({'where':{'id':_0x4f1f87[_0xe11c('0x4e')]['id'],'UserId':null}})[_0xe11c('0x1f')](handleEntityNotFound(_0xc14c92,null))[_0xe11c('0x1f')](function(_0x2aa276){if(_0x2aa276){_0x413edc[_0xe11c('0x27')]=_0x2aa276[_0xe11c('0x5d')]({'plain':!![]});return db[_0xe11c('0x5e')][_0xe11c('0x52')]({'where':{'id':_0x2aa276[_0xe11c('0x5f')]}});}return null;})[_0xe11c('0x1f')](handleEntityNotFound(_0xc14c92,null))[_0xe11c('0x1f')](function(_0x2cb3ba){if(_0x2cb3ba){_0x413edc[_0xe11c('0x64')]=_0x2cb3ba['get']({'plain':!![]});interaction_log['info'](_0xe11c('0x77'),_0x4f1f87['user']['id'],_0x4f1f87[_0xe11c('0x5b')][_0xe11c('0x35')],_0x4f1f87[_0xe11c('0x5b')][_0xe11c('0x78')],_0x413edc[_0xe11c('0x64')]['id'],_0x4f1f87[_0xe11c('0x51')]?JSON[_0xe11c('0x23')](_0x4f1f87['body']):_0xe11c('0x79'));return respondWithRpcPromise('RejectMessage',_0xe11c('0x7a'),_0x413edc);}return null;})[_0xe11c('0x1f')](function(_0x3356c7){var _0x5bcdc8=_0xe11c('0x67')+_0x3356c7[_0xe11c('0x27')][_0xe11c('0x68')];return db['sequelize'][_0xe11c('0x3b')](_0x5bcdc8,{'type':db[_0xe11c('0x7b')][_0xe11c('0x6a')][_0xe11c('0x7c')],'raw':!![]})[_0xe11c('0x1f')](function(_0x65c8){return _0x65c8;});})[_0xe11c('0x1f')](function(_0x5a6546){if(_0x5a6546){_0x413edc['message']['contact']=_0x5a6546[0x0];if(!_0x4f1f87[_0xe11c('0x51')][_0xe11c('0x5a')])return;return db['User'][_0xe11c('0x52')]({'where':{'id':_0x4f1f87[_0xe11c('0x51')][_0xe11c('0x5a')],'role':_0xe11c('0x5c')},'attributes':['id',_0xe11c('0x35'),'fullname',_0xe11c('0x6d'),_0xe11c('0x6e')],'raw':!![]});}return null;})[_0xe11c('0x1f')](function(_0x34d418){if(!_0x34d418)return null;_0x413edc['message'][_0xe11c('0x5c')]=_0x34d418;return _0x413edc;})[_0xe11c('0x1f')](function(_0x39cb1f){if(_0x39cb1f){_0x39cb1f[_0xe11c('0x27')][_0xe11c('0x70')]=util[_0xe11c('0x62')](_0xe11c('0x71'),_0x4f1f87[_0xe11c('0x5b')][_0xe11c('0x35')]);_0x39cb1f[_0xe11c('0x27')][_0xe11c('0x72')]=_0x413edc[_0xe11c('0x72')];_0x39cb1f[_0xe11c('0x27')][_0xe11c('0x7d')]=_0x413edc[_0xe11c('0x72')];_0x39cb1f[_0xe11c('0x27')][_0xe11c('0x73')]='reject';respondWithRpcPromise('EventManager',_0xe11c('0x74'),{'event':_0xe11c('0x7e'),'message':_0x39cb1f[_0xe11c('0x27')]},client9002);return _0x413edc;}return null;})['then'](respondWithResult(_0xc14c92,null))[_0xe11c('0x29')](handleError(_0xc14c92,null));};exports[_0xe11c('0x7f')]=function(_0x21eb06,_0x372968){var _0x2ad137;return db['FaxMessage'][_0xe11c('0x7f')](_0x21eb06[_0xe11c('0x51')],{})[_0xe11c('0x1f')](function(_0x139750){_0x2ad137=_0x139750;return db['CmContact']['findOne']({'where':{'id':_0x2ad137[_0xe11c('0x68')]}});})[_0xe11c('0x1f')](function(_0x27e0b6){if(_[_0xe11c('0x60')](_0x27e0b6)){return;}else{_0x2ad137[_0xe11c('0x76')]=_0x27e0b6['fax'];return db[_0xe11c('0x80')][_0xe11c('0x81')]({'where':{'id':_0x2ad137[_0xe11c('0x82')]}});}})['then'](function(_0x30a12c){return respondWithRpcPromise(_0xe11c('0x83'),_0xe11c('0x83'),{'FaxAccountId':_['isNil'](_0x21eb06[_0xe11c('0x51')])?undefined:_0x21eb06[_0xe11c('0x51')]['FaxAccountId'],'path':_[_0xe11c('0x60')](_0x30a12c)?undefined:util[_0xe11c('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x30a12c[_0xe11c('0x84')]),'fax':_[_0xe11c('0x60')](_0x2ad137['fax'])?undefined:_0x2ad137[_0xe11c('0x76')],'AttachmentId':_0x2ad137[_0xe11c('0x82')]},client9002);})[_0xe11c('0x1f')](respondWithResult(_0x372968,0xc9))['catch'](handleError(_0x372968,null));};exports[_0xe11c('0x85')]=function(_0x463254,_0x107785){var _0x182ec1=path[_0xe11c('0x86')](config['root'],_0xe11c('0x87'),_0xe11c('0x88'),_0xe11c('0x89'));return db[_0xe11c('0x4a')]['find']({'where':{'id':_0x463254[_0xe11c('0x4e')]['id']},'include':[{'model':db['Attachment'],'as':_0xe11c('0x80')}]})['then'](handleEntityNotFound(_0x107785,null))[_0xe11c('0x1f')](function(_0xa9d7f8){if(_0xa9d7f8){return _0x107785[_0xe11c('0x85')](path[_0xe11c('0x86')](_0x182ec1,_0xa9d7f8['Attachment']['basename']));}})[_0xe11c('0x29')](handleError(_0x107785,null));}; \ No newline at end of file +var _0x0441=['name','send','index','map','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','merge','options','FaxMessage','includeAll','findAll','rows','show','params','include','find','update','body','destroy','describe','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteractionId','format','interaction','get','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','EventManager','fax-interactions','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','motionChannel','event','create','CmContact','findOne','isNil','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','zip-dir','moment','mustache','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','limit','count','offset','set','Content-Range','apply','reject','save','then','end','stack'];(function(_0xa3f3e9,_0x530c20){var _0x5c21d4=function(_0x1b51e7){while(--_0x1b51e7){_0xa3f3e9['push'](_0xa3f3e9['shift']());}};_0x5c21d4(++_0x530c20);}(_0x0441,0xd3));var _0x1044=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x0441[_0x28fbe3];return _0x45db6a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1044('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1044('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1044('0x2'));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(_0x1044('0x3'));var squel=require(_0x1044('0x4'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1044('0x5'));var toCsv=require(_0x1044('0x6'));var querystring=require('querystring');var Papa=require(_0x1044('0x7'));var Redis=require(_0x1044('0x8'));var authService=require(_0x1044('0x9'));var qs=require(_0x1044('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1044('0xb'))(_0x1044('0xc'));var utils=require(_0x1044('0xd'));var config=require(_0x1044('0xe'));var licenseUtil=require(_0x1044('0xf'));var db=require(_0x1044('0x10'))['db'];config[_0x1044('0x11')]=_[_0x1044('0x12')](config[_0x1044('0x11')],{'host':_0x1044('0x13'),'port':0x18eb});var socket=require(_0x1044('0x14'))(new Redis(config['redis']));require(_0x1044('0x15'))[_0x1044('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1044('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x1044('0x17')][_0x1044('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3ed028,_0x47e580,_0x53e8a6,_0x36e2aa){return new BPromise(function(_0x2f985b,_0x267341){var _0x2186e7=_0x36e2aa||client;return _0x2186e7[_0x1044('0x19')](_0x3ed028,_0x53e8a6)['then'](function(_0x160a31){logger[_0x1044('0x1a')](_0x1044('0x1b'),_0x47e580,_0x1044('0x1c'));logger[_0x1044('0x1d')](_0x1044('0x1e'),_0x47e580,_0x1044('0x1c'),JSON[_0x1044('0x1f')](_0x160a31));if(_0x160a31['error']){if(_0x160a31[_0x1044('0x20')]['code']===0x1f4){logger[_0x1044('0x20')](_0x1044('0x1b'),_0x47e580,_0x160a31['error'][_0x1044('0x21')]);return _0x267341(_0x160a31['error'][_0x1044('0x21')]);}logger[_0x1044('0x20')](_0x1044('0x1b'),_0x47e580,_0x160a31[_0x1044('0x20')][_0x1044('0x21')]);return _0x2f985b(_0x160a31[_0x1044('0x20')][_0x1044('0x21')]);}else{logger[_0x1044('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x47e580,_0x1044('0x1c'));_0x2f985b(_0x160a31[_0x1044('0x22')][_0x1044('0x21')]);}})[_0x1044('0x23')](function(_0x8008e7){logger['error'](_0x1044('0x1b'),_0x47e580,_0x8008e7);_0x267341(_0x8008e7);});});}function respondWithStatusCode(_0xb5fd1e,_0x151ca4){_0x151ca4=_0x151ca4||0xcc;return function(_0x3925ae){if(_0x3925ae){return _0xb5fd1e[_0x1044('0x24')](_0x151ca4);}return _0xb5fd1e[_0x1044('0x25')](_0x151ca4)['end']();};}function respondWithResult(_0x3c2b9a,_0x5a147c){_0x5a147c=_0x5a147c||0xc8;return function(_0x3c81e2){if(_0x3c81e2){return _0x3c2b9a[_0x1044('0x25')](_0x5a147c)['json'](_0x3c81e2);}};}function respondWithFilteredResult(_0x16f8f4,_0x12a69c){return function(_0x3e8c83){if(_0x3e8c83){var _0xa0eaf7=typeof _0x12a69c['offset']==='undefined'&&typeof _0x12a69c[_0x1044('0x26')]==='undefined';var _0xd907f6=_0x3e8c83[_0x1044('0x27')];var _0x5cd865=_0xa0eaf7?0x0:_0x12a69c[_0x1044('0x28')];var _0x295b9f=_0xa0eaf7?_0x3e8c83[_0x1044('0x27')]:_0x12a69c[_0x1044('0x28')]+_0x12a69c[_0x1044('0x26')];var _0x42a617;if(_0x295b9f>=_0xd907f6){_0x295b9f=_0xd907f6;_0x42a617=0xc8;}else{_0x42a617=0xce;}_0x16f8f4[_0x1044('0x25')](_0x42a617);return _0x16f8f4[_0x1044('0x29')](_0x1044('0x2a'),_0x5cd865+'-'+_0x295b9f+'/'+_0xd907f6)['json'](_0x3e8c83);}return null;};}function patchUpdates(_0x3de7b2){return function(_0x598b98){try{jsonpatch[_0x1044('0x2b')](_0x598b98,_0x3de7b2,!![]);}catch(_0x489952){return BPromise[_0x1044('0x2c')](_0x489952);}return _0x598b98[_0x1044('0x2d')]();};}function saveUpdates(_0x399b2d,_0x1b73ac){return function(_0x55b15b){if(_0x55b15b){return _0x55b15b['update'](_0x399b2d)[_0x1044('0x2e')](function(_0x5d0b2e){return _0x5d0b2e;});}return null;};}function removeEntity(_0x50e6d6,_0x1f23cb){return function(_0x353c5d){if(_0x353c5d){return _0x353c5d['destroy']()[_0x1044('0x2e')](function(){_0x50e6d6['status'](0xcc)[_0x1044('0x2f')]();});}};}function handleEntityNotFound(_0x4ecf0f,_0x3e4470){return function(_0x5c5cb6){if(!_0x5c5cb6){_0x4ecf0f[_0x1044('0x24')](0x194);}return _0x5c5cb6;};}function handleError(_0x4c16f6,_0x46ff03){_0x46ff03=_0x46ff03||0x1f4;return function(_0x1dad64){logger['error'](_0x1dad64[_0x1044('0x30')]);if(_0x1dad64[_0x1044('0x31')]){delete _0x1dad64[_0x1044('0x31')];}_0x4c16f6[_0x1044('0x25')](_0x46ff03)[_0x1044('0x32')](_0x1dad64);};}exports[_0x1044('0x33')]=function(_0x45664a,_0x464b77){var _0x134c18={},_0x4a02a3={},_0x5d1b71={'count':0x0,'rows':[]};var _0x1d1278=_[_0x1044('0x34')](db['FaxMessage']['rawAttributes'],function(_0x361387){return{'name':_0x361387['fieldName'],'type':_0x361387[_0x1044('0x35')][_0x1044('0x36')]};});_0x4a02a3[_0x1044('0x37')]=_[_0x1044('0x34')](_0x1d1278,_0x1044('0x31'));_0x4a02a3['query']=_[_0x1044('0x38')](_0x45664a[_0x1044('0x39')]);_0x4a02a3['filters']=_[_0x1044('0x3a')](_0x4a02a3['model'],_0x4a02a3[_0x1044('0x39')]);_0x134c18[_0x1044('0x3b')]=_[_0x1044('0x3a')](_0x4a02a3[_0x1044('0x37')],qs[_0x1044('0x3c')](_0x45664a[_0x1044('0x39')]['fields']));_0x134c18['attributes']=_0x134c18[_0x1044('0x3b')][_0x1044('0x3d')]?_0x134c18[_0x1044('0x3b')]:_0x4a02a3['model'];if(!_0x45664a[_0x1044('0x39')][_0x1044('0x3e')](_0x1044('0x3f'))){_0x134c18['limit']=qs[_0x1044('0x26')](_0x45664a[_0x1044('0x39')]['limit']);_0x134c18[_0x1044('0x28')]=qs['offset'](_0x45664a['query']['offset']);}_0x134c18['order']=qs[_0x1044('0x40')](_0x45664a[_0x1044('0x39')][_0x1044('0x40')]);_0x134c18[_0x1044('0x41')]=qs[_0x1044('0x42')](_['pick'](_0x45664a[_0x1044('0x39')],_0x4a02a3[_0x1044('0x42')]),_0x1d1278);if(_0x45664a[_0x1044('0x39')]['filter']){_0x134c18[_0x1044('0x41')]=_['merge'](_0x134c18[_0x1044('0x41')],{'$or':_[_0x1044('0x34')](_0x1d1278,function(_0x3e1075){if(_0x3e1075[_0x1044('0x35')]!==_0x1044('0x43')){var _0x3ea6c6={};_0x3ea6c6[_0x3e1075[_0x1044('0x31')]]={'$like':'%'+_0x45664a['query']['filter']+'%'};return _0x3ea6c6;}})});}_0x134c18=_[_0x1044('0x44')]({},_0x134c18,_0x45664a[_0x1044('0x45')]);var _0x596ae4={'where':_0x134c18[_0x1044('0x41')]};return db[_0x1044('0x46')][_0x1044('0x27')](_0x596ae4)[_0x1044('0x2e')](function(_0x4dfd95){_0x5d1b71['count']=_0x4dfd95;if(_0x45664a['query'][_0x1044('0x47')]){_0x134c18['include']=[{'all':!![]}];}return db[_0x1044('0x46')][_0x1044('0x48')](_0x134c18);})[_0x1044('0x2e')](function(_0x427f58){_0x5d1b71[_0x1044('0x49')]=_0x427f58;return _0x5d1b71;})[_0x1044('0x2e')](respondWithFilteredResult(_0x464b77,_0x134c18))['catch'](handleError(_0x464b77,null));};exports[_0x1044('0x4a')]=function(_0x5646c1,_0x4a5a77){var _0x7a743c={'raw':!![],'where':{'id':_0x5646c1[_0x1044('0x4b')]['id']}},_0x285e32={};_0x285e32['model']=_['keys'](db[_0x1044('0x46')]['rawAttributes']);_0x285e32[_0x1044('0x39')]=_[_0x1044('0x38')](_0x5646c1[_0x1044('0x39')]);_0x285e32['filters']=_[_0x1044('0x3a')](_0x285e32[_0x1044('0x37')],_0x285e32[_0x1044('0x39')]);_0x7a743c['attributes']=_[_0x1044('0x3a')](_0x285e32[_0x1044('0x37')],qs[_0x1044('0x3c')](_0x5646c1[_0x1044('0x39')][_0x1044('0x3c')]));_0x7a743c[_0x1044('0x3b')]=_0x7a743c[_0x1044('0x3b')]['length']?_0x7a743c[_0x1044('0x3b')]:_0x285e32['model'];if(_0x5646c1[_0x1044('0x39')][_0x1044('0x47')]){_0x7a743c[_0x1044('0x4c')]=[{'all':!![]}];}_0x7a743c=_[_0x1044('0x44')]({},_0x7a743c,_0x5646c1['options']);return db[_0x1044('0x46')][_0x1044('0x4d')](_0x7a743c)[_0x1044('0x2e')](handleEntityNotFound(_0x4a5a77,null))[_0x1044('0x2e')](respondWithResult(_0x4a5a77,null))[_0x1044('0x23')](handleError(_0x4a5a77,null));};exports[_0x1044('0x4e')]=function(_0x2e3ff0,_0x49731b){if(_0x2e3ff0[_0x1044('0x4f')]['id']){delete _0x2e3ff0[_0x1044('0x4f')]['id'];}return db[_0x1044('0x46')][_0x1044('0x4d')]({'where':{'id':_0x2e3ff0[_0x1044('0x4b')]['id']}})[_0x1044('0x2e')](handleEntityNotFound(_0x49731b,null))[_0x1044('0x2e')](saveUpdates(_0x2e3ff0[_0x1044('0x4f')],null))[_0x1044('0x2e')](respondWithResult(_0x49731b,null))[_0x1044('0x23')](handleError(_0x49731b,null));};exports[_0x1044('0x50')]=function(_0x29df76,_0x43e06c){return db[_0x1044('0x46')]['find']({'where':{'id':_0x29df76['params']['id']}})[_0x1044('0x2e')](handleEntityNotFound(_0x43e06c,null))[_0x1044('0x2e')](removeEntity(_0x43e06c,null))['catch'](handleError(_0x43e06c,null));};exports[_0x1044('0x51')]=function(_0x2b43c8,_0x589203){return db[_0x1044('0x46')][_0x1044('0x51')]()[_0x1044('0x2e')](respondWithResult(_0x589203,null))[_0x1044('0x23')](handleError(_0x589203,null));};var interaction_log=require(_0x1044('0xb'))('fax-interactions');exports[_0x1044('0x52')]=function(_0x263894,_0x427b9a,_0x9ea5d3){var _0xcb7ad3={'agent':{},'channel':_0x1044('0x53')};if(_0x263894[_0x1044('0x4f')]['id']){delete _0x263894[_0x1044('0x4f')]['id'];}_0x263894[_0x1044('0x4f')][_0x1044('0x54')]=!![];_0x263894[_0x1044('0x4f')]['readAt']=moment()['format'](_0x1044('0x55'));_0x263894[_0x1044('0x4f')]['UserId']=_0x263894[_0x1044('0x4f')][_0x1044('0x56')]||_0x263894[_0x1044('0x57')]['id'];_0xcb7ad3[_0x1044('0x58')]['id']=_0x263894[_0x1044('0x4f')][_0x1044('0x56')];return db['FaxMessage'][_0x1044('0x4d')]({'where':{'id':_0x263894[_0x1044('0x4b')]['id'],'UserId':null}})[_0x1044('0x2e')](handleEntityNotFound(_0x427b9a,null))[_0x1044('0x2e')](saveUpdates(_0x263894['body'],null))[_0x1044('0x2e')](function(_0x34c476){if(_0x34c476){_0xcb7ad3[_0x1044('0x21')]=_0x34c476['get']({'plain':!![]});return db['FaxInteraction'][_0x1044('0x4d')]({'where':{'id':_0x34c476[_0x1044('0x59')]}});}return null;})[_0x1044('0x2e')](handleEntityNotFound(_0x427b9a,null))[_0x1044('0x2e')](function(_0x249926){if(_0x249926){return _0x249926[_0x1044('0x4e')]({'UserId':_0x263894[_0x1044('0x4f')][_0x1044('0x56')],'read1stAt':_['isNil'](_0x249926['read1stAt'])?moment()[_0x1044('0x5a')](_0x1044('0x55')):undefined});}return null;})[_0x1044('0x2e')](function(_0x359052){if(_0x359052){_0xcb7ad3[_0x1044('0x5b')]=_0x359052[_0x1044('0x5c')]({'plain':!![]});interaction_log[_0x1044('0x1a')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x263894[_0x1044('0x57')]['id'],_0x263894['user']['name'],_0x263894[_0x1044('0x57')][_0x1044('0x5d')],_0xcb7ad3[_0x1044('0x5b')]['id'],_0x263894['body']?JSON[_0x1044('0x1f')](_0x263894[_0x1044('0x4f')]):_0x1044('0x5e'));return respondWithRpcPromise(_0x1044('0x5f'),_0x1044('0x60'),_0xcb7ad3);}return null;})['then'](function(_0x37cac8){var _0x4cf0b1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x37cac8['message'][_0x1044('0x61')];return db[_0x1044('0x62')]['query'](_0x4cf0b1,{'type':db[_0x1044('0x63')]['QueryTypes'][_0x1044('0x64')],'raw':!![]})[_0x1044('0x2e')](function(_0x28d606){return _0x28d606;});})[_0x1044('0x2e')](function(_0xc3ace1){if(_0xc3ace1){_0xcb7ad3[_0x1044('0x21')][_0x1044('0x65')]=_0xc3ace1[0x0];if(!_0x263894['body'][_0x1044('0x56')])return;return db[_0x1044('0x66')]['find']({'where':{'id':_0x263894['body'][_0x1044('0x56')],'role':'agent'},'attributes':['id',_0x1044('0x31'),_0x1044('0x67'),_0x1044('0x68'),_0x1044('0x69')],'raw':!![]});}return null;})[_0x1044('0x2e')](function(_0x792992){if(!_0x792992)return null;_0xcb7ad3[_0x1044('0x21')]['agent']=_0x792992;return _0xcb7ad3;})[_0x1044('0x2e')](function(_0x33b734){if(_0x33b734){if(_0x263894['body'][_0x1044('0x6a')]){_0xcb7ad3['message']['interface']=util['format'](_0x1044('0x6b'),_0x263894[_0x1044('0x57')][_0x1044('0x31')]);_0xcb7ad3['message']['channel']=_0xcb7ad3[_0x1044('0x6c')];_0xcb7ad3[_0x1044('0x21')]['motionChannel']=_0xcb7ad3['channel'];_0xcb7ad3['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x1044('0x6d'),{'event':'acceptmessage','message':_0xcb7ad3[_0x1044('0x21')]},client9002)[_0x1044('0x2e')](function(){return _0xcb7ad3;});}return _0xcb7ad3;}return null;})[_0x1044('0x2e')](respondWithResult(_0x427b9a,null))[_0x1044('0x23')](handleError(_0x427b9a,null));};var interaction_log=require(_0x1044('0xb'))(_0x1044('0x6e'));exports[_0x1044('0x2c')]=function(_0x16b961,_0x382981,_0x462e7c){var _0x213062={'agent':{},'channel':_0x1044('0x53')};if(_0x16b961['body']['id']){delete _0x16b961['body']['id'];}_0x16b961[_0x1044('0x4f')][_0x1044('0x56')]=_0x16b961[_0x1044('0x4f')][_0x1044('0x56')]||_0x16b961[_0x1044('0x57')]['id'];_0x213062[_0x1044('0x58')]['id']=_0x16b961[_0x1044('0x4f')]['UserId'];return db[_0x1044('0x46')]['find']({'where':{'id':_0x16b961[_0x1044('0x4b')]['id'],'UserId':null}})[_0x1044('0x2e')](handleEntityNotFound(_0x382981,null))[_0x1044('0x2e')](function(_0x1e6db2){if(_0x1e6db2){_0x213062['message']=_0x1e6db2[_0x1044('0x5c')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1e6db2['FaxInteractionId']}});}return null;})[_0x1044('0x2e')](handleEntityNotFound(_0x382981,null))['then'](function(_0x3c4188){if(_0x3c4188){_0x213062[_0x1044('0x5b')]=_0x3c4188[_0x1044('0x5c')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16b961[_0x1044('0x57')]['id'],_0x16b961[_0x1044('0x57')][_0x1044('0x31')],_0x16b961[_0x1044('0x57')][_0x1044('0x5d')],_0x213062['interaction']['id'],_0x16b961[_0x1044('0x4f')]?JSON[_0x1044('0x1f')](_0x16b961[_0x1044('0x4f')]):_0x1044('0x5e'));return respondWithRpcPromise(_0x1044('0x6f'),'rejectMessage',_0x213062);}return null;})[_0x1044('0x2e')](function(_0xa8bdac){var _0x225d0c=_0x1044('0x70')+_0xa8bdac[_0x1044('0x21')][_0x1044('0x61')];return db[_0x1044('0x62')][_0x1044('0x39')](_0x225d0c,{'type':db['Sequelize'][_0x1044('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5624b5){return _0x5624b5;});})[_0x1044('0x2e')](function(_0x973b19){if(_0x973b19){_0x213062['message'][_0x1044('0x65')]=_0x973b19[0x0];if(!_0x16b961[_0x1044('0x4f')][_0x1044('0x56')])return;return db[_0x1044('0x66')][_0x1044('0x4d')]({'where':{'id':_0x16b961[_0x1044('0x4f')]['UserId'],'role':_0x1044('0x58')},'attributes':['id',_0x1044('0x31'),_0x1044('0x67'),_0x1044('0x68'),_0x1044('0x69')],'raw':!![]});}return null;})[_0x1044('0x2e')](function(_0x41bff4){if(!_0x41bff4)return null;_0x213062[_0x1044('0x21')][_0x1044('0x58')]=_0x41bff4;return _0x213062;})[_0x1044('0x2e')](function(_0xf07c11){if(_0xf07c11){_0xf07c11[_0x1044('0x21')]['interface']=util[_0x1044('0x5a')](_0x1044('0x6b'),_0x16b961[_0x1044('0x57')][_0x1044('0x31')]);_0xf07c11[_0x1044('0x21')][_0x1044('0x6c')]=_0x213062[_0x1044('0x6c')];_0xf07c11['message'][_0x1044('0x72')]=_0x213062[_0x1044('0x6c')];_0xf07c11[_0x1044('0x21')][_0x1044('0x73')]=_0x1044('0x2c');respondWithRpcPromise(_0x1044('0x6d'),_0x1044('0x6d'),{'event':'rejectmessage','message':_0xf07c11['message']},client9002);return _0x213062;}return null;})[_0x1044('0x2e')](respondWithResult(_0x382981,null))[_0x1044('0x23')](handleError(_0x382981,null));};exports['create']=function(_0x3acca4,_0x5ef6ef){var _0x1517bb;return db[_0x1044('0x46')][_0x1044('0x74')](_0x3acca4['body'],{})[_0x1044('0x2e')](function(_0x5e7da1){_0x1517bb=_0x5e7da1;return db[_0x1044('0x75')][_0x1044('0x76')]({'where':{'id':_0x1517bb['ContactId']}});})[_0x1044('0x2e')](function(_0x589195){if(_[_0x1044('0x77')](_0x589195)){return;}else{_0x1517bb[_0x1044('0x53')]=_0x589195['fax'];return db[_0x1044('0x78')][_0x1044('0x76')]({'where':{'id':_0x1517bb['AttachmentId']}});}})[_0x1044('0x2e')](function(_0xd15edb){return respondWithRpcPromise(_0x1044('0x79'),_0x1044('0x79'),{'FaxAccountId':_[_0x1044('0x77')](_0x3acca4[_0x1044('0x4f')])?undefined:_0x3acca4['body']['FaxAccountId'],'path':_['isNil'](_0xd15edb)?undefined:util[_0x1044('0x5a')](_0x1044('0x7a'),_0xd15edb[_0x1044('0x7b')]),'fax':_['isNil'](_0x1517bb[_0x1044('0x53')])?undefined:_0x1517bb[_0x1044('0x53')],'AttachmentId':_0x1517bb[_0x1044('0x7c')]},client9002);})[_0x1044('0x2e')](respondWithResult(_0x5ef6ef,0xc9))[_0x1044('0x23')](handleError(_0x5ef6ef,null));};exports[_0x1044('0x7d')]=function(_0x342587,_0x116521){var _0x5a6416=path[_0x1044('0x7e')](config[_0x1044('0x7f')],_0x1044('0x80'),_0x1044('0x81'),'attachments');return db[_0x1044('0x46')][_0x1044('0x4d')]({'where':{'id':_0x342587[_0x1044('0x4b')]['id']},'include':[{'model':db[_0x1044('0x78')],'as':_0x1044('0x78')}]})['then'](handleEntityNotFound(_0x116521,null))[_0x1044('0x2e')](function(_0xd4cec8){if(_0xd4cec8){return _0x116521[_0x1044('0x7d')](path[_0x1044('0x7e')](_0x5a6416,_0xd4cec8[_0x1044('0x78')][_0x1044('0x7b')]));}})[_0x1044('0x23')](handleError(_0x116521,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index bce44a2..5c444d0 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 _0xe978=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','update','remove'];(function(_0x14cf43,_0x13b418){var _0x31197e=function(_0x4e3ae7){while(--_0x4e3ae7){_0x14cf43['push'](_0x14cf43['shift']());}};_0x31197e(++_0x13b418);}(_0xe978,0x70));var _0x8e97=function(_0x2e4223,_0x14df7a){_0x2e4223=_0x2e4223-0x0;var _0x346967=_0xe978[_0x2e4223];return _0x346967;};'use strict';var EventEmitter=require(_0x8e97('0x0'));var FaxMessage=require(_0x8e97('0x1'))['db'][_0x8e97('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e97('0x3'),'afterDestroy':_0x8e97('0x4')};function emitEvent(_0x16e587){return function(_0x3e3a3a,_0x1e27f7,_0x4f11c9){FaxMessageEvents[_0x8e97('0x5')](_0x16e587+':'+_0x3e3a3a['id'],_0x3e3a3a);FaxMessageEvents[_0x8e97('0x5')](_0x16e587,_0x3e3a3a);_0x4f11c9(null);};}for(var e in events){if(events[_0x8e97('0x6')](e)){var event=events[e];FaxMessage[_0x8e97('0x7')](e,emitEvent(event));}}module[_0x8e97('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x2087=['events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0x2087,0xf3));var _0x7208=function(_0x1eaf5e,_0x333d16){_0x1eaf5e=_0x1eaf5e-0x0;var _0x409fa2=_0x2087[_0x1eaf5e];return _0x409fa2;};'use strict';var EventEmitter=require(_0x7208('0x0'));var FaxMessage=require(_0x7208('0x1'))['db'][_0x7208('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7208('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7208('0x4'),'afterDestroy':_0x7208('0x5')};function emitEvent(_0x4503f7){return function(_0x1d5d58,_0x4d7cd4,_0x57509e){FaxMessageEvents[_0x7208('0x6')](_0x4503f7+':'+_0x1d5d58['id'],_0x1d5d58);FaxMessageEvents['emit'](_0x4503f7,_0x1d5d58);_0x57509e(null);};}for(var e in events){if(events[_0x7208('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7208('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 98e1cb9..293beda 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 _0xd68c=['FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxMessage.attributes','define'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xd68c,0x1d2));var _0xcd68=function(_0x302ab6,_0x7c7d3a){_0x302ab6=_0x302ab6-0x0;var _0x2a9fed=_0xd68c[_0x302ab6];return _0x2a9fed;};'use strict';var _=require(_0xcd68('0x0'));var util=require(_0xcd68('0x1'));var logger=require(_0xcd68('0x2'))(_0xcd68('0x3'));var moment=require(_0xcd68('0x4'));var BPromise=require(_0xcd68('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd68('0x6'));var rimraf=require('rimraf');var config=require(_0xcd68('0x7'));var attributes=require(_0xcd68('0x8'));module['exports']=function(_0x598eb2,_0x2ccdc7){return _0x598eb2[_0xcd68('0x9')](_0xcd68('0xa'),attributes,{'tableName':_0xcd68('0xb'),'paranoid':![],'indexes':[{'name':_0xcd68('0xc'),'fields':['body'],'type':_0xcd68('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47ae,_0x2cc150,_0x20d768){var _0x5450f9=_0x598eb2[_0xcd68('0xe')];var _0x2de315=_0x47ae[_0xcd68('0xf')]({'plain':!![]});if(_0x2de315[_0xcd68('0x10')]['toLowerCase']()==='in'||_0x2de315[_0xcd68('0x10')][_0xcd68('0x11')]()===_0xcd68('0x12')&&!_0x2de315[_0xcd68('0x13')]&&!_[_0xcd68('0x14')](_0x2de315[_0xcd68('0x15')])){_0x5450f9[_0xcd68('0x16')][_0xcd68('0x17')]({'where':{'id':_0x2de315[_0xcd68('0x18')]}})['then'](function(_0x44f247){if(_0x44f247){_0x44f247[_0xcd68('0x19')]({'lastMsgAt':_0x2de315['createdAt'],'lastMsgDirection':_0x2de315[_0xcd68('0x10')][_0xcd68('0x11')]()});}})['catch'](function(_0x58821e){console[_0xcd68('0x1a')](_0x58821e);});}_0x20d768();}},'charset':_0xcd68('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x01e3=['FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil'];(function(_0x275f92,_0xf6eb4c){var _0x51556=function(_0xb96bab){while(--_0xb96bab){_0x275f92['push'](_0x275f92['shift']());}};_0x51556(++_0xf6eb4c);}(_0x01e3,0xaa));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x301e('0x0'));var util=require(_0x301e('0x1'));var logger=require('../../config/logger')(_0x301e('0x2'));var moment=require('moment');var BPromise=require(_0x301e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x301e('0x4'));var rimraf=require(_0x301e('0x5'));var config=require(_0x301e('0x6'));var attributes=require('./faxMessage.attributes');module[_0x301e('0x7')]=function(_0x539501,_0x506e61){return _0x539501[_0x301e('0x8')]('FaxMessage',attributes,{'tableName':_0x301e('0x9'),'paranoid':![],'indexes':[{'name':_0x301e('0xa'),'fields':[_0x301e('0xb')],'type':_0x301e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7c8fa7,_0x3bfc6c,_0xf1c0e1){var _0x523452=_0x539501[_0x301e('0xd')];var _0x1e7427=_0x7c8fa7[_0x301e('0xe')]({'plain':!![]});if(_0x1e7427['direction'][_0x301e('0xf')]()==='in'||_0x1e7427[_0x301e('0x10')][_0x301e('0xf')]()===_0x301e('0x11')&&!_0x1e7427['secret']&&!_[_0x301e('0x12')](_0x1e7427['UserId'])){_0x523452[_0x301e('0x13')]['findOne']({'where':{'id':_0x1e7427[_0x301e('0x14')]}})[_0x301e('0x15')](function(_0x141070){if(_0x141070){_0x141070[_0x301e('0x16')]({'lastMsgAt':_0x1e7427[_0x301e('0x17')],'lastMsgDirection':_0x1e7427[_0x301e('0x10')][_0x301e('0xf')]()});}})[_0x301e('0x18')](function(_0x1fc0fc){console[_0x301e('0x19')](_0x1fc0fc);});}_0xf1c0e1();}},'charset':_0x301e('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b3e1ad7..97e33de 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 _0x99e9=['register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x99e9,0xb4));var _0x999e=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x99e9[_0x3d8ba1];return _0x87804e;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});config[_0x999e('0xa')]=_[_0x999e('0xb')](config['redis'],{'host':_0x999e('0xc'),'port':0x18eb});var socket=require(_0x999e('0xd'))(new Redis(config[_0x999e('0xa')]));require(_0x999e('0xe'))[_0x999e('0xf')](socket);function respondWithRpcPromise(_0x175042,_0x3f2c24,_0x180846){return new BPromise(function(_0x3cb1c2,_0xf40130){return client[_0x999e('0x10')](_0x175042,_0x180846)[_0x999e('0x11')](function(_0x4246b1){logger[_0x999e('0x12')](_0x999e('0x13'),_0x3f2c24,_0x999e('0x14'));logger[_0x999e('0x15')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3f2c24,_0x999e('0x14'),JSON['stringify'](_0x4246b1));if(_0x4246b1[_0x999e('0x16')]){if(_0x4246b1[_0x999e('0x16')][_0x999e('0x17')]===0x1f4){logger['error'](_0x999e('0x13'),_0x3f2c24,_0x4246b1['error'][_0x999e('0x18')]);return _0xf40130(_0x4246b1['error']['message']);}logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);return _0x3cb1c2(_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3f2c24,'request\x20sent');_0x3cb1c2(_0x4246b1[_0x999e('0x19')][_0x999e('0x18')]);}})[_0x999e('0x1a')](function(_0x302f52){logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x302f52);_0xf40130(_0x302f52);});});}exports['CreateFaxMessage']=function(_0x5d86d4){var _0xc20d3e=this;return new Promise(function(_0x3f4d7c,_0x3b3642){return db['FaxMessage'][_0x999e('0x1b')](_0x5d86d4[_0x999e('0x1c')],{'raw':_0x5d86d4[_0x999e('0x1d')]?_0x5d86d4[_0x999e('0x1d')][_0x999e('0x1e')]===undefined?!![]:![]:!![]})[_0x999e('0x11')](function(_0x427bcf){logger['info']('CreateFaxMessage',_0x5d86d4);logger[_0x999e('0x15')](_0x999e('0x1f'),_0x5d86d4,JSON['stringify'](_0x427bcf));_0x3f4d7c(_0x427bcf);})[_0x999e('0x1a')](function(_0xe324d8){logger[_0x999e('0x16')](_0x999e('0x1f'),_0xe324d8[_0x999e('0x18')],_0x5d86d4);_0x3b3642(_0xc20d3e[_0x999e('0x16')](0x1f4,_0xe324d8['message']));});});};exports[_0x999e('0x20')]=function(_0x4199ff){var _0x11068e=this;return new Promise(function(_0x12b9ad,_0x1b7adb){return db[_0x999e('0x21')][_0x999e('0x22')](_0x4199ff['body'],{'raw':_0x4199ff[_0x999e('0x1d')]?_0x4199ff['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x23')]||null:null,'attributes':_0x4199ff['options']?_0x4199ff[_0x999e('0x1d')][_0x999e('0x24')]||null:null,'limit':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x25')]||null:null})[_0x999e('0x11')](function(_0x82e067){logger[_0x999e('0x12')](_0x999e('0x20'),_0x4199ff);logger[_0x999e('0x15')]('UpdateFaxMessage',_0x4199ff,JSON[_0x999e('0x26')](_0x82e067));_0x12b9ad(_0x82e067);})[_0x999e('0x1a')](function(_0x371613){logger['error'](_0x999e('0x20'),_0x371613['message'],_0x4199ff);_0x1b7adb(_0x11068e['error'](0x1f4,_0x371613[_0x999e('0x18')]));});});}; \ No newline at end of file +var _0x4c4e=['localhost','socket.io-emitter','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','debug','stringify','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x4aa21e,_0x2c62c8){var _0x4ac58e=function(_0x1d03a1){while(--_0x1d03a1){_0x4aa21e['push'](_0x4aa21e['shift']());}};_0x4ac58e(++_0x2c62c8);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2b609f,_0x5ab2c9){_0x2b609f=_0x2b609f-0x0;var _0x161c41=_0x4c4e[_0x2b609f];return _0x161c41;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});config[_0xe4c4('0xa')]=_[_0xe4c4('0xb')](config[_0xe4c4('0xa')],{'host':_0xe4c4('0xc'),'port':0x18eb});var socket=require(_0xe4c4('0xd'))(new Redis(config[_0xe4c4('0xa')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x31f879,_0x6f2545,_0x27ad42){return new BPromise(function(_0x1bc786,_0x333c08){return client[_0xe4c4('0xe')](_0x31f879,_0x27ad42)['then'](function(_0x303d89){logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));logger['debug'](_0xe4c4('0x12'),_0x6f2545,_0xe4c4('0x11'),JSON['stringify'](_0x303d89));if(_0x303d89[_0xe4c4('0x13')]){if(_0x303d89[_0xe4c4('0x13')]['code']===0x1f4){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89['error'][_0xe4c4('0x14')]);return _0x333c08(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);return _0x1bc786(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}else{logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));_0x1bc786(_0x303d89[_0xe4c4('0x15')][_0xe4c4('0x14')]);}})[_0xe4c4('0x16')](function(_0x5a32b5){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x5a32b5);_0x333c08(_0x5a32b5);});});}exports[_0xe4c4('0x17')]=function(_0x317cc8){var _0x5da165=this;return new Promise(function(_0x3d5856,_0x1cad5d){return db[_0xe4c4('0x18')][_0xe4c4('0x19')](_0x317cc8[_0xe4c4('0x1a')],{'raw':_0x317cc8[_0xe4c4('0x1b')]?_0x317cc8[_0xe4c4('0x1b')][_0xe4c4('0x1c')]===undefined?!![]:![]:!![]})[_0xe4c4('0x1d')](function(_0x1a7690){logger[_0xe4c4('0xf')](_0xe4c4('0x17'),_0x317cc8);logger[_0xe4c4('0x1e')](_0xe4c4('0x17'),_0x317cc8,JSON[_0xe4c4('0x1f')](_0x1a7690));_0x3d5856(_0x1a7690);})['catch'](function(_0x49cadc){logger[_0xe4c4('0x13')]('CreateFaxMessage',_0x49cadc[_0xe4c4('0x14')],_0x317cc8);_0x1cad5d(_0x5da165['error'](0x1f4,_0x49cadc[_0xe4c4('0x14')]));});});};exports['UpdateFaxMessage']=function(_0x34d667){var _0x583393=this;return new Promise(function(_0xba53ef,_0x4a0199){return db['FaxMessage']['update'](_0x34d667['body'],{'raw':_0x34d667[_0xe4c4('0x1b')]?_0x34d667['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d667[_0xe4c4('0x1b')]?_0x34d667[_0xe4c4('0x1b')]['where']||null:null,'attributes':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x20')]||null:null,'limit':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x21')]||null:null})[_0xe4c4('0x1d')](function(_0x48060e){logger['info'](_0xe4c4('0x22'),_0x34d667);logger[_0xe4c4('0x1e')](_0xe4c4('0x22'),_0x34d667,JSON[_0xe4c4('0x1f')](_0x48060e));_0xba53ef(_0x48060e);})['catch'](function(_0x49c913){logger[_0xe4c4('0x13')](_0xe4c4('0x22'),_0x49c913['message'],_0x34d667);_0x4a0199(_0x583393[_0xe4c4('0x13')](0x1f4,_0x49c913[_0xe4c4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b9a84aa..26e3eba 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 _0x8e4a=['faxMessage:','./faxMessage.events','save','remove','emit','removeListener','register'];(function(_0x2787ed,_0xdc2719){var _0x3c34d7=function(_0x32cb14){while(--_0x32cb14){_0x2787ed['push'](_0x2787ed['shift']());}};_0x3c34d7(++_0xdc2719);}(_0x8e4a,0x7f));var _0xa8e4=function(_0x103b26,_0x12c6b2){_0x103b26=_0x103b26-0x0;var _0x4c108a=_0x8e4a[_0x103b26];return _0x4c108a;};'use strict';var FaxMessageEvents=require(_0xa8e4('0x0'));var events=[_0xa8e4('0x1'),_0xa8e4('0x2'),'update'];function createListener(_0x5b2888,_0x1d4696){return function(_0x5c495a){_0x1d4696[_0xa8e4('0x3')](_0x5b2888,_0x5c495a);};}function removeListener(_0x45a519,_0xbf9df0){return function(){FaxMessageEvents[_0xa8e4('0x4')](_0x45a519,_0xbf9df0);};}exports[_0xa8e4('0x5')]=function(_0x3ffdeb){for(var _0x56047a=0x0,_0x19051b=events['length'];_0x56047a<_0x19051b;_0x56047a++){var _0x3e6324=events[_0x56047a];var _0x4e89e5=createListener(_0xa8e4('0x6')+_0x3e6324,_0x3ffdeb);FaxMessageEvents['on'](_0x3e6324,_0x4e89e5);}}; \ No newline at end of file +var _0xe72a=['register','faxMessage:','./faxMessage.events','save','update','removeListener'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe72a,0xfe));var _0xae72=function(_0x5c8b70,_0x4fa574){_0x5c8b70=_0x5c8b70-0x0;var _0x239ecb=_0xe72a[_0x5c8b70];return _0x239ecb;};'use strict';var FaxMessageEvents=require(_0xae72('0x0'));var events=[_0xae72('0x1'),'remove',_0xae72('0x2')];function createListener(_0x5e10c2,_0x32f61a){return function(_0x21f78f){_0x32f61a['emit'](_0x5e10c2,_0x21f78f);};}function removeListener(_0x3fdc58,_0xccff9a){return function(){FaxMessageEvents[_0xae72('0x3')](_0x3fdc58,_0xccff9a);};}exports[_0xae72('0x4')]=function(_0x2d498e){for(var _0x1e1765=0x0,_0x183d9e=events['length'];_0x1e1765<_0x183d9e;_0x1e1765++){var _0x22b701=events[_0x1e1765];var _0x40b038=createListener(_0xae72('0x5')+_0x22b701,_0x2d498e);FaxMessageEvents['on'](_0x22b701,_0x40b038);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2916a71..84ab877 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 _0x55e0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0xdfecb5,_0x23ab8c){var _0x1ef525=function(_0x4e7d50){while(--_0x4e7d50){_0xdfecb5['push'](_0xdfecb5['shift']());}};_0x1ef525(++_0x23ab8c);}(_0x55e0,0xdc));var _0x055e=function(_0x571bb4,_0x4cf81e){_0x571bb4=_0x571bb4-0x0;var _0x1d0ba0=_0x55e0[_0x571bb4];return _0x1d0ba0;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0x9')](_0x055e('0xd'),auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x055e('0x10'),'faxmessage:create'),controller[_0x055e('0x11')]);router[_0x055e('0x12')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller[_0x055e('0x13')]);router[_0x055e('0x12')](_0x055e('0x14'),auth['isAuthenticated'](),controller[_0x055e('0x15')]);router[_0x055e('0x12')](_0x055e('0x16'),auth[_0x055e('0xa')](),controller[_0x055e('0x17')]);router['delete'](_0x055e('0xc'),auth[_0x055e('0xa')](),controller[_0x055e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x1d1e94,_0x2ebb10){var _0x3f2ac4=function(_0x2d671c){while(--_0x2d671c){_0x1d1e94['push'](_0x1d1e94['shift']());}};_0x3f2ac4(++_0x2ebb10);}(_0x9354,0x96));var _0x4935=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x9354[_0x4828b1];return _0x1fec1b;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);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 bce3737..feb4ac0 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 _0x0b44=['rrmemory','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x1e5d24,_0x252204){var _0x4ef7cd=function(_0x38fd36){while(--_0x38fd36){_0x1e5d24['push'](_0x1e5d24['shift']());}};_0x4ef7cd(++_0x252204);}(_0x0b44,0xe2));var _0x40b4=function(_0x5242e2,_0x2e93ca){_0x5242e2=_0x5242e2-0x0;var _0x5c3ee3=_0x0b44[_0x5242e2];return _0x5c3ee3;};'use strict';var Sequelize=require(_0x40b4('0x0'));module[_0x40b4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x40b4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x40b4('0x3')]},'timeout':{'type':Sequelize[_0x40b4('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x40b4('0x5'),'beepall',_0x40b4('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x40b4('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3599=['exports','STRING','name','beepall','sequelize'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3599,0x185));var _0x9359=function(_0x52f68d,_0x3d27bc){_0x52f68d=_0x52f68d-0x0;var _0x21be54=_0x3599[_0x52f68d];return _0x21be54;};'use strict';var Sequelize=require(_0x9359('0x0'));module[_0x9359('0x1')]={'name':{'type':Sequelize[_0x9359('0x2')],'unique':_0x9359('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9359('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9359('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 b75d9f5..133d4d1 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 _0xf7f4=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','status','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','rows','show','params','rawAttributes','fields','catch','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserFaxQueue','User','findAndCountAll','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','findAll','select','field','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','isArray','getAgents','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'];(function(_0x1cd9af,_0x606e88){var _0x606d70=function(_0x13fcbf){while(--_0x13fcbf){_0x1cd9af['push'](_0x1cd9af['shift']());}};_0x606d70(++_0x606e88);}(_0xf7f4,0x199));var _0x4f7f=function(_0x34c916,_0x319533){_0x34c916=_0x34c916-0x0;var _0x16d84e=_0xf7f4[_0x34c916];return _0x16d84e;};'use strict';var emlformat=require(_0x4f7f('0x0'));var rimraf=require(_0x4f7f('0x1'));var zipdir=require(_0x4f7f('0x2'));var jsonpatch=require(_0x4f7f('0x3'));var rp=require(_0x4f7f('0x4'));var moment=require(_0x4f7f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f7f('0x6'));var util=require(_0x4f7f('0x7'));var path=require(_0x4f7f('0x8'));var sox=require(_0x4f7f('0x9'));var csv=require('to-csv');var ejs=require(_0x4f7f('0xa'));var fs=require('fs');var fs_extra=require(_0x4f7f('0xb'));var _=require(_0x4f7f('0xc'));var squel=require(_0x4f7f('0xd'));var crypto=require(_0x4f7f('0xe'));var jsforce=require(_0x4f7f('0xf'));var deskjs=require(_0x4f7f('0x10'));var toCsv=require(_0x4f7f('0x11'));var querystring=require(_0x4f7f('0x12'));var Papa=require(_0x4f7f('0x13'));var Redis=require(_0x4f7f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4f7f('0x15'));var as=require(_0x4f7f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f7f('0x17'))(_0x4f7f('0x18'));var utils=require('../../config/utils');var config=require(_0x4f7f('0x19'));var licenseUtil=require(_0x4f7f('0x1a'));var db=require(_0x4f7f('0x1b'))['db'];config[_0x4f7f('0x1c')]=_[_0x4f7f('0x1d')](config[_0x4f7f('0x1c')],{'host':_0x4f7f('0x1e'),'port':0x18eb});var socket=require(_0x4f7f('0x1f'))(new Redis(config[_0x4f7f('0x1c')]));require(_0x4f7f('0x20'))[_0x4f7f('0x21')](socket);function respondWithStatusCode(_0x3c2016,_0x4dc2b0){_0x4dc2b0=_0x4dc2b0||0xcc;return function(_0xe2b6af){if(_0xe2b6af){return _0x3c2016[_0x4f7f('0x22')](_0x4dc2b0);}return _0x3c2016['status'](_0x4dc2b0)[_0x4f7f('0x23')]();};}function respondWithResult(_0x2107ed,_0x9f6921){_0x9f6921=_0x9f6921||0xc8;return function(_0x1e494d){if(_0x1e494d){return _0x2107ed['status'](_0x9f6921)[_0x4f7f('0x24')](_0x1e494d);}};}function respondWithFilteredResult(_0xddd81,_0xb5c19a){return function(_0x5e9ceb){if(_0x5e9ceb){var _0x2bfe57=typeof _0xb5c19a[_0x4f7f('0x25')]==='undefined'&&typeof _0xb5c19a['limit']===_0x4f7f('0x26');var _0x461181=_0x5e9ceb[_0x4f7f('0x27')];var _0x3f91e7=_0x2bfe57?0x0:_0xb5c19a['offset'];var _0x56fd90=_0x2bfe57?_0x5e9ceb[_0x4f7f('0x27')]:_0xb5c19a[_0x4f7f('0x25')]+_0xb5c19a[_0x4f7f('0x28')];var _0x58b526;if(_0x56fd90>=_0x461181){_0x56fd90=_0x461181;_0x58b526=0xc8;}else{_0x58b526=0xce;}_0xddd81['status'](_0x58b526);return _0xddd81[_0x4f7f('0x29')](_0x4f7f('0x2a'),_0x3f91e7+'-'+_0x56fd90+'/'+_0x461181)['json'](_0x5e9ceb);}return null;};}function patchUpdates(_0x4184b6){return function(_0x7f0fd1){try{jsonpatch[_0x4f7f('0x2b')](_0x7f0fd1,_0x4184b6,!![]);}catch(_0x5f26e1){return BPromise[_0x4f7f('0x2c')](_0x5f26e1);}return _0x7f0fd1[_0x4f7f('0x2d')]();};}function saveUpdates(_0x522b5f,_0x1a1d3b){return function(_0x32c42a){if(_0x32c42a){return _0x32c42a[_0x4f7f('0x2e')](_0x522b5f)[_0x4f7f('0x2f')](function(_0x306471){return _0x306471;});}return null;};}function removeEntity(_0x183b37,_0x689753){return function(_0x5be9d6){if(_0x5be9d6){return _0x5be9d6['destroy']()[_0x4f7f('0x2f')](function(){var _0x5859fa=_0x5be9d6[_0x4f7f('0x30')]({'plain':!![]});var _0x24308c=_0x4f7f('0x31');return db[_0x4f7f('0x32')][_0x4f7f('0x33')]({'where':{'type':_0x24308c,'resourceId':_0x5859fa['id']}})[_0x4f7f('0x2f')](function(){return _0x5be9d6;});})[_0x4f7f('0x2f')](function(){_0x183b37[_0x4f7f('0x34')](0xcc)[_0x4f7f('0x23')]();});}};}function handleEntityNotFound(_0x270ea9,_0x14ba41){return function(_0x1838ee){if(!_0x1838ee){_0x270ea9['sendStatus'](0x194);}return _0x1838ee;};}function handleError(_0x182f19,_0x7c38d5){_0x7c38d5=_0x7c38d5||0x1f4;return function(_0x12c019){logger[_0x4f7f('0x35')](_0x12c019[_0x4f7f('0x36')]);if(_0x12c019[_0x4f7f('0x37')]){delete _0x12c019[_0x4f7f('0x37')];}_0x182f19['status'](_0x7c38d5)[_0x4f7f('0x38')](_0x12c019);};}exports[_0x4f7f('0x39')]=function(_0x371a25,_0x48c015){var _0x186390={},_0x95059c={},_0x1ae205={'count':0x0,'rows':[]};var _0x22616c=_[_0x4f7f('0x3a')](db['FaxQueue']['rawAttributes'],function(_0x19fac2){return{'name':_0x19fac2['fieldName'],'type':_0x19fac2[_0x4f7f('0x3b')][_0x4f7f('0x3c')]};});_0x95059c[_0x4f7f('0x3d')]=_[_0x4f7f('0x3a')](_0x22616c,_0x4f7f('0x37'));_0x95059c[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](_0x371a25[_0x4f7f('0x3e')]);_0x95059c[_0x4f7f('0x40')]=_[_0x4f7f('0x41')](_0x95059c[_0x4f7f('0x3d')],_0x95059c['query']);_0x186390[_0x4f7f('0x42')]=_['intersection'](_0x95059c[_0x4f7f('0x3d')],qs['fields'](_0x371a25[_0x4f7f('0x3e')]['fields']));_0x186390[_0x4f7f('0x42')]=_0x186390['attributes'][_0x4f7f('0x43')]?_0x186390[_0x4f7f('0x42')]:_0x95059c[_0x4f7f('0x3d')];if(!_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x44')](_0x4f7f('0x45'))){_0x186390[_0x4f7f('0x28')]=qs[_0x4f7f('0x28')](_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x28')]);_0x186390[_0x4f7f('0x25')]=qs[_0x4f7f('0x25')](_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x25')]);}_0x186390[_0x4f7f('0x46')]=qs[_0x4f7f('0x47')](_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x47')]);_0x186390[_0x4f7f('0x48')]=qs[_0x4f7f('0x40')](_[_0x4f7f('0x49')](_0x371a25[_0x4f7f('0x3e')],_0x95059c[_0x4f7f('0x40')]),_0x22616c);if(_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x4a')]){_0x186390['where']=_[_0x4f7f('0x4b')](_0x186390['where'],{'$or':_[_0x4f7f('0x3a')](_0x22616c,function(_0x5ea9dc){if(_0x5ea9dc[_0x4f7f('0x3b')]!==_0x4f7f('0x4c')){var _0x768428={};_0x768428[_0x5ea9dc['name']]={'$like':'%'+_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x4a')]+'%'};return _0x768428;}})});}_0x186390=_['merge']({},_0x186390,_0x371a25[_0x4f7f('0x4d')]);var _0xab298c={'where':_0x186390[_0x4f7f('0x48')]};return db[_0x4f7f('0x4e')][_0x4f7f('0x27')](_0xab298c)[_0x4f7f('0x2f')](function(_0x3cf6c7){_0x1ae205[_0x4f7f('0x27')]=_0x3cf6c7;if(_0x371a25[_0x4f7f('0x3e')][_0x4f7f('0x4f')]){_0x186390[_0x4f7f('0x50')]=[{'all':!![]}];}return db[_0x4f7f('0x4e')]['findAll'](_0x186390);})[_0x4f7f('0x2f')](function(_0x1f84e1){_0x1ae205[_0x4f7f('0x51')]=_0x1f84e1;return _0x1ae205;})[_0x4f7f('0x2f')](respondWithFilteredResult(_0x48c015,_0x186390))['catch'](handleError(_0x48c015,null));};exports[_0x4f7f('0x52')]=function(_0x9a65dc,_0x206c54){var _0x301edc={'raw':!![],'where':{'id':_0x9a65dc[_0x4f7f('0x53')]['id']}},_0x4d81cc={};_0x4d81cc[_0x4f7f('0x3d')]=_[_0x4f7f('0x3f')](db[_0x4f7f('0x4e')][_0x4f7f('0x54')]);_0x4d81cc[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](_0x9a65dc[_0x4f7f('0x3e')]);_0x4d81cc[_0x4f7f('0x40')]=_[_0x4f7f('0x41')](_0x4d81cc[_0x4f7f('0x3d')],_0x4d81cc[_0x4f7f('0x3e')]);_0x301edc[_0x4f7f('0x42')]=_[_0x4f7f('0x41')](_0x4d81cc[_0x4f7f('0x3d')],qs[_0x4f7f('0x55')](_0x9a65dc[_0x4f7f('0x3e')][_0x4f7f('0x55')]));_0x301edc[_0x4f7f('0x42')]=_0x301edc['attributes'][_0x4f7f('0x43')]?_0x301edc[_0x4f7f('0x42')]:_0x4d81cc[_0x4f7f('0x3d')];if(_0x9a65dc[_0x4f7f('0x3e')]['includeAll']){_0x301edc['include']=[{'all':!![]}];}_0x301edc=_[_0x4f7f('0x4b')]({},_0x301edc,_0x9a65dc[_0x4f7f('0x4d')]);return db[_0x4f7f('0x4e')]['find'](_0x301edc)[_0x4f7f('0x2f')](handleEntityNotFound(_0x206c54,null))[_0x4f7f('0x2f')](respondWithResult(_0x206c54,null))[_0x4f7f('0x56')](handleError(_0x206c54,null));};exports[_0x4f7f('0x57')]=function(_0x4d6ef7,_0x1aea8d){return db[_0x4f7f('0x4e')][_0x4f7f('0x57')](_0x4d6ef7['body'],{})[_0x4f7f('0x2f')](function(_0x23ff83){var _0x4664da=_0x4d6ef7['user'][_0x4f7f('0x30')]({'plain':!![]});if(!_0x4664da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4664da['role']===_0x4f7f('0x58')){var _0x23da8e=_0x23ff83[_0x4f7f('0x30')]({'plain':!![]});var _0xd2a0aa=_0x4f7f('0x31');return db[_0x4f7f('0x59')][_0x4f7f('0x5a')]({'where':{'name':_0xd2a0aa,'userProfileId':_0x4664da[_0x4f7f('0x5b')]},'raw':!![]})[_0x4f7f('0x2f')](function(_0x45fd63){if(_0x45fd63&&_0x45fd63[_0x4f7f('0x5c')]===0x0){return db[_0x4f7f('0x32')][_0x4f7f('0x57')]({'name':_0x23da8e[_0x4f7f('0x37')],'resourceId':_0x23da8e['id'],'type':_0x45fd63[_0x4f7f('0x37')],'sectionId':_0x45fd63['id']},{})[_0x4f7f('0x2f')](function(){return _0x23ff83;});}else{return _0x23ff83;}})[_0x4f7f('0x56')](function(_0x1d4861){logger[_0x4f7f('0x35')](_0x4f7f('0x5d'),_0x1d4861);throw _0x1d4861;});}return _0x23ff83;})['then'](respondWithResult(_0x1aea8d,0xc9))['catch'](handleError(_0x1aea8d,null));};exports['update']=function(_0x263cca,_0x28a1c6){if(_0x263cca[_0x4f7f('0x5e')]['id']){delete _0x263cca[_0x4f7f('0x5e')]['id'];}return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x263cca[_0x4f7f('0x53')]['id']}})['then'](handleEntityNotFound(_0x28a1c6,null))[_0x4f7f('0x2f')](saveUpdates(_0x263cca['body'],null))[_0x4f7f('0x2f')](respondWithResult(_0x28a1c6,null))['catch'](handleError(_0x28a1c6,null));};exports[_0x4f7f('0x33')]=function(_0x3f7b59,_0x318b54){return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x3f7b59[_0x4f7f('0x53')]['id']}})[_0x4f7f('0x2f')](handleEntityNotFound(_0x318b54,null))['then'](removeEntity(_0x318b54,null))['catch'](handleError(_0x318b54,null));};exports[_0x4f7f('0x5f')]=function(_0x1d3ad5,_0x340a6a){return db['FaxQueue'][_0x4f7f('0x5f')]()[_0x4f7f('0x2f')](respondWithResult(_0x340a6a,null))['catch'](handleError(_0x340a6a,null));};exports['getMembers']=function(_0x262e1c,_0x3106ea,_0x412892){var _0x2bb056={'raw':!![],'where':{}},_0x112b69={},_0x10d382;return db[_0x4f7f('0x4e')][_0x4f7f('0x60')]({'where':{'id':_0x262e1c['params']['id']}})[_0x4f7f('0x2f')](handleEntityNotFound(_0x3106ea,null))[_0x4f7f('0x2f')](function(_0x12fbec){if(_0x12fbec){_0x10d382=_0x12fbec['get']({'plain':!![]});_0x112b69['model']=_[_0x4f7f('0x3f')](db[_0x4f7f('0x61')]['rawAttributes']);_0x112b69[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](_0x262e1c[_0x4f7f('0x3e')]);_0x112b69['filters']=_['intersection'](_0x112b69[_0x4f7f('0x3d')],_0x112b69[_0x4f7f('0x3e')]);_0x2bb056['attributes']=_[_0x4f7f('0x41')](_0x112b69[_0x4f7f('0x3d')],qs[_0x4f7f('0x55')](_0x262e1c[_0x4f7f('0x3e')][_0x4f7f('0x55')]));_0x2bb056[_0x4f7f('0x42')]=_0x2bb056[_0x4f7f('0x42')][_0x4f7f('0x43')]?_0x2bb056[_0x4f7f('0x42')]:_0x112b69[_0x4f7f('0x3d')];if(!_0x262e1c[_0x4f7f('0x3e')][_0x4f7f('0x44')]('nolimit')){_0x2bb056['limit']=qs[_0x4f7f('0x28')](_0x262e1c[_0x4f7f('0x3e')][_0x4f7f('0x28')]);_0x2bb056['offset']=qs['offset'](_0x262e1c['query'][_0x4f7f('0x25')]);}_0x2bb056[_0x4f7f('0x46')]=qs[_0x4f7f('0x47')](_0x262e1c[_0x4f7f('0x3e')][_0x4f7f('0x47')]);_0x2bb056[_0x4f7f('0x48')]=qs[_0x4f7f('0x40')](_[_0x4f7f('0x49')](_0x262e1c[_0x4f7f('0x3e')],_0x112b69['filters']));_0x2bb056['where']['FaxQueueId']=_0x12fbec['id'];if(_0x262e1c[_0x4f7f('0x3e')][_0x4f7f('0x4a')]){_0x2bb056['where']=_[_0x4f7f('0x4b')](_0x2bb056['where'],{'$or':_[_0x4f7f('0x3a')](_0x2bb056['attributes'],function(_0x532294){var _0x4eac3a={};_0x4eac3a[_0x532294]={'$like':'%'+_0x262e1c['query'][_0x4f7f('0x4a')]+'%'};return _0x4eac3a;})});}_0x2bb056=_[_0x4f7f('0x4b')]({},_0x2bb056,_0x262e1c[_0x4f7f('0x4d')]);return db[_0x4f7f('0x61')]['findAll'](_0x2bb056);}})[_0x4f7f('0x2f')](function(_0x5c1924){if(_0x5c1924){return db[_0x4f7f('0x62')][_0x4f7f('0x63')]({'where':{'id':_[_0x4f7f('0x3a')](_0x5c1924,'UserId'),'role':'agent'},'attributes':['id',_0x4f7f('0x37'),_0x4f7f('0x64'),_0x4f7f('0x65'),_0x4f7f('0x66')]});}})[_0x4f7f('0x2f')](function(_0x354a10){if(_0x354a10){return{'count':_0x354a10[_0x4f7f('0x27')],'rows':_[_0x4f7f('0x3a')](_0x354a10[_0x4f7f('0x51')],function(_0x59b1b2){return{'membername':_0x59b1b2['name'],'UserId':_0x59b1b2['id'],'queue_name':_0x10d382[_0x4f7f('0x37')],'FaxQueueId':_0x10d382['id'],'interface':util[_0x4f7f('0x67')](_0x4f7f('0x68'),_0x4f7f('0x69'),_0x59b1b2['name']),'penalty':0x0,'paused':_0x59b1b2[_0x4f7f('0x64')],'createdAt':_0x59b1b2[_0x4f7f('0x66')],'updatedAt':_0x59b1b2[_0x4f7f('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3106ea,_0x2bb056))[_0x4f7f('0x56')](handleError(_0x3106ea,null));};exports[_0x4f7f('0x6a')]=function(_0xdfffbb,_0x4ac288,_0x34cebe){var _0xe18334={};var _0x16b0e3={};var _0x4fb589;var _0x32048d;return db[_0x4f7f('0x4e')][_0x4f7f('0x60')]({'where':{'id':_0xdfffbb[_0x4f7f('0x53')]['id']}})[_0x4f7f('0x2f')](handleEntityNotFound(_0x4ac288,null))[_0x4f7f('0x2f')](function(_0x55d3b5){if(_0x55d3b5){_0x4fb589=_0x55d3b5;_0x16b0e3[_0x4f7f('0x3d')]=_['keys'](db[_0x4f7f('0x6b')][_0x4f7f('0x54')]);_0x16b0e3[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](_0xdfffbb[_0x4f7f('0x3e')]);_0x16b0e3[_0x4f7f('0x40')]=_['intersection'](_0x16b0e3['model'],_0x16b0e3['query']);_0xe18334[_0x4f7f('0x42')]=_['intersection'](_0x16b0e3[_0x4f7f('0x3d')],qs['fields'](_0xdfffbb['query'][_0x4f7f('0x55')]));_0xe18334['attributes']=_0xe18334[_0x4f7f('0x42')][_0x4f7f('0x43')]?_0xe18334[_0x4f7f('0x42')]:_0x16b0e3[_0x4f7f('0x3d')];_0xe18334['order']=qs['sort'](_0xdfffbb[_0x4f7f('0x3e')][_0x4f7f('0x47')]);_0xe18334[_0x4f7f('0x48')]=qs[_0x4f7f('0x40')](_[_0x4f7f('0x49')](_0xdfffbb[_0x4f7f('0x3e')],_0x16b0e3[_0x4f7f('0x40')]));if(_0xdfffbb[_0x4f7f('0x3e')][_0x4f7f('0x4a')]){_0xe18334[_0x4f7f('0x48')]=_[_0x4f7f('0x4b')](_0xe18334['where'],{'$or':_[_0x4f7f('0x3a')](_0xe18334[_0x4f7f('0x42')],function(_0x2fc08f){var _0x588bb8={};_0x588bb8[_0x2fc08f]={'$like':'%'+_0xdfffbb[_0x4f7f('0x3e')][_0x4f7f('0x4a')]+'%'};return _0x588bb8;})});}_0xe18334=_[_0x4f7f('0x4b')]({},_0xe18334,_0xdfffbb[_0x4f7f('0x4d')]);return _0x4fb589[_0x4f7f('0x6a')](_0xe18334);}})[_0x4f7f('0x2f')](function(_0x4f769e){if(_0x4f769e){_0x32048d=_0x4f769e[_0x4f7f('0x43')];if(!_0xdfffbb[_0x4f7f('0x3e')]['hasOwnProperty'](_0x4f7f('0x45'))){_0xe18334[_0x4f7f('0x28')]=qs[_0x4f7f('0x28')](_0xdfffbb[_0x4f7f('0x3e')][_0x4f7f('0x28')]);_0xe18334[_0x4f7f('0x25')]=qs[_0x4f7f('0x25')](_0xdfffbb[_0x4f7f('0x3e')]['offset']);}return _0x4fb589[_0x4f7f('0x6a')](_0xe18334);}})[_0x4f7f('0x2f')](function(_0x23b654){if(_0x23b654){return _0x23b654?{'count':_0x32048d,'rows':_0x23b654}:null;}})['then'](respondWithResult(_0x4ac288,null))[_0x4f7f('0x56')](handleError(_0x4ac288,null));};exports['addTeams']=function(_0x24f099,_0x38d8af,_0xf98df0){var _0x599d5f=_0x24f099[_0x4f7f('0x5e')][_0x4f7f('0x6c')];return db['Team']['findAll']({'where':{'id':_0x599d5f},'attributes':['id'],'include':[{'model':db[_0x4f7f('0x62')],'as':_0x4f7f('0x6d'),'attributes':['id',_0x4f7f('0x37'),_0x4f7f('0x6e'),'voicePause',_0x4f7f('0x6f')],'raw':!![]}]})['then'](function(_0x32cfde){if(_0x32cfde){var _0x490137=_[_0x4f7f('0x70')](_0x32cfde,function(_0x267fc3){var _0x55611e=_0x267fc3[_0x4f7f('0x30')]({'plain':!![]});return _0x55611e[_0x4f7f('0x6d')];});return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x24f099[_0x4f7f('0x53')]['id']}})[_0x4f7f('0x2f')](function(_0x4d5b8a){return db[_0x4f7f('0x71')][_0x4f7f('0x72')](function(_0x4a402d){return _0x4d5b8a['addTeams'](_0x599d5f,{'transaction':_0x4a402d})[_0x4f7f('0x2f')](function(){return BPromise[_0x4f7f('0x73')](_0x490137,function(_0x38733a){return db['UserFaxQueue'][_0x4f7f('0x74')]({'where':{'UserId':_0x38733a['id'],'FaxQueueId':_0x24f099[_0x4f7f('0x53')]['id']},'transaction':_0x4a402d});});})[_0x4f7f('0x2f')](function(){_0x490137['forEach'](function(_0x1c3772){socket[_0x4f7f('0x75')](_0x4f7f('0x76'),{'UserId':_0x1c3772['id'],'FaxQueueId':_0x4d5b8a['id']});});});});});}})[_0x4f7f('0x2f')](respondWithStatusCode(_0x38d8af,null))['catch'](handleError(_0x38d8af,null));};exports[_0x4f7f('0x77')]=function(_0x1fceb8,_0x5e2e4c,_0x4b29bc){return db['Team'][_0x4f7f('0x78')]({'where':{'id':_0x1fceb8[_0x4f7f('0x3e')][_0x4f7f('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x4f7f('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f7f('0x2f')](handleEntityNotFound(_0x5e2e4c,null))[_0x4f7f('0x2f')](function(_0x4ecc9b){var _0xe8e8d4=_['map'](_0x4ecc9b,'id');var _0x5f2f50=[];var _0x56caed=[];var _0x5a5a6c=squel[_0x4f7f('0x79')]();_0x5a5a6c[_0x4f7f('0x7a')]('tq.TeamId')['from']('team_has_fax_queues','tq')[_0x4f7f('0x7b')](_0x4f7f('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4f7f('0x7d'),_0x1fceb8[_0x4f7f('0x53')]['id']);for(var _0x341549=0x0;_0x341549<_0x4ecc9b[_0x4f7f('0x43')];_0x341549+=0x1){let _0x2370fb=_0x4ecc9b[_0x341549];for(var _0x62a5ee=0x0;_0x62a5ee<_0x2370fb[_0x4f7f('0x6d')]['length'];_0x62a5ee+=0x1){let _0x262c0f=_0x2370fb[_0x4f7f('0x6d')][_0x62a5ee];var _0x582f34=_0x5a5a6c[_0x4f7f('0x7e')]();_0x582f34[_0x4f7f('0x48')](_0x4f7f('0x7f'),_0x262c0f['id']);_0x56caed['push'](db['sequelize'][_0x4f7f('0x3e')](_0x582f34[_0x4f7f('0x80')](),{'type':db[_0x4f7f('0x71')]['QueryTypes'][_0x4f7f('0x81')]})[_0x4f7f('0x2f')](function(_0xf8ca48){if(_0xf8ca48[_0x4f7f('0x43')]===0x1){return _0x262c0f['id'];}else{var _0x1fae8f=_[_0x4f7f('0x82')](_['map'](_0xf8ca48,_0x4f7f('0x83')),function(_0x74b5d){return _[_0x4f7f('0x84')](_0xe8e8d4,_0x74b5d);});if(_0x1fae8f){return _0x262c0f['id'];}}}));}}return BPromise[_0x4f7f('0x85')](_0x56caed)[_0x4f7f('0x2f')](function(_0xee73cc){_0x5f2f50=_(_0x5f2f50)[_0x4f7f('0x86')](_0xee73cc)['compact']()['value']();return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x1fceb8[_0x4f7f('0x53')]['id']}})['then'](function(_0x2ad96e){return db[_0x4f7f('0x71')]['transaction'](function(_0x302135){return _0x2ad96e[_0x4f7f('0x77')](_0x1fceb8[_0x4f7f('0x3e')][_0x4f7f('0x6c')],{'transaction':_0x302135})[_0x4f7f('0x2f')](function(){if(!_[_0x4f7f('0x87')](_0x5f2f50)){return _0x2ad96e[_0x4f7f('0x88')](_0x5f2f50,{'transaction':_0x302135});}})[_0x4f7f('0x2f')](function(){_0x5f2f50[_0x4f7f('0x89')](function(_0x3c5afe){socket[_0x4f7f('0x75')](_0x4f7f('0x8a'),{'UserId':_0x3c5afe,'FaxQueueId':_0x2ad96e['id']});});});});});});})[_0x4f7f('0x2f')](respondWithStatusCode(_0x5e2e4c,null))[_0x4f7f('0x56')](handleError(_0x5e2e4c,null));};exports[_0x4f7f('0x8b')]=function(_0x555b75,_0x420256,_0x5acb2b){return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x555b75[_0x4f7f('0x53')]['id']}})[_0x4f7f('0x2f')](handleEntityNotFound(_0x420256,null))[_0x4f7f('0x2f')](function(_0x227424){if(_0x227424){return _0x227424['addAgents'](_0x555b75[_0x4f7f('0x5e')][_0x4f7f('0x6c')],_[_0x4f7f('0x8c')](_0x555b75[_0x4f7f('0x5e')],['ids','id'])||{})['spread'](function(_0xe08c30){for(var _0x36a3c9=0x0;_0x36a3c9<_0x555b75[_0x4f7f('0x5e')][_0x4f7f('0x6c')][_0x4f7f('0x43')];_0x36a3c9+=0x1){socket['emit'](_0x4f7f('0x76'),{'UserId':Number(_0x555b75[_0x4f7f('0x5e')][_0x4f7f('0x6c')][_0x36a3c9]),'FaxQueueId':Number(_0x555b75[_0x4f7f('0x53')]['id'])});}return _0xe08c30;});}})['then'](respondWithResult(_0x420256,null))[_0x4f7f('0x56')](handleError(_0x420256,null));};exports['removeAgents']=function(_0x3cace5,_0x277fd6,_0x5058e1){return db[_0x4f7f('0x4e')][_0x4f7f('0x5a')]({'where':{'id':_0x3cace5[_0x4f7f('0x53')]['id']}})['then'](handleEntityNotFound(_0x277fd6,null))[_0x4f7f('0x2f')](function(_0x1f99a8){if(_0x1f99a8){return _0x1f99a8[_0x4f7f('0x88')](_0x3cace5[_0x4f7f('0x3e')][_0x4f7f('0x6c')])['then'](function(){if(_[_0x4f7f('0x8d')](_0x3cace5[_0x4f7f('0x3e')][_0x4f7f('0x6c')])){for(var _0x4919fa=0x0;_0x4919fa<_0x3cace5[_0x4f7f('0x3e')][_0x4f7f('0x6c')][_0x4f7f('0x43')];_0x4919fa+=0x1){socket[_0x4f7f('0x75')](_0x4f7f('0x8a'),{'UserId':Number(_0x3cace5['query'][_0x4f7f('0x6c')][_0x4919fa]),'FaxQueueId':Number(_0x3cace5[_0x4f7f('0x53')]['id'])});}}else{socket[_0x4f7f('0x75')](_0x4f7f('0x8a'),{'UserId':Number(_0x3cace5[_0x4f7f('0x3e')]['ids']),'FaxQueueId':Number(_0x3cace5['params']['id'])});}});}})[_0x4f7f('0x2f')](respondWithStatusCode(_0x277fd6,null))[_0x4f7f('0x56')](handleError(_0x277fd6,null));};exports[_0x4f7f('0x8e')]=function(_0x4e614d,_0x53bc56,_0xe48d77){var _0x45af58={};var _0x351b44={};var _0x14b184;var _0x2ce3be;return db[_0x4f7f('0x4e')][_0x4f7f('0x60')]({'where':{'id':_0x4e614d[_0x4f7f('0x53')]['id']}})['then'](handleEntityNotFound(_0x53bc56,null))[_0x4f7f('0x2f')](function(_0xb82837){if(_0xb82837){_0x14b184=_0xb82837;_0x351b44['model']=_[_0x4f7f('0x3f')](db[_0x4f7f('0x62')]['rawAttributes']);_0x351b44[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](_0x4e614d[_0x4f7f('0x3e')]);_0x351b44[_0x4f7f('0x40')]=_[_0x4f7f('0x41')](_0x351b44[_0x4f7f('0x3d')],_0x351b44[_0x4f7f('0x3e')]);_0x45af58['attributes']=_[_0x4f7f('0x41')](_0x351b44[_0x4f7f('0x3d')],qs[_0x4f7f('0x55')](_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x55')]));_0x45af58[_0x4f7f('0x42')]=_0x45af58[_0x4f7f('0x42')]['length']?_0x45af58[_0x4f7f('0x42')]:_0x351b44['model'];_0x45af58[_0x4f7f('0x46')]=qs[_0x4f7f('0x47')](_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x47')]);_0x45af58[_0x4f7f('0x48')]=qs[_0x4f7f('0x40')](_[_0x4f7f('0x49')](_0x4e614d[_0x4f7f('0x3e')],_0x351b44['filters']));if(_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x4a')]){_0x45af58['where']=_[_0x4f7f('0x4b')](_0x45af58[_0x4f7f('0x48')],{'$or':_[_0x4f7f('0x3a')](_0x45af58[_0x4f7f('0x42')],function(_0x2c7291){var _0x36511a={};_0x36511a[_0x2c7291]={'$like':'%'+_0x4e614d['query']['filter']+'%'};return _0x36511a;})});}_0x45af58=_[_0x4f7f('0x4b')]({},_0x45af58,_0x4e614d[_0x4f7f('0x4d')]);return _0x14b184['getAgents'](_0x45af58);}})[_0x4f7f('0x2f')](function(_0x1ad9c8){if(_0x1ad9c8){_0x2ce3be=_0x1ad9c8[_0x4f7f('0x43')];if(!_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x44')](_0x4f7f('0x45'))){_0x45af58['limit']=qs[_0x4f7f('0x28')](_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x28')]);_0x45af58[_0x4f7f('0x25')]=qs[_0x4f7f('0x25')](_0x4e614d[_0x4f7f('0x3e')][_0x4f7f('0x25')]);}return _0x14b184[_0x4f7f('0x8e')](_0x45af58);}})[_0x4f7f('0x2f')](function(_0x425a07){if(_0x425a07){return _0x425a07?{'count':_0x2ce3be,'rows':_0x425a07}:null;}})['then'](respondWithResult(_0x53bc56,null))[_0x4f7f('0x56')](handleError(_0x53bc56,null));}; \ No newline at end of file +var _0x55de=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','user','role','FaxQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','isArray','userFaxQueue:remove','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','key','model','query','keys','filters'];(function(_0x2feb70,_0x534ea1){var _0x54697f=function(_0x221ec5){while(--_0x221ec5){_0x2feb70['push'](_0x2feb70['shift']());}};_0x54697f(++_0x534ea1);}(_0x55de,0xdc));var _0xe55d=function(_0x311c92,_0x9166a3){_0x311c92=_0x311c92-0x0;var _0x2914d0=_0x55de[_0x311c92];return _0x2914d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe55d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe55d('0x1'));var rp=require('request-promise');var moment=require(_0xe55d('0x2'));var BPromise=require(_0xe55d('0x3'));var Mustache=require(_0xe55d('0x4'));var util=require(_0xe55d('0x5'));var path=require(_0xe55d('0x6'));var sox=require(_0xe55d('0x7'));var csv=require(_0xe55d('0x8'));var ejs=require(_0xe55d('0x9'));var fs=require('fs');var fs_extra=require(_0xe55d('0xa'));var _=require(_0xe55d('0xb'));var squel=require(_0xe55d('0xc'));var crypto=require(_0xe55d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe55d('0xe'));var toCsv=require(_0xe55d('0x8'));var querystring=require(_0xe55d('0xf'));var Papa=require('papaparse');var Redis=require(_0xe55d('0x10'));var authService=require(_0xe55d('0x11'));var qs=require(_0xe55d('0x12'));var as=require(_0xe55d('0x13'));var hardwareService=require(_0xe55d('0x14'));var logger=require(_0xe55d('0x15'))(_0xe55d('0x16'));var utils=require('../../config/utils');var config=require(_0xe55d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe55d('0x18'))['db'];config[_0xe55d('0x19')]=_[_0xe55d('0x1a')](config[_0xe55d('0x19')],{'host':_0xe55d('0x1b'),'port':0x18eb});var socket=require(_0xe55d('0x1c'))(new Redis(config[_0xe55d('0x19')]));require(_0xe55d('0x1d'))[_0xe55d('0x1e')](socket);function respondWithStatusCode(_0x3c7ee8,_0x159f15){_0x159f15=_0x159f15||0xcc;return function(_0x22090a){if(_0x22090a){return _0x3c7ee8['sendStatus'](_0x159f15);}return _0x3c7ee8[_0xe55d('0x1f')](_0x159f15)[_0xe55d('0x20')]();};}function respondWithResult(_0x1f3642,_0xb09071){_0xb09071=_0xb09071||0xc8;return function(_0xeeb5db){if(_0xeeb5db){return _0x1f3642[_0xe55d('0x1f')](_0xb09071)[_0xe55d('0x21')](_0xeeb5db);}};}function respondWithFilteredResult(_0x3a34c3,_0x1e68c0){return function(_0x2b18b){if(_0x2b18b){var _0x1da7ec=typeof _0x1e68c0['offset']===_0xe55d('0x22')&&typeof _0x1e68c0[_0xe55d('0x23')]===_0xe55d('0x22');var _0x1dc6bb=_0x2b18b['count'];var _0x566808=_0x1da7ec?0x0:_0x1e68c0['offset'];var _0x25d554=_0x1da7ec?_0x2b18b[_0xe55d('0x24')]:_0x1e68c0[_0xe55d('0x25')]+_0x1e68c0[_0xe55d('0x23')];var _0x1ca569;if(_0x25d554>=_0x1dc6bb){_0x25d554=_0x1dc6bb;_0x1ca569=0xc8;}else{_0x1ca569=0xce;}_0x3a34c3[_0xe55d('0x1f')](_0x1ca569);return _0x3a34c3[_0xe55d('0x26')](_0xe55d('0x27'),_0x566808+'-'+_0x25d554+'/'+_0x1dc6bb)['json'](_0x2b18b);}return null;};}function patchUpdates(_0xbeeda9){return function(_0x4fa17e){try{jsonpatch['apply'](_0x4fa17e,_0xbeeda9,!![]);}catch(_0x468854){return BPromise['reject'](_0x468854);}return _0x4fa17e[_0xe55d('0x28')]();};}function saveUpdates(_0x24c392,_0x23068b){return function(_0x438917){if(_0x438917){return _0x438917[_0xe55d('0x29')](_0x24c392)[_0xe55d('0x2a')](function(_0x11dfab){return _0x11dfab;});}return null;};}function removeEntity(_0x28d7cd,_0x5ed742){return function(_0x3e07bd){if(_0x3e07bd){return _0x3e07bd['destroy']()[_0xe55d('0x2a')](function(){var _0x1594a3=_0x3e07bd[_0xe55d('0x2b')]({'plain':!![]});var _0x57ce91='FaxQueues';return db[_0xe55d('0x2c')][_0xe55d('0x2d')]({'where':{'type':_0x57ce91,'resourceId':_0x1594a3['id']}})[_0xe55d('0x2a')](function(){return _0x3e07bd;});})[_0xe55d('0x2a')](function(){_0x28d7cd[_0xe55d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53ff6d,_0x3cab74){return function(_0x3780d4){if(!_0x3780d4){_0x53ff6d[_0xe55d('0x2e')](0x194);}return _0x3780d4;};}function handleError(_0x496a32,_0xf6f2cd){_0xf6f2cd=_0xf6f2cd||0x1f4;return function(_0x8edbed){logger[_0xe55d('0x2f')](_0x8edbed[_0xe55d('0x30')]);if(_0x8edbed[_0xe55d('0x31')]){delete _0x8edbed[_0xe55d('0x31')];}_0x496a32[_0xe55d('0x1f')](_0xf6f2cd)[_0xe55d('0x32')](_0x8edbed);};}exports[_0xe55d('0x33')]=function(_0x2a05b3,_0x209446){var _0x13f87a={},_0x3d0fde={},_0x4c84fd={'count':0x0,'rows':[]};var _0x89f547=_[_0xe55d('0x34')](db[_0xe55d('0x35')][_0xe55d('0x36')],function(_0x324d16){return{'name':_0x324d16['fieldName'],'type':_0x324d16['type'][_0xe55d('0x37')]};});_0x3d0fde[_0xe55d('0x38')]=_[_0xe55d('0x34')](_0x89f547,_0xe55d('0x31'));_0x3d0fde[_0xe55d('0x39')]=_[_0xe55d('0x3a')](_0x2a05b3[_0xe55d('0x39')]);_0x3d0fde[_0xe55d('0x3b')]=_[_0xe55d('0x3c')](_0x3d0fde['model'],_0x3d0fde[_0xe55d('0x39')]);_0x13f87a[_0xe55d('0x3d')]=_[_0xe55d('0x3c')](_0x3d0fde[_0xe55d('0x38')],qs[_0xe55d('0x3e')](_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x3e')]));_0x13f87a[_0xe55d('0x3d')]=_0x13f87a[_0xe55d('0x3d')][_0xe55d('0x3f')]?_0x13f87a['attributes']:_0x3d0fde['model'];if(!_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x40')](_0xe55d('0x41'))){_0x13f87a[_0xe55d('0x23')]=qs[_0xe55d('0x23')](_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x23')]);_0x13f87a[_0xe55d('0x25')]=qs['offset'](_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x25')]);}_0x13f87a[_0xe55d('0x42')]=qs[_0xe55d('0x43')](_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x43')]);_0x13f87a[_0xe55d('0x44')]=qs[_0xe55d('0x3b')](_[_0xe55d('0x45')](_0x2a05b3[_0xe55d('0x39')],_0x3d0fde[_0xe55d('0x3b')]),_0x89f547);if(_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x46')]){_0x13f87a[_0xe55d('0x44')]=_[_0xe55d('0x47')](_0x13f87a['where'],{'$or':_['map'](_0x89f547,function(_0x5f075e){if(_0x5f075e[_0xe55d('0x48')]!==_0xe55d('0x49')){var _0xbd7df9={};_0xbd7df9[_0x5f075e[_0xe55d('0x31')]]={'$like':'%'+_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x46')]+'%'};return _0xbd7df9;}})});}_0x13f87a=_[_0xe55d('0x47')]({},_0x13f87a,_0x2a05b3['options']);var _0x81f86c={'where':_0x13f87a[_0xe55d('0x44')]};return db[_0xe55d('0x35')]['count'](_0x81f86c)[_0xe55d('0x2a')](function(_0x3d808f){_0x4c84fd['count']=_0x3d808f;if(_0x2a05b3[_0xe55d('0x39')][_0xe55d('0x4a')]){_0x13f87a['include']=[{'all':!![]}];}return db[_0xe55d('0x35')][_0xe55d('0x4b')](_0x13f87a);})[_0xe55d('0x2a')](function(_0x13f0eb){_0x4c84fd[_0xe55d('0x4c')]=_0x13f0eb;return _0x4c84fd;})[_0xe55d('0x2a')](respondWithFilteredResult(_0x209446,_0x13f87a))['catch'](handleError(_0x209446,null));};exports[_0xe55d('0x4d')]=function(_0x26f81a,_0x1d295b){var _0x523781={'raw':!![],'where':{'id':_0x26f81a[_0xe55d('0x4e')]['id']}},_0x35cd69={};_0x35cd69[_0xe55d('0x38')]=_[_0xe55d('0x3a')](db[_0xe55d('0x35')]['rawAttributes']);_0x35cd69['query']=_[_0xe55d('0x3a')](_0x26f81a['query']);_0x35cd69['filters']=_[_0xe55d('0x3c')](_0x35cd69['model'],_0x35cd69[_0xe55d('0x39')]);_0x523781[_0xe55d('0x3d')]=_['intersection'](_0x35cd69[_0xe55d('0x38')],qs['fields'](_0x26f81a[_0xe55d('0x39')][_0xe55d('0x3e')]));_0x523781['attributes']=_0x523781[_0xe55d('0x3d')][_0xe55d('0x3f')]?_0x523781[_0xe55d('0x3d')]:_0x35cd69[_0xe55d('0x38')];if(_0x26f81a[_0xe55d('0x39')][_0xe55d('0x4a')]){_0x523781[_0xe55d('0x4f')]=[{'all':!![]}];}_0x523781=_[_0xe55d('0x47')]({},_0x523781,_0x26f81a[_0xe55d('0x50')]);return db[_0xe55d('0x35')][_0xe55d('0x51')](_0x523781)[_0xe55d('0x2a')](handleEntityNotFound(_0x1d295b,null))['then'](respondWithResult(_0x1d295b,null))[_0xe55d('0x52')](handleError(_0x1d295b,null));};exports[_0xe55d('0x53')]=function(_0x374ce2,_0x4ea3eb){return db[_0xe55d('0x35')][_0xe55d('0x53')](_0x374ce2[_0xe55d('0x54')],{})[_0xe55d('0x2a')](function(_0x822dd7){var _0x5958a7=_0x374ce2[_0xe55d('0x55')][_0xe55d('0x2b')]({'plain':!![]});if(!_0x5958a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5958a7[_0xe55d('0x56')]===_0xe55d('0x55')){var _0x2d3129=_0x822dd7['get']({'plain':!![]});var _0x5a7d7c=_0xe55d('0x57');return db['UserProfileSection'][_0xe55d('0x51')]({'where':{'name':_0x5a7d7c,'userProfileId':_0x5958a7[_0xe55d('0x58')]},'raw':!![]})['then'](function(_0x5e239a){if(_0x5e239a&&_0x5e239a['autoAssociation']===0x0){return db[_0xe55d('0x2c')]['create']({'name':_0x2d3129['name'],'resourceId':_0x2d3129['id'],'type':_0x5e239a[_0xe55d('0x31')],'sectionId':_0x5e239a['id']},{})[_0xe55d('0x2a')](function(){return _0x822dd7;});}else{return _0x822dd7;}})['catch'](function(_0x46bffe){logger[_0xe55d('0x2f')](_0xe55d('0x59'),_0x46bffe);throw _0x46bffe;});}return _0x822dd7;})[_0xe55d('0x2a')](respondWithResult(_0x4ea3eb,0xc9))[_0xe55d('0x52')](handleError(_0x4ea3eb,null));};exports[_0xe55d('0x29')]=function(_0xdd8228,_0x4f14f9){if(_0xdd8228[_0xe55d('0x54')]['id']){delete _0xdd8228[_0xe55d('0x54')]['id'];}return db[_0xe55d('0x35')][_0xe55d('0x51')]({'where':{'id':_0xdd8228[_0xe55d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f14f9,null))[_0xe55d('0x2a')](saveUpdates(_0xdd8228[_0xe55d('0x54')],null))[_0xe55d('0x2a')](respondWithResult(_0x4f14f9,null))['catch'](handleError(_0x4f14f9,null));};exports['destroy']=function(_0x4a2525,_0x8b7934){return db['FaxQueue'][_0xe55d('0x51')]({'where':{'id':_0x4a2525['params']['id']}})[_0xe55d('0x2a')](handleEntityNotFound(_0x8b7934,null))[_0xe55d('0x2a')](removeEntity(_0x8b7934,null))[_0xe55d('0x52')](handleError(_0x8b7934,null));};exports[_0xe55d('0x5a')]=function(_0x3402b5,_0x42de19){return db[_0xe55d('0x35')][_0xe55d('0x5a')]()['then'](respondWithResult(_0x42de19,null))[_0xe55d('0x52')](handleError(_0x42de19,null));};exports['getMembers']=function(_0x387356,_0x17da09,_0x5fa478){var _0x378ad3={'raw':!![],'where':{}},_0x558040={},_0x15a661;return db['FaxQueue'][_0xe55d('0x5b')]({'where':{'id':_0x387356['params']['id']}})[_0xe55d('0x2a')](handleEntityNotFound(_0x17da09,null))[_0xe55d('0x2a')](function(_0x1df8a1){if(_0x1df8a1){_0x15a661=_0x1df8a1[_0xe55d('0x2b')]({'plain':!![]});_0x558040['model']=_[_0xe55d('0x3a')](db[_0xe55d('0x5c')]['rawAttributes']);_0x558040[_0xe55d('0x39')]=_[_0xe55d('0x3a')](_0x387356[_0xe55d('0x39')]);_0x558040[_0xe55d('0x3b')]=_[_0xe55d('0x3c')](_0x558040[_0xe55d('0x38')],_0x558040[_0xe55d('0x39')]);_0x378ad3[_0xe55d('0x3d')]=_[_0xe55d('0x3c')](_0x558040[_0xe55d('0x38')],qs[_0xe55d('0x3e')](_0x387356['query'][_0xe55d('0x3e')]));_0x378ad3[_0xe55d('0x3d')]=_0x378ad3[_0xe55d('0x3d')][_0xe55d('0x3f')]?_0x378ad3['attributes']:_0x558040[_0xe55d('0x38')];if(!_0x387356[_0xe55d('0x39')][_0xe55d('0x40')](_0xe55d('0x41'))){_0x378ad3['limit']=qs[_0xe55d('0x23')](_0x387356[_0xe55d('0x39')][_0xe55d('0x23')]);_0x378ad3[_0xe55d('0x25')]=qs['offset'](_0x387356[_0xe55d('0x39')][_0xe55d('0x25')]);}_0x378ad3[_0xe55d('0x42')]=qs['sort'](_0x387356[_0xe55d('0x39')][_0xe55d('0x43')]);_0x378ad3[_0xe55d('0x44')]=qs[_0xe55d('0x3b')](_['pick'](_0x387356['query'],_0x558040[_0xe55d('0x3b')]));_0x378ad3[_0xe55d('0x44')][_0xe55d('0x5d')]=_0x1df8a1['id'];if(_0x387356[_0xe55d('0x39')][_0xe55d('0x46')]){_0x378ad3[_0xe55d('0x44')]=_['merge'](_0x378ad3[_0xe55d('0x44')],{'$or':_['map'](_0x378ad3['attributes'],function(_0x347f56){var _0x319077={};_0x319077[_0x347f56]={'$like':'%'+_0x387356['query'][_0xe55d('0x46')]+'%'};return _0x319077;})});}_0x378ad3=_[_0xe55d('0x47')]({},_0x378ad3,_0x387356[_0xe55d('0x50')]);return db['UserFaxQueue'][_0xe55d('0x4b')](_0x378ad3);}})[_0xe55d('0x2a')](function(_0x5670f1){if(_0x5670f1){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x5670f1,_0xe55d('0x5e')),'role':_0xe55d('0x5f')},'attributes':['id',_0xe55d('0x31'),_0xe55d('0x60'),'updatedAt',_0xe55d('0x61')]});}})['then'](function(_0x4d6fc5){if(_0x4d6fc5){return{'count':_0x4d6fc5['count'],'rows':_[_0xe55d('0x34')](_0x4d6fc5[_0xe55d('0x4c')],function(_0x20f387){return{'membername':_0x20f387['name'],'UserId':_0x20f387['id'],'queue_name':_0x15a661[_0xe55d('0x31')],'FaxQueueId':_0x15a661['id'],'interface':util[_0xe55d('0x62')](_0xe55d('0x63'),_0xe55d('0x64'),_0x20f387['name']),'penalty':0x0,'paused':_0x20f387[_0xe55d('0x60')],'createdAt':_0x20f387['createdAt'],'updatedAt':_0x20f387['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe55d('0x2a')](respondWithFilteredResult(_0x17da09,_0x378ad3))['catch'](handleError(_0x17da09,null));};exports[_0xe55d('0x65')]=function(_0x2e195d,_0x1f2147,_0x32db63){var _0xeb23a3={};var _0x51357b={};var _0x534f31;var _0x186734;return db[_0xe55d('0x35')][_0xe55d('0x5b')]({'where':{'id':_0x2e195d[_0xe55d('0x4e')]['id']}})[_0xe55d('0x2a')](handleEntityNotFound(_0x1f2147,null))[_0xe55d('0x2a')](function(_0x86ae77){if(_0x86ae77){_0x534f31=_0x86ae77;_0x51357b[_0xe55d('0x38')]=_[_0xe55d('0x3a')](db[_0xe55d('0x66')][_0xe55d('0x36')]);_0x51357b[_0xe55d('0x39')]=_[_0xe55d('0x3a')](_0x2e195d[_0xe55d('0x39')]);_0x51357b[_0xe55d('0x3b')]=_[_0xe55d('0x3c')](_0x51357b[_0xe55d('0x38')],_0x51357b[_0xe55d('0x39')]);_0xeb23a3['attributes']=_['intersection'](_0x51357b[_0xe55d('0x38')],qs[_0xe55d('0x3e')](_0x2e195d[_0xe55d('0x39')]['fields']));_0xeb23a3[_0xe55d('0x3d')]=_0xeb23a3[_0xe55d('0x3d')]['length']?_0xeb23a3[_0xe55d('0x3d')]:_0x51357b[_0xe55d('0x38')];_0xeb23a3[_0xe55d('0x42')]=qs[_0xe55d('0x43')](_0x2e195d[_0xe55d('0x39')][_0xe55d('0x43')]);_0xeb23a3[_0xe55d('0x44')]=qs['filters'](_[_0xe55d('0x45')](_0x2e195d[_0xe55d('0x39')],_0x51357b[_0xe55d('0x3b')]));if(_0x2e195d['query'][_0xe55d('0x46')]){_0xeb23a3[_0xe55d('0x44')]=_[_0xe55d('0x47')](_0xeb23a3[_0xe55d('0x44')],{'$or':_['map'](_0xeb23a3[_0xe55d('0x3d')],function(_0x3e1e2f){var _0x1da5b3={};_0x1da5b3[_0x3e1e2f]={'$like':'%'+_0x2e195d[_0xe55d('0x39')][_0xe55d('0x46')]+'%'};return _0x1da5b3;})});}_0xeb23a3=_[_0xe55d('0x47')]({},_0xeb23a3,_0x2e195d['options']);return _0x534f31[_0xe55d('0x65')](_0xeb23a3);}})[_0xe55d('0x2a')](function(_0x3ee9e7){if(_0x3ee9e7){_0x186734=_0x3ee9e7[_0xe55d('0x3f')];if(!_0x2e195d['query'][_0xe55d('0x40')](_0xe55d('0x41'))){_0xeb23a3['limit']=qs['limit'](_0x2e195d['query'][_0xe55d('0x23')]);_0xeb23a3[_0xe55d('0x25')]=qs[_0xe55d('0x25')](_0x2e195d[_0xe55d('0x39')][_0xe55d('0x25')]);}return _0x534f31[_0xe55d('0x65')](_0xeb23a3);}})[_0xe55d('0x2a')](function(_0xd188af){if(_0xd188af){return _0xd188af?{'count':_0x186734,'rows':_0xd188af}:null;}})[_0xe55d('0x2a')](respondWithResult(_0x1f2147,null))['catch'](handleError(_0x1f2147,null));};exports[_0xe55d('0x67')]=function(_0x5c5957,_0x576476,_0x4aa5e2){var _0x69aab7=_0x5c5957['body'][_0xe55d('0x68')];return db[_0xe55d('0x66')][_0xe55d('0x4b')]({'where':{'id':_0x69aab7},'attributes':['id'],'include':[{'model':db[_0xe55d('0x69')],'as':_0xe55d('0x6a'),'attributes':['id','name',_0xe55d('0x6b'),_0xe55d('0x6c'),_0xe55d('0x6d')],'raw':!![]}]})[_0xe55d('0x2a')](function(_0x24e9e5){if(_0x24e9e5){var _0x4396dd=_[_0xe55d('0x6e')](_0x24e9e5,function(_0x1db6db){var _0x152d00=_0x1db6db[_0xe55d('0x2b')]({'plain':!![]});return _0x152d00['Agents'];});return db[_0xe55d('0x35')][_0xe55d('0x51')]({'where':{'id':_0x5c5957[_0xe55d('0x4e')]['id']}})[_0xe55d('0x2a')](function(_0x421813){return db[_0xe55d('0x6f')][_0xe55d('0x70')](function(_0x3de861){return _0x421813[_0xe55d('0x67')](_0x69aab7,{'transaction':_0x3de861})[_0xe55d('0x2a')](function(){return BPromise['each'](_0x4396dd,function(_0x257b37){return db[_0xe55d('0x5c')]['findOrCreate']({'where':{'UserId':_0x257b37['id'],'FaxQueueId':_0x5c5957[_0xe55d('0x4e')]['id']},'transaction':_0x3de861});});})['then'](function(){_0x4396dd['forEach'](function(_0x5ec8cc){socket[_0xe55d('0x71')](_0xe55d('0x72'),{'UserId':_0x5ec8cc['id'],'FaxQueueId':_0x421813['id']});});});});});}})[_0xe55d('0x2a')](respondWithStatusCode(_0x576476,null))['catch'](handleError(_0x576476,null));};exports[_0xe55d('0x73')]=function(_0x2a5a13,_0x9932c4,_0x443e1e){return db[_0xe55d('0x66')][_0xe55d('0x4b')]({'where':{'id':_0x2a5a13[_0xe55d('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe55d('0x69')],'as':_0xe55d('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xe55d('0x2a')](handleEntityNotFound(_0x9932c4,null))[_0xe55d('0x2a')](function(_0x4c091d){var _0xe2671a=_[_0xe55d('0x34')](_0x4c091d,'id');var _0x4cf6bf=[];var _0x33d42f=[];var _0x401264=squel[_0xe55d('0x74')]();_0x401264[_0xe55d('0x75')](_0xe55d('0x76'))[_0xe55d('0x77')](_0xe55d('0x78'),'tq')[_0xe55d('0x79')]('user_has_teams','ut',_0xe55d('0x7a'))[_0xe55d('0x44')]('FaxQueueId\x20=\x20?',_0x2a5a13[_0xe55d('0x4e')]['id']);for(var _0x297d42=0x0;_0x297d42<_0x4c091d['length'];_0x297d42+=0x1){let _0x591641=_0x4c091d[_0x297d42];for(var _0x344856=0x0;_0x344856<_0x591641[_0xe55d('0x6a')][_0xe55d('0x3f')];_0x344856+=0x1){let _0x504c01=_0x591641['Agents'][_0x344856];var _0x396d78=_0x401264[_0xe55d('0x7b')]();_0x396d78[_0xe55d('0x44')](_0xe55d('0x7c'),_0x504c01['id']);_0x33d42f[_0xe55d('0x7d')](db[_0xe55d('0x6f')][_0xe55d('0x39')](_0x396d78[_0xe55d('0x7e')](),{'type':db['sequelize'][_0xe55d('0x7f')][_0xe55d('0x80')]})[_0xe55d('0x2a')](function(_0x2e97b6){if(_0x2e97b6[_0xe55d('0x3f')]===0x1){return _0x504c01['id'];}else{var _0x28f0f9=_[_0xe55d('0x81')](_[_0xe55d('0x34')](_0x2e97b6,'TeamId'),function(_0x39a518){return _[_0xe55d('0x82')](_0xe2671a,_0x39a518);});if(_0x28f0f9){return _0x504c01['id'];}}}));}}return BPromise[_0xe55d('0x83')](_0x33d42f)['then'](function(_0x3b63d0){_0x4cf6bf=_(_0x4cf6bf)[_0xe55d('0x84')](_0x3b63d0)[_0xe55d('0x85')]()[_0xe55d('0x86')]();return db[_0xe55d('0x35')][_0xe55d('0x51')]({'where':{'id':_0x2a5a13['params']['id']}})['then'](function(_0x40788c){return db[_0xe55d('0x6f')][_0xe55d('0x70')](function(_0x393214){return _0x40788c[_0xe55d('0x73')](_0x2a5a13[_0xe55d('0x39')]['ids'],{'transaction':_0x393214})[_0xe55d('0x2a')](function(){if(!_[_0xe55d('0x87')](_0x4cf6bf)){return _0x40788c[_0xe55d('0x88')](_0x4cf6bf,{'transaction':_0x393214});}})[_0xe55d('0x2a')](function(){_0x4cf6bf['forEach'](function(_0x51fc26){socket['emit']('userFaxQueue:remove',{'UserId':_0x51fc26,'FaxQueueId':_0x40788c['id']});});});});});});})['then'](respondWithStatusCode(_0x9932c4,null))[_0xe55d('0x52')](handleError(_0x9932c4,null));};exports['addAgents']=function(_0x4c49ff,_0xe9bf1b,_0x545a21){return db['FaxQueue'][_0xe55d('0x51')]({'where':{'id':_0x4c49ff[_0xe55d('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe9bf1b,null))[_0xe55d('0x2a')](function(_0x50f700){if(_0x50f700){return _0x50f700['addAgents'](_0x4c49ff[_0xe55d('0x54')][_0xe55d('0x68')],_['omit'](_0x4c49ff['body'],[_0xe55d('0x68'),'id'])||{})['spread'](function(_0x13904e){for(var _0xc4cba=0x0;_0xc4cba<_0x4c49ff[_0xe55d('0x54')][_0xe55d('0x68')][_0xe55d('0x3f')];_0xc4cba+=0x1){socket[_0xe55d('0x71')](_0xe55d('0x72'),{'UserId':Number(_0x4c49ff[_0xe55d('0x54')]['ids'][_0xc4cba]),'FaxQueueId':Number(_0x4c49ff['params']['id'])});}return _0x13904e;});}})[_0xe55d('0x2a')](respondWithResult(_0xe9bf1b,null))[_0xe55d('0x52')](handleError(_0xe9bf1b,null));};exports[_0xe55d('0x88')]=function(_0x382026,_0x903847,_0x4975b0){return db[_0xe55d('0x35')]['find']({'where':{'id':_0x382026[_0xe55d('0x4e')]['id']}})[_0xe55d('0x2a')](handleEntityNotFound(_0x903847,null))[_0xe55d('0x2a')](function(_0x5544e0){if(_0x5544e0){return _0x5544e0[_0xe55d('0x88')](_0x382026[_0xe55d('0x39')][_0xe55d('0x68')])[_0xe55d('0x2a')](function(){if(_[_0xe55d('0x89')](_0x382026[_0xe55d('0x39')]['ids'])){for(var _0x34a0dc=0x0;_0x34a0dc<_0x382026['query'][_0xe55d('0x68')][_0xe55d('0x3f')];_0x34a0dc+=0x1){socket[_0xe55d('0x71')](_0xe55d('0x8a'),{'UserId':Number(_0x382026[_0xe55d('0x39')][_0xe55d('0x68')][_0x34a0dc]),'FaxQueueId':Number(_0x382026[_0xe55d('0x4e')]['id'])});}}else{socket[_0xe55d('0x71')](_0xe55d('0x8a'),{'UserId':Number(_0x382026['query'][_0xe55d('0x68')]),'FaxQueueId':Number(_0x382026[_0xe55d('0x4e')]['id'])});}});}})[_0xe55d('0x2a')](respondWithStatusCode(_0x903847,null))[_0xe55d('0x52')](handleError(_0x903847,null));};exports[_0xe55d('0x8b')]=function(_0x15a6ea,_0x20c8c3,_0x383264){var _0x32053d={};var _0x4dca65={};var _0xd0c52;var _0x5491cb;return db[_0xe55d('0x35')]['findOne']({'where':{'id':_0x15a6ea[_0xe55d('0x4e')]['id']}})[_0xe55d('0x2a')](handleEntityNotFound(_0x20c8c3,null))[_0xe55d('0x2a')](function(_0x5dcace){if(_0x5dcace){_0xd0c52=_0x5dcace;_0x4dca65[_0xe55d('0x38')]=_['keys'](db[_0xe55d('0x69')]['rawAttributes']);_0x4dca65[_0xe55d('0x39')]=_[_0xe55d('0x3a')](_0x15a6ea[_0xe55d('0x39')]);_0x4dca65[_0xe55d('0x3b')]=_[_0xe55d('0x3c')](_0x4dca65[_0xe55d('0x38')],_0x4dca65[_0xe55d('0x39')]);_0x32053d['attributes']=_[_0xe55d('0x3c')](_0x4dca65[_0xe55d('0x38')],qs[_0xe55d('0x3e')](_0x15a6ea['query'][_0xe55d('0x3e')]));_0x32053d['attributes']=_0x32053d[_0xe55d('0x3d')][_0xe55d('0x3f')]?_0x32053d[_0xe55d('0x3d')]:_0x4dca65[_0xe55d('0x38')];_0x32053d[_0xe55d('0x42')]=qs['sort'](_0x15a6ea[_0xe55d('0x39')][_0xe55d('0x43')]);_0x32053d[_0xe55d('0x44')]=qs[_0xe55d('0x3b')](_[_0xe55d('0x45')](_0x15a6ea['query'],_0x4dca65[_0xe55d('0x3b')]));if(_0x15a6ea[_0xe55d('0x39')][_0xe55d('0x46')]){_0x32053d[_0xe55d('0x44')]=_[_0xe55d('0x47')](_0x32053d[_0xe55d('0x44')],{'$or':_[_0xe55d('0x34')](_0x32053d[_0xe55d('0x3d')],function(_0x588798){var _0x411b25={};_0x411b25[_0x588798]={'$like':'%'+_0x15a6ea[_0xe55d('0x39')]['filter']+'%'};return _0x411b25;})});}_0x32053d=_[_0xe55d('0x47')]({},_0x32053d,_0x15a6ea[_0xe55d('0x50')]);return _0xd0c52[_0xe55d('0x8b')](_0x32053d);}})[_0xe55d('0x2a')](function(_0x2f61bc){if(_0x2f61bc){_0x5491cb=_0x2f61bc['length'];if(!_0x15a6ea[_0xe55d('0x39')][_0xe55d('0x40')](_0xe55d('0x41'))){_0x32053d[_0xe55d('0x23')]=qs['limit'](_0x15a6ea[_0xe55d('0x39')][_0xe55d('0x23')]);_0x32053d[_0xe55d('0x25')]=qs[_0xe55d('0x25')](_0x15a6ea[_0xe55d('0x39')]['offset']);}return _0xd0c52['getAgents'](_0x32053d);}})[_0xe55d('0x2a')](function(_0x5ca031){if(_0x5ca031){return _0x5ca031?{'count':_0x5491cb,'rows':_0x5ca031}:null;}})[_0xe55d('0x2a')](respondWithResult(_0x20c8c3,null))[_0xe55d('0x52')](handleError(_0x20c8c3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 79a497e..e0f1932 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 _0x6f49=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x122519,_0x1b1675){var _0x29ab16=function(_0x37f28f){while(--_0x37f28f){_0x122519['push'](_0x122519['shift']());}};_0x29ab16(++_0x1b1675);}(_0x6f49,0xa1));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x96f4('0x0'));var FaxQueue=require(_0x96f4('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96f4('0x2'),'afterUpdate':_0x96f4('0x3'),'afterDestroy':_0x96f4('0x4')};function emitEvent(_0xec3219){return function(_0x5eafc8,_0x3ac03d,_0xfa257d){FaxQueueEvents[_0x96f4('0x5')](_0xec3219+':'+_0x5eafc8['id'],_0x5eafc8);FaxQueueEvents['emit'](_0xec3219,_0x5eafc8);_0xfa257d(null);};}for(var e in events){if(events[_0x96f4('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x96f4('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x6b03=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','remove'];(function(_0x26eadb,_0x246399){var _0x1c5a00=function(_0x3c1b4f){while(--_0x3c1b4f){_0x26eadb['push'](_0x26eadb['shift']());}};_0x1c5a00(++_0x246399);}(_0x6b03,0xea));var _0x36b0=function(_0x495a4d,_0x58bc54){_0x495a4d=_0x495a4d-0x0;var _0xa6cdd7=_0x6b03[_0x495a4d];return _0xa6cdd7;};'use strict';var EventEmitter=require(_0x36b0('0x0'));var FaxQueue=require(_0x36b0('0x1'))['db'][_0x36b0('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x36b0('0x3')](0x0);var events={'afterCreate':_0x36b0('0x4'),'afterUpdate':'update','afterDestroy':_0x36b0('0x5')};function emitEvent(_0x2b27a3){return function(_0x1bc70b,_0x447b78,_0x51728e){FaxQueueEvents[_0x36b0('0x6')](_0x2b27a3+':'+_0x1bc70b['id'],_0x1bc70b);FaxQueueEvents[_0x36b0('0x6')](_0x2b27a3,_0x1bc70b);_0x51728e(null);};}for(var e in events){if(events[_0x36b0('0x7')](e)){var event=events[e];FaxQueue[_0x36b0('0x8')](e,emitEvent(event));}}module[_0x36b0('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index d3a11bd..757c056 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 _0x480c=['path','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','util','api','request-promise'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x480c,0x178));var _0xc480=function(_0x1ae5dc,_0x31a664){_0x1ae5dc=_0x1ae5dc-0x0;var _0x137f77=_0x480c[_0x1ae5dc];return _0x137f77;};'use strict';var _=require(_0xc480('0x0'));var util=require(_0xc480('0x1'));var logger=require('../../config/logger')(_0xc480('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc480('0x3'));var fs=require('fs');var path=require(_0xc480('0x4'));var rimraf=require('rimraf');var config=require(_0xc480('0x5'));var attributes=require(_0xc480('0x6'));module['exports']=function(_0x5a7399,_0x1a81de){return _0x5a7399[_0xc480('0x7')](_0xc480('0x8'),attributes,{'tableName':_0xc480('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eaa=['FaxQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x0eaa,0x12d));var _0xa0ea=function(_0x2b84a7,_0xedf6d6){_0x2b84a7=_0x2b84a7-0x0;var _0x209cd4=_0x0eaa[_0x2b84a7];return _0x209cd4;};'use strict';var _=require('lodash');var util=require(_0xa0ea('0x0'));var logger=require(_0xa0ea('0x1'))(_0xa0ea('0x2'));var moment=require(_0xa0ea('0x3'));var BPromise=require(_0xa0ea('0x4'));var rp=require(_0xa0ea('0x5'));var fs=require('fs');var path=require(_0xa0ea('0x6'));var rimraf=require(_0xa0ea('0x7'));var config=require(_0xa0ea('0x8'));var attributes=require(_0xa0ea('0x9'));module[_0xa0ea('0xa')]=function(_0x1269fc,_0x3a0999){return _0x1269fc['define'](_0xa0ea('0xb'),attributes,{'tableName':'fax_queues','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 09f8ba9..da1fad8 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 _0x0aa8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','ShowFaxQueue','find','moment','bluebird','ioredis'];(function(_0x4e4253,_0x411609){var _0x52767f=function(_0x13750d){while(--_0x13750d){_0x4e4253['push'](_0x4e4253['shift']());}};_0x52767f(++_0x411609);}(_0x0aa8,0xc5));var _0x80aa=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x0aa8[_0xbebf50];return _0xce1496;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x80aa('0x0'));var BPromise=require(_0x80aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80aa('0x2'));var db=require(_0x80aa('0x3'))['db'];var utils=require(_0x80aa('0x4'));var logger=require(_0x80aa('0x5'))(_0x80aa('0x6'));var config=require(_0x80aa('0x7'));var jayson=require(_0x80aa('0x8'));var client=jayson[_0x80aa('0x9')][_0x80aa('0xa')]({'port':0x232a});config[_0x80aa('0xb')]=_['defaults'](config[_0x80aa('0xb')],{'host':_0x80aa('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80aa('0xb')]));require(_0x80aa('0xd'))[_0x80aa('0xe')](socket);function respondWithRpcPromise(_0x469105,_0x2e9b76,_0x26da65){return new BPromise(function(_0x40bc26,_0x54a860){return client[_0x80aa('0xf')](_0x469105,_0x26da65)['then'](function(_0x1bed99){logger['info'](_0x80aa('0x10'),_0x2e9b76,_0x80aa('0x11'));logger['debug'](_0x80aa('0x12'),_0x2e9b76,_0x80aa('0x11'),JSON['stringify'](_0x1bed99));if(_0x1bed99['error']){if(_0x1bed99[_0x80aa('0x13')]['code']===0x1f4){logger[_0x80aa('0x13')]('FaxQueue,\x20%s,\x20%s',_0x2e9b76,_0x1bed99[_0x80aa('0x13')]['message']);return _0x54a860(_0x1bed99[_0x80aa('0x13')][_0x80aa('0x14')]);}logger['error'](_0x80aa('0x10'),_0x2e9b76,_0x1bed99[_0x80aa('0x13')][_0x80aa('0x14')]);return _0x40bc26(_0x1bed99[_0x80aa('0x13')][_0x80aa('0x14')]);}else{logger[_0x80aa('0x15')](_0x80aa('0x10'),_0x2e9b76,_0x80aa('0x11'));_0x40bc26(_0x1bed99[_0x80aa('0x16')][_0x80aa('0x14')]);}})[_0x80aa('0x17')](function(_0x2a2c62){logger[_0x80aa('0x13')](_0x80aa('0x10'),_0x2e9b76,_0x2a2c62);_0x54a860(_0x2a2c62);});});}exports[_0x80aa('0x18')]=function(_0x340430){var _0x1775a4=this;return new Promise(function(_0x104d76,_0x5d71e2){return db[_0x80aa('0x19')][_0x80aa('0x1a')]({'raw':_0x340430[_0x80aa('0x1b')]?_0x340430[_0x80aa('0x1b')][_0x80aa('0x1c')]===undefined?!![]:![]:!![],'where':_0x340430['options']?_0x340430['options'][_0x80aa('0x1d')]||null:null,'attributes':_0x340430['options']?_0x340430[_0x80aa('0x1b')][_0x80aa('0x1e')]||null:null,'limit':_0x340430['options']?_0x340430[_0x80aa('0x1b')][_0x80aa('0x1f')]||null:null,'include':_0x340430[_0x80aa('0x1b')]?_0x340430['options'][_0x80aa('0x20')]?_[_0x80aa('0x21')](_0x340430[_0x80aa('0x1b')][_0x80aa('0x20')],function(_0x5bdf20){return{'model':db[_0x5bdf20[_0x80aa('0x22')]],'as':_0x5bdf20['as'],'attributes':_0x5bdf20[_0x80aa('0x1e')],'include':_0x5bdf20[_0x80aa('0x20')]?_[_0x80aa('0x21')](_0x5bdf20[_0x80aa('0x20')],function(_0x1128f4){return{'model':db[_0x1128f4[_0x80aa('0x22')]],'as':_0x1128f4['as'],'attributes':_0x1128f4[_0x80aa('0x1e')],'include':_0x1128f4[_0x80aa('0x20')]?_['map'](_0x1128f4[_0x80aa('0x20')],function(_0x334dc9){return{'model':db[_0x334dc9[_0x80aa('0x22')]],'as':_0x334dc9['as'],'attributes':_0x334dc9[_0x80aa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x80aa('0x23')](function(_0x46ec55){logger[_0x80aa('0x15')](_0x80aa('0x18'),_0x340430);logger[_0x80aa('0x24')](_0x80aa('0x18'),_0x340430,JSON[_0x80aa('0x25')](_0x46ec55));_0x104d76(_0x46ec55);})[_0x80aa('0x17')](function(_0x49fb3b){logger[_0x80aa('0x13')]('GetFaxQueue',_0x49fb3b[_0x80aa('0x14')],_0x340430);_0x5d71e2(_0x1775a4['error'](0x1f4,_0x49fb3b['message']));});});};exports[_0x80aa('0x26')]=function(_0x3dce47){var _0x525eb3=this;return new Promise(function(_0xd927fc,_0x3388b7){return db[_0x80aa('0x19')][_0x80aa('0x27')]({'raw':_0x3dce47[_0x80aa('0x1b')]?_0x3dce47[_0x80aa('0x1b')][_0x80aa('0x1c')]===undefined?!![]:![]:!![],'where':_0x3dce47['options']?_0x3dce47[_0x80aa('0x1b')][_0x80aa('0x1d')]||null:null,'attributes':_0x3dce47[_0x80aa('0x1b')]?_0x3dce47[_0x80aa('0x1b')][_0x80aa('0x1e')]||null:null,'include':_0x3dce47[_0x80aa('0x1b')]?_0x3dce47[_0x80aa('0x1b')][_0x80aa('0x20')]?_[_0x80aa('0x21')](_0x3dce47[_0x80aa('0x1b')][_0x80aa('0x20')],function(_0x16f200){return{'model':db[_0x16f200[_0x80aa('0x22')]],'as':_0x16f200['as'],'attributes':_0x16f200['attributes'],'include':_0x16f200[_0x80aa('0x20')]?_[_0x80aa('0x21')](_0x16f200[_0x80aa('0x20')],function(_0x9fff97){return{'model':db[_0x9fff97['model']],'as':_0x9fff97['as'],'attributes':_0x9fff97['attributes'],'include':_0x9fff97[_0x80aa('0x20')]?_[_0x80aa('0x21')](_0x9fff97[_0x80aa('0x20')],function(_0x39712d){return{'model':db[_0x39712d[_0x80aa('0x22')]],'as':_0x39712d['as'],'attributes':_0x39712d['attributes']};}):[]};}):[]};}):[]:[]})[_0x80aa('0x23')](function(_0x24b759){logger[_0x80aa('0x15')](_0x80aa('0x26'),_0x3dce47);logger[_0x80aa('0x24')](_0x80aa('0x26'),_0x3dce47,JSON[_0x80aa('0x25')](_0x24b759));_0xd927fc(_0x24b759);})['catch'](function(_0x54454f){logger[_0x80aa('0x13')](_0x80aa('0x26'),_0x54454f[_0x80aa('0x14')],_0x3dce47);_0x3388b7(_0x525eb3[_0x80aa('0x13')](0x1f4,_0x54454f[_0x80aa('0x14')]));});});}; \ No newline at end of file +var _0x0318=['request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetFaxQueue','catch','ShowFaxQueue','find','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./faxQueue.socket','request','FaxQueue,\x20%s,\x20%s'];(function(_0xa539ee,_0x3fdac5){var _0x22166c=function(_0x18d644){while(--_0x18d644){_0xa539ee['push'](_0xa539ee['shift']());}};_0x22166c(++_0x3fdac5);}(_0x0318,0xf0));var _0x8031=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0318[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8031('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8031('0x1'))['db'];var utils=require(_0x8031('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x8031('0x3'));var jayson=require(_0x8031('0x4'));var client=jayson[_0x8031('0x5')][_0x8031('0x6')]({'port':0x232a});config[_0x8031('0x7')]=_[_0x8031('0x8')](config[_0x8031('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8031('0x7')]));require(_0x8031('0x9'))['register'](socket);function respondWithRpcPromise(_0x269fc8,_0x42b0dc,_0x5860fe){return new BPromise(function(_0x20c7e8,_0x149c76){return client[_0x8031('0xa')](_0x269fc8,_0x5860fe)['then'](function(_0x2cbb3c){logger['info'](_0x8031('0xb'),_0x42b0dc,_0x8031('0xc'));logger[_0x8031('0xd')](_0x8031('0xe'),_0x42b0dc,_0x8031('0xc'),JSON[_0x8031('0xf')](_0x2cbb3c));if(_0x2cbb3c['error']){if(_0x2cbb3c[_0x8031('0x10')][_0x8031('0x11')]===0x1f4){logger[_0x8031('0x10')](_0x8031('0xb'),_0x42b0dc,_0x2cbb3c[_0x8031('0x10')]['message']);return _0x149c76(_0x2cbb3c['error']['message']);}logger[_0x8031('0x10')]('FaxQueue,\x20%s,\x20%s',_0x42b0dc,_0x2cbb3c['error'][_0x8031('0x12')]);return _0x20c7e8(_0x2cbb3c[_0x8031('0x10')][_0x8031('0x12')]);}else{logger[_0x8031('0x13')](_0x8031('0xb'),_0x42b0dc,_0x8031('0xc'));_0x20c7e8(_0x2cbb3c[_0x8031('0x14')]['message']);}})['catch'](function(_0x3c57ca){logger[_0x8031('0x10')](_0x8031('0xb'),_0x42b0dc,_0x3c57ca);_0x149c76(_0x3c57ca);});});}exports['GetFaxQueue']=function(_0x259129){var _0x1fb8cb=this;return new Promise(function(_0x542e21,_0x22b0e3){return db[_0x8031('0x15')][_0x8031('0x16')]({'raw':_0x259129[_0x8031('0x17')]?_0x259129['options'][_0x8031('0x18')]===undefined?!![]:![]:!![],'where':_0x259129[_0x8031('0x17')]?_0x259129['options'][_0x8031('0x19')]||null:null,'attributes':_0x259129[_0x8031('0x17')]?_0x259129[_0x8031('0x17')]['attributes']||null:null,'limit':_0x259129['options']?_0x259129[_0x8031('0x17')][_0x8031('0x1a')]||null:null,'include':_0x259129[_0x8031('0x17')]?_0x259129[_0x8031('0x17')][_0x8031('0x1b')]?_[_0x8031('0x1c')](_0x259129[_0x8031('0x17')][_0x8031('0x1b')],function(_0x27592a){return{'model':db[_0x27592a[_0x8031('0x1d')]],'as':_0x27592a['as'],'attributes':_0x27592a[_0x8031('0x1e')],'include':_0x27592a['include']?_[_0x8031('0x1c')](_0x27592a[_0x8031('0x1b')],function(_0x47967e){return{'model':db[_0x47967e['model']],'as':_0x47967e['as'],'attributes':_0x47967e[_0x8031('0x1e')],'include':_0x47967e['include']?_[_0x8031('0x1c')](_0x47967e[_0x8031('0x1b')],function(_0x55d2db){return{'model':db[_0x55d2db['model']],'as':_0x55d2db['as'],'attributes':_0x55d2db[_0x8031('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8031('0x1f')](function(_0x1de114){logger[_0x8031('0x13')](_0x8031('0x20'),_0x259129);logger[_0x8031('0xd')](_0x8031('0x20'),_0x259129,JSON['stringify'](_0x1de114));_0x542e21(_0x1de114);})[_0x8031('0x21')](function(_0x10b869){logger[_0x8031('0x10')](_0x8031('0x20'),_0x10b869['message'],_0x259129);_0x22b0e3(_0x1fb8cb['error'](0x1f4,_0x10b869[_0x8031('0x12')]));});});};exports[_0x8031('0x22')]=function(_0x3ce075){var _0x4c3798=this;return new Promise(function(_0x19e560,_0x2a60aa){return db[_0x8031('0x15')][_0x8031('0x23')]({'raw':_0x3ce075['options']?_0x3ce075[_0x8031('0x17')][_0x8031('0x18')]===undefined?!![]:![]:!![],'where':_0x3ce075[_0x8031('0x17')]?_0x3ce075['options']['where']||null:null,'attributes':_0x3ce075[_0x8031('0x17')]?_0x3ce075['options'][_0x8031('0x1e')]||null:null,'include':_0x3ce075['options']?_0x3ce075[_0x8031('0x17')][_0x8031('0x1b')]?_['map'](_0x3ce075[_0x8031('0x17')][_0x8031('0x1b')],function(_0x1125ae){return{'model':db[_0x1125ae[_0x8031('0x1d')]],'as':_0x1125ae['as'],'attributes':_0x1125ae['attributes'],'include':_0x1125ae[_0x8031('0x1b')]?_[_0x8031('0x1c')](_0x1125ae['include'],function(_0x3a1752){return{'model':db[_0x3a1752[_0x8031('0x1d')]],'as':_0x3a1752['as'],'attributes':_0x3a1752[_0x8031('0x1e')],'include':_0x3a1752[_0x8031('0x1b')]?_['map'](_0x3a1752[_0x8031('0x1b')],function(_0x7ea953){return{'model':db[_0x7ea953[_0x8031('0x1d')]],'as':_0x7ea953['as'],'attributes':_0x7ea953[_0x8031('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8031('0x1f')](function(_0x36bedd){logger[_0x8031('0x13')](_0x8031('0x22'),_0x3ce075);logger['debug'](_0x8031('0x22'),_0x3ce075,JSON[_0x8031('0xf')](_0x36bedd));_0x19e560(_0x36bedd);})[_0x8031('0x21')](function(_0x197215){logger['error'](_0x8031('0x22'),_0x197215['message'],_0x3ce075);_0x2a60aa(_0x4c3798[_0x8031('0x10')](0x1f4,_0x197215[_0x8031('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c2684a0..aaf8a39 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 _0x5d08=['./faxQueue.events','save','remove','emit','removeListener','register','length','faxQueue:'];(function(_0x13668c,_0x3aadb6){var _0x48ce38=function(_0x59c03b){while(--_0x59c03b){_0x13668c['push'](_0x13668c['shift']());}};_0x48ce38(++_0x3aadb6);}(_0x5d08,0x1e0));var _0x85d0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d08[_0x122ef9];return _0x42fba0;};'use strict';var FaxQueueEvents=require(_0x85d0('0x0'));var events=[_0x85d0('0x1'),_0x85d0('0x2'),'update'];function createListener(_0x424f5e,_0x29adc1){return function(_0x1cfd82){_0x29adc1[_0x85d0('0x3')](_0x424f5e,_0x1cfd82);};}function removeListener(_0x3bf916,_0x3fd0c2){return function(){FaxQueueEvents[_0x85d0('0x4')](_0x3bf916,_0x3fd0c2);};}exports[_0x85d0('0x5')]=function(_0x1963db){for(var _0x1f5e99=0x0,_0x5f4663=events[_0x85d0('0x6')];_0x1f5e99<_0x5f4663;_0x1f5e99++){var _0x2e4326=events[_0x1f5e99];var _0x306803=createListener(_0x85d0('0x7')+_0x2e4326,_0x1963db);FaxQueueEvents['on'](_0x2e4326,_0x306803);}}; \ No newline at end of file +var _0xe7e4=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','remove'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xe7e4,0x1be));var _0x4e7e=function(_0x3a3295,_0x572ab8){_0x3a3295=_0x3a3295-0x0;var _0x2fc7ff=_0xe7e4[_0x3a3295];return _0x2fc7ff;};'use strict';var FaxQueueEvents=require(_0x4e7e('0x0'));var events=['save',_0x4e7e('0x1'),_0x4e7e('0x2')];function createListener(_0x149bc2,_0x4adcf4){return function(_0x281097){_0x4adcf4[_0x4e7e('0x3')](_0x149bc2,_0x281097);};}function removeListener(_0x1afc5d,_0x59fd25){return function(){FaxQueueEvents[_0x4e7e('0x4')](_0x1afc5d,_0x59fd25);};}exports[_0x4e7e('0x5')]=function(_0x5cd189){for(var _0x4a6a07=0x0,_0x1f0fe3=events[_0x4e7e('0x6')];_0x4a6a07<_0x1f0fe3;_0x4a6a07++){var _0x508127=events[_0x4a6a07];var _0xec99b3=createListener(_0x4e7e('0x7')+_0x508127,_0x5cd189);FaxQueueEvents['on'](_0x508127,_0xec99b3);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ffd837f..32ece54 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 _0x3a6d=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','update','delete','removeTeams','exports','multer'];(function(_0x4207a1,_0x266b99){var _0x3e5df8=function(_0x1b17aa){while(--_0x1b17aa){_0x4207a1['push'](_0x4207a1['shift']());}};_0x3e5df8(++_0x266b99);}(_0x3a6d,0x143));var _0xd3a6=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x3a6d[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0x9')](_0xd3a6('0xf'),auth[_0xd3a6('0xa')](),controller['getMembers']);router[_0xd3a6('0x9')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);router[_0xd3a6('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xd3a6('0x12')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x13')]);router[_0xd3a6('0x12')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x14')]);router['post'](_0xd3a6('0x15'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x16')]);router['put'](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x17')]);router['delete'](_0xd3a6('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xd3a6('0x18')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x19')]);router[_0xd3a6('0x18')](_0xd3a6('0x15'),auth[_0xd3a6('0xa')](),controller['removeAgents']);module[_0xd3a6('0x1a')]=router; \ No newline at end of file +var _0x8aad=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','/:id/teams','removeTeams'];(function(_0x3a6dc7,_0x3c29b3){var _0x32dcb9=function(_0x2179e2){while(--_0x2179e2){_0x3a6dc7['push'](_0x3a6dc7['shift']());}};_0x32dcb9(++_0x3c29b3);}(_0x8aad,0x146));var _0xd8aa=function(_0x5962d9,_0x5cfa3b){_0x5962d9=_0x5962d9-0x0;var _0x11d8b9=_0x8aad[_0x5962d9];return _0x11d8b9;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/describe',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd8aa('0x8')](_0xd8aa('0xb'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0x8')]('/:id/teams',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x8')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd8aa('0x12')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0xa'),auth[_0xd8aa('0x6')](),controller['update']);router[_0xd8aa('0x15')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller[_0xd8aa('0x16')]);router[_0xd8aa('0x15')](_0xd8aa('0x17'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x18')]);router['delete'](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x19')]);module[_0xd8aa('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 4f386dd..cdf0723 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 _0xe292=['exports','STRING','DATE'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe292,0x19e));var _0x2e29=function(_0x18cc74,_0xf93919){_0x18cc74=_0x18cc74-0x0;var _0x3188e7=_0xe292[_0x18cc74];return _0x3188e7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2e29('0x0')]={'uniqueid':{'type':Sequelize[_0x2e29('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2e29('0x2')]},'acceptAt':{'type':Sequelize[_0x2e29('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa8f4=['STRING','DATE','sequelize','exports'];(function(_0x2db3d3,_0x5dc096){var _0xf00dbd=function(_0x172849){while(--_0x172849){_0x2db3d3['push'](_0x2db3d3['shift']());}};_0xf00dbd(++_0x5dc096);}(_0xa8f4,0x13e));var _0x4a8f=function(_0x5c76c5,_0x487ba7){_0x5c76c5=_0x5c76c5-0x0;var _0x102e10=_0xa8f4[_0x5c76c5];return _0x102e10;};'use strict';var moment=require('moment');var Sequelize=require(_0x4a8f('0x0'));module[_0x4a8f('0x1')]={'uniqueid':{'type':Sequelize[_0x4a8f('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4a8f('0x3')]},'leaveAt':{'type':Sequelize[_0x4a8f('0x3')]},'acceptAt':{'type':Sequelize[_0x4a8f('0x3')]},'exitAt':{'type':Sequelize[_0x4a8f('0x3')]},'reason':{'type':Sequelize[_0x4a8f('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 6e0fffd..905355f 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 _0x7dc2=['find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','catch','show','keys'];(function(_0x48b41d,_0x44c697){var _0x1e165b=function(_0xc1fa3a){while(--_0xc1fa3a){_0x48b41d['push'](_0x48b41d['shift']());}};_0x1e165b(++_0x44c697);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27dc('0x0'));var jsonpatch=require(_0x27dc('0x1'));var rp=require(_0x27dc('0x2'));var moment=require(_0x27dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27dc('0x4'));var util=require(_0x27dc('0x5'));var path=require('path');var sox=require(_0x27dc('0x6'));var csv=require(_0x27dc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27dc('0x8'));var _=require('lodash');var squel=require(_0x27dc('0x9'));var crypto=require(_0x27dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x27dc('0xb'));var toCsv=require(_0x27dc('0x7'));var querystring=require(_0x27dc('0xc'));var Papa=require(_0x27dc('0xd'));var Redis=require('ioredis');var authService=require(_0x27dc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x27dc('0xf'));var hardwareService=require(_0x27dc('0x10'));var logger=require(_0x27dc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x27dc('0x12'));var licenseUtil=require(_0x27dc('0x13'));var db=require(_0x27dc('0x14'))['db'];function respondWithStatusCode(_0x1c7a9e,_0x4d8afd){_0x4d8afd=_0x4d8afd||0xcc;return function(_0x2d7799){if(_0x2d7799){return _0x1c7a9e['sendStatus'](_0x4d8afd);}return _0x1c7a9e[_0x27dc('0x15')](_0x4d8afd)['end']();};}function respondWithResult(_0x1282f2,_0x22d9ac){_0x22d9ac=_0x22d9ac||0xc8;return function(_0x7972d8){if(_0x7972d8){return _0x1282f2[_0x27dc('0x15')](_0x22d9ac)['json'](_0x7972d8);}};}function respondWithFilteredResult(_0x110316,_0x1bd473){return function(_0x798f50){if(_0x798f50){var _0x4193f9=typeof _0x1bd473[_0x27dc('0x16')]==='undefined'&&typeof _0x1bd473[_0x27dc('0x17')]===_0x27dc('0x18');var _0x21f537=_0x798f50[_0x27dc('0x19')];var _0x5d308b=_0x4193f9?0x0:_0x1bd473[_0x27dc('0x16')];var _0x1ff9a2=_0x4193f9?_0x798f50[_0x27dc('0x19')]:_0x1bd473[_0x27dc('0x16')]+_0x1bd473[_0x27dc('0x17')];var _0x3dcfca;if(_0x1ff9a2>=_0x21f537){_0x1ff9a2=_0x21f537;_0x3dcfca=0xc8;}else{_0x3dcfca=0xce;}_0x110316[_0x27dc('0x15')](_0x3dcfca);return _0x110316[_0x27dc('0x1a')](_0x27dc('0x1b'),_0x5d308b+'-'+_0x1ff9a2+'/'+_0x21f537)[_0x27dc('0x1c')](_0x798f50);}return null;};}function patchUpdates(_0x5064d5){return function(_0x3b9afc){try{jsonpatch[_0x27dc('0x1d')](_0x3b9afc,_0x5064d5,!![]);}catch(_0x4bb946){return BPromise[_0x27dc('0x1e')](_0x4bb946);}return _0x3b9afc['save']();};}function saveUpdates(_0x5c0fca,_0x2843b1){return function(_0x4eddfe){if(_0x4eddfe){return _0x4eddfe[_0x27dc('0x1f')](_0x5c0fca)['then'](function(_0x4a7d2a){return _0x4a7d2a;});}return null;};}function removeEntity(_0x14fa88,_0x4a9da0){return function(_0x37917e){if(_0x37917e){return _0x37917e['destroy']()[_0x27dc('0x20')](function(){_0x14fa88[_0x27dc('0x15')](0xcc)[_0x27dc('0x21')]();});}};}function handleEntityNotFound(_0x19db16,_0x5205ed){return function(_0x473e2d){if(!_0x473e2d){_0x19db16['sendStatus'](0x194);}return _0x473e2d;};}function handleError(_0x4d91f7,_0x1409fd){_0x1409fd=_0x1409fd||0x1f4;return function(_0x25bfb7){logger['error'](_0x25bfb7[_0x27dc('0x22')]);if(_0x25bfb7[_0x27dc('0x23')]){delete _0x25bfb7[_0x27dc('0x23')];}_0x4d91f7[_0x27dc('0x15')](_0x1409fd)[_0x27dc('0x24')](_0x25bfb7);};}exports[_0x27dc('0x25')]=function(_0x76d54b,_0x15904d){var _0x1e751d={},_0xb4e273={},_0x295776={'count':0x0,'rows':[]};var _0x5ef2cc=_[_0x27dc('0x26')](db[_0x27dc('0x27')]['rawAttributes'],function(_0x14a8a1){return{'name':_0x14a8a1[_0x27dc('0x28')],'type':_0x14a8a1[_0x27dc('0x29')][_0x27dc('0x2a')]};});_0xb4e273['model']=_[_0x27dc('0x26')](_0x5ef2cc,_0x27dc('0x23'));_0xb4e273[_0x27dc('0x2b')]=_['keys'](_0x76d54b[_0x27dc('0x2b')]);_0xb4e273[_0x27dc('0x2c')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],_0xb4e273['query']);_0x1e751d[_0x27dc('0x2f')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],qs['fields'](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x1e751d[_0x27dc('0x2f')]=_0x1e751d[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x1e751d['attributes']:_0xb4e273[_0x27dc('0x2e')];if(!_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x32')](_0x27dc('0x33'))){_0x1e751d[_0x27dc('0x17')]=qs['limit'](_0x76d54b['query'][_0x27dc('0x17')]);_0x1e751d[_0x27dc('0x16')]=qs[_0x27dc('0x16')](_0x76d54b[_0x27dc('0x2b')]['offset']);}_0x1e751d['order']=qs[_0x27dc('0x34')](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x34')]);_0x1e751d['where']=qs[_0x27dc('0x2c')](_['pick'](_0x76d54b[_0x27dc('0x2b')],_0xb4e273['filters']),_0x5ef2cc);if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x35')]){_0x1e751d[_0x27dc('0x36')]=_[_0x27dc('0x37')](_0x1e751d[_0x27dc('0x36')],{'$or':_[_0x27dc('0x26')](_0x5ef2cc,function(_0x1f72fc){if(_0x1f72fc[_0x27dc('0x29')]!=='VIRTUAL'){var _0x3f017b={};_0x3f017b[_0x1f72fc[_0x27dc('0x23')]]={'$like':'%'+_0x76d54b['query'][_0x27dc('0x35')]+'%'};return _0x3f017b;}})});}_0x1e751d=_[_0x27dc('0x37')]({},_0x1e751d,_0x76d54b[_0x27dc('0x38')]);var _0x49fa10={'where':_0x1e751d[_0x27dc('0x36')]};return db[_0x27dc('0x27')][_0x27dc('0x19')](_0x49fa10)[_0x27dc('0x20')](function(_0x5800fa){_0x295776[_0x27dc('0x19')]=_0x5800fa;if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x39')]){_0x1e751d[_0x27dc('0x3a')]=[{'all':!![]}];}return db[_0x27dc('0x27')][_0x27dc('0x3b')](_0x1e751d);})['then'](function(_0x5066b5){_0x295776['rows']=_0x5066b5;return _0x295776;})[_0x27dc('0x20')](respondWithFilteredResult(_0x15904d,_0x1e751d))[_0x27dc('0x3c')](handleError(_0x15904d,null));};exports[_0x27dc('0x3d')]=function(_0xc15911,_0x4fcbe6){var _0x57b207={'raw':!![],'where':{'id':_0xc15911['params']['id']}},_0x725244={};_0x725244[_0x27dc('0x2e')]=_[_0x27dc('0x3e')](db[_0x27dc('0x27')]['rawAttributes']);_0x725244[_0x27dc('0x2b')]=_[_0x27dc('0x3e')](_0xc15911[_0x27dc('0x2b')]);_0x725244[_0x27dc('0x2c')]=_['intersection'](_0x725244[_0x27dc('0x2e')],_0x725244[_0x27dc('0x2b')]);_0x57b207['attributes']=_[_0x27dc('0x2d')](_0x725244[_0x27dc('0x2e')],qs[_0x27dc('0x30')](_0xc15911[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x57b207[_0x27dc('0x2f')]=_0x57b207[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x57b207[_0x27dc('0x2f')]:_0x725244['model'];if(_0xc15911[_0x27dc('0x2b')]['includeAll']){_0x57b207[_0x27dc('0x3a')]=[{'all':!![]}];}_0x57b207=_[_0x27dc('0x37')]({},_0x57b207,_0xc15911[_0x27dc('0x38')]);return db[_0x27dc('0x27')][_0x27dc('0x3f')](_0x57b207)['then'](handleEntityNotFound(_0x4fcbe6,null))[_0x27dc('0x20')](respondWithResult(_0x4fcbe6,null))[_0x27dc('0x3c')](handleError(_0x4fcbe6,null));};exports[_0x27dc('0x40')]=function(_0x255323,_0x1a3256){return db[_0x27dc('0x27')][_0x27dc('0x40')](_0x255323[_0x27dc('0x41')],{})[_0x27dc('0x20')](respondWithResult(_0x1a3256,0xc9))['catch'](handleError(_0x1a3256,null));};exports['update']=function(_0x8db62d,_0x37517d){if(_0x8db62d['body']['id']){delete _0x8db62d[_0x27dc('0x41')]['id'];}return db[_0x27dc('0x27')]['find']({'where':{'id':_0x8db62d['params']['id']}})['then'](handleEntityNotFound(_0x37517d,null))[_0x27dc('0x20')](saveUpdates(_0x8db62d['body'],null))['then'](respondWithResult(_0x37517d,null))[_0x27dc('0x3c')](handleError(_0x37517d,null));};exports[_0x27dc('0x42')]=function(_0x22f3df,_0x5ee5e3){return db[_0x27dc('0x27')][_0x27dc('0x3f')]({'where':{'id':_0x22f3df['params']['id']}})[_0x27dc('0x20')](handleEntityNotFound(_0x5ee5e3,null))[_0x27dc('0x20')](removeEntity(_0x5ee5e3,null))['catch'](handleError(_0x5ee5e3,null));};exports[_0x27dc('0x43')]=function(_0xb2eda0,_0x371516){return db[_0x27dc('0x27')][_0x27dc('0x43')]()[_0x27dc('0x20')](respondWithResult(_0x371516,null))['catch'](handleError(_0x371516,null));}; \ No newline at end of file +var _0xd6ce=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','index','FaxQueueReport','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','update','params','describe','eml-format'];(function(_0x5c91b3,_0xe53bfc){var _0x22e42b=function(_0x2b1014){while(--_0x2b1014){_0x5c91b3['push'](_0x5c91b3['shift']());}};_0x22e42b(++_0xe53bfc);}(_0xd6ce,0x127));var _0xed6c=function(_0x1e8a0c,_0x53521a){_0x1e8a0c=_0x1e8a0c-0x0;var _0x31223e=_0xd6ce[_0x1e8a0c];return _0x31223e;};'use strict';var emlformat=require(_0xed6c('0x0'));var rimraf=require(_0xed6c('0x1'));var zipdir=require(_0xed6c('0x2'));var jsonpatch=require(_0xed6c('0x3'));var rp=require(_0xed6c('0x4'));var moment=require(_0xed6c('0x5'));var BPromise=require(_0xed6c('0x6'));var Mustache=require(_0xed6c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xed6c('0x8'));var csv=require(_0xed6c('0x9'));var ejs=require(_0xed6c('0xa'));var fs=require('fs');var fs_extra=require(_0xed6c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed6c('0xc'));var jsforce=require(_0xed6c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed6c('0xe'));var Papa=require(_0xed6c('0xf'));var Redis=require(_0xed6c('0x10'));var authService=require(_0xed6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed6c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed6c('0x13'));var db=require(_0xed6c('0x14'))['db'];function respondWithStatusCode(_0x4efd40,_0x17e109){_0x17e109=_0x17e109||0xcc;return function(_0x55ea5e){if(_0x55ea5e){return _0x4efd40[_0xed6c('0x15')](_0x17e109);}return _0x4efd40[_0xed6c('0x16')](_0x17e109)['end']();};}function respondWithResult(_0x3f3126,_0x32a8c9){_0x32a8c9=_0x32a8c9||0xc8;return function(_0x46d807){if(_0x46d807){return _0x3f3126[_0xed6c('0x16')](_0x32a8c9)['json'](_0x46d807);}};}function respondWithFilteredResult(_0x57ec05,_0x2034d4){return function(_0x3d99b8){if(_0x3d99b8){var _0x156e84=typeof _0x2034d4['offset']===_0xed6c('0x17')&&typeof _0x2034d4['limit']===_0xed6c('0x17');var _0x326350=_0x3d99b8[_0xed6c('0x18')];var _0x1fe8c0=_0x156e84?0x0:_0x2034d4['offset'];var _0x387ba1=_0x156e84?_0x3d99b8[_0xed6c('0x18')]:_0x2034d4[_0xed6c('0x19')]+_0x2034d4['limit'];var _0x3f32a3;if(_0x387ba1>=_0x326350){_0x387ba1=_0x326350;_0x3f32a3=0xc8;}else{_0x3f32a3=0xce;}_0x57ec05[_0xed6c('0x16')](_0x3f32a3);return _0x57ec05[_0xed6c('0x1a')](_0xed6c('0x1b'),_0x1fe8c0+'-'+_0x387ba1+'/'+_0x326350)[_0xed6c('0x1c')](_0x3d99b8);}return null;};}function patchUpdates(_0x5e86ad){return function(_0x85aedf){try{jsonpatch['apply'](_0x85aedf,_0x5e86ad,!![]);}catch(_0x4a3fae){return BPromise[_0xed6c('0x1d')](_0x4a3fae);}return _0x85aedf[_0xed6c('0x1e')]();};}function saveUpdates(_0x34faac,_0x49a583){return function(_0x2fd94b){if(_0x2fd94b){return _0x2fd94b['update'](_0x34faac)[_0xed6c('0x1f')](function(_0x5ea6f4){return _0x5ea6f4;});}return null;};}function removeEntity(_0x7882e0,_0x21e0ba){return function(_0x51876b){if(_0x51876b){return _0x51876b[_0xed6c('0x20')]()[_0xed6c('0x1f')](function(){_0x7882e0[_0xed6c('0x16')](0xcc)[_0xed6c('0x21')]();});}};}function handleEntityNotFound(_0x27fb6c,_0x328af2){return function(_0x2bb6fc){if(!_0x2bb6fc){_0x27fb6c[_0xed6c('0x15')](0x194);}return _0x2bb6fc;};}function handleError(_0x58538b,_0x319d61){_0x319d61=_0x319d61||0x1f4;return function(_0x27484c){logger[_0xed6c('0x22')](_0x27484c[_0xed6c('0x23')]);if(_0x27484c[_0xed6c('0x24')]){delete _0x27484c[_0xed6c('0x24')];}_0x58538b['status'](_0x319d61)[_0xed6c('0x25')](_0x27484c);};}exports[_0xed6c('0x26')]=function(_0x3182ce,_0x4e0a5a){var _0x4e4373={},_0x531cd0={},_0x5172b2={'count':0x0,'rows':[]};var _0xb88247=_['map'](db[_0xed6c('0x27')]['rawAttributes'],function(_0x202b96){return{'name':_0x202b96[_0xed6c('0x28')],'type':_0x202b96['type'][_0xed6c('0x29')]};});_0x531cd0[_0xed6c('0x2a')]=_[_0xed6c('0x2b')](_0xb88247,_0xed6c('0x24'));_0x531cd0[_0xed6c('0x2c')]=_[_0xed6c('0x2d')](_0x3182ce['query']);_0x531cd0[_0xed6c('0x2e')]=_[_0xed6c('0x2f')](_0x531cd0['model'],_0x531cd0[_0xed6c('0x2c')]);_0x4e4373['attributes']=_[_0xed6c('0x2f')](_0x531cd0[_0xed6c('0x2a')],qs[_0xed6c('0x30')](_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x30')]));_0x4e4373[_0xed6c('0x31')]=_0x4e4373['attributes']['length']?_0x4e4373['attributes']:_0x531cd0[_0xed6c('0x2a')];if(!_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x32')]('nolimit')){_0x4e4373[_0xed6c('0x33')]=qs[_0xed6c('0x33')](_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x33')]);_0x4e4373[_0xed6c('0x19')]=qs[_0xed6c('0x19')](_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x19')]);}_0x4e4373[_0xed6c('0x34')]=qs[_0xed6c('0x35')](_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x35')]);_0x4e4373['where']=qs[_0xed6c('0x2e')](_[_0xed6c('0x36')](_0x3182ce[_0xed6c('0x2c')],_0x531cd0[_0xed6c('0x2e')]),_0xb88247);if(_0x3182ce['query'][_0xed6c('0x37')]){_0x4e4373[_0xed6c('0x38')]=_[_0xed6c('0x39')](_0x4e4373['where'],{'$or':_[_0xed6c('0x2b')](_0xb88247,function(_0x50381e){if(_0x50381e[_0xed6c('0x3a')]!==_0xed6c('0x3b')){var _0xbacc3c={};_0xbacc3c[_0x50381e['name']]={'$like':'%'+_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x37')]+'%'};return _0xbacc3c;}})});}_0x4e4373=_[_0xed6c('0x39')]({},_0x4e4373,_0x3182ce[_0xed6c('0x3c')]);var _0x18504a={'where':_0x4e4373[_0xed6c('0x38')]};return db[_0xed6c('0x27')][_0xed6c('0x18')](_0x18504a)[_0xed6c('0x1f')](function(_0x210aac){_0x5172b2[_0xed6c('0x18')]=_0x210aac;if(_0x3182ce[_0xed6c('0x2c')][_0xed6c('0x3d')]){_0x4e4373[_0xed6c('0x3e')]=[{'all':!![]}];}return db[_0xed6c('0x27')][_0xed6c('0x3f')](_0x4e4373);})['then'](function(_0x10d810){_0x5172b2[_0xed6c('0x40')]=_0x10d810;return _0x5172b2;})['then'](respondWithFilteredResult(_0x4e0a5a,_0x4e4373))[_0xed6c('0x41')](handleError(_0x4e0a5a,null));};exports[_0xed6c('0x42')]=function(_0x569d1c,_0x4afcd3){var _0x6bc8dc={'raw':!![],'where':{'id':_0x569d1c['params']['id']}},_0x177544={};_0x177544[_0xed6c('0x2a')]=_[_0xed6c('0x2d')](db['FaxQueueReport']['rawAttributes']);_0x177544[_0xed6c('0x2c')]=_[_0xed6c('0x2d')](_0x569d1c[_0xed6c('0x2c')]);_0x177544[_0xed6c('0x2e')]=_['intersection'](_0x177544[_0xed6c('0x2a')],_0x177544[_0xed6c('0x2c')]);_0x6bc8dc[_0xed6c('0x31')]=_[_0xed6c('0x2f')](_0x177544[_0xed6c('0x2a')],qs[_0xed6c('0x30')](_0x569d1c[_0xed6c('0x2c')][_0xed6c('0x30')]));_0x6bc8dc[_0xed6c('0x31')]=_0x6bc8dc['attributes'][_0xed6c('0x43')]?_0x6bc8dc['attributes']:_0x177544[_0xed6c('0x2a')];if(_0x569d1c[_0xed6c('0x2c')][_0xed6c('0x3d')]){_0x6bc8dc[_0xed6c('0x3e')]=[{'all':!![]}];}_0x6bc8dc=_['merge']({},_0x6bc8dc,_0x569d1c[_0xed6c('0x3c')]);return db['FaxQueueReport'][_0xed6c('0x44')](_0x6bc8dc)[_0xed6c('0x1f')](handleEntityNotFound(_0x4afcd3,null))[_0xed6c('0x1f')](respondWithResult(_0x4afcd3,null))[_0xed6c('0x41')](handleError(_0x4afcd3,null));};exports['create']=function(_0x160148,_0x369481){return db[_0xed6c('0x27')][_0xed6c('0x45')](_0x160148[_0xed6c('0x46')],{})[_0xed6c('0x1f')](respondWithResult(_0x369481,0xc9))[_0xed6c('0x41')](handleError(_0x369481,null));};exports[_0xed6c('0x47')]=function(_0x2475eb,_0x124616){if(_0x2475eb[_0xed6c('0x46')]['id']){delete _0x2475eb[_0xed6c('0x46')]['id'];}return db[_0xed6c('0x27')][_0xed6c('0x44')]({'where':{'id':_0x2475eb[_0xed6c('0x48')]['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x124616,null))[_0xed6c('0x1f')](saveUpdates(_0x2475eb['body'],null))[_0xed6c('0x1f')](respondWithResult(_0x124616,null))[_0xed6c('0x41')](handleError(_0x124616,null));};exports[_0xed6c('0x20')]=function(_0x3ce893,_0x2301fd){return db[_0xed6c('0x27')][_0xed6c('0x44')]({'where':{'id':_0x3ce893[_0xed6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2301fd,null))[_0xed6c('0x1f')](removeEntity(_0x2301fd,null))[_0xed6c('0x41')](handleError(_0x2301fd,null));};exports[_0xed6c('0x49')]=function(_0x366b0e,_0x2438aa){return db[_0xed6c('0x27')]['describe']()[_0xed6c('0x1f')](respondWithResult(_0x2438aa,null))[_0xed6c('0x41')](handleError(_0x2438aa,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c77d891..9c50f17 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1ea1a0,_0x1d093c){_0x1ea1a0=_0x1ea1a0-0x0;var _0x1c1e45=_0x1cb9[_0x1ea1a0];return _0x1c1e45;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x57fa26,_0x28112c){_0x57fa26=_0x57fa26-0x0;var _0x52b014=_0x1cb9[_0x57fa26];return _0x52b014;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 13593b0..b857709 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 _0xa50d=['message','info','request\x20sent','catch','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s'];(function(_0x172510,_0x45ad6b){var _0x5dcbca=function(_0x376eeb){while(--_0x376eeb){_0x172510['push'](_0x172510['shift']());}};_0x5dcbca(++_0x45ad6b);}(_0xa50d,0x1ba));var _0xda50=function(_0x220ce0,_0x1f6747){_0x220ce0=_0x220ce0-0x0;var _0x40ac6f=_0xa50d[_0x220ce0];return _0x40ac6f;};'use strict';var _=require(_0xda50('0x0'));var util=require(_0xda50('0x1'));var moment=require(_0xda50('0x2'));var BPromise=require('bluebird');var rs=require(_0xda50('0x3'));var fs=require('fs');var Redis=require(_0xda50('0x4'));var db=require(_0xda50('0x5'))['db'];var utils=require(_0xda50('0x6'));var logger=require(_0xda50('0x7'))(_0xda50('0x8'));var config=require(_0xda50('0x9'));var jayson=require(_0xda50('0xa'));var client=jayson['client'][_0xda50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43efd9,_0x361ea0,_0x47848d){return new BPromise(function(_0x3fa0ce,_0x4a82dc){return client[_0xda50('0xc')](_0x43efd9,_0x47848d)[_0xda50('0xd')](function(_0x464b55){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x361ea0,'request\x20sent');logger[_0xda50('0xe')](_0xda50('0xf'),_0x361ea0,'request\x20sent',JSON[_0xda50('0x10')](_0x464b55));if(_0x464b55[_0xda50('0x11')]){if(_0x464b55[_0xda50('0x11')][_0xda50('0x12')]===0x1f4){logger['error'](_0xda50('0x13'),_0x361ea0,_0x464b55[_0xda50('0x11')][_0xda50('0x14')]);return _0x4a82dc(_0x464b55[_0xda50('0x11')]['message']);}logger[_0xda50('0x11')](_0xda50('0x13'),_0x361ea0,_0x464b55[_0xda50('0x11')][_0xda50('0x14')]);return _0x3fa0ce(_0x464b55[_0xda50('0x11')][_0xda50('0x14')]);}else{logger[_0xda50('0x15')]('FaxQueueReport,\x20%s,\x20%s',_0x361ea0,_0xda50('0x16'));_0x3fa0ce(_0x464b55['result']['message']);}})[_0xda50('0x17')](function(_0x4ecc9f){logger[_0xda50('0x11')](_0xda50('0x13'),_0x361ea0,_0x4ecc9f);_0x4a82dc(_0x4ecc9f);});});}exports['CreateFaxQueueReport']=function(_0x5ec94d){var _0x117ee0=this;return new Promise(function(_0x33f5a0,_0x36f55a){return db[_0xda50('0x18')][_0xda50('0x19')](_0x5ec94d[_0xda50('0x1a')],{'raw':_0x5ec94d[_0xda50('0x1b')]?_0x5ec94d['options'][_0xda50('0x1c')]===undefined?!![]:![]:!![]})[_0xda50('0xd')](function(_0xc76fff){logger[_0xda50('0x15')]('CreateFaxQueueReport',_0x5ec94d);logger[_0xda50('0xe')]('CreateFaxQueueReport',_0x5ec94d,JSON[_0xda50('0x10')](_0xc76fff));_0x33f5a0(_0xc76fff);})[_0xda50('0x17')](function(_0x4bcd31){logger[_0xda50('0x11')]('CreateFaxQueueReport',_0x4bcd31[_0xda50('0x14')],_0x5ec94d);_0x36f55a(_0x117ee0[_0xda50('0x11')](0x1f4,_0x4bcd31[_0xda50('0x14')]));});});};exports[_0xda50('0x1d')]=function(_0x319467){var _0x567c8f=this;return new Promise(function(_0x54b486,_0x42d1df){return db['FaxQueueReport'][_0xda50('0x1e')](_0x319467['body'],{'raw':_0x319467['options']?_0x319467[_0xda50('0x1b')][_0xda50('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319467[_0xda50('0x1b')]?_0x319467[_0xda50('0x1b')][_0xda50('0x1f')]||null:null,'attributes':_0x319467[_0xda50('0x1b')]?_0x319467[_0xda50('0x1b')][_0xda50('0x20')]||null:null,'limit':_0x319467['options']?_0x319467[_0xda50('0x1b')]['limit']||null:null})[_0xda50('0xd')](function(_0x1088a7){logger[_0xda50('0x15')](_0xda50('0x1d'),_0x319467);logger[_0xda50('0xe')](_0xda50('0x1d'),_0x319467,JSON[_0xda50('0x10')](_0x1088a7));_0x54b486(_0x1088a7);})['catch'](function(_0x417725){logger['error']('UpdateFaxQueueReport',_0x417725[_0xda50('0x14')],_0x319467);_0x42d1df(_0x567c8f[_0xda50('0x11')](0x1f4,_0x417725[_0xda50('0x14')]));});});}; \ No newline at end of file +var _0x326f=['options','raw','where','attributes','limit','UpdateFaxQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body'];(function(_0x4ceaaf,_0x31053e){var _0x40ff6f=function(_0x4c6d30){while(--_0x4c6d30){_0x4ceaaf['push'](_0x4ceaaf['shift']());}};_0x40ff6f(++_0x31053e);}(_0x326f,0x188));var _0xf326=function(_0x21d250,_0x4d416c){_0x21d250=_0x21d250-0x0;var _0x10b8a4=_0x326f[_0x21d250];return _0x10b8a4;};'use strict';var _=require(_0xf326('0x0'));var util=require(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rs=require(_0xf326('0x4'));var fs=require('fs');var Redis=require(_0xf326('0x5'));var db=require(_0xf326('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')][_0xf326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57248c,_0x391414,_0x541746){return new BPromise(function(_0x43f895,_0x550c3f){return client[_0xf326('0xc')](_0x57248c,_0x541746)[_0xf326('0xd')](function(_0x143854){logger[_0xf326('0xe')](_0xf326('0xf'),_0x391414,_0xf326('0x10'));logger[_0xf326('0x11')](_0xf326('0x12'),_0x391414,_0xf326('0x10'),JSON['stringify'](_0x143854));if(_0x143854[_0xf326('0x13')]){if(_0x143854['error'][_0xf326('0x14')]===0x1f4){logger[_0xf326('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x391414,_0x143854['error'][_0xf326('0x15')]);return _0x550c3f(_0x143854[_0xf326('0x13')][_0xf326('0x15')]);}logger[_0xf326('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x391414,_0x143854[_0xf326('0x13')][_0xf326('0x15')]);return _0x43f895(_0x143854[_0xf326('0x13')][_0xf326('0x15')]);}else{logger[_0xf326('0xe')](_0xf326('0xf'),_0x391414,'request\x20sent');_0x43f895(_0x143854[_0xf326('0x16')][_0xf326('0x15')]);}})[_0xf326('0x17')](function(_0x13489a){logger[_0xf326('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x391414,_0x13489a);_0x550c3f(_0x13489a);});});}exports[_0xf326('0x18')]=function(_0x295dbd){var _0x121ee6=this;return new Promise(function(_0x43fb77,_0x2e710d){return db[_0xf326('0x19')][_0xf326('0x1a')](_0x295dbd[_0xf326('0x1b')],{'raw':_0x295dbd[_0xf326('0x1c')]?_0x295dbd['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x30cc90){logger[_0xf326('0xe')](_0xf326('0x18'),_0x295dbd);logger[_0xf326('0x11')](_0xf326('0x18'),_0x295dbd,JSON['stringify'](_0x30cc90));_0x43fb77(_0x30cc90);})[_0xf326('0x17')](function(_0x195b0b){logger[_0xf326('0x13')]('CreateFaxQueueReport',_0x195b0b[_0xf326('0x15')],_0x295dbd);_0x2e710d(_0x121ee6[_0xf326('0x13')](0x1f4,_0x195b0b['message']));});});};exports['UpdateFaxQueueReport']=function(_0x20f9bd){var _0x5e3058=this;return new Promise(function(_0x2217e3,_0x3edef8){return db['FaxQueueReport']['update'](_0x20f9bd[_0xf326('0x1b')],{'raw':_0x20f9bd[_0xf326('0x1c')]?_0x20f9bd[_0xf326('0x1c')][_0xf326('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20f9bd['options']?_0x20f9bd[_0xf326('0x1c')][_0xf326('0x1e')]||null:null,'attributes':_0x20f9bd[_0xf326('0x1c')]?_0x20f9bd[_0xf326('0x1c')][_0xf326('0x1f')]||null:null,'limit':_0x20f9bd['options']?_0x20f9bd[_0xf326('0x1c')][_0xf326('0x20')]||null:null})[_0xf326('0xd')](function(_0x48e324){logger[_0xf326('0xe')](_0xf326('0x21'),_0x20f9bd);logger['debug'](_0xf326('0x21'),_0x20f9bd,JSON[_0xf326('0x22')](_0x48e324));_0x2217e3(_0x48e324);})[_0xf326('0x17')](function(_0x1fb89f){logger[_0xf326('0x13')]('UpdateFaxQueueReport',_0x1fb89f[_0xf326('0x15')],_0x20f9bd);_0x3edef8(_0x5e3058[_0xf326('0x13')](0x1f4,_0x1fb89f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7ce0a33..c85884f 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 _0xd8db=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','describe','get','/:id','post','put','update','delete','util'];(function(_0x40f727,_0xd5ee50){var _0x27fc9b=function(_0x129a13){while(--_0x129a13){_0x40f727['push'](_0x40f727['shift']());}};_0x27fc9b(++_0xd5ee50);}(_0xd8db,0x10f));var _0xbd8d=function(_0x10ab33,_0x2baf3d){_0x10ab33=_0x10ab33-0x0;var _0x1b6f44=_0xd8db[_0x10ab33];return _0x1b6f44;};'use strict';var multer=require('multer');var util=require(_0xbd8d('0x0'));var path=require(_0xbd8d('0x1'));var timeout=require(_0xbd8d('0x2'));var express=require(_0xbd8d('0x3'));var router=express[_0xbd8d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd8d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd8d('0x6'));var controller=require(_0xbd8d('0x7'));router['get']('/',auth[_0xbd8d('0x8')](),controller[_0xbd8d('0x9')]);router['get']('/describe',auth[_0xbd8d('0x8')](),controller[_0xbd8d('0xa')]);router[_0xbd8d('0xb')](_0xbd8d('0xc'),auth[_0xbd8d('0x8')](),controller['show']);router[_0xbd8d('0xd')]('/',auth[_0xbd8d('0x8')](),controller['create']);router[_0xbd8d('0xe')](_0xbd8d('0xc'),auth[_0xbd8d('0x8')](),controller[_0xbd8d('0xf')]);router[_0xbd8d('0x10')](_0xbd8d('0xc'),auth[_0xbd8d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd853=['../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','exports','multer','util','Router','../../components/auth/service'];(function(_0x26eead,_0x821bc8){var _0x24e4ac=function(_0x51b4b1){while(--_0x51b4b1){_0x26eead['push'](_0x26eead['shift']());}};_0x24e4ac(++_0x821bc8);}(_0xd853,0xea));var _0x3d85=function(_0x2f0bf1,_0x183ef1){_0x2f0bf1=_0x2f0bf1-0x0;var _0xf1df38=_0xd853[_0x2f0bf1];return _0xf1df38;};'use strict';var multer=require(_0x3d85('0x0'));var util=require(_0x3d85('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3d85('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3d85('0x3'));var interaction=require(_0x3d85('0x4'));var config=require('../../config/environment');var controller=require(_0x3d85('0x5'));router[_0x3d85('0x6')]('/',auth[_0x3d85('0x7')](),controller[_0x3d85('0x8')]);router['get'](_0x3d85('0x9'),auth[_0x3d85('0x7')](),controller[_0x3d85('0xa')]);router[_0x3d85('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3d85('0xb')]('/',auth['isAuthenticated'](),controller[_0x3d85('0xc')]);router['put'](_0x3d85('0xd'),auth[_0x3d85('0x7')](),controller[_0x3d85('0xe')]);router[_0x3d85('0xf')](_0x3d85('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d85('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 173e4fe..45ff128 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5742b5,_0x771d9){var _0xfb7bab=function(_0x3e3211){while(--_0x3e3211){_0x5742b5['push'](_0x5742b5['shift']());}};_0xfb7bab(++_0x771d9);}(_0xaa88,0x137));var _0x8aa8=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0xaa88[_0x51ac09];return _0x3f827d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x36238d,_0x25543e){var _0x141fad=function(_0x285507){while(--_0x285507){_0x36238d['push'](_0x36238d['shift']());}};_0x141fad(++_0x25543e);}(_0xedd9,0xfc));var _0x9edd=function(_0x7d6eca,_0x59d54a){_0x7d6eca=_0x7d6eca-0x0;var _0x128263=_0xedd9[_0x7d6eca];return _0x128263;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f3b103f..e9845e4 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 _0xdc76=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','error','name','send','index','FaxTransferReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','include','rows','show','params','length','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdc76,0xd7));var _0x6dc7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdc76[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x6dc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dc7('0x1'));var jsonpatch=require(_0x6dc7('0x2'));var rp=require('request-promise');var moment=require(_0x6dc7('0x3'));var BPromise=require(_0x6dc7('0x4'));var Mustache=require(_0x6dc7('0x5'));var util=require(_0x6dc7('0x6'));var path=require(_0x6dc7('0x7'));var sox=require(_0x6dc7('0x8'));var csv=require(_0x6dc7('0x9'));var ejs=require(_0x6dc7('0xa'));var fs=require('fs');var fs_extra=require(_0x6dc7('0xb'));var _=require(_0x6dc7('0xc'));var squel=require(_0x6dc7('0xd'));var crypto=require(_0x6dc7('0xe'));var jsforce=require(_0x6dc7('0xf'));var deskjs=require(_0x6dc7('0x10'));var toCsv=require(_0x6dc7('0x9'));var querystring=require(_0x6dc7('0x11'));var Papa=require(_0x6dc7('0x12'));var Redis=require('ioredis');var authService=require(_0x6dc7('0x13'));var qs=require(_0x6dc7('0x14'));var as=require(_0x6dc7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc7('0x16'))(_0x6dc7('0x17'));var utils=require(_0x6dc7('0x18'));var config=require(_0x6dc7('0x19'));var licenseUtil=require(_0x6dc7('0x1a'));var db=require(_0x6dc7('0x1b'))['db'];function respondWithStatusCode(_0x5222b6,_0x4574a6){_0x4574a6=_0x4574a6||0xcc;return function(_0x2c5e5b){if(_0x2c5e5b){return _0x5222b6[_0x6dc7('0x1c')](_0x4574a6);}return _0x5222b6['status'](_0x4574a6)['end']();};}function respondWithResult(_0x31deca,_0x5d632d){_0x5d632d=_0x5d632d||0xc8;return function(_0x3c2cff){if(_0x3c2cff){return _0x31deca[_0x6dc7('0x1d')](_0x5d632d)[_0x6dc7('0x1e')](_0x3c2cff);}};}function respondWithFilteredResult(_0x141946,_0x186b50){return function(_0x4a43fe){if(_0x4a43fe){var _0x5b11e9=typeof _0x186b50['offset']==='undefined'&&typeof _0x186b50['limit']===_0x6dc7('0x1f');var _0xa2a6da=_0x4a43fe[_0x6dc7('0x20')];var _0x57088e=_0x5b11e9?0x0:_0x186b50[_0x6dc7('0x21')];var _0x99b97a=_0x5b11e9?_0x4a43fe[_0x6dc7('0x20')]:_0x186b50[_0x6dc7('0x21')]+_0x186b50[_0x6dc7('0x22')];var _0x3eb066;if(_0x99b97a>=_0xa2a6da){_0x99b97a=_0xa2a6da;_0x3eb066=0xc8;}else{_0x3eb066=0xce;}_0x141946[_0x6dc7('0x1d')](_0x3eb066);return _0x141946[_0x6dc7('0x23')](_0x6dc7('0x24'),_0x57088e+'-'+_0x99b97a+'/'+_0xa2a6da)[_0x6dc7('0x1e')](_0x4a43fe);}return null;};}function patchUpdates(_0x1b1caf){return function(_0x29f031){try{jsonpatch['apply'](_0x29f031,_0x1b1caf,!![]);}catch(_0x4e9bac){return BPromise[_0x6dc7('0x25')](_0x4e9bac);}return _0x29f031['save']();};}function saveUpdates(_0x5a933d,_0x44ebfa){return function(_0x535db4){if(_0x535db4){return _0x535db4[_0x6dc7('0x26')](_0x5a933d)[_0x6dc7('0x27')](function(_0x1d1168){return _0x1d1168;});}return null;};}function removeEntity(_0x2cbc8e,_0x5ddc2a){return function(_0x54e148){if(_0x54e148){return _0x54e148['destroy']()[_0x6dc7('0x27')](function(){_0x2cbc8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cef0c,_0x1bb84b){return function(_0x5c28fc){if(!_0x5c28fc){_0x1cef0c[_0x6dc7('0x1c')](0x194);}return _0x5c28fc;};}function handleError(_0x5ca743,_0x4fa26c){_0x4fa26c=_0x4fa26c||0x1f4;return function(_0x173fd3){logger[_0x6dc7('0x28')](_0x173fd3['stack']);if(_0x173fd3['name']){delete _0x173fd3[_0x6dc7('0x29')];}_0x5ca743[_0x6dc7('0x1d')](_0x4fa26c)[_0x6dc7('0x2a')](_0x173fd3);};}exports[_0x6dc7('0x2b')]=function(_0x3503a8,_0x18632a){var _0x59d967={},_0x2426c5={},_0x4f0bdd={'count':0x0,'rows':[]};var _0x85dae6=_['map'](db[_0x6dc7('0x2c')][_0x6dc7('0x2d')],function(_0x181536){return{'name':_0x181536[_0x6dc7('0x2e')],'type':_0x181536['type'][_0x6dc7('0x2f')]};});_0x2426c5[_0x6dc7('0x30')]=_[_0x6dc7('0x31')](_0x85dae6,_0x6dc7('0x29'));_0x2426c5[_0x6dc7('0x32')]=_[_0x6dc7('0x33')](_0x3503a8['query']);_0x2426c5['filters']=_[_0x6dc7('0x34')](_0x2426c5[_0x6dc7('0x30')],_0x2426c5[_0x6dc7('0x32')]);_0x59d967[_0x6dc7('0x35')]=_[_0x6dc7('0x34')](_0x2426c5[_0x6dc7('0x30')],qs[_0x6dc7('0x36')](_0x3503a8[_0x6dc7('0x32')]['fields']));_0x59d967[_0x6dc7('0x35')]=_0x59d967[_0x6dc7('0x35')]['length']?_0x59d967[_0x6dc7('0x35')]:_0x2426c5[_0x6dc7('0x30')];if(!_0x3503a8[_0x6dc7('0x32')][_0x6dc7('0x37')](_0x6dc7('0x38'))){_0x59d967[_0x6dc7('0x22')]=qs[_0x6dc7('0x22')](_0x3503a8[_0x6dc7('0x32')][_0x6dc7('0x22')]);_0x59d967[_0x6dc7('0x21')]=qs['offset'](_0x3503a8['query'][_0x6dc7('0x21')]);}_0x59d967['order']=qs[_0x6dc7('0x39')](_0x3503a8['query']['sort']);_0x59d967[_0x6dc7('0x3a')]=qs[_0x6dc7('0x3b')](_[_0x6dc7('0x3c')](_0x3503a8[_0x6dc7('0x32')],_0x2426c5[_0x6dc7('0x3b')]),_0x85dae6);if(_0x3503a8[_0x6dc7('0x32')][_0x6dc7('0x3d')]){_0x59d967[_0x6dc7('0x3a')]=_[_0x6dc7('0x3e')](_0x59d967['where'],{'$or':_[_0x6dc7('0x31')](_0x85dae6,function(_0x258fd3){if(_0x258fd3[_0x6dc7('0x3f')]!=='VIRTUAL'){var _0x3807e1={};_0x3807e1[_0x258fd3[_0x6dc7('0x29')]]={'$like':'%'+_0x3503a8[_0x6dc7('0x32')]['filter']+'%'};return _0x3807e1;}})});}_0x59d967=_[_0x6dc7('0x3e')]({},_0x59d967,_0x3503a8[_0x6dc7('0x40')]);var _0x51465a={'where':_0x59d967[_0x6dc7('0x3a')]};return db[_0x6dc7('0x2c')][_0x6dc7('0x20')](_0x51465a)[_0x6dc7('0x27')](function(_0x523f53){_0x4f0bdd[_0x6dc7('0x20')]=_0x523f53;if(_0x3503a8['query']['includeAll']){_0x59d967[_0x6dc7('0x41')]=[{'all':!![]}];}return db[_0x6dc7('0x2c')]['findAll'](_0x59d967);})['then'](function(_0x43301e){_0x4f0bdd[_0x6dc7('0x42')]=_0x43301e;return _0x4f0bdd;})[_0x6dc7('0x27')](respondWithFilteredResult(_0x18632a,_0x59d967))['catch'](handleError(_0x18632a,null));};exports[_0x6dc7('0x43')]=function(_0x4835c7,_0x40b3f0){var _0x5d9653={'raw':!![],'where':{'id':_0x4835c7[_0x6dc7('0x44')]['id']}},_0x383236={};_0x383236[_0x6dc7('0x30')]=_[_0x6dc7('0x33')](db[_0x6dc7('0x2c')][_0x6dc7('0x2d')]);_0x383236['query']=_[_0x6dc7('0x33')](_0x4835c7[_0x6dc7('0x32')]);_0x383236['filters']=_[_0x6dc7('0x34')](_0x383236[_0x6dc7('0x30')],_0x383236[_0x6dc7('0x32')]);_0x5d9653['attributes']=_['intersection'](_0x383236[_0x6dc7('0x30')],qs['fields'](_0x4835c7[_0x6dc7('0x32')]['fields']));_0x5d9653['attributes']=_0x5d9653[_0x6dc7('0x35')][_0x6dc7('0x45')]?_0x5d9653[_0x6dc7('0x35')]:_0x383236['model'];if(_0x4835c7[_0x6dc7('0x32')][_0x6dc7('0x46')]){_0x5d9653['include']=[{'all':!![]}];}_0x5d9653=_[_0x6dc7('0x3e')]({},_0x5d9653,_0x4835c7['options']);return db[_0x6dc7('0x2c')][_0x6dc7('0x47')](_0x5d9653)[_0x6dc7('0x27')](handleEntityNotFound(_0x40b3f0,null))['then'](respondWithResult(_0x40b3f0,null))[_0x6dc7('0x48')](handleError(_0x40b3f0,null));};exports[_0x6dc7('0x49')]=function(_0x102e28,_0x118bec){return db[_0x6dc7('0x2c')][_0x6dc7('0x49')](_0x102e28[_0x6dc7('0x4a')],{})[_0x6dc7('0x27')](respondWithResult(_0x118bec,0xc9))[_0x6dc7('0x48')](handleError(_0x118bec,null));};exports['update']=function(_0x50de0d,_0xcb5a47){if(_0x50de0d[_0x6dc7('0x4a')]['id']){delete _0x50de0d['body']['id'];}return db[_0x6dc7('0x2c')]['find']({'where':{'id':_0x50de0d['params']['id']}})[_0x6dc7('0x27')](handleEntityNotFound(_0xcb5a47,null))[_0x6dc7('0x27')](saveUpdates(_0x50de0d[_0x6dc7('0x4a')],null))['then'](respondWithResult(_0xcb5a47,null))['catch'](handleError(_0xcb5a47,null));};exports['destroy']=function(_0x505b44,_0x593e02){return db[_0x6dc7('0x2c')][_0x6dc7('0x47')]({'where':{'id':_0x505b44[_0x6dc7('0x44')]['id']}})[_0x6dc7('0x27')](handleEntityNotFound(_0x593e02,null))[_0x6dc7('0x27')](removeEntity(_0x593e02,null))['catch'](handleError(_0x593e02,null));};exports['describe']=function(_0x1d97ed,_0xc58ab2){return db[_0x6dc7('0x2c')][_0x6dc7('0x4b')]()[_0x6dc7('0x27')](respondWithResult(_0xc58ab2,null))[_0x6dc7('0x48')](handleError(_0xc58ab2,null));}; \ No newline at end of file +var _0x6bc6=['catch','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','update','destroy','then','name','index','map','FaxTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x6bc6,0x15b));var _0x66bc=function(_0x467b5d,_0x22ca71){_0x467b5d=_0x467b5d-0x0;var _0x3a64da=_0x6bc6[_0x467b5d];return _0x3a64da;};'use strict';var emlformat=require(_0x66bc('0x0'));var rimraf=require(_0x66bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66bc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x66bc('0x3'));var Mustache=require(_0x66bc('0x4'));var util=require('util');var path=require('path');var sox=require(_0x66bc('0x5'));var csv=require(_0x66bc('0x6'));var ejs=require(_0x66bc('0x7'));var fs=require('fs');var fs_extra=require(_0x66bc('0x8'));var _=require(_0x66bc('0x9'));var squel=require('squel');var crypto=require(_0x66bc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x66bc('0xb'));var toCsv=require(_0x66bc('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x66bc('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x66bc('0xd'));var hardwareService=require(_0x66bc('0xe'));var logger=require(_0x66bc('0xf'))(_0x66bc('0x10'));var utils=require(_0x66bc('0x11'));var config=require(_0x66bc('0x12'));var licenseUtil=require(_0x66bc('0x13'));var db=require(_0x66bc('0x14'))['db'];function respondWithStatusCode(_0x515515,_0x9078fd){_0x9078fd=_0x9078fd||0xcc;return function(_0x5de75a){if(_0x5de75a){return _0x515515[_0x66bc('0x15')](_0x9078fd);}return _0x515515[_0x66bc('0x16')](_0x9078fd)['end']();};}function respondWithResult(_0x7cff71,_0x3a5175){_0x3a5175=_0x3a5175||0xc8;return function(_0x18b5f1){if(_0x18b5f1){return _0x7cff71[_0x66bc('0x16')](_0x3a5175)[_0x66bc('0x17')](_0x18b5f1);}};}function respondWithFilteredResult(_0x580689,_0x3a3633){return function(_0x346879){if(_0x346879){var _0xed7875=typeof _0x3a3633['offset']===_0x66bc('0x18')&&typeof _0x3a3633['limit']==='undefined';var _0x22c59e=_0x346879['count'];var _0x13c8b8=_0xed7875?0x0:_0x3a3633[_0x66bc('0x19')];var _0x5c905a=_0xed7875?_0x346879['count']:_0x3a3633[_0x66bc('0x19')]+_0x3a3633[_0x66bc('0x1a')];var _0x53223c;if(_0x5c905a>=_0x22c59e){_0x5c905a=_0x22c59e;_0x53223c=0xc8;}else{_0x53223c=0xce;}_0x580689[_0x66bc('0x16')](_0x53223c);return _0x580689[_0x66bc('0x1b')](_0x66bc('0x1c'),_0x13c8b8+'-'+_0x5c905a+'/'+_0x22c59e)[_0x66bc('0x17')](_0x346879);}return null;};}function patchUpdates(_0x17faaa){return function(_0x548eae){try{jsonpatch[_0x66bc('0x1d')](_0x548eae,_0x17faaa,!![]);}catch(_0x400142){return BPromise[_0x66bc('0x1e')](_0x400142);}return _0x548eae['save']();};}function saveUpdates(_0x2f42a9,_0x4da2b9){return function(_0x36d19b){if(_0x36d19b){return _0x36d19b[_0x66bc('0x1f')](_0x2f42a9)['then'](function(_0x4dce89){return _0x4dce89;});}return null;};}function removeEntity(_0x4ac2cd,_0x1a2b45){return function(_0x396117){if(_0x396117){return _0x396117[_0x66bc('0x20')]()[_0x66bc('0x21')](function(){_0x4ac2cd[_0x66bc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488e73,_0x303ef1){return function(_0xc3c31f){if(!_0xc3c31f){_0x488e73[_0x66bc('0x15')](0x194);}return _0xc3c31f;};}function handleError(_0x385f67,_0x576acb){_0x576acb=_0x576acb||0x1f4;return function(_0x3cfdd9){logger['error'](_0x3cfdd9['stack']);if(_0x3cfdd9['name']){delete _0x3cfdd9[_0x66bc('0x22')];}_0x385f67[_0x66bc('0x16')](_0x576acb)['send'](_0x3cfdd9);};}exports[_0x66bc('0x23')]=function(_0x45ae1,_0x479d47){var _0x3fece8={},_0xbd90b7={},_0x509bbc={'count':0x0,'rows':[]};var _0x5a50d9=_[_0x66bc('0x24')](db[_0x66bc('0x25')][_0x66bc('0x26')],function(_0x1cae76){return{'name':_0x1cae76['fieldName'],'type':_0x1cae76['type'][_0x66bc('0x27')]};});_0xbd90b7[_0x66bc('0x28')]=_['map'](_0x5a50d9,_0x66bc('0x22'));_0xbd90b7[_0x66bc('0x29')]=_[_0x66bc('0x2a')](_0x45ae1[_0x66bc('0x29')]);_0xbd90b7[_0x66bc('0x2b')]=_[_0x66bc('0x2c')](_0xbd90b7[_0x66bc('0x28')],_0xbd90b7[_0x66bc('0x29')]);_0x3fece8[_0x66bc('0x2d')]=_[_0x66bc('0x2c')](_0xbd90b7[_0x66bc('0x28')],qs[_0x66bc('0x2e')](_0x45ae1['query']['fields']));_0x3fece8[_0x66bc('0x2d')]=_0x3fece8[_0x66bc('0x2d')][_0x66bc('0x2f')]?_0x3fece8['attributes']:_0xbd90b7[_0x66bc('0x28')];if(!_0x45ae1[_0x66bc('0x29')][_0x66bc('0x30')]('nolimit')){_0x3fece8[_0x66bc('0x1a')]=qs[_0x66bc('0x1a')](_0x45ae1[_0x66bc('0x29')]['limit']);_0x3fece8[_0x66bc('0x19')]=qs['offset'](_0x45ae1['query']['offset']);}_0x3fece8['order']=qs[_0x66bc('0x31')](_0x45ae1[_0x66bc('0x29')][_0x66bc('0x31')]);_0x3fece8[_0x66bc('0x32')]=qs[_0x66bc('0x2b')](_[_0x66bc('0x33')](_0x45ae1['query'],_0xbd90b7['filters']),_0x5a50d9);if(_0x45ae1[_0x66bc('0x29')][_0x66bc('0x34')]){_0x3fece8[_0x66bc('0x32')]=_[_0x66bc('0x35')](_0x3fece8['where'],{'$or':_[_0x66bc('0x24')](_0x5a50d9,function(_0x3baa45){if(_0x3baa45[_0x66bc('0x36')]!==_0x66bc('0x37')){var _0xb8de97={};_0xb8de97[_0x3baa45[_0x66bc('0x22')]]={'$like':'%'+_0x45ae1[_0x66bc('0x29')][_0x66bc('0x34')]+'%'};return _0xb8de97;}})});}_0x3fece8=_[_0x66bc('0x35')]({},_0x3fece8,_0x45ae1[_0x66bc('0x38')]);var _0x5fab68={'where':_0x3fece8[_0x66bc('0x32')]};return db[_0x66bc('0x25')][_0x66bc('0x39')](_0x5fab68)[_0x66bc('0x21')](function(_0x2c91c3){_0x509bbc['count']=_0x2c91c3;if(_0x45ae1[_0x66bc('0x29')][_0x66bc('0x3a')]){_0x3fece8['include']=[{'all':!![]}];}return db[_0x66bc('0x25')][_0x66bc('0x3b')](_0x3fece8);})[_0x66bc('0x21')](function(_0x37120){_0x509bbc[_0x66bc('0x3c')]=_0x37120;return _0x509bbc;})[_0x66bc('0x21')](respondWithFilteredResult(_0x479d47,_0x3fece8))[_0x66bc('0x3d')](handleError(_0x479d47,null));};exports['show']=function(_0x1ae816,_0x13752d){var _0x184489={'raw':!![],'where':{'id':_0x1ae816[_0x66bc('0x3e')]['id']}},_0x55780f={};_0x55780f[_0x66bc('0x28')]=_[_0x66bc('0x2a')](db[_0x66bc('0x25')][_0x66bc('0x26')]);_0x55780f[_0x66bc('0x29')]=_['keys'](_0x1ae816[_0x66bc('0x29')]);_0x55780f[_0x66bc('0x2b')]=_[_0x66bc('0x2c')](_0x55780f['model'],_0x55780f[_0x66bc('0x29')]);_0x184489[_0x66bc('0x2d')]=_[_0x66bc('0x2c')](_0x55780f[_0x66bc('0x28')],qs['fields'](_0x1ae816['query']['fields']));_0x184489['attributes']=_0x184489[_0x66bc('0x2d')]['length']?_0x184489['attributes']:_0x55780f[_0x66bc('0x28')];if(_0x1ae816[_0x66bc('0x29')][_0x66bc('0x3a')]){_0x184489[_0x66bc('0x3f')]=[{'all':!![]}];}_0x184489=_[_0x66bc('0x35')]({},_0x184489,_0x1ae816[_0x66bc('0x38')]);return db['FaxTransferReport'][_0x66bc('0x40')](_0x184489)[_0x66bc('0x21')](handleEntityNotFound(_0x13752d,null))[_0x66bc('0x21')](respondWithResult(_0x13752d,null))[_0x66bc('0x3d')](handleError(_0x13752d,null));};exports[_0x66bc('0x41')]=function(_0x397462,_0x3588f4){return db[_0x66bc('0x25')]['create'](_0x397462[_0x66bc('0x42')],{})[_0x66bc('0x21')](respondWithResult(_0x3588f4,0xc9))[_0x66bc('0x3d')](handleError(_0x3588f4,null));};exports[_0x66bc('0x1f')]=function(_0x52d772,_0x421605){if(_0x52d772[_0x66bc('0x42')]['id']){delete _0x52d772[_0x66bc('0x42')]['id'];}return db[_0x66bc('0x25')][_0x66bc('0x40')]({'where':{'id':_0x52d772['params']['id']}})[_0x66bc('0x21')](handleEntityNotFound(_0x421605,null))[_0x66bc('0x21')](saveUpdates(_0x52d772[_0x66bc('0x42')],null))['then'](respondWithResult(_0x421605,null))[_0x66bc('0x3d')](handleError(_0x421605,null));};exports[_0x66bc('0x20')]=function(_0x51661e,_0x40a694){return db[_0x66bc('0x25')][_0x66bc('0x40')]({'where':{'id':_0x51661e[_0x66bc('0x3e')]['id']}})[_0x66bc('0x21')](handleEntityNotFound(_0x40a694,null))[_0x66bc('0x21')](removeEntity(_0x40a694,null))[_0x66bc('0x3d')](handleError(_0x40a694,null));};exports[_0x66bc('0x43')]=function(_0x40fdc7,_0x1a4a9d){return db['FaxTransferReport'][_0x66bc('0x43')]()[_0x66bc('0x21')](respondWithResult(_0x1a4a9d,null))[_0x66bc('0x3d')](handleError(_0x1a4a9d,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 796a33f..777eb09 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 _0x0f58=['../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x470bde,_0xf4720d){var _0x47d4b7=function(_0x4d1b17){while(--_0x4d1b17){_0x470bde['push'](_0x470bde['shift']());}};_0x47d4b7(++_0xf4720d);}(_0x0f58,0x164));var _0x80f5=function(_0x3e779c,_0x546ea2){_0x3e779c=_0x3e779c-0x0;var _0x22ab11=_0x0f58[_0x3e779c];return _0x22ab11;};'use strict';var _=require(_0x80f5('0x0'));var util=require(_0x80f5('0x1'));var logger=require(_0x80f5('0x2'))(_0x80f5('0x3'));var moment=require(_0x80f5('0x4'));var BPromise=require('bluebird');var rp=require(_0x80f5('0x5'));var fs=require('fs');var path=require(_0x80f5('0x6'));var rimraf=require(_0x80f5('0x7'));var config=require(_0x80f5('0x8'));var attributes=require(_0x80f5('0x9'));module[_0x80f5('0xa')]=function(_0x105437,_0x418af5){return _0x105437[_0x80f5('0xb')]('FaxTransferReport',attributes,{'tableName':_0x80f5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x80f5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc1c=['../../config/logger','api','bluebird','path','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x254761,_0x550307){var _0x4236de=function(_0x13968e){while(--_0x13968e){_0x254761['push'](_0x254761['shift']());}};_0x4236de(++_0x550307);}(_0xbc1c,0x98));var _0xcbc1=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0xbc1c[_0x589eb4];return _0xf50816;};'use strict';var _=require(_0xcbc1('0x0'));var util=require(_0xcbc1('0x1'));var logger=require(_0xcbc1('0x2'))(_0xcbc1('0x3'));var moment=require('moment');var BPromise=require(_0xcbc1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbc1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module['exports']=function(_0x533988,_0x2e4f2b){return _0x533988[_0xcbc1('0x7')](_0xcbc1('0x8'),attributes,{'tableName':_0xcbc1('0x9'),'paranoid':![],'indexes':[{'name':_0xcbc1('0xa'),'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 3b12317..d4bca40 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 _0xb77d=['http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xb77d,0x68));var _0xdb77=function(_0x448e8d,_0x43a056){_0x448e8d=_0x448e8d-0x0;var _0x46e774=_0xb77d[_0x448e8d];return _0x46e774;};'use strict';var _=require(_0xdb77('0x0'));var util=require(_0xdb77('0x1'));var moment=require(_0xdb77('0x2'));var BPromise=require(_0xdb77('0x3'));var rs=require(_0xdb77('0x4'));var fs=require('fs');var Redis=require(_0xdb77('0x5'));var db=require(_0xdb77('0x6'))['db'];var utils=require(_0xdb77('0x7'));var logger=require(_0xdb77('0x8'))(_0xdb77('0x9'));var config=require('../../config/environment');var jayson=require(_0xdb77('0xa'));var client=jayson['client'][_0xdb77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58880e,_0x4639d4,_0x45d502){return new BPromise(function(_0x14b98e,_0x514653){return client[_0xdb77('0xc')](_0x58880e,_0x45d502)[_0xdb77('0xd')](function(_0x4592c2){logger[_0xdb77('0xe')](_0xdb77('0xf'),_0x4639d4,_0xdb77('0x10'));logger['debug'](_0xdb77('0x11'),_0x4639d4,_0xdb77('0x10'),JSON[_0xdb77('0x12')](_0x4592c2));if(_0x4592c2[_0xdb77('0x13')]){if(_0x4592c2[_0xdb77('0x13')][_0xdb77('0x14')]===0x1f4){logger[_0xdb77('0x13')](_0xdb77('0xf'),_0x4639d4,_0x4592c2[_0xdb77('0x13')]['message']);return _0x514653(_0x4592c2[_0xdb77('0x13')]['message']);}logger[_0xdb77('0x13')](_0xdb77('0xf'),_0x4639d4,_0x4592c2[_0xdb77('0x13')][_0xdb77('0x15')]);return _0x14b98e(_0x4592c2['error'][_0xdb77('0x15')]);}else{logger['info'](_0xdb77('0xf'),_0x4639d4,'request\x20sent');_0x14b98e(_0x4592c2[_0xdb77('0x16')][_0xdb77('0x15')]);}})['catch'](function(_0x468c08){logger[_0xdb77('0x13')](_0xdb77('0xf'),_0x4639d4,_0x468c08);_0x514653(_0x468c08);});});} \ No newline at end of file +var _0xf7c4=['FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x3f4f26,_0x1f3919){var _0x5753d5=function(_0x315eec){while(--_0x315eec){_0x3f4f26['push'](_0x3f4f26['shift']());}};_0x5753d5(++_0x1f3919);}(_0xf7c4,0x12a));var _0x4f7c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf7c4[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4f7c('0x0'));var util=require(_0x4f7c('0x1'));var moment=require(_0x4f7c('0x2'));var BPromise=require(_0x4f7c('0x3'));var rs=require(_0x4f7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f7c('0x6'))(_0x4f7c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4f7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b7247,_0x45f34f,_0xf04068){return new BPromise(function(_0x4a3a3c,_0xf4fded){return client[_0x4f7c('0x9')](_0x1b7247,_0xf04068)[_0x4f7c('0xa')](function(_0x10e2d5){logger[_0x4f7c('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x45f34f,_0x4f7c('0xc'));logger[_0x4f7c('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x45f34f,'request\x20sent',JSON[_0x4f7c('0xe')](_0x10e2d5));if(_0x10e2d5[_0x4f7c('0xf')]){if(_0x10e2d5[_0x4f7c('0xf')][_0x4f7c('0x10')]===0x1f4){logger[_0x4f7c('0xf')](_0x4f7c('0x11'),_0x45f34f,_0x10e2d5['error'][_0x4f7c('0x12')]);return _0xf4fded(_0x10e2d5[_0x4f7c('0xf')]['message']);}logger[_0x4f7c('0xf')](_0x4f7c('0x11'),_0x45f34f,_0x10e2d5[_0x4f7c('0xf')][_0x4f7c('0x12')]);return _0x4a3a3c(_0x10e2d5['error'][_0x4f7c('0x12')]);}else{logger[_0x4f7c('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x45f34f,_0x4f7c('0xc'));_0x4a3a3c(_0x10e2d5[_0x4f7c('0x13')]['message']);}})[_0x4f7c('0x14')](function(_0x329ebc){logger['error'](_0x4f7c('0x11'),_0x45f34f,_0x329ebc);_0xf4fded(_0x329ebc);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a1afecd..fef5dbf 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 _0x3e62=['create','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x224f88,_0xf0ceec){var _0x467011=function(_0x6a95f3){while(--_0x6a95f3){_0x224f88['push'](_0x224f88['shift']());}};_0x467011(++_0xf0ceec);}(_0x3e62,0xd5));var _0x23e6=function(_0x468978,_0x6b16ac){_0x468978=_0x468978-0x0;var _0x1eb09c=_0x3e62[_0x468978];return _0x1eb09c;};'use strict';var multer=require(_0x23e6('0x0'));var util=require(_0x23e6('0x1'));var path=require('path');var timeout=require(_0x23e6('0x2'));var express=require(_0x23e6('0x3'));var router=express['Router']();var fs_extra=require(_0x23e6('0x4'));var auth=require(_0x23e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x23e6('0x6'));var controller=require(_0x23e6('0x7'));router[_0x23e6('0x8')]('/',auth[_0x23e6('0x9')](),controller[_0x23e6('0xa')]);router[_0x23e6('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x23e6('0xb')]);router['get'](_0x23e6('0xc'),auth[_0x23e6('0x9')](),controller[_0x23e6('0xd')]);router[_0x23e6('0xe')]('/',auth[_0x23e6('0x9')](),controller[_0x23e6('0xf')]);router[_0x23e6('0x10')](_0x23e6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x23e6('0x11')](_0x23e6('0xc'),auth[_0x23e6('0x9')](),controller['destroy']);module[_0x23e6('0x12')]=router; \ No newline at end of file +var _0xff85=['express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy','exports','multer','path'];(function(_0x5ae1af,_0x3a3c68){var _0x57769c=function(_0x31e76b){while(--_0x31e76b){_0x5ae1af['push'](_0x5ae1af['shift']());}};_0x57769c(++_0x3a3c68);}(_0xff85,0x1b8));var _0x5ff8=function(_0x35e3eb,_0x2cb9dd){_0x35e3eb=_0x35e3eb-0x0;var _0x354733=_0xff85[_0x35e3eb];return _0x354733;};'use strict';var multer=require(_0x5ff8('0x0'));var util=require('util');var path=require(_0x5ff8('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ff8('0x2'));var router=express[_0x5ff8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ff8('0x4'));var config=require(_0x5ff8('0x5'));var controller=require('./faxTransferReport.controller');router[_0x5ff8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5ff8('0x7'),auth[_0x5ff8('0x8')](),controller[_0x5ff8('0x9')]);router['get'](_0x5ff8('0xa'),auth[_0x5ff8('0x8')](),controller[_0x5ff8('0xb')]);router['post']('/',auth[_0x5ff8('0x8')](),controller[_0x5ff8('0xc')]);router[_0x5ff8('0xd')](_0x5ff8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5ff8('0xe')](_0x5ff8('0xa'),auth['isAuthenticated'](),controller[_0x5ff8('0xf')]);module[_0x5ff8('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 431b94e..960b759 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 _0xb6b6=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x23ec4c,_0x3cde1e){var _0x3b58be=function(_0x423106){while(--_0x423106){_0x23ec4c['push'](_0x23ec4c['shift']());}};_0x3b58be(++_0x3cde1e);}(_0xb6b6,0xe6));var _0x6b6b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb6b6[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0x6b6b('0x0'));var path=require('path');var timeout=require(_0x6b6b('0x1'));var express=require(_0x6b6b('0x2'));var router=express[_0x6b6b('0x3')]();var fs_extra=require(_0x6b6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6b6b('0x5'));var config=require(_0x6b6b('0x6'));var controller=require(_0x6b6b('0x7'));router[_0x6b6b('0x8')]('/',auth['isAuthenticated'](),controller[_0x6b6b('0x9')]);router[_0x6b6b('0x8')](_0x6b6b('0xa'),auth[_0x6b6b('0xb')](),controller[_0x6b6b('0xc')]);router[_0x6b6b('0x8')](_0x6b6b('0xd'),auth[_0x6b6b('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6b6b('0xb')](),controller[_0x6b6b('0xe')]);router[_0x6b6b('0xf')]('/',auth[_0x6b6b('0xb')](),controller[_0x6b6b('0x10')]);router[_0x6b6b('0xf')](_0x6b6b('0xd'),auth[_0x6b6b('0xb')](),controller[_0x6b6b('0x11')]);router[_0x6b6b('0x12')]('/:id',auth[_0x6b6b('0xb')](),controller[_0x6b6b('0x13')]);router[_0x6b6b('0x14')](_0x6b6b('0xa'),auth['isAuthenticated'](),controller[_0x6b6b('0x15')]);module[_0x6b6b('0x16')]=router; \ No newline at end of file +var _0x6c78=['isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../config/environment','./intDeskAccount.controller'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x6c78,0x1d9));var _0x86c7=function(_0x3d6e1d,_0x575ffa){_0x3d6e1d=_0x3d6e1d-0x0;var _0x1f6645=_0x6c78[_0x3d6e1d];return _0x1f6645;};'use strict';var multer=require(_0x86c7('0x0'));var util=require(_0x86c7('0x1'));var path=require(_0x86c7('0x2'));var timeout=require(_0x86c7('0x3'));var express=require('express');var router=express[_0x86c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x86c7('0x5'));var controller=require(_0x86c7('0x6'));router['get']('/',auth[_0x86c7('0x7')](),controller[_0x86c7('0x8')]);router[_0x86c7('0x9')]('/:id',auth[_0x86c7('0x7')](),controller[_0x86c7('0xa')]);router[_0x86c7('0x9')](_0x86c7('0xb'),auth[_0x86c7('0x7')](),controller[_0x86c7('0xc')]);router[_0x86c7('0x9')]('/:id/fields',auth[_0x86c7('0x7')](),controller[_0x86c7('0xd')]);router[_0x86c7('0xe')]('/',auth[_0x86c7('0x7')](),controller[_0x86c7('0xf')]);router['post'](_0x86c7('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x86c7('0x10')]('/:id',auth[_0x86c7('0x7')](),controller[_0x86c7('0x11')]);router[_0x86c7('0x12')]('/:id',auth[_0x86c7('0x7')](),controller[_0x86c7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 123aa5a..96733ae 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 _0xa9bd=['STRING','ENUM','integrationTab','exports'];(function(_0x4c0d9b,_0x4865ec){var _0x421013=function(_0x55c3e1){while(--_0x55c3e1){_0x4c0d9b['push'](_0x4c0d9b['shift']());}};_0x421013(++_0x4865ec);}(_0xa9bd,0xfb));var _0xda9b=function(_0x344586,_0x227672){_0x344586=_0x344586-0x0;var _0x1400b2=_0xa9bd[_0x344586];return _0x1400b2;};'use strict';var Sequelize=require('sequelize');module[_0xda9b('0x0')]={'name':{'type':Sequelize[_0xda9b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xda9b('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xda9b('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xda9b('0x1')]},'tokenSecret':{'type':Sequelize[_0xda9b('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xda9b('0x2')]('integrationTab','newTab'),'defaultValue':_0xda9b('0x3')}}; \ No newline at end of file +var _0xa2f5=['newTab','integrationTab','STRING','ENUM','basic'];(function(_0x72c924,_0x21ba61){var _0x5a56a8=function(_0x2f20ed){while(--_0x2f20ed){_0x72c924['push'](_0x72c924['shift']());}};_0x5a56a8(++_0x21ba61);}(_0xa2f5,0x1e2));var _0x5a2f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa2f5[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5a2f('0x0')]},'username':{'type':Sequelize[_0x5a2f('0x0')]},'remoteUri':{'type':Sequelize[_0x5a2f('0x0')]},'authType':{'type':Sequelize[_0x5a2f('0x1')]('basic'),'defaultValue':_0x5a2f('0x2')},'password':{'type':Sequelize[_0x5a2f('0x0')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x5a2f('0x0')]},'token':{'type':Sequelize[_0x5a2f('0x0')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5a2f('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x5a2f('0x1')]('integrationTab',_0x5a2f('0x3')),'defaultValue':_0x5a2f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7a11624..b59fa57 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 _0xec7b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','name','includeAll','DeskAccount','findAll','rows','catch','show','params','keys','include','options','create','body','find','getConfigurations','findOne','DeskConfiguration','order','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xec7b,0x1bf));var _0xbec7=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xec7b[_0x593752];return _0x4612be;};'use strict';var emlformat=require(_0xbec7('0x0'));var rimraf=require(_0xbec7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbec7('0x2'));var moment=require('moment');var BPromise=require(_0xbec7('0x3'));var Mustache=require(_0xbec7('0x4'));var util=require(_0xbec7('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbec7('0x6'));var _=require(_0xbec7('0x7'));var squel=require(_0xbec7('0x8'));var crypto=require(_0xbec7('0x9'));var jsforce=require(_0xbec7('0xa'));var deskjs=require(_0xbec7('0xb'));var toCsv=require(_0xbec7('0xc'));var querystring=require(_0xbec7('0xd'));var Papa=require(_0xbec7('0xe'));var Redis=require(_0xbec7('0xf'));var authService=require(_0xbec7('0x10'));var qs=require(_0xbec7('0x11'));var as=require(_0xbec7('0x12'));var hardwareService=require(_0xbec7('0x13'));var logger=require(_0xbec7('0x14'))(_0xbec7('0x15'));var utils=require(_0xbec7('0x16'));var config=require(_0xbec7('0x17'));var licenseUtil=require(_0xbec7('0x18'));var db=require(_0xbec7('0x19'))['db'];var integrations=require(_0xbec7('0x1a'));function respondWithStatusCode(_0x1aa2db,_0x33195e){_0x33195e=_0x33195e||0xcc;return function(_0x5be042){if(_0x5be042){return _0x1aa2db[_0xbec7('0x1b')](_0x33195e);}return _0x1aa2db[_0xbec7('0x1c')](_0x33195e)[_0xbec7('0x1d')]();};}function respondWithResult(_0x17b95a,_0x2980ab){_0x2980ab=_0x2980ab||0xc8;return function(_0xa4d2f6){if(_0xa4d2f6){return _0x17b95a['status'](_0x2980ab)[_0xbec7('0x1e')](_0xa4d2f6);}};}function respondWithFilteredResult(_0x1495a4,_0x120f44){return function(_0x5c8ca5){if(_0x5c8ca5){var _0x31d698=typeof _0x120f44['offset']===_0xbec7('0x1f')&&typeof _0x120f44['limit']===_0xbec7('0x1f');var _0xa09c87=_0x5c8ca5[_0xbec7('0x20')];var _0x302bc0=_0x31d698?0x0:_0x120f44[_0xbec7('0x21')];var _0x5532b9=_0x31d698?_0x5c8ca5[_0xbec7('0x20')]:_0x120f44['offset']+_0x120f44[_0xbec7('0x22')];var _0x291fc5;if(_0x5532b9>=_0xa09c87){_0x5532b9=_0xa09c87;_0x291fc5=0xc8;}else{_0x291fc5=0xce;}_0x1495a4['status'](_0x291fc5);return _0x1495a4['set'](_0xbec7('0x23'),_0x302bc0+'-'+_0x5532b9+'/'+_0xa09c87)['json'](_0x5c8ca5);}return null;};}function patchUpdates(_0x5826bd){return function(_0x58f34a){try{jsonpatch['apply'](_0x58f34a,_0x5826bd,!![]);}catch(_0x4cf975){return BPromise[_0xbec7('0x24')](_0x4cf975);}return _0x58f34a[_0xbec7('0x25')]();};}function saveUpdates(_0x404ec5,_0x4a280d){return function(_0x4f2336){if(_0x4f2336){return _0x4f2336['update'](_0x404ec5)[_0xbec7('0x26')](function(_0x3276e3){return _0x3276e3;});}return null;};}function removeEntity(_0x425503,_0x4b7d62){return function(_0x1a5cd3){if(_0x1a5cd3){return _0x1a5cd3[_0xbec7('0x27')]()[_0xbec7('0x26')](function(){_0x425503[_0xbec7('0x1c')](0xcc)[_0xbec7('0x1d')]();});}};}function handleEntityNotFound(_0x4fd9c1,_0xb55131){return function(_0x16b2c9){if(!_0x16b2c9){_0x4fd9c1[_0xbec7('0x1b')](0x194);}return _0x16b2c9;};}function handleError(_0x22afc7,_0x295979){_0x295979=_0x295979||0x1f4;return function(_0x4e61c4){logger[_0xbec7('0x28')](_0x4e61c4[_0xbec7('0x29')]);if(_0x4e61c4['name']){delete _0x4e61c4['name'];}_0x22afc7[_0xbec7('0x1c')](_0x295979)[_0xbec7('0x2a')](_0x4e61c4);};}exports['index']=function(_0x50b6cb,_0x4297d3){var _0x14c75c={},_0x183c3f={},_0x7fa81b={'count':0x0,'rows':[]};var _0x53d241=_[_0xbec7('0x2b')](db['DeskAccount'][_0xbec7('0x2c')],function(_0x31d8da){return{'name':_0x31d8da[_0xbec7('0x2d')],'type':_0x31d8da['type'][_0xbec7('0x2e')]};});_0x183c3f[_0xbec7('0x2f')]=_[_0xbec7('0x2b')](_0x53d241,'name');_0x183c3f[_0xbec7('0x30')]=_['keys'](_0x50b6cb[_0xbec7('0x30')]);_0x183c3f[_0xbec7('0x31')]=_[_0xbec7('0x32')](_0x183c3f['model'],_0x183c3f['query']);_0x14c75c['attributes']=_[_0xbec7('0x32')](_0x183c3f['model'],qs[_0xbec7('0x33')](_0x50b6cb[_0xbec7('0x30')]['fields']));_0x14c75c[_0xbec7('0x34')]=_0x14c75c[_0xbec7('0x34')][_0xbec7('0x35')]?_0x14c75c['attributes']:_0x183c3f['model'];if(!_0x50b6cb[_0xbec7('0x30')][_0xbec7('0x36')]('nolimit')){_0x14c75c['limit']=qs[_0xbec7('0x22')](_0x50b6cb[_0xbec7('0x30')]['limit']);_0x14c75c[_0xbec7('0x21')]=qs[_0xbec7('0x21')](_0x50b6cb[_0xbec7('0x30')][_0xbec7('0x21')]);}_0x14c75c['order']=qs[_0xbec7('0x37')](_0x50b6cb[_0xbec7('0x30')][_0xbec7('0x37')]);_0x14c75c[_0xbec7('0x38')]=qs[_0xbec7('0x31')](_[_0xbec7('0x39')](_0x50b6cb[_0xbec7('0x30')],_0x183c3f[_0xbec7('0x31')]),_0x53d241);if(_0x50b6cb['query'][_0xbec7('0x3a')]){_0x14c75c[_0xbec7('0x38')]=_[_0xbec7('0x3b')](_0x14c75c[_0xbec7('0x38')],{'$or':_[_0xbec7('0x2b')](_0x53d241,function(_0x42827f){if(_0x42827f[_0xbec7('0x3c')]!=='VIRTUAL'){var _0x3ed3fc={};_0x3ed3fc[_0x42827f[_0xbec7('0x3d')]]={'$like':'%'+_0x50b6cb['query'][_0xbec7('0x3a')]+'%'};return _0x3ed3fc;}})});}_0x14c75c=_[_0xbec7('0x3b')]({},_0x14c75c,_0x50b6cb['options']);var _0xe53047={'where':_0x14c75c[_0xbec7('0x38')]};return db['DeskAccount'][_0xbec7('0x20')](_0xe53047)[_0xbec7('0x26')](function(_0x2365d0){_0x7fa81b[_0xbec7('0x20')]=_0x2365d0;if(_0x50b6cb[_0xbec7('0x30')][_0xbec7('0x3e')]){_0x14c75c['include']=[{'all':!![]}];}return db[_0xbec7('0x3f')][_0xbec7('0x40')](_0x14c75c);})[_0xbec7('0x26')](function(_0x58df14){_0x7fa81b[_0xbec7('0x41')]=_0x58df14;return _0x7fa81b;})[_0xbec7('0x26')](respondWithFilteredResult(_0x4297d3,_0x14c75c))[_0xbec7('0x42')](handleError(_0x4297d3,null));};exports[_0xbec7('0x43')]=function(_0x89f477,_0xae22e4){var _0xe3337b={'raw':![],'where':{'id':_0x89f477[_0xbec7('0x44')]['id']}},_0x491f9f={};_0x491f9f[_0xbec7('0x2f')]=_[_0xbec7('0x45')](db[_0xbec7('0x3f')][_0xbec7('0x2c')]);_0x491f9f[_0xbec7('0x30')]=_[_0xbec7('0x45')](_0x89f477['query']);_0x491f9f[_0xbec7('0x31')]=_['intersection'](_0x491f9f[_0xbec7('0x2f')],_0x491f9f['query']);_0xe3337b[_0xbec7('0x34')]=_[_0xbec7('0x32')](_0x491f9f['model'],qs[_0xbec7('0x33')](_0x89f477[_0xbec7('0x30')][_0xbec7('0x33')]));_0xe3337b['attributes']=_0xe3337b[_0xbec7('0x34')][_0xbec7('0x35')]?_0xe3337b['attributes']:_0x491f9f['model'];if(_0x89f477[_0xbec7('0x30')]['includeAll']){_0xe3337b[_0xbec7('0x46')]=[{'all':!![]}];}_0xe3337b=_['merge']({},_0xe3337b,_0x89f477[_0xbec7('0x47')]);return db[_0xbec7('0x3f')]['find'](_0xe3337b)['then'](handleEntityNotFound(_0xae22e4,null))['then'](respondWithResult(_0xae22e4,null))[_0xbec7('0x42')](handleError(_0xae22e4,null));};exports[_0xbec7('0x48')]=function(_0x1e2584,_0x4def3d){return db[_0xbec7('0x3f')]['create'](_0x1e2584[_0xbec7('0x49')],{})[_0xbec7('0x26')](respondWithResult(_0x4def3d,0xc9))[_0xbec7('0x42')](handleError(_0x4def3d,null));};exports['update']=function(_0x58327b,_0x1f1be5){if(_0x58327b[_0xbec7('0x49')]['id']){delete _0x58327b[_0xbec7('0x49')]['id'];}return db[_0xbec7('0x3f')][_0xbec7('0x4a')]({'where':{'id':_0x58327b[_0xbec7('0x44')]['id']}})[_0xbec7('0x26')](handleEntityNotFound(_0x1f1be5,null))[_0xbec7('0x26')](saveUpdates(_0x58327b[_0xbec7('0x49')],null))[_0xbec7('0x26')](respondWithResult(_0x1f1be5,null))['catch'](handleError(_0x1f1be5,null));};exports[_0xbec7('0x27')]=function(_0x12ec4d,_0x6a35f3){return db['DeskAccount'][_0xbec7('0x4a')]({'where':{'id':_0x12ec4d[_0xbec7('0x44')]['id']}})[_0xbec7('0x26')](handleEntityNotFound(_0x6a35f3,null))[_0xbec7('0x26')](removeEntity(_0x6a35f3,null))[_0xbec7('0x42')](handleError(_0x6a35f3,null));};exports[_0xbec7('0x4b')]=function(_0x2503db,_0x2a4c8e,_0x5f1569){var _0x4dba96={};var _0x5ab712={};var _0x17efa6;var _0x57cc90;return db[_0xbec7('0x3f')][_0xbec7('0x4c')]({'where':{'id':_0x2503db[_0xbec7('0x44')]['id']}})[_0xbec7('0x26')](handleEntityNotFound(_0x2a4c8e,null))['then'](function(_0x4ee8a3){if(_0x4ee8a3){_0x17efa6=_0x4ee8a3;_0x5ab712[_0xbec7('0x2f')]=_[_0xbec7('0x45')](db[_0xbec7('0x4d')][_0xbec7('0x2c')]);_0x5ab712['query']=_['keys'](_0x2503db['query']);_0x5ab712[_0xbec7('0x31')]=_[_0xbec7('0x32')](_0x5ab712[_0xbec7('0x2f')],_0x5ab712[_0xbec7('0x30')]);_0x4dba96[_0xbec7('0x34')]=_[_0xbec7('0x32')](_0x5ab712[_0xbec7('0x2f')],qs[_0xbec7('0x33')](_0x2503db['query'][_0xbec7('0x33')]));_0x4dba96[_0xbec7('0x34')]=_0x4dba96[_0xbec7('0x34')][_0xbec7('0x35')]?_0x4dba96[_0xbec7('0x34')]:_0x5ab712['model'];_0x4dba96[_0xbec7('0x4e')]=qs[_0xbec7('0x37')](_0x2503db['query'][_0xbec7('0x37')]);_0x4dba96[_0xbec7('0x38')]=qs[_0xbec7('0x31')](_[_0xbec7('0x39')](_0x2503db[_0xbec7('0x30')],_0x5ab712[_0xbec7('0x31')]));if(_0x2503db[_0xbec7('0x30')][_0xbec7('0x3a')]){_0x4dba96['where']=_['merge'](_0x4dba96[_0xbec7('0x38')],{'$or':_['map'](_0x4dba96[_0xbec7('0x34')],function(_0x55f56a){var _0x442086={};_0x442086[_0x55f56a]={'$like':'%'+_0x2503db[_0xbec7('0x30')][_0xbec7('0x3a')]+'%'};return _0x442086;})});}_0x4dba96=_['merge']({},_0x4dba96,_0x2503db[_0xbec7('0x47')]);return _0x17efa6[_0xbec7('0x4b')](_0x4dba96);}})[_0xbec7('0x26')](function(_0x34b6ff){if(_0x34b6ff){_0x57cc90=_0x34b6ff[_0xbec7('0x35')];if(!_0x2503db[_0xbec7('0x30')]['hasOwnProperty'](_0xbec7('0x4f'))){_0x4dba96[_0xbec7('0x22')]=qs[_0xbec7('0x22')](_0x2503db[_0xbec7('0x30')][_0xbec7('0x22')]);_0x4dba96[_0xbec7('0x21')]=qs[_0xbec7('0x21')](_0x2503db[_0xbec7('0x30')][_0xbec7('0x21')]);}return _0x17efa6['getConfigurations'](_0x4dba96);}})['then'](function(_0x2a85af){if(_0x2a85af){return _0x2a85af?{'count':_0x57cc90,'rows':_0x2a85af}:null;}})[_0xbec7('0x26')](respondWithResult(_0x2a4c8e,null))[_0xbec7('0x42')](handleError(_0x2a4c8e,null));};exports['addConfiguration']=function(_0x21c168,_0x5501c4,_0x2f042c){if(_0x21c168[_0xbec7('0x49')]['id']){delete _0x21c168[_0xbec7('0x49')]['id'];}return db[_0xbec7('0x3f')][_0xbec7('0x4c')]({'where':{'id':_0x21c168[_0xbec7('0x44')]['id']}})[_0xbec7('0x26')](handleEntityNotFound(_0x5501c4,null))[_0xbec7('0x26')](function(_0x5ea4c8){if(_0x5ea4c8){_0x21c168['body'][_0xbec7('0x50')]=_0x5ea4c8['id'];_0x21c168[_0xbec7('0x49')][_0xbec7('0x51')]=integrations[_0xbec7('0x52')](_0x21c168['body'][_0xbec7('0x53')],_0x21c168[_0xbec7('0x49')][_0xbec7('0x3c')]);_0x21c168['body'][_0xbec7('0x54')]=integrations['getDescriptions'](_0x21c168['body'][_0xbec7('0x53')],_0x21c168[_0xbec7('0x49')][_0xbec7('0x3c')]);return db[_0xbec7('0x4d')][_0xbec7('0x48')](_0x21c168[_0xbec7('0x49')],{'include':[{'model':db['DeskField'],'as':_0xbec7('0x51')},{'model':db[_0xbec7('0x55')],'as':'Descriptions'}]});}return null;})[_0xbec7('0x26')](respondWithResult(_0x5501c4,null))[_0xbec7('0x42')](handleError(_0x5501c4,null));};exports[_0xbec7('0x56')]=function(_0x16b73f,_0x1a78d9,_0x361aff){var _0x5a4568=[{'name':_0xbec7('0x57'),'label':_0xbec7('0x57'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x47b26e='';return db['DeskAccount']['findOne']({'where':{'id':_0x16b73f[_0xbec7('0x44')]['id']},'attributes':['id',_0xbec7('0x58'),_0xbec7('0x59'),_0xbec7('0x5a'),_0xbec7('0x5b'),_0xbec7('0x5c'),_0xbec7('0x5d'),_0xbec7('0x5e'),_0xbec7('0x5f')]})[_0xbec7('0x26')](handleEntityNotFound(_0x1a78d9,null))[_0xbec7('0x26')](function(_0x656dc1){if(_0x656dc1){_0x47b26e=_0x656dc1['remoteUri'];var _0x855eec=_0x47b26e[_0xbec7('0x60')](-0x1);if(_0x855eec==='/'){_0x47b26e=_0x47b26e[_0xbec7('0x61')](0x0,_0x47b26e[_0xbec7('0x62')](_0x855eec));}var _0x468462={'method':_0xbec7('0x63'),'uri':util[_0xbec7('0x64')](_0xbec7('0x65'),_0x47b26e),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x656dc1[_0xbec7('0x59')]==='basic'){_0x468462[_0xbec7('0x66')][_0xbec7('0x67')]=util[_0xbec7('0x64')](_0xbec7('0x68'),new Buffer(util['format'](_0xbec7('0x69'),_0x656dc1[_0xbec7('0x5a')],_0x656dc1[_0xbec7('0x5b')]))['toString'](_0xbec7('0x6a')));}return rp(_0x468462)[_0xbec7('0x26')](function(_0xe7b71e){return _0x5a4568[_0xbec7('0x6b')](_[_0xbec7('0x2b')](_0xe7b71e[_0xbec7('0x6c')][_0xbec7('0x6d')],function(_0x2a8366){return{'id':_0x2a8366[_0xbec7('0x3d')],'name':_0x2a8366['name'],'type':_0x2a8366[_0xbec7('0x3c')],'active':_0x2a8366[_0xbec7('0x6e')],'label':_0x2a8366['label'],'custom':!![]};}));});}})[_0xbec7('0x26')](function(_0x11d115){return{'count':_0x11d115['length'],'rows':_0x11d115};})[_0xbec7('0x26')](respondWithResult(_0x1a78d9,null))[_0xbec7('0x42')](function(_0x222a92){var _0xc7efdf=_0x16b73f[_0xbec7('0x30')]['test']?0x1f4:_0x222a92[_0xbec7('0x6f')]||0x1f4;logger['error'](_0xbec7('0x70'),_0xbec7('0x56'),_0xc7efdf,JSON[_0xbec7('0x71')](_0x222a92));delete _0x222a92['name'];if(_0xc7efdf===0x191){_0xc7efdf=0x190;}_0x1a78d9[_0xbec7('0x1c')](_0xc7efdf)[_0xbec7('0x2a')](_0x16b73f[_0xbec7('0x30')][_0xbec7('0x72')]?{'message':_0xbec7('0x73'),'statusCode':_0x222a92[_0xbec7('0x6f')]}:_0x222a92);});}; \ No newline at end of file +var _0x9439=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','options','includeAll','include','catch','show','params','create','body','update','find','findOne','DeskConfiguration','rawAttributes','length','filter','getConfigurations','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','concat','_embedded','entries','label','test','statusCode','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x1f4984,_0x4311a2){var _0x4432a0=function(_0x57729a){while(--_0x57729a){_0x1f4984['push'](_0x1f4984['shift']());}};_0x4432a0(++_0x4311a2);}(_0x9439,0xc9));var _0x9943=function(_0x2ebe8f,_0x51953d){_0x2ebe8f=_0x2ebe8f-0x0;var _0x1abba9=_0x9439[_0x2ebe8f];return _0x1abba9;};'use strict';var emlformat=require(_0x9943('0x0'));var rimraf=require(_0x9943('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9943('0x2'));var rp=require(_0x9943('0x3'));var moment=require(_0x9943('0x4'));var BPromise=require(_0x9943('0x5'));var Mustache=require(_0x9943('0x6'));var util=require(_0x9943('0x7'));var path=require(_0x9943('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9943('0x9'));var fs=require('fs');var fs_extra=require(_0x9943('0xa'));var _=require(_0x9943('0xb'));var squel=require(_0x9943('0xc'));var crypto=require(_0x9943('0xd'));var jsforce=require(_0x9943('0xe'));var deskjs=require(_0x9943('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9943('0x10'));var Redis=require(_0x9943('0x11'));var authService=require(_0x9943('0x12'));var qs=require(_0x9943('0x13'));var as=require(_0x9943('0x14'));var hardwareService=require(_0x9943('0x15'));var logger=require(_0x9943('0x16'))(_0x9943('0x17'));var utils=require('../../config/utils');var config=require(_0x9943('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9943('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56cdad,_0x4b93f2){_0x4b93f2=_0x4b93f2||0xcc;return function(_0x244bcc){if(_0x244bcc){return _0x56cdad['sendStatus'](_0x4b93f2);}return _0x56cdad[_0x9943('0x1a')](_0x4b93f2)['end']();};}function respondWithResult(_0x1f836c,_0x3cf200){_0x3cf200=_0x3cf200||0xc8;return function(_0x50e17e){if(_0x50e17e){return _0x1f836c[_0x9943('0x1a')](_0x3cf200)['json'](_0x50e17e);}};}function respondWithFilteredResult(_0x5a883b,_0x4184c6){return function(_0x329941){if(_0x329941){var _0x4aa196=typeof _0x4184c6[_0x9943('0x1b')]===_0x9943('0x1c')&&typeof _0x4184c6[_0x9943('0x1d')]===_0x9943('0x1c');var _0x4149ae=_0x329941[_0x9943('0x1e')];var _0x2287f8=_0x4aa196?0x0:_0x4184c6['offset'];var _0x4323e7=_0x4aa196?_0x329941[_0x9943('0x1e')]:_0x4184c6['offset']+_0x4184c6[_0x9943('0x1d')];var _0x484228;if(_0x4323e7>=_0x4149ae){_0x4323e7=_0x4149ae;_0x484228=0xc8;}else{_0x484228=0xce;}_0x5a883b[_0x9943('0x1a')](_0x484228);return _0x5a883b[_0x9943('0x1f')](_0x9943('0x20'),_0x2287f8+'-'+_0x4323e7+'/'+_0x4149ae)[_0x9943('0x21')](_0x329941);}return null;};}function patchUpdates(_0x264be6){return function(_0x55b2c3){try{jsonpatch['apply'](_0x55b2c3,_0x264be6,!![]);}catch(_0x2cb980){return BPromise[_0x9943('0x22')](_0x2cb980);}return _0x55b2c3[_0x9943('0x23')]();};}function saveUpdates(_0x357de3,_0x163f33){return function(_0x3c9583){if(_0x3c9583){return _0x3c9583['update'](_0x357de3)[_0x9943('0x24')](function(_0x111e78){return _0x111e78;});}return null;};}function removeEntity(_0x2b792c,_0x4f6310){return function(_0x2b204e){if(_0x2b204e){return _0x2b204e[_0x9943('0x25')]()[_0x9943('0x24')](function(){_0x2b792c[_0x9943('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e630b,_0x2d2f59){return function(_0x2283e3){if(!_0x2283e3){_0x2e630b[_0x9943('0x26')](0x194);}return _0x2283e3;};}function handleError(_0x3c1b98,_0x23b252){_0x23b252=_0x23b252||0x1f4;return function(_0x52aa98){logger['error'](_0x52aa98[_0x9943('0x27')]);if(_0x52aa98[_0x9943('0x28')]){delete _0x52aa98[_0x9943('0x28')];}_0x3c1b98['status'](_0x23b252)[_0x9943('0x29')](_0x52aa98);};}exports[_0x9943('0x2a')]=function(_0x942e28,_0x3a3018){var _0x2a3dc2={},_0x3f2220={},_0x31a6e3={'count':0x0,'rows':[]};var _0x371b0e=_[_0x9943('0x2b')](db[_0x9943('0x2c')]['rawAttributes'],function(_0x5ce3fa){return{'name':_0x5ce3fa[_0x9943('0x2d')],'type':_0x5ce3fa[_0x9943('0x2e')]['key']};});_0x3f2220[_0x9943('0x2f')]=_['map'](_0x371b0e,_0x9943('0x28'));_0x3f2220[_0x9943('0x30')]=_[_0x9943('0x31')](_0x942e28['query']);_0x3f2220[_0x9943('0x32')]=_[_0x9943('0x33')](_0x3f2220[_0x9943('0x2f')],_0x3f2220[_0x9943('0x30')]);_0x2a3dc2['attributes']=_['intersection'](_0x3f2220['model'],qs['fields'](_0x942e28[_0x9943('0x30')][_0x9943('0x34')]));_0x2a3dc2[_0x9943('0x35')]=_0x2a3dc2[_0x9943('0x35')]['length']?_0x2a3dc2['attributes']:_0x3f2220[_0x9943('0x2f')];if(!_0x942e28[_0x9943('0x30')][_0x9943('0x36')](_0x9943('0x37'))){_0x2a3dc2['limit']=qs[_0x9943('0x1d')](_0x942e28[_0x9943('0x30')][_0x9943('0x1d')]);_0x2a3dc2[_0x9943('0x1b')]=qs['offset'](_0x942e28[_0x9943('0x30')]['offset']);}_0x2a3dc2[_0x9943('0x38')]=qs[_0x9943('0x39')](_0x942e28['query']['sort']);_0x2a3dc2['where']=qs[_0x9943('0x32')](_[_0x9943('0x3a')](_0x942e28[_0x9943('0x30')],_0x3f2220[_0x9943('0x32')]),_0x371b0e);if(_0x942e28[_0x9943('0x30')]['filter']){_0x2a3dc2['where']=_[_0x9943('0x3b')](_0x2a3dc2[_0x9943('0x3c')],{'$or':_[_0x9943('0x2b')](_0x371b0e,function(_0x5799e8){if(_0x5799e8['type']!=='VIRTUAL'){var _0x47029a={};_0x47029a[_0x5799e8[_0x9943('0x28')]]={'$like':'%'+_0x942e28[_0x9943('0x30')]['filter']+'%'};return _0x47029a;}})});}_0x2a3dc2=_[_0x9943('0x3b')]({},_0x2a3dc2,_0x942e28[_0x9943('0x3d')]);var _0x9d12f5={'where':_0x2a3dc2['where']};return db[_0x9943('0x2c')]['count'](_0x9d12f5)['then'](function(_0x3fb4d1){_0x31a6e3[_0x9943('0x1e')]=_0x3fb4d1;if(_0x942e28[_0x9943('0x30')][_0x9943('0x3e')]){_0x2a3dc2[_0x9943('0x3f')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2a3dc2);})[_0x9943('0x24')](function(_0x1a0162){_0x31a6e3['rows']=_0x1a0162;return _0x31a6e3;})['then'](respondWithFilteredResult(_0x3a3018,_0x2a3dc2))[_0x9943('0x40')](handleError(_0x3a3018,null));};exports[_0x9943('0x41')]=function(_0x17b5bf,_0x581681){var _0xed2d={'raw':![],'where':{'id':_0x17b5bf[_0x9943('0x42')]['id']}},_0x5856dd={};_0x5856dd['model']=_['keys'](db['DeskAccount']['rawAttributes']);_0x5856dd['query']=_[_0x9943('0x31')](_0x17b5bf[_0x9943('0x30')]);_0x5856dd[_0x9943('0x32')]=_[_0x9943('0x33')](_0x5856dd[_0x9943('0x2f')],_0x5856dd[_0x9943('0x30')]);_0xed2d['attributes']=_[_0x9943('0x33')](_0x5856dd[_0x9943('0x2f')],qs[_0x9943('0x34')](_0x17b5bf[_0x9943('0x30')][_0x9943('0x34')]));_0xed2d[_0x9943('0x35')]=_0xed2d[_0x9943('0x35')]['length']?_0xed2d[_0x9943('0x35')]:_0x5856dd['model'];if(_0x17b5bf[_0x9943('0x30')][_0x9943('0x3e')]){_0xed2d[_0x9943('0x3f')]=[{'all':!![]}];}_0xed2d=_[_0x9943('0x3b')]({},_0xed2d,_0x17b5bf[_0x9943('0x3d')]);return db[_0x9943('0x2c')]['find'](_0xed2d)[_0x9943('0x24')](handleEntityNotFound(_0x581681,null))[_0x9943('0x24')](respondWithResult(_0x581681,null))[_0x9943('0x40')](handleError(_0x581681,null));};exports[_0x9943('0x43')]=function(_0x29a881,_0x22015e){return db[_0x9943('0x2c')][_0x9943('0x43')](_0x29a881[_0x9943('0x44')],{})[_0x9943('0x24')](respondWithResult(_0x22015e,0xc9))[_0x9943('0x40')](handleError(_0x22015e,null));};exports[_0x9943('0x45')]=function(_0x33528f,_0x564c64){if(_0x33528f[_0x9943('0x44')]['id']){delete _0x33528f[_0x9943('0x44')]['id'];}return db[_0x9943('0x2c')][_0x9943('0x46')]({'where':{'id':_0x33528f[_0x9943('0x42')]['id']}})[_0x9943('0x24')](handleEntityNotFound(_0x564c64,null))[_0x9943('0x24')](saveUpdates(_0x33528f[_0x9943('0x44')],null))[_0x9943('0x24')](respondWithResult(_0x564c64,null))[_0x9943('0x40')](handleError(_0x564c64,null));};exports['destroy']=function(_0x59dbf8,_0x14b909){return db[_0x9943('0x2c')]['find']({'where':{'id':_0x59dbf8[_0x9943('0x42')]['id']}})[_0x9943('0x24')](handleEntityNotFound(_0x14b909,null))[_0x9943('0x24')](removeEntity(_0x14b909,null))[_0x9943('0x40')](handleError(_0x14b909,null));};exports['getConfigurations']=function(_0x4a290b,_0x5de52a,_0x567a40){var _0x3097c9={};var _0x599356={};var _0x5ebc21;var _0x42b8e2;return db[_0x9943('0x2c')][_0x9943('0x47')]({'where':{'id':_0x4a290b[_0x9943('0x42')]['id']}})[_0x9943('0x24')](handleEntityNotFound(_0x5de52a,null))[_0x9943('0x24')](function(_0x3bd02d){if(_0x3bd02d){_0x5ebc21=_0x3bd02d;_0x599356[_0x9943('0x2f')]=_[_0x9943('0x31')](db[_0x9943('0x48')][_0x9943('0x49')]);_0x599356[_0x9943('0x30')]=_[_0x9943('0x31')](_0x4a290b[_0x9943('0x30')]);_0x599356['filters']=_[_0x9943('0x33')](_0x599356[_0x9943('0x2f')],_0x599356[_0x9943('0x30')]);_0x3097c9[_0x9943('0x35')]=_[_0x9943('0x33')](_0x599356[_0x9943('0x2f')],qs[_0x9943('0x34')](_0x4a290b[_0x9943('0x30')][_0x9943('0x34')]));_0x3097c9['attributes']=_0x3097c9[_0x9943('0x35')][_0x9943('0x4a')]?_0x3097c9['attributes']:_0x599356[_0x9943('0x2f')];_0x3097c9['order']=qs[_0x9943('0x39')](_0x4a290b[_0x9943('0x30')][_0x9943('0x39')]);_0x3097c9[_0x9943('0x3c')]=qs[_0x9943('0x32')](_['pick'](_0x4a290b[_0x9943('0x30')],_0x599356['filters']));if(_0x4a290b['query'][_0x9943('0x4b')]){_0x3097c9[_0x9943('0x3c')]=_[_0x9943('0x3b')](_0x3097c9[_0x9943('0x3c')],{'$or':_['map'](_0x3097c9[_0x9943('0x35')],function(_0x2961d9){var _0x2bfd47={};_0x2bfd47[_0x2961d9]={'$like':'%'+_0x4a290b[_0x9943('0x30')][_0x9943('0x4b')]+'%'};return _0x2bfd47;})});}_0x3097c9=_[_0x9943('0x3b')]({},_0x3097c9,_0x4a290b[_0x9943('0x3d')]);return _0x5ebc21[_0x9943('0x4c')](_0x3097c9);}})[_0x9943('0x24')](function(_0x3ca617){if(_0x3ca617){_0x42b8e2=_0x3ca617[_0x9943('0x4a')];if(!_0x4a290b[_0x9943('0x30')][_0x9943('0x36')](_0x9943('0x37'))){_0x3097c9[_0x9943('0x1d')]=qs[_0x9943('0x1d')](_0x4a290b[_0x9943('0x30')][_0x9943('0x1d')]);_0x3097c9['offset']=qs[_0x9943('0x1b')](_0x4a290b['query'][_0x9943('0x1b')]);}return _0x5ebc21[_0x9943('0x4c')](_0x3097c9);}})[_0x9943('0x24')](function(_0x2d1fc8){if(_0x2d1fc8){return _0x2d1fc8?{'count':_0x42b8e2,'rows':_0x2d1fc8}:null;}})[_0x9943('0x24')](respondWithResult(_0x5de52a,null))[_0x9943('0x40')](handleError(_0x5de52a,null));};exports['addConfiguration']=function(_0x38f0fd,_0x17aa42,_0xda3b12){if(_0x38f0fd[_0x9943('0x44')]['id']){delete _0x38f0fd[_0x9943('0x44')]['id'];}return db['DeskAccount'][_0x9943('0x47')]({'where':{'id':_0x38f0fd['params']['id']}})[_0x9943('0x24')](handleEntityNotFound(_0x17aa42,null))[_0x9943('0x24')](function(_0x51542a){if(_0x51542a){_0x38f0fd[_0x9943('0x44')]['AccountId']=_0x51542a['id'];_0x38f0fd[_0x9943('0x44')][_0x9943('0x4d')]=integrations[_0x9943('0x4e')](_0x38f0fd[_0x9943('0x44')]['channel'],_0x38f0fd[_0x9943('0x44')]['type']);_0x38f0fd['body'][_0x9943('0x4f')]=integrations[_0x9943('0x50')](_0x38f0fd['body'][_0x9943('0x51')],_0x38f0fd['body'][_0x9943('0x2e')]);return db[_0x9943('0x48')][_0x9943('0x43')](_0x38f0fd[_0x9943('0x44')],{'include':[{'model':db[_0x9943('0x52')],'as':_0x9943('0x4d')},{'model':db[_0x9943('0x52')],'as':_0x9943('0x4f')}]});}return null;})['then'](respondWithResult(_0x17aa42,null))[_0x9943('0x40')](handleError(_0x17aa42,null));};exports[_0x9943('0x53')]=function(_0x25e252,_0x545540,_0x5edd6d){var _0x23ed6a=[{'name':_0x9943('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x57a521='';return db[_0x9943('0x2c')][_0x9943('0x47')]({'where':{'id':_0x25e252[_0x9943('0x42')]['id']},'attributes':['id',_0x9943('0x55'),_0x9943('0x56'),_0x9943('0x57'),'password',_0x9943('0x58'),_0x9943('0x59'),_0x9943('0x5a'),_0x9943('0x5b')]})[_0x9943('0x24')](handleEntityNotFound(_0x545540,null))[_0x9943('0x24')](function(_0x24388b){if(_0x24388b){_0x57a521=_0x24388b[_0x9943('0x55')];var _0x4d77b4=_0x57a521['slice'](-0x1);if(_0x4d77b4==='/'){_0x57a521=_0x57a521[_0x9943('0x5c')](0x0,_0x57a521['lastIndexOf'](_0x4d77b4));}var _0x5c539a={'method':_0x9943('0x5d'),'uri':util[_0x9943('0x5e')](_0x9943('0x5f'),_0x57a521),'headers':{'Content-Type':_0x9943('0x60'),'Accept':_0x9943('0x60')},'json':!![]};if(_0x24388b[_0x9943('0x56')]===_0x9943('0x61')){_0x5c539a['headers'][_0x9943('0x62')]=util[_0x9943('0x5e')](_0x9943('0x63'),new Buffer(util[_0x9943('0x5e')](_0x9943('0x64'),_0x24388b['username'],_0x24388b[_0x9943('0x65')]))[_0x9943('0x66')]('base64'));}return rp(_0x5c539a)[_0x9943('0x24')](function(_0x2d9ab7){return _0x23ed6a[_0x9943('0x67')](_['map'](_0x2d9ab7[_0x9943('0x68')][_0x9943('0x69')],function(_0x45523f){return{'id':_0x45523f[_0x9943('0x28')],'name':_0x45523f[_0x9943('0x28')],'type':_0x45523f['type'],'active':_0x45523f['active'],'label':_0x45523f[_0x9943('0x6a')],'custom':!![]};}));});}})[_0x9943('0x24')](function(_0x2caac4){return{'count':_0x2caac4[_0x9943('0x4a')],'rows':_0x2caac4};})[_0x9943('0x24')](respondWithResult(_0x545540,null))[_0x9943('0x40')](function(_0x11ffea){var _0x398694=_0x25e252[_0x9943('0x30')][_0x9943('0x6b')]?0x1f4:_0x11ffea[_0x9943('0x6c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9943('0x53'),_0x398694,JSON[_0x9943('0x6d')](_0x11ffea));delete _0x11ffea[_0x9943('0x28')];if(_0x398694===0x191){_0x398694=0x190;}_0x545540[_0x9943('0x1a')](_0x398694)['send'](_0x25e252['query'][_0x9943('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x11ffea[_0x9943('0x6c')]}:_0x11ffea);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e00eada..cf23a1c 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 _0x9c83=['exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x9c83,0xb7));var _0x39c8=function(_0x2ba2de,_0x13be03){_0x2ba2de=_0x2ba2de-0x0;var _0x31570c=_0x9c83[_0x2ba2de];return _0x31570c;};'use strict';var _=require(_0x39c8('0x0'));var util=require(_0x39c8('0x1'));var logger=require(_0x39c8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x39c8('0x3'));var rp=require(_0x39c8('0x4'));var fs=require('fs');var path=require(_0x39c8('0x5'));var rimraf=require(_0x39c8('0x6'));var config=require(_0x39c8('0x7'));var attributes=require(_0x39c8('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x39c8('0x9')]=function(_0x35770f,_0x4267f1){return _0x35770f['define'](_0x39c8('0xa'),attributes,{'tableName':_0x39c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x258b=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','api'];(function(_0x4cd1b2,_0x4b1212){var _0x114055=function(_0x5090ef){while(--_0x5090ef){_0x4cd1b2['push'](_0x4cd1b2['shift']());}};_0x114055(++_0x4b1212);}(_0x258b,0x136));var _0xb258=function(_0x53ea58,_0x1ae292){_0x53ea58=_0x53ea58-0x0;var _0x5a35e2=_0x258b[_0x53ea58];return _0x5a35e2;};'use strict';var _=require(_0xb258('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb258('0x1'));var moment=require('moment');var BPromise=require(_0xb258('0x2'));var rp=require(_0xb258('0x3'));var fs=require('fs');var path=require(_0xb258('0x4'));var rimraf=require(_0xb258('0x5'));var config=require(_0xb258('0x6'));var attributes=require(_0xb258('0x7'));var integrations=require(_0xb258('0x8'));module[_0xb258('0x9')]=function(_0x291314,_0x1f58f6){return _0x291314['define'](_0xb258('0xa'),attributes,{'tableName':_0xb258('0xb'),'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 4edb029..cdc8a0b 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 _0x8508=['../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','DeskAccount','findAll','options','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x28cf1b,_0x589dbf){var _0x965f7f=function(_0x2a0bd6){while(--_0x2a0bd6){_0x28cf1b['push'](_0x28cf1b['shift']());}};_0x965f7f(++_0x589dbf);}(_0x8508,0x8a));var _0x8850=function(_0x58acbd,_0x3cab33){_0x58acbd=_0x58acbd-0x0;var _0x3c3d03=_0x8508[_0x58acbd];return _0x3c3d03;};'use strict';var _=require('lodash');var util=require(_0x8850('0x0'));var moment=require(_0x8850('0x1'));var BPromise=require(_0x8850('0x2'));var rs=require(_0x8850('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8850('0x4'))['db'];var utils=require(_0x8850('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8850('0x6'));var jayson=require(_0x8850('0x7'));var client=jayson[_0x8850('0x8')][_0x8850('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5635cf,_0x2b283a,_0x4d7cbb){return new BPromise(function(_0x5e2c7f,_0x1bb40e){return client[_0x8850('0xa')](_0x5635cf,_0x4d7cbb)[_0x8850('0xb')](function(_0x284e07){logger[_0x8850('0xc')](_0x8850('0xd'),_0x2b283a,'request\x20sent');logger['debug'](_0x8850('0xe'),_0x2b283a,'request\x20sent',JSON[_0x8850('0xf')](_0x284e07));if(_0x284e07[_0x8850('0x10')]){if(_0x284e07[_0x8850('0x10')][_0x8850('0x11')]===0x1f4){logger[_0x8850('0x10')]('DeskAccount,\x20%s,\x20%s',_0x2b283a,_0x284e07[_0x8850('0x10')][_0x8850('0x12')]);return _0x1bb40e(_0x284e07[_0x8850('0x10')][_0x8850('0x12')]);}logger[_0x8850('0x10')](_0x8850('0xd'),_0x2b283a,_0x284e07[_0x8850('0x10')][_0x8850('0x12')]);return _0x5e2c7f(_0x284e07[_0x8850('0x10')][_0x8850('0x12')]);}else{logger[_0x8850('0xc')](_0x8850('0xd'),_0x2b283a,_0x8850('0x13'));_0x5e2c7f(_0x284e07[_0x8850('0x14')]['message']);}})[_0x8850('0x15')](function(_0x5d3528){logger[_0x8850('0x10')](_0x8850('0xd'),_0x2b283a,_0x5d3528);_0x1bb40e(_0x5d3528);});});}exports['GetDeskAccount']=function(_0x302be){var _0x2ddfe6=this;return new Promise(function(_0x11b855,_0x1f8000){return db[_0x8850('0x16')][_0x8850('0x17')]({'raw':_0x302be['options']?_0x302be[_0x8850('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x302be[_0x8850('0x18')]?_0x302be[_0x8850('0x18')][_0x8850('0x19')]||null:null,'attributes':_0x302be[_0x8850('0x18')]?_0x302be[_0x8850('0x18')][_0x8850('0x1a')]||null:null,'limit':_0x302be[_0x8850('0x18')]?_0x302be[_0x8850('0x18')][_0x8850('0x1b')]||null:null,'include':_0x302be[_0x8850('0x18')]?_0x302be[_0x8850('0x18')][_0x8850('0x1c')]?_[_0x8850('0x1d')](_0x302be[_0x8850('0x18')][_0x8850('0x1c')],function(_0x24bd1e){return{'model':db[_0x24bd1e[_0x8850('0x1e')]],'as':_0x24bd1e['as'],'attributes':_0x24bd1e['attributes'],'include':_0x24bd1e['include']?_[_0x8850('0x1d')](_0x24bd1e[_0x8850('0x1c')],function(_0x2fe163){return{'model':db[_0x2fe163[_0x8850('0x1e')]],'as':_0x2fe163['as'],'attributes':_0x2fe163[_0x8850('0x1a')],'include':_0x2fe163[_0x8850('0x1c')]?_[_0x8850('0x1d')](_0x2fe163[_0x8850('0x1c')],function(_0x4a70c7){return{'model':db[_0x4a70c7[_0x8850('0x1e')]],'as':_0x4a70c7['as'],'attributes':_0x4a70c7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e3dca){logger[_0x8850('0xc')](_0x8850('0x1f'),_0x302be);logger['debug']('GetDeskAccount',_0x302be,JSON['stringify'](_0x5e3dca));_0x11b855(_0x5e3dca);})[_0x8850('0x15')](function(_0x4c3ee9){logger[_0x8850('0x10')](_0x8850('0x1f'),_0x4c3ee9[_0x8850('0x12')],_0x302be);_0x1f8000(_0x2ddfe6['error'](0x1f4,_0x4c3ee9[_0x8850('0x12')]));});});};exports[_0x8850('0x20')]=function(_0x2c3e1f){var _0x30bee1=this;return new Promise(function(_0x21c96f,_0x1ec9a4){return db[_0x8850('0x16')][_0x8850('0x21')]({'raw':_0x2c3e1f[_0x8850('0x18')]?_0x2c3e1f[_0x8850('0x18')][_0x8850('0x22')]===undefined?!![]:![]:!![],'where':_0x2c3e1f['options']?_0x2c3e1f[_0x8850('0x18')][_0x8850('0x19')]||null:null,'attributes':_0x2c3e1f['options']?_0x2c3e1f[_0x8850('0x18')]['attributes']||null:null,'include':_0x2c3e1f[_0x8850('0x18')]?_0x2c3e1f['options'][_0x8850('0x1c')]?_[_0x8850('0x1d')](_0x2c3e1f['options'][_0x8850('0x1c')],function(_0x5c356f){return{'model':db[_0x5c356f['model']],'as':_0x5c356f['as'],'attributes':_0x5c356f['attributes'],'include':_0x5c356f['include']?_[_0x8850('0x1d')](_0x5c356f[_0x8850('0x1c')],function(_0x1cca2c){return{'model':db[_0x1cca2c[_0x8850('0x1e')]],'as':_0x1cca2c['as'],'attributes':_0x1cca2c[_0x8850('0x1a')],'include':_0x1cca2c[_0x8850('0x1c')]?_[_0x8850('0x1d')](_0x1cca2c[_0x8850('0x1c')],function(_0x418415){return{'model':db[_0x418415[_0x8850('0x1e')]],'as':_0x418415['as'],'attributes':_0x418415[_0x8850('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8850('0xb')](function(_0x5bab74){logger['info'](_0x8850('0x20'),_0x2c3e1f);logger[_0x8850('0x23')](_0x8850('0x20'),_0x2c3e1f,JSON[_0x8850('0xf')](_0x5bab74));_0x21c96f(_0x5bab74);})[_0x8850('0x15')](function(_0xd71be0){logger[_0x8850('0x10')](_0x8850('0x20'),_0xd71be0['message'],_0x2c3e1f);_0x1ec9a4(_0x30bee1[_0x8850('0x10')](0x1f4,_0xd71be0[_0x8850('0x12')]));});});}; \ No newline at end of file +var _0x909a=['util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetDeskAccount','ShowDeskAccount','find','lodash'];(function(_0x45d25f,_0x414062){var _0x5eedff=function(_0x3bd135){while(--_0x3bd135){_0x45d25f['push'](_0x45d25f['shift']());}};_0x5eedff(++_0x414062);}(_0x909a,0x83));var _0xa909=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0x909a[_0x570496];return _0x1d4204;};'use strict';var _=require(_0xa909('0x0'));var util=require(_0xa909('0x1'));var moment=require('moment');var BPromise=require(_0xa909('0x2'));var rs=require(_0xa909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa909('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa909('0x5'))('rpc');var config=require(_0xa909('0x6'));var jayson=require(_0xa909('0x7'));var client=jayson['client'][_0xa909('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b8ab0,_0x57950a,_0x418f39){return new BPromise(function(_0x31f880,_0x4dabd7){return client['request'](_0x5b8ab0,_0x418f39)['then'](function(_0x5e5189){logger[_0xa909('0x9')](_0xa909('0xa'),_0x57950a,_0xa909('0xb'));logger[_0xa909('0xc')](_0xa909('0xd'),_0x57950a,_0xa909('0xb'),JSON[_0xa909('0xe')](_0x5e5189));if(_0x5e5189[_0xa909('0xf')]){if(_0x5e5189[_0xa909('0xf')][_0xa909('0x10')]===0x1f4){logger[_0xa909('0xf')]('DeskAccount,\x20%s,\x20%s',_0x57950a,_0x5e5189['error']['message']);return _0x4dabd7(_0x5e5189[_0xa909('0xf')][_0xa909('0x11')]);}logger[_0xa909('0xf')](_0xa909('0xa'),_0x57950a,_0x5e5189[_0xa909('0xf')][_0xa909('0x11')]);return _0x31f880(_0x5e5189['error'][_0xa909('0x11')]);}else{logger[_0xa909('0x9')](_0xa909('0xa'),_0x57950a,_0xa909('0xb'));_0x31f880(_0x5e5189['result']['message']);}})[_0xa909('0x12')](function(_0x18c770){logger['error'](_0xa909('0xa'),_0x57950a,_0x18c770);_0x4dabd7(_0x18c770);});});}exports['GetDeskAccount']=function(_0x5ee1de){var _0x55abf3=this;return new Promise(function(_0x559be4,_0x17b5cb){return db[_0xa909('0x13')][_0xa909('0x14')]({'raw':_0x5ee1de[_0xa909('0x15')]?_0x5ee1de[_0xa909('0x15')][_0xa909('0x16')]===undefined?!![]:![]:!![],'where':_0x5ee1de['options']?_0x5ee1de[_0xa909('0x15')][_0xa909('0x17')]||null:null,'attributes':_0x5ee1de['options']?_0x5ee1de[_0xa909('0x15')][_0xa909('0x18')]||null:null,'limit':_0x5ee1de[_0xa909('0x15')]?_0x5ee1de[_0xa909('0x15')][_0xa909('0x19')]||null:null,'include':_0x5ee1de[_0xa909('0x15')]?_0x5ee1de['options'][_0xa909('0x1a')]?_[_0xa909('0x1b')](_0x5ee1de['options'][_0xa909('0x1a')],function(_0x24e8b2){return{'model':db[_0x24e8b2[_0xa909('0x1c')]],'as':_0x24e8b2['as'],'attributes':_0x24e8b2[_0xa909('0x18')],'include':_0x24e8b2['include']?_[_0xa909('0x1b')](_0x24e8b2['include'],function(_0x5d1a7e){return{'model':db[_0x5d1a7e[_0xa909('0x1c')]],'as':_0x5d1a7e['as'],'attributes':_0x5d1a7e[_0xa909('0x18')],'include':_0x5d1a7e[_0xa909('0x1a')]?_[_0xa909('0x1b')](_0x5d1a7e['include'],function(_0x238d46){return{'model':db[_0x238d46[_0xa909('0x1c')]],'as':_0x238d46['as'],'attributes':_0x238d46[_0xa909('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa909('0x1d')](function(_0x5dc00a){logger[_0xa909('0x9')]('GetDeskAccount',_0x5ee1de);logger[_0xa909('0xc')](_0xa909('0x1e'),_0x5ee1de,JSON['stringify'](_0x5dc00a));_0x559be4(_0x5dc00a);})[_0xa909('0x12')](function(_0x33f9bf){logger[_0xa909('0xf')](_0xa909('0x1e'),_0x33f9bf['message'],_0x5ee1de);_0x17b5cb(_0x55abf3[_0xa909('0xf')](0x1f4,_0x33f9bf[_0xa909('0x11')]));});});};exports[_0xa909('0x1f')]=function(_0x5199a5){var _0x170bdf=this;return new Promise(function(_0xe4e62d,_0x5989dd){return db['DeskAccount'][_0xa909('0x20')]({'raw':_0x5199a5['options']?_0x5199a5[_0xa909('0x15')][_0xa909('0x16')]===undefined?!![]:![]:!![],'where':_0x5199a5['options']?_0x5199a5['options'][_0xa909('0x17')]||null:null,'attributes':_0x5199a5['options']?_0x5199a5['options']['attributes']||null:null,'include':_0x5199a5['options']?_0x5199a5[_0xa909('0x15')][_0xa909('0x1a')]?_[_0xa909('0x1b')](_0x5199a5[_0xa909('0x15')][_0xa909('0x1a')],function(_0x1daff3){return{'model':db[_0x1daff3[_0xa909('0x1c')]],'as':_0x1daff3['as'],'attributes':_0x1daff3[_0xa909('0x18')],'include':_0x1daff3[_0xa909('0x1a')]?_[_0xa909('0x1b')](_0x1daff3['include'],function(_0x5331ab){return{'model':db[_0x5331ab[_0xa909('0x1c')]],'as':_0x5331ab['as'],'attributes':_0x5331ab[_0xa909('0x18')],'include':_0x5331ab[_0xa909('0x1a')]?_['map'](_0x5331ab[_0xa909('0x1a')],function(_0x4eb005){return{'model':db[_0x4eb005[_0xa909('0x1c')]],'as':_0x4eb005['as'],'attributes':_0x4eb005[_0xa909('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9ad5){logger['info'](_0xa909('0x1f'),_0x5199a5);logger['debug'](_0xa909('0x1f'),_0x5199a5,JSON[_0xa909('0xe')](_0x1f9ad5));_0xe4e62d(_0x1f9ad5);})[_0xa909('0x12')](function(_0x4876bd){logger[_0xa909('0xf')]('ShowDeskAccount',_0x4876bd[_0xa909('0x11')],_0x5199a5);_0x5989dd(_0x170bdf[_0xa909('0xf')](0x1f4,_0x4876bd[_0xa909('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9b7dbb8..f0b70ca 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x596d3f,_0x12c493){var _0x553d2b=function(_0x39bf25){while(--_0x39bf25){_0x596d3f['push'](_0x596d3f['shift']());}};_0x553d2b(++_0x12c493);}(_0x008c,0x188));var _0xc008=function(_0xe429f8,_0xb5ddb4){_0xe429f8=_0xe429f8-0x0;var _0x439723=_0x008c[_0xe429f8];return _0x439723;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x55ca,0x126));var _0xa55c=function(_0x1d2f68,_0x280a21){_0x1d2f68=_0x1d2f68-0x0;var _0x3cbf0a=_0x55ca[_0x1d2f68];return _0x3cbf0a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e05dac7..b309e45 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 _0x412d=['STRING','sequelize','exports'];(function(_0x196bec,_0x5364cc){var _0x3ade9a=function(_0xdcfde){while(--_0xdcfde){_0x196bec['push'](_0x196bec['shift']());}};_0x3ade9a(++_0x5364cc);}(_0x412d,0xac));var _0xd412=function(_0x35a62a,_0x50593a){_0x35a62a=_0x35a62a-0x0;var _0x4b35f5=_0x412d[_0x35a62a];return _0x4b35f5;};'use strict';var Sequelize=require(_0xd412('0x0'));module[_0xd412('0x1')]={'name':{'type':Sequelize[_0xd412('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0207=['sequelize','exports','STRING'];(function(_0x20061d,_0x3b49e4){var _0x27f99b=function(_0x30a58b){while(--_0x30a58b){_0x20061d['push'](_0x20061d['shift']());}};_0x27f99b(++_0x3b49e4);}(_0x0207,0x93));var _0x7020=function(_0xb347b9,_0x3c4105){_0xb347b9=_0xb347b9-0x0;var _0x40091b=_0x0207[_0xb347b9];return _0x40091b;};'use strict';var Sequelize=require(_0x7020('0x0'));module[_0x7020('0x1')]={'name':{'type':Sequelize[_0x7020('0x2')]},'description':{'type':Sequelize[_0x7020('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1cda904..bd2aded 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 _0x0f0a=['name','send','map','DeskConfiguration','type','key','model','query','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','fields','find','create','body','update','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack'];(function(_0x3baaf2,_0x894e3d){var _0x50e8b0=function(_0x35dd6f){while(--_0x35dd6f){_0x3baaf2['push'](_0x3baaf2['shift']());}};_0x50e8b0(++_0x894e3d);}(_0x0f0a,0x1bd));var _0xa0f0=function(_0x2e019e,_0x46242a){_0x2e019e=_0x2e019e-0x0;var _0x1dacd9=_0x0f0a[_0x2e019e];return _0x1dacd9;};'use strict';var emlformat=require(_0xa0f0('0x0'));var rimraf=require(_0xa0f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0f0('0x2'));var rp=require('request-promise');var moment=require(_0xa0f0('0x3'));var BPromise=require(_0xa0f0('0x4'));var Mustache=require(_0xa0f0('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa0f0('0x6'));var csv=require('to-csv');var ejs=require(_0xa0f0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0f0('0x8'));var jsforce=require(_0xa0f0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa0f0('0xa'));var querystring=require('querystring');var Papa=require(_0xa0f0('0xb'));var Redis=require(_0xa0f0('0xc'));var authService=require(_0xa0f0('0xd'));var qs=require(_0xa0f0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0f0('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xa0f0('0x10'));var licenseUtil=require(_0xa0f0('0x11'));var db=require(_0xa0f0('0x12'))['db'];function respondWithStatusCode(_0x5d438c,_0x5a91c5){_0x5a91c5=_0x5a91c5||0xcc;return function(_0x405c0e){if(_0x405c0e){return _0x5d438c['sendStatus'](_0x5a91c5);}return _0x5d438c[_0xa0f0('0x13')](_0x5a91c5)[_0xa0f0('0x14')]();};}function respondWithResult(_0xe2b850,_0x20a3d0){_0x20a3d0=_0x20a3d0||0xc8;return function(_0x37976b){if(_0x37976b){return _0xe2b850[_0xa0f0('0x13')](_0x20a3d0)['json'](_0x37976b);}};}function respondWithFilteredResult(_0x1bd881,_0x3696d5){return function(_0x1ee587){if(_0x1ee587){var _0x257940=typeof _0x3696d5[_0xa0f0('0x15')]===_0xa0f0('0x16')&&typeof _0x3696d5[_0xa0f0('0x17')]===_0xa0f0('0x16');var _0x77a995=_0x1ee587[_0xa0f0('0x18')];var _0x2dc4c6=_0x257940?0x0:_0x3696d5['offset'];var _0x1428f7=_0x257940?_0x1ee587['count']:_0x3696d5[_0xa0f0('0x15')]+_0x3696d5[_0xa0f0('0x17')];var _0x2c8c0b;if(_0x1428f7>=_0x77a995){_0x1428f7=_0x77a995;_0x2c8c0b=0xc8;}else{_0x2c8c0b=0xce;}_0x1bd881[_0xa0f0('0x13')](_0x2c8c0b);return _0x1bd881[_0xa0f0('0x19')](_0xa0f0('0x1a'),_0x2dc4c6+'-'+_0x1428f7+'/'+_0x77a995)[_0xa0f0('0x1b')](_0x1ee587);}return null;};}function patchUpdates(_0x7945ab){return function(_0x2268ad){try{jsonpatch[_0xa0f0('0x1c')](_0x2268ad,_0x7945ab,!![]);}catch(_0x1a591b){return BPromise[_0xa0f0('0x1d')](_0x1a591b);}return _0x2268ad[_0xa0f0('0x1e')]();};}function saveUpdates(_0x2a47e7,_0x383e67){return function(_0x43fa4b){if(_0x43fa4b){return _0x43fa4b['update'](_0x2a47e7)[_0xa0f0('0x1f')](function(_0x182c75){return _0x182c75;});}return null;};}function removeEntity(_0x30e393,_0x4f0171){return function(_0x55f9b4){if(_0x55f9b4){return _0x55f9b4[_0xa0f0('0x20')]()[_0xa0f0('0x1f')](function(){_0x30e393[_0xa0f0('0x13')](0xcc)[_0xa0f0('0x14')]();});}};}function handleEntityNotFound(_0x2e832b,_0x1d56aa){return function(_0x536043){if(!_0x536043){_0x2e832b['sendStatus'](0x194);}return _0x536043;};}function handleError(_0x3e2675,_0x29d04f){_0x29d04f=_0x29d04f||0x1f4;return function(_0x220cc2){logger[_0xa0f0('0x21')](_0x220cc2[_0xa0f0('0x22')]);if(_0x220cc2['name']){delete _0x220cc2[_0xa0f0('0x23')];}_0x3e2675[_0xa0f0('0x13')](_0x29d04f)[_0xa0f0('0x24')](_0x220cc2);};}exports['index']=function(_0x3b1ef9,_0x17f33a){var _0x526d21={},_0xd4b862={},_0x307b08={'count':0x0,'rows':[]};var _0x8857e4=_[_0xa0f0('0x25')](db[_0xa0f0('0x26')]['rawAttributes'],function(_0x5d960a){return{'name':_0x5d960a['fieldName'],'type':_0x5d960a[_0xa0f0('0x27')][_0xa0f0('0x28')]};});_0xd4b862[_0xa0f0('0x29')]=_[_0xa0f0('0x25')](_0x8857e4,_0xa0f0('0x23'));_0xd4b862['query']=_['keys'](_0x3b1ef9[_0xa0f0('0x2a')]);_0xd4b862['filters']=_['intersection'](_0xd4b862[_0xa0f0('0x29')],_0xd4b862[_0xa0f0('0x2a')]);_0x526d21[_0xa0f0('0x2b')]=_['intersection'](_0xd4b862['model'],qs['fields'](_0x3b1ef9[_0xa0f0('0x2a')]['fields']));_0x526d21[_0xa0f0('0x2b')]=_0x526d21['attributes'][_0xa0f0('0x2c')]?_0x526d21[_0xa0f0('0x2b')]:_0xd4b862[_0xa0f0('0x29')];if(!_0x3b1ef9[_0xa0f0('0x2a')][_0xa0f0('0x2d')](_0xa0f0('0x2e'))){_0x526d21[_0xa0f0('0x17')]=qs[_0xa0f0('0x17')](_0x3b1ef9[_0xa0f0('0x2a')]['limit']);_0x526d21[_0xa0f0('0x15')]=qs[_0xa0f0('0x15')](_0x3b1ef9['query'][_0xa0f0('0x15')]);}_0x526d21['order']=qs[_0xa0f0('0x2f')](_0x3b1ef9[_0xa0f0('0x2a')][_0xa0f0('0x2f')]);_0x526d21[_0xa0f0('0x30')]=qs[_0xa0f0('0x31')](_[_0xa0f0('0x32')](_0x3b1ef9[_0xa0f0('0x2a')],_0xd4b862[_0xa0f0('0x31')]),_0x8857e4);if(_0x3b1ef9[_0xa0f0('0x2a')]['filter']){_0x526d21[_0xa0f0('0x30')]=_[_0xa0f0('0x33')](_0x526d21[_0xa0f0('0x30')],{'$or':_[_0xa0f0('0x25')](_0x8857e4,function(_0x3abe85){if(_0x3abe85[_0xa0f0('0x27')]!==_0xa0f0('0x34')){var _0x1bcbd1={};_0x1bcbd1[_0x3abe85['name']]={'$like':'%'+_0x3b1ef9[_0xa0f0('0x2a')][_0xa0f0('0x35')]+'%'};return _0x1bcbd1;}})});}_0x526d21=_['merge']({},_0x526d21,_0x3b1ef9[_0xa0f0('0x36')]);var _0x3bbe13={'where':_0x526d21[_0xa0f0('0x30')]};return db[_0xa0f0('0x26')][_0xa0f0('0x18')](_0x3bbe13)['then'](function(_0x17210c){_0x307b08[_0xa0f0('0x18')]=_0x17210c;if(_0x3b1ef9[_0xa0f0('0x2a')][_0xa0f0('0x37')]){_0x526d21[_0xa0f0('0x38')]=[{'all':!![]}];}return db[_0xa0f0('0x26')][_0xa0f0('0x39')](_0x526d21);})[_0xa0f0('0x1f')](function(_0x53e532){_0x307b08[_0xa0f0('0x3a')]=_0x53e532;return _0x307b08;})[_0xa0f0('0x1f')](respondWithFilteredResult(_0x17f33a,_0x526d21))[_0xa0f0('0x3b')](handleError(_0x17f33a,null));};exports[_0xa0f0('0x3c')]=function(_0x42a4f3,_0xb4147e){var _0x2d4c8c={'raw':![],'where':{'id':_0x42a4f3[_0xa0f0('0x3d')]['id']}},_0x1db409={};_0x1db409[_0xa0f0('0x29')]=_[_0xa0f0('0x3e')](db[_0xa0f0('0x26')][_0xa0f0('0x3f')]);_0x1db409[_0xa0f0('0x2a')]=_[_0xa0f0('0x3e')](_0x42a4f3[_0xa0f0('0x2a')]);_0x1db409['filters']=_['intersection'](_0x1db409[_0xa0f0('0x29')],_0x1db409[_0xa0f0('0x2a')]);_0x2d4c8c[_0xa0f0('0x2b')]=_[_0xa0f0('0x40')](_0x1db409[_0xa0f0('0x29')],qs[_0xa0f0('0x41')](_0x42a4f3[_0xa0f0('0x2a')]['fields']));_0x2d4c8c[_0xa0f0('0x2b')]=_0x2d4c8c[_0xa0f0('0x2b')][_0xa0f0('0x2c')]?_0x2d4c8c[_0xa0f0('0x2b')]:_0x1db409[_0xa0f0('0x29')];if(_0x42a4f3[_0xa0f0('0x2a')][_0xa0f0('0x37')]){_0x2d4c8c['include']=[{'all':!![]}];}_0x2d4c8c=_['merge']({},_0x2d4c8c,_0x42a4f3[_0xa0f0('0x36')]);return db[_0xa0f0('0x26')][_0xa0f0('0x42')](_0x2d4c8c)[_0xa0f0('0x1f')](handleEntityNotFound(_0xb4147e,null))['then'](respondWithResult(_0xb4147e,null))[_0xa0f0('0x3b')](handleError(_0xb4147e,null));};exports[_0xa0f0('0x43')]=function(_0x3833b7,_0x394fc3){return db[_0xa0f0('0x26')][_0xa0f0('0x43')](_0x3833b7[_0xa0f0('0x44')],{})[_0xa0f0('0x1f')](respondWithResult(_0x394fc3,0xc9))[_0xa0f0('0x3b')](handleError(_0x394fc3,null));};exports[_0xa0f0('0x45')]=function(_0x3c7db7,_0x32062a){if(_0x3c7db7['body']['id']){delete _0x3c7db7[_0xa0f0('0x44')]['id'];}return db[_0xa0f0('0x26')]['find']({'where':{'id':_0x3c7db7[_0xa0f0('0x3d')]['id']}})[_0xa0f0('0x1f')](handleEntityNotFound(_0x32062a,null))[_0xa0f0('0x1f')](saveUpdates(_0x3c7db7[_0xa0f0('0x44')],null))[_0xa0f0('0x1f')](respondWithResult(_0x32062a,null))[_0xa0f0('0x3b')](handleError(_0x32062a,null));};exports[_0xa0f0('0x20')]=function(_0x37caeb,_0x2cb217){return db[_0xa0f0('0x26')][_0xa0f0('0x42')]({'where':{'id':_0x37caeb[_0xa0f0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2cb217,null))[_0xa0f0('0x1f')](removeEntity(_0x2cb217,null))[_0xa0f0('0x3b')](handleError(_0x2cb217,null));};exports[_0xa0f0('0x46')]=function(_0x4f5649,_0x1e820b,_0x1c702c){var _0x1158f5={};var _0x561e07={};var _0x57c089;var _0x46da2b;return db[_0xa0f0('0x26')][_0xa0f0('0x47')]({'where':{'id':_0x4f5649[_0xa0f0('0x3d')]['id']}})[_0xa0f0('0x1f')](handleEntityNotFound(_0x1e820b,null))[_0xa0f0('0x1f')](function(_0x1455ab){if(_0x1455ab){_0x57c089=_0x1455ab;_0x561e07[_0xa0f0('0x29')]=_['keys'](db[_0xa0f0('0x48')]['rawAttributes']);_0x561e07['query']=_[_0xa0f0('0x3e')](_0x4f5649[_0xa0f0('0x2a')]);_0x561e07[_0xa0f0('0x31')]=_[_0xa0f0('0x40')](_0x561e07[_0xa0f0('0x29')],_0x561e07[_0xa0f0('0x2a')]);_0x1158f5[_0xa0f0('0x2b')]=_[_0xa0f0('0x40')](_0x561e07[_0xa0f0('0x29')],qs['fields'](_0x4f5649['query'][_0xa0f0('0x41')]));_0x1158f5[_0xa0f0('0x2b')]=_0x1158f5[_0xa0f0('0x2b')]['length']?_0x1158f5[_0xa0f0('0x2b')]:_0x561e07[_0xa0f0('0x29')];_0x1158f5[_0xa0f0('0x49')]=qs['sort'](_0x4f5649['query'][_0xa0f0('0x2f')]);_0x1158f5[_0xa0f0('0x30')]=qs['filters'](_[_0xa0f0('0x32')](_0x4f5649[_0xa0f0('0x2a')],_0x561e07[_0xa0f0('0x31')]));if(_0x4f5649[_0xa0f0('0x2a')][_0xa0f0('0x35')]){_0x1158f5[_0xa0f0('0x30')]=_[_0xa0f0('0x33')](_0x1158f5[_0xa0f0('0x30')],{'$or':_[_0xa0f0('0x25')](_0x1158f5[_0xa0f0('0x2b')],function(_0x5f1c92){var _0x31c1c5={};_0x31c1c5[_0x5f1c92]={'$like':'%'+_0x4f5649[_0xa0f0('0x2a')][_0xa0f0('0x35')]+'%'};return _0x31c1c5;})});}_0x1158f5=_[_0xa0f0('0x33')]({},_0x1158f5,_0x4f5649[_0xa0f0('0x36')]);return _0x57c089[_0xa0f0('0x46')](_0x1158f5);}})[_0xa0f0('0x1f')](function(_0x57e65d){if(_0x57e65d){_0x46da2b=_0x57e65d['length'];if(!_0x4f5649[_0xa0f0('0x2a')]['hasOwnProperty'](_0xa0f0('0x2e'))){_0x1158f5[_0xa0f0('0x17')]=qs[_0xa0f0('0x17')](_0x4f5649[_0xa0f0('0x2a')][_0xa0f0('0x17')]);_0x1158f5['offset']=qs['offset'](_0x4f5649['query'][_0xa0f0('0x15')]);}return _0x57c089[_0xa0f0('0x46')](_0x1158f5);}})['then'](function(_0x28d9a3){if(_0x28d9a3){return _0x28d9a3?{'count':_0x46da2b,'rows':_0x28d9a3}:null;}})['then'](respondWithResult(_0x1e820b,null))[_0xa0f0('0x3b')](handleError(_0x1e820b,null));};exports[_0xa0f0('0x4a')]=function(_0x2884fe,_0x38cbf2,_0x452bcd){var _0x31b131={};var _0x3af897={};var _0x3f573e;var _0x4e3147;return db[_0xa0f0('0x26')][_0xa0f0('0x47')]({'where':{'id':_0x2884fe[_0xa0f0('0x3d')]['id']}})[_0xa0f0('0x1f')](handleEntityNotFound(_0x38cbf2,null))[_0xa0f0('0x1f')](function(_0x27aca5){if(_0x27aca5){_0x3f573e=_0x27aca5;_0x3af897[_0xa0f0('0x29')]=_[_0xa0f0('0x3e')](db['DeskField'][_0xa0f0('0x3f')]);_0x3af897[_0xa0f0('0x2a')]=_['keys'](_0x2884fe[_0xa0f0('0x2a')]);_0x3af897[_0xa0f0('0x31')]=_[_0xa0f0('0x40')](_0x3af897['model'],_0x3af897[_0xa0f0('0x2a')]);_0x31b131[_0xa0f0('0x2b')]=_[_0xa0f0('0x40')](_0x3af897[_0xa0f0('0x29')],qs[_0xa0f0('0x41')](_0x2884fe[_0xa0f0('0x2a')][_0xa0f0('0x41')]));_0x31b131[_0xa0f0('0x2b')]=_0x31b131[_0xa0f0('0x2b')][_0xa0f0('0x2c')]?_0x31b131[_0xa0f0('0x2b')]:_0x3af897[_0xa0f0('0x29')];_0x31b131[_0xa0f0('0x49')]=qs[_0xa0f0('0x2f')](_0x2884fe[_0xa0f0('0x2a')]['sort']);_0x31b131['where']=qs[_0xa0f0('0x31')](_[_0xa0f0('0x32')](_0x2884fe['query'],_0x3af897['filters']));if(_0x2884fe['query'][_0xa0f0('0x35')]){_0x31b131[_0xa0f0('0x30')]=_[_0xa0f0('0x33')](_0x31b131['where'],{'$or':_[_0xa0f0('0x25')](_0x31b131[_0xa0f0('0x2b')],function(_0x57ca2c){var _0x23fad2={};_0x23fad2[_0x57ca2c]={'$like':'%'+_0x2884fe['query'][_0xa0f0('0x35')]+'%'};return _0x23fad2;})});}_0x31b131=_[_0xa0f0('0x33')]({},_0x31b131,_0x2884fe[_0xa0f0('0x36')]);return _0x3f573e['getSubjects'](_0x31b131);}})['then'](function(_0x40bbd0){if(_0x40bbd0){_0x4e3147=_0x40bbd0['length'];if(!_0x2884fe[_0xa0f0('0x2a')][_0xa0f0('0x2d')]('nolimit')){_0x31b131[_0xa0f0('0x17')]=qs[_0xa0f0('0x17')](_0x2884fe['query']['limit']);_0x31b131['offset']=qs[_0xa0f0('0x15')](_0x2884fe['query'][_0xa0f0('0x15')]);}return _0x3f573e[_0xa0f0('0x4a')](_0x31b131);}})[_0xa0f0('0x1f')](function(_0x35af61){if(_0x35af61){return _0x35af61?{'count':_0x4e3147,'rows':_0x35af61}:null;}})[_0xa0f0('0x1f')](respondWithResult(_0x38cbf2,null))[_0xa0f0('0x3b')](handleError(_0x38cbf2,null));};exports[_0xa0f0('0x4b')]=function(_0x4c06db,_0x45fbfa,_0x490624){var _0x2a1541={};var _0x5ecfc7={};var _0x5ec660;var _0x49b161;return db[_0xa0f0('0x26')][_0xa0f0('0x47')]({'where':{'id':_0x4c06db['params']['id']}})['then'](handleEntityNotFound(_0x45fbfa,null))[_0xa0f0('0x1f')](function(_0x53abbb){if(_0x53abbb){_0x5ec660=_0x53abbb;_0x5ecfc7[_0xa0f0('0x29')]=_[_0xa0f0('0x3e')](db[_0xa0f0('0x48')][_0xa0f0('0x3f')]);_0x5ecfc7[_0xa0f0('0x2a')]=_['keys'](_0x4c06db[_0xa0f0('0x2a')]);_0x5ecfc7[_0xa0f0('0x31')]=_['intersection'](_0x5ecfc7[_0xa0f0('0x29')],_0x5ecfc7[_0xa0f0('0x2a')]);_0x2a1541['attributes']=_[_0xa0f0('0x40')](_0x5ecfc7[_0xa0f0('0x29')],qs[_0xa0f0('0x41')](_0x4c06db[_0xa0f0('0x2a')][_0xa0f0('0x41')]));_0x2a1541['attributes']=_0x2a1541[_0xa0f0('0x2b')]['length']?_0x2a1541[_0xa0f0('0x2b')]:_0x5ecfc7[_0xa0f0('0x29')];_0x2a1541[_0xa0f0('0x49')]=qs[_0xa0f0('0x2f')](_0x4c06db[_0xa0f0('0x2a')][_0xa0f0('0x2f')]);_0x2a1541[_0xa0f0('0x30')]=qs[_0xa0f0('0x31')](_[_0xa0f0('0x32')](_0x4c06db[_0xa0f0('0x2a')],_0x5ecfc7['filters']));if(_0x4c06db[_0xa0f0('0x2a')]['filter']){_0x2a1541[_0xa0f0('0x30')]=_[_0xa0f0('0x33')](_0x2a1541[_0xa0f0('0x30')],{'$or':_[_0xa0f0('0x25')](_0x2a1541[_0xa0f0('0x2b')],function(_0x4ff87d){var _0x2669e8={};_0x2669e8[_0x4ff87d]={'$like':'%'+_0x4c06db[_0xa0f0('0x2a')]['filter']+'%'};return _0x2669e8;})});}_0x2a1541=_[_0xa0f0('0x33')]({},_0x2a1541,_0x4c06db[_0xa0f0('0x36')]);return _0x5ec660[_0xa0f0('0x4b')](_0x2a1541);}})[_0xa0f0('0x1f')](function(_0x12de6d){if(_0x12de6d){_0x49b161=_0x12de6d[_0xa0f0('0x2c')];if(!_0x4c06db[_0xa0f0('0x2a')][_0xa0f0('0x2d')](_0xa0f0('0x2e'))){_0x2a1541[_0xa0f0('0x17')]=qs[_0xa0f0('0x17')](_0x4c06db['query'][_0xa0f0('0x17')]);_0x2a1541[_0xa0f0('0x15')]=qs[_0xa0f0('0x15')](_0x4c06db[_0xa0f0('0x2a')][_0xa0f0('0x15')]);}return _0x5ec660[_0xa0f0('0x4b')](_0x2a1541);}})[_0xa0f0('0x1f')](function(_0x351e86){if(_0x351e86){return _0x351e86?{'count':_0x49b161,'rows':_0x351e86}:null;}})[_0xa0f0('0x1f')](respondWithResult(_0x45fbfa,null))['catch'](handleError(_0x45fbfa,null));};exports[_0xa0f0('0x4c')]=function(_0x3c14ee,_0x3b3062,_0x444324){var _0x14930e={};var _0x71004a={};var _0x1485e1;var _0x55bf56;return db['DeskConfiguration'][_0xa0f0('0x47')]({'where':{'id':_0x3c14ee['params']['id']}})['then'](handleEntityNotFound(_0x3b3062,null))['then'](function(_0xe00911){if(_0xe00911){_0x1485e1=_0xe00911;_0x71004a[_0xa0f0('0x29')]=_[_0xa0f0('0x3e')](db[_0xa0f0('0x4d')]['rawAttributes']);_0x71004a[_0xa0f0('0x2a')]=_[_0xa0f0('0x3e')](_0x3c14ee[_0xa0f0('0x2a')]);_0x71004a['filters']=_[_0xa0f0('0x40')](_0x71004a[_0xa0f0('0x29')],_0x71004a['query']);_0x14930e['attributes']=_[_0xa0f0('0x40')](_0x71004a['model'],qs[_0xa0f0('0x41')](_0x3c14ee[_0xa0f0('0x2a')][_0xa0f0('0x41')]));_0x14930e[_0xa0f0('0x2b')]=_0x14930e[_0xa0f0('0x2b')][_0xa0f0('0x2c')]?_0x14930e['attributes']:_0x71004a[_0xa0f0('0x29')];_0x14930e[_0xa0f0('0x49')]=qs['sort'](_0x3c14ee[_0xa0f0('0x2a')]['sort']);_0x14930e[_0xa0f0('0x30')]=qs[_0xa0f0('0x31')](_[_0xa0f0('0x32')](_0x3c14ee[_0xa0f0('0x2a')],_0x71004a['filters']));if(_0x3c14ee[_0xa0f0('0x2a')][_0xa0f0('0x35')]){_0x14930e[_0xa0f0('0x30')]=_[_0xa0f0('0x33')](_0x14930e[_0xa0f0('0x30')],{'$or':_[_0xa0f0('0x25')](_0x14930e[_0xa0f0('0x2b')],function(_0x5d4033){var _0x2f51ce={};_0x2f51ce[_0x5d4033]={'$like':'%'+_0x3c14ee[_0xa0f0('0x2a')][_0xa0f0('0x35')]+'%'};return _0x2f51ce;})});}_0x14930e=_[_0xa0f0('0x33')]({},_0x14930e,_0x3c14ee[_0xa0f0('0x36')]);return _0x1485e1['getTags'](_0x14930e);}})[_0xa0f0('0x1f')](function(_0x3fd75a){if(_0x3fd75a){_0x55bf56=_0x3fd75a['length'];if(!_0x3c14ee[_0xa0f0('0x2a')][_0xa0f0('0x2d')](_0xa0f0('0x2e'))){_0x14930e[_0xa0f0('0x17')]=qs[_0xa0f0('0x17')](_0x3c14ee[_0xa0f0('0x2a')]['limit']);_0x14930e['offset']=qs[_0xa0f0('0x15')](_0x3c14ee[_0xa0f0('0x2a')][_0xa0f0('0x15')]);}return _0x1485e1[_0xa0f0('0x4c')](_0x14930e);}})[_0xa0f0('0x1f')](function(_0x4fbb62){if(_0x4fbb62){return _0x4fbb62?{'count':_0x55bf56,'rows':_0x4fbb62}:null;}})[_0xa0f0('0x1f')](respondWithResult(_0x3b3062,null))[_0xa0f0('0x3b')](handleError(_0x3b3062,null));};exports[_0xa0f0('0x4e')]=function(_0x138a96,_0x33bd75,_0x19002e){if(_0x138a96[_0xa0f0('0x44')]['id']){delete _0x138a96['body']['id'];}return db['DeskConfiguration'][_0xa0f0('0x47')]({'where':{'id':_0x138a96[_0xa0f0('0x3d')]['id']}})[_0xa0f0('0x1f')](handleEntityNotFound(_0x33bd75,null))[_0xa0f0('0x1f')](function(_0x44ba14){if(_0x44ba14){return _0x44ba14[_0xa0f0('0x4e')](_0x138a96[_0xa0f0('0x44')][_0xa0f0('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x33bd75,null))[_0xa0f0('0x3b')](handleError(_0x33bd75,null));}; \ No newline at end of file +var _0x335e=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','find','catch','create','body','params','getFields','DeskField','rawAttributes','getSubjects','getDescriptions','findOne'];(function(_0x189fee,_0x278c9c){var _0x4d87d3=function(_0x401d0f){while(--_0x401d0f){_0x189fee['push'](_0x189fee['shift']());}};_0x4d87d3(++_0x278c9c);}(_0x335e,0xb2));var _0xe335=function(_0x3e8588,_0x2efec5){_0x3e8588=_0x3e8588-0x0;var _0x352103=_0x335e[_0x3e8588];return _0x352103;};'use strict';var emlformat=require(_0xe335('0x0'));var rimraf=require(_0xe335('0x1'));var zipdir=require(_0xe335('0x2'));var jsonpatch=require(_0xe335('0x3'));var rp=require(_0xe335('0x4'));var moment=require(_0xe335('0x5'));var BPromise=require(_0xe335('0x6'));var Mustache=require(_0xe335('0x7'));var util=require(_0xe335('0x8'));var path=require(_0xe335('0x9'));var sox=require(_0xe335('0xa'));var csv=require(_0xe335('0xb'));var ejs=require(_0xe335('0xc'));var fs=require('fs');var fs_extra=require(_0xe335('0xd'));var _=require(_0xe335('0xe'));var squel=require(_0xe335('0xf'));var crypto=require('crypto');var jsforce=require(_0xe335('0x10'));var deskjs=require(_0xe335('0x11'));var toCsv=require(_0xe335('0xb'));var querystring=require('querystring');var Papa=require(_0xe335('0x12'));var Redis=require('ioredis');var authService=require(_0xe335('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe335('0x14'));var hardwareService=require(_0xe335('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe335('0x16'));var config=require(_0xe335('0x17'));var licenseUtil=require(_0xe335('0x18'));var db=require(_0xe335('0x19'))['db'];function respondWithStatusCode(_0x532ab7,_0x152b9d){_0x152b9d=_0x152b9d||0xcc;return function(_0x192cc8){if(_0x192cc8){return _0x532ab7['sendStatus'](_0x152b9d);}return _0x532ab7['status'](_0x152b9d)['end']();};}function respondWithResult(_0x3c91df,_0x50d2d3){_0x50d2d3=_0x50d2d3||0xc8;return function(_0x40021a){if(_0x40021a){return _0x3c91df[_0xe335('0x1a')](_0x50d2d3)[_0xe335('0x1b')](_0x40021a);}};}function respondWithFilteredResult(_0x1a3880,_0x4987ef){return function(_0x70c99d){if(_0x70c99d){var _0x4a19d1=typeof _0x4987ef['offset']===_0xe335('0x1c')&&typeof _0x4987ef[_0xe335('0x1d')]===_0xe335('0x1c');var _0x494ed4=_0x70c99d['count'];var _0x596eae=_0x4a19d1?0x0:_0x4987ef['offset'];var _0x3f99bc=_0x4a19d1?_0x70c99d[_0xe335('0x1e')]:_0x4987ef[_0xe335('0x1f')]+_0x4987ef[_0xe335('0x1d')];var _0x4f62cf;if(_0x3f99bc>=_0x494ed4){_0x3f99bc=_0x494ed4;_0x4f62cf=0xc8;}else{_0x4f62cf=0xce;}_0x1a3880['status'](_0x4f62cf);return _0x1a3880[_0xe335('0x20')](_0xe335('0x21'),_0x596eae+'-'+_0x3f99bc+'/'+_0x494ed4)[_0xe335('0x1b')](_0x70c99d);}return null;};}function patchUpdates(_0x4d2f1c){return function(_0x2113c8){try{jsonpatch[_0xe335('0x22')](_0x2113c8,_0x4d2f1c,!![]);}catch(_0x2c589f){return BPromise[_0xe335('0x23')](_0x2c589f);}return _0x2113c8[_0xe335('0x24')]();};}function saveUpdates(_0x3110b8,_0x4db267){return function(_0x3233c9){if(_0x3233c9){return _0x3233c9[_0xe335('0x25')](_0x3110b8)[_0xe335('0x26')](function(_0x972a8e){return _0x972a8e;});}return null;};}function removeEntity(_0xddb677,_0xd4f5a0){return function(_0xfd5c62){if(_0xfd5c62){return _0xfd5c62[_0xe335('0x27')]()[_0xe335('0x26')](function(){_0xddb677[_0xe335('0x1a')](0xcc)[_0xe335('0x28')]();});}};}function handleEntityNotFound(_0x37fc68,_0x4b265e){return function(_0x52de3e){if(!_0x52de3e){_0x37fc68[_0xe335('0x29')](0x194);}return _0x52de3e;};}function handleError(_0x410419,_0x3994f3){_0x3994f3=_0x3994f3||0x1f4;return function(_0x448471){logger[_0xe335('0x2a')](_0x448471[_0xe335('0x2b')]);if(_0x448471[_0xe335('0x2c')]){delete _0x448471[_0xe335('0x2c')];}_0x410419['status'](_0x3994f3)[_0xe335('0x2d')](_0x448471);};}exports[_0xe335('0x2e')]=function(_0x5ae075,_0x595a9d){var _0x456905={},_0x530c6c={},_0x237e72={'count':0x0,'rows':[]};var _0x3c404d=_[_0xe335('0x2f')](db[_0xe335('0x30')]['rawAttributes'],function(_0x344e2b){return{'name':_0x344e2b[_0xe335('0x31')],'type':_0x344e2b[_0xe335('0x32')]['key']};});_0x530c6c[_0xe335('0x33')]=_[_0xe335('0x2f')](_0x3c404d,_0xe335('0x2c'));_0x530c6c[_0xe335('0x34')]=_[_0xe335('0x35')](_0x5ae075[_0xe335('0x34')]);_0x530c6c['filters']=_[_0xe335('0x36')](_0x530c6c['model'],_0x530c6c[_0xe335('0x34')]);_0x456905[_0xe335('0x37')]=_[_0xe335('0x36')](_0x530c6c['model'],qs[_0xe335('0x38')](_0x5ae075[_0xe335('0x34')][_0xe335('0x38')]));_0x456905[_0xe335('0x37')]=_0x456905['attributes'][_0xe335('0x39')]?_0x456905[_0xe335('0x37')]:_0x530c6c['model'];if(!_0x5ae075[_0xe335('0x34')][_0xe335('0x3a')](_0xe335('0x3b'))){_0x456905[_0xe335('0x1d')]=qs[_0xe335('0x1d')](_0x5ae075['query']['limit']);_0x456905[_0xe335('0x1f')]=qs[_0xe335('0x1f')](_0x5ae075[_0xe335('0x34')][_0xe335('0x1f')]);}_0x456905[_0xe335('0x3c')]=qs[_0xe335('0x3d')](_0x5ae075[_0xe335('0x34')][_0xe335('0x3d')]);_0x456905[_0xe335('0x3e')]=qs[_0xe335('0x3f')](_[_0xe335('0x40')](_0x5ae075[_0xe335('0x34')],_0x530c6c[_0xe335('0x3f')]),_0x3c404d);if(_0x5ae075['query'][_0xe335('0x41')]){_0x456905['where']=_['merge'](_0x456905[_0xe335('0x3e')],{'$or':_[_0xe335('0x2f')](_0x3c404d,function(_0x328a50){if(_0x328a50[_0xe335('0x32')]!=='VIRTUAL'){var _0x40d691={};_0x40d691[_0x328a50[_0xe335('0x2c')]]={'$like':'%'+_0x5ae075[_0xe335('0x34')][_0xe335('0x41')]+'%'};return _0x40d691;}})});}_0x456905=_[_0xe335('0x42')]({},_0x456905,_0x5ae075[_0xe335('0x43')]);var _0xb53704={'where':_0x456905[_0xe335('0x3e')]};return db[_0xe335('0x30')][_0xe335('0x1e')](_0xb53704)[_0xe335('0x26')](function(_0x512786){_0x237e72[_0xe335('0x1e')]=_0x512786;if(_0x5ae075['query'][_0xe335('0x44')]){_0x456905[_0xe335('0x45')]=[{'all':!![]}];}return db[_0xe335('0x30')][_0xe335('0x46')](_0x456905);})[_0xe335('0x26')](function(_0x1ed108){_0x237e72['rows']=_0x1ed108;return _0x237e72;})[_0xe335('0x26')](respondWithFilteredResult(_0x595a9d,_0x456905))['catch'](handleError(_0x595a9d,null));};exports[_0xe335('0x47')]=function(_0x2a9d25,_0xa8cca0){var _0x116c60={'raw':![],'where':{'id':_0x2a9d25['params']['id']}},_0x5c1ee8={};_0x5c1ee8[_0xe335('0x33')]=_[_0xe335('0x35')](db[_0xe335('0x30')]['rawAttributes']);_0x5c1ee8[_0xe335('0x34')]=_[_0xe335('0x35')](_0x2a9d25['query']);_0x5c1ee8[_0xe335('0x3f')]=_['intersection'](_0x5c1ee8[_0xe335('0x33')],_0x5c1ee8[_0xe335('0x34')]);_0x116c60[_0xe335('0x37')]=_[_0xe335('0x36')](_0x5c1ee8[_0xe335('0x33')],qs[_0xe335('0x38')](_0x2a9d25[_0xe335('0x34')][_0xe335('0x38')]));_0x116c60[_0xe335('0x37')]=_0x116c60['attributes']['length']?_0x116c60[_0xe335('0x37')]:_0x5c1ee8['model'];if(_0x2a9d25[_0xe335('0x34')][_0xe335('0x44')]){_0x116c60[_0xe335('0x45')]=[{'all':!![]}];}_0x116c60=_[_0xe335('0x42')]({},_0x116c60,_0x2a9d25[_0xe335('0x43')]);return db[_0xe335('0x30')][_0xe335('0x48')](_0x116c60)[_0xe335('0x26')](handleEntityNotFound(_0xa8cca0,null))[_0xe335('0x26')](respondWithResult(_0xa8cca0,null))[_0xe335('0x49')](handleError(_0xa8cca0,null));};exports[_0xe335('0x4a')]=function(_0xc2e788,_0x4e7d54){return db[_0xe335('0x30')][_0xe335('0x4a')](_0xc2e788[_0xe335('0x4b')],{})[_0xe335('0x26')](respondWithResult(_0x4e7d54,0xc9))[_0xe335('0x49')](handleError(_0x4e7d54,null));};exports[_0xe335('0x25')]=function(_0x6b8ac3,_0x58591d){if(_0x6b8ac3[_0xe335('0x4b')]['id']){delete _0x6b8ac3['body']['id'];}return db[_0xe335('0x30')][_0xe335('0x48')]({'where':{'id':_0x6b8ac3[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x58591d,null))[_0xe335('0x26')](saveUpdates(_0x6b8ac3['body'],null))[_0xe335('0x26')](respondWithResult(_0x58591d,null))['catch'](handleError(_0x58591d,null));};exports[_0xe335('0x27')]=function(_0x2458c0,_0x47cd5f){return db['DeskConfiguration'][_0xe335('0x48')]({'where':{'id':_0x2458c0[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x47cd5f,null))[_0xe335('0x26')](removeEntity(_0x47cd5f,null))['catch'](handleError(_0x47cd5f,null));};exports[_0xe335('0x4d')]=function(_0x5dc80f,_0x626f17,_0x332902){var _0xd6cb9f={};var _0x255305={};var _0x4a8168;var _0x540bd0;return db[_0xe335('0x30')]['findOne']({'where':{'id':_0x5dc80f[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x626f17,null))[_0xe335('0x26')](function(_0x554f2a){if(_0x554f2a){_0x4a8168=_0x554f2a;_0x255305[_0xe335('0x33')]=_[_0xe335('0x35')](db[_0xe335('0x4e')][_0xe335('0x4f')]);_0x255305[_0xe335('0x34')]=_[_0xe335('0x35')](_0x5dc80f[_0xe335('0x34')]);_0x255305['filters']=_[_0xe335('0x36')](_0x255305[_0xe335('0x33')],_0x255305[_0xe335('0x34')]);_0xd6cb9f[_0xe335('0x37')]=_[_0xe335('0x36')](_0x255305[_0xe335('0x33')],qs['fields'](_0x5dc80f['query'][_0xe335('0x38')]));_0xd6cb9f[_0xe335('0x37')]=_0xd6cb9f[_0xe335('0x37')][_0xe335('0x39')]?_0xd6cb9f[_0xe335('0x37')]:_0x255305[_0xe335('0x33')];_0xd6cb9f[_0xe335('0x3c')]=qs['sort'](_0x5dc80f['query'][_0xe335('0x3d')]);_0xd6cb9f['where']=qs[_0xe335('0x3f')](_[_0xe335('0x40')](_0x5dc80f[_0xe335('0x34')],_0x255305[_0xe335('0x3f')]));if(_0x5dc80f[_0xe335('0x34')][_0xe335('0x41')]){_0xd6cb9f[_0xe335('0x3e')]=_[_0xe335('0x42')](_0xd6cb9f['where'],{'$or':_[_0xe335('0x2f')](_0xd6cb9f[_0xe335('0x37')],function(_0x4f7b90){var _0x493c15={};_0x493c15[_0x4f7b90]={'$like':'%'+_0x5dc80f[_0xe335('0x34')][_0xe335('0x41')]+'%'};return _0x493c15;})});}_0xd6cb9f=_[_0xe335('0x42')]({},_0xd6cb9f,_0x5dc80f[_0xe335('0x43')]);return _0x4a8168[_0xe335('0x4d')](_0xd6cb9f);}})[_0xe335('0x26')](function(_0x22119b){if(_0x22119b){_0x540bd0=_0x22119b[_0xe335('0x39')];if(!_0x5dc80f[_0xe335('0x34')]['hasOwnProperty']('nolimit')){_0xd6cb9f['limit']=qs[_0xe335('0x1d')](_0x5dc80f[_0xe335('0x34')][_0xe335('0x1d')]);_0xd6cb9f['offset']=qs[_0xe335('0x1f')](_0x5dc80f['query'][_0xe335('0x1f')]);}return _0x4a8168[_0xe335('0x4d')](_0xd6cb9f);}})[_0xe335('0x26')](function(_0x5b226c){if(_0x5b226c){return _0x5b226c?{'count':_0x540bd0,'rows':_0x5b226c}:null;}})[_0xe335('0x26')](respondWithResult(_0x626f17,null))[_0xe335('0x49')](handleError(_0x626f17,null));};exports['getSubjects']=function(_0x575466,_0x4cea8b,_0x54530a){var _0x44d21d={};var _0x58d532={};var _0x1837c2;var _0x20de63;return db[_0xe335('0x30')]['findOne']({'where':{'id':_0x575466[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x4cea8b,null))[_0xe335('0x26')](function(_0x2c0053){if(_0x2c0053){_0x1837c2=_0x2c0053;_0x58d532['model']=_['keys'](db[_0xe335('0x4e')][_0xe335('0x4f')]);_0x58d532[_0xe335('0x34')]=_[_0xe335('0x35')](_0x575466['query']);_0x58d532['filters']=_[_0xe335('0x36')](_0x58d532[_0xe335('0x33')],_0x58d532[_0xe335('0x34')]);_0x44d21d['attributes']=_['intersection'](_0x58d532[_0xe335('0x33')],qs['fields'](_0x575466['query'][_0xe335('0x38')]));_0x44d21d[_0xe335('0x37')]=_0x44d21d[_0xe335('0x37')]['length']?_0x44d21d[_0xe335('0x37')]:_0x58d532[_0xe335('0x33')];_0x44d21d[_0xe335('0x3c')]=qs[_0xe335('0x3d')](_0x575466['query'][_0xe335('0x3d')]);_0x44d21d[_0xe335('0x3e')]=qs[_0xe335('0x3f')](_[_0xe335('0x40')](_0x575466['query'],_0x58d532[_0xe335('0x3f')]));if(_0x575466[_0xe335('0x34')][_0xe335('0x41')]){_0x44d21d[_0xe335('0x3e')]=_[_0xe335('0x42')](_0x44d21d[_0xe335('0x3e')],{'$or':_[_0xe335('0x2f')](_0x44d21d[_0xe335('0x37')],function(_0x56df20){var _0x5a532f={};_0x5a532f[_0x56df20]={'$like':'%'+_0x575466[_0xe335('0x34')][_0xe335('0x41')]+'%'};return _0x5a532f;})});}_0x44d21d=_[_0xe335('0x42')]({},_0x44d21d,_0x575466[_0xe335('0x43')]);return _0x1837c2['getSubjects'](_0x44d21d);}})['then'](function(_0x317b4e){if(_0x317b4e){_0x20de63=_0x317b4e[_0xe335('0x39')];if(!_0x575466[_0xe335('0x34')][_0xe335('0x3a')](_0xe335('0x3b'))){_0x44d21d[_0xe335('0x1d')]=qs[_0xe335('0x1d')](_0x575466[_0xe335('0x34')][_0xe335('0x1d')]);_0x44d21d[_0xe335('0x1f')]=qs['offset'](_0x575466['query'][_0xe335('0x1f')]);}return _0x1837c2[_0xe335('0x50')](_0x44d21d);}})[_0xe335('0x26')](function(_0x17765e){if(_0x17765e){return _0x17765e?{'count':_0x20de63,'rows':_0x17765e}:null;}})[_0xe335('0x26')](respondWithResult(_0x4cea8b,null))[_0xe335('0x49')](handleError(_0x4cea8b,null));};exports[_0xe335('0x51')]=function(_0x416335,_0x1a3f6e,_0x196d4a){var _0x3eff63={};var _0x198c18={};var _0x1644b2;var _0x5dd5bd;return db[_0xe335('0x30')][_0xe335('0x52')]({'where':{'id':_0x416335[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x1a3f6e,null))[_0xe335('0x26')](function(_0x3dbf9b){if(_0x3dbf9b){_0x1644b2=_0x3dbf9b;_0x198c18[_0xe335('0x33')]=_[_0xe335('0x35')](db[_0xe335('0x4e')]['rawAttributes']);_0x198c18[_0xe335('0x34')]=_[_0xe335('0x35')](_0x416335[_0xe335('0x34')]);_0x198c18['filters']=_[_0xe335('0x36')](_0x198c18[_0xe335('0x33')],_0x198c18['query']);_0x3eff63['attributes']=_[_0xe335('0x36')](_0x198c18[_0xe335('0x33')],qs[_0xe335('0x38')](_0x416335[_0xe335('0x34')][_0xe335('0x38')]));_0x3eff63[_0xe335('0x37')]=_0x3eff63[_0xe335('0x37')][_0xe335('0x39')]?_0x3eff63[_0xe335('0x37')]:_0x198c18[_0xe335('0x33')];_0x3eff63[_0xe335('0x3c')]=qs[_0xe335('0x3d')](_0x416335[_0xe335('0x34')][_0xe335('0x3d')]);_0x3eff63['where']=qs[_0xe335('0x3f')](_[_0xe335('0x40')](_0x416335[_0xe335('0x34')],_0x198c18[_0xe335('0x3f')]));if(_0x416335[_0xe335('0x34')][_0xe335('0x41')]){_0x3eff63['where']=_[_0xe335('0x42')](_0x3eff63[_0xe335('0x3e')],{'$or':_['map'](_0x3eff63[_0xe335('0x37')],function(_0x128e05){var _0x4c1345={};_0x4c1345[_0x128e05]={'$like':'%'+_0x416335[_0xe335('0x34')]['filter']+'%'};return _0x4c1345;})});}_0x3eff63=_[_0xe335('0x42')]({},_0x3eff63,_0x416335[_0xe335('0x43')]);return _0x1644b2[_0xe335('0x51')](_0x3eff63);}})[_0xe335('0x26')](function(_0x364d3a){if(_0x364d3a){_0x5dd5bd=_0x364d3a[_0xe335('0x39')];if(!_0x416335[_0xe335('0x34')]['hasOwnProperty'](_0xe335('0x3b'))){_0x3eff63[_0xe335('0x1d')]=qs['limit'](_0x416335['query'][_0xe335('0x1d')]);_0x3eff63[_0xe335('0x1f')]=qs[_0xe335('0x1f')](_0x416335[_0xe335('0x34')]['offset']);}return _0x1644b2[_0xe335('0x51')](_0x3eff63);}})['then'](function(_0x263568){if(_0x263568){return _0x263568?{'count':_0x5dd5bd,'rows':_0x263568}:null;}})[_0xe335('0x26')](respondWithResult(_0x1a3f6e,null))[_0xe335('0x49')](handleError(_0x1a3f6e,null));};exports[_0xe335('0x53')]=function(_0x53d8a4,_0xbcd911,_0x5e0cdb){var _0x519d2a={};var _0x1ae172={};var _0x37152d;var _0x39f670;return db['DeskConfiguration'][_0xe335('0x52')]({'where':{'id':_0x53d8a4['params']['id']}})['then'](handleEntityNotFound(_0xbcd911,null))[_0xe335('0x26')](function(_0x11c355){if(_0x11c355){_0x37152d=_0x11c355;_0x1ae172[_0xe335('0x33')]=_[_0xe335('0x35')](db[_0xe335('0x54')][_0xe335('0x4f')]);_0x1ae172[_0xe335('0x34')]=_[_0xe335('0x35')](_0x53d8a4[_0xe335('0x34')]);_0x1ae172[_0xe335('0x3f')]=_[_0xe335('0x36')](_0x1ae172[_0xe335('0x33')],_0x1ae172['query']);_0x519d2a['attributes']=_[_0xe335('0x36')](_0x1ae172[_0xe335('0x33')],qs[_0xe335('0x38')](_0x53d8a4['query'][_0xe335('0x38')]));_0x519d2a['attributes']=_0x519d2a[_0xe335('0x37')]['length']?_0x519d2a[_0xe335('0x37')]:_0x1ae172[_0xe335('0x33')];_0x519d2a[_0xe335('0x3c')]=qs[_0xe335('0x3d')](_0x53d8a4[_0xe335('0x34')][_0xe335('0x3d')]);_0x519d2a['where']=qs[_0xe335('0x3f')](_[_0xe335('0x40')](_0x53d8a4[_0xe335('0x34')],_0x1ae172[_0xe335('0x3f')]));if(_0x53d8a4[_0xe335('0x34')]['filter']){_0x519d2a[_0xe335('0x3e')]=_['merge'](_0x519d2a[_0xe335('0x3e')],{'$or':_[_0xe335('0x2f')](_0x519d2a[_0xe335('0x37')],function(_0x1bba33){var _0x562efd={};_0x562efd[_0x1bba33]={'$like':'%'+_0x53d8a4[_0xe335('0x34')][_0xe335('0x41')]+'%'};return _0x562efd;})});}_0x519d2a=_['merge']({},_0x519d2a,_0x53d8a4[_0xe335('0x43')]);return _0x37152d[_0xe335('0x53')](_0x519d2a);}})[_0xe335('0x26')](function(_0x5c3cce){if(_0x5c3cce){_0x39f670=_0x5c3cce['length'];if(!_0x53d8a4[_0xe335('0x34')][_0xe335('0x3a')](_0xe335('0x3b'))){_0x519d2a[_0xe335('0x1d')]=qs['limit'](_0x53d8a4[_0xe335('0x34')][_0xe335('0x1d')]);_0x519d2a['offset']=qs[_0xe335('0x1f')](_0x53d8a4['query'][_0xe335('0x1f')]);}return _0x37152d[_0xe335('0x53')](_0x519d2a);}})[_0xe335('0x26')](function(_0x303898){if(_0x303898){return _0x303898?{'count':_0x39f670,'rows':_0x303898}:null;}})[_0xe335('0x26')](respondWithResult(_0xbcd911,null))[_0xe335('0x49')](handleError(_0xbcd911,null));};exports[_0xe335('0x55')]=function(_0x3dee0b,_0x53d94b,_0x2584ca){if(_0x3dee0b['body']['id']){delete _0x3dee0b['body']['id'];}return db[_0xe335('0x30')][_0xe335('0x52')]({'where':{'id':_0x3dee0b[_0xe335('0x4c')]['id']}})[_0xe335('0x26')](handleEntityNotFound(_0x53d94b,null))[_0xe335('0x26')](function(_0x453daa){if(_0x453daa){return _0x453daa[_0xe335('0x55')](_0x3dee0b[_0xe335('0x4b')][_0xe335('0x56')]||[]);}return null;})[_0xe335('0x26')](respondWithResult(_0x53d94b,null))[_0xe335('0x49')](handleError(_0x53d94b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5f1b831..ed88cd1 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 _0x0d90=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x220ef3,_0x409fe4){var _0x4c6ab9=function(_0x4c5a3f){while(--_0x4c5a3f){_0x220ef3['push'](_0x220ef3['shift']());}};_0x4c6ab9(++_0x409fe4);}(_0x0d90,0xa0));var _0x00d9=function(_0xd47129,_0x5936fa){_0xd47129=_0xd47129-0x0;var _0x3ac4a4=_0x0d90[_0xd47129];return _0x3ac4a4;};'use strict';var _=require(_0x00d9('0x0'));var util=require(_0x00d9('0x1'));var logger=require(_0x00d9('0x2'))('api');var moment=require(_0x00d9('0x3'));var BPromise=require(_0x00d9('0x4'));var rp=require(_0x00d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00d9('0x6'));var config=require(_0x00d9('0x7'));var attributes=require(_0x00d9('0x8'));module[_0x00d9('0x9')]=function(_0xf76e6a,_0x5768fb){return _0xf76e6a[_0x00d9('0xa')](_0x00d9('0xb'),attributes,{'tableName':_0x00d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd39b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util'];(function(_0x299a26,_0x474a6c){var _0x43923b=function(_0x4bf774){while(--_0x4bf774){_0x299a26['push'](_0x299a26['shift']());}};_0x43923b(++_0x474a6c);}(_0xd39b,0xec));var _0xbd39=function(_0x4a8bbf,_0x37889c){_0x4a8bbf=_0x4a8bbf-0x0;var _0x22e263=_0xd39b[_0x4a8bbf];return _0x22e263;};'use strict';var _=require(_0xbd39('0x0'));var util=require(_0xbd39('0x1'));var logger=require(_0xbd39('0x2'))(_0xbd39('0x3'));var moment=require(_0xbd39('0x4'));var BPromise=require(_0xbd39('0x5'));var rp=require(_0xbd39('0x6'));var fs=require('fs');var path=require(_0xbd39('0x7'));var rimraf=require(_0xbd39('0x8'));var config=require(_0xbd39('0x9'));var attributes=require(_0xbd39('0xa'));module[_0xbd39('0xb')]=function(_0x1c5f75,_0x58d371){return _0x1c5f75[_0xbd39('0xc')]('DeskConfiguration',attributes,{'tableName':_0xbd39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 390bacc..02d6602 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 _0x2581=['request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','DeskConfiguration,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x20039f,_0x3d04d1){var _0x5a779a=function(_0x37e602){while(--_0x37e602){_0x20039f['push'](_0x20039f['shift']());}};_0x5a779a(++_0x3d04d1);}(_0x2581,0xcb));var _0x1258=function(_0x50a2a9,_0x1ac5e4){_0x50a2a9=_0x50a2a9-0x0;var _0x3effad=_0x2581[_0x50a2a9];return _0x3effad;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1258('0x5'))['db'];var utils=require(_0x1258('0x6'));var logger=require(_0x1258('0x7'))(_0x1258('0x8'));var config=require(_0x1258('0x9'));var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582ed7,_0x3e1044,_0x21cd98){return new BPromise(function(_0x468494,_0x18bbac){return client[_0x1258('0xd')](_0x582ed7,_0x21cd98)[_0x1258('0xe')](function(_0x429efc){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3e1044,_0x1258('0xf'));logger[_0x1258('0x10')](_0x1258('0x11'),_0x3e1044,_0x1258('0xf'),JSON['stringify'](_0x429efc));if(_0x429efc[_0x1258('0x12')]){if(_0x429efc[_0x1258('0x12')][_0x1258('0x13')]===0x1f4){logger[_0x1258('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3e1044,_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);return _0x18bbac(_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);}logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x429efc[_0x1258('0x12')]['message']);return _0x468494(_0x429efc[_0x1258('0x12')]['message']);}else{logger[_0x1258('0x16')](_0x1258('0x15'),_0x3e1044,_0x1258('0xf'));_0x468494(_0x429efc[_0x1258('0x17')][_0x1258('0x14')]);}})['catch'](function(_0x1645a6){logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x1645a6);_0x18bbac(_0x1645a6);});});} \ No newline at end of file +var _0xb03e=['debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb03e,0x1eb));var _0xeb03=function(_0x103e7f,_0x413d27){_0x103e7f=_0x103e7f-0x0;var _0x4622bc=_0xb03e[_0x103e7f];return _0x4622bc;};'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')]('DeskConfiguration,\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')]('DeskConfiguration,\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);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index ac234f3..9aea90a 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 _0xaa61=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x2929ac,_0x56a221){_0x2929ac=_0x2929ac-0x0;var _0x4e1633=_0xaa61[_0x2929ac];return _0x4e1633;};'use strict';var multer=require(_0x1aa6('0x0'));var util=require(_0x1aa6('0x1'));var path=require(_0x1aa6('0x2'));var timeout=require(_0x1aa6('0x3'));var express=require('express');var router=express[_0x1aa6('0x4')]();var fs_extra=require(_0x1aa6('0x5'));var auth=require(_0x1aa6('0x6'));var interaction=require(_0x1aa6('0x7'));var config=require(_0x1aa6('0x8'));var controller=require(_0x1aa6('0x9'));router[_0x1aa6('0xa')]('/',auth[_0x1aa6('0xb')](),controller[_0x1aa6('0xc')]);router[_0x1aa6('0xa')](_0x1aa6('0xd'),auth[_0x1aa6('0xb')](),controller[_0x1aa6('0xe')]);router['post']('/',auth[_0x1aa6('0xb')](),controller[_0x1aa6('0xf')]);router['put']('/:id',auth[_0x1aa6('0xb')](),controller[_0x1aa6('0x10')]);router[_0x1aa6('0x11')](_0x1aa6('0xd'),auth[_0x1aa6('0xb')](),controller[_0x1aa6('0x12')]);module[_0x1aa6('0x13')]=router; \ No newline at end of file +var _0x9679=['/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x9ec8dd,_0x222146){var _0x54a46d=function(_0x47d258){while(--_0x47d258){_0x9ec8dd['push'](_0x9ec8dd['shift']());}};_0x54a46d(++_0x222146);}(_0x9679,0x15f));var _0x9967=function(_0x53bf37,_0x4f62a7){_0x53bf37=_0x53bf37-0x0;var _0x139195=_0x9679[_0x53bf37];return _0x139195;};'use strict';var multer=require(_0x9967('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9967('0x1'));var express=require(_0x9967('0x2'));var router=express[_0x9967('0x3')]();var fs_extra=require(_0x9967('0x4'));var auth=require(_0x9967('0x5'));var interaction=require(_0x9967('0x6'));var config=require(_0x9967('0x7'));var controller=require(_0x9967('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9967('0x9')](_0x9967('0xa'),auth['isAuthenticated'](),controller[_0x9967('0xb')]);router['post']('/',auth[_0x9967('0xc')](),controller[_0x9967('0xd')]);router[_0x9967('0xe')](_0x9967('0xa'),auth[_0x9967('0xc')](),controller[_0x9967('0xf')]);router[_0x9967('0x10')](_0x9967('0xa'),auth[_0x9967('0xc')](),controller[_0x9967('0x11')]);module[_0x9967('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index b6b0c95..f118293 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 _0x5b66=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5b66,0xbc));var _0x65b6=function(_0x12aeca,_0x508c69){_0x12aeca=_0x12aeca-0x0;var _0x3c2594=_0x5b66[_0x12aeca];return _0x3c2594;};'use strict';var Sequelize=require(_0x65b6('0x0'));module['exports']={'type':{'type':Sequelize[_0x65b6('0x1')](_0x65b6('0x2'),_0x65b6('0x3'),_0x65b6('0x4'),_0x65b6('0x5'),_0x65b6('0x6')),'defaultValue':_0x65b6('0x2')},'content':{'type':Sequelize[_0x65b6('0x7')]},'key':{'type':Sequelize[_0x65b6('0x7')]},'keyType':{'type':Sequelize[_0x65b6('0x1')]('string',_0x65b6('0x3'),_0x65b6('0x4'))},'keyContent':{'type':Sequelize[_0x65b6('0x7')]},'idField':{'type':Sequelize[_0x65b6('0x7')]},'nameField':{'type':Sequelize[_0x65b6('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x65b6('0x7')]}}; \ No newline at end of file +var _0x81db=['BOOLEAN','ENUM','variable','customVariable','keyValue','picklist','STRING','string'];(function(_0x400257,_0x1b9c00){var _0x3456f4=function(_0x28cd5e){while(--_0x28cd5e){_0x400257['push'](_0x400257['shift']());}};_0x3456f4(++_0x1b9c00);}(_0x81db,0x1d9));var _0xb81d=function(_0x2bd750,_0x39be0a){_0x2bd750=_0x2bd750-0x0;var _0xf32aab=_0x81db[_0x2bd750];return _0xf32aab;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb81d('0x0')]('string',_0xb81d('0x1'),_0xb81d('0x2'),_0xb81d('0x3'),_0xb81d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb81d('0x5')]},'keyType':{'type':Sequelize[_0xb81d('0x0')](_0xb81d('0x6'),_0xb81d('0x1'),_0xb81d('0x2'))},'keyContent':{'type':Sequelize[_0xb81d('0x5')]},'idField':{'type':Sequelize[_0xb81d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb81d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb81d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 03f288b..d988306 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 _0x2e09=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskField','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','rawAttributes','intersection','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x8e8bec,_0x4d0674){var _0x291092=function(_0x27c921){while(--_0x27c921){_0x8e8bec['push'](_0x8e8bec['shift']());}};_0x291092(++_0x4d0674);}(_0x2e09,0xc8));var _0x92e0=function(_0x475a35,_0x217ce9){_0x475a35=_0x475a35-0x0;var _0x256a51=_0x2e09[_0x475a35];return _0x256a51;};'use strict';var emlformat=require(_0x92e0('0x0'));var rimraf=require(_0x92e0('0x1'));var zipdir=require(_0x92e0('0x2'));var jsonpatch=require(_0x92e0('0x3'));var rp=require(_0x92e0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x92e0('0x5'));var util=require(_0x92e0('0x6'));var path=require(_0x92e0('0x7'));var sox=require(_0x92e0('0x8'));var csv=require(_0x92e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92e0('0xa'));var squel=require(_0x92e0('0xb'));var crypto=require(_0x92e0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x92e0('0x9'));var querystring=require(_0x92e0('0xd'));var Papa=require(_0x92e0('0xe'));var Redis=require('ioredis');var authService=require(_0x92e0('0xf'));var qs=require(_0x92e0('0x10'));var as=require(_0x92e0('0x11'));var hardwareService=require(_0x92e0('0x12'));var logger=require(_0x92e0('0x13'))(_0x92e0('0x14'));var utils=require('../../config/utils');var config=require(_0x92e0('0x15'));var licenseUtil=require(_0x92e0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d634f,_0x1349d1){_0x1349d1=_0x1349d1||0xcc;return function(_0x37e9ed){if(_0x37e9ed){return _0x5d634f['sendStatus'](_0x1349d1);}return _0x5d634f[_0x92e0('0x17')](_0x1349d1)[_0x92e0('0x18')]();};}function respondWithResult(_0x1ad54f,_0x5f4615){_0x5f4615=_0x5f4615||0xc8;return function(_0x36084d){if(_0x36084d){return _0x1ad54f[_0x92e0('0x17')](_0x5f4615)[_0x92e0('0x19')](_0x36084d);}};}function respondWithFilteredResult(_0x50c648,_0x33c2c0){return function(_0x3d6d87){if(_0x3d6d87){var _0x5a7c6e=typeof _0x33c2c0[_0x92e0('0x1a')]===_0x92e0('0x1b')&&typeof _0x33c2c0[_0x92e0('0x1c')]===_0x92e0('0x1b');var _0x161938=_0x3d6d87[_0x92e0('0x1d')];var _0x5cf7f4=_0x5a7c6e?0x0:_0x33c2c0[_0x92e0('0x1a')];var _0x38c0ff=_0x5a7c6e?_0x3d6d87[_0x92e0('0x1d')]:_0x33c2c0[_0x92e0('0x1a')]+_0x33c2c0[_0x92e0('0x1c')];var _0x5aecd2;if(_0x38c0ff>=_0x161938){_0x38c0ff=_0x161938;_0x5aecd2=0xc8;}else{_0x5aecd2=0xce;}_0x50c648['status'](_0x5aecd2);return _0x50c648[_0x92e0('0x1e')](_0x92e0('0x1f'),_0x5cf7f4+'-'+_0x38c0ff+'/'+_0x161938)['json'](_0x3d6d87);}return null;};}function patchUpdates(_0x286245){return function(_0x11f3fa){try{jsonpatch[_0x92e0('0x20')](_0x11f3fa,_0x286245,!![]);}catch(_0xcd478d){return BPromise[_0x92e0('0x21')](_0xcd478d);}return _0x11f3fa[_0x92e0('0x22')]();};}function saveUpdates(_0x116d2d,_0x39391a){return function(_0x32ff72){if(_0x32ff72){return _0x32ff72[_0x92e0('0x23')](_0x116d2d)[_0x92e0('0x24')](function(_0x3742e2){return _0x3742e2;});}return null;};}function removeEntity(_0x3ea600,_0x13802d){return function(_0x5253eb){if(_0x5253eb){return _0x5253eb[_0x92e0('0x25')]()[_0x92e0('0x24')](function(){_0x3ea600[_0x92e0('0x17')](0xcc)[_0x92e0('0x18')]();});}};}function handleEntityNotFound(_0x5bf9e3,_0x3a4178){return function(_0x2ec01c){if(!_0x2ec01c){_0x5bf9e3['sendStatus'](0x194);}return _0x2ec01c;};}function handleError(_0x3c09fb,_0x34bec1){_0x34bec1=_0x34bec1||0x1f4;return function(_0x305697){logger[_0x92e0('0x26')](_0x305697['stack']);if(_0x305697[_0x92e0('0x27')]){delete _0x305697[_0x92e0('0x27')];}_0x3c09fb[_0x92e0('0x17')](_0x34bec1)[_0x92e0('0x28')](_0x305697);};}exports[_0x92e0('0x29')]=function(_0x22bc6f,_0x35eeb0){var _0x31df53={},_0x46ad00={},_0x3571bc={'count':0x0,'rows':[]};var _0x3d1ccf=_[_0x92e0('0x2a')](db[_0x92e0('0x2b')]['rawAttributes'],function(_0x2438f8){return{'name':_0x2438f8['fieldName'],'type':_0x2438f8[_0x92e0('0x2c')][_0x92e0('0x2d')]};});_0x46ad00[_0x92e0('0x2e')]=_['map'](_0x3d1ccf,_0x92e0('0x27'));_0x46ad00[_0x92e0('0x2f')]=_['keys'](_0x22bc6f[_0x92e0('0x2f')]);_0x46ad00[_0x92e0('0x30')]=_['intersection'](_0x46ad00[_0x92e0('0x2e')],_0x46ad00[_0x92e0('0x2f')]);_0x31df53[_0x92e0('0x31')]=_['intersection'](_0x46ad00[_0x92e0('0x2e')],qs[_0x92e0('0x32')](_0x22bc6f['query'][_0x92e0('0x32')]));_0x31df53[_0x92e0('0x31')]=_0x31df53['attributes'][_0x92e0('0x33')]?_0x31df53['attributes']:_0x46ad00['model'];if(!_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x34')](_0x92e0('0x35'))){_0x31df53[_0x92e0('0x1c')]=qs[_0x92e0('0x1c')](_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x1c')]);_0x31df53['offset']=qs[_0x92e0('0x1a')](_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x1a')]);}_0x31df53[_0x92e0('0x36')]=qs[_0x92e0('0x37')](_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x37')]);_0x31df53['where']=qs['filters'](_[_0x92e0('0x38')](_0x22bc6f[_0x92e0('0x2f')],_0x46ad00[_0x92e0('0x30')]),_0x3d1ccf);if(_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x39')]){_0x31df53[_0x92e0('0x3a')]=_[_0x92e0('0x3b')](_0x31df53['where'],{'$or':_['map'](_0x3d1ccf,function(_0x5783b5){if(_0x5783b5[_0x92e0('0x2c')]!==_0x92e0('0x3c')){var _0x483e54={};_0x483e54[_0x5783b5['name']]={'$like':'%'+_0x22bc6f[_0x92e0('0x2f')][_0x92e0('0x39')]+'%'};return _0x483e54;}})});}_0x31df53=_[_0x92e0('0x3b')]({},_0x31df53,_0x22bc6f[_0x92e0('0x3d')]);var _0x2521ce={'where':_0x31df53[_0x92e0('0x3a')]};return db[_0x92e0('0x2b')][_0x92e0('0x1d')](_0x2521ce)[_0x92e0('0x24')](function(_0x59559f){_0x3571bc[_0x92e0('0x1d')]=_0x59559f;if(_0x22bc6f['query'][_0x92e0('0x3e')]){_0x31df53[_0x92e0('0x3f')]=[{'all':!![]}];}return db[_0x92e0('0x2b')][_0x92e0('0x40')](_0x31df53);})[_0x92e0('0x24')](function(_0x24a807){_0x3571bc['rows']=_0x24a807;return _0x3571bc;})[_0x92e0('0x24')](respondWithFilteredResult(_0x35eeb0,_0x31df53))['catch'](handleError(_0x35eeb0,null));};exports[_0x92e0('0x41')]=function(_0x55d000,_0x1edd4c){var _0x4429bf={'raw':!![],'where':{'id':_0x55d000['params']['id']}},_0xf7219e={};_0xf7219e[_0x92e0('0x2e')]=_[_0x92e0('0x42')](db[_0x92e0('0x2b')][_0x92e0('0x43')]);_0xf7219e[_0x92e0('0x2f')]=_['keys'](_0x55d000[_0x92e0('0x2f')]);_0xf7219e[_0x92e0('0x30')]=_[_0x92e0('0x44')](_0xf7219e[_0x92e0('0x2e')],_0xf7219e[_0x92e0('0x2f')]);_0x4429bf[_0x92e0('0x31')]=_[_0x92e0('0x44')](_0xf7219e[_0x92e0('0x2e')],qs[_0x92e0('0x32')](_0x55d000[_0x92e0('0x2f')][_0x92e0('0x32')]));_0x4429bf[_0x92e0('0x31')]=_0x4429bf[_0x92e0('0x31')][_0x92e0('0x33')]?_0x4429bf[_0x92e0('0x31')]:_0xf7219e[_0x92e0('0x2e')];if(_0x55d000[_0x92e0('0x2f')][_0x92e0('0x3e')]){_0x4429bf['include']=[{'all':!![]}];}_0x4429bf=_['merge']({},_0x4429bf,_0x55d000[_0x92e0('0x3d')]);return db['DeskField'][_0x92e0('0x45')](_0x4429bf)[_0x92e0('0x24')](handleEntityNotFound(_0x1edd4c,null))[_0x92e0('0x24')](respondWithResult(_0x1edd4c,null))[_0x92e0('0x46')](handleError(_0x1edd4c,null));};exports[_0x92e0('0x47')]=function(_0x4b62f1,_0x506d67){return db[_0x92e0('0x2b')][_0x92e0('0x47')](_0x4b62f1[_0x92e0('0x48')],{})[_0x92e0('0x24')](respondWithResult(_0x506d67,0xc9))[_0x92e0('0x46')](handleError(_0x506d67,null));};exports[_0x92e0('0x23')]=function(_0x1aa63b,_0x31fdb4){if(_0x1aa63b[_0x92e0('0x48')]['id']){delete _0x1aa63b[_0x92e0('0x48')]['id'];}return db[_0x92e0('0x2b')][_0x92e0('0x45')]({'where':{'id':_0x1aa63b[_0x92e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x31fdb4,null))[_0x92e0('0x24')](saveUpdates(_0x1aa63b['body'],null))[_0x92e0('0x24')](respondWithResult(_0x31fdb4,null))[_0x92e0('0x46')](handleError(_0x31fdb4,null));};exports[_0x92e0('0x25')]=function(_0x26005a,_0x267abc){return db['DeskField'][_0x92e0('0x45')]({'where':{'id':_0x26005a[_0x92e0('0x49')]['id']}})[_0x92e0('0x24')](handleEntityNotFound(_0x267abc,null))[_0x92e0('0x24')](removeEntity(_0x267abc,null))[_0x92e0('0x46')](handleError(_0x267abc,null));}; \ No newline at end of file +var _0xc99e=['stack','name','send','index','map','DeskField','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','update','then','destroy'];(function(_0x50cf5b,_0x19b129){var _0x5d1a3a=function(_0x206bb4){while(--_0x206bb4){_0x50cf5b['push'](_0x50cf5b['shift']());}};_0x5d1a3a(++_0x19b129);}(_0xc99e,0x6e));var _0xec99=function(_0x4c4b21,_0x2e40d1){_0x4c4b21=_0x4c4b21-0x0;var _0x260480=_0xc99e[_0x4c4b21];return _0x260480;};'use strict';var emlformat=require(_0xec99('0x0'));var rimraf=require(_0xec99('0x1'));var zipdir=require(_0xec99('0x2'));var jsonpatch=require(_0xec99('0x3'));var rp=require(_0xec99('0x4'));var moment=require(_0xec99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xec99('0x6'));var util=require(_0xec99('0x7'));var path=require(_0xec99('0x8'));var sox=require(_0xec99('0x9'));var csv=require(_0xec99('0xa'));var ejs=require(_0xec99('0xb'));var fs=require('fs');var fs_extra=require(_0xec99('0xc'));var _=require(_0xec99('0xd'));var squel=require('squel');var crypto=require(_0xec99('0xe'));var jsforce=require(_0xec99('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xec99('0xa'));var querystring=require(_0xec99('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xec99('0x11'));var qs=require(_0xec99('0x12'));var as=require(_0xec99('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec99('0x14'))(_0xec99('0x15'));var utils=require(_0xec99('0x16'));var config=require(_0xec99('0x17'));var licenseUtil=require(_0xec99('0x18'));var db=require(_0xec99('0x19'))['db'];function respondWithStatusCode(_0x580b34,_0xd5aa6f){_0xd5aa6f=_0xd5aa6f||0xcc;return function(_0x549ba9){if(_0x549ba9){return _0x580b34[_0xec99('0x1a')](_0xd5aa6f);}return _0x580b34['status'](_0xd5aa6f)[_0xec99('0x1b')]();};}function respondWithResult(_0x57bf4c,_0x59374e){_0x59374e=_0x59374e||0xc8;return function(_0xc7627){if(_0xc7627){return _0x57bf4c['status'](_0x59374e)[_0xec99('0x1c')](_0xc7627);}};}function respondWithFilteredResult(_0x159c47,_0x3946b3){return function(_0x3d70fb){if(_0x3d70fb){var _0x3350f9=typeof _0x3946b3[_0xec99('0x1d')]===_0xec99('0x1e')&&typeof _0x3946b3['limit']===_0xec99('0x1e');var _0x52d9a7=_0x3d70fb[_0xec99('0x1f')];var _0x387e3d=_0x3350f9?0x0:_0x3946b3[_0xec99('0x1d')];var _0x7eb76b=_0x3350f9?_0x3d70fb['count']:_0x3946b3['offset']+_0x3946b3['limit'];var _0x1a6d8e;if(_0x7eb76b>=_0x52d9a7){_0x7eb76b=_0x52d9a7;_0x1a6d8e=0xc8;}else{_0x1a6d8e=0xce;}_0x159c47[_0xec99('0x20')](_0x1a6d8e);return _0x159c47[_0xec99('0x21')](_0xec99('0x22'),_0x387e3d+'-'+_0x7eb76b+'/'+_0x52d9a7)[_0xec99('0x1c')](_0x3d70fb);}return null;};}function patchUpdates(_0x1edaf9){return function(_0x1644a8){try{jsonpatch['apply'](_0x1644a8,_0x1edaf9,!![]);}catch(_0x56b54b){return BPromise[_0xec99('0x23')](_0x56b54b);}return _0x1644a8[_0xec99('0x24')]();};}function saveUpdates(_0x5364ee,_0xdb6cd1){return function(_0x1be97d){if(_0x1be97d){return _0x1be97d[_0xec99('0x25')](_0x5364ee)[_0xec99('0x26')](function(_0x18e065){return _0x18e065;});}return null;};}function removeEntity(_0x3c2e16,_0x1b32c6){return function(_0x10ab73){if(_0x10ab73){return _0x10ab73[_0xec99('0x27')]()[_0xec99('0x26')](function(){_0x3c2e16['status'](0xcc)[_0xec99('0x1b')]();});}};}function handleEntityNotFound(_0x588f27,_0x5aeb8f){return function(_0x5eebc1){if(!_0x5eebc1){_0x588f27[_0xec99('0x1a')](0x194);}return _0x5eebc1;};}function handleError(_0x39754c,_0x21ff98){_0x21ff98=_0x21ff98||0x1f4;return function(_0x26cd07){logger['error'](_0x26cd07[_0xec99('0x28')]);if(_0x26cd07[_0xec99('0x29')]){delete _0x26cd07[_0xec99('0x29')];}_0x39754c[_0xec99('0x20')](_0x21ff98)[_0xec99('0x2a')](_0x26cd07);};}exports[_0xec99('0x2b')]=function(_0x34f1f5,_0x185bee){var _0x12a3d6={},_0x373666={},_0x153bde={'count':0x0,'rows':[]};var _0x575ab4=_[_0xec99('0x2c')](db[_0xec99('0x2d')]['rawAttributes'],function(_0x22c264){return{'name':_0x22c264[_0xec99('0x2e')],'type':_0x22c264[_0xec99('0x2f')]['key']};});_0x373666[_0xec99('0x30')]=_[_0xec99('0x2c')](_0x575ab4,_0xec99('0x29'));_0x373666[_0xec99('0x31')]=_[_0xec99('0x32')](_0x34f1f5[_0xec99('0x31')]);_0x373666['filters']=_[_0xec99('0x33')](_0x373666[_0xec99('0x30')],_0x373666[_0xec99('0x31')]);_0x12a3d6['attributes']=_['intersection'](_0x373666['model'],qs[_0xec99('0x34')](_0x34f1f5['query'][_0xec99('0x34')]));_0x12a3d6[_0xec99('0x35')]=_0x12a3d6[_0xec99('0x35')][_0xec99('0x36')]?_0x12a3d6[_0xec99('0x35')]:_0x373666['model'];if(!_0x34f1f5[_0xec99('0x31')][_0xec99('0x37')](_0xec99('0x38'))){_0x12a3d6[_0xec99('0x39')]=qs['limit'](_0x34f1f5[_0xec99('0x31')]['limit']);_0x12a3d6['offset']=qs[_0xec99('0x1d')](_0x34f1f5['query'][_0xec99('0x1d')]);}_0x12a3d6[_0xec99('0x3a')]=qs[_0xec99('0x3b')](_0x34f1f5[_0xec99('0x31')]['sort']);_0x12a3d6['where']=qs[_0xec99('0x3c')](_['pick'](_0x34f1f5[_0xec99('0x31')],_0x373666[_0xec99('0x3c')]),_0x575ab4);if(_0x34f1f5[_0xec99('0x31')][_0xec99('0x3d')]){_0x12a3d6['where']=_[_0xec99('0x3e')](_0x12a3d6[_0xec99('0x3f')],{'$or':_[_0xec99('0x2c')](_0x575ab4,function(_0x2a40ae){if(_0x2a40ae[_0xec99('0x2f')]!=='VIRTUAL'){var _0x476b13={};_0x476b13[_0x2a40ae[_0xec99('0x29')]]={'$like':'%'+_0x34f1f5['query'][_0xec99('0x3d')]+'%'};return _0x476b13;}})});}_0x12a3d6=_[_0xec99('0x3e')]({},_0x12a3d6,_0x34f1f5[_0xec99('0x40')]);var _0x1f9f55={'where':_0x12a3d6[_0xec99('0x3f')]};return db[_0xec99('0x2d')][_0xec99('0x1f')](_0x1f9f55)[_0xec99('0x26')](function(_0x127714){_0x153bde['count']=_0x127714;if(_0x34f1f5[_0xec99('0x31')][_0xec99('0x41')]){_0x12a3d6[_0xec99('0x42')]=[{'all':!![]}];}return db[_0xec99('0x2d')][_0xec99('0x43')](_0x12a3d6);})[_0xec99('0x26')](function(_0x553d42){_0x153bde[_0xec99('0x44')]=_0x553d42;return _0x153bde;})[_0xec99('0x26')](respondWithFilteredResult(_0x185bee,_0x12a3d6))[_0xec99('0x45')](handleError(_0x185bee,null));};exports[_0xec99('0x46')]=function(_0x14a5f7,_0x1f246d){var _0x244cca={'raw':!![],'where':{'id':_0x14a5f7['params']['id']}},_0x129cc1={};_0x129cc1[_0xec99('0x30')]=_['keys'](db[_0xec99('0x2d')]['rawAttributes']);_0x129cc1[_0xec99('0x31')]=_[_0xec99('0x32')](_0x14a5f7[_0xec99('0x31')]);_0x129cc1[_0xec99('0x3c')]=_[_0xec99('0x33')](_0x129cc1[_0xec99('0x30')],_0x129cc1[_0xec99('0x31')]);_0x244cca[_0xec99('0x35')]=_[_0xec99('0x33')](_0x129cc1[_0xec99('0x30')],qs[_0xec99('0x34')](_0x14a5f7['query'][_0xec99('0x34')]));_0x244cca[_0xec99('0x35')]=_0x244cca[_0xec99('0x35')][_0xec99('0x36')]?_0x244cca['attributes']:_0x129cc1[_0xec99('0x30')];if(_0x14a5f7[_0xec99('0x31')][_0xec99('0x41')]){_0x244cca[_0xec99('0x42')]=[{'all':!![]}];}_0x244cca=_[_0xec99('0x3e')]({},_0x244cca,_0x14a5f7[_0xec99('0x40')]);return db[_0xec99('0x2d')][_0xec99('0x47')](_0x244cca)[_0xec99('0x26')](handleEntityNotFound(_0x1f246d,null))[_0xec99('0x26')](respondWithResult(_0x1f246d,null))['catch'](handleError(_0x1f246d,null));};exports[_0xec99('0x48')]=function(_0xe0672b,_0x417a09){return db[_0xec99('0x2d')][_0xec99('0x48')](_0xe0672b['body'],{})[_0xec99('0x26')](respondWithResult(_0x417a09,0xc9))[_0xec99('0x45')](handleError(_0x417a09,null));};exports['update']=function(_0x44fc7e,_0x579b41){if(_0x44fc7e[_0xec99('0x49')]['id']){delete _0x44fc7e['body']['id'];}return db[_0xec99('0x2d')][_0xec99('0x47')]({'where':{'id':_0x44fc7e[_0xec99('0x4a')]['id']}})['then'](handleEntityNotFound(_0x579b41,null))[_0xec99('0x26')](saveUpdates(_0x44fc7e[_0xec99('0x49')],null))['then'](respondWithResult(_0x579b41,null))[_0xec99('0x45')](handleError(_0x579b41,null));};exports[_0xec99('0x27')]=function(_0x4f7a71,_0xa63f76){return db['DeskField']['find']({'where':{'id':_0x4f7a71[_0xec99('0x4a')]['id']}})[_0xec99('0x26')](handleEntityNotFound(_0xa63f76,null))[_0xec99('0x26')](removeEntity(_0xa63f76,null))[_0xec99('0x45')](handleError(_0xa63f76,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4a1451d..ab865f3 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 _0x9acf=['int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','DeskField'];(function(_0x1943cf,_0x21c64d){var _0x2e1c29=function(_0x4f075e){while(--_0x4f075e){_0x1943cf['push'](_0x1943cf['shift']());}};_0x2e1c29(++_0x21c64d);}(_0x9acf,0x17b));var _0xf9ac=function(_0x19e5bf,_0x1c53a1){_0x19e5bf=_0x19e5bf-0x0;var _0x2d616d=_0x9acf[_0x19e5bf];return _0x2d616d;};'use strict';var _=require('lodash');var util=require(_0xf9ac('0x0'));var logger=require(_0xf9ac('0x1'))(_0xf9ac('0x2'));var moment=require(_0xf9ac('0x3'));var BPromise=require(_0xf9ac('0x4'));var rp=require(_0xf9ac('0x5'));var fs=require('fs');var path=require(_0xf9ac('0x6'));var rimraf=require(_0xf9ac('0x7'));var config=require(_0xf9ac('0x8'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x508848,_0x28a0db){return _0x508848[_0xf9ac('0x9')](_0xf9ac('0xa'),attributes,{'tableName':_0xf9ac('0xb'),'paranoid':![],'indexes':[{'name':_0xf9ac('0xc'),'fields':[_0xf9ac('0xd'),_0xf9ac('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0304=['../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26e449,_0x4b987c){var _0xcdb366=function(_0x197cbc){while(--_0x197cbc){_0x26e449['push'](_0x26e449['shift']());}};_0xcdb366(++_0x4b987c);}(_0x0304,0xa1));var _0x4030=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0304[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x4030('0x0'));var util=require(_0x4030('0x1'));var logger=require(_0x4030('0x2'))(_0x4030('0x3'));var moment=require(_0x4030('0x4'));var BPromise=require(_0x4030('0x5'));var rp=require(_0x4030('0x6'));var fs=require('fs');var path=require(_0x4030('0x7'));var rimraf=require(_0x4030('0x8'));var config=require(_0x4030('0x9'));var attributes=require(_0x4030('0xa'));module[_0x4030('0xb')]=function(_0x4d9c5f,_0x3818f5){return _0x4d9c5f[_0x4030('0xc')](_0x4030('0xd'),attributes,{'tableName':_0x4030('0xe'),'paranoid':![],'indexes':[{'name':_0x4030('0xf'),'fields':[_0x4030('0x10'),'FieldId'],'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 3ba532f..63a3e1e 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 _0x6d32=['request\x20sent','stringify','error','DeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d32,0x8a));var _0x26d3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6d32[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x26d3('0x0'));var util=require(_0x26d3('0x1'));var moment=require(_0x26d3('0x2'));var BPromise=require(_0x26d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26d3('0x4'));var db=require(_0x26d3('0x5'))['db'];var utils=require(_0x26d3('0x6'));var logger=require(_0x26d3('0x7'))(_0x26d3('0x8'));var config=require(_0x26d3('0x9'));var jayson=require(_0x26d3('0xa'));var client=jayson[_0x26d3('0xb')][_0x26d3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb06eac,_0x1d1d11,_0x204561){return new BPromise(function(_0x2608f0,_0x4ed0a0){return client[_0x26d3('0xd')](_0xb06eac,_0x204561)[_0x26d3('0xe')](function(_0x3d8a92){logger[_0x26d3('0xf')]('DeskField,\x20%s,\x20%s',_0x1d1d11,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x1d1d11,_0x26d3('0x10'),JSON[_0x26d3('0x11')](_0x3d8a92));if(_0x3d8a92[_0x26d3('0x12')]){if(_0x3d8a92[_0x26d3('0x12')]['code']===0x1f4){logger['error'](_0x26d3('0x13'),_0x1d1d11,_0x3d8a92[_0x26d3('0x12')][_0x26d3('0x14')]);return _0x4ed0a0(_0x3d8a92[_0x26d3('0x12')][_0x26d3('0x14')]);}logger[_0x26d3('0x12')]('DeskField,\x20%s,\x20%s',_0x1d1d11,_0x3d8a92[_0x26d3('0x12')][_0x26d3('0x14')]);return _0x2608f0(_0x3d8a92[_0x26d3('0x12')][_0x26d3('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x1d1d11,_0x26d3('0x10'));_0x2608f0(_0x3d8a92['result']['message']);}})[_0x26d3('0x15')](function(_0x30e312){logger['error'](_0x26d3('0x13'),_0x1d1d11,_0x30e312);_0x4ed0a0(_0x30e312);});});} \ No newline at end of file +var _0xed08=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xed08,0x6b));var _0x8ed0=function(_0x32a9b2,_0x372806){_0x32a9b2=_0x32a9b2-0x0;var _0xe495fd=_0xed08[_0x32a9b2];return _0xe495fd;};'use strict';var _=require(_0x8ed0('0x0'));var util=require('util');var moment=require(_0x8ed0('0x1'));var BPromise=require(_0x8ed0('0x2'));var rs=require(_0x8ed0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ed0('0x4'))['db'];var utils=require(_0x8ed0('0x5'));var logger=require(_0x8ed0('0x6'))('rpc');var config=require(_0x8ed0('0x7'));var jayson=require(_0x8ed0('0x8'));var client=jayson[_0x8ed0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca9c1,_0x5b76e0,_0x1f87cb){return new BPromise(function(_0x4ebd89,_0x48788b){return client[_0x8ed0('0xa')](_0x3ca9c1,_0x1f87cb)[_0x8ed0('0xb')](function(_0x29db59){logger[_0x8ed0('0xc')]('DeskField,\x20%s,\x20%s',_0x5b76e0,_0x8ed0('0xd'));logger[_0x8ed0('0xe')](_0x8ed0('0xf'),_0x5b76e0,_0x8ed0('0xd'),JSON[_0x8ed0('0x10')](_0x29db59));if(_0x29db59[_0x8ed0('0x11')]){if(_0x29db59['error'][_0x8ed0('0x12')]===0x1f4){logger[_0x8ed0('0x11')](_0x8ed0('0x13'),_0x5b76e0,_0x29db59[_0x8ed0('0x11')][_0x8ed0('0x14')]);return _0x48788b(_0x29db59['error'][_0x8ed0('0x14')]);}logger['error'](_0x8ed0('0x13'),_0x5b76e0,_0x29db59[_0x8ed0('0x11')][_0x8ed0('0x14')]);return _0x4ebd89(_0x29db59[_0x8ed0('0x11')]['message']);}else{logger[_0x8ed0('0xc')](_0x8ed0('0x13'),_0x5b76e0,_0x8ed0('0xd'));_0x4ebd89(_0x29db59[_0x8ed0('0x15')][_0x8ed0('0x14')]);}})['catch'](function(_0x2b854f){logger[_0x8ed0('0x11')](_0x8ed0('0x13'),_0x5b76e0,_0x2b854f);_0x48788b(_0x2b854f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bc71f02..c28166f 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 _0x19e1=['post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xf15771,_0x322502){var _0xf9b1b3=function(_0x1436c2){while(--_0x1436c2){_0xf15771['push'](_0xf15771['shift']());}};_0xf9b1b3(++_0x322502);}(_0x19e1,0xde));var _0x119e=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0x19e1[_0x20aae1];return _0x510601;};'use strict';var multer=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var timeout=require(_0x119e('0x3'));var express=require('express');var router=express[_0x119e('0x4')]();var fs_extra=require(_0x119e('0x5'));var auth=require(_0x119e('0x6'));var interaction=require(_0x119e('0x7'));var config=require(_0x119e('0x8'));var controller=require(_0x119e('0x9'));router[_0x119e('0xa')]('/',auth['isAuthenticated'](),controller[_0x119e('0xb')]);router[_0x119e('0xa')](_0x119e('0xc'),auth[_0x119e('0xd')](),controller[_0x119e('0xe')]);router[_0x119e('0xa')](_0x119e('0xf'),auth['isAuthenticated'](),controller[_0x119e('0x10')]);router['get'](_0x119e('0x11'),auth[_0x119e('0xd')](),controller['getFields']);router[_0x119e('0x12')]('/',auth[_0x119e('0xd')](),controller[_0x119e('0x13')]);router[_0x119e('0x12')](_0x119e('0xf'),auth['isAuthenticated'](),controller[_0x119e('0x14')]);router['put'](_0x119e('0xc'),auth['isAuthenticated'](),controller[_0x119e('0x15')]);router[_0x119e('0x16')](_0x119e('0xc'),auth[_0x119e('0xd')](),controller['destroy']);module[_0x119e('0x17')]=router; \ No newline at end of file +var _0x937b=['Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x87cc4f,_0x5445d6){var _0x34e783=function(_0x496275){while(--_0x496275){_0x87cc4f['push'](_0x87cc4f['shift']());}};_0x34e783(++_0x5445d6);}(_0x937b,0x1c9));var _0xb937=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x937b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb937('0x0'));var util=require(_0xb937('0x1'));var path=require(_0xb937('0x2'));var timeout=require(_0xb937('0x3'));var express=require(_0xb937('0x4'));var router=express[_0xb937('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb937('0x6'));var interaction=require(_0xb937('0x7'));var config=require('../../config/environment');var controller=require(_0xb937('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb937('0x9')]);router[_0xb937('0xa')](_0xb937('0xb'),auth[_0xb937('0xc')](),controller['show']);router[_0xb937('0xa')](_0xb937('0xd'),auth[_0xb937('0xc')](),controller[_0xb937('0xe')]);router[_0xb937('0xa')](_0xb937('0xf'),auth[_0xb937('0xc')](),controller['getFields']);router['post']('/',auth[_0xb937('0xc')](),controller[_0xb937('0x10')]);router[_0xb937('0x11')](_0xb937('0xd'),auth[_0xb937('0xc')](),controller[_0xb937('0x12')]);router[_0xb937('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb937('0x14')]);router['delete']('/:id',auth[_0xb937('0xc')](),controller[_0xb937('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 548f53e..e64a305 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 _0x4fb4=['BOOLEAN','exports','STRING'];(function(_0x25be63,_0x4b335e){var _0x4daaa8=function(_0x4b7f37){while(--_0x4b7f37){_0x25be63['push'](_0x25be63['shift']());}};_0x4daaa8(++_0x4b335e);}(_0x4fb4,0x190));var _0x44fb=function(_0x18b28c,_0x1da7ee){_0x18b28c=_0x18b28c-0x0;var _0x4d08c3=_0x4fb4[_0x18b28c];return _0x4d08c3;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')]},'username':{'type':Sequelize[_0x44fb('0x1')]},'password':{'type':Sequelize[_0x44fb('0x1')]},'remoteUri':{'type':Sequelize[_0x44fb('0x1')]},'tenantId':{'type':Sequelize[_0x44fb('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x44fb('0x1')]},'serverUrl':{'type':Sequelize[_0x44fb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x44fb('0x1')]},'modernAuthentication':{'type':Sequelize[_0x44fb('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x576b=['BOOLEAN','STRING'];(function(_0x3af8b0,_0x48c27c){var _0x17aa44=function(_0x27fc8a){while(--_0x27fc8a){_0x3af8b0['push'](_0x3af8b0['shift']());}};_0x17aa44(++_0x48c27c);}(_0x576b,0x1d9));var _0xb576=function(_0x3349cb,_0xce2eb2){_0x3349cb=_0x3349cb-0x0;var _0x15df5a=_0x576b[_0x3349cb];return _0x15df5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb576('0x0')]},'password':{'type':Sequelize[_0xb576('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xb576('0x0')]},'clientId':{'type':Sequelize[_0xb576('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb576('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb576('0x0')]},'modernAuthentication':{'type':Sequelize[_0xb576('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index abdcd49..a701f86 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 _0xb32f=['socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Attributes(',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','status','set','update','then','end','sendStatus','error','name','send','index','map','Dynamics365Account','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','findAll','rows','show','includeAll','include','merge','catch','create','body','find','params','destroy','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname'];(function(_0x48559f,_0x1c92ce){var _0x406467=function(_0x4940dc){while(--_0x4940dc){_0x48559f['push'](_0x48559f['shift']());}};_0x406467(++_0x1c92ce);}(_0xb32f,0x1c2));var _0xfb32=function(_0x54d05d,_0x4312df){_0x54d05d=_0x54d05d-0x0;var _0x5c6f75=_0xb32f[_0x54d05d];return _0x5c6f75;};'use strict';var rp=require(_0xfb32('0x0'));var util=require('util');var _=require(_0xfb32('0x1'));var qs=require(_0xfb32('0x2'));var logger=require(_0xfb32('0x3'))(_0xfb32('0x4'));var db=require(_0xfb32('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3977ce,_0x9f006c){_0x9f006c=_0x9f006c||0xc8;return function(_0x49d1a3){if(_0x49d1a3){return _0x3977ce['status'](_0x9f006c)[_0xfb32('0x6')](_0x49d1a3);}};}function respondWithFilteredResult(_0x40cde9,_0x5a6ecb){return function(_0x317c5d){if(_0x317c5d){var _0x288d41=typeof _0x5a6ecb[_0xfb32('0x7')]===_0xfb32('0x8')&&typeof _0x5a6ecb[_0xfb32('0x9')]===_0xfb32('0x8');var _0x84d508=_0x317c5d['count'];var _0x5be174=_0x288d41?0x0:_0x5a6ecb['offset'];var _0x2f75c0=_0x288d41?_0x317c5d[_0xfb32('0xa')]:_0x5a6ecb[_0xfb32('0x7')]+_0x5a6ecb['limit'];var _0x2cf139;if(_0x2f75c0>=_0x84d508){_0x2f75c0=_0x84d508;_0x2cf139=0xc8;}else{_0x2cf139=0xce;}_0x40cde9[_0xfb32('0xb')](_0x2cf139);return _0x40cde9[_0xfb32('0xc')]('Content-Range',_0x5be174+'-'+_0x2f75c0+'/'+_0x84d508)['json'](_0x317c5d);}return null;};}function saveUpdates(_0x443510){return function(_0x326057){if(_0x326057){return _0x326057[_0xfb32('0xd')](_0x443510)[_0xfb32('0xe')](function(_0x47c29c){return _0x47c29c;});}return null;};}function removeEntity(_0x29f9be){return function(_0x548667){if(_0x548667){return _0x548667['destroy']()[_0xfb32('0xe')](function(){_0x29f9be[_0xfb32('0xb')](0xcc)[_0xfb32('0xf')]();});}};}function handleEntityNotFound(_0x579ae4){return function(_0x552e39){if(!_0x552e39){_0x579ae4[_0xfb32('0x10')](0x194);}return _0x552e39;};}function handleError(_0x789623,_0x8ba975){_0x8ba975=_0x8ba975||0x1f4;return function(_0x54b838){logger[_0xfb32('0x11')](_0x54b838['stack']);if(_0x54b838[_0xfb32('0x12')]){delete _0x54b838[_0xfb32('0x12')];}_0x789623['status'](_0x8ba975)[_0xfb32('0x13')](_0x54b838);};}exports[_0xfb32('0x14')]=function(_0x501abe,_0x5aefc3){var _0x1b9d76={},_0x1711c0={},_0x5e92bf={'count':0x0,'rows':[]};var _0x2e3773=_[_0xfb32('0x15')](db[_0xfb32('0x16')]['rawAttributes'],function(_0x4f3ed5){return{'name':_0x4f3ed5[_0xfb32('0x17')],'type':_0x4f3ed5[_0xfb32('0x18')][_0xfb32('0x19')]};});_0x1711c0['model']=_['map'](_0x2e3773,_0xfb32('0x12'));_0x1711c0['query']=_[_0xfb32('0x1a')](_0x501abe[_0xfb32('0x1b')]);_0x1711c0[_0xfb32('0x1c')]=_[_0xfb32('0x1d')](_0x1711c0[_0xfb32('0x1e')],_0x1711c0['query']);_0x1b9d76[_0xfb32('0x1f')]=_[_0xfb32('0x1d')](_0x1711c0['model'],qs[_0xfb32('0x20')](_0x501abe['query'][_0xfb32('0x20')]));_0x1b9d76[_0xfb32('0x1f')]=_0x1b9d76[_0xfb32('0x1f')][_0xfb32('0x21')]?_0x1b9d76['attributes']:_0x1711c0[_0xfb32('0x1e')];if(!_0x501abe['query'][_0xfb32('0x22')](_0xfb32('0x23'))){_0x1b9d76[_0xfb32('0x9')]=qs['limit'](_0x501abe['query'][_0xfb32('0x9')]);_0x1b9d76[_0xfb32('0x7')]=qs['offset'](_0x501abe[_0xfb32('0x1b')][_0xfb32('0x7')]);}_0x1b9d76['order']=qs[_0xfb32('0x24')](_0x501abe[_0xfb32('0x1b')][_0xfb32('0x24')]);_0x1b9d76[_0xfb32('0x25')]=qs[_0xfb32('0x1c')](_[_0xfb32('0x26')](_0x501abe[_0xfb32('0x1b')],_0x1711c0['filters']),_0x2e3773);if(_0x501abe[_0xfb32('0x1b')][_0xfb32('0x27')]){_0x1b9d76[_0xfb32('0x25')]=_['merge'](_0x1b9d76[_0xfb32('0x25')],{'$or':_[_0xfb32('0x15')](_0x2e3773,function(_0x10d986){if(_0x10d986[_0xfb32('0x18')]!=='VIRTUAL'){var _0x128003={};_0x128003[_0x10d986[_0xfb32('0x12')]]={'$like':'%'+_0x501abe['query']['filter']+'%'};return _0x128003;}})});}_0x1b9d76=_['merge']({},_0x1b9d76,_0x501abe[_0xfb32('0x28')]);var _0x303f93={'where':_0x1b9d76['where']};return db['Dynamics365Account'][_0xfb32('0xa')](_0x303f93)[_0xfb32('0xe')](function(_0x49e542){_0x5e92bf[_0xfb32('0xa')]=_0x49e542;if(_0x501abe[_0xfb32('0x1b')]['includeAll']){_0x1b9d76['include']=[{'all':!![]}];}return db[_0xfb32('0x16')][_0xfb32('0x29')](_0x1b9d76);})[_0xfb32('0xe')](function(_0x5e789b){_0x5e92bf[_0xfb32('0x2a')]=_0x5e789b;return _0x5e92bf;})[_0xfb32('0xe')](respondWithFilteredResult(_0x5aefc3,_0x1b9d76))['catch'](handleError(_0x5aefc3,null));};exports[_0xfb32('0x2b')]=function(_0x42b47c,_0x3586f5){var _0x59e439={'raw':![],'where':{'id':_0x42b47c['params']['id']}},_0x1e5d1a={};_0x1e5d1a[_0xfb32('0x1e')]=_[_0xfb32('0x1a')](db[_0xfb32('0x16')]['rawAttributes']);_0x1e5d1a[_0xfb32('0x1b')]=_['keys'](_0x42b47c[_0xfb32('0x1b')]);_0x1e5d1a['filters']=_[_0xfb32('0x1d')](_0x1e5d1a[_0xfb32('0x1e')],_0x1e5d1a[_0xfb32('0x1b')]);_0x59e439[_0xfb32('0x1f')]=_['intersection'](_0x1e5d1a['model'],qs[_0xfb32('0x20')](_0x42b47c[_0xfb32('0x1b')][_0xfb32('0x20')]));_0x59e439['attributes']=_0x59e439['attributes']['length']?_0x59e439[_0xfb32('0x1f')]:_0x1e5d1a['model'];if(_0x42b47c[_0xfb32('0x1b')][_0xfb32('0x2c')]){_0x59e439[_0xfb32('0x2d')]=[{'all':!![]}];}_0x59e439=_[_0xfb32('0x2e')]({},_0x59e439,_0x42b47c[_0xfb32('0x28')]);return db[_0xfb32('0x16')]['find'](_0x59e439)['then'](handleEntityNotFound(_0x3586f5,null))[_0xfb32('0xe')](respondWithResult(_0x3586f5,null))[_0xfb32('0x2f')](handleError(_0x3586f5,null));};exports[_0xfb32('0x30')]=function(_0xd38829,_0x267214){return db[_0xfb32('0x16')]['create'](_0xd38829[_0xfb32('0x31')],{})['then'](respondWithResult(_0x267214,0xc9))[_0xfb32('0x2f')](handleError(_0x267214,null));};exports[_0xfb32('0xd')]=function(_0x353f9b,_0x290f21){if(_0x353f9b['body']['id']){delete _0x353f9b[_0xfb32('0x31')]['id'];}return db[_0xfb32('0x16')][_0xfb32('0x32')]({'where':{'id':_0x353f9b[_0xfb32('0x33')]['id']}})[_0xfb32('0xe')](handleEntityNotFound(_0x290f21,null))['then'](saveUpdates(_0x353f9b[_0xfb32('0x31')],null))[_0xfb32('0xe')](respondWithResult(_0x290f21,null))['catch'](handleError(_0x290f21,null));};exports[_0xfb32('0x34')]=function(_0x3bc973,_0xaf6d5b){return db[_0xfb32('0x16')]['find']({'where':{'id':_0x3bc973['params']['id']}})[_0xfb32('0xe')](handleEntityNotFound(_0xaf6d5b,null))[_0xfb32('0xe')](removeEntity(_0xaf6d5b,null))[_0xfb32('0x2f')](handleError(_0xaf6d5b,null));};exports[_0xfb32('0x35')]=function(_0x2df77a,_0x4441f1){var _0xe5bb64={};var _0x1db46c={};var _0x51875a;var _0x5d99ff;return db[_0xfb32('0x16')][_0xfb32('0x36')]({'where':{'id':_0x2df77a[_0xfb32('0x33')]['id']}})[_0xfb32('0xe')](handleEntityNotFound(_0x4441f1,null))[_0xfb32('0xe')](function(_0x299d00){if(_0x299d00){_0x51875a=_0x299d00;_0x1db46c['model']=_['keys'](db[_0xfb32('0x37')][_0xfb32('0x38')]);_0x1db46c[_0xfb32('0x1b')]=_['keys'](_0x2df77a[_0xfb32('0x1b')]);_0x1db46c[_0xfb32('0x1c')]=_[_0xfb32('0x1d')](_0x1db46c[_0xfb32('0x1e')],_0x1db46c['query']);_0xe5bb64['attributes']=_['intersection'](_0x1db46c[_0xfb32('0x1e')],qs[_0xfb32('0x20')](_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x20')]));_0xe5bb64[_0xfb32('0x1f')]=_0xe5bb64[_0xfb32('0x1f')][_0xfb32('0x21')]?_0xe5bb64['attributes']:_0x1db46c[_0xfb32('0x1e')];_0xe5bb64[_0xfb32('0x39')]=qs['sort'](_0x2df77a['query'][_0xfb32('0x24')]);_0xe5bb64[_0xfb32('0x25')]=qs[_0xfb32('0x1c')](_[_0xfb32('0x26')](_0x2df77a[_0xfb32('0x1b')],_0x1db46c[_0xfb32('0x1c')]));if(_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x27')]){_0xe5bb64[_0xfb32('0x25')]=_[_0xfb32('0x2e')](_0xe5bb64[_0xfb32('0x25')],{'$or':_['map'](_0xe5bb64[_0xfb32('0x1f')],function(_0x3e9225){var _0x3f37bb={};_0x3f37bb[_0x3e9225]={'$like':'%'+_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x27')]+'%'};return _0x3f37bb;})});}_0xe5bb64=_[_0xfb32('0x2e')]({},_0xe5bb64,_0x2df77a['options']);return _0x51875a[_0xfb32('0x35')](_0xe5bb64);}})[_0xfb32('0xe')](function(_0x36bb62){if(_0x36bb62){_0x5d99ff=_0x36bb62[_0xfb32('0x21')];if(!_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x22')](_0xfb32('0x23'))){_0xe5bb64[_0xfb32('0x9')]=qs[_0xfb32('0x9')](_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x9')]);_0xe5bb64[_0xfb32('0x7')]=qs[_0xfb32('0x7')](_0x2df77a[_0xfb32('0x1b')][_0xfb32('0x7')]);}return _0x51875a['getConfigurations'](_0xe5bb64);}})[_0xfb32('0xe')](function(_0x4a89b0){if(_0x4a89b0){return _0x4a89b0?{'count':_0x5d99ff,'rows':_0x4a89b0}:null;}})[_0xfb32('0xe')](respondWithResult(_0x4441f1,null))[_0xfb32('0x2f')](handleError(_0x4441f1,null));};exports['addConfiguration']=function(_0x3d9b69,_0x5c9b85){if(_0x3d9b69[_0xfb32('0x31')]['id']){delete _0x3d9b69[_0xfb32('0x31')]['id'];}return db['Dynamics365Account'][_0xfb32('0x36')]({'where':{'id':_0x3d9b69[_0xfb32('0x33')]['id']}})[_0xfb32('0xe')](handleEntityNotFound(_0x5c9b85,null))[_0xfb32('0xe')](function(_0x28082b){if(_0x28082b){_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x3a')]=_0x28082b['id'];_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x3b')]=integrations[_0xfb32('0x3c')](_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x3d')],_0x3d9b69['body'][_0xfb32('0x18')]);_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x3e')]=integrations[_0xfb32('0x3f')](_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x3d')],_0x3d9b69[_0xfb32('0x31')][_0xfb32('0x18')]);return db[_0xfb32('0x37')][_0xfb32('0x30')](_0x3d9b69[_0xfb32('0x31')],{'include':[{'model':db[_0xfb32('0x40')],'as':_0xfb32('0x3b')},{'model':db[_0xfb32('0x40')],'as':_0xfb32('0x3e')}]});}return null;})[_0xfb32('0xe')](respondWithResult(_0x5c9b85,null))[_0xfb32('0x2f')](handleError(_0x5c9b85,null));};function sanitizeRemoteUri(_0xc90827){var _0x10a88b=_0xc90827['slice'](-0x1);if(_0x10a88b==='/')return _0xc90827[_0xfb32('0x41')](0x0,_0xc90827[_0xfb32('0x42')](_0x10a88b));return _0xc90827;}function getWebApiUrl(_0x132ec2){return util[_0xfb32('0x43')](_0xfb32('0x44'),_0x132ec2);}exports['getFields']=function(_0x3c7ba0,_0x204d4a){var _0x5f25eb=_0x3c7ba0[_0xfb32('0x1b')][_0xfb32('0x45')];var _0x4f7f5b=_0x5f25eb===_0xfb32('0x46')?_0xfb32('0x47'):_0xfb32('0x48');var _0x567bf7='';var _0x57e012='';var _0x4fd7b9='';var _0x249c37='';var _0x5c1549='';var _0x171abc='';var _0x531183='';var _0x2b3ca1='';var _0x2ee24f=[_0xfb32('0x49'),'description',_0xfb32('0x4a'),_0xfb32('0x4b'),_0xfb32('0x4c'),_0xfb32('0x4d'),_0xfb32('0x4e'),_0xfb32('0x4f'),_0xfb32('0x50'),_0xfb32('0x51')];var _0x362fa8=[_0xfb32('0x52'),_0xfb32('0x53'),_0xfb32('0x54'),'billedserviceunits','contactidname',_0xfb32('0x55'),_0xfb32('0x56'),_0xfb32('0x57'),_0xfb32('0x58'),_0xfb32('0x59'),_0xfb32('0x5a'),'createdbyyominame',_0xfb32('0x5b'),_0xfb32('0x5c'),_0xfb32('0x5d'),'customeridname','customeridtype',_0xfb32('0x5e'),_0xfb32('0x5f'),'entitlementidname',_0xfb32('0x60'),_0xfb32('0x61'),_0xfb32('0x62'),_0xfb32('0x63'),'firstresponsebykpiidname',_0xfb32('0x64'),_0xfb32('0x65'),_0xfb32('0x66'),_0xfb32('0x67'),_0xfb32('0x68'),'masteridname',_0xfb32('0x69'),_0xfb32('0x6a'),_0xfb32('0x6b'),'modifiedbyyominame',_0xfb32('0x6c'),'modifiedonbehalfbyname',_0xfb32('0x6d'),_0xfb32('0x6e'),'msdyn_iotalertname',_0xfb32('0x6f'),'onholdtime',_0xfb32('0x70'),_0xfb32('0x71'),_0xfb32('0x72'),_0xfb32('0x73'),_0xfb32('0x74'),_0xfb32('0x75'),'primarycontactidyominame',_0xfb32('0x76'),'productidname',_0xfb32('0x77'),'resolveby',_0xfb32('0x78'),_0xfb32('0x79'),_0xfb32('0x7a'),_0xfb32('0x7b'),'sentimentvalue',_0xfb32('0x7c'),_0xfb32('0x7d'),_0xfb32('0x7e'),_0xfb32('0x7f'),'statuscode','subjectidname',_0xfb32('0x80'),_0xfb32('0x81'),_0xfb32('0x82'),_0xfb32('0x83'),_0xfb32('0x84'),_0xfb32('0x85')];var _0x1f2fca=_0x2ee24f[_0xfb32('0x86')](_0x362fa8);return db[_0xfb32('0x16')]['findOne']({'where':{'id':_0x3c7ba0['params']['id']},'attributes':['id',_0xfb32('0x87'),'password',_0xfb32('0x88'),_0xfb32('0x89'),_0xfb32('0x8a'),_0xfb32('0x8b'),_0xfb32('0x8c')],'include':[{'model':db[_0xfb32('0x8d')],'as':'CloudProvider','attributes':['id',_0xfb32('0x8e'),_0xfb32('0x8f')]}]})[_0xfb32('0xe')](handleEntityNotFound(_0x204d4a,null))[_0xfb32('0xe')](function(_0x3fff9e){if(_0x3fff9e){if(_0x3fff9e[_0xfb32('0x8c')]){_0x3fff9e[_0xfb32('0x90')]=_0x3fff9e['CloudProvider'][_0xfb32('0x8e')];_0x2b3ca1=sanitizeRemoteUri(_0x3fff9e[_0xfb32('0x8d')][_0xfb32('0x8f')]);_0x531183=getWebApiUrl(_0x2b3ca1);return _0x3fff9e;}_0x2b3ca1=sanitizeRemoteUri(_0x3fff9e[_0xfb32('0x88')]);_0x531183=getWebApiUrl(_0x2b3ca1);var _0x3a6b59={'method':_0xfb32('0x91'),'uri':_0xfb32('0x92')+_0x3fff9e['tenantId']+_0xfb32('0x93'),'form':{'client_id':_0x3fff9e['clientId'],'resource':_0x2b3ca1,'username':_0x3fff9e[_0xfb32('0x87')],'password':_0x3fff9e['password'],'grant_type':_0xfb32('0x94'),'client_secret':_0x3fff9e[_0xfb32('0x8b')]},'json':!![]};return rp(_0x3a6b59);}})['then'](function(_0x4e10d4){_0x171abc=_0x4e10d4[_0xfb32('0x90')];var _0x22fb10={'method':_0xfb32('0x95'),'uri':encodeURI(_0x531183+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4f7f5b+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x171abc,'If-None-Match':null,'OData-Version':_0xfb32('0x96')},'json':!![]};return rp(_0x22fb10);})['then'](function(_0x43d136){var _0x32c18f=_0x43d136[_0xfb32('0x97')][0x0];var _0x48e2c4=_0x32c18f['MetadataId'];var _0x49ab06={'method':_0xfb32('0x95'),'uri':_0x531183+_0xfb32('0x98')+_0x48e2c4+_0xfb32('0x99'),'headers':{'Authorization':'Bearer\x20'+_0x171abc,'If-None-Match':null,'OData-Version':_0xfb32('0x96')},'json':!![]};return rp(_0x49ab06);})['then'](function(_0x1ae26c){_0x567bf7=_0x1ae26c;_0x57e012=_0x567bf7[_0xfb32('0x9a')];_0x57e012=_[_0xfb32('0x9b')](_0x57e012,function(_0x44d78a){return!_0x1f2fca[_0xfb32('0x9c')](_0x44d78a[_0xfb32('0x9d')]);});var _0x339d37=[];var _0x493758=[];_0x57e012[_0xfb32('0x9e')](function(_0x7ed477){if(_0x7ed477[_0xfb32('0x9f')]){var _0x1202d0=_0x7ed477[_0xfb32('0x9f')][_0xfb32('0x41')](_0x7ed477[_0xfb32('0x9f')]['lastIndexOf']('.')+0x1);if(_0x1202d0===_0xfb32('0xa0')){_0x339d37[_0xfb32('0xa1')](getSelectList(_0x531183,_0x5f25eb,_0x493758,_0x567bf7['MetadataId'],_0x7ed477[_0xfb32('0xa2')],_0x171abc));}}});return Promise[_0xfb32('0xa3')](_0x339d37);})['then'](function(_0x43690e){_0x4fd7b9=_0x43690e[0x0];var _0x46c183=[];var _0x3f35ce=[];_0x57e012[_0xfb32('0x9e')](function(_0x51ee02){if(!_[_0xfb32('0xa4')](_0x51ee02['@odata.type'])){var _0x4a051e=_0x51ee02['@odata.type'][_0xfb32('0x41')](_0x51ee02[_0xfb32('0x9f')]['lastIndexOf']('.')+0x1);if(_0x4a051e===_0xfb32('0xa5')){_0x46c183[_0xfb32('0xa1')](getBooleanList(_0x531183,_0x5f25eb,_0x3f35ce,_0x567bf7['MetadataId'],_0x51ee02[_0xfb32('0xa2')],_0x171abc));}}});return Promise['all'](_0x46c183);})['then'](function(_0x32a64){_0x249c37=_0x32a64[0x0];var _0x3da260=[];var _0x12a05=[];_0x57e012['forEach'](function(_0x13d6fd){if(_0x13d6fd['@odata.type']){var _0x1199a1=_0x13d6fd[_0xfb32('0x9f')][_0xfb32('0x41')](_0x13d6fd[_0xfb32('0x9f')]['lastIndexOf']('.')+0x1);if(_0x1199a1===_0xfb32('0xa6')||_0x1199a1===_0xfb32('0xa7')||_0x1199a1===_0xfb32('0xa8')||_0x1199a1===_0xfb32('0xa9')||_0x1199a1===_0xfb32('0xaa')||_0x1199a1===_0xfb32('0xab')||_0x1199a1===_0xfb32('0xac')||_0x1199a1===_0xfb32('0xad')||_0x1199a1==='StateAttributeMetadata'||_0x1199a1===_0xfb32('0xae')){_0x3da260[_0xfb32('0xa1')](getInputList(_0x531183,_0x5f25eb,_0x1199a1,_0x12a05,_0x567bf7[_0xfb32('0xa2')],_0x13d6fd[_0xfb32('0xa2')],_0x171abc));}}});return Promise[_0xfb32('0xa3')](_0x3da260);})[_0xfb32('0xe')](function(_0x37f33b){_0x5c1549=_0x37f33b[0x0];var _0x2fc5c1=_0x4fd7b9['concat'](_0x249c37)[_0xfb32('0x86')](_0x5c1549);var _0x34e48c={'count':_0x2fc5c1['length'],'rows':_0x2fc5c1};return _0x34e48c;})['then'](respondWithResult(_0x204d4a,null))[_0xfb32('0x2f')](function(_0x5ed5a7){var _0x6e72e7=_0x3c7ba0['query']['test']?0x1f4:_0x5ed5a7[_0xfb32('0xaf')]||0x1f4;logger[_0xfb32('0x11')](_0x5ed5a7['stack']);delete _0x5ed5a7[_0xfb32('0x12')];if(_0x6e72e7===0x191){_0x6e72e7=0x190;}_0x204d4a[_0xfb32('0xb')](_0x6e72e7)[_0xfb32('0x13')](_0x3c7ba0['query'][_0xfb32('0xb0')]?{'message':_0xfb32('0xb1'),'statusCode':_0x5ed5a7[_0xfb32('0xaf')]}:_0x5ed5a7);});};function getSelectList(_0x28b64c,_0x380ba4,_0x381954,_0x543155,_0x36a269,_0x140158){var _0x481ea5={'method':_0xfb32('0x95'),'uri':_0x28b64c+'EntityDefinitions('+_0x543155+')/Attributes('+_0x36a269+_0xfb32('0xb2')+_0xfb32('0xb3'),'headers':{'Authorization':_0xfb32('0xb4')+_0x140158,'If-None-Match':null,'OData-Version':_0xfb32('0x96')},'json':!![]};return rp(_0x481ea5)[_0xfb32('0xe')](function(_0xe9debe){var _0x4bc44a=[];var _0x2f85cf=_0xe9debe[_0xfb32('0xb5')][_0xfb32('0xb6')];_0x2f85cf[_0xfb32('0x9e')](function(_0x5d6ec5){_0x4bc44a['push']({'name':_0x5d6ec5[_0xfb32('0xb7')][_0xfb32('0xb8')][_0xfb32('0xb7')],'value':String(_0x5d6ec5['Value'])});});var _0x26416e={'id':_0x380ba4+'_'+_0xe9debe[_0xfb32('0x9d')],'name':_0xe9debe[_0xfb32('0xb9')][_0xfb32('0xb8')][_0xfb32('0xb7')],'custom':![],'options':_0x4bc44a};_0x381954[_0xfb32('0xa1')](_0x26416e);return _0x381954;});}function getBooleanList(_0x3986d8,_0x351844,_0x16f650,_0x2d081c,_0x21348a,_0x5491ad){var _0x28388f={'method':_0xfb32('0x95'),'uri':_0x3986d8+'EntityDefinitions('+_0x2d081c+')/Attributes('+_0x21348a+_0xfb32('0xba'),'headers':{'Authorization':_0xfb32('0xb4')+_0x5491ad,'If-None-Match':null,'OData-Version':_0xfb32('0x96')},'json':!![]};return rp(_0x28388f)[_0xfb32('0xe')](function(_0x2810f8){var _0x5d355f=[];_0x5d355f[_0xfb32('0xa1')]({'name':_0x2810f8[_0xfb32('0xb5')][_0xfb32('0xbb')][_0xfb32('0xb7')][_0xfb32('0xb8')][_0xfb32('0xb7')],'value':_0xfb32('0xbc')},{'name':_0x2810f8[_0xfb32('0xb5')]['FalseOption']['Label'][_0xfb32('0xb8')][_0xfb32('0xb7')],'value':_0xfb32('0xbd')});var _0x42becd={'id':_0x351844+'_'+_0x2810f8[_0xfb32('0x9d')],'name':_0x2810f8['DisplayName'][_0xfb32('0xb8')][_0xfb32('0xb7')],'custom':![],'options':_0x5d355f};_0x16f650[_0xfb32('0xa1')](_0x42becd);return _0x16f650;});}function getInputList(_0x44bf6b,_0x425bb8,_0x2e9faf,_0x339b6a,_0x80b69,_0x8d242f,_0x87125c){var _0x2a6d50={'method':'GET','uri':_0x44bf6b+_0xfb32('0x98')+_0x80b69+_0xfb32('0xbe')+_0x8d242f+_0xfb32('0xbf')+_0x2e9faf+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xfb32('0xb4')+_0x87125c,'If-None-Match':null,'OData-Version':_0xfb32('0x96')},'json':!![]};return rp(_0x2a6d50)[_0xfb32('0xe')](function(_0x4d079c){var _0x1cc917={'id':_0x425bb8+'_'+_0x4d079c[_0xfb32('0x9d')],'name':_0x4d079c[_0xfb32('0xb9')][_0xfb32('0xb8')]?_0x4d079c['DisplayName']['UserLocalizedLabel'][_0xfb32('0xb7')]:_0x4d079c[_0xfb32('0x9d')],'custom':![],'options':[]};_0x339b6a['push'](_0x1cc917);return _0x339b6a;});} \ No newline at end of file +var _0xed27=['TrueOption','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','Dynamics365Account','fields','includeAll','find','create','body','catch','getConfigurations','Dynamics365Configuration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','transactioncurrencyidname','traversedpath','versionnumber','concat','username','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','push','lastIndexOf','BooleanAttributeMetadata','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','error','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)'];(function(_0x514235,_0x52dedb){var _0x27827b=function(_0x17b9da){while(--_0x17b9da){_0x514235['push'](_0x514235['shift']());}};_0x27827b(++_0x52dedb);}(_0xed27,0x183));var _0x7ed2=function(_0x2c8c59,_0x2637bd){_0x2c8c59=_0x2c8c59-0x0;var _0x3316c1=_0xed27[_0x2c8c59];return _0x3316c1;};'use strict';var rp=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var _=require(_0x7ed2('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7ed2('0x3'))(_0x7ed2('0x4'));var db=require(_0x7ed2('0x5'))['db'];var integrations=require(_0x7ed2('0x6'));function respondWithResult(_0x2ceee1,_0x4a0c79){_0x4a0c79=_0x4a0c79||0xc8;return function(_0x1b1903){if(_0x1b1903){return _0x2ceee1[_0x7ed2('0x7')](_0x4a0c79)[_0x7ed2('0x8')](_0x1b1903);}};}function respondWithFilteredResult(_0x26bea2,_0x38d82a){return function(_0x1b23d9){if(_0x1b23d9){var _0x3e362f=typeof _0x38d82a[_0x7ed2('0x9')]===_0x7ed2('0xa')&&typeof _0x38d82a[_0x7ed2('0xb')]==='undefined';var _0x3e8c53=_0x1b23d9['count'];var _0x445ff7=_0x3e362f?0x0:_0x38d82a['offset'];var _0x506e69=_0x3e362f?_0x1b23d9[_0x7ed2('0xc')]:_0x38d82a[_0x7ed2('0x9')]+_0x38d82a[_0x7ed2('0xb')];var _0x384d31;if(_0x506e69>=_0x3e8c53){_0x506e69=_0x3e8c53;_0x384d31=0xc8;}else{_0x384d31=0xce;}_0x26bea2[_0x7ed2('0x7')](_0x384d31);return _0x26bea2[_0x7ed2('0xd')](_0x7ed2('0xe'),_0x445ff7+'-'+_0x506e69+'/'+_0x3e8c53)[_0x7ed2('0x8')](_0x1b23d9);}return null;};}function saveUpdates(_0x33ac72){return function(_0x4a2842){if(_0x4a2842){return _0x4a2842['update'](_0x33ac72)['then'](function(_0xd96d51){return _0xd96d51;});}return null;};}function removeEntity(_0xeb2003){return function(_0x1920d8){if(_0x1920d8){return _0x1920d8[_0x7ed2('0xf')]()[_0x7ed2('0x10')](function(){_0xeb2003[_0x7ed2('0x7')](0xcc)[_0x7ed2('0x11')]();});}};}function handleEntityNotFound(_0x5b7d69){return function(_0x55fce7){if(!_0x55fce7){_0x5b7d69[_0x7ed2('0x12')](0x194);}return _0x55fce7;};}function handleError(_0x4676c1,_0x3da3c9){_0x3da3c9=_0x3da3c9||0x1f4;return function(_0x10bf53){logger['error'](_0x10bf53[_0x7ed2('0x13')]);if(_0x10bf53[_0x7ed2('0x14')]){delete _0x10bf53[_0x7ed2('0x14')];}_0x4676c1[_0x7ed2('0x7')](_0x3da3c9)[_0x7ed2('0x15')](_0x10bf53);};}exports[_0x7ed2('0x16')]=function(_0x2cb9f4,_0x3c3760){var _0x508d2a={},_0x5457f2={},_0x510e54={'count':0x0,'rows':[]};var _0x3b2e20=_[_0x7ed2('0x17')](db['Dynamics365Account'][_0x7ed2('0x18')],function(_0x4fcbc5){return{'name':_0x4fcbc5[_0x7ed2('0x19')],'type':_0x4fcbc5[_0x7ed2('0x1a')]['key']};});_0x5457f2[_0x7ed2('0x1b')]=_[_0x7ed2('0x17')](_0x3b2e20,_0x7ed2('0x14'));_0x5457f2[_0x7ed2('0x1c')]=_[_0x7ed2('0x1d')](_0x2cb9f4['query']);_0x5457f2['filters']=_[_0x7ed2('0x1e')](_0x5457f2[_0x7ed2('0x1b')],_0x5457f2[_0x7ed2('0x1c')]);_0x508d2a[_0x7ed2('0x1f')]=_[_0x7ed2('0x1e')](_0x5457f2[_0x7ed2('0x1b')],qs['fields'](_0x2cb9f4[_0x7ed2('0x1c')]['fields']));_0x508d2a[_0x7ed2('0x1f')]=_0x508d2a[_0x7ed2('0x1f')][_0x7ed2('0x20')]?_0x508d2a['attributes']:_0x5457f2[_0x7ed2('0x1b')];if(!_0x2cb9f4['query'][_0x7ed2('0x21')](_0x7ed2('0x22'))){_0x508d2a[_0x7ed2('0xb')]=qs[_0x7ed2('0xb')](_0x2cb9f4['query']['limit']);_0x508d2a['offset']=qs[_0x7ed2('0x9')](_0x2cb9f4[_0x7ed2('0x1c')][_0x7ed2('0x9')]);}_0x508d2a[_0x7ed2('0x23')]=qs['sort'](_0x2cb9f4[_0x7ed2('0x1c')][_0x7ed2('0x24')]);_0x508d2a[_0x7ed2('0x25')]=qs[_0x7ed2('0x26')](_['pick'](_0x2cb9f4[_0x7ed2('0x1c')],_0x5457f2[_0x7ed2('0x26')]),_0x3b2e20);if(_0x2cb9f4['query'][_0x7ed2('0x27')]){_0x508d2a[_0x7ed2('0x25')]=_['merge'](_0x508d2a['where'],{'$or':_[_0x7ed2('0x17')](_0x3b2e20,function(_0x2775f6){if(_0x2775f6[_0x7ed2('0x1a')]!==_0x7ed2('0x28')){var _0x720e36={};_0x720e36[_0x2775f6['name']]={'$like':'%'+_0x2cb9f4[_0x7ed2('0x1c')][_0x7ed2('0x27')]+'%'};return _0x720e36;}})});}_0x508d2a=_[_0x7ed2('0x29')]({},_0x508d2a,_0x2cb9f4[_0x7ed2('0x2a')]);var _0x11c365={'where':_0x508d2a[_0x7ed2('0x25')]};return db['Dynamics365Account'][_0x7ed2('0xc')](_0x11c365)[_0x7ed2('0x10')](function(_0x572ccf){_0x510e54[_0x7ed2('0xc')]=_0x572ccf;if(_0x2cb9f4[_0x7ed2('0x1c')]['includeAll']){_0x508d2a[_0x7ed2('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x7ed2('0x2c')](_0x508d2a);})[_0x7ed2('0x10')](function(_0x4cc0a5){_0x510e54[_0x7ed2('0x2d')]=_0x4cc0a5;return _0x510e54;})[_0x7ed2('0x10')](respondWithFilteredResult(_0x3c3760,_0x508d2a))['catch'](handleError(_0x3c3760,null));};exports[_0x7ed2('0x2e')]=function(_0x387ad6,_0x12712b){var _0x397cd2={'raw':![],'where':{'id':_0x387ad6[_0x7ed2('0x2f')]['id']}},_0x1efced={};_0x1efced['model']=_[_0x7ed2('0x1d')](db[_0x7ed2('0x30')][_0x7ed2('0x18')]);_0x1efced[_0x7ed2('0x1c')]=_[_0x7ed2('0x1d')](_0x387ad6[_0x7ed2('0x1c')]);_0x1efced[_0x7ed2('0x26')]=_[_0x7ed2('0x1e')](_0x1efced[_0x7ed2('0x1b')],_0x1efced[_0x7ed2('0x1c')]);_0x397cd2[_0x7ed2('0x1f')]=_[_0x7ed2('0x1e')](_0x1efced[_0x7ed2('0x1b')],qs[_0x7ed2('0x31')](_0x387ad6[_0x7ed2('0x1c')][_0x7ed2('0x31')]));_0x397cd2[_0x7ed2('0x1f')]=_0x397cd2['attributes']['length']?_0x397cd2[_0x7ed2('0x1f')]:_0x1efced[_0x7ed2('0x1b')];if(_0x387ad6[_0x7ed2('0x1c')][_0x7ed2('0x32')]){_0x397cd2[_0x7ed2('0x2b')]=[{'all':!![]}];}_0x397cd2=_[_0x7ed2('0x29')]({},_0x397cd2,_0x387ad6[_0x7ed2('0x2a')]);return db[_0x7ed2('0x30')][_0x7ed2('0x33')](_0x397cd2)[_0x7ed2('0x10')](handleEntityNotFound(_0x12712b,null))[_0x7ed2('0x10')](respondWithResult(_0x12712b,null))['catch'](handleError(_0x12712b,null));};exports[_0x7ed2('0x34')]=function(_0x2a197f,_0x372a70){return db['Dynamics365Account'][_0x7ed2('0x34')](_0x2a197f[_0x7ed2('0x35')],{})[_0x7ed2('0x10')](respondWithResult(_0x372a70,0xc9))[_0x7ed2('0x36')](handleError(_0x372a70,null));};exports['update']=function(_0x8583df,_0x3ea897){if(_0x8583df[_0x7ed2('0x35')]['id']){delete _0x8583df[_0x7ed2('0x35')]['id'];}return db[_0x7ed2('0x30')][_0x7ed2('0x33')]({'where':{'id':_0x8583df[_0x7ed2('0x2f')]['id']}})[_0x7ed2('0x10')](handleEntityNotFound(_0x3ea897,null))['then'](saveUpdates(_0x8583df[_0x7ed2('0x35')],null))[_0x7ed2('0x10')](respondWithResult(_0x3ea897,null))[_0x7ed2('0x36')](handleError(_0x3ea897,null));};exports[_0x7ed2('0xf')]=function(_0x260bba,_0x56faa6){return db['Dynamics365Account'][_0x7ed2('0x33')]({'where':{'id':_0x260bba['params']['id']}})[_0x7ed2('0x10')](handleEntityNotFound(_0x56faa6,null))[_0x7ed2('0x10')](removeEntity(_0x56faa6,null))['catch'](handleError(_0x56faa6,null));};exports[_0x7ed2('0x37')]=function(_0x122a85,_0x479f00){var _0x15bb05={};var _0x1b4cbd={};var _0x5d5fbf;var _0x5b2fe2;return db[_0x7ed2('0x30')]['findOne']({'where':{'id':_0x122a85[_0x7ed2('0x2f')]['id']}})[_0x7ed2('0x10')](handleEntityNotFound(_0x479f00,null))['then'](function(_0x30acd0){if(_0x30acd0){_0x5d5fbf=_0x30acd0;_0x1b4cbd[_0x7ed2('0x1b')]=_[_0x7ed2('0x1d')](db[_0x7ed2('0x38')][_0x7ed2('0x18')]);_0x1b4cbd[_0x7ed2('0x1c')]=_[_0x7ed2('0x1d')](_0x122a85[_0x7ed2('0x1c')]);_0x1b4cbd[_0x7ed2('0x26')]=_[_0x7ed2('0x1e')](_0x1b4cbd[_0x7ed2('0x1b')],_0x1b4cbd[_0x7ed2('0x1c')]);_0x15bb05[_0x7ed2('0x1f')]=_[_0x7ed2('0x1e')](_0x1b4cbd['model'],qs['fields'](_0x122a85['query'][_0x7ed2('0x31')]));_0x15bb05[_0x7ed2('0x1f')]=_0x15bb05[_0x7ed2('0x1f')]['length']?_0x15bb05['attributes']:_0x1b4cbd[_0x7ed2('0x1b')];_0x15bb05['order']=qs[_0x7ed2('0x24')](_0x122a85[_0x7ed2('0x1c')]['sort']);_0x15bb05[_0x7ed2('0x25')]=qs['filters'](_['pick'](_0x122a85[_0x7ed2('0x1c')],_0x1b4cbd[_0x7ed2('0x26')]));if(_0x122a85['query'][_0x7ed2('0x27')]){_0x15bb05[_0x7ed2('0x25')]=_[_0x7ed2('0x29')](_0x15bb05[_0x7ed2('0x25')],{'$or':_[_0x7ed2('0x17')](_0x15bb05['attributes'],function(_0x371038){var _0x248dbf={};_0x248dbf[_0x371038]={'$like':'%'+_0x122a85[_0x7ed2('0x1c')][_0x7ed2('0x27')]+'%'};return _0x248dbf;})});}_0x15bb05=_[_0x7ed2('0x29')]({},_0x15bb05,_0x122a85['options']);return _0x5d5fbf['getConfigurations'](_0x15bb05);}})[_0x7ed2('0x10')](function(_0x105df5){if(_0x105df5){_0x5b2fe2=_0x105df5[_0x7ed2('0x20')];if(!_0x122a85[_0x7ed2('0x1c')][_0x7ed2('0x21')](_0x7ed2('0x22'))){_0x15bb05[_0x7ed2('0xb')]=qs[_0x7ed2('0xb')](_0x122a85['query'][_0x7ed2('0xb')]);_0x15bb05['offset']=qs['offset'](_0x122a85[_0x7ed2('0x1c')][_0x7ed2('0x9')]);}return _0x5d5fbf['getConfigurations'](_0x15bb05);}})['then'](function(_0x1caab3){if(_0x1caab3){return _0x1caab3?{'count':_0x5b2fe2,'rows':_0x1caab3}:null;}})[_0x7ed2('0x10')](respondWithResult(_0x479f00,null))['catch'](handleError(_0x479f00,null));};exports[_0x7ed2('0x39')]=function(_0x28b10d,_0x241831){if(_0x28b10d[_0x7ed2('0x35')]['id']){delete _0x28b10d[_0x7ed2('0x35')]['id'];}return db[_0x7ed2('0x30')][_0x7ed2('0x3a')]({'where':{'id':_0x28b10d[_0x7ed2('0x2f')]['id']}})[_0x7ed2('0x10')](handleEntityNotFound(_0x241831,null))[_0x7ed2('0x10')](function(_0x49b846){if(_0x49b846){_0x28b10d[_0x7ed2('0x35')]['AccountId']=_0x49b846['id'];_0x28b10d['body'][_0x7ed2('0x3b')]=integrations[_0x7ed2('0x3c')](_0x28b10d[_0x7ed2('0x35')][_0x7ed2('0x3d')],_0x28b10d[_0x7ed2('0x35')][_0x7ed2('0x1a')]);_0x28b10d['body'][_0x7ed2('0x3e')]=integrations['getDescriptions'](_0x28b10d['body']['channel'],_0x28b10d[_0x7ed2('0x35')][_0x7ed2('0x1a')]);return db[_0x7ed2('0x38')][_0x7ed2('0x34')](_0x28b10d['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x7ed2('0x3b')},{'model':db[_0x7ed2('0x3f')],'as':'Descriptions'}]});}return null;})[_0x7ed2('0x10')](respondWithResult(_0x241831,null))[_0x7ed2('0x36')](handleError(_0x241831,null));};function sanitizeRemoteUri(_0x1cce92){var _0x31aa9a=_0x1cce92[_0x7ed2('0x40')](-0x1);if(_0x31aa9a==='/')return _0x1cce92[_0x7ed2('0x41')](0x0,_0x1cce92['lastIndexOf'](_0x31aa9a));return _0x1cce92;}function getWebApiUrl(_0xf09329){return util[_0x7ed2('0x42')](_0x7ed2('0x43'),_0xf09329);}exports[_0x7ed2('0x44')]=function(_0x522adb,_0x34d415){var _0x2aaa26=_0x522adb[_0x7ed2('0x1c')][_0x7ed2('0x45')];var _0x19b607=_0x2aaa26===_0x7ed2('0x46')?_0x7ed2('0x47'):_0x7ed2('0x48');var _0x2cc47c='';var _0x38cd0d='';var _0x28e20a='';var _0x95479d='';var _0x46548c='';var _0xd013a9='';var _0x18a678='';var _0x249fe2='';var _0x729722=[_0x7ed2('0x49'),_0x7ed2('0x4a'),_0x7ed2('0x4b'),'ownerid',_0x7ed2('0x4c'),_0x7ed2('0x4d'),_0x7ed2('0x4e'),_0x7ed2('0x4f'),'directioncode',_0x7ed2('0x50')];var _0x281098=[_0x7ed2('0x51'),_0x7ed2('0x52'),_0x7ed2('0x53'),'billedserviceunits',_0x7ed2('0x54'),'contactidyominame',_0x7ed2('0x55'),_0x7ed2('0x56'),_0x7ed2('0x57'),'createdbyexternalpartyyominame',_0x7ed2('0x58'),_0x7ed2('0x59'),_0x7ed2('0x5a'),_0x7ed2('0x5b'),_0x7ed2('0x5c'),_0x7ed2('0x5d'),_0x7ed2('0x5e'),_0x7ed2('0x5f'),_0x7ed2('0x60'),_0x7ed2('0x61'),_0x7ed2('0x62'),'entityimage_url',_0x7ed2('0x63'),_0x7ed2('0x64'),_0x7ed2('0x65'),_0x7ed2('0x66'),'importsequencenumber',_0x7ed2('0x67'),_0x7ed2('0x68'),_0x7ed2('0x69'),_0x7ed2('0x6a'),_0x7ed2('0x6b'),_0x7ed2('0x6c'),'modifiedbyname',_0x7ed2('0x6d'),_0x7ed2('0x6e'),'modifiedonbehalfbyname',_0x7ed2('0x6f'),_0x7ed2('0x70'),_0x7ed2('0x71'),_0x7ed2('0x72'),'onholdtime',_0x7ed2('0x73'),_0x7ed2('0x74'),_0x7ed2('0x75'),_0x7ed2('0x76'),_0x7ed2('0x77'),_0x7ed2('0x78'),_0x7ed2('0x79'),_0x7ed2('0x7a'),_0x7ed2('0x7b'),_0x7ed2('0x7c'),_0x7ed2('0x7d'),_0x7ed2('0x7e'),'responseby',_0x7ed2('0x7f'),_0x7ed2('0x80'),_0x7ed2('0x81'),'slainvokedidname',_0x7ed2('0x82'),_0x7ed2('0x83'),_0x7ed2('0x84'),_0x7ed2('0x85'),'subjectidname','ticketnumber','timezoneruleversionnumber',_0x7ed2('0x86'),_0x7ed2('0x87'),'utcconversiontimezonecode',_0x7ed2('0x88')];var _0x96b3f0=_0x729722[_0x7ed2('0x89')](_0x281098);return db[_0x7ed2('0x30')][_0x7ed2('0x3a')]({'where':{'id':_0x522adb[_0x7ed2('0x2f')]['id']},'attributes':['id',_0x7ed2('0x8a'),'password',_0x7ed2('0x8b'),_0x7ed2('0x8c'),'clientId',_0x7ed2('0x8d'),_0x7ed2('0x8e')],'include':[{'model':db[_0x7ed2('0x8f')],'as':_0x7ed2('0x8f'),'attributes':['id',_0x7ed2('0x90'),_0x7ed2('0x91')]}]})[_0x7ed2('0x10')](handleEntityNotFound(_0x34d415,null))[_0x7ed2('0x10')](function(_0x292b20){if(_0x292b20){if(_0x292b20['modernAuthentication']){_0x292b20[_0x7ed2('0x92')]=_0x292b20[_0x7ed2('0x8f')][_0x7ed2('0x90')];_0x249fe2=sanitizeRemoteUri(_0x292b20[_0x7ed2('0x8f')][_0x7ed2('0x91')]);_0x18a678=getWebApiUrl(_0x249fe2);return _0x292b20;}_0x249fe2=sanitizeRemoteUri(_0x292b20[_0x7ed2('0x8b')]);_0x18a678=getWebApiUrl(_0x249fe2);var _0x3dd1a7={'method':_0x7ed2('0x93'),'uri':_0x7ed2('0x94')+_0x292b20[_0x7ed2('0x8c')]+_0x7ed2('0x95'),'form':{'client_id':_0x292b20['clientId'],'resource':_0x249fe2,'username':_0x292b20[_0x7ed2('0x8a')],'password':_0x292b20[_0x7ed2('0x96')],'grant_type':'password','client_secret':_0x292b20[_0x7ed2('0x8d')]},'json':!![]};return rp(_0x3dd1a7);}})['then'](function(_0x52cb5e){_0xd013a9=_0x52cb5e['access_token'];var _0x1dadc4={'method':'GET','uri':encodeURI(_0x18a678+_0x7ed2('0x97')+_0x19b607+'\x27'),'headers':{'Authorization':_0x7ed2('0x98')+_0xd013a9,'If-None-Match':null,'OData-Version':_0x7ed2('0x99')},'json':!![]};return rp(_0x1dadc4);})['then'](function(_0x1b7fa5){var _0x52f29c=_0x1b7fa5[_0x7ed2('0x9a')][0x0];var _0x229fe3=_0x52f29c[_0x7ed2('0x9b')];var _0x49b753={'method':_0x7ed2('0x9c'),'uri':_0x18a678+'EntityDefinitions('+_0x229fe3+_0x7ed2('0x9d'),'headers':{'Authorization':_0x7ed2('0x98')+_0xd013a9,'If-None-Match':null,'OData-Version':_0x7ed2('0x99')},'json':!![]};return rp(_0x49b753);})['then'](function(_0x324684){_0x2cc47c=_0x324684;_0x38cd0d=_0x2cc47c['Attributes'];_0x38cd0d=_[_0x7ed2('0x9e')](_0x38cd0d,function(_0x254036){return!_0x96b3f0[_0x7ed2('0x9f')](_0x254036[_0x7ed2('0xa0')]);});var _0x3ac394=[];var _0x5ddb9a=[];_0x38cd0d['forEach'](function(_0x27b83f){if(_0x27b83f['@odata.type']){var _0x8338fe=_0x27b83f[_0x7ed2('0xa1')][_0x7ed2('0x41')](_0x27b83f[_0x7ed2('0xa1')]['lastIndexOf']('.')+0x1);if(_0x8338fe==='PicklistAttributeMetadata'){_0x3ac394[_0x7ed2('0xa2')](getSelectList(_0x18a678,_0x2aaa26,_0x5ddb9a,_0x2cc47c['MetadataId'],_0x27b83f[_0x7ed2('0x9b')],_0xd013a9));}}});return Promise['all'](_0x3ac394);})[_0x7ed2('0x10')](function(_0xada27e){_0x28e20a=_0xada27e[0x0];var _0x45c0bd=[];var _0x1eb405=[];_0x38cd0d['forEach'](function(_0x1916a2){if(!_['isNil'](_0x1916a2[_0x7ed2('0xa1')])){var _0x5d0772=_0x1916a2[_0x7ed2('0xa1')]['substring'](_0x1916a2[_0x7ed2('0xa1')][_0x7ed2('0xa3')]('.')+0x1);if(_0x5d0772===_0x7ed2('0xa4')){_0x45c0bd['push'](getBooleanList(_0x18a678,_0x2aaa26,_0x1eb405,_0x2cc47c['MetadataId'],_0x1916a2[_0x7ed2('0x9b')],_0xd013a9));}}});return Promise[_0x7ed2('0xa5')](_0x45c0bd);})[_0x7ed2('0x10')](function(_0x39cc61){_0x95479d=_0x39cc61[0x0];var _0x5b0405=[];var _0x24edb8=[];_0x38cd0d[_0x7ed2('0xa6')](function(_0x5c9b25){if(_0x5c9b25[_0x7ed2('0xa1')]){var _0x45f9e8=_0x5c9b25[_0x7ed2('0xa1')][_0x7ed2('0x41')](_0x5c9b25[_0x7ed2('0xa1')][_0x7ed2('0xa3')]('.')+0x1);if(_0x45f9e8===_0x7ed2('0xa7')||_0x45f9e8===_0x7ed2('0xa8')||_0x45f9e8==='BigIntAttributeMetadata'||_0x45f9e8==='IntegerAttributeMetadata'||_0x45f9e8===_0x7ed2('0xa9')||_0x45f9e8==='DateTimeAttributeMetadata'||_0x45f9e8===_0x7ed2('0xaa')||_0x45f9e8===_0x7ed2('0xab')||_0x45f9e8===_0x7ed2('0xac')||_0x45f9e8===_0x7ed2('0xad')){_0x5b0405['push'](getInputList(_0x18a678,_0x2aaa26,_0x45f9e8,_0x24edb8,_0x2cc47c[_0x7ed2('0x9b')],_0x5c9b25[_0x7ed2('0x9b')],_0xd013a9));}}});return Promise[_0x7ed2('0xa5')](_0x5b0405);})[_0x7ed2('0x10')](function(_0x102119){_0x46548c=_0x102119[0x0];var _0x25c73e=_0x28e20a['concat'](_0x95479d)[_0x7ed2('0x89')](_0x46548c);var _0x324b83={'count':_0x25c73e['length'],'rows':_0x25c73e};return _0x324b83;})[_0x7ed2('0x10')](respondWithResult(_0x34d415,null))[_0x7ed2('0x36')](function(_0x3c6c00){var _0x3d667b=_0x522adb[_0x7ed2('0x1c')]['test']?0x1f4:_0x3c6c00['statusCode']||0x1f4;logger[_0x7ed2('0xae')](_0x3c6c00[_0x7ed2('0x13')]);delete _0x3c6c00[_0x7ed2('0x14')];if(_0x3d667b===0x191){_0x3d667b=0x190;}_0x34d415[_0x7ed2('0x7')](_0x3d667b)['send'](_0x522adb[_0x7ed2('0x1c')][_0x7ed2('0xaf')]?{'message':_0x7ed2('0xb0'),'statusCode':_0x3c6c00['statusCode']}:_0x3c6c00);});};function getSelectList(_0x5d2245,_0x11489b,_0x19a149,_0x202b14,_0x4267d2,_0x14454a){var _0x5426d3={'method':'GET','uri':_0x5d2245+_0x7ed2('0xb1')+_0x202b14+_0x7ed2('0xb2')+_0x4267d2+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7ed2('0xb3'),'headers':{'Authorization':_0x7ed2('0x98')+_0x14454a,'If-None-Match':null,'OData-Version':_0x7ed2('0x99')},'json':!![]};return rp(_0x5426d3)[_0x7ed2('0x10')](function(_0x22cd36){var _0x19440c=[];var _0x37f1a4=_0x22cd36[_0x7ed2('0xb4')][_0x7ed2('0xb5')];_0x37f1a4['forEach'](function(_0x404ce9){_0x19440c['push']({'name':_0x404ce9['Label'][_0x7ed2('0xb6')]['Label'],'value':String(_0x404ce9[_0x7ed2('0xb7')])});});var _0x2128e0={'id':_0x11489b+'_'+_0x22cd36[_0x7ed2('0xa0')],'name':_0x22cd36['DisplayName'][_0x7ed2('0xb6')][_0x7ed2('0xb8')],'custom':![],'options':_0x19440c};_0x19a149[_0x7ed2('0xa2')](_0x2128e0);return _0x19a149;});}function getBooleanList(_0x448266,_0x46b81e,_0x5d721d,_0x1d08ad,_0x4afab2,_0x32641a){var _0x688bd6={'method':_0x7ed2('0x9c'),'uri':_0x448266+_0x7ed2('0xb1')+_0x1d08ad+')/Attributes('+_0x4afab2+_0x7ed2('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x32641a,'If-None-Match':null,'OData-Version':_0x7ed2('0x99')},'json':!![]};return rp(_0x688bd6)[_0x7ed2('0x10')](function(_0x183969){var _0x5a9870=[];_0x5a9870['push']({'name':_0x183969[_0x7ed2('0xb4')][_0x7ed2('0xba')][_0x7ed2('0xb8')]['UserLocalizedLabel'][_0x7ed2('0xb8')],'value':'true'},{'name':_0x183969[_0x7ed2('0xb4')][_0x7ed2('0xbb')][_0x7ed2('0xb8')][_0x7ed2('0xb6')][_0x7ed2('0xb8')],'value':_0x7ed2('0xbc')});var _0xb87d4c={'id':_0x46b81e+'_'+_0x183969[_0x7ed2('0xa0')],'name':_0x183969[_0x7ed2('0xbd')]['UserLocalizedLabel'][_0x7ed2('0xb8')],'custom':![],'options':_0x5a9870};_0x5d721d['push'](_0xb87d4c);return _0x5d721d;});}function getInputList(_0x552eab,_0xaafa09,_0x30f41e,_0x5a1c01,_0x54a278,_0x17ceb0,_0x4a2da3){var _0x531f5e={'method':_0x7ed2('0x9c'),'uri':_0x552eab+_0x7ed2('0xb1')+_0x54a278+_0x7ed2('0xb2')+_0x17ceb0+_0x7ed2('0xbe')+_0x30f41e+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7ed2('0x98')+_0x4a2da3,'If-None-Match':null,'OData-Version':_0x7ed2('0x99')},'json':!![]};return rp(_0x531f5e)[_0x7ed2('0x10')](function(_0x6c461d){var _0x4111be={'id':_0xaafa09+'_'+_0x6c461d[_0x7ed2('0xa0')],'name':_0x6c461d['DisplayName'][_0x7ed2('0xb6')]?_0x6c461d[_0x7ed2('0xbd')][_0x7ed2('0xb6')]['Label']:_0x6c461d[_0x7ed2('0xa0')],'custom':![],'options':[]};_0x5a1c01['push'](_0x4111be);return _0x5a1c01;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e10bd1d..c0fdc9c 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x40bfd0,_0xb56d08){var _0x58764f=function(_0x214e21){while(--_0x214e21){_0x40bfd0['push'](_0x40bfd0['shift']());}};_0x58764f(++_0xb56d08);}(_0xe706,0xa3));var _0x6e70=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0xe706[_0x5b87ce];return _0x597aa7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a2424,_0x1afcc7){var _0x68fc05=function(_0x475dac){while(--_0x475dac){_0x3a2424['push'](_0x3a2424['shift']());}};_0x68fc05(++_0x1afcc7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 34a075b..3d9052d 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 _0x46db=['info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map','stringify','catch','ShowDynamics365Account','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then'];(function(_0x9119f3,_0x5364d3){var _0x336cc3=function(_0x3c8cd6){while(--_0x3c8cd6){_0x9119f3['push'](_0x9119f3['shift']());}};_0x336cc3(++_0x5364d3);}(_0x46db,0xe9));var _0xb46d=function(_0x342024,_0x47212d){_0x342024=_0x342024-0x0;var _0x384838=_0x46db[_0x342024];return _0x384838;};'use strict';var _=require('lodash');var util=require(_0xb46d('0x0'));var moment=require(_0xb46d('0x1'));var BPromise=require(_0xb46d('0x2'));var rs=require(_0xb46d('0x3'));var fs=require('fs');var Redis=require(_0xb46d('0x4'));var db=require(_0xb46d('0x5'))['db'];var utils=require(_0xb46d('0x6'));var logger=require('../../config/logger')(_0xb46d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb46d('0x8')][_0xb46d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1870f5,_0x2190ee,_0x8cbee6){return new BPromise(function(_0x31fd53,_0x7ae3ee){return client[_0xb46d('0xa')](_0x1870f5,_0x8cbee6)[_0xb46d('0xb')](function(_0x11c91f){logger[_0xb46d('0xc')](_0xb46d('0xd'),_0x2190ee,'request\x20sent');logger[_0xb46d('0xe')](_0xb46d('0xf'),_0x2190ee,_0xb46d('0x10'),JSON['stringify'](_0x11c91f));if(_0x11c91f['error']){if(_0x11c91f[_0xb46d('0x11')]['code']===0x1f4){logger[_0xb46d('0x11')](_0xb46d('0xd'),_0x2190ee,_0x11c91f[_0xb46d('0x11')][_0xb46d('0x12')]);return _0x7ae3ee(_0x11c91f['error']['message']);}logger[_0xb46d('0x11')](_0xb46d('0xd'),_0x2190ee,_0x11c91f['error'][_0xb46d('0x12')]);return _0x31fd53(_0x11c91f[_0xb46d('0x11')][_0xb46d('0x12')]);}else{logger[_0xb46d('0xc')](_0xb46d('0xd'),_0x2190ee,_0xb46d('0x10'));_0x31fd53(_0x11c91f[_0xb46d('0x13')]['message']);}})['catch'](function(_0x47901d){logger[_0xb46d('0x11')](_0xb46d('0xd'),_0x2190ee,_0x47901d);_0x7ae3ee(_0x47901d);});});}exports[_0xb46d('0x14')]=function(_0x51aee3){var _0x353d4c=this;return new Promise(function(_0x3170b3,_0xa319dc){return db[_0xb46d('0x15')][_0xb46d('0x16')]({'raw':_0x51aee3[_0xb46d('0x17')]?_0x51aee3[_0xb46d('0x17')][_0xb46d('0x18')]===undefined?!![]:![]:!![],'where':_0x51aee3[_0xb46d('0x17')]?_0x51aee3['options'][_0xb46d('0x19')]||null:null,'attributes':_0x51aee3['options']?_0x51aee3['options']['attributes']||null:null,'limit':_0x51aee3['options']?_0x51aee3['options'][_0xb46d('0x1a')]||null:null,'include':_0x51aee3[_0xb46d('0x17')]?_0x51aee3[_0xb46d('0x17')][_0xb46d('0x1b')]?_['map'](_0x51aee3[_0xb46d('0x17')][_0xb46d('0x1b')],function(_0x3f82b6){return{'model':db[_0x3f82b6[_0xb46d('0x1c')]],'as':_0x3f82b6['as'],'attributes':_0x3f82b6[_0xb46d('0x1d')],'include':_0x3f82b6[_0xb46d('0x1b')]?_[_0xb46d('0x1e')](_0x3f82b6[_0xb46d('0x1b')],function(_0xdb7fef){return{'model':db[_0xdb7fef[_0xb46d('0x1c')]],'as':_0xdb7fef['as'],'attributes':_0xdb7fef[_0xb46d('0x1d')],'include':_0xdb7fef['include']?_[_0xb46d('0x1e')](_0xdb7fef['include'],function(_0x3957e4){return{'model':db[_0x3957e4[_0xb46d('0x1c')]],'as':_0x3957e4['as'],'attributes':_0x3957e4[_0xb46d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb46d('0xb')](function(_0x2e5c83){logger[_0xb46d('0xc')](_0xb46d('0x14'),_0x51aee3);logger['debug']('GetDynamics365Account',_0x51aee3,JSON[_0xb46d('0x1f')](_0x2e5c83));_0x3170b3(_0x2e5c83);})[_0xb46d('0x20')](function(_0x37e521){logger[_0xb46d('0x11')](_0xb46d('0x14'),_0x37e521[_0xb46d('0x12')],_0x51aee3);_0xa319dc(_0x353d4c[_0xb46d('0x11')](0x1f4,_0x37e521[_0xb46d('0x12')]));});});};exports[_0xb46d('0x21')]=function(_0x3c1cb0){var _0x36a77a=this;return new Promise(function(_0x3a510d,_0x3e714a){return db[_0xb46d('0x15')][_0xb46d('0x22')]({'raw':_0x3c1cb0[_0xb46d('0x17')]?_0x3c1cb0['options'][_0xb46d('0x18')]===undefined?!![]:![]:!![],'where':_0x3c1cb0['options']?_0x3c1cb0['options'][_0xb46d('0x19')]||null:null,'attributes':_0x3c1cb0[_0xb46d('0x17')]?_0x3c1cb0[_0xb46d('0x17')][_0xb46d('0x1d')]||null:null,'include':_0x3c1cb0['options']?_0x3c1cb0[_0xb46d('0x17')]['include']?_[_0xb46d('0x1e')](_0x3c1cb0[_0xb46d('0x17')][_0xb46d('0x1b')],function(_0x2c31f1){return{'model':db[_0x2c31f1[_0xb46d('0x1c')]],'as':_0x2c31f1['as'],'attributes':_0x2c31f1[_0xb46d('0x1d')],'include':_0x2c31f1['include']?_[_0xb46d('0x1e')](_0x2c31f1['include'],function(_0x36e215){return{'model':db[_0x36e215[_0xb46d('0x1c')]],'as':_0x36e215['as'],'attributes':_0x36e215[_0xb46d('0x1d')],'include':_0x36e215[_0xb46d('0x1b')]?_[_0xb46d('0x1e')](_0x36e215[_0xb46d('0x1b')],function(_0x3d7042){return{'model':db[_0x3d7042['model']],'as':_0x3d7042['as'],'attributes':_0x3d7042[_0xb46d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e576b){logger[_0xb46d('0xc')](_0xb46d('0x21'),_0x3c1cb0);logger[_0xb46d('0xe')](_0xb46d('0x21'),_0x3c1cb0,JSON['stringify'](_0x3e576b));_0x3a510d(_0x3e576b);})['catch'](function(_0x852dd7){logger[_0xb46d('0x11')](_0xb46d('0x21'),_0x852dd7[_0xb46d('0x12')],_0x3c1cb0);_0x3e714a(_0x36a77a[_0xb46d('0x11')](0x1f4,_0x852dd7['message']));});});}; \ No newline at end of file +var _0xdee1=['then','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','Dynamics365Account','findAll','options','where','map','include','model','attributes','GetDynamics365Account','catch','ShowDynamics365Account','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5c6c64,_0x12d4cb){var _0x172174=function(_0x3f49c3){while(--_0x3f49c3){_0x5c6c64['push'](_0x5c6c64['shift']());}};_0x172174(++_0x12d4cb);}(_0xdee1,0x18c));var _0x1dee=function(_0x311c92,_0x9166a3){_0x311c92=_0x311c92-0x0;var _0x2914d0=_0xdee1[_0x311c92];return _0x2914d0;};'use strict';var _=require(_0x1dee('0x0'));var util=require(_0x1dee('0x1'));var moment=require(_0x1dee('0x2'));var BPromise=require(_0x1dee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dee('0x4'));var db=require(_0x1dee('0x5'))['db'];var utils=require(_0x1dee('0x6'));var logger=require(_0x1dee('0x7'))(_0x1dee('0x8'));var config=require(_0x1dee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1dee('0xa')][_0x1dee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15c8fa,_0x11704a,_0x5400d4){return new BPromise(function(_0x652329,_0x32e340){return client['request'](_0x15c8fa,_0x5400d4)[_0x1dee('0xc')](function(_0x448018){logger['info'](_0x1dee('0xd'),_0x11704a,'request\x20sent');logger[_0x1dee('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x11704a,_0x1dee('0xf'),JSON[_0x1dee('0x10')](_0x448018));if(_0x448018[_0x1dee('0x11')]){if(_0x448018[_0x1dee('0x11')][_0x1dee('0x12')]===0x1f4){logger[_0x1dee('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x11704a,_0x448018[_0x1dee('0x11')][_0x1dee('0x13')]);return _0x32e340(_0x448018[_0x1dee('0x11')]['message']);}logger[_0x1dee('0x11')](_0x1dee('0xd'),_0x11704a,_0x448018['error']['message']);return _0x652329(_0x448018[_0x1dee('0x11')][_0x1dee('0x13')]);}else{logger[_0x1dee('0x14')](_0x1dee('0xd'),_0x11704a,'request\x20sent');_0x652329(_0x448018['result']['message']);}})['catch'](function(_0x1489bf){logger[_0x1dee('0x11')](_0x1dee('0xd'),_0x11704a,_0x1489bf);_0x32e340(_0x1489bf);});});}exports['GetDynamics365Account']=function(_0xa8b04){var _0x53e19a=this;return new Promise(function(_0x4faa9e,_0x282746){return db[_0x1dee('0x15')][_0x1dee('0x16')]({'raw':_0xa8b04['options']?_0xa8b04['options']['raw']===undefined?!![]:![]:!![],'where':_0xa8b04[_0x1dee('0x17')]?_0xa8b04[_0x1dee('0x17')][_0x1dee('0x18')]||null:null,'attributes':_0xa8b04[_0x1dee('0x17')]?_0xa8b04[_0x1dee('0x17')]['attributes']||null:null,'limit':_0xa8b04[_0x1dee('0x17')]?_0xa8b04['options']['limit']||null:null,'include':_0xa8b04[_0x1dee('0x17')]?_0xa8b04[_0x1dee('0x17')]['include']?_[_0x1dee('0x19')](_0xa8b04['options'][_0x1dee('0x1a')],function(_0x5c18be){return{'model':db[_0x5c18be[_0x1dee('0x1b')]],'as':_0x5c18be['as'],'attributes':_0x5c18be[_0x1dee('0x1c')],'include':_0x5c18be[_0x1dee('0x1a')]?_[_0x1dee('0x19')](_0x5c18be[_0x1dee('0x1a')],function(_0x2452fa){return{'model':db[_0x2452fa[_0x1dee('0x1b')]],'as':_0x2452fa['as'],'attributes':_0x2452fa[_0x1dee('0x1c')],'include':_0x2452fa[_0x1dee('0x1a')]?_[_0x1dee('0x19')](_0x2452fa[_0x1dee('0x1a')],function(_0x45b917){return{'model':db[_0x45b917['model']],'as':_0x45b917['as'],'attributes':_0x45b917['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ddf58){logger[_0x1dee('0x14')]('GetDynamics365Account',_0xa8b04);logger['debug'](_0x1dee('0x1d'),_0xa8b04,JSON['stringify'](_0x1ddf58));_0x4faa9e(_0x1ddf58);})[_0x1dee('0x1e')](function(_0xdda33c){logger[_0x1dee('0x11')](_0x1dee('0x1d'),_0xdda33c[_0x1dee('0x13')],_0xa8b04);_0x282746(_0x53e19a[_0x1dee('0x11')](0x1f4,_0xdda33c[_0x1dee('0x13')]));});});};exports[_0x1dee('0x1f')]=function(_0x59a07d){var _0x33b8e7=this;return new Promise(function(_0x124bb0,_0x1bdfdf){return db[_0x1dee('0x15')][_0x1dee('0x20')]({'raw':_0x59a07d[_0x1dee('0x17')]?_0x59a07d[_0x1dee('0x17')][_0x1dee('0x21')]===undefined?!![]:![]:!![],'where':_0x59a07d[_0x1dee('0x17')]?_0x59a07d['options']['where']||null:null,'attributes':_0x59a07d['options']?_0x59a07d[_0x1dee('0x17')][_0x1dee('0x1c')]||null:null,'include':_0x59a07d[_0x1dee('0x17')]?_0x59a07d[_0x1dee('0x17')][_0x1dee('0x1a')]?_[_0x1dee('0x19')](_0x59a07d[_0x1dee('0x17')][_0x1dee('0x1a')],function(_0x194d15){return{'model':db[_0x194d15[_0x1dee('0x1b')]],'as':_0x194d15['as'],'attributes':_0x194d15[_0x1dee('0x1c')],'include':_0x194d15['include']?_[_0x1dee('0x19')](_0x194d15[_0x1dee('0x1a')],function(_0x4016b9){return{'model':db[_0x4016b9[_0x1dee('0x1b')]],'as':_0x4016b9['as'],'attributes':_0x4016b9[_0x1dee('0x1c')],'include':_0x4016b9[_0x1dee('0x1a')]?_[_0x1dee('0x19')](_0x4016b9[_0x1dee('0x1a')],function(_0x1b84a2){return{'model':db[_0x1b84a2[_0x1dee('0x1b')]],'as':_0x1b84a2['as'],'attributes':_0x1b84a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dee('0xc')](function(_0x21a481){logger['info'](_0x1dee('0x1f'),_0x59a07d);logger[_0x1dee('0xe')](_0x1dee('0x1f'),_0x59a07d,JSON[_0x1dee('0x10')](_0x21a481));_0x124bb0(_0x21a481);})[_0x1dee('0x1e')](function(_0x75a95a){logger['error'](_0x1dee('0x1f'),_0x75a95a[_0x1dee('0x13')],_0x59a07d);_0x1bdfdf(_0x33b8e7[_0x1dee('0x11')](0x1f4,_0x75a95a[_0x1dee('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index eecc36b..4a2bf4d 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 _0xd94d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','put','update','delete','/:id','destroy','exports','util'];(function(_0x114ff6,_0x19e80d){var _0x4d3a58=function(_0x351ee1){while(--_0x351ee1){_0x114ff6['push'](_0x114ff6['shift']());}};_0x4d3a58(++_0x19e80d);}(_0xd94d,0x16f));var _0xdd94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd94d[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xdd94('0x0'));var path=require(_0xdd94('0x1'));var timeout=require(_0xdd94('0x2'));var express=require('express');var router=express[_0xdd94('0x3')]();var fs_extra=require(_0xdd94('0x4'));var auth=require(_0xdd94('0x5'));var interaction=require(_0xdd94('0x6'));var config=require(_0xdd94('0x7'));var controller=require(_0xdd94('0x8'));router[_0xdd94('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd94('0xa')]);router[_0xdd94('0x9')]('/:id',auth[_0xdd94('0xb')](),controller[_0xdd94('0xc')]);router[_0xdd94('0x9')](_0xdd94('0xd'),auth[_0xdd94('0xb')](),controller[_0xdd94('0xe')]);router[_0xdd94('0x9')](_0xdd94('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xdd94('0x9')]('/:id/descriptions',auth[_0xdd94('0xb')](),controller[_0xdd94('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdd94('0x11')]('/:id',auth[_0xdd94('0xb')](),controller[_0xdd94('0x12')]);router[_0xdd94('0x13')](_0xdd94('0x14'),auth[_0xdd94('0xb')](),controller[_0xdd94('0x15')]);module[_0xdd94('0x16')]=router; \ No newline at end of file +var _0x8889=['isAuthenticated','index','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8889,0x1d9));var _0x9888=function(_0x22ae02,_0x3dd837){_0x22ae02=_0x22ae02-0x0;var _0x27e17e=_0x8889[_0x22ae02];return _0x27e17e;};'use strict';var multer=require(_0x9888('0x0'));var util=require(_0x9888('0x1'));var path=require(_0x9888('0x2'));var timeout=require(_0x9888('0x3'));var express=require(_0x9888('0x4'));var router=express[_0x9888('0x5')]();var fs_extra=require(_0x9888('0x6'));var auth=require(_0x9888('0x7'));var interaction=require(_0x9888('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x9888('0x9')]('/',auth[_0x9888('0xa')](),controller[_0x9888('0xb')]);router['get'](_0x9888('0xc'),auth[_0x9888('0xa')](),controller['show']);router[_0x9888('0x9')](_0x9888('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x9888('0x9')](_0x9888('0xe'),auth[_0x9888('0xa')](),controller['getSubjects']);router[_0x9888('0x9')](_0x9888('0xf'),auth[_0x9888('0xa')](),controller[_0x9888('0x10')]);router[_0x9888('0x11')]('/',auth[_0x9888('0xa')](),controller[_0x9888('0x12')]);router[_0x9888('0x13')](_0x9888('0xc'),auth[_0x9888('0xa')](),controller[_0x9888('0x14')]);router['delete'](_0x9888('0xc'),auth[_0x9888('0xa')](),controller[_0x9888('0x15')]);module[_0x9888('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 1a1c5a7..0439116 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 _0x2078=['ENUM','incident','phonecall','nothing','contact','BOOLEAN','STRING'];(function(_0x19dfab,_0x12a120){var _0x35137d=function(_0x26d3bc){while(--_0x26d3bc){_0x19dfab['push'](_0x19dfab['shift']());}};_0x35137d(++_0x12a120);}(_0x2078,0xbc));var _0x8207=function(_0x5b8cab,_0x4c5c51){_0x5b8cab=_0x5b8cab-0x0;var _0x192b95=_0x2078[_0x5b8cab];return _0x192b95;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8207('0x0')]},'ticketType':{'type':Sequelize[_0x8207('0x1')](_0x8207('0x2'),_0x8207('0x3')),'defaultValue':_0x8207('0x2')},'moduleCreate':{'type':Sequelize[_0x8207('0x1')]('contact',_0x8207('0x4')),'defaultValue':_0x8207('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8207('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x15d9=['incident','contact','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x2ae2bc,_0x177514){var _0x53c290=function(_0x3ac4c0){while(--_0x3ac4c0){_0x2ae2bc['push'](_0x2ae2bc['shift']());}};_0x53c290(++_0x177514);}(_0x15d9,0xc0));var _0x915d=function(_0x472266,_0x13b9aa){_0x472266=_0x472266-0x0;var _0x5ed7ef=_0x15d9[_0x472266];return _0x5ed7ef;};'use strict';var Sequelize=require(_0x915d('0x0'));module[_0x915d('0x1')]={'name':{'type':Sequelize[_0x915d('0x2')]},'description':{'type':Sequelize[_0x915d('0x2')]},'ticketType':{'type':Sequelize[_0x915d('0x3')]('incident','phonecall'),'defaultValue':_0x915d('0x4')},'moduleCreate':{'type':Sequelize[_0x915d('0x3')](_0x915d('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x915d('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x915d('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 75a05f0..68ce888 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 _0xc582=['lodash','crypto','jsforce','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','find','create','body','params','getFields','findOne','order','pick','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv'];(function(_0x3bd314,_0x1b4452){var _0x38311e=function(_0xbdad01){while(--_0xbdad01){_0x3bd314['push'](_0x3bd314['shift']());}};_0x38311e(++_0x1b4452);}(_0xc582,0x130));var _0x2c58=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xc582[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require(_0x2c58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c58('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c58('0x3'));var util=require(_0x2c58('0x4'));var path=require(_0x2c58('0x5'));var sox=require(_0x2c58('0x6'));var csv=require(_0x2c58('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c58('0x8'));var squel=require('squel');var crypto=require(_0x2c58('0x9'));var jsforce=require(_0x2c58('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2c58('0x7'));var querystring=require(_0x2c58('0xb'));var Papa=require(_0x2c58('0xc'));var Redis=require('ioredis');var authService=require(_0x2c58('0xd'));var qs=require(_0x2c58('0xe'));var as=require(_0x2c58('0xf'));var hardwareService=require(_0x2c58('0x10'));var logger=require('../../config/logger')(_0x2c58('0x11'));var utils=require(_0x2c58('0x12'));var config=require(_0x2c58('0x13'));var licenseUtil=require(_0x2c58('0x14'));var db=require(_0x2c58('0x15'))['db'];function respondWithStatusCode(_0x5e2c53,_0x580baa){_0x580baa=_0x580baa||0xcc;return function(_0x1d1d9f){if(_0x1d1d9f){return _0x5e2c53[_0x2c58('0x16')](_0x580baa);}return _0x5e2c53[_0x2c58('0x17')](_0x580baa)[_0x2c58('0x18')]();};}function respondWithResult(_0x37e4d3,_0x47bd11){_0x47bd11=_0x47bd11||0xc8;return function(_0x4df62c){if(_0x4df62c){return _0x37e4d3[_0x2c58('0x17')](_0x47bd11)[_0x2c58('0x19')](_0x4df62c);}};}function respondWithFilteredResult(_0x634efe,_0xaddfd1){return function(_0x181499){if(_0x181499){var _0x4a4bc7=typeof _0xaddfd1[_0x2c58('0x1a')]===_0x2c58('0x1b')&&typeof _0xaddfd1[_0x2c58('0x1c')]==='undefined';var _0x18310e=_0x181499[_0x2c58('0x1d')];var _0x4957e1=_0x4a4bc7?0x0:_0xaddfd1[_0x2c58('0x1a')];var _0x1ac921=_0x4a4bc7?_0x181499[_0x2c58('0x1d')]:_0xaddfd1[_0x2c58('0x1a')]+_0xaddfd1[_0x2c58('0x1c')];var _0x306461;if(_0x1ac921>=_0x18310e){_0x1ac921=_0x18310e;_0x306461=0xc8;}else{_0x306461=0xce;}_0x634efe[_0x2c58('0x17')](_0x306461);return _0x634efe['set'](_0x2c58('0x1e'),_0x4957e1+'-'+_0x1ac921+'/'+_0x18310e)[_0x2c58('0x19')](_0x181499);}return null;};}function patchUpdates(_0xbf9c88){return function(_0x33aec4){try{jsonpatch[_0x2c58('0x1f')](_0x33aec4,_0xbf9c88,!![]);}catch(_0x31b536){return BPromise[_0x2c58('0x20')](_0x31b536);}return _0x33aec4[_0x2c58('0x21')]();};}function saveUpdates(_0x597ca7,_0x30e296){return function(_0x2fd741){if(_0x2fd741){return _0x2fd741[_0x2c58('0x22')](_0x597ca7)[_0x2c58('0x23')](function(_0x39901b){return _0x39901b;});}return null;};}function removeEntity(_0x5ebed2,_0x29561d){return function(_0x3f86ec){if(_0x3f86ec){return _0x3f86ec[_0x2c58('0x24')]()[_0x2c58('0x23')](function(){_0x5ebed2['status'](0xcc)[_0x2c58('0x18')]();});}};}function handleEntityNotFound(_0x747d12,_0x314352){return function(_0x34c866){if(!_0x34c866){_0x747d12[_0x2c58('0x16')](0x194);}return _0x34c866;};}function handleError(_0x553516,_0x241d5f){_0x241d5f=_0x241d5f||0x1f4;return function(_0x49e8b3){logger[_0x2c58('0x25')](_0x49e8b3['stack']);if(_0x49e8b3[_0x2c58('0x26')]){delete _0x49e8b3[_0x2c58('0x26')];}_0x553516[_0x2c58('0x17')](_0x241d5f)[_0x2c58('0x27')](_0x49e8b3);};}exports[_0x2c58('0x28')]=function(_0x5cac6c,_0x249879){var _0x1e61a2={},_0x4dd35e={},_0x45c794={'count':0x0,'rows':[]};var _0x509f73=_[_0x2c58('0x29')](db[_0x2c58('0x2a')][_0x2c58('0x2b')],function(_0x6952fa){return{'name':_0x6952fa['fieldName'],'type':_0x6952fa[_0x2c58('0x2c')][_0x2c58('0x2d')]};});_0x4dd35e['model']=_['map'](_0x509f73,_0x2c58('0x26'));_0x4dd35e[_0x2c58('0x2e')]=_[_0x2c58('0x2f')](_0x5cac6c[_0x2c58('0x2e')]);_0x4dd35e[_0x2c58('0x30')]=_[_0x2c58('0x31')](_0x4dd35e[_0x2c58('0x32')],_0x4dd35e[_0x2c58('0x2e')]);_0x1e61a2['attributes']=_[_0x2c58('0x31')](_0x4dd35e[_0x2c58('0x32')],qs[_0x2c58('0x33')](_0x5cac6c[_0x2c58('0x2e')][_0x2c58('0x33')]));_0x1e61a2[_0x2c58('0x34')]=_0x1e61a2['attributes'][_0x2c58('0x35')]?_0x1e61a2['attributes']:_0x4dd35e[_0x2c58('0x32')];if(!_0x5cac6c['query']['hasOwnProperty'](_0x2c58('0x36'))){_0x1e61a2[_0x2c58('0x1c')]=qs['limit'](_0x5cac6c[_0x2c58('0x2e')]['limit']);_0x1e61a2[_0x2c58('0x1a')]=qs['offset'](_0x5cac6c[_0x2c58('0x2e')][_0x2c58('0x1a')]);}_0x1e61a2['order']=qs[_0x2c58('0x37')](_0x5cac6c[_0x2c58('0x2e')][_0x2c58('0x37')]);_0x1e61a2[_0x2c58('0x38')]=qs[_0x2c58('0x30')](_['pick'](_0x5cac6c['query'],_0x4dd35e[_0x2c58('0x30')]),_0x509f73);if(_0x5cac6c['query'][_0x2c58('0x39')]){_0x1e61a2[_0x2c58('0x38')]=_[_0x2c58('0x3a')](_0x1e61a2[_0x2c58('0x38')],{'$or':_[_0x2c58('0x29')](_0x509f73,function(_0x74fc4b){if(_0x74fc4b[_0x2c58('0x2c')]!==_0x2c58('0x3b')){var _0x476eb2={};_0x476eb2[_0x74fc4b[_0x2c58('0x26')]]={'$like':'%'+_0x5cac6c['query'][_0x2c58('0x39')]+'%'};return _0x476eb2;}})});}_0x1e61a2=_[_0x2c58('0x3a')]({},_0x1e61a2,_0x5cac6c[_0x2c58('0x3c')]);var _0x4af90c={'where':_0x1e61a2[_0x2c58('0x38')]};return db[_0x2c58('0x2a')][_0x2c58('0x1d')](_0x4af90c)[_0x2c58('0x23')](function(_0x41c420){_0x45c794[_0x2c58('0x1d')]=_0x41c420;if(_0x5cac6c[_0x2c58('0x2e')][_0x2c58('0x3d')]){_0x1e61a2['include']=[{'all':!![]}];}return db[_0x2c58('0x2a')][_0x2c58('0x3e')](_0x1e61a2);})[_0x2c58('0x23')](function(_0x2bf0d5){_0x45c794[_0x2c58('0x3f')]=_0x2bf0d5;return _0x45c794;})['then'](respondWithFilteredResult(_0x249879,_0x1e61a2))[_0x2c58('0x40')](handleError(_0x249879,null));};exports[_0x2c58('0x41')]=function(_0x1aa89b,_0x21b143){var _0x58791c={'raw':![],'where':{'id':_0x1aa89b['params']['id']}},_0x1fd516={};_0x1fd516['model']=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x1fd516['query']=_['keys'](_0x1aa89b[_0x2c58('0x2e')]);_0x1fd516['filters']=_[_0x2c58('0x31')](_0x1fd516[_0x2c58('0x32')],_0x1fd516[_0x2c58('0x2e')]);_0x58791c[_0x2c58('0x34')]=_[_0x2c58('0x31')](_0x1fd516[_0x2c58('0x32')],qs[_0x2c58('0x33')](_0x1aa89b[_0x2c58('0x2e')][_0x2c58('0x33')]));_0x58791c['attributes']=_0x58791c['attributes'][_0x2c58('0x35')]?_0x58791c[_0x2c58('0x34')]:_0x1fd516['model'];if(_0x1aa89b['query']['includeAll']){_0x58791c['include']=[{'all':!![]}];}_0x58791c=_[_0x2c58('0x3a')]({},_0x58791c,_0x1aa89b['options']);return db[_0x2c58('0x2a')][_0x2c58('0x42')](_0x58791c)[_0x2c58('0x23')](handleEntityNotFound(_0x21b143,null))[_0x2c58('0x23')](respondWithResult(_0x21b143,null))['catch'](handleError(_0x21b143,null));};exports[_0x2c58('0x43')]=function(_0x24b5ad,_0x3bcb7b){return db[_0x2c58('0x2a')][_0x2c58('0x43')](_0x24b5ad[_0x2c58('0x44')],{})[_0x2c58('0x23')](respondWithResult(_0x3bcb7b,0xc9))[_0x2c58('0x40')](handleError(_0x3bcb7b,null));};exports[_0x2c58('0x22')]=function(_0x7d1bfe,_0x43ed54){if(_0x7d1bfe['body']['id']){delete _0x7d1bfe[_0x2c58('0x44')]['id'];}return db[_0x2c58('0x2a')][_0x2c58('0x42')]({'where':{'id':_0x7d1bfe[_0x2c58('0x45')]['id']}})[_0x2c58('0x23')](handleEntityNotFound(_0x43ed54,null))[_0x2c58('0x23')](saveUpdates(_0x7d1bfe[_0x2c58('0x44')],null))[_0x2c58('0x23')](respondWithResult(_0x43ed54,null))[_0x2c58('0x40')](handleError(_0x43ed54,null));};exports[_0x2c58('0x24')]=function(_0x398bb2,_0x4e587a){return db[_0x2c58('0x2a')]['find']({'where':{'id':_0x398bb2[_0x2c58('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e587a,null))[_0x2c58('0x23')](removeEntity(_0x4e587a,null))[_0x2c58('0x40')](handleError(_0x4e587a,null));};exports[_0x2c58('0x46')]=function(_0x2107b4,_0x263e11,_0x1922f7){var _0x5f39d4={};var _0x1f209f={};var _0x362f8e;var _0x256539;return db[_0x2c58('0x2a')][_0x2c58('0x47')]({'where':{'id':_0x2107b4['params']['id']}})[_0x2c58('0x23')](handleEntityNotFound(_0x263e11,null))[_0x2c58('0x23')](function(_0x1e0f3b){if(_0x1e0f3b){_0x362f8e=_0x1e0f3b;_0x1f209f[_0x2c58('0x32')]=_[_0x2c58('0x2f')](db['Dynamics365Field'][_0x2c58('0x2b')]);_0x1f209f[_0x2c58('0x2e')]=_[_0x2c58('0x2f')](_0x2107b4[_0x2c58('0x2e')]);_0x1f209f['filters']=_['intersection'](_0x1f209f[_0x2c58('0x32')],_0x1f209f[_0x2c58('0x2e')]);_0x5f39d4['attributes']=_[_0x2c58('0x31')](_0x1f209f[_0x2c58('0x32')],qs['fields'](_0x2107b4[_0x2c58('0x2e')][_0x2c58('0x33')]));_0x5f39d4[_0x2c58('0x34')]=_0x5f39d4['attributes'][_0x2c58('0x35')]?_0x5f39d4['attributes']:_0x1f209f[_0x2c58('0x32')];_0x5f39d4[_0x2c58('0x48')]=qs[_0x2c58('0x37')](_0x2107b4[_0x2c58('0x2e')][_0x2c58('0x37')]);_0x5f39d4[_0x2c58('0x38')]=qs[_0x2c58('0x30')](_[_0x2c58('0x49')](_0x2107b4['query'],_0x1f209f[_0x2c58('0x30')]));if(_0x2107b4[_0x2c58('0x2e')][_0x2c58('0x39')]){_0x5f39d4['where']=_[_0x2c58('0x3a')](_0x5f39d4[_0x2c58('0x38')],{'$or':_['map'](_0x5f39d4[_0x2c58('0x34')],function(_0x20c6a6){var _0x4837bf={};_0x4837bf[_0x20c6a6]={'$like':'%'+_0x2107b4[_0x2c58('0x2e')]['filter']+'%'};return _0x4837bf;})});}_0x5f39d4=_['merge']({},_0x5f39d4,_0x2107b4[_0x2c58('0x3c')]);return _0x362f8e[_0x2c58('0x46')](_0x5f39d4);}})[_0x2c58('0x23')](function(_0x51452e){if(_0x51452e){_0x256539=_0x51452e[_0x2c58('0x35')];if(!_0x2107b4[_0x2c58('0x2e')][_0x2c58('0x4a')](_0x2c58('0x36'))){_0x5f39d4[_0x2c58('0x1c')]=qs[_0x2c58('0x1c')](_0x2107b4[_0x2c58('0x2e')][_0x2c58('0x1c')]);_0x5f39d4['offset']=qs[_0x2c58('0x1a')](_0x2107b4['query'][_0x2c58('0x1a')]);}return _0x362f8e[_0x2c58('0x46')](_0x5f39d4);}})['then'](function(_0x3ea671){if(_0x3ea671){return _0x3ea671?{'count':_0x256539,'rows':_0x3ea671}:null;}})[_0x2c58('0x23')](respondWithResult(_0x263e11,null))[_0x2c58('0x40')](handleError(_0x263e11,null));};exports[_0x2c58('0x4b')]=function(_0x1b4569,_0x129368,_0x3f0f4b){var _0xa83fab={};var _0x2298cd={};var _0x1cbaf8;var _0x47c830;return db[_0x2c58('0x2a')]['findOne']({'where':{'id':_0x1b4569[_0x2c58('0x45')]['id']}})[_0x2c58('0x23')](handleEntityNotFound(_0x129368,null))['then'](function(_0x290ddf){if(_0x290ddf){_0x1cbaf8=_0x290ddf;_0x2298cd[_0x2c58('0x32')]=_[_0x2c58('0x2f')](db[_0x2c58('0x4c')][_0x2c58('0x2b')]);_0x2298cd[_0x2c58('0x2e')]=_[_0x2c58('0x2f')](_0x1b4569[_0x2c58('0x2e')]);_0x2298cd['filters']=_[_0x2c58('0x31')](_0x2298cd[_0x2c58('0x32')],_0x2298cd[_0x2c58('0x2e')]);_0xa83fab['attributes']=_['intersection'](_0x2298cd[_0x2c58('0x32')],qs[_0x2c58('0x33')](_0x1b4569[_0x2c58('0x2e')][_0x2c58('0x33')]));_0xa83fab[_0x2c58('0x34')]=_0xa83fab['attributes'][_0x2c58('0x35')]?_0xa83fab[_0x2c58('0x34')]:_0x2298cd[_0x2c58('0x32')];_0xa83fab[_0x2c58('0x48')]=qs[_0x2c58('0x37')](_0x1b4569['query'][_0x2c58('0x37')]);_0xa83fab[_0x2c58('0x38')]=qs['filters'](_[_0x2c58('0x49')](_0x1b4569[_0x2c58('0x2e')],_0x2298cd[_0x2c58('0x30')]));if(_0x1b4569[_0x2c58('0x2e')][_0x2c58('0x39')]){_0xa83fab[_0x2c58('0x38')]=_[_0x2c58('0x3a')](_0xa83fab['where'],{'$or':_[_0x2c58('0x29')](_0xa83fab[_0x2c58('0x34')],function(_0x351e3b){var _0x3cc1df={};_0x3cc1df[_0x351e3b]={'$like':'%'+_0x1b4569[_0x2c58('0x2e')][_0x2c58('0x39')]+'%'};return _0x3cc1df;})});}_0xa83fab=_[_0x2c58('0x3a')]({},_0xa83fab,_0x1b4569[_0x2c58('0x3c')]);return _0x1cbaf8['getSubjects'](_0xa83fab);}})[_0x2c58('0x23')](function(_0x7866da){if(_0x7866da){_0x47c830=_0x7866da[_0x2c58('0x35')];if(!_0x1b4569['query'][_0x2c58('0x4a')](_0x2c58('0x36'))){_0xa83fab[_0x2c58('0x1c')]=qs[_0x2c58('0x1c')](_0x1b4569[_0x2c58('0x2e')][_0x2c58('0x1c')]);_0xa83fab['offset']=qs['offset'](_0x1b4569[_0x2c58('0x2e')]['offset']);}return _0x1cbaf8['getSubjects'](_0xa83fab);}})[_0x2c58('0x23')](function(_0x33d842){if(_0x33d842){return _0x33d842?{'count':_0x47c830,'rows':_0x33d842}:null;}})[_0x2c58('0x23')](respondWithResult(_0x129368,null))[_0x2c58('0x40')](handleError(_0x129368,null));};exports[_0x2c58('0x4d')]=function(_0x31986e,_0x490ce4,_0x5898a3){var _0x4d0279={};var _0x437b53={};var _0x5013b4;var _0x2d96f3;return db[_0x2c58('0x2a')][_0x2c58('0x47')]({'where':{'id':_0x31986e[_0x2c58('0x45')]['id']}})[_0x2c58('0x23')](handleEntityNotFound(_0x490ce4,null))['then'](function(_0x554c7c){if(_0x554c7c){_0x5013b4=_0x554c7c;_0x437b53[_0x2c58('0x32')]=_[_0x2c58('0x2f')](db['Dynamics365Field'][_0x2c58('0x2b')]);_0x437b53[_0x2c58('0x2e')]=_[_0x2c58('0x2f')](_0x31986e[_0x2c58('0x2e')]);_0x437b53[_0x2c58('0x30')]=_[_0x2c58('0x31')](_0x437b53['model'],_0x437b53[_0x2c58('0x2e')]);_0x4d0279[_0x2c58('0x34')]=_[_0x2c58('0x31')](_0x437b53[_0x2c58('0x32')],qs[_0x2c58('0x33')](_0x31986e[_0x2c58('0x2e')][_0x2c58('0x33')]));_0x4d0279['attributes']=_0x4d0279[_0x2c58('0x34')]['length']?_0x4d0279['attributes']:_0x437b53['model'];_0x4d0279[_0x2c58('0x48')]=qs[_0x2c58('0x37')](_0x31986e[_0x2c58('0x2e')][_0x2c58('0x37')]);_0x4d0279[_0x2c58('0x38')]=qs[_0x2c58('0x30')](_[_0x2c58('0x49')](_0x31986e['query'],_0x437b53['filters']));if(_0x31986e['query'][_0x2c58('0x39')]){_0x4d0279[_0x2c58('0x38')]=_[_0x2c58('0x3a')](_0x4d0279[_0x2c58('0x38')],{'$or':_[_0x2c58('0x29')](_0x4d0279['attributes'],function(_0x483c10){var _0x3d63dc={};_0x3d63dc[_0x483c10]={'$like':'%'+_0x31986e[_0x2c58('0x2e')][_0x2c58('0x39')]+'%'};return _0x3d63dc;})});}_0x4d0279=_[_0x2c58('0x3a')]({},_0x4d0279,_0x31986e['options']);return _0x5013b4[_0x2c58('0x4d')](_0x4d0279);}})[_0x2c58('0x23')](function(_0x4a3ac2){if(_0x4a3ac2){_0x2d96f3=_0x4a3ac2[_0x2c58('0x35')];if(!_0x31986e[_0x2c58('0x2e')]['hasOwnProperty'](_0x2c58('0x36'))){_0x4d0279[_0x2c58('0x1c')]=qs[_0x2c58('0x1c')](_0x31986e[_0x2c58('0x2e')][_0x2c58('0x1c')]);_0x4d0279[_0x2c58('0x1a')]=qs[_0x2c58('0x1a')](_0x31986e[_0x2c58('0x2e')][_0x2c58('0x1a')]);}return _0x5013b4[_0x2c58('0x4d')](_0x4d0279);}})[_0x2c58('0x23')](function(_0x1d3cde){if(_0x1d3cde){return _0x1d3cde?{'count':_0x2d96f3,'rows':_0x1d3cde}:null;}})[_0x2c58('0x23')](respondWithResult(_0x490ce4,null))[_0x2c58('0x40')](handleError(_0x490ce4,null));}; \ No newline at end of file +var _0x8f0e=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','Dynamics365Configuration','type','key','model','query','keys','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','filters','include','find','create','body','getFields','findOne','Dynamics365Field','length','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set'];(function(_0x1341a6,_0x23816a){var _0x37658e=function(_0xbe0a4d){while(--_0xbe0a4d){_0x1341a6['push'](_0x1341a6['shift']());}};_0x37658e(++_0x23816a);}(_0x8f0e,0x118));var _0xe8f0=function(_0x485255,_0x4c782b){_0x485255=_0x485255-0x0;var _0x5b84b4=_0x8f0e[_0x485255];return _0x5b84b4;};'use strict';var emlformat=require(_0xe8f0('0x0'));var rimraf=require(_0xe8f0('0x1'));var zipdir=require(_0xe8f0('0x2'));var jsonpatch=require(_0xe8f0('0x3'));var rp=require('request-promise');var moment=require(_0xe8f0('0x4'));var BPromise=require(_0xe8f0('0x5'));var Mustache=require('mustache');var util=require(_0xe8f0('0x6'));var path=require('path');var sox=require(_0xe8f0('0x7'));var csv=require(_0xe8f0('0x8'));var ejs=require(_0xe8f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe8f0('0xa'));var crypto=require('crypto');var jsforce=require(_0xe8f0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8f0('0xc'));var Papa=require('papaparse');var Redis=require(_0xe8f0('0xd'));var authService=require(_0xe8f0('0xe'));var qs=require(_0xe8f0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8f0('0x10'));var logger=require(_0xe8f0('0x11'))(_0xe8f0('0x12'));var utils=require(_0xe8f0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe8f0('0x14'));var db=require(_0xe8f0('0x15'))['db'];function respondWithStatusCode(_0x2bc05f,_0x2b16bb){_0x2b16bb=_0x2b16bb||0xcc;return function(_0x155227){if(_0x155227){return _0x2bc05f['sendStatus'](_0x2b16bb);}return _0x2bc05f[_0xe8f0('0x16')](_0x2b16bb)['end']();};}function respondWithResult(_0x4e9327,_0x2e1136){_0x2e1136=_0x2e1136||0xc8;return function(_0x24e023){if(_0x24e023){return _0x4e9327[_0xe8f0('0x16')](_0x2e1136)[_0xe8f0('0x17')](_0x24e023);}};}function respondWithFilteredResult(_0x504a95,_0x494029){return function(_0x32032d){if(_0x32032d){var _0x405d69=typeof _0x494029[_0xe8f0('0x18')]===_0xe8f0('0x19')&&typeof _0x494029['limit']===_0xe8f0('0x19');var _0x46a51d=_0x32032d[_0xe8f0('0x1a')];var _0x395525=_0x405d69?0x0:_0x494029[_0xe8f0('0x18')];var _0x411c48=_0x405d69?_0x32032d[_0xe8f0('0x1a')]:_0x494029[_0xe8f0('0x18')]+_0x494029['limit'];var _0x30087f;if(_0x411c48>=_0x46a51d){_0x411c48=_0x46a51d;_0x30087f=0xc8;}else{_0x30087f=0xce;}_0x504a95[_0xe8f0('0x16')](_0x30087f);return _0x504a95[_0xe8f0('0x1b')](_0xe8f0('0x1c'),_0x395525+'-'+_0x411c48+'/'+_0x46a51d)[_0xe8f0('0x17')](_0x32032d);}return null;};}function patchUpdates(_0x56c51f){return function(_0x3ee3aa){try{jsonpatch[_0xe8f0('0x1d')](_0x3ee3aa,_0x56c51f,!![]);}catch(_0x2dd50d){return BPromise[_0xe8f0('0x1e')](_0x2dd50d);}return _0x3ee3aa[_0xe8f0('0x1f')]();};}function saveUpdates(_0x1fba9b,_0x2e4be4){return function(_0x3d0a22){if(_0x3d0a22){return _0x3d0a22[_0xe8f0('0x20')](_0x1fba9b)[_0xe8f0('0x21')](function(_0x41365e){return _0x41365e;});}return null;};}function removeEntity(_0x937086,_0x374bd4){return function(_0x540bd1){if(_0x540bd1){return _0x540bd1[_0xe8f0('0x22')]()['then'](function(){_0x937086['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2791b9,_0x3a6bc4){return function(_0x56e214){if(!_0x56e214){_0x2791b9[_0xe8f0('0x23')](0x194);}return _0x56e214;};}function handleError(_0x4f16ff,_0x1d9f52){_0x1d9f52=_0x1d9f52||0x1f4;return function(_0x31e382){logger[_0xe8f0('0x24')](_0x31e382['stack']);if(_0x31e382[_0xe8f0('0x25')]){delete _0x31e382[_0xe8f0('0x25')];}_0x4f16ff[_0xe8f0('0x16')](_0x1d9f52)[_0xe8f0('0x26')](_0x31e382);};}exports[_0xe8f0('0x27')]=function(_0x3fca1e,_0x3e06dd){var _0x82cf70={},_0x45aea5={},_0x50f1ac={'count':0x0,'rows':[]};var _0x48f761=_[_0xe8f0('0x28')](db[_0xe8f0('0x29')]['rawAttributes'],function(_0x4f816f){return{'name':_0x4f816f['fieldName'],'type':_0x4f816f[_0xe8f0('0x2a')][_0xe8f0('0x2b')]};});_0x45aea5[_0xe8f0('0x2c')]=_[_0xe8f0('0x28')](_0x48f761,'name');_0x45aea5[_0xe8f0('0x2d')]=_[_0xe8f0('0x2e')](_0x3fca1e[_0xe8f0('0x2d')]);_0x45aea5['filters']=_[_0xe8f0('0x2f')](_0x45aea5[_0xe8f0('0x2c')],_0x45aea5[_0xe8f0('0x2d')]);_0x82cf70['attributes']=_['intersection'](_0x45aea5[_0xe8f0('0x2c')],qs['fields'](_0x3fca1e[_0xe8f0('0x2d')][_0xe8f0('0x30')]));_0x82cf70[_0xe8f0('0x31')]=_0x82cf70['attributes']['length']?_0x82cf70[_0xe8f0('0x31')]:_0x45aea5['model'];if(!_0x3fca1e['query']['hasOwnProperty'](_0xe8f0('0x32'))){_0x82cf70['limit']=qs[_0xe8f0('0x33')](_0x3fca1e['query'][_0xe8f0('0x33')]);_0x82cf70[_0xe8f0('0x18')]=qs[_0xe8f0('0x18')](_0x3fca1e[_0xe8f0('0x2d')][_0xe8f0('0x18')]);}_0x82cf70[_0xe8f0('0x34')]=qs[_0xe8f0('0x35')](_0x3fca1e['query'][_0xe8f0('0x35')]);_0x82cf70[_0xe8f0('0x36')]=qs['filters'](_[_0xe8f0('0x37')](_0x3fca1e['query'],_0x45aea5['filters']),_0x48f761);if(_0x3fca1e[_0xe8f0('0x2d')][_0xe8f0('0x38')]){_0x82cf70[_0xe8f0('0x36')]=_[_0xe8f0('0x39')](_0x82cf70[_0xe8f0('0x36')],{'$or':_['map'](_0x48f761,function(_0x3044b4){if(_0x3044b4['type']!=='VIRTUAL'){var _0x17874a={};_0x17874a[_0x3044b4[_0xe8f0('0x25')]]={'$like':'%'+_0x3fca1e[_0xe8f0('0x2d')][_0xe8f0('0x38')]+'%'};return _0x17874a;}})});}_0x82cf70=_['merge']({},_0x82cf70,_0x3fca1e[_0xe8f0('0x3a')]);var _0x37b951={'where':_0x82cf70[_0xe8f0('0x36')]};return db['Dynamics365Configuration']['count'](_0x37b951)[_0xe8f0('0x21')](function(_0x49218a){_0x50f1ac['count']=_0x49218a;if(_0x3fca1e[_0xe8f0('0x2d')][_0xe8f0('0x3b')]){_0x82cf70['include']=[{'all':!![]}];}return db[_0xe8f0('0x29')][_0xe8f0('0x3c')](_0x82cf70);})['then'](function(_0x5ae8a1){_0x50f1ac['rows']=_0x5ae8a1;return _0x50f1ac;})[_0xe8f0('0x21')](respondWithFilteredResult(_0x3e06dd,_0x82cf70))[_0xe8f0('0x3d')](handleError(_0x3e06dd,null));};exports[_0xe8f0('0x3e')]=function(_0x3344fb,_0x435936){var _0x3c3a49={'raw':![],'where':{'id':_0x3344fb[_0xe8f0('0x3f')]['id']}},_0x36edd5={};_0x36edd5['model']=_['keys'](db[_0xe8f0('0x29')][_0xe8f0('0x40')]);_0x36edd5[_0xe8f0('0x2d')]=_[_0xe8f0('0x2e')](_0x3344fb[_0xe8f0('0x2d')]);_0x36edd5[_0xe8f0('0x41')]=_[_0xe8f0('0x2f')](_0x36edd5[_0xe8f0('0x2c')],_0x36edd5[_0xe8f0('0x2d')]);_0x3c3a49[_0xe8f0('0x31')]=_[_0xe8f0('0x2f')](_0x36edd5['model'],qs[_0xe8f0('0x30')](_0x3344fb[_0xe8f0('0x2d')][_0xe8f0('0x30')]));_0x3c3a49[_0xe8f0('0x31')]=_0x3c3a49[_0xe8f0('0x31')]['length']?_0x3c3a49[_0xe8f0('0x31')]:_0x36edd5[_0xe8f0('0x2c')];if(_0x3344fb[_0xe8f0('0x2d')][_0xe8f0('0x3b')]){_0x3c3a49[_0xe8f0('0x42')]=[{'all':!![]}];}_0x3c3a49=_['merge']({},_0x3c3a49,_0x3344fb[_0xe8f0('0x3a')]);return db[_0xe8f0('0x29')][_0xe8f0('0x43')](_0x3c3a49)[_0xe8f0('0x21')](handleEntityNotFound(_0x435936,null))[_0xe8f0('0x21')](respondWithResult(_0x435936,null))[_0xe8f0('0x3d')](handleError(_0x435936,null));};exports['create']=function(_0x526691,_0x258833){return db['Dynamics365Configuration'][_0xe8f0('0x44')](_0x526691[_0xe8f0('0x45')],{})[_0xe8f0('0x21')](respondWithResult(_0x258833,0xc9))[_0xe8f0('0x3d')](handleError(_0x258833,null));};exports[_0xe8f0('0x20')]=function(_0x527c4d,_0xd15f5){if(_0x527c4d[_0xe8f0('0x45')]['id']){delete _0x527c4d[_0xe8f0('0x45')]['id'];}return db[_0xe8f0('0x29')][_0xe8f0('0x43')]({'where':{'id':_0x527c4d[_0xe8f0('0x3f')]['id']}})[_0xe8f0('0x21')](handleEntityNotFound(_0xd15f5,null))[_0xe8f0('0x21')](saveUpdates(_0x527c4d[_0xe8f0('0x45')],null))[_0xe8f0('0x21')](respondWithResult(_0xd15f5,null))[_0xe8f0('0x3d')](handleError(_0xd15f5,null));};exports['destroy']=function(_0x28e055,_0x41046f){return db[_0xe8f0('0x29')][_0xe8f0('0x43')]({'where':{'id':_0x28e055[_0xe8f0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41046f,null))[_0xe8f0('0x21')](removeEntity(_0x41046f,null))[_0xe8f0('0x3d')](handleError(_0x41046f,null));};exports[_0xe8f0('0x46')]=function(_0x144a6b,_0x4c6629,_0x1c93ef){var _0x3af676={};var _0x56a9e6={};var _0x2e9493;var _0x2ef01d;return db[_0xe8f0('0x29')][_0xe8f0('0x47')]({'where':{'id':_0x144a6b[_0xe8f0('0x3f')]['id']}})[_0xe8f0('0x21')](handleEntityNotFound(_0x4c6629,null))[_0xe8f0('0x21')](function(_0x2293d3){if(_0x2293d3){_0x2e9493=_0x2293d3;_0x56a9e6[_0xe8f0('0x2c')]=_[_0xe8f0('0x2e')](db[_0xe8f0('0x48')][_0xe8f0('0x40')]);_0x56a9e6[_0xe8f0('0x2d')]=_[_0xe8f0('0x2e')](_0x144a6b[_0xe8f0('0x2d')]);_0x56a9e6[_0xe8f0('0x41')]=_['intersection'](_0x56a9e6[_0xe8f0('0x2c')],_0x56a9e6['query']);_0x3af676['attributes']=_[_0xe8f0('0x2f')](_0x56a9e6[_0xe8f0('0x2c')],qs[_0xe8f0('0x30')](_0x144a6b[_0xe8f0('0x2d')][_0xe8f0('0x30')]));_0x3af676[_0xe8f0('0x31')]=_0x3af676['attributes'][_0xe8f0('0x49')]?_0x3af676[_0xe8f0('0x31')]:_0x56a9e6[_0xe8f0('0x2c')];_0x3af676[_0xe8f0('0x34')]=qs[_0xe8f0('0x35')](_0x144a6b[_0xe8f0('0x2d')][_0xe8f0('0x35')]);_0x3af676[_0xe8f0('0x36')]=qs[_0xe8f0('0x41')](_[_0xe8f0('0x37')](_0x144a6b[_0xe8f0('0x2d')],_0x56a9e6[_0xe8f0('0x41')]));if(_0x144a6b[_0xe8f0('0x2d')][_0xe8f0('0x38')]){_0x3af676[_0xe8f0('0x36')]=_[_0xe8f0('0x39')](_0x3af676[_0xe8f0('0x36')],{'$or':_[_0xe8f0('0x28')](_0x3af676[_0xe8f0('0x31')],function(_0x269014){var _0x3d0001={};_0x3d0001[_0x269014]={'$like':'%'+_0x144a6b['query'][_0xe8f0('0x38')]+'%'};return _0x3d0001;})});}_0x3af676=_['merge']({},_0x3af676,_0x144a6b[_0xe8f0('0x3a')]);return _0x2e9493[_0xe8f0('0x46')](_0x3af676);}})['then'](function(_0x5d40e8){if(_0x5d40e8){_0x2ef01d=_0x5d40e8[_0xe8f0('0x49')];if(!_0x144a6b[_0xe8f0('0x2d')][_0xe8f0('0x4a')](_0xe8f0('0x32'))){_0x3af676[_0xe8f0('0x33')]=qs[_0xe8f0('0x33')](_0x144a6b['query'][_0xe8f0('0x33')]);_0x3af676[_0xe8f0('0x18')]=qs[_0xe8f0('0x18')](_0x144a6b[_0xe8f0('0x2d')][_0xe8f0('0x18')]);}return _0x2e9493['getFields'](_0x3af676);}})[_0xe8f0('0x21')](function(_0x5bd180){if(_0x5bd180){return _0x5bd180?{'count':_0x2ef01d,'rows':_0x5bd180}:null;}})['then'](respondWithResult(_0x4c6629,null))[_0xe8f0('0x3d')](handleError(_0x4c6629,null));};exports[_0xe8f0('0x4b')]=function(_0x5b44aa,_0x282e72,_0x1647c0){var _0x364da9={};var _0x50e78d={};var _0x11c244;var _0x50e39b;return db[_0xe8f0('0x29')][_0xe8f0('0x47')]({'where':{'id':_0x5b44aa[_0xe8f0('0x3f')]['id']}})[_0xe8f0('0x21')](handleEntityNotFound(_0x282e72,null))[_0xe8f0('0x21')](function(_0x447bb2){if(_0x447bb2){_0x11c244=_0x447bb2;_0x50e78d['model']=_[_0xe8f0('0x2e')](db[_0xe8f0('0x48')][_0xe8f0('0x40')]);_0x50e78d[_0xe8f0('0x2d')]=_['keys'](_0x5b44aa[_0xe8f0('0x2d')]);_0x50e78d[_0xe8f0('0x41')]=_[_0xe8f0('0x2f')](_0x50e78d['model'],_0x50e78d[_0xe8f0('0x2d')]);_0x364da9[_0xe8f0('0x31')]=_[_0xe8f0('0x2f')](_0x50e78d[_0xe8f0('0x2c')],qs[_0xe8f0('0x30')](_0x5b44aa[_0xe8f0('0x2d')][_0xe8f0('0x30')]));_0x364da9[_0xe8f0('0x31')]=_0x364da9[_0xe8f0('0x31')][_0xe8f0('0x49')]?_0x364da9[_0xe8f0('0x31')]:_0x50e78d[_0xe8f0('0x2c')];_0x364da9[_0xe8f0('0x34')]=qs[_0xe8f0('0x35')](_0x5b44aa[_0xe8f0('0x2d')][_0xe8f0('0x35')]);_0x364da9[_0xe8f0('0x36')]=qs[_0xe8f0('0x41')](_['pick'](_0x5b44aa[_0xe8f0('0x2d')],_0x50e78d[_0xe8f0('0x41')]));if(_0x5b44aa['query'][_0xe8f0('0x38')]){_0x364da9['where']=_[_0xe8f0('0x39')](_0x364da9['where'],{'$or':_['map'](_0x364da9[_0xe8f0('0x31')],function(_0x1cfffe){var _0x53af8b={};_0x53af8b[_0x1cfffe]={'$like':'%'+_0x5b44aa[_0xe8f0('0x2d')][_0xe8f0('0x38')]+'%'};return _0x53af8b;})});}_0x364da9=_['merge']({},_0x364da9,_0x5b44aa[_0xe8f0('0x3a')]);return _0x11c244[_0xe8f0('0x4b')](_0x364da9);}})[_0xe8f0('0x21')](function(_0x6924f1){if(_0x6924f1){_0x50e39b=_0x6924f1[_0xe8f0('0x49')];if(!_0x5b44aa[_0xe8f0('0x2d')]['hasOwnProperty'](_0xe8f0('0x32'))){_0x364da9['limit']=qs[_0xe8f0('0x33')](_0x5b44aa['query'][_0xe8f0('0x33')]);_0x364da9[_0xe8f0('0x18')]=qs[_0xe8f0('0x18')](_0x5b44aa[_0xe8f0('0x2d')]['offset']);}return _0x11c244[_0xe8f0('0x4b')](_0x364da9);}})[_0xe8f0('0x21')](function(_0x8fe4b9){if(_0x8fe4b9){return _0x8fe4b9?{'count':_0x50e39b,'rows':_0x8fe4b9}:null;}})[_0xe8f0('0x21')](respondWithResult(_0x282e72,null))[_0xe8f0('0x3d')](handleError(_0x282e72,null));};exports[_0xe8f0('0x4c')]=function(_0xd1dea0,_0x53e5d8,_0x1a58b0){var _0x46f005={};var _0xd1d374={};var _0x23413d;var _0xd7716b;return db['Dynamics365Configuration'][_0xe8f0('0x47')]({'where':{'id':_0xd1dea0[_0xe8f0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x53e5d8,null))[_0xe8f0('0x21')](function(_0x48dca9){if(_0x48dca9){_0x23413d=_0x48dca9;_0xd1d374[_0xe8f0('0x2c')]=_[_0xe8f0('0x2e')](db[_0xe8f0('0x48')][_0xe8f0('0x40')]);_0xd1d374[_0xe8f0('0x2d')]=_[_0xe8f0('0x2e')](_0xd1dea0['query']);_0xd1d374[_0xe8f0('0x41')]=_[_0xe8f0('0x2f')](_0xd1d374[_0xe8f0('0x2c')],_0xd1d374[_0xe8f0('0x2d')]);_0x46f005[_0xe8f0('0x31')]=_[_0xe8f0('0x2f')](_0xd1d374[_0xe8f0('0x2c')],qs[_0xe8f0('0x30')](_0xd1dea0[_0xe8f0('0x2d')][_0xe8f0('0x30')]));_0x46f005['attributes']=_0x46f005[_0xe8f0('0x31')][_0xe8f0('0x49')]?_0x46f005[_0xe8f0('0x31')]:_0xd1d374['model'];_0x46f005[_0xe8f0('0x34')]=qs[_0xe8f0('0x35')](_0xd1dea0['query'][_0xe8f0('0x35')]);_0x46f005[_0xe8f0('0x36')]=qs[_0xe8f0('0x41')](_['pick'](_0xd1dea0[_0xe8f0('0x2d')],_0xd1d374[_0xe8f0('0x41')]));if(_0xd1dea0[_0xe8f0('0x2d')][_0xe8f0('0x38')]){_0x46f005[_0xe8f0('0x36')]=_['merge'](_0x46f005['where'],{'$or':_['map'](_0x46f005[_0xe8f0('0x31')],function(_0x41faca){var _0x2ef2d0={};_0x2ef2d0[_0x41faca]={'$like':'%'+_0xd1dea0[_0xe8f0('0x2d')][_0xe8f0('0x38')]+'%'};return _0x2ef2d0;})});}_0x46f005=_['merge']({},_0x46f005,_0xd1dea0[_0xe8f0('0x3a')]);return _0x23413d['getDescriptions'](_0x46f005);}})[_0xe8f0('0x21')](function(_0x76fdf8){if(_0x76fdf8){_0xd7716b=_0x76fdf8[_0xe8f0('0x49')];if(!_0xd1dea0[_0xe8f0('0x2d')][_0xe8f0('0x4a')](_0xe8f0('0x32'))){_0x46f005[_0xe8f0('0x33')]=qs[_0xe8f0('0x33')](_0xd1dea0['query'][_0xe8f0('0x33')]);_0x46f005[_0xe8f0('0x18')]=qs[_0xe8f0('0x18')](_0xd1dea0[_0xe8f0('0x2d')][_0xe8f0('0x18')]);}return _0x23413d[_0xe8f0('0x4c')](_0x46f005);}})[_0xe8f0('0x21')](function(_0x48c107){if(_0x48c107){return _0x48c107?{'count':_0xd7716b,'rows':_0x48c107}:null;}})[_0xe8f0('0x21')](respondWithResult(_0x53e5d8,null))['catch'](handleError(_0x53e5d8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9e3f172..452943a 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 _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x582476,_0x3c521f){var _0x1794dd=function(_0x42897c){while(--_0x42897c){_0x582476['push'](_0x582476['shift']());}};_0x1794dd(++_0x3c521f);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1b7de8,_0x3425ab){_0x1b7de8=_0x1b7de8-0x0;var _0x348168=_0xd6d6[_0x1b7de8];return _0x348168;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19697a,_0x57e223){var _0x5a4ca5=function(_0x378bb5){while(--_0x378bb5){_0x19697a['push'](_0x19697a['shift']());}};_0x5a4ca5(++_0x57e223);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3c42ff,_0x45ee1f){_0x3c42ff=_0x3c42ff-0x0;var _0x4c0f6d=_0xf3cd[_0x3c42ff];return _0x4c0f6d;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'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 96079e9..87464c0 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 _0x0fcb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','catch','lodash','moment'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x0fcb,0xe4));var _0xb0fc=function(_0x768559,_0x573ffa){_0x768559=_0x768559-0x0;var _0x18d849=_0x0fcb[_0x768559];return _0x18d849;};'use strict';var _=require(_0xb0fc('0x0'));var util=require('util');var moment=require(_0xb0fc('0x1'));var BPromise=require(_0xb0fc('0x2'));var rs=require(_0xb0fc('0x3'));var fs=require('fs');var Redis=require(_0xb0fc('0x4'));var db=require(_0xb0fc('0x5'))['db'];var utils=require(_0xb0fc('0x6'));var logger=require(_0xb0fc('0x7'))(_0xb0fc('0x8'));var config=require(_0xb0fc('0x9'));var jayson=require(_0xb0fc('0xa'));var client=jayson[_0xb0fc('0xb')][_0xb0fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18d8ba,_0x15452f,_0x427bef){return new BPromise(function(_0x3c7615,_0x1832bf){return client['request'](_0x18d8ba,_0x427bef)[_0xb0fc('0xd')](function(_0x514101){logger[_0xb0fc('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x15452f,'request\x20sent');logger[_0xb0fc('0xf')](_0xb0fc('0x10'),_0x15452f,'request\x20sent',JSON['stringify'](_0x514101));if(_0x514101[_0xb0fc('0x11')]){if(_0x514101[_0xb0fc('0x11')][_0xb0fc('0x12')]===0x1f4){logger[_0xb0fc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x15452f,_0x514101[_0xb0fc('0x11')][_0xb0fc('0x13')]);return _0x1832bf(_0x514101[_0xb0fc('0x11')]['message']);}logger[_0xb0fc('0x11')](_0xb0fc('0x14'),_0x15452f,_0x514101[_0xb0fc('0x11')][_0xb0fc('0x13')]);return _0x3c7615(_0x514101[_0xb0fc('0x11')][_0xb0fc('0x13')]);}else{logger[_0xb0fc('0xe')](_0xb0fc('0x14'),_0x15452f,_0xb0fc('0x15'));_0x3c7615(_0x514101['result'][_0xb0fc('0x13')]);}})[_0xb0fc('0x16')](function(_0x3e83e9){logger['error'](_0xb0fc('0x14'),_0x15452f,_0x3e83e9);_0x1832bf(_0x3e83e9);});});} \ No newline at end of file +var _0x6233=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x31204d,_0x565509){var _0x1830e9=function(_0x5b5376){while(--_0x5b5376){_0x31204d['push'](_0x31204d['shift']());}};_0x1830e9(++_0x565509);}(_0x6233,0x112));var _0x3623=function(_0x321b59,_0x629e28){_0x321b59=_0x321b59-0x0;var _0x437086=_0x6233[_0x321b59];return _0x437086;};'use strict';var _=require(_0x3623('0x0'));var util=require(_0x3623('0x1'));var moment=require('moment');var BPromise=require(_0x3623('0x2'));var rs=require(_0x3623('0x3'));var fs=require('fs');var Redis=require(_0x3623('0x4'));var db=require(_0x3623('0x5'))['db'];var utils=require(_0x3623('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3623('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3623('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53e08c,_0x5890e5,_0x362011){return new BPromise(function(_0x1acd03,_0x92ac68){return client[_0x3623('0x9')](_0x53e08c,_0x362011)['then'](function(_0x5e0f6f){logger[_0x3623('0xa')](_0x3623('0xb'),_0x5890e5,_0x3623('0xc'));logger[_0x3623('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5890e5,'request\x20sent',JSON['stringify'](_0x5e0f6f));if(_0x5e0f6f[_0x3623('0xe')]){if(_0x5e0f6f[_0x3623('0xe')]['code']===0x1f4){logger[_0x3623('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5890e5,_0x5e0f6f[_0x3623('0xe')][_0x3623('0xf')]);return _0x92ac68(_0x5e0f6f[_0x3623('0xe')]['message']);}logger[_0x3623('0xe')](_0x3623('0xb'),_0x5890e5,_0x5e0f6f['error'][_0x3623('0xf')]);return _0x1acd03(_0x5e0f6f[_0x3623('0xe')]['message']);}else{logger[_0x3623('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5890e5,_0x3623('0xc'));_0x1acd03(_0x5e0f6f['result'][_0x3623('0xf')]);}})[_0x3623('0x10')](function(_0x319a53){logger[_0x3623('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5890e5,_0x319a53);_0x92ac68(_0x319a53);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 269aa1a..a4cca38 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 _0xe568=['util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0xf47bf,_0x2554ea){var _0x4e998f=function(_0x19d270){while(--_0x19d270){_0xf47bf['push'](_0xf47bf['shift']());}};_0x4e998f(++_0x2554ea);}(_0xe568,0xff));var _0x8e56=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xe568[_0x466247];return _0x4b352e;};'use strict';var multer=require('multer');var util=require(_0x8e56('0x0'));var path=require('path');var timeout=require(_0x8e56('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e56('0x2'));var auth=require(_0x8e56('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8e56('0x4'));var controller=require(_0x8e56('0x5'));router[_0x8e56('0x6')]('/',auth[_0x8e56('0x7')](),controller[_0x8e56('0x8')]);router['get'](_0x8e56('0x9'),auth[_0x8e56('0x7')](),controller[_0x8e56('0xa')]);router[_0x8e56('0xb')]('/',auth[_0x8e56('0x7')](),controller[_0x8e56('0xc')]);router[_0x8e56('0xd')](_0x8e56('0x9'),auth[_0x8e56('0x7')](),controller[_0x8e56('0xe')]);router['delete']('/:id',auth[_0x8e56('0x7')](),controller[_0x8e56('0xf')]);module[_0x8e56('0x10')]=router; \ No newline at end of file +var _0x3440=['connect-timeout','Router','fs-extra','../../config/environment','./intDynamics365Field.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','util'];(function(_0x38d91b,_0x45a1d6){var _0x1027e0=function(_0xb1b5f5){while(--_0xb1b5f5){_0x38d91b['push'](_0x38d91b['shift']());}};_0x1027e0(++_0x45a1d6);}(_0x3440,0x7c));var _0x0344=function(_0x2f441a,_0x5b836b){_0x2f441a=_0x2f441a-0x0;var _0x5997e6=_0x3440[_0x2f441a];return _0x5997e6;};'use strict';var multer=require(_0x0344('0x0'));var util=require(_0x0344('0x1'));var path=require('path');var timeout=require(_0x0344('0x2'));var express=require('express');var router=express[_0x0344('0x3')]();var fs_extra=require(_0x0344('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0344('0x5'));var controller=require(_0x0344('0x6'));router[_0x0344('0x7')]('/',auth['isAuthenticated'](),controller[_0x0344('0x8')]);router['get'](_0x0344('0x9'),auth['isAuthenticated'](),controller[_0x0344('0xa')]);router[_0x0344('0xb')]('/',auth[_0x0344('0xc')](),controller[_0x0344('0xd')]);router[_0x0344('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0344('0xf')]);router[_0x0344('0x10')](_0x0344('0x9'),auth[_0x0344('0xc')](),controller[_0x0344('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0f02408..32063a5 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 _0x055e=['keyValue','STRING','string','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0x055e,0x68));var _0xe055=function(_0x3bb0e4,_0x596363){_0x3bb0e4=_0x3bb0e4-0x0;var _0x5343a3=_0x055e[_0x3bb0e4];return _0x5343a3;};'use strict';var Sequelize=require(_0xe055('0x0'));module[_0xe055('0x1')]={'type':{'type':Sequelize[_0xe055('0x2')]('string','variable',_0xe055('0x3'),_0xe055('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe055('0x5')]},'key':{'type':Sequelize[_0xe055('0x5')]},'keyType':{'type':Sequelize[_0xe055('0x2')](_0xe055('0x6'),_0xe055('0x7'),_0xe055('0x3'))},'keyContent':{'type':Sequelize[_0xe055('0x5')]},'idField':{'type':Sequelize[_0xe055('0x5')]},'nameField':{'type':Sequelize[_0xe055('0x5')]},'customField':{'type':Sequelize[_0xe055('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e4=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb7e4,0x156));var _0x4b7e=function(_0x42e7f4,_0x1813a6){_0x42e7f4=_0x42e7f4-0x0;var _0x225359=_0xb7e4[_0x42e7f4];return _0x225359;};'use strict';var Sequelize=require(_0x4b7e('0x0'));module[_0x4b7e('0x1')]={'type':{'type':Sequelize[_0x4b7e('0x2')](_0x4b7e('0x3'),_0x4b7e('0x4'),_0x4b7e('0x5'),_0x4b7e('0x6'),'picklist'),'defaultValue':_0x4b7e('0x3')},'content':{'type':Sequelize[_0x4b7e('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4b7e('0x3'),'variable',_0x4b7e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4b7e('0x7')]},'nameField':{'type':Sequelize[_0x4b7e('0x7')]},'customField':{'type':Sequelize[_0x4b7e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b7e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 33000a7..01c20f8 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 _0x6a4a=['offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','Dynamics365Field','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x12286d,_0x149576){var _0xdb15ed=function(_0x3d799b){while(--_0x3d799b){_0x12286d['push'](_0x12286d['shift']());}};_0xdb15ed(++_0x149576);}(_0x6a4a,0x150));var _0xa6a4=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x6a4a[_0x4207f4];return _0x29a621;};'use strict';var emlformat=require(_0xa6a4('0x0'));var rimraf=require(_0xa6a4('0x1'));var zipdir=require(_0xa6a4('0x2'));var jsonpatch=require(_0xa6a4('0x3'));var rp=require(_0xa6a4('0x4'));var moment=require(_0xa6a4('0x5'));var BPromise=require(_0xa6a4('0x6'));var Mustache=require(_0xa6a4('0x7'));var util=require(_0xa6a4('0x8'));var path=require(_0xa6a4('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6a4('0xa'));var _=require('lodash');var squel=require(_0xa6a4('0xb'));var crypto=require('crypto');var jsforce=require(_0xa6a4('0xc'));var deskjs=require(_0xa6a4('0xd'));var toCsv=require(_0xa6a4('0xe'));var querystring=require('querystring');var Papa=require(_0xa6a4('0xf'));var Redis=require('ioredis');var authService=require(_0xa6a4('0x10'));var qs=require(_0xa6a4('0x11'));var as=require(_0xa6a4('0x12'));var hardwareService=require(_0xa6a4('0x13'));var logger=require(_0xa6a4('0x14'))(_0xa6a4('0x15'));var utils=require('../../config/utils');var config=require(_0xa6a4('0x16'));var licenseUtil=require(_0xa6a4('0x17'));var db=require(_0xa6a4('0x18'))['db'];function respondWithStatusCode(_0x296af8,_0x2719e3){_0x2719e3=_0x2719e3||0xcc;return function(_0x17e434){if(_0x17e434){return _0x296af8[_0xa6a4('0x19')](_0x2719e3);}return _0x296af8[_0xa6a4('0x1a')](_0x2719e3)[_0xa6a4('0x1b')]();};}function respondWithResult(_0x5da5ce,_0x54be22){_0x54be22=_0x54be22||0xc8;return function(_0x6ad928){if(_0x6ad928){return _0x5da5ce[_0xa6a4('0x1a')](_0x54be22)[_0xa6a4('0x1c')](_0x6ad928);}};}function respondWithFilteredResult(_0x3a0ded,_0x12ddec){return function(_0x2e8943){if(_0x2e8943){var _0x1dcdd6=typeof _0x12ddec[_0xa6a4('0x1d')]===_0xa6a4('0x1e')&&typeof _0x12ddec[_0xa6a4('0x1f')]===_0xa6a4('0x1e');var _0x92493e=_0x2e8943['count'];var _0x1f3f25=_0x1dcdd6?0x0:_0x12ddec['offset'];var _0x26ca94=_0x1dcdd6?_0x2e8943[_0xa6a4('0x20')]:_0x12ddec[_0xa6a4('0x1d')]+_0x12ddec[_0xa6a4('0x1f')];var _0x597450;if(_0x26ca94>=_0x92493e){_0x26ca94=_0x92493e;_0x597450=0xc8;}else{_0x597450=0xce;}_0x3a0ded[_0xa6a4('0x1a')](_0x597450);return _0x3a0ded[_0xa6a4('0x21')]('Content-Range',_0x1f3f25+'-'+_0x26ca94+'/'+_0x92493e)['json'](_0x2e8943);}return null;};}function patchUpdates(_0x2b4aee){return function(_0x4fd63b){try{jsonpatch[_0xa6a4('0x22')](_0x4fd63b,_0x2b4aee,!![]);}catch(_0x5f563c){return BPromise[_0xa6a4('0x23')](_0x5f563c);}return _0x4fd63b['save']();};}function saveUpdates(_0x4d6f15,_0x3f9b81){return function(_0x1029a5){if(_0x1029a5){return _0x1029a5['update'](_0x4d6f15)[_0xa6a4('0x24')](function(_0x14b39d){return _0x14b39d;});}return null;};}function removeEntity(_0x457c45,_0x275d61){return function(_0x486ae7){if(_0x486ae7){return _0x486ae7[_0xa6a4('0x25')]()[_0xa6a4('0x24')](function(){_0x457c45[_0xa6a4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1887c6,_0x1c91e4){return function(_0x33c437){if(!_0x33c437){_0x1887c6[_0xa6a4('0x19')](0x194);}return _0x33c437;};}function handleError(_0x3a959f,_0xc86caa){_0xc86caa=_0xc86caa||0x1f4;return function(_0x53fa3c){logger[_0xa6a4('0x26')](_0x53fa3c['stack']);if(_0x53fa3c[_0xa6a4('0x27')]){delete _0x53fa3c['name'];}_0x3a959f[_0xa6a4('0x1a')](_0xc86caa)['send'](_0x53fa3c);};}exports['index']=function(_0x287469,_0x518da6){var _0x15bd38={},_0x2bc726={},_0x2e79cc={'count':0x0,'rows':[]};var _0x14b37c=_[_0xa6a4('0x28')](db['Dynamics365Field'][_0xa6a4('0x29')],function(_0x3fd690){return{'name':_0x3fd690[_0xa6a4('0x2a')],'type':_0x3fd690[_0xa6a4('0x2b')]['key']};});_0x2bc726[_0xa6a4('0x2c')]=_['map'](_0x14b37c,_0xa6a4('0x27'));_0x2bc726[_0xa6a4('0x2d')]=_[_0xa6a4('0x2e')](_0x287469[_0xa6a4('0x2d')]);_0x2bc726['filters']=_[_0xa6a4('0x2f')](_0x2bc726[_0xa6a4('0x2c')],_0x2bc726[_0xa6a4('0x2d')]);_0x15bd38['attributes']=_[_0xa6a4('0x2f')](_0x2bc726[_0xa6a4('0x2c')],qs[_0xa6a4('0x30')](_0x287469['query'][_0xa6a4('0x30')]));_0x15bd38[_0xa6a4('0x31')]=_0x15bd38[_0xa6a4('0x31')][_0xa6a4('0x32')]?_0x15bd38['attributes']:_0x2bc726[_0xa6a4('0x2c')];if(!_0x287469[_0xa6a4('0x2d')][_0xa6a4('0x33')](_0xa6a4('0x34'))){_0x15bd38[_0xa6a4('0x1f')]=qs[_0xa6a4('0x1f')](_0x287469[_0xa6a4('0x2d')]['limit']);_0x15bd38[_0xa6a4('0x1d')]=qs[_0xa6a4('0x1d')](_0x287469['query']['offset']);}_0x15bd38[_0xa6a4('0x35')]=qs[_0xa6a4('0x36')](_0x287469['query']['sort']);_0x15bd38['where']=qs[_0xa6a4('0x37')](_[_0xa6a4('0x38')](_0x287469[_0xa6a4('0x2d')],_0x2bc726[_0xa6a4('0x37')]),_0x14b37c);if(_0x287469[_0xa6a4('0x2d')][_0xa6a4('0x39')]){_0x15bd38[_0xa6a4('0x3a')]=_[_0xa6a4('0x3b')](_0x15bd38[_0xa6a4('0x3a')],{'$or':_['map'](_0x14b37c,function(_0x496dd6){if(_0x496dd6[_0xa6a4('0x2b')]!==_0xa6a4('0x3c')){var _0xb5f179={};_0xb5f179[_0x496dd6[_0xa6a4('0x27')]]={'$like':'%'+_0x287469[_0xa6a4('0x2d')]['filter']+'%'};return _0xb5f179;}})});}_0x15bd38=_[_0xa6a4('0x3b')]({},_0x15bd38,_0x287469['options']);var _0x34d9bb={'where':_0x15bd38['where']};return db[_0xa6a4('0x3d')][_0xa6a4('0x20')](_0x34d9bb)['then'](function(_0x4093b0){_0x2e79cc['count']=_0x4093b0;if(_0x287469[_0xa6a4('0x2d')]['includeAll']){_0x15bd38[_0xa6a4('0x3e')]=[{'all':!![]}];}return db[_0xa6a4('0x3d')][_0xa6a4('0x3f')](_0x15bd38);})[_0xa6a4('0x24')](function(_0x36c527){_0x2e79cc[_0xa6a4('0x40')]=_0x36c527;return _0x2e79cc;})[_0xa6a4('0x24')](respondWithFilteredResult(_0x518da6,_0x15bd38))[_0xa6a4('0x41')](handleError(_0x518da6,null));};exports[_0xa6a4('0x42')]=function(_0x5a637d,_0x310b6a){var _0x1afbaa={'raw':!![],'where':{'id':_0x5a637d[_0xa6a4('0x43')]['id']}},_0x4b83d3={};_0x4b83d3[_0xa6a4('0x2c')]=_['keys'](db[_0xa6a4('0x3d')][_0xa6a4('0x29')]);_0x4b83d3['query']=_['keys'](_0x5a637d['query']);_0x4b83d3[_0xa6a4('0x37')]=_[_0xa6a4('0x2f')](_0x4b83d3[_0xa6a4('0x2c')],_0x4b83d3['query']);_0x1afbaa[_0xa6a4('0x31')]=_[_0xa6a4('0x2f')](_0x4b83d3[_0xa6a4('0x2c')],qs[_0xa6a4('0x30')](_0x5a637d['query']['fields']));_0x1afbaa[_0xa6a4('0x31')]=_0x1afbaa[_0xa6a4('0x31')][_0xa6a4('0x32')]?_0x1afbaa[_0xa6a4('0x31')]:_0x4b83d3[_0xa6a4('0x2c')];if(_0x5a637d[_0xa6a4('0x2d')][_0xa6a4('0x44')]){_0x1afbaa['include']=[{'all':!![]}];}_0x1afbaa=_[_0xa6a4('0x3b')]({},_0x1afbaa,_0x5a637d['options']);return db[_0xa6a4('0x3d')][_0xa6a4('0x45')](_0x1afbaa)[_0xa6a4('0x24')](handleEntityNotFound(_0x310b6a,null))[_0xa6a4('0x24')](respondWithResult(_0x310b6a,null))[_0xa6a4('0x41')](handleError(_0x310b6a,null));};exports[_0xa6a4('0x46')]=function(_0x2a6c77,_0x33936){return db[_0xa6a4('0x3d')][_0xa6a4('0x46')](_0x2a6c77[_0xa6a4('0x47')],{})['then'](respondWithResult(_0x33936,0xc9))[_0xa6a4('0x41')](handleError(_0x33936,null));};exports[_0xa6a4('0x48')]=function(_0x80ae9,_0x968ca6){if(_0x80ae9['body']['id']){delete _0x80ae9[_0xa6a4('0x47')]['id'];}return db[_0xa6a4('0x3d')][_0xa6a4('0x45')]({'where':{'id':_0x80ae9[_0xa6a4('0x43')]['id']}})[_0xa6a4('0x24')](handleEntityNotFound(_0x968ca6,null))[_0xa6a4('0x24')](saveUpdates(_0x80ae9[_0xa6a4('0x47')],null))[_0xa6a4('0x24')](respondWithResult(_0x968ca6,null))[_0xa6a4('0x41')](handleError(_0x968ca6,null));};exports[_0xa6a4('0x25')]=function(_0x4e59ee,_0x458ba0){return db['Dynamics365Field'][_0xa6a4('0x45')]({'where':{'id':_0x4e59ee[_0xa6a4('0x43')]['id']}})[_0xa6a4('0x24')](handleEntityNotFound(_0x458ba0,null))['then'](removeEntity(_0x458ba0,null))[_0xa6a4('0x41')](handleError(_0x458ba0,null));}; \ No newline at end of file +var _0xe996=['rawAttributes','options','create','body','find','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','includeAll','include','findAll','catch','show','params'];(function(_0x2e8436,_0x60d207){var _0x41a31a=function(_0x5aa6cf){while(--_0x5aa6cf){_0x2e8436['push'](_0x2e8436['shift']());}};_0x41a31a(++_0x60d207);}(_0xe996,0x172));var _0x6e99=function(_0x15fb94,_0x5bccef){_0x15fb94=_0x15fb94-0x0;var _0x3b66d1=_0xe996[_0x15fb94];return _0x3b66d1;};'use strict';var emlformat=require(_0x6e99('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6e99('0x1'));var rp=require('request-promise');var moment=require(_0x6e99('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6e99('0x3'));var util=require(_0x6e99('0x4'));var path=require(_0x6e99('0x5'));var sox=require(_0x6e99('0x6'));var csv=require(_0x6e99('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e99('0x8'));var squel=require(_0x6e99('0x9'));var crypto=require(_0x6e99('0xa'));var jsforce=require(_0x6e99('0xb'));var deskjs=require(_0x6e99('0xc'));var toCsv=require(_0x6e99('0x7'));var querystring=require('querystring');var Papa=require(_0x6e99('0xd'));var Redis=require(_0x6e99('0xe'));var authService=require(_0x6e99('0xf'));var qs=require(_0x6e99('0x10'));var as=require(_0x6e99('0x11'));var hardwareService=require(_0x6e99('0x12'));var logger=require(_0x6e99('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6e99('0x14'));var licenseUtil=require(_0x6e99('0x15'));var db=require(_0x6e99('0x16'))['db'];function respondWithStatusCode(_0xf288e7,_0x2fc9ca){_0x2fc9ca=_0x2fc9ca||0xcc;return function(_0x2533b9){if(_0x2533b9){return _0xf288e7['sendStatus'](_0x2fc9ca);}return _0xf288e7[_0x6e99('0x17')](_0x2fc9ca)[_0x6e99('0x18')]();};}function respondWithResult(_0x570e32,_0x1174d3){_0x1174d3=_0x1174d3||0xc8;return function(_0x53f971){if(_0x53f971){return _0x570e32[_0x6e99('0x17')](_0x1174d3)[_0x6e99('0x19')](_0x53f971);}};}function respondWithFilteredResult(_0x893d33,_0x403f8a){return function(_0x101f0f){if(_0x101f0f){var _0x44a80b=typeof _0x403f8a[_0x6e99('0x1a')]===_0x6e99('0x1b')&&typeof _0x403f8a[_0x6e99('0x1c')]===_0x6e99('0x1b');var _0x100b06=_0x101f0f[_0x6e99('0x1d')];var _0x49fb33=_0x44a80b?0x0:_0x403f8a[_0x6e99('0x1a')];var _0x4fbf44=_0x44a80b?_0x101f0f['count']:_0x403f8a[_0x6e99('0x1a')]+_0x403f8a[_0x6e99('0x1c')];var _0x1b35d7;if(_0x4fbf44>=_0x100b06){_0x4fbf44=_0x100b06;_0x1b35d7=0xc8;}else{_0x1b35d7=0xce;}_0x893d33[_0x6e99('0x17')](_0x1b35d7);return _0x893d33[_0x6e99('0x1e')](_0x6e99('0x1f'),_0x49fb33+'-'+_0x4fbf44+'/'+_0x100b06)[_0x6e99('0x19')](_0x101f0f);}return null;};}function patchUpdates(_0x30b6f7){return function(_0x46205b){try{jsonpatch[_0x6e99('0x20')](_0x46205b,_0x30b6f7,!![]);}catch(_0xe616d9){return BPromise[_0x6e99('0x21')](_0xe616d9);}return _0x46205b[_0x6e99('0x22')]();};}function saveUpdates(_0x37a354,_0x2f80cc){return function(_0x17472){if(_0x17472){return _0x17472[_0x6e99('0x23')](_0x37a354)[_0x6e99('0x24')](function(_0x317ee8){return _0x317ee8;});}return null;};}function removeEntity(_0x347cd6,_0x363592){return function(_0x20b8bd){if(_0x20b8bd){return _0x20b8bd[_0x6e99('0x25')]()[_0x6e99('0x24')](function(){_0x347cd6['status'](0xcc)[_0x6e99('0x18')]();});}};}function handleEntityNotFound(_0x21090c,_0x1362cd){return function(_0xe3c25a){if(!_0xe3c25a){_0x21090c[_0x6e99('0x26')](0x194);}return _0xe3c25a;};}function handleError(_0xe1bb6d,_0x56d23b){_0x56d23b=_0x56d23b||0x1f4;return function(_0x22ae3d){logger[_0x6e99('0x27')](_0x22ae3d[_0x6e99('0x28')]);if(_0x22ae3d[_0x6e99('0x29')]){delete _0x22ae3d[_0x6e99('0x29')];}_0xe1bb6d['status'](_0x56d23b)[_0x6e99('0x2a')](_0x22ae3d);};}exports[_0x6e99('0x2b')]=function(_0x51cd3d,_0x2741bd){var _0x98f58b={},_0x35017={},_0x48e308={'count':0x0,'rows':[]};var _0x40ad43=_[_0x6e99('0x2c')](db[_0x6e99('0x2d')]['rawAttributes'],function(_0x294b44){return{'name':_0x294b44[_0x6e99('0x2e')],'type':_0x294b44[_0x6e99('0x2f')]['key']};});_0x35017['model']=_['map'](_0x40ad43,'name');_0x35017[_0x6e99('0x30')]=_[_0x6e99('0x31')](_0x51cd3d[_0x6e99('0x30')]);_0x35017[_0x6e99('0x32')]=_[_0x6e99('0x33')](_0x35017[_0x6e99('0x34')],_0x35017[_0x6e99('0x30')]);_0x98f58b[_0x6e99('0x35')]=_[_0x6e99('0x33')](_0x35017[_0x6e99('0x34')],qs['fields'](_0x51cd3d[_0x6e99('0x30')][_0x6e99('0x36')]));_0x98f58b[_0x6e99('0x35')]=_0x98f58b[_0x6e99('0x35')][_0x6e99('0x37')]?_0x98f58b[_0x6e99('0x35')]:_0x35017[_0x6e99('0x34')];if(!_0x51cd3d[_0x6e99('0x30')][_0x6e99('0x38')](_0x6e99('0x39'))){_0x98f58b[_0x6e99('0x1c')]=qs[_0x6e99('0x1c')](_0x51cd3d['query'][_0x6e99('0x1c')]);_0x98f58b[_0x6e99('0x1a')]=qs[_0x6e99('0x1a')](_0x51cd3d['query'][_0x6e99('0x1a')]);}_0x98f58b['order']=qs[_0x6e99('0x3a')](_0x51cd3d['query'][_0x6e99('0x3a')]);_0x98f58b['where']=qs['filters'](_['pick'](_0x51cd3d[_0x6e99('0x30')],_0x35017['filters']),_0x40ad43);if(_0x51cd3d[_0x6e99('0x30')]['filter']){_0x98f58b[_0x6e99('0x3b')]=_[_0x6e99('0x3c')](_0x98f58b[_0x6e99('0x3b')],{'$or':_[_0x6e99('0x2c')](_0x40ad43,function(_0x3e9a3c){if(_0x3e9a3c['type']!=='VIRTUAL'){var _0x26e20a={};_0x26e20a[_0x3e9a3c[_0x6e99('0x29')]]={'$like':'%'+_0x51cd3d[_0x6e99('0x30')][_0x6e99('0x3d')]+'%'};return _0x26e20a;}})});}_0x98f58b=_[_0x6e99('0x3c')]({},_0x98f58b,_0x51cd3d['options']);var _0x2384d6={'where':_0x98f58b['where']};return db['Dynamics365Field'][_0x6e99('0x1d')](_0x2384d6)['then'](function(_0x83aed5){_0x48e308['count']=_0x83aed5;if(_0x51cd3d[_0x6e99('0x30')][_0x6e99('0x3e')]){_0x98f58b[_0x6e99('0x3f')]=[{'all':!![]}];}return db[_0x6e99('0x2d')][_0x6e99('0x40')](_0x98f58b);})['then'](function(_0x2698af){_0x48e308['rows']=_0x2698af;return _0x48e308;})[_0x6e99('0x24')](respondWithFilteredResult(_0x2741bd,_0x98f58b))[_0x6e99('0x41')](handleError(_0x2741bd,null));};exports[_0x6e99('0x42')]=function(_0x44df34,_0xe826ee){var _0x4f687d={'raw':!![],'where':{'id':_0x44df34[_0x6e99('0x43')]['id']}},_0x1ba629={};_0x1ba629['model']=_[_0x6e99('0x31')](db[_0x6e99('0x2d')][_0x6e99('0x44')]);_0x1ba629[_0x6e99('0x30')]=_[_0x6e99('0x31')](_0x44df34['query']);_0x1ba629[_0x6e99('0x32')]=_[_0x6e99('0x33')](_0x1ba629[_0x6e99('0x34')],_0x1ba629['query']);_0x4f687d['attributes']=_[_0x6e99('0x33')](_0x1ba629[_0x6e99('0x34')],qs[_0x6e99('0x36')](_0x44df34[_0x6e99('0x30')][_0x6e99('0x36')]));_0x4f687d[_0x6e99('0x35')]=_0x4f687d[_0x6e99('0x35')][_0x6e99('0x37')]?_0x4f687d[_0x6e99('0x35')]:_0x1ba629[_0x6e99('0x34')];if(_0x44df34[_0x6e99('0x30')]['includeAll']){_0x4f687d[_0x6e99('0x3f')]=[{'all':!![]}];}_0x4f687d=_[_0x6e99('0x3c')]({},_0x4f687d,_0x44df34[_0x6e99('0x45')]);return db['Dynamics365Field']['find'](_0x4f687d)[_0x6e99('0x24')](handleEntityNotFound(_0xe826ee,null))[_0x6e99('0x24')](respondWithResult(_0xe826ee,null))['catch'](handleError(_0xe826ee,null));};exports[_0x6e99('0x46')]=function(_0x354909,_0x1b7536){return db['Dynamics365Field'][_0x6e99('0x46')](_0x354909[_0x6e99('0x47')],{})[_0x6e99('0x24')](respondWithResult(_0x1b7536,0xc9))[_0x6e99('0x41')](handleError(_0x1b7536,null));};exports[_0x6e99('0x23')]=function(_0x357f5e,_0x136cd0){if(_0x357f5e['body']['id']){delete _0x357f5e[_0x6e99('0x47')]['id'];}return db[_0x6e99('0x2d')][_0x6e99('0x48')]({'where':{'id':_0x357f5e['params']['id']}})[_0x6e99('0x24')](handleEntityNotFound(_0x136cd0,null))[_0x6e99('0x24')](saveUpdates(_0x357f5e['body'],null))[_0x6e99('0x24')](respondWithResult(_0x136cd0,null))['catch'](handleError(_0x136cd0,null));};exports[_0x6e99('0x25')]=function(_0x27cf43,_0x135acb){return db[_0x6e99('0x2d')][_0x6e99('0x48')]({'where':{'id':_0x27cf43['params']['id']}})['then'](handleEntityNotFound(_0x135acb,null))['then'](removeEntity(_0x135acb,null))[_0x6e99('0x41')](handleError(_0x135acb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 176f6fc..f4e2e5c 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 _0x1dbf=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d2112,_0x4e5251){var _0x514895=function(_0x4cdca0){while(--_0x4cdca0){_0x4d2112['push'](_0x4d2112['shift']());}};_0x514895(++_0x4e5251);}(_0x1dbf,0x119));var _0xf1db=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x1dbf[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xf1db('0x0'));var util=require(_0xf1db('0x1'));var logger=require(_0xf1db('0x2'))(_0xf1db('0x3'));var moment=require(_0xf1db('0x4'));var BPromise=require(_0xf1db('0x5'));var rp=require(_0xf1db('0x6'));var fs=require('fs');var path=require(_0xf1db('0x7'));var rimraf=require(_0xf1db('0x8'));var config=require(_0xf1db('0x9'));var attributes=require(_0xf1db('0xa'));module[_0xf1db('0xb')]=function(_0x58ab0e,_0x3cdb66){return _0x58ab0e['define'](_0xf1db('0xc'),attributes,{'tableName':_0xf1db('0xd'),'paranoid':![],'indexes':[{'name':_0xf1db('0xe'),'fields':[_0xf1db('0xf'),_0xf1db('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56a9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','api'];(function(_0x560551,_0xce9fe7){var _0x1e06b6=function(_0x19a9ab){while(--_0x19a9ab){_0x560551['push'](_0x560551['shift']());}};_0x1e06b6(++_0xce9fe7);}(_0x56a9,0x140));var _0x956a=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x56a9[_0x5c468f];return _0x2136b0;};'use strict';var _=require(_0x956a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x956a('0x1'));var moment=require(_0x956a('0x2'));var BPromise=require(_0x956a('0x3'));var rp=require(_0x956a('0x4'));var fs=require('fs');var path=require(_0x956a('0x5'));var rimraf=require(_0x956a('0x6'));var config=require(_0x956a('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x104cb7,_0x1f8737){return _0x104cb7[_0x956a('0x8')](_0x956a('0x9'),attributes,{'tableName':_0x956a('0xa'),'paranoid':![],'indexes':[{'name':_0x956a('0xb'),'fields':[_0x956a('0xc'),_0x956a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index fc5f84d..5e6a3bb 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 _0x1d5c=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x4a61f6,_0x25a455){var _0x1a2aa8=function(_0x44ba70){while(--_0x44ba70){_0x4a61f6['push'](_0x4a61f6['shift']());}};_0x1a2aa8(++_0x25a455);}(_0x1d5c,0x12f));var _0xc1d5=function(_0x486b00,_0x501df5){_0x486b00=_0x486b00-0x0;var _0x47ea82=_0x1d5c[_0x486b00];return _0x47ea82;};'use strict';var _=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var moment=require('moment');var BPromise=require(_0xc1d5('0x2'));var rs=require(_0xc1d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1d5('0x4'))['db'];var utils=require(_0xc1d5('0x5'));var logger=require(_0xc1d5('0x6'))(_0xc1d5('0x7'));var config=require('../../config/environment');var jayson=require(_0xc1d5('0x8'));var client=jayson['client'][_0xc1d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x298265,_0x5a8a1b,_0x43c991){return new BPromise(function(_0xaad0,_0x1c49e8){return client['request'](_0x298265,_0x43c991)[_0xc1d5('0xa')](function(_0x5948db){logger[_0xc1d5('0xb')](_0xc1d5('0xc'),_0x5a8a1b,_0xc1d5('0xd'));logger['debug'](_0xc1d5('0xe'),_0x5a8a1b,'request\x20sent',JSON['stringify'](_0x5948db));if(_0x5948db[_0xc1d5('0xf')]){if(_0x5948db[_0xc1d5('0xf')][_0xc1d5('0x10')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5a8a1b,_0x5948db[_0xc1d5('0xf')][_0xc1d5('0x11')]);return _0x1c49e8(_0x5948db[_0xc1d5('0xf')]['message']);}logger[_0xc1d5('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5a8a1b,_0x5948db[_0xc1d5('0xf')][_0xc1d5('0x11')]);return _0xaad0(_0x5948db[_0xc1d5('0xf')][_0xc1d5('0x11')]);}else{logger[_0xc1d5('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5a8a1b,_0xc1d5('0xd'));_0xaad0(_0x5948db['result'][_0xc1d5('0x11')]);}})[_0xc1d5('0x12')](function(_0x1509a2){logger['error'](_0xc1d5('0xc'),_0x5a8a1b,_0x1509a2);_0x1c49e8(_0x1509a2);});});} \ No newline at end of file +var _0x5300=['message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x104d3f,_0xd485d7){var _0x2fa844=function(_0x3d3861){while(--_0x3d3861){_0x104d3f['push'](_0x104d3f['shift']());}};_0x2fa844(++_0xd485d7);}(_0x5300,0xa5));var _0x0530=function(_0x3bd0ca,_0x3c2a6d){_0x3bd0ca=_0x3bd0ca-0x0;var _0x21dca1=_0x5300[_0x3bd0ca];return _0x21dca1;};'use strict';var _=require(_0x0530('0x0'));var util=require(_0x0530('0x1'));var moment=require(_0x0530('0x2'));var BPromise=require('bluebird');var rs=require(_0x0530('0x3'));var fs=require('fs');var Redis=require(_0x0530('0x4'));var db=require(_0x0530('0x5'))['db'];var utils=require(_0x0530('0x6'));var logger=require(_0x0530('0x7'))(_0x0530('0x8'));var config=require('../../config/environment');var jayson=require(_0x0530('0x9'));var client=jayson[_0x0530('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491f84,_0x3932fe,_0x502e88){return new BPromise(function(_0x323da2,_0x291acf){return client[_0x0530('0xb')](_0x491f84,_0x502e88)[_0x0530('0xc')](function(_0x34f472){logger[_0x0530('0xd')](_0x0530('0xe'),_0x3932fe,'request\x20sent');logger[_0x0530('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3932fe,'request\x20sent',JSON[_0x0530('0x10')](_0x34f472));if(_0x34f472[_0x0530('0x11')]){if(_0x34f472[_0x0530('0x11')][_0x0530('0x12')]===0x1f4){logger[_0x0530('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3932fe,_0x34f472[_0x0530('0x11')][_0x0530('0x13')]);return _0x291acf(_0x34f472[_0x0530('0x11')][_0x0530('0x13')]);}logger['error'](_0x0530('0xe'),_0x3932fe,_0x34f472[_0x0530('0x11')][_0x0530('0x13')]);return _0x323da2(_0x34f472[_0x0530('0x11')][_0x0530('0x13')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3932fe,_0x0530('0x14'));_0x323da2(_0x34f472[_0x0530('0x15')][_0x0530('0x13')]);}})[_0x0530('0x16')](function(_0x17260c){logger[_0x0530('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3932fe,_0x17260c);_0x291acf(_0x17260c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f282a36..7a0ed9f 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 _0x81b4=['/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x23cb0f,_0x1f3f8c){var _0x37ede7=function(_0x1536f9){while(--_0x1536f9){_0x23cb0f['push'](_0x23cb0f['shift']());}};_0x37ede7(++_0x1f3f8c);}(_0x81b4,0x152));var _0x481b=function(_0x1fd7d8,_0x104c32){_0x1fd7d8=_0x1fd7d8-0x0;var _0x25d49a=_0x81b4[_0x1fd7d8];return _0x25d49a;};'use strict';var multer=require(_0x481b('0x0'));var util=require(_0x481b('0x1'));var path=require(_0x481b('0x2'));var timeout=require(_0x481b('0x3'));var express=require(_0x481b('0x4'));var router=express[_0x481b('0x5')]();var fs_extra=require(_0x481b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x481b('0x7'));var config=require(_0x481b('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x481b('0x9')]('/',auth[_0x481b('0xa')](),controller[_0x481b('0xb')]);router[_0x481b('0x9')](_0x481b('0xc'),auth[_0x481b('0xa')](),controller['show']);router[_0x481b('0x9')](_0x481b('0xd'),auth[_0x481b('0xa')](),controller['getConfigurations']);router[_0x481b('0x9')](_0x481b('0xe'),auth[_0x481b('0xa')](),controller[_0x481b('0xf')]);router[_0x481b('0x10')]('/',auth['isAuthenticated'](),controller[_0x481b('0x11')]);router[_0x481b('0x10')](_0x481b('0xd'),auth[_0x481b('0xa')](),controller['addConfiguration']);router['put'](_0x481b('0xc'),auth[_0x481b('0xa')](),controller[_0x481b('0x12')]);router[_0x481b('0x13')](_0x481b('0xc'),auth['isAuthenticated'](),controller[_0x481b('0x14')]);module[_0x481b('0x15')]=router; \ No newline at end of file +var _0x0a52=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x30dedb,_0x534bf5){var _0x4f3869=function(_0x995cb0){while(--_0x995cb0){_0x30dedb['push'](_0x30dedb['shift']());}};_0x4f3869(++_0x534bf5);}(_0x0a52,0x89));var _0x20a5=function(_0x433774,_0x399331){_0x433774=_0x433774-0x0;var _0x34900a=_0x0a52[_0x433774];return _0x34900a;};'use strict';var multer=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var path=require(_0x20a5('0x2'));var timeout=require(_0x20a5('0x3'));var express=require(_0x20a5('0x4'));var router=express[_0x20a5('0x5')]();var fs_extra=require(_0x20a5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x20a5('0x7'));var config=require(_0x20a5('0x8'));var controller=require(_0x20a5('0x9'));router['get']('/',auth[_0x20a5('0xa')](),controller[_0x20a5('0xb')]);router[_0x20a5('0xc')](_0x20a5('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x20a5('0xe'),auth['isAuthenticated'](),controller[_0x20a5('0xf')]);router[_0x20a5('0xc')](_0x20a5('0x10'),auth[_0x20a5('0xa')](),controller[_0x20a5('0x11')]);router[_0x20a5('0x12')]('/',auth[_0x20a5('0xa')](),controller[_0x20a5('0x13')]);router['post']('/:id/configurations',auth[_0x20a5('0xa')](),controller[_0x20a5('0x14')]);router[_0x20a5('0x15')](_0x20a5('0xd'),auth[_0x20a5('0xa')](),controller[_0x20a5('0x16')]);router[_0x20a5('0x17')]('/:id',auth[_0x20a5('0xa')](),controller[_0x20a5('0x18')]);module[_0x20a5('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 395ddbc..14361a0 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 _0x1399=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x1399,0x16c));var _0x9139=function(_0x182891,_0x4716b0){_0x182891=_0x182891-0x0;var _0x166fb5=_0x1399[_0x182891];return _0x166fb5;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9139('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x9139('0x3')},'apiKey':{'type':Sequelize[_0x9139('0x2')]},'remoteUri':{'type':Sequelize[_0x9139('0x2')],'unique':_0x9139('0x4')},'serverUrl':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x896e=['exports','STRING','username','remoteUri','sequelize'];(function(_0x542a5d,_0x27e6c8){var _0x251378=function(_0x295247){while(--_0x295247){_0x542a5d['push'](_0x542a5d['shift']());}};_0x251378(++_0x27e6c8);}(_0x896e,0x1e9));var _0xe896=function(_0x3a317b,_0x8e4b4a){_0x3a317b=_0x3a317b-0x0;var _0x29cba6=_0x896e[_0x3a317b];return _0x29cba6;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'name':{'type':Sequelize[_0xe896('0x2')]},'description':{'type':Sequelize[_0xe896('0x2')]},'username':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x3')},'apiKey':{'type':Sequelize[_0xe896('0x2')]},'remoteUri':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x4')},'serverUrl':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 4027fdb..d42a5ec 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 _0xc16f=['eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','count','limit','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','create','body','catch','getConfigurations','findOne','order','AccountId','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','label','default','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials'];(function(_0x212259,_0x40a977){var _0x5035f4=function(_0x44b7fa){while(--_0x44b7fa){_0x212259['push'](_0x212259['shift']());}};_0x5035f4(++_0x40a977);}(_0xc16f,0xe6));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc16('0x0'));var rimraf=require(_0xfc16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc16('0x2'));var rp=require(_0xfc16('0x3'));var moment=require(_0xfc16('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc16('0x5'));var path=require('path');var sox=require(_0xfc16('0x6'));var csv=require(_0xfc16('0x7'));var ejs=require(_0xfc16('0x8'));var fs=require('fs');var fs_extra=require(_0xfc16('0x9'));var _=require(_0xfc16('0xa'));var squel=require(_0xfc16('0xb'));var crypto=require(_0xfc16('0xc'));var jsforce=require(_0xfc16('0xd'));var deskjs=require(_0xfc16('0xe'));var toCsv=require(_0xfc16('0x7'));var querystring=require(_0xfc16('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfc16('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc16('0x11'));var logger=require(_0xfc16('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfc16('0x13'));var licenseUtil=require(_0xfc16('0x14'));var db=require(_0xfc16('0x15'))['db'];var integrations=require(_0xfc16('0x16'));function respondWithStatusCode(_0x2dcd29,_0x1384e2){_0x1384e2=_0x1384e2||0xcc;return function(_0x18868b){if(_0x18868b){return _0x2dcd29[_0xfc16('0x17')](_0x1384e2);}return _0x2dcd29['status'](_0x1384e2)[_0xfc16('0x18')]();};}function respondWithResult(_0x21123d,_0x2319f3){_0x2319f3=_0x2319f3||0xc8;return function(_0x1fb96f){if(_0x1fb96f){return _0x21123d[_0xfc16('0x19')](_0x2319f3)[_0xfc16('0x1a')](_0x1fb96f);}};}function respondWithFilteredResult(_0x2ae498,_0x3b01dc){return function(_0x36e3e1){if(_0x36e3e1){var _0x5d2228=typeof _0x3b01dc['offset']==='undefined'&&typeof _0x3b01dc['limit']==='undefined';var _0x438b83=_0x36e3e1['count'];var _0x3edfc8=_0x5d2228?0x0:_0x3b01dc[_0xfc16('0x1b')];var _0x39a7b8=_0x5d2228?_0x36e3e1[_0xfc16('0x1c')]:_0x3b01dc[_0xfc16('0x1b')]+_0x3b01dc[_0xfc16('0x1d')];var _0xd67e03;if(_0x39a7b8>=_0x438b83){_0x39a7b8=_0x438b83;_0xd67e03=0xc8;}else{_0xd67e03=0xce;}_0x2ae498['status'](_0xd67e03);return _0x2ae498['set']('Content-Range',_0x3edfc8+'-'+_0x39a7b8+'/'+_0x438b83)['json'](_0x36e3e1);}return null;};}function patchUpdates(_0x5e4185){return function(_0x577a14){try{jsonpatch[_0xfc16('0x1e')](_0x577a14,_0x5e4185,!![]);}catch(_0x2b9b89){return BPromise[_0xfc16('0x1f')](_0x2b9b89);}return _0x577a14[_0xfc16('0x20')]();};}function saveUpdates(_0x56c811,_0x4b2bdf){return function(_0x2246ed){if(_0x2246ed){return _0x2246ed[_0xfc16('0x21')](_0x56c811)[_0xfc16('0x22')](function(_0x5efe2b){return _0x5efe2b;});}return null;};}function removeEntity(_0xf2335b,_0x49afce){return function(_0x39c8bd){if(_0x39c8bd){return _0x39c8bd[_0xfc16('0x23')]()[_0xfc16('0x22')](function(){_0xf2335b[_0xfc16('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45187c,_0x4b15a0){return function(_0x1690a3){if(!_0x1690a3){_0x45187c[_0xfc16('0x17')](0x194);}return _0x1690a3;};}function handleError(_0x4e29df,_0x1d3d0c){_0x1d3d0c=_0x1d3d0c||0x1f4;return function(_0x11e522){logger[_0xfc16('0x24')](_0x11e522[_0xfc16('0x25')]);if(_0x11e522[_0xfc16('0x26')]){delete _0x11e522[_0xfc16('0x26')];}_0x4e29df['status'](_0x1d3d0c)['send'](_0x11e522);};}exports[_0xfc16('0x27')]=function(_0x2528ba,_0x4fdfb4){var _0x3f9592={},_0x138bdc={},_0x1e56a4={'count':0x0,'rows':[]};var _0x4d8588=_[_0xfc16('0x28')](db[_0xfc16('0x29')][_0xfc16('0x2a')],function(_0x1de571){return{'name':_0x1de571[_0xfc16('0x2b')],'type':_0x1de571[_0xfc16('0x2c')][_0xfc16('0x2d')]};});_0x138bdc[_0xfc16('0x2e')]=_[_0xfc16('0x28')](_0x4d8588,'name');_0x138bdc[_0xfc16('0x2f')]=_[_0xfc16('0x30')](_0x2528ba['query']);_0x138bdc[_0xfc16('0x31')]=_['intersection'](_0x138bdc[_0xfc16('0x2e')],_0x138bdc[_0xfc16('0x2f')]);_0x3f9592[_0xfc16('0x32')]=_[_0xfc16('0x33')](_0x138bdc[_0xfc16('0x2e')],qs['fields'](_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x34')]));_0x3f9592['attributes']=_0x3f9592[_0xfc16('0x32')]['length']?_0x3f9592[_0xfc16('0x32')]:_0x138bdc['model'];if(!_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x35')](_0xfc16('0x36'))){_0x3f9592[_0xfc16('0x1d')]=qs[_0xfc16('0x1d')](_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x1d')]);_0x3f9592['offset']=qs[_0xfc16('0x1b')](_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x1b')]);}_0x3f9592['order']=qs[_0xfc16('0x37')](_0x2528ba['query'][_0xfc16('0x37')]);_0x3f9592[_0xfc16('0x38')]=qs['filters'](_[_0xfc16('0x39')](_0x2528ba[_0xfc16('0x2f')],_0x138bdc[_0xfc16('0x31')]),_0x4d8588);if(_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x3a')]){_0x3f9592[_0xfc16('0x38')]=_[_0xfc16('0x3b')](_0x3f9592['where'],{'$or':_[_0xfc16('0x28')](_0x4d8588,function(_0x456266){if(_0x456266[_0xfc16('0x2c')]!==_0xfc16('0x3c')){var _0x582a7={};_0x582a7[_0x456266['name']]={'$like':'%'+_0x2528ba[_0xfc16('0x2f')][_0xfc16('0x3a')]+'%'};return _0x582a7;}})});}_0x3f9592=_[_0xfc16('0x3b')]({},_0x3f9592,_0x2528ba[_0xfc16('0x3d')]);var _0x541d53={'where':_0x3f9592[_0xfc16('0x38')]};return db[_0xfc16('0x29')][_0xfc16('0x1c')](_0x541d53)[_0xfc16('0x22')](function(_0x28ea3b){_0x1e56a4[_0xfc16('0x1c')]=_0x28ea3b;if(_0x2528ba[_0xfc16('0x2f')]['includeAll']){_0x3f9592[_0xfc16('0x3e')]=[{'all':!![]}];}return db[_0xfc16('0x29')][_0xfc16('0x3f')](_0x3f9592);})[_0xfc16('0x22')](function(_0x25824d){_0x1e56a4[_0xfc16('0x40')]=_0x25824d;return _0x1e56a4;})['then'](respondWithFilteredResult(_0x4fdfb4,_0x3f9592))['catch'](handleError(_0x4fdfb4,null));};exports[_0xfc16('0x41')]=function(_0x1f4057,_0x3cb18f){var _0xcefb9c={'raw':![],'where':{'id':_0x1f4057[_0xfc16('0x42')]['id']}},_0x581944={};_0x581944['model']=_[_0xfc16('0x30')](db[_0xfc16('0x29')][_0xfc16('0x2a')]);_0x581944[_0xfc16('0x2f')]=_[_0xfc16('0x30')](_0x1f4057['query']);_0x581944['filters']=_['intersection'](_0x581944[_0xfc16('0x2e')],_0x581944[_0xfc16('0x2f')]);_0xcefb9c['attributes']=_[_0xfc16('0x33')](_0x581944[_0xfc16('0x2e')],qs[_0xfc16('0x34')](_0x1f4057[_0xfc16('0x2f')][_0xfc16('0x34')]));_0xcefb9c[_0xfc16('0x32')]=_0xcefb9c[_0xfc16('0x32')][_0xfc16('0x43')]?_0xcefb9c[_0xfc16('0x32')]:_0x581944[_0xfc16('0x2e')];if(_0x1f4057[_0xfc16('0x2f')][_0xfc16('0x44')]){_0xcefb9c[_0xfc16('0x3e')]=[{'all':!![]}];}_0xcefb9c=_[_0xfc16('0x3b')]({},_0xcefb9c,_0x1f4057[_0xfc16('0x3d')]);return db['FreshdeskAccount'][_0xfc16('0x45')](_0xcefb9c)[_0xfc16('0x22')](handleEntityNotFound(_0x3cb18f,null))[_0xfc16('0x22')](respondWithResult(_0x3cb18f,null))['catch'](handleError(_0x3cb18f,null));};exports[_0xfc16('0x46')]=function(_0x340b4c,_0x1d80a2){return db['FreshdeskAccount'][_0xfc16('0x46')](_0x340b4c[_0xfc16('0x47')],{})[_0xfc16('0x22')](respondWithResult(_0x1d80a2,0xc9))[_0xfc16('0x48')](handleError(_0x1d80a2,null));};exports['update']=function(_0x13f6f8,_0x57052a){if(_0x13f6f8[_0xfc16('0x47')]['id']){delete _0x13f6f8[_0xfc16('0x47')]['id'];}return db[_0xfc16('0x29')]['find']({'where':{'id':_0x13f6f8[_0xfc16('0x42')]['id']}})['then'](handleEntityNotFound(_0x57052a,null))[_0xfc16('0x22')](saveUpdates(_0x13f6f8[_0xfc16('0x47')],null))['then'](respondWithResult(_0x57052a,null))[_0xfc16('0x48')](handleError(_0x57052a,null));};exports['destroy']=function(_0x530f44,_0x33afe6){return db[_0xfc16('0x29')][_0xfc16('0x45')]({'where':{'id':_0x530f44[_0xfc16('0x42')]['id']}})['then'](handleEntityNotFound(_0x33afe6,null))[_0xfc16('0x22')](removeEntity(_0x33afe6,null))[_0xfc16('0x48')](handleError(_0x33afe6,null));};exports[_0xfc16('0x49')]=function(_0x51c3b4,_0x447ce1,_0x5e1a56){var _0x328018={};var _0x51b8ad={};var _0x1fe64e;var _0x69e05d;return db[_0xfc16('0x29')][_0xfc16('0x4a')]({'where':{'id':_0x51c3b4['params']['id']}})['then'](handleEntityNotFound(_0x447ce1,null))[_0xfc16('0x22')](function(_0x1db265){if(_0x1db265){_0x1fe64e=_0x1db265;_0x51b8ad[_0xfc16('0x2e')]=_['keys'](db['FreshdeskConfiguration'][_0xfc16('0x2a')]);_0x51b8ad[_0xfc16('0x2f')]=_['keys'](_0x51c3b4['query']);_0x51b8ad[_0xfc16('0x31')]=_['intersection'](_0x51b8ad[_0xfc16('0x2e')],_0x51b8ad[_0xfc16('0x2f')]);_0x328018[_0xfc16('0x32')]=_[_0xfc16('0x33')](_0x51b8ad[_0xfc16('0x2e')],qs[_0xfc16('0x34')](_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x34')]));_0x328018[_0xfc16('0x32')]=_0x328018[_0xfc16('0x32')][_0xfc16('0x43')]?_0x328018[_0xfc16('0x32')]:_0x51b8ad[_0xfc16('0x2e')];_0x328018[_0xfc16('0x4b')]=qs[_0xfc16('0x37')](_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x37')]);_0x328018[_0xfc16('0x38')]=qs['filters'](_['pick'](_0x51c3b4[_0xfc16('0x2f')],_0x51b8ad[_0xfc16('0x31')]));if(_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x3a')]){_0x328018['where']=_[_0xfc16('0x3b')](_0x328018[_0xfc16('0x38')],{'$or':_[_0xfc16('0x28')](_0x328018[_0xfc16('0x32')],function(_0xcbf76a){var _0x1e85e8={};_0x1e85e8[_0xcbf76a]={'$like':'%'+_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x3a')]+'%'};return _0x1e85e8;})});}_0x328018=_[_0xfc16('0x3b')]({},_0x328018,_0x51c3b4[_0xfc16('0x3d')]);return _0x1fe64e[_0xfc16('0x49')](_0x328018);}})[_0xfc16('0x22')](function(_0x596cbd){if(_0x596cbd){_0x69e05d=_0x596cbd[_0xfc16('0x43')];if(!_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x35')](_0xfc16('0x36'))){_0x328018[_0xfc16('0x1d')]=qs[_0xfc16('0x1d')](_0x51c3b4[_0xfc16('0x2f')]['limit']);_0x328018['offset']=qs[_0xfc16('0x1b')](_0x51c3b4[_0xfc16('0x2f')][_0xfc16('0x1b')]);}return _0x1fe64e[_0xfc16('0x49')](_0x328018);}})[_0xfc16('0x22')](function(_0x35ef90){if(_0x35ef90){return _0x35ef90?{'count':_0x69e05d,'rows':_0x35ef90}:null;}})[_0xfc16('0x22')](respondWithResult(_0x447ce1,null))[_0xfc16('0x48')](handleError(_0x447ce1,null));};exports['addConfiguration']=function(_0x584319,_0x3d2303,_0x1d912c){if(_0x584319['body']['id']){delete _0x584319[_0xfc16('0x47')]['id'];}return db['FreshdeskAccount'][_0xfc16('0x4a')]({'where':{'id':_0x584319['params']['id']}})['then'](handleEntityNotFound(_0x3d2303,null))[_0xfc16('0x22')](function(_0x391e01){if(_0x391e01){_0x584319[_0xfc16('0x47')][_0xfc16('0x4c')]=_0x391e01['id'];_0x584319['body']['Subjects']=integrations[_0xfc16('0x4d')](_0x584319['body'][_0xfc16('0x4e')],_0x584319[_0xfc16('0x47')][_0xfc16('0x2c')]);_0x584319['body'][_0xfc16('0x4f')]=integrations['getDescriptions'](_0x584319[_0xfc16('0x47')][_0xfc16('0x4e')],_0x584319[_0xfc16('0x47')][_0xfc16('0x2c')]);return db[_0xfc16('0x50')][_0xfc16('0x46')](_0x584319[_0xfc16('0x47')],{'include':[{'model':db[_0xfc16('0x51')],'as':_0xfc16('0x52')},{'model':db['FreshdeskField'],'as':_0xfc16('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d2303,null))[_0xfc16('0x48')](handleError(_0x3d2303,null));};exports[_0xfc16('0x53')]=function(_0x295f6a,_0xa4ae15,_0x46ed27){var _0xe65d73='';return db['FreshdeskAccount'][_0xfc16('0x4a')]({'where':{'id':_0x295f6a[_0xfc16('0x42')]['id']},'attributes':['id',_0xfc16('0x54'),_0xfc16('0x55')]})[_0xfc16('0x22')](handleEntityNotFound(_0xa4ae15,null))[_0xfc16('0x22')](function(_0x38e1c9){if(_0x38e1c9){_0xe65d73=_0x38e1c9[_0xfc16('0x54')];var _0x406cb8=_0xe65d73[_0xfc16('0x56')](-0x1);if(_0x406cb8==='/'){_0xe65d73=_0xe65d73[_0xfc16('0x57')](0x0,_0xe65d73[_0xfc16('0x58')](_0x406cb8));}return rp({'method':_0xfc16('0x59'),'uri':util[_0xfc16('0x5a')](_0xfc16('0x5b'),_0xe65d73,_0xfc16('0x5c')),'headers':{'Authorization':util[_0xfc16('0x5a')]('Basic\x20%s',new Buffer(util[_0xfc16('0x5a')](_0xfc16('0x5d'),_0x38e1c9['apiKey']))[_0xfc16('0x5e')](_0xfc16('0x5f')))},'json':!![]});}})['then'](function(_0x16739a){if(_0x16739a){var _0x215cf=[_0xfc16('0x60'),_0xfc16('0x61'),_0xfc16('0x62'),_0xfc16('0x63'),_0xfc16('0x19'),_0xfc16('0x64'),_0xfc16('0x65'),_0xfc16('0x66'),_0xfc16('0x67'),_0xfc16('0x65'),_0xfc16('0x68')];_[_0xfc16('0x69')](_0x16739a,function(_0x1d80d1){return _0x215cf['includes'](_0x1d80d1[_0xfc16('0x26')])||!_0x1d80d1['default']&&_0x1d80d1[_0xfc16('0x2c')]!=='custom_text'&&_0x1d80d1['type']!=='custom_dropdown';});return{'count':_0x16739a[_0xfc16('0x43')],'rows':_['map'](_0x16739a,function(_0x73947f){return{'id':_0x73947f[_0xfc16('0x26')],'name':_0x73947f[_0xfc16('0x6a')],'custom':!_0x73947f[_0xfc16('0x6b')],'options':_0x73947f[_0xfc16('0x6c')]?_[_0xfc16('0x28')](_0x73947f[_0xfc16('0x6c')],function(_0x11bd52){return{'name':_['capitalize'](_0x11bd52),'value':_0x11bd52};}):[]};})};}})[_0xfc16('0x22')](respondWithResult(_0xa4ae15,null))[_0xfc16('0x48')](function(_0x41f7f2){var _0x3fe1c2=_0x295f6a[_0xfc16('0x2f')]['test']?0x1f4:_0x41f7f2[_0xfc16('0x6d')]||0x1f4;logger[_0xfc16('0x24')](_0xfc16('0x6e'),'getFields',_0x3fe1c2,JSON[_0xfc16('0x6f')](_0x41f7f2));delete _0x41f7f2[_0xfc16('0x26')];if(_0x3fe1c2===0x191){_0x3fe1c2=0x190;}_0xa4ae15['status'](_0x3fe1c2)[_0xfc16('0x70')](_0x295f6a[_0xfc16('0x2f')][_0xfc16('0x71')]?{'message':_0xfc16('0x72'),'statusCode':_0x41f7f2[_0xfc16('0x6d')]}:_0x41f7f2);});}; \ No newline at end of file +var _0xa699=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','update','params','getConfigurations','findOne','FreshdeskConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','toString','base64','subject','agent','description','priority','source','ticket_type','group','company','remove','includes','label','default','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa699,0x6b));var _0x9a69=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xa699[_0x2c1114];return _0x2b877c;};'use strict';var emlformat=require(_0x9a69('0x0'));var rimraf=require(_0x9a69('0x1'));var zipdir=require(_0x9a69('0x2'));var jsonpatch=require(_0x9a69('0x3'));var rp=require(_0x9a69('0x4'));var moment=require(_0x9a69('0x5'));var BPromise=require(_0x9a69('0x6'));var Mustache=require(_0x9a69('0x7'));var util=require(_0x9a69('0x8'));var path=require(_0x9a69('0x9'));var sox=require(_0x9a69('0xa'));var csv=require(_0x9a69('0xb'));var ejs=require(_0x9a69('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a69('0xd'));var squel=require(_0x9a69('0xe'));var crypto=require(_0x9a69('0xf'));var jsforce=require(_0x9a69('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9a69('0xb'));var querystring=require(_0x9a69('0x11'));var Papa=require(_0x9a69('0x12'));var Redis=require(_0x9a69('0x13'));var authService=require(_0x9a69('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a69('0x15'));var logger=require('../../config/logger')(_0x9a69('0x16'));var utils=require(_0x9a69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x18'));var db=require(_0x9a69('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x81dfb1,_0x2e613e){_0x2e613e=_0x2e613e||0xcc;return function(_0x57e34){if(_0x57e34){return _0x81dfb1[_0x9a69('0x1a')](_0x2e613e);}return _0x81dfb1[_0x9a69('0x1b')](_0x2e613e)[_0x9a69('0x1c')]();};}function respondWithResult(_0x34b5b0,_0x2a5b83){_0x2a5b83=_0x2a5b83||0xc8;return function(_0x1581d6){if(_0x1581d6){return _0x34b5b0['status'](_0x2a5b83)[_0x9a69('0x1d')](_0x1581d6);}};}function respondWithFilteredResult(_0x17de41,_0x2be3ec){return function(_0x5e982d){if(_0x5e982d){var _0x13fd7=typeof _0x2be3ec[_0x9a69('0x1e')]===_0x9a69('0x1f')&&typeof _0x2be3ec[_0x9a69('0x20')]===_0x9a69('0x1f');var _0x5b5161=_0x5e982d[_0x9a69('0x21')];var _0x2a6a0d=_0x13fd7?0x0:_0x2be3ec[_0x9a69('0x1e')];var _0x334474=_0x13fd7?_0x5e982d[_0x9a69('0x21')]:_0x2be3ec[_0x9a69('0x1e')]+_0x2be3ec[_0x9a69('0x20')];var _0x45cae5;if(_0x334474>=_0x5b5161){_0x334474=_0x5b5161;_0x45cae5=0xc8;}else{_0x45cae5=0xce;}_0x17de41[_0x9a69('0x1b')](_0x45cae5);return _0x17de41[_0x9a69('0x22')]('Content-Range',_0x2a6a0d+'-'+_0x334474+'/'+_0x5b5161)['json'](_0x5e982d);}return null;};}function patchUpdates(_0x5ebb09){return function(_0x426f72){try{jsonpatch[_0x9a69('0x23')](_0x426f72,_0x5ebb09,!![]);}catch(_0x518620){return BPromise[_0x9a69('0x24')](_0x518620);}return _0x426f72[_0x9a69('0x25')]();};}function saveUpdates(_0x265291,_0x4d6a93){return function(_0x4b9b28){if(_0x4b9b28){return _0x4b9b28['update'](_0x265291)[_0x9a69('0x26')](function(_0x5f4138){return _0x5f4138;});}return null;};}function removeEntity(_0x140cbe,_0x28f5f7){return function(_0x256cc1){if(_0x256cc1){return _0x256cc1[_0x9a69('0x27')]()['then'](function(){_0x140cbe[_0x9a69('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203d32,_0x4ef126){return function(_0x5ac01c){if(!_0x5ac01c){_0x203d32[_0x9a69('0x1a')](0x194);}return _0x5ac01c;};}function handleError(_0xf6fea2,_0x268cef){_0x268cef=_0x268cef||0x1f4;return function(_0xbe0597){logger[_0x9a69('0x28')](_0xbe0597[_0x9a69('0x29')]);if(_0xbe0597[_0x9a69('0x2a')]){delete _0xbe0597[_0x9a69('0x2a')];}_0xf6fea2[_0x9a69('0x1b')](_0x268cef)[_0x9a69('0x2b')](_0xbe0597);};}exports['index']=function(_0x1ff48e,_0x165a87){var _0x5433b3={},_0x54e643={},_0x4b3539={'count':0x0,'rows':[]};var _0x1f976b=_['map'](db[_0x9a69('0x2c')][_0x9a69('0x2d')],function(_0x31b83b){return{'name':_0x31b83b[_0x9a69('0x2e')],'type':_0x31b83b[_0x9a69('0x2f')][_0x9a69('0x30')]};});_0x54e643[_0x9a69('0x31')]=_[_0x9a69('0x32')](_0x1f976b,_0x9a69('0x2a'));_0x54e643[_0x9a69('0x33')]=_[_0x9a69('0x34')](_0x1ff48e[_0x9a69('0x33')]);_0x54e643[_0x9a69('0x35')]=_[_0x9a69('0x36')](_0x54e643[_0x9a69('0x31')],_0x54e643[_0x9a69('0x33')]);_0x5433b3[_0x9a69('0x37')]=_['intersection'](_0x54e643['model'],qs[_0x9a69('0x38')](_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x38')]));_0x5433b3[_0x9a69('0x37')]=_0x5433b3[_0x9a69('0x37')]['length']?_0x5433b3['attributes']:_0x54e643['model'];if(!_0x1ff48e['query'][_0x9a69('0x39')](_0x9a69('0x3a'))){_0x5433b3[_0x9a69('0x20')]=qs[_0x9a69('0x20')](_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x20')]);_0x5433b3['offset']=qs['offset'](_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x1e')]);}_0x5433b3[_0x9a69('0x3b')]=qs['sort'](_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x3c')]);_0x5433b3[_0x9a69('0x3d')]=qs[_0x9a69('0x35')](_[_0x9a69('0x3e')](_0x1ff48e[_0x9a69('0x33')],_0x54e643[_0x9a69('0x35')]),_0x1f976b);if(_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x3f')]){_0x5433b3[_0x9a69('0x3d')]=_[_0x9a69('0x40')](_0x5433b3['where'],{'$or':_[_0x9a69('0x32')](_0x1f976b,function(_0x524958){if(_0x524958['type']!=='VIRTUAL'){var _0x5dd195={};_0x5dd195[_0x524958[_0x9a69('0x2a')]]={'$like':'%'+_0x1ff48e[_0x9a69('0x33')]['filter']+'%'};return _0x5dd195;}})});}_0x5433b3=_['merge']({},_0x5433b3,_0x1ff48e['options']);var _0x28100b={'where':_0x5433b3[_0x9a69('0x3d')]};return db[_0x9a69('0x2c')]['count'](_0x28100b)[_0x9a69('0x26')](function(_0x36aa5f){_0x4b3539[_0x9a69('0x21')]=_0x36aa5f;if(_0x1ff48e[_0x9a69('0x33')][_0x9a69('0x41')]){_0x5433b3[_0x9a69('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x9a69('0x43')](_0x5433b3);})[_0x9a69('0x26')](function(_0x1d54c9){_0x4b3539[_0x9a69('0x44')]=_0x1d54c9;return _0x4b3539;})['then'](respondWithFilteredResult(_0x165a87,_0x5433b3))[_0x9a69('0x45')](handleError(_0x165a87,null));};exports[_0x9a69('0x46')]=function(_0x5b309a,_0x318de1){var _0x3c78e2={'raw':![],'where':{'id':_0x5b309a['params']['id']}},_0x23b174={};_0x23b174['model']=_['keys'](db[_0x9a69('0x2c')][_0x9a69('0x2d')]);_0x23b174[_0x9a69('0x33')]=_[_0x9a69('0x34')](_0x5b309a['query']);_0x23b174[_0x9a69('0x35')]=_[_0x9a69('0x36')](_0x23b174[_0x9a69('0x31')],_0x23b174[_0x9a69('0x33')]);_0x3c78e2['attributes']=_[_0x9a69('0x36')](_0x23b174[_0x9a69('0x31')],qs[_0x9a69('0x38')](_0x5b309a[_0x9a69('0x33')]['fields']));_0x3c78e2[_0x9a69('0x37')]=_0x3c78e2['attributes'][_0x9a69('0x47')]?_0x3c78e2['attributes']:_0x23b174[_0x9a69('0x31')];if(_0x5b309a['query'][_0x9a69('0x41')]){_0x3c78e2['include']=[{'all':!![]}];}_0x3c78e2=_[_0x9a69('0x40')]({},_0x3c78e2,_0x5b309a[_0x9a69('0x48')]);return db[_0x9a69('0x2c')][_0x9a69('0x49')](_0x3c78e2)['then'](handleEntityNotFound(_0x318de1,null))[_0x9a69('0x26')](respondWithResult(_0x318de1,null))[_0x9a69('0x45')](handleError(_0x318de1,null));};exports[_0x9a69('0x4a')]=function(_0x2537b0,_0x18b0be){return db[_0x9a69('0x2c')][_0x9a69('0x4a')](_0x2537b0[_0x9a69('0x4b')],{})[_0x9a69('0x26')](respondWithResult(_0x18b0be,0xc9))['catch'](handleError(_0x18b0be,null));};exports[_0x9a69('0x4c')]=function(_0x6046a7,_0x1a104f){if(_0x6046a7[_0x9a69('0x4b')]['id']){delete _0x6046a7[_0x9a69('0x4b')]['id'];}return db[_0x9a69('0x2c')][_0x9a69('0x49')]({'where':{'id':_0x6046a7[_0x9a69('0x4d')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x1a104f,null))[_0x9a69('0x26')](saveUpdates(_0x6046a7[_0x9a69('0x4b')],null))[_0x9a69('0x26')](respondWithResult(_0x1a104f,null))[_0x9a69('0x45')](handleError(_0x1a104f,null));};exports[_0x9a69('0x27')]=function(_0x18ab7a,_0x4c5b25){return db[_0x9a69('0x2c')][_0x9a69('0x49')]({'where':{'id':_0x18ab7a[_0x9a69('0x4d')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x4c5b25,null))[_0x9a69('0x26')](removeEntity(_0x4c5b25,null))[_0x9a69('0x45')](handleError(_0x4c5b25,null));};exports[_0x9a69('0x4e')]=function(_0x52a75f,_0x15100e,_0xf378fd){var _0x2b7b66={};var _0x9a7c34={};var _0x18c353;var _0x32c826;return db[_0x9a69('0x2c')][_0x9a69('0x4f')]({'where':{'id':_0x52a75f[_0x9a69('0x4d')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x15100e,null))[_0x9a69('0x26')](function(_0x546243){if(_0x546243){_0x18c353=_0x546243;_0x9a7c34[_0x9a69('0x31')]=_[_0x9a69('0x34')](db[_0x9a69('0x50')]['rawAttributes']);_0x9a7c34[_0x9a69('0x33')]=_['keys'](_0x52a75f['query']);_0x9a7c34[_0x9a69('0x35')]=_[_0x9a69('0x36')](_0x9a7c34[_0x9a69('0x31')],_0x9a7c34[_0x9a69('0x33')]);_0x2b7b66['attributes']=_['intersection'](_0x9a7c34[_0x9a69('0x31')],qs['fields'](_0x52a75f[_0x9a69('0x33')]['fields']));_0x2b7b66['attributes']=_0x2b7b66[_0x9a69('0x37')][_0x9a69('0x47')]?_0x2b7b66[_0x9a69('0x37')]:_0x9a7c34[_0x9a69('0x31')];_0x2b7b66[_0x9a69('0x3b')]=qs[_0x9a69('0x3c')](_0x52a75f[_0x9a69('0x33')]['sort']);_0x2b7b66[_0x9a69('0x3d')]=qs[_0x9a69('0x35')](_[_0x9a69('0x3e')](_0x52a75f[_0x9a69('0x33')],_0x9a7c34['filters']));if(_0x52a75f[_0x9a69('0x33')][_0x9a69('0x3f')]){_0x2b7b66[_0x9a69('0x3d')]=_['merge'](_0x2b7b66[_0x9a69('0x3d')],{'$or':_[_0x9a69('0x32')](_0x2b7b66['attributes'],function(_0x533dcd){var _0x34ee21={};_0x34ee21[_0x533dcd]={'$like':'%'+_0x52a75f[_0x9a69('0x33')][_0x9a69('0x3f')]+'%'};return _0x34ee21;})});}_0x2b7b66=_[_0x9a69('0x40')]({},_0x2b7b66,_0x52a75f['options']);return _0x18c353['getConfigurations'](_0x2b7b66);}})[_0x9a69('0x26')](function(_0x37a9b6){if(_0x37a9b6){_0x32c826=_0x37a9b6['length'];if(!_0x52a75f[_0x9a69('0x33')][_0x9a69('0x39')]('nolimit')){_0x2b7b66[_0x9a69('0x20')]=qs['limit'](_0x52a75f[_0x9a69('0x33')]['limit']);_0x2b7b66['offset']=qs[_0x9a69('0x1e')](_0x52a75f[_0x9a69('0x33')][_0x9a69('0x1e')]);}return _0x18c353['getConfigurations'](_0x2b7b66);}})[_0x9a69('0x26')](function(_0x269cd7){if(_0x269cd7){return _0x269cd7?{'count':_0x32c826,'rows':_0x269cd7}:null;}})[_0x9a69('0x26')](respondWithResult(_0x15100e,null))[_0x9a69('0x45')](handleError(_0x15100e,null));};exports['addConfiguration']=function(_0x420057,_0x45549e,_0x665d9e){if(_0x420057[_0x9a69('0x4b')]['id']){delete _0x420057[_0x9a69('0x4b')]['id'];}return db[_0x9a69('0x2c')][_0x9a69('0x4f')]({'where':{'id':_0x420057[_0x9a69('0x4d')]['id']}})['then'](handleEntityNotFound(_0x45549e,null))[_0x9a69('0x26')](function(_0x51bf8d){if(_0x51bf8d){_0x420057['body']['AccountId']=_0x51bf8d['id'];_0x420057[_0x9a69('0x4b')][_0x9a69('0x51')]=integrations[_0x9a69('0x52')](_0x420057[_0x9a69('0x4b')][_0x9a69('0x53')],_0x420057[_0x9a69('0x4b')]['type']);_0x420057[_0x9a69('0x4b')]['Descriptions']=integrations[_0x9a69('0x54')](_0x420057[_0x9a69('0x4b')][_0x9a69('0x53')],_0x420057[_0x9a69('0x4b')][_0x9a69('0x2f')]);return db[_0x9a69('0x50')][_0x9a69('0x4a')](_0x420057['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x9a69('0x51')},{'model':db[_0x9a69('0x55')],'as':_0x9a69('0x56')}]});}return null;})['then'](respondWithResult(_0x45549e,null))[_0x9a69('0x45')](handleError(_0x45549e,null));};exports[_0x9a69('0x57')]=function(_0xb93218,_0x270e6b,_0xbbc647){var _0x2a7f48='';return db[_0x9a69('0x2c')]['findOne']({'where':{'id':_0xb93218['params']['id']},'attributes':['id',_0x9a69('0x58'),'apiKey']})['then'](handleEntityNotFound(_0x270e6b,null))[_0x9a69('0x26')](function(_0x428f46){if(_0x428f46){_0x2a7f48=_0x428f46[_0x9a69('0x58')];var _0x857872=_0x2a7f48[_0x9a69('0x59')](-0x1);if(_0x857872==='/'){_0x2a7f48=_0x2a7f48[_0x9a69('0x5a')](0x0,_0x2a7f48[_0x9a69('0x5b')](_0x857872));}return rp({'method':_0x9a69('0x5c'),'uri':util[_0x9a69('0x5d')](_0x9a69('0x5e'),_0x2a7f48,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x9a69('0x5d')](_0x9a69('0x5f'),_0x428f46['apiKey']))[_0x9a69('0x60')](_0x9a69('0x61')))},'json':!![]});}})[_0x9a69('0x26')](function(_0x1e2948){if(_0x1e2948){var _0x180683=['requester',_0x9a69('0x62'),_0x9a69('0x63'),_0x9a69('0x64'),_0x9a69('0x1b'),_0x9a69('0x65'),'group',_0x9a69('0x66'),_0x9a69('0x67'),_0x9a69('0x68'),_0x9a69('0x69')];_[_0x9a69('0x6a')](_0x1e2948,function(_0x27dc6b){return _0x180683[_0x9a69('0x6b')](_0x27dc6b[_0x9a69('0x2a')])||!_0x27dc6b['default']&&_0x27dc6b[_0x9a69('0x2f')]!=='custom_text'&&_0x27dc6b[_0x9a69('0x2f')]!=='custom_dropdown';});return{'count':_0x1e2948[_0x9a69('0x47')],'rows':_[_0x9a69('0x32')](_0x1e2948,function(_0x3425ce){return{'id':_0x3425ce['name'],'name':_0x3425ce[_0x9a69('0x6c')],'custom':!_0x3425ce[_0x9a69('0x6d')],'options':_0x3425ce['choices']?_[_0x9a69('0x32')](_0x3425ce[_0x9a69('0x6e')],function(_0x29e6c4){return{'name':_[_0x9a69('0x6f')](_0x29e6c4),'value':_0x29e6c4};}):[]};})};}})['then'](respondWithResult(_0x270e6b,null))['catch'](function(_0x2abc56){var _0x5d4e64=_0xb93218[_0x9a69('0x33')][_0x9a69('0x70')]?0x1f4:_0x2abc56[_0x9a69('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5d4e64,JSON[_0x9a69('0x72')](_0x2abc56));delete _0x2abc56['name'];if(_0x5d4e64===0x191){_0x5d4e64=0x190;}_0x270e6b['status'](_0x5d4e64)[_0x9a69('0x2b')](_0xb93218['query']['test']?{'message':_0x9a69('0x73'),'statusCode':_0x2abc56[_0x9a69('0x71')]}:_0x2abc56);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 29e822b..fb2083f 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 _0x1788=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','bluebird'];(function(_0x56e6c6,_0x4486ce){var _0x21547e=function(_0x5f0730){while(--_0x5f0730){_0x56e6c6['push'](_0x56e6c6['shift']());}};_0x21547e(++_0x4486ce);}(_0x1788,0x1bc));var _0x8178=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x1788[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x8178('0x0'));var util=require(_0x8178('0x1'));var logger=require('../../config/logger')(_0x8178('0x2'));var moment=require('moment');var BPromise=require(_0x8178('0x3'));var rp=require(_0x8178('0x4'));var fs=require('fs');var path=require(_0x8178('0x5'));var rimraf=require(_0x8178('0x6'));var config=require(_0x8178('0x7'));var attributes=require(_0x8178('0x8'));var integrations=require(_0x8178('0x9'));module[_0x8178('0xa')]=function(_0x1ed1f1,_0x6f2af8){return _0x1ed1f1[_0x8178('0xb')](_0x8178('0xc'),attributes,{'tableName':_0x8178('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdabb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','../../config/logger','api'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdabb,0x1d9));var _0xbdab=function(_0x54a892,_0x1a4eeb){_0x54a892=_0x54a892-0x0;var _0x1f24f1=_0xdabb[_0x54a892];return _0x1f24f1;};'use strict';var _=require(_0xbdab('0x0'));var util=require('util');var logger=require(_0xbdab('0x1'))(_0xbdab('0x2'));var moment=require(_0xbdab('0x3'));var BPromise=require(_0xbdab('0x4'));var rp=require(_0xbdab('0x5'));var fs=require('fs');var path=require(_0xbdab('0x6'));var rimraf=require(_0xbdab('0x7'));var config=require(_0xbdab('0x8'));var attributes=require(_0xbdab('0x9'));var integrations=require(_0xbdab('0xa'));module[_0xbdab('0xb')]=function(_0x3d2b94,_0x279654){return _0x3d2b94[_0xbdab('0xc')](_0xbdab('0xd'),attributes,{'tableName':'int_freshdesk_accounts','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 ebef0a2..4f00701 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 _0x8075=['find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x411172,_0x5f3b53){var _0x489979=function(_0x295d59){while(--_0x295d59){_0x411172['push'](_0x411172['shift']());}};_0x489979(++_0x5f3b53);}(_0x8075,0xab));var _0x5807=function(_0x83432a,_0x2e971f){_0x83432a=_0x83432a-0x0;var _0x19ad69=_0x8075[_0x83432a];return _0x19ad69;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var moment=require('moment');var BPromise=require(_0x5807('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5807('0x3'));var db=require(_0x5807('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5807('0x5'))(_0x5807('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5807('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308e83,_0x1f2ddc,_0x2b84d0){return new BPromise(function(_0x1e98cf,_0x29e888){return client[_0x5807('0x8')](_0x308e83,_0x2b84d0)['then'](function(_0x47f3dc){logger[_0x5807('0x9')](_0x5807('0xa'),_0x1f2ddc,_0x5807('0xb'));logger[_0x5807('0xc')](_0x5807('0xd'),_0x1f2ddc,_0x5807('0xb'),JSON[_0x5807('0xe')](_0x47f3dc));if(_0x47f3dc[_0x5807('0xf')]){if(_0x47f3dc[_0x5807('0xf')][_0x5807('0x10')]===0x1f4){logger[_0x5807('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1f2ddc,_0x47f3dc[_0x5807('0xf')][_0x5807('0x11')]);return _0x29e888(_0x47f3dc[_0x5807('0xf')][_0x5807('0x11')]);}logger[_0x5807('0xf')](_0x5807('0xa'),_0x1f2ddc,_0x47f3dc[_0x5807('0xf')][_0x5807('0x11')]);return _0x1e98cf(_0x47f3dc[_0x5807('0xf')][_0x5807('0x11')]);}else{logger[_0x5807('0x9')](_0x5807('0xa'),_0x1f2ddc,_0x5807('0xb'));_0x1e98cf(_0x47f3dc[_0x5807('0x12')][_0x5807('0x11')]);}})[_0x5807('0x13')](function(_0x3db6ea){logger[_0x5807('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1f2ddc,_0x3db6ea);_0x29e888(_0x3db6ea);});});}exports[_0x5807('0x14')]=function(_0x24dec8){var _0x3c6121=this;return new Promise(function(_0x9c184c,_0x2015d0){return db['FreshdeskAccount'][_0x5807('0x15')]({'raw':_0x24dec8[_0x5807('0x16')]?_0x24dec8[_0x5807('0x16')][_0x5807('0x17')]===undefined?!![]:![]:!![],'where':_0x24dec8['options']?_0x24dec8[_0x5807('0x16')][_0x5807('0x18')]||null:null,'attributes':_0x24dec8[_0x5807('0x16')]?_0x24dec8[_0x5807('0x16')][_0x5807('0x19')]||null:null,'limit':_0x24dec8[_0x5807('0x16')]?_0x24dec8[_0x5807('0x16')][_0x5807('0x1a')]||null:null,'include':_0x24dec8['options']?_0x24dec8['options'][_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x24dec8[_0x5807('0x16')]['include'],function(_0x32360e){return{'model':db[_0x32360e[_0x5807('0x1d')]],'as':_0x32360e['as'],'attributes':_0x32360e['attributes'],'include':_0x32360e[_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x32360e[_0x5807('0x1b')],function(_0x50dac1){return{'model':db[_0x50dac1[_0x5807('0x1d')]],'as':_0x50dac1['as'],'attributes':_0x50dac1[_0x5807('0x19')],'include':_0x50dac1[_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x50dac1['include'],function(_0x5ccaf1){return{'model':db[_0x5ccaf1[_0x5807('0x1d')]],'as':_0x5ccaf1['as'],'attributes':_0x5ccaf1['attributes']};}):[]};}):[]};}):[]:[]})[_0x5807('0x1e')](function(_0x73ac38){logger[_0x5807('0x9')]('GetFreshdeskAccount',_0x24dec8);logger[_0x5807('0xc')]('GetFreshdeskAccount',_0x24dec8,JSON['stringify'](_0x73ac38));_0x9c184c(_0x73ac38);})[_0x5807('0x13')](function(_0x4966fa){logger[_0x5807('0xf')]('GetFreshdeskAccount',_0x4966fa[_0x5807('0x11')],_0x24dec8);_0x2015d0(_0x3c6121[_0x5807('0xf')](0x1f4,_0x4966fa[_0x5807('0x11')]));});});};exports[_0x5807('0x1f')]=function(_0x3815d4){var _0x45e977=this;return new Promise(function(_0x3bf634,_0x5cecce){return db[_0x5807('0x20')][_0x5807('0x21')]({'raw':_0x3815d4['options']?_0x3815d4['options'][_0x5807('0x17')]===undefined?!![]:![]:!![],'where':_0x3815d4[_0x5807('0x16')]?_0x3815d4[_0x5807('0x16')][_0x5807('0x18')]||null:null,'attributes':_0x3815d4[_0x5807('0x16')]?_0x3815d4[_0x5807('0x16')]['attributes']||null:null,'include':_0x3815d4[_0x5807('0x16')]?_0x3815d4[_0x5807('0x16')][_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x3815d4['options'][_0x5807('0x1b')],function(_0x49713f){return{'model':db[_0x49713f[_0x5807('0x1d')]],'as':_0x49713f['as'],'attributes':_0x49713f[_0x5807('0x19')],'include':_0x49713f[_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x49713f['include'],function(_0x3eb149){return{'model':db[_0x3eb149[_0x5807('0x1d')]],'as':_0x3eb149['as'],'attributes':_0x3eb149[_0x5807('0x19')],'include':_0x3eb149[_0x5807('0x1b')]?_[_0x5807('0x1c')](_0x3eb149[_0x5807('0x1b')],function(_0x299a33){return{'model':db[_0x299a33['model']],'as':_0x299a33['as'],'attributes':_0x299a33[_0x5807('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5807('0x1e')](function(_0x5f289c){logger[_0x5807('0x9')](_0x5807('0x1f'),_0x3815d4);logger['debug'](_0x5807('0x1f'),_0x3815d4,JSON[_0x5807('0xe')](_0x5f289c));_0x3bf634(_0x5f289c);})[_0x5807('0x13')](function(_0x4b243e){logger['error']('ShowFreshdeskAccount',_0x4b243e['message'],_0x3815d4);_0x5cecce(_0x45e977[_0x5807('0xf')](0x1f4,_0x4b243e[_0x5807('0x11')]));});});}; \ No newline at end of file +var _0x233b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','catch','FreshdeskAccount','ShowFreshdeskAccount','lodash','util','randomstring','ioredis'];(function(_0x3a7155,_0x3683f5){var _0x24b0e1=function(_0x399e7d){while(--_0x399e7d){_0x3a7155['push'](_0x3a7155['shift']());}};_0x24b0e1(++_0x3683f5);}(_0x233b,0xe3));var _0xb233=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x233b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb233('0x2'));var fs=require('fs');var Redis=require(_0xb233('0x3'));var db=require(_0xb233('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb233('0x5'))(_0xb233('0x6'));var config=require(_0xb233('0x7'));var jayson=require(_0xb233('0x8'));var client=jayson[_0xb233('0x9')][_0xb233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b5bfa,_0x248133,_0x2c41b0){return new BPromise(function(_0x315c0c,_0x393f4e){return client[_0xb233('0xb')](_0x2b5bfa,_0x2c41b0)['then'](function(_0x2ac84f){logger[_0xb233('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x248133,_0xb233('0xd'));logger[_0xb233('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x248133,_0xb233('0xd'),JSON[_0xb233('0xf')](_0x2ac84f));if(_0x2ac84f[_0xb233('0x10')]){if(_0x2ac84f[_0xb233('0x10')]['code']===0x1f4){logger[_0xb233('0x10')](_0xb233('0x11'),_0x248133,_0x2ac84f[_0xb233('0x10')][_0xb233('0x12')]);return _0x393f4e(_0x2ac84f[_0xb233('0x10')][_0xb233('0x12')]);}logger['error'](_0xb233('0x11'),_0x248133,_0x2ac84f[_0xb233('0x10')][_0xb233('0x12')]);return _0x315c0c(_0x2ac84f[_0xb233('0x10')]['message']);}else{logger[_0xb233('0xc')](_0xb233('0x11'),_0x248133,_0xb233('0xd'));_0x315c0c(_0x2ac84f['result'][_0xb233('0x12')]);}})['catch'](function(_0x1ca838){logger[_0xb233('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x248133,_0x1ca838);_0x393f4e(_0x1ca838);});});}exports['GetFreshdeskAccount']=function(_0x1efa3c){var _0x1e828b=this;return new Promise(function(_0x4c47b8,_0x4df4a0){return db['FreshdeskAccount'][_0xb233('0x13')]({'raw':_0x1efa3c[_0xb233('0x14')]?_0x1efa3c[_0xb233('0x14')][_0xb233('0x15')]===undefined?!![]:![]:!![],'where':_0x1efa3c[_0xb233('0x14')]?_0x1efa3c[_0xb233('0x14')][_0xb233('0x16')]||null:null,'attributes':_0x1efa3c[_0xb233('0x14')]?_0x1efa3c[_0xb233('0x14')][_0xb233('0x17')]||null:null,'limit':_0x1efa3c[_0xb233('0x14')]?_0x1efa3c[_0xb233('0x14')][_0xb233('0x18')]||null:null,'include':_0x1efa3c[_0xb233('0x14')]?_0x1efa3c[_0xb233('0x14')][_0xb233('0x19')]?_[_0xb233('0x1a')](_0x1efa3c[_0xb233('0x14')][_0xb233('0x19')],function(_0x26d66d){return{'model':db[_0x26d66d[_0xb233('0x1b')]],'as':_0x26d66d['as'],'attributes':_0x26d66d[_0xb233('0x17')],'include':_0x26d66d[_0xb233('0x19')]?_['map'](_0x26d66d['include'],function(_0x153f03){return{'model':db[_0x153f03[_0xb233('0x1b')]],'as':_0x153f03['as'],'attributes':_0x153f03[_0xb233('0x17')],'include':_0x153f03[_0xb233('0x19')]?_[_0xb233('0x1a')](_0x153f03[_0xb233('0x19')],function(_0x422adc){return{'model':db[_0x422adc[_0xb233('0x1b')]],'as':_0x422adc['as'],'attributes':_0x422adc[_0xb233('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb233('0x1c')](function(_0x190a7e){logger['info'](_0xb233('0x1d'),_0x1efa3c);logger[_0xb233('0xe')](_0xb233('0x1d'),_0x1efa3c,JSON[_0xb233('0xf')](_0x190a7e));_0x4c47b8(_0x190a7e);})[_0xb233('0x1e')](function(_0x2469b5){logger[_0xb233('0x10')](_0xb233('0x1d'),_0x2469b5[_0xb233('0x12')],_0x1efa3c);_0x4df4a0(_0x1e828b['error'](0x1f4,_0x2469b5[_0xb233('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x24b331){var _0x30907d=this;return new Promise(function(_0x59d478,_0x4cfb94){return db[_0xb233('0x1f')]['find']({'raw':_0x24b331[_0xb233('0x14')]?_0x24b331[_0xb233('0x14')][_0xb233('0x15')]===undefined?!![]:![]:!![],'where':_0x24b331[_0xb233('0x14')]?_0x24b331[_0xb233('0x14')][_0xb233('0x16')]||null:null,'attributes':_0x24b331['options']?_0x24b331['options']['attributes']||null:null,'include':_0x24b331[_0xb233('0x14')]?_0x24b331[_0xb233('0x14')][_0xb233('0x19')]?_[_0xb233('0x1a')](_0x24b331[_0xb233('0x14')]['include'],function(_0x226c1c){return{'model':db[_0x226c1c[_0xb233('0x1b')]],'as':_0x226c1c['as'],'attributes':_0x226c1c[_0xb233('0x17')],'include':_0x226c1c[_0xb233('0x19')]?_[_0xb233('0x1a')](_0x226c1c[_0xb233('0x19')],function(_0x19c18c){return{'model':db[_0x19c18c[_0xb233('0x1b')]],'as':_0x19c18c['as'],'attributes':_0x19c18c['attributes'],'include':_0x19c18c[_0xb233('0x19')]?_[_0xb233('0x1a')](_0x19c18c['include'],function(_0x350570){return{'model':db[_0x350570[_0xb233('0x1b')]],'as':_0x350570['as'],'attributes':_0x350570[_0xb233('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb233('0x1c')](function(_0x51bf34){logger['info']('ShowFreshdeskAccount',_0x24b331);logger[_0xb233('0xe')](_0xb233('0x20'),_0x24b331,JSON['stringify'](_0x51bf34));_0x59d478(_0x51bf34);})[_0xb233('0x1e')](function(_0x55b7e5){logger[_0xb233('0x10')](_0xb233('0x20'),_0x55b7e5[_0xb233('0x12')],_0x24b331);_0x4cfb94(_0x30907d['error'](0x1f4,_0x55b7e5['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c2bd2d8..d9ff158 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 _0x44b7=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44b7,0xe5));var _0x744b=function(_0x3024cc,_0x3b367c){_0x3024cc=_0x3024cc-0x0;var _0x4e681d=_0x44b7[_0x3024cc];return _0x4e681d;};'use strict';var multer=require(_0x744b('0x0'));var util=require(_0x744b('0x1'));var path=require(_0x744b('0x2'));var timeout=require(_0x744b('0x3'));var express=require(_0x744b('0x4'));var router=express[_0x744b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x744b('0x6'));var config=require(_0x744b('0x7'));var controller=require(_0x744b('0x8'));router[_0x744b('0x9')]('/',auth['isAuthenticated'](),controller[_0x744b('0xa')]);router[_0x744b('0x9')](_0x744b('0xb'),auth[_0x744b('0xc')](),controller['show']);router[_0x744b('0x9')](_0x744b('0xd'),auth['isAuthenticated'](),controller[_0x744b('0xe')]);router[_0x744b('0x9')](_0x744b('0xf'),auth[_0x744b('0xc')](),controller[_0x744b('0x10')]);router[_0x744b('0x9')](_0x744b('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x744b('0x9')](_0x744b('0x12'),auth['isAuthenticated'](),controller[_0x744b('0x13')]);router[_0x744b('0x14')]('/',auth[_0x744b('0xc')](),controller[_0x744b('0x15')]);router[_0x744b('0x14')](_0x744b('0x12'),auth[_0x744b('0xc')](),controller[_0x744b('0x16')]);router[_0x744b('0x17')](_0x744b('0xb'),auth[_0x744b('0xc')](),controller[_0x744b('0x18')]);router[_0x744b('0x19')](_0x744b('0xb'),auth[_0x744b('0xc')](),controller[_0x744b('0x1a')]);module[_0x744b('0x1b')]=router; \ No newline at end of file +var _0xfc73=['isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0xfc73,0x8d));var _0x3fc7=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xfc73[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var path=require(_0x3fc7('0x2'));var timeout=require('connect-timeout');var express=require(_0x3fc7('0x3'));var router=express[_0x3fc7('0x4')]();var fs_extra=require(_0x3fc7('0x5'));var auth=require(_0x3fc7('0x6'));var interaction=require(_0x3fc7('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x3fc7('0x8')]('/',auth[_0x3fc7('0x9')](),controller[_0x3fc7('0xa')]);router[_0x3fc7('0x8')](_0x3fc7('0xb'),auth[_0x3fc7('0x9')](),controller[_0x3fc7('0xc')]);router[_0x3fc7('0x8')](_0x3fc7('0xd'),auth[_0x3fc7('0x9')](),controller[_0x3fc7('0xe')]);router[_0x3fc7('0x8')]('/:id/subjects',auth[_0x3fc7('0x9')](),controller[_0x3fc7('0xf')]);router['get'](_0x3fc7('0x10'),auth[_0x3fc7('0x9')](),controller['getDescriptions']);router[_0x3fc7('0x8')](_0x3fc7('0x11'),auth[_0x3fc7('0x9')](),controller[_0x3fc7('0x12')]);router[_0x3fc7('0x13')]('/',auth[_0x3fc7('0x9')](),controller[_0x3fc7('0x14')]);router[_0x3fc7('0x13')](_0x3fc7('0x11'),auth[_0x3fc7('0x9')](),controller[_0x3fc7('0x15')]);router[_0x3fc7('0x16')](_0x3fc7('0xb'),auth[_0x3fc7('0x9')](),controller[_0x3fc7('0x17')]);router['delete']('/:id',auth[_0x3fc7('0x9')](),controller[_0x3fc7('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 95d32a9..ac3f9ff 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 _0x6e81=['STRING','sequelize','exports'];(function(_0x46b2e3,_0x55cd81){var _0x61e488=function(_0x351882){while(--_0x351882){_0x46b2e3['push'](_0x46b2e3['shift']());}};_0x61e488(++_0x55cd81);}(_0x6e81,0x85));var _0x16e8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6e81[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x16e8('0x0'));module[_0x16e8('0x1')]={'name':{'type':Sequelize[_0x16e8('0x2')]},'description':{'type':Sequelize[_0x16e8('0x2')]}}; \ No newline at end of file +var _0x1b56=['STRING','sequelize','exports'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x1b56,0x1a5));var _0x61b5=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x1b56[_0xfedc72];return _0x2c7c78;};'use strict';var Sequelize=require(_0x61b5('0x0'));module[_0x61b5('0x1')]={'name':{'type':Sequelize[_0x61b5('0x2')]},'description':{'type':Sequelize[_0x61b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 16b4174..d10e756 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 _0x15dd=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','where','filter','merge','map','includeAll','include','FreshdeskConfiguration','findAll','catch','params','options','find','body','getFields','findOne','FreshdeskField','order','sort','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4d094d,_0x199f1f){var _0x832da1=function(_0x521091){while(--_0x521091){_0x4d094d['push'](_0x4d094d['shift']());}};_0x832da1(++_0x199f1f);}(_0x15dd,0x187));var _0xd15d=function(_0x47be0b,_0x21bd47){_0x47be0b=_0x47be0b-0x0;var _0x227507=_0x15dd[_0x47be0b];return _0x227507;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd15d('0x0'));var zipdir=require(_0xd15d('0x1'));var jsonpatch=require(_0xd15d('0x2'));var rp=require(_0xd15d('0x3'));var moment=require(_0xd15d('0x4'));var BPromise=require(_0xd15d('0x5'));var Mustache=require(_0xd15d('0x6'));var util=require(_0xd15d('0x7'));var path=require('path');var sox=require(_0xd15d('0x8'));var csv=require(_0xd15d('0x9'));var ejs=require(_0xd15d('0xa'));var fs=require('fs');var fs_extra=require(_0xd15d('0xb'));var _=require(_0xd15d('0xc'));var squel=require('squel');var crypto=require(_0xd15d('0xd'));var jsforce=require(_0xd15d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd15d('0x9'));var querystring=require(_0xd15d('0xf'));var Papa=require(_0xd15d('0x10'));var Redis=require(_0xd15d('0x11'));var authService=require(_0xd15d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd15d('0x13'));var hardwareService=require(_0xd15d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd15d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd15d('0x16'));var db=require(_0xd15d('0x17'))['db'];function respondWithStatusCode(_0x184d66,_0x55b604){_0x55b604=_0x55b604||0xcc;return function(_0x15c463){if(_0x15c463){return _0x184d66['sendStatus'](_0x55b604);}return _0x184d66[_0xd15d('0x18')](_0x55b604)[_0xd15d('0x19')]();};}function respondWithResult(_0xf3de21,_0x452ef7){_0x452ef7=_0x452ef7||0xc8;return function(_0x408099){if(_0x408099){return _0xf3de21[_0xd15d('0x18')](_0x452ef7)['json'](_0x408099);}};}function respondWithFilteredResult(_0x1c2523,_0x4c7bb4){return function(_0x384ae7){if(_0x384ae7){var _0x28b6fc=typeof _0x4c7bb4[_0xd15d('0x1a')]===_0xd15d('0x1b')&&typeof _0x4c7bb4[_0xd15d('0x1c')]==='undefined';var _0x29c30=_0x384ae7[_0xd15d('0x1d')];var _0xf9eda2=_0x28b6fc?0x0:_0x4c7bb4[_0xd15d('0x1a')];var _0x348cdd=_0x28b6fc?_0x384ae7[_0xd15d('0x1d')]:_0x4c7bb4[_0xd15d('0x1a')]+_0x4c7bb4[_0xd15d('0x1c')];var _0x16ca4d;if(_0x348cdd>=_0x29c30){_0x348cdd=_0x29c30;_0x16ca4d=0xc8;}else{_0x16ca4d=0xce;}_0x1c2523[_0xd15d('0x18')](_0x16ca4d);return _0x1c2523[_0xd15d('0x1e')](_0xd15d('0x1f'),_0xf9eda2+'-'+_0x348cdd+'/'+_0x29c30)[_0xd15d('0x20')](_0x384ae7);}return null;};}function patchUpdates(_0x570d28){return function(_0x1366e0){try{jsonpatch[_0xd15d('0x21')](_0x1366e0,_0x570d28,!![]);}catch(_0x24c778){return BPromise[_0xd15d('0x22')](_0x24c778);}return _0x1366e0[_0xd15d('0x23')]();};}function saveUpdates(_0x24760a,_0x35f11b){return function(_0x3a1e3d){if(_0x3a1e3d){return _0x3a1e3d[_0xd15d('0x24')](_0x24760a)['then'](function(_0x477178){return _0x477178;});}return null;};}function removeEntity(_0xe94396,_0x420ad8){return function(_0x3182a9){if(_0x3182a9){return _0x3182a9[_0xd15d('0x25')]()[_0xd15d('0x26')](function(){_0xe94396[_0xd15d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65d944,_0x53bbcc){return function(_0x46774e){if(!_0x46774e){_0x65d944[_0xd15d('0x27')](0x194);}return _0x46774e;};}function handleError(_0x1da7d1,_0x48f828){_0x48f828=_0x48f828||0x1f4;return function(_0x285606){logger[_0xd15d('0x28')](_0x285606['stack']);if(_0x285606[_0xd15d('0x29')]){delete _0x285606[_0xd15d('0x29')];}_0x1da7d1[_0xd15d('0x18')](_0x48f828)[_0xd15d('0x2a')](_0x285606);};}exports[_0xd15d('0x2b')]=function(_0x242d88,_0x3b1fe2){var _0x56ea27={},_0x12b7b2={},_0x217d57={'count':0x0,'rows':[]};var _0x50bc1a=_['map'](db['FreshdeskConfiguration'][_0xd15d('0x2c')],function(_0x437159){return{'name':_0x437159['fieldName'],'type':_0x437159[_0xd15d('0x2d')]['key']};});_0x12b7b2[_0xd15d('0x2e')]=_['map'](_0x50bc1a,_0xd15d('0x29'));_0x12b7b2[_0xd15d('0x2f')]=_[_0xd15d('0x30')](_0x242d88['query']);_0x12b7b2[_0xd15d('0x31')]=_[_0xd15d('0x32')](_0x12b7b2[_0xd15d('0x2e')],_0x12b7b2[_0xd15d('0x2f')]);_0x56ea27[_0xd15d('0x33')]=_['intersection'](_0x12b7b2['model'],qs[_0xd15d('0x34')](_0x242d88[_0xd15d('0x2f')]['fields']));_0x56ea27[_0xd15d('0x33')]=_0x56ea27[_0xd15d('0x33')][_0xd15d('0x35')]?_0x56ea27[_0xd15d('0x33')]:_0x12b7b2['model'];if(!_0x242d88[_0xd15d('0x2f')]['hasOwnProperty']('nolimit')){_0x56ea27['limit']=qs[_0xd15d('0x1c')](_0x242d88['query'][_0xd15d('0x1c')]);_0x56ea27['offset']=qs['offset'](_0x242d88[_0xd15d('0x2f')][_0xd15d('0x1a')]);}_0x56ea27['order']=qs['sort'](_0x242d88['query']['sort']);_0x56ea27[_0xd15d('0x36')]=qs[_0xd15d('0x31')](_['pick'](_0x242d88[_0xd15d('0x2f')],_0x12b7b2[_0xd15d('0x31')]),_0x50bc1a);if(_0x242d88['query'][_0xd15d('0x37')]){_0x56ea27[_0xd15d('0x36')]=_[_0xd15d('0x38')](_0x56ea27[_0xd15d('0x36')],{'$or':_[_0xd15d('0x39')](_0x50bc1a,function(_0x5825a6){if(_0x5825a6[_0xd15d('0x2d')]!=='VIRTUAL'){var _0x383749={};_0x383749[_0x5825a6['name']]={'$like':'%'+_0x242d88['query']['filter']+'%'};return _0x383749;}})});}_0x56ea27=_[_0xd15d('0x38')]({},_0x56ea27,_0x242d88['options']);var _0x2eb879={'where':_0x56ea27['where']};return db['FreshdeskConfiguration'][_0xd15d('0x1d')](_0x2eb879)[_0xd15d('0x26')](function(_0x45cc52){_0x217d57[_0xd15d('0x1d')]=_0x45cc52;if(_0x242d88[_0xd15d('0x2f')][_0xd15d('0x3a')]){_0x56ea27[_0xd15d('0x3b')]=[{'all':!![]}];}return db[_0xd15d('0x3c')][_0xd15d('0x3d')](_0x56ea27);})['then'](function(_0x28cc38){_0x217d57['rows']=_0x28cc38;return _0x217d57;})[_0xd15d('0x26')](respondWithFilteredResult(_0x3b1fe2,_0x56ea27))[_0xd15d('0x3e')](handleError(_0x3b1fe2,null));};exports['show']=function(_0x1ade2c,_0x21ea84){var _0x4a0707={'raw':![],'where':{'id':_0x1ade2c[_0xd15d('0x3f')]['id']}},_0x130ac5={};_0x130ac5[_0xd15d('0x2e')]=_['keys'](db[_0xd15d('0x3c')][_0xd15d('0x2c')]);_0x130ac5[_0xd15d('0x2f')]=_[_0xd15d('0x30')](_0x1ade2c[_0xd15d('0x2f')]);_0x130ac5[_0xd15d('0x31')]=_[_0xd15d('0x32')](_0x130ac5[_0xd15d('0x2e')],_0x130ac5['query']);_0x4a0707[_0xd15d('0x33')]=_[_0xd15d('0x32')](_0x130ac5[_0xd15d('0x2e')],qs[_0xd15d('0x34')](_0x1ade2c[_0xd15d('0x2f')][_0xd15d('0x34')]));_0x4a0707[_0xd15d('0x33')]=_0x4a0707['attributes']['length']?_0x4a0707[_0xd15d('0x33')]:_0x130ac5[_0xd15d('0x2e')];if(_0x1ade2c[_0xd15d('0x2f')][_0xd15d('0x3a')]){_0x4a0707[_0xd15d('0x3b')]=[{'all':!![]}];}_0x4a0707=_[_0xd15d('0x38')]({},_0x4a0707,_0x1ade2c[_0xd15d('0x40')]);return db[_0xd15d('0x3c')][_0xd15d('0x41')](_0x4a0707)['then'](handleEntityNotFound(_0x21ea84,null))['then'](respondWithResult(_0x21ea84,null))['catch'](handleError(_0x21ea84,null));};exports['create']=function(_0x4f9ab9,_0x51eb04){return db['FreshdeskConfiguration']['create'](_0x4f9ab9[_0xd15d('0x42')],{})[_0xd15d('0x26')](respondWithResult(_0x51eb04,0xc9))[_0xd15d('0x3e')](handleError(_0x51eb04,null));};exports[_0xd15d('0x24')]=function(_0x9a3995,_0x38a4da){if(_0x9a3995['body']['id']){delete _0x9a3995[_0xd15d('0x42')]['id'];}return db[_0xd15d('0x3c')][_0xd15d('0x41')]({'where':{'id':_0x9a3995[_0xd15d('0x3f')]['id']}})[_0xd15d('0x26')](handleEntityNotFound(_0x38a4da,null))[_0xd15d('0x26')](saveUpdates(_0x9a3995['body'],null))[_0xd15d('0x26')](respondWithResult(_0x38a4da,null))[_0xd15d('0x3e')](handleError(_0x38a4da,null));};exports['destroy']=function(_0x2d46e3,_0x7d4968){return db[_0xd15d('0x3c')]['find']({'where':{'id':_0x2d46e3[_0xd15d('0x3f')]['id']}})[_0xd15d('0x26')](handleEntityNotFound(_0x7d4968,null))[_0xd15d('0x26')](removeEntity(_0x7d4968,null))['catch'](handleError(_0x7d4968,null));};exports[_0xd15d('0x43')]=function(_0x2f40d5,_0x4ff0f3,_0xcce9e5){var _0x5a6232={};var _0x892d92={};var _0x2c74e5;var _0x5c0125;return db[_0xd15d('0x3c')][_0xd15d('0x44')]({'where':{'id':_0x2f40d5[_0xd15d('0x3f')]['id']}})[_0xd15d('0x26')](handleEntityNotFound(_0x4ff0f3,null))['then'](function(_0x36f8b6){if(_0x36f8b6){_0x2c74e5=_0x36f8b6;_0x892d92[_0xd15d('0x2e')]=_['keys'](db[_0xd15d('0x45')][_0xd15d('0x2c')]);_0x892d92[_0xd15d('0x2f')]=_[_0xd15d('0x30')](_0x2f40d5[_0xd15d('0x2f')]);_0x892d92[_0xd15d('0x31')]=_[_0xd15d('0x32')](_0x892d92[_0xd15d('0x2e')],_0x892d92['query']);_0x5a6232[_0xd15d('0x33')]=_[_0xd15d('0x32')](_0x892d92['model'],qs[_0xd15d('0x34')](_0x2f40d5['query'][_0xd15d('0x34')]));_0x5a6232['attributes']=_0x5a6232['attributes']['length']?_0x5a6232[_0xd15d('0x33')]:_0x892d92['model'];_0x5a6232[_0xd15d('0x46')]=qs[_0xd15d('0x47')](_0x2f40d5['query'][_0xd15d('0x47')]);_0x5a6232[_0xd15d('0x36')]=qs[_0xd15d('0x31')](_[_0xd15d('0x48')](_0x2f40d5[_0xd15d('0x2f')],_0x892d92['filters']));if(_0x2f40d5[_0xd15d('0x2f')][_0xd15d('0x37')]){_0x5a6232[_0xd15d('0x36')]=_[_0xd15d('0x38')](_0x5a6232[_0xd15d('0x36')],{'$or':_[_0xd15d('0x39')](_0x5a6232[_0xd15d('0x33')],function(_0x1809f7){var _0x3019b9={};_0x3019b9[_0x1809f7]={'$like':'%'+_0x2f40d5[_0xd15d('0x2f')][_0xd15d('0x37')]+'%'};return _0x3019b9;})});}_0x5a6232=_[_0xd15d('0x38')]({},_0x5a6232,_0x2f40d5[_0xd15d('0x40')]);return _0x2c74e5[_0xd15d('0x43')](_0x5a6232);}})[_0xd15d('0x26')](function(_0x9f37c){if(_0x9f37c){_0x5c0125=_0x9f37c['length'];if(!_0x2f40d5[_0xd15d('0x2f')][_0xd15d('0x49')](_0xd15d('0x4a'))){_0x5a6232['limit']=qs['limit'](_0x2f40d5[_0xd15d('0x2f')][_0xd15d('0x1c')]);_0x5a6232[_0xd15d('0x1a')]=qs['offset'](_0x2f40d5[_0xd15d('0x2f')][_0xd15d('0x1a')]);}return _0x2c74e5[_0xd15d('0x43')](_0x5a6232);}})['then'](function(_0x1eca50){if(_0x1eca50){return _0x1eca50?{'count':_0x5c0125,'rows':_0x1eca50}:null;}})[_0xd15d('0x26')](respondWithResult(_0x4ff0f3,null))[_0xd15d('0x3e')](handleError(_0x4ff0f3,null));};exports[_0xd15d('0x4b')]=function(_0x17d4bc,_0x58fdfb,_0x1e5438){var _0xda0d20={};var _0x2556ac={};var _0x27c8e6;var _0x4bae37;return db[_0xd15d('0x3c')][_0xd15d('0x44')]({'where':{'id':_0x17d4bc[_0xd15d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x58fdfb,null))['then'](function(_0x14ba54){if(_0x14ba54){_0x27c8e6=_0x14ba54;_0x2556ac['model']=_[_0xd15d('0x30')](db[_0xd15d('0x45')]['rawAttributes']);_0x2556ac[_0xd15d('0x2f')]=_[_0xd15d('0x30')](_0x17d4bc[_0xd15d('0x2f')]);_0x2556ac[_0xd15d('0x31')]=_['intersection'](_0x2556ac[_0xd15d('0x2e')],_0x2556ac[_0xd15d('0x2f')]);_0xda0d20['attributes']=_[_0xd15d('0x32')](_0x2556ac[_0xd15d('0x2e')],qs[_0xd15d('0x34')](_0x17d4bc[_0xd15d('0x2f')][_0xd15d('0x34')]));_0xda0d20['attributes']=_0xda0d20[_0xd15d('0x33')][_0xd15d('0x35')]?_0xda0d20[_0xd15d('0x33')]:_0x2556ac[_0xd15d('0x2e')];_0xda0d20[_0xd15d('0x46')]=qs[_0xd15d('0x47')](_0x17d4bc[_0xd15d('0x2f')][_0xd15d('0x47')]);_0xda0d20['where']=qs[_0xd15d('0x31')](_[_0xd15d('0x48')](_0x17d4bc[_0xd15d('0x2f')],_0x2556ac[_0xd15d('0x31')]));if(_0x17d4bc[_0xd15d('0x2f')][_0xd15d('0x37')]){_0xda0d20[_0xd15d('0x36')]=_[_0xd15d('0x38')](_0xda0d20['where'],{'$or':_['map'](_0xda0d20[_0xd15d('0x33')],function(_0x266921){var _0x87999c={};_0x87999c[_0x266921]={'$like':'%'+_0x17d4bc[_0xd15d('0x2f')][_0xd15d('0x37')]+'%'};return _0x87999c;})});}_0xda0d20=_[_0xd15d('0x38')]({},_0xda0d20,_0x17d4bc[_0xd15d('0x40')]);return _0x27c8e6[_0xd15d('0x4b')](_0xda0d20);}})['then'](function(_0x269e20){if(_0x269e20){_0x4bae37=_0x269e20[_0xd15d('0x35')];if(!_0x17d4bc[_0xd15d('0x2f')][_0xd15d('0x49')](_0xd15d('0x4a'))){_0xda0d20['limit']=qs[_0xd15d('0x1c')](_0x17d4bc[_0xd15d('0x2f')]['limit']);_0xda0d20[_0xd15d('0x1a')]=qs['offset'](_0x17d4bc['query'][_0xd15d('0x1a')]);}return _0x27c8e6[_0xd15d('0x4b')](_0xda0d20);}})[_0xd15d('0x26')](function(_0x1f4ef5){if(_0x1f4ef5){return _0x1f4ef5?{'count':_0x4bae37,'rows':_0x1f4ef5}:null;}})[_0xd15d('0x26')](respondWithResult(_0x58fdfb,null))[_0xd15d('0x3e')](handleError(_0x58fdfb,null));};exports['getDescriptions']=function(_0x45e63e,_0x21a348,_0x4de2fa){var _0x2b5ea9={};var _0x58f8f3={};var _0x265d60;var _0x4757da;return db[_0xd15d('0x3c')]['findOne']({'where':{'id':_0x45e63e[_0xd15d('0x3f')]['id']}})[_0xd15d('0x26')](handleEntityNotFound(_0x21a348,null))[_0xd15d('0x26')](function(_0x369a18){if(_0x369a18){_0x265d60=_0x369a18;_0x58f8f3[_0xd15d('0x2e')]=_[_0xd15d('0x30')](db[_0xd15d('0x45')][_0xd15d('0x2c')]);_0x58f8f3[_0xd15d('0x2f')]=_[_0xd15d('0x30')](_0x45e63e[_0xd15d('0x2f')]);_0x58f8f3[_0xd15d('0x31')]=_[_0xd15d('0x32')](_0x58f8f3[_0xd15d('0x2e')],_0x58f8f3['query']);_0x2b5ea9['attributes']=_[_0xd15d('0x32')](_0x58f8f3[_0xd15d('0x2e')],qs['fields'](_0x45e63e[_0xd15d('0x2f')][_0xd15d('0x34')]));_0x2b5ea9[_0xd15d('0x33')]=_0x2b5ea9[_0xd15d('0x33')]['length']?_0x2b5ea9[_0xd15d('0x33')]:_0x58f8f3[_0xd15d('0x2e')];_0x2b5ea9[_0xd15d('0x46')]=qs[_0xd15d('0x47')](_0x45e63e[_0xd15d('0x2f')]['sort']);_0x2b5ea9[_0xd15d('0x36')]=qs[_0xd15d('0x31')](_[_0xd15d('0x48')](_0x45e63e[_0xd15d('0x2f')],_0x58f8f3['filters']));if(_0x45e63e[_0xd15d('0x2f')]['filter']){_0x2b5ea9[_0xd15d('0x36')]=_[_0xd15d('0x38')](_0x2b5ea9[_0xd15d('0x36')],{'$or':_[_0xd15d('0x39')](_0x2b5ea9['attributes'],function(_0x1aeb2f){var _0x50dab4={};_0x50dab4[_0x1aeb2f]={'$like':'%'+_0x45e63e['query'][_0xd15d('0x37')]+'%'};return _0x50dab4;})});}_0x2b5ea9=_[_0xd15d('0x38')]({},_0x2b5ea9,_0x45e63e[_0xd15d('0x40')]);return _0x265d60[_0xd15d('0x4c')](_0x2b5ea9);}})[_0xd15d('0x26')](function(_0x1107e6){if(_0x1107e6){_0x4757da=_0x1107e6['length'];if(!_0x45e63e[_0xd15d('0x2f')]['hasOwnProperty']('nolimit')){_0x2b5ea9[_0xd15d('0x1c')]=qs[_0xd15d('0x1c')](_0x45e63e[_0xd15d('0x2f')][_0xd15d('0x1c')]);_0x2b5ea9[_0xd15d('0x1a')]=qs[_0xd15d('0x1a')](_0x45e63e[_0xd15d('0x2f')][_0xd15d('0x1a')]);}return _0x265d60[_0xd15d('0x4c')](_0x2b5ea9);}})[_0xd15d('0x26')](function(_0x506b19){if(_0x506b19){return _0x506b19?{'count':_0x4757da,'rows':_0x506b19}:null;}})['then'](respondWithResult(_0x21a348,null))['catch'](handleError(_0x21a348,null));};exports[_0xd15d('0x4d')]=function(_0x138a52,_0xd41719,_0x4e0d5e){var _0x15ac46={};var _0x2405fe={};var _0x1eb06e;var _0x48458e;return db[_0xd15d('0x3c')][_0xd15d('0x44')]({'where':{'id':_0x138a52[_0xd15d('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd41719,null))[_0xd15d('0x26')](function(_0x240213){if(_0x240213){_0x1eb06e=_0x240213;_0x2405fe['model']=_[_0xd15d('0x30')](db['Tag'][_0xd15d('0x2c')]);_0x2405fe['query']=_['keys'](_0x138a52[_0xd15d('0x2f')]);_0x2405fe[_0xd15d('0x31')]=_[_0xd15d('0x32')](_0x2405fe[_0xd15d('0x2e')],_0x2405fe[_0xd15d('0x2f')]);_0x15ac46[_0xd15d('0x33')]=_[_0xd15d('0x32')](_0x2405fe['model'],qs['fields'](_0x138a52[_0xd15d('0x2f')][_0xd15d('0x34')]));_0x15ac46[_0xd15d('0x33')]=_0x15ac46[_0xd15d('0x33')]['length']?_0x15ac46['attributes']:_0x2405fe[_0xd15d('0x2e')];_0x15ac46[_0xd15d('0x46')]=qs[_0xd15d('0x47')](_0x138a52[_0xd15d('0x2f')][_0xd15d('0x47')]);_0x15ac46['where']=qs[_0xd15d('0x31')](_[_0xd15d('0x48')](_0x138a52[_0xd15d('0x2f')],_0x2405fe[_0xd15d('0x31')]));if(_0x138a52[_0xd15d('0x2f')][_0xd15d('0x37')]){_0x15ac46[_0xd15d('0x36')]=_[_0xd15d('0x38')](_0x15ac46[_0xd15d('0x36')],{'$or':_[_0xd15d('0x39')](_0x15ac46[_0xd15d('0x33')],function(_0x2c8637){var _0x44b71c={};_0x44b71c[_0x2c8637]={'$like':'%'+_0x138a52['query'][_0xd15d('0x37')]+'%'};return _0x44b71c;})});}_0x15ac46=_['merge']({},_0x15ac46,_0x138a52[_0xd15d('0x40')]);return _0x1eb06e[_0xd15d('0x4d')](_0x15ac46);}})[_0xd15d('0x26')](function(_0x36b6fb){if(_0x36b6fb){_0x48458e=_0x36b6fb[_0xd15d('0x35')];if(!_0x138a52[_0xd15d('0x2f')]['hasOwnProperty'](_0xd15d('0x4a'))){_0x15ac46['limit']=qs[_0xd15d('0x1c')](_0x138a52[_0xd15d('0x2f')][_0xd15d('0x1c')]);_0x15ac46[_0xd15d('0x1a')]=qs[_0xd15d('0x1a')](_0x138a52[_0xd15d('0x2f')][_0xd15d('0x1a')]);}return _0x1eb06e[_0xd15d('0x4d')](_0x15ac46);}})[_0xd15d('0x26')](function(_0x18df4e){if(_0x18df4e){return _0x18df4e?{'count':_0x48458e,'rows':_0x18df4e}:null;}})[_0xd15d('0x26')](respondWithResult(_0xd41719,null))[_0xd15d('0x3e')](handleError(_0xd41719,null));};exports[_0xd15d('0x4e')]=function(_0x4c9163,_0x694596,_0xf2d817){if(_0x4c9163['body']['id']){delete _0x4c9163[_0xd15d('0x42')]['id'];}return db[_0xd15d('0x3c')][_0xd15d('0x44')]({'where':{'id':_0x4c9163[_0xd15d('0x3f')]['id']}})[_0xd15d('0x26')](handleEntityNotFound(_0x694596,null))[_0xd15d('0x26')](function(_0x3e5374){if(_0x3e5374){return _0x3e5374['setTags'](_0x4c9163[_0xd15d('0x42')][_0xd15d('0x4f')]||[]);}return null;})[_0xd15d('0x26')](respondWithResult(_0x694596,null))[_0xd15d('0x3e')](handleError(_0x694596,null));}; \ No newline at end of file +var _0xb777=['to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','reject','save','update','then','end','error','stack','name','send','index','FreshdeskConfiguration','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','pick','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','FreshdeskField','getFields','hasOwnProperty','nolimit','getSubjects','findOne','filter','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','mustache','util','path','sox'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb777,0x95));var _0x7b77=function(_0x5b04a3,_0xfda4fd){_0x5b04a3=_0x5b04a3-0x0;var _0x1adf11=_0xb777[_0x5b04a3];return _0x1adf11;};'use strict';var emlformat=require(_0x7b77('0x0'));var rimraf=require(_0x7b77('0x1'));var zipdir=require(_0x7b77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b77('0x3'));var util=require(_0x7b77('0x4'));var path=require(_0x7b77('0x5'));var sox=require(_0x7b77('0x6'));var csv=require(_0x7b77('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b77('0x8'));var _=require('lodash');var squel=require(_0x7b77('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b77('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7b77('0xb'));var Papa=require(_0x7b77('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b77('0xd'));var as=require(_0x7b77('0xe'));var hardwareService=require(_0x7b77('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x7b77('0x10'));var config=require(_0x7b77('0x11'));var licenseUtil=require(_0x7b77('0x12'));var db=require(_0x7b77('0x13'))['db'];function respondWithStatusCode(_0x1836dd,_0x4d9289){_0x4d9289=_0x4d9289||0xcc;return function(_0x19239b){if(_0x19239b){return _0x1836dd[_0x7b77('0x14')](_0x4d9289);}return _0x1836dd[_0x7b77('0x15')](_0x4d9289)['end']();};}function respondWithResult(_0x85fd2,_0x32af2c){_0x32af2c=_0x32af2c||0xc8;return function(_0x573a44){if(_0x573a44){return _0x85fd2[_0x7b77('0x15')](_0x32af2c)['json'](_0x573a44);}};}function respondWithFilteredResult(_0x504c39,_0x46f179){return function(_0x2185de){if(_0x2185de){var _0x4f210a=typeof _0x46f179[_0x7b77('0x16')]===_0x7b77('0x17')&&typeof _0x46f179[_0x7b77('0x18')]==='undefined';var _0x1965fc=_0x2185de[_0x7b77('0x19')];var _0x5065d4=_0x4f210a?0x0:_0x46f179['offset'];var _0x24fe92=_0x4f210a?_0x2185de['count']:_0x46f179['offset']+_0x46f179[_0x7b77('0x18')];var _0xb558c4;if(_0x24fe92>=_0x1965fc){_0x24fe92=_0x1965fc;_0xb558c4=0xc8;}else{_0xb558c4=0xce;}_0x504c39[_0x7b77('0x15')](_0xb558c4);return _0x504c39[_0x7b77('0x1a')]('Content-Range',_0x5065d4+'-'+_0x24fe92+'/'+_0x1965fc)['json'](_0x2185de);}return null;};}function patchUpdates(_0x83d663){return function(_0x5971d9){try{jsonpatch['apply'](_0x5971d9,_0x83d663,!![]);}catch(_0x321c45){return BPromise[_0x7b77('0x1b')](_0x321c45);}return _0x5971d9[_0x7b77('0x1c')]();};}function saveUpdates(_0x198ecc,_0x1342d9){return function(_0x12040f){if(_0x12040f){return _0x12040f[_0x7b77('0x1d')](_0x198ecc)[_0x7b77('0x1e')](function(_0x3713b8){return _0x3713b8;});}return null;};}function removeEntity(_0x20b573,_0x31e4f6){return function(_0x27d79d){if(_0x27d79d){return _0x27d79d['destroy']()[_0x7b77('0x1e')](function(){_0x20b573[_0x7b77('0x15')](0xcc)[_0x7b77('0x1f')]();});}};}function handleEntityNotFound(_0x4e9f4d,_0x103243){return function(_0x35ef4a){if(!_0x35ef4a){_0x4e9f4d['sendStatus'](0x194);}return _0x35ef4a;};}function handleError(_0x4bea56,_0xdef8e4){_0xdef8e4=_0xdef8e4||0x1f4;return function(_0x29ae8d){logger[_0x7b77('0x20')](_0x29ae8d[_0x7b77('0x21')]);if(_0x29ae8d[_0x7b77('0x22')]){delete _0x29ae8d[_0x7b77('0x22')];}_0x4bea56[_0x7b77('0x15')](_0xdef8e4)[_0x7b77('0x23')](_0x29ae8d);};}exports[_0x7b77('0x24')]=function(_0x2dac24,_0x10ffeb){var _0x10bd88={},_0x3e18f3={},_0x49cd8e={'count':0x0,'rows':[]};var _0x158d89=_['map'](db[_0x7b77('0x25')]['rawAttributes'],function(_0x234e13){return{'name':_0x234e13['fieldName'],'type':_0x234e13[_0x7b77('0x26')][_0x7b77('0x27')]};});_0x3e18f3[_0x7b77('0x28')]=_[_0x7b77('0x29')](_0x158d89,_0x7b77('0x22'));_0x3e18f3[_0x7b77('0x2a')]=_[_0x7b77('0x2b')](_0x2dac24[_0x7b77('0x2a')]);_0x3e18f3[_0x7b77('0x2c')]=_[_0x7b77('0x2d')](_0x3e18f3[_0x7b77('0x28')],_0x3e18f3[_0x7b77('0x2a')]);_0x10bd88[_0x7b77('0x2e')]=_[_0x7b77('0x2d')](_0x3e18f3['model'],qs['fields'](_0x2dac24[_0x7b77('0x2a')]['fields']));_0x10bd88[_0x7b77('0x2e')]=_0x10bd88[_0x7b77('0x2e')][_0x7b77('0x2f')]?_0x10bd88[_0x7b77('0x2e')]:_0x3e18f3[_0x7b77('0x28')];if(!_0x2dac24[_0x7b77('0x2a')]['hasOwnProperty']('nolimit')){_0x10bd88[_0x7b77('0x18')]=qs[_0x7b77('0x18')](_0x2dac24[_0x7b77('0x2a')][_0x7b77('0x18')]);_0x10bd88[_0x7b77('0x16')]=qs['offset'](_0x2dac24[_0x7b77('0x2a')][_0x7b77('0x16')]);}_0x10bd88[_0x7b77('0x30')]=qs['sort'](_0x2dac24[_0x7b77('0x2a')][_0x7b77('0x31')]);_0x10bd88['where']=qs[_0x7b77('0x2c')](_[_0x7b77('0x32')](_0x2dac24[_0x7b77('0x2a')],_0x3e18f3[_0x7b77('0x2c')]),_0x158d89);if(_0x2dac24[_0x7b77('0x2a')]['filter']){_0x10bd88['where']=_['merge'](_0x10bd88['where'],{'$or':_[_0x7b77('0x29')](_0x158d89,function(_0x245fcf){if(_0x245fcf[_0x7b77('0x26')]!==_0x7b77('0x33')){var _0x410ffa={};_0x410ffa[_0x245fcf[_0x7b77('0x22')]]={'$like':'%'+_0x2dac24['query']['filter']+'%'};return _0x410ffa;}})});}_0x10bd88=_[_0x7b77('0x34')]({},_0x10bd88,_0x2dac24[_0x7b77('0x35')]);var _0xf660cb={'where':_0x10bd88[_0x7b77('0x36')]};return db[_0x7b77('0x25')][_0x7b77('0x19')](_0xf660cb)[_0x7b77('0x1e')](function(_0x103ce6){_0x49cd8e[_0x7b77('0x19')]=_0x103ce6;if(_0x2dac24[_0x7b77('0x2a')][_0x7b77('0x37')]){_0x10bd88[_0x7b77('0x38')]=[{'all':!![]}];}return db[_0x7b77('0x25')][_0x7b77('0x39')](_0x10bd88);})[_0x7b77('0x1e')](function(_0x49e726){_0x49cd8e[_0x7b77('0x3a')]=_0x49e726;return _0x49cd8e;})[_0x7b77('0x1e')](respondWithFilteredResult(_0x10ffeb,_0x10bd88))[_0x7b77('0x3b')](handleError(_0x10ffeb,null));};exports[_0x7b77('0x3c')]=function(_0x1dd2f4,_0x1e4fcd){var _0x100965={'raw':![],'where':{'id':_0x1dd2f4[_0x7b77('0x3d')]['id']}},_0x118e05={};_0x118e05['model']=_[_0x7b77('0x2b')](db[_0x7b77('0x25')][_0x7b77('0x3e')]);_0x118e05[_0x7b77('0x2a')]=_['keys'](_0x1dd2f4[_0x7b77('0x2a')]);_0x118e05['filters']=_['intersection'](_0x118e05[_0x7b77('0x28')],_0x118e05[_0x7b77('0x2a')]);_0x100965[_0x7b77('0x2e')]=_[_0x7b77('0x2d')](_0x118e05[_0x7b77('0x28')],qs[_0x7b77('0x3f')](_0x1dd2f4[_0x7b77('0x2a')][_0x7b77('0x3f')]));_0x100965[_0x7b77('0x2e')]=_0x100965[_0x7b77('0x2e')][_0x7b77('0x2f')]?_0x100965[_0x7b77('0x2e')]:_0x118e05[_0x7b77('0x28')];if(_0x1dd2f4['query'][_0x7b77('0x37')]){_0x100965[_0x7b77('0x38')]=[{'all':!![]}];}_0x100965=_[_0x7b77('0x34')]({},_0x100965,_0x1dd2f4[_0x7b77('0x35')]);return db['FreshdeskConfiguration'][_0x7b77('0x40')](_0x100965)['then'](handleEntityNotFound(_0x1e4fcd,null))[_0x7b77('0x1e')](respondWithResult(_0x1e4fcd,null))[_0x7b77('0x3b')](handleError(_0x1e4fcd,null));};exports[_0x7b77('0x41')]=function(_0x10daff,_0xd6b91f){return db[_0x7b77('0x25')][_0x7b77('0x41')](_0x10daff[_0x7b77('0x42')],{})['then'](respondWithResult(_0xd6b91f,0xc9))[_0x7b77('0x3b')](handleError(_0xd6b91f,null));};exports[_0x7b77('0x1d')]=function(_0x5d1d1e,_0x5b2148){if(_0x5d1d1e[_0x7b77('0x42')]['id']){delete _0x5d1d1e['body']['id'];}return db[_0x7b77('0x25')][_0x7b77('0x40')]({'where':{'id':_0x5d1d1e['params']['id']}})['then'](handleEntityNotFound(_0x5b2148,null))[_0x7b77('0x1e')](saveUpdates(_0x5d1d1e[_0x7b77('0x42')],null))['then'](respondWithResult(_0x5b2148,null))[_0x7b77('0x3b')](handleError(_0x5b2148,null));};exports['destroy']=function(_0x2efeaf,_0x5cd22f){return db[_0x7b77('0x25')][_0x7b77('0x40')]({'where':{'id':_0x2efeaf['params']['id']}})['then'](handleEntityNotFound(_0x5cd22f,null))[_0x7b77('0x1e')](removeEntity(_0x5cd22f,null))[_0x7b77('0x3b')](handleError(_0x5cd22f,null));};exports['getFields']=function(_0x24d8e3,_0x3ab4aa,_0x14203b){var _0x1639ee={};var _0x36796f={};var _0x3670a0;var _0x41ae79;return db[_0x7b77('0x25')]['findOne']({'where':{'id':_0x24d8e3[_0x7b77('0x3d')]['id']}})[_0x7b77('0x1e')](handleEntityNotFound(_0x3ab4aa,null))[_0x7b77('0x1e')](function(_0x21bc08){if(_0x21bc08){_0x3670a0=_0x21bc08;_0x36796f['model']=_[_0x7b77('0x2b')](db[_0x7b77('0x43')][_0x7b77('0x3e')]);_0x36796f[_0x7b77('0x2a')]=_[_0x7b77('0x2b')](_0x24d8e3[_0x7b77('0x2a')]);_0x36796f['filters']=_['intersection'](_0x36796f[_0x7b77('0x28')],_0x36796f[_0x7b77('0x2a')]);_0x1639ee[_0x7b77('0x2e')]=_[_0x7b77('0x2d')](_0x36796f[_0x7b77('0x28')],qs[_0x7b77('0x3f')](_0x24d8e3['query'][_0x7b77('0x3f')]));_0x1639ee['attributes']=_0x1639ee['attributes']['length']?_0x1639ee[_0x7b77('0x2e')]:_0x36796f['model'];_0x1639ee[_0x7b77('0x30')]=qs['sort'](_0x24d8e3[_0x7b77('0x2a')][_0x7b77('0x31')]);_0x1639ee[_0x7b77('0x36')]=qs[_0x7b77('0x2c')](_[_0x7b77('0x32')](_0x24d8e3[_0x7b77('0x2a')],_0x36796f[_0x7b77('0x2c')]));if(_0x24d8e3[_0x7b77('0x2a')]['filter']){_0x1639ee['where']=_[_0x7b77('0x34')](_0x1639ee['where'],{'$or':_[_0x7b77('0x29')](_0x1639ee[_0x7b77('0x2e')],function(_0xb8272d){var _0x236c00={};_0x236c00[_0xb8272d]={'$like':'%'+_0x24d8e3[_0x7b77('0x2a')]['filter']+'%'};return _0x236c00;})});}_0x1639ee=_[_0x7b77('0x34')]({},_0x1639ee,_0x24d8e3[_0x7b77('0x35')]);return _0x3670a0[_0x7b77('0x44')](_0x1639ee);}})[_0x7b77('0x1e')](function(_0x2b78eb){if(_0x2b78eb){_0x41ae79=_0x2b78eb['length'];if(!_0x24d8e3['query'][_0x7b77('0x45')](_0x7b77('0x46'))){_0x1639ee[_0x7b77('0x18')]=qs[_0x7b77('0x18')](_0x24d8e3['query'][_0x7b77('0x18')]);_0x1639ee[_0x7b77('0x16')]=qs['offset'](_0x24d8e3['query'][_0x7b77('0x16')]);}return _0x3670a0[_0x7b77('0x44')](_0x1639ee);}})[_0x7b77('0x1e')](function(_0x185f06){if(_0x185f06){return _0x185f06?{'count':_0x41ae79,'rows':_0x185f06}:null;}})[_0x7b77('0x1e')](respondWithResult(_0x3ab4aa,null))[_0x7b77('0x3b')](handleError(_0x3ab4aa,null));};exports[_0x7b77('0x47')]=function(_0x200dc1,_0x4013a1,_0x5669d3){var _0x4b1fd9={};var _0x41681a={};var _0x253900;var _0x1d782b;return db['FreshdeskConfiguration'][_0x7b77('0x48')]({'where':{'id':_0x200dc1[_0x7b77('0x3d')]['id']}})[_0x7b77('0x1e')](handleEntityNotFound(_0x4013a1,null))[_0x7b77('0x1e')](function(_0x426dc6){if(_0x426dc6){_0x253900=_0x426dc6;_0x41681a[_0x7b77('0x28')]=_[_0x7b77('0x2b')](db[_0x7b77('0x43')][_0x7b77('0x3e')]);_0x41681a['query']=_['keys'](_0x200dc1[_0x7b77('0x2a')]);_0x41681a[_0x7b77('0x2c')]=_[_0x7b77('0x2d')](_0x41681a[_0x7b77('0x28')],_0x41681a[_0x7b77('0x2a')]);_0x4b1fd9[_0x7b77('0x2e')]=_['intersection'](_0x41681a[_0x7b77('0x28')],qs[_0x7b77('0x3f')](_0x200dc1[_0x7b77('0x2a')][_0x7b77('0x3f')]));_0x4b1fd9[_0x7b77('0x2e')]=_0x4b1fd9['attributes'][_0x7b77('0x2f')]?_0x4b1fd9[_0x7b77('0x2e')]:_0x41681a['model'];_0x4b1fd9[_0x7b77('0x30')]=qs[_0x7b77('0x31')](_0x200dc1[_0x7b77('0x2a')]['sort']);_0x4b1fd9[_0x7b77('0x36')]=qs['filters'](_[_0x7b77('0x32')](_0x200dc1[_0x7b77('0x2a')],_0x41681a[_0x7b77('0x2c')]));if(_0x200dc1['query']['filter']){_0x4b1fd9[_0x7b77('0x36')]=_[_0x7b77('0x34')](_0x4b1fd9[_0x7b77('0x36')],{'$or':_[_0x7b77('0x29')](_0x4b1fd9[_0x7b77('0x2e')],function(_0x26285a){var _0x1ef81e={};_0x1ef81e[_0x26285a]={'$like':'%'+_0x200dc1[_0x7b77('0x2a')][_0x7b77('0x49')]+'%'};return _0x1ef81e;})});}_0x4b1fd9=_['merge']({},_0x4b1fd9,_0x200dc1[_0x7b77('0x35')]);return _0x253900['getSubjects'](_0x4b1fd9);}})['then'](function(_0x55eaaa){if(_0x55eaaa){_0x1d782b=_0x55eaaa[_0x7b77('0x2f')];if(!_0x200dc1[_0x7b77('0x2a')][_0x7b77('0x45')]('nolimit')){_0x4b1fd9[_0x7b77('0x18')]=qs[_0x7b77('0x18')](_0x200dc1['query']['limit']);_0x4b1fd9[_0x7b77('0x16')]=qs[_0x7b77('0x16')](_0x200dc1[_0x7b77('0x2a')][_0x7b77('0x16')]);}return _0x253900[_0x7b77('0x47')](_0x4b1fd9);}})['then'](function(_0x5110b2){if(_0x5110b2){return _0x5110b2?{'count':_0x1d782b,'rows':_0x5110b2}:null;}})[_0x7b77('0x1e')](respondWithResult(_0x4013a1,null))[_0x7b77('0x3b')](handleError(_0x4013a1,null));};exports[_0x7b77('0x4a')]=function(_0x561f92,_0x1d5954,_0xad5523){var _0x387656={};var _0x558c28={};var _0x503fb7;var _0x1b0029;return db[_0x7b77('0x25')]['findOne']({'where':{'id':_0x561f92[_0x7b77('0x3d')]['id']}})[_0x7b77('0x1e')](handleEntityNotFound(_0x1d5954,null))[_0x7b77('0x1e')](function(_0x1b996d){if(_0x1b996d){_0x503fb7=_0x1b996d;_0x558c28[_0x7b77('0x28')]=_[_0x7b77('0x2b')](db[_0x7b77('0x43')][_0x7b77('0x3e')]);_0x558c28[_0x7b77('0x2a')]=_['keys'](_0x561f92['query']);_0x558c28[_0x7b77('0x2c')]=_[_0x7b77('0x2d')](_0x558c28[_0x7b77('0x28')],_0x558c28[_0x7b77('0x2a')]);_0x387656[_0x7b77('0x2e')]=_[_0x7b77('0x2d')](_0x558c28[_0x7b77('0x28')],qs[_0x7b77('0x3f')](_0x561f92['query'][_0x7b77('0x3f')]));_0x387656['attributes']=_0x387656[_0x7b77('0x2e')][_0x7b77('0x2f')]?_0x387656[_0x7b77('0x2e')]:_0x558c28[_0x7b77('0x28')];_0x387656[_0x7b77('0x30')]=qs[_0x7b77('0x31')](_0x561f92[_0x7b77('0x2a')][_0x7b77('0x31')]);_0x387656[_0x7b77('0x36')]=qs[_0x7b77('0x2c')](_[_0x7b77('0x32')](_0x561f92[_0x7b77('0x2a')],_0x558c28['filters']));if(_0x561f92[_0x7b77('0x2a')][_0x7b77('0x49')]){_0x387656[_0x7b77('0x36')]=_['merge'](_0x387656[_0x7b77('0x36')],{'$or':_['map'](_0x387656['attributes'],function(_0x28cefd){var _0x5db674={};_0x5db674[_0x28cefd]={'$like':'%'+_0x561f92[_0x7b77('0x2a')][_0x7b77('0x49')]+'%'};return _0x5db674;})});}_0x387656=_[_0x7b77('0x34')]({},_0x387656,_0x561f92[_0x7b77('0x35')]);return _0x503fb7[_0x7b77('0x4a')](_0x387656);}})[_0x7b77('0x1e')](function(_0x55262b){if(_0x55262b){_0x1b0029=_0x55262b['length'];if(!_0x561f92[_0x7b77('0x2a')][_0x7b77('0x45')](_0x7b77('0x46'))){_0x387656[_0x7b77('0x18')]=qs[_0x7b77('0x18')](_0x561f92[_0x7b77('0x2a')][_0x7b77('0x18')]);_0x387656[_0x7b77('0x16')]=qs['offset'](_0x561f92[_0x7b77('0x2a')][_0x7b77('0x16')]);}return _0x503fb7[_0x7b77('0x4a')](_0x387656);}})[_0x7b77('0x1e')](function(_0x2a6263){if(_0x2a6263){return _0x2a6263?{'count':_0x1b0029,'rows':_0x2a6263}:null;}})['then'](respondWithResult(_0x1d5954,null))[_0x7b77('0x3b')](handleError(_0x1d5954,null));};exports[_0x7b77('0x4b')]=function(_0xee2623,_0x307c25,_0x4427be){var _0x427ba3={};var _0x14cecf={};var _0x3f7c70;var _0xb165a7;return db[_0x7b77('0x25')][_0x7b77('0x48')]({'where':{'id':_0xee2623[_0x7b77('0x3d')]['id']}})[_0x7b77('0x1e')](handleEntityNotFound(_0x307c25,null))[_0x7b77('0x1e')](function(_0x548609){if(_0x548609){_0x3f7c70=_0x548609;_0x14cecf[_0x7b77('0x28')]=_[_0x7b77('0x2b')](db['Tag'][_0x7b77('0x3e')]);_0x14cecf[_0x7b77('0x2a')]=_[_0x7b77('0x2b')](_0xee2623['query']);_0x14cecf['filters']=_[_0x7b77('0x2d')](_0x14cecf[_0x7b77('0x28')],_0x14cecf[_0x7b77('0x2a')]);_0x427ba3[_0x7b77('0x2e')]=_[_0x7b77('0x2d')](_0x14cecf['model'],qs['fields'](_0xee2623[_0x7b77('0x2a')][_0x7b77('0x3f')]));_0x427ba3[_0x7b77('0x2e')]=_0x427ba3[_0x7b77('0x2e')][_0x7b77('0x2f')]?_0x427ba3[_0x7b77('0x2e')]:_0x14cecf['model'];_0x427ba3[_0x7b77('0x30')]=qs[_0x7b77('0x31')](_0xee2623[_0x7b77('0x2a')][_0x7b77('0x31')]);_0x427ba3['where']=qs[_0x7b77('0x2c')](_[_0x7b77('0x32')](_0xee2623[_0x7b77('0x2a')],_0x14cecf[_0x7b77('0x2c')]));if(_0xee2623[_0x7b77('0x2a')][_0x7b77('0x49')]){_0x427ba3[_0x7b77('0x36')]=_[_0x7b77('0x34')](_0x427ba3[_0x7b77('0x36')],{'$or':_['map'](_0x427ba3[_0x7b77('0x2e')],function(_0x40f4e7){var _0x15aff1={};_0x15aff1[_0x40f4e7]={'$like':'%'+_0xee2623[_0x7b77('0x2a')][_0x7b77('0x49')]+'%'};return _0x15aff1;})});}_0x427ba3=_['merge']({},_0x427ba3,_0xee2623[_0x7b77('0x35')]);return _0x3f7c70[_0x7b77('0x4b')](_0x427ba3);}})[_0x7b77('0x1e')](function(_0x3c3725){if(_0x3c3725){_0xb165a7=_0x3c3725[_0x7b77('0x2f')];if(!_0xee2623[_0x7b77('0x2a')][_0x7b77('0x45')](_0x7b77('0x46'))){_0x427ba3[_0x7b77('0x18')]=qs[_0x7b77('0x18')](_0xee2623[_0x7b77('0x2a')][_0x7b77('0x18')]);_0x427ba3[_0x7b77('0x16')]=qs[_0x7b77('0x16')](_0xee2623[_0x7b77('0x2a')]['offset']);}return _0x3f7c70['getTags'](_0x427ba3);}})['then'](function(_0x95cc7b){if(_0x95cc7b){return _0x95cc7b?{'count':_0xb165a7,'rows':_0x95cc7b}:null;}})[_0x7b77('0x1e')](respondWithResult(_0x307c25,null))[_0x7b77('0x3b')](handleError(_0x307c25,null));};exports[_0x7b77('0x4c')]=function(_0x560aed,_0x4450b7,_0x4bc055){if(_0x560aed[_0x7b77('0x42')]['id']){delete _0x560aed['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x560aed['params']['id']}})['then'](handleEntityNotFound(_0x4450b7,null))[_0x7b77('0x1e')](function(_0x492004){if(_0x492004){return _0x492004['setTags'](_0x560aed[_0x7b77('0x42')][_0x7b77('0x4d')]||[]);}return null;})[_0x7b77('0x1e')](respondWithResult(_0x4450b7,null))['catch'](handleError(_0x4450b7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1f7b39e..21860e8 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 _0x888a=['bluebird','request-promise','path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','moment'];(function(_0x5c791f,_0x258b93){var _0x2a3aa2=function(_0x3004cf){while(--_0x3004cf){_0x5c791f['push'](_0x5c791f['shift']());}};_0x2a3aa2(++_0x258b93);}(_0x888a,0xd9));var _0xa888=function(_0x45aa15,_0x3a892c){_0x45aa15=_0x45aa15-0x0;var _0x370ef2=_0x888a[_0x45aa15];return _0x370ef2;};'use strict';var _=require('lodash');var util=require(_0xa888('0x0'));var logger=require('../../config/logger')(_0xa888('0x1'));var moment=require(_0xa888('0x2'));var BPromise=require(_0xa888('0x3'));var rp=require(_0xa888('0x4'));var fs=require('fs');var path=require(_0xa888('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa888('0x6'));module[_0xa888('0x7')]=function(_0x2c2dc9,_0x3cfeec){return _0x2c2dc9[_0xa888('0x8')](_0xa888('0x9'),attributes,{'tableName':_0xa888('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x505b=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x505b,0x11e));var _0xb505=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x505b[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xb505('0x0'));var util=require(_0xb505('0x1'));var logger=require(_0xb505('0x2'))('api');var moment=require(_0xb505('0x3'));var BPromise=require(_0xb505('0x4'));var rp=require(_0xb505('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb505('0x6'));var config=require(_0xb505('0x7'));var attributes=require(_0xb505('0x8'));module['exports']=function(_0x39c482,_0x2f2bba){return _0x39c482[_0xb505('0x9')](_0xb505('0xa'),attributes,{'tableName':_0xb505('0xb'),'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 375af41..caec30c 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 _0x93d5=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x308f51,_0x32466e){var _0x8e1b3e=function(_0x1f00c9){while(--_0x1f00c9){_0x308f51['push'](_0x308f51['shift']());}};_0x8e1b3e(++_0x32466e);}(_0x93d5,0x147));var _0x593d=function(_0x1ab7ed,_0x4dbcef){_0x1ab7ed=_0x1ab7ed-0x0;var _0x55efd9=_0x93d5[_0x1ab7ed];return _0x55efd9;};'use strict';var _=require(_0x593d('0x0'));var util=require(_0x593d('0x1'));var moment=require(_0x593d('0x2'));var BPromise=require(_0x593d('0x3'));var rs=require(_0x593d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x593d('0x5'));var logger=require(_0x593d('0x6'))('rpc');var config=require(_0x593d('0x7'));var jayson=require(_0x593d('0x8'));var client=jayson[_0x593d('0x9')][_0x593d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19f9e1,_0x46a6c9,_0x3bfdc5){return new BPromise(function(_0x359c30,_0x144297){return client['request'](_0x19f9e1,_0x3bfdc5)[_0x593d('0xb')](function(_0x3781ba){logger['info'](_0x593d('0xc'),_0x46a6c9,_0x593d('0xd'));logger[_0x593d('0xe')](_0x593d('0xf'),_0x46a6c9,_0x593d('0xd'),JSON[_0x593d('0x10')](_0x3781ba));if(_0x3781ba['error']){if(_0x3781ba[_0x593d('0x11')]['code']===0x1f4){logger[_0x593d('0x11')](_0x593d('0xc'),_0x46a6c9,_0x3781ba['error'][_0x593d('0x12')]);return _0x144297(_0x3781ba[_0x593d('0x11')][_0x593d('0x12')]);}logger[_0x593d('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x46a6c9,_0x3781ba[_0x593d('0x11')][_0x593d('0x12')]);return _0x359c30(_0x3781ba[_0x593d('0x11')][_0x593d('0x12')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x46a6c9,'request\x20sent');_0x359c30(_0x3781ba['result'][_0x593d('0x12')]);}})['catch'](function(_0x495a34){logger[_0x593d('0x11')](_0x593d('0xc'),_0x46a6c9,_0x495a34);_0x144297(_0x495a34);});});} \ No newline at end of file +var _0xabad=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x430469,_0x20e783){var _0x1ca55e=function(_0x42e6e6){while(--_0x42e6e6){_0x430469['push'](_0x430469['shift']());}};_0x1ca55e(++_0x20e783);}(_0xabad,0x12f));var _0xdaba=function(_0x3da312,_0x391ccd){_0x3da312=_0x3da312-0x0;var _0x28fb08=_0xabad[_0x3da312];return _0x28fb08;};'use strict';var _=require(_0xdaba('0x0'));var util=require(_0xdaba('0x1'));var moment=require(_0xdaba('0x2'));var BPromise=require(_0xdaba('0x3'));var rs=require(_0xdaba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x5'))['db'];var utils=require(_0xdaba('0x6'));var logger=require(_0xdaba('0x7'))(_0xdaba('0x8'));var config=require(_0xdaba('0x9'));var jayson=require(_0xdaba('0xa'));var client=jayson[_0xdaba('0xb')][_0xdaba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb1dfd4,_0x42ec98,_0x32030d){return new BPromise(function(_0x141cb0,_0x2c4477){return client[_0xdaba('0xd')](_0xb1dfd4,_0x32030d)[_0xdaba('0xe')](function(_0x3bb424){logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x42ec98,_0xdaba('0x11'));logger[_0xdaba('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42ec98,_0xdaba('0x11'),JSON[_0xdaba('0x13')](_0x3bb424));if(_0x3bb424['error']){if(_0x3bb424['error'][_0xdaba('0x14')]===0x1f4){logger['error'](_0xdaba('0x10'),_0x42ec98,_0x3bb424[_0xdaba('0x15')]['message']);return _0x2c4477(_0x3bb424[_0xdaba('0x15')][_0xdaba('0x16')]);}logger[_0xdaba('0x15')](_0xdaba('0x10'),_0x42ec98,_0x3bb424['error'][_0xdaba('0x16')]);return _0x141cb0(_0x3bb424['error'][_0xdaba('0x16')]);}else{logger['info'](_0xdaba('0x10'),_0x42ec98,_0xdaba('0x11'));_0x141cb0(_0x3bb424['result'][_0xdaba('0x16')]);}})[_0xdaba('0x17')](function(_0x1ead01){logger['error'](_0xdaba('0x10'),_0x42ec98,_0x1ead01);_0x2c4477(_0x1ead01);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c428782..e0d742a 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 _0xfa18=['../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa18,0x19c));var _0x8fa1=function(_0x229d76,_0x244808){_0x229d76=_0x229d76-0x0;var _0xcd6180=_0xfa18[_0x229d76];return _0xcd6180;};'use strict';var multer=require(_0x8fa1('0x0'));var util=require(_0x8fa1('0x1'));var path=require(_0x8fa1('0x2'));var timeout=require('connect-timeout');var express=require(_0x8fa1('0x3'));var router=express[_0x8fa1('0x4')]();var fs_extra=require(_0x8fa1('0x5'));var auth=require(_0x8fa1('0x6'));var interaction=require(_0x8fa1('0x7'));var config=require('../../config/environment');var controller=require(_0x8fa1('0x8'));router[_0x8fa1('0x9')]('/',auth[_0x8fa1('0xa')](),controller[_0x8fa1('0xb')]);router[_0x8fa1('0x9')]('/:id',auth[_0x8fa1('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8fa1('0xc')]);router[_0x8fa1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x8fa1('0xe')]);router[_0x8fa1('0xf')](_0x8fa1('0x10'),auth[_0x8fa1('0xa')](),controller[_0x8fa1('0x11')]);module[_0x8fa1('0x12')]=router; \ No newline at end of file +var _0x88fb=['/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x53fcb5,_0x32d66b){var _0x503f06=function(_0xca0354){while(--_0xca0354){_0x53fcb5['push'](_0x53fcb5['shift']());}};_0x503f06(++_0x32d66b);}(_0x88fb,0x198));var _0xb88f=function(_0x319ab2,_0xaa1204){_0x319ab2=_0x319ab2-0x0;var _0x11c590=_0x88fb[_0x319ab2];return _0x11c590;};'use strict';var multer=require(_0xb88f('0x0'));var util=require('util');var path=require(_0xb88f('0x1'));var timeout=require(_0xb88f('0x2'));var express=require(_0xb88f('0x3'));var router=express[_0xb88f('0x4')]();var fs_extra=require(_0xb88f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb88f('0x6'));var config=require(_0xb88f('0x7'));var controller=require(_0xb88f('0x8'));router[_0xb88f('0x9')]('/',auth[_0xb88f('0xa')](),controller[_0xb88f('0xb')]);router[_0xb88f('0x9')](_0xb88f('0xc'),auth[_0xb88f('0xa')](),controller[_0xb88f('0xd')]);router[_0xb88f('0xe')]('/',auth['isAuthenticated'](),controller[_0xb88f('0xf')]);router[_0xb88f('0x10')](_0xb88f('0xc'),auth[_0xb88f('0xa')](),controller['update']);router[_0xb88f('0x11')](_0xb88f('0xc'),auth[_0xb88f('0xa')](),controller[_0xb88f('0x12')]);module[_0xb88f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 64fa4d1..65ca1c4 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 _0x0b3c=['sequelize','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x3ca115,_0x286520){var _0x1538bc=function(_0x2f891b){while(--_0x2f891b){_0x3ca115['push'](_0x3ca115['shift']());}};_0x1538bc(++_0x286520);}(_0x0b3c,0x171));var _0xc0b3=function(_0x9584a9,_0x413cec){_0x9584a9=_0x9584a9-0x0;var _0x2b3b6e=_0x0b3c[_0x9584a9];return _0x2b3b6e;};'use strict';var Sequelize=require(_0xc0b3('0x0'));module['exports']={'type':{'type':Sequelize[_0xc0b3('0x1')]('string',_0xc0b3('0x2'),_0xc0b3('0x3'),_0xc0b3('0x4'),_0xc0b3('0x5')),'defaultValue':_0xc0b3('0x6')},'content':{'type':Sequelize[_0xc0b3('0x7')]},'key':{'type':Sequelize[_0xc0b3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc0b3('0x6'),'variable',_0xc0b3('0x3'))},'keyContent':{'type':Sequelize[_0xc0b3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc0b3('0x7')]},'customField':{'type':Sequelize[_0xc0b3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc0b3('0x7')]}}; \ No newline at end of file +var _0xc92b=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xc92b,0x183));var _0xbc92=function(_0x5e8610,_0x2025d5){_0x5e8610=_0x5e8610-0x0;var _0x669eac=_0xc92b[_0x5e8610];return _0x669eac;};'use strict';var Sequelize=require(_0xbc92('0x0'));module[_0xbc92('0x1')]={'type':{'type':Sequelize[_0xbc92('0x2')](_0xbc92('0x3'),_0xbc92('0x4'),_0xbc92('0x5'),_0xbc92('0x6'),'picklist'),'defaultValue':_0xbc92('0x3')},'content':{'type':Sequelize[_0xbc92('0x7')]},'key':{'type':Sequelize[_0xbc92('0x7')]},'keyType':{'type':Sequelize[_0xbc92('0x2')](_0xbc92('0x3'),_0xbc92('0x4'),_0xbc92('0x5'))},'keyContent':{'type':Sequelize[_0xbc92('0x7')]},'idField':{'type':Sequelize[_0xbc92('0x7')]},'nameField':{'type':Sequelize[_0xbc92('0x7')]},'customField':{'type':Sequelize[_0xbc92('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8ff9c61..a6db36e 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 _0x9b87=['sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','options','FreshdeskField','includeAll','include','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x9b87,0x8e));var _0x79b8=function(_0x11e008,_0x54404e){_0x11e008=_0x11e008-0x0;var _0x2d886b=_0x9b87[_0x11e008];return _0x2d886b;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];function respondWithStatusCode(_0x21ad20,_0x33227b){_0x33227b=_0x33227b||0xcc;return function(_0x41095c){if(_0x41095c){return _0x21ad20[_0x79b8('0x1a')](_0x33227b);}return _0x21ad20[_0x79b8('0x1b')](_0x33227b)[_0x79b8('0x1c')]();};}function respondWithResult(_0x43ec09,_0x59e229){_0x59e229=_0x59e229||0xc8;return function(_0x150fb7){if(_0x150fb7){return _0x43ec09['status'](_0x59e229)['json'](_0x150fb7);}};}function respondWithFilteredResult(_0x3142e9,_0x21aae0){return function(_0x57a248){if(_0x57a248){var _0x5ddab5=typeof _0x21aae0[_0x79b8('0x1d')]==='undefined'&&typeof _0x21aae0['limit']===_0x79b8('0x1e');var _0x24c02f=_0x57a248[_0x79b8('0x1f')];var _0x2ae2d5=_0x5ddab5?0x0:_0x21aae0[_0x79b8('0x1d')];var _0x23d771=_0x5ddab5?_0x57a248['count']:_0x21aae0[_0x79b8('0x1d')]+_0x21aae0['limit'];var _0x53d386;if(_0x23d771>=_0x24c02f){_0x23d771=_0x24c02f;_0x53d386=0xc8;}else{_0x53d386=0xce;}_0x3142e9[_0x79b8('0x1b')](_0x53d386);return _0x3142e9[_0x79b8('0x20')](_0x79b8('0x21'),_0x2ae2d5+'-'+_0x23d771+'/'+_0x24c02f)[_0x79b8('0x22')](_0x57a248);}return null;};}function patchUpdates(_0x1e24cf){return function(_0x1e7507){try{jsonpatch[_0x79b8('0x23')](_0x1e7507,_0x1e24cf,!![]);}catch(_0x261c48){return BPromise[_0x79b8('0x24')](_0x261c48);}return _0x1e7507['save']();};}function saveUpdates(_0x3e9d83,_0x255207){return function(_0x4dbfcf){if(_0x4dbfcf){return _0x4dbfcf[_0x79b8('0x25')](_0x3e9d83)[_0x79b8('0x26')](function(_0x54c605){return _0x54c605;});}return null;};}function removeEntity(_0x28be4b,_0x4f543f){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228[_0x79b8('0x27')]()[_0x79b8('0x26')](function(){_0x28be4b[_0x79b8('0x1b')](0xcc)[_0x79b8('0x1c')]();});}};}function handleEntityNotFound(_0x9deb6c,_0x4cd38b){return function(_0x35db24){if(!_0x35db24){_0x9deb6c[_0x79b8('0x1a')](0x194);}return _0x35db24;};}function handleError(_0x1e84f3,_0x3ba5ac){_0x3ba5ac=_0x3ba5ac||0x1f4;return function(_0x4bbbf8){logger[_0x79b8('0x28')](_0x4bbbf8[_0x79b8('0x29')]);if(_0x4bbbf8[_0x79b8('0x2a')]){delete _0x4bbbf8['name'];}_0x1e84f3[_0x79b8('0x1b')](_0x3ba5ac)[_0x79b8('0x2b')](_0x4bbbf8);};}exports[_0x79b8('0x2c')]=function(_0x2942e9,_0x3662aa){var _0x23483f={},_0x4f51d1={},_0x434ecd={'count':0x0,'rows':[]};var _0x5a24fd=_[_0x79b8('0x2d')](db['FreshdeskField'][_0x79b8('0x2e')],function(_0x1090d2){return{'name':_0x1090d2[_0x79b8('0x2f')],'type':_0x1090d2['type'][_0x79b8('0x30')]};});_0x4f51d1[_0x79b8('0x31')]=_[_0x79b8('0x2d')](_0x5a24fd,_0x79b8('0x2a'));_0x4f51d1['query']=_[_0x79b8('0x32')](_0x2942e9['query']);_0x4f51d1['filters']=_[_0x79b8('0x33')](_0x4f51d1[_0x79b8('0x31')],_0x4f51d1['query']);_0x23483f[_0x79b8('0x34')]=_['intersection'](_0x4f51d1['model'],qs[_0x79b8('0x35')](_0x2942e9['query'][_0x79b8('0x35')]));_0x23483f[_0x79b8('0x34')]=_0x23483f['attributes'][_0x79b8('0x36')]?_0x23483f[_0x79b8('0x34')]:_0x4f51d1[_0x79b8('0x31')];if(!_0x2942e9[_0x79b8('0x37')][_0x79b8('0x38')](_0x79b8('0x39'))){_0x23483f['limit']=qs[_0x79b8('0x3a')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3a')]);_0x23483f[_0x79b8('0x1d')]=qs[_0x79b8('0x1d')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x1d')]);}_0x23483f[_0x79b8('0x3b')]=qs[_0x79b8('0x3c')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3c')]);_0x23483f['where']=qs[_0x79b8('0x3d')](_[_0x79b8('0x3e')](_0x2942e9[_0x79b8('0x37')],_0x4f51d1['filters']),_0x5a24fd);if(_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3f')]){_0x23483f[_0x79b8('0x40')]=_[_0x79b8('0x41')](_0x23483f[_0x79b8('0x40')],{'$or':_[_0x79b8('0x2d')](_0x5a24fd,function(_0x4b6248){if(_0x4b6248[_0x79b8('0x42')]!=='VIRTUAL'){var _0x512d04={};_0x512d04[_0x4b6248[_0x79b8('0x2a')]]={'$like':'%'+_0x2942e9['query']['filter']+'%'};return _0x512d04;}})});}_0x23483f=_[_0x79b8('0x41')]({},_0x23483f,_0x2942e9[_0x79b8('0x43')]);var _0x422c56={'where':_0x23483f[_0x79b8('0x40')]};return db[_0x79b8('0x44')][_0x79b8('0x1f')](_0x422c56)[_0x79b8('0x26')](function(_0x2aac60){_0x434ecd[_0x79b8('0x1f')]=_0x2aac60;if(_0x2942e9[_0x79b8('0x37')][_0x79b8('0x45')]){_0x23483f[_0x79b8('0x46')]=[{'all':!![]}];}return db[_0x79b8('0x44')]['findAll'](_0x23483f);})[_0x79b8('0x26')](function(_0x13b041){_0x434ecd['rows']=_0x13b041;return _0x434ecd;})[_0x79b8('0x26')](respondWithFilteredResult(_0x3662aa,_0x23483f))[_0x79b8('0x47')](handleError(_0x3662aa,null));};exports['show']=function(_0x17dd9e,_0x62a011){var _0x2ddad8={'raw':!![],'where':{'id':_0x17dd9e[_0x79b8('0x48')]['id']}},_0x28d4e4={};_0x28d4e4[_0x79b8('0x31')]=_[_0x79b8('0x32')](db[_0x79b8('0x44')][_0x79b8('0x2e')]);_0x28d4e4[_0x79b8('0x37')]=_[_0x79b8('0x32')](_0x17dd9e[_0x79b8('0x37')]);_0x28d4e4['filters']=_['intersection'](_0x28d4e4[_0x79b8('0x31')],_0x28d4e4[_0x79b8('0x37')]);_0x2ddad8[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x28d4e4['model'],qs[_0x79b8('0x35')](_0x17dd9e[_0x79b8('0x37')][_0x79b8('0x35')]));_0x2ddad8[_0x79b8('0x34')]=_0x2ddad8['attributes'][_0x79b8('0x36')]?_0x2ddad8[_0x79b8('0x34')]:_0x28d4e4[_0x79b8('0x31')];if(_0x17dd9e[_0x79b8('0x37')]['includeAll']){_0x2ddad8[_0x79b8('0x46')]=[{'all':!![]}];}_0x2ddad8=_[_0x79b8('0x41')]({},_0x2ddad8,_0x17dd9e[_0x79b8('0x43')]);return db[_0x79b8('0x44')][_0x79b8('0x49')](_0x2ddad8)[_0x79b8('0x26')](handleEntityNotFound(_0x62a011,null))['then'](respondWithResult(_0x62a011,null))[_0x79b8('0x47')](handleError(_0x62a011,null));};exports[_0x79b8('0x4a')]=function(_0x330051,_0xc89e93){return db['FreshdeskField']['create'](_0x330051[_0x79b8('0x4b')],{})[_0x79b8('0x26')](respondWithResult(_0xc89e93,0xc9))[_0x79b8('0x47')](handleError(_0xc89e93,null));};exports[_0x79b8('0x25')]=function(_0x32e7ea,_0x19272d){if(_0x32e7ea[_0x79b8('0x4b')]['id']){delete _0x32e7ea[_0x79b8('0x4b')]['id'];}return db[_0x79b8('0x44')]['find']({'where':{'id':_0x32e7ea[_0x79b8('0x48')]['id']}})[_0x79b8('0x26')](handleEntityNotFound(_0x19272d,null))[_0x79b8('0x26')](saveUpdates(_0x32e7ea['body'],null))[_0x79b8('0x26')](respondWithResult(_0x19272d,null))['catch'](handleError(_0x19272d,null));};exports['destroy']=function(_0x24ebb2,_0x252c2c){return db[_0x79b8('0x44')][_0x79b8('0x49')]({'where':{'id':_0x24ebb2['params']['id']}})['then'](handleEntityNotFound(_0x252c2c,null))[_0x79b8('0x26')](removeEntity(_0x252c2c,null))[_0x79b8('0x47')](handleError(_0x252c2c,null));}; \ No newline at end of file +var _0x0713=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','keys','find','catch','body','zip-dir','fast-json-patch'];(function(_0x5a14b6,_0xa71c7e){var _0x26bd86=function(_0x109087){while(--_0x109087){_0x5a14b6['push'](_0x5a14b6['shift']());}};_0x26bd86(++_0xa71c7e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=_['map'](db[_0x3071('0x2d')][_0x3071('0x2e')],function(_0x6ddf96){return{'name':_0x6ddf96[_0x3071('0x2f')],'type':_0x6ddf96[_0x3071('0x30')][_0x3071('0x31')]};});_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x5aba96,'name');_0x292205['query']=_['keys'](_0x177b5f[_0x3071('0x34')]);_0x292205[_0x3071('0x35')]=_['intersection'](_0x292205[_0x3071('0x32')],_0x292205[_0x3071('0x34')]);_0x32f1b4[_0x3071('0x36')]=_[_0x3071('0x37')](_0x292205['model'],qs[_0x3071('0x38')](_0x177b5f[_0x3071('0x34')][_0x3071('0x38')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x39')]?_0x32f1b4[_0x3071('0x36')]:_0x292205[_0x3071('0x32')];if(!_0x177b5f['query'][_0x3071('0x3a')]('nolimit')){_0x32f1b4['limit']=qs[_0x3071('0x20')](_0x177b5f[_0x3071('0x34')]['limit']);_0x32f1b4[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x177b5f[_0x3071('0x34')][_0x3071('0x1e')]);}_0x32f1b4[_0x3071('0x3b')]=qs[_0x3071('0x3c')](_0x177b5f['query'][_0x3071('0x3c')]);_0x32f1b4[_0x3071('0x3d')]=qs['filters'](_[_0x3071('0x3e')](_0x177b5f['query'],_0x292205[_0x3071('0x35')]),_0x5aba96);if(_0x177b5f[_0x3071('0x34')]['filter']){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4[_0x3071('0x3d')],{'$or':_[_0x3071('0x33')](_0x5aba96,function(_0x55afa6){if(_0x55afa6[_0x3071('0x30')]!=='VIRTUAL'){var _0x1ac90a={};_0x1ac90a[_0x55afa6['name']]={'$like':'%'+_0x177b5f[_0x3071('0x34')][_0x3071('0x40')]+'%'};return _0x1ac90a;}})});}_0x32f1b4=_[_0x3071('0x3f')]({},_0x32f1b4,_0x177b5f[_0x3071('0x41')]);var _0x30ab68={'where':_0x32f1b4['where']};return db['FreshdeskField'][_0x3071('0x21')](_0x30ab68)[_0x3071('0x27')](function(_0x1455be){_0x254fc8[_0x3071('0x21')]=_0x1455be;if(_0x177b5f['query'][_0x3071('0x42')]){_0x32f1b4[_0x3071('0x43')]=[{'all':!![]}];}return db[_0x3071('0x2d')][_0x3071('0x44')](_0x32f1b4);})[_0x3071('0x27')](function(_0xb9a4b8){_0x254fc8['rows']=_0xb9a4b8;return _0x254fc8;})[_0x3071('0x27')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))['catch'](handleError(_0x3921a1,null));};exports['show']=function(_0x4dc9d1,_0x47ceaf){var _0x2992e6={'raw':!![],'where':{'id':_0x4dc9d1[_0x3071('0x45')]['id']}},_0x1be8b6={};_0x1be8b6[_0x3071('0x32')]=_[_0x3071('0x46')](db[_0x3071('0x2d')][_0x3071('0x2e')]);_0x1be8b6[_0x3071('0x34')]=_['keys'](_0x4dc9d1[_0x3071('0x34')]);_0x1be8b6[_0x3071('0x35')]=_[_0x3071('0x37')](_0x1be8b6[_0x3071('0x32')],_0x1be8b6[_0x3071('0x34')]);_0x2992e6['attributes']=_['intersection'](_0x1be8b6[_0x3071('0x32')],qs[_0x3071('0x38')](_0x4dc9d1[_0x3071('0x34')][_0x3071('0x38')]));_0x2992e6[_0x3071('0x36')]=_0x2992e6['attributes'][_0x3071('0x39')]?_0x2992e6['attributes']:_0x1be8b6[_0x3071('0x32')];if(_0x4dc9d1['query']['includeAll']){_0x2992e6[_0x3071('0x43')]=[{'all':!![]}];}_0x2992e6=_['merge']({},_0x2992e6,_0x4dc9d1[_0x3071('0x41')]);return db['FreshdeskField'][_0x3071('0x47')](_0x2992e6)[_0x3071('0x27')](handleEntityNotFound(_0x47ceaf,null))[_0x3071('0x27')](respondWithResult(_0x47ceaf,null))[_0x3071('0x48')](handleError(_0x47ceaf,null));};exports['create']=function(_0x2d70bf,_0x575c12){return db[_0x3071('0x2d')]['create'](_0x2d70bf[_0x3071('0x49')],{})[_0x3071('0x27')](respondWithResult(_0x575c12,0xc9))['catch'](handleError(_0x575c12,null));};exports[_0x3071('0x26')]=function(_0x117e73,_0x224a70){if(_0x117e73[_0x3071('0x49')]['id']){delete _0x117e73[_0x3071('0x49')]['id'];}return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x117e73['params']['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x224a70,null))[_0x3071('0x27')](saveUpdates(_0x117e73[_0x3071('0x49')],null))[_0x3071('0x27')](respondWithResult(_0x224a70,null))['catch'](handleError(_0x224a70,null));};exports[_0x3071('0x28')]=function(_0x2aea37,_0x1b832e){return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x2aea37[_0x3071('0x45')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1b832e,null))[_0x3071('0x27')](removeEntity(_0x1b832e,null))[_0x3071('0x48')](handleError(_0x1b832e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f6150e9..85b844e 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 _0xa2d5=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0xa2d5,0xc4));var _0x5a2d=function(_0xa38c75,_0x2d16d8){_0xa38c75=_0xa38c75-0x0;var _0x179fef=_0xa2d5[_0xa38c75];return _0x179fef;};'use strict';var _=require(_0x5a2d('0x0'));var util=require(_0x5a2d('0x1'));var logger=require(_0x5a2d('0x2'))(_0x5a2d('0x3'));var moment=require(_0x5a2d('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a2d('0x5'));var fs=require('fs');var path=require(_0x5a2d('0x6'));var rimraf=require(_0x5a2d('0x7'));var config=require(_0x5a2d('0x8'));var attributes=require(_0x5a2d('0x9'));module[_0x5a2d('0xa')]=function(_0x5d6f00,_0x385c77){return _0x5d6f00[_0x5a2d('0xb')](_0x5a2d('0xc'),attributes,{'tableName':_0x5a2d('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x5a2d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cb4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util'];(function(_0x363dac,_0x300b7e){var _0x53de00=function(_0x1d0d45){while(--_0x1d0d45){_0x363dac['push'](_0x363dac['shift']());}};_0x53de00(++_0x300b7e);}(_0x2cb4,0x13e));var _0x42cb=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x2cb4[_0x231a47];return _0x48d7c9;};'use strict';var _=require(_0x42cb('0x0'));var util=require(_0x42cb('0x1'));var logger=require(_0x42cb('0x2'))(_0x42cb('0x3'));var moment=require(_0x42cb('0x4'));var BPromise=require(_0x42cb('0x5'));var rp=require(_0x42cb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42cb('0x7'));var config=require(_0x42cb('0x8'));var attributes=require(_0x42cb('0x9'));module[_0x42cb('0xa')]=function(_0x1a3c33,_0x492a40){return _0x1a3c33[_0x42cb('0xb')](_0x42cb('0xc'),attributes,{'tableName':_0x42cb('0xd'),'paranoid':![],'indexes':[{'name':_0x42cb('0xe'),'fields':['idField',_0x42cb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 70820d1..646a3b1 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 _0xbc02=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x347051,_0x21348b){var _0x2561df=function(_0x6fe766){while(--_0x6fe766){_0x347051['push'](_0x347051['shift']());}};_0x2561df(++_0x21348b);}(_0xbc02,0x82));var _0x2bc0=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0xbc02[_0x170cbb];return _0x39fae4;};'use strict';var _=require('lodash');var util=require(_0x2bc0('0x0'));var moment=require(_0x2bc0('0x1'));var BPromise=require(_0x2bc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bc0('0x3'));var db=require(_0x2bc0('0x4'))['db'];var utils=require(_0x2bc0('0x5'));var logger=require(_0x2bc0('0x6'))(_0x2bc0('0x7'));var config=require(_0x2bc0('0x8'));var jayson=require(_0x2bc0('0x9'));var client=jayson[_0x2bc0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56d74a,_0x1af064,_0x5bc0cc){return new BPromise(function(_0x9759cf,_0x509f37){return client['request'](_0x56d74a,_0x5bc0cc)['then'](function(_0x29cc70){logger[_0x2bc0('0xb')](_0x2bc0('0xc'),_0x1af064,_0x2bc0('0xd'));logger[_0x2bc0('0xe')](_0x2bc0('0xf'),_0x1af064,_0x2bc0('0xd'),JSON[_0x2bc0('0x10')](_0x29cc70));if(_0x29cc70[_0x2bc0('0x11')]){if(_0x29cc70[_0x2bc0('0x11')]['code']===0x1f4){logger['error'](_0x2bc0('0xc'),_0x1af064,_0x29cc70[_0x2bc0('0x11')]['message']);return _0x509f37(_0x29cc70['error'][_0x2bc0('0x12')]);}logger[_0x2bc0('0x11')](_0x2bc0('0xc'),_0x1af064,_0x29cc70[_0x2bc0('0x11')]['message']);return _0x9759cf(_0x29cc70[_0x2bc0('0x11')][_0x2bc0('0x12')]);}else{logger[_0x2bc0('0xb')](_0x2bc0('0xc'),_0x1af064,'request\x20sent');_0x9759cf(_0x29cc70[_0x2bc0('0x13')][_0x2bc0('0x12')]);}})[_0x2bc0('0x14')](function(_0x478536){logger[_0x2bc0('0x11')](_0x2bc0('0xc'),_0x1af064,_0x478536);_0x509f37(_0x478536);});});} \ No newline at end of file +var _0xedf3=['info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xedf3,0x17a));var _0x3edf=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0xedf3[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require('lodash');var util=require(_0x3edf('0x0'));var moment=require(_0x3edf('0x1'));var BPromise=require(_0x3edf('0x2'));var rs=require(_0x3edf('0x3'));var fs=require('fs');var Redis=require(_0x3edf('0x4'));var db=require(_0x3edf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3edf('0x6'))(_0x3edf('0x7'));var config=require(_0x3edf('0x8'));var jayson=require(_0x3edf('0x9'));var client=jayson['client'][_0x3edf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ebb50,_0x50f7fe,_0x290673){return new BPromise(function(_0x27f076,_0x370588){return client[_0x3edf('0xb')](_0x4ebb50,_0x290673)[_0x3edf('0xc')](function(_0x551336){logger[_0x3edf('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x50f7fe,_0x3edf('0xe'));logger[_0x3edf('0xf')](_0x3edf('0x10'),_0x50f7fe,_0x3edf('0xe'),JSON[_0x3edf('0x11')](_0x551336));if(_0x551336[_0x3edf('0x12')]){if(_0x551336[_0x3edf('0x12')][_0x3edf('0x13')]===0x1f4){logger[_0x3edf('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x50f7fe,_0x551336['error'][_0x3edf('0x14')]);return _0x370588(_0x551336['error'][_0x3edf('0x14')]);}logger[_0x3edf('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x50f7fe,_0x551336[_0x3edf('0x12')][_0x3edf('0x14')]);return _0x27f076(_0x551336['error'][_0x3edf('0x14')]);}else{logger[_0x3edf('0xd')](_0x3edf('0x15'),_0x50f7fe,_0x3edf('0xe'));_0x27f076(_0x551336[_0x3edf('0x16')][_0x3edf('0x14')]);}})['catch'](function(_0x3fd722){logger[_0x3edf('0x12')](_0x3edf('0x15'),_0x50f7fe,_0x3fd722);_0x370588(_0x3fd722);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2b13395..a01e7d9 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 _0x0bb5=['./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5dadfa,_0x2dacf8){var _0x1162aa=function(_0x4327a7){while(--_0x4327a7){_0x5dadfa['push'](_0x5dadfa['shift']());}};_0x1162aa(++_0x2dacf8);}(_0x0bb5,0x148));var _0x50bb=function(_0xa2d316,_0x4c47ac){_0xa2d316=_0xa2d316-0x0;var _0x238733=_0x0bb5[_0xa2d316];return _0x238733;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/configurations',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x10')]('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x10')](_0x50bb('0x12'),auth[_0x50bb('0xb')](),controller['addConfiguration']);router[_0x50bb('0x13')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router; \ No newline at end of file +var _0xa478=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','getFields','post','/:id/configurations','update'];(function(_0x1cab1b,_0x38ec24){var _0x32da8e=function(_0x164822){while(--_0x164822){_0x1cab1b['push'](_0x1cab1b['shift']());}};_0x32da8e(++_0x38ec24);}(_0xa478,0x136));var _0x8a47=function(_0xed6f46,_0x1c9006){_0xed6f46=_0xed6f46-0x0;var _0x5b267c=_0xa478[_0xed6f46];return _0x5b267c;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require(_0x8a47('0x2'));var timeout=require(_0x8a47('0x3'));var express=require(_0x8a47('0x4'));var router=express[_0x8a47('0x5')]();var fs_extra=require(_0x8a47('0x6'));var auth=require(_0x8a47('0x7'));var interaction=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var controller=require(_0x8a47('0xa'));router[_0x8a47('0xb')]('/',auth['isAuthenticated'](),controller[_0x8a47('0xc')]);router[_0x8a47('0xb')](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller['show']);router[_0x8a47('0xb')]('/:id/configurations',auth[_0x8a47('0xe')](),controller[_0x8a47('0xf')]);router[_0x8a47('0xb')]('/:id/fields',auth[_0x8a47('0xe')](),controller[_0x8a47('0x10')]);router['post']('/',auth[_0x8a47('0xe')](),controller['create']);router[_0x8a47('0x11')](_0x8a47('0x12'),auth[_0x8a47('0xe')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8a47('0xe')](),controller[_0x8a47('0x13')]);router['delete'](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller[_0x8a47('0x14')]);module[_0x8a47('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ccfd9da..c3105cb 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 _0x1967=['STRING','username','remoteUri','exports'];(function(_0x772156,_0x5b5faa){var _0x79234b=function(_0x54773f){while(--_0x54773f){_0x772156['push'](_0x772156['shift']());}};_0x79234b(++_0x5b5faa);}(_0x1967,0x173));var _0x7196=function(_0x3db11e,_0x57b717){_0x3db11e=_0x3db11e-0x0;var _0x52a759=_0x1967[_0x3db11e];return _0x52a759;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x524e=['username','remoteUri','STRING'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x524e,0x15e));var _0xe524=function(_0x2c3ce6,_0x364884){_0x2c3ce6=_0x2c3ce6-0x0;var _0x60e8bb=_0x524e[_0x2c3ce6];return _0x60e8bb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index db2ae38..6e3cd8e 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 _0x3a89=['mustache','sox','to-csv','ejs','fs-extra','squel','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','then','include','show','keys','includeAll','options','find','catch','create','body','update','params','getConfigurations','FreshsalesConfiguration','pick','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','substring','GET','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x13ebf0,_0x25a468){var _0x4db40b=function(_0x16ea2e){while(--_0x16ea2e){_0x13ebf0['push'](_0x13ebf0['shift']());}};_0x4db40b(++_0x25a468);}(_0x3a89,0xc4));var _0x93a8=function(_0x36b4e6,_0x72bc45){_0x36b4e6=_0x36b4e6-0x0;var _0x29f9bf=_0x3a89[_0x36b4e6];return _0x29f9bf;};'use strict';var emlformat=require(_0x93a8('0x0'));var rimraf=require(_0x93a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93a8('0x2'));var rp=require(_0x93a8('0x3'));var moment=require(_0x93a8('0x4'));var BPromise=require(_0x93a8('0x5'));var Mustache=require(_0x93a8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x93a8('0x7'));var csv=require(_0x93a8('0x8'));var ejs=require(_0x93a8('0x9'));var fs=require('fs');var fs_extra=require(_0x93a8('0xa'));var _=require('lodash');var squel=require(_0x93a8('0xb'));var crypto=require('crypto');var jsforce=require(_0x93a8('0xc'));var deskjs=require(_0x93a8('0xd'));var toCsv=require(_0x93a8('0x8'));var querystring=require(_0x93a8('0xe'));var Papa=require('papaparse');var Redis=require(_0x93a8('0xf'));var authService=require(_0x93a8('0x10'));var qs=require(_0x93a8('0x11'));var as=require(_0x93a8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93a8('0x13'))(_0x93a8('0x14'));var utils=require(_0x93a8('0x15'));var config=require(_0x93a8('0x16'));var licenseUtil=require(_0x93a8('0x17'));var db=require(_0x93a8('0x18'))['db'];var integrations=require(_0x93a8('0x19'));function respondWithStatusCode(_0x3fc15c,_0x7d544c){_0x7d544c=_0x7d544c||0xcc;return function(_0x190213){if(_0x190213){return _0x3fc15c[_0x93a8('0x1a')](_0x7d544c);}return _0x3fc15c['status'](_0x7d544c)['end']();};}function respondWithResult(_0x47f0fe,_0x35a705){_0x35a705=_0x35a705||0xc8;return function(_0x12828d){if(_0x12828d){return _0x47f0fe[_0x93a8('0x1b')](_0x35a705)[_0x93a8('0x1c')](_0x12828d);}};}function respondWithFilteredResult(_0x5bf318,_0x33e3bd){return function(_0x4e219e){if(_0x4e219e){var _0x257b31=typeof _0x33e3bd[_0x93a8('0x1d')]===_0x93a8('0x1e')&&typeof _0x33e3bd['limit']==='undefined';var _0x577aec=_0x4e219e[_0x93a8('0x1f')];var _0x3d89a8=_0x257b31?0x0:_0x33e3bd['offset'];var _0x491307=_0x257b31?_0x4e219e[_0x93a8('0x1f')]:_0x33e3bd[_0x93a8('0x1d')]+_0x33e3bd['limit'];var _0x63b19d;if(_0x491307>=_0x577aec){_0x491307=_0x577aec;_0x63b19d=0xc8;}else{_0x63b19d=0xce;}_0x5bf318[_0x93a8('0x1b')](_0x63b19d);return _0x5bf318['set'](_0x93a8('0x20'),_0x3d89a8+'-'+_0x491307+'/'+_0x577aec)['json'](_0x4e219e);}return null;};}function patchUpdates(_0x178807){return function(_0x83a13e){try{jsonpatch[_0x93a8('0x21')](_0x83a13e,_0x178807,!![]);}catch(_0x5243d5){return BPromise[_0x93a8('0x22')](_0x5243d5);}return _0x83a13e[_0x93a8('0x23')]();};}function saveUpdates(_0x2a073a,_0x517340){return function(_0x522b36){if(_0x522b36){return _0x522b36['update'](_0x2a073a)['then'](function(_0x125a02){return _0x125a02;});}return null;};}function removeEntity(_0x488869,_0x9bf765){return function(_0x4eae9a){if(_0x4eae9a){return _0x4eae9a[_0x93a8('0x24')]()['then'](function(){_0x488869['status'](0xcc)[_0x93a8('0x25')]();});}};}function handleEntityNotFound(_0xaa6462,_0x229baf){return function(_0x50f91f){if(!_0x50f91f){_0xaa6462[_0x93a8('0x1a')](0x194);}return _0x50f91f;};}function handleError(_0x1976d1,_0x13b1c7){_0x13b1c7=_0x13b1c7||0x1f4;return function(_0xbf3db0){logger[_0x93a8('0x26')](_0xbf3db0[_0x93a8('0x27')]);if(_0xbf3db0[_0x93a8('0x28')]){delete _0xbf3db0[_0x93a8('0x28')];}_0x1976d1[_0x93a8('0x1b')](_0x13b1c7)[_0x93a8('0x29')](_0xbf3db0);};}exports[_0x93a8('0x2a')]=function(_0x277d16,_0x18420f){var _0xbd0e35={},_0x192570={},_0x87b35a={'count':0x0,'rows':[]};var _0x4cdc31=_[_0x93a8('0x2b')](db[_0x93a8('0x2c')][_0x93a8('0x2d')],function(_0x15091d){return{'name':_0x15091d['fieldName'],'type':_0x15091d['type'][_0x93a8('0x2e')]};});_0x192570[_0x93a8('0x2f')]=_[_0x93a8('0x2b')](_0x4cdc31,_0x93a8('0x28'));_0x192570['query']=_['keys'](_0x277d16['query']);_0x192570[_0x93a8('0x30')]=_[_0x93a8('0x31')](_0x192570[_0x93a8('0x2f')],_0x192570[_0x93a8('0x32')]);_0xbd0e35['attributes']=_['intersection'](_0x192570[_0x93a8('0x2f')],qs[_0x93a8('0x33')](_0x277d16['query'][_0x93a8('0x33')]));_0xbd0e35[_0x93a8('0x34')]=_0xbd0e35[_0x93a8('0x34')][_0x93a8('0x35')]?_0xbd0e35[_0x93a8('0x34')]:_0x192570[_0x93a8('0x2f')];if(!_0x277d16[_0x93a8('0x32')][_0x93a8('0x36')](_0x93a8('0x37'))){_0xbd0e35[_0x93a8('0x38')]=qs[_0x93a8('0x38')](_0x277d16[_0x93a8('0x32')][_0x93a8('0x38')]);_0xbd0e35['offset']=qs['offset'](_0x277d16[_0x93a8('0x32')][_0x93a8('0x1d')]);}_0xbd0e35[_0x93a8('0x39')]=qs[_0x93a8('0x3a')](_0x277d16['query'][_0x93a8('0x3a')]);_0xbd0e35[_0x93a8('0x3b')]=qs[_0x93a8('0x30')](_['pick'](_0x277d16[_0x93a8('0x32')],_0x192570[_0x93a8('0x30')]),_0x4cdc31);if(_0x277d16[_0x93a8('0x32')][_0x93a8('0x3c')]){_0xbd0e35[_0x93a8('0x3b')]=_[_0x93a8('0x3d')](_0xbd0e35[_0x93a8('0x3b')],{'$or':_[_0x93a8('0x2b')](_0x4cdc31,function(_0x277566){if(_0x277566[_0x93a8('0x3e')]!=='VIRTUAL'){var _0x595152={};_0x595152[_0x277566['name']]={'$like':'%'+_0x277d16[_0x93a8('0x32')][_0x93a8('0x3c')]+'%'};return _0x595152;}})});}_0xbd0e35=_['merge']({},_0xbd0e35,_0x277d16['options']);var _0x4e1b21={'where':_0xbd0e35[_0x93a8('0x3b')]};return db[_0x93a8('0x2c')]['count'](_0x4e1b21)[_0x93a8('0x3f')](function(_0x31d4ea){_0x87b35a[_0x93a8('0x1f')]=_0x31d4ea;if(_0x277d16[_0x93a8('0x32')]['includeAll']){_0xbd0e35[_0x93a8('0x40')]=[{'all':!![]}];}return db[_0x93a8('0x2c')]['findAll'](_0xbd0e35);})[_0x93a8('0x3f')](function(_0x322302){_0x87b35a['rows']=_0x322302;return _0x87b35a;})[_0x93a8('0x3f')](respondWithFilteredResult(_0x18420f,_0xbd0e35))['catch'](handleError(_0x18420f,null));};exports[_0x93a8('0x41')]=function(_0x361529,_0x258d79){var _0x31dd66={'raw':![],'where':{'id':_0x361529['params']['id']}},_0x4b7085={};_0x4b7085['model']=_[_0x93a8('0x42')](db[_0x93a8('0x2c')][_0x93a8('0x2d')]);_0x4b7085['query']=_['keys'](_0x361529[_0x93a8('0x32')]);_0x4b7085['filters']=_[_0x93a8('0x31')](_0x4b7085['model'],_0x4b7085['query']);_0x31dd66[_0x93a8('0x34')]=_[_0x93a8('0x31')](_0x4b7085[_0x93a8('0x2f')],qs[_0x93a8('0x33')](_0x361529['query'][_0x93a8('0x33')]));_0x31dd66['attributes']=_0x31dd66[_0x93a8('0x34')][_0x93a8('0x35')]?_0x31dd66[_0x93a8('0x34')]:_0x4b7085[_0x93a8('0x2f')];if(_0x361529['query'][_0x93a8('0x43')]){_0x31dd66[_0x93a8('0x40')]=[{'all':!![]}];}_0x31dd66=_[_0x93a8('0x3d')]({},_0x31dd66,_0x361529[_0x93a8('0x44')]);return db[_0x93a8('0x2c')][_0x93a8('0x45')](_0x31dd66)[_0x93a8('0x3f')](handleEntityNotFound(_0x258d79,null))[_0x93a8('0x3f')](respondWithResult(_0x258d79,null))[_0x93a8('0x46')](handleError(_0x258d79,null));};exports['create']=function(_0x575670,_0xa01b14){return db[_0x93a8('0x2c')][_0x93a8('0x47')](_0x575670[_0x93a8('0x48')],{})[_0x93a8('0x3f')](respondWithResult(_0xa01b14,0xc9))['catch'](handleError(_0xa01b14,null));};exports[_0x93a8('0x49')]=function(_0x48e0f6,_0x3ffee5){if(_0x48e0f6[_0x93a8('0x48')]['id']){delete _0x48e0f6['body']['id'];}return db['FreshsalesAccount'][_0x93a8('0x45')]({'where':{'id':_0x48e0f6[_0x93a8('0x4a')]['id']}})[_0x93a8('0x3f')](handleEntityNotFound(_0x3ffee5,null))[_0x93a8('0x3f')](saveUpdates(_0x48e0f6[_0x93a8('0x48')],null))[_0x93a8('0x3f')](respondWithResult(_0x3ffee5,null))[_0x93a8('0x46')](handleError(_0x3ffee5,null));};exports['destroy']=function(_0xcdfce5,_0x5c7a05){return db[_0x93a8('0x2c')][_0x93a8('0x45')]({'where':{'id':_0xcdfce5[_0x93a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c7a05,null))[_0x93a8('0x3f')](removeEntity(_0x5c7a05,null))[_0x93a8('0x46')](handleError(_0x5c7a05,null));};exports[_0x93a8('0x4b')]=function(_0x50f413,_0x45fe67,_0x95eccb){var _0x515eac={};var _0x1632df={};var _0x59dfdf;var _0x41ee1a;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x50f413['params']['id']}})[_0x93a8('0x3f')](handleEntityNotFound(_0x45fe67,null))[_0x93a8('0x3f')](function(_0x256bae){if(_0x256bae){_0x59dfdf=_0x256bae;_0x1632df[_0x93a8('0x2f')]=_[_0x93a8('0x42')](db[_0x93a8('0x4c')][_0x93a8('0x2d')]);_0x1632df[_0x93a8('0x32')]=_['keys'](_0x50f413[_0x93a8('0x32')]);_0x1632df[_0x93a8('0x30')]=_[_0x93a8('0x31')](_0x1632df[_0x93a8('0x2f')],_0x1632df[_0x93a8('0x32')]);_0x515eac[_0x93a8('0x34')]=_[_0x93a8('0x31')](_0x1632df[_0x93a8('0x2f')],qs[_0x93a8('0x33')](_0x50f413[_0x93a8('0x32')][_0x93a8('0x33')]));_0x515eac[_0x93a8('0x34')]=_0x515eac[_0x93a8('0x34')][_0x93a8('0x35')]?_0x515eac['attributes']:_0x1632df['model'];_0x515eac[_0x93a8('0x39')]=qs[_0x93a8('0x3a')](_0x50f413['query'][_0x93a8('0x3a')]);_0x515eac[_0x93a8('0x3b')]=qs[_0x93a8('0x30')](_[_0x93a8('0x4d')](_0x50f413[_0x93a8('0x32')],_0x1632df[_0x93a8('0x30')]));if(_0x50f413[_0x93a8('0x32')][_0x93a8('0x3c')]){_0x515eac[_0x93a8('0x3b')]=_[_0x93a8('0x3d')](_0x515eac['where'],{'$or':_[_0x93a8('0x2b')](_0x515eac[_0x93a8('0x34')],function(_0x689445){var _0x2c571c={};_0x2c571c[_0x689445]={'$like':'%'+_0x50f413['query'][_0x93a8('0x3c')]+'%'};return _0x2c571c;})});}_0x515eac=_[_0x93a8('0x3d')]({},_0x515eac,_0x50f413[_0x93a8('0x44')]);return _0x59dfdf[_0x93a8('0x4b')](_0x515eac);}})['then'](function(_0x5913cd){if(_0x5913cd){_0x41ee1a=_0x5913cd[_0x93a8('0x35')];if(!_0x50f413['query'][_0x93a8('0x36')]('nolimit')){_0x515eac[_0x93a8('0x38')]=qs[_0x93a8('0x38')](_0x50f413[_0x93a8('0x32')][_0x93a8('0x38')]);_0x515eac['offset']=qs['offset'](_0x50f413[_0x93a8('0x32')]['offset']);}return _0x59dfdf[_0x93a8('0x4b')](_0x515eac);}})[_0x93a8('0x3f')](function(_0x5745b0){if(_0x5745b0){return _0x5745b0?{'count':_0x41ee1a,'rows':_0x5745b0}:null;}})[_0x93a8('0x3f')](respondWithResult(_0x45fe67,null))[_0x93a8('0x46')](handleError(_0x45fe67,null));};exports['addConfiguration']=function(_0x272919,_0x3ead58,_0x4c78fd){if(_0x272919[_0x93a8('0x48')]['id']){delete _0x272919[_0x93a8('0x48')]['id'];}return db[_0x93a8('0x2c')][_0x93a8('0x4e')]({'where':{'id':_0x272919[_0x93a8('0x4a')]['id']}})[_0x93a8('0x3f')](handleEntityNotFound(_0x3ead58,null))[_0x93a8('0x3f')](function(_0x3b7e37){if(_0x3b7e37){_0x272919[_0x93a8('0x48')][_0x93a8('0x4f')]=_0x3b7e37['id'];_0x272919['body']['Subjects']=integrations[_0x93a8('0x50')](_0x272919['body'][_0x93a8('0x51')],_0x272919[_0x93a8('0x48')]['type']);_0x272919[_0x93a8('0x48')][_0x93a8('0x52')]=integrations[_0x93a8('0x53')](_0x272919[_0x93a8('0x48')]['channel'],_0x272919[_0x93a8('0x48')][_0x93a8('0x3e')]);return db['FreshsalesConfiguration']['create'](_0x272919[_0x93a8('0x48')],{'include':[{'model':db[_0x93a8('0x54')],'as':_0x93a8('0x55')},{'model':db[_0x93a8('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3ead58,null))['catch'](handleError(_0x3ead58,null));};exports[_0x93a8('0x56')]=function(_0x332479,_0x13c314,_0x3f6941){var _0x58deb3='';var _0x358111='';return db[_0x93a8('0x2c')][_0x93a8('0x4e')]({'where':{'id':_0x332479[_0x93a8('0x4a')]['id']},'attributes':['id',_0x93a8('0x57'),_0x93a8('0x58'),_0x93a8('0x59')]})[_0x93a8('0x3f')](handleEntityNotFound(_0x13c314,null))['then'](function(_0x5605d4){if(_0x5605d4){_0x358111=_0x5605d4[_0x93a8('0x57')];_0x58deb3=_0x5605d4['remoteUri'];var _0x4ce1cf=_0x5605d4[_0x93a8('0x58')]['slice'](-0x1);if(_0x4ce1cf==='/'){_0x58deb3=_0x58deb3[_0x93a8('0x5a')](0x0,_0x58deb3['lastIndexOf'](_0x4ce1cf));}return rp({'method':_0x93a8('0x5b'),'uri':util[_0x93a8('0x5c')](_0x93a8('0x5d'),_0x58deb3,_0x93a8('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x5605d4[_0x93a8('0x59')]},'json':!![]});}})[_0x93a8('0x3f')](function(_0x35035){if(_0x35035){var _0x5ece26=_0x35035['users'];var _0x182dd8=![];var _0x1082ca=null;for(_0x1082ca=0x0;_0x1082ca<_0x5ece26[_0x93a8('0x35')];_0x1082ca++){if(_0x5ece26[_0x1082ca][_0x93a8('0x5f')]===_0x358111){_0x182dd8=!![];}}if(_0x182dd8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x93a8('0x60')});}}})['then'](respondWithResult(_0x13c314,null))['catch'](function(_0x18c54d){var _0xc20956=_0x332479[_0x93a8('0x32')]['test']?0x1f4:_0x18c54d[_0x93a8('0x61')]||0x1f4;logger['error'](_0x93a8('0x62'),_0x93a8('0x56'),_0xc20956,JSON['stringify'](_0x18c54d));delete _0x18c54d[_0x93a8('0x28')];if(_0xc20956===0x191){_0xc20956=0x190;}_0x13c314[_0x93a8('0x1b')](_0xc20956)['send'](_0x332479[_0x93a8('0x32')][_0x93a8('0x63')]?{'message':_0x93a8('0x64'),'statusCode':_0x18c54d[_0x93a8('0x61')]}:_0x18c54d);});}; \ No newline at end of file +var _0x0111=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','options','FreshsalesAccount','includeAll','include','catch','show','params','merge','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','length','hasOwnProperty','Subjects','getSubjects','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xb3ae42,_0x4b0299){var _0x2f5eb7=function(_0x3eab8e){while(--_0x3eab8e){_0xb3ae42['push'](_0xb3ae42['shift']());}};_0x2f5eb7(++_0x4b0299);}(_0x0111,0x127));var _0x1011=function(_0x2141c2,_0x15c6bd){_0x2141c2=_0x2141c2-0x0;var _0x1c0c29=_0x0111[_0x2141c2];return _0x1c0c29;};'use strict';var emlformat=require(_0x1011('0x0'));var rimraf=require(_0x1011('0x1'));var zipdir=require(_0x1011('0x2'));var jsonpatch=require(_0x1011('0x3'));var rp=require(_0x1011('0x4'));var moment=require(_0x1011('0x5'));var BPromise=require(_0x1011('0x6'));var Mustache=require(_0x1011('0x7'));var util=require(_0x1011('0x8'));var path=require('path');var sox=require(_0x1011('0x9'));var csv=require(_0x1011('0xa'));var ejs=require(_0x1011('0xb'));var fs=require('fs');var fs_extra=require(_0x1011('0xc'));var _=require(_0x1011('0xd'));var squel=require(_0x1011('0xe'));var crypto=require('crypto');var jsforce=require(_0x1011('0xf'));var deskjs=require(_0x1011('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1011('0x11'));var Redis=require(_0x1011('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1011('0x13'));var as=require(_0x1011('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1011('0x15'))('api');var utils=require(_0x1011('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1011('0x17'));var db=require(_0x1011('0x18'))['db'];var integrations=require(_0x1011('0x19'));function respondWithStatusCode(_0x192c88,_0x5ea7c1){_0x5ea7c1=_0x5ea7c1||0xcc;return function(_0x51a86c){if(_0x51a86c){return _0x192c88[_0x1011('0x1a')](_0x5ea7c1);}return _0x192c88['status'](_0x5ea7c1)[_0x1011('0x1b')]();};}function respondWithResult(_0x2e897b,_0x5d7387){_0x5d7387=_0x5d7387||0xc8;return function(_0x3f0770){if(_0x3f0770){return _0x2e897b[_0x1011('0x1c')](_0x5d7387)[_0x1011('0x1d')](_0x3f0770);}};}function respondWithFilteredResult(_0x2dd523,_0x85cd0c){return function(_0x23c452){if(_0x23c452){var _0x5f34ff=typeof _0x85cd0c['offset']==='undefined'&&typeof _0x85cd0c['limit']==='undefined';var _0x3621b9=_0x23c452['count'];var _0x5777b7=_0x5f34ff?0x0:_0x85cd0c[_0x1011('0x1e')];var _0x53b8a3=_0x5f34ff?_0x23c452[_0x1011('0x1f')]:_0x85cd0c[_0x1011('0x1e')]+_0x85cd0c[_0x1011('0x20')];var _0x5a9823;if(_0x53b8a3>=_0x3621b9){_0x53b8a3=_0x3621b9;_0x5a9823=0xc8;}else{_0x5a9823=0xce;}_0x2dd523[_0x1011('0x1c')](_0x5a9823);return _0x2dd523[_0x1011('0x21')](_0x1011('0x22'),_0x5777b7+'-'+_0x53b8a3+'/'+_0x3621b9)[_0x1011('0x1d')](_0x23c452);}return null;};}function patchUpdates(_0x282fa6){return function(_0x459a47){try{jsonpatch[_0x1011('0x23')](_0x459a47,_0x282fa6,!![]);}catch(_0x280f5d){return BPromise['reject'](_0x280f5d);}return _0x459a47['save']();};}function saveUpdates(_0x9ea05b,_0x268dc6){return function(_0x5dc46d){if(_0x5dc46d){return _0x5dc46d[_0x1011('0x24')](_0x9ea05b)[_0x1011('0x25')](function(_0x864d1b){return _0x864d1b;});}return null;};}function removeEntity(_0x188e10,_0x25f239){return function(_0x232eba){if(_0x232eba){return _0x232eba[_0x1011('0x26')]()[_0x1011('0x25')](function(){_0x188e10[_0x1011('0x1c')](0xcc)[_0x1011('0x1b')]();});}};}function handleEntityNotFound(_0xce3b8a,_0x2629ad){return function(_0x3cfa86){if(!_0x3cfa86){_0xce3b8a['sendStatus'](0x194);}return _0x3cfa86;};}function handleError(_0x5f0169,_0x48a83d){_0x48a83d=_0x48a83d||0x1f4;return function(_0x31aaba){logger[_0x1011('0x27')](_0x31aaba[_0x1011('0x28')]);if(_0x31aaba[_0x1011('0x29')]){delete _0x31aaba[_0x1011('0x29')];}_0x5f0169['status'](_0x48a83d)['send'](_0x31aaba);};}exports[_0x1011('0x2a')]=function(_0x455799,_0x18fa1c){var _0x22dc1a={},_0x56f082={},_0x4cf9ed={'count':0x0,'rows':[]};var _0xc98480=_[_0x1011('0x2b')](db['FreshsalesAccount'][_0x1011('0x2c')],function(_0x3c4e88){return{'name':_0x3c4e88['fieldName'],'type':_0x3c4e88[_0x1011('0x2d')][_0x1011('0x2e')]};});_0x56f082[_0x1011('0x2f')]=_[_0x1011('0x2b')](_0xc98480,_0x1011('0x29'));_0x56f082[_0x1011('0x30')]=_[_0x1011('0x31')](_0x455799[_0x1011('0x30')]);_0x56f082['filters']=_[_0x1011('0x32')](_0x56f082['model'],_0x56f082[_0x1011('0x30')]);_0x22dc1a[_0x1011('0x33')]=_[_0x1011('0x32')](_0x56f082[_0x1011('0x2f')],qs['fields'](_0x455799[_0x1011('0x30')][_0x1011('0x34')]));_0x22dc1a['attributes']=_0x22dc1a['attributes']['length']?_0x22dc1a[_0x1011('0x33')]:_0x56f082['model'];if(!_0x455799['query']['hasOwnProperty'](_0x1011('0x35'))){_0x22dc1a[_0x1011('0x20')]=qs[_0x1011('0x20')](_0x455799[_0x1011('0x30')][_0x1011('0x20')]);_0x22dc1a[_0x1011('0x1e')]=qs[_0x1011('0x1e')](_0x455799[_0x1011('0x30')][_0x1011('0x1e')]);}_0x22dc1a[_0x1011('0x36')]=qs[_0x1011('0x37')](_0x455799['query']['sort']);_0x22dc1a[_0x1011('0x38')]=qs['filters'](_['pick'](_0x455799[_0x1011('0x30')],_0x56f082[_0x1011('0x39')]),_0xc98480);if(_0x455799[_0x1011('0x30')][_0x1011('0x3a')]){_0x22dc1a[_0x1011('0x38')]=_['merge'](_0x22dc1a[_0x1011('0x38')],{'$or':_[_0x1011('0x2b')](_0xc98480,function(_0x796439){if(_0x796439[_0x1011('0x2d')]!==_0x1011('0x3b')){var _0x22dbb6={};_0x22dbb6[_0x796439[_0x1011('0x29')]]={'$like':'%'+_0x455799[_0x1011('0x30')]['filter']+'%'};return _0x22dbb6;}})});}_0x22dc1a=_['merge']({},_0x22dc1a,_0x455799[_0x1011('0x3c')]);var _0x2339ee={'where':_0x22dc1a[_0x1011('0x38')]};return db[_0x1011('0x3d')]['count'](_0x2339ee)[_0x1011('0x25')](function(_0x432425){_0x4cf9ed[_0x1011('0x1f')]=_0x432425;if(_0x455799[_0x1011('0x30')][_0x1011('0x3e')]){_0x22dc1a[_0x1011('0x3f')]=[{'all':!![]}];}return db[_0x1011('0x3d')]['findAll'](_0x22dc1a);})[_0x1011('0x25')](function(_0x5e5695){_0x4cf9ed['rows']=_0x5e5695;return _0x4cf9ed;})[_0x1011('0x25')](respondWithFilteredResult(_0x18fa1c,_0x22dc1a))[_0x1011('0x40')](handleError(_0x18fa1c,null));};exports[_0x1011('0x41')]=function(_0x11e42f,_0x233322){var _0x1c7267={'raw':![],'where':{'id':_0x11e42f[_0x1011('0x42')]['id']}},_0x24be80={};_0x24be80[_0x1011('0x2f')]=_['keys'](db[_0x1011('0x3d')][_0x1011('0x2c')]);_0x24be80['query']=_['keys'](_0x11e42f['query']);_0x24be80['filters']=_['intersection'](_0x24be80[_0x1011('0x2f')],_0x24be80[_0x1011('0x30')]);_0x1c7267[_0x1011('0x33')]=_[_0x1011('0x32')](_0x24be80[_0x1011('0x2f')],qs['fields'](_0x11e42f[_0x1011('0x30')][_0x1011('0x34')]));_0x1c7267[_0x1011('0x33')]=_0x1c7267['attributes']['length']?_0x1c7267[_0x1011('0x33')]:_0x24be80['model'];if(_0x11e42f[_0x1011('0x30')][_0x1011('0x3e')]){_0x1c7267[_0x1011('0x3f')]=[{'all':!![]}];}_0x1c7267=_[_0x1011('0x43')]({},_0x1c7267,_0x11e42f['options']);return db[_0x1011('0x3d')][_0x1011('0x44')](_0x1c7267)[_0x1011('0x25')](handleEntityNotFound(_0x233322,null))[_0x1011('0x25')](respondWithResult(_0x233322,null))[_0x1011('0x40')](handleError(_0x233322,null));};exports[_0x1011('0x45')]=function(_0x2fcd3e,_0xd9fe96){return db[_0x1011('0x3d')][_0x1011('0x45')](_0x2fcd3e[_0x1011('0x46')],{})[_0x1011('0x25')](respondWithResult(_0xd9fe96,0xc9))[_0x1011('0x40')](handleError(_0xd9fe96,null));};exports[_0x1011('0x24')]=function(_0x1fb7af,_0x4b8a22){if(_0x1fb7af[_0x1011('0x46')]['id']){delete _0x1fb7af[_0x1011('0x46')]['id'];}return db[_0x1011('0x3d')][_0x1011('0x44')]({'where':{'id':_0x1fb7af[_0x1011('0x42')]['id']}})[_0x1011('0x25')](handleEntityNotFound(_0x4b8a22,null))[_0x1011('0x25')](saveUpdates(_0x1fb7af[_0x1011('0x46')],null))['then'](respondWithResult(_0x4b8a22,null))[_0x1011('0x40')](handleError(_0x4b8a22,null));};exports[_0x1011('0x26')]=function(_0x35329,_0x2a19b6){return db['FreshsalesAccount'][_0x1011('0x44')]({'where':{'id':_0x35329[_0x1011('0x42')]['id']}})[_0x1011('0x25')](handleEntityNotFound(_0x2a19b6,null))[_0x1011('0x25')](removeEntity(_0x2a19b6,null))[_0x1011('0x40')](handleError(_0x2a19b6,null));};exports[_0x1011('0x47')]=function(_0xe4f534,_0x1ade8e,_0x47a88f){var _0x1ffee2={};var _0x3d0bae={};var _0x583155;var _0x166974;return db[_0x1011('0x3d')][_0x1011('0x48')]({'where':{'id':_0xe4f534[_0x1011('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ade8e,null))[_0x1011('0x25')](function(_0x1aae2a){if(_0x1aae2a){_0x583155=_0x1aae2a;_0x3d0bae[_0x1011('0x2f')]=_['keys'](db[_0x1011('0x49')][_0x1011('0x2c')]);_0x3d0bae[_0x1011('0x30')]=_[_0x1011('0x31')](_0xe4f534[_0x1011('0x30')]);_0x3d0bae[_0x1011('0x39')]=_[_0x1011('0x32')](_0x3d0bae[_0x1011('0x2f')],_0x3d0bae[_0x1011('0x30')]);_0x1ffee2[_0x1011('0x33')]=_[_0x1011('0x32')](_0x3d0bae[_0x1011('0x2f')],qs[_0x1011('0x34')](_0xe4f534[_0x1011('0x30')]['fields']));_0x1ffee2[_0x1011('0x33')]=_0x1ffee2['attributes'][_0x1011('0x4a')]?_0x1ffee2[_0x1011('0x33')]:_0x3d0bae['model'];_0x1ffee2[_0x1011('0x36')]=qs[_0x1011('0x37')](_0xe4f534[_0x1011('0x30')][_0x1011('0x37')]);_0x1ffee2[_0x1011('0x38')]=qs[_0x1011('0x39')](_['pick'](_0xe4f534[_0x1011('0x30')],_0x3d0bae['filters']));if(_0xe4f534[_0x1011('0x30')][_0x1011('0x3a')]){_0x1ffee2[_0x1011('0x38')]=_['merge'](_0x1ffee2['where'],{'$or':_[_0x1011('0x2b')](_0x1ffee2[_0x1011('0x33')],function(_0x38499b){var _0x29c76c={};_0x29c76c[_0x38499b]={'$like':'%'+_0xe4f534[_0x1011('0x30')][_0x1011('0x3a')]+'%'};return _0x29c76c;})});}_0x1ffee2=_[_0x1011('0x43')]({},_0x1ffee2,_0xe4f534['options']);return _0x583155[_0x1011('0x47')](_0x1ffee2);}})[_0x1011('0x25')](function(_0x2e573f){if(_0x2e573f){_0x166974=_0x2e573f[_0x1011('0x4a')];if(!_0xe4f534[_0x1011('0x30')][_0x1011('0x4b')](_0x1011('0x35'))){_0x1ffee2['limit']=qs[_0x1011('0x20')](_0xe4f534[_0x1011('0x30')]['limit']);_0x1ffee2[_0x1011('0x1e')]=qs['offset'](_0xe4f534[_0x1011('0x30')][_0x1011('0x1e')]);}return _0x583155[_0x1011('0x47')](_0x1ffee2);}})['then'](function(_0x436f70){if(_0x436f70){return _0x436f70?{'count':_0x166974,'rows':_0x436f70}:null;}})['then'](respondWithResult(_0x1ade8e,null))[_0x1011('0x40')](handleError(_0x1ade8e,null));};exports['addConfiguration']=function(_0x426836,_0xe09e7e,_0x11e942){if(_0x426836[_0x1011('0x46')]['id']){delete _0x426836[_0x1011('0x46')]['id'];}return db[_0x1011('0x3d')][_0x1011('0x48')]({'where':{'id':_0x426836[_0x1011('0x42')]['id']}})['then'](handleEntityNotFound(_0xe09e7e,null))['then'](function(_0x482249){if(_0x482249){_0x426836[_0x1011('0x46')]['AccountId']=_0x482249['id'];_0x426836[_0x1011('0x46')][_0x1011('0x4c')]=integrations[_0x1011('0x4d')](_0x426836[_0x1011('0x46')]['channel'],_0x426836['body'][_0x1011('0x2d')]);_0x426836[_0x1011('0x46')][_0x1011('0x4e')]=integrations[_0x1011('0x4f')](_0x426836['body']['channel'],_0x426836[_0x1011('0x46')][_0x1011('0x2d')]);return db[_0x1011('0x49')][_0x1011('0x45')](_0x426836[_0x1011('0x46')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x1011('0x50')],'as':'Descriptions'}]});}return null;})[_0x1011('0x25')](respondWithResult(_0xe09e7e,null))['catch'](handleError(_0xe09e7e,null));};exports[_0x1011('0x51')]=function(_0x2cbe30,_0x2c1aa7,_0xf12d69){var _0x3d4eb2='';var _0x5e232e='';return db[_0x1011('0x3d')]['findOne']({'where':{'id':_0x2cbe30['params']['id']},'attributes':['id',_0x1011('0x52'),_0x1011('0x53'),_0x1011('0x54')]})[_0x1011('0x25')](handleEntityNotFound(_0x2c1aa7,null))['then'](function(_0x45ef7e){if(_0x45ef7e){_0x5e232e=_0x45ef7e[_0x1011('0x52')];_0x3d4eb2=_0x45ef7e['remoteUri'];var _0x167a9d=_0x45ef7e['remoteUri'][_0x1011('0x55')](-0x1);if(_0x167a9d==='/'){_0x3d4eb2=_0x3d4eb2['substring'](0x0,_0x3d4eb2[_0x1011('0x56')](_0x167a9d));}return rp({'method':_0x1011('0x57'),'uri':util[_0x1011('0x58')](_0x1011('0x59'),_0x3d4eb2,_0x1011('0x5a')),'headers':{'Authorization':_0x1011('0x5b')+_0x45ef7e[_0x1011('0x54')]},'json':!![]});}})[_0x1011('0x25')](function(_0x1b112d){if(_0x1b112d){var _0x35929d=_0x1b112d[_0x1011('0x5c')];var _0x338e67=![];var _0x45e59a=null;for(_0x45e59a=0x0;_0x45e59a<_0x35929d[_0x1011('0x4a')];_0x45e59a++){if(_0x35929d[_0x45e59a][_0x1011('0x5d')]===_0x5e232e){_0x338e67=!![];}}if(_0x338e67){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1011('0x5e')});}}})[_0x1011('0x25')](respondWithResult(_0x2c1aa7,null))[_0x1011('0x40')](function(_0x4b2136){var _0x392fc5=_0x2cbe30[_0x1011('0x30')][_0x1011('0x5f')]?0x1f4:_0x4b2136[_0x1011('0x60')]||0x1f4;logger[_0x1011('0x27')](_0x1011('0x61'),_0x1011('0x51'),_0x392fc5,JSON[_0x1011('0x62')](_0x4b2136));delete _0x4b2136[_0x1011('0x29')];if(_0x392fc5===0x191){_0x392fc5=0x190;}_0x2c1aa7[_0x1011('0x1c')](_0x392fc5)[_0x1011('0x63')](_0x2cbe30[_0x1011('0x30')]['test']?{'message':_0x1011('0x64'),'statusCode':_0x4b2136['statusCode']}:_0x4b2136);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index ad2caed..4916bdd 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 _0xc4aa=['bluebird','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a85=['moment','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','../../config/logger','api'];(function(_0x3d1dba,_0x2a42bb){var _0x15d472=function(_0x5c8951){while(--_0x5c8951){_0x3d1dba['push'](_0x3d1dba['shift']());}};_0x15d472(++_0x2a42bb);}(_0x1a85,0x178));var _0x51a8=function(_0x232cbf,_0x3e2f33){_0x232cbf=_0x232cbf-0x0;var _0x1cd460=_0x1a85[_0x232cbf];return _0x1cd460;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x51a8('0x6'));module['exports']=function(_0x2c1180,_0x5cf430){return _0x2c1180[_0x51a8('0x7')](_0x51a8('0x8'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 11bb6a2..27e5537 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 _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x47af26,_0x47abe0){var _0x40e46d=function(_0x3f7f25){while(--_0x3f7f25){_0x47af26['push'](_0x47af26['shift']());}};_0x40e46d(++_0x47abe0);}(_0x896e,0x1e9));var _0xe896=function(_0x32e6b1,_0x29993d){_0x32e6b1=_0x32e6b1-0x0;var _0x37cfb2=_0x896e[_0x32e6b1];return _0x37cfb2;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file +var _0x583c=['raw','where','attributes','limit','map','include','model','debug','stringify','catch','ShowFreshsalesAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x583c,0x12b));var _0xc583=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x583c[_0xd050c6];return _0x7278a;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['findAll']({'raw':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x15')]===undefined?!![]:![]:!![],'where':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x16')]||null:null,'attributes':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x17')]||null:null,'limit':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x18')]||null:null,'include':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84['options']['include']?_[_0xc583('0x19')](_0x8a2d84[_0xc583('0x14')][_0xc583('0x1a')],function(_0x5ceef1){return{'model':db[_0x5ceef1[_0xc583('0x1b')]],'as':_0x5ceef1['as'],'attributes':_0x5ceef1[_0xc583('0x17')],'include':_0x5ceef1[_0xc583('0x1a')]?_[_0xc583('0x19')](_0x5ceef1[_0xc583('0x1a')],function(_0x48c95e){return{'model':db[_0x48c95e['model']],'as':_0x48c95e['as'],'attributes':_0x48c95e[_0xc583('0x17')],'include':_0x48c95e['include']?_[_0xc583('0x19')](_0x48c95e[_0xc583('0x1a')],function(_0xbabf24){return{'model':db[_0xbabf24[_0xc583('0x1b')]],'as':_0xbabf24['as'],'attributes':_0xbabf24[_0xc583('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafb4){logger[_0xc583('0xb')]('GetFreshsalesAccount',_0x8a2d84);logger[_0xc583('0x1c')]('GetFreshsalesAccount',_0x8a2d84,JSON[_0xc583('0x1d')](_0x2dafb4));_0x36e0fd(_0x2dafb4);})[_0xc583('0x1e')](function(_0x1c80b1){logger[_0xc583('0xf')](_0xc583('0x12'),_0x1c80b1[_0xc583('0x10')],_0x8a2d84);_0x5433ec(_0x12aac2[_0xc583('0xf')](0x1f4,_0x1c80b1['message']));});});};exports[_0xc583('0x1f')]=function(_0x390bc3){var _0x23f3a4=this;return new Promise(function(_0xcbf1f1,_0x1dd665){return db[_0xc583('0x13')]['find']({'raw':_0x390bc3[_0xc583('0x14')]?_0x390bc3['options']['raw']===undefined?!![]:![]:!![],'where':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')][_0xc583('0x16')]||null:null,'attributes':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')]['attributes']||null:null,'include':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')][_0xc583('0x1a')]?_['map'](_0x390bc3[_0xc583('0x14')]['include'],function(_0x1aa62a){return{'model':db[_0x1aa62a[_0xc583('0x1b')]],'as':_0x1aa62a['as'],'attributes':_0x1aa62a[_0xc583('0x17')],'include':_0x1aa62a[_0xc583('0x1a')]?_[_0xc583('0x19')](_0x1aa62a['include'],function(_0x242728){return{'model':db[_0x242728['model']],'as':_0x242728['as'],'attributes':_0x242728[_0xc583('0x17')],'include':_0x242728['include']?_[_0xc583('0x19')](_0x242728[_0xc583('0x1a')],function(_0x7d89d0){return{'model':db[_0x7d89d0[_0xc583('0x1b')]],'as':_0x7d89d0['as'],'attributes':_0x7d89d0[_0xc583('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc583('0xa')](function(_0x54200c){logger['info'](_0xc583('0x1f'),_0x390bc3);logger[_0xc583('0x1c')]('ShowFreshsalesAccount',_0x390bc3,JSON[_0xc583('0x1d')](_0x54200c));_0xcbf1f1(_0x54200c);})[_0xc583('0x1e')](function(_0x22de5a){logger[_0xc583('0xf')](_0xc583('0x1f'),_0x22de5a[_0xc583('0x10')],_0x390bc3);_0x1dd665(_0x23f3a4['error'](0x1f4,_0x22de5a[_0xc583('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d14b012..677e375 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 _0x7fd6=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7fd6,0x1bd));var _0x67fd=function(_0x2195ab,_0x1e2840){_0x2195ab=_0x2195ab-0x0;var _0x19aa12=_0x7fd6[_0x2195ab];return _0x19aa12;};'use strict';var multer=require(_0x67fd('0x0'));var util=require(_0x67fd('0x1'));var path=require(_0x67fd('0x2'));var timeout=require(_0x67fd('0x3'));var express=require('express');var router=express[_0x67fd('0x4')]();var fs_extra=require(_0x67fd('0x5'));var auth=require(_0x67fd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x67fd('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x67fd('0x8')]('/',auth[_0x67fd('0x9')](),controller[_0x67fd('0xa')]);router['get'](_0x67fd('0xb'),auth[_0x67fd('0x9')](),controller['show']);router[_0x67fd('0x8')]('/:id/subjects',auth[_0x67fd('0x9')](),controller[_0x67fd('0xc')]);router[_0x67fd('0x8')](_0x67fd('0xd'),auth[_0x67fd('0x9')](),controller[_0x67fd('0xe')]);router[_0x67fd('0x8')](_0x67fd('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x67fd('0x10')]('/',auth[_0x67fd('0x9')](),controller[_0x67fd('0x11')]);router[_0x67fd('0x12')]('/:id',auth[_0x67fd('0x9')](),controller[_0x67fd('0x13')]);router[_0x67fd('0x14')](_0x67fd('0xb'),auth[_0x67fd('0x9')](),controller[_0x67fd('0x15')]);module['exports']=router; \ No newline at end of file +var _0x62d3=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','delete','destroy','multer','util'];(function(_0x2766e9,_0x59e726){var _0x287b14=function(_0x4a529d){while(--_0x4a529d){_0x2766e9['push'](_0x2766e9['shift']());}};_0x287b14(++_0x59e726);}(_0x62d3,0x18e));var _0x362d=function(_0x2a2c81,_0x30e8f7){_0x2a2c81=_0x2a2c81-0x0;var _0x18fc65=_0x62d3[_0x2a2c81];return _0x18fc65;};'use strict';var multer=require(_0x362d('0x0'));var util=require(_0x362d('0x1'));var path=require(_0x362d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x362d('0x3'));var interaction=require(_0x362d('0x4'));var config=require(_0x362d('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x362d('0x6')](),controller[_0x362d('0x7')]);router[_0x362d('0x8')](_0x362d('0x9'),auth[_0x362d('0x6')](),controller['show']);router[_0x362d('0x8')](_0x362d('0xa'),auth[_0x362d('0x6')](),controller[_0x362d('0xb')]);router[_0x362d('0x8')](_0x362d('0xc'),auth['isAuthenticated'](),controller[_0x362d('0xd')]);router[_0x362d('0x8')](_0x362d('0xe'),auth[_0x362d('0x6')](),controller[_0x362d('0xf')]);router[_0x362d('0x10')]('/',auth['isAuthenticated'](),controller[_0x362d('0x11')]);router['put'](_0x362d('0x9'),auth[_0x362d('0x6')](),controller['update']);router[_0x362d('0x12')](_0x362d('0x9'),auth[_0x362d('0x6')](),controller[_0x362d('0x13')]);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 f016696..cefea2e 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 _0xfeaf=['sequelize','exports'];(function(_0x5e7d0c,_0x56ba7b){var _0xc24371=function(_0x1754d4){while(--_0x1754d4){_0x5e7d0c['push'](_0x5e7d0c['shift']());}};_0xc24371(++_0x56ba7b);}(_0xfeaf,0x14a));var _0xffea=function(_0x121551,_0x264974){_0x121551=_0x121551-0x0;var _0x19fbbc=_0xfeaf[_0x121551];return _0x19fbbc;};'use strict';var Sequelize=require(_0xffea('0x0'));module[_0xffea('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x737e=['sequelize','exports','STRING'];(function(_0x4329f3,_0x4f3ade){var _0x4ff413=function(_0x16ed06){while(--_0x16ed06){_0x4329f3['push'](_0x4329f3['shift']());}};_0x4ff413(++_0x4f3ade);}(_0x737e,0x14a));var _0xe737=function(_0x46fc15,_0x1d6053){_0x46fc15=_0x46fc15-0x0;var _0x48b3dc=_0x737e[_0x46fc15];return _0x48b3dc;};'use strict';var Sequelize=require(_0xe737('0x0'));module[_0xe737('0x1')]={'name':{'type':Sequelize[_0xe737('0x2')]},'description':{'type':Sequelize[_0xe737('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 84efdf0..0e3d3e0 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 _0xf968=['options','include','findAll','rows','catch','show','params','intersection','fields','includeAll','find','create','body','update','getSubjects','findOne','FreshsalesField','order','nolimit','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x169b36,_0x353028){var _0x2c179a=function(_0x45e9c1){while(--_0x45e9c1){_0x169b36['push'](_0x169b36['shift']());}};_0x2c179a(++_0x353028);}(_0xf968,0x1a5));var _0x8f96=function(_0x52a359,_0x36f744){_0x52a359=_0x52a359-0x0;var _0x8e76df=_0xf968[_0x52a359];return _0x8e76df;};'use strict';var emlformat=require(_0x8f96('0x0'));var rimraf=require(_0x8f96('0x1'));var zipdir=require(_0x8f96('0x2'));var jsonpatch=require(_0x8f96('0x3'));var rp=require(_0x8f96('0x4'));var moment=require(_0x8f96('0x5'));var BPromise=require(_0x8f96('0x6'));var Mustache=require('mustache');var util=require(_0x8f96('0x7'));var path=require(_0x8f96('0x8'));var sox=require(_0x8f96('0x9'));var csv=require(_0x8f96('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f96('0xb'));var _=require(_0x8f96('0xc'));var squel=require(_0x8f96('0xd'));var crypto=require(_0x8f96('0xe'));var jsforce=require(_0x8f96('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f96('0x10'));var Papa=require(_0x8f96('0x11'));var Redis=require(_0x8f96('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8f96('0x13'));var as=require(_0x8f96('0x14'));var hardwareService=require(_0x8f96('0x15'));var logger=require(_0x8f96('0x16'))('api');var utils=require(_0x8f96('0x17'));var config=require(_0x8f96('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x80bc87,_0x209540){_0x209540=_0x209540||0xcc;return function(_0xa7fef1){if(_0xa7fef1){return _0x80bc87[_0x8f96('0x19')](_0x209540);}return _0x80bc87[_0x8f96('0x1a')](_0x209540)[_0x8f96('0x1b')]();};}function respondWithResult(_0x4ae8e4,_0x28bfa2){_0x28bfa2=_0x28bfa2||0xc8;return function(_0x357792){if(_0x357792){return _0x4ae8e4[_0x8f96('0x1a')](_0x28bfa2)[_0x8f96('0x1c')](_0x357792);}};}function respondWithFilteredResult(_0x4014d6,_0x9b3f82){return function(_0x55af2d){if(_0x55af2d){var _0x4717b5=typeof _0x9b3f82[_0x8f96('0x1d')]===_0x8f96('0x1e')&&typeof _0x9b3f82['limit']===_0x8f96('0x1e');var _0x122931=_0x55af2d[_0x8f96('0x1f')];var _0x277c6e=_0x4717b5?0x0:_0x9b3f82[_0x8f96('0x1d')];var _0x1e58d8=_0x4717b5?_0x55af2d[_0x8f96('0x1f')]:_0x9b3f82['offset']+_0x9b3f82['limit'];var _0x45cced;if(_0x1e58d8>=_0x122931){_0x1e58d8=_0x122931;_0x45cced=0xc8;}else{_0x45cced=0xce;}_0x4014d6[_0x8f96('0x1a')](_0x45cced);return _0x4014d6['set'](_0x8f96('0x20'),_0x277c6e+'-'+_0x1e58d8+'/'+_0x122931)['json'](_0x55af2d);}return null;};}function patchUpdates(_0xfccc01){return function(_0x222da6){try{jsonpatch['apply'](_0x222da6,_0xfccc01,!![]);}catch(_0x5dc4e8){return BPromise[_0x8f96('0x21')](_0x5dc4e8);}return _0x222da6[_0x8f96('0x22')]();};}function saveUpdates(_0x581311,_0x43400f){return function(_0xaf7a14){if(_0xaf7a14){return _0xaf7a14['update'](_0x581311)[_0x8f96('0x23')](function(_0x3053f6){return _0x3053f6;});}return null;};}function removeEntity(_0x3809ad,_0x2cb52e){return function(_0x536de4){if(_0x536de4){return _0x536de4[_0x8f96('0x24')]()['then'](function(){_0x3809ad[_0x8f96('0x1a')](0xcc)[_0x8f96('0x1b')]();});}};}function handleEntityNotFound(_0x37f4e2,_0x3da343){return function(_0x1ce1a1){if(!_0x1ce1a1){_0x37f4e2[_0x8f96('0x19')](0x194);}return _0x1ce1a1;};}function handleError(_0xc4d5c2,_0xf67661){_0xf67661=_0xf67661||0x1f4;return function(_0x548ab5){logger['error'](_0x548ab5[_0x8f96('0x25')]);if(_0x548ab5[_0x8f96('0x26')]){delete _0x548ab5[_0x8f96('0x26')];}_0xc4d5c2[_0x8f96('0x1a')](_0xf67661)['send'](_0x548ab5);};}exports[_0x8f96('0x27')]=function(_0x544fd4,_0x49bb9e){var _0x5ec4d1={},_0x1ff2b3={},_0x40b5d3={'count':0x0,'rows':[]};var _0x20059c=_[_0x8f96('0x28')](db[_0x8f96('0x29')][_0x8f96('0x2a')],function(_0x2d09c7){return{'name':_0x2d09c7[_0x8f96('0x2b')],'type':_0x2d09c7[_0x8f96('0x2c')]['key']};});_0x1ff2b3[_0x8f96('0x2d')]=_[_0x8f96('0x28')](_0x20059c,_0x8f96('0x26'));_0x1ff2b3['query']=_[_0x8f96('0x2e')](_0x544fd4[_0x8f96('0x2f')]);_0x1ff2b3[_0x8f96('0x30')]=_['intersection'](_0x1ff2b3[_0x8f96('0x2d')],_0x1ff2b3[_0x8f96('0x2f')]);_0x5ec4d1['attributes']=_['intersection'](_0x1ff2b3[_0x8f96('0x2d')],qs['fields'](_0x544fd4[_0x8f96('0x2f')]['fields']));_0x5ec4d1[_0x8f96('0x31')]=_0x5ec4d1[_0x8f96('0x31')][_0x8f96('0x32')]?_0x5ec4d1[_0x8f96('0x31')]:_0x1ff2b3[_0x8f96('0x2d')];if(!_0x544fd4[_0x8f96('0x2f')][_0x8f96('0x33')]('nolimit')){_0x5ec4d1[_0x8f96('0x34')]=qs[_0x8f96('0x34')](_0x544fd4['query']['limit']);_0x5ec4d1[_0x8f96('0x1d')]=qs[_0x8f96('0x1d')](_0x544fd4['query'][_0x8f96('0x1d')]);}_0x5ec4d1['order']=qs[_0x8f96('0x35')](_0x544fd4[_0x8f96('0x2f')]['sort']);_0x5ec4d1[_0x8f96('0x36')]=qs[_0x8f96('0x30')](_[_0x8f96('0x37')](_0x544fd4['query'],_0x1ff2b3['filters']),_0x20059c);if(_0x544fd4[_0x8f96('0x2f')][_0x8f96('0x38')]){_0x5ec4d1['where']=_[_0x8f96('0x39')](_0x5ec4d1[_0x8f96('0x36')],{'$or':_[_0x8f96('0x28')](_0x20059c,function(_0x5d2f59){if(_0x5d2f59[_0x8f96('0x2c')]!==_0x8f96('0x3a')){var _0x5acf7c={};_0x5acf7c[_0x5d2f59['name']]={'$like':'%'+_0x544fd4[_0x8f96('0x2f')]['filter']+'%'};return _0x5acf7c;}})});}_0x5ec4d1=_['merge']({},_0x5ec4d1,_0x544fd4[_0x8f96('0x3b')]);var _0x13b71a={'where':_0x5ec4d1[_0x8f96('0x36')]};return db[_0x8f96('0x29')][_0x8f96('0x1f')](_0x13b71a)['then'](function(_0x467ed6){_0x40b5d3[_0x8f96('0x1f')]=_0x467ed6;if(_0x544fd4['query']['includeAll']){_0x5ec4d1[_0x8f96('0x3c')]=[{'all':!![]}];}return db[_0x8f96('0x29')][_0x8f96('0x3d')](_0x5ec4d1);})[_0x8f96('0x23')](function(_0x4a2d0){_0x40b5d3[_0x8f96('0x3e')]=_0x4a2d0;return _0x40b5d3;})[_0x8f96('0x23')](respondWithFilteredResult(_0x49bb9e,_0x5ec4d1))[_0x8f96('0x3f')](handleError(_0x49bb9e,null));};exports[_0x8f96('0x40')]=function(_0x45c715,_0x5ebc26){var _0x4a2a37={'raw':![],'where':{'id':_0x45c715[_0x8f96('0x41')]['id']}},_0x23fcd9={};_0x23fcd9[_0x8f96('0x2d')]=_[_0x8f96('0x2e')](db[_0x8f96('0x29')][_0x8f96('0x2a')]);_0x23fcd9[_0x8f96('0x2f')]=_[_0x8f96('0x2e')](_0x45c715[_0x8f96('0x2f')]);_0x23fcd9[_0x8f96('0x30')]=_[_0x8f96('0x42')](_0x23fcd9[_0x8f96('0x2d')],_0x23fcd9[_0x8f96('0x2f')]);_0x4a2a37[_0x8f96('0x31')]=_[_0x8f96('0x42')](_0x23fcd9['model'],qs[_0x8f96('0x43')](_0x45c715[_0x8f96('0x2f')][_0x8f96('0x43')]));_0x4a2a37['attributes']=_0x4a2a37[_0x8f96('0x31')][_0x8f96('0x32')]?_0x4a2a37[_0x8f96('0x31')]:_0x23fcd9[_0x8f96('0x2d')];if(_0x45c715['query'][_0x8f96('0x44')]){_0x4a2a37[_0x8f96('0x3c')]=[{'all':!![]}];}_0x4a2a37=_[_0x8f96('0x39')]({},_0x4a2a37,_0x45c715['options']);return db[_0x8f96('0x29')][_0x8f96('0x45')](_0x4a2a37)['then'](handleEntityNotFound(_0x5ebc26,null))[_0x8f96('0x23')](respondWithResult(_0x5ebc26,null))['catch'](handleError(_0x5ebc26,null));};exports[_0x8f96('0x46')]=function(_0x503ee2,_0x5b5dc0){return db[_0x8f96('0x29')][_0x8f96('0x46')](_0x503ee2[_0x8f96('0x47')],{})['then'](respondWithResult(_0x5b5dc0,0xc9))[_0x8f96('0x3f')](handleError(_0x5b5dc0,null));};exports[_0x8f96('0x48')]=function(_0xf43a42,_0x344e83){if(_0xf43a42[_0x8f96('0x47')]['id']){delete _0xf43a42[_0x8f96('0x47')]['id'];}return db[_0x8f96('0x29')]['find']({'where':{'id':_0xf43a42[_0x8f96('0x41')]['id']}})['then'](handleEntityNotFound(_0x344e83,null))[_0x8f96('0x23')](saveUpdates(_0xf43a42[_0x8f96('0x47')],null))['then'](respondWithResult(_0x344e83,null))[_0x8f96('0x3f')](handleError(_0x344e83,null));};exports[_0x8f96('0x24')]=function(_0x295b77,_0x3af6c8){return db[_0x8f96('0x29')][_0x8f96('0x45')]({'where':{'id':_0x295b77['params']['id']}})[_0x8f96('0x23')](handleEntityNotFound(_0x3af6c8,null))[_0x8f96('0x23')](removeEntity(_0x3af6c8,null))[_0x8f96('0x3f')](handleError(_0x3af6c8,null));};exports[_0x8f96('0x49')]=function(_0x35ca93,_0x165123,_0x25c2d8){var _0x224c6d={};var _0x510b49={};var _0x34403f;var _0x42a688;return db[_0x8f96('0x29')][_0x8f96('0x4a')]({'where':{'id':_0x35ca93[_0x8f96('0x41')]['id']}})[_0x8f96('0x23')](handleEntityNotFound(_0x165123,null))[_0x8f96('0x23')](function(_0x46c3f4){if(_0x46c3f4){_0x34403f=_0x46c3f4;_0x510b49[_0x8f96('0x2d')]=_[_0x8f96('0x2e')](db[_0x8f96('0x4b')][_0x8f96('0x2a')]);_0x510b49[_0x8f96('0x2f')]=_['keys'](_0x35ca93[_0x8f96('0x2f')]);_0x510b49[_0x8f96('0x30')]=_[_0x8f96('0x42')](_0x510b49[_0x8f96('0x2d')],_0x510b49[_0x8f96('0x2f')]);_0x224c6d['attributes']=_['intersection'](_0x510b49['model'],qs['fields'](_0x35ca93[_0x8f96('0x2f')][_0x8f96('0x43')]));_0x224c6d['attributes']=_0x224c6d[_0x8f96('0x31')]['length']?_0x224c6d['attributes']:_0x510b49[_0x8f96('0x2d')];_0x224c6d[_0x8f96('0x4c')]=qs[_0x8f96('0x35')](_0x35ca93[_0x8f96('0x2f')]['sort']);_0x224c6d[_0x8f96('0x36')]=qs[_0x8f96('0x30')](_['pick'](_0x35ca93[_0x8f96('0x2f')],_0x510b49[_0x8f96('0x30')]));if(_0x35ca93[_0x8f96('0x2f')][_0x8f96('0x38')]){_0x224c6d['where']=_['merge'](_0x224c6d[_0x8f96('0x36')],{'$or':_[_0x8f96('0x28')](_0x224c6d[_0x8f96('0x31')],function(_0x58a479){var _0x1bc075={};_0x1bc075[_0x58a479]={'$like':'%'+_0x35ca93[_0x8f96('0x2f')][_0x8f96('0x38')]+'%'};return _0x1bc075;})});}_0x224c6d=_[_0x8f96('0x39')]({},_0x224c6d,_0x35ca93[_0x8f96('0x3b')]);return _0x34403f[_0x8f96('0x49')](_0x224c6d);}})[_0x8f96('0x23')](function(_0x43d841){if(_0x43d841){_0x42a688=_0x43d841['length'];if(!_0x35ca93[_0x8f96('0x2f')][_0x8f96('0x33')](_0x8f96('0x4d'))){_0x224c6d[_0x8f96('0x34')]=qs['limit'](_0x35ca93['query'][_0x8f96('0x34')]);_0x224c6d[_0x8f96('0x1d')]=qs['offset'](_0x35ca93[_0x8f96('0x2f')]['offset']);}return _0x34403f['getSubjects'](_0x224c6d);}})['then'](function(_0x1be757){if(_0x1be757){return _0x1be757?{'count':_0x42a688,'rows':_0x1be757}:null;}})['then'](respondWithResult(_0x165123,null))['catch'](handleError(_0x165123,null));};exports[_0x8f96('0x4e')]=function(_0x5ab76a,_0x3641bd,_0x27b0e2){var _0x358bb9={};var _0x3dd0ff={};var _0x2194ba;var _0x23999c;return db[_0x8f96('0x29')][_0x8f96('0x4a')]({'where':{'id':_0x5ab76a[_0x8f96('0x41')]['id']}})[_0x8f96('0x23')](handleEntityNotFound(_0x3641bd,null))[_0x8f96('0x23')](function(_0x79a093){if(_0x79a093){_0x2194ba=_0x79a093;_0x3dd0ff[_0x8f96('0x2d')]=_['keys'](db[_0x8f96('0x4b')][_0x8f96('0x2a')]);_0x3dd0ff[_0x8f96('0x2f')]=_['keys'](_0x5ab76a[_0x8f96('0x2f')]);_0x3dd0ff[_0x8f96('0x30')]=_[_0x8f96('0x42')](_0x3dd0ff[_0x8f96('0x2d')],_0x3dd0ff[_0x8f96('0x2f')]);_0x358bb9[_0x8f96('0x31')]=_[_0x8f96('0x42')](_0x3dd0ff[_0x8f96('0x2d')],qs[_0x8f96('0x43')](_0x5ab76a[_0x8f96('0x2f')][_0x8f96('0x43')]));_0x358bb9[_0x8f96('0x31')]=_0x358bb9['attributes'][_0x8f96('0x32')]?_0x358bb9[_0x8f96('0x31')]:_0x3dd0ff['model'];_0x358bb9[_0x8f96('0x4c')]=qs['sort'](_0x5ab76a[_0x8f96('0x2f')]['sort']);_0x358bb9[_0x8f96('0x36')]=qs[_0x8f96('0x30')](_[_0x8f96('0x37')](_0x5ab76a['query'],_0x3dd0ff[_0x8f96('0x30')]));if(_0x5ab76a[_0x8f96('0x2f')][_0x8f96('0x38')]){_0x358bb9[_0x8f96('0x36')]=_[_0x8f96('0x39')](_0x358bb9[_0x8f96('0x36')],{'$or':_[_0x8f96('0x28')](_0x358bb9[_0x8f96('0x31')],function(_0x1ab117){var _0x3fd88a={};_0x3fd88a[_0x1ab117]={'$like':'%'+_0x5ab76a[_0x8f96('0x2f')][_0x8f96('0x38')]+'%'};return _0x3fd88a;})});}_0x358bb9=_[_0x8f96('0x39')]({},_0x358bb9,_0x5ab76a[_0x8f96('0x3b')]);return _0x2194ba['getDescriptions'](_0x358bb9);}})[_0x8f96('0x23')](function(_0x404158){if(_0x404158){_0x23999c=_0x404158[_0x8f96('0x32')];if(!_0x5ab76a[_0x8f96('0x2f')][_0x8f96('0x33')](_0x8f96('0x4d'))){_0x358bb9[_0x8f96('0x34')]=qs[_0x8f96('0x34')](_0x5ab76a[_0x8f96('0x2f')][_0x8f96('0x34')]);_0x358bb9['offset']=qs['offset'](_0x5ab76a[_0x8f96('0x2f')]['offset']);}return _0x2194ba[_0x8f96('0x4e')](_0x358bb9);}})[_0x8f96('0x23')](function(_0x2b317e){if(_0x2b317e){return _0x2b317e?{'count':_0x23999c,'rows':_0x2b317e}:null;}})['then'](respondWithResult(_0x3641bd,null))['catch'](handleError(_0x3641bd,null));};exports[_0x8f96('0x4f')]=function(_0x4429f8,_0x3c915e,_0x3b0f89){var _0x2505aa={};var _0x3491d3={};var _0x152608;var _0x525509;return db[_0x8f96('0x29')][_0x8f96('0x4a')]({'where':{'id':_0x4429f8['params']['id']}})[_0x8f96('0x23')](handleEntityNotFound(_0x3c915e,null))[_0x8f96('0x23')](function(_0x50381b){if(_0x50381b){_0x152608=_0x50381b;_0x3491d3[_0x8f96('0x2d')]=_['keys'](db[_0x8f96('0x4b')][_0x8f96('0x2a')]);_0x3491d3['query']=_[_0x8f96('0x2e')](_0x4429f8[_0x8f96('0x2f')]);_0x3491d3[_0x8f96('0x30')]=_[_0x8f96('0x42')](_0x3491d3[_0x8f96('0x2d')],_0x3491d3[_0x8f96('0x2f')]);_0x2505aa['attributes']=_[_0x8f96('0x42')](_0x3491d3['model'],qs[_0x8f96('0x43')](_0x4429f8[_0x8f96('0x2f')][_0x8f96('0x43')]));_0x2505aa[_0x8f96('0x31')]=_0x2505aa[_0x8f96('0x31')]['length']?_0x2505aa[_0x8f96('0x31')]:_0x3491d3['model'];_0x2505aa[_0x8f96('0x4c')]=qs[_0x8f96('0x35')](_0x4429f8[_0x8f96('0x2f')]['sort']);_0x2505aa[_0x8f96('0x36')]=qs[_0x8f96('0x30')](_[_0x8f96('0x37')](_0x4429f8[_0x8f96('0x2f')],_0x3491d3['filters']));if(_0x4429f8['query']['filter']){_0x2505aa[_0x8f96('0x36')]=_[_0x8f96('0x39')](_0x2505aa[_0x8f96('0x36')],{'$or':_[_0x8f96('0x28')](_0x2505aa[_0x8f96('0x31')],function(_0x5015fb){var _0x354ccc={};_0x354ccc[_0x5015fb]={'$like':'%'+_0x4429f8[_0x8f96('0x2f')][_0x8f96('0x38')]+'%'};return _0x354ccc;})});}_0x2505aa=_[_0x8f96('0x39')]({},_0x2505aa,_0x4429f8['options']);return _0x152608[_0x8f96('0x4f')](_0x2505aa);}})['then'](function(_0x190832){if(_0x190832){_0x525509=_0x190832[_0x8f96('0x32')];if(!_0x4429f8[_0x8f96('0x2f')][_0x8f96('0x33')](_0x8f96('0x4d'))){_0x2505aa[_0x8f96('0x34')]=qs['limit'](_0x4429f8[_0x8f96('0x2f')][_0x8f96('0x34')]);_0x2505aa[_0x8f96('0x1d')]=qs[_0x8f96('0x1d')](_0x4429f8[_0x8f96('0x2f')][_0x8f96('0x1d')]);}return _0x152608['getFields'](_0x2505aa);}})['then'](function(_0x4f5e37){if(_0x4f5e37){return _0x4f5e37?{'count':_0x525509,'rows':_0x4f5e37}:null;}})['then'](respondWithResult(_0x3c915e,null))[_0x8f96('0x3f')](handleError(_0x3c915e,null));}; \ No newline at end of file +var _0x762f=['undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','send','index','map','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','name','merge','options','findAll','rows','catch','FreshsalesConfiguration','include','find','create','body','params','getSubjects','findOne','rawAttributes','getDescriptions','getFields','FreshsalesField','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x762f,0x122));var _0xf762=function(_0x434b74,_0x358bca){_0x434b74=_0x434b74-0x0;var _0x43abb1=_0x762f[_0x434b74];return _0x43abb1;};'use strict';var emlformat=require(_0xf762('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf762('0x1'));var jsonpatch=require(_0xf762('0x2'));var rp=require(_0xf762('0x3'));var moment=require(_0xf762('0x4'));var BPromise=require(_0xf762('0x5'));var Mustache=require('mustache');var util=require(_0xf762('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf762('0x7'));var ejs=require(_0xf762('0x8'));var fs=require('fs');var fs_extra=require(_0xf762('0x9'));var _=require(_0xf762('0xa'));var squel=require(_0xf762('0xb'));var crypto=require(_0xf762('0xc'));var jsforce=require(_0xf762('0xd'));var deskjs=require(_0xf762('0xe'));var toCsv=require(_0xf762('0x7'));var querystring=require(_0xf762('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf762('0x10'));var as=require(_0xf762('0x11'));var hardwareService=require(_0xf762('0x12'));var logger=require(_0xf762('0x13'))(_0xf762('0x14'));var utils=require(_0xf762('0x15'));var config=require(_0xf762('0x16'));var licenseUtil=require(_0xf762('0x17'));var db=require(_0xf762('0x18'))['db'];function respondWithStatusCode(_0x9e3de9,_0xcccef4){_0xcccef4=_0xcccef4||0xcc;return function(_0xff99aa){if(_0xff99aa){return _0x9e3de9[_0xf762('0x19')](_0xcccef4);}return _0x9e3de9['status'](_0xcccef4)[_0xf762('0x1a')]();};}function respondWithResult(_0x2cc795,_0x25cfed){_0x25cfed=_0x25cfed||0xc8;return function(_0x41dbe3){if(_0x41dbe3){return _0x2cc795[_0xf762('0x1b')](_0x25cfed)[_0xf762('0x1c')](_0x41dbe3);}};}function respondWithFilteredResult(_0x4a077d,_0x3703e7){return function(_0xfc3fb4){if(_0xfc3fb4){var _0x58db4c=typeof _0x3703e7[_0xf762('0x1d')]==='undefined'&&typeof _0x3703e7['limit']===_0xf762('0x1e');var _0x40d060=_0xfc3fb4[_0xf762('0x1f')];var _0x4d3d8b=_0x58db4c?0x0:_0x3703e7[_0xf762('0x1d')];var _0x29de24=_0x58db4c?_0xfc3fb4[_0xf762('0x1f')]:_0x3703e7[_0xf762('0x1d')]+_0x3703e7[_0xf762('0x20')];var _0x139c50;if(_0x29de24>=_0x40d060){_0x29de24=_0x40d060;_0x139c50=0xc8;}else{_0x139c50=0xce;}_0x4a077d[_0xf762('0x1b')](_0x139c50);return _0x4a077d[_0xf762('0x21')](_0xf762('0x22'),_0x4d3d8b+'-'+_0x29de24+'/'+_0x40d060)[_0xf762('0x1c')](_0xfc3fb4);}return null;};}function patchUpdates(_0x5bf95f){return function(_0x59d2c7){try{jsonpatch[_0xf762('0x23')](_0x59d2c7,_0x5bf95f,!![]);}catch(_0x1692f7){return BPromise['reject'](_0x1692f7);}return _0x59d2c7[_0xf762('0x24')]();};}function saveUpdates(_0x13f2b,_0x59348f){return function(_0x9b6385){if(_0x9b6385){return _0x9b6385[_0xf762('0x25')](_0x13f2b)[_0xf762('0x26')](function(_0x350e0c){return _0x350e0c;});}return null;};}function removeEntity(_0x2a988f,_0x10c8cd){return function(_0x52a9d3){if(_0x52a9d3){return _0x52a9d3[_0xf762('0x27')]()[_0xf762('0x26')](function(){_0x2a988f[_0xf762('0x1b')](0xcc)[_0xf762('0x1a')]();});}};}function handleEntityNotFound(_0x5bbb2c,_0x36dc06){return function(_0x53780a){if(!_0x53780a){_0x5bbb2c[_0xf762('0x19')](0x194);}return _0x53780a;};}function handleError(_0x17c3aa,_0x50bfab){_0x50bfab=_0x50bfab||0x1f4;return function(_0x4f3923){logger['error'](_0x4f3923[_0xf762('0x28')]);if(_0x4f3923['name']){delete _0x4f3923['name'];}_0x17c3aa[_0xf762('0x1b')](_0x50bfab)[_0xf762('0x29')](_0x4f3923);};}exports[_0xf762('0x2a')]=function(_0x55ac9f,_0x30e1ff){var _0x552eb9={},_0xf6f7a6={},_0x35e2c1={'count':0x0,'rows':[]};var _0x208c44=_[_0xf762('0x2b')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x4da3c8){return{'name':_0x4da3c8[_0xf762('0x2c')],'type':_0x4da3c8['type']['key']};});_0xf6f7a6['model']=_[_0xf762('0x2b')](_0x208c44,'name');_0xf6f7a6['query']=_[_0xf762('0x2d')](_0x55ac9f[_0xf762('0x2e')]);_0xf6f7a6[_0xf762('0x2f')]=_[_0xf762('0x30')](_0xf6f7a6[_0xf762('0x31')],_0xf6f7a6['query']);_0x552eb9[_0xf762('0x32')]=_[_0xf762('0x30')](_0xf6f7a6[_0xf762('0x31')],qs['fields'](_0x55ac9f[_0xf762('0x2e')][_0xf762('0x33')]));_0x552eb9[_0xf762('0x32')]=_0x552eb9[_0xf762('0x32')][_0xf762('0x34')]?_0x552eb9[_0xf762('0x32')]:_0xf6f7a6[_0xf762('0x31')];if(!_0x55ac9f[_0xf762('0x2e')][_0xf762('0x35')](_0xf762('0x36'))){_0x552eb9[_0xf762('0x20')]=qs[_0xf762('0x20')](_0x55ac9f['query'][_0xf762('0x20')]);_0x552eb9[_0xf762('0x1d')]=qs[_0xf762('0x1d')](_0x55ac9f[_0xf762('0x2e')][_0xf762('0x1d')]);}_0x552eb9[_0xf762('0x37')]=qs[_0xf762('0x38')](_0x55ac9f[_0xf762('0x2e')][_0xf762('0x38')]);_0x552eb9[_0xf762('0x39')]=qs[_0xf762('0x2f')](_[_0xf762('0x3a')](_0x55ac9f[_0xf762('0x2e')],_0xf6f7a6[_0xf762('0x2f')]),_0x208c44);if(_0x55ac9f[_0xf762('0x2e')][_0xf762('0x3b')]){_0x552eb9[_0xf762('0x39')]=_['merge'](_0x552eb9['where'],{'$or':_[_0xf762('0x2b')](_0x208c44,function(_0x6b37cc){if(_0x6b37cc[_0xf762('0x3c')]!==_0xf762('0x3d')){var _0x2746ba={};_0x2746ba[_0x6b37cc[_0xf762('0x3e')]]={'$like':'%'+_0x55ac9f[_0xf762('0x2e')][_0xf762('0x3b')]+'%'};return _0x2746ba;}})});}_0x552eb9=_[_0xf762('0x3f')]({},_0x552eb9,_0x55ac9f[_0xf762('0x40')]);var _0x24ea9d={'where':_0x552eb9[_0xf762('0x39')]};return db['FreshsalesConfiguration'][_0xf762('0x1f')](_0x24ea9d)[_0xf762('0x26')](function(_0x4c73ad){_0x35e2c1[_0xf762('0x1f')]=_0x4c73ad;if(_0x55ac9f['query']['includeAll']){_0x552eb9['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xf762('0x41')](_0x552eb9);})[_0xf762('0x26')](function(_0x98336){_0x35e2c1[_0xf762('0x42')]=_0x98336;return _0x35e2c1;})[_0xf762('0x26')](respondWithFilteredResult(_0x30e1ff,_0x552eb9))[_0xf762('0x43')](handleError(_0x30e1ff,null));};exports['show']=function(_0x5eb274,_0x5cea96){var _0x38fcb6={'raw':![],'where':{'id':_0x5eb274['params']['id']}},_0x1a7ac5={};_0x1a7ac5[_0xf762('0x31')]=_['keys'](db[_0xf762('0x44')]['rawAttributes']);_0x1a7ac5['query']=_['keys'](_0x5eb274[_0xf762('0x2e')]);_0x1a7ac5['filters']=_[_0xf762('0x30')](_0x1a7ac5['model'],_0x1a7ac5[_0xf762('0x2e')]);_0x38fcb6[_0xf762('0x32')]=_[_0xf762('0x30')](_0x1a7ac5[_0xf762('0x31')],qs[_0xf762('0x33')](_0x5eb274[_0xf762('0x2e')][_0xf762('0x33')]));_0x38fcb6[_0xf762('0x32')]=_0x38fcb6[_0xf762('0x32')][_0xf762('0x34')]?_0x38fcb6['attributes']:_0x1a7ac5[_0xf762('0x31')];if(_0x5eb274[_0xf762('0x2e')]['includeAll']){_0x38fcb6[_0xf762('0x45')]=[{'all':!![]}];}_0x38fcb6=_[_0xf762('0x3f')]({},_0x38fcb6,_0x5eb274['options']);return db['FreshsalesConfiguration'][_0xf762('0x46')](_0x38fcb6)[_0xf762('0x26')](handleEntityNotFound(_0x5cea96,null))[_0xf762('0x26')](respondWithResult(_0x5cea96,null))[_0xf762('0x43')](handleError(_0x5cea96,null));};exports[_0xf762('0x47')]=function(_0x445f84,_0x5c99f8){return db[_0xf762('0x44')]['create'](_0x445f84[_0xf762('0x48')],{})['then'](respondWithResult(_0x5c99f8,0xc9))[_0xf762('0x43')](handleError(_0x5c99f8,null));};exports[_0xf762('0x25')]=function(_0x18d0d5,_0x50f473){if(_0x18d0d5[_0xf762('0x48')]['id']){delete _0x18d0d5[_0xf762('0x48')]['id'];}return db[_0xf762('0x44')]['find']({'where':{'id':_0x18d0d5[_0xf762('0x49')]['id']}})['then'](handleEntityNotFound(_0x50f473,null))[_0xf762('0x26')](saveUpdates(_0x18d0d5['body'],null))[_0xf762('0x26')](respondWithResult(_0x50f473,null))['catch'](handleError(_0x50f473,null));};exports[_0xf762('0x27')]=function(_0x1df682,_0x43908c){return db['FreshsalesConfiguration'][_0xf762('0x46')]({'where':{'id':_0x1df682['params']['id']}})['then'](handleEntityNotFound(_0x43908c,null))[_0xf762('0x26')](removeEntity(_0x43908c,null))[_0xf762('0x43')](handleError(_0x43908c,null));};exports[_0xf762('0x4a')]=function(_0x5c31fe,_0xb945ca,_0x598992){var _0x3ec788={};var _0x301792={};var _0x3db2af;var _0x48838e;return db[_0xf762('0x44')][_0xf762('0x4b')]({'where':{'id':_0x5c31fe[_0xf762('0x49')]['id']}})['then'](handleEntityNotFound(_0xb945ca,null))[_0xf762('0x26')](function(_0xa974d1){if(_0xa974d1){_0x3db2af=_0xa974d1;_0x301792[_0xf762('0x31')]=_[_0xf762('0x2d')](db['FreshsalesField'][_0xf762('0x4c')]);_0x301792[_0xf762('0x2e')]=_[_0xf762('0x2d')](_0x5c31fe[_0xf762('0x2e')]);_0x301792['filters']=_[_0xf762('0x30')](_0x301792['model'],_0x301792[_0xf762('0x2e')]);_0x3ec788[_0xf762('0x32')]=_[_0xf762('0x30')](_0x301792[_0xf762('0x31')],qs[_0xf762('0x33')](_0x5c31fe[_0xf762('0x2e')][_0xf762('0x33')]));_0x3ec788[_0xf762('0x32')]=_0x3ec788[_0xf762('0x32')][_0xf762('0x34')]?_0x3ec788['attributes']:_0x301792[_0xf762('0x31')];_0x3ec788[_0xf762('0x37')]=qs[_0xf762('0x38')](_0x5c31fe[_0xf762('0x2e')][_0xf762('0x38')]);_0x3ec788[_0xf762('0x39')]=qs[_0xf762('0x2f')](_[_0xf762('0x3a')](_0x5c31fe['query'],_0x301792[_0xf762('0x2f')]));if(_0x5c31fe[_0xf762('0x2e')]['filter']){_0x3ec788[_0xf762('0x39')]=_[_0xf762('0x3f')](_0x3ec788[_0xf762('0x39')],{'$or':_[_0xf762('0x2b')](_0x3ec788[_0xf762('0x32')],function(_0x2d6b59){var _0x10fc3e={};_0x10fc3e[_0x2d6b59]={'$like':'%'+_0x5c31fe[_0xf762('0x2e')][_0xf762('0x3b')]+'%'};return _0x10fc3e;})});}_0x3ec788=_[_0xf762('0x3f')]({},_0x3ec788,_0x5c31fe['options']);return _0x3db2af[_0xf762('0x4a')](_0x3ec788);}})['then'](function(_0x2ee288){if(_0x2ee288){_0x48838e=_0x2ee288[_0xf762('0x34')];if(!_0x5c31fe[_0xf762('0x2e')][_0xf762('0x35')](_0xf762('0x36'))){_0x3ec788[_0xf762('0x20')]=qs['limit'](_0x5c31fe[_0xf762('0x2e')]['limit']);_0x3ec788['offset']=qs[_0xf762('0x1d')](_0x5c31fe['query'][_0xf762('0x1d')]);}return _0x3db2af[_0xf762('0x4a')](_0x3ec788);}})[_0xf762('0x26')](function(_0x3be46d){if(_0x3be46d){return _0x3be46d?{'count':_0x48838e,'rows':_0x3be46d}:null;}})[_0xf762('0x26')](respondWithResult(_0xb945ca,null))[_0xf762('0x43')](handleError(_0xb945ca,null));};exports['getDescriptions']=function(_0x5787a8,_0x1c3956,_0x3f6bd8){var _0x39f3af={};var _0x5b6a61={};var _0x4c990a;var _0x226ad6;return db['FreshsalesConfiguration'][_0xf762('0x4b')]({'where':{'id':_0x5787a8[_0xf762('0x49')]['id']}})[_0xf762('0x26')](handleEntityNotFound(_0x1c3956,null))[_0xf762('0x26')](function(_0x2de9cf){if(_0x2de9cf){_0x4c990a=_0x2de9cf;_0x5b6a61['model']=_[_0xf762('0x2d')](db['FreshsalesField'][_0xf762('0x4c')]);_0x5b6a61[_0xf762('0x2e')]=_['keys'](_0x5787a8[_0xf762('0x2e')]);_0x5b6a61['filters']=_[_0xf762('0x30')](_0x5b6a61[_0xf762('0x31')],_0x5b6a61[_0xf762('0x2e')]);_0x39f3af[_0xf762('0x32')]=_[_0xf762('0x30')](_0x5b6a61[_0xf762('0x31')],qs[_0xf762('0x33')](_0x5787a8['query'][_0xf762('0x33')]));_0x39f3af[_0xf762('0x32')]=_0x39f3af[_0xf762('0x32')][_0xf762('0x34')]?_0x39f3af[_0xf762('0x32')]:_0x5b6a61[_0xf762('0x31')];_0x39f3af[_0xf762('0x37')]=qs[_0xf762('0x38')](_0x5787a8[_0xf762('0x2e')]['sort']);_0x39f3af[_0xf762('0x39')]=qs['filters'](_['pick'](_0x5787a8[_0xf762('0x2e')],_0x5b6a61['filters']));if(_0x5787a8['query']['filter']){_0x39f3af[_0xf762('0x39')]=_[_0xf762('0x3f')](_0x39f3af['where'],{'$or':_[_0xf762('0x2b')](_0x39f3af[_0xf762('0x32')],function(_0x470686){var _0x1ef67c={};_0x1ef67c[_0x470686]={'$like':'%'+_0x5787a8[_0xf762('0x2e')]['filter']+'%'};return _0x1ef67c;})});}_0x39f3af=_[_0xf762('0x3f')]({},_0x39f3af,_0x5787a8[_0xf762('0x40')]);return _0x4c990a['getDescriptions'](_0x39f3af);}})[_0xf762('0x26')](function(_0x424ea0){if(_0x424ea0){_0x226ad6=_0x424ea0['length'];if(!_0x5787a8[_0xf762('0x2e')][_0xf762('0x35')](_0xf762('0x36'))){_0x39f3af[_0xf762('0x20')]=qs[_0xf762('0x20')](_0x5787a8['query'][_0xf762('0x20')]);_0x39f3af[_0xf762('0x1d')]=qs['offset'](_0x5787a8[_0xf762('0x2e')][_0xf762('0x1d')]);}return _0x4c990a[_0xf762('0x4d')](_0x39f3af);}})[_0xf762('0x26')](function(_0x57fe1e){if(_0x57fe1e){return _0x57fe1e?{'count':_0x226ad6,'rows':_0x57fe1e}:null;}})[_0xf762('0x26')](respondWithResult(_0x1c3956,null))[_0xf762('0x43')](handleError(_0x1c3956,null));};exports[_0xf762('0x4e')]=function(_0x3d589a,_0x125793,_0xc294c8){var _0x158001={};var _0x3858f9={};var _0x425151;var _0x527af2;return db[_0xf762('0x44')]['findOne']({'where':{'id':_0x3d589a[_0xf762('0x49')]['id']}})['then'](handleEntityNotFound(_0x125793,null))[_0xf762('0x26')](function(_0x17c09f){if(_0x17c09f){_0x425151=_0x17c09f;_0x3858f9[_0xf762('0x31')]=_['keys'](db[_0xf762('0x4f')][_0xf762('0x4c')]);_0x3858f9[_0xf762('0x2e')]=_[_0xf762('0x2d')](_0x3d589a['query']);_0x3858f9['filters']=_[_0xf762('0x30')](_0x3858f9[_0xf762('0x31')],_0x3858f9['query']);_0x158001['attributes']=_[_0xf762('0x30')](_0x3858f9['model'],qs[_0xf762('0x33')](_0x3d589a[_0xf762('0x2e')]['fields']));_0x158001['attributes']=_0x158001[_0xf762('0x32')][_0xf762('0x34')]?_0x158001['attributes']:_0x3858f9['model'];_0x158001['order']=qs[_0xf762('0x38')](_0x3d589a[_0xf762('0x2e')][_0xf762('0x38')]);_0x158001[_0xf762('0x39')]=qs[_0xf762('0x2f')](_[_0xf762('0x3a')](_0x3d589a['query'],_0x3858f9[_0xf762('0x2f')]));if(_0x3d589a[_0xf762('0x2e')][_0xf762('0x3b')]){_0x158001[_0xf762('0x39')]=_[_0xf762('0x3f')](_0x158001[_0xf762('0x39')],{'$or':_['map'](_0x158001[_0xf762('0x32')],function(_0xdd4217){var _0x42d0bd={};_0x42d0bd[_0xdd4217]={'$like':'%'+_0x3d589a[_0xf762('0x2e')]['filter']+'%'};return _0x42d0bd;})});}_0x158001=_['merge']({},_0x158001,_0x3d589a[_0xf762('0x40')]);return _0x425151[_0xf762('0x4e')](_0x158001);}})[_0xf762('0x26')](function(_0x38a9e6){if(_0x38a9e6){_0x527af2=_0x38a9e6[_0xf762('0x34')];if(!_0x3d589a['query']['hasOwnProperty'](_0xf762('0x36'))){_0x158001[_0xf762('0x20')]=qs[_0xf762('0x20')](_0x3d589a[_0xf762('0x2e')][_0xf762('0x20')]);_0x158001[_0xf762('0x1d')]=qs[_0xf762('0x1d')](_0x3d589a['query'][_0xf762('0x1d')]);}return _0x425151[_0xf762('0x4e')](_0x158001);}})['then'](function(_0x180823){if(_0x180823){return _0x180823?{'count':_0x527af2,'rows':_0x180823}:null;}})[_0xf762('0x26')](respondWithResult(_0x125793,null))[_0xf762('0x43')](handleError(_0x125793,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index ab2c5a7..e737415 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 _0x7f4f=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7f4f,0xd6));var _0xf7f4=function(_0x4dddaf,_0x4050d2){_0x4dddaf=_0x4dddaf-0x0;var _0x333f82=_0x7f4f[_0x4dddaf];return _0x333f82;};'use strict';var _=require(_0xf7f4('0x0'));var util=require(_0xf7f4('0x1'));var logger=require(_0xf7f4('0x2'))(_0xf7f4('0x3'));var moment=require(_0xf7f4('0x4'));var BPromise=require(_0xf7f4('0x5'));var rp=require(_0xf7f4('0x6'));var fs=require('fs');var path=require(_0xf7f4('0x7'));var rimraf=require(_0xf7f4('0x8'));var config=require(_0xf7f4('0x9'));var attributes=require(_0xf7f4('0xa'));module[_0xf7f4('0xb')]=function(_0x5d9c29,_0x149a1a){return _0x5d9c29[_0xf7f4('0xc')](_0xf7f4('0xd'),attributes,{'tableName':_0xf7f4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd711=['moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xd711,0xcf));var _0x1d71=function(_0x21a1ad,_0x4eab02){_0x21a1ad=_0x21a1ad-0x0;var _0x59e9cc=_0xd711[_0x21a1ad];return _0x59e9cc;};'use strict';var _=require(_0x1d71('0x0'));var util=require('util');var logger=require(_0x1d71('0x1'))('api');var moment=require(_0x1d71('0x2'));var BPromise=require(_0x1d71('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d71('0x4'));var rimraf=require(_0x1d71('0x5'));var config=require(_0x1d71('0x6'));var attributes=require(_0x1d71('0x7'));module['exports']=function(_0x36da1b,_0x2eef96){return _0x36da1b[_0x1d71('0x8')](_0x1d71('0x9'),attributes,{'tableName':_0x1d71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 9a84793..d05bf91 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 _0x3be8=['../../config/utils','rpc','../../config/environment','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','catch','lodash','bluebird','randomstring','../../mysqldb'];(function(_0x20f4d9,_0x446eda){var _0x3c33f1=function(_0x2964a1){while(--_0x2964a1){_0x20f4d9['push'](_0x20f4d9['shift']());}};_0x3c33f1(++_0x446eda);}(_0x3be8,0x164));var _0x83be=function(_0x1189e3,_0x1e9d6c){_0x1189e3=_0x1189e3-0x0;var _0x39d343=_0x3be8[_0x1189e3];return _0x39d343;};'use strict';var _=require(_0x83be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x83be('0x1'));var rs=require(_0x83be('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83be('0x3'))['db'];var utils=require(_0x83be('0x4'));var logger=require('../../config/logger')(_0x83be('0x5'));var config=require(_0x83be('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x83be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x146dfb,_0x28c9d8,_0x1a8a75){return new BPromise(function(_0x549120,_0x3f58b0){return client[_0x83be('0x8')](_0x146dfb,_0x1a8a75)['then'](function(_0x26ab2a){logger[_0x83be('0x9')](_0x83be('0xa'),_0x28c9d8,'request\x20sent');logger[_0x83be('0xb')](_0x83be('0xc'),_0x28c9d8,_0x83be('0xd'),JSON[_0x83be('0xe')](_0x26ab2a));if(_0x26ab2a['error']){if(_0x26ab2a['error'][_0x83be('0xf')]===0x1f4){logger['error'](_0x83be('0xa'),_0x28c9d8,_0x26ab2a['error'][_0x83be('0x10')]);return _0x3f58b0(_0x26ab2a['error']['message']);}logger[_0x83be('0x11')](_0x83be('0xa'),_0x28c9d8,_0x26ab2a[_0x83be('0x11')][_0x83be('0x10')]);return _0x549120(_0x26ab2a['error'][_0x83be('0x10')]);}else{logger['info'](_0x83be('0xa'),_0x28c9d8,_0x83be('0xd'));_0x549120(_0x26ab2a[_0x83be('0x12')][_0x83be('0x10')]);}})[_0x83be('0x13')](function(_0x4a4804){logger[_0x83be('0x11')](_0x83be('0xa'),_0x28c9d8,_0x4a4804);_0x3f58b0(_0x4a4804);});});} \ No newline at end of file +var _0x83dd=['FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x83dd,0xfa));var _0xd83d=function(_0x7fcd74,_0x4a03db){_0x7fcd74=_0x7fcd74-0x0;var _0x5715b8=_0x83dd[_0x7fcd74];return _0x5715b8;};'use strict';var _=require(_0xd83d('0x0'));var util=require(_0xd83d('0x1'));var moment=require(_0xd83d('0x2'));var BPromise=require(_0xd83d('0x3'));var rs=require(_0xd83d('0x4'));var fs=require('fs');var Redis=require(_0xd83d('0x5'));var db=require(_0xd83d('0x6'))['db'];var utils=require(_0xd83d('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd83d('0x8'));var client=jayson[_0xd83d('0x9')][_0xd83d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477950,_0x390493,_0x4806da){return new BPromise(function(_0x31c4b4,_0x569222){return client[_0xd83d('0xb')](_0x477950,_0x4806da)[_0xd83d('0xc')](function(_0x549752){logger[_0xd83d('0xd')](_0xd83d('0xe'),_0x390493,'request\x20sent');logger[_0xd83d('0xf')](_0xd83d('0x10'),_0x390493,_0xd83d('0x11'),JSON['stringify'](_0x549752));if(_0x549752[_0xd83d('0x12')]){if(_0x549752[_0xd83d('0x12')]['code']===0x1f4){logger[_0xd83d('0x12')](_0xd83d('0xe'),_0x390493,_0x549752['error']['message']);return _0x569222(_0x549752[_0xd83d('0x12')][_0xd83d('0x13')]);}logger[_0xd83d('0x12')](_0xd83d('0xe'),_0x390493,_0x549752[_0xd83d('0x12')][_0xd83d('0x13')]);return _0x31c4b4(_0x549752[_0xd83d('0x12')][_0xd83d('0x13')]);}else{logger[_0xd83d('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x390493,_0xd83d('0x11'));_0x31c4b4(_0x549752[_0xd83d('0x14')][_0xd83d('0x13')]);}})[_0xd83d('0x15')](function(_0x489bb2){logger[_0xd83d('0x12')](_0xd83d('0xe'),_0x390493,_0x489bb2);_0x569222(_0x489bb2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index b831035..8d1a010 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 _0xd84b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','delete','/:id','destroy','exports','util','path','connect-timeout'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xd84b,0x177));var _0xbd84=function(_0x5c94d6,_0x2b38a3){_0x5c94d6=_0x5c94d6-0x0;var _0x316263=_0xd84b[_0x5c94d6];return _0x316263;};'use strict';var multer=require('multer');var util=require(_0xbd84('0x0'));var path=require(_0xbd84('0x1'));var timeout=require(_0xbd84('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd84('0x3'));var auth=require(_0xbd84('0x4'));var interaction=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0x8')]);router[_0xbd84('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbd84('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbd84('0xa')](_0xbd84('0xb'),auth[_0xbd84('0x7')](),controller[_0xbd84('0xc')]);module[_0xbd84('0xd')]=router; \ No newline at end of file +var _0x58e5=['util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesField.controller','isAuthenticated','get','/:id','put','update','delete','exports','multer'];(function(_0x1779d1,_0x55acb6){var _0x2884e3=function(_0x2ec4be){while(--_0x2ec4be){_0x1779d1['push'](_0x1779d1['shift']());}};_0x2884e3(++_0x55acb6);}(_0x58e5,0xd1));var _0x558e=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x58e5[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var path=require(_0x558e('0x2'));var timeout=require(_0x558e('0x3'));var express=require(_0x558e('0x4'));var router=express[_0x558e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x558e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x558e('0x7'));router['get']('/',auth[_0x558e('0x8')](),controller['index']);router[_0x558e('0x9')](_0x558e('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x558e('0xb')](_0x558e('0xa'),auth['isAuthenticated'](),controller[_0x558e('0xc')]);router[_0x558e('0xd')](_0x558e('0xa'),auth[_0x558e('0x8')](),controller['destroy']);module[_0x558e('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index c2d9200..c5a4b79 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 _0xf464=['sequelize','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4ad5f2,_0x4b9a8b){var _0x2c86ae=function(_0x54704c){while(--_0x54704c){_0x4ad5f2['push'](_0x4ad5f2['shift']());}};_0x2c86ae(++_0x4b9a8b);}(_0xf464,0x128));var _0x4f46=function(_0x182966,_0x50e3fb){_0x182966=_0x182966-0x0;var _0x17e97a=_0xf464[_0x182966];return _0x17e97a;};'use strict';var Sequelize=require(_0x4f46('0x0'));module['exports']={'type':{'type':Sequelize[_0x4f46('0x1')](_0x4f46('0x2'),_0x4f46('0x3'),'customVariable',_0x4f46('0x4'),_0x4f46('0x5')),'defaultValue':_0x4f46('0x2')},'content':{'type':Sequelize[_0x4f46('0x6')]},'key':{'type':Sequelize[_0x4f46('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x4f46('0x2'),_0x4f46('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4f46('0x6')]},'idField':{'type':Sequelize[_0x4f46('0x6')]},'nameField':{'type':Sequelize[_0x4f46('0x6')]},'customField':{'type':Sequelize[_0x4f46('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f46('0x6')]}}; \ No newline at end of file +var _0xb50c=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb50c,0xc0));var _0xcb50=function(_0x2dbcea,_0x5e578d){_0x2dbcea=_0x2dbcea-0x0;var _0x2227e0=_0xb50c[_0x2dbcea];return _0x2227e0;};'use strict';var Sequelize=require(_0xcb50('0x0'));module['exports']={'type':{'type':Sequelize[_0xcb50('0x1')](_0xcb50('0x2'),_0xcb50('0x3'),_0xcb50('0x4'),_0xcb50('0x5'),'picklist'),'defaultValue':_0xcb50('0x2')},'content':{'type':Sequelize[_0xcb50('0x6')]},'key':{'type':Sequelize[_0xcb50('0x6')]},'keyType':{'type':Sequelize[_0xcb50('0x1')](_0xcb50('0x2'),_0xcb50('0x3'),_0xcb50('0x4'))},'keyContent':{'type':Sequelize[_0xcb50('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcb50('0x6')]},'customField':{'type':Sequelize[_0xcb50('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcb50('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c94a5bb..05d0ba1 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 _0x1702=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','end','stack','name','index','map','FreshsalesField','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x17479d,_0x593129){var _0x2d461c=function(_0x347164){while(--_0x347164){_0x17479d['push'](_0x17479d['shift']());}};_0x2d461c(++_0x593129);}(_0x1702,0x19a));var _0x2170=function(_0x1ab52b,_0x5bfbcd){_0x1ab52b=_0x1ab52b-0x0;var _0x13c48f=_0x1702[_0x1ab52b];return _0x13c48f;};'use strict';var emlformat=require(_0x2170('0x0'));var rimraf=require(_0x2170('0x1'));var zipdir=require(_0x2170('0x2'));var jsonpatch=require(_0x2170('0x3'));var rp=require('request-promise');var moment=require(_0x2170('0x4'));var BPromise=require(_0x2170('0x5'));var Mustache=require(_0x2170('0x6'));var util=require(_0x2170('0x7'));var path=require(_0x2170('0x8'));var sox=require('sox');var csv=require(_0x2170('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2170('0xa'));var _=require(_0x2170('0xb'));var squel=require(_0x2170('0xc'));var crypto=require('crypto');var jsforce=require(_0x2170('0xd'));var deskjs=require(_0x2170('0xe'));var toCsv=require(_0x2170('0x9'));var querystring=require(_0x2170('0xf'));var Papa=require(_0x2170('0x10'));var Redis=require(_0x2170('0x11'));var authService=require(_0x2170('0x12'));var qs=require(_0x2170('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2170('0x14'));var logger=require(_0x2170('0x15'))(_0x2170('0x16'));var utils=require(_0x2170('0x17'));var config=require(_0x2170('0x18'));var licenseUtil=require(_0x2170('0x19'));var db=require(_0x2170('0x1a'))['db'];function respondWithStatusCode(_0x5b9023,_0x44eb5a){_0x44eb5a=_0x44eb5a||0xcc;return function(_0x23d658){if(_0x23d658){return _0x5b9023[_0x2170('0x1b')](_0x44eb5a);}return _0x5b9023['status'](_0x44eb5a)['end']();};}function respondWithResult(_0x51bcb4,_0xd5484b){_0xd5484b=_0xd5484b||0xc8;return function(_0x246127){if(_0x246127){return _0x51bcb4[_0x2170('0x1c')](_0xd5484b)[_0x2170('0x1d')](_0x246127);}};}function respondWithFilteredResult(_0x51dedc,_0x5d7e68){return function(_0x2d4ebe){if(_0x2d4ebe){var _0x463d20=typeof _0x5d7e68[_0x2170('0x1e')]==='undefined'&&typeof _0x5d7e68[_0x2170('0x1f')]===_0x2170('0x20');var _0x4726b0=_0x2d4ebe[_0x2170('0x21')];var _0x517858=_0x463d20?0x0:_0x5d7e68[_0x2170('0x1e')];var _0x3a646d=_0x463d20?_0x2d4ebe[_0x2170('0x21')]:_0x5d7e68[_0x2170('0x1e')]+_0x5d7e68[_0x2170('0x1f')];var _0x4b7a2f;if(_0x3a646d>=_0x4726b0){_0x3a646d=_0x4726b0;_0x4b7a2f=0xc8;}else{_0x4b7a2f=0xce;}_0x51dedc['status'](_0x4b7a2f);return _0x51dedc[_0x2170('0x22')]('Content-Range',_0x517858+'-'+_0x3a646d+'/'+_0x4726b0)['json'](_0x2d4ebe);}return null;};}function patchUpdates(_0x174f76){return function(_0x20cece){try{jsonpatch[_0x2170('0x23')](_0x20cece,_0x174f76,!![]);}catch(_0x8e93ab){return BPromise[_0x2170('0x24')](_0x8e93ab);}return _0x20cece[_0x2170('0x25')]();};}function saveUpdates(_0x182108,_0x34624a){return function(_0x2aed1e){if(_0x2aed1e){return _0x2aed1e[_0x2170('0x26')](_0x182108)[_0x2170('0x27')](function(_0x4a0c78){return _0x4a0c78;});}return null;};}function removeEntity(_0x1838c6,_0x1f9943){return function(_0x2be5c6){if(_0x2be5c6){return _0x2be5c6['destroy']()['then'](function(){_0x1838c6[_0x2170('0x1c')](0xcc)[_0x2170('0x28')]();});}};}function handleEntityNotFound(_0x551697,_0x333e25){return function(_0x2ad2e7){if(!_0x2ad2e7){_0x551697[_0x2170('0x1b')](0x194);}return _0x2ad2e7;};}function handleError(_0x3464ab,_0x2f8225){_0x2f8225=_0x2f8225||0x1f4;return function(_0x345387){logger['error'](_0x345387[_0x2170('0x29')]);if(_0x345387[_0x2170('0x2a')]){delete _0x345387['name'];}_0x3464ab[_0x2170('0x1c')](_0x2f8225)['send'](_0x345387);};}exports[_0x2170('0x2b')]=function(_0x362b81,_0x45bc4e){var _0x6f9b52={},_0xa5077e={},_0x22bb15={'count':0x0,'rows':[]};var _0x249406=_[_0x2170('0x2c')](db[_0x2170('0x2d')]['rawAttributes'],function(_0x9b2bb3){return{'name':_0x9b2bb3[_0x2170('0x2e')],'type':_0x9b2bb3[_0x2170('0x2f')][_0x2170('0x30')]};});_0xa5077e[_0x2170('0x31')]=_['map'](_0x249406,_0x2170('0x2a'));_0xa5077e['query']=_[_0x2170('0x32')](_0x362b81[_0x2170('0x33')]);_0xa5077e[_0x2170('0x34')]=_[_0x2170('0x35')](_0xa5077e[_0x2170('0x31')],_0xa5077e[_0x2170('0x33')]);_0x6f9b52[_0x2170('0x36')]=_[_0x2170('0x35')](_0xa5077e['model'],qs[_0x2170('0x37')](_0x362b81[_0x2170('0x33')][_0x2170('0x37')]));_0x6f9b52[_0x2170('0x36')]=_0x6f9b52['attributes'][_0x2170('0x38')]?_0x6f9b52[_0x2170('0x36')]:_0xa5077e[_0x2170('0x31')];if(!_0x362b81[_0x2170('0x33')][_0x2170('0x39')](_0x2170('0x3a'))){_0x6f9b52[_0x2170('0x1f')]=qs[_0x2170('0x1f')](_0x362b81[_0x2170('0x33')][_0x2170('0x1f')]);_0x6f9b52[_0x2170('0x1e')]=qs[_0x2170('0x1e')](_0x362b81['query'][_0x2170('0x1e')]);}_0x6f9b52[_0x2170('0x3b')]=qs[_0x2170('0x3c')](_0x362b81[_0x2170('0x33')][_0x2170('0x3c')]);_0x6f9b52['where']=qs['filters'](_[_0x2170('0x3d')](_0x362b81[_0x2170('0x33')],_0xa5077e[_0x2170('0x34')]),_0x249406);if(_0x362b81[_0x2170('0x33')][_0x2170('0x3e')]){_0x6f9b52[_0x2170('0x3f')]=_[_0x2170('0x40')](_0x6f9b52[_0x2170('0x3f')],{'$or':_[_0x2170('0x2c')](_0x249406,function(_0x133592){if(_0x133592[_0x2170('0x2f')]!==_0x2170('0x41')){var _0x171f76={};_0x171f76[_0x133592[_0x2170('0x2a')]]={'$like':'%'+_0x362b81[_0x2170('0x33')][_0x2170('0x3e')]+'%'};return _0x171f76;}})});}_0x6f9b52=_['merge']({},_0x6f9b52,_0x362b81[_0x2170('0x42')]);var _0x3dec48={'where':_0x6f9b52[_0x2170('0x3f')]};return db['FreshsalesField'][_0x2170('0x21')](_0x3dec48)[_0x2170('0x27')](function(_0x3a94ab){_0x22bb15[_0x2170('0x21')]=_0x3a94ab;if(_0x362b81[_0x2170('0x33')][_0x2170('0x43')]){_0x6f9b52[_0x2170('0x44')]=[{'all':!![]}];}return db['FreshsalesField'][_0x2170('0x45')](_0x6f9b52);})[_0x2170('0x27')](function(_0x916b0d){_0x22bb15[_0x2170('0x46')]=_0x916b0d;return _0x22bb15;})[_0x2170('0x27')](respondWithFilteredResult(_0x45bc4e,_0x6f9b52))[_0x2170('0x47')](handleError(_0x45bc4e,null));};exports[_0x2170('0x48')]=function(_0x2d9a9c,_0x4c6289){var _0x2ed1d2={'raw':!![],'where':{'id':_0x2d9a9c[_0x2170('0x49')]['id']}},_0x2f0624={};_0x2f0624[_0x2170('0x31')]=_[_0x2170('0x32')](db['FreshsalesField'][_0x2170('0x4a')]);_0x2f0624[_0x2170('0x33')]=_[_0x2170('0x32')](_0x2d9a9c[_0x2170('0x33')]);_0x2f0624['filters']=_[_0x2170('0x35')](_0x2f0624[_0x2170('0x31')],_0x2f0624['query']);_0x2ed1d2['attributes']=_[_0x2170('0x35')](_0x2f0624['model'],qs[_0x2170('0x37')](_0x2d9a9c['query'][_0x2170('0x37')]));_0x2ed1d2[_0x2170('0x36')]=_0x2ed1d2[_0x2170('0x36')][_0x2170('0x38')]?_0x2ed1d2[_0x2170('0x36')]:_0x2f0624[_0x2170('0x31')];if(_0x2d9a9c[_0x2170('0x33')][_0x2170('0x43')]){_0x2ed1d2['include']=[{'all':!![]}];}_0x2ed1d2=_[_0x2170('0x40')]({},_0x2ed1d2,_0x2d9a9c[_0x2170('0x42')]);return db[_0x2170('0x2d')]['find'](_0x2ed1d2)['then'](handleEntityNotFound(_0x4c6289,null))[_0x2170('0x27')](respondWithResult(_0x4c6289,null))[_0x2170('0x47')](handleError(_0x4c6289,null));};exports['create']=function(_0x144cb0,_0x352cf3){return db[_0x2170('0x2d')][_0x2170('0x4b')](_0x144cb0[_0x2170('0x4c')],{})['then'](respondWithResult(_0x352cf3,0xc9))['catch'](handleError(_0x352cf3,null));};exports[_0x2170('0x26')]=function(_0x126907,_0x6079cb){if(_0x126907[_0x2170('0x4c')]['id']){delete _0x126907['body']['id'];}return db[_0x2170('0x2d')][_0x2170('0x4d')]({'where':{'id':_0x126907[_0x2170('0x49')]['id']}})['then'](handleEntityNotFound(_0x6079cb,null))['then'](saveUpdates(_0x126907[_0x2170('0x4c')],null))['then'](respondWithResult(_0x6079cb,null))[_0x2170('0x47')](handleError(_0x6079cb,null));};exports[_0x2170('0x4e')]=function(_0x454145,_0x542db2){return db[_0x2170('0x2d')][_0x2170('0x4d')]({'where':{'id':_0x454145[_0x2170('0x49')]['id']}})[_0x2170('0x27')](handleEntityNotFound(_0x542db2,null))[_0x2170('0x27')](removeEntity(_0x542db2,null))[_0x2170('0x47')](handleError(_0x542db2,null));}; \ No newline at end of file +var _0x8fa8=['keys','includeAll','include','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','update','destroy','then','error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','findAll','rows','catch','show','params'];(function(_0x561197,_0x2d7d64){var _0x191270=function(_0x32d6e2){while(--_0x32d6e2){_0x561197['push'](_0x561197['shift']());}};_0x191270(++_0x2d7d64);}(_0x8fa8,0xe2));var _0x88fa=function(_0xb08769,_0xed91e5){_0xb08769=_0xb08769-0x0;var _0x5afe05=_0x8fa8[_0xb08769];return _0x5afe05;};'use strict';var emlformat=require(_0x88fa('0x0'));var rimraf=require(_0x88fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88fa('0x2'));var rp=require(_0x88fa('0x3'));var moment=require(_0x88fa('0x4'));var BPromise=require(_0x88fa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x88fa('0x6'));var sox=require(_0x88fa('0x7'));var csv=require(_0x88fa('0x8'));var ejs=require(_0x88fa('0x9'));var fs=require('fs');var fs_extra=require(_0x88fa('0xa'));var _=require(_0x88fa('0xb'));var squel=require(_0x88fa('0xc'));var crypto=require('crypto');var jsforce=require(_0x88fa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x88fa('0x8'));var querystring=require(_0x88fa('0xe'));var Papa=require(_0x88fa('0xf'));var Redis=require(_0x88fa('0x10'));var authService=require(_0x88fa('0x11'));var qs=require(_0x88fa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88fa('0x13'));var logger=require('../../config/logger')(_0x88fa('0x14'));var utils=require(_0x88fa('0x15'));var config=require(_0x88fa('0x16'));var licenseUtil=require(_0x88fa('0x17'));var db=require(_0x88fa('0x18'))['db'];function respondWithStatusCode(_0x59c204,_0x1358e0){_0x1358e0=_0x1358e0||0xcc;return function(_0x1da5d5){if(_0x1da5d5){return _0x59c204[_0x88fa('0x19')](_0x1358e0);}return _0x59c204[_0x88fa('0x1a')](_0x1358e0)[_0x88fa('0x1b')]();};}function respondWithResult(_0x5ebbb5,_0x5f59f8){_0x5f59f8=_0x5f59f8||0xc8;return function(_0x30c712){if(_0x30c712){return _0x5ebbb5[_0x88fa('0x1a')](_0x5f59f8)[_0x88fa('0x1c')](_0x30c712);}};}function respondWithFilteredResult(_0x133555,_0x48b0ac){return function(_0x4783fb){if(_0x4783fb){var _0x796525=typeof _0x48b0ac['offset']==='undefined'&&typeof _0x48b0ac[_0x88fa('0x1d')]===_0x88fa('0x1e');var _0x270142=_0x4783fb[_0x88fa('0x1f')];var _0x27e4da=_0x796525?0x0:_0x48b0ac[_0x88fa('0x20')];var _0x49e780=_0x796525?_0x4783fb['count']:_0x48b0ac['offset']+_0x48b0ac[_0x88fa('0x1d')];var _0x2c6113;if(_0x49e780>=_0x270142){_0x49e780=_0x270142;_0x2c6113=0xc8;}else{_0x2c6113=0xce;}_0x133555[_0x88fa('0x1a')](_0x2c6113);return _0x133555[_0x88fa('0x21')](_0x88fa('0x22'),_0x27e4da+'-'+_0x49e780+'/'+_0x270142)['json'](_0x4783fb);}return null;};}function patchUpdates(_0x3a9784){return function(_0x2fa9be){try{jsonpatch['apply'](_0x2fa9be,_0x3a9784,!![]);}catch(_0x3b63d8){return BPromise['reject'](_0x3b63d8);}return _0x2fa9be['save']();};}function saveUpdates(_0x2cd91c,_0x1acc6d){return function(_0x21a211){if(_0x21a211){return _0x21a211[_0x88fa('0x23')](_0x2cd91c)['then'](function(_0x57eee6){return _0x57eee6;});}return null;};}function removeEntity(_0x5a42ae,_0x5b91a3){return function(_0x3b9a37){if(_0x3b9a37){return _0x3b9a37[_0x88fa('0x24')]()[_0x88fa('0x25')](function(){_0x5a42ae[_0x88fa('0x1a')](0xcc)[_0x88fa('0x1b')]();});}};}function handleEntityNotFound(_0x7b785b,_0x443695){return function(_0x5b17fc){if(!_0x5b17fc){_0x7b785b[_0x88fa('0x19')](0x194);}return _0x5b17fc;};}function handleError(_0x2c5262,_0x21d590){_0x21d590=_0x21d590||0x1f4;return function(_0x16089a){logger[_0x88fa('0x26')](_0x16089a['stack']);if(_0x16089a[_0x88fa('0x27')]){delete _0x16089a['name'];}_0x2c5262['status'](_0x21d590)[_0x88fa('0x28')](_0x16089a);};}exports[_0x88fa('0x29')]=function(_0x2263c1,_0x5ed14f){var _0x3b01e3={},_0x5da788={},_0x4e77aa={'count':0x0,'rows':[]};var _0x24e8c0=_[_0x88fa('0x2a')](db[_0x88fa('0x2b')][_0x88fa('0x2c')],function(_0x398e5f){return{'name':_0x398e5f[_0x88fa('0x2d')],'type':_0x398e5f[_0x88fa('0x2e')][_0x88fa('0x2f')]};});_0x5da788[_0x88fa('0x30')]=_[_0x88fa('0x2a')](_0x24e8c0,_0x88fa('0x27'));_0x5da788['query']=_['keys'](_0x2263c1[_0x88fa('0x31')]);_0x5da788[_0x88fa('0x32')]=_[_0x88fa('0x33')](_0x5da788[_0x88fa('0x30')],_0x5da788[_0x88fa('0x31')]);_0x3b01e3[_0x88fa('0x34')]=_[_0x88fa('0x33')](_0x5da788['model'],qs[_0x88fa('0x35')](_0x2263c1[_0x88fa('0x31')]['fields']));_0x3b01e3[_0x88fa('0x34')]=_0x3b01e3[_0x88fa('0x34')][_0x88fa('0x36')]?_0x3b01e3[_0x88fa('0x34')]:_0x5da788['model'];if(!_0x2263c1[_0x88fa('0x31')]['hasOwnProperty'](_0x88fa('0x37'))){_0x3b01e3['limit']=qs[_0x88fa('0x1d')](_0x2263c1[_0x88fa('0x31')]['limit']);_0x3b01e3[_0x88fa('0x20')]=qs[_0x88fa('0x20')](_0x2263c1['query']['offset']);}_0x3b01e3[_0x88fa('0x38')]=qs[_0x88fa('0x39')](_0x2263c1['query'][_0x88fa('0x39')]);_0x3b01e3[_0x88fa('0x3a')]=qs['filters'](_['pick'](_0x2263c1[_0x88fa('0x31')],_0x5da788[_0x88fa('0x32')]),_0x24e8c0);if(_0x2263c1[_0x88fa('0x31')]['filter']){_0x3b01e3[_0x88fa('0x3a')]=_[_0x88fa('0x3b')](_0x3b01e3[_0x88fa('0x3a')],{'$or':_[_0x88fa('0x2a')](_0x24e8c0,function(_0x515942){if(_0x515942[_0x88fa('0x2e')]!==_0x88fa('0x3c')){var _0x3622d9={};_0x3622d9[_0x515942[_0x88fa('0x27')]]={'$like':'%'+_0x2263c1[_0x88fa('0x31')]['filter']+'%'};return _0x3622d9;}})});}_0x3b01e3=_['merge']({},_0x3b01e3,_0x2263c1['options']);var _0x48e683={'where':_0x3b01e3[_0x88fa('0x3a')]};return db['FreshsalesField'][_0x88fa('0x1f')](_0x48e683)[_0x88fa('0x25')](function(_0x1f3070){_0x4e77aa[_0x88fa('0x1f')]=_0x1f3070;if(_0x2263c1['query']['includeAll']){_0x3b01e3['include']=[{'all':!![]}];}return db[_0x88fa('0x2b')][_0x88fa('0x3d')](_0x3b01e3);})[_0x88fa('0x25')](function(_0x41e02f){_0x4e77aa[_0x88fa('0x3e')]=_0x41e02f;return _0x4e77aa;})[_0x88fa('0x25')](respondWithFilteredResult(_0x5ed14f,_0x3b01e3))[_0x88fa('0x3f')](handleError(_0x5ed14f,null));};exports[_0x88fa('0x40')]=function(_0x47d173,_0x42b4e8){var _0x57dfa7={'raw':!![],'where':{'id':_0x47d173[_0x88fa('0x41')]['id']}},_0x1ccaad={};_0x1ccaad[_0x88fa('0x30')]=_[_0x88fa('0x42')](db[_0x88fa('0x2b')][_0x88fa('0x2c')]);_0x1ccaad[_0x88fa('0x31')]=_[_0x88fa('0x42')](_0x47d173['query']);_0x1ccaad[_0x88fa('0x32')]=_[_0x88fa('0x33')](_0x1ccaad['model'],_0x1ccaad[_0x88fa('0x31')]);_0x57dfa7[_0x88fa('0x34')]=_['intersection'](_0x1ccaad[_0x88fa('0x30')],qs[_0x88fa('0x35')](_0x47d173['query'][_0x88fa('0x35')]));_0x57dfa7[_0x88fa('0x34')]=_0x57dfa7[_0x88fa('0x34')][_0x88fa('0x36')]?_0x57dfa7['attributes']:_0x1ccaad[_0x88fa('0x30')];if(_0x47d173[_0x88fa('0x31')][_0x88fa('0x43')]){_0x57dfa7[_0x88fa('0x44')]=[{'all':!![]}];}_0x57dfa7=_[_0x88fa('0x3b')]({},_0x57dfa7,_0x47d173[_0x88fa('0x45')]);return db['FreshsalesField']['find'](_0x57dfa7)[_0x88fa('0x25')](handleEntityNotFound(_0x42b4e8,null))[_0x88fa('0x25')](respondWithResult(_0x42b4e8,null))[_0x88fa('0x3f')](handleError(_0x42b4e8,null));};exports[_0x88fa('0x46')]=function(_0x21e44b,_0x56a781){return db[_0x88fa('0x2b')][_0x88fa('0x46')](_0x21e44b[_0x88fa('0x47')],{})[_0x88fa('0x25')](respondWithResult(_0x56a781,0xc9))[_0x88fa('0x3f')](handleError(_0x56a781,null));};exports[_0x88fa('0x23')]=function(_0x208f6c,_0x250a39){if(_0x208f6c[_0x88fa('0x47')]['id']){delete _0x208f6c['body']['id'];}return db[_0x88fa('0x2b')][_0x88fa('0x48')]({'where':{'id':_0x208f6c['params']['id']}})[_0x88fa('0x25')](handleEntityNotFound(_0x250a39,null))[_0x88fa('0x25')](saveUpdates(_0x208f6c['body'],null))[_0x88fa('0x25')](respondWithResult(_0x250a39,null))[_0x88fa('0x3f')](handleError(_0x250a39,null));};exports[_0x88fa('0x24')]=function(_0x32a94a,_0x451252){return db[_0x88fa('0x2b')][_0x88fa('0x48')]({'where':{'id':_0x32a94a[_0x88fa('0x41')]['id']}})[_0x88fa('0x25')](handleEntityNotFound(_0x451252,null))['then'](removeEntity(_0x451252,null))[_0x88fa('0x3f')](handleError(_0x451252,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 877ff05..e1cc16d 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 _0xf3a8=['idField','FieldId','util','../../config/logger','moment','path','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x5597cd,_0x30c379){var _0x594134=function(_0x355ffe){while(--_0x355ffe){_0x5597cd['push'](_0x5597cd['shift']());}};_0x594134(++_0x30c379);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x2fc6b9,_0xa62528){_0x2fc6b9=_0x2fc6b9-0x0;var _0x4a2006=_0xf3a8[_0x2fc6b9];return _0x4a2006;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3a('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3a('0x4'));var attributes=require('./intFreshsalesField.attributes');module[_0x8f3a('0x5')]=function(_0x3d6e2d,_0x109997){return _0x3d6e2d[_0x8f3a('0x6')](_0x8f3a('0x7'),attributes,{'tableName':_0x8f3a('0x8'),'paranoid':![],'indexes':[{'name':_0x8f3a('0x9'),'fields':[_0x8f3a('0xa'),_0x8f3a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd2=['int_freshsales_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x1cd7f1,_0x44236f){var _0x5adfde=function(_0x409537){while(--_0x409537){_0x1cd7f1['push'](_0x1cd7f1['shift']());}};_0x5adfde(++_0x44236f);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require(_0x2cdd('0x2'))(_0x2cdd('0x3'));var moment=require('moment');var BPromise=require(_0x2cdd('0x4'));var rp=require(_0x2cdd('0x5'));var fs=require('fs');var path=require(_0x2cdd('0x6'));var rimraf=require(_0x2cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x2cdd('0x8'));module[_0x2cdd('0x9')]=function(_0x5f3b53,_0x1cc1ac){return _0x5f3b53[_0x2cdd('0xa')](_0x2cdd('0xb'),attributes,{'tableName':_0x2cdd('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 8d4099f..110f661 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x58c0ca,_0xccd9b2){var _0x21600b=function(_0x5cf310){while(--_0x5cf310){_0x58c0ca['push'](_0x58c0ca['shift']());}};_0x21600b(++_0xccd9b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x5fc3[_0x82140];return _0x2b15a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3c307c,_0x1b06c4){var _0x32cf08=function(_0x371144){while(--_0x371144){_0x3c307c['push'](_0x3c307c['shift']());}};_0x32cf08(++_0x1b06c4);}(_0x5d17,0x114));var _0x75d1=function(_0x31d6c2,_0x422dcd){_0x31d6c2=_0x31d6c2-0x0;var _0x295dd0=_0x5d17[_0x31d6c2];return _0x295dd0;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 331ecfd..5096279 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(_0x1f3386,_0x42226e){var _0x574a9b=function(_0x5c4060){while(--_0x5c4060){_0x1f3386['push'](_0x1f3386['shift']());}};_0x574a9b(++_0x42226e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x5b093d,_0x1ad1ae){var _0x12b8ea=function(_0x553acf){while(--_0x553acf){_0x5b093d['push'](_0x5b093d['shift']());}};_0x12b8ea(++_0x1ad1ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 7c4ea9e..799ae21 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 _0xf9ae=['integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x189942,_0x808691){var _0x19aa4d=function(_0x372e2e){while(--_0x372e2e){_0x189942['push'](_0x189942['shift']());}};_0x19aa4d(++_0x808691);}(_0xf9ae,0x85));var _0xef9a=function(_0x4ef673,_0x223308){_0x4ef673=_0x4ef673-0x0;var _0x3574d7=_0xf9ae[_0x4ef673];return _0x3574d7;};'use strict';var Sequelize=require(_0xef9a('0x0'));module[_0xef9a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef9a('0x2')]},'username':{'type':Sequelize[_0xef9a('0x2')],'unique':_0xef9a('0x3')},'remoteUri':{'type':Sequelize[_0xef9a('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xef9a('0x2')]},'clientSecret':{'type':Sequelize[_0xef9a('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xef9a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xef9a('0x4')](_0xef9a('0x5'),'newTab'),'defaultValue':_0xef9a('0x5')}}; \ No newline at end of file +var _0xaebd=['ENUM','newTab','integrationTab','sequelize','STRING','username'];(function(_0x1c3df7,_0x27c1f4){var _0x414eea=function(_0x56cc92){while(--_0x56cc92){_0x1c3df7['push'](_0x1c3df7['shift']());}};_0x414eea(++_0x27c1f4);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x534b5a,_0x2ed076){_0x534b5a=_0x534b5a-0x0;var _0x311184=_0xaebd[_0x534b5a];return _0x311184;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'remoteUri':{'type':Sequelize[_0xdaeb('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xdaeb('0x1')]},'clientSecret':{'type':Sequelize[_0xdaeb('0x1')]},'securityToken':{'type':Sequelize[_0xdaeb('0x1')]},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdaeb('0x3')]('integrationTab',_0xdaeb('0x4')),'defaultValue':_0xdaeb('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b06c4e0..0e37360 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 _0x6442=['index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','SalesforceAccount','findAll','catch','show','params','length','includeAll','options','find','create','body','findOne','sort','getConfigurations','Subjects','Descriptions','getDescriptions','channel','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','slice','substring','login','concat','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Description','int','picklist','boolean','email','textarea','includes','label','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send'];(function(_0x2cad9f,_0x4a99c9){var _0x58afd0=function(_0x4a8a5b){while(--_0x4a8a5b){_0x2cad9f['push'](_0x2cad9f['shift']());}};_0x58afd0(++_0x4a99c9);}(_0x6442,0xb9));var _0x2644=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x6442[_0x3daa8c];return _0x2b1bd7;};'use strict';var emlformat=require(_0x2644('0x0'));var rimraf=require(_0x2644('0x1'));var zipdir=require(_0x2644('0x2'));var jsonpatch=require(_0x2644('0x3'));var rp=require(_0x2644('0x4'));var moment=require(_0x2644('0x5'));var BPromise=require(_0x2644('0x6'));var Mustache=require('mustache');var util=require(_0x2644('0x7'));var path=require(_0x2644('0x8'));var sox=require(_0x2644('0x9'));var csv=require('to-csv');var ejs=require(_0x2644('0xa'));var fs=require('fs');var fs_extra=require(_0x2644('0xb'));var _=require(_0x2644('0xc'));var squel=require(_0x2644('0xd'));var crypto=require(_0x2644('0xe'));var jsforce=require(_0x2644('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2644('0x10'));var querystring=require('querystring');var Papa=require(_0x2644('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2644('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2644('0x13'));var logger=require('../../config/logger')(_0x2644('0x14'));var utils=require(_0x2644('0x15'));var config=require(_0x2644('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2644('0x17'));function respondWithStatusCode(_0x191755,_0x30601d){_0x30601d=_0x30601d||0xcc;return function(_0x2d230e){if(_0x2d230e){return _0x191755['sendStatus'](_0x30601d);}return _0x191755[_0x2644('0x18')](_0x30601d)[_0x2644('0x19')]();};}function respondWithResult(_0x362f77,_0x547781){_0x547781=_0x547781||0xc8;return function(_0x1f9c98){if(_0x1f9c98){return _0x362f77['status'](_0x547781)['json'](_0x1f9c98);}};}function respondWithFilteredResult(_0x282120,_0x2d8293){return function(_0x433f1e){if(_0x433f1e){var _0x205b22=typeof _0x2d8293[_0x2644('0x1a')]===_0x2644('0x1b')&&typeof _0x2d8293['limit']==='undefined';var _0x414f26=_0x433f1e[_0x2644('0x1c')];var _0x3f63f3=_0x205b22?0x0:_0x2d8293['offset'];var _0x1779a0=_0x205b22?_0x433f1e[_0x2644('0x1c')]:_0x2d8293['offset']+_0x2d8293[_0x2644('0x1d')];var _0x1f3a74;if(_0x1779a0>=_0x414f26){_0x1779a0=_0x414f26;_0x1f3a74=0xc8;}else{_0x1f3a74=0xce;}_0x282120[_0x2644('0x18')](_0x1f3a74);return _0x282120[_0x2644('0x1e')](_0x2644('0x1f'),_0x3f63f3+'-'+_0x1779a0+'/'+_0x414f26)[_0x2644('0x20')](_0x433f1e);}return null;};}function patchUpdates(_0x2836e6){return function(_0x2e5f29){try{jsonpatch[_0x2644('0x21')](_0x2e5f29,_0x2836e6,!![]);}catch(_0x407274){return BPromise[_0x2644('0x22')](_0x407274);}return _0x2e5f29[_0x2644('0x23')]();};}function saveUpdates(_0x218da8,_0x58a350){return function(_0x3505dc){if(_0x3505dc){return _0x3505dc[_0x2644('0x24')](_0x218da8)['then'](function(_0x2374fa){return _0x2374fa;});}return null;};}function removeEntity(_0x4d1caf,_0x369d5a){return function(_0xdb6a85){if(_0xdb6a85){return _0xdb6a85[_0x2644('0x25')]()[_0x2644('0x26')](function(){_0x4d1caf[_0x2644('0x18')](0xcc)[_0x2644('0x19')]();});}};}function handleEntityNotFound(_0x460da4,_0x56514b){return function(_0x1ebe27){if(!_0x1ebe27){_0x460da4[_0x2644('0x27')](0x194);}return _0x1ebe27;};}function handleError(_0x23837b,_0x5e4759){_0x5e4759=_0x5e4759||0x1f4;return function(_0xb8f4c5){logger[_0x2644('0x28')](_0xb8f4c5['stack']);if(_0xb8f4c5[_0x2644('0x29')]){delete _0xb8f4c5[_0x2644('0x29')];}_0x23837b[_0x2644('0x18')](_0x5e4759)[_0x2644('0x2a')](_0xb8f4c5);};}exports[_0x2644('0x2b')]=function(_0x60ada2,_0x47f843){var _0x1d9092={},_0x28d7e2={},_0x2d9841={'count':0x0,'rows':[]};var _0x14dda1=_[_0x2644('0x2c')](db['SalesforceAccount'][_0x2644('0x2d')],function(_0x114eb4){return{'name':_0x114eb4[_0x2644('0x2e')],'type':_0x114eb4[_0x2644('0x2f')]['key']};});_0x28d7e2[_0x2644('0x30')]=_[_0x2644('0x2c')](_0x14dda1,'name');_0x28d7e2[_0x2644('0x31')]=_[_0x2644('0x32')](_0x60ada2[_0x2644('0x31')]);_0x28d7e2[_0x2644('0x33')]=_['intersection'](_0x28d7e2[_0x2644('0x30')],_0x28d7e2[_0x2644('0x31')]);_0x1d9092[_0x2644('0x34')]=_[_0x2644('0x35')](_0x28d7e2[_0x2644('0x30')],qs[_0x2644('0x36')](_0x60ada2['query'][_0x2644('0x36')]));_0x1d9092[_0x2644('0x34')]=_0x1d9092[_0x2644('0x34')]['length']?_0x1d9092['attributes']:_0x28d7e2[_0x2644('0x30')];if(!_0x60ada2[_0x2644('0x31')][_0x2644('0x37')](_0x2644('0x38'))){_0x1d9092['limit']=qs[_0x2644('0x1d')](_0x60ada2['query'][_0x2644('0x1d')]);_0x1d9092[_0x2644('0x1a')]=qs[_0x2644('0x1a')](_0x60ada2[_0x2644('0x31')][_0x2644('0x1a')]);}_0x1d9092[_0x2644('0x39')]=qs['sort'](_0x60ada2[_0x2644('0x31')]['sort']);_0x1d9092[_0x2644('0x3a')]=qs[_0x2644('0x33')](_[_0x2644('0x3b')](_0x60ada2[_0x2644('0x31')],_0x28d7e2[_0x2644('0x33')]),_0x14dda1);if(_0x60ada2[_0x2644('0x31')][_0x2644('0x3c')]){_0x1d9092[_0x2644('0x3a')]=_[_0x2644('0x3d')](_0x1d9092[_0x2644('0x3a')],{'$or':_[_0x2644('0x2c')](_0x14dda1,function(_0x43f0b1){if(_0x43f0b1[_0x2644('0x2f')]!=='VIRTUAL'){var _0x54b524={};_0x54b524[_0x43f0b1['name']]={'$like':'%'+_0x60ada2[_0x2644('0x31')]['filter']+'%'};return _0x54b524;}})});}_0x1d9092=_[_0x2644('0x3d')]({},_0x1d9092,_0x60ada2['options']);var _0x3707ea={'where':_0x1d9092[_0x2644('0x3a')]};return db['SalesforceAccount'][_0x2644('0x1c')](_0x3707ea)[_0x2644('0x26')](function(_0x2b55e3){_0x2d9841[_0x2644('0x1c')]=_0x2b55e3;if(_0x60ada2['query']['includeAll']){_0x1d9092['include']=[{'all':!![]}];}return db[_0x2644('0x3e')][_0x2644('0x3f')](_0x1d9092);})[_0x2644('0x26')](function(_0x5e39e0){_0x2d9841['rows']=_0x5e39e0;return _0x2d9841;})[_0x2644('0x26')](respondWithFilteredResult(_0x47f843,_0x1d9092))[_0x2644('0x40')](handleError(_0x47f843,null));};exports[_0x2644('0x41')]=function(_0x4a9da5,_0xc1417a){var _0x4a665d={'raw':![],'where':{'id':_0x4a9da5[_0x2644('0x42')]['id']}},_0x3f2834={};_0x3f2834['model']=_[_0x2644('0x32')](db['SalesforceAccount']['rawAttributes']);_0x3f2834[_0x2644('0x31')]=_[_0x2644('0x32')](_0x4a9da5[_0x2644('0x31')]);_0x3f2834[_0x2644('0x33')]=_[_0x2644('0x35')](_0x3f2834[_0x2644('0x30')],_0x3f2834['query']);_0x4a665d[_0x2644('0x34')]=_[_0x2644('0x35')](_0x3f2834[_0x2644('0x30')],qs[_0x2644('0x36')](_0x4a9da5[_0x2644('0x31')][_0x2644('0x36')]));_0x4a665d['attributes']=_0x4a665d[_0x2644('0x34')][_0x2644('0x43')]?_0x4a665d['attributes']:_0x3f2834[_0x2644('0x30')];if(_0x4a9da5[_0x2644('0x31')][_0x2644('0x44')]){_0x4a665d['include']=[{'all':!![]}];}_0x4a665d=_[_0x2644('0x3d')]({},_0x4a665d,_0x4a9da5[_0x2644('0x45')]);return db['SalesforceAccount'][_0x2644('0x46')](_0x4a665d)[_0x2644('0x26')](handleEntityNotFound(_0xc1417a,null))[_0x2644('0x26')](respondWithResult(_0xc1417a,null))[_0x2644('0x40')](handleError(_0xc1417a,null));};exports[_0x2644('0x47')]=function(_0x26eeae,_0xf38837){return db[_0x2644('0x3e')][_0x2644('0x47')](_0x26eeae[_0x2644('0x48')],{})[_0x2644('0x26')](respondWithResult(_0xf38837,0xc9))[_0x2644('0x40')](handleError(_0xf38837,null));};exports[_0x2644('0x24')]=function(_0x456132,_0x4f6b5a){if(_0x456132[_0x2644('0x48')]['id']){delete _0x456132[_0x2644('0x48')]['id'];}return db[_0x2644('0x3e')]['find']({'where':{'id':_0x456132[_0x2644('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f6b5a,null))['then'](saveUpdates(_0x456132['body'],null))[_0x2644('0x26')](respondWithResult(_0x4f6b5a,null))[_0x2644('0x40')](handleError(_0x4f6b5a,null));};exports[_0x2644('0x25')]=function(_0xfffe38,_0x3dbd06){return db['SalesforceAccount'][_0x2644('0x46')]({'where':{'id':_0xfffe38[_0x2644('0x42')]['id']}})[_0x2644('0x26')](handleEntityNotFound(_0x3dbd06,null))[_0x2644('0x26')](removeEntity(_0x3dbd06,null))[_0x2644('0x40')](handleError(_0x3dbd06,null));};exports['getConfigurations']=function(_0x44d280,_0x4d1397,_0x4ce0c4){var _0x4a4ec4={};var _0x24ca0c={};var _0x491285;var _0x4b19d5;return db[_0x2644('0x3e')][_0x2644('0x49')]({'where':{'id':_0x44d280[_0x2644('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d1397,null))[_0x2644('0x26')](function(_0x2d92cc){if(_0x2d92cc){_0x491285=_0x2d92cc;_0x24ca0c[_0x2644('0x30')]=_[_0x2644('0x32')](db['SalesforceConfiguration'][_0x2644('0x2d')]);_0x24ca0c[_0x2644('0x31')]=_[_0x2644('0x32')](_0x44d280[_0x2644('0x31')]);_0x24ca0c['filters']=_[_0x2644('0x35')](_0x24ca0c['model'],_0x24ca0c[_0x2644('0x31')]);_0x4a4ec4['attributes']=_['intersection'](_0x24ca0c[_0x2644('0x30')],qs['fields'](_0x44d280[_0x2644('0x31')]['fields']));_0x4a4ec4[_0x2644('0x34')]=_0x4a4ec4[_0x2644('0x34')][_0x2644('0x43')]?_0x4a4ec4[_0x2644('0x34')]:_0x24ca0c[_0x2644('0x30')];_0x4a4ec4['order']=qs['sort'](_0x44d280[_0x2644('0x31')][_0x2644('0x4a')]);_0x4a4ec4[_0x2644('0x3a')]=qs['filters'](_[_0x2644('0x3b')](_0x44d280[_0x2644('0x31')],_0x24ca0c[_0x2644('0x33')]));if(_0x44d280[_0x2644('0x31')][_0x2644('0x3c')]){_0x4a4ec4[_0x2644('0x3a')]=_[_0x2644('0x3d')](_0x4a4ec4[_0x2644('0x3a')],{'$or':_[_0x2644('0x2c')](_0x4a4ec4[_0x2644('0x34')],function(_0x5e15a3){var _0x4edc34={};_0x4edc34[_0x5e15a3]={'$like':'%'+_0x44d280[_0x2644('0x31')][_0x2644('0x3c')]+'%'};return _0x4edc34;})});}_0x4a4ec4=_['merge']({},_0x4a4ec4,_0x44d280[_0x2644('0x45')]);return _0x491285[_0x2644('0x4b')](_0x4a4ec4);}})[_0x2644('0x26')](function(_0x122181){if(_0x122181){_0x4b19d5=_0x122181[_0x2644('0x43')];if(!_0x44d280[_0x2644('0x31')]['hasOwnProperty'](_0x2644('0x38'))){_0x4a4ec4[_0x2644('0x1d')]=qs[_0x2644('0x1d')](_0x44d280[_0x2644('0x31')][_0x2644('0x1d')]);_0x4a4ec4[_0x2644('0x1a')]=qs[_0x2644('0x1a')](_0x44d280[_0x2644('0x31')][_0x2644('0x1a')]);}return _0x491285['getConfigurations'](_0x4a4ec4);}})['then'](function(_0x1614da){if(_0x1614da){return _0x1614da?{'count':_0x4b19d5,'rows':_0x1614da}:null;}})[_0x2644('0x26')](respondWithResult(_0x4d1397,null))[_0x2644('0x40')](handleError(_0x4d1397,null));};exports['addConfiguration']=function(_0x4da260,_0x2bc62c,_0x5d3f6f){if(_0x4da260[_0x2644('0x48')]['id']){delete _0x4da260[_0x2644('0x48')]['id'];}return db[_0x2644('0x3e')]['findOne']({'where':{'id':_0x4da260[_0x2644('0x42')]['id']}})[_0x2644('0x26')](handleEntityNotFound(_0x2bc62c,null))[_0x2644('0x26')](function(_0x35995a){if(_0x35995a){_0x4da260[_0x2644('0x48')]['AccountId']=_0x35995a['id'];_0x4da260[_0x2644('0x48')][_0x2644('0x4c')]=integrations['getSubjects'](_0x4da260[_0x2644('0x48')]['channel'],_0x4da260[_0x2644('0x48')]['type']);_0x4da260['body'][_0x2644('0x4d')]=integrations[_0x2644('0x4e')](_0x4da260[_0x2644('0x48')][_0x2644('0x4f')],_0x4da260[_0x2644('0x48')][_0x2644('0x2f')]);return db[_0x2644('0x50')]['create'](_0x4da260['body'],{'include':[{'model':db[_0x2644('0x51')],'as':_0x2644('0x4c')},{'model':db[_0x2644('0x51')],'as':_0x2644('0x4d')}]});}return null;})[_0x2644('0x26')](respondWithResult(_0x2bc62c,null))[_0x2644('0x40')](handleError(_0x2bc62c,null));};exports[_0x2644('0x52')]=function(_0x4fe1ae,_0x5991f1,_0x5c920e){var _0x38f4e4;var _0x513863='';var _0x79d947=_0x2644('0x53');return db[_0x2644('0x3e')][_0x2644('0x49')]({'where':{'id':_0x4fe1ae[_0x2644('0x42')]['id']},'attributes':['id',_0x2644('0x54'),_0x2644('0x55'),_0x2644('0x56'),'username',_0x2644('0x57'),'securityToken']})[_0x2644('0x26')](handleEntityNotFound(_0x5991f1,null))['then'](function(_0x86ac90){if(_0x86ac90){_0x513863=_0x86ac90['remoteUri'];var _0xfda9ad=_0x513863[_0x2644('0x58')](-0x1);if(_0xfda9ad==='/'){_0x513863=_0x513863[_0x2644('0x59')](0x0,_0x513863['lastIndexOf'](_0xfda9ad));}_0x38f4e4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x513863,'clientId':_0x86ac90[_0x2644('0x55')],'clientSecret':_0x86ac90['clientSecret']}});return _0x38f4e4[_0x2644('0x5a')](_0x86ac90['username'],_0x86ac90[_0x2644('0x57')][_0x2644('0x5b')](_0x86ac90['securityToken']));}})['then'](function(_0x384c29){if(_0x384c29){if(!_['isNil'](_0x4fe1ae[_0x2644('0x31')][_0x2644('0x5c')])){_0x79d947=_0x4fe1ae[_0x2644('0x31')][_0x2644('0x5c')];}return _0x38f4e4[_0x2644('0x5d')](_0x79d947)[_0x2644('0x5e')]();}})[_0x2644('0x26')](function(_0x3d1e86){var _0x5474be=['OwnerId','ActivityDate',_0x2644('0x5f'),_0x2644('0x60'),'Subject',_0x2644('0x61')];var _0x2580a5=['string',_0x2644('0x62'),_0x2644('0x63'),_0x2644('0x64'),_0x2644('0x65'),_0x2644('0x66'),'phone'];if(_0x3d1e86){_['remove'](_0x3d1e86[_0x2644('0x36')],function(_0x384cf8){return _0x5474be[_0x2644('0x67')](_0x384cf8[_0x2644('0x29')])||!_0x2580a5[_0x2644('0x67')](_0x384cf8[_0x2644('0x2f')]);});return{'count':_0x3d1e86[_0x2644('0x36')][_0x2644('0x43')],'rows':_[_0x2644('0x2c')](_0x3d1e86[_0x2644('0x36')],function(_0x5e63c4){return{'id':_0x5e63c4[_0x2644('0x29')],'name':_0x5e63c4[_0x2644('0x68')],'custom':_0x5e63c4['custom'],'options':_0x5e63c4['picklistValues']['length']>0x0?_[_0x2644('0x2c')](_0x5e63c4['picklistValues'],function(_0x3cb69b){return{'name':_0x3cb69b[_0x2644('0x68')],'value':_0x3cb69b['value']};}):_0x5e63c4['type']=='boolean'?[{'name':_0x2644('0x69'),'value':_0x2644('0x6a')},{'name':_0x2644('0x6b'),'value':_0x2644('0x6c')}]:[]};})};}})['then'](respondWithResult(_0x5991f1,null))[_0x2644('0x40')](function(_0x1f37ee){var _0x479d73=_0x4fe1ae[_0x2644('0x31')][_0x2644('0x6d')]?0x1f4:_0x1f37ee['statusCode']||0x1f4;logger[_0x2644('0x28')](_0x2644('0x6e'),_0x2644('0x52'),_0x479d73,JSON[_0x2644('0x6f')](_0x1f37ee));delete _0x1f37ee[_0x2644('0x29')];if(_0x479d73===0x191){_0x479d73=0x190;}_0x5991f1[_0x2644('0x18')](_0x479d73)['send'](_0x4fe1ae[_0x2644('0x31')][_0x2644('0x6d')]?{'message':_0x2644('0x70'),'statusCode':_0x1f37ee[_0x2644('0x71')]}:_0x1f37ee);});}; \ No newline at end of file +var _0xf35d=['findAll','then','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','Subjects','channel','Descriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','password','securityToken','substring','Connection','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','name','includes','label','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xf35d,0x135));var _0xdf35=function(_0x3ee451,_0x2edd11){_0x3ee451=_0x3ee451-0x0;var _0x3de1cb=_0xf35d[_0x3ee451];return _0x3de1cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdf35('0x1'));var moment=require(_0xdf35('0x2'));var BPromise=require(_0xdf35('0x3'));var Mustache=require('mustache');var util=require(_0xdf35('0x4'));var path=require(_0xdf35('0x5'));var sox=require(_0xdf35('0x6'));var csv=require(_0xdf35('0x7'));var ejs=require(_0xdf35('0x8'));var fs=require('fs');var fs_extra=require(_0xdf35('0x9'));var _=require(_0xdf35('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf35('0xb'));var deskjs=require(_0xdf35('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdf35('0xd'));var Papa=require(_0xdf35('0xe'));var Redis=require('ioredis');var authService=require(_0xdf35('0xf'));var qs=require(_0xdf35('0x10'));var as=require(_0xdf35('0x11'));var hardwareService=require(_0xdf35('0x12'));var logger=require('../../config/logger')(_0xdf35('0x13'));var utils=require(_0xdf35('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdf35('0x15'));var db=require(_0xdf35('0x16'))['db'];var integrations=require(_0xdf35('0x17'));function respondWithStatusCode(_0x5981bf,_0x5199dd){_0x5199dd=_0x5199dd||0xcc;return function(_0x151ccb){if(_0x151ccb){return _0x5981bf[_0xdf35('0x18')](_0x5199dd);}return _0x5981bf['status'](_0x5199dd)[_0xdf35('0x19')]();};}function respondWithResult(_0x45b9f6,_0x3ceb56){_0x3ceb56=_0x3ceb56||0xc8;return function(_0x559e40){if(_0x559e40){return _0x45b9f6[_0xdf35('0x1a')](_0x3ceb56)[_0xdf35('0x1b')](_0x559e40);}};}function respondWithFilteredResult(_0x17366d,_0x50821b){return function(_0x4e7875){if(_0x4e7875){var _0x4592f9=typeof _0x50821b[_0xdf35('0x1c')]===_0xdf35('0x1d')&&typeof _0x50821b[_0xdf35('0x1e')]===_0xdf35('0x1d');var _0x2dff6=_0x4e7875['count'];var _0x3e3227=_0x4592f9?0x0:_0x50821b[_0xdf35('0x1c')];var _0x4928cd=_0x4592f9?_0x4e7875[_0xdf35('0x1f')]:_0x50821b[_0xdf35('0x1c')]+_0x50821b[_0xdf35('0x1e')];var _0x3e5a3f;if(_0x4928cd>=_0x2dff6){_0x4928cd=_0x2dff6;_0x3e5a3f=0xc8;}else{_0x3e5a3f=0xce;}_0x17366d['status'](_0x3e5a3f);return _0x17366d[_0xdf35('0x20')](_0xdf35('0x21'),_0x3e3227+'-'+_0x4928cd+'/'+_0x2dff6)[_0xdf35('0x1b')](_0x4e7875);}return null;};}function patchUpdates(_0x48d4ae){return function(_0x52a061){try{jsonpatch[_0xdf35('0x22')](_0x52a061,_0x48d4ae,!![]);}catch(_0x4b550f){return BPromise['reject'](_0x4b550f);}return _0x52a061[_0xdf35('0x23')]();};}function saveUpdates(_0x11c9f6,_0x4d19b7){return function(_0xdf0ff7){if(_0xdf0ff7){return _0xdf0ff7[_0xdf35('0x24')](_0x11c9f6)['then'](function(_0x2dfa0b){return _0x2dfa0b;});}return null;};}function removeEntity(_0x1c96dd,_0x23d191){return function(_0x288907){if(_0x288907){return _0x288907[_0xdf35('0x25')]()['then'](function(){_0x1c96dd[_0xdf35('0x1a')](0xcc)[_0xdf35('0x19')]();});}};}function handleEntityNotFound(_0x518206,_0x177831){return function(_0x213d3a){if(!_0x213d3a){_0x518206[_0xdf35('0x18')](0x194);}return _0x213d3a;};}function handleError(_0x8e75d0,_0x5acf07){_0x5acf07=_0x5acf07||0x1f4;return function(_0xac31c3){logger[_0xdf35('0x26')](_0xac31c3[_0xdf35('0x27')]);if(_0xac31c3['name']){delete _0xac31c3['name'];}_0x8e75d0[_0xdf35('0x1a')](_0x5acf07)[_0xdf35('0x28')](_0xac31c3);};}exports[_0xdf35('0x29')]=function(_0x284c2f,_0x5c59f1){var _0x27bb4f={},_0x2e00ce={},_0x13c39d={'count':0x0,'rows':[]};var _0x8444d0=_[_0xdf35('0x2a')](db[_0xdf35('0x2b')][_0xdf35('0x2c')],function(_0x3967be){return{'name':_0x3967be[_0xdf35('0x2d')],'type':_0x3967be[_0xdf35('0x2e')][_0xdf35('0x2f')]};});_0x2e00ce['model']=_[_0xdf35('0x2a')](_0x8444d0,'name');_0x2e00ce['query']=_[_0xdf35('0x30')](_0x284c2f[_0xdf35('0x31')]);_0x2e00ce[_0xdf35('0x32')]=_[_0xdf35('0x33')](_0x2e00ce[_0xdf35('0x34')],_0x2e00ce[_0xdf35('0x31')]);_0x27bb4f[_0xdf35('0x35')]=_[_0xdf35('0x33')](_0x2e00ce[_0xdf35('0x34')],qs[_0xdf35('0x36')](_0x284c2f[_0xdf35('0x31')]['fields']));_0x27bb4f['attributes']=_0x27bb4f[_0xdf35('0x35')][_0xdf35('0x37')]?_0x27bb4f['attributes']:_0x2e00ce['model'];if(!_0x284c2f[_0xdf35('0x31')]['hasOwnProperty'](_0xdf35('0x38'))){_0x27bb4f[_0xdf35('0x1e')]=qs[_0xdf35('0x1e')](_0x284c2f[_0xdf35('0x31')][_0xdf35('0x1e')]);_0x27bb4f[_0xdf35('0x1c')]=qs[_0xdf35('0x1c')](_0x284c2f[_0xdf35('0x31')][_0xdf35('0x1c')]);}_0x27bb4f['order']=qs['sort'](_0x284c2f['query'][_0xdf35('0x39')]);_0x27bb4f[_0xdf35('0x3a')]=qs[_0xdf35('0x32')](_[_0xdf35('0x3b')](_0x284c2f['query'],_0x2e00ce[_0xdf35('0x32')]),_0x8444d0);if(_0x284c2f[_0xdf35('0x31')][_0xdf35('0x3c')]){_0x27bb4f[_0xdf35('0x3a')]=_[_0xdf35('0x3d')](_0x27bb4f[_0xdf35('0x3a')],{'$or':_[_0xdf35('0x2a')](_0x8444d0,function(_0x2750f2){if(_0x2750f2[_0xdf35('0x2e')]!=='VIRTUAL'){var _0x23639b={};_0x23639b[_0x2750f2['name']]={'$like':'%'+_0x284c2f[_0xdf35('0x31')][_0xdf35('0x3c')]+'%'};return _0x23639b;}})});}_0x27bb4f=_['merge']({},_0x27bb4f,_0x284c2f[_0xdf35('0x3e')]);var _0x40a0d7={'where':_0x27bb4f[_0xdf35('0x3a')]};return db[_0xdf35('0x2b')][_0xdf35('0x1f')](_0x40a0d7)['then'](function(_0x55eded){_0x13c39d[_0xdf35('0x1f')]=_0x55eded;if(_0x284c2f['query']['includeAll']){_0x27bb4f['include']=[{'all':!![]}];}return db[_0xdf35('0x2b')][_0xdf35('0x3f')](_0x27bb4f);})[_0xdf35('0x40')](function(_0x132696){_0x13c39d['rows']=_0x132696;return _0x13c39d;})[_0xdf35('0x40')](respondWithFilteredResult(_0x5c59f1,_0x27bb4f))[_0xdf35('0x41')](handleError(_0x5c59f1,null));};exports[_0xdf35('0x42')]=function(_0x6c716e,_0x23e9d5){var _0x9b4d50={'raw':![],'where':{'id':_0x6c716e[_0xdf35('0x43')]['id']}},_0x45a7c6={};_0x45a7c6[_0xdf35('0x34')]=_[_0xdf35('0x30')](db[_0xdf35('0x2b')][_0xdf35('0x2c')]);_0x45a7c6[_0xdf35('0x31')]=_[_0xdf35('0x30')](_0x6c716e[_0xdf35('0x31')]);_0x45a7c6[_0xdf35('0x32')]=_[_0xdf35('0x33')](_0x45a7c6[_0xdf35('0x34')],_0x45a7c6[_0xdf35('0x31')]);_0x9b4d50[_0xdf35('0x35')]=_[_0xdf35('0x33')](_0x45a7c6[_0xdf35('0x34')],qs[_0xdf35('0x36')](_0x6c716e[_0xdf35('0x31')]['fields']));_0x9b4d50[_0xdf35('0x35')]=_0x9b4d50[_0xdf35('0x35')]['length']?_0x9b4d50[_0xdf35('0x35')]:_0x45a7c6[_0xdf35('0x34')];if(_0x6c716e[_0xdf35('0x31')][_0xdf35('0x44')]){_0x9b4d50['include']=[{'all':!![]}];}_0x9b4d50=_[_0xdf35('0x3d')]({},_0x9b4d50,_0x6c716e[_0xdf35('0x3e')]);return db[_0xdf35('0x2b')][_0xdf35('0x45')](_0x9b4d50)[_0xdf35('0x40')](handleEntityNotFound(_0x23e9d5,null))['then'](respondWithResult(_0x23e9d5,null))[_0xdf35('0x41')](handleError(_0x23e9d5,null));};exports[_0xdf35('0x46')]=function(_0x30445b,_0x55030d){return db['SalesforceAccount'][_0xdf35('0x46')](_0x30445b[_0xdf35('0x47')],{})['then'](respondWithResult(_0x55030d,0xc9))[_0xdf35('0x41')](handleError(_0x55030d,null));};exports[_0xdf35('0x24')]=function(_0x25d7bd,_0x2f0c20){if(_0x25d7bd[_0xdf35('0x47')]['id']){delete _0x25d7bd[_0xdf35('0x47')]['id'];}return db[_0xdf35('0x2b')][_0xdf35('0x45')]({'where':{'id':_0x25d7bd[_0xdf35('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f0c20,null))[_0xdf35('0x40')](saveUpdates(_0x25d7bd[_0xdf35('0x47')],null))['then'](respondWithResult(_0x2f0c20,null))[_0xdf35('0x41')](handleError(_0x2f0c20,null));};exports[_0xdf35('0x25')]=function(_0x1c1efb,_0x237fee){return db[_0xdf35('0x2b')][_0xdf35('0x45')]({'where':{'id':_0x1c1efb[_0xdf35('0x43')]['id']}})['then'](handleEntityNotFound(_0x237fee,null))['then'](removeEntity(_0x237fee,null))[_0xdf35('0x41')](handleError(_0x237fee,null));};exports[_0xdf35('0x48')]=function(_0x502557,_0x5278a3,_0x3b9bef){var _0x9892e2={};var _0x1b9d02={};var _0x38aca4;var _0x3cdf4b;return db[_0xdf35('0x2b')][_0xdf35('0x49')]({'where':{'id':_0x502557[_0xdf35('0x43')]['id']}})['then'](handleEntityNotFound(_0x5278a3,null))['then'](function(_0x453366){if(_0x453366){_0x38aca4=_0x453366;_0x1b9d02[_0xdf35('0x34')]=_[_0xdf35('0x30')](db[_0xdf35('0x4a')][_0xdf35('0x2c')]);_0x1b9d02['query']=_[_0xdf35('0x30')](_0x502557[_0xdf35('0x31')]);_0x1b9d02[_0xdf35('0x32')]=_[_0xdf35('0x33')](_0x1b9d02[_0xdf35('0x34')],_0x1b9d02[_0xdf35('0x31')]);_0x9892e2[_0xdf35('0x35')]=_[_0xdf35('0x33')](_0x1b9d02[_0xdf35('0x34')],qs[_0xdf35('0x36')](_0x502557[_0xdf35('0x31')][_0xdf35('0x36')]));_0x9892e2['attributes']=_0x9892e2[_0xdf35('0x35')][_0xdf35('0x37')]?_0x9892e2['attributes']:_0x1b9d02[_0xdf35('0x34')];_0x9892e2[_0xdf35('0x4b')]=qs[_0xdf35('0x39')](_0x502557[_0xdf35('0x31')][_0xdf35('0x39')]);_0x9892e2[_0xdf35('0x3a')]=qs['filters'](_['pick'](_0x502557[_0xdf35('0x31')],_0x1b9d02[_0xdf35('0x32')]));if(_0x502557[_0xdf35('0x31')][_0xdf35('0x3c')]){_0x9892e2[_0xdf35('0x3a')]=_['merge'](_0x9892e2[_0xdf35('0x3a')],{'$or':_[_0xdf35('0x2a')](_0x9892e2[_0xdf35('0x35')],function(_0x230f4e){var _0xc2ffbf={};_0xc2ffbf[_0x230f4e]={'$like':'%'+_0x502557[_0xdf35('0x31')][_0xdf35('0x3c')]+'%'};return _0xc2ffbf;})});}_0x9892e2=_[_0xdf35('0x3d')]({},_0x9892e2,_0x502557[_0xdf35('0x3e')]);return _0x38aca4[_0xdf35('0x48')](_0x9892e2);}})[_0xdf35('0x40')](function(_0x72b6f5){if(_0x72b6f5){_0x3cdf4b=_0x72b6f5[_0xdf35('0x37')];if(!_0x502557[_0xdf35('0x31')]['hasOwnProperty'](_0xdf35('0x38'))){_0x9892e2[_0xdf35('0x1e')]=qs[_0xdf35('0x1e')](_0x502557[_0xdf35('0x31')]['limit']);_0x9892e2[_0xdf35('0x1c')]=qs[_0xdf35('0x1c')](_0x502557[_0xdf35('0x31')]['offset']);}return _0x38aca4['getConfigurations'](_0x9892e2);}})['then'](function(_0x36b3c7){if(_0x36b3c7){return _0x36b3c7?{'count':_0x3cdf4b,'rows':_0x36b3c7}:null;}})['then'](respondWithResult(_0x5278a3,null))[_0xdf35('0x41')](handleError(_0x5278a3,null));};exports[_0xdf35('0x4c')]=function(_0x5af98b,_0x12664e,_0x313be5){if(_0x5af98b['body']['id']){delete _0x5af98b['body']['id'];}return db[_0xdf35('0x2b')][_0xdf35('0x49')]({'where':{'id':_0x5af98b[_0xdf35('0x43')]['id']}})[_0xdf35('0x40')](handleEntityNotFound(_0x12664e,null))[_0xdf35('0x40')](function(_0x419456){if(_0x419456){_0x5af98b['body']['AccountId']=_0x419456['id'];_0x5af98b[_0xdf35('0x47')][_0xdf35('0x4d')]=integrations['getSubjects'](_0x5af98b['body'][_0xdf35('0x4e')],_0x5af98b[_0xdf35('0x47')][_0xdf35('0x2e')]);_0x5af98b['body'][_0xdf35('0x4f')]=integrations['getDescriptions'](_0x5af98b[_0xdf35('0x47')]['channel'],_0x5af98b['body'][_0xdf35('0x2e')]);return db[_0xdf35('0x4a')][_0xdf35('0x46')](_0x5af98b[_0xdf35('0x47')],{'include':[{'model':db[_0xdf35('0x50')],'as':_0xdf35('0x4d')},{'model':db[_0xdf35('0x50')],'as':_0xdf35('0x4f')}]});}return null;})[_0xdf35('0x40')](respondWithResult(_0x12664e,null))[_0xdf35('0x41')](handleError(_0x12664e,null));};exports['getFields']=function(_0x5b3275,_0x587e39,_0x411ef4){var _0x4abba9;var _0x2c4e3e='';var _0x362127=_0xdf35('0x51');return db[_0xdf35('0x2b')][_0xdf35('0x49')]({'where':{'id':_0x5b3275['params']['id']},'attributes':['id',_0xdf35('0x52'),_0xdf35('0x53'),_0xdf35('0x54'),'username',_0xdf35('0x55'),_0xdf35('0x56')]})[_0xdf35('0x40')](handleEntityNotFound(_0x587e39,null))[_0xdf35('0x40')](function(_0x39c02b){if(_0x39c02b){_0x2c4e3e=_0x39c02b[_0xdf35('0x52')];var _0x25dd12=_0x2c4e3e['slice'](-0x1);if(_0x25dd12==='/'){_0x2c4e3e=_0x2c4e3e[_0xdf35('0x57')](0x0,_0x2c4e3e['lastIndexOf'](_0x25dd12));}_0x4abba9=new jsforce[(_0xdf35('0x58'))]({'oauth2':{'loginUrl':_0x2c4e3e,'clientId':_0x39c02b[_0xdf35('0x53')],'clientSecret':_0x39c02b['clientSecret']}});return _0x4abba9[_0xdf35('0x59')](_0x39c02b[_0xdf35('0x5a')],_0x39c02b[_0xdf35('0x55')][_0xdf35('0x5b')](_0x39c02b[_0xdf35('0x56')]));}})['then'](function(_0x14c502){if(_0x14c502){if(!_[_0xdf35('0x5c')](_0x5b3275[_0xdf35('0x31')]['ticketType'])){_0x362127=_0x5b3275[_0xdf35('0x31')][_0xdf35('0x5d')];}return _0x4abba9[_0xdf35('0x5e')](_0x362127)[_0xdf35('0x5f')]();}})['then'](function(_0x2fda3c){var _0x5ea5f3=[_0xdf35('0x60'),_0xdf35('0x61'),_0xdf35('0x62'),_0xdf35('0x63'),_0xdf35('0x64'),_0xdf35('0x65')];var _0x8c6d02=[_0xdf35('0x66'),_0xdf35('0x67'),_0xdf35('0x68'),'boolean',_0xdf35('0x69'),_0xdf35('0x6a'),_0xdf35('0x6b')];if(_0x2fda3c){_['remove'](_0x2fda3c['fields'],function(_0x1475c6){return _0x5ea5f3['includes'](_0x1475c6[_0xdf35('0x6c')])||!_0x8c6d02[_0xdf35('0x6d')](_0x1475c6[_0xdf35('0x2e')]);});return{'count':_0x2fda3c[_0xdf35('0x36')][_0xdf35('0x37')],'rows':_[_0xdf35('0x2a')](_0x2fda3c['fields'],function(_0x53f930){return{'id':_0x53f930[_0xdf35('0x6c')],'name':_0x53f930[_0xdf35('0x6e')],'custom':_0x53f930['custom'],'options':_0x53f930[_0xdf35('0x6f')][_0xdf35('0x37')]>0x0?_[_0xdf35('0x2a')](_0x53f930[_0xdf35('0x6f')],function(_0x294dc1){return{'name':_0x294dc1[_0xdf35('0x6e')],'value':_0x294dc1[_0xdf35('0x70')]};}):_0x53f930[_0xdf35('0x2e')]==_0xdf35('0x71')?[{'name':_0xdf35('0x72'),'value':_0xdf35('0x73')},{'name':_0xdf35('0x74'),'value':_0xdf35('0x75')}]:[]};})};}})[_0xdf35('0x40')](respondWithResult(_0x587e39,null))[_0xdf35('0x41')](function(_0xd672e1){var _0x2cfec4=_0x5b3275[_0xdf35('0x31')][_0xdf35('0x76')]?0x1f4:_0xd672e1[_0xdf35('0x77')]||0x1f4;logger[_0xdf35('0x26')](_0xdf35('0x78'),_0xdf35('0x79'),_0x2cfec4,JSON[_0xdf35('0x7a')](_0xd672e1));delete _0xd672e1[_0xdf35('0x6c')];if(_0x2cfec4===0x191){_0x2cfec4=0x190;}_0x587e39[_0xdf35('0x1a')](_0x2cfec4)[_0xdf35('0x28')](_0x5b3275[_0xdf35('0x31')][_0xdf35('0x76')]?{'message':_0xdf35('0x7b'),'statusCode':_0xd672e1['statusCode']}:_0xd672e1);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 495c183..1c25f84 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 _0x84d1=['util','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','define','SalesforceAccount','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x84d1,0xa4));var _0x184d=function(_0x3713e2,_0x381fd6){_0x3713e2=_0x3713e2-0x0;var _0x4e81d8=_0x84d1[_0x3713e2];return _0x4e81d8;};'use strict';var _=require(_0x184d('0x0'));var util=require(_0x184d('0x1'));var logger=require('../../config/logger')(_0x184d('0x2'));var moment=require(_0x184d('0x3'));var BPromise=require(_0x184d('0x4'));var rp=require(_0x184d('0x5'));var fs=require('fs');var path=require(_0x184d('0x6'));var rimraf=require('rimraf');var config=require(_0x184d('0x7'));var attributes=require(_0x184d('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x738700,_0x1fbed0){return _0x738700[_0x184d('0x9')](_0x184d('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc385=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','api','bluebird','request-promise'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc385,0xa0));var _0x5c38=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xc385[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x5c38('0x0'));var util=require(_0x5c38('0x1'));var logger=require('../../config/logger')(_0x5c38('0x2'));var moment=require('moment');var BPromise=require(_0x5c38('0x3'));var rp=require(_0x5c38('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c38('0x5'));var config=require('../../config/environment');var attributes=require(_0x5c38('0x6'));var integrations=require(_0x5c38('0x7'));module[_0x5c38('0x8')]=function(_0x11dcc6,_0x355863){return _0x11dcc6['define'](_0x5c38('0x9'),attributes,{'tableName':_0x5c38('0xa'),'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 4c341ed..f5bfc04 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 _0x5531=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include','map','attributes','model','debug','stringify','ShowSalesforceAccount','find','lodash','moment','bluebird'];(function(_0x35991d,_0x4f4ab3){var _0x1b4963=function(_0x3db409){while(--_0x3db409){_0x35991d['push'](_0x35991d['shift']());}};_0x1b4963(++_0x4f4ab3);}(_0x5531,0xd5));var _0x1553=function(_0x4c2bbd,_0x4a49b5){_0x4c2bbd=_0x4c2bbd-0x0;var _0x570d19=_0x5531[_0x4c2bbd];return _0x570d19;};'use strict';var _=require(_0x1553('0x0'));var util=require('util');var moment=require(_0x1553('0x1'));var BPromise=require(_0x1553('0x2'));var rs=require(_0x1553('0x3'));var fs=require('fs');var Redis=require(_0x1553('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1553('0x5'));var logger=require(_0x1553('0x6'))(_0x1553('0x7'));var config=require(_0x1553('0x8'));var jayson=require(_0x1553('0x9'));var client=jayson['client'][_0x1553('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1069a5,_0x1c7030,_0x20146e){return new BPromise(function(_0x20b17b,_0x13d622){return client[_0x1553('0xb')](_0x1069a5,_0x20146e)[_0x1553('0xc')](function(_0x5cfaf3){logger[_0x1553('0xd')](_0x1553('0xe'),_0x1c7030,_0x1553('0xf'));logger['debug'](_0x1553('0x10'),_0x1c7030,'request\x20sent',JSON['stringify'](_0x5cfaf3));if(_0x5cfaf3[_0x1553('0x11')]){if(_0x5cfaf3[_0x1553('0x11')][_0x1553('0x12')]===0x1f4){logger[_0x1553('0x11')](_0x1553('0xe'),_0x1c7030,_0x5cfaf3[_0x1553('0x11')][_0x1553('0x13')]);return _0x13d622(_0x5cfaf3[_0x1553('0x11')][_0x1553('0x13')]);}logger[_0x1553('0x11')](_0x1553('0xe'),_0x1c7030,_0x5cfaf3['error'][_0x1553('0x13')]);return _0x20b17b(_0x5cfaf3['error']['message']);}else{logger[_0x1553('0xd')](_0x1553('0xe'),_0x1c7030,_0x1553('0xf'));_0x20b17b(_0x5cfaf3[_0x1553('0x14')][_0x1553('0x13')]);}})[_0x1553('0x15')](function(_0x32ba60){logger[_0x1553('0x11')](_0x1553('0xe'),_0x1c7030,_0x32ba60);_0x13d622(_0x32ba60);});});}exports[_0x1553('0x16')]=function(_0x320fee){var _0x19509a=this;return new Promise(function(_0x47c781,_0x628aac){return db['SalesforceAccount'][_0x1553('0x17')]({'raw':_0x320fee[_0x1553('0x18')]?_0x320fee[_0x1553('0x18')][_0x1553('0x19')]===undefined?!![]:![]:!![],'where':_0x320fee[_0x1553('0x18')]?_0x320fee[_0x1553('0x18')][_0x1553('0x1a')]||null:null,'attributes':_0x320fee[_0x1553('0x18')]?_0x320fee['options']['attributes']||null:null,'limit':_0x320fee[_0x1553('0x18')]?_0x320fee[_0x1553('0x18')][_0x1553('0x1b')]||null:null,'include':_0x320fee[_0x1553('0x18')]?_0x320fee['options'][_0x1553('0x1c')]?_[_0x1553('0x1d')](_0x320fee[_0x1553('0x18')][_0x1553('0x1c')],function(_0x1d00f6){return{'model':db[_0x1d00f6['model']],'as':_0x1d00f6['as'],'attributes':_0x1d00f6[_0x1553('0x1e')],'include':_0x1d00f6[_0x1553('0x1c')]?_['map'](_0x1d00f6[_0x1553('0x1c')],function(_0x5a22d5){return{'model':db[_0x5a22d5[_0x1553('0x1f')]],'as':_0x5a22d5['as'],'attributes':_0x5a22d5[_0x1553('0x1e')],'include':_0x5a22d5['include']?_['map'](_0x5a22d5[_0x1553('0x1c')],function(_0x77d364){return{'model':db[_0x77d364[_0x1553('0x1f')]],'as':_0x77d364['as'],'attributes':_0x77d364[_0x1553('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1553('0xc')](function(_0x52b689){logger['info'](_0x1553('0x16'),_0x320fee);logger[_0x1553('0x20')]('GetSalesforceAccount',_0x320fee,JSON[_0x1553('0x21')](_0x52b689));_0x47c781(_0x52b689);})[_0x1553('0x15')](function(_0x14662d){logger['error'](_0x1553('0x16'),_0x14662d['message'],_0x320fee);_0x628aac(_0x19509a[_0x1553('0x11')](0x1f4,_0x14662d[_0x1553('0x13')]));});});};exports[_0x1553('0x22')]=function(_0x46abc0){var _0x3eb9f7=this;return new Promise(function(_0x524daa,_0x422e13){return db['SalesforceAccount'][_0x1553('0x23')]({'raw':_0x46abc0[_0x1553('0x18')]?_0x46abc0[_0x1553('0x18')][_0x1553('0x19')]===undefined?!![]:![]:!![],'where':_0x46abc0[_0x1553('0x18')]?_0x46abc0['options'][_0x1553('0x1a')]||null:null,'attributes':_0x46abc0[_0x1553('0x18')]?_0x46abc0[_0x1553('0x18')][_0x1553('0x1e')]||null:null,'include':_0x46abc0['options']?_0x46abc0[_0x1553('0x18')][_0x1553('0x1c')]?_[_0x1553('0x1d')](_0x46abc0[_0x1553('0x18')][_0x1553('0x1c')],function(_0x5e6cdc){return{'model':db[_0x5e6cdc['model']],'as':_0x5e6cdc['as'],'attributes':_0x5e6cdc['attributes'],'include':_0x5e6cdc['include']?_[_0x1553('0x1d')](_0x5e6cdc[_0x1553('0x1c')],function(_0x3897f4){return{'model':db[_0x3897f4['model']],'as':_0x3897f4['as'],'attributes':_0x3897f4[_0x1553('0x1e')],'include':_0x3897f4[_0x1553('0x1c')]?_['map'](_0x3897f4[_0x1553('0x1c')],function(_0x1be53b){return{'model':db[_0x1be53b[_0x1553('0x1f')]],'as':_0x1be53b['as'],'attributes':_0x1be53b[_0x1553('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1553('0xc')](function(_0x32085e){logger[_0x1553('0xd')](_0x1553('0x22'),_0x46abc0);logger[_0x1553('0x20')](_0x1553('0x22'),_0x46abc0,JSON['stringify'](_0x32085e));_0x524daa(_0x32085e);})[_0x1553('0x15')](function(_0x30e049){logger[_0x1553('0x11')](_0x1553('0x22'),_0x30e049[_0x1553('0x13')],_0x46abc0);_0x422e13(_0x3eb9f7[_0x1553('0x11')](0x1f4,_0x30e049[_0x1553('0x13')]));});});}; \ No newline at end of file +var _0x2611=['message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','model','map','then','debug','find','where','ShowSalesforceAccount','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55e8ef,_0x57618b){var _0x937802=function(_0x54a5a6){while(--_0x54a5a6){_0x55e8ef['push'](_0x55e8ef['shift']());}};_0x937802(++_0x57618b);}(_0x2611,0xd7));var _0x1261=function(_0x5a28d8,_0x6440fb){_0x5a28d8=_0x5a28d8-0x0;var _0x170c8a=_0x2611[_0x5a28d8];return _0x170c8a;};'use strict';var _=require('lodash');var util=require(_0x1261('0x0'));var moment=require(_0x1261('0x1'));var BPromise=require('bluebird');var rs=require(_0x1261('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1261('0x3'));var logger=require(_0x1261('0x4'))(_0x1261('0x5'));var config=require('../../config/environment');var jayson=require(_0x1261('0x6'));var client=jayson[_0x1261('0x7')][_0x1261('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25ecd4,_0x394efe,_0x13bfb8){return new BPromise(function(_0x2aa117,_0x20d6f){return client['request'](_0x25ecd4,_0x13bfb8)['then'](function(_0x15ad66){logger[_0x1261('0x9')](_0x1261('0xa'),_0x394efe,_0x1261('0xb'));logger['debug'](_0x1261('0xc'),_0x394efe,'request\x20sent',JSON[_0x1261('0xd')](_0x15ad66));if(_0x15ad66['error']){if(_0x15ad66[_0x1261('0xe')][_0x1261('0xf')]===0x1f4){logger[_0x1261('0xe')](_0x1261('0xa'),_0x394efe,_0x15ad66[_0x1261('0xe')]['message']);return _0x20d6f(_0x15ad66[_0x1261('0xe')][_0x1261('0x10')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x394efe,_0x15ad66[_0x1261('0xe')]['message']);return _0x2aa117(_0x15ad66[_0x1261('0xe')]['message']);}else{logger['info'](_0x1261('0xa'),_0x394efe,_0x1261('0xb'));_0x2aa117(_0x15ad66['result'][_0x1261('0x10')]);}})[_0x1261('0x11')](function(_0x42da0e){logger[_0x1261('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x394efe,_0x42da0e);_0x20d6f(_0x42da0e);});});}exports[_0x1261('0x12')]=function(_0x3e16e8){var _0xd176e8=this;return new Promise(function(_0x482265,_0x55eac3){return db[_0x1261('0x13')][_0x1261('0x14')]({'raw':_0x3e16e8[_0x1261('0x15')]?_0x3e16e8['options'][_0x1261('0x16')]===undefined?!![]:![]:!![],'where':_0x3e16e8[_0x1261('0x15')]?_0x3e16e8[_0x1261('0x15')]['where']||null:null,'attributes':_0x3e16e8[_0x1261('0x15')]?_0x3e16e8['options'][_0x1261('0x17')]||null:null,'limit':_0x3e16e8[_0x1261('0x15')]?_0x3e16e8['options'][_0x1261('0x18')]||null:null,'include':_0x3e16e8[_0x1261('0x15')]?_0x3e16e8[_0x1261('0x15')][_0x1261('0x19')]?_['map'](_0x3e16e8['options']['include'],function(_0xd9c065){return{'model':db[_0xd9c065[_0x1261('0x1a')]],'as':_0xd9c065['as'],'attributes':_0xd9c065[_0x1261('0x17')],'include':_0xd9c065[_0x1261('0x19')]?_[_0x1261('0x1b')](_0xd9c065[_0x1261('0x19')],function(_0x2c22cf){return{'model':db[_0x2c22cf['model']],'as':_0x2c22cf['as'],'attributes':_0x2c22cf[_0x1261('0x17')],'include':_0x2c22cf[_0x1261('0x19')]?_['map'](_0x2c22cf[_0x1261('0x19')],function(_0x4ebdab){return{'model':db[_0x4ebdab[_0x1261('0x1a')]],'as':_0x4ebdab['as'],'attributes':_0x4ebdab[_0x1261('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1261('0x1c')](function(_0x1b9ebe){logger[_0x1261('0x9')](_0x1261('0x12'),_0x3e16e8);logger[_0x1261('0x1d')]('GetSalesforceAccount',_0x3e16e8,JSON['stringify'](_0x1b9ebe));_0x482265(_0x1b9ebe);})[_0x1261('0x11')](function(_0xc1b8b2){logger['error'](_0x1261('0x12'),_0xc1b8b2[_0x1261('0x10')],_0x3e16e8);_0x55eac3(_0xd176e8['error'](0x1f4,_0xc1b8b2['message']));});});};exports['ShowSalesforceAccount']=function(_0xf57c06){var _0x5305b3=this;return new Promise(function(_0x4b2668,_0x30165b){return db[_0x1261('0x13')][_0x1261('0x1e')]({'raw':_0xf57c06[_0x1261('0x15')]?_0xf57c06[_0x1261('0x15')][_0x1261('0x16')]===undefined?!![]:![]:!![],'where':_0xf57c06['options']?_0xf57c06[_0x1261('0x15')][_0x1261('0x1f')]||null:null,'attributes':_0xf57c06[_0x1261('0x15')]?_0xf57c06[_0x1261('0x15')][_0x1261('0x17')]||null:null,'include':_0xf57c06['options']?_0xf57c06[_0x1261('0x15')]['include']?_[_0x1261('0x1b')](_0xf57c06[_0x1261('0x15')]['include'],function(_0x21fc88){return{'model':db[_0x21fc88[_0x1261('0x1a')]],'as':_0x21fc88['as'],'attributes':_0x21fc88[_0x1261('0x17')],'include':_0x21fc88[_0x1261('0x19')]?_[_0x1261('0x1b')](_0x21fc88[_0x1261('0x19')],function(_0x1d6e10){return{'model':db[_0x1d6e10['model']],'as':_0x1d6e10['as'],'attributes':_0x1d6e10['attributes'],'include':_0x1d6e10['include']?_[_0x1261('0x1b')](_0x1d6e10[_0x1261('0x19')],function(_0x57a913){return{'model':db[_0x57a913[_0x1261('0x1a')]],'as':_0x57a913['as'],'attributes':_0x57a913['attributes']};}):[]};}):[]};}):[]:[]})[_0x1261('0x1c')](function(_0x4a96be){logger['info'](_0x1261('0x20'),_0xf57c06);logger[_0x1261('0x1d')](_0x1261('0x20'),_0xf57c06,JSON[_0x1261('0xd')](_0x4a96be));_0x4b2668(_0x4a96be);})[_0x1261('0x11')](function(_0x41d1f0){logger[_0x1261('0xe')](_0x1261('0x20'),_0x41d1f0[_0x1261('0x10')],_0xf57c06);_0x30165b(_0x5305b3[_0x1261('0xe')](0x1f4,_0x41d1f0[_0x1261('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2b24714..4143ea4 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x52d15b,_0x41dbd2){var _0x55e57a=function(_0x4e22c5){while(--_0x4e22c5){_0x52d15b['push'](_0x52d15b['shift']());}};_0x55e57a(++_0x41dbd2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14eac8,_0x59be6f){_0x14eac8=_0x14eac8-0x0;var _0x2dc84e=_0x5f2f[_0x14eac8];return _0x2dc84e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xdb28,0x106));var _0x8db2=function(_0x2c3673,_0x1b98c8){_0x2c3673=_0x2c3673-0x0;var _0x238157=_0xdb28[_0x2c3673];return _0x238157;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 24d3bbc..24f7353 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 _0xfda0=['account_contact_lead','contact_lead','ENUM','nothing','account','sequelize','exports','STRING','Task','contact','lead'];(function(_0x19fc64,_0x3cc450){var _0x5b2a74=function(_0x2a2eea){while(--_0x2a2eea){_0x19fc64['push'](_0x19fc64['shift']());}};_0x5b2a74(++_0x3cc450);}(_0xfda0,0x17b));var _0x0fda=function(_0x51f1fc,_0x2fd943){_0x51f1fc=_0x51f1fc-0x0;var _0x5521b9=_0xfda0[_0x51f1fc];return _0x5521b9;};'use strict';var Sequelize=require(_0x0fda('0x0'));module[_0x0fda('0x1')]={'name':{'type':Sequelize[_0x0fda('0x2')]},'description':{'type':Sequelize[_0x0fda('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0fda('0x3'),'Case'),'defaultValue':_0x0fda('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x0fda('0x4'),_0x0fda('0x5'),_0x0fda('0x6'),'account'),'defaultValue':_0x0fda('0x7')},'moduleCreate':{'type':Sequelize[_0x0fda('0x8')](_0x0fda('0x9'),_0x0fda('0x4'),_0x0fda('0x5'),_0x0fda('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x0fda('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0fda('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0fda('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0fda('0x2')]}}; \ No newline at end of file +var _0xf315=['account_contact_lead','account','nothing','contact','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','lead'];(function(_0x346f5a,_0x33de62){var _0x2c1254=function(_0x20c734){while(--_0x20c734){_0x346f5a['push'](_0x346f5a['shift']());}};_0x2c1254(++_0x33de62);}(_0xf315,0x130));var _0x5f31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf315[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5f31('0x0'));module[_0x5f31('0x1')]={'name':{'type':Sequelize[_0x5f31('0x2')]},'description':{'type':Sequelize[_0x5f31('0x2')]},'ticketType':{'type':Sequelize[_0x5f31('0x3')]('Task',_0x5f31('0x4')),'defaultValue':_0x5f31('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5f31('0x6'),'contact',_0x5f31('0x7'),_0x5f31('0x8'),_0x5f31('0x9')),'defaultValue':_0x5f31('0x6')},'moduleCreate':{'type':Sequelize[_0x5f31('0x3')](_0x5f31('0xa'),_0x5f31('0xb'),'lead',_0x5f31('0x9')),'defaultValue':_0x5f31('0x7')},'leadId':{'type':Sequelize[_0x5f31('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x5f31('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5f31('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x5f31('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index bede574..6b32718 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 _0x3456=['find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','map','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','filters','length','options'];(function(_0x26513f,_0xeea75b){var _0x4c1cf7=function(_0x1ca40e){while(--_0x1ca40e){_0x26513f['push'](_0x26513f['shift']());}};_0x4c1cf7(++_0xeea75b);}(_0x3456,0x193));var _0x6345=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x3456[_0x80544e];return _0x4f9b90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6345('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6345('0x1'));var rp=require(_0x6345('0x2'));var moment=require(_0x6345('0x3'));var BPromise=require(_0x6345('0x4'));var Mustache=require(_0x6345('0x5'));var util=require(_0x6345('0x6'));var path=require(_0x6345('0x7'));var sox=require(_0x6345('0x8'));var csv=require(_0x6345('0x9'));var ejs=require(_0x6345('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6345('0xb'));var squel=require(_0x6345('0xc'));var crypto=require('crypto');var jsforce=require(_0x6345('0xd'));var deskjs=require(_0x6345('0xe'));var toCsv=require(_0x6345('0x9'));var querystring=require('querystring');var Papa=require(_0x6345('0xf'));var Redis=require(_0x6345('0x10'));var authService=require(_0x6345('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6345('0x12'));var logger=require('../../config/logger')(_0x6345('0x13'));var utils=require(_0x6345('0x14'));var config=require(_0x6345('0x15'));var licenseUtil=require(_0x6345('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130099,_0x5274bf){_0x5274bf=_0x5274bf||0xcc;return function(_0x259160){if(_0x259160){return _0x130099[_0x6345('0x17')](_0x5274bf);}return _0x130099[_0x6345('0x18')](_0x5274bf)['end']();};}function respondWithResult(_0x28dd7b,_0x5b4d1c){_0x5b4d1c=_0x5b4d1c||0xc8;return function(_0x28c655){if(_0x28c655){return _0x28dd7b[_0x6345('0x18')](_0x5b4d1c)[_0x6345('0x19')](_0x28c655);}};}function respondWithFilteredResult(_0x280d93,_0x9a2848){return function(_0x573453){if(_0x573453){var _0xadc522=typeof _0x9a2848['offset']===_0x6345('0x1a')&&typeof _0x9a2848[_0x6345('0x1b')]===_0x6345('0x1a');var _0x1806a=_0x573453[_0x6345('0x1c')];var _0x13f424=_0xadc522?0x0:_0x9a2848[_0x6345('0x1d')];var _0x2e049d=_0xadc522?_0x573453[_0x6345('0x1c')]:_0x9a2848[_0x6345('0x1d')]+_0x9a2848['limit'];var _0x151fb0;if(_0x2e049d>=_0x1806a){_0x2e049d=_0x1806a;_0x151fb0=0xc8;}else{_0x151fb0=0xce;}_0x280d93[_0x6345('0x18')](_0x151fb0);return _0x280d93['set']('Content-Range',_0x13f424+'-'+_0x2e049d+'/'+_0x1806a)['json'](_0x573453);}return null;};}function patchUpdates(_0xb1bf9d){return function(_0x3155e0){try{jsonpatch[_0x6345('0x1e')](_0x3155e0,_0xb1bf9d,!![]);}catch(_0x29dff5){return BPromise[_0x6345('0x1f')](_0x29dff5);}return _0x3155e0[_0x6345('0x20')]();};}function saveUpdates(_0x3d3f34,_0x3300f4){return function(_0xdecb98){if(_0xdecb98){return _0xdecb98[_0x6345('0x21')](_0x3d3f34)[_0x6345('0x22')](function(_0x407d4a){return _0x407d4a;});}return null;};}function removeEntity(_0x35448e,_0x5ee996){return function(_0xf86e0e){if(_0xf86e0e){return _0xf86e0e[_0x6345('0x23')]()[_0x6345('0x22')](function(){_0x35448e['status'](0xcc)[_0x6345('0x24')]();});}};}function handleEntityNotFound(_0x441468,_0x1e6e06){return function(_0x3222ae){if(!_0x3222ae){_0x441468['sendStatus'](0x194);}return _0x3222ae;};}function handleError(_0xdf9954,_0x57e822){_0x57e822=_0x57e822||0x1f4;return function(_0xebbb04){logger[_0x6345('0x25')](_0xebbb04[_0x6345('0x26')]);if(_0xebbb04[_0x6345('0x27')]){delete _0xebbb04[_0x6345('0x27')];}_0xdf9954[_0x6345('0x18')](_0x57e822)['send'](_0xebbb04);};}exports['index']=function(_0x5ba612,_0xf6e467){var _0x3f2e05={},_0x5dafee={},_0x1b5963={'count':0x0,'rows':[]};var _0x2f012a=_[_0x6345('0x28')](db['SalesforceConfiguration']['rawAttributes'],function(_0x4225f6){return{'name':_0x4225f6[_0x6345('0x29')],'type':_0x4225f6['type'][_0x6345('0x2a')]};});_0x5dafee[_0x6345('0x2b')]=_[_0x6345('0x28')](_0x2f012a,_0x6345('0x27'));_0x5dafee[_0x6345('0x2c')]=_['keys'](_0x5ba612[_0x6345('0x2c')]);_0x5dafee['filters']=_['intersection'](_0x5dafee['model'],_0x5dafee[_0x6345('0x2c')]);_0x3f2e05['attributes']=_[_0x6345('0x2d')](_0x5dafee['model'],qs[_0x6345('0x2e')](_0x5ba612[_0x6345('0x2c')]['fields']));_0x3f2e05[_0x6345('0x2f')]=_0x3f2e05[_0x6345('0x2f')]['length']?_0x3f2e05[_0x6345('0x2f')]:_0x5dafee['model'];if(!_0x5ba612[_0x6345('0x2c')][_0x6345('0x30')](_0x6345('0x31'))){_0x3f2e05['limit']=qs['limit'](_0x5ba612[_0x6345('0x2c')][_0x6345('0x1b')]);_0x3f2e05[_0x6345('0x1d')]=qs[_0x6345('0x1d')](_0x5ba612[_0x6345('0x2c')]['offset']);}_0x3f2e05[_0x6345('0x32')]=qs[_0x6345('0x33')](_0x5ba612[_0x6345('0x2c')][_0x6345('0x33')]);_0x3f2e05[_0x6345('0x34')]=qs['filters'](_[_0x6345('0x35')](_0x5ba612['query'],_0x5dafee['filters']),_0x2f012a);if(_0x5ba612[_0x6345('0x2c')][_0x6345('0x36')]){_0x3f2e05[_0x6345('0x34')]=_['merge'](_0x3f2e05['where'],{'$or':_['map'](_0x2f012a,function(_0x39e88e){if(_0x39e88e[_0x6345('0x37')]!==_0x6345('0x38')){var _0x5a7c78={};_0x5a7c78[_0x39e88e[_0x6345('0x27')]]={'$like':'%'+_0x5ba612[_0x6345('0x2c')][_0x6345('0x36')]+'%'};return _0x5a7c78;}})});}_0x3f2e05=_[_0x6345('0x39')]({},_0x3f2e05,_0x5ba612['options']);var _0x65e39={'where':_0x3f2e05['where']};return db[_0x6345('0x3a')][_0x6345('0x1c')](_0x65e39)[_0x6345('0x22')](function(_0x3c8c8d){_0x1b5963[_0x6345('0x1c')]=_0x3c8c8d;if(_0x5ba612['query'][_0x6345('0x3b')]){_0x3f2e05[_0x6345('0x3c')]=[{'all':!![]}];}return db[_0x6345('0x3a')][_0x6345('0x3d')](_0x3f2e05);})[_0x6345('0x22')](function(_0x5e2567){_0x1b5963[_0x6345('0x3e')]=_0x5e2567;return _0x1b5963;})['then'](respondWithFilteredResult(_0xf6e467,_0x3f2e05))[_0x6345('0x3f')](handleError(_0xf6e467,null));};exports[_0x6345('0x40')]=function(_0x2779e9,_0xfc17d1){var _0x51131c={'raw':![],'where':{'id':_0x2779e9[_0x6345('0x41')]['id']}},_0x71d0e4={};_0x71d0e4['model']=_[_0x6345('0x42')](db[_0x6345('0x3a')][_0x6345('0x43')]);_0x71d0e4['query']=_['keys'](_0x2779e9[_0x6345('0x2c')]);_0x71d0e4[_0x6345('0x44')]=_[_0x6345('0x2d')](_0x71d0e4[_0x6345('0x2b')],_0x71d0e4[_0x6345('0x2c')]);_0x51131c['attributes']=_[_0x6345('0x2d')](_0x71d0e4[_0x6345('0x2b')],qs[_0x6345('0x2e')](_0x2779e9['query'][_0x6345('0x2e')]));_0x51131c['attributes']=_0x51131c['attributes'][_0x6345('0x45')]?_0x51131c[_0x6345('0x2f')]:_0x71d0e4[_0x6345('0x2b')];if(_0x2779e9[_0x6345('0x2c')][_0x6345('0x3b')]){_0x51131c['include']=[{'all':!![]}];}_0x51131c=_['merge']({},_0x51131c,_0x2779e9[_0x6345('0x46')]);return db[_0x6345('0x3a')][_0x6345('0x47')](_0x51131c)[_0x6345('0x22')](handleEntityNotFound(_0xfc17d1,null))[_0x6345('0x22')](respondWithResult(_0xfc17d1,null))[_0x6345('0x3f')](handleError(_0xfc17d1,null));};exports[_0x6345('0x48')]=function(_0x285aea,_0x41d6e3){return db[_0x6345('0x3a')][_0x6345('0x48')](_0x285aea[_0x6345('0x49')],{})[_0x6345('0x22')](respondWithResult(_0x41d6e3,0xc9))[_0x6345('0x3f')](handleError(_0x41d6e3,null));};exports[_0x6345('0x21')]=function(_0x4cc0d2,_0x44225b){if(_0x4cc0d2[_0x6345('0x49')]['id']){delete _0x4cc0d2[_0x6345('0x49')]['id'];}return db['SalesforceConfiguration'][_0x6345('0x47')]({'where':{'id':_0x4cc0d2[_0x6345('0x41')]['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x44225b,null))[_0x6345('0x22')](saveUpdates(_0x4cc0d2[_0x6345('0x49')],null))[_0x6345('0x22')](respondWithResult(_0x44225b,null))[_0x6345('0x3f')](handleError(_0x44225b,null));};exports[_0x6345('0x23')]=function(_0x25f107,_0x380ecb){return db[_0x6345('0x3a')]['find']({'where':{'id':_0x25f107[_0x6345('0x41')]['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x380ecb,null))[_0x6345('0x22')](removeEntity(_0x380ecb,null))[_0x6345('0x3f')](handleError(_0x380ecb,null));};exports[_0x6345('0x4a')]=function(_0x5384d5,_0x1e14ae,_0x254918){var _0xa9c4b7={};var _0x10397f={};var _0x147874;var _0x315be6;return db[_0x6345('0x3a')][_0x6345('0x4b')]({'where':{'id':_0x5384d5['params']['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x1e14ae,null))[_0x6345('0x22')](function(_0x566f91){if(_0x566f91){_0x147874=_0x566f91;_0x10397f[_0x6345('0x2b')]=_[_0x6345('0x42')](db[_0x6345('0x4c')]['rawAttributes']);_0x10397f[_0x6345('0x2c')]=_['keys'](_0x5384d5[_0x6345('0x2c')]);_0x10397f['filters']=_[_0x6345('0x2d')](_0x10397f[_0x6345('0x2b')],_0x10397f[_0x6345('0x2c')]);_0xa9c4b7[_0x6345('0x2f')]=_['intersection'](_0x10397f[_0x6345('0x2b')],qs[_0x6345('0x2e')](_0x5384d5[_0x6345('0x2c')][_0x6345('0x2e')]));_0xa9c4b7['attributes']=_0xa9c4b7['attributes']['length']?_0xa9c4b7[_0x6345('0x2f')]:_0x10397f[_0x6345('0x2b')];_0xa9c4b7[_0x6345('0x32')]=qs[_0x6345('0x33')](_0x5384d5[_0x6345('0x2c')]['sort']);_0xa9c4b7[_0x6345('0x34')]=qs[_0x6345('0x44')](_[_0x6345('0x35')](_0x5384d5[_0x6345('0x2c')],_0x10397f[_0x6345('0x44')]));if(_0x5384d5[_0x6345('0x2c')]['filter']){_0xa9c4b7['where']=_[_0x6345('0x39')](_0xa9c4b7[_0x6345('0x34')],{'$or':_[_0x6345('0x28')](_0xa9c4b7['attributes'],function(_0x18cbc2){var _0x74c61d={};_0x74c61d[_0x18cbc2]={'$like':'%'+_0x5384d5[_0x6345('0x2c')][_0x6345('0x36')]+'%'};return _0x74c61d;})});}_0xa9c4b7=_['merge']({},_0xa9c4b7,_0x5384d5[_0x6345('0x46')]);return _0x147874[_0x6345('0x4a')](_0xa9c4b7);}})[_0x6345('0x22')](function(_0x5ad36b){if(_0x5ad36b){_0x315be6=_0x5ad36b[_0x6345('0x45')];if(!_0x5384d5[_0x6345('0x2c')][_0x6345('0x30')](_0x6345('0x31'))){_0xa9c4b7[_0x6345('0x1b')]=qs['limit'](_0x5384d5[_0x6345('0x2c')][_0x6345('0x1b')]);_0xa9c4b7[_0x6345('0x1d')]=qs['offset'](_0x5384d5['query'][_0x6345('0x1d')]);}return _0x147874[_0x6345('0x4a')](_0xa9c4b7);}})[_0x6345('0x22')](function(_0xcf7fa9){if(_0xcf7fa9){return _0xcf7fa9?{'count':_0x315be6,'rows':_0xcf7fa9}:null;}})[_0x6345('0x22')](respondWithResult(_0x1e14ae,null))[_0x6345('0x3f')](handleError(_0x1e14ae,null));};exports[_0x6345('0x4d')]=function(_0x5c2f99,_0x30be3d,_0x16d01e){var _0x3fe1da={};var _0x156c01={};var _0x34e967;var _0x53fe7f;return db[_0x6345('0x3a')]['findOne']({'where':{'id':_0x5c2f99[_0x6345('0x41')]['id']}})[_0x6345('0x22')](handleEntityNotFound(_0x30be3d,null))['then'](function(_0x174d1f){if(_0x174d1f){_0x34e967=_0x174d1f;_0x156c01[_0x6345('0x2b')]=_[_0x6345('0x42')](db[_0x6345('0x4c')]['rawAttributes']);_0x156c01[_0x6345('0x2c')]=_[_0x6345('0x42')](_0x5c2f99[_0x6345('0x2c')]);_0x156c01['filters']=_['intersection'](_0x156c01[_0x6345('0x2b')],_0x156c01['query']);_0x3fe1da[_0x6345('0x2f')]=_[_0x6345('0x2d')](_0x156c01['model'],qs['fields'](_0x5c2f99['query'][_0x6345('0x2e')]));_0x3fe1da['attributes']=_0x3fe1da[_0x6345('0x2f')][_0x6345('0x45')]?_0x3fe1da[_0x6345('0x2f')]:_0x156c01['model'];_0x3fe1da[_0x6345('0x32')]=qs[_0x6345('0x33')](_0x5c2f99[_0x6345('0x2c')][_0x6345('0x33')]);_0x3fe1da[_0x6345('0x34')]=qs[_0x6345('0x44')](_[_0x6345('0x35')](_0x5c2f99[_0x6345('0x2c')],_0x156c01[_0x6345('0x44')]));if(_0x5c2f99[_0x6345('0x2c')][_0x6345('0x36')]){_0x3fe1da[_0x6345('0x34')]=_[_0x6345('0x39')](_0x3fe1da[_0x6345('0x34')],{'$or':_[_0x6345('0x28')](_0x3fe1da['attributes'],function(_0x15ede9){var _0x1adead={};_0x1adead[_0x15ede9]={'$like':'%'+_0x5c2f99['query'][_0x6345('0x36')]+'%'};return _0x1adead;})});}_0x3fe1da=_['merge']({},_0x3fe1da,_0x5c2f99['options']);return _0x34e967['getSubjects'](_0x3fe1da);}})[_0x6345('0x22')](function(_0x3a6a75){if(_0x3a6a75){_0x53fe7f=_0x3a6a75['length'];if(!_0x5c2f99[_0x6345('0x2c')][_0x6345('0x30')]('nolimit')){_0x3fe1da['limit']=qs[_0x6345('0x1b')](_0x5c2f99[_0x6345('0x2c')][_0x6345('0x1b')]);_0x3fe1da[_0x6345('0x1d')]=qs[_0x6345('0x1d')](_0x5c2f99[_0x6345('0x2c')][_0x6345('0x1d')]);}return _0x34e967['getSubjects'](_0x3fe1da);}})[_0x6345('0x22')](function(_0x289060){if(_0x289060){return _0x289060?{'count':_0x53fe7f,'rows':_0x289060}:null;}})['then'](respondWithResult(_0x30be3d,null))['catch'](handleError(_0x30be3d,null));};exports[_0x6345('0x4e')]=function(_0x1c2936,_0x3cb5cd,_0xfca5f2){var _0x4ae81d={};var _0x29a388={};var _0x2a1993;var _0x51c03f;return db[_0x6345('0x3a')][_0x6345('0x4b')]({'where':{'id':_0x1c2936[_0x6345('0x41')]['id']}})['then'](handleEntityNotFound(_0x3cb5cd,null))['then'](function(_0x28f9dc){if(_0x28f9dc){_0x2a1993=_0x28f9dc;_0x29a388[_0x6345('0x2b')]=_['keys'](db[_0x6345('0x4c')]['rawAttributes']);_0x29a388[_0x6345('0x2c')]=_['keys'](_0x1c2936[_0x6345('0x2c')]);_0x29a388[_0x6345('0x44')]=_[_0x6345('0x2d')](_0x29a388[_0x6345('0x2b')],_0x29a388['query']);_0x4ae81d['attributes']=_[_0x6345('0x2d')](_0x29a388[_0x6345('0x2b')],qs[_0x6345('0x2e')](_0x1c2936[_0x6345('0x2c')][_0x6345('0x2e')]));_0x4ae81d[_0x6345('0x2f')]=_0x4ae81d[_0x6345('0x2f')][_0x6345('0x45')]?_0x4ae81d['attributes']:_0x29a388[_0x6345('0x2b')];_0x4ae81d['order']=qs[_0x6345('0x33')](_0x1c2936[_0x6345('0x2c')][_0x6345('0x33')]);_0x4ae81d[_0x6345('0x34')]=qs['filters'](_['pick'](_0x1c2936['query'],_0x29a388['filters']));if(_0x1c2936[_0x6345('0x2c')]['filter']){_0x4ae81d[_0x6345('0x34')]=_[_0x6345('0x39')](_0x4ae81d[_0x6345('0x34')],{'$or':_['map'](_0x4ae81d['attributes'],function(_0xaf0f89){var _0x185ffd={};_0x185ffd[_0xaf0f89]={'$like':'%'+_0x1c2936[_0x6345('0x2c')]['filter']+'%'};return _0x185ffd;})});}_0x4ae81d=_[_0x6345('0x39')]({},_0x4ae81d,_0x1c2936[_0x6345('0x46')]);return _0x2a1993[_0x6345('0x4e')](_0x4ae81d);}})['then'](function(_0x34b051){if(_0x34b051){_0x51c03f=_0x34b051['length'];if(!_0x1c2936[_0x6345('0x2c')]['hasOwnProperty'](_0x6345('0x31'))){_0x4ae81d['limit']=qs[_0x6345('0x1b')](_0x1c2936[_0x6345('0x2c')][_0x6345('0x1b')]);_0x4ae81d[_0x6345('0x1d')]=qs['offset'](_0x1c2936[_0x6345('0x2c')][_0x6345('0x1d')]);}return _0x2a1993[_0x6345('0x4e')](_0x4ae81d);}})[_0x6345('0x22')](function(_0x354e18){if(_0x354e18){return _0x354e18?{'count':_0x51c03f,'rows':_0x354e18}:null;}})[_0x6345('0x22')](respondWithResult(_0x3cb5cd,null))['catch'](handleError(_0x3cb5cd,null));}; \ No newline at end of file +var _0x0896=['filter','merge','where','includeAll','include','SalesforceConfiguration','rows','params','options','find','catch','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x955204,_0x563ef8){var _0x4d1f7e=function(_0xe81a02){while(--_0xe81a02){_0x955204['push'](_0x955204['shift']());}};_0x4d1f7e(++_0x563ef8);}(_0x0896,0x12a));var _0x6089=function(_0x35f41c,_0x124e77){_0x35f41c=_0x35f41c-0x0;var _0x1f25fb=_0x0896[_0x35f41c];return _0x1f25fb;};'use strict';var emlformat=require(_0x6089('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6089('0x1'));var jsonpatch=require(_0x6089('0x2'));var rp=require('request-promise');var moment=require(_0x6089('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6089('0x4'));var path=require(_0x6089('0x5'));var sox=require(_0x6089('0x6'));var csv=require('to-csv');var ejs=require(_0x6089('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6089('0x8'));var crypto=require(_0x6089('0x9'));var jsforce=require(_0x6089('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6089('0xb'));var querystring=require(_0x6089('0xc'));var Papa=require(_0x6089('0xd'));var Redis=require('ioredis');var authService=require(_0x6089('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6089('0xf'))('api');var utils=require(_0x6089('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6089('0x11'))['db'];function respondWithStatusCode(_0x47456e,_0x1ab9fc){_0x1ab9fc=_0x1ab9fc||0xcc;return function(_0x32f056){if(_0x32f056){return _0x47456e[_0x6089('0x12')](_0x1ab9fc);}return _0x47456e[_0x6089('0x13')](_0x1ab9fc)['end']();};}function respondWithResult(_0x1e4a10,_0x193bb2){_0x193bb2=_0x193bb2||0xc8;return function(_0x4635fd){if(_0x4635fd){return _0x1e4a10[_0x6089('0x13')](_0x193bb2)[_0x6089('0x14')](_0x4635fd);}};}function respondWithFilteredResult(_0x27e913,_0x3761a2){return function(_0x2c8c6f){if(_0x2c8c6f){var _0x31681b=typeof _0x3761a2[_0x6089('0x15')]===_0x6089('0x16')&&typeof _0x3761a2[_0x6089('0x17')]===_0x6089('0x16');var _0x52608c=_0x2c8c6f[_0x6089('0x18')];var _0x3b06a=_0x31681b?0x0:_0x3761a2['offset'];var _0x146246=_0x31681b?_0x2c8c6f[_0x6089('0x18')]:_0x3761a2[_0x6089('0x15')]+_0x3761a2[_0x6089('0x17')];var _0x4a138e;if(_0x146246>=_0x52608c){_0x146246=_0x52608c;_0x4a138e=0xc8;}else{_0x4a138e=0xce;}_0x27e913[_0x6089('0x13')](_0x4a138e);return _0x27e913['set'](_0x6089('0x19'),_0x3b06a+'-'+_0x146246+'/'+_0x52608c)[_0x6089('0x14')](_0x2c8c6f);}return null;};}function patchUpdates(_0x3203bf){return function(_0x19003a){try{jsonpatch[_0x6089('0x1a')](_0x19003a,_0x3203bf,!![]);}catch(_0x249188){return BPromise[_0x6089('0x1b')](_0x249188);}return _0x19003a[_0x6089('0x1c')]();};}function saveUpdates(_0x5010ff,_0x358cc1){return function(_0x44c230){if(_0x44c230){return _0x44c230[_0x6089('0x1d')](_0x5010ff)['then'](function(_0x349a54){return _0x349a54;});}return null;};}function removeEntity(_0x2653e4,_0x2e2bf4){return function(_0x513a53){if(_0x513a53){return _0x513a53[_0x6089('0x1e')]()[_0x6089('0x1f')](function(){_0x2653e4[_0x6089('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28c61d,_0x1bda9c){return function(_0x48626){if(!_0x48626){_0x28c61d['sendStatus'](0x194);}return _0x48626;};}function handleError(_0x2a0919,_0x5e98c5){_0x5e98c5=_0x5e98c5||0x1f4;return function(_0x2e39ea){logger['error'](_0x2e39ea['stack']);if(_0x2e39ea[_0x6089('0x20')]){delete _0x2e39ea['name'];}_0x2a0919['status'](_0x5e98c5)['send'](_0x2e39ea);};}exports[_0x6089('0x21')]=function(_0x2b2fee,_0x369085){var _0x40b434={},_0x3c2d9b={},_0x2ceb82={'count':0x0,'rows':[]};var _0xd07eed=_[_0x6089('0x22')](db['SalesforceConfiguration'][_0x6089('0x23')],function(_0x14ba25){return{'name':_0x14ba25[_0x6089('0x24')],'type':_0x14ba25[_0x6089('0x25')][_0x6089('0x26')]};});_0x3c2d9b[_0x6089('0x27')]=_[_0x6089('0x22')](_0xd07eed,_0x6089('0x20'));_0x3c2d9b[_0x6089('0x28')]=_[_0x6089('0x29')](_0x2b2fee['query']);_0x3c2d9b[_0x6089('0x2a')]=_[_0x6089('0x2b')](_0x3c2d9b['model'],_0x3c2d9b[_0x6089('0x28')]);_0x40b434[_0x6089('0x2c')]=_[_0x6089('0x2b')](_0x3c2d9b[_0x6089('0x27')],qs['fields'](_0x2b2fee['query'][_0x6089('0x2d')]));_0x40b434[_0x6089('0x2c')]=_0x40b434[_0x6089('0x2c')][_0x6089('0x2e')]?_0x40b434[_0x6089('0x2c')]:_0x3c2d9b['model'];if(!_0x2b2fee[_0x6089('0x28')][_0x6089('0x2f')](_0x6089('0x30'))){_0x40b434['limit']=qs[_0x6089('0x17')](_0x2b2fee[_0x6089('0x28')][_0x6089('0x17')]);_0x40b434['offset']=qs[_0x6089('0x15')](_0x2b2fee[_0x6089('0x28')]['offset']);}_0x40b434[_0x6089('0x31')]=qs['sort'](_0x2b2fee[_0x6089('0x28')][_0x6089('0x32')]);_0x40b434['where']=qs[_0x6089('0x2a')](_[_0x6089('0x33')](_0x2b2fee[_0x6089('0x28')],_0x3c2d9b[_0x6089('0x2a')]),_0xd07eed);if(_0x2b2fee['query'][_0x6089('0x34')]){_0x40b434['where']=_[_0x6089('0x35')](_0x40b434[_0x6089('0x36')],{'$or':_[_0x6089('0x22')](_0xd07eed,function(_0xa95df){if(_0xa95df[_0x6089('0x25')]!=='VIRTUAL'){var _0x397eec={};_0x397eec[_0xa95df['name']]={'$like':'%'+_0x2b2fee[_0x6089('0x28')][_0x6089('0x34')]+'%'};return _0x397eec;}})});}_0x40b434=_[_0x6089('0x35')]({},_0x40b434,_0x2b2fee['options']);var _0xf6a004={'where':_0x40b434[_0x6089('0x36')]};return db['SalesforceConfiguration'][_0x6089('0x18')](_0xf6a004)[_0x6089('0x1f')](function(_0x117970){_0x2ceb82[_0x6089('0x18')]=_0x117970;if(_0x2b2fee['query'][_0x6089('0x37')]){_0x40b434[_0x6089('0x38')]=[{'all':!![]}];}return db[_0x6089('0x39')]['findAll'](_0x40b434);})[_0x6089('0x1f')](function(_0x60278b){_0x2ceb82[_0x6089('0x3a')]=_0x60278b;return _0x2ceb82;})[_0x6089('0x1f')](respondWithFilteredResult(_0x369085,_0x40b434))['catch'](handleError(_0x369085,null));};exports['show']=function(_0x56e228,_0x236750){var _0x4e00d9={'raw':![],'where':{'id':_0x56e228[_0x6089('0x3b')]['id']}},_0x2dda91={};_0x2dda91['model']=_[_0x6089('0x29')](db[_0x6089('0x39')][_0x6089('0x23')]);_0x2dda91['query']=_[_0x6089('0x29')](_0x56e228[_0x6089('0x28')]);_0x2dda91[_0x6089('0x2a')]=_['intersection'](_0x2dda91[_0x6089('0x27')],_0x2dda91['query']);_0x4e00d9['attributes']=_['intersection'](_0x2dda91[_0x6089('0x27')],qs[_0x6089('0x2d')](_0x56e228[_0x6089('0x28')]['fields']));_0x4e00d9[_0x6089('0x2c')]=_0x4e00d9[_0x6089('0x2c')]['length']?_0x4e00d9[_0x6089('0x2c')]:_0x2dda91[_0x6089('0x27')];if(_0x56e228[_0x6089('0x28')]['includeAll']){_0x4e00d9[_0x6089('0x38')]=[{'all':!![]}];}_0x4e00d9=_['merge']({},_0x4e00d9,_0x56e228[_0x6089('0x3c')]);return db['SalesforceConfiguration'][_0x6089('0x3d')](_0x4e00d9)[_0x6089('0x1f')](handleEntityNotFound(_0x236750,null))['then'](respondWithResult(_0x236750,null))[_0x6089('0x3e')](handleError(_0x236750,null));};exports[_0x6089('0x3f')]=function(_0x1dcbf8,_0x5dbddd){return db[_0x6089('0x39')][_0x6089('0x3f')](_0x1dcbf8[_0x6089('0x40')],{})[_0x6089('0x1f')](respondWithResult(_0x5dbddd,0xc9))['catch'](handleError(_0x5dbddd,null));};exports['update']=function(_0x4b753a,_0x57de78){if(_0x4b753a[_0x6089('0x40')]['id']){delete _0x4b753a[_0x6089('0x40')]['id'];}return db['SalesforceConfiguration'][_0x6089('0x3d')]({'where':{'id':_0x4b753a[_0x6089('0x3b')]['id']}})[_0x6089('0x1f')](handleEntityNotFound(_0x57de78,null))[_0x6089('0x1f')](saveUpdates(_0x4b753a[_0x6089('0x40')],null))[_0x6089('0x1f')](respondWithResult(_0x57de78,null))[_0x6089('0x3e')](handleError(_0x57de78,null));};exports[_0x6089('0x1e')]=function(_0x2bf0de,_0x165d00){return db[_0x6089('0x39')]['find']({'where':{'id':_0x2bf0de['params']['id']}})[_0x6089('0x1f')](handleEntityNotFound(_0x165d00,null))[_0x6089('0x1f')](removeEntity(_0x165d00,null))[_0x6089('0x3e')](handleError(_0x165d00,null));};exports[_0x6089('0x41')]=function(_0x3dd8f4,_0x1c5427,_0x5de6d9){var _0x45a74e={};var _0x47ff83={};var _0x4aa132;var _0x117ff7;return db[_0x6089('0x39')][_0x6089('0x42')]({'where':{'id':_0x3dd8f4[_0x6089('0x3b')]['id']}})[_0x6089('0x1f')](handleEntityNotFound(_0x1c5427,null))[_0x6089('0x1f')](function(_0x3d2ca5){if(_0x3d2ca5){_0x4aa132=_0x3d2ca5;_0x47ff83[_0x6089('0x27')]=_[_0x6089('0x29')](db[_0x6089('0x43')][_0x6089('0x23')]);_0x47ff83[_0x6089('0x28')]=_[_0x6089('0x29')](_0x3dd8f4[_0x6089('0x28')]);_0x47ff83[_0x6089('0x2a')]=_[_0x6089('0x2b')](_0x47ff83['model'],_0x47ff83[_0x6089('0x28')]);_0x45a74e[_0x6089('0x2c')]=_[_0x6089('0x2b')](_0x47ff83[_0x6089('0x27')],qs[_0x6089('0x2d')](_0x3dd8f4['query'][_0x6089('0x2d')]));_0x45a74e[_0x6089('0x2c')]=_0x45a74e[_0x6089('0x2c')][_0x6089('0x2e')]?_0x45a74e['attributes']:_0x47ff83[_0x6089('0x27')];_0x45a74e[_0x6089('0x31')]=qs[_0x6089('0x32')](_0x3dd8f4[_0x6089('0x28')][_0x6089('0x32')]);_0x45a74e['where']=qs[_0x6089('0x2a')](_[_0x6089('0x33')](_0x3dd8f4['query'],_0x47ff83[_0x6089('0x2a')]));if(_0x3dd8f4[_0x6089('0x28')]['filter']){_0x45a74e['where']=_[_0x6089('0x35')](_0x45a74e['where'],{'$or':_['map'](_0x45a74e[_0x6089('0x2c')],function(_0x2d8e5c){var _0x56db1d={};_0x56db1d[_0x2d8e5c]={'$like':'%'+_0x3dd8f4[_0x6089('0x28')][_0x6089('0x34')]+'%'};return _0x56db1d;})});}_0x45a74e=_[_0x6089('0x35')]({},_0x45a74e,_0x3dd8f4[_0x6089('0x3c')]);return _0x4aa132[_0x6089('0x41')](_0x45a74e);}})['then'](function(_0x2158eb){if(_0x2158eb){_0x117ff7=_0x2158eb[_0x6089('0x2e')];if(!_0x3dd8f4[_0x6089('0x28')]['hasOwnProperty'](_0x6089('0x30'))){_0x45a74e[_0x6089('0x17')]=qs['limit'](_0x3dd8f4['query'][_0x6089('0x17')]);_0x45a74e[_0x6089('0x15')]=qs[_0x6089('0x15')](_0x3dd8f4[_0x6089('0x28')][_0x6089('0x15')]);}return _0x4aa132[_0x6089('0x41')](_0x45a74e);}})[_0x6089('0x1f')](function(_0x5af530){if(_0x5af530){return _0x5af530?{'count':_0x117ff7,'rows':_0x5af530}:null;}})[_0x6089('0x1f')](respondWithResult(_0x1c5427,null))[_0x6089('0x3e')](handleError(_0x1c5427,null));};exports['getSubjects']=function(_0x1677a3,_0x325c5a,_0x2ec896){var _0x5cae0c={};var _0xe9ad12={};var _0x354769;var _0x2f55d4;return db[_0x6089('0x39')][_0x6089('0x42')]({'where':{'id':_0x1677a3[_0x6089('0x3b')]['id']}})[_0x6089('0x1f')](handleEntityNotFound(_0x325c5a,null))[_0x6089('0x1f')](function(_0x4777eb){if(_0x4777eb){_0x354769=_0x4777eb;_0xe9ad12[_0x6089('0x27')]=_[_0x6089('0x29')](db['SalesforceField']['rawAttributes']);_0xe9ad12['query']=_[_0x6089('0x29')](_0x1677a3[_0x6089('0x28')]);_0xe9ad12[_0x6089('0x2a')]=_[_0x6089('0x2b')](_0xe9ad12['model'],_0xe9ad12[_0x6089('0x28')]);_0x5cae0c['attributes']=_[_0x6089('0x2b')](_0xe9ad12[_0x6089('0x27')],qs[_0x6089('0x2d')](_0x1677a3[_0x6089('0x28')][_0x6089('0x2d')]));_0x5cae0c[_0x6089('0x2c')]=_0x5cae0c[_0x6089('0x2c')][_0x6089('0x2e')]?_0x5cae0c[_0x6089('0x2c')]:_0xe9ad12[_0x6089('0x27')];_0x5cae0c[_0x6089('0x31')]=qs['sort'](_0x1677a3[_0x6089('0x28')][_0x6089('0x32')]);_0x5cae0c[_0x6089('0x36')]=qs[_0x6089('0x2a')](_['pick'](_0x1677a3[_0x6089('0x28')],_0xe9ad12[_0x6089('0x2a')]));if(_0x1677a3['query'][_0x6089('0x34')]){_0x5cae0c['where']=_[_0x6089('0x35')](_0x5cae0c['where'],{'$or':_['map'](_0x5cae0c[_0x6089('0x2c')],function(_0x4b7a82){var _0x4565cb={};_0x4565cb[_0x4b7a82]={'$like':'%'+_0x1677a3[_0x6089('0x28')][_0x6089('0x34')]+'%'};return _0x4565cb;})});}_0x5cae0c=_[_0x6089('0x35')]({},_0x5cae0c,_0x1677a3[_0x6089('0x3c')]);return _0x354769[_0x6089('0x44')](_0x5cae0c);}})['then'](function(_0x30c202){if(_0x30c202){_0x2f55d4=_0x30c202[_0x6089('0x2e')];if(!_0x1677a3['query'][_0x6089('0x2f')](_0x6089('0x30'))){_0x5cae0c['limit']=qs['limit'](_0x1677a3[_0x6089('0x28')][_0x6089('0x17')]);_0x5cae0c['offset']=qs[_0x6089('0x15')](_0x1677a3[_0x6089('0x28')][_0x6089('0x15')]);}return _0x354769['getSubjects'](_0x5cae0c);}})[_0x6089('0x1f')](function(_0x982d6){if(_0x982d6){return _0x982d6?{'count':_0x2f55d4,'rows':_0x982d6}:null;}})[_0x6089('0x1f')](respondWithResult(_0x325c5a,null))[_0x6089('0x3e')](handleError(_0x325c5a,null));};exports[_0x6089('0x45')]=function(_0x132984,_0x5065e8,_0x5b6a6e){var _0x7992b5={};var _0x21e563={};var _0x1fa727;var _0x3ce183;return db['SalesforceConfiguration'][_0x6089('0x42')]({'where':{'id':_0x132984['params']['id']}})[_0x6089('0x1f')](handleEntityNotFound(_0x5065e8,null))[_0x6089('0x1f')](function(_0x25899f){if(_0x25899f){_0x1fa727=_0x25899f;_0x21e563[_0x6089('0x27')]=_['keys'](db[_0x6089('0x43')][_0x6089('0x23')]);_0x21e563['query']=_[_0x6089('0x29')](_0x132984[_0x6089('0x28')]);_0x21e563[_0x6089('0x2a')]=_['intersection'](_0x21e563[_0x6089('0x27')],_0x21e563[_0x6089('0x28')]);_0x7992b5[_0x6089('0x2c')]=_[_0x6089('0x2b')](_0x21e563[_0x6089('0x27')],qs[_0x6089('0x2d')](_0x132984['query'][_0x6089('0x2d')]));_0x7992b5[_0x6089('0x2c')]=_0x7992b5[_0x6089('0x2c')][_0x6089('0x2e')]?_0x7992b5[_0x6089('0x2c')]:_0x21e563[_0x6089('0x27')];_0x7992b5['order']=qs['sort'](_0x132984['query'][_0x6089('0x32')]);_0x7992b5[_0x6089('0x36')]=qs[_0x6089('0x2a')](_[_0x6089('0x33')](_0x132984[_0x6089('0x28')],_0x21e563[_0x6089('0x2a')]));if(_0x132984[_0x6089('0x28')][_0x6089('0x34')]){_0x7992b5[_0x6089('0x36')]=_[_0x6089('0x35')](_0x7992b5[_0x6089('0x36')],{'$or':_['map'](_0x7992b5[_0x6089('0x2c')],function(_0x50561c){var _0x1e3d73={};_0x1e3d73[_0x50561c]={'$like':'%'+_0x132984[_0x6089('0x28')][_0x6089('0x34')]+'%'};return _0x1e3d73;})});}_0x7992b5=_[_0x6089('0x35')]({},_0x7992b5,_0x132984[_0x6089('0x3c')]);return _0x1fa727[_0x6089('0x45')](_0x7992b5);}})['then'](function(_0xca76ee){if(_0xca76ee){_0x3ce183=_0xca76ee['length'];if(!_0x132984[_0x6089('0x28')]['hasOwnProperty'](_0x6089('0x30'))){_0x7992b5['limit']=qs['limit'](_0x132984[_0x6089('0x28')][_0x6089('0x17')]);_0x7992b5['offset']=qs[_0x6089('0x15')](_0x132984[_0x6089('0x28')][_0x6089('0x15')]);}return _0x1fa727[_0x6089('0x45')](_0x7992b5);}})[_0x6089('0x1f')](function(_0x12da3c){if(_0x12da3c){return _0x12da3c?{'count':_0x3ce183,'rows':_0x12da3c}:null;}})[_0x6089('0x1f')](respondWithResult(_0x5065e8,null))[_0x6089('0x3e')](handleError(_0x5065e8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index fcd48ce..2a865da 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 _0xd02c=['./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5be211,_0x236afd){var _0x2f1a8c=function(_0x117786){while(--_0x117786){_0x5be211['push'](_0x5be211['shift']());}};_0x2f1a8c(++_0x236afd);}(_0xd02c,0x1bc));var _0xcd02=function(_0xe1ec8f,_0x1e7415){_0xe1ec8f=_0xe1ec8f-0x0;var _0x25ecad=_0xd02c[_0xe1ec8f];return _0x25ecad;};'use strict';var _=require(_0xcd02('0x0'));var util=require(_0xcd02('0x1'));var logger=require(_0xcd02('0x2'))(_0xcd02('0x3'));var moment=require(_0xcd02('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd02('0x6'));module['exports']=function(_0x45a9ed,_0x3e05f0){return _0x45a9ed[_0xcd02('0x7')](_0xcd02('0x8'),attributes,{'tableName':_0xcd02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82e1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x579f0c,_0x34c753){var _0x204b6c=function(_0xf7e537){while(--_0xf7e537){_0x579f0c['push'](_0x579f0c['shift']());}};_0x204b6c(++_0x34c753);}(_0x82e1,0x14f));var _0x182e=function(_0x1f6691,_0x3a3d46){_0x1f6691=_0x1f6691-0x0;var _0xf786b6=_0x82e1[_0x1f6691];return _0xf786b6;};'use strict';var _=require(_0x182e('0x0'));var util=require(_0x182e('0x1'));var logger=require(_0x182e('0x2'))(_0x182e('0x3'));var moment=require(_0x182e('0x4'));var BPromise=require(_0x182e('0x5'));var rp=require(_0x182e('0x6'));var fs=require('fs');var path=require(_0x182e('0x7'));var rimraf=require(_0x182e('0x8'));var config=require('../../config/environment');var attributes=require(_0x182e('0x9'));module[_0x182e('0xa')]=function(_0xff8683,_0x43e01f){return _0xff8683[_0x182e('0xb')](_0x182e('0xc'),attributes,{'tableName':_0x182e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 08a2e1a..deeb041 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 _0xf9ca=['request','then','info','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x49757d,_0x116db4){var _0x496daa=function(_0x4f8ea9){while(--_0x4f8ea9){_0x49757d['push'](_0x49757d['shift']());}};_0x496daa(++_0x116db4);}(_0xf9ca,0xa2));var _0xaf9c=function(_0x3d014d,_0x137e73){_0x3d014d=_0x3d014d-0x0;var _0x227e8a=_0xf9ca[_0x3d014d];return _0x227e8a;};'use strict';var _=require(_0xaf9c('0x0'));var util=require(_0xaf9c('0x1'));var moment=require('moment');var BPromise=require(_0xaf9c('0x2'));var rs=require(_0xaf9c('0x3'));var fs=require('fs');var Redis=require(_0xaf9c('0x4'));var db=require(_0xaf9c('0x5'))['db'];var utils=require(_0xaf9c('0x6'));var logger=require(_0xaf9c('0x7'))(_0xaf9c('0x8'));var config=require(_0xaf9c('0x9'));var jayson=require(_0xaf9c('0xa'));var client=jayson[_0xaf9c('0xb')][_0xaf9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x262b24,_0x29ff4b,_0x1b4f8c){return new BPromise(function(_0x2b479b,_0xdcfab6){return client[_0xaf9c('0xd')](_0x262b24,_0x1b4f8c)[_0xaf9c('0xe')](function(_0x5abb08){logger[_0xaf9c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x29ff4b,_0xaf9c('0x10'));logger[_0xaf9c('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x29ff4b,_0xaf9c('0x10'),JSON[_0xaf9c('0x12')](_0x5abb08));if(_0x5abb08[_0xaf9c('0x13')]){if(_0x5abb08[_0xaf9c('0x13')][_0xaf9c('0x14')]===0x1f4){logger['error'](_0xaf9c('0x15'),_0x29ff4b,_0x5abb08[_0xaf9c('0x13')][_0xaf9c('0x16')]);return _0xdcfab6(_0x5abb08[_0xaf9c('0x13')]['message']);}logger['error'](_0xaf9c('0x15'),_0x29ff4b,_0x5abb08['error'][_0xaf9c('0x16')]);return _0x2b479b(_0x5abb08[_0xaf9c('0x13')][_0xaf9c('0x16')]);}else{logger[_0xaf9c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x29ff4b,_0xaf9c('0x10'));_0x2b479b(_0x5abb08[_0xaf9c('0x17')][_0xaf9c('0x16')]);}})[_0xaf9c('0x18')](function(_0x3c81b4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x29ff4b,_0x3c81b4);_0xdcfab6(_0x3c81b4);});});} \ No newline at end of file +var _0xf3bc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x3fa779,_0x5ddb62){var _0x115a7a=function(_0x4acda7){while(--_0x4acda7){_0x3fa779['push'](_0x3fa779['shift']());}};_0x115a7a(++_0x5ddb62);}(_0xf3bc,0xf9));var _0xcf3b=function(_0x432ff4,_0x5ba032){_0x432ff4=_0x432ff4-0x0;var _0x43e649=_0xf3bc[_0x432ff4];return _0x43e649;};'use strict';var _=require(_0xcf3b('0x0'));var util=require('util');var moment=require(_0xcf3b('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf3b('0x2'));var fs=require('fs');var Redis=require(_0xcf3b('0x3'));var db=require(_0xcf3b('0x4'))['db'];var utils=require(_0xcf3b('0x5'));var logger=require(_0xcf3b('0x6'))(_0xcf3b('0x7'));var config=require(_0xcf3b('0x8'));var jayson=require(_0xcf3b('0x9'));var client=jayson[_0xcf3b('0xa')][_0xcf3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc565,_0x5d9240,_0x4d4fcb){return new BPromise(function(_0x4080c3,_0x13081f){return client[_0xcf3b('0xc')](_0x2cc565,_0x4d4fcb)['then'](function(_0xfd65fa){logger[_0xcf3b('0xd')](_0xcf3b('0xe'),_0x5d9240,'request\x20sent');logger['debug'](_0xcf3b('0xf'),_0x5d9240,_0xcf3b('0x10'),JSON[_0xcf3b('0x11')](_0xfd65fa));if(_0xfd65fa['error']){if(_0xfd65fa[_0xcf3b('0x12')][_0xcf3b('0x13')]===0x1f4){logger[_0xcf3b('0x12')](_0xcf3b('0xe'),_0x5d9240,_0xfd65fa[_0xcf3b('0x12')][_0xcf3b('0x14')]);return _0x13081f(_0xfd65fa[_0xcf3b('0x12')][_0xcf3b('0x14')]);}logger['error'](_0xcf3b('0xe'),_0x5d9240,_0xfd65fa[_0xcf3b('0x12')][_0xcf3b('0x14')]);return _0x4080c3(_0xfd65fa[_0xcf3b('0x12')][_0xcf3b('0x14')]);}else{logger[_0xcf3b('0xd')](_0xcf3b('0xe'),_0x5d9240,_0xcf3b('0x10'));_0x4080c3(_0xfd65fa[_0xcf3b('0x15')]['message']);}})[_0xcf3b('0x16')](function(_0xf62ac2){logger[_0xcf3b('0x12')](_0xcf3b('0xe'),_0x5d9240,_0xf62ac2);_0x13081f(_0xf62ac2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 88cad86..b54f28f 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 _0xf5d2=['destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete'];(function(_0x48b061,_0x507df5){var _0xf488e7=function(_0x52e8c2){while(--_0x52e8c2){_0x48b061['push'](_0x48b061['shift']());}};_0xf488e7(++_0x507df5);}(_0xf5d2,0x169));var _0x2f5d=function(_0x163494,_0x53f302){_0x163494=_0x163494-0x0;var _0x5e10f7=_0xf5d2[_0x163494];return _0x5e10f7;};'use strict';var multer=require(_0x2f5d('0x0'));var util=require('util');var path=require(_0x2f5d('0x1'));var timeout=require(_0x2f5d('0x2'));var express=require(_0x2f5d('0x3'));var router=express[_0x2f5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f5d('0x5'));var interaction=require(_0x2f5d('0x6'));var config=require('../../config/environment');var controller=require(_0x2f5d('0x7'));router['get']('/',auth[_0x2f5d('0x8')](),controller[_0x2f5d('0x9')]);router[_0x2f5d('0xa')]('/:id',auth[_0x2f5d('0x8')](),controller['show']);router[_0x2f5d('0xb')]('/',auth['isAuthenticated'](),controller[_0x2f5d('0xc')]);router[_0x2f5d('0xd')](_0x2f5d('0xe'),auth[_0x2f5d('0x8')](),controller[_0x2f5d('0xf')]);router[_0x2f5d('0x10')](_0x2f5d('0xe'),auth[_0x2f5d('0x8')](),controller[_0x2f5d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5b41=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util'];(function(_0x2b0ae8,_0x52c16e){var _0x5b05d0=function(_0x37076c){while(--_0x37076c){_0x2b0ae8['push'](_0x2b0ae8['shift']());}};_0x5b05d0(++_0x52c16e);}(_0x5b41,0x19e));var _0x15b4=function(_0x57546d,_0x3def56){_0x57546d=_0x57546d-0x0;var _0x22b6a3=_0x5b41[_0x57546d];return _0x22b6a3;};'use strict';var multer=require(_0x15b4('0x0'));var util=require(_0x15b4('0x1'));var path=require(_0x15b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x15b4('0x3'));var router=express[_0x15b4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x15b4('0x5'));var config=require(_0x15b4('0x6'));var controller=require('./intSalesforceField.controller');router[_0x15b4('0x7')]('/',auth[_0x15b4('0x8')](),controller[_0x15b4('0x9')]);router[_0x15b4('0x7')](_0x15b4('0xa'),auth['isAuthenticated'](),controller[_0x15b4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x15b4('0xc')]);router[_0x15b4('0xd')]('/:id',auth[_0x15b4('0x8')](),controller[_0x15b4('0xe')]);router['delete'](_0x15b4('0xa'),auth[_0x15b4('0x8')](),controller[_0x15b4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 08e501b..90b09d0 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 _0x2982=['string','variable','customVariable','picklist','STRING','exports','ENUM'];(function(_0x512e7b,_0x242308){var _0x4f2693=function(_0x40dec3){while(--_0x40dec3){_0x512e7b['push'](_0x512e7b['shift']());}};_0x4f2693(++_0x242308);}(_0x2982,0x98));var _0x2298=function(_0xc4f65c,_0x25acf5){_0xc4f65c=_0xc4f65c-0x0;var _0x5473e4=_0x2982[_0xc4f65c];return _0x5473e4;};'use strict';var Sequelize=require('sequelize');module[_0x2298('0x0')]={'type':{'type':Sequelize[_0x2298('0x1')](_0x2298('0x2'),_0x2298('0x3'),_0x2298('0x4'),'keyValue',_0x2298('0x5')),'defaultValue':_0x2298('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2298('0x6')]},'keyType':{'type':Sequelize[_0x2298('0x1')](_0x2298('0x2'),_0x2298('0x3'),_0x2298('0x4'))},'keyContent':{'type':Sequelize[_0x2298('0x6')]},'idField':{'type':Sequelize[_0x2298('0x6')]},'variableName':{'type':Sequelize[_0x2298('0x6')]}}; \ No newline at end of file +var _0x9c71=['STRING','ENUM','variable','sequelize','exports','string','customVariable','keyValue','picklist'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9c71,0xd2));var _0x19c7=function(_0x5cf550,_0x44c563){_0x5cf550=_0x5cf550-0x0;var _0x378411=_0x9c71[_0x5cf550];return _0x378411;};'use strict';var Sequelize=require(_0x19c7('0x0'));module[_0x19c7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x19c7('0x2'),'variable',_0x19c7('0x3'),_0x19c7('0x4'),_0x19c7('0x5')),'defaultValue':_0x19c7('0x2')},'content':{'type':Sequelize[_0x19c7('0x6')]},'key':{'type':Sequelize[_0x19c7('0x6')]},'keyType':{'type':Sequelize[_0x19c7('0x7')]('string',_0x19c7('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x19c7('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x19c7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6e7a461..02ed904 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 _0xa0f1=['params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','rows','show'];(function(_0x477c0c,_0x48b400){var _0x37d540=function(_0x2d95e2){while(--_0x2d95e2){_0x477c0c['push'](_0x477c0c['shift']());}};_0x37d540(++_0x48b400);}(_0xa0f1,0x1e0));var _0x1a0f=function(_0x31bc18,_0x13e195){_0x31bc18=_0x31bc18-0x0;var _0x46d54b=_0xa0f1[_0x31bc18];return _0x46d54b;};'use strict';var emlformat=require(_0x1a0f('0x0'));var rimraf=require(_0x1a0f('0x1'));var zipdir=require(_0x1a0f('0x2'));var jsonpatch=require(_0x1a0f('0x3'));var rp=require(_0x1a0f('0x4'));var moment=require(_0x1a0f('0x5'));var BPromise=require(_0x1a0f('0x6'));var Mustache=require('mustache');var util=require(_0x1a0f('0x7'));var path=require(_0x1a0f('0x8'));var sox=require(_0x1a0f('0x9'));var csv=require(_0x1a0f('0xa'));var ejs=require(_0x1a0f('0xb'));var fs=require('fs');var fs_extra=require(_0x1a0f('0xc'));var _=require(_0x1a0f('0xd'));var squel=require(_0x1a0f('0xe'));var crypto=require(_0x1a0f('0xf'));var jsforce=require(_0x1a0f('0x10'));var deskjs=require(_0x1a0f('0x11'));var toCsv=require(_0x1a0f('0xa'));var querystring=require(_0x1a0f('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a0f('0x13'));var qs=require(_0x1a0f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a0f('0x15'))(_0x1a0f('0x16'));var utils=require(_0x1a0f('0x17'));var config=require(_0x1a0f('0x18'));var licenseUtil=require(_0x1a0f('0x19'));var db=require(_0x1a0f('0x1a'))['db'];function respondWithStatusCode(_0x31a631,_0x3864c9){_0x3864c9=_0x3864c9||0xcc;return function(_0x378813){if(_0x378813){return _0x31a631[_0x1a0f('0x1b')](_0x3864c9);}return _0x31a631[_0x1a0f('0x1c')](_0x3864c9)[_0x1a0f('0x1d')]();};}function respondWithResult(_0x25dc2b,_0x4c8550){_0x4c8550=_0x4c8550||0xc8;return function(_0x250a46){if(_0x250a46){return _0x25dc2b[_0x1a0f('0x1c')](_0x4c8550)[_0x1a0f('0x1e')](_0x250a46);}};}function respondWithFilteredResult(_0x1ee8d9,_0x45b829){return function(_0x1e694f){if(_0x1e694f){var _0x5d918e=typeof _0x45b829[_0x1a0f('0x1f')]===_0x1a0f('0x20')&&typeof _0x45b829[_0x1a0f('0x21')]==='undefined';var _0x302ad5=_0x1e694f[_0x1a0f('0x22')];var _0x153ef9=_0x5d918e?0x0:_0x45b829[_0x1a0f('0x1f')];var _0x2c4a78=_0x5d918e?_0x1e694f[_0x1a0f('0x22')]:_0x45b829['offset']+_0x45b829[_0x1a0f('0x21')];var _0x114e49;if(_0x2c4a78>=_0x302ad5){_0x2c4a78=_0x302ad5;_0x114e49=0xc8;}else{_0x114e49=0xce;}_0x1ee8d9[_0x1a0f('0x1c')](_0x114e49);return _0x1ee8d9[_0x1a0f('0x23')](_0x1a0f('0x24'),_0x153ef9+'-'+_0x2c4a78+'/'+_0x302ad5)[_0x1a0f('0x1e')](_0x1e694f);}return null;};}function patchUpdates(_0x26b38a){return function(_0x5327ef){try{jsonpatch[_0x1a0f('0x25')](_0x5327ef,_0x26b38a,!![]);}catch(_0x26d9ce){return BPromise[_0x1a0f('0x26')](_0x26d9ce);}return _0x5327ef[_0x1a0f('0x27')]();};}function saveUpdates(_0x56c079,_0x553bcc){return function(_0x4a275a){if(_0x4a275a){return _0x4a275a['update'](_0x56c079)[_0x1a0f('0x28')](function(_0x493926){return _0x493926;});}return null;};}function removeEntity(_0x4c2e46,_0x54709a){return function(_0x5b8dd6){if(_0x5b8dd6){return _0x5b8dd6[_0x1a0f('0x29')]()[_0x1a0f('0x28')](function(){_0x4c2e46[_0x1a0f('0x1c')](0xcc)[_0x1a0f('0x1d')]();});}};}function handleEntityNotFound(_0x141b16,_0x2faef9){return function(_0x2b1254){if(!_0x2b1254){_0x141b16[_0x1a0f('0x1b')](0x194);}return _0x2b1254;};}function handleError(_0x2dbf6f,_0x53acac){_0x53acac=_0x53acac||0x1f4;return function(_0x53f6ed){logger[_0x1a0f('0x2a')](_0x53f6ed[_0x1a0f('0x2b')]);if(_0x53f6ed[_0x1a0f('0x2c')]){delete _0x53f6ed[_0x1a0f('0x2c')];}_0x2dbf6f['status'](_0x53acac)[_0x1a0f('0x2d')](_0x53f6ed);};}exports[_0x1a0f('0x2e')]=function(_0x6204f1,_0x131932){var _0x3ecba9={},_0x55c277={},_0x2dabd8={'count':0x0,'rows':[]};var _0x21586c=_['map'](db['SalesforceField'][_0x1a0f('0x2f')],function(_0xd96083){return{'name':_0xd96083[_0x1a0f('0x30')],'type':_0xd96083[_0x1a0f('0x31')][_0x1a0f('0x32')]};});_0x55c277['model']=_[_0x1a0f('0x33')](_0x21586c,_0x1a0f('0x2c'));_0x55c277[_0x1a0f('0x34')]=_[_0x1a0f('0x35')](_0x6204f1[_0x1a0f('0x34')]);_0x55c277['filters']=_[_0x1a0f('0x36')](_0x55c277[_0x1a0f('0x37')],_0x55c277['query']);_0x3ecba9[_0x1a0f('0x38')]=_['intersection'](_0x55c277[_0x1a0f('0x37')],qs[_0x1a0f('0x39')](_0x6204f1['query']['fields']));_0x3ecba9['attributes']=_0x3ecba9[_0x1a0f('0x38')][_0x1a0f('0x3a')]?_0x3ecba9[_0x1a0f('0x38')]:_0x55c277[_0x1a0f('0x37')];if(!_0x6204f1[_0x1a0f('0x34')][_0x1a0f('0x3b')](_0x1a0f('0x3c'))){_0x3ecba9['limit']=qs[_0x1a0f('0x21')](_0x6204f1[_0x1a0f('0x34')]['limit']);_0x3ecba9['offset']=qs['offset'](_0x6204f1[_0x1a0f('0x34')][_0x1a0f('0x1f')]);}_0x3ecba9['order']=qs[_0x1a0f('0x3d')](_0x6204f1[_0x1a0f('0x34')][_0x1a0f('0x3d')]);_0x3ecba9[_0x1a0f('0x3e')]=qs[_0x1a0f('0x3f')](_['pick'](_0x6204f1[_0x1a0f('0x34')],_0x55c277[_0x1a0f('0x3f')]),_0x21586c);if(_0x6204f1[_0x1a0f('0x34')][_0x1a0f('0x40')]){_0x3ecba9['where']=_[_0x1a0f('0x41')](_0x3ecba9[_0x1a0f('0x3e')],{'$or':_['map'](_0x21586c,function(_0x2d266d){if(_0x2d266d[_0x1a0f('0x31')]!==_0x1a0f('0x42')){var _0x40497f={};_0x40497f[_0x2d266d[_0x1a0f('0x2c')]]={'$like':'%'+_0x6204f1[_0x1a0f('0x34')]['filter']+'%'};return _0x40497f;}})});}_0x3ecba9=_[_0x1a0f('0x41')]({},_0x3ecba9,_0x6204f1[_0x1a0f('0x43')]);var _0x5d8a5b={'where':_0x3ecba9[_0x1a0f('0x3e')]};return db[_0x1a0f('0x44')]['count'](_0x5d8a5b)[_0x1a0f('0x28')](function(_0x40066b){_0x2dabd8['count']=_0x40066b;if(_0x6204f1[_0x1a0f('0x34')][_0x1a0f('0x45')]){_0x3ecba9[_0x1a0f('0x46')]=[{'all':!![]}];}return db[_0x1a0f('0x44')]['findAll'](_0x3ecba9);})[_0x1a0f('0x28')](function(_0x3f15c4){_0x2dabd8[_0x1a0f('0x47')]=_0x3f15c4;return _0x2dabd8;})[_0x1a0f('0x28')](respondWithFilteredResult(_0x131932,_0x3ecba9))['catch'](handleError(_0x131932,null));};exports[_0x1a0f('0x48')]=function(_0x381bf3,_0x1a4d40){var _0x1e9740={'raw':!![],'where':{'id':_0x381bf3[_0x1a0f('0x49')]['id']}},_0x4dfc2d={};_0x4dfc2d[_0x1a0f('0x37')]=_['keys'](db[_0x1a0f('0x44')]['rawAttributes']);_0x4dfc2d[_0x1a0f('0x34')]=_['keys'](_0x381bf3[_0x1a0f('0x34')]);_0x4dfc2d['filters']=_[_0x1a0f('0x36')](_0x4dfc2d['model'],_0x4dfc2d[_0x1a0f('0x34')]);_0x1e9740[_0x1a0f('0x38')]=_[_0x1a0f('0x36')](_0x4dfc2d[_0x1a0f('0x37')],qs[_0x1a0f('0x39')](_0x381bf3[_0x1a0f('0x34')][_0x1a0f('0x39')]));_0x1e9740['attributes']=_0x1e9740[_0x1a0f('0x38')]['length']?_0x1e9740[_0x1a0f('0x38')]:_0x4dfc2d[_0x1a0f('0x37')];if(_0x381bf3[_0x1a0f('0x34')][_0x1a0f('0x45')]){_0x1e9740[_0x1a0f('0x46')]=[{'all':!![]}];}_0x1e9740=_[_0x1a0f('0x41')]({},_0x1e9740,_0x381bf3[_0x1a0f('0x43')]);return db[_0x1a0f('0x44')][_0x1a0f('0x4a')](_0x1e9740)[_0x1a0f('0x28')](handleEntityNotFound(_0x1a4d40,null))[_0x1a0f('0x28')](respondWithResult(_0x1a4d40,null))[_0x1a0f('0x4b')](handleError(_0x1a4d40,null));};exports[_0x1a0f('0x4c')]=function(_0x282220,_0x14c6d8){return db[_0x1a0f('0x44')][_0x1a0f('0x4c')](_0x282220[_0x1a0f('0x4d')],{})[_0x1a0f('0x28')](respondWithResult(_0x14c6d8,0xc9))[_0x1a0f('0x4b')](handleError(_0x14c6d8,null));};exports[_0x1a0f('0x4e')]=function(_0x52983d,_0x35cb41){if(_0x52983d[_0x1a0f('0x4d')]['id']){delete _0x52983d[_0x1a0f('0x4d')]['id'];}return db[_0x1a0f('0x44')][_0x1a0f('0x4a')]({'where':{'id':_0x52983d[_0x1a0f('0x49')]['id']}})[_0x1a0f('0x28')](handleEntityNotFound(_0x35cb41,null))[_0x1a0f('0x28')](saveUpdates(_0x52983d[_0x1a0f('0x4d')],null))['then'](respondWithResult(_0x35cb41,null))[_0x1a0f('0x4b')](handleError(_0x35cb41,null));};exports[_0x1a0f('0x29')]=function(_0x47ad53,_0x3493a6){return db[_0x1a0f('0x44')][_0x1a0f('0x4a')]({'where':{'id':_0x47ad53[_0x1a0f('0x49')]['id']}})[_0x1a0f('0x28')](handleEntityNotFound(_0x3493a6,null))['then'](removeEntity(_0x3493a6,null))[_0x1a0f('0x4b')](handleError(_0x3493a6,null));}; \ No newline at end of file +var _0xcc5a=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x476499,_0x233a48){var _0x1311e3=function(_0x22c672){while(--_0x22c672){_0x476499['push'](_0x476499['shift']());}};_0x1311e3(++_0x233a48);}(_0xcc5a,0x92));var _0xacc5=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0xcc5a[_0x37d0bc];return _0x170e60;};'use strict';var emlformat=require(_0xacc5('0x0'));var rimraf=require(_0xacc5('0x1'));var zipdir=require(_0xacc5('0x2'));var jsonpatch=require(_0xacc5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xacc5('0x4'));var Mustache=require(_0xacc5('0x5'));var util=require(_0xacc5('0x6'));var path=require('path');var sox=require(_0xacc5('0x7'));var csv=require('to-csv');var ejs=require(_0xacc5('0x8'));var fs=require('fs');var fs_extra=require(_0xacc5('0x9'));var _=require(_0xacc5('0xa'));var squel=require(_0xacc5('0xb'));var crypto=require(_0xacc5('0xc'));var jsforce=require(_0xacc5('0xd'));var deskjs=require(_0xacc5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xacc5('0xf'));var Papa=require(_0xacc5('0x10'));var Redis=require(_0xacc5('0x11'));var authService=require(_0xacc5('0x12'));var qs=require(_0xacc5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacc5('0x14'));var logger=require(_0xacc5('0x15'))('api');var utils=require(_0xacc5('0x16'));var config=require(_0xacc5('0x17'));var licenseUtil=require(_0xacc5('0x18'));var db=require(_0xacc5('0x19'))['db'];function respondWithStatusCode(_0x50019e,_0x3e6a88){_0x3e6a88=_0x3e6a88||0xcc;return function(_0xfda569){if(_0xfda569){return _0x50019e[_0xacc5('0x1a')](_0x3e6a88);}return _0x50019e[_0xacc5('0x1b')](_0x3e6a88)[_0xacc5('0x1c')]();};}function respondWithResult(_0x2ff792,_0xf5b3ca){_0xf5b3ca=_0xf5b3ca||0xc8;return function(_0x18fe7f){if(_0x18fe7f){return _0x2ff792[_0xacc5('0x1b')](_0xf5b3ca)['json'](_0x18fe7f);}};}function respondWithFilteredResult(_0x245d75,_0x1aeeab){return function(_0x3d6dba){if(_0x3d6dba){var _0x1cd58c=typeof _0x1aeeab['offset']==='undefined'&&typeof _0x1aeeab[_0xacc5('0x1d')]===_0xacc5('0x1e');var _0x435049=_0x3d6dba[_0xacc5('0x1f')];var _0x5dfa31=_0x1cd58c?0x0:_0x1aeeab[_0xacc5('0x20')];var _0x2792e1=_0x1cd58c?_0x3d6dba[_0xacc5('0x1f')]:_0x1aeeab['offset']+_0x1aeeab['limit'];var _0x393c53;if(_0x2792e1>=_0x435049){_0x2792e1=_0x435049;_0x393c53=0xc8;}else{_0x393c53=0xce;}_0x245d75['status'](_0x393c53);return _0x245d75[_0xacc5('0x21')]('Content-Range',_0x5dfa31+'-'+_0x2792e1+'/'+_0x435049)['json'](_0x3d6dba);}return null;};}function patchUpdates(_0x50afd7){return function(_0x497f67){try{jsonpatch[_0xacc5('0x22')](_0x497f67,_0x50afd7,!![]);}catch(_0x5ef92a){return BPromise[_0xacc5('0x23')](_0x5ef92a);}return _0x497f67[_0xacc5('0x24')]();};}function saveUpdates(_0x51354c,_0x336fc5){return function(_0x2e7234){if(_0x2e7234){return _0x2e7234[_0xacc5('0x25')](_0x51354c)[_0xacc5('0x26')](function(_0x2f104d){return _0x2f104d;});}return null;};}function removeEntity(_0x5c9cab,_0x5bee70){return function(_0x19878d){if(_0x19878d){return _0x19878d[_0xacc5('0x27')]()[_0xacc5('0x26')](function(){_0x5c9cab['status'](0xcc)[_0xacc5('0x1c')]();});}};}function handleEntityNotFound(_0x5d5b19,_0x155d17){return function(_0x13c3e8){if(!_0x13c3e8){_0x5d5b19['sendStatus'](0x194);}return _0x13c3e8;};}function handleError(_0x1f9c01,_0x1fa07c){_0x1fa07c=_0x1fa07c||0x1f4;return function(_0x5a559a){logger[_0xacc5('0x28')](_0x5a559a[_0xacc5('0x29')]);if(_0x5a559a[_0xacc5('0x2a')]){delete _0x5a559a[_0xacc5('0x2a')];}_0x1f9c01[_0xacc5('0x1b')](_0x1fa07c)[_0xacc5('0x2b')](_0x5a559a);};}exports[_0xacc5('0x2c')]=function(_0x286798,_0x2489db){var _0x34bbb3={},_0x534ceb={},_0x53f29e={'count':0x0,'rows':[]};var _0x203728=_[_0xacc5('0x2d')](db[_0xacc5('0x2e')]['rawAttributes'],function(_0x197a38){return{'name':_0x197a38['fieldName'],'type':_0x197a38[_0xacc5('0x2f')][_0xacc5('0x30')]};});_0x534ceb[_0xacc5('0x31')]=_['map'](_0x203728,'name');_0x534ceb[_0xacc5('0x32')]=_[_0xacc5('0x33')](_0x286798['query']);_0x534ceb[_0xacc5('0x34')]=_[_0xacc5('0x35')](_0x534ceb['model'],_0x534ceb['query']);_0x34bbb3[_0xacc5('0x36')]=_[_0xacc5('0x35')](_0x534ceb[_0xacc5('0x31')],qs[_0xacc5('0x37')](_0x286798[_0xacc5('0x32')]['fields']));_0x34bbb3[_0xacc5('0x36')]=_0x34bbb3[_0xacc5('0x36')][_0xacc5('0x38')]?_0x34bbb3[_0xacc5('0x36')]:_0x534ceb[_0xacc5('0x31')];if(!_0x286798['query'][_0xacc5('0x39')]('nolimit')){_0x34bbb3[_0xacc5('0x1d')]=qs[_0xacc5('0x1d')](_0x286798[_0xacc5('0x32')][_0xacc5('0x1d')]);_0x34bbb3[_0xacc5('0x20')]=qs[_0xacc5('0x20')](_0x286798[_0xacc5('0x32')][_0xacc5('0x20')]);}_0x34bbb3[_0xacc5('0x3a')]=qs[_0xacc5('0x3b')](_0x286798['query'][_0xacc5('0x3b')]);_0x34bbb3[_0xacc5('0x3c')]=qs[_0xacc5('0x34')](_[_0xacc5('0x3d')](_0x286798['query'],_0x534ceb[_0xacc5('0x34')]),_0x203728);if(_0x286798[_0xacc5('0x32')][_0xacc5('0x3e')]){_0x34bbb3[_0xacc5('0x3c')]=_[_0xacc5('0x3f')](_0x34bbb3[_0xacc5('0x3c')],{'$or':_[_0xacc5('0x2d')](_0x203728,function(_0x4a515f){if(_0x4a515f[_0xacc5('0x2f')]!=='VIRTUAL'){var _0x50d7d8={};_0x50d7d8[_0x4a515f[_0xacc5('0x2a')]]={'$like':'%'+_0x286798['query']['filter']+'%'};return _0x50d7d8;}})});}_0x34bbb3=_[_0xacc5('0x3f')]({},_0x34bbb3,_0x286798['options']);var _0x448227={'where':_0x34bbb3[_0xacc5('0x3c')]};return db[_0xacc5('0x2e')][_0xacc5('0x1f')](_0x448227)[_0xacc5('0x26')](function(_0xa3e0ae){_0x53f29e[_0xacc5('0x1f')]=_0xa3e0ae;if(_0x286798[_0xacc5('0x32')][_0xacc5('0x40')]){_0x34bbb3[_0xacc5('0x41')]=[{'all':!![]}];}return db[_0xacc5('0x2e')][_0xacc5('0x42')](_0x34bbb3);})[_0xacc5('0x26')](function(_0x2db864){_0x53f29e[_0xacc5('0x43')]=_0x2db864;return _0x53f29e;})[_0xacc5('0x26')](respondWithFilteredResult(_0x2489db,_0x34bbb3))['catch'](handleError(_0x2489db,null));};exports[_0xacc5('0x44')]=function(_0x59b008,_0xb14e3e){var _0x3954ea={'raw':!![],'where':{'id':_0x59b008[_0xacc5('0x45')]['id']}},_0x4f7c05={};_0x4f7c05[_0xacc5('0x31')]=_[_0xacc5('0x33')](db[_0xacc5('0x2e')][_0xacc5('0x46')]);_0x4f7c05[_0xacc5('0x32')]=_[_0xacc5('0x33')](_0x59b008[_0xacc5('0x32')]);_0x4f7c05[_0xacc5('0x34')]=_[_0xacc5('0x35')](_0x4f7c05['model'],_0x4f7c05['query']);_0x3954ea['attributes']=_[_0xacc5('0x35')](_0x4f7c05[_0xacc5('0x31')],qs[_0xacc5('0x37')](_0x59b008[_0xacc5('0x32')][_0xacc5('0x37')]));_0x3954ea[_0xacc5('0x36')]=_0x3954ea[_0xacc5('0x36')][_0xacc5('0x38')]?_0x3954ea[_0xacc5('0x36')]:_0x4f7c05[_0xacc5('0x31')];if(_0x59b008[_0xacc5('0x32')]['includeAll']){_0x3954ea[_0xacc5('0x41')]=[{'all':!![]}];}_0x3954ea=_[_0xacc5('0x3f')]({},_0x3954ea,_0x59b008[_0xacc5('0x47')]);return db[_0xacc5('0x2e')][_0xacc5('0x48')](_0x3954ea)[_0xacc5('0x26')](handleEntityNotFound(_0xb14e3e,null))[_0xacc5('0x26')](respondWithResult(_0xb14e3e,null))['catch'](handleError(_0xb14e3e,null));};exports[_0xacc5('0x49')]=function(_0xc8727a,_0x57147a){return db[_0xacc5('0x2e')][_0xacc5('0x49')](_0xc8727a['body'],{})[_0xacc5('0x26')](respondWithResult(_0x57147a,0xc9))[_0xacc5('0x4a')](handleError(_0x57147a,null));};exports[_0xacc5('0x25')]=function(_0x548b3d,_0x5aec93){if(_0x548b3d[_0xacc5('0x4b')]['id']){delete _0x548b3d['body']['id'];}return db[_0xacc5('0x2e')][_0xacc5('0x48')]({'where':{'id':_0x548b3d[_0xacc5('0x45')]['id']}})['then'](handleEntityNotFound(_0x5aec93,null))[_0xacc5('0x26')](saveUpdates(_0x548b3d[_0xacc5('0x4b')],null))[_0xacc5('0x26')](respondWithResult(_0x5aec93,null))['catch'](handleError(_0x5aec93,null));};exports[_0xacc5('0x27')]=function(_0x38031d,_0x537be8){return db[_0xacc5('0x2e')][_0xacc5('0x48')]({'where':{'id':_0x38031d['params']['id']}})['then'](handleEntityNotFound(_0x537be8,null))[_0xacc5('0x26')](removeEntity(_0x537be8,null))[_0xacc5('0x4a')](handleError(_0x537be8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b3a7740..2c94b3e 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 _0x4b4c=['util','../../config/logger','moment','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash'];(function(_0x28af42,_0x38c3e9){var _0x2eecd2=function(_0x374d44){while(--_0x374d44){_0x28af42['push'](_0x28af42['shift']());}};_0x2eecd2(++_0x38c3e9);}(_0x4b4c,0xef));var _0xc4b4=function(_0x3b6c6d,_0x56db4f){_0x3b6c6d=_0x3b6c6d-0x0;var _0x5d4521=_0x4b4c[_0x3b6c6d];return _0x5d4521;};'use strict';var _=require(_0xc4b4('0x0'));var util=require(_0xc4b4('0x1'));var logger=require(_0xc4b4('0x2'))('api');var moment=require(_0xc4b4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b4('0x4'));var rimraf=require(_0xc4b4('0x5'));var config=require(_0xc4b4('0x6'));var attributes=require(_0xc4b4('0x7'));module['exports']=function(_0x5258fe,_0x39e2f9){return _0x5258fe[_0xc4b4('0x8')]('SalesforceField',attributes,{'tableName':_0xc4b4('0x9'),'paranoid':![],'indexes':[{'name':_0xc4b4('0xa'),'fields':['idField',_0xc4b4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8da5=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x8da5,0x129));var _0x58da=function(_0x407891,_0x40afa0){_0x407891=_0x407891-0x0;var _0x387672=_0x8da5[_0x407891];return _0x387672;};'use strict';var _=require(_0x58da('0x0'));var util=require('util');var logger=require(_0x58da('0x1'))(_0x58da('0x2'));var moment=require(_0x58da('0x3'));var BPromise=require(_0x58da('0x4'));var rp=require(_0x58da('0x5'));var fs=require('fs');var path=require(_0x58da('0x6'));var rimraf=require(_0x58da('0x7'));var config=require(_0x58da('0x8'));var attributes=require(_0x58da('0x9'));module[_0x58da('0xa')]=function(_0x5f3be9,_0x1acad1){return _0x5f3be9[_0x58da('0xb')](_0x58da('0xc'),attributes,{'tableName':_0x58da('0xd'),'paranoid':![],'indexes':[{'name':_0x58da('0xe'),'fields':[_0x58da('0xf'),_0x58da('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index c39619c..7df8abb 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 _0xf415=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x37eb04,_0x2d568d){var _0x2df232=function(_0x33d5e3){while(--_0x33d5e3){_0x37eb04['push'](_0x37eb04['shift']());}};_0x2df232(++_0x2d568d);}(_0xf415,0x15b));var _0x5f41=function(_0x2af02a,_0x50717c){_0x2af02a=_0x2af02a-0x0;var _0x461055=_0xf415[_0x2af02a];return _0x461055;};'use strict';var _=require(_0x5f41('0x0'));var util=require('util');var moment=require(_0x5f41('0x1'));var BPromise=require(_0x5f41('0x2'));var rs=require(_0x5f41('0x3'));var fs=require('fs');var Redis=require(_0x5f41('0x4'));var db=require(_0x5f41('0x5'))['db'];var utils=require(_0x5f41('0x6'));var logger=require(_0x5f41('0x7'))(_0x5f41('0x8'));var config=require(_0x5f41('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5f41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16910f,_0xbcedb1,_0xfded34){return new BPromise(function(_0x596886,_0x28cd90){return client[_0x5f41('0xb')](_0x16910f,_0xfded34)[_0x5f41('0xc')](function(_0x18a49e){logger[_0x5f41('0xd')](_0x5f41('0xe'),_0xbcedb1,_0x5f41('0xf'));logger[_0x5f41('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xbcedb1,_0x5f41('0xf'),JSON[_0x5f41('0x11')](_0x18a49e));if(_0x18a49e[_0x5f41('0x12')]){if(_0x18a49e['error'][_0x5f41('0x13')]===0x1f4){logger['error'](_0x5f41('0xe'),_0xbcedb1,_0x18a49e[_0x5f41('0x12')]['message']);return _0x28cd90(_0x18a49e[_0x5f41('0x12')][_0x5f41('0x14')]);}logger[_0x5f41('0x12')](_0x5f41('0xe'),_0xbcedb1,_0x18a49e[_0x5f41('0x12')][_0x5f41('0x14')]);return _0x596886(_0x18a49e[_0x5f41('0x12')]['message']);}else{logger[_0x5f41('0xd')](_0x5f41('0xe'),_0xbcedb1,'request\x20sent');_0x596886(_0x18a49e['result'][_0x5f41('0x14')]);}})[_0x5f41('0x15')](function(_0x216232){logger[_0x5f41('0x12')](_0x5f41('0xe'),_0xbcedb1,_0x216232);_0x28cd90(_0x216232);});});} \ No newline at end of file +var _0xac22=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','debug'];(function(_0x219550,_0x1a3481){var _0x32b10d=function(_0x2c97bd){while(--_0x2c97bd){_0x219550['push'](_0x219550['shift']());}};_0x32b10d(++_0x1a3481);}(_0xac22,0x156));var _0x2ac2=function(_0xac36f5,_0x48df2a){_0xac36f5=_0xac36f5-0x0;var _0x4ecfa1=_0xac22[_0xac36f5];return _0x4ecfa1;};'use strict';var _=require(_0x2ac2('0x0'));var util=require(_0x2ac2('0x1'));var moment=require(_0x2ac2('0x2'));var BPromise=require(_0x2ac2('0x3'));var rs=require(_0x2ac2('0x4'));var fs=require('fs');var Redis=require(_0x2ac2('0x5'));var db=require(_0x2ac2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ac2('0x7'))('rpc');var config=require(_0x2ac2('0x8'));var jayson=require(_0x2ac2('0x9'));var client=jayson[_0x2ac2('0xa')][_0x2ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36225b,_0x4dc971,_0x2309ea){return new BPromise(function(_0x90b5cd,_0x4e6ce5){return client['request'](_0x36225b,_0x2309ea)['then'](function(_0x4534a1){logger[_0x2ac2('0xc')](_0x2ac2('0xd'),_0x4dc971,'request\x20sent');logger[_0x2ac2('0xe')](_0x2ac2('0xf'),_0x4dc971,_0x2ac2('0x10'),JSON[_0x2ac2('0x11')](_0x4534a1));if(_0x4534a1['error']){if(_0x4534a1[_0x2ac2('0x12')]['code']===0x1f4){logger['error'](_0x2ac2('0xd'),_0x4dc971,_0x4534a1[_0x2ac2('0x12')][_0x2ac2('0x13')]);return _0x4e6ce5(_0x4534a1['error']['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x4dc971,_0x4534a1[_0x2ac2('0x12')][_0x2ac2('0x13')]);return _0x90b5cd(_0x4534a1[_0x2ac2('0x12')][_0x2ac2('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x4dc971,_0x2ac2('0x10'));_0x90b5cd(_0x4534a1[_0x2ac2('0x14')][_0x2ac2('0x13')]);}})['catch'](function(_0x402c3d){logger[_0x2ac2('0x12')](_0x2ac2('0xd'),_0x4dc971,_0x402c3d);_0x4e6ce5(_0x402c3d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 78baf7d..3c81254 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 _0x2f68=['create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x3a740e,_0x1e059c){var _0x483f44=function(_0x2c9c8a){while(--_0x2c9c8a){_0x3a740e['push'](_0x3a740e['shift']());}};_0x483f44(++_0x1e059c);}(_0x2f68,0x9a));var _0x82f6=function(_0x42926f,_0x258f9b){_0x42926f=_0x42926f-0x0;var _0x40897d=_0x2f68[_0x42926f];return _0x40897d;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['getConfigurations']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),controller[_0x82f6('0xe')]);router[_0x82f6('0xd')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0x8')](),controller[_0x82f6('0x11')]);router[_0x82f6('0x12')](_0x82f6('0x9'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x13')]);module[_0x82f6('0x14')]=router; \ No newline at end of file +var _0xd45b=['show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x112cba,_0x2131fa){var _0x1ab284=function(_0x348b4b){while(--_0x348b4b){_0x112cba['push'](_0x112cba['shift']());}};_0x1ab284(++_0x2131fa);}(_0xd45b,0x11f));var _0xbd45=function(_0x20c29f,_0x5d4801){_0x20c29f=_0x20c29f-0x0;var _0x302b4a=_0xd45b[_0x20c29f];return _0x302b4a;};'use strict';var multer=require(_0xbd45('0x0'));var util=require(_0xbd45('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbd45('0x2'));var router=express[_0xbd45('0x3')]();var fs_extra=require(_0xbd45('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbd45('0x5'));var config=require(_0xbd45('0x6'));var controller=require(_0xbd45('0x7'));router[_0xbd45('0x8')]('/',auth[_0xbd45('0x9')](),controller[_0xbd45('0xa')]);router[_0xbd45('0x8')](_0xbd45('0xb'),auth['isAuthenticated'](),controller[_0xbd45('0xc')]);router[_0xbd45('0x8')](_0xbd45('0xd'),auth[_0xbd45('0x9')](),controller['getConfigurations']);router[_0xbd45('0x8')](_0xbd45('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xbd45('0xf')]('/',auth[_0xbd45('0x9')](),controller[_0xbd45('0x10')]);router[_0xbd45('0xf')](_0xbd45('0xd'),auth[_0xbd45('0x9')](),controller[_0xbd45('0x11')]);router[_0xbd45('0x12')]('/:id',auth[_0xbd45('0x9')](),controller[_0xbd45('0x13')]);router[_0xbd45('0x14')]('/:id',auth[_0xbd45('0x9')](),controller[_0xbd45('0x15')]);module[_0xbd45('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 08ef44f..188b445 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 _0xf55a=['exports','STRING','username','sequelize'];(function(_0x5e848d,_0x1dbd20){var _0x3785e5=function(_0xc82b39){while(--_0xc82b39){_0x5e848d['push'](_0x5e848d['shift']());}};_0x3785e5(++_0x1dbd20);}(_0xf55a,0xe3));var _0xaf55=function(_0x461e7d,_0x354b87){_0x461e7d=_0x461e7d-0x0;var _0x48c148=_0xf55a[_0x461e7d];return _0x48c148;};'use strict';var Sequelize=require(_0xaf55('0x0'));module[_0xaf55('0x1')]={'name':{'type':Sequelize[_0xaf55('0x2')]},'description':{'type':Sequelize[_0xaf55('0x2')]},'username':{'type':Sequelize[_0xaf55('0x2')],'unique':_0xaf55('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xaf55('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xaf55('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x308d=['sequelize','exports','STRING','username'];(function(_0x15ef74,_0x1a57a0){var _0x6ae279=function(_0x440acd){while(--_0x440acd){_0x15ef74['push'](_0x15ef74['shift']());}};_0x6ae279(++_0x1a57a0);}(_0x308d,0x1cc));var _0xd308=function(_0x3c0007,_0x55170c){_0x3c0007=_0x3c0007-0x0;var _0x4404b0=_0x308d[_0x3c0007];return _0x4404b0;};'use strict';var Sequelize=require(_0xd308('0x0'));module[_0xd308('0x1')]={'name':{'type':Sequelize[_0xd308('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd308('0x2')],'unique':_0xd308('0x3')},'password':{'type':Sequelize[_0xd308('0x2')]},'email':{'type':Sequelize[_0xd308('0x2')]},'remoteUri':{'type':Sequelize[_0xd308('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index e97722d..376fb34 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 _0x4a84=['parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','calendar_stc','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','log','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','inactive','false','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','error','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','catch','show','params','create','body','find','destroy','getConfigurations','ServicenowConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category'];(function(_0x3a80b6,_0x5109a8){var _0x401469=function(_0x4524b5){while(--_0x4524b5){_0x3a80b6['push'](_0x3a80b6['shift']());}};_0x401469(++_0x5109a8);}(_0x4a84,0x1d8));var _0x44a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4a84[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44a8('0x0'));var zipdir=require(_0x44a8('0x1'));var jsonpatch=require(_0x44a8('0x2'));var rp=require(_0x44a8('0x3'));var moment=require(_0x44a8('0x4'));var BPromise=require(_0x44a8('0x5'));var Mustache=require(_0x44a8('0x6'));var util=require(_0x44a8('0x7'));var path=require(_0x44a8('0x8'));var sox=require(_0x44a8('0x9'));var csv=require(_0x44a8('0xa'));var ejs=require(_0x44a8('0xb'));var fs=require('fs');var fs_extra=require(_0x44a8('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x44a8('0xd'));var jsforce=require(_0x44a8('0xe'));var deskjs=require(_0x44a8('0xf'));var toCsv=require(_0x44a8('0xa'));var querystring=require(_0x44a8('0x10'));var Papa=require(_0x44a8('0x11'));var Redis=require(_0x44a8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x44a8('0x13'));var as=require(_0x44a8('0x14'));var hardwareService=require(_0x44a8('0x15'));var logger=require(_0x44a8('0x16'))(_0x44a8('0x17'));var utils=require(_0x44a8('0x18'));var config=require(_0x44a8('0x19'));var licenseUtil=require(_0x44a8('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x28c33f,_0x464662){_0x464662=_0x464662||0xcc;return function(_0x20d569){if(_0x20d569){return _0x28c33f[_0x44a8('0x1b')](_0x464662);}return _0x28c33f[_0x44a8('0x1c')](_0x464662)[_0x44a8('0x1d')]();};}function respondWithResult(_0x48307e,_0x45bdcd){_0x45bdcd=_0x45bdcd||0xc8;return function(_0x10e7b1){if(_0x10e7b1){return _0x48307e[_0x44a8('0x1c')](_0x45bdcd)[_0x44a8('0x1e')](_0x10e7b1);}};}function respondWithFilteredResult(_0x1594a3,_0x2f33c9){return function(_0x4ac1f4){if(_0x4ac1f4){var _0x3b1e32=typeof _0x2f33c9[_0x44a8('0x1f')]===_0x44a8('0x20')&&typeof _0x2f33c9[_0x44a8('0x21')]==='undefined';var _0x473cd0=_0x4ac1f4[_0x44a8('0x22')];var _0x7153e3=_0x3b1e32?0x0:_0x2f33c9['offset'];var _0x33f2b4=_0x3b1e32?_0x4ac1f4[_0x44a8('0x22')]:_0x2f33c9['offset']+_0x2f33c9[_0x44a8('0x21')];var _0x48a89a;if(_0x33f2b4>=_0x473cd0){_0x33f2b4=_0x473cd0;_0x48a89a=0xc8;}else{_0x48a89a=0xce;}_0x1594a3['status'](_0x48a89a);return _0x1594a3['set']('Content-Range',_0x7153e3+'-'+_0x33f2b4+'/'+_0x473cd0)[_0x44a8('0x1e')](_0x4ac1f4);}return null;};}function patchUpdates(_0x11b16d){return function(_0x26b98a){try{jsonpatch['apply'](_0x26b98a,_0x11b16d,!![]);}catch(_0x350cd1){return BPromise[_0x44a8('0x23')](_0x350cd1);}return _0x26b98a['save']();};}function saveUpdates(_0x4358a3,_0x91ca0f){return function(_0x3f7234){if(_0x3f7234){return _0x3f7234[_0x44a8('0x24')](_0x4358a3)[_0x44a8('0x25')](function(_0x38aee8){return _0x38aee8;});}return null;};}function removeEntity(_0x103407,_0x31bc2c){return function(_0x5ec743){if(_0x5ec743){return _0x5ec743['destroy']()[_0x44a8('0x25')](function(){_0x103407[_0x44a8('0x1c')](0xcc)[_0x44a8('0x1d')]();});}};}function handleEntityNotFound(_0x5d37be,_0x26a2c1){return function(_0x47fb05){if(!_0x47fb05){_0x5d37be[_0x44a8('0x1b')](0x194);}return _0x47fb05;};}function handleError(_0x38fe54,_0x3798ef){_0x3798ef=_0x3798ef||0x1f4;return function(_0x336d73){logger[_0x44a8('0x26')](_0x336d73['stack']);if(_0x336d73[_0x44a8('0x27')]){delete _0x336d73['name'];}_0x38fe54[_0x44a8('0x1c')](_0x3798ef)[_0x44a8('0x28')](_0x336d73);};}exports[_0x44a8('0x29')]=function(_0x268b92,_0x7ae58d){var _0x458e50={},_0x42d655={},_0x1af1ae={'count':0x0,'rows':[]};var _0x11db86=_['map'](db['ServicenowAccount'][_0x44a8('0x2a')],function(_0x3e4067){return{'name':_0x3e4067['fieldName'],'type':_0x3e4067[_0x44a8('0x2b')][_0x44a8('0x2c')]};});_0x42d655['model']=_[_0x44a8('0x2d')](_0x11db86,'name');_0x42d655[_0x44a8('0x2e')]=_[_0x44a8('0x2f')](_0x268b92[_0x44a8('0x2e')]);_0x42d655[_0x44a8('0x30')]=_[_0x44a8('0x31')](_0x42d655['model'],_0x42d655[_0x44a8('0x2e')]);_0x458e50[_0x44a8('0x32')]=_[_0x44a8('0x31')](_0x42d655[_0x44a8('0x33')],qs[_0x44a8('0x34')](_0x268b92['query'][_0x44a8('0x34')]));_0x458e50[_0x44a8('0x32')]=_0x458e50[_0x44a8('0x32')][_0x44a8('0x35')]?_0x458e50['attributes']:_0x42d655[_0x44a8('0x33')];if(!_0x268b92[_0x44a8('0x2e')][_0x44a8('0x36')](_0x44a8('0x37'))){_0x458e50['limit']=qs[_0x44a8('0x21')](_0x268b92[_0x44a8('0x2e')][_0x44a8('0x21')]);_0x458e50['offset']=qs[_0x44a8('0x1f')](_0x268b92[_0x44a8('0x2e')]['offset']);}_0x458e50['order']=qs[_0x44a8('0x38')](_0x268b92['query']['sort']);_0x458e50['where']=qs['filters'](_[_0x44a8('0x39')](_0x268b92[_0x44a8('0x2e')],_0x42d655[_0x44a8('0x30')]),_0x11db86);if(_0x268b92[_0x44a8('0x2e')][_0x44a8('0x3a')]){_0x458e50[_0x44a8('0x3b')]=_[_0x44a8('0x3c')](_0x458e50['where'],{'$or':_[_0x44a8('0x2d')](_0x11db86,function(_0x5e3bff){if(_0x5e3bff[_0x44a8('0x2b')]!==_0x44a8('0x3d')){var _0x3b4851={};_0x3b4851[_0x5e3bff[_0x44a8('0x27')]]={'$like':'%'+_0x268b92['query'][_0x44a8('0x3a')]+'%'};return _0x3b4851;}})});}_0x458e50=_[_0x44a8('0x3c')]({},_0x458e50,_0x268b92[_0x44a8('0x3e')]);var _0x38800e={'where':_0x458e50[_0x44a8('0x3b')]};return db[_0x44a8('0x3f')][_0x44a8('0x22')](_0x38800e)['then'](function(_0x4c8a2b){_0x1af1ae[_0x44a8('0x22')]=_0x4c8a2b;if(_0x268b92['query'][_0x44a8('0x40')]){_0x458e50[_0x44a8('0x41')]=[{'all':!![]}];}return db[_0x44a8('0x3f')][_0x44a8('0x42')](_0x458e50);})['then'](function(_0x415c69){_0x1af1ae['rows']=_0x415c69;return _0x1af1ae;})[_0x44a8('0x25')](respondWithFilteredResult(_0x7ae58d,_0x458e50))[_0x44a8('0x43')](handleError(_0x7ae58d,null));};exports[_0x44a8('0x44')]=function(_0x149e19,_0x5684b1){var _0x42edd7={'raw':![],'where':{'id':_0x149e19[_0x44a8('0x45')]['id']}},_0x304d83={};_0x304d83[_0x44a8('0x33')]=_['keys'](db[_0x44a8('0x3f')][_0x44a8('0x2a')]);_0x304d83['query']=_[_0x44a8('0x2f')](_0x149e19[_0x44a8('0x2e')]);_0x304d83[_0x44a8('0x30')]=_[_0x44a8('0x31')](_0x304d83[_0x44a8('0x33')],_0x304d83[_0x44a8('0x2e')]);_0x42edd7[_0x44a8('0x32')]=_['intersection'](_0x304d83[_0x44a8('0x33')],qs['fields'](_0x149e19['query'][_0x44a8('0x34')]));_0x42edd7[_0x44a8('0x32')]=_0x42edd7[_0x44a8('0x32')][_0x44a8('0x35')]?_0x42edd7[_0x44a8('0x32')]:_0x304d83[_0x44a8('0x33')];if(_0x149e19[_0x44a8('0x2e')][_0x44a8('0x40')]){_0x42edd7[_0x44a8('0x41')]=[{'all':!![]}];}_0x42edd7=_[_0x44a8('0x3c')]({},_0x42edd7,_0x149e19[_0x44a8('0x3e')]);return db[_0x44a8('0x3f')]['find'](_0x42edd7)[_0x44a8('0x25')](handleEntityNotFound(_0x5684b1,null))[_0x44a8('0x25')](respondWithResult(_0x5684b1,null))[_0x44a8('0x43')](handleError(_0x5684b1,null));};exports[_0x44a8('0x46')]=function(_0x5e9aee,_0xaff9ba){return db['ServicenowAccount'][_0x44a8('0x46')](_0x5e9aee[_0x44a8('0x47')],{})[_0x44a8('0x25')](respondWithResult(_0xaff9ba,0xc9))['catch'](handleError(_0xaff9ba,null));};exports[_0x44a8('0x24')]=function(_0x4ee853,_0x3ed331){if(_0x4ee853[_0x44a8('0x47')]['id']){delete _0x4ee853[_0x44a8('0x47')]['id'];}return db[_0x44a8('0x3f')][_0x44a8('0x48')]({'where':{'id':_0x4ee853[_0x44a8('0x45')]['id']}})[_0x44a8('0x25')](handleEntityNotFound(_0x3ed331,null))[_0x44a8('0x25')](saveUpdates(_0x4ee853[_0x44a8('0x47')],null))['then'](respondWithResult(_0x3ed331,null))['catch'](handleError(_0x3ed331,null));};exports[_0x44a8('0x49')]=function(_0x2c757a,_0x2a1c94){return db['ServicenowAccount'][_0x44a8('0x48')]({'where':{'id':_0x2c757a[_0x44a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a1c94,null))[_0x44a8('0x25')](removeEntity(_0x2a1c94,null))['catch'](handleError(_0x2a1c94,null));};exports[_0x44a8('0x4a')]=function(_0x3256d4,_0x4e6c8e,_0x2320a3){var _0x3aa65d={};var _0x54e836={};var _0x4e5124;var _0xad8977;return db[_0x44a8('0x3f')]['findOne']({'where':{'id':_0x3256d4[_0x44a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e6c8e,null))[_0x44a8('0x25')](function(_0x8befea){if(_0x8befea){_0x4e5124=_0x8befea;_0x54e836['model']=_['keys'](db[_0x44a8('0x4b')][_0x44a8('0x2a')]);_0x54e836[_0x44a8('0x2e')]=_[_0x44a8('0x2f')](_0x3256d4[_0x44a8('0x2e')]);_0x54e836[_0x44a8('0x30')]=_['intersection'](_0x54e836[_0x44a8('0x33')],_0x54e836[_0x44a8('0x2e')]);_0x3aa65d[_0x44a8('0x32')]=_[_0x44a8('0x31')](_0x54e836[_0x44a8('0x33')],qs[_0x44a8('0x34')](_0x3256d4['query'][_0x44a8('0x34')]));_0x3aa65d[_0x44a8('0x32')]=_0x3aa65d['attributes']['length']?_0x3aa65d[_0x44a8('0x32')]:_0x54e836[_0x44a8('0x33')];_0x3aa65d[_0x44a8('0x4c')]=qs[_0x44a8('0x38')](_0x3256d4[_0x44a8('0x2e')][_0x44a8('0x38')]);_0x3aa65d['where']=qs[_0x44a8('0x30')](_[_0x44a8('0x39')](_0x3256d4[_0x44a8('0x2e')],_0x54e836[_0x44a8('0x30')]));if(_0x3256d4[_0x44a8('0x2e')]['filter']){_0x3aa65d['where']=_[_0x44a8('0x3c')](_0x3aa65d[_0x44a8('0x3b')],{'$or':_[_0x44a8('0x2d')](_0x3aa65d[_0x44a8('0x32')],function(_0x3d83ea){var _0x3b3208={};_0x3b3208[_0x3d83ea]={'$like':'%'+_0x3256d4[_0x44a8('0x2e')][_0x44a8('0x3a')]+'%'};return _0x3b3208;})});}_0x3aa65d=_[_0x44a8('0x3c')]({},_0x3aa65d,_0x3256d4[_0x44a8('0x3e')]);return _0x4e5124[_0x44a8('0x4a')](_0x3aa65d);}})[_0x44a8('0x25')](function(_0x1076d9){if(_0x1076d9){_0xad8977=_0x1076d9['length'];if(!_0x3256d4[_0x44a8('0x2e')][_0x44a8('0x36')](_0x44a8('0x37'))){_0x3aa65d[_0x44a8('0x21')]=qs[_0x44a8('0x21')](_0x3256d4[_0x44a8('0x2e')][_0x44a8('0x21')]);_0x3aa65d[_0x44a8('0x1f')]=qs[_0x44a8('0x1f')](_0x3256d4['query'][_0x44a8('0x1f')]);}return _0x4e5124[_0x44a8('0x4a')](_0x3aa65d);}})[_0x44a8('0x25')](function(_0x30adc6){if(_0x30adc6){return _0x30adc6?{'count':_0xad8977,'rows':_0x30adc6}:null;}})[_0x44a8('0x25')](respondWithResult(_0x4e6c8e,null))[_0x44a8('0x43')](handleError(_0x4e6c8e,null));};exports[_0x44a8('0x4d')]=function(_0x100a0d,_0x26309f,_0x137586){if(_0x100a0d[_0x44a8('0x47')]['id']){delete _0x100a0d[_0x44a8('0x47')]['id'];}return db[_0x44a8('0x3f')][_0x44a8('0x4e')]({'where':{'id':_0x100a0d[_0x44a8('0x45')]['id']}})[_0x44a8('0x25')](handleEntityNotFound(_0x26309f,null))[_0x44a8('0x25')](function(_0x6ac459){if(_0x6ac459){_0x100a0d[_0x44a8('0x47')][_0x44a8('0x4f')]=_0x6ac459['id'];_0x100a0d[_0x44a8('0x47')][_0x44a8('0x50')]=integrations[_0x44a8('0x51')](_0x100a0d[_0x44a8('0x47')][_0x44a8('0x52')],_0x100a0d[_0x44a8('0x47')]['type']);_0x100a0d['body'][_0x44a8('0x53')]=integrations[_0x44a8('0x54')](_0x100a0d['body'][_0x44a8('0x52')],_0x100a0d[_0x44a8('0x47')]['type']);return db[_0x44a8('0x4b')][_0x44a8('0x46')](_0x100a0d['body'],{'include':[{'model':db[_0x44a8('0x55')],'as':_0x44a8('0x50')},{'model':db[_0x44a8('0x55')],'as':_0x44a8('0x53')}]});}return null;})[_0x44a8('0x25')](respondWithResult(_0x26309f,null))[_0x44a8('0x43')](handleError(_0x26309f,null));};exports[_0x44a8('0x56')]=function(_0x301e5a,_0x18e77f,_0x128abf){var _0x3efc2a=[_0x44a8('0x57'),_0x44a8('0x58'),_0x44a8('0x59'),_0x44a8('0x5a'),_0x44a8('0x5b'),_0x44a8('0x5c'),_0x44a8('0x5d'),'severity',_0x44a8('0x5e')];var _0xc54668=[_0x44a8('0x5f'),'made_sla',_0x44a8('0x60'),'watch_list',_0x44a8('0x61'),_0x44a8('0x62'),_0x44a8('0x63'),'hold_reason',_0x44a8('0x64'),_0x44a8('0x65'),_0x44a8('0x66'),_0x44a8('0x67'),_0x44a8('0x68'),_0x44a8('0x69'),_0x44a8('0x6a'),_0x44a8('0x6b'),'state','sys_created_by','knowledge',_0x44a8('0x4c'),_0x44a8('0x6c'),'closed_at',_0x44a8('0x6d'),_0x44a8('0x6e'),_0x44a8('0x6f'),_0x44a8('0x70'),'work_notes_list',_0x44a8('0x71'),_0x44a8('0x72'),_0x44a8('0x73'),_0x44a8('0x74'),_0x44a8('0x75'),'expected_start',_0x44a8('0x76'),_0x44a8('0x77'),_0x44a8('0x78'),'work_end','reopened_time',_0x44a8('0x79'),_0x44a8('0x7a'),_0x44a8('0x7b'),_0x44a8('0x5a'),_0x44a8('0x7c'),'short_description',_0x44a8('0x5b'),_0x44a8('0x7d'),_0x44a8('0x7e'),_0x44a8('0x7f'),_0x44a8('0x80'),_0x44a8('0x81'),'additional_assignee_list',_0x44a8('0x82'),'calendar_duration',_0x44a8('0x5c'),_0x44a8('0x83'),_0x44a8('0x84'),_0x44a8('0x85'),_0x44a8('0x86'),_0x44a8('0x87'),_0x44a8('0x88'),'contact_type',_0x44a8('0x89'),_0x44a8('0x5d'),_0x44a8('0x8a'),_0x44a8('0x8b'),_0x44a8('0x8c'),_0x44a8('0x8d'),_0x44a8('0x8e'),_0x44a8('0x8f'),_0x44a8('0x90'),_0x44a8('0x91'),'sla_due',_0x44a8('0x92'),_0x44a8('0x93'),_0x44a8('0x94'),_0x44a8('0x95'),_0x44a8('0x96'),_0x44a8('0x97'),_0x44a8('0x98'),'upon_approval',_0x44a8('0x99'),_0x44a8('0x9a'),_0x44a8('0x5e')];var _0x42379e='';var _0x10e4dd='';var _0xbbbcc6=[];var _0x12ec37='';var _0x4e3325='';var _0x3dd608=[];var _0x1bce46='';var _0x57f738='';var _0x2cdd11={};var _0x3cc6a0='';return db[_0x44a8('0x3f')][_0x44a8('0x4e')]({'where':{'id':_0x301e5a[_0x44a8('0x45')]['id']},'attributes':['id',_0x44a8('0x9b'),_0x44a8('0x9c'),_0x44a8('0x9d'),'remoteUri','serverUrl']})[_0x44a8('0x25')](handleEntityNotFound(_0x18e77f,null))[_0x44a8('0x25')](function(_0x1601c8){if(_0x1601c8){_0x3cc6a0=_0x1601c8['remoteUri'];var _0x1b1cfc=_0x3cc6a0[_0x44a8('0x9e')](-0x1);if(_0x1b1cfc==='/'){_0x3cc6a0=_0x3cc6a0[_0x44a8('0x9f')](0x0,_0x3cc6a0[_0x44a8('0xa0')](_0x1b1cfc));}_0x57f738=util[_0x44a8('0xa1')](_0x44a8('0xa2'),_0x3cc6a0);_0x1bce46=util[_0x44a8('0xa1')](_0x44a8('0xa3'),_0x3cc6a0);_0x2cdd11={'user':_0x1601c8[_0x44a8('0x9b')],'pass':_0x1601c8[_0x44a8('0x9c')]};var _0xe74f52={'method':_0x44a8('0xa4'),'uri':_0x57f738+_0x44a8('0xa5'),'auth':_0x2cdd11,'json':!![]};return rp(_0xe74f52);}})['then'](function(_0x720ebc){if(_0x720ebc[_0x44a8('0xa6')][_0x44a8('0x35')]>0x0){_0x42379e=_0x720ebc[_0x44a8('0xa6')];}console['log'](_0x44a8('0xa7'),_0x42379e);_0x3dd608=[];_0x10e4dd=Object['assign']([],_0x42379e);_[_0x44a8('0xa8')](_0x10e4dd,function(_0x3d75d9){return!_0x3efc2a[_0x44a8('0xa9')](_0x3d75d9['name']);});_0x10e4dd[_0x44a8('0xaa')](function(_0x4d7fbc){var _0x48d339=createFieldObject(_0x1bce46,_0x2cdd11,_0x4d7fbc[_0x44a8('0xab')],_0x4d7fbc[_0x44a8('0x27')],_0x4d7fbc[_0x44a8('0xac')],![]);_0x3dd608[_0x44a8('0xad')](_0x48d339);});return Promise[_0x44a8('0xae')](_0x3dd608);})[_0x44a8('0x25')](function(_0x3fed65){_0xbbbcc6=_0x3fed65;_0x12ec37=Object['assign']([],_0x42379e);console['log'](_0x44a8('0xaf'),_0x42379e);_[_0x44a8('0xa8')](_0x12ec37,function(_0x316aeb){return _0xc54668[_0x44a8('0xa9')](_0x316aeb['name']);});console['log'](_0x44a8('0xb0'),_0x12ec37);_0x3dd608=[];_0x12ec37['forEach'](function(_0x7058d4){var _0x4c19b9=createFieldObject(_0x1bce46,_0x2cdd11,_0x7058d4[_0x44a8('0xab')],_0x7058d4['name'],_0x7058d4['label'],!![]);_0x3dd608[_0x44a8('0xad')](_0x4c19b9);});return Promise[_0x44a8('0xae')](_0x3dd608);})[_0x44a8('0x25')](function(_0x44ecc0){_0x4e3325=_0x44ecc0;var _0x1fa2c3=_0xbbbcc6[_0x44a8('0xb1')](_0x4e3325);return{'count':_0x1fa2c3[_0x44a8('0x35')],'rows':_0x1fa2c3};})[_0x44a8('0x25')](respondWithResult(_0x18e77f,null))[_0x44a8('0x43')](function(_0x2ede0b){console[_0x44a8('0xb2')](_0x44a8('0xb3')+_0x2ede0b);var _0x533ee6=_0x301e5a['query'][_0x44a8('0xb4')]?0x1f4:_0x2ede0b['statusCode']||0x1f4;logger[_0x44a8('0x26')](_0x2ede0b['stack']);delete _0x2ede0b[_0x44a8('0x27')];if(_0x533ee6===0x191){_0x533ee6=0x190;}_0x18e77f['status'](_0x533ee6)[_0x44a8('0x28')](_0x301e5a[_0x44a8('0x2e')]['test']?{'message':_0x44a8('0xb5'),'statusCode':_0x2ede0b[_0x44a8('0xb6')]}:_0x2ede0b);});};function createFieldObject(_0x2ad972,_0x101075,_0x3ce4fe,_0x2ab129,_0x2cd9f7,_0x36dcd0){return new Promise(function(_0x5d8c5e,_0x3662d2){var _0x5a0469={'id':_0x2ab129,'name':_0x2cd9f7,'custom':_0x36dcd0};if(_0x3ce4fe===_0x44a8('0xb7')){_0x5a0469['options']=[{'name':_0x44a8('0xb8'),'value':_0x44a8('0xb9')},{'name':'False','value':'false'}];_0x5d8c5e(_0x5a0469);}else{var _0x586d8c={'method':'GET','uri':_0x2ad972+'sys_choice?sysparm_query=name=incident^element='+_0x2ab129,'auth':_0x101075,'json':!![]};return rp(_0x586d8c)['then'](function(_0x32344c){var _0x457c19=[];if(_0x32344c['result']['length']>0x0){_0x32344c['result'][_0x44a8('0xaa')](function(_0x24c0e){if(_0x24c0e[_0x44a8('0xba')]===_0x44a8('0xbb')){var _0x348fba={'name':_0x24c0e[_0x44a8('0xac')],'value':_0x24c0e[_0x44a8('0xbc')]};_0x457c19[_0x44a8('0xad')](_0x348fba);}});}_0x5a0469[_0x44a8('0x3e')]=_0x457c19;if(_0x5a0469[_0x44a8('0x3e')][_0x44a8('0x35')]>0x0){_0x5d8c5e(_0x5a0469);}else{if(_0x36dcd0==![]){_0x5d8c5e();}else{_0x5d8c5e(_0x5a0469);}}});}});} \ No newline at end of file +var _0x7bf5=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','catch','params','options','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','close_code','notify','incident_state','severity','category','made_sla','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','user_input','sys_domain','state','knowledge','closed_at','cmdb_ci','impact','active','business_service','priority','rfc','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','closed_by','parent_incident','sys_id','reopened_by','urgency','problem_id','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','statusCode','send','test','boolean','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','apply','reject','save','update','destroy','error','stack','name','index','map','ServicenowAccount','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x7bf5,0x82));var _0x57bf=function(_0x4539af,_0xff049f){_0x4539af=_0x4539af-0x0;var _0x5e1d3e=_0x7bf5[_0x4539af];return _0x5e1d3e;};'use strict';var emlformat=require(_0x57bf('0x0'));var rimraf=require(_0x57bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x57bf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x57bf('0x3'));var util=require(_0x57bf('0x4'));var path=require(_0x57bf('0x5'));var sox=require(_0x57bf('0x6'));var csv=require('to-csv');var ejs=require(_0x57bf('0x7'));var fs=require('fs');var fs_extra=require(_0x57bf('0x8'));var _=require(_0x57bf('0x9'));var squel=require('squel');var crypto=require(_0x57bf('0xa'));var jsforce=require(_0x57bf('0xb'));var deskjs=require(_0x57bf('0xc'));var toCsv=require(_0x57bf('0xd'));var querystring=require(_0x57bf('0xe'));var Papa=require(_0x57bf('0xf'));var Redis=require(_0x57bf('0x10'));var authService=require(_0x57bf('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57bf('0x12'));var logger=require('../../config/logger')(_0x57bf('0x13'));var utils=require('../../config/utils');var config=require(_0x57bf('0x14'));var licenseUtil=require(_0x57bf('0x15'));var db=require(_0x57bf('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3fc112,_0xa94d5b){_0xa94d5b=_0xa94d5b||0xcc;return function(_0x394327){if(_0x394327){return _0x3fc112[_0x57bf('0x17')](_0xa94d5b);}return _0x3fc112['status'](_0xa94d5b)[_0x57bf('0x18')]();};}function respondWithResult(_0x10c70b,_0x20cf50){_0x20cf50=_0x20cf50||0xc8;return function(_0xdebdb5){if(_0xdebdb5){return _0x10c70b[_0x57bf('0x19')](_0x20cf50)[_0x57bf('0x1a')](_0xdebdb5);}};}function respondWithFilteredResult(_0xf946e6,_0x2cb865){return function(_0x2ca282){if(_0x2ca282){var _0x1b8df4=typeof _0x2cb865[_0x57bf('0x1b')]===_0x57bf('0x1c')&&typeof _0x2cb865['limit']===_0x57bf('0x1c');var _0x950aae=_0x2ca282[_0x57bf('0x1d')];var _0x17025c=_0x1b8df4?0x0:_0x2cb865['offset'];var _0x3bde66=_0x1b8df4?_0x2ca282['count']:_0x2cb865[_0x57bf('0x1b')]+_0x2cb865['limit'];var _0x21ef62;if(_0x3bde66>=_0x950aae){_0x3bde66=_0x950aae;_0x21ef62=0xc8;}else{_0x21ef62=0xce;}_0xf946e6[_0x57bf('0x19')](_0x21ef62);return _0xf946e6['set']('Content-Range',_0x17025c+'-'+_0x3bde66+'/'+_0x950aae)[_0x57bf('0x1a')](_0x2ca282);}return null;};}function patchUpdates(_0x3fb28f){return function(_0x142a40){try{jsonpatch[_0x57bf('0x1e')](_0x142a40,_0x3fb28f,!![]);}catch(_0x40b8df){return BPromise[_0x57bf('0x1f')](_0x40b8df);}return _0x142a40[_0x57bf('0x20')]();};}function saveUpdates(_0x3851b7,_0x5081e2){return function(_0x50a17f){if(_0x50a17f){return _0x50a17f[_0x57bf('0x21')](_0x3851b7)['then'](function(_0x1531bd){return _0x1531bd;});}return null;};}function removeEntity(_0x2d843a,_0x17057b){return function(_0x242634){if(_0x242634){return _0x242634[_0x57bf('0x22')]()['then'](function(){_0x2d843a['status'](0xcc)[_0x57bf('0x18')]();});}};}function handleEntityNotFound(_0x476b56,_0x54f3af){return function(_0x3c173d){if(!_0x3c173d){_0x476b56[_0x57bf('0x17')](0x194);}return _0x3c173d;};}function handleError(_0x1fa65d,_0x1ee7f6){_0x1ee7f6=_0x1ee7f6||0x1f4;return function(_0x3292ce){logger[_0x57bf('0x23')](_0x3292ce[_0x57bf('0x24')]);if(_0x3292ce[_0x57bf('0x25')]){delete _0x3292ce[_0x57bf('0x25')];}_0x1fa65d[_0x57bf('0x19')](_0x1ee7f6)['send'](_0x3292ce);};}exports[_0x57bf('0x26')]=function(_0x2cec39,_0x370178){var _0x2991f2={},_0x5e3278={},_0xf95a00={'count':0x0,'rows':[]};var _0x17aaf9=_[_0x57bf('0x27')](db[_0x57bf('0x28')][_0x57bf('0x29')],function(_0x16b7c9){return{'name':_0x16b7c9['fieldName'],'type':_0x16b7c9[_0x57bf('0x2a')][_0x57bf('0x2b')]};});_0x5e3278['model']=_[_0x57bf('0x27')](_0x17aaf9,_0x57bf('0x25'));_0x5e3278[_0x57bf('0x2c')]=_[_0x57bf('0x2d')](_0x2cec39[_0x57bf('0x2c')]);_0x5e3278[_0x57bf('0x2e')]=_[_0x57bf('0x2f')](_0x5e3278[_0x57bf('0x30')],_0x5e3278['query']);_0x2991f2[_0x57bf('0x31')]=_[_0x57bf('0x2f')](_0x5e3278['model'],qs[_0x57bf('0x32')](_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x32')]));_0x2991f2[_0x57bf('0x31')]=_0x2991f2[_0x57bf('0x31')][_0x57bf('0x33')]?_0x2991f2[_0x57bf('0x31')]:_0x5e3278['model'];if(!_0x2cec39['query'][_0x57bf('0x34')](_0x57bf('0x35'))){_0x2991f2[_0x57bf('0x36')]=qs[_0x57bf('0x36')](_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x36')]);_0x2991f2[_0x57bf('0x1b')]=qs['offset'](_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x1b')]);}_0x2991f2[_0x57bf('0x37')]=qs[_0x57bf('0x38')](_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x38')]);_0x2991f2[_0x57bf('0x39')]=qs['filters'](_[_0x57bf('0x3a')](_0x2cec39[_0x57bf('0x2c')],_0x5e3278['filters']),_0x17aaf9);if(_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x3b')]){_0x2991f2[_0x57bf('0x39')]=_[_0x57bf('0x3c')](_0x2991f2[_0x57bf('0x39')],{'$or':_[_0x57bf('0x27')](_0x17aaf9,function(_0x5cd5d1){if(_0x5cd5d1[_0x57bf('0x2a')]!==_0x57bf('0x3d')){var _0x509eb8={};_0x509eb8[_0x5cd5d1['name']]={'$like':'%'+_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x3b')]+'%'};return _0x509eb8;}})});}_0x2991f2=_['merge']({},_0x2991f2,_0x2cec39['options']);var _0x184974={'where':_0x2991f2[_0x57bf('0x39')]};return db[_0x57bf('0x28')]['count'](_0x184974)[_0x57bf('0x3e')](function(_0x3d4a9e){_0xf95a00[_0x57bf('0x1d')]=_0x3d4a9e;if(_0x2cec39[_0x57bf('0x2c')][_0x57bf('0x3f')]){_0x2991f2[_0x57bf('0x40')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x2991f2);})[_0x57bf('0x3e')](function(_0x16ad7c){_0xf95a00['rows']=_0x16ad7c;return _0xf95a00;})[_0x57bf('0x3e')](respondWithFilteredResult(_0x370178,_0x2991f2))[_0x57bf('0x41')](handleError(_0x370178,null));};exports['show']=function(_0xea5295,_0x52ae24){var _0x531c29={'raw':![],'where':{'id':_0xea5295[_0x57bf('0x42')]['id']}},_0x8eef64={};_0x8eef64[_0x57bf('0x30')]=_[_0x57bf('0x2d')](db['ServicenowAccount'][_0x57bf('0x29')]);_0x8eef64[_0x57bf('0x2c')]=_['keys'](_0xea5295[_0x57bf('0x2c')]);_0x8eef64[_0x57bf('0x2e')]=_[_0x57bf('0x2f')](_0x8eef64[_0x57bf('0x30')],_0x8eef64[_0x57bf('0x2c')]);_0x531c29[_0x57bf('0x31')]=_[_0x57bf('0x2f')](_0x8eef64['model'],qs[_0x57bf('0x32')](_0xea5295['query'][_0x57bf('0x32')]));_0x531c29[_0x57bf('0x31')]=_0x531c29[_0x57bf('0x31')][_0x57bf('0x33')]?_0x531c29[_0x57bf('0x31')]:_0x8eef64[_0x57bf('0x30')];if(_0xea5295[_0x57bf('0x2c')][_0x57bf('0x3f')]){_0x531c29['include']=[{'all':!![]}];}_0x531c29=_['merge']({},_0x531c29,_0xea5295[_0x57bf('0x43')]);return db['ServicenowAccount'][_0x57bf('0x44')](_0x531c29)[_0x57bf('0x3e')](handleEntityNotFound(_0x52ae24,null))['then'](respondWithResult(_0x52ae24,null))['catch'](handleError(_0x52ae24,null));};exports[_0x57bf('0x45')]=function(_0x27c023,_0x173685){return db['ServicenowAccount'][_0x57bf('0x45')](_0x27c023['body'],{})[_0x57bf('0x3e')](respondWithResult(_0x173685,0xc9))['catch'](handleError(_0x173685,null));};exports['update']=function(_0x363cb0,_0x9e70c4){if(_0x363cb0[_0x57bf('0x46')]['id']){delete _0x363cb0[_0x57bf('0x46')]['id'];}return db[_0x57bf('0x28')][_0x57bf('0x44')]({'where':{'id':_0x363cb0[_0x57bf('0x42')]['id']}})[_0x57bf('0x3e')](handleEntityNotFound(_0x9e70c4,null))['then'](saveUpdates(_0x363cb0[_0x57bf('0x46')],null))[_0x57bf('0x3e')](respondWithResult(_0x9e70c4,null))['catch'](handleError(_0x9e70c4,null));};exports[_0x57bf('0x22')]=function(_0x3b3891,_0x421a9e){return db['ServicenowAccount'][_0x57bf('0x44')]({'where':{'id':_0x3b3891[_0x57bf('0x42')]['id']}})[_0x57bf('0x3e')](handleEntityNotFound(_0x421a9e,null))['then'](removeEntity(_0x421a9e,null))[_0x57bf('0x41')](handleError(_0x421a9e,null));};exports['getConfigurations']=function(_0x5d1df0,_0x5ef29e,_0x3ebd7c){var _0x1bb073={};var _0x4dd66f={};var _0x410d47;var _0x5add9d;return db[_0x57bf('0x28')][_0x57bf('0x47')]({'where':{'id':_0x5d1df0[_0x57bf('0x42')]['id']}})[_0x57bf('0x3e')](handleEntityNotFound(_0x5ef29e,null))[_0x57bf('0x3e')](function(_0x827ed9){if(_0x827ed9){_0x410d47=_0x827ed9;_0x4dd66f[_0x57bf('0x30')]=_[_0x57bf('0x2d')](db['ServicenowConfiguration'][_0x57bf('0x29')]);_0x4dd66f[_0x57bf('0x2c')]=_['keys'](_0x5d1df0[_0x57bf('0x2c')]);_0x4dd66f[_0x57bf('0x2e')]=_[_0x57bf('0x2f')](_0x4dd66f[_0x57bf('0x30')],_0x4dd66f['query']);_0x1bb073[_0x57bf('0x31')]=_[_0x57bf('0x2f')](_0x4dd66f[_0x57bf('0x30')],qs['fields'](_0x5d1df0['query'][_0x57bf('0x32')]));_0x1bb073['attributes']=_0x1bb073[_0x57bf('0x31')]['length']?_0x1bb073['attributes']:_0x4dd66f['model'];_0x1bb073[_0x57bf('0x37')]=qs[_0x57bf('0x38')](_0x5d1df0[_0x57bf('0x2c')][_0x57bf('0x38')]);_0x1bb073[_0x57bf('0x39')]=qs[_0x57bf('0x2e')](_[_0x57bf('0x3a')](_0x5d1df0[_0x57bf('0x2c')],_0x4dd66f['filters']));if(_0x5d1df0[_0x57bf('0x2c')][_0x57bf('0x3b')]){_0x1bb073[_0x57bf('0x39')]=_[_0x57bf('0x3c')](_0x1bb073[_0x57bf('0x39')],{'$or':_[_0x57bf('0x27')](_0x1bb073[_0x57bf('0x31')],function(_0x4f386d){var _0x42083b={};_0x42083b[_0x4f386d]={'$like':'%'+_0x5d1df0[_0x57bf('0x2c')][_0x57bf('0x3b')]+'%'};return _0x42083b;})});}_0x1bb073=_[_0x57bf('0x3c')]({},_0x1bb073,_0x5d1df0[_0x57bf('0x43')]);return _0x410d47['getConfigurations'](_0x1bb073);}})[_0x57bf('0x3e')](function(_0x2812f6){if(_0x2812f6){_0x5add9d=_0x2812f6[_0x57bf('0x33')];if(!_0x5d1df0[_0x57bf('0x2c')][_0x57bf('0x34')]('nolimit')){_0x1bb073[_0x57bf('0x36')]=qs[_0x57bf('0x36')](_0x5d1df0[_0x57bf('0x2c')]['limit']);_0x1bb073[_0x57bf('0x1b')]=qs[_0x57bf('0x1b')](_0x5d1df0['query'][_0x57bf('0x1b')]);}return _0x410d47[_0x57bf('0x48')](_0x1bb073);}})['then'](function(_0xfb6a51){if(_0xfb6a51){return _0xfb6a51?{'count':_0x5add9d,'rows':_0xfb6a51}:null;}})[_0x57bf('0x3e')](respondWithResult(_0x5ef29e,null))['catch'](handleError(_0x5ef29e,null));};exports[_0x57bf('0x49')]=function(_0x3b3e3e,_0x43fe09,_0x143e28){if(_0x3b3e3e[_0x57bf('0x46')]['id']){delete _0x3b3e3e[_0x57bf('0x46')]['id'];}return db[_0x57bf('0x28')][_0x57bf('0x47')]({'where':{'id':_0x3b3e3e['params']['id']}})[_0x57bf('0x3e')](handleEntityNotFound(_0x43fe09,null))[_0x57bf('0x3e')](function(_0x48301b){if(_0x48301b){_0x3b3e3e['body'][_0x57bf('0x4a')]=_0x48301b['id'];_0x3b3e3e['body'][_0x57bf('0x4b')]=integrations['getSubjects'](_0x3b3e3e['body'][_0x57bf('0x4c')],_0x3b3e3e[_0x57bf('0x46')]['type']);_0x3b3e3e['body'][_0x57bf('0x4d')]=integrations[_0x57bf('0x4e')](_0x3b3e3e[_0x57bf('0x46')][_0x57bf('0x4c')],_0x3b3e3e[_0x57bf('0x46')]['type']);return db[_0x57bf('0x4f')][_0x57bf('0x45')](_0x3b3e3e[_0x57bf('0x46')],{'include':[{'model':db[_0x57bf('0x50')],'as':_0x57bf('0x4b')},{'model':db['ServicenowField'],'as':_0x57bf('0x4d')}]});}return null;})[_0x57bf('0x3e')](respondWithResult(_0x43fe09,null))[_0x57bf('0x41')](handleError(_0x43fe09,null));};exports[_0x57bf('0x51')]=function(_0x423698,_0x47c544,_0x167041){var _0x538edb=['made_sla',_0x57bf('0x52'),'knowledge','subcategory',_0x57bf('0x53'),_0x57bf('0x54'),_0x57bf('0x55'),_0x57bf('0x56'),_0x57bf('0x57')];var _0x2ba4aa=['parent',_0x57bf('0x58'),'caused_by',_0x57bf('0x59'),_0x57bf('0x5a'),_0x57bf('0x5b'),'child_incidents','hold_reason',_0x57bf('0x5c'),_0x57bf('0x5d'),_0x57bf('0x5e'),_0x57bf('0x5f'),'opened_by',_0x57bf('0x60'),'sys_created_on',_0x57bf('0x61'),_0x57bf('0x62'),'sys_created_by',_0x57bf('0x63'),_0x57bf('0x37'),'calendar_stc',_0x57bf('0x64'),_0x57bf('0x65'),'delivery_plan',_0x57bf('0x66'),_0x57bf('0x67'),'work_notes_list',_0x57bf('0x68'),_0x57bf('0x69'),'sys_domain_path',_0x57bf('0x6a'),_0x57bf('0x6b'),_0x57bf('0x6c'),'opened_at','business_duration',_0x57bf('0x6d'),_0x57bf('0x6e'),_0x57bf('0x6f'),_0x57bf('0x70'),_0x57bf('0x71'),_0x57bf('0x72'),_0x57bf('0x73'),_0x57bf('0x74'),_0x57bf('0x75'),'close_code',_0x57bf('0x76'),_0x57bf('0x77'),_0x57bf('0x78'),_0x57bf('0x79'),_0x57bf('0x7a'),_0x57bf('0x7b'),_0x57bf('0x7c'),_0x57bf('0x7d'),_0x57bf('0x54'),'sys_class_name','close_notes',_0x57bf('0x7e'),'follow_up',_0x57bf('0x7f'),_0x57bf('0x80'),'contact_type',_0x57bf('0x81'),'incident_state',_0x57bf('0x82'),_0x57bf('0x83'),_0x57bf('0x84'),'reassignment_count','activity_due',_0x57bf('0x85'),_0x57bf('0x56'),_0x57bf('0x86'),_0x57bf('0x87'),_0x57bf('0x88'),_0x57bf('0x89'),'due_date',_0x57bf('0x8a'),_0x57bf('0x8b'),_0x57bf('0x8c'),'escalation',_0x57bf('0x8d'),_0x57bf('0x8e'),_0x57bf('0x8f'),_0x57bf('0x57')];var _0x1b91f3='';var _0x10bb76='';var _0x189790=[];var _0x27d0c6='';var _0x31da8f='';var _0x4c631a=[];var _0x5d41e8='';var _0x3cbddf='';var _0x1c7cae={};var _0x10ba08='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x423698['params']['id']},'attributes':['id','username',_0x57bf('0x90'),_0x57bf('0x91'),'remoteUri',_0x57bf('0x92')]})[_0x57bf('0x3e')](handleEntityNotFound(_0x47c544,null))[_0x57bf('0x3e')](function(_0x54097c){if(_0x54097c){_0x10ba08=_0x54097c[_0x57bf('0x93')];var _0x279516=_0x10ba08[_0x57bf('0x94')](-0x1);if(_0x279516==='/'){_0x10ba08=_0x10ba08[_0x57bf('0x95')](0x0,_0x10ba08['lastIndexOf'](_0x279516));}_0x3cbddf=util[_0x57bf('0x96')](_0x57bf('0x97'),_0x10ba08);_0x5d41e8=util[_0x57bf('0x96')](_0x57bf('0x98'),_0x10ba08);_0x1c7cae={'user':_0x54097c['username'],'pass':_0x54097c[_0x57bf('0x90')]};var _0xd09ad9={'method':_0x57bf('0x99'),'uri':_0x3cbddf+_0x57bf('0x9a'),'auth':_0x1c7cae,'json':!![]};return rp(_0xd09ad9);}})[_0x57bf('0x3e')](function(_0x14c8a6){if(_0x14c8a6[_0x57bf('0x9b')][_0x57bf('0x33')]>0x0){_0x1b91f3=_0x14c8a6[_0x57bf('0x9b')];}console[_0x57bf('0x9c')](_0x57bf('0x9d'),_0x1b91f3);_0x4c631a=[];_0x10bb76=Object[_0x57bf('0x9e')]([],_0x1b91f3);_['remove'](_0x10bb76,function(_0x25a235){return!_0x538edb[_0x57bf('0x9f')](_0x25a235[_0x57bf('0x25')]);});_0x10bb76[_0x57bf('0xa0')](function(_0x4f94d3){var _0x3a6e5c=createFieldObject(_0x5d41e8,_0x1c7cae,_0x4f94d3[_0x57bf('0xa1')],_0x4f94d3['name'],_0x4f94d3['label'],![]);_0x4c631a['push'](_0x3a6e5c);});return Promise[_0x57bf('0xa2')](_0x4c631a);})[_0x57bf('0x3e')](function(_0x5e30ea){_0x189790=_0x5e30ea;_0x27d0c6=Object[_0x57bf('0x9e')]([],_0x1b91f3);console['log'](_0x57bf('0xa3'),_0x1b91f3);_[_0x57bf('0xa4')](_0x27d0c6,function(_0x54af6b){return _0x2ba4aa['includes'](_0x54af6b[_0x57bf('0x25')]);});console[_0x57bf('0x9c')](_0x57bf('0xa5'),_0x27d0c6);_0x4c631a=[];_0x27d0c6['forEach'](function(_0x47f302){var _0x4fc897=createFieldObject(_0x5d41e8,_0x1c7cae,_0x47f302[_0x57bf('0xa1')],_0x47f302[_0x57bf('0x25')],_0x47f302[_0x57bf('0xa6')],!![]);_0x4c631a[_0x57bf('0xa7')](_0x4fc897);});return Promise['all'](_0x4c631a);})['then'](function(_0x2e39f6){_0x31da8f=_0x2e39f6;var _0x5b82ee=_0x189790[_0x57bf('0xa8')](_0x31da8f);return{'count':_0x5b82ee[_0x57bf('0x33')],'rows':_0x5b82ee};})[_0x57bf('0x3e')](respondWithResult(_0x47c544,null))[_0x57bf('0x41')](function(_0x2d0406){console[_0x57bf('0x9c')](_0x57bf('0xa9')+_0x2d0406);var _0x4b8e42=_0x423698[_0x57bf('0x2c')]['test']?0x1f4:_0x2d0406[_0x57bf('0xaa')]||0x1f4;logger[_0x57bf('0x23')](_0x2d0406[_0x57bf('0x24')]);delete _0x2d0406[_0x57bf('0x25')];if(_0x4b8e42===0x191){_0x4b8e42=0x190;}_0x47c544[_0x57bf('0x19')](_0x4b8e42)[_0x57bf('0xab')](_0x423698[_0x57bf('0x2c')][_0x57bf('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x2d0406[_0x57bf('0xaa')]}:_0x2d0406);});};function createFieldObject(_0x527f61,_0x49a2bb,_0x2059cf,_0x2a607d,_0x5e8091,_0x4d7315){return new Promise(function(_0x366234,_0x3bd95e){var _0x375858={'id':_0x2a607d,'name':_0x5e8091,'custom':_0x4d7315};if(_0x2059cf===_0x57bf('0xad')){_0x375858[_0x57bf('0x43')]=[{'name':'True','value':'true'},{'name':_0x57bf('0xae'),'value':_0x57bf('0xaf')}];_0x366234(_0x375858);}else{var _0x210933={'method':_0x57bf('0x99'),'uri':_0x527f61+_0x57bf('0xb0')+_0x2a607d,'auth':_0x49a2bb,'json':!![]};return rp(_0x210933)['then'](function(_0x78fe90){var _0x35b016=[];if(_0x78fe90['result'][_0x57bf('0x33')]>0x0){_0x78fe90['result'][_0x57bf('0xa0')](function(_0x3f048f){if(_0x3f048f[_0x57bf('0xb1')]===_0x57bf('0xaf')){var _0x59734d={'name':_0x3f048f[_0x57bf('0xa6')],'value':_0x3f048f[_0x57bf('0xb2')]};_0x35b016['push'](_0x59734d);}});}_0x375858[_0x57bf('0x43')]=_0x35b016;if(_0x375858[_0x57bf('0x43')]['length']>0x0){_0x366234(_0x375858);}else{if(_0x4d7315==![]){_0x366234();}else{_0x366234(_0x375858);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 194efa5..be8fa9b 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 _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x5479a,_0x3d6e36){var _0x53686d=function(_0x132918){while(--_0x132918){_0x5479a['push'](_0x5479a['shift']());}};_0x53686d(++_0x3d6e36);}(_0x4c60,0xc1));var _0x04c6=function(_0x3d4d35,_0x396c03){_0x3d4d35=_0x3d4d35-0x0;var _0x1d395e=_0x4c60[_0x3d4d35];return _0x1d395e;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x326f,0xd1));var _0xf326=function(_0x5c1217,_0x56ae9a){_0x5c1217=_0x5c1217-0x0;var _0xda594f=_0x326f[_0x5c1217];return _0xda594f;};'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'));var integrations=require(_0xf326('0x9'));module[_0xf326('0xa')]=function(_0x4c2249,_0x3c254d){return _0x4c2249[_0xf326('0xb')](_0xf326('0xc'),attributes,{'tableName':_0xf326('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 9d60e8d..773bc45 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 _0xddf2=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','model','map','then','stringify','ShowServicenowAccount','debug','lodash'];(function(_0x21dfd0,_0x25fc60){var _0x17853c=function(_0x4cdd09){while(--_0x4cdd09){_0x21dfd0['push'](_0x21dfd0['shift']());}};_0x17853c(++_0x25fc60);}(_0xddf2,0x1cd));var _0x2ddf=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xddf2[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x2ddf('0x0'));var util=require(_0x2ddf('0x1'));var moment=require(_0x2ddf('0x2'));var BPromise=require(_0x2ddf('0x3'));var rs=require(_0x2ddf('0x4'));var fs=require('fs');var Redis=require(_0x2ddf('0x5'));var db=require(_0x2ddf('0x6'))['db'];var utils=require(_0x2ddf('0x7'));var logger=require(_0x2ddf('0x8'))(_0x2ddf('0x9'));var config=require('../../config/environment');var jayson=require(_0x2ddf('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x133909,_0x49cbdf,_0x3605e4){return new BPromise(function(_0x3ad0de,_0x4e2c0d){return client['request'](_0x133909,_0x3605e4)['then'](function(_0x4e3d3c){logger[_0x2ddf('0xb')](_0x2ddf('0xc'),_0x49cbdf,'request\x20sent');logger['debug'](_0x2ddf('0xd'),_0x49cbdf,_0x2ddf('0xe'),JSON['stringify'](_0x4e3d3c));if(_0x4e3d3c[_0x2ddf('0xf')]){if(_0x4e3d3c[_0x2ddf('0xf')][_0x2ddf('0x10')]===0x1f4){logger[_0x2ddf('0xf')](_0x2ddf('0xc'),_0x49cbdf,_0x4e3d3c[_0x2ddf('0xf')][_0x2ddf('0x11')]);return _0x4e2c0d(_0x4e3d3c['error'][_0x2ddf('0x11')]);}logger[_0x2ddf('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x49cbdf,_0x4e3d3c[_0x2ddf('0xf')]['message']);return _0x3ad0de(_0x4e3d3c[_0x2ddf('0xf')][_0x2ddf('0x11')]);}else{logger[_0x2ddf('0xb')](_0x2ddf('0xc'),_0x49cbdf,'request\x20sent');_0x3ad0de(_0x4e3d3c[_0x2ddf('0x12')][_0x2ddf('0x11')]);}})[_0x2ddf('0x13')](function(_0x111e27){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x49cbdf,_0x111e27);_0x4e2c0d(_0x111e27);});});}exports[_0x2ddf('0x14')]=function(_0x22af52){var _0x51cf82=this;return new Promise(function(_0x20038e,_0x1a4a16){return db[_0x2ddf('0x15')]['findAll']({'raw':_0x22af52[_0x2ddf('0x16')]?_0x22af52[_0x2ddf('0x16')][_0x2ddf('0x17')]===undefined?!![]:![]:!![],'where':_0x22af52['options']?_0x22af52[_0x2ddf('0x16')]['where']||null:null,'attributes':_0x22af52[_0x2ddf('0x16')]?_0x22af52['options'][_0x2ddf('0x18')]||null:null,'limit':_0x22af52[_0x2ddf('0x16')]?_0x22af52[_0x2ddf('0x16')][_0x2ddf('0x19')]||null:null,'include':_0x22af52[_0x2ddf('0x16')]?_0x22af52[_0x2ddf('0x16')][_0x2ddf('0x1a')]?_['map'](_0x22af52[_0x2ddf('0x16')][_0x2ddf('0x1a')],function(_0x284814){return{'model':db[_0x284814[_0x2ddf('0x1b')]],'as':_0x284814['as'],'attributes':_0x284814['attributes'],'include':_0x284814['include']?_[_0x2ddf('0x1c')](_0x284814[_0x2ddf('0x1a')],function(_0x3780e4){return{'model':db[_0x3780e4[_0x2ddf('0x1b')]],'as':_0x3780e4['as'],'attributes':_0x3780e4[_0x2ddf('0x18')],'include':_0x3780e4[_0x2ddf('0x1a')]?_[_0x2ddf('0x1c')](_0x3780e4[_0x2ddf('0x1a')],function(_0x2a34ec){return{'model':db[_0x2a34ec[_0x2ddf('0x1b')]],'as':_0x2a34ec['as'],'attributes':_0x2a34ec[_0x2ddf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2ddf('0x1d')](function(_0x321fa7){logger[_0x2ddf('0xb')](_0x2ddf('0x14'),_0x22af52);logger['debug'](_0x2ddf('0x14'),_0x22af52,JSON[_0x2ddf('0x1e')](_0x321fa7));_0x20038e(_0x321fa7);})[_0x2ddf('0x13')](function(_0x5884db){logger[_0x2ddf('0xf')](_0x2ddf('0x14'),_0x5884db[_0x2ddf('0x11')],_0x22af52);_0x1a4a16(_0x51cf82[_0x2ddf('0xf')](0x1f4,_0x5884db['message']));});});};exports[_0x2ddf('0x1f')]=function(_0x598a3f){var _0x3e041d=this;return new Promise(function(_0x20cbb2,_0x73e0ca){return db[_0x2ddf('0x15')]['find']({'raw':_0x598a3f[_0x2ddf('0x16')]?_0x598a3f[_0x2ddf('0x16')][_0x2ddf('0x17')]===undefined?!![]:![]:!![],'where':_0x598a3f[_0x2ddf('0x16')]?_0x598a3f[_0x2ddf('0x16')]['where']||null:null,'attributes':_0x598a3f[_0x2ddf('0x16')]?_0x598a3f['options']['attributes']||null:null,'include':_0x598a3f['options']?_0x598a3f['options'][_0x2ddf('0x1a')]?_[_0x2ddf('0x1c')](_0x598a3f[_0x2ddf('0x16')][_0x2ddf('0x1a')],function(_0x148c05){return{'model':db[_0x148c05[_0x2ddf('0x1b')]],'as':_0x148c05['as'],'attributes':_0x148c05['attributes'],'include':_0x148c05[_0x2ddf('0x1a')]?_[_0x2ddf('0x1c')](_0x148c05[_0x2ddf('0x1a')],function(_0x525d13){return{'model':db[_0x525d13[_0x2ddf('0x1b')]],'as':_0x525d13['as'],'attributes':_0x525d13['attributes'],'include':_0x525d13[_0x2ddf('0x1a')]?_[_0x2ddf('0x1c')](_0x525d13[_0x2ddf('0x1a')],function(_0x5f3272){return{'model':db[_0x5f3272[_0x2ddf('0x1b')]],'as':_0x5f3272['as'],'attributes':_0x5f3272['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ddf('0x1d')](function(_0x3b1b8d){logger[_0x2ddf('0xb')]('ShowServicenowAccount',_0x598a3f);logger[_0x2ddf('0x20')]('ShowServicenowAccount',_0x598a3f,JSON[_0x2ddf('0x1e')](_0x3b1b8d));_0x20cbb2(_0x3b1b8d);})[_0x2ddf('0x13')](function(_0x178096){logger[_0x2ddf('0xf')]('ShowServicenowAccount',_0x178096[_0x2ddf('0x11')],_0x598a3f);_0x73e0ca(_0x3e041d[_0x2ddf('0xf')](0x1f4,_0x178096[_0x2ddf('0x11')]));});});}; \ No newline at end of file +var _0xaded=['raw','where','attributes','include','map','model','debug','ShowServicenowAccount','find','then','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0xaded,0x175));var _0xdade=function(_0x51d764,_0x2f7761){_0x51d764=_0x51d764-0x0;var _0x45f63a=_0xaded[_0x51d764];return _0x45f63a;};'use strict';var _=require('lodash');var util=require(_0xdade('0x0'));var moment=require('moment');var BPromise=require(_0xdade('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdade('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdade('0x3'));var logger=require(_0xdade('0x4'))(_0xdade('0x5'));var config=require('../../config/environment');var jayson=require(_0xdade('0x6'));var client=jayson[_0xdade('0x7')][_0xdade('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fb3ee,_0x30db78,_0x3bf331){return new BPromise(function(_0x1b92c1,_0x17441d){return client[_0xdade('0x9')](_0x3fb3ee,_0x3bf331)['then'](function(_0x3efd0d){logger[_0xdade('0xa')](_0xdade('0xb'),_0x30db78,'request\x20sent');logger['debug'](_0xdade('0xc'),_0x30db78,'request\x20sent',JSON[_0xdade('0xd')](_0x3efd0d));if(_0x3efd0d[_0xdade('0xe')]){if(_0x3efd0d[_0xdade('0xe')]['code']===0x1f4){logger[_0xdade('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x30db78,_0x3efd0d['error']['message']);return _0x17441d(_0x3efd0d['error'][_0xdade('0xf')]);}logger[_0xdade('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x30db78,_0x3efd0d['error'][_0xdade('0xf')]);return _0x1b92c1(_0x3efd0d[_0xdade('0xe')]['message']);}else{logger[_0xdade('0xa')](_0xdade('0xb'),_0x30db78,_0xdade('0x10'));_0x1b92c1(_0x3efd0d[_0xdade('0x11')][_0xdade('0xf')]);}})[_0xdade('0x12')](function(_0x3dd600){logger[_0xdade('0xe')](_0xdade('0xb'),_0x30db78,_0x3dd600);_0x17441d(_0x3dd600);});});}exports[_0xdade('0x13')]=function(_0x193323){var _0x9ebd0=this;return new Promise(function(_0x1adce4,_0x10f33b){return db[_0xdade('0x14')][_0xdade('0x15')]({'raw':_0x193323['options']?_0x193323[_0xdade('0x16')][_0xdade('0x17')]===undefined?!![]:![]:!![],'where':_0x193323['options']?_0x193323['options'][_0xdade('0x18')]||null:null,'attributes':_0x193323[_0xdade('0x16')]?_0x193323[_0xdade('0x16')][_0xdade('0x19')]||null:null,'limit':_0x193323[_0xdade('0x16')]?_0x193323[_0xdade('0x16')]['limit']||null:null,'include':_0x193323['options']?_0x193323[_0xdade('0x16')][_0xdade('0x1a')]?_[_0xdade('0x1b')](_0x193323['options'][_0xdade('0x1a')],function(_0x371da1){return{'model':db[_0x371da1['model']],'as':_0x371da1['as'],'attributes':_0x371da1[_0xdade('0x19')],'include':_0x371da1[_0xdade('0x1a')]?_['map'](_0x371da1['include'],function(_0x50df9c){return{'model':db[_0x50df9c[_0xdade('0x1c')]],'as':_0x50df9c['as'],'attributes':_0x50df9c['attributes'],'include':_0x50df9c[_0xdade('0x1a')]?_[_0xdade('0x1b')](_0x50df9c[_0xdade('0x1a')],function(_0x48462e){return{'model':db[_0x48462e[_0xdade('0x1c')]],'as':_0x48462e['as'],'attributes':_0x48462e[_0xdade('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b1c6){logger['info']('GetServicenowAccount',_0x193323);logger[_0xdade('0x1d')](_0xdade('0x13'),_0x193323,JSON[_0xdade('0xd')](_0x36b1c6));_0x1adce4(_0x36b1c6);})[_0xdade('0x12')](function(_0x41fdd5){logger[_0xdade('0xe')](_0xdade('0x13'),_0x41fdd5[_0xdade('0xf')],_0x193323);_0x10f33b(_0x9ebd0[_0xdade('0xe')](0x1f4,_0x41fdd5['message']));});});};exports[_0xdade('0x1e')]=function(_0x560a65){var _0x6edca5=this;return new Promise(function(_0x24021e,_0x47db20){return db[_0xdade('0x14')][_0xdade('0x1f')]({'raw':_0x560a65[_0xdade('0x16')]?_0x560a65[_0xdade('0x16')][_0xdade('0x17')]===undefined?!![]:![]:!![],'where':_0x560a65[_0xdade('0x16')]?_0x560a65['options']['where']||null:null,'attributes':_0x560a65['options']?_0x560a65[_0xdade('0x16')][_0xdade('0x19')]||null:null,'include':_0x560a65[_0xdade('0x16')]?_0x560a65['options']['include']?_[_0xdade('0x1b')](_0x560a65['options'][_0xdade('0x1a')],function(_0x5360ad){return{'model':db[_0x5360ad[_0xdade('0x1c')]],'as':_0x5360ad['as'],'attributes':_0x5360ad[_0xdade('0x19')],'include':_0x5360ad[_0xdade('0x1a')]?_[_0xdade('0x1b')](_0x5360ad['include'],function(_0x138895){return{'model':db[_0x138895[_0xdade('0x1c')]],'as':_0x138895['as'],'attributes':_0x138895[_0xdade('0x19')],'include':_0x138895[_0xdade('0x1a')]?_[_0xdade('0x1b')](_0x138895[_0xdade('0x1a')],function(_0x33f2bb){return{'model':db[_0x33f2bb[_0xdade('0x1c')]],'as':_0x33f2bb['as'],'attributes':_0x33f2bb[_0xdade('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdade('0x20')](function(_0x1cd6c1){logger[_0xdade('0xa')](_0xdade('0x1e'),_0x560a65);logger[_0xdade('0x1d')]('ShowServicenowAccount',_0x560a65,JSON[_0xdade('0xd')](_0x1cd6c1));_0x24021e(_0x1cd6c1);})[_0xdade('0x12')](function(_0x5de7ed){logger[_0xdade('0xe')](_0xdade('0x1e'),_0x5de7ed['message'],_0x560a65);_0x47db20(_0x6edca5['error'](0x1f4,_0x5de7ed[_0xdade('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 305e113..ae12733 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 _0x3fe1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x3fe1,0x1c4));var _0x13fe=function(_0x398598,_0x519b63){_0x398598=_0x398598-0x0;var _0x12cf68=_0x3fe1[_0x398598];return _0x12cf68;};'use strict';var multer=require(_0x13fe('0x0'));var util=require(_0x13fe('0x1'));var path=require('path');var timeout=require(_0x13fe('0x2'));var express=require(_0x13fe('0x3'));var router=express[_0x13fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x13fe('0x5'));var interaction=require(_0x13fe('0x6'));var config=require(_0x13fe('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x13fe('0x8')](),controller[_0x13fe('0x9')]);router[_0x13fe('0xa')](_0x13fe('0xb'),auth[_0x13fe('0x8')](),controller[_0x13fe('0xc')]);router['get'](_0x13fe('0xd'),auth[_0x13fe('0x8')](),controller['getFields']);router[_0x13fe('0xa')](_0x13fe('0xe'),auth['isAuthenticated'](),controller[_0x13fe('0xf')]);router['get'](_0x13fe('0x10'),auth[_0x13fe('0x8')](),controller[_0x13fe('0x11')]);router[_0x13fe('0x12')]('/',auth[_0x13fe('0x8')](),controller[_0x13fe('0x13')]);router[_0x13fe('0x14')](_0x13fe('0xb'),auth[_0x13fe('0x8')](),controller[_0x13fe('0x15')]);router[_0x13fe('0x16')](_0x13fe('0xb'),auth[_0x13fe('0x8')](),controller['destroy']);module[_0x13fe('0x17')]=router; \ No newline at end of file +var _0x40ad=['./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x190218,_0x1e7e8d){var _0xb2f213=function(_0x13b0a5){while(--_0x13b0a5){_0x190218['push'](_0x190218['shift']());}};_0xb2f213(++_0x1e7e8d);}(_0x40ad,0x19d));var _0xd40a=function(_0x2a37a4,_0x464b98){_0x2a37a4=_0x2a37a4-0x0;var _0x29d935=_0x40ad[_0x2a37a4];return _0x29d935;};'use strict';var multer=require(_0xd40a('0x0'));var util=require(_0xd40a('0x1'));var path=require(_0xd40a('0x2'));var timeout=require(_0xd40a('0x3'));var express=require('express');var router=express[_0xd40a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd40a('0x5'));var config=require(_0xd40a('0x6'));var controller=require(_0xd40a('0x7'));router['get']('/',auth[_0xd40a('0x8')](),controller[_0xd40a('0x9')]);router[_0xd40a('0xa')](_0xd40a('0xb'),auth['isAuthenticated'](),controller[_0xd40a('0xc')]);router['get']('/:id/fields',auth[_0xd40a('0x8')](),controller[_0xd40a('0xd')]);router[_0xd40a('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd40a('0xe')]);router[_0xd40a('0xa')](_0xd40a('0xf'),auth[_0xd40a('0x8')](),controller[_0xd40a('0x10')]);router[_0xd40a('0x11')]('/',auth[_0xd40a('0x8')](),controller[_0xd40a('0x12')]);router[_0xd40a('0x13')](_0xd40a('0xb'),auth[_0xd40a('0x8')](),controller[_0xd40a('0x14')]);router['delete'](_0xd40a('0xb'),auth[_0xd40a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c11bf9a..9435e50 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 _0x837a=['STRING','sequelize','exports'];(function(_0x1bc6ab,_0x380f3f){var _0x21e515=function(_0x3ff33a){while(--_0x3ff33a){_0x1bc6ab['push'](_0x1bc6ab['shift']());}};_0x21e515(++_0x380f3f);}(_0x837a,0xfa));var _0xa837=function(_0x2c6464,_0x5c53e4){_0x2c6464=_0x2c6464-0x0;var _0x49c939=_0x837a[_0x2c6464];return _0x49c939;};'use strict';var Sequelize=require(_0xa837('0x0'));module[_0xa837('0x1')]={'name':{'type':Sequelize[_0xa837('0x2')]},'description':{'type':Sequelize[_0xa837('0x2')]}}; \ No newline at end of file +var _0xbfe4=['sequelize','exports','STRING'];(function(_0x2276f4,_0x4b0ee5){var _0x17186c=function(_0x59ccfc){while(--_0x59ccfc){_0x2276f4['push'](_0x2276f4['shift']());}};_0x17186c(++_0x4b0ee5);}(_0xbfe4,0x1c5));var _0x4bfe=function(_0x5d76a1,_0x39c5e3){_0x5d76a1=_0x5d76a1-0x0;var _0x15aa06=_0xbfe4[_0x5d76a1];return _0x15aa06;};'use strict';var Sequelize=require(_0x4bfe('0x0'));module[_0x4bfe('0x1')]={'name':{'type':Sequelize[_0x4bfe('0x2')]},'description':{'type':Sequelize[_0x4bfe('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 50fe43c..75cc916 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 _0xa552=['getFields','ServicenowField','pick','filter','findOne','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body'];(function(_0x4133ef,_0x472f8c){var _0x5a6bdc=function(_0x14426a){while(--_0x14426a){_0x4133ef['push'](_0x4133ef['shift']());}};_0x5a6bdc(++_0x472f8c);}(_0xa552,0x193));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2a55('0x0'));var rimraf=require(_0x2a55('0x1'));var zipdir=require(_0x2a55('0x2'));var jsonpatch=require(_0x2a55('0x3'));var rp=require(_0x2a55('0x4'));var moment=require(_0x2a55('0x5'));var BPromise=require(_0x2a55('0x6'));var Mustache=require(_0x2a55('0x7'));var util=require(_0x2a55('0x8'));var path=require('path');var sox=require(_0x2a55('0x9'));var csv=require(_0x2a55('0xa'));var ejs=require(_0x2a55('0xb'));var fs=require('fs');var fs_extra=require(_0x2a55('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a55('0xd'));var jsforce=require(_0x2a55('0xe'));var deskjs=require(_0x2a55('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2a55('0x10'));var Papa=require(_0x2a55('0x11'));var Redis=require('ioredis');var authService=require(_0x2a55('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2a55('0x13'));var hardwareService=require(_0x2a55('0x14'));var logger=require(_0x2a55('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2a55('0x16'));var licenseUtil=require(_0x2a55('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31e8f3,_0x451261){_0x451261=_0x451261||0xcc;return function(_0x5d2e48){if(_0x5d2e48){return _0x31e8f3['sendStatus'](_0x451261);}return _0x31e8f3['status'](_0x451261)[_0x2a55('0x18')]();};}function respondWithResult(_0x35ac10,_0x584642){_0x584642=_0x584642||0xc8;return function(_0x35eb41){if(_0x35eb41){return _0x35ac10[_0x2a55('0x19')](_0x584642)[_0x2a55('0x1a')](_0x35eb41);}};}function respondWithFilteredResult(_0x32428a,_0x108f6d){return function(_0x5477ff){if(_0x5477ff){var _0x421b62=typeof _0x108f6d[_0x2a55('0x1b')]===_0x2a55('0x1c')&&typeof _0x108f6d[_0x2a55('0x1d')]===_0x2a55('0x1c');var _0x5d8d49=_0x5477ff['count'];var _0x8eee57=_0x421b62?0x0:_0x108f6d[_0x2a55('0x1b')];var _0xbc9e3a=_0x421b62?_0x5477ff[_0x2a55('0x1e')]:_0x108f6d[_0x2a55('0x1b')]+_0x108f6d['limit'];var _0x135481;if(_0xbc9e3a>=_0x5d8d49){_0xbc9e3a=_0x5d8d49;_0x135481=0xc8;}else{_0x135481=0xce;}_0x32428a[_0x2a55('0x19')](_0x135481);return _0x32428a['set'](_0x2a55('0x1f'),_0x8eee57+'-'+_0xbc9e3a+'/'+_0x5d8d49)[_0x2a55('0x1a')](_0x5477ff);}return null;};}function patchUpdates(_0x202c7a){return function(_0x7e60ce){try{jsonpatch['apply'](_0x7e60ce,_0x202c7a,!![]);}catch(_0x440c52){return BPromise[_0x2a55('0x20')](_0x440c52);}return _0x7e60ce['save']();};}function saveUpdates(_0xce8aa2,_0x3b5559){return function(_0x50abd0){if(_0x50abd0){return _0x50abd0[_0x2a55('0x21')](_0xce8aa2)[_0x2a55('0x22')](function(_0x2b6318){return _0x2b6318;});}return null;};}function removeEntity(_0x5fd114,_0x2811ef){return function(_0x5ea18b){if(_0x5ea18b){return _0x5ea18b['destroy']()[_0x2a55('0x22')](function(){_0x5fd114[_0x2a55('0x19')](0xcc)[_0x2a55('0x18')]();});}};}function handleEntityNotFound(_0x31b1cf,_0x32c5a1){return function(_0xd6a12){if(!_0xd6a12){_0x31b1cf[_0x2a55('0x23')](0x194);}return _0xd6a12;};}function handleError(_0x273132,_0x4b32ee){_0x4b32ee=_0x4b32ee||0x1f4;return function(_0x2cba37){logger[_0x2a55('0x24')](_0x2cba37[_0x2a55('0x25')]);if(_0x2cba37[_0x2a55('0x26')]){delete _0x2cba37[_0x2a55('0x26')];}_0x273132[_0x2a55('0x19')](_0x4b32ee)[_0x2a55('0x27')](_0x2cba37);};}exports[_0x2a55('0x28')]=function(_0x13756d,_0x3ee780){var _0x12f235={},_0x51278e={},_0xcbb70c={'count':0x0,'rows':[]};var _0x212121=_[_0x2a55('0x29')](db[_0x2a55('0x2a')][_0x2a55('0x2b')],function(_0x5374ec){return{'name':_0x5374ec[_0x2a55('0x2c')],'type':_0x5374ec[_0x2a55('0x2d')][_0x2a55('0x2e')]};});_0x51278e[_0x2a55('0x2f')]=_[_0x2a55('0x29')](_0x212121,_0x2a55('0x26'));_0x51278e['query']=_[_0x2a55('0x30')](_0x13756d[_0x2a55('0x31')]);_0x51278e[_0x2a55('0x32')]=_['intersection'](_0x51278e[_0x2a55('0x2f')],_0x51278e[_0x2a55('0x31')]);_0x12f235[_0x2a55('0x33')]=_[_0x2a55('0x34')](_0x51278e[_0x2a55('0x2f')],qs[_0x2a55('0x35')](_0x13756d[_0x2a55('0x31')]['fields']));_0x12f235[_0x2a55('0x33')]=_0x12f235['attributes'][_0x2a55('0x36')]?_0x12f235[_0x2a55('0x33')]:_0x51278e[_0x2a55('0x2f')];if(!_0x13756d['query'][_0x2a55('0x37')](_0x2a55('0x38'))){_0x12f235[_0x2a55('0x1d')]=qs[_0x2a55('0x1d')](_0x13756d[_0x2a55('0x31')][_0x2a55('0x1d')]);_0x12f235[_0x2a55('0x1b')]=qs[_0x2a55('0x1b')](_0x13756d['query'][_0x2a55('0x1b')]);}_0x12f235['order']=qs[_0x2a55('0x39')](_0x13756d[_0x2a55('0x31')][_0x2a55('0x39')]);_0x12f235[_0x2a55('0x3a')]=qs['filters'](_['pick'](_0x13756d[_0x2a55('0x31')],_0x51278e[_0x2a55('0x32')]),_0x212121);if(_0x13756d[_0x2a55('0x31')]['filter']){_0x12f235[_0x2a55('0x3a')]=_['merge'](_0x12f235['where'],{'$or':_['map'](_0x212121,function(_0x1c0e01){if(_0x1c0e01[_0x2a55('0x2d')]!==_0x2a55('0x3b')){var _0x339cfc={};_0x339cfc[_0x1c0e01[_0x2a55('0x26')]]={'$like':'%'+_0x13756d[_0x2a55('0x31')]['filter']+'%'};return _0x339cfc;}})});}_0x12f235=_[_0x2a55('0x3c')]({},_0x12f235,_0x13756d[_0x2a55('0x3d')]);var _0x4a3f68={'where':_0x12f235[_0x2a55('0x3a')]};return db[_0x2a55('0x2a')][_0x2a55('0x1e')](_0x4a3f68)['then'](function(_0x16da13){_0xcbb70c[_0x2a55('0x1e')]=_0x16da13;if(_0x13756d[_0x2a55('0x31')][_0x2a55('0x3e')]){_0x12f235[_0x2a55('0x3f')]=[{'all':!![]}];}return db[_0x2a55('0x2a')][_0x2a55('0x40')](_0x12f235);})[_0x2a55('0x22')](function(_0x10aa3b){_0xcbb70c[_0x2a55('0x41')]=_0x10aa3b;return _0xcbb70c;})[_0x2a55('0x22')](respondWithFilteredResult(_0x3ee780,_0x12f235))[_0x2a55('0x42')](handleError(_0x3ee780,null));};exports[_0x2a55('0x43')]=function(_0x41d98c,_0x2ee55d){var _0x5c8114={'raw':![],'where':{'id':_0x41d98c[_0x2a55('0x44')]['id']}},_0xe0d420={};_0xe0d420['model']=_['keys'](db[_0x2a55('0x2a')][_0x2a55('0x2b')]);_0xe0d420[_0x2a55('0x31')]=_['keys'](_0x41d98c[_0x2a55('0x31')]);_0xe0d420['filters']=_[_0x2a55('0x34')](_0xe0d420[_0x2a55('0x2f')],_0xe0d420[_0x2a55('0x31')]);_0x5c8114[_0x2a55('0x33')]=_[_0x2a55('0x34')](_0xe0d420[_0x2a55('0x2f')],qs[_0x2a55('0x35')](_0x41d98c['query'][_0x2a55('0x35')]));_0x5c8114[_0x2a55('0x33')]=_0x5c8114[_0x2a55('0x33')][_0x2a55('0x36')]?_0x5c8114['attributes']:_0xe0d420[_0x2a55('0x2f')];if(_0x41d98c['query'][_0x2a55('0x3e')]){_0x5c8114[_0x2a55('0x3f')]=[{'all':!![]}];}_0x5c8114=_[_0x2a55('0x3c')]({},_0x5c8114,_0x41d98c['options']);return db[_0x2a55('0x2a')][_0x2a55('0x45')](_0x5c8114)[_0x2a55('0x22')](handleEntityNotFound(_0x2ee55d,null))['then'](respondWithResult(_0x2ee55d,null))['catch'](handleError(_0x2ee55d,null));};exports['create']=function(_0x59f3a2,_0x413d3c){return db[_0x2a55('0x2a')]['create'](_0x59f3a2[_0x2a55('0x46')],{})[_0x2a55('0x22')](respondWithResult(_0x413d3c,0xc9))[_0x2a55('0x42')](handleError(_0x413d3c,null));};exports['update']=function(_0x5bc34e,_0x27cf3f){if(_0x5bc34e[_0x2a55('0x46')]['id']){delete _0x5bc34e[_0x2a55('0x46')]['id'];}return db[_0x2a55('0x2a')][_0x2a55('0x45')]({'where':{'id':_0x5bc34e['params']['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x27cf3f,null))[_0x2a55('0x22')](saveUpdates(_0x5bc34e['body'],null))['then'](respondWithResult(_0x27cf3f,null))[_0x2a55('0x42')](handleError(_0x27cf3f,null));};exports['destroy']=function(_0x401f89,_0x17d783){return db[_0x2a55('0x2a')]['find']({'where':{'id':_0x401f89['params']['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x17d783,null))['then'](removeEntity(_0x17d783,null))[_0x2a55('0x42')](handleError(_0x17d783,null));};exports[_0x2a55('0x47')]=function(_0x918565,_0x2abe5,_0x14315f){var _0x51ac18={};var _0x5165d8={};var _0xa8d5bd;var _0x1b5e29;return db[_0x2a55('0x2a')]['findOne']({'where':{'id':_0x918565[_0x2a55('0x44')]['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x2abe5,null))[_0x2a55('0x22')](function(_0x4fe598){if(_0x4fe598){_0xa8d5bd=_0x4fe598;_0x5165d8[_0x2a55('0x2f')]=_[_0x2a55('0x30')](db[_0x2a55('0x48')][_0x2a55('0x2b')]);_0x5165d8[_0x2a55('0x31')]=_[_0x2a55('0x30')](_0x918565[_0x2a55('0x31')]);_0x5165d8[_0x2a55('0x32')]=_['intersection'](_0x5165d8[_0x2a55('0x2f')],_0x5165d8['query']);_0x51ac18[_0x2a55('0x33')]=_[_0x2a55('0x34')](_0x5165d8[_0x2a55('0x2f')],qs[_0x2a55('0x35')](_0x918565[_0x2a55('0x31')]['fields']));_0x51ac18['attributes']=_0x51ac18[_0x2a55('0x33')]['length']?_0x51ac18['attributes']:_0x5165d8[_0x2a55('0x2f')];_0x51ac18['order']=qs[_0x2a55('0x39')](_0x918565[_0x2a55('0x31')][_0x2a55('0x39')]);_0x51ac18[_0x2a55('0x3a')]=qs[_0x2a55('0x32')](_[_0x2a55('0x49')](_0x918565[_0x2a55('0x31')],_0x5165d8[_0x2a55('0x32')]));if(_0x918565['query'][_0x2a55('0x4a')]){_0x51ac18[_0x2a55('0x3a')]=_[_0x2a55('0x3c')](_0x51ac18['where'],{'$or':_[_0x2a55('0x29')](_0x51ac18[_0x2a55('0x33')],function(_0x5b8c70){var _0x5b1a83={};_0x5b1a83[_0x5b8c70]={'$like':'%'+_0x918565['query'][_0x2a55('0x4a')]+'%'};return _0x5b1a83;})});}_0x51ac18=_[_0x2a55('0x3c')]({},_0x51ac18,_0x918565[_0x2a55('0x3d')]);return _0xa8d5bd[_0x2a55('0x47')](_0x51ac18);}})[_0x2a55('0x22')](function(_0x59397c){if(_0x59397c){_0x1b5e29=_0x59397c[_0x2a55('0x36')];if(!_0x918565[_0x2a55('0x31')][_0x2a55('0x37')]('nolimit')){_0x51ac18[_0x2a55('0x1d')]=qs[_0x2a55('0x1d')](_0x918565['query'][_0x2a55('0x1d')]);_0x51ac18[_0x2a55('0x1b')]=qs[_0x2a55('0x1b')](_0x918565[_0x2a55('0x31')][_0x2a55('0x1b')]);}return _0xa8d5bd['getFields'](_0x51ac18);}})[_0x2a55('0x22')](function(_0x292cba){if(_0x292cba){return _0x292cba?{'count':_0x1b5e29,'rows':_0x292cba}:null;}})[_0x2a55('0x22')](respondWithResult(_0x2abe5,null))[_0x2a55('0x42')](handleError(_0x2abe5,null));};exports['getSubjects']=function(_0x219715,_0x4df232,_0x383175){var _0x2d07c5={};var _0x5f4aec={};var _0x1c179c;var _0xd0e35e;return db['ServicenowConfiguration'][_0x2a55('0x4b')]({'where':{'id':_0x219715[_0x2a55('0x44')]['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x4df232,null))['then'](function(_0x308f88){if(_0x308f88){_0x1c179c=_0x308f88;_0x5f4aec[_0x2a55('0x2f')]=_[_0x2a55('0x30')](db[_0x2a55('0x48')][_0x2a55('0x2b')]);_0x5f4aec[_0x2a55('0x31')]=_[_0x2a55('0x30')](_0x219715[_0x2a55('0x31')]);_0x5f4aec['filters']=_[_0x2a55('0x34')](_0x5f4aec['model'],_0x5f4aec[_0x2a55('0x31')]);_0x2d07c5['attributes']=_[_0x2a55('0x34')](_0x5f4aec[_0x2a55('0x2f')],qs['fields'](_0x219715[_0x2a55('0x31')]['fields']));_0x2d07c5['attributes']=_0x2d07c5[_0x2a55('0x33')][_0x2a55('0x36')]?_0x2d07c5[_0x2a55('0x33')]:_0x5f4aec[_0x2a55('0x2f')];_0x2d07c5[_0x2a55('0x4c')]=qs[_0x2a55('0x39')](_0x219715[_0x2a55('0x31')][_0x2a55('0x39')]);_0x2d07c5[_0x2a55('0x3a')]=qs[_0x2a55('0x32')](_[_0x2a55('0x49')](_0x219715[_0x2a55('0x31')],_0x5f4aec[_0x2a55('0x32')]));if(_0x219715[_0x2a55('0x31')][_0x2a55('0x4a')]){_0x2d07c5['where']=_['merge'](_0x2d07c5[_0x2a55('0x3a')],{'$or':_['map'](_0x2d07c5[_0x2a55('0x33')],function(_0x294777){var _0x75fbaf={};_0x75fbaf[_0x294777]={'$like':'%'+_0x219715[_0x2a55('0x31')]['filter']+'%'};return _0x75fbaf;})});}_0x2d07c5=_[_0x2a55('0x3c')]({},_0x2d07c5,_0x219715['options']);return _0x1c179c['getSubjects'](_0x2d07c5);}})[_0x2a55('0x22')](function(_0x491719){if(_0x491719){_0xd0e35e=_0x491719[_0x2a55('0x36')];if(!_0x219715[_0x2a55('0x31')][_0x2a55('0x37')](_0x2a55('0x38'))){_0x2d07c5[_0x2a55('0x1d')]=qs[_0x2a55('0x1d')](_0x219715['query'][_0x2a55('0x1d')]);_0x2d07c5[_0x2a55('0x1b')]=qs[_0x2a55('0x1b')](_0x219715[_0x2a55('0x31')][_0x2a55('0x1b')]);}return _0x1c179c[_0x2a55('0x4d')](_0x2d07c5);}})[_0x2a55('0x22')](function(_0x364c85){if(_0x364c85){return _0x364c85?{'count':_0xd0e35e,'rows':_0x364c85}:null;}})[_0x2a55('0x22')](respondWithResult(_0x4df232,null))['catch'](handleError(_0x4df232,null));};exports[_0x2a55('0x4e')]=function(_0x5c7312,_0x7a0809,_0x5883c7){var _0x214a12={};var _0x47507d={};var _0x218ebe;var _0x368bd3;return db[_0x2a55('0x2a')][_0x2a55('0x4b')]({'where':{'id':_0x5c7312[_0x2a55('0x44')]['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x7a0809,null))[_0x2a55('0x22')](function(_0x25bbb3){if(_0x25bbb3){_0x218ebe=_0x25bbb3;_0x47507d[_0x2a55('0x2f')]=_[_0x2a55('0x30')](db[_0x2a55('0x48')]['rawAttributes']);_0x47507d[_0x2a55('0x31')]=_[_0x2a55('0x30')](_0x5c7312[_0x2a55('0x31')]);_0x47507d['filters']=_[_0x2a55('0x34')](_0x47507d[_0x2a55('0x2f')],_0x47507d[_0x2a55('0x31')]);_0x214a12[_0x2a55('0x33')]=_[_0x2a55('0x34')](_0x47507d['model'],qs['fields'](_0x5c7312[_0x2a55('0x31')][_0x2a55('0x35')]));_0x214a12[_0x2a55('0x33')]=_0x214a12[_0x2a55('0x33')][_0x2a55('0x36')]?_0x214a12[_0x2a55('0x33')]:_0x47507d[_0x2a55('0x2f')];_0x214a12[_0x2a55('0x4c')]=qs[_0x2a55('0x39')](_0x5c7312[_0x2a55('0x31')][_0x2a55('0x39')]);_0x214a12[_0x2a55('0x3a')]=qs['filters'](_[_0x2a55('0x49')](_0x5c7312[_0x2a55('0x31')],_0x47507d[_0x2a55('0x32')]));if(_0x5c7312[_0x2a55('0x31')][_0x2a55('0x4a')]){_0x214a12[_0x2a55('0x3a')]=_[_0x2a55('0x3c')](_0x214a12[_0x2a55('0x3a')],{'$or':_[_0x2a55('0x29')](_0x214a12[_0x2a55('0x33')],function(_0x356a2b){var _0x4f7f78={};_0x4f7f78[_0x356a2b]={'$like':'%'+_0x5c7312[_0x2a55('0x31')][_0x2a55('0x4a')]+'%'};return _0x4f7f78;})});}_0x214a12=_[_0x2a55('0x3c')]({},_0x214a12,_0x5c7312[_0x2a55('0x3d')]);return _0x218ebe['getDescriptions'](_0x214a12);}})[_0x2a55('0x22')](function(_0x9df2f){if(_0x9df2f){_0x368bd3=_0x9df2f['length'];if(!_0x5c7312['query']['hasOwnProperty'](_0x2a55('0x38'))){_0x214a12[_0x2a55('0x1d')]=qs[_0x2a55('0x1d')](_0x5c7312[_0x2a55('0x31')][_0x2a55('0x1d')]);_0x214a12[_0x2a55('0x1b')]=qs[_0x2a55('0x1b')](_0x5c7312['query'][_0x2a55('0x1b')]);}return _0x218ebe['getDescriptions'](_0x214a12);}})['then'](function(_0x2c1444){if(_0x2c1444){return _0x2c1444?{'count':_0x368bd3,'rows':_0x2c1444}:null;}})[_0x2a55('0x22')](respondWithResult(_0x7a0809,null))[_0x2a55('0x42')](handleError(_0x7a0809,null));}; \ No newline at end of file +var _0x9ae6=['length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','catch','show','params','fields','includeAll','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes'];(function(_0xf5cf27,_0x184af9){var _0x29538e=function(_0x5e2676){while(--_0x5e2676){_0xf5cf27['push'](_0xf5cf27['shift']());}};_0x29538e(++_0x184af9);}(_0x9ae6,0x16c));var _0x69ae=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x9ae6[_0x146a97];return _0x259d5c;};'use strict';var emlformat=require(_0x69ae('0x0'));var rimraf=require(_0x69ae('0x1'));var zipdir=require(_0x69ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x69ae('0x3'));var BPromise=require(_0x69ae('0x4'));var Mustache=require('mustache');var util=require(_0x69ae('0x5'));var path=require(_0x69ae('0x6'));var sox=require(_0x69ae('0x7'));var csv=require(_0x69ae('0x8'));var ejs=require(_0x69ae('0x9'));var fs=require('fs');var fs_extra=require(_0x69ae('0xa'));var _=require(_0x69ae('0xb'));var squel=require(_0x69ae('0xc'));var crypto=require(_0x69ae('0xd'));var jsforce=require(_0x69ae('0xe'));var deskjs=require(_0x69ae('0xf'));var toCsv=require(_0x69ae('0x8'));var querystring=require(_0x69ae('0x10'));var Papa=require('papaparse');var Redis=require(_0x69ae('0x11'));var authService=require(_0x69ae('0x12'));var qs=require(_0x69ae('0x13'));var as=require(_0x69ae('0x14'));var hardwareService=require(_0x69ae('0x15'));var logger=require(_0x69ae('0x16'))(_0x69ae('0x17'));var utils=require(_0x69ae('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x69ae('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fb47f,_0x3c80f2){_0x3c80f2=_0x3c80f2||0xcc;return function(_0x362027){if(_0x362027){return _0x2fb47f[_0x69ae('0x1a')](_0x3c80f2);}return _0x2fb47f[_0x69ae('0x1b')](_0x3c80f2)[_0x69ae('0x1c')]();};}function respondWithResult(_0x47f207,_0x2547aa){_0x2547aa=_0x2547aa||0xc8;return function(_0x38350d){if(_0x38350d){return _0x47f207[_0x69ae('0x1b')](_0x2547aa)[_0x69ae('0x1d')](_0x38350d);}};}function respondWithFilteredResult(_0xa43c3d,_0x2f3bb0){return function(_0x435a52){if(_0x435a52){var _0xe0e6d2=typeof _0x2f3bb0[_0x69ae('0x1e')]==='undefined'&&typeof _0x2f3bb0[_0x69ae('0x1f')]===_0x69ae('0x20');var _0x4186b8=_0x435a52['count'];var _0x250da9=_0xe0e6d2?0x0:_0x2f3bb0[_0x69ae('0x1e')];var _0xedd2ff=_0xe0e6d2?_0x435a52[_0x69ae('0x21')]:_0x2f3bb0['offset']+_0x2f3bb0[_0x69ae('0x1f')];var _0x3d52c5;if(_0xedd2ff>=_0x4186b8){_0xedd2ff=_0x4186b8;_0x3d52c5=0xc8;}else{_0x3d52c5=0xce;}_0xa43c3d[_0x69ae('0x1b')](_0x3d52c5);return _0xa43c3d[_0x69ae('0x22')](_0x69ae('0x23'),_0x250da9+'-'+_0xedd2ff+'/'+_0x4186b8)[_0x69ae('0x1d')](_0x435a52);}return null;};}function patchUpdates(_0x21ed46){return function(_0x3a4348){try{jsonpatch[_0x69ae('0x24')](_0x3a4348,_0x21ed46,!![]);}catch(_0xcb849b){return BPromise['reject'](_0xcb849b);}return _0x3a4348[_0x69ae('0x25')]();};}function saveUpdates(_0x4f6068,_0x22721a){return function(_0x1aca91){if(_0x1aca91){return _0x1aca91[_0x69ae('0x26')](_0x4f6068)[_0x69ae('0x27')](function(_0x5404bd){return _0x5404bd;});}return null;};}function removeEntity(_0x1c608f,_0x18a1a2){return function(_0x2abd61){if(_0x2abd61){return _0x2abd61[_0x69ae('0x28')]()[_0x69ae('0x27')](function(){_0x1c608f[_0x69ae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551897,_0x591fe8){return function(_0x3d3305){if(!_0x3d3305){_0x551897[_0x69ae('0x1a')](0x194);}return _0x3d3305;};}function handleError(_0x3be398,_0x5de586){_0x5de586=_0x5de586||0x1f4;return function(_0x4fd150){logger[_0x69ae('0x29')](_0x4fd150[_0x69ae('0x2a')]);if(_0x4fd150[_0x69ae('0x2b')]){delete _0x4fd150[_0x69ae('0x2b')];}_0x3be398[_0x69ae('0x1b')](_0x5de586)[_0x69ae('0x2c')](_0x4fd150);};}exports[_0x69ae('0x2d')]=function(_0x211503,_0x1ca4e9){var _0x2cb59c={},_0x10bf82={},_0x3e6153={'count':0x0,'rows':[]};var _0x5da588=_['map'](db[_0x69ae('0x2e')][_0x69ae('0x2f')],function(_0x38d329){return{'name':_0x38d329[_0x69ae('0x30')],'type':_0x38d329[_0x69ae('0x31')][_0x69ae('0x32')]};});_0x10bf82['model']=_['map'](_0x5da588,'name');_0x10bf82['query']=_[_0x69ae('0x33')](_0x211503[_0x69ae('0x34')]);_0x10bf82['filters']=_[_0x69ae('0x35')](_0x10bf82[_0x69ae('0x36')],_0x10bf82[_0x69ae('0x34')]);_0x2cb59c[_0x69ae('0x37')]=_['intersection'](_0x10bf82[_0x69ae('0x36')],qs['fields'](_0x211503[_0x69ae('0x34')]['fields']));_0x2cb59c['attributes']=_0x2cb59c['attributes'][_0x69ae('0x38')]?_0x2cb59c['attributes']:_0x10bf82[_0x69ae('0x36')];if(!_0x211503[_0x69ae('0x34')][_0x69ae('0x39')](_0x69ae('0x3a'))){_0x2cb59c[_0x69ae('0x1f')]=qs[_0x69ae('0x1f')](_0x211503['query'][_0x69ae('0x1f')]);_0x2cb59c[_0x69ae('0x1e')]=qs[_0x69ae('0x1e')](_0x211503[_0x69ae('0x34')]['offset']);}_0x2cb59c[_0x69ae('0x3b')]=qs[_0x69ae('0x3c')](_0x211503[_0x69ae('0x34')][_0x69ae('0x3c')]);_0x2cb59c['where']=qs[_0x69ae('0x3d')](_[_0x69ae('0x3e')](_0x211503[_0x69ae('0x34')],_0x10bf82[_0x69ae('0x3d')]),_0x5da588);if(_0x211503['query'][_0x69ae('0x3f')]){_0x2cb59c[_0x69ae('0x40')]=_[_0x69ae('0x41')](_0x2cb59c[_0x69ae('0x40')],{'$or':_[_0x69ae('0x42')](_0x5da588,function(_0x545a3a){if(_0x545a3a[_0x69ae('0x31')]!==_0x69ae('0x43')){var _0x34027b={};_0x34027b[_0x545a3a['name']]={'$like':'%'+_0x211503[_0x69ae('0x34')][_0x69ae('0x3f')]+'%'};return _0x34027b;}})});}_0x2cb59c=_[_0x69ae('0x41')]({},_0x2cb59c,_0x211503[_0x69ae('0x44')]);var _0x54a26e={'where':_0x2cb59c[_0x69ae('0x40')]};return db['ServicenowConfiguration'][_0x69ae('0x21')](_0x54a26e)['then'](function(_0x58afd4){_0x3e6153[_0x69ae('0x21')]=_0x58afd4;if(_0x211503[_0x69ae('0x34')]['includeAll']){_0x2cb59c[_0x69ae('0x45')]=[{'all':!![]}];}return db[_0x69ae('0x2e')][_0x69ae('0x46')](_0x2cb59c);})[_0x69ae('0x27')](function(_0x3d0ffa){_0x3e6153['rows']=_0x3d0ffa;return _0x3e6153;})[_0x69ae('0x27')](respondWithFilteredResult(_0x1ca4e9,_0x2cb59c))[_0x69ae('0x47')](handleError(_0x1ca4e9,null));};exports[_0x69ae('0x48')]=function(_0x22d7ad,_0x4a59e4){var _0x33284a={'raw':![],'where':{'id':_0x22d7ad[_0x69ae('0x49')]['id']}},_0x2212a0={};_0x2212a0[_0x69ae('0x36')]=_[_0x69ae('0x33')](db['ServicenowConfiguration'][_0x69ae('0x2f')]);_0x2212a0['query']=_[_0x69ae('0x33')](_0x22d7ad[_0x69ae('0x34')]);_0x2212a0[_0x69ae('0x3d')]=_[_0x69ae('0x35')](_0x2212a0['model'],_0x2212a0['query']);_0x33284a[_0x69ae('0x37')]=_[_0x69ae('0x35')](_0x2212a0[_0x69ae('0x36')],qs[_0x69ae('0x4a')](_0x22d7ad['query'][_0x69ae('0x4a')]));_0x33284a['attributes']=_0x33284a['attributes'][_0x69ae('0x38')]?_0x33284a['attributes']:_0x2212a0[_0x69ae('0x36')];if(_0x22d7ad[_0x69ae('0x34')][_0x69ae('0x4b')]){_0x33284a[_0x69ae('0x45')]=[{'all':!![]}];}_0x33284a=_['merge']({},_0x33284a,_0x22d7ad[_0x69ae('0x44')]);return db[_0x69ae('0x2e')][_0x69ae('0x4c')](_0x33284a)[_0x69ae('0x27')](handleEntityNotFound(_0x4a59e4,null))[_0x69ae('0x27')](respondWithResult(_0x4a59e4,null))[_0x69ae('0x47')](handleError(_0x4a59e4,null));};exports['create']=function(_0x1e3b41,_0x22cc41){return db['ServicenowConfiguration'][_0x69ae('0x4d')](_0x1e3b41[_0x69ae('0x4e')],{})[_0x69ae('0x27')](respondWithResult(_0x22cc41,0xc9))[_0x69ae('0x47')](handleError(_0x22cc41,null));};exports[_0x69ae('0x26')]=function(_0x10a355,_0xee125b){if(_0x10a355[_0x69ae('0x4e')]['id']){delete _0x10a355[_0x69ae('0x4e')]['id'];}return db[_0x69ae('0x2e')][_0x69ae('0x4c')]({'where':{'id':_0x10a355[_0x69ae('0x49')]['id']}})[_0x69ae('0x27')](handleEntityNotFound(_0xee125b,null))[_0x69ae('0x27')](saveUpdates(_0x10a355[_0x69ae('0x4e')],null))[_0x69ae('0x27')](respondWithResult(_0xee125b,null))[_0x69ae('0x47')](handleError(_0xee125b,null));};exports[_0x69ae('0x28')]=function(_0x3aeb7a,_0x4bd056){return db[_0x69ae('0x2e')][_0x69ae('0x4c')]({'where':{'id':_0x3aeb7a[_0x69ae('0x49')]['id']}})[_0x69ae('0x27')](handleEntityNotFound(_0x4bd056,null))[_0x69ae('0x27')](removeEntity(_0x4bd056,null))[_0x69ae('0x47')](handleError(_0x4bd056,null));};exports[_0x69ae('0x4f')]=function(_0x43d916,_0x185596,_0x43c664){var _0x57ab32={};var _0x71c3a7={};var _0x2d5e56;var _0x47a9d0;return db['ServicenowConfiguration'][_0x69ae('0x50')]({'where':{'id':_0x43d916['params']['id']}})['then'](handleEntityNotFound(_0x185596,null))[_0x69ae('0x27')](function(_0x2ab753){if(_0x2ab753){_0x2d5e56=_0x2ab753;_0x71c3a7[_0x69ae('0x36')]=_[_0x69ae('0x33')](db[_0x69ae('0x51')][_0x69ae('0x2f')]);_0x71c3a7['query']=_[_0x69ae('0x33')](_0x43d916[_0x69ae('0x34')]);_0x71c3a7[_0x69ae('0x3d')]=_[_0x69ae('0x35')](_0x71c3a7[_0x69ae('0x36')],_0x71c3a7[_0x69ae('0x34')]);_0x57ab32[_0x69ae('0x37')]=_[_0x69ae('0x35')](_0x71c3a7['model'],qs[_0x69ae('0x4a')](_0x43d916[_0x69ae('0x34')][_0x69ae('0x4a')]));_0x57ab32[_0x69ae('0x37')]=_0x57ab32[_0x69ae('0x37')][_0x69ae('0x38')]?_0x57ab32[_0x69ae('0x37')]:_0x71c3a7[_0x69ae('0x36')];_0x57ab32[_0x69ae('0x3b')]=qs['sort'](_0x43d916['query']['sort']);_0x57ab32[_0x69ae('0x40')]=qs[_0x69ae('0x3d')](_['pick'](_0x43d916[_0x69ae('0x34')],_0x71c3a7[_0x69ae('0x3d')]));if(_0x43d916['query']['filter']){_0x57ab32[_0x69ae('0x40')]=_[_0x69ae('0x41')](_0x57ab32[_0x69ae('0x40')],{'$or':_[_0x69ae('0x42')](_0x57ab32[_0x69ae('0x37')],function(_0x82fd9a){var _0x115637={};_0x115637[_0x82fd9a]={'$like':'%'+_0x43d916[_0x69ae('0x34')][_0x69ae('0x3f')]+'%'};return _0x115637;})});}_0x57ab32=_['merge']({},_0x57ab32,_0x43d916[_0x69ae('0x44')]);return _0x2d5e56[_0x69ae('0x4f')](_0x57ab32);}})[_0x69ae('0x27')](function(_0x48e789){if(_0x48e789){_0x47a9d0=_0x48e789['length'];if(!_0x43d916[_0x69ae('0x34')][_0x69ae('0x39')](_0x69ae('0x3a'))){_0x57ab32[_0x69ae('0x1f')]=qs['limit'](_0x43d916['query'][_0x69ae('0x1f')]);_0x57ab32[_0x69ae('0x1e')]=qs['offset'](_0x43d916['query'][_0x69ae('0x1e')]);}return _0x2d5e56[_0x69ae('0x4f')](_0x57ab32);}})[_0x69ae('0x27')](function(_0x1de5b9){if(_0x1de5b9){return _0x1de5b9?{'count':_0x47a9d0,'rows':_0x1de5b9}:null;}})[_0x69ae('0x27')](respondWithResult(_0x185596,null))[_0x69ae('0x47')](handleError(_0x185596,null));};exports[_0x69ae('0x52')]=function(_0x2f8bb4,_0x1a92ce,_0x27b2ed){var _0x227d44={};var _0x4fbfc2={};var _0x64f361;var _0x1a576f;return db[_0x69ae('0x2e')][_0x69ae('0x50')]({'where':{'id':_0x2f8bb4[_0x69ae('0x49')]['id']}})[_0x69ae('0x27')](handleEntityNotFound(_0x1a92ce,null))[_0x69ae('0x27')](function(_0x9384e7){if(_0x9384e7){_0x64f361=_0x9384e7;_0x4fbfc2[_0x69ae('0x36')]=_[_0x69ae('0x33')](db[_0x69ae('0x51')][_0x69ae('0x2f')]);_0x4fbfc2[_0x69ae('0x34')]=_['keys'](_0x2f8bb4[_0x69ae('0x34')]);_0x4fbfc2['filters']=_[_0x69ae('0x35')](_0x4fbfc2[_0x69ae('0x36')],_0x4fbfc2[_0x69ae('0x34')]);_0x227d44[_0x69ae('0x37')]=_[_0x69ae('0x35')](_0x4fbfc2[_0x69ae('0x36')],qs[_0x69ae('0x4a')](_0x2f8bb4['query'][_0x69ae('0x4a')]));_0x227d44[_0x69ae('0x37')]=_0x227d44[_0x69ae('0x37')][_0x69ae('0x38')]?_0x227d44[_0x69ae('0x37')]:_0x4fbfc2['model'];_0x227d44[_0x69ae('0x3b')]=qs[_0x69ae('0x3c')](_0x2f8bb4[_0x69ae('0x34')][_0x69ae('0x3c')]);_0x227d44['where']=qs[_0x69ae('0x3d')](_['pick'](_0x2f8bb4[_0x69ae('0x34')],_0x4fbfc2[_0x69ae('0x3d')]));if(_0x2f8bb4[_0x69ae('0x34')][_0x69ae('0x3f')]){_0x227d44[_0x69ae('0x40')]=_[_0x69ae('0x41')](_0x227d44[_0x69ae('0x40')],{'$or':_[_0x69ae('0x42')](_0x227d44['attributes'],function(_0x49abfd){var _0x34651d={};_0x34651d[_0x49abfd]={'$like':'%'+_0x2f8bb4[_0x69ae('0x34')][_0x69ae('0x3f')]+'%'};return _0x34651d;})});}_0x227d44=_['merge']({},_0x227d44,_0x2f8bb4['options']);return _0x64f361['getSubjects'](_0x227d44);}})['then'](function(_0x3bfee7){if(_0x3bfee7){_0x1a576f=_0x3bfee7[_0x69ae('0x38')];if(!_0x2f8bb4[_0x69ae('0x34')][_0x69ae('0x39')](_0x69ae('0x3a'))){_0x227d44[_0x69ae('0x1f')]=qs[_0x69ae('0x1f')](_0x2f8bb4[_0x69ae('0x34')][_0x69ae('0x1f')]);_0x227d44['offset']=qs[_0x69ae('0x1e')](_0x2f8bb4['query']['offset']);}return _0x64f361[_0x69ae('0x52')](_0x227d44);}})['then'](function(_0x49f66f){if(_0x49f66f){return _0x49f66f?{'count':_0x1a576f,'rows':_0x49f66f}:null;}})[_0x69ae('0x27')](respondWithResult(_0x1a92ce,null))[_0x69ae('0x47')](handleError(_0x1a92ce,null));};exports[_0x69ae('0x53')]=function(_0xf07d47,_0x5c7625,_0x26ecee){var _0x4b4d8d={};var _0x7d5788={};var _0x2f644e;var _0x47171d;return db[_0x69ae('0x2e')][_0x69ae('0x50')]({'where':{'id':_0xf07d47[_0x69ae('0x49')]['id']}})[_0x69ae('0x27')](handleEntityNotFound(_0x5c7625,null))[_0x69ae('0x27')](function(_0x2d1396){if(_0x2d1396){_0x2f644e=_0x2d1396;_0x7d5788['model']=_[_0x69ae('0x33')](db[_0x69ae('0x51')][_0x69ae('0x2f')]);_0x7d5788['query']=_[_0x69ae('0x33')](_0xf07d47[_0x69ae('0x34')]);_0x7d5788['filters']=_[_0x69ae('0x35')](_0x7d5788[_0x69ae('0x36')],_0x7d5788[_0x69ae('0x34')]);_0x4b4d8d[_0x69ae('0x37')]=_['intersection'](_0x7d5788[_0x69ae('0x36')],qs[_0x69ae('0x4a')](_0xf07d47[_0x69ae('0x34')][_0x69ae('0x4a')]));_0x4b4d8d['attributes']=_0x4b4d8d[_0x69ae('0x37')][_0x69ae('0x38')]?_0x4b4d8d[_0x69ae('0x37')]:_0x7d5788[_0x69ae('0x36')];_0x4b4d8d[_0x69ae('0x3b')]=qs[_0x69ae('0x3c')](_0xf07d47[_0x69ae('0x34')][_0x69ae('0x3c')]);_0x4b4d8d[_0x69ae('0x40')]=qs[_0x69ae('0x3d')](_[_0x69ae('0x3e')](_0xf07d47[_0x69ae('0x34')],_0x7d5788[_0x69ae('0x3d')]));if(_0xf07d47[_0x69ae('0x34')][_0x69ae('0x3f')]){_0x4b4d8d[_0x69ae('0x40')]=_[_0x69ae('0x41')](_0x4b4d8d[_0x69ae('0x40')],{'$or':_['map'](_0x4b4d8d[_0x69ae('0x37')],function(_0x12fc65){var _0x480f90={};_0x480f90[_0x12fc65]={'$like':'%'+_0xf07d47['query']['filter']+'%'};return _0x480f90;})});}_0x4b4d8d=_[_0x69ae('0x41')]({},_0x4b4d8d,_0xf07d47['options']);return _0x2f644e[_0x69ae('0x53')](_0x4b4d8d);}})['then'](function(_0x262a4f){if(_0x262a4f){_0x47171d=_0x262a4f[_0x69ae('0x38')];if(!_0xf07d47['query'][_0x69ae('0x39')](_0x69ae('0x3a'))){_0x4b4d8d[_0x69ae('0x1f')]=qs[_0x69ae('0x1f')](_0xf07d47['query']['limit']);_0x4b4d8d[_0x69ae('0x1e')]=qs[_0x69ae('0x1e')](_0xf07d47['query'][_0x69ae('0x1e')]);}return _0x2f644e['getDescriptions'](_0x4b4d8d);}})[_0x69ae('0x27')](function(_0x1661bf){if(_0x1661bf){return _0x1661bf?{'count':_0x47171d,'rows':_0x1661bf}:null;}})[_0x69ae('0x27')](respondWithResult(_0x5c7625,null))['catch'](handleError(_0x5c7625,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 292614a..e4fd79b 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 _0x81fa=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x2ad514,_0x3a2088){var _0x4d4fa4=function(_0x319b44){while(--_0x319b44){_0x2ad514['push'](_0x2ad514['shift']());}};_0x4d4fa4(++_0x3a2088);}(_0x81fa,0xdd));var _0xa81f=function(_0x2e9d2c,_0x2e97ad){_0x2e9d2c=_0x2e9d2c-0x0;var _0x233caa=_0x81fa[_0x2e9d2c];return _0x233caa;};'use strict';var _=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var logger=require('../../config/logger')(_0xa81f('0x2'));var moment=require(_0xa81f('0x3'));var BPromise=require(_0xa81f('0x4'));var rp=require(_0xa81f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa81f('0x6'));var config=require(_0xa81f('0x7'));var attributes=require(_0xa81f('0x8'));module[_0xa81f('0x9')]=function(_0x1dc233,_0x158719){return _0x1dc233[_0xa81f('0xa')](_0xa81f('0xb'),attributes,{'tableName':_0xa81f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2964=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x2964,0x108));var _0x4296=function(_0x4fcc9f,_0x4d0877){_0x4fcc9f=_0x4fcc9f-0x0;var _0x46fd56=_0x2964[_0x4fcc9f];return _0x46fd56;};'use strict';var _=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var logger=require(_0x4296('0x2'))(_0x4296('0x3'));var moment=require(_0x4296('0x4'));var BPromise=require(_0x4296('0x5'));var rp=require(_0x4296('0x6'));var fs=require('fs');var path=require(_0x4296('0x7'));var rimraf=require(_0x4296('0x8'));var config=require('../../config/environment');var attributes=require(_0x4296('0x9'));module[_0x4296('0xa')]=function(_0x23dfb1,_0x10a454){return _0x23dfb1[_0x4296('0xb')](_0x4296('0xc'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 1dd537f..c876bb9 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 _0x9c94=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x9c94,0x99));var _0x49c9=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x9c94[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0x49c9('0x0'));var util=require(_0x49c9('0x1'));var moment=require('moment');var BPromise=require(_0x49c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49c9('0x3'));var db=require(_0x49c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c9('0x5'))(_0x49c9('0x6'));var config=require(_0x49c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x49c9('0x8')][_0x49c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d3e26,_0x50f3fb,_0x47758a){return new BPromise(function(_0x1cf938,_0x3eb9bf){return client[_0x49c9('0xa')](_0x7d3e26,_0x47758a)[_0x49c9('0xb')](function(_0x359ec1){logger[_0x49c9('0xc')](_0x49c9('0xd'),_0x50f3fb,_0x49c9('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x50f3fb,_0x49c9('0xe'),JSON[_0x49c9('0xf')](_0x359ec1));if(_0x359ec1[_0x49c9('0x10')]){if(_0x359ec1[_0x49c9('0x10')][_0x49c9('0x11')]===0x1f4){logger['error'](_0x49c9('0xd'),_0x50f3fb,_0x359ec1[_0x49c9('0x10')][_0x49c9('0x12')]);return _0x3eb9bf(_0x359ec1[_0x49c9('0x10')]['message']);}logger[_0x49c9('0x10')](_0x49c9('0xd'),_0x50f3fb,_0x359ec1[_0x49c9('0x10')][_0x49c9('0x12')]);return _0x1cf938(_0x359ec1['error']['message']);}else{logger['info'](_0x49c9('0xd'),_0x50f3fb,'request\x20sent');_0x1cf938(_0x359ec1[_0x49c9('0x13')][_0x49c9('0x12')]);}})[_0x49c9('0x14')](function(_0x10e5d0){logger[_0x49c9('0x10')](_0x49c9('0xd'),_0x50f3fb,_0x10e5d0);_0x3eb9bf(_0x10e5d0);});});} \ No newline at end of file +var _0x494e=['ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x168740,_0x2a96b5){var _0x303be3=function(_0x9615a6){while(--_0x9615a6){_0x168740['push'](_0x168740['shift']());}};_0x303be3(++_0x2a96b5);}(_0x494e,0xd6));var _0xe494=function(_0x5822bd,_0x4114fd){_0x5822bd=_0x5822bd-0x0;var _0xfc7ecd=_0x494e[_0x5822bd];return _0xfc7ecd;};'use strict';var _=require(_0xe494('0x0'));var util=require('util');var moment=require(_0xe494('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe494('0x2'));var db=require(_0xe494('0x3'))['db'];var utils=require(_0xe494('0x4'));var logger=require(_0xe494('0x5'))(_0xe494('0x6'));var config=require(_0xe494('0x7'));var jayson=require(_0xe494('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16773d,_0x298248,_0x7c1e3e){return new BPromise(function(_0x1c477d,_0x39bca1){return client[_0xe494('0x9')](_0x16773d,_0x7c1e3e)[_0xe494('0xa')](function(_0x58de64){logger[_0xe494('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x298248,'request\x20sent');logger[_0xe494('0xc')](_0xe494('0xd'),_0x298248,_0xe494('0xe'),JSON[_0xe494('0xf')](_0x58de64));if(_0x58de64['error']){if(_0x58de64['error']['code']===0x1f4){logger[_0xe494('0x10')](_0xe494('0x11'),_0x298248,_0x58de64[_0xe494('0x10')]['message']);return _0x39bca1(_0x58de64[_0xe494('0x10')][_0xe494('0x12')]);}logger[_0xe494('0x10')](_0xe494('0x11'),_0x298248,_0x58de64['error'][_0xe494('0x12')]);return _0x1c477d(_0x58de64['error']['message']);}else{logger[_0xe494('0xb')](_0xe494('0x11'),_0x298248,_0xe494('0xe'));_0x1c477d(_0x58de64[_0xe494('0x13')]['message']);}})[_0xe494('0x14')](function(_0x283602){logger[_0xe494('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x298248,_0x283602);_0x39bca1(_0x283602);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7a13d68..ce3d814 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 _0x975b=['/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index'];(function(_0x5df296,_0x515747){var _0x560d24=function(_0x1d48ba){while(--_0x1d48ba){_0x5df296['push'](_0x5df296['shift']());}};_0x560d24(++_0x515747);}(_0x975b,0x67));var _0xb975=function(_0x16d786,_0x23e957){_0x16d786=_0x16d786-0x0;var _0x422e2a=_0x975b[_0x16d786];return _0x422e2a;};'use strict';var multer=require(_0xb975('0x0'));var util=require('util');var path=require(_0xb975('0x1'));var timeout=require(_0xb975('0x2'));var express=require(_0xb975('0x3'));var router=express[_0xb975('0x4')]();var fs_extra=require(_0xb975('0x5'));var auth=require(_0xb975('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb975('0x7'));var controller=require(_0xb975('0x8'));router[_0xb975('0x9')]('/',auth['isAuthenticated'](),controller[_0xb975('0xa')]);router['get'](_0xb975('0xb'),auth[_0xb975('0xc')](),controller[_0xb975('0xd')]);router[_0xb975('0xe')]('/',auth['isAuthenticated'](),controller[_0xb975('0xf')]);router[_0xb975('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb975('0x11')]('/:id',auth[_0xb975('0xc')](),controller[_0xb975('0x12')]);module['exports']=router; \ No newline at end of file +var _0x68ce=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x68ce,0x1e5));var _0xe68c=function(_0x5c2748,_0x564960){_0x5c2748=_0x5c2748-0x0;var _0x59761d=_0x68ce[_0x5c2748];return _0x59761d;};'use strict';var multer=require(_0xe68c('0x0'));var util=require(_0xe68c('0x1'));var path=require(_0xe68c('0x2'));var timeout=require(_0xe68c('0x3'));var express=require(_0xe68c('0x4'));var router=express[_0xe68c('0x5')]();var fs_extra=require(_0xe68c('0x6'));var auth=require(_0xe68c('0x7'));var interaction=require(_0xe68c('0x8'));var config=require(_0xe68c('0x9'));var controller=require('./intServicenowField.controller');router[_0xe68c('0xa')]('/',auth[_0xe68c('0xb')](),controller['index']);router[_0xe68c('0xa')](_0xe68c('0xc'),auth[_0xe68c('0xb')](),controller[_0xe68c('0xd')]);router[_0xe68c('0xe')]('/',auth['isAuthenticated'](),controller[_0xe68c('0xf')]);router[_0xe68c('0x10')](_0xe68c('0xc'),auth[_0xe68c('0xb')](),controller[_0xe68c('0x11')]);router[_0xe68c('0x12')]('/:id',auth[_0xe68c('0xb')](),controller[_0xe68c('0x13')]);module[_0xe68c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 93ebcb2..6dcd678 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 _0x7f2b=['ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','exports'];(function(_0x2314b7,_0x1bea46){var _0x10d950=function(_0x4dc11c){while(--_0x4dc11c){_0x2314b7['push'](_0x2314b7['shift']());}};_0x10d950(++_0x1bea46);}(_0x7f2b,0x1ef));var _0xb7f2=function(_0x16aeda,_0x25c909){_0x16aeda=_0x16aeda-0x0;var _0x5c150f=_0x7f2b[_0x16aeda];return _0x5c150f;};'use strict';var Sequelize=require('sequelize');module[_0xb7f2('0x0')]={'type':{'type':Sequelize[_0xb7f2('0x1')]('string',_0xb7f2('0x2'),_0xb7f2('0x3'),_0xb7f2('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb7f2('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb7f2('0x1')](_0xb7f2('0x6'),_0xb7f2('0x2'),_0xb7f2('0x3'))},'keyContent':{'type':Sequelize[_0xb7f2('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb7f2('0x5')]},'customField':{'type':Sequelize[_0xb7f2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb7f2('0x5')]}}; \ No newline at end of file +var _0x2f07=['STRING','BOOLEAN','ENUM','variable','customVariable','picklist','string'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x2f07,0x121));var _0x72f0=function(_0xb52305,_0x5c2329){_0xb52305=_0xb52305-0x0;var _0x5dc8ed=_0x2f07[_0xb52305];return _0x5dc8ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x72f0('0x0')]('string',_0x72f0('0x1'),_0x72f0('0x2'),'keyValue',_0x72f0('0x3')),'defaultValue':_0x72f0('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x72f0('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x72f0('0x4'),_0x72f0('0x1'),_0x72f0('0x2'))},'keyContent':{'type':Sequelize[_0x72f0('0x5')]},'idField':{'type':Sequelize[_0x72f0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x72f0('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x72f0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 036a5c3..ef790be 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 _0x6375=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','ServicenowField','find','create','body','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x24d1c1,_0x365bf3){var _0x908781=function(_0x40eb3f){while(--_0x40eb3f){_0x24d1c1['push'](_0x24d1c1['shift']());}};_0x908781(++_0x365bf3);}(_0x6375,0x14a));var _0x5637=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x6375[_0x5235dd];return _0x13059d;};'use strict';var emlformat=require(_0x5637('0x0'));var rimraf=require(_0x5637('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5637('0x2'));var moment=require(_0x5637('0x3'));var BPromise=require(_0x5637('0x4'));var Mustache=require(_0x5637('0x5'));var util=require(_0x5637('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5637('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5637('0x8'));var _=require(_0x5637('0x9'));var squel=require(_0x5637('0xa'));var crypto=require(_0x5637('0xb'));var jsforce=require(_0x5637('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5637('0xd'));var Papa=require(_0x5637('0xe'));var Redis=require('ioredis');var authService=require(_0x5637('0xf'));var qs=require(_0x5637('0x10'));var as=require(_0x5637('0x11'));var hardwareService=require(_0x5637('0x12'));var logger=require(_0x5637('0x13'))(_0x5637('0x14'));var utils=require(_0x5637('0x15'));var config=require(_0x5637('0x16'));var licenseUtil=require(_0x5637('0x17'));var db=require(_0x5637('0x18'))['db'];function respondWithStatusCode(_0x59b020,_0x1cb7a3){_0x1cb7a3=_0x1cb7a3||0xcc;return function(_0x2ed2dc){if(_0x2ed2dc){return _0x59b020['sendStatus'](_0x1cb7a3);}return _0x59b020['status'](_0x1cb7a3)[_0x5637('0x19')]();};}function respondWithResult(_0x4b9919,_0x1f434a){_0x1f434a=_0x1f434a||0xc8;return function(_0x3c8e05){if(_0x3c8e05){return _0x4b9919[_0x5637('0x1a')](_0x1f434a)['json'](_0x3c8e05);}};}function respondWithFilteredResult(_0x51a352,_0x531229){return function(_0x114237){if(_0x114237){var _0x3600ca=typeof _0x531229[_0x5637('0x1b')]===_0x5637('0x1c')&&typeof _0x531229[_0x5637('0x1d')]===_0x5637('0x1c');var _0x33216f=_0x114237[_0x5637('0x1e')];var _0x51d44b=_0x3600ca?0x0:_0x531229[_0x5637('0x1b')];var _0x452d33=_0x3600ca?_0x114237[_0x5637('0x1e')]:_0x531229[_0x5637('0x1b')]+_0x531229['limit'];var _0x109a4b;if(_0x452d33>=_0x33216f){_0x452d33=_0x33216f;_0x109a4b=0xc8;}else{_0x109a4b=0xce;}_0x51a352[_0x5637('0x1a')](_0x109a4b);return _0x51a352[_0x5637('0x1f')](_0x5637('0x20'),_0x51d44b+'-'+_0x452d33+'/'+_0x33216f)[_0x5637('0x21')](_0x114237);}return null;};}function patchUpdates(_0xfd17f0){return function(_0x28fff8){try{jsonpatch['apply'](_0x28fff8,_0xfd17f0,!![]);}catch(_0x2796a0){return BPromise[_0x5637('0x22')](_0x2796a0);}return _0x28fff8[_0x5637('0x23')]();};}function saveUpdates(_0x826112,_0x4ff6d9){return function(_0x4a4252){if(_0x4a4252){return _0x4a4252[_0x5637('0x24')](_0x826112)[_0x5637('0x25')](function(_0x3159a3){return _0x3159a3;});}return null;};}function removeEntity(_0x2b8c3b,_0x2a3df8){return function(_0xe1b36b){if(_0xe1b36b){return _0xe1b36b['destroy']()[_0x5637('0x25')](function(){_0x2b8c3b[_0x5637('0x1a')](0xcc)[_0x5637('0x19')]();});}};}function handleEntityNotFound(_0x4b2246,_0x20c83a){return function(_0x3cdc94){if(!_0x3cdc94){_0x4b2246[_0x5637('0x26')](0x194);}return _0x3cdc94;};}function handleError(_0x56e70a,_0x246888){_0x246888=_0x246888||0x1f4;return function(_0x46fb91){logger['error'](_0x46fb91['stack']);if(_0x46fb91[_0x5637('0x27')]){delete _0x46fb91['name'];}_0x56e70a['status'](_0x246888)[_0x5637('0x28')](_0x46fb91);};}exports[_0x5637('0x29')]=function(_0xbeb7f3,_0x178dbb){var _0x191883={},_0x543eb8={},_0x55f816={'count':0x0,'rows':[]};var _0x25a973=_['map'](db['ServicenowField'][_0x5637('0x2a')],function(_0x5da476){return{'name':_0x5da476[_0x5637('0x2b')],'type':_0x5da476[_0x5637('0x2c')][_0x5637('0x2d')]};});_0x543eb8[_0x5637('0x2e')]=_['map'](_0x25a973,'name');_0x543eb8[_0x5637('0x2f')]=_[_0x5637('0x30')](_0xbeb7f3[_0x5637('0x2f')]);_0x543eb8[_0x5637('0x31')]=_[_0x5637('0x32')](_0x543eb8['model'],_0x543eb8[_0x5637('0x2f')]);_0x191883['attributes']=_[_0x5637('0x32')](_0x543eb8[_0x5637('0x2e')],qs[_0x5637('0x33')](_0xbeb7f3[_0x5637('0x2f')][_0x5637('0x33')]));_0x191883[_0x5637('0x34')]=_0x191883[_0x5637('0x34')][_0x5637('0x35')]?_0x191883[_0x5637('0x34')]:_0x543eb8[_0x5637('0x2e')];if(!_0xbeb7f3[_0x5637('0x2f')][_0x5637('0x36')](_0x5637('0x37'))){_0x191883[_0x5637('0x1d')]=qs[_0x5637('0x1d')](_0xbeb7f3['query'][_0x5637('0x1d')]);_0x191883[_0x5637('0x1b')]=qs[_0x5637('0x1b')](_0xbeb7f3['query'][_0x5637('0x1b')]);}_0x191883[_0x5637('0x38')]=qs[_0x5637('0x39')](_0xbeb7f3[_0x5637('0x2f')][_0x5637('0x39')]);_0x191883[_0x5637('0x3a')]=qs['filters'](_[_0x5637('0x3b')](_0xbeb7f3[_0x5637('0x2f')],_0x543eb8['filters']),_0x25a973);if(_0xbeb7f3[_0x5637('0x2f')]['filter']){_0x191883[_0x5637('0x3a')]=_[_0x5637('0x3c')](_0x191883[_0x5637('0x3a')],{'$or':_[_0x5637('0x3d')](_0x25a973,function(_0x4cebd6){if(_0x4cebd6['type']!=='VIRTUAL'){var _0x4f0043={};_0x4f0043[_0x4cebd6['name']]={'$like':'%'+_0xbeb7f3[_0x5637('0x2f')][_0x5637('0x3e')]+'%'};return _0x4f0043;}})});}_0x191883=_['merge']({},_0x191883,_0xbeb7f3[_0x5637('0x3f')]);var _0x18c6dd={'where':_0x191883['where']};return db['ServicenowField']['count'](_0x18c6dd)['then'](function(_0x4ff348){_0x55f816[_0x5637('0x1e')]=_0x4ff348;if(_0xbeb7f3['query'][_0x5637('0x40')]){_0x191883[_0x5637('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0x5637('0x42')](_0x191883);})['then'](function(_0x1b8a84){_0x55f816[_0x5637('0x43')]=_0x1b8a84;return _0x55f816;})[_0x5637('0x25')](respondWithFilteredResult(_0x178dbb,_0x191883))[_0x5637('0x44')](handleError(_0x178dbb,null));};exports[_0x5637('0x45')]=function(_0x22bb06,_0x1496b5){var _0x4854d4={'raw':!![],'where':{'id':_0x22bb06['params']['id']}},_0x55751e={};_0x55751e['model']=_[_0x5637('0x30')](db[_0x5637('0x46')][_0x5637('0x2a')]);_0x55751e['query']=_[_0x5637('0x30')](_0x22bb06['query']);_0x55751e[_0x5637('0x31')]=_[_0x5637('0x32')](_0x55751e[_0x5637('0x2e')],_0x55751e[_0x5637('0x2f')]);_0x4854d4[_0x5637('0x34')]=_[_0x5637('0x32')](_0x55751e[_0x5637('0x2e')],qs[_0x5637('0x33')](_0x22bb06['query'][_0x5637('0x33')]));_0x4854d4['attributes']=_0x4854d4[_0x5637('0x34')][_0x5637('0x35')]?_0x4854d4[_0x5637('0x34')]:_0x55751e[_0x5637('0x2e')];if(_0x22bb06[_0x5637('0x2f')][_0x5637('0x40')]){_0x4854d4[_0x5637('0x41')]=[{'all':!![]}];}_0x4854d4=_[_0x5637('0x3c')]({},_0x4854d4,_0x22bb06[_0x5637('0x3f')]);return db[_0x5637('0x46')][_0x5637('0x47')](_0x4854d4)[_0x5637('0x25')](handleEntityNotFound(_0x1496b5,null))[_0x5637('0x25')](respondWithResult(_0x1496b5,null))[_0x5637('0x44')](handleError(_0x1496b5,null));};exports['create']=function(_0x3f73d9,_0x21991a){return db[_0x5637('0x46')][_0x5637('0x48')](_0x3f73d9[_0x5637('0x49')],{})[_0x5637('0x25')](respondWithResult(_0x21991a,0xc9))[_0x5637('0x44')](handleError(_0x21991a,null));};exports[_0x5637('0x24')]=function(_0x19653f,_0x19d09f){if(_0x19653f[_0x5637('0x49')]['id']){delete _0x19653f[_0x5637('0x49')]['id'];}return db[_0x5637('0x46')][_0x5637('0x47')]({'where':{'id':_0x19653f[_0x5637('0x4a')]['id']}})[_0x5637('0x25')](handleEntityNotFound(_0x19d09f,null))['then'](saveUpdates(_0x19653f['body'],null))[_0x5637('0x25')](respondWithResult(_0x19d09f,null))[_0x5637('0x44')](handleError(_0x19d09f,null));};exports[_0x5637('0x4b')]=function(_0x1766ef,_0x4cb1e1){return db['ServicenowField'][_0x5637('0x47')]({'where':{'id':_0x1766ef[_0x5637('0x4a')]['id']}})[_0x5637('0x25')](handleEntityNotFound(_0x4cb1e1,null))[_0x5637('0x25')](removeEntity(_0x4cb1e1,null))[_0x5637('0x44')](handleError(_0x4cb1e1,null));}; \ No newline at end of file +var _0x4777=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','update','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x39d38e,_0x3da1f7){var _0x18e737=function(_0x373eef){while(--_0x373eef){_0x39d38e['push'](_0x39d38e['shift']());}};_0x18e737(++_0x3da1f7);}(_0x4777,0x170));var _0x7477=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x4777[_0x30a31e];return _0x170879;};'use strict';var emlformat=require(_0x7477('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7477('0x1'));var rp=require(_0x7477('0x2'));var moment=require(_0x7477('0x3'));var BPromise=require(_0x7477('0x4'));var Mustache=require(_0x7477('0x5'));var util=require(_0x7477('0x6'));var path=require(_0x7477('0x7'));var sox=require(_0x7477('0x8'));var csv=require(_0x7477('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7477('0xa'));var _=require(_0x7477('0xb'));var squel=require(_0x7477('0xc'));var crypto=require(_0x7477('0xd'));var jsforce=require(_0x7477('0xe'));var deskjs=require(_0x7477('0xf'));var toCsv=require(_0x7477('0x9'));var querystring=require(_0x7477('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7477('0x11'));var qs=require(_0x7477('0x12'));var as=require(_0x7477('0x13'));var hardwareService=require(_0x7477('0x14'));var logger=require(_0x7477('0x15'))(_0x7477('0x16'));var utils=require(_0x7477('0x17'));var config=require(_0x7477('0x18'));var licenseUtil=require(_0x7477('0x19'));var db=require(_0x7477('0x1a'))['db'];function respondWithStatusCode(_0x36c05f,_0x15fa95){_0x15fa95=_0x15fa95||0xcc;return function(_0x576d97){if(_0x576d97){return _0x36c05f[_0x7477('0x1b')](_0x15fa95);}return _0x36c05f[_0x7477('0x1c')](_0x15fa95)[_0x7477('0x1d')]();};}function respondWithResult(_0x1b2052,_0x558c00){_0x558c00=_0x558c00||0xc8;return function(_0x39fe4e){if(_0x39fe4e){return _0x1b2052['status'](_0x558c00)[_0x7477('0x1e')](_0x39fe4e);}};}function respondWithFilteredResult(_0x22202d,_0x30265d){return function(_0x2c641d){if(_0x2c641d){var _0x307365=typeof _0x30265d[_0x7477('0x1f')]===_0x7477('0x20')&&typeof _0x30265d[_0x7477('0x21')]===_0x7477('0x20');var _0x17b565=_0x2c641d[_0x7477('0x22')];var _0x369e60=_0x307365?0x0:_0x30265d[_0x7477('0x1f')];var _0xfe4320=_0x307365?_0x2c641d[_0x7477('0x22')]:_0x30265d['offset']+_0x30265d[_0x7477('0x21')];var _0x339a8a;if(_0xfe4320>=_0x17b565){_0xfe4320=_0x17b565;_0x339a8a=0xc8;}else{_0x339a8a=0xce;}_0x22202d[_0x7477('0x1c')](_0x339a8a);return _0x22202d[_0x7477('0x23')](_0x7477('0x24'),_0x369e60+'-'+_0xfe4320+'/'+_0x17b565)[_0x7477('0x1e')](_0x2c641d);}return null;};}function patchUpdates(_0x16bfe7){return function(_0x4d3ab7){try{jsonpatch['apply'](_0x4d3ab7,_0x16bfe7,!![]);}catch(_0x599fbd){return BPromise['reject'](_0x599fbd);}return _0x4d3ab7[_0x7477('0x25')]();};}function saveUpdates(_0x56f584,_0x298bc5){return function(_0x330325){if(_0x330325){return _0x330325['update'](_0x56f584)[_0x7477('0x26')](function(_0x52174a){return _0x52174a;});}return null;};}function removeEntity(_0x16bed7,_0x3937fa){return function(_0x26a6be){if(_0x26a6be){return _0x26a6be[_0x7477('0x27')]()[_0x7477('0x26')](function(){_0x16bed7[_0x7477('0x1c')](0xcc)[_0x7477('0x1d')]();});}};}function handleEntityNotFound(_0x2a9f3e,_0x20e66f){return function(_0x2a49e8){if(!_0x2a49e8){_0x2a9f3e[_0x7477('0x1b')](0x194);}return _0x2a49e8;};}function handleError(_0x45e9b8,_0x2ae360){_0x2ae360=_0x2ae360||0x1f4;return function(_0x74113a){logger['error'](_0x74113a[_0x7477('0x28')]);if(_0x74113a['name']){delete _0x74113a[_0x7477('0x29')];}_0x45e9b8[_0x7477('0x1c')](_0x2ae360)[_0x7477('0x2a')](_0x74113a);};}exports[_0x7477('0x2b')]=function(_0x5079ea,_0x4fccfc){var _0x486a13={},_0x1357a2={},_0x17d276={'count':0x0,'rows':[]};var _0x203838=_[_0x7477('0x2c')](db[_0x7477('0x2d')][_0x7477('0x2e')],function(_0x1e0a7a){return{'name':_0x1e0a7a[_0x7477('0x2f')],'type':_0x1e0a7a[_0x7477('0x30')]['key']};});_0x1357a2[_0x7477('0x31')]=_['map'](_0x203838,_0x7477('0x29'));_0x1357a2[_0x7477('0x32')]=_['keys'](_0x5079ea[_0x7477('0x32')]);_0x1357a2['filters']=_[_0x7477('0x33')](_0x1357a2[_0x7477('0x31')],_0x1357a2[_0x7477('0x32')]);_0x486a13['attributes']=_[_0x7477('0x33')](_0x1357a2[_0x7477('0x31')],qs[_0x7477('0x34')](_0x5079ea[_0x7477('0x32')][_0x7477('0x34')]));_0x486a13[_0x7477('0x35')]=_0x486a13[_0x7477('0x35')][_0x7477('0x36')]?_0x486a13[_0x7477('0x35')]:_0x1357a2[_0x7477('0x31')];if(!_0x5079ea[_0x7477('0x32')]['hasOwnProperty'](_0x7477('0x37'))){_0x486a13[_0x7477('0x21')]=qs[_0x7477('0x21')](_0x5079ea['query'][_0x7477('0x21')]);_0x486a13[_0x7477('0x1f')]=qs[_0x7477('0x1f')](_0x5079ea[_0x7477('0x32')][_0x7477('0x1f')]);}_0x486a13[_0x7477('0x38')]=qs['sort'](_0x5079ea[_0x7477('0x32')][_0x7477('0x39')]);_0x486a13[_0x7477('0x3a')]=qs[_0x7477('0x3b')](_[_0x7477('0x3c')](_0x5079ea[_0x7477('0x32')],_0x1357a2['filters']),_0x203838);if(_0x5079ea[_0x7477('0x32')][_0x7477('0x3d')]){_0x486a13[_0x7477('0x3a')]=_['merge'](_0x486a13['where'],{'$or':_[_0x7477('0x2c')](_0x203838,function(_0x2aae46){if(_0x2aae46[_0x7477('0x30')]!==_0x7477('0x3e')){var _0x22cc0a={};_0x22cc0a[_0x2aae46[_0x7477('0x29')]]={'$like':'%'+_0x5079ea[_0x7477('0x32')][_0x7477('0x3d')]+'%'};return _0x22cc0a;}})});}_0x486a13=_['merge']({},_0x486a13,_0x5079ea[_0x7477('0x3f')]);var _0x334bcf={'where':_0x486a13['where']};return db[_0x7477('0x2d')][_0x7477('0x22')](_0x334bcf)[_0x7477('0x26')](function(_0x1bee75){_0x17d276['count']=_0x1bee75;if(_0x5079ea['query'][_0x7477('0x40')]){_0x486a13[_0x7477('0x41')]=[{'all':!![]}];}return db[_0x7477('0x2d')][_0x7477('0x42')](_0x486a13);})[_0x7477('0x26')](function(_0x1dd3df){_0x17d276[_0x7477('0x43')]=_0x1dd3df;return _0x17d276;})['then'](respondWithFilteredResult(_0x4fccfc,_0x486a13))[_0x7477('0x44')](handleError(_0x4fccfc,null));};exports[_0x7477('0x45')]=function(_0x42ebec,_0x1a2dc6){var _0xf1d7ae={'raw':!![],'where':{'id':_0x42ebec['params']['id']}},_0x3466b0={};_0x3466b0[_0x7477('0x31')]=_[_0x7477('0x46')](db['ServicenowField'][_0x7477('0x2e')]);_0x3466b0[_0x7477('0x32')]=_['keys'](_0x42ebec['query']);_0x3466b0[_0x7477('0x3b')]=_[_0x7477('0x33')](_0x3466b0[_0x7477('0x31')],_0x3466b0[_0x7477('0x32')]);_0xf1d7ae[_0x7477('0x35')]=_['intersection'](_0x3466b0[_0x7477('0x31')],qs[_0x7477('0x34')](_0x42ebec[_0x7477('0x32')][_0x7477('0x34')]));_0xf1d7ae[_0x7477('0x35')]=_0xf1d7ae[_0x7477('0x35')][_0x7477('0x36')]?_0xf1d7ae['attributes']:_0x3466b0[_0x7477('0x31')];if(_0x42ebec['query']['includeAll']){_0xf1d7ae[_0x7477('0x41')]=[{'all':!![]}];}_0xf1d7ae=_[_0x7477('0x47')]({},_0xf1d7ae,_0x42ebec[_0x7477('0x3f')]);return db['ServicenowField'][_0x7477('0x48')](_0xf1d7ae)[_0x7477('0x26')](handleEntityNotFound(_0x1a2dc6,null))['then'](respondWithResult(_0x1a2dc6,null))[_0x7477('0x44')](handleError(_0x1a2dc6,null));};exports[_0x7477('0x49')]=function(_0x50a798,_0x1a236b){return db[_0x7477('0x2d')][_0x7477('0x49')](_0x50a798[_0x7477('0x4a')],{})[_0x7477('0x26')](respondWithResult(_0x1a236b,0xc9))[_0x7477('0x44')](handleError(_0x1a236b,null));};exports[_0x7477('0x4b')]=function(_0x32f190,_0x20545b){if(_0x32f190['body']['id']){delete _0x32f190[_0x7477('0x4a')]['id'];}return db['ServicenowField'][_0x7477('0x48')]({'where':{'id':_0x32f190['params']['id']}})[_0x7477('0x26')](handleEntityNotFound(_0x20545b,null))[_0x7477('0x26')](saveUpdates(_0x32f190['body'],null))['then'](respondWithResult(_0x20545b,null))[_0x7477('0x44')](handleError(_0x20545b,null));};exports[_0x7477('0x27')]=function(_0x2c1f28,_0x25d024){return db[_0x7477('0x2d')][_0x7477('0x48')]({'where':{'id':_0x2c1f28[_0x7477('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25d024,null))[_0x7477('0x26')](removeEntity(_0x25d024,null))[_0x7477('0x44')](handleError(_0x25d024,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d1cbffc..b0e604d 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 _0x4a67=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','util','moment','bluebird','path','rimraf'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x4a67,0x145));var _0x74a6=function(_0x5d741a,_0x5c0848){_0x5d741a=_0x5d741a-0x0;var _0x1a9fde=_0x4a67[_0x5d741a];return _0x1a9fde;};'use strict';var _=require('lodash');var util=require(_0x74a6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x74a6('0x1'));var BPromise=require(_0x74a6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74a6('0x3'));var rimraf=require(_0x74a6('0x4'));var config=require(_0x74a6('0x5'));var attributes=require(_0x74a6('0x6'));module[_0x74a6('0x7')]=function(_0x5ef6cc,_0x2ae12d){return _0x5ef6cc[_0x74a6('0x8')](_0x74a6('0x9'),attributes,{'tableName':_0x74a6('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39e6=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x39e6,0xee));var _0x639e=function(_0x242460,_0x1ddfba){_0x242460=_0x242460-0x0;var _0x38e869=_0x39e6[_0x242460];return _0x38e869;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x639e('0x0'));var BPromise=require(_0x639e('0x1'));var rp=require(_0x639e('0x2'));var fs=require('fs');var path=require(_0x639e('0x3'));var rimraf=require('rimraf');var config=require(_0x639e('0x4'));var attributes=require(_0x639e('0x5'));module[_0x639e('0x6')]=function(_0x24e694,_0x48818f){return _0x24e694[_0x639e('0x7')](_0x639e('0x8'),attributes,{'tableName':_0x639e('0x9'),'paranoid':![],'indexes':[{'name':_0x639e('0xa'),'fields':[_0x639e('0xb'),_0x639e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 8f59ce4..46ba500 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0xbdb7[_0x543c51];return _0x360555;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5b3044,_0x5dbd51){var _0x4896d5=function(_0x1b1c79){while(--_0x1b1c79){_0x5b3044['push'](_0x5b3044['shift']());}};_0x4896d5(++_0x5dbd51);}(_0xaa88,0x137));var _0x8aa8=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xaa88[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index fd4c363..c651b1e 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x335204,_0x55bcc1){var _0xff11b9=function(_0x251b57){while(--_0x251b57){_0x335204['push'](_0x335204['shift']());}};_0xff11b9(++_0x55bcc1);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x453b31,_0x2a2aec){var _0x4569af=function(_0x37e721){while(--_0x37e721){_0x453b31['push'](_0x453b31['shift']());}};_0x4569af(++_0x2a2aec);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 eacc7e8..a4ed038 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(_0xed76ce,_0x57600e){var _0x49a9d3=function(_0x199705){while(--_0x199705){_0xed76ce['push'](_0xed76ce['shift']());}};_0x49a9d3(++_0x57600e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x57ed2c,_0x56ebf5){var _0x3d4e39=function(_0x3ce8f3){while(--_0x3ce8f3){_0x57ed2c['push'](_0x57ed2c['shift']());}};_0x3d4e39(++_0x56ebf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 c41c7d2..a551eb0 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 _0x7047=['AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_name','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','stringify','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','json','apply','reject','update','then','destroy','sendStatus','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','name','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','intersection','merge','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7047,0xa7));var _0x7704=function(_0x86597f,_0x5dc3b3){_0x86597f=_0x86597f-0x0;var _0x1f4e98=_0x7047[_0x86597f];return _0x1f4e98;};'use strict';var emlformat=require(_0x7704('0x0'));var rimraf=require(_0x7704('0x1'));var zipdir=require(_0x7704('0x2'));var jsonpatch=require(_0x7704('0x3'));var rp=require(_0x7704('0x4'));var moment=require(_0x7704('0x5'));var BPromise=require(_0x7704('0x6'));var Mustache=require(_0x7704('0x7'));var util=require(_0x7704('0x8'));var path=require(_0x7704('0x9'));var sox=require(_0x7704('0xa'));var csv=require('to-csv');var ejs=require(_0x7704('0xb'));var fs=require('fs');var fs_extra=require(_0x7704('0xc'));var _=require(_0x7704('0xd'));var squel=require(_0x7704('0xe'));var crypto=require(_0x7704('0xf'));var jsforce=require(_0x7704('0x10'));var deskjs=require(_0x7704('0x11'));var toCsv=require(_0x7704('0x12'));var querystring=require(_0x7704('0x13'));var Papa=require(_0x7704('0x14'));var Redis=require('ioredis');var authService=require(_0x7704('0x15'));var qs=require(_0x7704('0x16'));var as=require(_0x7704('0x17'));var hardwareService=require(_0x7704('0x18'));var logger=require('../../config/logger')(_0x7704('0x19'));var utils=require(_0x7704('0x1a'));var config=require(_0x7704('0x1b'));var licenseUtil=require(_0x7704('0x1c'));var db=require(_0x7704('0x1d'))['db'];var integrations=require(_0x7704('0x1e'));function respondWithStatusCode(_0x47b296,_0x229a8e){_0x229a8e=_0x229a8e||0xcc;return function(_0x87a11e){if(_0x87a11e){return _0x47b296['sendStatus'](_0x229a8e);}return _0x47b296[_0x7704('0x1f')](_0x229a8e)[_0x7704('0x20')]();};}function respondWithResult(_0x1acd60,_0x828887){_0x828887=_0x828887||0xc8;return function(_0x383c2d){if(_0x383c2d){return _0x1acd60['status'](_0x828887)['json'](_0x383c2d);}};}function respondWithFilteredResult(_0xbd58dd,_0xb4e037){return function(_0x2c8d32){if(_0x2c8d32){var _0x270e73=typeof _0xb4e037['offset']===_0x7704('0x21')&&typeof _0xb4e037['limit']===_0x7704('0x21');var _0x348a39=_0x2c8d32[_0x7704('0x22')];var _0x2ac789=_0x270e73?0x0:_0xb4e037[_0x7704('0x23')];var _0x85b8f8=_0x270e73?_0x2c8d32['count']:_0xb4e037['offset']+_0xb4e037[_0x7704('0x24')];var _0x486fd0;if(_0x85b8f8>=_0x348a39){_0x85b8f8=_0x348a39;_0x486fd0=0xc8;}else{_0x486fd0=0xce;}_0xbd58dd[_0x7704('0x1f')](_0x486fd0);return _0xbd58dd[_0x7704('0x25')]('Content-Range',_0x2ac789+'-'+_0x85b8f8+'/'+_0x348a39)[_0x7704('0x26')](_0x2c8d32);}return null;};}function patchUpdates(_0x39681f){return function(_0x2ce068){try{jsonpatch[_0x7704('0x27')](_0x2ce068,_0x39681f,!![]);}catch(_0x23c182){return BPromise[_0x7704('0x28')](_0x23c182);}return _0x2ce068['save']();};}function saveUpdates(_0xc6c23f,_0x52f093){return function(_0x2d38cb){if(_0x2d38cb){return _0x2d38cb[_0x7704('0x29')](_0xc6c23f)[_0x7704('0x2a')](function(_0xda2a7e){return _0xda2a7e;});}return null;};}function removeEntity(_0x16dfd9,_0x1b9cc0){return function(_0x2c73b3){if(_0x2c73b3){return _0x2c73b3[_0x7704('0x2b')]()[_0x7704('0x2a')](function(){_0x16dfd9[_0x7704('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a497a,_0x56e2ac){return function(_0x3e6390){if(!_0x3e6390){_0x3a497a[_0x7704('0x2c')](0x194);}return _0x3e6390;};}function handleError(_0x3ac7c6,_0x956ffc){_0x956ffc=_0x956ffc||0x1f4;return function(_0x19701a){logger['error'](_0x19701a['stack']);if(_0x19701a['name']){delete _0x19701a['name'];}_0x3ac7c6[_0x7704('0x1f')](_0x956ffc)[_0x7704('0x2d')](_0x19701a);};}exports['index']=function(_0x2c6aec,_0x4769e2){var _0x2d9673={},_0x33eff9={},_0x211a7d={'count':0x0,'rows':[]};var _0x57620c=_[_0x7704('0x2e')](db['SugarcrmAccount'][_0x7704('0x2f')],function(_0x1f807c){return{'name':_0x1f807c[_0x7704('0x30')],'type':_0x1f807c['type'][_0x7704('0x31')]};});_0x33eff9[_0x7704('0x32')]=_[_0x7704('0x2e')](_0x57620c,'name');_0x33eff9[_0x7704('0x33')]=_[_0x7704('0x34')](_0x2c6aec[_0x7704('0x33')]);_0x33eff9[_0x7704('0x35')]=_['intersection'](_0x33eff9[_0x7704('0x32')],_0x33eff9[_0x7704('0x33')]);_0x2d9673[_0x7704('0x36')]=_['intersection'](_0x33eff9[_0x7704('0x32')],qs['fields'](_0x2c6aec[_0x7704('0x33')][_0x7704('0x37')]));_0x2d9673[_0x7704('0x36')]=_0x2d9673['attributes'][_0x7704('0x38')]?_0x2d9673[_0x7704('0x36')]:_0x33eff9[_0x7704('0x32')];if(!_0x2c6aec[_0x7704('0x33')]['hasOwnProperty'](_0x7704('0x39'))){_0x2d9673[_0x7704('0x24')]=qs['limit'](_0x2c6aec[_0x7704('0x33')][_0x7704('0x24')]);_0x2d9673['offset']=qs['offset'](_0x2c6aec['query'][_0x7704('0x23')]);}_0x2d9673[_0x7704('0x3a')]=qs[_0x7704('0x3b')](_0x2c6aec[_0x7704('0x33')][_0x7704('0x3b')]);_0x2d9673[_0x7704('0x3c')]=qs[_0x7704('0x35')](_[_0x7704('0x3d')](_0x2c6aec[_0x7704('0x33')],_0x33eff9['filters']),_0x57620c);if(_0x2c6aec['query'][_0x7704('0x3e')]){_0x2d9673[_0x7704('0x3c')]=_['merge'](_0x2d9673[_0x7704('0x3c')],{'$or':_[_0x7704('0x2e')](_0x57620c,function(_0x1f8739){if(_0x1f8739[_0x7704('0x3f')]!==_0x7704('0x40')){var _0x2f85f0={};_0x2f85f0[_0x1f8739[_0x7704('0x41')]]={'$like':'%'+_0x2c6aec[_0x7704('0x33')][_0x7704('0x3e')]+'%'};return _0x2f85f0;}})});}_0x2d9673=_['merge']({},_0x2d9673,_0x2c6aec[_0x7704('0x42')]);var _0x3bfa52={'where':_0x2d9673[_0x7704('0x3c')]};return db[_0x7704('0x43')]['count'](_0x3bfa52)[_0x7704('0x2a')](function(_0x48b94b){_0x211a7d[_0x7704('0x22')]=_0x48b94b;if(_0x2c6aec[_0x7704('0x33')][_0x7704('0x44')]){_0x2d9673[_0x7704('0x45')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x7704('0x46')](_0x2d9673);})['then'](function(_0x5ad971){_0x211a7d[_0x7704('0x47')]=_0x5ad971;return _0x211a7d;})[_0x7704('0x2a')](respondWithFilteredResult(_0x4769e2,_0x2d9673))[_0x7704('0x48')](handleError(_0x4769e2,null));};exports[_0x7704('0x49')]=function(_0xe0a7a5,_0x474d73){var _0x1e1d91={'raw':![],'where':{'id':_0xe0a7a5['params']['id']}},_0xfe1f68={};_0xfe1f68['model']=_[_0x7704('0x34')](db[_0x7704('0x43')][_0x7704('0x2f')]);_0xfe1f68[_0x7704('0x33')]=_[_0x7704('0x34')](_0xe0a7a5[_0x7704('0x33')]);_0xfe1f68['filters']=_[_0x7704('0x4a')](_0xfe1f68[_0x7704('0x32')],_0xfe1f68[_0x7704('0x33')]);_0x1e1d91['attributes']=_['intersection'](_0xfe1f68[_0x7704('0x32')],qs['fields'](_0xe0a7a5[_0x7704('0x33')][_0x7704('0x37')]));_0x1e1d91[_0x7704('0x36')]=_0x1e1d91[_0x7704('0x36')][_0x7704('0x38')]?_0x1e1d91[_0x7704('0x36')]:_0xfe1f68[_0x7704('0x32')];if(_0xe0a7a5[_0x7704('0x33')][_0x7704('0x44')]){_0x1e1d91[_0x7704('0x45')]=[{'all':!![]}];}_0x1e1d91=_[_0x7704('0x4b')]({},_0x1e1d91,_0xe0a7a5[_0x7704('0x42')]);return db[_0x7704('0x43')][_0x7704('0x4c')](_0x1e1d91)[_0x7704('0x2a')](handleEntityNotFound(_0x474d73,null))[_0x7704('0x2a')](respondWithResult(_0x474d73,null))['catch'](handleError(_0x474d73,null));};exports['create']=function(_0x19acfa,_0x370f3b){return db[_0x7704('0x43')][_0x7704('0x4d')](_0x19acfa[_0x7704('0x4e')],{})[_0x7704('0x2a')](respondWithResult(_0x370f3b,0xc9))[_0x7704('0x48')](handleError(_0x370f3b,null));};exports[_0x7704('0x29')]=function(_0x3a04b5,_0x427535){if(_0x3a04b5[_0x7704('0x4e')]['id']){delete _0x3a04b5[_0x7704('0x4e')]['id'];}return db[_0x7704('0x43')][_0x7704('0x4c')]({'where':{'id':_0x3a04b5['params']['id']}})[_0x7704('0x2a')](handleEntityNotFound(_0x427535,null))[_0x7704('0x2a')](saveUpdates(_0x3a04b5[_0x7704('0x4e')],null))[_0x7704('0x2a')](respondWithResult(_0x427535,null))[_0x7704('0x48')](handleError(_0x427535,null));};exports[_0x7704('0x2b')]=function(_0x1f6445,_0x23ad4d){return db[_0x7704('0x43')]['find']({'where':{'id':_0x1f6445[_0x7704('0x4f')]['id']}})[_0x7704('0x2a')](handleEntityNotFound(_0x23ad4d,null))['then'](removeEntity(_0x23ad4d,null))['catch'](handleError(_0x23ad4d,null));};exports[_0x7704('0x50')]=function(_0x3254d2,_0x21c826,_0x10289e){var _0x4b2be7={};var _0x108ca9={};var _0x4b0e15;var _0x4f34d0;return db[_0x7704('0x43')][_0x7704('0x51')]({'where':{'id':_0x3254d2[_0x7704('0x4f')]['id']}})[_0x7704('0x2a')](handleEntityNotFound(_0x21c826,null))[_0x7704('0x2a')](function(_0x6648a7){if(_0x6648a7){_0x4b0e15=_0x6648a7;_0x108ca9['model']=_['keys'](db[_0x7704('0x52')][_0x7704('0x2f')]);_0x108ca9[_0x7704('0x33')]=_[_0x7704('0x34')](_0x3254d2[_0x7704('0x33')]);_0x108ca9['filters']=_[_0x7704('0x4a')](_0x108ca9[_0x7704('0x32')],_0x108ca9['query']);_0x4b2be7[_0x7704('0x36')]=_[_0x7704('0x4a')](_0x108ca9['model'],qs[_0x7704('0x37')](_0x3254d2[_0x7704('0x33')]['fields']));_0x4b2be7[_0x7704('0x36')]=_0x4b2be7[_0x7704('0x36')][_0x7704('0x38')]?_0x4b2be7[_0x7704('0x36')]:_0x108ca9[_0x7704('0x32')];_0x4b2be7[_0x7704('0x3a')]=qs[_0x7704('0x3b')](_0x3254d2[_0x7704('0x33')][_0x7704('0x3b')]);_0x4b2be7[_0x7704('0x3c')]=qs['filters'](_[_0x7704('0x3d')](_0x3254d2[_0x7704('0x33')],_0x108ca9[_0x7704('0x35')]));if(_0x3254d2['query'][_0x7704('0x3e')]){_0x4b2be7['where']=_['merge'](_0x4b2be7['where'],{'$or':_[_0x7704('0x2e')](_0x4b2be7[_0x7704('0x36')],function(_0x552723){var _0x196f60={};_0x196f60[_0x552723]={'$like':'%'+_0x3254d2[_0x7704('0x33')][_0x7704('0x3e')]+'%'};return _0x196f60;})});}_0x4b2be7=_['merge']({},_0x4b2be7,_0x3254d2['options']);return _0x4b0e15[_0x7704('0x50')](_0x4b2be7);}})[_0x7704('0x2a')](function(_0x3ef866){if(_0x3ef866){_0x4f34d0=_0x3ef866[_0x7704('0x38')];if(!_0x3254d2[_0x7704('0x33')]['hasOwnProperty'](_0x7704('0x39'))){_0x4b2be7[_0x7704('0x24')]=qs['limit'](_0x3254d2[_0x7704('0x33')][_0x7704('0x24')]);_0x4b2be7[_0x7704('0x23')]=qs[_0x7704('0x23')](_0x3254d2[_0x7704('0x33')]['offset']);}return _0x4b0e15[_0x7704('0x50')](_0x4b2be7);}})[_0x7704('0x2a')](function(_0xacc106){if(_0xacc106){return _0xacc106?{'count':_0x4f34d0,'rows':_0xacc106}:null;}})['then'](respondWithResult(_0x21c826,null))['catch'](handleError(_0x21c826,null));};exports['addConfiguration']=function(_0x1ffd47,_0x41fb99,_0x5d7c6d){if(_0x1ffd47[_0x7704('0x4e')]['id']){delete _0x1ffd47[_0x7704('0x4e')]['id'];}return db[_0x7704('0x43')][_0x7704('0x51')]({'where':{'id':_0x1ffd47[_0x7704('0x4f')]['id']}})[_0x7704('0x2a')](handleEntityNotFound(_0x41fb99,null))[_0x7704('0x2a')](function(_0x319db6){if(_0x319db6){_0x1ffd47[_0x7704('0x4e')][_0x7704('0x53')]=_0x319db6['id'];_0x1ffd47['body'][_0x7704('0x54')]=integrations[_0x7704('0x55')](_0x1ffd47[_0x7704('0x4e')][_0x7704('0x56')],_0x1ffd47[_0x7704('0x4e')][_0x7704('0x3f')]);_0x1ffd47['body'][_0x7704('0x57')]=integrations[_0x7704('0x58')](_0x1ffd47[_0x7704('0x4e')][_0x7704('0x56')],_0x1ffd47[_0x7704('0x4e')][_0x7704('0x3f')]);return db['SugarcrmConfiguration'][_0x7704('0x4d')](_0x1ffd47['body'],{'include':[{'model':db[_0x7704('0x59')],'as':_0x7704('0x54')},{'model':db['SugarcrmField'],'as':_0x7704('0x57')}]});}return null;})['then'](respondWithResult(_0x41fb99,null))[_0x7704('0x48')](handleError(_0x41fb99,null));};exports[_0x7704('0x5a')]=function(_0x198bdd,_0x56ad6f,_0x5bcfd3){var _0x3b6b68='';var _0x2dafe8=['id','name',_0x7704('0x5b'),'created_by',_0x7704('0x5c'),'date_start',_0x7704('0x5d'),_0x7704('0x5e'),_0x7704('0x5f'),'parent_type',_0x7704('0x60'),'direction'];return db[_0x7704('0x43')][_0x7704('0x51')]({'where':{'id':_0x198bdd[_0x7704('0x4f')]['id']},'attributes':['id','username',_0x7704('0x61'),'remoteUri']})['then'](handleEntityNotFound(_0x56ad6f,null))[_0x7704('0x2a')](function(_0x43a33f){if(_0x43a33f){_0x3b6b68=_0x43a33f[_0x7704('0x62')];var _0x22d50b=_0x3b6b68[_0x7704('0x63')](-0x1);if(_0x22d50b==='/'){_0x3b6b68=_0x3b6b68[_0x7704('0x64')](0x0,_0x3b6b68[_0x7704('0x65')](_0x22d50b));}return rp({'method':_0x7704('0x66'),'uri':util[_0x7704('0x67')](_0x7704('0x68'),_0x3b6b68,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x7704('0x69'),'input_type':_0x7704('0x6a'),'response_type':_0x7704('0x6a'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x43a33f[_0x7704('0x6b')],'password':_0x43a33f[_0x7704('0x61')],'encryption':_0x7704('0x6c')},'application':_0x7704('0x6d')})}});}})[_0x7704('0x2a')](function(_0x5a7010){if(_0x5a7010&&_0x5a7010[_0x7704('0x41')]!=='Invalid\x20Login'&&_0x5a7010[_0x7704('0x41')]!==_0x7704('0x6e')){return rp({'method':_0x7704('0x66'),'uri':util['format'](_0x7704('0x68'),_0x3b6b68,_0x7704('0x6f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x7704('0x6a'),'response_type':_0x7704('0x6a'),'rest_data':JSON[_0x7704('0x70')]({'session':_0x5a7010['id'],'module_name':_0x7704('0x71')})}})['then'](function(_0x233cd7){if(_0x233cd7){var _0xf70734=_[_0x7704('0x72')](_0x233cd7[_0x7704('0x73')]);_['remove'](_0xf70734,function(_0x5ce0ff){return _0x2dafe8[_0x7704('0x74')](_0x5ce0ff[_0x7704('0x41')]);});return{'count':_0xf70734['length'],'rows':_[_0x7704('0x2e')](_0xf70734,function(_0x4402c7){return{'id':_0x4402c7['name'],'name':_0x4402c7[_0x7704('0x75')],'custom':_[_0x7704('0x76')](_0x4402c7[_0x7704('0x41')],'_c')?!![]:![],'options':_0x4402c7[_0x7704('0x42')]?_['map'](_[_0x7704('0x72')](_0x4402c7['options']),function(_0x43e71e){return{'name':_0x43e71e[_0x7704('0x77')],'value':_0x43e71e[_0x7704('0x41')]};}):[]};})};}})[_0x7704('0x2a')](respondWithResult(_0x56ad6f,null))[_0x7704('0x48')](function(_0x4abb39){var _0x1741f4=_0x198bdd[_0x7704('0x33')][_0x7704('0x78')]?0x1f4:_0x4abb39[_0x7704('0x79')]||0x1f4;logger[_0x7704('0x7a')](_0x7704('0x7b'),_0x7704('0x5a'),_0x1741f4,JSON[_0x7704('0x70')](_0x4abb39));delete _0x4abb39['name'];if(_0x1741f4===0x191){_0x1741f4=0x190;}_0x56ad6f[_0x7704('0x1f')](_0x1741f4)[_0x7704('0x2d')](_0x198bdd[_0x7704('0x33')][_0x7704('0x78')]?{'message':_0x7704('0x7c'),'statusCode':_0x4abb39['statusCode']}:_0x4abb39);});}else{var _0x42fd1a=0x1f4;_0x56ad6f[_0x7704('0x1f')](_0x42fd1a)['send']({'message':_0x7704('0x7c'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xb7ce=['params','includeAll','find','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','order','filter','options','hasOwnProperty','nolimit','AccountId','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','format','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','test','statusCode','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','limit','sort','where','pick','VIRTUAL','merge','include','findAll','catch'];(function(_0x479e9c,_0x5a2a73){var _0x38aee9=function(_0x10f78c){while(--_0x10f78c){_0x479e9c['push'](_0x479e9c['shift']());}};_0x38aee9(++_0x5a2a73);}(_0xb7ce,0x1a3));var _0xeb7c=function(_0x4280a8,_0x57fe80){_0x4280a8=_0x4280a8-0x0;var _0x32180e=_0xb7ce[_0x4280a8];return _0x32180e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb7c('0x1'));var rp=require(_0xeb7c('0x2'));var moment=require(_0xeb7c('0x3'));var BPromise=require(_0xeb7c('0x4'));var Mustache=require(_0xeb7c('0x5'));var util=require('util');var path=require(_0xeb7c('0x6'));var sox=require(_0xeb7c('0x7'));var csv=require(_0xeb7c('0x8'));var ejs=require(_0xeb7c('0x9'));var fs=require('fs');var fs_extra=require(_0xeb7c('0xa'));var _=require(_0xeb7c('0xb'));var squel=require(_0xeb7c('0xc'));var crypto=require('crypto');var jsforce=require(_0xeb7c('0xd'));var deskjs=require(_0xeb7c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb7c('0xf'));var Papa=require(_0xeb7c('0x10'));var Redis=require(_0xeb7c('0x11'));var authService=require(_0xeb7c('0x12'));var qs=require(_0xeb7c('0x13'));var as=require(_0xeb7c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb7c('0x15'));var utils=require('../../config/utils');var config=require(_0xeb7c('0x16'));var licenseUtil=require(_0xeb7c('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeb7c('0x18'));function respondWithStatusCode(_0xb26420,_0x280e13){_0x280e13=_0x280e13||0xcc;return function(_0x276c75){if(_0x276c75){return _0xb26420[_0xeb7c('0x19')](_0x280e13);}return _0xb26420[_0xeb7c('0x1a')](_0x280e13)[_0xeb7c('0x1b')]();};}function respondWithResult(_0x374317,_0x63c3d3){_0x63c3d3=_0x63c3d3||0xc8;return function(_0x27d613){if(_0x27d613){return _0x374317[_0xeb7c('0x1a')](_0x63c3d3)[_0xeb7c('0x1c')](_0x27d613);}};}function respondWithFilteredResult(_0x4cddce,_0x289d39){return function(_0x58b598){if(_0x58b598){var _0x44e1c9=typeof _0x289d39[_0xeb7c('0x1d')]===_0xeb7c('0x1e')&&typeof _0x289d39['limit']===_0xeb7c('0x1e');var _0x2cb16c=_0x58b598[_0xeb7c('0x1f')];var _0x2b911b=_0x44e1c9?0x0:_0x289d39[_0xeb7c('0x1d')];var _0x374ced=_0x44e1c9?_0x58b598['count']:_0x289d39[_0xeb7c('0x1d')]+_0x289d39['limit'];var _0xc0b3e7;if(_0x374ced>=_0x2cb16c){_0x374ced=_0x2cb16c;_0xc0b3e7=0xc8;}else{_0xc0b3e7=0xce;}_0x4cddce[_0xeb7c('0x1a')](_0xc0b3e7);return _0x4cddce[_0xeb7c('0x20')]('Content-Range',_0x2b911b+'-'+_0x374ced+'/'+_0x2cb16c)[_0xeb7c('0x1c')](_0x58b598);}return null;};}function patchUpdates(_0x451f12){return function(_0x380ead){try{jsonpatch[_0xeb7c('0x21')](_0x380ead,_0x451f12,!![]);}catch(_0x5c4fcc){return BPromise[_0xeb7c('0x22')](_0x5c4fcc);}return _0x380ead[_0xeb7c('0x23')]();};}function saveUpdates(_0xfcc8f0,_0x983d57){return function(_0x5d6049){if(_0x5d6049){return _0x5d6049['update'](_0xfcc8f0)[_0xeb7c('0x24')](function(_0xbecbe2){return _0xbecbe2;});}return null;};}function removeEntity(_0x52102,_0x245fac){return function(_0x1a8946){if(_0x1a8946){return _0x1a8946[_0xeb7c('0x25')]()[_0xeb7c('0x24')](function(){_0x52102[_0xeb7c('0x1a')](0xcc)[_0xeb7c('0x1b')]();});}};}function handleEntityNotFound(_0x141dd1,_0x113066){return function(_0x3c2d89){if(!_0x3c2d89){_0x141dd1[_0xeb7c('0x19')](0x194);}return _0x3c2d89;};}function handleError(_0x255be1,_0x3c0274){_0x3c0274=_0x3c0274||0x1f4;return function(_0x3de17f){logger[_0xeb7c('0x26')](_0x3de17f[_0xeb7c('0x27')]);if(_0x3de17f[_0xeb7c('0x28')]){delete _0x3de17f[_0xeb7c('0x28')];}_0x255be1[_0xeb7c('0x1a')](_0x3c0274)[_0xeb7c('0x29')](_0x3de17f);};}exports['index']=function(_0x42cc9c,_0x192668){var _0x197c38={},_0x14e73f={},_0x5d952d={'count':0x0,'rows':[]};var _0xd44836=_['map'](db[_0xeb7c('0x2a')][_0xeb7c('0x2b')],function(_0x18af5e){return{'name':_0x18af5e[_0xeb7c('0x2c')],'type':_0x18af5e[_0xeb7c('0x2d')][_0xeb7c('0x2e')]};});_0x14e73f['model']=_[_0xeb7c('0x2f')](_0xd44836,'name');_0x14e73f[_0xeb7c('0x30')]=_[_0xeb7c('0x31')](_0x42cc9c['query']);_0x14e73f[_0xeb7c('0x32')]=_[_0xeb7c('0x33')](_0x14e73f[_0xeb7c('0x34')],_0x14e73f[_0xeb7c('0x30')]);_0x197c38['attributes']=_[_0xeb7c('0x33')](_0x14e73f['model'],qs[_0xeb7c('0x35')](_0x42cc9c[_0xeb7c('0x30')][_0xeb7c('0x35')]));_0x197c38[_0xeb7c('0x36')]=_0x197c38[_0xeb7c('0x36')][_0xeb7c('0x37')]?_0x197c38[_0xeb7c('0x36')]:_0x14e73f[_0xeb7c('0x34')];if(!_0x42cc9c['query']['hasOwnProperty']('nolimit')){_0x197c38[_0xeb7c('0x38')]=qs['limit'](_0x42cc9c[_0xeb7c('0x30')]['limit']);_0x197c38[_0xeb7c('0x1d')]=qs[_0xeb7c('0x1d')](_0x42cc9c[_0xeb7c('0x30')][_0xeb7c('0x1d')]);}_0x197c38['order']=qs[_0xeb7c('0x39')](_0x42cc9c['query'][_0xeb7c('0x39')]);_0x197c38[_0xeb7c('0x3a')]=qs[_0xeb7c('0x32')](_[_0xeb7c('0x3b')](_0x42cc9c['query'],_0x14e73f[_0xeb7c('0x32')]),_0xd44836);if(_0x42cc9c['query']['filter']){_0x197c38[_0xeb7c('0x3a')]=_['merge'](_0x197c38[_0xeb7c('0x3a')],{'$or':_[_0xeb7c('0x2f')](_0xd44836,function(_0x420df0){if(_0x420df0['type']!==_0xeb7c('0x3c')){var _0x1a9960={};_0x1a9960[_0x420df0[_0xeb7c('0x28')]]={'$like':'%'+_0x42cc9c[_0xeb7c('0x30')]['filter']+'%'};return _0x1a9960;}})});}_0x197c38=_[_0xeb7c('0x3d')]({},_0x197c38,_0x42cc9c['options']);var _0x5a1af4={'where':_0x197c38[_0xeb7c('0x3a')]};return db[_0xeb7c('0x2a')][_0xeb7c('0x1f')](_0x5a1af4)[_0xeb7c('0x24')](function(_0x181f94){_0x5d952d[_0xeb7c('0x1f')]=_0x181f94;if(_0x42cc9c[_0xeb7c('0x30')]['includeAll']){_0x197c38[_0xeb7c('0x3e')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xeb7c('0x3f')](_0x197c38);})['then'](function(_0x274562){_0x5d952d['rows']=_0x274562;return _0x5d952d;})[_0xeb7c('0x24')](respondWithFilteredResult(_0x192668,_0x197c38))[_0xeb7c('0x40')](handleError(_0x192668,null));};exports['show']=function(_0xf160c7,_0x3e0e4e){var _0xa1df96={'raw':![],'where':{'id':_0xf160c7[_0xeb7c('0x41')]['id']}},_0x14d837={};_0x14d837[_0xeb7c('0x34')]=_[_0xeb7c('0x31')](db['SugarcrmAccount'][_0xeb7c('0x2b')]);_0x14d837[_0xeb7c('0x30')]=_['keys'](_0xf160c7[_0xeb7c('0x30')]);_0x14d837[_0xeb7c('0x32')]=_[_0xeb7c('0x33')](_0x14d837['model'],_0x14d837[_0xeb7c('0x30')]);_0xa1df96[_0xeb7c('0x36')]=_[_0xeb7c('0x33')](_0x14d837[_0xeb7c('0x34')],qs[_0xeb7c('0x35')](_0xf160c7[_0xeb7c('0x30')][_0xeb7c('0x35')]));_0xa1df96[_0xeb7c('0x36')]=_0xa1df96[_0xeb7c('0x36')]['length']?_0xa1df96[_0xeb7c('0x36')]:_0x14d837['model'];if(_0xf160c7[_0xeb7c('0x30')][_0xeb7c('0x42')]){_0xa1df96[_0xeb7c('0x3e')]=[{'all':!![]}];}_0xa1df96=_[_0xeb7c('0x3d')]({},_0xa1df96,_0xf160c7['options']);return db[_0xeb7c('0x2a')][_0xeb7c('0x43')](_0xa1df96)[_0xeb7c('0x24')](handleEntityNotFound(_0x3e0e4e,null))[_0xeb7c('0x24')](respondWithResult(_0x3e0e4e,null))[_0xeb7c('0x40')](handleError(_0x3e0e4e,null));};exports[_0xeb7c('0x44')]=function(_0x2e2f9b,_0x2a71d7){return db[_0xeb7c('0x2a')]['create'](_0x2e2f9b[_0xeb7c('0x45')],{})[_0xeb7c('0x24')](respondWithResult(_0x2a71d7,0xc9))['catch'](handleError(_0x2a71d7,null));};exports[_0xeb7c('0x46')]=function(_0x498511,_0x324543){if(_0x498511['body']['id']){delete _0x498511['body']['id'];}return db[_0xeb7c('0x2a')]['find']({'where':{'id':_0x498511[_0xeb7c('0x41')]['id']}})['then'](handleEntityNotFound(_0x324543,null))[_0xeb7c('0x24')](saveUpdates(_0x498511[_0xeb7c('0x45')],null))['then'](respondWithResult(_0x324543,null))[_0xeb7c('0x40')](handleError(_0x324543,null));};exports[_0xeb7c('0x25')]=function(_0x6f619c,_0x577066){return db[_0xeb7c('0x2a')]['find']({'where':{'id':_0x6f619c[_0xeb7c('0x41')]['id']}})[_0xeb7c('0x24')](handleEntityNotFound(_0x577066,null))[_0xeb7c('0x24')](removeEntity(_0x577066,null))[_0xeb7c('0x40')](handleError(_0x577066,null));};exports[_0xeb7c('0x47')]=function(_0x5db353,_0xf2e321,_0x1a0353){var _0x389271={};var _0x4e0ed8={};var _0x5a2099;var _0x1611ac;return db[_0xeb7c('0x2a')][_0xeb7c('0x48')]({'where':{'id':_0x5db353[_0xeb7c('0x41')]['id']}})[_0xeb7c('0x24')](handleEntityNotFound(_0xf2e321,null))[_0xeb7c('0x24')](function(_0x3f2739){if(_0x3f2739){_0x5a2099=_0x3f2739;_0x4e0ed8[_0xeb7c('0x34')]=_[_0xeb7c('0x31')](db[_0xeb7c('0x49')][_0xeb7c('0x2b')]);_0x4e0ed8[_0xeb7c('0x30')]=_[_0xeb7c('0x31')](_0x5db353[_0xeb7c('0x30')]);_0x4e0ed8[_0xeb7c('0x32')]=_[_0xeb7c('0x33')](_0x4e0ed8['model'],_0x4e0ed8[_0xeb7c('0x30')]);_0x389271[_0xeb7c('0x36')]=_['intersection'](_0x4e0ed8[_0xeb7c('0x34')],qs[_0xeb7c('0x35')](_0x5db353[_0xeb7c('0x30')][_0xeb7c('0x35')]));_0x389271['attributes']=_0x389271['attributes'][_0xeb7c('0x37')]?_0x389271[_0xeb7c('0x36')]:_0x4e0ed8[_0xeb7c('0x34')];_0x389271[_0xeb7c('0x4a')]=qs[_0xeb7c('0x39')](_0x5db353[_0xeb7c('0x30')]['sort']);_0x389271[_0xeb7c('0x3a')]=qs[_0xeb7c('0x32')](_[_0xeb7c('0x3b')](_0x5db353[_0xeb7c('0x30')],_0x4e0ed8[_0xeb7c('0x32')]));if(_0x5db353['query'][_0xeb7c('0x4b')]){_0x389271[_0xeb7c('0x3a')]=_[_0xeb7c('0x3d')](_0x389271[_0xeb7c('0x3a')],{'$or':_[_0xeb7c('0x2f')](_0x389271['attributes'],function(_0x180ced){var _0x714883={};_0x714883[_0x180ced]={'$like':'%'+_0x5db353[_0xeb7c('0x30')][_0xeb7c('0x4b')]+'%'};return _0x714883;})});}_0x389271=_[_0xeb7c('0x3d')]({},_0x389271,_0x5db353[_0xeb7c('0x4c')]);return _0x5a2099[_0xeb7c('0x47')](_0x389271);}})[_0xeb7c('0x24')](function(_0x2f6edf){if(_0x2f6edf){_0x1611ac=_0x2f6edf[_0xeb7c('0x37')];if(!_0x5db353[_0xeb7c('0x30')][_0xeb7c('0x4d')](_0xeb7c('0x4e'))){_0x389271[_0xeb7c('0x38')]=qs['limit'](_0x5db353[_0xeb7c('0x30')][_0xeb7c('0x38')]);_0x389271['offset']=qs[_0xeb7c('0x1d')](_0x5db353[_0xeb7c('0x30')][_0xeb7c('0x1d')]);}return _0x5a2099['getConfigurations'](_0x389271);}})[_0xeb7c('0x24')](function(_0x21a81c){if(_0x21a81c){return _0x21a81c?{'count':_0x1611ac,'rows':_0x21a81c}:null;}})[_0xeb7c('0x24')](respondWithResult(_0xf2e321,null))[_0xeb7c('0x40')](handleError(_0xf2e321,null));};exports['addConfiguration']=function(_0xf2b8b,_0x4713e9,_0x54c07c){if(_0xf2b8b[_0xeb7c('0x45')]['id']){delete _0xf2b8b[_0xeb7c('0x45')]['id'];}return db['SugarcrmAccount'][_0xeb7c('0x48')]({'where':{'id':_0xf2b8b['params']['id']}})[_0xeb7c('0x24')](handleEntityNotFound(_0x4713e9,null))[_0xeb7c('0x24')](function(_0x1018ed){if(_0x1018ed){_0xf2b8b[_0xeb7c('0x45')][_0xeb7c('0x4f')]=_0x1018ed['id'];_0xf2b8b[_0xeb7c('0x45')]['Subjects']=integrations['getSubjects'](_0xf2b8b[_0xeb7c('0x45')][_0xeb7c('0x50')],_0xf2b8b[_0xeb7c('0x45')][_0xeb7c('0x2d')]);_0xf2b8b['body'][_0xeb7c('0x51')]=integrations[_0xeb7c('0x52')](_0xf2b8b[_0xeb7c('0x45')][_0xeb7c('0x50')],_0xf2b8b[_0xeb7c('0x45')][_0xeb7c('0x2d')]);return db[_0xeb7c('0x49')]['create'](_0xf2b8b[_0xeb7c('0x45')],{'include':[{'model':db[_0xeb7c('0x53')],'as':_0xeb7c('0x54')},{'model':db['SugarcrmField'],'as':_0xeb7c('0x51')}]});}return null;})['then'](respondWithResult(_0x4713e9,null))[_0xeb7c('0x40')](handleError(_0x4713e9,null));};exports[_0xeb7c('0x55')]=function(_0x4cb3b9,_0x2e6499,_0x47ce18){var _0xd7516d='';var _0x5b9828=['id','name',_0xeb7c('0x56'),_0xeb7c('0x57'),_0xeb7c('0x58'),_0xeb7c('0x59'),_0xeb7c('0x5a'),_0xeb7c('0x5b'),'parent_id',_0xeb7c('0x5c'),_0xeb7c('0x5d'),_0xeb7c('0x5e')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4cb3b9['params']['id']},'attributes':['id',_0xeb7c('0x5f'),_0xeb7c('0x60'),_0xeb7c('0x61')]})[_0xeb7c('0x24')](handleEntityNotFound(_0x2e6499,null))[_0xeb7c('0x24')](function(_0x1b6e99){if(_0x1b6e99){_0xd7516d=_0x1b6e99[_0xeb7c('0x61')];var _0x475486=_0xd7516d[_0xeb7c('0x62')](-0x1);if(_0x475486==='/'){_0xd7516d=_0xd7516d[_0xeb7c('0x63')](0x0,_0xd7516d[_0xeb7c('0x64')](_0x475486));}return rp({'method':_0xeb7c('0x65'),'uri':util['format']('%s%s',_0xd7516d,_0xeb7c('0x66')),'json':!![],'form':{'method':_0xeb7c('0x67'),'input_type':'JSON','response_type':_0xeb7c('0x68'),'rest_data':JSON[_0xeb7c('0x69')]({'user_auth':{'user_name':_0x1b6e99[_0xeb7c('0x5f')],'password':_0x1b6e99[_0xeb7c('0x60')],'encryption':_0xeb7c('0x6a')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xeb7c('0x24')](function(_0x3c9a66){if(_0x3c9a66&&_0x3c9a66['name']!==_0xeb7c('0x6b')&&_0x3c9a66['name']!==_0xeb7c('0x6c')){return rp({'method':_0xeb7c('0x65'),'uri':util[_0xeb7c('0x6d')](_0xeb7c('0x6e'),_0xd7516d,_0xeb7c('0x66')),'json':!![],'form':{'method':_0xeb7c('0x6f'),'input_type':'JSON','response_type':_0xeb7c('0x68'),'rest_data':JSON[_0xeb7c('0x69')]({'session':_0x3c9a66['id'],'module_name':_0xeb7c('0x70')})}})[_0xeb7c('0x24')](function(_0x363b2b){if(_0x363b2b){var _0x14c0c5=_[_0xeb7c('0x71')](_0x363b2b[_0xeb7c('0x72')]);_[_0xeb7c('0x73')](_0x14c0c5,function(_0x292d2f){return _0x5b9828[_0xeb7c('0x74')](_0x292d2f[_0xeb7c('0x28')]);});return{'count':_0x14c0c5[_0xeb7c('0x37')],'rows':_['map'](_0x14c0c5,function(_0x1ed791){return{'id':_0x1ed791[_0xeb7c('0x28')],'name':_0x1ed791[_0xeb7c('0x75')],'custom':_['endsWith'](_0x1ed791[_0xeb7c('0x28')],'_c')?!![]:![],'options':_0x1ed791[_0xeb7c('0x4c')]?_[_0xeb7c('0x2f')](_[_0xeb7c('0x71')](_0x1ed791['options']),function(_0x77925a){return{'name':_0x77925a['value'],'value':_0x77925a[_0xeb7c('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x2e6499,null))[_0xeb7c('0x40')](function(_0x466a92){var _0x2235e6=_0x4cb3b9[_0xeb7c('0x30')][_0xeb7c('0x76')]?0x1f4:_0x466a92[_0xeb7c('0x77')]||0x1f4;logger[_0xeb7c('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2235e6,JSON[_0xeb7c('0x69')](_0x466a92));delete _0x466a92[_0xeb7c('0x28')];if(_0x2235e6===0x191){_0x2235e6=0x190;}_0x2e6499['status'](_0x2235e6)[_0xeb7c('0x29')](_0x4cb3b9['query'][_0xeb7c('0x76')]?{'message':_0xeb7c('0x78'),'statusCode':_0x466a92[_0xeb7c('0x77')]}:_0x466a92);});}else{var _0x5b381c=0x1f4;_0x2e6499[_0xeb7c('0x1a')](_0x5b381c)[_0xeb7c('0x29')]({'message':_0xeb7c('0x78'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index ac0690e..8c2624d 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 _0xf630=['exports','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xf630,0xf0));var _0x0f63=function(_0x541817,_0x42ce68){_0x541817=_0x541817-0x0;var _0x46a287=_0xf630[_0x541817];return _0x46a287;};'use strict';var _=require(_0x0f63('0x0'));var util=require(_0x0f63('0x1'));var logger=require(_0x0f63('0x2'))(_0x0f63('0x3'));var moment=require(_0x0f63('0x4'));var BPromise=require(_0x0f63('0x5'));var rp=require(_0x0f63('0x6'));var fs=require('fs');var path=require(_0x0f63('0x7'));var rimraf=require(_0x0f63('0x8'));var config=require(_0x0f63('0x9'));var attributes=require(_0x0f63('0xa'));var integrations=require(_0x0f63('0xb'));module[_0x0f63('0xc')]=function(_0x290a32,_0x39e858){return _0x290a32['define']('SugarcrmAccount',attributes,{'tableName':_0x0f63('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8535=['api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','lodash','util','../../config/logger'];(function(_0x234bb5,_0xee1d0f){var _0x2a8046=function(_0x473365){while(--_0x473365){_0x234bb5['push'](_0x234bb5['shift']());}};_0x2a8046(++_0xee1d0f);}(_0x8535,0xbd));var _0x5853=function(_0x719323,_0x37500e){_0x719323=_0x719323-0x0;var _0xe1a983=_0x8535[_0x719323];return _0xe1a983;};'use strict';var _=require(_0x5853('0x0'));var util=require(_0x5853('0x1'));var logger=require(_0x5853('0x2'))(_0x5853('0x3'));var moment=require('moment');var BPromise=require(_0x5853('0x4'));var rp=require(_0x5853('0x5'));var fs=require('fs');var path=require(_0x5853('0x6'));var rimraf=require('rimraf');var config=require(_0x5853('0x7'));var attributes=require(_0x5853('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x5853('0x9')]=function(_0x1e0dab,_0x2ac469){return _0x1e0dab[_0x5853('0xa')](_0x5853('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','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 d401f12..1fb4377 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 _0x086d=['catch','GetSugarcrmAccount','findAll','options','where','limit','include','map','model','attributes','ShowSugarcrmAccount','SugarcrmAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message'];(function(_0x319fcc,_0x45a33a){var _0x57f2f5=function(_0xd76cb6){while(--_0xd76cb6){_0x319fcc['push'](_0x319fcc['shift']());}};_0x57f2f5(++_0x45a33a);}(_0x086d,0xb8));var _0xd086=function(_0x317415,_0x582ef1){_0x317415=_0x317415-0x0;var _0x7b48e1=_0x086d[_0x317415];return _0x7b48e1;};'use strict';var _=require(_0xd086('0x0'));var util=require('util');var moment=require(_0xd086('0x1'));var BPromise=require(_0xd086('0x2'));var rs=require(_0xd086('0x3'));var fs=require('fs');var Redis=require(_0xd086('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd086('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd086('0x6'));var jayson=require(_0xd086('0x7'));var client=jayson['client'][_0xd086('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bfce0,_0x17164d,_0x5526ca){return new BPromise(function(_0x258645,_0x37ab59){return client[_0xd086('0x9')](_0x4bfce0,_0x5526ca)[_0xd086('0xa')](function(_0x3bc8c8){logger[_0xd086('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x17164d,'request\x20sent');logger[_0xd086('0xc')](_0xd086('0xd'),_0x17164d,_0xd086('0xe'),JSON[_0xd086('0xf')](_0x3bc8c8));if(_0x3bc8c8[_0xd086('0x10')]){if(_0x3bc8c8['error'][_0xd086('0x11')]===0x1f4){logger[_0xd086('0x10')](_0xd086('0x12'),_0x17164d,_0x3bc8c8[_0xd086('0x10')][_0xd086('0x13')]);return _0x37ab59(_0x3bc8c8[_0xd086('0x10')][_0xd086('0x13')]);}logger['error'](_0xd086('0x12'),_0x17164d,_0x3bc8c8[_0xd086('0x10')][_0xd086('0x13')]);return _0x258645(_0x3bc8c8['error'][_0xd086('0x13')]);}else{logger['info'](_0xd086('0x12'),_0x17164d,'request\x20sent');_0x258645(_0x3bc8c8['result'][_0xd086('0x13')]);}})[_0xd086('0x14')](function(_0x4c0d8e){logger[_0xd086('0x10')](_0xd086('0x12'),_0x17164d,_0x4c0d8e);_0x37ab59(_0x4c0d8e);});});}exports[_0xd086('0x15')]=function(_0x166c2f){var _0x203ed2=this;return new Promise(function(_0x31fafd,_0x1ba1f0){return db['SugarcrmAccount'][_0xd086('0x16')]({'raw':_0x166c2f['options']?_0x166c2f[_0xd086('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x166c2f[_0xd086('0x17')]?_0x166c2f[_0xd086('0x17')][_0xd086('0x18')]||null:null,'attributes':_0x166c2f[_0xd086('0x17')]?_0x166c2f['options']['attributes']||null:null,'limit':_0x166c2f[_0xd086('0x17')]?_0x166c2f['options'][_0xd086('0x19')]||null:null,'include':_0x166c2f[_0xd086('0x17')]?_0x166c2f[_0xd086('0x17')][_0xd086('0x1a')]?_[_0xd086('0x1b')](_0x166c2f[_0xd086('0x17')][_0xd086('0x1a')],function(_0x279a02){return{'model':db[_0x279a02['model']],'as':_0x279a02['as'],'attributes':_0x279a02['attributes'],'include':_0x279a02[_0xd086('0x1a')]?_[_0xd086('0x1b')](_0x279a02[_0xd086('0x1a')],function(_0x22b2c3){return{'model':db[_0x22b2c3['model']],'as':_0x22b2c3['as'],'attributes':_0x22b2c3['attributes'],'include':_0x22b2c3[_0xd086('0x1a')]?_[_0xd086('0x1b')](_0x22b2c3[_0xd086('0x1a')],function(_0x1e1977){return{'model':db[_0x1e1977[_0xd086('0x1c')]],'as':_0x1e1977['as'],'attributes':_0x1e1977[_0xd086('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd086('0xa')](function(_0x126992){logger[_0xd086('0xb')](_0xd086('0x15'),_0x166c2f);logger['debug']('GetSugarcrmAccount',_0x166c2f,JSON[_0xd086('0xf')](_0x126992));_0x31fafd(_0x126992);})['catch'](function(_0x2f134d){logger[_0xd086('0x10')](_0xd086('0x15'),_0x2f134d[_0xd086('0x13')],_0x166c2f);_0x1ba1f0(_0x203ed2[_0xd086('0x10')](0x1f4,_0x2f134d[_0xd086('0x13')]));});});};exports[_0xd086('0x1e')]=function(_0x2f26b5){var _0xd56e3b=this;return new Promise(function(_0x468691,_0x1a6b02){return db[_0xd086('0x1f')][_0xd086('0x20')]({'raw':_0x2f26b5[_0xd086('0x17')]?_0x2f26b5[_0xd086('0x17')][_0xd086('0x21')]===undefined?!![]:![]:!![],'where':_0x2f26b5[_0xd086('0x17')]?_0x2f26b5[_0xd086('0x17')][_0xd086('0x18')]||null:null,'attributes':_0x2f26b5[_0xd086('0x17')]?_0x2f26b5[_0xd086('0x17')][_0xd086('0x1d')]||null:null,'include':_0x2f26b5[_0xd086('0x17')]?_0x2f26b5[_0xd086('0x17')][_0xd086('0x1a')]?_['map'](_0x2f26b5[_0xd086('0x17')]['include'],function(_0x2e7a85){return{'model':db[_0x2e7a85[_0xd086('0x1c')]],'as':_0x2e7a85['as'],'attributes':_0x2e7a85['attributes'],'include':_0x2e7a85['include']?_['map'](_0x2e7a85[_0xd086('0x1a')],function(_0x82d217){return{'model':db[_0x82d217[_0xd086('0x1c')]],'as':_0x82d217['as'],'attributes':_0x82d217[_0xd086('0x1d')],'include':_0x82d217[_0xd086('0x1a')]?_[_0xd086('0x1b')](_0x82d217['include'],function(_0x59c7b0){return{'model':db[_0x59c7b0['model']],'as':_0x59c7b0['as'],'attributes':_0x59c7b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd086('0xa')](function(_0x2bf5e7){logger['info'](_0xd086('0x1e'),_0x2f26b5);logger[_0xd086('0xc')]('ShowSugarcrmAccount',_0x2f26b5,JSON['stringify'](_0x2bf5e7));_0x468691(_0x2bf5e7);})[_0xd086('0x14')](function(_0x38119f){logger[_0xd086('0x10')]('ShowSugarcrmAccount',_0x38119f[_0xd086('0x13')],_0x2f26b5);_0x1a6b02(_0xd56e3b[_0xd086('0x10')](0x1f4,_0x38119f[_0xd086('0x13')]));});});}; \ No newline at end of file +var _0x1e5b=['raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','limit','include','map','attributes','model','debug','ShowSugarcrmAccount','find'];(function(_0x2c5c3d,_0x136e2c){var _0x1acf55=function(_0x2adfaf){while(--_0x2adfaf){_0x2c5c3d['push'](_0x2c5c3d['shift']());}};_0x1acf55(++_0x136e2c);}(_0x1e5b,0x1bd));var _0xb1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb1e5('0x0'));var moment=require(_0xb1e5('0x1'));var BPromise=require(_0xb1e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1e5('0x3'));var db=require(_0xb1e5('0x4'))['db'];var utils=require(_0xb1e5('0x5'));var logger=require(_0xb1e5('0x6'))(_0xb1e5('0x7'));var config=require(_0xb1e5('0x8'));var jayson=require(_0xb1e5('0x9'));var client=jayson[_0xb1e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b0357,_0x57822c,_0x12912b){return new BPromise(function(_0x4d906e,_0x4d4d5a){return client[_0xb1e5('0xb')](_0x5b0357,_0x12912b)[_0xb1e5('0xc')](function(_0xbe05c1){logger['info'](_0xb1e5('0xd'),_0x57822c,_0xb1e5('0xe'));logger['debug'](_0xb1e5('0xf'),_0x57822c,_0xb1e5('0xe'),JSON[_0xb1e5('0x10')](_0xbe05c1));if(_0xbe05c1[_0xb1e5('0x11')]){if(_0xbe05c1['error'][_0xb1e5('0x12')]===0x1f4){logger['error'](_0xb1e5('0xd'),_0x57822c,_0xbe05c1[_0xb1e5('0x11')][_0xb1e5('0x13')]);return _0x4d4d5a(_0xbe05c1[_0xb1e5('0x11')]['message']);}logger[_0xb1e5('0x11')](_0xb1e5('0xd'),_0x57822c,_0xbe05c1[_0xb1e5('0x11')][_0xb1e5('0x13')]);return _0x4d906e(_0xbe05c1['error'][_0xb1e5('0x13')]);}else{logger[_0xb1e5('0x14')](_0xb1e5('0xd'),_0x57822c,_0xb1e5('0xe'));_0x4d906e(_0xbe05c1[_0xb1e5('0x15')]['message']);}})[_0xb1e5('0x16')](function(_0x4c788a){logger[_0xb1e5('0x11')](_0xb1e5('0xd'),_0x57822c,_0x4c788a);_0x4d4d5a(_0x4c788a);});});}exports[_0xb1e5('0x17')]=function(_0x399412){var _0x496a19=this;return new Promise(function(_0x15eb04,_0x4e6fa6){return db[_0xb1e5('0x18')][_0xb1e5('0x19')]({'raw':_0x399412[_0xb1e5('0x1a')]?_0x399412[_0xb1e5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x399412['options']?_0x399412['options'][_0xb1e5('0x1b')]||null:null,'attributes':_0x399412[_0xb1e5('0x1a')]?_0x399412[_0xb1e5('0x1a')]['attributes']||null:null,'limit':_0x399412[_0xb1e5('0x1a')]?_0x399412[_0xb1e5('0x1a')][_0xb1e5('0x1c')]||null:null,'include':_0x399412['options']?_0x399412['options'][_0xb1e5('0x1d')]?_[_0xb1e5('0x1e')](_0x399412[_0xb1e5('0x1a')][_0xb1e5('0x1d')],function(_0x558756){return{'model':db[_0x558756['model']],'as':_0x558756['as'],'attributes':_0x558756[_0xb1e5('0x1f')],'include':_0x558756[_0xb1e5('0x1d')]?_[_0xb1e5('0x1e')](_0x558756['include'],function(_0x2e682a){return{'model':db[_0x2e682a[_0xb1e5('0x20')]],'as':_0x2e682a['as'],'attributes':_0x2e682a[_0xb1e5('0x1f')],'include':_0x2e682a[_0xb1e5('0x1d')]?_[_0xb1e5('0x1e')](_0x2e682a['include'],function(_0xfcb2d9){return{'model':db[_0xfcb2d9[_0xb1e5('0x20')]],'as':_0xfcb2d9['as'],'attributes':_0xfcb2d9[_0xb1e5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb1e5('0xc')](function(_0xf0e7f2){logger[_0xb1e5('0x14')](_0xb1e5('0x17'),_0x399412);logger[_0xb1e5('0x21')](_0xb1e5('0x17'),_0x399412,JSON[_0xb1e5('0x10')](_0xf0e7f2));_0x15eb04(_0xf0e7f2);})[_0xb1e5('0x16')](function(_0x2a1ac9){logger[_0xb1e5('0x11')](_0xb1e5('0x17'),_0x2a1ac9[_0xb1e5('0x13')],_0x399412);_0x4e6fa6(_0x496a19[_0xb1e5('0x11')](0x1f4,_0x2a1ac9[_0xb1e5('0x13')]));});});};exports[_0xb1e5('0x22')]=function(_0x3ed07c){var _0x46ef97=this;return new Promise(function(_0x3d168e,_0x5a60b3){return db[_0xb1e5('0x18')][_0xb1e5('0x23')]({'raw':_0x3ed07c[_0xb1e5('0x1a')]?_0x3ed07c['options'][_0xb1e5('0x24')]===undefined?!![]:![]:!![],'where':_0x3ed07c[_0xb1e5('0x1a')]?_0x3ed07c['options'][_0xb1e5('0x1b')]||null:null,'attributes':_0x3ed07c[_0xb1e5('0x1a')]?_0x3ed07c[_0xb1e5('0x1a')][_0xb1e5('0x1f')]||null:null,'include':_0x3ed07c['options']?_0x3ed07c[_0xb1e5('0x1a')][_0xb1e5('0x1d')]?_['map'](_0x3ed07c[_0xb1e5('0x1a')]['include'],function(_0x30d0d4){return{'model':db[_0x30d0d4['model']],'as':_0x30d0d4['as'],'attributes':_0x30d0d4[_0xb1e5('0x1f')],'include':_0x30d0d4[_0xb1e5('0x1d')]?_[_0xb1e5('0x1e')](_0x30d0d4[_0xb1e5('0x1d')],function(_0x146ab8){return{'model':db[_0x146ab8[_0xb1e5('0x20')]],'as':_0x146ab8['as'],'attributes':_0x146ab8[_0xb1e5('0x1f')],'include':_0x146ab8['include']?_[_0xb1e5('0x1e')](_0x146ab8[_0xb1e5('0x1d')],function(_0x2b5f3a){return{'model':db[_0x2b5f3a[_0xb1e5('0x20')]],'as':_0x2b5f3a['as'],'attributes':_0x2b5f3a[_0xb1e5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb1e5('0xc')](function(_0x479c){logger[_0xb1e5('0x14')]('ShowSugarcrmAccount',_0x3ed07c);logger[_0xb1e5('0x21')](_0xb1e5('0x22'),_0x3ed07c,JSON[_0xb1e5('0x10')](_0x479c));_0x3d168e(_0x479c);})[_0xb1e5('0x16')](function(_0x2ff4d3){logger[_0xb1e5('0x11')](_0xb1e5('0x22'),_0x2ff4d3['message'],_0x3ed07c);_0x5a60b3(_0x46ef97[_0xb1e5('0x11')](0x1f4,_0x2ff4d3[_0xb1e5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index cbe3139..bb19dc3 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 _0xda07=['getDescriptions','post','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/descriptions'];(function(_0x3eddd9,_0x73e6be){var _0x3f3e97=function(_0x293276){while(--_0x293276){_0x3eddd9['push'](_0x3eddd9['shift']());}};_0x3f3e97(++_0x73e6be);}(_0xda07,0x17f));var _0x7da0=function(_0x5c3d4c,_0x3a8a7b){_0x5c3d4c=_0x5c3d4c-0x0;var _0x29d798=_0xda07[_0x5c3d4c];return _0x29d798;};'use strict';var multer=require(_0x7da0('0x0'));var util=require(_0x7da0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7da0('0x2'));var router=express[_0x7da0('0x3')]();var fs_extra=require(_0x7da0('0x4'));var auth=require(_0x7da0('0x5'));var interaction=require(_0x7da0('0x6'));var config=require(_0x7da0('0x7'));var controller=require(_0x7da0('0x8'));router[_0x7da0('0x9')]('/',auth[_0x7da0('0xa')](),controller['index']);router[_0x7da0('0x9')](_0x7da0('0xb'),auth[_0x7da0('0xa')](),controller[_0x7da0('0xc')]);router[_0x7da0('0x9')](_0x7da0('0xd'),auth[_0x7da0('0xa')](),controller[_0x7da0('0xe')]);router[_0x7da0('0x9')]('/:id/subjects',auth[_0x7da0('0xa')](),controller['getSubjects']);router[_0x7da0('0x9')](_0x7da0('0xf'),auth[_0x7da0('0xa')](),controller[_0x7da0('0x10')]);router[_0x7da0('0x11')]('/',auth[_0x7da0('0xa')](),controller['create']);router[_0x7da0('0x12')]('/:id',auth[_0x7da0('0xa')](),controller[_0x7da0('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7da0('0x14')]=router; \ No newline at end of file +var _0xb23b=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0xbb8078,_0x3a80e8){var _0x511e5e=function(_0x1b180a){while(--_0x1b180a){_0xbb8078['push'](_0xbb8078['shift']());}};_0x511e5e(++_0x3a80e8);}(_0xb23b,0x181));var _0xbb23=function(_0x4731b0,_0x384141){_0x4731b0=_0x4731b0-0x0;var _0x4a5525=_0xb23b[_0x4731b0];return _0x4a5525;};'use strict';var multer=require(_0xbb23('0x0'));var util=require(_0xbb23('0x1'));var path=require(_0xbb23('0x2'));var timeout=require(_0xbb23('0x3'));var express=require(_0xbb23('0x4'));var router=express[_0xbb23('0x5')]();var fs_extra=require(_0xbb23('0x6'));var auth=require(_0xbb23('0x7'));var interaction=require(_0xbb23('0x8'));var config=require('../../config/environment');var controller=require(_0xbb23('0x9'));router[_0xbb23('0xa')]('/',auth[_0xbb23('0xb')](),controller[_0xbb23('0xc')]);router['get'](_0xbb23('0xd'),auth[_0xbb23('0xb')](),controller[_0xbb23('0xe')]);router[_0xbb23('0xa')](_0xbb23('0xf'),auth[_0xbb23('0xb')](),controller['getFields']);router['get'](_0xbb23('0x10'),auth[_0xbb23('0xb')](),controller[_0xbb23('0x11')]);router[_0xbb23('0xa')](_0xbb23('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xbb23('0x13')]('/',auth[_0xbb23('0xb')](),controller[_0xbb23('0x14')]);router[_0xbb23('0x15')](_0xbb23('0xd'),auth[_0xbb23('0xb')](),controller['update']);router[_0xbb23('0x16')]('/:id',auth[_0xbb23('0xb')](),controller[_0xbb23('0x17')]);module[_0xbb23('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 3d3a126..480ecee 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 _0xd9df=['exports','STRING','sequelize'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xd9df,0x1f4));var _0xfd9d=function(_0x6c9327,_0x4ece36){_0x6c9327=_0x6c9327-0x0;var _0x52de76=_0xd9df[_0x6c9327];return _0x52de76;};'use strict';var Sequelize=require(_0xfd9d('0x0'));module[_0xfd9d('0x1')]={'name':{'type':Sequelize[_0xfd9d('0x2')]},'description':{'type':Sequelize[_0xfd9d('0x2')]}}; \ No newline at end of file +var _0xa9f4=['sequelize','exports','STRING'];(function(_0x20a20b,_0x215379){var _0x4bcf18=function(_0x2eecc3){while(--_0x2eecc3){_0x20a20b['push'](_0x20a20b['shift']());}};_0x4bcf18(++_0x215379);}(_0xa9f4,0xf6));var _0x4a9f=function(_0x2d46bb,_0x4f801f){_0x2d46bb=_0x2d46bb-0x0;var _0x4fbeb9=_0xa9f4[_0x2d46bb];return _0x4fbeb9;};'use strict';var Sequelize=require(_0x4a9f('0x0'));module[_0x4a9f('0x1')]={'name':{'type':Sequelize[_0x4a9f('0x2')]},'description':{'type':Sequelize[_0x4a9f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 93ff522..b9db617 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 _0x6d94=['update','destroy','getFields','SugarcrmField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','then','end','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','nolimit','order','sort','pick','filter','where','type','VIRTUAL','includeAll','include','findAll','show','params','keys','length','merge','options','find','catch','create','body'];(function(_0x37bc10,_0x3cbe82){var _0x1f11ce=function(_0x1c64c5){while(--_0x1c64c5){_0x37bc10['push'](_0x37bc10['shift']());}};_0x1f11ce(++_0x3cbe82);}(_0x6d94,0x189));var _0x46d9=function(_0x242c5c,_0x12d172){_0x242c5c=_0x242c5c-0x0;var _0x761d0=_0x6d94[_0x242c5c];return _0x761d0;};'use strict';var emlformat=require(_0x46d9('0x0'));var rimraf=require(_0x46d9('0x1'));var zipdir=require(_0x46d9('0x2'));var jsonpatch=require(_0x46d9('0x3'));var rp=require(_0x46d9('0x4'));var moment=require(_0x46d9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46d9('0x6'));var path=require(_0x46d9('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('lodash');var squel=require(_0x46d9('0x8'));var crypto=require(_0x46d9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x46d9('0xa'));var toCsv=require(_0x46d9('0xb'));var querystring=require(_0x46d9('0xc'));var Papa=require(_0x46d9('0xd'));var Redis=require(_0x46d9('0xe'));var authService=require(_0x46d9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x46d9('0x10'));var hardwareService=require(_0x46d9('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x46d9('0x12'));var licenseUtil=require(_0x46d9('0x13'));var db=require(_0x46d9('0x14'))['db'];function respondWithStatusCode(_0x243408,_0x57e9fd){_0x57e9fd=_0x57e9fd||0xcc;return function(_0x4260dd){if(_0x4260dd){return _0x243408[_0x46d9('0x15')](_0x57e9fd);}return _0x243408[_0x46d9('0x16')](_0x57e9fd)['end']();};}function respondWithResult(_0x1249fd,_0x1a1360){_0x1a1360=_0x1a1360||0xc8;return function(_0x444b17){if(_0x444b17){return _0x1249fd[_0x46d9('0x16')](_0x1a1360)[_0x46d9('0x17')](_0x444b17);}};}function respondWithFilteredResult(_0x326bfe,_0x4211d9){return function(_0x47574e){if(_0x47574e){var _0x449524=typeof _0x4211d9[_0x46d9('0x18')]==='undefined'&&typeof _0x4211d9[_0x46d9('0x19')]===_0x46d9('0x1a');var _0x46c66e=_0x47574e['count'];var _0x47abf8=_0x449524?0x0:_0x4211d9[_0x46d9('0x18')];var _0x1c677d=_0x449524?_0x47574e[_0x46d9('0x1b')]:_0x4211d9[_0x46d9('0x18')]+_0x4211d9[_0x46d9('0x19')];var _0xd187fb;if(_0x1c677d>=_0x46c66e){_0x1c677d=_0x46c66e;_0xd187fb=0xc8;}else{_0xd187fb=0xce;}_0x326bfe[_0x46d9('0x16')](_0xd187fb);return _0x326bfe['set'](_0x46d9('0x1c'),_0x47abf8+'-'+_0x1c677d+'/'+_0x46c66e)[_0x46d9('0x17')](_0x47574e);}return null;};}function patchUpdates(_0x15d79c){return function(_0xa2805){try{jsonpatch[_0x46d9('0x1d')](_0xa2805,_0x15d79c,!![]);}catch(_0x48d3dc){return BPromise['reject'](_0x48d3dc);}return _0xa2805['save']();};}function saveUpdates(_0x3e1cc2,_0x1f6b2b){return function(_0x637a2d){if(_0x637a2d){return _0x637a2d['update'](_0x3e1cc2)[_0x46d9('0x1e')](function(_0xddf1d3){return _0xddf1d3;});}return null;};}function removeEntity(_0x288558,_0x42040f){return function(_0x55245e){if(_0x55245e){return _0x55245e['destroy']()[_0x46d9('0x1e')](function(){_0x288558['status'](0xcc)[_0x46d9('0x1f')]();});}};}function handleEntityNotFound(_0x117f46,_0x2d5e38){return function(_0xb0a642){if(!_0xb0a642){_0x117f46[_0x46d9('0x15')](0x194);}return _0xb0a642;};}function handleError(_0x18f780,_0x2120ac){_0x2120ac=_0x2120ac||0x1f4;return function(_0x59e53b){logger[_0x46d9('0x20')](_0x59e53b[_0x46d9('0x21')]);if(_0x59e53b[_0x46d9('0x22')]){delete _0x59e53b[_0x46d9('0x22')];}_0x18f780[_0x46d9('0x16')](_0x2120ac)[_0x46d9('0x23')](_0x59e53b);};}exports[_0x46d9('0x24')]=function(_0x44cfba,_0x3616b0){var _0x3b2b04={},_0x3d441b={},_0x306f6e={'count':0x0,'rows':[]};var _0x31fffa=_[_0x46d9('0x25')](db[_0x46d9('0x26')][_0x46d9('0x27')],function(_0x5e3c28){return{'name':_0x5e3c28[_0x46d9('0x28')],'type':_0x5e3c28['type'][_0x46d9('0x29')]};});_0x3d441b['model']=_[_0x46d9('0x25')](_0x31fffa,'name');_0x3d441b['query']=_['keys'](_0x44cfba['query']);_0x3d441b[_0x46d9('0x2a')]=_[_0x46d9('0x2b')](_0x3d441b[_0x46d9('0x2c')],_0x3d441b[_0x46d9('0x2d')]);_0x3b2b04[_0x46d9('0x2e')]=_[_0x46d9('0x2b')](_0x3d441b[_0x46d9('0x2c')],qs[_0x46d9('0x2f')](_0x44cfba[_0x46d9('0x2d')][_0x46d9('0x2f')]));_0x3b2b04[_0x46d9('0x2e')]=_0x3b2b04[_0x46d9('0x2e')]['length']?_0x3b2b04[_0x46d9('0x2e')]:_0x3d441b[_0x46d9('0x2c')];if(!_0x44cfba['query']['hasOwnProperty'](_0x46d9('0x30'))){_0x3b2b04[_0x46d9('0x19')]=qs[_0x46d9('0x19')](_0x44cfba[_0x46d9('0x2d')][_0x46d9('0x19')]);_0x3b2b04[_0x46d9('0x18')]=qs['offset'](_0x44cfba[_0x46d9('0x2d')][_0x46d9('0x18')]);}_0x3b2b04[_0x46d9('0x31')]=qs[_0x46d9('0x32')](_0x44cfba[_0x46d9('0x2d')]['sort']);_0x3b2b04['where']=qs[_0x46d9('0x2a')](_[_0x46d9('0x33')](_0x44cfba['query'],_0x3d441b[_0x46d9('0x2a')]),_0x31fffa);if(_0x44cfba['query'][_0x46d9('0x34')]){_0x3b2b04['where']=_['merge'](_0x3b2b04[_0x46d9('0x35')],{'$or':_[_0x46d9('0x25')](_0x31fffa,function(_0x31f770){if(_0x31f770[_0x46d9('0x36')]!==_0x46d9('0x37')){var _0x1c924f={};_0x1c924f[_0x31f770['name']]={'$like':'%'+_0x44cfba['query'][_0x46d9('0x34')]+'%'};return _0x1c924f;}})});}_0x3b2b04=_['merge']({},_0x3b2b04,_0x44cfba['options']);var _0x3ae09f={'where':_0x3b2b04['where']};return db[_0x46d9('0x26')][_0x46d9('0x1b')](_0x3ae09f)[_0x46d9('0x1e')](function(_0x1eeb29){_0x306f6e[_0x46d9('0x1b')]=_0x1eeb29;if(_0x44cfba[_0x46d9('0x2d')][_0x46d9('0x38')]){_0x3b2b04[_0x46d9('0x39')]=[{'all':!![]}];}return db[_0x46d9('0x26')][_0x46d9('0x3a')](_0x3b2b04);})['then'](function(_0x2d6bc5){_0x306f6e['rows']=_0x2d6bc5;return _0x306f6e;})[_0x46d9('0x1e')](respondWithFilteredResult(_0x3616b0,_0x3b2b04))['catch'](handleError(_0x3616b0,null));};exports[_0x46d9('0x3b')]=function(_0x339ade,_0x1e6a3f){var _0x1a2b9f={'raw':![],'where':{'id':_0x339ade[_0x46d9('0x3c')]['id']}},_0x4d3b8b={};_0x4d3b8b[_0x46d9('0x2c')]=_[_0x46d9('0x3d')](db[_0x46d9('0x26')][_0x46d9('0x27')]);_0x4d3b8b[_0x46d9('0x2d')]=_[_0x46d9('0x3d')](_0x339ade[_0x46d9('0x2d')]);_0x4d3b8b['filters']=_[_0x46d9('0x2b')](_0x4d3b8b['model'],_0x4d3b8b[_0x46d9('0x2d')]);_0x1a2b9f[_0x46d9('0x2e')]=_[_0x46d9('0x2b')](_0x4d3b8b['model'],qs[_0x46d9('0x2f')](_0x339ade[_0x46d9('0x2d')]['fields']));_0x1a2b9f[_0x46d9('0x2e')]=_0x1a2b9f[_0x46d9('0x2e')][_0x46d9('0x3e')]?_0x1a2b9f[_0x46d9('0x2e')]:_0x4d3b8b[_0x46d9('0x2c')];if(_0x339ade[_0x46d9('0x2d')][_0x46d9('0x38')]){_0x1a2b9f[_0x46d9('0x39')]=[{'all':!![]}];}_0x1a2b9f=_[_0x46d9('0x3f')]({},_0x1a2b9f,_0x339ade[_0x46d9('0x40')]);return db[_0x46d9('0x26')][_0x46d9('0x41')](_0x1a2b9f)[_0x46d9('0x1e')](handleEntityNotFound(_0x1e6a3f,null))['then'](respondWithResult(_0x1e6a3f,null))[_0x46d9('0x42')](handleError(_0x1e6a3f,null));};exports['create']=function(_0x3c6033,_0x2c4725){return db[_0x46d9('0x26')][_0x46d9('0x43')](_0x3c6033[_0x46d9('0x44')],{})[_0x46d9('0x1e')](respondWithResult(_0x2c4725,0xc9))[_0x46d9('0x42')](handleError(_0x2c4725,null));};exports[_0x46d9('0x45')]=function(_0x3d7e07,_0x19d32d){if(_0x3d7e07[_0x46d9('0x44')]['id']){delete _0x3d7e07[_0x46d9('0x44')]['id'];}return db[_0x46d9('0x26')][_0x46d9('0x41')]({'where':{'id':_0x3d7e07[_0x46d9('0x3c')]['id']}})[_0x46d9('0x1e')](handleEntityNotFound(_0x19d32d,null))[_0x46d9('0x1e')](saveUpdates(_0x3d7e07['body'],null))[_0x46d9('0x1e')](respondWithResult(_0x19d32d,null))[_0x46d9('0x42')](handleError(_0x19d32d,null));};exports[_0x46d9('0x46')]=function(_0x4d82d3,_0x3c3de4){return db['SugarcrmConfiguration'][_0x46d9('0x41')]({'where':{'id':_0x4d82d3[_0x46d9('0x3c')]['id']}})[_0x46d9('0x1e')](handleEntityNotFound(_0x3c3de4,null))[_0x46d9('0x1e')](removeEntity(_0x3c3de4,null))[_0x46d9('0x42')](handleError(_0x3c3de4,null));};exports[_0x46d9('0x47')]=function(_0x874f1a,_0x52bb4a,_0x35cb06){var _0x545934={};var _0x5b93a5={};var _0x278623;var _0x4a4ecc;return db[_0x46d9('0x26')]['findOne']({'where':{'id':_0x874f1a[_0x46d9('0x3c')]['id']}})[_0x46d9('0x1e')](handleEntityNotFound(_0x52bb4a,null))[_0x46d9('0x1e')](function(_0x5c2002){if(_0x5c2002){_0x278623=_0x5c2002;_0x5b93a5[_0x46d9('0x2c')]=_['keys'](db[_0x46d9('0x48')]['rawAttributes']);_0x5b93a5[_0x46d9('0x2d')]=_[_0x46d9('0x3d')](_0x874f1a[_0x46d9('0x2d')]);_0x5b93a5[_0x46d9('0x2a')]=_['intersection'](_0x5b93a5[_0x46d9('0x2c')],_0x5b93a5[_0x46d9('0x2d')]);_0x545934[_0x46d9('0x2e')]=_['intersection'](_0x5b93a5[_0x46d9('0x2c')],qs[_0x46d9('0x2f')](_0x874f1a['query'][_0x46d9('0x2f')]));_0x545934[_0x46d9('0x2e')]=_0x545934[_0x46d9('0x2e')]['length']?_0x545934['attributes']:_0x5b93a5['model'];_0x545934[_0x46d9('0x31')]=qs[_0x46d9('0x32')](_0x874f1a[_0x46d9('0x2d')][_0x46d9('0x32')]);_0x545934[_0x46d9('0x35')]=qs['filters'](_[_0x46d9('0x33')](_0x874f1a[_0x46d9('0x2d')],_0x5b93a5[_0x46d9('0x2a')]));if(_0x874f1a[_0x46d9('0x2d')][_0x46d9('0x34')]){_0x545934[_0x46d9('0x35')]=_[_0x46d9('0x3f')](_0x545934['where'],{'$or':_['map'](_0x545934[_0x46d9('0x2e')],function(_0x38c6b3){var _0x31a968={};_0x31a968[_0x38c6b3]={'$like':'%'+_0x874f1a[_0x46d9('0x2d')][_0x46d9('0x34')]+'%'};return _0x31a968;})});}_0x545934=_[_0x46d9('0x3f')]({},_0x545934,_0x874f1a['options']);return _0x278623[_0x46d9('0x47')](_0x545934);}})[_0x46d9('0x1e')](function(_0x41f647){if(_0x41f647){_0x4a4ecc=_0x41f647[_0x46d9('0x3e')];if(!_0x874f1a[_0x46d9('0x2d')][_0x46d9('0x49')](_0x46d9('0x30'))){_0x545934[_0x46d9('0x19')]=qs[_0x46d9('0x19')](_0x874f1a[_0x46d9('0x2d')][_0x46d9('0x19')]);_0x545934['offset']=qs[_0x46d9('0x18')](_0x874f1a[_0x46d9('0x2d')]['offset']);}return _0x278623['getFields'](_0x545934);}})[_0x46d9('0x1e')](function(_0x43b2ee){if(_0x43b2ee){return _0x43b2ee?{'count':_0x4a4ecc,'rows':_0x43b2ee}:null;}})['then'](respondWithResult(_0x52bb4a,null))[_0x46d9('0x42')](handleError(_0x52bb4a,null));};exports[_0x46d9('0x4a')]=function(_0x24dfa6,_0x226c6a,_0x259d95){var _0x2a475f={};var _0x2c5c16={};var _0x568c5f;var _0xcfcc04;return db[_0x46d9('0x26')][_0x46d9('0x4b')]({'where':{'id':_0x24dfa6[_0x46d9('0x3c')]['id']}})[_0x46d9('0x1e')](handleEntityNotFound(_0x226c6a,null))['then'](function(_0x4c616c){if(_0x4c616c){_0x568c5f=_0x4c616c;_0x2c5c16[_0x46d9('0x2c')]=_['keys'](db['SugarcrmField'][_0x46d9('0x27')]);_0x2c5c16[_0x46d9('0x2d')]=_[_0x46d9('0x3d')](_0x24dfa6[_0x46d9('0x2d')]);_0x2c5c16[_0x46d9('0x2a')]=_[_0x46d9('0x2b')](_0x2c5c16[_0x46d9('0x2c')],_0x2c5c16['query']);_0x2a475f['attributes']=_['intersection'](_0x2c5c16[_0x46d9('0x2c')],qs[_0x46d9('0x2f')](_0x24dfa6['query'][_0x46d9('0x2f')]));_0x2a475f['attributes']=_0x2a475f['attributes'][_0x46d9('0x3e')]?_0x2a475f[_0x46d9('0x2e')]:_0x2c5c16[_0x46d9('0x2c')];_0x2a475f[_0x46d9('0x31')]=qs[_0x46d9('0x32')](_0x24dfa6[_0x46d9('0x2d')][_0x46d9('0x32')]);_0x2a475f[_0x46d9('0x35')]=qs[_0x46d9('0x2a')](_[_0x46d9('0x33')](_0x24dfa6[_0x46d9('0x2d')],_0x2c5c16[_0x46d9('0x2a')]));if(_0x24dfa6['query'][_0x46d9('0x34')]){_0x2a475f['where']=_[_0x46d9('0x3f')](_0x2a475f[_0x46d9('0x35')],{'$or':_[_0x46d9('0x25')](_0x2a475f[_0x46d9('0x2e')],function(_0x100084){var _0x4833b1={};_0x4833b1[_0x100084]={'$like':'%'+_0x24dfa6[_0x46d9('0x2d')][_0x46d9('0x34')]+'%'};return _0x4833b1;})});}_0x2a475f=_['merge']({},_0x2a475f,_0x24dfa6[_0x46d9('0x40')]);return _0x568c5f[_0x46d9('0x4a')](_0x2a475f);}})['then'](function(_0xe25051){if(_0xe25051){_0xcfcc04=_0xe25051[_0x46d9('0x3e')];if(!_0x24dfa6['query'][_0x46d9('0x49')]('nolimit')){_0x2a475f['limit']=qs[_0x46d9('0x19')](_0x24dfa6[_0x46d9('0x2d')]['limit']);_0x2a475f['offset']=qs[_0x46d9('0x18')](_0x24dfa6[_0x46d9('0x2d')]['offset']);}return _0x568c5f[_0x46d9('0x4a')](_0x2a475f);}})[_0x46d9('0x1e')](function(_0x3a3ae9){if(_0x3a3ae9){return _0x3a3ae9?{'count':_0xcfcc04,'rows':_0x3a3ae9}:null;}})[_0x46d9('0x1e')](respondWithResult(_0x226c6a,null))['catch'](handleError(_0x226c6a,null));};exports[_0x46d9('0x4c')]=function(_0x4276b6,_0x116eac,_0x1e07c2){var _0x32937b={};var _0xb310c1={};var _0x592c63;var _0x26823c;return db[_0x46d9('0x26')]['findOne']({'where':{'id':_0x4276b6[_0x46d9('0x3c')]['id']}})[_0x46d9('0x1e')](handleEntityNotFound(_0x116eac,null))[_0x46d9('0x1e')](function(_0x505217){if(_0x505217){_0x592c63=_0x505217;_0xb310c1[_0x46d9('0x2c')]=_[_0x46d9('0x3d')](db[_0x46d9('0x48')][_0x46d9('0x27')]);_0xb310c1['query']=_['keys'](_0x4276b6[_0x46d9('0x2d')]);_0xb310c1['filters']=_[_0x46d9('0x2b')](_0xb310c1[_0x46d9('0x2c')],_0xb310c1['query']);_0x32937b[_0x46d9('0x2e')]=_[_0x46d9('0x2b')](_0xb310c1['model'],qs[_0x46d9('0x2f')](_0x4276b6[_0x46d9('0x2d')][_0x46d9('0x2f')]));_0x32937b[_0x46d9('0x2e')]=_0x32937b['attributes'][_0x46d9('0x3e')]?_0x32937b['attributes']:_0xb310c1[_0x46d9('0x2c')];_0x32937b[_0x46d9('0x31')]=qs[_0x46d9('0x32')](_0x4276b6[_0x46d9('0x2d')]['sort']);_0x32937b['where']=qs[_0x46d9('0x2a')](_['pick'](_0x4276b6[_0x46d9('0x2d')],_0xb310c1[_0x46d9('0x2a')]));if(_0x4276b6[_0x46d9('0x2d')][_0x46d9('0x34')]){_0x32937b[_0x46d9('0x35')]=_[_0x46d9('0x3f')](_0x32937b[_0x46d9('0x35')],{'$or':_[_0x46d9('0x25')](_0x32937b['attributes'],function(_0x45f31f){var _0x78966c={};_0x78966c[_0x45f31f]={'$like':'%'+_0x4276b6[_0x46d9('0x2d')][_0x46d9('0x34')]+'%'};return _0x78966c;})});}_0x32937b=_[_0x46d9('0x3f')]({},_0x32937b,_0x4276b6[_0x46d9('0x40')]);return _0x592c63['getDescriptions'](_0x32937b);}})[_0x46d9('0x1e')](function(_0x4e4feb){if(_0x4e4feb){_0x26823c=_0x4e4feb[_0x46d9('0x3e')];if(!_0x4276b6[_0x46d9('0x2d')]['hasOwnProperty']('nolimit')){_0x32937b['limit']=qs['limit'](_0x4276b6['query']['limit']);_0x32937b[_0x46d9('0x18')]=qs[_0x46d9('0x18')](_0x4276b6['query'][_0x46d9('0x18')]);}return _0x592c63[_0x46d9('0x4c')](_0x32937b);}})[_0x46d9('0x1e')](function(_0x24aa77){if(_0x24aa77){return _0x24aa77?{'count':_0x26823c,'rows':_0x24aa77}:null;}})[_0x46d9('0x1e')](respondWithResult(_0x116eac,null))[_0x46d9('0x42')](handleError(_0x116eac,null));}; \ No newline at end of file +var _0x2e96=['undefined','count','offset','limit','status','set','Content-Range','apply','reject','update','destroy','end','error','stack','name','send','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmConfiguration','then','includeAll','findAll','catch','show','fields','length','include','find','create','body','getFields','findOne','params','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json'];(function(_0x49c1fc,_0x32948f){var _0x1f5f58=function(_0x48e8c4){while(--_0x48e8c4){_0x49c1fc['push'](_0x49c1fc['shift']());}};_0x1f5f58(++_0x32948f);}(_0x2e96,0xd5));var _0x62e9=function(_0x40e21e,_0x30181e){_0x40e21e=_0x40e21e-0x0;var _0x56c454=_0x2e96[_0x40e21e];return _0x56c454;};'use strict';var emlformat=require(_0x62e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x62e9('0x1'));var jsonpatch=require(_0x62e9('0x2'));var rp=require('request-promise');var moment=require(_0x62e9('0x3'));var BPromise=require(_0x62e9('0x4'));var Mustache=require('mustache');var util=require(_0x62e9('0x5'));var path=require(_0x62e9('0x6'));var sox=require(_0x62e9('0x7'));var csv=require('to-csv');var ejs=require(_0x62e9('0x8'));var fs=require('fs');var fs_extra=require(_0x62e9('0x9'));var _=require(_0x62e9('0xa'));var squel=require(_0x62e9('0xb'));var crypto=require(_0x62e9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62e9('0xd'));var querystring=require(_0x62e9('0xe'));var Papa=require(_0x62e9('0xf'));var Redis=require(_0x62e9('0x10'));var authService=require(_0x62e9('0x11'));var qs=require(_0x62e9('0x12'));var as=require(_0x62e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62e9('0x14'))(_0x62e9('0x15'));var utils=require(_0x62e9('0x16'));var config=require(_0x62e9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x62e9('0x18'))['db'];function respondWithStatusCode(_0x31a5b7,_0x43279b){_0x43279b=_0x43279b||0xcc;return function(_0x37dc3c){if(_0x37dc3c){return _0x31a5b7[_0x62e9('0x19')](_0x43279b);}return _0x31a5b7['status'](_0x43279b)['end']();};}function respondWithResult(_0x3d988f,_0x3669ea){_0x3669ea=_0x3669ea||0xc8;return function(_0x27deb9){if(_0x27deb9){return _0x3d988f['status'](_0x3669ea)[_0x62e9('0x1a')](_0x27deb9);}};}function respondWithFilteredResult(_0xa5b304,_0x5edc39){return function(_0xa888b4){if(_0xa888b4){var _0x2f1972=typeof _0x5edc39['offset']===_0x62e9('0x1b')&&typeof _0x5edc39['limit']===_0x62e9('0x1b');var _0x240d89=_0xa888b4[_0x62e9('0x1c')];var _0x1ecadb=_0x2f1972?0x0:_0x5edc39['offset'];var _0x2027d7=_0x2f1972?_0xa888b4[_0x62e9('0x1c')]:_0x5edc39[_0x62e9('0x1d')]+_0x5edc39[_0x62e9('0x1e')];var _0x3ce144;if(_0x2027d7>=_0x240d89){_0x2027d7=_0x240d89;_0x3ce144=0xc8;}else{_0x3ce144=0xce;}_0xa5b304[_0x62e9('0x1f')](_0x3ce144);return _0xa5b304[_0x62e9('0x20')](_0x62e9('0x21'),_0x1ecadb+'-'+_0x2027d7+'/'+_0x240d89)[_0x62e9('0x1a')](_0xa888b4);}return null;};}function patchUpdates(_0x1fea8b){return function(_0x3af4f9){try{jsonpatch[_0x62e9('0x22')](_0x3af4f9,_0x1fea8b,!![]);}catch(_0x37caa4){return BPromise[_0x62e9('0x23')](_0x37caa4);}return _0x3af4f9['save']();};}function saveUpdates(_0x4a63b0,_0x41ff4f){return function(_0x53abac){if(_0x53abac){return _0x53abac[_0x62e9('0x24')](_0x4a63b0)['then'](function(_0x533aec){return _0x533aec;});}return null;};}function removeEntity(_0x462d89,_0x454315){return function(_0xd7c5a8){if(_0xd7c5a8){return _0xd7c5a8[_0x62e9('0x25')]()['then'](function(){_0x462d89['status'](0xcc)[_0x62e9('0x26')]();});}};}function handleEntityNotFound(_0x9ef552,_0x39b99d){return function(_0x240f60){if(!_0x240f60){_0x9ef552['sendStatus'](0x194);}return _0x240f60;};}function handleError(_0x444309,_0x328319){_0x328319=_0x328319||0x1f4;return function(_0x36263e){logger[_0x62e9('0x27')](_0x36263e[_0x62e9('0x28')]);if(_0x36263e[_0x62e9('0x29')]){delete _0x36263e[_0x62e9('0x29')];}_0x444309['status'](_0x328319)[_0x62e9('0x2a')](_0x36263e);};}exports['index']=function(_0x48deea,_0x6b77c8){var _0x340562={},_0x3638ed={},_0xf42843={'count':0x0,'rows':[]};var _0x4e35a1=_[_0x62e9('0x2b')](db['SugarcrmConfiguration'][_0x62e9('0x2c')],function(_0x6e302c){return{'name':_0x6e302c['fieldName'],'type':_0x6e302c[_0x62e9('0x2d')]['key']};});_0x3638ed[_0x62e9('0x2e')]=_[_0x62e9('0x2b')](_0x4e35a1,_0x62e9('0x29'));_0x3638ed['query']=_[_0x62e9('0x2f')](_0x48deea[_0x62e9('0x30')]);_0x3638ed[_0x62e9('0x31')]=_['intersection'](_0x3638ed[_0x62e9('0x2e')],_0x3638ed[_0x62e9('0x30')]);_0x340562['attributes']=_[_0x62e9('0x32')](_0x3638ed[_0x62e9('0x2e')],qs['fields'](_0x48deea[_0x62e9('0x30')]['fields']));_0x340562[_0x62e9('0x33')]=_0x340562['attributes']['length']?_0x340562[_0x62e9('0x33')]:_0x3638ed['model'];if(!_0x48deea[_0x62e9('0x30')][_0x62e9('0x34')](_0x62e9('0x35'))){_0x340562[_0x62e9('0x1e')]=qs[_0x62e9('0x1e')](_0x48deea['query'][_0x62e9('0x1e')]);_0x340562[_0x62e9('0x1d')]=qs['offset'](_0x48deea[_0x62e9('0x30')][_0x62e9('0x1d')]);}_0x340562[_0x62e9('0x36')]=qs[_0x62e9('0x37')](_0x48deea[_0x62e9('0x30')][_0x62e9('0x37')]);_0x340562['where']=qs[_0x62e9('0x31')](_[_0x62e9('0x38')](_0x48deea['query'],_0x3638ed[_0x62e9('0x31')]),_0x4e35a1);if(_0x48deea[_0x62e9('0x30')][_0x62e9('0x39')]){_0x340562[_0x62e9('0x3a')]=_[_0x62e9('0x3b')](_0x340562['where'],{'$or':_[_0x62e9('0x2b')](_0x4e35a1,function(_0x30da2c){if(_0x30da2c['type']!==_0x62e9('0x3c')){var _0x5a6926={};_0x5a6926[_0x30da2c[_0x62e9('0x29')]]={'$like':'%'+_0x48deea[_0x62e9('0x30')]['filter']+'%'};return _0x5a6926;}})});}_0x340562=_[_0x62e9('0x3b')]({},_0x340562,_0x48deea[_0x62e9('0x3d')]);var _0x42257b={'where':_0x340562[_0x62e9('0x3a')]};return db[_0x62e9('0x3e')]['count'](_0x42257b)[_0x62e9('0x3f')](function(_0x234f62){_0xf42843['count']=_0x234f62;if(_0x48deea[_0x62e9('0x30')][_0x62e9('0x40')]){_0x340562['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x62e9('0x41')](_0x340562);})[_0x62e9('0x3f')](function(_0x3f0dd0){_0xf42843['rows']=_0x3f0dd0;return _0xf42843;})[_0x62e9('0x3f')](respondWithFilteredResult(_0x6b77c8,_0x340562))[_0x62e9('0x42')](handleError(_0x6b77c8,null));};exports[_0x62e9('0x43')]=function(_0x5f3738,_0x10d9a5){var _0x5f24c1={'raw':![],'where':{'id':_0x5f3738['params']['id']}},_0x1bfcd0={};_0x1bfcd0[_0x62e9('0x2e')]=_['keys'](db[_0x62e9('0x3e')][_0x62e9('0x2c')]);_0x1bfcd0['query']=_[_0x62e9('0x2f')](_0x5f3738[_0x62e9('0x30')]);_0x1bfcd0[_0x62e9('0x31')]=_[_0x62e9('0x32')](_0x1bfcd0[_0x62e9('0x2e')],_0x1bfcd0['query']);_0x5f24c1[_0x62e9('0x33')]=_[_0x62e9('0x32')](_0x1bfcd0['model'],qs['fields'](_0x5f3738[_0x62e9('0x30')][_0x62e9('0x44')]));_0x5f24c1[_0x62e9('0x33')]=_0x5f24c1[_0x62e9('0x33')][_0x62e9('0x45')]?_0x5f24c1[_0x62e9('0x33')]:_0x1bfcd0['model'];if(_0x5f3738[_0x62e9('0x30')]['includeAll']){_0x5f24c1[_0x62e9('0x46')]=[{'all':!![]}];}_0x5f24c1=_['merge']({},_0x5f24c1,_0x5f3738[_0x62e9('0x3d')]);return db[_0x62e9('0x3e')][_0x62e9('0x47')](_0x5f24c1)[_0x62e9('0x3f')](handleEntityNotFound(_0x10d9a5,null))[_0x62e9('0x3f')](respondWithResult(_0x10d9a5,null))[_0x62e9('0x42')](handleError(_0x10d9a5,null));};exports[_0x62e9('0x48')]=function(_0x1ffbf6,_0x8f753b){return db[_0x62e9('0x3e')]['create'](_0x1ffbf6['body'],{})[_0x62e9('0x3f')](respondWithResult(_0x8f753b,0xc9))[_0x62e9('0x42')](handleError(_0x8f753b,null));};exports[_0x62e9('0x24')]=function(_0x569175,_0x3b6c19){if(_0x569175[_0x62e9('0x49')]['id']){delete _0x569175['body']['id'];}return db[_0x62e9('0x3e')][_0x62e9('0x47')]({'where':{'id':_0x569175['params']['id']}})[_0x62e9('0x3f')](handleEntityNotFound(_0x3b6c19,null))[_0x62e9('0x3f')](saveUpdates(_0x569175[_0x62e9('0x49')],null))['then'](respondWithResult(_0x3b6c19,null))[_0x62e9('0x42')](handleError(_0x3b6c19,null));};exports[_0x62e9('0x25')]=function(_0x144e94,_0x22bfcc){return db[_0x62e9('0x3e')][_0x62e9('0x47')]({'where':{'id':_0x144e94['params']['id']}})[_0x62e9('0x3f')](handleEntityNotFound(_0x22bfcc,null))[_0x62e9('0x3f')](removeEntity(_0x22bfcc,null))[_0x62e9('0x42')](handleError(_0x22bfcc,null));};exports[_0x62e9('0x4a')]=function(_0x6d2df9,_0x3e9815,_0xf5af91){var _0x3c2cc5={};var _0x5ab16c={};var _0x205529;var _0x46dfc3;return db[_0x62e9('0x3e')][_0x62e9('0x4b')]({'where':{'id':_0x6d2df9[_0x62e9('0x4c')]['id']}})[_0x62e9('0x3f')](handleEntityNotFound(_0x3e9815,null))[_0x62e9('0x3f')](function(_0x19b0db){if(_0x19b0db){_0x205529=_0x19b0db;_0x5ab16c[_0x62e9('0x2e')]=_['keys'](db[_0x62e9('0x4d')][_0x62e9('0x2c')]);_0x5ab16c['query']=_[_0x62e9('0x2f')](_0x6d2df9[_0x62e9('0x30')]);_0x5ab16c[_0x62e9('0x31')]=_[_0x62e9('0x32')](_0x5ab16c[_0x62e9('0x2e')],_0x5ab16c[_0x62e9('0x30')]);_0x3c2cc5[_0x62e9('0x33')]=_['intersection'](_0x5ab16c[_0x62e9('0x2e')],qs[_0x62e9('0x44')](_0x6d2df9[_0x62e9('0x30')][_0x62e9('0x44')]));_0x3c2cc5[_0x62e9('0x33')]=_0x3c2cc5[_0x62e9('0x33')][_0x62e9('0x45')]?_0x3c2cc5['attributes']:_0x5ab16c[_0x62e9('0x2e')];_0x3c2cc5[_0x62e9('0x36')]=qs[_0x62e9('0x37')](_0x6d2df9['query'][_0x62e9('0x37')]);_0x3c2cc5['where']=qs[_0x62e9('0x31')](_['pick'](_0x6d2df9[_0x62e9('0x30')],_0x5ab16c['filters']));if(_0x6d2df9[_0x62e9('0x30')][_0x62e9('0x39')]){_0x3c2cc5[_0x62e9('0x3a')]=_[_0x62e9('0x3b')](_0x3c2cc5['where'],{'$or':_['map'](_0x3c2cc5[_0x62e9('0x33')],function(_0x57212d){var _0x937265={};_0x937265[_0x57212d]={'$like':'%'+_0x6d2df9[_0x62e9('0x30')][_0x62e9('0x39')]+'%'};return _0x937265;})});}_0x3c2cc5=_['merge']({},_0x3c2cc5,_0x6d2df9[_0x62e9('0x3d')]);return _0x205529[_0x62e9('0x4a')](_0x3c2cc5);}})['then'](function(_0x46b992){if(_0x46b992){_0x46dfc3=_0x46b992[_0x62e9('0x45')];if(!_0x6d2df9['query'][_0x62e9('0x34')]('nolimit')){_0x3c2cc5[_0x62e9('0x1e')]=qs[_0x62e9('0x1e')](_0x6d2df9['query']['limit']);_0x3c2cc5[_0x62e9('0x1d')]=qs[_0x62e9('0x1d')](_0x6d2df9[_0x62e9('0x30')][_0x62e9('0x1d')]);}return _0x205529['getFields'](_0x3c2cc5);}})['then'](function(_0x6b4700){if(_0x6b4700){return _0x6b4700?{'count':_0x46dfc3,'rows':_0x6b4700}:null;}})[_0x62e9('0x3f')](respondWithResult(_0x3e9815,null))['catch'](handleError(_0x3e9815,null));};exports[_0x62e9('0x4e')]=function(_0x3db006,_0x943a81,_0xa5f7cf){var _0x33cb77={};var _0x2e7976={};var _0x37d54e;var _0x9724ed;return db[_0x62e9('0x3e')][_0x62e9('0x4b')]({'where':{'id':_0x3db006['params']['id']}})[_0x62e9('0x3f')](handleEntityNotFound(_0x943a81,null))[_0x62e9('0x3f')](function(_0x459139){if(_0x459139){_0x37d54e=_0x459139;_0x2e7976['model']=_[_0x62e9('0x2f')](db[_0x62e9('0x4d')][_0x62e9('0x2c')]);_0x2e7976[_0x62e9('0x30')]=_[_0x62e9('0x2f')](_0x3db006[_0x62e9('0x30')]);_0x2e7976[_0x62e9('0x31')]=_['intersection'](_0x2e7976['model'],_0x2e7976[_0x62e9('0x30')]);_0x33cb77[_0x62e9('0x33')]=_[_0x62e9('0x32')](_0x2e7976[_0x62e9('0x2e')],qs['fields'](_0x3db006[_0x62e9('0x30')]['fields']));_0x33cb77['attributes']=_0x33cb77[_0x62e9('0x33')][_0x62e9('0x45')]?_0x33cb77[_0x62e9('0x33')]:_0x2e7976[_0x62e9('0x2e')];_0x33cb77['order']=qs[_0x62e9('0x37')](_0x3db006[_0x62e9('0x30')][_0x62e9('0x37')]);_0x33cb77['where']=qs[_0x62e9('0x31')](_[_0x62e9('0x38')](_0x3db006['query'],_0x2e7976['filters']));if(_0x3db006[_0x62e9('0x30')][_0x62e9('0x39')]){_0x33cb77['where']=_[_0x62e9('0x3b')](_0x33cb77['where'],{'$or':_[_0x62e9('0x2b')](_0x33cb77['attributes'],function(_0x36ef84){var _0xd6f59a={};_0xd6f59a[_0x36ef84]={'$like':'%'+_0x3db006[_0x62e9('0x30')]['filter']+'%'};return _0xd6f59a;})});}_0x33cb77=_[_0x62e9('0x3b')]({},_0x33cb77,_0x3db006['options']);return _0x37d54e[_0x62e9('0x4e')](_0x33cb77);}})['then'](function(_0x422ef1){if(_0x422ef1){_0x9724ed=_0x422ef1[_0x62e9('0x45')];if(!_0x3db006[_0x62e9('0x30')]['hasOwnProperty'](_0x62e9('0x35'))){_0x33cb77[_0x62e9('0x1e')]=qs['limit'](_0x3db006[_0x62e9('0x30')][_0x62e9('0x1e')]);_0x33cb77[_0x62e9('0x1d')]=qs[_0x62e9('0x1d')](_0x3db006[_0x62e9('0x30')]['offset']);}return _0x37d54e[_0x62e9('0x4e')](_0x33cb77);}})[_0x62e9('0x3f')](function(_0x12e01b){if(_0x12e01b){return _0x12e01b?{'count':_0x9724ed,'rows':_0x12e01b}:null;}})[_0x62e9('0x3f')](respondWithResult(_0x943a81,null))[_0x62e9('0x42')](handleError(_0x943a81,null));};exports[_0x62e9('0x4f')]=function(_0x344987,_0x7fa38e,_0x1b1766){var _0x32373e={};var _0x575901={};var _0x12471e;var _0x2e5c2c;return db[_0x62e9('0x3e')][_0x62e9('0x4b')]({'where':{'id':_0x344987[_0x62e9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7fa38e,null))[_0x62e9('0x3f')](function(_0xf621a){if(_0xf621a){_0x12471e=_0xf621a;_0x575901[_0x62e9('0x2e')]=_[_0x62e9('0x2f')](db[_0x62e9('0x4d')][_0x62e9('0x2c')]);_0x575901[_0x62e9('0x30')]=_[_0x62e9('0x2f')](_0x344987['query']);_0x575901['filters']=_[_0x62e9('0x32')](_0x575901[_0x62e9('0x2e')],_0x575901['query']);_0x32373e['attributes']=_[_0x62e9('0x32')](_0x575901[_0x62e9('0x2e')],qs['fields'](_0x344987[_0x62e9('0x30')][_0x62e9('0x44')]));_0x32373e[_0x62e9('0x33')]=_0x32373e[_0x62e9('0x33')]['length']?_0x32373e[_0x62e9('0x33')]:_0x575901['model'];_0x32373e['order']=qs[_0x62e9('0x37')](_0x344987['query'][_0x62e9('0x37')]);_0x32373e[_0x62e9('0x3a')]=qs[_0x62e9('0x31')](_['pick'](_0x344987['query'],_0x575901[_0x62e9('0x31')]));if(_0x344987['query']['filter']){_0x32373e['where']=_[_0x62e9('0x3b')](_0x32373e[_0x62e9('0x3a')],{'$or':_[_0x62e9('0x2b')](_0x32373e[_0x62e9('0x33')],function(_0x27f17f){var _0x36f75a={};_0x36f75a[_0x27f17f]={'$like':'%'+_0x344987[_0x62e9('0x30')]['filter']+'%'};return _0x36f75a;})});}_0x32373e=_['merge']({},_0x32373e,_0x344987[_0x62e9('0x3d')]);return _0x12471e['getDescriptions'](_0x32373e);}})[_0x62e9('0x3f')](function(_0x239914){if(_0x239914){_0x2e5c2c=_0x239914[_0x62e9('0x45')];if(!_0x344987['query'][_0x62e9('0x34')](_0x62e9('0x35'))){_0x32373e[_0x62e9('0x1e')]=qs[_0x62e9('0x1e')](_0x344987[_0x62e9('0x30')][_0x62e9('0x1e')]);_0x32373e[_0x62e9('0x1d')]=qs[_0x62e9('0x1d')](_0x344987[_0x62e9('0x30')][_0x62e9('0x1d')]);}return _0x12471e[_0x62e9('0x4f')](_0x32373e);}})[_0x62e9('0x3f')](function(_0x48d38d){if(_0x48d38d){return _0x48d38d?{'count':_0x2e5c2c,'rows':_0x48d38d}:null;}})[_0x62e9('0x3f')](respondWithResult(_0x7fa38e,null))[_0x62e9('0x42')](handleError(_0x7fa38e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 1d29950..5cfc619 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 _0xfe3c=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x411770,_0x3ffa83){var _0x418ffe=function(_0x19e9a2){while(--_0x19e9a2){_0x411770['push'](_0x411770['shift']());}};_0x418ffe(++_0x3ffa83);}(_0xfe3c,0x83));var _0xcfe3=function(_0x25482a,_0x3d215a){_0x25482a=_0x25482a-0x0;var _0x11a6e8=_0xfe3c[_0x25482a];return _0x11a6e8;};'use strict';var _=require(_0xcfe3('0x0'));var util=require(_0xcfe3('0x1'));var logger=require(_0xcfe3('0x2'))(_0xcfe3('0x3'));var moment=require(_0xcfe3('0x4'));var BPromise=require(_0xcfe3('0x5'));var rp=require(_0xcfe3('0x6'));var fs=require('fs');var path=require(_0xcfe3('0x7'));var rimraf=require('rimraf');var config=require(_0xcfe3('0x8'));var attributes=require(_0xcfe3('0x9'));module[_0xcfe3('0xa')]=function(_0x44ec77,_0x43e6db){return _0x44ec77[_0xcfe3('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0xcfe3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0df2=['./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','util','api','request-promise','rimraf','../../config/environment'];(function(_0x4bf19e,_0x229ad1){var _0x50825e=function(_0x19f6f2){while(--_0x19f6f2){_0x4bf19e['push'](_0x4bf19e['shift']());}};_0x50825e(++_0x229ad1);}(_0x0df2,0x1f2));var _0x20df=function(_0x2cd3a7,_0x278f96){_0x2cd3a7=_0x2cd3a7-0x0;var _0x1aeb9b=_0x0df2[_0x2cd3a7];return _0x1aeb9b;};'use strict';var _=require(_0x20df('0x0'));var util=require(_0x20df('0x1'));var logger=require('../../config/logger')(_0x20df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x20df('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20df('0x4'));var config=require(_0x20df('0x5'));var attributes=require(_0x20df('0x6'));module['exports']=function(_0x25220d,_0x336851){return _0x25220d[_0x20df('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x20df('0x8'),'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 34cb12b..1028a63 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 _0xac60=['../../config/logger','rpc','../../config/environment','http','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ef140,_0x295f20){var _0x32735f=function(_0x473b6e){while(--_0x473b6e){_0x2ef140['push'](_0x2ef140['shift']());}};_0x32735f(++_0x295f20);}(_0xac60,0x151));var _0x0ac6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xac60[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ac6('0x0'));var BPromise=require(_0x0ac6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ac6('0x2'));var db=require(_0x0ac6('0x3'))['db'];var utils=require(_0x0ac6('0x4'));var logger=require(_0x0ac6('0x5'))(_0x0ac6('0x6'));var config=require(_0x0ac6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ac6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x112861,_0x41b96d,_0x19b043){return new BPromise(function(_0x356f13,_0x57f0be){return client['request'](_0x112861,_0x19b043)[_0x0ac6('0x9')](function(_0x1254ed){logger['info'](_0x0ac6('0xa'),_0x41b96d,_0x0ac6('0xb'));logger['debug'](_0x0ac6('0xc'),_0x41b96d,_0x0ac6('0xb'),JSON['stringify'](_0x1254ed));if(_0x1254ed[_0x0ac6('0xd')]){if(_0x1254ed[_0x0ac6('0xd')][_0x0ac6('0xe')]===0x1f4){logger[_0x0ac6('0xd')](_0x0ac6('0xa'),_0x41b96d,_0x1254ed[_0x0ac6('0xd')]['message']);return _0x57f0be(_0x1254ed[_0x0ac6('0xd')][_0x0ac6('0xf')]);}logger[_0x0ac6('0xd')](_0x0ac6('0xa'),_0x41b96d,_0x1254ed[_0x0ac6('0xd')][_0x0ac6('0xf')]);return _0x356f13(_0x1254ed['error']['message']);}else{logger['info'](_0x0ac6('0xa'),_0x41b96d,_0x0ac6('0xb'));_0x356f13(_0x1254ed[_0x0ac6('0x10')][_0x0ac6('0xf')]);}})[_0x0ac6('0x11')](function(_0x11b45d){logger['error'](_0x0ac6('0xa'),_0x41b96d,_0x11b45d);_0x57f0be(_0x11b45d);});});} \ No newline at end of file +var _0x9e5a=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util'];(function(_0x4ec2e2,_0x25c82e){var _0x57bc19=function(_0x169cd3){while(--_0x169cd3){_0x4ec2e2['push'](_0x4ec2e2['shift']());}};_0x57bc19(++_0x25c82e);}(_0x9e5a,0x12b));var _0xa9e5=function(_0x58f136,_0xd3fc31){_0x58f136=_0x58f136-0x0;var _0x2be7a8=_0x9e5a[_0x58f136];return _0x2be7a8;};'use strict';var _=require('lodash');var util=require(_0xa9e5('0x0'));var moment=require(_0xa9e5('0x1'));var BPromise=require(_0xa9e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9e5('0x3'));var db=require(_0xa9e5('0x4'))['db'];var utils=require(_0xa9e5('0x5'));var logger=require('../../config/logger')(_0xa9e5('0x6'));var config=require(_0xa9e5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16cd9f,_0xee2eae,_0x303842){return new BPromise(function(_0x3fd732,_0xd3b035){return client[_0xa9e5('0x9')](_0x16cd9f,_0x303842)[_0xa9e5('0xa')](function(_0xc427ba){logger[_0xa9e5('0xb')](_0xa9e5('0xc'),_0xee2eae,_0xa9e5('0xd'));logger[_0xa9e5('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xee2eae,_0xa9e5('0xd'),JSON[_0xa9e5('0xf')](_0xc427ba));if(_0xc427ba[_0xa9e5('0x10')]){if(_0xc427ba['error'][_0xa9e5('0x11')]===0x1f4){logger[_0xa9e5('0x10')](_0xa9e5('0xc'),_0xee2eae,_0xc427ba['error'][_0xa9e5('0x12')]);return _0xd3b035(_0xc427ba['error'][_0xa9e5('0x12')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xee2eae,_0xc427ba[_0xa9e5('0x10')][_0xa9e5('0x12')]);return _0x3fd732(_0xc427ba[_0xa9e5('0x10')]['message']);}else{logger['info'](_0xa9e5('0xc'),_0xee2eae,_0xa9e5('0xd'));_0x3fd732(_0xc427ba[_0xa9e5('0x13')][_0xa9e5('0x12')]);}})['catch'](function(_0x222eb0){logger['error'](_0xa9e5('0xc'),_0xee2eae,_0x222eb0);_0xd3b035(_0x222eb0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 790b302..88084eb 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 _0x350f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x350f,0xd9));var _0xf350=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x350f[_0x52f159];return _0x156799;};'use strict';var multer=require(_0xf350('0x0'));var util=require(_0xf350('0x1'));var path=require(_0xf350('0x2'));var timeout=require(_0xf350('0x3'));var express=require(_0xf350('0x4'));var router=express[_0xf350('0x5')]();var fs_extra=require(_0xf350('0x6'));var auth=require(_0xf350('0x7'));var interaction=require(_0xf350('0x8'));var config=require(_0xf350('0x9'));var controller=require(_0xf350('0xa'));router[_0xf350('0xb')]('/',auth[_0xf350('0xc')](),controller['index']);router[_0xf350('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf350('0xd')]('/',auth[_0xf350('0xc')](),controller[_0xf350('0xe')]);router[_0xf350('0xf')](_0xf350('0x10'),auth[_0xf350('0xc')](),controller[_0xf350('0x11')]);router['delete']('/:id',auth[_0xf350('0xc')](),controller[_0xf350('0x12')]);module[_0xf350('0x13')]=router; \ No newline at end of file +var _0x6514=['show','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id'];(function(_0x2434c0,_0xc33b8a){var _0x439905=function(_0x822bd1){while(--_0x822bd1){_0x2434c0['push'](_0x2434c0['shift']());}};_0x439905(++_0xc33b8a);}(_0x6514,0x146));var _0x4651=function(_0x55400f,_0x4a7639){_0x55400f=_0x55400f-0x0;var _0x20c175=_0x6514[_0x55400f];return _0x20c175;};'use strict';var multer=require('multer');var util=require(_0x4651('0x0'));var path=require(_0x4651('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4651('0x2')]();var fs_extra=require(_0x4651('0x3'));var auth=require(_0x4651('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4651('0x5'));var controller=require(_0x4651('0x6'));router[_0x4651('0x7')]('/',auth[_0x4651('0x8')](),controller['index']);router[_0x4651('0x7')](_0x4651('0x9'),auth[_0x4651('0x8')](),controller[_0x4651('0xa')]);router['post']('/',auth[_0x4651('0x8')](),controller['create']);router[_0x4651('0xb')](_0x4651('0x9'),auth[_0x4651('0x8')](),controller[_0x4651('0xc')]);router[_0x4651('0xd')](_0x4651('0x9'),auth['isAuthenticated'](),controller[_0x4651('0xe')]);module[_0x4651('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 39ce15f..97ebde6 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 _0xb078=['ENUM','customVariable','BOOLEAN','string','variable','picklist','STRING'];(function(_0x39149,_0x548a65){var _0x5a0f05=function(_0x260e31){while(--_0x260e31){_0x39149['push'](_0x39149['shift']());}};_0x5a0f05(++_0x548a65);}(_0xb078,0xa4));var _0x8b07=function(_0x1a47c5,_0x4f6511){_0x1a47c5=_0x1a47c5-0x0;var _0x455a32=_0xb078[_0x1a47c5];return _0x455a32;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8b07('0x0'),_0x8b07('0x1'),'customVariable','keyValue',_0x8b07('0x2')),'defaultValue':_0x8b07('0x0')},'content':{'type':Sequelize[_0x8b07('0x3')]},'key':{'type':Sequelize[_0x8b07('0x3')]},'keyType':{'type':Sequelize[_0x8b07('0x4')]('string',_0x8b07('0x1'),_0x8b07('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b07('0x3')]},'nameField':{'type':Sequelize[_0x8b07('0x3')]},'customField':{'type':Sequelize[_0x8b07('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6116=['ENUM','string','variable','customVariable','picklist','STRING','exports'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x6116,0x109));var _0x6611=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6116[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module[_0x6611('0x0')]={'type':{'type':Sequelize[_0x6611('0x1')](_0x6611('0x2'),_0x6611('0x3'),_0x6611('0x4'),'keyValue',_0x6611('0x5')),'defaultValue':_0x6611('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6611('0x6')]},'keyType':{'type':Sequelize[_0x6611('0x1')](_0x6611('0x2'),_0x6611('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6611('0x6')]},'idField':{'type':Sequelize[_0x6611('0x6')]},'nameField':{'type':Sequelize[_0x6611('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6611('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fd0adc9..86f5662 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 _0xeb10=['limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','SugarcrmField','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','path','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xeb10,0xbd));var _0x0eb1=function(_0x4375bb,_0x2e8bb8){_0x4375bb=_0x4375bb-0x0;var _0x432073=_0xeb10[_0x4375bb];return _0x432073;};'use strict';var emlformat=require(_0x0eb1('0x0'));var rimraf=require(_0x0eb1('0x1'));var zipdir=require(_0x0eb1('0x2'));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('util');var path=require(_0x0eb1('0x3'));var sox=require('sox');var csv=require(_0x0eb1('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0eb1('0x5'));var _=require(_0x0eb1('0x6'));var squel=require('squel');var crypto=require(_0x0eb1('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0eb1('0x4'));var querystring=require(_0x0eb1('0x8'));var Papa=require('papaparse');var Redis=require(_0x0eb1('0x9'));var authService=require(_0x0eb1('0xa'));var qs=require(_0x0eb1('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eb1('0xc'));var logger=require(_0x0eb1('0xd'))(_0x0eb1('0xe'));var utils=require(_0x0eb1('0xf'));var config=require(_0x0eb1('0x10'));var licenseUtil=require(_0x0eb1('0x11'));var db=require(_0x0eb1('0x12'))['db'];function respondWithStatusCode(_0x29dc62,_0xdd118f){_0xdd118f=_0xdd118f||0xcc;return function(_0x7d22ad){if(_0x7d22ad){return _0x29dc62[_0x0eb1('0x13')](_0xdd118f);}return _0x29dc62[_0x0eb1('0x14')](_0xdd118f)[_0x0eb1('0x15')]();};}function respondWithResult(_0x4608d8,_0x34f936){_0x34f936=_0x34f936||0xc8;return function(_0x517865){if(_0x517865){return _0x4608d8[_0x0eb1('0x14')](_0x34f936)[_0x0eb1('0x16')](_0x517865);}};}function respondWithFilteredResult(_0x5e67c2,_0x2a0385){return function(_0x2e6937){if(_0x2e6937){var _0x1b9525=typeof _0x2a0385[_0x0eb1('0x17')]==='undefined'&&typeof _0x2a0385[_0x0eb1('0x18')]===_0x0eb1('0x19');var _0x1df602=_0x2e6937[_0x0eb1('0x1a')];var _0xa805de=_0x1b9525?0x0:_0x2a0385[_0x0eb1('0x17')];var _0x56489d=_0x1b9525?_0x2e6937['count']:_0x2a0385['offset']+_0x2a0385[_0x0eb1('0x18')];var _0x4b3d36;if(_0x56489d>=_0x1df602){_0x56489d=_0x1df602;_0x4b3d36=0xc8;}else{_0x4b3d36=0xce;}_0x5e67c2[_0x0eb1('0x14')](_0x4b3d36);return _0x5e67c2[_0x0eb1('0x1b')](_0x0eb1('0x1c'),_0xa805de+'-'+_0x56489d+'/'+_0x1df602)[_0x0eb1('0x16')](_0x2e6937);}return null;};}function patchUpdates(_0x343f5c){return function(_0x58b058){try{jsonpatch['apply'](_0x58b058,_0x343f5c,!![]);}catch(_0x31c68d){return BPromise[_0x0eb1('0x1d')](_0x31c68d);}return _0x58b058[_0x0eb1('0x1e')]();};}function saveUpdates(_0xafb1f8,_0x47147){return function(_0x4f4389){if(_0x4f4389){return _0x4f4389[_0x0eb1('0x1f')](_0xafb1f8)['then'](function(_0xf742d1){return _0xf742d1;});}return null;};}function removeEntity(_0x477f7d,_0x86ee32){return function(_0x556566){if(_0x556566){return _0x556566[_0x0eb1('0x20')]()[_0x0eb1('0x21')](function(){_0x477f7d[_0x0eb1('0x14')](0xcc)[_0x0eb1('0x15')]();});}};}function handleEntityNotFound(_0xa6b750,_0x5db944){return function(_0x2c6eb3){if(!_0x2c6eb3){_0xa6b750[_0x0eb1('0x13')](0x194);}return _0x2c6eb3;};}function handleError(_0x469842,_0x2a8d92){_0x2a8d92=_0x2a8d92||0x1f4;return function(_0x172265){logger[_0x0eb1('0x22')](_0x172265[_0x0eb1('0x23')]);if(_0x172265[_0x0eb1('0x24')]){delete _0x172265[_0x0eb1('0x24')];}_0x469842[_0x0eb1('0x14')](_0x2a8d92)[_0x0eb1('0x25')](_0x172265);};}exports[_0x0eb1('0x26')]=function(_0x4bf32c,_0x2c610f){var _0x55df04={},_0x1055b8={},_0x26fa70={'count':0x0,'rows':[]};var _0x164f01=_[_0x0eb1('0x27')](db['SugarcrmField'][_0x0eb1('0x28')],function(_0x570570){return{'name':_0x570570[_0x0eb1('0x29')],'type':_0x570570[_0x0eb1('0x2a')]['key']};});_0x1055b8[_0x0eb1('0x2b')]=_[_0x0eb1('0x27')](_0x164f01,_0x0eb1('0x24'));_0x1055b8[_0x0eb1('0x2c')]=_['keys'](_0x4bf32c[_0x0eb1('0x2c')]);_0x1055b8[_0x0eb1('0x2d')]=_[_0x0eb1('0x2e')](_0x1055b8[_0x0eb1('0x2b')],_0x1055b8[_0x0eb1('0x2c')]);_0x55df04[_0x0eb1('0x2f')]=_['intersection'](_0x1055b8['model'],qs[_0x0eb1('0x30')](_0x4bf32c[_0x0eb1('0x2c')][_0x0eb1('0x30')]));_0x55df04[_0x0eb1('0x2f')]=_0x55df04[_0x0eb1('0x2f')][_0x0eb1('0x31')]?_0x55df04['attributes']:_0x1055b8['model'];if(!_0x4bf32c[_0x0eb1('0x2c')][_0x0eb1('0x32')]('nolimit')){_0x55df04[_0x0eb1('0x18')]=qs['limit'](_0x4bf32c['query']['limit']);_0x55df04[_0x0eb1('0x17')]=qs[_0x0eb1('0x17')](_0x4bf32c[_0x0eb1('0x2c')][_0x0eb1('0x17')]);}_0x55df04[_0x0eb1('0x33')]=qs['sort'](_0x4bf32c[_0x0eb1('0x2c')][_0x0eb1('0x34')]);_0x55df04[_0x0eb1('0x35')]=qs['filters'](_[_0x0eb1('0x36')](_0x4bf32c[_0x0eb1('0x2c')],_0x1055b8[_0x0eb1('0x2d')]),_0x164f01);if(_0x4bf32c['query']['filter']){_0x55df04[_0x0eb1('0x35')]=_['merge'](_0x55df04[_0x0eb1('0x35')],{'$or':_[_0x0eb1('0x27')](_0x164f01,function(_0x4b7444){if(_0x4b7444[_0x0eb1('0x2a')]!==_0x0eb1('0x37')){var _0x1ca311={};_0x1ca311[_0x4b7444[_0x0eb1('0x24')]]={'$like':'%'+_0x4bf32c['query'][_0x0eb1('0x38')]+'%'};return _0x1ca311;}})});}_0x55df04=_[_0x0eb1('0x39')]({},_0x55df04,_0x4bf32c[_0x0eb1('0x3a')]);var _0x4c88a9={'where':_0x55df04[_0x0eb1('0x35')]};return db[_0x0eb1('0x3b')][_0x0eb1('0x1a')](_0x4c88a9)[_0x0eb1('0x21')](function(_0x3f8166){_0x26fa70[_0x0eb1('0x1a')]=_0x3f8166;if(_0x4bf32c['query'][_0x0eb1('0x3c')]){_0x55df04['include']=[{'all':!![]}];}return db[_0x0eb1('0x3b')][_0x0eb1('0x3d')](_0x55df04);})[_0x0eb1('0x21')](function(_0x195300){_0x26fa70[_0x0eb1('0x3e')]=_0x195300;return _0x26fa70;})['then'](respondWithFilteredResult(_0x2c610f,_0x55df04))[_0x0eb1('0x3f')](handleError(_0x2c610f,null));};exports[_0x0eb1('0x40')]=function(_0x37dfc8,_0xa30b31){var _0x53a045={'raw':!![],'where':{'id':_0x37dfc8[_0x0eb1('0x41')]['id']}},_0x26d756={};_0x26d756[_0x0eb1('0x2b')]=_[_0x0eb1('0x42')](db[_0x0eb1('0x3b')][_0x0eb1('0x28')]);_0x26d756['query']=_[_0x0eb1('0x42')](_0x37dfc8['query']);_0x26d756[_0x0eb1('0x2d')]=_[_0x0eb1('0x2e')](_0x26d756[_0x0eb1('0x2b')],_0x26d756[_0x0eb1('0x2c')]);_0x53a045[_0x0eb1('0x2f')]=_[_0x0eb1('0x2e')](_0x26d756['model'],qs[_0x0eb1('0x30')](_0x37dfc8['query'][_0x0eb1('0x30')]));_0x53a045[_0x0eb1('0x2f')]=_0x53a045[_0x0eb1('0x2f')][_0x0eb1('0x31')]?_0x53a045[_0x0eb1('0x2f')]:_0x26d756[_0x0eb1('0x2b')];if(_0x37dfc8[_0x0eb1('0x2c')][_0x0eb1('0x3c')]){_0x53a045[_0x0eb1('0x43')]=[{'all':!![]}];}_0x53a045=_['merge']({},_0x53a045,_0x37dfc8[_0x0eb1('0x3a')]);return db[_0x0eb1('0x3b')][_0x0eb1('0x44')](_0x53a045)[_0x0eb1('0x21')](handleEntityNotFound(_0xa30b31,null))[_0x0eb1('0x21')](respondWithResult(_0xa30b31,null))[_0x0eb1('0x3f')](handleError(_0xa30b31,null));};exports[_0x0eb1('0x45')]=function(_0x16cc59,_0x16c3b8){return db[_0x0eb1('0x3b')]['create'](_0x16cc59[_0x0eb1('0x46')],{})[_0x0eb1('0x21')](respondWithResult(_0x16c3b8,0xc9))[_0x0eb1('0x3f')](handleError(_0x16c3b8,null));};exports[_0x0eb1('0x1f')]=function(_0x59da88,_0xdd59a9){if(_0x59da88[_0x0eb1('0x46')]['id']){delete _0x59da88[_0x0eb1('0x46')]['id'];}return db[_0x0eb1('0x3b')][_0x0eb1('0x44')]({'where':{'id':_0x59da88[_0x0eb1('0x41')]['id']}})[_0x0eb1('0x21')](handleEntityNotFound(_0xdd59a9,null))[_0x0eb1('0x21')](saveUpdates(_0x59da88[_0x0eb1('0x46')],null))[_0x0eb1('0x21')](respondWithResult(_0xdd59a9,null))[_0x0eb1('0x3f')](handleError(_0xdd59a9,null));};exports[_0x0eb1('0x20')]=function(_0x38a563,_0x4c524c){return db[_0x0eb1('0x3b')]['find']({'where':{'id':_0x38a563[_0x0eb1('0x41')]['id']}})['then'](handleEntityNotFound(_0x4c524c,null))[_0x0eb1('0x21')](removeEntity(_0x4c524c,null))['catch'](handleError(_0x4c524c,null));}; \ No newline at end of file +var _0x8c23=['where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort'];(function(_0x3e36b6,_0x43de3b){var _0x4a3a36=function(_0x13f6a0){while(--_0x13f6a0){_0x3e36b6['push'](_0x3e36b6['shift']());}};_0x4a3a36(++_0x43de3b);}(_0x8c23,0xf1));var _0x38c2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8c23[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x38c2('0x0'));var rimraf=require(_0x38c2('0x1'));var zipdir=require(_0x38c2('0x2'));var jsonpatch=require(_0x38c2('0x3'));var rp=require('request-promise');var moment=require(_0x38c2('0x4'));var BPromise=require(_0x38c2('0x5'));var Mustache=require(_0x38c2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x38c2('0x7'));var csv=require(_0x38c2('0x8'));var ejs=require(_0x38c2('0x9'));var fs=require('fs');var fs_extra=require(_0x38c2('0xa'));var _=require(_0x38c2('0xb'));var squel=require(_0x38c2('0xc'));var crypto=require(_0x38c2('0xd'));var jsforce=require(_0x38c2('0xe'));var deskjs=require(_0x38c2('0xf'));var toCsv=require(_0x38c2('0x8'));var querystring=require(_0x38c2('0x10'));var Papa=require(_0x38c2('0x11'));var Redis=require('ioredis');var authService=require(_0x38c2('0x12'));var qs=require(_0x38c2('0x13'));var as=require(_0x38c2('0x14'));var hardwareService=require(_0x38c2('0x15'));var logger=require(_0x38c2('0x16'))(_0x38c2('0x17'));var utils=require(_0x38c2('0x18'));var config=require(_0x38c2('0x19'));var licenseUtil=require(_0x38c2('0x1a'));var db=require(_0x38c2('0x1b'))['db'];function respondWithStatusCode(_0xb4e309,_0x3bd40a){_0x3bd40a=_0x3bd40a||0xcc;return function(_0x49319e){if(_0x49319e){return _0xb4e309[_0x38c2('0x1c')](_0x3bd40a);}return _0xb4e309[_0x38c2('0x1d')](_0x3bd40a)[_0x38c2('0x1e')]();};}function respondWithResult(_0x5ac8a5,_0x1e9761){_0x1e9761=_0x1e9761||0xc8;return function(_0x173f04){if(_0x173f04){return _0x5ac8a5[_0x38c2('0x1d')](_0x1e9761)[_0x38c2('0x1f')](_0x173f04);}};}function respondWithFilteredResult(_0x3c6bde,_0x18f160){return function(_0x30aedb){if(_0x30aedb){var _0x47d7aa=typeof _0x18f160[_0x38c2('0x20')]==='undefined'&&typeof _0x18f160[_0x38c2('0x21')]===_0x38c2('0x22');var _0xa8fcf0=_0x30aedb[_0x38c2('0x23')];var _0x2a07b3=_0x47d7aa?0x0:_0x18f160[_0x38c2('0x20')];var _0x2e641f=_0x47d7aa?_0x30aedb['count']:_0x18f160[_0x38c2('0x20')]+_0x18f160[_0x38c2('0x21')];var _0x50ec0f;if(_0x2e641f>=_0xa8fcf0){_0x2e641f=_0xa8fcf0;_0x50ec0f=0xc8;}else{_0x50ec0f=0xce;}_0x3c6bde[_0x38c2('0x1d')](_0x50ec0f);return _0x3c6bde['set'](_0x38c2('0x24'),_0x2a07b3+'-'+_0x2e641f+'/'+_0xa8fcf0)[_0x38c2('0x1f')](_0x30aedb);}return null;};}function patchUpdates(_0x3bf1e0){return function(_0x16d16a){try{jsonpatch['apply'](_0x16d16a,_0x3bf1e0,!![]);}catch(_0x43e7ef){return BPromise['reject'](_0x43e7ef);}return _0x16d16a[_0x38c2('0x25')]();};}function saveUpdates(_0x19cc7b,_0x3e32ea){return function(_0x38c97d){if(_0x38c97d){return _0x38c97d[_0x38c2('0x26')](_0x19cc7b)[_0x38c2('0x27')](function(_0x2026b1){return _0x2026b1;});}return null;};}function removeEntity(_0x353b22,_0x2238de){return function(_0x27be66){if(_0x27be66){return _0x27be66[_0x38c2('0x28')]()['then'](function(){_0x353b22[_0x38c2('0x1d')](0xcc)[_0x38c2('0x1e')]();});}};}function handleEntityNotFound(_0xb1e016,_0x3aff3a){return function(_0x40b7b4){if(!_0x40b7b4){_0xb1e016[_0x38c2('0x1c')](0x194);}return _0x40b7b4;};}function handleError(_0x1bb1dd,_0x21a8c9){_0x21a8c9=_0x21a8c9||0x1f4;return function(_0x22b852){logger['error'](_0x22b852['stack']);if(_0x22b852[_0x38c2('0x29')]){delete _0x22b852[_0x38c2('0x29')];}_0x1bb1dd[_0x38c2('0x1d')](_0x21a8c9)[_0x38c2('0x2a')](_0x22b852);};}exports[_0x38c2('0x2b')]=function(_0x59dfc7,_0x222382){var _0x35479c={},_0x21480c={},_0x59eaa3={'count':0x0,'rows':[]};var _0x302131=_[_0x38c2('0x2c')](db[_0x38c2('0x2d')][_0x38c2('0x2e')],function(_0x33ab8c){return{'name':_0x33ab8c[_0x38c2('0x2f')],'type':_0x33ab8c['type'][_0x38c2('0x30')]};});_0x21480c[_0x38c2('0x31')]=_['map'](_0x302131,'name');_0x21480c[_0x38c2('0x32')]=_[_0x38c2('0x33')](_0x59dfc7[_0x38c2('0x32')]);_0x21480c[_0x38c2('0x34')]=_[_0x38c2('0x35')](_0x21480c[_0x38c2('0x31')],_0x21480c[_0x38c2('0x32')]);_0x35479c['attributes']=_[_0x38c2('0x35')](_0x21480c[_0x38c2('0x31')],qs[_0x38c2('0x36')](_0x59dfc7['query']['fields']));_0x35479c[_0x38c2('0x37')]=_0x35479c[_0x38c2('0x37')]['length']?_0x35479c[_0x38c2('0x37')]:_0x21480c[_0x38c2('0x31')];if(!_0x59dfc7['query']['hasOwnProperty'](_0x38c2('0x38'))){_0x35479c[_0x38c2('0x21')]=qs[_0x38c2('0x21')](_0x59dfc7[_0x38c2('0x32')][_0x38c2('0x21')]);_0x35479c[_0x38c2('0x20')]=qs[_0x38c2('0x20')](_0x59dfc7['query'][_0x38c2('0x20')]);}_0x35479c[_0x38c2('0x39')]=qs[_0x38c2('0x3a')](_0x59dfc7[_0x38c2('0x32')][_0x38c2('0x3a')]);_0x35479c[_0x38c2('0x3b')]=qs[_0x38c2('0x34')](_[_0x38c2('0x3c')](_0x59dfc7[_0x38c2('0x32')],_0x21480c[_0x38c2('0x34')]),_0x302131);if(_0x59dfc7[_0x38c2('0x32')][_0x38c2('0x3d')]){_0x35479c[_0x38c2('0x3b')]=_[_0x38c2('0x3e')](_0x35479c[_0x38c2('0x3b')],{'$or':_['map'](_0x302131,function(_0x1722dd){if(_0x1722dd['type']!==_0x38c2('0x3f')){var _0x5b8719={};_0x5b8719[_0x1722dd['name']]={'$like':'%'+_0x59dfc7['query'][_0x38c2('0x3d')]+'%'};return _0x5b8719;}})});}_0x35479c=_[_0x38c2('0x3e')]({},_0x35479c,_0x59dfc7[_0x38c2('0x40')]);var _0x3c0993={'where':_0x35479c[_0x38c2('0x3b')]};return db[_0x38c2('0x2d')]['count'](_0x3c0993)[_0x38c2('0x27')](function(_0x177ace){_0x59eaa3[_0x38c2('0x23')]=_0x177ace;if(_0x59dfc7[_0x38c2('0x32')]['includeAll']){_0x35479c[_0x38c2('0x41')]=[{'all':!![]}];}return db[_0x38c2('0x2d')][_0x38c2('0x42')](_0x35479c);})['then'](function(_0x55ddb8){_0x59eaa3[_0x38c2('0x43')]=_0x55ddb8;return _0x59eaa3;})['then'](respondWithFilteredResult(_0x222382,_0x35479c))['catch'](handleError(_0x222382,null));};exports[_0x38c2('0x44')]=function(_0x2891aa,_0x151a55){var _0x287c41={'raw':!![],'where':{'id':_0x2891aa['params']['id']}},_0x4bb787={};_0x4bb787[_0x38c2('0x31')]=_[_0x38c2('0x33')](db['SugarcrmField'][_0x38c2('0x2e')]);_0x4bb787[_0x38c2('0x32')]=_[_0x38c2('0x33')](_0x2891aa[_0x38c2('0x32')]);_0x4bb787[_0x38c2('0x34')]=_['intersection'](_0x4bb787[_0x38c2('0x31')],_0x4bb787[_0x38c2('0x32')]);_0x287c41[_0x38c2('0x37')]=_[_0x38c2('0x35')](_0x4bb787['model'],qs[_0x38c2('0x36')](_0x2891aa[_0x38c2('0x32')][_0x38c2('0x36')]));_0x287c41[_0x38c2('0x37')]=_0x287c41[_0x38c2('0x37')][_0x38c2('0x45')]?_0x287c41[_0x38c2('0x37')]:_0x4bb787[_0x38c2('0x31')];if(_0x2891aa[_0x38c2('0x32')][_0x38c2('0x46')]){_0x287c41[_0x38c2('0x41')]=[{'all':!![]}];}_0x287c41=_[_0x38c2('0x3e')]({},_0x287c41,_0x2891aa[_0x38c2('0x40')]);return db['SugarcrmField'][_0x38c2('0x47')](_0x287c41)[_0x38c2('0x27')](handleEntityNotFound(_0x151a55,null))[_0x38c2('0x27')](respondWithResult(_0x151a55,null))['catch'](handleError(_0x151a55,null));};exports[_0x38c2('0x48')]=function(_0x41c99b,_0x518c45){return db[_0x38c2('0x2d')][_0x38c2('0x48')](_0x41c99b[_0x38c2('0x49')],{})['then'](respondWithResult(_0x518c45,0xc9))[_0x38c2('0x4a')](handleError(_0x518c45,null));};exports['update']=function(_0x26d3e3,_0x3aa3a1){if(_0x26d3e3['body']['id']){delete _0x26d3e3[_0x38c2('0x49')]['id'];}return db[_0x38c2('0x2d')][_0x38c2('0x47')]({'where':{'id':_0x26d3e3['params']['id']}})[_0x38c2('0x27')](handleEntityNotFound(_0x3aa3a1,null))['then'](saveUpdates(_0x26d3e3['body'],null))['then'](respondWithResult(_0x3aa3a1,null))[_0x38c2('0x4a')](handleError(_0x3aa3a1,null));};exports[_0x38c2('0x28')]=function(_0x45ef5a,_0x5c733e){return db[_0x38c2('0x2d')][_0x38c2('0x47')]({'where':{'id':_0x45ef5a['params']['id']}})['then'](handleEntityNotFound(_0x5c733e,null))[_0x38c2('0x27')](removeEntity(_0x5c733e,null))[_0x38c2('0x4a')](handleError(_0x5c733e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 25415f4..20cb9c2 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 _0xa238=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2ee549,_0x2a2b6a){var _0x642a8b=function(_0x128d72){while(--_0x128d72){_0x2ee549['push'](_0x2ee549['shift']());}};_0x642a8b(++_0x2a2b6a);}(_0xa238,0x139));var _0x8a23=function(_0x5d56bb,_0x254c57){_0x5d56bb=_0x5d56bb-0x0;var _0xb1a658=_0xa238[_0x5d56bb];return _0xb1a658;};'use strict';var _=require(_0x8a23('0x0'));var util=require(_0x8a23('0x1'));var logger=require('../../config/logger')(_0x8a23('0x2'));var moment=require(_0x8a23('0x3'));var BPromise=require(_0x8a23('0x4'));var rp=require(_0x8a23('0x5'));var fs=require('fs');var path=require(_0x8a23('0x6'));var rimraf=require(_0x8a23('0x7'));var config=require(_0x8a23('0x8'));var attributes=require(_0x8a23('0x9'));module[_0x8a23('0xa')]=function(_0xcf31cb,_0x1b5505){return _0xcf31cb[_0x8a23('0xb')](_0x8a23('0xc'),attributes,{'tableName':_0x8a23('0xd'),'paranoid':![],'indexes':[{'name':_0x8a23('0xe'),'fields':['idField',_0x8a23('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ce9=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x4ce9,0x180));var _0x94ce=function(_0x53e83f,_0x58e90c){_0x53e83f=_0x53e83f-0x0;var _0x57d1e7=_0x4ce9[_0x53e83f];return _0x57d1e7;};'use strict';var _=require(_0x94ce('0x0'));var util=require(_0x94ce('0x1'));var logger=require(_0x94ce('0x2'))(_0x94ce('0x3'));var moment=require('moment');var BPromise=require(_0x94ce('0x4'));var rp=require(_0x94ce('0x5'));var fs=require('fs');var path=require(_0x94ce('0x6'));var rimraf=require(_0x94ce('0x7'));var config=require(_0x94ce('0x8'));var attributes=require(_0x94ce('0x9'));module[_0x94ce('0xa')]=function(_0x5dc46c,_0x2ecddd){return _0x5dc46c[_0x94ce('0xb')](_0x94ce('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x94ce('0xd'),'fields':[_0x94ce('0xe'),'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 d9192aa..1b29570 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 _0x61fc=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1938f1,_0x4685d){var _0x5b924d=function(_0x5c4a59){while(--_0x5c4a59){_0x1938f1['push'](_0x1938f1['shift']());}};_0x5b924d(++_0x4685d);}(_0x61fc,0x194));var _0xc61f=function(_0x9ccd57,_0x2149ba){_0x9ccd57=_0x9ccd57-0x0;var _0x29ca23=_0x61fc[_0x9ccd57];return _0x29ca23;};'use strict';var _=require(_0xc61f('0x0'));var util=require(_0xc61f('0x1'));var moment=require(_0xc61f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc61f('0x3'));var fs=require('fs');var Redis=require(_0xc61f('0x4'));var db=require(_0xc61f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc61f('0x6'))(_0xc61f('0x7'));var config=require(_0xc61f('0x8'));var jayson=require(_0xc61f('0x9'));var client=jayson[_0xc61f('0xa')][_0xc61f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x63e4c4,_0x27b95c,_0x1359d3){return new BPromise(function(_0x2fc8e3,_0x54ff9b){return client[_0xc61f('0xc')](_0x63e4c4,_0x1359d3)[_0xc61f('0xd')](function(_0x50d257){logger[_0xc61f('0xe')](_0xc61f('0xf'),_0x27b95c,_0xc61f('0x10'));logger[_0xc61f('0x11')](_0xc61f('0x12'),_0x27b95c,'request\x20sent',JSON['stringify'](_0x50d257));if(_0x50d257[_0xc61f('0x13')]){if(_0x50d257['error']['code']===0x1f4){logger[_0xc61f('0x13')](_0xc61f('0xf'),_0x27b95c,_0x50d257[_0xc61f('0x13')][_0xc61f('0x14')]);return _0x54ff9b(_0x50d257[_0xc61f('0x13')][_0xc61f('0x14')]);}logger[_0xc61f('0x13')](_0xc61f('0xf'),_0x27b95c,_0x50d257[_0xc61f('0x13')][_0xc61f('0x14')]);return _0x2fc8e3(_0x50d257[_0xc61f('0x13')][_0xc61f('0x14')]);}else{logger[_0xc61f('0xe')](_0xc61f('0xf'),_0x27b95c,_0xc61f('0x10'));_0x2fc8e3(_0x50d257[_0xc61f('0x15')]['message']);}})[_0xc61f('0x16')](function(_0x23b65b){logger[_0xc61f('0x13')](_0xc61f('0xf'),_0x27b95c,_0x23b65b);_0x54ff9b(_0x23b65b);});});} \ No newline at end of file +var _0xa766=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x353f02,_0x47c044){var _0x269378=function(_0x2b3cdd){while(--_0x2b3cdd){_0x353f02['push'](_0x353f02['shift']());}};_0x269378(++_0x47c044);}(_0xa766,0x152));var _0x6a76=function(_0x3478d6,_0x4ea2c7){_0x3478d6=_0x3478d6-0x0;var _0x398620=_0xa766[_0x3478d6];return _0x398620;};'use strict';var _=require(_0x6a76('0x0'));var util=require(_0x6a76('0x1'));var moment=require(_0x6a76('0x2'));var BPromise=require(_0x6a76('0x3'));var rs=require(_0x6a76('0x4'));var fs=require('fs');var Redis=require(_0x6a76('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a76('0x6'))(_0x6a76('0x7'));var config=require(_0x6a76('0x8'));var jayson=require(_0x6a76('0x9'));var client=jayson[_0x6a76('0xa')][_0x6a76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x461ef5,_0x52c954,_0x4bf0d4){return new BPromise(function(_0x473251,_0x2d8b42){return client[_0x6a76('0xc')](_0x461ef5,_0x4bf0d4)[_0x6a76('0xd')](function(_0x1e057f){logger[_0x6a76('0xe')](_0x6a76('0xf'),_0x52c954,_0x6a76('0x10'));logger[_0x6a76('0x11')](_0x6a76('0x12'),_0x52c954,'request\x20sent',JSON['stringify'](_0x1e057f));if(_0x1e057f[_0x6a76('0x13')]){if(_0x1e057f['error'][_0x6a76('0x14')]===0x1f4){logger[_0x6a76('0x13')](_0x6a76('0xf'),_0x52c954,_0x1e057f['error'][_0x6a76('0x15')]);return _0x2d8b42(_0x1e057f[_0x6a76('0x13')][_0x6a76('0x15')]);}logger[_0x6a76('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x52c954,_0x1e057f[_0x6a76('0x13')][_0x6a76('0x15')]);return _0x473251(_0x1e057f[_0x6a76('0x13')][_0x6a76('0x15')]);}else{logger[_0x6a76('0xe')](_0x6a76('0xf'),_0x52c954,_0x6a76('0x10'));_0x473251(_0x1e057f[_0x6a76('0x16')][_0x6a76('0x15')]);}})[_0x6a76('0x17')](function(_0x56f133){logger[_0x6a76('0x13')](_0x6a76('0xf'),_0x52c954,_0x56f133);_0x2d8b42(_0x56f133);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5e98e28..41d55f1 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 _0xfd3a=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','path','Router','fs-extra'];(function(_0x51beb9,_0x808d66){var _0x4005b1=function(_0x48eec9){while(--_0x48eec9){_0x51beb9['push'](_0x51beb9['shift']());}};_0x4005b1(++_0x808d66);}(_0xfd3a,0xb1));var _0xafd3=function(_0xaef3f1,_0x42efe5){_0xaef3f1=_0xaef3f1-0x0;var _0x1657a3=_0xfd3a[_0xaef3f1];return _0x1657a3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xafd3('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xafd3('0x1')]();var fs_extra=require(_0xafd3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xafd3('0x3'));var config=require(_0xafd3('0x4'));var controller=require(_0xafd3('0x5'));router['get']('/',auth[_0xafd3('0x6')](),controller[_0xafd3('0x7')]);router[_0xafd3('0x8')](_0xafd3('0x9'),auth['isAuthenticated'](),controller[_0xafd3('0xa')]);router[_0xafd3('0x8')](_0xafd3('0xb'),auth['isAuthenticated'](),controller[_0xafd3('0xc')]);router[_0xafd3('0x8')](_0xafd3('0xd'),auth[_0xafd3('0x6')](),controller[_0xafd3('0xe')]);router['post']('/',auth[_0xafd3('0x6')](),controller[_0xafd3('0xf')]);router[_0xafd3('0x10')]('/:id/configurations',auth[_0xafd3('0x6')](),controller['addConfiguration']);router[_0xafd3('0x11')](_0xafd3('0x9'),auth[_0xafd3('0x6')](),controller[_0xafd3('0x12')]);router[_0xafd3('0x13')]('/:id',auth[_0xafd3('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x544f=['isAuthenticated','/:id','post','create','/:id/configurations','addConfiguration','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x3f51cf,_0x869ab7){var _0x3f96eb=function(_0x162724){while(--_0x162724){_0x3f51cf['push'](_0x3f51cf['shift']());}};_0x3f96eb(++_0x869ab7);}(_0x544f,0x14c));var _0xf544=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x544f[_0x211632];return _0x5a1da1;};'use strict';var multer=require(_0xf544('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf544('0x1'));var express=require(_0xf544('0x2'));var router=express[_0xf544('0x3')]();var fs_extra=require(_0xf544('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf544('0x5'));var config=require(_0xf544('0x6'));var controller=require('./intVtigerAccount.controller');router[_0xf544('0x7')]('/',auth[_0xf544('0x8')](),controller['index']);router[_0xf544('0x7')](_0xf544('0x9'),auth[_0xf544('0x8')](),controller['show']);router[_0xf544('0x7')]('/:id/configurations',auth[_0xf544('0x8')](),controller['getConfigurations']);router[_0xf544('0x7')]('/:id/fields',auth[_0xf544('0x8')](),controller['getFields']);router[_0xf544('0xa')]('/',auth[_0xf544('0x8')](),controller[_0xf544('0xb')]);router[_0xf544('0xa')](_0xf544('0xc'),auth[_0xf544('0x8')](),controller[_0xf544('0xd')]);router[_0xf544('0xe')]('/:id',auth[_0xf544('0x8')](),controller[_0xf544('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf544('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e1ac9da..e2ab9a6 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 _0xd141=['STRING','HelpDesk','sequelize','exports'];(function(_0x591a39,_0x2747c6){var _0xc2f762=function(_0xef3980){while(--_0xef3980){_0x591a39['push'](_0x591a39['shift']());}};_0xc2f762(++_0x2747c6);}(_0xd141,0x1a6));var _0x1d14=function(_0x1e4710,_0x125758){_0x1e4710=_0x1e4710-0x0;var _0x3dfc06=_0xd141[_0x1e4710];return _0x3dfc06;};'use strict';var Sequelize=require(_0x1d14('0x0'));module[_0x1d14('0x1')]={'name':{'type':Sequelize[_0x1d14('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1d14('0x2')],'allowNull':![],'defaultValue':_0x1d14('0x3')},'remoteUri':{'type':Sequelize[_0x1d14('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1d14('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1d14('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcbc6=['HelpDesk','STRING'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0xcbc6,0xb9));var _0x6cbc=function(_0xa368d,_0x501d61){_0xa368d=_0xa368d-0x0;var _0x3499fa=_0xcbc6[_0xa368d];return _0x3499fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x6cbc('0x0')]},'username':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![],'defaultValue':_0x6cbc('0x1')},'remoteUri':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6cbc('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index c6d20aa..a5d3c66 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 _0xbee1=['index','map','VtigerAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','POST','login','result','success','describe','reference','owner','remove','includes','editable','false','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','status','end','sendStatus','error','stack','name','send'];(function(_0x339beb,_0xb08e81){var _0x4dacc3=function(_0x2cee4c){while(--_0x2cee4c){_0x339beb['push'](_0x339beb['shift']());}};_0x4dacc3(++_0xb08e81);}(_0xbee1,0xc5));var _0x1bee=function(_0xbe5c9b,_0x1a9a22){_0xbe5c9b=_0xbe5c9b-0x0;var _0x2a734b=_0xbee1[_0xbe5c9b];return _0x2a734b;};'use strict';var emlformat=require(_0x1bee('0x0'));var rimraf=require(_0x1bee('0x1'));var zipdir=require(_0x1bee('0x2'));var jsonpatch=require(_0x1bee('0x3'));var rp=require(_0x1bee('0x4'));var moment=require(_0x1bee('0x5'));var BPromise=require(_0x1bee('0x6'));var Mustache=require(_0x1bee('0x7'));var util=require(_0x1bee('0x8'));var path=require(_0x1bee('0x9'));var sox=require(_0x1bee('0xa'));var csv=require('to-csv');var ejs=require(_0x1bee('0xb'));var fs=require('fs');var fs_extra=require(_0x1bee('0xc'));var _=require(_0x1bee('0xd'));var squel=require(_0x1bee('0xe'));var crypto=require('crypto');var jsforce=require(_0x1bee('0xf'));var deskjs=require(_0x1bee('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1bee('0x11'));var Papa=require(_0x1bee('0x12'));var Redis=require('ioredis');var authService=require(_0x1bee('0x13'));var qs=require(_0x1bee('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bee('0x15'));var logger=require(_0x1bee('0x16'))(_0x1bee('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1bee('0x18'))['db'];var integrations=require(_0x1bee('0x19'));function respondWithStatusCode(_0x56bd53,_0x50ed80){_0x50ed80=_0x50ed80||0xcc;return function(_0x2fabd1){if(_0x2fabd1){return _0x56bd53['sendStatus'](_0x50ed80);}return _0x56bd53['status'](_0x50ed80)['end']();};}function respondWithResult(_0x2dd81b,_0xf3f37f){_0xf3f37f=_0xf3f37f||0xc8;return function(_0x5e40ac){if(_0x5e40ac){return _0x2dd81b['status'](_0xf3f37f)[_0x1bee('0x1a')](_0x5e40ac);}};}function respondWithFilteredResult(_0x75526,_0x1d0f5c){return function(_0x447f23){if(_0x447f23){var _0x5760ae=typeof _0x1d0f5c[_0x1bee('0x1b')]===_0x1bee('0x1c')&&typeof _0x1d0f5c[_0x1bee('0x1d')]===_0x1bee('0x1c');var _0x54696b=_0x447f23[_0x1bee('0x1e')];var _0x5d892f=_0x5760ae?0x0:_0x1d0f5c[_0x1bee('0x1b')];var _0x387752=_0x5760ae?_0x447f23[_0x1bee('0x1e')]:_0x1d0f5c[_0x1bee('0x1b')]+_0x1d0f5c[_0x1bee('0x1d')];var _0x12a33d;if(_0x387752>=_0x54696b){_0x387752=_0x54696b;_0x12a33d=0xc8;}else{_0x12a33d=0xce;}_0x75526['status'](_0x12a33d);return _0x75526[_0x1bee('0x1f')](_0x1bee('0x20'),_0x5d892f+'-'+_0x387752+'/'+_0x54696b)[_0x1bee('0x1a')](_0x447f23);}return null;};}function patchUpdates(_0x4e6866){return function(_0x13e246){try{jsonpatch[_0x1bee('0x21')](_0x13e246,_0x4e6866,!![]);}catch(_0x32b61d){return BPromise[_0x1bee('0x22')](_0x32b61d);}return _0x13e246['save']();};}function saveUpdates(_0x6fcedc,_0x6af972){return function(_0x1b63c4){if(_0x1b63c4){return _0x1b63c4[_0x1bee('0x23')](_0x6fcedc)[_0x1bee('0x24')](function(_0x5ed794){return _0x5ed794;});}return null;};}function removeEntity(_0x5f00b9,_0x257602){return function(_0x5a9112){if(_0x5a9112){return _0x5a9112[_0x1bee('0x25')]()[_0x1bee('0x24')](function(){_0x5f00b9[_0x1bee('0x26')](0xcc)[_0x1bee('0x27')]();});}};}function handleEntityNotFound(_0x356d23,_0x279766){return function(_0x17036f){if(!_0x17036f){_0x356d23[_0x1bee('0x28')](0x194);}return _0x17036f;};}function handleError(_0x3c4200,_0x246a74){_0x246a74=_0x246a74||0x1f4;return function(_0x31c385){logger[_0x1bee('0x29')](_0x31c385[_0x1bee('0x2a')]);if(_0x31c385[_0x1bee('0x2b')]){delete _0x31c385[_0x1bee('0x2b')];}_0x3c4200[_0x1bee('0x26')](_0x246a74)[_0x1bee('0x2c')](_0x31c385);};}exports[_0x1bee('0x2d')]=function(_0x405a77,_0x1d4fa6){var _0x168588={},_0x6883cc={},_0x2e2e8b={'count':0x0,'rows':[]};var _0x3dd2d0=_[_0x1bee('0x2e')](db[_0x1bee('0x2f')][_0x1bee('0x30')],function(_0x1c144b){return{'name':_0x1c144b['fieldName'],'type':_0x1c144b[_0x1bee('0x31')][_0x1bee('0x32')]};});_0x6883cc['model']=_[_0x1bee('0x2e')](_0x3dd2d0,_0x1bee('0x2b'));_0x6883cc[_0x1bee('0x33')]=_[_0x1bee('0x34')](_0x405a77[_0x1bee('0x33')]);_0x6883cc[_0x1bee('0x35')]=_[_0x1bee('0x36')](_0x6883cc[_0x1bee('0x37')],_0x6883cc['query']);_0x168588[_0x1bee('0x38')]=_[_0x1bee('0x36')](_0x6883cc[_0x1bee('0x37')],qs['fields'](_0x405a77[_0x1bee('0x33')][_0x1bee('0x39')]));_0x168588[_0x1bee('0x38')]=_0x168588[_0x1bee('0x38')][_0x1bee('0x3a')]?_0x168588[_0x1bee('0x38')]:_0x6883cc[_0x1bee('0x37')];if(!_0x405a77[_0x1bee('0x33')]['hasOwnProperty'](_0x1bee('0x3b'))){_0x168588[_0x1bee('0x1d')]=qs['limit'](_0x405a77['query'][_0x1bee('0x1d')]);_0x168588[_0x1bee('0x1b')]=qs[_0x1bee('0x1b')](_0x405a77[_0x1bee('0x33')]['offset']);}_0x168588[_0x1bee('0x3c')]=qs[_0x1bee('0x3d')](_0x405a77['query'][_0x1bee('0x3d')]);_0x168588['where']=qs[_0x1bee('0x35')](_[_0x1bee('0x3e')](_0x405a77[_0x1bee('0x33')],_0x6883cc[_0x1bee('0x35')]),_0x3dd2d0);if(_0x405a77['query'][_0x1bee('0x3f')]){_0x168588['where']=_[_0x1bee('0x40')](_0x168588[_0x1bee('0x41')],{'$or':_[_0x1bee('0x2e')](_0x3dd2d0,function(_0x594cc0){if(_0x594cc0[_0x1bee('0x31')]!=='VIRTUAL'){var _0x2cea75={};_0x2cea75[_0x594cc0[_0x1bee('0x2b')]]={'$like':'%'+_0x405a77[_0x1bee('0x33')][_0x1bee('0x3f')]+'%'};return _0x2cea75;}})});}_0x168588=_['merge']({},_0x168588,_0x405a77[_0x1bee('0x42')]);var _0x5cfc17={'where':_0x168588['where']};return db[_0x1bee('0x2f')][_0x1bee('0x1e')](_0x5cfc17)['then'](function(_0x5d717c){_0x2e2e8b[_0x1bee('0x1e')]=_0x5d717c;if(_0x405a77[_0x1bee('0x33')][_0x1bee('0x43')]){_0x168588[_0x1bee('0x44')]=[{'all':!![]}];}return db[_0x1bee('0x2f')][_0x1bee('0x45')](_0x168588);})[_0x1bee('0x24')](function(_0x20fcf7){_0x2e2e8b['rows']=_0x20fcf7;return _0x2e2e8b;})[_0x1bee('0x24')](respondWithFilteredResult(_0x1d4fa6,_0x168588))[_0x1bee('0x46')](handleError(_0x1d4fa6,null));};exports[_0x1bee('0x47')]=function(_0x442e2d,_0x4918ae){var _0x5d9707={'raw':![],'where':{'id':_0x442e2d[_0x1bee('0x48')]['id']}},_0x470425={};_0x470425[_0x1bee('0x37')]=_[_0x1bee('0x34')](db[_0x1bee('0x2f')][_0x1bee('0x30')]);_0x470425['query']=_[_0x1bee('0x34')](_0x442e2d[_0x1bee('0x33')]);_0x470425[_0x1bee('0x35')]=_[_0x1bee('0x36')](_0x470425[_0x1bee('0x37')],_0x470425[_0x1bee('0x33')]);_0x5d9707[_0x1bee('0x38')]=_['intersection'](_0x470425[_0x1bee('0x37')],qs[_0x1bee('0x39')](_0x442e2d[_0x1bee('0x33')]['fields']));_0x5d9707[_0x1bee('0x38')]=_0x5d9707['attributes']['length']?_0x5d9707[_0x1bee('0x38')]:_0x470425[_0x1bee('0x37')];if(_0x442e2d[_0x1bee('0x33')][_0x1bee('0x43')]){_0x5d9707[_0x1bee('0x44')]=[{'all':!![]}];}_0x5d9707=_[_0x1bee('0x40')]({},_0x5d9707,_0x442e2d[_0x1bee('0x42')]);return db[_0x1bee('0x2f')][_0x1bee('0x49')](_0x5d9707)[_0x1bee('0x24')](handleEntityNotFound(_0x4918ae,null))[_0x1bee('0x24')](respondWithResult(_0x4918ae,null))[_0x1bee('0x46')](handleError(_0x4918ae,null));};exports['create']=function(_0x2dd460,_0x4c2e6b){return db[_0x1bee('0x2f')][_0x1bee('0x4a')](_0x2dd460[_0x1bee('0x4b')],{})['then'](respondWithResult(_0x4c2e6b,0xc9))[_0x1bee('0x46')](handleError(_0x4c2e6b,null));};exports[_0x1bee('0x23')]=function(_0x2d3d6,_0x212efa){if(_0x2d3d6[_0x1bee('0x4b')]['id']){delete _0x2d3d6['body']['id'];}return db[_0x1bee('0x2f')][_0x1bee('0x49')]({'where':{'id':_0x2d3d6['params']['id']}})[_0x1bee('0x24')](handleEntityNotFound(_0x212efa,null))['then'](saveUpdates(_0x2d3d6['body'],null))[_0x1bee('0x24')](respondWithResult(_0x212efa,null))[_0x1bee('0x46')](handleError(_0x212efa,null));};exports[_0x1bee('0x25')]=function(_0x11e91c,_0x53a0ec){return db['VtigerAccount'][_0x1bee('0x49')]({'where':{'id':_0x11e91c[_0x1bee('0x48')]['id']}})['then'](handleEntityNotFound(_0x53a0ec,null))[_0x1bee('0x24')](removeEntity(_0x53a0ec,null))[_0x1bee('0x46')](handleError(_0x53a0ec,null));};exports[_0x1bee('0x4c')]=function(_0x36b52d,_0xcc8ad2,_0xbcf270){var _0x3be689={};var _0x2b4bbb={};var _0x332af8;var _0x1bc04e;return db[_0x1bee('0x2f')]['findOne']({'where':{'id':_0x36b52d[_0x1bee('0x48')]['id']}})['then'](handleEntityNotFound(_0xcc8ad2,null))[_0x1bee('0x24')](function(_0x22bea3){if(_0x22bea3){_0x332af8=_0x22bea3;_0x2b4bbb[_0x1bee('0x37')]=_[_0x1bee('0x34')](db[_0x1bee('0x4d')][_0x1bee('0x30')]);_0x2b4bbb[_0x1bee('0x33')]=_[_0x1bee('0x34')](_0x36b52d[_0x1bee('0x33')]);_0x2b4bbb[_0x1bee('0x35')]=_[_0x1bee('0x36')](_0x2b4bbb[_0x1bee('0x37')],_0x2b4bbb[_0x1bee('0x33')]);_0x3be689['attributes']=_[_0x1bee('0x36')](_0x2b4bbb[_0x1bee('0x37')],qs[_0x1bee('0x39')](_0x36b52d[_0x1bee('0x33')][_0x1bee('0x39')]));_0x3be689[_0x1bee('0x38')]=_0x3be689[_0x1bee('0x38')][_0x1bee('0x3a')]?_0x3be689[_0x1bee('0x38')]:_0x2b4bbb[_0x1bee('0x37')];_0x3be689[_0x1bee('0x3c')]=qs['sort'](_0x36b52d['query'][_0x1bee('0x3d')]);_0x3be689[_0x1bee('0x41')]=qs[_0x1bee('0x35')](_[_0x1bee('0x3e')](_0x36b52d[_0x1bee('0x33')],_0x2b4bbb['filters']));if(_0x36b52d[_0x1bee('0x33')][_0x1bee('0x3f')]){_0x3be689[_0x1bee('0x41')]=_['merge'](_0x3be689[_0x1bee('0x41')],{'$or':_[_0x1bee('0x2e')](_0x3be689[_0x1bee('0x38')],function(_0x4ac69d){var _0x29c6f0={};_0x29c6f0[_0x4ac69d]={'$like':'%'+_0x36b52d[_0x1bee('0x33')][_0x1bee('0x3f')]+'%'};return _0x29c6f0;})});}_0x3be689=_[_0x1bee('0x40')]({},_0x3be689,_0x36b52d[_0x1bee('0x42')]);return _0x332af8[_0x1bee('0x4c')](_0x3be689);}})['then'](function(_0x324119){if(_0x324119){_0x1bc04e=_0x324119[_0x1bee('0x3a')];if(!_0x36b52d[_0x1bee('0x33')][_0x1bee('0x4e')](_0x1bee('0x3b'))){_0x3be689[_0x1bee('0x1d')]=qs[_0x1bee('0x1d')](_0x36b52d[_0x1bee('0x33')][_0x1bee('0x1d')]);_0x3be689[_0x1bee('0x1b')]=qs['offset'](_0x36b52d['query'][_0x1bee('0x1b')]);}return _0x332af8['getConfigurations'](_0x3be689);}})[_0x1bee('0x24')](function(_0x2e6f65){if(_0x2e6f65){return _0x2e6f65?{'count':_0x1bc04e,'rows':_0x2e6f65}:null;}})['then'](respondWithResult(_0xcc8ad2,null))[_0x1bee('0x46')](handleError(_0xcc8ad2,null));};exports[_0x1bee('0x4f')]=function(_0x2701a5,_0x33010a,_0x2e6faa){if(_0x2701a5['body']['id']){delete _0x2701a5[_0x1bee('0x4b')]['id'];}return db[_0x1bee('0x2f')][_0x1bee('0x50')]({'where':{'id':_0x2701a5[_0x1bee('0x48')]['id']}})[_0x1bee('0x24')](handleEntityNotFound(_0x33010a,null))[_0x1bee('0x24')](function(_0x4a6700){if(_0x4a6700){_0x2701a5[_0x1bee('0x4b')][_0x1bee('0x51')]=_0x4a6700['id'];_0x2701a5[_0x1bee('0x4b')][_0x1bee('0x52')]=integrations[_0x1bee('0x53')](_0x2701a5['body']['channel'],_0x2701a5[_0x1bee('0x4b')]['type']);_0x2701a5[_0x1bee('0x4b')][_0x1bee('0x54')]=integrations[_0x1bee('0x55')](_0x2701a5[_0x1bee('0x4b')][_0x1bee('0x56')],_0x2701a5[_0x1bee('0x4b')][_0x1bee('0x31')]);return db[_0x1bee('0x4d')][_0x1bee('0x4a')](_0x2701a5[_0x1bee('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0x1bee('0x52')},{'model':db[_0x1bee('0x57')],'as':_0x1bee('0x54')}]});}return null;})[_0x1bee('0x24')](respondWithResult(_0x33010a,null))[_0x1bee('0x46')](handleError(_0x33010a,null));};var md5=require(_0x1bee('0x58'));exports['getFields']=function(_0x21c98b,_0x5e4e9b,_0x2251ea){var _0x554cd7=null;var _0x555155=null;var _0x521fe5=null;var _0x238b06=null;var _0x1f85a2='';return db[_0x1bee('0x2f')][_0x1bee('0x50')]({'where':{'id':_0x21c98b[_0x1bee('0x48')]['id']},'attributes':['id',_0x1bee('0x2b'),_0x1bee('0x59'),_0x1bee('0x5a'),_0x1bee('0x5b'),_0x1bee('0x5c'),_0x1bee('0x5d'),_0x1bee('0x5e')]})[_0x1bee('0x24')](handleEntityNotFound(_0x5e4e9b,null))[_0x1bee('0x24')](function(_0x131acc){if(_0x131acc){_0x554cd7=_0x131acc[_0x1bee('0x59')];_0x555155=_0x131acc[_0x1bee('0x5e')];_0x521fe5=_0x131acc['moduleName'];_0x1f85a2=_0x131acc[_0x1bee('0x5c')];var _0x500402=_0x1f85a2['slice'](-0x1);if(_0x500402==='/'){_0x1f85a2=_0x1f85a2[_0x1bee('0x5f')](0x0,_0x1f85a2[_0x1bee('0x60')](_0x500402));}_0x238b06=util[_0x1bee('0x61')](_0x1bee('0x62'),_0x1f85a2);var _0x459285={'method':_0x1bee('0x63'),'uri':_0x238b06,'qs':{'operation':'getchallenge','username':_0x131acc[_0x1bee('0x59')]},'json':!![]};return rp(_0x459285);}})['then'](function(_0x4f659f){if(_0x4f659f['success']){var _0x279cd5={'method':_0x1bee('0x64'),'uri':_0x238b06,'form':{'operation':_0x1bee('0x65'),'username':_0x554cd7,'accessKey':md5(_0x4f659f[_0x1bee('0x66')]['token']+_0x555155)},'json':!![]};return rp(_0x279cd5);}})[_0x1bee('0x24')](function(_0x486a6e){if(_0x486a6e[_0x1bee('0x67')]){var _0x300602={'method':_0x1bee('0x63'),'uri':_0x238b06,'qs':{'operation':_0x1bee('0x68'),'username':_0x554cd7,'sessionName':_0x486a6e['result']['sessionName'],'elementType':_0x521fe5},'json':!![]};return rp(_0x300602);}})[_0x1bee('0x24')](function(_0x45e76f){if(_0x45e76f[_0x1bee('0x67')]){var _0x505b39=['autogenerated',_0x1bee('0x69'),_0x1bee('0x6a')];_[_0x1bee('0x6b')](_0x45e76f[_0x1bee('0x66')][_0x1bee('0x39')],function(_0x56bdb8){return _0x505b39[_0x1bee('0x6c')](_0x56bdb8[_0x1bee('0x31')][_0x1bee('0x2b')]);});_[_0x1bee('0x6b')](_0x45e76f['result'][_0x1bee('0x39')],function(_0x34f205){return _0x34f205[_0x1bee('0x6d')]===_0x1bee('0x6e');});return{'count':_0x45e76f['result']['fields'][_0x1bee('0x3a')],'rows':_[_0x1bee('0x2e')](_0x45e76f[_0x1bee('0x66')][_0x1bee('0x39')],function(_0x30c293){return{'id':_0x30c293[_0x1bee('0x2b')],'name':_0x30c293['label'],'custom':_['startsWith'](_0x30c293[_0x1bee('0x2b')],_0x1bee('0x6f'))?!![]:![],'options':_0x30c293[_0x1bee('0x31')][_0x1bee('0x2b')]==='picklist'&&_0x30c293[_0x1bee('0x31')][_0x1bee('0x70')][_0x1bee('0x3a')]>0x0?_[_0x1bee('0x2e')](_0x30c293[_0x1bee('0x31')][_0x1bee('0x70')],function(_0x36d534){return{'name':_0x36d534[_0x1bee('0x71')],'value':_0x36d534[_0x1bee('0x72')]};}):[]};})};}})[_0x1bee('0x24')](respondWithResult(_0x5e4e9b,null))[_0x1bee('0x46')](function(_0xa57306){console[_0x1bee('0x73')](_0x1bee('0x74')+_0xa57306);var _0x26c9a7=_0x21c98b[_0x1bee('0x33')][_0x1bee('0x75')]?0x1f4:_0xa57306[_0x1bee('0x76')]||0x1f4;logger[_0x1bee('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x26c9a7,JSON[_0x1bee('0x77')](_0xa57306));delete _0xa57306[_0x1bee('0x2b')];if(_0x26c9a7===0x191){_0x26c9a7=0x190;}_0x5e4e9b[_0x1bee('0x26')](_0x26c9a7)[_0x1bee('0x2c')](_0x21c98b[_0x1bee('0x33')]['test']?{'message':_0x1bee('0x78'),'statusCode':_0xa57306[_0x1bee('0x76')]}:_0xa57306);});}; \ No newline at end of file +var _0xa1c3=['substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','sort','map','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa1c3,0x102));var _0x3a1c=function(_0x4579cc,_0x199999){_0x4579cc=_0x4579cc-0x0;var _0x318362=_0xa1c3[_0x4579cc];return _0x318362;};'use strict';var emlformat=require(_0x3a1c('0x0'));var rimraf=require(_0x3a1c('0x1'));var zipdir=require(_0x3a1c('0x2'));var jsonpatch=require(_0x3a1c('0x3'));var rp=require(_0x3a1c('0x4'));var moment=require(_0x3a1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a1c('0x6'));var util=require('util');var path=require(_0x3a1c('0x7'));var sox=require('sox');var csv=require(_0x3a1c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3a1c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3a1c('0xa'));var toCsv=require(_0x3a1c('0x8'));var querystring=require(_0x3a1c('0xb'));var Papa=require(_0x3a1c('0xc'));var Redis=require(_0x3a1c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3a1c('0xe'));var as=require(_0x3a1c('0xf'));var hardwareService=require(_0x3a1c('0x10'));var logger=require(_0x3a1c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3a1c('0x12'));var licenseUtil=require(_0x3a1c('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3a1c('0x14'));function respondWithStatusCode(_0x138883,_0x47f092){_0x47f092=_0x47f092||0xcc;return function(_0x4d0f0d){if(_0x4d0f0d){return _0x138883[_0x3a1c('0x15')](_0x47f092);}return _0x138883[_0x3a1c('0x16')](_0x47f092)[_0x3a1c('0x17')]();};}function respondWithResult(_0x3150c2,_0x54babe){_0x54babe=_0x54babe||0xc8;return function(_0x4ec9c1){if(_0x4ec9c1){return _0x3150c2[_0x3a1c('0x16')](_0x54babe)[_0x3a1c('0x18')](_0x4ec9c1);}};}function respondWithFilteredResult(_0x2d7c4c,_0x52f2e5){return function(_0x2092f0){if(_0x2092f0){var _0x2c253e=typeof _0x52f2e5[_0x3a1c('0x19')]===_0x3a1c('0x1a')&&typeof _0x52f2e5[_0x3a1c('0x1b')]===_0x3a1c('0x1a');var _0x4863a0=_0x2092f0['count'];var _0x27d013=_0x2c253e?0x0:_0x52f2e5[_0x3a1c('0x19')];var _0xc7ba25=_0x2c253e?_0x2092f0[_0x3a1c('0x1c')]:_0x52f2e5['offset']+_0x52f2e5[_0x3a1c('0x1b')];var _0x457063;if(_0xc7ba25>=_0x4863a0){_0xc7ba25=_0x4863a0;_0x457063=0xc8;}else{_0x457063=0xce;}_0x2d7c4c[_0x3a1c('0x16')](_0x457063);return _0x2d7c4c['set'](_0x3a1c('0x1d'),_0x27d013+'-'+_0xc7ba25+'/'+_0x4863a0)[_0x3a1c('0x18')](_0x2092f0);}return null;};}function patchUpdates(_0x35ff70){return function(_0x10fdf4){try{jsonpatch[_0x3a1c('0x1e')](_0x10fdf4,_0x35ff70,!![]);}catch(_0x4b2010){return BPromise[_0x3a1c('0x1f')](_0x4b2010);}return _0x10fdf4['save']();};}function saveUpdates(_0x12012c,_0x2c0449){return function(_0x58e1e3){if(_0x58e1e3){return _0x58e1e3[_0x3a1c('0x20')](_0x12012c)[_0x3a1c('0x21')](function(_0x548ddd){return _0x548ddd;});}return null;};}function removeEntity(_0x157b1f,_0x548d7e){return function(_0x1fc851){if(_0x1fc851){return _0x1fc851[_0x3a1c('0x22')]()[_0x3a1c('0x21')](function(){_0x157b1f[_0x3a1c('0x16')](0xcc)[_0x3a1c('0x17')]();});}};}function handleEntityNotFound(_0x29aae7,_0x19ea33){return function(_0x4cf4d0){if(!_0x4cf4d0){_0x29aae7[_0x3a1c('0x15')](0x194);}return _0x4cf4d0;};}function handleError(_0x1a9721,_0x161ce5){_0x161ce5=_0x161ce5||0x1f4;return function(_0x5f30c6){logger[_0x3a1c('0x23')](_0x5f30c6[_0x3a1c('0x24')]);if(_0x5f30c6[_0x3a1c('0x25')]){delete _0x5f30c6[_0x3a1c('0x25')];}_0x1a9721[_0x3a1c('0x16')](_0x161ce5)[_0x3a1c('0x26')](_0x5f30c6);};}exports[_0x3a1c('0x27')]=function(_0x1132e0,_0x51fef6){var _0x2002a6={},_0x54958f={},_0x58650c={'count':0x0,'rows':[]};var _0x5e7412=_['map'](db[_0x3a1c('0x28')][_0x3a1c('0x29')],function(_0xd70df5){return{'name':_0xd70df5[_0x3a1c('0x2a')],'type':_0xd70df5['type'][_0x3a1c('0x2b')]};});_0x54958f['model']=_['map'](_0x5e7412,_0x3a1c('0x25'));_0x54958f[_0x3a1c('0x2c')]=_[_0x3a1c('0x2d')](_0x1132e0[_0x3a1c('0x2c')]);_0x54958f[_0x3a1c('0x2e')]=_[_0x3a1c('0x2f')](_0x54958f[_0x3a1c('0x30')],_0x54958f[_0x3a1c('0x2c')]);_0x2002a6[_0x3a1c('0x31')]=_[_0x3a1c('0x2f')](_0x54958f['model'],qs[_0x3a1c('0x32')](_0x1132e0[_0x3a1c('0x2c')]['fields']));_0x2002a6[_0x3a1c('0x31')]=_0x2002a6['attributes'][_0x3a1c('0x33')]?_0x2002a6[_0x3a1c('0x31')]:_0x54958f[_0x3a1c('0x30')];if(!_0x1132e0[_0x3a1c('0x2c')][_0x3a1c('0x34')](_0x3a1c('0x35'))){_0x2002a6[_0x3a1c('0x1b')]=qs[_0x3a1c('0x1b')](_0x1132e0['query']['limit']);_0x2002a6[_0x3a1c('0x19')]=qs[_0x3a1c('0x19')](_0x1132e0[_0x3a1c('0x2c')][_0x3a1c('0x19')]);}_0x2002a6['order']=qs['sort'](_0x1132e0[_0x3a1c('0x2c')]['sort']);_0x2002a6[_0x3a1c('0x36')]=qs['filters'](_[_0x3a1c('0x37')](_0x1132e0['query'],_0x54958f['filters']),_0x5e7412);if(_0x1132e0[_0x3a1c('0x2c')][_0x3a1c('0x38')]){_0x2002a6[_0x3a1c('0x36')]=_['merge'](_0x2002a6[_0x3a1c('0x36')],{'$or':_['map'](_0x5e7412,function(_0x76de32){if(_0x76de32[_0x3a1c('0x39')]!=='VIRTUAL'){var _0x322dc2={};_0x322dc2[_0x76de32[_0x3a1c('0x25')]]={'$like':'%'+_0x1132e0['query']['filter']+'%'};return _0x322dc2;}})});}_0x2002a6=_[_0x3a1c('0x3a')]({},_0x2002a6,_0x1132e0[_0x3a1c('0x3b')]);var _0x211aa1={'where':_0x2002a6['where']};return db[_0x3a1c('0x28')]['count'](_0x211aa1)[_0x3a1c('0x21')](function(_0xa80a79){_0x58650c[_0x3a1c('0x1c')]=_0xa80a79;if(_0x1132e0['query'][_0x3a1c('0x3c')]){_0x2002a6[_0x3a1c('0x3d')]=[{'all':!![]}];}return db['VtigerAccount'][_0x3a1c('0x3e')](_0x2002a6);})['then'](function(_0x8f49a6){_0x58650c[_0x3a1c('0x3f')]=_0x8f49a6;return _0x58650c;})[_0x3a1c('0x21')](respondWithFilteredResult(_0x51fef6,_0x2002a6))[_0x3a1c('0x40')](handleError(_0x51fef6,null));};exports['show']=function(_0x34e46d,_0x20775e){var _0x1615fb={'raw':![],'where':{'id':_0x34e46d['params']['id']}},_0x189735={};_0x189735['model']=_[_0x3a1c('0x2d')](db[_0x3a1c('0x28')]['rawAttributes']);_0x189735[_0x3a1c('0x2c')]=_[_0x3a1c('0x2d')](_0x34e46d['query']);_0x189735[_0x3a1c('0x2e')]=_[_0x3a1c('0x2f')](_0x189735[_0x3a1c('0x30')],_0x189735[_0x3a1c('0x2c')]);_0x1615fb['attributes']=_[_0x3a1c('0x2f')](_0x189735['model'],qs[_0x3a1c('0x32')](_0x34e46d['query'][_0x3a1c('0x32')]));_0x1615fb[_0x3a1c('0x31')]=_0x1615fb['attributes'][_0x3a1c('0x33')]?_0x1615fb[_0x3a1c('0x31')]:_0x189735[_0x3a1c('0x30')];if(_0x34e46d[_0x3a1c('0x2c')][_0x3a1c('0x3c')]){_0x1615fb['include']=[{'all':!![]}];}_0x1615fb=_['merge']({},_0x1615fb,_0x34e46d[_0x3a1c('0x3b')]);return db[_0x3a1c('0x28')][_0x3a1c('0x41')](_0x1615fb)['then'](handleEntityNotFound(_0x20775e,null))[_0x3a1c('0x21')](respondWithResult(_0x20775e,null))[_0x3a1c('0x40')](handleError(_0x20775e,null));};exports[_0x3a1c('0x42')]=function(_0x229f62,_0x2b19da){return db['VtigerAccount'][_0x3a1c('0x42')](_0x229f62[_0x3a1c('0x43')],{})['then'](respondWithResult(_0x2b19da,0xc9))[_0x3a1c('0x40')](handleError(_0x2b19da,null));};exports[_0x3a1c('0x20')]=function(_0x58b400,_0x382e8f){if(_0x58b400[_0x3a1c('0x43')]['id']){delete _0x58b400[_0x3a1c('0x43')]['id'];}return db[_0x3a1c('0x28')]['find']({'where':{'id':_0x58b400[_0x3a1c('0x44')]['id']}})[_0x3a1c('0x21')](handleEntityNotFound(_0x382e8f,null))[_0x3a1c('0x21')](saveUpdates(_0x58b400['body'],null))[_0x3a1c('0x21')](respondWithResult(_0x382e8f,null))[_0x3a1c('0x40')](handleError(_0x382e8f,null));};exports[_0x3a1c('0x22')]=function(_0x14353a,_0x454554){return db['VtigerAccount']['find']({'where':{'id':_0x14353a[_0x3a1c('0x44')]['id']}})[_0x3a1c('0x21')](handleEntityNotFound(_0x454554,null))[_0x3a1c('0x21')](removeEntity(_0x454554,null))[_0x3a1c('0x40')](handleError(_0x454554,null));};exports[_0x3a1c('0x45')]=function(_0x15851d,_0x4a56ba,_0x43c7b7){var _0x5be5d4={};var _0x4053e2={};var _0x30a77a;var _0x40a08b;return db[_0x3a1c('0x28')][_0x3a1c('0x46')]({'where':{'id':_0x15851d[_0x3a1c('0x44')]['id']}})[_0x3a1c('0x21')](handleEntityNotFound(_0x4a56ba,null))[_0x3a1c('0x21')](function(_0x39eb9c){if(_0x39eb9c){_0x30a77a=_0x39eb9c;_0x4053e2[_0x3a1c('0x30')]=_[_0x3a1c('0x2d')](db[_0x3a1c('0x47')][_0x3a1c('0x29')]);_0x4053e2['query']=_[_0x3a1c('0x2d')](_0x15851d['query']);_0x4053e2[_0x3a1c('0x2e')]=_[_0x3a1c('0x2f')](_0x4053e2[_0x3a1c('0x30')],_0x4053e2[_0x3a1c('0x2c')]);_0x5be5d4[_0x3a1c('0x31')]=_['intersection'](_0x4053e2[_0x3a1c('0x30')],qs[_0x3a1c('0x32')](_0x15851d[_0x3a1c('0x2c')][_0x3a1c('0x32')]));_0x5be5d4['attributes']=_0x5be5d4[_0x3a1c('0x31')][_0x3a1c('0x33')]?_0x5be5d4[_0x3a1c('0x31')]:_0x4053e2[_0x3a1c('0x30')];_0x5be5d4['order']=qs[_0x3a1c('0x48')](_0x15851d['query'][_0x3a1c('0x48')]);_0x5be5d4[_0x3a1c('0x36')]=qs[_0x3a1c('0x2e')](_['pick'](_0x15851d[_0x3a1c('0x2c')],_0x4053e2['filters']));if(_0x15851d[_0x3a1c('0x2c')]['filter']){_0x5be5d4[_0x3a1c('0x36')]=_[_0x3a1c('0x3a')](_0x5be5d4['where'],{'$or':_[_0x3a1c('0x49')](_0x5be5d4[_0x3a1c('0x31')],function(_0x338a8f){var _0x209d5f={};_0x209d5f[_0x338a8f]={'$like':'%'+_0x15851d[_0x3a1c('0x2c')][_0x3a1c('0x38')]+'%'};return _0x209d5f;})});}_0x5be5d4=_[_0x3a1c('0x3a')]({},_0x5be5d4,_0x15851d[_0x3a1c('0x3b')]);return _0x30a77a[_0x3a1c('0x45')](_0x5be5d4);}})['then'](function(_0x2c2e72){if(_0x2c2e72){_0x40a08b=_0x2c2e72['length'];if(!_0x15851d[_0x3a1c('0x2c')][_0x3a1c('0x34')](_0x3a1c('0x35'))){_0x5be5d4[_0x3a1c('0x1b')]=qs[_0x3a1c('0x1b')](_0x15851d[_0x3a1c('0x2c')][_0x3a1c('0x1b')]);_0x5be5d4[_0x3a1c('0x19')]=qs[_0x3a1c('0x19')](_0x15851d[_0x3a1c('0x2c')][_0x3a1c('0x19')]);}return _0x30a77a[_0x3a1c('0x45')](_0x5be5d4);}})[_0x3a1c('0x21')](function(_0x573e46){if(_0x573e46){return _0x573e46?{'count':_0x40a08b,'rows':_0x573e46}:null;}})[_0x3a1c('0x21')](respondWithResult(_0x4a56ba,null))[_0x3a1c('0x40')](handleError(_0x4a56ba,null));};exports['addConfiguration']=function(_0x1de0e0,_0x2257df,_0x1dd885){if(_0x1de0e0[_0x3a1c('0x43')]['id']){delete _0x1de0e0[_0x3a1c('0x43')]['id'];}return db[_0x3a1c('0x28')][_0x3a1c('0x46')]({'where':{'id':_0x1de0e0[_0x3a1c('0x44')]['id']}})[_0x3a1c('0x21')](handleEntityNotFound(_0x2257df,null))['then'](function(_0x2bd5cb){if(_0x2bd5cb){_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x4a')]=_0x2bd5cb['id'];_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x4b')]=integrations[_0x3a1c('0x4c')](_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x4d')],_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x39')]);_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x4e')]=integrations[_0x3a1c('0x4f')](_0x1de0e0[_0x3a1c('0x43')][_0x3a1c('0x4d')],_0x1de0e0['body'][_0x3a1c('0x39')]);return db[_0x3a1c('0x47')][_0x3a1c('0x42')](_0x1de0e0[_0x3a1c('0x43')],{'include':[{'model':db[_0x3a1c('0x50')],'as':_0x3a1c('0x4b')},{'model':db[_0x3a1c('0x50')],'as':_0x3a1c('0x4e')}]});}return null;})[_0x3a1c('0x21')](respondWithResult(_0x2257df,null))[_0x3a1c('0x40')](handleError(_0x2257df,null));};var md5=require(_0x3a1c('0x51'));exports[_0x3a1c('0x52')]=function(_0x4edfa8,_0x59ead5,_0x1dfb83){var _0x52086f=null;var _0x56a6aa=null;var _0x548404=null;var _0x41dbc1=null;var _0x32036a='';return db[_0x3a1c('0x28')][_0x3a1c('0x46')]({'where':{'id':_0x4edfa8[_0x3a1c('0x44')]['id']},'attributes':['id',_0x3a1c('0x25'),_0x3a1c('0x53'),_0x3a1c('0x54'),_0x3a1c('0x55'),_0x3a1c('0x56'),_0x3a1c('0x57'),_0x3a1c('0x58')]})[_0x3a1c('0x21')](handleEntityNotFound(_0x59ead5,null))[_0x3a1c('0x21')](function(_0x20e0d4){if(_0x20e0d4){_0x52086f=_0x20e0d4[_0x3a1c('0x53')];_0x56a6aa=_0x20e0d4[_0x3a1c('0x58')];_0x548404=_0x20e0d4[_0x3a1c('0x55')];_0x32036a=_0x20e0d4[_0x3a1c('0x56')];var _0xc578d9=_0x32036a[_0x3a1c('0x59')](-0x1);if(_0xc578d9==='/'){_0x32036a=_0x32036a[_0x3a1c('0x5a')](0x0,_0x32036a[_0x3a1c('0x5b')](_0xc578d9));}_0x41dbc1=util['format']('%s/webservice.php',_0x32036a);var _0x257ed7={'method':_0x3a1c('0x5c'),'uri':_0x41dbc1,'qs':{'operation':_0x3a1c('0x5d'),'username':_0x20e0d4['username']},'json':!![]};return rp(_0x257ed7);}})[_0x3a1c('0x21')](function(_0x2fde14){if(_0x2fde14[_0x3a1c('0x5e')]){var _0x15e9ef={'method':_0x3a1c('0x5f'),'uri':_0x41dbc1,'form':{'operation':_0x3a1c('0x60'),'username':_0x52086f,'accessKey':md5(_0x2fde14[_0x3a1c('0x61')][_0x3a1c('0x62')]+_0x56a6aa)},'json':!![]};return rp(_0x15e9ef);}})[_0x3a1c('0x21')](function(_0x16eddf){if(_0x16eddf[_0x3a1c('0x5e')]){var _0xb5151c={'method':'GET','uri':_0x41dbc1,'qs':{'operation':_0x3a1c('0x63'),'username':_0x52086f,'sessionName':_0x16eddf[_0x3a1c('0x61')][_0x3a1c('0x64')],'elementType':_0x548404},'json':!![]};return rp(_0xb5151c);}})[_0x3a1c('0x21')](function(_0x11fd02){if(_0x11fd02[_0x3a1c('0x5e')]){var _0x397b08=[_0x3a1c('0x65'),_0x3a1c('0x66'),'owner'];_['remove'](_0x11fd02[_0x3a1c('0x61')][_0x3a1c('0x32')],function(_0x404560){return _0x397b08['includes'](_0x404560[_0x3a1c('0x39')][_0x3a1c('0x25')]);});_['remove'](_0x11fd02[_0x3a1c('0x61')][_0x3a1c('0x32')],function(_0x3903a8){return _0x3903a8[_0x3a1c('0x67')]===_0x3a1c('0x68');});return{'count':_0x11fd02[_0x3a1c('0x61')][_0x3a1c('0x32')]['length'],'rows':_[_0x3a1c('0x49')](_0x11fd02[_0x3a1c('0x61')]['fields'],function(_0x8a1e6d){return{'id':_0x8a1e6d['name'],'name':_0x8a1e6d['label'],'custom':_[_0x3a1c('0x69')](_0x8a1e6d[_0x3a1c('0x25')],_0x3a1c('0x6a'))?!![]:![],'options':_0x8a1e6d[_0x3a1c('0x39')][_0x3a1c('0x25')]===_0x3a1c('0x6b')&&_0x8a1e6d[_0x3a1c('0x39')][_0x3a1c('0x6c')][_0x3a1c('0x33')]>0x0?_['map'](_0x8a1e6d[_0x3a1c('0x39')][_0x3a1c('0x6c')],function(_0x25cca1){return{'name':_0x25cca1[_0x3a1c('0x6d')],'value':_0x25cca1[_0x3a1c('0x6e')]};}):[]};})};}})[_0x3a1c('0x21')](respondWithResult(_0x59ead5,null))[_0x3a1c('0x40')](function(_0x313d0c){console[_0x3a1c('0x6f')](_0x3a1c('0x70')+_0x313d0c);var _0x4bec32=_0x4edfa8[_0x3a1c('0x2c')][_0x3a1c('0x71')]?0x1f4:_0x313d0c['statusCode']||0x1f4;logger['error'](_0x3a1c('0x72'),_0x3a1c('0x52'),_0x4bec32,JSON[_0x3a1c('0x73')](_0x313d0c));delete _0x313d0c[_0x3a1c('0x25')];if(_0x4bec32===0x191){_0x4bec32=0x190;}_0x59ead5['status'](_0x4bec32)['send'](_0x4edfa8['query'][_0x3a1c('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x313d0c['statusCode']}:_0x313d0c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5bfdfb4..a956578 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 _0x6834=['exports','define','util','../../config/logger','api','bluebird','path','rimraf','../../components/integrations/configuration'];(function(_0x1653bf,_0x43083b){var _0xe57166=function(_0x2cc1f0){while(--_0x2cc1f0){_0x1653bf['push'](_0x1653bf['shift']());}};_0xe57166(++_0x43083b);}(_0x6834,0x1d6));var _0x4683=function(_0x5e7389,_0x1e12ff){_0x5e7389=_0x5e7389-0x0;var _0x3aaac5=_0x6834[_0x5e7389];return _0x3aaac5;};'use strict';var _=require('lodash');var util=require(_0x4683('0x0'));var logger=require(_0x4683('0x1'))(_0x4683('0x2'));var moment=require('moment');var BPromise=require(_0x4683('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4683('0x4'));var rimraf=require(_0x4683('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4683('0x6'));module[_0x4683('0x7')]=function(_0x1f7b16,_0x587beb){return _0x1f7b16[_0x4683('0x8')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdac=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xcdac,0x6c));var _0xccda=function(_0x553f18,_0x5df993){_0x553f18=_0x553f18-0x0;var _0x17a25e=_0xcdac[_0x553f18];return _0x17a25e;};'use strict';var _=require(_0xccda('0x0'));var util=require(_0xccda('0x1'));var logger=require(_0xccda('0x2'))('api');var moment=require(_0xccda('0x3'));var BPromise=require('bluebird');var rp=require(_0xccda('0x4'));var fs=require('fs');var path=require(_0xccda('0x5'));var rimraf=require(_0xccda('0x6'));var config=require(_0xccda('0x7'));var attributes=require(_0xccda('0x8'));var integrations=require(_0xccda('0x9'));module[_0xccda('0xa')]=function(_0x9b25ce,_0x554525){return _0x9b25ce[_0xccda('0xb')](_0xccda('0xc'),attributes,{'tableName':_0xccda('0xd'),'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 956f3bf..8960791 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 _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1d83ea,_0x252f25){var _0x9a6db4=function(_0x42d4ec){while(--_0x42d4ec){_0x1d83ea['push'](_0x1d83ea['shift']());}};_0x9a6db4(++_0x252f25);}(_0x2547,0x1cd));var _0x7254=function(_0x517bad,_0xba86b7){_0x517bad=_0x517bad-0x0;var _0x26d1b3=_0x2547[_0x517bad];return _0x26d1b3;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file +var _0x5c00=['where','limit','include','map','model','attributes','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVtigerAccount','findAll','options','raw'];(function(_0x399dfd,_0xee1e3e){var _0x4ac388=function(_0x5d0689){while(--_0x5d0689){_0x399dfd['push'](_0x399dfd['shift']());}};_0x4ac388(++_0xee1e3e);}(_0x5c00,0x17e));var _0x05c0=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0x5c00[_0x47c902];return _0x1ad6a0;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['VtigerAccount'][_0x05c0('0x17')]({'raw':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options']['attributes']||null:null,'limit':_0x521cbd['options']?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1b')]||null:null,'include':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x521cbd[_0x05c0('0x18')]['include'],function(_0x9b4930){return{'model':db[_0x9b4930[_0x05c0('0x1e')]],'as':_0x9b4930['as'],'attributes':_0x9b4930['attributes'],'include':_0x9b4930['include']?_['map'](_0x9b4930['include'],function(_0x56aa78){return{'model':db[_0x56aa78[_0x05c0('0x1e')]],'as':_0x56aa78['as'],'attributes':_0x56aa78[_0x05c0('0x1f')],'include':_0x56aa78['include']?_[_0x05c0('0x1d')](_0x56aa78[_0x05c0('0x1c')],function(_0x3617dc){return{'model':db[_0x3617dc[_0x05c0('0x1e')]],'as':_0x3617dc['as'],'attributes':_0x3617dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x1c14b1){logger[_0x05c0('0xc')](_0x05c0('0x16'),_0x521cbd);logger[_0x05c0('0xf')](_0x05c0('0x16'),_0x521cbd,JSON['stringify'](_0x1c14b1));_0x1230e5(_0x1c14b1);})['catch'](function(_0x2df109){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x2df109[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x2df109[_0x05c0('0x13')]));});});};exports[_0x05c0('0x20')]=function(_0x3c9eb1){var _0x33eff3=this;return new Promise(function(_0x87b07c,_0x3e38f0){return db[_0x05c0('0x21')]['find']({'raw':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1f')]||null:null,'include':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')],function(_0x2a9e82){return{'model':db[_0x2a9e82[_0x05c0('0x1e')]],'as':_0x2a9e82['as'],'attributes':_0x2a9e82[_0x05c0('0x1f')],'include':_0x2a9e82[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x2a9e82[_0x05c0('0x1c')],function(_0x3a9c63){return{'model':db[_0x3a9c63[_0x05c0('0x1e')]],'as':_0x3a9c63['as'],'attributes':_0x3a9c63[_0x05c0('0x1f')],'include':_0x3a9c63[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3a9c63[_0x05c0('0x1c')],function(_0x21c22){return{'model':db[_0x21c22[_0x05c0('0x1e')]],'as':_0x21c22['as'],'attributes':_0x21c22[_0x05c0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x337847){logger[_0x05c0('0xc')](_0x05c0('0x20'),_0x3c9eb1);logger[_0x05c0('0xf')](_0x05c0('0x20'),_0x3c9eb1,JSON[_0x05c0('0x10')](_0x337847));_0x87b07c(_0x337847);})[_0x05c0('0x15')](function(_0x40d4db){logger[_0x05c0('0x11')](_0x05c0('0x20'),_0x40d4db[_0x05c0('0x13')],_0x3c9eb1);_0x3e38f0(_0x33eff3[_0x05c0('0x11')](0x1f4,_0x40d4db['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index b3f588f..4035d0b 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 _0xd0e2=['./intVtigerConfiguration.controller','index','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4604ad,_0x2c516e){var _0x3ed8ef=function(_0x2cb13e){while(--_0x2cb13e){_0x4604ad['push'](_0x4604ad['shift']());}};_0x3ed8ef(++_0x2c516e);}(_0xd0e2,0x102));var _0x2d0e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd0e2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2d0e('0x0'));var express=require(_0x2d0e('0x1'));var router=express['Router']();var fs_extra=require(_0x2d0e('0x2'));var auth=require(_0x2d0e('0x3'));var interaction=require(_0x2d0e('0x4'));var config=require(_0x2d0e('0x5'));var controller=require(_0x2d0e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2d0e('0x7')]);router[_0x2d0e('0x8')](_0x2d0e('0x9'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x2d0e('0xc')]);router[_0x2d0e('0x8')](_0x2d0e('0xd'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0xe')]);router[_0x2d0e('0x8')](_0x2d0e('0xf'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x10')]);router[_0x2d0e('0x11')]('/',auth['isAuthenticated'](),controller[_0x2d0e('0x12')]);router[_0x2d0e('0x13')](_0x2d0e('0x9'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x14')]);router[_0x2d0e('0x15')](_0x2d0e('0x9'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x16')]);module[_0x2d0e('0x17')]=router; \ No newline at end of file +var _0xfe6e=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x2fc2a2,_0xeb4a23){var _0x31350d=function(_0x4c1cbc){while(--_0x4c1cbc){_0x2fc2a2['push'](_0x2fc2a2['shift']());}};_0x31350d(++_0xeb4a23);}(_0xfe6e,0xe4));var _0xefe6=function(_0x1f7926,_0x4fae96){_0x1f7926=_0x1f7926-0x0;var _0x1ead31=_0xfe6e[_0x1f7926];return _0x1ead31;};'use strict';var multer=require('multer');var util=require(_0xefe6('0x0'));var path=require(_0xefe6('0x1'));var timeout=require(_0xefe6('0x2'));var express=require(_0xefe6('0x3'));var router=express[_0xefe6('0x4')]();var fs_extra=require(_0xefe6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xefe6('0x6'));var config=require(_0xefe6('0x7'));var controller=require(_0xefe6('0x8'));router['get']('/',auth[_0xefe6('0x9')](),controller[_0xefe6('0xa')]);router[_0xefe6('0xb')]('/:id',auth[_0xefe6('0x9')](),controller[_0xefe6('0xc')]);router[_0xefe6('0xb')](_0xefe6('0xd'),auth[_0xefe6('0x9')](),controller[_0xefe6('0xe')]);router[_0xefe6('0xb')](_0xefe6('0xf'),auth[_0xefe6('0x9')](),controller['getSubjects']);router[_0xefe6('0xb')](_0xefe6('0x10'),auth[_0xefe6('0x9')](),controller[_0xefe6('0x11')]);router[_0xefe6('0x12')]('/',auth['isAuthenticated'](),controller[_0xefe6('0x13')]);router[_0xefe6('0x14')](_0xefe6('0x15'),auth[_0xefe6('0x9')](),controller['update']);router[_0xefe6('0x16')](_0xefe6('0x15'),auth[_0xefe6('0x9')](),controller[_0xefe6('0x17')]);module[_0xefe6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 54c2719..ed3d40b 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 _0xfd60=['sequelize','STRING'];(function(_0x5d0bbb,_0x28e869){var _0xdb9a0a=function(_0x1059b1){while(--_0x1059b1){_0x5d0bbb['push'](_0x5d0bbb['shift']());}};_0xdb9a0a(++_0x28e869);}(_0xfd60,0xfe));var _0x0fd6=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xfd60[_0x8b8564];return _0x360c61;};'use strict';var Sequelize=require(_0x0fd6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fd6('0x1')]}}; \ No newline at end of file +var _0x5516=['exports','STRING','sequelize'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x5516,0x9e));var _0x6551=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x5516[_0x1a21ff];return _0x25afc1;};'use strict';var Sequelize=require(_0x6551('0x0'));module[_0x6551('0x1')]={'name':{'type':Sequelize[_0x6551('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 65b80b0..57eb13e 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 _0xc0d8=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getFields','findOne','getSubjects','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xc0d8,0x6e));var _0x8c0d=function(_0x46c4a7,_0x5e05b8){_0x46c4a7=_0x46c4a7-0x0;var _0x1c6cc8=_0xc0d8[_0x46c4a7];return _0x1c6cc8;};'use strict';var emlformat=require(_0x8c0d('0x0'));var rimraf=require(_0x8c0d('0x1'));var zipdir=require(_0x8c0d('0x2'));var jsonpatch=require(_0x8c0d('0x3'));var rp=require('request-promise');var moment=require(_0x8c0d('0x4'));var BPromise=require(_0x8c0d('0x5'));var Mustache=require('mustache');var util=require(_0x8c0d('0x6'));var path=require(_0x8c0d('0x7'));var sox=require(_0x8c0d('0x8'));var csv=require(_0x8c0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c0d('0xa'));var _=require(_0x8c0d('0xb'));var squel=require(_0x8c0d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c0d('0xd'));var deskjs=require(_0x8c0d('0xe'));var toCsv=require(_0x8c0d('0x9'));var querystring=require(_0x8c0d('0xf'));var Papa=require(_0x8c0d('0x10'));var Redis=require('ioredis');var authService=require(_0x8c0d('0x11'));var qs=require(_0x8c0d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c0d('0x13'));var logger=require(_0x8c0d('0x14'))(_0x8c0d('0x15'));var utils=require(_0x8c0d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b7318,_0xb7fd1){_0xb7fd1=_0xb7fd1||0xcc;return function(_0x3ce231){if(_0x3ce231){return _0x2b7318[_0x8c0d('0x17')](_0xb7fd1);}return _0x2b7318[_0x8c0d('0x18')](_0xb7fd1)[_0x8c0d('0x19')]();};}function respondWithResult(_0x1bc129,_0x19e3e9){_0x19e3e9=_0x19e3e9||0xc8;return function(_0x3056a7){if(_0x3056a7){return _0x1bc129['status'](_0x19e3e9)[_0x8c0d('0x1a')](_0x3056a7);}};}function respondWithFilteredResult(_0xd42f70,_0x381c9a){return function(_0x30216e){if(_0x30216e){var _0x54eda8=typeof _0x381c9a[_0x8c0d('0x1b')]===_0x8c0d('0x1c')&&typeof _0x381c9a[_0x8c0d('0x1d')]===_0x8c0d('0x1c');var _0x3a89b3=_0x30216e[_0x8c0d('0x1e')];var _0x41dd5d=_0x54eda8?0x0:_0x381c9a['offset'];var _0x426f78=_0x54eda8?_0x30216e[_0x8c0d('0x1e')]:_0x381c9a[_0x8c0d('0x1b')]+_0x381c9a['limit'];var _0x4e3b41;if(_0x426f78>=_0x3a89b3){_0x426f78=_0x3a89b3;_0x4e3b41=0xc8;}else{_0x4e3b41=0xce;}_0xd42f70[_0x8c0d('0x18')](_0x4e3b41);return _0xd42f70[_0x8c0d('0x1f')]('Content-Range',_0x41dd5d+'-'+_0x426f78+'/'+_0x3a89b3)['json'](_0x30216e);}return null;};}function patchUpdates(_0x97541c){return function(_0x545eeb){try{jsonpatch['apply'](_0x545eeb,_0x97541c,!![]);}catch(_0x138faf){return BPromise[_0x8c0d('0x20')](_0x138faf);}return _0x545eeb['save']();};}function saveUpdates(_0x17f645,_0x5000d2){return function(_0x3f6884){if(_0x3f6884){return _0x3f6884[_0x8c0d('0x21')](_0x17f645)[_0x8c0d('0x22')](function(_0x337343){return _0x337343;});}return null;};}function removeEntity(_0x4cc4b7,_0x18beea){return function(_0x2be390){if(_0x2be390){return _0x2be390[_0x8c0d('0x23')]()[_0x8c0d('0x22')](function(){_0x4cc4b7[_0x8c0d('0x18')](0xcc)[_0x8c0d('0x19')]();});}};}function handleEntityNotFound(_0x30cb56,_0x2e1c03){return function(_0x1df676){if(!_0x1df676){_0x30cb56[_0x8c0d('0x17')](0x194);}return _0x1df676;};}function handleError(_0x3098e5,_0x4ec68d){_0x4ec68d=_0x4ec68d||0x1f4;return function(_0x17ec07){logger[_0x8c0d('0x24')](_0x17ec07[_0x8c0d('0x25')]);if(_0x17ec07[_0x8c0d('0x26')]){delete _0x17ec07['name'];}_0x3098e5['status'](_0x4ec68d)[_0x8c0d('0x27')](_0x17ec07);};}exports['index']=function(_0x5c141f,_0x5e55d4){var _0x501e05={},_0x1f556b={},_0x137f04={'count':0x0,'rows':[]};var _0x17e0f4=_[_0x8c0d('0x28')](db[_0x8c0d('0x29')][_0x8c0d('0x2a')],function(_0x3dd2f6){return{'name':_0x3dd2f6[_0x8c0d('0x2b')],'type':_0x3dd2f6[_0x8c0d('0x2c')][_0x8c0d('0x2d')]};});_0x1f556b[_0x8c0d('0x2e')]=_[_0x8c0d('0x28')](_0x17e0f4,_0x8c0d('0x26'));_0x1f556b[_0x8c0d('0x2f')]=_[_0x8c0d('0x30')](_0x5c141f[_0x8c0d('0x2f')]);_0x1f556b[_0x8c0d('0x31')]=_[_0x8c0d('0x32')](_0x1f556b['model'],_0x1f556b['query']);_0x501e05[_0x8c0d('0x33')]=_[_0x8c0d('0x32')](_0x1f556b[_0x8c0d('0x2e')],qs[_0x8c0d('0x34')](_0x5c141f[_0x8c0d('0x2f')]['fields']));_0x501e05[_0x8c0d('0x33')]=_0x501e05[_0x8c0d('0x33')][_0x8c0d('0x35')]?_0x501e05[_0x8c0d('0x33')]:_0x1f556b[_0x8c0d('0x2e')];if(!_0x5c141f[_0x8c0d('0x2f')][_0x8c0d('0x36')](_0x8c0d('0x37'))){_0x501e05[_0x8c0d('0x1d')]=qs[_0x8c0d('0x1d')](_0x5c141f['query'][_0x8c0d('0x1d')]);_0x501e05[_0x8c0d('0x1b')]=qs['offset'](_0x5c141f[_0x8c0d('0x2f')][_0x8c0d('0x1b')]);}_0x501e05[_0x8c0d('0x38')]=qs[_0x8c0d('0x39')](_0x5c141f[_0x8c0d('0x2f')][_0x8c0d('0x39')]);_0x501e05[_0x8c0d('0x3a')]=qs[_0x8c0d('0x31')](_[_0x8c0d('0x3b')](_0x5c141f[_0x8c0d('0x2f')],_0x1f556b[_0x8c0d('0x31')]),_0x17e0f4);if(_0x5c141f[_0x8c0d('0x2f')][_0x8c0d('0x3c')]){_0x501e05[_0x8c0d('0x3a')]=_[_0x8c0d('0x3d')](_0x501e05['where'],{'$or':_[_0x8c0d('0x28')](_0x17e0f4,function(_0x2c1092){if(_0x2c1092[_0x8c0d('0x2c')]!==_0x8c0d('0x3e')){var _0x3c10f5={};_0x3c10f5[_0x2c1092[_0x8c0d('0x26')]]={'$like':'%'+_0x5c141f['query']['filter']+'%'};return _0x3c10f5;}})});}_0x501e05=_['merge']({},_0x501e05,_0x5c141f['options']);var _0x36a27e={'where':_0x501e05['where']};return db['VtigerConfiguration'][_0x8c0d('0x1e')](_0x36a27e)[_0x8c0d('0x22')](function(_0x4c4226){_0x137f04['count']=_0x4c4226;if(_0x5c141f[_0x8c0d('0x2f')][_0x8c0d('0x3f')]){_0x501e05[_0x8c0d('0x40')]=[{'all':!![]}];}return db[_0x8c0d('0x29')][_0x8c0d('0x41')](_0x501e05);})['then'](function(_0x59f811){_0x137f04[_0x8c0d('0x42')]=_0x59f811;return _0x137f04;})[_0x8c0d('0x22')](respondWithFilteredResult(_0x5e55d4,_0x501e05))['catch'](handleError(_0x5e55d4,null));};exports[_0x8c0d('0x43')]=function(_0x28c70f,_0x2c04c5){var _0x1ddca6={'raw':![],'where':{'id':_0x28c70f[_0x8c0d('0x44')]['id']}},_0x5c169e={};_0x5c169e['model']=_[_0x8c0d('0x30')](db[_0x8c0d('0x29')]['rawAttributes']);_0x5c169e['query']=_[_0x8c0d('0x30')](_0x28c70f['query']);_0x5c169e[_0x8c0d('0x31')]=_['intersection'](_0x5c169e[_0x8c0d('0x2e')],_0x5c169e[_0x8c0d('0x2f')]);_0x1ddca6[_0x8c0d('0x33')]=_[_0x8c0d('0x32')](_0x5c169e[_0x8c0d('0x2e')],qs[_0x8c0d('0x34')](_0x28c70f[_0x8c0d('0x2f')]['fields']));_0x1ddca6[_0x8c0d('0x33')]=_0x1ddca6['attributes'][_0x8c0d('0x35')]?_0x1ddca6[_0x8c0d('0x33')]:_0x5c169e['model'];if(_0x28c70f[_0x8c0d('0x2f')][_0x8c0d('0x3f')]){_0x1ddca6[_0x8c0d('0x40')]=[{'all':!![]}];}_0x1ddca6=_[_0x8c0d('0x3d')]({},_0x1ddca6,_0x28c70f[_0x8c0d('0x45')]);return db[_0x8c0d('0x29')][_0x8c0d('0x46')](_0x1ddca6)[_0x8c0d('0x22')](handleEntityNotFound(_0x2c04c5,null))['then'](respondWithResult(_0x2c04c5,null))[_0x8c0d('0x47')](handleError(_0x2c04c5,null));};exports[_0x8c0d('0x48')]=function(_0x58c8da,_0x9bcd90){return db[_0x8c0d('0x29')][_0x8c0d('0x48')](_0x58c8da[_0x8c0d('0x49')],{})[_0x8c0d('0x22')](respondWithResult(_0x9bcd90,0xc9))[_0x8c0d('0x47')](handleError(_0x9bcd90,null));};exports[_0x8c0d('0x21')]=function(_0x28fd0a,_0x4a8a4a){if(_0x28fd0a[_0x8c0d('0x49')]['id']){delete _0x28fd0a[_0x8c0d('0x49')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x28fd0a['params']['id']}})[_0x8c0d('0x22')](handleEntityNotFound(_0x4a8a4a,null))[_0x8c0d('0x22')](saveUpdates(_0x28fd0a[_0x8c0d('0x49')],null))[_0x8c0d('0x22')](respondWithResult(_0x4a8a4a,null))[_0x8c0d('0x47')](handleError(_0x4a8a4a,null));};exports[_0x8c0d('0x23')]=function(_0x2154bf,_0x3096ff){return db[_0x8c0d('0x29')][_0x8c0d('0x46')]({'where':{'id':_0x2154bf[_0x8c0d('0x44')]['id']}})[_0x8c0d('0x22')](handleEntityNotFound(_0x3096ff,null))[_0x8c0d('0x22')](removeEntity(_0x3096ff,null))['catch'](handleError(_0x3096ff,null));};exports[_0x8c0d('0x4a')]=function(_0x5e3923,_0x1b8a36,_0x15c517){var _0x2a4d4f={};var _0xe6a88a={};var _0x5b1275;var _0x10f673;return db[_0x8c0d('0x29')][_0x8c0d('0x4b')]({'where':{'id':_0x5e3923[_0x8c0d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b8a36,null))[_0x8c0d('0x22')](function(_0x3ceb4f){if(_0x3ceb4f){_0x5b1275=_0x3ceb4f;_0xe6a88a[_0x8c0d('0x2e')]=_[_0x8c0d('0x30')](db['VtigerField'][_0x8c0d('0x2a')]);_0xe6a88a[_0x8c0d('0x2f')]=_[_0x8c0d('0x30')](_0x5e3923[_0x8c0d('0x2f')]);_0xe6a88a[_0x8c0d('0x31')]=_[_0x8c0d('0x32')](_0xe6a88a[_0x8c0d('0x2e')],_0xe6a88a[_0x8c0d('0x2f')]);_0x2a4d4f[_0x8c0d('0x33')]=_[_0x8c0d('0x32')](_0xe6a88a[_0x8c0d('0x2e')],qs[_0x8c0d('0x34')](_0x5e3923[_0x8c0d('0x2f')][_0x8c0d('0x34')]));_0x2a4d4f[_0x8c0d('0x33')]=_0x2a4d4f['attributes']['length']?_0x2a4d4f['attributes']:_0xe6a88a[_0x8c0d('0x2e')];_0x2a4d4f[_0x8c0d('0x38')]=qs[_0x8c0d('0x39')](_0x5e3923[_0x8c0d('0x2f')][_0x8c0d('0x39')]);_0x2a4d4f['where']=qs[_0x8c0d('0x31')](_[_0x8c0d('0x3b')](_0x5e3923[_0x8c0d('0x2f')],_0xe6a88a[_0x8c0d('0x31')]));if(_0x5e3923[_0x8c0d('0x2f')]['filter']){_0x2a4d4f[_0x8c0d('0x3a')]=_[_0x8c0d('0x3d')](_0x2a4d4f[_0x8c0d('0x3a')],{'$or':_[_0x8c0d('0x28')](_0x2a4d4f[_0x8c0d('0x33')],function(_0x2f4e0a){var _0x344863={};_0x344863[_0x2f4e0a]={'$like':'%'+_0x5e3923[_0x8c0d('0x2f')][_0x8c0d('0x3c')]+'%'};return _0x344863;})});}_0x2a4d4f=_[_0x8c0d('0x3d')]({},_0x2a4d4f,_0x5e3923['options']);return _0x5b1275['getFields'](_0x2a4d4f);}})['then'](function(_0x20bb42){if(_0x20bb42){_0x10f673=_0x20bb42[_0x8c0d('0x35')];if(!_0x5e3923[_0x8c0d('0x2f')][_0x8c0d('0x36')](_0x8c0d('0x37'))){_0x2a4d4f[_0x8c0d('0x1d')]=qs[_0x8c0d('0x1d')](_0x5e3923['query'][_0x8c0d('0x1d')]);_0x2a4d4f['offset']=qs['offset'](_0x5e3923[_0x8c0d('0x2f')][_0x8c0d('0x1b')]);}return _0x5b1275[_0x8c0d('0x4a')](_0x2a4d4f);}})[_0x8c0d('0x22')](function(_0x6b93ad){if(_0x6b93ad){return _0x6b93ad?{'count':_0x10f673,'rows':_0x6b93ad}:null;}})[_0x8c0d('0x22')](respondWithResult(_0x1b8a36,null))['catch'](handleError(_0x1b8a36,null));};exports[_0x8c0d('0x4c')]=function(_0x24acba,_0x39ded0,_0x2dbb00){var _0x2d998a={};var _0x5e8562={};var _0x362587;var _0x186ce3;return db[_0x8c0d('0x29')][_0x8c0d('0x4b')]({'where':{'id':_0x24acba[_0x8c0d('0x44')]['id']}})['then'](handleEntityNotFound(_0x39ded0,null))[_0x8c0d('0x22')](function(_0x633816){if(_0x633816){_0x362587=_0x633816;_0x5e8562[_0x8c0d('0x2e')]=_[_0x8c0d('0x30')](db['VtigerField'][_0x8c0d('0x2a')]);_0x5e8562[_0x8c0d('0x2f')]=_[_0x8c0d('0x30')](_0x24acba[_0x8c0d('0x2f')]);_0x5e8562[_0x8c0d('0x31')]=_[_0x8c0d('0x32')](_0x5e8562[_0x8c0d('0x2e')],_0x5e8562[_0x8c0d('0x2f')]);_0x2d998a['attributes']=_[_0x8c0d('0x32')](_0x5e8562[_0x8c0d('0x2e')],qs[_0x8c0d('0x34')](_0x24acba[_0x8c0d('0x2f')][_0x8c0d('0x34')]));_0x2d998a['attributes']=_0x2d998a[_0x8c0d('0x33')]['length']?_0x2d998a['attributes']:_0x5e8562[_0x8c0d('0x2e')];_0x2d998a[_0x8c0d('0x38')]=qs[_0x8c0d('0x39')](_0x24acba[_0x8c0d('0x2f')][_0x8c0d('0x39')]);_0x2d998a[_0x8c0d('0x3a')]=qs[_0x8c0d('0x31')](_['pick'](_0x24acba[_0x8c0d('0x2f')],_0x5e8562[_0x8c0d('0x31')]));if(_0x24acba[_0x8c0d('0x2f')]['filter']){_0x2d998a[_0x8c0d('0x3a')]=_[_0x8c0d('0x3d')](_0x2d998a[_0x8c0d('0x3a')],{'$or':_[_0x8c0d('0x28')](_0x2d998a['attributes'],function(_0x31864c){var _0x31a881={};_0x31a881[_0x31864c]={'$like':'%'+_0x24acba[_0x8c0d('0x2f')][_0x8c0d('0x3c')]+'%'};return _0x31a881;})});}_0x2d998a=_[_0x8c0d('0x3d')]({},_0x2d998a,_0x24acba[_0x8c0d('0x45')]);return _0x362587['getSubjects'](_0x2d998a);}})[_0x8c0d('0x22')](function(_0x5e0f88){if(_0x5e0f88){_0x186ce3=_0x5e0f88[_0x8c0d('0x35')];if(!_0x24acba[_0x8c0d('0x2f')]['hasOwnProperty'](_0x8c0d('0x37'))){_0x2d998a[_0x8c0d('0x1d')]=qs[_0x8c0d('0x1d')](_0x24acba['query'][_0x8c0d('0x1d')]);_0x2d998a[_0x8c0d('0x1b')]=qs[_0x8c0d('0x1b')](_0x24acba[_0x8c0d('0x2f')][_0x8c0d('0x1b')]);}return _0x362587[_0x8c0d('0x4c')](_0x2d998a);}})[_0x8c0d('0x22')](function(_0x275dba){if(_0x275dba){return _0x275dba?{'count':_0x186ce3,'rows':_0x275dba}:null;}})[_0x8c0d('0x22')](respondWithResult(_0x39ded0,null))[_0x8c0d('0x47')](handleError(_0x39ded0,null));};exports[_0x8c0d('0x4d')]=function(_0x1c913d,_0x348b2e,_0x4f95f9){var _0x7c5d13={};var _0x577232={};var _0x38902b;var _0x2465ec;return db['VtigerConfiguration'][_0x8c0d('0x4b')]({'where':{'id':_0x1c913d['params']['id']}})['then'](handleEntityNotFound(_0x348b2e,null))['then'](function(_0xdb3dcb){if(_0xdb3dcb){_0x38902b=_0xdb3dcb;_0x577232['model']=_['keys'](db[_0x8c0d('0x4e')]['rawAttributes']);_0x577232[_0x8c0d('0x2f')]=_[_0x8c0d('0x30')](_0x1c913d['query']);_0x577232[_0x8c0d('0x31')]=_[_0x8c0d('0x32')](_0x577232[_0x8c0d('0x2e')],_0x577232[_0x8c0d('0x2f')]);_0x7c5d13[_0x8c0d('0x33')]=_[_0x8c0d('0x32')](_0x577232['model'],qs[_0x8c0d('0x34')](_0x1c913d[_0x8c0d('0x2f')][_0x8c0d('0x34')]));_0x7c5d13[_0x8c0d('0x33')]=_0x7c5d13[_0x8c0d('0x33')][_0x8c0d('0x35')]?_0x7c5d13[_0x8c0d('0x33')]:_0x577232[_0x8c0d('0x2e')];_0x7c5d13[_0x8c0d('0x38')]=qs[_0x8c0d('0x39')](_0x1c913d[_0x8c0d('0x2f')]['sort']);_0x7c5d13[_0x8c0d('0x3a')]=qs[_0x8c0d('0x31')](_[_0x8c0d('0x3b')](_0x1c913d[_0x8c0d('0x2f')],_0x577232[_0x8c0d('0x31')]));if(_0x1c913d[_0x8c0d('0x2f')][_0x8c0d('0x3c')]){_0x7c5d13[_0x8c0d('0x3a')]=_[_0x8c0d('0x3d')](_0x7c5d13[_0x8c0d('0x3a')],{'$or':_[_0x8c0d('0x28')](_0x7c5d13[_0x8c0d('0x33')],function(_0x2b59fc){var _0x1b32c6={};_0x1b32c6[_0x2b59fc]={'$like':'%'+_0x1c913d[_0x8c0d('0x2f')][_0x8c0d('0x3c')]+'%'};return _0x1b32c6;})});}_0x7c5d13=_['merge']({},_0x7c5d13,_0x1c913d[_0x8c0d('0x45')]);return _0x38902b['getDescriptions'](_0x7c5d13);}})[_0x8c0d('0x22')](function(_0x5cb76d){if(_0x5cb76d){_0x2465ec=_0x5cb76d[_0x8c0d('0x35')];if(!_0x1c913d['query'][_0x8c0d('0x36')](_0x8c0d('0x37'))){_0x7c5d13[_0x8c0d('0x1d')]=qs['limit'](_0x1c913d[_0x8c0d('0x2f')][_0x8c0d('0x1d')]);_0x7c5d13[_0x8c0d('0x1b')]=qs[_0x8c0d('0x1b')](_0x1c913d[_0x8c0d('0x2f')]['offset']);}return _0x38902b['getDescriptions'](_0x7c5d13);}})[_0x8c0d('0x22')](function(_0x358e61){if(_0x358e61){return _0x358e61?{'count':_0x2465ec,'rows':_0x358e61}:null;}})[_0x8c0d('0x22')](respondWithResult(_0x348b2e,null))[_0x8c0d('0x47')](handleError(_0x348b2e,null));}; \ No newline at end of file +var _0x85b2=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','getFields','order','pick','filter','getSubjects','findOne','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index'];(function(_0x388e15,_0x49788b){var _0x51b23c=function(_0x234bff){while(--_0x234bff){_0x388e15['push'](_0x388e15['shift']());}};_0x51b23c(++_0x49788b);}(_0x85b2,0x11a));var _0x285b=function(_0x4a5ec4,_0x24fa15){_0x4a5ec4=_0x4a5ec4-0x0;var _0x3bd782=_0x85b2[_0x4a5ec4];return _0x3bd782;};'use strict';var emlformat=require(_0x285b('0x0'));var rimraf=require(_0x285b('0x1'));var zipdir=require(_0x285b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x285b('0x3'));var moment=require(_0x285b('0x4'));var BPromise=require(_0x285b('0x5'));var Mustache=require(_0x285b('0x6'));var util=require(_0x285b('0x7'));var path=require(_0x285b('0x8'));var sox=require(_0x285b('0x9'));var csv=require(_0x285b('0xa'));var ejs=require(_0x285b('0xb'));var fs=require('fs');var fs_extra=require(_0x285b('0xc'));var _=require('lodash');var squel=require(_0x285b('0xd'));var crypto=require('crypto');var jsforce=require(_0x285b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x285b('0xa'));var querystring=require(_0x285b('0xf'));var Papa=require(_0x285b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x285b('0x11'));var as=require(_0x285b('0x12'));var hardwareService=require(_0x285b('0x13'));var logger=require(_0x285b('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x285b('0x15'));var db=require(_0x285b('0x16'))['db'];function respondWithStatusCode(_0x3aaf3a,_0x14ae0d){_0x14ae0d=_0x14ae0d||0xcc;return function(_0x513b65){if(_0x513b65){return _0x3aaf3a['sendStatus'](_0x14ae0d);}return _0x3aaf3a[_0x285b('0x17')](_0x14ae0d)[_0x285b('0x18')]();};}function respondWithResult(_0x491001,_0x1b0874){_0x1b0874=_0x1b0874||0xc8;return function(_0x3a6839){if(_0x3a6839){return _0x491001[_0x285b('0x17')](_0x1b0874)[_0x285b('0x19')](_0x3a6839);}};}function respondWithFilteredResult(_0x34805f,_0x3b61d6){return function(_0x406911){if(_0x406911){var _0x230ade=typeof _0x3b61d6[_0x285b('0x1a')]===_0x285b('0x1b')&&typeof _0x3b61d6[_0x285b('0x1c')]==='undefined';var _0x3dfa1d=_0x406911[_0x285b('0x1d')];var _0x46df50=_0x230ade?0x0:_0x3b61d6['offset'];var _0x3c91f4=_0x230ade?_0x406911[_0x285b('0x1d')]:_0x3b61d6[_0x285b('0x1a')]+_0x3b61d6[_0x285b('0x1c')];var _0x28fcc7;if(_0x3c91f4>=_0x3dfa1d){_0x3c91f4=_0x3dfa1d;_0x28fcc7=0xc8;}else{_0x28fcc7=0xce;}_0x34805f[_0x285b('0x17')](_0x28fcc7);return _0x34805f[_0x285b('0x1e')](_0x285b('0x1f'),_0x46df50+'-'+_0x3c91f4+'/'+_0x3dfa1d)[_0x285b('0x19')](_0x406911);}return null;};}function patchUpdates(_0xa42e50){return function(_0x32d74e){try{jsonpatch[_0x285b('0x20')](_0x32d74e,_0xa42e50,!![]);}catch(_0x124f08){return BPromise[_0x285b('0x21')](_0x124f08);}return _0x32d74e['save']();};}function saveUpdates(_0x53a1b0,_0x184d18){return function(_0xb5649d){if(_0xb5649d){return _0xb5649d[_0x285b('0x22')](_0x53a1b0)[_0x285b('0x23')](function(_0x3babf6){return _0x3babf6;});}return null;};}function removeEntity(_0x3330da,_0x3c7a78){return function(_0x317873){if(_0x317873){return _0x317873['destroy']()['then'](function(){_0x3330da[_0x285b('0x17')](0xcc)[_0x285b('0x18')]();});}};}function handleEntityNotFound(_0x441c64,_0x4c05af){return function(_0x414b10){if(!_0x414b10){_0x441c64[_0x285b('0x24')](0x194);}return _0x414b10;};}function handleError(_0x1b467d,_0x4f6608){_0x4f6608=_0x4f6608||0x1f4;return function(_0xd5103c){logger[_0x285b('0x25')](_0xd5103c[_0x285b('0x26')]);if(_0xd5103c[_0x285b('0x27')]){delete _0xd5103c[_0x285b('0x27')];}_0x1b467d['status'](_0x4f6608)[_0x285b('0x28')](_0xd5103c);};}exports[_0x285b('0x29')]=function(_0x201095,_0x587ebf){var _0x4e7526={},_0x3fc567={},_0x3fb61a={'count':0x0,'rows':[]};var _0x10874e=_[_0x285b('0x2a')](db['VtigerConfiguration'][_0x285b('0x2b')],function(_0x54cbf0){return{'name':_0x54cbf0[_0x285b('0x2c')],'type':_0x54cbf0[_0x285b('0x2d')][_0x285b('0x2e')]};});_0x3fc567[_0x285b('0x2f')]=_[_0x285b('0x2a')](_0x10874e,_0x285b('0x27'));_0x3fc567[_0x285b('0x30')]=_[_0x285b('0x31')](_0x201095['query']);_0x3fc567[_0x285b('0x32')]=_[_0x285b('0x33')](_0x3fc567[_0x285b('0x2f')],_0x3fc567[_0x285b('0x30')]);_0x4e7526[_0x285b('0x34')]=_[_0x285b('0x33')](_0x3fc567[_0x285b('0x2f')],qs[_0x285b('0x35')](_0x201095['query'][_0x285b('0x35')]));_0x4e7526['attributes']=_0x4e7526[_0x285b('0x34')]['length']?_0x4e7526['attributes']:_0x3fc567[_0x285b('0x2f')];if(!_0x201095[_0x285b('0x30')][_0x285b('0x36')](_0x285b('0x37'))){_0x4e7526[_0x285b('0x1c')]=qs[_0x285b('0x1c')](_0x201095[_0x285b('0x30')]['limit']);_0x4e7526['offset']=qs[_0x285b('0x1a')](_0x201095['query']['offset']);}_0x4e7526['order']=qs['sort'](_0x201095['query'][_0x285b('0x38')]);_0x4e7526['where']=qs['filters'](_['pick'](_0x201095[_0x285b('0x30')],_0x3fc567[_0x285b('0x32')]),_0x10874e);if(_0x201095[_0x285b('0x30')]['filter']){_0x4e7526[_0x285b('0x39')]=_[_0x285b('0x3a')](_0x4e7526[_0x285b('0x39')],{'$or':_[_0x285b('0x2a')](_0x10874e,function(_0x282cf1){if(_0x282cf1[_0x285b('0x2d')]!==_0x285b('0x3b')){var _0xc117cb={};_0xc117cb[_0x282cf1[_0x285b('0x27')]]={'$like':'%'+_0x201095[_0x285b('0x30')]['filter']+'%'};return _0xc117cb;}})});}_0x4e7526=_[_0x285b('0x3a')]({},_0x4e7526,_0x201095[_0x285b('0x3c')]);var _0x3b4b26={'where':_0x4e7526['where']};return db[_0x285b('0x3d')][_0x285b('0x1d')](_0x3b4b26)[_0x285b('0x23')](function(_0x17649b){_0x3fb61a[_0x285b('0x1d')]=_0x17649b;if(_0x201095[_0x285b('0x30')][_0x285b('0x3e')]){_0x4e7526[_0x285b('0x3f')]=[{'all':!![]}];}return db[_0x285b('0x3d')]['findAll'](_0x4e7526);})[_0x285b('0x23')](function(_0x4f61c5){_0x3fb61a[_0x285b('0x40')]=_0x4f61c5;return _0x3fb61a;})['then'](respondWithFilteredResult(_0x587ebf,_0x4e7526))[_0x285b('0x41')](handleError(_0x587ebf,null));};exports[_0x285b('0x42')]=function(_0x4ad0ac,_0x445101){var _0x556015={'raw':![],'where':{'id':_0x4ad0ac[_0x285b('0x43')]['id']}},_0x485546={};_0x485546[_0x285b('0x2f')]=_[_0x285b('0x31')](db['VtigerConfiguration'][_0x285b('0x2b')]);_0x485546['query']=_['keys'](_0x4ad0ac[_0x285b('0x30')]);_0x485546[_0x285b('0x32')]=_[_0x285b('0x33')](_0x485546[_0x285b('0x2f')],_0x485546[_0x285b('0x30')]);_0x556015[_0x285b('0x34')]=_[_0x285b('0x33')](_0x485546['model'],qs[_0x285b('0x35')](_0x4ad0ac['query'][_0x285b('0x35')]));_0x556015[_0x285b('0x34')]=_0x556015[_0x285b('0x34')][_0x285b('0x44')]?_0x556015[_0x285b('0x34')]:_0x485546[_0x285b('0x2f')];if(_0x4ad0ac[_0x285b('0x30')]['includeAll']){_0x556015[_0x285b('0x3f')]=[{'all':!![]}];}_0x556015=_[_0x285b('0x3a')]({},_0x556015,_0x4ad0ac['options']);return db[_0x285b('0x3d')][_0x285b('0x45')](_0x556015)[_0x285b('0x23')](handleEntityNotFound(_0x445101,null))['then'](respondWithResult(_0x445101,null))[_0x285b('0x41')](handleError(_0x445101,null));};exports[_0x285b('0x46')]=function(_0x413fa1,_0x288b81){return db[_0x285b('0x3d')][_0x285b('0x46')](_0x413fa1[_0x285b('0x47')],{})[_0x285b('0x23')](respondWithResult(_0x288b81,0xc9))[_0x285b('0x41')](handleError(_0x288b81,null));};exports[_0x285b('0x22')]=function(_0x1b4208,_0x40178d){if(_0x1b4208[_0x285b('0x47')]['id']){delete _0x1b4208[_0x285b('0x47')]['id'];}return db[_0x285b('0x3d')][_0x285b('0x45')]({'where':{'id':_0x1b4208[_0x285b('0x43')]['id']}})['then'](handleEntityNotFound(_0x40178d,null))[_0x285b('0x23')](saveUpdates(_0x1b4208[_0x285b('0x47')],null))['then'](respondWithResult(_0x40178d,null))[_0x285b('0x41')](handleError(_0x40178d,null));};exports[_0x285b('0x48')]=function(_0x26655a,_0x38b0c6){return db[_0x285b('0x3d')]['find']({'where':{'id':_0x26655a[_0x285b('0x43')]['id']}})['then'](handleEntityNotFound(_0x38b0c6,null))[_0x285b('0x23')](removeEntity(_0x38b0c6,null))[_0x285b('0x41')](handleError(_0x38b0c6,null));};exports[_0x285b('0x49')]=function(_0x414a57,_0x3f8dd1,_0x3b76af){var _0x2c4675={};var _0x2de847={};var _0x410c8f;var _0x15e672;return db[_0x285b('0x3d')]['findOne']({'where':{'id':_0x414a57['params']['id']}})[_0x285b('0x23')](handleEntityNotFound(_0x3f8dd1,null))['then'](function(_0x424839){if(_0x424839){_0x410c8f=_0x424839;_0x2de847['model']=_[_0x285b('0x31')](db['VtigerField']['rawAttributes']);_0x2de847[_0x285b('0x30')]=_[_0x285b('0x31')](_0x414a57[_0x285b('0x30')]);_0x2de847['filters']=_['intersection'](_0x2de847[_0x285b('0x2f')],_0x2de847[_0x285b('0x30')]);_0x2c4675['attributes']=_[_0x285b('0x33')](_0x2de847[_0x285b('0x2f')],qs[_0x285b('0x35')](_0x414a57[_0x285b('0x30')]['fields']));_0x2c4675[_0x285b('0x34')]=_0x2c4675[_0x285b('0x34')][_0x285b('0x44')]?_0x2c4675[_0x285b('0x34')]:_0x2de847[_0x285b('0x2f')];_0x2c4675[_0x285b('0x4a')]=qs[_0x285b('0x38')](_0x414a57[_0x285b('0x30')][_0x285b('0x38')]);_0x2c4675[_0x285b('0x39')]=qs['filters'](_[_0x285b('0x4b')](_0x414a57[_0x285b('0x30')],_0x2de847[_0x285b('0x32')]));if(_0x414a57['query'][_0x285b('0x4c')]){_0x2c4675[_0x285b('0x39')]=_[_0x285b('0x3a')](_0x2c4675[_0x285b('0x39')],{'$or':_[_0x285b('0x2a')](_0x2c4675[_0x285b('0x34')],function(_0x247f4c){var _0x9ab633={};_0x9ab633[_0x247f4c]={'$like':'%'+_0x414a57['query'][_0x285b('0x4c')]+'%'};return _0x9ab633;})});}_0x2c4675=_[_0x285b('0x3a')]({},_0x2c4675,_0x414a57['options']);return _0x410c8f[_0x285b('0x49')](_0x2c4675);}})[_0x285b('0x23')](function(_0x3c5b28){if(_0x3c5b28){_0x15e672=_0x3c5b28[_0x285b('0x44')];if(!_0x414a57['query'][_0x285b('0x36')](_0x285b('0x37'))){_0x2c4675[_0x285b('0x1c')]=qs[_0x285b('0x1c')](_0x414a57['query'][_0x285b('0x1c')]);_0x2c4675['offset']=qs[_0x285b('0x1a')](_0x414a57[_0x285b('0x30')][_0x285b('0x1a')]);}return _0x410c8f[_0x285b('0x49')](_0x2c4675);}})[_0x285b('0x23')](function(_0x4544fb){if(_0x4544fb){return _0x4544fb?{'count':_0x15e672,'rows':_0x4544fb}:null;}})[_0x285b('0x23')](respondWithResult(_0x3f8dd1,null))[_0x285b('0x41')](handleError(_0x3f8dd1,null));};exports[_0x285b('0x4d')]=function(_0x1f5bd4,_0x411b79,_0x36e48f){var _0x3060d2={};var _0x37caf4={};var _0x167ce9;var _0x37dace;return db[_0x285b('0x3d')][_0x285b('0x4e')]({'where':{'id':_0x1f5bd4['params']['id']}})[_0x285b('0x23')](handleEntityNotFound(_0x411b79,null))['then'](function(_0x552d21){if(_0x552d21){_0x167ce9=_0x552d21;_0x37caf4[_0x285b('0x2f')]=_[_0x285b('0x31')](db[_0x285b('0x4f')][_0x285b('0x2b')]);_0x37caf4[_0x285b('0x30')]=_[_0x285b('0x31')](_0x1f5bd4[_0x285b('0x30')]);_0x37caf4[_0x285b('0x32')]=_[_0x285b('0x33')](_0x37caf4['model'],_0x37caf4['query']);_0x3060d2[_0x285b('0x34')]=_[_0x285b('0x33')](_0x37caf4[_0x285b('0x2f')],qs['fields'](_0x1f5bd4[_0x285b('0x30')][_0x285b('0x35')]));_0x3060d2[_0x285b('0x34')]=_0x3060d2[_0x285b('0x34')][_0x285b('0x44')]?_0x3060d2[_0x285b('0x34')]:_0x37caf4['model'];_0x3060d2[_0x285b('0x4a')]=qs[_0x285b('0x38')](_0x1f5bd4[_0x285b('0x30')]['sort']);_0x3060d2[_0x285b('0x39')]=qs[_0x285b('0x32')](_['pick'](_0x1f5bd4['query'],_0x37caf4[_0x285b('0x32')]));if(_0x1f5bd4[_0x285b('0x30')][_0x285b('0x4c')]){_0x3060d2[_0x285b('0x39')]=_[_0x285b('0x3a')](_0x3060d2['where'],{'$or':_[_0x285b('0x2a')](_0x3060d2[_0x285b('0x34')],function(_0x319d7f){var _0x54e86f={};_0x54e86f[_0x319d7f]={'$like':'%'+_0x1f5bd4[_0x285b('0x30')][_0x285b('0x4c')]+'%'};return _0x54e86f;})});}_0x3060d2=_['merge']({},_0x3060d2,_0x1f5bd4[_0x285b('0x3c')]);return _0x167ce9[_0x285b('0x4d')](_0x3060d2);}})[_0x285b('0x23')](function(_0x149355){if(_0x149355){_0x37dace=_0x149355[_0x285b('0x44')];if(!_0x1f5bd4[_0x285b('0x30')][_0x285b('0x36')](_0x285b('0x37'))){_0x3060d2['limit']=qs[_0x285b('0x1c')](_0x1f5bd4[_0x285b('0x30')][_0x285b('0x1c')]);_0x3060d2[_0x285b('0x1a')]=qs[_0x285b('0x1a')](_0x1f5bd4[_0x285b('0x30')][_0x285b('0x1a')]);}return _0x167ce9[_0x285b('0x4d')](_0x3060d2);}})[_0x285b('0x23')](function(_0x4d1937){if(_0x4d1937){return _0x4d1937?{'count':_0x37dace,'rows':_0x4d1937}:null;}})['then'](respondWithResult(_0x411b79,null))[_0x285b('0x41')](handleError(_0x411b79,null));};exports[_0x285b('0x50')]=function(_0x2d187c,_0x223e90,_0x464f27){var _0x38a150={};var _0x338a31={};var _0x1ee1c3;var _0x57d966;return db[_0x285b('0x3d')][_0x285b('0x4e')]({'where':{'id':_0x2d187c[_0x285b('0x43')]['id']}})[_0x285b('0x23')](handleEntityNotFound(_0x223e90,null))[_0x285b('0x23')](function(_0x3b4e94){if(_0x3b4e94){_0x1ee1c3=_0x3b4e94;_0x338a31[_0x285b('0x2f')]=_['keys'](db[_0x285b('0x4f')][_0x285b('0x2b')]);_0x338a31[_0x285b('0x30')]=_['keys'](_0x2d187c[_0x285b('0x30')]);_0x338a31[_0x285b('0x32')]=_[_0x285b('0x33')](_0x338a31['model'],_0x338a31[_0x285b('0x30')]);_0x38a150[_0x285b('0x34')]=_[_0x285b('0x33')](_0x338a31['model'],qs[_0x285b('0x35')](_0x2d187c[_0x285b('0x30')][_0x285b('0x35')]));_0x38a150[_0x285b('0x34')]=_0x38a150[_0x285b('0x34')]['length']?_0x38a150['attributes']:_0x338a31[_0x285b('0x2f')];_0x38a150['order']=qs[_0x285b('0x38')](_0x2d187c['query'][_0x285b('0x38')]);_0x38a150[_0x285b('0x39')]=qs['filters'](_[_0x285b('0x4b')](_0x2d187c['query'],_0x338a31['filters']));if(_0x2d187c[_0x285b('0x30')][_0x285b('0x4c')]){_0x38a150['where']=_[_0x285b('0x3a')](_0x38a150[_0x285b('0x39')],{'$or':_[_0x285b('0x2a')](_0x38a150['attributes'],function(_0x4ea66f){var _0x37baff={};_0x37baff[_0x4ea66f]={'$like':'%'+_0x2d187c[_0x285b('0x30')][_0x285b('0x4c')]+'%'};return _0x37baff;})});}_0x38a150=_[_0x285b('0x3a')]({},_0x38a150,_0x2d187c[_0x285b('0x3c')]);return _0x1ee1c3['getDescriptions'](_0x38a150);}})[_0x285b('0x23')](function(_0x20b588){if(_0x20b588){_0x57d966=_0x20b588['length'];if(!_0x2d187c['query'][_0x285b('0x36')](_0x285b('0x37'))){_0x38a150['limit']=qs[_0x285b('0x1c')](_0x2d187c[_0x285b('0x30')][_0x285b('0x1c')]);_0x38a150[_0x285b('0x1a')]=qs['offset'](_0x2d187c[_0x285b('0x30')][_0x285b('0x1a')]);}return _0x1ee1c3[_0x285b('0x50')](_0x38a150);}})['then'](function(_0x254a7e){if(_0x254a7e){return _0x254a7e?{'count':_0x57d966,'rows':_0x254a7e}:null;}})[_0x285b('0x23')](respondWithResult(_0x223e90,null))[_0x285b('0x41')](handleError(_0x223e90,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 730d864..d94140d 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 _0xe8cb=['define','VtigerConfiguration','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xe8cb,0x142));var _0xbe8c=function(_0x228d23,_0x123b88){_0x228d23=_0x228d23-0x0;var _0x3981f5=_0xe8cb[_0x228d23];return _0x3981f5;};'use strict';var _=require('lodash');var util=require(_0xbe8c('0x0'));var logger=require(_0xbe8c('0x1'))(_0xbe8c('0x2'));var moment=require('moment');var BPromise=require(_0xbe8c('0x3'));var rp=require(_0xbe8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe8c('0x5'));var config=require(_0xbe8c('0x6'));var attributes=require(_0xbe8c('0x7'));module['exports']=function(_0x3c3bb0,_0x30f614){return _0x3c3bb0[_0xbe8c('0x8')](_0xbe8c('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1eb=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37c199,_0x5740c7){var _0x279b3b=function(_0xe16e78){while(--_0xe16e78){_0x37c199['push'](_0x37c199['shift']());}};_0x279b3b(++_0x5740c7);}(_0xd1eb,0x18d));var _0xbd1e=function(_0x2c51d8,_0x1c53c0){_0x2c51d8=_0x2c51d8-0x0;var _0x546e7b=_0xd1eb[_0x2c51d8];return _0x546e7b;};'use strict';var _=require(_0xbd1e('0x0'));var util=require(_0xbd1e('0x1'));var logger=require(_0xbd1e('0x2'))('api');var moment=require(_0xbd1e('0x3'));var BPromise=require(_0xbd1e('0x4'));var rp=require(_0xbd1e('0x5'));var fs=require('fs');var path=require(_0xbd1e('0x6'));var rimraf=require(_0xbd1e('0x7'));var config=require(_0xbd1e('0x8'));var attributes=require(_0xbd1e('0x9'));module[_0xbd1e('0xa')]=function(_0x2da33f,_0x3eb447){return _0x2da33f[_0xbd1e('0xb')](_0xbd1e('0xc'),attributes,{'tableName':_0xbd1e('0xd'),'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 f318f5d..746de6e 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 _0x1f1b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring'];(function(_0x415b82,_0x59b657){var _0x54d186=function(_0x3ed333){while(--_0x3ed333){_0x415b82['push'](_0x415b82['shift']());}};_0x54d186(++_0x59b657);}(_0x1f1b,0x1f1));var _0xb1f1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f1b[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xb1f1('0x0'));var moment=require(_0xb1f1('0x1'));var BPromise=require('bluebird');var rs=require(_0xb1f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb1f1('0x3'));var logger=require(_0xb1f1('0x4'))(_0xb1f1('0x5'));var config=require(_0xb1f1('0x6'));var jayson=require(_0xb1f1('0x7'));var client=jayson['client'][_0xb1f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c3911,_0x3ec7de,_0x1166da){return new BPromise(function(_0x3ed1ec,_0x187950){return client['request'](_0x3c3911,_0x1166da)[_0xb1f1('0x9')](function(_0x2f39ab){logger[_0xb1f1('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ec7de,_0xb1f1('0xb'));logger[_0xb1f1('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3ec7de,_0xb1f1('0xb'),JSON[_0xb1f1('0xd')](_0x2f39ab));if(_0x2f39ab[_0xb1f1('0xe')]){if(_0x2f39ab[_0xb1f1('0xe')][_0xb1f1('0xf')]===0x1f4){logger[_0xb1f1('0xe')](_0xb1f1('0x10'),_0x3ec7de,_0x2f39ab[_0xb1f1('0xe')]['message']);return _0x187950(_0x2f39ab['error'][_0xb1f1('0x11')]);}logger[_0xb1f1('0xe')](_0xb1f1('0x10'),_0x3ec7de,_0x2f39ab['error'][_0xb1f1('0x11')]);return _0x3ed1ec(_0x2f39ab[_0xb1f1('0xe')][_0xb1f1('0x11')]);}else{logger[_0xb1f1('0xa')](_0xb1f1('0x10'),_0x3ec7de,_0xb1f1('0xb'));_0x3ed1ec(_0x2f39ab[_0xb1f1('0x12')][_0xb1f1('0x11')]);}})[_0xb1f1('0x13')](function(_0x2eab26){logger['error'](_0xb1f1('0x10'),_0x3ec7de,_0x2eab26);_0x187950(_0x2eab26);});});} \ No newline at end of file +var _0x6406=['http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x329ba9,_0x14e4b4){var _0x5217e8=function(_0x1aae2b){while(--_0x1aae2b){_0x329ba9['push'](_0x329ba9['shift']());}};_0x5217e8(++_0x14e4b4);}(_0x6406,0x19a));var _0x6640=function(_0x568427,_0x742280){_0x568427=_0x568427-0x0;var _0x3c2f86=_0x6406[_0x568427];return _0x3c2f86;};'use strict';var _=require('lodash');var util=require(_0x6640('0x0'));var moment=require(_0x6640('0x1'));var BPromise=require(_0x6640('0x2'));var rs=require(_0x6640('0x3'));var fs=require('fs');var Redis=require(_0x6640('0x4'));var db=require(_0x6640('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6640('0x6'))(_0x6640('0x7'));var config=require(_0x6640('0x8'));var jayson=require(_0x6640('0x9'));var client=jayson['client'][_0x6640('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11f1da,_0x1cb404,_0x41cf89){return new BPromise(function(_0x1a9bc4,_0x42b9ab){return client['request'](_0x11f1da,_0x41cf89)[_0x6640('0xb')](function(_0xde4b71){logger[_0x6640('0xc')](_0x6640('0xd'),_0x1cb404,_0x6640('0xe'));logger[_0x6640('0xf')](_0x6640('0x10'),_0x1cb404,_0x6640('0xe'),JSON['stringify'](_0xde4b71));if(_0xde4b71[_0x6640('0x11')]){if(_0xde4b71[_0x6640('0x11')]['code']===0x1f4){logger['error'](_0x6640('0xd'),_0x1cb404,_0xde4b71[_0x6640('0x11')][_0x6640('0x12')]);return _0x42b9ab(_0xde4b71[_0x6640('0x11')]['message']);}logger[_0x6640('0x11')](_0x6640('0xd'),_0x1cb404,_0xde4b71['error'][_0x6640('0x12')]);return _0x1a9bc4(_0xde4b71['error'][_0x6640('0x12')]);}else{logger[_0x6640('0xc')](_0x6640('0xd'),_0x1cb404,_0x6640('0xe'));_0x1a9bc4(_0xde4b71[_0x6640('0x13')][_0x6640('0x12')]);}})[_0x6640('0x14')](function(_0x596d3d){logger[_0x6640('0x11')](_0x6640('0xd'),_0x1cb404,_0x596d3d);_0x42b9ab(_0x596d3d);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 278a2eb..0999ce3 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 _0xa8f3=['express','Router','../../components/interaction/service','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xa8f3,0x94));var _0x3a8f=function(_0x5f3f50,_0x24eb3e){_0x5f3f50=_0x5f3f50-0x0;var _0x11260e=_0xa8f3[_0x5f3f50];return _0x11260e;};'use strict';var multer=require(_0x3a8f('0x0'));var util=require(_0x3a8f('0x1'));var path=require(_0x3a8f('0x2'));var timeout=require(_0x3a8f('0x3'));var express=require(_0x3a8f('0x4'));var router=express[_0x3a8f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a8f('0x6'));var config=require('../../config/environment');var controller=require(_0x3a8f('0x7'));router[_0x3a8f('0x8')]('/',auth['isAuthenticated'](),controller[_0x3a8f('0x9')]);router['get'](_0x3a8f('0xa'),auth[_0x3a8f('0xb')](),controller[_0x3a8f('0xc')]);router[_0x3a8f('0xd')]('/',auth[_0x3a8f('0xb')](),controller[_0x3a8f('0xe')]);router[_0x3a8f('0xf')](_0x3a8f('0xa'),auth[_0x3a8f('0xb')](),controller['update']);router[_0x3a8f('0x10')](_0x3a8f('0xa'),auth['isAuthenticated'](),controller[_0x3a8f('0x11')]);module[_0x3a8f('0x12')]=router; \ No newline at end of file +var _0x8b01=['index','show','post','create','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x93e6a1,_0x11e83d){var _0x37a194=function(_0x40144b){while(--_0x40144b){_0x93e6a1['push'](_0x93e6a1['shift']());}};_0x37a194(++_0x11e83d);}(_0x8b01,0x116));var _0x18b0=function(_0x3ac634,_0x353e18){_0x3ac634=_0x3ac634-0x0;var _0x4efc55=_0x8b01[_0x3ac634];return _0x4efc55;};'use strict';var multer=require(_0x18b0('0x0'));var util=require('util');var path=require(_0x18b0('0x1'));var timeout=require(_0x18b0('0x2'));var express=require(_0x18b0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x18b0('0x4'));var interaction=require(_0x18b0('0x5'));var config=require(_0x18b0('0x6'));var controller=require(_0x18b0('0x7'));router[_0x18b0('0x8')]('/',auth[_0x18b0('0x9')](),controller[_0x18b0('0xa')]);router[_0x18b0('0x8')]('/:id',auth[_0x18b0('0x9')](),controller[_0x18b0('0xb')]);router[_0x18b0('0xc')]('/',auth[_0x18b0('0x9')](),controller[_0x18b0('0xd')]);router['put'](_0x18b0('0xe'),auth[_0x18b0('0x9')](),controller[_0x18b0('0xf')]);router['delete'](_0x18b0('0xe'),auth['isAuthenticated'](),controller[_0x18b0('0x10')]);module[_0x18b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 8372b19..f34339c 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 _0x6af6=['string','STRING','customVariable','sequelize','exports','ENUM','variable'];(function(_0x2f3d73,_0x2e35ac){var _0x2b5fb7=function(_0x427d46){while(--_0x427d46){_0x2f3d73['push'](_0x2f3d73['shift']());}};_0x2b5fb7(++_0x2e35ac);}(_0x6af6,0x14c));var _0x66af=function(_0x30a637,_0x481384){_0x30a637=_0x30a637-0x0;var _0x2565c3=_0x6af6[_0x30a637];return _0x2565c3;};'use strict';var Sequelize=require(_0x66af('0x0'));module[_0x66af('0x1')]={'type':{'type':Sequelize[_0x66af('0x2')]('string',_0x66af('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0x66af('0x4')},'content':{'type':Sequelize[_0x66af('0x5')]},'key':{'type':Sequelize[_0x66af('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66af('0x4'),_0x66af('0x3'),_0x66af('0x6'))},'keyContent':{'type':Sequelize[_0x66af('0x5')]},'idField':{'type':Sequelize[_0x66af('0x5')]},'nameField':{'type':Sequelize[_0x66af('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8afa=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','string'];(function(_0x2f4f25,_0x592d31){var _0x6a112a=function(_0x112d68){while(--_0x112d68){_0x2f4f25['push'](_0x2f4f25['shift']());}};_0x6a112a(++_0x592d31);}(_0x8afa,0x1a1));var _0xa8af=function(_0x318c43,_0x40ae1e){_0x318c43=_0x318c43-0x0;var _0xda449a=_0x8afa[_0x318c43];return _0xda449a;};'use strict';var Sequelize=require(_0xa8af('0x0'));module[_0xa8af('0x1')]={'type':{'type':Sequelize[_0xa8af('0x2')]('string',_0xa8af('0x3'),'customVariable',_0xa8af('0x4'),'picklist'),'defaultValue':_0xa8af('0x5')},'content':{'type':Sequelize[_0xa8af('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa8af('0x3'),_0xa8af('0x7'))},'keyContent':{'type':Sequelize[_0xa8af('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa8af('0x6')]},'customField':{'type':Sequelize[_0xa8af('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa8af('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index a3ac892..be5194c 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 _0x8988=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8988,0x1a6));var _0x8898=function(_0x5cf522,_0x1ee1f4){_0x5cf522=_0x5cf522-0x0;var _0x31295d=_0x8988[_0x5cf522];return _0x31295d;};'use strict';var emlformat=require(_0x8898('0x0'));var rimraf=require(_0x8898('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8898('0x2'));var moment=require(_0x8898('0x3'));var BPromise=require(_0x8898('0x4'));var Mustache=require('mustache');var util=require(_0x8898('0x5'));var path=require(_0x8898('0x6'));var sox=require('sox');var csv=require(_0x8898('0x7'));var ejs=require(_0x8898('0x8'));var fs=require('fs');var fs_extra=require(_0x8898('0x9'));var _=require(_0x8898('0xa'));var squel=require('squel');var crypto=require(_0x8898('0xb'));var jsforce=require(_0x8898('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8898('0x7'));var querystring=require(_0x8898('0xd'));var Papa=require(_0x8898('0xe'));var Redis=require(_0x8898('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8898('0x10'));var as=require(_0x8898('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8898('0x12'))(_0x8898('0x13'));var utils=require(_0x8898('0x14'));var config=require(_0x8898('0x15'));var licenseUtil=require(_0x8898('0x16'));var db=require(_0x8898('0x17'))['db'];function respondWithStatusCode(_0x3e8a24,_0x35401f){_0x35401f=_0x35401f||0xcc;return function(_0x25853e){if(_0x25853e){return _0x3e8a24[_0x8898('0x18')](_0x35401f);}return _0x3e8a24[_0x8898('0x19')](_0x35401f)[_0x8898('0x1a')]();};}function respondWithResult(_0x80a7a5,_0x2beca3){_0x2beca3=_0x2beca3||0xc8;return function(_0x5a163f){if(_0x5a163f){return _0x80a7a5[_0x8898('0x19')](_0x2beca3)[_0x8898('0x1b')](_0x5a163f);}};}function respondWithFilteredResult(_0xcc9ebd,_0x5b55ec){return function(_0x30a4db){if(_0x30a4db){var _0x598252=typeof _0x5b55ec['offset']==='undefined'&&typeof _0x5b55ec[_0x8898('0x1c')]===_0x8898('0x1d');var _0x32db89=_0x30a4db[_0x8898('0x1e')];var _0x1c8ceb=_0x598252?0x0:_0x5b55ec[_0x8898('0x1f')];var _0x47f565=_0x598252?_0x30a4db[_0x8898('0x1e')]:_0x5b55ec[_0x8898('0x1f')]+_0x5b55ec[_0x8898('0x1c')];var _0x2e252e;if(_0x47f565>=_0x32db89){_0x47f565=_0x32db89;_0x2e252e=0xc8;}else{_0x2e252e=0xce;}_0xcc9ebd[_0x8898('0x19')](_0x2e252e);return _0xcc9ebd[_0x8898('0x20')](_0x8898('0x21'),_0x1c8ceb+'-'+_0x47f565+'/'+_0x32db89)[_0x8898('0x1b')](_0x30a4db);}return null;};}function patchUpdates(_0x4df319){return function(_0x1d9fae){try{jsonpatch[_0x8898('0x22')](_0x1d9fae,_0x4df319,!![]);}catch(_0x2dc662){return BPromise[_0x8898('0x23')](_0x2dc662);}return _0x1d9fae[_0x8898('0x24')]();};}function saveUpdates(_0xf4841,_0x48acd2){return function(_0x24f91d){if(_0x24f91d){return _0x24f91d[_0x8898('0x25')](_0xf4841)[_0x8898('0x26')](function(_0x5be618){return _0x5be618;});}return null;};}function removeEntity(_0x23d4c6,_0x1248af){return function(_0x2f5735){if(_0x2f5735){return _0x2f5735[_0x8898('0x27')]()[_0x8898('0x26')](function(){_0x23d4c6[_0x8898('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ebf9,_0x2a36ca){return function(_0x4fd5d3){if(!_0x4fd5d3){_0x33ebf9[_0x8898('0x18')](0x194);}return _0x4fd5d3;};}function handleError(_0x14dff4,_0xd5ae5e){_0xd5ae5e=_0xd5ae5e||0x1f4;return function(_0x6805a5){logger['error'](_0x6805a5['stack']);if(_0x6805a5[_0x8898('0x28')]){delete _0x6805a5[_0x8898('0x28')];}_0x14dff4[_0x8898('0x19')](_0xd5ae5e)[_0x8898('0x29')](_0x6805a5);};}exports['index']=function(_0x12b641,_0x37910e){var _0x27298d={},_0x5862f3={},_0x20ed12={'count':0x0,'rows':[]};var _0x18b1a3=_[_0x8898('0x2a')](db[_0x8898('0x2b')][_0x8898('0x2c')],function(_0x29db0f){return{'name':_0x29db0f[_0x8898('0x2d')],'type':_0x29db0f[_0x8898('0x2e')]['key']};});_0x5862f3[_0x8898('0x2f')]=_['map'](_0x18b1a3,'name');_0x5862f3[_0x8898('0x30')]=_[_0x8898('0x31')](_0x12b641[_0x8898('0x30')]);_0x5862f3[_0x8898('0x32')]=_[_0x8898('0x33')](_0x5862f3[_0x8898('0x2f')],_0x5862f3[_0x8898('0x30')]);_0x27298d[_0x8898('0x34')]=_[_0x8898('0x33')](_0x5862f3[_0x8898('0x2f')],qs[_0x8898('0x35')](_0x12b641[_0x8898('0x30')][_0x8898('0x35')]));_0x27298d[_0x8898('0x34')]=_0x27298d[_0x8898('0x34')][_0x8898('0x36')]?_0x27298d[_0x8898('0x34')]:_0x5862f3[_0x8898('0x2f')];if(!_0x12b641[_0x8898('0x30')]['hasOwnProperty'](_0x8898('0x37'))){_0x27298d[_0x8898('0x1c')]=qs['limit'](_0x12b641[_0x8898('0x30')][_0x8898('0x1c')]);_0x27298d[_0x8898('0x1f')]=qs['offset'](_0x12b641['query']['offset']);}_0x27298d[_0x8898('0x38')]=qs[_0x8898('0x39')](_0x12b641[_0x8898('0x30')][_0x8898('0x39')]);_0x27298d[_0x8898('0x3a')]=qs['filters'](_[_0x8898('0x3b')](_0x12b641[_0x8898('0x30')],_0x5862f3['filters']),_0x18b1a3);if(_0x12b641[_0x8898('0x30')][_0x8898('0x3c')]){_0x27298d[_0x8898('0x3a')]=_[_0x8898('0x3d')](_0x27298d[_0x8898('0x3a')],{'$or':_[_0x8898('0x2a')](_0x18b1a3,function(_0x1cc62a){if(_0x1cc62a['type']!==_0x8898('0x3e')){var _0x4f3b16={};_0x4f3b16[_0x1cc62a['name']]={'$like':'%'+_0x12b641[_0x8898('0x30')][_0x8898('0x3c')]+'%'};return _0x4f3b16;}})});}_0x27298d=_[_0x8898('0x3d')]({},_0x27298d,_0x12b641[_0x8898('0x3f')]);var _0x58b941={'where':_0x27298d[_0x8898('0x3a')]};return db[_0x8898('0x2b')][_0x8898('0x1e')](_0x58b941)[_0x8898('0x26')](function(_0x5e3780){_0x20ed12[_0x8898('0x1e')]=_0x5e3780;if(_0x12b641['query']['includeAll']){_0x27298d[_0x8898('0x40')]=[{'all':!![]}];}return db[_0x8898('0x2b')][_0x8898('0x41')](_0x27298d);})[_0x8898('0x26')](function(_0x707cc7){_0x20ed12[_0x8898('0x42')]=_0x707cc7;return _0x20ed12;})['then'](respondWithFilteredResult(_0x37910e,_0x27298d))[_0x8898('0x43')](handleError(_0x37910e,null));};exports[_0x8898('0x44')]=function(_0x48e120,_0x1515d7){var _0x4e9e5f={'raw':!![],'where':{'id':_0x48e120['params']['id']}},_0xb7115c={};_0xb7115c[_0x8898('0x2f')]=_['keys'](db[_0x8898('0x2b')]['rawAttributes']);_0xb7115c['query']=_['keys'](_0x48e120['query']);_0xb7115c[_0x8898('0x32')]=_[_0x8898('0x33')](_0xb7115c['model'],_0xb7115c['query']);_0x4e9e5f[_0x8898('0x34')]=_['intersection'](_0xb7115c[_0x8898('0x2f')],qs[_0x8898('0x35')](_0x48e120[_0x8898('0x30')]['fields']));_0x4e9e5f[_0x8898('0x34')]=_0x4e9e5f[_0x8898('0x34')][_0x8898('0x36')]?_0x4e9e5f['attributes']:_0xb7115c['model'];if(_0x48e120[_0x8898('0x30')][_0x8898('0x45')]){_0x4e9e5f[_0x8898('0x40')]=[{'all':!![]}];}_0x4e9e5f=_[_0x8898('0x3d')]({},_0x4e9e5f,_0x48e120['options']);return db[_0x8898('0x2b')]['find'](_0x4e9e5f)[_0x8898('0x26')](handleEntityNotFound(_0x1515d7,null))[_0x8898('0x26')](respondWithResult(_0x1515d7,null))[_0x8898('0x43')](handleError(_0x1515d7,null));};exports[_0x8898('0x46')]=function(_0xc74fc6,_0x519a2f){return db['VtigerField'][_0x8898('0x46')](_0xc74fc6['body'],{})[_0x8898('0x26')](respondWithResult(_0x519a2f,0xc9))[_0x8898('0x43')](handleError(_0x519a2f,null));};exports[_0x8898('0x25')]=function(_0x1c3ed2,_0x508e16){if(_0x1c3ed2[_0x8898('0x47')]['id']){delete _0x1c3ed2[_0x8898('0x47')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x1c3ed2[_0x8898('0x48')]['id']}})['then'](handleEntityNotFound(_0x508e16,null))[_0x8898('0x26')](saveUpdates(_0x1c3ed2['body'],null))[_0x8898('0x26')](respondWithResult(_0x508e16,null))[_0x8898('0x43')](handleError(_0x508e16,null));};exports[_0x8898('0x27')]=function(_0x52a235,_0x1f0068){return db['VtigerField'][_0x8898('0x49')]({'where':{'id':_0x52a235['params']['id']}})[_0x8898('0x26')](handleEntityNotFound(_0x1f0068,null))[_0x8898('0x26')](removeEntity(_0x1f0068,null))[_0x8898('0x43')](handleError(_0x1f0068,null));}; \ No newline at end of file +var _0xc0d9=['path','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','end','error','stack','name','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4f5dfd,_0x39ea52){var _0x315d44=function(_0x3056f6){while(--_0x3056f6){_0x4f5dfd['push'](_0x4f5dfd['shift']());}};_0x315d44(++_0x39ea52);}(_0xc0d9,0x123));var _0x9c0d=function(_0x5c3b49,_0x3fd746){_0x5c3b49=_0x5c3b49-0x0;var _0x1e2dfa=_0xc0d9[_0x5c3b49];return _0x1e2dfa;};'use strict';var emlformat=require(_0x9c0d('0x0'));var rimraf=require(_0x9c0d('0x1'));var zipdir=require(_0x9c0d('0x2'));var jsonpatch=require(_0x9c0d('0x3'));var rp=require(_0x9c0d('0x4'));var moment=require(_0x9c0d('0x5'));var BPromise=require(_0x9c0d('0x6'));var Mustache=require(_0x9c0d('0x7'));var util=require(_0x9c0d('0x8'));var path=require(_0x9c0d('0x9'));var sox=require('sox');var csv=require(_0x9c0d('0xa'));var ejs=require(_0x9c0d('0xb'));var fs=require('fs');var fs_extra=require(_0x9c0d('0xc'));var _=require(_0x9c0d('0xd'));var squel=require(_0x9c0d('0xe'));var crypto=require(_0x9c0d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9c0d('0x10'));var toCsv=require(_0x9c0d('0xa'));var querystring=require('querystring');var Papa=require(_0x9c0d('0x11'));var Redis=require(_0x9c0d('0x12'));var authService=require(_0x9c0d('0x13'));var qs=require(_0x9c0d('0x14'));var as=require(_0x9c0d('0x15'));var hardwareService=require(_0x9c0d('0x16'));var logger=require(_0x9c0d('0x17'))(_0x9c0d('0x18'));var utils=require(_0x9c0d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9c0d('0x1a'));var db=require(_0x9c0d('0x1b'))['db'];function respondWithStatusCode(_0x35d6be,_0x202c68){_0x202c68=_0x202c68||0xcc;return function(_0x2ca7af){if(_0x2ca7af){return _0x35d6be[_0x9c0d('0x1c')](_0x202c68);}return _0x35d6be['status'](_0x202c68)['end']();};}function respondWithResult(_0x544069,_0x3c1fde){_0x3c1fde=_0x3c1fde||0xc8;return function(_0xf8fa90){if(_0xf8fa90){return _0x544069[_0x9c0d('0x1d')](_0x3c1fde)[_0x9c0d('0x1e')](_0xf8fa90);}};}function respondWithFilteredResult(_0x2a7062,_0x303777){return function(_0x48f6c1){if(_0x48f6c1){var _0x1ea224=typeof _0x303777[_0x9c0d('0x1f')]===_0x9c0d('0x20')&&typeof _0x303777['limit']===_0x9c0d('0x20');var _0x172162=_0x48f6c1[_0x9c0d('0x21')];var _0x2be453=_0x1ea224?0x0:_0x303777[_0x9c0d('0x1f')];var _0x1f1d0a=_0x1ea224?_0x48f6c1[_0x9c0d('0x21')]:_0x303777[_0x9c0d('0x1f')]+_0x303777[_0x9c0d('0x22')];var _0x2383e8;if(_0x1f1d0a>=_0x172162){_0x1f1d0a=_0x172162;_0x2383e8=0xc8;}else{_0x2383e8=0xce;}_0x2a7062[_0x9c0d('0x1d')](_0x2383e8);return _0x2a7062[_0x9c0d('0x23')]('Content-Range',_0x2be453+'-'+_0x1f1d0a+'/'+_0x172162)[_0x9c0d('0x1e')](_0x48f6c1);}return null;};}function patchUpdates(_0x52610c){return function(_0x574bc8){try{jsonpatch['apply'](_0x574bc8,_0x52610c,!![]);}catch(_0x4ce60a){return BPromise[_0x9c0d('0x24')](_0x4ce60a);}return _0x574bc8[_0x9c0d('0x25')]();};}function saveUpdates(_0x2a21f7,_0x452039){return function(_0x4ea1ea){if(_0x4ea1ea){return _0x4ea1ea[_0x9c0d('0x26')](_0x2a21f7)['then'](function(_0x4baa51){return _0x4baa51;});}return null;};}function removeEntity(_0xafc4e,_0x102575){return function(_0x18cf36){if(_0x18cf36){return _0x18cf36[_0x9c0d('0x27')]()[_0x9c0d('0x28')](function(){_0xafc4e[_0x9c0d('0x1d')](0xcc)[_0x9c0d('0x29')]();});}};}function handleEntityNotFound(_0x576879,_0x33245b){return function(_0x31c1b8){if(!_0x31c1b8){_0x576879['sendStatus'](0x194);}return _0x31c1b8;};}function handleError(_0x4ebceb,_0x4e6194){_0x4e6194=_0x4e6194||0x1f4;return function(_0x42482f){logger[_0x9c0d('0x2a')](_0x42482f[_0x9c0d('0x2b')]);if(_0x42482f['name']){delete _0x42482f[_0x9c0d('0x2c')];}_0x4ebceb[_0x9c0d('0x1d')](_0x4e6194)['send'](_0x42482f);};}exports['index']=function(_0xc7daca,_0x324e23){var _0x5c4d14={},_0x4f7327={},_0x64c4f0={'count':0x0,'rows':[]};var _0x192e7e=_[_0x9c0d('0x2d')](db[_0x9c0d('0x2e')][_0x9c0d('0x2f')],function(_0x54d501){return{'name':_0x54d501[_0x9c0d('0x30')],'type':_0x54d501[_0x9c0d('0x31')][_0x9c0d('0x32')]};});_0x4f7327['model']=_[_0x9c0d('0x2d')](_0x192e7e,_0x9c0d('0x2c'));_0x4f7327[_0x9c0d('0x33')]=_[_0x9c0d('0x34')](_0xc7daca[_0x9c0d('0x33')]);_0x4f7327[_0x9c0d('0x35')]=_[_0x9c0d('0x36')](_0x4f7327['model'],_0x4f7327['query']);_0x5c4d14['attributes']=_['intersection'](_0x4f7327[_0x9c0d('0x37')],qs[_0x9c0d('0x38')](_0xc7daca[_0x9c0d('0x33')]['fields']));_0x5c4d14['attributes']=_0x5c4d14[_0x9c0d('0x39')][_0x9c0d('0x3a')]?_0x5c4d14['attributes']:_0x4f7327[_0x9c0d('0x37')];if(!_0xc7daca[_0x9c0d('0x33')]['hasOwnProperty'](_0x9c0d('0x3b'))){_0x5c4d14[_0x9c0d('0x22')]=qs[_0x9c0d('0x22')](_0xc7daca['query'][_0x9c0d('0x22')]);_0x5c4d14[_0x9c0d('0x1f')]=qs[_0x9c0d('0x1f')](_0xc7daca[_0x9c0d('0x33')][_0x9c0d('0x1f')]);}_0x5c4d14['order']=qs[_0x9c0d('0x3c')](_0xc7daca[_0x9c0d('0x33')][_0x9c0d('0x3c')]);_0x5c4d14[_0x9c0d('0x3d')]=qs[_0x9c0d('0x35')](_['pick'](_0xc7daca['query'],_0x4f7327[_0x9c0d('0x35')]),_0x192e7e);if(_0xc7daca[_0x9c0d('0x33')][_0x9c0d('0x3e')]){_0x5c4d14[_0x9c0d('0x3d')]=_[_0x9c0d('0x3f')](_0x5c4d14[_0x9c0d('0x3d')],{'$or':_[_0x9c0d('0x2d')](_0x192e7e,function(_0x59e99c){if(_0x59e99c[_0x9c0d('0x31')]!==_0x9c0d('0x40')){var _0x2965c3={};_0x2965c3[_0x59e99c[_0x9c0d('0x2c')]]={'$like':'%'+_0xc7daca['query'][_0x9c0d('0x3e')]+'%'};return _0x2965c3;}})});}_0x5c4d14=_['merge']({},_0x5c4d14,_0xc7daca[_0x9c0d('0x41')]);var _0x2dc99d={'where':_0x5c4d14[_0x9c0d('0x3d')]};return db[_0x9c0d('0x2e')][_0x9c0d('0x21')](_0x2dc99d)[_0x9c0d('0x28')](function(_0x1a69af){_0x64c4f0[_0x9c0d('0x21')]=_0x1a69af;if(_0xc7daca[_0x9c0d('0x33')]['includeAll']){_0x5c4d14[_0x9c0d('0x42')]=[{'all':!![]}];}return db[_0x9c0d('0x2e')][_0x9c0d('0x43')](_0x5c4d14);})['then'](function(_0x3edde3){_0x64c4f0[_0x9c0d('0x44')]=_0x3edde3;return _0x64c4f0;})[_0x9c0d('0x28')](respondWithFilteredResult(_0x324e23,_0x5c4d14))[_0x9c0d('0x45')](handleError(_0x324e23,null));};exports['show']=function(_0x549537,_0x262a67){var _0x4779ce={'raw':!![],'where':{'id':_0x549537[_0x9c0d('0x46')]['id']}},_0x2eec52={};_0x2eec52[_0x9c0d('0x37')]=_['keys'](db[_0x9c0d('0x2e')][_0x9c0d('0x2f')]);_0x2eec52['query']=_[_0x9c0d('0x34')](_0x549537[_0x9c0d('0x33')]);_0x2eec52[_0x9c0d('0x35')]=_[_0x9c0d('0x36')](_0x2eec52[_0x9c0d('0x37')],_0x2eec52['query']);_0x4779ce['attributes']=_['intersection'](_0x2eec52[_0x9c0d('0x37')],qs['fields'](_0x549537['query']['fields']));_0x4779ce[_0x9c0d('0x39')]=_0x4779ce[_0x9c0d('0x39')][_0x9c0d('0x3a')]?_0x4779ce[_0x9c0d('0x39')]:_0x2eec52[_0x9c0d('0x37')];if(_0x549537[_0x9c0d('0x33')][_0x9c0d('0x47')]){_0x4779ce[_0x9c0d('0x42')]=[{'all':!![]}];}_0x4779ce=_['merge']({},_0x4779ce,_0x549537['options']);return db[_0x9c0d('0x2e')][_0x9c0d('0x48')](_0x4779ce)[_0x9c0d('0x28')](handleEntityNotFound(_0x262a67,null))[_0x9c0d('0x28')](respondWithResult(_0x262a67,null))[_0x9c0d('0x45')](handleError(_0x262a67,null));};exports[_0x9c0d('0x49')]=function(_0x443f3a,_0x147a8f){return db[_0x9c0d('0x2e')][_0x9c0d('0x49')](_0x443f3a[_0x9c0d('0x4a')],{})['then'](respondWithResult(_0x147a8f,0xc9))[_0x9c0d('0x45')](handleError(_0x147a8f,null));};exports['update']=function(_0x4eb794,_0xe8bc26){if(_0x4eb794[_0x9c0d('0x4a')]['id']){delete _0x4eb794['body']['id'];}return db[_0x9c0d('0x2e')][_0x9c0d('0x48')]({'where':{'id':_0x4eb794[_0x9c0d('0x46')]['id']}})[_0x9c0d('0x28')](handleEntityNotFound(_0xe8bc26,null))['then'](saveUpdates(_0x4eb794[_0x9c0d('0x4a')],null))['then'](respondWithResult(_0xe8bc26,null))['catch'](handleError(_0xe8bc26,null));};exports[_0x9c0d('0x27')]=function(_0x33d909,_0x5e6fcb){return db['VtigerField']['find']({'where':{'id':_0x33d909[_0x9c0d('0x46')]['id']}})[_0x9c0d('0x28')](handleEntityNotFound(_0x5e6fcb,null))['then'](removeEntity(_0x5e6fcb,null))[_0x9c0d('0x45')](handleError(_0x5e6fcb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 77240c3..62eedda 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 _0x8f0f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','idField','FieldId','../../config/logger','api'];(function(_0x1e47b6,_0x800189){var _0x2039cc=function(_0x7aa01d){while(--_0x7aa01d){_0x1e47b6['push'](_0x1e47b6['shift']());}};_0x2039cc(++_0x800189);}(_0x8f0f,0x15d));var _0xf8f0=function(_0x917b7c,_0x38b46f){_0x917b7c=_0x917b7c-0x0;var _0xa04ca4=_0x8f0f[_0x917b7c];return _0xa04ca4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf8f0('0x0'))(_0xf8f0('0x1'));var moment=require(_0xf8f0('0x2'));var BPromise=require(_0xf8f0('0x3'));var rp=require(_0xf8f0('0x4'));var fs=require('fs');var path=require(_0xf8f0('0x5'));var rimraf=require(_0xf8f0('0x6'));var config=require(_0xf8f0('0x7'));var attributes=require(_0xf8f0('0x8'));module[_0xf8f0('0x9')]=function(_0x2afcc6,_0x125b8b){return _0x2afcc6[_0xf8f0('0xa')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xf8f0('0xb'),_0xf8f0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a0=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd4a0,0x1bb));var _0x0d4a=function(_0x35bf99,_0x15a389){_0x35bf99=_0x35bf99-0x0;var _0x205da0=_0xd4a0[_0x35bf99];return _0x205da0;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var logger=require(_0x0d4a('0x2'))(_0x0d4a('0x3'));var moment=require(_0x0d4a('0x4'));var BPromise=require(_0x0d4a('0x5'));var rp=require(_0x0d4a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d4a('0x7'));var config=require(_0x0d4a('0x8'));var attributes=require(_0x0d4a('0x9'));module[_0x0d4a('0xa')]=function(_0x250450,_0x4d9cf8){return _0x250450[_0x0d4a('0xb')](_0x0d4a('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x0d4a('0xd'),'fields':['idField',_0x0d4a('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 e5d2de0..ea53aec 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 _0xcda6=['info','result','catch','lodash','bluebird','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcda6,0x18a));var _0x6cda=function(_0x3377bc,_0x40699c){_0x3377bc=_0x3377bc-0x0;var _0x966ef7=_0xcda6[_0x3377bc];return _0x966ef7;};'use strict';var _=require(_0x6cda('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6cda('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6cda('0x2'));var config=require(_0x6cda('0x3'));var jayson=require(_0x6cda('0x4'));var client=jayson[_0x6cda('0x5')][_0x6cda('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa72ef0,_0x2f0074,_0x5e1e07){return new BPromise(function(_0x37c7ee,_0x3cc7b2){return client[_0x6cda('0x7')](_0xa72ef0,_0x5e1e07)[_0x6cda('0x8')](function(_0x229f8b){logger['info'](_0x6cda('0x9'),_0x2f0074,_0x6cda('0xa'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x2f0074,_0x6cda('0xa'),JSON['stringify'](_0x229f8b));if(_0x229f8b[_0x6cda('0xb')]){if(_0x229f8b[_0x6cda('0xb')][_0x6cda('0xc')]===0x1f4){logger[_0x6cda('0xb')]('VtigerField,\x20%s,\x20%s',_0x2f0074,_0x229f8b[_0x6cda('0xb')][_0x6cda('0xd')]);return _0x3cc7b2(_0x229f8b['error'][_0x6cda('0xd')]);}logger['error'](_0x6cda('0x9'),_0x2f0074,_0x229f8b[_0x6cda('0xb')]['message']);return _0x37c7ee(_0x229f8b[_0x6cda('0xb')][_0x6cda('0xd')]);}else{logger[_0x6cda('0xe')](_0x6cda('0x9'),_0x2f0074,'request\x20sent');_0x37c7ee(_0x229f8b[_0x6cda('0xf')][_0x6cda('0xd')]);}})[_0x6cda('0x10')](function(_0xf84b40){logger[_0x6cda('0xb')](_0x6cda('0x9'),_0x2f0074,_0xf84b40);_0x3cc7b2(_0xf84b40);});});} \ No newline at end of file +var _0x4843=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','error','message','info'];(function(_0x4b7391,_0x586f07){var _0x581212=function(_0x4e92c0){while(--_0x4e92c0){_0x4b7391['push'](_0x4b7391['shift']());}};_0x581212(++_0x586f07);}(_0x4843,0x12d));var _0x3484=function(_0x36a951,_0x1d62d){_0x36a951=_0x36a951-0x0;var _0x4964e7=_0x4843[_0x36a951];return _0x4964e7;};'use strict';var _=require(_0x3484('0x0'));var util=require(_0x3484('0x1'));var moment=require('moment');var BPromise=require(_0x3484('0x2'));var rs=require(_0x3484('0x3'));var fs=require('fs');var Redis=require(_0x3484('0x4'));var db=require(_0x3484('0x5'))['db'];var utils=require(_0x3484('0x6'));var logger=require(_0x3484('0x7'))('rpc');var config=require(_0x3484('0x8'));var jayson=require(_0x3484('0x9'));var client=jayson[_0x3484('0xa')][_0x3484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ea1f1,_0x16178e,_0x214dc6){return new BPromise(function(_0x32d339,_0x505d90){return client[_0x3484('0xc')](_0x4ea1f1,_0x214dc6)[_0x3484('0xd')](function(_0x69540f){logger['info'](_0x3484('0xe'),_0x16178e,'request\x20sent');logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x16178e,_0x3484('0xf'),JSON['stringify'](_0x69540f));if(_0x69540f[_0x3484('0x10')]){if(_0x69540f[_0x3484('0x10')]['code']===0x1f4){logger[_0x3484('0x10')]('VtigerField,\x20%s,\x20%s',_0x16178e,_0x69540f['error'][_0x3484('0x11')]);return _0x505d90(_0x69540f[_0x3484('0x10')][_0x3484('0x11')]);}logger['error'](_0x3484('0xe'),_0x16178e,_0x69540f[_0x3484('0x10')][_0x3484('0x11')]);return _0x32d339(_0x69540f['error'][_0x3484('0x11')]);}else{logger[_0x3484('0x12')](_0x3484('0xe'),_0x16178e,'request\x20sent');_0x32d339(_0x69540f[_0x3484('0x13')][_0x3484('0x11')]);}})['catch'](function(_0x4c3649){logger[_0x3484('0x10')](_0x3484('0xe'),_0x16178e,_0x4c3649);_0x505d90(_0x4c3649);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 2667ef8..887a621 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 _0xc25d=['post','/:id/configurations','addConfiguration','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getFields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc25d,0x1ec));var _0xdc25=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0xc25d[_0x38854e];return _0x3f8415;};'use strict';var multer=require(_0xdc25('0x0'));var util=require(_0xdc25('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc25('0x2'));var router=express['Router']();var fs_extra=require(_0xdc25('0x3'));var auth=require(_0xdc25('0x4'));var interaction=require(_0xdc25('0x5'));var config=require(_0xdc25('0x6'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0xdc25('0x7')](),controller['index']);router[_0xdc25('0x8')](_0xdc25('0x9'),auth[_0xdc25('0x7')](),controller[_0xdc25('0xa')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xdc25('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdc25('0xb')]);router[_0xdc25('0xc')]('/',auth[_0xdc25('0x7')](),controller['create']);router[_0xdc25('0xc')](_0xdc25('0xd'),auth[_0xdc25('0x7')](),controller[_0xdc25('0xe')]);router['put']('/:id',auth[_0xdc25('0x7')](),controller[_0xdc25('0xf')]);router[_0xdc25('0x10')](_0xdc25('0x9'),auth[_0xdc25('0x7')](),controller[_0xdc25('0x11')]);module['exports']=router; \ No newline at end of file +var _0x15b5=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','delete','destroy','exports','multer','fs-extra','../../components/auth/service'];(function(_0x15c93b,_0x52f50f){var _0x544bba=function(_0x40fcb7){while(--_0x40fcb7){_0x15c93b['push'](_0x15c93b['shift']());}};_0x544bba(++_0x52f50f);}(_0x15b5,0x1bf));var _0x515b=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x15b5[_0x31c19c];return _0x1a87f7;};'use strict';var multer=require(_0x515b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x515b('0x1'));var auth=require(_0x515b('0x2'));var interaction=require(_0x515b('0x3'));var config=require(_0x515b('0x4'));var controller=require(_0x515b('0x5'));router[_0x515b('0x6')]('/',auth[_0x515b('0x7')](),controller[_0x515b('0x8')]);router['get'](_0x515b('0x9'),auth[_0x515b('0x7')](),controller['show']);router[_0x515b('0x6')](_0x515b('0xa'),auth[_0x515b('0x7')](),controller['getConfigurations']);router[_0x515b('0x6')](_0x515b('0xb'),auth[_0x515b('0x7')](),controller['getFields']);router[_0x515b('0xc')]('/',auth['isAuthenticated'](),controller[_0x515b('0xd')]);router[_0x515b('0xc')](_0x515b('0xa'),auth[_0x515b('0x7')](),controller[_0x515b('0xe')]);router['put'](_0x515b('0x9'),auth[_0x515b('0x7')](),controller['update']);router[_0x515b('0xf')](_0x515b('0x9'),auth[_0x515b('0x7')](),controller[_0x515b('0x10')]);module[_0x515b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 4f0dc96..4606c4e 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 _0x96fd=['newTab','exports','STRING','remoteUri','password','token','ENUM','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96fd,0x1e9));var _0xd96f=function(_0x520e84,_0x2900cd){_0x520e84=_0x520e84-0x0;var _0x5cc5c3=_0x96fd[_0x520e84];return _0x5cc5c3;};'use strict';var Sequelize=require('sequelize');module[_0xd96f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd96f('0x1')]},'username':{'type':Sequelize[_0xd96f('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd96f('0x1')]},'token':{'type':Sequelize[_0xd96f('0x1')]},'remoteUri':{'type':Sequelize[_0xd96f('0x1')],'unique':_0xd96f('0x2')},'authType':{'type':Sequelize['ENUM'](_0xd96f('0x3'),_0xd96f('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xd96f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd96f('0x5')](_0xd96f('0x6'),_0xd96f('0x7')),'defaultValue':_0xd96f('0x6')}}; \ No newline at end of file +var _0x7b84=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x7b84,0x17c));var _0x47b8=function(_0x42e338,_0x3e36a0){_0x42e338=_0x42e338-0x0;var _0x6770d3=_0x7b84[_0x42e338];return _0x6770d3;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')]},'description':{'type':Sequelize[_0x47b8('0x2')]},'username':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x3')},'password':{'type':Sequelize[_0x47b8('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x4')},'authType':{'type':Sequelize[_0x47b8('0x5')](_0x47b8('0x6'),_0x47b8('0x7')),'defaultValue':_0x47b8('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x47b8('0x5')](_0x47b8('0x8'),_0x47b8('0x9')),'defaultValue':_0x47b8('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 89dac59..07db731 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 _0x878f=['username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','headers','%s/token:%s','base64','Sequelize','ValidationError','subject','description','group','assignee','includes','position','title','system_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','error','name','send','index','ZendeskAccount','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x878f,0x173));var _0xf878=function(_0x30e7aa,_0x2997de){_0x30e7aa=_0x30e7aa-0x0;var _0x16f7cd=_0x878f[_0x30e7aa];return _0x16f7cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];var integrations=require(_0xf878('0x15'));function respondWithStatusCode(_0x596fb5,_0x1ce004){_0x1ce004=_0x1ce004||0xcc;return function(_0x38eddf){if(_0x38eddf){return _0x596fb5[_0xf878('0x16')](_0x1ce004);}return _0x596fb5['status'](_0x1ce004)[_0xf878('0x17')]();};}function respondWithResult(_0x3902f7,_0x119e9e){_0x119e9e=_0x119e9e||0xc8;return function(_0x492260){if(_0x492260){return _0x3902f7['status'](_0x119e9e)[_0xf878('0x18')](_0x492260);}};}function respondWithFilteredResult(_0x35ff2d,_0x31d888){return function(_0x6dbeca){if(_0x6dbeca){var _0x44aacc=typeof _0x31d888[_0xf878('0x19')]===_0xf878('0x1a')&&typeof _0x31d888[_0xf878('0x1b')]===_0xf878('0x1a');var _0x3a55f3=_0x6dbeca[_0xf878('0x1c')];var _0x47a91a=_0x44aacc?0x0:_0x31d888[_0xf878('0x19')];var _0x34ae59=_0x44aacc?_0x6dbeca[_0xf878('0x1c')]:_0x31d888[_0xf878('0x19')]+_0x31d888[_0xf878('0x1b')];var _0x237d15;if(_0x34ae59>=_0x3a55f3){_0x34ae59=_0x3a55f3;_0x237d15=0xc8;}else{_0x237d15=0xce;}_0x35ff2d[_0xf878('0x1d')](_0x237d15);return _0x35ff2d['set'](_0xf878('0x1e'),_0x47a91a+'-'+_0x34ae59+'/'+_0x3a55f3)[_0xf878('0x18')](_0x6dbeca);}return null;};}function patchUpdates(_0x250f85){return function(_0x59efcb){try{jsonpatch[_0xf878('0x1f')](_0x59efcb,_0x250f85,!![]);}catch(_0x23590c){return BPromise[_0xf878('0x20')](_0x23590c);}return _0x59efcb[_0xf878('0x21')]();};}function saveUpdates(_0x22d884,_0x442450){return function(_0x1cbc92){if(_0x1cbc92){return _0x1cbc92[_0xf878('0x22')](_0x22d884)[_0xf878('0x23')](function(_0x1a6506){return _0x1a6506;});}return null;};}function removeEntity(_0x45e61f,_0x566995){return function(_0x2ac38b){if(_0x2ac38b){return _0x2ac38b['destroy']()[_0xf878('0x23')](function(){_0x45e61f[_0xf878('0x1d')](0xcc)[_0xf878('0x17')]();});}};}function handleEntityNotFound(_0x280036,_0x20449e){return function(_0x5ebaa0){if(!_0x5ebaa0){_0x280036['sendStatus'](0x194);}return _0x5ebaa0;};}function handleError(_0x59ba7b,_0x242926){_0x242926=_0x242926||0x1f4;return function(_0x3baba4){logger[_0xf878('0x24')](_0x3baba4['stack']);if(_0x3baba4[_0xf878('0x25')]){delete _0x3baba4[_0xf878('0x25')];}_0x59ba7b[_0xf878('0x1d')](_0x242926)[_0xf878('0x26')](_0x3baba4);};}exports[_0xf878('0x27')]=function(_0x5aff46,_0x502322){var _0x9a127d={},_0x5d9c97={},_0x4a0286={'count':0x0,'rows':[]};var _0x31e2e1=_['map'](db[_0xf878('0x28')]['rawAttributes'],function(_0x2c61c1){return{'name':_0x2c61c1['fieldName'],'type':_0x2c61c1[_0xf878('0x29')]['key']};});_0x5d9c97[_0xf878('0x2a')]=_[_0xf878('0x2b')](_0x31e2e1,_0xf878('0x25'));_0x5d9c97[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x5aff46[_0xf878('0x2c')]);_0x5d9c97['filters']=_[_0xf878('0x2e')](_0x5d9c97[_0xf878('0x2a')],_0x5d9c97[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d9c97['model'],qs[_0xf878('0x30')](_0x5aff46[_0xf878('0x2c')]['fields']));_0x9a127d[_0xf878('0x2f')]=_0x9a127d[_0xf878('0x2f')][_0xf878('0x31')]?_0x9a127d[_0xf878('0x2f')]:_0x5d9c97[_0xf878('0x2a')];if(!_0x5aff46['query'][_0xf878('0x32')](_0xf878('0x33'))){_0x9a127d[_0xf878('0x1b')]=qs[_0xf878('0x1b')](_0x5aff46['query'][_0xf878('0x1b')]);_0x9a127d['offset']=qs['offset'](_0x5aff46[_0xf878('0x2c')][_0xf878('0x19')]);}_0x9a127d[_0xf878('0x34')]=qs[_0xf878('0x35')](_0x5aff46[_0xf878('0x2c')]['sort']);_0x9a127d[_0xf878('0x36')]=qs['filters'](_[_0xf878('0x37')](_0x5aff46[_0xf878('0x2c')],_0x5d9c97['filters']),_0x31e2e1);if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]){_0x9a127d['where']=_[_0xf878('0x39')](_0x9a127d[_0xf878('0x36')],{'$or':_['map'](_0x31e2e1,function(_0x4129c2){if(_0x4129c2[_0xf878('0x29')]!==_0xf878('0x3a')){var _0xc8eb91={};_0xc8eb91[_0x4129c2[_0xf878('0x25')]]={'$like':'%'+_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0xc8eb91;}})});}_0x9a127d=_['merge']({},_0x9a127d,_0x5aff46[_0xf878('0x3b')]);var _0x14340d={'where':_0x9a127d['where']};return db[_0xf878('0x28')]['count'](_0x14340d)['then'](function(_0x2ec109){_0x4a0286[_0xf878('0x1c')]=_0x2ec109;if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x3c')]){_0x9a127d[_0xf878('0x3d')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xf878('0x3e')](_0x9a127d);})['then'](function(_0xb09736){_0x4a0286[_0xf878('0x3f')]=_0xb09736;return _0x4a0286;})['then'](respondWithFilteredResult(_0x502322,_0x9a127d))['catch'](handleError(_0x502322,null));};exports[_0xf878('0x40')]=function(_0x2a66c1,_0x13fcd3){var _0x2f6ee5={'raw':![],'where':{'id':_0x2a66c1[_0xf878('0x41')]['id']}},_0x5d6e03={};_0x5d6e03[_0xf878('0x2a')]=_[_0xf878('0x2d')](db[_0xf878('0x28')]['rawAttributes']);_0x5d6e03[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x2a66c1[_0xf878('0x2c')]);_0x5d6e03[_0xf878('0x42')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],_0x5d6e03['query']);_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],qs[_0xf878('0x30')](_0x2a66c1[_0xf878('0x2c')]['fields']));_0x2f6ee5[_0xf878('0x2f')]=_0x2f6ee5[_0xf878('0x2f')][_0xf878('0x31')]?_0x2f6ee5[_0xf878('0x2f')]:_0x5d6e03['model'];if(_0x2a66c1[_0xf878('0x2c')][_0xf878('0x3c')]){_0x2f6ee5[_0xf878('0x3d')]=[{'all':!![]}];}_0x2f6ee5=_['merge']({},_0x2f6ee5,_0x2a66c1['options']);return db[_0xf878('0x28')]['find'](_0x2f6ee5)['then'](handleEntityNotFound(_0x13fcd3,null))['then'](respondWithResult(_0x13fcd3,null))[_0xf878('0x43')](handleError(_0x13fcd3,null));};exports['create']=function(_0x156fdb,_0x450a10){return db[_0xf878('0x28')][_0xf878('0x44')](_0x156fdb[_0xf878('0x45')],{})[_0xf878('0x23')](respondWithResult(_0x450a10,0xc9))[_0xf878('0x43')](handleError(_0x450a10,null));};exports['update']=function(_0xb0bf4c,_0x361ac8){if(_0xb0bf4c[_0xf878('0x45')]['id']){delete _0xb0bf4c[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')]['find']({'where':{'id':_0xb0bf4c['params']['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x361ac8,null))[_0xf878('0x23')](saveUpdates(_0xb0bf4c['body'],null))[_0xf878('0x23')](respondWithResult(_0x361ac8,null))['catch'](handleError(_0x361ac8,null));};exports[_0xf878('0x46')]=function(_0x31adde,_0x379912){return db[_0xf878('0x28')]['find']({'where':{'id':_0x31adde[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x379912,null))[_0xf878('0x23')](removeEntity(_0x379912,null))['catch'](handleError(_0x379912,null));};exports[_0xf878('0x47')]=function(_0x30df05,_0x1d3427,_0x28c393){var _0x53e3c3={};var _0x112f2a={};var _0x181f09;var _0x3f9fce;return db['ZendeskAccount'][_0xf878('0x48')]({'where':{'id':_0x30df05[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x1d3427,null))[_0xf878('0x23')](function(_0x5118f4){if(_0x5118f4){_0x181f09=_0x5118f4;_0x112f2a['model']=_['keys'](db[_0xf878('0x49')]['rawAttributes']);_0x112f2a['query']=_['keys'](_0x30df05[_0xf878('0x2c')]);_0x112f2a[_0xf878('0x42')]=_['intersection'](_0x112f2a[_0xf878('0x2a')],_0x112f2a[_0xf878('0x2c')]);_0x53e3c3[_0xf878('0x2f')]=_['intersection'](_0x112f2a['model'],qs[_0xf878('0x30')](_0x30df05['query'][_0xf878('0x30')]));_0x53e3c3[_0xf878('0x2f')]=_0x53e3c3[_0xf878('0x2f')][_0xf878('0x31')]?_0x53e3c3[_0xf878('0x2f')]:_0x112f2a[_0xf878('0x2a')];_0x53e3c3['order']=qs[_0xf878('0x35')](_0x30df05[_0xf878('0x2c')]['sort']);_0x53e3c3[_0xf878('0x36')]=qs[_0xf878('0x42')](_[_0xf878('0x37')](_0x30df05[_0xf878('0x2c')],_0x112f2a[_0xf878('0x42')]));if(_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]){_0x53e3c3['where']=_[_0xf878('0x39')](_0x53e3c3[_0xf878('0x36')],{'$or':_[_0xf878('0x2b')](_0x53e3c3['attributes'],function(_0x392242){var _0x560e0b={};_0x560e0b[_0x392242]={'$like':'%'+_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0x560e0b;})});}_0x53e3c3=_[_0xf878('0x39')]({},_0x53e3c3,_0x30df05[_0xf878('0x3b')]);return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x1141dd){if(_0x1141dd){_0x3f9fce=_0x1141dd[_0xf878('0x31')];if(!_0x30df05[_0xf878('0x2c')][_0xf878('0x32')]('nolimit')){_0x53e3c3['limit']=qs['limit'](_0x30df05[_0xf878('0x2c')]['limit']);_0x53e3c3[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x30df05['query']['offset']);}return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x3340c1){if(_0x3340c1){return _0x3340c1?{'count':_0x3f9fce,'rows':_0x3340c1}:null;}})[_0xf878('0x23')](respondWithResult(_0x1d3427,null))[_0xf878('0x43')](handleError(_0x1d3427,null));};exports[_0xf878('0x4a')]=function(_0x3e78fc,_0x302258,_0x1602ed){if(_0x3e78fc[_0xf878('0x45')]['id']){delete _0x3e78fc[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x3e78fc[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x302258,null))[_0xf878('0x23')](function(_0x1254dd){if(_0x1254dd){_0x3e78fc[_0xf878('0x45')]['AccountId']=_0x1254dd['id'];_0x3e78fc[_0xf878('0x45')]['Subjects']=integrations[_0xf878('0x4b')](_0x3e78fc[_0xf878('0x45')][_0xf878('0x4c')],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);_0x3e78fc[_0xf878('0x45')][_0xf878('0x4d')]=integrations[_0xf878('0x4e')](_0x3e78fc[_0xf878('0x45')]['channel'],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);return db[_0xf878('0x49')][_0xf878('0x44')](_0x3e78fc['body'],{'include':[{'model':db[_0xf878('0x4f')],'as':_0xf878('0x50')},{'model':db[_0xf878('0x4f')],'as':_0xf878('0x4d')}]});}return null;})[_0xf878('0x23')](respondWithResult(_0x302258,null))['catch'](handleError(_0x302258,null));};exports['getFields']=function(_0x453644,_0x1b0230,_0x193f6c){var _0x251613='';return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x453644[_0xf878('0x41')]['id']},'attributes':['id',_0xf878('0x51'),_0xf878('0x52'),_0xf878('0x53'),_0xf878('0x54'),_0xf878('0x55')]})[_0xf878('0x23')](handleEntityNotFound(_0x1b0230,null))[_0xf878('0x23')](function(_0x3bfd00){if(_0x3bfd00){_0x251613=_0x3bfd00[_0xf878('0x55')];var _0x153069=_0x251613['slice'](-0x1);if(_0x153069==='/'){_0x251613=_0x251613[_0xf878('0x56')](0x0,_0x251613[_0xf878('0x57')](_0x153069));}var _0x288235={'method':_0xf878('0x58'),'uri':util[_0xf878('0x59')](_0xf878('0x5a'),_0x251613,_0xf878('0x5b')),'json':!![]};switch(_0x3bfd00[_0xf878('0x54')]){case _0xf878('0x52'):_0x288235['headers']={'Authorization':util[_0xf878('0x59')](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x5d'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00[_0xf878('0x52')]))[_0xf878('0x5e')]('base64'))};break;case'token':_0x288235[_0xf878('0x5f')]={'Authorization':util['format'](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x60'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00['token']))[_0xf878('0x5e')](_0xf878('0x61')))};break;default:throw new db[(_0xf878('0x62'))][(_0xf878('0x63'))]('Unknown\x20authentication\x20type');}return rp(_0x288235);}})[_0xf878('0x23')](function(_0x565e8c){if(_0x565e8c){var _0x21537f=[_0xf878('0x64'),_0xf878('0x65'),_0xf878('0x66'),_0xf878('0x67')];_['remove'](_0x565e8c[_0xf878('0x5b')],function(_0x21c5d1){return _0x21537f[_0xf878('0x68')](_0x21c5d1[_0xf878('0x29')]);});return{'count':_0x565e8c['ticket_fields'][_0xf878('0x31')],'rows':_['map'](_0x565e8c[_0xf878('0x5b')],function(_0x107456){return{'id':_0x107456['id'],'name':_0x107456[_0xf878('0x69')]>0x7?_0x107456[_0xf878('0x6a')]:_0x107456[_0xf878('0x29')],'custom':_0x107456[_0xf878('0x69')]>0x7?!![]:![],'options':_0x107456[_0xf878('0x6b')]?_0x107456[_0xf878('0x6b')]:_0x107456['custom_field_options']?_0x107456['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x1b0230,null))[_0xf878('0x43')](function(_0x1a9af7){var _0x497b7a=_0x453644['query'][_0xf878('0x6c')]?0x1f4:_0x1a9af7['statusCode']||0x1f4;logger[_0xf878('0x24')](_0xf878('0x6d'),_0xf878('0x6e'),_0x497b7a,JSON[_0xf878('0x6f')](_0x1a9af7));delete _0x1a9af7[_0xf878('0x25')];if(_0x497b7a===0x191){_0x497b7a=0x190;}_0x1b0230[_0xf878('0x1d')](_0x497b7a)[_0xf878('0x26')](_0x453644[_0xf878('0x2c')][_0xf878('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x1a9af7[_0xf878('0x70')]}:_0x1a9af7);});}; \ No newline at end of file +var _0x57f8=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','channel','Descriptions','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','includes','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','error','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x57f8,0x198));var _0x857f=function(_0xca8958,_0x25eed8){_0xca8958=_0xca8958-0x0;var _0x3d7165=_0x57f8[_0xca8958];return _0x3d7165;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e1eda,_0x2d5e26){_0x2d5e26=_0x2d5e26||0xcc;return function(_0x373333){if(_0x373333){return _0x2e1eda[_0x857f('0x1b')](_0x2d5e26);}return _0x2e1eda[_0x857f('0x1c')](_0x2d5e26)['end']();};}function respondWithResult(_0x4bc590,_0x3b09d9){_0x3b09d9=_0x3b09d9||0xc8;return function(_0x5f27b2){if(_0x5f27b2){return _0x4bc590[_0x857f('0x1c')](_0x3b09d9)['json'](_0x5f27b2);}};}function respondWithFilteredResult(_0x1d47bf,_0x134a4f){return function(_0x5c3a69){if(_0x5c3a69){var _0x27e8f1=typeof _0x134a4f[_0x857f('0x1d')]===_0x857f('0x1e')&&typeof _0x134a4f[_0x857f('0x1f')]===_0x857f('0x1e');var _0x38a3c2=_0x5c3a69[_0x857f('0x20')];var _0x429e23=_0x27e8f1?0x0:_0x134a4f[_0x857f('0x1d')];var _0x38a242=_0x27e8f1?_0x5c3a69[_0x857f('0x20')]:_0x134a4f['offset']+_0x134a4f[_0x857f('0x1f')];var _0x1e8fd4;if(_0x38a242>=_0x38a3c2){_0x38a242=_0x38a3c2;_0x1e8fd4=0xc8;}else{_0x1e8fd4=0xce;}_0x1d47bf['status'](_0x1e8fd4);return _0x1d47bf[_0x857f('0x21')](_0x857f('0x22'),_0x429e23+'-'+_0x38a242+'/'+_0x38a3c2)[_0x857f('0x23')](_0x5c3a69);}return null;};}function patchUpdates(_0x484035){return function(_0x57fa8b){try{jsonpatch[_0x857f('0x24')](_0x57fa8b,_0x484035,!![]);}catch(_0x8f278){return BPromise[_0x857f('0x25')](_0x8f278);}return _0x57fa8b['save']();};}function saveUpdates(_0x118237,_0x17a98e){return function(_0xdf8ac3){if(_0xdf8ac3){return _0xdf8ac3['update'](_0x118237)[_0x857f('0x26')](function(_0x14a8ce){return _0x14a8ce;});}return null;};}function removeEntity(_0x50bfb7,_0x3bc543){return function(_0x1a651f){if(_0x1a651f){return _0x1a651f[_0x857f('0x27')]()[_0x857f('0x26')](function(){_0x50bfb7[_0x857f('0x1c')](0xcc)[_0x857f('0x28')]();});}};}function handleEntityNotFound(_0x233a68,_0x2a89ba){return function(_0x181a9e){if(!_0x181a9e){_0x233a68[_0x857f('0x1b')](0x194);}return _0x181a9e;};}function handleError(_0x72f0aa,_0x4782ab){_0x4782ab=_0x4782ab||0x1f4;return function(_0x250731){logger[_0x857f('0x29')](_0x250731['stack']);if(_0x250731[_0x857f('0x2a')]){delete _0x250731[_0x857f('0x2a')];}_0x72f0aa[_0x857f('0x1c')](_0x4782ab)[_0x857f('0x2b')](_0x250731);};}exports['index']=function(_0x40c306,_0x57ceaa){var _0x1b405a={},_0x234048={},_0x45a37f={'count':0x0,'rows':[]};var _0x2ab814=_[_0x857f('0x2c')](db[_0x857f('0x2d')][_0x857f('0x2e')],function(_0xe79241){return{'name':_0xe79241[_0x857f('0x2f')],'type':_0xe79241[_0x857f('0x30')][_0x857f('0x31')]};});_0x234048[_0x857f('0x32')]=_[_0x857f('0x2c')](_0x2ab814,'name');_0x234048[_0x857f('0x33')]=_[_0x857f('0x34')](_0x40c306['query']);_0x234048[_0x857f('0x35')]=_[_0x857f('0x36')](_0x234048['model'],_0x234048[_0x857f('0x33')]);_0x1b405a[_0x857f('0x37')]=_['intersection'](_0x234048[_0x857f('0x32')],qs[_0x857f('0x38')](_0x40c306[_0x857f('0x33')][_0x857f('0x38')]));_0x1b405a['attributes']=_0x1b405a['attributes'][_0x857f('0x39')]?_0x1b405a[_0x857f('0x37')]:_0x234048['model'];if(!_0x40c306[_0x857f('0x33')]['hasOwnProperty'](_0x857f('0x3a'))){_0x1b405a[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x40c306[_0x857f('0x33')][_0x857f('0x1f')]);_0x1b405a['offset']=qs['offset'](_0x40c306[_0x857f('0x33')]['offset']);}_0x1b405a[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x40c306[_0x857f('0x33')]['sort']);_0x1b405a[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x40c306[_0x857f('0x33')],_0x234048[_0x857f('0x35')]),_0x2ab814);if(_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]){_0x1b405a['where']=_[_0x857f('0x40')](_0x1b405a[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x2ab814,function(_0x28ffe4){if(_0x28ffe4[_0x857f('0x30')]!==_0x857f('0x41')){var _0x447f28={};_0x447f28[_0x28ffe4['name']]={'$like':'%'+_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x447f28;}})});}_0x1b405a=_[_0x857f('0x40')]({},_0x1b405a,_0x40c306[_0x857f('0x42')]);var _0x196c95={'where':_0x1b405a[_0x857f('0x3d')]};return db['ZendeskAccount'][_0x857f('0x20')](_0x196c95)[_0x857f('0x26')](function(_0x167e9d){_0x45a37f[_0x857f('0x20')]=_0x167e9d;if(_0x40c306[_0x857f('0x33')][_0x857f('0x43')]){_0x1b405a[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2d')]['findAll'](_0x1b405a);})[_0x857f('0x26')](function(_0x223095){_0x45a37f[_0x857f('0x45')]=_0x223095;return _0x45a37f;})[_0x857f('0x26')](respondWithFilteredResult(_0x57ceaa,_0x1b405a))[_0x857f('0x46')](handleError(_0x57ceaa,null));};exports[_0x857f('0x47')]=function(_0x374b9f,_0x42d922){var _0xb4d7c2={'raw':![],'where':{'id':_0x374b9f[_0x857f('0x48')]['id']}},_0x3e2079={};_0x3e2079[_0x857f('0x32')]=_[_0x857f('0x34')](db[_0x857f('0x2d')]['rawAttributes']);_0x3e2079[_0x857f('0x33')]=_['keys'](_0x374b9f[_0x857f('0x33')]);_0x3e2079[_0x857f('0x35')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],_0x3e2079[_0x857f('0x33')]);_0xb4d7c2[_0x857f('0x37')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],qs[_0x857f('0x38')](_0x374b9f[_0x857f('0x33')][_0x857f('0x38')]));_0xb4d7c2['attributes']=_0xb4d7c2['attributes'][_0x857f('0x39')]?_0xb4d7c2['attributes']:_0x3e2079[_0x857f('0x32')];if(_0x374b9f['query'][_0x857f('0x43')]){_0xb4d7c2[_0x857f('0x44')]=[{'all':!![]}];}_0xb4d7c2=_[_0x857f('0x40')]({},_0xb4d7c2,_0x374b9f[_0x857f('0x42')]);return db[_0x857f('0x2d')][_0x857f('0x49')](_0xb4d7c2)[_0x857f('0x26')](handleEntityNotFound(_0x42d922,null))[_0x857f('0x26')](respondWithResult(_0x42d922,null))['catch'](handleError(_0x42d922,null));};exports[_0x857f('0x4a')]=function(_0x3b431d,_0x3806d4){return db[_0x857f('0x2d')]['create'](_0x3b431d[_0x857f('0x4b')],{})[_0x857f('0x26')](respondWithResult(_0x3806d4,0xc9))[_0x857f('0x46')](handleError(_0x3806d4,null));};exports[_0x857f('0x4c')]=function(_0x67563,_0x53baae){if(_0x67563[_0x857f('0x4b')]['id']){delete _0x67563[_0x857f('0x4b')]['id'];}return db['ZendeskAccount'][_0x857f('0x49')]({'where':{'id':_0x67563[_0x857f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53baae,null))[_0x857f('0x26')](saveUpdates(_0x67563['body'],null))[_0x857f('0x26')](respondWithResult(_0x53baae,null))[_0x857f('0x46')](handleError(_0x53baae,null));};exports[_0x857f('0x27')]=function(_0x2008d5,_0x58bf27){return db[_0x857f('0x2d')][_0x857f('0x49')]({'where':{'id':_0x2008d5[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x58bf27,null))[_0x857f('0x26')](removeEntity(_0x58bf27,null))['catch'](handleError(_0x58bf27,null));};exports[_0x857f('0x4d')]=function(_0x13ef75,_0x9d8273,_0x2670e6){var _0x3e24a5={};var _0x9edee5={};var _0x12712a;var _0x59164a;return db[_0x857f('0x2d')][_0x857f('0x4e')]({'where':{'id':_0x13ef75[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x9d8273,null))[_0x857f('0x26')](function(_0x153e4e){if(_0x153e4e){_0x12712a=_0x153e4e;_0x9edee5['model']=_[_0x857f('0x34')](db[_0x857f('0x4f')][_0x857f('0x2e')]);_0x9edee5[_0x857f('0x33')]=_[_0x857f('0x34')](_0x13ef75[_0x857f('0x33')]);_0x9edee5[_0x857f('0x35')]=_[_0x857f('0x36')](_0x9edee5['model'],_0x9edee5['query']);_0x3e24a5[_0x857f('0x37')]=_[_0x857f('0x36')](_0x9edee5[_0x857f('0x32')],qs[_0x857f('0x38')](_0x13ef75[_0x857f('0x33')][_0x857f('0x38')]));_0x3e24a5['attributes']=_0x3e24a5[_0x857f('0x37')][_0x857f('0x39')]?_0x3e24a5['attributes']:_0x9edee5[_0x857f('0x32')];_0x3e24a5['order']=qs[_0x857f('0x3c')](_0x13ef75[_0x857f('0x33')]['sort']);_0x3e24a5[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x13ef75[_0x857f('0x33')],_0x9edee5[_0x857f('0x35')]));if(_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]){_0x3e24a5[_0x857f('0x3d')]=_['merge'](_0x3e24a5[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x3e24a5[_0x857f('0x37')],function(_0x7cc7f7){var _0x3c612f={};_0x3c612f[_0x7cc7f7]={'$like':'%'+_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x3c612f;})});}_0x3e24a5=_[_0x857f('0x40')]({},_0x3e24a5,_0x13ef75[_0x857f('0x42')]);return _0x12712a[_0x857f('0x4d')](_0x3e24a5);}})[_0x857f('0x26')](function(_0x5631fb){if(_0x5631fb){_0x59164a=_0x5631fb[_0x857f('0x39')];if(!_0x13ef75[_0x857f('0x33')][_0x857f('0x50')](_0x857f('0x3a'))){_0x3e24a5['limit']=qs[_0x857f('0x1f')](_0x13ef75['query'][_0x857f('0x1f')]);_0x3e24a5[_0x857f('0x1d')]=qs[_0x857f('0x1d')](_0x13ef75[_0x857f('0x33')]['offset']);}return _0x12712a['getConfigurations'](_0x3e24a5);}})[_0x857f('0x26')](function(_0x3ee981){if(_0x3ee981){return _0x3ee981?{'count':_0x59164a,'rows':_0x3ee981}:null;}})[_0x857f('0x26')](respondWithResult(_0x9d8273,null))['catch'](handleError(_0x9d8273,null));};exports[_0x857f('0x51')]=function(_0x5e42bc,_0x5b505,_0x1d6c1c){if(_0x5e42bc[_0x857f('0x4b')]['id']){delete _0x5e42bc['body']['id'];}return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x5e42bc[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x5b505,null))[_0x857f('0x26')](function(_0x41f9d8){if(_0x41f9d8){_0x5e42bc[_0x857f('0x4b')][_0x857f('0x52')]=_0x41f9d8['id'];_0x5e42bc[_0x857f('0x4b')]['Subjects']=integrations['getSubjects'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);_0x5e42bc[_0x857f('0x4b')][_0x857f('0x54')]=integrations['getDescriptions'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);return db[_0x857f('0x4f')][_0x857f('0x4a')](_0x5e42bc[_0x857f('0x4b')],{'include':[{'model':db[_0x857f('0x55')],'as':_0x857f('0x56')},{'model':db[_0x857f('0x55')],'as':'Descriptions'}]});}return null;})[_0x857f('0x26')](respondWithResult(_0x5b505,null))['catch'](handleError(_0x5b505,null));};exports['getFields']=function(_0x35cd3e,_0x48e588,_0x5e5fd9){var _0x2e2cf3='';return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x35cd3e['params']['id']},'attributes':['id',_0x857f('0x57'),_0x857f('0x58'),_0x857f('0x59'),_0x857f('0x5a'),'remoteUri']})[_0x857f('0x26')](handleEntityNotFound(_0x48e588,null))[_0x857f('0x26')](function(_0x3100aa){if(_0x3100aa){_0x2e2cf3=_0x3100aa[_0x857f('0x5b')];var _0x387aaa=_0x2e2cf3[_0x857f('0x5c')](-0x1);if(_0x387aaa==='/'){_0x2e2cf3=_0x2e2cf3[_0x857f('0x5d')](0x0,_0x2e2cf3['lastIndexOf'](_0x387aaa));}var _0x54e75d={'method':_0x857f('0x5e'),'uri':util[_0x857f('0x5f')](_0x857f('0x60'),_0x2e2cf3,_0x857f('0x61')),'json':!![]};switch(_0x3100aa[_0x857f('0x5a')]){case _0x857f('0x58'):_0x54e75d['headers']={'Authorization':util[_0x857f('0x5f')](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s:%s',_0x3100aa['username'],_0x3100aa[_0x857f('0x58')]))['toString']('base64'))};break;case _0x857f('0x59'):_0x54e75d[_0x857f('0x63')]={'Authorization':util['format'](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s/token:%s',_0x3100aa[_0x857f('0x57')],_0x3100aa[_0x857f('0x59')]))[_0x857f('0x64')](_0x857f('0x65')))};break;default:throw new db[(_0x857f('0x66'))][(_0x857f('0x67'))](_0x857f('0x68'));}return rp(_0x54e75d);}})[_0x857f('0x26')](function(_0x415fd3){if(_0x415fd3){var _0x465857=[_0x857f('0x69'),_0x857f('0x6a'),'group','assignee'];_['remove'](_0x415fd3[_0x857f('0x61')],function(_0x310b18){return _0x465857[_0x857f('0x6b')](_0x310b18[_0x857f('0x30')]);});return{'count':_0x415fd3[_0x857f('0x61')][_0x857f('0x39')],'rows':_[_0x857f('0x2c')](_0x415fd3['ticket_fields'],function(_0x40077e){return{'id':_0x40077e['id'],'name':_0x40077e['position']>0x7?_0x40077e[_0x857f('0x6c')]:_0x40077e['type'],'custom':_0x40077e['position']>0x7?!![]:![],'options':_0x40077e[_0x857f('0x6d')]?_0x40077e['system_field_options']:_0x40077e[_0x857f('0x6e')]?_0x40077e[_0x857f('0x6e')]:[]};})};}})[_0x857f('0x26')](respondWithResult(_0x48e588,null))['catch'](function(_0x45be3d){var _0x19456f=_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?0x1f4:_0x45be3d[_0x857f('0x70')]||0x1f4;logger[_0x857f('0x29')](_0x857f('0x71'),_0x857f('0x72'),_0x19456f,JSON[_0x857f('0x73')](_0x45be3d));delete _0x45be3d['name'];if(_0x19456f===0x191){_0x19456f=0x190;}_0x48e588[_0x857f('0x1c')](_0x19456f)[_0x857f('0x2b')](_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x45be3d[_0x857f('0x70')]}:_0x45be3d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1f4ae69..f1c40e2 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 _0x0550=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x218ee3,_0x2e60e9){var _0x77673d=function(_0x527822){while(--_0x527822){_0x218ee3['push'](_0x218ee3['shift']());}};_0x77673d(++_0x2e60e9);}(_0x0550,0x8f));var _0x0055=function(_0x972b32,_0x56ea80){_0x972b32=_0x972b32-0x0;var _0x6e8e75=_0x0550[_0x972b32];return _0x6e8e75;};'use strict';var _=require('lodash');var util=require(_0x0055('0x0'));var logger=require(_0x0055('0x1'))(_0x0055('0x2'));var moment=require(_0x0055('0x3'));var BPromise=require(_0x0055('0x4'));var rp=require(_0x0055('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0055('0x6'));var config=require('../../config/environment');var attributes=require(_0x0055('0x7'));var integrations=require(_0x0055('0x8'));module[_0x0055('0x9')]=function(_0x2f777d,_0x381f35){return _0x2f777d[_0x0055('0xa')](_0x0055('0xb'),attributes,{'tableName':_0x0055('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x983f=['../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x45ce57,_0x75c39e){var _0x5aa756=function(_0xb68f75){while(--_0xb68f75){_0x45ce57['push'](_0x45ce57['shift']());}};_0x5aa756(++_0x75c39e);}(_0x983f,0x1b1));var _0xf983=function(_0x440d65,_0x4938b7){_0x440d65=_0x440d65-0x0;var _0x2172e4=_0x983f[_0x440d65];return _0x2172e4;};'use strict';var _=require(_0xf983('0x0'));var util=require(_0xf983('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf983('0x2'));var BPromise=require(_0xf983('0x3'));var rp=require(_0xf983('0x4'));var fs=require('fs');var path=require(_0xf983('0x5'));var rimraf=require('rimraf');var config=require(_0xf983('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xf983('0x7'));module['exports']=function(_0x4e8834,_0x38dbc2){return _0x4e8834[_0xf983('0x8')](_0xf983('0x9'),attributes,{'tableName':_0xf983('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 4e94bba..2eb3e0a 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 _0x5d60=['request\x20sent','debug','error','message','result','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','map','include','model','stringify','catch','ShowZendeskAccount','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x3e8451,_0x191b4a){var _0x3e0a71=function(_0x5a94f0){while(--_0x5a94f0){_0x3e8451['push'](_0x3e8451['shift']());}};_0x3e0a71(++_0x191b4a);}(_0x5d60,0xcc));var _0x05d6=function(_0x529b54,_0x5748df){_0x529b54=_0x529b54-0x0;var _0x50cca3=_0x5d60[_0x529b54];return _0x50cca3;};'use strict';var _=require('lodash');var util=require(_0x05d6('0x0'));var moment=require(_0x05d6('0x1'));var BPromise=require('bluebird');var rs=require(_0x05d6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05d6('0x3'))['db'];var utils=require(_0x05d6('0x4'));var logger=require(_0x05d6('0x5'))(_0x05d6('0x6'));var config=require(_0x05d6('0x7'));var jayson=require(_0x05d6('0x8'));var client=jayson['client'][_0x05d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51e00a,_0x3a9a9a,_0x74d43c){return new BPromise(function(_0x4d359a,_0xf60c68){return client['request'](_0x51e00a,_0x74d43c)[_0x05d6('0xa')](function(_0xa575d5){logger[_0x05d6('0xb')](_0x05d6('0xc'),_0x3a9a9a,_0x05d6('0xd'));logger[_0x05d6('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3a9a9a,'request\x20sent',JSON['stringify'](_0xa575d5));if(_0xa575d5[_0x05d6('0xf')]){if(_0xa575d5[_0x05d6('0xf')]['code']===0x1f4){logger[_0x05d6('0xf')](_0x05d6('0xc'),_0x3a9a9a,_0xa575d5[_0x05d6('0xf')]['message']);return _0xf60c68(_0xa575d5[_0x05d6('0xf')][_0x05d6('0x10')]);}logger[_0x05d6('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x3a9a9a,_0xa575d5['error'][_0x05d6('0x10')]);return _0x4d359a(_0xa575d5[_0x05d6('0xf')][_0x05d6('0x10')]);}else{logger[_0x05d6('0xb')](_0x05d6('0xc'),_0x3a9a9a,_0x05d6('0xd'));_0x4d359a(_0xa575d5[_0x05d6('0x11')][_0x05d6('0x10')]);}})['catch'](function(_0x501920){logger[_0x05d6('0xf')](_0x05d6('0xc'),_0x3a9a9a,_0x501920);_0xf60c68(_0x501920);});});}exports[_0x05d6('0x12')]=function(_0x57f898){var _0x5ec114=this;return new Promise(function(_0x3908ce,_0x1f58dd){return db[_0x05d6('0x13')]['findAll']({'raw':_0x57f898[_0x05d6('0x14')]?_0x57f898[_0x05d6('0x14')][_0x05d6('0x15')]===undefined?!![]:![]:!![],'where':_0x57f898[_0x05d6('0x14')]?_0x57f898[_0x05d6('0x14')][_0x05d6('0x16')]||null:null,'attributes':_0x57f898[_0x05d6('0x14')]?_0x57f898[_0x05d6('0x14')][_0x05d6('0x17')]||null:null,'limit':_0x57f898['options']?_0x57f898[_0x05d6('0x14')][_0x05d6('0x18')]||null:null,'include':_0x57f898[_0x05d6('0x14')]?_0x57f898[_0x05d6('0x14')]['include']?_[_0x05d6('0x19')](_0x57f898[_0x05d6('0x14')][_0x05d6('0x1a')],function(_0x3d980a){return{'model':db[_0x3d980a[_0x05d6('0x1b')]],'as':_0x3d980a['as'],'attributes':_0x3d980a[_0x05d6('0x17')],'include':_0x3d980a[_0x05d6('0x1a')]?_[_0x05d6('0x19')](_0x3d980a['include'],function(_0x457f57){return{'model':db[_0x457f57[_0x05d6('0x1b')]],'as':_0x457f57['as'],'attributes':_0x457f57[_0x05d6('0x17')],'include':_0x457f57[_0x05d6('0x1a')]?_[_0x05d6('0x19')](_0x457f57[_0x05d6('0x1a')],function(_0x785a87){return{'model':db[_0x785a87[_0x05d6('0x1b')]],'as':_0x785a87['as'],'attributes':_0x785a87[_0x05d6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x05d6('0xa')](function(_0x39de6d){logger[_0x05d6('0xb')](_0x05d6('0x12'),_0x57f898);logger[_0x05d6('0xe')](_0x05d6('0x12'),_0x57f898,JSON[_0x05d6('0x1c')](_0x39de6d));_0x3908ce(_0x39de6d);})[_0x05d6('0x1d')](function(_0x1f35b8){logger['error'](_0x05d6('0x12'),_0x1f35b8[_0x05d6('0x10')],_0x57f898);_0x1f58dd(_0x5ec114[_0x05d6('0xf')](0x1f4,_0x1f35b8[_0x05d6('0x10')]));});});};exports[_0x05d6('0x1e')]=function(_0x29ae8b){var _0x1c7108=this;return new Promise(function(_0x3047db,_0x39fe95){return db[_0x05d6('0x13')]['find']({'raw':_0x29ae8b[_0x05d6('0x14')]?_0x29ae8b[_0x05d6('0x14')][_0x05d6('0x15')]===undefined?!![]:![]:!![],'where':_0x29ae8b[_0x05d6('0x14')]?_0x29ae8b[_0x05d6('0x14')]['where']||null:null,'attributes':_0x29ae8b[_0x05d6('0x14')]?_0x29ae8b[_0x05d6('0x14')][_0x05d6('0x17')]||null:null,'include':_0x29ae8b['options']?_0x29ae8b[_0x05d6('0x14')]['include']?_[_0x05d6('0x19')](_0x29ae8b[_0x05d6('0x14')][_0x05d6('0x1a')],function(_0xf2d334){return{'model':db[_0xf2d334[_0x05d6('0x1b')]],'as':_0xf2d334['as'],'attributes':_0xf2d334[_0x05d6('0x17')],'include':_0xf2d334[_0x05d6('0x1a')]?_[_0x05d6('0x19')](_0xf2d334[_0x05d6('0x1a')],function(_0x211557){return{'model':db[_0x211557[_0x05d6('0x1b')]],'as':_0x211557['as'],'attributes':_0x211557[_0x05d6('0x17')],'include':_0x211557['include']?_[_0x05d6('0x19')](_0x211557[_0x05d6('0x1a')],function(_0x4047bb){return{'model':db[_0x4047bb[_0x05d6('0x1b')]],'as':_0x4047bb['as'],'attributes':_0x4047bb[_0x05d6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x05d6('0xa')](function(_0x4ce551){logger[_0x05d6('0xb')](_0x05d6('0x1e'),_0x29ae8b);logger['debug']('ShowZendeskAccount',_0x29ae8b,JSON[_0x05d6('0x1c')](_0x4ce551));_0x3047db(_0x4ce551);})[_0x05d6('0x1d')](function(_0x339060){logger['error'](_0x05d6('0x1e'),_0x339060[_0x05d6('0x10')],_0x29ae8b);_0x39fe95(_0x1c7108[_0x05d6('0xf')](0x1f4,_0x339060['message']));});});}; \ No newline at end of file +var _0x1c0c=['where','limit','include','map','model','attributes','ShowZendeskAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetZendeskAccount','ZendeskAccount','findAll','options'];(function(_0x20f76d,_0x5f12b3){var _0x2b2080=function(_0x287f90){while(--_0x287f90){_0x20f76d['push'](_0x20f76d['shift']());}};_0x2b2080(++_0x5f12b3);}(_0x1c0c,0x1c5));var _0xc1c0=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1c0c[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xc1c0('0x0'));var util=require(_0xc1c0('0x1'));var moment=require(_0xc1c0('0x2'));var BPromise=require(_0xc1c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c0('0x4'));var db=require(_0xc1c0('0x5'))['db'];var utils=require(_0xc1c0('0x6'));var logger=require(_0xc1c0('0x7'))(_0xc1c0('0x8'));var config=require(_0xc1c0('0x9'));var jayson=require(_0xc1c0('0xa'));var client=jayson['client'][_0xc1c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ecbf4,_0x31e6e0,_0x4de445){return new BPromise(function(_0x59d8be,_0x2a82c){return client[_0xc1c0('0xc')](_0x2ecbf4,_0x4de445)[_0xc1c0('0xd')](function(_0x4139df){logger['info'](_0xc1c0('0xe'),_0x31e6e0,_0xc1c0('0xf'));logger[_0xc1c0('0x10')](_0xc1c0('0x11'),_0x31e6e0,'request\x20sent',JSON[_0xc1c0('0x12')](_0x4139df));if(_0x4139df[_0xc1c0('0x13')]){if(_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x14')]===0x1f4){logger[_0xc1c0('0x13')](_0xc1c0('0xe'),_0x31e6e0,_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);return _0x2a82c(_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);}logger[_0xc1c0('0x13')](_0xc1c0('0xe'),_0x31e6e0,_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);return _0x59d8be(_0x4139df['error'][_0xc1c0('0x15')]);}else{logger[_0xc1c0('0x16')]('ZendeskAccount,\x20%s,\x20%s',_0x31e6e0,_0xc1c0('0xf'));_0x59d8be(_0x4139df['result']['message']);}})[_0xc1c0('0x17')](function(_0x2bbcfc){logger['error'](_0xc1c0('0xe'),_0x31e6e0,_0x2bbcfc);_0x2a82c(_0x2bbcfc);});});}exports[_0xc1c0('0x18')]=function(_0xc21080){var _0x160154=this;return new Promise(function(_0x3986e2,_0x482a59){return db[_0xc1c0('0x19')][_0xc1c0('0x1a')]({'raw':_0xc21080['options']?_0xc21080[_0xc1c0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xc21080[_0xc1c0('0x1b')]?_0xc21080['options'][_0xc1c0('0x1c')]||null:null,'attributes':_0xc21080[_0xc1c0('0x1b')]?_0xc21080[_0xc1c0('0x1b')]['attributes']||null:null,'limit':_0xc21080[_0xc1c0('0x1b')]?_0xc21080[_0xc1c0('0x1b')][_0xc1c0('0x1d')]||null:null,'include':_0xc21080['options']?_0xc21080['options'][_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0xc21080['options'][_0xc1c0('0x1e')],function(_0x5dbb14){return{'model':db[_0x5dbb14[_0xc1c0('0x20')]],'as':_0x5dbb14['as'],'attributes':_0x5dbb14['attributes'],'include':_0x5dbb14[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x5dbb14[_0xc1c0('0x1e')],function(_0x59fe9f){return{'model':db[_0x59fe9f[_0xc1c0('0x20')]],'as':_0x59fe9f['as'],'attributes':_0x59fe9f[_0xc1c0('0x21')],'include':_0x59fe9f[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x59fe9f[_0xc1c0('0x1e')],function(_0x480edb){return{'model':db[_0x480edb[_0xc1c0('0x20')]],'as':_0x480edb['as'],'attributes':_0x480edb[_0xc1c0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c0('0xd')](function(_0x47bb7e){logger['info'](_0xc1c0('0x18'),_0xc21080);logger[_0xc1c0('0x10')](_0xc1c0('0x18'),_0xc21080,JSON[_0xc1c0('0x12')](_0x47bb7e));_0x3986e2(_0x47bb7e);})[_0xc1c0('0x17')](function(_0x2c5fed){logger[_0xc1c0('0x13')](_0xc1c0('0x18'),_0x2c5fed['message'],_0xc21080);_0x482a59(_0x160154[_0xc1c0('0x13')](0x1f4,_0x2c5fed[_0xc1c0('0x15')]));});});};exports[_0xc1c0('0x22')]=function(_0x2df501){var _0xfd1891=this;return new Promise(function(_0x1229be,_0x4a361d){return db['ZendeskAccount'][_0xc1c0('0x23')]({'raw':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x24')]===undefined?!![]:![]:!![],'where':_0x2df501['options']?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1c')]||null:null,'attributes':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x21')]||null:null,'include':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1e')],function(_0xff2611){return{'model':db[_0xff2611[_0xc1c0('0x20')]],'as':_0xff2611['as'],'attributes':_0xff2611[_0xc1c0('0x21')],'include':_0xff2611[_0xc1c0('0x1e')]?_['map'](_0xff2611[_0xc1c0('0x1e')],function(_0xb08aa8){return{'model':db[_0xb08aa8['model']],'as':_0xb08aa8['as'],'attributes':_0xb08aa8['attributes'],'include':_0xb08aa8[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0xb08aa8['include'],function(_0xe1506e){return{'model':db[_0xe1506e[_0xc1c0('0x20')]],'as':_0xe1506e['as'],'attributes':_0xe1506e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1c0('0xd')](function(_0x5a7605){logger[_0xc1c0('0x16')](_0xc1c0('0x22'),_0x2df501);logger['debug'](_0xc1c0('0x22'),_0x2df501,JSON[_0xc1c0('0x12')](_0x5a7605));_0x1229be(_0x5a7605);})['catch'](function(_0xd8705a){logger[_0xc1c0('0x13')]('ShowZendeskAccount',_0xd8705a[_0xc1c0('0x15')],_0x2df501);_0x4a361d(_0xfd1891['error'](0x1f4,_0xd8705a['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index ee25652..1d50d89 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x104853,_0x2fa75a){var _0x200369=function(_0x240b84){while(--_0x240b84){_0x104853['push'](_0x104853['shift']());}};_0x200369(++_0x2fa75a);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',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/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x447892,_0x122909){var _0x32e9bf=function(_0x3dd93d){while(--_0x3dd93d){_0x447892['push'](_0x447892['shift']());}};_0x32e9bf(++_0x122909);}(_0xda3f,0xec));var _0xfda3=function(_0x4159b8,_0xa680d3){_0x4159b8=_0x4159b8-0x0;var _0x349a0c=_0xda3f[_0x4159b8];return _0x349a0c;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a65bbbc..426f2d3 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 _0x4e08=['STRING','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4e08,0xcb));var _0x84e0=function(_0x25e01f,_0x1f2976){_0x25e01f=_0x25e01f-0x0;var _0x2cd432=_0x4e08[_0x25e01f];return _0x2cd432;};'use strict';var Sequelize=require('sequelize');module[_0x84e0('0x0')]={'name':{'type':Sequelize[_0x84e0('0x1')]},'description':{'type':Sequelize[_0x84e0('0x1')]}}; \ No newline at end of file +var _0xba7a=['sequelize','STRING'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0xba7a,0x1d8));var _0xaba7=function(_0x4e79ad,_0x21ef9f){_0x4e79ad=_0x4e79ad-0x0;var _0x2cec9d=_0xba7a[_0x4e79ad];return _0x2cec9d;};'use strict';var Sequelize=require(_0xaba7('0x0'));module['exports']={'name':{'type':Sequelize[_0xaba7('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 1d94fd8..f4db3d6 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 _0x4a72=['../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','params','catch','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','mustache','path','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'];(function(_0x416303,_0x43b56f){var _0x305bda=function(_0x3fd034){while(--_0x3fd034){_0x416303['push'](_0x416303['shift']());}};_0x305bda(++_0x43b56f);}(_0x4a72,0x8d));var _0x24a7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4a72[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24a7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24a7('0x1'));var rp=require(_0x24a7('0x2'));var moment=require(_0x24a7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24a7('0x4'));var util=require('util');var path=require(_0x24a7('0x5'));var sox=require(_0x24a7('0x6'));var csv=require(_0x24a7('0x7'));var ejs=require(_0x24a7('0x8'));var fs=require('fs');var fs_extra=require(_0x24a7('0x9'));var _=require('lodash');var squel=require(_0x24a7('0xa'));var crypto=require('crypto');var jsforce=require(_0x24a7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24a7('0xc'));var Papa=require(_0x24a7('0xd'));var Redis=require(_0x24a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x24a7('0xf'));var as=require(_0x24a7('0x10'));var hardwareService=require(_0x24a7('0x11'));var logger=require(_0x24a7('0x12'))(_0x24a7('0x13'));var utils=require(_0x24a7('0x14'));var config=require(_0x24a7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x24a7('0x16'))['db'];function respondWithStatusCode(_0x19f2ad,_0x50017b){_0x50017b=_0x50017b||0xcc;return function(_0x3cebdd){if(_0x3cebdd){return _0x19f2ad[_0x24a7('0x17')](_0x50017b);}return _0x19f2ad['status'](_0x50017b)[_0x24a7('0x18')]();};}function respondWithResult(_0x54e364,_0x1d9501){_0x1d9501=_0x1d9501||0xc8;return function(_0x37961c){if(_0x37961c){return _0x54e364[_0x24a7('0x19')](_0x1d9501)['json'](_0x37961c);}};}function respondWithFilteredResult(_0x25cfd1,_0x52d61f){return function(_0x40b208){if(_0x40b208){var _0x84d27e=typeof _0x52d61f[_0x24a7('0x1a')]===_0x24a7('0x1b')&&typeof _0x52d61f['limit']===_0x24a7('0x1b');var _0x34d63a=_0x40b208[_0x24a7('0x1c')];var _0xbd2e32=_0x84d27e?0x0:_0x52d61f[_0x24a7('0x1a')];var _0x29ad31=_0x84d27e?_0x40b208[_0x24a7('0x1c')]:_0x52d61f['offset']+_0x52d61f[_0x24a7('0x1d')];var _0x4d14f5;if(_0x29ad31>=_0x34d63a){_0x29ad31=_0x34d63a;_0x4d14f5=0xc8;}else{_0x4d14f5=0xce;}_0x25cfd1['status'](_0x4d14f5);return _0x25cfd1['set']('Content-Range',_0xbd2e32+'-'+_0x29ad31+'/'+_0x34d63a)['json'](_0x40b208);}return null;};}function patchUpdates(_0x2a5a92){return function(_0x23914c){try{jsonpatch[_0x24a7('0x1e')](_0x23914c,_0x2a5a92,!![]);}catch(_0x23a49c){return BPromise[_0x24a7('0x1f')](_0x23a49c);}return _0x23914c[_0x24a7('0x20')]();};}function saveUpdates(_0x451787,_0x58b037){return function(_0x32beb0){if(_0x32beb0){return _0x32beb0[_0x24a7('0x21')](_0x451787)[_0x24a7('0x22')](function(_0x44377c){return _0x44377c;});}return null;};}function removeEntity(_0x277192,_0x586746){return function(_0x5bd9ec){if(_0x5bd9ec){return _0x5bd9ec[_0x24a7('0x23')]()[_0x24a7('0x22')](function(){_0x277192[_0x24a7('0x19')](0xcc)[_0x24a7('0x18')]();});}};}function handleEntityNotFound(_0x1ea500,_0x447155){return function(_0x2eff9a){if(!_0x2eff9a){_0x1ea500[_0x24a7('0x17')](0x194);}return _0x2eff9a;};}function handleError(_0x2ba0cc,_0x10cd9e){_0x10cd9e=_0x10cd9e||0x1f4;return function(_0x2c6e4){logger[_0x24a7('0x24')](_0x2c6e4['stack']);if(_0x2c6e4[_0x24a7('0x25')]){delete _0x2c6e4[_0x24a7('0x25')];}_0x2ba0cc['status'](_0x10cd9e)[_0x24a7('0x26')](_0x2c6e4);};}exports[_0x24a7('0x27')]=function(_0x2df1fb,_0x5b9610){var _0x5a0682={},_0x1f80fd={},_0x45d032={'count':0x0,'rows':[]};var _0x2612ff=_[_0x24a7('0x28')](db[_0x24a7('0x29')][_0x24a7('0x2a')],function(_0x42012c){return{'name':_0x42012c[_0x24a7('0x2b')],'type':_0x42012c['type'][_0x24a7('0x2c')]};});_0x1f80fd['model']=_[_0x24a7('0x28')](_0x2612ff,_0x24a7('0x25'));_0x1f80fd[_0x24a7('0x2d')]=_[_0x24a7('0x2e')](_0x2df1fb['query']);_0x1f80fd[_0x24a7('0x2f')]=_['intersection'](_0x1f80fd[_0x24a7('0x30')],_0x1f80fd[_0x24a7('0x2d')]);_0x5a0682[_0x24a7('0x31')]=_[_0x24a7('0x32')](_0x1f80fd[_0x24a7('0x30')],qs[_0x24a7('0x33')](_0x2df1fb[_0x24a7('0x2d')]['fields']));_0x5a0682[_0x24a7('0x31')]=_0x5a0682[_0x24a7('0x31')][_0x24a7('0x34')]?_0x5a0682[_0x24a7('0x31')]:_0x1f80fd[_0x24a7('0x30')];if(!_0x2df1fb['query'][_0x24a7('0x35')](_0x24a7('0x36'))){_0x5a0682['limit']=qs[_0x24a7('0x1d')](_0x2df1fb[_0x24a7('0x2d')][_0x24a7('0x1d')]);_0x5a0682[_0x24a7('0x1a')]=qs[_0x24a7('0x1a')](_0x2df1fb[_0x24a7('0x2d')][_0x24a7('0x1a')]);}_0x5a0682[_0x24a7('0x37')]=qs[_0x24a7('0x38')](_0x2df1fb[_0x24a7('0x2d')][_0x24a7('0x38')]);_0x5a0682[_0x24a7('0x39')]=qs['filters'](_[_0x24a7('0x3a')](_0x2df1fb['query'],_0x1f80fd[_0x24a7('0x2f')]),_0x2612ff);if(_0x2df1fb[_0x24a7('0x2d')]['filter']){_0x5a0682[_0x24a7('0x39')]=_['merge'](_0x5a0682[_0x24a7('0x39')],{'$or':_[_0x24a7('0x28')](_0x2612ff,function(_0x3d710c){if(_0x3d710c[_0x24a7('0x3b')]!==_0x24a7('0x3c')){var _0x1a3b6c={};_0x1a3b6c[_0x3d710c[_0x24a7('0x25')]]={'$like':'%'+_0x2df1fb['query'][_0x24a7('0x3d')]+'%'};return _0x1a3b6c;}})});}_0x5a0682=_[_0x24a7('0x3e')]({},_0x5a0682,_0x2df1fb[_0x24a7('0x3f')]);var _0x33929e={'where':_0x5a0682[_0x24a7('0x39')]};return db['ZendeskConfiguration'][_0x24a7('0x1c')](_0x33929e)['then'](function(_0x5aa3b8){_0x45d032[_0x24a7('0x1c')]=_0x5aa3b8;if(_0x2df1fb[_0x24a7('0x2d')][_0x24a7('0x40')]){_0x5a0682[_0x24a7('0x41')]=[{'all':!![]}];}return db[_0x24a7('0x29')]['findAll'](_0x5a0682);})['then'](function(_0x5278e9){_0x45d032[_0x24a7('0x42')]=_0x5278e9;return _0x45d032;})[_0x24a7('0x22')](respondWithFilteredResult(_0x5b9610,_0x5a0682))['catch'](handleError(_0x5b9610,null));};exports['show']=function(_0x532df0,_0x4a1794){var _0x1b6a3c={'raw':![],'where':{'id':_0x532df0[_0x24a7('0x43')]['id']}},_0x390eaf={};_0x390eaf[_0x24a7('0x30')]=_['keys'](db['ZendeskConfiguration'][_0x24a7('0x2a')]);_0x390eaf['query']=_['keys'](_0x532df0[_0x24a7('0x2d')]);_0x390eaf['filters']=_[_0x24a7('0x32')](_0x390eaf['model'],_0x390eaf[_0x24a7('0x2d')]);_0x1b6a3c['attributes']=_['intersection'](_0x390eaf[_0x24a7('0x30')],qs['fields'](_0x532df0['query'][_0x24a7('0x33')]));_0x1b6a3c[_0x24a7('0x31')]=_0x1b6a3c[_0x24a7('0x31')][_0x24a7('0x34')]?_0x1b6a3c[_0x24a7('0x31')]:_0x390eaf[_0x24a7('0x30')];if(_0x532df0[_0x24a7('0x2d')]['includeAll']){_0x1b6a3c[_0x24a7('0x41')]=[{'all':!![]}];}_0x1b6a3c=_[_0x24a7('0x3e')]({},_0x1b6a3c,_0x532df0[_0x24a7('0x3f')]);return db['ZendeskConfiguration']['find'](_0x1b6a3c)['then'](handleEntityNotFound(_0x4a1794,null))['then'](respondWithResult(_0x4a1794,null))[_0x24a7('0x44')](handleError(_0x4a1794,null));};exports[_0x24a7('0x45')]=function(_0x1b4902,_0x597ecd){return db['ZendeskConfiguration']['create'](_0x1b4902[_0x24a7('0x46')],{})[_0x24a7('0x22')](respondWithResult(_0x597ecd,0xc9))[_0x24a7('0x44')](handleError(_0x597ecd,null));};exports[_0x24a7('0x21')]=function(_0x4122d1,_0x3b5113){if(_0x4122d1[_0x24a7('0x46')]['id']){delete _0x4122d1[_0x24a7('0x46')]['id'];}return db[_0x24a7('0x29')][_0x24a7('0x47')]({'where':{'id':_0x4122d1[_0x24a7('0x43')]['id']}})[_0x24a7('0x22')](handleEntityNotFound(_0x3b5113,null))[_0x24a7('0x22')](saveUpdates(_0x4122d1[_0x24a7('0x46')],null))['then'](respondWithResult(_0x3b5113,null))[_0x24a7('0x44')](handleError(_0x3b5113,null));};exports[_0x24a7('0x23')]=function(_0x2bb456,_0x1897bd){return db[_0x24a7('0x29')][_0x24a7('0x47')]({'where':{'id':_0x2bb456['params']['id']}})['then'](handleEntityNotFound(_0x1897bd,null))[_0x24a7('0x22')](removeEntity(_0x1897bd,null))[_0x24a7('0x44')](handleError(_0x1897bd,null));};exports[_0x24a7('0x48')]=function(_0x1d69a5,_0x561d43,_0x35dcb9){var _0x5847d2={};var _0x2fa528={};var _0x25a504;var _0x3378c4;return db[_0x24a7('0x29')][_0x24a7('0x49')]({'where':{'id':_0x1d69a5['params']['id']}})['then'](handleEntityNotFound(_0x561d43,null))[_0x24a7('0x22')](function(_0x240cf1){if(_0x240cf1){_0x25a504=_0x240cf1;_0x2fa528[_0x24a7('0x30')]=_[_0x24a7('0x2e')](db['ZendeskField'][_0x24a7('0x2a')]);_0x2fa528[_0x24a7('0x2d')]=_[_0x24a7('0x2e')](_0x1d69a5[_0x24a7('0x2d')]);_0x2fa528[_0x24a7('0x2f')]=_[_0x24a7('0x32')](_0x2fa528[_0x24a7('0x30')],_0x2fa528[_0x24a7('0x2d')]);_0x5847d2[_0x24a7('0x31')]=_[_0x24a7('0x32')](_0x2fa528[_0x24a7('0x30')],qs['fields'](_0x1d69a5['query'][_0x24a7('0x33')]));_0x5847d2['attributes']=_0x5847d2[_0x24a7('0x31')][_0x24a7('0x34')]?_0x5847d2[_0x24a7('0x31')]:_0x2fa528[_0x24a7('0x30')];_0x5847d2[_0x24a7('0x37')]=qs[_0x24a7('0x38')](_0x1d69a5['query']['sort']);_0x5847d2[_0x24a7('0x39')]=qs['filters'](_[_0x24a7('0x3a')](_0x1d69a5['query'],_0x2fa528['filters']));if(_0x1d69a5[_0x24a7('0x2d')][_0x24a7('0x3d')]){_0x5847d2[_0x24a7('0x39')]=_[_0x24a7('0x3e')](_0x5847d2[_0x24a7('0x39')],{'$or':_['map'](_0x5847d2[_0x24a7('0x31')],function(_0x1aaec7){var _0x3e29e4={};_0x3e29e4[_0x1aaec7]={'$like':'%'+_0x1d69a5['query'][_0x24a7('0x3d')]+'%'};return _0x3e29e4;})});}_0x5847d2=_[_0x24a7('0x3e')]({},_0x5847d2,_0x1d69a5[_0x24a7('0x3f')]);return _0x25a504[_0x24a7('0x48')](_0x5847d2);}})[_0x24a7('0x22')](function(_0xd1fb53){if(_0xd1fb53){_0x3378c4=_0xd1fb53[_0x24a7('0x34')];if(!_0x1d69a5['query']['hasOwnProperty']('nolimit')){_0x5847d2[_0x24a7('0x1d')]=qs[_0x24a7('0x1d')](_0x1d69a5[_0x24a7('0x2d')]['limit']);_0x5847d2['offset']=qs[_0x24a7('0x1a')](_0x1d69a5[_0x24a7('0x2d')][_0x24a7('0x1a')]);}return _0x25a504['getFields'](_0x5847d2);}})[_0x24a7('0x22')](function(_0xfcebf){if(_0xfcebf){return _0xfcebf?{'count':_0x3378c4,'rows':_0xfcebf}:null;}})[_0x24a7('0x22')](respondWithResult(_0x561d43,null))['catch'](handleError(_0x561d43,null));};exports['getSubjects']=function(_0x3179aa,_0x5ca533,_0x13e2d0){var _0x21c1b8={};var _0x2d1d96={};var _0x9ab116;var _0x5eb265;return db[_0x24a7('0x29')]['findOne']({'where':{'id':_0x3179aa['params']['id']}})[_0x24a7('0x22')](handleEntityNotFound(_0x5ca533,null))[_0x24a7('0x22')](function(_0x1385a7){if(_0x1385a7){_0x9ab116=_0x1385a7;_0x2d1d96['model']=_[_0x24a7('0x2e')](db[_0x24a7('0x4a')][_0x24a7('0x2a')]);_0x2d1d96[_0x24a7('0x2d')]=_[_0x24a7('0x2e')](_0x3179aa[_0x24a7('0x2d')]);_0x2d1d96[_0x24a7('0x2f')]=_[_0x24a7('0x32')](_0x2d1d96[_0x24a7('0x30')],_0x2d1d96[_0x24a7('0x2d')]);_0x21c1b8[_0x24a7('0x31')]=_[_0x24a7('0x32')](_0x2d1d96[_0x24a7('0x30')],qs[_0x24a7('0x33')](_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x33')]));_0x21c1b8[_0x24a7('0x31')]=_0x21c1b8['attributes'][_0x24a7('0x34')]?_0x21c1b8[_0x24a7('0x31')]:_0x2d1d96[_0x24a7('0x30')];_0x21c1b8[_0x24a7('0x37')]=qs['sort'](_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x38')]);_0x21c1b8[_0x24a7('0x39')]=qs[_0x24a7('0x2f')](_[_0x24a7('0x3a')](_0x3179aa[_0x24a7('0x2d')],_0x2d1d96[_0x24a7('0x2f')]));if(_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x3d')]){_0x21c1b8[_0x24a7('0x39')]=_[_0x24a7('0x3e')](_0x21c1b8[_0x24a7('0x39')],{'$or':_['map'](_0x21c1b8['attributes'],function(_0x226506){var _0x205cae={};_0x205cae[_0x226506]={'$like':'%'+_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x3d')]+'%'};return _0x205cae;})});}_0x21c1b8=_[_0x24a7('0x3e')]({},_0x21c1b8,_0x3179aa[_0x24a7('0x3f')]);return _0x9ab116[_0x24a7('0x4b')](_0x21c1b8);}})[_0x24a7('0x22')](function(_0x5702c9){if(_0x5702c9){_0x5eb265=_0x5702c9[_0x24a7('0x34')];if(!_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x35')](_0x24a7('0x36'))){_0x21c1b8[_0x24a7('0x1d')]=qs[_0x24a7('0x1d')](_0x3179aa[_0x24a7('0x2d')][_0x24a7('0x1d')]);_0x21c1b8[_0x24a7('0x1a')]=qs[_0x24a7('0x1a')](_0x3179aa['query'][_0x24a7('0x1a')]);}return _0x9ab116['getSubjects'](_0x21c1b8);}})['then'](function(_0x1b49b9){if(_0x1b49b9){return _0x1b49b9?{'count':_0x5eb265,'rows':_0x1b49b9}:null;}})[_0x24a7('0x22')](respondWithResult(_0x5ca533,null))[_0x24a7('0x44')](handleError(_0x5ca533,null));};exports[_0x24a7('0x4c')]=function(_0x5ca077,_0xaac02e,_0x4f7624){var _0x38a1f5={};var _0x5d6f00={};var _0x59da76;var _0x463224;return db['ZendeskConfiguration'][_0x24a7('0x49')]({'where':{'id':_0x5ca077[_0x24a7('0x43')]['id']}})['then'](handleEntityNotFound(_0xaac02e,null))[_0x24a7('0x22')](function(_0x193909){if(_0x193909){_0x59da76=_0x193909;_0x5d6f00[_0x24a7('0x30')]=_[_0x24a7('0x2e')](db[_0x24a7('0x4a')][_0x24a7('0x2a')]);_0x5d6f00[_0x24a7('0x2d')]=_['keys'](_0x5ca077[_0x24a7('0x2d')]);_0x5d6f00[_0x24a7('0x2f')]=_[_0x24a7('0x32')](_0x5d6f00[_0x24a7('0x30')],_0x5d6f00['query']);_0x38a1f5[_0x24a7('0x31')]=_['intersection'](_0x5d6f00[_0x24a7('0x30')],qs['fields'](_0x5ca077[_0x24a7('0x2d')][_0x24a7('0x33')]));_0x38a1f5[_0x24a7('0x31')]=_0x38a1f5[_0x24a7('0x31')][_0x24a7('0x34')]?_0x38a1f5['attributes']:_0x5d6f00[_0x24a7('0x30')];_0x38a1f5[_0x24a7('0x37')]=qs[_0x24a7('0x38')](_0x5ca077[_0x24a7('0x2d')][_0x24a7('0x38')]);_0x38a1f5[_0x24a7('0x39')]=qs[_0x24a7('0x2f')](_['pick'](_0x5ca077['query'],_0x5d6f00[_0x24a7('0x2f')]));if(_0x5ca077[_0x24a7('0x2d')][_0x24a7('0x3d')]){_0x38a1f5['where']=_[_0x24a7('0x3e')](_0x38a1f5[_0x24a7('0x39')],{'$or':_[_0x24a7('0x28')](_0x38a1f5[_0x24a7('0x31')],function(_0x18a4c0){var _0x557043={};_0x557043[_0x18a4c0]={'$like':'%'+_0x5ca077['query'][_0x24a7('0x3d')]+'%'};return _0x557043;})});}_0x38a1f5=_[_0x24a7('0x3e')]({},_0x38a1f5,_0x5ca077['options']);return _0x59da76[_0x24a7('0x4c')](_0x38a1f5);}})[_0x24a7('0x22')](function(_0x1f76f9){if(_0x1f76f9){_0x463224=_0x1f76f9['length'];if(!_0x5ca077['query'][_0x24a7('0x35')](_0x24a7('0x36'))){_0x38a1f5[_0x24a7('0x1d')]=qs['limit'](_0x5ca077[_0x24a7('0x2d')][_0x24a7('0x1d')]);_0x38a1f5[_0x24a7('0x1a')]=qs[_0x24a7('0x1a')](_0x5ca077['query'][_0x24a7('0x1a')]);}return _0x59da76[_0x24a7('0x4c')](_0x38a1f5);}})[_0x24a7('0x22')](function(_0x17c864){if(_0x17c864){return _0x17c864?{'count':_0x463224,'rows':_0x17c864}:null;}})[_0x24a7('0x22')](respondWithResult(_0xaac02e,null))['catch'](handleError(_0xaac02e,null));};exports[_0x24a7('0x4d')]=function(_0x37ad59,_0x3e2604,_0xf553c){var _0x114647={};var _0x5e54b2={};var _0x5ecbf4;var _0x2004d4;return db[_0x24a7('0x29')][_0x24a7('0x49')]({'where':{'id':_0x37ad59[_0x24a7('0x43')]['id']}})[_0x24a7('0x22')](handleEntityNotFound(_0x3e2604,null))[_0x24a7('0x22')](function(_0x3d9e09){if(_0x3d9e09){_0x5ecbf4=_0x3d9e09;_0x5e54b2[_0x24a7('0x30')]=_[_0x24a7('0x2e')](db[_0x24a7('0x4e')][_0x24a7('0x2a')]);_0x5e54b2[_0x24a7('0x2d')]=_[_0x24a7('0x2e')](_0x37ad59[_0x24a7('0x2d')]);_0x5e54b2[_0x24a7('0x2f')]=_[_0x24a7('0x32')](_0x5e54b2[_0x24a7('0x30')],_0x5e54b2['query']);_0x114647[_0x24a7('0x31')]=_[_0x24a7('0x32')](_0x5e54b2[_0x24a7('0x30')],qs['fields'](_0x37ad59['query'][_0x24a7('0x33')]));_0x114647[_0x24a7('0x31')]=_0x114647[_0x24a7('0x31')]['length']?_0x114647['attributes']:_0x5e54b2['model'];_0x114647[_0x24a7('0x37')]=qs['sort'](_0x37ad59['query'][_0x24a7('0x38')]);_0x114647[_0x24a7('0x39')]=qs['filters'](_[_0x24a7('0x3a')](_0x37ad59[_0x24a7('0x2d')],_0x5e54b2[_0x24a7('0x2f')]));if(_0x37ad59[_0x24a7('0x2d')]['filter']){_0x114647[_0x24a7('0x39')]=_['merge'](_0x114647['where'],{'$or':_[_0x24a7('0x28')](_0x114647[_0x24a7('0x31')],function(_0x50ae64){var _0x359a01={};_0x359a01[_0x50ae64]={'$like':'%'+_0x37ad59[_0x24a7('0x2d')][_0x24a7('0x3d')]+'%'};return _0x359a01;})});}_0x114647=_[_0x24a7('0x3e')]({},_0x114647,_0x37ad59[_0x24a7('0x3f')]);return _0x5ecbf4['getTags'](_0x114647);}})['then'](function(_0x238ac4){if(_0x238ac4){_0x2004d4=_0x238ac4['length'];if(!_0x37ad59['query']['hasOwnProperty'](_0x24a7('0x36'))){_0x114647[_0x24a7('0x1d')]=qs[_0x24a7('0x1d')](_0x37ad59[_0x24a7('0x2d')][_0x24a7('0x1d')]);_0x114647['offset']=qs[_0x24a7('0x1a')](_0x37ad59[_0x24a7('0x2d')][_0x24a7('0x1a')]);}return _0x5ecbf4[_0x24a7('0x4d')](_0x114647);}})['then'](function(_0x201be6){if(_0x201be6){return _0x201be6?{'count':_0x2004d4,'rows':_0x201be6}:null;}})[_0x24a7('0x22')](respondWithResult(_0x3e2604,null))[_0x24a7('0x44')](handleError(_0x3e2604,null));};exports[_0x24a7('0x4f')]=function(_0x3b40b6,_0x207962,_0x6f59ac){if(_0x3b40b6[_0x24a7('0x46')]['id']){delete _0x3b40b6[_0x24a7('0x46')]['id'];}return db[_0x24a7('0x29')]['findOne']({'where':{'id':_0x3b40b6['params']['id']}})[_0x24a7('0x22')](handleEntityNotFound(_0x207962,null))[_0x24a7('0x22')](function(_0x2b3c69){if(_0x2b3c69){return _0x2b3c69[_0x24a7('0x4f')](_0x3b40b6[_0x24a7('0x46')][_0x24a7('0x50')]||[]);}return null;})[_0x24a7('0x22')](respondWithResult(_0x207962,null))[_0x24a7('0x44')](handleError(_0x207962,null));}; \ No newline at end of file +var _0x034e=['fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','ZendeskConfiguration','length','includeAll','find','create','body','findOne','ZendeskField','rawAttributes','getFields','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','update','then','error','stack','name','index','map'];(function(_0x1c67a2,_0x599648){var _0x4fbd8e=function(_0x2e465b){while(--_0x2e465b){_0x1c67a2['push'](_0x1c67a2['shift']());}};_0x4fbd8e(++_0x599648);}(_0x034e,0x11c));var _0xe034=function(_0x2e2f34,_0x24d010){_0x2e2f34=_0x2e2f34-0x0;var _0x84096=_0x034e[_0x2e2f34];return _0x84096;};'use strict';var emlformat=require(_0xe034('0x0'));var rimraf=require(_0xe034('0x1'));var zipdir=require(_0xe034('0x2'));var jsonpatch=require(_0xe034('0x3'));var rp=require(_0xe034('0x4'));var moment=require('moment');var BPromise=require(_0xe034('0x5'));var Mustache=require(_0xe034('0x6'));var util=require('util');var path=require(_0xe034('0x7'));var sox=require('sox');var csv=require(_0xe034('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe034('0x9'));var _=require(_0xe034('0xa'));var squel=require(_0xe034('0xb'));var crypto=require('crypto');var jsforce=require(_0xe034('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe034('0x8'));var querystring=require(_0xe034('0xd'));var Papa=require(_0xe034('0xe'));var Redis=require('ioredis');var authService=require(_0xe034('0xf'));var qs=require(_0xe034('0x10'));var as=require(_0xe034('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe034('0x12'))(_0xe034('0x13'));var utils=require(_0xe034('0x14'));var config=require(_0xe034('0x15'));var licenseUtil=require(_0xe034('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x285792,_0x20556a){_0x20556a=_0x20556a||0xcc;return function(_0x1ad854){if(_0x1ad854){return _0x285792[_0xe034('0x17')](_0x20556a);}return _0x285792[_0xe034('0x18')](_0x20556a)[_0xe034('0x19')]();};}function respondWithResult(_0x27bbbd,_0x65ffc8){_0x65ffc8=_0x65ffc8||0xc8;return function(_0x4e0261){if(_0x4e0261){return _0x27bbbd[_0xe034('0x18')](_0x65ffc8)['json'](_0x4e0261);}};}function respondWithFilteredResult(_0x328afa,_0x36d73f){return function(_0x371b97){if(_0x371b97){var _0x2a0671=typeof _0x36d73f[_0xe034('0x1a')]===_0xe034('0x1b')&&typeof _0x36d73f['limit']==='undefined';var _0x55f0f5=_0x371b97['count'];var _0x535d9e=_0x2a0671?0x0:_0x36d73f[_0xe034('0x1a')];var _0x16d935=_0x2a0671?_0x371b97[_0xe034('0x1c')]:_0x36d73f[_0xe034('0x1a')]+_0x36d73f['limit'];var _0x35d5e2;if(_0x16d935>=_0x55f0f5){_0x16d935=_0x55f0f5;_0x35d5e2=0xc8;}else{_0x35d5e2=0xce;}_0x328afa[_0xe034('0x18')](_0x35d5e2);return _0x328afa[_0xe034('0x1d')](_0xe034('0x1e'),_0x535d9e+'-'+_0x16d935+'/'+_0x55f0f5)[_0xe034('0x1f')](_0x371b97);}return null;};}function patchUpdates(_0x1d18d9){return function(_0x71a434){try{jsonpatch['apply'](_0x71a434,_0x1d18d9,!![]);}catch(_0xe3840c){return BPromise['reject'](_0xe3840c);}return _0x71a434[_0xe034('0x20')]();};}function saveUpdates(_0x12fdec,_0x361e61){return function(_0x275a73){if(_0x275a73){return _0x275a73[_0xe034('0x21')](_0x12fdec)[_0xe034('0x22')](function(_0x115113){return _0x115113;});}return null;};}function removeEntity(_0x47c78a,_0x2451bf){return function(_0x17bd72){if(_0x17bd72){return _0x17bd72['destroy']()[_0xe034('0x22')](function(){_0x47c78a['status'](0xcc)[_0xe034('0x19')]();});}};}function handleEntityNotFound(_0x15153c,_0x10da05){return function(_0x23514b){if(!_0x23514b){_0x15153c[_0xe034('0x17')](0x194);}return _0x23514b;};}function handleError(_0x55742b,_0x451a53){_0x451a53=_0x451a53||0x1f4;return function(_0x180777){logger[_0xe034('0x23')](_0x180777[_0xe034('0x24')]);if(_0x180777['name']){delete _0x180777[_0xe034('0x25')];}_0x55742b[_0xe034('0x18')](_0x451a53)['send'](_0x180777);};}exports[_0xe034('0x26')]=function(_0x25445d,_0x3746d1){var _0x578d3d={},_0x164dca={},_0x14b765={'count':0x0,'rows':[]};var _0x4d9243=_[_0xe034('0x27')](db['ZendeskConfiguration']['rawAttributes'],function(_0x12635c){return{'name':_0x12635c[_0xe034('0x28')],'type':_0x12635c[_0xe034('0x29')][_0xe034('0x2a')]};});_0x164dca['model']=_[_0xe034('0x27')](_0x4d9243,_0xe034('0x25'));_0x164dca['query']=_[_0xe034('0x2b')](_0x25445d[_0xe034('0x2c')]);_0x164dca[_0xe034('0x2d')]=_['intersection'](_0x164dca[_0xe034('0x2e')],_0x164dca[_0xe034('0x2c')]);_0x578d3d[_0xe034('0x2f')]=_[_0xe034('0x30')](_0x164dca[_0xe034('0x2e')],qs[_0xe034('0x31')](_0x25445d[_0xe034('0x2c')][_0xe034('0x31')]));_0x578d3d['attributes']=_0x578d3d[_0xe034('0x2f')]['length']?_0x578d3d['attributes']:_0x164dca[_0xe034('0x2e')];if(!_0x25445d[_0xe034('0x2c')][_0xe034('0x32')]('nolimit')){_0x578d3d[_0xe034('0x33')]=qs['limit'](_0x25445d['query'][_0xe034('0x33')]);_0x578d3d[_0xe034('0x1a')]=qs['offset'](_0x25445d[_0xe034('0x2c')]['offset']);}_0x578d3d[_0xe034('0x34')]=qs[_0xe034('0x35')](_0x25445d[_0xe034('0x2c')][_0xe034('0x35')]);_0x578d3d[_0xe034('0x36')]=qs['filters'](_[_0xe034('0x37')](_0x25445d[_0xe034('0x2c')],_0x164dca['filters']),_0x4d9243);if(_0x25445d['query']['filter']){_0x578d3d['where']=_['merge'](_0x578d3d[_0xe034('0x36')],{'$or':_[_0xe034('0x27')](_0x4d9243,function(_0x453336){if(_0x453336[_0xe034('0x29')]!==_0xe034('0x38')){var _0x125829={};_0x125829[_0x453336[_0xe034('0x25')]]={'$like':'%'+_0x25445d[_0xe034('0x2c')][_0xe034('0x39')]+'%'};return _0x125829;}})});}_0x578d3d=_[_0xe034('0x3a')]({},_0x578d3d,_0x25445d[_0xe034('0x3b')]);var _0x1d3407={'where':_0x578d3d[_0xe034('0x36')]};return db['ZendeskConfiguration'][_0xe034('0x1c')](_0x1d3407)[_0xe034('0x22')](function(_0x54c685){_0x14b765[_0xe034('0x1c')]=_0x54c685;if(_0x25445d[_0xe034('0x2c')]['includeAll']){_0x578d3d[_0xe034('0x3c')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xe034('0x3d')](_0x578d3d);})['then'](function(_0x2a409e){_0x14b765[_0xe034('0x3e')]=_0x2a409e;return _0x14b765;})[_0xe034('0x22')](respondWithFilteredResult(_0x3746d1,_0x578d3d))[_0xe034('0x3f')](handleError(_0x3746d1,null));};exports[_0xe034('0x40')]=function(_0x1949ae,_0x2fe878){var _0x426314={'raw':![],'where':{'id':_0x1949ae[_0xe034('0x41')]['id']}},_0x22215a={};_0x22215a[_0xe034('0x2e')]=_[_0xe034('0x2b')](db[_0xe034('0x42')]['rawAttributes']);_0x22215a[_0xe034('0x2c')]=_[_0xe034('0x2b')](_0x1949ae['query']);_0x22215a['filters']=_['intersection'](_0x22215a[_0xe034('0x2e')],_0x22215a[_0xe034('0x2c')]);_0x426314[_0xe034('0x2f')]=_[_0xe034('0x30')](_0x22215a['model'],qs[_0xe034('0x31')](_0x1949ae['query'][_0xe034('0x31')]));_0x426314['attributes']=_0x426314['attributes'][_0xe034('0x43')]?_0x426314[_0xe034('0x2f')]:_0x22215a[_0xe034('0x2e')];if(_0x1949ae['query'][_0xe034('0x44')]){_0x426314['include']=[{'all':!![]}];}_0x426314=_[_0xe034('0x3a')]({},_0x426314,_0x1949ae[_0xe034('0x3b')]);return db[_0xe034('0x42')][_0xe034('0x45')](_0x426314)[_0xe034('0x22')](handleEntityNotFound(_0x2fe878,null))[_0xe034('0x22')](respondWithResult(_0x2fe878,null))[_0xe034('0x3f')](handleError(_0x2fe878,null));};exports[_0xe034('0x46')]=function(_0x352cde,_0x2d7195){return db['ZendeskConfiguration'][_0xe034('0x46')](_0x352cde[_0xe034('0x47')],{})['then'](respondWithResult(_0x2d7195,0xc9))[_0xe034('0x3f')](handleError(_0x2d7195,null));};exports[_0xe034('0x21')]=function(_0x17b5a6,_0x1d3e71){if(_0x17b5a6[_0xe034('0x47')]['id']){delete _0x17b5a6[_0xe034('0x47')]['id'];}return db[_0xe034('0x42')][_0xe034('0x45')]({'where':{'id':_0x17b5a6[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x1d3e71,null))[_0xe034('0x22')](saveUpdates(_0x17b5a6[_0xe034('0x47')],null))[_0xe034('0x22')](respondWithResult(_0x1d3e71,null))['catch'](handleError(_0x1d3e71,null));};exports['destroy']=function(_0x2e5adb,_0x53f4c4){return db[_0xe034('0x42')][_0xe034('0x45')]({'where':{'id':_0x2e5adb[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x53f4c4,null))[_0xe034('0x22')](removeEntity(_0x53f4c4,null))[_0xe034('0x3f')](handleError(_0x53f4c4,null));};exports['getFields']=function(_0xf6b145,_0x1d8fde,_0x1bf109){var _0x970b67={};var _0xe719a1={};var _0x34df4f;var _0x5d0472;return db['ZendeskConfiguration'][_0xe034('0x48')]({'where':{'id':_0xf6b145[_0xe034('0x41')]['id']}})['then'](handleEntityNotFound(_0x1d8fde,null))[_0xe034('0x22')](function(_0x165aff){if(_0x165aff){_0x34df4f=_0x165aff;_0xe719a1[_0xe034('0x2e')]=_[_0xe034('0x2b')](db[_0xe034('0x49')][_0xe034('0x4a')]);_0xe719a1[_0xe034('0x2c')]=_[_0xe034('0x2b')](_0xf6b145[_0xe034('0x2c')]);_0xe719a1[_0xe034('0x2d')]=_[_0xe034('0x30')](_0xe719a1[_0xe034('0x2e')],_0xe719a1[_0xe034('0x2c')]);_0x970b67['attributes']=_['intersection'](_0xe719a1['model'],qs[_0xe034('0x31')](_0xf6b145['query'][_0xe034('0x31')]));_0x970b67[_0xe034('0x2f')]=_0x970b67[_0xe034('0x2f')][_0xe034('0x43')]?_0x970b67[_0xe034('0x2f')]:_0xe719a1['model'];_0x970b67[_0xe034('0x34')]=qs[_0xe034('0x35')](_0xf6b145[_0xe034('0x2c')][_0xe034('0x35')]);_0x970b67[_0xe034('0x36')]=qs[_0xe034('0x2d')](_[_0xe034('0x37')](_0xf6b145[_0xe034('0x2c')],_0xe719a1[_0xe034('0x2d')]));if(_0xf6b145[_0xe034('0x2c')][_0xe034('0x39')]){_0x970b67[_0xe034('0x36')]=_['merge'](_0x970b67[_0xe034('0x36')],{'$or':_['map'](_0x970b67['attributes'],function(_0x1bb3a7){var _0x190aff={};_0x190aff[_0x1bb3a7]={'$like':'%'+_0xf6b145['query'][_0xe034('0x39')]+'%'};return _0x190aff;})});}_0x970b67=_[_0xe034('0x3a')]({},_0x970b67,_0xf6b145[_0xe034('0x3b')]);return _0x34df4f[_0xe034('0x4b')](_0x970b67);}})[_0xe034('0x22')](function(_0x561a58){if(_0x561a58){_0x5d0472=_0x561a58['length'];if(!_0xf6b145[_0xe034('0x2c')]['hasOwnProperty'](_0xe034('0x4c'))){_0x970b67['limit']=qs[_0xe034('0x33')](_0xf6b145['query'][_0xe034('0x33')]);_0x970b67[_0xe034('0x1a')]=qs['offset'](_0xf6b145[_0xe034('0x2c')][_0xe034('0x1a')]);}return _0x34df4f[_0xe034('0x4b')](_0x970b67);}})[_0xe034('0x22')](function(_0x4d567b){if(_0x4d567b){return _0x4d567b?{'count':_0x5d0472,'rows':_0x4d567b}:null;}})[_0xe034('0x22')](respondWithResult(_0x1d8fde,null))['catch'](handleError(_0x1d8fde,null));};exports[_0xe034('0x4d')]=function(_0x59afa1,_0x1c0df5,_0x1f9a53){var _0xec5fb1={};var _0x355c6d={};var _0x352873;var _0x516c02;return db[_0xe034('0x42')][_0xe034('0x48')]({'where':{'id':_0x59afa1[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x1c0df5,null))[_0xe034('0x22')](function(_0x1783fd){if(_0x1783fd){_0x352873=_0x1783fd;_0x355c6d['model']=_[_0xe034('0x2b')](db['ZendeskField'][_0xe034('0x4a')]);_0x355c6d[_0xe034('0x2c')]=_[_0xe034('0x2b')](_0x59afa1[_0xe034('0x2c')]);_0x355c6d[_0xe034('0x2d')]=_[_0xe034('0x30')](_0x355c6d[_0xe034('0x2e')],_0x355c6d[_0xe034('0x2c')]);_0xec5fb1[_0xe034('0x2f')]=_[_0xe034('0x30')](_0x355c6d[_0xe034('0x2e')],qs[_0xe034('0x31')](_0x59afa1['query']['fields']));_0xec5fb1[_0xe034('0x2f')]=_0xec5fb1['attributes'][_0xe034('0x43')]?_0xec5fb1[_0xe034('0x2f')]:_0x355c6d[_0xe034('0x2e')];_0xec5fb1[_0xe034('0x34')]=qs['sort'](_0x59afa1['query']['sort']);_0xec5fb1[_0xe034('0x36')]=qs['filters'](_[_0xe034('0x37')](_0x59afa1['query'],_0x355c6d[_0xe034('0x2d')]));if(_0x59afa1[_0xe034('0x2c')][_0xe034('0x39')]){_0xec5fb1[_0xe034('0x36')]=_[_0xe034('0x3a')](_0xec5fb1['where'],{'$or':_[_0xe034('0x27')](_0xec5fb1[_0xe034('0x2f')],function(_0x5a1381){var _0xfb502b={};_0xfb502b[_0x5a1381]={'$like':'%'+_0x59afa1['query']['filter']+'%'};return _0xfb502b;})});}_0xec5fb1=_['merge']({},_0xec5fb1,_0x59afa1[_0xe034('0x3b')]);return _0x352873['getSubjects'](_0xec5fb1);}})[_0xe034('0x22')](function(_0x4b79b4){if(_0x4b79b4){_0x516c02=_0x4b79b4[_0xe034('0x43')];if(!_0x59afa1[_0xe034('0x2c')][_0xe034('0x32')](_0xe034('0x4c'))){_0xec5fb1[_0xe034('0x33')]=qs[_0xe034('0x33')](_0x59afa1[_0xe034('0x2c')]['limit']);_0xec5fb1[_0xe034('0x1a')]=qs[_0xe034('0x1a')](_0x59afa1[_0xe034('0x2c')][_0xe034('0x1a')]);}return _0x352873[_0xe034('0x4d')](_0xec5fb1);}})['then'](function(_0x40cfc7){if(_0x40cfc7){return _0x40cfc7?{'count':_0x516c02,'rows':_0x40cfc7}:null;}})['then'](respondWithResult(_0x1c0df5,null))[_0xe034('0x3f')](handleError(_0x1c0df5,null));};exports['getDescriptions']=function(_0x568608,_0x189cb4,_0x482fd6){var _0x1c77eb={};var _0x28d546={};var _0x3d858b;var _0x45edca;return db[_0xe034('0x42')][_0xe034('0x48')]({'where':{'id':_0x568608[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x189cb4,null))[_0xe034('0x22')](function(_0x288d74){if(_0x288d74){_0x3d858b=_0x288d74;_0x28d546[_0xe034('0x2e')]=_[_0xe034('0x2b')](db['ZendeskField'][_0xe034('0x4a')]);_0x28d546[_0xe034('0x2c')]=_['keys'](_0x568608[_0xe034('0x2c')]);_0x28d546[_0xe034('0x2d')]=_['intersection'](_0x28d546['model'],_0x28d546[_0xe034('0x2c')]);_0x1c77eb[_0xe034('0x2f')]=_['intersection'](_0x28d546['model'],qs['fields'](_0x568608[_0xe034('0x2c')][_0xe034('0x31')]));_0x1c77eb['attributes']=_0x1c77eb[_0xe034('0x2f')]['length']?_0x1c77eb['attributes']:_0x28d546[_0xe034('0x2e')];_0x1c77eb['order']=qs[_0xe034('0x35')](_0x568608['query'][_0xe034('0x35')]);_0x1c77eb[_0xe034('0x36')]=qs[_0xe034('0x2d')](_[_0xe034('0x37')](_0x568608[_0xe034('0x2c')],_0x28d546[_0xe034('0x2d')]));if(_0x568608[_0xe034('0x2c')][_0xe034('0x39')]){_0x1c77eb[_0xe034('0x36')]=_['merge'](_0x1c77eb['where'],{'$or':_[_0xe034('0x27')](_0x1c77eb[_0xe034('0x2f')],function(_0xf2a15a){var _0x40d23b={};_0x40d23b[_0xf2a15a]={'$like':'%'+_0x568608[_0xe034('0x2c')]['filter']+'%'};return _0x40d23b;})});}_0x1c77eb=_['merge']({},_0x1c77eb,_0x568608[_0xe034('0x3b')]);return _0x3d858b[_0xe034('0x4e')](_0x1c77eb);}})[_0xe034('0x22')](function(_0x504556){if(_0x504556){_0x45edca=_0x504556[_0xe034('0x43')];if(!_0x568608['query'][_0xe034('0x32')](_0xe034('0x4c'))){_0x1c77eb[_0xe034('0x33')]=qs[_0xe034('0x33')](_0x568608[_0xe034('0x2c')][_0xe034('0x33')]);_0x1c77eb[_0xe034('0x1a')]=qs[_0xe034('0x1a')](_0x568608[_0xe034('0x2c')][_0xe034('0x1a')]);}return _0x3d858b[_0xe034('0x4e')](_0x1c77eb);}})[_0xe034('0x22')](function(_0x58600a){if(_0x58600a){return _0x58600a?{'count':_0x45edca,'rows':_0x58600a}:null;}})[_0xe034('0x22')](respondWithResult(_0x189cb4,null))[_0xe034('0x3f')](handleError(_0x189cb4,null));};exports[_0xe034('0x4f')]=function(_0xd52b84,_0x53d8a9,_0x53334a){var _0x3a0b7e={};var _0x2dd50d={};var _0x5ed2f8;var _0x22a02f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xd52b84[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x53d8a9,null))[_0xe034('0x22')](function(_0x530394){if(_0x530394){_0x5ed2f8=_0x530394;_0x2dd50d[_0xe034('0x2e')]=_['keys'](db['Tag'][_0xe034('0x4a')]);_0x2dd50d['query']=_[_0xe034('0x2b')](_0xd52b84[_0xe034('0x2c')]);_0x2dd50d[_0xe034('0x2d')]=_[_0xe034('0x30')](_0x2dd50d[_0xe034('0x2e')],_0x2dd50d['query']);_0x3a0b7e[_0xe034('0x2f')]=_[_0xe034('0x30')](_0x2dd50d[_0xe034('0x2e')],qs['fields'](_0xd52b84[_0xe034('0x2c')]['fields']));_0x3a0b7e[_0xe034('0x2f')]=_0x3a0b7e[_0xe034('0x2f')][_0xe034('0x43')]?_0x3a0b7e['attributes']:_0x2dd50d[_0xe034('0x2e')];_0x3a0b7e[_0xe034('0x34')]=qs[_0xe034('0x35')](_0xd52b84[_0xe034('0x2c')][_0xe034('0x35')]);_0x3a0b7e[_0xe034('0x36')]=qs['filters'](_[_0xe034('0x37')](_0xd52b84[_0xe034('0x2c')],_0x2dd50d[_0xe034('0x2d')]));if(_0xd52b84[_0xe034('0x2c')][_0xe034('0x39')]){_0x3a0b7e['where']=_[_0xe034('0x3a')](_0x3a0b7e['where'],{'$or':_[_0xe034('0x27')](_0x3a0b7e[_0xe034('0x2f')],function(_0x1e99b1){var _0x39b507={};_0x39b507[_0x1e99b1]={'$like':'%'+_0xd52b84[_0xe034('0x2c')]['filter']+'%'};return _0x39b507;})});}_0x3a0b7e=_[_0xe034('0x3a')]({},_0x3a0b7e,_0xd52b84[_0xe034('0x3b')]);return _0x5ed2f8[_0xe034('0x4f')](_0x3a0b7e);}})[_0xe034('0x22')](function(_0x156c77){if(_0x156c77){_0x22a02f=_0x156c77[_0xe034('0x43')];if(!_0xd52b84[_0xe034('0x2c')][_0xe034('0x32')](_0xe034('0x4c'))){_0x3a0b7e[_0xe034('0x33')]=qs[_0xe034('0x33')](_0xd52b84[_0xe034('0x2c')][_0xe034('0x33')]);_0x3a0b7e[_0xe034('0x1a')]=qs['offset'](_0xd52b84[_0xe034('0x2c')]['offset']);}return _0x5ed2f8[_0xe034('0x4f')](_0x3a0b7e);}})[_0xe034('0x22')](function(_0x4ac44){if(_0x4ac44){return _0x4ac44?{'count':_0x22a02f,'rows':_0x4ac44}:null;}})[_0xe034('0x22')](respondWithResult(_0x53d8a9,null))[_0xe034('0x3f')](handleError(_0x53d8a9,null));};exports['setTags']=function(_0x590629,_0x66cb83,_0x5eeb6a){if(_0x590629['body']['id']){delete _0x590629[_0xe034('0x47')]['id'];}return db[_0xe034('0x42')]['findOne']({'where':{'id':_0x590629[_0xe034('0x41')]['id']}})[_0xe034('0x22')](handleEntityNotFound(_0x66cb83,null))[_0xe034('0x22')](function(_0x27ef8b){if(_0x27ef8b){return _0x27ef8b[_0xe034('0x50')](_0x590629[_0xe034('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x66cb83,null))[_0xe034('0x3f')](handleError(_0x66cb83,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4ab8cff..553e453 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 _0x32b6=['moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api'];(function(_0x4b93bb,_0x4d425c){var _0x388fb4=function(_0x1186ee){while(--_0x1186ee){_0x4b93bb['push'](_0x4b93bb['shift']());}};_0x388fb4(++_0x4d425c);}(_0x32b6,0x1d1));var _0x632b=function(_0x575e65,_0x302cc6){_0x575e65=_0x575e65-0x0;var _0x5f39d5=_0x32b6[_0x575e65];return _0x5f39d5;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c9a=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x5057ff,_0x2ed29e){var _0x4ccfd4=function(_0x64684f){while(--_0x64684f){_0x5057ff['push'](_0x5057ff['shift']());}};_0x4ccfd4(++_0x2ed29e);}(_0x1c9a,0x98));var _0xa1c9=function(_0x322a54,_0x5b4337){_0x322a54=_0x322a54-0x0;var _0x189e73=_0x1c9a[_0x322a54];return _0x189e73;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var logger=require(_0xa1c9('0x1'))('api');var moment=require(_0xa1c9('0x2'));var BPromise=require(_0xa1c9('0x3'));var rp=require(_0xa1c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c9('0x5'));var config=require(_0xa1c9('0x6'));var attributes=require(_0xa1c9('0x7'));module[_0xa1c9('0x8')]=function(_0x572229,_0x144e91){return _0x572229['define'](_0xa1c9('0x9'),attributes,{'tableName':_0xa1c9('0xa'),'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 9fb73d4..7748d0a 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 _0x5dec=['../../config/logger','../../config/environment','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x5dec,0x78));var _0xc5de=function(_0x512738,_0x52ef6b){_0x512738=_0x512738-0x0;var _0x1bdb2b=_0x5dec[_0x512738];return _0x1bdb2b;};'use strict';var _=require(_0xc5de('0x0'));var util=require(_0xc5de('0x1'));var moment=require(_0xc5de('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5de('0x3'));var fs=require('fs');var Redis=require(_0xc5de('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5de('0x5'));var logger=require(_0xc5de('0x6'))('rpc');var config=require(_0xc5de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc5de('0x8')][_0xc5de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd774ae,_0xfbe262,_0x54b8ac){return new BPromise(function(_0xb37bb,_0x58a7c6){return client[_0xc5de('0xa')](_0xd774ae,_0x54b8ac)['then'](function(_0x4602d5){logger['info'](_0xc5de('0xb'),_0xfbe262,'request\x20sent');logger[_0xc5de('0xc')](_0xc5de('0xd'),_0xfbe262,_0xc5de('0xe'),JSON[_0xc5de('0xf')](_0x4602d5));if(_0x4602d5[_0xc5de('0x10')]){if(_0x4602d5[_0xc5de('0x10')][_0xc5de('0x11')]===0x1f4){logger[_0xc5de('0x10')](_0xc5de('0xb'),_0xfbe262,_0x4602d5[_0xc5de('0x10')][_0xc5de('0x12')]);return _0x58a7c6(_0x4602d5[_0xc5de('0x10')]['message']);}logger[_0xc5de('0x10')](_0xc5de('0xb'),_0xfbe262,_0x4602d5[_0xc5de('0x10')]['message']);return _0xb37bb(_0x4602d5[_0xc5de('0x10')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xfbe262,_0xc5de('0xe'));_0xb37bb(_0x4602d5[_0xc5de('0x13')][_0xc5de('0x12')]);}})[_0xc5de('0x14')](function(_0x27bd10){logger[_0xc5de('0x10')](_0xc5de('0xb'),_0xfbe262,_0x27bd10);_0x58a7c6(_0x27bd10);});});} \ No newline at end of file +var _0x3c1d=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x33bea0,_0x35b285){var _0x29c325=function(_0x15a1f4){while(--_0x15a1f4){_0x33bea0['push'](_0x33bea0['shift']());}};_0x29c325(++_0x35b285);}(_0x3c1d,0xaa));var _0xd3c1=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x3c1d[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xd3c1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd3c1('0x1'));var rs=require(_0xd3c1('0x2'));var fs=require('fs');var Redis=require(_0xd3c1('0x3'));var db=require(_0xd3c1('0x4'))['db'];var utils=require(_0xd3c1('0x5'));var logger=require(_0xd3c1('0x6'))('rpc');var config=require(_0xd3c1('0x7'));var jayson=require(_0xd3c1('0x8'));var client=jayson[_0xd3c1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482f8d,_0x56a6f2,_0x4a0b27){return new BPromise(function(_0x30364d,_0x2f617e){return client['request'](_0x482f8d,_0x4a0b27)[_0xd3c1('0xa')](function(_0x5af1a7){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x56a6f2,_0xd3c1('0xb'));logger[_0xd3c1('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x56a6f2,_0xd3c1('0xb'),JSON[_0xd3c1('0xd')](_0x5af1a7));if(_0x5af1a7['error']){if(_0x5af1a7[_0xd3c1('0xe')][_0xd3c1('0xf')]===0x1f4){logger[_0xd3c1('0xe')](_0xd3c1('0x10'),_0x56a6f2,_0x5af1a7[_0xd3c1('0xe')][_0xd3c1('0x11')]);return _0x2f617e(_0x5af1a7[_0xd3c1('0xe')][_0xd3c1('0x11')]);}logger[_0xd3c1('0xe')](_0xd3c1('0x10'),_0x56a6f2,_0x5af1a7[_0xd3c1('0xe')]['message']);return _0x30364d(_0x5af1a7[_0xd3c1('0xe')]['message']);}else{logger[_0xd3c1('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x56a6f2,'request\x20sent');_0x30364d(_0x5af1a7[_0xd3c1('0x13')][_0xd3c1('0x11')]);}})[_0xd3c1('0x14')](function(_0x2f736e){logger[_0xd3c1('0xe')](_0xd3c1('0x10'),_0x56a6f2,_0x2f736e);_0x2f617e(_0x2f736e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 979aff7..00a6a1d 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 _0x4149=['get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x368682,_0x56698f){var _0x2bc428=function(_0x1255a2){while(--_0x1255a2){_0x368682['push'](_0x368682['shift']());}};_0x2bc428(++_0x56698f);}(_0x4149,0x13b));var _0x9414=function(_0x271ce9,_0x20240c){_0x271ce9=_0x271ce9-0x0;var _0x12683d=_0x4149[_0x271ce9];return _0x12683d;};'use strict';var multer=require(_0x9414('0x0'));var util=require(_0x9414('0x1'));var path=require('path');var timeout=require(_0x9414('0x2'));var express=require(_0x9414('0x3'));var router=express['Router']();var fs_extra=require(_0x9414('0x4'));var auth=require(_0x9414('0x5'));var interaction=require(_0x9414('0x6'));var config=require(_0x9414('0x7'));var controller=require(_0x9414('0x8'));router[_0x9414('0x9')]('/',auth[_0x9414('0xa')](),controller['index']);router['get'](_0x9414('0xb'),auth['isAuthenticated'](),controller[_0x9414('0xc')]);router['post']('/',auth[_0x9414('0xa')](),controller[_0x9414('0xd')]);router[_0x9414('0xe')](_0x9414('0xb'),auth[_0x9414('0xa')](),controller[_0x9414('0xf')]);router['delete'](_0x9414('0xb'),auth['isAuthenticated'](),controller[_0x9414('0x10')]);module[_0x9414('0x11')]=router; \ No newline at end of file +var _0x7841=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','update','delete','destroy','exports','multer'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x7841,0x11f));var _0x1784=function(_0x20259c,_0xe43fb2){_0x20259c=_0x20259c-0x0;var _0x4d988e=_0x7841[_0x20259c];return _0x4d988e;};'use strict';var multer=require(_0x1784('0x0'));var util=require(_0x1784('0x1'));var path=require(_0x1784('0x2'));var timeout=require('connect-timeout');var express=require(_0x1784('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1784('0x4'));var interaction=require(_0x1784('0x5'));var config=require(_0x1784('0x6'));var controller=require('./intZendeskField.controller');router[_0x1784('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1784('0x7')]('/:id',auth[_0x1784('0x8')](),controller[_0x1784('0x9')]);router[_0x1784('0xa')]('/',auth[_0x1784('0x8')](),controller[_0x1784('0xb')]);router['put']('/:id',auth[_0x1784('0x8')](),controller[_0x1784('0xc')]);router[_0x1784('0xd')]('/:id',auth[_0x1784('0x8')](),controller[_0x1784('0xe')]);module[_0x1784('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 32d1f62..6a78c45 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 _0xd551=['keyValue','picklist','STRING','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x145150,_0x1b011c){var _0x4e6d3f=function(_0x154782){while(--_0x154782){_0x145150['push'](_0x145150['shift']());}};_0x4e6d3f(++_0x1b011c);}(_0xd551,0x10c));var _0x1d55=function(_0xc07088,_0x504f6c){_0xc07088=_0xc07088-0x0;var _0x4ec332=_0xd551[_0xc07088];return _0x4ec332;};'use strict';var Sequelize=require(_0x1d55('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1d55('0x1'),_0x1d55('0x2'),_0x1d55('0x3'),_0x1d55('0x4'),_0x1d55('0x5')),'defaultValue':_0x1d55('0x1')},'content':{'type':Sequelize[_0x1d55('0x6')]},'key':{'type':Sequelize[_0x1d55('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1d55('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1d55('0x6')]},'customField':{'type':Sequelize[_0x1d55('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d55('0x6')]}}; \ No newline at end of file +var _0x01f9=['picklist','STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x01f9,0x1cc));var _0x901f=function(_0x2d17af,_0x2ded06){_0x2d17af=_0x2d17af-0x0;var _0x4d8e00=_0x01f9[_0x2d17af];return _0x4d8e00;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x901f('0x0')](_0x901f('0x1'),_0x901f('0x2'),'customVariable',_0x901f('0x3'),_0x901f('0x4')),'defaultValue':_0x901f('0x1')},'content':{'type':Sequelize[_0x901f('0x5')]},'key':{'type':Sequelize[_0x901f('0x5')]},'keyType':{'type':Sequelize[_0x901f('0x0')]('string',_0x901f('0x2'),_0x901f('0x6'))},'keyContent':{'type':Sequelize[_0x901f('0x5')]},'idField':{'type':Sequelize[_0x901f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x901f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x901f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a2c34f6..6ae9e02 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 _0x1330=['count','limit','set','apply','reject','save','update','then','error','stack','name','index','map','ZendeskField','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','VIRTUAL','where','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined'];(function(_0x187ad0,_0x4f6ec1){var _0x14d8fe=function(_0x5bf4a3){while(--_0x5bf4a3){_0x187ad0['push'](_0x187ad0['shift']());}};_0x14d8fe(++_0x4f6ec1);}(_0x1330,0x1f4));var _0x0133=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0x1330[_0x10b1bb];return _0x2d4e05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0133('0x0'));var zipdir=require(_0x0133('0x1'));var jsonpatch=require(_0x0133('0x2'));var rp=require(_0x0133('0x3'));var moment=require('moment');var BPromise=require(_0x0133('0x4'));var Mustache=require(_0x0133('0x5'));var util=require(_0x0133('0x6'));var path=require(_0x0133('0x7'));var sox=require(_0x0133('0x8'));var csv=require(_0x0133('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0133('0xa'));var _=require(_0x0133('0xb'));var squel=require(_0x0133('0xc'));var crypto=require(_0x0133('0xd'));var jsforce=require(_0x0133('0xe'));var deskjs=require(_0x0133('0xf'));var toCsv=require(_0x0133('0x9'));var querystring=require(_0x0133('0x10'));var Papa=require(_0x0133('0x11'));var Redis=require(_0x0133('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0133('0x13'));var as=require(_0x0133('0x14'));var hardwareService=require(_0x0133('0x15'));var logger=require(_0x0133('0x16'))(_0x0133('0x17'));var utils=require(_0x0133('0x18'));var config=require(_0x0133('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1742b2,_0xdb76ab){_0xdb76ab=_0xdb76ab||0xcc;return function(_0x25824f){if(_0x25824f){return _0x1742b2[_0x0133('0x1a')](_0xdb76ab);}return _0x1742b2[_0x0133('0x1b')](_0xdb76ab)[_0x0133('0x1c')]();};}function respondWithResult(_0x1e7901,_0xea20aa){_0xea20aa=_0xea20aa||0xc8;return function(_0x2a9860){if(_0x2a9860){return _0x1e7901[_0x0133('0x1b')](_0xea20aa)[_0x0133('0x1d')](_0x2a9860);}};}function respondWithFilteredResult(_0x5845a,_0x2d2e54){return function(_0x1504dc){if(_0x1504dc){var _0x21790a=typeof _0x2d2e54[_0x0133('0x1e')]===_0x0133('0x1f')&&typeof _0x2d2e54['limit']===_0x0133('0x1f');var _0x525294=_0x1504dc[_0x0133('0x20')];var _0xc0de52=_0x21790a?0x0:_0x2d2e54[_0x0133('0x1e')];var _0x2a45ad=_0x21790a?_0x1504dc[_0x0133('0x20')]:_0x2d2e54['offset']+_0x2d2e54[_0x0133('0x21')];var _0x38534c;if(_0x2a45ad>=_0x525294){_0x2a45ad=_0x525294;_0x38534c=0xc8;}else{_0x38534c=0xce;}_0x5845a[_0x0133('0x1b')](_0x38534c);return _0x5845a[_0x0133('0x22')]('Content-Range',_0xc0de52+'-'+_0x2a45ad+'/'+_0x525294)['json'](_0x1504dc);}return null;};}function patchUpdates(_0x2bac3c){return function(_0x52a05f){try{jsonpatch[_0x0133('0x23')](_0x52a05f,_0x2bac3c,!![]);}catch(_0x15e0b4){return BPromise[_0x0133('0x24')](_0x15e0b4);}return _0x52a05f[_0x0133('0x25')]();};}function saveUpdates(_0x637a8a,_0xb2ba55){return function(_0x53f1e0){if(_0x53f1e0){return _0x53f1e0[_0x0133('0x26')](_0x637a8a)[_0x0133('0x27')](function(_0x59b80c){return _0x59b80c;});}return null;};}function removeEntity(_0xeff7bc,_0x8a3aba){return function(_0x1b381e){if(_0x1b381e){return _0x1b381e['destroy']()[_0x0133('0x27')](function(){_0xeff7bc['status'](0xcc)[_0x0133('0x1c')]();});}};}function handleEntityNotFound(_0x4f4b68,_0x5937df){return function(_0x32c92e){if(!_0x32c92e){_0x4f4b68[_0x0133('0x1a')](0x194);}return _0x32c92e;};}function handleError(_0x3528d9,_0x28942c){_0x28942c=_0x28942c||0x1f4;return function(_0x10ba20){logger[_0x0133('0x28')](_0x10ba20[_0x0133('0x29')]);if(_0x10ba20['name']){delete _0x10ba20[_0x0133('0x2a')];}_0x3528d9['status'](_0x28942c)['send'](_0x10ba20);};}exports[_0x0133('0x2b')]=function(_0x3340dd,_0x450da6){var _0x3aefb8={},_0x2c0609={},_0x2ab179={'count':0x0,'rows':[]};var _0x37c14f=_[_0x0133('0x2c')](db[_0x0133('0x2d')]['rawAttributes'],function(_0x39b053){return{'name':_0x39b053[_0x0133('0x2e')],'type':_0x39b053['type'][_0x0133('0x2f')]};});_0x2c0609[_0x0133('0x30')]=_[_0x0133('0x2c')](_0x37c14f,_0x0133('0x2a'));_0x2c0609['query']=_[_0x0133('0x31')](_0x3340dd[_0x0133('0x32')]);_0x2c0609['filters']=_[_0x0133('0x33')](_0x2c0609[_0x0133('0x30')],_0x2c0609[_0x0133('0x32')]);_0x3aefb8[_0x0133('0x34')]=_[_0x0133('0x33')](_0x2c0609[_0x0133('0x30')],qs['fields'](_0x3340dd[_0x0133('0x32')][_0x0133('0x35')]));_0x3aefb8['attributes']=_0x3aefb8[_0x0133('0x34')][_0x0133('0x36')]?_0x3aefb8[_0x0133('0x34')]:_0x2c0609[_0x0133('0x30')];if(!_0x3340dd[_0x0133('0x32')]['hasOwnProperty'](_0x0133('0x37'))){_0x3aefb8[_0x0133('0x21')]=qs[_0x0133('0x21')](_0x3340dd[_0x0133('0x32')][_0x0133('0x21')]);_0x3aefb8[_0x0133('0x1e')]=qs[_0x0133('0x1e')](_0x3340dd['query'][_0x0133('0x1e')]);}_0x3aefb8[_0x0133('0x38')]=qs[_0x0133('0x39')](_0x3340dd[_0x0133('0x32')]['sort']);_0x3aefb8['where']=qs[_0x0133('0x3a')](_[_0x0133('0x3b')](_0x3340dd[_0x0133('0x32')],_0x2c0609[_0x0133('0x3a')]),_0x37c14f);if(_0x3340dd[_0x0133('0x32')]['filter']){_0x3aefb8['where']=_[_0x0133('0x3c')](_0x3aefb8['where'],{'$or':_[_0x0133('0x2c')](_0x37c14f,function(_0x231278){if(_0x231278['type']!==_0x0133('0x3d')){var _0x24f35e={};_0x24f35e[_0x231278[_0x0133('0x2a')]]={'$like':'%'+_0x3340dd['query']['filter']+'%'};return _0x24f35e;}})});}_0x3aefb8=_[_0x0133('0x3c')]({},_0x3aefb8,_0x3340dd['options']);var _0x481c3c={'where':_0x3aefb8[_0x0133('0x3e')]};return db[_0x0133('0x2d')][_0x0133('0x20')](_0x481c3c)[_0x0133('0x27')](function(_0x5ea321){_0x2ab179[_0x0133('0x20')]=_0x5ea321;if(_0x3340dd[_0x0133('0x32')]['includeAll']){_0x3aefb8[_0x0133('0x3f')]=[{'all':!![]}];}return db[_0x0133('0x2d')][_0x0133('0x40')](_0x3aefb8);})[_0x0133('0x27')](function(_0x4377d4){_0x2ab179[_0x0133('0x41')]=_0x4377d4;return _0x2ab179;})[_0x0133('0x27')](respondWithFilteredResult(_0x450da6,_0x3aefb8))[_0x0133('0x42')](handleError(_0x450da6,null));};exports[_0x0133('0x43')]=function(_0xb6914,_0x2537ee){var _0x3165e6={'raw':!![],'where':{'id':_0xb6914[_0x0133('0x44')]['id']}},_0x4f2e35={};_0x4f2e35[_0x0133('0x30')]=_[_0x0133('0x31')](db[_0x0133('0x2d')][_0x0133('0x45')]);_0x4f2e35[_0x0133('0x32')]=_['keys'](_0xb6914[_0x0133('0x32')]);_0x4f2e35['filters']=_['intersection'](_0x4f2e35[_0x0133('0x30')],_0x4f2e35[_0x0133('0x32')]);_0x3165e6[_0x0133('0x34')]=_[_0x0133('0x33')](_0x4f2e35[_0x0133('0x30')],qs[_0x0133('0x35')](_0xb6914[_0x0133('0x32')]['fields']));_0x3165e6[_0x0133('0x34')]=_0x3165e6[_0x0133('0x34')][_0x0133('0x36')]?_0x3165e6[_0x0133('0x34')]:_0x4f2e35[_0x0133('0x30')];if(_0xb6914[_0x0133('0x32')][_0x0133('0x46')]){_0x3165e6[_0x0133('0x3f')]=[{'all':!![]}];}_0x3165e6=_[_0x0133('0x3c')]({},_0x3165e6,_0xb6914[_0x0133('0x47')]);return db[_0x0133('0x2d')][_0x0133('0x48')](_0x3165e6)['then'](handleEntityNotFound(_0x2537ee,null))[_0x0133('0x27')](respondWithResult(_0x2537ee,null))[_0x0133('0x42')](handleError(_0x2537ee,null));};exports[_0x0133('0x49')]=function(_0x533f13,_0x1537d7){return db['ZendeskField'][_0x0133('0x49')](_0x533f13[_0x0133('0x4a')],{})[_0x0133('0x27')](respondWithResult(_0x1537d7,0xc9))[_0x0133('0x42')](handleError(_0x1537d7,null));};exports['update']=function(_0x40c198,_0x4dbe20){if(_0x40c198[_0x0133('0x4a')]['id']){delete _0x40c198['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x40c198['params']['id']}})[_0x0133('0x27')](handleEntityNotFound(_0x4dbe20,null))[_0x0133('0x27')](saveUpdates(_0x40c198[_0x0133('0x4a')],null))[_0x0133('0x27')](respondWithResult(_0x4dbe20,null))[_0x0133('0x42')](handleError(_0x4dbe20,null));};exports[_0x0133('0x4b')]=function(_0x1bf31f,_0x395de0){return db[_0x0133('0x2d')][_0x0133('0x48')]({'where':{'id':_0x1bf31f['params']['id']}})['then'](handleEntityNotFound(_0x395de0,null))['then'](removeEntity(_0x395de0,null))['catch'](handleError(_0x395de0,null));}; \ No newline at end of file +var _0x08d2=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','ZendeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','map','type','includeAll','findAll','catch','params','options','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x32c85c,_0x24cefb){var _0x49cc2d=function(_0x581741){while(--_0x581741){_0x32c85c['push'](_0x32c85c['shift']());}};_0x49cc2d(++_0x24cefb);}(_0x08d2,0x182));var _0x208d=function(_0x7cfc38,_0xde796f){_0x7cfc38=_0x7cfc38-0x0;var _0x33907c=_0x08d2[_0x7cfc38];return _0x33907c;};'use strict';var emlformat=require(_0x208d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x208d('0x1'));var rp=require(_0x208d('0x2'));var moment=require(_0x208d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x208d('0x4'));var util=require(_0x208d('0x5'));var path=require('path');var sox=require(_0x208d('0x6'));var csv=require(_0x208d('0x7'));var ejs=require(_0x208d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x208d('0x9'));var squel=require(_0x208d('0xa'));var crypto=require(_0x208d('0xb'));var jsforce=require(_0x208d('0xc'));var deskjs=require(_0x208d('0xd'));var toCsv=require(_0x208d('0x7'));var querystring=require(_0x208d('0xe'));var Papa=require(_0x208d('0xf'));var Redis=require('ioredis');var authService=require(_0x208d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x208d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x208d('0x12'));var config=require(_0x208d('0x13'));var licenseUtil=require(_0x208d('0x14'));var db=require(_0x208d('0x15'))['db'];function respondWithStatusCode(_0x1c1d9f,_0x107efe){_0x107efe=_0x107efe||0xcc;return function(_0x6a6204){if(_0x6a6204){return _0x1c1d9f[_0x208d('0x16')](_0x107efe);}return _0x1c1d9f[_0x208d('0x17')](_0x107efe)[_0x208d('0x18')]();};}function respondWithResult(_0x3e3878,_0x3e824f){_0x3e824f=_0x3e824f||0xc8;return function(_0x2c6dbc){if(_0x2c6dbc){return _0x3e3878[_0x208d('0x17')](_0x3e824f)[_0x208d('0x19')](_0x2c6dbc);}};}function respondWithFilteredResult(_0x4f836d,_0x2a578d){return function(_0x3521e5){if(_0x3521e5){var _0x49fb75=typeof _0x2a578d['offset']===_0x208d('0x1a')&&typeof _0x2a578d[_0x208d('0x1b')]==='undefined';var _0x1125bb=_0x3521e5[_0x208d('0x1c')];var _0x48e6f3=_0x49fb75?0x0:_0x2a578d[_0x208d('0x1d')];var _0xc56b9a=_0x49fb75?_0x3521e5['count']:_0x2a578d[_0x208d('0x1d')]+_0x2a578d['limit'];var _0x59646d;if(_0xc56b9a>=_0x1125bb){_0xc56b9a=_0x1125bb;_0x59646d=0xc8;}else{_0x59646d=0xce;}_0x4f836d[_0x208d('0x17')](_0x59646d);return _0x4f836d[_0x208d('0x1e')](_0x208d('0x1f'),_0x48e6f3+'-'+_0xc56b9a+'/'+_0x1125bb)['json'](_0x3521e5);}return null;};}function patchUpdates(_0x59e8b7){return function(_0x45daea){try{jsonpatch[_0x208d('0x20')](_0x45daea,_0x59e8b7,!![]);}catch(_0x5505c3){return BPromise['reject'](_0x5505c3);}return _0x45daea[_0x208d('0x21')]();};}function saveUpdates(_0x1c5a0b,_0x59f566){return function(_0x1832fd){if(_0x1832fd){return _0x1832fd[_0x208d('0x22')](_0x1c5a0b)[_0x208d('0x23')](function(_0x73ee9c){return _0x73ee9c;});}return null;};}function removeEntity(_0x186151,_0x158889){return function(_0x42b881){if(_0x42b881){return _0x42b881['destroy']()[_0x208d('0x23')](function(){_0x186151['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae4a6,_0x4bf1fe){return function(_0x3b9257){if(!_0x3b9257){_0x1ae4a6['sendStatus'](0x194);}return _0x3b9257;};}function handleError(_0x2ab1c6,_0x472704){_0x472704=_0x472704||0x1f4;return function(_0x14e7e5){logger[_0x208d('0x24')](_0x14e7e5[_0x208d('0x25')]);if(_0x14e7e5[_0x208d('0x26')]){delete _0x14e7e5[_0x208d('0x26')];}_0x2ab1c6['status'](_0x472704)[_0x208d('0x27')](_0x14e7e5);};}exports['index']=function(_0x5b3acf,_0x13c75c){var _0x41e091={},_0x3e9063={},_0x1d49cc={'count':0x0,'rows':[]};var _0x5c0c4f=_['map'](db[_0x208d('0x28')][_0x208d('0x29')],function(_0x474895){return{'name':_0x474895[_0x208d('0x2a')],'type':_0x474895['type']['key']};});_0x3e9063[_0x208d('0x2b')]=_['map'](_0x5c0c4f,_0x208d('0x26'));_0x3e9063[_0x208d('0x2c')]=_[_0x208d('0x2d')](_0x5b3acf[_0x208d('0x2c')]);_0x3e9063[_0x208d('0x2e')]=_[_0x208d('0x2f')](_0x3e9063[_0x208d('0x2b')],_0x3e9063['query']);_0x41e091[_0x208d('0x30')]=_['intersection'](_0x3e9063['model'],qs[_0x208d('0x31')](_0x5b3acf[_0x208d('0x2c')][_0x208d('0x31')]));_0x41e091[_0x208d('0x30')]=_0x41e091[_0x208d('0x30')][_0x208d('0x32')]?_0x41e091['attributes']:_0x3e9063[_0x208d('0x2b')];if(!_0x5b3acf[_0x208d('0x2c')][_0x208d('0x33')](_0x208d('0x34'))){_0x41e091['limit']=qs[_0x208d('0x1b')](_0x5b3acf[_0x208d('0x2c')][_0x208d('0x1b')]);_0x41e091[_0x208d('0x1d')]=qs['offset'](_0x5b3acf[_0x208d('0x2c')][_0x208d('0x1d')]);}_0x41e091[_0x208d('0x35')]=qs['sort'](_0x5b3acf[_0x208d('0x2c')]['sort']);_0x41e091[_0x208d('0x36')]=qs[_0x208d('0x2e')](_['pick'](_0x5b3acf[_0x208d('0x2c')],_0x3e9063[_0x208d('0x2e')]),_0x5c0c4f);if(_0x5b3acf[_0x208d('0x2c')]['filter']){_0x41e091['where']=_[_0x208d('0x37')](_0x41e091[_0x208d('0x36')],{'$or':_[_0x208d('0x38')](_0x5c0c4f,function(_0x26991f){if(_0x26991f[_0x208d('0x39')]!=='VIRTUAL'){var _0x57743b={};_0x57743b[_0x26991f[_0x208d('0x26')]]={'$like':'%'+_0x5b3acf[_0x208d('0x2c')]['filter']+'%'};return _0x57743b;}})});}_0x41e091=_[_0x208d('0x37')]({},_0x41e091,_0x5b3acf['options']);var _0x4bb1fd={'where':_0x41e091['where']};return db[_0x208d('0x28')]['count'](_0x4bb1fd)['then'](function(_0x4006e0){_0x1d49cc['count']=_0x4006e0;if(_0x5b3acf[_0x208d('0x2c')][_0x208d('0x3a')]){_0x41e091['include']=[{'all':!![]}];}return db['ZendeskField'][_0x208d('0x3b')](_0x41e091);})['then'](function(_0x2d08a8){_0x1d49cc['rows']=_0x2d08a8;return _0x1d49cc;})[_0x208d('0x23')](respondWithFilteredResult(_0x13c75c,_0x41e091))[_0x208d('0x3c')](handleError(_0x13c75c,null));};exports['show']=function(_0x10e3fc,_0x500148){var _0xb7af3={'raw':!![],'where':{'id':_0x10e3fc[_0x208d('0x3d')]['id']}},_0x52bdd5={};_0x52bdd5[_0x208d('0x2b')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x52bdd5['query']=_[_0x208d('0x2d')](_0x10e3fc[_0x208d('0x2c')]);_0x52bdd5['filters']=_[_0x208d('0x2f')](_0x52bdd5[_0x208d('0x2b')],_0x52bdd5[_0x208d('0x2c')]);_0xb7af3[_0x208d('0x30')]=_[_0x208d('0x2f')](_0x52bdd5['model'],qs[_0x208d('0x31')](_0x10e3fc['query']['fields']));_0xb7af3[_0x208d('0x30')]=_0xb7af3[_0x208d('0x30')]['length']?_0xb7af3[_0x208d('0x30')]:_0x52bdd5[_0x208d('0x2b')];if(_0x10e3fc[_0x208d('0x2c')]['includeAll']){_0xb7af3['include']=[{'all':!![]}];}_0xb7af3=_[_0x208d('0x37')]({},_0xb7af3,_0x10e3fc[_0x208d('0x3e')]);return db[_0x208d('0x28')][_0x208d('0x3f')](_0xb7af3)[_0x208d('0x23')](handleEntityNotFound(_0x500148,null))[_0x208d('0x23')](respondWithResult(_0x500148,null))[_0x208d('0x3c')](handleError(_0x500148,null));};exports[_0x208d('0x40')]=function(_0x3d284f,_0x3fceb4){return db[_0x208d('0x28')]['create'](_0x3d284f[_0x208d('0x41')],{})[_0x208d('0x23')](respondWithResult(_0x3fceb4,0xc9))[_0x208d('0x3c')](handleError(_0x3fceb4,null));};exports[_0x208d('0x22')]=function(_0x4e6402,_0x21afaf){if(_0x4e6402['body']['id']){delete _0x4e6402[_0x208d('0x41')]['id'];}return db[_0x208d('0x28')][_0x208d('0x3f')]({'where':{'id':_0x4e6402[_0x208d('0x3d')]['id']}})[_0x208d('0x23')](handleEntityNotFound(_0x21afaf,null))[_0x208d('0x23')](saveUpdates(_0x4e6402[_0x208d('0x41')],null))[_0x208d('0x23')](respondWithResult(_0x21afaf,null))[_0x208d('0x3c')](handleError(_0x21afaf,null));};exports['destroy']=function(_0xa20efa,_0xc8ad03){return db['ZendeskField'][_0x208d('0x3f')]({'where':{'id':_0xa20efa[_0x208d('0x3d')]['id']}})[_0x208d('0x23')](handleEntityNotFound(_0xc8ad03,null))[_0x208d('0x23')](removeEntity(_0xc8ad03,null))[_0x208d('0x3c')](handleError(_0xc8ad03,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 283760a..ac0fb40 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 _0xeb88=['../../config/logger','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','zendesk_unique_index','FieldId','lodash','util'];(function(_0x3a6b4d,_0x2874ce){var _0x481ebb=function(_0x259d08){while(--_0x259d08){_0x3a6b4d['push'](_0x3a6b4d['shift']());}};_0x481ebb(++_0x2874ce);}(_0xeb88,0x1d7));var _0x8eb8=function(_0x9fdaa8,_0x5f5d8f){_0x9fdaa8=_0x9fdaa8-0x0;var _0x4cb404=_0xeb88[_0x9fdaa8];return _0x4cb404;};'use strict';var _=require(_0x8eb8('0x0'));var util=require(_0x8eb8('0x1'));var logger=require(_0x8eb8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8eb8('0x3'));var fs=require('fs');var path=require(_0x8eb8('0x4'));var rimraf=require('rimraf');var config=require(_0x8eb8('0x5'));var attributes=require(_0x8eb8('0x6'));module[_0x8eb8('0x7')]=function(_0x1a8c29,_0xbec76a){return _0x1a8c29['define'](_0x8eb8('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8eb8('0x9'),'fields':['idField',_0x8eb8('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b96=['request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4efa28,_0x4e1805){var _0x599196=function(_0x2e80d9){while(--_0x2e80d9){_0x4efa28['push'](_0x4efa28['shift']());}};_0x599196(++_0x4e1805);}(_0x6b96,0x16a));var _0x66b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6b96[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x66b9('0x0'));var util=require(_0x66b9('0x1'));var logger=require(_0x66b9('0x2'))(_0x66b9('0x3'));var moment=require(_0x66b9('0x4'));var BPromise=require(_0x66b9('0x5'));var rp=require(_0x66b9('0x6'));var fs=require('fs');var path=require(_0x66b9('0x7'));var rimraf=require(_0x66b9('0x8'));var config=require('../../config/environment');var attributes=require(_0x66b9('0x9'));module[_0x66b9('0xa')]=function(_0x4d904e,_0x38435d){return _0x4d904e[_0x66b9('0xb')](_0x66b9('0xc'),attributes,{'tableName':_0x66b9('0xd'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x66b9('0xe'),_0x66b9('0xf')],'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 8576a26..4f0c3d6 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 _0xc061=['ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring'];(function(_0x1bb4c9,_0x862b45){var _0x9cf999=function(_0x16897e){while(--_0x16897e){_0x1bb4c9['push'](_0x1bb4c9['shift']());}};_0x9cf999(++_0x862b45);}(_0xc061,0x69));var _0x1c06=function(_0x1dad49,_0x2a64d4){_0x1dad49=_0x1dad49-0x0;var _0x5dd707=_0xc061[_0x1dad49];return _0x5dd707;};'use strict';var _=require('lodash');var util=require(_0x1c06('0x0'));var moment=require(_0x1c06('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c06('0x2'));var fs=require('fs');var Redis=require(_0x1c06('0x3'));var db=require(_0x1c06('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c06('0x5'))(_0x1c06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c06('0x7')][_0x1c06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4edc3d,_0xa95dec,_0x4eaacc){return new BPromise(function(_0x4064bd,_0x391afa){return client['request'](_0x4edc3d,_0x4eaacc)[_0x1c06('0x9')](function(_0x3354a0){logger['info']('ZendeskField,\x20%s,\x20%s',_0xa95dec,'request\x20sent');logger['debug'](_0x1c06('0xa'),_0xa95dec,_0x1c06('0xb'),JSON[_0x1c06('0xc')](_0x3354a0));if(_0x3354a0['error']){if(_0x3354a0[_0x1c06('0xd')]['code']===0x1f4){logger[_0x1c06('0xd')](_0x1c06('0xe'),_0xa95dec,_0x3354a0[_0x1c06('0xd')][_0x1c06('0xf')]);return _0x391afa(_0x3354a0[_0x1c06('0xd')][_0x1c06('0xf')]);}logger[_0x1c06('0xd')]('ZendeskField,\x20%s,\x20%s',_0xa95dec,_0x3354a0['error'][_0x1c06('0xf')]);return _0x4064bd(_0x3354a0[_0x1c06('0xd')][_0x1c06('0xf')]);}else{logger['info'](_0x1c06('0xe'),_0xa95dec,'request\x20sent');_0x4064bd(_0x3354a0[_0x1c06('0x10')][_0x1c06('0xf')]);}})[_0x1c06('0x11')](function(_0x12bc7e){logger['error']('ZendeskField,\x20%s,\x20%s',_0xa95dec,_0x12bc7e);_0x391afa(_0x12bc7e);});});} \ No newline at end of file +var _0xb241=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','info'];(function(_0x2f793b,_0x17cb9d){var _0x2cb054=function(_0x507abc){while(--_0x507abc){_0x2f793b['push'](_0x2f793b['shift']());}};_0x2cb054(++_0x17cb9d);}(_0xb241,0x1b7));var _0x1b24=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb241[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x1b24('0x0'));var util=require('util');var moment=require(_0x1b24('0x1'));var BPromise=require(_0x1b24('0x2'));var rs=require(_0x1b24('0x3'));var fs=require('fs');var Redis=require(_0x1b24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b24('0x5'));var logger=require('../../config/logger')(_0x1b24('0x6'));var config=require(_0x1b24('0x7'));var jayson=require(_0x1b24('0x8'));var client=jayson[_0x1b24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cfea4,_0x59d155,_0x2b0370){return new BPromise(function(_0xff00aa,_0x1c2916){return client[_0x1b24('0xa')](_0x5cfea4,_0x2b0370)[_0x1b24('0xb')](function(_0x3568f0){logger['info']('ZendeskField,\x20%s,\x20%s',_0x59d155,_0x1b24('0xc'));logger[_0x1b24('0xd')](_0x1b24('0xe'),_0x59d155,_0x1b24('0xc'),JSON[_0x1b24('0xf')](_0x3568f0));if(_0x3568f0['error']){if(_0x3568f0[_0x1b24('0x10')][_0x1b24('0x11')]===0x1f4){logger[_0x1b24('0x10')](_0x1b24('0x12'),_0x59d155,_0x3568f0[_0x1b24('0x10')]['message']);return _0x1c2916(_0x3568f0[_0x1b24('0x10')][_0x1b24('0x13')]);}logger[_0x1b24('0x10')](_0x1b24('0x12'),_0x59d155,_0x3568f0[_0x1b24('0x10')][_0x1b24('0x13')]);return _0xff00aa(_0x3568f0[_0x1b24('0x10')][_0x1b24('0x13')]);}else{logger[_0x1b24('0x14')](_0x1b24('0x12'),_0x59d155,_0x1b24('0xc'));_0xff00aa(_0x3568f0[_0x1b24('0x15')]['message']);}})[_0x1b24('0x16')](function(_0x1c343d){logger[_0x1b24('0x10')]('ZendeskField,\x20%s,\x20%s',_0x59d155,_0x1c343d);_0x1c2916(_0x1c343d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 91d3e0c..14ba424 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 _0xdac6=['express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path'];(function(_0x2cf6f8,_0x52914d){var _0x58fcee=function(_0x1da47f){while(--_0x1da47f){_0x2cf6f8['push'](_0x2cf6f8['shift']());}};_0x58fcee(++_0x52914d);}(_0xdac6,0x1cc));var _0x6dac=function(_0x43498f,_0x2dd99f){_0x43498f=_0x43498f-0x0;var _0x2dbdce=_0xdac6[_0x43498f];return _0x2dbdce;};'use strict';var multer=require(_0x6dac('0x0'));var util=require('util');var path=require(_0x6dac('0x1'));var timeout=require('connect-timeout');var express=require(_0x6dac('0x2'));var router=express[_0x6dac('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6dac('0x4'));var interaction=require(_0x6dac('0x5'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6dac('0x6')](_0x6dac('0x7'),auth[_0x6dac('0x8')](),controller[_0x6dac('0x9')]);router[_0x6dac('0x6')](_0x6dac('0xa'),auth[_0x6dac('0x8')](),controller[_0x6dac('0xb')]);router[_0x6dac('0x6')](_0x6dac('0xc'),auth[_0x6dac('0x8')](),controller[_0x6dac('0xd')]);router[_0x6dac('0xe')]('/',auth[_0x6dac('0x8')](),controller['create']);router[_0x6dac('0xe')](_0x6dac('0xa'),auth[_0x6dac('0x8')](),controller[_0x6dac('0xf')]);router[_0x6dac('0x10')]('/:id',auth[_0x6dac('0x8')](),controller[_0x6dac('0x11')]);router[_0x6dac('0x12')](_0x6dac('0x7'),auth[_0x6dac('0x8')](),controller[_0x6dac('0x13')]);module[_0x6dac('0x14')]=router; \ No newline at end of file +var _0xaa79=['post','addConfiguration','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','create'];(function(_0x46aae3,_0x11d46c){var _0x4e5ff6=function(_0x465dd9){while(--_0x465dd9){_0x46aae3['push'](_0x46aae3['shift']());}};_0x4e5ff6(++_0x11d46c);}(_0xaa79,0x10b));var _0x9aa7=function(_0x51149a,_0x3e2829){_0x51149a=_0x51149a-0x0;var _0x4af506=_0xaa79[_0x51149a];return _0x4af506;};'use strict';var multer=require(_0x9aa7('0x0'));var util=require(_0x9aa7('0x1'));var path=require(_0x9aa7('0x2'));var timeout=require(_0x9aa7('0x3'));var express=require('express');var router=express[_0x9aa7('0x4')]();var fs_extra=require(_0x9aa7('0x5'));var auth=require(_0x9aa7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x9aa7('0x7')]('/',auth[_0x9aa7('0x8')](),controller['index']);router[_0x9aa7('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9aa7('0x7')](_0x9aa7('0x9'),auth[_0x9aa7('0x8')](),controller['getConfigurations']);router[_0x9aa7('0x7')](_0x9aa7('0xa'),auth['isAuthenticated'](),controller[_0x9aa7('0xb')]);router['post']('/',auth[_0x9aa7('0x8')](),controller[_0x9aa7('0xc')]);router[_0x9aa7('0xd')](_0x9aa7('0x9'),auth[_0x9aa7('0x8')](),controller[_0x9aa7('0xe')]);router[_0x9aa7('0xf')]('/:id',auth[_0x9aa7('0x8')](),controller[_0x9aa7('0x10')]);router['delete'](_0x9aa7('0x11'),auth['isAuthenticated'](),controller[_0x9aa7('0x12')]);module[_0x9aa7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 73d28c5..776ad48 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 _0xf109=['exports','STRING','sequelize'];(function(_0x51a7e4,_0x266ae2){var _0x5aa1f4=function(_0x15d8ce){while(--_0x15d8ce){_0x51a7e4['push'](_0x51a7e4['shift']());}};_0x5aa1f4(++_0x266ae2);}(_0xf109,0xce));var _0x9f10=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xf109[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file +var _0xe14d=['exports','STRING','sequelize'];(function(_0x5d201b,_0x5f6711){var _0x4431c5=function(_0x4d1b7c){while(--_0x4d1b7c){_0x5d201b['push'](_0x5d201b['shift']());}};_0x4431c5(++_0x5f6711);}(_0xe14d,0x1ee));var _0xde14=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xe14d[_0x257642];return _0x3d813b;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 439162f..cc23bd9 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 _0x6049=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter','merge','VIRTUAL','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','sort','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','clientSecret','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x444cfc,_0x462f88){var _0x4b2382=function(_0x4e33d5){while(--_0x4e33d5){_0x444cfc['push'](_0x444cfc['shift']());}};_0x4b2382(++_0x462f88);}(_0x6049,0x180));var _0x9604=function(_0x43af36,_0x5b39e9){_0x43af36=_0x43af36-0x0;var _0x188d4f=_0x6049[_0x43af36];return _0x188d4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9604('0x0'));var zipdir=require(_0x9604('0x1'));var jsonpatch=require(_0x9604('0x2'));var rp=require(_0x9604('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9604('0x4'));var util=require(_0x9604('0x5'));var path=require(_0x9604('0x6'));var sox=require(_0x9604('0x7'));var csv=require(_0x9604('0x8'));var ejs=require(_0x9604('0x9'));var fs=require('fs');var fs_extra=require(_0x9604('0xa'));var _=require(_0x9604('0xb'));var squel=require(_0x9604('0xc'));var crypto=require(_0x9604('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9604('0xe'));var Papa=require(_0x9604('0xf'));var Redis=require(_0x9604('0x10'));var authService=require(_0x9604('0x11'));var qs=require(_0x9604('0x12'));var as=require(_0x9604('0x13'));var hardwareService=require(_0x9604('0x14'));var logger=require(_0x9604('0x15'))('api');var utils=require(_0x9604('0x16'));var config=require(_0x9604('0x17'));var licenseUtil=require(_0x9604('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f42d3,_0x3a32a4){_0x3a32a4=_0x3a32a4||0xcc;return function(_0x196876){if(_0x196876){return _0x3f42d3[_0x9604('0x19')](_0x3a32a4);}return _0x3f42d3['status'](_0x3a32a4)[_0x9604('0x1a')]();};}function respondWithResult(_0x4f2028,_0x49f3d1){_0x49f3d1=_0x49f3d1||0xc8;return function(_0x33aff2){if(_0x33aff2){return _0x4f2028[_0x9604('0x1b')](_0x49f3d1)['json'](_0x33aff2);}};}function respondWithFilteredResult(_0x5d491c,_0x356781){return function(_0x6c15fe){if(_0x6c15fe){var _0x5ad563=typeof _0x356781[_0x9604('0x1c')]===_0x9604('0x1d')&&typeof _0x356781[_0x9604('0x1e')]===_0x9604('0x1d');var _0x163027=_0x6c15fe['count'];var _0x238e7c=_0x5ad563?0x0:_0x356781['offset'];var _0x2e23e3=_0x5ad563?_0x6c15fe[_0x9604('0x1f')]:_0x356781[_0x9604('0x1c')]+_0x356781[_0x9604('0x1e')];var _0x347997;if(_0x2e23e3>=_0x163027){_0x2e23e3=_0x163027;_0x347997=0xc8;}else{_0x347997=0xce;}_0x5d491c[_0x9604('0x1b')](_0x347997);return _0x5d491c[_0x9604('0x20')](_0x9604('0x21'),_0x238e7c+'-'+_0x2e23e3+'/'+_0x163027)[_0x9604('0x22')](_0x6c15fe);}return null;};}function patchUpdates(_0x4c1ffd){return function(_0x3614ae){try{jsonpatch[_0x9604('0x23')](_0x3614ae,_0x4c1ffd,!![]);}catch(_0x2ad9d8){return BPromise['reject'](_0x2ad9d8);}return _0x3614ae[_0x9604('0x24')]();};}function saveUpdates(_0x23c287,_0x420416){return function(_0x107b90){if(_0x107b90){return _0x107b90[_0x9604('0x25')](_0x23c287)[_0x9604('0x26')](function(_0x199582){return _0x199582;});}return null;};}function removeEntity(_0x5ca555,_0x3bcbd5){return function(_0x20715d){if(_0x20715d){return _0x20715d[_0x9604('0x27')]()[_0x9604('0x26')](function(){_0x5ca555['status'](0xcc)[_0x9604('0x1a')]();});}};}function handleEntityNotFound(_0x1eadeb,_0x121f51){return function(_0x238e22){if(!_0x238e22){_0x1eadeb['sendStatus'](0x194);}return _0x238e22;};}function handleError(_0x59f585,_0x12c353){_0x12c353=_0x12c353||0x1f4;return function(_0xa06b88){logger[_0x9604('0x28')](_0xa06b88[_0x9604('0x29')]);if(_0xa06b88['name']){delete _0xa06b88['name'];}_0x59f585[_0x9604('0x1b')](_0x12c353)[_0x9604('0x2a')](_0xa06b88);};}exports[_0x9604('0x2b')]=function(_0x25851f,_0x570fbb){var _0x28de31={},_0x2f8584={},_0x5b6fb9={'count':0x0,'rows':[]};var _0x19487e=_[_0x9604('0x2c')](db[_0x9604('0x2d')][_0x9604('0x2e')],function(_0x1f47f3){return{'name':_0x1f47f3[_0x9604('0x2f')],'type':_0x1f47f3[_0x9604('0x30')][_0x9604('0x31')]};});_0x2f8584['model']=_[_0x9604('0x2c')](_0x19487e,_0x9604('0x32'));_0x2f8584[_0x9604('0x33')]=_[_0x9604('0x34')](_0x25851f[_0x9604('0x33')]);_0x2f8584[_0x9604('0x35')]=_[_0x9604('0x36')](_0x2f8584[_0x9604('0x37')],_0x2f8584[_0x9604('0x33')]);_0x28de31[_0x9604('0x38')]=_[_0x9604('0x36')](_0x2f8584[_0x9604('0x37')],qs[_0x9604('0x39')](_0x25851f[_0x9604('0x33')]['fields']));_0x28de31[_0x9604('0x38')]=_0x28de31[_0x9604('0x38')][_0x9604('0x3a')]?_0x28de31[_0x9604('0x38')]:_0x2f8584[_0x9604('0x37')];if(!_0x25851f[_0x9604('0x33')]['hasOwnProperty'](_0x9604('0x3b'))){_0x28de31[_0x9604('0x1e')]=qs[_0x9604('0x1e')](_0x25851f[_0x9604('0x33')][_0x9604('0x1e')]);_0x28de31[_0x9604('0x1c')]=qs[_0x9604('0x1c')](_0x25851f[_0x9604('0x33')][_0x9604('0x1c')]);}_0x28de31[_0x9604('0x3c')]=qs['sort'](_0x25851f['query']['sort']);_0x28de31[_0x9604('0x3d')]=qs[_0x9604('0x35')](_['pick'](_0x25851f[_0x9604('0x33')],_0x2f8584[_0x9604('0x35')]),_0x19487e);if(_0x25851f[_0x9604('0x33')][_0x9604('0x3e')]){_0x28de31[_0x9604('0x3d')]=_[_0x9604('0x3f')](_0x28de31['where'],{'$or':_[_0x9604('0x2c')](_0x19487e,function(_0x4441f0){if(_0x4441f0['type']!==_0x9604('0x40')){var _0x4777a0={};_0x4777a0[_0x4441f0[_0x9604('0x32')]]={'$like':'%'+_0x25851f[_0x9604('0x33')][_0x9604('0x3e')]+'%'};return _0x4777a0;}})});}_0x28de31=_[_0x9604('0x3f')]({},_0x28de31,_0x25851f['options']);var _0x42d01e={'where':_0x28de31['where']};return db[_0x9604('0x2d')]['count'](_0x42d01e)[_0x9604('0x26')](function(_0x48a5ae){_0x5b6fb9[_0x9604('0x1f')]=_0x48a5ae;if(_0x25851f[_0x9604('0x33')]['includeAll']){_0x28de31[_0x9604('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x9604('0x42')](_0x28de31);})[_0x9604('0x26')](function(_0x5f45c7){_0x5b6fb9[_0x9604('0x43')]=_0x5f45c7;return _0x5b6fb9;})['then'](respondWithFilteredResult(_0x570fbb,_0x28de31))['catch'](handleError(_0x570fbb,null));};exports[_0x9604('0x44')]=function(_0x5db60f,_0x558e72){var _0x4274fd={'raw':![],'where':{'id':_0x5db60f['params']['id']}},_0x59ab35={};_0x59ab35['model']=_['keys'](db['ZohoAccount'][_0x9604('0x2e')]);_0x59ab35[_0x9604('0x33')]=_[_0x9604('0x34')](_0x5db60f['query']);_0x59ab35[_0x9604('0x35')]=_['intersection'](_0x59ab35[_0x9604('0x37')],_0x59ab35[_0x9604('0x33')]);_0x4274fd[_0x9604('0x38')]=_[_0x9604('0x36')](_0x59ab35[_0x9604('0x37')],qs[_0x9604('0x39')](_0x5db60f[_0x9604('0x33')]['fields']));_0x4274fd['attributes']=_0x4274fd[_0x9604('0x38')]['length']?_0x4274fd[_0x9604('0x38')]:_0x59ab35[_0x9604('0x37')];if(_0x5db60f[_0x9604('0x33')]['includeAll']){_0x4274fd[_0x9604('0x41')]=[{'all':!![]}];}_0x4274fd=_['merge']({},_0x4274fd,_0x5db60f['options']);return db[_0x9604('0x2d')][_0x9604('0x45')](_0x4274fd)[_0x9604('0x26')](handleEntityNotFound(_0x558e72,null))[_0x9604('0x26')](respondWithResult(_0x558e72,null))[_0x9604('0x46')](handleError(_0x558e72,null));};exports[_0x9604('0x47')]=function(_0x5b6078,_0x334923){return db[_0x9604('0x2d')][_0x9604('0x47')](_0x5b6078[_0x9604('0x48')],{})[_0x9604('0x26')](respondWithResult(_0x334923,0xc9))[_0x9604('0x46')](handleError(_0x334923,null));};exports[_0x9604('0x25')]=function(_0x58fe2d,_0x2bc99d){if(_0x58fe2d[_0x9604('0x48')]['id']){delete _0x58fe2d[_0x9604('0x48')]['id'];}return db[_0x9604('0x2d')][_0x9604('0x45')]({'where':{'id':_0x58fe2d[_0x9604('0x49')]['id']}})[_0x9604('0x26')](handleEntityNotFound(_0x2bc99d,null))['then'](saveUpdates(_0x58fe2d['body'],null))[_0x9604('0x26')](respondWithResult(_0x2bc99d,null))['catch'](handleError(_0x2bc99d,null));};exports[_0x9604('0x27')]=function(_0x4e23e8,_0x44ec57){return db[_0x9604('0x2d')][_0x9604('0x45')]({'where':{'id':_0x4e23e8[_0x9604('0x49')]['id']}})[_0x9604('0x26')](handleEntityNotFound(_0x44ec57,null))[_0x9604('0x26')](removeEntity(_0x44ec57,null))[_0x9604('0x46')](handleError(_0x44ec57,null));};exports[_0x9604('0x4a')]=function(_0x423cb7,_0x4a72e0,_0x356176){var _0x5cae66={};var _0x4d4b5c={};var _0x499190;var _0x5282c4;return db['ZohoAccount'][_0x9604('0x4b')]({'where':{'id':_0x423cb7['params']['id']}})[_0x9604('0x26')](handleEntityNotFound(_0x4a72e0,null))[_0x9604('0x26')](function(_0xea6994){if(_0xea6994){_0x499190=_0xea6994;_0x4d4b5c[_0x9604('0x37')]=_['keys'](db['ZohoConfiguration'][_0x9604('0x2e')]);_0x4d4b5c[_0x9604('0x33')]=_['keys'](_0x423cb7['query']);_0x4d4b5c[_0x9604('0x35')]=_[_0x9604('0x36')](_0x4d4b5c[_0x9604('0x37')],_0x4d4b5c[_0x9604('0x33')]);_0x5cae66[_0x9604('0x38')]=_[_0x9604('0x36')](_0x4d4b5c[_0x9604('0x37')],qs[_0x9604('0x39')](_0x423cb7[_0x9604('0x33')][_0x9604('0x39')]));_0x5cae66[_0x9604('0x38')]=_0x5cae66['attributes']['length']?_0x5cae66[_0x9604('0x38')]:_0x4d4b5c['model'];_0x5cae66['order']=qs['sort'](_0x423cb7[_0x9604('0x33')][_0x9604('0x4c')]);_0x5cae66[_0x9604('0x3d')]=qs[_0x9604('0x35')](_[_0x9604('0x4d')](_0x423cb7[_0x9604('0x33')],_0x4d4b5c['filters']));if(_0x423cb7[_0x9604('0x33')][_0x9604('0x3e')]){_0x5cae66[_0x9604('0x3d')]=_['merge'](_0x5cae66[_0x9604('0x3d')],{'$or':_['map'](_0x5cae66[_0x9604('0x38')],function(_0x41a355){var _0x5b445f={};_0x5b445f[_0x41a355]={'$like':'%'+_0x423cb7[_0x9604('0x33')][_0x9604('0x3e')]+'%'};return _0x5b445f;})});}_0x5cae66=_[_0x9604('0x3f')]({},_0x5cae66,_0x423cb7['options']);return _0x499190[_0x9604('0x4a')](_0x5cae66);}})['then'](function(_0x595e06){if(_0x595e06){_0x5282c4=_0x595e06[_0x9604('0x3a')];if(!_0x423cb7[_0x9604('0x33')][_0x9604('0x4e')](_0x9604('0x3b'))){_0x5cae66[_0x9604('0x1e')]=qs[_0x9604('0x1e')](_0x423cb7[_0x9604('0x33')][_0x9604('0x1e')]);_0x5cae66['offset']=qs['offset'](_0x423cb7[_0x9604('0x33')]['offset']);}return _0x499190['getConfigurations'](_0x5cae66);}})[_0x9604('0x26')](function(_0x5d7a43){if(_0x5d7a43){return _0x5d7a43?{'count':_0x5282c4,'rows':_0x5d7a43}:null;}})[_0x9604('0x26')](respondWithResult(_0x4a72e0,null))[_0x9604('0x46')](handleError(_0x4a72e0,null));};exports[_0x9604('0x4f')]=function(_0xfad6db,_0xc75644,_0x5ccc75){if(_0xfad6db[_0x9604('0x48')]['id']){delete _0xfad6db[_0x9604('0x48')]['id'];}return db['ZohoAccount'][_0x9604('0x4b')]({'where':{'id':_0xfad6db[_0x9604('0x49')]['id']}})[_0x9604('0x26')](handleEntityNotFound(_0xc75644,null))[_0x9604('0x26')](function(_0x2168f){if(_0x2168f){_0xfad6db[_0x9604('0x48')][_0x9604('0x50')]=_0x2168f['id'];_0xfad6db['body'][_0x9604('0x51')]=integrations[_0x9604('0x52')](_0xfad6db[_0x9604('0x48')][_0x9604('0x53')],_0xfad6db['body'][_0x9604('0x30')]);_0xfad6db[_0x9604('0x48')][_0x9604('0x54')]=integrations['getDescriptions'](_0xfad6db[_0x9604('0x48')][_0x9604('0x53')],_0xfad6db[_0x9604('0x48')][_0x9604('0x30')]);return db[_0x9604('0x55')][_0x9604('0x47')](_0xfad6db[_0x9604('0x48')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x9604('0x56')],'as':_0x9604('0x54')}]});}return null;})[_0x9604('0x26')](respondWithResult(_0xc75644,null))[_0x9604('0x46')](handleError(_0xc75644,null));};function getAccessToken(_0x2e580f){return new Promise(function(_0x4dd535,_0x3e4e24){var _0x2e1657;switch(_0x2e580f[_0x9604('0x57')]){case'US':_0x2e1657='https://accounts.zoho.com';break;case'AU':_0x2e1657=_0x9604('0x58');break;case'EU':_0x2e1657=_0x9604('0x59');break;case'IN':_0x2e1657=_0x9604('0x5a');break;case'CN':_0x2e1657='https://accounts.zoho.com.cn';break;default:_0x2e1657='https://accounts.zoho.eu';break;}var _0x38af0f={'method':_0x9604('0x5b'),'uri':_0x2e1657+_0x9604('0x5c'),'qs':{'refresh_token':_0x2e580f[_0x9604('0x5d')],'client_id':_0x2e580f['clientId'],'client_secret':_0x2e580f['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x38af0f)[_0x9604('0x26')](function(_0x2922ee){if(_0x2922ee['access_token']){_0x4dd535(_0x2922ee['access_token']);}else{_0x3e4e24(_0x9604('0x5e'));}})[_0x9604('0x46')](function(_0x55d398){_0x3e4e24(_0x55d398);});});}exports[_0x9604('0x5f')]=function(_0x1fe0d5,_0x5963e9,_0x28e8e9){var _0x96fb61,_0x47a88b,_0x4c1f56,_0x7b7263,_0x3674e9;return db['ZohoAccount']['findOne']({'where':{'id':_0x1fe0d5[_0x9604('0x49')]['id']},'attributes':['id',_0x9604('0x60'),_0x9604('0x57'),_0x9604('0x61'),_0x9604('0x62'),_0x9604('0x63'),_0x9604('0x64'),'refreshToken']})['then'](handleEntityNotFound(_0x5963e9,null))['then'](function(_0x3d41e5){_0x3674e9=_0x3d41e5;_0x96fb61=_0x3674e9[_0x9604('0x60')];_0x47a88b=_0x96fb61==='zoho.eu'?'eu':_0x9604('0x65');_0x4c1f56=_0x3674e9[_0x9604('0x63')];var _0x1fb84d=_0x4c1f56[_0x9604('0x66')](-0x1);if(_0x1fb84d==='/'||_0x1fb84d==='\x5c'||_0x1fb84d===':'){_0x4c1f56=_0x4c1f56[_0x9604('0x67')](0x0,_0x4c1f56[_0x9604('0x68')](_0x1fb84d));}if(!_0x3674e9['refreshToken']){throw new Error(_0x9604('0x69'));}return getAccessToken(_0x3674e9);})[_0x9604('0x26')](function(_0x500084){if(_0x500084){return rp({'method':_0x9604('0x6a'),'uri':util['format'](_0x9604('0x6b'),_0x47a88b),'qs':{'module':_0x9604('0x6c')},'headers':{'Authorization':_0x9604('0x6d')+_0x500084},'json':!![]});}})[_0x9604('0x26')](function(_0x156017){if(_0x156017){if(_0x156017[_0x9604('0x6e')]&&_0x156017['response']['error']){throw new Error(_0x156017['response']['error'][_0x9604('0x6f')]);}var _0x19d9e8=[];var _0x46af81=[];var _0x392661=[_0x9604('0x70'),_0x9604('0x71'),_0x9604('0x72'),_0x9604('0x73'),_0x9604('0x74'),_0x9604('0x75'),_0x9604('0x76'),_0x9604('0x77')];_0x46af81=_[_0x9604('0x78')](_0x156017[_0x9604('0x39')],function(_0x2efc19){return _0x392661['includes'](_0x2efc19[_0x9604('0x79')]);});for(var _0x1f814f=0x0;_0x1f814f<_0x46af81[_0x9604('0x3a')];_0x1f814f++){if(_0x46af81[_0x1f814f][_0x9604('0x7a')]===![]){_0x19d9e8[_0x9604('0x7b')]({'id':_0x46af81[_0x1f814f]['id'],'name':_0x46af81[_0x1f814f][_0x9604('0x7c')],'custom':_0x46af81[_0x1f814f][_0x9604('0x7d')],'options':_0x46af81[_0x1f814f][_0x9604('0x7e')]===_0x9604('0x7f')&&_0x46af81[_0x1f814f][_0x9604('0x80')]['length']>-0x1?_['map'](_0x46af81[_0x1f814f]['pick_list_values'],function(_0x4c9c70){return{'name':_0x4c9c70,'value':_0x4c9c70};}):[]});}}return{'count':_0x19d9e8[_0x9604('0x3a')],'rows':_0x19d9e8};}else{return{'count':0x0,'rows':[]};}})[_0x9604('0x26')](respondWithResult(_0x5963e9,null))[_0x9604('0x46')](function(_0x2720e0){var _0x50b4b4=_0x1fe0d5[_0x9604('0x33')][_0x9604('0x81')]?0x1f4:_0x2720e0[_0x9604('0x82')]||0x1f4;logger[_0x9604('0x28')](_0x9604('0x83'),_0x9604('0x5f'),_0x50b4b4,JSON[_0x9604('0x84')](_0x2720e0));delete _0x2720e0[_0x9604('0x32')];if(_0x50b4b4===0x191){_0x50b4b4=0x190;}_0x5963e9[_0x9604('0x1b')](_0x50b4b4)[_0x9604('0x2a')](_0x1fe0d5[_0x9604('0x33')]['test']?{'message':_0x9604('0x85'),'statusCode':_0x2720e0['statusCode']}:_0x2720e0);});}; \ No newline at end of file +var _0x8ac0=['Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','destroy','then','error','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','getConfigurations','findOne','Subjects','getSubjects','getDescriptions','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','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','code','host','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0x8ac0,0x9e));var _0x08ac=function(_0x19bed3,_0x4099e1){_0x19bed3=_0x19bed3-0x0;var _0x51f424=_0x8ac0[_0x19bed3];return _0x51f424;};'use strict';var emlformat=require(_0x08ac('0x0'));var rimraf=require(_0x08ac('0x1'));var zipdir=require(_0x08ac('0x2'));var jsonpatch=require(_0x08ac('0x3'));var rp=require('request-promise');var moment=require(_0x08ac('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x08ac('0x5'));var path=require(_0x08ac('0x6'));var sox=require(_0x08ac('0x7'));var csv=require(_0x08ac('0x8'));var ejs=require(_0x08ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x08ac('0xa'));var jsforce=require(_0x08ac('0xb'));var deskjs=require(_0x08ac('0xc'));var toCsv=require('to-csv');var querystring=require(_0x08ac('0xd'));var Papa=require(_0x08ac('0xe'));var Redis=require(_0x08ac('0xf'));var authService=require(_0x08ac('0x10'));var qs=require(_0x08ac('0x11'));var as=require(_0x08ac('0x12'));var hardwareService=require(_0x08ac('0x13'));var logger=require(_0x08ac('0x14'))(_0x08ac('0x15'));var utils=require(_0x08ac('0x16'));var config=require(_0x08ac('0x17'));var licenseUtil=require(_0x08ac('0x18'));var db=require(_0x08ac('0x19'))['db'];var integrations=require(_0x08ac('0x1a'));function respondWithStatusCode(_0x2c7180,_0x19f6d0){_0x19f6d0=_0x19f6d0||0xcc;return function(_0x3a27cf){if(_0x3a27cf){return _0x2c7180[_0x08ac('0x1b')](_0x19f6d0);}return _0x2c7180['status'](_0x19f6d0)[_0x08ac('0x1c')]();};}function respondWithResult(_0x44eeb0,_0x4c8aa5){_0x4c8aa5=_0x4c8aa5||0xc8;return function(_0x4ce983){if(_0x4ce983){return _0x44eeb0['status'](_0x4c8aa5)[_0x08ac('0x1d')](_0x4ce983);}};}function respondWithFilteredResult(_0x3b5be6,_0x1653fb){return function(_0x5577a6){if(_0x5577a6){var _0x2bd5de=typeof _0x1653fb[_0x08ac('0x1e')]===_0x08ac('0x1f')&&typeof _0x1653fb[_0x08ac('0x20')]==='undefined';var _0x281155=_0x5577a6['count'];var _0x2086bd=_0x2bd5de?0x0:_0x1653fb['offset'];var _0x49df46=_0x2bd5de?_0x5577a6[_0x08ac('0x21')]:_0x1653fb[_0x08ac('0x1e')]+_0x1653fb[_0x08ac('0x20')];var _0x15ae06;if(_0x49df46>=_0x281155){_0x49df46=_0x281155;_0x15ae06=0xc8;}else{_0x15ae06=0xce;}_0x3b5be6[_0x08ac('0x22')](_0x15ae06);return _0x3b5be6[_0x08ac('0x23')]('Content-Range',_0x2086bd+'-'+_0x49df46+'/'+_0x281155)[_0x08ac('0x1d')](_0x5577a6);}return null;};}function patchUpdates(_0x5189de){return function(_0x36b8f1){try{jsonpatch['apply'](_0x36b8f1,_0x5189de,!![]);}catch(_0x504468){return BPromise[_0x08ac('0x24')](_0x504468);}return _0x36b8f1[_0x08ac('0x25')]();};}function saveUpdates(_0x2f0c30,_0x47d56a){return function(_0x2f1340){if(_0x2f1340){return _0x2f1340[_0x08ac('0x26')](_0x2f0c30)['then'](function(_0x4cd840){return _0x4cd840;});}return null;};}function removeEntity(_0x507ca8,_0x2db3da){return function(_0x55c9d8){if(_0x55c9d8){return _0x55c9d8[_0x08ac('0x27')]()[_0x08ac('0x28')](function(){_0x507ca8[_0x08ac('0x22')](0xcc)[_0x08ac('0x1c')]();});}};}function handleEntityNotFound(_0x2ada1e,_0x4f9b50){return function(_0x1f3f4b){if(!_0x1f3f4b){_0x2ada1e[_0x08ac('0x1b')](0x194);}return _0x1f3f4b;};}function handleError(_0x24a7a6,_0xb1b023){_0xb1b023=_0xb1b023||0x1f4;return function(_0x5568ca){logger[_0x08ac('0x29')](_0x5568ca[_0x08ac('0x2a')]);if(_0x5568ca[_0x08ac('0x2b')]){delete _0x5568ca[_0x08ac('0x2b')];}_0x24a7a6[_0x08ac('0x22')](_0xb1b023)[_0x08ac('0x2c')](_0x5568ca);};}exports[_0x08ac('0x2d')]=function(_0x284de1,_0x35b640){var _0x326207={},_0x1b7536={},_0x3c8f89={'count':0x0,'rows':[]};var _0x32a04a=_[_0x08ac('0x2e')](db[_0x08ac('0x2f')]['rawAttributes'],function(_0x290d89){return{'name':_0x290d89[_0x08ac('0x30')],'type':_0x290d89[_0x08ac('0x31')][_0x08ac('0x32')]};});_0x1b7536[_0x08ac('0x33')]=_[_0x08ac('0x2e')](_0x32a04a,_0x08ac('0x2b'));_0x1b7536['query']=_['keys'](_0x284de1[_0x08ac('0x34')]);_0x1b7536[_0x08ac('0x35')]=_[_0x08ac('0x36')](_0x1b7536['model'],_0x1b7536['query']);_0x326207[_0x08ac('0x37')]=_['intersection'](_0x1b7536['model'],qs['fields'](_0x284de1[_0x08ac('0x34')][_0x08ac('0x38')]));_0x326207['attributes']=_0x326207['attributes'][_0x08ac('0x39')]?_0x326207[_0x08ac('0x37')]:_0x1b7536[_0x08ac('0x33')];if(!_0x284de1[_0x08ac('0x34')][_0x08ac('0x3a')]('nolimit')){_0x326207[_0x08ac('0x20')]=qs[_0x08ac('0x20')](_0x284de1[_0x08ac('0x34')][_0x08ac('0x20')]);_0x326207[_0x08ac('0x1e')]=qs['offset'](_0x284de1[_0x08ac('0x34')][_0x08ac('0x1e')]);}_0x326207[_0x08ac('0x3b')]=qs['sort'](_0x284de1[_0x08ac('0x34')][_0x08ac('0x3c')]);_0x326207[_0x08ac('0x3d')]=qs[_0x08ac('0x35')](_[_0x08ac('0x3e')](_0x284de1[_0x08ac('0x34')],_0x1b7536[_0x08ac('0x35')]),_0x32a04a);if(_0x284de1[_0x08ac('0x34')][_0x08ac('0x3f')]){_0x326207['where']=_[_0x08ac('0x40')](_0x326207[_0x08ac('0x3d')],{'$or':_['map'](_0x32a04a,function(_0x11224b){if(_0x11224b['type']!==_0x08ac('0x41')){var _0x292222={};_0x292222[_0x11224b[_0x08ac('0x2b')]]={'$like':'%'+_0x284de1[_0x08ac('0x34')][_0x08ac('0x3f')]+'%'};return _0x292222;}})});}_0x326207=_['merge']({},_0x326207,_0x284de1[_0x08ac('0x42')]);var _0x10a2e4={'where':_0x326207[_0x08ac('0x3d')]};return db[_0x08ac('0x2f')][_0x08ac('0x21')](_0x10a2e4)[_0x08ac('0x28')](function(_0x324e49){_0x3c8f89[_0x08ac('0x21')]=_0x324e49;if(_0x284de1[_0x08ac('0x34')][_0x08ac('0x43')]){_0x326207['include']=[{'all':!![]}];}return db[_0x08ac('0x2f')][_0x08ac('0x44')](_0x326207);})[_0x08ac('0x28')](function(_0x453c7e){_0x3c8f89[_0x08ac('0x45')]=_0x453c7e;return _0x3c8f89;})[_0x08ac('0x28')](respondWithFilteredResult(_0x35b640,_0x326207))[_0x08ac('0x46')](handleError(_0x35b640,null));};exports[_0x08ac('0x47')]=function(_0x21a3e4,_0x3178a3){var _0x7a1839={'raw':![],'where':{'id':_0x21a3e4['params']['id']}},_0x37d394={};_0x37d394[_0x08ac('0x33')]=_[_0x08ac('0x48')](db[_0x08ac('0x2f')][_0x08ac('0x49')]);_0x37d394[_0x08ac('0x34')]=_[_0x08ac('0x48')](_0x21a3e4[_0x08ac('0x34')]);_0x37d394[_0x08ac('0x35')]=_[_0x08ac('0x36')](_0x37d394[_0x08ac('0x33')],_0x37d394[_0x08ac('0x34')]);_0x7a1839[_0x08ac('0x37')]=_[_0x08ac('0x36')](_0x37d394[_0x08ac('0x33')],qs['fields'](_0x21a3e4[_0x08ac('0x34')][_0x08ac('0x38')]));_0x7a1839[_0x08ac('0x37')]=_0x7a1839['attributes'][_0x08ac('0x39')]?_0x7a1839[_0x08ac('0x37')]:_0x37d394[_0x08ac('0x33')];if(_0x21a3e4[_0x08ac('0x34')][_0x08ac('0x43')]){_0x7a1839[_0x08ac('0x4a')]=[{'all':!![]}];}_0x7a1839=_[_0x08ac('0x40')]({},_0x7a1839,_0x21a3e4['options']);return db['ZohoAccount'][_0x08ac('0x4b')](_0x7a1839)['then'](handleEntityNotFound(_0x3178a3,null))[_0x08ac('0x28')](respondWithResult(_0x3178a3,null))['catch'](handleError(_0x3178a3,null));};exports['create']=function(_0x1f943f,_0x49e519){return db[_0x08ac('0x2f')][_0x08ac('0x4c')](_0x1f943f[_0x08ac('0x4d')],{})[_0x08ac('0x28')](respondWithResult(_0x49e519,0xc9))[_0x08ac('0x46')](handleError(_0x49e519,null));};exports['update']=function(_0x40e6d3,_0x591242){if(_0x40e6d3[_0x08ac('0x4d')]['id']){delete _0x40e6d3['body']['id'];}return db[_0x08ac('0x2f')][_0x08ac('0x4b')]({'where':{'id':_0x40e6d3['params']['id']}})[_0x08ac('0x28')](handleEntityNotFound(_0x591242,null))[_0x08ac('0x28')](saveUpdates(_0x40e6d3[_0x08ac('0x4d')],null))[_0x08ac('0x28')](respondWithResult(_0x591242,null))['catch'](handleError(_0x591242,null));};exports['destroy']=function(_0x50e242,_0x275670){return db[_0x08ac('0x2f')][_0x08ac('0x4b')]({'where':{'id':_0x50e242[_0x08ac('0x4e')]['id']}})[_0x08ac('0x28')](handleEntityNotFound(_0x275670,null))[_0x08ac('0x28')](removeEntity(_0x275670,null))['catch'](handleError(_0x275670,null));};exports[_0x08ac('0x4f')]=function(_0x1466a4,_0xf73cb5,_0x58a0f5){var _0x5a2b59={};var _0x2ffda4={};var _0x3dbdc4;var _0x54f8ca;return db['ZohoAccount'][_0x08ac('0x50')]({'where':{'id':_0x1466a4[_0x08ac('0x4e')]['id']}})[_0x08ac('0x28')](handleEntityNotFound(_0xf73cb5,null))['then'](function(_0x48d90b){if(_0x48d90b){_0x3dbdc4=_0x48d90b;_0x2ffda4[_0x08ac('0x33')]=_[_0x08ac('0x48')](db['ZohoConfiguration'][_0x08ac('0x49')]);_0x2ffda4[_0x08ac('0x34')]=_[_0x08ac('0x48')](_0x1466a4[_0x08ac('0x34')]);_0x2ffda4[_0x08ac('0x35')]=_[_0x08ac('0x36')](_0x2ffda4[_0x08ac('0x33')],_0x2ffda4['query']);_0x5a2b59['attributes']=_[_0x08ac('0x36')](_0x2ffda4[_0x08ac('0x33')],qs[_0x08ac('0x38')](_0x1466a4[_0x08ac('0x34')][_0x08ac('0x38')]));_0x5a2b59[_0x08ac('0x37')]=_0x5a2b59['attributes']['length']?_0x5a2b59[_0x08ac('0x37')]:_0x2ffda4['model'];_0x5a2b59[_0x08ac('0x3b')]=qs[_0x08ac('0x3c')](_0x1466a4[_0x08ac('0x34')][_0x08ac('0x3c')]);_0x5a2b59['where']=qs[_0x08ac('0x35')](_[_0x08ac('0x3e')](_0x1466a4['query'],_0x2ffda4['filters']));if(_0x1466a4['query'][_0x08ac('0x3f')]){_0x5a2b59[_0x08ac('0x3d')]=_[_0x08ac('0x40')](_0x5a2b59['where'],{'$or':_[_0x08ac('0x2e')](_0x5a2b59[_0x08ac('0x37')],function(_0x145ad4){var _0x23db52={};_0x23db52[_0x145ad4]={'$like':'%'+_0x1466a4[_0x08ac('0x34')][_0x08ac('0x3f')]+'%'};return _0x23db52;})});}_0x5a2b59=_[_0x08ac('0x40')]({},_0x5a2b59,_0x1466a4[_0x08ac('0x42')]);return _0x3dbdc4[_0x08ac('0x4f')](_0x5a2b59);}})[_0x08ac('0x28')](function(_0x1505de){if(_0x1505de){_0x54f8ca=_0x1505de[_0x08ac('0x39')];if(!_0x1466a4[_0x08ac('0x34')]['hasOwnProperty']('nolimit')){_0x5a2b59[_0x08ac('0x20')]=qs[_0x08ac('0x20')](_0x1466a4[_0x08ac('0x34')][_0x08ac('0x20')]);_0x5a2b59['offset']=qs[_0x08ac('0x1e')](_0x1466a4[_0x08ac('0x34')][_0x08ac('0x1e')]);}return _0x3dbdc4[_0x08ac('0x4f')](_0x5a2b59);}})[_0x08ac('0x28')](function(_0x57ca6e){if(_0x57ca6e){return _0x57ca6e?{'count':_0x54f8ca,'rows':_0x57ca6e}:null;}})['then'](respondWithResult(_0xf73cb5,null))[_0x08ac('0x46')](handleError(_0xf73cb5,null));};exports['addConfiguration']=function(_0x47ada2,_0x5af53,_0x4d0360){if(_0x47ada2[_0x08ac('0x4d')]['id']){delete _0x47ada2[_0x08ac('0x4d')]['id'];}return db[_0x08ac('0x2f')][_0x08ac('0x50')]({'where':{'id':_0x47ada2[_0x08ac('0x4e')]['id']}})[_0x08ac('0x28')](handleEntityNotFound(_0x5af53,null))[_0x08ac('0x28')](function(_0xd367a6){if(_0xd367a6){_0x47ada2['body']['AccountId']=_0xd367a6['id'];_0x47ada2[_0x08ac('0x4d')][_0x08ac('0x51')]=integrations[_0x08ac('0x52')](_0x47ada2['body']['channel'],_0x47ada2[_0x08ac('0x4d')][_0x08ac('0x31')]);_0x47ada2[_0x08ac('0x4d')]['Descriptions']=integrations[_0x08ac('0x53')](_0x47ada2['body']['channel'],_0x47ada2[_0x08ac('0x4d')]['type']);return db['ZohoConfiguration'][_0x08ac('0x4c')](_0x47ada2[_0x08ac('0x4d')],{'include':[{'model':db[_0x08ac('0x54')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x08ac('0x55')}]});}return null;})[_0x08ac('0x28')](respondWithResult(_0x5af53,null))[_0x08ac('0x46')](handleError(_0x5af53,null));};function getAccessToken(_0x4d9684){return new Promise(function(_0x22382c,_0x208fc0){var _0x316ab2;switch(_0x4d9684[_0x08ac('0x56')]){case'US':_0x316ab2=_0x08ac('0x57');break;case'AU':_0x316ab2=_0x08ac('0x58');break;case'EU':_0x316ab2=_0x08ac('0x59');break;case'IN':_0x316ab2=_0x08ac('0x5a');break;case'CN':_0x316ab2=_0x08ac('0x5b');break;default:_0x316ab2='https://accounts.zoho.eu';break;}var _0x466759={'method':_0x08ac('0x5c'),'uri':_0x316ab2+_0x08ac('0x5d'),'qs':{'refresh_token':_0x4d9684[_0x08ac('0x5e')],'client_id':_0x4d9684[_0x08ac('0x5f')],'client_secret':_0x4d9684[_0x08ac('0x60')],'grant_type':_0x08ac('0x61')},'json':!![]};return rp(_0x466759)[_0x08ac('0x28')](function(_0x356660){if(_0x356660[_0x08ac('0x62')]){_0x22382c(_0x356660[_0x08ac('0x62')]);}else{_0x208fc0(_0x08ac('0x63'));}})[_0x08ac('0x46')](function(_0x1b3cc3){_0x208fc0(_0x1b3cc3);});});}exports[_0x08ac('0x64')]=function(_0xec2a5,_0x5a719e,_0x5af2af){var _0x7cb17a,_0x5c8475,_0x2efd79,_0x5e0486,_0xb87eb9;return db[_0x08ac('0x2f')][_0x08ac('0x50')]({'where':{'id':_0xec2a5['params']['id']},'attributes':['id','host',_0x08ac('0x56'),_0x08ac('0x5f'),'clientSecret','serverUrl',_0x08ac('0x65'),'refreshToken']})['then'](handleEntityNotFound(_0x5a719e,null))[_0x08ac('0x28')](function(_0x449878){_0xb87eb9=_0x449878;_0x7cb17a=_0xb87eb9[_0x08ac('0x66')];_0x5c8475=_0x7cb17a===_0x08ac('0x67')?'eu':_0x08ac('0x68');_0x2efd79=_0xb87eb9['serverUrl'];var _0x157740=_0x2efd79[_0x08ac('0x69')](-0x1);if(_0x157740==='/'||_0x157740==='\x5c'||_0x157740===':'){_0x2efd79=_0x2efd79['substring'](0x0,_0x2efd79[_0x08ac('0x6a')](_0x157740));}if(!_0xb87eb9[_0x08ac('0x5e')]){throw new Error(_0x08ac('0x6b'));}return getAccessToken(_0xb87eb9);})[_0x08ac('0x28')](function(_0x24a1f8){if(_0x24a1f8){return rp({'method':_0x08ac('0x6c'),'uri':util[_0x08ac('0x6d')](_0x08ac('0x6e'),_0x5c8475),'qs':{'module':_0x08ac('0x6f')},'headers':{'Authorization':_0x08ac('0x70')+_0x24a1f8},'json':!![]});}})[_0x08ac('0x28')](function(_0x1c3ea0){if(_0x1c3ea0){if(_0x1c3ea0[_0x08ac('0x71')]&&_0x1c3ea0[_0x08ac('0x71')][_0x08ac('0x29')]){throw new Error(_0x1c3ea0['response']['error'][_0x08ac('0x72')]);}var _0x36b782=[];var _0xc63007=[];var _0x321f5c=[_0x08ac('0x73'),_0x08ac('0x74'),_0x08ac('0x75'),_0x08ac('0x76'),'Call_Duration',_0x08ac('0x77'),_0x08ac('0x78'),_0x08ac('0x79')];_0xc63007=_[_0x08ac('0x7a')](_0x1c3ea0[_0x08ac('0x38')],function(_0x5add38){return _0x321f5c[_0x08ac('0x7b')](_0x5add38[_0x08ac('0x7c')]);});for(var _0x50deef=0x0;_0x50deef<_0xc63007[_0x08ac('0x39')];_0x50deef++){if(_0xc63007[_0x50deef][_0x08ac('0x7d')]===![]){_0x36b782[_0x08ac('0x7e')]({'id':_0xc63007[_0x50deef]['id'],'name':_0xc63007[_0x50deef]['display_label'],'custom':_0xc63007[_0x50deef][_0x08ac('0x7f')],'options':_0xc63007[_0x50deef][_0x08ac('0x80')]===_0x08ac('0x81')&&_0xc63007[_0x50deef][_0x08ac('0x82')][_0x08ac('0x39')]>-0x1?_['map'](_0xc63007[_0x50deef][_0x08ac('0x82')],function(_0x39feeb){return{'name':_0x39feeb,'value':_0x39feeb};}):[]});}}return{'count':_0x36b782['length'],'rows':_0x36b782};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5a719e,null))[_0x08ac('0x46')](function(_0x33b1bd){var _0x4b8d2a=_0xec2a5[_0x08ac('0x34')][_0x08ac('0x83')]?0x1f4:_0x33b1bd[_0x08ac('0x84')]||0x1f4;logger[_0x08ac('0x29')](_0x08ac('0x85'),'getFields',_0x4b8d2a,JSON[_0x08ac('0x86')](_0x33b1bd));delete _0x33b1bd[_0x08ac('0x2b')];if(_0x4b8d2a===0x191){_0x4b8d2a=0x190;}_0x5a719e[_0x08ac('0x22')](_0x4b8d2a)['send'](_0xec2a5[_0x08ac('0x34')][_0x08ac('0x83')]?{'message':'Wrong\x20credentials','statusCode':_0x33b1bd[_0x08ac('0x84')]}:_0x33b1bd);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c7a0423..62ab410 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 _0x00d5=['util','api','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','then','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','https://accounts.zoho.eu','/oauth/v2/token','refresh_token','refreshToken'];(function(_0x37a677,_0x442881){var _0x11f5d9=function(_0x2210da){while(--_0x2210da){_0x37a677['push'](_0x37a677['shift']());}};_0x11f5d9(++_0x442881);}(_0x00d5,0x78));var _0x500d=function(_0x37c054,_0x1cf983){_0x37c054=_0x37c054-0x0;var _0x20e5ef=_0x00d5[_0x37c054];return _0x20e5ef;};'use strict';var _=require('lodash');var util=require(_0x500d('0x0'));var logger=require('../../config/logger')(_0x500d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x500d('0x2'));var rimraf=require(_0x500d('0x3'));var config=require(_0x500d('0x4'));var attributes=require(_0x500d('0x5'));var integrations=require(_0x500d('0x6'));module[_0x500d('0x7')]=function(_0x3e8059,_0x2d3110){return _0x3e8059['define'](_0x500d('0x8'),attributes,{'tableName':_0x500d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcb4227,_0x46c5d6,_0x4ac972){if(_0xcb4227['changed'](_0x500d('0xa'))||_0xcb4227['changed'](_0x500d('0xb'))||_0xcb4227[_0x500d('0xc')](_0x500d('0xd'))||_0xcb4227[_0x500d('0xc')](_0x500d('0xe'))||_0xcb4227[_0x500d('0xc')](_0x500d('0xf'))||_0xcb4227['changed'](_0x500d('0x10'))){var _0x10b467,_0x26325;_0x10b467=_0xcb4227['serverUrl'];var _0x72e3fc=_0x10b467['slice'](-0x1);if(_0x72e3fc==='/'||_0x72e3fc==='\x5c'||_0x72e3fc===':'){_0x10b467=_0x10b467[_0x500d('0x11')](0x0,_0x10b467[_0x500d('0x12')](_0x72e3fc));}switch(_0xcb4227[_0x500d('0xa')]){case'US':_0x26325=_0x500d('0x13');break;case'AU':_0x26325=_0x500d('0x14');break;case'IN':_0x26325=_0x500d('0x15');break;case'CN':_0x26325=_0x500d('0x16');break;default:_0x26325='https://accounts.zoho.eu';break;}var _0xc43bdd={'method':_0x500d('0x17'),'uri':_0x26325+'/oauth/v2/token','form':{'grant_type':_0x500d('0x18'),'client_id':_0xcb4227[_0x500d('0xd')],'client_secret':_0xcb4227[_0x500d('0xe')],'redirect_uri':_0xcb4227[_0x500d('0xb')],'code':_0xcb4227[_0x500d('0xf')]},'headers':{'Content-Type':_0x500d('0x19')}};return rp(_0xc43bdd)[_0x500d('0x1a')](function(_0x140b54){var _0x708f9e=JSON['parse'](_0x140b54);if(_0x708f9e['refresh_token']){_0xcb4227['refreshToken']=_0x708f9e['refresh_token'];logger[_0x500d('0x1b')](util[_0x500d('0x1c')](_0x500d('0x1d'),_0xcb4227[_0x500d('0x1e')],_0xcb4227['id']));}else{logger[_0x500d('0x1f')](util[_0x500d('0x1c')](_0x500d('0x20'),_0xcb4227[_0x500d('0x1e')],_0xcb4227['id']),util[_0x500d('0x21')](_0x708f9e,{'showHidden':![],'depth':null}));}return _0x4ac972(null,_0x46c5d6);})[_0x500d('0x22')](function(_0x5acb10){logger[_0x500d('0x1f')](util['format'](_0x500d('0x20'),_0xcb4227[_0x500d('0x1e')],_0xcb4227['id']),util[_0x500d('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ac972(_0x5acb10);});}else{return _0x4ac972(null,_0x46c5d6);}},'beforeUpdate':function(_0x81f1da,_0x261054,_0x1286d4){if(_0x81f1da[_0x500d('0xc')](_0x500d('0xa'))||_0x81f1da[_0x500d('0xc')]('serverUrl')||_0x81f1da[_0x500d('0xc')](_0x500d('0xd'))||_0x81f1da['changed'](_0x500d('0xe'))||_0x81f1da[_0x500d('0xc')]('code')||_0x81f1da['changed'](_0x500d('0x10'))){var _0x168582,_0x58e32d;_0x168582=_0x81f1da[_0x500d('0xb')];var _0x2bf0f8=_0x168582[_0x500d('0x23')](-0x1);if(_0x2bf0f8==='/'||_0x2bf0f8==='\x5c'||_0x2bf0f8===':'){_0x168582=_0x168582[_0x500d('0x11')](0x0,_0x168582[_0x500d('0x12')](_0x2bf0f8));}switch(_0x81f1da[_0x500d('0xa')]){case'US':_0x58e32d=_0x500d('0x13');break;case'AU':_0x58e32d=_0x500d('0x14');break;case'IN':_0x58e32d=_0x500d('0x15');break;case'CN':_0x58e32d=_0x500d('0x16');break;default:_0x58e32d=_0x500d('0x24');break;}var _0x1f7709={'method':_0x500d('0x17'),'uri':_0x58e32d+_0x500d('0x25'),'form':{'grant_type':_0x500d('0x18'),'client_id':_0x81f1da[_0x500d('0xd')],'client_secret':_0x81f1da[_0x500d('0xe')],'redirect_uri':_0x81f1da[_0x500d('0xb')],'code':_0x81f1da[_0x500d('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1f7709)[_0x500d('0x1a')](function(_0x4739d1){var _0x34d45c=JSON['parse'](_0x4739d1);if(_0x34d45c[_0x500d('0x26')]){_0x81f1da[_0x500d('0x27')]=_0x34d45c['refresh_token'];logger[_0x500d('0x1b')](util[_0x500d('0x1c')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x81f1da[_0x500d('0x1e')],_0x81f1da['id']));}else{logger[_0x500d('0x1f')](util[_0x500d('0x1c')](_0x500d('0x20'),_0x81f1da[_0x500d('0x1e')],_0x81f1da['id']),util['inspect'](_0x34d45c,{'showHidden':![],'depth':null}));}return _0x1286d4(null,_0x261054);})[_0x500d('0x22')](function(_0x10674b){logger[_0x500d('0x1f')](util[_0x500d('0x1c')](_0x500d('0x20'),_0x81f1da[_0x500d('0x1e')],_0x81f1da['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1286d4(_0x10674b);});}else{return _0x1286d4(null,_0x261054);}}}});}; \ No newline at end of file +var _0xa59a=['application/x-www-form-urlencoded','then','refresh_token','refreshToken','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','parse','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','changed','serverUrl','clientId','host','slice','substring','zone','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','code'];(function(_0x24d72c,_0x24fe61){var _0x39c9d6=function(_0x265058){while(--_0x265058){_0x24d72c['push'](_0x24d72c['shift']());}};_0x39c9d6(++_0x24fe61);}(_0xa59a,0x1a9));var _0xaa59=function(_0x55430d,_0x27a795){_0x55430d=_0x55430d-0x0;var _0x5ad12e=_0xa59a[_0x55430d];return _0x5ad12e;};'use strict';var _=require(_0xaa59('0x0'));var util=require(_0xaa59('0x1'));var logger=require(_0xaa59('0x2'))(_0xaa59('0x3'));var moment=require(_0xaa59('0x4'));var BPromise=require(_0xaa59('0x5'));var rp=require(_0xaa59('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa59('0x7'));var config=require(_0xaa59('0x8'));var attributes=require(_0xaa59('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xb51b83,_0x455d9a){return _0xb51b83[_0xaa59('0xa')](_0xaa59('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21e9c2,_0x2d7c2b,_0xb81e24){if(_0x21e9c2[_0xaa59('0xc')]('zone')||_0x21e9c2['changed'](_0xaa59('0xd'))||_0x21e9c2[_0xaa59('0xc')](_0xaa59('0xe'))||_0x21e9c2[_0xaa59('0xc')]('clientSecret')||_0x21e9c2[_0xaa59('0xc')]('code')||_0x21e9c2[_0xaa59('0xc')](_0xaa59('0xf'))){var _0x35c21b,_0x14a6d2;_0x35c21b=_0x21e9c2[_0xaa59('0xd')];var _0x388e23=_0x35c21b[_0xaa59('0x10')](-0x1);if(_0x388e23==='/'||_0x388e23==='\x5c'||_0x388e23===':'){_0x35c21b=_0x35c21b[_0xaa59('0x11')](0x0,_0x35c21b['lastIndexOf'](_0x388e23));}switch(_0x21e9c2[_0xaa59('0x12')]){case'US':_0x14a6d2='https://accounts.zoho.com';break;case'AU':_0x14a6d2='https://accounts.zoho.com.au';break;case'IN':_0x14a6d2=_0xaa59('0x13');break;case'CN':_0x14a6d2='https://accounts.zoho.com.cn';break;default:_0x14a6d2=_0xaa59('0x14');break;}var _0x1f0843={'method':_0xaa59('0x15'),'uri':_0x14a6d2+_0xaa59('0x16'),'form':{'grant_type':_0xaa59('0x17'),'client_id':_0x21e9c2['clientId'],'client_secret':_0x21e9c2[_0xaa59('0x18')],'redirect_uri':_0x21e9c2[_0xaa59('0xd')],'code':_0x21e9c2[_0xaa59('0x19')]},'headers':{'Content-Type':_0xaa59('0x1a')}};return rp(_0x1f0843)[_0xaa59('0x1b')](function(_0x5f4708){var _0x1b7951=JSON['parse'](_0x5f4708);if(_0x1b7951[_0xaa59('0x1c')]){_0x21e9c2[_0xaa59('0x1d')]=_0x1b7951[_0xaa59('0x1c')];logger['info'](util[_0xaa59('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x21e9c2[_0xaa59('0x1f')],_0x21e9c2['id']));}else{logger[_0xaa59('0x20')](util[_0xaa59('0x1e')](_0xaa59('0x21'),_0x21e9c2['name'],_0x21e9c2['id']),util[_0xaa59('0x22')](_0x1b7951,{'showHidden':![],'depth':null}));}return _0xb81e24(null,_0x2d7c2b);})[_0xaa59('0x23')](function(_0x24e069){logger['error'](util[_0xaa59('0x1e')](_0xaa59('0x21'),_0x21e9c2[_0xaa59('0x1f')],_0x21e9c2['id']),util[_0xaa59('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0xb81e24(_0x24e069);});}else{return _0xb81e24(null,_0x2d7c2b);}},'beforeUpdate':function(_0x5633e1,_0x172728,_0x32fb29){if(_0x5633e1[_0xaa59('0xc')]('zone')||_0x5633e1[_0xaa59('0xc')]('serverUrl')||_0x5633e1[_0xaa59('0xc')](_0xaa59('0xe'))||_0x5633e1[_0xaa59('0xc')](_0xaa59('0x18'))||_0x5633e1[_0xaa59('0xc')]('code')||_0x5633e1[_0xaa59('0xc')]('host')){var _0x45183d,_0x3d139c;_0x45183d=_0x5633e1[_0xaa59('0xd')];var _0x32e7e0=_0x45183d[_0xaa59('0x10')](-0x1);if(_0x32e7e0==='/'||_0x32e7e0==='\x5c'||_0x32e7e0===':'){_0x45183d=_0x45183d['substring'](0x0,_0x45183d[_0xaa59('0x24')](_0x32e7e0));}switch(_0x5633e1[_0xaa59('0x12')]){case'US':_0x3d139c='https://accounts.zoho.com';break;case'AU':_0x3d139c=_0xaa59('0x25');break;case'IN':_0x3d139c=_0xaa59('0x13');break;case'CN':_0x3d139c=_0xaa59('0x26');break;default:_0x3d139c=_0xaa59('0x14');break;}var _0x4d99c4={'method':'POST','uri':_0x3d139c+'/oauth/v2/token','form':{'grant_type':_0xaa59('0x17'),'client_id':_0x5633e1[_0xaa59('0xe')],'client_secret':_0x5633e1[_0xaa59('0x18')],'redirect_uri':_0x5633e1[_0xaa59('0xd')],'code':_0x5633e1['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4d99c4)[_0xaa59('0x1b')](function(_0x1e6325){var _0x38d3cb=JSON[_0xaa59('0x27')](_0x1e6325);if(_0x38d3cb['refresh_token']){_0x5633e1['refreshToken']=_0x38d3cb[_0xaa59('0x1c')];logger['info'](util[_0xaa59('0x1e')](_0xaa59('0x28'),_0x5633e1[_0xaa59('0x1f')],_0x5633e1['id']));}else{logger[_0xaa59('0x20')](util[_0xaa59('0x1e')](_0xaa59('0x21'),_0x5633e1[_0xaa59('0x1f')],_0x5633e1['id']),util['inspect'](_0x38d3cb,{'showHidden':![],'depth':null}));}return _0x32fb29(null,_0x172728);})[_0xaa59('0x23')](function(_0x36ec44){logger['error'](util[_0xaa59('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5633e1[_0xaa59('0x1f')],_0x5633e1['id']),util[_0xaa59('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x32fb29(_0x36ec44);});}else{return _0x32fb29(null,_0x172728);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 38a98d7..9227bfd 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 _0x887b=['debug','find','where','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ZohoAccount','findAll','options','attributes','limit','include','map','model','then','GetZohoAccount'];(function(_0x55c350,_0x22ba34){var _0x339af3=function(_0x11e103){while(--_0x11e103){_0x55c350['push'](_0x55c350['shift']());}};_0x339af3(++_0x22ba34);}(_0x887b,0x185));var _0xb887=function(_0x2cba3e,_0x79e553){_0x2cba3e=_0x2cba3e-0x0;var _0x2c5dea=_0x887b[_0x2cba3e];return _0x2c5dea;};'use strict';var _=require(_0xb887('0x0'));var util=require(_0xb887('0x1'));var moment=require(_0xb887('0x2'));var BPromise=require(_0xb887('0x3'));var rs=require(_0xb887('0x4'));var fs=require('fs');var Redis=require(_0xb887('0x5'));var db=require(_0xb887('0x6'))['db'];var utils=require(_0xb887('0x7'));var logger=require(_0xb887('0x8'))('rpc');var config=require(_0xb887('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x332507,_0x353587,_0x59707f){return new BPromise(function(_0x4a1c1e,_0x32ace2){return client[_0xb887('0xa')](_0x332507,_0x59707f)['then'](function(_0x49962f){logger['info'](_0xb887('0xb'),_0x353587,_0xb887('0xc'));logger['debug'](_0xb887('0xd'),_0x353587,'request\x20sent',JSON[_0xb887('0xe')](_0x49962f));if(_0x49962f[_0xb887('0xf')]){if(_0x49962f[_0xb887('0xf')][_0xb887('0x10')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x353587,_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);return _0x32ace2(_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);}logger[_0xb887('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x353587,_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);return _0x4a1c1e(_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);}else{logger[_0xb887('0x12')](_0xb887('0xb'),_0x353587,_0xb887('0xc'));_0x4a1c1e(_0x49962f[_0xb887('0x13')][_0xb887('0x11')]);}})[_0xb887('0x14')](function(_0x2f4e2d){logger[_0xb887('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x353587,_0x2f4e2d);_0x32ace2(_0x2f4e2d);});});}exports['GetZohoAccount']=function(_0x279ab0){var _0x33b7e0=this;return new Promise(function(_0x4aa052,_0x21d7dc){return db[_0xb887('0x15')][_0xb887('0x16')]({'raw':_0x279ab0[_0xb887('0x17')]?_0x279ab0[_0xb887('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x279ab0[_0xb887('0x17')]?_0x279ab0['options']['where']||null:null,'attributes':_0x279ab0[_0xb887('0x17')]?_0x279ab0[_0xb887('0x17')][_0xb887('0x18')]||null:null,'limit':_0x279ab0['options']?_0x279ab0['options'][_0xb887('0x19')]||null:null,'include':_0x279ab0['options']?_0x279ab0[_0xb887('0x17')][_0xb887('0x1a')]?_[_0xb887('0x1b')](_0x279ab0[_0xb887('0x17')]['include'],function(_0x17dd2f){return{'model':db[_0x17dd2f[_0xb887('0x1c')]],'as':_0x17dd2f['as'],'attributes':_0x17dd2f[_0xb887('0x18')],'include':_0x17dd2f['include']?_[_0xb887('0x1b')](_0x17dd2f['include'],function(_0x198351){return{'model':db[_0x198351[_0xb887('0x1c')]],'as':_0x198351['as'],'attributes':_0x198351[_0xb887('0x18')],'include':_0x198351['include']?_['map'](_0x198351[_0xb887('0x1a')],function(_0x1496cd){return{'model':db[_0x1496cd[_0xb887('0x1c')]],'as':_0x1496cd['as'],'attributes':_0x1496cd[_0xb887('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb887('0x1d')](function(_0x233e78){logger['info'](_0xb887('0x1e'),_0x279ab0);logger[_0xb887('0x1f')](_0xb887('0x1e'),_0x279ab0,JSON[_0xb887('0xe')](_0x233e78));_0x4aa052(_0x233e78);})['catch'](function(_0x25002c){logger['error'](_0xb887('0x1e'),_0x25002c[_0xb887('0x11')],_0x279ab0);_0x21d7dc(_0x33b7e0[_0xb887('0xf')](0x1f4,_0x25002c[_0xb887('0x11')]));});});};exports['ShowZohoAccount']=function(_0x346e5b){var _0x3db03a=this;return new Promise(function(_0x560c72,_0x256454){return db[_0xb887('0x15')][_0xb887('0x20')]({'raw':_0x346e5b['options']?_0x346e5b[_0xb887('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x346e5b[_0xb887('0x17')]?_0x346e5b['options'][_0xb887('0x21')]||null:null,'attributes':_0x346e5b[_0xb887('0x17')]?_0x346e5b[_0xb887('0x17')][_0xb887('0x18')]||null:null,'include':_0x346e5b['options']?_0x346e5b[_0xb887('0x17')][_0xb887('0x1a')]?_[_0xb887('0x1b')](_0x346e5b[_0xb887('0x17')]['include'],function(_0x33bcc8){return{'model':db[_0x33bcc8[_0xb887('0x1c')]],'as':_0x33bcc8['as'],'attributes':_0x33bcc8[_0xb887('0x18')],'include':_0x33bcc8[_0xb887('0x1a')]?_[_0xb887('0x1b')](_0x33bcc8[_0xb887('0x1a')],function(_0x3c9737){return{'model':db[_0x3c9737['model']],'as':_0x3c9737['as'],'attributes':_0x3c9737[_0xb887('0x18')],'include':_0x3c9737[_0xb887('0x1a')]?_['map'](_0x3c9737[_0xb887('0x1a')],function(_0x1debfd){return{'model':db[_0x1debfd['model']],'as':_0x1debfd['as'],'attributes':_0x1debfd[_0xb887('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb887('0x1d')](function(_0x4760aa){logger['info']('ShowZohoAccount',_0x346e5b);logger['debug']('ShowZohoAccount',_0x346e5b,JSON[_0xb887('0xe')](_0x4760aa));_0x560c72(_0x4760aa);})[_0xb887('0x14')](function(_0x4f057c){logger[_0xb887('0xf')](_0xb887('0x22'),_0x4f057c[_0xb887('0x11')],_0x346e5b);_0x256454(_0x3db03a['error'](0x1f4,_0x4f057c[_0xb887('0x11')]));});});}; \ No newline at end of file +var _0x7292=['where','attributes','include','map','model','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x1da017,_0x440f48){var _0x2e989c=function(_0x913545){while(--_0x913545){_0x1da017['push'](_0x1da017['shift']());}};_0x2e989c(++_0x440f48);}(_0x7292,0x6d));var _0x2729=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x7292[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var moment=require(_0x2729('0x2'));var BPromise=require(_0x2729('0x3'));var rs=require(_0x2729('0x4'));var fs=require('fs');var Redis=require(_0x2729('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2729('0x6'));var logger=require(_0x2729('0x7'))(_0x2729('0x8'));var config=require(_0x2729('0x9'));var jayson=require(_0x2729('0xa'));var client=jayson['client'][_0x2729('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e9245,_0x32c498,_0x15612c){return new BPromise(function(_0x3b4f90,_0x33d118){return client['request'](_0x3e9245,_0x15612c)[_0x2729('0xc')](function(_0x5b3014){logger[_0x2729('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x32c498,'request\x20sent');logger[_0x2729('0xe')](_0x2729('0xf'),_0x32c498,_0x2729('0x10'),JSON[_0x2729('0x11')](_0x5b3014));if(_0x5b3014[_0x2729('0x12')]){if(_0x5b3014[_0x2729('0x12')]['code']===0x1f4){logger['error'](_0x2729('0x13'),_0x32c498,_0x5b3014[_0x2729('0x12')][_0x2729('0x14')]);return _0x33d118(_0x5b3014['error']['message']);}logger[_0x2729('0x12')](_0x2729('0x13'),_0x32c498,_0x5b3014[_0x2729('0x12')]['message']);return _0x3b4f90(_0x5b3014[_0x2729('0x12')][_0x2729('0x14')]);}else{logger[_0x2729('0xd')](_0x2729('0x13'),_0x32c498,_0x2729('0x10'));_0x3b4f90(_0x5b3014['result'][_0x2729('0x14')]);}})[_0x2729('0x15')](function(_0x1a2333){logger[_0x2729('0x12')](_0x2729('0x13'),_0x32c498,_0x1a2333);_0x33d118(_0x1a2333);});});}exports[_0x2729('0x16')]=function(_0x2b5bad){var _0x418b89=this;return new Promise(function(_0x807abf,_0xe4dc1d){return db[_0x2729('0x17')][_0x2729('0x18')]({'raw':_0x2b5bad[_0x2729('0x19')]?_0x2b5bad[_0x2729('0x19')][_0x2729('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b5bad[_0x2729('0x19')]?_0x2b5bad[_0x2729('0x19')][_0x2729('0x1b')]||null:null,'attributes':_0x2b5bad[_0x2729('0x19')]?_0x2b5bad[_0x2729('0x19')][_0x2729('0x1c')]||null:null,'limit':_0x2b5bad[_0x2729('0x19')]?_0x2b5bad[_0x2729('0x19')]['limit']||null:null,'include':_0x2b5bad['options']?_0x2b5bad[_0x2729('0x19')][_0x2729('0x1d')]?_[_0x2729('0x1e')](_0x2b5bad[_0x2729('0x19')]['include'],function(_0x16d69f){return{'model':db[_0x16d69f['model']],'as':_0x16d69f['as'],'attributes':_0x16d69f[_0x2729('0x1c')],'include':_0x16d69f[_0x2729('0x1d')]?_[_0x2729('0x1e')](_0x16d69f['include'],function(_0x320de3){return{'model':db[_0x320de3['model']],'as':_0x320de3['as'],'attributes':_0x320de3[_0x2729('0x1c')],'include':_0x320de3['include']?_[_0x2729('0x1e')](_0x320de3[_0x2729('0x1d')],function(_0x56e64d){return{'model':db[_0x56e64d[_0x2729('0x1f')]],'as':_0x56e64d['as'],'attributes':_0x56e64d[_0x2729('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b40bd){logger[_0x2729('0xd')](_0x2729('0x16'),_0x2b5bad);logger[_0x2729('0xe')](_0x2729('0x16'),_0x2b5bad,JSON['stringify'](_0x5b40bd));_0x807abf(_0x5b40bd);})[_0x2729('0x15')](function(_0x23d7ed){logger[_0x2729('0x12')](_0x2729('0x16'),_0x23d7ed[_0x2729('0x14')],_0x2b5bad);_0xe4dc1d(_0x418b89[_0x2729('0x12')](0x1f4,_0x23d7ed[_0x2729('0x14')]));});});};exports[_0x2729('0x20')]=function(_0x16c700){var _0x38cbab=this;return new Promise(function(_0x5e122f,_0x4dd9e2){return db[_0x2729('0x17')][_0x2729('0x21')]({'raw':_0x16c700[_0x2729('0x19')]?_0x16c700['options']['raw']===undefined?!![]:![]:!![],'where':_0x16c700['options']?_0x16c700[_0x2729('0x19')][_0x2729('0x1b')]||null:null,'attributes':_0x16c700[_0x2729('0x19')]?_0x16c700['options'][_0x2729('0x1c')]||null:null,'include':_0x16c700[_0x2729('0x19')]?_0x16c700[_0x2729('0x19')][_0x2729('0x1d')]?_[_0x2729('0x1e')](_0x16c700['options'][_0x2729('0x1d')],function(_0x4aa819){return{'model':db[_0x4aa819[_0x2729('0x1f')]],'as':_0x4aa819['as'],'attributes':_0x4aa819[_0x2729('0x1c')],'include':_0x4aa819['include']?_['map'](_0x4aa819[_0x2729('0x1d')],function(_0x508efc){return{'model':db[_0x508efc['model']],'as':_0x508efc['as'],'attributes':_0x508efc['attributes'],'include':_0x508efc[_0x2729('0x1d')]?_[_0x2729('0x1e')](_0x508efc[_0x2729('0x1d')],function(_0x22fdbb){return{'model':db[_0x22fdbb[_0x2729('0x1f')]],'as':_0x22fdbb['as'],'attributes':_0x22fdbb[_0x2729('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2729('0xc')](function(_0x1fc20d){logger['info']('ShowZohoAccount',_0x16c700);logger[_0x2729('0xe')](_0x2729('0x20'),_0x16c700,JSON['stringify'](_0x1fc20d));_0x5e122f(_0x1fc20d);})['catch'](function(_0x41fa5c){logger[_0x2729('0x12')](_0x2729('0x20'),_0x41fa5c[_0x2729('0x14')],_0x16c700);_0x4dd9e2(_0x38cbab[_0x2729('0x12')](0x1f4,_0x41fa5c[_0x2729('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 655fa25..d53640a 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 _0x8b08=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x8b08,0x9d));var _0x88b0=function(_0x5ca9fd,_0xd18db){_0x5ca9fd=_0x5ca9fd-0x0;var _0x3f10d8=_0x8b08[_0x5ca9fd];return _0x3f10d8;};'use strict';var multer=require(_0x88b0('0x0'));var util=require(_0x88b0('0x1'));var path=require(_0x88b0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x88b0('0x3'));var auth=require(_0x88b0('0x4'));var interaction=require(_0x88b0('0x5'));var config=require(_0x88b0('0x6'));var controller=require(_0x88b0('0x7'));router[_0x88b0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x88b0('0x9')](),controller[_0x88b0('0xa')]);router['get']('/:id/fields',auth[_0x88b0('0x9')](),controller[_0x88b0('0xb')]);router[_0x88b0('0x8')](_0x88b0('0xc'),auth['isAuthenticated'](),controller[_0x88b0('0xd')]);router[_0x88b0('0x8')]('/:id/descriptions',auth[_0x88b0('0x9')](),controller[_0x88b0('0xe')]);router[_0x88b0('0xf')]('/',auth[_0x88b0('0x9')](),controller[_0x88b0('0x10')]);router[_0x88b0('0x11')](_0x88b0('0x12'),auth['isAuthenticated'](),controller[_0x88b0('0x13')]);router[_0x88b0('0x14')](_0x88b0('0x12'),auth[_0x88b0('0x9')](),controller[_0x88b0('0x15')]);module[_0x88b0('0x16')]=router; \ No newline at end of file +var _0xd37f=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0xc95e52,_0x3c4532){var _0x1d747f=function(_0x427918){while(--_0x427918){_0xc95e52['push'](_0xc95e52['shift']());}};_0x1d747f(++_0x3c4532);}(_0xd37f,0x67));var _0xfd37=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xd37f[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0xfd37('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd37('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfd37('0x2'));var auth=require(_0xfd37('0x3'));var interaction=require(_0xfd37('0x4'));var config=require(_0xfd37('0x5'));var controller=require(_0xfd37('0x6'));router[_0xfd37('0x7')]('/',auth[_0xfd37('0x8')](),controller[_0xfd37('0x9')]);router[_0xfd37('0x7')](_0xfd37('0xa'),auth[_0xfd37('0x8')](),controller[_0xfd37('0xb')]);router[_0xfd37('0x7')](_0xfd37('0xc'),auth['isAuthenticated'](),controller[_0xfd37('0xd')]);router[_0xfd37('0x7')](_0xfd37('0xe'),auth[_0xfd37('0x8')](),controller[_0xfd37('0xf')]);router[_0xfd37('0x7')]('/:id/descriptions',auth[_0xfd37('0x8')](),controller[_0xfd37('0x10')]);router[_0xfd37('0x11')]('/',auth[_0xfd37('0x8')](),controller['create']);router[_0xfd37('0x12')](_0xfd37('0xa'),auth[_0xfd37('0x8')](),controller[_0xfd37('0x13')]);router[_0xfd37('0x14')](_0xfd37('0xa'),auth[_0xfd37('0x8')](),controller[_0xfd37('0x15')]);module[_0xfd37('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 70a0307..0f4c835 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 _0x1bcd=['ENUM','lead','contact','nothing','contact_lead','STRING','exports'];(function(_0x255944,_0x2ab465){var _0x183b97=function(_0x2d963b){while(--_0x2d963b){_0x255944['push'](_0x255944['shift']());}};_0x183b97(++_0x2ab465);}(_0x1bcd,0xf4));var _0xd1bc=function(_0x40095c,_0x394d4f){_0x40095c=_0x40095c-0x0;var _0x5590cf=_0x1bcd[_0x40095c];return _0x5590cf;};'use strict';var Sequelize=require('sequelize');module[_0xd1bc('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xd1bc('0x1')](_0xd1bc('0x2'),_0xd1bc('0x3'),_0xd1bc('0x4')),'defaultValue':_0xd1bc('0x2')},'moduleSearch':{'type':Sequelize[_0xd1bc('0x1')](_0xd1bc('0x5'),_0xd1bc('0x3'),_0xd1bc('0x2')),'defaultValue':_0xd1bc('0x5')},'description':{'type':Sequelize[_0xd1bc('0x6')]}}; \ No newline at end of file +var _0x2138=['STRING','lead','contact','nothing','ENUM','contact_lead','sequelize','exports'];(function(_0x4a68a4,_0x1e587a){var _0xf2940e=function(_0x3021dc){while(--_0x3021dc){_0x4a68a4['push'](_0x4a68a4['shift']());}};_0xf2940e(++_0x1e587a);}(_0x2138,0x1ce));var _0x8213=function(_0x3d018f,_0x245821){_0x3d018f=_0x3d018f-0x0;var _0x859012=_0x2138[_0x3d018f];return _0x859012;};'use strict';var Sequelize=require(_0x8213('0x0'));module[_0x8213('0x1')]={'name':{'type':Sequelize[_0x8213('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x8213('0x3'),_0x8213('0x4'),_0x8213('0x5')),'defaultValue':_0x8213('0x3')},'moduleSearch':{'type':Sequelize[_0x8213('0x6')](_0x8213('0x7'),'contact','lead'),'defaultValue':_0x8213('0x7')},'description':{'type':Sequelize[_0x8213('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4c90467..1cc3cc6 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 _0xc0ba=['../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','findAll','show','include','find','create','body','catch','params','getFields','findOne','ZohoField','pick','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc0ba,0x1d3));var _0xac0b=function(_0x2dd195,_0x4c1c1b){_0x2dd195=_0x2dd195-0x0;var _0x3358c8=_0xc0ba[_0x2dd195];return _0x3358c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac0b('0x0'));var zipdir=require(_0xac0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac0b('0x2'));var moment=require(_0xac0b('0x3'));var BPromise=require(_0xac0b('0x4'));var Mustache=require(_0xac0b('0x5'));var util=require(_0xac0b('0x6'));var path=require(_0xac0b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac0b('0x8'));var fs=require('fs');var fs_extra=require(_0xac0b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xac0b('0xa'));var jsforce=require(_0xac0b('0xb'));var deskjs=require(_0xac0b('0xc'));var toCsv=require(_0xac0b('0xd'));var querystring=require(_0xac0b('0xe'));var Papa=require(_0xac0b('0xf'));var Redis=require(_0xac0b('0x10'));var authService=require(_0xac0b('0x11'));var qs=require(_0xac0b('0x12'));var as=require(_0xac0b('0x13'));var hardwareService=require(_0xac0b('0x14'));var logger=require(_0xac0b('0x15'))(_0xac0b('0x16'));var utils=require('../../config/utils');var config=require(_0xac0b('0x17'));var licenseUtil=require(_0xac0b('0x18'));var db=require(_0xac0b('0x19'))['db'];function respondWithStatusCode(_0x2c24f8,_0x5f58a5){_0x5f58a5=_0x5f58a5||0xcc;return function(_0x2646c7){if(_0x2646c7){return _0x2c24f8[_0xac0b('0x1a')](_0x5f58a5);}return _0x2c24f8['status'](_0x5f58a5)[_0xac0b('0x1b')]();};}function respondWithResult(_0x48f592,_0x143857){_0x143857=_0x143857||0xc8;return function(_0x5cd0c4){if(_0x5cd0c4){return _0x48f592['status'](_0x143857)[_0xac0b('0x1c')](_0x5cd0c4);}};}function respondWithFilteredResult(_0x5d1d92,_0xb9789a){return function(_0x2929f0){if(_0x2929f0){var _0x2e6294=typeof _0xb9789a[_0xac0b('0x1d')]===_0xac0b('0x1e')&&typeof _0xb9789a[_0xac0b('0x1f')]==='undefined';var _0x263172=_0x2929f0[_0xac0b('0x20')];var _0x17702c=_0x2e6294?0x0:_0xb9789a[_0xac0b('0x1d')];var _0x42b13f=_0x2e6294?_0x2929f0['count']:_0xb9789a[_0xac0b('0x1d')]+_0xb9789a[_0xac0b('0x1f')];var _0x52f67c;if(_0x42b13f>=_0x263172){_0x42b13f=_0x263172;_0x52f67c=0xc8;}else{_0x52f67c=0xce;}_0x5d1d92[_0xac0b('0x21')](_0x52f67c);return _0x5d1d92['set'](_0xac0b('0x22'),_0x17702c+'-'+_0x42b13f+'/'+_0x263172)[_0xac0b('0x1c')](_0x2929f0);}return null;};}function patchUpdates(_0x3dc435){return function(_0x1099f7){try{jsonpatch[_0xac0b('0x23')](_0x1099f7,_0x3dc435,!![]);}catch(_0x27b8b9){return BPromise[_0xac0b('0x24')](_0x27b8b9);}return _0x1099f7[_0xac0b('0x25')]();};}function saveUpdates(_0x1bad50,_0x45cfcf){return function(_0x42a7c9){if(_0x42a7c9){return _0x42a7c9[_0xac0b('0x26')](_0x1bad50)[_0xac0b('0x27')](function(_0x3d3166){return _0x3d3166;});}return null;};}function removeEntity(_0x4b6cac,_0x24d750){return function(_0x1b6e06){if(_0x1b6e06){return _0x1b6e06[_0xac0b('0x28')]()[_0xac0b('0x27')](function(){_0x4b6cac[_0xac0b('0x21')](0xcc)[_0xac0b('0x1b')]();});}};}function handleEntityNotFound(_0x13a9c6,_0x9209fb){return function(_0x289935){if(!_0x289935){_0x13a9c6[_0xac0b('0x1a')](0x194);}return _0x289935;};}function handleError(_0x480fab,_0x4c325e){_0x4c325e=_0x4c325e||0x1f4;return function(_0x304eb0){logger[_0xac0b('0x29')](_0x304eb0['stack']);if(_0x304eb0[_0xac0b('0x2a')]){delete _0x304eb0[_0xac0b('0x2a')];}_0x480fab[_0xac0b('0x21')](_0x4c325e)[_0xac0b('0x2b')](_0x304eb0);};}exports[_0xac0b('0x2c')]=function(_0x1cf604,_0x2525e4){var _0x4e43aa={},_0x4e9834={},_0x59e418={'count':0x0,'rows':[]};var _0x1024b3=_[_0xac0b('0x2d')](db[_0xac0b('0x2e')][_0xac0b('0x2f')],function(_0x33bf51){return{'name':_0x33bf51[_0xac0b('0x30')],'type':_0x33bf51[_0xac0b('0x31')][_0xac0b('0x32')]};});_0x4e9834[_0xac0b('0x33')]=_[_0xac0b('0x2d')](_0x1024b3,'name');_0x4e9834['query']=_[_0xac0b('0x34')](_0x1cf604['query']);_0x4e9834[_0xac0b('0x35')]=_[_0xac0b('0x36')](_0x4e9834[_0xac0b('0x33')],_0x4e9834[_0xac0b('0x37')]);_0x4e43aa['attributes']=_[_0xac0b('0x36')](_0x4e9834[_0xac0b('0x33')],qs[_0xac0b('0x38')](_0x1cf604[_0xac0b('0x37')]['fields']));_0x4e43aa['attributes']=_0x4e43aa['attributes'][_0xac0b('0x39')]?_0x4e43aa[_0xac0b('0x3a')]:_0x4e9834[_0xac0b('0x33')];if(!_0x1cf604[_0xac0b('0x37')][_0xac0b('0x3b')]('nolimit')){_0x4e43aa[_0xac0b('0x1f')]=qs['limit'](_0x1cf604['query'][_0xac0b('0x1f')]);_0x4e43aa[_0xac0b('0x1d')]=qs[_0xac0b('0x1d')](_0x1cf604['query'][_0xac0b('0x1d')]);}_0x4e43aa[_0xac0b('0x3c')]=qs[_0xac0b('0x3d')](_0x1cf604['query'][_0xac0b('0x3d')]);_0x4e43aa[_0xac0b('0x3e')]=qs['filters'](_['pick'](_0x1cf604[_0xac0b('0x37')],_0x4e9834['filters']),_0x1024b3);if(_0x1cf604[_0xac0b('0x37')][_0xac0b('0x3f')]){_0x4e43aa[_0xac0b('0x3e')]=_[_0xac0b('0x40')](_0x4e43aa[_0xac0b('0x3e')],{'$or':_[_0xac0b('0x2d')](_0x1024b3,function(_0x1a3469){if(_0x1a3469['type']!=='VIRTUAL'){var _0x47cd00={};_0x47cd00[_0x1a3469[_0xac0b('0x2a')]]={'$like':'%'+_0x1cf604[_0xac0b('0x37')][_0xac0b('0x3f')]+'%'};return _0x47cd00;}})});}_0x4e43aa=_[_0xac0b('0x40')]({},_0x4e43aa,_0x1cf604[_0xac0b('0x41')]);var _0x7fc80e={'where':_0x4e43aa[_0xac0b('0x3e')]};return db[_0xac0b('0x2e')][_0xac0b('0x20')](_0x7fc80e)[_0xac0b('0x27')](function(_0x4894d1){_0x59e418[_0xac0b('0x20')]=_0x4894d1;if(_0x1cf604[_0xac0b('0x37')][_0xac0b('0x42')]){_0x4e43aa['include']=[{'all':!![]}];}return db[_0xac0b('0x2e')][_0xac0b('0x43')](_0x4e43aa);})['then'](function(_0x58680e){_0x59e418['rows']=_0x58680e;return _0x59e418;})[_0xac0b('0x27')](respondWithFilteredResult(_0x2525e4,_0x4e43aa))['catch'](handleError(_0x2525e4,null));};exports[_0xac0b('0x44')]=function(_0x5e20ad,_0x3fc371){var _0x4f8239={'raw':![],'where':{'id':_0x5e20ad['params']['id']}},_0x3bd903={};_0x3bd903[_0xac0b('0x33')]=_[_0xac0b('0x34')](db['ZohoConfiguration'][_0xac0b('0x2f')]);_0x3bd903[_0xac0b('0x37')]=_[_0xac0b('0x34')](_0x5e20ad[_0xac0b('0x37')]);_0x3bd903[_0xac0b('0x35')]=_[_0xac0b('0x36')](_0x3bd903[_0xac0b('0x33')],_0x3bd903[_0xac0b('0x37')]);_0x4f8239['attributes']=_['intersection'](_0x3bd903[_0xac0b('0x33')],qs[_0xac0b('0x38')](_0x5e20ad[_0xac0b('0x37')][_0xac0b('0x38')]));_0x4f8239[_0xac0b('0x3a')]=_0x4f8239[_0xac0b('0x3a')]['length']?_0x4f8239[_0xac0b('0x3a')]:_0x3bd903[_0xac0b('0x33')];if(_0x5e20ad[_0xac0b('0x37')][_0xac0b('0x42')]){_0x4f8239[_0xac0b('0x45')]=[{'all':!![]}];}_0x4f8239=_[_0xac0b('0x40')]({},_0x4f8239,_0x5e20ad[_0xac0b('0x41')]);return db[_0xac0b('0x2e')][_0xac0b('0x46')](_0x4f8239)[_0xac0b('0x27')](handleEntityNotFound(_0x3fc371,null))[_0xac0b('0x27')](respondWithResult(_0x3fc371,null))['catch'](handleError(_0x3fc371,null));};exports[_0xac0b('0x47')]=function(_0x26a97f,_0x8ce505){return db[_0xac0b('0x2e')][_0xac0b('0x47')](_0x26a97f[_0xac0b('0x48')],{})[_0xac0b('0x27')](respondWithResult(_0x8ce505,0xc9))[_0xac0b('0x49')](handleError(_0x8ce505,null));};exports[_0xac0b('0x26')]=function(_0x153d5d,_0xb4a201){if(_0x153d5d[_0xac0b('0x48')]['id']){delete _0x153d5d[_0xac0b('0x48')]['id'];}return db[_0xac0b('0x2e')][_0xac0b('0x46')]({'where':{'id':_0x153d5d[_0xac0b('0x4a')]['id']}})[_0xac0b('0x27')](handleEntityNotFound(_0xb4a201,null))[_0xac0b('0x27')](saveUpdates(_0x153d5d[_0xac0b('0x48')],null))[_0xac0b('0x27')](respondWithResult(_0xb4a201,null))[_0xac0b('0x49')](handleError(_0xb4a201,null));};exports[_0xac0b('0x28')]=function(_0x394477,_0xbc5a80){return db['ZohoConfiguration'][_0xac0b('0x46')]({'where':{'id':_0x394477['params']['id']}})[_0xac0b('0x27')](handleEntityNotFound(_0xbc5a80,null))[_0xac0b('0x27')](removeEntity(_0xbc5a80,null))['catch'](handleError(_0xbc5a80,null));};exports[_0xac0b('0x4b')]=function(_0x5c2188,_0x2b5796,_0x380e49){var _0x537362={};var _0x88a087={};var _0x342ef0;var _0x319955;return db[_0xac0b('0x2e')][_0xac0b('0x4c')]({'where':{'id':_0x5c2188[_0xac0b('0x4a')]['id']}})[_0xac0b('0x27')](handleEntityNotFound(_0x2b5796,null))[_0xac0b('0x27')](function(_0x5d9384){if(_0x5d9384){_0x342ef0=_0x5d9384;_0x88a087[_0xac0b('0x33')]=_[_0xac0b('0x34')](db[_0xac0b('0x4d')][_0xac0b('0x2f')]);_0x88a087[_0xac0b('0x37')]=_[_0xac0b('0x34')](_0x5c2188['query']);_0x88a087[_0xac0b('0x35')]=_['intersection'](_0x88a087['model'],_0x88a087['query']);_0x537362[_0xac0b('0x3a')]=_['intersection'](_0x88a087[_0xac0b('0x33')],qs[_0xac0b('0x38')](_0x5c2188['query'][_0xac0b('0x38')]));_0x537362['attributes']=_0x537362[_0xac0b('0x3a')]['length']?_0x537362[_0xac0b('0x3a')]:_0x88a087[_0xac0b('0x33')];_0x537362[_0xac0b('0x3c')]=qs[_0xac0b('0x3d')](_0x5c2188[_0xac0b('0x37')][_0xac0b('0x3d')]);_0x537362[_0xac0b('0x3e')]=qs[_0xac0b('0x35')](_[_0xac0b('0x4e')](_0x5c2188['query'],_0x88a087['filters']));if(_0x5c2188[_0xac0b('0x37')][_0xac0b('0x3f')]){_0x537362['where']=_[_0xac0b('0x40')](_0x537362['where'],{'$or':_[_0xac0b('0x2d')](_0x537362[_0xac0b('0x3a')],function(_0x3566fe){var _0x5cffb9={};_0x5cffb9[_0x3566fe]={'$like':'%'+_0x5c2188[_0xac0b('0x37')][_0xac0b('0x3f')]+'%'};return _0x5cffb9;})});}_0x537362=_[_0xac0b('0x40')]({},_0x537362,_0x5c2188[_0xac0b('0x41')]);return _0x342ef0['getFields'](_0x537362);}})[_0xac0b('0x27')](function(_0x377ecd){if(_0x377ecd){_0x319955=_0x377ecd[_0xac0b('0x39')];if(!_0x5c2188[_0xac0b('0x37')]['hasOwnProperty'](_0xac0b('0x4f'))){_0x537362[_0xac0b('0x1f')]=qs[_0xac0b('0x1f')](_0x5c2188['query'][_0xac0b('0x1f')]);_0x537362[_0xac0b('0x1d')]=qs['offset'](_0x5c2188[_0xac0b('0x37')]['offset']);}return _0x342ef0['getFields'](_0x537362);}})[_0xac0b('0x27')](function(_0x459e96){if(_0x459e96){return _0x459e96?{'count':_0x319955,'rows':_0x459e96}:null;}})[_0xac0b('0x27')](respondWithResult(_0x2b5796,null))[_0xac0b('0x49')](handleError(_0x2b5796,null));};exports[_0xac0b('0x50')]=function(_0x5e2ff5,_0x31e280,_0x379da4){var _0x24e9c7={};var _0x579e71={};var _0x362777;var _0x40e4c1;return db['ZohoConfiguration'][_0xac0b('0x4c')]({'where':{'id':_0x5e2ff5['params']['id']}})[_0xac0b('0x27')](handleEntityNotFound(_0x31e280,null))[_0xac0b('0x27')](function(_0x38ffa2){if(_0x38ffa2){_0x362777=_0x38ffa2;_0x579e71['model']=_[_0xac0b('0x34')](db['ZohoField']['rawAttributes']);_0x579e71[_0xac0b('0x37')]=_[_0xac0b('0x34')](_0x5e2ff5[_0xac0b('0x37')]);_0x579e71[_0xac0b('0x35')]=_[_0xac0b('0x36')](_0x579e71[_0xac0b('0x33')],_0x579e71['query']);_0x24e9c7[_0xac0b('0x3a')]=_['intersection'](_0x579e71[_0xac0b('0x33')],qs[_0xac0b('0x38')](_0x5e2ff5[_0xac0b('0x37')][_0xac0b('0x38')]));_0x24e9c7[_0xac0b('0x3a')]=_0x24e9c7[_0xac0b('0x3a')]['length']?_0x24e9c7['attributes']:_0x579e71['model'];_0x24e9c7[_0xac0b('0x3c')]=qs[_0xac0b('0x3d')](_0x5e2ff5['query']['sort']);_0x24e9c7['where']=qs['filters'](_[_0xac0b('0x4e')](_0x5e2ff5[_0xac0b('0x37')],_0x579e71[_0xac0b('0x35')]));if(_0x5e2ff5[_0xac0b('0x37')][_0xac0b('0x3f')]){_0x24e9c7['where']=_['merge'](_0x24e9c7[_0xac0b('0x3e')],{'$or':_['map'](_0x24e9c7[_0xac0b('0x3a')],function(_0x33ce6d){var _0x185d1e={};_0x185d1e[_0x33ce6d]={'$like':'%'+_0x5e2ff5[_0xac0b('0x37')][_0xac0b('0x3f')]+'%'};return _0x185d1e;})});}_0x24e9c7=_[_0xac0b('0x40')]({},_0x24e9c7,_0x5e2ff5['options']);return _0x362777['getSubjects'](_0x24e9c7);}})['then'](function(_0x51c8c0){if(_0x51c8c0){_0x40e4c1=_0x51c8c0[_0xac0b('0x39')];if(!_0x5e2ff5[_0xac0b('0x37')]['hasOwnProperty'](_0xac0b('0x4f'))){_0x24e9c7[_0xac0b('0x1f')]=qs[_0xac0b('0x1f')](_0x5e2ff5[_0xac0b('0x37')][_0xac0b('0x1f')]);_0x24e9c7[_0xac0b('0x1d')]=qs[_0xac0b('0x1d')](_0x5e2ff5[_0xac0b('0x37')]['offset']);}return _0x362777[_0xac0b('0x50')](_0x24e9c7);}})[_0xac0b('0x27')](function(_0x3586fa){if(_0x3586fa){return _0x3586fa?{'count':_0x40e4c1,'rows':_0x3586fa}:null;}})['then'](respondWithResult(_0x31e280,null))[_0xac0b('0x49')](handleError(_0x31e280,null));};exports['getDescriptions']=function(_0x45d969,_0x54713a,_0x4acac2){var _0x4b47ba={};var _0x4e6209={};var _0x29bcae;var _0x5ccb24;return db['ZohoConfiguration'][_0xac0b('0x4c')]({'where':{'id':_0x45d969[_0xac0b('0x4a')]['id']}})[_0xac0b('0x27')](handleEntityNotFound(_0x54713a,null))[_0xac0b('0x27')](function(_0x18bd39){if(_0x18bd39){_0x29bcae=_0x18bd39;_0x4e6209[_0xac0b('0x33')]=_['keys'](db['ZohoField'][_0xac0b('0x2f')]);_0x4e6209['query']=_[_0xac0b('0x34')](_0x45d969[_0xac0b('0x37')]);_0x4e6209[_0xac0b('0x35')]=_[_0xac0b('0x36')](_0x4e6209['model'],_0x4e6209[_0xac0b('0x37')]);_0x4b47ba[_0xac0b('0x3a')]=_['intersection'](_0x4e6209[_0xac0b('0x33')],qs[_0xac0b('0x38')](_0x45d969['query'][_0xac0b('0x38')]));_0x4b47ba[_0xac0b('0x3a')]=_0x4b47ba[_0xac0b('0x3a')]['length']?_0x4b47ba['attributes']:_0x4e6209[_0xac0b('0x33')];_0x4b47ba[_0xac0b('0x3c')]=qs[_0xac0b('0x3d')](_0x45d969[_0xac0b('0x37')][_0xac0b('0x3d')]);_0x4b47ba[_0xac0b('0x3e')]=qs['filters'](_[_0xac0b('0x4e')](_0x45d969[_0xac0b('0x37')],_0x4e6209[_0xac0b('0x35')]));if(_0x45d969[_0xac0b('0x37')][_0xac0b('0x3f')]){_0x4b47ba[_0xac0b('0x3e')]=_[_0xac0b('0x40')](_0x4b47ba['where'],{'$or':_[_0xac0b('0x2d')](_0x4b47ba['attributes'],function(_0x35aa61){var _0x29bc8a={};_0x29bc8a[_0x35aa61]={'$like':'%'+_0x45d969[_0xac0b('0x37')][_0xac0b('0x3f')]+'%'};return _0x29bc8a;})});}_0x4b47ba=_['merge']({},_0x4b47ba,_0x45d969[_0xac0b('0x41')]);return _0x29bcae[_0xac0b('0x51')](_0x4b47ba);}})[_0xac0b('0x27')](function(_0x544d7b){if(_0x544d7b){_0x5ccb24=_0x544d7b[_0xac0b('0x39')];if(!_0x45d969[_0xac0b('0x37')][_0xac0b('0x3b')](_0xac0b('0x4f'))){_0x4b47ba[_0xac0b('0x1f')]=qs[_0xac0b('0x1f')](_0x45d969[_0xac0b('0x37')][_0xac0b('0x1f')]);_0x4b47ba['offset']=qs[_0xac0b('0x1d')](_0x45d969[_0xac0b('0x37')]['offset']);}return _0x29bcae[_0xac0b('0x51')](_0x4b47ba);}})['then'](function(_0x3155b2){if(_0x3155b2){return _0x3155b2?{'count':_0x5ccb24,'rows':_0x3155b2}:null;}})[_0xac0b('0x27')](respondWithResult(_0x54713a,null))[_0xac0b('0x49')](handleError(_0x54713a,null));}; \ No newline at end of file +var _0x94a4=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','ZohoConfiguration','rawAttributes','fieldName','model','map','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','find','create','body','update','findOne','getFields','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4efb98,_0x4175a4){var _0x225966=function(_0xa50adb){while(--_0xa50adb){_0x4efb98['push'](_0x4efb98['shift']());}};_0x225966(++_0x4175a4);}(_0x94a4,0x83));var _0x494a=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x94a4[_0x2b9b7f];return _0x4ed19a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x494a('0x0'));var zipdir=require(_0x494a('0x1'));var jsonpatch=require(_0x494a('0x2'));var rp=require(_0x494a('0x3'));var moment=require(_0x494a('0x4'));var BPromise=require(_0x494a('0x5'));var Mustache=require('mustache');var util=require(_0x494a('0x6'));var path=require(_0x494a('0x7'));var sox=require(_0x494a('0x8'));var csv=require(_0x494a('0x9'));var ejs=require(_0x494a('0xa'));var fs=require('fs');var fs_extra=require(_0x494a('0xb'));var _=require(_0x494a('0xc'));var squel=require(_0x494a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x494a('0xe'));var toCsv=require(_0x494a('0x9'));var querystring=require(_0x494a('0xf'));var Papa=require(_0x494a('0x10'));var Redis=require(_0x494a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x494a('0x12'));var hardwareService=require(_0x494a('0x13'));var logger=require(_0x494a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x494a('0x15'));var licenseUtil=require(_0x494a('0x16'));var db=require(_0x494a('0x17'))['db'];function respondWithStatusCode(_0x15756d,_0x3a7950){_0x3a7950=_0x3a7950||0xcc;return function(_0x1ac138){if(_0x1ac138){return _0x15756d[_0x494a('0x18')](_0x3a7950);}return _0x15756d[_0x494a('0x19')](_0x3a7950)[_0x494a('0x1a')]();};}function respondWithResult(_0x32e204,_0xe5e310){_0xe5e310=_0xe5e310||0xc8;return function(_0x597dcf){if(_0x597dcf){return _0x32e204[_0x494a('0x19')](_0xe5e310)[_0x494a('0x1b')](_0x597dcf);}};}function respondWithFilteredResult(_0x4af607,_0x387e5f){return function(_0x27679c){if(_0x27679c){var _0x5f4053=typeof _0x387e5f[_0x494a('0x1c')]===_0x494a('0x1d')&&typeof _0x387e5f['limit']===_0x494a('0x1d');var _0x5029ac=_0x27679c[_0x494a('0x1e')];var _0x5d54f7=_0x5f4053?0x0:_0x387e5f[_0x494a('0x1c')];var _0x334020=_0x5f4053?_0x27679c[_0x494a('0x1e')]:_0x387e5f['offset']+_0x387e5f[_0x494a('0x1f')];var _0xe1f0f7;if(_0x334020>=_0x5029ac){_0x334020=_0x5029ac;_0xe1f0f7=0xc8;}else{_0xe1f0f7=0xce;}_0x4af607[_0x494a('0x19')](_0xe1f0f7);return _0x4af607[_0x494a('0x20')](_0x494a('0x21'),_0x5d54f7+'-'+_0x334020+'/'+_0x5029ac)['json'](_0x27679c);}return null;};}function patchUpdates(_0x277ba0){return function(_0x19184b){try{jsonpatch[_0x494a('0x22')](_0x19184b,_0x277ba0,!![]);}catch(_0x5519fd){return BPromise[_0x494a('0x23')](_0x5519fd);}return _0x19184b[_0x494a('0x24')]();};}function saveUpdates(_0x406b54,_0x389b9f){return function(_0x403b3b){if(_0x403b3b){return _0x403b3b['update'](_0x406b54)[_0x494a('0x25')](function(_0x216f4c){return _0x216f4c;});}return null;};}function removeEntity(_0x1d3f5a,_0x14ef71){return function(_0x225b8b){if(_0x225b8b){return _0x225b8b[_0x494a('0x26')]()[_0x494a('0x25')](function(){_0x1d3f5a['status'](0xcc)[_0x494a('0x1a')]();});}};}function handleEntityNotFound(_0x11c4f1,_0x3311fd){return function(_0x2b20d3){if(!_0x2b20d3){_0x11c4f1[_0x494a('0x18')](0x194);}return _0x2b20d3;};}function handleError(_0x8fef6e,_0x321ea0){_0x321ea0=_0x321ea0||0x1f4;return function(_0x2d3ead){logger[_0x494a('0x27')](_0x2d3ead[_0x494a('0x28')]);if(_0x2d3ead[_0x494a('0x29')]){delete _0x2d3ead[_0x494a('0x29')];}_0x8fef6e[_0x494a('0x19')](_0x321ea0)[_0x494a('0x2a')](_0x2d3ead);};}exports['index']=function(_0xc5ea5f,_0x3e2bea){var _0x4fefb9={},_0x11b4fb={},_0x572d1b={'count':0x0,'rows':[]};var _0x2da527=_['map'](db[_0x494a('0x2b')][_0x494a('0x2c')],function(_0x6c2879){return{'name':_0x6c2879[_0x494a('0x2d')],'type':_0x6c2879['type']['key']};});_0x11b4fb[_0x494a('0x2e')]=_[_0x494a('0x2f')](_0x2da527,_0x494a('0x29'));_0x11b4fb[_0x494a('0x30')]=_[_0x494a('0x31')](_0xc5ea5f['query']);_0x11b4fb['filters']=_['intersection'](_0x11b4fb[_0x494a('0x2e')],_0x11b4fb['query']);_0x4fefb9['attributes']=_['intersection'](_0x11b4fb[_0x494a('0x2e')],qs[_0x494a('0x32')](_0xc5ea5f[_0x494a('0x30')][_0x494a('0x32')]));_0x4fefb9[_0x494a('0x33')]=_0x4fefb9[_0x494a('0x33')][_0x494a('0x34')]?_0x4fefb9[_0x494a('0x33')]:_0x11b4fb['model'];if(!_0xc5ea5f[_0x494a('0x30')][_0x494a('0x35')](_0x494a('0x36'))){_0x4fefb9[_0x494a('0x1f')]=qs[_0x494a('0x1f')](_0xc5ea5f['query']['limit']);_0x4fefb9[_0x494a('0x1c')]=qs['offset'](_0xc5ea5f[_0x494a('0x30')]['offset']);}_0x4fefb9[_0x494a('0x37')]=qs[_0x494a('0x38')](_0xc5ea5f[_0x494a('0x30')][_0x494a('0x38')]);_0x4fefb9[_0x494a('0x39')]=qs[_0x494a('0x3a')](_[_0x494a('0x3b')](_0xc5ea5f[_0x494a('0x30')],_0x11b4fb[_0x494a('0x3a')]),_0x2da527);if(_0xc5ea5f[_0x494a('0x30')][_0x494a('0x3c')]){_0x4fefb9['where']=_[_0x494a('0x3d')](_0x4fefb9[_0x494a('0x39')],{'$or':_['map'](_0x2da527,function(_0x3c894c){if(_0x3c894c['type']!==_0x494a('0x3e')){var _0x19c04b={};_0x19c04b[_0x3c894c[_0x494a('0x29')]]={'$like':'%'+_0xc5ea5f[_0x494a('0x30')][_0x494a('0x3c')]+'%'};return _0x19c04b;}})});}_0x4fefb9=_[_0x494a('0x3d')]({},_0x4fefb9,_0xc5ea5f[_0x494a('0x3f')]);var _0x137ce2={'where':_0x4fefb9[_0x494a('0x39')]};return db[_0x494a('0x2b')]['count'](_0x137ce2)[_0x494a('0x25')](function(_0x24be3f){_0x572d1b[_0x494a('0x1e')]=_0x24be3f;if(_0xc5ea5f[_0x494a('0x30')][_0x494a('0x40')]){_0x4fefb9[_0x494a('0x41')]=[{'all':!![]}];}return db[_0x494a('0x2b')]['findAll'](_0x4fefb9);})[_0x494a('0x25')](function(_0x33eb6f){_0x572d1b[_0x494a('0x42')]=_0x33eb6f;return _0x572d1b;})[_0x494a('0x25')](respondWithFilteredResult(_0x3e2bea,_0x4fefb9))[_0x494a('0x43')](handleError(_0x3e2bea,null));};exports['show']=function(_0x61054e,_0x352fbf){var _0xf183c0={'raw':![],'where':{'id':_0x61054e[_0x494a('0x44')]['id']}},_0x18ccf8={};_0x18ccf8['model']=_[_0x494a('0x31')](db['ZohoConfiguration']['rawAttributes']);_0x18ccf8[_0x494a('0x30')]=_['keys'](_0x61054e['query']);_0x18ccf8[_0x494a('0x3a')]=_[_0x494a('0x45')](_0x18ccf8[_0x494a('0x2e')],_0x18ccf8['query']);_0xf183c0[_0x494a('0x33')]=_[_0x494a('0x45')](_0x18ccf8[_0x494a('0x2e')],qs['fields'](_0x61054e['query']['fields']));_0xf183c0[_0x494a('0x33')]=_0xf183c0[_0x494a('0x33')][_0x494a('0x34')]?_0xf183c0[_0x494a('0x33')]:_0x18ccf8[_0x494a('0x2e')];if(_0x61054e[_0x494a('0x30')][_0x494a('0x40')]){_0xf183c0[_0x494a('0x41')]=[{'all':!![]}];}_0xf183c0=_[_0x494a('0x3d')]({},_0xf183c0,_0x61054e[_0x494a('0x3f')]);return db[_0x494a('0x2b')][_0x494a('0x46')](_0xf183c0)[_0x494a('0x25')](handleEntityNotFound(_0x352fbf,null))[_0x494a('0x25')](respondWithResult(_0x352fbf,null))['catch'](handleError(_0x352fbf,null));};exports[_0x494a('0x47')]=function(_0x57dd27,_0x55d910){return db[_0x494a('0x2b')][_0x494a('0x47')](_0x57dd27[_0x494a('0x48')],{})[_0x494a('0x25')](respondWithResult(_0x55d910,0xc9))[_0x494a('0x43')](handleError(_0x55d910,null));};exports[_0x494a('0x49')]=function(_0x5fffe1,_0x15c36b){if(_0x5fffe1['body']['id']){delete _0x5fffe1[_0x494a('0x48')]['id'];}return db[_0x494a('0x2b')][_0x494a('0x46')]({'where':{'id':_0x5fffe1[_0x494a('0x44')]['id']}})[_0x494a('0x25')](handleEntityNotFound(_0x15c36b,null))[_0x494a('0x25')](saveUpdates(_0x5fffe1['body'],null))['then'](respondWithResult(_0x15c36b,null))[_0x494a('0x43')](handleError(_0x15c36b,null));};exports[_0x494a('0x26')]=function(_0x4a5dd2,_0x55c2fc){return db[_0x494a('0x2b')][_0x494a('0x46')]({'where':{'id':_0x4a5dd2[_0x494a('0x44')]['id']}})['then'](handleEntityNotFound(_0x55c2fc,null))[_0x494a('0x25')](removeEntity(_0x55c2fc,null))[_0x494a('0x43')](handleError(_0x55c2fc,null));};exports['getFields']=function(_0x3501cd,_0x5e0e4a,_0x479ee8){var _0x32ac76={};var _0x2db087={};var _0x3fd16b;var _0x3c26a0;return db['ZohoConfiguration'][_0x494a('0x4a')]({'where':{'id':_0x3501cd[_0x494a('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e0e4a,null))[_0x494a('0x25')](function(_0x160dda){if(_0x160dda){_0x3fd16b=_0x160dda;_0x2db087[_0x494a('0x2e')]=_[_0x494a('0x31')](db['ZohoField'][_0x494a('0x2c')]);_0x2db087[_0x494a('0x30')]=_[_0x494a('0x31')](_0x3501cd['query']);_0x2db087[_0x494a('0x3a')]=_[_0x494a('0x45')](_0x2db087[_0x494a('0x2e')],_0x2db087['query']);_0x32ac76[_0x494a('0x33')]=_[_0x494a('0x45')](_0x2db087[_0x494a('0x2e')],qs[_0x494a('0x32')](_0x3501cd['query']['fields']));_0x32ac76[_0x494a('0x33')]=_0x32ac76[_0x494a('0x33')][_0x494a('0x34')]?_0x32ac76[_0x494a('0x33')]:_0x2db087[_0x494a('0x2e')];_0x32ac76[_0x494a('0x37')]=qs[_0x494a('0x38')](_0x3501cd[_0x494a('0x30')][_0x494a('0x38')]);_0x32ac76[_0x494a('0x39')]=qs[_0x494a('0x3a')](_['pick'](_0x3501cd['query'],_0x2db087['filters']));if(_0x3501cd[_0x494a('0x30')][_0x494a('0x3c')]){_0x32ac76[_0x494a('0x39')]=_[_0x494a('0x3d')](_0x32ac76[_0x494a('0x39')],{'$or':_['map'](_0x32ac76[_0x494a('0x33')],function(_0x4c8280){var _0x277903={};_0x277903[_0x4c8280]={'$like':'%'+_0x3501cd['query'][_0x494a('0x3c')]+'%'};return _0x277903;})});}_0x32ac76=_[_0x494a('0x3d')]({},_0x32ac76,_0x3501cd[_0x494a('0x3f')]);return _0x3fd16b[_0x494a('0x4b')](_0x32ac76);}})[_0x494a('0x25')](function(_0xeee670){if(_0xeee670){_0x3c26a0=_0xeee670['length'];if(!_0x3501cd[_0x494a('0x30')]['hasOwnProperty'](_0x494a('0x36'))){_0x32ac76[_0x494a('0x1f')]=qs[_0x494a('0x1f')](_0x3501cd[_0x494a('0x30')][_0x494a('0x1f')]);_0x32ac76[_0x494a('0x1c')]=qs[_0x494a('0x1c')](_0x3501cd[_0x494a('0x30')][_0x494a('0x1c')]);}return _0x3fd16b[_0x494a('0x4b')](_0x32ac76);}})[_0x494a('0x25')](function(_0x17cb65){if(_0x17cb65){return _0x17cb65?{'count':_0x3c26a0,'rows':_0x17cb65}:null;}})[_0x494a('0x25')](respondWithResult(_0x5e0e4a,null))[_0x494a('0x43')](handleError(_0x5e0e4a,null));};exports[_0x494a('0x4c')]=function(_0x26f937,_0x3c09a7,_0x4076f){var _0x3a55bb={};var _0x1bfc20={};var _0x3bdb52;var _0x21eb74;return db[_0x494a('0x2b')][_0x494a('0x4a')]({'where':{'id':_0x26f937[_0x494a('0x44')]['id']}})[_0x494a('0x25')](handleEntityNotFound(_0x3c09a7,null))['then'](function(_0x184c1f){if(_0x184c1f){_0x3bdb52=_0x184c1f;_0x1bfc20[_0x494a('0x2e')]=_[_0x494a('0x31')](db[_0x494a('0x4d')]['rawAttributes']);_0x1bfc20['query']=_[_0x494a('0x31')](_0x26f937[_0x494a('0x30')]);_0x1bfc20['filters']=_[_0x494a('0x45')](_0x1bfc20['model'],_0x1bfc20[_0x494a('0x30')]);_0x3a55bb['attributes']=_[_0x494a('0x45')](_0x1bfc20[_0x494a('0x2e')],qs[_0x494a('0x32')](_0x26f937[_0x494a('0x30')]['fields']));_0x3a55bb['attributes']=_0x3a55bb[_0x494a('0x33')][_0x494a('0x34')]?_0x3a55bb[_0x494a('0x33')]:_0x1bfc20['model'];_0x3a55bb[_0x494a('0x37')]=qs[_0x494a('0x38')](_0x26f937[_0x494a('0x30')]['sort']);_0x3a55bb[_0x494a('0x39')]=qs[_0x494a('0x3a')](_[_0x494a('0x3b')](_0x26f937['query'],_0x1bfc20[_0x494a('0x3a')]));if(_0x26f937['query'][_0x494a('0x3c')]){_0x3a55bb[_0x494a('0x39')]=_[_0x494a('0x3d')](_0x3a55bb[_0x494a('0x39')],{'$or':_[_0x494a('0x2f')](_0x3a55bb['attributes'],function(_0x405c87){var _0x4c3177={};_0x4c3177[_0x405c87]={'$like':'%'+_0x26f937[_0x494a('0x30')][_0x494a('0x3c')]+'%'};return _0x4c3177;})});}_0x3a55bb=_[_0x494a('0x3d')]({},_0x3a55bb,_0x26f937[_0x494a('0x3f')]);return _0x3bdb52['getSubjects'](_0x3a55bb);}})[_0x494a('0x25')](function(_0x43a25c){if(_0x43a25c){_0x21eb74=_0x43a25c[_0x494a('0x34')];if(!_0x26f937[_0x494a('0x30')][_0x494a('0x35')]('nolimit')){_0x3a55bb['limit']=qs[_0x494a('0x1f')](_0x26f937[_0x494a('0x30')][_0x494a('0x1f')]);_0x3a55bb[_0x494a('0x1c')]=qs[_0x494a('0x1c')](_0x26f937[_0x494a('0x30')][_0x494a('0x1c')]);}return _0x3bdb52[_0x494a('0x4c')](_0x3a55bb);}})['then'](function(_0xb7e900){if(_0xb7e900){return _0xb7e900?{'count':_0x21eb74,'rows':_0xb7e900}:null;}})[_0x494a('0x25')](respondWithResult(_0x3c09a7,null))[_0x494a('0x43')](handleError(_0x3c09a7,null));};exports[_0x494a('0x4e')]=function(_0x4b8540,_0x4ed295,_0x175fb0){var _0x4ba00f={};var _0x3a6c93={};var _0x137b0c;var _0x25059e;return db['ZohoConfiguration'][_0x494a('0x4a')]({'where':{'id':_0x4b8540[_0x494a('0x44')]['id']}})[_0x494a('0x25')](handleEntityNotFound(_0x4ed295,null))[_0x494a('0x25')](function(_0x269e2a){if(_0x269e2a){_0x137b0c=_0x269e2a;_0x3a6c93[_0x494a('0x2e')]=_['keys'](db[_0x494a('0x4d')][_0x494a('0x2c')]);_0x3a6c93['query']=_[_0x494a('0x31')](_0x4b8540[_0x494a('0x30')]);_0x3a6c93[_0x494a('0x3a')]=_[_0x494a('0x45')](_0x3a6c93[_0x494a('0x2e')],_0x3a6c93[_0x494a('0x30')]);_0x4ba00f['attributes']=_[_0x494a('0x45')](_0x3a6c93[_0x494a('0x2e')],qs['fields'](_0x4b8540[_0x494a('0x30')]['fields']));_0x4ba00f['attributes']=_0x4ba00f[_0x494a('0x33')][_0x494a('0x34')]?_0x4ba00f['attributes']:_0x3a6c93[_0x494a('0x2e')];_0x4ba00f[_0x494a('0x37')]=qs['sort'](_0x4b8540[_0x494a('0x30')][_0x494a('0x38')]);_0x4ba00f['where']=qs[_0x494a('0x3a')](_[_0x494a('0x3b')](_0x4b8540[_0x494a('0x30')],_0x3a6c93[_0x494a('0x3a')]));if(_0x4b8540[_0x494a('0x30')]['filter']){_0x4ba00f[_0x494a('0x39')]=_[_0x494a('0x3d')](_0x4ba00f[_0x494a('0x39')],{'$or':_[_0x494a('0x2f')](_0x4ba00f['attributes'],function(_0x601ca4){var _0x366351={};_0x366351[_0x601ca4]={'$like':'%'+_0x4b8540['query'][_0x494a('0x3c')]+'%'};return _0x366351;})});}_0x4ba00f=_[_0x494a('0x3d')]({},_0x4ba00f,_0x4b8540[_0x494a('0x3f')]);return _0x137b0c['getDescriptions'](_0x4ba00f);}})['then'](function(_0x1b4caa){if(_0x1b4caa){_0x25059e=_0x1b4caa[_0x494a('0x34')];if(!_0x4b8540['query'][_0x494a('0x35')](_0x494a('0x36'))){_0x4ba00f['limit']=qs['limit'](_0x4b8540['query'][_0x494a('0x1f')]);_0x4ba00f['offset']=qs[_0x494a('0x1c')](_0x4b8540['query'][_0x494a('0x1c')]);}return _0x137b0c[_0x494a('0x4e')](_0x4ba00f);}})[_0x494a('0x25')](function(_0x2763ec){if(_0x2763ec){return _0x2763ec?{'count':_0x25059e,'rows':_0x2763ec}:null;}})[_0x494a('0x25')](respondWithResult(_0x4ed295,null))['catch'](handleError(_0x4ed295,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c79f21c..8cfac51 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 _0xb5e5=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x389b70,_0xf2cae6){var _0x289f61=function(_0x392e7c){while(--_0x392e7c){_0x389b70['push'](_0x389b70['shift']());}};_0x289f61(++_0xf2cae6);}(_0xb5e5,0x19b));var _0x5b5e=function(_0x4cf6b9,_0x4f97f1){_0x4cf6b9=_0x4cf6b9-0x0;var _0x564f4b=_0xb5e5[_0x4cf6b9];return _0x564f4b;};'use strict';var _=require(_0x5b5e('0x0'));var util=require(_0x5b5e('0x1'));var logger=require(_0x5b5e('0x2'))(_0x5b5e('0x3'));var moment=require(_0x5b5e('0x4'));var BPromise=require(_0x5b5e('0x5'));var rp=require(_0x5b5e('0x6'));var fs=require('fs');var path=require(_0x5b5e('0x7'));var rimraf=require('rimraf');var config=require(_0x5b5e('0x8'));var attributes=require(_0x5b5e('0x9'));module[_0x5b5e('0xa')]=function(_0x2155be,_0x2543b9){return _0x2155be[_0x5b5e('0xb')](_0x5b5e('0xc'),attributes,{'tableName':_0x5b5e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fa2=['moment','bluebird','path','rimraf','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x3b0b37,_0x29e258){var _0x28644c=function(_0x4aa04b){while(--_0x4aa04b){_0x3b0b37['push'](_0x3b0b37['shift']());}};_0x28644c(++_0x29e258);}(_0x4fa2,0x96));var _0x24fa=function(_0x56bef9,_0x40a34d){_0x56bef9=_0x56bef9-0x0;var _0x225efc=_0x4fa2[_0x56bef9];return _0x225efc;};'use strict';var _=require(_0x24fa('0x0'));var util=require(_0x24fa('0x1'));var logger=require(_0x24fa('0x2'))(_0x24fa('0x3'));var moment=require(_0x24fa('0x4'));var BPromise=require(_0x24fa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24fa('0x6'));var rimraf=require(_0x24fa('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x24fa('0x8')]=function(_0x335553,_0xf5c901){return _0x335553['define'](_0x24fa('0x9'),attributes,{'tableName':_0x24fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index f7ade11..4ed40ae 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 _0x28cb=['ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x407cd4,_0x501284){var _0x3c179f=function(_0x4e4b9b){while(--_0x4e4b9b){_0x407cd4['push'](_0x407cd4['shift']());}};_0x3c179f(++_0x501284);}(_0x28cb,0x1d6));var _0xb28c=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x28cb[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xb28c('0x0'));var util=require(_0xb28c('0x1'));var moment=require(_0xb28c('0x2'));var BPromise=require(_0xb28c('0x3'));var rs=require(_0xb28c('0x4'));var fs=require('fs');var Redis=require(_0xb28c('0x5'));var db=require(_0xb28c('0x6'))['db'];var utils=require(_0xb28c('0x7'));var logger=require(_0xb28c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb28c('0x9'));var client=jayson[_0xb28c('0xa')][_0xb28c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283d92,_0x493cd4,_0x438405){return new BPromise(function(_0x4666ca,_0x513f3b){return client[_0xb28c('0xc')](_0x283d92,_0x438405)[_0xb28c('0xd')](function(_0x499eaf){logger['info'](_0xb28c('0xe'),_0x493cd4,'request\x20sent');logger['debug'](_0xb28c('0xf'),_0x493cd4,_0xb28c('0x10'),JSON[_0xb28c('0x11')](_0x499eaf));if(_0x499eaf[_0xb28c('0x12')]){if(_0x499eaf[_0xb28c('0x12')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x493cd4,_0x499eaf[_0xb28c('0x12')][_0xb28c('0x13')]);return _0x513f3b(_0x499eaf['error'][_0xb28c('0x13')]);}logger[_0xb28c('0x12')](_0xb28c('0xe'),_0x493cd4,_0x499eaf['error'][_0xb28c('0x13')]);return _0x4666ca(_0x499eaf[_0xb28c('0x12')]['message']);}else{logger[_0xb28c('0x14')](_0xb28c('0xe'),_0x493cd4,'request\x20sent');_0x4666ca(_0x499eaf[_0xb28c('0x15')]['message']);}})['catch'](function(_0xc0c7af){logger[_0xb28c('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x493cd4,_0xc0c7af);_0x513f3b(_0xc0c7af);});});} \ No newline at end of file +var _0x5ba1=['message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xce2d7e,_0x56dac4){var _0x3143d9=function(_0x52633b){while(--_0x52633b){_0xce2d7e['push'](_0xce2d7e['shift']());}};_0x3143d9(++_0x56dac4);}(_0x5ba1,0x1a4));var _0x15ba=function(_0x7381ae,_0x2af148){_0x7381ae=_0x7381ae-0x0;var _0x48f3f5=_0x5ba1[_0x7381ae];return _0x48f3f5;};'use strict';var _=require(_0x15ba('0x0'));var util=require('util');var moment=require(_0x15ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x15ba('0x2'));var fs=require('fs');var Redis=require(_0x15ba('0x3'));var db=require(_0x15ba('0x4'))['db'];var utils=require(_0x15ba('0x5'));var logger=require(_0x15ba('0x6'))(_0x15ba('0x7'));var config=require('../../config/environment');var jayson=require(_0x15ba('0x8'));var client=jayson[_0x15ba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb151,_0x35182f,_0x1fb067){return new BPromise(function(_0x3cc979,_0x16d9a4){return client[_0x15ba('0xa')](_0x5eb151,_0x1fb067)[_0x15ba('0xb')](function(_0x4ebac4){logger[_0x15ba('0xc')](_0x15ba('0xd'),_0x35182f,'request\x20sent');logger[_0x15ba('0xe')](_0x15ba('0xf'),_0x35182f,_0x15ba('0x10'),JSON[_0x15ba('0x11')](_0x4ebac4));if(_0x4ebac4[_0x15ba('0x12')]){if(_0x4ebac4[_0x15ba('0x12')][_0x15ba('0x13')]===0x1f4){logger[_0x15ba('0x12')](_0x15ba('0xd'),_0x35182f,_0x4ebac4['error'][_0x15ba('0x14')]);return _0x16d9a4(_0x4ebac4['error']['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x35182f,_0x4ebac4['error'][_0x15ba('0x14')]);return _0x3cc979(_0x4ebac4[_0x15ba('0x12')][_0x15ba('0x14')]);}else{logger[_0x15ba('0xc')](_0x15ba('0xd'),_0x35182f,_0x15ba('0x10'));_0x3cc979(_0x4ebac4[_0x15ba('0x15')][_0x15ba('0x14')]);}})['catch'](function(_0x1f6b89){logger[_0x15ba('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x35182f,_0x1f6b89);_0x16d9a4(_0x1f6b89);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d934e52..13e7aae 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 _0xfa21=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','destroy'];(function(_0x214571,_0x202d29){var _0x36626a=function(_0x2e90e7){while(--_0x2e90e7){_0x214571['push'](_0x214571['shift']());}};_0x36626a(++_0x202d29);}(_0xfa21,0x169));var _0x1fa2=function(_0x2e7a1a,_0x20383f){_0x2e7a1a=_0x2e7a1a-0x0;var _0x268f71=_0xfa21[_0x2e7a1a];return _0x268f71;};'use strict';var multer=require(_0x1fa2('0x0'));var util=require(_0x1fa2('0x1'));var path=require(_0x1fa2('0x2'));var timeout=require(_0x1fa2('0x3'));var express=require(_0x1fa2('0x4'));var router=express[_0x1fa2('0x5')]();var fs_extra=require(_0x1fa2('0x6'));var auth=require(_0x1fa2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa2('0x8'));var controller=require('./intZohoField.controller');router[_0x1fa2('0x9')]('/',auth[_0x1fa2('0xa')](),controller['index']);router[_0x1fa2('0x9')](_0x1fa2('0xb'),auth[_0x1fa2('0xa')](),controller[_0x1fa2('0xc')]);router['post']('/',auth[_0x1fa2('0xa')](),controller[_0x1fa2('0xd')]);router[_0x1fa2('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1fa2('0xf')]);router['delete']('/:id',auth[_0x1fa2('0xa')](),controller[_0x1fa2('0x10')]);module[_0x1fa2('0x11')]=router; \ No newline at end of file +var _0xb27e=['fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x91fc59,_0x256231){var _0x5dea63=function(_0x19bdbf){while(--_0x19bdbf){_0x91fc59['push'](_0x91fc59['shift']());}};_0x5dea63(++_0x256231);}(_0xb27e,0x109));var _0xeb27=function(_0x258cf0,_0x26050a){_0x258cf0=_0x258cf0-0x0;var _0x484378=_0xb27e[_0x258cf0];return _0x484378;};'use strict';var multer=require(_0xeb27('0x0'));var util=require(_0xeb27('0x1'));var path=require(_0xeb27('0x2'));var timeout=require(_0xeb27('0x3'));var express=require(_0xeb27('0x4'));var router=express['Router']();var fs_extra=require(_0xeb27('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeb27('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xeb27('0x7')]('/',auth['isAuthenticated'](),controller[_0xeb27('0x8')]);router['get'](_0xeb27('0x9'),auth[_0xeb27('0xa')](),controller[_0xeb27('0xb')]);router[_0xeb27('0xc')]('/',auth[_0xeb27('0xa')](),controller[_0xeb27('0xd')]);router['put'](_0xeb27('0x9'),auth[_0xeb27('0xa')](),controller[_0xeb27('0xe')]);router[_0xeb27('0xf')](_0xeb27('0x9'),auth['isAuthenticated'](),controller[_0xeb27('0x10')]);module[_0xeb27('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index af02350..f6835db 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 _0x69de=['keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x58bb2e,_0x53f002){var _0x5df8dc=function(_0x1e7356){while(--_0x1e7356){_0x58bb2e['push'](_0x58bb2e['shift']());}};_0x5df8dc(++_0x53f002);}(_0x69de,0x7a));var _0xe69d=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x69de[_0x37756b];return _0x46efec;};'use strict';var Sequelize=require('sequelize');module[_0xe69d('0x0')]={'type':{'type':Sequelize[_0xe69d('0x1')]('string',_0xe69d('0x2'),_0xe69d('0x3'),_0xe69d('0x4'),_0xe69d('0x5')),'defaultValue':_0xe69d('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe69d('0x7')]},'keyType':{'type':Sequelize[_0xe69d('0x1')]('string',_0xe69d('0x2'),_0xe69d('0x3'))},'keyContent':{'type':Sequelize[_0xe69d('0x7')]},'idField':{'type':Sequelize[_0xe69d('0x7')]},'nameField':{'type':Sequelize[_0xe69d('0x7')]},'customField':{'type':Sequelize[_0xe69d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe69d('0x7')]}}; \ No newline at end of file +var _0xd5db=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd5db,0x1d1));var _0xbd5d=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xd5db[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0xbd5d('0x0'));module[_0xbd5d('0x1')]={'type':{'type':Sequelize[_0xbd5d('0x2')](_0xbd5d('0x3'),_0xbd5d('0x4'),_0xbd5d('0x5'),_0xbd5d('0x6'),'picklist'),'defaultValue':_0xbd5d('0x3')},'content':{'type':Sequelize[_0xbd5d('0x7')]},'key':{'type':Sequelize[_0xbd5d('0x7')]},'keyType':{'type':Sequelize[_0xbd5d('0x2')]('string',_0xbd5d('0x4'),_0xbd5d('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbd5d('0x7')]},'customField':{'type':Sequelize[_0xbd5d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd5d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4cedd29..0fe6f06 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 _0xa255=['options','find','create','body','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','send','index','map','ZohoField','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','VIRTUAL','merge','where','include','rows','catch','params','includeAll'];(function(_0x516b14,_0x514290){var _0x1650bd=function(_0xb65197){while(--_0xb65197){_0x516b14['push'](_0x516b14['shift']());}};_0x1650bd(++_0x514290);}(_0xa255,0x88));var _0x5a25=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0xa255[_0x3b7b8a];return _0x441206;};'use strict';var emlformat=require(_0x5a25('0x0'));var rimraf=require(_0x5a25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a25('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a25('0x3'));var util=require(_0x5a25('0x4'));var path=require(_0x5a25('0x5'));var sox=require('sox');var csv=require(_0x5a25('0x6'));var ejs=require(_0x5a25('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a25('0x8'));var squel=require(_0x5a25('0x9'));var crypto=require('crypto');var jsforce=require(_0x5a25('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5a25('0x6'));var querystring=require('querystring');var Papa=require(_0x5a25('0xb'));var Redis=require('ioredis');var authService=require(_0x5a25('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x5a25('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a25('0xe'));var utils=require('../../config/utils');var config=require(_0x5a25('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a25('0x10'))['db'];function respondWithStatusCode(_0x2afdea,_0x31e71f){_0x31e71f=_0x31e71f||0xcc;return function(_0x49b43b){if(_0x49b43b){return _0x2afdea['sendStatus'](_0x31e71f);}return _0x2afdea['status'](_0x31e71f)[_0x5a25('0x11')]();};}function respondWithResult(_0x361666,_0x13404c){_0x13404c=_0x13404c||0xc8;return function(_0xb5daa7){if(_0xb5daa7){return _0x361666[_0x5a25('0x12')](_0x13404c)[_0x5a25('0x13')](_0xb5daa7);}};}function respondWithFilteredResult(_0x4aafbc,_0xac997){return function(_0x2fb754){if(_0x2fb754){var _0x211963=typeof _0xac997[_0x5a25('0x14')]==='undefined'&&typeof _0xac997[_0x5a25('0x15')]===_0x5a25('0x16');var _0x2c3fb6=_0x2fb754[_0x5a25('0x17')];var _0x366397=_0x211963?0x0:_0xac997['offset'];var _0x5c41f3=_0x211963?_0x2fb754[_0x5a25('0x17')]:_0xac997[_0x5a25('0x14')]+_0xac997[_0x5a25('0x15')];var _0x435c63;if(_0x5c41f3>=_0x2c3fb6){_0x5c41f3=_0x2c3fb6;_0x435c63=0xc8;}else{_0x435c63=0xce;}_0x4aafbc[_0x5a25('0x12')](_0x435c63);return _0x4aafbc[_0x5a25('0x18')](_0x5a25('0x19'),_0x366397+'-'+_0x5c41f3+'/'+_0x2c3fb6)[_0x5a25('0x13')](_0x2fb754);}return null;};}function patchUpdates(_0x64848f){return function(_0x2b6a84){try{jsonpatch['apply'](_0x2b6a84,_0x64848f,!![]);}catch(_0x4fe713){return BPromise[_0x5a25('0x1a')](_0x4fe713);}return _0x2b6a84['save']();};}function saveUpdates(_0x3ae620,_0x1358a8){return function(_0x585b77){if(_0x585b77){return _0x585b77[_0x5a25('0x1b')](_0x3ae620)['then'](function(_0xadbb6){return _0xadbb6;});}return null;};}function removeEntity(_0x1ea37b,_0x1cc381){return function(_0xdadfca){if(_0xdadfca){return _0xdadfca[_0x5a25('0x1c')]()[_0x5a25('0x1d')](function(){_0x1ea37b[_0x5a25('0x12')](0xcc)[_0x5a25('0x11')]();});}};}function handleEntityNotFound(_0x4f859c,_0x1d8bf1){return function(_0xf867ba){if(!_0xf867ba){_0x4f859c[_0x5a25('0x1e')](0x194);}return _0xf867ba;};}function handleError(_0x45e146,_0x19c26d){_0x19c26d=_0x19c26d||0x1f4;return function(_0x5dc375){logger[_0x5a25('0x1f')](_0x5dc375[_0x5a25('0x20')]);if(_0x5dc375['name']){delete _0x5dc375['name'];}_0x45e146[_0x5a25('0x12')](_0x19c26d)[_0x5a25('0x21')](_0x5dc375);};}exports[_0x5a25('0x22')]=function(_0xbb3de6,_0x4b2c41){var _0x2ff898={},_0x4cf6fb={},_0xac8e98={'count':0x0,'rows':[]};var _0x5cc6d7=_[_0x5a25('0x23')](db[_0x5a25('0x24')][_0x5a25('0x25')],function(_0x3162d2){return{'name':_0x3162d2[_0x5a25('0x26')],'type':_0x3162d2[_0x5a25('0x27')]['key']};});_0x4cf6fb['model']=_['map'](_0x5cc6d7,_0x5a25('0x28'));_0x4cf6fb[_0x5a25('0x29')]=_[_0x5a25('0x2a')](_0xbb3de6[_0x5a25('0x29')]);_0x4cf6fb[_0x5a25('0x2b')]=_['intersection'](_0x4cf6fb[_0x5a25('0x2c')],_0x4cf6fb[_0x5a25('0x29')]);_0x2ff898[_0x5a25('0x2d')]=_[_0x5a25('0x2e')](_0x4cf6fb[_0x5a25('0x2c')],qs[_0x5a25('0x2f')](_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x2f')]));_0x2ff898['attributes']=_0x2ff898[_0x5a25('0x2d')][_0x5a25('0x30')]?_0x2ff898['attributes']:_0x4cf6fb[_0x5a25('0x2c')];if(!_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x31')]('nolimit')){_0x2ff898[_0x5a25('0x15')]=qs[_0x5a25('0x15')](_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x15')]);_0x2ff898['offset']=qs[_0x5a25('0x14')](_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x14')]);}_0x2ff898[_0x5a25('0x32')]=qs[_0x5a25('0x33')](_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x33')]);_0x2ff898['where']=qs[_0x5a25('0x2b')](_[_0x5a25('0x34')](_0xbb3de6[_0x5a25('0x29')],_0x4cf6fb[_0x5a25('0x2b')]),_0x5cc6d7);if(_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x35')]){_0x2ff898['where']=_['merge'](_0x2ff898['where'],{'$or':_['map'](_0x5cc6d7,function(_0x1d3870){if(_0x1d3870[_0x5a25('0x27')]!==_0x5a25('0x36')){var _0x1b3462={};_0x1b3462[_0x1d3870[_0x5a25('0x28')]]={'$like':'%'+_0xbb3de6[_0x5a25('0x29')]['filter']+'%'};return _0x1b3462;}})});}_0x2ff898=_[_0x5a25('0x37')]({},_0x2ff898,_0xbb3de6['options']);var _0x5f2ea7={'where':_0x2ff898[_0x5a25('0x38')]};return db[_0x5a25('0x24')]['count'](_0x5f2ea7)[_0x5a25('0x1d')](function(_0xb329c6){_0xac8e98[_0x5a25('0x17')]=_0xb329c6;if(_0xbb3de6[_0x5a25('0x29')]['includeAll']){_0x2ff898[_0x5a25('0x39')]=[{'all':!![]}];}return db[_0x5a25('0x24')]['findAll'](_0x2ff898);})['then'](function(_0xe0d924){_0xac8e98[_0x5a25('0x3a')]=_0xe0d924;return _0xac8e98;})[_0x5a25('0x1d')](respondWithFilteredResult(_0x4b2c41,_0x2ff898))[_0x5a25('0x3b')](handleError(_0x4b2c41,null));};exports['show']=function(_0x44e893,_0x5a31d){var _0x33dc32={'raw':!![],'where':{'id':_0x44e893[_0x5a25('0x3c')]['id']}},_0x37a545={};_0x37a545[_0x5a25('0x2c')]=_[_0x5a25('0x2a')](db['ZohoField'][_0x5a25('0x25')]);_0x37a545[_0x5a25('0x29')]=_[_0x5a25('0x2a')](_0x44e893[_0x5a25('0x29')]);_0x37a545[_0x5a25('0x2b')]=_[_0x5a25('0x2e')](_0x37a545[_0x5a25('0x2c')],_0x37a545[_0x5a25('0x29')]);_0x33dc32[_0x5a25('0x2d')]=_['intersection'](_0x37a545[_0x5a25('0x2c')],qs['fields'](_0x44e893['query'][_0x5a25('0x2f')]));_0x33dc32[_0x5a25('0x2d')]=_0x33dc32[_0x5a25('0x2d')][_0x5a25('0x30')]?_0x33dc32[_0x5a25('0x2d')]:_0x37a545['model'];if(_0x44e893[_0x5a25('0x29')][_0x5a25('0x3d')]){_0x33dc32[_0x5a25('0x39')]=[{'all':!![]}];}_0x33dc32=_[_0x5a25('0x37')]({},_0x33dc32,_0x44e893[_0x5a25('0x3e')]);return db[_0x5a25('0x24')][_0x5a25('0x3f')](_0x33dc32)[_0x5a25('0x1d')](handleEntityNotFound(_0x5a31d,null))[_0x5a25('0x1d')](respondWithResult(_0x5a31d,null))[_0x5a25('0x3b')](handleError(_0x5a31d,null));};exports[_0x5a25('0x40')]=function(_0xd9dfa6,_0x4fffb0){return db[_0x5a25('0x24')][_0x5a25('0x40')](_0xd9dfa6[_0x5a25('0x41')],{})[_0x5a25('0x1d')](respondWithResult(_0x4fffb0,0xc9))[_0x5a25('0x3b')](handleError(_0x4fffb0,null));};exports['update']=function(_0x3a68d0,_0xcbd92e){if(_0x3a68d0[_0x5a25('0x41')]['id']){delete _0x3a68d0[_0x5a25('0x41')]['id'];}return db[_0x5a25('0x24')][_0x5a25('0x3f')]({'where':{'id':_0x3a68d0[_0x5a25('0x3c')]['id']}})[_0x5a25('0x1d')](handleEntityNotFound(_0xcbd92e,null))[_0x5a25('0x1d')](saveUpdates(_0x3a68d0['body'],null))[_0x5a25('0x1d')](respondWithResult(_0xcbd92e,null))[_0x5a25('0x3b')](handleError(_0xcbd92e,null));};exports[_0x5a25('0x1c')]=function(_0x32e9cf,_0x116305){return db[_0x5a25('0x24')]['find']({'where':{'id':_0x32e9cf[_0x5a25('0x3c')]['id']}})['then'](handleEntityNotFound(_0x116305,null))['then'](removeEntity(_0x116305,null))[_0x5a25('0x3b')](handleError(_0x116305,null));}; \ No newline at end of file +var _0x5483=['index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send'];(function(_0x13bd92,_0x4eea2b){var _0x4a35c2=function(_0x216c70){while(--_0x216c70){_0x13bd92['push'](_0x13bd92['shift']());}};_0x4a35c2(++_0x4eea2b);}(_0x5483,0x6b));var _0x3548=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x5483[_0x15dbca];return _0x326533;};'use strict';var emlformat=require(_0x3548('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3548('0x1'));var jsonpatch=require(_0x3548('0x2'));var rp=require(_0x3548('0x3'));var moment=require(_0x3548('0x4'));var BPromise=require(_0x3548('0x5'));var Mustache=require(_0x3548('0x6'));var util=require(_0x3548('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3548('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3548('0x9'));var squel=require(_0x3548('0xa'));var crypto=require(_0x3548('0xb'));var jsforce=require(_0x3548('0xc'));var deskjs=require(_0x3548('0xd'));var toCsv=require(_0x3548('0xe'));var querystring=require(_0x3548('0xf'));var Papa=require(_0x3548('0x10'));var Redis=require(_0x3548('0x11'));var authService=require(_0x3548('0x12'));var qs=require(_0x3548('0x13'));var as=require(_0x3548('0x14'));var hardwareService=require(_0x3548('0x15'));var logger=require(_0x3548('0x16'))(_0x3548('0x17'));var utils=require(_0x3548('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3548('0x19'));var db=require(_0x3548('0x1a'))['db'];function respondWithStatusCode(_0x2183a2,_0x1f627d){_0x1f627d=_0x1f627d||0xcc;return function(_0x53733e){if(_0x53733e){return _0x2183a2[_0x3548('0x1b')](_0x1f627d);}return _0x2183a2[_0x3548('0x1c')](_0x1f627d)[_0x3548('0x1d')]();};}function respondWithResult(_0x43d556,_0x34d5ab){_0x34d5ab=_0x34d5ab||0xc8;return function(_0x5bfd8d){if(_0x5bfd8d){return _0x43d556[_0x3548('0x1c')](_0x34d5ab)[_0x3548('0x1e')](_0x5bfd8d);}};}function respondWithFilteredResult(_0x14adee,_0x37dcfe){return function(_0xb0707a){if(_0xb0707a){var _0x118843=typeof _0x37dcfe[_0x3548('0x1f')]===_0x3548('0x20')&&typeof _0x37dcfe[_0x3548('0x21')]===_0x3548('0x20');var _0x5f5bab=_0xb0707a[_0x3548('0x22')];var _0x2ae65c=_0x118843?0x0:_0x37dcfe[_0x3548('0x1f')];var _0x21b3ab=_0x118843?_0xb0707a[_0x3548('0x22')]:_0x37dcfe[_0x3548('0x1f')]+_0x37dcfe[_0x3548('0x21')];var _0x507a99;if(_0x21b3ab>=_0x5f5bab){_0x21b3ab=_0x5f5bab;_0x507a99=0xc8;}else{_0x507a99=0xce;}_0x14adee['status'](_0x507a99);return _0x14adee[_0x3548('0x23')](_0x3548('0x24'),_0x2ae65c+'-'+_0x21b3ab+'/'+_0x5f5bab)[_0x3548('0x1e')](_0xb0707a);}return null;};}function patchUpdates(_0x2cbcaa){return function(_0x4a8a65){try{jsonpatch[_0x3548('0x25')](_0x4a8a65,_0x2cbcaa,!![]);}catch(_0x54fc0b){return BPromise[_0x3548('0x26')](_0x54fc0b);}return _0x4a8a65['save']();};}function saveUpdates(_0x5c3329,_0x1ac2ff){return function(_0x4c0b97){if(_0x4c0b97){return _0x4c0b97[_0x3548('0x27')](_0x5c3329)[_0x3548('0x28')](function(_0x3ae375){return _0x3ae375;});}return null;};}function removeEntity(_0x3c3be8,_0x1ff9d7){return function(_0x1f59b1){if(_0x1f59b1){return _0x1f59b1[_0x3548('0x29')]()[_0x3548('0x28')](function(){_0x3c3be8[_0x3548('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafd458,_0x40036e){return function(_0x12fef8){if(!_0x12fef8){_0xafd458[_0x3548('0x1b')](0x194);}return _0x12fef8;};}function handleError(_0x268c1e,_0x155bf4){_0x155bf4=_0x155bf4||0x1f4;return function(_0x2515f4){logger[_0x3548('0x2a')](_0x2515f4['stack']);if(_0x2515f4[_0x3548('0x2b')]){delete _0x2515f4[_0x3548('0x2b')];}_0x268c1e['status'](_0x155bf4)[_0x3548('0x2c')](_0x2515f4);};}exports[_0x3548('0x2d')]=function(_0x4a62e8,_0x5de806){var _0x3a67c9={},_0x4cca50={},_0x55af52={'count':0x0,'rows':[]};var _0x5d4784=_[_0x3548('0x2e')](db[_0x3548('0x2f')]['rawAttributes'],function(_0x384437){return{'name':_0x384437[_0x3548('0x30')],'type':_0x384437[_0x3548('0x31')]['key']};});_0x4cca50[_0x3548('0x32')]=_[_0x3548('0x2e')](_0x5d4784,'name');_0x4cca50[_0x3548('0x33')]=_[_0x3548('0x34')](_0x4a62e8[_0x3548('0x33')]);_0x4cca50[_0x3548('0x35')]=_[_0x3548('0x36')](_0x4cca50['model'],_0x4cca50[_0x3548('0x33')]);_0x3a67c9[_0x3548('0x37')]=_['intersection'](_0x4cca50['model'],qs[_0x3548('0x38')](_0x4a62e8['query'][_0x3548('0x38')]));_0x3a67c9[_0x3548('0x37')]=_0x3a67c9[_0x3548('0x37')][_0x3548('0x39')]?_0x3a67c9[_0x3548('0x37')]:_0x4cca50['model'];if(!_0x4a62e8['query'][_0x3548('0x3a')]('nolimit')){_0x3a67c9[_0x3548('0x21')]=qs['limit'](_0x4a62e8[_0x3548('0x33')][_0x3548('0x21')]);_0x3a67c9[_0x3548('0x1f')]=qs[_0x3548('0x1f')](_0x4a62e8[_0x3548('0x33')][_0x3548('0x1f')]);}_0x3a67c9[_0x3548('0x3b')]=qs['sort'](_0x4a62e8['query'][_0x3548('0x3c')]);_0x3a67c9['where']=qs[_0x3548('0x35')](_[_0x3548('0x3d')](_0x4a62e8['query'],_0x4cca50['filters']),_0x5d4784);if(_0x4a62e8['query'][_0x3548('0x3e')]){_0x3a67c9[_0x3548('0x3f')]=_[_0x3548('0x40')](_0x3a67c9['where'],{'$or':_[_0x3548('0x2e')](_0x5d4784,function(_0x23072f){if(_0x23072f['type']!==_0x3548('0x41')){var _0x90b4b1={};_0x90b4b1[_0x23072f[_0x3548('0x2b')]]={'$like':'%'+_0x4a62e8[_0x3548('0x33')]['filter']+'%'};return _0x90b4b1;}})});}_0x3a67c9=_[_0x3548('0x40')]({},_0x3a67c9,_0x4a62e8[_0x3548('0x42')]);var _0x54358a={'where':_0x3a67c9[_0x3548('0x3f')]};return db[_0x3548('0x2f')]['count'](_0x54358a)['then'](function(_0x3679d3){_0x55af52[_0x3548('0x22')]=_0x3679d3;if(_0x4a62e8[_0x3548('0x33')][_0x3548('0x43')]){_0x3a67c9['include']=[{'all':!![]}];}return db[_0x3548('0x2f')][_0x3548('0x44')](_0x3a67c9);})[_0x3548('0x28')](function(_0x3478f1){_0x55af52[_0x3548('0x45')]=_0x3478f1;return _0x55af52;})[_0x3548('0x28')](respondWithFilteredResult(_0x5de806,_0x3a67c9))[_0x3548('0x46')](handleError(_0x5de806,null));};exports[_0x3548('0x47')]=function(_0x209cd7,_0x688717){var _0x2b72b7={'raw':!![],'where':{'id':_0x209cd7[_0x3548('0x48')]['id']}},_0x4e251a={};_0x4e251a['model']=_[_0x3548('0x34')](db[_0x3548('0x2f')]['rawAttributes']);_0x4e251a[_0x3548('0x33')]=_[_0x3548('0x34')](_0x209cd7[_0x3548('0x33')]);_0x4e251a['filters']=_[_0x3548('0x36')](_0x4e251a[_0x3548('0x32')],_0x4e251a[_0x3548('0x33')]);_0x2b72b7[_0x3548('0x37')]=_[_0x3548('0x36')](_0x4e251a[_0x3548('0x32')],qs['fields'](_0x209cd7[_0x3548('0x33')][_0x3548('0x38')]));_0x2b72b7[_0x3548('0x37')]=_0x2b72b7[_0x3548('0x37')][_0x3548('0x39')]?_0x2b72b7[_0x3548('0x37')]:_0x4e251a[_0x3548('0x32')];if(_0x209cd7[_0x3548('0x33')][_0x3548('0x43')]){_0x2b72b7['include']=[{'all':!![]}];}_0x2b72b7=_[_0x3548('0x40')]({},_0x2b72b7,_0x209cd7[_0x3548('0x42')]);return db[_0x3548('0x2f')][_0x3548('0x49')](_0x2b72b7)[_0x3548('0x28')](handleEntityNotFound(_0x688717,null))['then'](respondWithResult(_0x688717,null))[_0x3548('0x46')](handleError(_0x688717,null));};exports[_0x3548('0x4a')]=function(_0x3fc997,_0x3c5c96){return db[_0x3548('0x2f')][_0x3548('0x4a')](_0x3fc997[_0x3548('0x4b')],{})['then'](respondWithResult(_0x3c5c96,0xc9))['catch'](handleError(_0x3c5c96,null));};exports[_0x3548('0x27')]=function(_0xf91f3a,_0x3ac729){if(_0xf91f3a['body']['id']){delete _0xf91f3a[_0x3548('0x4b')]['id'];}return db[_0x3548('0x2f')]['find']({'where':{'id':_0xf91f3a[_0x3548('0x48')]['id']}})[_0x3548('0x28')](handleEntityNotFound(_0x3ac729,null))['then'](saveUpdates(_0xf91f3a[_0x3548('0x4b')],null))[_0x3548('0x28')](respondWithResult(_0x3ac729,null))[_0x3548('0x46')](handleError(_0x3ac729,null));};exports[_0x3548('0x29')]=function(_0x3aa1f9,_0x31c63d){return db[_0x3548('0x2f')][_0x3548('0x49')]({'where':{'id':_0x3aa1f9['params']['id']}})[_0x3548('0x28')](handleEntityNotFound(_0x31c63d,null))[_0x3548('0x28')](removeEntity(_0x31c63d,null))['catch'](handleError(_0x31c63d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 73e08a8..3ed2607 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 _0xacf4=['bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','../../config/logger','api','moment'];(function(_0x43fe89,_0x1e9be0){var _0x18d869=function(_0x53daef){while(--_0x53daef){_0x43fe89['push'](_0x43fe89['shift']());}};_0x18d869(++_0x1e9be0);}(_0xacf4,0xe7));var _0x4acf=function(_0x43bc6b,_0x2b577c){_0x43bc6b=_0x43bc6b-0x0;var _0x114255=_0xacf4[_0x43bc6b];return _0x114255;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0xededfa,_0x35f3f0){var _0x5b8f86=function(_0x3a108a){while(--_0x3a108a){_0xededfa['push'](_0xededfa['shift']());}};_0x5b8f86(++_0x35f3f0);}(_0xd046,0x129));var _0x6d04=function(_0x1b51c7,_0x2862b4){_0x1b51c7=_0x1b51c7-0x0;var _0x3a4b=_0xd046[_0x1b51c7];return _0x3a4b;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var logger=require(_0x6d04('0x1'))(_0x6d04('0x2'));var moment=require('moment');var BPromise=require(_0x6d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x6d04('0x5'));module['exports']=function(_0x4bacb1,_0xf3b4e7){return _0x4bacb1[_0x6d04('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x6d04('0x7'),'fields':[_0x6d04('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 99373b4..d589f36 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 _0x43ce=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x231a0a,_0x51c762){var _0x481cef=function(_0x3673ad){while(--_0x3673ad){_0x231a0a['push'](_0x231a0a['shift']());}};_0x481cef(++_0x51c762);}(_0x43ce,0xe0));var _0xe43c=function(_0x37d8cb,_0xd505f7){_0x37d8cb=_0x37d8cb-0x0;var _0x1221da=_0x43ce[_0x37d8cb];return _0x1221da;};'use strict';var _=require('lodash');var util=require(_0xe43c('0x0'));var moment=require(_0xe43c('0x1'));var BPromise=require(_0xe43c('0x2'));var rs=require(_0xe43c('0x3'));var fs=require('fs');var Redis=require(_0xe43c('0x4'));var db=require(_0xe43c('0x5'))['db'];var utils=require(_0xe43c('0x6'));var logger=require(_0xe43c('0x7'))(_0xe43c('0x8'));var config=require(_0xe43c('0x9'));var jayson=require(_0xe43c('0xa'));var client=jayson['client'][_0xe43c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x706856,_0x1e4737,_0x4f8e3c){return new BPromise(function(_0x3eefe9,_0x3a1891){return client[_0xe43c('0xc')](_0x706856,_0x4f8e3c)[_0xe43c('0xd')](function(_0x51fbef){logger['info'](_0xe43c('0xe'),_0x1e4737,_0xe43c('0xf'));logger[_0xe43c('0x10')](_0xe43c('0x11'),_0x1e4737,_0xe43c('0xf'),JSON[_0xe43c('0x12')](_0x51fbef));if(_0x51fbef[_0xe43c('0x13')]){if(_0x51fbef['error'][_0xe43c('0x14')]===0x1f4){logger[_0xe43c('0x13')](_0xe43c('0xe'),_0x1e4737,_0x51fbef[_0xe43c('0x13')][_0xe43c('0x15')]);return _0x3a1891(_0x51fbef[_0xe43c('0x13')][_0xe43c('0x15')]);}logger['error'](_0xe43c('0xe'),_0x1e4737,_0x51fbef[_0xe43c('0x13')][_0xe43c('0x15')]);return _0x3eefe9(_0x51fbef['error']['message']);}else{logger[_0xe43c('0x16')]('ZohoField,\x20%s,\x20%s',_0x1e4737,'request\x20sent');_0x3eefe9(_0x51fbef['result'][_0xe43c('0x15')]);}})['catch'](function(_0x482afc){logger[_0xe43c('0x13')](_0xe43c('0xe'),_0x1e4737,_0x482afc);_0x3a1891(_0x482afc);});});} \ No newline at end of file +var _0x0451=['request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4fb196,_0x47fcf5){var _0x5817fb=function(_0x34cd4f){while(--_0x34cd4f){_0x4fb196['push'](_0x4fb196['shift']());}};_0x5817fb(++_0x47fcf5);}(_0x0451,0x9c));var _0x1045=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0451[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x1045('0x0'));var util=require(_0x1045('0x1'));var moment=require('moment');var BPromise=require(_0x1045('0x2'));var rs=require(_0x1045('0x3'));var fs=require('fs');var Redis=require(_0x1045('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1045('0x5'));var logger=require(_0x1045('0x6'))(_0x1045('0x7'));var config=require(_0x1045('0x8'));var jayson=require(_0x1045('0x9'));var client=jayson[_0x1045('0xa')][_0x1045('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6aa6,_0x15fe91,_0x4c1699){return new BPromise(function(_0x2c6e28,_0x4d2cee){return client[_0x1045('0xc')](_0x4d6aa6,_0x4c1699)[_0x1045('0xd')](function(_0x279856){logger[_0x1045('0xe')](_0x1045('0xf'),_0x15fe91,_0x1045('0x10'));logger[_0x1045('0x11')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x15fe91,'request\x20sent',JSON[_0x1045('0x12')](_0x279856));if(_0x279856[_0x1045('0x13')]){if(_0x279856['error'][_0x1045('0x14')]===0x1f4){logger[_0x1045('0x13')]('ZohoField,\x20%s,\x20%s',_0x15fe91,_0x279856[_0x1045('0x13')][_0x1045('0x15')]);return _0x4d2cee(_0x279856[_0x1045('0x13')]['message']);}logger[_0x1045('0x13')]('ZohoField,\x20%s,\x20%s',_0x15fe91,_0x279856[_0x1045('0x13')][_0x1045('0x15')]);return _0x2c6e28(_0x279856[_0x1045('0x13')]['message']);}else{logger['info'](_0x1045('0xf'),_0x15fe91,_0x1045('0x10'));_0x2c6e28(_0x279856[_0x1045('0x16')][_0x1045('0x15')]);}})[_0x1045('0x17')](function(_0x23e734){logger[_0x1045('0x13')](_0x1045('0xf'),_0x15fe91,_0x23e734);_0x4d2cee(_0x23e734);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3fe22d2..4c5a36a 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x439af6,_0x479095){var _0x259601=function(_0x375ea9){while(--_0x375ea9){_0x439af6['push'](_0x439af6['shift']());}};_0x259601(++_0x479095);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c6a068e..4658efc 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 _0x9ef8=['sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x1447bb,_0x51b4ce){var _0x367cd4=function(_0x1158e0){while(--_0x1158e0){_0x1447bb['push'](_0x1447bb['shift']());}};_0x367cd4(++_0x51b4ce);}(_0x9ef8,0x78));var _0x89ef=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x9ef8[_0x4e55a9];return _0x4a9b67;};'use strict';var Sequelize=require(_0x89ef('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x89ef('0x1')],'allowNull':![],'unique':_0x89ef('0x2')},'main':{'type':Sequelize[_0x89ef('0x1')],'defaultValue':_0x89ef('0x3')},'filename':{'type':Sequelize[_0x89ef('0x1')]},'path':{'type':Sequelize[_0x89ef('0x1')]},'type':{'type':Sequelize[_0x89ef('0x1')]},'size':{'type':Sequelize[_0x89ef('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x89ef('0x1')]},'logo':{'type':Sequelize[_0x89ef('0x1')]},'state':{'type':Sequelize[_0x89ef('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x89ef('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x89ef('0x1')]},'link':{'type':Sequelize[_0x89ef('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x1b4d=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x44f8c3,_0x27f4e5){var _0x39d91d=function(_0x2b7464){while(--_0x2b7464){_0x44f8c3['push'](_0x44f8c3['shift']());}};_0x39d91d(++_0x27f4e5);}(_0x1b4d,0xce));var _0xd1b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1b4d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xd1b4('0x0'));module[_0xd1b4('0x1')]={'name':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![],'unique':_0xd1b4('0x3')},'version':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![],'unique':_0xd1b4('0x3')},'main':{'type':Sequelize[_0xd1b4('0x2')],'defaultValue':_0xd1b4('0x4')},'filename':{'type':Sequelize[_0xd1b4('0x2')]},'path':{'type':Sequelize[_0xd1b4('0x2')]},'type':{'type':Sequelize[_0xd1b4('0x2')]},'size':{'type':Sequelize[_0xd1b4('0x5')]},'active':{'type':Sequelize[_0xd1b4('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xd1b4('0x2')]},'logo':{'type':Sequelize[_0xd1b4('0x2')]},'state':{'type':Sequelize[_0xd1b4('0x2')],'unique':_0xd1b4('0x7')},'description':{'type':Sequelize[_0xd1b4('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd1b4('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index c4e85db..8d57bbc 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 _0xe3da=['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','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x1c4161,_0x3c3b25){var _0x2e3f51=function(_0x293350){while(--_0x293350){_0x1c4161['push'](_0x1c4161['shift']());}};_0x2e3f51(++_0x3c3b25);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));}; \ No newline at end of file +var _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x1803bb,_0x28d69e){var _0x27f820=function(_0x36ca4a){while(--_0x36ca4a){_0x1803bb['push'](_0x1803bb['shift']());}};_0x27f820(++_0x28d69e);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index cdde71c..ec00dce 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 _0xaf2e=['./integration.attributes','Integration','integrations','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x22d656,_0x5c53c0){var _0x56bffb=function(_0x54c1f0){while(--_0x54c1f0){_0x22d656['push'](_0x22d656['shift']());}};_0x56bffb(++_0x5c53c0);}(_0xaf2e,0x1bc));var _0xeaf2=function(_0x1385c0,_0x1569bb){_0x1385c0=_0x1385c0-0x0;var _0x50f20d=_0xaf2e[_0x1385c0];return _0x50f20d;};'use strict';var _=require('lodash');var util=require(_0xeaf2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xeaf2('0x1'));var BPromise=require(_0xeaf2('0x2'));var rp=require(_0xeaf2('0x3'));var fs=require('fs');var path=require(_0xeaf2('0x4'));var rimraf=require('rimraf');var config=require(_0xeaf2('0x5'));var attributes=require(_0xeaf2('0x6'));module['exports']=function(_0x4510a7,_0x2a0209){return _0x4510a7['define'](_0xeaf2('0x7'),attributes,{'tableName':_0xeaf2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9928=['Integration','integrations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x85979c,_0x437e71){var _0x96e676=function(_0x2b3b6c){while(--_0x2b3b6c){_0x85979c['push'](_0x85979c['shift']());}};_0x96e676(++_0x437e71);}(_0x9928,0xc8));var _0x8992=function(_0x1cdf19,_0x2c4b46){_0x1cdf19=_0x1cdf19-0x0;var _0x340a02=_0x9928[_0x1cdf19];return _0x340a02;};'use strict';var _=require(_0x8992('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8992('0x1'));var moment=require(_0x8992('0x2'));var BPromise=require(_0x8992('0x3'));var rp=require(_0x8992('0x4'));var fs=require('fs');var path=require(_0x8992('0x5'));var rimraf=require(_0x8992('0x6'));var config=require(_0x8992('0x7'));var attributes=require('./integration.attributes');module['exports']=function(_0x53e77d,_0xb722a5){return _0x53e77d[_0x8992('0x8')](_0x8992('0x9'),attributes,{'tableName':_0x8992('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 13a8956..ebdcb00 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0x524e,0x15e));var _0xe524=function(_0x256822,_0xe1a1f2){_0x256822=_0x256822-0x0;var _0x15baf9=_0x524e[_0x256822];return _0x15baf9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +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(_0x278acd,_0x16d3fc){var _0x330bc8=function(_0x416d16){while(--_0x416d16){_0x278acd['push'](_0x278acd['shift']());}};_0x330bc8(++_0x16d3fc);}(_0xd943,0x15d));var _0x3d94=function(_0x4e1cec,_0x21af7d){_0x4e1cec=_0x4e1cec-0x0;var _0x417046=_0xd943[_0x4e1cec];return _0x417046;};'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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f8489b7..d8ea760 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 _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x23fb48,_0x47a117){var _0x467867=function(_0x4bd0ba){while(--_0x4bd0ba){_0x23fb48['push'](_0x23fb48['shift']());}};_0x467867(++_0x47a117);}(_0x0b0e,0x187));var _0xe0b0=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x0b0e[_0x36bff5];return _0x80ade5;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file +var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x4b3d60,_0x23596d){var _0x3e437a=function(_0x17e6a4){while(--_0x17e6a4){_0x4b3d60['push'](_0x4b3d60['shift']());}};_0x3e437a(++_0x23596d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x108db1,_0x89896d){_0x108db1=_0x108db1-0x0;var _0x16848d=_0x0b0e[_0x108db1];return _0x16848d;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index da471c8..747b90a 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 _0x8621=['ENUM','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x23a16b,_0x5607aa){var _0xd8dd7b=function(_0x5305a4){while(--_0x5305a4){_0x23a16b['push'](_0x23a16b['shift']());}};_0xd8dd7b(++_0x5607aa);}(_0x8621,0xf3));var _0x1862=function(_0x6d2915,_0x5daf33){_0x6d2915=_0x6d2915-0x0;var _0x37ec2f=_0x8621[_0x6d2915];return _0x37ec2f;};'use strict';var Sequelize=require(_0x1862('0x0'));module[_0x1862('0x1')]={'integration':{'type':Sequelize[_0x1862('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x1862('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x1862('0x3')]},'contacts':{'type':Sequelize[_0x1862('0x2')]},'uniqueid':{'type':Sequelize[_0x1862('0x2')]},'calleridnum':{'type':Sequelize[_0x1862('0x2')]},'calleridname':{'type':Sequelize[_0x1862('0x2')]},'queue':{'type':Sequelize[_0x1862('0x2')]},'interface':{'type':Sequelize[_0x1862('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x1862('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x1862('0x3')]},'agentcomplete':{'type':Sequelize[_0x1862('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1862('0x4')]},'talktime':{'type':Sequelize[_0x1862('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1862('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1862('0x4')]},'agentdump':{'type':Sequelize[_0x1862('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x1862('0x2')]},'channel':{'type':Sequelize[_0x1862('0x2')]},'channelstate':{'type':Sequelize[_0x1862('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x1862('0x2')]},'language':{'type':Sequelize[_0x1862('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1862('0x2')]},'priority':{'type':Sequelize[_0x1862('0x2')]},'destchannel':{'type':Sequelize[_0x1862('0x2')]},'destchannelstate':{'type':Sequelize[_0x1862('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x1862('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1862('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x1862('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1862('0x2')]},'destlanguage':{'type':Sequelize[_0x1862('0x2')]},'destaccountcode':{'type':Sequelize[_0x1862('0x2')]},'destcontext':{'type':Sequelize[_0x1862('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x1862('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x1862('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x1862('0x2')]},'from':{'type':Sequelize[_0x1862('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x1862('0x6')]},'html':{'type':Sequelize[_0x1862('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x1862('0x7')]('SENT',_0x1862('0x8'),_0x1862('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x1862('0x2')]},'projectId':{'type':Sequelize[_0x1862('0x3')]}}; \ No newline at end of file +var _0x510b=['BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x588280,_0x456cee){var _0x5a2fb4=function(_0x55e85e){while(--_0x55e85e){_0x588280['push'](_0x588280['shift']());}};_0x5a2fb4(++_0x456cee);}(_0x510b,0xa0));var _0xb510=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x510b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb510('0x0'));module[_0xb510('0x1')]={'integration':{'type':Sequelize[_0xb510('0x2')]},'eventChannel':{'type':Sequelize[_0xb510('0x2')]},'exitStatus':{'type':Sequelize[_0xb510('0x2')]},'ticketId':{'type':Sequelize[_0xb510('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xb510('0x2')]},'uniqueid':{'type':Sequelize[_0xb510('0x2')]},'calleridnum':{'type':Sequelize[_0xb510('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb510('0x2')]},'interface':{'type':Sequelize[_0xb510('0x2')]},'membername':{'type':Sequelize[_0xb510('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb510('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb510('0x3')]},'holdtime':{'type':Sequelize[_0xb510('0x4')]},'agentcomplete':{'type':Sequelize[_0xb510('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xb510('0x4')]},'agentacw':{'type':Sequelize[_0xb510('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb510('0x4')]},'reason':{'type':Sequelize[_0xb510('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xb510('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb510('0x3')]},'agentdump':{'type':Sequelize[_0xb510('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xb510('0x2')]},'channel':{'type':Sequelize[_0xb510('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb510('0x2')]},'language':{'type':Sequelize[_0xb510('0x2')]},'accountcode':{'type':Sequelize[_0xb510('0x2')]},'context':{'type':Sequelize[_0xb510('0x2')]},'exten':{'type':Sequelize[_0xb510('0x2')]},'priority':{'type':Sequelize[_0xb510('0x2')]},'destchannel':{'type':Sequelize[_0xb510('0x2')]},'destchannelstate':{'type':Sequelize[_0xb510('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb510('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xb510('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xb510('0x2')]},'destaccountcode':{'type':Sequelize[_0xb510('0x2')]},'destcontext':{'type':Sequelize[_0xb510('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb510('0x2')]},'destuniqueid':{'type':Sequelize[_0xb510('0x2')]},'messageId':{'type':Sequelize[_0xb510('0x2')]},'inReplyTo':{'type':Sequelize[_0xb510('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xb510('0x2')]},'to':{'type':Sequelize[_0xb510('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xb510('0x6')]},'html':{'type':Sequelize[_0xb510('0x6')]},'text':{'type':Sequelize[_0xb510('0x6')]},'status':{'type':Sequelize['ENUM'](_0xb510('0x7'),_0xb510('0x8'),_0xb510('0x9'),_0xb510('0xa'))},'url':{'type':Sequelize[_0xb510('0x2')]},'app':{'type':Sequelize[_0xb510('0x2')]},'appdata':{'type':Sequelize[_0xb510('0x2')]},'projectId':{'type':Sequelize[_0xb510('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0f48e81..0478272 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 _0xfe16=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','type','VIRTUAL','merge','options','IntegrationReport','includeAll','include','findAll','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3e1eae,_0x55c245){var _0x53d927=function(_0x40249d){while(--_0x40249d){_0x3e1eae['push'](_0x3e1eae['shift']());}};_0x53d927(++_0x55c245);}(_0xfe16,0x1b8));var _0x6fe1=function(_0xed3c07,_0x5e4bdc){_0xed3c07=_0xed3c07-0x0;var _0x336cb9=_0xfe16[_0xed3c07];return _0x336cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fe1('0x0'));var zipdir=require(_0x6fe1('0x1'));var jsonpatch=require(_0x6fe1('0x2'));var rp=require(_0x6fe1('0x3'));var moment=require(_0x6fe1('0x4'));var BPromise=require(_0x6fe1('0x5'));var Mustache=require(_0x6fe1('0x6'));var util=require(_0x6fe1('0x7'));var path=require(_0x6fe1('0x8'));var sox=require(_0x6fe1('0x9'));var csv=require(_0x6fe1('0xa'));var ejs=require(_0x6fe1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6fe1('0xc'));var crypto=require(_0x6fe1('0xd'));var jsforce=require(_0x6fe1('0xe'));var deskjs=require(_0x6fe1('0xf'));var toCsv=require(_0x6fe1('0xa'));var querystring=require('querystring');var Papa=require(_0x6fe1('0x10'));var Redis=require(_0x6fe1('0x11'));var authService=require(_0x6fe1('0x12'));var qs=require(_0x6fe1('0x13'));var as=require(_0x6fe1('0x14'));var hardwareService=require(_0x6fe1('0x15'));var logger=require(_0x6fe1('0x16'))('api');var utils=require(_0x6fe1('0x17'));var config=require(_0x6fe1('0x18'));var licenseUtil=require(_0x6fe1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e917e,_0x9238d0){_0x9238d0=_0x9238d0||0xcc;return function(_0x3120d0){if(_0x3120d0){return _0x5e917e[_0x6fe1('0x1a')](_0x9238d0);}return _0x5e917e[_0x6fe1('0x1b')](_0x9238d0)['end']();};}function respondWithResult(_0x199e74,_0x2d7030){_0x2d7030=_0x2d7030||0xc8;return function(_0x26e138){if(_0x26e138){return _0x199e74['status'](_0x2d7030)[_0x6fe1('0x1c')](_0x26e138);}};}function respondWithFilteredResult(_0x598311,_0x107111){return function(_0x366147){if(_0x366147){var _0x4f93a8=typeof _0x107111[_0x6fe1('0x1d')]===_0x6fe1('0x1e')&&typeof _0x107111[_0x6fe1('0x1f')]===_0x6fe1('0x1e');var _0x1aaf18=_0x366147[_0x6fe1('0x20')];var _0x247f4c=_0x4f93a8?0x0:_0x107111[_0x6fe1('0x1d')];var _0x38de44=_0x4f93a8?_0x366147[_0x6fe1('0x20')]:_0x107111[_0x6fe1('0x1d')]+_0x107111['limit'];var _0x121e9c;if(_0x38de44>=_0x1aaf18){_0x38de44=_0x1aaf18;_0x121e9c=0xc8;}else{_0x121e9c=0xce;}_0x598311['status'](_0x121e9c);return _0x598311[_0x6fe1('0x21')](_0x6fe1('0x22'),_0x247f4c+'-'+_0x38de44+'/'+_0x1aaf18)['json'](_0x366147);}return null;};}function patchUpdates(_0x1c30de){return function(_0x487cba){try{jsonpatch['apply'](_0x487cba,_0x1c30de,!![]);}catch(_0xa8ab0f){return BPromise[_0x6fe1('0x23')](_0xa8ab0f);}return _0x487cba[_0x6fe1('0x24')]();};}function saveUpdates(_0x5a13c3,_0xecb950){return function(_0x43dcd5){if(_0x43dcd5){return _0x43dcd5[_0x6fe1('0x25')](_0x5a13c3)[_0x6fe1('0x26')](function(_0x23304d){return _0x23304d;});}return null;};}function removeEntity(_0x11a523,_0x5bccaa){return function(_0x180450){if(_0x180450){return _0x180450[_0x6fe1('0x27')]()[_0x6fe1('0x26')](function(){_0x11a523[_0x6fe1('0x1b')](0xcc)[_0x6fe1('0x28')]();});}};}function handleEntityNotFound(_0x4efd35,_0x23c720){return function(_0x1f6477){if(!_0x1f6477){_0x4efd35[_0x6fe1('0x1a')](0x194);}return _0x1f6477;};}function handleError(_0x379221,_0x26ed2f){_0x26ed2f=_0x26ed2f||0x1f4;return function(_0x40668d){logger['error'](_0x40668d[_0x6fe1('0x29')]);if(_0x40668d[_0x6fe1('0x2a')]){delete _0x40668d['name'];}_0x379221[_0x6fe1('0x1b')](_0x26ed2f)['send'](_0x40668d);};}exports[_0x6fe1('0x2b')]=function(_0xcc6944,_0x46a52e){var _0x1baefc={},_0x4e9721={},_0x57938f={'count':0x0,'rows':[]};var _0x3d4ee4=_[_0x6fe1('0x2c')](db['IntegrationReport'][_0x6fe1('0x2d')],function(_0x757649){return{'name':_0x757649[_0x6fe1('0x2e')],'type':_0x757649['type']['key']};});_0x4e9721[_0x6fe1('0x2f')]=_['map'](_0x3d4ee4,_0x6fe1('0x2a'));_0x4e9721['query']=_[_0x6fe1('0x30')](_0xcc6944[_0x6fe1('0x31')]);_0x4e9721['filters']=_['intersection'](_0x4e9721[_0x6fe1('0x2f')],_0x4e9721['query']);_0x1baefc[_0x6fe1('0x32')]=_[_0x6fe1('0x33')](_0x4e9721['model'],qs['fields'](_0xcc6944['query'][_0x6fe1('0x34')]));_0x1baefc[_0x6fe1('0x32')]=_0x1baefc[_0x6fe1('0x32')][_0x6fe1('0x35')]?_0x1baefc[_0x6fe1('0x32')]:_0x4e9721[_0x6fe1('0x2f')];if(!_0xcc6944[_0x6fe1('0x31')][_0x6fe1('0x36')](_0x6fe1('0x37'))){_0x1baefc[_0x6fe1('0x1f')]=qs[_0x6fe1('0x1f')](_0xcc6944[_0x6fe1('0x31')][_0x6fe1('0x1f')]);_0x1baefc[_0x6fe1('0x1d')]=qs[_0x6fe1('0x1d')](_0xcc6944[_0x6fe1('0x31')][_0x6fe1('0x1d')]);}_0x1baefc['order']=qs['sort'](_0xcc6944[_0x6fe1('0x31')]['sort']);_0x1baefc[_0x6fe1('0x38')]=qs[_0x6fe1('0x39')](_[_0x6fe1('0x3a')](_0xcc6944['query'],_0x4e9721['filters']),_0x3d4ee4);if(_0xcc6944['query'][_0x6fe1('0x3b')]){_0x1baefc[_0x6fe1('0x38')]=_['merge'](_0x1baefc[_0x6fe1('0x38')],{'$or':_[_0x6fe1('0x2c')](_0x3d4ee4,function(_0x2b9535){if(_0x2b9535[_0x6fe1('0x3c')]!==_0x6fe1('0x3d')){var _0x5aedd5={};_0x5aedd5[_0x2b9535[_0x6fe1('0x2a')]]={'$like':'%'+_0xcc6944[_0x6fe1('0x31')][_0x6fe1('0x3b')]+'%'};return _0x5aedd5;}})});}_0x1baefc=_[_0x6fe1('0x3e')]({},_0x1baefc,_0xcc6944[_0x6fe1('0x3f')]);var _0x53dd7e={'where':_0x1baefc[_0x6fe1('0x38')]};return db[_0x6fe1('0x40')][_0x6fe1('0x20')](_0x53dd7e)['then'](function(_0x47dc3f){_0x57938f[_0x6fe1('0x20')]=_0x47dc3f;if(_0xcc6944[_0x6fe1('0x31')][_0x6fe1('0x41')]){_0x1baefc[_0x6fe1('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0x6fe1('0x43')](_0x1baefc);})['then'](function(_0x56510d){_0x57938f['rows']=_0x56510d;return _0x57938f;})['then'](respondWithFilteredResult(_0x46a52e,_0x1baefc))['catch'](handleError(_0x46a52e,null));};exports[_0x6fe1('0x44')]=function(_0x3dc5e2,_0x568a50){var _0x1082ab={'raw':![],'where':{'id':_0x3dc5e2['params']['id']}},_0x3afaf7={};_0x3afaf7[_0x6fe1('0x2f')]=_['keys'](db[_0x6fe1('0x40')][_0x6fe1('0x2d')]);_0x3afaf7[_0x6fe1('0x31')]=_[_0x6fe1('0x30')](_0x3dc5e2[_0x6fe1('0x31')]);_0x3afaf7[_0x6fe1('0x39')]=_[_0x6fe1('0x33')](_0x3afaf7[_0x6fe1('0x2f')],_0x3afaf7['query']);_0x1082ab['attributes']=_[_0x6fe1('0x33')](_0x3afaf7[_0x6fe1('0x2f')],qs[_0x6fe1('0x34')](_0x3dc5e2[_0x6fe1('0x31')][_0x6fe1('0x34')]));_0x1082ab[_0x6fe1('0x32')]=_0x1082ab[_0x6fe1('0x32')][_0x6fe1('0x35')]?_0x1082ab[_0x6fe1('0x32')]:_0x3afaf7[_0x6fe1('0x2f')];if(_0x3dc5e2[_0x6fe1('0x31')][_0x6fe1('0x41')]){_0x1082ab[_0x6fe1('0x42')]=[{'all':!![]}];}_0x1082ab=_[_0x6fe1('0x3e')]({},_0x1082ab,_0x3dc5e2[_0x6fe1('0x3f')]);return db[_0x6fe1('0x40')][_0x6fe1('0x45')](_0x1082ab)[_0x6fe1('0x26')](handleEntityNotFound(_0x568a50,null))[_0x6fe1('0x26')](respondWithResult(_0x568a50,null))[_0x6fe1('0x46')](handleError(_0x568a50,null));};exports[_0x6fe1('0x47')]=function(_0x4b1a82,_0x18201b){return db[_0x6fe1('0x40')]['create'](_0x4b1a82['body'],{})[_0x6fe1('0x26')](respondWithResult(_0x18201b,0xc9))['catch'](handleError(_0x18201b,null));};exports[_0x6fe1('0x25')]=function(_0x1ccafc,_0x103a76){if(_0x1ccafc[_0x6fe1('0x48')]['id']){delete _0x1ccafc[_0x6fe1('0x48')]['id'];}return db[_0x6fe1('0x40')][_0x6fe1('0x45')]({'where':{'id':_0x1ccafc[_0x6fe1('0x49')]['id']}})[_0x6fe1('0x26')](handleEntityNotFound(_0x103a76,null))[_0x6fe1('0x26')](saveUpdates(_0x1ccafc[_0x6fe1('0x48')],null))[_0x6fe1('0x26')](respondWithResult(_0x103a76,null))[_0x6fe1('0x46')](handleError(_0x103a76,null));};exports[_0x6fe1('0x27')]=function(_0x10cb0a,_0x146e35){return db[_0x6fe1('0x40')][_0x6fe1('0x45')]({'where':{'id':_0x10cb0a[_0x6fe1('0x49')]['id']}})[_0x6fe1('0x26')](handleEntityNotFound(_0x146e35,null))['then'](removeEntity(_0x146e35,null))[_0x6fe1('0x46')](handleError(_0x146e35,null));};exports['describe']=function(_0x38fb97,_0x12ae19){return db[_0x6fe1('0x40')]['describe']()[_0x6fe1('0x26')](respondWithResult(_0x12ae19,null))[_0x6fe1('0x46')](handleError(_0x12ae19,null));}; \ No newline at end of file +var _0xe9ee=['catch','options','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows'];(function(_0x2ce3d0,_0xd94815){var _0x3c35d3=function(_0x16670d){while(--_0x16670d){_0x2ce3d0['push'](_0x2ce3d0['shift']());}};_0x3c35d3(++_0xd94815);}(_0xe9ee,0xf7));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee9e('0x0'));var rimraf=require(_0xee9e('0x1'));var zipdir=require(_0xee9e('0x2'));var jsonpatch=require(_0xee9e('0x3'));var rp=require(_0xee9e('0x4'));var moment=require(_0xee9e('0x5'));var BPromise=require(_0xee9e('0x6'));var Mustache=require(_0xee9e('0x7'));var util=require(_0xee9e('0x8'));var path=require(_0xee9e('0x9'));var sox=require(_0xee9e('0xa'));var csv=require(_0xee9e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee9e('0xc'));var _=require(_0xee9e('0xd'));var squel=require(_0xee9e('0xe'));var crypto=require(_0xee9e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xee9e('0x10'));var toCsv=require(_0xee9e('0xb'));var querystring=require(_0xee9e('0x11'));var Papa=require(_0xee9e('0x12'));var Redis=require(_0xee9e('0x13'));var authService=require(_0xee9e('0x14'));var qs=require(_0xee9e('0x15'));var as=require(_0xee9e('0x16'));var hardwareService=require(_0xee9e('0x17'));var logger=require(_0xee9e('0x18'))(_0xee9e('0x19'));var utils=require(_0xee9e('0x1a'));var config=require(_0xee9e('0x1b'));var licenseUtil=require(_0xee9e('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44e8ca,_0xf75238){_0xf75238=_0xf75238||0xcc;return function(_0x3ea62a){if(_0x3ea62a){return _0x44e8ca[_0xee9e('0x1d')](_0xf75238);}return _0x44e8ca['status'](_0xf75238)[_0xee9e('0x1e')]();};}function respondWithResult(_0x5a3f7e,_0x4fe61b){_0x4fe61b=_0x4fe61b||0xc8;return function(_0x53427a){if(_0x53427a){return _0x5a3f7e['status'](_0x4fe61b)[_0xee9e('0x1f')](_0x53427a);}};}function respondWithFilteredResult(_0x108199,_0x4fe13d){return function(_0x106354){if(_0x106354){var _0x1e8795=typeof _0x4fe13d[_0xee9e('0x20')]==='undefined'&&typeof _0x4fe13d[_0xee9e('0x21')]===_0xee9e('0x22');var _0x383c1d=_0x106354['count'];var _0x70eb4d=_0x1e8795?0x0:_0x4fe13d['offset'];var _0x13dbf5=_0x1e8795?_0x106354[_0xee9e('0x23')]:_0x4fe13d[_0xee9e('0x20')]+_0x4fe13d[_0xee9e('0x21')];var _0x53b297;if(_0x13dbf5>=_0x383c1d){_0x13dbf5=_0x383c1d;_0x53b297=0xc8;}else{_0x53b297=0xce;}_0x108199[_0xee9e('0x24')](_0x53b297);return _0x108199[_0xee9e('0x25')](_0xee9e('0x26'),_0x70eb4d+'-'+_0x13dbf5+'/'+_0x383c1d)['json'](_0x106354);}return null;};}function patchUpdates(_0x5eb802){return function(_0x5e01dc){try{jsonpatch[_0xee9e('0x27')](_0x5e01dc,_0x5eb802,!![]);}catch(_0x2ee93a){return BPromise[_0xee9e('0x28')](_0x2ee93a);}return _0x5e01dc[_0xee9e('0x29')]();};}function saveUpdates(_0x151097,_0x1ec3ae){return function(_0x4e4727){if(_0x4e4727){return _0x4e4727['update'](_0x151097)[_0xee9e('0x2a')](function(_0x54414f){return _0x54414f;});}return null;};}function removeEntity(_0x459e8d,_0x29c857){return function(_0x5d3643){if(_0x5d3643){return _0x5d3643[_0xee9e('0x2b')]()[_0xee9e('0x2a')](function(){_0x459e8d[_0xee9e('0x24')](0xcc)[_0xee9e('0x1e')]();});}};}function handleEntityNotFound(_0x5cc3af,_0x43c61e){return function(_0x191d29){if(!_0x191d29){_0x5cc3af[_0xee9e('0x1d')](0x194);}return _0x191d29;};}function handleError(_0x14a9c7,_0x40eb37){_0x40eb37=_0x40eb37||0x1f4;return function(_0xd24213){logger[_0xee9e('0x2c')](_0xd24213[_0xee9e('0x2d')]);if(_0xd24213[_0xee9e('0x2e')]){delete _0xd24213[_0xee9e('0x2e')];}_0x14a9c7[_0xee9e('0x24')](_0x40eb37)[_0xee9e('0x2f')](_0xd24213);};}exports['index']=function(_0x411bef,_0x5a61cb){var _0x2d5f9a={},_0xafbea5={},_0x2d6d5b={'count':0x0,'rows':[]};var _0x10cb3c=_[_0xee9e('0x30')](db[_0xee9e('0x31')][_0xee9e('0x32')],function(_0x3c6779){return{'name':_0x3c6779[_0xee9e('0x33')],'type':_0x3c6779[_0xee9e('0x34')]['key']};});_0xafbea5[_0xee9e('0x35')]=_[_0xee9e('0x30')](_0x10cb3c,'name');_0xafbea5[_0xee9e('0x36')]=_[_0xee9e('0x37')](_0x411bef[_0xee9e('0x36')]);_0xafbea5[_0xee9e('0x38')]=_['intersection'](_0xafbea5[_0xee9e('0x35')],_0xafbea5[_0xee9e('0x36')]);_0x2d5f9a[_0xee9e('0x39')]=_[_0xee9e('0x3a')](_0xafbea5[_0xee9e('0x35')],qs[_0xee9e('0x3b')](_0x411bef['query']['fields']));_0x2d5f9a[_0xee9e('0x39')]=_0x2d5f9a[_0xee9e('0x39')][_0xee9e('0x3c')]?_0x2d5f9a[_0xee9e('0x39')]:_0xafbea5['model'];if(!_0x411bef[_0xee9e('0x36')][_0xee9e('0x3d')](_0xee9e('0x3e'))){_0x2d5f9a[_0xee9e('0x21')]=qs[_0xee9e('0x21')](_0x411bef['query'][_0xee9e('0x21')]);_0x2d5f9a[_0xee9e('0x20')]=qs[_0xee9e('0x20')](_0x411bef[_0xee9e('0x36')][_0xee9e('0x20')]);}_0x2d5f9a[_0xee9e('0x3f')]=qs[_0xee9e('0x40')](_0x411bef[_0xee9e('0x36')][_0xee9e('0x40')]);_0x2d5f9a['where']=qs[_0xee9e('0x38')](_[_0xee9e('0x41')](_0x411bef[_0xee9e('0x36')],_0xafbea5['filters']),_0x10cb3c);if(_0x411bef['query'][_0xee9e('0x42')]){_0x2d5f9a[_0xee9e('0x43')]=_['merge'](_0x2d5f9a[_0xee9e('0x43')],{'$or':_['map'](_0x10cb3c,function(_0x15744d){if(_0x15744d[_0xee9e('0x34')]!==_0xee9e('0x44')){var _0x4ed052={};_0x4ed052[_0x15744d[_0xee9e('0x2e')]]={'$like':'%'+_0x411bef[_0xee9e('0x36')]['filter']+'%'};return _0x4ed052;}})});}_0x2d5f9a=_[_0xee9e('0x45')]({},_0x2d5f9a,_0x411bef['options']);var _0x444310={'where':_0x2d5f9a[_0xee9e('0x43')]};return db['IntegrationReport'][_0xee9e('0x23')](_0x444310)[_0xee9e('0x2a')](function(_0x59ae45){_0x2d6d5b['count']=_0x59ae45;if(_0x411bef[_0xee9e('0x36')]['includeAll']){_0x2d5f9a[_0xee9e('0x46')]=[{'all':!![]}];}return db[_0xee9e('0x31')][_0xee9e('0x47')](_0x2d5f9a);})[_0xee9e('0x2a')](function(_0x51061d){_0x2d6d5b[_0xee9e('0x48')]=_0x51061d;return _0x2d6d5b;})[_0xee9e('0x2a')](respondWithFilteredResult(_0x5a61cb,_0x2d5f9a))[_0xee9e('0x49')](handleError(_0x5a61cb,null));};exports['show']=function(_0x2d5dd6,_0x16b180){var _0x2afa41={'raw':![],'where':{'id':_0x2d5dd6['params']['id']}},_0x52de40={};_0x52de40['model']=_[_0xee9e('0x37')](db['IntegrationReport']['rawAttributes']);_0x52de40[_0xee9e('0x36')]=_[_0xee9e('0x37')](_0x2d5dd6[_0xee9e('0x36')]);_0x52de40[_0xee9e('0x38')]=_[_0xee9e('0x3a')](_0x52de40['model'],_0x52de40[_0xee9e('0x36')]);_0x2afa41[_0xee9e('0x39')]=_[_0xee9e('0x3a')](_0x52de40[_0xee9e('0x35')],qs[_0xee9e('0x3b')](_0x2d5dd6[_0xee9e('0x36')][_0xee9e('0x3b')]));_0x2afa41['attributes']=_0x2afa41[_0xee9e('0x39')]['length']?_0x2afa41[_0xee9e('0x39')]:_0x52de40[_0xee9e('0x35')];if(_0x2d5dd6[_0xee9e('0x36')]['includeAll']){_0x2afa41[_0xee9e('0x46')]=[{'all':!![]}];}_0x2afa41=_[_0xee9e('0x45')]({},_0x2afa41,_0x2d5dd6[_0xee9e('0x4a')]);return db[_0xee9e('0x31')]['find'](_0x2afa41)[_0xee9e('0x2a')](handleEntityNotFound(_0x16b180,null))[_0xee9e('0x2a')](respondWithResult(_0x16b180,null))['catch'](handleError(_0x16b180,null));};exports[_0xee9e('0x4b')]=function(_0xac269a,_0x4c16c2){return db['IntegrationReport']['create'](_0xac269a[_0xee9e('0x4c')],{})[_0xee9e('0x2a')](respondWithResult(_0x4c16c2,0xc9))[_0xee9e('0x49')](handleError(_0x4c16c2,null));};exports[_0xee9e('0x4d')]=function(_0x287e43,_0x56cdca){if(_0x287e43[_0xee9e('0x4c')]['id']){delete _0x287e43[_0xee9e('0x4c')]['id'];}return db[_0xee9e('0x31')][_0xee9e('0x4e')]({'where':{'id':_0x287e43[_0xee9e('0x4f')]['id']}})[_0xee9e('0x2a')](handleEntityNotFound(_0x56cdca,null))[_0xee9e('0x2a')](saveUpdates(_0x287e43['body'],null))[_0xee9e('0x2a')](respondWithResult(_0x56cdca,null))['catch'](handleError(_0x56cdca,null));};exports[_0xee9e('0x2b')]=function(_0x17fbea,_0x9dcdfa){return db[_0xee9e('0x31')][_0xee9e('0x4e')]({'where':{'id':_0x17fbea[_0xee9e('0x4f')]['id']}})[_0xee9e('0x2a')](handleEntityNotFound(_0x9dcdfa,null))[_0xee9e('0x2a')](removeEntity(_0x9dcdfa,null))[_0xee9e('0x49')](handleError(_0x9dcdfa,null));};exports['describe']=function(_0x33daa9,_0x2df625){return db[_0xee9e('0x31')]['describe']()[_0xee9e('0x2a')](respondWithResult(_0x2df625,null))['catch'](handleError(_0x2df625,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 8191f03..348b810 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 _0x74fd=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x74fd,0x17b));var _0xd74f=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x74fd[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0xd74f('0x0'));var util=require(_0xd74f('0x1'));var logger=require(_0xd74f('0x2'))(_0xd74f('0x3'));var moment=require(_0xd74f('0x4'));var BPromise=require(_0xd74f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd74f('0x6'));var rimraf=require(_0xd74f('0x7'));var config=require(_0xd74f('0x8'));var attributes=require('./integrationReport.attributes');module[_0xd74f('0x9')]=function(_0x17d8c4,_0x3ebc7b){return _0x17d8c4[_0xd74f('0xa')](_0xd74f('0xb'),attributes,{'tableName':_0xd74f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdaa=['api','moment','bluebird','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger'];(function(_0x4e8f5b,_0x3386be){var _0xb477f4=function(_0x417ddd){while(--_0x417ddd){_0x4e8f5b['push'](_0x4e8f5b['shift']());}};_0xb477f4(++_0x3386be);}(_0xcdaa,0x13d));var _0xacda=function(_0x42f502,_0x4db706){_0x42f502=_0x42f502-0x0;var _0x520e70=_0xcdaa[_0x42f502];return _0x520e70;};'use strict';var _=require('lodash');var util=require(_0xacda('0x0'));var logger=require(_0xacda('0x1'))(_0xacda('0x2'));var moment=require(_0xacda('0x3'));var BPromise=require(_0xacda('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xacda('0x5'));var rimraf=require(_0xacda('0x6'));var config=require('../../config/environment');var attributes=require(_0xacda('0x7'));module[_0xacda('0x8')]=function(_0x57e2d3,_0x2920c8){return _0x57e2d3[_0xacda('0x9')](_0xacda('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 43768c4..57e4a29 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 _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x1967,0x173));var _0x7196=function(_0x455c52,_0x5d27ff){_0x455c52=_0x455c52-0x0;var _0x33a1a9=_0x1967[_0x455c52];return _0x33a1a9;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1d5cbb,_0x425e7f){var _0x1da5d5=function(_0x462f8d){while(--_0x462f8d){_0x1d5cbb['push'](_0x1d5cbb['shift']());}};_0x1da5d5(++_0x425e7f);}(_0x5fab,0x177));var _0xb5fa=function(_0xc3b08e,_0x427235){_0xc3b08e=_0xc3b08e-0x0;var _0x4c5e08=_0x5fab[_0xc3b08e];return _0x4c5e08;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 89294ac..99c8516 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 _0xaa96=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports'];(function(_0x289f1f,_0x25f6f5){var _0x13ea8d=function(_0x19dd46){while(--_0x19dd46){_0x289f1f['push'](_0x289f1f['shift']());}};_0x13ea8d(++_0x25f6f5);}(_0xaa96,0x145));var _0x6aa9=function(_0x499773,_0x14f1eb){_0x499773=_0x499773-0x0;var _0xfc9b65=_0xaa96[_0x499773];return _0xfc9b65;};'use strict';var multer=require('multer');var util=require(_0x6aa9('0x0'));var path=require(_0x6aa9('0x1'));var timeout=require(_0x6aa9('0x2'));var express=require(_0x6aa9('0x3'));var router=express[_0x6aa9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6aa9('0x5'));var interaction=require(_0x6aa9('0x6'));var config=require(_0x6aa9('0x7'));var controller=require(_0x6aa9('0x8'));router[_0x6aa9('0x9')]('/',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0xb')]);router[_0x6aa9('0x9')](_0x6aa9('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6aa9('0x9')](_0x6aa9('0xd'),auth['isAuthenticated'](),controller[_0x6aa9('0xe')]);router[_0x6aa9('0xf')]('/',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x10')]);router[_0x6aa9('0xf')](_0x6aa9('0xd'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x11')]);router[_0x6aa9('0xf')](_0x6aa9('0x12'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x13')]);router[_0x6aa9('0x14')](_0x6aa9('0xc'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x15')]);router[_0x6aa9('0x16')]('/:id',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x17')]);module[_0x6aa9('0x18')]=router; \ No newline at end of file +var _0x13c5=['show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','/:id','update','delete','destroy','exports','multer','../../components/auth/service','./interval.controller','get','isAuthenticated','index'];(function(_0xf5bda0,_0x2589e1){var _0x5303cb=function(_0xdb9afe){while(--_0xdb9afe){_0xf5bda0['push'](_0xf5bda0['shift']());}};_0x5303cb(++_0x2589e1);}(_0x13c5,0x7a));var _0x513c=function(_0x483800,_0x15ef76){_0x483800=_0x483800-0x0;var _0x3ae709=_0x13c5[_0x483800];return _0x3ae709;};'use strict';var multer=require(_0x513c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x513c('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x513c('0x2'));router[_0x513c('0x3')]('/',auth[_0x513c('0x4')](),controller[_0x513c('0x5')]);router['get']('/:id',auth[_0x513c('0x4')](),controller[_0x513c('0x6')]);router[_0x513c('0x3')](_0x513c('0x7'),auth[_0x513c('0x4')](),controller[_0x513c('0x8')]);router[_0x513c('0x9')]('/',auth[_0x513c('0x4')](),controller['create']);router[_0x513c('0x9')](_0x513c('0x7'),auth['isAuthenticated'](),controller['addInterval']);router[_0x513c('0x9')](_0x513c('0xa'),auth['isAuthenticated'](),controller['addIntervals']);router['put'](_0x513c('0xb'),auth['isAuthenticated'](),controller[_0x513c('0xc')]);router[_0x513c('0xd')]('/:id',auth[_0x513c('0x4')](),controller[_0x513c('0xe')]);module[_0x513c('0xf')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a5df73e..c412ed2 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 _0x4bd1=['STRING','exports'];(function(_0x57c180,_0x4303ee){var _0x5b7062=function(_0x2c259d){while(--_0x2c259d){_0x57c180['push'](_0x57c180['shift']());}};_0x5b7062(++_0x4303ee);}(_0x4bd1,0x177));var _0x14bd=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4bd1[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require('sequelize');module[_0x14bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x14bd('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x105f=['sequelize','exports','STRING'];(function(_0x461eaa,_0x5b9604){var _0x3f2756=function(_0xddf81a){while(--_0xddf81a){_0x461eaa['push'](_0x461eaa['shift']());}};_0x3f2756(++_0x5b9604);}(_0x105f,0x1a1));var _0xf105=function(_0x3b60c7,_0xb85ee7){_0x3b60c7=_0x3b60c7-0x0;var _0x32f39b=_0x105f[_0x3b60c7];return _0x32f39b;};'use strict';var Sequelize=require(_0xf105('0x0'));module[_0xf105('0x1')]={'name':{'type':Sequelize[_0xf105('0x2')]},'description':{'type':Sequelize[_0xf105('0x2')]},'interval':{'type':Sequelize[_0xf105('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 986e917..7696c59 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 _0xb7ed=['UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filters','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','addInterval','IntervalId','getIntervals','findOne','order','pick','merge','addIntervals','transaction','bulkCreate','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals'];(function(_0x4e8718,_0x51a62f){var _0x1234e9=function(_0x4de43c){while(--_0x4de43c){_0x4e8718['push'](_0x4e8718['shift']());}};_0x1234e9(++_0x51a62f);}(_0xb7ed,0x8e));var _0xdb7e=function(_0xcd9ec8,_0x27699f){_0xcd9ec8=_0xcd9ec8-0x0;var _0x5aa31b=_0xb7ed[_0xcd9ec8];return _0x5aa31b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb7e('0x0'));var zipdir=require(_0xdb7e('0x1'));var jsonpatch=require(_0xdb7e('0x2'));var rp=require(_0xdb7e('0x3'));var moment=require(_0xdb7e('0x4'));var BPromise=require(_0xdb7e('0x5'));var Mustache=require(_0xdb7e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xdb7e('0x7'));var csv=require(_0xdb7e('0x8'));var ejs=require(_0xdb7e('0x9'));var fs=require('fs');var fs_extra=require(_0xdb7e('0xa'));var _=require(_0xdb7e('0xb'));var squel=require(_0xdb7e('0xc'));var crypto=require(_0xdb7e('0xd'));var jsforce=require(_0xdb7e('0xe'));var deskjs=require(_0xdb7e('0xf'));var toCsv=require(_0xdb7e('0x8'));var querystring=require(_0xdb7e('0x10'));var Papa=require(_0xdb7e('0x11'));var Redis=require(_0xdb7e('0x12'));var authService=require(_0xdb7e('0x13'));var qs=require(_0xdb7e('0x14'));var as=require(_0xdb7e('0x15'));var hardwareService=require(_0xdb7e('0x16'));var logger=require(_0xdb7e('0x17'))(_0xdb7e('0x18'));var utils=require(_0xdb7e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb7e('0x1a'))['db'];var extensions=require(_0xdb7e('0x1b'));function respondWithStatusCode(_0x44d571,_0x1d3adc){_0x1d3adc=_0x1d3adc||0xcc;return function(_0x2aa121){if(_0x2aa121){return _0x44d571['sendStatus'](_0x1d3adc);}return _0x44d571[_0xdb7e('0x1c')](_0x1d3adc)[_0xdb7e('0x1d')]();};}function respondWithResult(_0x2d6ee1,_0x36615a){_0x36615a=_0x36615a||0xc8;return function(_0x408187){if(_0x408187){return _0x2d6ee1[_0xdb7e('0x1c')](_0x36615a)[_0xdb7e('0x1e')](_0x408187);}};}function respondWithFilteredResult(_0x43818c,_0x491a2c){return function(_0x43ad64){if(_0x43ad64){var _0x22793f=typeof _0x491a2c['offset']==='undefined'&&typeof _0x491a2c[_0xdb7e('0x1f')]===_0xdb7e('0x20');var _0x3c66b9=_0x43ad64[_0xdb7e('0x21')];var _0x2ddc65=_0x22793f?0x0:_0x491a2c[_0xdb7e('0x22')];var _0x6467ad=_0x22793f?_0x43ad64[_0xdb7e('0x21')]:_0x491a2c[_0xdb7e('0x22')]+_0x491a2c['limit'];var _0x5dd54c;if(_0x6467ad>=_0x3c66b9){_0x6467ad=_0x3c66b9;_0x5dd54c=0xc8;}else{_0x5dd54c=0xce;}_0x43818c[_0xdb7e('0x1c')](_0x5dd54c);return _0x43818c[_0xdb7e('0x23')](_0xdb7e('0x24'),_0x2ddc65+'-'+_0x6467ad+'/'+_0x3c66b9)['json'](_0x43ad64);}return null;};}function patchUpdates(_0x14c15f){return function(_0x1d6b7a){try{jsonpatch['apply'](_0x1d6b7a,_0x14c15f,!![]);}catch(_0x497e99){return BPromise[_0xdb7e('0x25')](_0x497e99);}return _0x1d6b7a[_0xdb7e('0x26')]();};}function saveUpdates(_0x98cad,_0x552d40){return function(_0x181546){if(_0x181546){return _0x181546[_0xdb7e('0x27')](_0x98cad)[_0xdb7e('0x28')](function(_0x3e08c0){return _0x3e08c0;});}return null;};}function removeEntity(_0x12e8b6,_0x5d7d6b){return function(_0x9af251){if(_0x9af251){return _0x9af251[_0xdb7e('0x29')]()[_0xdb7e('0x28')](function(){var _0x54dca8=_0x9af251[_0xdb7e('0x2a')]({'plain':!![]});var _0x129b18=_0xdb7e('0x2b');return db[_0xdb7e('0x2c')]['destroy']({'where':{'type':_0x129b18,'resourceId':_0x54dca8['id']}})[_0xdb7e('0x28')](function(){return _0x9af251;});})[_0xdb7e('0x28')](function(){_0x12e8b6[_0xdb7e('0x1c')](0xcc)[_0xdb7e('0x1d')]();});}};}function handleEntityNotFound(_0x1995a3,_0x315032){return function(_0x86671d){if(!_0x86671d){_0x1995a3['sendStatus'](0x194);}return _0x86671d;};}function handleError(_0x3a3f93,_0x130f42){_0x130f42=_0x130f42||0x1f4;return function(_0x24526b){logger[_0xdb7e('0x2d')](_0x24526b[_0xdb7e('0x2e')]);if(_0x24526b[_0xdb7e('0x2f')]){delete _0x24526b[_0xdb7e('0x2f')];}_0x3a3f93[_0xdb7e('0x1c')](_0x130f42)[_0xdb7e('0x30')](_0x24526b);};}exports[_0xdb7e('0x31')]=function(_0x471da9,_0x4bdb2b){var _0x30f0f4={},_0x52a52f={},_0x550cb8={'count':0x0,'rows':[]};var _0x228b06=_[_0xdb7e('0x32')](db[_0xdb7e('0x33')][_0xdb7e('0x34')],function(_0x1d1bf0){return{'name':_0x1d1bf0[_0xdb7e('0x35')],'type':_0x1d1bf0['type'][_0xdb7e('0x36')]};});_0x52a52f[_0xdb7e('0x37')]=_[_0xdb7e('0x32')](_0x228b06,'name');_0x52a52f['query']=_[_0xdb7e('0x38')](_0x471da9['query']);_0x52a52f['filters']=_[_0xdb7e('0x39')](_0x52a52f[_0xdb7e('0x37')],_0x52a52f[_0xdb7e('0x3a')]);_0x30f0f4[_0xdb7e('0x3b')]=_[_0xdb7e('0x39')](_0x52a52f[_0xdb7e('0x37')],qs['fields'](_0x471da9[_0xdb7e('0x3a')][_0xdb7e('0x3c')]));_0x30f0f4['attributes']=_0x30f0f4[_0xdb7e('0x3b')][_0xdb7e('0x3d')]?_0x30f0f4[_0xdb7e('0x3b')]:_0x52a52f[_0xdb7e('0x37')];if(!_0x471da9[_0xdb7e('0x3a')][_0xdb7e('0x3e')]('nolimit')){_0x30f0f4[_0xdb7e('0x1f')]=qs['limit'](_0x471da9[_0xdb7e('0x3a')]['limit']);_0x30f0f4['offset']=qs[_0xdb7e('0x22')](_0x471da9['query'][_0xdb7e('0x22')]);}_0x30f0f4['order']=qs[_0xdb7e('0x3f')](_0x471da9[_0xdb7e('0x3a')]['sort']);_0x30f0f4[_0xdb7e('0x40')]=qs[_0xdb7e('0x41')](_['pick'](_0x471da9[_0xdb7e('0x3a')],_0x52a52f['filters']),_0x228b06);if(_0x471da9['query']['filter']){_0x30f0f4[_0xdb7e('0x40')]=_['merge'](_0x30f0f4[_0xdb7e('0x40')],{'$or':_[_0xdb7e('0x32')](_0x228b06,function(_0x263b01){if(_0x263b01[_0xdb7e('0x42')]!==_0xdb7e('0x43')){var _0x1b81ec={};_0x1b81ec[_0x263b01[_0xdb7e('0x2f')]]={'$like':'%'+_0x471da9[_0xdb7e('0x3a')][_0xdb7e('0x44')]+'%'};return _0x1b81ec;}})});}_0x30f0f4=_['merge']({},_0x30f0f4,_0x471da9[_0xdb7e('0x45')]);var _0xf5a684={'where':_0x30f0f4[_0xdb7e('0x40')]};return db[_0xdb7e('0x33')][_0xdb7e('0x21')](_0xf5a684)[_0xdb7e('0x28')](function(_0x50973b){_0x550cb8[_0xdb7e('0x21')]=_0x50973b;if(_0x471da9[_0xdb7e('0x3a')][_0xdb7e('0x46')]){_0x30f0f4[_0xdb7e('0x47')]=[{'all':!![]}];}return db['Interval'][_0xdb7e('0x48')](_0x30f0f4);})['then'](function(_0xe0336d){_0x550cb8['rows']=_0xe0336d;return _0x550cb8;})['then'](respondWithFilteredResult(_0x4bdb2b,_0x30f0f4))[_0xdb7e('0x49')](handleError(_0x4bdb2b,null));};exports[_0xdb7e('0x4a')]=function(_0x2bad33,_0xd6a5fc){var _0x55c371={'raw':!![],'where':{'id':_0x2bad33[_0xdb7e('0x4b')]['id']}},_0x1dbf86={};_0x1dbf86[_0xdb7e('0x37')]=_['keys'](db['Interval'][_0xdb7e('0x34')]);_0x1dbf86[_0xdb7e('0x3a')]=_[_0xdb7e('0x38')](_0x2bad33[_0xdb7e('0x3a')]);_0x1dbf86['filters']=_[_0xdb7e('0x39')](_0x1dbf86[_0xdb7e('0x37')],_0x1dbf86[_0xdb7e('0x3a')]);_0x55c371[_0xdb7e('0x3b')]=_[_0xdb7e('0x39')](_0x1dbf86['model'],qs[_0xdb7e('0x3c')](_0x2bad33['query'][_0xdb7e('0x3c')]));_0x55c371['attributes']=_0x55c371['attributes']['length']?_0x55c371['attributes']:_0x1dbf86[_0xdb7e('0x37')];if(_0x2bad33['query'][_0xdb7e('0x46')]){_0x55c371['include']=[{'all':!![]}];}_0x55c371=_['merge']({},_0x55c371,_0x2bad33[_0xdb7e('0x45')]);return db[_0xdb7e('0x33')][_0xdb7e('0x4c')](_0x55c371)[_0xdb7e('0x28')](handleEntityNotFound(_0xd6a5fc,null))[_0xdb7e('0x28')](respondWithResult(_0xd6a5fc,null))['catch'](handleError(_0xd6a5fc,null));};exports[_0xdb7e('0x4d')]=function(_0x141490,_0x26aa18){return db[_0xdb7e('0x33')][_0xdb7e('0x4d')](_0x141490[_0xdb7e('0x4e')],{})[_0xdb7e('0x28')](function(_0x34bc72){var _0x31f716=_0x141490['user'][_0xdb7e('0x2a')]({'plain':!![]});if(!_0x31f716)throw new Error(_0xdb7e('0x4f'));if(_0x31f716['role']===_0xdb7e('0x50')){var _0x2b14aa=_0x34bc72[_0xdb7e('0x2a')]({'plain':!![]});var _0x173102='Intervals';return db['UserProfileSection'][_0xdb7e('0x4c')]({'where':{'name':_0x173102,'userProfileId':_0x31f716[_0xdb7e('0x51')]},'raw':!![]})['then'](function(_0x2379d6){if(_0x2379d6&&_0x2379d6[_0xdb7e('0x52')]===0x0){return db[_0xdb7e('0x2c')][_0xdb7e('0x4d')]({'name':_0x2b14aa[_0xdb7e('0x2f')],'resourceId':_0x2b14aa['id'],'type':_0x2379d6[_0xdb7e('0x2f')],'sectionId':_0x2379d6['id']},{})[_0xdb7e('0x28')](function(){return _0x34bc72;});}else{return _0x34bc72;}})['catch'](function(_0x591334){logger[_0xdb7e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x591334);throw _0x591334;});}return _0x34bc72;})['then'](respondWithResult(_0x26aa18,0xc9))['catch'](handleError(_0x26aa18,null));};exports['update']=function(_0x17e77a,_0x5068cd){if(_0x17e77a[_0xdb7e('0x4e')]['id']){delete _0x17e77a[_0xdb7e('0x4e')]['id'];}return db['Interval'][_0xdb7e('0x4c')]({'where':{'id':_0x17e77a[_0xdb7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5068cd,null))[_0xdb7e('0x28')](saveUpdates(_0x17e77a['body'],null))['then'](respondWithResult(_0x5068cd,null))[_0xdb7e('0x49')](handleError(_0x5068cd,null));};exports[_0xdb7e('0x29')]=function(_0x58feef,_0x283398){return db[_0xdb7e('0x33')][_0xdb7e('0x4c')]({'where':{'id':_0x58feef[_0xdb7e('0x4b')]['id']}})[_0xdb7e('0x28')](handleEntityNotFound(_0x283398,null))['then'](removeEntity(_0x283398,null))['catch'](handleError(_0x283398,null));};exports[_0xdb7e('0x53')]=function(_0x9537e3,_0x2e1486,_0x38cfb0){if(_0x9537e3[_0xdb7e('0x4e')]['id']){delete _0x9537e3[_0xdb7e('0x4e')]['id'];}return db[_0xdb7e('0x33')][_0xdb7e('0x4c')]({'where':{'id':_0x9537e3['params']['id']}})[_0xdb7e('0x28')](handleEntityNotFound(_0x2e1486,null))[_0xdb7e('0x28')](function(_0x429bf1){if(_0x429bf1){_0x9537e3['body'][_0xdb7e('0x54')]=_0x429bf1['id'];return db[_0xdb7e('0x33')][_0xdb7e('0x4d')](_0x9537e3[_0xdb7e('0x4e')]);}})['then'](respondWithResult(_0x2e1486,null))[_0xdb7e('0x49')](handleError(_0x2e1486,null));};exports[_0xdb7e('0x55')]=function(_0x206e99,_0x30c6cb,_0x268f6c){var _0x462039={};var _0x1ef6ef={};var _0x4b09e3;var _0x32c081;return db[_0xdb7e('0x33')][_0xdb7e('0x56')]({'where':{'id':_0x206e99['params']['id']}})[_0xdb7e('0x28')](handleEntityNotFound(_0x30c6cb,null))['then'](function(_0x42deba){if(_0x42deba){_0x4b09e3=_0x42deba;_0x1ef6ef[_0xdb7e('0x37')]=_[_0xdb7e('0x38')](db['Interval'][_0xdb7e('0x34')]);_0x1ef6ef[_0xdb7e('0x3a')]=_[_0xdb7e('0x38')](_0x206e99[_0xdb7e('0x3a')]);_0x1ef6ef[_0xdb7e('0x41')]=_[_0xdb7e('0x39')](_0x1ef6ef[_0xdb7e('0x37')],_0x1ef6ef[_0xdb7e('0x3a')]);_0x462039[_0xdb7e('0x3b')]=_[_0xdb7e('0x39')](_0x1ef6ef[_0xdb7e('0x37')],qs[_0xdb7e('0x3c')](_0x206e99[_0xdb7e('0x3a')][_0xdb7e('0x3c')]));_0x462039['attributes']=_0x462039[_0xdb7e('0x3b')]['length']?_0x462039[_0xdb7e('0x3b')]:_0x1ef6ef[_0xdb7e('0x37')];_0x462039[_0xdb7e('0x57')]=qs[_0xdb7e('0x3f')](_0x206e99[_0xdb7e('0x3a')]['sort']);_0x462039['where']=qs[_0xdb7e('0x41')](_[_0xdb7e('0x58')](_0x206e99[_0xdb7e('0x3a')],_0x1ef6ef['filters']));if(_0x206e99['query']['filter']){_0x462039[_0xdb7e('0x40')]=_['merge'](_0x462039[_0xdb7e('0x40')],{'$or':_[_0xdb7e('0x32')](_0x462039[_0xdb7e('0x3b')],function(_0x4f51d7){var _0x549e8b={};_0x549e8b[_0x4f51d7]={'$like':'%'+_0x206e99['query'][_0xdb7e('0x44')]+'%'};return _0x549e8b;})});}_0x462039=_[_0xdb7e('0x59')]({},_0x462039,_0x206e99[_0xdb7e('0x45')]);return _0x4b09e3[_0xdb7e('0x55')](_0x462039);}})[_0xdb7e('0x28')](function(_0x4cae36){if(_0x4cae36){_0x32c081=_0x4cae36[_0xdb7e('0x3d')];if(!_0x206e99[_0xdb7e('0x3a')][_0xdb7e('0x3e')]('nolimit')){_0x462039[_0xdb7e('0x1f')]=qs['limit'](_0x206e99[_0xdb7e('0x3a')]['limit']);_0x462039[_0xdb7e('0x22')]=qs[_0xdb7e('0x22')](_0x206e99['query'][_0xdb7e('0x22')]);}return _0x4b09e3['getIntervals'](_0x462039);}})['then'](function(_0x293ee3){if(_0x293ee3){return _0x293ee3?{'count':_0x32c081,'rows':_0x293ee3}:null;}})['then'](respondWithResult(_0x30c6cb,null))[_0xdb7e('0x49')](handleError(_0x30c6cb,null));};exports[_0xdb7e('0x5a')]=function(_0x4d58ae,_0x504c1d,_0x416316){return db[_0xdb7e('0x33')][_0xdb7e('0x56')]({'where':{'id':_0x4d58ae['params']['id']}})[_0xdb7e('0x28')](handleEntityNotFound(_0x504c1d,null))[_0xdb7e('0x28')](function(_0x469781){if(_0x469781){return db['sequelize'][_0xdb7e('0x5b')](function(_0x1a34af){return db[_0xdb7e('0x33')][_0xdb7e('0x29')]({'where':{'IntervalId':_0x4d58ae['params']['id']},'transaction':_0x1a34af})[_0xdb7e('0x28')](function(_0x45f475){var _0x12de46=_[_0xdb7e('0x32')](_0x4d58ae[_0xdb7e('0x4e')],function(_0x278303){delete _0x278303['id'];_0x278303[_0xdb7e('0x54')]=_0x4d58ae[_0xdb7e('0x4b')]['id'];return _0x278303;});return db[_0xdb7e('0x33')][_0xdb7e('0x5c')](_0x12de46,{'transaction':_0x1a34af});});})[_0xdb7e('0x28')](function(){return db[_0xdb7e('0x33')][_0xdb7e('0x48')]({'where':{'IntervalId':_0x4d58ae[_0xdb7e('0x4b')]['id']}});});}})[_0xdb7e('0x28')](respondWithResult(_0x504c1d,null))['catch'](handleError(_0x504c1d,null));}; \ No newline at end of file +var _0x807c=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Intervals','sendStatus','error','stack','name','send','index','Interval','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','addInterval','IntervalId','getIntervals','findOne','pick','addIntervals','sequelize','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x45c34b,_0xe6c9ec){var _0x1c914a=function(_0x3167eb){while(--_0x3167eb){_0x45c34b['push'](_0x45c34b['shift']());}};_0x1c914a(++_0xe6c9ec);}(_0x807c,0x170));var _0xc807=function(_0x5b035f,_0x2d6591){_0x5b035f=_0x5b035f-0x0;var _0x4634b8=_0x807c[_0x5b035f];return _0x4634b8;};'use strict';var emlformat=require(_0xc807('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc807('0x1'));var jsonpatch=require(_0xc807('0x2'));var rp=require('request-promise');var moment=require(_0xc807('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc807('0x4'));var util=require(_0xc807('0x5'));var path=require(_0xc807('0x6'));var sox=require(_0xc807('0x7'));var csv=require(_0xc807('0x8'));var ejs=require(_0xc807('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc807('0xa'));var squel=require(_0xc807('0xb'));var crypto=require(_0xc807('0xc'));var jsforce=require(_0xc807('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc807('0x8'));var querystring=require(_0xc807('0xe'));var Papa=require(_0xc807('0xf'));var Redis=require(_0xc807('0x10'));var authService=require(_0xc807('0x11'));var qs=require(_0xc807('0x12'));var as=require(_0xc807('0x13'));var hardwareService=require(_0xc807('0x14'));var logger=require(_0xc807('0x15'))(_0xc807('0x16'));var utils=require(_0xc807('0x17'));var config=require(_0xc807('0x18'));var licenseUtil=require(_0xc807('0x19'));var db=require(_0xc807('0x1a'))['db'];var extensions=require(_0xc807('0x1b'));function respondWithStatusCode(_0x8cdfe3,_0x35ce60){_0x35ce60=_0x35ce60||0xcc;return function(_0x144677){if(_0x144677){return _0x8cdfe3['sendStatus'](_0x35ce60);}return _0x8cdfe3[_0xc807('0x1c')](_0x35ce60)[_0xc807('0x1d')]();};}function respondWithResult(_0x1140b8,_0x3a6a11){_0x3a6a11=_0x3a6a11||0xc8;return function(_0x27c88a){if(_0x27c88a){return _0x1140b8[_0xc807('0x1c')](_0x3a6a11)[_0xc807('0x1e')](_0x27c88a);}};}function respondWithFilteredResult(_0x1383e5,_0x2a3567){return function(_0x4ba815){if(_0x4ba815){var _0x1b5435=typeof _0x2a3567[_0xc807('0x1f')]===_0xc807('0x20')&&typeof _0x2a3567[_0xc807('0x21')]===_0xc807('0x20');var _0x476b61=_0x4ba815[_0xc807('0x22')];var _0x2f12a7=_0x1b5435?0x0:_0x2a3567[_0xc807('0x1f')];var _0x107846=_0x1b5435?_0x4ba815[_0xc807('0x22')]:_0x2a3567[_0xc807('0x1f')]+_0x2a3567['limit'];var _0x136d8e;if(_0x107846>=_0x476b61){_0x107846=_0x476b61;_0x136d8e=0xc8;}else{_0x136d8e=0xce;}_0x1383e5[_0xc807('0x1c')](_0x136d8e);return _0x1383e5[_0xc807('0x23')](_0xc807('0x24'),_0x2f12a7+'-'+_0x107846+'/'+_0x476b61)['json'](_0x4ba815);}return null;};}function patchUpdates(_0x4e6f93){return function(_0x58a13f){try{jsonpatch[_0xc807('0x25')](_0x58a13f,_0x4e6f93,!![]);}catch(_0x4632dc){return BPromise[_0xc807('0x26')](_0x4632dc);}return _0x58a13f[_0xc807('0x27')]();};}function saveUpdates(_0x490d61,_0x5d15b9){return function(_0x3ac41c){if(_0x3ac41c){return _0x3ac41c['update'](_0x490d61)[_0xc807('0x28')](function(_0x232315){return _0x232315;});}return null;};}function removeEntity(_0x121b2d,_0x18a336){return function(_0xe97f3e){if(_0xe97f3e){return _0xe97f3e[_0xc807('0x29')]()[_0xc807('0x28')](function(){var _0x3117be=_0xe97f3e[_0xc807('0x2a')]({'plain':!![]});var _0x3d4960=_0xc807('0x2b');return db['UserProfileResource'][_0xc807('0x29')]({'where':{'type':_0x3d4960,'resourceId':_0x3117be['id']}})['then'](function(){return _0xe97f3e;});})[_0xc807('0x28')](function(){_0x121b2d[_0xc807('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2047e0,_0x5bfa7b){return function(_0x4e867e){if(!_0x4e867e){_0x2047e0[_0xc807('0x2c')](0x194);}return _0x4e867e;};}function handleError(_0x49e2c9,_0x3b8c71){_0x3b8c71=_0x3b8c71||0x1f4;return function(_0x2229a2){logger[_0xc807('0x2d')](_0x2229a2[_0xc807('0x2e')]);if(_0x2229a2[_0xc807('0x2f')]){delete _0x2229a2[_0xc807('0x2f')];}_0x49e2c9[_0xc807('0x1c')](_0x3b8c71)[_0xc807('0x30')](_0x2229a2);};}exports[_0xc807('0x31')]=function(_0x3adf9f,_0x170bda){var _0x37dd8b={},_0x165013={},_0x4c2aab={'count':0x0,'rows':[]};var _0x1f882f=_['map'](db[_0xc807('0x32')][_0xc807('0x33')],function(_0x214b34){return{'name':_0x214b34['fieldName'],'type':_0x214b34[_0xc807('0x34')][_0xc807('0x35')]};});_0x165013['model']=_[_0xc807('0x36')](_0x1f882f,_0xc807('0x2f'));_0x165013[_0xc807('0x37')]=_[_0xc807('0x38')](_0x3adf9f[_0xc807('0x37')]);_0x165013[_0xc807('0x39')]=_[_0xc807('0x3a')](_0x165013['model'],_0x165013[_0xc807('0x37')]);_0x37dd8b[_0xc807('0x3b')]=_[_0xc807('0x3a')](_0x165013[_0xc807('0x3c')],qs[_0xc807('0x3d')](_0x3adf9f[_0xc807('0x37')][_0xc807('0x3d')]));_0x37dd8b[_0xc807('0x3b')]=_0x37dd8b[_0xc807('0x3b')][_0xc807('0x3e')]?_0x37dd8b[_0xc807('0x3b')]:_0x165013[_0xc807('0x3c')];if(!_0x3adf9f[_0xc807('0x37')][_0xc807('0x3f')](_0xc807('0x40'))){_0x37dd8b[_0xc807('0x21')]=qs[_0xc807('0x21')](_0x3adf9f[_0xc807('0x37')][_0xc807('0x21')]);_0x37dd8b['offset']=qs[_0xc807('0x1f')](_0x3adf9f['query'][_0xc807('0x1f')]);}_0x37dd8b[_0xc807('0x41')]=qs[_0xc807('0x42')](_0x3adf9f[_0xc807('0x37')][_0xc807('0x42')]);_0x37dd8b[_0xc807('0x43')]=qs[_0xc807('0x39')](_['pick'](_0x3adf9f[_0xc807('0x37')],_0x165013[_0xc807('0x39')]),_0x1f882f);if(_0x3adf9f[_0xc807('0x37')][_0xc807('0x44')]){_0x37dd8b['where']=_[_0xc807('0x45')](_0x37dd8b[_0xc807('0x43')],{'$or':_['map'](_0x1f882f,function(_0x34a55f){if(_0x34a55f[_0xc807('0x34')]!==_0xc807('0x46')){var _0x370f23={};_0x370f23[_0x34a55f['name']]={'$like':'%'+_0x3adf9f[_0xc807('0x37')][_0xc807('0x44')]+'%'};return _0x370f23;}})});}_0x37dd8b=_[_0xc807('0x45')]({},_0x37dd8b,_0x3adf9f[_0xc807('0x47')]);var _0x36773d={'where':_0x37dd8b[_0xc807('0x43')]};return db['Interval'][_0xc807('0x22')](_0x36773d)[_0xc807('0x28')](function(_0xdc0c90){_0x4c2aab['count']=_0xdc0c90;if(_0x3adf9f[_0xc807('0x37')][_0xc807('0x48')]){_0x37dd8b['include']=[{'all':!![]}];}return db[_0xc807('0x32')][_0xc807('0x49')](_0x37dd8b);})['then'](function(_0x25b794){_0x4c2aab[_0xc807('0x4a')]=_0x25b794;return _0x4c2aab;})[_0xc807('0x28')](respondWithFilteredResult(_0x170bda,_0x37dd8b))['catch'](handleError(_0x170bda,null));};exports[_0xc807('0x4b')]=function(_0x1c1a41,_0x56e61b){var _0xa0a0={'raw':!![],'where':{'id':_0x1c1a41['params']['id']}},_0x14ea35={};_0x14ea35[_0xc807('0x3c')]=_['keys'](db[_0xc807('0x32')][_0xc807('0x33')]);_0x14ea35[_0xc807('0x37')]=_[_0xc807('0x38')](_0x1c1a41[_0xc807('0x37')]);_0x14ea35[_0xc807('0x39')]=_[_0xc807('0x3a')](_0x14ea35[_0xc807('0x3c')],_0x14ea35[_0xc807('0x37')]);_0xa0a0['attributes']=_[_0xc807('0x3a')](_0x14ea35[_0xc807('0x3c')],qs[_0xc807('0x3d')](_0x1c1a41[_0xc807('0x37')][_0xc807('0x3d')]));_0xa0a0[_0xc807('0x3b')]=_0xa0a0[_0xc807('0x3b')]['length']?_0xa0a0[_0xc807('0x3b')]:_0x14ea35[_0xc807('0x3c')];if(_0x1c1a41[_0xc807('0x37')][_0xc807('0x48')]){_0xa0a0[_0xc807('0x4c')]=[{'all':!![]}];}_0xa0a0=_[_0xc807('0x45')]({},_0xa0a0,_0x1c1a41[_0xc807('0x47')]);return db[_0xc807('0x32')][_0xc807('0x4d')](_0xa0a0)[_0xc807('0x28')](handleEntityNotFound(_0x56e61b,null))[_0xc807('0x28')](respondWithResult(_0x56e61b,null))[_0xc807('0x4e')](handleError(_0x56e61b,null));};exports['create']=function(_0x14c968,_0x49cb00){return db[_0xc807('0x32')][_0xc807('0x4f')](_0x14c968[_0xc807('0x50')],{})[_0xc807('0x28')](function(_0x3bc152){var _0x5d0117=_0x14c968[_0xc807('0x51')][_0xc807('0x2a')]({'plain':!![]});if(!_0x5d0117)throw new Error(_0xc807('0x52'));if(_0x5d0117[_0xc807('0x53')]===_0xc807('0x51')){var _0x1bd4e6=_0x3bc152['get']({'plain':!![]});var _0x4e5f10=_0xc807('0x2b');return db[_0xc807('0x54')][_0xc807('0x4d')]({'where':{'name':_0x4e5f10,'userProfileId':_0x5d0117[_0xc807('0x55')]},'raw':!![]})[_0xc807('0x28')](function(_0x2e859d){if(_0x2e859d&&_0x2e859d[_0xc807('0x56')]===0x0){return db['UserProfileResource'][_0xc807('0x4f')]({'name':_0x1bd4e6['name'],'resourceId':_0x1bd4e6['id'],'type':_0x2e859d[_0xc807('0x2f')],'sectionId':_0x2e859d['id']},{})[_0xc807('0x28')](function(){return _0x3bc152;});}else{return _0x3bc152;}})[_0xc807('0x4e')](function(_0x559f1a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559f1a);throw _0x559f1a;});}return _0x3bc152;})[_0xc807('0x28')](respondWithResult(_0x49cb00,0xc9))[_0xc807('0x4e')](handleError(_0x49cb00,null));};exports['update']=function(_0x3e795d,_0x3b7459){if(_0x3e795d[_0xc807('0x50')]['id']){delete _0x3e795d[_0xc807('0x50')]['id'];}return db[_0xc807('0x32')][_0xc807('0x4d')]({'where':{'id':_0x3e795d[_0xc807('0x57')]['id']}})['then'](handleEntityNotFound(_0x3b7459,null))['then'](saveUpdates(_0x3e795d[_0xc807('0x50')],null))['then'](respondWithResult(_0x3b7459,null))['catch'](handleError(_0x3b7459,null));};exports[_0xc807('0x29')]=function(_0x3d0837,_0x4880c6){return db['Interval'][_0xc807('0x4d')]({'where':{'id':_0x3d0837['params']['id']}})[_0xc807('0x28')](handleEntityNotFound(_0x4880c6,null))[_0xc807('0x28')](removeEntity(_0x4880c6,null))[_0xc807('0x4e')](handleError(_0x4880c6,null));};exports[_0xc807('0x58')]=function(_0x2696dd,_0x58e12f,_0x1bf921){if(_0x2696dd[_0xc807('0x50')]['id']){delete _0x2696dd[_0xc807('0x50')]['id'];}return db[_0xc807('0x32')][_0xc807('0x4d')]({'where':{'id':_0x2696dd[_0xc807('0x57')]['id']}})[_0xc807('0x28')](handleEntityNotFound(_0x58e12f,null))[_0xc807('0x28')](function(_0x4c2066){if(_0x4c2066){_0x2696dd[_0xc807('0x50')][_0xc807('0x59')]=_0x4c2066['id'];return db[_0xc807('0x32')]['create'](_0x2696dd[_0xc807('0x50')]);}})[_0xc807('0x28')](respondWithResult(_0x58e12f,null))[_0xc807('0x4e')](handleError(_0x58e12f,null));};exports[_0xc807('0x5a')]=function(_0x3ddc1b,_0x288811,_0x52b85e){var _0x5bfc48={};var _0x40b7b2={};var _0x47543b;var _0x4f8f01;return db[_0xc807('0x32')][_0xc807('0x5b')]({'where':{'id':_0x3ddc1b[_0xc807('0x57')]['id']}})[_0xc807('0x28')](handleEntityNotFound(_0x288811,null))['then'](function(_0x353d54){if(_0x353d54){_0x47543b=_0x353d54;_0x40b7b2['model']=_[_0xc807('0x38')](db[_0xc807('0x32')][_0xc807('0x33')]);_0x40b7b2[_0xc807('0x37')]=_['keys'](_0x3ddc1b[_0xc807('0x37')]);_0x40b7b2[_0xc807('0x39')]=_['intersection'](_0x40b7b2[_0xc807('0x3c')],_0x40b7b2[_0xc807('0x37')]);_0x5bfc48[_0xc807('0x3b')]=_['intersection'](_0x40b7b2[_0xc807('0x3c')],qs[_0xc807('0x3d')](_0x3ddc1b['query'][_0xc807('0x3d')]));_0x5bfc48['attributes']=_0x5bfc48['attributes']['length']?_0x5bfc48['attributes']:_0x40b7b2[_0xc807('0x3c')];_0x5bfc48[_0xc807('0x41')]=qs[_0xc807('0x42')](_0x3ddc1b['query'][_0xc807('0x42')]);_0x5bfc48['where']=qs[_0xc807('0x39')](_[_0xc807('0x5c')](_0x3ddc1b['query'],_0x40b7b2['filters']));if(_0x3ddc1b[_0xc807('0x37')][_0xc807('0x44')]){_0x5bfc48[_0xc807('0x43')]=_['merge'](_0x5bfc48[_0xc807('0x43')],{'$or':_[_0xc807('0x36')](_0x5bfc48[_0xc807('0x3b')],function(_0x479259){var _0x49c8c9={};_0x49c8c9[_0x479259]={'$like':'%'+_0x3ddc1b[_0xc807('0x37')][_0xc807('0x44')]+'%'};return _0x49c8c9;})});}_0x5bfc48=_[_0xc807('0x45')]({},_0x5bfc48,_0x3ddc1b[_0xc807('0x47')]);return _0x47543b[_0xc807('0x5a')](_0x5bfc48);}})[_0xc807('0x28')](function(_0x243b18){if(_0x243b18){_0x4f8f01=_0x243b18['length'];if(!_0x3ddc1b[_0xc807('0x37')][_0xc807('0x3f')](_0xc807('0x40'))){_0x5bfc48[_0xc807('0x21')]=qs[_0xc807('0x21')](_0x3ddc1b[_0xc807('0x37')][_0xc807('0x21')]);_0x5bfc48[_0xc807('0x1f')]=qs[_0xc807('0x1f')](_0x3ddc1b['query'][_0xc807('0x1f')]);}return _0x47543b[_0xc807('0x5a')](_0x5bfc48);}})['then'](function(_0x2d8258){if(_0x2d8258){return _0x2d8258?{'count':_0x4f8f01,'rows':_0x2d8258}:null;}})[_0xc807('0x28')](respondWithResult(_0x288811,null))[_0xc807('0x4e')](handleError(_0x288811,null));};exports[_0xc807('0x5d')]=function(_0x47df49,_0x2d5794,_0x3fbcb9){return db[_0xc807('0x32')]['findOne']({'where':{'id':_0x47df49['params']['id']}})[_0xc807('0x28')](handleEntityNotFound(_0x2d5794,null))['then'](function(_0x3defda){if(_0x3defda){return db[_0xc807('0x5e')]['transaction'](function(_0x1f6442){return db[_0xc807('0x32')][_0xc807('0x29')]({'where':{'IntervalId':_0x47df49[_0xc807('0x57')]['id']},'transaction':_0x1f6442})[_0xc807('0x28')](function(_0x3df8f7){var _0x343b23=_['map'](_0x47df49[_0xc807('0x50')],function(_0x5f3f12){delete _0x5f3f12['id'];_0x5f3f12['IntervalId']=_0x47df49[_0xc807('0x57')]['id'];return _0x5f3f12;});return db['Interval'][_0xc807('0x5f')](_0x343b23,{'transaction':_0x1f6442});});})[_0xc807('0x28')](function(){return db[_0xc807('0x32')][_0xc807('0x49')]({'where':{'IntervalId':_0x47df49['params']['id']}});});}})[_0xc807('0x28')](respondWithResult(_0x2d5794,null))['catch'](handleError(_0x2d5794,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 425e9e4..f50507b 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 _0x9dc7=['all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','Interval','tools_intervals','rewrite','string','interval','getIntervals','then'];(function(_0x42d142,_0x309e7d){var _0x39b768=function(_0x4d9163){while(--_0x4d9163){_0x42d142['push'](_0x42d142['shift']());}};_0x39b768(++_0x309e7d);}(_0x9dc7,0x144));var _0x79dc=function(_0x4d85c1,_0xc446d5){_0x4d85c1=_0x4d85c1-0x0;var _0x53a425=_0x9dc7[_0x4d85c1];return _0x53a425;};'use strict';var attributes=require(_0x79dc('0x0'));var extensions=require(_0x79dc('0x1'));var iftime=require(_0x79dc('0x2'))[_0x79dc('0x3')];module[_0x79dc('0x4')]=function(_0xc33fd0){return _0xc33fd0['define'](_0x79dc('0x5'),attributes,{'tableName':_0x79dc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49ee85){extensions['rewrite'](_0xc33fd0,_0x49ee85);},'afterBulkCreate':function(_0x2b4332,_0x206d74,_0x74b8af){_0x74b8af();extensions[_0x79dc('0x7')](_0xc33fd0,_0x2b4332[0x0]);},'afterUpdate':function(_0xa9d964){extensions[_0x79dc('0x7')](_0xc33fd0,_0xa9d964);},'afterDestroy':function(_0x257cb0){extensions['rewrite'](_0xc33fd0,_0x257cb0);}},'instanceMethods':{'ifTime':function(_0x35df01=undefined,_0x211e2a=new Date()){if(typeof this['interval']===_0x79dc('0x8')){return iftime(this[_0x79dc('0x9')],_0x35df01,_0x211e2a);}else{return this[_0x79dc('0xa')]()[_0x79dc('0xb')](function(_0x131c16){return Promise[_0x79dc('0xc')](_0x131c16[_0x79dc('0xd')](function(_0x3b8d06){return _0x3b8d06[_0x79dc('0xe')](_0x35df01,_0x211e2a);}));})[_0x79dc('0xb')](function(_0xc32957){return _0xc32957[_0x79dc('0xf')](function(_0x26e441,_0x4973f5){return _0x26e441||_0x4973f5;},![]);});}}}});}; \ No newline at end of file +var _0x1309=['then','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','all','map','ifTime'];(function(_0x226251,_0x8bf103){var _0x217c24=function(_0x7f8e0f){while(--_0x7f8e0f){_0x226251['push'](_0x226251['shift']());}};_0x217c24(++_0x8bf103);}(_0x1309,0x172));var _0x9130=function(_0x96e224,_0x111076){_0x96e224=_0x96e224-0x0;var _0x79a9c9=_0x1309[_0x96e224];return _0x79a9c9;};'use strict';var attributes=require(_0x9130('0x0'));var extensions=require(_0x9130('0x1'));var iftime=require(_0x9130('0x2'))['iftime'];module[_0x9130('0x3')]=function(_0x55ad59){return _0x55ad59[_0x9130('0x4')](_0x9130('0x5'),attributes,{'tableName':_0x9130('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f7143){extensions['rewrite'](_0x55ad59,_0x3f7143);},'afterBulkCreate':function(_0x1ab990,_0x36791d,_0x5495f1){_0x5495f1();extensions[_0x9130('0x7')](_0x55ad59,_0x1ab990[0x0]);},'afterUpdate':function(_0x56586c){extensions['rewrite'](_0x55ad59,_0x56586c);},'afterDestroy':function(_0x2825b3){extensions[_0x9130('0x7')](_0x55ad59,_0x2825b3);}},'instanceMethods':{'ifTime':function(_0xeaeb0a=undefined,_0x35121a=new Date()){if(typeof this[_0x9130('0x8')]===_0x9130('0x9')){return iftime(this[_0x9130('0x8')],_0xeaeb0a,_0x35121a);}else{return this[_0x9130('0xa')]()['then'](function(_0x9fe096){return Promise[_0x9130('0xb')](_0x9fe096[_0x9130('0xc')](function(_0x30b25a){return _0x30b25a[_0x9130('0xd')](_0xeaeb0a,_0x35121a);}));})[_0x9130('0xe')](function(_0x27d9fe){return _0x27d9fe[_0x9130('0xf')](function(_0x2df63e,_0x77e4a4){return _0x2df63e||_0x77e4a4;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index efecb8f..7f123d5 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 _0x8df6=['then','info','GetInterval','debug','stringify','catch','error','message','ShowInterval','all','ifTime','reduce','format','join','findById','name','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','util','../../mysqldb','iftime','rpc','Interval','findAll','options','where','limit','include','map','attributes','model'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x8df6,0x13a));var _0x68df=function(_0x381a2f,_0xbc6bdc){_0x381a2f=_0x381a2f-0x0;var _0x5cc98b=_0x8df6[_0x381a2f];return _0x5cc98b;};'use strict';var _=require(_0x68df('0x0'));var util=require(_0x68df('0x1'));var db=require(_0x68df('0x2'))['db'];var iftime=require('../../utils/iftime')[_0x68df('0x3')];var logger=require('../../config/logger')(_0x68df('0x4'));exports['GetInterval']=function(_0x4c5fe9){var _0x5827a5=this;return new Promise(function(_0x380445,_0x467fb2){return db[_0x68df('0x5')][_0x68df('0x6')]({'raw':_0x4c5fe9[_0x68df('0x7')]?_0x4c5fe9[_0x68df('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x4c5fe9[_0x68df('0x7')]?_0x4c5fe9['options'][_0x68df('0x8')]||null:null,'attributes':_0x4c5fe9['options']?_0x4c5fe9[_0x68df('0x7')]['attributes']||null:null,'limit':_0x4c5fe9[_0x68df('0x7')]?_0x4c5fe9[_0x68df('0x7')][_0x68df('0x9')]||null:null,'include':_0x4c5fe9[_0x68df('0x7')]?_0x4c5fe9['options'][_0x68df('0xa')]?_[_0x68df('0xb')](_0x4c5fe9[_0x68df('0x7')][_0x68df('0xa')],function(_0x42923c){return{'model':db[_0x42923c['model']],'as':_0x42923c['as'],'attributes':_0x42923c[_0x68df('0xc')],'include':_0x42923c[_0x68df('0xa')]?_['map'](_0x42923c[_0x68df('0xa')],function(_0x2bb507){return{'model':db[_0x2bb507[_0x68df('0xd')]],'as':_0x2bb507['as'],'attributes':_0x2bb507[_0x68df('0xc')],'include':_0x2bb507[_0x68df('0xa')]?_['map'](_0x2bb507['include'],function(_0x185fe6){return{'model':db[_0x185fe6['model']],'as':_0x185fe6['as'],'attributes':_0x185fe6[_0x68df('0xc')]};}):[]};}):[]};}):[]:[]})[_0x68df('0xe')](function(_0x3f6159){logger[_0x68df('0xf')](_0x68df('0x10'),_0x4c5fe9);logger[_0x68df('0x11')](_0x68df('0x10'),_0x4c5fe9,JSON[_0x68df('0x12')](_0x3f6159));_0x380445(_0x3f6159);})[_0x68df('0x13')](function(_0x1d3b3b){logger[_0x68df('0x14')](_0x68df('0x10'),_0x1d3b3b[_0x68df('0x15')],_0x4c5fe9);_0x467fb2(_0x5827a5['error'](0x1f4,_0x1d3b3b['message']));});});};exports[_0x68df('0x16')]=function(_0x10bedc){var _0x51aab9=this;return new Promise(function(_0x39e04b,_0x120240){return db[_0x68df('0x5')]['find']({'raw':_0x10bedc[_0x68df('0x7')]?_0x10bedc[_0x68df('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x10bedc[_0x68df('0x7')]?_0x10bedc['options'][_0x68df('0x8')]||null:null,'attributes':_0x10bedc['options']?_0x10bedc[_0x68df('0x7')]['attributes']||null:null,'include':_0x10bedc[_0x68df('0x7')]?_0x10bedc['options']['include']?_[_0x68df('0xb')](_0x10bedc[_0x68df('0x7')][_0x68df('0xa')],function(_0x2b8652){return{'model':db[_0x2b8652[_0x68df('0xd')]],'as':_0x2b8652['as'],'attributes':_0x2b8652[_0x68df('0xc')],'include':_0x2b8652[_0x68df('0xa')]?_[_0x68df('0xb')](_0x2b8652['include'],function(_0x5c84b0){return{'model':db[_0x5c84b0['model']],'as':_0x5c84b0['as'],'attributes':_0x5c84b0[_0x68df('0xc')],'include':_0x5c84b0[_0x68df('0xa')]?_[_0x68df('0xb')](_0x5c84b0[_0x68df('0xa')],function(_0x31ac13){return{'model':db[_0x31ac13[_0x68df('0xd')]],'as':_0x31ac13['as'],'attributes':_0x31ac13[_0x68df('0xc')]};}):[]};}):[]};}):[]:[]})[_0x68df('0xe')](function(_0x51b55f){logger[_0x68df('0xf')](_0x68df('0x16'),_0x10bedc);logger['debug'](_0x68df('0x16'),_0x10bedc,JSON[_0x68df('0x12')](_0x51b55f));_0x39e04b(_0x51b55f);})[_0x68df('0x13')](function(_0xbc6f3e){logger[_0x68df('0x14')](_0x68df('0x16'),_0xbc6f3e[_0x68df('0x15')],_0x10bedc);_0x120240(_0x51aab9[_0x68df('0x14')](0x1f4,_0xbc6f3e[_0x68df('0x15')]));});});};function checkArrayOfIntervals(_0xb03efc,_0x12b548){var _0x1f7e14=[];return db[_0x68df('0x5')][_0x68df('0x6')]({'where':{'id':_0xb03efc}})[_0x68df('0xe')](function(_0x5199d2){_0x1f7e14=_0x5199d2;return Promise[_0x68df('0x17')](_0x1f7e14[_0x68df('0xb')](function(_0x54fc9b){return _0x54fc9b[_0x68df('0x18')](_0x12b548);}));})[_0x68df('0xe')](function(_0x2a3ed5){var _0x3330da=_0x2a3ed5[_0x68df('0x19')](function(_0x149570,_0x3ad156){return _0x149570||_0x3ad156;},![]);logger[_0x68df('0xf')](util[_0x68df('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1f7e14['map'](function(_0x385c03){return _0x385c03['name'];})[_0x68df('0x1b')](',\x20'),_0x1f7e14[_0x68df('0xb')](function(_0x3a1638){return _0x3a1638['id'];})[_0x68df('0x1b')](',\x20')));return _0x3330da;});}function checkSingleInterval(_0x14c2cb,_0x1e437b){return db[_0x68df('0x5')][_0x68df('0x1c')](_0x14c2cb)['then'](function(_0x3653f7){if(_0x3653f7){logger[_0x68df('0xf')](util[_0x68df('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x3653f7[_0x68df('0x1d')],_0x3653f7['id']));return _0x3653f7[_0x68df('0x18')](_0x1e437b);}});}exports[_0x68df('0x1e')]=function(_0x1584d3){var _0x4c5c9e=_0x1584d3[_0x68df('0x1f')];var _0x395e48=Array[_0x68df('0x20')](_0x1584d3[_0x68df('0x21')])?_0x1584d3['intervals']:typeof _0x1584d3['intervals']===_0x68df('0x22')?[_0x1584d3[_0x68df('0x21')]]:[];var _0x1bea6a=_0x1584d3[_0x68df('0x23')]||undefined;var _0x342bb1=![];if(_0x395e48[_0x68df('0x24')]){logger['info'](util[_0x68df('0x1a')](_0x68df('0x25'),_0x395e48[_0x68df('0x1b')](';\x20')));}if(_0x1bea6a){logger[_0x68df('0xf')](util[_0x68df('0x1a')](_0x68df('0x26'),_0x1bea6a));}logger[_0x68df('0x11')]('Iftime',_0x342bb1);logger[_0x68df('0x27')]('IntervalIftime',_0x1584d3);return Promise[_0x68df('0x28')]()['then'](function(){if(Array[_0x68df('0x20')](_0x4c5c9e)){return checkArrayOfIntervals(_0x4c5c9e,_0x1bea6a);}else if(_0x4c5c9e){return checkSingleInterval(_0x4c5c9e,_0x1bea6a);}})[_0x68df('0xe')](function(_0x193239){var _0x4415d3=_0x395e48['reduce'](function(_0x323fa2,_0x4ddeb5){return _0x323fa2||iftime(_0x4ddeb5,_0x1bea6a);},![]);_0x342bb1=_0x193239||_0x4415d3;return _0x342bb1;})['catch'](function(_0x1f7e75){logger[_0x68df('0x14')](_0x68df('0x1e'),_0x1584d3,_0x1f7e75);throw this[_0x68df('0x14')](0x1f4,_0x1f7e75['message']);});}; \ No newline at end of file +var _0xfe76=['../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','catch','error','message','ShowInterval','Interval','find','stringify','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','ifTime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','IntervalIftime','lodash','util','../../mysqldb'];(function(_0x17a3f0,_0x4266a1){var _0x4b5d61=function(_0x1bee11){while(--_0x1bee11){_0x17a3f0['push'](_0x17a3f0['shift']());}};_0x4b5d61(++_0x4266a1);}(_0xfe76,0x1b5));var _0x6fe7=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xfe76[_0x33bc64];return _0x3fdd34;};'use strict';var _=require(_0x6fe7('0x0'));var util=require(_0x6fe7('0x1'));var db=require(_0x6fe7('0x2'))['db'];var iftime=require(_0x6fe7('0x3'))[_0x6fe7('0x4')];var logger=require(_0x6fe7('0x5'))(_0x6fe7('0x6'));exports[_0x6fe7('0x7')]=function(_0x49f862){var _0x1e4b05=this;return new Promise(function(_0x42eec4,_0x28e220){return db['Interval'][_0x6fe7('0x8')]({'raw':_0x49f862[_0x6fe7('0x9')]?_0x49f862['options'][_0x6fe7('0xa')]===undefined?!![]:![]:!![],'where':_0x49f862[_0x6fe7('0x9')]?_0x49f862[_0x6fe7('0x9')][_0x6fe7('0xb')]||null:null,'attributes':_0x49f862[_0x6fe7('0x9')]?_0x49f862['options'][_0x6fe7('0xc')]||null:null,'limit':_0x49f862[_0x6fe7('0x9')]?_0x49f862[_0x6fe7('0x9')][_0x6fe7('0xd')]||null:null,'include':_0x49f862[_0x6fe7('0x9')]?_0x49f862[_0x6fe7('0x9')][_0x6fe7('0xe')]?_[_0x6fe7('0xf')](_0x49f862['options'][_0x6fe7('0xe')],function(_0x29f830){return{'model':db[_0x29f830[_0x6fe7('0x10')]],'as':_0x29f830['as'],'attributes':_0x29f830[_0x6fe7('0xc')],'include':_0x29f830[_0x6fe7('0xe')]?_[_0x6fe7('0xf')](_0x29f830[_0x6fe7('0xe')],function(_0x57388f){return{'model':db[_0x57388f[_0x6fe7('0x10')]],'as':_0x57388f['as'],'attributes':_0x57388f[_0x6fe7('0xc')],'include':_0x57388f[_0x6fe7('0xe')]?_[_0x6fe7('0xf')](_0x57388f[_0x6fe7('0xe')],function(_0xa342da){return{'model':db[_0xa342da[_0x6fe7('0x10')]],'as':_0xa342da['as'],'attributes':_0xa342da[_0x6fe7('0xc')]};}):[]};}):[]};}):[]:[]})[_0x6fe7('0x11')](function(_0xcff013){logger[_0x6fe7('0x12')]('GetInterval',_0x49f862);logger[_0x6fe7('0x13')](_0x6fe7('0x7'),_0x49f862,JSON['stringify'](_0xcff013));_0x42eec4(_0xcff013);})[_0x6fe7('0x14')](function(_0x93c683){logger[_0x6fe7('0x15')](_0x6fe7('0x7'),_0x93c683[_0x6fe7('0x16')],_0x49f862);_0x28e220(_0x1e4b05['error'](0x1f4,_0x93c683[_0x6fe7('0x16')]));});});};exports[_0x6fe7('0x17')]=function(_0x3a179f){var _0x4b310e=this;return new Promise(function(_0x272d15,_0x22f607){return db[_0x6fe7('0x18')][_0x6fe7('0x19')]({'raw':_0x3a179f[_0x6fe7('0x9')]?_0x3a179f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a179f[_0x6fe7('0x9')]?_0x3a179f[_0x6fe7('0x9')][_0x6fe7('0xb')]||null:null,'attributes':_0x3a179f[_0x6fe7('0x9')]?_0x3a179f[_0x6fe7('0x9')]['attributes']||null:null,'include':_0x3a179f[_0x6fe7('0x9')]?_0x3a179f[_0x6fe7('0x9')][_0x6fe7('0xe')]?_['map'](_0x3a179f[_0x6fe7('0x9')][_0x6fe7('0xe')],function(_0x31be25){return{'model':db[_0x31be25[_0x6fe7('0x10')]],'as':_0x31be25['as'],'attributes':_0x31be25['attributes'],'include':_0x31be25[_0x6fe7('0xe')]?_[_0x6fe7('0xf')](_0x31be25[_0x6fe7('0xe')],function(_0x3f422d){return{'model':db[_0x3f422d[_0x6fe7('0x10')]],'as':_0x3f422d['as'],'attributes':_0x3f422d[_0x6fe7('0xc')],'include':_0x3f422d[_0x6fe7('0xe')]?_[_0x6fe7('0xf')](_0x3f422d['include'],function(_0xf9bafa){return{'model':db[_0xf9bafa[_0x6fe7('0x10')]],'as':_0xf9bafa['as'],'attributes':_0xf9bafa[_0x6fe7('0xc')]};}):[]};}):[]};}):[]:[]})[_0x6fe7('0x11')](function(_0x11d301){logger[_0x6fe7('0x12')](_0x6fe7('0x17'),_0x3a179f);logger[_0x6fe7('0x13')](_0x6fe7('0x17'),_0x3a179f,JSON[_0x6fe7('0x1a')](_0x11d301));_0x272d15(_0x11d301);})[_0x6fe7('0x14')](function(_0x24b80e){logger[_0x6fe7('0x15')](_0x6fe7('0x17'),_0x24b80e['message'],_0x3a179f);_0x22f607(_0x4b310e[_0x6fe7('0x15')](0x1f4,_0x24b80e['message']));});});};function checkArrayOfIntervals(_0x237a5b,_0xd1cf9f){var _0x10a15a=[];return db[_0x6fe7('0x18')][_0x6fe7('0x8')]({'where':{'id':_0x237a5b}})[_0x6fe7('0x11')](function(_0xfbc470){_0x10a15a=_0xfbc470;return Promise['all'](_0x10a15a[_0x6fe7('0xf')](function(_0x429880){return _0x429880['ifTime'](_0xd1cf9f);}));})['then'](function(_0x4e6b82){var _0x4c9be2=_0x4e6b82[_0x6fe7('0x1b')](function(_0xb20feb,_0x432b29){return _0xb20feb||_0x432b29;},![]);logger[_0x6fe7('0x12')](util[_0x6fe7('0x1c')](_0x6fe7('0x1d'),_0x10a15a['map'](function(_0x199449){return _0x199449['name'];})[_0x6fe7('0x1e')](',\x20'),_0x10a15a[_0x6fe7('0xf')](function(_0x49c18e){return _0x49c18e['id'];})['join'](',\x20')));return _0x4c9be2;});}function checkSingleInterval(_0x48be80,_0x1e5943){return db[_0x6fe7('0x18')][_0x6fe7('0x1f')](_0x48be80)[_0x6fe7('0x11')](function(_0x144c23){if(_0x144c23){logger[_0x6fe7('0x12')](util[_0x6fe7('0x1c')](_0x6fe7('0x20'),_0x144c23[_0x6fe7('0x21')],_0x144c23['id']));return _0x144c23[_0x6fe7('0x22')](_0x1e5943);}});}exports['IntervalIftime']=function(_0x64a889){var _0x37c1d4=_0x64a889[_0x6fe7('0x23')];var _0x1139d2=Array[_0x6fe7('0x24')](_0x64a889[_0x6fe7('0x25')])?_0x64a889['intervals']:typeof _0x64a889[_0x6fe7('0x25')]===_0x6fe7('0x26')?[_0x64a889['intervals']]:[];var _0x57e7ba=_0x64a889[_0x6fe7('0x27')]||undefined;var _0x5b4a1e=![];if(_0x1139d2[_0x6fe7('0x28')]){logger[_0x6fe7('0x12')](util[_0x6fe7('0x1c')](_0x6fe7('0x29'),_0x1139d2['join'](';\x20')));}if(_0x57e7ba){logger[_0x6fe7('0x12')](util[_0x6fe7('0x1c')](_0x6fe7('0x2a'),_0x57e7ba));}logger[_0x6fe7('0x13')]('Iftime',_0x5b4a1e);logger['silly'](_0x6fe7('0x2b'),_0x64a889);return Promise['resolve']()['then'](function(){if(Array[_0x6fe7('0x24')](_0x37c1d4)){return checkArrayOfIntervals(_0x37c1d4,_0x57e7ba);}else if(_0x37c1d4){return checkSingleInterval(_0x37c1d4,_0x57e7ba);}})['then'](function(_0xd02996){var _0x1808cb=_0x1139d2[_0x6fe7('0x1b')](function(_0x14ec9c,_0x1c58bd){return _0x14ec9c||iftime(_0x1c58bd,_0x57e7ba);},![]);_0x5b4a1e=_0xd02996||_0x1808cb;return _0x5b4a1e;})[_0x6fe7('0x14')](function(_0x493a42){logger[_0x6fe7('0x15')](_0x6fe7('0x2b'),_0x64a889,_0x493a42);throw this[_0x6fe7('0x15')](0x1f4,_0x493a42['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index db300ac..089c227 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xb10b,0x12a));var _0xbb10=function(_0x241b4b,_0x206d5a){_0x241b4b=_0x241b4b-0x0;var _0x2220d0=_0xb10b[_0x241b4b];return _0x2220d0;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb10b,0x12a));var _0xbb10=function(_0x160cd7,_0x315362){_0x160cd7=_0x160cd7-0x0;var _0x4c34f2=_0xb10b[_0x160cd7];return _0x4c34f2;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bc15d1e..8bdc330 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 _0xb656=['Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','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','send','body','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','issuetype'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0xb656,0xdb));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6b65('0x0'));var https=require(_0x6b65('0x1'));var logger=require(_0x6b65('0x2'))(_0x6b65('0x3'));var USERNAME='support';var PASSWORD=_0x6b65('0x4');function openIssue(_0x4721dd,_0x1d2fbe){var _0x3cc552={'fields':{'project':{'key':_0x4721dd[_0x6b65('0x5')]||_0x6b65('0x6')},'summary':(_0x4721dd['summary']||_0x6b65('0x7'))+_0x6b65('0x8')+_0x4721dd['ip'],'description':_0x4721dd['description']||JSON[_0x6b65('0x9')](_0x4721dd),'issuetype':{'name':_0x4721dd[_0x6b65('0xa')]||_0x6b65('0xb')}}};_0x3cc552[_0x6b65('0xc')][_0x6b65('0xd')]=_0x4721dd[_0x6b65('0xe')];_0x3cc552[_0x6b65('0xc')][_0x6b65('0xf')]=_0x4721dd[_0x6b65('0x10')];_0x3cc552['fields'][_0x6b65('0x11')]=_0x4721dd[_0x6b65('0x12')];_0x3cc552['fields'][_0x6b65('0x13')]=_0x4721dd[_0x6b65('0x14')];_0x3cc552[_0x6b65('0xc')][_0x6b65('0x15')]=_0x4721dd[_0x6b65('0x16')];_0x3cc552[_0x6b65('0xc')]['customfield_10102']=_0x4721dd['ip'];var _0xa1114e={'host':_0x6b65('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x6b65('0x18'),'Authorization':_0x6b65('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x6b65('0x1a')](_0x6b65('0x1b'))}};var _0xd4a3fe=JSON[_0x6b65('0x9')](_0x3cc552);var _0xf6f9bf=https[_0x6b65('0x1c')](_0xa1114e,function(_0x590743){_0x590743[_0x6b65('0x1d')](_0x6b65('0x1e'));var _0x5153b3='';_0x590743['on']('data',function(_0xcd9bbf){_0x5153b3+=_0xcd9bbf;});_0x590743['on']('end',function(){if(_0x1d2fbe){return _0x1d2fbe[_0x6b65('0x1f')](_0x590743[_0x6b65('0x20')])[_0x6b65('0x21')](JSON[_0x6b65('0x22')](_0x5153b3));}});});_0xf6f9bf['on'](_0x6b65('0x23'),function(_0x1d47ee){if(_0x1d2fbe){return _0x1d2fbe[_0x6b65('0x1f')](0x1f4)[_0x6b65('0x21')]({'errors':[{'message':_0x6b65('0x24'),'type':_0x6b65('0x25')}]});}});_0xf6f9bf[_0x6b65('0x26')](_0xd4a3fe);_0xf6f9bf[_0x6b65('0x27')]();}exports[_0x6b65('0x28')]=openIssue;exports[_0x6b65('0x29')]=function(_0x316f22,_0x1984a9){_0x316f22[_0x6b65('0x2a')]['ip']=_0x316f22['headers'][_0x6b65('0x2b')]||_0x316f22['connection'][_0x6b65('0x2c')]||_0x316f22[_0x6b65('0x2d')][_0x6b65('0x2c')]||_0x316f22['connection'][_0x6b65('0x2d')][_0x6b65('0x2c')];return openIssue(_0x316f22[_0x6b65('0x2a')],_0x1984a9);}; \ No newline at end of file +var _0x3662=['error','status','api.jira','end','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','statusCode','json'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3662,0x15b));var _0x2366=function(_0x1a9521,_0x473bcb){_0x1a9521=_0x1a9521-0x0;var _0x2134f7=_0x3662[_0x1a9521];return _0x2134f7;};'use strict';var BPromise=require(_0x2366('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x2366('0x1'));var USERNAME=_0x2366('0x2');var PASSWORD=_0x2366('0x3');function openIssue(_0x50822d,_0x1caa6c){var _0x5c76f1={'fields':{'project':{'key':_0x50822d[_0x2366('0x4')]||_0x2366('0x5')},'summary':(_0x50822d[_0x2366('0x6')]||_0x2366('0x7'))+_0x2366('0x8')+_0x50822d['ip'],'description':_0x50822d[_0x2366('0x9')]||JSON[_0x2366('0xa')](_0x50822d),'issuetype':{'name':_0x50822d['issuetype']||_0x2366('0xb')}}};_0x5c76f1[_0x2366('0xc')]['customfield_11500']=_0x50822d[_0x2366('0xd')];_0x5c76f1['fields'][_0x2366('0xe')]=_0x50822d[_0x2366('0xf')];_0x5c76f1['fields'][_0x2366('0x10')]=_0x50822d['newToken'];_0x5c76f1[_0x2366('0xc')][_0x2366('0x11')]=_0x50822d['name'];_0x5c76f1[_0x2366('0xc')][_0x2366('0x12')]=_0x50822d[_0x2366('0x13')];_0x5c76f1[_0x2366('0xc')][_0x2366('0x14')]=_0x50822d['ip'];var _0x339c0a={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x2366('0x15'),'Authorization':_0x2366('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x2366('0x17')](_0x2366('0x18'))}};var _0x44ff75=JSON[_0x2366('0xa')](_0x5c76f1);var _0x26986b=https[_0x2366('0x19')](_0x339c0a,function(_0x13e174){_0x13e174[_0x2366('0x1a')](_0x2366('0x1b'));var _0x110011='';_0x13e174['on'](_0x2366('0x1c'),function(_0x51180c){_0x110011+=_0x51180c;});_0x13e174['on']('end',function(){if(_0x1caa6c){return _0x1caa6c['status'](_0x13e174[_0x2366('0x1d')])[_0x2366('0x1e')](JSON['parse'](_0x110011));}});});_0x26986b['on'](_0x2366('0x1f'),function(_0x15a96d){if(_0x1caa6c){return _0x1caa6c[_0x2366('0x20')](0x1f4)[_0x2366('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x2366('0x21')}]});}});_0x26986b['write'](_0x44ff75);_0x26986b[_0x2366('0x22')]();}exports[_0x2366('0x23')]=openIssue;exports[_0x2366('0x24')]=function(_0x3c289b,_0x43d1fa){_0x3c289b[_0x2366('0x25')]['ip']=_0x3c289b['headers'][_0x2366('0x26')]||_0x3c289b['connection'][_0x2366('0x27')]||_0x3c289b[_0x2366('0x28')][_0x2366('0x27')]||_0x3c289b[_0x2366('0x29')][_0x2366('0x28')][_0x2366('0x27')];return openIssue(_0x3c289b['body'],_0x43d1fa);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index bff3828..57d0f06 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 _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2c0a09,_0x32855e){var _0x2d42c5=function(_0x59c549){while(--_0x59c549){_0x2c0a09['push'](_0x2c0a09['shift']());}};_0x2d42c5(++_0x32855e);}(_0x5ff3,0x17d));var _0x35ff=function(_0x22fda6,_0x18d7eb){_0x22fda6=_0x22fda6-0x0;var _0x4108b0=_0x5ff3[_0x22fda6];return _0x4108b0;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file +var _0x41bb=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x286832,_0x1bebf8){var _0x16bac4=function(_0x57df40){while(--_0x57df40){_0x286832['push'](_0x286832['shift']());}};_0x16bac4(++_0x1bebf8);}(_0x41bb,0xc5));var _0xb41b=function(_0x26189f,_0x32e2a3){_0x26189f=_0x26189f-0x0;var _0x2571c1=_0x41bb[_0x26189f];return _0x2571c1;};'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('0xd')]('/',auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router[_0xb41b('0xf')]('/:id',auth[_0xb41b('0x9')](),controller['update']);router[_0xb41b('0x10')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x11')]);module[_0xb41b('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 6f9d76e..b142604 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x21c638,_0x5971d0){_0x21c638=_0x21c638-0x0;var _0x437f01=_0x7a54[_0x21c638];return _0x437f01;};'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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5d05,_0x135420){_0x3f5d05=_0x3f5d05-0x0;var _0x37fb61=_0x7a54[_0x3f5d05];return _0x37fb61;};'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 f8baf1c..8b98855 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 _0x2484=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','intersection','fields','query','attributes','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xa46cc9,_0x327f7d){var _0x5683ed=function(_0x3432d4){while(--_0x3432d4){_0xa46cc9['push'](_0xa46cc9['shift']());}};_0x5683ed(++_0x327f7d);}(_0x2484,0x178));var _0x4248=function(_0x49365d,_0x227a7c){_0x49365d=_0x49365d-0x0;var _0x508eaa=_0x2484[_0x49365d];return _0x508eaa;};'use strict';var emlformat=require(_0x4248('0x0'));var rimraf=require(_0x4248('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4248('0x2'));var rp=require(_0x4248('0x3'));var moment=require(_0x4248('0x4'));var BPromise=require(_0x4248('0x5'));var Mustache=require(_0x4248('0x6'));var util=require(_0x4248('0x7'));var path=require(_0x4248('0x8'));var sox=require('sox');var csv=require(_0x4248('0x9'));var ejs=require(_0x4248('0xa'));var fs=require('fs');var fs_extra=require(_0x4248('0xb'));var _=require(_0x4248('0xc'));var squel=require(_0x4248('0xd'));var crypto=require(_0x4248('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4248('0xf'));var toCsv=require(_0x4248('0x9'));var querystring=require(_0x4248('0x10'));var Papa=require(_0x4248('0x11'));var Redis=require(_0x4248('0x12'));var authService=require(_0x4248('0x13'));var qs=require(_0x4248('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4248('0x15'));var logger=require('../../config/logger')(_0x4248('0x16'));var utils=require(_0x4248('0x17'));var config=require(_0x4248('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeb5fd1,_0x5237e9){_0x5237e9=_0x5237e9||0xcc;return function(_0x182e84){if(_0x182e84){return _0xeb5fd1[_0x4248('0x19')](_0x5237e9);}return _0xeb5fd1[_0x4248('0x1a')](_0x5237e9)[_0x4248('0x1b')]();};}function respondWithResult(_0x3a557b,_0x588077){_0x588077=_0x588077||0xc8;return function(_0x8b30bb){if(_0x8b30bb){return _0x3a557b[_0x4248('0x1a')](_0x588077)[_0x4248('0x1c')](_0x8b30bb);}};}function respondWithFilteredResult(_0x35308b,_0x3e7d0a){return function(_0x51c92e){if(_0x51c92e){var _0x46cfbb=typeof _0x3e7d0a[_0x4248('0x1d')]===_0x4248('0x1e')&&typeof _0x3e7d0a[_0x4248('0x1f')]===_0x4248('0x1e');var _0x321e92=_0x51c92e[_0x4248('0x20')];var _0x45edc6=_0x46cfbb?0x0:_0x3e7d0a[_0x4248('0x1d')];var _0xd03b87=_0x46cfbb?_0x51c92e[_0x4248('0x20')]:_0x3e7d0a[_0x4248('0x1d')]+_0x3e7d0a[_0x4248('0x1f')];var _0x1b2f10;if(_0xd03b87>=_0x321e92){_0xd03b87=_0x321e92;_0x1b2f10=0xc8;}else{_0x1b2f10=0xce;}_0x35308b[_0x4248('0x1a')](_0x1b2f10);return _0x35308b[_0x4248('0x21')](_0x4248('0x22'),_0x45edc6+'-'+_0xd03b87+'/'+_0x321e92)[_0x4248('0x1c')](_0x51c92e);}return null;};}function patchUpdates(_0x5ab53e){return function(_0x3c1c46){try{jsonpatch[_0x4248('0x23')](_0x3c1c46,_0x5ab53e,!![]);}catch(_0x2d674b){return BPromise[_0x4248('0x24')](_0x2d674b);}return _0x3c1c46['save']();};}function saveUpdates(_0x43c75d,_0x37b1b3){return function(_0x30b232){if(_0x30b232){return _0x30b232['update'](_0x43c75d)[_0x4248('0x25')](function(_0x25ffa3){return _0x25ffa3;});}return null;};}function removeEntity(_0x50f032,_0x3bfcf2){return function(_0x598681){if(_0x598681){return _0x598681[_0x4248('0x26')]()[_0x4248('0x25')](function(){_0x50f032[_0x4248('0x1a')](0xcc)[_0x4248('0x1b')]();});}};}function handleEntityNotFound(_0x5a3938,_0x1c6ade){return function(_0x205382){if(!_0x205382){_0x5a3938[_0x4248('0x19')](0x194);}return _0x205382;};}function handleError(_0xb3e0e0,_0xd758e6){_0xd758e6=_0xd758e6||0x1f4;return function(_0x429641){logger[_0x4248('0x27')](_0x429641[_0x4248('0x28')]);if(_0x429641[_0x4248('0x29')]){delete _0x429641[_0x4248('0x29')];}_0xb3e0e0[_0x4248('0x1a')](_0xd758e6)[_0x4248('0x2a')](_0x429641);};}exports[_0x4248('0x2b')]=function(_0xf72ecc,_0xf06a1a){var _0x439859={},_0x482689={},_0x346d91={'count':0x0,'rows':[]};var _0x40ca90=_[_0x4248('0x2c')](db['JscriptyAnswerReport'][_0x4248('0x2d')],function(_0x1b4768){return{'name':_0x1b4768[_0x4248('0x2e')],'type':_0x1b4768[_0x4248('0x2f')][_0x4248('0x30')]};});_0x482689[_0x4248('0x31')]=_[_0x4248('0x2c')](_0x40ca90,'name');_0x482689['query']=_['keys'](_0xf72ecc['query']);_0x482689['filters']=_['intersection'](_0x482689['model'],_0x482689['query']);_0x439859['attributes']=_[_0x4248('0x32')](_0x482689[_0x4248('0x31')],qs[_0x4248('0x33')](_0xf72ecc[_0x4248('0x34')]['fields']));_0x439859[_0x4248('0x35')]=_0x439859['attributes'][_0x4248('0x36')]?_0x439859[_0x4248('0x35')]:_0x482689[_0x4248('0x31')];if(!_0xf72ecc[_0x4248('0x34')]['hasOwnProperty']('nolimit')){_0x439859[_0x4248('0x1f')]=qs[_0x4248('0x1f')](_0xf72ecc[_0x4248('0x34')][_0x4248('0x1f')]);_0x439859[_0x4248('0x1d')]=qs[_0x4248('0x1d')](_0xf72ecc[_0x4248('0x34')][_0x4248('0x1d')]);}_0x439859['order']=qs['sort'](_0xf72ecc['query'][_0x4248('0x37')]);_0x439859['where']=qs[_0x4248('0x38')](_[_0x4248('0x39')](_0xf72ecc[_0x4248('0x34')],_0x482689[_0x4248('0x38')]),_0x40ca90);if(_0xf72ecc[_0x4248('0x34')][_0x4248('0x3a')]){_0x439859[_0x4248('0x3b')]=_[_0x4248('0x3c')](_0x439859['where'],{'$or':_[_0x4248('0x2c')](_0x40ca90,function(_0x24a824){if(_0x24a824['type']!==_0x4248('0x3d')){var _0x38a7ab={};_0x38a7ab[_0x24a824['name']]={'$like':'%'+_0xf72ecc[_0x4248('0x34')][_0x4248('0x3a')]+'%'};return _0x38a7ab;}})});}_0x439859=_[_0x4248('0x3c')]({},_0x439859,_0xf72ecc[_0x4248('0x3e')]);var _0xb7f152={'where':_0x439859['where']};return db[_0x4248('0x3f')]['count'](_0xb7f152)['then'](function(_0x33152c){_0x346d91[_0x4248('0x20')]=_0x33152c;if(_0xf72ecc[_0x4248('0x34')][_0x4248('0x40')]){_0x439859[_0x4248('0x41')]=[{'all':!![]}];}return db[_0x4248('0x3f')][_0x4248('0x42')](_0x439859);})[_0x4248('0x25')](function(_0x267923){_0x346d91[_0x4248('0x43')]=_0x267923;return _0x346d91;})['then'](respondWithFilteredResult(_0xf06a1a,_0x439859))[_0x4248('0x44')](handleError(_0xf06a1a,null));};exports[_0x4248('0x45')]=function(_0x3b40ad,_0x4b9200){var _0x57ff44={'raw':!![],'where':{'id':_0x3b40ad[_0x4248('0x46')]['id']}},_0x4b29c1={};_0x4b29c1[_0x4248('0x31')]=_[_0x4248('0x47')](db[_0x4248('0x3f')][_0x4248('0x2d')]);_0x4b29c1[_0x4248('0x34')]=_['keys'](_0x3b40ad[_0x4248('0x34')]);_0x4b29c1[_0x4248('0x38')]=_[_0x4248('0x32')](_0x4b29c1['model'],_0x4b29c1[_0x4248('0x34')]);_0x57ff44[_0x4248('0x35')]=_[_0x4248('0x32')](_0x4b29c1['model'],qs['fields'](_0x3b40ad[_0x4248('0x34')][_0x4248('0x33')]));_0x57ff44[_0x4248('0x35')]=_0x57ff44[_0x4248('0x35')]['length']?_0x57ff44[_0x4248('0x35')]:_0x4b29c1[_0x4248('0x31')];if(_0x3b40ad['query'][_0x4248('0x40')]){_0x57ff44['include']=[{'all':!![]}];}_0x57ff44=_[_0x4248('0x3c')]({},_0x57ff44,_0x3b40ad[_0x4248('0x3e')]);return db['JscriptyAnswerReport'][_0x4248('0x48')](_0x57ff44)['then'](handleEntityNotFound(_0x4b9200,null))[_0x4248('0x25')](respondWithResult(_0x4b9200,null))[_0x4248('0x44')](handleError(_0x4b9200,null));};exports[_0x4248('0x49')]=function(_0x20184b,_0x47b0ef){return db['JscriptyAnswerReport']['create'](_0x20184b[_0x4248('0x4a')],{})[_0x4248('0x25')](respondWithResult(_0x47b0ef,0xc9))[_0x4248('0x44')](handleError(_0x47b0ef,null));};exports[_0x4248('0x4b')]=function(_0x4c5b11,_0x42f12a){if(_0x4c5b11[_0x4248('0x4a')]['id']){delete _0x4c5b11[_0x4248('0x4a')]['id'];}return db[_0x4248('0x3f')]['find']({'where':{'id':_0x4c5b11[_0x4248('0x46')]['id']}})[_0x4248('0x25')](handleEntityNotFound(_0x42f12a,null))[_0x4248('0x25')](saveUpdates(_0x4c5b11[_0x4248('0x4a')],null))[_0x4248('0x25')](respondWithResult(_0x42f12a,null))[_0x4248('0x44')](handleError(_0x42f12a,null));};exports[_0x4248('0x26')]=function(_0x46b2e4,_0x34a922){return db['JscriptyAnswerReport'][_0x4248('0x48')]({'where':{'id':_0x46b2e4[_0x4248('0x46')]['id']}})[_0x4248('0x25')](handleEntityNotFound(_0x34a922,null))[_0x4248('0x25')](removeEntity(_0x34a922,null))[_0x4248('0x44')](handleError(_0x34a922,null));};exports['describe']=function(_0x548bfa,_0x27e3a5){return db[_0x4248('0x3f')][_0x4248('0x4c')]()['then'](respondWithResult(_0x27e3a5,null))['catch'](handleError(_0x27e3a5,null));}; \ No newline at end of file +var _0x2494=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','JscriptyAnswerReport','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x30c92b,_0x154324){var _0x33837b=function(_0x3366e6){while(--_0x3366e6){_0x30c92b['push'](_0x30c92b['shift']());}};_0x33837b(++_0x154324);}(_0x2494,0x82));var _0x4249=function(_0x5578cf,_0x2a8f9d){_0x5578cf=_0x5578cf-0x0;var _0x4f5371=_0x2494[_0x5578cf];return _0x4f5371;};'use strict';var emlformat=require(_0x4249('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4249('0x1'));var jsonpatch=require(_0x4249('0x2'));var rp=require(_0x4249('0x3'));var moment=require(_0x4249('0x4'));var BPromise=require(_0x4249('0x5'));var Mustache=require(_0x4249('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4249('0x7'));var csv=require('to-csv');var ejs=require(_0x4249('0x8'));var fs=require('fs');var fs_extra=require(_0x4249('0x9'));var _=require(_0x4249('0xa'));var squel=require('squel');var crypto=require(_0x4249('0xb'));var jsforce=require(_0x4249('0xc'));var deskjs=require(_0x4249('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4249('0xe'));var Redis=require(_0x4249('0xf'));var authService=require(_0x4249('0x10'));var qs=require(_0x4249('0x11'));var as=require(_0x4249('0x12'));var hardwareService=require(_0x4249('0x13'));var logger=require(_0x4249('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4249('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4249('0x16'))['db'];function respondWithStatusCode(_0x40b7ac,_0x57c3c7){_0x57c3c7=_0x57c3c7||0xcc;return function(_0x3cde97){if(_0x3cde97){return _0x40b7ac[_0x4249('0x17')](_0x57c3c7);}return _0x40b7ac['status'](_0x57c3c7)[_0x4249('0x18')]();};}function respondWithResult(_0x40ce9c,_0x2348f7){_0x2348f7=_0x2348f7||0xc8;return function(_0x3a514b){if(_0x3a514b){return _0x40ce9c[_0x4249('0x19')](_0x2348f7)[_0x4249('0x1a')](_0x3a514b);}};}function respondWithFilteredResult(_0x49eede,_0x7da5cf){return function(_0x32d170){if(_0x32d170){var _0x58ebd9=typeof _0x7da5cf[_0x4249('0x1b')]==='undefined'&&typeof _0x7da5cf['limit']==='undefined';var _0x39a6df=_0x32d170[_0x4249('0x1c')];var _0x1dbb4d=_0x58ebd9?0x0:_0x7da5cf[_0x4249('0x1b')];var _0x345606=_0x58ebd9?_0x32d170['count']:_0x7da5cf['offset']+_0x7da5cf[_0x4249('0x1d')];var _0x1333e1;if(_0x345606>=_0x39a6df){_0x345606=_0x39a6df;_0x1333e1=0xc8;}else{_0x1333e1=0xce;}_0x49eede[_0x4249('0x19')](_0x1333e1);return _0x49eede['set'](_0x4249('0x1e'),_0x1dbb4d+'-'+_0x345606+'/'+_0x39a6df)[_0x4249('0x1a')](_0x32d170);}return null;};}function patchUpdates(_0x4e5208){return function(_0x17399e){try{jsonpatch['apply'](_0x17399e,_0x4e5208,!![]);}catch(_0x4513d9){return BPromise[_0x4249('0x1f')](_0x4513d9);}return _0x17399e[_0x4249('0x20')]();};}function saveUpdates(_0x170fb2,_0x42d0d9){return function(_0x157354){if(_0x157354){return _0x157354[_0x4249('0x21')](_0x170fb2)[_0x4249('0x22')](function(_0x4032f7){return _0x4032f7;});}return null;};}function removeEntity(_0x15561d,_0x9da8){return function(_0x453667){if(_0x453667){return _0x453667[_0x4249('0x23')]()[_0x4249('0x22')](function(){_0x15561d[_0x4249('0x19')](0xcc)[_0x4249('0x18')]();});}};}function handleEntityNotFound(_0x35b6ec,_0x2e5843){return function(_0x4f970e){if(!_0x4f970e){_0x35b6ec[_0x4249('0x17')](0x194);}return _0x4f970e;};}function handleError(_0x43dc25,_0x1d4fb9){_0x1d4fb9=_0x1d4fb9||0x1f4;return function(_0x4ce9af){logger[_0x4249('0x24')](_0x4ce9af[_0x4249('0x25')]);if(_0x4ce9af[_0x4249('0x26')]){delete _0x4ce9af[_0x4249('0x26')];}_0x43dc25['status'](_0x1d4fb9)[_0x4249('0x27')](_0x4ce9af);};}exports['index']=function(_0x2dbac8,_0x16e141){var _0x3780ba={},_0x4eba42={},_0xb4d4d8={'count':0x0,'rows':[]};var _0x3b3cb5=_['map'](db[_0x4249('0x28')]['rawAttributes'],function(_0x4e7761){return{'name':_0x4e7761['fieldName'],'type':_0x4e7761['type'][_0x4249('0x29')]};});_0x4eba42[_0x4249('0x2a')]=_['map'](_0x3b3cb5,_0x4249('0x26'));_0x4eba42[_0x4249('0x2b')]=_['keys'](_0x2dbac8[_0x4249('0x2b')]);_0x4eba42['filters']=_['intersection'](_0x4eba42[_0x4249('0x2a')],_0x4eba42[_0x4249('0x2b')]);_0x3780ba[_0x4249('0x2c')]=_['intersection'](_0x4eba42[_0x4249('0x2a')],qs['fields'](_0x2dbac8['query'][_0x4249('0x2d')]));_0x3780ba[_0x4249('0x2c')]=_0x3780ba['attributes']['length']?_0x3780ba[_0x4249('0x2c')]:_0x4eba42[_0x4249('0x2a')];if(!_0x2dbac8[_0x4249('0x2b')][_0x4249('0x2e')](_0x4249('0x2f'))){_0x3780ba[_0x4249('0x1d')]=qs[_0x4249('0x1d')](_0x2dbac8[_0x4249('0x2b')][_0x4249('0x1d')]);_0x3780ba[_0x4249('0x1b')]=qs[_0x4249('0x1b')](_0x2dbac8[_0x4249('0x2b')][_0x4249('0x1b')]);}_0x3780ba[_0x4249('0x30')]=qs[_0x4249('0x31')](_0x2dbac8['query']['sort']);_0x3780ba[_0x4249('0x32')]=qs[_0x4249('0x33')](_[_0x4249('0x34')](_0x2dbac8[_0x4249('0x2b')],_0x4eba42['filters']),_0x3b3cb5);if(_0x2dbac8[_0x4249('0x2b')][_0x4249('0x35')]){_0x3780ba[_0x4249('0x32')]=_[_0x4249('0x36')](_0x3780ba[_0x4249('0x32')],{'$or':_[_0x4249('0x37')](_0x3b3cb5,function(_0xb51eb2){if(_0xb51eb2[_0x4249('0x38')]!==_0x4249('0x39')){var _0x42725d={};_0x42725d[_0xb51eb2['name']]={'$like':'%'+_0x2dbac8['query']['filter']+'%'};return _0x42725d;}})});}_0x3780ba=_[_0x4249('0x36')]({},_0x3780ba,_0x2dbac8[_0x4249('0x3a')]);var _0x1b6afd={'where':_0x3780ba[_0x4249('0x32')]};return db['JscriptyAnswerReport'][_0x4249('0x1c')](_0x1b6afd)['then'](function(_0xd71464){_0xb4d4d8[_0x4249('0x1c')]=_0xd71464;if(_0x2dbac8['query'][_0x4249('0x3b')]){_0x3780ba[_0x4249('0x3c')]=[{'all':!![]}];}return db[_0x4249('0x28')][_0x4249('0x3d')](_0x3780ba);})[_0x4249('0x22')](function(_0x872aaa){_0xb4d4d8[_0x4249('0x3e')]=_0x872aaa;return _0xb4d4d8;})[_0x4249('0x22')](respondWithFilteredResult(_0x16e141,_0x3780ba))[_0x4249('0x3f')](handleError(_0x16e141,null));};exports[_0x4249('0x40')]=function(_0x513cd7,_0x1f73a0){var _0x3d30eb={'raw':!![],'where':{'id':_0x513cd7[_0x4249('0x41')]['id']}},_0x2e08b4={};_0x2e08b4[_0x4249('0x2a')]=_[_0x4249('0x42')](db[_0x4249('0x28')][_0x4249('0x43')]);_0x2e08b4[_0x4249('0x2b')]=_[_0x4249('0x42')](_0x513cd7[_0x4249('0x2b')]);_0x2e08b4['filters']=_[_0x4249('0x44')](_0x2e08b4[_0x4249('0x2a')],_0x2e08b4[_0x4249('0x2b')]);_0x3d30eb[_0x4249('0x2c')]=_[_0x4249('0x44')](_0x2e08b4[_0x4249('0x2a')],qs['fields'](_0x513cd7[_0x4249('0x2b')][_0x4249('0x2d')]));_0x3d30eb['attributes']=_0x3d30eb[_0x4249('0x2c')][_0x4249('0x45')]?_0x3d30eb['attributes']:_0x2e08b4[_0x4249('0x2a')];if(_0x513cd7['query']['includeAll']){_0x3d30eb[_0x4249('0x3c')]=[{'all':!![]}];}_0x3d30eb=_['merge']({},_0x3d30eb,_0x513cd7[_0x4249('0x3a')]);return db[_0x4249('0x28')][_0x4249('0x46')](_0x3d30eb)[_0x4249('0x22')](handleEntityNotFound(_0x1f73a0,null))['then'](respondWithResult(_0x1f73a0,null))[_0x4249('0x3f')](handleError(_0x1f73a0,null));};exports[_0x4249('0x47')]=function(_0x4c63fa,_0x28ad9b){return db[_0x4249('0x28')][_0x4249('0x47')](_0x4c63fa[_0x4249('0x48')],{})[_0x4249('0x22')](respondWithResult(_0x28ad9b,0xc9))[_0x4249('0x3f')](handleError(_0x28ad9b,null));};exports[_0x4249('0x21')]=function(_0xeab8f7,_0x35222b){if(_0xeab8f7[_0x4249('0x48')]['id']){delete _0xeab8f7[_0x4249('0x48')]['id'];}return db['JscriptyAnswerReport'][_0x4249('0x46')]({'where':{'id':_0xeab8f7[_0x4249('0x41')]['id']}})[_0x4249('0x22')](handleEntityNotFound(_0x35222b,null))[_0x4249('0x22')](saveUpdates(_0xeab8f7['body'],null))['then'](respondWithResult(_0x35222b,null))[_0x4249('0x3f')](handleError(_0x35222b,null));};exports[_0x4249('0x23')]=function(_0x4d163f,_0x36a67f){return db[_0x4249('0x28')][_0x4249('0x46')]({'where':{'id':_0x4d163f['params']['id']}})['then'](handleEntityNotFound(_0x36a67f,null))[_0x4249('0x22')](removeEntity(_0x36a67f,null))['catch'](handleError(_0x36a67f,null));};exports[_0x4249('0x49')]=function(_0x58a075,_0x4554ac){return db[_0x4249('0x28')]['describe']()[_0x4249('0x22')](respondWithResult(_0x4554ac,null))[_0x4249('0x3f')](handleError(_0x4554ac,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 11456d2..80dd90f 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 _0x811a=['path','../../config/environment','define','JscriptyAnswerReport','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x538cac,_0x581ad1){var _0x554759=function(_0x25eb48){while(--_0x25eb48){_0x538cac['push'](_0x538cac['shift']());}};_0x554759(++_0x581ad1);}(_0x811a,0xc2));var _0xa811=function(_0x3e24ac,_0x134afd){_0x3e24ac=_0x3e24ac-0x0;var _0x1b54d1=_0x811a[_0x3e24ac];return _0x1b54d1;};'use strict';var _=require('lodash');var util=require(_0xa811('0x0'));var logger=require(_0xa811('0x1'))(_0xa811('0x2'));var moment=require(_0xa811('0x3'));var BPromise=require(_0xa811('0x4'));var rp=require(_0xa811('0x5'));var fs=require('fs');var path=require(_0xa811('0x6'));var rimraf=require('rimraf');var config=require(_0xa811('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2aff83,_0x264c98){return _0x2aff83[_0xa811('0x8')](_0xa811('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbed=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util'];(function(_0x56018e,_0x309ad5){var _0x5cb725=function(_0x5c90cd){while(--_0x5c90cd){_0x56018e['push'](_0x56018e['shift']());}};_0x5cb725(++_0x309ad5);}(_0xfbed,0x116));var _0xdfbe=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xfbed[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xdfbe('0x0'));var util=require(_0xdfbe('0x1'));var logger=require(_0xdfbe('0x2'))(_0xdfbe('0x3'));var moment=require(_0xdfbe('0x4'));var BPromise=require(_0xdfbe('0x5'));var rp=require(_0xdfbe('0x6'));var fs=require('fs');var path=require(_0xdfbe('0x7'));var rimraf=require(_0xdfbe('0x8'));var config=require(_0xdfbe('0x9'));var attributes=require(_0xdfbe('0xa'));module[_0xdfbe('0xb')]=function(_0x4560b0,_0x571399){return _0x4560b0[_0xdfbe('0xc')](_0xdfbe('0xd'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 4b55bab..60a3d95 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 _0x0d68=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29b875,_0x57dba9){var _0x3ccced=function(_0x23c6f4){while(--_0x23c6f4){_0x29b875['push'](_0x29b875['shift']());}};_0x3ccced(++_0x57dba9);}(_0x0d68,0x99));var _0x80d6=function(_0x23c19a,_0x364398){_0x23c19a=_0x23c19a-0x0;var _0x3a0d46=_0x0d68[_0x23c19a];return _0x3a0d46;};'use strict';var _=require('lodash');var util=require(_0x80d6('0x0'));var moment=require(_0x80d6('0x1'));var BPromise=require(_0x80d6('0x2'));var rs=require(_0x80d6('0x3'));var fs=require('fs');var Redis=require(_0x80d6('0x4'));var db=require(_0x80d6('0x5'))['db'];var utils=require(_0x80d6('0x6'));var logger=require(_0x80d6('0x7'))(_0x80d6('0x8'));var config=require(_0x80d6('0x9'));var jayson=require(_0x80d6('0xa'));var client=jayson[_0x80d6('0xb')][_0x80d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x448400,_0x5f00ee,_0x32d68d){return new BPromise(function(_0x4bc01f,_0x39d2ca){return client[_0x80d6('0xd')](_0x448400,_0x32d68d)[_0x80d6('0xe')](function(_0x5db730){logger[_0x80d6('0xf')](_0x80d6('0x10'),_0x5f00ee,_0x80d6('0x11'));logger[_0x80d6('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5f00ee,_0x80d6('0x11'),JSON['stringify'](_0x5db730));if(_0x5db730[_0x80d6('0x13')]){if(_0x5db730[_0x80d6('0x13')][_0x80d6('0x14')]===0x1f4){logger[_0x80d6('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5f00ee,_0x5db730['error'][_0x80d6('0x15')]);return _0x39d2ca(_0x5db730[_0x80d6('0x13')][_0x80d6('0x15')]);}logger[_0x80d6('0x13')](_0x80d6('0x10'),_0x5f00ee,_0x5db730[_0x80d6('0x13')][_0x80d6('0x15')]);return _0x4bc01f(_0x5db730[_0x80d6('0x13')]['message']);}else{logger[_0x80d6('0xf')](_0x80d6('0x10'),_0x5f00ee,_0x80d6('0x11'));_0x4bc01f(_0x5db730[_0x80d6('0x16')][_0x80d6('0x15')]);}})[_0x80d6('0x17')](function(_0x27ddb4){logger[_0x80d6('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5f00ee,_0x27ddb4);_0x39d2ca(_0x27ddb4);});});} \ No newline at end of file +var _0xeaba=['jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xee4ba3,_0x354cec){var _0x571a72=function(_0x26b43e){while(--_0x26b43e){_0xee4ba3['push'](_0xee4ba3['shift']());}};_0x571a72(++_0x354cec);}(_0xeaba,0x150));var _0xaeab=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xeaba[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xaeab('0x0'));var util=require(_0xaeab('0x1'));var moment=require(_0xaeab('0x2'));var BPromise=require('bluebird');var rs=require(_0xaeab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaeab('0x4'))['db'];var utils=require(_0xaeab('0x5'));var logger=require(_0xaeab('0x6'))(_0xaeab('0x7'));var config=require(_0xaeab('0x8'));var jayson=require(_0xaeab('0x9'));var client=jayson[_0xaeab('0xa')][_0xaeab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a743f,_0xbfbc39,_0x148fd2){return new BPromise(function(_0x4b6f81,_0x703a7d){return client[_0xaeab('0xc')](_0x5a743f,_0x148fd2)[_0xaeab('0xd')](function(_0x5a27e0){logger[_0xaeab('0xe')](_0xaeab('0xf'),_0xbfbc39,_0xaeab('0x10'));logger[_0xaeab('0x11')](_0xaeab('0x12'),_0xbfbc39,'request\x20sent',JSON['stringify'](_0x5a27e0));if(_0x5a27e0[_0xaeab('0x13')]){if(_0x5a27e0['error'][_0xaeab('0x14')]===0x1f4){logger[_0xaeab('0x13')](_0xaeab('0xf'),_0xbfbc39,_0x5a27e0[_0xaeab('0x13')]['message']);return _0x703a7d(_0x5a27e0[_0xaeab('0x13')]['message']);}logger['error'](_0xaeab('0xf'),_0xbfbc39,_0x5a27e0[_0xaeab('0x13')][_0xaeab('0x15')]);return _0x4b6f81(_0x5a27e0['error'][_0xaeab('0x15')]);}else{logger[_0xaeab('0xe')](_0xaeab('0xf'),_0xbfbc39,_0xaeab('0x10'));_0x4b6f81(_0x5a27e0['result']['message']);}})[_0xaeab('0x16')](function(_0x2fac1d){logger[_0xaeab('0x13')](_0xaeab('0xf'),_0xbfbc39,_0x2fac1d);_0x703a7d(_0x2fac1d);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d37a2bc..eea605a 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 _0xaaad=['show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id'];(function(_0x568e87,_0x3e0f07){var _0x5bb7a3=function(_0x5e52fa){while(--_0x5e52fa){_0x568e87['push'](_0x568e87['shift']());}};_0x5bb7a3(++_0x3e0f07);}(_0xaaad,0x64));var _0xdaaa=function(_0x2b416b,_0x272263){_0x2b416b=_0x2b416b-0x0;var _0x3a7468=_0xaaad[_0x2b416b];return _0x3a7468;};'use strict';var multer=require(_0xdaaa('0x0'));var util=require(_0xdaaa('0x1'));var path=require('path');var timeout=require(_0xdaaa('0x2'));var express=require('express');var router=express[_0xdaaa('0x3')]();var fs_extra=require(_0xdaaa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdaaa('0x5'));var config=require('../../config/environment');var controller=require(_0xdaaa('0x6'));router[_0xdaaa('0x7')]('/',auth[_0xdaaa('0x8')](),controller['index']);router[_0xdaaa('0x7')](_0xdaaa('0x9'),auth['isAuthenticated'](),controller[_0xdaaa('0xa')]);router[_0xdaaa('0x7')](_0xdaaa('0xb'),auth[_0xdaaa('0x8')](),controller['getSessions']);router[_0xdaaa('0x7')](_0xdaaa('0xc'),auth[_0xdaaa('0x8')](),controller[_0xdaaa('0xd')]);router[_0xdaaa('0x7')](_0xdaaa('0xe'),auth[_0xdaaa('0x8')](),timeout(_0xdaaa('0xf')),controller['getSummary']);router[_0xdaaa('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdaaa('0x10')](_0xdaaa('0x11'),auth[_0xdaaa('0x8')](),controller[_0xdaaa('0x12')]);router[_0xdaaa('0x13')]('/:id',auth[_0xdaaa('0x8')](),controller[_0xdaaa('0x14')]);router[_0xdaaa('0x15')](_0xdaaa('0x9'),auth[_0xdaaa('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd755=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put'];(function(_0x99e801,_0xa53f83){var _0x8cac87=function(_0x203a4a){while(--_0x203a4a){_0x99e801['push'](_0x99e801['shift']());}};_0x8cac87(++_0xa53f83);}(_0xd755,0x12d));var _0x5d75=function(_0x13f0a2,_0x1b3623){_0x13f0a2=_0x13f0a2-0x0;var _0x4cd0b4=_0xd755[_0x13f0a2];return _0x4cd0b4;};'use strict';var multer=require(_0x5d75('0x0'));var util=require(_0x5d75('0x1'));var path=require(_0x5d75('0x2'));var timeout=require(_0x5d75('0x3'));var express=require('express');var router=express[_0x5d75('0x4')]();var fs_extra=require(_0x5d75('0x5'));var auth=require(_0x5d75('0x6'));var interaction=require(_0x5d75('0x7'));var config=require(_0x5d75('0x8'));var controller=require('./jscriptyProject.controller');router[_0x5d75('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d75('0xa')]);router['get']('/:id',auth[_0x5d75('0xb')](),controller[_0x5d75('0xc')]);router['get'](_0x5d75('0xd'),auth['isAuthenticated'](),controller['getSessions']);router['get'](_0x5d75('0xe'),auth[_0x5d75('0xb')](),controller[_0x5d75('0xf')]);router[_0x5d75('0x9')](_0x5d75('0x10'),auth[_0x5d75('0xb')](),timeout('30s'),controller[_0x5d75('0x11')]);router[_0x5d75('0x12')]('/',auth['isAuthenticated'](),controller[_0x5d75('0x13')]);router[_0x5d75('0x12')](_0x5d75('0x14'),auth[_0x5d75('0xb')](),controller[_0x5d75('0x15')]);router[_0x5d75('0x16')](_0x5d75('0x17'),auth[_0x5d75('0xb')](),controller['update']);router[_0x5d75('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5d75('0x19')]);module[_0x5d75('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index e5b661c..32cb871 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 _0xb6ee=['BOOLEAN','sequelize','lodash','util','exports','STRING','isObjectLike','setDataValue','stringify','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description'];(function(_0x2cbc48,_0x316303){var _0x30f314=function(_0x3e29a1){while(--_0x3e29a1){_0x2cbc48['push'](_0x2cbc48['shift']());}};_0x30f314(++_0x316303);}(_0xb6ee,0x169));var _0xeb6e=function(_0x7a4f2,_0x873d67){_0x7a4f2=_0x7a4f2-0x0;var _0x1eb77f=_0xb6ee[_0x7a4f2];return _0x1eb77f;};'use strict';var Sequelize=require(_0xeb6e('0x0'));var _=require(_0xeb6e('0x1'));var util=require(_0xeb6e('0x2'));module[_0xeb6e('0x3')]={'name':{'type':Sequelize[_0xeb6e('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xeb6e('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x36b7e2){if(_[_0xeb6e('0x5')](_0x36b7e2)){this[_0xeb6e('0x6')]('formData',JSON[_0xeb6e('0x7')](_0x36b7e2));}else if(_['isString'](_0x36b7e2)){this['setDataValue'](_0xeb6e('0x8'),_0x36b7e2);}else{this['setDataValue'](_0xeb6e('0x8'),util[_0xeb6e('0x9')](_0xeb6e('0xa'),this[_0xeb6e('0xb')](_0xeb6e('0xc'))||'',this[_0xeb6e('0xb')](_0xeb6e('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xeb6e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9ce1=['description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name'];(function(_0x584513,_0x37c6c9){var _0xe4a14e=function(_0x4aadc0){while(--_0x4aadc0){_0x584513['push'](_0x584513['shift']());}};_0xe4a14e(++_0x37c6c9);}(_0x9ce1,0x82));var _0x19ce=function(_0x18c731,_0x5a7e88){_0x18c731=_0x18c731-0x0;var _0x33d5cf=_0x9ce1[_0x18c731];return _0x33d5cf;};'use strict';var Sequelize=require(_0x19ce('0x0'));var _=require(_0x19ce('0x1'));var util=require(_0x19ce('0x2'));module[_0x19ce('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x19ce('0x4')]},'formData':{'type':Sequelize[_0x19ce('0x5')](_0x19ce('0x6')),'set':function(_0x3bcc7f){if(_['isObjectLike'](_0x3bcc7f)){this[_0x19ce('0x7')](_0x19ce('0x8'),JSON[_0x19ce('0x9')](_0x3bcc7f));}else if(_['isString'](_0x3bcc7f)){this['setDataValue'](_0x19ce('0x8'),_0x3bcc7f);}else{this[_0x19ce('0x7')](_0x19ce('0x8'),util[_0x19ce('0xa')](_0x19ce('0xb'),this[_0x19ce('0xc')](_0x19ce('0xd'))||'',this[_0x19ce('0xc')](_0x19ce('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x19ce('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 59b4a21..93d4651 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 _0x2572=['toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','Projects','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','rows','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','omit','createdAt','updatedAt','body','role','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode'];(function(_0x2e9e32,_0x4735a9){var _0x3495c9=function(_0x48e03c){while(--_0x48e03c){_0x2e9e32['push'](_0x2e9e32['shift']());}};_0x3495c9(++_0x4735a9);}(_0x2572,0x110));var _0x2257=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2572[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require(_0x2257('0x6'));var Mustache=require(_0x2257('0x7'));var util=require(_0x2257('0x8'));var path=require('path');var sox=require(_0x2257('0x9'));var csv=require(_0x2257('0xa'));var ejs=require(_0x2257('0xb'));var fs=require('fs');var fs_extra=require(_0x2257('0xc'));var _=require(_0x2257('0xd'));var squel=require(_0x2257('0xe'));var crypto=require(_0x2257('0xf'));var jsforce=require(_0x2257('0x10'));var deskjs=require(_0x2257('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2257('0x12'));var Papa=require(_0x2257('0x13'));var Redis=require('ioredis');var authService=require(_0x2257('0x14'));var qs=require(_0x2257('0x15'));var as=require(_0x2257('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2257('0x17'))(_0x2257('0x18'));var utils=require(_0x2257('0x19'));var config=require(_0x2257('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1b'))['db'];function respondWithStatusCode(_0x5131bd,_0x578d2f){_0x578d2f=_0x578d2f||0xcc;return function(_0x7f8b71){if(_0x7f8b71){return _0x5131bd[_0x2257('0x1c')](_0x578d2f);}return _0x5131bd[_0x2257('0x1d')](_0x578d2f)[_0x2257('0x1e')]();};}function respondWithResult(_0x2e610e,_0x32fdfe){_0x32fdfe=_0x32fdfe||0xc8;return function(_0x1738a3){if(_0x1738a3){return _0x2e610e['status'](_0x32fdfe)['json'](_0x1738a3);}};}function respondWithFilteredResult(_0x3578db,_0x45efee){return function(_0x2b4102){if(_0x2b4102){var _0x156d68=typeof _0x45efee['offset']==='undefined'&&typeof _0x45efee[_0x2257('0x1f')]==='undefined';var _0x4cd932=_0x2b4102['count'];var _0x31c8c6=_0x156d68?0x0:_0x45efee[_0x2257('0x20')];var _0x31e8d0=_0x156d68?_0x2b4102[_0x2257('0x21')]:_0x45efee[_0x2257('0x20')]+_0x45efee[_0x2257('0x1f')];var _0x36224b;if(_0x31e8d0>=_0x4cd932){_0x31e8d0=_0x4cd932;_0x36224b=0xc8;}else{_0x36224b=0xce;}_0x3578db[_0x2257('0x1d')](_0x36224b);return _0x3578db[_0x2257('0x22')](_0x2257('0x23'),_0x31c8c6+'-'+_0x31e8d0+'/'+_0x4cd932)[_0x2257('0x24')](_0x2b4102);}return null;};}function patchUpdates(_0x263108){return function(_0x482240){try{jsonpatch[_0x2257('0x25')](_0x482240,_0x263108,!![]);}catch(_0x2e3d19){return BPromise['reject'](_0x2e3d19);}return _0x482240['save']();};}function saveUpdates(_0x56e513,_0x5ae577){return function(_0x31cd98){if(_0x31cd98){return _0x31cd98[_0x2257('0x26')](_0x56e513)[_0x2257('0x27')](function(_0x2a1aa7){return _0x2a1aa7;});}return null;};}function removeEntity(_0x137d53,_0x1e220c){return function(_0x1549aa){if(_0x1549aa){return _0x1549aa[_0x2257('0x28')]()[_0x2257('0x27')](function(){var _0x27a619=_0x1549aa['get']({'plain':!![]});var _0x3ab173=_0x2257('0x29');return db['UserProfileResource'][_0x2257('0x28')]({'where':{'type':_0x3ab173,'resourceId':_0x27a619['id']}})[_0x2257('0x27')](function(){return _0x1549aa;});})['then'](function(){_0x137d53[_0x2257('0x1d')](0xcc)[_0x2257('0x1e')]();});}};}function handleEntityNotFound(_0x4bdc02,_0x387200){return function(_0x40f188){if(!_0x40f188){_0x4bdc02[_0x2257('0x1c')](0x194);}return _0x40f188;};}function handleError(_0x33619a,_0x574c57){_0x574c57=_0x574c57||0x1f4;return function(_0x8b9b1b){logger[_0x2257('0x2a')](_0x8b9b1b['stack']);if(_0x8b9b1b[_0x2257('0x2b')]){delete _0x8b9b1b[_0x2257('0x2b')];}_0x33619a[_0x2257('0x1d')](_0x574c57)[_0x2257('0x2c')](_0x8b9b1b);};}exports[_0x2257('0x2d')]=function(_0x1a491d,_0x3b5372){var _0x43f0b2={},_0x320ead={},_0x54f10b={'count':0x0,'rows':[]};var _0x2a15d9=_[_0x2257('0x2e')](db['JscriptyProject']['rawAttributes'],function(_0x30a71a){return{'name':_0x30a71a[_0x2257('0x2f')],'type':_0x30a71a[_0x2257('0x30')][_0x2257('0x31')]};});_0x320ead[_0x2257('0x32')]=_[_0x2257('0x2e')](_0x2a15d9,'name');_0x320ead[_0x2257('0x33')]=_[_0x2257('0x34')](_0x1a491d[_0x2257('0x33')]);_0x320ead[_0x2257('0x35')]=_['intersection'](_0x320ead[_0x2257('0x32')],_0x320ead['query']);_0x43f0b2['attributes']=_[_0x2257('0x36')](_0x320ead[_0x2257('0x32')],qs[_0x2257('0x37')](_0x1a491d[_0x2257('0x33')][_0x2257('0x37')]));_0x43f0b2[_0x2257('0x38')]=_0x43f0b2[_0x2257('0x38')][_0x2257('0x39')]?_0x43f0b2[_0x2257('0x38')]:_0x320ead[_0x2257('0x32')];if(!_0x1a491d[_0x2257('0x33')][_0x2257('0x3a')](_0x2257('0x3b'))){_0x43f0b2[_0x2257('0x1f')]=qs['limit'](_0x1a491d[_0x2257('0x33')][_0x2257('0x1f')]);_0x43f0b2[_0x2257('0x20')]=qs[_0x2257('0x20')](_0x1a491d[_0x2257('0x33')]['offset']);}_0x43f0b2[_0x2257('0x3c')]=qs[_0x2257('0x3d')](_0x1a491d[_0x2257('0x33')][_0x2257('0x3d')]);_0x43f0b2[_0x2257('0x3e')]=qs[_0x2257('0x35')](_[_0x2257('0x3f')](_0x1a491d[_0x2257('0x33')],_0x320ead[_0x2257('0x35')]),_0x2a15d9);if(_0x1a491d[_0x2257('0x33')][_0x2257('0x40')]){_0x43f0b2[_0x2257('0x3e')]=_[_0x2257('0x41')](_0x43f0b2['where'],{'$or':_[_0x2257('0x2e')](_0x2a15d9,function(_0x312416){if(_0x312416[_0x2257('0x30')]!==_0x2257('0x42')){var _0x6ebead={};_0x6ebead[_0x312416[_0x2257('0x2b')]]={'$like':'%'+_0x1a491d[_0x2257('0x33')][_0x2257('0x40')]+'%'};return _0x6ebead;}})});}_0x43f0b2=_[_0x2257('0x41')]({},_0x43f0b2,_0x1a491d[_0x2257('0x43')]);var _0x510ff7={'where':_0x43f0b2[_0x2257('0x3e')]};return db[_0x2257('0x44')][_0x2257('0x21')](_0x510ff7)['then'](function(_0x22a6ea){_0x54f10b[_0x2257('0x21')]=_0x22a6ea;if(_0x1a491d[_0x2257('0x33')][_0x2257('0x45')]){_0x43f0b2[_0x2257('0x46')]=[{'all':!![]}];}return db[_0x2257('0x44')]['findAll'](_0x43f0b2);})[_0x2257('0x27')](function(_0x2be2ee){_0x54f10b[_0x2257('0x47')]=_0x2be2ee;return _0x54f10b;})[_0x2257('0x27')](respondWithFilteredResult(_0x3b5372,_0x43f0b2))['catch'](handleError(_0x3b5372,null));};exports['show']=function(_0x490a7b,_0x52c23d){var _0xff4e24={'raw':![],'where':{'id':_0x490a7b['params']['id']}},_0x521783={};_0x521783[_0x2257('0x32')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x521783[_0x2257('0x33')]=_[_0x2257('0x34')](_0x490a7b[_0x2257('0x33')]);_0x521783[_0x2257('0x35')]=_[_0x2257('0x36')](_0x521783[_0x2257('0x32')],_0x521783[_0x2257('0x33')]);_0xff4e24['attributes']=_[_0x2257('0x36')](_0x521783['model'],qs[_0x2257('0x37')](_0x490a7b[_0x2257('0x33')][_0x2257('0x37')]));_0xff4e24[_0x2257('0x38')]=_0xff4e24[_0x2257('0x38')][_0x2257('0x39')]?_0xff4e24[_0x2257('0x38')]:_0x521783['model'];if(_0x490a7b[_0x2257('0x33')][_0x2257('0x45')]){_0xff4e24['include']=[{'all':!![]}];}_0xff4e24=_[_0x2257('0x41')]({},_0xff4e24,_0x490a7b['options']);return db[_0x2257('0x44')][_0x2257('0x48')](_0xff4e24)[_0x2257('0x27')](handleEntityNotFound(_0x52c23d,null))[_0x2257('0x27')](respondWithResult(_0x52c23d,null))[_0x2257('0x49')](handleError(_0x52c23d,null));};exports[_0x2257('0x4a')]=function(_0x33ed5a,_0x50c5cb){return db[_0x2257('0x44')][_0x2257('0x4a')](_0x33ed5a['body'],{})[_0x2257('0x27')](function(_0x57ae22){var _0x4b921d=_0x33ed5a[_0x2257('0x4b')][_0x2257('0x4c')]({'plain':!![]});if(!_0x4b921d)throw new Error(_0x2257('0x4d'));if(_0x4b921d['role']===_0x2257('0x4b')){var _0x4cf2b6=_0x57ae22[_0x2257('0x4c')]({'plain':!![]});var _0x53644a=_0x2257('0x29');return db[_0x2257('0x4e')][_0x2257('0x48')]({'where':{'name':_0x53644a,'userProfileId':_0x4b921d[_0x2257('0x4f')]},'raw':!![]})[_0x2257('0x27')](function(_0x22780a){if(_0x22780a&&_0x22780a[_0x2257('0x50')]===0x0){return db[_0x2257('0x51')]['create']({'name':_0x4cf2b6[_0x2257('0x2b')],'resourceId':_0x4cf2b6['id'],'type':_0x22780a[_0x2257('0x2b')],'sectionId':_0x22780a['id']},{})[_0x2257('0x27')](function(){return _0x57ae22;});}else{return _0x57ae22;}})[_0x2257('0x49')](function(_0x3ae279){logger[_0x2257('0x2a')](_0x2257('0x52'),_0x3ae279);throw _0x3ae279;});}return _0x57ae22;})[_0x2257('0x27')](respondWithResult(_0x50c5cb,0xc9))[_0x2257('0x49')](handleError(_0x50c5cb,null));};exports[_0x2257('0x53')]=function(_0x194d90,_0x3aa4bb){var _0x271f2f={'where':{'id':_0x194d90[_0x2257('0x54')]['id']}},_0x594c16={};_0x594c16[_0x2257('0x32')]=_[_0x2257('0x34')](db['JscriptyProject'][_0x2257('0x55')]);_0x271f2f[_0x2257('0x38')]=_[_0x2257('0x36')](_0x594c16['model'],qs[_0x2257('0x37')](_0x194d90[_0x2257('0x33')][_0x2257('0x37')]));_0x271f2f[_0x2257('0x38')]=_0x271f2f[_0x2257('0x38')][_0x2257('0x39')]?_0x271f2f['attributes']:_0x594c16['model'];if(_0x194d90[_0x2257('0x33')][_0x2257('0x45')]){_0x271f2f[_0x2257('0x46')]=[{'all':!![]}];}_0x271f2f=_[_0x2257('0x41')]({},_0x271f2f,_0x194d90[_0x2257('0x43')]);return db[_0x2257('0x44')][_0x2257('0x48')](_0x271f2f)[_0x2257('0x27')](handleEntityNotFound(_0x3aa4bb,null))[_0x2257('0x27')](function(_0x40d926){if(_0x40d926){var _0x44aa84=_0x40d926[_0x2257('0x4c')]({'plain':!![]});_0x44aa84=qs[_0x2257('0x56')](_0x44aa84,['id',_0x2257('0x57'),_0x2257('0x58')]);_0x194d90[_0x2257('0x59')]=_[_0x2257('0x56')](_0x194d90[_0x2257('0x59')],['id',_0x2257('0x57'),'updatedAt']);return db['JscriptyProject']['create'](_[_0x2257('0x41')](_0x44aa84,_0x194d90[_0x2257('0x59')]),{'include':_0x194d90[_0x2257('0x33')][_0x2257('0x45')]?[{'all':!![]}]:undefined})[_0x2257('0x27')](function(_0x412efa){var _0x2241b3=_0x194d90[_0x2257('0x4b')]['get']({'plain':!![]});if(!_0x2241b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2241b3[_0x2257('0x5a')]==='user'){var _0x411d47=_0x412efa['get']({'plain':!![]});var _0x1fe210='Projects';return db[_0x2257('0x4e')][_0x2257('0x48')]({'where':{'name':_0x1fe210,'userProfileId':_0x2241b3[_0x2257('0x4f')]},'raw':!![]})[_0x2257('0x27')](function(_0x22c4ea){if(_0x22c4ea&&_0x22c4ea[_0x2257('0x50')]===0x0){return db[_0x2257('0x51')][_0x2257('0x4a')]({'name':_0x411d47['name'],'resourceId':_0x411d47['id'],'type':_0x22c4ea[_0x2257('0x2b')],'sectionId':_0x22c4ea['id']},{})[_0x2257('0x27')](function(){return _0x412efa;});}else{return _0x412efa;}})[_0x2257('0x49')](function(_0xdb72ad){logger[_0x2257('0x2a')](_0x2257('0x52'),_0xdb72ad);throw _0xdb72ad;});}return _0x412efa;});}})[_0x2257('0x27')](respondWithResult(_0x3aa4bb,0xc9))['catch'](handleError(_0x3aa4bb,null));};exports[_0x2257('0x26')]=function(_0xa07de9,_0x35de68){if(_0xa07de9[_0x2257('0x59')]['id']){delete _0xa07de9[_0x2257('0x59')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0xa07de9['params']['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x35de68,null))[_0x2257('0x27')](saveUpdates(_0xa07de9[_0x2257('0x59')],null))[_0x2257('0x27')](respondWithResult(_0x35de68,null))[_0x2257('0x49')](handleError(_0x35de68,null));};exports[_0x2257('0x28')]=function(_0x364303,_0x2bca07){return db['JscriptyProject'][_0x2257('0x48')]({'where':{'id':_0x364303[_0x2257('0x54')]['id']}})['then'](handleEntityNotFound(_0x2bca07,null))[_0x2257('0x27')](removeEntity(_0x2bca07,null))[_0x2257('0x49')](handleError(_0x2bca07,null));};exports[_0x2257('0x5b')]=function(_0x2acfc1,_0xe33530,_0x285b0a){var _0x1e4b15={'raw':!![],'where':{}};var _0x4e6a59={};var _0x5b1972={'count':0x0,'rows':[]};return db[_0x2257('0x44')][_0x2257('0x5c')]({'where':{'id':_0x2acfc1['params']['id']}})[_0x2257('0x27')](handleEntityNotFound(_0xe33530,null))['then'](function(_0x1a9935){if(_0x1a9935){_0x4e6a59[_0x2257('0x32')]=_[_0x2257('0x34')](db[_0x2257('0x5d')][_0x2257('0x55')]);_0x4e6a59[_0x2257('0x33')]=_['keys'](_0x2acfc1['query']);_0x4e6a59[_0x2257('0x35')]=_[_0x2257('0x36')](_0x4e6a59[_0x2257('0x32')],_0x4e6a59[_0x2257('0x33')]);_0x1e4b15[_0x2257('0x38')]=_[_0x2257('0x36')](_0x4e6a59[_0x2257('0x32')],qs['fields'](_0x2acfc1['query']['fields']));_0x1e4b15['attributes']=_0x1e4b15[_0x2257('0x38')][_0x2257('0x39')]?_0x1e4b15['attributes']:_0x4e6a59[_0x2257('0x32')];if(!_0x2acfc1[_0x2257('0x33')][_0x2257('0x3a')]('nolimit')){_0x1e4b15[_0x2257('0x1f')]=qs['limit'](_0x2acfc1[_0x2257('0x33')][_0x2257('0x1f')]);_0x1e4b15[_0x2257('0x20')]=qs[_0x2257('0x20')](_0x2acfc1[_0x2257('0x33')]['offset']);}_0x1e4b15[_0x2257('0x3c')]=qs['sort'](_0x2acfc1[_0x2257('0x33')]['sort']);_0x1e4b15[_0x2257('0x3e')]=qs[_0x2257('0x35')](_[_0x2257('0x3f')](_0x2acfc1[_0x2257('0x33')],_0x4e6a59[_0x2257('0x35')]));_0x1e4b15[_0x2257('0x3e')][_0x2257('0x5e')]=_0x1a9935['id'];if(_0x2acfc1[_0x2257('0x33')][_0x2257('0x40')]){_0x1e4b15['where']=_[_0x2257('0x41')](_0x1e4b15['where'],{'$or':_[_0x2257('0x2e')](_0x1e4b15[_0x2257('0x38')],function(_0x38ffdf){var _0xc5eae9={};_0xc5eae9[_0x38ffdf]={'$like':'%'+_0x2acfc1[_0x2257('0x33')][_0x2257('0x40')]+'%'};return _0xc5eae9;})});}_0x1e4b15=_[_0x2257('0x41')]({},_0x1e4b15,_0x2acfc1['options']);return db['JscriptySessionReport'][_0x2257('0x21')]({'where':_0x1e4b15[_0x2257('0x3e')]})[_0x2257('0x27')](function(_0x542c31){_0x5b1972[_0x2257('0x21')]=_0x542c31;if(_0x2acfc1[_0x2257('0x33')][_0x2257('0x45')]){_0x1e4b15[_0x2257('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2257('0x5f')](_0x1e4b15);})[_0x2257('0x27')](function(_0x391416){_0x5b1972[_0x2257('0x47')]=_0x391416;return _0x5b1972;});}})[_0x2257('0x27')](respondWithFilteredResult(_0xe33530,_0x1e4b15))[_0x2257('0x49')](handleError(_0xe33530,null));};exports[_0x2257('0x60')]=function(_0x57a959,_0x1f92dd,_0x15cafb){var _0x216434={'raw':!![],'where':{}};var _0x39986d={};var _0x4f9d72={'count':0x0,'rows':[]};return db[_0x2257('0x44')]['findOne']({'where':{'id':_0x57a959['params']['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x1f92dd,null))[_0x2257('0x27')](function(_0x909078){if(_0x909078){_0x39986d[_0x2257('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0x2257('0x55')]);_0x39986d[_0x2257('0x33')]=_['keys'](_0x57a959[_0x2257('0x33')]);_0x39986d[_0x2257('0x35')]=_['intersection'](_0x39986d[_0x2257('0x32')],_0x39986d['query']);_0x216434[_0x2257('0x38')]=_[_0x2257('0x36')](_0x39986d[_0x2257('0x32')],qs['fields'](_0x57a959[_0x2257('0x33')][_0x2257('0x37')]));_0x216434[_0x2257('0x38')]=_0x216434[_0x2257('0x38')][_0x2257('0x39')]?_0x216434[_0x2257('0x38')]:_0x39986d[_0x2257('0x32')];if(!_0x57a959[_0x2257('0x33')][_0x2257('0x3a')](_0x2257('0x3b'))){_0x216434[_0x2257('0x1f')]=qs['limit'](_0x57a959['query'][_0x2257('0x1f')]);_0x216434[_0x2257('0x20')]=qs[_0x2257('0x20')](_0x57a959[_0x2257('0x33')][_0x2257('0x20')]);}_0x216434[_0x2257('0x3c')]=qs['sort'](_0x57a959['query'][_0x2257('0x3d')]);_0x216434['where']=qs['filters'](_[_0x2257('0x3f')](_0x57a959[_0x2257('0x33')],_0x39986d[_0x2257('0x35')]));_0x216434[_0x2257('0x3e')][_0x2257('0x5e')]=_0x909078['id'];if(_0x57a959[_0x2257('0x33')][_0x2257('0x40')]){_0x216434[_0x2257('0x3e')]=_[_0x2257('0x41')](_0x216434[_0x2257('0x3e')],{'$or':_[_0x2257('0x2e')](_0x216434[_0x2257('0x38')],function(_0x3b3c89){var _0x44682d={};_0x44682d[_0x3b3c89]={'$like':'%'+_0x57a959['query'][_0x2257('0x40')]+'%'};return _0x44682d;})});}_0x216434=_[_0x2257('0x41')]({},_0x216434,_0x57a959['options']);return db[_0x2257('0x61')][_0x2257('0x21')]({'where':_0x216434['where']})['then'](function(_0x4d0606){_0x4f9d72[_0x2257('0x21')]=_0x4d0606;if(_0x57a959[_0x2257('0x33')][_0x2257('0x45')]){_0x216434[_0x2257('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x2257('0x5f')](_0x216434);})['then'](function(_0x6befa3){_0x4f9d72[_0x2257('0x47')]=_0x6befa3;return _0x4f9d72;});}})['then'](respondWithFilteredResult(_0x1f92dd,_0x216434))[_0x2257('0x49')](handleError(_0x1f92dd,null));};function char(_0x20f694){return _0x2257('0x62')===typeof _0x20f694?String[_0x2257('0x63')][_0x2257('0x25')](null,arguments):_0x20f694;}function needsEncapsulation(_0x32ea56){return!!_0x32ea56&&(_0x32ea56[_0x2257('0x64')]()[_0x2257('0x65')](char(0xd))>=0x0||_0x32ea56[_0x2257('0x64')]()[_0x2257('0x65')](char(0xa))>=0x0||_0x32ea56['toString']()[_0x2257('0x65')](char(0x2c))>=0x0||_0x32ea56['toString']()[_0x2257('0x65')](char(0x22))>=0x0);}function encapsulate(_0x2b5434){var _0x11e059=char(0x22),_0x397bb1='\x5c'+char(0x22),_0x195a5b=_0x2b5434[_0x2257('0x64')]()['replace'](new RegExp(_0x11e059,'g'),_0x397bb1);return _0x11e059+_0x195a5b+_0x11e059;}exports[_0x2257('0x66')]=function(_0x1efe01,_0x28133d,_0x58546f){var _0x135812,_0xf17dca;var _0x17a0ab={'where':{'ProjectId':_0x1efe01[_0x2257('0x54')]['id']}};if(_0x1efe01[_0x2257('0x33')][_0x2257('0x67')]){_0x17a0ab['where'][_0x2257('0x68')]=JSON[_0x2257('0x69')](_0x1efe01['query'][_0x2257('0x67')]);}return db['JscriptySessionReport'][_0x2257('0x5f')](_0x17a0ab)['then'](handleEntityNotFound(_0x28133d,null))[_0x2257('0x27')](function(_0x27e6f6){if(_0x27e6f6){_0x135812=_0x27e6f6;return db[_0x2257('0x6a')]['findAll']({'where':{'SessionId':{'$in':_[_0x2257('0x2e')](_0x135812,'id')},'ProjectId':_0x1efe01[_0x2257('0x54')]['id']},'order':_0x2257('0x6b')});}})[_0x2257('0x27')](handleEntityNotFound(_0x28133d,null))['then'](function(_0xd5e4c3){if(_0xd5e4c3){_0xf17dca=_0xd5e4c3;var _0x3d8d86={};for(var _0x4f0fe4=0x0,_0x27a334=_0xf17dca[_0x2257('0x39')];_0x4f0fe4<_0x27a334;_0x4f0fe4++){if(!_0x3d8d86['hasOwnProperty'](_0xf17dca[_0x4f0fe4][_0x2257('0x6c')])){_0x3d8d86[_0xf17dca[_0x4f0fe4][_0x2257('0x6c')]]=needsEncapsulation(_0xf17dca[_0x4f0fe4][_0x2257('0x6d')])?encapsulate(_0xf17dca[_0x4f0fe4]['question']):_0xf17dca[_0x4f0fe4][_0x2257('0x6d')];}}var _0x20c7fb=[],_0x1c5b02={};for(var _0x43f407=0x0,_0x236034=_0x135812['length'];_0x43f407<_0x236034;_0x43f407++){_0x1c5b02={'ProjectId':_0x1efe01[_0x2257('0x54')]['id'],'SessionId':_0x135812[_0x43f407]['id'],'StartTime':moment(_0x135812[_0x43f407][_0x2257('0x68')])[_0x2257('0x6e')](_0x2257('0x6f'))};for(var _0x36cd1b=0x0,_0x57fbd8=_0xf17dca[_0x2257('0x39')];_0x36cd1b<_0x57fbd8;_0x36cd1b++){if(_0xf17dca[_0x36cd1b]['SessionId']==_0x135812[_0x43f407]['id']&&_0x3d8d86[_0x2257('0x3a')](_0xf17dca[_0x36cd1b]['questionId'])){_0x1c5b02[_0x3d8d86[_0xf17dca[_0x36cd1b]['questionId']]]=_0xf17dca[_0x36cd1b][_0x2257('0x70')];}}for(var _0x393af1 in _0x3d8d86){if(!_0x1c5b02[_0x2257('0x3a')](_0x3d8d86[_0x393af1])){_0x1c5b02[_0x3d8d86[_0x393af1]]=null;}}_0x20c7fb[_0x2257('0x71')](_0x1c5b02);}return _0x20c7fb;}})['then'](function(_0x11053d){if(!_[_0x2257('0x72')](_0x11053d)){var _0x455fcd=toCsv(_0x11053d);var _0x15658a=Date[_0x2257('0x73')]();fs[_0x2257('0x74')](util[_0x2257('0x6e')](_0x2257('0x75'),_0x1efe01[_0x2257('0x54')]['id'],_0x15658a),_0x455fcd);_0x28133d[_0x2257('0x76')](_0x2257('0x77'),_0x2257('0x78')+util[_0x2257('0x6e')](_0x2257('0x79'),_0x1efe01[_0x2257('0x54')]['id'],_0x15658a));_0x28133d['setHeader']('Content-type',_0x2257('0x7a'));return _0x28133d[_0x2257('0x7b')](util[_0x2257('0x6e')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1efe01[_0x2257('0x54')]['id'],_0x15658a));}else{return _0x28133d['sendStatus'](0xcc);}})[_0x2257('0x49')](handleError(_0x28133d,null));}; \ No newline at end of file +var _0x5523=['Projects','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','includeAll','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','SessionId','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x5523,0x137));var _0x3552=function(_0x3e47d0,_0x5e7626){_0x3e47d0=_0x3e47d0-0x0;var _0x2a68e1=_0x5523[_0x3e47d0];return _0x2a68e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3552('0x0'));var jsonpatch=require(_0x3552('0x1'));var rp=require(_0x3552('0x2'));var moment=require(_0x3552('0x3'));var BPromise=require(_0x3552('0x4'));var Mustache=require(_0x3552('0x5'));var util=require(_0x3552('0x6'));var path=require(_0x3552('0x7'));var sox=require(_0x3552('0x8'));var csv=require(_0x3552('0x9'));var ejs=require(_0x3552('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3552('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3552('0xc'));var toCsv=require(_0x3552('0x9'));var querystring=require(_0x3552('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3552('0xe'));var qs=require(_0x3552('0xf'));var as=require(_0x3552('0x10'));var hardwareService=require(_0x3552('0x11'));var logger=require(_0x3552('0x12'))(_0x3552('0x13'));var utils=require(_0x3552('0x14'));var config=require(_0x3552('0x15'));var licenseUtil=require(_0x3552('0x16'));var db=require(_0x3552('0x17'))['db'];function respondWithStatusCode(_0xae728b,_0x549df0){_0x549df0=_0x549df0||0xcc;return function(_0x295d0d){if(_0x295d0d){return _0xae728b[_0x3552('0x18')](_0x549df0);}return _0xae728b[_0x3552('0x19')](_0x549df0)['end']();};}function respondWithResult(_0x538549,_0x123c8e){_0x123c8e=_0x123c8e||0xc8;return function(_0x3e90fc){if(_0x3e90fc){return _0x538549[_0x3552('0x19')](_0x123c8e)[_0x3552('0x1a')](_0x3e90fc);}};}function respondWithFilteredResult(_0x50813d,_0x3b9f0a){return function(_0x268d39){if(_0x268d39){var _0x31dd12=typeof _0x3b9f0a[_0x3552('0x1b')]==='undefined'&&typeof _0x3b9f0a[_0x3552('0x1c')]===_0x3552('0x1d');var _0xcc111c=_0x268d39['count'];var _0x2375c9=_0x31dd12?0x0:_0x3b9f0a[_0x3552('0x1b')];var _0x586e1f=_0x31dd12?_0x268d39[_0x3552('0x1e')]:_0x3b9f0a[_0x3552('0x1b')]+_0x3b9f0a[_0x3552('0x1c')];var _0x42fe33;if(_0x586e1f>=_0xcc111c){_0x586e1f=_0xcc111c;_0x42fe33=0xc8;}else{_0x42fe33=0xce;}_0x50813d['status'](_0x42fe33);return _0x50813d[_0x3552('0x1f')](_0x3552('0x20'),_0x2375c9+'-'+_0x586e1f+'/'+_0xcc111c)['json'](_0x268d39);}return null;};}function patchUpdates(_0x26984c){return function(_0x443bab){try{jsonpatch[_0x3552('0x21')](_0x443bab,_0x26984c,!![]);}catch(_0x404b40){return BPromise[_0x3552('0x22')](_0x404b40);}return _0x443bab['save']();};}function saveUpdates(_0x2fe62c,_0x4ea201){return function(_0x42a3d3){if(_0x42a3d3){return _0x42a3d3['update'](_0x2fe62c)[_0x3552('0x23')](function(_0x3ddfb3){return _0x3ddfb3;});}return null;};}function removeEntity(_0x5355e4,_0x1f80b5){return function(_0x534c68){if(_0x534c68){return _0x534c68[_0x3552('0x24')]()['then'](function(){var _0x1972b7=_0x534c68['get']({'plain':!![]});var _0x11c23f=_0x3552('0x25');return db[_0x3552('0x26')][_0x3552('0x24')]({'where':{'type':_0x11c23f,'resourceId':_0x1972b7['id']}})[_0x3552('0x23')](function(){return _0x534c68;});})[_0x3552('0x23')](function(){_0x5355e4[_0x3552('0x19')](0xcc)[_0x3552('0x27')]();});}};}function handleEntityNotFound(_0x5028e1,_0x5d93f6){return function(_0x7d75aa){if(!_0x7d75aa){_0x5028e1['sendStatus'](0x194);}return _0x7d75aa;};}function handleError(_0x29dc07,_0x43d239){_0x43d239=_0x43d239||0x1f4;return function(_0x914ffc){logger[_0x3552('0x28')](_0x914ffc[_0x3552('0x29')]);if(_0x914ffc['name']){delete _0x914ffc[_0x3552('0x2a')];}_0x29dc07[_0x3552('0x19')](_0x43d239)[_0x3552('0x2b')](_0x914ffc);};}exports[_0x3552('0x2c')]=function(_0x212185,_0x52220d){var _0x32b45f={},_0x144d92={},_0x4bbe07={'count':0x0,'rows':[]};var _0xa8952e=_['map'](db['JscriptyProject'][_0x3552('0x2d')],function(_0xe41ad6){return{'name':_0xe41ad6[_0x3552('0x2e')],'type':_0xe41ad6[_0x3552('0x2f')][_0x3552('0x30')]};});_0x144d92[_0x3552('0x31')]=_[_0x3552('0x32')](_0xa8952e,_0x3552('0x2a'));_0x144d92['query']=_['keys'](_0x212185['query']);_0x144d92[_0x3552('0x33')]=_[_0x3552('0x34')](_0x144d92['model'],_0x144d92['query']);_0x32b45f[_0x3552('0x35')]=_[_0x3552('0x34')](_0x144d92[_0x3552('0x31')],qs[_0x3552('0x36')](_0x212185[_0x3552('0x37')][_0x3552('0x36')]));_0x32b45f[_0x3552('0x35')]=_0x32b45f['attributes'][_0x3552('0x38')]?_0x32b45f[_0x3552('0x35')]:_0x144d92[_0x3552('0x31')];if(!_0x212185[_0x3552('0x37')][_0x3552('0x39')]('nolimit')){_0x32b45f[_0x3552('0x1c')]=qs['limit'](_0x212185[_0x3552('0x37')]['limit']);_0x32b45f[_0x3552('0x1b')]=qs[_0x3552('0x1b')](_0x212185[_0x3552('0x37')][_0x3552('0x1b')]);}_0x32b45f[_0x3552('0x3a')]=qs[_0x3552('0x3b')](_0x212185[_0x3552('0x37')][_0x3552('0x3b')]);_0x32b45f[_0x3552('0x3c')]=qs[_0x3552('0x33')](_[_0x3552('0x3d')](_0x212185[_0x3552('0x37')],_0x144d92['filters']),_0xa8952e);if(_0x212185[_0x3552('0x37')][_0x3552('0x3e')]){_0x32b45f[_0x3552('0x3c')]=_[_0x3552('0x3f')](_0x32b45f[_0x3552('0x3c')],{'$or':_['map'](_0xa8952e,function(_0x36d84b){if(_0x36d84b['type']!==_0x3552('0x40')){var _0x1e8d10={};_0x1e8d10[_0x36d84b['name']]={'$like':'%'+_0x212185[_0x3552('0x37')][_0x3552('0x3e')]+'%'};return _0x1e8d10;}})});}_0x32b45f=_[_0x3552('0x3f')]({},_0x32b45f,_0x212185[_0x3552('0x41')]);var _0xaab25d={'where':_0x32b45f[_0x3552('0x3c')]};return db[_0x3552('0x42')][_0x3552('0x1e')](_0xaab25d)[_0x3552('0x23')](function(_0x142da0){_0x4bbe07[_0x3552('0x1e')]=_0x142da0;if(_0x212185[_0x3552('0x37')]['includeAll']){_0x32b45f[_0x3552('0x43')]=[{'all':!![]}];}return db[_0x3552('0x42')][_0x3552('0x44')](_0x32b45f);})[_0x3552('0x23')](function(_0x45973b){_0x4bbe07[_0x3552('0x45')]=_0x45973b;return _0x4bbe07;})[_0x3552('0x23')](respondWithFilteredResult(_0x52220d,_0x32b45f))[_0x3552('0x46')](handleError(_0x52220d,null));};exports['show']=function(_0x1631d0,_0x3e9921){var _0x200fe8={'raw':![],'where':{'id':_0x1631d0[_0x3552('0x47')]['id']}},_0x38290f={};_0x38290f[_0x3552('0x31')]=_[_0x3552('0x48')](db['JscriptyProject'][_0x3552('0x2d')]);_0x38290f[_0x3552('0x37')]=_[_0x3552('0x48')](_0x1631d0[_0x3552('0x37')]);_0x38290f[_0x3552('0x33')]=_[_0x3552('0x34')](_0x38290f[_0x3552('0x31')],_0x38290f[_0x3552('0x37')]);_0x200fe8['attributes']=_[_0x3552('0x34')](_0x38290f[_0x3552('0x31')],qs[_0x3552('0x36')](_0x1631d0[_0x3552('0x37')][_0x3552('0x36')]));_0x200fe8[_0x3552('0x35')]=_0x200fe8[_0x3552('0x35')][_0x3552('0x38')]?_0x200fe8[_0x3552('0x35')]:_0x38290f['model'];if(_0x1631d0[_0x3552('0x37')]['includeAll']){_0x200fe8[_0x3552('0x43')]=[{'all':!![]}];}_0x200fe8=_[_0x3552('0x3f')]({},_0x200fe8,_0x1631d0['options']);return db['JscriptyProject'][_0x3552('0x49')](_0x200fe8)[_0x3552('0x23')](handleEntityNotFound(_0x3e9921,null))['then'](respondWithResult(_0x3e9921,null))[_0x3552('0x46')](handleError(_0x3e9921,null));};exports[_0x3552('0x4a')]=function(_0x68222b,_0x71ca89){return db[_0x3552('0x42')]['create'](_0x68222b[_0x3552('0x4b')],{})[_0x3552('0x23')](function(_0x40c412){var _0x4eff7a=_0x68222b[_0x3552('0x4c')][_0x3552('0x4d')]({'plain':!![]});if(!_0x4eff7a)throw new Error(_0x3552('0x4e'));if(_0x4eff7a[_0x3552('0x4f')]===_0x3552('0x4c')){var _0x2f94e4=_0x40c412[_0x3552('0x4d')]({'plain':!![]});var _0x3b78b8=_0x3552('0x25');return db[_0x3552('0x50')][_0x3552('0x49')]({'where':{'name':_0x3b78b8,'userProfileId':_0x4eff7a[_0x3552('0x51')]},'raw':!![]})['then'](function(_0x1bfc84){if(_0x1bfc84&&_0x1bfc84[_0x3552('0x52')]===0x0){return db[_0x3552('0x26')][_0x3552('0x4a')]({'name':_0x2f94e4[_0x3552('0x2a')],'resourceId':_0x2f94e4['id'],'type':_0x1bfc84['name'],'sectionId':_0x1bfc84['id']},{})['then'](function(){return _0x40c412;});}else{return _0x40c412;}})[_0x3552('0x46')](function(_0x42c63d){logger[_0x3552('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42c63d);throw _0x42c63d;});}return _0x40c412;})['then'](respondWithResult(_0x71ca89,0xc9))['catch'](handleError(_0x71ca89,null));};exports[_0x3552('0x53')]=function(_0x4ad6e5,_0x5daef7){var _0xc7d21e={'where':{'id':_0x4ad6e5[_0x3552('0x47')]['id']}},_0x2e43eb={};_0x2e43eb[_0x3552('0x31')]=_['keys'](db[_0x3552('0x42')][_0x3552('0x2d')]);_0xc7d21e[_0x3552('0x35')]=_[_0x3552('0x34')](_0x2e43eb[_0x3552('0x31')],qs[_0x3552('0x36')](_0x4ad6e5['query'][_0x3552('0x36')]));_0xc7d21e[_0x3552('0x35')]=_0xc7d21e[_0x3552('0x35')][_0x3552('0x38')]?_0xc7d21e['attributes']:_0x2e43eb[_0x3552('0x31')];if(_0x4ad6e5[_0x3552('0x37')][_0x3552('0x54')]){_0xc7d21e[_0x3552('0x43')]=[{'all':!![]}];}_0xc7d21e=_[_0x3552('0x3f')]({},_0xc7d21e,_0x4ad6e5[_0x3552('0x41')]);return db['JscriptyProject'][_0x3552('0x49')](_0xc7d21e)['then'](handleEntityNotFound(_0x5daef7,null))['then'](function(_0x2a7d99){if(_0x2a7d99){var _0x306e98=_0x2a7d99[_0x3552('0x4d')]({'plain':!![]});_0x306e98=qs['omit'](_0x306e98,['id','createdAt','updatedAt']);_0x4ad6e5['body']=_['omit'](_0x4ad6e5[_0x3552('0x4b')],['id',_0x3552('0x55'),_0x3552('0x56')]);return db[_0x3552('0x42')][_0x3552('0x4a')](_[_0x3552('0x3f')](_0x306e98,_0x4ad6e5['body']),{'include':_0x4ad6e5['query']['includeAll']?[{'all':!![]}]:undefined})[_0x3552('0x23')](function(_0x318e4c){var _0x4a40a3=_0x4ad6e5['user'][_0x3552('0x4d')]({'plain':!![]});if(!_0x4a40a3)throw new Error(_0x3552('0x4e'));if(_0x4a40a3['role']==='user'){var _0x1039b0=_0x318e4c[_0x3552('0x4d')]({'plain':!![]});var _0x28e503='Projects';return db[_0x3552('0x50')][_0x3552('0x49')]({'where':{'name':_0x28e503,'userProfileId':_0x4a40a3['userProfileId']},'raw':!![]})['then'](function(_0x5e1181){if(_0x5e1181&&_0x5e1181['autoAssociation']===0x0){return db[_0x3552('0x26')][_0x3552('0x4a')]({'name':_0x1039b0[_0x3552('0x2a')],'resourceId':_0x1039b0['id'],'type':_0x5e1181[_0x3552('0x2a')],'sectionId':_0x5e1181['id']},{})[_0x3552('0x23')](function(){return _0x318e4c;});}else{return _0x318e4c;}})['catch'](function(_0x4eaaa8){logger['error'](_0x3552('0x57'),_0x4eaaa8);throw _0x4eaaa8;});}return _0x318e4c;});}})['then'](respondWithResult(_0x5daef7,0xc9))[_0x3552('0x46')](handleError(_0x5daef7,null));};exports[_0x3552('0x58')]=function(_0x8a4545,_0x4bf9ff){if(_0x8a4545[_0x3552('0x4b')]['id']){delete _0x8a4545[_0x3552('0x4b')]['id'];}return db[_0x3552('0x42')]['find']({'where':{'id':_0x8a4545[_0x3552('0x47')]['id']}})[_0x3552('0x23')](handleEntityNotFound(_0x4bf9ff,null))[_0x3552('0x23')](saveUpdates(_0x8a4545['body'],null))[_0x3552('0x23')](respondWithResult(_0x4bf9ff,null))['catch'](handleError(_0x4bf9ff,null));};exports[_0x3552('0x24')]=function(_0x4e37d0,_0x571322){return db[_0x3552('0x42')]['find']({'where':{'id':_0x4e37d0['params']['id']}})[_0x3552('0x23')](handleEntityNotFound(_0x571322,null))[_0x3552('0x23')](removeEntity(_0x571322,null))[_0x3552('0x46')](handleError(_0x571322,null));};exports[_0x3552('0x59')]=function(_0x763317,_0x1da9c0,_0x1d345c){var _0x4702bc={'raw':!![],'where':{}};var _0x27aa33={};var _0x1eacba={'count':0x0,'rows':[]};return db[_0x3552('0x42')][_0x3552('0x5a')]({'where':{'id':_0x763317['params']['id']}})[_0x3552('0x23')](handleEntityNotFound(_0x1da9c0,null))[_0x3552('0x23')](function(_0x185a1a){if(_0x185a1a){_0x27aa33[_0x3552('0x31')]=_[_0x3552('0x48')](db[_0x3552('0x5b')]['rawAttributes']);_0x27aa33['query']=_[_0x3552('0x48')](_0x763317[_0x3552('0x37')]);_0x27aa33[_0x3552('0x33')]=_[_0x3552('0x34')](_0x27aa33[_0x3552('0x31')],_0x27aa33['query']);_0x4702bc[_0x3552('0x35')]=_[_0x3552('0x34')](_0x27aa33[_0x3552('0x31')],qs[_0x3552('0x36')](_0x763317[_0x3552('0x37')][_0x3552('0x36')]));_0x4702bc[_0x3552('0x35')]=_0x4702bc[_0x3552('0x35')][_0x3552('0x38')]?_0x4702bc[_0x3552('0x35')]:_0x27aa33[_0x3552('0x31')];if(!_0x763317[_0x3552('0x37')]['hasOwnProperty'](_0x3552('0x5c'))){_0x4702bc[_0x3552('0x1c')]=qs[_0x3552('0x1c')](_0x763317[_0x3552('0x37')]['limit']);_0x4702bc[_0x3552('0x1b')]=qs['offset'](_0x763317[_0x3552('0x37')][_0x3552('0x1b')]);}_0x4702bc['order']=qs['sort'](_0x763317[_0x3552('0x37')][_0x3552('0x3b')]);_0x4702bc[_0x3552('0x3c')]=qs['filters'](_['pick'](_0x763317[_0x3552('0x37')],_0x27aa33[_0x3552('0x33')]));_0x4702bc[_0x3552('0x3c')][_0x3552('0x5d')]=_0x185a1a['id'];if(_0x763317[_0x3552('0x37')]['filter']){_0x4702bc[_0x3552('0x3c')]=_[_0x3552('0x3f')](_0x4702bc[_0x3552('0x3c')],{'$or':_[_0x3552('0x32')](_0x4702bc[_0x3552('0x35')],function(_0x17d06f){var _0x49f6ba={};_0x49f6ba[_0x17d06f]={'$like':'%'+_0x763317[_0x3552('0x37')]['filter']+'%'};return _0x49f6ba;})});}_0x4702bc=_[_0x3552('0x3f')]({},_0x4702bc,_0x763317[_0x3552('0x41')]);return db[_0x3552('0x5b')]['count']({'where':_0x4702bc[_0x3552('0x3c')]})['then'](function(_0x497a35){_0x1eacba[_0x3552('0x1e')]=_0x497a35;if(_0x763317[_0x3552('0x37')]['includeAll']){_0x4702bc['include']=[{'all':!![]}];}return db[_0x3552('0x5b')]['findAll'](_0x4702bc);})['then'](function(_0x1a43b4){_0x1eacba['rows']=_0x1a43b4;return _0x1eacba;});}})[_0x3552('0x23')](respondWithFilteredResult(_0x1da9c0,_0x4702bc))[_0x3552('0x46')](handleError(_0x1da9c0,null));};exports['getAnswers']=function(_0x2960a2,_0x53bf9e,_0x39efa7){var _0x3db63d={'raw':!![],'where':{}};var _0x1566ab={};var _0x46c6f1={'count':0x0,'rows':[]};return db[_0x3552('0x42')][_0x3552('0x5a')]({'where':{'id':_0x2960a2[_0x3552('0x47')]['id']}})['then'](handleEntityNotFound(_0x53bf9e,null))[_0x3552('0x23')](function(_0x336b58){if(_0x336b58){_0x1566ab['model']=_['keys'](db['JscriptyAnswerReport'][_0x3552('0x2d')]);_0x1566ab[_0x3552('0x37')]=_[_0x3552('0x48')](_0x2960a2[_0x3552('0x37')]);_0x1566ab[_0x3552('0x33')]=_[_0x3552('0x34')](_0x1566ab[_0x3552('0x31')],_0x1566ab[_0x3552('0x37')]);_0x3db63d['attributes']=_[_0x3552('0x34')](_0x1566ab[_0x3552('0x31')],qs[_0x3552('0x36')](_0x2960a2['query'][_0x3552('0x36')]));_0x3db63d[_0x3552('0x35')]=_0x3db63d[_0x3552('0x35')][_0x3552('0x38')]?_0x3db63d[_0x3552('0x35')]:_0x1566ab['model'];if(!_0x2960a2['query']['hasOwnProperty'](_0x3552('0x5c'))){_0x3db63d[_0x3552('0x1c')]=qs[_0x3552('0x1c')](_0x2960a2[_0x3552('0x37')]['limit']);_0x3db63d[_0x3552('0x1b')]=qs['offset'](_0x2960a2[_0x3552('0x37')][_0x3552('0x1b')]);}_0x3db63d['order']=qs[_0x3552('0x3b')](_0x2960a2[_0x3552('0x37')]['sort']);_0x3db63d['where']=qs[_0x3552('0x33')](_[_0x3552('0x3d')](_0x2960a2['query'],_0x1566ab[_0x3552('0x33')]));_0x3db63d[_0x3552('0x3c')][_0x3552('0x5d')]=_0x336b58['id'];if(_0x2960a2[_0x3552('0x37')][_0x3552('0x3e')]){_0x3db63d[_0x3552('0x3c')]=_['merge'](_0x3db63d[_0x3552('0x3c')],{'$or':_[_0x3552('0x32')](_0x3db63d[_0x3552('0x35')],function(_0x88b8a2){var _0x45f44a={};_0x45f44a[_0x88b8a2]={'$like':'%'+_0x2960a2['query'][_0x3552('0x3e')]+'%'};return _0x45f44a;})});}_0x3db63d=_[_0x3552('0x3f')]({},_0x3db63d,_0x2960a2[_0x3552('0x41')]);return db[_0x3552('0x5e')][_0x3552('0x1e')]({'where':_0x3db63d[_0x3552('0x3c')]})[_0x3552('0x23')](function(_0xe4f31d){_0x46c6f1[_0x3552('0x1e')]=_0xe4f31d;if(_0x2960a2[_0x3552('0x37')][_0x3552('0x54')]){_0x3db63d[_0x3552('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3552('0x44')](_0x3db63d);})[_0x3552('0x23')](function(_0x4044c5){_0x46c6f1[_0x3552('0x45')]=_0x4044c5;return _0x46c6f1;});}})[_0x3552('0x23')](respondWithFilteredResult(_0x53bf9e,_0x3db63d))[_0x3552('0x46')](handleError(_0x53bf9e,null));};function char(_0x373121){return _0x3552('0x5f')===typeof _0x373121?String[_0x3552('0x60')][_0x3552('0x21')](null,arguments):_0x373121;}function needsEncapsulation(_0x36c4af){return!!_0x36c4af&&(_0x36c4af[_0x3552('0x61')]()[_0x3552('0x62')](char(0xd))>=0x0||_0x36c4af[_0x3552('0x61')]()[_0x3552('0x62')](char(0xa))>=0x0||_0x36c4af[_0x3552('0x61')]()[_0x3552('0x62')](char(0x2c))>=0x0||_0x36c4af['toString']()[_0x3552('0x62')](char(0x22))>=0x0);}function encapsulate(_0x1c6a62){var _0x46e1a5=char(0x22),_0x5b1502='\x5c'+char(0x22),_0x302218=_0x1c6a62['toString']()[_0x3552('0x63')](new RegExp(_0x46e1a5,'g'),_0x5b1502);return _0x46e1a5+_0x302218+_0x46e1a5;}exports[_0x3552('0x64')]=function(_0x1b4abd,_0x2c13c8,_0x4927c5){var _0x3bebe7,_0x59ed12;var _0x14b488={'where':{'ProjectId':_0x1b4abd['params']['id']}};if(_0x1b4abd[_0x3552('0x37')][_0x3552('0x65')]){_0x14b488[_0x3552('0x3c')][_0x3552('0x66')]=JSON['parse'](_0x1b4abd[_0x3552('0x37')][_0x3552('0x65')]);}return db[_0x3552('0x5b')][_0x3552('0x44')](_0x14b488)[_0x3552('0x23')](handleEntityNotFound(_0x2c13c8,null))[_0x3552('0x23')](function(_0x181d72){if(_0x181d72){_0x3bebe7=_0x181d72;return db[_0x3552('0x67')]['findAll']({'where':{'SessionId':{'$in':_[_0x3552('0x32')](_0x3bebe7,'id')},'ProjectId':_0x1b4abd[_0x3552('0x47')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x2c13c8,null))[_0x3552('0x23')](function(_0x10729c){if(_0x10729c){_0x59ed12=_0x10729c;var _0x3541a5={};for(var _0x567cb6=0x0,_0x2708b6=_0x59ed12['length'];_0x567cb6<_0x2708b6;_0x567cb6++){if(!_0x3541a5[_0x3552('0x39')](_0x59ed12[_0x567cb6]['questionId'])){_0x3541a5[_0x59ed12[_0x567cb6][_0x3552('0x68')]]=needsEncapsulation(_0x59ed12[_0x567cb6][_0x3552('0x69')])?encapsulate(_0x59ed12[_0x567cb6]['question']):_0x59ed12[_0x567cb6][_0x3552('0x69')];}}var _0x21278b=[],_0x2c8446={};for(var _0x3b9f80=0x0,_0x47ca2b=_0x3bebe7[_0x3552('0x38')];_0x3b9f80<_0x47ca2b;_0x3b9f80++){_0x2c8446={'ProjectId':_0x1b4abd[_0x3552('0x47')]['id'],'SessionId':_0x3bebe7[_0x3b9f80]['id'],'StartTime':moment(_0x3bebe7[_0x3b9f80][_0x3552('0x66')])[_0x3552('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3d97c8=0x0,_0x1f58b7=_0x59ed12[_0x3552('0x38')];_0x3d97c8<_0x1f58b7;_0x3d97c8++){if(_0x59ed12[_0x3d97c8][_0x3552('0x6b')]==_0x3bebe7[_0x3b9f80]['id']&&_0x3541a5[_0x3552('0x39')](_0x59ed12[_0x3d97c8][_0x3552('0x68')])){_0x2c8446[_0x3541a5[_0x59ed12[_0x3d97c8][_0x3552('0x68')]]]=_0x59ed12[_0x3d97c8]['answer'];}}for(var _0x193c08 in _0x3541a5){if(!_0x2c8446[_0x3552('0x39')](_0x3541a5[_0x193c08])){_0x2c8446[_0x3541a5[_0x193c08]]=null;}}_0x21278b['push'](_0x2c8446);}return _0x21278b;}})['then'](function(_0x53e9c9){if(!_[_0x3552('0x6c')](_0x53e9c9)){var _0x36ce25=toCsv(_0x53e9c9);var _0x1df6d7=Date[_0x3552('0x6d')]();fs[_0x3552('0x6e')](util[_0x3552('0x6a')](_0x3552('0x6f'),_0x1b4abd[_0x3552('0x47')]['id'],_0x1df6d7),_0x36ce25);_0x2c13c8[_0x3552('0x70')](_0x3552('0x71'),_0x3552('0x72')+util[_0x3552('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x1b4abd[_0x3552('0x47')]['id'],_0x1df6d7));_0x2c13c8[_0x3552('0x70')]('Content-type','text/csv');return _0x2c13c8[_0x3552('0x73')](util[_0x3552('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1b4abd[_0x3552('0x47')]['id'],_0x1df6d7));}else{return _0x2c13c8[_0x3552('0x18')](0xcc);}})[_0x3552('0x46')](handleError(_0x2c13c8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 3a46d46..6ca5c05 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 _0x2caf=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','api','bluebird','request-promise','path'];(function(_0x1e7a47,_0x5eca8a){var _0x1d00e9=function(_0x1d8018){while(--_0x1d8018){_0x1e7a47['push'](_0x1e7a47['shift']());}};_0x1d00e9(++_0x5eca8a);}(_0x2caf,0x6a));var _0xf2ca=function(_0x132cf1,_0x810f81){_0x132cf1=_0x132cf1-0x0;var _0x4d13bd=_0x2caf[_0x132cf1];return _0x4d13bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2ca('0x0'));var moment=require('moment');var BPromise=require(_0xf2ca('0x1'));var rp=require(_0xf2ca('0x2'));var fs=require('fs');var path=require(_0xf2ca('0x3'));var rimraf=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var attributes=require(_0xf2ca('0x6'));module[_0xf2ca('0x7')]=function(_0x51372a,_0x8ce770){return _0x51372a[_0xf2ca('0x8')](_0xf2ca('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7edb=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','./jscriptyProject.attributes','exports'];(function(_0xc7add,_0xd8e89c){var _0x39d0a0=function(_0x18f387){while(--_0x18f387){_0xc7add['push'](_0xc7add['shift']());}};_0x39d0a0(++_0xd8e89c);}(_0x7edb,0x158));var _0xb7ed=function(_0x59ad14,_0x47f930){_0x59ad14=_0x59ad14-0x0;var _0x27e236=_0x7edb[_0x59ad14];return _0x27e236;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'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 98369f6..68e2b61 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0xcdcbea,_0xe93ee4){var _0xf6d6cf=function(_0x318a48){while(--_0x318a48){_0xcdcbea['push'](_0xcdcbea['shift']());}};_0xf6d6cf(++_0xe93ee4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 872c9a9..6d32c95 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 _0x7d8d=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x6a23aa,_0x3797ab){var _0x5ad153=function(_0xee6112){while(--_0xee6112){_0x6a23aa['push'](_0x6a23aa['shift']());}};_0x5ad153(++_0x3797ab);}(_0x7d8d,0x1aa));var _0xd7d8=function(_0x3d4fdc,_0x25b396){_0x3d4fdc=_0x3d4fdc-0x0;var _0x3b59f0=_0x7d8d[_0x3d4fdc];return _0x3b59f0;};'use strict';var multer=require(_0xd7d8('0x0'));var util=require(_0xd7d8('0x1'));var path=require(_0xd7d8('0x2'));var timeout=require(_0xd7d8('0x3'));var express=require(_0xd7d8('0x4'));var router=express['Router']();var fs_extra=require(_0xd7d8('0x5'));var auth=require(_0xd7d8('0x6'));var interaction=require(_0xd7d8('0x7'));var config=require('../../config/environment');var controller=require(_0xd7d8('0x8'));router[_0xd7d8('0x9')]('/',auth[_0xd7d8('0xa')](),controller[_0xd7d8('0xb')]);router['get']('/describe',auth[_0xd7d8('0xa')](),controller[_0xd7d8('0xc')]);router[_0xd7d8('0x9')](_0xd7d8('0xd'),auth[_0xd7d8('0xa')](),controller[_0xd7d8('0xe')]);router[_0xd7d8('0xf')]('/',auth[_0xd7d8('0xa')](),controller[_0xd7d8('0x10')]);router[_0xd7d8('0x11')](_0xd7d8('0xd'),auth[_0xd7d8('0xa')](),controller[_0xd7d8('0x12')]);router[_0xd7d8('0x13')](_0xd7d8('0xd'),auth[_0xd7d8('0xa')](),controller[_0xd7d8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5d77=['isAuthenticated','index','/describe','show','create','delete','/:id','destroy','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get'];(function(_0x3d2e4f,_0x139a5e){var _0x4ae0ec=function(_0x3eea67){while(--_0x3eea67){_0x3d2e4f['push'](_0x3d2e4f['shift']());}};_0x4ae0ec(++_0x139a5e);}(_0x5d77,0xda));var _0x75d7=function(_0x201a67,_0x2688e7){_0x201a67=_0x201a67-0x0;var _0x123634=_0x5d77[_0x201a67];return _0x123634;};'use strict';var multer=require('multer');var util=require(_0x75d7('0x0'));var path=require(_0x75d7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75d7('0x2'));var interaction=require(_0x75d7('0x3'));var config=require(_0x75d7('0x4'));var controller=require(_0x75d7('0x5'));router[_0x75d7('0x6')]('/',auth[_0x75d7('0x7')](),controller[_0x75d7('0x8')]);router[_0x75d7('0x6')](_0x75d7('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x75d7('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x75d7('0xa')]);router['post']('/',auth[_0x75d7('0x7')](),controller[_0x75d7('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x75d7('0xc')](_0x75d7('0xd'),auth['isAuthenticated'](),controller[_0x75d7('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index de6a5ef..eb746a2 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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x17822e,_0x592a80){_0x17822e=_0x17822e-0x0;var _0x403713=_0x7a54[_0x17822e];return _0x403713;};'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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x31cb80,_0x1dafdf){_0x31cb80=_0x31cb80-0x0;var _0xe9ee79=_0x7a54[_0x31cb80];return _0xe9ee79;};'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 d1292f3..954b57d 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 _0x5df6=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','rawAttributes','fieldName','type','key','model','map','name','query'];(function(_0x425c9f,_0x53dad2){var _0x5317af=function(_0x50059e){while(--_0x50059e){_0x425c9f['push'](_0x425c9f['shift']());}};_0x5317af(++_0x53dad2);}(_0x5df6,0x105));var _0x65df=function(_0x516b81,_0x2b6bec){_0x516b81=_0x516b81-0x0;var _0x1ca10a=_0x5df6[_0x516b81];return _0x1ca10a;};'use strict';var emlformat=require(_0x65df('0x0'));var rimraf=require(_0x65df('0x1'));var zipdir=require(_0x65df('0x2'));var jsonpatch=require(_0x65df('0x3'));var rp=require(_0x65df('0x4'));var moment=require(_0x65df('0x5'));var BPromise=require(_0x65df('0x6'));var Mustache=require(_0x65df('0x7'));var util=require(_0x65df('0x8'));var path=require(_0x65df('0x9'));var sox=require(_0x65df('0xa'));var csv=require(_0x65df('0xb'));var ejs=require(_0x65df('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65df('0xd'));var squel=require('squel');var crypto=require(_0x65df('0xe'));var jsforce=require(_0x65df('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x65df('0xb'));var querystring=require(_0x65df('0x10'));var Papa=require(_0x65df('0x11'));var Redis=require('ioredis');var authService=require(_0x65df('0x12'));var qs=require(_0x65df('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65df('0x14'));var logger=require(_0x65df('0x15'))(_0x65df('0x16'));var utils=require('../../config/utils');var config=require(_0x65df('0x17'));var licenseUtil=require(_0x65df('0x18'));var db=require(_0x65df('0x19'))['db'];function respondWithStatusCode(_0x145ea6,_0x4b8e98){_0x4b8e98=_0x4b8e98||0xcc;return function(_0x418b22){if(_0x418b22){return _0x145ea6['sendStatus'](_0x4b8e98);}return _0x145ea6[_0x65df('0x1a')](_0x4b8e98)[_0x65df('0x1b')]();};}function respondWithResult(_0x53b283,_0x3ebdba){_0x3ebdba=_0x3ebdba||0xc8;return function(_0x3ba237){if(_0x3ba237){return _0x53b283[_0x65df('0x1a')](_0x3ebdba)[_0x65df('0x1c')](_0x3ba237);}};}function respondWithFilteredResult(_0x332e85,_0x551310){return function(_0x26b878){if(_0x26b878){var _0x1d4a1d=typeof _0x551310[_0x65df('0x1d')]===_0x65df('0x1e')&&typeof _0x551310[_0x65df('0x1f')]===_0x65df('0x1e');var _0x147092=_0x26b878['count'];var _0x102f76=_0x1d4a1d?0x0:_0x551310[_0x65df('0x1d')];var _0x24c2ed=_0x1d4a1d?_0x26b878[_0x65df('0x20')]:_0x551310['offset']+_0x551310[_0x65df('0x1f')];var _0xb93d78;if(_0x24c2ed>=_0x147092){_0x24c2ed=_0x147092;_0xb93d78=0xc8;}else{_0xb93d78=0xce;}_0x332e85['status'](_0xb93d78);return _0x332e85[_0x65df('0x21')](_0x65df('0x22'),_0x102f76+'-'+_0x24c2ed+'/'+_0x147092)[_0x65df('0x1c')](_0x26b878);}return null;};}function patchUpdates(_0xb4cc7f){return function(_0x158903){try{jsonpatch[_0x65df('0x23')](_0x158903,_0xb4cc7f,!![]);}catch(_0x37097b){return BPromise[_0x65df('0x24')](_0x37097b);}return _0x158903[_0x65df('0x25')]();};}function saveUpdates(_0x17c116,_0xc04ca5){return function(_0xacb3ec){if(_0xacb3ec){return _0xacb3ec['update'](_0x17c116)[_0x65df('0x26')](function(_0x52cd75){return _0x52cd75;});}return null;};}function removeEntity(_0x43d52f,_0x159a27){return function(_0x7df1ab){if(_0x7df1ab){return _0x7df1ab[_0x65df('0x27')]()[_0x65df('0x26')](function(){_0x43d52f[_0x65df('0x1a')](0xcc)[_0x65df('0x1b')]();});}};}function handleEntityNotFound(_0x84ee58,_0x3114e8){return function(_0x12242b){if(!_0x12242b){_0x84ee58[_0x65df('0x28')](0x194);}return _0x12242b;};}function handleError(_0x2eac14,_0x5eb9e9){_0x5eb9e9=_0x5eb9e9||0x1f4;return function(_0x431547){logger[_0x65df('0x29')](_0x431547[_0x65df('0x2a')]);if(_0x431547['name']){delete _0x431547['name'];}_0x2eac14[_0x65df('0x1a')](_0x5eb9e9)['send'](_0x431547);};}exports['index']=function(_0x157a1d,_0x2d8411){var _0x3f5e5d={},_0x31b547={},_0x23e321={'count':0x0,'rows':[]};var _0x273831=_['map'](db['JscriptyQuestionReport'][_0x65df('0x2b')],function(_0x59576a){return{'name':_0x59576a[_0x65df('0x2c')],'type':_0x59576a[_0x65df('0x2d')][_0x65df('0x2e')]};});_0x31b547[_0x65df('0x2f')]=_[_0x65df('0x30')](_0x273831,_0x65df('0x31'));_0x31b547[_0x65df('0x32')]=_[_0x65df('0x33')](_0x157a1d[_0x65df('0x32')]);_0x31b547[_0x65df('0x34')]=_[_0x65df('0x35')](_0x31b547['model'],_0x31b547[_0x65df('0x32')]);_0x3f5e5d[_0x65df('0x36')]=_[_0x65df('0x35')](_0x31b547['model'],qs[_0x65df('0x37')](_0x157a1d[_0x65df('0x32')][_0x65df('0x37')]));_0x3f5e5d['attributes']=_0x3f5e5d[_0x65df('0x36')][_0x65df('0x38')]?_0x3f5e5d[_0x65df('0x36')]:_0x31b547[_0x65df('0x2f')];if(!_0x157a1d['query'][_0x65df('0x39')](_0x65df('0x3a'))){_0x3f5e5d[_0x65df('0x1f')]=qs[_0x65df('0x1f')](_0x157a1d[_0x65df('0x32')][_0x65df('0x1f')]);_0x3f5e5d[_0x65df('0x1d')]=qs[_0x65df('0x1d')](_0x157a1d[_0x65df('0x32')][_0x65df('0x1d')]);}_0x3f5e5d[_0x65df('0x3b')]=qs[_0x65df('0x3c')](_0x157a1d[_0x65df('0x32')][_0x65df('0x3c')]);_0x3f5e5d['where']=qs['filters'](_[_0x65df('0x3d')](_0x157a1d[_0x65df('0x32')],_0x31b547[_0x65df('0x34')]),_0x273831);if(_0x157a1d['query'][_0x65df('0x3e')]){_0x3f5e5d[_0x65df('0x3f')]=_[_0x65df('0x40')](_0x3f5e5d['where'],{'$or':_[_0x65df('0x30')](_0x273831,function(_0x2eb8a7){if(_0x2eb8a7[_0x65df('0x2d')]!=='VIRTUAL'){var _0x3a7075={};_0x3a7075[_0x2eb8a7['name']]={'$like':'%'+_0x157a1d[_0x65df('0x32')]['filter']+'%'};return _0x3a7075;}})});}_0x3f5e5d=_[_0x65df('0x40')]({},_0x3f5e5d,_0x157a1d[_0x65df('0x41')]);var _0x14bf90={'where':_0x3f5e5d[_0x65df('0x3f')]};return db[_0x65df('0x42')][_0x65df('0x20')](_0x14bf90)[_0x65df('0x26')](function(_0x5144c7){_0x23e321[_0x65df('0x20')]=_0x5144c7;if(_0x157a1d[_0x65df('0x32')][_0x65df('0x43')]){_0x3f5e5d[_0x65df('0x44')]=[{'all':!![]}];}return db[_0x65df('0x42')][_0x65df('0x45')](_0x3f5e5d);})[_0x65df('0x26')](function(_0x17adb6){_0x23e321[_0x65df('0x46')]=_0x17adb6;return _0x23e321;})[_0x65df('0x26')](respondWithFilteredResult(_0x2d8411,_0x3f5e5d))[_0x65df('0x47')](handleError(_0x2d8411,null));};exports[_0x65df('0x48')]=function(_0x436b0a,_0x288e91){var _0x3a762b={'raw':!![],'where':{'id':_0x436b0a[_0x65df('0x49')]['id']}},_0x280821={};_0x280821[_0x65df('0x2f')]=_[_0x65df('0x33')](db[_0x65df('0x42')][_0x65df('0x2b')]);_0x280821['query']=_[_0x65df('0x33')](_0x436b0a[_0x65df('0x32')]);_0x280821[_0x65df('0x34')]=_[_0x65df('0x35')](_0x280821[_0x65df('0x2f')],_0x280821[_0x65df('0x32')]);_0x3a762b[_0x65df('0x36')]=_[_0x65df('0x35')](_0x280821[_0x65df('0x2f')],qs[_0x65df('0x37')](_0x436b0a[_0x65df('0x32')][_0x65df('0x37')]));_0x3a762b[_0x65df('0x36')]=_0x3a762b[_0x65df('0x36')]['length']?_0x3a762b['attributes']:_0x280821[_0x65df('0x2f')];if(_0x436b0a[_0x65df('0x32')][_0x65df('0x43')]){_0x3a762b[_0x65df('0x44')]=[{'all':!![]}];}_0x3a762b=_['merge']({},_0x3a762b,_0x436b0a[_0x65df('0x41')]);return db[_0x65df('0x42')][_0x65df('0x4a')](_0x3a762b)[_0x65df('0x26')](handleEntityNotFound(_0x288e91,null))['then'](respondWithResult(_0x288e91,null))[_0x65df('0x47')](handleError(_0x288e91,null));};exports[_0x65df('0x4b')]=function(_0x5cff2d,_0x459576){return db[_0x65df('0x42')][_0x65df('0x4b')](_0x5cff2d[_0x65df('0x4c')],{})[_0x65df('0x26')](respondWithResult(_0x459576,0xc9))[_0x65df('0x47')](handleError(_0x459576,null));};exports['update']=function(_0x3747f0,_0x2b4a66){if(_0x3747f0[_0x65df('0x4c')]['id']){delete _0x3747f0[_0x65df('0x4c')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x3747f0[_0x65df('0x49')]['id']}})[_0x65df('0x26')](handleEntityNotFound(_0x2b4a66,null))['then'](saveUpdates(_0x3747f0[_0x65df('0x4c')],null))[_0x65df('0x26')](respondWithResult(_0x2b4a66,null))[_0x65df('0x47')](handleError(_0x2b4a66,null));};exports[_0x65df('0x27')]=function(_0x498b64,_0x560f52){return db['JscriptyQuestionReport'][_0x65df('0x4a')]({'where':{'id':_0x498b64[_0x65df('0x49')]['id']}})['then'](handleEntityNotFound(_0x560f52,null))[_0x65df('0x26')](removeEntity(_0x560f52,null))[_0x65df('0x47')](handleError(_0x560f52,null));};exports[_0x65df('0x4d')]=function(_0x539445,_0x338471){return db[_0x65df('0x42')]['describe']()[_0x65df('0x26')](respondWithResult(_0x338471,null))[_0x65df('0x47')](handleError(_0x338471,null));}; \ No newline at end of file +var _0x7c19=['body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create'];(function(_0x34032c,_0x5c591b){var _0x320c6e=function(_0x4effb5){while(--_0x4effb5){_0x34032c['push'](_0x34032c['shift']());}};_0x320c6e(++_0x5c591b);}(_0x7c19,0x9c));var _0x97c1=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7c19[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x97c1('0x0'));var rimraf=require(_0x97c1('0x1'));var zipdir=require(_0x97c1('0x2'));var jsonpatch=require(_0x97c1('0x3'));var rp=require(_0x97c1('0x4'));var moment=require(_0x97c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x97c1('0x6'));var util=require(_0x97c1('0x7'));var path=require(_0x97c1('0x8'));var sox=require('sox');var csv=require(_0x97c1('0x9'));var ejs=require(_0x97c1('0xa'));var fs=require('fs');var fs_extra=require(_0x97c1('0xb'));var _=require(_0x97c1('0xc'));var squel=require(_0x97c1('0xd'));var crypto=require(_0x97c1('0xe'));var jsforce=require(_0x97c1('0xf'));var deskjs=require(_0x97c1('0x10'));var toCsv=require(_0x97c1('0x9'));var querystring=require(_0x97c1('0x11'));var Papa=require('papaparse');var Redis=require(_0x97c1('0x12'));var authService=require(_0x97c1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x97c1('0x14'));var hardwareService=require(_0x97c1('0x15'));var logger=require(_0x97c1('0x16'))('api');var utils=require(_0x97c1('0x17'));var config=require(_0x97c1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x97c1('0x19'))['db'];function respondWithStatusCode(_0x52841f,_0x5f22f6){_0x5f22f6=_0x5f22f6||0xcc;return function(_0x126581){if(_0x126581){return _0x52841f['sendStatus'](_0x5f22f6);}return _0x52841f[_0x97c1('0x1a')](_0x5f22f6)[_0x97c1('0x1b')]();};}function respondWithResult(_0x5ac805,_0x1a01cb){_0x1a01cb=_0x1a01cb||0xc8;return function(_0x419711){if(_0x419711){return _0x5ac805[_0x97c1('0x1a')](_0x1a01cb)[_0x97c1('0x1c')](_0x419711);}};}function respondWithFilteredResult(_0x16eafb,_0x40ac08){return function(_0xe764bd){if(_0xe764bd){var _0x37fc99=typeof _0x40ac08[_0x97c1('0x1d')]==='undefined'&&typeof _0x40ac08[_0x97c1('0x1e')]===_0x97c1('0x1f');var _0x550a90=_0xe764bd['count'];var _0x21e38f=_0x37fc99?0x0:_0x40ac08['offset'];var _0xe373a1=_0x37fc99?_0xe764bd[_0x97c1('0x20')]:_0x40ac08[_0x97c1('0x1d')]+_0x40ac08['limit'];var _0x18b0e5;if(_0xe373a1>=_0x550a90){_0xe373a1=_0x550a90;_0x18b0e5=0xc8;}else{_0x18b0e5=0xce;}_0x16eafb[_0x97c1('0x1a')](_0x18b0e5);return _0x16eafb[_0x97c1('0x21')](_0x97c1('0x22'),_0x21e38f+'-'+_0xe373a1+'/'+_0x550a90)[_0x97c1('0x1c')](_0xe764bd);}return null;};}function patchUpdates(_0x5203ab){return function(_0x31877d){try{jsonpatch[_0x97c1('0x23')](_0x31877d,_0x5203ab,!![]);}catch(_0x33dc2d){return BPromise[_0x97c1('0x24')](_0x33dc2d);}return _0x31877d['save']();};}function saveUpdates(_0x5f5568,_0x1a095b){return function(_0x4106ef){if(_0x4106ef){return _0x4106ef[_0x97c1('0x25')](_0x5f5568)[_0x97c1('0x26')](function(_0x445dd8){return _0x445dd8;});}return null;};}function removeEntity(_0x4db508,_0x1ba2ef){return function(_0x2d3e3c){if(_0x2d3e3c){return _0x2d3e3c[_0x97c1('0x27')]()[_0x97c1('0x26')](function(){_0x4db508[_0x97c1('0x1a')](0xcc)[_0x97c1('0x1b')]();});}};}function handleEntityNotFound(_0x4b096f,_0x40dde3){return function(_0x255da2){if(!_0x255da2){_0x4b096f['sendStatus'](0x194);}return _0x255da2;};}function handleError(_0x10f76a,_0x1a8bdf){_0x1a8bdf=_0x1a8bdf||0x1f4;return function(_0x5374f1){logger[_0x97c1('0x28')](_0x5374f1['stack']);if(_0x5374f1[_0x97c1('0x29')]){delete _0x5374f1[_0x97c1('0x29')];}_0x10f76a[_0x97c1('0x1a')](_0x1a8bdf)['send'](_0x5374f1);};}exports[_0x97c1('0x2a')]=function(_0x258b55,_0x310ad0){var _0x43a1b0={},_0x1f55dc={},_0x51b46f={'count':0x0,'rows':[]};var _0x46b0ee=_[_0x97c1('0x2b')](db[_0x97c1('0x2c')][_0x97c1('0x2d')],function(_0x976b80){return{'name':_0x976b80[_0x97c1('0x2e')],'type':_0x976b80[_0x97c1('0x2f')][_0x97c1('0x30')]};});_0x1f55dc[_0x97c1('0x31')]=_[_0x97c1('0x2b')](_0x46b0ee,'name');_0x1f55dc[_0x97c1('0x32')]=_[_0x97c1('0x33')](_0x258b55['query']);_0x1f55dc['filters']=_[_0x97c1('0x34')](_0x1f55dc['model'],_0x1f55dc[_0x97c1('0x32')]);_0x43a1b0['attributes']=_['intersection'](_0x1f55dc[_0x97c1('0x31')],qs[_0x97c1('0x35')](_0x258b55[_0x97c1('0x32')]['fields']));_0x43a1b0[_0x97c1('0x36')]=_0x43a1b0[_0x97c1('0x36')][_0x97c1('0x37')]?_0x43a1b0[_0x97c1('0x36')]:_0x1f55dc[_0x97c1('0x31')];if(!_0x258b55[_0x97c1('0x32')][_0x97c1('0x38')](_0x97c1('0x39'))){_0x43a1b0[_0x97c1('0x1e')]=qs[_0x97c1('0x1e')](_0x258b55[_0x97c1('0x32')][_0x97c1('0x1e')]);_0x43a1b0[_0x97c1('0x1d')]=qs[_0x97c1('0x1d')](_0x258b55[_0x97c1('0x32')][_0x97c1('0x1d')]);}_0x43a1b0[_0x97c1('0x3a')]=qs['sort'](_0x258b55[_0x97c1('0x32')][_0x97c1('0x3b')]);_0x43a1b0[_0x97c1('0x3c')]=qs[_0x97c1('0x3d')](_['pick'](_0x258b55['query'],_0x1f55dc[_0x97c1('0x3d')]),_0x46b0ee);if(_0x258b55['query'][_0x97c1('0x3e')]){_0x43a1b0['where']=_[_0x97c1('0x3f')](_0x43a1b0[_0x97c1('0x3c')],{'$or':_[_0x97c1('0x2b')](_0x46b0ee,function(_0x28a911){if(_0x28a911[_0x97c1('0x2f')]!==_0x97c1('0x40')){var _0x30b326={};_0x30b326[_0x28a911[_0x97c1('0x29')]]={'$like':'%'+_0x258b55[_0x97c1('0x32')][_0x97c1('0x3e')]+'%'};return _0x30b326;}})});}_0x43a1b0=_[_0x97c1('0x3f')]({},_0x43a1b0,_0x258b55[_0x97c1('0x41')]);var _0x280207={'where':_0x43a1b0[_0x97c1('0x3c')]};return db['JscriptyQuestionReport'][_0x97c1('0x20')](_0x280207)[_0x97c1('0x26')](function(_0x52d9c9){_0x51b46f['count']=_0x52d9c9;if(_0x258b55[_0x97c1('0x32')][_0x97c1('0x42')]){_0x43a1b0[_0x97c1('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x43a1b0);})[_0x97c1('0x26')](function(_0x380aff){_0x51b46f[_0x97c1('0x44')]=_0x380aff;return _0x51b46f;})['then'](respondWithFilteredResult(_0x310ad0,_0x43a1b0))[_0x97c1('0x45')](handleError(_0x310ad0,null));};exports[_0x97c1('0x46')]=function(_0x21da70,_0x3d630f){var _0x50c92c={'raw':!![],'where':{'id':_0x21da70['params']['id']}},_0xb267b0={};_0xb267b0['model']=_[_0x97c1('0x33')](db[_0x97c1('0x2c')][_0x97c1('0x2d')]);_0xb267b0['query']=_[_0x97c1('0x33')](_0x21da70[_0x97c1('0x32')]);_0xb267b0['filters']=_[_0x97c1('0x34')](_0xb267b0[_0x97c1('0x31')],_0xb267b0[_0x97c1('0x32')]);_0x50c92c[_0x97c1('0x36')]=_[_0x97c1('0x34')](_0xb267b0['model'],qs[_0x97c1('0x35')](_0x21da70['query'][_0x97c1('0x35')]));_0x50c92c['attributes']=_0x50c92c[_0x97c1('0x36')][_0x97c1('0x37')]?_0x50c92c[_0x97c1('0x36')]:_0xb267b0[_0x97c1('0x31')];if(_0x21da70[_0x97c1('0x32')]['includeAll']){_0x50c92c[_0x97c1('0x43')]=[{'all':!![]}];}_0x50c92c=_[_0x97c1('0x3f')]({},_0x50c92c,_0x21da70[_0x97c1('0x41')]);return db[_0x97c1('0x2c')]['find'](_0x50c92c)[_0x97c1('0x26')](handleEntityNotFound(_0x3d630f,null))[_0x97c1('0x26')](respondWithResult(_0x3d630f,null))[_0x97c1('0x45')](handleError(_0x3d630f,null));};exports[_0x97c1('0x47')]=function(_0x5a9d4c,_0x1ac7b8){return db[_0x97c1('0x2c')]['create'](_0x5a9d4c[_0x97c1('0x48')],{})['then'](respondWithResult(_0x1ac7b8,0xc9))[_0x97c1('0x45')](handleError(_0x1ac7b8,null));};exports['update']=function(_0x2159a4,_0x5f03a6){if(_0x2159a4[_0x97c1('0x48')]['id']){delete _0x2159a4[_0x97c1('0x48')]['id'];}return db[_0x97c1('0x2c')][_0x97c1('0x49')]({'where':{'id':_0x2159a4[_0x97c1('0x4a')]['id']}})[_0x97c1('0x26')](handleEntityNotFound(_0x5f03a6,null))[_0x97c1('0x26')](saveUpdates(_0x2159a4[_0x97c1('0x48')],null))['then'](respondWithResult(_0x5f03a6,null))[_0x97c1('0x45')](handleError(_0x5f03a6,null));};exports[_0x97c1('0x27')]=function(_0x485a0c,_0x19382d){return db['JscriptyQuestionReport'][_0x97c1('0x49')]({'where':{'id':_0x485a0c['params']['id']}})[_0x97c1('0x26')](handleEntityNotFound(_0x19382d,null))['then'](removeEntity(_0x19382d,null))[_0x97c1('0x45')](handleError(_0x19382d,null));};exports[_0x97c1('0x4b')]=function(_0x4db4b3,_0x367c3c){return db['JscriptyQuestionReport'][_0x97c1('0x4b')]()[_0x97c1('0x26')](respondWithResult(_0x367c3c,null))['catch'](handleError(_0x367c3c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 03c5452..1a160a0 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 _0xc162=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc162,0xd8));var _0x2c16=function(_0xa7e9a2,_0x2e8e91){_0xa7e9a2=_0xa7e9a2-0x0;var _0x597a0f=_0xc162[_0xa7e9a2];return _0x597a0f;};'use strict';var _=require(_0x2c16('0x0'));var util=require(_0x2c16('0x1'));var logger=require('../../config/logger')(_0x2c16('0x2'));var moment=require(_0x2c16('0x3'));var BPromise=require(_0x2c16('0x4'));var rp=require(_0x2c16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c16('0x6'));var attributes=require(_0x2c16('0x7'));module[_0x2c16('0x8')]=function(_0x43b9e0,_0x43846c){return _0x43b9e0[_0x2c16('0x9')](_0x2c16('0xa'),attributes,{'tableName':_0x2c16('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe80e=['moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api'];(function(_0x38efde,_0x76f75c){var _0x2c1be8=function(_0x4e309c){while(--_0x4e309c){_0x38efde['push'](_0x38efde['shift']());}};_0x2c1be8(++_0x76f75c);}(_0xe80e,0x65));var _0xee80=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xe80e[_0x5416db];return _0x243e35;};'use strict';var _=require(_0xee80('0x0'));var util=require('util');var logger=require(_0xee80('0x1'))(_0xee80('0x2'));var moment=require(_0xee80('0x3'));var BPromise=require(_0xee80('0x4'));var rp=require(_0xee80('0x5'));var fs=require('fs');var path=require(_0xee80('0x6'));var rimraf=require(_0xee80('0x7'));var config=require('../../config/environment');var attributes=require(_0xee80('0x8'));module[_0xee80('0x9')]=function(_0x46c803,_0x48b862){return _0x46c803[_0xee80('0xa')](_0xee80('0xb'),attributes,{'tableName':_0xee80('0xc'),'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 e40caca..f5d2219 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 _0xd6a9=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x21ac81,_0x160aac){var _0x54a873=function(_0xea10bf){while(--_0xea10bf){_0x21ac81['push'](_0x21ac81['shift']());}};_0x54a873(++_0x160aac);}(_0xd6a9,0xa7));var _0x9d6a=function(_0x1d1138,_0x964895){_0x1d1138=_0x1d1138-0x0;var _0x129443=_0xd6a9[_0x1d1138];return _0x129443;};'use strict';var _=require(_0x9d6a('0x0'));var util=require(_0x9d6a('0x1'));var moment=require(_0x9d6a('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d6a('0x3'));var fs=require('fs');var Redis=require(_0x9d6a('0x4'));var db=require(_0x9d6a('0x5'))['db'];var utils=require(_0x9d6a('0x6'));var logger=require(_0x9d6a('0x7'))(_0x9d6a('0x8'));var config=require(_0x9d6a('0x9'));var jayson=require(_0x9d6a('0xa'));var client=jayson[_0x9d6a('0xb')][_0x9d6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bab7b,_0x4378ee,_0x357ab7){return new BPromise(function(_0x33427e,_0x3d25e5){return client[_0x9d6a('0xd')](_0x3bab7b,_0x357ab7)['then'](function(_0x48220b){logger[_0x9d6a('0xe')](_0x9d6a('0xf'),_0x4378ee,'request\x20sent');logger[_0x9d6a('0x10')](_0x9d6a('0x11'),_0x4378ee,_0x9d6a('0x12'),JSON['stringify'](_0x48220b));if(_0x48220b[_0x9d6a('0x13')]){if(_0x48220b[_0x9d6a('0x13')][_0x9d6a('0x14')]===0x1f4){logger['error'](_0x9d6a('0xf'),_0x4378ee,_0x48220b['error'][_0x9d6a('0x15')]);return _0x3d25e5(_0x48220b[_0x9d6a('0x13')][_0x9d6a('0x15')]);}logger['error'](_0x9d6a('0xf'),_0x4378ee,_0x48220b[_0x9d6a('0x13')][_0x9d6a('0x15')]);return _0x33427e(_0x48220b['error'][_0x9d6a('0x15')]);}else{logger[_0x9d6a('0xe')](_0x9d6a('0xf'),_0x4378ee,'request\x20sent');_0x33427e(_0x48220b[_0x9d6a('0x16')][_0x9d6a('0x15')]);}})[_0x9d6a('0x17')](function(_0x5efa3e){logger[_0x9d6a('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4378ee,_0x5efa3e);_0x3d25e5(_0x5efa3e);});});} \ No newline at end of file +var _0x0741=['request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x23fcff,_0x5f38de){var _0x290d35=function(_0x383287){while(--_0x383287){_0x23fcff['push'](_0x23fcff['shift']());}};_0x290d35(++_0x5f38de);}(_0x0741,0x6c));var _0x1074=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0741[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require(_0x1074('0x0'));var moment=require(_0x1074('0x1'));var BPromise=require(_0x1074('0x2'));var rs=require(_0x1074('0x3'));var fs=require('fs');var Redis=require(_0x1074('0x4'));var db=require(_0x1074('0x5'))['db'];var utils=require(_0x1074('0x6'));var logger=require('../../config/logger')(_0x1074('0x7'));var config=require(_0x1074('0x8'));var jayson=require(_0x1074('0x9'));var client=jayson[_0x1074('0xa')][_0x1074('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x246c4b,_0x5cf91c,_0xebcd3e){return new BPromise(function(_0x1d7b55,_0x3ed85b){return client[_0x1074('0xc')](_0x246c4b,_0xebcd3e)[_0x1074('0xd')](function(_0x5d97fa){logger[_0x1074('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cf91c,_0x1074('0xf'));logger['debug'](_0x1074('0x10'),_0x5cf91c,_0x1074('0xf'),JSON[_0x1074('0x11')](_0x5d97fa));if(_0x5d97fa[_0x1074('0x12')]){if(_0x5d97fa[_0x1074('0x12')][_0x1074('0x13')]===0x1f4){logger[_0x1074('0x12')](_0x1074('0x14'),_0x5cf91c,_0x5d97fa[_0x1074('0x12')][_0x1074('0x15')]);return _0x3ed85b(_0x5d97fa[_0x1074('0x12')][_0x1074('0x15')]);}logger[_0x1074('0x12')](_0x1074('0x14'),_0x5cf91c,_0x5d97fa[_0x1074('0x12')][_0x1074('0x15')]);return _0x1d7b55(_0x5d97fa[_0x1074('0x12')][_0x1074('0x15')]);}else{logger[_0x1074('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cf91c,_0x1074('0xf'));_0x1d7b55(_0x5d97fa[_0x1074('0x16')][_0x1074('0x15')]);}})[_0x1074('0x17')](function(_0x5c8398){logger[_0x1074('0x12')](_0x1074('0x14'),_0x5cf91c,_0x5c8398);_0x3ed85b(_0x5c8398);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index fdc1e7e..033dd1d 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 _0x93d7=['index','/describe','/:id','show','/:id/questions','getQuestions','post','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x4b9872,_0x8ed480){var _0x2b943d=function(_0x2f60d6){while(--_0x2f60d6){_0x4b9872['push'](_0x4b9872['shift']());}};_0x2b943d(++_0x8ed480);}(_0x93d7,0x129));var _0x793d=function(_0x2a4812,_0x19481e){_0x2a4812=_0x2a4812-0x0;var _0x5baa61=_0x93d7[_0x2a4812];return _0x5baa61;};'use strict';var multer=require(_0x793d('0x0'));var util=require('util');var path=require(_0x793d('0x1'));var timeout=require(_0x793d('0x2'));var express=require(_0x793d('0x3'));var router=express[_0x793d('0x4')]();var fs_extra=require(_0x793d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x793d('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x793d('0x7')]('/',auth[_0x793d('0x8')](),controller[_0x793d('0x9')]);router['get'](_0x793d('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x793d('0x7')](_0x793d('0xb'),auth[_0x793d('0x8')](),controller[_0x793d('0xc')]);router[_0x793d('0x7')](_0x793d('0xd'),auth[_0x793d('0x8')](),controller[_0x793d('0xe')]);router[_0x793d('0xf')]('/',auth[_0x793d('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x793d('0x10')]);router[_0x793d('0x11')]('/:id',auth[_0x793d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9822=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','destroy','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9822,0x1a4));var _0x2982=function(_0x440516,_0xd84b69){_0x440516=_0x440516-0x0;var _0x570f72=_0x9822[_0x440516];return _0x570f72;};'use strict';var multer=require(_0x2982('0x0'));var util=require(_0x2982('0x1'));var path=require(_0x2982('0x2'));var timeout=require(_0x2982('0x3'));var express=require(_0x2982('0x4'));var router=express[_0x2982('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2982('0x6'));var config=require(_0x2982('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x2982('0x8')]('/',auth[_0x2982('0x9')](),controller['index']);router[_0x2982('0x8')](_0x2982('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2982('0x8')]('/:id',auth[_0x2982('0x9')](),controller[_0x2982('0xb')]);router[_0x2982('0x8')](_0x2982('0xc'),auth[_0x2982('0x9')](),controller[_0x2982('0xd')]);router[_0x2982('0xe')]('/',auth[_0x2982('0x9')](),controller[_0x2982('0xf')]);router[_0x2982('0x10')](_0x2982('0x11'),auth['isAuthenticated'](),controller[_0x2982('0x12')]);router['delete'](_0x2982('0x11'),auth[_0x2982('0x9')](),controller[_0x2982('0x13')]);module[_0x2982('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 585e610..efba35f 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 _0x12aa=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x12aa,0xcd));var _0xa12a=function(_0x5e89f1,_0x2abd3c){_0x5e89f1=_0x5e89f1-0x0;var _0x33b8dd=_0x12aa[_0x5e89f1];return _0x33b8dd;};'use strict';var moment=require(_0xa12a('0x0'));var Sequelize=require('sequelize');module[_0xa12a('0x1')]={'starttime':{'type':Sequelize[_0xa12a('0x2')],'set':function(_0x53e906){this[_0xa12a('0x3')]('starttime',_0x53e906);this[_0xa12a('0x3')]('endtime',moment()['format'](_0xa12a('0x4')));}},'endtime':{'type':Sequelize[_0xa12a('0x2')]},'membername':{'type':Sequelize[_0xa12a('0x5')]},'projectname':{'type':Sequelize[_0xa12a('0x5')]},'queue':{'type':Sequelize[_0xa12a('0x5')]},'uniqueid':{'type':Sequelize[_0xa12a('0x5')]},'calleridname':{'type':Sequelize[_0xa12a('0x5')]},'calleridnum':{'type':Sequelize[_0xa12a('0x5')]},'completed':{'type':Sequelize[_0xa12a('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x3971=['YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format'];(function(_0x331298,_0x12341a){var _0x3824bc=function(_0x19449f){while(--_0x19449f){_0x331298['push'](_0x331298['shift']());}};_0x3824bc(++_0x12341a);}(_0x3971,0x7a));var _0x1397=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3971[_0x5a776b];return _0xbbef59;};'use strict';var moment=require(_0x1397('0x0'));var Sequelize=require(_0x1397('0x1'));module[_0x1397('0x2')]={'starttime':{'type':Sequelize[_0x1397('0x3')],'set':function(_0x16184c){this[_0x1397('0x4')](_0x1397('0x5'),_0x16184c);this[_0x1397('0x4')](_0x1397('0x6'),moment()[_0x1397('0x7')](_0x1397('0x8')));}},'endtime':{'type':Sequelize[_0x1397('0x3')]},'membername':{'type':Sequelize[_0x1397('0x9')]},'projectname':{'type':Sequelize[_0x1397('0x9')]},'queue':{'type':Sequelize[_0x1397('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1397('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 0452166..d63d42b 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 _0x8c34=['rawAttributes','includeAll','find','create','body','update','destroy','findOne','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','end','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params'];(function(_0x34e79d,_0x1fb826){var _0x56afa8=function(_0x5177f4){while(--_0x5177f4){_0x34e79d['push'](_0x34e79d['shift']());}};_0x56afa8(++_0x1fb826);}(_0x8c34,0x147));var _0x48c3=function(_0xd48d77,_0xb001f7){_0xd48d77=_0xd48d77-0x0;var _0x4a275a=_0x8c34[_0xd48d77];return _0x4a275a;};'use strict';var emlformat=require(_0x48c3('0x0'));var rimraf=require(_0x48c3('0x1'));var zipdir=require(_0x48c3('0x2'));var jsonpatch=require(_0x48c3('0x3'));var rp=require('request-promise');var moment=require(_0x48c3('0x4'));var BPromise=require(_0x48c3('0x5'));var Mustache=require(_0x48c3('0x6'));var util=require(_0x48c3('0x7'));var path=require(_0x48c3('0x8'));var sox=require(_0x48c3('0x9'));var csv=require(_0x48c3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48c3('0xb'));var _=require(_0x48c3('0xc'));var squel=require(_0x48c3('0xd'));var crypto=require('crypto');var jsforce=require(_0x48c3('0xe'));var deskjs=require(_0x48c3('0xf'));var toCsv=require(_0x48c3('0xa'));var querystring=require(_0x48c3('0x10'));var Papa=require(_0x48c3('0x11'));var Redis=require('ioredis');var authService=require(_0x48c3('0x12'));var qs=require(_0x48c3('0x13'));var as=require(_0x48c3('0x14'));var hardwareService=require(_0x48c3('0x15'));var logger=require('../../config/logger')(_0x48c3('0x16'));var utils=require(_0x48c3('0x17'));var config=require(_0x48c3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x512459,_0x2a7be7){_0x2a7be7=_0x2a7be7||0xcc;return function(_0x179766){if(_0x179766){return _0x512459['sendStatus'](_0x2a7be7);}return _0x512459[_0x48c3('0x19')](_0x2a7be7)['end']();};}function respondWithResult(_0xe60b9,_0x2e1c6a){_0x2e1c6a=_0x2e1c6a||0xc8;return function(_0x2080d3){if(_0x2080d3){return _0xe60b9[_0x48c3('0x19')](_0x2e1c6a)[_0x48c3('0x1a')](_0x2080d3);}};}function respondWithFilteredResult(_0x58d273,_0x921678){return function(_0x89af3d){if(_0x89af3d){var _0x10ca21=typeof _0x921678[_0x48c3('0x1b')]===_0x48c3('0x1c')&&typeof _0x921678['limit']===_0x48c3('0x1c');var _0x136c55=_0x89af3d[_0x48c3('0x1d')];var _0x355ac6=_0x10ca21?0x0:_0x921678[_0x48c3('0x1b')];var _0x488cc4=_0x10ca21?_0x89af3d[_0x48c3('0x1d')]:_0x921678[_0x48c3('0x1b')]+_0x921678[_0x48c3('0x1e')];var _0x3e4dd4;if(_0x488cc4>=_0x136c55){_0x488cc4=_0x136c55;_0x3e4dd4=0xc8;}else{_0x3e4dd4=0xce;}_0x58d273[_0x48c3('0x19')](_0x3e4dd4);return _0x58d273['set'](_0x48c3('0x1f'),_0x355ac6+'-'+_0x488cc4+'/'+_0x136c55)[_0x48c3('0x1a')](_0x89af3d);}return null;};}function patchUpdates(_0x34460c){return function(_0x4274fc){try{jsonpatch[_0x48c3('0x20')](_0x4274fc,_0x34460c,!![]);}catch(_0x3dbc7d){return BPromise[_0x48c3('0x21')](_0x3dbc7d);}return _0x4274fc[_0x48c3('0x22')]();};}function saveUpdates(_0x3a0d13,_0x2081f7){return function(_0x2a978a){if(_0x2a978a){return _0x2a978a['update'](_0x3a0d13)['then'](function(_0x55c036){return _0x55c036;});}return null;};}function removeEntity(_0x1b724e,_0x312645){return function(_0xc62735){if(_0xc62735){return _0xc62735['destroy']()[_0x48c3('0x23')](function(){_0x1b724e[_0x48c3('0x19')](0xcc)[_0x48c3('0x24')]();});}};}function handleEntityNotFound(_0x5b2e3a,_0x1a33ad){return function(_0x343233){if(!_0x343233){_0x5b2e3a['sendStatus'](0x194);}return _0x343233;};}function handleError(_0x3b4915,_0x129043){_0x129043=_0x129043||0x1f4;return function(_0x3a8ae0){logger['error'](_0x3a8ae0['stack']);if(_0x3a8ae0['name']){delete _0x3a8ae0[_0x48c3('0x25')];}_0x3b4915[_0x48c3('0x19')](_0x129043)[_0x48c3('0x26')](_0x3a8ae0);};}exports[_0x48c3('0x27')]=function(_0x1366d7,_0x55fcca){var _0x58de9a={},_0x444cff={},_0x10b805={'count':0x0,'rows':[]};var _0x1e8874=_[_0x48c3('0x28')](db[_0x48c3('0x29')]['rawAttributes'],function(_0x50f816){return{'name':_0x50f816[_0x48c3('0x2a')],'type':_0x50f816[_0x48c3('0x2b')][_0x48c3('0x2c')]};});_0x444cff[_0x48c3('0x2d')]=_[_0x48c3('0x28')](_0x1e8874,_0x48c3('0x25'));_0x444cff[_0x48c3('0x2e')]=_[_0x48c3('0x2f')](_0x1366d7[_0x48c3('0x2e')]);_0x444cff['filters']=_[_0x48c3('0x30')](_0x444cff['model'],_0x444cff[_0x48c3('0x2e')]);_0x58de9a[_0x48c3('0x31')]=_['intersection'](_0x444cff[_0x48c3('0x2d')],qs[_0x48c3('0x32')](_0x1366d7[_0x48c3('0x2e')][_0x48c3('0x32')]));_0x58de9a[_0x48c3('0x31')]=_0x58de9a[_0x48c3('0x31')][_0x48c3('0x33')]?_0x58de9a[_0x48c3('0x31')]:_0x444cff[_0x48c3('0x2d')];if(!_0x1366d7[_0x48c3('0x2e')][_0x48c3('0x34')](_0x48c3('0x35'))){_0x58de9a[_0x48c3('0x1e')]=qs['limit'](_0x1366d7[_0x48c3('0x2e')][_0x48c3('0x1e')]);_0x58de9a[_0x48c3('0x1b')]=qs['offset'](_0x1366d7[_0x48c3('0x2e')][_0x48c3('0x1b')]);}_0x58de9a['order']=qs[_0x48c3('0x36')](_0x1366d7[_0x48c3('0x2e')][_0x48c3('0x36')]);_0x58de9a[_0x48c3('0x37')]=qs[_0x48c3('0x38')](_[_0x48c3('0x39')](_0x1366d7[_0x48c3('0x2e')],_0x444cff[_0x48c3('0x38')]),_0x1e8874);if(_0x1366d7['query'][_0x48c3('0x3a')]){_0x58de9a[_0x48c3('0x37')]=_['merge'](_0x58de9a[_0x48c3('0x37')],{'$or':_['map'](_0x1e8874,function(_0x2171b5){if(_0x2171b5[_0x48c3('0x2b')]!==_0x48c3('0x3b')){var _0x5bebf3={};_0x5bebf3[_0x2171b5[_0x48c3('0x25')]]={'$like':'%'+_0x1366d7['query']['filter']+'%'};return _0x5bebf3;}})});}_0x58de9a=_[_0x48c3('0x3c')]({},_0x58de9a,_0x1366d7[_0x48c3('0x3d')]);var _0x3bf6e4={'where':_0x58de9a[_0x48c3('0x37')]};return db[_0x48c3('0x29')]['count'](_0x3bf6e4)[_0x48c3('0x23')](function(_0x26869b){_0x10b805[_0x48c3('0x1d')]=_0x26869b;if(_0x1366d7[_0x48c3('0x2e')]['includeAll']){_0x58de9a[_0x48c3('0x3e')]=[{'all':!![]}];}return db[_0x48c3('0x29')][_0x48c3('0x3f')](_0x58de9a);})[_0x48c3('0x23')](function(_0x3bb4c1){_0x10b805[_0x48c3('0x40')]=_0x3bb4c1;return _0x10b805;})[_0x48c3('0x23')](respondWithFilteredResult(_0x55fcca,_0x58de9a))[_0x48c3('0x41')](handleError(_0x55fcca,null));};exports[_0x48c3('0x42')]=function(_0x2c1da0,_0xca07db){var _0x1c8a9d={'raw':!![],'where':{'id':_0x2c1da0[_0x48c3('0x43')]['id']}},_0x394fdc={};_0x394fdc[_0x48c3('0x2d')]=_[_0x48c3('0x2f')](db[_0x48c3('0x29')][_0x48c3('0x44')]);_0x394fdc[_0x48c3('0x2e')]=_[_0x48c3('0x2f')](_0x2c1da0[_0x48c3('0x2e')]);_0x394fdc[_0x48c3('0x38')]=_[_0x48c3('0x30')](_0x394fdc['model'],_0x394fdc[_0x48c3('0x2e')]);_0x1c8a9d[_0x48c3('0x31')]=_[_0x48c3('0x30')](_0x394fdc[_0x48c3('0x2d')],qs[_0x48c3('0x32')](_0x2c1da0[_0x48c3('0x2e')][_0x48c3('0x32')]));_0x1c8a9d[_0x48c3('0x31')]=_0x1c8a9d[_0x48c3('0x31')]['length']?_0x1c8a9d[_0x48c3('0x31')]:_0x394fdc[_0x48c3('0x2d')];if(_0x2c1da0[_0x48c3('0x2e')][_0x48c3('0x45')]){_0x1c8a9d[_0x48c3('0x3e')]=[{'all':!![]}];}_0x1c8a9d=_[_0x48c3('0x3c')]({},_0x1c8a9d,_0x2c1da0['options']);return db[_0x48c3('0x29')][_0x48c3('0x46')](_0x1c8a9d)[_0x48c3('0x23')](handleEntityNotFound(_0xca07db,null))[_0x48c3('0x23')](respondWithResult(_0xca07db,null))[_0x48c3('0x41')](handleError(_0xca07db,null));};exports[_0x48c3('0x47')]=function(_0x6a5e5d,_0x3b3a8d){return db[_0x48c3('0x29')][_0x48c3('0x47')](_0x6a5e5d[_0x48c3('0x48')],{})[_0x48c3('0x23')](respondWithResult(_0x3b3a8d,0xc9))[_0x48c3('0x41')](handleError(_0x3b3a8d,null));};exports[_0x48c3('0x49')]=function(_0x1bde79,_0x5b6a83){if(_0x1bde79[_0x48c3('0x48')]['id']){delete _0x1bde79['body']['id'];}return db[_0x48c3('0x29')][_0x48c3('0x46')]({'where':{'id':_0x1bde79['params']['id']}})[_0x48c3('0x23')](handleEntityNotFound(_0x5b6a83,null))[_0x48c3('0x23')](saveUpdates(_0x1bde79[_0x48c3('0x48')],null))[_0x48c3('0x23')](respondWithResult(_0x5b6a83,null))[_0x48c3('0x41')](handleError(_0x5b6a83,null));};exports[_0x48c3('0x4a')]=function(_0x3b7f9c,_0x3942af){return db['JscriptySessionReport']['find']({'where':{'id':_0x3b7f9c['params']['id']}})[_0x48c3('0x23')](handleEntityNotFound(_0x3942af,null))[_0x48c3('0x23')](removeEntity(_0x3942af,null))[_0x48c3('0x41')](handleError(_0x3942af,null));};exports['describe']=function(_0x4141af,_0x4db314){return db['JscriptySessionReport']['describe']()[_0x48c3('0x23')](respondWithResult(_0x4db314,null))[_0x48c3('0x41')](handleError(_0x4db314,null));};exports['getQuestions']=function(_0x343342,_0x55dc77,_0x11e43a){var _0x5cae15={'raw':!![],'where':{}};var _0x3e340c={};var _0x217569={'count':0x0,'rows':[]};return db[_0x48c3('0x29')][_0x48c3('0x4b')]({'where':{'id':_0x343342['params']['id']}})[_0x48c3('0x23')](handleEntityNotFound(_0x55dc77,null))[_0x48c3('0x23')](function(_0x459541){if(_0x459541){_0x3e340c[_0x48c3('0x2d')]=_['keys'](db[_0x48c3('0x4c')]['rawAttributes']);_0x3e340c[_0x48c3('0x2e')]=_[_0x48c3('0x2f')](_0x343342['query']);_0x3e340c['filters']=_[_0x48c3('0x30')](_0x3e340c['model'],_0x3e340c[_0x48c3('0x2e')]);_0x5cae15[_0x48c3('0x31')]=_[_0x48c3('0x30')](_0x3e340c[_0x48c3('0x2d')],qs[_0x48c3('0x32')](_0x343342[_0x48c3('0x2e')]['fields']));_0x5cae15['attributes']=_0x5cae15[_0x48c3('0x31')]['length']?_0x5cae15[_0x48c3('0x31')]:_0x3e340c[_0x48c3('0x2d')];if(!_0x343342[_0x48c3('0x2e')][_0x48c3('0x34')](_0x48c3('0x35'))){_0x5cae15[_0x48c3('0x1e')]=qs[_0x48c3('0x1e')](_0x343342['query'][_0x48c3('0x1e')]);_0x5cae15['offset']=qs[_0x48c3('0x1b')](_0x343342[_0x48c3('0x2e')][_0x48c3('0x1b')]);}_0x5cae15[_0x48c3('0x4d')]=qs[_0x48c3('0x36')](_0x343342[_0x48c3('0x2e')][_0x48c3('0x36')]);_0x5cae15[_0x48c3('0x37')]=qs['filters'](_[_0x48c3('0x39')](_0x343342['query'],_0x3e340c[_0x48c3('0x38')]));_0x5cae15['where'][_0x48c3('0x4e')]=_0x459541['id'];if(_0x343342[_0x48c3('0x2e')][_0x48c3('0x3a')]){_0x5cae15[_0x48c3('0x37')]=_[_0x48c3('0x3c')](_0x5cae15[_0x48c3('0x37')],{'$or':_['map'](_0x5cae15[_0x48c3('0x31')],function(_0x5b4f69){var _0x205120={};_0x205120[_0x5b4f69]={'$like':'%'+_0x343342['query'][_0x48c3('0x3a')]+'%'};return _0x205120;})});}_0x5cae15=_[_0x48c3('0x3c')]({},_0x5cae15,_0x343342[_0x48c3('0x3d')]);return db[_0x48c3('0x4c')][_0x48c3('0x1d')]({'where':_0x5cae15[_0x48c3('0x37')]})[_0x48c3('0x23')](function(_0x33c224){_0x217569['count']=_0x33c224;if(_0x343342[_0x48c3('0x2e')][_0x48c3('0x45')]){_0x5cae15[_0x48c3('0x3e')]=[{'all':!![]}];}return db[_0x48c3('0x4c')][_0x48c3('0x3f')](_0x5cae15);})[_0x48c3('0x23')](function(_0x3bc928){_0x217569[_0x48c3('0x40')]=_0x3bc928;return _0x217569;});}})[_0x48c3('0x23')](respondWithFilteredResult(_0x55dc77,_0x5cae15))['catch'](handleError(_0x55dc77,null));}; \ No newline at end of file +var _0xccd6=['filter','type','merge','options','then','includeAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','findOne','JscriptyQuestionReport','nolimit','SessionId','include','zip-dir','request-promise','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','JscriptySessionReport','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters'];(function(_0x520c97,_0x4f5aea){var _0x3b0655=function(_0x5b2c08){while(--_0x5b2c08){_0x520c97['push'](_0x520c97['shift']());}};_0x3b0655(++_0x4f5aea);}(_0xccd6,0xb1));var _0x6ccd=function(_0x4e04a8,_0x2f2d6a){_0x4e04a8=_0x4e04a8-0x0;var _0x6c3e6f=_0xccd6[_0x4e04a8];return _0x6c3e6f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ccd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ccd('0x1'));var moment=require(_0x6ccd('0x2'));var BPromise=require(_0x6ccd('0x3'));var Mustache=require(_0x6ccd('0x4'));var util=require(_0x6ccd('0x5'));var path=require(_0x6ccd('0x6'));var sox=require(_0x6ccd('0x7'));var csv=require(_0x6ccd('0x8'));var ejs=require(_0x6ccd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ccd('0xa'));var squel=require(_0x6ccd('0xb'));var crypto=require(_0x6ccd('0xc'));var jsforce=require(_0x6ccd('0xd'));var deskjs=require(_0x6ccd('0xe'));var toCsv=require(_0x6ccd('0x8'));var querystring=require('querystring');var Papa=require(_0x6ccd('0xf'));var Redis=require(_0x6ccd('0x10'));var authService=require(_0x6ccd('0x11'));var qs=require(_0x6ccd('0x12'));var as=require(_0x6ccd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ccd('0x14'))('api');var utils=require(_0x6ccd('0x15'));var config=require(_0x6ccd('0x16'));var licenseUtil=require(_0x6ccd('0x17'));var db=require(_0x6ccd('0x18'))['db'];function respondWithStatusCode(_0x1907e0,_0x38d477){_0x38d477=_0x38d477||0xcc;return function(_0x5cfc40){if(_0x5cfc40){return _0x1907e0[_0x6ccd('0x19')](_0x38d477);}return _0x1907e0[_0x6ccd('0x1a')](_0x38d477)[_0x6ccd('0x1b')]();};}function respondWithResult(_0x5aa218,_0x27a979){_0x27a979=_0x27a979||0xc8;return function(_0x520225){if(_0x520225){return _0x5aa218[_0x6ccd('0x1a')](_0x27a979)['json'](_0x520225);}};}function respondWithFilteredResult(_0x460192,_0x4226fb){return function(_0x560993){if(_0x560993){var _0x3ec62b=typeof _0x4226fb['offset']===_0x6ccd('0x1c')&&typeof _0x4226fb['limit']===_0x6ccd('0x1c');var _0x3af6dd=_0x560993[_0x6ccd('0x1d')];var _0x45e4fa=_0x3ec62b?0x0:_0x4226fb[_0x6ccd('0x1e')];var _0x318d41=_0x3ec62b?_0x560993[_0x6ccd('0x1d')]:_0x4226fb[_0x6ccd('0x1e')]+_0x4226fb[_0x6ccd('0x1f')];var _0x587ad0;if(_0x318d41>=_0x3af6dd){_0x318d41=_0x3af6dd;_0x587ad0=0xc8;}else{_0x587ad0=0xce;}_0x460192[_0x6ccd('0x1a')](_0x587ad0);return _0x460192[_0x6ccd('0x20')](_0x6ccd('0x21'),_0x45e4fa+'-'+_0x318d41+'/'+_0x3af6dd)['json'](_0x560993);}return null;};}function patchUpdates(_0x4d152b){return function(_0x114ad7){try{jsonpatch[_0x6ccd('0x22')](_0x114ad7,_0x4d152b,!![]);}catch(_0x5e5946){return BPromise[_0x6ccd('0x23')](_0x5e5946);}return _0x114ad7[_0x6ccd('0x24')]();};}function saveUpdates(_0x11e674,_0x353d27){return function(_0xe85b30){if(_0xe85b30){return _0xe85b30[_0x6ccd('0x25')](_0x11e674)['then'](function(_0x23cdd0){return _0x23cdd0;});}return null;};}function removeEntity(_0x5881e7,_0x33406c){return function(_0xac5d8c){if(_0xac5d8c){return _0xac5d8c[_0x6ccd('0x26')]()['then'](function(){_0x5881e7[_0x6ccd('0x1a')](0xcc)[_0x6ccd('0x1b')]();});}};}function handleEntityNotFound(_0x252aee,_0x18661d){return function(_0x345b72){if(!_0x345b72){_0x252aee[_0x6ccd('0x19')](0x194);}return _0x345b72;};}function handleError(_0x92167f,_0x2c965c){_0x2c965c=_0x2c965c||0x1f4;return function(_0x47996e){logger[_0x6ccd('0x27')](_0x47996e[_0x6ccd('0x28')]);if(_0x47996e[_0x6ccd('0x29')]){delete _0x47996e[_0x6ccd('0x29')];}_0x92167f[_0x6ccd('0x1a')](_0x2c965c)[_0x6ccd('0x2a')](_0x47996e);};}exports['index']=function(_0x441576,_0x279dfb){var _0x5c5870={},_0x23dcc2={},_0x51f647={'count':0x0,'rows':[]};var _0x475b34=_[_0x6ccd('0x2b')](db[_0x6ccd('0x2c')]['rawAttributes'],function(_0x4a3045){return{'name':_0x4a3045[_0x6ccd('0x2d')],'type':_0x4a3045['type']['key']};});_0x23dcc2[_0x6ccd('0x2e')]=_[_0x6ccd('0x2b')](_0x475b34,_0x6ccd('0x29'));_0x23dcc2[_0x6ccd('0x2f')]=_[_0x6ccd('0x30')](_0x441576[_0x6ccd('0x2f')]);_0x23dcc2['filters']=_[_0x6ccd('0x31')](_0x23dcc2[_0x6ccd('0x2e')],_0x23dcc2[_0x6ccd('0x2f')]);_0x5c5870['attributes']=_[_0x6ccd('0x31')](_0x23dcc2[_0x6ccd('0x2e')],qs[_0x6ccd('0x32')](_0x441576[_0x6ccd('0x2f')]['fields']));_0x5c5870[_0x6ccd('0x33')]=_0x5c5870['attributes']['length']?_0x5c5870[_0x6ccd('0x33')]:_0x23dcc2[_0x6ccd('0x2e')];if(!_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x34')]('nolimit')){_0x5c5870[_0x6ccd('0x1f')]=qs[_0x6ccd('0x1f')](_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x1f')]);_0x5c5870[_0x6ccd('0x1e')]=qs[_0x6ccd('0x1e')](_0x441576['query'][_0x6ccd('0x1e')]);}_0x5c5870[_0x6ccd('0x35')]=qs[_0x6ccd('0x36')](_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x36')]);_0x5c5870[_0x6ccd('0x37')]=qs[_0x6ccd('0x38')](_['pick'](_0x441576[_0x6ccd('0x2f')],_0x23dcc2[_0x6ccd('0x38')]),_0x475b34);if(_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x39')]){_0x5c5870['where']=_['merge'](_0x5c5870[_0x6ccd('0x37')],{'$or':_[_0x6ccd('0x2b')](_0x475b34,function(_0x2341be){if(_0x2341be[_0x6ccd('0x3a')]!=='VIRTUAL'){var _0x1198bf={};_0x1198bf[_0x2341be['name']]={'$like':'%'+_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x39')]+'%'};return _0x1198bf;}})});}_0x5c5870=_[_0x6ccd('0x3b')]({},_0x5c5870,_0x441576[_0x6ccd('0x3c')]);var _0x443b4d={'where':_0x5c5870[_0x6ccd('0x37')]};return db[_0x6ccd('0x2c')][_0x6ccd('0x1d')](_0x443b4d)[_0x6ccd('0x3d')](function(_0x5f10fb){_0x51f647[_0x6ccd('0x1d')]=_0x5f10fb;if(_0x441576[_0x6ccd('0x2f')][_0x6ccd('0x3e')]){_0x5c5870['include']=[{'all':!![]}];}return db[_0x6ccd('0x2c')]['findAll'](_0x5c5870);})[_0x6ccd('0x3d')](function(_0xc60cf){_0x51f647[_0x6ccd('0x3f')]=_0xc60cf;return _0x51f647;})[_0x6ccd('0x3d')](respondWithFilteredResult(_0x279dfb,_0x5c5870))[_0x6ccd('0x40')](handleError(_0x279dfb,null));};exports[_0x6ccd('0x41')]=function(_0x256e97,_0xa5e8bb){var _0x23876f={'raw':!![],'where':{'id':_0x256e97['params']['id']}},_0x5d1759={};_0x5d1759[_0x6ccd('0x2e')]=_[_0x6ccd('0x30')](db[_0x6ccd('0x2c')][_0x6ccd('0x42')]);_0x5d1759[_0x6ccd('0x2f')]=_[_0x6ccd('0x30')](_0x256e97[_0x6ccd('0x2f')]);_0x5d1759[_0x6ccd('0x38')]=_[_0x6ccd('0x31')](_0x5d1759[_0x6ccd('0x2e')],_0x5d1759['query']);_0x23876f['attributes']=_['intersection'](_0x5d1759[_0x6ccd('0x2e')],qs[_0x6ccd('0x32')](_0x256e97['query']['fields']));_0x23876f['attributes']=_0x23876f[_0x6ccd('0x33')][_0x6ccd('0x43')]?_0x23876f[_0x6ccd('0x33')]:_0x5d1759['model'];if(_0x256e97[_0x6ccd('0x2f')][_0x6ccd('0x3e')]){_0x23876f['include']=[{'all':!![]}];}_0x23876f=_['merge']({},_0x23876f,_0x256e97[_0x6ccd('0x3c')]);return db[_0x6ccd('0x2c')][_0x6ccd('0x44')](_0x23876f)[_0x6ccd('0x3d')](handleEntityNotFound(_0xa5e8bb,null))[_0x6ccd('0x3d')](respondWithResult(_0xa5e8bb,null))['catch'](handleError(_0xa5e8bb,null));};exports[_0x6ccd('0x45')]=function(_0x2bf6ff,_0x61e9b4){return db[_0x6ccd('0x2c')][_0x6ccd('0x45')](_0x2bf6ff[_0x6ccd('0x46')],{})[_0x6ccd('0x3d')](respondWithResult(_0x61e9b4,0xc9))[_0x6ccd('0x40')](handleError(_0x61e9b4,null));};exports['update']=function(_0x5f2fb9,_0x1cc171){if(_0x5f2fb9[_0x6ccd('0x46')]['id']){delete _0x5f2fb9['body']['id'];}return db[_0x6ccd('0x2c')][_0x6ccd('0x44')]({'where':{'id':_0x5f2fb9[_0x6ccd('0x47')]['id']}})[_0x6ccd('0x3d')](handleEntityNotFound(_0x1cc171,null))[_0x6ccd('0x3d')](saveUpdates(_0x5f2fb9['body'],null))['then'](respondWithResult(_0x1cc171,null))[_0x6ccd('0x40')](handleError(_0x1cc171,null));};exports[_0x6ccd('0x26')]=function(_0x1a6646,_0x6c0c74){return db[_0x6ccd('0x2c')][_0x6ccd('0x44')]({'where':{'id':_0x1a6646['params']['id']}})['then'](handleEntityNotFound(_0x6c0c74,null))[_0x6ccd('0x3d')](removeEntity(_0x6c0c74,null))[_0x6ccd('0x40')](handleError(_0x6c0c74,null));};exports['describe']=function(_0x363349,_0x3350c0){return db[_0x6ccd('0x2c')][_0x6ccd('0x48')]()[_0x6ccd('0x3d')](respondWithResult(_0x3350c0,null))[_0x6ccd('0x40')](handleError(_0x3350c0,null));};exports['getQuestions']=function(_0x2ea512,_0xd22ad5,_0x2493f8){var _0x3297eb={'raw':!![],'where':{}};var _0x17f910={};var _0x34fff5={'count':0x0,'rows':[]};return db[_0x6ccd('0x2c')][_0x6ccd('0x49')]({'where':{'id':_0x2ea512[_0x6ccd('0x47')]['id']}})['then'](handleEntityNotFound(_0xd22ad5,null))['then'](function(_0x5e274b){if(_0x5e274b){_0x17f910[_0x6ccd('0x2e')]=_[_0x6ccd('0x30')](db[_0x6ccd('0x4a')]['rawAttributes']);_0x17f910['query']=_[_0x6ccd('0x30')](_0x2ea512[_0x6ccd('0x2f')]);_0x17f910[_0x6ccd('0x38')]=_[_0x6ccd('0x31')](_0x17f910['model'],_0x17f910['query']);_0x3297eb[_0x6ccd('0x33')]=_[_0x6ccd('0x31')](_0x17f910[_0x6ccd('0x2e')],qs['fields'](_0x2ea512['query'][_0x6ccd('0x32')]));_0x3297eb[_0x6ccd('0x33')]=_0x3297eb[_0x6ccd('0x33')]['length']?_0x3297eb[_0x6ccd('0x33')]:_0x17f910[_0x6ccd('0x2e')];if(!_0x2ea512[_0x6ccd('0x2f')]['hasOwnProperty'](_0x6ccd('0x4b'))){_0x3297eb[_0x6ccd('0x1f')]=qs[_0x6ccd('0x1f')](_0x2ea512['query'][_0x6ccd('0x1f')]);_0x3297eb[_0x6ccd('0x1e')]=qs['offset'](_0x2ea512['query'][_0x6ccd('0x1e')]);}_0x3297eb[_0x6ccd('0x35')]=qs['sort'](_0x2ea512[_0x6ccd('0x2f')][_0x6ccd('0x36')]);_0x3297eb[_0x6ccd('0x37')]=qs[_0x6ccd('0x38')](_['pick'](_0x2ea512[_0x6ccd('0x2f')],_0x17f910['filters']));_0x3297eb['where'][_0x6ccd('0x4c')]=_0x5e274b['id'];if(_0x2ea512[_0x6ccd('0x2f')]['filter']){_0x3297eb[_0x6ccd('0x37')]=_[_0x6ccd('0x3b')](_0x3297eb[_0x6ccd('0x37')],{'$or':_[_0x6ccd('0x2b')](_0x3297eb['attributes'],function(_0x2289a7){var _0x4d857f={};_0x4d857f[_0x2289a7]={'$like':'%'+_0x2ea512['query']['filter']+'%'};return _0x4d857f;})});}_0x3297eb=_[_0x6ccd('0x3b')]({},_0x3297eb,_0x2ea512['options']);return db[_0x6ccd('0x4a')][_0x6ccd('0x1d')]({'where':_0x3297eb[_0x6ccd('0x37')]})[_0x6ccd('0x3d')](function(_0x2cd15d){_0x34fff5[_0x6ccd('0x1d')]=_0x2cd15d;if(_0x2ea512[_0x6ccd('0x2f')][_0x6ccd('0x3e')]){_0x3297eb[_0x6ccd('0x4d')]=[{'all':!![]}];}return db[_0x6ccd('0x4a')]['findAll'](_0x3297eb);})[_0x6ccd('0x3d')](function(_0x5302a5){_0x34fff5[_0x6ccd('0x3f')]=_0x5302a5;return _0x34fff5;});}})[_0x6ccd('0x3d')](respondWithFilteredResult(_0xd22ad5,_0x3297eb))[_0x6ccd('0x40')](handleError(_0xd22ad5,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index e0af7ac..20a90f3 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 _0x3f8a=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x230381,_0x59d77e){var _0x559739=function(_0x2af2eb){while(--_0x2af2eb){_0x230381['push'](_0x230381['shift']());}};_0x559739(++_0x59d77e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4edb67,_0x16b3fe){_0x4edb67=_0x4edb67-0x0;var _0x3d94b5=_0x3f8a[_0x4edb67];return _0x3d94b5;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x1bc72b,_0x51ce5a){_0x1bc72b=_0x1bc72b-0x0;var _0x4ad09d=_0x0f4d[_0x1bc72b];return _0x4ad09d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),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 fc31136..36dadcf 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3c1e2c,_0xf28bb5){var _0x11753e=function(_0x51f4d2){while(--_0x51f4d2){_0x3c1e2c['push'](_0x3c1e2c['shift']());}};_0x11753e(++_0xf28bb5);}(_0x9f0e,0x116));var _0xe9f0=function(_0x22d90e,_0x1e9616){_0x22d90e=_0x22d90e-0x0;var _0x13e406=_0x9f0e[_0x22d90e];return _0x13e406;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x48f8c4,_0x4e3dba){var _0x118849=function(_0x4f9838){while(--_0x4f9838){_0x48f8c4['push'](_0x48f8c4['shift']());}};_0x118849(++_0x4e3dba);}(_0x8952,0x17e));var _0x2895=function(_0x3e9d46,_0x3e72ad){_0x3e9d46=_0x3e9d46-0x0;var _0x493cb2=_0x8952[_0x3e9d46];return _0x493cb2;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 4056e91..d4d1507 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 _0x775b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path'];(function(_0x31bb6f,_0x388f16){var _0x5297ec=function(_0x37f213){while(--_0x37f213){_0x31bb6f['push'](_0x31bb6f['shift']());}};_0x5297ec(++_0x388f16);}(_0x775b,0xce));var _0xb775=function(_0x163cd0,_0x461c03){_0x163cd0=_0x163cd0-0x0;var _0x166213=_0x775b[_0x163cd0];return _0x166213;};'use strict';var multer=require(_0xb775('0x0'));var util=require(_0xb775('0x1'));var path=require(_0xb775('0x2'));var timeout=require(_0xb775('0x3'));var express=require('express');var router=express[_0xb775('0x4')]();var fs_extra=require(_0xb775('0x5'));var auth=require(_0xb775('0x6'));var interaction=require(_0xb775('0x7'));var config=require(_0xb775('0x8'));var controller=require(_0xb775('0x9'));router[_0xb775('0xa')]('/',controller[_0xb775('0xb')]);router[_0xb775('0xc')](_0xb775('0xd'),auth[_0xb775('0xe')](),controller[_0xb775('0xf')]);router[_0xb775('0xa')](_0xb775('0x10'),auth[_0xb775('0xe')](),controller[_0xb775('0x11')]);module[_0xb775('0x12')]=router; \ No newline at end of file +var _0xa2b2=['update','/download_log_file','downloadLogFile','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./license.controller','get','put','/:id','isAuthenticated'];(function(_0x37452f,_0x17a04c){var _0xd5b34f=function(_0x4a0f68){while(--_0x4a0f68){_0x37452f['push'](_0x37452f['shift']());}};_0xd5b34f(++_0x17a04c);}(_0xa2b2,0x1df));var _0x2a2b=function(_0x4c291e,_0x3a22a7){_0x4c291e=_0x4c291e-0x0;var _0x5e4848=_0xa2b2[_0x4c291e];return _0x5e4848;};'use strict';var multer=require('multer');var util=require(_0x2a2b('0x0'));var path=require('path');var timeout=require(_0x2a2b('0x1'));var express=require(_0x2a2b('0x2'));var router=express[_0x2a2b('0x3')]();var fs_extra=require(_0x2a2b('0x4'));var auth=require(_0x2a2b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a2b('0x6'));router[_0x2a2b('0x7')]('/',controller['index']);router[_0x2a2b('0x8')](_0x2a2b('0x9'),auth[_0x2a2b('0xa')](),controller[_0x2a2b('0xb')]);router[_0x2a2b('0x7')](_0x2a2b('0xc'),auth[_0x2a2b('0xa')](),controller[_0x2a2b('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f4b6f7f..d302f9d 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 _0xe48b=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe48b,0x1b0));var _0xbe48=function(_0x3b1fbf,_0x2fbf2f){_0x3b1fbf=_0x3b1fbf-0x0;var _0x2fea4e=_0xe48b[_0x3b1fbf];return _0x2fea4e;};'use strict';var Sequelize=require(_0xbe48('0x0'));module[_0xbe48('0x1')]={'license':{'type':Sequelize[_0xbe48('0x2')]},'data1':{'type':Sequelize[_0xbe48('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xbe48('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf28f=['exports','TEXT','STRING'];(function(_0x552eda,_0x965e93){var _0x353e80=function(_0x9a2178){while(--_0x9a2178){_0x552eda['push'](_0x552eda['shift']());}};_0x353e80(++_0x965e93);}(_0xf28f,0xed));var _0xff28=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xf28f[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require('sequelize');module[_0xff28('0x0')]={'license':{'type':Sequelize[_0xff28('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xff28('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index e7075df..5bb6ac2 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 _0xc612=['error','name','send','../../config/license/util','index','model','keys','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','License','find','checkLicense','demo','license-info.log','join','log','xcally','Content-disposition','set','Content-Type','text/plain','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0xc612,0x1aa));var _0x2c61=function(_0x46cc3f,_0x576e2c){_0x46cc3f=_0x46cc3f-0x0;var _0x40bc19=_0xc612[_0x46cc3f];return _0x40bc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c61('0x0'));var zipdir=require(_0x2c61('0x1'));var jsonpatch=require(_0x2c61('0x2'));var rp=require(_0x2c61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c61('0x4'));var util=require(_0x2c61('0x5'));var path=require(_0x2c61('0x6'));var sox=require('sox');var csv=require(_0x2c61('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c61('0x8'));var _=require(_0x2c61('0x9'));var squel=require(_0x2c61('0xa'));var crypto=require(_0x2c61('0xb'));var jsforce=require(_0x2c61('0xc'));var deskjs=require(_0x2c61('0xd'));var toCsv=require(_0x2c61('0x7'));var querystring=require(_0x2c61('0xe'));var Papa=require(_0x2c61('0xf'));var Redis=require(_0x2c61('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2c61('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c61('0x12'));var logger=require(_0x2c61('0x13'))(_0x2c61('0x14'));var utils=require(_0x2c61('0x15'));var config=require(_0x2c61('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33a4e8,_0x25b81d){_0x25b81d=_0x25b81d||0xcc;return function(_0x3fe6a5){if(_0x3fe6a5){return _0x33a4e8[_0x2c61('0x17')](_0x25b81d);}return _0x33a4e8[_0x2c61('0x18')](_0x25b81d)[_0x2c61('0x19')]();};}function respondWithResult(_0x5ac56a,_0xadebc){_0xadebc=_0xadebc||0xc8;return function(_0x45ed6a){if(_0x45ed6a){return _0x5ac56a[_0x2c61('0x18')](_0xadebc)[_0x2c61('0x1a')](_0x45ed6a);}};}function respondWithFilteredResult(_0x4b4636,_0x5167e7){return function(_0x1c4ef2){if(_0x1c4ef2){var _0x5a3521=typeof _0x5167e7['offset']===_0x2c61('0x1b')&&typeof _0x5167e7[_0x2c61('0x1c')]===_0x2c61('0x1b');var _0x5c8de3=_0x1c4ef2['count'];var _0x11bcc2=_0x5a3521?0x0:_0x5167e7['offset'];var _0x326b49=_0x5a3521?_0x1c4ef2[_0x2c61('0x1d')]:_0x5167e7['offset']+_0x5167e7[_0x2c61('0x1c')];var _0x53b53f;if(_0x326b49>=_0x5c8de3){_0x326b49=_0x5c8de3;_0x53b53f=0xc8;}else{_0x53b53f=0xce;}_0x4b4636[_0x2c61('0x18')](_0x53b53f);return _0x4b4636['set'](_0x2c61('0x1e'),_0x11bcc2+'-'+_0x326b49+'/'+_0x5c8de3)['json'](_0x1c4ef2);}return null;};}function patchUpdates(_0x1ebac2){return function(_0x42322b){try{jsonpatch[_0x2c61('0x1f')](_0x42322b,_0x1ebac2,!![]);}catch(_0x26134e){return BPromise[_0x2c61('0x20')](_0x26134e);}return _0x42322b['save']();};}function saveUpdates(_0x13a8dd,_0xcee353){return function(_0x293f24){if(_0x293f24){return _0x293f24[_0x2c61('0x21')](_0x13a8dd)[_0x2c61('0x22')](function(_0x49b8e3){return _0x49b8e3;});}return null;};}function removeEntity(_0x2ac832,_0x3d25ee){return function(_0x16d622){if(_0x16d622){return _0x16d622[_0x2c61('0x23')]()['then'](function(){_0x2ac832[_0x2c61('0x18')](0xcc)[_0x2c61('0x19')]();});}};}function handleEntityNotFound(_0xe35f5b,_0x162e47){return function(_0x356b8b){if(!_0x356b8b){_0xe35f5b['sendStatus'](0x194);}return _0x356b8b;};}function handleError(_0x42c6ec,_0x342140){_0x342140=_0x342140||0x1f4;return function(_0x57f609){logger[_0x2c61('0x24')](_0x57f609['stack']);if(_0x57f609[_0x2c61('0x25')]){delete _0x57f609[_0x2c61('0x25')];}_0x42c6ec[_0x2c61('0x18')](_0x342140)[_0x2c61('0x26')](_0x57f609);};}var utilLicense=require(_0x2c61('0x27'));exports[_0x2c61('0x28')]=function(_0x272291,_0x17496b){var _0x52898e={'raw':!![],'where':{'id':0x1}},_0x3485be={};_0x3485be[_0x2c61('0x29')]=_[_0x2c61('0x2a')](db['License']['rawAttributes']);_0x3485be['query']=_['keys'](_0x272291[_0x2c61('0x2b')]);_0x3485be[_0x2c61('0x2c')]=_[_0x2c61('0x2d')](_0x3485be[_0x2c61('0x29')],_0x3485be[_0x2c61('0x2b')]);_0x52898e[_0x2c61('0x2e')]=_[_0x2c61('0x2d')](_0x3485be[_0x2c61('0x29')],qs['fields'](_0x272291[_0x2c61('0x2b')][_0x2c61('0x2f')]));_0x52898e[_0x2c61('0x2e')]=_0x52898e[_0x2c61('0x2e')][_0x2c61('0x30')]?_0x52898e[_0x2c61('0x2e')]:_0x3485be[_0x2c61('0x29')];_0x52898e=_[_0x2c61('0x31')]({},_0x52898e,_0x272291[_0x2c61('0x32')]);return utilLicense[_0x2c61('0x33')](_0x52898e)[_0x2c61('0x22')](respondWithResult(_0x17496b,null))[_0x2c61('0x34')](handleError(_0x17496b,null));};exports[_0x2c61('0x21')]=function(_0x1fdbf8,_0x4660e4){if(_0x1fdbf8[_0x2c61('0x35')]['id']){delete _0x1fdbf8[_0x2c61('0x35')]['id'];}return db[_0x2c61('0x36')][_0x2c61('0x37')]({'where':{'id':_0x1fdbf8['params']['id']}})['then'](handleEntityNotFound(_0x4660e4,null))['then'](function(_0x40980d){var _0x42081d=_0x40980d['get']({'plain':!![]});return utilLicense[_0x2c61('0x38')](_0x42081d,_0x1fdbf8['body']['key']);})[_0x2c61('0x22')](function(_0x59b1db){if(!_0x59b1db[_0x2c61('0x39')]){return saveUpdates(_0x1fdbf8[_0x2c61('0x35')],null);}return _0x59b1db;})[_0x2c61('0x22')](respondWithResult(_0x4660e4,null))[_0x2c61('0x34')](handleError(_0x4660e4,null));};exports['downloadLogFile']=function(_0x400c4a,_0x3ce872){var _0xe53544=_0x2c61('0x3a');var _0x3217f5=path[_0x2c61('0x3b')]('/var',_0x2c61('0x3c'),_0x2c61('0x3d'),_0xe53544);_0x3ce872['setHeader'](_0x2c61('0x3e'),'attachment;\x20filename='+_0xe53544);_0x3ce872[_0x2c61('0x3f')](_0x2c61('0x40'),_0x2c61('0x41'));_0x3ce872['download'](_0x3217f5);}; \ No newline at end of file +var _0x7cc6=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','status','end','sendStatus','error','name','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','update','body','License','params','get','checkLicense','key','demo','catch','downloadLogFile','license-info.log','log','xcally','setHeader','Content-disposition','set','Content-Type','text/plain','download'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x7cc6,0x19e));var _0x67cc=function(_0x128c2a,_0xcec374){_0x128c2a=_0x128c2a-0x0;var _0x1621b4=_0x7cc6[_0x128c2a];return _0x1621b4;};'use strict';var emlformat=require(_0x67cc('0x0'));var rimraf=require(_0x67cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x67cc('0x2'));var moment=require('moment');var BPromise=require(_0x67cc('0x3'));var Mustache=require(_0x67cc('0x4'));var util=require(_0x67cc('0x5'));var path=require(_0x67cc('0x6'));var sox=require('sox');var csv=require(_0x67cc('0x7'));var ejs=require(_0x67cc('0x8'));var fs=require('fs');var fs_extra=require(_0x67cc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x67cc('0xa'));var jsforce=require(_0x67cc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x67cc('0xc'));var Papa=require(_0x67cc('0xd'));var Redis=require(_0x67cc('0xe'));var authService=require(_0x67cc('0xf'));var qs=require(_0x67cc('0x10'));var as=require(_0x67cc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67cc('0x12'))(_0x67cc('0x13'));var utils=require(_0x67cc('0x14'));var config=require(_0x67cc('0x15'));var licenseUtil=require(_0x67cc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x562679,_0x1b4a9b){_0x1b4a9b=_0x1b4a9b||0xcc;return function(_0x27b4eb){if(_0x27b4eb){return _0x562679['sendStatus'](_0x1b4a9b);}return _0x562679['status'](_0x1b4a9b)['end']();};}function respondWithResult(_0x3e6cec,_0xcead3f){_0xcead3f=_0xcead3f||0xc8;return function(_0x3c12da){if(_0x3c12da){return _0x3e6cec['status'](_0xcead3f)[_0x67cc('0x17')](_0x3c12da);}};}function respondWithFilteredResult(_0x2e7182,_0xafec8a){return function(_0xab0d64){if(_0xab0d64){var _0x1336c=typeof _0xafec8a[_0x67cc('0x18')]===_0x67cc('0x19')&&typeof _0xafec8a[_0x67cc('0x1a')]===_0x67cc('0x19');var _0x3b1be7=_0xab0d64[_0x67cc('0x1b')];var _0x45c87f=_0x1336c?0x0:_0xafec8a[_0x67cc('0x18')];var _0x5ba303=_0x1336c?_0xab0d64[_0x67cc('0x1b')]:_0xafec8a[_0x67cc('0x18')]+_0xafec8a['limit'];var _0x4da884;if(_0x5ba303>=_0x3b1be7){_0x5ba303=_0x3b1be7;_0x4da884=0xc8;}else{_0x4da884=0xce;}_0x2e7182['status'](_0x4da884);return _0x2e7182['set'](_0x67cc('0x1c'),_0x45c87f+'-'+_0x5ba303+'/'+_0x3b1be7)[_0x67cc('0x17')](_0xab0d64);}return null;};}function patchUpdates(_0x240281){return function(_0x58f095){try{jsonpatch[_0x67cc('0x1d')](_0x58f095,_0x240281,!![]);}catch(_0x23549a){return BPromise[_0x67cc('0x1e')](_0x23549a);}return _0x58f095[_0x67cc('0x1f')]();};}function saveUpdates(_0x215f85,_0x5d35be){return function(_0xd2d6dd){if(_0xd2d6dd){return _0xd2d6dd['update'](_0x215f85)[_0x67cc('0x20')](function(_0x2dbfa4){return _0x2dbfa4;});}return null;};}function removeEntity(_0x557c10,_0x10c8c9){return function(_0x3f84c8){if(_0x3f84c8){return _0x3f84c8[_0x67cc('0x21')]()['then'](function(){_0x557c10[_0x67cc('0x22')](0xcc)[_0x67cc('0x23')]();});}};}function handleEntityNotFound(_0x1985af,_0xdb220e){return function(_0x44664b){if(!_0x44664b){_0x1985af[_0x67cc('0x24')](0x194);}return _0x44664b;};}function handleError(_0x221bbd,_0x1a7ac7){_0x1a7ac7=_0x1a7ac7||0x1f4;return function(_0x27b9d2){logger[_0x67cc('0x25')](_0x27b9d2['stack']);if(_0x27b9d2[_0x67cc('0x26')]){delete _0x27b9d2[_0x67cc('0x26')];}_0x221bbd[_0x67cc('0x22')](_0x1a7ac7)['send'](_0x27b9d2);};}var utilLicense=require(_0x67cc('0x16'));exports[_0x67cc('0x27')]=function(_0x311a71,_0x2dedf5){var _0x10afe9={'raw':!![],'where':{'id':0x1}},_0x5929e0={};_0x5929e0[_0x67cc('0x28')]=_[_0x67cc('0x29')](db['License'][_0x67cc('0x2a')]);_0x5929e0[_0x67cc('0x2b')]=_['keys'](_0x311a71[_0x67cc('0x2b')]);_0x5929e0[_0x67cc('0x2c')]=_[_0x67cc('0x2d')](_0x5929e0[_0x67cc('0x28')],_0x5929e0[_0x67cc('0x2b')]);_0x10afe9[_0x67cc('0x2e')]=_[_0x67cc('0x2d')](_0x5929e0['model'],qs[_0x67cc('0x2f')](_0x311a71[_0x67cc('0x2b')]['fields']));_0x10afe9[_0x67cc('0x2e')]=_0x10afe9[_0x67cc('0x2e')]['length']?_0x10afe9[_0x67cc('0x2e')]:_0x5929e0['model'];_0x10afe9=_[_0x67cc('0x30')]({},_0x10afe9,_0x311a71[_0x67cc('0x31')]);return utilLicense['getLicense'](_0x10afe9)[_0x67cc('0x20')](respondWithResult(_0x2dedf5,null))['catch'](handleError(_0x2dedf5,null));};exports[_0x67cc('0x32')]=function(_0xf10042,_0x3cd851){if(_0xf10042[_0x67cc('0x33')]['id']){delete _0xf10042['body']['id'];}return db[_0x67cc('0x34')]['find']({'where':{'id':_0xf10042[_0x67cc('0x35')]['id']}})[_0x67cc('0x20')](handleEntityNotFound(_0x3cd851,null))[_0x67cc('0x20')](function(_0x484070){var _0x448973=_0x484070[_0x67cc('0x36')]({'plain':!![]});return utilLicense[_0x67cc('0x37')](_0x448973,_0xf10042['body'][_0x67cc('0x38')]);})['then'](function(_0x28d9f3){if(!_0x28d9f3[_0x67cc('0x39')]){return saveUpdates(_0xf10042[_0x67cc('0x33')],null);}return _0x28d9f3;})['then'](respondWithResult(_0x3cd851,null))[_0x67cc('0x3a')](handleError(_0x3cd851,null));};exports[_0x67cc('0x3b')]=function(_0xc96d07,_0x41a17c){var _0x36d765=_0x67cc('0x3c');var _0x6ba379=path['join']('/var',_0x67cc('0x3d'),_0x67cc('0x3e'),_0x36d765);_0x41a17c[_0x67cc('0x3f')](_0x67cc('0x40'),'attachment;\x20filename='+_0x36d765);_0x41a17c[_0x67cc('0x41')](_0x67cc('0x42'),_0x67cc('0x43'));_0x41a17c[_0x67cc('0x44')](_0x6ba379);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1d6e709..16c5695 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 _0xddf3=['request-promise','path','../../config/environment','exports','define','License','license','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5367c5,_0x439de4){var _0x22c25e=function(_0x54317c){while(--_0x54317c){_0x5367c5['push'](_0x5367c5['shift']());}};_0x22c25e(++_0x439de4);}(_0xddf3,0x1b7));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ddf('0x0'));var util=require('util');var logger=require(_0x3ddf('0x1'))(_0x3ddf('0x2'));var moment=require(_0x3ddf('0x3'));var BPromise=require(_0x3ddf('0x4'));var rp=require(_0x3ddf('0x5'));var fs=require('fs');var path=require(_0x3ddf('0x6'));var rimraf=require('rimraf');var config=require(_0x3ddf('0x7'));var attributes=require('./license.attributes');module[_0x3ddf('0x8')]=function(_0x136581,_0x185e8f){return _0x136581[_0x3ddf('0x9')](_0x3ddf('0xa'),attributes,{'tableName':_0x3ddf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc016=['License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./license.attributes','exports'];(function(_0x351af1,_0x2770f7){var _0x2aaafd=function(_0x149d25){while(--_0x149d25){_0x351af1['push'](_0x351af1['shift']());}};_0x2aaafd(++_0x2770f7);}(_0xc016,0x13a));var _0x6c01=function(_0x5610b4,_0x4cc595){_0x5610b4=_0x5610b4-0x0;var _0x28d5e8=_0xc016[_0x5610b4];return _0x28d5e8;};'use strict';var _=require(_0x6c01('0x0'));var util=require(_0x6c01('0x1'));var logger=require(_0x6c01('0x2'))(_0x6c01('0x3'));var moment=require(_0x6c01('0x4'));var BPromise=require(_0x6c01('0x5'));var rp=require(_0x6c01('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c01('0x7'));var attributes=require(_0x6c01('0x8'));module[_0x6c01('0x9')]=function(_0x2a52e1,_0x1a5df2){return _0x2a52e1['define'](_0x6c01('0xa'),attributes,{'tableName':_0x6c01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a690caa..7ec5b43 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 _0x8116=['../../config/logger','rpc','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x176d66,_0x1e3fc6){var _0x54555d=function(_0x4d7f39){while(--_0x4d7f39){_0x176d66['push'](_0x176d66['shift']());}};_0x54555d(++_0x1e3fc6);}(_0x8116,0xd5));var _0x6811=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8116[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6811('0x0'));var util=require(_0x6811('0x1'));var moment=require(_0x6811('0x2'));var BPromise=require(_0x6811('0x3'));var rs=require(_0x6811('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6811('0x5'))['db'];var utils=require(_0x6811('0x6'));var logger=require(_0x6811('0x7'))(_0x6811('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6811('0x9')][_0x6811('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df570,_0x304411,_0x427034){return new BPromise(function(_0x36969b,_0x4c2c5e){return client[_0x6811('0xb')](_0x3df570,_0x427034)[_0x6811('0xc')](function(_0x4059f6){logger['info'](_0x6811('0xd'),_0x304411,_0x6811('0xe'));logger[_0x6811('0xf')](_0x6811('0x10'),_0x304411,'request\x20sent',JSON[_0x6811('0x11')](_0x4059f6));if(_0x4059f6[_0x6811('0x12')]){if(_0x4059f6[_0x6811('0x12')]['code']===0x1f4){logger[_0x6811('0x12')](_0x6811('0xd'),_0x304411,_0x4059f6[_0x6811('0x12')][_0x6811('0x13')]);return _0x4c2c5e(_0x4059f6[_0x6811('0x12')]['message']);}logger[_0x6811('0x12')](_0x6811('0xd'),_0x304411,_0x4059f6['error'][_0x6811('0x13')]);return _0x36969b(_0x4059f6[_0x6811('0x12')]['message']);}else{logger['info'](_0x6811('0xd'),_0x304411,'request\x20sent');_0x36969b(_0x4059f6[_0x6811('0x14')][_0x6811('0x13')]);}})[_0x6811('0x15')](function(_0x1d32d8){logger['error'](_0x6811('0xd'),_0x304411,_0x1d32d8);_0x4c2c5e(_0x1d32d8);});});} \ No newline at end of file +var _0x3ef9=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x8d2138,_0x3ce98f){var _0x1c6aa1=function(_0x55c20a){while(--_0x55c20a){_0x8d2138['push'](_0x8d2138['shift']());}};_0x1c6aa1(++_0x3ce98f);}(_0x3ef9,0xdb));var _0x93ef=function(_0x425c62,_0x457991){_0x425c62=_0x425c62-0x0;var _0x5eb48f=_0x3ef9[_0x425c62];return _0x5eb48f;};'use strict';var _=require(_0x93ef('0x0'));var util=require(_0x93ef('0x1'));var moment=require(_0x93ef('0x2'));var BPromise=require('bluebird');var rs=require(_0x93ef('0x3'));var fs=require('fs');var Redis=require(_0x93ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x93ef('0x5'));var logger=require(_0x93ef('0x6'))('rpc');var config=require(_0x93ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93ef('0x8')][_0x93ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f4f0a,_0x56c140,_0x25cbf0){return new BPromise(function(_0x3cfb8a,_0x129449){return client[_0x93ef('0xa')](_0x1f4f0a,_0x25cbf0)[_0x93ef('0xb')](function(_0x495e56){logger[_0x93ef('0xc')](_0x93ef('0xd'),_0x56c140,_0x93ef('0xe'));logger[_0x93ef('0xf')](_0x93ef('0x10'),_0x56c140,_0x93ef('0xe'),JSON['stringify'](_0x495e56));if(_0x495e56['error']){if(_0x495e56['error']['code']===0x1f4){logger['error'](_0x93ef('0xd'),_0x56c140,_0x495e56[_0x93ef('0x11')][_0x93ef('0x12')]);return _0x129449(_0x495e56[_0x93ef('0x11')]['message']);}logger['error'](_0x93ef('0xd'),_0x56c140,_0x495e56['error'][_0x93ef('0x12')]);return _0x3cfb8a(_0x495e56[_0x93ef('0x11')][_0x93ef('0x12')]);}else{logger[_0x93ef('0xc')](_0x93ef('0xd'),_0x56c140,'request\x20sent');_0x3cfb8a(_0x495e56[_0x93ef('0x13')]['message']);}})[_0x93ef('0x14')](function(_0x96084f){logger[_0x93ef('0x11')](_0x93ef('0xd'),_0x56c140,_0x96084f);_0x129449(_0x96084f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0e5a0b6..4ab7c00 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 _0x47e5=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','/:id','update','delete','removeDispositions','removeSmtp','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1ad6bf,_0x23add8){var _0x584b88=function(_0x46b52a){while(--_0x46b52a){_0x1ad6bf['push'](_0x1ad6bf['shift']());}};_0x584b88(++_0x23add8);}(_0x47e5,0x8d));var _0x547e=function(_0x4534e3,_0x56de6e){_0x4534e3=_0x4534e3-0x0;var _0x50c3a3=_0x47e5[_0x4534e3];return _0x50c3a3;};'use strict';var multer=require(_0x547e('0x0'));var util=require(_0x547e('0x1'));var path=require('path');var timeout=require(_0x547e('0x2'));var express=require('express');var router=express[_0x547e('0x3')]();var fs_extra=require(_0x547e('0x4'));var auth=require(_0x547e('0x5'));var interaction=require(_0x547e('0x6'));var config=require(_0x547e('0x7'));var controller=require('./mailAccount.controller');router[_0x547e('0x8')]('/',auth[_0x547e('0x9')](),controller[_0x547e('0xa')]);router[_0x547e('0x8')](_0x547e('0xb'),auth[_0x547e('0x9')](),controller[_0x547e('0xc')]);router[_0x547e('0x8')]('/:id',auth[_0x547e('0x9')](),controller[_0x547e('0xd')]);router[_0x547e('0x8')](_0x547e('0xe'),auth[_0x547e('0x9')](),controller[_0x547e('0xf')]);router[_0x547e('0x8')]('/:id/canned_answers',auth[_0x547e('0x9')](),controller[_0x547e('0x10')]);router[_0x547e('0x8')](_0x547e('0x11'),auth['isAuthenticated'](),controller[_0x547e('0x12')]);router[_0x547e('0x8')](_0x547e('0x13'),auth[_0x547e('0x9')](),controller[_0x547e('0x14')]);router[_0x547e('0x8')](_0x547e('0x15'),auth['isAuthenticated'](),controller[_0x547e('0x16')]);router['get'](_0x547e('0x17'),auth[_0x547e('0x9')](),controller[_0x547e('0x18')]);router[_0x547e('0x8')]('/:id/messages',auth[_0x547e('0x9')](),controller[_0x547e('0x19')]);router['get'](_0x547e('0x1a'),auth[_0x547e('0x9')](),controller[_0x547e('0x1b')]);router['get'](_0x547e('0x1c'),auth[_0x547e('0x9')](),controller[_0x547e('0x1d')]);router['post'](_0x547e('0xe'),auth[_0x547e('0x9')](),controller[_0x547e('0x1e')]);router[_0x547e('0x1f')](_0x547e('0x20'),auth['isAuthenticated'](),controller[_0x547e('0x21')]);router['post']('/',auth[_0x547e('0x9')](),controller[_0x547e('0x22')]);router[_0x547e('0x1f')](_0x547e('0x11'),auth[_0x547e('0x9')](),controller[_0x547e('0x23')]);router[_0x547e('0x1f')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x547e('0x24')]);router[_0x547e('0x1f')]('/:id/interactions',auth[_0x547e('0x9')](),controller[_0x547e('0x25')]);router['post'](_0x547e('0x17'),auth[_0x547e('0x9')](),controller[_0x547e('0x26')]);router['post'](_0x547e('0x27'),auth[_0x547e('0x9')](),controller['send']);router[_0x547e('0x1f')](_0x547e('0x1c'),auth[_0x547e('0x9')](),controller[_0x547e('0x28')]);router[_0x547e('0x29')](_0x547e('0x2a'),auth[_0x547e('0x9')](),controller[_0x547e('0x2b')]);router[_0x547e('0x2c')](_0x547e('0xe'),auth[_0x547e('0x9')](),controller[_0x547e('0x2d')]);router[_0x547e('0x2c')](_0x547e('0x20'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x547e('0x2c')](_0x547e('0x11'),auth[_0x547e('0x9')](),controller['removeImap']);router[_0x547e('0x2c')](_0x547e('0x13'),auth['isAuthenticated'](),controller[_0x547e('0x2e')]);router[_0x547e('0x2c')](_0x547e('0x2a'),auth[_0x547e('0x9')](),controller['destroy']);router['delete']('/:id/users',auth[_0x547e('0x9')](),controller[_0x547e('0x2f')]);module[_0x547e('0x30')]=router; \ No newline at end of file +var _0x5bcf=['addApplications','/:id/send','addAgents','put','delete','removeAnswers','removeSmtp','/:id','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications'];(function(_0x547ea0,_0x58254c){var _0x36e258=function(_0x288a1a){while(--_0x288a1a){_0x547ea0['push'](_0x547ea0['shift']());}};_0x36e258(++_0x58254c);}(_0x5bcf,0x12f));var _0xf5bc=function(_0x5ad1d7,_0x2dd2cf){_0x5ad1d7=_0x5ad1d7-0x0;var _0xcf4632=_0x5bcf[_0x5ad1d7];return _0xcf4632;};'use strict';var multer=require(_0xf5bc('0x0'));var util=require(_0xf5bc('0x1'));var path=require('path');var timeout=require(_0xf5bc('0x2'));var express=require(_0xf5bc('0x3'));var router=express[_0xf5bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf5bc('0x5'));var interaction=require(_0xf5bc('0x6'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xf5bc('0x7')]('/',auth[_0xf5bc('0x8')](),controller['index']);router[_0xf5bc('0x7')](_0xf5bc('0x9'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0xa')]);router[_0xf5bc('0x7')]('/:id',auth[_0xf5bc('0x8')](),controller[_0xf5bc('0xb')]);router[_0xf5bc('0x7')](_0xf5bc('0xc'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0xd')]);router[_0xf5bc('0x7')](_0xf5bc('0xe'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0xf')]);router[_0xf5bc('0x7')](_0xf5bc('0x10'),auth['isAuthenticated'](),controller['getImap']);router[_0xf5bc('0x7')](_0xf5bc('0x11'),auth[_0xf5bc('0x8')](),controller['getSmtp']);router[_0xf5bc('0x7')](_0xf5bc('0x12'),auth[_0xf5bc('0x8')](),controller['getInteractions']);router[_0xf5bc('0x7')]('/:id/applications',auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x13')]);router[_0xf5bc('0x7')](_0xf5bc('0x14'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x15')]);router[_0xf5bc('0x7')]('/:id/verify',auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x16')]);router['get'](_0xf5bc('0x17'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x18')]);router[_0xf5bc('0x19')](_0xf5bc('0xc'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x1a')]);router[_0xf5bc('0x19')](_0xf5bc('0xe'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x1b')]);router[_0xf5bc('0x19')]('/',auth['isAuthenticated'](),controller[_0xf5bc('0x1c')]);router['post'](_0xf5bc('0x10'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x1d')]);router['post']('/:id/out_servers',auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x1e')]);router[_0xf5bc('0x19')](_0xf5bc('0x12'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x1f')]);router['post'](_0xf5bc('0x20'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x21')]);router[_0xf5bc('0x19')](_0xf5bc('0x22'),auth[_0xf5bc('0x8')](),controller['send']);router[_0xf5bc('0x19')](_0xf5bc('0x17'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x23')]);router[_0xf5bc('0x24')]('/:id',auth[_0xf5bc('0x8')](),controller['update']);router[_0xf5bc('0x25')](_0xf5bc('0xc'),auth[_0xf5bc('0x8')](),controller['removeDispositions']);router[_0xf5bc('0x25')](_0xf5bc('0xe'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x26')]);router[_0xf5bc('0x25')]('/:id/in_servers',auth['isAuthenticated'](),controller['removeImap']);router[_0xf5bc('0x25')](_0xf5bc('0x11'),auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x27')]);router[_0xf5bc('0x25')](_0xf5bc('0x28'),auth['isAuthenticated'](),controller['destroy']);router[_0xf5bc('0x25')]('/:id/users',auth[_0xf5bc('0x8')](),controller[_0xf5bc('0x29')]);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 78e0846..2af3a57 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 _0x08e5=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','ENUM','hotmail','yahoo','provider','getDataValue','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x2d6a3f,_0x62d237){var _0x2826ff=function(_0x580f88){while(--_0x580f88){_0x2d6a3f['push'](_0x2d6a3f['shift']());}};_0x2826ff(++_0x62d237);}(_0x08e5,0xbf));var _0x508e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x08e5[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x508e('0x0')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x508e('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x508e('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x508e('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x508e('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x508e('0x2')]},'markAsUnread':{'type':Sequelize[_0x508e('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x508e('0x0')],'allowNull':![],'defaultValue':_0x508e('0x3')},'fontSize':{'type':Sequelize[_0x508e('0x4')](0x2)[_0x508e('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x508e('0x2')],'defaultValue':function(){return _0x508e('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x508e('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x508e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x508e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x508e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x508e('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x508e('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x508e('0x1')],'defaultValue':![],'comment':_0x508e('0x8'),'set':function(_0x1cc4ec){if(!_0x1cc4ec)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x508e('0x9')]('mandatoryDisposition',_0x1cc4ec);}},'provider':{'type':Sequelize[_0x508e('0xa')]('gmail',_0x508e('0xb'),_0x508e('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x508e('0xd')))return'custom';return this[_0x508e('0xe')](_0x508e('0xd'));},'set':function(_0x6a31eb){if(_0x6a31eb==='custom')_0x6a31eb=null;return this['setDataValue'](_0x508e('0xd'),_0x6a31eb);}}}; \ No newline at end of file +var _0x90d1=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x2de699,_0x29ccd8){var _0x1754b7=function(_0x4f70ee){while(--_0x4f70ee){_0x2de699['push'](_0x2de699['shift']());}};_0x1754b7(++_0x29ccd8);}(_0x90d1,0xc1));var _0x190d=function(_0x5a6d3b,_0x15a93b){_0x5a6d3b=_0x5a6d3b-0x0;var _0x3aaf17=_0x90d1[_0x5a6d3b];return _0x3aaf17;};'use strict';var Sequelize=require(_0x190d('0x0'));module['exports']={'description':{'type':Sequelize[_0x190d('0x1')]},'name':{'type':Sequelize[_0x190d('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x190d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x190d('0x3')]},'markAsUnread':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x190d('0x1')],'allowNull':![],'defaultValue':_0x190d('0x4')},'fontSize':{'type':Sequelize[_0x190d('0x5')](0x2)[_0x190d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x190d('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x190d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x190d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x190d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x190d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x190d('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x489960){if(!_0x489960)this[_0x190d('0x8')](_0x190d('0x9'),null);this['setDataValue'](_0x190d('0xa'),_0x489960);}},'provider':{'type':Sequelize['ENUM'](_0x190d('0xb'),_0x190d('0xc'),_0x190d('0xd'),_0x190d('0xe')),'defaultValue':null,'get':function(){if(!this[_0x190d('0xf')](_0x190d('0x10')))return _0x190d('0x11');return this[_0x190d('0xf')](_0x190d('0x10'));},'set':function(_0x12c90c){if(_0x12c90c===_0x190d('0x11'))_0x12c90c=null;return this[_0x190d('0x8')]('provider',_0x12c90c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index d2f44d9..0ad4a23 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 _0x6a90=['smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp.office365.com','user','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','username','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','show','params','MailServerIn','include','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','order','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','email','ListId','active','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','attachments','root','server/files/attachments','SendMail','sendMail','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','get','MailAccounts','destroy','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider'];(function(_0x4ffafb,_0x20171a){var _0x4ab472=function(_0x1afc75){while(--_0x1afc75){_0x4ffafb['push'](_0x4ffafb['shift']());}};_0x4ab472(++_0x20171a);}(_0x6a90,0x159));var _0x06a9=function(_0x22c6af,_0x4f3d65){_0x22c6af=_0x22c6af-0x0;var _0x13bfe4=_0x6a90[_0x22c6af];return _0x13bfe4;};'use strict';var moment=require(_0x06a9('0x0'));var BPromise=require('bluebird');var util=require(_0x06a9('0x1'));var path=require(_0x06a9('0x2'));var _=require(_0x06a9('0x3'));var juice=require(_0x06a9('0x4'));var Redis=require(_0x06a9('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x06a9('0x6'))(_0x06a9('0x7'));var config=require(_0x06a9('0x8'));var db=require(_0x06a9('0x9'))['db'];config[_0x06a9('0xa')]=_[_0x06a9('0xb')](config['redis'],{'host':_0x06a9('0xc'),'port':0x18eb});var socket=require(_0x06a9('0xd'))(new Redis(config['redis']));require(_0x06a9('0xe'))[_0x06a9('0xf')](socket);var jayson=require(_0x06a9('0x10'));var client=jayson[_0x06a9('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x36db26,_0x336fc8,_0x121665,_0x49ff1d){return new BPromise(function(_0x1a2722,_0x5ad5d2){var _0x5473b2=_0x49ff1d||client;return _0x5473b2[_0x06a9('0x12')](_0x36db26,_0x121665)[_0x06a9('0x13')](function(_0x1ff857){logger['info']('MailAccount,\x20%s,\x20%s',_0x336fc8,'request\x20sent');logger[_0x06a9('0x14')](_0x06a9('0x15'),_0x336fc8,'request\x20sent',JSON[_0x06a9('0x16')](_0x1ff857));if(_0x1ff857[_0x06a9('0x17')]){if(_0x1ff857[_0x06a9('0x17')][_0x06a9('0x18')]===0x1f4){logger[_0x06a9('0x17')]('MailAccount,\x20%s,\x20%s',_0x336fc8,_0x1ff857['error'][_0x06a9('0x19')]);return _0x5ad5d2(_0x1ff857[_0x06a9('0x17')][_0x06a9('0x19')]);}logger['error'](_0x06a9('0x1a'),_0x336fc8,_0x1ff857['error']['message']);return _0x1a2722(_0x1ff857[_0x06a9('0x17')]['message']);}else{logger[_0x06a9('0x1b')](_0x06a9('0x1a'),_0x336fc8,_0x06a9('0x1c'));_0x1a2722(_0x1ff857[_0x06a9('0x1d')][_0x06a9('0x19')]);}})[_0x06a9('0x1e')](function(_0x521c4f){logger['error']('MailAccount,\x20%s,\x20%s',_0x336fc8,_0x521c4f);_0x5ad5d2(_0x521c4f);});});}function respondWithStatusCode(_0x4ed8a4,_0x367c4e){_0x367c4e=_0x367c4e||0xcc;return function(_0xdd6ccc){if(_0xdd6ccc){return _0x4ed8a4[_0x06a9('0x1f')](_0x367c4e);}return _0x4ed8a4[_0x06a9('0x20')](_0x367c4e)[_0x06a9('0x21')]();};}function respondWithResult(_0x4e7263,_0x5837c8){_0x5837c8=_0x5837c8||0xc8;return function(_0xdd04a3){if(_0xdd04a3){return _0x4e7263[_0x06a9('0x20')](_0x5837c8)[_0x06a9('0x22')](_0xdd04a3);}};}function respondWithFilteredResult(_0x160af2,_0x2bd092){return function(_0x3d24dc){if(_0x3d24dc){var _0x1ec11f=typeof _0x2bd092[_0x06a9('0x23')]===_0x06a9('0x24')&&typeof _0x2bd092['limit']==='undefined';var _0x496b8e=_0x3d24dc[_0x06a9('0x25')];var _0x33e8ca=_0x1ec11f?0x0:_0x2bd092['offset'];var _0x38bb57=_0x1ec11f?_0x3d24dc[_0x06a9('0x25')]:_0x2bd092[_0x06a9('0x23')]+_0x2bd092[_0x06a9('0x26')];var _0x46ae6e;if(_0x38bb57>=_0x496b8e){_0x38bb57=_0x496b8e;_0x46ae6e=0xc8;}else{_0x46ae6e=0xce;}_0x160af2[_0x06a9('0x20')](_0x46ae6e);return _0x160af2['set'](_0x06a9('0x27'),_0x33e8ca+'-'+_0x38bb57+'/'+_0x496b8e)[_0x06a9('0x22')](_0x3d24dc);}return null;};}function saveUpdates(_0x3a2576){return function(_0x300698){if(_0x300698){return _0x300698['update'](_0x3a2576)['then'](function(_0x483780){return _0x483780;});}return null;};}function removeEntity(_0x33f5bc){return function(_0x292b32){if(_0x292b32){return _0x292b32['destroy']()[_0x06a9('0x13')](function(){var _0x3fb89=_0x292b32[_0x06a9('0x28')]({'plain':!![]});var _0x3019e6=_0x06a9('0x29');return db['UserProfileResource'][_0x06a9('0x2a')]({'where':{'type':_0x3019e6,'resourceId':_0x3fb89['id']}})['then'](function(){return _0x292b32;});})[_0x06a9('0x13')](function(){_0x33f5bc[_0x06a9('0x20')](0xcc)[_0x06a9('0x21')]();});}};}function handleEntityNotFound(_0x207beb){return function(_0x302e08){if(!_0x302e08){_0x207beb[_0x06a9('0x1f')](0x194);}return _0x302e08;};}function handleError(_0xda4df6,_0x23e989){_0x23e989=_0x23e989||0x1f4;return function(_0x4826f9){logger[_0x06a9('0x17')](_0x4826f9[_0x06a9('0x2b')]);if(_0x4826f9[_0x06a9('0x2c')]){delete _0x4826f9['name'];}_0xda4df6[_0x06a9('0x20')](_0x23e989)[_0x06a9('0x2d')](_0x4826f9);};}function getImapHost(_0x168fe4){switch(_0x168fe4){case _0x06a9('0x2e'):return _0x06a9('0x2f');case'yahoo':return _0x06a9('0x30');case'hotmail':return _0x06a9('0x31');case _0x06a9('0x32'):return _0x06a9('0x33');}throw new Error(_0x06a9('0x34'),_0x168fe4);}function getSmtpHost(_0x291f2f){switch(_0x291f2f){case _0x06a9('0x2e'):return _0x06a9('0x35');case _0x06a9('0x36'):return _0x06a9('0x37');case'hotmail':return'smtp-mail.outlook.com';case _0x06a9('0x32'):return _0x06a9('0x38');}throw new Error('Unknown\x20email\x20service\x20provider',_0x291f2f);}function getAuthenticationOptions(_0x31a766,_0x486a10){var _0x51d064={};var _0x5a7dec={};if(_0x31a766){_0x51d064[_0x06a9('0x39')]=_0x5a7dec[_0x06a9('0x39')]=_0x486a10['username'];_0x51d064['password']=_0x5a7dec[_0x06a9('0x3a')]=_0x486a10[_0x06a9('0x3b')];if(_0x486a10[_0x06a9('0x3c')]){_0x51d064['modernAuthentication']=_0x5a7dec[_0x06a9('0x3c')]=!![];_0x51d064[_0x06a9('0x3d')]=_0x5a7dec[_0x06a9('0x3d')]=_0x486a10[_0x06a9('0x3d')];_0x51d064['password']=_0x5a7dec[_0x06a9('0x3a')]=null;}else{_0x51d064[_0x06a9('0x3d')]=_0x5a7dec[_0x06a9('0x3d')]=null;}_0x51d064[_0x06a9('0x3e')]=getImapHost(_0x31a766);_0x51d064[_0x06a9('0x3f')]=0x3e1;_0x5a7dec[_0x06a9('0x3e')]=getSmtpHost(_0x31a766);_0x5a7dec[_0x06a9('0x3f')]=0x24b;_0x5a7dec[_0x06a9('0x40')]=![];_0x51d064[_0x06a9('0x41')]=_0x5a7dec[_0x06a9('0x41')]=null;}else{if(_0x486a10['authentication']){_0x51d064[_0x06a9('0x39')]=_0x5a7dec[_0x06a9('0x39')]=_0x486a10[_0x06a9('0x42')];_0x51d064['password']=_0x5a7dec[_0x06a9('0x3a')]=_0x486a10[_0x06a9('0x3b')];}else{_0x51d064['authentication']=_0x5a7dec[_0x06a9('0x43')]=![];_0x51d064[_0x06a9('0x39')]=_0x5a7dec[_0x06a9('0x39')]=null;_0x51d064[_0x06a9('0x3b')]=_0x5a7dec[_0x06a9('0x3a')]=null;}_0x51d064[_0x06a9('0x3e')]=_0x486a10[_0x06a9('0x44')][_0x06a9('0x3e')];_0x51d064[_0x06a9('0x3f')]=_0x486a10[_0x06a9('0x44')][_0x06a9('0x3f')];_0x5a7dec[_0x06a9('0x3e')]=_0x486a10[_0x06a9('0x45')][_0x06a9('0x3e')];_0x5a7dec[_0x06a9('0x3f')]=_0x486a10[_0x06a9('0x45')]['port'];}return{'Imap':_0x51d064,'Smtp':_0x5a7dec};}exports[_0x06a9('0x46')]=function(_0x5ae5a5,_0x172c1f){var _0x429385={'include':[{'model':db['MailServerIn'],'as':_0x06a9('0x44')},{'model':db[_0x06a9('0x47')],'as':_0x06a9('0x45')},{'model':db[_0x06a9('0x48')],'as':_0x06a9('0x49')}]},_0x1a086f={},_0x832cc={'count':0x0,'rows':[]};var _0x50682f=_[_0x06a9('0x4a')](db[_0x06a9('0x4b')][_0x06a9('0x4c')],function(_0x5a93db){return{'name':_0x5a93db[_0x06a9('0x4d')],'type':_0x5a93db['type'][_0x06a9('0x4e')]};});_0x1a086f['model']=_[_0x06a9('0x4a')](_0x50682f,_0x06a9('0x2c'));_0x1a086f[_0x06a9('0x4f')]=_[_0x06a9('0x50')](_0x5ae5a5['query']);_0x1a086f[_0x06a9('0x51')]=_[_0x06a9('0x52')](_0x1a086f[_0x06a9('0x53')],_0x1a086f[_0x06a9('0x4f')]);_0x429385['attributes']=_[_0x06a9('0x52')](_0x1a086f[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x5ae5a5[_0x06a9('0x4f')][_0x06a9('0x54')]));_0x429385[_0x06a9('0x55')]=_0x429385[_0x06a9('0x55')][_0x06a9('0x56')]?_0x429385['attributes']:_0x1a086f[_0x06a9('0x53')];if(!_0x5ae5a5['query'][_0x06a9('0x57')](_0x06a9('0x58'))){_0x429385[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x5ae5a5[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x429385['offset']=qs[_0x06a9('0x23')](_0x5ae5a5['query'][_0x06a9('0x23')]);}_0x429385['order']=qs[_0x06a9('0x59')](_0x5ae5a5[_0x06a9('0x4f')]['sort']);_0x429385[_0x06a9('0x5a')]=qs['filters'](_[_0x06a9('0x5b')](_0x5ae5a5[_0x06a9('0x4f')],_0x1a086f[_0x06a9('0x51')]),_0x50682f);if(_0x5ae5a5['query'][_0x06a9('0x5c')]){_0x429385[_0x06a9('0x5a')]=_[_0x06a9('0x5d')](_0x429385[_0x06a9('0x5a')],{'$or':_['map'](_0x50682f,function(_0x1f16c7){if(_0x1f16c7[_0x06a9('0x5e')]!==_0x06a9('0x5f')){var _0x21c7cd={};_0x21c7cd[_0x1f16c7[_0x06a9('0x2c')]]={'$like':'%'+_0x5ae5a5['query'][_0x06a9('0x5c')]+'%'};return _0x21c7cd;}})});}_0x429385=_['merge']({},_0x429385,_0x5ae5a5[_0x06a9('0x60')]);var _0x47c992={'where':_0x429385[_0x06a9('0x5a')]};return db[_0x06a9('0x4b')]['count'](_0x47c992)['then'](function(_0x531cef){_0x832cc[_0x06a9('0x25')]=_0x531cef;if(_0x5ae5a5[_0x06a9('0x4f')]['includeAll']){_0x429385['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x429385);})[_0x06a9('0x13')](function(_0x429f03){_0x832cc[_0x06a9('0x61')]=_0x429f03;return _0x832cc;})[_0x06a9('0x13')](respondWithFilteredResult(_0x172c1f,_0x429385))[_0x06a9('0x1e')](handleError(_0x172c1f,null));};exports[_0x06a9('0x62')]=function(_0x1961db,_0x1a57e3){var _0x2c5774={'raw':![],'where':{'id':_0x1961db[_0x06a9('0x63')]['id']},'include':[{'model':db[_0x06a9('0x64')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x06a9('0x48')],'as':_0x06a9('0x49')}]},_0x10a497={};_0x10a497[_0x06a9('0x53')]=_[_0x06a9('0x50')](db['MailAccount'][_0x06a9('0x4c')]);_0x10a497[_0x06a9('0x4f')]=_[_0x06a9('0x50')](_0x1961db['query']);_0x10a497['filters']=_[_0x06a9('0x52')](_0x10a497[_0x06a9('0x53')],_0x10a497[_0x06a9('0x4f')]);_0x2c5774['attributes']=_['intersection'](_0x10a497[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x1961db[_0x06a9('0x4f')][_0x06a9('0x54')]));_0x2c5774['attributes']=_0x2c5774[_0x06a9('0x55')][_0x06a9('0x56')]?_0x2c5774['attributes']:_0x10a497[_0x06a9('0x53')];if(_0x1961db[_0x06a9('0x4f')]['includeAll']){_0x2c5774[_0x06a9('0x65')]=[{'all':!![]}];}_0x2c5774=_[_0x06a9('0x5d')]({},_0x2c5774,_0x1961db[_0x06a9('0x60')]);return db[_0x06a9('0x4b')][_0x06a9('0x66')](_0x2c5774)[_0x06a9('0x13')](handleEntityNotFound(_0x1a57e3,null))['then'](respondWithResult(_0x1a57e3,null))[_0x06a9('0x1e')](handleError(_0x1a57e3,null));};exports[_0x06a9('0x67')]=function(_0x3f6bf5,_0x211f81){if(_0x3f6bf5['body']['id']){delete _0x3f6bf5[_0x06a9('0x68')]['id'];}var _0x2de5ed=_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x69')]===_0x06a9('0x6a')?null:_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x69')];var _0x1b5d27=_0x3f6bf5['body']['Imap']||{};var _0x5b6a60=_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x45')]||{};if(_0x2de5ed){_0x1b5d27[_0x06a9('0x3e')]=getImapHost(_0x2de5ed);_0x1b5d27[_0x06a9('0x3f')]=0x3e1;_0x5b6a60[_0x06a9('0x3e')]=getSmtpHost(_0x2de5ed);_0x5b6a60[_0x06a9('0x3f')]=0x24b;_0x5b6a60[_0x06a9('0x40')]=![];}if(_0x5b6a60[_0x06a9('0x3c')]){_0x5b6a60[_0x06a9('0x40')]=![];}else{_0x5b6a60[_0x06a9('0x3d')]=null;}if(!_0x1b5d27[_0x06a9('0x3c')])_0x1b5d27['CloudProviderId']=null;_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x44')]=_0x1b5d27;_0x3f6bf5[_0x06a9('0x68')]['Smtp']=_0x5b6a60;return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x3f6bf5[_0x06a9('0x63')]['id']},'include':[{'model':db[_0x06a9('0x64')],'as':_0x06a9('0x44')},{'model':db[_0x06a9('0x47')],'as':_0x06a9('0x45')},{'model':db[_0x06a9('0x48')],'as':'mandatoryDispositionPause'}]})[_0x06a9('0x13')](handleEntityNotFound(_0x211f81,null))[_0x06a9('0x13')](function(_0x2bd029){if(!_0x2bd029)throw new Error(_0x06a9('0x6b'));if(_0x2bd029[_0x06a9('0x41')])delete _0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x44')];return _0x2bd029;})[_0x06a9('0x13')](saveUpdates(_0x3f6bf5['body'],null))[_0x06a9('0x13')](function(_0x9e5d19){if(!_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x44')])return _0x9e5d19;return db[_0x06a9('0x64')][_0x06a9('0x67')](_0x3f6bf5[_0x06a9('0x68')]['Imap'],{'where':{'MailAccountId':_0x9e5d19['id']}})[_0x06a9('0x13')](function(){return _0x9e5d19;});})[_0x06a9('0x13')](function(_0x3d79e5){if(!_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x45')])return _0x3d79e5;return db[_0x06a9('0x47')][_0x06a9('0x67')](_0x3f6bf5[_0x06a9('0x68')][_0x06a9('0x45')],{'where':{'MailAccountId':_0x3d79e5['id']}})[_0x06a9('0x13')](function(){return _0x3d79e5;});})['then'](respondWithResult(_0x211f81,null))[_0x06a9('0x1e')](handleError(_0x211f81,null));};exports['describe']=function(_0x41da21,_0x26e81b){return db[_0x06a9('0x4b')][_0x06a9('0x6c')]()[_0x06a9('0x13')](respondWithResult(_0x26e81b,null))[_0x06a9('0x1e')](handleError(_0x26e81b,null));};exports[_0x06a9('0x6d')]=function(_0x272629,_0x324fa7){if(_0x272629['body']['id']){delete _0x272629[_0x06a9('0x68')]['id'];}return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x272629[_0x06a9('0x63')]['id']}})['then'](handleEntityNotFound(_0x324fa7,null))[_0x06a9('0x13')](function(_0x1b88df){if(_0x1b88df){_0x272629['body'][_0x06a9('0x6e')]=_0x1b88df['id'];return db['Disposition'][_0x06a9('0x6f')](_0x272629[_0x06a9('0x68')]);}})['then'](respondWithResult(_0x324fa7,null))[_0x06a9('0x1e')](handleError(_0x324fa7,null));};exports[_0x06a9('0x70')]=function(_0x306afa,_0xd04072){var _0x3be256={'raw':![],'where':{}};var _0x4ccb99={};var _0x5d7ba8={'count':0x0,'rows':[]};return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x306afa[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0xd04072,null))['then'](function(_0x2a28c8){if(_0x2a28c8){_0x4ccb99['model']=_['keys'](db[_0x06a9('0x72')][_0x06a9('0x4c')]);_0x4ccb99['query']=_['keys'](_0x306afa['query']);_0x4ccb99['filters']=_[_0x06a9('0x52')](_0x4ccb99[_0x06a9('0x53')],_0x4ccb99['query']);_0x3be256[_0x06a9('0x55')]=_[_0x06a9('0x52')](_0x4ccb99[_0x06a9('0x53')],qs['fields'](_0x306afa['query'][_0x06a9('0x54')]));_0x3be256[_0x06a9('0x55')]=_0x3be256['attributes'][_0x06a9('0x56')]?_0x3be256['attributes']:_0x4ccb99[_0x06a9('0x53')];if(!_0x306afa[_0x06a9('0x4f')][_0x06a9('0x57')]('nolimit')){_0x3be256[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x306afa[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x3be256[_0x06a9('0x23')]=qs[_0x06a9('0x23')](_0x306afa[_0x06a9('0x4f')][_0x06a9('0x23')]);}_0x3be256[_0x06a9('0x73')]=qs[_0x06a9('0x59')](_0x306afa[_0x06a9('0x4f')]['sort']);_0x3be256[_0x06a9('0x5a')]=qs[_0x06a9('0x51')](_[_0x06a9('0x5b')](_0x306afa[_0x06a9('0x4f')],_0x4ccb99['filters']));_0x3be256[_0x06a9('0x5a')][_0x06a9('0x6e')]=_0x2a28c8['id'];if(_0x306afa[_0x06a9('0x4f')][_0x06a9('0x5c')]){_0x3be256[_0x06a9('0x5a')]=_['merge'](_0x3be256[_0x06a9('0x5a')],{'$or':_[_0x06a9('0x4a')](_0x3be256[_0x06a9('0x55')],function(_0x404f3c){var _0x28fa31={};_0x28fa31[_0x404f3c]={'$like':'%'+_0x306afa[_0x06a9('0x4f')][_0x06a9('0x5c')]+'%'};return _0x28fa31;})});}_0x3be256=_[_0x06a9('0x5d')]({},_0x3be256,_0x306afa[_0x06a9('0x60')]);return db[_0x06a9('0x72')][_0x06a9('0x25')]({'where':_0x3be256[_0x06a9('0x5a')]})[_0x06a9('0x13')](function(_0x50900a){_0x5d7ba8[_0x06a9('0x25')]=_0x50900a;if(_0x306afa[_0x06a9('0x4f')][_0x06a9('0x74')]){_0x3be256[_0x06a9('0x65')]=[{'all':!![]}];}return db[_0x06a9('0x72')]['findAll'](_0x3be256);})[_0x06a9('0x13')](function(_0x16aa99){_0x5d7ba8[_0x06a9('0x61')]=_0x16aa99;return _0x5d7ba8;});}})[_0x06a9('0x13')](respondWithFilteredResult(_0xd04072,_0x3be256))[_0x06a9('0x1e')](handleError(_0xd04072,null));};exports[_0x06a9('0x75')]=function(_0xc7cc5c,_0x918bc3){return db[_0x06a9('0x4b')]['find']({'where':{'id':_0xc7cc5c[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x918bc3,null))[_0x06a9('0x13')](function(_0x291d6b){if(_0x291d6b){return _0x291d6b[_0x06a9('0x75')](_0xc7cc5c[_0x06a9('0x4f')][_0x06a9('0x76')]);}})[_0x06a9('0x13')](respondWithStatusCode(_0x918bc3,null))[_0x06a9('0x1e')](handleError(_0x918bc3,null));};exports[_0x06a9('0x77')]=function(_0xba4fba,_0x53bc4d){if(_0xba4fba[_0x06a9('0x68')]['id']){delete _0xba4fba[_0x06a9('0x68')]['id'];}return db[_0x06a9('0x4b')]['find']({'where':{'id':_0xba4fba[_0x06a9('0x63')]['id']}})['then'](handleEntityNotFound(_0x53bc4d,null))[_0x06a9('0x13')](function(_0x2daae8){if(_0x2daae8){_0xba4fba[_0x06a9('0x68')][_0x06a9('0x6e')]=_0x2daae8['id'];return db[_0x06a9('0x78')][_0x06a9('0x6f')](_0xba4fba['body']);}})[_0x06a9('0x13')](respondWithResult(_0x53bc4d,null))[_0x06a9('0x1e')](handleError(_0x53bc4d,null));};exports[_0x06a9('0x79')]=function(_0x1466c8,_0x2ec2b2){var _0x351737={'raw':![],'where':{}};var _0x217fb0={};var _0x4effd4={'count':0x0,'rows':[]};return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x1466c8[_0x06a9('0x63')]['id']}})['then'](handleEntityNotFound(_0x2ec2b2,null))[_0x06a9('0x13')](function(_0x4f53a0){if(_0x4f53a0){_0x217fb0[_0x06a9('0x53')]=_[_0x06a9('0x50')](db[_0x06a9('0x78')][_0x06a9('0x4c')]);_0x217fb0[_0x06a9('0x4f')]=_['keys'](_0x1466c8['query']);_0x217fb0['filters']=_[_0x06a9('0x52')](_0x217fb0[_0x06a9('0x53')],_0x217fb0[_0x06a9('0x4f')]);_0x351737[_0x06a9('0x55')]=_[_0x06a9('0x52')](_0x217fb0[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x1466c8['query'][_0x06a9('0x54')]));_0x351737['attributes']=_0x351737[_0x06a9('0x55')][_0x06a9('0x56')]?_0x351737[_0x06a9('0x55')]:_0x217fb0['model'];if(!_0x1466c8['query'][_0x06a9('0x57')]('nolimit')){_0x351737[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x1466c8[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x351737[_0x06a9('0x23')]=qs['offset'](_0x1466c8[_0x06a9('0x4f')][_0x06a9('0x23')]);}_0x351737[_0x06a9('0x73')]=qs[_0x06a9('0x59')](_0x1466c8[_0x06a9('0x4f')][_0x06a9('0x59')]);_0x351737['where']=qs[_0x06a9('0x51')](_[_0x06a9('0x5b')](_0x1466c8['query'],_0x217fb0['filters']));_0x351737['where'][_0x06a9('0x6e')]=_0x4f53a0['id'];if(_0x1466c8[_0x06a9('0x4f')]['filter']){_0x351737[_0x06a9('0x5a')]=_[_0x06a9('0x5d')](_0x351737['where'],{'$or':_[_0x06a9('0x4a')](_0x351737[_0x06a9('0x55')],function(_0x21a27a){var _0xb5887a={};_0xb5887a[_0x21a27a]={'$like':'%'+_0x1466c8[_0x06a9('0x4f')][_0x06a9('0x5c')]+'%'};return _0xb5887a;})});}_0x351737=_[_0x06a9('0x5d')]({},_0x351737,_0x1466c8[_0x06a9('0x60')]);return db[_0x06a9('0x78')][_0x06a9('0x25')]({'where':_0x351737[_0x06a9('0x5a')]})[_0x06a9('0x13')](function(_0x476130){_0x4effd4['count']=_0x476130;if(_0x1466c8[_0x06a9('0x4f')][_0x06a9('0x74')]){_0x351737[_0x06a9('0x65')]=[{'all':!![]}];}return db['CannedAnswer'][_0x06a9('0x7a')](_0x351737);})[_0x06a9('0x13')](function(_0x444ca1){_0x4effd4[_0x06a9('0x61')]=_0x444ca1;return _0x4effd4;});}})[_0x06a9('0x13')](respondWithFilteredResult(_0x2ec2b2,_0x351737))[_0x06a9('0x1e')](handleError(_0x2ec2b2,null));};exports[_0x06a9('0x7b')]=function(_0x30fa38,_0x2af0e5){return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x30fa38[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x2af0e5,null))[_0x06a9('0x13')](function(_0x25933c){if(_0x25933c){return _0x25933c['removeAnswers'](_0x30fa38[_0x06a9('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x2af0e5,null))[_0x06a9('0x1e')](handleError(_0x2af0e5,null));};exports[_0x06a9('0x6f')]=function(_0x4bd0af,_0x34f3c5){var _0x714c25={'name':_0x4bd0af['body'][_0x06a9('0x2c')],'key':_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x4e')],'provider':_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x69')]===_0x06a9('0x6a')?null:_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x69')],'email':_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x7c')],'ListId':_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x7d')],'active':!_['isNil'](_0x4bd0af['body'][_0x06a9('0x7e')])?_0x4bd0af[_0x06a9('0x68')][_0x06a9('0x7e')]:!![],'description':_0x4bd0af[_0x06a9('0x68')]['description']||null};var _0x5689ed=getAuthenticationOptions(_0x714c25[_0x06a9('0x69')],_0x4bd0af[_0x06a9('0x68')]);_0x714c25[_0x06a9('0x44')]=_0x5689ed['Imap'];_0x714c25['Smtp']=_0x5689ed[_0x06a9('0x45')];return db['MailAccount'][_0x06a9('0x6f')](_0x714c25,{'include':[{'model':db[_0x06a9('0x47')],'as':_0x06a9('0x45')},{'model':db[_0x06a9('0x64')],'as':_0x06a9('0x44')}]})[_0x06a9('0x13')](function(_0x5d6ad8){var _0x2c8fd9=_0x4bd0af['user']['get']({'plain':!![]});if(!_0x2c8fd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c8fd9[_0x06a9('0x7f')]===_0x06a9('0x39')){var _0x41d75c=_0x5d6ad8['get']({'plain':!![]});return db[_0x06a9('0x80')][_0x06a9('0x66')]({'where':{'name':_0x06a9('0x29'),'userProfileId':_0x2c8fd9['userProfileId']},'raw':!![]})[_0x06a9('0x13')](function(_0x1d010a){if(_0x1d010a&&_0x1d010a[_0x06a9('0x81')]===0x0){return db[_0x06a9('0x82')][_0x06a9('0x6f')]({'name':_0x41d75c[_0x06a9('0x2c')],'resourceId':_0x41d75c['id'],'type':_0x1d010a[_0x06a9('0x2c')],'sectionId':_0x1d010a['id']},{})[_0x06a9('0x13')](function(){return _0x5d6ad8;});}else{return _0x5d6ad8;}})[_0x06a9('0x1e')](function(_0x24cf7c){logger[_0x06a9('0x17')](_0x06a9('0x83'),_0x24cf7c);throw _0x24cf7c;});}return _0x5d6ad8;})[_0x06a9('0x13')](respondWithResult(_0x34f3c5,0xc9))[_0x06a9('0x1e')](handleError(_0x34f3c5,null));};exports[_0x06a9('0x84')]=function(_0x1aa0d5,_0x2fa670){return db[_0x06a9('0x4b')]['findOne']({'where':{'id':_0x1aa0d5[_0x06a9('0x63')]['id']}})['then'](handleEntityNotFound(_0x2fa670,null))[_0x06a9('0x13')](function(_0x2090e0){if(_0x2090e0){return _0x2090e0['getImap']();}return null;})[_0x06a9('0x13')](respondWithResult(_0x2fa670,null))['catch'](handleError(_0x2fa670,null));};exports[_0x06a9('0x85')]=function(_0x1a64df,_0x17995e){if(_0x1a64df[_0x06a9('0x68')]['id']){delete _0x1a64df[_0x06a9('0x68')]['id'];}return db[_0x06a9('0x4b')]['find']({'where':{'id':_0x1a64df[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x17995e,null))[_0x06a9('0x13')](function(_0x2eca00){if(_0x2eca00){_0x1a64df['body'][_0x06a9('0x6e')]=_0x2eca00['id'];return db[_0x06a9('0x64')]['create'](_0x1a64df[_0x06a9('0x68')]);}})[_0x06a9('0x13')](respondWithResult(_0x17995e,null))[_0x06a9('0x1e')](handleError(_0x17995e,null));};exports[_0x06a9('0x86')]=function(_0x408fa7,_0x313447){return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x408fa7['params']['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x313447,null))[_0x06a9('0x13')](function(_0x23b561){if(_0x23b561){return _0x23b561['setImap'](null);}return null;})[_0x06a9('0x13')](respondWithStatusCode(_0x313447,null))[_0x06a9('0x1e')](handleError(_0x313447,null));};exports[_0x06a9('0x87')]=function(_0x16830e,_0x234203){return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x16830e[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x234203,null))[_0x06a9('0x13')](function(_0x12179c){if(_0x12179c){return _0x12179c['getSmtp']();}return null;})[_0x06a9('0x13')](respondWithResult(_0x234203,null))[_0x06a9('0x1e')](handleError(_0x234203,null));};exports[_0x06a9('0x88')]=function(_0x24aed6,_0x599a73){if(_0x24aed6[_0x06a9('0x68')]['id']){delete _0x24aed6[_0x06a9('0x68')]['id'];}return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x24aed6[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x599a73,null))[_0x06a9('0x13')](function(_0x5135c1){if(_0x5135c1){_0x24aed6[_0x06a9('0x68')]['MailAccountId']=_0x5135c1['id'];return db[_0x06a9('0x47')]['create'](_0x24aed6['body']);}})['then'](respondWithResult(_0x599a73,null))[_0x06a9('0x1e')](handleError(_0x599a73,null));};exports['removeSmtp']=function(_0x432056,_0x2435bc){return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x432056[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x2435bc,null))[_0x06a9('0x13')](function(_0x2af7bc){if(_0x2af7bc){return _0x2af7bc[_0x06a9('0x89')](null);}return null;})[_0x06a9('0x13')](respondWithStatusCode(_0x2435bc,null))[_0x06a9('0x1e')](handleError(_0x2435bc,null));};exports['addInteraction']=function(_0x3589fa,_0x499a1d){return db[_0x06a9('0x8a')]['find']({'where':{'id':_0x3589fa['params']['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x499a1d,null))[_0x06a9('0x13')](function(_0x2b29fd){if(_0x2b29fd){return _0x2b29fd[_0x06a9('0x8b')](_0x3589fa[_0x06a9('0x68')][_0x06a9('0x76')],_[_0x06a9('0x8c')](_0x3589fa[_0x06a9('0x68')],[_0x06a9('0x76'),'id'])||{});}})['then'](respondWithResult(_0x499a1d,null))[_0x06a9('0x1e')](handleError(_0x499a1d,null));};exports[_0x06a9('0x8d')]=function(_0x2d177c,_0x45724e){var _0x386296={'raw':![],'where':{}};var _0xb0c196={};var _0xf01abf={'count':0x0,'rows':[]};return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x2d177c[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x45724e,null))[_0x06a9('0x13')](function(_0x26befd){if(_0x26befd){_0xb0c196[_0x06a9('0x53')]=_[_0x06a9('0x50')](db[_0x06a9('0x8a')][_0x06a9('0x4c')]);_0xb0c196[_0x06a9('0x4f')]=_[_0x06a9('0x50')](_0x2d177c[_0x06a9('0x4f')]);_0xb0c196[_0x06a9('0x51')]=_[_0x06a9('0x52')](_0xb0c196[_0x06a9('0x53')],_0xb0c196[_0x06a9('0x4f')]);_0x386296[_0x06a9('0x55')]=_[_0x06a9('0x52')](_0xb0c196[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x54')]));_0x386296['attributes']=_0x386296[_0x06a9('0x55')]['length']?_0x386296[_0x06a9('0x55')]:_0xb0c196[_0x06a9('0x53')];if(!_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x57')](_0x06a9('0x58'))){_0x386296[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x386296[_0x06a9('0x23')]=qs[_0x06a9('0x23')](_0x2d177c[_0x06a9('0x4f')]['offset']);}_0x386296[_0x06a9('0x73')]=qs[_0x06a9('0x59')](_0x2d177c[_0x06a9('0x4f')]['sort']);_0x386296[_0x06a9('0x5a')]=qs[_0x06a9('0x51')](_[_0x06a9('0x5b')](_0x2d177c[_0x06a9('0x4f')],_0xb0c196[_0x06a9('0x51')]));_0x386296[_0x06a9('0x5a')][_0x06a9('0x6e')]=_0x26befd['id'];if(_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x5c')]){_0x386296['where']=_['merge'](_0x386296[_0x06a9('0x5a')],{'$or':_[_0x06a9('0x4a')](_0x386296[_0x06a9('0x55')],function(_0x435906){var _0x13587a={};_0x13587a[_0x435906]={'$like':'%'+_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x5c')]+'%'};return _0x13587a;})});}_0x386296=_[_0x06a9('0x5d')]({},_0x386296,_0x2d177c[_0x06a9('0x60')]);return db[_0x06a9('0x8a')][_0x06a9('0x25')]({'where':_0x386296[_0x06a9('0x5a')]})[_0x06a9('0x13')](function(_0x5ca7e5){_0xf01abf[_0x06a9('0x25')]=_0x5ca7e5;if(_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x74')]){_0x386296[_0x06a9('0x65')]=[{'model':db[_0x06a9('0x8e')],'as':_0x06a9('0x8f'),'required':![]},{'model':db[_0x06a9('0x90')],'as':_0x06a9('0x91'),'attributes':['name',_0x06a9('0x92'),_0x06a9('0x93')],'required':![]},{'model':db[_0x06a9('0x94')],'as':'Tags','attributes':['id','name',_0x06a9('0x95')],'where':_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x96')]?{'id':_0x2d177c[_0x06a9('0x4f')]['tag']}:undefined,'required':_0x2d177c[_0x06a9('0x4f')][_0x06a9('0x96')]?!![]:![]}];}return db[_0x06a9('0x8a')][_0x06a9('0x7a')](_0x386296);})[_0x06a9('0x13')](function(_0x29c9e8){_0xf01abf['rows']=_0x29c9e8;return _0xf01abf;});}})[_0x06a9('0x13')](respondWithFilteredResult(_0x45724e,_0x386296))[_0x06a9('0x1e')](handleError(_0x45724e,null));};exports[_0x06a9('0x97')]=function addApplications(_0x1383cb,_0x1a03e9){var _0xd16755=_0x1383cb['params']['id'];var _0x2c45e1=_0x1383cb[_0x06a9('0x68')];var _0x449a35=0xc8;var _0x2066a3=null;return db[_0x06a9('0x98')][_0x06a9('0x99')]({'isolationLevel':db[_0x06a9('0x98')][_0x06a9('0x9a')][_0x06a9('0x9b')]['READ_COMMITTED']},function(_0x48322e){return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0xd16755},'transaction':_0x48322e})[_0x06a9('0x13')](function(_0x5acfb4){if(_0x5acfb4){return db[_0x06a9('0x9c')][_0x06a9('0x2a')]({'where':{'MailAccountId':_0xd16755},'transaction':_0x48322e})[_0x06a9('0x13')](function(){var _0x5d0c04=_[_0x06a9('0x4a')](_0x2c45e1,function(_0x4e0992){_0x4e0992[_0x06a9('0x6e')]=_0xd16755;return _0x4e0992;});return db['MailApplication'][_0x06a9('0x9d')](_0x5d0c04,{'transaction':_0x48322e});});}else{_0x449a35=0x194;_0x2066a3=[];}});})[_0x06a9('0x13')](function(){if(_0x449a35!==0x194){return db['MailApplication'][_0x06a9('0x9e')]({'where':{'MailAccountId':_0xd16755},'order':_0x06a9('0x9f')})['then'](function(_0xd6910a){_0x2066a3=_0xd6910a;});}})[_0x06a9('0x1e')](function(_0x2911cd){_0x449a35=0x1f4;logger[_0x06a9('0x17')](_0x2911cd['stack']);if(_0x2911cd['name']){delete _0x2911cd[_0x06a9('0x2c')];}_0x2066a3=_0x2911cd;})[_0x06a9('0xa0')](function(){if(_0x2066a3===null){_0x1a03e9['sendStatus'](_0x449a35);}else{if(_0x449a35===0x1f4){_0x1a03e9[_0x06a9('0x20')](_0x449a35)[_0x06a9('0x2d')](_0x2066a3);}else{_0x1a03e9[_0x06a9('0x20')](_0x449a35)[_0x06a9('0x22')](_0x2066a3);}}});};exports[_0x06a9('0xa1')]=function(_0x5bc5d0,_0x3cd429){var _0x4fd368={};var _0x43f977={};var _0x26e156;var _0x3b6dfa;return db['MailAccount'][_0x06a9('0x71')]({'where':{'id':_0x5bc5d0[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x3cd429,null))[_0x06a9('0x13')](function(_0x2cc92c){if(_0x2cc92c){_0x26e156=_0x2cc92c;_0x43f977[_0x06a9('0x53')]=_['keys'](db['MailApplication']['rawAttributes']);_0x43f977[_0x06a9('0x4f')]=_['keys'](_0x5bc5d0[_0x06a9('0x4f')]);_0x43f977['filters']=_[_0x06a9('0x52')](_0x43f977['model'],_0x43f977[_0x06a9('0x4f')]);_0x4fd368[_0x06a9('0x55')]=_[_0x06a9('0x52')](_0x43f977['model'],qs['fields'](_0x5bc5d0[_0x06a9('0x4f')][_0x06a9('0x54')]));_0x4fd368[_0x06a9('0x55')]=_0x4fd368[_0x06a9('0x55')][_0x06a9('0x56')]?_0x4fd368[_0x06a9('0x55')]:_0x43f977[_0x06a9('0x53')];_0x4fd368[_0x06a9('0x73')]=qs[_0x06a9('0x59')](_0x5bc5d0[_0x06a9('0x4f')]['sort']);_0x4fd368[_0x06a9('0x5a')]=qs['filters'](_[_0x06a9('0x5b')](_0x5bc5d0[_0x06a9('0x4f')],_0x43f977[_0x06a9('0x51')]));if(_0x5bc5d0[_0x06a9('0x4f')][_0x06a9('0x5c')]){_0x4fd368[_0x06a9('0x5a')]=_['merge'](_0x4fd368['where'],{'$or':_[_0x06a9('0x4a')](_0x4fd368[_0x06a9('0x55')],function(_0x2b49b3){var _0x2a3d3b={};_0x2a3d3b[_0x2b49b3]={'$like':'%'+_0x5bc5d0['query'][_0x06a9('0x5c')]+'%'};return _0x2a3d3b;})});}_0x4fd368=_[_0x06a9('0x5d')]({},_0x4fd368,_0x5bc5d0[_0x06a9('0x60')]);return _0x26e156['getApplications'](_0x4fd368);}})[_0x06a9('0x13')](function(_0x2be548){if(_0x2be548){_0x3b6dfa=_0x2be548[_0x06a9('0x56')];if(!_0x5bc5d0['query'][_0x06a9('0x57')](_0x06a9('0x58'))){_0x4fd368[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x5bc5d0[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x4fd368[_0x06a9('0x23')]=qs[_0x06a9('0x23')](_0x5bc5d0['query'][_0x06a9('0x23')]);}return _0x26e156[_0x06a9('0xa1')](_0x4fd368);}})[_0x06a9('0x13')](function(_0x5798d1){if(_0x5798d1){return _0x5798d1?{'count':_0x3b6dfa,'rows':_0x5798d1}:null;}})['then'](respondWithResult(_0x3cd429,null))['catch'](handleError(_0x3cd429,null));};exports[_0x06a9('0xa2')]=function(_0x5c91bd,_0x1b77f5){var _0x3e0e2e={'raw':!![],'where':{}};var _0x200fb4={};var _0x357625={'count':0x0,'rows':[]};return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x5c91bd['params']['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x1b77f5,null))[_0x06a9('0x13')](function(_0x57046d){if(_0x57046d){_0x200fb4[_0x06a9('0x53')]=_[_0x06a9('0x50')](db['MailMessage'][_0x06a9('0x4c')]);_0x200fb4[_0x06a9('0x4f')]=_[_0x06a9('0x50')](_0x5c91bd[_0x06a9('0x4f')]);_0x200fb4[_0x06a9('0x51')]=_[_0x06a9('0x52')](_0x200fb4[_0x06a9('0x53')],_0x200fb4[_0x06a9('0x4f')]);_0x3e0e2e[_0x06a9('0x55')]=_['intersection'](_0x200fb4[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x5c91bd[_0x06a9('0x4f')]['fields']));_0x3e0e2e[_0x06a9('0x55')]=_0x3e0e2e[_0x06a9('0x55')][_0x06a9('0x56')]?_0x3e0e2e[_0x06a9('0x55')]:_0x200fb4['model'];if(!_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x57')](_0x06a9('0x58'))){_0x3e0e2e[_0x06a9('0x26')]=qs[_0x06a9('0x26')](_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x26')]);_0x3e0e2e[_0x06a9('0x23')]=qs[_0x06a9('0x23')](_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x23')]);}_0x3e0e2e[_0x06a9('0x73')]=qs['sort'](_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x59')]);_0x3e0e2e[_0x06a9('0x5a')]=qs['filters'](_[_0x06a9('0x5b')](_0x5c91bd[_0x06a9('0x4f')],_0x200fb4[_0x06a9('0x51')]));_0x3e0e2e[_0x06a9('0x5a')]['MailAccountId']=_0x57046d['id'];if(_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x5c')]){_0x3e0e2e[_0x06a9('0x5a')]=_[_0x06a9('0x5d')](_0x3e0e2e['where'],{'$or':_[_0x06a9('0x4a')](_0x3e0e2e[_0x06a9('0x55')],function(_0x3fbb2f){var _0x19146e={};_0x19146e[_0x3fbb2f]={'$like':'%'+_0x5c91bd[_0x06a9('0x4f')]['filter']+'%'};return _0x19146e;})});}if(_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0xa3')]){var _0x59374d=_0x5c91bd['query'][_0x06a9('0xa3')][_0x06a9('0xa4')](',');var _0x2f0e2a={};_0x2f0e2a[_0x59374d[0x0]]={'$gte':moment(_0x59374d[0x1])[_0x06a9('0xa5')](_0x06a9('0xa6'))};_0x3e0e2e[_0x06a9('0x5a')]=_[_0x06a9('0x5d')](_0x3e0e2e[_0x06a9('0x5a')],_0x2f0e2a);}_0x3e0e2e=_['merge']({},_0x3e0e2e,_0x5c91bd[_0x06a9('0x60')]);return db[_0x06a9('0xa7')][_0x06a9('0x25')]({'where':_0x3e0e2e[_0x06a9('0x5a')]})[_0x06a9('0x13')](function(_0x4ddab0){_0x357625[_0x06a9('0x25')]=_0x4ddab0;if(_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0x74')]){_0x3e0e2e[_0x06a9('0x65')]=[{'all':!![]}];}return db[_0x06a9('0xa7')][_0x06a9('0x7a')](_0x3e0e2e);})['then'](function(_0x1acdfa){if(_0x5c91bd[_0x06a9('0x4f')][_0x06a9('0xa8')]===_0x06a9('0xa9')){for(var _0x1b076f=0x0;_0x1b076f<_0x1acdfa[_0x06a9('0x56')];_0x1b076f++){_0x1acdfa[_0x1b076f][_0x06a9('0x68')]=juice(_0x1acdfa[_0x1b076f]['body']);}}_0x357625[_0x06a9('0x61')]=_0x1acdfa;return _0x357625;});}})['then'](respondWithFilteredResult(_0x1b77f5,_0x3e0e2e))['catch'](handleError(_0x1b77f5,null));};exports[_0x06a9('0x2d')]=function(_0x1749be,_0x420c37){var _0x39f425,_0xceab78={},_0x42fde9;if(_0x1749be[_0x06a9('0x68')]['to']){_0x42fde9=_0x1749be[_0x06a9('0x68')]['to'][_0x06a9('0xa4')](',')[0x0];}return db['MailAccount'][_0x06a9('0x66')]({'where':{'id':_0x1749be[_0x06a9('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x06a9('0xaa'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x42fde9},'limit':0x1,'order':[[_0x06a9('0xab'),_0x06a9('0xac')]]}]},{'model':db[_0x06a9('0x47')],'as':_0x06a9('0x45'),'raw':!![],'include':[{'model':db[_0x06a9('0xad')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x420c37,null))[_0x06a9('0x13')](function(_0x3848b7){if(!_0x3848b7)return;_0x39f425=_0x3848b7;if(!_0x3848b7[_0x06a9('0x45')])throw new Error(_0x06a9('0xae'));if(_[_0x06a9('0xaf')](_0x1749be['body']['from'])){_0x1749be[_0x06a9('0x68')]['from']=util[_0x06a9('0xa5')]('%s\x20<%s>',_0x3848b7[_0x06a9('0x2c')],_0x3848b7[_0x06a9('0x7c')]||_0x3848b7[_0x06a9('0x45')][_0x06a9('0x39')]);}if(_0x1749be['body'][_0x06a9('0xb0')]&&_0x1749be[_0x06a9('0x68')][_0x06a9('0xb0')][_0x06a9('0x56')]){for(var _0x2b9971=0x0;_0x2b9971<_0x1749be[_0x06a9('0x68')]['attachments']['length'];_0x2b9971+=0x1){_0x1749be[_0x06a9('0x68')][_0x06a9('0xb0')][_0x2b9971]={'filename':_0x1749be['body'][_0x06a9('0xb0')][_0x2b9971][_0x06a9('0x2c')],'path':path['join'](config[_0x06a9('0xb1')],_0x06a9('0xb2'),_0x1749be[_0x06a9('0x68')][_0x06a9('0xb0')][_0x2b9971]['basename'])};}}var _0x2e040c=_0x3848b7['getSmtpOptions']();return respondWithRpcPromise(_0x06a9('0xb3'),_0x06a9('0xb4'),{'account':_0x2e040c,'message':_0x1749be[_0x06a9('0x68')]});})[_0x06a9('0x13')](function(_0x5889ab){if(!_0x5889ab)return;_0xceab78=_0x5889ab;if(!_0x39f425['List'])throw new Error('List\x20not\x20found');if(_0x39f425[_0x06a9('0xaa')]['Contacts']['length'])return _0x39f425[_0x06a9('0xaa')][_0x06a9('0xb5')][0x0];return db[_0x06a9('0x8e')][_0x06a9('0x6f')](_['defaults'](_0x1749be[_0x06a9('0x68')],{'firstName':_0x1749be[_0x06a9('0x68')]['to'],'email':_0x1749be['body']['to'],'phone':_0x1749be['body']['to'],'ListId':_0x39f425[_0x06a9('0x7d')]}));})[_0x06a9('0x13')](function(_0x17a988){if(!_0x17a988)return;var _0x186da0={'UserId':_0x1749be['user']['id'],'ContactId':_0x17a988['id'],'MailAccountId':_0x39f425['id'],'inReplyTo':_0xceab78[_0x06a9('0xb6')],'to':_0x1749be[_0x06a9('0x68')]['from'],'cc':_0x1749be['body']['cc'],'subject':_0x1749be[_0x06a9('0x68')][_0x06a9('0xb7')],'attach':_0x1749be[_0x06a9('0x68')][_0x06a9('0xb8')],'firstMsgDirection':_0x06a9('0xb9'),'lastMsgAt':moment()[_0x06a9('0xa5')](_0x06a9('0xa6')),'lastMsgDirection':_0x06a9('0xb9'),'Messages':[_['merge'](_0x1749be['body'],{'messageId':_0xceab78[_0x06a9('0xb6')],'sentAt':moment()[_0x06a9('0xa5')](_0x06a9('0xa6')),'read':!![],'MailAccountId':_0x39f425['id'],'UserId':_0x1749be['user']['id'],'ContactId':_0x17a988['id']})]};if(_0x1749be[_0x06a9('0x68')]['Interaction']){_0x186da0=_['merge'](_0x186da0,_0x1749be[_0x06a9('0x68')][_0x06a9('0xba')]);}return db[_0x06a9('0x8a')][_0x06a9('0x6f')](_0x186da0,{'include':[{'model':db[_0x06a9('0xa7')],'as':_0x06a9('0xbb')}]});})[_0x06a9('0x13')](respondWithResult(_0x420c37,null))[_0x06a9('0x1e')](handleError(_0x420c37,null));};exports[_0x06a9('0xbc')]=function(_0x7f7b18,_0x31f375){return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x7f7b18['params']['id']},'include':[{'model':db[_0x06a9('0x47')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x06a9('0xad')],'as':_0x06a9('0xad'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x31f375,null))['then'](function(_0x4dd84f){if(!_0x4dd84f['Smtp'])return;var _0x459fdc=_0x4dd84f[_0x06a9('0xbd')]();return respondWithRpcPromise(_0x06a9('0xbe'),_0x06a9('0xbc'),{'account':_0x459fdc});})['then'](respondWithResult(_0x31f375,null))[_0x06a9('0x1e')](handleError(_0x31f375,null));};exports['destroy']=function(_0x37bf85,_0x6ef29c){return db[_0x06a9('0x4b')]['find']({'where':{'id':_0x37bf85[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x6ef29c,null))[_0x06a9('0x13')](function(_0x495ac9){if(_0x495ac9&&_0x495ac9[_0x06a9('0x41')]){throw new db['Sequelize']['ValidationError'](_0x06a9('0xbf'));}return _0x495ac9;})['then'](removeEntity(_0x6ef29c,null))['catch'](handleError(_0x6ef29c,null));};exports['addAgents']=function(_0x4a7966,_0x974bf0){return db[_0x06a9('0x4b')][_0x06a9('0x66')]({'where':{'id':_0x4a7966[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x974bf0,null))[_0x06a9('0x13')](function(_0x479353){if(_0x479353){return _0x479353[_0x06a9('0xc0')](_0x4a7966[_0x06a9('0x68')][_0x06a9('0x76')],_[_0x06a9('0x8c')](_0x4a7966[_0x06a9('0x68')],[_0x06a9('0x76'),'id'])||{})['spread'](function(_0x248da0){for(var _0x4a61d8=0x0;_0x4a61d8<_0x4a7966['body'][_0x06a9('0x76')][_0x06a9('0x56')];_0x4a61d8+=0x1){socket['emit'](_0x06a9('0xc1'),{'UserId':Number(_0x4a7966[_0x06a9('0x68')]['ids'][_0x4a61d8]),'MailAccountId':Number(_0x4a7966[_0x06a9('0x63')]['id'])});}return _0x248da0;});}})[_0x06a9('0x13')](respondWithResult(_0x974bf0,null))[_0x06a9('0x1e')](handleError(_0x974bf0,null));};exports[_0x06a9('0xc2')]=function(_0x28cfbc,_0x1542cc){return db['MailAccount'][_0x06a9('0x66')]({'where':{'id':_0x28cfbc[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0x1542cc,null))[_0x06a9('0x13')](function(_0x2a165d){if(_0x2a165d){return _0x2a165d[_0x06a9('0xc2')](_0x28cfbc[_0x06a9('0x4f')][_0x06a9('0x76')])[_0x06a9('0x13')](function(){if(_[_0x06a9('0xc3')](_0x28cfbc[_0x06a9('0x4f')][_0x06a9('0x76')])){for(var _0x2b98af=0x0;_0x2b98af<_0x28cfbc[_0x06a9('0x4f')][_0x06a9('0x76')]['length'];_0x2b98af+=0x1){socket[_0x06a9('0xc4')](_0x06a9('0xc5'),{'UserId':Number(_0x28cfbc['query'][_0x06a9('0x76')][_0x2b98af]),'MailAccountId':Number(_0x28cfbc[_0x06a9('0x63')]['id'])});}}else{socket[_0x06a9('0xc4')](_0x06a9('0xc5'),{'UserId':Number(_0x28cfbc[_0x06a9('0x4f')][_0x06a9('0x76')]),'MailAccountId':Number(_0x28cfbc[_0x06a9('0x63')]['id'])});}});}})[_0x06a9('0x13')](respondWithStatusCode(_0x1542cc,null))[_0x06a9('0x1e')](handleError(_0x1542cc,null));};exports['getAgents']=function(_0x5b4a0e,_0xb3c4ad){var _0x27b826={};var _0x499401={};var _0x4acafa;var _0x2471b7;return db[_0x06a9('0x4b')][_0x06a9('0x71')]({'where':{'id':_0x5b4a0e[_0x06a9('0x63')]['id']}})[_0x06a9('0x13')](handleEntityNotFound(_0xb3c4ad,null))[_0x06a9('0x13')](function(_0x91e3a0){if(_0x91e3a0){_0x4acafa=_0x91e3a0;_0x499401[_0x06a9('0x53')]=_[_0x06a9('0x50')](db[_0x06a9('0x90')][_0x06a9('0x4c')]);_0x499401[_0x06a9('0x4f')]=_[_0x06a9('0x50')](_0x5b4a0e[_0x06a9('0x4f')]);_0x499401[_0x06a9('0x51')]=_[_0x06a9('0x52')](_0x499401['model'],_0x499401[_0x06a9('0x4f')]);_0x27b826[_0x06a9('0x55')]=_[_0x06a9('0x52')](_0x499401[_0x06a9('0x53')],qs[_0x06a9('0x54')](_0x5b4a0e['query'][_0x06a9('0x54')]));_0x27b826[_0x06a9('0x55')]=_0x27b826[_0x06a9('0x55')][_0x06a9('0x56')]?_0x27b826[_0x06a9('0x55')]:_0x499401[_0x06a9('0x53')];_0x27b826['order']=qs['sort'](_0x5b4a0e[_0x06a9('0x4f')][_0x06a9('0x59')]);_0x27b826[_0x06a9('0x5a')]=qs['filters'](_[_0x06a9('0x5b')](_0x5b4a0e[_0x06a9('0x4f')],_0x499401[_0x06a9('0x51')]));if(_0x5b4a0e[_0x06a9('0x4f')][_0x06a9('0x5c')]){_0x27b826[_0x06a9('0x5a')]=_[_0x06a9('0x5d')](_0x27b826[_0x06a9('0x5a')],{'$or':_[_0x06a9('0x4a')](_0x27b826[_0x06a9('0x55')],function(_0x3c5a86){var _0x367d75={};_0x367d75[_0x3c5a86]={'$like':'%'+_0x5b4a0e[_0x06a9('0x4f')][_0x06a9('0x5c')]+'%'};return _0x367d75;})});}_0x27b826=_[_0x06a9('0x5d')]({},_0x27b826,_0x5b4a0e[_0x06a9('0x60')]);return _0x4acafa[_0x06a9('0xc6')](_0x27b826);}})[_0x06a9('0x13')](function(_0x54a92a){if(_0x54a92a){_0x2471b7=_0x54a92a[_0x06a9('0x56')];if(!_0x5b4a0e[_0x06a9('0x4f')][_0x06a9('0x57')](_0x06a9('0x58'))){_0x27b826['limit']=qs[_0x06a9('0x26')](_0x5b4a0e[_0x06a9('0x4f')]['limit']);_0x27b826[_0x06a9('0x23')]=qs[_0x06a9('0x23')](_0x5b4a0e['query'][_0x06a9('0x23')]);}return _0x4acafa[_0x06a9('0xc6')](_0x27b826);}})[_0x06a9('0x13')](function(_0x452825){if(_0x452825){return _0x452825?{'count':_0x2471b7,'rows':_0x452825}:null;}})[_0x06a9('0x13')](respondWithResult(_0xb3c4ad,null))[_0x06a9('0x1e')](handleError(_0xb3c4ad,null));}; \ No newline at end of file +var _0xa376=['sort','where','pick','filter','merge','options','findAll','rows','MailServerIn','fields','includeAll','include','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','hasOwnProperty','order','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','email','ListId','isNil','active','description','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','gmail','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','length'];(function(_0x499123,_0x345139){var _0xb511bf=function(_0x21fdac){while(--_0x21fdac){_0x499123['push'](_0x499123['shift']());}};_0xb511bf(++_0x345139);}(_0xa376,0x129));var _0x6a37=function(_0x19b347,_0x383da8){_0x19b347=_0x19b347-0x0;var _0x1dc07d=_0xa376[_0x19b347];return _0x1dc07d;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x6a37('0x0'));var path=require(_0x6a37('0x1'));var _=require(_0x6a37('0x2'));var juice=require(_0x6a37('0x3'));var Redis=require(_0x6a37('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x6a37('0x5'))(_0x6a37('0x6'));var config=require(_0x6a37('0x7'));var db=require(_0x6a37('0x8'))['db'];config['redis']=_[_0x6a37('0x9')](config[_0x6a37('0xa')],{'host':_0x6a37('0xb'),'port':0x18eb});var socket=require(_0x6a37('0xc'))(new Redis(config[_0x6a37('0xa')]));require(_0x6a37('0xd'))['register'](socket);var jayson=require(_0x6a37('0xe'));var client=jayson[_0x6a37('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x5e58c9,_0x52c910,_0x205af8,_0x34cb50){return new BPromise(function(_0x49be25,_0x3809d5){var _0x1772bd=_0x34cb50||client;return _0x1772bd['request'](_0x5e58c9,_0x205af8)[_0x6a37('0x10')](function(_0x2302a3){logger[_0x6a37('0x11')](_0x6a37('0x12'),_0x52c910,_0x6a37('0x13'));logger['debug'](_0x6a37('0x14'),_0x52c910,'request\x20sent',JSON['stringify'](_0x2302a3));if(_0x2302a3['error']){if(_0x2302a3['error'][_0x6a37('0x15')]===0x1f4){logger[_0x6a37('0x16')](_0x6a37('0x12'),_0x52c910,_0x2302a3['error'][_0x6a37('0x17')]);return _0x3809d5(_0x2302a3[_0x6a37('0x16')][_0x6a37('0x17')]);}logger[_0x6a37('0x16')](_0x6a37('0x12'),_0x52c910,_0x2302a3[_0x6a37('0x16')][_0x6a37('0x17')]);return _0x49be25(_0x2302a3['error'][_0x6a37('0x17')]);}else{logger[_0x6a37('0x11')](_0x6a37('0x12'),_0x52c910,'request\x20sent');_0x49be25(_0x2302a3[_0x6a37('0x18')][_0x6a37('0x17')]);}})[_0x6a37('0x19')](function(_0x2a1676){logger[_0x6a37('0x16')](_0x6a37('0x12'),_0x52c910,_0x2a1676);_0x3809d5(_0x2a1676);});});}function respondWithStatusCode(_0x4ef50f,_0x593d67){_0x593d67=_0x593d67||0xcc;return function(_0x30ffff){if(_0x30ffff){return _0x4ef50f['sendStatus'](_0x593d67);}return _0x4ef50f[_0x6a37('0x1a')](_0x593d67)[_0x6a37('0x1b')]();};}function respondWithResult(_0x1361cd,_0x51f775){_0x51f775=_0x51f775||0xc8;return function(_0x249f4f){if(_0x249f4f){return _0x1361cd[_0x6a37('0x1a')](_0x51f775)[_0x6a37('0x1c')](_0x249f4f);}};}function respondWithFilteredResult(_0x402f47,_0x1d4007){return function(_0x335d8c){if(_0x335d8c){var _0x4cee87=typeof _0x1d4007[_0x6a37('0x1d')]===_0x6a37('0x1e')&&typeof _0x1d4007[_0x6a37('0x1f')]===_0x6a37('0x1e');var _0x42d47a=_0x335d8c[_0x6a37('0x20')];var _0x581127=_0x4cee87?0x0:_0x1d4007[_0x6a37('0x1d')];var _0x287ee2=_0x4cee87?_0x335d8c[_0x6a37('0x20')]:_0x1d4007[_0x6a37('0x1d')]+_0x1d4007[_0x6a37('0x1f')];var _0x1369f3;if(_0x287ee2>=_0x42d47a){_0x287ee2=_0x42d47a;_0x1369f3=0xc8;}else{_0x1369f3=0xce;}_0x402f47[_0x6a37('0x1a')](_0x1369f3);return _0x402f47[_0x6a37('0x21')](_0x6a37('0x22'),_0x581127+'-'+_0x287ee2+'/'+_0x42d47a)[_0x6a37('0x1c')](_0x335d8c);}return null;};}function saveUpdates(_0x3cf866){return function(_0x147747){if(_0x147747){return _0x147747[_0x6a37('0x23')](_0x3cf866)[_0x6a37('0x10')](function(_0x60c0f1){return _0x60c0f1;});}return null;};}function removeEntity(_0x2ef930){return function(_0x57937d){if(_0x57937d){return _0x57937d['destroy']()['then'](function(){var _0x477827=_0x57937d[_0x6a37('0x24')]({'plain':!![]});var _0x39e704='MailAccounts';return db[_0x6a37('0x25')][_0x6a37('0x26')]({'where':{'type':_0x39e704,'resourceId':_0x477827['id']}})[_0x6a37('0x10')](function(){return _0x57937d;});})[_0x6a37('0x10')](function(){_0x2ef930[_0x6a37('0x1a')](0xcc)[_0x6a37('0x1b')]();});}};}function handleEntityNotFound(_0x2258ba){return function(_0x11ee46){if(!_0x11ee46){_0x2258ba[_0x6a37('0x27')](0x194);}return _0x11ee46;};}function handleError(_0x1d8f9d,_0x16cfbb){_0x16cfbb=_0x16cfbb||0x1f4;return function(_0x46023d){logger[_0x6a37('0x16')](_0x46023d[_0x6a37('0x28')]);if(_0x46023d[_0x6a37('0x29')]){delete _0x46023d[_0x6a37('0x29')];}_0x1d8f9d['status'](_0x16cfbb)[_0x6a37('0x2a')](_0x46023d);};}function getImapHost(_0x18c0a7){switch(_0x18c0a7){case _0x6a37('0x2b'):return'imap.gmail.com';case _0x6a37('0x2c'):return'imap.mail.yahoo.com';case'hotmail':return _0x6a37('0x2d');case _0x6a37('0x2e'):return _0x6a37('0x2f');}throw new Error(_0x6a37('0x30'),_0x18c0a7);}function getSmtpHost(_0x5534a5){switch(_0x5534a5){case _0x6a37('0x2b'):return _0x6a37('0x31');case _0x6a37('0x2c'):return _0x6a37('0x32');case'hotmail':return _0x6a37('0x33');case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5534a5);}function getAuthenticationOptions(_0x2b4887,_0x47547c){var _0x473959={};var _0x2197de={};if(_0x2b4887){_0x473959['user']=_0x2197de[_0x6a37('0x34')]=_0x47547c[_0x6a37('0x35')];_0x473959[_0x6a37('0x36')]=_0x2197de['pass']=_0x47547c[_0x6a37('0x36')];if(_0x47547c[_0x6a37('0x37')]){_0x473959['modernAuthentication']=_0x2197de[_0x6a37('0x37')]=!![];_0x473959[_0x6a37('0x38')]=_0x2197de[_0x6a37('0x38')]=_0x47547c[_0x6a37('0x38')];_0x473959[_0x6a37('0x36')]=_0x2197de[_0x6a37('0x39')]=null;}else{_0x473959['CloudProviderId']=_0x2197de[_0x6a37('0x38')]=null;}_0x473959[_0x6a37('0x3a')]=getImapHost(_0x2b4887);_0x473959[_0x6a37('0x3b')]=0x3e1;_0x2197de['host']=getSmtpHost(_0x2b4887);_0x2197de[_0x6a37('0x3b')]=0x24b;_0x2197de[_0x6a37('0x3c')]=![];_0x473959[_0x6a37('0x3d')]=_0x2197de['service']=null;}else{if(_0x47547c['authentication']){_0x473959[_0x6a37('0x34')]=_0x2197de[_0x6a37('0x34')]=_0x47547c['username'];_0x473959[_0x6a37('0x36')]=_0x2197de['pass']=_0x47547c[_0x6a37('0x36')];}else{_0x473959['authentication']=_0x2197de[_0x6a37('0x3e')]=![];_0x473959[_0x6a37('0x34')]=_0x2197de[_0x6a37('0x34')]=null;_0x473959['password']=_0x2197de['pass']=null;}_0x473959[_0x6a37('0x3a')]=_0x47547c[_0x6a37('0x3f')]['host'];_0x473959['port']=_0x47547c[_0x6a37('0x3f')][_0x6a37('0x3b')];_0x2197de[_0x6a37('0x3a')]=_0x47547c[_0x6a37('0x40')][_0x6a37('0x3a')];_0x2197de[_0x6a37('0x3b')]=_0x47547c[_0x6a37('0x40')][_0x6a37('0x3b')];}return{'Imap':_0x473959,'Smtp':_0x2197de};}exports[_0x6a37('0x41')]=function(_0x326284,_0x3c9cb9){var _0x2fe5d8={'include':[{'model':db['MailServerIn'],'as':_0x6a37('0x3f')},{'model':db[_0x6a37('0x42')],'as':'Smtp'},{'model':db[_0x6a37('0x43')],'as':_0x6a37('0x44')}]},_0xe531b4={},_0x2af5f0={'count':0x0,'rows':[]};var _0x4de060=_[_0x6a37('0x45')](db[_0x6a37('0x46')]['rawAttributes'],function(_0x1c85e3){return{'name':_0x1c85e3[_0x6a37('0x47')],'type':_0x1c85e3[_0x6a37('0x48')][_0x6a37('0x49')]};});_0xe531b4[_0x6a37('0x4a')]=_[_0x6a37('0x45')](_0x4de060,_0x6a37('0x29'));_0xe531b4[_0x6a37('0x4b')]=_[_0x6a37('0x4c')](_0x326284['query']);_0xe531b4[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0xe531b4['model'],_0xe531b4['query']);_0x2fe5d8[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0xe531b4['model'],qs['fields'](_0x326284['query']['fields']));_0x2fe5d8[_0x6a37('0x4f')]=_0x2fe5d8[_0x6a37('0x4f')][_0x6a37('0x50')]?_0x2fe5d8[_0x6a37('0x4f')]:_0xe531b4['model'];if(!_0x326284['query']['hasOwnProperty']('nolimit')){_0x2fe5d8[_0x6a37('0x1f')]=qs['limit'](_0x326284[_0x6a37('0x4b')][_0x6a37('0x1f')]);_0x2fe5d8[_0x6a37('0x1d')]=qs[_0x6a37('0x1d')](_0x326284[_0x6a37('0x4b')][_0x6a37('0x1d')]);}_0x2fe5d8['order']=qs[_0x6a37('0x51')](_0x326284[_0x6a37('0x4b')][_0x6a37('0x51')]);_0x2fe5d8[_0x6a37('0x52')]=qs[_0x6a37('0x4d')](_[_0x6a37('0x53')](_0x326284[_0x6a37('0x4b')],_0xe531b4[_0x6a37('0x4d')]),_0x4de060);if(_0x326284[_0x6a37('0x4b')]['filter']){_0x2fe5d8[_0x6a37('0x52')]=_['merge'](_0x2fe5d8[_0x6a37('0x52')],{'$or':_[_0x6a37('0x45')](_0x4de060,function(_0x3f580c){if(_0x3f580c[_0x6a37('0x48')]!=='VIRTUAL'){var _0x4a5756={};_0x4a5756[_0x3f580c[_0x6a37('0x29')]]={'$like':'%'+_0x326284[_0x6a37('0x4b')][_0x6a37('0x54')]+'%'};return _0x4a5756;}})});}_0x2fe5d8=_[_0x6a37('0x55')]({},_0x2fe5d8,_0x326284[_0x6a37('0x56')]);var _0x22e32f={'where':_0x2fe5d8[_0x6a37('0x52')]};return db[_0x6a37('0x46')]['count'](_0x22e32f)[_0x6a37('0x10')](function(_0x290735){_0x2af5f0[_0x6a37('0x20')]=_0x290735;if(_0x326284[_0x6a37('0x4b')]['includeAll']){_0x2fe5d8['include']=[{'all':!![]}];}return db['MailAccount'][_0x6a37('0x57')](_0x2fe5d8);})[_0x6a37('0x10')](function(_0x5ee2d3){_0x2af5f0[_0x6a37('0x58')]=_0x5ee2d3;return _0x2af5f0;})[_0x6a37('0x10')](respondWithFilteredResult(_0x3c9cb9,_0x2fe5d8))[_0x6a37('0x19')](handleError(_0x3c9cb9,null));};exports['show']=function(_0x33c07f,_0x5b5c4b){var _0xfdd581={'raw':![],'where':{'id':_0x33c07f['params']['id']},'include':[{'model':db[_0x6a37('0x59')],'as':_0x6a37('0x3f')},{'model':db['MailServerOut'],'as':_0x6a37('0x40')},{'model':db[_0x6a37('0x43')],'as':_0x6a37('0x44')}]},_0x105e1d={};_0x105e1d[_0x6a37('0x4a')]=_[_0x6a37('0x4c')](db[_0x6a37('0x46')]['rawAttributes']);_0x105e1d[_0x6a37('0x4b')]=_[_0x6a37('0x4c')](_0x33c07f['query']);_0x105e1d[_0x6a37('0x4d')]=_['intersection'](_0x105e1d[_0x6a37('0x4a')],_0x105e1d[_0x6a37('0x4b')]);_0xfdd581[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x105e1d['model'],qs['fields'](_0x33c07f[_0x6a37('0x4b')][_0x6a37('0x5a')]));_0xfdd581[_0x6a37('0x4f')]=_0xfdd581[_0x6a37('0x4f')]['length']?_0xfdd581[_0x6a37('0x4f')]:_0x105e1d[_0x6a37('0x4a')];if(_0x33c07f[_0x6a37('0x4b')][_0x6a37('0x5b')]){_0xfdd581[_0x6a37('0x5c')]=[{'all':!![]}];}_0xfdd581=_[_0x6a37('0x55')]({},_0xfdd581,_0x33c07f[_0x6a37('0x56')]);return db[_0x6a37('0x46')][_0x6a37('0x5d')](_0xfdd581)['then'](handleEntityNotFound(_0x5b5c4b,null))[_0x6a37('0x10')](respondWithResult(_0x5b5c4b,null))[_0x6a37('0x19')](handleError(_0x5b5c4b,null));};exports[_0x6a37('0x23')]=function(_0xe843eb,_0x26dee){if(_0xe843eb[_0x6a37('0x5e')]['id']){delete _0xe843eb['body']['id'];}var _0x31dad6=_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x5f')]===_0x6a37('0x60')?null:_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x5f')];var _0x4562d7=_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x3f')]||{};var _0x54546c=_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x40')]||{};if(_0x31dad6){_0x4562d7[_0x6a37('0x3a')]=getImapHost(_0x31dad6);_0x4562d7[_0x6a37('0x3b')]=0x3e1;_0x54546c['host']=getSmtpHost(_0x31dad6);_0x54546c[_0x6a37('0x3b')]=0x24b;_0x54546c[_0x6a37('0x3c')]=![];}if(_0x54546c['modernAuthentication']){_0x54546c[_0x6a37('0x3c')]=![];}else{_0x54546c[_0x6a37('0x38')]=null;}if(!_0x4562d7[_0x6a37('0x37')])_0x4562d7[_0x6a37('0x38')]=null;_0xe843eb['body'][_0x6a37('0x3f')]=_0x4562d7;_0xe843eb[_0x6a37('0x5e')]['Smtp']=_0x54546c;return db['MailAccount'][_0x6a37('0x5d')]({'where':{'id':_0xe843eb[_0x6a37('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x6a37('0x3f')},{'model':db[_0x6a37('0x42')],'as':_0x6a37('0x40')},{'model':db[_0x6a37('0x43')],'as':_0x6a37('0x44')}]})[_0x6a37('0x10')](handleEntityNotFound(_0x26dee,null))[_0x6a37('0x10')](function(_0x28d0c6){if(!_0x28d0c6)throw new Error(_0x6a37('0x62'));if(_0x28d0c6[_0x6a37('0x3d')])delete _0xe843eb[_0x6a37('0x5e')][_0x6a37('0x3f')];return _0x28d0c6;})[_0x6a37('0x10')](saveUpdates(_0xe843eb[_0x6a37('0x5e')],null))[_0x6a37('0x10')](function(_0x108f70){if(!_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x3f')])return _0x108f70;return db[_0x6a37('0x59')][_0x6a37('0x23')](_0xe843eb[_0x6a37('0x5e')]['Imap'],{'where':{'MailAccountId':_0x108f70['id']}})['then'](function(){return _0x108f70;});})['then'](function(_0x431048){if(!_0xe843eb[_0x6a37('0x5e')][_0x6a37('0x40')])return _0x431048;return db[_0x6a37('0x42')][_0x6a37('0x23')](_0xe843eb[_0x6a37('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x431048['id']}})[_0x6a37('0x10')](function(){return _0x431048;});})[_0x6a37('0x10')](respondWithResult(_0x26dee,null))[_0x6a37('0x19')](handleError(_0x26dee,null));};exports[_0x6a37('0x63')]=function(_0xa134be,_0x151a91){return db[_0x6a37('0x46')]['describe']()[_0x6a37('0x10')](respondWithResult(_0x151a91,null))[_0x6a37('0x19')](handleError(_0x151a91,null));};exports['addDisposition']=function(_0x4e0ef3,_0x29283c){if(_0x4e0ef3[_0x6a37('0x5e')]['id']){delete _0x4e0ef3[_0x6a37('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x4e0ef3[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x29283c,null))['then'](function(_0xf87203){if(_0xf87203){_0x4e0ef3[_0x6a37('0x5e')][_0x6a37('0x64')]=_0xf87203['id'];return db[_0x6a37('0x65')][_0x6a37('0x66')](_0x4e0ef3[_0x6a37('0x5e')]);}})[_0x6a37('0x10')](respondWithResult(_0x29283c,null))[_0x6a37('0x19')](handleError(_0x29283c,null));};exports[_0x6a37('0x67')]=function(_0x9114ac,_0x378910){var _0x130ff1={'raw':![],'where':{}};var _0x3dbcb8={};var _0x1ecd2f={'count':0x0,'rows':[]};return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x9114ac[_0x6a37('0x61')]['id']}})['then'](handleEntityNotFound(_0x378910,null))['then'](function(_0x1117f3){if(_0x1117f3){_0x3dbcb8['model']=_['keys'](db[_0x6a37('0x65')][_0x6a37('0x69')]);_0x3dbcb8[_0x6a37('0x4b')]=_['keys'](_0x9114ac[_0x6a37('0x4b')]);_0x3dbcb8[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0x3dbcb8[_0x6a37('0x4a')],_0x3dbcb8['query']);_0x130ff1[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x3dbcb8[_0x6a37('0x4a')],qs['fields'](_0x9114ac['query'][_0x6a37('0x5a')]));_0x130ff1[_0x6a37('0x4f')]=_0x130ff1['attributes'][_0x6a37('0x50')]?_0x130ff1['attributes']:_0x3dbcb8[_0x6a37('0x4a')];if(!_0x9114ac[_0x6a37('0x4b')][_0x6a37('0x6a')]('nolimit')){_0x130ff1[_0x6a37('0x1f')]=qs[_0x6a37('0x1f')](_0x9114ac[_0x6a37('0x4b')][_0x6a37('0x1f')]);_0x130ff1[_0x6a37('0x1d')]=qs[_0x6a37('0x1d')](_0x9114ac['query'][_0x6a37('0x1d')]);}_0x130ff1[_0x6a37('0x6b')]=qs[_0x6a37('0x51')](_0x9114ac[_0x6a37('0x4b')][_0x6a37('0x51')]);_0x130ff1[_0x6a37('0x52')]=qs[_0x6a37('0x4d')](_['pick'](_0x9114ac[_0x6a37('0x4b')],_0x3dbcb8[_0x6a37('0x4d')]));_0x130ff1[_0x6a37('0x52')][_0x6a37('0x64')]=_0x1117f3['id'];if(_0x9114ac[_0x6a37('0x4b')][_0x6a37('0x54')]){_0x130ff1[_0x6a37('0x52')]=_['merge'](_0x130ff1[_0x6a37('0x52')],{'$or':_[_0x6a37('0x45')](_0x130ff1[_0x6a37('0x4f')],function(_0x37b97a){var _0x17f762={};_0x17f762[_0x37b97a]={'$like':'%'+_0x9114ac['query'][_0x6a37('0x54')]+'%'};return _0x17f762;})});}_0x130ff1=_['merge']({},_0x130ff1,_0x9114ac[_0x6a37('0x56')]);return db['Disposition'][_0x6a37('0x20')]({'where':_0x130ff1[_0x6a37('0x52')]})['then'](function(_0xe2bbd9){_0x1ecd2f[_0x6a37('0x20')]=_0xe2bbd9;if(_0x9114ac[_0x6a37('0x4b')][_0x6a37('0x5b')]){_0x130ff1['include']=[{'all':!![]}];}return db['Disposition'][_0x6a37('0x57')](_0x130ff1);})[_0x6a37('0x10')](function(_0x4f7673){_0x1ecd2f[_0x6a37('0x58')]=_0x4f7673;return _0x1ecd2f;});}})[_0x6a37('0x10')](respondWithFilteredResult(_0x378910,_0x130ff1))[_0x6a37('0x19')](handleError(_0x378910,null));};exports[_0x6a37('0x6c')]=function(_0x12187d,_0x16a6e3){return db['MailAccount'][_0x6a37('0x5d')]({'where':{'id':_0x12187d[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x16a6e3,null))[_0x6a37('0x10')](function(_0xb9b497){if(_0xb9b497){return _0xb9b497[_0x6a37('0x6c')](_0x12187d[_0x6a37('0x4b')][_0x6a37('0x6d')]);}})['then'](respondWithStatusCode(_0x16a6e3,null))[_0x6a37('0x19')](handleError(_0x16a6e3,null));};exports['addAnswer']=function(_0x46deb4,_0x5ba3f3){if(_0x46deb4[_0x6a37('0x5e')]['id']){delete _0x46deb4['body']['id'];}return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x46deb4[_0x6a37('0x61')]['id']}})['then'](handleEntityNotFound(_0x5ba3f3,null))[_0x6a37('0x10')](function(_0x437ef8){if(_0x437ef8){_0x46deb4['body'][_0x6a37('0x64')]=_0x437ef8['id'];return db[_0x6a37('0x6e')][_0x6a37('0x66')](_0x46deb4[_0x6a37('0x5e')]);}})['then'](respondWithResult(_0x5ba3f3,null))[_0x6a37('0x19')](handleError(_0x5ba3f3,null));};exports[_0x6a37('0x6f')]=function(_0x33344e,_0x1e695c){var _0x1f382b={'raw':![],'where':{}};var _0x493486={};var _0x3fc491={'count':0x0,'rows':[]};return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x33344e[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x1e695c,null))[_0x6a37('0x10')](function(_0x4e4fa6){if(_0x4e4fa6){_0x493486[_0x6a37('0x4a')]=_['keys'](db[_0x6a37('0x6e')][_0x6a37('0x69')]);_0x493486[_0x6a37('0x4b')]=_[_0x6a37('0x4c')](_0x33344e[_0x6a37('0x4b')]);_0x493486[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0x493486['model'],_0x493486[_0x6a37('0x4b')]);_0x1f382b[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x493486[_0x6a37('0x4a')],qs[_0x6a37('0x5a')](_0x33344e[_0x6a37('0x4b')]['fields']));_0x1f382b[_0x6a37('0x4f')]=_0x1f382b[_0x6a37('0x4f')][_0x6a37('0x50')]?_0x1f382b['attributes']:_0x493486[_0x6a37('0x4a')];if(!_0x33344e['query'][_0x6a37('0x6a')](_0x6a37('0x70'))){_0x1f382b[_0x6a37('0x1f')]=qs['limit'](_0x33344e[_0x6a37('0x4b')][_0x6a37('0x1f')]);_0x1f382b[_0x6a37('0x1d')]=qs[_0x6a37('0x1d')](_0x33344e[_0x6a37('0x4b')]['offset']);}_0x1f382b[_0x6a37('0x6b')]=qs[_0x6a37('0x51')](_0x33344e['query'][_0x6a37('0x51')]);_0x1f382b['where']=qs[_0x6a37('0x4d')](_[_0x6a37('0x53')](_0x33344e[_0x6a37('0x4b')],_0x493486[_0x6a37('0x4d')]));_0x1f382b[_0x6a37('0x52')]['MailAccountId']=_0x4e4fa6['id'];if(_0x33344e[_0x6a37('0x4b')][_0x6a37('0x54')]){_0x1f382b[_0x6a37('0x52')]=_[_0x6a37('0x55')](_0x1f382b[_0x6a37('0x52')],{'$or':_['map'](_0x1f382b[_0x6a37('0x4f')],function(_0x116d65){var _0x4b6da5={};_0x4b6da5[_0x116d65]={'$like':'%'+_0x33344e[_0x6a37('0x4b')][_0x6a37('0x54')]+'%'};return _0x4b6da5;})});}_0x1f382b=_[_0x6a37('0x55')]({},_0x1f382b,_0x33344e[_0x6a37('0x56')]);return db[_0x6a37('0x6e')][_0x6a37('0x20')]({'where':_0x1f382b[_0x6a37('0x52')]})[_0x6a37('0x10')](function(_0x211864){_0x3fc491[_0x6a37('0x20')]=_0x211864;if(_0x33344e[_0x6a37('0x4b')][_0x6a37('0x5b')]){_0x1f382b['include']=[{'all':!![]}];}return db[_0x6a37('0x6e')]['findAll'](_0x1f382b);})[_0x6a37('0x10')](function(_0x55fff7){_0x3fc491[_0x6a37('0x58')]=_0x55fff7;return _0x3fc491;});}})['then'](respondWithFilteredResult(_0x1e695c,_0x1f382b))['catch'](handleError(_0x1e695c,null));};exports[_0x6a37('0x71')]=function(_0x4a356c,_0x581e63){return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x4a356c[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x581e63,null))[_0x6a37('0x10')](function(_0x4e9a85){if(_0x4e9a85){return _0x4e9a85[_0x6a37('0x71')](_0x4a356c['query'][_0x6a37('0x6d')]);}})[_0x6a37('0x10')](respondWithStatusCode(_0x581e63,null))['catch'](handleError(_0x581e63,null));};exports[_0x6a37('0x66')]=function(_0x3dd2c2,_0x1a82cc){var _0x2f533f={'name':_0x3dd2c2[_0x6a37('0x5e')]['name'],'key':_0x3dd2c2[_0x6a37('0x5e')][_0x6a37('0x49')],'provider':_0x3dd2c2['body']['provider']===_0x6a37('0x60')?null:_0x3dd2c2['body'][_0x6a37('0x5f')],'email':_0x3dd2c2['body'][_0x6a37('0x72')],'ListId':_0x3dd2c2[_0x6a37('0x5e')][_0x6a37('0x73')],'active':!_[_0x6a37('0x74')](_0x3dd2c2[_0x6a37('0x5e')][_0x6a37('0x75')])?_0x3dd2c2[_0x6a37('0x5e')][_0x6a37('0x75')]:!![],'description':_0x3dd2c2['body'][_0x6a37('0x76')]||null};var _0x42b535=getAuthenticationOptions(_0x2f533f[_0x6a37('0x5f')],_0x3dd2c2[_0x6a37('0x5e')]);_0x2f533f[_0x6a37('0x3f')]=_0x42b535[_0x6a37('0x3f')];_0x2f533f[_0x6a37('0x40')]=_0x42b535['Smtp'];return db[_0x6a37('0x46')][_0x6a37('0x66')](_0x2f533f,{'include':[{'model':db['MailServerOut'],'as':_0x6a37('0x40')},{'model':db[_0x6a37('0x59')],'as':_0x6a37('0x3f')}]})[_0x6a37('0x10')](function(_0x419851){var _0x4255f5=_0x3dd2c2['user'][_0x6a37('0x24')]({'plain':!![]});if(!_0x4255f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4255f5[_0x6a37('0x77')]===_0x6a37('0x34')){var _0x29c628=_0x419851['get']({'plain':!![]});return db['UserProfileSection'][_0x6a37('0x5d')]({'where':{'name':'MailAccounts','userProfileId':_0x4255f5[_0x6a37('0x78')]},'raw':!![]})[_0x6a37('0x10')](function(_0x50f4cb){if(_0x50f4cb&&_0x50f4cb[_0x6a37('0x79')]===0x0){return db[_0x6a37('0x25')][_0x6a37('0x66')]({'name':_0x29c628[_0x6a37('0x29')],'resourceId':_0x29c628['id'],'type':_0x50f4cb[_0x6a37('0x29')],'sectionId':_0x50f4cb['id']},{})['then'](function(){return _0x419851;});}else{return _0x419851;}})['catch'](function(_0x21b3d0){logger['error'](_0x6a37('0x7a'),_0x21b3d0);throw _0x21b3d0;});}return _0x419851;})[_0x6a37('0x10')](respondWithResult(_0x1a82cc,0xc9))[_0x6a37('0x19')](handleError(_0x1a82cc,null));};exports[_0x6a37('0x7b')]=function(_0x2db2f6,_0x328ef9){return db['MailAccount']['findOne']({'where':{'id':_0x2db2f6[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x328ef9,null))[_0x6a37('0x10')](function(_0x169b00){if(_0x169b00){return _0x169b00[_0x6a37('0x7b')]();}return null;})[_0x6a37('0x10')](respondWithResult(_0x328ef9,null))[_0x6a37('0x19')](handleError(_0x328ef9,null));};exports[_0x6a37('0x7c')]=function(_0x37b213,_0x450ce9){if(_0x37b213[_0x6a37('0x5e')]['id']){delete _0x37b213[_0x6a37('0x5e')]['id'];}return db['MailAccount'][_0x6a37('0x5d')]({'where':{'id':_0x37b213[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x450ce9,null))['then'](function(_0x302d93){if(_0x302d93){_0x37b213[_0x6a37('0x5e')][_0x6a37('0x64')]=_0x302d93['id'];return db[_0x6a37('0x59')][_0x6a37('0x66')](_0x37b213[_0x6a37('0x5e')]);}})[_0x6a37('0x10')](respondWithResult(_0x450ce9,null))[_0x6a37('0x19')](handleError(_0x450ce9,null));};exports[_0x6a37('0x7d')]=function(_0x544f7a,_0xa06061){return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x544f7a[_0x6a37('0x61')]['id']}})['then'](handleEntityNotFound(_0xa06061,null))[_0x6a37('0x10')](function(_0x429532){if(_0x429532){return _0x429532[_0x6a37('0x7e')](null);}return null;})[_0x6a37('0x10')](respondWithStatusCode(_0xa06061,null))[_0x6a37('0x19')](handleError(_0xa06061,null));};exports[_0x6a37('0x7f')]=function(_0x142ad3,_0x56de08){return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x142ad3[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x56de08,null))['then'](function(_0xf9b0b6){if(_0xf9b0b6){return _0xf9b0b6[_0x6a37('0x7f')]();}return null;})[_0x6a37('0x10')](respondWithResult(_0x56de08,null))[_0x6a37('0x19')](handleError(_0x56de08,null));};exports[_0x6a37('0x80')]=function(_0x3bb829,_0x2d94f0){if(_0x3bb829[_0x6a37('0x5e')]['id']){delete _0x3bb829[_0x6a37('0x5e')]['id'];}return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x3bb829[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x2d94f0,null))['then'](function(_0x1417ee){if(_0x1417ee){_0x3bb829[_0x6a37('0x5e')][_0x6a37('0x64')]=_0x1417ee['id'];return db['MailServerOut'][_0x6a37('0x66')](_0x3bb829[_0x6a37('0x5e')]);}})['then'](respondWithResult(_0x2d94f0,null))[_0x6a37('0x19')](handleError(_0x2d94f0,null));};exports[_0x6a37('0x81')]=function(_0x4fb643,_0x58991d){return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x4fb643[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x58991d,null))['then'](function(_0x38cdcc){if(_0x38cdcc){return _0x38cdcc[_0x6a37('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x58991d,null))['catch'](handleError(_0x58991d,null));};exports[_0x6a37('0x83')]=function(_0x162b97,_0x507ff6){return db[_0x6a37('0x84')][_0x6a37('0x5d')]({'where':{'id':_0x162b97[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x507ff6,null))[_0x6a37('0x10')](function(_0x355caa){if(_0x355caa){return _0x355caa[_0x6a37('0x83')](_0x162b97['body'][_0x6a37('0x6d')],_[_0x6a37('0x85')](_0x162b97[_0x6a37('0x5e')],[_0x6a37('0x6d'),'id'])||{});}})[_0x6a37('0x10')](respondWithResult(_0x507ff6,null))[_0x6a37('0x19')](handleError(_0x507ff6,null));};exports[_0x6a37('0x86')]=function(_0x80c3bf,_0x5c3af1){var _0x591228={'raw':![],'where':{}};var _0x43ea16={};var _0x4b338a={'count':0x0,'rows':[]};return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x80c3bf['params']['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x5c3af1,null))[_0x6a37('0x10')](function(_0x1641dc){if(_0x1641dc){_0x43ea16[_0x6a37('0x4a')]=_[_0x6a37('0x4c')](db['MailInteraction'][_0x6a37('0x69')]);_0x43ea16['query']=_['keys'](_0x80c3bf[_0x6a37('0x4b')]);_0x43ea16[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0x43ea16[_0x6a37('0x4a')],_0x43ea16[_0x6a37('0x4b')]);_0x591228[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x43ea16[_0x6a37('0x4a')],qs['fields'](_0x80c3bf['query'][_0x6a37('0x5a')]));_0x591228['attributes']=_0x591228[_0x6a37('0x4f')][_0x6a37('0x50')]?_0x591228['attributes']:_0x43ea16[_0x6a37('0x4a')];if(!_0x80c3bf[_0x6a37('0x4b')][_0x6a37('0x6a')](_0x6a37('0x70'))){_0x591228['limit']=qs[_0x6a37('0x1f')](_0x80c3bf[_0x6a37('0x4b')][_0x6a37('0x1f')]);_0x591228['offset']=qs['offset'](_0x80c3bf[_0x6a37('0x4b')][_0x6a37('0x1d')]);}_0x591228[_0x6a37('0x6b')]=qs['sort'](_0x80c3bf['query'][_0x6a37('0x51')]);_0x591228[_0x6a37('0x52')]=qs['filters'](_[_0x6a37('0x53')](_0x80c3bf[_0x6a37('0x4b')],_0x43ea16['filters']));_0x591228[_0x6a37('0x52')][_0x6a37('0x64')]=_0x1641dc['id'];if(_0x80c3bf['query']['filter']){_0x591228[_0x6a37('0x52')]=_[_0x6a37('0x55')](_0x591228[_0x6a37('0x52')],{'$or':_[_0x6a37('0x45')](_0x591228[_0x6a37('0x4f')],function(_0x24bd5a){var _0x5015c0={};_0x5015c0[_0x24bd5a]={'$like':'%'+_0x80c3bf['query'][_0x6a37('0x54')]+'%'};return _0x5015c0;})});}_0x591228=_[_0x6a37('0x55')]({},_0x591228,_0x80c3bf[_0x6a37('0x56')]);return db['MailInteraction']['count']({'where':_0x591228[_0x6a37('0x52')]})[_0x6a37('0x10')](function(_0x185ae9){_0x4b338a[_0x6a37('0x20')]=_0x185ae9;if(_0x80c3bf[_0x6a37('0x4b')][_0x6a37('0x5b')]){_0x591228[_0x6a37('0x5c')]=[{'model':db['CmContact'],'as':_0x6a37('0x87'),'required':![]},{'model':db[_0x6a37('0x88')],'as':_0x6a37('0x89'),'attributes':[_0x6a37('0x29'),_0x6a37('0x8a'),_0x6a37('0x8b')],'required':![]},{'model':db[_0x6a37('0x8c')],'as':_0x6a37('0x8d'),'attributes':['id',_0x6a37('0x29'),'color'],'where':_0x80c3bf['query'][_0x6a37('0x8e')]?{'id':_0x80c3bf[_0x6a37('0x4b')][_0x6a37('0x8e')]}:undefined,'required':_0x80c3bf[_0x6a37('0x4b')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x6a37('0x57')](_0x591228);})[_0x6a37('0x10')](function(_0x825c18){_0x4b338a[_0x6a37('0x58')]=_0x825c18;return _0x4b338a;});}})[_0x6a37('0x10')](respondWithFilteredResult(_0x5c3af1,_0x591228))['catch'](handleError(_0x5c3af1,null));};exports['addApplications']=function addApplications(_0x1de802,_0x45952d){var _0x5b9c8e=_0x1de802['params']['id'];var _0x17c18a=_0x1de802[_0x6a37('0x5e')];var _0x249bca=0xc8;var _0x144af3=null;return db['sequelize'][_0x6a37('0x8f')]({'isolationLevel':db[_0x6a37('0x90')][_0x6a37('0x91')][_0x6a37('0x92')]['READ_COMMITTED']},function(_0x1a25ce){return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x5b9c8e},'transaction':_0x1a25ce})[_0x6a37('0x10')](function(_0x1b194a){if(_0x1b194a){return db[_0x6a37('0x93')]['destroy']({'where':{'MailAccountId':_0x5b9c8e},'transaction':_0x1a25ce})[_0x6a37('0x10')](function(){var _0x1ae1d4=_[_0x6a37('0x45')](_0x17c18a,function(_0x4d03e8){_0x4d03e8['MailAccountId']=_0x5b9c8e;return _0x4d03e8;});return db[_0x6a37('0x93')][_0x6a37('0x94')](_0x1ae1d4,{'transaction':_0x1a25ce});});}else{_0x249bca=0x194;_0x144af3=[];}});})[_0x6a37('0x10')](function(){if(_0x249bca!==0x194){return db[_0x6a37('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x5b9c8e},'order':_0x6a37('0x95')})['then'](function(_0x290c15){_0x144af3=_0x290c15;});}})[_0x6a37('0x19')](function(_0x126d27){_0x249bca=0x1f4;logger[_0x6a37('0x16')](_0x126d27[_0x6a37('0x28')]);if(_0x126d27[_0x6a37('0x29')]){delete _0x126d27[_0x6a37('0x29')];}_0x144af3=_0x126d27;})['finally'](function(){if(_0x144af3===null){_0x45952d[_0x6a37('0x27')](_0x249bca);}else{if(_0x249bca===0x1f4){_0x45952d['status'](_0x249bca)[_0x6a37('0x2a')](_0x144af3);}else{_0x45952d['status'](_0x249bca)[_0x6a37('0x1c')](_0x144af3);}}});};exports['getApplications']=function(_0x310ee9,_0x54011e){var _0x3b5d10={};var _0x2d84f1={};var _0x34f87f;var _0x4cf0b8;return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0x310ee9[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x54011e,null))['then'](function(_0x4e5055){if(_0x4e5055){_0x34f87f=_0x4e5055;_0x2d84f1[_0x6a37('0x4a')]=_[_0x6a37('0x4c')](db[_0x6a37('0x93')][_0x6a37('0x69')]);_0x2d84f1[_0x6a37('0x4b')]=_[_0x6a37('0x4c')](_0x310ee9[_0x6a37('0x4b')]);_0x2d84f1['filters']=_[_0x6a37('0x4e')](_0x2d84f1[_0x6a37('0x4a')],_0x2d84f1[_0x6a37('0x4b')]);_0x3b5d10['attributes']=_[_0x6a37('0x4e')](_0x2d84f1[_0x6a37('0x4a')],qs['fields'](_0x310ee9[_0x6a37('0x4b')][_0x6a37('0x5a')]));_0x3b5d10[_0x6a37('0x4f')]=_0x3b5d10[_0x6a37('0x4f')]['length']?_0x3b5d10[_0x6a37('0x4f')]:_0x2d84f1[_0x6a37('0x4a')];_0x3b5d10[_0x6a37('0x6b')]=qs[_0x6a37('0x51')](_0x310ee9[_0x6a37('0x4b')]['sort']);_0x3b5d10[_0x6a37('0x52')]=qs[_0x6a37('0x4d')](_[_0x6a37('0x53')](_0x310ee9[_0x6a37('0x4b')],_0x2d84f1[_0x6a37('0x4d')]));if(_0x310ee9[_0x6a37('0x4b')][_0x6a37('0x54')]){_0x3b5d10[_0x6a37('0x52')]=_['merge'](_0x3b5d10['where'],{'$or':_[_0x6a37('0x45')](_0x3b5d10[_0x6a37('0x4f')],function(_0xd3e928){var _0x525185={};_0x525185[_0xd3e928]={'$like':'%'+_0x310ee9[_0x6a37('0x4b')][_0x6a37('0x54')]+'%'};return _0x525185;})});}_0x3b5d10=_[_0x6a37('0x55')]({},_0x3b5d10,_0x310ee9['options']);return _0x34f87f[_0x6a37('0x96')](_0x3b5d10);}})[_0x6a37('0x10')](function(_0x170e1c){if(_0x170e1c){_0x4cf0b8=_0x170e1c['length'];if(!_0x310ee9[_0x6a37('0x4b')][_0x6a37('0x6a')](_0x6a37('0x70'))){_0x3b5d10[_0x6a37('0x1f')]=qs[_0x6a37('0x1f')](_0x310ee9['query'][_0x6a37('0x1f')]);_0x3b5d10[_0x6a37('0x1d')]=qs['offset'](_0x310ee9[_0x6a37('0x4b')][_0x6a37('0x1d')]);}return _0x34f87f[_0x6a37('0x96')](_0x3b5d10);}})['then'](function(_0x441e55){if(_0x441e55){return _0x441e55?{'count':_0x4cf0b8,'rows':_0x441e55}:null;}})[_0x6a37('0x10')](respondWithResult(_0x54011e,null))[_0x6a37('0x19')](handleError(_0x54011e,null));};exports['getMessages']=function(_0xef6e58,_0x29ddd7){var _0x1de79e={'raw':!![],'where':{}};var _0x4caa31={};var _0x4d4473={'count':0x0,'rows':[]};return db[_0x6a37('0x46')][_0x6a37('0x68')]({'where':{'id':_0xef6e58[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x29ddd7,null))[_0x6a37('0x10')](function(_0x2bed08){if(_0x2bed08){_0x4caa31['model']=_[_0x6a37('0x4c')](db[_0x6a37('0x97')][_0x6a37('0x69')]);_0x4caa31[_0x6a37('0x4b')]=_[_0x6a37('0x4c')](_0xef6e58[_0x6a37('0x4b')]);_0x4caa31[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0x4caa31[_0x6a37('0x4a')],_0x4caa31['query']);_0x1de79e[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x4caa31[_0x6a37('0x4a')],qs['fields'](_0xef6e58[_0x6a37('0x4b')][_0x6a37('0x5a')]));_0x1de79e[_0x6a37('0x4f')]=_0x1de79e['attributes']['length']?_0x1de79e[_0x6a37('0x4f')]:_0x4caa31[_0x6a37('0x4a')];if(!_0xef6e58[_0x6a37('0x4b')][_0x6a37('0x6a')](_0x6a37('0x70'))){_0x1de79e[_0x6a37('0x1f')]=qs[_0x6a37('0x1f')](_0xef6e58['query']['limit']);_0x1de79e[_0x6a37('0x1d')]=qs['offset'](_0xef6e58['query']['offset']);}_0x1de79e[_0x6a37('0x6b')]=qs[_0x6a37('0x51')](_0xef6e58[_0x6a37('0x4b')][_0x6a37('0x51')]);_0x1de79e[_0x6a37('0x52')]=qs[_0x6a37('0x4d')](_[_0x6a37('0x53')](_0xef6e58[_0x6a37('0x4b')],_0x4caa31[_0x6a37('0x4d')]));_0x1de79e[_0x6a37('0x52')][_0x6a37('0x64')]=_0x2bed08['id'];if(_0xef6e58['query'][_0x6a37('0x54')]){_0x1de79e[_0x6a37('0x52')]=_[_0x6a37('0x55')](_0x1de79e[_0x6a37('0x52')],{'$or':_[_0x6a37('0x45')](_0x1de79e[_0x6a37('0x4f')],function(_0x36c3ba){var _0x167958={};_0x167958[_0x36c3ba]={'$like':'%'+_0xef6e58['query'][_0x6a37('0x54')]+'%'};return _0x167958;})});}if(_0xef6e58[_0x6a37('0x4b')]['$gte']){var _0x1b9b19=_0xef6e58['query'][_0x6a37('0x98')][_0x6a37('0x99')](',');var _0x57f4f0={};_0x57f4f0[_0x1b9b19[0x0]]={'$gte':moment(_0x1b9b19[0x1])['format'](_0x6a37('0x9a'))};_0x1de79e[_0x6a37('0x52')]=_['merge'](_0x1de79e['where'],_0x57f4f0);}_0x1de79e=_[_0x6a37('0x55')]({},_0x1de79e,_0xef6e58['options']);return db[_0x6a37('0x97')][_0x6a37('0x20')]({'where':_0x1de79e[_0x6a37('0x52')]})[_0x6a37('0x10')](function(_0x58d31a){_0x4d4473['count']=_0x58d31a;if(_0xef6e58[_0x6a37('0x4b')][_0x6a37('0x5b')]){_0x1de79e['include']=[{'all':!![]}];}return db[_0x6a37('0x97')]['findAll'](_0x1de79e);})[_0x6a37('0x10')](function(_0x339a66){if(_0xef6e58[_0x6a37('0x4b')][_0x6a37('0x9b')]===_0x6a37('0x9c')){for(var _0x30333c=0x0;_0x30333c<_0x339a66[_0x6a37('0x50')];_0x30333c++){_0x339a66[_0x30333c][_0x6a37('0x5e')]=juice(_0x339a66[_0x30333c][_0x6a37('0x5e')]);}}_0x4d4473[_0x6a37('0x58')]=_0x339a66;return _0x4d4473;});}})['then'](respondWithFilteredResult(_0x29ddd7,_0x1de79e))[_0x6a37('0x19')](handleError(_0x29ddd7,null));};exports[_0x6a37('0x2a')]=function(_0x214b04,_0x196ddf){var _0x5dd41a,_0x1f5d2f={},_0x34ca6c;if(_0x214b04['body']['to']){_0x34ca6c=_0x214b04['body']['to'][_0x6a37('0x99')](',')[0x0];}return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x214b04[_0x6a37('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x6a37('0x9d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x34ca6c},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':_0x6a37('0x40'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6a37('0x9e'),'raw':!![]}]}]})[_0x6a37('0x10')](handleEntityNotFound(_0x196ddf,null))[_0x6a37('0x10')](function(_0x5298d3){if(!_0x5298d3)return;_0x5dd41a=_0x5298d3;if(!_0x5298d3[_0x6a37('0x40')])throw new Error(_0x6a37('0x9f'));if(_[_0x6a37('0x74')](_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa0')])){_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa0')]=util[_0x6a37('0xa1')]('%s\x20<%s>',_0x5298d3['name'],_0x5298d3[_0x6a37('0x72')]||_0x5298d3[_0x6a37('0x40')][_0x6a37('0x34')]);}if(_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa2')]&&_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa2')][_0x6a37('0x50')]){for(var _0x4a4fbd=0x0;_0x4a4fbd<_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa2')][_0x6a37('0x50')];_0x4a4fbd+=0x1){_0x214b04['body']['attachments'][_0x4a4fbd]={'filename':_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa2')][_0x4a4fbd][_0x6a37('0x29')],'path':path[_0x6a37('0xa3')](config[_0x6a37('0xa4')],_0x6a37('0xa5'),_0x214b04[_0x6a37('0x5e')]['attachments'][_0x4a4fbd][_0x6a37('0xa6')])};}}var _0x10b45b=_0x5298d3[_0x6a37('0xa7')]();return respondWithRpcPromise(_0x6a37('0xa8'),_0x6a37('0xa9'),{'account':_0x10b45b,'message':_0x214b04['body']});})[_0x6a37('0x10')](function(_0x18d323){if(!_0x18d323)return;_0x1f5d2f=_0x18d323;if(!_0x5dd41a[_0x6a37('0x9d')])throw new Error(_0x6a37('0xaa'));if(_0x5dd41a[_0x6a37('0x9d')][_0x6a37('0xab')]['length'])return _0x5dd41a['List'][_0x6a37('0xab')][0x0];return db['CmContact']['create'](_['defaults'](_0x214b04[_0x6a37('0x5e')],{'firstName':_0x214b04[_0x6a37('0x5e')]['to'],'email':_0x214b04[_0x6a37('0x5e')]['to'],'phone':_0x214b04[_0x6a37('0x5e')]['to'],'ListId':_0x5dd41a[_0x6a37('0x73')]}));})[_0x6a37('0x10')](function(_0x494bfa){if(!_0x494bfa)return;var _0x44a102={'UserId':_0x214b04[_0x6a37('0x34')]['id'],'ContactId':_0x494bfa['id'],'MailAccountId':_0x5dd41a['id'],'inReplyTo':_0x1f5d2f['messageId'],'to':_0x214b04[_0x6a37('0x5e')][_0x6a37('0xa0')],'cc':_0x214b04[_0x6a37('0x5e')]['cc'],'subject':_0x214b04[_0x6a37('0x5e')]['subject'],'attach':_0x214b04[_0x6a37('0x5e')][_0x6a37('0xac')],'firstMsgDirection':_0x6a37('0xad'),'lastMsgAt':moment()[_0x6a37('0xa1')](_0x6a37('0x9a')),'lastMsgDirection':_0x6a37('0xad'),'Messages':[_[_0x6a37('0x55')](_0x214b04[_0x6a37('0x5e')],{'messageId':_0x1f5d2f['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5dd41a['id'],'UserId':_0x214b04['user']['id'],'ContactId':_0x494bfa['id']})]};if(_0x214b04[_0x6a37('0x5e')]['Interaction']){_0x44a102=_[_0x6a37('0x55')](_0x44a102,_0x214b04[_0x6a37('0x5e')][_0x6a37('0xae')]);}return db[_0x6a37('0x84')][_0x6a37('0x66')](_0x44a102,{'include':[{'model':db[_0x6a37('0x97')],'as':_0x6a37('0xaf')}]});})[_0x6a37('0x10')](respondWithResult(_0x196ddf,null))[_0x6a37('0x19')](handleError(_0x196ddf,null));};exports['verifySmtp']=function(_0x39fc07,_0x2c3755){return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x39fc07['params']['id']},'include':[{'model':db[_0x6a37('0x42')],'as':_0x6a37('0x40'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6a37('0x9e'),'raw':!![]}]}]})[_0x6a37('0x10')](handleEntityNotFound(_0x2c3755,null))[_0x6a37('0x10')](function(_0x56d2d5){if(!_0x56d2d5[_0x6a37('0x40')])return;var _0x1bd1da=_0x56d2d5[_0x6a37('0xa7')]();return respondWithRpcPromise(_0x6a37('0xb0'),_0x6a37('0xb1'),{'account':_0x1bd1da});})['then'](respondWithResult(_0x2c3755,null))[_0x6a37('0x19')](handleError(_0x2c3755,null));};exports[_0x6a37('0x26')]=function(_0x16dc18,_0x3d2160){return db['MailAccount'][_0x6a37('0x5d')]({'where':{'id':_0x16dc18['params']['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x3d2160,null))[_0x6a37('0x10')](function(_0x430393){if(_0x430393&&_0x430393[_0x6a37('0x3d')]){throw new db[(_0x6a37('0xb2'))][(_0x6a37('0xb3'))](_0x6a37('0xb4'));}return _0x430393;})[_0x6a37('0x10')](removeEntity(_0x3d2160,null))['catch'](handleError(_0x3d2160,null));};exports[_0x6a37('0xb5')]=function(_0x22dba4,_0x2c928e){return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x22dba4['params']['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x2c928e,null))[_0x6a37('0x10')](function(_0x53f7ad){if(_0x53f7ad){return _0x53f7ad[_0x6a37('0xb5')](_0x22dba4['body']['ids'],_[_0x6a37('0x85')](_0x22dba4['body'],[_0x6a37('0x6d'),'id'])||{})[_0x6a37('0xb6')](function(_0x79a81b){for(var _0x5d648c=0x0;_0x5d648c<_0x22dba4[_0x6a37('0x5e')][_0x6a37('0x6d')][_0x6a37('0x50')];_0x5d648c+=0x1){socket[_0x6a37('0xb7')](_0x6a37('0xb8'),{'UserId':Number(_0x22dba4[_0x6a37('0x5e')]['ids'][_0x5d648c]),'MailAccountId':Number(_0x22dba4['params']['id'])});}return _0x79a81b;});}})[_0x6a37('0x10')](respondWithResult(_0x2c928e,null))[_0x6a37('0x19')](handleError(_0x2c928e,null));};exports[_0x6a37('0xb9')]=function(_0x1eff32,_0x1f92a8){return db[_0x6a37('0x46')][_0x6a37('0x5d')]({'where':{'id':_0x1eff32[_0x6a37('0x61')]['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x1f92a8,null))[_0x6a37('0x10')](function(_0x44c5d8){if(_0x44c5d8){return _0x44c5d8[_0x6a37('0xb9')](_0x1eff32[_0x6a37('0x4b')]['ids'])['then'](function(){if(_[_0x6a37('0xba')](_0x1eff32['query'][_0x6a37('0x6d')])){for(var _0xe57347=0x0;_0xe57347<_0x1eff32['query'][_0x6a37('0x6d')]['length'];_0xe57347+=0x1){socket['emit'](_0x6a37('0xbb'),{'UserId':Number(_0x1eff32[_0x6a37('0x4b')]['ids'][_0xe57347]),'MailAccountId':Number(_0x1eff32[_0x6a37('0x61')]['id'])});}}else{socket[_0x6a37('0xb7')](_0x6a37('0xbb'),{'UserId':Number(_0x1eff32[_0x6a37('0x4b')]['ids']),'MailAccountId':Number(_0x1eff32[_0x6a37('0x61')]['id'])});}});}})[_0x6a37('0x10')](respondWithStatusCode(_0x1f92a8,null))[_0x6a37('0x19')](handleError(_0x1f92a8,null));};exports[_0x6a37('0xbc')]=function(_0x2b8852,_0x2e644f){var _0x298a59={};var _0x11b6f6={};var _0x3c5876;var _0x3cf4f8;return db['MailAccount'][_0x6a37('0x68')]({'where':{'id':_0x2b8852['params']['id']}})[_0x6a37('0x10')](handleEntityNotFound(_0x2e644f,null))['then'](function(_0x595ab2){if(_0x595ab2){_0x3c5876=_0x595ab2;_0x11b6f6[_0x6a37('0x4a')]=_[_0x6a37('0x4c')](db[_0x6a37('0x88')][_0x6a37('0x69')]);_0x11b6f6['query']=_[_0x6a37('0x4c')](_0x2b8852[_0x6a37('0x4b')]);_0x11b6f6[_0x6a37('0x4d')]=_[_0x6a37('0x4e')](_0x11b6f6[_0x6a37('0x4a')],_0x11b6f6['query']);_0x298a59[_0x6a37('0x4f')]=_[_0x6a37('0x4e')](_0x11b6f6[_0x6a37('0x4a')],qs[_0x6a37('0x5a')](_0x2b8852['query'][_0x6a37('0x5a')]));_0x298a59[_0x6a37('0x4f')]=_0x298a59['attributes'][_0x6a37('0x50')]?_0x298a59[_0x6a37('0x4f')]:_0x11b6f6['model'];_0x298a59['order']=qs[_0x6a37('0x51')](_0x2b8852[_0x6a37('0x4b')][_0x6a37('0x51')]);_0x298a59[_0x6a37('0x52')]=qs[_0x6a37('0x4d')](_[_0x6a37('0x53')](_0x2b8852['query'],_0x11b6f6[_0x6a37('0x4d')]));if(_0x2b8852[_0x6a37('0x4b')][_0x6a37('0x54')]){_0x298a59[_0x6a37('0x52')]=_[_0x6a37('0x55')](_0x298a59[_0x6a37('0x52')],{'$or':_[_0x6a37('0x45')](_0x298a59[_0x6a37('0x4f')],function(_0x29c566){var _0x146483={};_0x146483[_0x29c566]={'$like':'%'+_0x2b8852['query'][_0x6a37('0x54')]+'%'};return _0x146483;})});}_0x298a59=_[_0x6a37('0x55')]({},_0x298a59,_0x2b8852[_0x6a37('0x56')]);return _0x3c5876[_0x6a37('0xbc')](_0x298a59);}})['then'](function(_0x24fed6){if(_0x24fed6){_0x3cf4f8=_0x24fed6[_0x6a37('0x50')];if(!_0x2b8852[_0x6a37('0x4b')]['hasOwnProperty'](_0x6a37('0x70'))){_0x298a59[_0x6a37('0x1f')]=qs[_0x6a37('0x1f')](_0x2b8852[_0x6a37('0x4b')][_0x6a37('0x1f')]);_0x298a59['offset']=qs[_0x6a37('0x1d')](_0x2b8852[_0x6a37('0x4b')]['offset']);}return _0x3c5876['getAgents'](_0x298a59);}})[_0x6a37('0x10')](function(_0x4b6c70){if(_0x4b6c70){return _0x4b6c70?{'count':_0x3cf4f8,'rows':_0x4b6c70}:null;}})[_0x6a37('0x10')](respondWithResult(_0x2e644f,null))[_0x6a37('0x19')](handleError(_0x2e644f,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 55504ed..da78c72 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 _0x50be=['hasOwnProperty','events','../../mysqldb','MailAccount','save','update','remove','emit'];(function(_0x4fb723,_0x3f3b64){var _0x41e6ff=function(_0x5e596b){while(--_0x5e596b){_0x4fb723['push'](_0x4fb723['shift']());}};_0x41e6ff(++_0x3f3b64);}(_0x50be,0x191));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe50b('0x0'));var MailAccount=require(_0xe50b('0x1'))['db'][_0xe50b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe50b('0x3'),'afterUpdate':_0xe50b('0x4'),'afterDestroy':_0xe50b('0x5')};function emitEvent(_0x1f24a4){return function(_0x37abc4,_0x4f671a,_0x36c3c1){MailAccountEvents[_0xe50b('0x6')](_0x1f24a4+':'+_0x37abc4['id'],_0x37abc4);MailAccountEvents[_0xe50b('0x6')](_0x1f24a4,_0x37abc4);_0x36c3c1(null);};}for(var e in events){if(events[_0xe50b('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x79a3=['emit','hasOwnProperty','events','MailAccount','setMaxListeners','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x79a3,0x80));var _0x379a=function(_0x363c5d,_0x4ac556){_0x363c5d=_0x363c5d-0x0;var _0x3e4017=_0x79a3[_0x363c5d];return _0x3e4017;};'use strict';var EventEmitter=require(_0x379a('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x379a('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x379a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x379a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x484729){return function(_0x4c456f,_0x187d55,_0x24dda6){MailAccountEvents[_0x379a('0x4')](_0x484729+':'+_0x4c456f['id'],_0x4c456f);MailAccountEvents[_0x379a('0x4')](_0x484729,_0x4c456f);_0x24dda6(null);};}for(var e in events){if(events[_0x379a('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5e5910e..dfedb55 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 _0x3089=['./mailAccount.attributes','exports','define','MailAccount','provider','service','host','port','Smtp','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3089,0x100));var _0x9308=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3089[_0x43d11d];return _0x38cd08;};'use strict';var attributes=require(_0x9308('0x0'));module[_0x9308('0x1')]=function(_0x5bda64){return _0x5bda64[_0x9308('0x2')](_0x9308('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x394654=this;var _0xcfcef5={'id':_0x394654['id'],'tls':{'rejectUnauthorized':![]}};if(_0x394654[_0x9308('0x4')]!=='custom'){_0xcfcef5[_0x9308('0x5')]=_0x394654[_0x9308('0x4')];}else{_0xcfcef5[_0x9308('0x6')]=_0x394654['Smtp'][_0x9308('0x6')];_0xcfcef5[_0x9308('0x7')]=_0x394654[_0x9308('0x8')][_0x9308('0x7')];_0xcfcef5[_0x9308('0x9')]=_0x394654['Smtp'][_0x9308('0x9')];}if(_0x394654[_0x9308('0x8')]['authentication']){if(_0x394654[_0x9308('0x8')][_0x9308('0xa')]){if(!_0x394654['Smtp'][_0x9308('0xb')])throw new Error(_0x9308('0xc'));_0xcfcef5[_0x9308('0xd')]={'type':'OAuth2','user':_0x394654[_0x9308('0x8')][_0x9308('0xe')],'accessToken':_0x394654[_0x9308('0x8')][_0x9308('0xb')][_0x9308('0xf')]};}else{_0xcfcef5['auth']={'user':_0x394654[_0x9308('0x8')]['user'],'pass':_0x394654[_0x9308('0x8')]['pass']};}}return _0xcfcef5;}}});}; \ No newline at end of file +var _0x5963=['data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user'];(function(_0x358f87,_0x5a4d20){var _0x4b2fdb=function(_0x384222){while(--_0x384222){_0x358f87['push'](_0x358f87['shift']());}};_0x4b2fdb(++_0x5a4d20);}(_0x5963,0xc0));var _0x3596=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5963[_0x4a9fb1];return _0x348672;};'use strict';var attributes=require(_0x3596('0x0'));module[_0x3596('0x1')]=function(_0x14847f){return _0x14847f[_0x3596('0x2')](_0x3596('0x3'),attributes,{'tableName':_0x3596('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x22b5d4=this;var _0x462ec3={'id':_0x22b5d4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22b5d4[_0x3596('0x5')]!==_0x3596('0x6')){_0x462ec3[_0x3596('0x7')]=_0x22b5d4['provider'];}else{_0x462ec3['host']=_0x22b5d4[_0x3596('0x8')][_0x3596('0x9')];_0x462ec3[_0x3596('0xa')]=_0x22b5d4[_0x3596('0x8')][_0x3596('0xa')];_0x462ec3[_0x3596('0xb')]=_0x22b5d4['Smtp'][_0x3596('0xb')];}if(_0x22b5d4[_0x3596('0x8')][_0x3596('0xc')]){if(_0x22b5d4[_0x3596('0x8')][_0x3596('0xd')]){if(!_0x22b5d4[_0x3596('0x8')][_0x3596('0xe')])throw new Error(_0x3596('0xf'));_0x462ec3['auth']={'type':_0x3596('0x10'),'user':_0x22b5d4[_0x3596('0x8')][_0x3596('0x11')],'accessToken':_0x22b5d4[_0x3596('0x8')][_0x3596('0xe')][_0x3596('0x12')]};}else{_0x462ec3[_0x3596('0x13')]={'user':_0x22b5d4['Smtp']['user'],'pass':_0x22b5d4[_0x3596('0x8')][_0x3596('0x14')]};}}return _0x462ec3;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 83ecf4e..0d124ed 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 _0x896e=['createdAt','updatedAt','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','list','orderBy','asc','autoclose','applications','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','interaction','get','attachments','originTo','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','then','ShowMailAccount','find','setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes'];(function(_0x28e30d,_0x28889a){var _0x26e028=function(_0x52fd17){while(--_0x52fd17){_0x28e30d['push'](_0x28e30d['shift']());}};_0x26e028(++_0x28889a);}(_0x896e,0x1e9));var _0xe896=function(_0x1c1d09,_0x12d4a4){_0x1c1d09=_0x1c1d09-0x0;var _0x13427f=_0x896e[_0x1c1d09];return _0x13427f;};'use strict';var _=require(_0xe896('0x0'));var moment=require(_0xe896('0x1'));var BPromise=require(_0xe896('0x2'));var rs=require(_0xe896('0x3'));var Redis=require(_0xe896('0x4'));var db=require(_0xe896('0x5'))['db'];var logger=require(_0xe896('0x6'))(_0xe896('0x7'));var config=require(_0xe896('0x8'));var jayson=require(_0xe896('0x9'));var client=jayson[_0xe896('0xa')][_0xe896('0xb')]({'port':0x232c});config['redis']=_[_0xe896('0xc')](config[_0xe896('0xd')],{'host':_0xe896('0xe'),'port':0x18eb});var socket=require(_0xe896('0xf'))(new Redis(config[_0xe896('0xd')]));require('./mailAccount.socket')[_0xe896('0x10')](socket);function respondWithRpcPromise(_0x14b7e4,_0x37a90d,_0x4afd3f){return new BPromise(function(_0x305616,_0x48251e){return client[_0xe896('0x11')](_0x14b7e4,_0x4afd3f)['then'](function(_0x409eaf){logger[_0xe896('0x12')](_0xe896('0x13'),_0x37a90d,'request\x20sent');logger[_0xe896('0x14')](_0xe896('0x15'),_0x37a90d,_0xe896('0x16'),JSON['stringify'](_0x409eaf));if(_0x409eaf[_0xe896('0x17')]){if(_0x409eaf[_0xe896('0x17')][_0xe896('0x18')]===0x1f4){logger['error'](_0xe896('0x13'),_0x37a90d,_0x409eaf[_0xe896('0x17')][_0xe896('0x19')]);return _0x48251e(_0x409eaf['error']['message']);}logger[_0xe896('0x17')](_0xe896('0x13'),_0x37a90d,_0x409eaf['error']['message']);return _0x305616(_0x409eaf[_0xe896('0x17')][_0xe896('0x19')]);}else{logger['info'](_0xe896('0x13'),_0x37a90d,'request\x20sent');_0x305616(_0x409eaf[_0xe896('0x1a')][_0xe896('0x19')]);}})[_0xe896('0x1b')](function(_0x5dc89d){logger[_0xe896('0x17')](_0xe896('0x13'),_0x37a90d,_0x5dc89d);_0x48251e(_0x5dc89d);});});}exports[_0xe896('0x1c')]=function(_0xbebbe1){var _0x2693d6=this;return new Promise(function(_0x3ac8b8,_0x388c2e){return db[_0xe896('0x1d')]['findAll']({'raw':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1['options']['raw']===undefined?!![]:![]:!![],'where':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1[_0xe896('0x1e')][_0xe896('0x1f')]||null:null,'attributes':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1['options'][_0xe896('0x20')]||null:null,'limit':_0xbebbe1['options']?_0xbebbe1['options'][_0xe896('0x21')]||null:null,'include':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1[_0xe896('0x1e')][_0xe896('0x22')]?_[_0xe896('0x23')](_0xbebbe1[_0xe896('0x1e')][_0xe896('0x22')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x24')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x22')]?_['map'](_0x4b71cc[_0xe896('0x22')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x24')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')],'include':_0xd50fe2[_0xe896('0x22')]?_[_0xe896('0x23')](_0xd50fe2['include'],function(_0x10adad){return{'model':db[_0x10adad[_0xe896('0x24')]],'as':_0x10adad['as'],'attributes':_0x10adad[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0x25')](function(_0xace03f){logger['info']('GetMailAccount',_0xbebbe1);logger['debug']('GetMailAccount',_0xbebbe1,JSON['stringify'](_0xace03f));_0x3ac8b8(_0xace03f);})[_0xe896('0x1b')](function(_0x29a18e){logger[_0xe896('0x17')](_0xe896('0x1c'),_0x29a18e[_0xe896('0x19')],_0xbebbe1);_0x388c2e(_0x2693d6[_0xe896('0x17')](0x1f4,_0x29a18e[_0xe896('0x19')]));});});};exports[_0xe896('0x26')]=function(_0x4ab96b){var _0x4ce052=this;return new Promise(function(_0x142d29,_0x255dd1){return db[_0xe896('0x1d')][_0xe896('0x27')]({'raw':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')][_0xe896('0x1f')]||null:null,'attributes':_0x4ab96b[_0xe896('0x1e')]?_0x4ab96b['options']['attributes']||null:null,'include':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')][_0xe896('0x22')]?_[_0xe896('0x23')](_0x4ab96b[_0xe896('0x1e')][_0xe896('0x22')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x24')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x22')]?_[_0xe896('0x23')](_0x486eb5[_0xe896('0x22')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x24')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')],'include':_0x2cce09['include']?_[_0xe896('0x23')](_0x2cce09[_0xe896('0x22')],function(_0x5a2dd2){return{'model':db[_0x5a2dd2[_0xe896('0x24')]],'as':_0x5a2dd2['as'],'attributes':_0x5a2dd2['attributes']};}):[]};}):[]};}):[]:[]})[_0xe896('0x25')](function(_0x4f164f){if(_0x4ab96b[_0xe896('0x1e')]['smtp']===!![])_0x4f164f[_0xe896('0x28')](_0xe896('0x29'),_0x4f164f[_0xe896('0x2a')]());logger[_0xe896('0x12')](_0xe896('0x26'),_0x4ab96b);logger['debug']('ShowMailAccount',_0x4ab96b,JSON[_0xe896('0x2b')](_0x4f164f));_0x142d29(_0x4f164f);})[_0xe896('0x1b')](function(_0x387cc6){logger[_0xe896('0x17')](_0xe896('0x26'),_0x387cc6['message'],_0x4ab96b);_0x255dd1(_0x4ce052['error'](0x1f4,_0x387cc6[_0xe896('0x19')]));});});};exports[_0xe896('0x2c')]=function(_0x5890b1){var _0x57e194=this;return new Promise(function(_0x19d2fd,_0x3b1de8){var _0x911adb={'body':_0x5890b1[_0xe896('0x2d')],'channel':_0xe896('0x2e')};var _0x41fa6f=_[_0xe896('0x2f')](_[_0xe896('0x30')](db[_0xe896('0x31')][_0xe896('0x32')]),[_0xe896('0x33'),_0xe896('0x34'),'CompanyId',_0xe896('0x35')]);var _0x143ad4=![];if(_0x5890b1['body']['id']){delete _0x5890b1['body']['id'];}if(_['isNil'](_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe896('0x37')](_0x5890b1[_0xe896('0x2d')]['body'])||_0x5890b1['body']['body']===''){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0xe896('0x38')));}if(_[_0xe896('0x37')](_0x5890b1[_0xe896('0x2d')][_0xe896('0x39')])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41fa6f));}if(!_[_0xe896('0x3a')](_0x41fa6f,_0x5890b1[_0xe896('0x2d')]['mapKey'])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0xe896('0x3b')+_0x41fa6f));}var _0x179fc2={};_0x179fc2[_0x5890b1[_0xe896('0x2d')]['mapKey']]=_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')];return db[_0xe896('0x1d')][_0xe896('0x27')]({'where':{'id':_0x5890b1[_0xe896('0x3c')]['id']},'include':[{'model':db[_0xe896('0x3d')],'as':'List','include':[{'model':db[_0xe896('0x31')],'as':'Contacts','where':_0x179fc2,'limit':0x1,'order':[[_0xe896('0x34'),_0xe896('0x3e')]]}]},{'model':db[_0xe896('0x3f')],'as':_0xe896('0x40')},{'model':db[_0xe896('0x41')],'as':_0xe896('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xe896('0x43')}]}]})[_0xe896('0x25')](function(_0x4818cd){if(_0x4818cd&&_0x4818cd[_0xe896('0x44')]){var _0x355443=_0x4818cd['get']({'plain':!![]});_0x911adb[_0xe896('0x3c')]=_['omit'](_0x355443,[_0xe896('0x40'),_0xe896('0x44')]);_0x911adb[_0xe896('0x3c')][_0xe896('0x29')]=_0x4818cd[_0xe896('0x2a')]();_0x911adb['applications']=_0x355443[_0xe896('0x40')];_0x911adb[_0xe896('0x45')]=_0x355443[_0xe896('0x44')];_0x911adb['applications']=_[_0xe896('0x46')](_0x911adb['applications'],['priority'],[_0xe896('0x47')]);if(_0x911adb[_0xe896('0x3c')]&&_0x911adb['account'][_0xe896('0x48')]){_0x911adb[_0xe896('0x49')]['push']({'id':0x0,'priority':_0x911adb['applications'][_0xe896('0x4a')]+0x1,'app':_0xe896('0x4b'),'appdata':'autoclose','interval':_0xe896('0x4c')});}if(_0x911adb[_0xe896('0x3c')][_0xe896('0x40')]){delete _0x911adb[_0xe896('0x3c')][_0xe896('0x40')];}if(_0x911adb[_0xe896('0x3c')][_0xe896('0x44')]){delete _0x911adb[_0xe896('0x3c')][_0xe896('0x44')];}if(_0x355443[_0xe896('0x44')][_0xe896('0x4d')]['length']){return _0x355443[_0xe896('0x44')][_0xe896('0x4d')][0x0];}var _0x131c1c=_[_0xe896('0xc')](_0x5890b1[_0xe896('0x2d')],{'firstName':_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')],'ListId':_0x355443[_0xe896('0x35')]});_0x131c1c[_0x5890b1[_0xe896('0x2d')][_0xe896('0x39')]]=_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')];return db['CmContact'][_0xe896('0x4e')](_0x131c1c);}else{throw new Error(_0xe896('0x4f'));}})[_0xe896('0x25')](function(_0x5180b6){_0x911adb['contact']=_0x5180b6;if(_0x5180b6){if(!_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x50')]){_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['messageId']=rs[_0xe896('0x51')]()+'\x20'+_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x36')];}var _0x5d6c1c={'ContactId':_0x5180b6['id'],'MailAccountId':_0x5890b1[_0xe896('0x3c')]['id'],'inReplyTo':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x50')],'to':_0x5890b1[_0xe896('0x2d')]['message']['from'],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x52')],'attach':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x53')],'lastMsgAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x5890b1[_0xe896('0x3c')]['id']},'include':[{'model':db[_0xe896('0x56')],'as':'Messages','attributes':[_0xe896('0x50')],'where':{'messageId':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x57')]}}]})[_0xe896('0x25')](function(_0x3cc348){if(_0x3cc348){return[_0x3cc348,![]];}return db[_0xe896('0x58')][_0xe896('0x4e')](_0x5d6c1c)[_0xe896('0x25')](function(_0x117e92){return[_0x117e92,!![]];});});}else{throw new Error(_0xe896('0x59'));}})[_0xe896('0x5a')](function(_0xcb329a,_0x3248e6){if(_0xcb329a){_0x143ad4=_0x3248e6;if(!_0x3248e6){return _0xcb329a[_0xe896('0x5b')]({'inReplyTo':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x50')],'to':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x36')],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1[_0xe896('0x2d')]['message']['subject'],'attach':_0xcb329a[_0xe896('0x53')]?_0xcb329a[_0xe896('0x53')]:_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x53')],'substatus':null,'substatusAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgDirection':'in'});}else{return _0xcb329a;}}})[_0xe896('0x25')](function(_0x40e91d){_0x911adb[_0xe896('0x5c')]=_0x40e91d[_0xe896('0x5d')]({'plain':!![]});_0x911adb[_0xe896('0x5c')]['created']=_0x143ad4;return db[_0xe896('0x56')][_0xe896('0x4e')]({'body':_0x5890b1['body'][_0xe896('0x2d')],'MailAccountId':_0x5890b1['account']['id'],'MailInteractionId':_0x40e91d['id'],'direction':'in','ContactId':_0x911adb['contact']['id'],'messageId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['messageId'],'from':_0x5890b1['body'][_0xe896('0x19')]['from'],'to':_0x5890b1['body'][_0xe896('0x19')]['to'],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x52')],'attach':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x53')],'Attachments':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x5e')],'originTo':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x5f')],'originCc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['originCc'],'bcc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['bcc'],'ChatWebsiteId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x60')]||null,'originChannel':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x61')]||_0xe896('0x62'),'ChatOfflineMessageId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x63')]||null},{'include':[{'model':db[_0xe896('0x64')],'as':'Attachments'}]});})['then'](function(_0x48b523){_0x911adb[_0xe896('0x19')]=_0x48b523;if(_0x911adb[_0xe896('0x5c')][_0xe896('0x65')]){return db[_0xe896('0x66')][_0xe896('0x27')]({'attributes':['id',_0xe896('0x67')],'where':{'id':_0x911adb[_0xe896('0x5c')]['UserId']}})['then'](function(_0x4674ba){if(_0x4674ba){_0x911adb['applications'][_0xe896('0x68')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4674ba[_0xe896('0x67')]+','+(_0x911adb['account'][_0xe896('0x69')]||0xa),'interval':_0xe896('0x4c')});}return respondWithRpcPromise(_0xe896('0x6a'),_0xe896('0x6b'),_0x911adb);});}return respondWithRpcPromise(_0xe896('0x6a'),'startRouting',_0x911adb);})[_0xe896('0x25')](function(_0x35306d){_0x19d2fd(_0x35306d);})[_0xe896('0x1b')](function(_0x1bcfda){_0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0x1bcfda[_0xe896('0x19')]));});});}; \ No newline at end of file +var _0x1967=['getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','updatedAt','Applications','CloudProvider','List','get','applications','list','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','findAll','options','where','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions'];(function(_0x4fa4fd,_0x4c656b){var _0x3c50d0=function(_0x223600){while(--_0x223600){_0x4fa4fd['push'](_0x4fa4fd['shift']());}};_0x3c50d0(++_0x4c656b);}(_0x1967,0x173));var _0x7196=function(_0x2e8545,_0x4e1458){_0x2e8545=_0x2e8545-0x0;var _0x32ca12=_0x1967[_0x2e8545];return _0x32ca12;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var BPromise=require(_0x7196('0x1'));var rs=require(_0x7196('0x2'));var Redis=require(_0x7196('0x3'));var db=require(_0x7196('0x4'))['db'];var logger=require(_0x7196('0x5'))(_0x7196('0x6'));var config=require(_0x7196('0x7'));var jayson=require(_0x7196('0x8'));var client=jayson[_0x7196('0x9')]['http']({'port':0x232c});config[_0x7196('0xa')]=_[_0x7196('0xb')](config[_0x7196('0xa')],{'host':_0x7196('0xc'),'port':0x18eb});var socket=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xa')]));require('./mailAccount.socket')[_0x7196('0xe')](socket);function respondWithRpcPromise(_0xc6366f,_0x3f846e,_0x259b18){return new BPromise(function(_0x1e862d,_0x503070){return client['request'](_0xc6366f,_0x259b18)[_0x7196('0xf')](function(_0x10459b){logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));logger[_0x7196('0x13')](_0x7196('0x14'),_0x3f846e,_0x7196('0x12'),JSON[_0x7196('0x15')](_0x10459b));if(_0x10459b[_0x7196('0x16')]){if(_0x10459b[_0x7196('0x16')]['code']===0x1f4){logger[_0x7196('0x16')](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x503070(_0x10459b['error'][_0x7196('0x17')]);}logger['error'](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x1e862d(_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);}else{logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));_0x1e862d(_0x10459b[_0x7196('0x18')][_0x7196('0x17')]);}})[_0x7196('0x19')](function(_0x5b716a){logger['error'](_0x7196('0x11'),_0x3f846e,_0x5b716a);_0x503070(_0x5b716a);});});}exports[_0x7196('0x1a')]=function(_0x40418d){var _0x517a3e=this;return new Promise(function(_0x39b944,_0x539d8b){return db['MailAccount'][_0x7196('0x1b')]({'raw':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'limit':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')][_0x7196('0x1f')]||null:null,'include':_0x40418d['options']?_0x40418d[_0x7196('0x1c')]['include']?_[_0x7196('0x20')](_0x40418d[_0x7196('0x1c')][_0x7196('0x21')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x22')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x1e')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x21')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes'],'include':_0x2d284f['include']?_[_0x7196('0x20')](_0x2d284f[_0x7196('0x21')],function(_0x675e64){return{'model':db[_0x675e64['model']],'as':_0x675e64['as'],'attributes':_0x675e64[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd339){logger['info'](_0x7196('0x1a'),_0x40418d);logger[_0x7196('0x13')](_0x7196('0x1a'),_0x40418d,JSON['stringify'](_0x4fd339));_0x39b944(_0x4fd339);})[_0x7196('0x19')](function(_0x45d567){logger[_0x7196('0x16')](_0x7196('0x1a'),_0x45d567['message'],_0x40418d);_0x539d8b(_0x517a3e[_0x7196('0x16')](0x1f4,_0x45d567[_0x7196('0x17')]));});});};exports[_0x7196('0x23')]=function(_0x651d7e){var _0x4780e1=this;return new Promise(function(_0x2786f3,_0x15c5f0){return db[_0x7196('0x24')][_0x7196('0x25')]({'raw':_0x651d7e[_0x7196('0x1c')]?_0x651d7e[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x651d7e[_0x7196('0x1c')]?_0x651d7e['options'][_0x7196('0x1d')]||null:null,'attributes':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'include':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')]?_[_0x7196('0x20')](_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x22')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x1e')],'include':_0x4a8580[_0x7196('0x21')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x21')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x1e')],'include':_0x123cad[_0x7196('0x21')]?_[_0x7196('0x20')](_0x123cad['include'],function(_0x33831a){return{'model':db[_0x33831a[_0x7196('0x22')]],'as':_0x33831a['as'],'attributes':_0x33831a[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xf')](function(_0x11d4ec){if(_0x651d7e[_0x7196('0x1c')][_0x7196('0x26')]===!![])_0x11d4ec[_0x7196('0x27')](_0x7196('0x28'),_0x11d4ec[_0x7196('0x29')]());logger['info'](_0x7196('0x23'),_0x651d7e);logger[_0x7196('0x13')]('ShowMailAccount',_0x651d7e,JSON[_0x7196('0x15')](_0x11d4ec));_0x2786f3(_0x11d4ec);})['catch'](function(_0x5bd701){logger[_0x7196('0x16')](_0x7196('0x23'),_0x5bd701['message'],_0x651d7e);_0x15c5f0(_0x4780e1['error'](0x1f4,_0x5bd701[_0x7196('0x17')]));});});};exports[_0x7196('0x2a')]=function(_0xed32cd){var _0x4c2341=this;return new Promise(function(_0x36a990,_0x2d13a5){var _0x29ba1c={'body':_0xed32cd[_0x7196('0x2b')],'channel':_0x7196('0x2c')};var _0x428d76=_[_0x7196('0x2d')](_[_0x7196('0x2e')](db['CmContact'][_0x7196('0x2f')]),[_0x7196('0x30'),'updatedAt',_0x7196('0x31'),_0x7196('0x32')]);var _0x48178f=![];if(_0xed32cd[_0x7196('0x2b')]['id']){delete _0xed32cd[_0x7196('0x2b')]['id'];}if(_[_0x7196('0x33')](_0xed32cd['body'][_0x7196('0x34')])){return _0x2d13a5(_0x4c2341[_0x7196('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7196('0x33')](_0xed32cd[_0x7196('0x2b')]['body'])||_0xed32cd[_0x7196('0x2b')]['body']===''){return _0x2d13a5(_0x4c2341['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xed32cd['body'][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x36')+_0x428d76));}if(!_[_0x7196('0x37')](_0x428d76,_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x38')+_0x428d76));}var _0x56ffdd={};_0x56ffdd[_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')]['from'];return db[_0x7196('0x24')][_0x7196('0x25')]({'where':{'id':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7196('0x3a')],'as':'Contacts','where':_0x56ffdd,'limit':0x1,'order':[[_0x7196('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7196('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x7196('0x3d')}]}]})['then'](function(_0x48e3b5){if(_0x48e3b5&&_0x48e3b5[_0x7196('0x3e')]){var _0x182c8b=_0x48e3b5[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x39')]=_['omit'](_0x182c8b,[_0x7196('0x3c'),'List']);_0x29ba1c[_0x7196('0x39')][_0x7196('0x28')]=_0x48e3b5['getSmtpOptions']();_0x29ba1c[_0x7196('0x40')]=_0x182c8b[_0x7196('0x3c')];_0x29ba1c[_0x7196('0x41')]=_0x182c8b['List'];_0x29ba1c[_0x7196('0x40')]=_['orderBy'](_0x29ba1c[_0x7196('0x40')],[_0x7196('0x42')],[_0x7196('0x43')]);if(_0x29ba1c[_0x7196('0x39')]&&_0x29ba1c[_0x7196('0x39')][_0x7196('0x44')]){_0x29ba1c[_0x7196('0x40')][_0x7196('0x45')]({'id':0x0,'priority':_0x29ba1c['applications']['length']+0x1,'app':_0x7196('0x46'),'appdata':_0x7196('0x44'),'interval':_0x7196('0x47')});}if(_0x29ba1c[_0x7196('0x39')]['Applications']){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3c')];}if(_0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')]){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')];}if(_0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][_0x7196('0x49')]){return _0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][0x0];}var _0x4940a2=_[_0x7196('0xb')](_0xed32cd[_0x7196('0x2b')],{'firstName':_0xed32cd[_0x7196('0x2b')]['from'],'ListId':_0x182c8b[_0x7196('0x32')]});_0x4940a2[_0xed32cd['body'][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')][_0x7196('0x34')];return db[_0x7196('0x3a')][_0x7196('0x4a')](_0x4940a2);}else{throw new Error('List\x20not\x20found');}})[_0x7196('0xf')](function(_0x5b77fc){_0x29ba1c['contact']=_0x5b77fc;if(_0x5b77fc){if(!_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4b')]){_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')]=rs[_0x7196('0x4c')]()+'\x20'+_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x34')];}var _0x14dc43={'ContactId':_0x5b77fc['id'],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id'],'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['messageId'],'to':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x34')],'cc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['cc'],'subject':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7196('0x50')][_0x7196('0x25')]({'where':{'closed':![],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db[_0x7196('0x51')],'as':'Messages','attributes':[_0x7196('0x4b')],'where':{'messageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x52')]}}]})[_0x7196('0xf')](function(_0x3c3d64){if(_0x3c3d64){return[_0x3c3d64,![]];}return db[_0x7196('0x50')]['create'](_0x14dc43)[_0x7196('0xf')](function(_0x2c5cba){return[_0x2c5cba,!![]];});});}else{throw new Error(_0x7196('0x53'));}})[_0x7196('0x54')](function(_0x52827f,_0x418a7a){if(_0x52827f){_0x48178f=_0x418a7a;if(!_0x418a7a){return _0x52827f[_0x7196('0x55')]({'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')],'to':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['from'],'cc':_0xed32cd['body']['message']['cc'],'subject':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x4d')],'attach':_0x52827f[_0x7196('0x4e')]?_0x52827f[_0x7196('0x4e')]:_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'substatus':null,'substatusAt':moment()[_0x7196('0x4f')](_0x7196('0x56')),'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52827f;}}})['then'](function(_0x4542c1){_0x29ba1c[_0x7196('0x57')]=_0x4542c1[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x57')][_0x7196('0x58')]=_0x48178f;return db[_0x7196('0x51')][_0x7196('0x4a')]({'body':_0xed32cd[_0x7196('0x2b')]['body'],'MailAccountId':_0xed32cd['account']['id'],'MailInteractionId':_0x4542c1['id'],'direction':'in','ContactId':_0x29ba1c[_0x7196('0x59')]['id'],'messageId':_0xed32cd['body'][_0x7196('0x17')]['messageId'],'from':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x34')],'to':_0xed32cd[_0x7196('0x2b')]['message']['to'],'cc':_0xed32cd['body'][_0x7196('0x17')]['cc'],'subject':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'Attachments':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x5a')],'originTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5b')],'originCc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5c')],'bcc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5d')],'ChatWebsiteId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['ChatWebsiteId']||null,'originChannel':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x7196('0x5f')}]});})['then'](function(_0x218396){_0x29ba1c[_0x7196('0x17')]=_0x218396;if(_0x29ba1c['interaction'][_0x7196('0x60')]){return db['User']['find']({'attributes':['id',_0x7196('0x61')],'where':{'id':_0x29ba1c[_0x7196('0x57')][_0x7196('0x60')]}})['then'](function(_0x423b83){if(_0x423b83){_0x29ba1c['applications'][_0x7196('0x62')]({'id':0x0,'priority':0x0,'app':_0x7196('0x63'),'appdata':_0x423b83[_0x7196('0x61')]+','+(_0x29ba1c[_0x7196('0x39')][_0x7196('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);})[_0x7196('0xf')](function(_0x29bafd){_0x36a990(_0x29bafd);})[_0x7196('0x19')](function(_0x34633a){_0x2d13a5(_0x4c2341['error'](0x1f4,_0x34633a[_0x7196('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index bdf8c6d..7f6a863 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 _0x5b0f=['length','mailAccount:','save','update','emit'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5b0f,0xde));var _0xf5b0=function(_0x2c01b9,_0x5b5f46){_0x2c01b9=_0x2c01b9-0x0;var _0xbc501d=_0x5b0f[_0x2c01b9];return _0xbc501d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xf5b0('0x0'),'remove',_0xf5b0('0x1')];function createListener(_0x1e6fa9,_0x303495){return function(_0x288bcb){_0x303495[_0xf5b0('0x2')](_0x1e6fa9,_0x288bcb);};}function removeListener(_0xd2f3ea,_0x30aa1d){return function(){MailAccountEvents['removeListener'](_0xd2f3ea,_0x30aa1d);};}exports['register']=function(_0x251e0c){for(var _0x174987=0x0,_0x29f558=events[_0xf5b0('0x3')];_0x174987<_0x29f558;_0x174987++){var _0x5bb1f6=events[_0x174987];var _0x407991=createListener(_0xf5b0('0x4')+_0x5bb1f6,_0x251e0c);MailAccountEvents['on'](_0x5bb1f6,_0x407991);}}; \ No newline at end of file +var _0x5d6f=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x22ba1a,_0x477ca4){var _0x4af049=function(_0x50509b){while(--_0x50509b){_0x22ba1a['push'](_0x22ba1a['shift']());}};_0x4af049(++_0x477ca4);}(_0x5d6f,0x1d8));var _0xf5d6=function(_0x5a2d98,_0x1ddeeb){_0x5a2d98=_0x5a2d98-0x0;var _0x4a159f=_0x5d6f[_0x5a2d98];return _0x4a159f;};'use strict';var MailAccountEvents=require(_0xf5d6('0x0'));var events=[_0xf5d6('0x1'),_0xf5d6('0x2'),_0xf5d6('0x3')];function createListener(_0x3f3ce7,_0x2b5943){return function(_0x517458){_0x2b5943[_0xf5d6('0x4')](_0x3f3ce7,_0x517458);};}function removeListener(_0xa760b4,_0x12d2cc){return function(){MailAccountEvents[_0xf5d6('0x5')](_0xa760b4,_0x12d2cc);};}exports[_0xf5d6('0x6')]=function(_0x224c7c){for(var _0x3438d0=0x0,_0x2759e4=events[_0xf5d6('0x7')];_0x3438d0<_0x2759e4;_0x3438d0++){var _0x4b21bc=events[_0x3438d0];var _0x3ab16a=createListener(_0xf5d6('0x8')+_0x4b21bc,_0x224c7c);MailAccountEvents['on'](_0x4b21bc,_0x3ab16a);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1266a11..9ee4879 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 _0x1332=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer','connect-timeout','express'];(function(_0x20065d,_0x442e58){var _0x2e0f3f=function(_0x5da2db){while(--_0x5da2db){_0x20065d['push'](_0x20065d['shift']());}};_0x2e0f3f(++_0x442e58);}(_0x1332,0x8d));var _0x2133=function(_0x4560de,_0xf7324a){_0x4560de=_0x4560de-0x0;var _0x1939c0=_0x1332[_0x4560de];return _0x1939c0;};'use strict';var multer=require(_0x2133('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2133('0x1'));var express=require(_0x2133('0x2'));var router=express[_0x2133('0x3')]();var fs_extra=require(_0x2133('0x4'));var auth=require(_0x2133('0x5'));var interaction=require(_0x2133('0x6'));var config=require(_0x2133('0x7'));var controller=require(_0x2133('0x8'));router[_0x2133('0x9')](_0x2133('0xa'),auth[_0x2133('0xb')](),controller[_0x2133('0xc')]);router[_0x2133('0xd')](_0x2133('0xa'),auth[_0x2133('0xb')](),controller['update']);router[_0x2133('0xe')](_0x2133('0xa'),auth[_0x2133('0xb')](),controller['destroy']);module[_0x2133('0xf')]=router; \ No newline at end of file +var _0x6409=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','update','delete','exports','multer','util','path','express'];(function(_0x19eff5,_0x4499b0){var _0x189cd3=function(_0x5bf9c9){while(--_0x5bf9c9){_0x19eff5['push'](_0x19eff5['shift']());}};_0x189cd3(++_0x4499b0);}(_0x6409,0x19c));var _0x9640=function(_0x33300d,_0x5b632a){_0x33300d=_0x33300d-0x0;var _0x4db2ed=_0x6409[_0x33300d];return _0x4db2ed;};'use strict';var multer=require(_0x9640('0x0'));var util=require(_0x9640('0x1'));var path=require(_0x9640('0x2'));var timeout=require('connect-timeout');var express=require(_0x9640('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9640('0x4'));var interaction=require(_0x9640('0x5'));var config=require(_0x9640('0x6'));var controller=require(_0x9640('0x7'));router['get'](_0x9640('0x8'),auth[_0x9640('0x9')](),controller['show']);router['put'](_0x9640('0x8'),auth[_0x9640('0x9')](),controller[_0x9640('0xa')]);router[_0x9640('0xb')](_0x9640('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x9640('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 03c800c..e1ca84b 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 _0xd17e=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd17e,0x81));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xed17('0x0'));module[_0xed17('0x1')]={'priority':{'type':Sequelize[_0xed17('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xed17('0x3')],'allowNull':![],'defaultValue':_0xed17('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xed17('0x3')]},'interval':{'type':Sequelize[_0xed17('0x3')],'defaultValue':_0xed17('0x5')}}; \ No newline at end of file +var _0x2641=['STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x34bbc3,_0x23fa64){var _0x263a12=function(_0x274969){while(--_0x274969){_0x34bbc3['push'](_0x34bbc3['shift']());}};_0x263a12(++_0x23fa64);}(_0x2641,0xd0));var _0x1264=function(_0x32b4b3,_0x485040){_0x32b4b3=_0x32b4b3-0x0;var _0x291048=_0x2641[_0x32b4b3];return _0x291048;};'use strict';var Sequelize=require(_0x1264('0x0'));module[_0x1264('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1264('0x2')],'allowNull':![],'defaultValue':_0x1264('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1264('0x2')]},'interval':{'type':Sequelize[_0x1264('0x2')],'defaultValue':_0x1264('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7a3ada7..9de266a 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0xaa88[_0x284bc3];return _0x41ac81;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x291324,_0x252b89){var _0x404cd9=function(_0x4f8e93){while(--_0x4f8e93){_0x291324['push'](_0x291324['shift']());}};_0x404cd9(++_0x252b89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 9d716fb..57436c2 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 _0xb0f3=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','rimraf','../../config/environment'];(function(_0x4e9ff9,_0x34d27b){var _0x43405c=function(_0x22cdd6){while(--_0x22cdd6){_0x4e9ff9['push'](_0x4e9ff9['shift']());}};_0x43405c(++_0x34d27b);}(_0xb0f3,0x1c7));var _0x3b0f=function(_0x25831a,_0x3027d1){_0x25831a=_0x25831a-0x0;var _0x141686=_0xb0f3[_0x25831a];return _0x141686;};'use strict';var _=require(_0x3b0f('0x0'));var util=require(_0x3b0f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3b0f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3b0f('0x3'));var config=require(_0x3b0f('0x4'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x2bd741,_0x554b5b){return _0x2bd741[_0x3b0f('0x5')](_0x3b0f('0x6'),attributes,{'tableName':_0x3b0f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b0f('0x8'),'collate':_0x3b0f('0x9')});}; \ No newline at end of file +var _0x4201=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','rimraf','./mailApplication.attributes','exports','MailApplication'];(function(_0xe6967a,_0x4cd660){var _0x1547c0=function(_0x789c9c){while(--_0x789c9c){_0xe6967a['push'](_0xe6967a['shift']());}};_0x1547c0(++_0x4cd660);}(_0x4201,0x1ce));var _0x1420=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x4201[_0x912d27];return _0x31b918;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var logger=require(_0x1420('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1420('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1420('0x4'));var config=require('../../config/environment');var attributes=require(_0x1420('0x5'));module[_0x1420('0x6')]=function(_0x37a985,_0xb458de){return _0x37a985['define'](_0x1420('0x7'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1420('0x8'),'collate':_0x1420('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9349f1f..6b1b67d 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 _0x3728=['catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','then','debug'];(function(_0xcaf237,_0x2ba742){var _0x3aa73e=function(_0x245e98){while(--_0x245e98){_0xcaf237['push'](_0xcaf237['shift']());}};_0x3aa73e(++_0x2ba742);}(_0x3728,0x16d));var _0x8372=function(_0x110879,_0x4db422){_0x110879=_0x110879-0x0;var _0x35265e=_0x3728[_0x110879];return _0x35265e;};'use strict';var _=require('lodash');var util=require(_0x8372('0x0'));var moment=require('moment');var BPromise=require(_0x8372('0x1'));var rs=require(_0x8372('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8372('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8372('0x4'))(_0x8372('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8372('0x6')][_0x8372('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x20fd7c,_0x34f1ba,_0x125c9c){return new BPromise(function(_0x147c11,_0x5141fc){return client['request'](_0x20fd7c,_0x125c9c)['then'](function(_0x32f4e7){logger[_0x8372('0x8')](_0x8372('0x9'),_0x34f1ba,_0x8372('0xa'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x34f1ba,_0x8372('0xa'),JSON[_0x8372('0xb')](_0x32f4e7));if(_0x32f4e7[_0x8372('0xc')]){if(_0x32f4e7[_0x8372('0xc')][_0x8372('0xd')]===0x1f4){logger['error'](_0x8372('0x9'),_0x34f1ba,_0x32f4e7[_0x8372('0xc')][_0x8372('0xe')]);return _0x5141fc(_0x32f4e7[_0x8372('0xc')][_0x8372('0xe')]);}logger[_0x8372('0xc')]('MailApplication,\x20%s,\x20%s',_0x34f1ba,_0x32f4e7[_0x8372('0xc')]['message']);return _0x147c11(_0x32f4e7[_0x8372('0xc')][_0x8372('0xe')]);}else{logger[_0x8372('0x8')](_0x8372('0x9'),_0x34f1ba,_0x8372('0xa'));_0x147c11(_0x32f4e7['result'][_0x8372('0xe')]);}})['catch'](function(_0x4b40c4){logger[_0x8372('0xc')](_0x8372('0x9'),_0x34f1ba,_0x4b40c4);_0x5141fc(_0x4b40c4);});});}exports[_0x8372('0xf')]=function(_0x463b2e){var _0x529ecf=this;return new Promise(function(_0x4db518,_0x126f5f){return db[_0x8372('0x10')][_0x8372('0x11')](_0x463b2e[_0x8372('0x12')],{'raw':_0x463b2e['options']?_0x463b2e[_0x8372('0x13')][_0x8372('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x463b2e['options']?_0x463b2e[_0x8372('0x13')][_0x8372('0x15')]||null:null,'attributes':_0x463b2e['options']?_0x463b2e[_0x8372('0x13')]['attributes']||null:null,'limit':_0x463b2e[_0x8372('0x13')]?_0x463b2e['options'][_0x8372('0x16')]||null:null})[_0x8372('0x17')](function(_0x46e37b){logger[_0x8372('0x8')](_0x8372('0xf'),_0x463b2e);logger[_0x8372('0x18')](_0x8372('0xf'),_0x463b2e,JSON[_0x8372('0xb')](_0x46e37b));_0x4db518(_0x46e37b);})[_0x8372('0x19')](function(_0x146eb4){logger[_0x8372('0xc')](_0x8372('0xf'),_0x146eb4['message'],_0x463b2e);_0x126f5f(_0x529ecf[_0x8372('0xc')](0x1f4,_0x146eb4[_0x8372('0xe')]));});});}; \ No newline at end of file +var _0x51f9=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','lodash','util','bluebird','randomstring'];(function(_0x4de3d2,_0x2dc474){var _0x4a02e2=function(_0x244f67){while(--_0x244f67){_0x4de3d2['push'](_0x4de3d2['shift']());}};_0x4a02e2(++_0x2dc474);}(_0x51f9,0x132));var _0x951f=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x51f9[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x951f('0x0'));var util=require(_0x951f('0x1'));var moment=require('moment');var BPromise=require(_0x951f('0x2'));var rs=require(_0x951f('0x3'));var fs=require('fs');var Redis=require(_0x951f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x951f('0x5'));var logger=require(_0x951f('0x6'))(_0x951f('0x7'));var config=require(_0x951f('0x8'));var jayson=require(_0x951f('0x9'));var client=jayson[_0x951f('0xa')][_0x951f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aca31,_0x2b3eb2,_0x1ad764){return new BPromise(function(_0x1c8fc1,_0x347c9c){return client[_0x951f('0xc')](_0x4aca31,_0x1ad764)[_0x951f('0xd')](function(_0x3c5518){logger[_0x951f('0xe')](_0x951f('0xf'),_0x2b3eb2,_0x951f('0x10'));logger[_0x951f('0x11')](_0x951f('0x12'),_0x2b3eb2,_0x951f('0x10'),JSON[_0x951f('0x13')](_0x3c5518));if(_0x3c5518[_0x951f('0x14')]){if(_0x3c5518[_0x951f('0x14')]['code']===0x1f4){logger['error'](_0x951f('0xf'),_0x2b3eb2,_0x3c5518[_0x951f('0x14')][_0x951f('0x15')]);return _0x347c9c(_0x3c5518['error'][_0x951f('0x15')]);}logger['error'](_0x951f('0xf'),_0x2b3eb2,_0x3c5518[_0x951f('0x14')][_0x951f('0x15')]);return _0x1c8fc1(_0x3c5518[_0x951f('0x14')][_0x951f('0x15')]);}else{logger['info'](_0x951f('0xf'),_0x2b3eb2,_0x951f('0x10'));_0x1c8fc1(_0x3c5518[_0x951f('0x16')][_0x951f('0x15')]);}})[_0x951f('0x17')](function(_0x1aba07){logger[_0x951f('0x14')](_0x951f('0xf'),_0x2b3eb2,_0x1aba07);_0x347c9c(_0x1aba07);});});}exports[_0x951f('0x18')]=function(_0x43b0f4){var _0x21f443=this;return new Promise(function(_0x7b3d7b,_0x5da2ba){return db[_0x951f('0x19')][_0x951f('0x1a')](_0x43b0f4[_0x951f('0x1b')],{'raw':_0x43b0f4[_0x951f('0x1c')]?_0x43b0f4[_0x951f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43b0f4[_0x951f('0x1c')]?_0x43b0f4['options'][_0x951f('0x1d')]||null:null,'attributes':_0x43b0f4[_0x951f('0x1c')]?_0x43b0f4['options'][_0x951f('0x1e')]||null:null,'limit':_0x43b0f4[_0x951f('0x1c')]?_0x43b0f4[_0x951f('0x1c')]['limit']||null:null})[_0x951f('0xd')](function(_0x1bd0cd){logger['info']('UpdateMailApplication',_0x43b0f4);logger[_0x951f('0x11')](_0x951f('0x18'),_0x43b0f4,JSON[_0x951f('0x13')](_0x1bd0cd));_0x7b3d7b(_0x1bd0cd);})[_0x951f('0x17')](function(_0x2840f2){logger['error']('UpdateMailApplication',_0x2840f2[_0x951f('0x15')],_0x43b0f4);_0x5da2ba(_0x21f443[_0x951f('0x14')](0x1f4,_0x2840f2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f96ba3a..8d41f83 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 _0x9896=['put','mail','mailinteraction:update','delete','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','addMessage','tracked'];(function(_0x2ea87d,_0x1d3534){var _0x1a97a9=function(_0x3beb73){while(--_0x3beb73){_0x2ea87d['push'](_0x2ea87d['shift']());}};_0x1a97a9(++_0x1d3534);}(_0x9896,0x1b1));var _0x6989=function(_0x35c941,_0x4d3a47){_0x35c941=_0x35c941-0x0;var _0x467d8c=_0x9896[_0x35c941];return _0x467d8c;};'use strict';var express=require(_0x6989('0x0'));var router=express[_0x6989('0x1')]();var auth=require(_0x6989('0x2'));var interaction=require(_0x6989('0x3'));var controller=require('./mailInteraction.controller');router[_0x6989('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6989('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x6989('0x5')]);router[_0x6989('0x4')](_0x6989('0x6'),auth['isAuthenticated'](),controller[_0x6989('0x7')]);router['get'](_0x6989('0x8'),auth[_0x6989('0x9')](),controller[_0x6989('0xa')]);router[_0x6989('0x4')](_0x6989('0xb'),auth[_0x6989('0x9')](),controller[_0x6989('0xc')]);router[_0x6989('0xd')]('/',auth[_0x6989('0x9')](),controller[_0x6989('0xe')]);router[_0x6989('0xd')](_0x6989('0x8'),auth[_0x6989('0x9')](),controller[_0x6989('0xf')]);router['post']('/:id/tags',auth[_0x6989('0x9')](),interaction[_0x6989('0x10')]('mail','mailinteraction:addtags'),controller['addTags']);router[_0x6989('0x11')]('/:id',auth[_0x6989('0x9')](),interaction[_0x6989('0x10')](_0x6989('0x12'),_0x6989('0x13')),controller['update']);router[_0x6989('0x14')](_0x6989('0x6'),auth[_0x6989('0x9')](),interaction['tracked'](_0x6989('0x12'),'mailinteraction:destroy'),controller[_0x6989('0x15')]);router[_0x6989('0x14')](_0x6989('0x16'),auth[_0x6989('0x9')](),controller[_0x6989('0x17')]);module[_0x6989('0x18')]=router; \ No newline at end of file +var _0x791f=['mail','addTags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','addMessage'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x791f,0x118));var _0xf791=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0x791f[_0x541a67];return _0x45da2a;};'use strict';var express=require(_0xf791('0x0'));var router=express[_0xf791('0x1')]();var auth=require(_0xf791('0x2'));var interaction=require(_0xf791('0x3'));var controller=require('./mailInteraction.controller');router[_0xf791('0x4')]('/',auth['isAuthenticated'](),controller[_0xf791('0x5')]);router[_0xf791('0x4')](_0xf791('0x6'),auth['isAuthenticated'](),controller[_0xf791('0x7')]);router[_0xf791('0x4')](_0xf791('0x8'),auth[_0xf791('0x9')](),controller[_0xf791('0xa')]);router[_0xf791('0x4')](_0xf791('0xb'),auth[_0xf791('0x9')](),controller[_0xf791('0xc')]);router['get'](_0xf791('0xd'),auth[_0xf791('0x9')](),controller[_0xf791('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf791('0xf')]('/:id/messages',auth[_0xf791('0x9')](),controller[_0xf791('0x10')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xf791('0x11'),'mailinteraction:addtags'),controller[_0xf791('0x12')]);router['put'](_0xf791('0x8'),auth[_0xf791('0x9')](),interaction[_0xf791('0x13')](_0xf791('0x11'),_0xf791('0x14')),controller[_0xf791('0x15')]);router[_0xf791('0x16')](_0xf791('0x8'),auth[_0xf791('0x9')](),interaction['tracked'](_0xf791('0x11'),_0xf791('0x17')),controller[_0xf791('0x18')]);router[_0xf791('0x16')](_0xf791('0x19'),auth['isAuthenticated'](),controller['removeTags']);module[_0xf791('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 91bda4a..3cead9e 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 _0x141d=['iconv','exports','STRING','TEXT','long','BOOLEAN','DATE','ENUM','out','sequelize'];(function(_0x423d48,_0x3b372b){var _0x16b500=function(_0x448dea){while(--_0x448dea){_0x423d48['push'](_0x423d48['shift']());}};_0x16b500(++_0x3b372b);}(_0x141d,0x12b));var _0xd141=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x141d[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0xd141('0x0'));var iconv=require(_0xd141('0x1'));module[_0xd141('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd141('0x3')]},'secondDisposition':{'type':Sequelize[_0xd141('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd141('0x3')]},'note':{'type':Sequelize[_0xd141('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xd141('0x3')]},'cc':{'type':Sequelize[_0xd141('0x4')](_0xd141('0x5'))},'subject':{'type':Sequelize[_0xd141('0x4')]()},'attach':{'type':Sequelize[_0xd141('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd141('0x7')]},'substatus':{'type':Sequelize[_0xd141('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xd141('0x8')]('in',_0xd141('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd141('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd141('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4e3d=['out','BOOLEAN','sequelize','iconv','DATE','STRING','TEXT','long','ENUM'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x4e3d,0x12b));var _0xd4e3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4e3d[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xd4e3('0x0'));var iconv=require(_0xd4e3('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd4e3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd4e3('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd4e3('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xd4e3('0x3')]},'cc':{'type':Sequelize[_0xd4e3('0x4')](_0xd4e3('0x5'))},'subject':{'type':Sequelize[_0xd4e3('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd4e3('0x2')]},'substatus':{'type':Sequelize[_0xd4e3('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xd4e3('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd4e3('0x6')]('in',_0xd4e3('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd4e3('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd4e3('0x6')]('in',_0xd4e3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd4e3('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 014f121..f3b1a1b 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 _0xfb85=['hasOwnProperty','order','sort','where','pick','filter','split','YYYY-MM-DD\x20HH:mm:ss','true','rows','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','format','transcript-%d-%s.zip','attachments','push','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','Bcc','Attachments','basename','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','limit','count','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','getOptions','findAll','mail','query','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','MailMessage'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xfb85,0xa5));var _0x5fb8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfb85[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5fb8('0x0'));var rimraf=require(_0x5fb8('0x1'));var zipdir=require(_0x5fb8('0x2'));var moment=require(_0x5fb8('0x3'));var BPromise=require(_0x5fb8('0x4'));var util=require(_0x5fb8('0x5'));var path=require(_0x5fb8('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x5fb8('0x7'));var Redis=require(_0x5fb8('0x8'));var interaction=require(_0x5fb8('0x9'));var qs=require(_0x5fb8('0xa'));var logger=require(_0x5fb8('0xb'))(_0x5fb8('0xc'));var config=require(_0x5fb8('0xd'));var db=require(_0x5fb8('0xe'))['db'];var htmlEntities=require(_0x5fb8('0xf'));config[_0x5fb8('0x10')]=_[_0x5fb8('0x11')](config['redis'],{'host':_0x5fb8('0x12'),'port':0x18eb});var socket=require(_0x5fb8('0x13'))(new Redis(config[_0x5fb8('0x10')]));require(_0x5fb8('0x14'))[_0x5fb8('0x15')](socket);function respondWithStatusCode(_0x4bb2b0,_0xeab137){_0xeab137=_0xeab137||0xcc;return function(_0x1bb624){if(_0x1bb624){return _0x4bb2b0[_0x5fb8('0x16')](_0xeab137);}return _0x4bb2b0['status'](_0xeab137)['end']();};}function respondWithResult(_0x4dbb87,_0x39f4fe){_0x39f4fe=_0x39f4fe||0xc8;return function(_0x901590){if(_0x901590){return _0x4dbb87[_0x5fb8('0x17')](_0x39f4fe)[_0x5fb8('0x18')](_0x901590);}};}function respondWithFilteredResult(_0x57ef5c,_0xbee99b){return function(_0x2feeb5){if(_0x2feeb5){var _0x700a9d=typeof _0xbee99b[_0x5fb8('0x19')]==='undefined'&&typeof _0xbee99b[_0x5fb8('0x1a')]==='undefined';var _0x52017c=_0x2feeb5[_0x5fb8('0x1b')];var _0x569c65=_0x700a9d?0x0:_0xbee99b[_0x5fb8('0x19')];var _0x1924b8=_0x700a9d?_0x2feeb5['count']:_0xbee99b[_0x5fb8('0x19')]+_0xbee99b[_0x5fb8('0x1a')];var _0x381ff6;if(_0x1924b8>=_0x52017c){_0x1924b8=_0x52017c;_0x381ff6=0xc8;}else{_0x381ff6=0xce;}_0x57ef5c[_0x5fb8('0x17')](_0x381ff6);return _0x57ef5c['set'](_0x5fb8('0x1c'),_0x569c65+'-'+_0x1924b8+'/'+_0x52017c)[_0x5fb8('0x18')](_0x2feeb5);}return null;};}function saveUpdates(_0x14de6a){return function(_0x57c27c){if(_0x57c27c){return _0x57c27c[_0x5fb8('0x1d')](_0x14de6a)[_0x5fb8('0x1e')](function(_0x5036e9){return _0x5036e9;});}return null;};}function removeEntity(_0x47d3bd){return function(_0x416f36){if(_0x416f36){return _0x416f36[_0x5fb8('0x1f')]()[_0x5fb8('0x1e')](function(){_0x47d3bd['status'](0xcc)[_0x5fb8('0x20')]();});}};}function handleEntityNotFound(_0x100610){return function(_0x2d790b){if(!_0x2d790b){_0x100610['sendStatus'](0x194);}return _0x2d790b;};}function handleError(_0x5b41bb,_0x28e528){_0x28e528=_0x28e528||0x1f4;return function(_0x2326a7){logger[_0x5fb8('0x21')](_0x2326a7[_0x5fb8('0x22')]);if(_0x2326a7['name']){delete _0x2326a7[_0x5fb8('0x23')];}_0x5b41bb[_0x5fb8('0x17')](_0x28e528)[_0x5fb8('0x24')](_0x2326a7);};}exports[_0x5fb8('0x25')]=function(_0x3fc433,_0x15a8ea){var _0x299cea={};var _0x23ec3e=_[_0x5fb8('0x26')](db[_0x5fb8('0x27')][_0x5fb8('0x28')],function(_0x29a8e4){return{'name':_0x29a8e4[_0x5fb8('0x29')],'type':_0x29a8e4['type']['key']};});_0x299cea=qs[_0x5fb8('0x2a')](_0x23ec3e,_0x3fc433);return interaction[_0x5fb8('0x2b')](_0x5fb8('0x2c'),_0x3fc433[_0x5fb8('0x2d')],_0x3fc433['user'],_0x299cea,_0x23ec3e)[_0x5fb8('0x1e')](respondWithFilteredResult(_0x15a8ea,_0x299cea))[_0x5fb8('0x2e')](handleError(_0x15a8ea,null));};exports['show']=function(_0x5c234a,_0x4ede5a){var _0x525d2d={'raw':![],'where':{'id':_0x5c234a[_0x5fb8('0x2f')]['id']}},_0x11ca00={};_0x11ca00[_0x5fb8('0x30')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x11ca00['query']=_[_0x5fb8('0x31')](_0x5c234a[_0x5fb8('0x2d')]);_0x11ca00[_0x5fb8('0x32')]=_[_0x5fb8('0x33')](_0x11ca00[_0x5fb8('0x30')],_0x11ca00[_0x5fb8('0x2d')]);_0x525d2d[_0x5fb8('0x34')]=_[_0x5fb8('0x33')](_0x11ca00[_0x5fb8('0x30')],qs[_0x5fb8('0x35')](_0x5c234a[_0x5fb8('0x2d')][_0x5fb8('0x35')]));_0x525d2d[_0x5fb8('0x34')]=_0x525d2d[_0x5fb8('0x34')][_0x5fb8('0x36')]?_0x525d2d[_0x5fb8('0x34')]:_0x11ca00[_0x5fb8('0x30')];if(_0x5c234a[_0x5fb8('0x2d')][_0x5fb8('0x37')]){_0x525d2d[_0x5fb8('0x38')]=[{'all':!![]}];}_0x525d2d=_[_0x5fb8('0x39')]({},_0x525d2d,_0x5c234a[_0x5fb8('0x3a')]);return db['MailInteraction']['find'](_0x525d2d)[_0x5fb8('0x1e')](handleEntityNotFound(_0x4ede5a,null))[_0x5fb8('0x1e')](respondWithResult(_0x4ede5a,null))[_0x5fb8('0x2e')](handleError(_0x4ede5a,null));};exports[_0x5fb8('0x3b')]=function(_0x158f31,_0x388e36){return db[_0x5fb8('0x27')][_0x5fb8('0x3b')](_0x158f31[_0x5fb8('0x3c')],{})[_0x5fb8('0x1e')](respondWithResult(_0x388e36,0xc9))[_0x5fb8('0x2e')](handleError(_0x388e36,null));};exports[_0x5fb8('0x1d')]=function(_0x3fed6b,_0x276d29){if(_0x3fed6b[_0x5fb8('0x3c')]['id']){delete _0x3fed6b[_0x5fb8('0x3c')]['id'];}return db[_0x5fb8('0x27')][_0x5fb8('0x3d')]({'where':{'id':_0x3fed6b[_0x5fb8('0x2f')]['id']}})[_0x5fb8('0x1e')](handleEntityNotFound(_0x276d29,null))[_0x5fb8('0x1e')](saveUpdates(_0x3fed6b[_0x5fb8('0x3c')],null))['then'](respondWithResult(_0x276d29,null))[_0x5fb8('0x2e')](handleError(_0x276d29,null));};exports[_0x5fb8('0x1f')]=function(_0x175d9a,_0x82b3b6){return db[_0x5fb8('0x27')][_0x5fb8('0x3d')]({'where':{'id':_0x175d9a[_0x5fb8('0x2f')]['id']}})[_0x5fb8('0x1e')](handleEntityNotFound(_0x82b3b6,null))[_0x5fb8('0x1e')](removeEntity(_0x82b3b6,null))[_0x5fb8('0x2e')](handleError(_0x82b3b6,null));};exports[_0x5fb8('0x3e')]=function(_0x46af65,_0x16602d){return db[_0x5fb8('0x27')][_0x5fb8('0x3e')]()['then'](respondWithResult(_0x16602d,null))['catch'](handleError(_0x16602d,null));};exports[_0x5fb8('0x3f')]=function(_0x464495,_0xd490df){return db['MailMessage'][_0x5fb8('0x3d')]({'where':{'id':_0x464495[_0x5fb8('0x2f')]['id']}})['then'](handleEntityNotFound(_0xd490df,null))[_0x5fb8('0x1e')](function(_0x1f8915){if(_0x1f8915){return _0x1f8915[_0x5fb8('0x3f')](_0x464495[_0x5fb8('0x3c')][_0x5fb8('0x40')],_[_0x5fb8('0x41')](_0x464495['body'],[_0x5fb8('0x40'),'id'])||{});}})[_0x5fb8('0x1e')](respondWithResult(_0xd490df,null))[_0x5fb8('0x2e')](handleError(_0xd490df,null));};exports[_0x5fb8('0x42')]=function(_0x1a880a,_0x5a0ef1){var _0x5ce9fa={'raw':![],'where':{}};var _0x54c384={};var _0x13065a={'count':0x0,'rows':[]};return db[_0x5fb8('0x27')][_0x5fb8('0x43')]({'where':{'id':_0x1a880a['params']['id']}})[_0x5fb8('0x1e')](handleEntityNotFound(_0x5a0ef1,null))['then'](function(_0xbf7b47){if(_0xbf7b47){_0x54c384['model']=_[_0x5fb8('0x31')](db[_0x5fb8('0x44')][_0x5fb8('0x28')]);_0x54c384[_0x5fb8('0x2d')]=_[_0x5fb8('0x31')](_0x1a880a[_0x5fb8('0x2d')]);_0x54c384[_0x5fb8('0x32')]=_[_0x5fb8('0x33')](_0x54c384['model'],_0x54c384['query']);_0x5ce9fa['attributes']=_[_0x5fb8('0x33')](_0x54c384[_0x5fb8('0x30')],qs['fields'](_0x1a880a[_0x5fb8('0x2d')][_0x5fb8('0x35')]));_0x5ce9fa['attributes']=_0x5ce9fa['attributes']['length']?_0x5ce9fa['attributes']:_0x54c384[_0x5fb8('0x30')];if(!_0x1a880a[_0x5fb8('0x2d')][_0x5fb8('0x45')]('nolimit')){_0x5ce9fa[_0x5fb8('0x1a')]=qs[_0x5fb8('0x1a')](_0x1a880a['query'][_0x5fb8('0x1a')]);_0x5ce9fa[_0x5fb8('0x19')]=qs[_0x5fb8('0x19')](_0x1a880a['query'][_0x5fb8('0x19')]);}_0x5ce9fa[_0x5fb8('0x46')]=qs[_0x5fb8('0x47')](_0x1a880a['query'][_0x5fb8('0x47')]);_0x5ce9fa[_0x5fb8('0x48')]=qs[_0x5fb8('0x32')](_[_0x5fb8('0x49')](_0x1a880a[_0x5fb8('0x2d')],_0x54c384[_0x5fb8('0x32')]));_0x5ce9fa['where']['MailInteractionId']=_0xbf7b47['id'];if(_0x1a880a[_0x5fb8('0x2d')][_0x5fb8('0x4a')]){_0x5ce9fa[_0x5fb8('0x48')]=_[_0x5fb8('0x39')](_0x5ce9fa[_0x5fb8('0x48')],{'$or':_['map'](_0x5ce9fa[_0x5fb8('0x34')],function(_0x26614d){var _0x5e4b2d={};_0x5e4b2d[_0x26614d]={'$like':'%'+_0x1a880a[_0x5fb8('0x2d')][_0x5fb8('0x4a')]+'%'};return _0x5e4b2d;})});}if(_0x1a880a[_0x5fb8('0x2d')]['$gte']){var _0x4936a4=_0x1a880a[_0x5fb8('0x2d')]['$gte'][_0x5fb8('0x4b')](',');var _0x1db969={};_0x1db969[_0x4936a4[0x0]]={'$gte':moment(_0x4936a4[0x1])['format'](_0x5fb8('0x4c'))};_0x5ce9fa[_0x5fb8('0x48')]=_[_0x5fb8('0x39')](_0x5ce9fa[_0x5fb8('0x48')],_0x1db969);}_0x5ce9fa=_[_0x5fb8('0x39')]({},_0x5ce9fa,_0x1a880a[_0x5fb8('0x3a')]);return db[_0x5fb8('0x44')]['count']({'where':_0x5ce9fa[_0x5fb8('0x48')]})['then'](function(_0x479384){_0x13065a['count']=_0x479384;if(_0x1a880a[_0x5fb8('0x2d')]['includeAll']){_0x5ce9fa[_0x5fb8('0x38')]=[{'all':!![]}];}return db[_0x5fb8('0x44')][_0x5fb8('0x2b')](_0x5ce9fa);})['then'](function(_0x4ff3b7){if(_0x1a880a[_0x5fb8('0x2d')]['inlineCss']===_0x5fb8('0x4d')){for(var _0x240a80=0x0;_0x240a80<_0x4ff3b7[_0x5fb8('0x36')];_0x240a80++){_0x4ff3b7[_0x240a80]['body']=juice(_0x4ff3b7[_0x240a80][_0x5fb8('0x3c')]);}}_0x13065a[_0x5fb8('0x4e')]=_0x4ff3b7;return _0x13065a;});}})[_0x5fb8('0x1e')](respondWithFilteredResult(_0x5a0ef1,_0x5ce9fa))[_0x5fb8('0x2e')](handleError(_0x5a0ef1,null));};exports['addTags']=function(_0x5d9491,_0xba7b38){return db['MailInteraction'][_0x5fb8('0x3d')]({'where':{'id':_0x5d9491['params']['id']}})['then'](handleEntityNotFound(_0xba7b38,null))[_0x5fb8('0x1e')](function(_0x3ab697){if(_0x3ab697){return _0x3ab697[_0x5fb8('0x4f')](_0x5d9491[_0x5fb8('0x3c')][_0x5fb8('0x40')],_['omit'](_0x5d9491[_0x5fb8('0x3c')],[_0x5fb8('0x40'),'id'])||{})[_0x5fb8('0x50')](function(){return db[_0x5fb8('0x51')][_0x5fb8('0x2b')]({'attributes':['id',_0x5fb8('0x23'),'color'],'where':{'id':_0x5d9491[_0x5fb8('0x3c')][_0x5fb8('0x40')]}});})[_0x5fb8('0x1e')](function(_0x276b1c){socket[_0x5fb8('0x52')](_0x5fb8('0x53'),{'id':Number(_0x5d9491[_0x5fb8('0x2f')]['id']),'tags':_0x276b1c||[]});return{'id':Number(_0x5d9491[_0x5fb8('0x2f')]['id']),'tags':_0x276b1c||[]};});}})[_0x5fb8('0x1e')](respondWithResult(_0xba7b38,null))['catch'](handleError(_0xba7b38,null));};exports[_0x5fb8('0x54')]=function(_0x1ae5e3,_0x431529){return db['MailInteraction']['find']({'where':{'id':_0x1ae5e3[_0x5fb8('0x2f')]['id']}})[_0x5fb8('0x1e')](handleEntityNotFound(_0x431529,null))[_0x5fb8('0x1e')](function(_0x10310c){if(_0x10310c){return _0x10310c[_0x5fb8('0x54')](_0x1ae5e3['query'][_0x5fb8('0x40')]);}})['then'](respondWithStatusCode(_0x431529,null))[_0x5fb8('0x2e')](handleError(_0x431529,null));};exports['download']=function(_0x887d9e,_0x591327){var _0x3614c3=moment()[_0x5fb8('0x55')]()[_0x5fb8('0x56')]();var _0x1aa906=path[_0x5fb8('0x57')](config[_0x5fb8('0x58')],_0x5fb8('0x59'),'files',_0x5fb8('0x5a'));var _0x27b379=path[_0x5fb8('0x57')](config[_0x5fb8('0x58')],_0x5fb8('0x59'),'files','attachments');var _0x310b22=path[_0x5fb8('0x57')](_0x1aa906,_0x3614c3);var _0x200e67=util[_0x5fb8('0x5b')](_0x5fb8('0x5c'),_0x887d9e[_0x5fb8('0x2f')]['id'],_0x3614c3);var _0x1e830a=path['join'](_0x1aa906,_0x200e67);var _0x1f1d1e=[];if(_0x887d9e[_0x5fb8('0x2d')][_0x5fb8('0x5d')]){_0x1f1d1e[_0x5fb8('0x5e')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x572b08=[{'model':db[_0x5fb8('0x44')],'as':_0x5fb8('0x5f'),'attributes':['id',_0x5fb8('0x3c'),_0x5fb8('0x60'),'to','cc',_0x5fb8('0x61'),_0x5fb8('0x62'),_0x5fb8('0x63')],'where':{'secret':![]},'order':qs[_0x5fb8('0x47')]('id'),'include':_0x1f1d1e}];return db[_0x5fb8('0x27')][_0x5fb8('0x3d')]({'where':{'id':_0x887d9e[_0x5fb8('0x2f')]['id']},'include':_0x572b08})[_0x5fb8('0x1e')](handleEntityNotFound(_0x591327,null))[_0x5fb8('0x1e')](function(_0x4fdffe){if(_0x4fdffe&&_0x4fdffe[_0x5fb8('0x5f')]){var _0x4f5572=_0x4fdffe[_0x5fb8('0x64')]({'plain':!![]});fs[_0x5fb8('0x65')](_0x310b22);return BPromise[_0x5fb8('0x66')](_0x4f5572[_0x5fb8('0x5f')],function(_0x89ed2,_0x555ed4){var _0x793b7a={'from':_0x89ed2[_0x5fb8('0x60')],'to':_0x89ed2['to']||_0x5fb8('0x67'),'subject':_0x89ed2[_0x5fb8('0x62')],'html':htmlEntities[_0x5fb8('0x68')](_0x89ed2[_0x5fb8('0x3c')]),'headers':{'Date':moment(_0x89ed2[_0x5fb8('0x63')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x89ed2['cc']){_0x793b7a['headers']['Cc']=_0x89ed2['cc'];}if(_0x89ed2[_0x5fb8('0x61')]){_0x793b7a[_0x5fb8('0x69')][_0x5fb8('0x6a')]=_0x89ed2[_0x5fb8('0x61')];}return new BPromise(function(_0x26e4c2,_0x541af8){if(_0x89ed2[_0x5fb8('0x6b')]){for(var _0x45eba5=0x0;_0x45eba5<_0x89ed2[_0x5fb8('0x6b')][_0x5fb8('0x36')];_0x45eba5++){var _0x249b17=_0x89ed2[_0x5fb8('0x6b')][_0x45eba5];var _0x2bd99a=path[_0x5fb8('0x57')](_0x27b379,_0x249b17[_0x5fb8('0x6c')]);if(fs[_0x5fb8('0x6d')](_0x2bd99a)){_0x793b7a['attachments'][_0x5fb8('0x5e')]({'name':_0x249b17[_0x5fb8('0x23')],'contentType':_0x249b17[_0x5fb8('0x6e')],'data':fs[_0x5fb8('0x6f')](_0x2bd99a)});}}}emlformat[_0x5fb8('0x70')](_0x793b7a,function(_0x3556ab,_0x141620){if(_0x3556ab)return _0x541af8(_0x3556ab);fs[_0x5fb8('0x71')](path[_0x5fb8('0x57')](_0x310b22,util['format'](_0x5fb8('0x72'),_0x555ed4)),_0x141620);return _0x26e4c2(_0x141620);});});})[_0x5fb8('0x1e')](function(){return new BPromise(function(_0x46714e,_0x11cab0){zipdir(_0x310b22,{'saveTo':_0x1e830a},function(_0x312ecf,_0xcc3228){if(_0x312ecf)return _0x11cab0(_0x312ecf);return _0x46714e(_0xcc3228);});})[_0x5fb8('0x1e')](function(){return new BPromise(function(_0x113dd5,_0x471850){rimraf(_0x310b22,function(_0x3acc54){if(_0x3acc54)_0x471850(_0x3acc54);return _0x113dd5();});});})['then'](function(){return _0x591327[_0x5fb8('0x73')](_0x1e830a,_0x200e67,function(_0x50cd69){if(!_0x50cd69)fs[_0x5fb8('0x74')](_0x1e830a);});});});}else{return _0x591327['sendStatus'](0xc8);}})[_0x5fb8('0x2e')](handleError(_0x591327,null));}; \ No newline at end of file +var _0x3fb9=['./mailInteraction.socket','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','findAll','mail','query','user','catch','show','params','keys','filters','intersection','fields','attributes','length','model','includeAll','include','merge','options','MailInteraction','find','create','body','update','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','Tag','color','mailInteractionTags:save','removeTags','download','files','tmp','root','server','attachments','transcript-%d-%s.zip','join','Attachment','Messages','from','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','push','type','readFileSync','writeFileSync','message%d.eml','eml-format','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3fb9,0x1b0));var _0x93fb=function(_0x5ba491,_0x9cedc4){_0x5ba491=_0x5ba491-0x0;var _0x51bdfd=_0x3fb9[_0x5ba491];return _0x51bdfd;};'use strict';var emlformat=require(_0x93fb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x93fb('0x1'));var util=require('util');var path=require(_0x93fb('0x2'));var fs=require('fs');var _=require(_0x93fb('0x3'));var juice=require(_0x93fb('0x4'));var Redis=require(_0x93fb('0x5'));var interaction=require(_0x93fb('0x6'));var qs=require(_0x93fb('0x7'));var logger=require(_0x93fb('0x8'))('api');var config=require(_0x93fb('0x9'));var db=require(_0x93fb('0xa'))['db'];var htmlEntities=require(_0x93fb('0xb'));config[_0x93fb('0xc')]=_[_0x93fb('0xd')](config[_0x93fb('0xc')],{'host':_0x93fb('0xe'),'port':0x18eb});var socket=require(_0x93fb('0xf'))(new Redis(config[_0x93fb('0xc')]));require(_0x93fb('0x10'))['register'](socket);function respondWithStatusCode(_0x17638d,_0x23700a){_0x23700a=_0x23700a||0xcc;return function(_0x3f9b0a){if(_0x3f9b0a){return _0x17638d[_0x93fb('0x11')](_0x23700a);}return _0x17638d['status'](_0x23700a)[_0x93fb('0x12')]();};}function respondWithResult(_0x4c0e9e,_0x4387ee){_0x4387ee=_0x4387ee||0xc8;return function(_0xa3c194){if(_0xa3c194){return _0x4c0e9e[_0x93fb('0x13')](_0x4387ee)[_0x93fb('0x14')](_0xa3c194);}};}function respondWithFilteredResult(_0x35bccd,_0xd5c7fd){return function(_0xd84247){if(_0xd84247){var _0x569ffe=typeof _0xd5c7fd['offset']===_0x93fb('0x15')&&typeof _0xd5c7fd['limit']===_0x93fb('0x15');var _0x531239=_0xd84247['count'];var _0x388773=_0x569ffe?0x0:_0xd5c7fd[_0x93fb('0x16')];var _0x52aa2c=_0x569ffe?_0xd84247[_0x93fb('0x17')]:_0xd5c7fd['offset']+_0xd5c7fd[_0x93fb('0x18')];var _0x21cbb7;if(_0x52aa2c>=_0x531239){_0x52aa2c=_0x531239;_0x21cbb7=0xc8;}else{_0x21cbb7=0xce;}_0x35bccd[_0x93fb('0x13')](_0x21cbb7);return _0x35bccd[_0x93fb('0x19')](_0x93fb('0x1a'),_0x388773+'-'+_0x52aa2c+'/'+_0x531239)[_0x93fb('0x14')](_0xd84247);}return null;};}function saveUpdates(_0x3ea1e5){return function(_0x20d973){if(_0x20d973){return _0x20d973['update'](_0x3ea1e5)[_0x93fb('0x1b')](function(_0x244b69){return _0x244b69;});}return null;};}function removeEntity(_0x3b76f3){return function(_0x484155){if(_0x484155){return _0x484155[_0x93fb('0x1c')]()[_0x93fb('0x1b')](function(){_0x3b76f3[_0x93fb('0x13')](0xcc)[_0x93fb('0x12')]();});}};}function handleEntityNotFound(_0x4ad104){return function(_0xcb76a6){if(!_0xcb76a6){_0x4ad104[_0x93fb('0x11')](0x194);}return _0xcb76a6;};}function handleError(_0x5b2cd8,_0x2643a7){_0x2643a7=_0x2643a7||0x1f4;return function(_0x28d4ff){logger[_0x93fb('0x1d')](_0x28d4ff[_0x93fb('0x1e')]);if(_0x28d4ff[_0x93fb('0x1f')]){delete _0x28d4ff[_0x93fb('0x1f')];}_0x5b2cd8['status'](_0x2643a7)[_0x93fb('0x20')](_0x28d4ff);};}exports['index']=function(_0x316151,_0x16aa81){var _0x35660d={};var _0x4cea5b=_[_0x93fb('0x21')](db['MailInteraction'][_0x93fb('0x22')],function(_0x23d626){return{'name':_0x23d626[_0x93fb('0x23')],'type':_0x23d626['type']['key']};});_0x35660d=qs['getOptions'](_0x4cea5b,_0x316151);return interaction[_0x93fb('0x24')](_0x93fb('0x25'),_0x316151[_0x93fb('0x26')],_0x316151[_0x93fb('0x27')],_0x35660d,_0x4cea5b)[_0x93fb('0x1b')](respondWithFilteredResult(_0x16aa81,_0x35660d))[_0x93fb('0x28')](handleError(_0x16aa81,null));};exports[_0x93fb('0x29')]=function(_0x2a2de4,_0x306582){var _0x4172f6={'raw':![],'where':{'id':_0x2a2de4[_0x93fb('0x2a')]['id']}},_0xaf09e7={};_0xaf09e7['model']=_[_0x93fb('0x2b')](db['MailInteraction'][_0x93fb('0x22')]);_0xaf09e7['query']=_[_0x93fb('0x2b')](_0x2a2de4[_0x93fb('0x26')]);_0xaf09e7[_0x93fb('0x2c')]=_[_0x93fb('0x2d')](_0xaf09e7['model'],_0xaf09e7['query']);_0x4172f6['attributes']=_[_0x93fb('0x2d')](_0xaf09e7['model'],qs[_0x93fb('0x2e')](_0x2a2de4[_0x93fb('0x26')][_0x93fb('0x2e')]));_0x4172f6[_0x93fb('0x2f')]=_0x4172f6[_0x93fb('0x2f')][_0x93fb('0x30')]?_0x4172f6[_0x93fb('0x2f')]:_0xaf09e7[_0x93fb('0x31')];if(_0x2a2de4[_0x93fb('0x26')][_0x93fb('0x32')]){_0x4172f6[_0x93fb('0x33')]=[{'all':!![]}];}_0x4172f6=_[_0x93fb('0x34')]({},_0x4172f6,_0x2a2de4[_0x93fb('0x35')]);return db[_0x93fb('0x36')][_0x93fb('0x37')](_0x4172f6)[_0x93fb('0x1b')](handleEntityNotFound(_0x306582,null))[_0x93fb('0x1b')](respondWithResult(_0x306582,null))[_0x93fb('0x28')](handleError(_0x306582,null));};exports[_0x93fb('0x38')]=function(_0x5da17d,_0x5beda0){return db[_0x93fb('0x36')][_0x93fb('0x38')](_0x5da17d[_0x93fb('0x39')],{})[_0x93fb('0x1b')](respondWithResult(_0x5beda0,0xc9))['catch'](handleError(_0x5beda0,null));};exports[_0x93fb('0x3a')]=function(_0x489260,_0x7a9ce4){if(_0x489260[_0x93fb('0x39')]['id']){delete _0x489260['body']['id'];}return db[_0x93fb('0x36')][_0x93fb('0x37')]({'where':{'id':_0x489260['params']['id']}})['then'](handleEntityNotFound(_0x7a9ce4,null))['then'](saveUpdates(_0x489260[_0x93fb('0x39')],null))[_0x93fb('0x1b')](respondWithResult(_0x7a9ce4,null))[_0x93fb('0x28')](handleError(_0x7a9ce4,null));};exports[_0x93fb('0x1c')]=function(_0x135df9,_0x28b730){return db[_0x93fb('0x36')][_0x93fb('0x37')]({'where':{'id':_0x135df9[_0x93fb('0x2a')]['id']}})[_0x93fb('0x1b')](handleEntityNotFound(_0x28b730,null))[_0x93fb('0x1b')](removeEntity(_0x28b730,null))['catch'](handleError(_0x28b730,null));};exports[_0x93fb('0x3b')]=function(_0x121094,_0x57cc45){return db[_0x93fb('0x36')][_0x93fb('0x3b')]()[_0x93fb('0x1b')](respondWithResult(_0x57cc45,null))[_0x93fb('0x28')](handleError(_0x57cc45,null));};exports[_0x93fb('0x3c')]=function(_0x3d8777,_0x781ab){return db[_0x93fb('0x3d')][_0x93fb('0x37')]({'where':{'id':_0x3d8777[_0x93fb('0x2a')]['id']}})['then'](handleEntityNotFound(_0x781ab,null))[_0x93fb('0x1b')](function(_0x332f85){if(_0x332f85){return _0x332f85['addMessage'](_0x3d8777[_0x93fb('0x39')][_0x93fb('0x3e')],_[_0x93fb('0x3f')](_0x3d8777[_0x93fb('0x39')],['ids','id'])||{});}})[_0x93fb('0x1b')](respondWithResult(_0x781ab,null))['catch'](handleError(_0x781ab,null));};exports[_0x93fb('0x40')]=function(_0x914341,_0x2f0656){var _0x482026={'raw':![],'where':{}};var _0x35e8c1={};var _0x20cb30={'count':0x0,'rows':[]};return db[_0x93fb('0x36')][_0x93fb('0x41')]({'where':{'id':_0x914341[_0x93fb('0x2a')]['id']}})[_0x93fb('0x1b')](handleEntityNotFound(_0x2f0656,null))['then'](function(_0x3f4074){if(_0x3f4074){_0x35e8c1[_0x93fb('0x31')]=_[_0x93fb('0x2b')](db['MailMessage'][_0x93fb('0x22')]);_0x35e8c1[_0x93fb('0x26')]=_[_0x93fb('0x2b')](_0x914341[_0x93fb('0x26')]);_0x35e8c1['filters']=_[_0x93fb('0x2d')](_0x35e8c1[_0x93fb('0x31')],_0x35e8c1['query']);_0x482026[_0x93fb('0x2f')]=_[_0x93fb('0x2d')](_0x35e8c1[_0x93fb('0x31')],qs[_0x93fb('0x2e')](_0x914341[_0x93fb('0x26')][_0x93fb('0x2e')]));_0x482026[_0x93fb('0x2f')]=_0x482026[_0x93fb('0x2f')]['length']?_0x482026[_0x93fb('0x2f')]:_0x35e8c1['model'];if(!_0x914341[_0x93fb('0x26')][_0x93fb('0x42')](_0x93fb('0x43'))){_0x482026[_0x93fb('0x18')]=qs[_0x93fb('0x18')](_0x914341['query'][_0x93fb('0x18')]);_0x482026[_0x93fb('0x16')]=qs[_0x93fb('0x16')](_0x914341[_0x93fb('0x26')][_0x93fb('0x16')]);}_0x482026[_0x93fb('0x44')]=qs[_0x93fb('0x45')](_0x914341[_0x93fb('0x26')][_0x93fb('0x45')]);_0x482026[_0x93fb('0x46')]=qs[_0x93fb('0x2c')](_[_0x93fb('0x47')](_0x914341['query'],_0x35e8c1['filters']));_0x482026[_0x93fb('0x46')]['MailInteractionId']=_0x3f4074['id'];if(_0x914341[_0x93fb('0x26')]['filter']){_0x482026[_0x93fb('0x46')]=_[_0x93fb('0x34')](_0x482026[_0x93fb('0x46')],{'$or':_[_0x93fb('0x21')](_0x482026['attributes'],function(_0x3ff7b0){var _0x22ea8f={};_0x22ea8f[_0x3ff7b0]={'$like':'%'+_0x914341[_0x93fb('0x26')][_0x93fb('0x48')]+'%'};return _0x22ea8f;})});}if(_0x914341[_0x93fb('0x26')][_0x93fb('0x49')]){var _0x493d01=_0x914341['query'][_0x93fb('0x49')][_0x93fb('0x4a')](',');var _0x1dadb0={};_0x1dadb0[_0x493d01[0x0]]={'$gte':moment(_0x493d01[0x1])[_0x93fb('0x4b')](_0x93fb('0x4c'))};_0x482026[_0x93fb('0x46')]=_['merge'](_0x482026[_0x93fb('0x46')],_0x1dadb0);}_0x482026=_[_0x93fb('0x34')]({},_0x482026,_0x914341['options']);return db['MailMessage'][_0x93fb('0x17')]({'where':_0x482026['where']})['then'](function(_0xdf3ec7){_0x20cb30[_0x93fb('0x17')]=_0xdf3ec7;if(_0x914341['query'][_0x93fb('0x32')]){_0x482026['include']=[{'all':!![]}];}return db[_0x93fb('0x3d')][_0x93fb('0x24')](_0x482026);})[_0x93fb('0x1b')](function(_0x140fd5){if(_0x914341['query']['inlineCss']===_0x93fb('0x4d')){for(var _0x3eb5f5=0x0;_0x3eb5f5<_0x140fd5[_0x93fb('0x30')];_0x3eb5f5++){_0x140fd5[_0x3eb5f5][_0x93fb('0x39')]=juice(_0x140fd5[_0x3eb5f5][_0x93fb('0x39')]);}}_0x20cb30[_0x93fb('0x4e')]=_0x140fd5;return _0x20cb30;});}})[_0x93fb('0x1b')](respondWithFilteredResult(_0x2f0656,_0x482026))[_0x93fb('0x28')](handleError(_0x2f0656,null));};exports[_0x93fb('0x4f')]=function(_0x82a9ad,_0x3e08e1){return db[_0x93fb('0x36')][_0x93fb('0x37')]({'where':{'id':_0x82a9ad[_0x93fb('0x2a')]['id']}})[_0x93fb('0x1b')](handleEntityNotFound(_0x3e08e1,null))[_0x93fb('0x1b')](function(_0x19f1b2){if(_0x19f1b2){return _0x19f1b2['setTags'](_0x82a9ad[_0x93fb('0x39')][_0x93fb('0x3e')],_[_0x93fb('0x3f')](_0x82a9ad['body'],['ids','id'])||{})['spread'](function(){return db[_0x93fb('0x50')][_0x93fb('0x24')]({'attributes':['id',_0x93fb('0x1f'),_0x93fb('0x51')],'where':{'id':_0x82a9ad[_0x93fb('0x39')][_0x93fb('0x3e')]}});})[_0x93fb('0x1b')](function(_0x55c352){socket['emit'](_0x93fb('0x52'),{'id':Number(_0x82a9ad[_0x93fb('0x2a')]['id']),'tags':_0x55c352||[]});return{'id':Number(_0x82a9ad[_0x93fb('0x2a')]['id']),'tags':_0x55c352||[]};});}})[_0x93fb('0x1b')](respondWithResult(_0x3e08e1,null))[_0x93fb('0x28')](handleError(_0x3e08e1,null));};exports[_0x93fb('0x53')]=function(_0x3cda88,_0x671d41){return db[_0x93fb('0x36')][_0x93fb('0x37')]({'where':{'id':_0x3cda88[_0x93fb('0x2a')]['id']}})[_0x93fb('0x1b')](handleEntityNotFound(_0x671d41,null))[_0x93fb('0x1b')](function(_0x1465e0){if(_0x1465e0){return _0x1465e0[_0x93fb('0x53')](_0x3cda88[_0x93fb('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x671d41,null))[_0x93fb('0x28')](handleError(_0x671d41,null));};exports[_0x93fb('0x54')]=function(_0x117930,_0x1cd7b8){var _0x12760f=moment()['unix']()['toString']();var _0x251b76=path['join'](config['root'],'server',_0x93fb('0x55'),_0x93fb('0x56'));var _0x22c64f=path['join'](config[_0x93fb('0x57')],_0x93fb('0x58'),_0x93fb('0x55'),_0x93fb('0x59'));var _0xb4da3f=path['join'](_0x251b76,_0x12760f);var _0x2b38bd=util[_0x93fb('0x4b')](_0x93fb('0x5a'),_0x117930[_0x93fb('0x2a')]['id'],_0x12760f);var _0x7d9ca0=path[_0x93fb('0x5b')](_0x251b76,_0x2b38bd);var _0x39555b=[];if(_0x117930['query']['attachments']){_0x39555b['push']({'model':db[_0x93fb('0x5c')],'as':'Attachments','raw':!![]});}var _0x2b4b90=[{'model':db[_0x93fb('0x3d')],'as':_0x93fb('0x5d'),'attributes':['id',_0x93fb('0x39'),_0x93fb('0x5e'),'to','cc','bcc',_0x93fb('0x5f'),_0x93fb('0x60')],'where':{'secret':![]},'order':qs[_0x93fb('0x45')]('id'),'include':_0x39555b}];return db[_0x93fb('0x36')][_0x93fb('0x37')]({'where':{'id':_0x117930[_0x93fb('0x2a')]['id']},'include':_0x2b4b90})[_0x93fb('0x1b')](handleEntityNotFound(_0x1cd7b8,null))['then'](function(_0xbd8a24){if(_0xbd8a24&&_0xbd8a24[_0x93fb('0x5d')]){var _0x2fd890=_0xbd8a24[_0x93fb('0x61')]({'plain':!![]});fs[_0x93fb('0x62')](_0xb4da3f);return BPromise[_0x93fb('0x63')](_0x2fd890[_0x93fb('0x5d')],function(_0x31bc46,_0xff5324){var _0x3dda9d={'from':_0x31bc46[_0x93fb('0x5e')],'to':_0x31bc46['to']||_0x93fb('0x64'),'subject':_0x31bc46['subject'],'html':htmlEntities['decode'](_0x31bc46[_0x93fb('0x39')]),'headers':{'Date':moment(_0x31bc46[_0x93fb('0x60')])[_0x93fb('0x4b')](_0x93fb('0x65'))},'attachments':[]};if(_0x31bc46['cc']){_0x3dda9d[_0x93fb('0x66')]['Cc']=_0x31bc46['cc'];}if(_0x31bc46['bcc']){_0x3dda9d['headers'][_0x93fb('0x67')]=_0x31bc46['bcc'];}return new BPromise(function(_0x32514a,_0x291f72){if(_0x31bc46[_0x93fb('0x68')]){for(var _0x56ae24=0x0;_0x56ae24<_0x31bc46[_0x93fb('0x68')]['length'];_0x56ae24++){var _0x54c419=_0x31bc46[_0x93fb('0x68')][_0x56ae24];var _0x55bb56=path['join'](_0x22c64f,_0x54c419[_0x93fb('0x69')]);if(fs[_0x93fb('0x6a')](_0x55bb56)){_0x3dda9d['attachments'][_0x93fb('0x6b')]({'name':_0x54c419['name'],'contentType':_0x54c419[_0x93fb('0x6c')],'data':fs[_0x93fb('0x6d')](_0x55bb56)});}}}emlformat['build'](_0x3dda9d,function(_0x83107d,_0xee7803){if(_0x83107d)return _0x291f72(_0x83107d);fs[_0x93fb('0x6e')](path[_0x93fb('0x5b')](_0xb4da3f,util[_0x93fb('0x4b')](_0x93fb('0x6f'),_0xff5324)),_0xee7803);return _0x32514a(_0xee7803);});});})[_0x93fb('0x1b')](function(){return new BPromise(function(_0x6e4ac8,_0x51024a){zipdir(_0xb4da3f,{'saveTo':_0x7d9ca0},function(_0x462677,_0x16ce5a){if(_0x462677)return _0x51024a(_0x462677);return _0x6e4ac8(_0x16ce5a);});})[_0x93fb('0x1b')](function(){return new BPromise(function(_0x24d698,_0x43aa4a){rimraf(_0xb4da3f,function(_0xe7583f){if(_0xe7583f)_0x43aa4a(_0xe7583f);return _0x24d698();});});})[_0x93fb('0x1b')](function(){return _0x1cd7b8[_0x93fb('0x54')](_0x7d9ca0,_0x2b38bd,function(_0x39863f){if(!_0x39863f)fs['unlinkSync'](_0x7d9ca0);});});});}else{return _0x1cd7b8[_0x93fb('0x11')](0xc8);}})[_0x93fb('0x28')](handleError(_0x1cd7b8,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 2896b7c..3d7a846 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 _0x7aaa=['MailInteraction','../../mysqldb','MailMessage','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','exports','events'];(function(_0x8cb1c1,_0x1e7f87){var _0x39bdc1=function(_0x286d5a){while(--_0x286d5a){_0x8cb1c1['push'](_0x8cb1c1['shift']());}};_0x39bdc1(++_0x1e7f87);}(_0x7aaa,0x164));var _0xa7aa=function(_0x2219b5,_0x509fe5){_0x2219b5=_0x2219b5-0x0;var _0x4202be=_0x7aaa[_0x2219b5];return _0x4202be;};'use strict';var EventEmitter=require(_0xa7aa('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xa7aa('0x1')];var MailMessage=require(_0xa7aa('0x2'))['db'][_0xa7aa('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa7aa('0x4'),'afterUpdate':_0xa7aa('0x5'),'afterDestroy':_0xa7aa('0x6')};function emitEvent(_0x56f65d){return function(_0xa08d83,_0x10ef1e,_0x3eaa6a){_0xa08d83[_0xa7aa('0x7')]({'attributes':['id'],'raw':!![]})[_0xa7aa('0x8')](function(_0x176b17){_0xa08d83['setDataValue'](_0xa7aa('0x9'),_0x176b17[_0xa7aa('0xa')](function(_0x122565){return{'id':_0x122565['id']};}));return MailMessage[_0xa7aa('0xb')]({'where':{'MailInteractionId':_0xa08d83['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x52c9f1){_0xa08d83[_0xa7aa('0xc')](_0xa7aa('0xd'),_0x52c9f1[_0xa7aa('0xe')]);MailInteractionEvents[_0xa7aa('0xf')](_0x56f65d+':'+_0xa08d83['id'],_0xa08d83);MailInteractionEvents[_0xa7aa('0xf')](_0x56f65d,_0xa08d83);_0x3eaa6a(null);})['catch'](_0x3eaa6a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xa7aa('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x3f67=['getUsers','then','setDataValue','Users','map','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x3f67,0x1e9));var _0x73f6=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0x3f67[_0x9105f4];return _0x57a818;};'use strict';var EventEmitter=require(_0x73f6('0x0'));var MailInteraction=require(_0x73f6('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x73f6('0x1'))['db'][_0x73f6('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x73f6('0x3')](0x0);var events={'afterCreate':_0x73f6('0x4'),'afterUpdate':'update','afterDestroy':_0x73f6('0x5')};function emitEvent(_0x2bc761){return function(_0x1b5ac5,_0x590f81,_0x1984eb){_0x1b5ac5[_0x73f6('0x6')]({'attributes':['id'],'raw':!![]})[_0x73f6('0x7')](function(_0x2d4543){_0x1b5ac5[_0x73f6('0x8')](_0x73f6('0x9'),_0x2d4543[_0x73f6('0xa')](function(_0xf1ce5b){return{'id':_0xf1ce5b['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1b5ac5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1196af){_0x1b5ac5['setDataValue']('unreadMessages',_0x1196af['length']);MailInteractionEvents[_0x73f6('0xb')](_0x2bc761+':'+_0x1b5ac5['id'],_0x1b5ac5);MailInteractionEvents[_0x73f6('0xb')](_0x2bc761,_0x1b5ac5);_0x1984eb(null);})['catch'](_0x1984eb(null));};}for(var e in events){if(events[_0x73f6('0xc')](e)){var event=events[e];MailInteraction[_0x73f6('0xd')](e,emitEvent(event));}}module[_0x73f6('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2187dc7..3cef777 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 _0x2bfc=['changed','closed','models','get','MailMessage','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt'];(function(_0x199ce5,_0x4dbf7c){var _0x2ca7f5=function(_0x5d22f6){while(--_0x5d22f6){_0x199ce5['push'](_0x199ce5['shift']());}};_0x2ca7f5(++_0x4dbf7c);}(_0x2bfc,0xa9));var _0xc2bf=function(_0x1ef5cb,_0x3a9a73){_0x1ef5cb=_0x1ef5cb-0x0;var _0x198a87=_0x2bfc[_0x1ef5cb];return _0x198a87;};'use strict';var _=require(_0xc2bf('0x0'));var util=require(_0xc2bf('0x1'));var logger=require('../../config/logger')(_0xc2bf('0x2'));var moment=require(_0xc2bf('0x3'));var BPromise=require(_0xc2bf('0x4'));var rp=require(_0xc2bf('0x5'));var fs=require('fs');var path=require(_0xc2bf('0x6'));var rimraf=require(_0xc2bf('0x7'));var config=require(_0xc2bf('0x8'));var attributes=require(_0xc2bf('0x9'));module[_0xc2bf('0xa')]=function(_0xf80405,_0x2137cd){return _0xf80405[_0xc2bf('0xb')](_0xc2bf('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xc2bf('0xd'),'to'],'type':_0xc2bf('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1aacfc,_0x3f33d3,_0x3cf3fb){if(_0x1aacfc[_0xc2bf('0xf')]){_0x1aacfc[_0xc2bf('0x10')]=moment()[_0xc2bf('0x11')](_0xc2bf('0x12'));}if(_0x1aacfc['closed']){_0x1aacfc[_0xc2bf('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3cf3fb(null,_0x3f33d3);},'beforeUpdate':function(_0x46c582,_0x170e61,_0x1105cc){if(_0x46c582[_0xc2bf('0x14')](_0xc2bf('0xf'))){_0x46c582['substatusAt']=_0x46c582[_0xc2bf('0xf')]?moment()[_0xc2bf('0x11')](_0xc2bf('0x12')):null;}if(_0x46c582['changed'](_0xc2bf('0x15'))){_0x46c582['closedAt']=moment()[_0xc2bf('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x46c582['substatus']=null;_0x46c582[_0xc2bf('0x10')]=null;}_0x1105cc(null,_0x46c582);},'afterUpdate':function(_0x39a3fc,_0x493392,_0x2cc62b){var _0x32b043=_0xf80405[_0xc2bf('0x16')];var _0x31cdb6=_0x39a3fc[_0xc2bf('0x17')]({'plain':!![]});if(_0x31cdb6[_0xc2bf('0x15')]){return _0x32b043[_0xc2bf('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x31cdb6['id']}})['then'](function(){_0x2cc62b();})[_0xc2bf('0x19')](function(_0x1d8d09){_0x2cc62b(_0x1d8d09);});}else{_0x2cc62b();}}},'charset':'utf8mb4','collate':_0xc2bf('0x1a')});}; \ No newline at end of file +var _0xf2be=['moment','bluebird','request-promise','path','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','then','catch','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0xf2be,0x192));var _0xef2b=function(_0x49925a,_0x24eb11){_0x49925a=_0x49925a-0x0;var _0x2dfaed=_0xf2be[_0x49925a];return _0x2dfaed;};'use strict';var _=require(_0xef2b('0x0'));var util=require(_0xef2b('0x1'));var logger=require(_0xef2b('0x2'))(_0xef2b('0x3'));var moment=require(_0xef2b('0x4'));var BPromise=require(_0xef2b('0x5'));var rp=require(_0xef2b('0x6'));var fs=require('fs');var path=require(_0xef2b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef2b('0x8'));module[_0xef2b('0x9')]=function(_0x443a99,_0xf6a0b4){return _0x443a99[_0xef2b('0xa')](_0xef2b('0xb'),attributes,{'tableName':_0xef2b('0xc'),'paranoid':![],'indexes':[{'name':_0xef2b('0xd'),'fields':[_0xef2b('0xe'),'to'],'type':_0xef2b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25d723,_0x537404,_0x28641f){if(_0x25d723[_0xef2b('0x10')]){_0x25d723[_0xef2b('0x11')]=moment()['format'](_0xef2b('0x12'));}if(_0x25d723[_0xef2b('0x13')]){_0x25d723[_0xef2b('0x14')]=moment()[_0xef2b('0x15')](_0xef2b('0x12'));}_0x28641f(null,_0x537404);},'beforeUpdate':function(_0x3d8662,_0x3e93b6,_0x1e479f){if(_0x3d8662['changed'](_0xef2b('0x10'))){_0x3d8662[_0xef2b('0x11')]=_0x3d8662['substatus']?moment()['format'](_0xef2b('0x12')):null;}if(_0x3d8662[_0xef2b('0x16')](_0xef2b('0x13'))){_0x3d8662['closedAt']=moment()[_0xef2b('0x15')](_0xef2b('0x12'));_0x3d8662[_0xef2b('0x10')]=null;_0x3d8662['substatusAt']=null;}_0x1e479f(null,_0x3d8662);},'afterUpdate':function(_0x4f00d3,_0x418d86,_0x184164){var _0x34cfa5=_0x443a99[_0xef2b('0x17')];var _0x255c29=_0x4f00d3[_0xef2b('0x18')]({'plain':!![]});if(_0x255c29[_0xef2b('0x13')]){return _0x34cfa5['MailMessage'][_0xef2b('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x255c29['id']}})[_0xef2b('0x1a')](function(){_0x184164();})[_0xef2b('0x1b')](function(_0x5da290){_0x184164(_0x5da290);});}else{_0x184164();}}},'charset':_0xef2b('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 640c777..5981860 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 _0x4667=['http','redis','defaults','localhost','socket.io-emitter','register','request','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','then','debug','AddTagsToMailInteraction','addTags','ids','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x4667,0x10f));var _0x7466=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x4667[_0xc40b9f];return _0x535b9c;};'use strict';var _=require(_0x7466('0x0'));var util=require(_0x7466('0x1'));var moment=require('moment');var BPromise=require(_0x7466('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7466('0x3'))['db'];var utils=require(_0x7466('0x4'));var logger=require(_0x7466('0x5'))('rpc');var config=require(_0x7466('0x6'));var jayson=require(_0x7466('0x7'));var client=jayson[_0x7466('0x8')][_0x7466('0x9')]({'port':0x232a});config[_0x7466('0xa')]=_[_0x7466('0xb')](config[_0x7466('0xa')],{'host':_0x7466('0xc'),'port':0x18eb});var socket=require(_0x7466('0xd'))(new Redis(config[_0x7466('0xa')]));require('./mailInteraction.socket')[_0x7466('0xe')](socket);function respondWithRpcPromise(_0x2221c9,_0xab3091,_0x5d6b35){return new BPromise(function(_0x24b0a7,_0xb4883d){return client[_0x7466('0xf')](_0x2221c9,_0x5d6b35)['then'](function(_0x51b21f){logger[_0x7466('0x10')](_0x7466('0x11'),_0xab3091,'request\x20sent');logger['debug'](_0x7466('0x12'),_0xab3091,_0x7466('0x13'),JSON[_0x7466('0x14')](_0x51b21f));if(_0x51b21f[_0x7466('0x15')]){if(_0x51b21f['error']['code']===0x1f4){logger['error'](_0x7466('0x11'),_0xab3091,_0x51b21f[_0x7466('0x15')]['message']);return _0xb4883d(_0x51b21f[_0x7466('0x15')]['message']);}logger[_0x7466('0x15')]('MailInteraction,\x20%s,\x20%s',_0xab3091,_0x51b21f['error'][_0x7466('0x16')]);return _0x24b0a7(_0x51b21f[_0x7466('0x15')]['message']);}else{logger[_0x7466('0x10')](_0x7466('0x11'),_0xab3091,_0x7466('0x13'));_0x24b0a7(_0x51b21f[_0x7466('0x17')]['message']);}})[_0x7466('0x18')](function(_0x2fb8f7){logger[_0x7466('0x15')](_0x7466('0x11'),_0xab3091,_0x2fb8f7);_0xb4883d(_0x2fb8f7);});});}exports[_0x7466('0x19')]=function(_0x40f532){var _0x1e0946=this;return new Promise(function(_0x5f0d06,_0x4fbf3e){return db[_0x7466('0x1a')][_0x7466('0x1b')](_0x40f532[_0x7466('0x1c')],{'raw':_0x40f532[_0x7466('0x1d')]?_0x40f532[_0x7466('0x1d')][_0x7466('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f532['options']?_0x40f532[_0x7466('0x1d')][_0x7466('0x1f')]||null:null,'attributes':_0x40f532[_0x7466('0x1d')]?_0x40f532[_0x7466('0x1d')][_0x7466('0x20')]||null:null,'limit':_0x40f532['options']?_0x40f532['options']['limit']||null:null})[_0x7466('0x21')](function(_0x1c9f93){logger[_0x7466('0x10')](_0x7466('0x19'),_0x40f532);logger[_0x7466('0x22')]('UpdateMailInteraction',_0x40f532,JSON['stringify'](_0x1c9f93));_0x5f0d06(_0x1c9f93);})[_0x7466('0x18')](function(_0x5ecc4c){logger['error'](_0x7466('0x19'),_0x5ecc4c[_0x7466('0x16')],_0x40f532);_0x4fbf3e(_0x1e0946[_0x7466('0x15')](0x1f4,_0x5ecc4c[_0x7466('0x16')]));});});};exports[_0x7466('0x23')]=function(_0x2152c2){return new Promise(function(_0x2d67f0,_0x112598){return db[_0x7466('0x1a')]['find']({'where':_0x2152c2[_0x7466('0x1d')]?_0x2152c2[_0x7466('0x1d')][_0x7466('0x1f')]||null:null})[_0x7466('0x21')](function(_0x363230){if(_0x363230){return _0x363230[_0x7466('0x24')](_0x2152c2[_0x7466('0x1c')][_0x7466('0x25')],_['omit'](_0x2152c2[_0x7466('0x1c')],[_0x7466('0x25'),'id'])||{});}})[_0x7466('0x26')](function(_0x14c713){logger[_0x7466('0x10')]('AddTags',_0x2152c2);logger[_0x7466('0x22')]('AddTags',_0x2152c2,JSON['stringify'](_0x14c713));_0x2d67f0(_0x14c713);})[_0x7466('0x18')](function(_0x2c3ad4){logger[_0x7466('0x15')](_0x7466('0x27'),_0x2c3ad4[_0x7466('0x16')],_0x2152c2);_0x112598(_this[_0x7466('0x15')](0x1f4,_0x2c3ad4[_0x7466('0x16')]));});});}; \ No newline at end of file +var _0x59ec=['register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','UpdateMailInteraction','MailInteraction','body','options','where','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x32ba0f,_0xc0919b){var _0xacfb86=function(_0x2a90e8){while(--_0x2a90e8){_0x32ba0f['push'](_0x32ba0f['shift']());}};_0xacfb86(++_0xc0919b);}(_0x59ec,0x102));var _0xc59e=function(_0xb1c22d,_0x14cb11){_0xb1c22d=_0xb1c22d-0x0;var _0x292ffd=_0x59ec[_0xb1c22d];return _0x292ffd;};'use strict';var _=require(_0xc59e('0x0'));var util=require(_0xc59e('0x1'));var moment=require('moment');var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require(_0xc59e('0x5'));var logger=require(_0xc59e('0x6'))(_0xc59e('0x7'));var config=require(_0xc59e('0x8'));var jayson=require(_0xc59e('0x9'));var client=jayson[_0xc59e('0xa')][_0xc59e('0xb')]({'port':0x232a});config[_0xc59e('0xc')]=_[_0xc59e('0xd')](config[_0xc59e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc59e('0xe'))(new Redis(config[_0xc59e('0xc')]));require('./mailInteraction.socket')[_0xc59e('0xf')](socket);function respondWithRpcPromise(_0x57fa06,_0x3b365a,_0x5e0dff){return new BPromise(function(_0x5690be,_0x19d954){return client[_0xc59e('0x10')](_0x57fa06,_0x5e0dff)[_0xc59e('0x11')](function(_0x78d23a){logger['info'](_0xc59e('0x12'),_0x3b365a,'request\x20sent');logger[_0xc59e('0x13')](_0xc59e('0x14'),_0x3b365a,'request\x20sent',JSON[_0xc59e('0x15')](_0x78d23a));if(_0x78d23a[_0xc59e('0x16')]){if(_0x78d23a[_0xc59e('0x16')]['code']===0x1f4){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a['error'][_0xc59e('0x17')]);return _0x19d954(_0x78d23a[_0xc59e('0x16')]['message']);}logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a[_0xc59e('0x16')]['message']);return _0x5690be(_0x78d23a[_0xc59e('0x16')][_0xc59e('0x17')]);}else{logger[_0xc59e('0x18')]('MailInteraction,\x20%s,\x20%s',_0x3b365a,_0xc59e('0x19'));_0x5690be(_0x78d23a['result'][_0xc59e('0x17')]);}})[_0xc59e('0x1a')](function(_0x5aa256){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x5aa256);_0x19d954(_0x5aa256);});});}exports[_0xc59e('0x1b')]=function(_0x53333d){var _0x73efd2=this;return new Promise(function(_0x43bbf2,_0x15cb06){return db[_0xc59e('0x1c')]['update'](_0x53333d[_0xc59e('0x1d')],{'raw':_0x53333d[_0xc59e('0x1e')]?_0x53333d[_0xc59e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53333d[_0xc59e('0x1e')]?_0x53333d[_0xc59e('0x1e')][_0xc59e('0x1f')]||null:null,'attributes':_0x53333d[_0xc59e('0x1e')]?_0x53333d[_0xc59e('0x1e')]['attributes']||null:null,'limit':_0x53333d[_0xc59e('0x1e')]?_0x53333d[_0xc59e('0x1e')][_0xc59e('0x20')]||null:null})[_0xc59e('0x11')](function(_0x267ff3){logger['info'](_0xc59e('0x1b'),_0x53333d);logger[_0xc59e('0x13')](_0xc59e('0x1b'),_0x53333d,JSON[_0xc59e('0x15')](_0x267ff3));_0x43bbf2(_0x267ff3);})[_0xc59e('0x1a')](function(_0x4a93fc){logger[_0xc59e('0x16')](_0xc59e('0x1b'),_0x4a93fc[_0xc59e('0x17')],_0x53333d);_0x15cb06(_0x73efd2[_0xc59e('0x16')](0x1f4,_0x4a93fc[_0xc59e('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x2f4168){return new Promise(function(_0x260108,_0xf8c3c0){return db[_0xc59e('0x1c')][_0xc59e('0x21')]({'where':_0x2f4168[_0xc59e('0x1e')]?_0x2f4168['options']['where']||null:null})[_0xc59e('0x11')](function(_0x2f01ba){if(_0x2f01ba){return _0x2f01ba[_0xc59e('0x22')](_0x2f4168[_0xc59e('0x1d')][_0xc59e('0x23')],_[_0xc59e('0x24')](_0x2f4168[_0xc59e('0x1d')],[_0xc59e('0x23'),'id'])||{});}})[_0xc59e('0x25')](function(_0x1d94ec){logger[_0xc59e('0x18')](_0xc59e('0x26'),_0x2f4168);logger[_0xc59e('0x13')](_0xc59e('0x26'),_0x2f4168,JSON[_0xc59e('0x15')](_0x1d94ec));_0x260108(_0x1d94ec);})[_0xc59e('0x1a')](function(_0x213a50){logger[_0xc59e('0x16')](_0xc59e('0x26'),_0x213a50['message'],_0x2f4168);_0xf8c3c0(_this[_0xc59e('0x16')](0x1f4,_0x213a50[_0xc59e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d0e2af0..26daad3 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 _0xf3e4=['register','length','mailInteraction:','./mailInteraction.events','save','update','removeListener'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0xf3e4,0x11b));var _0x4f3e=function(_0x59db6c,_0x41e38b){_0x59db6c=_0x59db6c-0x0;var _0x475416=_0xf3e4[_0x59db6c];return _0x475416;};'use strict';var MailInteractionEvents=require(_0x4f3e('0x0'));var events=[_0x4f3e('0x1'),'remove',_0x4f3e('0x2')];function createListener(_0x1dc0f8,_0x4a5d08){return function(_0x4da4c6){_0x4a5d08['emit'](_0x1dc0f8,_0x4da4c6);};}function removeListener(_0x1ef28a,_0x40ab12){return function(){MailInteractionEvents[_0x4f3e('0x3')](_0x1ef28a,_0x40ab12);};}exports[_0x4f3e('0x4')]=function(_0x476334){for(var _0x419993=0x0,_0x3be4ef=events[_0x4f3e('0x5')];_0x419993<_0x3be4ef;_0x419993++){var _0x18c8cb=events[_0x419993];var _0x5a98b2=createListener(_0x4f3e('0x6')+_0x18c8cb,_0x476334);MailInteractionEvents['on'](_0x18c8cb,_0x5a98b2);}}; \ No newline at end of file +var _0x8129=['length','mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register'];(function(_0x1f28de,_0x39455f){var _0x1b4211=function(_0x569c5d){while(--_0x569c5d){_0x1f28de['push'](_0x1f28de['shift']());}};_0x1b4211(++_0x39455f);}(_0x8129,0x1ea));var _0x9812=function(_0x1b105b,_0x23adf1){_0x1b105b=_0x1b105b-0x0;var _0x338022=_0x8129[_0x1b105b];return _0x338022;};'use strict';var MailInteractionEvents=require(_0x9812('0x0'));var events=['save',_0x9812('0x1'),_0x9812('0x2')];function createListener(_0x468890,_0x534dcd){return function(_0x52107f){_0x534dcd[_0x9812('0x3')](_0x468890,_0x52107f);};}function removeListener(_0xa80ede,_0x3207c0){return function(){MailInteractionEvents[_0x9812('0x4')](_0xa80ede,_0x3207c0);};}exports[_0x9812('0x5')]=function(_0x5ccb4e){for(var _0x26b711=0x0,_0x19f314=events[_0x9812('0x6')];_0x26b711<_0x19f314;_0x26b711++){var _0x4821d5=events[_0x26b711];var _0x4562a3=createListener(_0x9812('0x7')+_0x4821d5,_0x5ccb4e);MailInteractionEvents['on'](_0x4821d5,_0x4562a3);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c38069c..bf58675 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 _0x180d=['/describe','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x180d,0xf9));var _0xd180=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x180d[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require(_0xd180('0x0'));var path=require(_0xd180('0x1'));var timeout=require(_0xd180('0x2'));var express=require(_0xd180('0x3'));var router=express[_0xd180('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd180('0x5'));var interaction=require(_0xd180('0x6'));var config=require(_0xd180('0x7'));var controller=require(_0xd180('0x8'));router[_0xd180('0x9')]('/',auth[_0xd180('0xa')](),controller['index']);router['get'](_0xd180('0xb'),auth[_0xd180('0xa')](),controller[_0xd180('0xc')]);router[_0xd180('0x9')](_0xd180('0xd'),auth[_0xd180('0xa')](),controller[_0xd180('0xe')]);router[_0xd180('0x9')](_0xd180('0xf'),auth[_0xd180('0xa')](),controller[_0xd180('0x10')]);router[_0xd180('0x11')]('/',auth[_0xd180('0xa')](),interaction[_0xd180('0x12')]('mail',_0xd180('0x13')),controller[_0xd180('0x14')]);router[_0xd180('0x15')](_0xd180('0xd'),auth[_0xd180('0xa')](),controller['update']);router['put'](_0xd180('0x16'),auth[_0xd180('0xa')](),controller[_0xd180('0x17')]);router[_0xd180('0x15')](_0xd180('0x18'),auth[_0xd180('0xa')](),controller['reject']);router['delete'](_0xd180('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd180('0x19')]=router; \ No newline at end of file +var _0xe59f=['connect-timeout','Router','fs-extra','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','mail','mailmessage:create','create','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path'];(function(_0x39a5b4,_0x5e60c7){var _0x1200dd=function(_0x3ba066){while(--_0x3ba066){_0x39a5b4['push'](_0x39a5b4['shift']());}};_0x1200dd(++_0x5e60c7);}(_0xe59f,0x1c5));var _0xfe59=function(_0x5b85e4,_0x482eae){_0x5b85e4=_0x5b85e4-0x0;var _0xc4e97e=_0xe59f[_0x5b85e4];return _0xc4e97e;};'use strict';var multer=require(_0xfe59('0x0'));var util=require(_0xfe59('0x1'));var path=require(_0xfe59('0x2'));var timeout=require(_0xfe59('0x3'));var express=require('express');var router=express[_0xfe59('0x4')]();var fs_extra=require(_0xfe59('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfe59('0x6'));router[_0xfe59('0x7')]('/',auth[_0xfe59('0x8')](),controller[_0xfe59('0x9')]);router[_0xfe59('0x7')](_0xfe59('0xa'),auth[_0xfe59('0x8')](),controller[_0xfe59('0xb')]);router[_0xfe59('0x7')](_0xfe59('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfe59('0x7')]('/:id/download',auth[_0xfe59('0x8')](),controller['download']);router[_0xfe59('0xd')]('/',auth[_0xfe59('0x8')](),interaction['tracked'](_0xfe59('0xe'),_0xfe59('0xf')),controller[_0xfe59('0x10')]);router[_0xfe59('0x11')](_0xfe59('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfe59('0x11')]('/:id/accept',auth[_0xfe59('0x8')](),controller[_0xfe59('0x12')]);router[_0xfe59('0x11')](_0xfe59('0x13'),auth['isAuthenticated'](),controller[_0xfe59('0x14')]);router[_0xfe59('0x15')](_0xfe59('0xc'),auth['isAuthenticated'](),controller[_0xfe59('0x16')]);module[_0xfe59('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 1b654b9..d838f2b 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 _0xa469=['exports','TEXT','long','medium','BOOLEAN','STRING','INTEGER','ENUM','Chat','Email','lodash'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa469,0x128));var _0x9a46=function(_0x4d0996,_0x4f6e68){_0x4d0996=_0x4d0996-0x0;var _0xf5ffe1=_0xa469[_0x4d0996];return _0xf5ffe1;};'use strict';var Sequelize=require('sequelize');var _=require(_0x9a46('0x0'));module[_0x9a46('0x1')]={'body':{'type':Sequelize[_0x9a46('0x2')](_0x9a46('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9a46('0x2')](_0x9a46('0x4'))},'read':{'type':Sequelize[_0x9a46('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9a46('0x6')](0x1fe)},'from':{'type':Sequelize[_0x9a46('0x6')]},'to':{'type':Sequelize[_0x9a46('0x2')](_0x9a46('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x9a46('0x3'))},'bcc':{'type':Sequelize[_0x9a46('0x2')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x9a46('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9a46('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0x9a46('0x3'))},'originChannel':{'type':Sequelize[_0x9a46('0x8')]('Email',_0x9a46('0x9')),'defaultValue':_0x9a46('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xf08f=['INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','long','TEXT','BOOLEAN','DATE'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xf08f,0x7d));var _0xff08=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xf08f[_0x58d5ac];return _0x37985c;};'use strict';var Sequelize=require(_0xff08('0x0'));var _=require(_0xff08('0x1'));module[_0xff08('0x2')]={'body':{'type':Sequelize['TEXT'](_0xff08('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xff08('0x4')]('medium')},'read':{'type':Sequelize[_0xff08('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xff08('0x3'))},'cc':{'type':Sequelize[_0xff08('0x4')](_0xff08('0x3'))},'bcc':{'type':Sequelize[_0xff08('0x4')](_0xff08('0x3'))},'subject':{'type':Sequelize[_0xff08('0x4')]},'sentAt':{'type':Sequelize[_0xff08('0x6')]},'attach':{'type':Sequelize[_0xff08('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xff08('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xff08('0x6')]},'originTo':{'type':Sequelize[_0xff08('0x4')](_0xff08('0x3'))},'originCc':{'type':Sequelize[_0xff08('0x4')](_0xff08('0x3'))},'originChannel':{'type':Sequelize[_0xff08('0x8')](_0xff08('0x9'),_0xff08('0xa')),'defaultValue':_0xff08('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index df8cff4..849edb5 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 _0x9da6=['event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','User','fullname','interface','rejectmessage','download','root','server','files','message-%s.eml','from','createdAt','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','readFileSync','writeFileSync','unlinkSync','eml-format','moment','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','end','stack','name','send','index','map','rawAttributes','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','MailMessage','includeAll','include','show','params','keys','options','find','describe','create','body','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','List','CmContact','List\x20not\x20found','sendMail','messageId','format','stringify','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','MailInteractionId','isNil','read1stAt','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','email','internal','manual','SIP/%s','channel','motionChannel'];(function(_0x1b53c6,_0x58622b){var _0x2b0345=function(_0x317231){while(--_0x317231){_0x1b53c6['push'](_0x1b53c6['shift']());}};_0x2b0345(++_0x58622b);}(_0x9da6,0x147));var _0x69da=function(_0xbc4037,_0x58f955){_0xbc4037=_0xbc4037-0x0;var _0x16a12c=_0x9da6[_0xbc4037];return _0x16a12c;};'use strict';var emlformat=require(_0x69da('0x0'));var moment=require(_0x69da('0x1'));var BPromise=require('bluebird');var util=require(_0x69da('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x69da('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x69da('0x4'));var qs=require(_0x69da('0x5'));var logger=require(_0x69da('0x6'))(_0x69da('0x7'));var interaction_log=require(_0x69da('0x6'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x69da('0x8'))['db'];config['redis']=_[_0x69da('0x9')](config[_0x69da('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x69da('0xb'))(new Redis(config['redis']));var htmlEntities=require(_0x69da('0xc'));require(_0x69da('0xd'))['register'](socket);var jayson=require(_0x69da('0xe'));var client=jayson[_0x69da('0xf')][_0x69da('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x69da('0x10')]({'port':0x232b});var client9002=jayson[_0x69da('0xf')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d46ba,_0x34652f,_0x1a43bb,_0x58fcba){return new BPromise(function(_0x59348c,_0x5acbaa){var _0x18a43a=_0x58fcba||client;return _0x18a43a['request'](_0x2d46ba,_0x1a43bb)[_0x69da('0x11')](function(_0x345661){logger[_0x69da('0x12')](_0x69da('0x13'),_0x34652f,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x34652f,'request\x20sent',JSON['stringify'](_0x345661));if(_0x345661[_0x69da('0x14')]){if(_0x345661[_0x69da('0x14')][_0x69da('0x15')]===0x1f4){logger[_0x69da('0x14')](_0x69da('0x13'),_0x34652f,_0x345661[_0x69da('0x14')][_0x69da('0x16')]);return _0x5acbaa(_0x345661[_0x69da('0x14')][_0x69da('0x16')]);}logger[_0x69da('0x14')](_0x69da('0x13'),_0x34652f,_0x345661[_0x69da('0x14')][_0x69da('0x16')]);return _0x59348c(_0x345661[_0x69da('0x14')][_0x69da('0x16')]);}else{logger[_0x69da('0x12')](_0x69da('0x13'),_0x34652f,_0x69da('0x17'));_0x59348c(_0x345661['result'][_0x69da('0x16')]);}})[_0x69da('0x18')](function(_0x181d31){logger['error'](_0x69da('0x13'),_0x34652f,_0x181d31);_0x5acbaa(_0x181d31);});});}function respondWithResult(_0x13dae7,_0x577e78){_0x577e78=_0x577e78||0xc8;return function(_0x4c6472){if(_0x4c6472){return _0x13dae7[_0x69da('0x19')](_0x577e78)[_0x69da('0x1a')](_0x4c6472);}};}function respondWithFilteredResult(_0x5b222d,_0x5ad2aa){return function(_0x15bac1){if(_0x15bac1){var _0x5b9ac6=typeof _0x5ad2aa[_0x69da('0x1b')]==='undefined'&&typeof _0x5ad2aa[_0x69da('0x1c')]===_0x69da('0x1d');var _0x2e4709=_0x15bac1[_0x69da('0x1e')];var _0x503ce2=_0x5b9ac6?0x0:_0x5ad2aa[_0x69da('0x1b')];var _0x3f5ee6=_0x5b9ac6?_0x15bac1[_0x69da('0x1e')]:_0x5ad2aa['offset']+_0x5ad2aa[_0x69da('0x1c')];var _0x2ea0d5;if(_0x3f5ee6>=_0x2e4709){_0x3f5ee6=_0x2e4709;_0x2ea0d5=0xc8;}else{_0x2ea0d5=0xce;}_0x5b222d[_0x69da('0x19')](_0x2ea0d5);return _0x5b222d[_0x69da('0x1f')](_0x69da('0x20'),_0x503ce2+'-'+_0x3f5ee6+'/'+_0x2e4709)[_0x69da('0x1a')](_0x15bac1);}return null;};}function saveUpdates(_0x205d66){return function(_0x4f2747){if(_0x4f2747){return _0x4f2747[_0x69da('0x21')](_0x205d66)['then'](function(_0x453900){return _0x453900;});}return null;};}function removeEntity(_0x45bd86){return function(_0x5565bd){if(_0x5565bd){return _0x5565bd['destroy']()[_0x69da('0x11')](function(){_0x45bd86['status'](0xcc)[_0x69da('0x22')]();});}};}function handleEntityNotFound(_0xf9242a){return function(_0x559cff){if(!_0x559cff){_0xf9242a['sendStatus'](0x194);}return _0x559cff;};}function handleError(_0x4afd86,_0xe26214){_0xe26214=_0xe26214||0x1f4;return function(_0x472010){logger[_0x69da('0x14')](_0x472010[_0x69da('0x23')]);if(_0x472010[_0x69da('0x24')]){delete _0x472010[_0x69da('0x24')];}_0x4afd86[_0x69da('0x19')](_0xe26214)[_0x69da('0x25')](_0x472010);};}exports[_0x69da('0x26')]=function(_0x2634fa,_0x18976b){var _0x134f57={},_0x348ece={},_0x55c42e={'count':0x0,'rows':[]};var _0x3e3047=_[_0x69da('0x27')](db['MailMessage'][_0x69da('0x28')],function(_0x313a22){return{'name':_0x313a22['fieldName'],'type':_0x313a22[_0x69da('0x29')]['key']};});_0x348ece['model']=_[_0x69da('0x27')](_0x3e3047,_0x69da('0x24'));_0x348ece[_0x69da('0x2a')]=_['keys'](_0x2634fa[_0x69da('0x2a')]);_0x348ece[_0x69da('0x2b')]=_[_0x69da('0x2c')](_0x348ece[_0x69da('0x2d')],_0x348ece[_0x69da('0x2a')]);_0x134f57['attributes']=_[_0x69da('0x2c')](_0x348ece[_0x69da('0x2d')],qs['fields'](_0x2634fa['query'][_0x69da('0x2e')]));_0x134f57['attributes']=_0x134f57[_0x69da('0x2f')][_0x69da('0x30')]?_0x134f57[_0x69da('0x2f')]:_0x348ece[_0x69da('0x2d')];if(!_0x2634fa[_0x69da('0x2a')][_0x69da('0x31')]('nolimit')){_0x134f57[_0x69da('0x1c')]=qs[_0x69da('0x1c')](_0x2634fa['query'][_0x69da('0x1c')]);_0x134f57[_0x69da('0x1b')]=qs[_0x69da('0x1b')](_0x2634fa[_0x69da('0x2a')]['offset']);}_0x134f57[_0x69da('0x32')]=qs[_0x69da('0x33')](_0x2634fa[_0x69da('0x2a')]['sort']);_0x134f57[_0x69da('0x34')]=qs['filters'](_[_0x69da('0x35')](_0x2634fa[_0x69da('0x2a')],_0x348ece['filters']),_0x3e3047);if(_0x2634fa[_0x69da('0x2a')][_0x69da('0x36')]){_0x134f57[_0x69da('0x34')]=_[_0x69da('0x37')](_0x134f57[_0x69da('0x34')],{'$or':_[_0x69da('0x27')](_0x3e3047,function(_0x49c723){if(_0x49c723['type']!=='VIRTUAL'){var _0x35e02a={};_0x35e02a[_0x49c723[_0x69da('0x24')]]={'$like':'%'+_0x2634fa[_0x69da('0x2a')][_0x69da('0x36')]+'%'};return _0x35e02a;}})});}_0x134f57=_[_0x69da('0x37')]({},_0x134f57,_0x2634fa['options']);var _0x8fc0b4={'where':_0x134f57['where']};return db[_0x69da('0x38')][_0x69da('0x1e')](_0x8fc0b4)['then'](function(_0x11f667){_0x55c42e[_0x69da('0x1e')]=_0x11f667;if(_0x2634fa['query'][_0x69da('0x39')]){_0x134f57[_0x69da('0x3a')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x134f57);})[_0x69da('0x11')](function(_0x1afb91){_0x55c42e['rows']=_0x1afb91;return _0x55c42e;})[_0x69da('0x11')](respondWithFilteredResult(_0x18976b,_0x134f57))[_0x69da('0x18')](handleError(_0x18976b,null));};exports[_0x69da('0x3b')]=function(_0x35eca9,_0xcb9fc7){var _0x13df23={'raw':!![],'where':{'id':_0x35eca9[_0x69da('0x3c')]['id']}},_0x1287b6={};_0x1287b6[_0x69da('0x2d')]=_[_0x69da('0x3d')](db[_0x69da('0x38')]['rawAttributes']);_0x1287b6[_0x69da('0x2a')]=_[_0x69da('0x3d')](_0x35eca9[_0x69da('0x2a')]);_0x1287b6[_0x69da('0x2b')]=_[_0x69da('0x2c')](_0x1287b6[_0x69da('0x2d')],_0x1287b6[_0x69da('0x2a')]);_0x13df23[_0x69da('0x2f')]=_[_0x69da('0x2c')](_0x1287b6[_0x69da('0x2d')],qs[_0x69da('0x2e')](_0x35eca9[_0x69da('0x2a')][_0x69da('0x2e')]));_0x13df23[_0x69da('0x2f')]=_0x13df23['attributes']['length']?_0x13df23[_0x69da('0x2f')]:_0x1287b6[_0x69da('0x2d')];if(_0x35eca9[_0x69da('0x2a')][_0x69da('0x39')]){_0x13df23[_0x69da('0x3a')]=[{'all':!![]}];}_0x13df23=_[_0x69da('0x37')]({},_0x13df23,_0x35eca9[_0x69da('0x3e')]);return db['MailMessage'][_0x69da('0x3f')](_0x13df23)['then'](handleEntityNotFound(_0xcb9fc7,null))[_0x69da('0x11')](respondWithResult(_0xcb9fc7,null))[_0x69da('0x18')](handleError(_0xcb9fc7,null));};exports[_0x69da('0x21')]=function(_0x238161,_0x5e1fb0){if(_0x238161['body']['id']){delete _0x238161['body']['id'];}return db[_0x69da('0x38')][_0x69da('0x3f')]({'where':{'id':_0x238161[_0x69da('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5e1fb0,null))[_0x69da('0x11')](saveUpdates(_0x238161['body'],null))[_0x69da('0x11')](respondWithResult(_0x5e1fb0,null))[_0x69da('0x18')](handleError(_0x5e1fb0,null));};exports['destroy']=function(_0x80eb91,_0x5729ef){return db['MailMessage']['find']({'where':{'id':_0x80eb91[_0x69da('0x3c')]['id']}})[_0x69da('0x11')](handleEntityNotFound(_0x5729ef,null))[_0x69da('0x11')](removeEntity(_0x5729ef,null))[_0x69da('0x18')](handleError(_0x5729ef,null));};exports[_0x69da('0x40')]=function(_0x14e22b,_0xd10d95){return db[_0x69da('0x38')][_0x69da('0x40')]()['then'](respondWithResult(_0xd10d95,null))[_0x69da('0x18')](handleError(_0xd10d95,null));};exports[_0x69da('0x41')]=function(_0x3cef00,_0x302e18){return db[_0x69da('0x38')][_0x69da('0x41')](_0x3cef00[_0x69da('0x42')])[_0x69da('0x11')](function(_0x3bcded){if(_0x3bcded){if(_0x3bcded['direction']===_0x69da('0x43')&&!_0x3bcded[_0x69da('0x44')]){var _0x1d6a5d,_0x5bff55,_0x5e1094;if(_0x3cef00[_0x69da('0x42')]['to']){_0x5bff55=_0x3cef00[_0x69da('0x42')]['to'][_0x69da('0x45')](',')[0x0];}return db[_0x69da('0x46')][_0x69da('0x47')]({'where':{'id':_0x3bcded[_0x69da('0x48')]},'include':[{'model':db[_0x69da('0x49')],'as':'List','include':[{'model':db['CmContact'],'as':_0x69da('0x4a'),'where':{'email':_0x5bff55},'limit':0x1,'order':[[_0x69da('0x4b'),_0x69da('0x4c')]]}]},{'model':db[_0x69da('0x4d')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x69da('0x4e'),'raw':!![]}]}]})[_0x69da('0x11')](function(_0x892d82){_0x1d6a5d=_0x892d82;if(!_0x1d6a5d||!_0x1d6a5d[_0x69da('0x4f')])return;var _0x21a001=_0x1d6a5d[_0x69da('0x50')]();if(_0x3cef00['body'][_0x69da('0x51')]&&_0x3cef00[_0x69da('0x42')][_0x69da('0x51')][_0x69da('0x30')]){for(var _0xec827=0x0;_0xec827<_0x3cef00[_0x69da('0x42')][_0x69da('0x51')]['length'];_0xec827+=0x1){_0x3cef00[_0x69da('0x42')][_0x69da('0x51')][_0xec827]={'filename':_0x3cef00[_0x69da('0x42')][_0x69da('0x51')][_0xec827][_0x69da('0x24')],'path':path[_0x69da('0x52')](config['root'],_0x69da('0x53'),_0x3cef00['body'][_0x69da('0x51')][_0xec827][_0x69da('0x54')])};}}_0x5e1094={'account':_0x21a001,'message':_0x3cef00[_0x69da('0x42')]};return;})[_0x69da('0x11')](function(){if(_0x1d6a5d[_0x69da('0x55')]){if(_0x1d6a5d['List'][_0x69da('0x4a')][_0x69da('0x30')]){return _0x1d6a5d[_0x69da('0x55')][_0x69da('0x4a')][0x0];}else{return db[_0x69da('0x56')]['create'](_[_0x69da('0x9')](_0x3cef00[_0x69da('0x42')],{'firstName':_0x3cef00[_0x69da('0x42')]['to'],'email':_0x3cef00['body']['to'],'phone':_0x3cef00[_0x69da('0x42')]['to'],'ListId':_0x1d6a5d['ListId']}));}}else{throw new Error(_0x69da('0x57'));}})[_0x69da('0x11')](function(){if(_0x5e1094){return respondWithRpcPromise('SendMail',_0x69da('0x58'),_0x5e1094,client9003)[_0x69da('0x11')](function(_0x5c9281){return _0x3bcded[_0x69da('0x21')]({'read':!![],'messageId':_0x5c9281[_0x69da('0x59')],'sentAt':moment()[_0x69da('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x69da('0x18')](function(_0x3a4d43){logger[_0x69da('0x14')]('%s',JSON[_0x69da('0x5b')](_0x3a4d43));return _0x3bcded;});}return _0x3bcded;});}return _0x3bcded;}})[_0x69da('0x11')](respondWithResult(_0x302e18,0xc9))[_0x69da('0x18')](handleError(_0x302e18,null));};exports[_0x69da('0x5c')]=function(_0x8cafb6,_0x376d33){var _0x1c699e={'agent':{},'channel':_0x69da('0x5d')};if(_0x8cafb6[_0x69da('0x42')]['id']){delete _0x8cafb6[_0x69da('0x42')]['id'];}_0x8cafb6[_0x69da('0x42')][_0x69da('0x5e')]=!![];_0x8cafb6['body']['readAt']=moment()['format'](_0x69da('0x5f'));_0x8cafb6[_0x69da('0x42')]['UserId']=_0x8cafb6[_0x69da('0x42')][_0x69da('0x60')]||_0x8cafb6['user']['id'];_0x1c699e[_0x69da('0x61')]['id']=_0x8cafb6[_0x69da('0x42')][_0x69da('0x60')];return db['MailMessage'][_0x69da('0x3f')]({'where':{'id':_0x8cafb6[_0x69da('0x3c')]['id'],'UserId':null}})[_0x69da('0x11')](handleEntityNotFound(_0x376d33,null))[_0x69da('0x11')](saveUpdates(_0x8cafb6[_0x69da('0x42')],null))[_0x69da('0x11')](function(_0x14f2d7){if(_0x14f2d7){_0x1c699e[_0x69da('0x16')]=_0x14f2d7['get']({'plain':!![]});return db['MailInteraction'][_0x69da('0x3f')]({'where':{'id':_0x14f2d7[_0x69da('0x62')]}});}return null;})[_0x69da('0x11')](handleEntityNotFound(_0x376d33,null))['then'](function(_0x1df4c5){if(_0x1df4c5){return _0x1df4c5[_0x69da('0x21')]({'UserId':_0x8cafb6[_0x69da('0x42')][_0x69da('0x60')],'read1stAt':_[_0x69da('0x63')](_0x1df4c5[_0x69da('0x64')])?moment()[_0x69da('0x5a')](_0x69da('0x5f')):undefined});}return null;})[_0x69da('0x11')](function(_0x31556c){if(_0x31556c){_0x1c699e[_0x69da('0x65')]=_0x31556c[_0x69da('0x66')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8cafb6[_0x69da('0x67')]['id'],_0x8cafb6[_0x69da('0x67')][_0x69da('0x24')],_0x8cafb6[_0x69da('0x67')][_0x69da('0x68')],_0x1c699e[_0x69da('0x65')]['id'],_0x8cafb6[_0x69da('0x42')]?JSON[_0x69da('0x5b')](_0x8cafb6[_0x69da('0x42')]):_0x69da('0x69'));return respondWithRpcPromise(_0x69da('0x6a'),_0x69da('0x6b'),_0x1c699e);}return null;})[_0x69da('0x11')](function(_0x1cb6f7){var _0xdafcb7=_0x69da('0x6c')+_0x1cb6f7['message']['ContactId'];return db['sequelize'][_0x69da('0x2a')](_0xdafcb7,{'type':db['Sequelize']['QueryTypes'][_0x69da('0x6d')],'raw':!![]})['then'](function(_0x1d2861){return _0x1d2861;});})[_0x69da('0x11')](function(_0x468a8d){if(_0x468a8d){_0x1c699e[_0x69da('0x16')][_0x69da('0x6e')]=_0x468a8d[0x0];if(!_0x8cafb6[_0x69da('0x42')][_0x69da('0x60')])return;return db['User'][_0x69da('0x3f')]({'where':{'id':_0x8cafb6['body'][_0x69da('0x60')],'role':_0x69da('0x61')},'attributes':['id',_0x69da('0x24'),'fullname',_0x69da('0x6f'),_0x69da('0x70')],'raw':!![]});}return null;})['then'](function(_0x2847b8){if(!_0x2847b8)return null;_0x1c699e[_0x69da('0x16')][_0x69da('0x61')]=_0x2847b8;return _0x1c699e;})['then'](function(_0x50bea3){if(_0x50bea3){if(_0x8cafb6[_0x69da('0x42')][_0x69da('0x71')]){_0x1c699e['message']['interface']=util[_0x69da('0x5a')](_0x69da('0x72'),_0x8cafb6['user'][_0x69da('0x24')]);_0x1c699e[_0x69da('0x16')][_0x69da('0x73')]=_0x1c699e[_0x69da('0x73')];_0x1c699e[_0x69da('0x16')][_0x69da('0x74')]=_0x1c699e[_0x69da('0x73')];_0x1c699e['message'][_0x69da('0x75')]=_0x69da('0x5c');_0x1c699e[_0x69da('0x16')][_0x69da('0x42')]=htmlToText[_0x69da('0x76')](_0x1c699e[_0x69da('0x16')][_0x69da('0x42')]);return respondWithRpcPromise(_0x69da('0x77'),'EventManager',{'event':'acceptmessage','message':_0x1c699e[_0x69da('0x16')]},client9002)['then'](function(){return _0x1c699e;});}return _0x1c699e;}return null;})[_0x69da('0x11')](respondWithResult(_0x376d33,null))[_0x69da('0x18')](handleError(_0x376d33,null));};exports[_0x69da('0x78')]=function(_0xa45332,_0x194a2a){var _0x565484={'agent':{},'channel':'mail'};if(_0xa45332[_0x69da('0x42')]['id']){delete _0xa45332['body']['id'];}_0xa45332[_0x69da('0x42')]['UserId']=_0xa45332['body'][_0x69da('0x60')]||_0xa45332[_0x69da('0x67')]['id'];_0x565484[_0x69da('0x61')]['id']=_0xa45332[_0x69da('0x42')][_0x69da('0x60')];return db[_0x69da('0x38')][_0x69da('0x3f')]({'where':{'id':_0xa45332[_0x69da('0x3c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x194a2a,null))[_0x69da('0x11')](function(_0x566c9b){if(_0x566c9b){_0x565484['message']=_0x566c9b[_0x69da('0x66')]({'plain':!![]});return db['MailInteraction'][_0x69da('0x3f')]({'where':{'id':_0x566c9b['MailInteractionId']}});}return null;})[_0x69da('0x11')](handleEntityNotFound(_0x194a2a,null))['then'](function(_0x58fc35){if(_0x58fc35){_0x565484['interaction']=_0x58fc35[_0x69da('0x66')]({'plain':!![]});interaction_log[_0x69da('0x12')](_0x69da('0x79'),_0xa45332[_0x69da('0x67')]['id'],_0xa45332['user']['name'],_0xa45332[_0x69da('0x67')][_0x69da('0x68')],_0x565484[_0x69da('0x65')]['id'],_0xa45332['body']?JSON['stringify'](_0xa45332[_0x69da('0x42')]):_0x69da('0x69'));return respondWithRpcPromise(_0x69da('0x7a'),_0x69da('0x7b'),_0x565484);}return null;})[_0x69da('0x11')](function(_0x42dd3b){var _0x342a19=_0x69da('0x6c')+_0x42dd3b[_0x69da('0x16')]['ContactId'];return db[_0x69da('0x7c')][_0x69da('0x2a')](_0x342a19,{'type':db['Sequelize'][_0x69da('0x7d')][_0x69da('0x6d')],'raw':!![]})[_0x69da('0x11')](function(_0x30fe75){return _0x30fe75;});})[_0x69da('0x11')](function(_0x333e1a){if(_0x333e1a){_0x565484[_0x69da('0x16')][_0x69da('0x6e')]=_0x333e1a[0x0];if(!_0xa45332[_0x69da('0x42')][_0x69da('0x60')])return;return db[_0x69da('0x7e')][_0x69da('0x3f')]({'where':{'id':_0xa45332['body'][_0x69da('0x60')],'role':_0x69da('0x61')},'attributes':['id','name',_0x69da('0x7f'),_0x69da('0x6f'),_0x69da('0x70')],'raw':!![]});}return null;})['then'](function(_0x36a42f){if(!_0x36a42f)return null;_0x565484['message'][_0x69da('0x61')]=_0x36a42f;return _0x565484;})['then'](function(_0x299ed5){if(_0x299ed5){_0x299ed5[_0x69da('0x16')][_0x69da('0x80')]=util[_0x69da('0x5a')]('SIP/%s',_0xa45332[_0x69da('0x67')][_0x69da('0x24')]);_0x299ed5[_0x69da('0x16')][_0x69da('0x73')]=_0x565484[_0x69da('0x73')];_0x299ed5[_0x69da('0x16')]['motionChannel']=_0x565484[_0x69da('0x73')];_0x299ed5[_0x69da('0x16')][_0x69da('0x75')]=_0x69da('0x78');_0x299ed5[_0x69da('0x16')][_0x69da('0x42')]=htmlToText[_0x69da('0x76')](_0x565484['message'][_0x69da('0x42')]);respondWithRpcPromise('EventManager',_0x69da('0x77'),{'event':_0x69da('0x81'),'message':_0x299ed5['message']},client9002);return _0x565484;}return null;})[_0x69da('0x11')](respondWithResult(_0x194a2a,null))[_0x69da('0x18')](handleError(_0x194a2a,null));};exports[_0x69da('0x82')]=function(_0x17405f,_0x4e4cee){var _0x3134ab=moment()['unix']()['toString']();var _0x41b1b6=path['join'](config[_0x69da('0x83')],_0x69da('0x84'),_0x69da('0x85'),'tmp');var _0x3e577b=path[_0x69da('0x52')](config[_0x69da('0x83')],'server',_0x69da('0x85'),_0x69da('0x51'));var _0x26ef22=util[_0x69da('0x5a')](_0x69da('0x86'),_0x3134ab);return db[_0x69da('0x38')][_0x69da('0x3f')]({'where':{'id':_0x17405f['params']['id']},'attributes':['id',_0x69da('0x42'),_0x69da('0x87'),'to','cc','bcc','subject',_0x69da('0x88')],'include':_0x17405f[_0x69da('0x2a')][_0x69da('0x51')]?[{'model':db['Attachment'],'as':_0x69da('0x89')}]:undefined})[_0x69da('0x11')](handleEntityNotFound(_0x4e4cee,null))[_0x69da('0x11')](function(_0x5c506d){if(_0x5c506d){var _0x297823=_0x5c506d;var _0x4d39d5={'from':_0x297823[_0x69da('0x87')],'to':_0x297823['to'],'subject':_0x297823[_0x69da('0x8a')],'html':htmlEntities[_0x69da('0x8b')](_0x297823['body']),'headers':{'Date':moment(_0x297823['createdAt'])['format'](_0x69da('0x8c'))},'attachments':[]};if(_0x5c506d['cc']){_0x4d39d5[_0x69da('0x8d')]['Cc']=_0x5c506d['cc'];}if(_0x5c506d[_0x69da('0x8e')]){_0x4d39d5[_0x69da('0x8d')][_0x69da('0x8f')]=_0x5c506d[_0x69da('0x8e')];}return new BPromise(function(_0x27ef23,_0x1a3721){if(_0x5c506d[_0x69da('0x89')]){for(var _0x4e62df=0x0;_0x4e62df<_0x5c506d['Attachments']['length'];_0x4e62df++){var _0x47a3ae=_0x5c506d[_0x69da('0x89')][_0x4e62df];var _0x148dd5=path[_0x69da('0x52')](_0x3e577b,_0x47a3ae[_0x69da('0x54')]);if(fs[_0x69da('0x90')](_0x148dd5)){_0x4d39d5['attachments']['push']({'name':_0x47a3ae['name'],'contentType':_0x47a3ae['type'],'data':fs[_0x69da('0x91')](_0x148dd5)});}}}emlformat['build'](_0x4d39d5,function(_0x281daa,_0x4caeca){if(_0x281daa)return _0x1a3721(_0x281daa);fs[_0x69da('0x92')](path[_0x69da('0x52')](_0x41b1b6,_0x26ef22),_0x4caeca);return _0x27ef23(_0x4caeca);});});}})[_0x69da('0x11')](function(_0xfbffb4){if(_0xfbffb4){return _0x4e4cee['download'](path['join'](_0x41b1b6,_0x26ef22),_0x26ef22,function(_0x5322d1){if(!_0x5322d1)fs[_0x69da('0x93')](path[_0x69da('0x52')](_0x41b1b6,_0x26ef22));});}})['catch'](handleError(_0x4e4cee,null));}; \ No newline at end of file +var _0x476c=['rejectMessage','User','email','rejectmessage','download','root','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','unlinkSync','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','MailMessage,\x20%s,\x20%s','result','status','json','undefined','count','offset','limit','set','Content-Range','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','update','body','describe','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','updatedAt','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','Contacts','CmContact','create','List\x20not\x20found','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','user','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x3b688c,_0x57f2f0){var _0x2d45a6=function(_0x2f9d82){while(--_0x2f9d82){_0x3b688c['push'](_0x3b688c['shift']());}};_0x2d45a6(++_0x57f2f0);}(_0x476c,0x154));var _0xc476=function(_0x4fa0ae,_0x154356){_0x4fa0ae=_0x4fa0ae-0x0;var _0x198f42=_0x476c[_0x4fa0ae];return _0x198f42;};'use strict';var emlformat=require('eml-format');var moment=require(_0xc476('0x0'));var BPromise=require(_0xc476('0x1'));var util=require(_0xc476('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xc476('0x3'));var Redis=require(_0xc476('0x4'));var htmlToText=require(_0xc476('0x5'));var qs=require(_0xc476('0x6'));var logger=require('../../config/logger')(_0xc476('0x7'));var interaction_log=require(_0xc476('0x8'))(_0xc476('0x9'));var config=require(_0xc476('0xa'));var db=require(_0xc476('0xb'))['db'];config[_0xc476('0xc')]=_[_0xc476('0xd')](config[_0xc476('0xc')],{'host':_0xc476('0xe'),'port':0x18eb});var socket=require(_0xc476('0xf'))(new Redis(config[_0xc476('0xc')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xc476('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc476('0x11')][_0xc476('0x12')]({'port':0x232c});var client9003=jayson[_0xc476('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xc476('0x11')][_0xc476('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x4a674e,_0x4bdaa7,_0x473b2d,_0x5bc1f5){return new BPromise(function(_0x4c84f3,_0x425fee){var _0x4ad4c0=_0x5bc1f5||client;return _0x4ad4c0[_0xc476('0x13')](_0x4a674e,_0x473b2d)[_0xc476('0x14')](function(_0x15ec8a){logger[_0xc476('0x15')]('MailMessage,\x20%s,\x20%s',_0x4bdaa7,_0xc476('0x16'));logger[_0xc476('0x17')](_0xc476('0x18'),_0x4bdaa7,_0xc476('0x16'),JSON['stringify'](_0x15ec8a));if(_0x15ec8a[_0xc476('0x19')]){if(_0x15ec8a[_0xc476('0x19')][_0xc476('0x1a')]===0x1f4){logger[_0xc476('0x19')]('MailMessage,\x20%s,\x20%s',_0x4bdaa7,_0x15ec8a['error'][_0xc476('0x1b')]);return _0x425fee(_0x15ec8a[_0xc476('0x19')][_0xc476('0x1b')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x4bdaa7,_0x15ec8a[_0xc476('0x19')]['message']);return _0x4c84f3(_0x15ec8a[_0xc476('0x19')][_0xc476('0x1b')]);}else{logger[_0xc476('0x15')](_0xc476('0x1c'),_0x4bdaa7,_0xc476('0x16'));_0x4c84f3(_0x15ec8a[_0xc476('0x1d')][_0xc476('0x1b')]);}})['catch'](function(_0xed80a4){logger[_0xc476('0x19')](_0xc476('0x1c'),_0x4bdaa7,_0xed80a4);_0x425fee(_0xed80a4);});});}function respondWithResult(_0x1f6c49,_0x2082c0){_0x2082c0=_0x2082c0||0xc8;return function(_0x4038ee){if(_0x4038ee){return _0x1f6c49[_0xc476('0x1e')](_0x2082c0)[_0xc476('0x1f')](_0x4038ee);}};}function respondWithFilteredResult(_0xb2dbeb,_0x362869){return function(_0x398d5a){if(_0x398d5a){var _0x3fddcc=typeof _0x362869['offset']===_0xc476('0x20')&&typeof _0x362869['limit']===_0xc476('0x20');var _0x2e872f=_0x398d5a[_0xc476('0x21')];var _0x24bf10=_0x3fddcc?0x0:_0x362869[_0xc476('0x22')];var _0x57be72=_0x3fddcc?_0x398d5a[_0xc476('0x21')]:_0x362869['offset']+_0x362869[_0xc476('0x23')];var _0x34107a;if(_0x57be72>=_0x2e872f){_0x57be72=_0x2e872f;_0x34107a=0xc8;}else{_0x34107a=0xce;}_0xb2dbeb['status'](_0x34107a);return _0xb2dbeb[_0xc476('0x24')](_0xc476('0x25'),_0x24bf10+'-'+_0x57be72+'/'+_0x2e872f)[_0xc476('0x1f')](_0x398d5a);}return null;};}function saveUpdates(_0x43c080){return function(_0x20398d){if(_0x20398d){return _0x20398d['update'](_0x43c080)[_0xc476('0x14')](function(_0x415fd4){return _0x415fd4;});}return null;};}function removeEntity(_0x36a119){return function(_0x701157){if(_0x701157){return _0x701157[_0xc476('0x26')]()[_0xc476('0x14')](function(){_0x36a119[_0xc476('0x1e')](0xcc)[_0xc476('0x27')]();});}};}function handleEntityNotFound(_0x3019c0){return function(_0x24963d){if(!_0x24963d){_0x3019c0['sendStatus'](0x194);}return _0x24963d;};}function handleError(_0x4535af,_0x5d157e){_0x5d157e=_0x5d157e||0x1f4;return function(_0x455f51){logger[_0xc476('0x19')](_0x455f51[_0xc476('0x28')]);if(_0x455f51[_0xc476('0x29')]){delete _0x455f51['name'];}_0x4535af[_0xc476('0x1e')](_0x5d157e)[_0xc476('0x2a')](_0x455f51);};}exports[_0xc476('0x2b')]=function(_0x4a0fa1,_0x3ad035){var _0x1edd1d={},_0x47df17={},_0xf7b0e2={'count':0x0,'rows':[]};var _0x6b0a82=_[_0xc476('0x2c')](db[_0xc476('0x2d')][_0xc476('0x2e')],function(_0x2a07b3){return{'name':_0x2a07b3[_0xc476('0x2f')],'type':_0x2a07b3[_0xc476('0x30')][_0xc476('0x31')]};});_0x47df17[_0xc476('0x32')]=_[_0xc476('0x2c')](_0x6b0a82,_0xc476('0x29'));_0x47df17[_0xc476('0x33')]=_[_0xc476('0x34')](_0x4a0fa1[_0xc476('0x33')]);_0x47df17[_0xc476('0x35')]=_['intersection'](_0x47df17[_0xc476('0x32')],_0x47df17[_0xc476('0x33')]);_0x1edd1d['attributes']=_[_0xc476('0x36')](_0x47df17[_0xc476('0x32')],qs[_0xc476('0x37')](_0x4a0fa1['query'][_0xc476('0x37')]));_0x1edd1d['attributes']=_0x1edd1d['attributes']['length']?_0x1edd1d[_0xc476('0x38')]:_0x47df17['model'];if(!_0x4a0fa1['query'][_0xc476('0x39')](_0xc476('0x3a'))){_0x1edd1d['limit']=qs[_0xc476('0x23')](_0x4a0fa1[_0xc476('0x33')][_0xc476('0x23')]);_0x1edd1d[_0xc476('0x22')]=qs[_0xc476('0x22')](_0x4a0fa1[_0xc476('0x33')][_0xc476('0x22')]);}_0x1edd1d['order']=qs[_0xc476('0x3b')](_0x4a0fa1[_0xc476('0x33')]['sort']);_0x1edd1d[_0xc476('0x3c')]=qs['filters'](_['pick'](_0x4a0fa1['query'],_0x47df17[_0xc476('0x35')]),_0x6b0a82);if(_0x4a0fa1[_0xc476('0x33')]['filter']){_0x1edd1d[_0xc476('0x3c')]=_[_0xc476('0x3d')](_0x1edd1d[_0xc476('0x3c')],{'$or':_['map'](_0x6b0a82,function(_0x3ada72){if(_0x3ada72[_0xc476('0x30')]!=='VIRTUAL'){var _0x4c9d1a={};_0x4c9d1a[_0x3ada72[_0xc476('0x29')]]={'$like':'%'+_0x4a0fa1[_0xc476('0x33')][_0xc476('0x3e')]+'%'};return _0x4c9d1a;}})});}_0x1edd1d=_['merge']({},_0x1edd1d,_0x4a0fa1[_0xc476('0x3f')]);var _0x1acfb0={'where':_0x1edd1d[_0xc476('0x3c')]};return db[_0xc476('0x2d')][_0xc476('0x21')](_0x1acfb0)[_0xc476('0x14')](function(_0x507b06){_0xf7b0e2[_0xc476('0x21')]=_0x507b06;if(_0x4a0fa1[_0xc476('0x33')][_0xc476('0x40')]){_0x1edd1d[_0xc476('0x41')]=[{'all':!![]}];}return db[_0xc476('0x2d')][_0xc476('0x42')](_0x1edd1d);})[_0xc476('0x14')](function(_0x9c98b4){_0xf7b0e2[_0xc476('0x43')]=_0x9c98b4;return _0xf7b0e2;})['then'](respondWithFilteredResult(_0x3ad035,_0x1edd1d))[_0xc476('0x44')](handleError(_0x3ad035,null));};exports[_0xc476('0x45')]=function(_0x2327a5,_0x356bcf){var _0x142069={'raw':!![],'where':{'id':_0x2327a5[_0xc476('0x46')]['id']}},_0x24a102={};_0x24a102[_0xc476('0x32')]=_['keys'](db[_0xc476('0x2d')]['rawAttributes']);_0x24a102['query']=_[_0xc476('0x34')](_0x2327a5[_0xc476('0x33')]);_0x24a102['filters']=_[_0xc476('0x36')](_0x24a102[_0xc476('0x32')],_0x24a102[_0xc476('0x33')]);_0x142069['attributes']=_[_0xc476('0x36')](_0x24a102[_0xc476('0x32')],qs[_0xc476('0x37')](_0x2327a5[_0xc476('0x33')][_0xc476('0x37')]));_0x142069[_0xc476('0x38')]=_0x142069[_0xc476('0x38')][_0xc476('0x47')]?_0x142069[_0xc476('0x38')]:_0x24a102[_0xc476('0x32')];if(_0x2327a5[_0xc476('0x33')][_0xc476('0x40')]){_0x142069[_0xc476('0x41')]=[{'all':!![]}];}_0x142069=_[_0xc476('0x3d')]({},_0x142069,_0x2327a5[_0xc476('0x3f')]);return db[_0xc476('0x2d')][_0xc476('0x48')](_0x142069)[_0xc476('0x14')](handleEntityNotFound(_0x356bcf,null))[_0xc476('0x14')](respondWithResult(_0x356bcf,null))['catch'](handleError(_0x356bcf,null));};exports[_0xc476('0x49')]=function(_0x372685,_0x263a28){if(_0x372685[_0xc476('0x4a')]['id']){delete _0x372685[_0xc476('0x4a')]['id'];}return db[_0xc476('0x2d')][_0xc476('0x48')]({'where':{'id':_0x372685[_0xc476('0x46')]['id']}})[_0xc476('0x14')](handleEntityNotFound(_0x263a28,null))['then'](saveUpdates(_0x372685[_0xc476('0x4a')],null))['then'](respondWithResult(_0x263a28,null))['catch'](handleError(_0x263a28,null));};exports[_0xc476('0x26')]=function(_0x4bbb2c,_0x1255d5){return db[_0xc476('0x2d')][_0xc476('0x48')]({'where':{'id':_0x4bbb2c[_0xc476('0x46')]['id']}})[_0xc476('0x14')](handleEntityNotFound(_0x1255d5,null))[_0xc476('0x14')](removeEntity(_0x1255d5,null))[_0xc476('0x44')](handleError(_0x1255d5,null));};exports[_0xc476('0x4b')]=function(_0x36bb08,_0x292b9c){return db[_0xc476('0x2d')]['describe']()['then'](respondWithResult(_0x292b9c,null))['catch'](handleError(_0x292b9c,null));};exports['create']=function(_0x4212a9,_0x29e4d7){return db[_0xc476('0x2d')]['create'](_0x4212a9[_0xc476('0x4a')])['then'](function(_0x221c03){if(_0x221c03){if(_0x221c03[_0xc476('0x4c')]===_0xc476('0x4d')&&!_0x221c03[_0xc476('0x4e')]){var _0x43cb47,_0x160c65,_0x3af3de;if(_0x4212a9[_0xc476('0x4a')]['to']){_0x160c65=_0x4212a9['body']['to'][_0xc476('0x4f')](',')[0x0];}return db[_0xc476('0x50')][_0xc476('0x51')]({'where':{'id':_0x221c03[_0xc476('0x52')]},'include':[{'model':db[_0xc476('0x53')],'as':_0xc476('0x54'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x160c65},'limit':0x1,'order':[[_0xc476('0x55'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc476('0x56'),'raw':!![]}]}]})[_0xc476('0x14')](function(_0x31344f){_0x43cb47=_0x31344f;if(!_0x43cb47||!_0x43cb47['Smtp'])return;var _0x3059e2=_0x43cb47[_0xc476('0x57')]();if(_0x4212a9[_0xc476('0x4a')][_0xc476('0x58')]&&_0x4212a9[_0xc476('0x4a')][_0xc476('0x58')][_0xc476('0x47')]){for(var _0x4db7e5=0x0;_0x4db7e5<_0x4212a9['body']['attachments'][_0xc476('0x47')];_0x4db7e5+=0x1){_0x4212a9[_0xc476('0x4a')][_0xc476('0x58')][_0x4db7e5]={'filename':_0x4212a9['body'][_0xc476('0x58')][_0x4db7e5]['name'],'path':path[_0xc476('0x59')](config['root'],_0xc476('0x5a'),_0x4212a9['body']['attachments'][_0x4db7e5][_0xc476('0x5b')])};}}_0x3af3de={'account':_0x3059e2,'message':_0x4212a9[_0xc476('0x4a')]};return;})[_0xc476('0x14')](function(){if(_0x43cb47['List']){if(_0x43cb47[_0xc476('0x54')][_0xc476('0x5c')][_0xc476('0x47')]){return _0x43cb47[_0xc476('0x54')][_0xc476('0x5c')][0x0];}else{return db[_0xc476('0x5d')][_0xc476('0x5e')](_[_0xc476('0xd')](_0x4212a9[_0xc476('0x4a')],{'firstName':_0x4212a9['body']['to'],'email':_0x4212a9[_0xc476('0x4a')]['to'],'phone':_0x4212a9[_0xc476('0x4a')]['to'],'ListId':_0x43cb47['ListId']}));}}else{throw new Error(_0xc476('0x5f'));}})[_0xc476('0x14')](function(){if(_0x3af3de){return respondWithRpcPromise('SendMail',_0xc476('0x60'),_0x3af3de,client9003)[_0xc476('0x14')](function(_0x29a4c3){return _0x221c03['update']({'read':!![],'messageId':_0x29a4c3['messageId'],'sentAt':moment()[_0xc476('0x61')](_0xc476('0x62'))});})['catch'](function(_0x10d0ba){logger[_0xc476('0x19')]('%s',JSON[_0xc476('0x63')](_0x10d0ba));return _0x221c03;});}return _0x221c03;});}return _0x221c03;}})[_0xc476('0x14')](respondWithResult(_0x29e4d7,0xc9))[_0xc476('0x44')](handleError(_0x29e4d7,null));};exports[_0xc476('0x64')]=function(_0x1a64b2,_0xd78b84){var _0x14e303={'agent':{},'channel':'mail'};if(_0x1a64b2[_0xc476('0x4a')]['id']){delete _0x1a64b2[_0xc476('0x4a')]['id'];}_0x1a64b2[_0xc476('0x4a')][_0xc476('0x65')]=!![];_0x1a64b2[_0xc476('0x4a')][_0xc476('0x66')]=moment()[_0xc476('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a64b2[_0xc476('0x4a')]['UserId']=_0x1a64b2[_0xc476('0x4a')]['UserId']||_0x1a64b2[_0xc476('0x67')]['id'];_0x14e303['agent']['id']=_0x1a64b2[_0xc476('0x4a')][_0xc476('0x68')];return db[_0xc476('0x2d')]['find']({'where':{'id':_0x1a64b2[_0xc476('0x46')]['id'],'UserId':null}})[_0xc476('0x14')](handleEntityNotFound(_0xd78b84,null))['then'](saveUpdates(_0x1a64b2[_0xc476('0x4a')],null))[_0xc476('0x14')](function(_0x1d2293){if(_0x1d2293){_0x14e303[_0xc476('0x1b')]=_0x1d2293[_0xc476('0x69')]({'plain':!![]});return db[_0xc476('0x6a')][_0xc476('0x48')]({'where':{'id':_0x1d2293[_0xc476('0x6b')]}});}return null;})[_0xc476('0x14')](handleEntityNotFound(_0xd78b84,null))['then'](function(_0x881d5c){if(_0x881d5c){return _0x881d5c[_0xc476('0x49')]({'UserId':_0x1a64b2['body']['UserId'],'read1stAt':_['isNil'](_0x881d5c[_0xc476('0x6c')])?moment()[_0xc476('0x61')](_0xc476('0x62')):undefined});}return null;})['then'](function(_0x30af77){if(_0x30af77){_0x14e303[_0xc476('0x6d')]=_0x30af77[_0xc476('0x69')]({'plain':!![]});interaction_log[_0xc476('0x15')](_0xc476('0x6e'),_0x1a64b2[_0xc476('0x67')]['id'],_0x1a64b2['user']['name'],_0x1a64b2[_0xc476('0x67')][_0xc476('0x6f')],_0x14e303[_0xc476('0x6d')]['id'],_0x1a64b2['body']?JSON['stringify'](_0x1a64b2[_0xc476('0x4a')]):_0xc476('0x70'));return respondWithRpcPromise(_0xc476('0x71'),_0xc476('0x72'),_0x14e303);}return null;})[_0xc476('0x14')](function(_0x2520da){var _0x365dd1=_0xc476('0x73')+_0x2520da[_0xc476('0x1b')][_0xc476('0x74')];return db[_0xc476('0x75')][_0xc476('0x33')](_0x365dd1,{'type':db[_0xc476('0x76')][_0xc476('0x77')][_0xc476('0x78')],'raw':!![]})[_0xc476('0x14')](function(_0x52a288){return _0x52a288;});})[_0xc476('0x14')](function(_0x32f682){if(_0x32f682){_0x14e303[_0xc476('0x1b')][_0xc476('0x79')]=_0x32f682[0x0];if(!_0x1a64b2[_0xc476('0x4a')][_0xc476('0x68')])return;return db['User'][_0xc476('0x48')]({'where':{'id':_0x1a64b2[_0xc476('0x4a')]['UserId'],'role':_0xc476('0x7a')},'attributes':['id',_0xc476('0x29'),_0xc476('0x7b'),'email',_0xc476('0x7c')],'raw':!![]});}return null;})[_0xc476('0x14')](function(_0x364934){if(!_0x364934)return null;_0x14e303['message'][_0xc476('0x7a')]=_0x364934;return _0x14e303;})[_0xc476('0x14')](function(_0x2bfe25){if(_0x2bfe25){if(_0x1a64b2['body'][_0xc476('0x7d')]){_0x14e303['message'][_0xc476('0x7e')]=util[_0xc476('0x61')](_0xc476('0x7f'),_0x1a64b2[_0xc476('0x67')][_0xc476('0x29')]);_0x14e303['message'][_0xc476('0x80')]=_0x14e303['channel'];_0x14e303['message'][_0xc476('0x81')]=_0x14e303[_0xc476('0x80')];_0x14e303[_0xc476('0x1b')][_0xc476('0x82')]='accept';_0x14e303[_0xc476('0x1b')][_0xc476('0x4a')]=htmlToText[_0xc476('0x83')](_0x14e303['message'][_0xc476('0x4a')]);return respondWithRpcPromise(_0xc476('0x84'),_0xc476('0x84'),{'event':_0xc476('0x85'),'message':_0x14e303[_0xc476('0x1b')]},client9002)['then'](function(){return _0x14e303;});}return _0x14e303;}return null;})['then'](respondWithResult(_0xd78b84,null))[_0xc476('0x44')](handleError(_0xd78b84,null));};exports[_0xc476('0x86')]=function(_0x154e68,_0x153bd1){var _0x1c364e={'agent':{},'channel':_0xc476('0x87')};if(_0x154e68[_0xc476('0x4a')]['id']){delete _0x154e68[_0xc476('0x4a')]['id'];}_0x154e68[_0xc476('0x4a')][_0xc476('0x68')]=_0x154e68[_0xc476('0x4a')][_0xc476('0x68')]||_0x154e68['user']['id'];_0x1c364e[_0xc476('0x7a')]['id']=_0x154e68['body']['UserId'];return db[_0xc476('0x2d')]['find']({'where':{'id':_0x154e68[_0xc476('0x46')]['id'],'UserId':null}})[_0xc476('0x14')](handleEntityNotFound(_0x153bd1,null))[_0xc476('0x14')](function(_0x2bc98c){if(_0x2bc98c){_0x1c364e['message']=_0x2bc98c['get']({'plain':!![]});return db[_0xc476('0x6a')][_0xc476('0x48')]({'where':{'id':_0x2bc98c[_0xc476('0x6b')]}});}return null;})[_0xc476('0x14')](handleEntityNotFound(_0x153bd1,null))['then'](function(_0x14dfba){if(_0x14dfba){_0x1c364e[_0xc476('0x6d')]=_0x14dfba[_0xc476('0x69')]({'plain':!![]});interaction_log[_0xc476('0x15')](_0xc476('0x88'),_0x154e68[_0xc476('0x67')]['id'],_0x154e68[_0xc476('0x67')][_0xc476('0x29')],_0x154e68[_0xc476('0x67')]['role'],_0x1c364e['interaction']['id'],_0x154e68[_0xc476('0x4a')]?JSON[_0xc476('0x63')](_0x154e68['body']):_0xc476('0x70'));return respondWithRpcPromise('RejectMessage',_0xc476('0x89'),_0x1c364e);}return null;})[_0xc476('0x14')](function(_0x3026be){var _0x46e8fc=_0xc476('0x73')+_0x3026be[_0xc476('0x1b')][_0xc476('0x74')];return db[_0xc476('0x75')][_0xc476('0x33')](_0x46e8fc,{'type':db['Sequelize'][_0xc476('0x77')][_0xc476('0x78')],'raw':!![]})['then'](function(_0x40e59d){return _0x40e59d;});})[_0xc476('0x14')](function(_0x3a6902){if(_0x3a6902){_0x1c364e[_0xc476('0x1b')][_0xc476('0x79')]=_0x3a6902[0x0];if(!_0x154e68[_0xc476('0x4a')][_0xc476('0x68')])return;return db[_0xc476('0x8a')][_0xc476('0x48')]({'where':{'id':_0x154e68[_0xc476('0x4a')][_0xc476('0x68')],'role':'agent'},'attributes':['id',_0xc476('0x29'),_0xc476('0x7b'),_0xc476('0x8b'),_0xc476('0x7c')],'raw':!![]});}return null;})[_0xc476('0x14')](function(_0x2802ac){if(!_0x2802ac)return null;_0x1c364e[_0xc476('0x1b')][_0xc476('0x7a')]=_0x2802ac;return _0x1c364e;})[_0xc476('0x14')](function(_0x34d710){if(_0x34d710){_0x34d710[_0xc476('0x1b')][_0xc476('0x7e')]=util['format'](_0xc476('0x7f'),_0x154e68[_0xc476('0x67')]['name']);_0x34d710[_0xc476('0x1b')][_0xc476('0x80')]=_0x1c364e[_0xc476('0x80')];_0x34d710['message'][_0xc476('0x81')]=_0x1c364e[_0xc476('0x80')];_0x34d710[_0xc476('0x1b')]['event']=_0xc476('0x86');_0x34d710[_0xc476('0x1b')][_0xc476('0x4a')]=htmlToText[_0xc476('0x83')](_0x1c364e[_0xc476('0x1b')][_0xc476('0x4a')]);respondWithRpcPromise(_0xc476('0x84'),'EventManager',{'event':_0xc476('0x8c'),'message':_0x34d710[_0xc476('0x1b')]},client9002);return _0x1c364e;}return null;})['then'](respondWithResult(_0x153bd1,null))[_0xc476('0x44')](handleError(_0x153bd1,null));};exports[_0xc476('0x8d')]=function(_0x505791,_0x25fb03){var _0x5c5f8b=moment()['unix']()['toString']();var _0x31fb81=path[_0xc476('0x59')](config[_0xc476('0x8e')],_0xc476('0x8f'),_0xc476('0x90'),_0xc476('0x91'));var _0x46db8f=path['join'](config[_0xc476('0x8e')],'server','files',_0xc476('0x58'));var _0x11c1e6=util['format'](_0xc476('0x92'),_0x5c5f8b);return db[_0xc476('0x2d')]['find']({'where':{'id':_0x505791['params']['id']},'attributes':['id','body','from','to','cc',_0xc476('0x93'),'subject',_0xc476('0x94')],'include':_0x505791[_0xc476('0x33')][_0xc476('0x58')]?[{'model':db[_0xc476('0x95')],'as':_0xc476('0x96')}]:undefined})[_0xc476('0x14')](handleEntityNotFound(_0x25fb03,null))[_0xc476('0x14')](function(_0x137b8f){if(_0x137b8f){var _0x3a2b1d=_0x137b8f;var _0x1a4949={'from':_0x3a2b1d[_0xc476('0x97')],'to':_0x3a2b1d['to'],'subject':_0x3a2b1d['subject'],'html':htmlEntities[_0xc476('0x98')](_0x3a2b1d[_0xc476('0x4a')]),'headers':{'Date':moment(_0x3a2b1d[_0xc476('0x94')])[_0xc476('0x61')](_0xc476('0x99'))},'attachments':[]};if(_0x137b8f['cc']){_0x1a4949[_0xc476('0x9a')]['Cc']=_0x137b8f['cc'];}if(_0x137b8f[_0xc476('0x93')]){_0x1a4949[_0xc476('0x9a')][_0xc476('0x9b')]=_0x137b8f[_0xc476('0x93')];}return new BPromise(function(_0x28c671,_0x56c706){if(_0x137b8f[_0xc476('0x96')]){for(var _0x405ee5=0x0;_0x405ee5<_0x137b8f['Attachments'][_0xc476('0x47')];_0x405ee5++){var _0x57ed4d=_0x137b8f[_0xc476('0x96')][_0x405ee5];var _0xe695b1=path[_0xc476('0x59')](_0x46db8f,_0x57ed4d[_0xc476('0x5b')]);if(fs[_0xc476('0x9c')](_0xe695b1)){_0x1a4949[_0xc476('0x58')][_0xc476('0x9d')]({'name':_0x57ed4d['name'],'contentType':_0x57ed4d[_0xc476('0x30')],'data':fs['readFileSync'](_0xe695b1)});}}}emlformat['build'](_0x1a4949,function(_0x48f3fb,_0x3d6ea6){if(_0x48f3fb)return _0x56c706(_0x48f3fb);fs['writeFileSync'](path[_0xc476('0x59')](_0x31fb81,_0x11c1e6),_0x3d6ea6);return _0x28c671(_0x3d6ea6);});});}})[_0xc476('0x14')](function(_0x585b35){if(_0x585b35){return _0x25fb03[_0xc476('0x8d')](path[_0xc476('0x59')](_0x31fb81,_0x11c1e6),_0x11c1e6,function(_0x3627d9){if(!_0x3627d9)fs[_0xc476('0x9e')](path[_0xc476('0x59')](_0x31fb81,_0x11c1e6));});}})[_0xc476('0x44')](handleError(_0x25fb03,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 975c50b..40df0b2 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 _0x64a9=['hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners','save','remove','emit'];(function(_0x5c74ef,_0x2077e7){var _0x5ec55e=function(_0x4bf83a){while(--_0x4bf83a){_0x5c74ef['push'](_0x5c74ef['shift']());}};_0x5ec55e(++_0x2077e7);}(_0x64a9,0x159));var _0x964a=function(_0x2012be,_0x92fc70){_0x2012be=_0x2012be-0x0;var _0x274916=_0x64a9[_0x2012be];return _0x274916;};'use strict';var EventEmitter=require(_0x964a('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x964a('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x964a('0x2')](0x0);var events={'afterCreate':_0x964a('0x3'),'afterUpdate':'update','afterDestroy':_0x964a('0x4')};function emitEvent(_0x5d1110){return function(_0x17932f,_0x10c312,_0x2700ad){MailMessageEvents[_0x964a('0x5')](_0x5d1110+':'+_0x17932f['id'],_0x17932f);MailMessageEvents['emit'](_0x5d1110,_0x17932f);_0x2700ad(null);};}for(var e in events){if(events[_0x964a('0x6')](e)){var event=events[e];MailMessage[_0x964a('0x7')](e,emitEvent(event));}}module[_0x964a('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xe4d6=['update','remove','emit','exports','events','../../mysqldb','MailMessage'];(function(_0x4fde0b,_0x4b4289){var _0x3f3b38=function(_0x5e4d17){while(--_0x5e4d17){_0x4fde0b['push'](_0x4fde0b['shift']());}};_0x3f3b38(++_0x4b4289);}(_0xe4d6,0x100));var _0x6e4d=function(_0x11d738,_0x5bff63){_0x11d738=_0x11d738-0x0;var _0x11ab52=_0xe4d6[_0x11d738];return _0x11ab52;};'use strict';var EventEmitter=require(_0x6e4d('0x0'));var MailMessage=require(_0x6e4d('0x1'))['db'][_0x6e4d('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e4d('0x3'),'afterDestroy':_0x6e4d('0x4')};function emitEvent(_0x2776e3){return function(_0x1c5409,_0x1f3b98,_0x16590e){MailMessageEvents[_0x6e4d('0x5')](_0x2776e3+':'+_0x1c5409['id'],_0x1c5409);MailMessageEvents[_0x6e4d('0x5')](_0x2776e3,_0x1c5409);_0x16590e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x6e4d('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 717f3be..d5d6f07 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 _0xf738=['request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','createdAt','catch','error','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0xf738,0xd5));var _0x8f73=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf738[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x8f73('0x0'));var util=require('util');var logger=require(_0x8f73('0x1'))(_0x8f73('0x2'));var moment=require(_0x8f73('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f73('0x4'));var htmlToText=require(_0x8f73('0x5'));var fs=require('fs');var path=require(_0x8f73('0x6'));var rimraf=require(_0x8f73('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f73('0x8'));module['exports']=function(_0x3dc83e,_0x434a80){return _0x3dc83e[_0x8f73('0x9')](_0x8f73('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x8f73('0xb'),'fields':[_0x8f73('0xb')]},{'name':_0x8f73('0xc'),'fields':['plainBody',_0x8f73('0xd')],'type':_0x8f73('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x102925,_0x284261,_0x283378){if(_0x102925[_0x8f73('0xf')]){_0x102925['plainBody']=htmlToText[_0x8f73('0x10')](_0x102925[_0x8f73('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x283378(null,_0x284261);},'afterCreate':function(_0x5c9088,_0x315c3d,_0x1a60e4){var _0xcc3ccb=_0x3dc83e[_0x8f73('0x11')];var _0x58535e=_0x5c9088[_0x8f73('0x12')]({'plain':!![]});if(_0x58535e[_0x8f73('0x13')][_0x8f73('0x14')]()==='in'||_0x58535e[_0x8f73('0x13')]['toLowerCase']()===_0x8f73('0x15')&&!_0x58535e[_0x8f73('0x16')]&&!_[_0x8f73('0x17')](_0x58535e['UserId'])){_0xcc3ccb[_0x8f73('0x18')][_0x8f73('0x19')]({'where':{'id':_0x58535e[_0x8f73('0x1a')]}})['then'](function(_0x5a5ee2){if(_0x5a5ee2){_0x5a5ee2['update']({'lastMsgAt':_0x58535e[_0x8f73('0x1b')],'lastMsgDirection':_0x58535e['direction'][_0x8f73('0x14')]()});}})[_0x8f73('0x1c')](function(_0x29c6f4){console[_0x8f73('0x1d')](_0x29c6f4);});}_0x1a60e4();}},'charset':_0x8f73('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3c76=['subject','FULLTEXT','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','then','createdAt','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','rimraf','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','plainBody'];(function(_0x2b2fd2,_0x3058e9){var _0x53c6d2=function(_0x32a654){while(--_0x32a654){_0x2b2fd2['push'](_0x2b2fd2['shift']());}};_0x53c6d2(++_0x3058e9);}(_0x3c76,0x161));var _0x63c7=function(_0x16467f,_0x8426ef){_0x16467f=_0x16467f-0x0;var _0xfaf0e4=_0x3c76[_0x16467f];return _0xfaf0e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x63c7('0x0'))('api');var moment=require(_0x63c7('0x1'));var BPromise=require(_0x63c7('0x2'));var rp=require(_0x63c7('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x63c7('0x4'));var config=require('../../config/environment');var attributes=require(_0x63c7('0x5'));module[_0x63c7('0x6')]=function(_0x468ef1,_0x234cac){return _0x468ef1['define'](_0x63c7('0x7'),attributes,{'tableName':_0x63c7('0x8'),'paranoid':![],'indexes':[{'name':_0x63c7('0x9'),'fields':[_0x63c7('0x9')]},{'name':'fti_mail_messages','fields':[_0x63c7('0xa'),_0x63c7('0xb')],'type':_0x63c7('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16bf29,_0x52af26,_0x455b7d){if(_0x16bf29['body']){_0x16bf29[_0x63c7('0xa')]=htmlToText[_0x63c7('0xd')](_0x16bf29[_0x63c7('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x455b7d(null,_0x52af26);},'afterCreate':function(_0x372cb4,_0x5e0a80,_0x5a66d3){var _0x36bc95=_0x468ef1[_0x63c7('0xf')];var _0x1200c2=_0x372cb4[_0x63c7('0x10')]({'plain':!![]});if(_0x1200c2[_0x63c7('0x11')][_0x63c7('0x12')]()==='in'||_0x1200c2[_0x63c7('0x11')][_0x63c7('0x12')]()===_0x63c7('0x13')&&!_0x1200c2[_0x63c7('0x14')]&&!_[_0x63c7('0x15')](_0x1200c2[_0x63c7('0x16')])){_0x36bc95[_0x63c7('0x17')]['findOne']({'where':{'id':_0x1200c2['MailInteractionId']}})[_0x63c7('0x18')](function(_0x5bbf78){if(_0x5bbf78){_0x5bbf78['update']({'lastMsgAt':_0x1200c2[_0x63c7('0x19')],'lastMsgDirection':_0x1200c2[_0x63c7('0x11')][_0x63c7('0x12')]()});}})['catch'](function(_0x3178f7){console['error'](_0x3178f7);});}_0x5a66d3();}},'charset':_0x63c7('0x1a'),'collate':_0x63c7('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1a3315c..fdfd22f 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 _0x6a95=['MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','create','body','options','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailMessage,\x20%s,\x20%s','debug'];(function(_0x26cd64,_0x191a41){var _0x4b372a=function(_0x2637ba){while(--_0x2637ba){_0x26cd64['push'](_0x26cd64['shift']());}};_0x4b372a(++_0x191a41);}(_0x6a95,0x1db));var _0x56a9=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x6a95[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});config[_0x56a9('0xc')]=_[_0x56a9('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x56a9('0xe'))(new Redis(config[_0x56a9('0xc')]));require('./mailMessage.socket')[_0x56a9('0xf')](socket);function respondWithRpcPromise(_0x1eddfd,_0x2d590d,_0xcf7c){return new BPromise(function(_0x3c1506,_0x319ff3){return client[_0x56a9('0x10')](_0x1eddfd,_0xcf7c)[_0x56a9('0x11')](function(_0x9ab10c){logger['info'](_0x56a9('0x12'),_0x2d590d,'request\x20sent');logger[_0x56a9('0x13')](_0x56a9('0x14'),_0x2d590d,_0x56a9('0x15'),JSON[_0x56a9('0x16')](_0x9ab10c));if(_0x9ab10c[_0x56a9('0x17')]){if(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x18')]===0x1f4){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error']['message']);return _0x319ff3(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x19')]);}logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error'][_0x56a9('0x19')]);return _0x3c1506(_0x9ab10c['error']['message']);}else{logger['info'](_0x56a9('0x12'),_0x2d590d,_0x56a9('0x15'));_0x3c1506(_0x9ab10c[_0x56a9('0x1a')][_0x56a9('0x19')]);}})[_0x56a9('0x1b')](function(_0x429e24){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x429e24);_0x319ff3(_0x429e24);});});}exports[_0x56a9('0x1c')]=function(_0x335cc3){var _0x2ff2ca=this;return new Promise(function(_0x62f79f,_0x5f145f){return db['MailMessage'][_0x56a9('0x1d')](_0x335cc3[_0x56a9('0x1e')],{'raw':_0x335cc3[_0x56a9('0x1f')]?_0x335cc3[_0x56a9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x56a9('0x11')](function(_0x3355c4){logger[_0x56a9('0x20')](_0x56a9('0x1c'),_0x335cc3);logger['debug'](_0x56a9('0x1c'),_0x335cc3,JSON[_0x56a9('0x16')](_0x3355c4));_0x62f79f(_0x3355c4);})[_0x56a9('0x1b')](function(_0xd029f7){logger[_0x56a9('0x17')]('CreateMailMessage',_0xd029f7[_0x56a9('0x19')],_0x335cc3);_0x5f145f(_0x2ff2ca[_0x56a9('0x17')](0x1f4,_0xd029f7[_0x56a9('0x19')]));});});}; \ No newline at end of file +var _0xa30a=['then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MailMessage','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});config[_0xaa30('0xb')]=_[_0xaa30('0xc')](config[_0xaa30('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0xd'))(new Redis(config[_0xaa30('0xb')]));require(_0xaa30('0xe'))[_0xaa30('0xf')](socket);function respondWithRpcPromise(_0x14a6a6,_0x45419f,_0x56f686){return new BPromise(function(_0x5afbf5,_0x12a8ce){return client['request'](_0x14a6a6,_0x56f686)[_0xaa30('0x10')](function(_0x1a5681){logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');logger[_0xaa30('0x13')](_0xaa30('0x14'),_0x45419f,_0xaa30('0x15'),JSON['stringify'](_0x1a5681));if(_0x1a5681[_0xaa30('0x16')]){if(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x17')]===0x1f4){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);return _0x12a8ce(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);}logger[_0xaa30('0x16')]('MailMessage,\x20%s,\x20%s',_0x45419f,_0x1a5681[_0xaa30('0x16')]['message']);return _0x5afbf5(_0x1a5681['error'][_0xaa30('0x18')]);}else{logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');_0x5afbf5(_0x1a5681['result']['message']);}})[_0xaa30('0x19')](function(_0x4acdfa){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x4acdfa);_0x12a8ce(_0x4acdfa);});});}exports['CreateMailMessage']=function(_0x4e29f9){var _0x520abb=this;return new Promise(function(_0x3cbf92,_0x3e4f1d){return db[_0xaa30('0x1a')][_0xaa30('0x1b')](_0x4e29f9[_0xaa30('0x1c')],{'raw':_0x4e29f9['options']?_0x4e29f9[_0xaa30('0x1d')][_0xaa30('0x1e')]===undefined?!![]:![]:!![]})[_0xaa30('0x10')](function(_0x2d9e35){logger[_0xaa30('0x11')]('CreateMailMessage',_0x4e29f9);logger[_0xaa30('0x13')](_0xaa30('0x1f'),_0x4e29f9,JSON[_0xaa30('0x20')](_0x2d9e35));_0x3cbf92(_0x2d9e35);})[_0xaa30('0x19')](function(_0x57d1ca){logger[_0xaa30('0x16')](_0xaa30('0x1f'),_0x57d1ca[_0xaa30('0x18')],_0x4e29f9);_0x3e4f1d(_0x520abb[_0xaa30('0x16')](0x1f4,_0x57d1ca[_0xaa30('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index aa4467e..0e792e3 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 _0x6be5=['length','mailMessage:','./mailMessage.events','remove','update','removeListener','register'];(function(_0x5ec2ad,_0x1b57eb){var _0x5f22f3=function(_0x52e3d7){while(--_0x52e3d7){_0x5ec2ad['push'](_0x5ec2ad['shift']());}};_0x5f22f3(++_0x1b57eb);}(_0x6be5,0x144));var _0x56be=function(_0x52f925,_0x573be0){_0x52f925=_0x52f925-0x0;var _0x4b439a=_0x6be5[_0x52f925];return _0x4b439a;};'use strict';var MailMessageEvents=require(_0x56be('0x0'));var events=['save',_0x56be('0x1'),_0x56be('0x2')];function createListener(_0x359098,_0x55d5c8){return function(_0x43321f){_0x55d5c8['emit'](_0x359098,_0x43321f);};}function removeListener(_0x581325,_0x5b8a70){return function(){MailMessageEvents[_0x56be('0x3')](_0x581325,_0x5b8a70);};}exports[_0x56be('0x4')]=function(_0x2a18a3){for(var _0x5b8efc=0x0,_0xbc2068=events[_0x56be('0x5')];_0x5b8efc<_0xbc2068;_0x5b8efc++){var _0x1ffcb8=events[_0x5b8efc];var _0x85ddd6=createListener(_0x56be('0x6')+_0x1ffcb8,_0x2a18a3);MailMessageEvents['on'](_0x1ffcb8,_0x85ddd6);}}; \ No newline at end of file +var _0x0b8f=['./mailMessage.events','remove','update','emit','removeListener','register'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x0b8f,0x174));var _0xf0b8=function(_0x4c583c,_0x2b543f){_0x4c583c=_0x4c583c-0x0;var _0x5b1361=_0x0b8f[_0x4c583c];return _0x5b1361;};'use strict';var MailMessageEvents=require(_0xf0b8('0x0'));var events=['save',_0xf0b8('0x1'),_0xf0b8('0x2')];function createListener(_0x2b0a3d,_0x1dd890){return function(_0x3f9ea9){_0x1dd890[_0xf0b8('0x3')](_0x2b0a3d,_0x3f9ea9);};}function removeListener(_0x2f0e03,_0x3de089){return function(){MailMessageEvents[_0xf0b8('0x4')](_0x2f0e03,_0x3de089);};}exports[_0xf0b8('0x5')]=function(_0x30847e){for(var _0x4c2e2e=0x0,_0x58fef4=events['length'];_0x4c2e2e<_0x58fef4;_0x4c2e2e++){var _0x4a1101=events[_0x4c2e2e];var _0x5cee2d=createListener('mailMessage:'+_0x4a1101,_0x30847e);MailMessageEvents['on'](_0x4a1101,_0x5cee2d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c6e871b..3a2daac 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 _0x292d=['../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','path','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x292d,0x1b6));var _0xd292=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x292d[_0x16dbfd];return _0x382254;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd292('0x0'));var timeout=require(_0xd292('0x1'));var express=require(_0xd292('0x2'));var router=express[_0xd292('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd292('0x4'));var interaction=require(_0xd292('0x5'));var config=require('../../config/environment');var controller=require(_0xd292('0x6'));router[_0xd292('0x7')]('/',auth[_0xd292('0x8')](),controller[_0xd292('0x9')]);router[_0xd292('0x7')]('/describe',auth[_0xd292('0x8')](),controller['describe']);router[_0xd292('0x7')]('/:id',auth[_0xd292('0x8')](),controller[_0xd292('0xa')]);router[_0xd292('0x7')](_0xd292('0xb'),auth[_0xd292('0x8')](),controller[_0xd292('0xc')]);router['get'](_0xd292('0xd'),auth[_0xd292('0x8')](),controller['getTeams']);router[_0xd292('0x7')](_0xd292('0xe'),auth[_0xd292('0x8')](),controller['getAgents']);router[_0xd292('0xf')]('/',auth[_0xd292('0x8')](),controller[_0xd292('0x10')]);router[_0xd292('0xf')]('/:id/teams',auth[_0xd292('0x8')](),controller[_0xd292('0x11')]);router[_0xd292('0xf')](_0xd292('0xe'),auth[_0xd292('0x8')](),controller[_0xd292('0x12')]);router[_0xd292('0x13')]('/:id',auth[_0xd292('0x8')](),controller[_0xd292('0x14')]);router[_0xd292('0x15')](_0xd292('0x16'),auth[_0xd292('0x8')](),controller[_0xd292('0x17')]);router[_0xd292('0x15')](_0xd292('0xd'),auth[_0xd292('0x8')](),controller[_0xd292('0x18')]);router[_0xd292('0x15')](_0xd292('0xe'),auth[_0xd292('0x8')](),controller[_0xd292('0x19')]);module['exports']=router; \ No newline at end of file +var _0x66b8=['multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams','post','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x66b8,0xfa));var _0x866b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x66b8[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x866b('0x0'));var util=require('util');var path=require(_0x866b('0x1'));var timeout=require(_0x866b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x866b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x866b('0x4'));var config=require(_0x866b('0x5'));var controller=require(_0x866b('0x6'));router['get']('/',auth[_0x866b('0x7')](),controller['index']);router[_0x866b('0x8')](_0x866b('0x9'),auth[_0x866b('0x7')](),controller[_0x866b('0xa')]);router['get'](_0x866b('0xb'),auth[_0x866b('0x7')](),controller[_0x866b('0xc')]);router['get'](_0x866b('0xd'),auth[_0x866b('0x7')](),controller['getMembers']);router[_0x866b('0x8')](_0x866b('0xe'),auth[_0x866b('0x7')](),controller['getTeams']);router[_0x866b('0x8')]('/:id/users',auth[_0x866b('0x7')](),controller['getAgents']);router[_0x866b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x866b('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x866b('0xf')](_0x866b('0x10'),auth[_0x866b('0x7')](),controller[_0x866b('0x11')]);router[_0x866b('0x12')](_0x866b('0xb'),auth[_0x866b('0x7')](),controller[_0x866b('0x13')]);router[_0x866b('0x14')](_0x866b('0xb'),auth[_0x866b('0x7')](),controller[_0x866b('0x15')]);router[_0x866b('0x14')](_0x866b('0xe'),auth['isAuthenticated'](),controller[_0x866b('0x16')]);router[_0x866b('0x14')](_0x866b('0x10'),auth[_0x866b('0x7')](),controller[_0x866b('0x17')]);module[_0x866b('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 3b875e0..451ab2d 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 _0xfa3a=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xfa3a,0xa5));var _0xafa3=function(_0x575a16,_0x18eefa){_0x575a16=_0x575a16-0x0;var _0x298d59=_0xfa3a[_0x575a16];return _0x298d59;};'use strict';var Sequelize=require('sequelize');module[_0xafa3('0x0')]={'name':{'type':Sequelize[_0xafa3('0x1')],'unique':_0xafa3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xafa3('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xafa3('0x3')](_0xafa3('0x4'),_0xafa3('0x5'),_0xafa3('0x6'))}}; \ No newline at end of file +var _0xd883=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x4eedf7,_0x391dd3){var _0x4e2294=function(_0x29eb94){while(--_0x29eb94){_0x4eedf7['push'](_0x4eedf7['shift']());}};_0x4e2294(++_0x391dd3);}(_0xd883,0x1b1));var _0x3d88=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd883[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3d88('0x0')],'unique':_0x3d88('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3d88('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d88('0x3')](_0x3d88('0x4'),_0x3d88('0x5'),_0x3d88('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 3784806..4ecb010 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 _0x3dca=['update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','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','find','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x3dca,0x186));var _0xa3dc=function(_0x591d76,_0x537a63){_0x591d76=_0x591d76-0x0;var _0x32173f=_0x3dca[_0x591d76];return _0x32173f;};'use strict';var emlformat=require(_0xa3dc('0x0'));var rimraf=require(_0xa3dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3dc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa3dc('0x3'));var Mustache=require(_0xa3dc('0x4'));var util=require(_0xa3dc('0x5'));var path=require(_0xa3dc('0x6'));var sox=require(_0xa3dc('0x7'));var csv=require(_0xa3dc('0x8'));var ejs=require(_0xa3dc('0x9'));var fs=require('fs');var fs_extra=require(_0xa3dc('0xa'));var _=require(_0xa3dc('0xb'));var squel=require(_0xa3dc('0xc'));var crypto=require(_0xa3dc('0xd'));var jsforce=require(_0xa3dc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa3dc('0x8'));var querystring=require('querystring');var Papa=require(_0xa3dc('0xf'));var Redis=require(_0xa3dc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3dc('0x11'));var as=require(_0xa3dc('0x12'));var hardwareService=require(_0xa3dc('0x13'));var logger=require('../../config/logger')(_0xa3dc('0x14'));var utils=require('../../config/utils');var config=require(_0xa3dc('0x15'));var licenseUtil=require(_0xa3dc('0x16'));var db=require(_0xa3dc('0x17'))['db'];config['redis']=_['defaults'](config[_0xa3dc('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3dc('0x19'))(new Redis(config[_0xa3dc('0x18')]));require(_0xa3dc('0x1a'))[_0xa3dc('0x1b')](socket);function respondWithStatusCode(_0x19523a,_0x1a618e){_0x1a618e=_0x1a618e||0xcc;return function(_0x4109ff){if(_0x4109ff){return _0x19523a['sendStatus'](_0x1a618e);}return _0x19523a[_0xa3dc('0x1c')](_0x1a618e)[_0xa3dc('0x1d')]();};}function respondWithResult(_0x516bcf,_0x57efa0){_0x57efa0=_0x57efa0||0xc8;return function(_0x40558f){if(_0x40558f){return _0x516bcf[_0xa3dc('0x1c')](_0x57efa0)[_0xa3dc('0x1e')](_0x40558f);}};}function respondWithFilteredResult(_0x4fd374,_0x102670){return function(_0xe31613){if(_0xe31613){var _0x5b0b84=typeof _0x102670[_0xa3dc('0x1f')]===_0xa3dc('0x20')&&typeof _0x102670[_0xa3dc('0x21')]===_0xa3dc('0x20');var _0x1182b1=_0xe31613[_0xa3dc('0x22')];var _0x45c3fe=_0x5b0b84?0x0:_0x102670[_0xa3dc('0x1f')];var _0x840228=_0x5b0b84?_0xe31613[_0xa3dc('0x22')]:_0x102670[_0xa3dc('0x1f')]+_0x102670['limit'];var _0x404a3c;if(_0x840228>=_0x1182b1){_0x840228=_0x1182b1;_0x404a3c=0xc8;}else{_0x404a3c=0xce;}_0x4fd374[_0xa3dc('0x1c')](_0x404a3c);return _0x4fd374[_0xa3dc('0x23')]('Content-Range',_0x45c3fe+'-'+_0x840228+'/'+_0x1182b1)[_0xa3dc('0x1e')](_0xe31613);}return null;};}function patchUpdates(_0x358831){return function(_0x223b1b){try{jsonpatch[_0xa3dc('0x24')](_0x223b1b,_0x358831,!![]);}catch(_0x1348c1){return BPromise[_0xa3dc('0x25')](_0x1348c1);}return _0x223b1b[_0xa3dc('0x26')]();};}function saveUpdates(_0x204225,_0x5d0b9d){return function(_0xb96da){if(_0xb96da){return _0xb96da[_0xa3dc('0x27')](_0x204225)[_0xa3dc('0x28')](function(_0x1eae08){return _0x1eae08;});}return null;};}function removeEntity(_0x3805f9,_0x1df5fa){return function(_0x263214){if(_0x263214){return _0x263214[_0xa3dc('0x29')]()[_0xa3dc('0x28')](function(){var _0x2c1c63=_0x263214[_0xa3dc('0x2a')]({'plain':!![]});var _0x21b5f9=_0xa3dc('0x2b');return db[_0xa3dc('0x2c')]['destroy']({'where':{'type':_0x21b5f9,'resourceId':_0x2c1c63['id']}})[_0xa3dc('0x28')](function(){return _0x263214;});})[_0xa3dc('0x28')](function(){_0x3805f9['status'](0xcc)[_0xa3dc('0x1d')]();});}};}function handleEntityNotFound(_0x234f15,_0x106aa6){return function(_0x4f2007){if(!_0x4f2007){_0x234f15[_0xa3dc('0x2d')](0x194);}return _0x4f2007;};}function handleError(_0x1ed329,_0x3f7967){_0x3f7967=_0x3f7967||0x1f4;return function(_0x1ce046){logger[_0xa3dc('0x2e')](_0x1ce046[_0xa3dc('0x2f')]);if(_0x1ce046[_0xa3dc('0x30')]){delete _0x1ce046[_0xa3dc('0x30')];}_0x1ed329['status'](_0x3f7967)[_0xa3dc('0x31')](_0x1ce046);};}exports[_0xa3dc('0x32')]=function(_0x5f4245,_0x4be694){var _0x3502d8={},_0xd61d93={},_0x310252={'count':0x0,'rows':[]};var _0xa294b5=_[_0xa3dc('0x33')](db[_0xa3dc('0x34')][_0xa3dc('0x35')],function(_0x270d0f){return{'name':_0x270d0f['fieldName'],'type':_0x270d0f[_0xa3dc('0x36')]['key']};});_0xd61d93[_0xa3dc('0x37')]=_['map'](_0xa294b5,_0xa3dc('0x30'));_0xd61d93['query']=_['keys'](_0x5f4245[_0xa3dc('0x38')]);_0xd61d93[_0xa3dc('0x39')]=_[_0xa3dc('0x3a')](_0xd61d93[_0xa3dc('0x37')],_0xd61d93[_0xa3dc('0x38')]);_0x3502d8['attributes']=_[_0xa3dc('0x3a')](_0xd61d93[_0xa3dc('0x37')],qs[_0xa3dc('0x3b')](_0x5f4245[_0xa3dc('0x38')]['fields']));_0x3502d8[_0xa3dc('0x3c')]=_0x3502d8['attributes'][_0xa3dc('0x3d')]?_0x3502d8[_0xa3dc('0x3c')]:_0xd61d93[_0xa3dc('0x37')];if(!_0x5f4245['query'][_0xa3dc('0x3e')](_0xa3dc('0x3f'))){_0x3502d8[_0xa3dc('0x21')]=qs[_0xa3dc('0x21')](_0x5f4245[_0xa3dc('0x38')][_0xa3dc('0x21')]);_0x3502d8[_0xa3dc('0x1f')]=qs[_0xa3dc('0x1f')](_0x5f4245['query']['offset']);}_0x3502d8[_0xa3dc('0x40')]=qs['sort'](_0x5f4245[_0xa3dc('0x38')][_0xa3dc('0x41')]);_0x3502d8[_0xa3dc('0x42')]=qs[_0xa3dc('0x39')](_['pick'](_0x5f4245[_0xa3dc('0x38')],_0xd61d93[_0xa3dc('0x39')]),_0xa294b5);if(_0x5f4245[_0xa3dc('0x38')][_0xa3dc('0x43')]){_0x3502d8[_0xa3dc('0x42')]=_[_0xa3dc('0x44')](_0x3502d8[_0xa3dc('0x42')],{'$or':_[_0xa3dc('0x33')](_0xa294b5,function(_0x132eb3){if(_0x132eb3[_0xa3dc('0x36')]!==_0xa3dc('0x45')){var _0x441ed0={};_0x441ed0[_0x132eb3[_0xa3dc('0x30')]]={'$like':'%'+_0x5f4245[_0xa3dc('0x38')][_0xa3dc('0x43')]+'%'};return _0x441ed0;}})});}_0x3502d8=_[_0xa3dc('0x44')]({},_0x3502d8,_0x5f4245[_0xa3dc('0x46')]);var _0x343b4d={'where':_0x3502d8[_0xa3dc('0x42')]};return db['MailQueue'][_0xa3dc('0x22')](_0x343b4d)[_0xa3dc('0x28')](function(_0x3c02ba){_0x310252[_0xa3dc('0x22')]=_0x3c02ba;if(_0x5f4245[_0xa3dc('0x38')]['includeAll']){_0x3502d8['include']=[{'all':!![]}];}return db['MailQueue'][_0xa3dc('0x47')](_0x3502d8);})[_0xa3dc('0x28')](function(_0x1026e0){_0x310252[_0xa3dc('0x48')]=_0x1026e0;return _0x310252;})[_0xa3dc('0x28')](respondWithFilteredResult(_0x4be694,_0x3502d8))[_0xa3dc('0x49')](handleError(_0x4be694,null));};exports[_0xa3dc('0x4a')]=function(_0x14193f,_0x3660cc){var _0x45d3c7={'raw':!![],'where':{'id':_0x14193f['params']['id']}},_0x41fddd={};_0x41fddd[_0xa3dc('0x37')]=_['keys'](db[_0xa3dc('0x34')][_0xa3dc('0x35')]);_0x41fddd[_0xa3dc('0x38')]=_[_0xa3dc('0x4b')](_0x14193f[_0xa3dc('0x38')]);_0x41fddd['filters']=_['intersection'](_0x41fddd[_0xa3dc('0x37')],_0x41fddd[_0xa3dc('0x38')]);_0x45d3c7[_0xa3dc('0x3c')]=_['intersection'](_0x41fddd[_0xa3dc('0x37')],qs[_0xa3dc('0x3b')](_0x14193f[_0xa3dc('0x38')][_0xa3dc('0x3b')]));_0x45d3c7['attributes']=_0x45d3c7[_0xa3dc('0x3c')][_0xa3dc('0x3d')]?_0x45d3c7['attributes']:_0x41fddd[_0xa3dc('0x37')];if(_0x14193f[_0xa3dc('0x38')][_0xa3dc('0x4c')]){_0x45d3c7[_0xa3dc('0x4d')]=[{'all':!![]}];}_0x45d3c7=_['merge']({},_0x45d3c7,_0x14193f[_0xa3dc('0x46')]);return db['MailQueue']['find'](_0x45d3c7)[_0xa3dc('0x28')](handleEntityNotFound(_0x3660cc,null))[_0xa3dc('0x28')](respondWithResult(_0x3660cc,null))[_0xa3dc('0x49')](handleError(_0x3660cc,null));};exports[_0xa3dc('0x4e')]=function(_0x35e03c,_0x3dc74e){return db[_0xa3dc('0x34')]['create'](_0x35e03c[_0xa3dc('0x4f')],{})[_0xa3dc('0x28')](function(_0x277ef6){var _0x2876a0=_0x35e03c[_0xa3dc('0x50')][_0xa3dc('0x2a')]({'plain':!![]});if(!_0x2876a0)throw new Error(_0xa3dc('0x51'));if(_0x2876a0[_0xa3dc('0x52')]===_0xa3dc('0x50')){var _0x545aec=_0x277ef6[_0xa3dc('0x2a')]({'plain':!![]});var _0x1cf8f9=_0xa3dc('0x2b');return db[_0xa3dc('0x53')]['find']({'where':{'name':_0x1cf8f9,'userProfileId':_0x2876a0[_0xa3dc('0x54')]},'raw':!![]})[_0xa3dc('0x28')](function(_0x20849c){if(_0x20849c&&_0x20849c[_0xa3dc('0x55')]===0x0){return db['UserProfileResource'][_0xa3dc('0x4e')]({'name':_0x545aec[_0xa3dc('0x30')],'resourceId':_0x545aec['id'],'type':_0x20849c[_0xa3dc('0x30')],'sectionId':_0x20849c['id']},{})['then'](function(){return _0x277ef6;});}else{return _0x277ef6;}})['catch'](function(_0x8ce399){logger[_0xa3dc('0x2e')](_0xa3dc('0x56'),_0x8ce399);throw _0x8ce399;});}return _0x277ef6;})[_0xa3dc('0x28')](respondWithResult(_0x3dc74e,0xc9))['catch'](handleError(_0x3dc74e,null));};exports[_0xa3dc('0x27')]=function(_0x21c65a,_0x27b70a){if(_0x21c65a[_0xa3dc('0x4f')]['id']){delete _0x21c65a[_0xa3dc('0x4f')]['id'];}return db[_0xa3dc('0x34')]['find']({'where':{'id':_0x21c65a[_0xa3dc('0x57')]['id']}})['then'](handleEntityNotFound(_0x27b70a,null))['then'](saveUpdates(_0x21c65a['body'],null))[_0xa3dc('0x28')](respondWithResult(_0x27b70a,null))['catch'](handleError(_0x27b70a,null));};exports[_0xa3dc('0x29')]=function(_0x4ee30a,_0x4c96d6){return db['MailQueue'][_0xa3dc('0x58')]({'where':{'id':_0x4ee30a[_0xa3dc('0x57')]['id']}})[_0xa3dc('0x28')](handleEntityNotFound(_0x4c96d6,null))[_0xa3dc('0x28')](removeEntity(_0x4c96d6,null))[_0xa3dc('0x49')](handleError(_0x4c96d6,null));};exports['describe']=function(_0x56b027,_0x6c72ed){return db['MailQueue'][_0xa3dc('0x59')]()[_0xa3dc('0x28')](respondWithResult(_0x6c72ed,null))[_0xa3dc('0x49')](handleError(_0x6c72ed,null));};exports[_0xa3dc('0x5a')]=function(_0x33efd9,_0x5e69ac,_0x43438a){var _0x5805e7={'raw':!![],'where':{}},_0x2dd38f={},_0x22fd5f;return db[_0xa3dc('0x34')][_0xa3dc('0x5b')]({'where':{'id':_0x33efd9[_0xa3dc('0x57')]['id']}})[_0xa3dc('0x28')](handleEntityNotFound(_0x5e69ac,null))[_0xa3dc('0x28')](function(_0x3467ff){if(_0x3467ff){_0x22fd5f=_0x3467ff['get']({'plain':!![]});_0x2dd38f['model']=_[_0xa3dc('0x4b')](db[_0xa3dc('0x5c')][_0xa3dc('0x35')]);_0x2dd38f['query']=_[_0xa3dc('0x4b')](_0x33efd9[_0xa3dc('0x38')]);_0x2dd38f[_0xa3dc('0x39')]=_['intersection'](_0x2dd38f[_0xa3dc('0x37')],_0x2dd38f['query']);_0x5805e7[_0xa3dc('0x3c')]=_[_0xa3dc('0x3a')](_0x2dd38f[_0xa3dc('0x37')],qs[_0xa3dc('0x3b')](_0x33efd9[_0xa3dc('0x38')][_0xa3dc('0x3b')]));_0x5805e7[_0xa3dc('0x3c')]=_0x5805e7[_0xa3dc('0x3c')][_0xa3dc('0x3d')]?_0x5805e7[_0xa3dc('0x3c')]:_0x2dd38f[_0xa3dc('0x37')];if(!_0x33efd9[_0xa3dc('0x38')][_0xa3dc('0x3e')](_0xa3dc('0x3f'))){_0x5805e7['limit']=qs[_0xa3dc('0x21')](_0x33efd9['query'][_0xa3dc('0x21')]);_0x5805e7[_0xa3dc('0x1f')]=qs[_0xa3dc('0x1f')](_0x33efd9['query']['offset']);}_0x5805e7[_0xa3dc('0x40')]=qs[_0xa3dc('0x41')](_0x33efd9['query'][_0xa3dc('0x41')]);_0x5805e7[_0xa3dc('0x42')]=qs[_0xa3dc('0x39')](_[_0xa3dc('0x5d')](_0x33efd9[_0xa3dc('0x38')],_0x2dd38f['filters']));_0x5805e7[_0xa3dc('0x42')][_0xa3dc('0x5e')]=_0x3467ff['id'];if(_0x33efd9[_0xa3dc('0x38')][_0xa3dc('0x43')]){_0x5805e7['where']=_[_0xa3dc('0x44')](_0x5805e7[_0xa3dc('0x42')],{'$or':_[_0xa3dc('0x33')](_0x5805e7['attributes'],function(_0x24ed4c){var _0x50cf0a={};_0x50cf0a[_0x24ed4c]={'$like':'%'+_0x33efd9['query']['filter']+'%'};return _0x50cf0a;})});}_0x5805e7=_[_0xa3dc('0x44')]({},_0x5805e7,_0x33efd9[_0xa3dc('0x46')]);return db['UserMailQueue'][_0xa3dc('0x47')](_0x5805e7);}})[_0xa3dc('0x28')](function(_0x47f6e1){if(_0x47f6e1){return db[_0xa3dc('0x5f')]['findAndCountAll']({'where':{'id':_[_0xa3dc('0x33')](_0x47f6e1,_0xa3dc('0x60')),'role':'agent'},'attributes':['id',_0xa3dc('0x30'),_0xa3dc('0x61'),_0xa3dc('0x62'),_0xa3dc('0x63')]});}})['then'](function(_0x376f7d){if(_0x376f7d){return{'count':_0x376f7d['count'],'rows':_['map'](_0x376f7d[_0xa3dc('0x48')],function(_0x58222f){return{'membername':_0x58222f[_0xa3dc('0x30')],'UserId':_0x58222f['id'],'queue_name':_0x22fd5f[_0xa3dc('0x30')],'MailQueueId':_0x22fd5f['id'],'interface':util['format'](_0xa3dc('0x64'),_0xa3dc('0x65'),_0x58222f[_0xa3dc('0x30')]),'penalty':0x0,'paused':_0x58222f[_0xa3dc('0x61')],'createdAt':_0x58222f['createdAt'],'updatedAt':_0x58222f[_0xa3dc('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa3dc('0x28')](respondWithFilteredResult(_0x5e69ac,_0x5805e7))['catch'](handleError(_0x5e69ac,null));};exports[_0xa3dc('0x66')]=function(_0x3fa8f2,_0x3ade91,_0x5bdf94){var _0x6a0717={};var _0x4aabae={};var _0x208259;var _0x49d24f;return db[_0xa3dc('0x34')][_0xa3dc('0x5b')]({'where':{'id':_0x3fa8f2['params']['id']}})['then'](handleEntityNotFound(_0x3ade91,null))[_0xa3dc('0x28')](function(_0x45404b){if(_0x45404b){_0x208259=_0x45404b;_0x4aabae[_0xa3dc('0x37')]=_['keys'](db[_0xa3dc('0x67')][_0xa3dc('0x35')]);_0x4aabae['query']=_[_0xa3dc('0x4b')](_0x3fa8f2['query']);_0x4aabae[_0xa3dc('0x39')]=_['intersection'](_0x4aabae['model'],_0x4aabae[_0xa3dc('0x38')]);_0x6a0717[_0xa3dc('0x3c')]=_[_0xa3dc('0x3a')](_0x4aabae['model'],qs[_0xa3dc('0x3b')](_0x3fa8f2[_0xa3dc('0x38')][_0xa3dc('0x3b')]));_0x6a0717[_0xa3dc('0x3c')]=_0x6a0717['attributes']['length']?_0x6a0717[_0xa3dc('0x3c')]:_0x4aabae[_0xa3dc('0x37')];_0x6a0717['order']=qs['sort'](_0x3fa8f2[_0xa3dc('0x38')][_0xa3dc('0x41')]);_0x6a0717['where']=qs[_0xa3dc('0x39')](_[_0xa3dc('0x5d')](_0x3fa8f2[_0xa3dc('0x38')],_0x4aabae['filters']));if(_0x3fa8f2['query'][_0xa3dc('0x43')]){_0x6a0717[_0xa3dc('0x42')]=_[_0xa3dc('0x44')](_0x6a0717[_0xa3dc('0x42')],{'$or':_[_0xa3dc('0x33')](_0x6a0717[_0xa3dc('0x3c')],function(_0x4eb930){var _0x3ff195={};_0x3ff195[_0x4eb930]={'$like':'%'+_0x3fa8f2[_0xa3dc('0x38')]['filter']+'%'};return _0x3ff195;})});}_0x6a0717=_[_0xa3dc('0x44')]({},_0x6a0717,_0x3fa8f2[_0xa3dc('0x46')]);return _0x208259[_0xa3dc('0x66')](_0x6a0717);}})[_0xa3dc('0x28')](function(_0x48a9c0){if(_0x48a9c0){_0x49d24f=_0x48a9c0['length'];if(!_0x3fa8f2[_0xa3dc('0x38')][_0xa3dc('0x3e')]('nolimit')){_0x6a0717[_0xa3dc('0x21')]=qs['limit'](_0x3fa8f2[_0xa3dc('0x38')]['limit']);_0x6a0717['offset']=qs[_0xa3dc('0x1f')](_0x3fa8f2[_0xa3dc('0x38')][_0xa3dc('0x1f')]);}return _0x208259[_0xa3dc('0x66')](_0x6a0717);}})[_0xa3dc('0x28')](function(_0x315da5){if(_0x315da5){return _0x315da5?{'count':_0x49d24f,'rows':_0x315da5}:null;}})[_0xa3dc('0x28')](respondWithResult(_0x3ade91,null))['catch'](handleError(_0x3ade91,null));};exports['addTeams']=function(_0x10374a,_0x406485,_0x13e4f2){var _0x1b613b=_0x10374a[_0xa3dc('0x4f')][_0xa3dc('0x68')];return db['Team'][_0xa3dc('0x47')]({'where':{'id':_0x1b613b},'attributes':['id'],'include':[{'model':db[_0xa3dc('0x5f')],'as':_0xa3dc('0x69'),'attributes':['id','name',_0xa3dc('0x6a'),_0xa3dc('0x6b'),_0xa3dc('0x6c')],'raw':!![]}]})[_0xa3dc('0x28')](function(_0x3984ee){if(_0x3984ee){var _0x20b229=_[_0xa3dc('0x6d')](_0x3984ee,function(_0x53c469){var _0x2500c2=_0x53c469['get']({'plain':!![]});return _0x2500c2[_0xa3dc('0x69')];});return db[_0xa3dc('0x34')][_0xa3dc('0x58')]({'where':{'id':_0x10374a[_0xa3dc('0x57')]['id']}})[_0xa3dc('0x28')](function(_0x23abc2){return db[_0xa3dc('0x6e')]['transaction'](function(_0x578cc6){return _0x23abc2['addTeams'](_0x1b613b,{'transaction':_0x578cc6})[_0xa3dc('0x28')](function(){return BPromise[_0xa3dc('0x6f')](_0x20b229,function(_0xe07843){return db[_0xa3dc('0x5c')]['findOrCreate']({'where':{'UserId':_0xe07843['id'],'MailQueueId':_0x10374a['params']['id']},'transaction':_0x578cc6});});})[_0xa3dc('0x28')](function(){_0x20b229[_0xa3dc('0x70')](function(_0x54a230){socket[_0xa3dc('0x71')](_0xa3dc('0x72'),{'UserId':_0x54a230['id'],'MailQueueId':_0x23abc2['id']});});});});});}})[_0xa3dc('0x28')](respondWithStatusCode(_0x406485,null))['catch'](handleError(_0x406485,null));};exports[_0xa3dc('0x73')]=function(_0x117cc8,_0x2cf7e7,_0x356e64){return db[_0xa3dc('0x67')]['findAll']({'where':{'id':_0x117cc8['query'][_0xa3dc('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa3dc('0x69'),'attributes':['id'],'raw':!![]}]})[_0xa3dc('0x28')](handleEntityNotFound(_0x2cf7e7,null))[_0xa3dc('0x28')](function(_0x2eaf96){var _0x445f0e=_[_0xa3dc('0x33')](_0x2eaf96,'id');var _0x3cab12=[];var _0x248448=[];var _0x1b6814=squel[_0xa3dc('0x74')]();_0x1b6814[_0xa3dc('0x75')](_0xa3dc('0x76'))[_0xa3dc('0x77')]('team_has_mail_queues','tq')[_0xa3dc('0x78')](_0xa3dc('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa3dc('0x42')](_0xa3dc('0x7a'),_0x117cc8['params']['id']);for(var _0x42034b=0x0;_0x42034b<_0x2eaf96[_0xa3dc('0x3d')];_0x42034b+=0x1){let _0x4b3b3e=_0x2eaf96[_0x42034b];for(var _0x321708=0x0;_0x321708<_0x4b3b3e[_0xa3dc('0x69')][_0xa3dc('0x3d')];_0x321708+=0x1){let _0x508e9a=_0x4b3b3e[_0xa3dc('0x69')][_0x321708];var _0x56d296=_0x1b6814[_0xa3dc('0x7b')]();_0x56d296[_0xa3dc('0x42')](_0xa3dc('0x7c'),_0x508e9a['id']);_0x248448[_0xa3dc('0x7d')](db[_0xa3dc('0x6e')][_0xa3dc('0x38')](_0x56d296[_0xa3dc('0x7e')](),{'type':db[_0xa3dc('0x6e')]['QueryTypes'][_0xa3dc('0x7f')]})['then'](function(_0x58757a){if(_0x58757a['length']===0x1){return _0x508e9a['id'];}else{var _0x832002=_[_0xa3dc('0x80')](_['map'](_0x58757a,_0xa3dc('0x81')),function(_0x48b894){return _[_0xa3dc('0x82')](_0x445f0e,_0x48b894);});if(_0x832002){return _0x508e9a['id'];}}}));}}return BPromise[_0xa3dc('0x83')](_0x248448)[_0xa3dc('0x28')](function(_0x482b92){_0x3cab12=_(_0x3cab12)['union'](_0x482b92)[_0xa3dc('0x84')]()[_0xa3dc('0x85')]();return db[_0xa3dc('0x34')][_0xa3dc('0x58')]({'where':{'id':_0x117cc8[_0xa3dc('0x57')]['id']}})[_0xa3dc('0x28')](function(_0x4fd7d4){return db[_0xa3dc('0x6e')][_0xa3dc('0x86')](function(_0x2b20b9){return _0x4fd7d4[_0xa3dc('0x73')](_0x117cc8['query'][_0xa3dc('0x68')],{'transaction':_0x2b20b9})['then'](function(){if(!_[_0xa3dc('0x87')](_0x3cab12)){return _0x4fd7d4[_0xa3dc('0x88')](_0x3cab12,{'transaction':_0x2b20b9});}})[_0xa3dc('0x28')](function(){_0x3cab12[_0xa3dc('0x70')](function(_0x30df7a){socket[_0xa3dc('0x71')](_0xa3dc('0x89'),{'UserId':_0x30df7a,'MailQueueId':_0x4fd7d4['id']});});});});});});})[_0xa3dc('0x28')](respondWithStatusCode(_0x2cf7e7,null))[_0xa3dc('0x49')](handleError(_0x2cf7e7,null));};exports[_0xa3dc('0x8a')]=function(_0x5c09f9,_0x4f3e6c,_0x3c7614){return db[_0xa3dc('0x34')][_0xa3dc('0x58')]({'where':{'id':_0x5c09f9[_0xa3dc('0x57')]['id']}})[_0xa3dc('0x28')](handleEntityNotFound(_0x4f3e6c,null))['then'](function(_0x25eeb9){if(_0x25eeb9){return _0x25eeb9[_0xa3dc('0x8a')](_0x5c09f9['body']['ids'],_[_0xa3dc('0x8b')](_0x5c09f9[_0xa3dc('0x4f')],[_0xa3dc('0x68'),'id'])||{})[_0xa3dc('0x8c')](function(_0x18b7dd){for(var _0x61cb23=0x0;_0x61cb23<_0x5c09f9[_0xa3dc('0x4f')]['ids']['length'];_0x61cb23+=0x1){socket['emit'](_0xa3dc('0x72'),{'UserId':Number(_0x5c09f9['body']['ids'][_0x61cb23]),'MailQueueId':Number(_0x5c09f9[_0xa3dc('0x57')]['id'])});}return _0x18b7dd;});}})[_0xa3dc('0x28')](respondWithResult(_0x4f3e6c,null))[_0xa3dc('0x49')](handleError(_0x4f3e6c,null));};exports['removeAgents']=function(_0x41bbe4,_0x5addf5,_0x23150a){return db[_0xa3dc('0x34')][_0xa3dc('0x58')]({'where':{'id':_0x41bbe4['params']['id']}})[_0xa3dc('0x28')](handleEntityNotFound(_0x5addf5,null))[_0xa3dc('0x28')](function(_0x29e30b){if(_0x29e30b){return _0x29e30b[_0xa3dc('0x88')](_0x41bbe4['query'][_0xa3dc('0x68')])[_0xa3dc('0x28')](function(){if(_[_0xa3dc('0x8d')](_0x41bbe4[_0xa3dc('0x38')][_0xa3dc('0x68')])){for(var _0x1985e0=0x0;_0x1985e0<_0x41bbe4[_0xa3dc('0x38')][_0xa3dc('0x68')]['length'];_0x1985e0+=0x1){socket[_0xa3dc('0x71')]('userMailQueue:remove',{'UserId':Number(_0x41bbe4[_0xa3dc('0x38')][_0xa3dc('0x68')][_0x1985e0]),'MailQueueId':Number(_0x41bbe4['params']['id'])});}}else{socket[_0xa3dc('0x71')](_0xa3dc('0x89'),{'UserId':Number(_0x41bbe4[_0xa3dc('0x38')][_0xa3dc('0x68')]),'MailQueueId':Number(_0x41bbe4[_0xa3dc('0x57')]['id'])});}});}})[_0xa3dc('0x28')](respondWithStatusCode(_0x5addf5,null))['catch'](handleError(_0x5addf5,null));};exports[_0xa3dc('0x8e')]=function(_0x270957,_0x10edf4,_0x325a86){var _0x53f90e={};var _0x126d37={};var _0x253ed3;var _0x32908e;return db[_0xa3dc('0x34')][_0xa3dc('0x5b')]({'where':{'id':_0x270957['params']['id']}})[_0xa3dc('0x28')](handleEntityNotFound(_0x10edf4,null))[_0xa3dc('0x28')](function(_0x2bd0e3){if(_0x2bd0e3){_0x253ed3=_0x2bd0e3;_0x126d37[_0xa3dc('0x37')]=_[_0xa3dc('0x4b')](db[_0xa3dc('0x5f')][_0xa3dc('0x35')]);_0x126d37['query']=_[_0xa3dc('0x4b')](_0x270957[_0xa3dc('0x38')]);_0x126d37[_0xa3dc('0x39')]=_['intersection'](_0x126d37['model'],_0x126d37[_0xa3dc('0x38')]);_0x53f90e['attributes']=_[_0xa3dc('0x3a')](_0x126d37[_0xa3dc('0x37')],qs[_0xa3dc('0x3b')](_0x270957[_0xa3dc('0x38')][_0xa3dc('0x3b')]));_0x53f90e[_0xa3dc('0x3c')]=_0x53f90e['attributes'][_0xa3dc('0x3d')]?_0x53f90e['attributes']:_0x126d37['model'];_0x53f90e[_0xa3dc('0x40')]=qs[_0xa3dc('0x41')](_0x270957[_0xa3dc('0x38')]['sort']);_0x53f90e[_0xa3dc('0x42')]=qs[_0xa3dc('0x39')](_[_0xa3dc('0x5d')](_0x270957[_0xa3dc('0x38')],_0x126d37[_0xa3dc('0x39')]));if(_0x270957[_0xa3dc('0x38')][_0xa3dc('0x43')]){_0x53f90e[_0xa3dc('0x42')]=_['merge'](_0x53f90e[_0xa3dc('0x42')],{'$or':_[_0xa3dc('0x33')](_0x53f90e['attributes'],function(_0x150c79){var _0x514c95={};_0x514c95[_0x150c79]={'$like':'%'+_0x270957[_0xa3dc('0x38')]['filter']+'%'};return _0x514c95;})});}_0x53f90e=_['merge']({},_0x53f90e,_0x270957[_0xa3dc('0x46')]);return _0x253ed3[_0xa3dc('0x8e')](_0x53f90e);}})[_0xa3dc('0x28')](function(_0x5ca5b5){if(_0x5ca5b5){_0x32908e=_0x5ca5b5[_0xa3dc('0x3d')];if(!_0x270957[_0xa3dc('0x38')][_0xa3dc('0x3e')](_0xa3dc('0x3f'))){_0x53f90e['limit']=qs['limit'](_0x270957[_0xa3dc('0x38')]['limit']);_0x53f90e[_0xa3dc('0x1f')]=qs[_0xa3dc('0x1f')](_0x270957['query'][_0xa3dc('0x1f')]);}return _0x253ed3['getAgents'](_0x53f90e);}})[_0xa3dc('0x28')](function(_0x56f431){if(_0x56f431){return _0x56f431?{'count':_0x32908e,'rows':_0x56f431}:null;}})[_0xa3dc('0x28')](respondWithResult(_0x10edf4,null))[_0xa3dc('0x49')](handleError(_0x10edf4,null));}; \ No newline at end of file +var _0x1928=['register','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','then','get','MailQueues','UserProfileResource','end','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','params','describe','findOne','MailQueueId','filter','findAndCountAll','mailPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','flatMap','transaction','each','UserMailQueue','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1928,0x183));var _0x8192=function(_0x24ff21,_0x20cdcc){_0x24ff21=_0x24ff21-0x0;var _0x777a7b=_0x1928[_0x24ff21];return _0x777a7b;};'use strict';var emlformat=require(_0x8192('0x0'));var rimraf=require(_0x8192('0x1'));var zipdir=require(_0x8192('0x2'));var jsonpatch=require(_0x8192('0x3'));var rp=require(_0x8192('0x4'));var moment=require(_0x8192('0x5'));var BPromise=require(_0x8192('0x6'));var Mustache=require(_0x8192('0x7'));var util=require(_0x8192('0x8'));var path=require(_0x8192('0x9'));var sox=require(_0x8192('0xa'));var csv=require(_0x8192('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8192('0xc'));var squel=require(_0x8192('0xd'));var crypto=require(_0x8192('0xe'));var jsforce=require(_0x8192('0xf'));var deskjs=require(_0x8192('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8192('0x11'));var Redis=require(_0x8192('0x12'));var authService=require(_0x8192('0x13'));var qs=require(_0x8192('0x14'));var as=require(_0x8192('0x15'));var hardwareService=require(_0x8192('0x16'));var logger=require(_0x8192('0x17'))(_0x8192('0x18'));var utils=require(_0x8192('0x19'));var config=require(_0x8192('0x1a'));var licenseUtil=require(_0x8192('0x1b'));var db=require('../../mysqldb')['db'];config[_0x8192('0x1c')]=_[_0x8192('0x1d')](config[_0x8192('0x1c')],{'host':_0x8192('0x1e'),'port':0x18eb});var socket=require(_0x8192('0x1f'))(new Redis(config[_0x8192('0x1c')]));require(_0x8192('0x20'))[_0x8192('0x21')](socket);function respondWithStatusCode(_0x476d96,_0x2058fd){_0x2058fd=_0x2058fd||0xcc;return function(_0x2b6c4a){if(_0x2b6c4a){return _0x476d96[_0x8192('0x22')](_0x2058fd);}return _0x476d96[_0x8192('0x23')](_0x2058fd)['end']();};}function respondWithResult(_0x571d90,_0x5de909){_0x5de909=_0x5de909||0xc8;return function(_0x1287df){if(_0x1287df){return _0x571d90[_0x8192('0x23')](_0x5de909)[_0x8192('0x24')](_0x1287df);}};}function respondWithFilteredResult(_0x517065,_0x276b36){return function(_0xcbfef6){if(_0xcbfef6){var _0x57927a=typeof _0x276b36[_0x8192('0x25')]===_0x8192('0x26')&&typeof _0x276b36[_0x8192('0x27')]===_0x8192('0x26');var _0xfb73a9=_0xcbfef6[_0x8192('0x28')];var _0x3f06f2=_0x57927a?0x0:_0x276b36[_0x8192('0x25')];var _0x2ea123=_0x57927a?_0xcbfef6[_0x8192('0x28')]:_0x276b36[_0x8192('0x25')]+_0x276b36[_0x8192('0x27')];var _0x256457;if(_0x2ea123>=_0xfb73a9){_0x2ea123=_0xfb73a9;_0x256457=0xc8;}else{_0x256457=0xce;}_0x517065[_0x8192('0x23')](_0x256457);return _0x517065['set']('Content-Range',_0x3f06f2+'-'+_0x2ea123+'/'+_0xfb73a9)[_0x8192('0x24')](_0xcbfef6);}return null;};}function patchUpdates(_0x14597a){return function(_0xecd07){try{jsonpatch['apply'](_0xecd07,_0x14597a,!![]);}catch(_0x29eb3e){return BPromise[_0x8192('0x29')](_0x29eb3e);}return _0xecd07['save']();};}function saveUpdates(_0x41d60e,_0x45f44e){return function(_0x3e6c2a){if(_0x3e6c2a){return _0x3e6c2a[_0x8192('0x2a')](_0x41d60e)['then'](function(_0x26213a){return _0x26213a;});}return null;};}function removeEntity(_0x1e577e,_0x5bd807){return function(_0x544196){if(_0x544196){return _0x544196[_0x8192('0x2b')]()[_0x8192('0x2c')](function(){var _0x5724c9=_0x544196[_0x8192('0x2d')]({'plain':!![]});var _0x36eb9b=_0x8192('0x2e');return db[_0x8192('0x2f')]['destroy']({'where':{'type':_0x36eb9b,'resourceId':_0x5724c9['id']}})[_0x8192('0x2c')](function(){return _0x544196;});})[_0x8192('0x2c')](function(){_0x1e577e[_0x8192('0x23')](0xcc)[_0x8192('0x30')]();});}};}function handleEntityNotFound(_0x3c9efa,_0x589413){return function(_0x53d7df){if(!_0x53d7df){_0x3c9efa[_0x8192('0x22')](0x194);}return _0x53d7df;};}function handleError(_0x5a791d,_0x361032){_0x361032=_0x361032||0x1f4;return function(_0x10095f){logger['error'](_0x10095f[_0x8192('0x31')]);if(_0x10095f[_0x8192('0x32')]){delete _0x10095f[_0x8192('0x32')];}_0x5a791d[_0x8192('0x23')](_0x361032)[_0x8192('0x33')](_0x10095f);};}exports[_0x8192('0x34')]=function(_0x2a1ce5,_0x4e33f0){var _0x2b610c={},_0x8098ba={},_0x4a652f={'count':0x0,'rows':[]};var _0x3bbd58=_[_0x8192('0x35')](db[_0x8192('0x36')][_0x8192('0x37')],function(_0x429e6b){return{'name':_0x429e6b[_0x8192('0x38')],'type':_0x429e6b[_0x8192('0x39')][_0x8192('0x3a')]};});_0x8098ba[_0x8192('0x3b')]=_[_0x8192('0x35')](_0x3bbd58,'name');_0x8098ba['query']=_[_0x8192('0x3c')](_0x2a1ce5[_0x8192('0x3d')]);_0x8098ba[_0x8192('0x3e')]=_[_0x8192('0x3f')](_0x8098ba[_0x8192('0x3b')],_0x8098ba[_0x8192('0x3d')]);_0x2b610c['attributes']=_[_0x8192('0x3f')](_0x8098ba['model'],qs[_0x8192('0x40')](_0x2a1ce5[_0x8192('0x3d')][_0x8192('0x40')]));_0x2b610c[_0x8192('0x41')]=_0x2b610c[_0x8192('0x41')][_0x8192('0x42')]?_0x2b610c[_0x8192('0x41')]:_0x8098ba[_0x8192('0x3b')];if(!_0x2a1ce5[_0x8192('0x3d')][_0x8192('0x43')](_0x8192('0x44'))){_0x2b610c[_0x8192('0x27')]=qs['limit'](_0x2a1ce5[_0x8192('0x3d')][_0x8192('0x27')]);_0x2b610c[_0x8192('0x25')]=qs[_0x8192('0x25')](_0x2a1ce5[_0x8192('0x3d')]['offset']);}_0x2b610c[_0x8192('0x45')]=qs[_0x8192('0x46')](_0x2a1ce5[_0x8192('0x3d')][_0x8192('0x46')]);_0x2b610c[_0x8192('0x47')]=qs['filters'](_[_0x8192('0x48')](_0x2a1ce5[_0x8192('0x3d')],_0x8098ba['filters']),_0x3bbd58);if(_0x2a1ce5[_0x8192('0x3d')]['filter']){_0x2b610c['where']=_[_0x8192('0x49')](_0x2b610c[_0x8192('0x47')],{'$or':_[_0x8192('0x35')](_0x3bbd58,function(_0x259e7a){if(_0x259e7a['type']!=='VIRTUAL'){var _0x377c30={};_0x377c30[_0x259e7a[_0x8192('0x32')]]={'$like':'%'+_0x2a1ce5[_0x8192('0x3d')]['filter']+'%'};return _0x377c30;}})});}_0x2b610c=_[_0x8192('0x49')]({},_0x2b610c,_0x2a1ce5['options']);var _0x473583={'where':_0x2b610c[_0x8192('0x47')]};return db[_0x8192('0x36')][_0x8192('0x28')](_0x473583)[_0x8192('0x2c')](function(_0x135d70){_0x4a652f[_0x8192('0x28')]=_0x135d70;if(_0x2a1ce5['query']['includeAll']){_0x2b610c[_0x8192('0x4a')]=[{'all':!![]}];}return db[_0x8192('0x36')][_0x8192('0x4b')](_0x2b610c);})[_0x8192('0x2c')](function(_0x4d08b3){_0x4a652f[_0x8192('0x4c')]=_0x4d08b3;return _0x4a652f;})[_0x8192('0x2c')](respondWithFilteredResult(_0x4e33f0,_0x2b610c))[_0x8192('0x4d')](handleError(_0x4e33f0,null));};exports['show']=function(_0x6d10db,_0x510bce){var _0x4418cf={'raw':!![],'where':{'id':_0x6d10db['params']['id']}},_0x4af99b={};_0x4af99b[_0x8192('0x3b')]=_[_0x8192('0x3c')](db['MailQueue'][_0x8192('0x37')]);_0x4af99b[_0x8192('0x3d')]=_[_0x8192('0x3c')](_0x6d10db['query']);_0x4af99b[_0x8192('0x3e')]=_[_0x8192('0x3f')](_0x4af99b['model'],_0x4af99b[_0x8192('0x3d')]);_0x4418cf[_0x8192('0x41')]=_[_0x8192('0x3f')](_0x4af99b[_0x8192('0x3b')],qs[_0x8192('0x40')](_0x6d10db[_0x8192('0x3d')][_0x8192('0x40')]));_0x4418cf[_0x8192('0x41')]=_0x4418cf[_0x8192('0x41')]['length']?_0x4418cf[_0x8192('0x41')]:_0x4af99b[_0x8192('0x3b')];if(_0x6d10db[_0x8192('0x3d')]['includeAll']){_0x4418cf[_0x8192('0x4a')]=[{'all':!![]}];}_0x4418cf=_[_0x8192('0x49')]({},_0x4418cf,_0x6d10db[_0x8192('0x4e')]);return db[_0x8192('0x36')][_0x8192('0x4f')](_0x4418cf)[_0x8192('0x2c')](handleEntityNotFound(_0x510bce,null))['then'](respondWithResult(_0x510bce,null))[_0x8192('0x4d')](handleError(_0x510bce,null));};exports['create']=function(_0x49962c,_0x103a2f){return db[_0x8192('0x36')][_0x8192('0x50')](_0x49962c['body'],{})[_0x8192('0x2c')](function(_0x569ea4){var _0x427e5d=_0x49962c[_0x8192('0x51')][_0x8192('0x2d')]({'plain':!![]});if(!_0x427e5d)throw new Error(_0x8192('0x52'));if(_0x427e5d[_0x8192('0x53')]==='user'){var _0x1952be=_0x569ea4['get']({'plain':!![]});var _0x1a8984=_0x8192('0x2e');return db[_0x8192('0x54')]['find']({'where':{'name':_0x1a8984,'userProfileId':_0x427e5d[_0x8192('0x55')]},'raw':!![]})[_0x8192('0x2c')](function(_0x4c971b){if(_0x4c971b&&_0x4c971b['autoAssociation']===0x0){return db[_0x8192('0x2f')][_0x8192('0x50')]({'name':_0x1952be[_0x8192('0x32')],'resourceId':_0x1952be['id'],'type':_0x4c971b[_0x8192('0x32')],'sectionId':_0x4c971b['id']},{})[_0x8192('0x2c')](function(){return _0x569ea4;});}else{return _0x569ea4;}})[_0x8192('0x4d')](function(_0x28a125){logger[_0x8192('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28a125);throw _0x28a125;});}return _0x569ea4;})['then'](respondWithResult(_0x103a2f,0xc9))['catch'](handleError(_0x103a2f,null));};exports['update']=function(_0x5b478f,_0x3d5214){if(_0x5b478f['body']['id']){delete _0x5b478f[_0x8192('0x57')]['id'];}return db[_0x8192('0x36')][_0x8192('0x4f')]({'where':{'id':_0x5b478f[_0x8192('0x58')]['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x3d5214,null))[_0x8192('0x2c')](saveUpdates(_0x5b478f['body'],null))[_0x8192('0x2c')](respondWithResult(_0x3d5214,null))['catch'](handleError(_0x3d5214,null));};exports[_0x8192('0x2b')]=function(_0x5da768,_0x3888b9){return db[_0x8192('0x36')][_0x8192('0x4f')]({'where':{'id':_0x5da768['params']['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x3888b9,null))['then'](removeEntity(_0x3888b9,null))[_0x8192('0x4d')](handleError(_0x3888b9,null));};exports[_0x8192('0x59')]=function(_0x33e47b,_0x26f5df){return db['MailQueue'][_0x8192('0x59')]()[_0x8192('0x2c')](respondWithResult(_0x26f5df,null))[_0x8192('0x4d')](handleError(_0x26f5df,null));};exports['getMembers']=function(_0x10ea1e,_0x55434c,_0x3bba88){var _0x315622={'raw':!![],'where':{}},_0x53b204={},_0x42b351;return db[_0x8192('0x36')][_0x8192('0x5a')]({'where':{'id':_0x10ea1e[_0x8192('0x58')]['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x55434c,null))[_0x8192('0x2c')](function(_0x297773){if(_0x297773){_0x42b351=_0x297773[_0x8192('0x2d')]({'plain':!![]});_0x53b204[_0x8192('0x3b')]=_[_0x8192('0x3c')](db['UserMailQueue']['rawAttributes']);_0x53b204[_0x8192('0x3d')]=_[_0x8192('0x3c')](_0x10ea1e['query']);_0x53b204[_0x8192('0x3e')]=_[_0x8192('0x3f')](_0x53b204[_0x8192('0x3b')],_0x53b204[_0x8192('0x3d')]);_0x315622[_0x8192('0x41')]=_[_0x8192('0x3f')](_0x53b204['model'],qs['fields'](_0x10ea1e[_0x8192('0x3d')]['fields']));_0x315622[_0x8192('0x41')]=_0x315622[_0x8192('0x41')]['length']?_0x315622[_0x8192('0x41')]:_0x53b204['model'];if(!_0x10ea1e[_0x8192('0x3d')]['hasOwnProperty'](_0x8192('0x44'))){_0x315622[_0x8192('0x27')]=qs['limit'](_0x10ea1e[_0x8192('0x3d')][_0x8192('0x27')]);_0x315622['offset']=qs[_0x8192('0x25')](_0x10ea1e[_0x8192('0x3d')][_0x8192('0x25')]);}_0x315622[_0x8192('0x45')]=qs[_0x8192('0x46')](_0x10ea1e[_0x8192('0x3d')][_0x8192('0x46')]);_0x315622[_0x8192('0x47')]=qs[_0x8192('0x3e')](_[_0x8192('0x48')](_0x10ea1e['query'],_0x53b204['filters']));_0x315622['where'][_0x8192('0x5b')]=_0x297773['id'];if(_0x10ea1e['query'][_0x8192('0x5c')]){_0x315622[_0x8192('0x47')]=_[_0x8192('0x49')](_0x315622[_0x8192('0x47')],{'$or':_[_0x8192('0x35')](_0x315622[_0x8192('0x41')],function(_0x2d10c9){var _0xcd6157={};_0xcd6157[_0x2d10c9]={'$like':'%'+_0x10ea1e['query'][_0x8192('0x5c')]+'%'};return _0xcd6157;})});}_0x315622=_['merge']({},_0x315622,_0x10ea1e[_0x8192('0x4e')]);return db['UserMailQueue'][_0x8192('0x4b')](_0x315622);}})[_0x8192('0x2c')](function(_0x47e093){if(_0x47e093){return db['User'][_0x8192('0x5d')]({'where':{'id':_['map'](_0x47e093,'UserId'),'role':'agent'},'attributes':['id',_0x8192('0x32'),_0x8192('0x5e'),'updatedAt',_0x8192('0x5f')]});}})[_0x8192('0x2c')](function(_0x4f84d5){if(_0x4f84d5){return{'count':_0x4f84d5[_0x8192('0x28')],'rows':_[_0x8192('0x35')](_0x4f84d5[_0x8192('0x4c')],function(_0x4d508e){return{'membername':_0x4d508e['name'],'UserId':_0x4d508e['id'],'queue_name':_0x42b351[_0x8192('0x32')],'MailQueueId':_0x42b351['id'],'interface':util[_0x8192('0x60')]('%s/%s',_0x8192('0x61'),_0x4d508e[_0x8192('0x32')]),'penalty':0x0,'paused':_0x4d508e[_0x8192('0x5e')],'createdAt':_0x4d508e[_0x8192('0x5f')],'updatedAt':_0x4d508e[_0x8192('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55434c,_0x315622))[_0x8192('0x4d')](handleError(_0x55434c,null));};exports[_0x8192('0x63')]=function(_0x468aa6,_0x5f0edb,_0x51852e){var _0x4f3c96={};var _0x2b6a32={};var _0x5829c1;var _0x35cc25;return db['MailQueue'][_0x8192('0x5a')]({'where':{'id':_0x468aa6['params']['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x5f0edb,null))[_0x8192('0x2c')](function(_0xe0220d){if(_0xe0220d){_0x5829c1=_0xe0220d;_0x2b6a32['model']=_[_0x8192('0x3c')](db[_0x8192('0x64')]['rawAttributes']);_0x2b6a32[_0x8192('0x3d')]=_[_0x8192('0x3c')](_0x468aa6['query']);_0x2b6a32[_0x8192('0x3e')]=_[_0x8192('0x3f')](_0x2b6a32[_0x8192('0x3b')],_0x2b6a32[_0x8192('0x3d')]);_0x4f3c96[_0x8192('0x41')]=_[_0x8192('0x3f')](_0x2b6a32[_0x8192('0x3b')],qs[_0x8192('0x40')](_0x468aa6[_0x8192('0x3d')][_0x8192('0x40')]));_0x4f3c96[_0x8192('0x41')]=_0x4f3c96[_0x8192('0x41')][_0x8192('0x42')]?_0x4f3c96[_0x8192('0x41')]:_0x2b6a32['model'];_0x4f3c96['order']=qs[_0x8192('0x46')](_0x468aa6['query']['sort']);_0x4f3c96[_0x8192('0x47')]=qs[_0x8192('0x3e')](_['pick'](_0x468aa6[_0x8192('0x3d')],_0x2b6a32[_0x8192('0x3e')]));if(_0x468aa6[_0x8192('0x3d')]['filter']){_0x4f3c96[_0x8192('0x47')]=_[_0x8192('0x49')](_0x4f3c96[_0x8192('0x47')],{'$or':_[_0x8192('0x35')](_0x4f3c96[_0x8192('0x41')],function(_0x1cc86b){var _0x74856c={};_0x74856c[_0x1cc86b]={'$like':'%'+_0x468aa6['query'][_0x8192('0x5c')]+'%'};return _0x74856c;})});}_0x4f3c96=_[_0x8192('0x49')]({},_0x4f3c96,_0x468aa6['options']);return _0x5829c1['getTeams'](_0x4f3c96);}})['then'](function(_0x4e6be9){if(_0x4e6be9){_0x35cc25=_0x4e6be9['length'];if(!_0x468aa6[_0x8192('0x3d')]['hasOwnProperty'](_0x8192('0x44'))){_0x4f3c96[_0x8192('0x27')]=qs[_0x8192('0x27')](_0x468aa6['query'][_0x8192('0x27')]);_0x4f3c96[_0x8192('0x25')]=qs[_0x8192('0x25')](_0x468aa6[_0x8192('0x3d')]['offset']);}return _0x5829c1[_0x8192('0x63')](_0x4f3c96);}})[_0x8192('0x2c')](function(_0x3df742){if(_0x3df742){return _0x3df742?{'count':_0x35cc25,'rows':_0x3df742}:null;}})[_0x8192('0x2c')](respondWithResult(_0x5f0edb,null))[_0x8192('0x4d')](handleError(_0x5f0edb,null));};exports[_0x8192('0x65')]=function(_0x1e78f2,_0x5666c2,_0x4593a2){var _0x2995c8=_0x1e78f2[_0x8192('0x57')][_0x8192('0x66')];return db[_0x8192('0x64')][_0x8192('0x4b')]({'where':{'id':_0x2995c8},'attributes':['id'],'include':[{'model':db[_0x8192('0x67')],'as':_0x8192('0x68'),'attributes':['id',_0x8192('0x32'),_0x8192('0x69'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0xd234e0){if(_0xd234e0){var _0x44e5ec=_[_0x8192('0x6a')](_0xd234e0,function(_0x922efb){var _0x266109=_0x922efb[_0x8192('0x2d')]({'plain':!![]});return _0x266109['Agents'];});return db[_0x8192('0x36')][_0x8192('0x4f')]({'where':{'id':_0x1e78f2[_0x8192('0x58')]['id']}})[_0x8192('0x2c')](function(_0x5c8d01){return db['sequelize'][_0x8192('0x6b')](function(_0x2c457d){return _0x5c8d01['addTeams'](_0x2995c8,{'transaction':_0x2c457d})['then'](function(){return BPromise[_0x8192('0x6c')](_0x44e5ec,function(_0x22d673){return db[_0x8192('0x6d')][_0x8192('0x6e')]({'where':{'UserId':_0x22d673['id'],'MailQueueId':_0x1e78f2['params']['id']},'transaction':_0x2c457d});});})[_0x8192('0x2c')](function(){_0x44e5ec[_0x8192('0x6f')](function(_0x42b23d){socket['emit'](_0x8192('0x70'),{'UserId':_0x42b23d['id'],'MailQueueId':_0x5c8d01['id']});});});});});}})[_0x8192('0x2c')](respondWithStatusCode(_0x5666c2,null))[_0x8192('0x4d')](handleError(_0x5666c2,null));};exports[_0x8192('0x71')]=function(_0x55c712,_0x36da8e,_0x3ad701){return db[_0x8192('0x64')][_0x8192('0x4b')]({'where':{'id':_0x55c712[_0x8192('0x3d')][_0x8192('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8192('0x2c')](handleEntityNotFound(_0x36da8e,null))['then'](function(_0x199445){var _0x52551b=_[_0x8192('0x35')](_0x199445,'id');var _0x2ea6dd=[];var _0x15b256=[];var _0x1ae35c=squel[_0x8192('0x72')]();_0x1ae35c[_0x8192('0x73')](_0x8192('0x74'))['from'](_0x8192('0x75'),'tq')[_0x8192('0x76')](_0x8192('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8192('0x47')](_0x8192('0x78'),_0x55c712['params']['id']);for(var _0x4a861c=0x0;_0x4a861c<_0x199445[_0x8192('0x42')];_0x4a861c+=0x1){let _0x2931fc=_0x199445[_0x4a861c];for(var _0x464ed1=0x0;_0x464ed1<_0x2931fc[_0x8192('0x68')][_0x8192('0x42')];_0x464ed1+=0x1){let _0xd9deb8=_0x2931fc['Agents'][_0x464ed1];var _0x6e7766=_0x1ae35c['clone']();_0x6e7766['where']('ut.UserId\x20=\x20?',_0xd9deb8['id']);_0x15b256[_0x8192('0x79')](db[_0x8192('0x7a')][_0x8192('0x3d')](_0x6e7766[_0x8192('0x7b')](),{'type':db[_0x8192('0x7a')][_0x8192('0x7c')][_0x8192('0x7d')]})[_0x8192('0x2c')](function(_0xe4b035){if(_0xe4b035['length']===0x1){return _0xd9deb8['id'];}else{var _0x3dd9fd=_[_0x8192('0x7e')](_[_0x8192('0x35')](_0xe4b035,_0x8192('0x7f')),function(_0x5dbe54){return _[_0x8192('0x80')](_0x52551b,_0x5dbe54);});if(_0x3dd9fd){return _0xd9deb8['id'];}}}));}}return BPromise[_0x8192('0x81')](_0x15b256)[_0x8192('0x2c')](function(_0x291187){_0x2ea6dd=_(_0x2ea6dd)['union'](_0x291187)[_0x8192('0x82')]()[_0x8192('0x83')]();return db[_0x8192('0x36')][_0x8192('0x4f')]({'where':{'id':_0x55c712['params']['id']}})['then'](function(_0x58f8d3){return db[_0x8192('0x7a')][_0x8192('0x6b')](function(_0x466309){return _0x58f8d3[_0x8192('0x71')](_0x55c712[_0x8192('0x3d')][_0x8192('0x66')],{'transaction':_0x466309})['then'](function(){if(!_[_0x8192('0x84')](_0x2ea6dd)){return _0x58f8d3[_0x8192('0x85')](_0x2ea6dd,{'transaction':_0x466309});}})['then'](function(){_0x2ea6dd[_0x8192('0x6f')](function(_0x1b7cb0){socket[_0x8192('0x86')]('userMailQueue:remove',{'UserId':_0x1b7cb0,'MailQueueId':_0x58f8d3['id']});});});});});});})['then'](respondWithStatusCode(_0x36da8e,null))['catch'](handleError(_0x36da8e,null));};exports[_0x8192('0x87')]=function(_0x117a69,_0x47d8e5,_0x5ec623){return db[_0x8192('0x36')]['find']({'where':{'id':_0x117a69[_0x8192('0x58')]['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x47d8e5,null))[_0x8192('0x2c')](function(_0x915ca){if(_0x915ca){return _0x915ca['addAgents'](_0x117a69[_0x8192('0x57')][_0x8192('0x66')],_['omit'](_0x117a69[_0x8192('0x57')],[_0x8192('0x66'),'id'])||{})[_0x8192('0x88')](function(_0x37503b){for(var _0x311d73=0x0;_0x311d73<_0x117a69[_0x8192('0x57')][_0x8192('0x66')][_0x8192('0x42')];_0x311d73+=0x1){socket[_0x8192('0x86')](_0x8192('0x70'),{'UserId':Number(_0x117a69[_0x8192('0x57')][_0x8192('0x66')][_0x311d73]),'MailQueueId':Number(_0x117a69[_0x8192('0x58')]['id'])});}return _0x37503b;});}})[_0x8192('0x2c')](respondWithResult(_0x47d8e5,null))[_0x8192('0x4d')](handleError(_0x47d8e5,null));};exports[_0x8192('0x85')]=function(_0x3d569c,_0x4df83a,_0x43f574){return db[_0x8192('0x36')][_0x8192('0x4f')]({'where':{'id':_0x3d569c[_0x8192('0x58')]['id']}})['then'](handleEntityNotFound(_0x4df83a,null))[_0x8192('0x2c')](function(_0x2a11a7){if(_0x2a11a7){return _0x2a11a7[_0x8192('0x85')](_0x3d569c['query'][_0x8192('0x66')])[_0x8192('0x2c')](function(){if(_[_0x8192('0x89')](_0x3d569c[_0x8192('0x3d')]['ids'])){for(var _0x2cd0ce=0x0;_0x2cd0ce<_0x3d569c[_0x8192('0x3d')][_0x8192('0x66')][_0x8192('0x42')];_0x2cd0ce+=0x1){socket[_0x8192('0x86')]('userMailQueue:remove',{'UserId':Number(_0x3d569c[_0x8192('0x3d')][_0x8192('0x66')][_0x2cd0ce]),'MailQueueId':Number(_0x3d569c['params']['id'])});}}else{socket['emit'](_0x8192('0x8a'),{'UserId':Number(_0x3d569c[_0x8192('0x3d')][_0x8192('0x66')]),'MailQueueId':Number(_0x3d569c[_0x8192('0x58')]['id'])});}});}})[_0x8192('0x2c')](respondWithStatusCode(_0x4df83a,null))[_0x8192('0x4d')](handleError(_0x4df83a,null));};exports[_0x8192('0x8b')]=function(_0x40d291,_0x39d107,_0xf380cb){var _0x17db34={};var _0x2364f1={};var _0x3b02c4;var _0x237abf;return db[_0x8192('0x36')][_0x8192('0x5a')]({'where':{'id':_0x40d291[_0x8192('0x58')]['id']}})[_0x8192('0x2c')](handleEntityNotFound(_0x39d107,null))[_0x8192('0x2c')](function(_0x529df8){if(_0x529df8){_0x3b02c4=_0x529df8;_0x2364f1['model']=_['keys'](db[_0x8192('0x67')][_0x8192('0x37')]);_0x2364f1['query']=_[_0x8192('0x3c')](_0x40d291[_0x8192('0x3d')]);_0x2364f1[_0x8192('0x3e')]=_['intersection'](_0x2364f1[_0x8192('0x3b')],_0x2364f1[_0x8192('0x3d')]);_0x17db34[_0x8192('0x41')]=_[_0x8192('0x3f')](_0x2364f1[_0x8192('0x3b')],qs['fields'](_0x40d291['query'][_0x8192('0x40')]));_0x17db34[_0x8192('0x41')]=_0x17db34[_0x8192('0x41')][_0x8192('0x42')]?_0x17db34['attributes']:_0x2364f1['model'];_0x17db34[_0x8192('0x45')]=qs[_0x8192('0x46')](_0x40d291[_0x8192('0x3d')]['sort']);_0x17db34[_0x8192('0x47')]=qs[_0x8192('0x3e')](_[_0x8192('0x48')](_0x40d291['query'],_0x2364f1[_0x8192('0x3e')]));if(_0x40d291['query'][_0x8192('0x5c')]){_0x17db34[_0x8192('0x47')]=_[_0x8192('0x49')](_0x17db34[_0x8192('0x47')],{'$or':_[_0x8192('0x35')](_0x17db34[_0x8192('0x41')],function(_0x4c5402){var _0x8223ab={};_0x8223ab[_0x4c5402]={'$like':'%'+_0x40d291[_0x8192('0x3d')][_0x8192('0x5c')]+'%'};return _0x8223ab;})});}_0x17db34=_[_0x8192('0x49')]({},_0x17db34,_0x40d291[_0x8192('0x4e')]);return _0x3b02c4[_0x8192('0x8b')](_0x17db34);}})[_0x8192('0x2c')](function(_0x547249){if(_0x547249){_0x237abf=_0x547249[_0x8192('0x42')];if(!_0x40d291[_0x8192('0x3d')][_0x8192('0x43')](_0x8192('0x44'))){_0x17db34[_0x8192('0x27')]=qs[_0x8192('0x27')](_0x40d291['query'][_0x8192('0x27')]);_0x17db34[_0x8192('0x25')]=qs[_0x8192('0x25')](_0x40d291[_0x8192('0x3d')][_0x8192('0x25')]);}return _0x3b02c4[_0x8192('0x8b')](_0x17db34);}})[_0x8192('0x2c')](function(_0x2048ca){if(_0x2048ca){return _0x2048ca?{'count':_0x237abf,'rows':_0x2048ca}:null;}})[_0x8192('0x2c')](respondWithResult(_0x39d107,null))[_0x8192('0x4d')](handleError(_0x39d107,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a753c9a..b7466dd 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 _0x996e=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x996e,0x1a0));var _0xe996=function(_0x45d15e,_0x1d7a94){_0x45d15e=_0x45d15e-0x0;var _0x23c486=_0x996e[_0x45d15e];return _0x23c486;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xe996('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe996('0x1')](0x0);var events={'afterCreate':_0xe996('0x2'),'afterUpdate':_0xe996('0x3'),'afterDestroy':_0xe996('0x4')};function emitEvent(_0x2c09ba){return function(_0x2ffe37,_0xe2dcc0,_0xae7789){MailQueueEvents[_0xe996('0x5')](_0x2c09ba+':'+_0x2ffe37['id'],_0x2ffe37);MailQueueEvents[_0xe996('0x5')](_0x2c09ba,_0x2ffe37);_0xae7789(null);};}for(var e in events){if(events[_0xe996('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xe996('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x7902=['events','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x41a546,_0x35ad39){var _0x20f9aa=function(_0x5bafc7){while(--_0x5bafc7){_0x41a546['push'](_0x41a546['shift']());}};_0x20f9aa(++_0x35ad39);}(_0x7902,0x1e8));var _0x2790=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x7902[_0x7791d5];return _0x5ce288;};'use strict';var EventEmitter=require(_0x2790('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x2790('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2790('0x2')](0x0);var events={'afterCreate':_0x2790('0x3'),'afterUpdate':_0x2790('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e42a1){return function(_0x218cf0,_0x277feb,_0xa7ae44){MailQueueEvents[_0x2790('0x5')](_0x4e42a1+':'+_0x218cf0['id'],_0x218cf0);MailQueueEvents[_0x2790('0x5')](_0x4e42a1,_0x218cf0);_0xa7ae44(null);};}for(var e in events){if(events[_0x2790('0x6')](e)){var event=events[e];MailQueue[_0x2790('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 573d119..d15287b 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 _0x9275=['./mailQueue.attributes','exports','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x77ad70,_0x4593bc){var _0x5c3e14=function(_0x3b0f34){while(--_0x3b0f34){_0x77ad70['push'](_0x77ad70['shift']());}};_0x5c3e14(++_0x4593bc);}(_0x9275,0x1a7));var _0x5927=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x9275[_0x448f8];return _0xa73126;};'use strict';var _=require(_0x5927('0x0'));var util=require(_0x5927('0x1'));var logger=require('../../config/logger')(_0x5927('0x2'));var moment=require(_0x5927('0x3'));var BPromise=require(_0x5927('0x4'));var rp=require(_0x5927('0x5'));var fs=require('fs');var path=require(_0x5927('0x6'));var rimraf=require(_0x5927('0x7'));var config=require(_0x5927('0x8'));var attributes=require(_0x5927('0x9'));module[_0x5927('0xa')]=function(_0x385793,_0x346714){return _0x385793['define']('MailQueue',attributes,{'tableName':_0x5927('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ed6=['MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x1ed6,0xc5));var _0x61ed=function(_0x13bd97,_0x1098c1){_0x13bd97=_0x13bd97-0x0;var _0x1425ea=_0x1ed6[_0x13bd97];return _0x1425ea;};'use strict';var _=require(_0x61ed('0x0'));var util=require(_0x61ed('0x1'));var logger=require('../../config/logger')(_0x61ed('0x2'));var moment=require(_0x61ed('0x3'));var BPromise=require(_0x61ed('0x4'));var rp=require(_0x61ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61ed('0x6'));var config=require(_0x61ed('0x7'));var attributes=require(_0x61ed('0x8'));module[_0x61ed('0x9')]=function(_0x8c072c,_0x52b8da){return _0x8c072c[_0x61ed('0xa')](_0x61ed('0xb'),attributes,{'tableName':_0x61ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index c5f8f37..a739c8d 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 _0xca0a=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','options','attributes','include','map','model','ShowMailQueue','MailQueue','find','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xca0a,0xb8));var _0xaca0=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xca0a[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xaca0('0x0'));var util=require('util');var moment=require(_0xaca0('0x1'));var BPromise=require(_0xaca0('0x2'));var rs=require(_0xaca0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaca0('0x4'))['db'];var utils=require(_0xaca0('0x5'));var logger=require(_0xaca0('0x6'))('rpc');var config=require(_0xaca0('0x7'));var jayson=require(_0xaca0('0x8'));var client=jayson[_0xaca0('0x9')][_0xaca0('0xa')]({'port':0x232a});config[_0xaca0('0xb')]=_['defaults'](config[_0xaca0('0xb')],{'host':_0xaca0('0xc'),'port':0x18eb});var socket=require(_0xaca0('0xd'))(new Redis(config['redis']));require(_0xaca0('0xe'))[_0xaca0('0xf')](socket);function respondWithRpcPromise(_0x57a67a,_0x4ecf84,_0xe42ee5){return new BPromise(function(_0x4a17c4,_0x152778){return client[_0xaca0('0x10')](_0x57a67a,_0xe42ee5)[_0xaca0('0x11')](function(_0x200149){logger[_0xaca0('0x12')](_0xaca0('0x13'),_0x4ecf84,_0xaca0('0x14'));logger[_0xaca0('0x15')](_0xaca0('0x16'),_0x4ecf84,_0xaca0('0x14'),JSON[_0xaca0('0x17')](_0x200149));if(_0x200149[_0xaca0('0x18')]){if(_0x200149[_0xaca0('0x18')]['code']===0x1f4){logger[_0xaca0('0x18')](_0xaca0('0x13'),_0x4ecf84,_0x200149[_0xaca0('0x18')][_0xaca0('0x19')]);return _0x152778(_0x200149[_0xaca0('0x18')][_0xaca0('0x19')]);}logger[_0xaca0('0x18')](_0xaca0('0x13'),_0x4ecf84,_0x200149['error']['message']);return _0x4a17c4(_0x200149[_0xaca0('0x18')][_0xaca0('0x19')]);}else{logger[_0xaca0('0x12')](_0xaca0('0x13'),_0x4ecf84,'request\x20sent');_0x4a17c4(_0x200149[_0xaca0('0x1a')]['message']);}})[_0xaca0('0x1b')](function(_0x2731e1){logger[_0xaca0('0x18')](_0xaca0('0x13'),_0x4ecf84,_0x2731e1);_0x152778(_0x2731e1);});});}exports[_0xaca0('0x1c')]=function(_0x1d06c0){var _0x750b6e=this;return new Promise(function(_0x24cc30,_0x2d0e7e){return db['MailQueue']['findAll']({'raw':_0x1d06c0['options']?_0x1d06c0[_0xaca0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1d06c0[_0xaca0('0x1d')]?_0x1d06c0['options']['where']||null:null,'attributes':_0x1d06c0[_0xaca0('0x1d')]?_0x1d06c0[_0xaca0('0x1d')][_0xaca0('0x1e')]||null:null,'limit':_0x1d06c0[_0xaca0('0x1d')]?_0x1d06c0[_0xaca0('0x1d')]['limit']||null:null,'include':_0x1d06c0[_0xaca0('0x1d')]?_0x1d06c0[_0xaca0('0x1d')][_0xaca0('0x1f')]?_[_0xaca0('0x20')](_0x1d06c0[_0xaca0('0x1d')]['include'],function(_0x42abbb){return{'model':db[_0x42abbb[_0xaca0('0x21')]],'as':_0x42abbb['as'],'attributes':_0x42abbb['attributes'],'include':_0x42abbb[_0xaca0('0x1f')]?_['map'](_0x42abbb[_0xaca0('0x1f')],function(_0x840c74){return{'model':db[_0x840c74[_0xaca0('0x21')]],'as':_0x840c74['as'],'attributes':_0x840c74[_0xaca0('0x1e')],'include':_0x840c74['include']?_[_0xaca0('0x20')](_0x840c74[_0xaca0('0x1f')],function(_0x218810){return{'model':db[_0x218810[_0xaca0('0x21')]],'as':_0x218810['as'],'attributes':_0x218810['attributes']};}):[]};}):[]};}):[]:[]})[_0xaca0('0x11')](function(_0x57a8f8){logger[_0xaca0('0x12')](_0xaca0('0x1c'),_0x1d06c0);logger[_0xaca0('0x15')](_0xaca0('0x1c'),_0x1d06c0,JSON['stringify'](_0x57a8f8));_0x24cc30(_0x57a8f8);})['catch'](function(_0x43be14){logger['error'](_0xaca0('0x1c'),_0x43be14[_0xaca0('0x19')],_0x1d06c0);_0x2d0e7e(_0x750b6e[_0xaca0('0x18')](0x1f4,_0x43be14[_0xaca0('0x19')]));});});};exports[_0xaca0('0x22')]=function(_0x5a5654){var _0x456333=this;return new Promise(function(_0x74dcd5,_0x2a1fe1){return db[_0xaca0('0x23')][_0xaca0('0x24')]({'raw':_0x5a5654[_0xaca0('0x1d')]?_0x5a5654[_0xaca0('0x1d')][_0xaca0('0x25')]===undefined?!![]:![]:!![],'where':_0x5a5654[_0xaca0('0x1d')]?_0x5a5654['options']['where']||null:null,'attributes':_0x5a5654['options']?_0x5a5654[_0xaca0('0x1d')][_0xaca0('0x1e')]||null:null,'include':_0x5a5654[_0xaca0('0x1d')]?_0x5a5654['options'][_0xaca0('0x1f')]?_[_0xaca0('0x20')](_0x5a5654[_0xaca0('0x1d')]['include'],function(_0x1b2878){return{'model':db[_0x1b2878[_0xaca0('0x21')]],'as':_0x1b2878['as'],'attributes':_0x1b2878[_0xaca0('0x1e')],'include':_0x1b2878['include']?_[_0xaca0('0x20')](_0x1b2878[_0xaca0('0x1f')],function(_0x409272){return{'model':db[_0x409272[_0xaca0('0x21')]],'as':_0x409272['as'],'attributes':_0x409272[_0xaca0('0x1e')],'include':_0x409272[_0xaca0('0x1f')]?_[_0xaca0('0x20')](_0x409272[_0xaca0('0x1f')],function(_0x45b91b){return{'model':db[_0x45b91b[_0xaca0('0x21')]],'as':_0x45b91b['as'],'attributes':_0x45b91b[_0xaca0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x416ec3){logger[_0xaca0('0x12')](_0xaca0('0x22'),_0x5a5654);logger[_0xaca0('0x15')](_0xaca0('0x22'),_0x5a5654,JSON[_0xaca0('0x17')](_0x416ec3));_0x74dcd5(_0x416ec3);})[_0xaca0('0x1b')](function(_0x4d7dfc){logger['error'](_0xaca0('0x22'),_0x4d7dfc[_0xaca0('0x19')],_0x5a5654);_0x2a1fe1(_0x456333['error'](0x1f4,_0x4d7dfc[_0xaca0('0x19')]));});});}; \ No newline at end of file +var _0x8a56=['redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2d9d75,_0x12099c){var _0x48a02f=function(_0x12ff48){while(--_0x12ff48){_0x2d9d75['push'](_0x2d9d75['shift']());}};_0x48a02f(++_0x12099c);}(_0x8a56,0xf0));var _0x68a5=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x8a56[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var moment=require(_0x68a5('0x2'));var BPromise=require(_0x68a5('0x3'));var rs=require(_0x68a5('0x4'));var fs=require('fs');var Redis=require(_0x68a5('0x5'));var db=require(_0x68a5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68a5('0x7'))(_0x68a5('0x8'));var config=require(_0x68a5('0x9'));var jayson=require(_0x68a5('0xa'));var client=jayson['client'][_0x68a5('0xb')]({'port':0x232a});config[_0x68a5('0xc')]=_[_0x68a5('0xd')](config[_0x68a5('0xc')],{'host':_0x68a5('0xe'),'port':0x18eb});var socket=require(_0x68a5('0xf'))(new Redis(config[_0x68a5('0xc')]));require(_0x68a5('0x10'))[_0x68a5('0x11')](socket);function respondWithRpcPromise(_0x5d0f33,_0x4efecf,_0x56104e){return new BPromise(function(_0x366fc6,_0x82b771){return client[_0x68a5('0x12')](_0x5d0f33,_0x56104e)[_0x68a5('0x13')](function(_0x34f6d6){logger[_0x68a5('0x14')](_0x68a5('0x15'),_0x4efecf,'request\x20sent');logger[_0x68a5('0x16')](_0x68a5('0x17'),_0x4efecf,_0x68a5('0x18'),JSON[_0x68a5('0x19')](_0x34f6d6));if(_0x34f6d6[_0x68a5('0x1a')]){if(_0x34f6d6[_0x68a5('0x1a')][_0x68a5('0x1b')]===0x1f4){logger[_0x68a5('0x1a')]('MailQueue,\x20%s,\x20%s',_0x4efecf,_0x34f6d6[_0x68a5('0x1a')][_0x68a5('0x1c')]);return _0x82b771(_0x34f6d6[_0x68a5('0x1a')][_0x68a5('0x1c')]);}logger[_0x68a5('0x1a')]('MailQueue,\x20%s,\x20%s',_0x4efecf,_0x34f6d6[_0x68a5('0x1a')][_0x68a5('0x1c')]);return _0x366fc6(_0x34f6d6[_0x68a5('0x1a')][_0x68a5('0x1c')]);}else{logger[_0x68a5('0x14')](_0x68a5('0x15'),_0x4efecf,_0x68a5('0x18'));_0x366fc6(_0x34f6d6[_0x68a5('0x1d')][_0x68a5('0x1c')]);}})[_0x68a5('0x1e')](function(_0xbc1ecc){logger[_0x68a5('0x1a')](_0x68a5('0x15'),_0x4efecf,_0xbc1ecc);_0x82b771(_0xbc1ecc);});});}exports[_0x68a5('0x1f')]=function(_0x55f5d5){var _0x1f3a67=this;return new Promise(function(_0x4c2506,_0x335ad7){return db[_0x68a5('0x20')][_0x68a5('0x21')]({'raw':_0x55f5d5[_0x68a5('0x22')]?_0x55f5d5['options'][_0x68a5('0x23')]===undefined?!![]:![]:!![],'where':_0x55f5d5[_0x68a5('0x22')]?_0x55f5d5[_0x68a5('0x22')]['where']||null:null,'attributes':_0x55f5d5[_0x68a5('0x22')]?_0x55f5d5[_0x68a5('0x22')][_0x68a5('0x24')]||null:null,'limit':_0x55f5d5[_0x68a5('0x22')]?_0x55f5d5[_0x68a5('0x22')]['limit']||null:null,'include':_0x55f5d5[_0x68a5('0x22')]?_0x55f5d5['options'][_0x68a5('0x25')]?_[_0x68a5('0x26')](_0x55f5d5['options']['include'],function(_0x48b844){return{'model':db[_0x48b844[_0x68a5('0x27')]],'as':_0x48b844['as'],'attributes':_0x48b844[_0x68a5('0x24')],'include':_0x48b844[_0x68a5('0x25')]?_[_0x68a5('0x26')](_0x48b844[_0x68a5('0x25')],function(_0xb3f7e8){return{'model':db[_0xb3f7e8['model']],'as':_0xb3f7e8['as'],'attributes':_0xb3f7e8['attributes'],'include':_0xb3f7e8[_0x68a5('0x25')]?_['map'](_0xb3f7e8['include'],function(_0x5f40b9){return{'model':db[_0x5f40b9[_0x68a5('0x27')]],'as':_0x5f40b9['as'],'attributes':_0x5f40b9[_0x68a5('0x24')]};}):[]};}):[]};}):[]:[]})[_0x68a5('0x13')](function(_0x2efb2c){logger['info'](_0x68a5('0x1f'),_0x55f5d5);logger['debug'](_0x68a5('0x1f'),_0x55f5d5,JSON[_0x68a5('0x19')](_0x2efb2c));_0x4c2506(_0x2efb2c);})[_0x68a5('0x1e')](function(_0x28566d){logger[_0x68a5('0x1a')](_0x68a5('0x1f'),_0x28566d['message'],_0x55f5d5);_0x335ad7(_0x1f3a67[_0x68a5('0x1a')](0x1f4,_0x28566d[_0x68a5('0x1c')]));});});};exports[_0x68a5('0x28')]=function(_0x1a4611){var _0x169572=this;return new Promise(function(_0x36b43b,_0x13d384){return db[_0x68a5('0x20')][_0x68a5('0x29')]({'raw':_0x1a4611[_0x68a5('0x22')]?_0x1a4611[_0x68a5('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x1a4611['options']?_0x1a4611['options']['where']||null:null,'attributes':_0x1a4611[_0x68a5('0x22')]?_0x1a4611[_0x68a5('0x22')][_0x68a5('0x24')]||null:null,'include':_0x1a4611[_0x68a5('0x22')]?_0x1a4611[_0x68a5('0x22')][_0x68a5('0x25')]?_[_0x68a5('0x26')](_0x1a4611['options'][_0x68a5('0x25')],function(_0x2c7933){return{'model':db[_0x2c7933['model']],'as':_0x2c7933['as'],'attributes':_0x2c7933['attributes'],'include':_0x2c7933[_0x68a5('0x25')]?_[_0x68a5('0x26')](_0x2c7933[_0x68a5('0x25')],function(_0x1c7e99){return{'model':db[_0x1c7e99['model']],'as':_0x1c7e99['as'],'attributes':_0x1c7e99[_0x68a5('0x24')],'include':_0x1c7e99[_0x68a5('0x25')]?_[_0x68a5('0x26')](_0x1c7e99[_0x68a5('0x25')],function(_0x348f04){return{'model':db[_0x348f04[_0x68a5('0x27')]],'as':_0x348f04['as'],'attributes':_0x348f04[_0x68a5('0x24')]};}):[]};}):[]};}):[]:[]})[_0x68a5('0x13')](function(_0x2be671){logger['info'](_0x68a5('0x28'),_0x1a4611);logger['debug'](_0x68a5('0x28'),_0x1a4611,JSON[_0x68a5('0x19')](_0x2be671));_0x36b43b(_0x2be671);})['catch'](function(_0x206ed0){logger[_0x68a5('0x1a')]('ShowMailQueue',_0x206ed0[_0x68a5('0x1c')],_0x1a4611);_0x13d384(_0x169572[_0x68a5('0x1a')](0x1f4,_0x206ed0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 05560c2..ea2e004 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 _0x505c=['remove','update','emit','removeListener','register','./mailQueue.events'];(function(_0x28bfdc,_0x50fd27){var _0x25bf45=function(_0x17f94a){while(--_0x17f94a){_0x28bfdc['push'](_0x28bfdc['shift']());}};_0x25bf45(++_0x50fd27);}(_0x505c,0x149));var _0xc505=function(_0x1644f2,_0x2884e8){_0x1644f2=_0x1644f2-0x0;var _0x1fcb31=_0x505c[_0x1644f2];return _0x1fcb31;};'use strict';var MailQueueEvents=require(_0xc505('0x0'));var events=['save',_0xc505('0x1'),_0xc505('0x2')];function createListener(_0x2d5022,_0x132a07){return function(_0x9f15b4){_0x132a07[_0xc505('0x3')](_0x2d5022,_0x9f15b4);};}function removeListener(_0x5856fb,_0x1a5f51){return function(){MailQueueEvents[_0xc505('0x4')](_0x5856fb,_0x1a5f51);};}exports[_0xc505('0x5')]=function(_0x5a5877){for(var _0x70741=0x0,_0x2ba551=events['length'];_0x70741<_0x2ba551;_0x70741++){var _0x4ed102=events[_0x70741];var _0x1a32b0=createListener('mailQueue:'+_0x4ed102,_0x5a5877);MailQueueEvents['on'](_0x4ed102,_0x1a32b0);}}; \ No newline at end of file +var _0xd06e=['remove','update','emit','length','mailQueue:','./mailQueue.events','save'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0xd06e,0x91));var _0xed06=function(_0x550095,_0x141d19){_0x550095=_0x550095-0x0;var _0x1c35b0=_0xd06e[_0x550095];return _0x1c35b0;};'use strict';var MailQueueEvents=require(_0xed06('0x0'));var events=[_0xed06('0x1'),_0xed06('0x2'),_0xed06('0x3')];function createListener(_0x3a5d39,_0x41828e){return function(_0x4cb15d){_0x41828e[_0xed06('0x4')](_0x3a5d39,_0x4cb15d);};}function removeListener(_0x529fca,_0xcb3496){return function(){MailQueueEvents['removeListener'](_0x529fca,_0xcb3496);};}exports['register']=function(_0x160a3c){for(var _0x2c4c1d=0x0,_0x548ed7=events[_0xed06('0x5')];_0x2c4c1d<_0x548ed7;_0x2c4c1d++){var _0x148eda=events[_0x2c4c1d];var _0x1a61ec=createListener(_0xed06('0x6')+_0x148eda,_0x160a3c);MailQueueEvents['on'](_0x148eda,_0x1a61ec);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ac2d66b..3ee1399 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 _0x581e=['isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x4fc524,_0x37158a){var _0x43b5fe=function(_0x462e6d){while(--_0x462e6d){_0x4fc524['push'](_0x4fc524['shift']());}};_0x43b5fe(++_0x37158a);}(_0x581e,0x89));var _0xe581=function(_0x33865a,_0x5a9cd7){_0x33865a=_0x33865a-0x0;var _0x44301f=_0x581e[_0x33865a];return _0x44301f;};'use strict';var multer=require(_0xe581('0x0'));var util=require('util');var path=require(_0xe581('0x1'));var timeout=require('connect-timeout');var express=require(_0xe581('0x2'));var router=express[_0xe581('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe581('0x4'));var config=require(_0xe581('0x5'));var controller=require(_0xe581('0x6'));router['get']('/',auth[_0xe581('0x7')](),controller['index']);router['get'](_0xe581('0x8'),auth[_0xe581('0x7')](),controller[_0xe581('0x9')]);router['get'](_0xe581('0xa'),auth[_0xe581('0x7')](),controller[_0xe581('0xb')]);router[_0xe581('0xc')]('/',auth[_0xe581('0x7')](),controller[_0xe581('0xd')]);router[_0xe581('0xe')](_0xe581('0xa'),auth[_0xe581('0x7')](),controller['update']);router[_0xe581('0xf')](_0xe581('0xa'),auth['isAuthenticated'](),controller[_0xe581('0x10')]);module[_0xe581('0x11')]=router; \ No newline at end of file +var _0x00f1=['/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','isAuthenticated','get'];(function(_0xd85763,_0x56e56b){var _0x454888=function(_0x4f804d){while(--_0x4f804d){_0xd85763['push'](_0xd85763['shift']());}};_0x454888(++_0x56e56b);}(_0x00f1,0x13a));var _0x100f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x00f1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x100f('0x0'));var path=require('path');var timeout=require(_0x100f('0x1'));var express=require(_0x100f('0x2'));var router=express[_0x100f('0x3')]();var fs_extra=require(_0x100f('0x4'));var auth=require(_0x100f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x100f('0x6'));router['get']('/',auth[_0x100f('0x7')](),controller['index']);router[_0x100f('0x8')](_0x100f('0x9'),auth[_0x100f('0x7')](),controller[_0x100f('0xa')]);router['get']('/:id',auth[_0x100f('0x7')](),controller[_0x100f('0xb')]);router[_0x100f('0xc')]('/',auth[_0x100f('0x7')](),controller[_0x100f('0xd')]);router[_0x100f('0xe')](_0x100f('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x100f('0x10')](_0x100f('0xf'),auth['isAuthenticated'](),controller[_0x100f('0x11')]);module[_0x100f('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 3f85739..0af6042 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 _0x909e=['sequelize','exports','STRING','DATE','moment'];(function(_0x286c4a,_0x3d559d){var _0x476a25=function(_0x1960ef){while(--_0x1960ef){_0x286c4a['push'](_0x286c4a['shift']());}};_0x476a25(++_0x3d559d);}(_0x909e,0xc7));var _0xe909=function(_0xc99bed,_0x2a48f8){_0xc99bed=_0xc99bed-0x0;var _0x1c500=_0x909e[_0xc99bed];return _0x1c500;};'use strict';var moment=require(_0xe909('0x0'));var Sequelize=require(_0xe909('0x1'));module[_0xe909('0x2')]={'uniqueid':{'type':Sequelize[_0xe909('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe909('0x4')]},'acceptAt':{'type':Sequelize[_0xe909('0x4')]},'exitAt':{'type':Sequelize[_0xe909('0x4')]},'reason':{'type':Sequelize[_0xe909('0x3')]}}; \ No newline at end of file +var _0xbb6e=['exports','STRING','DATE','moment','sequelize'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xbb6e,0xe4));var _0xebb6=function(_0xf97aa9,_0x1748b2){_0xf97aa9=_0xf97aa9-0x0;var _0x577e5b=_0xbb6e[_0xf97aa9];return _0x577e5b;};'use strict';var moment=require(_0xebb6('0x0'));var Sequelize=require(_0xebb6('0x1'));module[_0xebb6('0x2')]={'uniqueid':{'type':Sequelize[_0xebb6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xebb6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xebb6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xebb6('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 71bcb34..e1a48d4 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 _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x1533da,_0x2c7007){var _0x3ce6f6=function(_0x3d6cac){while(--_0x3d6cac){_0x1533da['push'](_0x1533da['shift']());}};_0x3ce6f6(++_0x2c7007);}(_0xd943,0x15d));var _0x3d94=function(_0xfe3b44,_0x257395){_0xfe3b44=_0xfe3b44-0x0;var _0x111983=_0xd943[_0xfe3b44];return _0x111983;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':!![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['MailQueueReport']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x38add1,_0x44b935){var _0x234c6f=function(_0x150c98){while(--_0x150c98){_0x38add1['push'](_0x38add1['shift']());}};_0x234c6f(++_0x44b935);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 9f8c4c5..981dee8 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 _0xe941=['uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x34c26b,_0x5e279b){var _0x2f9f58=function(_0x273abe){while(--_0x273abe){_0x34c26b['push'](_0x34c26b['shift']());}};_0x2f9f58(++_0x5e279b);}(_0xe941,0xc4));var _0x1e94=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe941[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x1e94('0x0'));var logger=require(_0x1e94('0x1'))(_0x1e94('0x2'));var moment=require(_0x1e94('0x3'));var BPromise=require(_0x1e94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e94('0x5'));var rimraf=require(_0x1e94('0x6'));var config=require(_0x1e94('0x7'));var attributes=require(_0x1e94('0x8'));module[_0x1e94('0x9')]=function(_0xb5aa55,_0x501440){return _0xb5aa55[_0x1e94('0xa')](_0x1e94('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1e94('0xc'),'fields':[_0x1e94('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe1e=['./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x160bee,_0x387d36){var _0x15e8b1=function(_0x927476){while(--_0x927476){_0x160bee['push'](_0x160bee['shift']());}};_0x15e8b1(++_0x387d36);}(_0xbe1e,0xe2));var _0xebe1=function(_0xd2e11d,_0x4608b6){_0xd2e11d=_0xd2e11d-0x0;var _0x253ac2=_0xbe1e[_0xd2e11d];return _0x253ac2;};'use strict';var _=require(_0xebe1('0x0'));var util=require(_0xebe1('0x1'));var logger=require(_0xebe1('0x2'))(_0xebe1('0x3'));var moment=require('moment');var BPromise=require(_0xebe1('0x4'));var rp=require(_0xebe1('0x5'));var fs=require('fs');var path=require(_0xebe1('0x6'));var rimraf=require('rimraf');var config=require(_0xebe1('0x7'));var attributes=require(_0xebe1('0x8'));module['exports']=function(_0x150091,_0x902536){return _0x150091[_0xebe1('0x9')](_0xebe1('0xa'),attributes,{'tableName':_0xebe1('0xb'),'paranoid':![],'indexes':[{'name':_0xebe1('0xc'),'fields':[_0xebe1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 5ebed35..7f1188c 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0x2ef3,0xba));var _0x32ef=function(_0x55b177,_0x3d4c9e){_0x55b177=_0x55b177-0x0;var _0x3cb293=_0x2ef3[_0x55b177];return _0x3cb293;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _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(_0x19dc07,_0x2ef96f){var _0x5f01bb=function(_0x19fb39){while(--_0x19fb39){_0x19dc07['push'](_0x19dc07['shift']());}};_0x5f01bb(++_0x2ef96f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'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 747e514..6687078 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2f037d,_0x1ceb8a){var _0x10eb2c=function(_0x4b9a4a){while(--_0x4b9a4a){_0x2f037d['push'](_0x2f037d['shift']());}};_0x10eb2c(++_0x1ceb8a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0xcb91[_0x1c7889];return _0x2f14e5;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 76ce934..e8e1589 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 _0x08b4=['INTEGER','sequelize','exports','STRING','BOOLEAN','INBOX'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x08b4,0x67));var _0x408b=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0x08b4[_0x329905];return _0x3aa42;};'use strict';var Sequelize=require(_0x408b('0x0'));module[_0x408b('0x1')]={'description':{'type':Sequelize[_0x408b('0x2')]},'host':{'type':Sequelize[_0x408b('0x2')]},'authentication':{'type':Sequelize[_0x408b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x408b('0x2')]},'password':{'type':Sequelize[_0x408b('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x408b('0x2')],'defaultValue':_0x408b('0x4')},'connTimeout':{'type':Sequelize[_0x408b('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x408b('0x2')]},'modernAuthentication':{'type':Sequelize[_0x408b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5ee9=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x21899c,_0x4c0d98){var _0x5e895e=function(_0x5d6df9){while(--_0x5d6df9){_0x21899c['push'](_0x21899c['shift']());}};_0x5e895e(++_0x4c0d98);}(_0x5ee9,0x120));var _0x95ee=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5ee9[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x95ee('0x0'));module[_0x95ee('0x1')]={'description':{'type':Sequelize[_0x95ee('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x95ee('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x95ee('0x2')]},'port':{'type':Sequelize[_0x95ee('0x4')]},'tls':{'type':Sequelize[_0x95ee('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x95ee('0x2')],'defaultValue':_0x95ee('0x5')},'connTimeout':{'type':Sequelize[_0x95ee('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x95ee('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x95ee('0x2')]},'modernAuthentication':{'type':Sequelize[_0x95ee('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 3f84e88..1e2f492 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 _0xd3ac=['../../config/logger','moment','bluebird','request-promise','path','exports','define','MailServerIn','lodash'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xd3ac,0x6b));var _0xcd3a=function(_0x5a90f6,_0x1f378a){_0x5a90f6=_0x5a90f6-0x0;var _0x6190f2=_0xd3ac[_0x5a90f6];return _0x6190f2;};'use strict';var _=require(_0xcd3a('0x0'));var util=require('util');var logger=require(_0xcd3a('0x1'))('api');var moment=require(_0xcd3a('0x2'));var BPromise=require(_0xcd3a('0x3'));var rp=require(_0xcd3a('0x4'));var fs=require('fs');var path=require(_0xcd3a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0xcd3a('0x6')]=function(_0x45132e,_0x2be413){return _0x45132e[_0xcd3a('0x7')](_0xcd3a('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62bd=['../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44d39a,_0x2ded78){var _0x11f377=function(_0x35fa69){while(--_0x35fa69){_0x44d39a['push'](_0x44d39a['shift']());}};_0x11f377(++_0x2ded78);}(_0x62bd,0x150));var _0xd62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd62b('0x0'));var util=require(_0xd62b('0x1'));var logger=require(_0xd62b('0x2'))(_0xd62b('0x3'));var moment=require(_0xd62b('0x4'));var BPromise=require(_0xd62b('0x5'));var rp=require(_0xd62b('0x6'));var fs=require('fs');var path=require(_0xd62b('0x7'));var rimraf=require(_0xd62b('0x8'));var config=require(_0xd62b('0x9'));var attributes=require(_0xd62b('0xa'));module[_0xd62b('0xb')]=function(_0x4c6d65,_0x1e9309){return _0x4c6d65[_0xd62b('0xc')](_0xd62b('0xd'),attributes,{'tableName':_0xd62b('0xe'),'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 ad84f4a..cf57f40 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 _0xfb3f=['include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit'];(function(_0x666bcd,_0x4cd384){var _0x9209af=function(_0x5baae8){while(--_0x5baae8){_0x666bcd['push'](_0x666bcd['shift']());}};_0x9209af(++_0x4cd384);}(_0xfb3f,0xb2));var _0xffb3=function(_0x33f87e,_0x799bc6){_0x33f87e=_0x33f87e-0x0;var _0x298d20=_0xfb3f[_0x33f87e];return _0x298d20;};'use strict';var _=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var moment=require(_0xffb3('0x2'));var BPromise=require(_0xffb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffb3('0x4'));var db=require(_0xffb3('0x5'))['db'];var utils=require(_0xffb3('0x6'));var logger=require(_0xffb3('0x7'))('rpc');var config=require(_0xffb3('0x8'));var jayson=require(_0xffb3('0x9'));var client=jayson['client'][_0xffb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a0485,_0xa54f2b,_0x4ad0af){return new BPromise(function(_0x2b2980,_0x1154ab){return client[_0xffb3('0xb')](_0x1a0485,_0x4ad0af)[_0xffb3('0xc')](function(_0x5efb52){logger[_0xffb3('0xd')](_0xffb3('0xe'),_0xa54f2b,_0xffb3('0xf'));logger[_0xffb3('0x10')](_0xffb3('0x11'),_0xa54f2b,_0xffb3('0xf'),JSON[_0xffb3('0x12')](_0x5efb52));if(_0x5efb52['error']){if(_0x5efb52[_0xffb3('0x13')][_0xffb3('0x14')]===0x1f4){logger[_0xffb3('0x13')](_0xffb3('0xe'),_0xa54f2b,_0x5efb52[_0xffb3('0x13')][_0xffb3('0x15')]);return _0x1154ab(_0x5efb52[_0xffb3('0x13')][_0xffb3('0x15')]);}logger[_0xffb3('0x13')](_0xffb3('0xe'),_0xa54f2b,_0x5efb52['error'][_0xffb3('0x15')]);return _0x2b2980(_0x5efb52[_0xffb3('0x13')][_0xffb3('0x15')]);}else{logger['info'](_0xffb3('0xe'),_0xa54f2b,_0xffb3('0xf'));_0x2b2980(_0x5efb52[_0xffb3('0x16')][_0xffb3('0x15')]);}})[_0xffb3('0x17')](function(_0xa65cdb){logger[_0xffb3('0x13')](_0xffb3('0xe'),_0xa54f2b,_0xa65cdb);_0x1154ab(_0xa65cdb);});});}exports[_0xffb3('0x18')]=function(_0x1e97a8){var _0x3adea5=this;return new Promise(function(_0x205a16,_0x44b63a){return db[_0xffb3('0x19')][_0xffb3('0x1a')]({'raw':_0x1e97a8[_0xffb3('0x1b')]?_0x1e97a8['options'][_0xffb3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e97a8[_0xffb3('0x1b')]?_0x1e97a8[_0xffb3('0x1b')][_0xffb3('0x1d')]||null:null,'attributes':_0x1e97a8['options']?_0x1e97a8['options'][_0xffb3('0x1e')]||null:null,'limit':_0x1e97a8['options']?_0x1e97a8['options'][_0xffb3('0x1f')]||null:null,'include':_0x1e97a8[_0xffb3('0x1b')]?_0x1e97a8[_0xffb3('0x1b')][_0xffb3('0x20')]?_[_0xffb3('0x21')](_0x1e97a8[_0xffb3('0x1b')][_0xffb3('0x20')],function(_0x1f9a49){return{'model':db[_0x1f9a49[_0xffb3('0x22')]],'as':_0x1f9a49['as'],'attributes':_0x1f9a49[_0xffb3('0x1e')],'include':_0x1f9a49[_0xffb3('0x20')]?_[_0xffb3('0x21')](_0x1f9a49[_0xffb3('0x20')],function(_0x164484){return{'model':db[_0x164484['model']],'as':_0x164484['as'],'attributes':_0x164484['attributes'],'include':_0x164484['include']?_['map'](_0x164484[_0xffb3('0x20')],function(_0x4d23f0){return{'model':db[_0x4d23f0[_0xffb3('0x22')]],'as':_0x4d23f0['as'],'attributes':_0x4d23f0[_0xffb3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4338a7){logger['info'](_0xffb3('0x18'),_0x1e97a8);logger['debug'](_0xffb3('0x18'),_0x1e97a8,JSON[_0xffb3('0x12')](_0x4338a7));_0x205a16(_0x4338a7);})[_0xffb3('0x17')](function(_0x18f9c2){logger['error'](_0xffb3('0x18'),_0x18f9c2[_0xffb3('0x15')],_0x1e97a8);_0x44b63a(_0x3adea5[_0xffb3('0x13')](0x1f4,_0x18f9c2[_0xffb3('0x15')]));});});}; \ No newline at end of file +var _0x5c7c=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x435063,_0x4ea50d){var _0x4cf2ae=function(_0x4cab2c){while(--_0x4cab2c){_0x435063['push'](_0x435063['shift']());}};_0x4cf2ae(++_0x4ea50d);}(_0x5c7c,0xe2));var _0xc5c7=function(_0x50b658,_0xd3077f){_0x50b658=_0x50b658-0x0;var _0x484d1d=_0x5c7c[_0x50b658];return _0x484d1d;};'use strict';var _=require(_0xc5c7('0x0'));var util=require('util');var moment=require(_0xc5c7('0x1'));var BPromise=require(_0xc5c7('0x2'));var rs=require(_0xc5c7('0x3'));var fs=require('fs');var Redis=require(_0xc5c7('0x4'));var db=require(_0xc5c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5c7('0x6'))(_0xc5c7('0x7'));var config=require(_0xc5c7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc5c7('0x9')][_0xc5c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d70c1,_0x18ba87,_0x1c0e31){return new BPromise(function(_0x1ab3f7,_0xb722db){return client[_0xc5c7('0xb')](_0x3d70c1,_0x1c0e31)[_0xc5c7('0xc')](function(_0x335360){logger['info']('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0xc5c7('0xd'));logger[_0xc5c7('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x18ba87,'request\x20sent',JSON['stringify'](_0x335360));if(_0x335360[_0xc5c7('0xf')]){if(_0x335360[_0xc5c7('0xf')][_0xc5c7('0x10')]===0x1f4){logger[_0xc5c7('0xf')](_0xc5c7('0x11'),_0x18ba87,_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);return _0xb722db(_0x335360[_0xc5c7('0xf')]['message']);}logger[_0xc5c7('0xf')]('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);return _0x1ab3f7(_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);}else{logger[_0xc5c7('0x13')](_0xc5c7('0x11'),_0x18ba87,_0xc5c7('0xd'));_0x1ab3f7(_0x335360[_0xc5c7('0x14')]['message']);}})[_0xc5c7('0x15')](function(_0x16826b){logger[_0xc5c7('0xf')]('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0x16826b);_0xb722db(_0x16826b);});});}exports['GetMailServerIn']=function(_0x1db6b3){var _0x22b6f0=this;return new Promise(function(_0x1f0aee,_0x4dd517){return db[_0xc5c7('0x16')][_0xc5c7('0x17')]({'raw':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3['options'][_0xc5c7('0x19')]===undefined?!![]:![]:!![],'where':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1a')]||null:null,'attributes':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1b')]||null:null,'limit':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3['options'][_0xc5c7('0x1c')]||null:null,'include':_0x1db6b3['options']?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x1db6b3[_0xc5c7('0x18')]['include'],function(_0x10fe26){return{'model':db[_0x10fe26[_0xc5c7('0x1f')]],'as':_0x10fe26['as'],'attributes':_0x10fe26[_0xc5c7('0x1b')],'include':_0x10fe26[_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x10fe26[_0xc5c7('0x1d')],function(_0x48a623){return{'model':db[_0x48a623['model']],'as':_0x48a623['as'],'attributes':_0x48a623['attributes'],'include':_0x48a623[_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x48a623[_0xc5c7('0x1d')],function(_0x4a509e){return{'model':db[_0x4a509e[_0xc5c7('0x1f')]],'as':_0x4a509e['as'],'attributes':_0x4a509e[_0xc5c7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc5c7('0xc')](function(_0x515789){logger[_0xc5c7('0x13')](_0xc5c7('0x20'),_0x1db6b3);logger[_0xc5c7('0xe')](_0xc5c7('0x20'),_0x1db6b3,JSON['stringify'](_0x515789));_0x1f0aee(_0x515789);})['catch'](function(_0x13ff18){logger[_0xc5c7('0xf')](_0xc5c7('0x20'),_0x13ff18['message'],_0x1db6b3);_0x4dd517(_0x22b6f0[_0xc5c7('0xf')](0x1f4,_0x13ff18[_0xc5c7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 91c63c5..c8a2bb0 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a54,0x106));var _0x47a5=function(_0x1eea38,_0x5c8427){_0x1eea38=_0x1eea38-0x0;var _0x2d595=_0x7a54[_0x1eea38];return _0x2d595;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0x3fe83a,_0x55f7f1){_0x3fe83a=_0x3fe83a-0x0;var _0x575826=_0x7a54[_0x3fe83a];return _0x575826;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 280cd2d..cdad783 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 _0x9c00=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1550dc,_0x316d56){var _0x402b9f=function(_0x21dadf){while(--_0x21dadf){_0x1550dc['push'](_0x1550dc['shift']());}};_0x402b9f(++_0x316d56);}(_0x9c00,0x1a0));var _0x09c0=function(_0x280438,_0x1a2b94){_0x280438=_0x280438-0x0;var _0x26c9d6=_0x9c00[_0x280438];return _0x26c9d6;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x09c0('0x2')]},'pass':{'type':Sequelize[_0x09c0('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x09c0('0x2')]},'authentication':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x34b7=['BOOLEAN','STRING','INTEGER'];(function(_0x23631b,_0x5d017c){var _0x2d0ce6=function(_0x29c43a){while(--_0x29c43a){_0x23631b['push'](_0x23631b['shift']());}};_0x2d0ce6(++_0x5d017c);}(_0x34b7,0x196));var _0x734b=function(_0x199b64,_0x5d1120){_0x199b64=_0x199b64-0x0;var _0x42b220=_0x34b7[_0x199b64];return _0x42b220;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x734b('0x0')]},'host':{'type':Sequelize[_0x734b('0x0')]},'user':{'type':Sequelize[_0x734b('0x0')]},'pass':{'type':Sequelize[_0x734b('0x0')]},'port':{'type':Sequelize[_0x734b('0x1')]},'secure':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9a80d9d..be85993 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 _0x531a=['bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xcb48ca,_0x540ecb){var _0x37be10=function(_0x3e1289){while(--_0x3e1289){_0xcb48ca['push'](_0xcb48ca['shift']());}};_0x37be10(++_0x540ecb);}(_0x531a,0x90));var _0xa531=function(_0x4a6cb7,_0x48a3d5){_0x4a6cb7=_0x4a6cb7-0x0;var _0x3cc689=_0x531a[_0x4a6cb7];return _0x3cc689;};'use strict';var emlformat=require(_0xa531('0x0'));var rimraf=require(_0xa531('0x1'));var zipdir=require(_0xa531('0x2'));var jsonpatch=require(_0xa531('0x3'));var rp=require(_0xa531('0x4'));var moment=require(_0xa531('0x5'));var BPromise=require(_0xa531('0x6'));var Mustache=require(_0xa531('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa531('0x8'));var csv=require(_0xa531('0x9'));var ejs=require(_0xa531('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa531('0xb'));var squel=require('squel');var crypto=require(_0xa531('0xc'));var jsforce=require(_0xa531('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa531('0x9'));var querystring=require(_0xa531('0xe'));var Papa=require(_0xa531('0xf'));var Redis=require('ioredis');var authService=require(_0xa531('0x10'));var qs=require(_0xa531('0x11'));var as=require(_0xa531('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa531('0x13'))(_0xa531('0x14'));var utils=require('../../config/utils');var config=require(_0xa531('0x15'));var licenseUtil=require(_0xa531('0x16'));var db=require(_0xa531('0x17'))['db'];function respondWithStatusCode(_0xb6cfa9,_0x174e45){_0x174e45=_0x174e45||0xcc;return function(_0x68b6fb){if(_0x68b6fb){return _0xb6cfa9[_0xa531('0x18')](_0x174e45);}return _0xb6cfa9['status'](_0x174e45)['end']();};}function respondWithResult(_0x44a9c2,_0x4fa6d8){_0x4fa6d8=_0x4fa6d8||0xc8;return function(_0x5b3cf9){if(_0x5b3cf9){return _0x44a9c2[_0xa531('0x19')](_0x4fa6d8)[_0xa531('0x1a')](_0x5b3cf9);}};}function respondWithFilteredResult(_0x3d6a6f,_0x3886aa){return function(_0x197fd1){if(_0x197fd1){var _0x4bf1fd=typeof _0x3886aa[_0xa531('0x1b')]===_0xa531('0x1c')&&typeof _0x3886aa[_0xa531('0x1d')]===_0xa531('0x1c');var _0x2f80b4=_0x197fd1['count'];var _0x16006b=_0x4bf1fd?0x0:_0x3886aa[_0xa531('0x1b')];var _0x16c6e2=_0x4bf1fd?_0x197fd1[_0xa531('0x1e')]:_0x3886aa[_0xa531('0x1b')]+_0x3886aa[_0xa531('0x1d')];var _0x1b5571;if(_0x16c6e2>=_0x2f80b4){_0x16c6e2=_0x2f80b4;_0x1b5571=0xc8;}else{_0x1b5571=0xce;}_0x3d6a6f[_0xa531('0x19')](_0x1b5571);return _0x3d6a6f[_0xa531('0x1f')]('Content-Range',_0x16006b+'-'+_0x16c6e2+'/'+_0x2f80b4)[_0xa531('0x1a')](_0x197fd1);}return null;};}function patchUpdates(_0x24ec14){return function(_0x300889){try{jsonpatch[_0xa531('0x20')](_0x300889,_0x24ec14,!![]);}catch(_0xbd1376){return BPromise[_0xa531('0x21')](_0xbd1376);}return _0x300889[_0xa531('0x22')]();};}function saveUpdates(_0x16e0be,_0xece497){return function(_0x443a23){if(_0x443a23){return _0x443a23[_0xa531('0x23')](_0x16e0be)[_0xa531('0x24')](function(_0x305229){return _0x305229;});}return null;};}function removeEntity(_0x453331,_0x34af29){return function(_0x13fb65){if(_0x13fb65){return _0x13fb65[_0xa531('0x25')]()[_0xa531('0x24')](function(){_0x453331['status'](0xcc)[_0xa531('0x26')]();});}};}function handleEntityNotFound(_0x4681c1,_0x5011f6){return function(_0x457790){if(!_0x457790){_0x4681c1[_0xa531('0x18')](0x194);}return _0x457790;};}function handleError(_0xbcfacc,_0x42213f){_0x42213f=_0x42213f||0x1f4;return function(_0x53028b){logger[_0xa531('0x27')](_0x53028b[_0xa531('0x28')]);if(_0x53028b['name']){delete _0x53028b[_0xa531('0x29')];}_0xbcfacc[_0xa531('0x19')](_0x42213f)['send'](_0x53028b);};}exports[_0xa531('0x2a')]=function(_0x532a11,_0x26164d){var _0x527daf={},_0x31ce8f={},_0x5f4df4={'count':0x0,'rows':[]};var _0x223c19=_[_0xa531('0x2b')](db[_0xa531('0x2c')][_0xa531('0x2d')],function(_0x1adcf7){return{'name':_0x1adcf7[_0xa531('0x2e')],'type':_0x1adcf7[_0xa531('0x2f')][_0xa531('0x30')]};});_0x31ce8f[_0xa531('0x31')]=_[_0xa531('0x2b')](_0x223c19,'name');_0x31ce8f[_0xa531('0x32')]=_[_0xa531('0x33')](_0x532a11[_0xa531('0x32')]);_0x31ce8f[_0xa531('0x34')]=_[_0xa531('0x35')](_0x31ce8f[_0xa531('0x31')],_0x31ce8f['query']);_0x527daf[_0xa531('0x36')]=_[_0xa531('0x35')](_0x31ce8f['model'],qs[_0xa531('0x37')](_0x532a11['query'][_0xa531('0x37')]));_0x527daf[_0xa531('0x36')]=_0x527daf[_0xa531('0x36')][_0xa531('0x38')]?_0x527daf[_0xa531('0x36')]:_0x31ce8f[_0xa531('0x31')];if(!_0x532a11[_0xa531('0x32')][_0xa531('0x39')](_0xa531('0x3a'))){_0x527daf[_0xa531('0x1d')]=qs[_0xa531('0x1d')](_0x532a11[_0xa531('0x32')][_0xa531('0x1d')]);_0x527daf[_0xa531('0x1b')]=qs['offset'](_0x532a11[_0xa531('0x32')][_0xa531('0x1b')]);}_0x527daf['order']=qs['sort'](_0x532a11[_0xa531('0x32')]['sort']);_0x527daf[_0xa531('0x3b')]=qs[_0xa531('0x34')](_[_0xa531('0x3c')](_0x532a11[_0xa531('0x32')],_0x31ce8f[_0xa531('0x34')]),_0x223c19);if(_0x532a11[_0xa531('0x32')][_0xa531('0x3d')]){_0x527daf[_0xa531('0x3b')]=_[_0xa531('0x3e')](_0x527daf[_0xa531('0x3b')],{'$or':_[_0xa531('0x2b')](_0x223c19,function(_0x16c51d){if(_0x16c51d[_0xa531('0x2f')]!==_0xa531('0x3f')){var _0x2d5da2={};_0x2d5da2[_0x16c51d[_0xa531('0x29')]]={'$like':'%'+_0x532a11[_0xa531('0x32')][_0xa531('0x3d')]+'%'};return _0x2d5da2;}})});}_0x527daf=_[_0xa531('0x3e')]({},_0x527daf,_0x532a11[_0xa531('0x40')]);var _0x12bb6f={'where':_0x527daf['where']};return db[_0xa531('0x2c')][_0xa531('0x1e')](_0x12bb6f)[_0xa531('0x24')](function(_0x2ce65a){_0x5f4df4[_0xa531('0x1e')]=_0x2ce65a;if(_0x532a11[_0xa531('0x32')][_0xa531('0x41')]){_0x527daf[_0xa531('0x42')]=[{'all':!![]}];}return db[_0xa531('0x2c')][_0xa531('0x43')](_0x527daf);})[_0xa531('0x24')](function(_0x5b47a1){_0x5f4df4[_0xa531('0x44')]=_0x5b47a1;return _0x5f4df4;})['then'](respondWithFilteredResult(_0x26164d,_0x527daf))[_0xa531('0x45')](handleError(_0x26164d,null));};exports[_0xa531('0x46')]=function(_0x58aecc,_0x1682c6){var _0x2b4293={'raw':!![],'where':{'id':_0x58aecc[_0xa531('0x47')]['id']}},_0x520871={};_0x520871[_0xa531('0x31')]=_[_0xa531('0x33')](db['MailServerOut'][_0xa531('0x2d')]);_0x520871[_0xa531('0x32')]=_[_0xa531('0x33')](_0x58aecc[_0xa531('0x32')]);_0x520871[_0xa531('0x34')]=_[_0xa531('0x35')](_0x520871['model'],_0x520871[_0xa531('0x32')]);_0x2b4293['attributes']=_[_0xa531('0x35')](_0x520871[_0xa531('0x31')],qs[_0xa531('0x37')](_0x58aecc['query']['fields']));_0x2b4293[_0xa531('0x36')]=_0x2b4293[_0xa531('0x36')][_0xa531('0x38')]?_0x2b4293[_0xa531('0x36')]:_0x520871[_0xa531('0x31')];if(_0x58aecc[_0xa531('0x32')]['includeAll']){_0x2b4293[_0xa531('0x42')]=[{'all':!![]}];}_0x2b4293=_['merge']({},_0x2b4293,_0x58aecc['options']);return db['MailServerOut'][_0xa531('0x48')](_0x2b4293)[_0xa531('0x24')](handleEntityNotFound(_0x1682c6,null))['then'](respondWithResult(_0x1682c6,null))[_0xa531('0x45')](handleError(_0x1682c6,null));};exports[_0xa531('0x49')]=function(_0x23c719,_0x17ffee){return db['MailServerOut'][_0xa531('0x49')](_0x23c719[_0xa531('0x4a')],{})['then'](respondWithResult(_0x17ffee,0xc9))[_0xa531('0x45')](handleError(_0x17ffee,null));};exports[_0xa531('0x23')]=function(_0x22068d,_0x1bde97){if(_0x22068d[_0xa531('0x4a')]['id']){delete _0x22068d[_0xa531('0x4a')]['id'];}return db[_0xa531('0x2c')][_0xa531('0x48')]({'where':{'id':_0x22068d[_0xa531('0x47')]['id']}})[_0xa531('0x24')](handleEntityNotFound(_0x1bde97,null))['then'](saveUpdates(_0x22068d[_0xa531('0x4a')],null))[_0xa531('0x24')](respondWithResult(_0x1bde97,null))['catch'](handleError(_0x1bde97,null));};exports[_0xa531('0x25')]=function(_0x22fb9f,_0x4b1df4){return db[_0xa531('0x2c')][_0xa531('0x48')]({'where':{'id':_0x22fb9f[_0xa531('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b1df4,null))['then'](removeEntity(_0x4b1df4,null))[_0xa531('0x45')](handleError(_0x4b1df4,null));}; \ No newline at end of file +var _0x6f90=['offset','count','limit','set','apply','reject','save','destroy','then','name','send','index','map','MailServerOut','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x6f90,0x183));var _0x06f9=function(_0x3ffccc,_0x39620f){_0x3ffccc=_0x3ffccc-0x0;var _0x1583d2=_0x6f90[_0x3ffccc];return _0x1583d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x06f9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06f9('0x1'));var moment=require(_0x06f9('0x2'));var BPromise=require(_0x06f9('0x3'));var Mustache=require('mustache');var util=require(_0x06f9('0x4'));var path=require(_0x06f9('0x5'));var sox=require(_0x06f9('0x6'));var csv=require(_0x06f9('0x7'));var ejs=require(_0x06f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06f9('0x9'));var squel=require(_0x06f9('0xa'));var crypto=require('crypto');var jsforce=require(_0x06f9('0xb'));var deskjs=require(_0x06f9('0xc'));var toCsv=require(_0x06f9('0x7'));var querystring=require(_0x06f9('0xd'));var Papa=require(_0x06f9('0xe'));var Redis=require('ioredis');var authService=require(_0x06f9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x06f9('0x10'));var hardwareService=require(_0x06f9('0x11'));var logger=require(_0x06f9('0x12'))('api');var utils=require(_0x06f9('0x13'));var config=require(_0x06f9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06f9('0x15'))['db'];function respondWithStatusCode(_0x236de7,_0x5c69bf){_0x5c69bf=_0x5c69bf||0xcc;return function(_0x5ded66){if(_0x5ded66){return _0x236de7[_0x06f9('0x16')](_0x5c69bf);}return _0x236de7[_0x06f9('0x17')](_0x5c69bf)[_0x06f9('0x18')]();};}function respondWithResult(_0x2a7a22,_0x54fdd8){_0x54fdd8=_0x54fdd8||0xc8;return function(_0x1ca904){if(_0x1ca904){return _0x2a7a22['status'](_0x54fdd8)[_0x06f9('0x19')](_0x1ca904);}};}function respondWithFilteredResult(_0x44fe67,_0x2d82dc){return function(_0x433e4d){if(_0x433e4d){var _0x3d714d=typeof _0x2d82dc['offset']===_0x06f9('0x1a')&&typeof _0x2d82dc['limit']===_0x06f9('0x1a');var _0x119c8e=_0x433e4d['count'];var _0x4c42b4=_0x3d714d?0x0:_0x2d82dc[_0x06f9('0x1b')];var _0x521a21=_0x3d714d?_0x433e4d[_0x06f9('0x1c')]:_0x2d82dc[_0x06f9('0x1b')]+_0x2d82dc[_0x06f9('0x1d')];var _0x412323;if(_0x521a21>=_0x119c8e){_0x521a21=_0x119c8e;_0x412323=0xc8;}else{_0x412323=0xce;}_0x44fe67[_0x06f9('0x17')](_0x412323);return _0x44fe67[_0x06f9('0x1e')]('Content-Range',_0x4c42b4+'-'+_0x521a21+'/'+_0x119c8e)[_0x06f9('0x19')](_0x433e4d);}return null;};}function patchUpdates(_0x134903){return function(_0x215210){try{jsonpatch[_0x06f9('0x1f')](_0x215210,_0x134903,!![]);}catch(_0x54ebbf){return BPromise[_0x06f9('0x20')](_0x54ebbf);}return _0x215210[_0x06f9('0x21')]();};}function saveUpdates(_0x40498e,_0x1052ef){return function(_0x3ae7cc){if(_0x3ae7cc){return _0x3ae7cc['update'](_0x40498e)['then'](function(_0x1f8512){return _0x1f8512;});}return null;};}function removeEntity(_0x1ba426,_0x403f40){return function(_0x5d7ea0){if(_0x5d7ea0){return _0x5d7ea0[_0x06f9('0x22')]()[_0x06f9('0x23')](function(){_0x1ba426[_0x06f9('0x17')](0xcc)[_0x06f9('0x18')]();});}};}function handleEntityNotFound(_0x17308a,_0x4b818d){return function(_0x29841f){if(!_0x29841f){_0x17308a[_0x06f9('0x16')](0x194);}return _0x29841f;};}function handleError(_0x305c63,_0x4b8b47){_0x4b8b47=_0x4b8b47||0x1f4;return function(_0x1d9d41){logger['error'](_0x1d9d41['stack']);if(_0x1d9d41[_0x06f9('0x24')]){delete _0x1d9d41[_0x06f9('0x24')];}_0x305c63[_0x06f9('0x17')](_0x4b8b47)[_0x06f9('0x25')](_0x1d9d41);};}exports[_0x06f9('0x26')]=function(_0x1efc02,_0x2ada88){var _0x4cc0ba={},_0x32d2e5={},_0x3c4165={'count':0x0,'rows':[]};var _0x2f183d=_[_0x06f9('0x27')](db[_0x06f9('0x28')]['rawAttributes'],function(_0xbad626){return{'name':_0xbad626[_0x06f9('0x29')],'type':_0xbad626['type'][_0x06f9('0x2a')]};});_0x32d2e5['model']=_[_0x06f9('0x27')](_0x2f183d,_0x06f9('0x24'));_0x32d2e5[_0x06f9('0x2b')]=_['keys'](_0x1efc02[_0x06f9('0x2b')]);_0x32d2e5[_0x06f9('0x2c')]=_[_0x06f9('0x2d')](_0x32d2e5[_0x06f9('0x2e')],_0x32d2e5[_0x06f9('0x2b')]);_0x4cc0ba[_0x06f9('0x2f')]=_[_0x06f9('0x2d')](_0x32d2e5[_0x06f9('0x2e')],qs[_0x06f9('0x30')](_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x30')]));_0x4cc0ba['attributes']=_0x4cc0ba[_0x06f9('0x2f')][_0x06f9('0x31')]?_0x4cc0ba[_0x06f9('0x2f')]:_0x32d2e5['model'];if(!_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x32')](_0x06f9('0x33'))){_0x4cc0ba[_0x06f9('0x1d')]=qs[_0x06f9('0x1d')](_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x1d')]);_0x4cc0ba[_0x06f9('0x1b')]=qs[_0x06f9('0x1b')](_0x1efc02[_0x06f9('0x2b')]['offset']);}_0x4cc0ba['order']=qs[_0x06f9('0x34')](_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x34')]);_0x4cc0ba[_0x06f9('0x35')]=qs[_0x06f9('0x2c')](_['pick'](_0x1efc02[_0x06f9('0x2b')],_0x32d2e5[_0x06f9('0x2c')]),_0x2f183d);if(_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x36')]){_0x4cc0ba[_0x06f9('0x35')]=_[_0x06f9('0x37')](_0x4cc0ba[_0x06f9('0x35')],{'$or':_[_0x06f9('0x27')](_0x2f183d,function(_0x3e141b){if(_0x3e141b['type']!==_0x06f9('0x38')){var _0x1d462c={};_0x1d462c[_0x3e141b['name']]={'$like':'%'+_0x1efc02['query']['filter']+'%'};return _0x1d462c;}})});}_0x4cc0ba=_[_0x06f9('0x37')]({},_0x4cc0ba,_0x1efc02[_0x06f9('0x39')]);var _0x6de04b={'where':_0x4cc0ba[_0x06f9('0x35')]};return db[_0x06f9('0x28')][_0x06f9('0x1c')](_0x6de04b)[_0x06f9('0x23')](function(_0x50b2bd){_0x3c4165[_0x06f9('0x1c')]=_0x50b2bd;if(_0x1efc02[_0x06f9('0x2b')][_0x06f9('0x3a')]){_0x4cc0ba['include']=[{'all':!![]}];}return db[_0x06f9('0x28')][_0x06f9('0x3b')](_0x4cc0ba);})[_0x06f9('0x23')](function(_0x22ba19){_0x3c4165[_0x06f9('0x3c')]=_0x22ba19;return _0x3c4165;})[_0x06f9('0x23')](respondWithFilteredResult(_0x2ada88,_0x4cc0ba))[_0x06f9('0x3d')](handleError(_0x2ada88,null));};exports[_0x06f9('0x3e')]=function(_0x429087,_0x13cea0){var _0x92be34={'raw':!![],'where':{'id':_0x429087[_0x06f9('0x3f')]['id']}},_0x14e0a1={};_0x14e0a1['model']=_[_0x06f9('0x40')](db[_0x06f9('0x28')][_0x06f9('0x41')]);_0x14e0a1[_0x06f9('0x2b')]=_[_0x06f9('0x40')](_0x429087[_0x06f9('0x2b')]);_0x14e0a1['filters']=_[_0x06f9('0x2d')](_0x14e0a1[_0x06f9('0x2e')],_0x14e0a1[_0x06f9('0x2b')]);_0x92be34[_0x06f9('0x2f')]=_[_0x06f9('0x2d')](_0x14e0a1[_0x06f9('0x2e')],qs[_0x06f9('0x30')](_0x429087[_0x06f9('0x2b')][_0x06f9('0x30')]));_0x92be34['attributes']=_0x92be34[_0x06f9('0x2f')][_0x06f9('0x31')]?_0x92be34[_0x06f9('0x2f')]:_0x14e0a1['model'];if(_0x429087[_0x06f9('0x2b')][_0x06f9('0x3a')]){_0x92be34['include']=[{'all':!![]}];}_0x92be34=_[_0x06f9('0x37')]({},_0x92be34,_0x429087[_0x06f9('0x39')]);return db['MailServerOut'][_0x06f9('0x42')](_0x92be34)[_0x06f9('0x23')](handleEntityNotFound(_0x13cea0,null))[_0x06f9('0x23')](respondWithResult(_0x13cea0,null))[_0x06f9('0x3d')](handleError(_0x13cea0,null));};exports['create']=function(_0x567522,_0x492091){return db[_0x06f9('0x28')][_0x06f9('0x43')](_0x567522[_0x06f9('0x44')],{})[_0x06f9('0x23')](respondWithResult(_0x492091,0xc9))[_0x06f9('0x3d')](handleError(_0x492091,null));};exports['update']=function(_0x5d0dd6,_0x225940){if(_0x5d0dd6[_0x06f9('0x44')]['id']){delete _0x5d0dd6['body']['id'];}return db[_0x06f9('0x28')][_0x06f9('0x42')]({'where':{'id':_0x5d0dd6[_0x06f9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x225940,null))['then'](saveUpdates(_0x5d0dd6[_0x06f9('0x44')],null))[_0x06f9('0x23')](respondWithResult(_0x225940,null))[_0x06f9('0x3d')](handleError(_0x225940,null));};exports['destroy']=function(_0x205b72,_0x3e2b27){return db[_0x06f9('0x28')][_0x06f9('0x42')]({'where':{'id':_0x205b72[_0x06f9('0x3f')]['id']}})[_0x06f9('0x23')](handleEntityNotFound(_0x3e2b27,null))[_0x06f9('0x23')](removeEntity(_0x3e2b27,null))[_0x06f9('0x3d')](handleError(_0x3e2b27,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8baa960..c889dbd 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 _0xf0d7=['MailServerOut','lodash','util','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x283cf6,_0x14e096){var _0x4b40e5=function(_0xd340e5){while(--_0xd340e5){_0x283cf6['push'](_0x283cf6['shift']());}};_0x4b40e5(++_0x14e096);}(_0xf0d7,0x1b1));var _0x7f0d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf0d7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7f0d('0x0'));var util=require(_0x7f0d('0x1'));var logger=require('../../config/logger')(_0x7f0d('0x2'));var moment=require(_0x7f0d('0x3'));var BPromise=require(_0x7f0d('0x4'));var rp=require(_0x7f0d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7f0d('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x7f0d('0x7')]=function(_0x243186,_0x57f21b){return _0x243186['define'](_0x7f0d('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83d3=['path','rimraf','./mailServerOut.attributes','MailServerOut','lodash','util','api','moment','request-promise'];(function(_0x33b62a,_0x3c000f){var _0x1bd1cd=function(_0x213317){while(--_0x213317){_0x33b62a['push'](_0x33b62a['shift']());}};_0x1bd1cd(++_0x3c000f);}(_0x83d3,0xa6));var _0x383d=function(_0xce2ee4,_0x3fe1e1){_0xce2ee4=_0xce2ee4-0x0;var _0x3fd000=_0x83d3[_0xce2ee4];return _0x3fd000;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var logger=require('../../config/logger')(_0x383d('0x2'));var moment=require(_0x383d('0x3'));var BPromise=require('bluebird');var rp=require(_0x383d('0x4'));var fs=require('fs');var path=require(_0x383d('0x5'));var rimraf=require(_0x383d('0x6'));var config=require('../../config/environment');var attributes=require(_0x383d('0x7'));module['exports']=function(_0xa32dc6,_0x2c626d){return _0xa32dc6['define'](_0x383d('0x8'),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 5f2f570..12b68db 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1b95bc,_0x405b2e){var _0x59f136=function(_0xc1b9c8){while(--_0xc1b9c8){_0x1b95bc['push'](_0x1b95bc['shift']());}};_0x59f136(++_0x405b2e);}(_0x1261,0x144));var _0x1126=function(_0x7026aa,_0x174e96){_0x7026aa=_0x7026aa-0x0;var _0x35a685=_0x1261[_0x7026aa];return _0x35a685;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0x2ef3,0xba));var _0x32ef=function(_0x45dae2,_0xa87720){_0x45dae2=_0x45dae2-0x0;var _0x46ac08=_0x2ef3[_0x45dae2];return _0x46ac08;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 84d3fbe..1b032ee 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 _0xcbc1=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller'];(function(_0x3d5da1,_0x347c77){var _0x55788e=function(_0x3aaece){while(--_0x3aaece){_0x3d5da1['push'](_0x3d5da1['shift']());}};_0x55788e(++_0x347c77);}(_0xcbc1,0x148));var _0x1cbc=function(_0x1245c1,_0x4d0f6e){_0x1245c1=_0x1245c1-0x0;var _0x140053=_0xcbc1[_0x1245c1];return _0x140053;};'use strict';var multer=require(_0x1cbc('0x0'));var util=require(_0x1cbc('0x1'));var path=require('path');var timeout=require(_0x1cbc('0x2'));var express=require(_0x1cbc('0x3'));var router=express[_0x1cbc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1cbc('0x5'));var interaction=require(_0x1cbc('0x6'));var config=require('../../config/environment');var controller=require(_0x1cbc('0x7'));router[_0x1cbc('0x8')]('/',auth[_0x1cbc('0x9')](),controller[_0x1cbc('0xa')]);router[_0x1cbc('0x8')](_0x1cbc('0xb'),auth[_0x1cbc('0x9')](),controller[_0x1cbc('0xc')]);router[_0x1cbc('0x8')](_0x1cbc('0xd'),auth[_0x1cbc('0x9')](),controller[_0x1cbc('0xe')]);router[_0x1cbc('0xf')]('/',auth[_0x1cbc('0x9')](),controller[_0x1cbc('0x10')]);router['put']('/:id',auth[_0x1cbc('0x9')](),controller[_0x1cbc('0x11')]);router[_0x1cbc('0x12')]('/:id',auth[_0x1cbc('0x9')](),controller[_0x1cbc('0x13')]);module[_0x1cbc('0x14')]=router; \ No newline at end of file +var _0xe51c=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','post'];(function(_0xbb4dc3,_0x3e74d8){var _0xcf6f15=function(_0x23d178){while(--_0x23d178){_0xbb4dc3['push'](_0xbb4dc3['shift']());}};_0xcf6f15(++_0x3e74d8);}(_0xe51c,0x13f));var _0xce51=function(_0x251669,_0x4cfefe){_0x251669=_0x251669-0x0;var _0x476916=_0xe51c[_0x251669];return _0x476916;};'use strict';var multer=require(_0xce51('0x0'));var util=require(_0xce51('0x1'));var path=require(_0xce51('0x2'));var timeout=require(_0xce51('0x3'));var express=require('express');var router=express[_0xce51('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xce51('0x5'));router[_0xce51('0x6')]('/',auth[_0xce51('0x7')](),controller['index']);router[_0xce51('0x6')](_0xce51('0x8'),auth[_0xce51('0x7')](),controller['describe']);router[_0xce51('0x6')](_0xce51('0x9'),auth[_0xce51('0x7')](),controller['show']);router[_0xce51('0xa')]('/',auth[_0xce51('0x7')](),controller['create']);router['put'](_0xce51('0x9'),auth[_0xce51('0x7')](),controller[_0xce51('0xb')]);router[_0xce51('0xc')](_0xce51('0x9'),auth[_0xce51('0x7')](),controller[_0xce51('0xd')]);module[_0xce51('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 63b1556..cbec2a9 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 _0x3c6c=['sequelize','STRING','name'];(function(_0x4b25e3,_0x33a600){var _0x1596c6=function(_0x3a2209){while(--_0x3a2209){_0x4b25e3['push'](_0x4b25e3['shift']());}};_0x1596c6(++_0x33a600);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x3f72fe,_0x4c5c28){_0x3f72fe=_0x3f72fe-0x0;var _0x23f72a=_0x3c6c[_0x3f72fe];return _0x23f72a;};'use strict';var Sequelize=require(_0xc3c6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3c6('0x1')],'unique':_0xc3c6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc3c6('0x1')]}}; \ No newline at end of file +var _0xf494=['STRING','sequelize','exports'];(function(_0x139705,_0x21dbc2){var _0x2c03e8=function(_0x8691c9){while(--_0x8691c9){_0x139705['push'](_0x139705['shift']());}};_0x2c03e8(++_0x21dbc2);}(_0xf494,0x1c6));var _0x4f49=function(_0x3c704b,_0xd6f86f){_0x3c704b=_0x3c704b-0x0;var _0x44cb8b=_0xf494[_0x3c704b];return _0x44cb8b;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4f49('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3ab8b26..ab5b88a 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 _0xb204=['count','set','Content-Range','reject','save','update','then','error','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','filters','fields','include','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','bluebird','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0xb204,0xc4));var _0x4b20=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xb204[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b20('0x0'));var zipdir=require(_0x4b20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b20('0x2'));var moment=require('moment');var BPromise=require(_0x4b20('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4b20('0x4'));var csv=require('to-csv');var ejs=require(_0x4b20('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b20('0x6'));var squel=require(_0x4b20('0x7'));var crypto=require('crypto');var jsforce=require(_0x4b20('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x4b20('0x9'));var querystring=require(_0x4b20('0xa'));var Papa=require(_0x4b20('0xb'));var Redis=require(_0x4b20('0xc'));var authService=require(_0x4b20('0xd'));var qs=require(_0x4b20('0xe'));var as=require(_0x4b20('0xf'));var hardwareService=require(_0x4b20('0x10'));var logger=require(_0x4b20('0x11'))(_0x4b20('0x12'));var utils=require(_0x4b20('0x13'));var config=require(_0x4b20('0x14'));var licenseUtil=require(_0x4b20('0x15'));var db=require(_0x4b20('0x16'))['db'];function respondWithStatusCode(_0x59d0d6,_0x5365d8){_0x5365d8=_0x5365d8||0xcc;return function(_0x5e54b3){if(_0x5e54b3){return _0x59d0d6['sendStatus'](_0x5365d8);}return _0x59d0d6['status'](_0x5365d8)[_0x4b20('0x17')]();};}function respondWithResult(_0x3da619,_0x17d780){_0x17d780=_0x17d780||0xc8;return function(_0x33b1eb){if(_0x33b1eb){return _0x3da619[_0x4b20('0x18')](_0x17d780)[_0x4b20('0x19')](_0x33b1eb);}};}function respondWithFilteredResult(_0x5afcf1,_0x181ef8){return function(_0x182bd5){if(_0x182bd5){var _0xbdddc8=typeof _0x181ef8[_0x4b20('0x1a')]===_0x4b20('0x1b')&&typeof _0x181ef8[_0x4b20('0x1c')]===_0x4b20('0x1b');var _0x5c9d64=_0x182bd5['count'];var _0x1b91e0=_0xbdddc8?0x0:_0x181ef8[_0x4b20('0x1a')];var _0x1855a0=_0xbdddc8?_0x182bd5[_0x4b20('0x1d')]:_0x181ef8['offset']+_0x181ef8[_0x4b20('0x1c')];var _0x11f8c4;if(_0x1855a0>=_0x5c9d64){_0x1855a0=_0x5c9d64;_0x11f8c4=0xc8;}else{_0x11f8c4=0xce;}_0x5afcf1[_0x4b20('0x18')](_0x11f8c4);return _0x5afcf1[_0x4b20('0x1e')](_0x4b20('0x1f'),_0x1b91e0+'-'+_0x1855a0+'/'+_0x5c9d64)[_0x4b20('0x19')](_0x182bd5);}return null;};}function patchUpdates(_0x8f0238){return function(_0x332ee8){try{jsonpatch['apply'](_0x332ee8,_0x8f0238,!![]);}catch(_0x520e70){return BPromise[_0x4b20('0x20')](_0x520e70);}return _0x332ee8[_0x4b20('0x21')]();};}function saveUpdates(_0x293989,_0x33a4e6){return function(_0x2aac62){if(_0x2aac62){return _0x2aac62[_0x4b20('0x22')](_0x293989)[_0x4b20('0x23')](function(_0x4d1fbf){return _0x4d1fbf;});}return null;};}function removeEntity(_0x38e713,_0x4b54e3){return function(_0x551485){if(_0x551485){return _0x551485['destroy']()[_0x4b20('0x23')](function(){_0x38e713['status'](0xcc)[_0x4b20('0x17')]();});}};}function handleEntityNotFound(_0x6276ec,_0x46ab49){return function(_0x45068c){if(!_0x45068c){_0x6276ec['sendStatus'](0x194);}return _0x45068c;};}function handleError(_0x3c4d3c,_0x25b765){_0x25b765=_0x25b765||0x1f4;return function(_0x32b555){logger[_0x4b20('0x24')](_0x32b555['stack']);if(_0x32b555[_0x4b20('0x25')]){delete _0x32b555['name'];}_0x3c4d3c['status'](_0x25b765)[_0x4b20('0x26')](_0x32b555);};}exports[_0x4b20('0x27')]=function(_0x52c085,_0x35fc64){var _0x2d9b47={},_0x54fb82={},_0x26edc9={'count':0x0,'rows':[]};var _0x5aaabf=_['map'](db[_0x4b20('0x28')][_0x4b20('0x29')],function(_0x233bf0){return{'name':_0x233bf0[_0x4b20('0x2a')],'type':_0x233bf0[_0x4b20('0x2b')][_0x4b20('0x2c')]};});_0x54fb82[_0x4b20('0x2d')]=_[_0x4b20('0x2e')](_0x5aaabf,'name');_0x54fb82[_0x4b20('0x2f')]=_[_0x4b20('0x30')](_0x52c085[_0x4b20('0x2f')]);_0x54fb82['filters']=_[_0x4b20('0x31')](_0x54fb82[_0x4b20('0x2d')],_0x54fb82[_0x4b20('0x2f')]);_0x2d9b47[_0x4b20('0x32')]=_[_0x4b20('0x31')](_0x54fb82['model'],qs['fields'](_0x52c085[_0x4b20('0x2f')]['fields']));_0x2d9b47['attributes']=_0x2d9b47['attributes'][_0x4b20('0x33')]?_0x2d9b47[_0x4b20('0x32')]:_0x54fb82[_0x4b20('0x2d')];if(!_0x52c085[_0x4b20('0x2f')][_0x4b20('0x34')](_0x4b20('0x35'))){_0x2d9b47['limit']=qs[_0x4b20('0x1c')](_0x52c085[_0x4b20('0x2f')][_0x4b20('0x1c')]);_0x2d9b47[_0x4b20('0x1a')]=qs[_0x4b20('0x1a')](_0x52c085[_0x4b20('0x2f')][_0x4b20('0x1a')]);}_0x2d9b47[_0x4b20('0x36')]=qs['sort'](_0x52c085[_0x4b20('0x2f')][_0x4b20('0x37')]);_0x2d9b47['where']=qs['filters'](_[_0x4b20('0x38')](_0x52c085[_0x4b20('0x2f')],_0x54fb82['filters']),_0x5aaabf);if(_0x52c085[_0x4b20('0x2f')][_0x4b20('0x39')]){_0x2d9b47[_0x4b20('0x3a')]=_['merge'](_0x2d9b47[_0x4b20('0x3a')],{'$or':_['map'](_0x5aaabf,function(_0x435265){if(_0x435265[_0x4b20('0x2b')]!==_0x4b20('0x3b')){var _0x21b5cf={};_0x21b5cf[_0x435265[_0x4b20('0x25')]]={'$like':'%'+_0x52c085[_0x4b20('0x2f')][_0x4b20('0x39')]+'%'};return _0x21b5cf;}})});}_0x2d9b47=_[_0x4b20('0x3c')]({},_0x2d9b47,_0x52c085[_0x4b20('0x3d')]);var _0x5ccb3f={'where':_0x2d9b47[_0x4b20('0x3a')]};return db[_0x4b20('0x28')][_0x4b20('0x1d')](_0x5ccb3f)['then'](function(_0x56fe4e){_0x26edc9[_0x4b20('0x1d')]=_0x56fe4e;if(_0x52c085[_0x4b20('0x2f')][_0x4b20('0x3e')]){_0x2d9b47['include']=[{'all':!![]}];}return db[_0x4b20('0x28')][_0x4b20('0x3f')](_0x2d9b47);})['then'](function(_0xc3fa47){_0x26edc9[_0x4b20('0x40')]=_0xc3fa47;return _0x26edc9;})[_0x4b20('0x23')](respondWithFilteredResult(_0x35fc64,_0x2d9b47))[_0x4b20('0x41')](handleError(_0x35fc64,null));};exports['show']=function(_0xcd98a0,_0x1de820){var _0x3e5897={'raw':!![],'where':{'id':_0xcd98a0[_0x4b20('0x42')]['id']}},_0x4a3db8={};_0x4a3db8[_0x4b20('0x2d')]=_[_0x4b20('0x30')](db['MailSubstatus'][_0x4b20('0x29')]);_0x4a3db8[_0x4b20('0x2f')]=_[_0x4b20('0x30')](_0xcd98a0[_0x4b20('0x2f')]);_0x4a3db8[_0x4b20('0x43')]=_[_0x4b20('0x31')](_0x4a3db8[_0x4b20('0x2d')],_0x4a3db8[_0x4b20('0x2f')]);_0x3e5897[_0x4b20('0x32')]=_[_0x4b20('0x31')](_0x4a3db8[_0x4b20('0x2d')],qs[_0x4b20('0x44')](_0xcd98a0['query'][_0x4b20('0x44')]));_0x3e5897[_0x4b20('0x32')]=_0x3e5897[_0x4b20('0x32')]['length']?_0x3e5897[_0x4b20('0x32')]:_0x4a3db8[_0x4b20('0x2d')];if(_0xcd98a0[_0x4b20('0x2f')][_0x4b20('0x3e')]){_0x3e5897[_0x4b20('0x45')]=[{'all':!![]}];}_0x3e5897=_[_0x4b20('0x3c')]({},_0x3e5897,_0xcd98a0[_0x4b20('0x3d')]);return db[_0x4b20('0x28')][_0x4b20('0x46')](_0x3e5897)[_0x4b20('0x23')](handleEntityNotFound(_0x1de820,null))[_0x4b20('0x23')](respondWithResult(_0x1de820,null))[_0x4b20('0x41')](handleError(_0x1de820,null));};exports[_0x4b20('0x47')]=function(_0x1c53e4,_0x18725c){return db[_0x4b20('0x28')][_0x4b20('0x47')](_0x1c53e4[_0x4b20('0x48')],{})[_0x4b20('0x23')](respondWithResult(_0x18725c,0xc9))[_0x4b20('0x41')](handleError(_0x18725c,null));};exports[_0x4b20('0x22')]=function(_0x563061,_0x49c971){if(_0x563061['body']['id']){delete _0x563061[_0x4b20('0x48')]['id'];}return db[_0x4b20('0x28')]['find']({'where':{'id':_0x563061[_0x4b20('0x42')]['id']}})[_0x4b20('0x23')](handleEntityNotFound(_0x49c971,null))['then'](saveUpdates(_0x563061[_0x4b20('0x48')],null))[_0x4b20('0x23')](respondWithResult(_0x49c971,null))[_0x4b20('0x41')](handleError(_0x49c971,null));};exports[_0x4b20('0x49')]=function(_0x247908,_0x38acf0){return db[_0x4b20('0x28')]['find']({'where':{'id':_0x247908['params']['id']}})[_0x4b20('0x23')](handleEntityNotFound(_0x38acf0,null))[_0x4b20('0x23')](removeEntity(_0x38acf0,null))[_0x4b20('0x41')](handleError(_0x38acf0,null));};exports[_0x4b20('0x4a')]=function(_0x4885d0,_0x4e8fe0){return db['MailSubstatus'][_0x4b20('0x4a')]()[_0x4b20('0x23')](respondWithResult(_0x4e8fe0,null))[_0x4b20('0x41')](handleError(_0x4e8fe0,null));}; \ No newline at end of file +var _0x9d61=['intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','fields','options','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','map','keys','query','filters'];(function(_0x52bb73,_0x4d0075){var _0x5b66fb=function(_0xa06810){while(--_0xa06810){_0x52bb73['push'](_0x52bb73['shift']());}};_0x5b66fb(++_0x4d0075);}(_0x9d61,0xff));var _0x19d6=function(_0x200b64,_0x75ecf8){_0x200b64=_0x200b64-0x0;var _0x550dc0=_0x9d61[_0x200b64];return _0x550dc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x19d6('0x0'));var zipdir=require(_0x19d6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19d6('0x2'));var moment=require(_0x19d6('0x3'));var BPromise=require(_0x19d6('0x4'));var Mustache=require(_0x19d6('0x5'));var util=require(_0x19d6('0x6'));var path=require(_0x19d6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19d6('0x8'));var _=require(_0x19d6('0x9'));var squel=require(_0x19d6('0xa'));var crypto=require('crypto');var jsforce=require(_0x19d6('0xb'));var deskjs=require(_0x19d6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x19d6('0xd'));var Papa=require(_0x19d6('0xe'));var Redis=require(_0x19d6('0xf'));var authService=require(_0x19d6('0x10'));var qs=require(_0x19d6('0x11'));var as=require(_0x19d6('0x12'));var hardwareService=require(_0x19d6('0x13'));var logger=require(_0x19d6('0x14'))(_0x19d6('0x15'));var utils=require('../../config/utils');var config=require(_0x19d6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x19d6('0x17'))['db'];function respondWithStatusCode(_0x57ef4d,_0x1b3130){_0x1b3130=_0x1b3130||0xcc;return function(_0x263c12){if(_0x263c12){return _0x57ef4d[_0x19d6('0x18')](_0x1b3130);}return _0x57ef4d[_0x19d6('0x19')](_0x1b3130)[_0x19d6('0x1a')]();};}function respondWithResult(_0x884969,_0x100e6d){_0x100e6d=_0x100e6d||0xc8;return function(_0x537b95){if(_0x537b95){return _0x884969[_0x19d6('0x19')](_0x100e6d)[_0x19d6('0x1b')](_0x537b95);}};}function respondWithFilteredResult(_0x44d059,_0x2d66aa){return function(_0x92f37f){if(_0x92f37f){var _0x311cd1=typeof _0x2d66aa['offset']===_0x19d6('0x1c')&&typeof _0x2d66aa[_0x19d6('0x1d')]===_0x19d6('0x1c');var _0x317b03=_0x92f37f[_0x19d6('0x1e')];var _0x38e346=_0x311cd1?0x0:_0x2d66aa['offset'];var _0x21cd38=_0x311cd1?_0x92f37f[_0x19d6('0x1e')]:_0x2d66aa[_0x19d6('0x1f')]+_0x2d66aa[_0x19d6('0x1d')];var _0x2d5f0e;if(_0x21cd38>=_0x317b03){_0x21cd38=_0x317b03;_0x2d5f0e=0xc8;}else{_0x2d5f0e=0xce;}_0x44d059[_0x19d6('0x19')](_0x2d5f0e);return _0x44d059[_0x19d6('0x20')](_0x19d6('0x21'),_0x38e346+'-'+_0x21cd38+'/'+_0x317b03)['json'](_0x92f37f);}return null;};}function patchUpdates(_0x22cfb5){return function(_0x599020){try{jsonpatch['apply'](_0x599020,_0x22cfb5,!![]);}catch(_0x443ac3){return BPromise[_0x19d6('0x22')](_0x443ac3);}return _0x599020['save']();};}function saveUpdates(_0x368ce4,_0x32cdb2){return function(_0x3b4633){if(_0x3b4633){return _0x3b4633[_0x19d6('0x23')](_0x368ce4)[_0x19d6('0x24')](function(_0x137a7f){return _0x137a7f;});}return null;};}function removeEntity(_0x47fa22,_0x5168cb){return function(_0x4e5a16){if(_0x4e5a16){return _0x4e5a16['destroy']()['then'](function(){_0x47fa22['status'](0xcc)[_0x19d6('0x1a')]();});}};}function handleEntityNotFound(_0x47ec60,_0x30386e){return function(_0xb4f1cf){if(!_0xb4f1cf){_0x47ec60[_0x19d6('0x18')](0x194);}return _0xb4f1cf;};}function handleError(_0x28d90f,_0x31af17){_0x31af17=_0x31af17||0x1f4;return function(_0x193144){logger[_0x19d6('0x25')](_0x193144[_0x19d6('0x26')]);if(_0x193144[_0x19d6('0x27')]){delete _0x193144[_0x19d6('0x27')];}_0x28d90f[_0x19d6('0x19')](_0x31af17)[_0x19d6('0x28')](_0x193144);};}exports[_0x19d6('0x29')]=function(_0x3b45e8,_0x4d8e38){var _0x151151={},_0x57b1e1={},_0x5401bd={'count':0x0,'rows':[]};var _0xd4803=_['map'](db[_0x19d6('0x2a')][_0x19d6('0x2b')],function(_0x48644e){return{'name':_0x48644e[_0x19d6('0x2c')],'type':_0x48644e['type']['key']};});_0x57b1e1['model']=_[_0x19d6('0x2d')](_0xd4803,_0x19d6('0x27'));_0x57b1e1['query']=_[_0x19d6('0x2e')](_0x3b45e8[_0x19d6('0x2f')]);_0x57b1e1[_0x19d6('0x30')]=_[_0x19d6('0x31')](_0x57b1e1[_0x19d6('0x32')],_0x57b1e1['query']);_0x151151[_0x19d6('0x33')]=_['intersection'](_0x57b1e1[_0x19d6('0x32')],qs['fields'](_0x3b45e8[_0x19d6('0x2f')]['fields']));_0x151151[_0x19d6('0x33')]=_0x151151[_0x19d6('0x33')][_0x19d6('0x34')]?_0x151151[_0x19d6('0x33')]:_0x57b1e1[_0x19d6('0x32')];if(!_0x3b45e8[_0x19d6('0x2f')][_0x19d6('0x35')](_0x19d6('0x36'))){_0x151151[_0x19d6('0x1d')]=qs[_0x19d6('0x1d')](_0x3b45e8[_0x19d6('0x2f')]['limit']);_0x151151[_0x19d6('0x1f')]=qs[_0x19d6('0x1f')](_0x3b45e8[_0x19d6('0x2f')][_0x19d6('0x1f')]);}_0x151151[_0x19d6('0x37')]=qs[_0x19d6('0x38')](_0x3b45e8[_0x19d6('0x2f')]['sort']);_0x151151[_0x19d6('0x39')]=qs[_0x19d6('0x30')](_[_0x19d6('0x3a')](_0x3b45e8[_0x19d6('0x2f')],_0x57b1e1[_0x19d6('0x30')]),_0xd4803);if(_0x3b45e8['query']['filter']){_0x151151['where']=_[_0x19d6('0x3b')](_0x151151['where'],{'$or':_['map'](_0xd4803,function(_0x3b2e2e){if(_0x3b2e2e[_0x19d6('0x3c')]!==_0x19d6('0x3d')){var _0x2af518={};_0x2af518[_0x3b2e2e[_0x19d6('0x27')]]={'$like':'%'+_0x3b45e8[_0x19d6('0x2f')][_0x19d6('0x3e')]+'%'};return _0x2af518;}})});}_0x151151=_['merge']({},_0x151151,_0x3b45e8['options']);var _0x2ad9af={'where':_0x151151[_0x19d6('0x39')]};return db[_0x19d6('0x2a')]['count'](_0x2ad9af)['then'](function(_0x51af86){_0x5401bd[_0x19d6('0x1e')]=_0x51af86;if(_0x3b45e8[_0x19d6('0x2f')][_0x19d6('0x3f')]){_0x151151[_0x19d6('0x40')]=[{'all':!![]}];}return db[_0x19d6('0x2a')]['findAll'](_0x151151);})[_0x19d6('0x24')](function(_0x3435b7){_0x5401bd[_0x19d6('0x41')]=_0x3435b7;return _0x5401bd;})['then'](respondWithFilteredResult(_0x4d8e38,_0x151151))[_0x19d6('0x42')](handleError(_0x4d8e38,null));};exports[_0x19d6('0x43')]=function(_0x5b6a44,_0x1332e5){var _0x4c02f1={'raw':!![],'where':{'id':_0x5b6a44[_0x19d6('0x44')]['id']}},_0xc193c0={};_0xc193c0['model']=_['keys'](db['MailSubstatus'][_0x19d6('0x2b')]);_0xc193c0[_0x19d6('0x2f')]=_[_0x19d6('0x2e')](_0x5b6a44[_0x19d6('0x2f')]);_0xc193c0[_0x19d6('0x30')]=_['intersection'](_0xc193c0[_0x19d6('0x32')],_0xc193c0[_0x19d6('0x2f')]);_0x4c02f1[_0x19d6('0x33')]=_[_0x19d6('0x31')](_0xc193c0[_0x19d6('0x32')],qs[_0x19d6('0x45')](_0x5b6a44[_0x19d6('0x2f')][_0x19d6('0x45')]));_0x4c02f1[_0x19d6('0x33')]=_0x4c02f1['attributes'][_0x19d6('0x34')]?_0x4c02f1[_0x19d6('0x33')]:_0xc193c0[_0x19d6('0x32')];if(_0x5b6a44[_0x19d6('0x2f')][_0x19d6('0x3f')]){_0x4c02f1[_0x19d6('0x40')]=[{'all':!![]}];}_0x4c02f1=_[_0x19d6('0x3b')]({},_0x4c02f1,_0x5b6a44[_0x19d6('0x46')]);return db['MailSubstatus'][_0x19d6('0x47')](_0x4c02f1)[_0x19d6('0x24')](handleEntityNotFound(_0x1332e5,null))[_0x19d6('0x24')](respondWithResult(_0x1332e5,null))[_0x19d6('0x42')](handleError(_0x1332e5,null));};exports[_0x19d6('0x48')]=function(_0x1d8154,_0x5a3c20){return db[_0x19d6('0x2a')]['create'](_0x1d8154[_0x19d6('0x49')],{})[_0x19d6('0x24')](respondWithResult(_0x5a3c20,0xc9))[_0x19d6('0x42')](handleError(_0x5a3c20,null));};exports[_0x19d6('0x23')]=function(_0x48270e,_0x282c0d){if(_0x48270e[_0x19d6('0x49')]['id']){delete _0x48270e[_0x19d6('0x49')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x48270e[_0x19d6('0x44')]['id']}})['then'](handleEntityNotFound(_0x282c0d,null))[_0x19d6('0x24')](saveUpdates(_0x48270e[_0x19d6('0x49')],null))[_0x19d6('0x24')](respondWithResult(_0x282c0d,null))['catch'](handleError(_0x282c0d,null));};exports[_0x19d6('0x4a')]=function(_0x3e768e,_0x12c5a1){return db[_0x19d6('0x2a')][_0x19d6('0x47')]({'where':{'id':_0x3e768e[_0x19d6('0x44')]['id']}})[_0x19d6('0x24')](handleEntityNotFound(_0x12c5a1,null))['then'](removeEntity(_0x12c5a1,null))[_0x19d6('0x42')](handleError(_0x12c5a1,null));};exports[_0x19d6('0x4b')]=function(_0x5d7b42,_0x506347){return db[_0x19d6('0x2a')][_0x19d6('0x4b')]()[_0x19d6('0x24')](respondWithResult(_0x506347,null))[_0x19d6('0x42')](handleError(_0x506347,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index deca0f3..d3223be 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 _0x99d5=['update','emit','hasOwnProperty','hook','exports','events','MailSubstatus','setMaxListeners'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x99d5,0x12d));var _0x599d=function(_0x49fc42,_0x18def7){_0x49fc42=_0x49fc42-0x0;var _0x5caa59=_0x99d5[_0x49fc42];return _0x5caa59;};'use strict';var EventEmitter=require(_0x599d('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x599d('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x599d('0x2')](0x0);var events={'afterUpdate':_0x599d('0x3')};function emitEvent(_0xd81136){return function(_0x520ca9,_0x23c0f9,_0x10b574){MailSubstatusEvents[_0x599d('0x4')](_0xd81136+':'+_0x520ca9['id'],_0x520ca9);MailSubstatusEvents[_0x599d('0x4')](_0xd81136,_0x520ca9);_0x10b574(null);};}for(var e in events){if(events[_0x599d('0x5')](e)){var event=events[e];MailSubstatus[_0x599d('0x6')](e,emitEvent(event));}}module[_0x599d('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x2950=['events','../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x1f8126,_0x3038a4){var _0x25af01=function(_0x4728f8){while(--_0x4728f8){_0x1f8126['push'](_0x1f8126['shift']());}};_0x25af01(++_0x3038a4);}(_0x2950,0xe0));var _0x0295=function(_0x3b702c,_0x503f7a){_0x3b702c=_0x3b702c-0x0;var _0x2cd3f9=_0x2950[_0x3b702c];return _0x2cd3f9;};'use strict';var EventEmitter=require(_0x0295('0x0'));var MailSubstatus=require(_0x0295('0x1'))['db'][_0x0295('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0295('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x3575a9){return function(_0x2db940,_0x3f8bef,_0x5aa424){MailSubstatusEvents[_0x0295('0x4')](_0x3575a9+':'+_0x2db940['id'],_0x2db940);MailSubstatusEvents['emit'](_0x3575a9,_0x2db940);_0x5aa424(null);};}for(var e in events){if(events[_0x0295('0x5')](e)){var event=events[e];MailSubstatus[_0x0295('0x6')](e,emitEvent(event));}}module[_0x0295('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 2c7a5ca..53e8fc1 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 _0xac2d=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','exports','define','MailSubstatus'];(function(_0x48856c,_0x2ee659){var _0x4a0e01=function(_0x1432e8){while(--_0x1432e8){_0x48856c['push'](_0x48856c['shift']());}};_0x4a0e01(++_0x2ee659);}(_0xac2d,0x13c));var _0xdac2=function(_0x27c7ca,_0xefe06f){_0x27c7ca=_0x27c7ca-0x0;var _0x44d893=_0xac2d[_0x27c7ca];return _0x44d893;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xdac2('0x0')]=function(_0x4e5297){var _0x36105d=_0x4e5297['models'];return _0x4e5297[_0xdac2('0x1')](_0xdac2('0x2'),attributes,{'tableName':_0xdac2('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1c93c7,_0x388d97,_0x4e077d){return _0x36105d[_0xdac2('0x4')][_0xdac2('0x5')]({'value':_0x1c93c7[_0xdac2('0x6')]},{'where':{'field':_0xdac2('0x7'),'value':_0x1c93c7[_0xdac2('0x8')]['name']}})[_0xdac2('0x9')](function(){_0x4e077d();})[_0xdac2('0xa')](function(_0x1a8a29){_0x4e077d(_0x1a8a29);});}}});}; \ No newline at end of file +var _0x1de0=['name','then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues'];(function(_0x2fcccf,_0x57a767){var _0x407edc=function(_0x13048b){while(--_0x13048b){_0x2fcccf['push'](_0x2fcccf['shift']());}};_0x407edc(++_0x57a767);}(_0x1de0,0x1b3));var _0x01de=function(_0x2eef8c,_0x15a03d){_0x2eef8c=_0x2eef8c-0x0;var _0x1bec99=_0x1de0[_0x2eef8c];return _0x1bec99;};'use strict';var attributes=require(_0x01de('0x0'));module[_0x01de('0x1')]=function(_0x1876b5){var _0x38c77d=_0x1876b5[_0x01de('0x2')];return _0x1876b5['define'](_0x01de('0x3'),attributes,{'tableName':_0x01de('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x465f0c,_0x45a011,_0x3cd415){return _0x38c77d[_0x01de('0x5')][_0x01de('0x6')]({'value':_0x465f0c['name']},{'where':{'field':_0x01de('0x7'),'value':_0x465f0c[_0x01de('0x8')][_0x01de('0x9')]}})[_0x01de('0xa')](function(){_0x3cd415();})[_0x01de('0xb')](function(_0x33ae5a){_0x3cd415(_0x33ae5a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index a34bc3b..a786d8e 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 _0xdf12=['then','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xdf12,0x170));var _0x2df1=function(_0x58eed2,_0x468b88){_0x58eed2=_0x58eed2-0x0;var _0x598342=_0xdf12[_0x58eed2];return _0x598342;};'use strict';var _=require(_0x2df1('0x0'));var util=require(_0x2df1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2df1('0x2'));var fs=require('fs');var Redis=require(_0x2df1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2df1('0x4'));var logger=require(_0x2df1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2df1('0x6'));var client=jayson[_0x2df1('0x7')][_0x2df1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2195c4,_0xefe2e3,_0x1b9f6b){return new BPromise(function(_0x13d660,_0x163711){return client[_0x2df1('0x9')](_0x2195c4,_0x1b9f6b)[_0x2df1('0xa')](function(_0x17cdf1){logger[_0x2df1('0xb')](_0x2df1('0xc'),_0xefe2e3,'request\x20sent');logger[_0x2df1('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0xefe2e3,_0x2df1('0xe'),JSON[_0x2df1('0xf')](_0x17cdf1));if(_0x17cdf1['error']){if(_0x17cdf1['error'][_0x2df1('0x10')]===0x1f4){logger['error'](_0x2df1('0xc'),_0xefe2e3,_0x17cdf1[_0x2df1('0x11')]['message']);return _0x163711(_0x17cdf1['error']['message']);}logger[_0x2df1('0x11')](_0x2df1('0xc'),_0xefe2e3,_0x17cdf1['error'][_0x2df1('0x12')]);return _0x13d660(_0x17cdf1[_0x2df1('0x11')]['message']);}else{logger['info'](_0x2df1('0xc'),_0xefe2e3,_0x2df1('0xe'));_0x13d660(_0x17cdf1[_0x2df1('0x13')][_0x2df1('0x12')]);}})[_0x2df1('0x14')](function(_0x4ea337){logger[_0x2df1('0x11')](_0x2df1('0xc'),_0xefe2e3,_0x4ea337);_0x163711(_0x4ea337);});});} \ No newline at end of file +var _0xe8b1=['request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x12f654,_0x4e1c65){var _0x59b5ae=function(_0x31cc76){while(--_0x31cc76){_0x12f654['push'](_0x12f654['shift']());}};_0x59b5ae(++_0x4e1c65);}(_0xe8b1,0x8a));var _0x1e8b=function(_0x2330fd,_0x56e9c7){_0x2330fd=_0x2330fd-0x0;var _0x5c1eba=_0xe8b1[_0x2330fd];return _0x5c1eba;};'use strict';var _=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e8b('0x2'));var fs=require('fs');var Redis=require(_0x1e8b('0x3'));var db=require(_0x1e8b('0x4'))['db'];var utils=require(_0x1e8b('0x5'));var logger=require(_0x1e8b('0x6'))(_0x1e8b('0x7'));var config=require(_0x1e8b('0x8'));var jayson=require(_0x1e8b('0x9'));var client=jayson[_0x1e8b('0xa')][_0x1e8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fbc48,_0x398f06,_0x3651d2){return new BPromise(function(_0x343d1e,_0x405b7b){return client[_0x1e8b('0xc')](_0x4fbc48,_0x3651d2)[_0x1e8b('0xd')](function(_0x36a48b){logger[_0x1e8b('0xe')](_0x1e8b('0xf'),_0x398f06,_0x1e8b('0x10'));logger[_0x1e8b('0x11')](_0x1e8b('0x12'),_0x398f06,_0x1e8b('0x10'),JSON[_0x1e8b('0x13')](_0x36a48b));if(_0x36a48b['error']){if(_0x36a48b[_0x1e8b('0x14')][_0x1e8b('0x15')]===0x1f4){logger[_0x1e8b('0x14')](_0x1e8b('0xf'),_0x398f06,_0x36a48b[_0x1e8b('0x14')]['message']);return _0x405b7b(_0x36a48b[_0x1e8b('0x14')]['message']);}logger[_0x1e8b('0x14')](_0x1e8b('0xf'),_0x398f06,_0x36a48b[_0x1e8b('0x14')][_0x1e8b('0x16')]);return _0x343d1e(_0x36a48b[_0x1e8b('0x14')][_0x1e8b('0x16')]);}else{logger['info'](_0x1e8b('0xf'),_0x398f06,_0x1e8b('0x10'));_0x343d1e(_0x36a48b[_0x1e8b('0x17')][_0x1e8b('0x16')]);}})[_0x1e8b('0x18')](function(_0x63f0c5){logger[_0x1e8b('0x14')](_0x1e8b('0xf'),_0x398f06,_0x63f0c5);_0x405b7b(_0x63f0c5);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3ab34ab..cf889d1 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 _0x3a3a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','destroy','exports'];(function(_0x465bc1,_0x4bebc5){var _0x26ab8f=function(_0xec0b70){while(--_0xec0b70){_0x465bc1['push'](_0x465bc1['shift']());}};_0x26ab8f(++_0x4bebc5);}(_0x3a3a,0x144));var _0xa3a3=function(_0x40850d,_0x550451){_0x40850d=_0x40850d-0x0;var _0x3e8508=_0x3a3a[_0x40850d];return _0x3e8508;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa3a3('0x0'));var timeout=require(_0xa3a3('0x1'));var express=require(_0xa3a3('0x2'));var router=express[_0xa3a3('0x3')]();var fs_extra=require(_0xa3a3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa3a3('0x5'));var config=require(_0xa3a3('0x6'));var controller=require(_0xa3a3('0x7'));router[_0xa3a3('0x8')]('/',auth[_0xa3a3('0x9')](),controller[_0xa3a3('0xa')]);router[_0xa3a3('0x8')](_0xa3a3('0xb'),auth[_0xa3a3('0x9')](),controller[_0xa3a3('0xc')]);router[_0xa3a3('0x8')](_0xa3a3('0xd'),auth[_0xa3a3('0x9')](),controller['show']);router[_0xa3a3('0xe')]('/',auth[_0xa3a3('0x9')](),controller['create']);router[_0xa3a3('0xf')](_0xa3a3('0xd'),auth[_0xa3a3('0x9')](),controller['update']);router['delete']('/:id',auth[_0xa3a3('0x9')](),controller[_0xa3a3('0x10')]);module[_0xa3a3('0x11')]=router; \ No newline at end of file +var _0x823c=['./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x52ec05,_0x15b3ef){var _0x47f47d=function(_0x4a4d00){while(--_0x4a4d00){_0x52ec05['push'](_0x52ec05['shift']());}};_0x47f47d(++_0x15b3ef);}(_0x823c,0xe4));var _0xc823=function(_0x39c22b,_0x4a3247){_0x39c22b=_0x39c22b-0x0;var _0x63f94e=_0x823c[_0x39c22b];return _0x63f94e;};'use strict';var multer=require(_0xc823('0x0'));var util=require('util');var path=require(_0xc823('0x1'));var timeout=require('connect-timeout');var express=require(_0xc823('0x2'));var router=express['Router']();var fs_extra=require(_0xc823('0x3'));var auth=require(_0xc823('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc823('0x5'));var controller=require(_0xc823('0x6'));router[_0xc823('0x7')]('/',auth[_0xc823('0x8')](),controller[_0xc823('0x9')]);router[_0xc823('0x7')](_0xc823('0xa'),auth['isAuthenticated'](),controller[_0xc823('0xb')]);router[_0xc823('0x7')](_0xc823('0xc'),auth[_0xc823('0x8')](),controller[_0xc823('0xd')]);router['post']('/',auth[_0xc823('0x8')](),controller[_0xc823('0xe')]);router['put'](_0xc823('0xc'),auth[_0xc823('0x8')](),controller[_0xc823('0xf')]);router[_0xc823('0x10')](_0xc823('0xc'),auth[_0xc823('0x8')](),controller[_0xc823('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9426eea..933713f 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x468ac5,_0x2edfd5){var _0x33a807=function(_0x204fb5){while(--_0x204fb5){_0x468ac5['push'](_0x468ac5['shift']());}};_0x33a807(++_0x2edfd5);}(_0x008c,0x188));var _0xc008=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x008c[_0x484c03];return _0x294127;};'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 +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1a06c4,_0x17d0e0){var _0x1bf57b=function(_0x2c11fa){while(--_0x2c11fa){_0x1a06c4['push'](_0x1a06c4['shift']());}};_0x1bf57b(++_0x17d0e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index af87e6f..c39e70e 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 _0x4a62=['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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','fieldName','type','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body'];(function(_0x5defac,_0x248f2b){var _0x58d90b=function(_0x5c97c6){while(--_0x5c97c6){_0x5defac['push'](_0x5defac['shift']());}};_0x58d90b(++_0x248f2b);}(_0x4a62,0x1d5));var _0x24a6=function(_0x5c62e2,_0x2ef1e1){_0x5c62e2=_0x5c62e2-0x0;var _0x1570b3=_0x4a62[_0x5c62e2];return _0x1570b3;};'use strict';var emlformat=require(_0x24a6('0x0'));var rimraf=require(_0x24a6('0x1'));var zipdir=require(_0x24a6('0x2'));var jsonpatch=require(_0x24a6('0x3'));var rp=require('request-promise');var moment=require(_0x24a6('0x4'));var BPromise=require(_0x24a6('0x5'));var Mustache=require(_0x24a6('0x6'));var util=require(_0x24a6('0x7'));var path=require(_0x24a6('0x8'));var sox=require(_0x24a6('0x9'));var csv=require(_0x24a6('0xa'));var ejs=require(_0x24a6('0xb'));var fs=require('fs');var fs_extra=require(_0x24a6('0xc'));var _=require(_0x24a6('0xd'));var squel=require(_0x24a6('0xe'));var crypto=require(_0x24a6('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24a6('0x10'));var Papa=require(_0x24a6('0x11'));var Redis=require('ioredis');var authService=require(_0x24a6('0x12'));var qs=require(_0x24a6('0x13'));var as=require(_0x24a6('0x14'));var hardwareService=require(_0x24a6('0x15'));var logger=require('../../config/logger')(_0x24a6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x24a6('0x17'));var db=require(_0x24a6('0x18'))['db'];function respondWithStatusCode(_0x56d32b,_0x2c84a6){_0x2c84a6=_0x2c84a6||0xcc;return function(_0x5c7b91){if(_0x5c7b91){return _0x56d32b[_0x24a6('0x19')](_0x2c84a6);}return _0x56d32b['status'](_0x2c84a6)[_0x24a6('0x1a')]();};}function respondWithResult(_0x18f505,_0x4d9129){_0x4d9129=_0x4d9129||0xc8;return function(_0x49a5ce){if(_0x49a5ce){return _0x18f505[_0x24a6('0x1b')](_0x4d9129)[_0x24a6('0x1c')](_0x49a5ce);}};}function respondWithFilteredResult(_0x12c42b,_0x331206){return function(_0x4c0a43){if(_0x4c0a43){var _0x473a92=typeof _0x331206[_0x24a6('0x1d')]==='undefined'&&typeof _0x331206[_0x24a6('0x1e')]===_0x24a6('0x1f');var _0x230c62=_0x4c0a43[_0x24a6('0x20')];var _0x2c853e=_0x473a92?0x0:_0x331206[_0x24a6('0x1d')];var _0x3c8a8b=_0x473a92?_0x4c0a43['count']:_0x331206[_0x24a6('0x1d')]+_0x331206[_0x24a6('0x1e')];var _0x1719c9;if(_0x3c8a8b>=_0x230c62){_0x3c8a8b=_0x230c62;_0x1719c9=0xc8;}else{_0x1719c9=0xce;}_0x12c42b[_0x24a6('0x1b')](_0x1719c9);return _0x12c42b['set'](_0x24a6('0x21'),_0x2c853e+'-'+_0x3c8a8b+'/'+_0x230c62)[_0x24a6('0x1c')](_0x4c0a43);}return null;};}function patchUpdates(_0x2510b8){return function(_0x4bcd34){try{jsonpatch[_0x24a6('0x22')](_0x4bcd34,_0x2510b8,!![]);}catch(_0x166670){return BPromise[_0x24a6('0x23')](_0x166670);}return _0x4bcd34[_0x24a6('0x24')]();};}function saveUpdates(_0xff5d21,_0xae1bab){return function(_0x4fdd19){if(_0x4fdd19){return _0x4fdd19[_0x24a6('0x25')](_0xff5d21)[_0x24a6('0x26')](function(_0x441b67){return _0x441b67;});}return null;};}function removeEntity(_0x423e0d,_0xea600c){return function(_0x16b060){if(_0x16b060){return _0x16b060[_0x24a6('0x27')]()[_0x24a6('0x26')](function(){_0x423e0d['status'](0xcc)[_0x24a6('0x1a')]();});}};}function handleEntityNotFound(_0x1bbcd0,_0x9c0c8){return function(_0x52dcb4){if(!_0x52dcb4){_0x1bbcd0[_0x24a6('0x19')](0x194);}return _0x52dcb4;};}function handleError(_0x3a04ff,_0x3812bd){_0x3812bd=_0x3812bd||0x1f4;return function(_0x54fc63){logger[_0x24a6('0x28')](_0x54fc63[_0x24a6('0x29')]);if(_0x54fc63[_0x24a6('0x2a')]){delete _0x54fc63[_0x24a6('0x2a')];}_0x3a04ff[_0x24a6('0x1b')](_0x3812bd)[_0x24a6('0x2b')](_0x54fc63);};}exports[_0x24a6('0x2c')]=function(_0x557edd,_0x4abc6a){var _0x508ca={},_0x4a9867={},_0x4c7faf={'count':0x0,'rows':[]};var _0x1a2f77=_[_0x24a6('0x2d')](db[_0x24a6('0x2e')]['rawAttributes'],function(_0x3676e2){return{'name':_0x3676e2[_0x24a6('0x2f')],'type':_0x3676e2[_0x24a6('0x30')][_0x24a6('0x31')]};});_0x4a9867['model']=_['map'](_0x1a2f77,_0x24a6('0x2a'));_0x4a9867[_0x24a6('0x32')]=_[_0x24a6('0x33')](_0x557edd[_0x24a6('0x32')]);_0x4a9867[_0x24a6('0x34')]=_['intersection'](_0x4a9867['model'],_0x4a9867[_0x24a6('0x32')]);_0x508ca['attributes']=_['intersection'](_0x4a9867[_0x24a6('0x35')],qs[_0x24a6('0x36')](_0x557edd[_0x24a6('0x32')]['fields']));_0x508ca['attributes']=_0x508ca['attributes'][_0x24a6('0x37')]?_0x508ca[_0x24a6('0x38')]:_0x4a9867[_0x24a6('0x35')];if(!_0x557edd[_0x24a6('0x32')][_0x24a6('0x39')](_0x24a6('0x3a'))){_0x508ca[_0x24a6('0x1e')]=qs[_0x24a6('0x1e')](_0x557edd[_0x24a6('0x32')]['limit']);_0x508ca['offset']=qs['offset'](_0x557edd['query'][_0x24a6('0x1d')]);}_0x508ca['order']=qs[_0x24a6('0x3b')](_0x557edd[_0x24a6('0x32')][_0x24a6('0x3b')]);_0x508ca['where']=qs[_0x24a6('0x34')](_[_0x24a6('0x3c')](_0x557edd[_0x24a6('0x32')],_0x4a9867[_0x24a6('0x34')]),_0x1a2f77);if(_0x557edd[_0x24a6('0x32')][_0x24a6('0x3d')]){_0x508ca[_0x24a6('0x3e')]=_[_0x24a6('0x3f')](_0x508ca[_0x24a6('0x3e')],{'$or':_[_0x24a6('0x2d')](_0x1a2f77,function(_0x4d188c){if(_0x4d188c[_0x24a6('0x30')]!==_0x24a6('0x40')){var _0x4aae2b={};_0x4aae2b[_0x4d188c[_0x24a6('0x2a')]]={'$like':'%'+_0x557edd['query']['filter']+'%'};return _0x4aae2b;}})});}_0x508ca=_[_0x24a6('0x3f')]({},_0x508ca,_0x557edd[_0x24a6('0x41')]);var _0x32c8ff={'where':_0x508ca[_0x24a6('0x3e')]};return db[_0x24a6('0x2e')][_0x24a6('0x20')](_0x32c8ff)['then'](function(_0xcd322f){_0x4c7faf[_0x24a6('0x20')]=_0xcd322f;if(_0x557edd[_0x24a6('0x32')]['includeAll']){_0x508ca[_0x24a6('0x42')]=[{'all':!![]}];}return db[_0x24a6('0x2e')]['findAll'](_0x508ca);})[_0x24a6('0x26')](function(_0x1ba6ea){_0x4c7faf[_0x24a6('0x43')]=_0x1ba6ea;return _0x4c7faf;})[_0x24a6('0x26')](respondWithFilteredResult(_0x4abc6a,_0x508ca))[_0x24a6('0x44')](handleError(_0x4abc6a,null));};exports[_0x24a6('0x45')]=function(_0x41ecd7,_0xa790db){var _0x361142={'raw':!![],'where':{'id':_0x41ecd7[_0x24a6('0x46')]['id']}},_0x22521b={};_0x22521b[_0x24a6('0x35')]=_['keys'](db[_0x24a6('0x2e')][_0x24a6('0x47')]);_0x22521b[_0x24a6('0x32')]=_[_0x24a6('0x33')](_0x41ecd7[_0x24a6('0x32')]);_0x22521b[_0x24a6('0x34')]=_['intersection'](_0x22521b[_0x24a6('0x35')],_0x22521b[_0x24a6('0x32')]);_0x361142[_0x24a6('0x38')]=_[_0x24a6('0x48')](_0x22521b['model'],qs['fields'](_0x41ecd7[_0x24a6('0x32')][_0x24a6('0x36')]));_0x361142[_0x24a6('0x38')]=_0x361142[_0x24a6('0x38')][_0x24a6('0x37')]?_0x361142['attributes']:_0x22521b['model'];if(_0x41ecd7[_0x24a6('0x32')][_0x24a6('0x49')]){_0x361142['include']=[{'all':!![]}];}_0x361142=_[_0x24a6('0x3f')]({},_0x361142,_0x41ecd7[_0x24a6('0x41')]);return db[_0x24a6('0x2e')][_0x24a6('0x4a')](_0x361142)['then'](handleEntityNotFound(_0xa790db,null))[_0x24a6('0x26')](respondWithResult(_0xa790db,null))[_0x24a6('0x44')](handleError(_0xa790db,null));};exports[_0x24a6('0x4b')]=function(_0x65cd70,_0x486c81){return db[_0x24a6('0x2e')][_0x24a6('0x4b')](_0x65cd70['body'],{})[_0x24a6('0x26')](respondWithResult(_0x486c81,0xc9))[_0x24a6('0x44')](handleError(_0x486c81,null));};exports[_0x24a6('0x25')]=function(_0x5c5ff3,_0x1ca43d){if(_0x5c5ff3[_0x24a6('0x4c')]['id']){delete _0x5c5ff3['body']['id'];}return db[_0x24a6('0x2e')][_0x24a6('0x4a')]({'where':{'id':_0x5c5ff3[_0x24a6('0x46')]['id']}})[_0x24a6('0x26')](handleEntityNotFound(_0x1ca43d,null))[_0x24a6('0x26')](saveUpdates(_0x5c5ff3['body'],null))[_0x24a6('0x26')](respondWithResult(_0x1ca43d,null))[_0x24a6('0x44')](handleError(_0x1ca43d,null));};exports['destroy']=function(_0x433836,_0x5abfab){return db[_0x24a6('0x2e')][_0x24a6('0x4a')]({'where':{'id':_0x433836[_0x24a6('0x46')]['id']}})[_0x24a6('0x26')](handleEntityNotFound(_0x5abfab,null))['then'](removeEntity(_0x5abfab,null))[_0x24a6('0x44')](handleError(_0x5abfab,null));};exports[_0x24a6('0x4d')]=function(_0x45df41,_0x24923c){return db[_0x24a6('0x2e')][_0x24a6('0x4d')]()['then'](respondWithResult(_0x24923c,null))[_0x24a6('0x44')](handleError(_0x24923c,null));}; \ No newline at end of file +var _0x3d99=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','MailTransferReport','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x47a052,_0x353806){var _0x232d11=function(_0x50af29){while(--_0x50af29){_0x47a052['push'](_0x47a052['shift']());}};_0x232d11(++_0x353806);}(_0x3d99,0x91));var _0x93d9=function(_0x385bf4,_0x5e15d4){_0x385bf4=_0x385bf4-0x0;var _0x2243bd=_0x3d99[_0x385bf4];return _0x2243bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93d9('0x0'));var zipdir=require(_0x93d9('0x1'));var jsonpatch=require(_0x93d9('0x2'));var rp=require('request-promise');var moment=require(_0x93d9('0x3'));var BPromise=require(_0x93d9('0x4'));var Mustache=require(_0x93d9('0x5'));var util=require('util');var path=require(_0x93d9('0x6'));var sox=require(_0x93d9('0x7'));var csv=require(_0x93d9('0x8'));var ejs=require(_0x93d9('0x9'));var fs=require('fs');var fs_extra=require(_0x93d9('0xa'));var _=require(_0x93d9('0xb'));var squel=require(_0x93d9('0xc'));var crypto=require(_0x93d9('0xd'));var jsforce=require(_0x93d9('0xe'));var deskjs=require(_0x93d9('0xf'));var toCsv=require(_0x93d9('0x8'));var querystring=require(_0x93d9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93d9('0x11'));var qs=require(_0x93d9('0x12'));var as=require(_0x93d9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93d9('0x14'))(_0x93d9('0x15'));var utils=require(_0x93d9('0x16'));var config=require(_0x93d9('0x17'));var licenseUtil=require(_0x93d9('0x18'));var db=require(_0x93d9('0x19'))['db'];function respondWithStatusCode(_0xcc0a26,_0x3c0a70){_0x3c0a70=_0x3c0a70||0xcc;return function(_0x1d4f63){if(_0x1d4f63){return _0xcc0a26[_0x93d9('0x1a')](_0x3c0a70);}return _0xcc0a26[_0x93d9('0x1b')](_0x3c0a70)[_0x93d9('0x1c')]();};}function respondWithResult(_0x2fb55f,_0x15631d){_0x15631d=_0x15631d||0xc8;return function(_0x46b258){if(_0x46b258){return _0x2fb55f[_0x93d9('0x1b')](_0x15631d)[_0x93d9('0x1d')](_0x46b258);}};}function respondWithFilteredResult(_0x4ccb7c,_0x30bc4a){return function(_0x3e5adc){if(_0x3e5adc){var _0x1bfdd8=typeof _0x30bc4a[_0x93d9('0x1e')]===_0x93d9('0x1f')&&typeof _0x30bc4a[_0x93d9('0x20')]===_0x93d9('0x1f');var _0x291fab=_0x3e5adc[_0x93d9('0x21')];var _0x429e78=_0x1bfdd8?0x0:_0x30bc4a[_0x93d9('0x1e')];var _0x317369=_0x1bfdd8?_0x3e5adc[_0x93d9('0x21')]:_0x30bc4a[_0x93d9('0x1e')]+_0x30bc4a['limit'];var _0x5c2691;if(_0x317369>=_0x291fab){_0x317369=_0x291fab;_0x5c2691=0xc8;}else{_0x5c2691=0xce;}_0x4ccb7c['status'](_0x5c2691);return _0x4ccb7c[_0x93d9('0x22')](_0x93d9('0x23'),_0x429e78+'-'+_0x317369+'/'+_0x291fab)[_0x93d9('0x1d')](_0x3e5adc);}return null;};}function patchUpdates(_0x33769f){return function(_0x1af17b){try{jsonpatch['apply'](_0x1af17b,_0x33769f,!![]);}catch(_0x5c5910){return BPromise[_0x93d9('0x24')](_0x5c5910);}return _0x1af17b[_0x93d9('0x25')]();};}function saveUpdates(_0x396580,_0x5640c5){return function(_0x52f5fc){if(_0x52f5fc){return _0x52f5fc[_0x93d9('0x26')](_0x396580)[_0x93d9('0x27')](function(_0xa14842){return _0xa14842;});}return null;};}function removeEntity(_0x2c3f75,_0x4a811e){return function(_0x31f624){if(_0x31f624){return _0x31f624[_0x93d9('0x28')]()[_0x93d9('0x27')](function(){_0x2c3f75[_0x93d9('0x1b')](0xcc)[_0x93d9('0x1c')]();});}};}function handleEntityNotFound(_0x3d28e0,_0x4cdf5d){return function(_0x4e4997){if(!_0x4e4997){_0x3d28e0[_0x93d9('0x1a')](0x194);}return _0x4e4997;};}function handleError(_0xc5a9d9,_0x59bf95){_0x59bf95=_0x59bf95||0x1f4;return function(_0x34311e){logger['error'](_0x34311e[_0x93d9('0x29')]);if(_0x34311e[_0x93d9('0x2a')]){delete _0x34311e[_0x93d9('0x2a')];}_0xc5a9d9['status'](_0x59bf95)['send'](_0x34311e);};}exports[_0x93d9('0x2b')]=function(_0x5e1dbb,_0x435ad5){var _0x53df01={},_0xbd53b0={},_0x4d5d9e={'count':0x0,'rows':[]};var _0x217483=_['map'](db[_0x93d9('0x2c')][_0x93d9('0x2d')],function(_0x21a868){return{'name':_0x21a868[_0x93d9('0x2e')],'type':_0x21a868['type'][_0x93d9('0x2f')]};});_0xbd53b0[_0x93d9('0x30')]=_[_0x93d9('0x31')](_0x217483,'name');_0xbd53b0['query']=_[_0x93d9('0x32')](_0x5e1dbb['query']);_0xbd53b0[_0x93d9('0x33')]=_[_0x93d9('0x34')](_0xbd53b0[_0x93d9('0x30')],_0xbd53b0['query']);_0x53df01[_0x93d9('0x35')]=_[_0x93d9('0x34')](_0xbd53b0['model'],qs[_0x93d9('0x36')](_0x5e1dbb['query'][_0x93d9('0x36')]));_0x53df01[_0x93d9('0x35')]=_0x53df01[_0x93d9('0x35')][_0x93d9('0x37')]?_0x53df01[_0x93d9('0x35')]:_0xbd53b0['model'];if(!_0x5e1dbb[_0x93d9('0x38')][_0x93d9('0x39')](_0x93d9('0x3a'))){_0x53df01[_0x93d9('0x20')]=qs['limit'](_0x5e1dbb[_0x93d9('0x38')][_0x93d9('0x20')]);_0x53df01[_0x93d9('0x1e')]=qs[_0x93d9('0x1e')](_0x5e1dbb['query'][_0x93d9('0x1e')]);}_0x53df01[_0x93d9('0x3b')]=qs[_0x93d9('0x3c')](_0x5e1dbb[_0x93d9('0x38')][_0x93d9('0x3c')]);_0x53df01['where']=qs['filters'](_[_0x93d9('0x3d')](_0x5e1dbb[_0x93d9('0x38')],_0xbd53b0[_0x93d9('0x33')]),_0x217483);if(_0x5e1dbb[_0x93d9('0x38')][_0x93d9('0x3e')]){_0x53df01[_0x93d9('0x3f')]=_[_0x93d9('0x40')](_0x53df01[_0x93d9('0x3f')],{'$or':_[_0x93d9('0x31')](_0x217483,function(_0x5c91ab){if(_0x5c91ab[_0x93d9('0x41')]!==_0x93d9('0x42')){var _0x48d323={};_0x48d323[_0x5c91ab[_0x93d9('0x2a')]]={'$like':'%'+_0x5e1dbb[_0x93d9('0x38')][_0x93d9('0x3e')]+'%'};return _0x48d323;}})});}_0x53df01=_[_0x93d9('0x40')]({},_0x53df01,_0x5e1dbb[_0x93d9('0x43')]);var _0x3c10b5={'where':_0x53df01['where']};return db['MailTransferReport'][_0x93d9('0x21')](_0x3c10b5)[_0x93d9('0x27')](function(_0x2d0cf8){_0x4d5d9e[_0x93d9('0x21')]=_0x2d0cf8;if(_0x5e1dbb[_0x93d9('0x38')]['includeAll']){_0x53df01['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x93d9('0x44')](_0x53df01);})[_0x93d9('0x27')](function(_0x3e2fc4){_0x4d5d9e[_0x93d9('0x45')]=_0x3e2fc4;return _0x4d5d9e;})[_0x93d9('0x27')](respondWithFilteredResult(_0x435ad5,_0x53df01))[_0x93d9('0x46')](handleError(_0x435ad5,null));};exports[_0x93d9('0x47')]=function(_0x840b4,_0x4fa791){var _0x419266={'raw':!![],'where':{'id':_0x840b4[_0x93d9('0x48')]['id']}},_0x691d2e={};_0x691d2e[_0x93d9('0x30')]=_[_0x93d9('0x32')](db[_0x93d9('0x2c')][_0x93d9('0x2d')]);_0x691d2e['query']=_[_0x93d9('0x32')](_0x840b4['query']);_0x691d2e[_0x93d9('0x33')]=_[_0x93d9('0x34')](_0x691d2e[_0x93d9('0x30')],_0x691d2e[_0x93d9('0x38')]);_0x419266[_0x93d9('0x35')]=_[_0x93d9('0x34')](_0x691d2e['model'],qs[_0x93d9('0x36')](_0x840b4['query'][_0x93d9('0x36')]));_0x419266['attributes']=_0x419266[_0x93d9('0x35')][_0x93d9('0x37')]?_0x419266[_0x93d9('0x35')]:_0x691d2e['model'];if(_0x840b4[_0x93d9('0x38')]['includeAll']){_0x419266['include']=[{'all':!![]}];}_0x419266=_[_0x93d9('0x40')]({},_0x419266,_0x840b4[_0x93d9('0x43')]);return db[_0x93d9('0x2c')][_0x93d9('0x49')](_0x419266)[_0x93d9('0x27')](handleEntityNotFound(_0x4fa791,null))[_0x93d9('0x27')](respondWithResult(_0x4fa791,null))[_0x93d9('0x46')](handleError(_0x4fa791,null));};exports[_0x93d9('0x4a')]=function(_0x134c75,_0x25f203){return db['MailTransferReport'][_0x93d9('0x4a')](_0x134c75[_0x93d9('0x4b')],{})[_0x93d9('0x27')](respondWithResult(_0x25f203,0xc9))['catch'](handleError(_0x25f203,null));};exports[_0x93d9('0x26')]=function(_0x2e4d34,_0x7b75bb){if(_0x2e4d34[_0x93d9('0x4b')]['id']){delete _0x2e4d34['body']['id'];}return db[_0x93d9('0x2c')][_0x93d9('0x49')]({'where':{'id':_0x2e4d34[_0x93d9('0x48')]['id']}})[_0x93d9('0x27')](handleEntityNotFound(_0x7b75bb,null))[_0x93d9('0x27')](saveUpdates(_0x2e4d34[_0x93d9('0x4b')],null))[_0x93d9('0x27')](respondWithResult(_0x7b75bb,null))['catch'](handleError(_0x7b75bb,null));};exports['destroy']=function(_0x115ae8,_0x439aef){return db['MailTransferReport']['find']({'where':{'id':_0x115ae8['params']['id']}})['then'](handleEntityNotFound(_0x439aef,null))[_0x93d9('0x27')](removeEntity(_0x439aef,null))['catch'](handleError(_0x439aef,null));};exports[_0x93d9('0x4c')]=function(_0x4ab830,_0x3b25b7){return db['MailTransferReport'][_0x93d9('0x4c')]()[_0x93d9('0x27')](respondWithResult(_0x3b25b7,null))[_0x93d9('0x46')](handleError(_0x3b25b7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f06f27e..c37d7db 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 _0x25ad=['exports','define','MailTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x3d07b2,_0x37d831){var _0x258a04=function(_0x300ad6){while(--_0x300ad6){_0x3d07b2['push'](_0x3d07b2['shift']());}};_0x258a04(++_0x37d831);}(_0x25ad,0x1b1));var _0xd25a=function(_0x1d77b2,_0x3d03e4){_0x1d77b2=_0x1d77b2-0x0;var _0x3c3341=_0x25ad[_0x1d77b2];return _0x3c3341;};'use strict';var _=require(_0xd25a('0x0'));var util=require('util');var logger=require(_0xd25a('0x1'))(_0xd25a('0x2'));var moment=require(_0xd25a('0x3'));var BPromise=require('bluebird');var rp=require(_0xd25a('0x4'));var fs=require('fs');var path=require(_0xd25a('0x5'));var rimraf=require(_0xd25a('0x6'));var config=require(_0xd25a('0x7'));var attributes=require(_0xd25a('0x8'));module[_0xd25a('0x9')]=function(_0x544053,_0x4ca0db){return _0x544053[_0xd25a('0xa')](_0xd25a('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xd25a('0xc'),'fields':[_0xd25a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['bluebird','request-promise','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x8fb6dc,_0x3bfa9){var _0x1eebbd=function(_0xf87943){while(--_0xf87943){_0x8fb6dc['push'](_0x8fb6dc['shift']());}};_0x1eebbd(++_0x3bfa9);}(_0x867f,0x7f));var _0xf867=function(_0x1e2072,_0xe3cc90){_0x1e2072=_0x1e2072-0x0;var _0x22956b=_0x867f[_0x1e2072];return _0x22956b;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf867('0x7'));module[_0xf867('0x8')]=function(_0x33b5a7,_0x254e82){return _0x33b5a7['define'](_0xf867('0x9'),attributes,{'tableName':_0xf867('0xa'),'paranoid':![],'indexes':[{'name':_0xf867('0xb'),'fields':[_0xf867('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 63d8b09..daea34c 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 _0x1446=['jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4d121d,_0x7c2e24){var _0x255d8d=function(_0x1ce266){while(--_0x1ce266){_0x4d121d['push'](_0x4d121d['shift']());}};_0x255d8d(++_0x7c2e24);}(_0x1446,0x66));var _0x6144=function(_0x25c9a6,_0x220577){_0x25c9a6=_0x25c9a6-0x0;var _0x46475a=_0x1446[_0x25c9a6];return _0x46475a;};'use strict';var _=require(_0x6144('0x0'));var util=require('util');var moment=require(_0x6144('0x1'));var BPromise=require('bluebird');var rs=require(_0x6144('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6144('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6144('0x4'))('rpc');var config=require(_0x6144('0x5'));var jayson=require(_0x6144('0x6'));var client=jayson[_0x6144('0x7')][_0x6144('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7fc78b,_0x56eeab,_0x4d2139){return new BPromise(function(_0x2e9aee,_0x56212f){return client[_0x6144('0x9')](_0x7fc78b,_0x4d2139)['then'](function(_0x2d71cb){logger['info'](_0x6144('0xa'),_0x56eeab,_0x6144('0xb'));logger['debug'](_0x6144('0xc'),_0x56eeab,_0x6144('0xb'),JSON[_0x6144('0xd')](_0x2d71cb));if(_0x2d71cb[_0x6144('0xe')]){if(_0x2d71cb[_0x6144('0xe')][_0x6144('0xf')]===0x1f4){logger[_0x6144('0xe')](_0x6144('0xa'),_0x56eeab,_0x2d71cb['error'][_0x6144('0x10')]);return _0x56212f(_0x2d71cb[_0x6144('0xe')][_0x6144('0x10')]);}logger['error'](_0x6144('0xa'),_0x56eeab,_0x2d71cb['error']['message']);return _0x2e9aee(_0x2d71cb[_0x6144('0xe')][_0x6144('0x10')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x56eeab,_0x6144('0xb'));_0x2e9aee(_0x2d71cb['result'][_0x6144('0x10')]);}})[_0x6144('0x11')](function(_0x309887){logger['error'](_0x6144('0xa'),_0x56eeab,_0x309887);_0x56212f(_0x309887);});});} \ No newline at end of file +var _0x1a52=['request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x103538,_0x4a9156){var _0x48128a=function(_0x5773cc){while(--_0x5773cc){_0x103538['push'](_0x103538['shift']());}};_0x48128a(++_0x4a9156);}(_0x1a52,0x174));var _0x21a5=function(_0x1a6c38,_0x42a780){_0x1a6c38=_0x1a6c38-0x0;var _0x2bdeb8=_0x1a52[_0x1a6c38];return _0x2bdeb8;};'use strict';var _=require('lodash');var util=require(_0x21a5('0x0'));var moment=require(_0x21a5('0x1'));var BPromise=require(_0x21a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21a5('0x3'))['db'];var utils=require(_0x21a5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x21a5('0x5'));var jayson=require(_0x21a5('0x6'));var client=jayson['client'][_0x21a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x307443,_0x5947ca,_0x3d43dd){return new BPromise(function(_0x4abae5,_0x465fdc){return client[_0x21a5('0x8')](_0x307443,_0x3d43dd)['then'](function(_0x2a1ce2){logger[_0x21a5('0x9')](_0x21a5('0xa'),_0x5947ca,'request\x20sent');logger[_0x21a5('0xb')](_0x21a5('0xc'),_0x5947ca,_0x21a5('0xd'),JSON[_0x21a5('0xe')](_0x2a1ce2));if(_0x2a1ce2[_0x21a5('0xf')]){if(_0x2a1ce2['error'][_0x21a5('0x10')]===0x1f4){logger[_0x21a5('0xf')](_0x21a5('0xa'),_0x5947ca,_0x2a1ce2[_0x21a5('0xf')][_0x21a5('0x11')]);return _0x465fdc(_0x2a1ce2[_0x21a5('0xf')][_0x21a5('0x11')]);}logger[_0x21a5('0xf')](_0x21a5('0xa'),_0x5947ca,_0x2a1ce2[_0x21a5('0xf')]['message']);return _0x4abae5(_0x2a1ce2[_0x21a5('0xf')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x5947ca,_0x21a5('0xd'));_0x4abae5(_0x2a1ce2[_0x21a5('0x12')][_0x21a5('0x11')]);}})[_0x21a5('0x13')](function(_0x2d30ca){logger[_0x21a5('0xf')](_0x21a5('0xa'),_0x5947ca,_0x2d30ca);_0x465fdc(_0x2d30ca);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index c95b1a0..645de96 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 _0xd977=['Router','../../components/auth/service','./memberReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd977,0x164));var _0x7d97=function(_0x11978a,_0x1843c3){_0x11978a=_0x11978a-0x0;var _0x28c6e3=_0xd977[_0x11978a];return _0x28c6e3;};'use strict';var multer=require(_0x7d97('0x0'));var util=require(_0x7d97('0x1'));var path=require(_0x7d97('0x2'));var timeout=require(_0x7d97('0x3'));var express=require(_0x7d97('0x4'));var router=express[_0x7d97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7d97('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d97('0x7'));router[_0x7d97('0x8')]('/',auth[_0x7d97('0x9')](),controller['index']);router[_0x7d97('0x8')](_0x7d97('0xa'),auth[_0x7d97('0x9')](),controller['describe']);router[_0x7d97('0x8')](_0x7d97('0xb'),auth[_0x7d97('0x9')](),controller[_0x7d97('0xc')]);router[_0x7d97('0xd')]('/',auth['isAuthenticated'](),controller[_0x7d97('0xe')]);router[_0x7d97('0xf')]('/:id',auth[_0x7d97('0x9')](),controller[_0x7d97('0x10')]);router[_0x7d97('0x11')](_0x7d97('0xb'),auth[_0x7d97('0x9')](),controller['destroy']);module[_0x7d97('0x12')]=router; \ No newline at end of file +var _0x25ea=['put','update','delete','/:id','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','describe','isAuthenticated','show','post'];(function(_0x49cc18,_0x11cc73){var _0x5b8e1c=function(_0x46f3c6){while(--_0x46f3c6){_0x49cc18['push'](_0x49cc18['shift']());}};_0x5b8e1c(++_0x11cc73);}(_0x25ea,0xd6));var _0xa25e=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x25ea[_0x4ce028];return _0x583d0c;};'use strict';var multer=require('multer');var util=require(_0xa25e('0x0'));var path=require(_0xa25e('0x1'));var timeout=require(_0xa25e('0x2'));var express=require('express');var router=express[_0xa25e('0x3')]();var fs_extra=require(_0xa25e('0x4'));var auth=require(_0xa25e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa25e('0x6'));var controller=require(_0xa25e('0x7'));router[_0xa25e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa25e('0x8')](_0xa25e('0x9'),auth['isAuthenticated'](),controller[_0xa25e('0xa')]);router[_0xa25e('0x8')]('/:id',auth[_0xa25e('0xb')](),controller[_0xa25e('0xc')]);router[_0xa25e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa25e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa25e('0xf')]);router[_0xa25e('0x10')](_0xa25e('0x11'),auth[_0xa25e('0xb')](),controller[_0xa25e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 9afd23f..5654522 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 _0xde8d=['talk:[start]','talk:[dial\x20string]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','setDataValue','exitAt','duration'];(function(_0x1e7835,_0x2cf072){var _0x3ab333=function(_0x4609e1){while(--_0x4609e1){_0x1e7835['push'](_0x1e7835['shift']());}};_0x3ab333(++_0x2cf072);}(_0xde8d,0x1c3));var _0xdde8=function(_0x2fdc88,_0x2a42e4){_0x2fdc88=_0x2fdc88-0x0;var _0x3b80ed=_0xde8d[_0x2fdc88];return _0x3b80ed;};'use strict';var Sequelize=require(_0xdde8('0x0'));var moment=require(_0xdde8('0x1'));module[_0xdde8('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xdde8('0x3')]},'type':{'type':Sequelize[_0xdde8('0x3')],'defaultValue':_0xdde8('0x4'),'comment':_0xdde8('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xdde8('0x6')]},'exitAt':{'type':Sequelize[_0xdde8('0x6')],'set':function(_0x4d824f){var _0x53e51f=moment(_0x4d824f);var _0x149870=moment(this[_0xdde8('0x7')]('enterAt'));var _0x1afaf5=_0x53e51f['diff'](_0x149870,'seconds');this[_0xdde8('0x8')](_0xdde8('0x9'),_0x4d824f);this[_0xdde8('0x8')](_0xdde8('0xa'),_0x1afaf5>=0x0?_0x1afaf5:null);}},'data1':{'type':Sequelize[_0xdde8('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xdde8('0x3')],'comment':_0xdde8('0xb')},'data3':{'type':Sequelize[_0xdde8('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xdde8('0x3')],'comment':_0xdde8('0xc')},'data5':{'type':Sequelize[_0xdde8('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xdde8('0xd')]},'uniqueid':{'type':Sequelize[_0xdde8('0x3')]}}; \ No newline at end of file +var _0xf5df=['diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt'];(function(_0x34dd3b,_0x6a05b6){var _0x2590c2=function(_0x70174a){while(--_0x70174a){_0x34dd3b['push'](_0x34dd3b['shift']());}};_0x2590c2(++_0x6a05b6);}(_0xf5df,0xac));var _0xff5d=function(_0x3ff45a,_0x50443e){_0x3ff45a=_0x3ff45a-0x0;var _0x6dc03f=_0xf5df[_0x3ff45a];return _0x6dc03f;};'use strict';var Sequelize=require(_0xff5d('0x0'));var moment=require('moment');module[_0xff5d('0x1')]={'channel':{'type':Sequelize[_0xff5d('0x2')]},'membername':{'type':Sequelize[_0xff5d('0x2')]},'interface':{'type':Sequelize[_0xff5d('0x2')]},'type':{'type':Sequelize[_0xff5d('0x2')],'defaultValue':_0xff5d('0x3'),'comment':_0xff5d('0x4')},'duration':{'type':Sequelize[_0xff5d('0x5')]},'enterAt':{'type':Sequelize[_0xff5d('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4958b2){var _0x2c646f=moment(_0x4958b2);var _0x3dcd78=moment(this['getDataValue'](_0xff5d('0x7')));var _0x498aea=_0x2c646f[_0xff5d('0x8')](_0x3dcd78,'seconds');this[_0xff5d('0x9')](_0xff5d('0xa'),_0x4958b2);this[_0xff5d('0x9')]('duration',_0x498aea>=0x0?_0x498aea:null);}},'data1':{'type':Sequelize[_0xff5d('0x2')],'comment':_0xff5d('0xb')},'data2':{'type':Sequelize[_0xff5d('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xff5d('0x2')],'comment':_0xff5d('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0xff5d('0xd')},'data5':{'type':Sequelize[_0xff5d('0x2')],'comment':_0xff5d('0xe')},'role':{'type':Sequelize[_0xff5d('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xff5d('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 37b8bc7..d0addf1 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x5ad18c,_0x340ac2){var _0x23d3bb=function(_0x209b82){while(--_0x209b82){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x23d3bb(++_0x340ac2);}(_0x008c,0x188));var _0xc008=function(_0xc8023,_0xd1912){_0xc8023=_0xc8023-0x0;var _0x448b50=_0x008c[_0xc8023];return _0x448b50;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x1fd676,_0x32bf62){var _0x1dd16e=function(_0x58ba4d){while(--_0x58ba4d){_0x1fd676['push'](_0x1fd676['shift']());}};_0x1dd16e(++_0x32bf62);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 422a8a9..c02d0c1 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 _0xdd1b=['exports','define','membername_interface','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xdd1b,0x1e7));var _0xbdd1=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0xdd1b[_0x8b631b];return _0x3e6832;};'use strict';var _=require('lodash');var util=require(_0xbdd1('0x0'));var logger=require(_0xbdd1('0x1'))('api');var moment=require(_0xbdd1('0x2'));var BPromise=require('bluebird');var rp=require(_0xbdd1('0x3'));var fs=require('fs');var path=require(_0xbdd1('0x4'));var rimraf=require(_0xbdd1('0x5'));var config=require(_0xbdd1('0x6'));var attributes=require(_0xbdd1('0x7'));module[_0xbdd1('0x8')]=function(_0x3693c2,_0x4cfda9){return _0x3693c2[_0xbdd1('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xbdd1('0xa'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a72=['request-promise','path','rimraf','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x5b9259,_0x198473){var _0x5bbf28=function(_0x392f8e){while(--_0x392f8e){_0x5b9259['push'](_0x5b9259['shift']());}};_0x5bbf28(++_0x198473);}(_0x7a72,0xbe));var _0x27a7=function(_0x297aa3,_0x38c8ba){_0x297aa3=_0x297aa3-0x0;var _0xe70969=_0x7a72[_0x297aa3];return _0xe70969;};'use strict';var _=require('lodash');var util=require(_0x27a7('0x0'));var logger=require(_0x27a7('0x1'))(_0x27a7('0x2'));var moment=require(_0x27a7('0x3'));var BPromise=require(_0x27a7('0x4'));var rp=require(_0x27a7('0x5'));var fs=require('fs');var path=require(_0x27a7('0x6'));var rimraf=require(_0x27a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x27a7('0x8'));module[_0x27a7('0x9')]=function(_0x4dd47c,_0x375c82){return _0x4dd47c[_0x27a7('0xa')](_0x27a7('0xb'),attributes,{'tableName':_0x27a7('0xc'),'paranoid':![],'indexes':[{'name':_0x27a7('0xd'),'fields':['membername',_0x27a7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index e8633c1..ba470e2 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 _0xe14a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','create','body','CreateMemberReport','UpdateMemberReport','update'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0xe14a,0x94));var _0xae14=function(_0x7b9023,_0x3cbed9){_0x7b9023=_0x7b9023-0x0;var _0x174fe0=_0xe14a[_0x7b9023];return _0x174fe0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae14('0x0'));var db=require(_0xae14('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xae14('0x2'))(_0xae14('0x3'));var config=require(_0xae14('0x4'));var jayson=require(_0xae14('0x5'));var client=jayson[_0xae14('0x6')][_0xae14('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbdeb24,_0x1aef6a,_0x19d9b8){return new BPromise(function(_0x1efd2c,_0x103029){return client[_0xae14('0x8')](_0xbdeb24,_0x19d9b8)[_0xae14('0x9')](function(_0x53f6f5){logger['info'](_0xae14('0xa'),_0x1aef6a,_0xae14('0xb'));logger[_0xae14('0xc')](_0xae14('0xd'),_0x1aef6a,_0xae14('0xb'),JSON['stringify'](_0x53f6f5));if(_0x53f6f5['error']){if(_0x53f6f5[_0xae14('0xe')][_0xae14('0xf')]===0x1f4){logger[_0xae14('0xe')](_0xae14('0xa'),_0x1aef6a,_0x53f6f5[_0xae14('0xe')][_0xae14('0x10')]);return _0x103029(_0x53f6f5[_0xae14('0xe')][_0xae14('0x10')]);}logger[_0xae14('0xe')](_0xae14('0xa'),_0x1aef6a,_0x53f6f5['error'][_0xae14('0x10')]);return _0x1efd2c(_0x53f6f5[_0xae14('0xe')]['message']);}else{logger[_0xae14('0x11')](_0xae14('0xa'),_0x1aef6a,_0xae14('0xb'));_0x1efd2c(_0x53f6f5[_0xae14('0x12')][_0xae14('0x10')]);}})['catch'](function(_0x5c7cf7){logger[_0xae14('0xe')](_0xae14('0xa'),_0x1aef6a,_0x5c7cf7);_0x103029(_0x5c7cf7);});});}exports[_0xae14('0x13')]=function(_0x4913e7){var _0x5726f7=this;return new Promise(function(_0x1ecd0f,_0x3621a6){return db[_0xae14('0x14')][_0xae14('0x15')]({'raw':_0x4913e7[_0xae14('0x16')]?_0x4913e7[_0xae14('0x16')][_0xae14('0x17')]===undefined?!![]:![]:!![],'where':_0x4913e7[_0xae14('0x16')]?_0x4913e7['options'][_0xae14('0x18')]||null:null,'attributes':_0x4913e7[_0xae14('0x16')]?_0x4913e7[_0xae14('0x16')][_0xae14('0x19')]||null:null,'limit':_0x4913e7[_0xae14('0x16')]?_0x4913e7[_0xae14('0x16')][_0xae14('0x1a')]||null:null,'include':_0x4913e7['options']?_0x4913e7[_0xae14('0x16')][_0xae14('0x1b')]?_[_0xae14('0x1c')](_0x4913e7[_0xae14('0x16')][_0xae14('0x1b')],function(_0x33885f){return{'model':db[_0x33885f['model']],'as':_0x33885f['as'],'attributes':_0x33885f['attributes'],'include':_0x33885f['include']?_[_0xae14('0x1c')](_0x33885f[_0xae14('0x1b')],function(_0x32893e){return{'model':db[_0x32893e[_0xae14('0x1d')]],'as':_0x32893e['as'],'attributes':_0x32893e[_0xae14('0x19')],'include':_0x32893e[_0xae14('0x1b')]?_[_0xae14('0x1c')](_0x32893e[_0xae14('0x1b')],function(_0x30c9f1){return{'model':db[_0x30c9f1[_0xae14('0x1d')]],'as':_0x30c9f1['as'],'attributes':_0x30c9f1[_0xae14('0x19')]};}):[]};}):[]};}):[]:[]})[_0xae14('0x9')](function(_0x540956){logger[_0xae14('0x11')](_0xae14('0x13'),_0x4913e7);logger[_0xae14('0xc')](_0xae14('0x13'),_0x4913e7,JSON[_0xae14('0x1e')](_0x540956));_0x1ecd0f(_0x540956);})[_0xae14('0x1f')](function(_0x1da1db){logger['error'](_0xae14('0x13'),_0x1da1db[_0xae14('0x10')],_0x4913e7);_0x3621a6(_0x5726f7[_0xae14('0xe')](0x1f4,_0x1da1db['message']));});});};exports['CreateMemberReport']=function(_0x2439d3){var _0x35ae08=this;return new Promise(function(_0x23e3ee,_0x2251da){return db['MemberReport'][_0xae14('0x20')](_0x2439d3[_0xae14('0x21')],{'raw':_0x2439d3[_0xae14('0x16')]?_0x2439d3['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1553e1){logger[_0xae14('0x11')](_0xae14('0x22'),_0x2439d3);logger['debug'](_0xae14('0x22'),_0x2439d3,JSON[_0xae14('0x1e')](_0x1553e1));_0x23e3ee(_0x1553e1);})[_0xae14('0x1f')](function(_0x4a1d9d){logger[_0xae14('0xe')](_0xae14('0x22'),_0x4a1d9d['message'],_0x2439d3);_0x2251da(_0x35ae08[_0xae14('0xe')](0x1f4,_0x4a1d9d[_0xae14('0x10')]));});});};exports[_0xae14('0x23')]=function(_0x1be576){var _0x4da9a4=this;return new Promise(function(_0x73d7ec,_0xc8d4ca){return db['MemberReport'][_0xae14('0x24')](_0x1be576[_0xae14('0x21')],{'raw':_0x1be576['options']?_0x1be576['options'][_0xae14('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1be576['options']?_0x1be576[_0xae14('0x16')][_0xae14('0x18')]||null:null,'attributes':_0x1be576[_0xae14('0x16')]?_0x1be576['options'][_0xae14('0x19')]||null:null,'limit':_0x1be576[_0xae14('0x16')]?_0x1be576[_0xae14('0x16')][_0xae14('0x1a')]||null:null})[_0xae14('0x9')](function(_0x7d969){logger[_0xae14('0x11')]('UpdateMemberReport',_0x1be576);logger[_0xae14('0xc')](_0xae14('0x23'),_0x1be576,JSON[_0xae14('0x1e')](_0x7d969));_0x73d7ec(_0x7d969);})[_0xae14('0x1f')](function(_0x1b4383){logger[_0xae14('0xe')](_0xae14('0x23'),_0x1b4383[_0xae14('0x10')],_0x1be576);_0xc8d4ca(_0x4da9a4[_0xae14('0xe')](0x1f4,_0x1b4383[_0xae14('0x10')]));});});}; \ No newline at end of file +var _0xbf07=['stringify','error','code','message','catch','MemberReport','findAll','options','raw','where','attributes','include','model','map','GetMemberReport','CreateMemberReport','body','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','request','then','info','MemberReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf07,0x77));var _0x7bf0=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xbf07[_0x454018];return _0x24697d;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var moment=require(_0x7bf0('0x2'));var BPromise=require(_0x7bf0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf0('0x4'));var db=require(_0x7bf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7bf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44f656,_0x50e680,_0x263964){return new BPromise(function(_0x536214,_0x415291){return client[_0x7bf0('0x7')](_0x44f656,_0x263964)[_0x7bf0('0x8')](function(_0x2565c7){logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,'request\x20sent');logger[_0x7bf0('0xb')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x50e680,_0x7bf0('0xc'),JSON[_0x7bf0('0xd')](_0x2565c7));if(_0x2565c7[_0x7bf0('0xe')]){if(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0xf')]===0x1f4){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x415291(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x536214(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}else{logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,_0x7bf0('0xc'));_0x536214(_0x2565c7['result'][_0x7bf0('0x10')]);}})[_0x7bf0('0x11')](function(_0x187489){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x187489);_0x415291(_0x187489);});});}exports['GetMemberReport']=function(_0x254dc8){var _0x3a1c6e=this;return new Promise(function(_0x2a99fe,_0x117342){return db[_0x7bf0('0x12')][_0x7bf0('0x13')]({'raw':_0x254dc8[_0x7bf0('0x14')]?_0x254dc8[_0x7bf0('0x14')][_0x7bf0('0x15')]===undefined?!![]:![]:!![],'where':_0x254dc8[_0x7bf0('0x14')]?_0x254dc8['options'][_0x7bf0('0x16')]||null:null,'attributes':_0x254dc8[_0x7bf0('0x14')]?_0x254dc8[_0x7bf0('0x14')][_0x7bf0('0x17')]||null:null,'limit':_0x254dc8[_0x7bf0('0x14')]?_0x254dc8[_0x7bf0('0x14')]['limit']||null:null,'include':_0x254dc8['options']?_0x254dc8[_0x7bf0('0x14')][_0x7bf0('0x18')]?_['map'](_0x254dc8[_0x7bf0('0x14')]['include'],function(_0x157e0f){return{'model':db[_0x157e0f[_0x7bf0('0x19')]],'as':_0x157e0f['as'],'attributes':_0x157e0f[_0x7bf0('0x17')],'include':_0x157e0f[_0x7bf0('0x18')]?_[_0x7bf0('0x1a')](_0x157e0f[_0x7bf0('0x18')],function(_0x2e4994){return{'model':db[_0x2e4994[_0x7bf0('0x19')]],'as':_0x2e4994['as'],'attributes':_0x2e4994[_0x7bf0('0x17')],'include':_0x2e4994[_0x7bf0('0x18')]?_[_0x7bf0('0x1a')](_0x2e4994['include'],function(_0x366c54){return{'model':db[_0x366c54[_0x7bf0('0x19')]],'as':_0x366c54['as'],'attributes':_0x366c54[_0x7bf0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7bf0('0x8')](function(_0x2ba0a3){logger['info'](_0x7bf0('0x1b'),_0x254dc8);logger[_0x7bf0('0xb')]('GetMemberReport',_0x254dc8,JSON[_0x7bf0('0xd')](_0x2ba0a3));_0x2a99fe(_0x2ba0a3);})['catch'](function(_0x1393f7){logger[_0x7bf0('0xe')](_0x7bf0('0x1b'),_0x1393f7['message'],_0x254dc8);_0x117342(_0x3a1c6e[_0x7bf0('0xe')](0x1f4,_0x1393f7[_0x7bf0('0x10')]));});});};exports[_0x7bf0('0x1c')]=function(_0x5ad9c9){var _0x371611=this;return new Promise(function(_0x318c1f,_0x116b32){return db[_0x7bf0('0x12')]['create'](_0x5ad9c9[_0x7bf0('0x1d')],{'raw':_0x5ad9c9[_0x7bf0('0x14')]?_0x5ad9c9[_0x7bf0('0x14')][_0x7bf0('0x15')]===undefined?!![]:![]:!![]})[_0x7bf0('0x8')](function(_0x4eac51){logger[_0x7bf0('0x9')](_0x7bf0('0x1c'),_0x5ad9c9);logger['debug'](_0x7bf0('0x1c'),_0x5ad9c9,JSON[_0x7bf0('0xd')](_0x4eac51));_0x318c1f(_0x4eac51);})['catch'](function(_0x4227ec){logger[_0x7bf0('0xe')](_0x7bf0('0x1c'),_0x4227ec[_0x7bf0('0x10')],_0x5ad9c9);_0x116b32(_0x371611[_0x7bf0('0xe')](0x1f4,_0x4227ec[_0x7bf0('0x10')]));});});};exports[_0x7bf0('0x1e')]=function(_0x36b25f){var _0x14e678=this;return new Promise(function(_0x2b94dd,_0x458142){return db[_0x7bf0('0x12')][_0x7bf0('0x1f')](_0x36b25f[_0x7bf0('0x1d')],{'raw':_0x36b25f[_0x7bf0('0x14')]?_0x36b25f['options'][_0x7bf0('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b25f[_0x7bf0('0x14')]?_0x36b25f[_0x7bf0('0x14')][_0x7bf0('0x16')]||null:null,'attributes':_0x36b25f[_0x7bf0('0x14')]?_0x36b25f['options'][_0x7bf0('0x17')]||null:null,'limit':_0x36b25f[_0x7bf0('0x14')]?_0x36b25f['options'][_0x7bf0('0x20')]||null:null})['then'](function(_0x426466){logger[_0x7bf0('0x9')](_0x7bf0('0x1e'),_0x36b25f);logger[_0x7bf0('0xb')](_0x7bf0('0x1e'),_0x36b25f,JSON[_0x7bf0('0xd')](_0x426466));_0x2b94dd(_0x426466);})[_0x7bf0('0x11')](function(_0x5ddede){logger['error'](_0x7bf0('0x1e'),_0x5ddede[_0x7bf0('0x10')],_0x36b25f);_0x458142(_0x14e678[_0x7bf0('0xe')](0x1f4,_0x5ddede['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3616697..f117e82 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 _0xa555=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','multer','util'];(function(_0xa936ca,_0x40459c){var _0x1fb9ad=function(_0x45a46d){while(--_0x45a46d){_0xa936ca['push'](_0xa936ca['shift']());}};_0x1fb9ad(++_0x40459c);}(_0xa555,0x139));var _0x5a55=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0xa555[_0x1f1a97];return _0x29fc6a;};'use strict';var multer=require(_0x5a55('0x0'));var util=require(_0x5a55('0x1'));var path=require('path');var timeout=require(_0x5a55('0x2'));var express=require('express');var router=express[_0x5a55('0x3')]();var fs_extra=require(_0x5a55('0x4'));var auth=require(_0x5a55('0x5'));var interaction=require(_0x5a55('0x6'));var config=require(_0x5a55('0x7'));var controller=require('./migration.controller');router[_0x5a55('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0xd2df=['connect-timeout','express','../../components/interaction/service','../../config/environment','./migration.controller','multer','util','path'];(function(_0x5e4866,_0x1f1101){var _0x38b84e=function(_0x4e1864){while(--_0x4e1864){_0x5e4866['push'](_0x5e4866['shift']());}};_0x38b84e(++_0x1f1101);}(_0xd2df,0x175));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var path=require(_0xfd2d('0x2'));var timeout=require(_0xfd2d('0x3'));var express=require(_0xfd2d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd2d('0x5'));var config=require(_0xfd2d('0x6'));var controller=require(_0xfd2d('0x7'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 74475a9..4410e11 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 _0x2ca3=['sequelize','exports'];(function(_0x25919a,_0x54a984){var _0x4837cc=function(_0x418fa1){while(--_0x418fa1){_0x25919a['push'](_0x25919a['shift']());}};_0x4837cc(++_0x54a984);}(_0x2ca3,0x1e8));var _0x32ca=function(_0x46e34f,_0x14a1dc){_0x46e34f=_0x46e34f-0x0;var _0x1bcd47=_0x2ca3[_0x46e34f];return _0x1bcd47;};'use strict';var Sequelize=require(_0x32ca('0x0'));module[_0x32ca('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0xdf9a=['exports','STRING','sequelize'];(function(_0x1509f7,_0x2fc1d2){var _0x3211a0=function(_0x204f7d){while(--_0x204f7d){_0x1509f7['push'](_0x1509f7['shift']());}};_0x3211a0(++_0x2fc1d2);}(_0xdf9a,0x131));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xadf9('0x0'));module[_0xadf9('0x1')]={'version':{'type':Sequelize[_0xadf9('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cee4292..67e8c2f 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 _0x90fd=['moment','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','eml-format','fast-json-patch','request-promise'];(function(_0x273fc5,_0x8635d5){var _0xc0bfc2=function(_0x275d2a){while(--_0x275d2a){_0x273fc5['push'](_0x273fc5['shift']());}};_0xc0bfc2(++_0x8635d5);}(_0x90fd,0x115));var _0xd90f=function(_0x8b8db0,_0x303399){_0x8b8db0=_0x8b8db0-0x0;var _0x1e01ab=_0x90fd[_0x8b8db0];return _0x1e01ab;};'use strict';var emlformat=require(_0xd90f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd90f('0x1'));var rp=require(_0xd90f('0x2'));var moment=require(_0xd90f('0x3'));var BPromise=require(_0xd90f('0x4'));var Mustache=require(_0xd90f('0x5'));var util=require(_0xd90f('0x6'));var path=require(_0xd90f('0x7'));var sox=require(_0xd90f('0x8'));var csv=require(_0xd90f('0x9'));var ejs=require(_0xd90f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd90f('0xb'));var squel=require(_0xd90f('0xc'));var crypto=require(_0xd90f('0xd'));var jsforce=require(_0xd90f('0xe'));var deskjs=require(_0xd90f('0xf'));var toCsv=require(_0xd90f('0x9'));var querystring=require(_0xd90f('0x10'));var Papa=require(_0xd90f('0x11'));var Redis=require(_0xd90f('0x12'));var authService=require(_0xd90f('0x13'));var qs=require(_0xd90f('0x14'));var as=require(_0xd90f('0x15'));var hardwareService=require(_0xd90f('0x16'));var logger=require('../../config/logger')(_0xd90f('0x17'));var utils=require(_0xd90f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd90f('0x19'));var db=require(_0xd90f('0x1a'))['db'];function respondWithStatusCode(_0x2a8348,_0xf7cc39){_0xf7cc39=_0xf7cc39||0xcc;return function(_0x3255c3){if(_0x3255c3){return _0x2a8348['sendStatus'](_0xf7cc39);}return _0x2a8348[_0xd90f('0x1b')](_0xf7cc39)[_0xd90f('0x1c')]();};}function respondWithResult(_0x3a8ce2,_0x30e0ac){_0x30e0ac=_0x30e0ac||0xc8;return function(_0x191edf){if(_0x191edf){return _0x3a8ce2[_0xd90f('0x1b')](_0x30e0ac)[_0xd90f('0x1d')](_0x191edf);}};}function respondWithFilteredResult(_0x37a1ea,_0x9e6873){return function(_0x1c2cca){if(_0x1c2cca){var _0x162340=typeof _0x9e6873[_0xd90f('0x1e')]===_0xd90f('0x1f')&&typeof _0x9e6873[_0xd90f('0x20')]===_0xd90f('0x1f');var _0xb03452=_0x1c2cca[_0xd90f('0x21')];var _0x3e9db7=_0x162340?0x0:_0x9e6873[_0xd90f('0x1e')];var _0x1f39d7=_0x162340?_0x1c2cca[_0xd90f('0x21')]:_0x9e6873['offset']+_0x9e6873[_0xd90f('0x20')];var _0xc80694;if(_0x1f39d7>=_0xb03452){_0x1f39d7=_0xb03452;_0xc80694=0xc8;}else{_0xc80694=0xce;}_0x37a1ea[_0xd90f('0x1b')](_0xc80694);return _0x37a1ea[_0xd90f('0x22')](_0xd90f('0x23'),_0x3e9db7+'-'+_0x1f39d7+'/'+_0xb03452)[_0xd90f('0x1d')](_0x1c2cca);}return null;};}function patchUpdates(_0x4146b0){return function(_0x411914){try{jsonpatch['apply'](_0x411914,_0x4146b0,!![]);}catch(_0x31ea72){return BPromise[_0xd90f('0x24')](_0x31ea72);}return _0x411914['save']();};}function saveUpdates(_0x19fe58,_0x50e080){return function(_0x586661){if(_0x586661){return _0x586661['update'](_0x19fe58)[_0xd90f('0x25')](function(_0x31c83a){return _0x31c83a;});}return null;};}function removeEntity(_0x4780c2,_0xdb2a89){return function(_0x365fd3){if(_0x365fd3){return _0x365fd3[_0xd90f('0x26')]()['then'](function(){_0x4780c2[_0xd90f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe50530,_0x5f3ca0){return function(_0x38fe2b){if(!_0x38fe2b){_0xe50530[_0xd90f('0x27')](0x194);}return _0x38fe2b;};}function handleError(_0x31ef01,_0x219f3e){_0x219f3e=_0x219f3e||0x1f4;return function(_0x24d838){logger[_0xd90f('0x28')](_0x24d838[_0xd90f('0x29')]);if(_0x24d838[_0xd90f('0x2a')]){delete _0x24d838[_0xd90f('0x2a')];}_0x31ef01['status'](_0x219f3e)[_0xd90f('0x2b')](_0x24d838);};}exports[_0xd90f('0x2c')]=function(_0x4c65ab,_0x59a221){var _0xd635d9={},_0x19ceb3={},_0x9c8711={'count':0x0,'rows':[]};var _0x32ff8e=_[_0xd90f('0x2d')](db[_0xd90f('0x2e')][_0xd90f('0x2f')],function(_0x37bc67){return{'name':_0x37bc67[_0xd90f('0x30')],'type':_0x37bc67[_0xd90f('0x31')][_0xd90f('0x32')]};});_0x19ceb3[_0xd90f('0x33')]=_[_0xd90f('0x2d')](_0x32ff8e,'name');_0x19ceb3[_0xd90f('0x34')]=_[_0xd90f('0x35')](_0x4c65ab[_0xd90f('0x34')]);_0x19ceb3['filters']=_[_0xd90f('0x36')](_0x19ceb3['model'],_0x19ceb3[_0xd90f('0x34')]);_0xd635d9[_0xd90f('0x37')]=_['intersection'](_0x19ceb3[_0xd90f('0x33')],qs[_0xd90f('0x38')](_0x4c65ab['query'][_0xd90f('0x38')]));_0xd635d9[_0xd90f('0x37')]=_0xd635d9['attributes'][_0xd90f('0x39')]?_0xd635d9['attributes']:_0x19ceb3[_0xd90f('0x33')];if(!_0x4c65ab[_0xd90f('0x34')]['hasOwnProperty'](_0xd90f('0x3a'))){_0xd635d9[_0xd90f('0x20')]=qs[_0xd90f('0x20')](_0x4c65ab['query']['limit']);_0xd635d9[_0xd90f('0x1e')]=qs['offset'](_0x4c65ab[_0xd90f('0x34')][_0xd90f('0x1e')]);}_0xd635d9[_0xd90f('0x3b')]=qs['sort'](_0x4c65ab[_0xd90f('0x34')][_0xd90f('0x3c')]);_0xd635d9['where']=qs[_0xd90f('0x3d')](_['pick'](_0x4c65ab[_0xd90f('0x34')],_0x19ceb3[_0xd90f('0x3d')]),_0x32ff8e);if(_0x4c65ab[_0xd90f('0x34')][_0xd90f('0x3e')]){_0xd635d9[_0xd90f('0x3f')]=_[_0xd90f('0x40')](_0xd635d9[_0xd90f('0x3f')],{'$or':_[_0xd90f('0x2d')](_0x32ff8e,function(_0x4eee7a){if(_0x4eee7a[_0xd90f('0x31')]!==_0xd90f('0x41')){var _0x5b64f8={};_0x5b64f8[_0x4eee7a['name']]={'$like':'%'+_0x4c65ab[_0xd90f('0x34')][_0xd90f('0x3e')]+'%'};return _0x5b64f8;}})});}_0xd635d9=_[_0xd90f('0x40')]({},_0xd635d9,_0x4c65ab[_0xd90f('0x42')]);var _0x2c73df={'where':_0xd635d9['where']};return db[_0xd90f('0x2e')][_0xd90f('0x21')](_0x2c73df)[_0xd90f('0x25')](function(_0x5dba7b){_0x9c8711[_0xd90f('0x21')]=_0x5dba7b;if(_0x4c65ab[_0xd90f('0x34')][_0xd90f('0x43')]){_0xd635d9[_0xd90f('0x44')]=[{'all':!![]}];}return db['Migration']['findAll'](_0xd635d9);})[_0xd90f('0x25')](function(_0x2f1c7e){_0x9c8711[_0xd90f('0x45')]=_0x2f1c7e;return _0x9c8711;})['then'](respondWithFilteredResult(_0x59a221,_0xd635d9))['catch'](handleError(_0x59a221,null));}; \ No newline at end of file +var _0x2eb2=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','Migration'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x2eb2[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x26')](_0x1599c7,'name');_0x44cf91[_0x22eb('0x2c')]=_[_0x22eb('0x2d')](_0x49dd59[_0x22eb('0x2c')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x44cf91[_0x22eb('0x30')],_0x44cf91[_0x22eb('0x2c')]);_0x25e5bc[_0x22eb('0x31')]=_[_0x22eb('0x2f')](_0x44cf91[_0x22eb('0x30')],qs['fields'](_0x49dd59['query'][_0x22eb('0x32')]));_0x25e5bc['attributes']=_0x25e5bc['attributes'][_0x22eb('0x33')]?_0x25e5bc[_0x22eb('0x31')]:_0x44cf91[_0x22eb('0x30')];if(!_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x34')](_0x22eb('0x35'))){_0x25e5bc[_0x22eb('0x36')]=qs[_0x22eb('0x36')](_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x36')]);_0x25e5bc['offset']=qs[_0x22eb('0x19')](_0x49dd59['query']['offset']);}_0x25e5bc[_0x22eb('0x37')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc[_0x22eb('0x39')]=qs[_0x22eb('0x2e')](_[_0x22eb('0x3a')](_0x49dd59[_0x22eb('0x2c')],_0x44cf91['filters']),_0x1599c7);if(_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x3b')]){_0x25e5bc['where']=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x39')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x2cc77c){if(_0x2cc77c[_0x22eb('0x2a')]!=='VIRTUAL'){var _0x51c8b5={};_0x51c8b5[_0x2cc77c[_0x22eb('0x24')]]={'$like':'%'+_0x49dd59[_0x22eb('0x2c')]['filter']+'%'};return _0x51c8b5;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59[_0x22eb('0x3d')]);var _0x46c6a1={'where':_0x25e5bc['where']};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x46c6a1)[_0x22eb('0x20')](function(_0x2a8517){_0x7c0119[_0x22eb('0x1b')]=_0x2a8517;if(_0x49dd59[_0x22eb('0x2c')]['includeAll']){_0x25e5bc[_0x22eb('0x3e')]=[{'all':!![]}];}return db[_0x22eb('0x27')]['findAll'](_0x25e5bc);})[_0x22eb('0x20')](function(_0x44d39f){_0x7c0119[_0x22eb('0x3f')]=_0x44d39f;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x40')](handleError(_0x2a950e,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 3bd3919..087d270 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 _0x3948=['moment','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x3f4a5b,_0x1fd470){var _0x54296b=function(_0x458a81){while(--_0x458a81){_0x3f4a5b['push'](_0x3f4a5b['shift']());}};_0x54296b(++_0x1fd470);}(_0x3948,0x99));var _0x8394=function(_0x189728,_0x47a742){_0x189728=_0x189728-0x0;var _0x32174e=_0x3948[_0x189728];return _0x32174e;};'use strict';var _=require(_0x8394('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8394('0x1'));var BPromise=require(_0x8394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8394('0x3'));var rimraf=require(_0x8394('0x4'));var config=require(_0x8394('0x5'));var attributes=require(_0x8394('0x6'));module[_0x8394('0x7')]=function(_0x300e62,_0x2cb6d1){return _0x300e62[_0x8394('0x8')](_0x8394('0x9'),attributes,{'tableName':_0x8394('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99ad=['bluebird','request-promise','path','rimraf','./migration.attributes','migrations','lodash','../../config/logger','moment'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x99ad,0x96));var _0xd99a=function(_0x3ef22a,_0x104ebf){_0x3ef22a=_0x3ef22a-0x0;var _0x484dd0=_0x99ad[_0x3ef22a];return _0x484dd0;};'use strict';var _=require(_0xd99a('0x0'));var util=require('util');var logger=require(_0xd99a('0x1'))('api');var moment=require(_0xd99a('0x2'));var BPromise=require(_0xd99a('0x3'));var rp=require(_0xd99a('0x4'));var fs=require('fs');var path=require(_0xd99a('0x5'));var rimraf=require(_0xd99a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd99a('0x7'));module['exports']=function(_0x500cfb,_0x1cc085){return _0x500cfb['define']('Migration',attributes,{'tableName':_0xd99a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 9cf473e..ffd344e 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Migration,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x300349,_0x59461f){var _0x5f54d2=function(_0x30df66){while(--_0x30df66){_0x300349['push'](_0x300349['shift']());}};_0x5f54d2(++_0x59461f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x532407,_0x25ec94){_0x532407=_0x532407-0x0;var _0x29af88=_0xb43b[_0x532407];return _0x29af88;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Migration,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Migration,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Migration,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0x5bc5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5bc5,0xb2));var _0x55bc=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x5bc5[_0x320b8e];return _0x55a10a;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var moment=require(_0x55bc('0x2'));var BPromise=require(_0x55bc('0x3'));var rs=require(_0x55bc('0x4'));var fs=require('fs');var Redis=require(_0x55bc('0x5'));var db=require(_0x55bc('0x6'))['db'];var utils=require(_0x55bc('0x7'));var logger=require(_0x55bc('0x8'))(_0x55bc('0x9'));var config=require(_0x55bc('0xa'));var jayson=require(_0x55bc('0xb'));var client=jayson[_0x55bc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d78d6,_0x5719c9,_0x2a612b){return new BPromise(function(_0x38839e,_0x4d0610){return client[_0x55bc('0xd')](_0x4d78d6,_0x2a612b)[_0x55bc('0xe')](function(_0xc535ac){logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,_0x55bc('0x11'));logger[_0x55bc('0x12')](_0x55bc('0x13'),_0x5719c9,'request\x20sent',JSON[_0x55bc('0x14')](_0xc535ac));if(_0xc535ac[_0x55bc('0x15')]){if(_0xc535ac[_0x55bc('0x15')]['code']===0x1f4){logger[_0x55bc('0x15')]('Migration,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x4d0610(_0xc535ac[_0x55bc('0x15')]['message']);}logger[_0x55bc('0x15')]('Migration,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x38839e(_0xc535ac[_0x55bc('0x15')]['message']);}else{logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,'request\x20sent');_0x38839e(_0xc535ac['result'][_0x55bc('0x16')]);}})['catch'](function(_0x482eea){logger[_0x55bc('0x15')](_0x55bc('0x10'),_0x5719c9,_0x482eea);_0x4d0610(_0x482eea);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3886c22..d0d4d53 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 _0x22c9=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show'];(function(_0x22a524,_0x32c0d0){var _0x2ebb53=function(_0x4899a6){while(--_0x4899a6){_0x22a524['push'](_0x22a524['shift']());}};_0x2ebb53(++_0x32c0d0);}(_0x22c9,0x151));var _0x922c=function(_0x2356e3,_0x3c1521){_0x2356e3=_0x2356e3-0x0;var _0x12e9f7=_0x22c9[_0x2356e3];return _0x12e9f7;};'use strict';var multer=require(_0x922c('0x0'));var util=require(_0x922c('0x1'));var path=require(_0x922c('0x2'));var timeout=require(_0x922c('0x3'));var express=require('express');var router=express[_0x922c('0x4')]();var fs_extra=require(_0x922c('0x5'));var auth=require(_0x922c('0x6'));var interaction=require(_0x922c('0x7'));var config=require(_0x922c('0x8'));var controller=require(_0x922c('0x9'));router[_0x922c('0xa')]('/',auth['isAuthenticated'](),controller[_0x922c('0xb')]);router[_0x922c('0xa')](_0x922c('0xc'),auth[_0x922c('0xd')](),controller[_0x922c('0xe')]);router[_0x922c('0xf')]('/',auth[_0x922c('0xd')](),controller[_0x922c('0x10')]);router[_0x922c('0x11')](_0x922c('0xc'),auth['isAuthenticated'](),controller[_0x922c('0x12')]);router[_0x922c('0x13')](_0x922c('0xc'),auth['isAuthenticated'](),controller[_0x922c('0x14')]);module[_0x922c('0x15')]=router; \ No newline at end of file +var _0xca96=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','create','delete','destroy','exports','util'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xca96,0x10f));var _0x6ca9=function(_0xdea652,_0x3d74b4){_0xdea652=_0xdea652-0x0;var _0x1335ae=_0xca96[_0xdea652];return _0x1335ae;};'use strict';var multer=require('multer');var util=require(_0x6ca9('0x0'));var path=require('path');var timeout=require(_0x6ca9('0x1'));var express=require(_0x6ca9('0x2'));var router=express[_0x6ca9('0x3')]();var fs_extra=require(_0x6ca9('0x4'));var auth=require(_0x6ca9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca9('0x6'));var controller=require(_0x6ca9('0x7'));router['get']('/',auth[_0x6ca9('0x8')](),controller[_0x6ca9('0x9')]);router[_0x6ca9('0xa')](_0x6ca9('0xb'),auth[_0x6ca9('0x8')](),controller[_0x6ca9('0xc')]);router['post']('/',auth[_0x6ca9('0x8')](),controller[_0x6ca9('0xd')]);router['put'](_0x6ca9('0xb'),auth[_0x6ca9('0x8')](),controller['update']);router[_0x6ca9('0xe')](_0x6ca9('0xb'),auth[_0x6ca9('0x8')](),controller[_0x6ca9('0xf')]);module[_0x6ca9('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index ed571e1..31417c6 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 _0x0782=['exports','ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x338f03,_0x28941b){var _0x514d7e=function(_0x417fba){while(--_0x417fba){_0x338f03['push'](_0x338f03['shift']());}};_0x514d7e(++_0x28941b);}(_0x0782,0x97));var _0x2078=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0x0782[_0x37a9d7];return _0x1343d3;};'use strict';var Sequelize=require(_0x2078('0x0'));module[_0x2078('0x1')]={'type':{'type':Sequelize[_0x2078('0x2')](_0x2078('0x3'),_0x2078('0x4'),_0x2078('0x5'),_0x2078('0x6'))},'value':{'type':Sequelize[_0x2078('0x7')]},'username':{'type':Sequelize[_0x2078('0x7')]},'password':{'type':Sequelize[_0x2078('0x7')]}}; \ No newline at end of file +var _0x6760=['sequelize','exports','ENUM','externip','turn','STRING'];(function(_0x322ce4,_0x3dd20c){var _0x4a1284=function(_0x4be2de){while(--_0x4be2de){_0x322ce4['push'](_0x322ce4['shift']());}};_0x4a1284(++_0x3dd20c);}(_0x6760,0x1e0));var _0x0676=function(_0xa5c0f,_0x5a3121){_0xa5c0f=_0xa5c0f-0x0;var _0x36705b=_0x6760[_0xa5c0f];return _0x36705b;};'use strict';var Sequelize=require(_0x0676('0x0'));module[_0x0676('0x1')]={'type':{'type':Sequelize[_0x0676('0x2')]('localnet',_0x0676('0x3'),'stun',_0x0676('0x4'))},'value':{'type':Sequelize[_0x0676('0x5')]},'username':{'type':Sequelize[_0x0676('0x5')]},'password':{'type':Sequelize[_0x0676('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 0f224f6..3a79e73 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 _0x694c=['STUN','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','format','chan_sip.so','destroy','util','path','../../components/parsers/qs','../../config/logger','api','../../config/environment','client','http','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','undefined','count','offset','limit','set','Content-Range','update','then','end','sendStatus','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','body'];(function(_0x3f33d2,_0x4de946){var _0x1b66a4=function(_0x2ac879){while(--_0x2ac879){_0x3f33d2['push'](_0x3f33d2['shift']());}};_0x1b66a4(++_0x4de946);}(_0x694c,0x1c9));var _0xc694=function(_0x5a1564,_0x31c1ad){_0x5a1564=_0x5a1564-0x0;var _0x3e27ea=_0x694c[_0x5a1564];return _0x3e27ea;};'use strict';var util=require(_0xc694('0x0'));var path=require(_0xc694('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0xc694('0x2'));var logger=require(_0xc694('0x3'))(_0xc694('0x4'));var config=require(_0xc694('0x5'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xc694('0x6')][_0xc694('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x465fcc,_0x465b27,_0x482dc2,_0x24ffe5){return new Promise(function(_0x589caf,_0x52728d){var _0x1a7333=_0x24ffe5||client;return _0x1a7333[_0xc694('0x8')](_0x465fcc,_0x482dc2)['then'](function(_0xcd3e50){logger[_0xc694('0x9')](_0xc694('0xa'),_0x465b27,'request\x20sent');logger[_0xc694('0xb')](_0xc694('0xc'),_0x465b27,_0xc694('0xd'),JSON['stringify'](_0xcd3e50));if(_0xcd3e50[_0xc694('0xe')]){if(_0xcd3e50['error'][_0xc694('0xf')]===0x1f4){logger[_0xc694('0xe')]('Network,\x20%s,\x20%s',_0x465b27,_0xcd3e50[_0xc694('0xe')][_0xc694('0x10')]);return _0x52728d(_0xcd3e50[_0xc694('0xe')][_0xc694('0x10')]);}logger[_0xc694('0xe')](_0xc694('0xa'),_0x465b27,_0xcd3e50['error'][_0xc694('0x10')]);return _0x589caf(_0xcd3e50[_0xc694('0xe')][_0xc694('0x10')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x465b27,_0xc694('0xd'));_0x589caf(_0xcd3e50[_0xc694('0x11')][_0xc694('0x10')]);}})[_0xc694('0x12')](function(_0x30ec9a){logger[_0xc694('0xe')](_0xc694('0xa'),_0x465b27,_0x30ec9a);_0x52728d(_0x30ec9a);});});}function respondWithResult(_0x133c94,_0x2a33ff){_0x2a33ff=_0x2a33ff||0xc8;return function(_0x400160){if(_0x400160){return _0x133c94[_0xc694('0x13')](_0x2a33ff)[_0xc694('0x14')](_0x400160);}};}function respondWithFilteredResult(_0x5de1df,_0x2bc26b){return function(_0x3abb03){if(_0x3abb03){var _0x4eea69=typeof _0x2bc26b['offset']==='undefined'&&typeof _0x2bc26b['limit']===_0xc694('0x15');var _0xe8d2e3=_0x3abb03[_0xc694('0x16')];var _0x33df36=_0x4eea69?0x0:_0x2bc26b[_0xc694('0x17')];var _0x2542f5=_0x4eea69?_0x3abb03[_0xc694('0x16')]:_0x2bc26b[_0xc694('0x17')]+_0x2bc26b[_0xc694('0x18')];var _0x538a34;if(_0x2542f5>=_0xe8d2e3){_0x2542f5=_0xe8d2e3;_0x538a34=0xc8;}else{_0x538a34=0xce;}_0x5de1df[_0xc694('0x13')](_0x538a34);return _0x5de1df[_0xc694('0x19')](_0xc694('0x1a'),_0x33df36+'-'+_0x2542f5+'/'+_0xe8d2e3)['json'](_0x3abb03);}return null;};}function saveUpdates(_0x3d9f13){return function(_0x4d39a6){if(_0x4d39a6){return _0x4d39a6[_0xc694('0x1b')](_0x3d9f13)[_0xc694('0x1c')](function(_0x1fe7e9){return _0x1fe7e9;});}return null;};}function removeEntity(_0x4782d6){return function(_0x39d6d7){if(_0x39d6d7){return _0x39d6d7['destroy']()[_0xc694('0x1c')](function(){_0x4782d6[_0xc694('0x13')](0xcc)[_0xc694('0x1d')]();});}};}function handleEntityNotFound(_0x21e03b){return function(_0x14a793){if(!_0x14a793){_0x21e03b[_0xc694('0x1e')](0x194);}return _0x14a793;};}function handleError(_0x3c2245,_0x4fb6f8){_0x4fb6f8=_0x4fb6f8||0x1f4;return function(_0x5bc1aa){logger['error'](_0x5bc1aa[_0xc694('0x1f')]);if(_0x5bc1aa['name']){delete _0x5bc1aa[_0xc694('0x20')];}_0x3c2245[_0xc694('0x13')](_0x4fb6f8)['send'](_0x5bc1aa);};}exports[_0xc694('0x21')]=function(_0x4712f3,_0x198673){var _0x40bcab={},_0xa4cb48={},_0x318359={'count':0x0,'rows':[]};var _0x19a1f4=_[_0xc694('0x22')](db[_0xc694('0x23')][_0xc694('0x24')],function(_0x18f22a){return{'name':_0x18f22a[_0xc694('0x25')],'type':_0x18f22a[_0xc694('0x26')][_0xc694('0x27')]};});_0xa4cb48[_0xc694('0x28')]=_[_0xc694('0x22')](_0x19a1f4,_0xc694('0x20'));_0xa4cb48[_0xc694('0x29')]=_[_0xc694('0x2a')](_0x4712f3[_0xc694('0x29')]);_0xa4cb48[_0xc694('0x2b')]=_[_0xc694('0x2c')](_0xa4cb48['model'],_0xa4cb48[_0xc694('0x29')]);_0x40bcab[_0xc694('0x2d')]=_['intersection'](_0xa4cb48[_0xc694('0x28')],qs[_0xc694('0x2e')](_0x4712f3[_0xc694('0x29')][_0xc694('0x2e')]));_0x40bcab[_0xc694('0x2d')]=_0x40bcab['attributes'][_0xc694('0x2f')]?_0x40bcab['attributes']:_0xa4cb48[_0xc694('0x28')];if(!_0x4712f3[_0xc694('0x29')][_0xc694('0x30')](_0xc694('0x31'))){_0x40bcab[_0xc694('0x18')]=qs[_0xc694('0x18')](_0x4712f3['query'][_0xc694('0x18')]);_0x40bcab[_0xc694('0x17')]=qs[_0xc694('0x17')](_0x4712f3[_0xc694('0x29')][_0xc694('0x17')]);}_0x40bcab[_0xc694('0x32')]=qs['sort'](_0x4712f3[_0xc694('0x29')]['sort']);_0x40bcab[_0xc694('0x33')]=qs[_0xc694('0x2b')](_[_0xc694('0x34')](_0x4712f3[_0xc694('0x29')],_0xa4cb48[_0xc694('0x2b')]),_0x19a1f4);if(_0x4712f3[_0xc694('0x29')]['filter']){_0x40bcab['where']=_[_0xc694('0x35')](_0x40bcab[_0xc694('0x33')],{'$or':_['map'](_0x19a1f4,function(_0x3d3657){if(_0x3d3657[_0xc694('0x26')]!==_0xc694('0x36')){var _0x3e2a1e={};_0x3e2a1e[_0x3d3657[_0xc694('0x20')]]={'$like':'%'+_0x4712f3[_0xc694('0x29')][_0xc694('0x37')]+'%'};return _0x3e2a1e;}})});}_0x40bcab=_[_0xc694('0x35')]({},_0x40bcab,_0x4712f3[_0xc694('0x38')]);var _0x297873={'where':_0x40bcab[_0xc694('0x33')]};return db[_0xc694('0x23')][_0xc694('0x16')](_0x297873)['then'](function(_0x70c779){_0x318359[_0xc694('0x16')]=_0x70c779;if(_0x4712f3[_0xc694('0x29')][_0xc694('0x39')]){_0x40bcab[_0xc694('0x3a')]=[{'all':!![]}];}return db[_0xc694('0x23')][_0xc694('0x3b')](_0x40bcab);})[_0xc694('0x1c')](function(_0xaea91b){_0x318359[_0xc694('0x3c')]=_0xaea91b;return _0x318359;})[_0xc694('0x1c')](respondWithFilteredResult(_0x198673,_0x40bcab))[_0xc694('0x12')](handleError(_0x198673,null));};exports[_0xc694('0x3d')]=function(_0x6ac107,_0x2d7309){var _0x52becb={'raw':!![],'where':{'id':_0x6ac107['params']['id']}},_0x3f7aa7={};_0x3f7aa7[_0xc694('0x28')]=_[_0xc694('0x2a')](db[_0xc694('0x23')][_0xc694('0x24')]);_0x3f7aa7[_0xc694('0x29')]=_['keys'](_0x6ac107[_0xc694('0x29')]);_0x3f7aa7[_0xc694('0x2b')]=_[_0xc694('0x2c')](_0x3f7aa7[_0xc694('0x28')],_0x3f7aa7['query']);_0x52becb[_0xc694('0x2d')]=_['intersection'](_0x3f7aa7[_0xc694('0x28')],qs['fields'](_0x6ac107['query']['fields']));_0x52becb[_0xc694('0x2d')]=_0x52becb['attributes']['length']?_0x52becb['attributes']:_0x3f7aa7[_0xc694('0x28')];if(_0x6ac107[_0xc694('0x29')]['includeAll']){_0x52becb[_0xc694('0x3a')]=[{'all':!![]}];}_0x52becb=_[_0xc694('0x35')]({},_0x52becb,_0x6ac107[_0xc694('0x38')]);return db[_0xc694('0x23')][_0xc694('0x3e')](_0x52becb)[_0xc694('0x1c')](handleEntityNotFound(_0x2d7309,null))[_0xc694('0x1c')](respondWithResult(_0x2d7309,null))['catch'](handleError(_0x2d7309,null));};exports[_0xc694('0x3f')]=function(_0x527929,_0x411bd9){var _0x23dfc5;return db[_0xc694('0x23')][_0xc694('0x3f')](_0x527929['body'],{'raw':!![]})['then'](function(_0x46e46a){_0x23dfc5=_0x46e46a;return db[_0xc694('0x23')]['findAll']({'where':{'type':_0x527929[_0xc694('0x40')][_0xc694('0x26')]},'raw':!![]});})[_0xc694('0x1c')](function(_0x247f78){if(_0x23dfc5['type']['toUpperCase']()==_0xc694('0x41')){var _0x367fe7=fs['readFileSync'](path[_0xc694('0x42')](config['root'],_0xc694('0x43')),_0xc694('0x44'));var _0x3fd798=ejs[_0xc694('0x45')](_0x367fe7,{'networks':_0x247f78||[]});fs[_0xc694('0x46')](_0xc694('0x47'),_0x3fd798);return respondWithRpcPromise(_0xc694('0x48'),_0xc694('0x3f'),{'module':_0xc694('0x49')});}else if(_0x23dfc5[_0xc694('0x26')][_0xc694('0x4a')]()==_0xc694('0x4b')){var _0x2ba77e=fs[_0xc694('0x4c')](path[_0xc694('0x42')](config[_0xc694('0x4d')],_0xc694('0x4e')),_0xc694('0x44'));var _0x39b02a=ejs['render'](_0x2ba77e,{'networks':_0x247f78||[]});fs['writeFileSync'](_0xc694('0x4f'),_0x39b02a);return respondWithRpcPromise('Reload',_0xc694('0x3f'),{'module':_0xc694('0x49')});}else{var _0x285f9a=fs[_0xc694('0x4c')](path[_0xc694('0x42')](config[_0xc694('0x4d')],_0xc694('0x50')),_0xc694('0x44'));var _0x3aee82=ejs['render'](_0x285f9a,{'networks':_0x247f78||[]});fs[_0xc694('0x46')](util['format'](_0xc694('0x51'),_0x527929[_0xc694('0x40')]['type'][_0xc694('0x52')]()),_0x3aee82);return respondWithRpcPromise(_0xc694('0x48'),_0xc694('0x3f'),{'module':'chan_sip.so'});}})['then'](function(){return _0x23dfc5;})[_0xc694('0x1c')](respondWithResult(_0x411bd9,0xc9))[_0xc694('0x12')](handleError(_0x411bd9,null));};exports[_0xc694('0x1b')]=function(_0x90178,_0x1fd8ee){var _0x2c23bc;return db[_0xc694('0x23')][_0xc694('0x3e')]({'where':{'id':_0x90178[_0xc694('0x53')]['id']}})[_0xc694('0x1c')](handleEntityNotFound(_0x1fd8ee,null))[_0xc694('0x1c')](saveUpdates(_0x90178['body'],null))[_0xc694('0x1c')](function(_0x2dee82){if(_0x2dee82){_0x2c23bc=_0x2dee82;return db[_0xc694('0x23')]['findAll']({'where':{'type':_0x2c23bc[_0xc694('0x26')]},'raw':!![]});}return null;})[_0xc694('0x1c')](function(_0x4c63ef){if(_0x2c23bc[_0xc694('0x26')][_0xc694('0x4a')]()==_0xc694('0x41')){var _0x157c33=fs[_0xc694('0x4c')](path[_0xc694('0x42')](config[_0xc694('0x4d')],_0xc694('0x43')),_0xc694('0x44'));var _0x3c510e=ejs['render'](_0x157c33,{'networks':_0x4c63ef||[]});fs[_0xc694('0x46')](_0xc694('0x47'),_0x3c510e);return respondWithRpcPromise('Reload','update',{'module':_0xc694('0x49')});}else if(_0x2c23bc[_0xc694('0x26')][_0xc694('0x4a')]()==_0xc694('0x4b')){var _0xb921ff=fs['readFileSync'](path['join'](config['root'],_0xc694('0x4e')),_0xc694('0x44'));var _0x5354f0=ejs[_0xc694('0x45')](_0xb921ff,{'networks':_0x4c63ef||[]});fs['writeFileSync'](_0xc694('0x4f'),_0x5354f0);return respondWithRpcPromise(_0xc694('0x48'),_0xc694('0x1b'),{'module':_0xc694('0x49')});}else{var _0x35cd1f=fs['readFileSync'](path[_0xc694('0x42')](config[_0xc694('0x4d')],'server/files/templates/network.ejs'),'utf8');var _0x551d75=ejs[_0xc694('0x45')](_0x35cd1f,{'networks':_0x4c63ef||[]});fs[_0xc694('0x46')](util[_0xc694('0x54')]('/etc/asterisk/sip_xcally_%s.conf',_0x90178[_0xc694('0x40')][_0xc694('0x26')][_0xc694('0x52')]()),_0x551d75);return respondWithRpcPromise(_0xc694('0x48'),'update',{'module':_0xc694('0x55')});}})[_0xc694('0x1c')](function(_0x2fd484){if(_0x2fd484){return _0x2c23bc;}return null;})[_0xc694('0x1c')](respondWithResult(_0x1fd8ee,null))[_0xc694('0x12')](handleError(_0x1fd8ee,null));};exports[_0xc694('0x56')]=function(_0x1c05c1,_0x154bd7){var _0xf0409;return db['Network'][_0xc694('0x3e')]({'where':{'id':_0x1c05c1[_0xc694('0x53')]['id']}})[_0xc694('0x1c')](function(_0x4a537f){_0xf0409=_0x4a537f;return _0x4a537f;})[_0xc694('0x1c')](handleEntityNotFound(_0x154bd7,null))['then'](removeEntity(_0x154bd7,null))[_0xc694('0x1c')](function(){if(_0xf0409){return db[_0xc694('0x23')]['findAll']({'where':{'type':_0xf0409[_0xc694('0x26')]},'raw':!![]});}})[_0xc694('0x1c')](function(_0x5ac48b){if(_0xf0409[_0xc694('0x26')]['toUpperCase']()==_0xc694('0x41')){var _0x5f0a18=fs[_0xc694('0x4c')](path[_0xc694('0x42')](config['root'],_0xc694('0x43')),'utf8');var _0x1968c9=ejs[_0xc694('0x45')](_0x5f0a18,{'networks':_0x5ac48b||[]});fs[_0xc694('0x46')](_0xc694('0x47'),_0x1968c9);return respondWithRpcPromise(_0xc694('0x48'),_0xc694('0x56'),{'module':_0xc694('0x49')});}else if(_0xf0409[_0xc694('0x26')][_0xc694('0x4a')]()==_0xc694('0x4b')){var _0x43e1e6=fs['readFileSync'](path[_0xc694('0x42')](config[_0xc694('0x4d')],_0xc694('0x4e')),'utf8');var _0x1a8229=ejs[_0xc694('0x45')](_0x43e1e6,{'networks':_0x5ac48b||[]});fs[_0xc694('0x46')](_0xc694('0x4f'),_0x1a8229);return respondWithRpcPromise(_0xc694('0x48'),_0xc694('0x56'),{'module':_0xc694('0x49')});}else{var _0x1134c8=fs[_0xc694('0x4c')](path[_0xc694('0x42')](config[_0xc694('0x4d')],_0xc694('0x50')),_0xc694('0x44'));var _0x352f23=ejs[_0xc694('0x45')](_0x1134c8,{'networks':_0x5ac48b||[]});fs[_0xc694('0x46')](util[_0xc694('0x54')](_0xc694('0x51'),_0xf0409[_0xc694('0x26')]['toLowerCase']()),_0x352f23);return respondWithRpcPromise(_0xc694('0x48'),'destroy',{'module':_0xc694('0x55')});}})[_0xc694('0x12')](handleError(_0x154bd7,null));}; \ No newline at end of file +var _0xbabc=['rows','length','find','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','readFileSync','server/files/templates/network.ejs','render','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/stun_xcally.conf','toLowerCase','/etc/asterisk/turn_xcally.conf','path','lodash','../../config/logger','api','../../config/environment','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','json','undefined','limit','count','offset','status','set','Content-Range','update','destroy','end','sendStatus','stack','name','Network','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1b2f4a,_0x93cef2){var _0x5e518b=function(_0x2272c0){while(--_0x2272c0){_0x1b2f4a['push'](_0x1b2f4a['shift']());}};_0x5e518b(++_0x93cef2);}(_0xbabc,0x159));var _0xcbab=function(_0x319493,_0x7b9841){_0x319493=_0x319493-0x0;var _0x12e05a=_0xbabc[_0x319493];return _0x12e05a;};'use strict';var util=require('util');var path=require(_0xcbab('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbab('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xcbab('0x2'))(_0xcbab('0x3'));var config=require(_0xcbab('0x4'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xcbab('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37a5c0,_0x520631,_0x5729c9,_0x4e6fcf){return new Promise(function(_0x45aa46,_0x4c0a64){var _0x345f0c=_0x4e6fcf||client;return _0x345f0c[_0xcbab('0x6')](_0x37a5c0,_0x5729c9)[_0xcbab('0x7')](function(_0x15fb29){logger[_0xcbab('0x8')](_0xcbab('0x9'),_0x520631,_0xcbab('0xa'));logger['debug'](_0xcbab('0xb'),_0x520631,_0xcbab('0xa'),JSON['stringify'](_0x15fb29));if(_0x15fb29[_0xcbab('0xc')]){if(_0x15fb29[_0xcbab('0xc')][_0xcbab('0xd')]===0x1f4){logger[_0xcbab('0xc')](_0xcbab('0x9'),_0x520631,_0x15fb29[_0xcbab('0xc')]['message']);return _0x4c0a64(_0x15fb29[_0xcbab('0xc')][_0xcbab('0xe')]);}logger[_0xcbab('0xc')](_0xcbab('0x9'),_0x520631,_0x15fb29['error'][_0xcbab('0xe')]);return _0x45aa46(_0x15fb29[_0xcbab('0xc')][_0xcbab('0xe')]);}else{logger[_0xcbab('0x8')](_0xcbab('0x9'),_0x520631,'request\x20sent');_0x45aa46(_0x15fb29[_0xcbab('0xf')][_0xcbab('0xe')]);}})[_0xcbab('0x10')](function(_0x290435){logger[_0xcbab('0xc')](_0xcbab('0x9'),_0x520631,_0x290435);_0x4c0a64(_0x290435);});});}function respondWithResult(_0xa27928,_0x4b0f27){_0x4b0f27=_0x4b0f27||0xc8;return function(_0x23819a){if(_0x23819a){return _0xa27928['status'](_0x4b0f27)[_0xcbab('0x11')](_0x23819a);}};}function respondWithFilteredResult(_0x383b6c,_0x3a6d61){return function(_0x13be36){if(_0x13be36){var _0x3c836c=typeof _0x3a6d61['offset']===_0xcbab('0x12')&&typeof _0x3a6d61[_0xcbab('0x13')]===_0xcbab('0x12');var _0x407f9a=_0x13be36[_0xcbab('0x14')];var _0x36dc6a=_0x3c836c?0x0:_0x3a6d61[_0xcbab('0x15')];var _0x142cae=_0x3c836c?_0x13be36['count']:_0x3a6d61[_0xcbab('0x15')]+_0x3a6d61[_0xcbab('0x13')];var _0x3b4656;if(_0x142cae>=_0x407f9a){_0x142cae=_0x407f9a;_0x3b4656=0xc8;}else{_0x3b4656=0xce;}_0x383b6c[_0xcbab('0x16')](_0x3b4656);return _0x383b6c[_0xcbab('0x17')](_0xcbab('0x18'),_0x36dc6a+'-'+_0x142cae+'/'+_0x407f9a)[_0xcbab('0x11')](_0x13be36);}return null;};}function saveUpdates(_0x350c6f){return function(_0x44c0da){if(_0x44c0da){return _0x44c0da[_0xcbab('0x19')](_0x350c6f)[_0xcbab('0x7')](function(_0x38abc6){return _0x38abc6;});}return null;};}function removeEntity(_0x3694bd){return function(_0x30df5c){if(_0x30df5c){return _0x30df5c[_0xcbab('0x1a')]()[_0xcbab('0x7')](function(){_0x3694bd[_0xcbab('0x16')](0xcc)[_0xcbab('0x1b')]();});}};}function handleEntityNotFound(_0x659f04){return function(_0x337383){if(!_0x337383){_0x659f04[_0xcbab('0x1c')](0x194);}return _0x337383;};}function handleError(_0x34bd5f,_0x2606d6){_0x2606d6=_0x2606d6||0x1f4;return function(_0x95856a){logger[_0xcbab('0xc')](_0x95856a[_0xcbab('0x1d')]);if(_0x95856a[_0xcbab('0x1e')]){delete _0x95856a[_0xcbab('0x1e')];}_0x34bd5f['status'](_0x2606d6)['send'](_0x95856a);};}exports['index']=function(_0x59eb56,_0x8d4f78){var _0x3252a7={},_0x4c0332={},_0x32ceb2={'count':0x0,'rows':[]};var _0x4465b5=_['map'](db[_0xcbab('0x1f')][_0xcbab('0x20')],function(_0x4be950){return{'name':_0x4be950[_0xcbab('0x21')],'type':_0x4be950[_0xcbab('0x22')][_0xcbab('0x23')]};});_0x4c0332['model']=_['map'](_0x4465b5,'name');_0x4c0332[_0xcbab('0x24')]=_[_0xcbab('0x25')](_0x59eb56['query']);_0x4c0332[_0xcbab('0x26')]=_[_0xcbab('0x27')](_0x4c0332['model'],_0x4c0332[_0xcbab('0x24')]);_0x3252a7[_0xcbab('0x28')]=_[_0xcbab('0x27')](_0x4c0332[_0xcbab('0x29')],qs[_0xcbab('0x2a')](_0x59eb56[_0xcbab('0x24')][_0xcbab('0x2a')]));_0x3252a7[_0xcbab('0x28')]=_0x3252a7['attributes']['length']?_0x3252a7[_0xcbab('0x28')]:_0x4c0332[_0xcbab('0x29')];if(!_0x59eb56[_0xcbab('0x24')][_0xcbab('0x2b')]('nolimit')){_0x3252a7[_0xcbab('0x13')]=qs[_0xcbab('0x13')](_0x59eb56[_0xcbab('0x24')][_0xcbab('0x13')]);_0x3252a7[_0xcbab('0x15')]=qs['offset'](_0x59eb56[_0xcbab('0x24')]['offset']);}_0x3252a7['order']=qs[_0xcbab('0x2c')](_0x59eb56[_0xcbab('0x24')]['sort']);_0x3252a7['where']=qs[_0xcbab('0x26')](_[_0xcbab('0x2d')](_0x59eb56[_0xcbab('0x24')],_0x4c0332[_0xcbab('0x26')]),_0x4465b5);if(_0x59eb56[_0xcbab('0x24')][_0xcbab('0x2e')]){_0x3252a7[_0xcbab('0x2f')]=_[_0xcbab('0x30')](_0x3252a7['where'],{'$or':_[_0xcbab('0x31')](_0x4465b5,function(_0x4060bb){if(_0x4060bb['type']!==_0xcbab('0x32')){var _0xfe4ff9={};_0xfe4ff9[_0x4060bb[_0xcbab('0x1e')]]={'$like':'%'+_0x59eb56[_0xcbab('0x24')][_0xcbab('0x2e')]+'%'};return _0xfe4ff9;}})});}_0x3252a7=_[_0xcbab('0x30')]({},_0x3252a7,_0x59eb56[_0xcbab('0x33')]);var _0x484d35={'where':_0x3252a7['where']};return db[_0xcbab('0x1f')][_0xcbab('0x14')](_0x484d35)['then'](function(_0x2065ed){_0x32ceb2[_0xcbab('0x14')]=_0x2065ed;if(_0x59eb56[_0xcbab('0x24')][_0xcbab('0x34')]){_0x3252a7[_0xcbab('0x35')]=[{'all':!![]}];}return db['Network'][_0xcbab('0x36')](_0x3252a7);})[_0xcbab('0x7')](function(_0x1f4398){_0x32ceb2[_0xcbab('0x37')]=_0x1f4398;return _0x32ceb2;})[_0xcbab('0x7')](respondWithFilteredResult(_0x8d4f78,_0x3252a7))[_0xcbab('0x10')](handleError(_0x8d4f78,null));};exports['show']=function(_0x4fbadf,_0x31f24a){var _0x44b903={'raw':!![],'where':{'id':_0x4fbadf['params']['id']}},_0x44630e={};_0x44630e[_0xcbab('0x29')]=_[_0xcbab('0x25')](db[_0xcbab('0x1f')][_0xcbab('0x20')]);_0x44630e[_0xcbab('0x24')]=_[_0xcbab('0x25')](_0x4fbadf[_0xcbab('0x24')]);_0x44630e[_0xcbab('0x26')]=_[_0xcbab('0x27')](_0x44630e[_0xcbab('0x29')],_0x44630e[_0xcbab('0x24')]);_0x44b903[_0xcbab('0x28')]=_[_0xcbab('0x27')](_0x44630e[_0xcbab('0x29')],qs[_0xcbab('0x2a')](_0x4fbadf['query'][_0xcbab('0x2a')]));_0x44b903[_0xcbab('0x28')]=_0x44b903[_0xcbab('0x28')][_0xcbab('0x38')]?_0x44b903[_0xcbab('0x28')]:_0x44630e[_0xcbab('0x29')];if(_0x4fbadf[_0xcbab('0x24')][_0xcbab('0x34')]){_0x44b903['include']=[{'all':!![]}];}_0x44b903=_[_0xcbab('0x30')]({},_0x44b903,_0x4fbadf[_0xcbab('0x33')]);return db['Network'][_0xcbab('0x39')](_0x44b903)[_0xcbab('0x7')](handleEntityNotFound(_0x31f24a,null))[_0xcbab('0x7')](respondWithResult(_0x31f24a,null))[_0xcbab('0x10')](handleError(_0x31f24a,null));};exports[_0xcbab('0x3a')]=function(_0x27ab3f,_0x19e3c1){var _0x42d1fe;return db['Network'][_0xcbab('0x3a')](_0x27ab3f['body'],{'raw':!![]})['then'](function(_0x2b849a){_0x42d1fe=_0x2b849a;return db[_0xcbab('0x1f')][_0xcbab('0x36')]({'where':{'type':_0x27ab3f[_0xcbab('0x3b')][_0xcbab('0x22')]},'raw':!![]});})[_0xcbab('0x7')](function(_0x1b7835){if(_0x42d1fe[_0xcbab('0x22')][_0xcbab('0x3c')]()==_0xcbab('0x3d')){var _0x5cf742=fs['readFileSync'](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x40')),_0xcbab('0x41'));var _0x483749=ejs['render'](_0x5cf742,{'networks':_0x1b7835||[]});fs[_0xcbab('0x42')]('/etc/asterisk/stun_xcally.conf',_0x483749);return respondWithRpcPromise(_0xcbab('0x43'),_0xcbab('0x3a'),{'module':_0xcbab('0x44')});}else if(_0x42d1fe[_0xcbab('0x22')][_0xcbab('0x3c')]()==_0xcbab('0x45')){var _0x591838=fs['readFileSync'](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x46')),_0xcbab('0x41'));var _0x2b5b05=ejs['render'](_0x591838,{'networks':_0x1b7835||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x2b5b05);return respondWithRpcPromise(_0xcbab('0x43'),'create',{'module':'res_stun_monitor.so'});}else{var _0x3b7910=fs[_0xcbab('0x47')](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x48')),_0xcbab('0x41'));var _0x3e2ddc=ejs[_0xcbab('0x49')](_0x3b7910,{'networks':_0x1b7835||[]});fs[_0xcbab('0x42')](util[_0xcbab('0x4a')](_0xcbab('0x4b'),_0x27ab3f[_0xcbab('0x3b')]['type']['toLowerCase']()),_0x3e2ddc);return respondWithRpcPromise(_0xcbab('0x43'),_0xcbab('0x3a'),{'module':_0xcbab('0x4c')});}})[_0xcbab('0x7')](function(){return _0x42d1fe;})['then'](respondWithResult(_0x19e3c1,0xc9))[_0xcbab('0x10')](handleError(_0x19e3c1,null));};exports['update']=function(_0x559ce9,_0x5cb4fa){var _0x216739;return db[_0xcbab('0x1f')]['find']({'where':{'id':_0x559ce9['params']['id']}})[_0xcbab('0x7')](handleEntityNotFound(_0x5cb4fa,null))[_0xcbab('0x7')](saveUpdates(_0x559ce9[_0xcbab('0x3b')],null))[_0xcbab('0x7')](function(_0xe44c0d){if(_0xe44c0d){_0x216739=_0xe44c0d;return db['Network'][_0xcbab('0x36')]({'where':{'type':_0x216739[_0xcbab('0x22')]},'raw':!![]});}return null;})[_0xcbab('0x7')](function(_0x3a48bb){if(_0x216739[_0xcbab('0x22')]['toUpperCase']()==_0xcbab('0x3d')){var _0x3bd3f3=fs['readFileSync'](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x40')),_0xcbab('0x41'));var _0x54dda9=ejs[_0xcbab('0x49')](_0x3bd3f3,{'networks':_0x3a48bb||[]});fs[_0xcbab('0x42')](_0xcbab('0x4d'),_0x54dda9);return respondWithRpcPromise(_0xcbab('0x43'),_0xcbab('0x19'),{'module':_0xcbab('0x44')});}else if(_0x216739[_0xcbab('0x22')][_0xcbab('0x3c')]()==_0xcbab('0x45')){var _0x3303a1=fs[_0xcbab('0x47')](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x12a817=ejs['render'](_0x3303a1,{'networks':_0x3a48bb||[]});fs[_0xcbab('0x42')]('/etc/asterisk/turn_xcally.conf',_0x12a817);return respondWithRpcPromise(_0xcbab('0x43'),_0xcbab('0x19'),{'module':_0xcbab('0x44')});}else{var _0x72a620=fs[_0xcbab('0x47')](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x48')),_0xcbab('0x41'));var _0x3f9115=ejs[_0xcbab('0x49')](_0x72a620,{'networks':_0x3a48bb||[]});fs[_0xcbab('0x42')](util[_0xcbab('0x4a')](_0xcbab('0x4b'),_0x559ce9[_0xcbab('0x3b')]['type'][_0xcbab('0x4e')]()),_0x3f9115);return respondWithRpcPromise(_0xcbab('0x43'),_0xcbab('0x19'),{'module':'chan_sip.so'});}})[_0xcbab('0x7')](function(_0xf05c4f){if(_0xf05c4f){return _0x216739;}return null;})[_0xcbab('0x7')](respondWithResult(_0x5cb4fa,null))[_0xcbab('0x10')](handleError(_0x5cb4fa,null));};exports[_0xcbab('0x1a')]=function(_0x57ecd7,_0x3f68d4){var _0x1ff4d9;return db['Network']['find']({'where':{'id':_0x57ecd7['params']['id']}})['then'](function(_0x27fae3){_0x1ff4d9=_0x27fae3;return _0x27fae3;})[_0xcbab('0x7')](handleEntityNotFound(_0x3f68d4,null))['then'](removeEntity(_0x3f68d4,null))[_0xcbab('0x7')](function(){if(_0x1ff4d9){return db[_0xcbab('0x1f')][_0xcbab('0x36')]({'where':{'type':_0x1ff4d9[_0xcbab('0x22')]},'raw':!![]});}})['then'](function(_0x9a62fe){if(_0x1ff4d9[_0xcbab('0x22')]['toUpperCase']()==_0xcbab('0x3d')){var _0xb2ffaa=fs[_0xcbab('0x47')](path['join'](config[_0xcbab('0x3f')],_0xcbab('0x40')),_0xcbab('0x41'));var _0x5a05a3=ejs['render'](_0xb2ffaa,{'networks':_0x9a62fe||[]});fs[_0xcbab('0x42')]('/etc/asterisk/stun_xcally.conf',_0x5a05a3);return respondWithRpcPromise(_0xcbab('0x43'),'destroy',{'module':_0xcbab('0x44')});}else if(_0x1ff4d9[_0xcbab('0x22')][_0xcbab('0x3c')]()==_0xcbab('0x45')){var _0x299a54=fs[_0xcbab('0x47')](path[_0xcbab('0x3e')](config['root'],_0xcbab('0x46')),_0xcbab('0x41'));var _0x1c62b8=ejs[_0xcbab('0x49')](_0x299a54,{'networks':_0x9a62fe||[]});fs[_0xcbab('0x42')](_0xcbab('0x4f'),_0x1c62b8);return respondWithRpcPromise('Reload',_0xcbab('0x1a'),{'module':_0xcbab('0x44')});}else{var _0x4782b3=fs[_0xcbab('0x47')](path[_0xcbab('0x3e')](config[_0xcbab('0x3f')],_0xcbab('0x48')),_0xcbab('0x41'));var _0x5e5850=ejs[_0xcbab('0x49')](_0x4782b3,{'networks':_0x9a62fe||[]});fs[_0xcbab('0x42')](util[_0xcbab('0x4a')](_0xcbab('0x4b'),_0x1ff4d9['type'][_0xcbab('0x4e')]()),_0x5e5850);return respondWithRpcPromise(_0xcbab('0x43'),'destroy',{'module':'chan_sip.so'});}})[_0xcbab('0x10')](handleError(_0x3f68d4,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3844328..941e886 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 _0x6308=['bluebird','request-promise','path','rimraf','../../config/environment','define','Network','network','lodash','../../config/logger'];(function(_0x49e9ca,_0x471424){var _0x27aac3=function(_0x3840b7){while(--_0x3840b7){_0x49e9ca['push'](_0x49e9ca['shift']());}};_0x27aac3(++_0x471424);}(_0x6308,0x1f2));var _0x8630=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x6308[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var logger=require(_0x8630('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8630('0x2'));var rp=require(_0x8630('0x3'));var fs=require('fs');var path=require(_0x8630('0x4'));var rimraf=require(_0x8630('0x5'));var config=require(_0x8630('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x1d62c8,_0x571543){return _0x1d62c8[_0x8630('0x7')](_0x8630('0x8'),attributes,{'tableName':_0x8630('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa588=['exports','define','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x22afe5,_0x284242){var _0x4e1348=function(_0x57647d){while(--_0x57647d){_0x22afe5['push'](_0x22afe5['shift']());}};_0x4e1348(++_0x284242);}(_0xa588,0xe1));var _0x8a58=function(_0x4ec964,_0x3b9bd8){_0x4ec964=_0x4ec964-0x0;var _0x5943e2=_0xa588[_0x4ec964];return _0x5943e2;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var logger=require(_0x8a58('0x1'))(_0x8a58('0x2'));var moment=require(_0x8a58('0x3'));var BPromise=require(_0x8a58('0x4'));var rp=require(_0x8a58('0x5'));var fs=require('fs');var path=require(_0x8a58('0x6'));var rimraf=require(_0x8a58('0x7'));var config=require(_0x8a58('0x8'));var attributes=require('./network.attributes');module[_0x8a58('0x9')]=function(_0x408a4a,_0x448366){return _0x408a4a[_0x8a58('0xa')](_0x8a58('0xb'),attributes,{'tableName':_0x8a58('0xc'),'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 40b2e60..00eaab4 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x58d80e,_0x58f806){_0x58d80e=_0x58d80e-0x0;var _0x2e57d1=_0x7a54[_0x58d80e];return _0x2e57d1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x77a826,_0x6a6a50){var _0x317dea=function(_0x2f1457){while(--_0x2f1457){_0x77a826['push'](_0x77a826['shift']());}};_0x317dea(++_0x6a6a50);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index efe5e85..4c0bdbf 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 _0xcc50=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','addApplications','addAgents','update','delete','destroy','removeAnswers','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x524f79,_0x313e98){var _0x3cae1f=function(_0x2dd189){while(--_0x2dd189){_0x524f79['push'](_0x524f79['shift']());}};_0x3cae1f(++_0x313e98);}(_0xcc50,0xf2));var _0x0cc5=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0xcc50[_0x1fd675];return _0x521d1c;};'use strict';var multer=require(_0x0cc5('0x0'));var util=require(_0x0cc5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cc5('0x2'));var auth=require(_0x0cc5('0x3'));var interaction=require(_0x0cc5('0x4'));var config=require(_0x0cc5('0x5'));var controller=require(_0x0cc5('0x6'));router[_0x0cc5('0x7')]('/',auth[_0x0cc5('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0cc5('0x9')]);router[_0x0cc5('0x7')](_0x0cc5('0xa'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0xb')]);router[_0x0cc5('0x7')](_0x0cc5('0xc'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0xd')]);router[_0x0cc5('0x7')](_0x0cc5('0xe'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0xf')]);router[_0x0cc5('0x7')](_0x0cc5('0x10'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x11')]);router[_0x0cc5('0x7')](_0x0cc5('0x12'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x13')]);router[_0x0cc5('0x7')](_0x0cc5('0x14'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x15')]);router[_0x0cc5('0x16')]('/',auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x17')]);router['post'](_0x0cc5('0xc'),auth[_0x0cc5('0x8')](),controller['addDisposition']);router['post'](_0x0cc5('0xe'),auth['isAuthenticated'](),controller[_0x0cc5('0x18')]);router['post']('/:id/notify',controller['notify']);router[_0x0cc5('0x16')]('/:id/applications',auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x19')]);router[_0x0cc5('0x16')](_0x0cc5('0x14'),auth['isAuthenticated'](),controller[_0x0cc5('0x1a')]);router[_0x0cc5('0x16')]('/:id/send',auth[_0x0cc5('0x8')](),controller['send']);router['put'](_0x0cc5('0xa'),auth[_0x0cc5('0x8')](),controller[_0x0cc5('0x1b')]);router[_0x0cc5('0x1c')](_0x0cc5('0xa'),auth['isAuthenticated'](),controller[_0x0cc5('0x1d')]);router[_0x0cc5('0x1c')](_0x0cc5('0xc'),auth[_0x0cc5('0x8')](),controller['removeDispositions']);router[_0x0cc5('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0cc5('0x1e')]);router[_0x0cc5('0x1c')](_0x0cc5('0x14'),auth[_0x0cc5('0x8')](),controller['removeAgents']);module[_0x0cc5('0x1f')]=router; \ No newline at end of file +var _0x44f3=['addApplications','addAgents','/:id/send','send','update','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','/:id/applications'];(function(_0x32824c,_0x187b0a){var _0x170e27=function(_0x3a2ea2){while(--_0x3a2ea2){_0x32824c['push'](_0x32824c['shift']());}};_0x170e27(++_0x187b0a);}(_0x44f3,0x1a0));var _0x344f=function(_0x285b7d,_0x46a4b7){_0x285b7d=_0x285b7d-0x0;var _0x1c6999=_0x44f3[_0x285b7d];return _0x1c6999;};'use strict';var multer=require(_0x344f('0x0'));var util=require('util');var path=require(_0x344f('0x1'));var timeout=require(_0x344f('0x2'));var express=require(_0x344f('0x3'));var router=express['Router']();var fs_extra=require(_0x344f('0x4'));var auth=require(_0x344f('0x5'));var interaction=require(_0x344f('0x6'));var config=require(_0x344f('0x7'));var controller=require('./openchannelAccount.controller');router[_0x344f('0x8')]('/',auth['isAuthenticated'](),controller[_0x344f('0x9')]);router['get'](_0x344f('0xa'),auth[_0x344f('0xb')](),controller[_0x344f('0xc')]);router['get'](_0x344f('0xd'),auth[_0x344f('0xb')](),controller['show']);router['get'](_0x344f('0xe'),auth['isAuthenticated'](),controller[_0x344f('0xf')]);router[_0x344f('0x8')](_0x344f('0x10'),auth['isAuthenticated'](),controller[_0x344f('0x11')]);router['get']('/:id/applications',auth[_0x344f('0xb')](),controller[_0x344f('0x12')]);router['get'](_0x344f('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x344f('0x8')](_0x344f('0x14'),auth[_0x344f('0xb')](),controller[_0x344f('0x15')]);router[_0x344f('0x16')]('/',auth[_0x344f('0xb')](),controller[_0x344f('0x17')]);router['post'](_0x344f('0xe'),auth[_0x344f('0xb')](),controller[_0x344f('0x18')]);router[_0x344f('0x16')](_0x344f('0x10'),auth[_0x344f('0xb')](),controller[_0x344f('0x19')]);router[_0x344f('0x16')](_0x344f('0x1a'),controller['notify']);router[_0x344f('0x16')](_0x344f('0x1b'),auth['isAuthenticated'](),controller[_0x344f('0x1c')]);router[_0x344f('0x16')](_0x344f('0x14'),auth[_0x344f('0xb')](),controller[_0x344f('0x1d')]);router[_0x344f('0x16')](_0x344f('0x1e'),auth[_0x344f('0xb')](),controller[_0x344f('0x1f')]);router['put']('/:id',auth[_0x344f('0xb')](),controller[_0x344f('0x20')]);router[_0x344f('0x21')](_0x344f('0xd'),auth[_0x344f('0xb')](),controller['destroy']);router[_0x344f('0x21')](_0x344f('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x344f('0x21')](_0x344f('0x10'),auth[_0x344f('0xb')](),controller[_0x344f('0x22')]);router[_0x344f('0x21')](_0x344f('0x14'),auth['isAuthenticated'](),controller[_0x344f('0x23')]);module[_0x344f('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 60c871c..f886e3a 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 _0x4721=['name','TEXT','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','STRING'];(function(_0x25f636,_0x474b8e){var _0x1f7dc4=function(_0x25629b){while(--_0x25629b){_0x25f636['push'](_0x25f636['shift']());}};_0x1f7dc4(++_0x474b8e);}(_0x4721,0x13e));var _0x1472=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x4721[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1472('0x0'));module['exports']={'name':{'type':Sequelize[_0x1472('0x1')],'unique':_0x1472('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1472('0x1')]},'token':{'type':Sequelize[_0x1472('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x1472('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1472('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1472('0x3')],'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['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1472('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1472('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1472('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1472('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1472('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x1472('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1472('0x5')],'defaultValue':![],'comment':_0x1472('0x7'),'set':function(_0x24cc65){if(!_0x24cc65)this[_0x1472('0x8')](_0x1472('0x9'),null);this[_0x1472('0x8')]('mandatoryDisposition',_0x24cc65);}}}; \ No newline at end of file +var _0x873f=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','TEXT'];(function(_0x37d7e4,_0x2806bf){var _0x568c8b=function(_0x3432e7){while(--_0x3432e7){_0x37d7e4['push'](_0x37d7e4['shift']());}};_0x568c8b(++_0x2806bf);}(_0x873f,0x139));var _0xf873=function(_0x4b2a56,_0x3f2880){_0x4b2a56=_0x4b2a56-0x0;var _0x4c3038=_0x873f[_0x4b2a56];return _0x4c3038;};'use strict';var Sequelize=require(_0xf873('0x0'));var rs=require('randomstring');module[_0xf873('0x1')]={'name':{'type':Sequelize[_0xf873('0x2')],'unique':_0xf873('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf873('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf873('0x4')]();}},'replyUri':{'type':Sequelize[_0xf873('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf873('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf873('0x5')],'defaultValue':function(){return _0xf873('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf873('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf873('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf873('0x2')]},'queueTransfer':{'type':Sequelize[_0xf873('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf873('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf873('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf873('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf873('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf873('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1dbcff){if(!_0x1dbcff)this['setDataValue'](_0xf873('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x1dbcff);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ccf67f2..3ad5367 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 _0xb4e6=['UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','CmContact','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','forcedOwnership','startRouting','Start','EventManager','addApplications','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','send','getApplications','getInteractions','User','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','apply','save','destroy','get','OpenchannelAccounts'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0xb4e6[_0x2c3a88];return _0x4a7925;};'use strict';var emlformat=require(_0x6b4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b4e('0x1'));var jsonpatch=require(_0x6b4e('0x2'));var rp=require(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var Mustache=require(_0x6b4e('0x6'));var util=require(_0x6b4e('0x7'));var path=require('path');var sox=require(_0x6b4e('0x8'));var csv=require(_0x6b4e('0x9'));var ejs=require(_0x6b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var as=require(_0x6b4e('0x12'));var hardwareService=require(_0x6b4e('0x13'));var logger=require('../../config/logger')(_0x6b4e('0x14'));var utils=require(_0x6b4e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b4e('0x16'));var db=require(_0x6b4e('0x17'))['db'];config[_0x6b4e('0x18')]=_[_0x6b4e('0x19')](config[_0x6b4e('0x18')],{'host':_0x6b4e('0x1a'),'port':0x18eb});var socket=require(_0x6b4e('0x1b'))(new Redis(config['redis']));require(_0x6b4e('0x1c'))[_0x6b4e('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6b4e('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x6b4e('0x1e')][_0x6b4e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3ba513,_0x42e265,_0x28c3ba,_0x135568){return new BPromise(function(_0x53a934,_0x5775f4){var _0x67496d=_0x135568||client;return _0x67496d[_0x6b4e('0x20')](_0x3ba513,_0x28c3ba)[_0x6b4e('0x21')](function(_0x39c1b8){logger[_0x6b4e('0x22')](_0x6b4e('0x23'),_0x42e265,_0x6b4e('0x24'));logger[_0x6b4e('0x25')](_0x6b4e('0x26'),_0x42e265,_0x6b4e('0x24'),JSON[_0x6b4e('0x27')](_0x39c1b8));if(_0x39c1b8['error']){if(_0x39c1b8[_0x6b4e('0x28')][_0x6b4e('0x29')]===0x1f4){logger[_0x6b4e('0x28')](_0x6b4e('0x23'),_0x42e265,_0x39c1b8['error'][_0x6b4e('0x2a')]);return _0x5775f4(_0x39c1b8['error'][_0x6b4e('0x2a')]);}logger[_0x6b4e('0x28')](_0x6b4e('0x23'),_0x42e265,_0x39c1b8[_0x6b4e('0x28')][_0x6b4e('0x2a')]);return _0x53a934(_0x39c1b8[_0x6b4e('0x28')][_0x6b4e('0x2a')]);}else{logger['info'](_0x6b4e('0x23'),_0x42e265,'request\x20sent');_0x53a934(_0x39c1b8[_0x6b4e('0x2b')][_0x6b4e('0x2a')]);}})[_0x6b4e('0x2c')](function(_0xdba4fe){logger['error'](_0x6b4e('0x23'),_0x42e265,_0xdba4fe);_0x5775f4(_0xdba4fe);});});}function respondWithStatusCode(_0x3f72d7,_0x4e217c){_0x4e217c=_0x4e217c||0xcc;return function(_0x32102f){if(_0x32102f){return _0x3f72d7[_0x6b4e('0x2d')](_0x4e217c);}return _0x3f72d7[_0x6b4e('0x2e')](_0x4e217c)[_0x6b4e('0x2f')]();};}function respondWithResult(_0x5bfe9e,_0x2d42be){_0x2d42be=_0x2d42be||0xc8;return function(_0x182375){if(_0x182375){return _0x5bfe9e['status'](_0x2d42be)[_0x6b4e('0x30')](_0x182375);}};}function respondWithFilteredResult(_0x453beb,_0x2f1129){return function(_0x143de5){if(_0x143de5){var _0x4a6c90=typeof _0x2f1129[_0x6b4e('0x31')]===_0x6b4e('0x32')&&typeof _0x2f1129['limit']===_0x6b4e('0x32');var _0x3f9868=_0x143de5[_0x6b4e('0x33')];var _0x53c242=_0x4a6c90?0x0:_0x2f1129['offset'];var _0x11156e=_0x4a6c90?_0x143de5[_0x6b4e('0x33')]:_0x2f1129[_0x6b4e('0x31')]+_0x2f1129['limit'];var _0x2a1a29;if(_0x11156e>=_0x3f9868){_0x11156e=_0x3f9868;_0x2a1a29=0xc8;}else{_0x2a1a29=0xce;}_0x453beb[_0x6b4e('0x2e')](_0x2a1a29);return _0x453beb[_0x6b4e('0x34')]('Content-Range',_0x53c242+'-'+_0x11156e+'/'+_0x3f9868)['json'](_0x143de5);}return null;};}function patchUpdates(_0x2bff51){return function(_0x4952ef){try{jsonpatch[_0x6b4e('0x35')](_0x4952ef,_0x2bff51,!![]);}catch(_0x332e74){return BPromise['reject'](_0x332e74);}return _0x4952ef[_0x6b4e('0x36')]();};}function saveUpdates(_0x3b3094,_0xa7d077){return function(_0x1e8d8d){if(_0x1e8d8d){return _0x1e8d8d['update'](_0x3b3094)['then'](function(_0x1a482e){return _0x1a482e;});}return null;};}function removeEntity(_0x2efd68,_0x2c2454){return function(_0x23e2d9){if(_0x23e2d9){return _0x23e2d9[_0x6b4e('0x37')]()[_0x6b4e('0x21')](function(){var _0x2a5198=_0x23e2d9[_0x6b4e('0x38')]({'plain':!![]});var _0x144954=_0x6b4e('0x39');return db[_0x6b4e('0x3a')][_0x6b4e('0x37')]({'where':{'type':_0x144954,'resourceId':_0x2a5198['id']}})[_0x6b4e('0x21')](function(){return _0x23e2d9;});})['then'](function(){_0x2efd68[_0x6b4e('0x2e')](0xcc)[_0x6b4e('0x2f')]();});}};}function handleEntityNotFound(_0x3f2c1d,_0x4c8639){return function(_0x287e74){if(!_0x287e74){_0x3f2c1d['sendStatus'](0x194);}return _0x287e74;};}function handleError(_0x1271bc,_0x1cb4c9){_0x1cb4c9=_0x1cb4c9||0x1f4;return function(_0x38687f){logger['error'](_0x38687f['stack']);if(_0x38687f[_0x6b4e('0x3b')]){delete _0x38687f[_0x6b4e('0x3b')];}_0x1271bc['status'](_0x1cb4c9)['send'](_0x38687f);};}exports[_0x6b4e('0x3c')]=function(_0xe125d7,_0x303507){var _0x39097d={'include':[{'model':db[_0x6b4e('0x3d')],'as':_0x6b4e('0x3e')}]},_0x164863={},_0x408d66={'count':0x0,'rows':[]};var _0x2faf8d=_[_0x6b4e('0x3f')](db[_0x6b4e('0x40')]['rawAttributes'],function(_0x3e4dcc){return{'name':_0x3e4dcc[_0x6b4e('0x41')],'type':_0x3e4dcc['type'][_0x6b4e('0x42')]};});_0x164863[_0x6b4e('0x43')]=_[_0x6b4e('0x3f')](_0x2faf8d,_0x6b4e('0x3b'));_0x164863[_0x6b4e('0x44')]=_['keys'](_0xe125d7['query']);_0x164863[_0x6b4e('0x45')]=_['intersection'](_0x164863[_0x6b4e('0x43')],_0x164863[_0x6b4e('0x44')]);_0x39097d['attributes']=_[_0x6b4e('0x46')](_0x164863['model'],qs[_0x6b4e('0x47')](_0xe125d7['query'][_0x6b4e('0x47')]));_0x39097d[_0x6b4e('0x48')]=_0x39097d[_0x6b4e('0x48')][_0x6b4e('0x49')]?_0x39097d['attributes']:_0x164863[_0x6b4e('0x43')];if(!_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x4a')]('nolimit')){_0x39097d[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x4b')]);_0x39097d[_0x6b4e('0x31')]=qs[_0x6b4e('0x31')](_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x31')]);}_0x39097d[_0x6b4e('0x4c')]=qs['sort'](_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x4d')]);_0x39097d[_0x6b4e('0x4e')]=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0xe125d7['query'],_0x164863[_0x6b4e('0x45')]),_0x2faf8d);if(_0xe125d7['query'][_0x6b4e('0x50')]){_0x39097d[_0x6b4e('0x4e')]=_[_0x6b4e('0x51')](_0x39097d[_0x6b4e('0x4e')],{'$or':_['map'](_0x2faf8d,function(_0x2fbbc8){if(_0x2fbbc8[_0x6b4e('0x52')]!==_0x6b4e('0x53')){var _0x5b9da3={};_0x5b9da3[_0x2fbbc8[_0x6b4e('0x3b')]]={'$like':'%'+_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x50')]+'%'};return _0x5b9da3;}})});}_0x39097d=_[_0x6b4e('0x51')]({},_0x39097d,_0xe125d7[_0x6b4e('0x54')]);var _0x33c797={'where':_0x39097d[_0x6b4e('0x4e')]};return db[_0x6b4e('0x40')][_0x6b4e('0x33')](_0x33c797)[_0x6b4e('0x21')](function(_0x58a66b){_0x408d66[_0x6b4e('0x33')]=_0x58a66b;if(_0xe125d7[_0x6b4e('0x44')][_0x6b4e('0x55')]){_0x39097d['include']=[{'all':!![]}];}return db[_0x6b4e('0x40')][_0x6b4e('0x56')](_0x39097d);})[_0x6b4e('0x21')](function(_0x738ee5){_0x408d66[_0x6b4e('0x57')]=_0x738ee5;return _0x408d66;})[_0x6b4e('0x21')](respondWithFilteredResult(_0x303507,_0x39097d))[_0x6b4e('0x2c')](handleError(_0x303507,null));};exports[_0x6b4e('0x58')]=function(_0x29eeb8,_0x9e13bf){var _0x61bf8e={'raw':![],'where':{'id':_0x29eeb8['params']['id']},'include':[{'model':db[_0x6b4e('0x3d')],'as':_0x6b4e('0x3e')}]},_0x49f81a={};_0x49f81a[_0x6b4e('0x43')]=_[_0x6b4e('0x59')](db['OpenchannelAccount'][_0x6b4e('0x5a')]);_0x49f81a[_0x6b4e('0x44')]=_[_0x6b4e('0x59')](_0x29eeb8['query']);_0x49f81a[_0x6b4e('0x45')]=_[_0x6b4e('0x46')](_0x49f81a[_0x6b4e('0x43')],_0x49f81a[_0x6b4e('0x44')]);_0x61bf8e[_0x6b4e('0x48')]=_['intersection'](_0x49f81a[_0x6b4e('0x43')],qs['fields'](_0x29eeb8[_0x6b4e('0x44')][_0x6b4e('0x47')]));_0x61bf8e['attributes']=_0x61bf8e[_0x6b4e('0x48')]['length']?_0x61bf8e[_0x6b4e('0x48')]:_0x49f81a[_0x6b4e('0x43')];if(_0x29eeb8[_0x6b4e('0x44')][_0x6b4e('0x55')]){_0x61bf8e[_0x6b4e('0x5b')]=[{'all':!![]}];}_0x61bf8e=_['merge']({},_0x61bf8e,_0x29eeb8[_0x6b4e('0x54')]);return db[_0x6b4e('0x40')][_0x6b4e('0x5c')](_0x61bf8e)['then'](handleEntityNotFound(_0x9e13bf,null))['then'](respondWithResult(_0x9e13bf,null))[_0x6b4e('0x2c')](handleError(_0x9e13bf,null));};exports[_0x6b4e('0x5d')]=function(_0x5d46b9,_0x88b7cc){return db[_0x6b4e('0x40')][_0x6b4e('0x5d')](_0x5d46b9[_0x6b4e('0x5e')],{})[_0x6b4e('0x21')](function(_0x5786f5){var _0x52faab=_0x5d46b9[_0x6b4e('0x5f')][_0x6b4e('0x38')]({'plain':!![]});if(!_0x52faab)throw new Error(_0x6b4e('0x60'));if(_0x52faab[_0x6b4e('0x61')]===_0x6b4e('0x5f')){var _0x2098e5=_0x5786f5[_0x6b4e('0x38')]({'plain':!![]});var _0x3661c5=_0x6b4e('0x39');return db['UserProfileSection'][_0x6b4e('0x5c')]({'where':{'name':_0x3661c5,'userProfileId':_0x52faab[_0x6b4e('0x62')]},'raw':!![]})[_0x6b4e('0x21')](function(_0x5d969f){if(_0x5d969f&&_0x5d969f['autoAssociation']===0x0){return db[_0x6b4e('0x3a')][_0x6b4e('0x5d')]({'name':_0x2098e5[_0x6b4e('0x3b')],'resourceId':_0x2098e5['id'],'type':_0x5d969f[_0x6b4e('0x3b')],'sectionId':_0x5d969f['id']},{})[_0x6b4e('0x21')](function(){return _0x5786f5;});}else{return _0x5786f5;}})['catch'](function(_0x15d205){logger[_0x6b4e('0x28')](_0x6b4e('0x63'),_0x15d205);throw _0x15d205;});}return _0x5786f5;})['then'](respondWithResult(_0x88b7cc,0xc9))[_0x6b4e('0x2c')](handleError(_0x88b7cc,null));};exports[_0x6b4e('0x64')]=function(_0x31e49d,_0x47ace7){if(_0x31e49d[_0x6b4e('0x5e')]['id']){delete _0x31e49d[_0x6b4e('0x5e')]['id'];}return db['OpenchannelAccount'][_0x6b4e('0x5c')]({'where':{'id':_0x31e49d[_0x6b4e('0x65')]['id']},'include':[{'model':db[_0x6b4e('0x3d')],'as':_0x6b4e('0x3e')}]})[_0x6b4e('0x21')](handleEntityNotFound(_0x47ace7,null))[_0x6b4e('0x21')](saveUpdates(_0x31e49d[_0x6b4e('0x5e')],null))['then'](respondWithResult(_0x47ace7,null))[_0x6b4e('0x2c')](handleError(_0x47ace7,null));};exports[_0x6b4e('0x37')]=function(_0x1de27f,_0x13bddb){return db[_0x6b4e('0x40')]['find']({'where':{'id':_0x1de27f[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x13bddb,null))[_0x6b4e('0x21')](removeEntity(_0x13bddb,null))[_0x6b4e('0x2c')](handleError(_0x13bddb,null));};exports[_0x6b4e('0x66')]=function(_0x4ed029,_0xa1246f){return db['OpenchannelAccount'][_0x6b4e('0x66')]()[_0x6b4e('0x21')](respondWithResult(_0xa1246f,null))[_0x6b4e('0x2c')](handleError(_0xa1246f,null));};exports[_0x6b4e('0x67')]=function(_0x55ff77,_0x7d1ce,_0xb14e52){if(_0x55ff77[_0x6b4e('0x5e')]['id']){delete _0x55ff77[_0x6b4e('0x5e')]['id'];}return db[_0x6b4e('0x40')][_0x6b4e('0x5c')]({'where':{'id':_0x55ff77[_0x6b4e('0x65')]['id']}})['then'](handleEntityNotFound(_0x7d1ce,null))['then'](function(_0x4cdc08){if(_0x4cdc08){_0x55ff77[_0x6b4e('0x5e')][_0x6b4e('0x68')]=_0x4cdc08['id'];return db[_0x6b4e('0x69')][_0x6b4e('0x5d')](_0x55ff77[_0x6b4e('0x5e')]);}})[_0x6b4e('0x21')](respondWithResult(_0x7d1ce,null))['catch'](handleError(_0x7d1ce,null));};exports['getDispositions']=function(_0x13d517,_0x22537c,_0xd8d2b2){var _0x266efd={'raw':![],'where':{}};var _0x4aa727={};var _0x116906={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6b4e('0x6a')]({'where':{'id':_0x13d517[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x22537c,null))[_0x6b4e('0x21')](function(_0x4bd8fb){if(_0x4bd8fb){_0x4aa727[_0x6b4e('0x43')]=_['keys'](db[_0x6b4e('0x69')]['rawAttributes']);_0x4aa727[_0x6b4e('0x44')]=_[_0x6b4e('0x59')](_0x13d517['query']);_0x4aa727[_0x6b4e('0x45')]=_['intersection'](_0x4aa727[_0x6b4e('0x43')],_0x4aa727[_0x6b4e('0x44')]);_0x266efd[_0x6b4e('0x48')]=_[_0x6b4e('0x46')](_0x4aa727['model'],qs['fields'](_0x13d517['query'][_0x6b4e('0x47')]));_0x266efd[_0x6b4e('0x48')]=_0x266efd['attributes'][_0x6b4e('0x49')]?_0x266efd[_0x6b4e('0x48')]:_0x4aa727[_0x6b4e('0x43')];if(!_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x4a')](_0x6b4e('0x6b'))){_0x266efd[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x4b')]);_0x266efd[_0x6b4e('0x31')]=qs['offset'](_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x31')]);}_0x266efd[_0x6b4e('0x4c')]=qs[_0x6b4e('0x4d')](_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x4d')]);_0x266efd[_0x6b4e('0x4e')]=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0x13d517['query'],_0x4aa727['filters']));_0x266efd['where']['OpenchannelAccountId']=_0x4bd8fb['id'];if(_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x50')]){_0x266efd[_0x6b4e('0x4e')]=_[_0x6b4e('0x51')](_0x266efd['where'],{'$or':_[_0x6b4e('0x3f')](_0x266efd[_0x6b4e('0x48')],function(_0x5b91ec){var _0x1ad4bb={};_0x1ad4bb[_0x5b91ec]={'$like':'%'+_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x50')]+'%'};return _0x1ad4bb;})});}_0x266efd=_[_0x6b4e('0x51')]({},_0x266efd,_0x13d517['options']);return db[_0x6b4e('0x69')][_0x6b4e('0x33')]({'where':_0x266efd['where']})['then'](function(_0x1dc719){_0x116906['count']=_0x1dc719;if(_0x13d517[_0x6b4e('0x44')][_0x6b4e('0x55')]){_0x266efd['include']=[{'all':!![]}];}return db[_0x6b4e('0x69')][_0x6b4e('0x56')](_0x266efd);})[_0x6b4e('0x21')](function(_0xae3060){_0x116906[_0x6b4e('0x57')]=_0xae3060;return _0x116906;});}})['then'](respondWithFilteredResult(_0x22537c,_0x266efd))['catch'](handleError(_0x22537c,null));};exports[_0x6b4e('0x6c')]=function(_0x378b38,_0xeb573c,_0x3b6f52){return db[_0x6b4e('0x40')][_0x6b4e('0x5c')]({'where':{'id':_0x378b38[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0xeb573c,null))[_0x6b4e('0x21')](function(_0x5b5910){if(_0x5b5910){return _0x5b5910[_0x6b4e('0x6c')](_0x378b38[_0x6b4e('0x44')][_0x6b4e('0x6d')]);}})[_0x6b4e('0x21')](respondWithStatusCode(_0xeb573c,null))[_0x6b4e('0x2c')](handleError(_0xeb573c,null));};exports[_0x6b4e('0x6e')]=function(_0x177052,_0x38e55f,_0x275b98){if(_0x177052[_0x6b4e('0x5e')]['id']){delete _0x177052[_0x6b4e('0x5e')]['id'];}return db[_0x6b4e('0x40')]['find']({'where':{'id':_0x177052['params']['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x38e55f,null))[_0x6b4e('0x21')](function(_0x3e905d){if(_0x3e905d){_0x177052[_0x6b4e('0x5e')][_0x6b4e('0x68')]=_0x3e905d['id'];return db['CannedAnswer'][_0x6b4e('0x5d')](_0x177052[_0x6b4e('0x5e')]);}})[_0x6b4e('0x21')](respondWithResult(_0x38e55f,null))['catch'](handleError(_0x38e55f,null));};exports[_0x6b4e('0x6f')]=function(_0x1716c6,_0x8253ab,_0x235fd4){var _0x11317c={'raw':![],'where':{}};var _0x44737f={};var _0x1f3e29={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6b4e('0x6a')]({'where':{'id':_0x1716c6[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x8253ab,null))['then'](function(_0x5c4db2){if(_0x5c4db2){_0x44737f['model']=_[_0x6b4e('0x59')](db['CannedAnswer'][_0x6b4e('0x5a')]);_0x44737f[_0x6b4e('0x44')]=_[_0x6b4e('0x59')](_0x1716c6[_0x6b4e('0x44')]);_0x44737f[_0x6b4e('0x45')]=_[_0x6b4e('0x46')](_0x44737f[_0x6b4e('0x43')],_0x44737f['query']);_0x11317c[_0x6b4e('0x48')]=_['intersection'](_0x44737f['model'],qs[_0x6b4e('0x47')](_0x1716c6[_0x6b4e('0x44')][_0x6b4e('0x47')]));_0x11317c['attributes']=_0x11317c[_0x6b4e('0x48')]['length']?_0x11317c[_0x6b4e('0x48')]:_0x44737f[_0x6b4e('0x43')];if(!_0x1716c6[_0x6b4e('0x44')][_0x6b4e('0x4a')](_0x6b4e('0x6b'))){_0x11317c[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0x1716c6[_0x6b4e('0x44')]['limit']);_0x11317c[_0x6b4e('0x31')]=qs['offset'](_0x1716c6[_0x6b4e('0x44')]['offset']);}_0x11317c[_0x6b4e('0x4c')]=qs['sort'](_0x1716c6[_0x6b4e('0x44')][_0x6b4e('0x4d')]);_0x11317c[_0x6b4e('0x4e')]=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0x1716c6[_0x6b4e('0x44')],_0x44737f[_0x6b4e('0x45')]));_0x11317c[_0x6b4e('0x4e')][_0x6b4e('0x68')]=_0x5c4db2['id'];if(_0x1716c6[_0x6b4e('0x44')][_0x6b4e('0x50')]){_0x11317c[_0x6b4e('0x4e')]=_[_0x6b4e('0x51')](_0x11317c[_0x6b4e('0x4e')],{'$or':_[_0x6b4e('0x3f')](_0x11317c[_0x6b4e('0x48')],function(_0x514f07){var _0xe833ac={};_0xe833ac[_0x514f07]={'$like':'%'+_0x1716c6['query'][_0x6b4e('0x50')]+'%'};return _0xe833ac;})});}_0x11317c=_['merge']({},_0x11317c,_0x1716c6[_0x6b4e('0x54')]);return db[_0x6b4e('0x70')][_0x6b4e('0x33')]({'where':_0x11317c[_0x6b4e('0x4e')]})['then'](function(_0x20ff58){_0x1f3e29[_0x6b4e('0x33')]=_0x20ff58;if(_0x1716c6[_0x6b4e('0x44')][_0x6b4e('0x55')]){_0x11317c['include']=[{'all':!![]}];}return db[_0x6b4e('0x70')]['findAll'](_0x11317c);})[_0x6b4e('0x21')](function(_0x14c8dd){_0x1f3e29[_0x6b4e('0x57')]=_0x14c8dd;return _0x1f3e29;});}})[_0x6b4e('0x21')](respondWithFilteredResult(_0x8253ab,_0x11317c))[_0x6b4e('0x2c')](handleError(_0x8253ab,null));};exports[_0x6b4e('0x71')]=function(_0x45b7b7,_0x3a8709,_0x3f8562){return db[_0x6b4e('0x40')][_0x6b4e('0x5c')]({'where':{'id':_0x45b7b7[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x3a8709,null))[_0x6b4e('0x21')](function(_0x2afb85){if(_0x2afb85){return _0x2afb85[_0x6b4e('0x71')](_0x45b7b7['query'][_0x6b4e('0x6d')]);}})[_0x6b4e('0x21')](respondWithStatusCode(_0x3a8709,null))[_0x6b4e('0x2c')](handleError(_0x3a8709,null));};exports[_0x6b4e('0x72')]=function(_0x529cfe,_0x1855eb,_0x7cc5a6){var _0x241a96={'body':_0x529cfe['body'],'channel':_0x6b4e('0x73')};var _0x186bf8=[];var _0x3c7b22=[];var _0x44bfe1={};var _0x4a864f=![];return db['CmContact'][_0x6b4e('0x66')]()[_0x6b4e('0x21')](function(_0x4f2a1b){if(!_0x4f2a1b){throw new db[(_0x6b4e('0x74'))][(_0x6b4e('0x75'))](_0x6b4e('0x76'));}_0x186bf8=_[_0x6b4e('0x77')](_[_0x6b4e('0x59')](_0x4f2a1b),[_0x6b4e('0x78'),'updatedAt']);_0x3c7b22=_[_0x6b4e('0x77')](_[_0x6b4e('0x59')](_0x4f2a1b),[_0x6b4e('0x78'),_0x6b4e('0x79'),_0x6b4e('0x7a'),_0x6b4e('0x7b')]);if(_0x529cfe[_0x6b4e('0x5e')]['id']){delete _0x529cfe[_0x6b4e('0x5e')]['id'];}if(_[_0x6b4e('0x7c')](_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x7d')])){throw new db['Sequelize'][(_0x6b4e('0x75'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x5e')])||_0x529cfe['body']['body']===''){throw new db[(_0x6b4e('0x74'))][(_0x6b4e('0x75'))](_0x6b4e('0x7e'));}if(_[_0x6b4e('0x7c')](_0x529cfe[_0x6b4e('0x5e')]['mapKey'])){throw new db[(_0x6b4e('0x74'))][(_0x6b4e('0x75'))](_0x6b4e('0x7f')+_0x3c7b22);}if(!_[_0x6b4e('0x80')](_0x3c7b22,_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x81')])){throw new db[(_0x6b4e('0x74'))][(_0x6b4e('0x75'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c7b22);}_0x44bfe1[_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x81')]]=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x7d')];})[_0x6b4e('0x21')](function(){return db[_0x6b4e('0x40')][_0x6b4e('0x5c')]({'where':{'id':_0x529cfe[_0x6b4e('0x65')]['id']},'include':[{'model':db[_0x6b4e('0x82')],'as':_0x6b4e('0x83'),'include':[{'model':db['CmContact'],'as':_0x6b4e('0x84'),'where':_0x44bfe1,'limit':0x1,'order':[[_0x6b4e('0x79'),_0x6b4e('0x85')]]}]},{'model':db[_0x6b4e('0x86')],'as':'Applications'}]});})[_0x6b4e('0x21')](handleEntityNotFound(_0x1855eb,null))['then'](function(_0x29b437){if(_0x29b437&&_0x29b437[_0x6b4e('0x83')]){_0x241a96[_0x6b4e('0x87')]=_0x29b437;_0x241a96[_0x6b4e('0x88')]=_0x29b437[_0x6b4e('0x89')];_0x241a96[_0x6b4e('0x8a')]=_0x29b437[_0x6b4e('0x83')];_0x241a96[_0x6b4e('0x88')]=_[_0x6b4e('0x8b')](_0x241a96['applications'],[_0x6b4e('0x8c')],['asc']);if(_0x241a96['account'][_0x6b4e('0x89')]){delete _0x241a96[_0x6b4e('0x87')]['Applications'];}if(_0x241a96[_0x6b4e('0x87')][_0x6b4e('0x83')]&&_0x241a96[_0x6b4e('0x87')]['List'][_0x6b4e('0x84')][_0x6b4e('0x49')]){return _0x241a96[_0x6b4e('0x87')][_0x6b4e('0x83')][_0x6b4e('0x84')][0x0];}var _0x2a9ee1=_[_0x6b4e('0x19')](_0x529cfe[_0x6b4e('0x5e')],{'firstName':_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x7d')],'ListId':_0x29b437['ListId']});_0x2a9ee1[_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x81')]]=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x7d')];return db[_0x6b4e('0x8d')][_0x6b4e('0x5d')](_0x2a9ee1,{'fields':_0x186bf8,'raw':!![]});}})[_0x6b4e('0x21')](handleEntityNotFound(_0x1855eb,null))[_0x6b4e('0x21')](function(_0x47dfe5){_0x241a96[_0x6b4e('0x8e')]=_0x47dfe5;if(_0x47dfe5){var _0x5b7ac7={'ContactId':_0x47dfe5['id'],'OpenchannelAccountId':_0x529cfe[_0x6b4e('0x65')]['id'],'from':(_0x47dfe5[_0x6b4e('0x8f')]||'')+'\x20'+(_0x47dfe5[_0x6b4e('0x90')]||'')};var _0x552873={'OpenchannelAccountId':_0x529cfe[_0x6b4e('0x65')]['id'],'closed':![]};if(_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x91')]){_0x552873[_0x6b4e('0x91')]=_0x529cfe['body']['threadId'];return db['OpenchannelInteraction'][_0x6b4e('0x5c')]({'where':_0x552873})['then'](function(_0x2ba4e2){if(_0x2ba4e2){return[_0x2ba4e2,![]];}_0x5b7ac7[_0x6b4e('0x91')]=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x91')];_0x5b7ac7['externalUrl']=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x92')];return db[_0x6b4e('0x93')][_0x6b4e('0x5d')](_0x5b7ac7)[_0x6b4e('0x21')](function(_0x5844fc){return[_0x5844fc,!![]];});});}else{_0x552873[_0x6b4e('0x91')]=null;}_0x552873['ContactId']=_0x47dfe5['id'];return db[_0x6b4e('0x93')][_0x6b4e('0x5c')]({'where':_0x552873})['then'](function(_0x1bf1e0){if(_0x1bf1e0){return[_0x1bf1e0,![]];}return db[_0x6b4e('0x93')]['create'](_0x5b7ac7)[_0x6b4e('0x21')](function(_0x56fbd4){return[_0x56fbd4,!![]];});});}})[_0x6b4e('0x94')](function(_0x51172e,_0x448439){if(_0x51172e){_0x4a864f=_0x448439;if(!_0x448439){var _0x247b27={'from':(_0x241a96[_0x6b4e('0x8e')]['firstName']||'')+'\x20'+(_0x241a96[_0x6b4e('0x8e')]['lastName']||'')};if(_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x91')]&&_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x95')]&&_0x529cfe['body'][_0x6b4e('0x91')]!=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x95')]){_0x247b27[_0x6b4e('0x91')]=_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x95')];}return _0x51172e[_0x6b4e('0x64')](_0x247b27);}else{return _0x51172e;}}})['then'](function(_0x4f6338){_0x241a96[_0x6b4e('0x96')]=_0x4f6338['get']({'plain':!![]});_0x241a96[_0x6b4e('0x96')][_0x6b4e('0x97')]=_0x4a864f;if(_0x241a96['interaction'][_0x6b4e('0x97')]){if(_0x241a96[_0x6b4e('0x87')][_0x6b4e('0x98')]){_0x241a96[_0x6b4e('0x88')][_0x6b4e('0x99')]({'id':0x0,'priority':_0x241a96[_0x6b4e('0x88')][_0x6b4e('0x49')]+0x1,'app':_0x6b4e('0x9a'),'appdata':'unmanaged','interval':_0x6b4e('0x9b')});}}return db[_0x6b4e('0x9c')][_0x6b4e('0x5d')]({'body':_0x529cfe[_0x6b4e('0x5e')]['body'],'OpenchannelAccountId':_0x529cfe['params']['id'],'OpenchannelInteractionId':_0x4f6338['id'],'direction':'in','ContactId':_0x241a96[_0x6b4e('0x8e')]['id'],'AttachmentId':_0x529cfe[_0x6b4e('0x5e')][_0x6b4e('0x9d')]});})['then'](function(_0x1524c0){_0x241a96[_0x6b4e('0x2a')]=_0x1524c0;if(_0x241a96[_0x6b4e('0x96')][_0x6b4e('0x9e')]){return db['User'][_0x6b4e('0x5c')]({'attributes':['id',_0x6b4e('0x3b')],'where':{'id':_0x241a96[_0x6b4e('0x96')][_0x6b4e('0x9e')]}})[_0x6b4e('0x21')](function(_0x428ea7){if(_0x428ea7){_0x241a96[_0x6b4e('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x428ea7[_0x6b4e('0x3b')]+','+(_0x241a96[_0x6b4e('0x87')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x241a96[_0x6b4e('0x9f')]=![];}return respondWithRpcPromise('Start',_0x6b4e('0xa0'),_0x241a96);});}return respondWithRpcPromise(_0x6b4e('0xa1'),_0x6b4e('0xa0'),_0x241a96);})[_0x6b4e('0x21')](function(_0x11264f){respondWithRpcPromise(_0x6b4e('0xa2'),_0x6b4e('0xa2'),{'event':_0x6b4e('0x72'),'message':_0x11264f},client9002);return _0x11264f;})['then'](respondWithResult(_0x1855eb,null))[_0x6b4e('0x2c')](handleError(_0x1855eb,null));};exports[_0x6b4e('0xa3')]=function(_0x2d50b3,_0x116e0b){var _0x983462=_0x2d50b3[_0x6b4e('0x65')]['id'];var _0x1b97f6=_0x2d50b3[_0x6b4e('0x5e')];var _0x1e592a=0xc8;var _0x5f3d05=null;return db['sequelize'][_0x6b4e('0xa4')]({'isolationLevel':db['sequelize'][_0x6b4e('0xa5')][_0x6b4e('0xa6')]['READ_COMMITTED']},function(_0x36480c){return db[_0x6b4e('0x40')][_0x6b4e('0x6a')]({'where':{'id':_0x983462},'transaction':_0x36480c})[_0x6b4e('0x21')](function(_0x389432){if(_0x389432){return db[_0x6b4e('0x86')]['destroy']({'where':{'OpenchannelAccountId':_0x983462},'transaction':_0x36480c})['then'](function(){var _0x29cef3=_[_0x6b4e('0x3f')](_0x1b97f6,function(_0x29a6e5){_0x29a6e5[_0x6b4e('0x68')]=_0x983462;return _0x29a6e5;});return db['OpenchannelApplication'][_0x6b4e('0xa7')](_0x29cef3,{'transaction':_0x36480c});});}else{_0x1e592a=0x194;_0x5f3d05=[];}});})[_0x6b4e('0x21')](function(){if(_0x1e592a!==0x194){return db[_0x6b4e('0x86')][_0x6b4e('0xa8')]({'where':{'OpenchannelAccountId':_0x983462},'order':_0x6b4e('0x8c')})[_0x6b4e('0x21')](function(_0x299d81){_0x5f3d05=_0x299d81;});}})[_0x6b4e('0x2c')](function(_0x4ef656){_0x1e592a=0x1f4;logger[_0x6b4e('0x28')](_0x4ef656['stack']);if(_0x4ef656[_0x6b4e('0x3b')]){delete _0x4ef656[_0x6b4e('0x3b')];}_0x5f3d05=_0x4ef656;})['finally'](function(){if(_0x5f3d05===null){_0x116e0b['sendStatus'](_0x1e592a);}else{if(_0x1e592a===0x1f4){_0x116e0b['status'](_0x1e592a)[_0x6b4e('0xa9')](_0x5f3d05);}else{_0x116e0b[_0x6b4e('0x2e')](_0x1e592a)['json'](_0x5f3d05);}}});};exports[_0x6b4e('0xaa')]=function(_0x4d6589,_0x414d80,_0x187e23){var _0x290517={};var _0x228fe4={};var _0x3be671;var _0x3c32a0;return db['OpenchannelAccount'][_0x6b4e('0x6a')]({'where':{'id':_0x4d6589[_0x6b4e('0x65')]['id']}})['then'](handleEntityNotFound(_0x414d80,null))['then'](function(_0x38a168){if(_0x38a168){_0x3be671=_0x38a168;_0x228fe4[_0x6b4e('0x43')]=_[_0x6b4e('0x59')](db['OpenchannelApplication']['rawAttributes']);_0x228fe4[_0x6b4e('0x44')]=_['keys'](_0x4d6589[_0x6b4e('0x44')]);_0x228fe4[_0x6b4e('0x45')]=_[_0x6b4e('0x46')](_0x228fe4['model'],_0x228fe4[_0x6b4e('0x44')]);_0x290517[_0x6b4e('0x48')]=_[_0x6b4e('0x46')](_0x228fe4[_0x6b4e('0x43')],qs['fields'](_0x4d6589[_0x6b4e('0x44')][_0x6b4e('0x47')]));_0x290517[_0x6b4e('0x48')]=_0x290517[_0x6b4e('0x48')][_0x6b4e('0x49')]?_0x290517[_0x6b4e('0x48')]:_0x228fe4[_0x6b4e('0x43')];_0x290517['order']=qs[_0x6b4e('0x4d')](_0x4d6589[_0x6b4e('0x44')][_0x6b4e('0x4d')]);_0x290517['where']=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0x4d6589[_0x6b4e('0x44')],_0x228fe4['filters']));if(_0x4d6589[_0x6b4e('0x44')][_0x6b4e('0x50')]){_0x290517['where']=_['merge'](_0x290517[_0x6b4e('0x4e')],{'$or':_[_0x6b4e('0x3f')](_0x290517['attributes'],function(_0x3e99b6){var _0x4bce21={};_0x4bce21[_0x3e99b6]={'$like':'%'+_0x4d6589[_0x6b4e('0x44')]['filter']+'%'};return _0x4bce21;})});}_0x290517=_[_0x6b4e('0x51')]({},_0x290517,_0x4d6589[_0x6b4e('0x54')]);return _0x3be671['getApplications'](_0x290517);}})[_0x6b4e('0x21')](function(_0x32b821){if(_0x32b821){_0x3c32a0=_0x32b821['length'];if(!_0x4d6589[_0x6b4e('0x44')][_0x6b4e('0x4a')]('nolimit')){_0x290517[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0x4d6589[_0x6b4e('0x44')][_0x6b4e('0x4b')]);_0x290517[_0x6b4e('0x31')]=qs[_0x6b4e('0x31')](_0x4d6589['query']['offset']);}return _0x3be671[_0x6b4e('0xaa')](_0x290517);}})[_0x6b4e('0x21')](function(_0x30383d){if(_0x30383d){return _0x30383d?{'count':_0x3c32a0,'rows':_0x30383d}:null;}})[_0x6b4e('0x21')](respondWithResult(_0x414d80,null))[_0x6b4e('0x2c')](handleError(_0x414d80,null));};exports[_0x6b4e('0xab')]=function(_0x1b4066,_0x49ef42,_0x12ed2a){var _0x3d80c0={'raw':![],'where':{}};var _0x4e9d52={};var _0x423175={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6b4e('0x6a')]({'where':{'id':_0x1b4066[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x49ef42,null))[_0x6b4e('0x21')](function(_0x479c8e){if(_0x479c8e){_0x4e9d52[_0x6b4e('0x43')]=_['keys'](db[_0x6b4e('0x93')][_0x6b4e('0x5a')]);_0x4e9d52[_0x6b4e('0x44')]=_[_0x6b4e('0x59')](_0x1b4066[_0x6b4e('0x44')]);_0x4e9d52[_0x6b4e('0x45')]=_[_0x6b4e('0x46')](_0x4e9d52[_0x6b4e('0x43')],_0x4e9d52['query']);_0x3d80c0['attributes']=_[_0x6b4e('0x46')](_0x4e9d52[_0x6b4e('0x43')],qs['fields'](_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x47')]));_0x3d80c0[_0x6b4e('0x48')]=_0x3d80c0[_0x6b4e('0x48')]['length']?_0x3d80c0[_0x6b4e('0x48')]:_0x4e9d52[_0x6b4e('0x43')];if(!_0x1b4066['query'][_0x6b4e('0x4a')](_0x6b4e('0x6b'))){_0x3d80c0[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x4b')]);_0x3d80c0[_0x6b4e('0x31')]=qs['offset'](_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x31')]);}_0x3d80c0[_0x6b4e('0x4c')]=qs['sort'](_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x4d')]);_0x3d80c0['where']=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0x1b4066[_0x6b4e('0x44')],_0x4e9d52['filters']));_0x3d80c0[_0x6b4e('0x4e')][_0x6b4e('0x68')]=_0x479c8e['id'];if(_0x1b4066[_0x6b4e('0x44')]['filter']){_0x3d80c0[_0x6b4e('0x4e')]=_[_0x6b4e('0x51')](_0x3d80c0[_0x6b4e('0x4e')],{'$or':_[_0x6b4e('0x3f')](_0x3d80c0['attributes'],function(_0x29e652){var _0x5a031a={};_0x5a031a[_0x29e652]={'$like':'%'+_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x50')]+'%'};return _0x5a031a;})});}_0x3d80c0=_[_0x6b4e('0x51')]({},_0x3d80c0,_0x1b4066[_0x6b4e('0x54')]);return db[_0x6b4e('0x93')][_0x6b4e('0x33')]({'where':_0x3d80c0[_0x6b4e('0x4e')]})[_0x6b4e('0x21')](function(_0x5a812f){_0x423175[_0x6b4e('0x33')]=_0x5a812f;if(_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0x55')]){_0x3d80c0[_0x6b4e('0x5b')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x6b4e('0xac')],'as':'Owner','attributes':[_0x6b4e('0x3b'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x6b4e('0xad'),'attributes':['id',_0x6b4e('0x3b'),_0x6b4e('0xae')],'where':_0x1b4066['query'][_0x6b4e('0xaf')]?{'id':_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0xaf')]}:undefined,'required':_0x1b4066[_0x6b4e('0x44')][_0x6b4e('0xaf')]?!![]:![]}];}return db[_0x6b4e('0x93')][_0x6b4e('0x56')](_0x3d80c0);})[_0x6b4e('0x21')](function(_0x41788a){_0x423175['rows']=_0x41788a;return _0x423175;});}})[_0x6b4e('0x21')](respondWithFilteredResult(_0x49ef42,_0x3d80c0))['catch'](handleError(_0x49ef42,null));};exports[_0x6b4e('0xb0')]=function(_0x43e792,_0x12f139,_0x24d955){return db[_0x6b4e('0x40')][_0x6b4e('0x5c')]({'where':{'id':_0x43e792['params']['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x12f139,null))[_0x6b4e('0x21')](function(_0x1224af){if(_0x1224af){return _0x1224af[_0x6b4e('0xb0')](_0x43e792[_0x6b4e('0x5e')][_0x6b4e('0x6d')],_['omit'](_0x43e792[_0x6b4e('0x5e')],[_0x6b4e('0x6d'),'id'])||{})[_0x6b4e('0x94')](function(_0x4344dd){for(var _0x55555a=0x0;_0x55555a<_0x43e792['body']['ids'][_0x6b4e('0x49')];_0x55555a+=0x1){socket[_0x6b4e('0xb1')](_0x6b4e('0xb2'),{'UserId':Number(_0x43e792[_0x6b4e('0x5e')][_0x6b4e('0x6d')][_0x55555a]),'OpenchannelAccountId':Number(_0x43e792[_0x6b4e('0x65')]['id'])});}return _0x4344dd;});}})['then'](respondWithResult(_0x12f139,null))[_0x6b4e('0x2c')](handleError(_0x12f139,null));};exports[_0x6b4e('0xb3')]=function(_0x5c77a7,_0x5872cd,_0x3ab2a3){return db['OpenchannelAccount'][_0x6b4e('0x5c')]({'where':{'id':_0x5c77a7['params']['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x5872cd,null))['then'](function(_0x4c344f){if(_0x4c344f){return _0x4c344f[_0x6b4e('0xb3')](_0x5c77a7['query'][_0x6b4e('0x6d')])['then'](function(){if(_[_0x6b4e('0xb4')](_0x5c77a7[_0x6b4e('0x44')][_0x6b4e('0x6d')])){for(var _0x24a43c=0x0;_0x24a43c<_0x5c77a7['query'][_0x6b4e('0x6d')][_0x6b4e('0x49')];_0x24a43c+=0x1){socket[_0x6b4e('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5c77a7['query'][_0x6b4e('0x6d')][_0x24a43c]),'OpenchannelAccountId':Number(_0x5c77a7['params']['id'])});}}else{socket[_0x6b4e('0xb1')](_0x6b4e('0xb5'),{'UserId':Number(_0x5c77a7['query']['ids']),'OpenchannelAccountId':Number(_0x5c77a7[_0x6b4e('0x65')]['id'])});}});}})[_0x6b4e('0x21')](respondWithStatusCode(_0x5872cd,null))[_0x6b4e('0x2c')](handleError(_0x5872cd,null));};exports['getAgents']=function(_0x4e4692,_0x1c10d7,_0x3790a6){var _0x505f03={};var _0x324a={};var _0x4b533f;var _0x43e75a;return db['OpenchannelAccount'][_0x6b4e('0x6a')]({'where':{'id':_0x4e4692[_0x6b4e('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c10d7,null))[_0x6b4e('0x21')](function(_0x5a5330){if(_0x5a5330){_0x4b533f=_0x5a5330;_0x324a[_0x6b4e('0x43')]=_[_0x6b4e('0x59')](db[_0x6b4e('0xac')]['rawAttributes']);_0x324a['query']=_[_0x6b4e('0x59')](_0x4e4692[_0x6b4e('0x44')]);_0x324a['filters']=_[_0x6b4e('0x46')](_0x324a[_0x6b4e('0x43')],_0x324a['query']);_0x505f03[_0x6b4e('0x48')]=_[_0x6b4e('0x46')](_0x324a[_0x6b4e('0x43')],qs[_0x6b4e('0x47')](_0x4e4692[_0x6b4e('0x44')][_0x6b4e('0x47')]));_0x505f03[_0x6b4e('0x48')]=_0x505f03[_0x6b4e('0x48')]['length']?_0x505f03['attributes']:_0x324a[_0x6b4e('0x43')];_0x505f03[_0x6b4e('0x4c')]=qs['sort'](_0x4e4692['query'][_0x6b4e('0x4d')]);_0x505f03[_0x6b4e('0x4e')]=qs[_0x6b4e('0x45')](_[_0x6b4e('0x4f')](_0x4e4692[_0x6b4e('0x44')],_0x324a[_0x6b4e('0x45')]));if(_0x4e4692[_0x6b4e('0x44')][_0x6b4e('0x50')]){_0x505f03[_0x6b4e('0x4e')]=_[_0x6b4e('0x51')](_0x505f03[_0x6b4e('0x4e')],{'$or':_['map'](_0x505f03[_0x6b4e('0x48')],function(_0x525de4){var _0x2f7464={};_0x2f7464[_0x525de4]={'$like':'%'+_0x4e4692[_0x6b4e('0x44')][_0x6b4e('0x50')]+'%'};return _0x2f7464;})});}_0x505f03=_[_0x6b4e('0x51')]({},_0x505f03,_0x4e4692['options']);return _0x4b533f[_0x6b4e('0xb6')](_0x505f03);}})[_0x6b4e('0x21')](function(_0x3242){if(_0x3242){_0x43e75a=_0x3242[_0x6b4e('0x49')];if(!_0x4e4692[_0x6b4e('0x44')][_0x6b4e('0x4a')](_0x6b4e('0x6b'))){_0x505f03[_0x6b4e('0x4b')]=qs[_0x6b4e('0x4b')](_0x4e4692['query'][_0x6b4e('0x4b')]);_0x505f03['offset']=qs[_0x6b4e('0x31')](_0x4e4692['query'][_0x6b4e('0x31')]);}return _0x4b533f[_0x6b4e('0xb6')](_0x505f03);}})[_0x6b4e('0x21')](function(_0x5e9fe3){if(_0x5e9fe3){return _0x5e9fe3?{'count':_0x43e75a,'rows':_0x5e9fe3}:null;}})[_0x6b4e('0x21')](respondWithResult(_0x1c10d7,null))[_0x6b4e('0x2c')](handleError(_0x1c10d7,null));};exports[_0x6b4e('0xa9')]=function(_0x47f6bd,_0x3c41c4,_0x5f4867){var _0x3f1e2b,_0x283183,_0x4b2052;if(_['isNil'](_0x47f6bd[_0x6b4e('0x5e')]['body'])||_0x47f6bd[_0x6b4e('0x5e')][_0x6b4e('0x5e')]===''){throw new db['Sequelize'][(_0x6b4e('0x75'))](_0x6b4e('0x7e'));}if(_['isNil'](_0x47f6bd[_0x6b4e('0x5e')]['to'])){}_0x3f1e2b=_0x47f6bd[_0x6b4e('0x5e')]['to'];return db[_0x6b4e('0x40')][_0x6b4e('0x6a')]({'where':{'id':_0x47f6bd[_0x6b4e('0x65')]['id']}})[_0x6b4e('0x21')](handleEntityNotFound(_0x3c41c4,null))[_0x6b4e('0x21')](function(_0x40f430){if(_0x40f430){return db[_0x6b4e('0x40')]['find']({'where':{'id':_0x40f430['id']},'include':[{'model':db['CmList'],'as':_0x6b4e('0x83'),'include':[{'model':db[_0x6b4e('0x8d')],'as':_0x6b4e('0x84'),'where':{[_0x40f430['mapKey']]:_0x3f1e2b},'limit':0x1,'order':[[_0x6b4e('0x79'),_0x6b4e('0x85')]]}]}]})[_0x6b4e('0x21')](handleEntityNotFound(_0x3c41c4,null))[_0x6b4e('0x21')](function(_0x3b55e6){if(_0x3b55e6&&_0x3b55e6[_0x6b4e('0x83')]){_0x283183=_0x3b55e6[_0x6b4e('0x38')]({'plain':!![]});if(_0x283183['List']&&_0x283183[_0x6b4e('0x83')][_0x6b4e('0x84')][_0x6b4e('0x49')]){return _0x283183[_0x6b4e('0x83')][_0x6b4e('0x84')][0x0];}return db[_0x6b4e('0x8d')][_0x6b4e('0x5d')](_[_0x6b4e('0x19')](_0x47f6bd[_0x6b4e('0x5e')],{'firstName':_0x3f1e2b,[_0x3b55e6[_0x6b4e('0x81')]]:_0x3f1e2b,'phone':_0x3f1e2b,'ListId':_0x283183[_0x6b4e('0x7b')]}));}})[_0x6b4e('0x21')](handleEntityNotFound(_0x3c41c4,null))[_0x6b4e('0x21')](function(_0x2deec5){if(_0x2deec5){_0x4b2052=_0x2deec5;return db[_0x6b4e('0x93')][_0x6b4e('0x5c')]({'where':{'ContactId':_0x4b2052['id'],'closed':![],'OpenchannelAccountId':_0x283183['id']}})[_0x6b4e('0x21')](function(_0x5c1f93){if(_0x5c1f93){return[_0x5c1f93,![]];}return db['OpenchannelInteraction'][_0x6b4e('0x5d')]({'UserId':_0x47f6bd[_0x6b4e('0x5f')]['id'],'ContactId':_0x4b2052['id'],'OpenchannelAccountId':_0x283183['id'],'lastMsgDirection':_0x6b4e('0xb7'),'firstMsgDirection':_0x6b4e('0xb7'),'Messages':[_[_0x6b4e('0x51')](_0x47f6bd[_0x6b4e('0x5e')],{'read':![],'body':_0x47f6bd[_0x6b4e('0x5e')][_0x6b4e('0x5e')],'OpenchannelAccountId':_0x283183['id'],'UserId':_0x47f6bd[_0x6b4e('0x5f')]['id'],'ContactId':_0x4b2052['id']})]},{'include':[{'model':db[_0x6b4e('0x9c')],'as':_0x6b4e('0xb8')}]})[_0x6b4e('0x21')](function(_0x2d9b47){return[_0x2d9b47,!![]];});});}})[_0x6b4e('0x94')](function(_0x42206d,_0x431b6d){if(_0x431b6d){return _0x42206d;}return db[_0x6b4e('0x9c')][_0x6b4e('0x5d')](_[_0x6b4e('0x51')](_0x47f6bd['body'],{'read':![],'body':_0x47f6bd['body'][_0x6b4e('0x5e')],'OpenchannelAccountId':_0x283183['id'],'OpenchannelInteractionId':_0x42206d['id'],'UserId':_0x47f6bd[_0x6b4e('0x5f')]['id'],'ContactId':_0x4b2052['id']}))[_0x6b4e('0x21')](function(_0x49f481){_0x42206d[_0x6b4e('0xb9')][_0x6b4e('0xb8')]=[];_0x42206d[_0x6b4e('0xb9')][_0x6b4e('0xb8')]['push'](_0x49f481[_0x6b4e('0xb9')]);return _0x42206d;});});}})['then'](respondWithResult(_0x3c41c4,null))[_0x6b4e('0x2c')](handleError(_0x3c41c4,null));}; \ No newline at end of file +var _0x9181=['getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','then','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','OpenchannelAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','OpenchannelAccount','findAll','show','params','include','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','rows','removeAnswers','notify','CmContact','ValidationError','difference','createdAt','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','updatedAt','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','contact','firstName','threadId','OpenchannelInteraction','externalUrl','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','EventManager','addApplications','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','userOpenchannelAccount:remove'];(function(_0x1f3d3f,_0x582dbb){var _0xcee75d=function(_0x5e12d1){while(--_0x5e12d1){_0x1f3d3f['push'](_0x1f3d3f['shift']());}};_0xcee75d(++_0x582dbb);}(_0x9181,0x182));var _0x1918=function(_0x55900c,_0x11ccee){_0x55900c=_0x55900c-0x0;var _0x199266=_0x9181[_0x55900c];return _0x199266;};'use strict';var emlformat=require(_0x1918('0x0'));var rimraf=require(_0x1918('0x1'));var zipdir=require(_0x1918('0x2'));var jsonpatch=require(_0x1918('0x3'));var rp=require(_0x1918('0x4'));var moment=require('moment');var BPromise=require(_0x1918('0x5'));var Mustache=require('mustache');var util=require(_0x1918('0x6'));var path=require(_0x1918('0x7'));var sox=require(_0x1918('0x8'));var csv=require(_0x1918('0x9'));var ejs=require(_0x1918('0xa'));var fs=require('fs');var fs_extra=require(_0x1918('0xb'));var _=require('lodash');var squel=require(_0x1918('0xc'));var crypto=require('crypto');var jsforce=require(_0x1918('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1918('0x9'));var querystring=require(_0x1918('0xe'));var Papa=require(_0x1918('0xf'));var Redis=require(_0x1918('0x10'));var authService=require(_0x1918('0x11'));var qs=require(_0x1918('0x12'));var as=require(_0x1918('0x13'));var hardwareService=require(_0x1918('0x14'));var logger=require(_0x1918('0x15'))(_0x1918('0x16'));var utils=require(_0x1918('0x17'));var config=require(_0x1918('0x18'));var licenseUtil=require(_0x1918('0x19'));var db=require('../../mysqldb')['db'];config[_0x1918('0x1a')]=_[_0x1918('0x1b')](config[_0x1918('0x1a')],{'host':_0x1918('0x1c'),'port':0x18eb});var socket=require(_0x1918('0x1d'))(new Redis(config[_0x1918('0x1a')]));require(_0x1918('0x1e'))['register'](socket);var jayson=require(_0x1918('0x1f'));var client=jayson[_0x1918('0x20')][_0x1918('0x21')]({'port':0x232c});var client9002=jayson[_0x1918('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dafec,_0x4947b5,_0x193305,_0x844035){return new BPromise(function(_0x303245,_0x5845c4){var _0x52087d=_0x844035||client;return _0x52087d['request'](_0x5dafec,_0x193305)[_0x1918('0x22')](function(_0x3df504){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4947b5,'request\x20sent');logger[_0x1918('0x23')](_0x1918('0x24'),_0x4947b5,_0x1918('0x25'),JSON['stringify'](_0x3df504));if(_0x3df504[_0x1918('0x26')]){if(_0x3df504[_0x1918('0x26')][_0x1918('0x27')]===0x1f4){logger[_0x1918('0x26')](_0x1918('0x28'),_0x4947b5,_0x3df504[_0x1918('0x26')][_0x1918('0x29')]);return _0x5845c4(_0x3df504['error'][_0x1918('0x29')]);}logger[_0x1918('0x26')](_0x1918('0x28'),_0x4947b5,_0x3df504[_0x1918('0x26')][_0x1918('0x29')]);return _0x303245(_0x3df504['error'][_0x1918('0x29')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4947b5,'request\x20sent');_0x303245(_0x3df504[_0x1918('0x2a')][_0x1918('0x29')]);}})[_0x1918('0x2b')](function(_0x3e0532){logger[_0x1918('0x26')](_0x1918('0x28'),_0x4947b5,_0x3e0532);_0x5845c4(_0x3e0532);});});}function respondWithStatusCode(_0x1d1dac,_0x132403){_0x132403=_0x132403||0xcc;return function(_0x139127){if(_0x139127){return _0x1d1dac[_0x1918('0x2c')](_0x132403);}return _0x1d1dac[_0x1918('0x2d')](_0x132403)[_0x1918('0x2e')]();};}function respondWithResult(_0x25d433,_0x58e227){_0x58e227=_0x58e227||0xc8;return function(_0xf693da){if(_0xf693da){return _0x25d433['status'](_0x58e227)[_0x1918('0x2f')](_0xf693da);}};}function respondWithFilteredResult(_0x1689ce,_0x5b8f9c){return function(_0x8ca18b){if(_0x8ca18b){var _0x32dd3b=typeof _0x5b8f9c[_0x1918('0x30')]===_0x1918('0x31')&&typeof _0x5b8f9c[_0x1918('0x32')]===_0x1918('0x31');var _0x4adba0=_0x8ca18b[_0x1918('0x33')];var _0x45d480=_0x32dd3b?0x0:_0x5b8f9c[_0x1918('0x30')];var _0x4a6c88=_0x32dd3b?_0x8ca18b[_0x1918('0x33')]:_0x5b8f9c[_0x1918('0x30')]+_0x5b8f9c[_0x1918('0x32')];var _0x440389;if(_0x4a6c88>=_0x4adba0){_0x4a6c88=_0x4adba0;_0x440389=0xc8;}else{_0x440389=0xce;}_0x1689ce[_0x1918('0x2d')](_0x440389);return _0x1689ce[_0x1918('0x34')](_0x1918('0x35'),_0x45d480+'-'+_0x4a6c88+'/'+_0x4adba0)[_0x1918('0x2f')](_0x8ca18b);}return null;};}function patchUpdates(_0x1a8103){return function(_0x517821){try{jsonpatch[_0x1918('0x36')](_0x517821,_0x1a8103,!![]);}catch(_0xbfda0){return BPromise['reject'](_0xbfda0);}return _0x517821[_0x1918('0x37')]();};}function saveUpdates(_0x78acf4,_0x2ff358){return function(_0xf4165c){if(_0xf4165c){return _0xf4165c['update'](_0x78acf4)[_0x1918('0x22')](function(_0x1b0e90){return _0x1b0e90;});}return null;};}function removeEntity(_0x43c040,_0x42432f){return function(_0x3bc774){if(_0x3bc774){return _0x3bc774[_0x1918('0x38')]()[_0x1918('0x22')](function(){var _0x2a42cb=_0x3bc774[_0x1918('0x39')]({'plain':!![]});var _0x2aa40d=_0x1918('0x3a');return db['UserProfileResource'][_0x1918('0x38')]({'where':{'type':_0x2aa40d,'resourceId':_0x2a42cb['id']}})[_0x1918('0x22')](function(){return _0x3bc774;});})[_0x1918('0x22')](function(){_0x43c040[_0x1918('0x2d')](0xcc)[_0x1918('0x2e')]();});}};}function handleEntityNotFound(_0x3ca167,_0x1ad6a1){return function(_0xad54b8){if(!_0xad54b8){_0x3ca167[_0x1918('0x2c')](0x194);}return _0xad54b8;};}function handleError(_0x337ed7,_0x35a69b){_0x35a69b=_0x35a69b||0x1f4;return function(_0x236efb){logger[_0x1918('0x26')](_0x236efb[_0x1918('0x3b')]);if(_0x236efb[_0x1918('0x3c')]){delete _0x236efb[_0x1918('0x3c')];}_0x337ed7['status'](_0x35a69b)[_0x1918('0x3d')](_0x236efb);};}exports['index']=function(_0x27834e,_0xc9a3dc){var _0x2ecf33={'include':[{'model':db[_0x1918('0x3e')],'as':_0x1918('0x3f')}]},_0x218c37={},_0x42b55c={'count':0x0,'rows':[]};var _0x11d6de=_[_0x1918('0x40')](db['OpenchannelAccount'][_0x1918('0x41')],function(_0x5e4634){return{'name':_0x5e4634[_0x1918('0x42')],'type':_0x5e4634[_0x1918('0x43')]['key']};});_0x218c37['model']=_['map'](_0x11d6de,_0x1918('0x3c'));_0x218c37[_0x1918('0x44')]=_[_0x1918('0x45')](_0x27834e['query']);_0x218c37[_0x1918('0x46')]=_[_0x1918('0x47')](_0x218c37[_0x1918('0x48')],_0x218c37[_0x1918('0x44')]);_0x2ecf33['attributes']=_[_0x1918('0x47')](_0x218c37['model'],qs['fields'](_0x27834e[_0x1918('0x44')][_0x1918('0x49')]));_0x2ecf33['attributes']=_0x2ecf33[_0x1918('0x4a')][_0x1918('0x4b')]?_0x2ecf33[_0x1918('0x4a')]:_0x218c37[_0x1918('0x48')];if(!_0x27834e[_0x1918('0x44')][_0x1918('0x4c')](_0x1918('0x4d'))){_0x2ecf33['limit']=qs[_0x1918('0x32')](_0x27834e[_0x1918('0x44')]['limit']);_0x2ecf33['offset']=qs[_0x1918('0x30')](_0x27834e[_0x1918('0x44')][_0x1918('0x30')]);}_0x2ecf33[_0x1918('0x4e')]=qs[_0x1918('0x4f')](_0x27834e[_0x1918('0x44')][_0x1918('0x4f')]);_0x2ecf33[_0x1918('0x50')]=qs[_0x1918('0x46')](_[_0x1918('0x51')](_0x27834e[_0x1918('0x44')],_0x218c37[_0x1918('0x46')]),_0x11d6de);if(_0x27834e[_0x1918('0x44')][_0x1918('0x52')]){_0x2ecf33[_0x1918('0x50')]=_['merge'](_0x2ecf33[_0x1918('0x50')],{'$or':_[_0x1918('0x40')](_0x11d6de,function(_0x100d1e){if(_0x100d1e[_0x1918('0x43')]!==_0x1918('0x53')){var _0x5ea587={};_0x5ea587[_0x100d1e[_0x1918('0x3c')]]={'$like':'%'+_0x27834e['query'][_0x1918('0x52')]+'%'};return _0x5ea587;}})});}_0x2ecf33=_[_0x1918('0x54')]({},_0x2ecf33,_0x27834e['options']);var _0x301c1e={'where':_0x2ecf33['where']};return db['OpenchannelAccount'][_0x1918('0x33')](_0x301c1e)[_0x1918('0x22')](function(_0x21bd6b){_0x42b55c['count']=_0x21bd6b;if(_0x27834e[_0x1918('0x44')][_0x1918('0x55')]){_0x2ecf33['include']=[{'all':!![]}];}return db[_0x1918('0x56')][_0x1918('0x57')](_0x2ecf33);})['then'](function(_0x37cd84){_0x42b55c['rows']=_0x37cd84;return _0x42b55c;})['then'](respondWithFilteredResult(_0xc9a3dc,_0x2ecf33))['catch'](handleError(_0xc9a3dc,null));};exports[_0x1918('0x58')]=function(_0x15c73a,_0x47e389){var _0x86e250={'raw':![],'where':{'id':_0x15c73a[_0x1918('0x59')]['id']},'include':[{'model':db[_0x1918('0x3e')],'as':_0x1918('0x3f')}]},_0x1bbe4e={};_0x1bbe4e['model']=_[_0x1918('0x45')](db[_0x1918('0x56')][_0x1918('0x41')]);_0x1bbe4e[_0x1918('0x44')]=_[_0x1918('0x45')](_0x15c73a[_0x1918('0x44')]);_0x1bbe4e[_0x1918('0x46')]=_[_0x1918('0x47')](_0x1bbe4e[_0x1918('0x48')],_0x1bbe4e[_0x1918('0x44')]);_0x86e250['attributes']=_['intersection'](_0x1bbe4e['model'],qs[_0x1918('0x49')](_0x15c73a[_0x1918('0x44')][_0x1918('0x49')]));_0x86e250[_0x1918('0x4a')]=_0x86e250[_0x1918('0x4a')][_0x1918('0x4b')]?_0x86e250[_0x1918('0x4a')]:_0x1bbe4e[_0x1918('0x48')];if(_0x15c73a[_0x1918('0x44')]['includeAll']){_0x86e250[_0x1918('0x5a')]=[{'all':!![]}];}_0x86e250=_[_0x1918('0x54')]({},_0x86e250,_0x15c73a[_0x1918('0x5b')]);return db['OpenchannelAccount']['find'](_0x86e250)[_0x1918('0x22')](handleEntityNotFound(_0x47e389,null))[_0x1918('0x22')](respondWithResult(_0x47e389,null))[_0x1918('0x2b')](handleError(_0x47e389,null));};exports['create']=function(_0x2b66e9,_0x24357f){return db[_0x1918('0x56')][_0x1918('0x5c')](_0x2b66e9[_0x1918('0x5d')],{})[_0x1918('0x22')](function(_0x1766f6){var _0x21f0bc=_0x2b66e9['user']['get']({'plain':!![]});if(!_0x21f0bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21f0bc['role']===_0x1918('0x5e')){var _0xda0b31=_0x1766f6[_0x1918('0x39')]({'plain':!![]});var _0x2bed28='OpenchannelAccounts';return db[_0x1918('0x5f')][_0x1918('0x60')]({'where':{'name':_0x2bed28,'userProfileId':_0x21f0bc[_0x1918('0x61')]},'raw':!![]})[_0x1918('0x22')](function(_0x6dff2){if(_0x6dff2&&_0x6dff2[_0x1918('0x62')]===0x0){return db[_0x1918('0x63')][_0x1918('0x5c')]({'name':_0xda0b31[_0x1918('0x3c')],'resourceId':_0xda0b31['id'],'type':_0x6dff2['name'],'sectionId':_0x6dff2['id']},{})[_0x1918('0x22')](function(){return _0x1766f6;});}else{return _0x1766f6;}})[_0x1918('0x2b')](function(_0x2b8ab2){logger['error'](_0x1918('0x64'),_0x2b8ab2);throw _0x2b8ab2;});}return _0x1766f6;})['then'](respondWithResult(_0x24357f,0xc9))['catch'](handleError(_0x24357f,null));};exports[_0x1918('0x65')]=function(_0x14026f,_0x2b6381){if(_0x14026f[_0x1918('0x5d')]['id']){delete _0x14026f[_0x1918('0x5d')]['id'];}return db['OpenchannelAccount'][_0x1918('0x60')]({'where':{'id':_0x14026f[_0x1918('0x59')]['id']},'include':[{'model':db[_0x1918('0x3e')],'as':_0x1918('0x3f')}]})['then'](handleEntityNotFound(_0x2b6381,null))[_0x1918('0x22')](saveUpdates(_0x14026f[_0x1918('0x5d')],null))[_0x1918('0x22')](respondWithResult(_0x2b6381,null))[_0x1918('0x2b')](handleError(_0x2b6381,null));};exports[_0x1918('0x38')]=function(_0x52c155,_0x576ca3){return db['OpenchannelAccount'][_0x1918('0x60')]({'where':{'id':_0x52c155[_0x1918('0x59')]['id']}})['then'](handleEntityNotFound(_0x576ca3,null))[_0x1918('0x22')](removeEntity(_0x576ca3,null))['catch'](handleError(_0x576ca3,null));};exports[_0x1918('0x66')]=function(_0x4c1ac3,_0x549137){return db['OpenchannelAccount'][_0x1918('0x66')]()[_0x1918('0x22')](respondWithResult(_0x549137,null))[_0x1918('0x2b')](handleError(_0x549137,null));};exports[_0x1918('0x67')]=function(_0x58215e,_0xf4549e,_0x85a2a4){if(_0x58215e[_0x1918('0x5d')]['id']){delete _0x58215e[_0x1918('0x5d')]['id'];}return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x58215e[_0x1918('0x59')]['id']}})['then'](handleEntityNotFound(_0xf4549e,null))['then'](function(_0x13eccd){if(_0x13eccd){_0x58215e[_0x1918('0x5d')]['OpenchannelAccountId']=_0x13eccd['id'];return db['Disposition'][_0x1918('0x5c')](_0x58215e[_0x1918('0x5d')]);}})[_0x1918('0x22')](respondWithResult(_0xf4549e,null))['catch'](handleError(_0xf4549e,null));};exports[_0x1918('0x68')]=function(_0x1c6574,_0x2e2a99,_0x36efc9){var _0x1c1c3f={'raw':![],'where':{}};var _0x43a37f={};var _0xeaa9ad={'count':0x0,'rows':[]};return db[_0x1918('0x56')][_0x1918('0x69')]({'where':{'id':_0x1c6574[_0x1918('0x59')]['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x2e2a99,null))[_0x1918('0x22')](function(_0x54d21d){if(_0x54d21d){_0x43a37f[_0x1918('0x48')]=_[_0x1918('0x45')](db[_0x1918('0x6a')][_0x1918('0x41')]);_0x43a37f[_0x1918('0x44')]=_[_0x1918('0x45')](_0x1c6574[_0x1918('0x44')]);_0x43a37f['filters']=_[_0x1918('0x47')](_0x43a37f[_0x1918('0x48')],_0x43a37f[_0x1918('0x44')]);_0x1c1c3f[_0x1918('0x4a')]=_[_0x1918('0x47')](_0x43a37f[_0x1918('0x48')],qs[_0x1918('0x49')](_0x1c6574[_0x1918('0x44')][_0x1918('0x49')]));_0x1c1c3f[_0x1918('0x4a')]=_0x1c1c3f[_0x1918('0x4a')][_0x1918('0x4b')]?_0x1c1c3f['attributes']:_0x43a37f[_0x1918('0x48')];if(!_0x1c6574[_0x1918('0x44')][_0x1918('0x4c')](_0x1918('0x4d'))){_0x1c1c3f[_0x1918('0x32')]=qs[_0x1918('0x32')](_0x1c6574[_0x1918('0x44')]['limit']);_0x1c1c3f[_0x1918('0x30')]=qs[_0x1918('0x30')](_0x1c6574['query']['offset']);}_0x1c1c3f['order']=qs[_0x1918('0x4f')](_0x1c6574[_0x1918('0x44')]['sort']);_0x1c1c3f[_0x1918('0x50')]=qs[_0x1918('0x46')](_[_0x1918('0x51')](_0x1c6574[_0x1918('0x44')],_0x43a37f[_0x1918('0x46')]));_0x1c1c3f['where']['OpenchannelAccountId']=_0x54d21d['id'];if(_0x1c6574[_0x1918('0x44')]['filter']){_0x1c1c3f[_0x1918('0x50')]=_[_0x1918('0x54')](_0x1c1c3f['where'],{'$or':_[_0x1918('0x40')](_0x1c1c3f[_0x1918('0x4a')],function(_0x9bfcc5){var _0x4af053={};_0x4af053[_0x9bfcc5]={'$like':'%'+_0x1c6574[_0x1918('0x44')]['filter']+'%'};return _0x4af053;})});}_0x1c1c3f=_[_0x1918('0x54')]({},_0x1c1c3f,_0x1c6574[_0x1918('0x5b')]);return db[_0x1918('0x6a')]['count']({'where':_0x1c1c3f[_0x1918('0x50')]})[_0x1918('0x22')](function(_0x2768f5){_0xeaa9ad[_0x1918('0x33')]=_0x2768f5;if(_0x1c6574[_0x1918('0x44')][_0x1918('0x55')]){_0x1c1c3f[_0x1918('0x5a')]=[{'all':!![]}];}return db[_0x1918('0x6a')][_0x1918('0x57')](_0x1c1c3f);})['then'](function(_0x5097e6){_0xeaa9ad['rows']=_0x5097e6;return _0xeaa9ad;});}})[_0x1918('0x22')](respondWithFilteredResult(_0x2e2a99,_0x1c1c3f))[_0x1918('0x2b')](handleError(_0x2e2a99,null));};exports['removeDispositions']=function(_0x455b0f,_0x2afe9d,_0x340a41){return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x455b0f['params']['id']}})['then'](handleEntityNotFound(_0x2afe9d,null))['then'](function(_0x406d7a){if(_0x406d7a){return _0x406d7a[_0x1918('0x6b')](_0x455b0f[_0x1918('0x44')][_0x1918('0x6c')]);}})['then'](respondWithStatusCode(_0x2afe9d,null))[_0x1918('0x2b')](handleError(_0x2afe9d,null));};exports[_0x1918('0x6d')]=function(_0x38ed0c,_0x1b1404,_0x2af9dd){if(_0x38ed0c[_0x1918('0x5d')]['id']){delete _0x38ed0c[_0x1918('0x5d')]['id'];}return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x38ed0c[_0x1918('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b1404,null))[_0x1918('0x22')](function(_0x3b5549){if(_0x3b5549){_0x38ed0c[_0x1918('0x5d')][_0x1918('0x6e')]=_0x3b5549['id'];return db[_0x1918('0x6f')][_0x1918('0x5c')](_0x38ed0c['body']);}})[_0x1918('0x22')](respondWithResult(_0x1b1404,null))[_0x1918('0x2b')](handleError(_0x1b1404,null));};exports[_0x1918('0x70')]=function(_0x1076ea,_0x5e5856,_0x4fa8bc){var _0x1338cc={'raw':![],'where':{}};var _0x5aa21f={};var _0x4b97de={'count':0x0,'rows':[]};return db[_0x1918('0x56')][_0x1918('0x69')]({'where':{'id':_0x1076ea['params']['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x5e5856,null))[_0x1918('0x22')](function(_0x58d9ac){if(_0x58d9ac){_0x5aa21f[_0x1918('0x48')]=_[_0x1918('0x45')](db[_0x1918('0x6f')][_0x1918('0x41')]);_0x5aa21f[_0x1918('0x44')]=_[_0x1918('0x45')](_0x1076ea[_0x1918('0x44')]);_0x5aa21f[_0x1918('0x46')]=_['intersection'](_0x5aa21f[_0x1918('0x48')],_0x5aa21f[_0x1918('0x44')]);_0x1338cc['attributes']=_[_0x1918('0x47')](_0x5aa21f[_0x1918('0x48')],qs[_0x1918('0x49')](_0x1076ea[_0x1918('0x44')][_0x1918('0x49')]));_0x1338cc[_0x1918('0x4a')]=_0x1338cc[_0x1918('0x4a')][_0x1918('0x4b')]?_0x1338cc['attributes']:_0x5aa21f[_0x1918('0x48')];if(!_0x1076ea[_0x1918('0x44')][_0x1918('0x4c')]('nolimit')){_0x1338cc['limit']=qs[_0x1918('0x32')](_0x1076ea[_0x1918('0x44')][_0x1918('0x32')]);_0x1338cc[_0x1918('0x30')]=qs['offset'](_0x1076ea[_0x1918('0x44')][_0x1918('0x30')]);}_0x1338cc['order']=qs[_0x1918('0x4f')](_0x1076ea[_0x1918('0x44')][_0x1918('0x4f')]);_0x1338cc['where']=qs['filters'](_[_0x1918('0x51')](_0x1076ea['query'],_0x5aa21f[_0x1918('0x46')]));_0x1338cc[_0x1918('0x50')][_0x1918('0x6e')]=_0x58d9ac['id'];if(_0x1076ea[_0x1918('0x44')][_0x1918('0x52')]){_0x1338cc[_0x1918('0x50')]=_[_0x1918('0x54')](_0x1338cc[_0x1918('0x50')],{'$or':_[_0x1918('0x40')](_0x1338cc[_0x1918('0x4a')],function(_0x105c73){var _0x504560={};_0x504560[_0x105c73]={'$like':'%'+_0x1076ea[_0x1918('0x44')]['filter']+'%'};return _0x504560;})});}_0x1338cc=_['merge']({},_0x1338cc,_0x1076ea['options']);return db[_0x1918('0x6f')][_0x1918('0x33')]({'where':_0x1338cc[_0x1918('0x50')]})[_0x1918('0x22')](function(_0x107b93){_0x4b97de[_0x1918('0x33')]=_0x107b93;if(_0x1076ea[_0x1918('0x44')][_0x1918('0x55')]){_0x1338cc['include']=[{'all':!![]}];}return db[_0x1918('0x6f')]['findAll'](_0x1338cc);})[_0x1918('0x22')](function(_0x1c5999){_0x4b97de[_0x1918('0x71')]=_0x1c5999;return _0x4b97de;});}})[_0x1918('0x22')](respondWithFilteredResult(_0x5e5856,_0x1338cc))['catch'](handleError(_0x5e5856,null));};exports[_0x1918('0x72')]=function(_0x4ecfec,_0x5dad23,_0x47473f){return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x4ecfec['params']['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x5dad23,null))[_0x1918('0x22')](function(_0x5da75e){if(_0x5da75e){return _0x5da75e[_0x1918('0x72')](_0x4ecfec['query'][_0x1918('0x6c')]);}})[_0x1918('0x22')](respondWithStatusCode(_0x5dad23,null))[_0x1918('0x2b')](handleError(_0x5dad23,null));};exports[_0x1918('0x73')]=function(_0x1fd4a1,_0xf2c354,_0x55c2fa){var _0xeb2913={'body':_0x1fd4a1[_0x1918('0x5d')],'channel':'openchannel'};var _0x22970c=[];var _0x547af1=[];var _0x48c214={};var _0x2d6f40=![];return db[_0x1918('0x74')][_0x1918('0x66')]()[_0x1918('0x22')](function(_0x4da92c){if(!_0x4da92c){throw new db['Sequelize'][(_0x1918('0x75'))]('no\x20available\x20attributes');}_0x22970c=_[_0x1918('0x76')](_[_0x1918('0x45')](_0x4da92c),[_0x1918('0x77'),'updatedAt']);_0x547af1=_[_0x1918('0x76')](_[_0x1918('0x45')](_0x4da92c),[_0x1918('0x77'),'updatedAt','CompanyId',_0x1918('0x78')]);if(_0x1fd4a1[_0x1918('0x5d')]['id']){delete _0x1fd4a1[_0x1918('0x5d')]['id'];}if(_[_0x1918('0x79')](_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7a')])){throw new db[(_0x1918('0x7b'))][(_0x1918('0x75'))](_0x1918('0x7c'));}if(_['isNil'](_0x1fd4a1[_0x1918('0x5d')]['body'])||_0x1fd4a1[_0x1918('0x5d')]['body']===''){throw new db[(_0x1918('0x7b'))][(_0x1918('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1918('0x79')](_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7d')])){throw new db[(_0x1918('0x7b'))][(_0x1918('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x547af1);}if(!_[_0x1918('0x7e')](_0x547af1,_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7d')])){throw new db[(_0x1918('0x7b'))][(_0x1918('0x75'))](_0x1918('0x7f')+_0x547af1);}_0x48c214[_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7d')]]=_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7a')];})['then'](function(){return db[_0x1918('0x56')]['find']({'where':{'id':_0x1fd4a1['params']['id']},'include':[{'model':db[_0x1918('0x80')],'as':_0x1918('0x81'),'include':[{'model':db[_0x1918('0x74')],'as':'Contacts','where':_0x48c214,'limit':0x1,'order':[[_0x1918('0x82'),_0x1918('0x83')]]}]},{'model':db[_0x1918('0x84')],'as':_0x1918('0x85')}]});})[_0x1918('0x22')](handleEntityNotFound(_0xf2c354,null))[_0x1918('0x22')](function(_0x3798b4){if(_0x3798b4&&_0x3798b4[_0x1918('0x81')]){_0xeb2913[_0x1918('0x86')]=_0x3798b4;_0xeb2913[_0x1918('0x87')]=_0x3798b4['Applications'];_0xeb2913[_0x1918('0x88')]=_0x3798b4[_0x1918('0x81')];_0xeb2913[_0x1918('0x87')]=_[_0x1918('0x89')](_0xeb2913[_0x1918('0x87')],[_0x1918('0x8a')],[_0x1918('0x8b')]);if(_0xeb2913[_0x1918('0x86')][_0x1918('0x85')]){delete _0xeb2913['account']['Applications'];}if(_0xeb2913['account'][_0x1918('0x81')]&&_0xeb2913['account']['List'][_0x1918('0x8c')][_0x1918('0x4b')]){return _0xeb2913[_0x1918('0x86')][_0x1918('0x81')][_0x1918('0x8c')][0x0];}var _0xb73c29=_[_0x1918('0x1b')](_0x1fd4a1['body'],{'firstName':_0x1fd4a1['body'][_0x1918('0x7a')],'ListId':_0x3798b4['ListId']});_0xb73c29[_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x7d')]]=_0x1fd4a1[_0x1918('0x5d')]['from'];return db[_0x1918('0x74')][_0x1918('0x5c')](_0xb73c29,{'fields':_0x22970c,'raw':!![]});}})['then'](handleEntityNotFound(_0xf2c354,null))[_0x1918('0x22')](function(_0x51de75){_0xeb2913[_0x1918('0x8d')]=_0x51de75;if(_0x51de75){var _0x541488={'ContactId':_0x51de75['id'],'OpenchannelAccountId':_0x1fd4a1['params']['id'],'from':(_0x51de75[_0x1918('0x8e')]||'')+'\x20'+(_0x51de75['lastName']||'')};var _0x5a9ff7={'OpenchannelAccountId':_0x1fd4a1[_0x1918('0x59')]['id'],'closed':![]};if(_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x8f')]){_0x5a9ff7[_0x1918('0x8f')]=_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x8f')];return db[_0x1918('0x90')][_0x1918('0x60')]({'where':_0x5a9ff7})[_0x1918('0x22')](function(_0x2a9f24){if(_0x2a9f24){return[_0x2a9f24,![]];}_0x541488[_0x1918('0x8f')]=_0x1fd4a1['body']['threadId'];_0x541488[_0x1918('0x91')]=_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x91')];return db[_0x1918('0x90')][_0x1918('0x5c')](_0x541488)[_0x1918('0x22')](function(_0x20f0a0){return[_0x20f0a0,!![]];});});}else{_0x5a9ff7[_0x1918('0x8f')]=null;}_0x5a9ff7['ContactId']=_0x51de75['id'];return db['OpenchannelInteraction'][_0x1918('0x60')]({'where':_0x5a9ff7})[_0x1918('0x22')](function(_0x411e5a){if(_0x411e5a){return[_0x411e5a,![]];}return db[_0x1918('0x90')]['create'](_0x541488)['then'](function(_0x427810){return[_0x427810,!![]];});});}})['spread'](function(_0x38e523,_0x4d4d59){if(_0x38e523){_0x2d6f40=_0x4d4d59;if(!_0x4d4d59){var _0x2f88b7={'from':(_0xeb2913[_0x1918('0x8d')][_0x1918('0x8e')]||'')+'\x20'+(_0xeb2913[_0x1918('0x8d')][_0x1918('0x92')]||'')};if(_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x8f')]&&_0x1fd4a1[_0x1918('0x5d')]['messageId']&&_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x8f')]!=_0x1fd4a1[_0x1918('0x5d')]['messageId']){_0x2f88b7[_0x1918('0x8f')]=_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x93')];}return _0x38e523[_0x1918('0x65')](_0x2f88b7);}else{return _0x38e523;}}})[_0x1918('0x22')](function(_0x3fbbed){_0xeb2913['interaction']=_0x3fbbed[_0x1918('0x39')]({'plain':!![]});_0xeb2913[_0x1918('0x94')]['created']=_0x2d6f40;if(_0xeb2913[_0x1918('0x94')][_0x1918('0x95')]){if(_0xeb2913['account'][_0x1918('0x96')]){_0xeb2913['applications'][_0x1918('0x97')]({'id':0x0,'priority':_0xeb2913[_0x1918('0x87')][_0x1918('0x4b')]+0x1,'app':_0x1918('0x98'),'appdata':_0x1918('0x99'),'interval':_0x1918('0x9a')});}}return db[_0x1918('0x9b')][_0x1918('0x5c')]({'body':_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x5d')],'OpenchannelAccountId':_0x1fd4a1[_0x1918('0x59')]['id'],'OpenchannelInteractionId':_0x3fbbed['id'],'direction':'in','ContactId':_0xeb2913['contact']['id'],'AttachmentId':_0x1fd4a1[_0x1918('0x5d')][_0x1918('0x9c')]});})['then'](function(_0x3608d3){_0xeb2913[_0x1918('0x29')]=_0x3608d3;if(_0xeb2913[_0x1918('0x94')][_0x1918('0x9d')]){return db[_0x1918('0x9e')][_0x1918('0x60')]({'attributes':['id','name'],'where':{'id':_0xeb2913['interaction'][_0x1918('0x9d')]}})[_0x1918('0x22')](function(_0x338a31){if(_0x338a31){_0xeb2913[_0x1918('0x87')][_0x1918('0x9f')]({'id':0x0,'priority':0x0,'app':_0x1918('0xa0'),'appdata':_0x338a31['name']+','+(_0xeb2913[_0x1918('0x86')][_0x1918('0xa1')]||0xa),'interval':'*,*,*,*'});_0xeb2913['forcedOwnership']=![];}return respondWithRpcPromise(_0x1918('0xa2'),'startRouting',_0xeb2913);});}return respondWithRpcPromise(_0x1918('0xa2'),'startRouting',_0xeb2913);})['then'](function(_0x50b2eb){respondWithRpcPromise(_0x1918('0xa3'),_0x1918('0xa3'),{'event':_0x1918('0x73'),'message':_0x50b2eb},client9002);return _0x50b2eb;})[_0x1918('0x22')](respondWithResult(_0xf2c354,null))[_0x1918('0x2b')](handleError(_0xf2c354,null));};exports[_0x1918('0xa4')]=function(_0x2f8b33,_0x4061f3){var _0x9330af=_0x2f8b33['params']['id'];var _0x366573=_0x2f8b33[_0x1918('0x5d')];var _0x41fa09=0xc8;var _0x594d40=null;return db['sequelize'][_0x1918('0xa5')]({'isolationLevel':db['sequelize'][_0x1918('0xa6')][_0x1918('0xa7')]['READ_COMMITTED']},function(_0x1aa777){return db[_0x1918('0x56')][_0x1918('0x69')]({'where':{'id':_0x9330af},'transaction':_0x1aa777})[_0x1918('0x22')](function(_0x458e64){if(_0x458e64){return db[_0x1918('0x84')]['destroy']({'where':{'OpenchannelAccountId':_0x9330af},'transaction':_0x1aa777})['then'](function(){var _0x387e3c=_[_0x1918('0x40')](_0x366573,function(_0x839993){_0x839993['OpenchannelAccountId']=_0x9330af;return _0x839993;});return db[_0x1918('0x84')][_0x1918('0xa8')](_0x387e3c,{'transaction':_0x1aa777});});}else{_0x41fa09=0x194;_0x594d40=[];}});})[_0x1918('0x22')](function(){if(_0x41fa09!==0x194){return db['OpenchannelApplication'][_0x1918('0xa9')]({'where':{'OpenchannelAccountId':_0x9330af},'order':_0x1918('0x8a')})['then'](function(_0x36d6fe){_0x594d40=_0x36d6fe;});}})[_0x1918('0x2b')](function(_0x54517f){_0x41fa09=0x1f4;logger[_0x1918('0x26')](_0x54517f[_0x1918('0x3b')]);if(_0x54517f[_0x1918('0x3c')]){delete _0x54517f[_0x1918('0x3c')];}_0x594d40=_0x54517f;})[_0x1918('0xaa')](function(){if(_0x594d40===null){_0x4061f3['sendStatus'](_0x41fa09);}else{if(_0x41fa09===0x1f4){_0x4061f3[_0x1918('0x2d')](_0x41fa09)[_0x1918('0x3d')](_0x594d40);}else{_0x4061f3[_0x1918('0x2d')](_0x41fa09)[_0x1918('0x2f')](_0x594d40);}}});};exports[_0x1918('0xab')]=function(_0x32f1fb,_0x19fada,_0x22cb24){var _0x408273={};var _0x13bfd7={};var _0x1a896e;var _0x2c1ad0;return db['OpenchannelAccount'][_0x1918('0x69')]({'where':{'id':_0x32f1fb[_0x1918('0x59')]['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x19fada,null))[_0x1918('0x22')](function(_0x4cc954){if(_0x4cc954){_0x1a896e=_0x4cc954;_0x13bfd7[_0x1918('0x48')]=_[_0x1918('0x45')](db['OpenchannelApplication']['rawAttributes']);_0x13bfd7[_0x1918('0x44')]=_[_0x1918('0x45')](_0x32f1fb[_0x1918('0x44')]);_0x13bfd7[_0x1918('0x46')]=_[_0x1918('0x47')](_0x13bfd7[_0x1918('0x48')],_0x13bfd7[_0x1918('0x44')]);_0x408273['attributes']=_[_0x1918('0x47')](_0x13bfd7[_0x1918('0x48')],qs['fields'](_0x32f1fb[_0x1918('0x44')][_0x1918('0x49')]));_0x408273[_0x1918('0x4a')]=_0x408273[_0x1918('0x4a')][_0x1918('0x4b')]?_0x408273[_0x1918('0x4a')]:_0x13bfd7[_0x1918('0x48')];_0x408273['order']=qs[_0x1918('0x4f')](_0x32f1fb[_0x1918('0x44')][_0x1918('0x4f')]);_0x408273[_0x1918('0x50')]=qs[_0x1918('0x46')](_[_0x1918('0x51')](_0x32f1fb[_0x1918('0x44')],_0x13bfd7['filters']));if(_0x32f1fb[_0x1918('0x44')]['filter']){_0x408273['where']=_[_0x1918('0x54')](_0x408273[_0x1918('0x50')],{'$or':_[_0x1918('0x40')](_0x408273[_0x1918('0x4a')],function(_0x54f42c){var _0x37d9eb={};_0x37d9eb[_0x54f42c]={'$like':'%'+_0x32f1fb['query'][_0x1918('0x52')]+'%'};return _0x37d9eb;})});}_0x408273=_[_0x1918('0x54')]({},_0x408273,_0x32f1fb['options']);return _0x1a896e[_0x1918('0xab')](_0x408273);}})[_0x1918('0x22')](function(_0x42b533){if(_0x42b533){_0x2c1ad0=_0x42b533[_0x1918('0x4b')];if(!_0x32f1fb[_0x1918('0x44')][_0x1918('0x4c')]('nolimit')){_0x408273[_0x1918('0x32')]=qs['limit'](_0x32f1fb[_0x1918('0x44')][_0x1918('0x32')]);_0x408273[_0x1918('0x30')]=qs[_0x1918('0x30')](_0x32f1fb[_0x1918('0x44')][_0x1918('0x30')]);}return _0x1a896e[_0x1918('0xab')](_0x408273);}})['then'](function(_0x5acf6e){if(_0x5acf6e){return _0x5acf6e?{'count':_0x2c1ad0,'rows':_0x5acf6e}:null;}})[_0x1918('0x22')](respondWithResult(_0x19fada,null))[_0x1918('0x2b')](handleError(_0x19fada,null));};exports[_0x1918('0xac')]=function(_0x451941,_0x18d670,_0x4fa310){var _0x11196c={'raw':![],'where':{}};var _0x580ee2={};var _0xec95d={'count':0x0,'rows':[]};return db[_0x1918('0x56')][_0x1918('0x69')]({'where':{'id':_0x451941['params']['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x18d670,null))[_0x1918('0x22')](function(_0x41ec8c){if(_0x41ec8c){_0x580ee2[_0x1918('0x48')]=_[_0x1918('0x45')](db[_0x1918('0x90')]['rawAttributes']);_0x580ee2[_0x1918('0x44')]=_[_0x1918('0x45')](_0x451941[_0x1918('0x44')]);_0x580ee2[_0x1918('0x46')]=_[_0x1918('0x47')](_0x580ee2[_0x1918('0x48')],_0x580ee2[_0x1918('0x44')]);_0x11196c[_0x1918('0x4a')]=_[_0x1918('0x47')](_0x580ee2[_0x1918('0x48')],qs[_0x1918('0x49')](_0x451941[_0x1918('0x44')][_0x1918('0x49')]));_0x11196c[_0x1918('0x4a')]=_0x11196c['attributes'][_0x1918('0x4b')]?_0x11196c[_0x1918('0x4a')]:_0x580ee2[_0x1918('0x48')];if(!_0x451941[_0x1918('0x44')][_0x1918('0x4c')](_0x1918('0x4d'))){_0x11196c['limit']=qs['limit'](_0x451941[_0x1918('0x44')][_0x1918('0x32')]);_0x11196c['offset']=qs[_0x1918('0x30')](_0x451941['query'][_0x1918('0x30')]);}_0x11196c['order']=qs['sort'](_0x451941['query'][_0x1918('0x4f')]);_0x11196c[_0x1918('0x50')]=qs[_0x1918('0x46')](_[_0x1918('0x51')](_0x451941[_0x1918('0x44')],_0x580ee2[_0x1918('0x46')]));_0x11196c[_0x1918('0x50')][_0x1918('0x6e')]=_0x41ec8c['id'];if(_0x451941[_0x1918('0x44')][_0x1918('0x52')]){_0x11196c[_0x1918('0x50')]=_[_0x1918('0x54')](_0x11196c[_0x1918('0x50')],{'$or':_['map'](_0x11196c[_0x1918('0x4a')],function(_0x142901){var _0x2f277f={};_0x2f277f[_0x142901]={'$like':'%'+_0x451941['query']['filter']+'%'};return _0x2f277f;})});}_0x11196c=_[_0x1918('0x54')]({},_0x11196c,_0x451941[_0x1918('0x5b')]);return db['OpenchannelInteraction'][_0x1918('0x33')]({'where':_0x11196c[_0x1918('0x50')]})[_0x1918('0x22')](function(_0x438385){_0xec95d[_0x1918('0x33')]=_0x438385;if(_0x451941[_0x1918('0x44')][_0x1918('0x55')]){_0x11196c[_0x1918('0x5a')]=[{'model':db['CmContact'],'as':_0x1918('0xad'),'required':![]},{'model':db[_0x1918('0x9e')],'as':_0x1918('0xae'),'attributes':['name',_0x1918('0xaf'),_0x1918('0xb0')],'required':![]},{'model':db[_0x1918('0xb1')],'as':_0x1918('0xb2'),'attributes':['id',_0x1918('0x3c'),_0x1918('0xb3')],'where':_0x451941[_0x1918('0x44')][_0x1918('0xb4')]?{'id':_0x451941[_0x1918('0x44')][_0x1918('0xb4')]}:undefined,'required':_0x451941['query'][_0x1918('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x1918('0x57')](_0x11196c);})[_0x1918('0x22')](function(_0x33facc){_0xec95d['rows']=_0x33facc;return _0xec95d;});}})[_0x1918('0x22')](respondWithFilteredResult(_0x18d670,_0x11196c))[_0x1918('0x2b')](handleError(_0x18d670,null));};exports['addAgents']=function(_0x18308e,_0x45684a,_0x5b1867){return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x18308e[_0x1918('0x59')]['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x45684a,null))[_0x1918('0x22')](function(_0x51b0ff){if(_0x51b0ff){return _0x51b0ff[_0x1918('0xb5')](_0x18308e[_0x1918('0x5d')]['ids'],_[_0x1918('0xb6')](_0x18308e[_0x1918('0x5d')],[_0x1918('0x6c'),'id'])||{})[_0x1918('0xb7')](function(_0x5b6e0a){for(var _0x57e9d7=0x0;_0x57e9d7<_0x18308e[_0x1918('0x5d')]['ids'][_0x1918('0x4b')];_0x57e9d7+=0x1){socket[_0x1918('0xb8')](_0x1918('0xb9'),{'UserId':Number(_0x18308e[_0x1918('0x5d')]['ids'][_0x57e9d7]),'OpenchannelAccountId':Number(_0x18308e[_0x1918('0x59')]['id'])});}return _0x5b6e0a;});}})[_0x1918('0x22')](respondWithResult(_0x45684a,null))[_0x1918('0x2b')](handleError(_0x45684a,null));};exports['removeAgents']=function(_0x4569bb,_0x4f49ae,_0x2bfc3c){return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x4569bb['params']['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x4f49ae,null))[_0x1918('0x22')](function(_0x7a1640){if(_0x7a1640){return _0x7a1640['removeAgents'](_0x4569bb[_0x1918('0x44')][_0x1918('0x6c')])['then'](function(){if(_['isArray'](_0x4569bb[_0x1918('0x44')][_0x1918('0x6c')])){for(var _0x2050c4=0x0;_0x2050c4<_0x4569bb[_0x1918('0x44')][_0x1918('0x6c')][_0x1918('0x4b')];_0x2050c4+=0x1){socket[_0x1918('0xb8')](_0x1918('0xba'),{'UserId':Number(_0x4569bb[_0x1918('0x44')][_0x1918('0x6c')][_0x2050c4]),'OpenchannelAccountId':Number(_0x4569bb[_0x1918('0x59')]['id'])});}}else{socket[_0x1918('0xb8')](_0x1918('0xba'),{'UserId':Number(_0x4569bb[_0x1918('0x44')][_0x1918('0x6c')]),'OpenchannelAccountId':Number(_0x4569bb[_0x1918('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f49ae,null))[_0x1918('0x2b')](handleError(_0x4f49ae,null));};exports[_0x1918('0xbb')]=function(_0x54f658,_0x2530b7,_0x114526){var _0x2ae45d={};var _0x29b6ca={};var _0x31887f;var _0xbaf0ad;return db[_0x1918('0x56')]['findOne']({'where':{'id':_0x54f658['params']['id']}})[_0x1918('0x22')](handleEntityNotFound(_0x2530b7,null))[_0x1918('0x22')](function(_0x16d947){if(_0x16d947){_0x31887f=_0x16d947;_0x29b6ca[_0x1918('0x48')]=_[_0x1918('0x45')](db[_0x1918('0x9e')]['rawAttributes']);_0x29b6ca[_0x1918('0x44')]=_[_0x1918('0x45')](_0x54f658[_0x1918('0x44')]);_0x29b6ca[_0x1918('0x46')]=_[_0x1918('0x47')](_0x29b6ca['model'],_0x29b6ca[_0x1918('0x44')]);_0x2ae45d[_0x1918('0x4a')]=_['intersection'](_0x29b6ca[_0x1918('0x48')],qs[_0x1918('0x49')](_0x54f658['query'][_0x1918('0x49')]));_0x2ae45d[_0x1918('0x4a')]=_0x2ae45d[_0x1918('0x4a')][_0x1918('0x4b')]?_0x2ae45d[_0x1918('0x4a')]:_0x29b6ca[_0x1918('0x48')];_0x2ae45d[_0x1918('0x4e')]=qs['sort'](_0x54f658[_0x1918('0x44')]['sort']);_0x2ae45d[_0x1918('0x50')]=qs[_0x1918('0x46')](_[_0x1918('0x51')](_0x54f658[_0x1918('0x44')],_0x29b6ca[_0x1918('0x46')]));if(_0x54f658[_0x1918('0x44')][_0x1918('0x52')]){_0x2ae45d[_0x1918('0x50')]=_[_0x1918('0x54')](_0x2ae45d[_0x1918('0x50')],{'$or':_['map'](_0x2ae45d[_0x1918('0x4a')],function(_0x1ad6c8){var _0x2a848e={};_0x2a848e[_0x1ad6c8]={'$like':'%'+_0x54f658[_0x1918('0x44')][_0x1918('0x52')]+'%'};return _0x2a848e;})});}_0x2ae45d=_[_0x1918('0x54')]({},_0x2ae45d,_0x54f658[_0x1918('0x5b')]);return _0x31887f[_0x1918('0xbb')](_0x2ae45d);}})['then'](function(_0x2722aa){if(_0x2722aa){_0xbaf0ad=_0x2722aa[_0x1918('0x4b')];if(!_0x54f658[_0x1918('0x44')]['hasOwnProperty'](_0x1918('0x4d'))){_0x2ae45d[_0x1918('0x32')]=qs['limit'](_0x54f658[_0x1918('0x44')][_0x1918('0x32')]);_0x2ae45d['offset']=qs[_0x1918('0x30')](_0x54f658['query'][_0x1918('0x30')]);}return _0x31887f['getAgents'](_0x2ae45d);}})[_0x1918('0x22')](function(_0x515928){if(_0x515928){return _0x515928?{'count':_0xbaf0ad,'rows':_0x515928}:null;}})[_0x1918('0x22')](respondWithResult(_0x2530b7,null))[_0x1918('0x2b')](handleError(_0x2530b7,null));};exports[_0x1918('0x3d')]=function(_0x3bd100,_0x58666e,_0x5173c2){var _0x4e80f4,_0xe2ed5b,_0x15d747;if(_[_0x1918('0x79')](_0x3bd100[_0x1918('0x5d')][_0x1918('0x5d')])||_0x3bd100['body']['body']===''){throw new db[(_0x1918('0x7b'))][(_0x1918('0x75'))](_0x1918('0xbc'));}if(_[_0x1918('0x79')](_0x3bd100[_0x1918('0x5d')]['to'])){}_0x4e80f4=_0x3bd100[_0x1918('0x5d')]['to'];return db[_0x1918('0x56')][_0x1918('0x69')]({'where':{'id':_0x3bd100['params']['id']}})['then'](handleEntityNotFound(_0x58666e,null))[_0x1918('0x22')](function(_0x34bb91){if(_0x34bb91){return db[_0x1918('0x56')][_0x1918('0x60')]({'where':{'id':_0x34bb91['id']},'include':[{'model':db[_0x1918('0x80')],'as':_0x1918('0x81'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x34bb91[_0x1918('0x7d')]]:_0x4e80f4},'limit':0x1,'order':[[_0x1918('0x82'),'DESC']]}]}]})[_0x1918('0x22')](handleEntityNotFound(_0x58666e,null))[_0x1918('0x22')](function(_0x4516b2){if(_0x4516b2&&_0x4516b2[_0x1918('0x81')]){_0xe2ed5b=_0x4516b2[_0x1918('0x39')]({'plain':!![]});if(_0xe2ed5b['List']&&_0xe2ed5b[_0x1918('0x81')]['Contacts'][_0x1918('0x4b')]){return _0xe2ed5b['List'][_0x1918('0x8c')][0x0];}return db[_0x1918('0x74')][_0x1918('0x5c')](_['defaults'](_0x3bd100[_0x1918('0x5d')],{'firstName':_0x4e80f4,[_0x4516b2[_0x1918('0x7d')]]:_0x4e80f4,'phone':_0x4e80f4,'ListId':_0xe2ed5b['ListId']}));}})['then'](handleEntityNotFound(_0x58666e,null))[_0x1918('0x22')](function(_0x49d299){if(_0x49d299){_0x15d747=_0x49d299;return db['OpenchannelInteraction'][_0x1918('0x60')]({'where':{'ContactId':_0x15d747['id'],'closed':![],'OpenchannelAccountId':_0xe2ed5b['id']}})['then'](function(_0x2cfbeb){if(_0x2cfbeb){return[_0x2cfbeb,![]];}return db[_0x1918('0x90')][_0x1918('0x5c')]({'UserId':_0x3bd100[_0x1918('0x5e')]['id'],'ContactId':_0x15d747['id'],'OpenchannelAccountId':_0xe2ed5b['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_['merge'](_0x3bd100[_0x1918('0x5d')],{'read':![],'body':_0x3bd100[_0x1918('0x5d')][_0x1918('0x5d')],'OpenchannelAccountId':_0xe2ed5b['id'],'UserId':_0x3bd100[_0x1918('0x5e')]['id'],'ContactId':_0x15d747['id']})]},{'include':[{'model':db[_0x1918('0x9b')],'as':_0x1918('0xbd')}]})['then'](function(_0x434119){return[_0x434119,!![]];});});}})[_0x1918('0xb7')](function(_0x4ae9d6,_0x7b5e0e){if(_0x7b5e0e){return _0x4ae9d6;}return db[_0x1918('0x9b')][_0x1918('0x5c')](_[_0x1918('0x54')](_0x3bd100[_0x1918('0x5d')],{'read':![],'body':_0x3bd100['body'][_0x1918('0x5d')],'OpenchannelAccountId':_0xe2ed5b['id'],'OpenchannelInteractionId':_0x4ae9d6['id'],'UserId':_0x3bd100[_0x1918('0x5e')]['id'],'ContactId':_0x15d747['id']}))[_0x1918('0x22')](function(_0x574434){_0x4ae9d6[_0x1918('0xbe')][_0x1918('0xbd')]=[];_0x4ae9d6['dataValues']['Messages'][_0x1918('0x97')](_0x574434[_0x1918('0xbe')]);return _0x4ae9d6;});});}})[_0x1918('0x22')](respondWithResult(_0x58666e,null))[_0x1918('0x2b')](handleError(_0x58666e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index cf9fa5e..e866708 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 _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x160078,_0x96dd19){var _0x22247a=function(_0x1927bd){while(--_0x1927bd){_0x160078['push'](_0x160078['shift']());}};_0x22247a(++_0x96dd19);}(_0x41bb,0xc5));var _0xb41b=function(_0x5d1d72,_0x127d61){_0x5d1d72=_0x5d1d72-0x0;var _0xb6e584=_0x41bb[_0x5d1d72];return _0xb6e584;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ec94b92..02516ea 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(_0x4863a0,_0x32082f){var _0x2a3749=function(_0x2413c8){while(--_0x2413c8){_0x4863a0['push'](_0x4863a0['shift']());}};_0x2a3749(++_0x32082f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xcd37b6,_0x10e7ba){var _0xefe402=function(_0x5c9d09){while(--_0x5c9d09){_0xcd37b6['push'](_0xcd37b6['shift']());}};_0xefe402(++_0x10e7ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 13e19a2..d93ceee 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 _0xefda=['socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x25a612,_0x411b2b){var _0x44e036=function(_0x521a96){while(--_0x521a96){_0x25a612['push'](_0x25a612['shift']());}};_0x44e036(++_0x411b2b);}(_0xefda,0x96));var _0xaefd=function(_0x590da5,_0x298084){_0x590da5=_0x590da5-0x0;var _0x54d4c4=_0xefda[_0x590da5];return _0x54d4c4;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});} \ No newline at end of file +var _0x0713=['socket.io-emitter','./openchannelAccount.socket','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xfce478,_0x41b0e5){var _0x1a86bd=function(_0x5800b6){while(--_0x5800b6){_0xfce478['push'](_0xfce478['shift']());}};_0x1a86bd(++_0x41b0e5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});config[_0x3071('0xb')]=_[_0x3071('0xc')](config[_0x3071('0xb')],{'host':_0x3071('0xd'),'port':0x18eb});var socket=require(_0x3071('0xe'))(new Redis(config[_0x3071('0xb')]));require(_0x3071('0xf'))['register'](socket);function respondWithRpcPromise(_0x3457cd,_0x2610b4,_0x937259){return new BPromise(function(_0xff9a29,_0x1ce844){return client['request'](_0x3457cd,_0x937259)[_0x3071('0x10')](function(_0x11a7ee){logger[_0x3071('0x11')](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2610b4,_0x3071('0x13'),JSON['stringify'](_0x11a7ee));if(_0x11a7ee[_0x3071('0x14')]){if(_0x11a7ee[_0x3071('0x14')]['code']===0x1f4){logger[_0x3071('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0x1ce844(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0xff9a29(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}else{logger['info'](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));_0xff9a29(_0x11a7ee[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x17aee2){logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x17aee2);_0x1ce844(_0x17aee2);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 1616bcf..953af5b 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 _0xe74e=['removeListener','openchannelAccount:','save','remove','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe74e,0x10a));var _0xee74=function(_0x3b311c,_0x298bf4){_0x3b311c=_0x3b311c-0x0;var _0x38551b=_0xe74e[_0x3b311c];return _0x38551b;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xee74('0x0'),_0xee74('0x1'),_0xee74('0x2')];function createListener(_0x1ff525,_0x45c54d){return function(_0x38a0bd){_0x45c54d[_0xee74('0x3')](_0x1ff525,_0x38a0bd);};}function removeListener(_0x175615,_0xc652f2){return function(){OpenchannelAccountEvents[_0xee74('0x4')](_0x175615,_0xc652f2);};}exports['register']=function(_0x483d0a){for(var _0xbb9d43=0x0,_0x242ac6=events['length'];_0xbb9d43<_0x242ac6;_0xbb9d43++){var _0x58fa11=events[_0xbb9d43];var _0x11c67e=createListener(_0xee74('0x5')+_0x58fa11,_0x483d0a);OpenchannelAccountEvents['on'](_0x58fa11,_0x11c67e);}}; \ No newline at end of file +var _0x5b05=['update','emit','removeListener','length','save','remove'];(function(_0x45aa68,_0x1156ce){var _0x2f1a03=function(_0x3af511){while(--_0x3af511){_0x45aa68['push'](_0x45aa68['shift']());}};_0x2f1a03(++_0x1156ce);}(_0x5b05,0x190));var _0x55b0=function(_0x2c7bd4,_0x322297){_0x2c7bd4=_0x2c7bd4-0x0;var _0x35a751=_0x5b05[_0x2c7bd4];return _0x35a751;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x55b0('0x0'),_0x55b0('0x1'),_0x55b0('0x2')];function createListener(_0x4148d8,_0x28c785){return function(_0x2925fe){_0x28c785[_0x55b0('0x3')](_0x4148d8,_0x2925fe);};}function removeListener(_0x43a880,_0x2cbf51){return function(){OpenchannelAccountEvents[_0x55b0('0x4')](_0x43a880,_0x2cbf51);};}exports['register']=function(_0x569adf){for(var _0x129898=0x0,_0xe0c407=events[_0x55b0('0x5')];_0x129898<_0xe0c407;_0x129898++){var _0x355e20=events[_0x129898];var _0xdf375f=createListener('openchannelAccount:'+_0x355e20,_0x569adf);OpenchannelAccountEvents['on'](_0x355e20,_0xdf375f);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 279ed5f..4ce6cf0 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 _0xfd60=['create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0xfd60,0x113));var _0x0fd6=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xfd60[_0x152121];return _0x592a85;};'use strict';var multer=require(_0x0fd6('0x0'));var util=require(_0x0fd6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fd6('0x2'));var router=express[_0x0fd6('0x3')]();var fs_extra=require(_0x0fd6('0x4'));var auth=require(_0x0fd6('0x5'));var interaction=require(_0x0fd6('0x6'));var config=require('../../config/environment');var controller=require(_0x0fd6('0x7'));router[_0x0fd6('0x8')]('/',auth[_0x0fd6('0x9')](),controller['index']);router[_0x0fd6('0x8')](_0x0fd6('0xa'),auth[_0x0fd6('0x9')](),controller[_0x0fd6('0xb')]);router[_0x0fd6('0xc')]('/',auth['isAuthenticated'](),controller[_0x0fd6('0xd')]);router['put'](_0x0fd6('0xa'),auth[_0x0fd6('0x9')](),controller[_0x0fd6('0xe')]);router[_0x0fd6('0xf')](_0x0fd6('0xa'),auth[_0x0fd6('0x9')](),controller[_0x0fd6('0x10')]);module[_0x0fd6('0x11')]=router; \ No newline at end of file +var _0x00a9=['get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller'];(function(_0x7645ed,_0x2f5b96){var _0x3005ab=function(_0x200be6){while(--_0x200be6){_0x7645ed['push'](_0x7645ed['shift']());}};_0x3005ab(++_0x2f5b96);}(_0x00a9,0xf0));var _0x900a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x00a9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x900a('0x0'));var util=require(_0x900a('0x1'));var path=require(_0x900a('0x2'));var timeout=require('connect-timeout');var express=require(_0x900a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x900a('0x4'));var interaction=require(_0x900a('0x5'));var config=require('../../config/environment');var controller=require(_0x900a('0x6'));router[_0x900a('0x7')]('/',auth['isAuthenticated'](),controller[_0x900a('0x8')]);router['get']('/:id',auth[_0x900a('0x9')](),controller[_0x900a('0xa')]);router[_0x900a('0xb')]('/',auth[_0x900a('0x9')](),controller[_0x900a('0xc')]);router[_0x900a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x900a('0xe')]);router[_0x900a('0xf')](_0x900a('0x10'),auth[_0x900a('0x9')](),controller[_0x900a('0x11')]);module[_0x900a('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3d1eb41..94afe6f 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 _0x32aa=['STRING','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x1c36b3,_0x26d4cd){var _0x329667=function(_0x1a233d){while(--_0x1a233d){_0x1c36b3['push'](_0x1c36b3['shift']());}};_0x329667(++_0x26d4cd);}(_0x32aa,0x166));var _0xa32a=function(_0x5856af,_0x6a158d){_0x5856af=_0x5856af-0x0;var _0x22a93a=_0x32aa[_0x5856af];return _0x22a93a;};'use strict';var Sequelize=require('sequelize');module[_0xa32a('0x0')]={'priority':{'type':Sequelize[_0xa32a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa32a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa32a('0x3')]()},'description':{'type':Sequelize[_0xa32a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa32a('0x4')}}; \ No newline at end of file +var _0xe53c=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x2e3a2c,_0x52ae45){var _0x1939b5=function(_0x3f0a4b){while(--_0x3f0a4b){_0x2e3a2c['push'](_0x2e3a2c['shift']());}};_0x1939b5(++_0x52ae45);}(_0xe53c,0x17e));var _0xce53=function(_0x23ed5d,_0x25c460){_0x23ed5d=_0x23ed5d-0x0;var _0x12fbdd=_0xe53c[_0x23ed5d];return _0x12fbdd;};'use strict';var Sequelize=require('sequelize');module[_0xce53('0x0')]={'priority':{'type':Sequelize[_0xce53('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xce53('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xce53('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xce53('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 7d1441d..9f4d6ce 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 _0x94f7=['then','destroy','end','sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x94f7,0x76));var _0x794f=function(_0x1a1aef,_0x408d20){_0x1a1aef=_0x1a1aef-0x0;var _0x3df283=_0x94f7[_0x1a1aef];return _0x3df283;};'use strict';var emlformat=require(_0x794f('0x0'));var rimraf=require(_0x794f('0x1'));var zipdir=require(_0x794f('0x2'));var jsonpatch=require(_0x794f('0x3'));var rp=require('request-promise');var moment=require(_0x794f('0x4'));var BPromise=require(_0x794f('0x5'));var Mustache=require(_0x794f('0x6'));var util=require(_0x794f('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x794f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x794f('0x9'));var jsforce=require(_0x794f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x794f('0xb'));var querystring=require(_0x794f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x794f('0xd'));var qs=require(_0x794f('0xe'));var as=require(_0x794f('0xf'));var hardwareService=require(_0x794f('0x10'));var logger=require(_0x794f('0x11'))(_0x794f('0x12'));var utils=require('../../config/utils');var config=require(_0x794f('0x13'));var licenseUtil=require(_0x794f('0x14'));var db=require(_0x794f('0x15'))['db'];function respondWithStatusCode(_0x512043,_0x166ba6){_0x166ba6=_0x166ba6||0xcc;return function(_0x5808cd){if(_0x5808cd){return _0x512043['sendStatus'](_0x166ba6);}return _0x512043[_0x794f('0x16')](_0x166ba6)['end']();};}function respondWithResult(_0x593c92,_0x92613d){_0x92613d=_0x92613d||0xc8;return function(_0x1e880f){if(_0x1e880f){return _0x593c92['status'](_0x92613d)[_0x794f('0x17')](_0x1e880f);}};}function respondWithFilteredResult(_0x32fced,_0x28d9fa){return function(_0x36ef1e){if(_0x36ef1e){var _0x5e9a9d=typeof _0x28d9fa[_0x794f('0x18')]===_0x794f('0x19')&&typeof _0x28d9fa[_0x794f('0x1a')]===_0x794f('0x19');var _0x2b5367=_0x36ef1e[_0x794f('0x1b')];var _0x213584=_0x5e9a9d?0x0:_0x28d9fa[_0x794f('0x18')];var _0x5d5408=_0x5e9a9d?_0x36ef1e[_0x794f('0x1b')]:_0x28d9fa[_0x794f('0x18')]+_0x28d9fa[_0x794f('0x1a')];var _0x9388fe;if(_0x5d5408>=_0x2b5367){_0x5d5408=_0x2b5367;_0x9388fe=0xc8;}else{_0x9388fe=0xce;}_0x32fced[_0x794f('0x16')](_0x9388fe);return _0x32fced[_0x794f('0x1c')](_0x794f('0x1d'),_0x213584+'-'+_0x5d5408+'/'+_0x2b5367)[_0x794f('0x17')](_0x36ef1e);}return null;};}function patchUpdates(_0x2d719e){return function(_0x1ddf73){try{jsonpatch[_0x794f('0x1e')](_0x1ddf73,_0x2d719e,!![]);}catch(_0x3651f8){return BPromise['reject'](_0x3651f8);}return _0x1ddf73[_0x794f('0x1f')]();};}function saveUpdates(_0x3a34c2,_0x3c1970){return function(_0x364ced){if(_0x364ced){return _0x364ced['update'](_0x3a34c2)[_0x794f('0x20')](function(_0x59f22c){return _0x59f22c;});}return null;};}function removeEntity(_0x508d71,_0x471ef5){return function(_0x3aa82f){if(_0x3aa82f){return _0x3aa82f[_0x794f('0x21')]()[_0x794f('0x20')](function(){_0x508d71[_0x794f('0x16')](0xcc)[_0x794f('0x22')]();});}};}function handleEntityNotFound(_0x562b6e,_0x22b5ea){return function(_0x2f9f0b){if(!_0x2f9f0b){_0x562b6e[_0x794f('0x23')](0x194);}return _0x2f9f0b;};}function handleError(_0x41920e,_0x40647a){_0x40647a=_0x40647a||0x1f4;return function(_0x52cf7a){logger[_0x794f('0x24')](_0x52cf7a[_0x794f('0x25')]);if(_0x52cf7a['name']){delete _0x52cf7a[_0x794f('0x26')];}_0x41920e['status'](_0x40647a)[_0x794f('0x27')](_0x52cf7a);};}exports[_0x794f('0x28')]=function(_0x154540,_0x2f3fbd){var _0x3f670d={},_0x3cdf79={},_0x429f32={'count':0x0,'rows':[]};var _0x43f81a=_['map'](db[_0x794f('0x29')][_0x794f('0x2a')],function(_0xf092e2){return{'name':_0xf092e2[_0x794f('0x2b')],'type':_0xf092e2[_0x794f('0x2c')][_0x794f('0x2d')]};});_0x3cdf79[_0x794f('0x2e')]=_[_0x794f('0x2f')](_0x43f81a,_0x794f('0x26'));_0x3cdf79[_0x794f('0x30')]=_['keys'](_0x154540[_0x794f('0x30')]);_0x3cdf79[_0x794f('0x31')]=_['intersection'](_0x3cdf79['model'],_0x3cdf79['query']);_0x3f670d[_0x794f('0x32')]=_[_0x794f('0x33')](_0x3cdf79[_0x794f('0x2e')],qs[_0x794f('0x34')](_0x154540['query']['fields']));_0x3f670d[_0x794f('0x32')]=_0x3f670d[_0x794f('0x32')][_0x794f('0x35')]?_0x3f670d[_0x794f('0x32')]:_0x3cdf79[_0x794f('0x2e')];if(!_0x154540[_0x794f('0x30')][_0x794f('0x36')](_0x794f('0x37'))){_0x3f670d[_0x794f('0x1a')]=qs['limit'](_0x154540[_0x794f('0x30')]['limit']);_0x3f670d[_0x794f('0x18')]=qs[_0x794f('0x18')](_0x154540[_0x794f('0x30')][_0x794f('0x18')]);}_0x3f670d[_0x794f('0x38')]=qs[_0x794f('0x39')](_0x154540[_0x794f('0x30')][_0x794f('0x39')]);_0x3f670d['where']=qs[_0x794f('0x31')](_[_0x794f('0x3a')](_0x154540[_0x794f('0x30')],_0x3cdf79[_0x794f('0x31')]),_0x43f81a);if(_0x154540['query'][_0x794f('0x3b')]){_0x3f670d['where']=_['merge'](_0x3f670d[_0x794f('0x3c')],{'$or':_[_0x794f('0x2f')](_0x43f81a,function(_0x4eb53e){if(_0x4eb53e[_0x794f('0x2c')]!==_0x794f('0x3d')){var _0xe53e65={};_0xe53e65[_0x4eb53e['name']]={'$like':'%'+_0x154540['query']['filter']+'%'};return _0xe53e65;}})});}_0x3f670d=_[_0x794f('0x3e')]({},_0x3f670d,_0x154540['options']);var _0x5dac95={'where':_0x3f670d[_0x794f('0x3c')]};return db['OpenchannelApplication'][_0x794f('0x1b')](_0x5dac95)[_0x794f('0x20')](function(_0x107488){_0x429f32[_0x794f('0x1b')]=_0x107488;if(_0x154540[_0x794f('0x30')][_0x794f('0x3f')]){_0x3f670d[_0x794f('0x40')]=[{'all':!![]}];}return db[_0x794f('0x29')][_0x794f('0x41')](_0x3f670d);})[_0x794f('0x20')](function(_0x181182){_0x429f32[_0x794f('0x42')]=_0x181182;return _0x429f32;})[_0x794f('0x20')](respondWithFilteredResult(_0x2f3fbd,_0x3f670d))[_0x794f('0x43')](handleError(_0x2f3fbd,null));};exports[_0x794f('0x44')]=function(_0x38beb4,_0x5937a2){var _0x3cd7a1={'raw':!![],'where':{'id':_0x38beb4[_0x794f('0x45')]['id']}},_0x4e03e6={};_0x4e03e6[_0x794f('0x2e')]=_[_0x794f('0x46')](db[_0x794f('0x29')][_0x794f('0x2a')]);_0x4e03e6['query']=_[_0x794f('0x46')](_0x38beb4[_0x794f('0x30')]);_0x4e03e6[_0x794f('0x31')]=_[_0x794f('0x33')](_0x4e03e6[_0x794f('0x2e')],_0x4e03e6[_0x794f('0x30')]);_0x3cd7a1[_0x794f('0x32')]=_[_0x794f('0x33')](_0x4e03e6[_0x794f('0x2e')],qs['fields'](_0x38beb4[_0x794f('0x30')][_0x794f('0x34')]));_0x3cd7a1['attributes']=_0x3cd7a1['attributes'][_0x794f('0x35')]?_0x3cd7a1[_0x794f('0x32')]:_0x4e03e6[_0x794f('0x2e')];if(_0x38beb4[_0x794f('0x30')][_0x794f('0x3f')]){_0x3cd7a1['include']=[{'all':!![]}];}_0x3cd7a1=_[_0x794f('0x3e')]({},_0x3cd7a1,_0x38beb4['options']);return db[_0x794f('0x29')][_0x794f('0x47')](_0x3cd7a1)['then'](handleEntityNotFound(_0x5937a2,null))[_0x794f('0x20')](respondWithResult(_0x5937a2,null))[_0x794f('0x43')](handleError(_0x5937a2,null));};exports[_0x794f('0x48')]=function(_0x4c7323,_0x6615b9){return db[_0x794f('0x29')][_0x794f('0x48')](_0x4c7323['body'],{})[_0x794f('0x20')](respondWithResult(_0x6615b9,0xc9))[_0x794f('0x43')](handleError(_0x6615b9,null));};exports[_0x794f('0x49')]=function(_0x7ab0d9,_0x339ca2){if(_0x7ab0d9[_0x794f('0x4a')]['id']){delete _0x7ab0d9[_0x794f('0x4a')]['id'];}return db['OpenchannelApplication'][_0x794f('0x47')]({'where':{'id':_0x7ab0d9['params']['id']}})[_0x794f('0x20')](handleEntityNotFound(_0x339ca2,null))[_0x794f('0x20')](saveUpdates(_0x7ab0d9[_0x794f('0x4a')],null))[_0x794f('0x20')](respondWithResult(_0x339ca2,null))['catch'](handleError(_0x339ca2,null));};exports[_0x794f('0x21')]=function(_0x3208f3,_0x154cb6){return db['OpenchannelApplication']['find']({'where':{'id':_0x3208f3[_0x794f('0x45')]['id']}})[_0x794f('0x20')](handleEntityNotFound(_0x154cb6,null))[_0x794f('0x20')](removeEntity(_0x154cb6,null))[_0x794f('0x43')](handleError(_0x154cb6,null));}; \ No newline at end of file +var _0x225e=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','then','sendStatus','error','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','options','find','create','body','update','params','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x225e,0x10f));var _0xe225=function(_0x4feed0,_0x1eb034){_0x4feed0=_0x4feed0-0x0;var _0x3a8e74=_0x225e[_0x4feed0];return _0x3a8e74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe225('0x0'));var zipdir=require(_0xe225('0x1'));var jsonpatch=require(_0xe225('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe225('0x3'));var Mustache=require(_0xe225('0x4'));var util=require(_0xe225('0x5'));var path=require(_0xe225('0x6'));var sox=require(_0xe225('0x7'));var csv=require(_0xe225('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe225('0x9'));var _=require(_0xe225('0xa'));var squel=require(_0xe225('0xb'));var crypto=require(_0xe225('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe225('0xd'));var toCsv=require(_0xe225('0x8'));var querystring=require(_0xe225('0xe'));var Papa=require(_0xe225('0xf'));var Redis=require('ioredis');var authService=require(_0xe225('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe225('0x11'));var hardwareService=require(_0xe225('0x12'));var logger=require('../../config/logger')(_0xe225('0x13'));var utils=require(_0xe225('0x14'));var config=require(_0xe225('0x15'));var licenseUtil=require(_0xe225('0x16'));var db=require(_0xe225('0x17'))['db'];function respondWithStatusCode(_0x547c6f,_0x2ee62c){_0x2ee62c=_0x2ee62c||0xcc;return function(_0x4516e6){if(_0x4516e6){return _0x547c6f['sendStatus'](_0x2ee62c);}return _0x547c6f[_0xe225('0x18')](_0x2ee62c)[_0xe225('0x19')]();};}function respondWithResult(_0x4939d2,_0x15dd97){_0x15dd97=_0x15dd97||0xc8;return function(_0x59ae83){if(_0x59ae83){return _0x4939d2[_0xe225('0x18')](_0x15dd97)[_0xe225('0x1a')](_0x59ae83);}};}function respondWithFilteredResult(_0x5ce112,_0x39c42b){return function(_0x4711be){if(_0x4711be){var _0x4655cd=typeof _0x39c42b[_0xe225('0x1b')]===_0xe225('0x1c')&&typeof _0x39c42b[_0xe225('0x1d')]===_0xe225('0x1c');var _0x421911=_0x4711be[_0xe225('0x1e')];var _0x162dff=_0x4655cd?0x0:_0x39c42b[_0xe225('0x1b')];var _0x427f75=_0x4655cd?_0x4711be[_0xe225('0x1e')]:_0x39c42b['offset']+_0x39c42b[_0xe225('0x1d')];var _0x335618;if(_0x427f75>=_0x421911){_0x427f75=_0x421911;_0x335618=0xc8;}else{_0x335618=0xce;}_0x5ce112[_0xe225('0x18')](_0x335618);return _0x5ce112['set']('Content-Range',_0x162dff+'-'+_0x427f75+'/'+_0x421911)[_0xe225('0x1a')](_0x4711be);}return null;};}function patchUpdates(_0xea0d3a){return function(_0x51fa0b){try{jsonpatch[_0xe225('0x1f')](_0x51fa0b,_0xea0d3a,!![]);}catch(_0x54c62e){return BPromise[_0xe225('0x20')](_0x54c62e);}return _0x51fa0b[_0xe225('0x21')]();};}function saveUpdates(_0x369e72,_0x326b9a){return function(_0x330166){if(_0x330166){return _0x330166['update'](_0x369e72)[_0xe225('0x22')](function(_0x1fe26f){return _0x1fe26f;});}return null;};}function removeEntity(_0x2e708f,_0x5b5237){return function(_0x317292){if(_0x317292){return _0x317292['destroy']()[_0xe225('0x22')](function(){_0x2e708f[_0xe225('0x18')](0xcc)[_0xe225('0x19')]();});}};}function handleEntityNotFound(_0xa22c9b,_0x4ffbc5){return function(_0x551212){if(!_0x551212){_0xa22c9b[_0xe225('0x23')](0x194);}return _0x551212;};}function handleError(_0x41e018,_0xfb0a00){_0xfb0a00=_0xfb0a00||0x1f4;return function(_0x4752a3){logger[_0xe225('0x24')](_0x4752a3['stack']);if(_0x4752a3[_0xe225('0x25')]){delete _0x4752a3['name'];}_0x41e018[_0xe225('0x18')](_0xfb0a00)[_0xe225('0x26')](_0x4752a3);};}exports['index']=function(_0x3b9f63,_0x4f0a83){var _0x302ad9={},_0x504d58={},_0x3c8493={'count':0x0,'rows':[]};var _0x31a179=_[_0xe225('0x27')](db[_0xe225('0x28')][_0xe225('0x29')],function(_0x52f80e){return{'name':_0x52f80e[_0xe225('0x2a')],'type':_0x52f80e[_0xe225('0x2b')][_0xe225('0x2c')]};});_0x504d58[_0xe225('0x2d')]=_[_0xe225('0x27')](_0x31a179,_0xe225('0x25'));_0x504d58[_0xe225('0x2e')]=_[_0xe225('0x2f')](_0x3b9f63['query']);_0x504d58[_0xe225('0x30')]=_[_0xe225('0x31')](_0x504d58['model'],_0x504d58[_0xe225('0x2e')]);_0x302ad9[_0xe225('0x32')]=_[_0xe225('0x31')](_0x504d58['model'],qs[_0xe225('0x33')](_0x3b9f63[_0xe225('0x2e')]['fields']));_0x302ad9[_0xe225('0x32')]=_0x302ad9[_0xe225('0x32')][_0xe225('0x34')]?_0x302ad9[_0xe225('0x32')]:_0x504d58[_0xe225('0x2d')];if(!_0x3b9f63[_0xe225('0x2e')][_0xe225('0x35')](_0xe225('0x36'))){_0x302ad9[_0xe225('0x1d')]=qs[_0xe225('0x1d')](_0x3b9f63['query'][_0xe225('0x1d')]);_0x302ad9[_0xe225('0x1b')]=qs[_0xe225('0x1b')](_0x3b9f63['query']['offset']);}_0x302ad9[_0xe225('0x37')]=qs[_0xe225('0x38')](_0x3b9f63['query']['sort']);_0x302ad9[_0xe225('0x39')]=qs[_0xe225('0x30')](_['pick'](_0x3b9f63[_0xe225('0x2e')],_0x504d58[_0xe225('0x30')]),_0x31a179);if(_0x3b9f63[_0xe225('0x2e')][_0xe225('0x3a')]){_0x302ad9[_0xe225('0x39')]=_[_0xe225('0x3b')](_0x302ad9[_0xe225('0x39')],{'$or':_[_0xe225('0x27')](_0x31a179,function(_0x52d4d5){if(_0x52d4d5[_0xe225('0x2b')]!==_0xe225('0x3c')){var _0x2ed68f={};_0x2ed68f[_0x52d4d5[_0xe225('0x25')]]={'$like':'%'+_0x3b9f63[_0xe225('0x2e')][_0xe225('0x3a')]+'%'};return _0x2ed68f;}})});}_0x302ad9=_[_0xe225('0x3b')]({},_0x302ad9,_0x3b9f63['options']);var _0x24df0a={'where':_0x302ad9['where']};return db[_0xe225('0x28')]['count'](_0x24df0a)[_0xe225('0x22')](function(_0x5588f2){_0x3c8493[_0xe225('0x1e')]=_0x5588f2;if(_0x3b9f63[_0xe225('0x2e')]['includeAll']){_0x302ad9[_0xe225('0x3d')]=[{'all':!![]}];}return db[_0xe225('0x28')]['findAll'](_0x302ad9);})[_0xe225('0x22')](function(_0x1b0aa8){_0x3c8493[_0xe225('0x3e')]=_0x1b0aa8;return _0x3c8493;})[_0xe225('0x22')](respondWithFilteredResult(_0x4f0a83,_0x302ad9))[_0xe225('0x3f')](handleError(_0x4f0a83,null));};exports[_0xe225('0x40')]=function(_0x337587,_0x5a02d8){var _0x544ac5={'raw':!![],'where':{'id':_0x337587['params']['id']}},_0xb68ec3={};_0xb68ec3[_0xe225('0x2d')]=_[_0xe225('0x2f')](db[_0xe225('0x28')][_0xe225('0x29')]);_0xb68ec3[_0xe225('0x2e')]=_[_0xe225('0x2f')](_0x337587['query']);_0xb68ec3[_0xe225('0x30')]=_[_0xe225('0x31')](_0xb68ec3[_0xe225('0x2d')],_0xb68ec3[_0xe225('0x2e')]);_0x544ac5[_0xe225('0x32')]=_[_0xe225('0x31')](_0xb68ec3[_0xe225('0x2d')],qs['fields'](_0x337587['query']['fields']));_0x544ac5[_0xe225('0x32')]=_0x544ac5[_0xe225('0x32')][_0xe225('0x34')]?_0x544ac5[_0xe225('0x32')]:_0xb68ec3['model'];if(_0x337587[_0xe225('0x2e')][_0xe225('0x41')]){_0x544ac5[_0xe225('0x3d')]=[{'all':!![]}];}_0x544ac5=_[_0xe225('0x3b')]({},_0x544ac5,_0x337587[_0xe225('0x42')]);return db['OpenchannelApplication'][_0xe225('0x43')](_0x544ac5)[_0xe225('0x22')](handleEntityNotFound(_0x5a02d8,null))['then'](respondWithResult(_0x5a02d8,null))[_0xe225('0x3f')](handleError(_0x5a02d8,null));};exports['create']=function(_0x5cd1b9,_0x47893d){return db[_0xe225('0x28')][_0xe225('0x44')](_0x5cd1b9[_0xe225('0x45')],{})[_0xe225('0x22')](respondWithResult(_0x47893d,0xc9))[_0xe225('0x3f')](handleError(_0x47893d,null));};exports[_0xe225('0x46')]=function(_0x2dc6e0,_0x8919ed){if(_0x2dc6e0[_0xe225('0x45')]['id']){delete _0x2dc6e0['body']['id'];}return db[_0xe225('0x28')][_0xe225('0x43')]({'where':{'id':_0x2dc6e0[_0xe225('0x47')]['id']}})[_0xe225('0x22')](handleEntityNotFound(_0x8919ed,null))[_0xe225('0x22')](saveUpdates(_0x2dc6e0[_0xe225('0x45')],null))['then'](respondWithResult(_0x8919ed,null))[_0xe225('0x3f')](handleError(_0x8919ed,null));};exports[_0xe225('0x48')]=function(_0xab90a,_0x1648b8){return db[_0xe225('0x28')][_0xe225('0x43')]({'where':{'id':_0xab90a[_0xe225('0x47')]['id']}})[_0xe225('0x22')](handleEntityNotFound(_0x1648b8,null))['then'](removeEntity(_0x1648b8,null))['catch'](handleError(_0x1648b8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 39a5cae..928020a 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 _0x1185=['../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3acd47,_0x209abf){var _0x18b443=function(_0x31cb79){while(--_0x31cb79){_0x3acd47['push'](_0x3acd47['shift']());}};_0x18b443(++_0x209abf);}(_0x1185,0x139));var _0x5118=function(_0x190c3a,_0x1d00fe){_0x190c3a=_0x190c3a-0x0;var _0x11f4b1=_0x1185[_0x190c3a];return _0x11f4b1;};'use strict';var _=require(_0x5118('0x0'));var util=require(_0x5118('0x1'));var logger=require(_0x5118('0x2'))(_0x5118('0x3'));var moment=require(_0x5118('0x4'));var BPromise=require(_0x5118('0x5'));var rp=require(_0x5118('0x6'));var fs=require('fs');var path=require(_0x5118('0x7'));var rimraf=require(_0x5118('0x8'));var config=require(_0x5118('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x5118('0xa')]=function(_0x34ee24,_0x52f103){return _0x34ee24[_0x5118('0xb')](_0x5118('0xc'),attributes,{'tableName':_0x5118('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x96ed=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications'];(function(_0x1541c6,_0x170408){var _0x41901b=function(_0x517db0){while(--_0x517db0){_0x1541c6['push'](_0x1541c6['shift']());}};_0x41901b(++_0x170408);}(_0x96ed,0x6a));var _0xd96e=function(_0x54cd29,_0x36f6fb){_0x54cd29=_0x54cd29-0x0;var _0x25d484=_0x96ed[_0x54cd29];return _0x25d484;};'use strict';var _=require(_0xd96e('0x0'));var util=require(_0xd96e('0x1'));var logger=require(_0xd96e('0x2'))(_0xd96e('0x3'));var moment=require('moment');var BPromise=require(_0xd96e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd96e('0x5'));var config=require(_0xd96e('0x6'));var attributes=require(_0xd96e('0x7'));module['exports']=function(_0x1b4358,_0x3273bc){return _0x1b4358[_0xd96e('0x8')](_0xd96e('0x9'),attributes,{'tableName':_0xd96e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd96e('0xb'),'collate':_0xd96e('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index c058db2..caf3dd1 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 _0x0949=['debug','stringify','error','code','message','result','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0949,0x13b));var _0x9094=function(_0x1083f0,_0x190add){_0x1083f0=_0x1083f0-0x0;var _0x3e671f=_0x0949[_0x1083f0];return _0x3e671f;};'use strict';var _=require(_0x9094('0x0'));var util=require(_0x9094('0x1'));var moment=require(_0x9094('0x2'));var BPromise=require(_0x9094('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9094('0x4'))['db'];var utils=require(_0x9094('0x5'));var logger=require(_0x9094('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9094('0x7'));var client=jayson[_0x9094('0x8')][_0x9094('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf8cd,_0x2cc98b,_0x41f4d7){return new BPromise(function(_0x21bbf8,_0x19884e){return client[_0x9094('0xa')](_0x3bf8cd,_0x41f4d7)[_0x9094('0xb')](function(_0x50ceb7){logger[_0x9094('0xc')](_0x9094('0xd'),_0x2cc98b,_0x9094('0xe'));logger[_0x9094('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2cc98b,_0x9094('0xe'),JSON[_0x9094('0x10')](_0x50ceb7));if(_0x50ceb7['error']){if(_0x50ceb7[_0x9094('0x11')][_0x9094('0x12')]===0x1f4){logger[_0x9094('0x11')](_0x9094('0xd'),_0x2cc98b,_0x50ceb7['error'][_0x9094('0x13')]);return _0x19884e(_0x50ceb7[_0x9094('0x11')]['message']);}logger['error'](_0x9094('0xd'),_0x2cc98b,_0x50ceb7[_0x9094('0x11')]['message']);return _0x21bbf8(_0x50ceb7[_0x9094('0x11')][_0x9094('0x13')]);}else{logger[_0x9094('0xc')](_0x9094('0xd'),_0x2cc98b,'request\x20sent');_0x21bbf8(_0x50ceb7[_0x9094('0x14')][_0x9094('0x13')]);}})['catch'](function(_0x53d938){logger[_0x9094('0x11')](_0x9094('0xd'),_0x2cc98b,_0x53d938);_0x19884e(_0x53d938);});});}exports[_0x9094('0x15')]=function(_0x3aed5f){var _0x578014=this;return new Promise(function(_0x1c2af6,_0x4775ec){return db['OpenchannelApplication'][_0x9094('0x16')](_0x3aed5f[_0x9094('0x17')],{'raw':_0x3aed5f[_0x9094('0x18')]?_0x3aed5f[_0x9094('0x18')][_0x9094('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aed5f[_0x9094('0x18')]?_0x3aed5f[_0x9094('0x18')][_0x9094('0x1a')]||null:null,'attributes':_0x3aed5f['options']?_0x3aed5f[_0x9094('0x18')][_0x9094('0x1b')]||null:null,'limit':_0x3aed5f[_0x9094('0x18')]?_0x3aed5f['options'][_0x9094('0x1c')]||null:null})[_0x9094('0xb')](function(_0x3eddc6){logger[_0x9094('0xc')](_0x9094('0x15'),_0x3aed5f);logger[_0x9094('0xf')](_0x9094('0x15'),_0x3aed5f,JSON[_0x9094('0x10')](_0x3eddc6));_0x1c2af6(_0x3eddc6);})[_0x9094('0x1d')](function(_0x1421d9){logger[_0x9094('0x11')]('UpdateOpenchannelApplication',_0x1421d9['message'],_0x3aed5f);_0x4775ec(_0x578014[_0x9094('0x11')](0x1f4,_0x1421d9[_0x9094('0x13')]));});});}; \ No newline at end of file +var _0x248c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','then','debug','lodash','util'];(function(_0x39d872,_0x56f195){var _0x4f6471=function(_0x591f88){while(--_0x591f88){_0x39d872['push'](_0x39d872['shift']());}};_0x4f6471(++_0x56f195);}(_0x248c,0x1de));var _0xc248=function(_0x141448,_0x188873){_0x141448=_0x141448-0x0;var _0x5e5ddd=_0x248c[_0x141448];return _0x5e5ddd;};'use strict';var _=require(_0xc248('0x0'));var util=require(_0xc248('0x1'));var moment=require(_0xc248('0x2'));var BPromise=require(_0xc248('0x3'));var rs=require(_0xc248('0x4'));var fs=require('fs');var Redis=require(_0xc248('0x5'));var db=require(_0xc248('0x6'))['db'];var utils=require(_0xc248('0x7'));var logger=require(_0xc248('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc248('0x9'));var client=jayson[_0xc248('0xa')][_0xc248('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fdf1c,_0x361761,_0x305f88){return new BPromise(function(_0x519d0e,_0x254283){return client[_0xc248('0xc')](_0x3fdf1c,_0x305f88)['then'](function(_0x1b2059){logger[_0xc248('0xd')](_0xc248('0xe'),_0x361761,_0xc248('0xf'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x361761,_0xc248('0xf'),JSON[_0xc248('0x10')](_0x1b2059));if(_0x1b2059[_0xc248('0x11')]){if(_0x1b2059[_0xc248('0x11')][_0xc248('0x12')]===0x1f4){logger[_0xc248('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x361761,_0x1b2059[_0xc248('0x11')][_0xc248('0x13')]);return _0x254283(_0x1b2059[_0xc248('0x11')]['message']);}logger[_0xc248('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x361761,_0x1b2059[_0xc248('0x11')][_0xc248('0x13')]);return _0x519d0e(_0x1b2059[_0xc248('0x11')][_0xc248('0x13')]);}else{logger['info'](_0xc248('0xe'),_0x361761,_0xc248('0xf'));_0x519d0e(_0x1b2059[_0xc248('0x14')][_0xc248('0x13')]);}})[_0xc248('0x15')](function(_0x5cccac){logger['error'](_0xc248('0xe'),_0x361761,_0x5cccac);_0x254283(_0x5cccac);});});}exports[_0xc248('0x16')]=function(_0x12627a){var _0x3dbab3=this;return new Promise(function(_0x378b30,_0x4f3557){return db[_0xc248('0x17')][_0xc248('0x18')](_0x12627a[_0xc248('0x19')],{'raw':_0x12627a[_0xc248('0x1a')]?_0x12627a['options'][_0xc248('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12627a[_0xc248('0x1a')]?_0x12627a[_0xc248('0x1a')]['where']||null:null,'attributes':_0x12627a[_0xc248('0x1a')]?_0x12627a[_0xc248('0x1a')][_0xc248('0x1c')]||null:null,'limit':_0x12627a[_0xc248('0x1a')]?_0x12627a[_0xc248('0x1a')][_0xc248('0x1d')]||null:null})[_0xc248('0x1e')](function(_0x5de8a4){logger[_0xc248('0xd')](_0xc248('0x16'),_0x12627a);logger[_0xc248('0x1f')](_0xc248('0x16'),_0x12627a,JSON[_0xc248('0x10')](_0x5de8a4));_0x378b30(_0x5de8a4);})[_0xc248('0x15')](function(_0x471eda){logger['error'](_0xc248('0x16'),_0x471eda[_0xc248('0x13')],_0x12627a);_0x4f3557(_0x3dbab3[_0xc248('0x11')](0x1f4,_0x471eda['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 3469534..53b86ee 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 _0xe8f0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','/:id/download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','update','delete','/:id','removeTags','util','path','connect-timeout'];(function(_0x365788,_0x3370aa){var _0x1cef52=function(_0x15b2b5){while(--_0x15b2b5){_0x365788['push'](_0x365788['shift']());}};_0x1cef52(++_0x3370aa);}(_0xe8f0,0x11b));var _0x0e8f=function(_0x4c75f1,_0x122c13){_0x4c75f1=_0x4c75f1-0x0;var _0x4ccb7c=_0xe8f0[_0x4c75f1];return _0x4ccb7c;};'use strict';var multer=require('multer');var util=require(_0x0e8f('0x0'));var path=require(_0x0e8f('0x1'));var timeout=require(_0x0e8f('0x2'));var express=require(_0x0e8f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e8f('0x4'));var interaction=require(_0x0e8f('0x5'));var config=require(_0x0e8f('0x6'));var controller=require(_0x0e8f('0x7'));router[_0x0e8f('0x8')]('/',auth[_0x0e8f('0x9')](),controller['index']);router[_0x0e8f('0x8')](_0x0e8f('0xa'),auth[_0x0e8f('0x9')](),controller[_0x0e8f('0xb')]);router['get']('/:id',auth[_0x0e8f('0x9')](),controller['show']);router[_0x0e8f('0x8')](_0x0e8f('0xc'),auth[_0x0e8f('0x9')](),controller['getMessages']);router['get'](_0x0e8f('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0e8f('0x9')](),controller[_0x0e8f('0xe')]);router[_0x0e8f('0xf')](_0x0e8f('0xc'),auth[_0x0e8f('0x9')](),controller[_0x0e8f('0x10')]);router[_0x0e8f('0xf')](_0x0e8f('0x11'),auth[_0x0e8f('0x9')](),interaction['tracked'](_0x0e8f('0x12'),_0x0e8f('0x13')),controller['addTags']);router[_0x0e8f('0x14')]('/:id',auth[_0x0e8f('0x9')](),interaction[_0x0e8f('0x15')](_0x0e8f('0x12'),'openchannelinteraction:update'),controller[_0x0e8f('0x16')]);router[_0x0e8f('0x17')](_0x0e8f('0x18'),auth[_0x0e8f('0x9')](),interaction['tracked'](_0x0e8f('0x12'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x0e8f('0x17')](_0x0e8f('0x11'),auth[_0x0e8f('0x9')](),controller[_0x0e8f('0x19')]);module['exports']=router; \ No newline at end of file +var _0x9eba=['../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','/:id','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0x9eba,0x162));var _0xa9eb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9eba[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xa9eb('0x0'));var util=require(_0xa9eb('0x1'));var path=require(_0xa9eb('0x2'));var timeout=require(_0xa9eb('0x3'));var express=require('express');var router=express[_0xa9eb('0x4')]();var fs_extra=require(_0xa9eb('0x5'));var auth=require(_0xa9eb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa9eb('0x7'));var controller=require(_0xa9eb('0x8'));router[_0xa9eb('0x9')]('/',auth[_0xa9eb('0xa')](),controller['index']);router[_0xa9eb('0x9')]('/describe',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa9eb('0x9')](_0xa9eb('0xc'),auth[_0xa9eb('0xa')](),controller[_0xa9eb('0xd')]);router[_0xa9eb('0x9')](_0xa9eb('0xe'),auth[_0xa9eb('0xa')](),controller[_0xa9eb('0xf')]);router[_0xa9eb('0x10')]('/',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x11')]);router['post'](_0xa9eb('0xc'),auth['isAuthenticated'](),controller[_0xa9eb('0x12')]);router[_0xa9eb('0x10')](_0xa9eb('0x13'),auth['isAuthenticated'](),interaction[_0xa9eb('0x14')]('openchannel',_0xa9eb('0x15')),controller['addTags']);router[_0xa9eb('0x16')]('/:id',auth[_0xa9eb('0xa')](),interaction[_0xa9eb('0x14')](_0xa9eb('0x17'),_0xa9eb('0x18')),controller['update']);router['delete'](_0xa9eb('0x19'),auth[_0xa9eb('0xa')](),interaction[_0xa9eb('0x14')](_0xa9eb('0x17'),_0xa9eb('0x1a')),controller[_0xa9eb('0x1b')]);router['delete']('/:id/tags',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x1c')]);module[_0xa9eb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9083fd0..5c7c9d2 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 _0x35a9=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4853a6,_0x33f9e7){var _0x22425d=function(_0x5b73fd){while(--_0x5b73fd){_0x4853a6['push'](_0x4853a6['shift']());}};_0x22425d(++_0x33f9e7);}(_0x35a9,0x73));var _0x935a=function(_0x53e9,_0x33fd76){_0x53e9=_0x53e9-0x0;var _0x269566=_0x35a9[_0x53e9];return _0x269566;};'use strict';var Sequelize=require('sequelize');module[_0x935a('0x0')]={'closed':{'type':Sequelize[_0x935a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x935a('0x2')]},'disposition':{'type':Sequelize[_0x935a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x935a('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x935a('0x3')]},'externalUrl':{'type':Sequelize[_0x935a('0x3')]},'lastMsgAt':{'type':Sequelize[_0x935a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x935a('0x4')]('in',_0x935a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x935a('0x4')]('in',_0x935a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x935a('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6732=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0xc41365,_0x35d774){var _0x388102=function(_0x44a91a){while(--_0x44a91a){_0xc41365['push'](_0xc41365['shift']());}};_0x388102(++_0x35d774);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2673('0x0'));module[_0x2673('0x1')]={'closed':{'type':Sequelize[_0x2673('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2673('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2673('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2673('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2673('0x3')]},'threadId':{'type':Sequelize[_0x2673('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2673('0x5')]('in',_0x2673('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x2673('0x5')]('in',_0x2673('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2673('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2673('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 ca262d9..02869c1 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 _0xb59c=['map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','update','body','describe','addMessage','ids','getMessages','findOne','hasOwnProperty','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','direction','secret','read','OpenchannelAccount','Account','Owner','createdAt','closed','closedAt','disposition','threadId','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','error','stack','name','send'];(function(_0x2e3f07,_0x41a0e8){var _0x5835f9=function(_0xf28dfc){while(--_0xf28dfc){_0x2e3f07['push'](_0x2e3f07['shift']());}};_0x5835f9(++_0x41a0e8);}(_0xb59c,0x1e8));var _0xcb59=function(_0x1f80c6,_0x447da3){_0x1f80c6=_0x1f80c6-0x0;var _0x178e39=_0xb59c[_0x1f80c6];return _0x178e39;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcb59('0x0'));var moment=require('moment');var util=require(_0xcb59('0x1'));var path=require(_0xcb59('0x2'));var ejs=require(_0xcb59('0x3'));var fs=require('fs');var _=require(_0xcb59('0x4'));var Redis=require(_0xcb59('0x5'));var interaction=require(_0xcb59('0x6'));var qs=require(_0xcb59('0x7'));var pdf=require(_0xcb59('0x8'));var logger=require('../../config/logger')(_0xcb59('0x9'));var config=require(_0xcb59('0xa'));var db=require(_0xcb59('0xb'))['db'];config['redis']=_['defaults'](config[_0xcb59('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb59('0xd'))(new Redis(config[_0xcb59('0xc')]));require(_0xcb59('0xe'))[_0xcb59('0xf')](socket);function respondWithStatusCode(_0x109621,_0xf63f6a){_0xf63f6a=_0xf63f6a||0xcc;return function(_0x240f0f){if(_0x240f0f){return _0x109621['sendStatus'](_0xf63f6a);}return _0x109621[_0xcb59('0x10')](_0xf63f6a)[_0xcb59('0x11')]();};}function respondWithResult(_0xa2fa47,_0x8e7d6a){_0x8e7d6a=_0x8e7d6a||0xc8;return function(_0x4883ea){if(_0x4883ea){return _0xa2fa47[_0xcb59('0x10')](_0x8e7d6a)[_0xcb59('0x12')](_0x4883ea);}};}function respondWithFilteredResult(_0x1e51dc,_0x3b501d){return function(_0x3ecd5d){if(_0x3ecd5d){var _0x232b6b=typeof _0x3b501d[_0xcb59('0x13')]===_0xcb59('0x14')&&typeof _0x3b501d['limit']===_0xcb59('0x14');var _0x538ec5=_0x3ecd5d['count'];var _0x120d59=_0x232b6b?0x0:_0x3b501d[_0xcb59('0x13')];var _0x379f19=_0x232b6b?_0x3ecd5d[_0xcb59('0x15')]:_0x3b501d[_0xcb59('0x13')]+_0x3b501d[_0xcb59('0x16')];var _0x4a9898;if(_0x379f19>=_0x538ec5){_0x379f19=_0x538ec5;_0x4a9898=0xc8;}else{_0x4a9898=0xce;}_0x1e51dc[_0xcb59('0x10')](_0x4a9898);return _0x1e51dc[_0xcb59('0x17')](_0xcb59('0x18'),_0x120d59+'-'+_0x379f19+'/'+_0x538ec5)['json'](_0x3ecd5d);}return null;};}function saveUpdates(_0x11a6f8){return function(_0x4e1701){if(_0x4e1701){return _0x4e1701['update'](_0x11a6f8)[_0xcb59('0x19')](function(_0xcd0397){return _0xcd0397;});}return null;};}function removeEntity(_0x2a4aa2){return function(_0x1033ba){if(_0x1033ba){return _0x1033ba[_0xcb59('0x1a')]()[_0xcb59('0x19')](function(){_0x2a4aa2[_0xcb59('0x10')](0xcc)[_0xcb59('0x11')]();});}};}function handleEntityNotFound(_0x129df4){return function(_0x9c0fce){if(!_0x9c0fce){_0x129df4[_0xcb59('0x1b')](0x194);}return _0x9c0fce;};}function handleError(_0x5a9f03,_0x5745c7){_0x5745c7=_0x5745c7||0x1f4;return function(_0x56d969){logger[_0xcb59('0x1c')](_0x56d969[_0xcb59('0x1d')]);if(_0x56d969[_0xcb59('0x1e')]){delete _0x56d969[_0xcb59('0x1e')];}_0x5a9f03['status'](_0x5745c7)[_0xcb59('0x1f')](_0x56d969);};}exports['index']=function(_0x55abbe,_0xef7884){var _0xa66d68={};var _0x5b4fb7=_[_0xcb59('0x20')](db[_0xcb59('0x21')][_0xcb59('0x22')],function(_0x4eca41){return{'name':_0x4eca41[_0xcb59('0x23')],'type':_0x4eca41[_0xcb59('0x24')][_0xcb59('0x25')]};});_0xa66d68=qs[_0xcb59('0x26')](_0x5b4fb7,_0x55abbe);return interaction[_0xcb59('0x27')]('openchannel',_0x55abbe[_0xcb59('0x28')],_0x55abbe[_0xcb59('0x29')],_0xa66d68,_0x5b4fb7)[_0xcb59('0x19')](respondWithFilteredResult(_0xef7884,_0xa66d68))[_0xcb59('0x2a')](handleError(_0xef7884,null));};exports[_0xcb59('0x2b')]=function(_0x557013,_0x12e94a){var _0x1a7100={};if(_0x557013[_0xcb59('0x28')][_0xcb59('0x24')]&&_0x557013[_0xcb59('0x28')][_0xcb59('0x24')]===_0xcb59('0x2c')){_0x1a7100[_0xcb59('0x2c')]=_0x557013[_0xcb59('0x2d')]['id'];}else{_0x1a7100['id']=_0x557013[_0xcb59('0x2d')]['id'];}var _0x123fc7={'raw':![],'where':_0x1a7100},_0x527e4d={};_0x527e4d[_0xcb59('0x2e')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x527e4d[_0xcb59('0x28')]=_[_0xcb59('0x2f')](_0x557013[_0xcb59('0x28')]);_0x527e4d[_0xcb59('0x30')]=_[_0xcb59('0x31')](_0x527e4d[_0xcb59('0x2e')],_0x527e4d[_0xcb59('0x28')]);_0x123fc7[_0xcb59('0x32')]=_[_0xcb59('0x31')](_0x527e4d[_0xcb59('0x2e')],qs['fields'](_0x557013['query'][_0xcb59('0x33')]));_0x123fc7[_0xcb59('0x32')]=_0x123fc7[_0xcb59('0x32')][_0xcb59('0x34')]?_0x123fc7[_0xcb59('0x32')]:_0x527e4d[_0xcb59('0x2e')];if(_0x557013[_0xcb59('0x28')][_0xcb59('0x35')]){_0x123fc7[_0xcb59('0x36')]=[{'all':!![]}];}_0x123fc7=_[_0xcb59('0x37')]({},_0x123fc7,_0x557013[_0xcb59('0x38')]);return db['OpenchannelInteraction'][_0xcb59('0x39')](_0x123fc7)[_0xcb59('0x19')](handleEntityNotFound(_0x12e94a,null))[_0xcb59('0x19')](respondWithResult(_0x12e94a,null))[_0xcb59('0x2a')](handleError(_0x12e94a,null));};exports[_0xcb59('0x3a')]=function(_0x197259,_0x5ac4a7){return db['OpenchannelInteraction'][_0xcb59('0x3a')](_0x197259['body'],{})[_0xcb59('0x19')](respondWithResult(_0x5ac4a7,0xc9))[_0xcb59('0x2a')](handleError(_0x5ac4a7,null));};exports[_0xcb59('0x3b')]=function(_0x22f504,_0xf9eaaa){if(_0x22f504[_0xcb59('0x3c')]['id']){delete _0x22f504[_0xcb59('0x3c')]['id'];}return db[_0xcb59('0x21')][_0xcb59('0x39')]({'where':{'id':_0x22f504[_0xcb59('0x2d')]['id']}})[_0xcb59('0x19')](handleEntityNotFound(_0xf9eaaa,null))[_0xcb59('0x19')](saveUpdates(_0x22f504[_0xcb59('0x3c')],null))[_0xcb59('0x19')](respondWithResult(_0xf9eaaa,null))[_0xcb59('0x2a')](handleError(_0xf9eaaa,null));};exports['destroy']=function(_0x309398,_0x1bf810){return db[_0xcb59('0x21')]['find']({'where':{'id':_0x309398[_0xcb59('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1bf810,null))[_0xcb59('0x19')](removeEntity(_0x1bf810,null))[_0xcb59('0x2a')](handleError(_0x1bf810,null));};exports[_0xcb59('0x3d')]=function(_0x37146f,_0x4f29e9){return db[_0xcb59('0x21')][_0xcb59('0x3d')]()[_0xcb59('0x19')](respondWithResult(_0x4f29e9,null))[_0xcb59('0x2a')](handleError(_0x4f29e9,null));};exports[_0xcb59('0x3e')]=function(_0x4e3d94,_0x5534b3){return db['OpenchannelMessage'][_0xcb59('0x39')]({'where':{'id':_0x4e3d94[_0xcb59('0x2d')]['id']}})[_0xcb59('0x19')](handleEntityNotFound(_0x5534b3,null))[_0xcb59('0x19')](function(_0x5d7c03){if(_0x5d7c03){return _0x5d7c03['addMessage'](_0x4e3d94['body']['ids'],_['omit'](_0x4e3d94['body'],[_0xcb59('0x3f'),'id'])||{});}})[_0xcb59('0x19')](respondWithResult(_0x5534b3,null))[_0xcb59('0x2a')](handleError(_0x5534b3,null));};exports[_0xcb59('0x40')]=function(_0x13b3cc,_0x24e495){var _0x4c18ed={'raw':![],'where':{}};var _0x7ac04b={};var _0x5cc3dd={'count':0x0,'rows':[]};return db[_0xcb59('0x21')][_0xcb59('0x41')]({'where':{'id':_0x13b3cc[_0xcb59('0x2d')]['id']}})[_0xcb59('0x19')](handleEntityNotFound(_0x24e495,null))['then'](function(_0x1b89de){if(_0x1b89de){_0x7ac04b[_0xcb59('0x2e')]=_[_0xcb59('0x2f')](db['OpenchannelMessage']['rawAttributes']);_0x7ac04b[_0xcb59('0x28')]=_[_0xcb59('0x2f')](_0x13b3cc['query']);_0x7ac04b[_0xcb59('0x30')]=_[_0xcb59('0x31')](_0x7ac04b[_0xcb59('0x2e')],_0x7ac04b[_0xcb59('0x28')]);_0x4c18ed[_0xcb59('0x32')]=_[_0xcb59('0x31')](_0x7ac04b[_0xcb59('0x2e')],qs[_0xcb59('0x33')](_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x33')]));_0x4c18ed[_0xcb59('0x32')]=_0x4c18ed['attributes']['length']?_0x4c18ed[_0xcb59('0x32')]:_0x7ac04b[_0xcb59('0x2e')];if(!_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x42')]('nolimit')){_0x4c18ed[_0xcb59('0x16')]=qs[_0xcb59('0x16')](_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x16')]);_0x4c18ed[_0xcb59('0x13')]=qs[_0xcb59('0x13')](_0x13b3cc[_0xcb59('0x28')]['offset']);}_0x4c18ed[_0xcb59('0x43')]=qs[_0xcb59('0x44')](_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x44')]);_0x4c18ed['where']=qs[_0xcb59('0x30')](_['pick'](_0x13b3cc[_0xcb59('0x28')],_0x7ac04b['filters']));_0x4c18ed[_0xcb59('0x45')]['OpenchannelInteractionId']=_0x1b89de['id'];if(_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x46')]){_0x4c18ed[_0xcb59('0x45')]=_['merge'](_0x4c18ed['where'],{'$or':_[_0xcb59('0x20')](_0x4c18ed[_0xcb59('0x32')],function(_0x506ada){var _0xd76208={};_0xd76208[_0x506ada]={'$like':'%'+_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x46')]+'%'};return _0xd76208;})});}if(_0x13b3cc[_0xcb59('0x28')]['$gte']){var _0x29d3e8=_0x13b3cc[_0xcb59('0x28')][_0xcb59('0x47')][_0xcb59('0x48')](',');var _0xcfbb8a={};_0xcfbb8a[_0x29d3e8[0x0]]={'$gte':moment(_0x29d3e8[0x1])[_0xcb59('0x49')](_0xcb59('0x4a'))};_0x4c18ed[_0xcb59('0x45')]=_[_0xcb59('0x37')](_0x4c18ed[_0xcb59('0x45')],_0xcfbb8a);}_0x4c18ed=_[_0xcb59('0x37')]({},_0x4c18ed,_0x13b3cc[_0xcb59('0x38')]);return db[_0xcb59('0x4b')][_0xcb59('0x15')]({'where':_0x4c18ed[_0xcb59('0x45')]})[_0xcb59('0x19')](function(_0x22598e){_0x5cc3dd[_0xcb59('0x15')]=_0x22598e;if(_0x13b3cc[_0xcb59('0x28')]['includeAll']){_0x4c18ed['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xcb59('0x27')](_0x4c18ed);})[_0xcb59('0x19')](function(_0x815b03){_0x5cc3dd['rows']=_0x815b03;return _0x5cc3dd;});}})[_0xcb59('0x19')](respondWithFilteredResult(_0x24e495,_0x4c18ed))[_0xcb59('0x2a')](handleError(_0x24e495,null));};exports[_0xcb59('0x4c')]=function(_0x7e2bc5,_0x22c87c){return db[_0xcb59('0x21')]['find']({'where':{'id':_0x7e2bc5['params']['id']}})[_0xcb59('0x19')](handleEntityNotFound(_0x22c87c,null))[_0xcb59('0x19')](function(_0x3bcbf0){if(_0x3bcbf0){return _0x3bcbf0[_0xcb59('0x4d')](_0x7e2bc5[_0xcb59('0x3c')][_0xcb59('0x3f')],_['omit'](_0x7e2bc5[_0xcb59('0x3c')],[_0xcb59('0x3f'),'id'])||{})[_0xcb59('0x4e')](function(){return db['Tag'][_0xcb59('0x27')]({'attributes':['id',_0xcb59('0x1e'),_0xcb59('0x4f')],'where':{'id':_0x7e2bc5[_0xcb59('0x3c')]['ids']}});})[_0xcb59('0x19')](function(_0x4828bd){socket[_0xcb59('0x50')](_0xcb59('0x51'),{'id':Number(_0x7e2bc5[_0xcb59('0x2d')]['id']),'tags':_0x4828bd||[]});return{'id':Number(_0x7e2bc5[_0xcb59('0x2d')]['id']),'tags':_0x4828bd||[]};});}})[_0xcb59('0x19')](respondWithResult(_0x22c87c,null))[_0xcb59('0x2a')](handleError(_0x22c87c,null));};exports[_0xcb59('0x52')]=function(_0x55cea1,_0x5a8c1f){return db[_0xcb59('0x21')][_0xcb59('0x39')]({'where':{'id':_0x55cea1['params']['id']}})['then'](handleEntityNotFound(_0x5a8c1f,null))[_0xcb59('0x19')](function(_0x57c4ea){if(_0x57c4ea){return _0x57c4ea[_0xcb59('0x52')](_0x55cea1[_0xcb59('0x28')][_0xcb59('0x3f')]);}})[_0xcb59('0x19')](respondWithStatusCode(_0x5a8c1f,null))[_0xcb59('0x2a')](handleError(_0x5a8c1f,null));};exports[_0xcb59('0x53')]=function(_0xa7e233,_0x48b630){var _0x5d7674=moment()[_0xcb59('0x54')]()[_0xcb59('0x55')]();var _0x3f13d3=path[_0xcb59('0x56')](config[_0xcb59('0x57')],_0xcb59('0x58'),_0xcb59('0x59'),_0xcb59('0x5a'));var _0x37c271=path[_0xcb59('0x56')](config[_0xcb59('0x57')],_0xcb59('0x58'),_0xcb59('0x59'),_0xcb59('0x5b'));var _0x3144ad=path[_0xcb59('0x56')](_0x3f13d3,_0x5d7674);var _0x2d5996=util[_0xcb59('0x49')](_0xcb59('0x5c'),_0xa7e233[_0xcb59('0x2d')]['id'],_0x5d7674);var _0x55f17f=path[_0xcb59('0x56')](_0x3f13d3,_0x2d5996);var _0x47be61=[];_0x47be61[_0xcb59('0x5d')]({'model':db[_0xcb59('0x5e')],'as':'User','attributes':['id',_0xcb59('0x5f')],'raw':!![]});_0x47be61['push']({'model':db[_0xcb59('0x60')],'as':_0xcb59('0x61'),'attributes':['id',_0xcb59('0x62'),_0xcb59('0x63')],'raw':!![]});if(_0xa7e233['query'][_0xcb59('0x5b')]){_0x47be61[_0xcb59('0x5d')]({'model':db[_0xcb59('0x64')],'as':_0xcb59('0x64'),'raw':!![]});}var _0xe19287=[{'model':db[_0xcb59('0x4b')],'as':'Messages','attributes':['id',_0xcb59('0x3c'),'createdAt',_0xcb59('0x65'),_0xcb59('0x66'),_0xcb59('0x67')],'include':_0x47be61}];_0xe19287[_0xcb59('0x5d')]({'model':db[_0xcb59('0x68')],'as':_0xcb59('0x69'),'attributes':['id',_0xcb59('0x1e')]});_0xe19287['push']({'model':db[_0xcb59('0x5e')],'as':_0xcb59('0x6a'),'attributes':['id','fullname']});return db[_0xcb59('0x21')][_0xcb59('0x39')]({'where':{'id':_0xa7e233['params']['id']},'include':_0xe19287})[_0xcb59('0x19')](handleEntityNotFound(_0x48b630,null))[_0xcb59('0x19')](function(_0x15278d){if(_0x15278d){var _0x446ed8=_0x15278d['get']({'plain':!![]});fs['mkdirSync'](_0x3144ad);var _0x177e6e={'channel':'Openchannel','account':_0x446ed8[_0xcb59('0x69')][_0xcb59('0x1e')],'agent':_0x446ed8[_0xcb59('0x6a')]?_0x446ed8[_0xcb59('0x6a')]['fullname']:'N.A.','createdAt':moment(_0x446ed8[_0xcb59('0x6b')])[_0xcb59('0x49')](_0xcb59('0x4a'))[_0xcb59('0x55')](),'closedAt':_0x446ed8[_0xcb59('0x6c')]?moment(_0x446ed8[_0xcb59('0x6d')])[_0xcb59('0x49')](_0xcb59('0x4a'))[_0xcb59('0x55')]():'','disposition':_0x446ed8[_0xcb59('0x6e')],'visibility':_0x446ed8[_0xcb59('0x6f')]?'Public':_0xcb59('0x70'),'messages':_(_0x446ed8[_0xcb59('0x71')])[_0xcb59('0x46')]({'secret':![]})['map'](function(_0x1161ce){if(_0x1161ce[_0xcb59('0x64')]){var _0x1c90e2=path[_0xcb59('0x56')](_0x37c271,_0x1161ce['Attachment'][_0xcb59('0x72')]);if(fs[_0xcb59('0x73')](_0x1c90e2)){fs[_0xcb59('0x74')](_0x1c90e2)[_0xcb59('0x75')](fs[_0xcb59('0x76')](path[_0xcb59('0x56')](_0x3144ad,_0x1161ce[_0xcb59('0x64')]['basename'])));}}return{'date':moment(_0x1161ce[_0xcb59('0x6b')])[_0xcb59('0x49')](_0xcb59('0x4a'))[_0xcb59('0x55')](),'sender':_0x1161ce[_0xcb59('0x65')]===_0xcb59('0x77')?_0x1161ce['User']?_0x1161ce['User'][_0xcb59('0x5f')]:_0xcb59('0x78'):_0x1161ce['Contact'][_0xcb59('0x62')]+(_0x1161ce[_0xcb59('0x61')][_0xcb59('0x63')]?'\x20'+_0x1161ce[_0xcb59('0x61')]['lastName']:''),'body':_0x1161ce['Attachment']?_0x1161ce[_0xcb59('0x64')][_0xcb59('0x72')]:_0x1161ce['body'],'direction':_0x1161ce[_0xcb59('0x65')]===_0xcb59('0x77')?'A':'C','secret':_0x1161ce[_0xcb59('0x66')],'read':_0x1161ce[_0xcb59('0x67')],'attachment':_0x1161ce[_0xcb59('0x64')]};})[_0xcb59('0x79')]()};return ejs['renderFile'](path['join'](config[_0xcb59('0x57')],_0xcb59('0x58'),_0xcb59('0x7a'),_0xcb59('0x7b')),{'interaction':_0x177e6e})['then'](function(_0x3f8363){var _0x4cac6e=path[_0xcb59('0x56')](_0x3144ad,_0xcb59('0x7c')+_0x446ed8['id']+'-'+_0x5d7674+_0xcb59('0x7d'));var _0x4bceb0={'path':_0x4cac6e,'channel':_0xcb59('0x7e'),'interactionId':_0x446ed8['id']};return pdf[_0xcb59('0x7f')](_0x3f8363,_0x4bceb0);})[_0xcb59('0x19')](function(){return new Promise(function(_0x520e79,_0x44ec56){zipdir(_0x3144ad,{'saveTo':_0x55f17f},function(_0x39a8d9,_0x593fd2){if(_0x39a8d9)return _0x44ec56(_0x39a8d9);return _0x520e79(_0x593fd2);});})[_0xcb59('0x19')](function(){return new Promise(function(_0x3b3eb7,_0x14f43c){rimraf(_0x3144ad,function(_0x560491){if(_0x560491)_0x14f43c(_0x560491);return _0x3b3eb7();});});})[_0xcb59('0x19')](function(){return _0x48b630[_0xcb59('0x53')](_0x55f17f,_0x2d5996,function(_0x1b5b5e){if(_0x1b5b5e){logger[_0xcb59('0x1c')](_0xcb59('0x80'),_0x1b5b5e);}else{fs[_0xcb59('0x81')](_0x55f17f);}});});});}else{return _0x48b630[_0xcb59('0x1b')](0xc8);}})[_0xcb59('0x2a')](handleError(_0x48b630,null));}; \ No newline at end of file +var _0x578d=['.pdf','Openchannel','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','name','send','map','rawAttributes','type','getOptions','findAll','openchannel','user','catch','show','query','from','params','model','keys','OpenchannelInteraction','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','attachments','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','read','push','OpenchannelAccount','Owner','get','mkdirSync','Account','fullname','N.A.','closedAt','disposition','threadId','basename','createReadStream','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0x578d,0x194));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xd578('0x0'));var zipdir=require(_0xd578('0x1'));var moment=require(_0xd578('0x2'));var util=require(_0xd578('0x3'));var path=require(_0xd578('0x4'));var ejs=require(_0xd578('0x5'));var fs=require('fs');var _=require(_0xd578('0x6'));var Redis=require(_0xd578('0x7'));var interaction=require(_0xd578('0x8'));var qs=require(_0xd578('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xd578('0xa'))(_0xd578('0xb'));var config=require(_0xd578('0xc'));var db=require(_0xd578('0xd'))['db'];config['redis']=_[_0xd578('0xe')](config[_0xd578('0xf')],{'host':_0xd578('0x10'),'port':0x18eb});var socket=require(_0xd578('0x11'))(new Redis(config[_0xd578('0xf')]));require(_0xd578('0x12'))[_0xd578('0x13')](socket);function respondWithStatusCode(_0x4194b6,_0x20cad4){_0x20cad4=_0x20cad4||0xcc;return function(_0xafaf6b){if(_0xafaf6b){return _0x4194b6[_0xd578('0x14')](_0x20cad4);}return _0x4194b6[_0xd578('0x15')](_0x20cad4)[_0xd578('0x16')]();};}function respondWithResult(_0x63aea2,_0x458535){_0x458535=_0x458535||0xc8;return function(_0x276c8d){if(_0x276c8d){return _0x63aea2[_0xd578('0x15')](_0x458535)[_0xd578('0x17')](_0x276c8d);}};}function respondWithFilteredResult(_0x1f502e,_0x20ebc5){return function(_0x4eb03b){if(_0x4eb03b){var _0x1d73a3=typeof _0x20ebc5['offset']==='undefined'&&typeof _0x20ebc5['limit']===_0xd578('0x18');var _0x169494=_0x4eb03b[_0xd578('0x19')];var _0x291d6c=_0x1d73a3?0x0:_0x20ebc5[_0xd578('0x1a')];var _0x5a360d=_0x1d73a3?_0x4eb03b['count']:_0x20ebc5[_0xd578('0x1a')]+_0x20ebc5[_0xd578('0x1b')];var _0x1b9217;if(_0x5a360d>=_0x169494){_0x5a360d=_0x169494;_0x1b9217=0xc8;}else{_0x1b9217=0xce;}_0x1f502e[_0xd578('0x15')](_0x1b9217);return _0x1f502e[_0xd578('0x1c')](_0xd578('0x1d'),_0x291d6c+'-'+_0x5a360d+'/'+_0x169494)['json'](_0x4eb03b);}return null;};}function saveUpdates(_0x5b7081){return function(_0x27ca2c){if(_0x27ca2c){return _0x27ca2c['update'](_0x5b7081)[_0xd578('0x1e')](function(_0x1bc385){return _0x1bc385;});}return null;};}function removeEntity(_0x3ef380){return function(_0x515591){if(_0x515591){return _0x515591[_0xd578('0x1f')]()[_0xd578('0x1e')](function(){_0x3ef380[_0xd578('0x15')](0xcc)[_0xd578('0x16')]();});}};}function handleEntityNotFound(_0x1f2c2a){return function(_0x838063){if(!_0x838063){_0x1f2c2a[_0xd578('0x14')](0x194);}return _0x838063;};}function handleError(_0x54d5bc,_0x426d2b){_0x426d2b=_0x426d2b||0x1f4;return function(_0x2de2f3){logger[_0xd578('0x20')](_0x2de2f3['stack']);if(_0x2de2f3[_0xd578('0x21')]){delete _0x2de2f3['name'];}_0x54d5bc[_0xd578('0x15')](_0x426d2b)[_0xd578('0x22')](_0x2de2f3);};}exports['index']=function(_0x4fdc66,_0x1d51bc){var _0x22704a={};var _0x10ec7a=_[_0xd578('0x23')](db['OpenchannelInteraction'][_0xd578('0x24')],function(_0x4b8eb8){return{'name':_0x4b8eb8['fieldName'],'type':_0x4b8eb8[_0xd578('0x25')]['key']};});_0x22704a=qs[_0xd578('0x26')](_0x10ec7a,_0x4fdc66);return interaction[_0xd578('0x27')](_0xd578('0x28'),_0x4fdc66['query'],_0x4fdc66[_0xd578('0x29')],_0x22704a,_0x10ec7a)[_0xd578('0x1e')](respondWithFilteredResult(_0x1d51bc,_0x22704a))[_0xd578('0x2a')](handleError(_0x1d51bc,null));};exports[_0xd578('0x2b')]=function(_0x4bac00,_0x56729a){var _0x27f6f6={};if(_0x4bac00[_0xd578('0x2c')][_0xd578('0x25')]&&_0x4bac00[_0xd578('0x2c')][_0xd578('0x25')]==='from'){_0x27f6f6[_0xd578('0x2d')]=_0x4bac00[_0xd578('0x2e')]['id'];}else{_0x27f6f6['id']=_0x4bac00['params']['id'];}var _0x55ac6d={'raw':![],'where':_0x27f6f6},_0x1194d5={};_0x1194d5[_0xd578('0x2f')]=_[_0xd578('0x30')](db[_0xd578('0x31')]['rawAttributes']);_0x1194d5['query']=_[_0xd578('0x30')](_0x4bac00[_0xd578('0x2c')]);_0x1194d5[_0xd578('0x32')]=_['intersection'](_0x1194d5[_0xd578('0x2f')],_0x1194d5['query']);_0x55ac6d[_0xd578('0x33')]=_[_0xd578('0x34')](_0x1194d5['model'],qs['fields'](_0x4bac00[_0xd578('0x2c')][_0xd578('0x35')]));_0x55ac6d[_0xd578('0x33')]=_0x55ac6d[_0xd578('0x33')][_0xd578('0x36')]?_0x55ac6d[_0xd578('0x33')]:_0x1194d5['model'];if(_0x4bac00[_0xd578('0x2c')][_0xd578('0x37')]){_0x55ac6d[_0xd578('0x38')]=[{'all':!![]}];}_0x55ac6d=_[_0xd578('0x39')]({},_0x55ac6d,_0x4bac00[_0xd578('0x3a')]);return db['OpenchannelInteraction'][_0xd578('0x3b')](_0x55ac6d)['then'](handleEntityNotFound(_0x56729a,null))[_0xd578('0x1e')](respondWithResult(_0x56729a,null))[_0xd578('0x2a')](handleError(_0x56729a,null));};exports[_0xd578('0x3c')]=function(_0xbea8e7,_0x37f34a){return db[_0xd578('0x31')][_0xd578('0x3c')](_0xbea8e7[_0xd578('0x3d')],{})[_0xd578('0x1e')](respondWithResult(_0x37f34a,0xc9))['catch'](handleError(_0x37f34a,null));};exports[_0xd578('0x3e')]=function(_0x5edb57,_0x38b6a9){if(_0x5edb57[_0xd578('0x3d')]['id']){delete _0x5edb57[_0xd578('0x3d')]['id'];}return db[_0xd578('0x31')][_0xd578('0x3b')]({'where':{'id':_0x5edb57['params']['id']}})[_0xd578('0x1e')](handleEntityNotFound(_0x38b6a9,null))['then'](saveUpdates(_0x5edb57[_0xd578('0x3d')],null))[_0xd578('0x1e')](respondWithResult(_0x38b6a9,null))[_0xd578('0x2a')](handleError(_0x38b6a9,null));};exports['destroy']=function(_0x5b09d5,_0x1b8e1d){return db['OpenchannelInteraction'][_0xd578('0x3b')]({'where':{'id':_0x5b09d5[_0xd578('0x2e')]['id']}})[_0xd578('0x1e')](handleEntityNotFound(_0x1b8e1d,null))[_0xd578('0x1e')](removeEntity(_0x1b8e1d,null))[_0xd578('0x2a')](handleError(_0x1b8e1d,null));};exports[_0xd578('0x3f')]=function(_0xa1975e,_0x536705){return db[_0xd578('0x31')][_0xd578('0x3f')]()[_0xd578('0x1e')](respondWithResult(_0x536705,null))[_0xd578('0x2a')](handleError(_0x536705,null));};exports[_0xd578('0x40')]=function(_0x4d248d,_0x3f4fbe){return db[_0xd578('0x41')][_0xd578('0x3b')]({'where':{'id':_0x4d248d['params']['id']}})['then'](handleEntityNotFound(_0x3f4fbe,null))[_0xd578('0x1e')](function(_0x95a701){if(_0x95a701){return _0x95a701['addMessage'](_0x4d248d[_0xd578('0x3d')]['ids'],_['omit'](_0x4d248d['body'],[_0xd578('0x42'),'id'])||{});}})[_0xd578('0x1e')](respondWithResult(_0x3f4fbe,null))[_0xd578('0x2a')](handleError(_0x3f4fbe,null));};exports[_0xd578('0x43')]=function(_0x21ddf5,_0x1e192e){var _0x19d6e6={'raw':![],'where':{}};var _0x32488f={};var _0x338e1b={'count':0x0,'rows':[]};return db[_0xd578('0x31')][_0xd578('0x44')]({'where':{'id':_0x21ddf5[_0xd578('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1e192e,null))['then'](function(_0x4a440c){if(_0x4a440c){_0x32488f[_0xd578('0x2f')]=_['keys'](db[_0xd578('0x41')][_0xd578('0x24')]);_0x32488f[_0xd578('0x2c')]=_[_0xd578('0x30')](_0x21ddf5[_0xd578('0x2c')]);_0x32488f[_0xd578('0x32')]=_[_0xd578('0x34')](_0x32488f[_0xd578('0x2f')],_0x32488f[_0xd578('0x2c')]);_0x19d6e6[_0xd578('0x33')]=_[_0xd578('0x34')](_0x32488f[_0xd578('0x2f')],qs[_0xd578('0x35')](_0x21ddf5['query']['fields']));_0x19d6e6[_0xd578('0x33')]=_0x19d6e6[_0xd578('0x33')][_0xd578('0x36')]?_0x19d6e6[_0xd578('0x33')]:_0x32488f['model'];if(!_0x21ddf5[_0xd578('0x2c')][_0xd578('0x45')](_0xd578('0x46'))){_0x19d6e6[_0xd578('0x1b')]=qs[_0xd578('0x1b')](_0x21ddf5[_0xd578('0x2c')][_0xd578('0x1b')]);_0x19d6e6[_0xd578('0x1a')]=qs[_0xd578('0x1a')](_0x21ddf5[_0xd578('0x2c')][_0xd578('0x1a')]);}_0x19d6e6[_0xd578('0x47')]=qs[_0xd578('0x48')](_0x21ddf5[_0xd578('0x2c')]['sort']);_0x19d6e6[_0xd578('0x49')]=qs[_0xd578('0x32')](_[_0xd578('0x4a')](_0x21ddf5[_0xd578('0x2c')],_0x32488f[_0xd578('0x32')]));_0x19d6e6[_0xd578('0x49')][_0xd578('0x4b')]=_0x4a440c['id'];if(_0x21ddf5[_0xd578('0x2c')][_0xd578('0x4c')]){_0x19d6e6[_0xd578('0x49')]=_[_0xd578('0x39')](_0x19d6e6[_0xd578('0x49')],{'$or':_[_0xd578('0x23')](_0x19d6e6[_0xd578('0x33')],function(_0x3d1020){var _0x1d3f86={};_0x1d3f86[_0x3d1020]={'$like':'%'+_0x21ddf5[_0xd578('0x2c')][_0xd578('0x4c')]+'%'};return _0x1d3f86;})});}if(_0x21ddf5['query'][_0xd578('0x4d')]){var _0x8c645e=_0x21ddf5['query'][_0xd578('0x4d')][_0xd578('0x4e')](',');var _0x4076bd={};_0x4076bd[_0x8c645e[0x0]]={'$gte':moment(_0x8c645e[0x1])[_0xd578('0x4f')](_0xd578('0x50'))};_0x19d6e6[_0xd578('0x49')]=_['merge'](_0x19d6e6[_0xd578('0x49')],_0x4076bd);}_0x19d6e6=_[_0xd578('0x39')]({},_0x19d6e6,_0x21ddf5[_0xd578('0x3a')]);return db[_0xd578('0x41')][_0xd578('0x19')]({'where':_0x19d6e6[_0xd578('0x49')]})['then'](function(_0x37f6ea){_0x338e1b['count']=_0x37f6ea;if(_0x21ddf5[_0xd578('0x2c')][_0xd578('0x37')]){_0x19d6e6[_0xd578('0x38')]=[{'all':!![]}];}return db[_0xd578('0x41')][_0xd578('0x27')](_0x19d6e6);})['then'](function(_0x36aaba){_0x338e1b['rows']=_0x36aaba;return _0x338e1b;});}})[_0xd578('0x1e')](respondWithFilteredResult(_0x1e192e,_0x19d6e6))[_0xd578('0x2a')](handleError(_0x1e192e,null));};exports[_0xd578('0x51')]=function(_0x4564a4,_0x523f23){return db[_0xd578('0x31')][_0xd578('0x3b')]({'where':{'id':_0x4564a4[_0xd578('0x2e')]['id']}})[_0xd578('0x1e')](handleEntityNotFound(_0x523f23,null))[_0xd578('0x1e')](function(_0x3f19ff){if(_0x3f19ff){return _0x3f19ff[_0xd578('0x52')](_0x4564a4[_0xd578('0x3d')][_0xd578('0x42')],_[_0xd578('0x53')](_0x4564a4[_0xd578('0x3d')],[_0xd578('0x42'),'id'])||{})[_0xd578('0x54')](function(){return db[_0xd578('0x55')][_0xd578('0x27')]({'attributes':['id','name',_0xd578('0x56')],'where':{'id':_0x4564a4[_0xd578('0x3d')]['ids']}});})[_0xd578('0x1e')](function(_0x5e677b){socket[_0xd578('0x57')](_0xd578('0x58'),{'id':Number(_0x4564a4[_0xd578('0x2e')]['id']),'tags':_0x5e677b||[]});return{'id':Number(_0x4564a4['params']['id']),'tags':_0x5e677b||[]};});}})[_0xd578('0x1e')](respondWithResult(_0x523f23,null))['catch'](handleError(_0x523f23,null));};exports[_0xd578('0x59')]=function(_0x4fa61d,_0x18eaaf){return db[_0xd578('0x31')]['find']({'where':{'id':_0x4fa61d['params']['id']}})['then'](handleEntityNotFound(_0x18eaaf,null))[_0xd578('0x1e')](function(_0x454045){if(_0x454045){return _0x454045[_0xd578('0x59')](_0x4fa61d['query'][_0xd578('0x42')]);}})[_0xd578('0x1e')](respondWithStatusCode(_0x18eaaf,null))[_0xd578('0x2a')](handleError(_0x18eaaf,null));};exports['download']=function(_0x50ba97,_0x1b2f31){var _0x124ff6=moment()[_0xd578('0x5a')]()[_0xd578('0x5b')]();var _0x3949f2=path[_0xd578('0x5c')](config[_0xd578('0x5d')],_0xd578('0x5e'),'files',_0xd578('0x5f'));var _0x1f52aa=path[_0xd578('0x5c')](config[_0xd578('0x5d')],'server','files',_0xd578('0x60'));var _0x17a09d=path['join'](_0x3949f2,_0x124ff6);var _0xc25351=util[_0xd578('0x4f')](_0xd578('0x61'),_0x50ba97[_0xd578('0x2e')]['id'],_0x124ff6);var _0x33a259=path[_0xd578('0x5c')](_0x3949f2,_0xc25351);var _0x330718=[];_0x330718['push']({'model':db[_0xd578('0x62')],'as':_0xd578('0x62'),'attributes':['id','fullname'],'raw':!![]});_0x330718['push']({'model':db[_0xd578('0x63')],'as':_0xd578('0x64'),'attributes':['id',_0xd578('0x65'),_0xd578('0x66')],'raw':!![]});if(_0x50ba97[_0xd578('0x2c')][_0xd578('0x60')]){_0x330718['push']({'model':db[_0xd578('0x67')],'as':_0xd578('0x67'),'raw':!![]});}var _0x455d5b=[{'model':db[_0xd578('0x41')],'as':'Messages','attributes':['id',_0xd578('0x3d'),_0xd578('0x68'),_0xd578('0x69'),_0xd578('0x6a'),_0xd578('0x6b')],'include':_0x330718}];_0x455d5b[_0xd578('0x6c')]({'model':db[_0xd578('0x6d')],'as':'Account','attributes':['id',_0xd578('0x21')]});_0x455d5b['push']({'model':db[_0xd578('0x62')],'as':_0xd578('0x6e'),'attributes':['id','fullname']});return db[_0xd578('0x31')]['find']({'where':{'id':_0x50ba97[_0xd578('0x2e')]['id']},'include':_0x455d5b})[_0xd578('0x1e')](handleEntityNotFound(_0x1b2f31,null))[_0xd578('0x1e')](function(_0x5704b6){if(_0x5704b6){var _0x5a4e69=_0x5704b6[_0xd578('0x6f')]({'plain':!![]});fs[_0xd578('0x70')](_0x17a09d);var _0x53b6a3={'channel':'Openchannel','account':_0x5a4e69[_0xd578('0x71')][_0xd578('0x21')],'agent':_0x5a4e69['Owner']?_0x5a4e69[_0xd578('0x6e')][_0xd578('0x72')]:_0xd578('0x73'),'createdAt':moment(_0x5a4e69[_0xd578('0x68')])[_0xd578('0x4f')](_0xd578('0x50'))[_0xd578('0x5b')](),'closedAt':_0x5a4e69['closed']?moment(_0x5a4e69[_0xd578('0x74')])['format'](_0xd578('0x50'))[_0xd578('0x5b')]():'','disposition':_0x5a4e69[_0xd578('0x75')],'visibility':_0x5a4e69[_0xd578('0x76')]?'Public':'Private','messages':_(_0x5a4e69['Messages'])['filter']({'secret':![]})[_0xd578('0x23')](function(_0x5573dd){if(_0x5573dd[_0xd578('0x67')]){var _0x311917=path[_0xd578('0x5c')](_0x1f52aa,_0x5573dd[_0xd578('0x67')][_0xd578('0x77')]);if(fs['existsSync'](_0x311917)){fs[_0xd578('0x78')](_0x311917)['pipe'](fs['createWriteStream'](path[_0xd578('0x5c')](_0x17a09d,_0x5573dd[_0xd578('0x67')]['basename'])));}}return{'date':moment(_0x5573dd[_0xd578('0x68')])[_0xd578('0x4f')](_0xd578('0x50'))[_0xd578('0x5b')](),'sender':_0x5573dd[_0xd578('0x69')]===_0xd578('0x79')?_0x5573dd[_0xd578('0x62')]?_0x5573dd[_0xd578('0x62')][_0xd578('0x72')]:_0xd578('0x7a'):_0x5573dd['Contact'][_0xd578('0x65')]+(_0x5573dd[_0xd578('0x64')]['lastName']?'\x20'+_0x5573dd[_0xd578('0x64')]['lastName']:''),'body':_0x5573dd[_0xd578('0x67')]?_0x5573dd[_0xd578('0x67')][_0xd578('0x77')]:_0x5573dd['body'],'direction':_0x5573dd[_0xd578('0x69')]===_0xd578('0x79')?'A':'C','secret':_0x5573dd[_0xd578('0x6a')],'read':_0x5573dd[_0xd578('0x6b')],'attachment':_0x5573dd['Attachment']};})[_0xd578('0x7b')]()};return ejs[_0xd578('0x7c')](path[_0xd578('0x5c')](config['root'],_0xd578('0x5e'),_0xd578('0x7d'),_0xd578('0x7e')),{'interaction':_0x53b6a3})[_0xd578('0x1e')](function(_0x224e99){var _0x4defbb=path['join'](_0x17a09d,_0xd578('0x7f')+_0x5a4e69['id']+'-'+_0x124ff6+_0xd578('0x80'));var _0x478edb={'path':_0x4defbb,'channel':_0xd578('0x81'),'interactionId':_0x5a4e69['id']};return pdf[_0xd578('0x82')](_0x224e99,_0x478edb);})['then'](function(){return new Promise(function(_0x3ef641,_0x2ac3f0){zipdir(_0x17a09d,{'saveTo':_0x33a259},function(_0xd22e1e,_0x155d5b){if(_0xd22e1e)return _0x2ac3f0(_0xd22e1e);return _0x3ef641(_0x155d5b);});})[_0xd578('0x1e')](function(){return new Promise(function(_0x63ccd9,_0x231c3e){rimraf(_0x17a09d,function(_0x3761b4){if(_0x3761b4)_0x231c3e(_0x3761b4);return _0x63ccd9();});});})['then'](function(){return _0x1b2f31[_0xd578('0x83')](_0x33a259,_0xc25351,function(_0x1bc41d){if(_0x1bc41d){logger[_0xd578('0x20')](_0xd578('0x84'),_0x1bc41d);}else{fs['unlinkSync'](_0x33a259);}});});});}else{return _0x1b2f31[_0xd578('0x14')](0xc8);}})[_0xd578('0x2a')](handleError(_0x1b2f31,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index df354fa..f5a0dcf 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 _0x199c=['Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x213938,_0x7a3a8){var _0x5214b9=function(_0xa16d40){while(--_0xa16d40){_0x213938['push'](_0x213938['shift']());}};_0x5214b9(++_0x7a3a8);}(_0x199c,0x14e));var _0xc199=function(_0x34dc62,_0x36af24){_0x34dc62=_0x34dc62-0x0;var _0x1ed4c3=_0x199c[_0x34dc62];return _0x1ed4c3;};'use strict';var EventEmitter=require(_0xc199('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xc199('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xc199('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc199('0x3')](0x0);var events={'afterCreate':_0xc199('0x4'),'afterUpdate':'update','afterDestroy':_0xc199('0x5')};function emitEvent(_0x27bd5f){return function(_0x581b6a,_0x1f2258,_0x57b41a){_0x581b6a[_0xc199('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d5549){_0x581b6a[_0xc199('0x7')](_0xc199('0x8'),_0x3d5549[_0xc199('0x9')](function(_0x273f19){return{'id':_0x273f19['id']};}));return OpenchannelMessage[_0xc199('0xa')]({'where':{'OpenchannelInteractionId':_0x581b6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc199('0xb')](function(_0xe776bb){_0x581b6a['setDataValue'](_0xc199('0xc'),_0xe776bb[_0xc199('0xd')]);OpenchannelInteractionEvents['emit'](_0x27bd5f+':'+_0x581b6a['id'],_0x581b6a);OpenchannelInteractionEvents[_0xc199('0xe')](_0x27bd5f,_0x581b6a);_0x57b41a(null);})[_0xc199('0xf')](_0x57b41a(null));};}for(var e in events){if(events[_0xc199('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xc199('0x11')](e,emitEvent(event));}}module[_0xc199('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5d0b=['update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0xd2faf3,_0x422544){var _0x586342=function(_0x1adc41){while(--_0x1adc41){_0xd2faf3['push'](_0xd2faf3['shift']());}};_0x586342(++_0x422544);}(_0x5d0b,0x12b));var _0xb5d0=function(_0x3e29e5,_0x1cd087){_0x3e29e5=_0x3e29e5-0x0;var _0x37f88a=_0x5d0b[_0x3e29e5];return _0x37f88a;};'use strict';var EventEmitter=require(_0xb5d0('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xb5d0('0x1')];var OpenchannelMessage=require(_0xb5d0('0x2'))['db'][_0xb5d0('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb5d0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb5d0('0x5'),'afterDestroy':_0xb5d0('0x6')};function emitEvent(_0x49df55){return function(_0x9e9638,_0x3fa786,_0x5f6077){_0x9e9638[_0xb5d0('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2de5c8){_0x9e9638[_0xb5d0('0x8')](_0xb5d0('0x9'),_0x2de5c8['map'](function(_0x22ee09){return{'id':_0x22ee09['id']};}));return OpenchannelMessage[_0xb5d0('0xa')]({'where':{'OpenchannelInteractionId':_0x9e9638['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb5d0('0xb')](function(_0x585068){_0x9e9638[_0xb5d0('0x8')](_0xb5d0('0xc'),_0x585068[_0xb5d0('0xd')]);OpenchannelInteractionEvents[_0xb5d0('0xe')](_0x49df55+':'+_0x9e9638['id'],_0x9e9638);OpenchannelInteractionEvents[_0xb5d0('0xe')](_0x49df55,_0x9e9638);_0x5f6077(null);})[_0xb5d0('0xf')](_0x5f6077(null));};}for(var e in events){if(events[_0xb5d0('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xb5d0('0x11')](e,emitEvent(event));}}module[_0xb5d0('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3e48937..8bb4f0f 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 _0xb95d=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','changed','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x1a54f4,_0x5d2a19){var _0x44f3fd=function(_0x50e250){while(--_0x50e250){_0x1a54f4['push'](_0x1a54f4['shift']());}};_0x44f3fd(++_0x5d2a19);}(_0xb95d,0x13f));var _0xdb95=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0xb95d[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0xdb95('0x0'));var util=require(_0xdb95('0x1'));var logger=require(_0xdb95('0x2'))(_0xdb95('0x3'));var moment=require(_0xdb95('0x4'));var BPromise=require(_0xdb95('0x5'));var rp=require(_0xdb95('0x6'));var fs=require('fs');var path=require(_0xdb95('0x7'));var rimraf=require('rimraf');var config=require(_0xdb95('0x8'));var attributes=require(_0xdb95('0x9'));module[_0xdb95('0xa')]=function(_0x602baa,_0x56103e){return _0x602baa[_0xdb95('0xb')](_0xdb95('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb95('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4a728d,_0x134266,_0x3b12d7){if(_0x4a728d[_0xdb95('0xe')]('closed')){_0x4a728d['closedAt']=moment()['format'](_0xdb95('0xf'));}_0x3b12d7(null,_0x4a728d);}}});}; \ No newline at end of file +var _0x97ee=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','lodash','util','api','moment'];(function(_0x3f18a9,_0x1670b5){var _0x4a8de1=function(_0x53be10){while(--_0x53be10){_0x3f18a9['push'](_0x3f18a9['shift']());}};_0x4a8de1(++_0x1670b5);}(_0x97ee,0xfb));var _0xe97e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x97ee[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xe97e('0x0'));var util=require(_0xe97e('0x1'));var logger=require('../../config/logger')(_0xe97e('0x2'));var moment=require(_0xe97e('0x3'));var BPromise=require(_0xe97e('0x4'));var rp=require(_0xe97e('0x5'));var fs=require('fs');var path=require(_0xe97e('0x6'));var rimraf=require(_0xe97e('0x7'));var config=require(_0xe97e('0x8'));var attributes=require(_0xe97e('0x9'));module[_0xe97e('0xa')]=function(_0x73d1dd,_0x23d684){return _0x73d1dd[_0xe97e('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0xe97e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe97e('0xd'),'hooks':{'beforeUpdate':function(_0x32603b,_0x230340,_0x44e212){if(_0x32603b[_0xe97e('0xe')](_0xe97e('0xf'))){_0x32603b[_0xe97e('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x44e212(null,_0x32603b);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b3cf8c4..706e82e 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 _0x7356=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x7356,0x101));var _0x6735=function(_0x15381c,_0x4d2874){_0x15381c=_0x15381c-0x0;var _0x9b936=_0x7356[_0x15381c];return _0x9b936;};'use strict';var _=require(_0x6735('0x0'));var util=require(_0x6735('0x1'));var moment=require('moment');var BPromise=require(_0x6735('0x2'));var rs=require(_0x6735('0x3'));var fs=require('fs');var Redis=require(_0x6735('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6735('0x5'));var logger=require(_0x6735('0x6'))(_0x6735('0x7'));var config=require(_0x6735('0x8'));var jayson=require(_0x6735('0x9'));var client=jayson[_0x6735('0xa')]['http']({'port':0x232a});config[_0x6735('0xb')]=_[_0x6735('0xc')](config['redis'],{'host':_0x6735('0xd'),'port':0x18eb});var socket=require(_0x6735('0xe'))(new Redis(config['redis']));require(_0x6735('0xf'))[_0x6735('0x10')](socket);function respondWithRpcPromise(_0x3ab1fb,_0x295599,_0x4406e6){return new BPromise(function(_0x12638e,_0x400a93){return client['request'](_0x3ab1fb,_0x4406e6)[_0x6735('0x11')](function(_0x23412a){logger[_0x6735('0x12')](_0x6735('0x13'),_0x295599,_0x6735('0x14'));logger[_0x6735('0x15')](_0x6735('0x16'),_0x295599,_0x6735('0x14'),JSON[_0x6735('0x17')](_0x23412a));if(_0x23412a[_0x6735('0x18')]){if(_0x23412a[_0x6735('0x18')][_0x6735('0x19')]===0x1f4){logger[_0x6735('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x295599,_0x23412a[_0x6735('0x18')][_0x6735('0x1a')]);return _0x400a93(_0x23412a['error'][_0x6735('0x1a')]);}logger['error'](_0x6735('0x13'),_0x295599,_0x23412a['error'][_0x6735('0x1a')]);return _0x12638e(_0x23412a[_0x6735('0x18')][_0x6735('0x1a')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x295599,_0x6735('0x14'));_0x12638e(_0x23412a[_0x6735('0x1b')][_0x6735('0x1a')]);}})[_0x6735('0x1c')](function(_0x1807e9){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x295599,_0x1807e9);_0x400a93(_0x1807e9);});});}exports['UpdateOpenchannelInteraction']=function(_0x35534f){var _0x55c78c=this;return new Promise(function(_0x1fbfec,_0x38a9a5){return db[_0x6735('0x1d')][_0x6735('0x1e')](_0x35534f[_0x6735('0x1f')],{'raw':_0x35534f['options']?_0x35534f[_0x6735('0x20')][_0x6735('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35534f[_0x6735('0x20')]?_0x35534f[_0x6735('0x20')][_0x6735('0x22')]||null:null,'attributes':_0x35534f[_0x6735('0x20')]?_0x35534f[_0x6735('0x20')][_0x6735('0x23')]||null:null,'limit':_0x35534f[_0x6735('0x20')]?_0x35534f['options'][_0x6735('0x24')]||null:null})[_0x6735('0x11')](function(_0x497c3d){logger['info'](_0x6735('0x25'),_0x35534f);logger[_0x6735('0x15')](_0x6735('0x25'),_0x35534f,JSON[_0x6735('0x17')](_0x497c3d));_0x1fbfec(_0x497c3d);})[_0x6735('0x1c')](function(_0x27ade4){logger[_0x6735('0x18')]('UpdateOpenchannelInteraction',_0x27ade4[_0x6735('0x1a')],_0x35534f);_0x38a9a5(_0x55c78c[_0x6735('0x18')](0x1f4,_0x27ade4[_0x6735('0x1a')]));});});};exports[_0x6735('0x26')]=function(_0x48acc8){return new Promise(function(_0x50f41d,_0x30bc87){return db['OpenchannelInteraction'][_0x6735('0x27')]({'where':_0x48acc8['options']?_0x48acc8[_0x6735('0x20')][_0x6735('0x22')]||null:null})[_0x6735('0x11')](function(_0x518ffa){if(_0x518ffa){return _0x518ffa['addTags'](_0x48acc8[_0x6735('0x1f')][_0x6735('0x28')],_[_0x6735('0x29')](_0x48acc8['body'],['ids','id'])||{});}})[_0x6735('0x2a')](function(_0x2ab1fe){logger[_0x6735('0x12')](_0x6735('0x2b'),_0x48acc8);logger[_0x6735('0x15')]('AddTags',_0x48acc8,JSON[_0x6735('0x17')](_0x2ab1fe));_0x50f41d(_0x2ab1fe);})[_0x6735('0x1c')](function(_0x556998){logger[_0x6735('0x18')](_0x6735('0x2b'),_0x556998[_0x6735('0x1a')],_0x48acc8);_0x30bc87(_this['error'](0x1f4,_0x556998[_0x6735('0x1a')]));});});}; \ No newline at end of file +var _0xeaba=['AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','AddTagsToOpenchannelInteraction','find','where','addTags','body','ids','omit'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xeaba,0x99));var _0xaeab=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xeaba[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xaeab('0x0'));var util=require(_0xaeab('0x1'));var moment=require(_0xaeab('0x2'));var BPromise=require('bluebird');var rs=require(_0xaeab('0x3'));var fs=require('fs');var Redis=require(_0xaeab('0x4'));var db=require(_0xaeab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeab('0x6'))(_0xaeab('0x7'));var config=require(_0xaeab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaeab('0x9')][_0xaeab('0xa')]({'port':0x232a});config[_0xaeab('0xb')]=_[_0xaeab('0xc')](config[_0xaeab('0xb')],{'host':_0xaeab('0xd'),'port':0x18eb});var socket=require(_0xaeab('0xe'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x548b93,_0x3542b0,_0x4fa7ee){return new BPromise(function(_0x5801a3,_0x4375d8){return client['request'](_0x548b93,_0x4fa7ee)[_0xaeab('0xf')](function(_0x3969d9){logger[_0xaeab('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3542b0,_0xaeab('0x11'));logger[_0xaeab('0x12')](_0xaeab('0x13'),_0x3542b0,_0xaeab('0x11'),JSON[_0xaeab('0x14')](_0x3969d9));if(_0x3969d9[_0xaeab('0x15')]){if(_0x3969d9[_0xaeab('0x15')][_0xaeab('0x16')]===0x1f4){logger[_0xaeab('0x15')](_0xaeab('0x17'),_0x3542b0,_0x3969d9[_0xaeab('0x15')][_0xaeab('0x18')]);return _0x4375d8(_0x3969d9[_0xaeab('0x15')][_0xaeab('0x18')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3542b0,_0x3969d9[_0xaeab('0x15')][_0xaeab('0x18')]);return _0x5801a3(_0x3969d9['error'][_0xaeab('0x18')]);}else{logger[_0xaeab('0x10')](_0xaeab('0x17'),_0x3542b0,'request\x20sent');_0x5801a3(_0x3969d9['result'][_0xaeab('0x18')]);}})[_0xaeab('0x19')](function(_0x4c8892){logger[_0xaeab('0x15')](_0xaeab('0x17'),_0x3542b0,_0x4c8892);_0x4375d8(_0x4c8892);});});}exports[_0xaeab('0x1a')]=function(_0x7297f2){var _0x1e3bad=this;return new Promise(function(_0x19fb54,_0x102029){return db[_0xaeab('0x1b')][_0xaeab('0x1c')](_0x7297f2['body'],{'raw':_0x7297f2[_0xaeab('0x1d')]?_0x7297f2[_0xaeab('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7297f2['options']?_0x7297f2['options']['where']||null:null,'attributes':_0x7297f2['options']?_0x7297f2[_0xaeab('0x1d')]['attributes']||null:null,'limit':_0x7297f2[_0xaeab('0x1d')]?_0x7297f2[_0xaeab('0x1d')]['limit']||null:null})[_0xaeab('0xf')](function(_0xcfce8e){logger[_0xaeab('0x10')](_0xaeab('0x1a'),_0x7297f2);logger[_0xaeab('0x12')]('UpdateOpenchannelInteraction',_0x7297f2,JSON['stringify'](_0xcfce8e));_0x19fb54(_0xcfce8e);})[_0xaeab('0x19')](function(_0x299bf4){logger[_0xaeab('0x15')](_0xaeab('0x1a'),_0x299bf4[_0xaeab('0x18')],_0x7297f2);_0x102029(_0x1e3bad['error'](0x1f4,_0x299bf4[_0xaeab('0x18')]));});});};exports[_0xaeab('0x1e')]=function(_0xad785){return new Promise(function(_0x426789,_0xd56694){return db[_0xaeab('0x1b')][_0xaeab('0x1f')]({'where':_0xad785['options']?_0xad785[_0xaeab('0x1d')][_0xaeab('0x20')]||null:null})[_0xaeab('0xf')](function(_0x4389c5){if(_0x4389c5){return _0x4389c5[_0xaeab('0x21')](_0xad785[_0xaeab('0x22')][_0xaeab('0x23')],_[_0xaeab('0x24')](_0xad785['body'],[_0xaeab('0x23'),'id'])||{});}})['spread'](function(_0x403603){logger[_0xaeab('0x10')]('AddTags',_0xad785);logger[_0xaeab('0x12')]('AddTags',_0xad785,JSON['stringify'](_0x403603));_0x426789(_0x403603);})[_0xaeab('0x19')](function(_0xe6e68b){logger[_0xaeab('0x15')](_0xaeab('0x25'),_0xe6e68b[_0xaeab('0x18')],_0xad785);_0xd56694(_this['error'](0x1f4,_0xe6e68b['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0f66a61..71af9dc 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 _0x96f9=['length','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96f9,0x182));var _0x996f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x96f9[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x996f('0x0'),_0x996f('0x1'),_0x996f('0x2')];function createListener(_0x4b6c8f,_0x451c8a){return function(_0x560228){_0x451c8a[_0x996f('0x3')](_0x4b6c8f,_0x560228);};}function removeListener(_0x25adba,_0x3a804c){return function(){OpenchannelInteractionEvents[_0x996f('0x4')](_0x25adba,_0x3a804c);};}exports[_0x996f('0x5')]=function(_0x1a3502){for(var _0x2822f5=0x0,_0x1fd17b=events[_0x996f('0x6')];_0x2822f5<_0x1fd17b;_0x2822f5++){var _0x4a4e32=events[_0x2822f5];var _0x30545a=createListener('openchannelInteraction:'+_0x4a4e32,_0x1a3502);OpenchannelInteractionEvents['on'](_0x4a4e32,_0x30545a);}}; \ No newline at end of file +var _0x1e51=['./openchannelInteraction.events','save','remove','update','register','length','openchannelInteraction:'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1e51,0x1f1));var _0x11e5=function(_0x4c0918,_0x2a4499){_0x4c0918=_0x4c0918-0x0;var _0x273018=_0x1e51[_0x4c0918];return _0x273018;};'use strict';var OpenchannelInteractionEvents=require(_0x11e5('0x0'));var events=[_0x11e5('0x1'),_0x11e5('0x2'),_0x11e5('0x3')];function createListener(_0x14a61e,_0x133b82){return function(_0x4d4c0f){_0x133b82['emit'](_0x14a61e,_0x4d4c0f);};}function removeListener(_0x3280e7,_0x26e3a1){return function(){OpenchannelInteractionEvents['removeListener'](_0x3280e7,_0x26e3a1);};}exports[_0x11e5('0x4')]=function(_0x7050dc){for(var _0xf3ab96=0x0,_0x39bd34=events[_0x11e5('0x5')];_0xf3ab96<_0x39bd34;_0xf3ab96++){var _0x59d1e6=events[_0xf3ab96];var _0x2e03ce=createListener(_0x11e5('0x6')+_0x59d1e6,_0x7050dc);OpenchannelInteractionEvents['on'](_0x59d1e6,_0x2e03ce);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 521d242..a4e75f3 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 _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(_0x23c741,_0x4ed6f2){var _0x3bed53=function(_0x25921b){while(--_0x25921b){_0x23c741['push'](_0x23c741['shift']());}};_0x3bed53(++_0x4ed6f2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xcb91[_0x44b3bd];return _0x1efc4a;};'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 +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x56cf86,_0x2c9b49){var _0x22aa39=function(_0x48b6ba){while(--_0x48b6ba){_0x56cf86['push'](_0x56cf86['shift']());}};_0x22aa39(++_0x2c9b49);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index ced72e0..08125c7 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 _0x5454=['out','DATE','STRING','medium'];(function(_0x116f0b,_0x1b0f82){var _0x5ecfba=function(_0x28aca2){while(--_0x28aca2){_0x116f0b['push'](_0x116f0b['shift']());}};_0x5ecfba(++_0x1b0f82);}(_0x5454,0x15b));var _0x4545=function(_0x15faa8,_0x450802){_0x15faa8=_0x15faa8-0x0;var _0x48668d=_0x5454[_0x15faa8];return _0x48668d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x4545('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4545('0x1')),'defaultValue':_0x4545('0x1'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4545('0x2')]},'providerName':{'type':Sequelize[_0x4545('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd4f4=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x593bbe,_0x3ef22e){var _0x221482=function(_0x4a0998){while(--_0x4a0998){_0x593bbe['push'](_0x593bbe['shift']());}};_0x221482(++_0x3ef22e);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x51bd63,_0x30e551){_0x51bd63=_0x51bd63-0x0;var _0x431686=_0xd4f4[_0x51bd63];return _0x431686;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'body':{'type':Sequelize[_0x4d4f('0x2')](_0x4d4f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d4f('0x5')]('in',_0x4d4f('0x6')),'defaultValue':_0x4d4f('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d4f('0x7')]},'providerName':{'type':Sequelize[_0x4d4f('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ac0f2db..a197f7a 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 _0x3b33=['jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','OpenchannelMessage','includeAll','include','findAll','rows','params','merge','options','find','create','body','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','internal','manual','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','email','interface','rejectmessage','eml-format','rimraf','fast-json-patch','moment','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register'];(function(_0x27a00f,_0x31b6b6){var _0x46c16c=function(_0xb5f007){while(--_0xb5f007){_0x27a00f['push'](_0x27a00f['shift']());}};_0x46c16c(++_0x31b6b6);}(_0x3b33,0xec));var _0x33b3=function(_0x448486,_0x50d590){_0x448486=_0x448486-0x0;var _0x4fc59f=_0x3b33[_0x448486];return _0x4fc59f;};'use strict';var emlformat=require(_0x33b3('0x0'));var rimraf=require(_0x33b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33b3('0x2'));var rp=require('request-promise');var moment=require(_0x33b3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x33b3('0x4'));var util=require(_0x33b3('0x5'));var path=require('path');var sox=require(_0x33b3('0x6'));var csv=require(_0x33b3('0x7'));var ejs=require(_0x33b3('0x8'));var fs=require('fs');var fs_extra=require(_0x33b3('0x9'));var _=require(_0x33b3('0xa'));var squel=require(_0x33b3('0xb'));var crypto=require(_0x33b3('0xc'));var jsforce=require(_0x33b3('0xd'));var deskjs=require(_0x33b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x33b3('0xf'));var Papa=require(_0x33b3('0x10'));var Redis=require(_0x33b3('0x11'));var authService=require(_0x33b3('0x12'));var qs=require(_0x33b3('0x13'));var as=require(_0x33b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33b3('0x15'))(_0x33b3('0x16'));var utils=require(_0x33b3('0x17'));var config=require(_0x33b3('0x18'));var licenseUtil=require(_0x33b3('0x19'));var db=require(_0x33b3('0x1a'))['db'];config['redis']=_[_0x33b3('0x1b')](config[_0x33b3('0x1c')],{'host':_0x33b3('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33b3('0x1c')]));require(_0x33b3('0x1e'))[_0x33b3('0x1f')](socket);var jayson=require(_0x33b3('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x33b3('0x21')][_0x33b3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3461bb,_0x4b54da,_0x5b9537,_0x4809ff){return new BPromise(function(_0x5739e5,_0x537b19){var _0x2fa810=_0x4809ff||client;return _0x2fa810[_0x33b3('0x23')](_0x3461bb,_0x5b9537)['then'](function(_0xbafe1e){logger['info'](_0x33b3('0x24'),_0x4b54da,'request\x20sent');logger['debug'](_0x33b3('0x25'),_0x4b54da,'request\x20sent',JSON[_0x33b3('0x26')](_0xbafe1e));if(_0xbafe1e[_0x33b3('0x27')]){if(_0xbafe1e[_0x33b3('0x27')][_0x33b3('0x28')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4b54da,_0xbafe1e[_0x33b3('0x27')][_0x33b3('0x29')]);return _0x537b19(_0xbafe1e[_0x33b3('0x27')]['message']);}logger[_0x33b3('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x4b54da,_0xbafe1e[_0x33b3('0x27')][_0x33b3('0x29')]);return _0x5739e5(_0xbafe1e[_0x33b3('0x27')]['message']);}else{logger[_0x33b3('0x2a')](_0x33b3('0x24'),_0x4b54da,'request\x20sent');_0x5739e5(_0xbafe1e[_0x33b3('0x2b')][_0x33b3('0x29')]);}})[_0x33b3('0x2c')](function(_0x40905d){logger[_0x33b3('0x27')](_0x33b3('0x24'),_0x4b54da,_0x40905d);_0x537b19(_0x40905d);});});}function respondWithStatusCode(_0x4e96e1,_0x5c3fea){_0x5c3fea=_0x5c3fea||0xcc;return function(_0x5b2d2d){if(_0x5b2d2d){return _0x4e96e1['sendStatus'](_0x5c3fea);}return _0x4e96e1[_0x33b3('0x2d')](_0x5c3fea)[_0x33b3('0x2e')]();};}function respondWithResult(_0x23946e,_0xcc6bed){_0xcc6bed=_0xcc6bed||0xc8;return function(_0x5246b0){if(_0x5246b0){return _0x23946e[_0x33b3('0x2d')](_0xcc6bed)['json'](_0x5246b0);}};}function respondWithFilteredResult(_0x4cd8b4,_0x50ef46){return function(_0x6daa42){if(_0x6daa42){var _0x1fb4bf=typeof _0x50ef46[_0x33b3('0x2f')]===_0x33b3('0x30')&&typeof _0x50ef46[_0x33b3('0x31')]===_0x33b3('0x30');var _0x40cb1d=_0x6daa42[_0x33b3('0x32')];var _0x625afb=_0x1fb4bf?0x0:_0x50ef46[_0x33b3('0x2f')];var _0x5edbb9=_0x1fb4bf?_0x6daa42['count']:_0x50ef46[_0x33b3('0x2f')]+_0x50ef46['limit'];var _0x3137bd;if(_0x5edbb9>=_0x40cb1d){_0x5edbb9=_0x40cb1d;_0x3137bd=0xc8;}else{_0x3137bd=0xce;}_0x4cd8b4['status'](_0x3137bd);return _0x4cd8b4[_0x33b3('0x33')](_0x33b3('0x34'),_0x625afb+'-'+_0x5edbb9+'/'+_0x40cb1d)[_0x33b3('0x35')](_0x6daa42);}return null;};}function patchUpdates(_0x59d595){return function(_0x10b821){try{jsonpatch['apply'](_0x10b821,_0x59d595,!![]);}catch(_0x14d5bf){return BPromise[_0x33b3('0x36')](_0x14d5bf);}return _0x10b821[_0x33b3('0x37')]();};}function saveUpdates(_0x16311c,_0x517830){return function(_0x16ec99){if(_0x16ec99){return _0x16ec99[_0x33b3('0x38')](_0x16311c)['then'](function(_0x279621){return _0x279621;});}return null;};}function removeEntity(_0xba7e7d,_0x48c381){return function(_0x1ba4eb){if(_0x1ba4eb){return _0x1ba4eb[_0x33b3('0x39')]()[_0x33b3('0x3a')](function(){_0xba7e7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x370f3c,_0x3236c1){return function(_0x5c6ceb){if(!_0x5c6ceb){_0x370f3c[_0x33b3('0x3b')](0x194);}return _0x5c6ceb;};}function handleError(_0x4209db,_0xc30cbb){_0xc30cbb=_0xc30cbb||0x1f4;return function(_0xe66d3a){logger['error'](_0xe66d3a[_0x33b3('0x3c')]);if(_0xe66d3a['name']){delete _0xe66d3a[_0x33b3('0x3d')];}_0x4209db[_0x33b3('0x2d')](_0xc30cbb)[_0x33b3('0x3e')](_0xe66d3a);};}exports[_0x33b3('0x3f')]=function(_0x5c976b,_0x238960){var _0x13e0ef={},_0x147b4f={},_0x481338={'count':0x0,'rows':[]};var _0x54827e=_[_0x33b3('0x40')](db['OpenchannelMessage'][_0x33b3('0x41')],function(_0x9ecb83){return{'name':_0x9ecb83[_0x33b3('0x42')],'type':_0x9ecb83[_0x33b3('0x43')][_0x33b3('0x44')]};});_0x147b4f[_0x33b3('0x45')]=_[_0x33b3('0x40')](_0x54827e,_0x33b3('0x3d'));_0x147b4f[_0x33b3('0x46')]=_[_0x33b3('0x47')](_0x5c976b[_0x33b3('0x46')]);_0x147b4f[_0x33b3('0x48')]=_[_0x33b3('0x49')](_0x147b4f[_0x33b3('0x45')],_0x147b4f[_0x33b3('0x46')]);_0x13e0ef[_0x33b3('0x4a')]=_['intersection'](_0x147b4f['model'],qs[_0x33b3('0x4b')](_0x5c976b[_0x33b3('0x46')][_0x33b3('0x4b')]));_0x13e0ef['attributes']=_0x13e0ef[_0x33b3('0x4a')][_0x33b3('0x4c')]?_0x13e0ef[_0x33b3('0x4a')]:_0x147b4f['model'];if(!_0x5c976b[_0x33b3('0x46')][_0x33b3('0x4d')](_0x33b3('0x4e'))){_0x13e0ef[_0x33b3('0x31')]=qs['limit'](_0x5c976b[_0x33b3('0x46')][_0x33b3('0x31')]);_0x13e0ef['offset']=qs[_0x33b3('0x2f')](_0x5c976b['query'][_0x33b3('0x2f')]);}_0x13e0ef[_0x33b3('0x4f')]=qs[_0x33b3('0x50')](_0x5c976b[_0x33b3('0x46')][_0x33b3('0x50')]);_0x13e0ef['where']=qs[_0x33b3('0x48')](_['pick'](_0x5c976b['query'],_0x147b4f[_0x33b3('0x48')]),_0x54827e);if(_0x5c976b[_0x33b3('0x46')]['filter']){_0x13e0ef['where']=_['merge'](_0x13e0ef[_0x33b3('0x51')],{'$or':_[_0x33b3('0x40')](_0x54827e,function(_0x9b2306){if(_0x9b2306[_0x33b3('0x43')]!=='VIRTUAL'){var _0x1b1aa1={};_0x1b1aa1[_0x9b2306[_0x33b3('0x3d')]]={'$like':'%'+_0x5c976b[_0x33b3('0x46')]['filter']+'%'};return _0x1b1aa1;}})});}_0x13e0ef=_['merge']({},_0x13e0ef,_0x5c976b['options']);var _0x183bc1={'where':_0x13e0ef[_0x33b3('0x51')]};return db[_0x33b3('0x52')][_0x33b3('0x32')](_0x183bc1)['then'](function(_0xc6a80f){_0x481338[_0x33b3('0x32')]=_0xc6a80f;if(_0x5c976b['query'][_0x33b3('0x53')]){_0x13e0ef[_0x33b3('0x54')]=[{'all':!![]}];}return db[_0x33b3('0x52')][_0x33b3('0x55')](_0x13e0ef);})[_0x33b3('0x3a')](function(_0x2666db){_0x481338[_0x33b3('0x56')]=_0x2666db;return _0x481338;})[_0x33b3('0x3a')](respondWithFilteredResult(_0x238960,_0x13e0ef))[_0x33b3('0x2c')](handleError(_0x238960,null));};exports['show']=function(_0x1302ba,_0x344bd0){var _0xa2d57e={'raw':!![],'where':{'id':_0x1302ba[_0x33b3('0x57')]['id']}},_0x30b727={};_0x30b727[_0x33b3('0x45')]=_[_0x33b3('0x47')](db[_0x33b3('0x52')][_0x33b3('0x41')]);_0x30b727['query']=_[_0x33b3('0x47')](_0x1302ba['query']);_0x30b727['filters']=_[_0x33b3('0x49')](_0x30b727[_0x33b3('0x45')],_0x30b727[_0x33b3('0x46')]);_0xa2d57e[_0x33b3('0x4a')]=_[_0x33b3('0x49')](_0x30b727[_0x33b3('0x45')],qs[_0x33b3('0x4b')](_0x1302ba[_0x33b3('0x46')][_0x33b3('0x4b')]));_0xa2d57e[_0x33b3('0x4a')]=_0xa2d57e[_0x33b3('0x4a')][_0x33b3('0x4c')]?_0xa2d57e[_0x33b3('0x4a')]:_0x30b727['model'];if(_0x1302ba['query'][_0x33b3('0x53')]){_0xa2d57e[_0x33b3('0x54')]=[{'all':!![]}];}_0xa2d57e=_[_0x33b3('0x58')]({},_0xa2d57e,_0x1302ba[_0x33b3('0x59')]);return db[_0x33b3('0x52')][_0x33b3('0x5a')](_0xa2d57e)[_0x33b3('0x3a')](handleEntityNotFound(_0x344bd0,null))[_0x33b3('0x3a')](respondWithResult(_0x344bd0,null))[_0x33b3('0x2c')](handleError(_0x344bd0,null));};exports[_0x33b3('0x5b')]=function(_0x2da82d,_0x42adec){return db[_0x33b3('0x52')][_0x33b3('0x5b')](_0x2da82d[_0x33b3('0x5c')],{})[_0x33b3('0x3a')](respondWithResult(_0x42adec,0xc9))['catch'](handleError(_0x42adec,null));};exports[_0x33b3('0x38')]=function(_0x4a4962,_0x4b5b7e){if(_0x4a4962[_0x33b3('0x5c')]['id']){delete _0x4a4962[_0x33b3('0x5c')]['id'];}return db[_0x33b3('0x52')][_0x33b3('0x5a')]({'where':{'id':_0x4a4962[_0x33b3('0x57')]['id']}})[_0x33b3('0x3a')](handleEntityNotFound(_0x4b5b7e,null))[_0x33b3('0x3a')](saveUpdates(_0x4a4962[_0x33b3('0x5c')],null))[_0x33b3('0x3a')](respondWithResult(_0x4b5b7e,null))[_0x33b3('0x2c')](handleError(_0x4b5b7e,null));};exports[_0x33b3('0x39')]=function(_0x58d862,_0xe57b26){return db['OpenchannelMessage'][_0x33b3('0x5a')]({'where':{'id':_0x58d862[_0x33b3('0x57')]['id']}})[_0x33b3('0x3a')](handleEntityNotFound(_0xe57b26,null))[_0x33b3('0x3a')](removeEntity(_0xe57b26,null))[_0x33b3('0x2c')](handleError(_0xe57b26,null));};exports['describe']=function(_0x2aba51,_0x56b0f8){return db['OpenchannelMessage']['describe']()[_0x33b3('0x3a')](respondWithResult(_0x56b0f8,null))[_0x33b3('0x2c')](handleError(_0x56b0f8,null));};var interaction_log=require(_0x33b3('0x15'))(_0x33b3('0x5d'));exports['accept']=function(_0x4780f4,_0x59034e,_0x467702){var _0x39f637={'agent':{},'channel':_0x33b3('0x5e')};if(_0x4780f4[_0x33b3('0x5c')]['id']){delete _0x4780f4[_0x33b3('0x5c')]['id'];}_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x5f')]=!![];_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x60')]=moment()['format'](_0x33b3('0x61'));_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x62')]=_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x62')]||_0x4780f4[_0x33b3('0x63')]['id'];_0x39f637['agent']['id']=_0x4780f4[_0x33b3('0x5c')]['UserId'];return db[_0x33b3('0x52')][_0x33b3('0x5a')]({'where':{'id':_0x4780f4[_0x33b3('0x57')]['id'],'UserId':null}})[_0x33b3('0x3a')](handleEntityNotFound(_0x59034e,null))[_0x33b3('0x3a')](saveUpdates(_0x4780f4[_0x33b3('0x5c')],null))[_0x33b3('0x3a')](function(_0x1503af){if(_0x1503af){_0x39f637[_0x33b3('0x29')]=_0x1503af[_0x33b3('0x64')]({'plain':!![]});return db[_0x33b3('0x65')]['find']({'where':{'id':_0x1503af[_0x33b3('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x59034e,null))[_0x33b3('0x3a')](function(_0x4671ff){if(_0x4671ff){return _0x4671ff[_0x33b3('0x38')]({'UserId':_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x62')],'read1stAt':_[_0x33b3('0x67')](_0x4671ff[_0x33b3('0x68')])?moment()['format'](_0x33b3('0x61')):undefined});}return null;})[_0x33b3('0x3a')](function(_0x66fa8a){if(_0x66fa8a){_0x39f637[_0x33b3('0x69')]=_0x66fa8a[_0x33b3('0x64')]({'plain':!![]});interaction_log[_0x33b3('0x2a')](_0x33b3('0x6a'),_0x4780f4[_0x33b3('0x63')]['id'],_0x4780f4['user'][_0x33b3('0x3d')],_0x4780f4[_0x33b3('0x63')][_0x33b3('0x6b')],_0x39f637[_0x33b3('0x69')]['id'],_0x4780f4['body']?JSON[_0x33b3('0x26')](_0x4780f4['body']):_0x33b3('0x6c'));return respondWithRpcPromise(_0x33b3('0x6d'),_0x33b3('0x6e'),_0x39f637);}return null;})[_0x33b3('0x3a')](function(_0x199a6b){var _0x4e3f71=_0x33b3('0x6f')+_0x199a6b[_0x33b3('0x29')][_0x33b3('0x70')];return db[_0x33b3('0x71')]['query'](_0x4e3f71,{'type':db[_0x33b3('0x72')][_0x33b3('0x73')][_0x33b3('0x74')],'raw':!![]})[_0x33b3('0x3a')](function(_0x1e6bfd){return _0x1e6bfd;});})[_0x33b3('0x3a')](function(_0x240f0b){if(_0x240f0b){_0x39f637[_0x33b3('0x29')]['contact']=_0x240f0b[0x0];if(!_0x4780f4['body'][_0x33b3('0x62')])return;return db['User'][_0x33b3('0x5a')]({'where':{'id':_0x4780f4['body'][_0x33b3('0x62')],'role':_0x33b3('0x75')},'attributes':['id',_0x33b3('0x3d'),_0x33b3('0x76'),'email',_0x33b3('0x77')],'raw':!![]});}return null;})['then'](function(_0x471275){if(!_0x471275)return null;_0x39f637[_0x33b3('0x29')]['agent']=_0x471275;return _0x39f637;})[_0x33b3('0x3a')](function(_0x36bc33){if(_0x36bc33){if(_0x4780f4[_0x33b3('0x5c')][_0x33b3('0x78')]){_0x39f637[_0x33b3('0x29')]['interface']=util[_0x33b3('0x79')](_0x33b3('0x7a'),_0x4780f4['user'][_0x33b3('0x3d')]);_0x39f637[_0x33b3('0x29')]['channel']=_0x39f637[_0x33b3('0x7b')];_0x39f637['message'][_0x33b3('0x7c')]=_0x39f637[_0x33b3('0x7b')];_0x39f637[_0x33b3('0x29')][_0x33b3('0x7d')]='accept';return respondWithRpcPromise(_0x33b3('0x7e'),_0x33b3('0x7e'),{'event':_0x33b3('0x7f'),'message':_0x39f637[_0x33b3('0x29')]},client9002)[_0x33b3('0x3a')](function(){return _0x39f637;});}return _0x39f637;}return null;})[_0x33b3('0x3a')](respondWithResult(_0x59034e,null))['catch'](handleError(_0x59034e,null));};var interaction_log=require('../../config/logger')(_0x33b3('0x5d'));exports['reject']=function(_0x5e46ba,_0x2ed150,_0x7ad921){var _0x31d8c7={'agent':{},'channel':_0x33b3('0x5e')};if(_0x5e46ba['body']['id']){delete _0x5e46ba['body']['id'];}_0x5e46ba['body']['UserId']=_0x5e46ba[_0x33b3('0x5c')]['UserId']||_0x5e46ba[_0x33b3('0x63')]['id'];_0x31d8c7[_0x33b3('0x75')]['id']=_0x5e46ba[_0x33b3('0x5c')][_0x33b3('0x62')];return db[_0x33b3('0x52')][_0x33b3('0x5a')]({'where':{'id':_0x5e46ba[_0x33b3('0x57')]['id'],'UserId':null}})[_0x33b3('0x3a')](handleEntityNotFound(_0x2ed150,null))[_0x33b3('0x3a')](function(_0xcfc075){if(_0xcfc075){_0x31d8c7['message']=_0xcfc075[_0x33b3('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x33b3('0x5a')]({'where':{'id':_0xcfc075[_0x33b3('0x66')]}});}return null;})[_0x33b3('0x3a')](handleEntityNotFound(_0x2ed150,null))[_0x33b3('0x3a')](function(_0x490ee9){if(_0x490ee9){_0x31d8c7[_0x33b3('0x69')]=_0x490ee9[_0x33b3('0x64')]({'plain':!![]});interaction_log['info'](_0x33b3('0x80'),_0x5e46ba[_0x33b3('0x63')]['id'],_0x5e46ba[_0x33b3('0x63')][_0x33b3('0x3d')],_0x5e46ba[_0x33b3('0x63')][_0x33b3('0x6b')],_0x31d8c7[_0x33b3('0x69')]['id'],_0x5e46ba['body']?JSON['stringify'](_0x5e46ba[_0x33b3('0x5c')]):_0x33b3('0x6c'));return respondWithRpcPromise(_0x33b3('0x81'),'rejectMessage',_0x31d8c7);}return null;})['then'](function(_0x1bef05){var _0x4eea2f=_0x33b3('0x6f')+_0x1bef05['message'][_0x33b3('0x70')];return db[_0x33b3('0x71')][_0x33b3('0x46')](_0x4eea2f,{'type':db[_0x33b3('0x72')][_0x33b3('0x73')][_0x33b3('0x74')],'raw':!![]})[_0x33b3('0x3a')](function(_0x3767c1){return _0x3767c1;});})[_0x33b3('0x3a')](function(_0x5388cb){if(_0x5388cb){_0x31d8c7[_0x33b3('0x29')][_0x33b3('0x82')]=_0x5388cb[0x0];if(!_0x5e46ba[_0x33b3('0x5c')]['UserId'])return;return db['User'][_0x33b3('0x5a')]({'where':{'id':_0x5e46ba[_0x33b3('0x5c')][_0x33b3('0x62')],'role':_0x33b3('0x75')},'attributes':['id',_0x33b3('0x3d'),_0x33b3('0x76'),_0x33b3('0x83'),'internal'],'raw':!![]});}return null;})['then'](function(_0x44bbda){if(!_0x44bbda)return null;_0x31d8c7[_0x33b3('0x29')]['agent']=_0x44bbda;return _0x31d8c7;})[_0x33b3('0x3a')](function(_0x2e4be3){if(_0x2e4be3){_0x2e4be3['message'][_0x33b3('0x84')]=util[_0x33b3('0x79')](_0x33b3('0x7a'),_0x5e46ba[_0x33b3('0x63')][_0x33b3('0x3d')]);_0x2e4be3[_0x33b3('0x29')][_0x33b3('0x7b')]=_0x31d8c7['channel'];_0x2e4be3['message'][_0x33b3('0x7c')]=_0x31d8c7[_0x33b3('0x7b')];_0x2e4be3[_0x33b3('0x29')][_0x33b3('0x7d')]=_0x33b3('0x36');respondWithRpcPromise(_0x33b3('0x7e'),_0x33b3('0x7e'),{'event':_0x33b3('0x85'),'message':_0x2e4be3['message']},client9002);return _0x31d8c7;}return null;})[_0x33b3('0x3a')](respondWithResult(_0x2ed150,null))[_0x33b3('0x2c')](handleError(_0x2ed150,null));}; \ No newline at end of file +var _0xce68=['Sequelize','fullname','SIP/%s','motionChannel','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','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','register','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','OpenchannelMessage','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','describe','openchannel-interactions','read','format','UserId','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','interface','channel','event','accept','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage'];(function(_0x6355b8,_0x2e0dcc){var _0x3308d8=function(_0x89c38f){while(--_0x89c38f){_0x6355b8['push'](_0x6355b8['shift']());}};_0x3308d8(++_0x2e0dcc);}(_0xce68,0x10c));var _0x8ce6=function(_0x51e9cf,_0x3b02cf){_0x51e9cf=_0x51e9cf-0x0;var _0x2c9129=_0xce68[_0x51e9cf];return _0x2c9129;};'use strict';var emlformat=require(_0x8ce6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ce6('0x1'));var jsonpatch=require(_0x8ce6('0x2'));var rp=require(_0x8ce6('0x3'));var moment=require(_0x8ce6('0x4'));var BPromise=require(_0x8ce6('0x5'));var Mustache=require('mustache');var util=require(_0x8ce6('0x6'));var path=require(_0x8ce6('0x7'));var sox=require(_0x8ce6('0x8'));var csv=require('to-csv');var ejs=require(_0x8ce6('0x9'));var fs=require('fs');var fs_extra=require(_0x8ce6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ce6('0xb'));var jsforce=require(_0x8ce6('0xc'));var deskjs=require(_0x8ce6('0xd'));var toCsv=require(_0x8ce6('0xe'));var querystring=require('querystring');var Papa=require(_0x8ce6('0xf'));var Redis=require(_0x8ce6('0x10'));var authService=require(_0x8ce6('0x11'));var qs=require(_0x8ce6('0x12'));var as=require(_0x8ce6('0x13'));var hardwareService=require(_0x8ce6('0x14'));var logger=require(_0x8ce6('0x15'))(_0x8ce6('0x16'));var utils=require(_0x8ce6('0x17'));var config=require(_0x8ce6('0x18'));var licenseUtil=require(_0x8ce6('0x19'));var db=require(_0x8ce6('0x1a'))['db'];config[_0x8ce6('0x1b')]=_[_0x8ce6('0x1c')](config[_0x8ce6('0x1b')],{'host':_0x8ce6('0x1d'),'port':0x18eb});var socket=require(_0x8ce6('0x1e'))(new Redis(config[_0x8ce6('0x1b')]));require('./openchannelMessage.socket')[_0x8ce6('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8ce6('0x20')][_0x8ce6('0x21')]({'port':0x232c});var client9002=jayson[_0x8ce6('0x20')][_0x8ce6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2c2d7e,_0x34cce2,_0x25aa78,_0x36824d){return new BPromise(function(_0x3fae8e,_0x3926b4){var _0x4fd6a6=_0x36824d||client;return _0x4fd6a6[_0x8ce6('0x22')](_0x2c2d7e,_0x25aa78)['then'](function(_0x29122f){logger[_0x8ce6('0x23')](_0x8ce6('0x24'),_0x34cce2,'request\x20sent');logger['debug'](_0x8ce6('0x25'),_0x34cce2,_0x8ce6('0x26'),JSON['stringify'](_0x29122f));if(_0x29122f[_0x8ce6('0x27')]){if(_0x29122f[_0x8ce6('0x27')][_0x8ce6('0x28')]===0x1f4){logger[_0x8ce6('0x27')](_0x8ce6('0x24'),_0x34cce2,_0x29122f[_0x8ce6('0x27')][_0x8ce6('0x29')]);return _0x3926b4(_0x29122f[_0x8ce6('0x27')][_0x8ce6('0x29')]);}logger[_0x8ce6('0x27')](_0x8ce6('0x24'),_0x34cce2,_0x29122f[_0x8ce6('0x27')]['message']);return _0x3fae8e(_0x29122f[_0x8ce6('0x27')]['message']);}else{logger[_0x8ce6('0x23')](_0x8ce6('0x24'),_0x34cce2,_0x8ce6('0x26'));_0x3fae8e(_0x29122f['result']['message']);}})['catch'](function(_0x5c2b61){logger[_0x8ce6('0x27')](_0x8ce6('0x24'),_0x34cce2,_0x5c2b61);_0x3926b4(_0x5c2b61);});});}function respondWithStatusCode(_0xac00e3,_0xed5ae7){_0xed5ae7=_0xed5ae7||0xcc;return function(_0x35c2d6){if(_0x35c2d6){return _0xac00e3[_0x8ce6('0x2a')](_0xed5ae7);}return _0xac00e3['status'](_0xed5ae7)['end']();};}function respondWithResult(_0x1233b0,_0x6a0f99){_0x6a0f99=_0x6a0f99||0xc8;return function(_0x31bf49){if(_0x31bf49){return _0x1233b0[_0x8ce6('0x2b')](_0x6a0f99)[_0x8ce6('0x2c')](_0x31bf49);}};}function respondWithFilteredResult(_0x10a3f9,_0x552251){return function(_0x4c5a7e){if(_0x4c5a7e){var _0x1eabc8=typeof _0x552251[_0x8ce6('0x2d')]===_0x8ce6('0x2e')&&typeof _0x552251['limit']===_0x8ce6('0x2e');var _0x3c6617=_0x4c5a7e[_0x8ce6('0x2f')];var _0x423e1c=_0x1eabc8?0x0:_0x552251['offset'];var _0x2c5bc8=_0x1eabc8?_0x4c5a7e[_0x8ce6('0x2f')]:_0x552251['offset']+_0x552251['limit'];var _0x2c6c7d;if(_0x2c5bc8>=_0x3c6617){_0x2c5bc8=_0x3c6617;_0x2c6c7d=0xc8;}else{_0x2c6c7d=0xce;}_0x10a3f9[_0x8ce6('0x2b')](_0x2c6c7d);return _0x10a3f9[_0x8ce6('0x30')](_0x8ce6('0x31'),_0x423e1c+'-'+_0x2c5bc8+'/'+_0x3c6617)[_0x8ce6('0x2c')](_0x4c5a7e);}return null;};}function patchUpdates(_0x75bb53){return function(_0x469da2){try{jsonpatch[_0x8ce6('0x32')](_0x469da2,_0x75bb53,!![]);}catch(_0x28a5b3){return BPromise[_0x8ce6('0x33')](_0x28a5b3);}return _0x469da2[_0x8ce6('0x34')]();};}function saveUpdates(_0x1b3215,_0x1e7ed4){return function(_0x3a8224){if(_0x3a8224){return _0x3a8224[_0x8ce6('0x35')](_0x1b3215)[_0x8ce6('0x36')](function(_0x4f7d39){return _0x4f7d39;});}return null;};}function removeEntity(_0x43b3ff,_0xd85701){return function(_0x58ff4f){if(_0x58ff4f){return _0x58ff4f[_0x8ce6('0x37')]()[_0x8ce6('0x36')](function(){_0x43b3ff[_0x8ce6('0x2b')](0xcc)[_0x8ce6('0x38')]();});}};}function handleEntityNotFound(_0x14ea6d,_0x4d3e12){return function(_0x533e37){if(!_0x533e37){_0x14ea6d[_0x8ce6('0x2a')](0x194);}return _0x533e37;};}function handleError(_0x37c1d3,_0x59608b){_0x59608b=_0x59608b||0x1f4;return function(_0x5199b4){logger[_0x8ce6('0x27')](_0x5199b4[_0x8ce6('0x39')]);if(_0x5199b4[_0x8ce6('0x3a')]){delete _0x5199b4[_0x8ce6('0x3a')];}_0x37c1d3[_0x8ce6('0x2b')](_0x59608b)[_0x8ce6('0x3b')](_0x5199b4);};}exports['index']=function(_0x174cf7,_0x4b05be){var _0x14deb3={},_0x4c6c86={},_0x25ff21={'count':0x0,'rows':[]};var _0x35cd9c=_[_0x8ce6('0x3c')](db[_0x8ce6('0x3d')]['rawAttributes'],function(_0x2d0775){return{'name':_0x2d0775['fieldName'],'type':_0x2d0775[_0x8ce6('0x3e')]['key']};});_0x4c6c86[_0x8ce6('0x3f')]=_[_0x8ce6('0x3c')](_0x35cd9c,_0x8ce6('0x3a'));_0x4c6c86['query']=_[_0x8ce6('0x40')](_0x174cf7[_0x8ce6('0x41')]);_0x4c6c86[_0x8ce6('0x42')]=_[_0x8ce6('0x43')](_0x4c6c86[_0x8ce6('0x3f')],_0x4c6c86[_0x8ce6('0x41')]);_0x14deb3['attributes']=_[_0x8ce6('0x43')](_0x4c6c86[_0x8ce6('0x3f')],qs[_0x8ce6('0x44')](_0x174cf7['query'][_0x8ce6('0x44')]));_0x14deb3[_0x8ce6('0x45')]=_0x14deb3[_0x8ce6('0x45')][_0x8ce6('0x46')]?_0x14deb3[_0x8ce6('0x45')]:_0x4c6c86[_0x8ce6('0x3f')];if(!_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x47')](_0x8ce6('0x48'))){_0x14deb3[_0x8ce6('0x49')]=qs[_0x8ce6('0x49')](_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x49')]);_0x14deb3[_0x8ce6('0x2d')]=qs[_0x8ce6('0x2d')](_0x174cf7['query'][_0x8ce6('0x2d')]);}_0x14deb3[_0x8ce6('0x4a')]=qs[_0x8ce6('0x4b')](_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x4b')]);_0x14deb3[_0x8ce6('0x4c')]=qs[_0x8ce6('0x42')](_[_0x8ce6('0x4d')](_0x174cf7[_0x8ce6('0x41')],_0x4c6c86[_0x8ce6('0x42')]),_0x35cd9c);if(_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x4e')]){_0x14deb3['where']=_[_0x8ce6('0x4f')](_0x14deb3[_0x8ce6('0x4c')],{'$or':_[_0x8ce6('0x3c')](_0x35cd9c,function(_0x28d685){if(_0x28d685[_0x8ce6('0x3e')]!==_0x8ce6('0x50')){var _0x58d54f={};_0x58d54f[_0x28d685[_0x8ce6('0x3a')]]={'$like':'%'+_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x4e')]+'%'};return _0x58d54f;}})});}_0x14deb3=_[_0x8ce6('0x4f')]({},_0x14deb3,_0x174cf7[_0x8ce6('0x51')]);var _0x212d18={'where':_0x14deb3['where']};return db[_0x8ce6('0x3d')][_0x8ce6('0x2f')](_0x212d18)['then'](function(_0x30f4c2){_0x25ff21[_0x8ce6('0x2f')]=_0x30f4c2;if(_0x174cf7[_0x8ce6('0x41')][_0x8ce6('0x52')]){_0x14deb3[_0x8ce6('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8ce6('0x54')](_0x14deb3);})[_0x8ce6('0x36')](function(_0x4883a3){_0x25ff21[_0x8ce6('0x55')]=_0x4883a3;return _0x25ff21;})['then'](respondWithFilteredResult(_0x4b05be,_0x14deb3))['catch'](handleError(_0x4b05be,null));};exports['show']=function(_0x465b14,_0x1ca3a1){var _0x4ec1ad={'raw':!![],'where':{'id':_0x465b14['params']['id']}},_0x4dea5f={};_0x4dea5f[_0x8ce6('0x3f')]=_[_0x8ce6('0x40')](db[_0x8ce6('0x3d')][_0x8ce6('0x56')]);_0x4dea5f['query']=_[_0x8ce6('0x40')](_0x465b14[_0x8ce6('0x41')]);_0x4dea5f[_0x8ce6('0x42')]=_['intersection'](_0x4dea5f['model'],_0x4dea5f[_0x8ce6('0x41')]);_0x4ec1ad[_0x8ce6('0x45')]=_[_0x8ce6('0x43')](_0x4dea5f['model'],qs[_0x8ce6('0x44')](_0x465b14[_0x8ce6('0x41')][_0x8ce6('0x44')]));_0x4ec1ad[_0x8ce6('0x45')]=_0x4ec1ad[_0x8ce6('0x45')]['length']?_0x4ec1ad[_0x8ce6('0x45')]:_0x4dea5f[_0x8ce6('0x3f')];if(_0x465b14[_0x8ce6('0x41')][_0x8ce6('0x52')]){_0x4ec1ad['include']=[{'all':!![]}];}_0x4ec1ad=_[_0x8ce6('0x4f')]({},_0x4ec1ad,_0x465b14[_0x8ce6('0x51')]);return db[_0x8ce6('0x3d')][_0x8ce6('0x57')](_0x4ec1ad)[_0x8ce6('0x36')](handleEntityNotFound(_0x1ca3a1,null))[_0x8ce6('0x36')](respondWithResult(_0x1ca3a1,null))[_0x8ce6('0x58')](handleError(_0x1ca3a1,null));};exports[_0x8ce6('0x59')]=function(_0x383159,_0x22b3dc){return db['OpenchannelMessage']['create'](_0x383159[_0x8ce6('0x5a')],{})[_0x8ce6('0x36')](respondWithResult(_0x22b3dc,0xc9))['catch'](handleError(_0x22b3dc,null));};exports[_0x8ce6('0x35')]=function(_0x520114,_0x3d0a48){if(_0x520114[_0x8ce6('0x5a')]['id']){delete _0x520114[_0x8ce6('0x5a')]['id'];}return db['OpenchannelMessage'][_0x8ce6('0x57')]({'where':{'id':_0x520114[_0x8ce6('0x5b')]['id']}})[_0x8ce6('0x36')](handleEntityNotFound(_0x3d0a48,null))[_0x8ce6('0x36')](saveUpdates(_0x520114[_0x8ce6('0x5a')],null))[_0x8ce6('0x36')](respondWithResult(_0x3d0a48,null))[_0x8ce6('0x58')](handleError(_0x3d0a48,null));};exports[_0x8ce6('0x37')]=function(_0x2f78f7,_0x3a86d0){return db['OpenchannelMessage'][_0x8ce6('0x57')]({'where':{'id':_0x2f78f7[_0x8ce6('0x5b')]['id']}})[_0x8ce6('0x36')](handleEntityNotFound(_0x3a86d0,null))['then'](removeEntity(_0x3a86d0,null))[_0x8ce6('0x58')](handleError(_0x3a86d0,null));};exports[_0x8ce6('0x5c')]=function(_0x2a26c0,_0x77aab1){return db[_0x8ce6('0x3d')]['describe']()['then'](respondWithResult(_0x77aab1,null))['catch'](handleError(_0x77aab1,null));};var interaction_log=require('../../config/logger')(_0x8ce6('0x5d'));exports['accept']=function(_0x19486d,_0x31e6ac,_0x127b45){var _0x13d1e5={'agent':{},'channel':'openchannel'};if(_0x19486d[_0x8ce6('0x5a')]['id']){delete _0x19486d[_0x8ce6('0x5a')]['id'];}_0x19486d[_0x8ce6('0x5a')][_0x8ce6('0x5e')]=!![];_0x19486d[_0x8ce6('0x5a')]['readAt']=moment()[_0x8ce6('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x19486d[_0x8ce6('0x5a')]['UserId']=_0x19486d['body'][_0x8ce6('0x60')]||_0x19486d['user']['id'];_0x13d1e5[_0x8ce6('0x61')]['id']=_0x19486d[_0x8ce6('0x5a')][_0x8ce6('0x60')];return db[_0x8ce6('0x3d')][_0x8ce6('0x57')]({'where':{'id':_0x19486d['params']['id'],'UserId':null}})[_0x8ce6('0x36')](handleEntityNotFound(_0x31e6ac,null))[_0x8ce6('0x36')](saveUpdates(_0x19486d['body'],null))[_0x8ce6('0x36')](function(_0x20235a){if(_0x20235a){_0x13d1e5[_0x8ce6('0x29')]=_0x20235a['get']({'plain':!![]});return db[_0x8ce6('0x62')][_0x8ce6('0x57')]({'where':{'id':_0x20235a[_0x8ce6('0x63')]}});}return null;})[_0x8ce6('0x36')](handleEntityNotFound(_0x31e6ac,null))['then'](function(_0x1db316){if(_0x1db316){return _0x1db316['update']({'UserId':_0x19486d[_0x8ce6('0x5a')][_0x8ce6('0x60')],'read1stAt':_[_0x8ce6('0x64')](_0x1db316['read1stAt'])?moment()[_0x8ce6('0x5f')](_0x8ce6('0x65')):undefined});}return null;})[_0x8ce6('0x36')](function(_0x4feebb){if(_0x4feebb){_0x13d1e5[_0x8ce6('0x66')]=_0x4feebb[_0x8ce6('0x67')]({'plain':!![]});interaction_log[_0x8ce6('0x23')](_0x8ce6('0x68'),_0x19486d[_0x8ce6('0x69')]['id'],_0x19486d[_0x8ce6('0x69')][_0x8ce6('0x3a')],_0x19486d[_0x8ce6('0x69')][_0x8ce6('0x6a')],_0x13d1e5[_0x8ce6('0x66')]['id'],_0x19486d[_0x8ce6('0x5a')]?JSON[_0x8ce6('0x6b')](_0x19486d[_0x8ce6('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8ce6('0x6c'),_0x13d1e5);}return null;})['then'](function(_0x46de33){var _0x1b2dbb=_0x8ce6('0x6d')+_0x46de33[_0x8ce6('0x29')][_0x8ce6('0x6e')];return db[_0x8ce6('0x6f')][_0x8ce6('0x41')](_0x1b2dbb,{'type':db['Sequelize'][_0x8ce6('0x70')][_0x8ce6('0x71')],'raw':!![]})[_0x8ce6('0x36')](function(_0x3950cc){return _0x3950cc;});})[_0x8ce6('0x36')](function(_0x4c90ab){if(_0x4c90ab){_0x13d1e5[_0x8ce6('0x29')][_0x8ce6('0x72')]=_0x4c90ab[0x0];if(!_0x19486d[_0x8ce6('0x5a')][_0x8ce6('0x60')])return;return db[_0x8ce6('0x73')][_0x8ce6('0x57')]({'where':{'id':_0x19486d[_0x8ce6('0x5a')]['UserId'],'role':_0x8ce6('0x61')},'attributes':['id','name','fullname',_0x8ce6('0x74'),_0x8ce6('0x75')],'raw':!![]});}return null;})[_0x8ce6('0x36')](function(_0x53f43d){if(!_0x53f43d)return null;_0x13d1e5[_0x8ce6('0x29')][_0x8ce6('0x61')]=_0x53f43d;return _0x13d1e5;})[_0x8ce6('0x36')](function(_0x3accab){if(_0x3accab){if(_0x19486d[_0x8ce6('0x5a')]['manual']){_0x13d1e5[_0x8ce6('0x29')][_0x8ce6('0x76')]=util[_0x8ce6('0x5f')]('SIP/%s',_0x19486d[_0x8ce6('0x69')]['name']);_0x13d1e5['message'][_0x8ce6('0x77')]=_0x13d1e5[_0x8ce6('0x77')];_0x13d1e5[_0x8ce6('0x29')]['motionChannel']=_0x13d1e5[_0x8ce6('0x77')];_0x13d1e5[_0x8ce6('0x29')][_0x8ce6('0x78')]=_0x8ce6('0x79');return respondWithRpcPromise(_0x8ce6('0x7a'),'EventManager',{'event':_0x8ce6('0x7b'),'message':_0x13d1e5[_0x8ce6('0x29')]},client9002)[_0x8ce6('0x36')](function(){return _0x13d1e5;});}return _0x13d1e5;}return null;})[_0x8ce6('0x36')](respondWithResult(_0x31e6ac,null))[_0x8ce6('0x58')](handleError(_0x31e6ac,null));};var interaction_log=require(_0x8ce6('0x15'))(_0x8ce6('0x5d'));exports['reject']=function(_0x267e30,_0x20f27,_0x5382b6){var _0x178bb1={'agent':{},'channel':_0x8ce6('0x7c')};if(_0x267e30[_0x8ce6('0x5a')]['id']){delete _0x267e30['body']['id'];}_0x267e30['body'][_0x8ce6('0x60')]=_0x267e30[_0x8ce6('0x5a')][_0x8ce6('0x60')]||_0x267e30[_0x8ce6('0x69')]['id'];_0x178bb1[_0x8ce6('0x61')]['id']=_0x267e30[_0x8ce6('0x5a')][_0x8ce6('0x60')];return db[_0x8ce6('0x3d')]['find']({'where':{'id':_0x267e30[_0x8ce6('0x5b')]['id'],'UserId':null}})[_0x8ce6('0x36')](handleEntityNotFound(_0x20f27,null))[_0x8ce6('0x36')](function(_0x42dd37){if(_0x42dd37){_0x178bb1[_0x8ce6('0x29')]=_0x42dd37[_0x8ce6('0x67')]({'plain':!![]});return db[_0x8ce6('0x62')][_0x8ce6('0x57')]({'where':{'id':_0x42dd37[_0x8ce6('0x63')]}});}return null;})[_0x8ce6('0x36')](handleEntityNotFound(_0x20f27,null))[_0x8ce6('0x36')](function(_0x3a5eb0){if(_0x3a5eb0){_0x178bb1[_0x8ce6('0x66')]=_0x3a5eb0[_0x8ce6('0x67')]({'plain':!![]});interaction_log[_0x8ce6('0x23')](_0x8ce6('0x7d'),_0x267e30[_0x8ce6('0x69')]['id'],_0x267e30[_0x8ce6('0x69')][_0x8ce6('0x3a')],_0x267e30[_0x8ce6('0x69')][_0x8ce6('0x6a')],_0x178bb1[_0x8ce6('0x66')]['id'],_0x267e30[_0x8ce6('0x5a')]?JSON[_0x8ce6('0x6b')](_0x267e30['body']):'null');return respondWithRpcPromise(_0x8ce6('0x7e'),_0x8ce6('0x7f'),_0x178bb1);}return null;})[_0x8ce6('0x36')](function(_0x2429f2){var _0x4bf699=_0x8ce6('0x6d')+_0x2429f2[_0x8ce6('0x29')][_0x8ce6('0x6e')];return db[_0x8ce6('0x6f')][_0x8ce6('0x41')](_0x4bf699,{'type':db[_0x8ce6('0x80')][_0x8ce6('0x70')][_0x8ce6('0x71')],'raw':!![]})['then'](function(_0x19811d){return _0x19811d;});})[_0x8ce6('0x36')](function(_0x156390){if(_0x156390){_0x178bb1[_0x8ce6('0x29')][_0x8ce6('0x72')]=_0x156390[0x0];if(!_0x267e30[_0x8ce6('0x5a')][_0x8ce6('0x60')])return;return db['User'][_0x8ce6('0x57')]({'where':{'id':_0x267e30['body'][_0x8ce6('0x60')],'role':_0x8ce6('0x61')},'attributes':['id',_0x8ce6('0x3a'),_0x8ce6('0x81'),_0x8ce6('0x74'),_0x8ce6('0x75')],'raw':!![]});}return null;})[_0x8ce6('0x36')](function(_0x444d6b){if(!_0x444d6b)return null;_0x178bb1[_0x8ce6('0x29')][_0x8ce6('0x61')]=_0x444d6b;return _0x178bb1;})[_0x8ce6('0x36')](function(_0x2172af){if(_0x2172af){_0x2172af[_0x8ce6('0x29')][_0x8ce6('0x76')]=util[_0x8ce6('0x5f')](_0x8ce6('0x82'),_0x267e30['user'][_0x8ce6('0x3a')]);_0x2172af[_0x8ce6('0x29')]['channel']=_0x178bb1[_0x8ce6('0x77')];_0x2172af[_0x8ce6('0x29')][_0x8ce6('0x83')]=_0x178bb1['channel'];_0x2172af[_0x8ce6('0x29')]['event']='reject';respondWithRpcPromise('EventManager',_0x8ce6('0x7a'),{'event':'rejectmessage','message':_0x2172af[_0x8ce6('0x29')]},client9002);return _0x178bb1;}return null;})[_0x8ce6('0x36')](respondWithResult(_0x20f27,null))[_0x8ce6('0x58')](handleError(_0x20f27,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index beccb37..78ba847 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 _0x0092=['setMaxListeners','save','update','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x2b6110,_0x45dc4b){var _0x44ebe6=function(_0x2ecf8f){while(--_0x2ecf8f){_0x2b6110['push'](_0x2b6110['shift']());}};_0x44ebe6(++_0x45dc4b);}(_0x0092,0x1a5));var _0x2009=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x0092[_0x5ce3c8];return _0xa76867;};'use strict';var EventEmitter=require(_0x2009('0x0'));var OpenchannelMessage=require(_0x2009('0x1'))['db'][_0x2009('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2009('0x3')](0x0);var events={'afterCreate':_0x2009('0x4'),'afterUpdate':_0x2009('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a170d){return function(_0xcc0508,_0x427d95,_0xe4325){OpenchannelMessageEvents['emit'](_0x1a170d+':'+_0xcc0508['id'],_0xcc0508);OpenchannelMessageEvents['emit'](_0x1a170d,_0xcc0508);_0xe4325(null);};}for(var e in events){if(events[_0x2009('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x2009('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xfcd9=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x203847,_0x38fb38){var _0x383d7a=function(_0x1f10bb){while(--_0x1f10bb){_0x203847['push'](_0x203847['shift']());}};_0x383d7a(++_0x38fb38);}(_0xfcd9,0x1c8));var _0x9fcd=function(_0x160182,_0x4cf21a){_0x160182=_0x160182-0x0;var _0x1c1e78=_0xfcd9[_0x160182];return _0x1c1e78;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x9fcd('0x0'))['db'][_0x9fcd('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9fcd('0x2')](0x0);var events={'afterCreate':_0x9fcd('0x3'),'afterUpdate':_0x9fcd('0x4'),'afterDestroy':_0x9fcd('0x5')};function emitEvent(_0x378e92){return function(_0x397ece,_0x376634,_0x409468){OpenchannelMessageEvents[_0x9fcd('0x6')](_0x378e92+':'+_0x397ece['id'],_0x397ece);OpenchannelMessageEvents['emit'](_0x378e92,_0x397ece);_0x409468(null);};}for(var e in events){if(events[_0x9fcd('0x7')](e)){var event=events[e];OpenchannelMessage[_0x9fcd('0x8')](e,emitEvent(event));}}module[_0x9fcd('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 1cb6728..6976dd4 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 _0x54a5=['catch','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','get','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','threadId','Interaction','update','error','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0x4876c5,_0x4d02e3){var _0x3e58b5=function(_0x1e49da){while(--_0x1e49da){_0x4876c5['push'](_0x4876c5['shift']());}};_0x3e58b5(++_0x4d02e3);}(_0x54a5,0xe8));var _0x554a=function(_0x33a4c9,_0x59994b){_0x33a4c9=_0x33a4c9-0x0;var _0x39935d=_0x54a5[_0x33a4c9];return _0x39935d;};'use strict';var _=require(_0x554a('0x0'));var util=require('util');var logger=require(_0x554a('0x1'))(_0x554a('0x2'));var moment=require(_0x554a('0x3'));var BPromise=require(_0x554a('0x4'));var rp=require(_0x554a('0x5'));var fs=require('fs');var path=require(_0x554a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x554a('0x7'));module[_0x554a('0x8')]=function(_0x157271,_0x2a2583){return _0x157271[_0x554a('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x554a('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x554a('0xb')],'type':_0x554a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x532059,_0x196b6d,_0x4241ac){var _0x4d79e3=_0x157271[_0x554a('0xd')];var _0x1e3c72=_0x532059['get']({'plain':!![]});if(_0x1e3c72[_0x554a('0xe')][_0x554a('0xf')]()==='in'||_0x1e3c72['direction'][_0x554a('0xf')]()===_0x554a('0x10')&&!_0x1e3c72['secret']&&!_[_0x554a('0x11')](_0x1e3c72[_0x554a('0x12')])){_0x4d79e3['OpenchannelInteraction'][_0x554a('0x13')]({'where':{'id':_0x1e3c72[_0x554a('0x14')]}})[_0x554a('0x15')](function(_0x1e04f2){if(_0x1e04f2){_0x1e04f2['update']({'lastMsgAt':_0x1e3c72[_0x554a('0x16')],'lastMsgDirection':_0x1e3c72[_0x554a('0xe')][_0x554a('0xf')]()});}})[_0x554a('0x17')](function(_0x2bb777){console['error'](_0x2bb777);});}if(_0x1e3c72['direction']===_0x554a('0x10')&&!_0x1e3c72[_0x554a('0x18')]){var _0x189b63;_0x4d79e3[_0x554a('0x19')][_0x554a('0x1a')]()[_0x554a('0x15')](function(_0x5331ab){return _0x4d79e3[_0x554a('0x1b')][_0x554a('0x1c')]({'where':{'id':_0x1e3c72[_0x554a('0x1d')]},'include':[{'model':_0x4d79e3[_0x554a('0x1e')],'as':_0x554a('0x1f'),'where':{'id':_0x1e3c72[_0x554a('0x14')]},'limit':0x1,'include':[{'model':_0x4d79e3['CmContact'],'as':_0x554a('0x20'),'attributes':_['keys'](_0x5331ab)}]}]});})[_0x554a('0x15')](function(_0x2c3771){_0x189b63=_0x2c3771[_0x554a('0x21')]({'plain':!![]});if(_0x189b63&&_0x189b63[_0x554a('0x22')]){logger[_0x554a('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x554a('0x24')](_0x554a('0x25'),_0x1e3c72['id'],_0x189b63[_0x554a('0x22')]));if(_0x189b63[_0x554a('0x1f')]&&_0x189b63[_0x554a('0x1f')]['length']){_0x1e3c72['Interaction']=_['omit'](_0x189b63['Interactions'][0x0],'Contact');_0x1e3c72['Contact']=_0x189b63[_0x554a('0x1f')][0x0][_0x554a('0x20')];}var _0x196b6d={'method':_0x554a('0x26'),'uri':encodeURI(_0x189b63[_0x554a('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x196b6d[_0x554a('0x27')]){case _0x554a('0x28'):_0x196b6d['qs']=_0x1e3c72;break;case'POST':_0x196b6d[_0x554a('0xb')]=_0x1e3c72;break;}return rp(_0x196b6d)[_0x554a('0x15')](function(_0x412d97){logger['info'](_0x554a('0x29'),'afterCreate',util[_0x554a('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1e3c72['id'],_0x189b63[_0x554a('0x22')]));if(_0x412d97[_0x554a('0xb')]['threadId']&&_0x412d97[_0x554a('0xb')][_0x554a('0x2a')]!=_0x1e3c72[_0x554a('0x2b')]['threadId']){return _0x4d79e3[_0x554a('0x1e')][_0x554a('0x2c')]({'threadId':_0x412d97['body'][_0x554a('0x2a')]},{'where':{'id':_0x1e3c72[_0x554a('0x2b')]['id']}});}else{return;}})[_0x554a('0x15')](function(){return _0x532059[_0x554a('0x2c')]({'read':!![]});})['catch'](function(_0x1904c2){logger[_0x554a('0x2d')](_0x554a('0x29'),_0x554a('0x2e'),util[_0x554a('0x2f')](_0x1904c2,{'showHidden':![],'depth':null}));_0x4241ac();});}else{_0x4241ac();}})[_0x554a('0x30')](function(){_0x4241ac();});}else{_0x4241ac();}}},'charset':_0x554a('0x31'),'collate':_0x554a('0x32')});}; \ No newline at end of file +var _0x5338=['describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelMessage.attributes','define','openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','update','createdAt','catch','error','CmContact'];(function(_0x5d491a,_0x46fe1b){var _0x31b402=function(_0x14854e){while(--_0x14854e){_0x5d491a['push'](_0x5d491a['shift']());}};_0x31b402(++_0x46fe1b);}(_0x5338,0x11e));var _0x8533=function(_0x331ce9,_0x4bf2fd){_0x331ce9=_0x331ce9-0x0;var _0x1b2ddb=_0x5338[_0x331ce9];return _0x1b2ddb;};'use strict';var _=require(_0x8533('0x0'));var util=require(_0x8533('0x1'));var logger=require(_0x8533('0x2'))(_0x8533('0x3'));var moment=require(_0x8533('0x4'));var BPromise=require(_0x8533('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8533('0x6'));var rimraf=require('rimraf');var config=require(_0x8533('0x7'));var attributes=require(_0x8533('0x8'));module['exports']=function(_0xb9a785,_0xa17bd5){return _0xb9a785[_0x8533('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x8533('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x8533('0xb')],'type':_0x8533('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x442b1e,_0x1453fc,_0x2f5bd6){var _0x46e3e5=_0xb9a785['models'];var _0x27744c=_0x442b1e[_0x8533('0xd')]({'plain':!![]});if(_0x27744c[_0x8533('0xe')]['toLowerCase']()==='in'||_0x27744c[_0x8533('0xe')][_0x8533('0xf')]()===_0x8533('0x10')&&!_0x27744c[_0x8533('0x11')]&&!_[_0x8533('0x12')](_0x27744c[_0x8533('0x13')])){_0x46e3e5[_0x8533('0x14')]['findOne']({'where':{'id':_0x27744c['OpenchannelInteractionId']}})['then'](function(_0x5820c6){if(_0x5820c6){_0x5820c6[_0x8533('0x15')]({'lastMsgAt':_0x27744c[_0x8533('0x16')],'lastMsgDirection':_0x27744c[_0x8533('0xe')]['toLowerCase']()});}})[_0x8533('0x17')](function(_0x3e97d6){console[_0x8533('0x18')](_0x3e97d6);});}if(_0x27744c[_0x8533('0xe')]===_0x8533('0x10')&&!_0x27744c['secret']){var _0x4f7325;_0x46e3e5[_0x8533('0x19')][_0x8533('0x1a')]()[_0x8533('0x1b')](function(_0x35adcd){return _0x46e3e5[_0x8533('0x1c')][_0x8533('0x1d')]({'where':{'id':_0x27744c[_0x8533('0x1e')]},'include':[{'model':_0x46e3e5[_0x8533('0x14')],'as':_0x8533('0x1f'),'where':{'id':_0x27744c[_0x8533('0x20')]},'limit':0x1,'include':[{'model':_0x46e3e5[_0x8533('0x19')],'as':_0x8533('0x21'),'attributes':_[_0x8533('0x22')](_0x35adcd)}]}]});})[_0x8533('0x1b')](function(_0x4276da){_0x4f7325=_0x4276da[_0x8533('0xd')]({'plain':!![]});if(_0x4f7325&&_0x4f7325['replyUri']){logger['info'](_0x8533('0x23'),_0x8533('0x24'),util[_0x8533('0x25')](_0x8533('0x26'),_0x27744c['id'],_0x4f7325[_0x8533('0x27')]));if(_0x4f7325['Interactions']&&_0x4f7325['Interactions'][_0x8533('0x28')]){_0x27744c['Interaction']=_[_0x8533('0x29')](_0x4f7325['Interactions'][0x0],_0x8533('0x21'));_0x27744c['Contact']=_0x4f7325['Interactions'][0x0]['Contact'];}var _0x1453fc={'method':_0x8533('0x2a'),'uri':encodeURI(_0x4f7325['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1453fc[_0x8533('0x2b')]){case _0x8533('0x2c'):_0x1453fc['qs']=_0x27744c;break;case _0x8533('0x2a'):_0x1453fc[_0x8533('0xb')]=_0x27744c;break;}return rp(_0x1453fc)[_0x8533('0x1b')](function(_0x4e0a4b){logger[_0x8533('0x2d')]('OpenchannelMessage,\x20%s,\x20%s',_0x8533('0x24'),util[_0x8533('0x25')](_0x8533('0x2e'),_0x27744c['id'],_0x4f7325[_0x8533('0x27')]));if(_0x4e0a4b[_0x8533('0xb')][_0x8533('0x2f')]&&_0x4e0a4b[_0x8533('0xb')]['threadId']!=_0x27744c[_0x8533('0x30')][_0x8533('0x2f')]){return _0x46e3e5[_0x8533('0x14')][_0x8533('0x15')]({'threadId':_0x4e0a4b[_0x8533('0xb')][_0x8533('0x2f')]},{'where':{'id':_0x27744c[_0x8533('0x30')]['id']}});}else{return;}})[_0x8533('0x1b')](function(){return _0x442b1e[_0x8533('0x15')]({'read':!![]});})[_0x8533('0x17')](function(_0x2258da){logger[_0x8533('0x18')](_0x8533('0x23'),_0x8533('0x24'),util[_0x8533('0x31')](_0x2258da,{'showHidden':![],'depth':null}));_0x2f5bd6();});}else{_0x2f5bd6();}})[_0x8533('0x32')](function(){_0x2f5bd6();});}else{_0x2f5bd6();}}},'charset':'utf8mb4','collate':_0x8533('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b239a8b..9909e83 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x2343c8,_0x1887dc){var _0x5f3925=function(_0x28ebcb){while(--_0x28ebcb){_0x2343c8['push'](_0x2343c8['shift']());}};_0x5f3925(++_0x1887dc);}(_0xadb5,0xad));var _0x5adb=function(_0x1d3632,_0x5090b2){_0x1d3632=_0x1d3632-0x0;var _0x5c44b0=_0xadb5[_0x1d3632];return _0x5c44b0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x91011d,_0x438f7d){var _0x797100=function(_0x198f4d){while(--_0x198f4d){_0x91011d['push'](_0x91011d['shift']());}};_0x797100(++_0x438f7d);}(_0x1261,0x144));var _0x1126=function(_0x3feb5f,_0x45cc31){_0x3feb5f=_0x3feb5f-0x0;var _0x5c4911=_0x1261[_0x3feb5f];return _0x5c4911;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 7e24234..cf04c81 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 _0x1a44=['./openchannelMessage.events','remove','update','emit','removeListener','register','openchannelMessage:'];(function(_0x465d15,_0x42f750){var _0x36a91a=function(_0x20af49){while(--_0x20af49){_0x465d15['push'](_0x465d15['shift']());}};_0x36a91a(++_0x42f750);}(_0x1a44,0xc4));var _0x41a4=function(_0x50dc59,_0x353122){_0x50dc59=_0x50dc59-0x0;var _0x4fa5c0=_0x1a44[_0x50dc59];return _0x4fa5c0;};'use strict';var OpenchannelMessageEvents=require(_0x41a4('0x0'));var events=['save',_0x41a4('0x1'),_0x41a4('0x2')];function createListener(_0x306334,_0xb7b167){return function(_0x308968){_0xb7b167[_0x41a4('0x3')](_0x306334,_0x308968);};}function removeListener(_0x397cb2,_0x529244){return function(){OpenchannelMessageEvents[_0x41a4('0x4')](_0x397cb2,_0x529244);};}exports[_0x41a4('0x5')]=function(_0xb62f3c){for(var _0x412bd8=0x0,_0x599ccc=events['length'];_0x412bd8<_0x599ccc;_0x412bd8++){var _0x2e523b=events[_0x412bd8];var _0x141ae3=createListener(_0x41a4('0x6')+_0x2e523b,_0xb62f3c);OpenchannelMessageEvents['on'](_0x2e523b,_0x141ae3);}}; \ No newline at end of file +var _0x55cd=['emit','removeListener','length','remove'];(function(_0x1fdde7,_0x4676a8){var _0x10e587=function(_0x4d74a0){while(--_0x4d74a0){_0x1fdde7['push'](_0x1fdde7['shift']());}};_0x10e587(++_0x4676a8);}(_0x55cd,0xdb));var _0xd55c=function(_0x5bad1f,_0x509daf){_0x5bad1f=_0x5bad1f-0x0;var _0x5e8ab8=_0x55cd[_0x5bad1f];return _0x5e8ab8;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xd55c('0x0'),'update'];function createListener(_0x3a5cd0,_0x462ab9){return function(_0x1efa97){_0x462ab9[_0xd55c('0x1')](_0x3a5cd0,_0x1efa97);};}function removeListener(_0x5a7c59,_0xb6c552){return function(){OpenchannelMessageEvents[_0xd55c('0x2')](_0x5a7c59,_0xb6c552);};}exports['register']=function(_0x6b25a4){for(var _0xd5d74e=0x0,_0x4fc57b=events[_0xd55c('0x3')];_0xd5d74e<_0x4fc57b;_0xd5d74e++){var _0x1e757b=events[_0xd5d74e];var _0x76f822=createListener('openchannelMessage:'+_0x1e757b,_0x6b25a4);OpenchannelMessageEvents['on'](_0x1e757b,_0x76f822);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index aeac706..8759e6e 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 _0xa639=['/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers'];(function(_0x4b5e6d,_0x3e53b1){var _0x3b7831=function(_0x4d922d){while(--_0x4d922d){_0x4b5e6d['push'](_0x4b5e6d['shift']());}};_0x3b7831(++_0x3e53b1);}(_0xa639,0x109));var _0x9a63=function(_0x1c4dbb,_0x255872){_0x1c4dbb=_0x1c4dbb-0x0;var _0x378103=_0xa639[_0x1c4dbb];return _0x378103;};'use strict';var multer=require(_0x9a63('0x0'));var util=require(_0x9a63('0x1'));var path=require('path');var timeout=require(_0x9a63('0x2'));var express=require(_0x9a63('0x3'));var router=express['Router']();var fs_extra=require(_0x9a63('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a63('0x5'));var config=require(_0x9a63('0x6'));var controller=require('./openchannelQueue.controller');router[_0x9a63('0x7')]('/',auth[_0x9a63('0x8')](),controller[_0x9a63('0x9')]);router[_0x9a63('0x7')](_0x9a63('0xa'),auth[_0x9a63('0x8')](),controller['describe']);router[_0x9a63('0x7')](_0x9a63('0xb'),auth[_0x9a63('0x8')](),controller[_0x9a63('0xc')]);router[_0x9a63('0x7')](_0x9a63('0xd'),auth['isAuthenticated'](),controller[_0x9a63('0xe')]);router[_0x9a63('0x7')](_0x9a63('0xf'),auth[_0x9a63('0x8')](),controller[_0x9a63('0x10')]);router[_0x9a63('0x7')]('/:id/users',auth[_0x9a63('0x8')](),controller[_0x9a63('0x11')]);router[_0x9a63('0x12')]('/',auth[_0x9a63('0x8')](),controller[_0x9a63('0x13')]);router[_0x9a63('0x12')](_0x9a63('0xf'),auth[_0x9a63('0x8')](),controller[_0x9a63('0x14')]);router[_0x9a63('0x12')](_0x9a63('0x15'),auth['isAuthenticated'](),controller[_0x9a63('0x16')]);router[_0x9a63('0x17')](_0x9a63('0xb'),auth[_0x9a63('0x8')](),controller[_0x9a63('0x18')]);router[_0x9a63('0x19')](_0x9a63('0xb'),auth[_0x9a63('0x8')](),controller['destroy']);router[_0x9a63('0x19')](_0x9a63('0xf'),auth[_0x9a63('0x8')](),controller['removeTeams']);router[_0x9a63('0x19')](_0x9a63('0x15'),auth[_0x9a63('0x8')](),controller[_0x9a63('0x1a')]);module[_0x9a63('0x1b')]=router; \ No newline at end of file +var _0x0f90=['/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','update','delete','destroy'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0f90,0x1b3));var _0x00f9=function(_0x23b8c4,_0x41b837){_0x23b8c4=_0x23b8c4-0x0;var _0x34b2c7=_0x0f90[_0x23b8c4];return _0x34b2c7;};'use strict';var multer=require(_0x00f9('0x0'));var util=require(_0x00f9('0x1'));var path=require(_0x00f9('0x2'));var timeout=require(_0x00f9('0x3'));var express=require(_0x00f9('0x4'));var router=express[_0x00f9('0x5')]();var fs_extra=require(_0x00f9('0x6'));var auth=require(_0x00f9('0x7'));var interaction=require(_0x00f9('0x8'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x00f9('0x9')]('/',auth[_0x00f9('0xa')](),controller['index']);router[_0x00f9('0x9')]('/describe',auth[_0x00f9('0xa')](),controller[_0x00f9('0xb')]);router['get'](_0x00f9('0xc'),auth[_0x00f9('0xa')](),controller['show']);router[_0x00f9('0x9')](_0x00f9('0xd'),auth[_0x00f9('0xa')](),controller['getMembers']);router[_0x00f9('0x9')](_0x00f9('0xe'),auth[_0x00f9('0xa')](),controller[_0x00f9('0xf')]);router[_0x00f9('0x9')]('/:id/users',auth[_0x00f9('0xa')](),controller[_0x00f9('0x10')]);router[_0x00f9('0x11')]('/',auth[_0x00f9('0xa')](),controller['create']);router['post'](_0x00f9('0xe'),auth[_0x00f9('0xa')](),controller[_0x00f9('0x12')]);router[_0x00f9('0x11')]('/:id/users',auth[_0x00f9('0xa')](),controller[_0x00f9('0x13')]);router[_0x00f9('0x14')](_0x00f9('0xc'),auth[_0x00f9('0xa')](),controller[_0x00f9('0x15')]);router[_0x00f9('0x16')](_0x00f9('0xc'),auth['isAuthenticated'](),controller[_0x00f9('0x17')]);router[_0x00f9('0x16')](_0x00f9('0xe'),auth[_0x00f9('0xa')](),controller['removeTeams']);router[_0x00f9('0x16')](_0x00f9('0x18'),auth[_0x00f9('0xa')](),controller[_0x00f9('0x19')]);module[_0x00f9('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 7e07126..ca2a798 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 _0x20f3=['roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x20f3,0xaf));var _0x320f=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x20f3[_0x1c470d];return _0x12141b;};'use strict';var Sequelize=require(_0x320f('0x0'));module['exports']={'name':{'type':Sequelize[_0x320f('0x1')],'unique':_0x320f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x320f('0x1')]},'timeout':{'type':Sequelize[_0x320f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x320f('0x4')]('rrmemory','beepall',_0x320f('0x5'))}}; \ No newline at end of file +var _0xc314=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x34ece7,_0x197dce){var _0x2bb837=function(_0x49a0b7){while(--_0x49a0b7){_0x34ece7['push'](_0x34ece7['shift']());}};_0x2bb837(++_0x197dce);}(_0xc314,0x95));var _0x4c31=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc314[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x4c31('0x0'));module[_0x4c31('0x1')]={'name':{'type':Sequelize[_0x4c31('0x2')],'unique':_0x4c31('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c31('0x2')]},'timeout':{'type':Sequelize[_0x4c31('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c31('0x5')](_0x4c31('0x6'),'beepall',_0x4c31('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index bcd1f92..2c9e3ac 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 _0xb4d3=['agent','format','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','removeTeams','select','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','status','end','offset','limit','count','Content-Range','json','reject','save','update','destroy','get','OpenchannelQueues','then','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','UserId'];(function(_0x174882,_0x47c151){var _0x51ad3f=function(_0x17eb70){while(--_0x17eb70){_0x174882['push'](_0x174882['shift']());}};_0x51ad3f(++_0x47c151);}(_0xb4d3,0x13d));var _0x3b4d=function(_0x21a0cb,_0x5a4cc5){_0x21a0cb=_0x21a0cb-0x0;var _0x2e9bb4=_0xb4d3[_0x21a0cb];return _0x2e9bb4;};'use strict';var emlformat=require(_0x3b4d('0x0'));var rimraf=require(_0x3b4d('0x1'));var zipdir=require(_0x3b4d('0x2'));var jsonpatch=require(_0x3b4d('0x3'));var rp=require(_0x3b4d('0x4'));var moment=require(_0x3b4d('0x5'));var BPromise=require(_0x3b4d('0x6'));var Mustache=require(_0x3b4d('0x7'));var util=require(_0x3b4d('0x8'));var path=require(_0x3b4d('0x9'));var sox=require(_0x3b4d('0xa'));var csv=require(_0x3b4d('0xb'));var ejs=require(_0x3b4d('0xc'));var fs=require('fs');var fs_extra=require(_0x3b4d('0xd'));var _=require('lodash');var squel=require(_0x3b4d('0xe'));var crypto=require('crypto');var jsforce=require(_0x3b4d('0xf'));var deskjs=require(_0x3b4d('0x10'));var toCsv=require(_0x3b4d('0xb'));var querystring=require(_0x3b4d('0x11'));var Papa=require('papaparse');var Redis=require(_0x3b4d('0x12'));var authService=require(_0x3b4d('0x13'));var qs=require(_0x3b4d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3b4d('0x15'));var licenseUtil=require(_0x3b4d('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3b4d('0x17')](config['redis'],{'host':_0x3b4d('0x18'),'port':0x18eb});var socket=require(_0x3b4d('0x19'))(new Redis(config[_0x3b4d('0x1a')]));require('./openchannelQueue.socket')[_0x3b4d('0x1b')](socket);function respondWithStatusCode(_0x31d29a,_0x5e9a1d){_0x5e9a1d=_0x5e9a1d||0xcc;return function(_0x14cacd){if(_0x14cacd){return _0x31d29a['sendStatus'](_0x5e9a1d);}return _0x31d29a[_0x3b4d('0x1c')](_0x5e9a1d)[_0x3b4d('0x1d')]();};}function respondWithResult(_0x3e60de,_0x3b9780){_0x3b9780=_0x3b9780||0xc8;return function(_0x3ae5b0){if(_0x3ae5b0){return _0x3e60de['status'](_0x3b9780)['json'](_0x3ae5b0);}};}function respondWithFilteredResult(_0xf6846f,_0x4242eb){return function(_0x5532ac){if(_0x5532ac){var _0x22c4b5=typeof _0x4242eb[_0x3b4d('0x1e')]==='undefined'&&typeof _0x4242eb[_0x3b4d('0x1f')]==='undefined';var _0x2dae9=_0x5532ac[_0x3b4d('0x20')];var _0x1fe58c=_0x22c4b5?0x0:_0x4242eb[_0x3b4d('0x1e')];var _0x39ea17=_0x22c4b5?_0x5532ac[_0x3b4d('0x20')]:_0x4242eb['offset']+_0x4242eb[_0x3b4d('0x1f')];var _0x59e05f;if(_0x39ea17>=_0x2dae9){_0x39ea17=_0x2dae9;_0x59e05f=0xc8;}else{_0x59e05f=0xce;}_0xf6846f[_0x3b4d('0x1c')](_0x59e05f);return _0xf6846f['set'](_0x3b4d('0x21'),_0x1fe58c+'-'+_0x39ea17+'/'+_0x2dae9)[_0x3b4d('0x22')](_0x5532ac);}return null;};}function patchUpdates(_0x463695){return function(_0x139bf1){try{jsonpatch['apply'](_0x139bf1,_0x463695,!![]);}catch(_0xbd2c51){return BPromise[_0x3b4d('0x23')](_0xbd2c51);}return _0x139bf1[_0x3b4d('0x24')]();};}function saveUpdates(_0x3e36a7,_0x4e63a6){return function(_0xa4c2f9){if(_0xa4c2f9){return _0xa4c2f9[_0x3b4d('0x25')](_0x3e36a7)['then'](function(_0x3bedfa){return _0x3bedfa;});}return null;};}function removeEntity(_0x20c4c4,_0x5aa75a){return function(_0x42cf46){if(_0x42cf46){return _0x42cf46[_0x3b4d('0x26')]()['then'](function(){var _0x4f1b3=_0x42cf46[_0x3b4d('0x27')]({'plain':!![]});var _0x32c8ff=_0x3b4d('0x28');return db['UserProfileResource'][_0x3b4d('0x26')]({'where':{'type':_0x32c8ff,'resourceId':_0x4f1b3['id']}})[_0x3b4d('0x29')](function(){return _0x42cf46;});})[_0x3b4d('0x29')](function(){_0x20c4c4[_0x3b4d('0x1c')](0xcc)[_0x3b4d('0x1d')]();});}};}function handleEntityNotFound(_0x1c0d10,_0x4368ed){return function(_0xf7c6f7){if(!_0xf7c6f7){_0x1c0d10['sendStatus'](0x194);}return _0xf7c6f7;};}function handleError(_0xcd152b,_0x445b44){_0x445b44=_0x445b44||0x1f4;return function(_0x50e6d5){logger[_0x3b4d('0x2a')](_0x50e6d5[_0x3b4d('0x2b')]);if(_0x50e6d5[_0x3b4d('0x2c')]){delete _0x50e6d5[_0x3b4d('0x2c')];}_0xcd152b['status'](_0x445b44)[_0x3b4d('0x2d')](_0x50e6d5);};}exports[_0x3b4d('0x2e')]=function(_0x3c81b6,_0x1b4d30){var _0x5a31e6={},_0x4fc899={},_0x332c14={'count':0x0,'rows':[]};var _0x3d089d=_[_0x3b4d('0x2f')](db[_0x3b4d('0x30')][_0x3b4d('0x31')],function(_0x1eab4c){return{'name':_0x1eab4c[_0x3b4d('0x32')],'type':_0x1eab4c[_0x3b4d('0x33')][_0x3b4d('0x34')]};});_0x4fc899[_0x3b4d('0x35')]=_[_0x3b4d('0x2f')](_0x3d089d,_0x3b4d('0x2c'));_0x4fc899[_0x3b4d('0x36')]=_[_0x3b4d('0x37')](_0x3c81b6[_0x3b4d('0x36')]);_0x4fc899['filters']=_[_0x3b4d('0x38')](_0x4fc899[_0x3b4d('0x35')],_0x4fc899[_0x3b4d('0x36')]);_0x5a31e6[_0x3b4d('0x39')]=_[_0x3b4d('0x38')](_0x4fc899[_0x3b4d('0x35')],qs[_0x3b4d('0x3a')](_0x3c81b6[_0x3b4d('0x36')]['fields']));_0x5a31e6[_0x3b4d('0x39')]=_0x5a31e6[_0x3b4d('0x39')][_0x3b4d('0x3b')]?_0x5a31e6[_0x3b4d('0x39')]:_0x4fc899[_0x3b4d('0x35')];if(!_0x3c81b6['query'][_0x3b4d('0x3c')](_0x3b4d('0x3d'))){_0x5a31e6[_0x3b4d('0x1f')]=qs[_0x3b4d('0x1f')](_0x3c81b6[_0x3b4d('0x36')]['limit']);_0x5a31e6[_0x3b4d('0x1e')]=qs['offset'](_0x3c81b6['query'][_0x3b4d('0x1e')]);}_0x5a31e6[_0x3b4d('0x3e')]=qs[_0x3b4d('0x3f')](_0x3c81b6[_0x3b4d('0x36')][_0x3b4d('0x3f')]);_0x5a31e6[_0x3b4d('0x40')]=qs[_0x3b4d('0x41')](_[_0x3b4d('0x42')](_0x3c81b6[_0x3b4d('0x36')],_0x4fc899[_0x3b4d('0x41')]),_0x3d089d);if(_0x3c81b6['query'][_0x3b4d('0x43')]){_0x5a31e6[_0x3b4d('0x40')]=_[_0x3b4d('0x44')](_0x5a31e6[_0x3b4d('0x40')],{'$or':_['map'](_0x3d089d,function(_0x957d35){if(_0x957d35[_0x3b4d('0x33')]!==_0x3b4d('0x45')){var _0x12e2d4={};_0x12e2d4[_0x957d35[_0x3b4d('0x2c')]]={'$like':'%'+_0x3c81b6[_0x3b4d('0x36')][_0x3b4d('0x43')]+'%'};return _0x12e2d4;}})});}_0x5a31e6=_['merge']({},_0x5a31e6,_0x3c81b6['options']);var _0xb213e4={'where':_0x5a31e6['where']};return db['OpenchannelQueue'][_0x3b4d('0x20')](_0xb213e4)['then'](function(_0x4e4b3b){_0x332c14['count']=_0x4e4b3b;if(_0x3c81b6['query'][_0x3b4d('0x46')]){_0x5a31e6[_0x3b4d('0x47')]=[{'all':!![]}];}return db[_0x3b4d('0x30')]['findAll'](_0x5a31e6);})[_0x3b4d('0x29')](function(_0x5df8db){_0x332c14[_0x3b4d('0x48')]=_0x5df8db;return _0x332c14;})[_0x3b4d('0x29')](respondWithFilteredResult(_0x1b4d30,_0x5a31e6))[_0x3b4d('0x49')](handleError(_0x1b4d30,null));};exports[_0x3b4d('0x4a')]=function(_0x36d178,_0x4ce31d){var _0x110f4a={'raw':!![],'where':{'id':_0x36d178[_0x3b4d('0x4b')]['id']}},_0x2448e7={};_0x2448e7['model']=_[_0x3b4d('0x37')](db['OpenchannelQueue']['rawAttributes']);_0x2448e7[_0x3b4d('0x36')]=_['keys'](_0x36d178['query']);_0x2448e7['filters']=_[_0x3b4d('0x38')](_0x2448e7[_0x3b4d('0x35')],_0x2448e7[_0x3b4d('0x36')]);_0x110f4a[_0x3b4d('0x39')]=_[_0x3b4d('0x38')](_0x2448e7['model'],qs['fields'](_0x36d178[_0x3b4d('0x36')][_0x3b4d('0x3a')]));_0x110f4a[_0x3b4d('0x39')]=_0x110f4a[_0x3b4d('0x39')][_0x3b4d('0x3b')]?_0x110f4a[_0x3b4d('0x39')]:_0x2448e7['model'];if(_0x36d178[_0x3b4d('0x36')][_0x3b4d('0x46')]){_0x110f4a[_0x3b4d('0x47')]=[{'all':!![]}];}_0x110f4a=_[_0x3b4d('0x44')]({},_0x110f4a,_0x36d178[_0x3b4d('0x4c')]);return db[_0x3b4d('0x30')][_0x3b4d('0x4d')](_0x110f4a)[_0x3b4d('0x29')](handleEntityNotFound(_0x4ce31d,null))[_0x3b4d('0x29')](respondWithResult(_0x4ce31d,null))['catch'](handleError(_0x4ce31d,null));};exports[_0x3b4d('0x4e')]=function(_0x422e62,_0x38df0c){return db['OpenchannelQueue']['create'](_0x422e62['body'],{})[_0x3b4d('0x29')](function(_0x9ff012){var _0x3cdcbc=_0x422e62[_0x3b4d('0x4f')][_0x3b4d('0x27')]({'plain':!![]});if(!_0x3cdcbc)throw new Error(_0x3b4d('0x50'));if(_0x3cdcbc[_0x3b4d('0x51')]==='user'){var _0x5699af=_0x9ff012[_0x3b4d('0x27')]({'plain':!![]});var _0x19993d=_0x3b4d('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x19993d,'userProfileId':_0x3cdcbc['userProfileId']},'raw':!![]})[_0x3b4d('0x29')](function(_0x459224){if(_0x459224&&_0x459224[_0x3b4d('0x52')]===0x0){return db[_0x3b4d('0x53')][_0x3b4d('0x4e')]({'name':_0x5699af['name'],'resourceId':_0x5699af['id'],'type':_0x459224[_0x3b4d('0x2c')],'sectionId':_0x459224['id']},{})['then'](function(){return _0x9ff012;});}else{return _0x9ff012;}})['catch'](function(_0x8d769c){logger[_0x3b4d('0x2a')](_0x3b4d('0x54'),_0x8d769c);throw _0x8d769c;});}return _0x9ff012;})[_0x3b4d('0x29')](respondWithResult(_0x38df0c,0xc9))[_0x3b4d('0x49')](handleError(_0x38df0c,null));};exports[_0x3b4d('0x25')]=function(_0x587468,_0x4f5a6){if(_0x587468[_0x3b4d('0x55')]['id']){delete _0x587468['body']['id'];}return db[_0x3b4d('0x30')]['find']({'where':{'id':_0x587468['params']['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x4f5a6,null))[_0x3b4d('0x29')](saveUpdates(_0x587468[_0x3b4d('0x55')],null))[_0x3b4d('0x29')](respondWithResult(_0x4f5a6,null))[_0x3b4d('0x49')](handleError(_0x4f5a6,null));};exports[_0x3b4d('0x26')]=function(_0x11f871,_0x2c620e){return db[_0x3b4d('0x30')]['find']({'where':{'id':_0x11f871[_0x3b4d('0x4b')]['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x2c620e,null))[_0x3b4d('0x29')](removeEntity(_0x2c620e,null))[_0x3b4d('0x49')](handleError(_0x2c620e,null));};exports[_0x3b4d('0x56')]=function(_0x319dfe,_0x422aea){return db[_0x3b4d('0x30')][_0x3b4d('0x56')]()['then'](respondWithResult(_0x422aea,null))[_0x3b4d('0x49')](handleError(_0x422aea,null));};exports[_0x3b4d('0x57')]=function(_0x3a6dfd,_0x2a3f79,_0x175ce7){var _0x2fd2a7={'raw':!![],'where':{}},_0x5d818a={},_0x176278;return db['OpenchannelQueue'][_0x3b4d('0x58')]({'where':{'id':_0x3a6dfd[_0x3b4d('0x4b')]['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x2a3f79,null))[_0x3b4d('0x29')](function(_0x2d2b04){if(_0x2d2b04){_0x176278=_0x2d2b04['get']({'plain':!![]});_0x5d818a[_0x3b4d('0x35')]=_[_0x3b4d('0x37')](db[_0x3b4d('0x59')][_0x3b4d('0x31')]);_0x5d818a[_0x3b4d('0x36')]=_['keys'](_0x3a6dfd[_0x3b4d('0x36')]);_0x5d818a[_0x3b4d('0x41')]=_['intersection'](_0x5d818a[_0x3b4d('0x35')],_0x5d818a['query']);_0x2fd2a7[_0x3b4d('0x39')]=_[_0x3b4d('0x38')](_0x5d818a[_0x3b4d('0x35')],qs[_0x3b4d('0x3a')](_0x3a6dfd[_0x3b4d('0x36')][_0x3b4d('0x3a')]));_0x2fd2a7['attributes']=_0x2fd2a7[_0x3b4d('0x39')][_0x3b4d('0x3b')]?_0x2fd2a7[_0x3b4d('0x39')]:_0x5d818a[_0x3b4d('0x35')];if(!_0x3a6dfd[_0x3b4d('0x36')][_0x3b4d('0x3c')](_0x3b4d('0x3d'))){_0x2fd2a7[_0x3b4d('0x1f')]=qs[_0x3b4d('0x1f')](_0x3a6dfd[_0x3b4d('0x36')]['limit']);_0x2fd2a7[_0x3b4d('0x1e')]=qs['offset'](_0x3a6dfd['query'][_0x3b4d('0x1e')]);}_0x2fd2a7[_0x3b4d('0x3e')]=qs[_0x3b4d('0x3f')](_0x3a6dfd[_0x3b4d('0x36')]['sort']);_0x2fd2a7['where']=qs[_0x3b4d('0x41')](_[_0x3b4d('0x42')](_0x3a6dfd['query'],_0x5d818a[_0x3b4d('0x41')]));_0x2fd2a7[_0x3b4d('0x40')][_0x3b4d('0x5a')]=_0x2d2b04['id'];if(_0x3a6dfd[_0x3b4d('0x36')][_0x3b4d('0x43')]){_0x2fd2a7[_0x3b4d('0x40')]=_[_0x3b4d('0x44')](_0x2fd2a7[_0x3b4d('0x40')],{'$or':_[_0x3b4d('0x2f')](_0x2fd2a7['attributes'],function(_0x1a8566){var _0x67bda={};_0x67bda[_0x1a8566]={'$like':'%'+_0x3a6dfd[_0x3b4d('0x36')]['filter']+'%'};return _0x67bda;})});}_0x2fd2a7=_[_0x3b4d('0x44')]({},_0x2fd2a7,_0x3a6dfd[_0x3b4d('0x4c')]);return db['UserOpenchannelQueue'][_0x3b4d('0x5b')](_0x2fd2a7);}})[_0x3b4d('0x29')](function(_0x134ca9){if(_0x134ca9){return db[_0x3b4d('0x5c')]['findAndCountAll']({'where':{'id':_[_0x3b4d('0x2f')](_0x134ca9,_0x3b4d('0x5d')),'role':_0x3b4d('0x5e')},'attributes':['id',_0x3b4d('0x2c'),'openchannelPause','updatedAt','createdAt']});}})[_0x3b4d('0x29')](function(_0x1ccee4){if(_0x1ccee4){return{'count':_0x1ccee4[_0x3b4d('0x20')],'rows':_[_0x3b4d('0x2f')](_0x1ccee4['rows'],function(_0x36d02d){return{'membername':_0x36d02d['name'],'UserId':_0x36d02d['id'],'queue_name':_0x176278['name'],'OpenchannelQueueId':_0x176278['id'],'interface':util[_0x3b4d('0x5f')]('%s/%s',_0x3b4d('0x60'),_0x36d02d[_0x3b4d('0x2c')]),'penalty':0x0,'paused':_0x36d02d['openchannelPause'],'createdAt':_0x36d02d[_0x3b4d('0x61')],'updatedAt':_0x36d02d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b4d('0x29')](respondWithFilteredResult(_0x2a3f79,_0x2fd2a7))[_0x3b4d('0x49')](handleError(_0x2a3f79,null));};exports[_0x3b4d('0x62')]=function(_0x207f7b,_0x11e798,_0x28245c){var _0x36b071={};var _0x14adec={};var _0x1aa674;var _0x356e73;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x207f7b[_0x3b4d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11e798,null))[_0x3b4d('0x29')](function(_0x3a6e15){if(_0x3a6e15){_0x1aa674=_0x3a6e15;_0x14adec['model']=_[_0x3b4d('0x37')](db['Team'][_0x3b4d('0x31')]);_0x14adec[_0x3b4d('0x36')]=_[_0x3b4d('0x37')](_0x207f7b[_0x3b4d('0x36')]);_0x14adec[_0x3b4d('0x41')]=_[_0x3b4d('0x38')](_0x14adec[_0x3b4d('0x35')],_0x14adec['query']);_0x36b071[_0x3b4d('0x39')]=_['intersection'](_0x14adec[_0x3b4d('0x35')],qs[_0x3b4d('0x3a')](_0x207f7b[_0x3b4d('0x36')][_0x3b4d('0x3a')]));_0x36b071[_0x3b4d('0x39')]=_0x36b071[_0x3b4d('0x39')][_0x3b4d('0x3b')]?_0x36b071[_0x3b4d('0x39')]:_0x14adec[_0x3b4d('0x35')];_0x36b071[_0x3b4d('0x3e')]=qs[_0x3b4d('0x3f')](_0x207f7b['query']['sort']);_0x36b071[_0x3b4d('0x40')]=qs[_0x3b4d('0x41')](_[_0x3b4d('0x42')](_0x207f7b[_0x3b4d('0x36')],_0x14adec[_0x3b4d('0x41')]));if(_0x207f7b[_0x3b4d('0x36')][_0x3b4d('0x43')]){_0x36b071[_0x3b4d('0x40')]=_[_0x3b4d('0x44')](_0x36b071[_0x3b4d('0x40')],{'$or':_[_0x3b4d('0x2f')](_0x36b071[_0x3b4d('0x39')],function(_0x201f58){var _0x38c533={};_0x38c533[_0x201f58]={'$like':'%'+_0x207f7b[_0x3b4d('0x36')][_0x3b4d('0x43')]+'%'};return _0x38c533;})});}_0x36b071=_['merge']({},_0x36b071,_0x207f7b[_0x3b4d('0x4c')]);return _0x1aa674[_0x3b4d('0x62')](_0x36b071);}})[_0x3b4d('0x29')](function(_0x12b597){if(_0x12b597){_0x356e73=_0x12b597['length'];if(!_0x207f7b[_0x3b4d('0x36')][_0x3b4d('0x3c')](_0x3b4d('0x3d'))){_0x36b071['limit']=qs[_0x3b4d('0x1f')](_0x207f7b[_0x3b4d('0x36')]['limit']);_0x36b071[_0x3b4d('0x1e')]=qs[_0x3b4d('0x1e')](_0x207f7b[_0x3b4d('0x36')][_0x3b4d('0x1e')]);}return _0x1aa674[_0x3b4d('0x62')](_0x36b071);}})[_0x3b4d('0x29')](function(_0x3f482e){if(_0x3f482e){return _0x3f482e?{'count':_0x356e73,'rows':_0x3f482e}:null;}})['then'](respondWithResult(_0x11e798,null))[_0x3b4d('0x49')](handleError(_0x11e798,null));};exports[_0x3b4d('0x63')]=function(_0x4847e1,_0x1a1173,_0x5c8243){var _0x4f012e=_0x4847e1['body'][_0x3b4d('0x64')];return db[_0x3b4d('0x65')][_0x3b4d('0x5b')]({'where':{'id':_0x4f012e},'attributes':['id'],'include':[{'model':db[_0x3b4d('0x5c')],'as':_0x3b4d('0x66'),'attributes':['id',_0x3b4d('0x2c'),_0x3b4d('0x67'),_0x3b4d('0x68'),_0x3b4d('0x69')],'raw':!![]}]})['then'](function(_0x30a697){if(_0x30a697){var _0x151aae=_[_0x3b4d('0x6a')](_0x30a697,function(_0x1a369e){var _0x22acb4=_0x1a369e[_0x3b4d('0x27')]({'plain':!![]});return _0x22acb4[_0x3b4d('0x66')];});return db[_0x3b4d('0x30')][_0x3b4d('0x4d')]({'where':{'id':_0x4847e1['params']['id']}})[_0x3b4d('0x29')](function(_0x40d033){return db['sequelize'][_0x3b4d('0x6b')](function(_0x358923){return _0x40d033['addTeams'](_0x4f012e,{'transaction':_0x358923})[_0x3b4d('0x29')](function(){return BPromise[_0x3b4d('0x6c')](_0x151aae,function(_0x419e57){return db[_0x3b4d('0x59')]['findOrCreate']({'where':{'UserId':_0x419e57['id'],'OpenchannelQueueId':_0x4847e1[_0x3b4d('0x4b')]['id']},'transaction':_0x358923});});})[_0x3b4d('0x29')](function(){_0x151aae[_0x3b4d('0x6d')](function(_0x3a4f30){socket[_0x3b4d('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x3a4f30['id'],'OpenchannelQueueId':_0x40d033['id']});});});});});}})['then'](respondWithStatusCode(_0x1a1173,null))[_0x3b4d('0x49')](handleError(_0x1a1173,null));};exports[_0x3b4d('0x6f')]=function(_0x315b75,_0x2f955a,_0x32bc1e){return db[_0x3b4d('0x65')]['findAll']({'where':{'id':_0x315b75[_0x3b4d('0x36')][_0x3b4d('0x64')]},'attributes':['id'],'include':[{'model':db[_0x3b4d('0x5c')],'as':_0x3b4d('0x66'),'attributes':['id'],'raw':!![]}]})[_0x3b4d('0x29')](handleEntityNotFound(_0x2f955a,null))['then'](function(_0x39bbf0){var _0x56d329=_[_0x3b4d('0x2f')](_0x39bbf0,'id');var _0x3d29bf=[];var _0x3a7afa=[];var _0x47fdf4=squel[_0x3b4d('0x70')]();_0x47fdf4['field']('tq.TeamId')[_0x3b4d('0x71')](_0x3b4d('0x72'),'tq')[_0x3b4d('0x73')]('user_has_teams','ut',_0x3b4d('0x74'))[_0x3b4d('0x40')](_0x3b4d('0x75'),_0x315b75[_0x3b4d('0x4b')]['id']);for(var _0x3710a1=0x0;_0x3710a1<_0x39bbf0[_0x3b4d('0x3b')];_0x3710a1+=0x1){let _0x31179b=_0x39bbf0[_0x3710a1];for(var _0x3ec52a=0x0;_0x3ec52a<_0x31179b[_0x3b4d('0x66')]['length'];_0x3ec52a+=0x1){let _0x2da298=_0x31179b[_0x3b4d('0x66')][_0x3ec52a];var _0x308b83=_0x47fdf4[_0x3b4d('0x76')]();_0x308b83['where']('ut.UserId\x20=\x20?',_0x2da298['id']);_0x3a7afa[_0x3b4d('0x77')](db[_0x3b4d('0x78')]['query'](_0x308b83['toString'](),{'type':db[_0x3b4d('0x78')][_0x3b4d('0x79')]['SELECT']})[_0x3b4d('0x29')](function(_0x581dde){if(_0x581dde[_0x3b4d('0x3b')]===0x1){return _0x2da298['id'];}else{var _0x5af189=_[_0x3b4d('0x7a')](_[_0x3b4d('0x2f')](_0x581dde,_0x3b4d('0x7b')),function(_0x476070){return _[_0x3b4d('0x7c')](_0x56d329,_0x476070);});if(_0x5af189){return _0x2da298['id'];}}}));}}return BPromise[_0x3b4d('0x7d')](_0x3a7afa)[_0x3b4d('0x29')](function(_0xc7e6cb){_0x3d29bf=_(_0x3d29bf)[_0x3b4d('0x7e')](_0xc7e6cb)[_0x3b4d('0x7f')]()['value']();return db['OpenchannelQueue'][_0x3b4d('0x4d')]({'where':{'id':_0x315b75[_0x3b4d('0x4b')]['id']}})[_0x3b4d('0x29')](function(_0x108b5f){return db[_0x3b4d('0x78')][_0x3b4d('0x6b')](function(_0x1428f1){return _0x108b5f[_0x3b4d('0x6f')](_0x315b75['query'][_0x3b4d('0x64')],{'transaction':_0x1428f1})[_0x3b4d('0x29')](function(){if(!_[_0x3b4d('0x80')](_0x3d29bf)){return _0x108b5f[_0x3b4d('0x81')](_0x3d29bf,{'transaction':_0x1428f1});}})[_0x3b4d('0x29')](function(){_0x3d29bf[_0x3b4d('0x6d')](function(_0xd17490){socket['emit'](_0x3b4d('0x82'),{'UserId':_0xd17490,'OpenchannelQueueId':_0x108b5f['id']});});});});});});})[_0x3b4d('0x29')](respondWithStatusCode(_0x2f955a,null))[_0x3b4d('0x49')](handleError(_0x2f955a,null));};exports[_0x3b4d('0x83')]=function(_0xae8045,_0x57764a,_0x1a3067){return db[_0x3b4d('0x30')][_0x3b4d('0x4d')]({'where':{'id':_0xae8045[_0x3b4d('0x4b')]['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x57764a,null))['then'](function(_0x183aa0){if(_0x183aa0){return _0x183aa0[_0x3b4d('0x83')](_0xae8045['body']['ids'],_[_0x3b4d('0x84')](_0xae8045[_0x3b4d('0x55')],[_0x3b4d('0x64'),'id'])||{})[_0x3b4d('0x85')](function(_0x1860fe){for(var _0x5879ff=0x0;_0x5879ff<_0xae8045['body'][_0x3b4d('0x64')]['length'];_0x5879ff+=0x1){socket['emit'](_0x3b4d('0x86'),{'UserId':Number(_0xae8045[_0x3b4d('0x55')][_0x3b4d('0x64')][_0x5879ff]),'OpenchannelQueueId':Number(_0xae8045[_0x3b4d('0x4b')]['id'])});}return _0x1860fe;});}})[_0x3b4d('0x29')](respondWithResult(_0x57764a,null))[_0x3b4d('0x49')](handleError(_0x57764a,null));};exports[_0x3b4d('0x81')]=function(_0x53b955,_0x186309,_0xdf69a7){return db[_0x3b4d('0x30')][_0x3b4d('0x4d')]({'where':{'id':_0x53b955['params']['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x186309,null))[_0x3b4d('0x29')](function(_0x54e750){if(_0x54e750){return _0x54e750[_0x3b4d('0x81')](_0x53b955[_0x3b4d('0x36')][_0x3b4d('0x64')])[_0x3b4d('0x29')](function(){if(_[_0x3b4d('0x87')](_0x53b955[_0x3b4d('0x36')]['ids'])){for(var _0x100121=0x0;_0x100121<_0x53b955[_0x3b4d('0x36')][_0x3b4d('0x64')]['length'];_0x100121+=0x1){socket[_0x3b4d('0x6e')](_0x3b4d('0x82'),{'UserId':Number(_0x53b955[_0x3b4d('0x36')][_0x3b4d('0x64')][_0x100121]),'OpenchannelQueueId':Number(_0x53b955[_0x3b4d('0x4b')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x53b955[_0x3b4d('0x36')][_0x3b4d('0x64')]),'OpenchannelQueueId':Number(_0x53b955['params']['id'])});}});}})[_0x3b4d('0x29')](respondWithStatusCode(_0x186309,null))[_0x3b4d('0x49')](handleError(_0x186309,null));};exports[_0x3b4d('0x88')]=function(_0x5bf42a,_0x290b6b,_0x7bc0ae){var _0x4c99e7={};var _0x313030={};var _0x43f4ec;var _0x43621c;return db['OpenchannelQueue'][_0x3b4d('0x58')]({'where':{'id':_0x5bf42a[_0x3b4d('0x4b')]['id']}})[_0x3b4d('0x29')](handleEntityNotFound(_0x290b6b,null))[_0x3b4d('0x29')](function(_0x607878){if(_0x607878){_0x43f4ec=_0x607878;_0x313030[_0x3b4d('0x35')]=_['keys'](db[_0x3b4d('0x5c')][_0x3b4d('0x31')]);_0x313030[_0x3b4d('0x36')]=_['keys'](_0x5bf42a[_0x3b4d('0x36')]);_0x313030[_0x3b4d('0x41')]=_[_0x3b4d('0x38')](_0x313030[_0x3b4d('0x35')],_0x313030[_0x3b4d('0x36')]);_0x4c99e7[_0x3b4d('0x39')]=_['intersection'](_0x313030[_0x3b4d('0x35')],qs[_0x3b4d('0x3a')](_0x5bf42a['query'][_0x3b4d('0x3a')]));_0x4c99e7['attributes']=_0x4c99e7[_0x3b4d('0x39')][_0x3b4d('0x3b')]?_0x4c99e7[_0x3b4d('0x39')]:_0x313030[_0x3b4d('0x35')];_0x4c99e7[_0x3b4d('0x3e')]=qs[_0x3b4d('0x3f')](_0x5bf42a[_0x3b4d('0x36')][_0x3b4d('0x3f')]);_0x4c99e7[_0x3b4d('0x40')]=qs[_0x3b4d('0x41')](_[_0x3b4d('0x42')](_0x5bf42a[_0x3b4d('0x36')],_0x313030[_0x3b4d('0x41')]));if(_0x5bf42a['query'][_0x3b4d('0x43')]){_0x4c99e7[_0x3b4d('0x40')]=_[_0x3b4d('0x44')](_0x4c99e7[_0x3b4d('0x40')],{'$or':_[_0x3b4d('0x2f')](_0x4c99e7['attributes'],function(_0x310a1e){var _0x158632={};_0x158632[_0x310a1e]={'$like':'%'+_0x5bf42a[_0x3b4d('0x36')][_0x3b4d('0x43')]+'%'};return _0x158632;})});}_0x4c99e7=_[_0x3b4d('0x44')]({},_0x4c99e7,_0x5bf42a[_0x3b4d('0x4c')]);return _0x43f4ec[_0x3b4d('0x88')](_0x4c99e7);}})[_0x3b4d('0x29')](function(_0x20c8d7){if(_0x20c8d7){_0x43621c=_0x20c8d7[_0x3b4d('0x3b')];if(!_0x5bf42a[_0x3b4d('0x36')][_0x3b4d('0x3c')](_0x3b4d('0x3d'))){_0x4c99e7[_0x3b4d('0x1f')]=qs[_0x3b4d('0x1f')](_0x5bf42a[_0x3b4d('0x36')][_0x3b4d('0x1f')]);_0x4c99e7['offset']=qs[_0x3b4d('0x1e')](_0x5bf42a[_0x3b4d('0x36')][_0x3b4d('0x1e')]);}return _0x43f4ec[_0x3b4d('0x88')](_0x4c99e7);}})['then'](function(_0x28376a){if(_0x28376a){return _0x28376a?{'count':_0x43621c,'rows':_0x28376a}:null;}})[_0x3b4d('0x29')](respondWithResult(_0x290b6b,null))[_0x3b4d('0x49')](handleError(_0x290b6b,null));}; \ No newline at end of file +var _0x6460=['limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','SIP','openchannelPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset'];(function(_0x50eea5,_0x4378af){var _0x3f94a6=function(_0x27d72c){while(--_0x27d72c){_0x50eea5['push'](_0x50eea5['shift']());}};_0x3f94a6(++_0x4378af);}(_0x6460,0x17f));var _0x0646=function(_0x2ba310,_0x5320cb){_0x2ba310=_0x2ba310-0x0;var _0x478aa1=_0x6460[_0x2ba310];return _0x478aa1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0646('0x0'));var jsonpatch=require(_0x0646('0x1'));var rp=require(_0x0646('0x2'));var moment=require(_0x0646('0x3'));var BPromise=require(_0x0646('0x4'));var Mustache=require(_0x0646('0x5'));var util=require('util');var path=require(_0x0646('0x6'));var sox=require(_0x0646('0x7'));var csv=require(_0x0646('0x8'));var ejs=require(_0x0646('0x9'));var fs=require('fs');var fs_extra=require(_0x0646('0xa'));var _=require(_0x0646('0xb'));var squel=require(_0x0646('0xc'));var crypto=require(_0x0646('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0646('0xe'));var toCsv=require(_0x0646('0x8'));var querystring=require('querystring');var Papa=require(_0x0646('0xf'));var Redis=require('ioredis');var authService=require(_0x0646('0x10'));var qs=require(_0x0646('0x11'));var as=require(_0x0646('0x12'));var hardwareService=require(_0x0646('0x13'));var logger=require('../../config/logger')(_0x0646('0x14'));var utils=require('../../config/utils');var config=require(_0x0646('0x15'));var licenseUtil=require(_0x0646('0x16'));var db=require(_0x0646('0x17'))['db'];config[_0x0646('0x18')]=_[_0x0646('0x19')](config[_0x0646('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x28fe2e,_0x382ce7){_0x382ce7=_0x382ce7||0xcc;return function(_0xb261d){if(_0xb261d){return _0x28fe2e[_0x0646('0x1a')](_0x382ce7);}return _0x28fe2e[_0x0646('0x1b')](_0x382ce7)[_0x0646('0x1c')]();};}function respondWithResult(_0x3f5706,_0x42ad5b){_0x42ad5b=_0x42ad5b||0xc8;return function(_0x2d01b3){if(_0x2d01b3){return _0x3f5706['status'](_0x42ad5b)[_0x0646('0x1d')](_0x2d01b3);}};}function respondWithFilteredResult(_0x39853e,_0x43b325){return function(_0x1d4e0b){if(_0x1d4e0b){var _0x141d10=typeof _0x43b325[_0x0646('0x1e')]==='undefined'&&typeof _0x43b325[_0x0646('0x1f')]===_0x0646('0x20');var _0x176732=_0x1d4e0b[_0x0646('0x21')];var _0x50e8dd=_0x141d10?0x0:_0x43b325['offset'];var _0x2e3105=_0x141d10?_0x1d4e0b[_0x0646('0x21')]:_0x43b325[_0x0646('0x1e')]+_0x43b325[_0x0646('0x1f')];var _0x46bdf7;if(_0x2e3105>=_0x176732){_0x2e3105=_0x176732;_0x46bdf7=0xc8;}else{_0x46bdf7=0xce;}_0x39853e[_0x0646('0x1b')](_0x46bdf7);return _0x39853e['set'](_0x0646('0x22'),_0x50e8dd+'-'+_0x2e3105+'/'+_0x176732)[_0x0646('0x1d')](_0x1d4e0b);}return null;};}function patchUpdates(_0x516133){return function(_0x103127){try{jsonpatch[_0x0646('0x23')](_0x103127,_0x516133,!![]);}catch(_0x3e6409){return BPromise[_0x0646('0x24')](_0x3e6409);}return _0x103127[_0x0646('0x25')]();};}function saveUpdates(_0x5a04bc,_0x4f4457){return function(_0xb069c4){if(_0xb069c4){return _0xb069c4[_0x0646('0x26')](_0x5a04bc)[_0x0646('0x27')](function(_0x44f090){return _0x44f090;});}return null;};}function removeEntity(_0x1ad305,_0x4ac349){return function(_0x5ede5f){if(_0x5ede5f){return _0x5ede5f[_0x0646('0x28')]()[_0x0646('0x27')](function(){var _0x406c4b=_0x5ede5f['get']({'plain':!![]});var _0x281df5=_0x0646('0x29');return db[_0x0646('0x2a')][_0x0646('0x28')]({'where':{'type':_0x281df5,'resourceId':_0x406c4b['id']}})[_0x0646('0x27')](function(){return _0x5ede5f;});})[_0x0646('0x27')](function(){_0x1ad305[_0x0646('0x1b')](0xcc)[_0x0646('0x1c')]();});}};}function handleEntityNotFound(_0x32bc48,_0x2a40fd){return function(_0x2f5201){if(!_0x2f5201){_0x32bc48['sendStatus'](0x194);}return _0x2f5201;};}function handleError(_0x2d1a6b,_0x1736c9){_0x1736c9=_0x1736c9||0x1f4;return function(_0x17846e){logger[_0x0646('0x2b')](_0x17846e[_0x0646('0x2c')]);if(_0x17846e[_0x0646('0x2d')]){delete _0x17846e[_0x0646('0x2d')];}_0x2d1a6b['status'](_0x1736c9)[_0x0646('0x2e')](_0x17846e);};}exports['index']=function(_0x2c3fa3,_0x21b121){var _0x13de93={},_0x459bae={},_0x58cb35={'count':0x0,'rows':[]};var _0x5a98c4=_['map'](db[_0x0646('0x2f')][_0x0646('0x30')],function(_0x5a8235){return{'name':_0x5a8235['fieldName'],'type':_0x5a8235[_0x0646('0x31')][_0x0646('0x32')]};});_0x459bae[_0x0646('0x33')]=_['map'](_0x5a98c4,'name');_0x459bae[_0x0646('0x34')]=_[_0x0646('0x35')](_0x2c3fa3[_0x0646('0x34')]);_0x459bae[_0x0646('0x36')]=_[_0x0646('0x37')](_0x459bae[_0x0646('0x33')],_0x459bae['query']);_0x13de93[_0x0646('0x38')]=_[_0x0646('0x37')](_0x459bae[_0x0646('0x33')],qs[_0x0646('0x39')](_0x2c3fa3[_0x0646('0x34')][_0x0646('0x39')]));_0x13de93[_0x0646('0x38')]=_0x13de93[_0x0646('0x38')]['length']?_0x13de93[_0x0646('0x38')]:_0x459bae[_0x0646('0x33')];if(!_0x2c3fa3[_0x0646('0x34')]['hasOwnProperty'](_0x0646('0x3a'))){_0x13de93[_0x0646('0x1f')]=qs[_0x0646('0x1f')](_0x2c3fa3[_0x0646('0x34')]['limit']);_0x13de93[_0x0646('0x1e')]=qs[_0x0646('0x1e')](_0x2c3fa3[_0x0646('0x34')][_0x0646('0x1e')]);}_0x13de93[_0x0646('0x3b')]=qs[_0x0646('0x3c')](_0x2c3fa3[_0x0646('0x34')][_0x0646('0x3c')]);_0x13de93['where']=qs[_0x0646('0x36')](_[_0x0646('0x3d')](_0x2c3fa3[_0x0646('0x34')],_0x459bae[_0x0646('0x36')]),_0x5a98c4);if(_0x2c3fa3['query'][_0x0646('0x3e')]){_0x13de93[_0x0646('0x3f')]=_[_0x0646('0x40')](_0x13de93[_0x0646('0x3f')],{'$or':_[_0x0646('0x41')](_0x5a98c4,function(_0x26280b){if(_0x26280b[_0x0646('0x31')]!==_0x0646('0x42')){var _0x4a1ac9={};_0x4a1ac9[_0x26280b[_0x0646('0x2d')]]={'$like':'%'+_0x2c3fa3[_0x0646('0x34')]['filter']+'%'};return _0x4a1ac9;}})});}_0x13de93=_[_0x0646('0x40')]({},_0x13de93,_0x2c3fa3[_0x0646('0x43')]);var _0x2158df={'where':_0x13de93[_0x0646('0x3f')]};return db[_0x0646('0x2f')][_0x0646('0x21')](_0x2158df)[_0x0646('0x27')](function(_0x8a0977){_0x58cb35[_0x0646('0x21')]=_0x8a0977;if(_0x2c3fa3[_0x0646('0x34')][_0x0646('0x44')]){_0x13de93[_0x0646('0x45')]=[{'all':!![]}];}return db[_0x0646('0x2f')][_0x0646('0x46')](_0x13de93);})['then'](function(_0x41b03a){_0x58cb35['rows']=_0x41b03a;return _0x58cb35;})[_0x0646('0x27')](respondWithFilteredResult(_0x21b121,_0x13de93))[_0x0646('0x47')](handleError(_0x21b121,null));};exports[_0x0646('0x48')]=function(_0x5129d6,_0x145709){var _0x21a3d={'raw':!![],'where':{'id':_0x5129d6[_0x0646('0x49')]['id']}},_0x18a66d={};_0x18a66d[_0x0646('0x33')]=_[_0x0646('0x35')](db[_0x0646('0x2f')][_0x0646('0x30')]);_0x18a66d[_0x0646('0x34')]=_[_0x0646('0x35')](_0x5129d6[_0x0646('0x34')]);_0x18a66d[_0x0646('0x36')]=_[_0x0646('0x37')](_0x18a66d[_0x0646('0x33')],_0x18a66d[_0x0646('0x34')]);_0x21a3d[_0x0646('0x38')]=_[_0x0646('0x37')](_0x18a66d[_0x0646('0x33')],qs[_0x0646('0x39')](_0x5129d6['query'][_0x0646('0x39')]));_0x21a3d[_0x0646('0x38')]=_0x21a3d[_0x0646('0x38')][_0x0646('0x4a')]?_0x21a3d['attributes']:_0x18a66d[_0x0646('0x33')];if(_0x5129d6[_0x0646('0x34')]['includeAll']){_0x21a3d[_0x0646('0x45')]=[{'all':!![]}];}_0x21a3d=_[_0x0646('0x40')]({},_0x21a3d,_0x5129d6[_0x0646('0x43')]);return db['OpenchannelQueue']['find'](_0x21a3d)['then'](handleEntityNotFound(_0x145709,null))['then'](respondWithResult(_0x145709,null))[_0x0646('0x47')](handleError(_0x145709,null));};exports[_0x0646('0x4b')]=function(_0x18f1d3,_0x4249d7){return db[_0x0646('0x2f')][_0x0646('0x4b')](_0x18f1d3['body'],{})[_0x0646('0x27')](function(_0x3eb341){var _0x5081eb=_0x18f1d3[_0x0646('0x4c')][_0x0646('0x4d')]({'plain':!![]});if(!_0x5081eb)throw new Error(_0x0646('0x4e'));if(_0x5081eb['role']==='user'){var _0x5def75=_0x3eb341[_0x0646('0x4d')]({'plain':!![]});var _0x1e644c=_0x0646('0x29');return db['UserProfileSection'][_0x0646('0x4f')]({'where':{'name':_0x1e644c,'userProfileId':_0x5081eb[_0x0646('0x50')]},'raw':!![]})[_0x0646('0x27')](function(_0x2779ab){if(_0x2779ab&&_0x2779ab[_0x0646('0x51')]===0x0){return db[_0x0646('0x2a')][_0x0646('0x4b')]({'name':_0x5def75[_0x0646('0x2d')],'resourceId':_0x5def75['id'],'type':_0x2779ab[_0x0646('0x2d')],'sectionId':_0x2779ab['id']},{})[_0x0646('0x27')](function(){return _0x3eb341;});}else{return _0x3eb341;}})[_0x0646('0x47')](function(_0x47d988){logger[_0x0646('0x2b')](_0x0646('0x52'),_0x47d988);throw _0x47d988;});}return _0x3eb341;})[_0x0646('0x27')](respondWithResult(_0x4249d7,0xc9))[_0x0646('0x47')](handleError(_0x4249d7,null));};exports[_0x0646('0x26')]=function(_0x4ecd77,_0x4d0840){if(_0x4ecd77['body']['id']){delete _0x4ecd77[_0x0646('0x53')]['id'];}return db[_0x0646('0x2f')][_0x0646('0x4f')]({'where':{'id':_0x4ecd77[_0x0646('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d0840,null))[_0x0646('0x27')](saveUpdates(_0x4ecd77[_0x0646('0x53')],null))[_0x0646('0x27')](respondWithResult(_0x4d0840,null))['catch'](handleError(_0x4d0840,null));};exports[_0x0646('0x28')]=function(_0x182765,_0x335fb2){return db[_0x0646('0x2f')]['find']({'where':{'id':_0x182765[_0x0646('0x49')]['id']}})[_0x0646('0x27')](handleEntityNotFound(_0x335fb2,null))['then'](removeEntity(_0x335fb2,null))[_0x0646('0x47')](handleError(_0x335fb2,null));};exports[_0x0646('0x54')]=function(_0x22692f,_0x535c77){return db[_0x0646('0x2f')][_0x0646('0x54')]()[_0x0646('0x27')](respondWithResult(_0x535c77,null))['catch'](handleError(_0x535c77,null));};exports[_0x0646('0x55')]=function(_0x58627b,_0x21e4a8,_0x147192){var _0x6936d8={'raw':!![],'where':{}},_0x4df269={},_0x3ec89e;return db['OpenchannelQueue'][_0x0646('0x56')]({'where':{'id':_0x58627b[_0x0646('0x49')]['id']}})[_0x0646('0x27')](handleEntityNotFound(_0x21e4a8,null))[_0x0646('0x27')](function(_0x285bcd){if(_0x285bcd){_0x3ec89e=_0x285bcd['get']({'plain':!![]});_0x4df269[_0x0646('0x33')]=_[_0x0646('0x35')](db[_0x0646('0x57')][_0x0646('0x30')]);_0x4df269[_0x0646('0x34')]=_['keys'](_0x58627b[_0x0646('0x34')]);_0x4df269[_0x0646('0x36')]=_['intersection'](_0x4df269[_0x0646('0x33')],_0x4df269[_0x0646('0x34')]);_0x6936d8[_0x0646('0x38')]=_[_0x0646('0x37')](_0x4df269['model'],qs[_0x0646('0x39')](_0x58627b['query']['fields']));_0x6936d8[_0x0646('0x38')]=_0x6936d8[_0x0646('0x38')][_0x0646('0x4a')]?_0x6936d8[_0x0646('0x38')]:_0x4df269[_0x0646('0x33')];if(!_0x58627b[_0x0646('0x34')][_0x0646('0x58')](_0x0646('0x3a'))){_0x6936d8[_0x0646('0x1f')]=qs[_0x0646('0x1f')](_0x58627b['query'][_0x0646('0x1f')]);_0x6936d8['offset']=qs['offset'](_0x58627b[_0x0646('0x34')][_0x0646('0x1e')]);}_0x6936d8['order']=qs[_0x0646('0x3c')](_0x58627b['query'][_0x0646('0x3c')]);_0x6936d8[_0x0646('0x3f')]=qs[_0x0646('0x36')](_[_0x0646('0x3d')](_0x58627b[_0x0646('0x34')],_0x4df269[_0x0646('0x36')]));_0x6936d8[_0x0646('0x3f')]['OpenchannelQueueId']=_0x285bcd['id'];if(_0x58627b[_0x0646('0x34')][_0x0646('0x3e')]){_0x6936d8[_0x0646('0x3f')]=_['merge'](_0x6936d8[_0x0646('0x3f')],{'$or':_[_0x0646('0x41')](_0x6936d8['attributes'],function(_0xdd6c6f){var _0x52f45b={};_0x52f45b[_0xdd6c6f]={'$like':'%'+_0x58627b[_0x0646('0x34')][_0x0646('0x3e')]+'%'};return _0x52f45b;})});}_0x6936d8=_[_0x0646('0x40')]({},_0x6936d8,_0x58627b[_0x0646('0x43')]);return db[_0x0646('0x57')][_0x0646('0x46')](_0x6936d8);}})[_0x0646('0x27')](function(_0x2a5558){if(_0x2a5558){return db[_0x0646('0x59')][_0x0646('0x5a')]({'where':{'id':_[_0x0646('0x41')](_0x2a5558,_0x0646('0x5b')),'role':_0x0646('0x5c')},'attributes':['id',_0x0646('0x2d'),'openchannelPause',_0x0646('0x5d'),_0x0646('0x5e')]});}})[_0x0646('0x27')](function(_0x14fc3c){if(_0x14fc3c){return{'count':_0x14fc3c[_0x0646('0x21')],'rows':_[_0x0646('0x41')](_0x14fc3c[_0x0646('0x5f')],function(_0x287b77){return{'membername':_0x287b77[_0x0646('0x2d')],'UserId':_0x287b77['id'],'queue_name':_0x3ec89e[_0x0646('0x2d')],'OpenchannelQueueId':_0x3ec89e['id'],'interface':util['format']('%s/%s',_0x0646('0x60'),_0x287b77[_0x0646('0x2d')]),'penalty':0x0,'paused':_0x287b77[_0x0646('0x61')],'createdAt':_0x287b77[_0x0646('0x5e')],'updatedAt':_0x287b77[_0x0646('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0646('0x27')](respondWithFilteredResult(_0x21e4a8,_0x6936d8))[_0x0646('0x47')](handleError(_0x21e4a8,null));};exports[_0x0646('0x62')]=function(_0x2518e9,_0x7a86ac,_0x33bc6e){var _0x162133={};var _0x25243d={};var _0xbe12ee;var _0x323c4a;return db[_0x0646('0x2f')][_0x0646('0x56')]({'where':{'id':_0x2518e9['params']['id']}})[_0x0646('0x27')](handleEntityNotFound(_0x7a86ac,null))[_0x0646('0x27')](function(_0x52731b){if(_0x52731b){_0xbe12ee=_0x52731b;_0x25243d[_0x0646('0x33')]=_[_0x0646('0x35')](db[_0x0646('0x63')][_0x0646('0x30')]);_0x25243d[_0x0646('0x34')]=_['keys'](_0x2518e9[_0x0646('0x34')]);_0x25243d['filters']=_[_0x0646('0x37')](_0x25243d[_0x0646('0x33')],_0x25243d['query']);_0x162133[_0x0646('0x38')]=_[_0x0646('0x37')](_0x25243d[_0x0646('0x33')],qs[_0x0646('0x39')](_0x2518e9[_0x0646('0x34')][_0x0646('0x39')]));_0x162133[_0x0646('0x38')]=_0x162133[_0x0646('0x38')][_0x0646('0x4a')]?_0x162133[_0x0646('0x38')]:_0x25243d['model'];_0x162133[_0x0646('0x3b')]=qs['sort'](_0x2518e9[_0x0646('0x34')][_0x0646('0x3c')]);_0x162133['where']=qs['filters'](_[_0x0646('0x3d')](_0x2518e9[_0x0646('0x34')],_0x25243d[_0x0646('0x36')]));if(_0x2518e9[_0x0646('0x34')][_0x0646('0x3e')]){_0x162133['where']=_[_0x0646('0x40')](_0x162133[_0x0646('0x3f')],{'$or':_[_0x0646('0x41')](_0x162133['attributes'],function(_0x594c8c){var _0x3ea6a7={};_0x3ea6a7[_0x594c8c]={'$like':'%'+_0x2518e9[_0x0646('0x34')]['filter']+'%'};return _0x3ea6a7;})});}_0x162133=_[_0x0646('0x40')]({},_0x162133,_0x2518e9[_0x0646('0x43')]);return _0xbe12ee[_0x0646('0x62')](_0x162133);}})['then'](function(_0x220cb2){if(_0x220cb2){_0x323c4a=_0x220cb2[_0x0646('0x4a')];if(!_0x2518e9['query']['hasOwnProperty']('nolimit')){_0x162133[_0x0646('0x1f')]=qs['limit'](_0x2518e9[_0x0646('0x34')][_0x0646('0x1f')]);_0x162133[_0x0646('0x1e')]=qs[_0x0646('0x1e')](_0x2518e9[_0x0646('0x34')]['offset']);}return _0xbe12ee[_0x0646('0x62')](_0x162133);}})[_0x0646('0x27')](function(_0x424c27){if(_0x424c27){return _0x424c27?{'count':_0x323c4a,'rows':_0x424c27}:null;}})['then'](respondWithResult(_0x7a86ac,null))['catch'](handleError(_0x7a86ac,null));};exports[_0x0646('0x64')]=function(_0xfeb93c,_0x105276,_0x2f89d1){var _0x2c3e36=_0xfeb93c[_0x0646('0x53')][_0x0646('0x65')];return db[_0x0646('0x63')][_0x0646('0x46')]({'where':{'id':_0x2c3e36},'attributes':['id'],'include':[{'model':db[_0x0646('0x59')],'as':_0x0646('0x66'),'attributes':['id',_0x0646('0x2d'),'online',_0x0646('0x67'),_0x0646('0x68')],'raw':!![]}]})[_0x0646('0x27')](function(_0x4321d6){if(_0x4321d6){var _0x13577c=_[_0x0646('0x69')](_0x4321d6,function(_0x543e7e){var _0xa4914=_0x543e7e['get']({'plain':!![]});return _0xa4914[_0x0646('0x66')];});return db[_0x0646('0x2f')][_0x0646('0x4f')]({'where':{'id':_0xfeb93c[_0x0646('0x49')]['id']}})['then'](function(_0x1181a3){return db[_0x0646('0x6a')][_0x0646('0x6b')](function(_0xd9a180){return _0x1181a3[_0x0646('0x64')](_0x2c3e36,{'transaction':_0xd9a180})[_0x0646('0x27')](function(){return BPromise['each'](_0x13577c,function(_0xa5ab69){return db[_0x0646('0x57')][_0x0646('0x6c')]({'where':{'UserId':_0xa5ab69['id'],'OpenchannelQueueId':_0xfeb93c[_0x0646('0x49')]['id']},'transaction':_0xd9a180});});})[_0x0646('0x27')](function(){_0x13577c[_0x0646('0x6d')](function(_0x1a6e89){socket[_0x0646('0x6e')](_0x0646('0x6f'),{'UserId':_0x1a6e89['id'],'OpenchannelQueueId':_0x1181a3['id']});});});});});}})[_0x0646('0x27')](respondWithStatusCode(_0x105276,null))[_0x0646('0x47')](handleError(_0x105276,null));};exports['removeTeams']=function(_0x218b8d,_0x3a6558,_0x4da9fb){return db[_0x0646('0x63')][_0x0646('0x46')]({'where':{'id':_0x218b8d[_0x0646('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0646('0x59')],'as':_0x0646('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3a6558,null))['then'](function(_0x453ae9){var _0x1eefe3=_[_0x0646('0x41')](_0x453ae9,'id');var _0x4946cd=[];var _0x5444bd=[];var _0x129984=squel[_0x0646('0x70')]();_0x129984[_0x0646('0x71')]('tq.TeamId')[_0x0646('0x72')](_0x0646('0x73'),'tq')[_0x0646('0x74')](_0x0646('0x75'),'ut',_0x0646('0x76'))[_0x0646('0x3f')](_0x0646('0x77'),_0x218b8d[_0x0646('0x49')]['id']);for(var _0x3225f8=0x0;_0x3225f8<_0x453ae9['length'];_0x3225f8+=0x1){let _0x5ba442=_0x453ae9[_0x3225f8];for(var _0x22b001=0x0;_0x22b001<_0x5ba442[_0x0646('0x66')]['length'];_0x22b001+=0x1){let _0x9b1520=_0x5ba442[_0x0646('0x66')][_0x22b001];var _0x24da3a=_0x129984[_0x0646('0x78')]();_0x24da3a[_0x0646('0x3f')](_0x0646('0x79'),_0x9b1520['id']);_0x5444bd[_0x0646('0x7a')](db['sequelize']['query'](_0x24da3a['toString'](),{'type':db[_0x0646('0x6a')][_0x0646('0x7b')][_0x0646('0x7c')]})[_0x0646('0x27')](function(_0x47345e){if(_0x47345e[_0x0646('0x4a')]===0x1){return _0x9b1520['id'];}else{var _0xa001da=_[_0x0646('0x7d')](_[_0x0646('0x41')](_0x47345e,_0x0646('0x7e')),function(_0x20e0de){return _[_0x0646('0x7f')](_0x1eefe3,_0x20e0de);});if(_0xa001da){return _0x9b1520['id'];}}}));}}return BPromise['all'](_0x5444bd)[_0x0646('0x27')](function(_0x1f3cf7){_0x4946cd=_(_0x4946cd)[_0x0646('0x80')](_0x1f3cf7)['compact']()[_0x0646('0x81')]();return db['OpenchannelQueue'][_0x0646('0x4f')]({'where':{'id':_0x218b8d[_0x0646('0x49')]['id']}})[_0x0646('0x27')](function(_0x2296bd){return db[_0x0646('0x6a')]['transaction'](function(_0x469af7){return _0x2296bd[_0x0646('0x82')](_0x218b8d[_0x0646('0x34')][_0x0646('0x65')],{'transaction':_0x469af7})[_0x0646('0x27')](function(){if(!_[_0x0646('0x83')](_0x4946cd)){return _0x2296bd['removeAgents'](_0x4946cd,{'transaction':_0x469af7});}})['then'](function(){_0x4946cd[_0x0646('0x6d')](function(_0xca8df7){socket[_0x0646('0x6e')](_0x0646('0x84'),{'UserId':_0xca8df7,'OpenchannelQueueId':_0x2296bd['id']});});});});});});})[_0x0646('0x27')](respondWithStatusCode(_0x3a6558,null))[_0x0646('0x47')](handleError(_0x3a6558,null));};exports['addAgents']=function(_0x196562,_0x203867,_0xc3a7c7){return db[_0x0646('0x2f')]['find']({'where':{'id':_0x196562[_0x0646('0x49')]['id']}})['then'](handleEntityNotFound(_0x203867,null))[_0x0646('0x27')](function(_0x5e9c1b){if(_0x5e9c1b){return _0x5e9c1b[_0x0646('0x85')](_0x196562[_0x0646('0x53')]['ids'],_['omit'](_0x196562[_0x0646('0x53')],['ids','id'])||{})[_0x0646('0x86')](function(_0x57ed0b){for(var _0x1d40b7=0x0;_0x1d40b7<_0x196562['body']['ids'][_0x0646('0x4a')];_0x1d40b7+=0x1){socket[_0x0646('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x196562[_0x0646('0x53')]['ids'][_0x1d40b7]),'OpenchannelQueueId':Number(_0x196562[_0x0646('0x49')]['id'])});}return _0x57ed0b;});}})[_0x0646('0x27')](respondWithResult(_0x203867,null))[_0x0646('0x47')](handleError(_0x203867,null));};exports[_0x0646('0x87')]=function(_0x3cf86c,_0x32d8db,_0x17163b){return db[_0x0646('0x2f')]['find']({'where':{'id':_0x3cf86c['params']['id']}})[_0x0646('0x27')](handleEntityNotFound(_0x32d8db,null))[_0x0646('0x27')](function(_0x4f3a5d){if(_0x4f3a5d){return _0x4f3a5d[_0x0646('0x87')](_0x3cf86c[_0x0646('0x34')]['ids'])[_0x0646('0x27')](function(){if(_[_0x0646('0x88')](_0x3cf86c[_0x0646('0x34')][_0x0646('0x65')])){for(var _0x31fc9e=0x0;_0x31fc9e<_0x3cf86c[_0x0646('0x34')][_0x0646('0x65')][_0x0646('0x4a')];_0x31fc9e+=0x1){socket[_0x0646('0x6e')](_0x0646('0x84'),{'UserId':Number(_0x3cf86c[_0x0646('0x34')][_0x0646('0x65')][_0x31fc9e]),'OpenchannelQueueId':Number(_0x3cf86c[_0x0646('0x49')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x3cf86c[_0x0646('0x34')][_0x0646('0x65')]),'OpenchannelQueueId':Number(_0x3cf86c[_0x0646('0x49')]['id'])});}});}})[_0x0646('0x27')](respondWithStatusCode(_0x32d8db,null))[_0x0646('0x47')](handleError(_0x32d8db,null));};exports[_0x0646('0x89')]=function(_0x464e18,_0x2b5c2c,_0x27d086){var _0x149d80={};var _0x49ad4b={};var _0x5409b2;var _0x5c71bf;return db['OpenchannelQueue'][_0x0646('0x56')]({'where':{'id':_0x464e18[_0x0646('0x49')]['id']}})[_0x0646('0x27')](handleEntityNotFound(_0x2b5c2c,null))['then'](function(_0x38229d){if(_0x38229d){_0x5409b2=_0x38229d;_0x49ad4b[_0x0646('0x33')]=_['keys'](db[_0x0646('0x59')][_0x0646('0x30')]);_0x49ad4b['query']=_[_0x0646('0x35')](_0x464e18[_0x0646('0x34')]);_0x49ad4b[_0x0646('0x36')]=_[_0x0646('0x37')](_0x49ad4b['model'],_0x49ad4b[_0x0646('0x34')]);_0x149d80[_0x0646('0x38')]=_[_0x0646('0x37')](_0x49ad4b[_0x0646('0x33')],qs[_0x0646('0x39')](_0x464e18[_0x0646('0x34')][_0x0646('0x39')]));_0x149d80[_0x0646('0x38')]=_0x149d80[_0x0646('0x38')][_0x0646('0x4a')]?_0x149d80[_0x0646('0x38')]:_0x49ad4b['model'];_0x149d80['order']=qs[_0x0646('0x3c')](_0x464e18['query'][_0x0646('0x3c')]);_0x149d80[_0x0646('0x3f')]=qs[_0x0646('0x36')](_['pick'](_0x464e18[_0x0646('0x34')],_0x49ad4b['filters']));if(_0x464e18[_0x0646('0x34')][_0x0646('0x3e')]){_0x149d80[_0x0646('0x3f')]=_[_0x0646('0x40')](_0x149d80['where'],{'$or':_[_0x0646('0x41')](_0x149d80[_0x0646('0x38')],function(_0x50e606){var _0x2c0db6={};_0x2c0db6[_0x50e606]={'$like':'%'+_0x464e18[_0x0646('0x34')]['filter']+'%'};return _0x2c0db6;})});}_0x149d80=_['merge']({},_0x149d80,_0x464e18['options']);return _0x5409b2[_0x0646('0x89')](_0x149d80);}})[_0x0646('0x27')](function(_0x1144cf){if(_0x1144cf){_0x5c71bf=_0x1144cf[_0x0646('0x4a')];if(!_0x464e18['query']['hasOwnProperty'](_0x0646('0x3a'))){_0x149d80[_0x0646('0x1f')]=qs[_0x0646('0x1f')](_0x464e18[_0x0646('0x34')][_0x0646('0x1f')]);_0x149d80['offset']=qs['offset'](_0x464e18[_0x0646('0x34')][_0x0646('0x1e')]);}return _0x5409b2[_0x0646('0x89')](_0x149d80);}})['then'](function(_0x2190f2){if(_0x2190f2){return _0x2190f2?{'count':_0x5c71bf,'rows':_0x2190f2}:null;}})['then'](respondWithResult(_0x2b5c2c,null))[_0x0646('0x47')](handleError(_0x2b5c2c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 73aea5d..05d1e8d 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 _0xfb28=['update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x29f968,_0x1f08a1){var _0x37ad48=function(_0x17191e){while(--_0x17191e){_0x29f968['push'](_0x29f968['shift']());}};_0x37ad48(++_0x1f08a1);}(_0xfb28,0x195));var _0x8fb2=function(_0x2b3d3d,_0xc95740){_0x2b3d3d=_0x2b3d3d-0x0;var _0xcb11f1=_0xfb28[_0x2b3d3d];return _0xcb11f1;};'use strict';var EventEmitter=require(_0x8fb2('0x0'));var OpenchannelQueue=require(_0x8fb2('0x1'))['db'][_0x8fb2('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8fb2('0x3')](0x0);var events={'afterCreate':_0x8fb2('0x4'),'afterUpdate':_0x8fb2('0x5'),'afterDestroy':_0x8fb2('0x6')};function emitEvent(_0x544220){return function(_0x2085c3,_0x18591a,_0x52a73a){OpenchannelQueueEvents[_0x8fb2('0x7')](_0x544220+':'+_0x2085c3['id'],_0x2085c3);OpenchannelQueueEvents['emit'](_0x544220,_0x2085c3);_0x52a73a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x8fb2('0x8')](e,emitEvent(event));}}module[_0x8fb2('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xac12=['events','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xac12,0xc0));var _0x2ac1=function(_0x2908d0,_0x1f017b){_0x2908d0=_0x2908d0-0x0;var _0x36986c=_0xac12[_0x2908d0];return _0x36986c;};'use strict';var EventEmitter=require(_0x2ac1('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2ac1('0x1')](0x0);var events={'afterCreate':_0x2ac1('0x2'),'afterUpdate':_0x2ac1('0x3'),'afterDestroy':_0x2ac1('0x4')};function emitEvent(_0x3bc106){return function(_0x160111,_0x1fd673,_0x17d42d){OpenchannelQueueEvents['emit'](_0x3bc106+':'+_0x160111['id'],_0x160111);OpenchannelQueueEvents['emit'](_0x3bc106,_0x160111);_0x17d42d(null);};}for(var e in events){if(events[_0x2ac1('0x5')](e)){var event=events[e];OpenchannelQueue[_0x2ac1('0x6')](e,emitEvent(event));}}module[_0x2ac1('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 26e11bb..b7a98ab 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 _0xbe19=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','util','../../config/logger'];(function(_0x422ac3,_0x48bbd4){var _0x53c0d4=function(_0x4b50f6){while(--_0x4b50f6){_0x422ac3['push'](_0x422ac3['shift']());}};_0x53c0d4(++_0x48bbd4);}(_0xbe19,0x82));var _0x9be1=function(_0x2b904c,_0x5bc78f){_0x2b904c=_0x2b904c-0x0;var _0x384b35=_0xbe19[_0x2b904c];return _0x384b35;};'use strict';var _=require('lodash');var util=require(_0x9be1('0x0'));var logger=require(_0x9be1('0x1'))(_0x9be1('0x2'));var moment=require(_0x9be1('0x3'));var BPromise=require(_0x9be1('0x4'));var rp=require(_0x9be1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9be1('0x6'));var config=require(_0x9be1('0x7'));var attributes=require(_0x9be1('0x8'));module['exports']=function(_0x4c7a9e,_0x5b46c6){return _0x4c7a9e[_0x9be1('0x9')](_0x9be1('0xa'),attributes,{'tableName':_0x9be1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd110=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0xd110,0xb5));var _0x0d11=function(_0x4de86b,_0x30d9dd){_0x4de86b=_0x4de86b-0x0;var _0x5c1d75=_0xd110[_0x4de86b];return _0x5c1d75;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var logger=require(_0x0d11('0x2'))(_0x0d11('0x3'));var moment=require(_0x0d11('0x4'));var BPromise=require(_0x0d11('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0d11('0x6'));var config=require(_0x0d11('0x7'));var attributes=require(_0x0d11('0x8'));module['exports']=function(_0x7c11ab,_0x2b42f1){return _0x7c11ab[_0x0d11('0x9')](_0x0d11('0xa'),attributes,{'tableName':_0x0d11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 17f18c3..04531e9 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 _0x0155=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','catch','lodash','util'];(function(_0x3165a8,_0x2c3f5e){var _0x365307=function(_0x425009){while(--_0x425009){_0x3165a8['push'](_0x3165a8['shift']());}};_0x365307(++_0x2c3f5e);}(_0x0155,0x16f));var _0x5015=function(_0x239917,_0x4b96bc){_0x239917=_0x239917-0x0;var _0x1bccaf=_0x0155[_0x239917];return _0x1bccaf;};'use strict';var _=require(_0x5015('0x0'));var util=require(_0x5015('0x1'));var moment=require(_0x5015('0x2'));var BPromise=require('bluebird');var rs=require(_0x5015('0x3'));var fs=require('fs');var Redis=require(_0x5015('0x4'));var db=require(_0x5015('0x5'))['db'];var utils=require(_0x5015('0x6'));var logger=require(_0x5015('0x7'))(_0x5015('0x8'));var config=require(_0x5015('0x9'));var jayson=require(_0x5015('0xa'));var client=jayson['client'][_0x5015('0xb')]({'port':0x232a});config[_0x5015('0xc')]=_[_0x5015('0xd')](config[_0x5015('0xc')],{'host':_0x5015('0xe'),'port':0x18eb});var socket=require(_0x5015('0xf'))(new Redis(config[_0x5015('0xc')]));require(_0x5015('0x10'))['register'](socket);function respondWithRpcPromise(_0x1277e2,_0x191872,_0x283497){return new BPromise(function(_0x59c640,_0x4d0117){return client['request'](_0x1277e2,_0x283497)[_0x5015('0x11')](function(_0x15b840){logger[_0x5015('0x12')](_0x5015('0x13'),_0x191872,_0x5015('0x14'));logger[_0x5015('0x15')](_0x5015('0x16'),_0x191872,_0x5015('0x14'),JSON[_0x5015('0x17')](_0x15b840));if(_0x15b840[_0x5015('0x18')]){if(_0x15b840['error'][_0x5015('0x19')]===0x1f4){logger[_0x5015('0x18')](_0x5015('0x13'),_0x191872,_0x15b840[_0x5015('0x18')][_0x5015('0x1a')]);return _0x4d0117(_0x15b840[_0x5015('0x18')][_0x5015('0x1a')]);}logger[_0x5015('0x18')](_0x5015('0x13'),_0x191872,_0x15b840[_0x5015('0x18')][_0x5015('0x1a')]);return _0x59c640(_0x15b840[_0x5015('0x18')][_0x5015('0x1a')]);}else{logger[_0x5015('0x12')](_0x5015('0x13'),_0x191872,_0x5015('0x14'));_0x59c640(_0x15b840['result'][_0x5015('0x1a')]);}})['catch'](function(_0x47ec53){logger[_0x5015('0x18')](_0x5015('0x13'),_0x191872,_0x47ec53);_0x4d0117(_0x47ec53);});});}exports[_0x5015('0x1b')]=function(_0x48703c){var _0x55e661=this;return new Promise(function(_0x51c73b,_0x273f5e){return db[_0x5015('0x1c')][_0x5015('0x1d')]({'raw':_0x48703c['options']?_0x48703c[_0x5015('0x1e')][_0x5015('0x1f')]===undefined?!![]:![]:!![],'where':_0x48703c[_0x5015('0x1e')]?_0x48703c[_0x5015('0x1e')][_0x5015('0x20')]||null:null,'attributes':_0x48703c[_0x5015('0x1e')]?_0x48703c['options'][_0x5015('0x21')]||null:null,'limit':_0x48703c['options']?_0x48703c[_0x5015('0x1e')][_0x5015('0x22')]||null:null,'include':_0x48703c['options']?_0x48703c[_0x5015('0x1e')][_0x5015('0x23')]?_[_0x5015('0x24')](_0x48703c[_0x5015('0x1e')][_0x5015('0x23')],function(_0x113ef1){return{'model':db[_0x113ef1[_0x5015('0x25')]],'as':_0x113ef1['as'],'attributes':_0x113ef1[_0x5015('0x21')],'include':_0x113ef1[_0x5015('0x23')]?_[_0x5015('0x24')](_0x113ef1[_0x5015('0x23')],function(_0x371b9a){return{'model':db[_0x371b9a['model']],'as':_0x371b9a['as'],'attributes':_0x371b9a[_0x5015('0x21')],'include':_0x371b9a[_0x5015('0x23')]?_['map'](_0x371b9a[_0x5015('0x23')],function(_0x5b8639){return{'model':db[_0x5b8639[_0x5015('0x25')]],'as':_0x5b8639['as'],'attributes':_0x5b8639[_0x5015('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x225b77){logger[_0x5015('0x12')](_0x5015('0x1b'),_0x48703c);logger[_0x5015('0x15')](_0x5015('0x1b'),_0x48703c,JSON[_0x5015('0x17')](_0x225b77));_0x51c73b(_0x225b77);})['catch'](function(_0x34364c){logger[_0x5015('0x18')]('GetOpenchannelQueue',_0x34364c[_0x5015('0x1a')],_0x48703c);_0x273f5e(_0x55e661[_0x5015('0x18')](0x1f4,_0x34364c[_0x5015('0x1a')]));});});};exports[_0x5015('0x26')]=function(_0x38c064){var _0x549659=this;return new Promise(function(_0x2cf1ed,_0x4a891f){return db['OpenchannelQueue'][_0x5015('0x27')]({'raw':_0x38c064[_0x5015('0x1e')]?_0x38c064[_0x5015('0x1e')][_0x5015('0x1f')]===undefined?!![]:![]:!![],'where':_0x38c064[_0x5015('0x1e')]?_0x38c064['options'][_0x5015('0x20')]||null:null,'attributes':_0x38c064['options']?_0x38c064[_0x5015('0x1e')][_0x5015('0x21')]||null:null,'include':_0x38c064['options']?_0x38c064[_0x5015('0x1e')][_0x5015('0x23')]?_[_0x5015('0x24')](_0x38c064[_0x5015('0x1e')][_0x5015('0x23')],function(_0x4ebc88){return{'model':db[_0x4ebc88[_0x5015('0x25')]],'as':_0x4ebc88['as'],'attributes':_0x4ebc88[_0x5015('0x21')],'include':_0x4ebc88[_0x5015('0x23')]?_[_0x5015('0x24')](_0x4ebc88[_0x5015('0x23')],function(_0x1729bc){return{'model':db[_0x1729bc[_0x5015('0x25')]],'as':_0x1729bc['as'],'attributes':_0x1729bc[_0x5015('0x21')],'include':_0x1729bc[_0x5015('0x23')]?_[_0x5015('0x24')](_0x1729bc['include'],function(_0x1f94aa){return{'model':db[_0x1f94aa[_0x5015('0x25')]],'as':_0x1f94aa['as'],'attributes':_0x1f94aa['attributes']};}):[]};}):[]};}):[]:[]})[_0x5015('0x11')](function(_0x5f1ca6){logger['info'](_0x5015('0x26'),_0x38c064);logger['debug'](_0x5015('0x26'),_0x38c064,JSON[_0x5015('0x17')](_0x5f1ca6));_0x2cf1ed(_0x5f1ca6);})[_0x5015('0x28')](function(_0x2e45b4){logger[_0x5015('0x18')](_0x5015('0x26'),_0x2e45b4[_0x5015('0x1a')],_0x38c064);_0x4a891f(_0x549659[_0x5015('0x18')](0x1f4,_0x2e45b4[_0x5015('0x1a')]));});});}; \ No newline at end of file +var _0x2ce5=['result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','stringify','find','ShowOpenchannelQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x327c57,_0xa7d8f2){var _0x441cd8=function(_0x55ac04){while(--_0x55ac04){_0x327c57['push'](_0x327c57['shift']());}};_0x441cd8(++_0xa7d8f2);}(_0x2ce5,0x101));var _0x52ce=function(_0x3e9bc6,_0x33c000){_0x3e9bc6=_0x3e9bc6-0x0;var _0x49234f=_0x2ce5[_0x3e9bc6];return _0x49234f;};'use strict';var _=require('lodash');var util=require(_0x52ce('0x0'));var moment=require('moment');var BPromise=require(_0x52ce('0x1'));var rs=require(_0x52ce('0x2'));var fs=require('fs');var Redis=require(_0x52ce('0x3'));var db=require(_0x52ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52ce('0x5'))(_0x52ce('0x6'));var config=require(_0x52ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x52ce('0x8')][_0x52ce('0x9')]({'port':0x232a});config[_0x52ce('0xa')]=_[_0x52ce('0xb')](config[_0x52ce('0xa')],{'host':_0x52ce('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52ce('0xa')]));require(_0x52ce('0xd'))[_0x52ce('0xe')](socket);function respondWithRpcPromise(_0xa0d0af,_0xe90e66,_0xf31ab5){return new BPromise(function(_0x48ae8d,_0x12d1df){return client[_0x52ce('0xf')](_0xa0d0af,_0xf31ab5)[_0x52ce('0x10')](function(_0x191a1f){logger[_0x52ce('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0xe90e66,_0x52ce('0x12'));logger['debug'](_0x52ce('0x13'),_0xe90e66,_0x52ce('0x12'),JSON['stringify'](_0x191a1f));if(_0x191a1f[_0x52ce('0x14')]){if(_0x191a1f[_0x52ce('0x14')]['code']===0x1f4){logger['error'](_0x52ce('0x15'),_0xe90e66,_0x191a1f[_0x52ce('0x14')][_0x52ce('0x16')]);return _0x12d1df(_0x191a1f[_0x52ce('0x14')][_0x52ce('0x16')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0xe90e66,_0x191a1f['error'][_0x52ce('0x16')]);return _0x48ae8d(_0x191a1f['error'][_0x52ce('0x16')]);}else{logger[_0x52ce('0x11')](_0x52ce('0x15'),_0xe90e66,_0x52ce('0x12'));_0x48ae8d(_0x191a1f[_0x52ce('0x17')]['message']);}})[_0x52ce('0x18')](function(_0x331cf0){logger[_0x52ce('0x14')](_0x52ce('0x15'),_0xe90e66,_0x331cf0);_0x12d1df(_0x331cf0);});});}exports['GetOpenchannelQueue']=function(_0x543265){var _0xb36e49=this;return new Promise(function(_0x183561,_0x6697b6){return db[_0x52ce('0x19')][_0x52ce('0x1a')]({'raw':_0x543265[_0x52ce('0x1b')]?_0x543265[_0x52ce('0x1b')][_0x52ce('0x1c')]===undefined?!![]:![]:!![],'where':_0x543265[_0x52ce('0x1b')]?_0x543265[_0x52ce('0x1b')][_0x52ce('0x1d')]||null:null,'attributes':_0x543265['options']?_0x543265[_0x52ce('0x1b')][_0x52ce('0x1e')]||null:null,'limit':_0x543265[_0x52ce('0x1b')]?_0x543265[_0x52ce('0x1b')][_0x52ce('0x1f')]||null:null,'include':_0x543265[_0x52ce('0x1b')]?_0x543265[_0x52ce('0x1b')][_0x52ce('0x20')]?_[_0x52ce('0x21')](_0x543265[_0x52ce('0x1b')][_0x52ce('0x20')],function(_0x1ce32f){return{'model':db[_0x1ce32f[_0x52ce('0x22')]],'as':_0x1ce32f['as'],'attributes':_0x1ce32f[_0x52ce('0x1e')],'include':_0x1ce32f[_0x52ce('0x20')]?_[_0x52ce('0x21')](_0x1ce32f[_0x52ce('0x20')],function(_0x1d0fab){return{'model':db[_0x1d0fab[_0x52ce('0x22')]],'as':_0x1d0fab['as'],'attributes':_0x1d0fab[_0x52ce('0x1e')],'include':_0x1d0fab[_0x52ce('0x20')]?_['map'](_0x1d0fab[_0x52ce('0x20')],function(_0x1c81a9){return{'model':db[_0x1c81a9[_0x52ce('0x22')]],'as':_0x1c81a9['as'],'attributes':_0x1c81a9[_0x52ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x52ce('0x10')](function(_0x45f206){logger[_0x52ce('0x11')](_0x52ce('0x23'),_0x543265);logger[_0x52ce('0x24')](_0x52ce('0x23'),_0x543265,JSON[_0x52ce('0x25')](_0x45f206));_0x183561(_0x45f206);})[_0x52ce('0x18')](function(_0x38472d){logger[_0x52ce('0x14')](_0x52ce('0x23'),_0x38472d[_0x52ce('0x16')],_0x543265);_0x6697b6(_0xb36e49['error'](0x1f4,_0x38472d[_0x52ce('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x35fae3){var _0x4988a7=this;return new Promise(function(_0x15bd84,_0x20ed16){return db['OpenchannelQueue'][_0x52ce('0x26')]({'raw':_0x35fae3[_0x52ce('0x1b')]?_0x35fae3[_0x52ce('0x1b')][_0x52ce('0x1c')]===undefined?!![]:![]:!![],'where':_0x35fae3[_0x52ce('0x1b')]?_0x35fae3[_0x52ce('0x1b')]['where']||null:null,'attributes':_0x35fae3[_0x52ce('0x1b')]?_0x35fae3[_0x52ce('0x1b')]['attributes']||null:null,'include':_0x35fae3['options']?_0x35fae3[_0x52ce('0x1b')][_0x52ce('0x20')]?_[_0x52ce('0x21')](_0x35fae3[_0x52ce('0x1b')][_0x52ce('0x20')],function(_0x52436e){return{'model':db[_0x52436e[_0x52ce('0x22')]],'as':_0x52436e['as'],'attributes':_0x52436e[_0x52ce('0x1e')],'include':_0x52436e['include']?_[_0x52ce('0x21')](_0x52436e['include'],function(_0x59b704){return{'model':db[_0x59b704['model']],'as':_0x59b704['as'],'attributes':_0x59b704[_0x52ce('0x1e')],'include':_0x59b704[_0x52ce('0x20')]?_[_0x52ce('0x21')](_0x59b704['include'],function(_0x8e97ac){return{'model':db[_0x8e97ac[_0x52ce('0x22')]],'as':_0x8e97ac['as'],'attributes':_0x8e97ac[_0x52ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x52ce('0x10')](function(_0x6390bd){logger[_0x52ce('0x11')](_0x52ce('0x27'),_0x35fae3);logger[_0x52ce('0x24')]('ShowOpenchannelQueue',_0x35fae3,JSON['stringify'](_0x6390bd));_0x15bd84(_0x6390bd);})[_0x52ce('0x18')](function(_0x4e630d){logger['error']('ShowOpenchannelQueue',_0x4e630d[_0x52ce('0x16')],_0x35fae3);_0x20ed16(_0x4988a7[_0x52ce('0x14')](0x1f4,_0x4e630d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 199d061..b4971a0 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 _0x125c=['save','remove','emit','removeListener','register','length','openchannelQueue:'];(function(_0xe8d1a1,_0x51f5fd){var _0x4e03fd=function(_0x40b062){while(--_0x40b062){_0xe8d1a1['push'](_0xe8d1a1['shift']());}};_0x4e03fd(++_0x51f5fd);}(_0x125c,0x17a));var _0xc125=function(_0x4ae6fa,_0x2235b4){_0x4ae6fa=_0x4ae6fa-0x0;var _0x2819f6=_0x125c[_0x4ae6fa];return _0x2819f6;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc125('0x0'),_0xc125('0x1'),'update'];function createListener(_0x4de701,_0x29f953){return function(_0x147ddb){_0x29f953[_0xc125('0x2')](_0x4de701,_0x147ddb);};}function removeListener(_0x36e05e,_0x3fced0){return function(){OpenchannelQueueEvents[_0xc125('0x3')](_0x36e05e,_0x3fced0);};}exports[_0xc125('0x4')]=function(_0x2f9a4b){for(var _0xf68b72=0x0,_0x537a8e=events[_0xc125('0x5')];_0xf68b72<_0x537a8e;_0xf68b72++){var _0x47612d=events[_0xf68b72];var _0x21d2e1=createListener(_0xc125('0x6')+_0x47612d,_0x2f9a4b);OpenchannelQueueEvents['on'](_0x47612d,_0x21d2e1);}}; \ No newline at end of file +var _0x8ae9=['save','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x4dd295,_0x3cc24b){var _0x209240=function(_0x446730){while(--_0x446730){_0x4dd295['push'](_0x4dd295['shift']());}};_0x209240(++_0x3cc24b);}(_0x8ae9,0x179));var _0x98ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ae9[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelQueueEvents=require(_0x98ae('0x0'));var events=[_0x98ae('0x1'),'remove','update'];function createListener(_0x4a1157,_0x2c2290){return function(_0xd86255){_0x2c2290[_0x98ae('0x2')](_0x4a1157,_0xd86255);};}function removeListener(_0x5a6b34,_0x4eea43){return function(){OpenchannelQueueEvents[_0x98ae('0x3')](_0x5a6b34,_0x4eea43);};}exports[_0x98ae('0x4')]=function(_0x237dd0){for(var _0x3a6b37=0x0,_0x58301b=events[_0x98ae('0x5')];_0x3a6b37<_0x58301b;_0x3a6b37++){var _0x303580=events[_0x3a6b37];var _0x4477e=createListener(_0x98ae('0x6')+_0x303580,_0x237dd0);OpenchannelQueueEvents['on'](_0x303580,_0x4477e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 92122cd..913bf41 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 _0x584f=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x584f,0xa3));var _0xf584=function(_0x4a573a,_0x4e4ede){_0x4a573a=_0x4a573a-0x0;var _0x231bbd=_0x584f[_0x4a573a];return _0x231bbd;};'use strict';var multer=require(_0xf584('0x0'));var util=require(_0xf584('0x1'));var path=require(_0xf584('0x2'));var timeout=require('connect-timeout');var express=require(_0xf584('0x3'));var router=express[_0xf584('0x4')]();var fs_extra=require(_0xf584('0x5'));var auth=require(_0xf584('0x6'));var interaction=require(_0xf584('0x7'));var config=require('../../config/environment');var controller=require(_0xf584('0x8'));router[_0xf584('0x9')]('/',auth[_0xf584('0xa')](),controller[_0xf584('0xb')]);router[_0xf584('0x9')](_0xf584('0xc'),auth['isAuthenticated'](),controller[_0xf584('0xd')]);router[_0xf584('0x9')](_0xf584('0xe'),auth[_0xf584('0xa')](),controller[_0xf584('0xf')]);router[_0xf584('0x10')]('/',auth[_0xf584('0xa')](),controller[_0xf584('0x11')]);router[_0xf584('0x12')](_0xf584('0xe'),auth[_0xf584('0xa')](),controller[_0xf584('0x13')]);router[_0xf584('0x14')]('/:id',auth[_0xf584('0xa')](),controller[_0xf584('0x15')]);module[_0xf584('0x16')]=router; \ No newline at end of file +var _0x204a=['./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xdbc579,_0x2d477a){var _0x2a5169=function(_0x53a648){while(--_0x53a648){_0xdbc579['push'](_0xdbc579['shift']());}};_0x2a5169(++_0x2d477a);}(_0x204a,0x1ad));var _0xa204=function(_0x54275f,_0x445a39){_0x54275f=_0x54275f-0x0;var _0x4340c8=_0x204a[_0x54275f];return _0x4340c8;};'use strict';var multer=require(_0xa204('0x0'));var util=require('util');var path=require(_0xa204('0x1'));var timeout=require(_0xa204('0x2'));var express=require(_0xa204('0x3'));var router=express[_0xa204('0x4')]();var fs_extra=require(_0xa204('0x5'));var auth=require(_0xa204('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa204('0x7'));var controller=require(_0xa204('0x8'));router[_0xa204('0x9')]('/',auth[_0xa204('0xa')](),controller[_0xa204('0xb')]);router['get'](_0xa204('0xc'),auth[_0xa204('0xa')](),controller[_0xa204('0xd')]);router[_0xa204('0x9')](_0xa204('0xe'),auth[_0xa204('0xa')](),controller[_0xa204('0xf')]);router[_0xa204('0x10')]('/',auth[_0xa204('0xa')](),controller[_0xa204('0x11')]);router[_0xa204('0x12')](_0xa204('0xe'),auth['isAuthenticated'](),controller[_0xa204('0x13')]);router[_0xa204('0x14')]('/:id',auth[_0xa204('0xa')](),controller[_0xa204('0x15')]);module[_0xa204('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 545d7d3..cfdb182 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 _0xee5e=['DATE','exports','STRING'];(function(_0x959987,_0x218f52){var _0x146f45=function(_0x43b1ab){while(--_0x43b1ab){_0x959987['push'](_0x959987['shift']());}};_0x146f45(++_0x218f52);}(_0xee5e,0x181));var _0xeee5=function(_0x555da5,_0x289151){_0x555da5=_0x555da5-0x0;var _0x17ec4d=_0xee5e[_0x555da5];return _0x17ec4d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xeee5('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xeee5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xeee5('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd086=['STRING','DATE','moment','exports'];(function(_0x39531c,_0x4e4dfb){var _0x9dfc07=function(_0x419fb9){while(--_0x419fb9){_0x39531c['push'](_0x39531c['shift']());}};_0x9dfc07(++_0x4e4dfb);}(_0xd086,0x1da));var _0x6d08=function(_0x49d045,_0x3ef04c){_0x49d045=_0x49d045-0x0;var _0x149fc0=_0xd086[_0x49d045];return _0x149fc0;};'use strict';var moment=require(_0x6d08('0x0'));var Sequelize=require('sequelize');module[_0x6d08('0x1')]={'uniqueid':{'type':Sequelize[_0x6d08('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6d08('0x2')]},'joinAt':{'type':Sequelize[_0x6d08('0x3')]},'leaveAt':{'type':Sequelize[_0x6d08('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'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 8d3a85f..f69abdf 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 _0x9698=['name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','OpenchannelQueueReport','then','includeAll','findAll','rows','params','fields','length','include','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack'];(function(_0x50fa37,_0x7093d3){var _0x4e23d8=function(_0x571f96){while(--_0x571f96){_0x50fa37['push'](_0x50fa37['shift']());}};_0x4e23d8(++_0x7093d3);}(_0x9698,0x73));var _0x8969=function(_0x34cb11,_0x5d10af){_0x34cb11=_0x34cb11-0x0;var _0x109f44=_0x9698[_0x34cb11];return _0x109f44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8969('0x0'));var jsonpatch=require(_0x8969('0x1'));var rp=require(_0x8969('0x2'));var moment=require(_0x8969('0x3'));var BPromise=require(_0x8969('0x4'));var Mustache=require(_0x8969('0x5'));var util=require(_0x8969('0x6'));var path=require(_0x8969('0x7'));var sox=require(_0x8969('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8969('0x9'));var _=require(_0x8969('0xa'));var squel=require(_0x8969('0xb'));var crypto=require(_0x8969('0xc'));var jsforce=require(_0x8969('0xd'));var deskjs=require(_0x8969('0xe'));var toCsv=require(_0x8969('0xf'));var querystring=require(_0x8969('0x10'));var Papa=require(_0x8969('0x11'));var Redis=require(_0x8969('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8969('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8969('0x14'))(_0x8969('0x15'));var utils=require(_0x8969('0x16'));var config=require(_0x8969('0x17'));var licenseUtil=require(_0x8969('0x18'));var db=require(_0x8969('0x19'))['db'];function respondWithStatusCode(_0x420d29,_0xcd97c2){_0xcd97c2=_0xcd97c2||0xcc;return function(_0x255d19){if(_0x255d19){return _0x420d29[_0x8969('0x1a')](_0xcd97c2);}return _0x420d29[_0x8969('0x1b')](_0xcd97c2)[_0x8969('0x1c')]();};}function respondWithResult(_0x2d83e6,_0xa73e02){_0xa73e02=_0xa73e02||0xc8;return function(_0x3962b){if(_0x3962b){return _0x2d83e6[_0x8969('0x1b')](_0xa73e02)[_0x8969('0x1d')](_0x3962b);}};}function respondWithFilteredResult(_0x575928,_0x464624){return function(_0x22f4ab){if(_0x22f4ab){var _0x905fb9=typeof _0x464624['offset']===_0x8969('0x1e')&&typeof _0x464624[_0x8969('0x1f')]==='undefined';var _0x25b022=_0x22f4ab['count'];var _0x5aa4a3=_0x905fb9?0x0:_0x464624['offset'];var _0x531dfd=_0x905fb9?_0x22f4ab[_0x8969('0x20')]:_0x464624[_0x8969('0x21')]+_0x464624['limit'];var _0x2a8171;if(_0x531dfd>=_0x25b022){_0x531dfd=_0x25b022;_0x2a8171=0xc8;}else{_0x2a8171=0xce;}_0x575928[_0x8969('0x1b')](_0x2a8171);return _0x575928[_0x8969('0x22')](_0x8969('0x23'),_0x5aa4a3+'-'+_0x531dfd+'/'+_0x25b022)['json'](_0x22f4ab);}return null;};}function patchUpdates(_0xead389){return function(_0x34d36a){try{jsonpatch[_0x8969('0x24')](_0x34d36a,_0xead389,!![]);}catch(_0x598b57){return BPromise[_0x8969('0x25')](_0x598b57);}return _0x34d36a[_0x8969('0x26')]();};}function saveUpdates(_0x27a2aa,_0x265c75){return function(_0x50149e){if(_0x50149e){return _0x50149e[_0x8969('0x27')](_0x27a2aa)['then'](function(_0x29f01e){return _0x29f01e;});}return null;};}function removeEntity(_0x4ee1f1,_0x85faa4){return function(_0x3abd36){if(_0x3abd36){return _0x3abd36[_0x8969('0x28')]()['then'](function(){_0x4ee1f1[_0x8969('0x1b')](0xcc)[_0x8969('0x1c')]();});}};}function handleEntityNotFound(_0x409724,_0x4d02f7){return function(_0x22d7b3){if(!_0x22d7b3){_0x409724[_0x8969('0x1a')](0x194);}return _0x22d7b3;};}function handleError(_0x1f0a88,_0x160b99){_0x160b99=_0x160b99||0x1f4;return function(_0x63e038){logger[_0x8969('0x29')](_0x63e038[_0x8969('0x2a')]);if(_0x63e038[_0x8969('0x2b')]){delete _0x63e038[_0x8969('0x2b')];}_0x1f0a88[_0x8969('0x1b')](_0x160b99)[_0x8969('0x2c')](_0x63e038);};}exports[_0x8969('0x2d')]=function(_0x56db9e,_0x416f72){var _0x1ab285={},_0x57e902={},_0x37fdd8={'count':0x0,'rows':[]};var _0x3e09a2=_[_0x8969('0x2e')](db['OpenchannelQueueReport'][_0x8969('0x2f')],function(_0x7476db){return{'name':_0x7476db['fieldName'],'type':_0x7476db[_0x8969('0x30')][_0x8969('0x31')]};});_0x57e902[_0x8969('0x32')]=_[_0x8969('0x2e')](_0x3e09a2,_0x8969('0x2b'));_0x57e902[_0x8969('0x33')]=_[_0x8969('0x34')](_0x56db9e[_0x8969('0x33')]);_0x57e902['filters']=_[_0x8969('0x35')](_0x57e902[_0x8969('0x32')],_0x57e902[_0x8969('0x33')]);_0x1ab285[_0x8969('0x36')]=_[_0x8969('0x35')](_0x57e902[_0x8969('0x32')],qs['fields'](_0x56db9e[_0x8969('0x33')]['fields']));_0x1ab285[_0x8969('0x36')]=_0x1ab285['attributes']['length']?_0x1ab285[_0x8969('0x36')]:_0x57e902[_0x8969('0x32')];if(!_0x56db9e[_0x8969('0x33')][_0x8969('0x37')](_0x8969('0x38'))){_0x1ab285['limit']=qs[_0x8969('0x1f')](_0x56db9e[_0x8969('0x33')][_0x8969('0x1f')]);_0x1ab285['offset']=qs[_0x8969('0x21')](_0x56db9e[_0x8969('0x33')][_0x8969('0x21')]);}_0x1ab285[_0x8969('0x39')]=qs[_0x8969('0x3a')](_0x56db9e[_0x8969('0x33')]['sort']);_0x1ab285[_0x8969('0x3b')]=qs['filters'](_[_0x8969('0x3c')](_0x56db9e[_0x8969('0x33')],_0x57e902[_0x8969('0x3d')]),_0x3e09a2);if(_0x56db9e[_0x8969('0x33')][_0x8969('0x3e')]){_0x1ab285[_0x8969('0x3b')]=_[_0x8969('0x3f')](_0x1ab285[_0x8969('0x3b')],{'$or':_[_0x8969('0x2e')](_0x3e09a2,function(_0x21e722){if(_0x21e722[_0x8969('0x30')]!=='VIRTUAL'){var _0x147675={};_0x147675[_0x21e722[_0x8969('0x2b')]]={'$like':'%'+_0x56db9e[_0x8969('0x33')][_0x8969('0x3e')]+'%'};return _0x147675;}})});}_0x1ab285=_['merge']({},_0x1ab285,_0x56db9e[_0x8969('0x40')]);var _0x5c2544={'where':_0x1ab285[_0x8969('0x3b')]};return db[_0x8969('0x41')]['count'](_0x5c2544)[_0x8969('0x42')](function(_0x5082c0){_0x37fdd8['count']=_0x5082c0;if(_0x56db9e[_0x8969('0x33')][_0x8969('0x43')]){_0x1ab285['include']=[{'all':!![]}];}return db[_0x8969('0x41')][_0x8969('0x44')](_0x1ab285);})[_0x8969('0x42')](function(_0x5eeaa4){_0x37fdd8[_0x8969('0x45')]=_0x5eeaa4;return _0x37fdd8;})['then'](respondWithFilteredResult(_0x416f72,_0x1ab285))['catch'](handleError(_0x416f72,null));};exports['show']=function(_0x32fdd6,_0xf5b41c){var _0x3d0ee8={'raw':!![],'where':{'id':_0x32fdd6[_0x8969('0x46')]['id']}},_0x1e6319={};_0x1e6319[_0x8969('0x32')]=_[_0x8969('0x34')](db['OpenchannelQueueReport'][_0x8969('0x2f')]);_0x1e6319[_0x8969('0x33')]=_[_0x8969('0x34')](_0x32fdd6[_0x8969('0x33')]);_0x1e6319['filters']=_[_0x8969('0x35')](_0x1e6319[_0x8969('0x32')],_0x1e6319[_0x8969('0x33')]);_0x3d0ee8[_0x8969('0x36')]=_[_0x8969('0x35')](_0x1e6319[_0x8969('0x32')],qs[_0x8969('0x47')](_0x32fdd6[_0x8969('0x33')]['fields']));_0x3d0ee8[_0x8969('0x36')]=_0x3d0ee8[_0x8969('0x36')][_0x8969('0x48')]?_0x3d0ee8[_0x8969('0x36')]:_0x1e6319[_0x8969('0x32')];if(_0x32fdd6[_0x8969('0x33')][_0x8969('0x43')]){_0x3d0ee8[_0x8969('0x49')]=[{'all':!![]}];}_0x3d0ee8=_[_0x8969('0x3f')]({},_0x3d0ee8,_0x32fdd6['options']);return db[_0x8969('0x41')][_0x8969('0x4a')](_0x3d0ee8)[_0x8969('0x42')](handleEntityNotFound(_0xf5b41c,null))[_0x8969('0x42')](respondWithResult(_0xf5b41c,null))[_0x8969('0x4b')](handleError(_0xf5b41c,null));};exports[_0x8969('0x4c')]=function(_0x5f4e06,_0x1c376b){return db['OpenchannelQueueReport'][_0x8969('0x4c')](_0x5f4e06[_0x8969('0x4d')],{})[_0x8969('0x42')](respondWithResult(_0x1c376b,0xc9))[_0x8969('0x4b')](handleError(_0x1c376b,null));};exports['update']=function(_0x28c277,_0x33fff0){if(_0x28c277['body']['id']){delete _0x28c277[_0x8969('0x4d')]['id'];}return db[_0x8969('0x41')][_0x8969('0x4a')]({'where':{'id':_0x28c277['params']['id']}})['then'](handleEntityNotFound(_0x33fff0,null))[_0x8969('0x42')](saveUpdates(_0x28c277[_0x8969('0x4d')],null))[_0x8969('0x42')](respondWithResult(_0x33fff0,null))[_0x8969('0x4b')](handleError(_0x33fff0,null));};exports[_0x8969('0x28')]=function(_0x2b2e8e,_0x2d14ca){return db[_0x8969('0x41')][_0x8969('0x4a')]({'where':{'id':_0x2b2e8e[_0x8969('0x46')]['id']}})[_0x8969('0x42')](handleEntityNotFound(_0x2d14ca,null))['then'](removeEntity(_0x2d14ca,null))[_0x8969('0x4b')](handleError(_0x2d14ca,null));};exports[_0x8969('0x4e')]=function(_0x521255,_0x1fd433){return db[_0x8969('0x41')][_0x8969('0x4e')]()['then'](respondWithResult(_0x1fd433,null))[_0x8969('0x4b')](handleError(_0x1fd433,null));}; \ No newline at end of file +var _0x45e8=['sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x40e735,_0x914218){var _0x5b4a8f=function(_0x3b61cf){while(--_0x3b61cf){_0x40e735['push'](_0x40e735['shift']());}};_0x5b4a8f(++_0x914218);}(_0x45e8,0x152));var _0x845e=function(_0x910b22,_0x57e873){_0x910b22=_0x910b22-0x0;var _0x1f594d=_0x45e8[_0x910b22];return _0x1f594d;};'use strict';var emlformat=require(_0x845e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x845e('0x1'));var moment=require(_0x845e('0x2'));var BPromise=require(_0x845e('0x3'));var Mustache=require(_0x845e('0x4'));var util=require(_0x845e('0x5'));var path=require(_0x845e('0x6'));var sox=require(_0x845e('0x7'));var csv=require(_0x845e('0x8'));var ejs=require(_0x845e('0x9'));var fs=require('fs');var fs_extra=require(_0x845e('0xa'));var _=require(_0x845e('0xb'));var squel=require(_0x845e('0xc'));var crypto=require(_0x845e('0xd'));var jsforce=require(_0x845e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x845e('0xf'));var Papa=require(_0x845e('0x10'));var Redis=require(_0x845e('0x11'));var authService=require(_0x845e('0x12'));var qs=require(_0x845e('0x13'));var as=require(_0x845e('0x14'));var hardwareService=require(_0x845e('0x15'));var logger=require(_0x845e('0x16'))(_0x845e('0x17'));var utils=require(_0x845e('0x18'));var config=require(_0x845e('0x19'));var licenseUtil=require(_0x845e('0x1a'));var db=require(_0x845e('0x1b'))['db'];function respondWithStatusCode(_0x5105fe,_0x4aa8d5){_0x4aa8d5=_0x4aa8d5||0xcc;return function(_0x153b82){if(_0x153b82){return _0x5105fe['sendStatus'](_0x4aa8d5);}return _0x5105fe['status'](_0x4aa8d5)[_0x845e('0x1c')]();};}function respondWithResult(_0x4e40c7,_0x20b458){_0x20b458=_0x20b458||0xc8;return function(_0x14266e){if(_0x14266e){return _0x4e40c7[_0x845e('0x1d')](_0x20b458)['json'](_0x14266e);}};}function respondWithFilteredResult(_0x291184,_0x316da9){return function(_0x2572fa){if(_0x2572fa){var _0x673675=typeof _0x316da9['offset']===_0x845e('0x1e')&&typeof _0x316da9[_0x845e('0x1f')]===_0x845e('0x1e');var _0x2e034c=_0x2572fa[_0x845e('0x20')];var _0x48f362=_0x673675?0x0:_0x316da9[_0x845e('0x21')];var _0x1edc65=_0x673675?_0x2572fa['count']:_0x316da9[_0x845e('0x21')]+_0x316da9[_0x845e('0x1f')];var _0x2e5850;if(_0x1edc65>=_0x2e034c){_0x1edc65=_0x2e034c;_0x2e5850=0xc8;}else{_0x2e5850=0xce;}_0x291184[_0x845e('0x1d')](_0x2e5850);return _0x291184[_0x845e('0x22')](_0x845e('0x23'),_0x48f362+'-'+_0x1edc65+'/'+_0x2e034c)[_0x845e('0x24')](_0x2572fa);}return null;};}function patchUpdates(_0x4751a6){return function(_0x264a64){try{jsonpatch[_0x845e('0x25')](_0x264a64,_0x4751a6,!![]);}catch(_0x136631){return BPromise[_0x845e('0x26')](_0x136631);}return _0x264a64[_0x845e('0x27')]();};}function saveUpdates(_0x2c4203,_0x521faa){return function(_0x133b2f){if(_0x133b2f){return _0x133b2f[_0x845e('0x28')](_0x2c4203)[_0x845e('0x29')](function(_0x4f98be){return _0x4f98be;});}return null;};}function removeEntity(_0x17f8e5,_0x3ab375){return function(_0x8a5d1b){if(_0x8a5d1b){return _0x8a5d1b[_0x845e('0x2a')]()[_0x845e('0x29')](function(){_0x17f8e5[_0x845e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a21e6,_0x54874d){return function(_0x28d0e8){if(!_0x28d0e8){_0x3a21e6[_0x845e('0x2b')](0x194);}return _0x28d0e8;};}function handleError(_0x1b7935,_0x4e26ab){_0x4e26ab=_0x4e26ab||0x1f4;return function(_0x1280f8){logger[_0x845e('0x2c')](_0x1280f8[_0x845e('0x2d')]);if(_0x1280f8[_0x845e('0x2e')]){delete _0x1280f8[_0x845e('0x2e')];}_0x1b7935[_0x845e('0x1d')](_0x4e26ab)['send'](_0x1280f8);};}exports[_0x845e('0x2f')]=function(_0x49605b,_0x37b543){var _0x8dbae0={},_0x4a8e87={},_0x29185d={'count':0x0,'rows':[]};var _0x4b0a1b=_[_0x845e('0x30')](db[_0x845e('0x31')][_0x845e('0x32')],function(_0x87fa79){return{'name':_0x87fa79[_0x845e('0x33')],'type':_0x87fa79[_0x845e('0x34')]['key']};});_0x4a8e87[_0x845e('0x35')]=_[_0x845e('0x30')](_0x4b0a1b,_0x845e('0x2e'));_0x4a8e87[_0x845e('0x36')]=_[_0x845e('0x37')](_0x49605b[_0x845e('0x36')]);_0x4a8e87[_0x845e('0x38')]=_[_0x845e('0x39')](_0x4a8e87['model'],_0x4a8e87['query']);_0x8dbae0['attributes']=_['intersection'](_0x4a8e87['model'],qs[_0x845e('0x3a')](_0x49605b[_0x845e('0x36')][_0x845e('0x3a')]));_0x8dbae0[_0x845e('0x3b')]=_0x8dbae0['attributes']['length']?_0x8dbae0[_0x845e('0x3b')]:_0x4a8e87[_0x845e('0x35')];if(!_0x49605b['query'][_0x845e('0x3c')](_0x845e('0x3d'))){_0x8dbae0[_0x845e('0x1f')]=qs[_0x845e('0x1f')](_0x49605b['query'][_0x845e('0x1f')]);_0x8dbae0[_0x845e('0x21')]=qs[_0x845e('0x21')](_0x49605b[_0x845e('0x36')][_0x845e('0x21')]);}_0x8dbae0['order']=qs['sort'](_0x49605b[_0x845e('0x36')][_0x845e('0x3e')]);_0x8dbae0[_0x845e('0x3f')]=qs[_0x845e('0x38')](_[_0x845e('0x40')](_0x49605b['query'],_0x4a8e87['filters']),_0x4b0a1b);if(_0x49605b[_0x845e('0x36')][_0x845e('0x41')]){_0x8dbae0[_0x845e('0x3f')]=_[_0x845e('0x42')](_0x8dbae0[_0x845e('0x3f')],{'$or':_[_0x845e('0x30')](_0x4b0a1b,function(_0x312da8){if(_0x312da8['type']!==_0x845e('0x43')){var _0x5c9d34={};_0x5c9d34[_0x312da8[_0x845e('0x2e')]]={'$like':'%'+_0x49605b['query']['filter']+'%'};return _0x5c9d34;}})});}_0x8dbae0=_[_0x845e('0x42')]({},_0x8dbae0,_0x49605b[_0x845e('0x44')]);var _0x563895={'where':_0x8dbae0[_0x845e('0x3f')]};return db[_0x845e('0x31')][_0x845e('0x20')](_0x563895)[_0x845e('0x29')](function(_0x4809c1){_0x29185d[_0x845e('0x20')]=_0x4809c1;if(_0x49605b[_0x845e('0x36')]['includeAll']){_0x8dbae0[_0x845e('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x845e('0x46')](_0x8dbae0);})[_0x845e('0x29')](function(_0x563bfe){_0x29185d['rows']=_0x563bfe;return _0x29185d;})[_0x845e('0x29')](respondWithFilteredResult(_0x37b543,_0x8dbae0))[_0x845e('0x47')](handleError(_0x37b543,null));};exports[_0x845e('0x48')]=function(_0x2e4df4,_0x1e0796){var _0xa291f5={'raw':!![],'where':{'id':_0x2e4df4[_0x845e('0x49')]['id']}},_0x198295={};_0x198295[_0x845e('0x35')]=_[_0x845e('0x37')](db[_0x845e('0x31')][_0x845e('0x32')]);_0x198295[_0x845e('0x36')]=_[_0x845e('0x37')](_0x2e4df4[_0x845e('0x36')]);_0x198295[_0x845e('0x38')]=_[_0x845e('0x39')](_0x198295[_0x845e('0x35')],_0x198295[_0x845e('0x36')]);_0xa291f5[_0x845e('0x3b')]=_[_0x845e('0x39')](_0x198295[_0x845e('0x35')],qs[_0x845e('0x3a')](_0x2e4df4[_0x845e('0x36')][_0x845e('0x3a')]));_0xa291f5[_0x845e('0x3b')]=_0xa291f5['attributes'][_0x845e('0x4a')]?_0xa291f5[_0x845e('0x3b')]:_0x198295[_0x845e('0x35')];if(_0x2e4df4[_0x845e('0x36')][_0x845e('0x4b')]){_0xa291f5[_0x845e('0x45')]=[{'all':!![]}];}_0xa291f5=_[_0x845e('0x42')]({},_0xa291f5,_0x2e4df4[_0x845e('0x44')]);return db[_0x845e('0x31')][_0x845e('0x4c')](_0xa291f5)[_0x845e('0x29')](handleEntityNotFound(_0x1e0796,null))['then'](respondWithResult(_0x1e0796,null))[_0x845e('0x47')](handleError(_0x1e0796,null));};exports[_0x845e('0x4d')]=function(_0x5a8ca0,_0x177254){return db[_0x845e('0x31')][_0x845e('0x4d')](_0x5a8ca0[_0x845e('0x4e')],{})[_0x845e('0x29')](respondWithResult(_0x177254,0xc9))[_0x845e('0x47')](handleError(_0x177254,null));};exports[_0x845e('0x28')]=function(_0x5ba1e1,_0x27002b){if(_0x5ba1e1[_0x845e('0x4e')]['id']){delete _0x5ba1e1[_0x845e('0x4e')]['id'];}return db['OpenchannelQueueReport'][_0x845e('0x4c')]({'where':{'id':_0x5ba1e1[_0x845e('0x49')]['id']}})[_0x845e('0x29')](handleEntityNotFound(_0x27002b,null))['then'](saveUpdates(_0x5ba1e1['body'],null))[_0x845e('0x29')](respondWithResult(_0x27002b,null))['catch'](handleError(_0x27002b,null));};exports['destroy']=function(_0x447c6e,_0x19f7fc){return db[_0x845e('0x31')][_0x845e('0x4c')]({'where':{'id':_0x447c6e['params']['id']}})['then'](handleEntityNotFound(_0x19f7fc,null))[_0x845e('0x29')](removeEntity(_0x19f7fc,null))[_0x845e('0x47')](handleError(_0x19f7fc,null));};exports[_0x845e('0x4f')]=function(_0x23c058,_0x110048){return db['OpenchannelQueueReport'][_0x845e('0x4f')]()[_0x845e('0x29')](respondWithResult(_0x110048,null))['catch'](handleError(_0x110048,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index cb4b6ec..9497695 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x36fad6,_0x2f6236){var _0x34fdf1=function(_0x5a12d4){while(--_0x5a12d4){_0x36fad6['push'](_0x36fad6['shift']());}};_0x34fdf1(++_0x2f6236);}(_0x1261,0x144));var _0x1126=function(_0x1bcc92,_0x4929b8){_0x1bcc92=_0x1bcc92-0x0;var _0x88406a=_0x1261[_0x1bcc92];return _0x88406a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x14024d,_0x33a94b){var _0x365fe6=function(_0x5c7e03){while(--_0x5c7e03){_0x14024d['push'](_0x14024d['shift']());}};_0x365fe6(++_0x33a94b);}(_0x326f,0xd1));var _0xf326=function(_0xe9b54c,_0x440c63){_0xe9b54c=_0xe9b54c-0x0;var _0x10d3fe=_0x326f[_0xe9b54c];return _0x10d3fe;};'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 46116f7..d2be98d 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 _0x6582=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2cace4,_0x332aa3){var _0x46d414=function(_0x4236b4){while(--_0x4236b4){_0x2cace4['push'](_0x2cace4['shift']());}};_0x46d414(++_0x332aa3);}(_0x6582,0x108));var _0x2658=function(_0x4070a0,_0x523f5d){_0x4070a0=_0x4070a0-0x0;var _0x55c11e=_0x6582[_0x4070a0];return _0x55c11e;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}exports['CreateOpenchannelQueueReport']=function(_0x4eb90d){var _0x57337e=this;return new Promise(function(_0xf4193a,_0x260fc7){return db[_0x2658('0x16')][_0x2658('0x17')](_0x4eb90d['body'],{'raw':_0x4eb90d[_0x2658('0x18')]?_0x4eb90d[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![]})[_0x2658('0xb')](function(_0x23cf70){logger[_0x2658('0xc')]('CreateOpenchannelQueueReport',_0x4eb90d);logger[_0x2658('0xf')]('CreateOpenchannelQueueReport',_0x4eb90d,JSON['stringify'](_0x23cf70));_0xf4193a(_0x23cf70);})[_0x2658('0x15')](function(_0x132000){logger['error'](_0x2658('0x1a'),_0x132000['message'],_0x4eb90d);_0x260fc7(_0x57337e[_0x2658('0x11')](0x1f4,_0x132000[_0x2658('0x13')]));});});};exports[_0x2658('0x1b')]=function(_0x2e6d6a){var _0x31231c=this;return new Promise(function(_0x2e80fc,_0xe9f81){return db[_0x2658('0x16')][_0x2658('0x1c')](_0x2e6d6a[_0x2658('0x1d')],{'raw':_0x2e6d6a['options']?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x1e')]||null:null,'attributes':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a['options'][_0x2658('0x1f')]||null:null,'limit':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x20')]||null:null})[_0x2658('0xb')](function(_0x1492cb){logger[_0x2658('0xc')](_0x2658('0x1b'),_0x2e6d6a);logger[_0x2658('0xf')](_0x2658('0x1b'),_0x2e6d6a,JSON[_0x2658('0x21')](_0x1492cb));_0x2e80fc(_0x1492cb);})[_0x2658('0x15')](function(_0x291bb4){logger[_0x2658('0x11')](_0x2658('0x1b'),_0x291bb4[_0x2658('0x13')],_0x2e6d6a);_0xe9f81(_0x31231c[_0x2658('0x11')](0x1f4,_0x291bb4[_0x2658('0x13')]));});});}; \ No newline at end of file +var _0x4227=['CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','UpdateOpenchannelQueueReport','update','raw','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x5746a1,_0x11eab1){var _0x551a43=function(_0x7ddcbe){while(--_0x7ddcbe){_0x5746a1['push'](_0x5746a1['shift']());}};_0x551a43(++_0x11eab1);}(_0x4227,0x89));var _0x7422=function(_0x247679,_0x10a08a){_0x247679=_0x247679-0x0;var _0x42e111=_0x4227[_0x247679];return _0x42e111;};'use strict';var _=require(_0x7422('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7422('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7422('0x2'));var db=require(_0x7422('0x3'))['db'];var utils=require(_0x7422('0x4'));var logger=require('../../config/logger')(_0x7422('0x5'));var config=require(_0x7422('0x6'));var jayson=require(_0x7422('0x7'));var client=jayson[_0x7422('0x8')][_0x7422('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b3432,_0xe99299,_0x45ca1a){return new BPromise(function(_0x12965e,_0x599d78){return client[_0x7422('0xa')](_0x2b3432,_0x45ca1a)[_0x7422('0xb')](function(_0x25de34){logger['info'](_0x7422('0xc'),_0xe99299,'request\x20sent');logger[_0x7422('0xd')](_0x7422('0xe'),_0xe99299,_0x7422('0xf'),JSON[_0x7422('0x10')](_0x25de34));if(_0x25de34[_0x7422('0x11')]){if(_0x25de34['error'][_0x7422('0x12')]===0x1f4){logger[_0x7422('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe99299,_0x25de34[_0x7422('0x11')][_0x7422('0x13')]);return _0x599d78(_0x25de34['error'][_0x7422('0x13')]);}logger[_0x7422('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe99299,_0x25de34['error'][_0x7422('0x13')]);return _0x12965e(_0x25de34['error'][_0x7422('0x13')]);}else{logger[_0x7422('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe99299,_0x7422('0xf'));_0x12965e(_0x25de34[_0x7422('0x15')][_0x7422('0x13')]);}})[_0x7422('0x16')](function(_0x2946ca){logger[_0x7422('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe99299,_0x2946ca);_0x599d78(_0x2946ca);});});}exports[_0x7422('0x17')]=function(_0xa7ff41){var _0x493f59=this;return new Promise(function(_0x30656d,_0x57b8bf){return db[_0x7422('0x18')]['create'](_0xa7ff41[_0x7422('0x19')],{'raw':_0xa7ff41[_0x7422('0x1a')]?_0xa7ff41[_0x7422('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7422('0xb')](function(_0xacaad1){logger[_0x7422('0x14')](_0x7422('0x17'),_0xa7ff41);logger['debug']('CreateOpenchannelQueueReport',_0xa7ff41,JSON[_0x7422('0x10')](_0xacaad1));_0x30656d(_0xacaad1);})[_0x7422('0x16')](function(_0x20c1e3){logger[_0x7422('0x11')](_0x7422('0x17'),_0x20c1e3[_0x7422('0x13')],_0xa7ff41);_0x57b8bf(_0x493f59[_0x7422('0x11')](0x1f4,_0x20c1e3['message']));});});};exports[_0x7422('0x1b')]=function(_0x46b927){var _0x4fc200=this;return new Promise(function(_0x3a5a0c,_0x23fb68){return db[_0x7422('0x18')][_0x7422('0x1c')](_0x46b927['body'],{'raw':_0x46b927[_0x7422('0x1a')]?_0x46b927[_0x7422('0x1a')][_0x7422('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46b927[_0x7422('0x1a')]?_0x46b927[_0x7422('0x1a')]['where']||null:null,'attributes':_0x46b927[_0x7422('0x1a')]?_0x46b927[_0x7422('0x1a')][_0x7422('0x1e')]||null:null,'limit':_0x46b927[_0x7422('0x1a')]?_0x46b927['options'][_0x7422('0x1f')]||null:null})[_0x7422('0xb')](function(_0x9b0144){logger[_0x7422('0x14')]('UpdateOpenchannelQueueReport',_0x46b927);logger[_0x7422('0xd')](_0x7422('0x1b'),_0x46b927,JSON['stringify'](_0x9b0144));_0x3a5a0c(_0x9b0144);})['catch'](function(_0x2baac6){logger[_0x7422('0x11')]('UpdateOpenchannelQueueReport',_0x2baac6[_0x7422('0x13')],_0x46b927);_0x23fb68(_0x4fc200[_0x7422('0x11')](0x1f4,_0x2baac6[_0x7422('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 85bf583..0d885ba 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 _0xddf6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','update','delete','exports','util','path','express'];(function(_0x381419,_0x3ea8b9){var _0x46cb10=function(_0x54a7c3){while(--_0x54a7c3){_0x381419['push'](_0x381419['shift']());}};_0x46cb10(++_0x3ea8b9);}(_0xddf6,0x1c9));var _0x6ddf=function(_0x82769e,_0x56597b){_0x82769e=_0x82769e-0x0;var _0x234a7e=_0xddf6[_0x82769e];return _0x234a7e;};'use strict';var multer=require('multer');var util=require(_0x6ddf('0x0'));var path=require(_0x6ddf('0x1'));var timeout=require('connect-timeout');var express=require(_0x6ddf('0x2'));var router=express[_0x6ddf('0x3')]();var fs_extra=require(_0x6ddf('0x4'));var auth=require(_0x6ddf('0x5'));var interaction=require(_0x6ddf('0x6'));var config=require(_0x6ddf('0x7'));var controller=require(_0x6ddf('0x8'));router['get']('/',auth[_0x6ddf('0x9')](),controller[_0x6ddf('0xa')]);router[_0x6ddf('0xb')](_0x6ddf('0xc'),auth[_0x6ddf('0x9')](),controller[_0x6ddf('0xd')]);router[_0x6ddf('0xb')](_0x6ddf('0xe'),auth[_0x6ddf('0x9')](),controller['show']);router[_0x6ddf('0xf')]('/',auth[_0x6ddf('0x9')](),controller[_0x6ddf('0x10')]);router['put'](_0x6ddf('0xe'),auth['isAuthenticated'](),controller[_0x6ddf('0x11')]);router[_0x6ddf('0x12')]('/:id',auth[_0x6ddf('0x9')](),controller['destroy']);module[_0x6ddf('0x13')]=router; \ No newline at end of file +var _0xec7a=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','util','path'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xec7a,0x1da));var _0xaec7=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xec7a[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require('multer');var util=require(_0xaec7('0x0'));var path=require(_0xaec7('0x1'));var timeout=require(_0xaec7('0x2'));var express=require(_0xaec7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaec7('0x4'));var interaction=require(_0xaec7('0x5'));var config=require(_0xaec7('0x6'));var controller=require(_0xaec7('0x7'));router[_0xaec7('0x8')]('/',auth[_0xaec7('0x9')](),controller[_0xaec7('0xa')]);router[_0xaec7('0x8')]('/describe',auth[_0xaec7('0x9')](),controller['describe']);router[_0xaec7('0x8')](_0xaec7('0xb'),auth[_0xaec7('0x9')](),controller['show']);router[_0xaec7('0xc')]('/',auth[_0xaec7('0x9')](),controller['create']);router[_0xaec7('0xd')](_0xaec7('0xb'),auth[_0xaec7('0x9')](),controller[_0xaec7('0xe')]);router[_0xaec7('0xf')](_0xaec7('0xb'),auth[_0xaec7('0x9')](),controller[_0xaec7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index dcafefd..c211562 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x7b341f,_0x11e481){var _0x46d0a1=function(_0x6f779d){while(--_0x6f779d){_0x7b341f['push'](_0x7b341f['shift']());}};_0x46d0a1(++_0x11e481);}(_0x34e8,0x12c));var _0x834e=function(_0x3e57fc,_0x2515b3){_0x3e57fc=_0x3e57fc-0x0;var _0x4e5d7f=_0x34e8[_0x3e57fc];return _0x4e5d7f;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x257783,_0x46c493){var _0x51f212=function(_0x419031){while(--_0x419031){_0x257783['push'](_0x257783['shift']());}};_0x51f212(++_0x46c493);}(_0xf4eb,0xec));var _0xbf4e=function(_0x28c319,_0x4d78ad){_0x28c319=_0x28c319-0x0;var _0x129651=_0xf4eb[_0x28c319];return _0x129651;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 987b033..951ccc5 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 _0x0084=['fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','include','findAll','catch','keys','length','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x0084,0x15c));var _0x4008=function(_0x41397b,_0x481d0e){_0x41397b=_0x41397b-0x0;var _0x5f4677=_0x0084[_0x41397b];return _0x5f4677;};'use strict';var emlformat=require(_0x4008('0x0'));var rimraf=require(_0x4008('0x1'));var zipdir=require(_0x4008('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4008('0x3'));var moment=require(_0x4008('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4008('0x5'));var util=require('util');var path=require(_0x4008('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4008('0x7'));var _=require('lodash');var squel=require(_0x4008('0x8'));var crypto=require(_0x4008('0x9'));var jsforce=require(_0x4008('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4008('0xb'));var querystring=require(_0x4008('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4008('0xd'));var qs=require(_0x4008('0xe'));var as=require(_0x4008('0xf'));var hardwareService=require(_0x4008('0x10'));var logger=require(_0x4008('0x11'))(_0x4008('0x12'));var utils=require(_0x4008('0x13'));var config=require(_0x4008('0x14'));var licenseUtil=require(_0x4008('0x15'));var db=require(_0x4008('0x16'))['db'];function respondWithStatusCode(_0x2c4d09,_0x853501){_0x853501=_0x853501||0xcc;return function(_0x30844b){if(_0x30844b){return _0x2c4d09['sendStatus'](_0x853501);}return _0x2c4d09['status'](_0x853501)[_0x4008('0x17')]();};}function respondWithResult(_0x462c32,_0x23c0d4){_0x23c0d4=_0x23c0d4||0xc8;return function(_0x5b17b9){if(_0x5b17b9){return _0x462c32[_0x4008('0x18')](_0x23c0d4)[_0x4008('0x19')](_0x5b17b9);}};}function respondWithFilteredResult(_0x48016c,_0x5359dd){return function(_0xabb217){if(_0xabb217){var _0x16013d=typeof _0x5359dd[_0x4008('0x1a')]==='undefined'&&typeof _0x5359dd['limit']===_0x4008('0x1b');var _0x382791=_0xabb217[_0x4008('0x1c')];var _0x490068=_0x16013d?0x0:_0x5359dd[_0x4008('0x1a')];var _0x592193=_0x16013d?_0xabb217[_0x4008('0x1c')]:_0x5359dd[_0x4008('0x1a')]+_0x5359dd['limit'];var _0x5d9a3;if(_0x592193>=_0x382791){_0x592193=_0x382791;_0x5d9a3=0xc8;}else{_0x5d9a3=0xce;}_0x48016c['status'](_0x5d9a3);return _0x48016c[_0x4008('0x1d')]('Content-Range',_0x490068+'-'+_0x592193+'/'+_0x382791)[_0x4008('0x19')](_0xabb217);}return null;};}function patchUpdates(_0x2f48fa){return function(_0x997555){try{jsonpatch[_0x4008('0x1e')](_0x997555,_0x2f48fa,!![]);}catch(_0x567795){return BPromise[_0x4008('0x1f')](_0x567795);}return _0x997555['save']();};}function saveUpdates(_0x21c6e9,_0x4f53c6){return function(_0x33b57a){if(_0x33b57a){return _0x33b57a[_0x4008('0x20')](_0x21c6e9)['then'](function(_0x51ad6e){return _0x51ad6e;});}return null;};}function removeEntity(_0x42e288,_0x57ae5b){return function(_0x2c7992){if(_0x2c7992){return _0x2c7992[_0x4008('0x21')]()[_0x4008('0x22')](function(){_0x42e288[_0x4008('0x18')](0xcc)[_0x4008('0x17')]();});}};}function handleEntityNotFound(_0x29e353,_0x1fc396){return function(_0x690294){if(!_0x690294){_0x29e353[_0x4008('0x23')](0x194);}return _0x690294;};}function handleError(_0x10134a,_0x21c701){_0x21c701=_0x21c701||0x1f4;return function(_0xacae8a){logger[_0x4008('0x24')](_0xacae8a[_0x4008('0x25')]);if(_0xacae8a[_0x4008('0x26')]){delete _0xacae8a['name'];}_0x10134a[_0x4008('0x18')](_0x21c701)['send'](_0xacae8a);};}exports['index']=function(_0x2e29d4,_0x4e5fe4){var _0x1f7793={},_0x3e4c18={},_0x3168bd={'count':0x0,'rows':[]};var _0x237cf7=_['map'](db[_0x4008('0x27')][_0x4008('0x28')],function(_0x2af3d3){return{'name':_0x2af3d3[_0x4008('0x29')],'type':_0x2af3d3[_0x4008('0x2a')][_0x4008('0x2b')]};});_0x3e4c18[_0x4008('0x2c')]=_[_0x4008('0x2d')](_0x237cf7,_0x4008('0x26'));_0x3e4c18[_0x4008('0x2e')]=_['keys'](_0x2e29d4[_0x4008('0x2e')]);_0x3e4c18['filters']=_[_0x4008('0x2f')](_0x3e4c18[_0x4008('0x2c')],_0x3e4c18[_0x4008('0x2e')]);_0x1f7793[_0x4008('0x30')]=_[_0x4008('0x2f')](_0x3e4c18[_0x4008('0x2c')],qs['fields'](_0x2e29d4[_0x4008('0x2e')][_0x4008('0x31')]));_0x1f7793[_0x4008('0x30')]=_0x1f7793[_0x4008('0x30')]['length']?_0x1f7793[_0x4008('0x30')]:_0x3e4c18[_0x4008('0x2c')];if(!_0x2e29d4[_0x4008('0x2e')]['hasOwnProperty'](_0x4008('0x32'))){_0x1f7793[_0x4008('0x33')]=qs[_0x4008('0x33')](_0x2e29d4[_0x4008('0x2e')][_0x4008('0x33')]);_0x1f7793[_0x4008('0x1a')]=qs['offset'](_0x2e29d4[_0x4008('0x2e')][_0x4008('0x1a')]);}_0x1f7793[_0x4008('0x34')]=qs['sort'](_0x2e29d4['query'][_0x4008('0x35')]);_0x1f7793[_0x4008('0x36')]=qs[_0x4008('0x37')](_[_0x4008('0x38')](_0x2e29d4[_0x4008('0x2e')],_0x3e4c18[_0x4008('0x37')]),_0x237cf7);if(_0x2e29d4[_0x4008('0x2e')]['filter']){_0x1f7793['where']=_[_0x4008('0x39')](_0x1f7793[_0x4008('0x36')],{'$or':_[_0x4008('0x2d')](_0x237cf7,function(_0x559127){if(_0x559127[_0x4008('0x2a')]!=='VIRTUAL'){var _0xbee076={};_0xbee076[_0x559127[_0x4008('0x26')]]={'$like':'%'+_0x2e29d4[_0x4008('0x2e')][_0x4008('0x3a')]+'%'};return _0xbee076;}})});}_0x1f7793=_[_0x4008('0x39')]({},_0x1f7793,_0x2e29d4[_0x4008('0x3b')]);var _0x5d1651={'where':_0x1f7793[_0x4008('0x36')]};return db[_0x4008('0x27')][_0x4008('0x1c')](_0x5d1651)['then'](function(_0x110b81){_0x3168bd[_0x4008('0x1c')]=_0x110b81;if(_0x2e29d4[_0x4008('0x2e')]['includeAll']){_0x1f7793[_0x4008('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x4008('0x3d')](_0x1f7793);})['then'](function(_0x2e9adc){_0x3168bd['rows']=_0x2e9adc;return _0x3168bd;})[_0x4008('0x22')](respondWithFilteredResult(_0x4e5fe4,_0x1f7793))[_0x4008('0x3e')](handleError(_0x4e5fe4,null));};exports['show']=function(_0x21b015,_0x44c25d){var _0x2f3bfc={'raw':!![],'where':{'id':_0x21b015['params']['id']}},_0x3c913e={};_0x3c913e[_0x4008('0x2c')]=_[_0x4008('0x3f')](db[_0x4008('0x27')][_0x4008('0x28')]);_0x3c913e[_0x4008('0x2e')]=_[_0x4008('0x3f')](_0x21b015[_0x4008('0x2e')]);_0x3c913e[_0x4008('0x37')]=_[_0x4008('0x2f')](_0x3c913e[_0x4008('0x2c')],_0x3c913e[_0x4008('0x2e')]);_0x2f3bfc[_0x4008('0x30')]=_['intersection'](_0x3c913e[_0x4008('0x2c')],qs[_0x4008('0x31')](_0x21b015[_0x4008('0x2e')][_0x4008('0x31')]));_0x2f3bfc['attributes']=_0x2f3bfc['attributes'][_0x4008('0x40')]?_0x2f3bfc[_0x4008('0x30')]:_0x3c913e['model'];if(_0x21b015[_0x4008('0x2e')][_0x4008('0x41')]){_0x2f3bfc[_0x4008('0x3c')]=[{'all':!![]}];}_0x2f3bfc=_[_0x4008('0x39')]({},_0x2f3bfc,_0x21b015[_0x4008('0x3b')]);return db['OpenchannelTransferReport']['find'](_0x2f3bfc)['then'](handleEntityNotFound(_0x44c25d,null))[_0x4008('0x22')](respondWithResult(_0x44c25d,null))[_0x4008('0x3e')](handleError(_0x44c25d,null));};exports[_0x4008('0x42')]=function(_0x11d5cc,_0x277a8c){return db['OpenchannelTransferReport'][_0x4008('0x42')](_0x11d5cc['body'],{})[_0x4008('0x22')](respondWithResult(_0x277a8c,0xc9))[_0x4008('0x3e')](handleError(_0x277a8c,null));};exports[_0x4008('0x20')]=function(_0x3e7f8b,_0x1000bb){if(_0x3e7f8b[_0x4008('0x43')]['id']){delete _0x3e7f8b['body']['id'];}return db[_0x4008('0x27')][_0x4008('0x44')]({'where':{'id':_0x3e7f8b[_0x4008('0x45')]['id']}})[_0x4008('0x22')](handleEntityNotFound(_0x1000bb,null))[_0x4008('0x22')](saveUpdates(_0x3e7f8b['body'],null))[_0x4008('0x22')](respondWithResult(_0x1000bb,null))[_0x4008('0x3e')](handleError(_0x1000bb,null));};exports[_0x4008('0x21')]=function(_0x237efa,_0xa8cc9c){return db[_0x4008('0x27')]['find']({'where':{'id':_0x237efa[_0x4008('0x45')]['id']}})['then'](handleEntityNotFound(_0xa8cc9c,null))[_0x4008('0x22')](removeEntity(_0xa8cc9c,null))[_0x4008('0x3e')](handleError(_0xa8cc9c,null));};exports[_0x4008('0x46')]=function(_0x397468,_0x1038f3){return db[_0x4008('0x27')]['describe']()['then'](respondWithResult(_0x1038f3,null))[_0x4008('0x3e')](handleError(_0x1038f3,null));}; \ No newline at end of file +var _0xb1ab=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','error','name','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43af7b,_0x3891d9){var _0x5ab131=function(_0x42f585){while(--_0x42f585){_0x43af7b['push'](_0x43af7b['shift']());}};_0x5ab131(++_0x3891d9);}(_0xb1ab,0x11c));var _0xbb1a=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb1ab[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0xbb1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb1a('0x1'));var jsonpatch=require(_0xbb1a('0x2'));var rp=require(_0xbb1a('0x3'));var moment=require(_0xbb1a('0x4'));var BPromise=require(_0xbb1a('0x5'));var Mustache=require('mustache');var util=require(_0xbb1a('0x6'));var path=require(_0xbb1a('0x7'));var sox=require(_0xbb1a('0x8'));var csv=require(_0xbb1a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb1a('0xa'));var _=require(_0xbb1a('0xb'));var squel=require(_0xbb1a('0xc'));var crypto=require(_0xbb1a('0xd'));var jsforce=require(_0xbb1a('0xe'));var deskjs=require(_0xbb1a('0xf'));var toCsv=require(_0xbb1a('0x9'));var querystring=require(_0xbb1a('0x10'));var Papa=require(_0xbb1a('0x11'));var Redis=require('ioredis');var authService=require(_0xbb1a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbb1a('0x13'));var hardwareService=require(_0xbb1a('0x14'));var logger=require(_0xbb1a('0x15'))('api');var utils=require(_0xbb1a('0x16'));var config=require(_0xbb1a('0x17'));var licenseUtil=require(_0xbb1a('0x18'));var db=require(_0xbb1a('0x19'))['db'];function respondWithStatusCode(_0x2d151b,_0x1158d0){_0x1158d0=_0x1158d0||0xcc;return function(_0x170065){if(_0x170065){return _0x2d151b['sendStatus'](_0x1158d0);}return _0x2d151b[_0xbb1a('0x1a')](_0x1158d0)[_0xbb1a('0x1b')]();};}function respondWithResult(_0x22b7d2,_0x1a87f4){_0x1a87f4=_0x1a87f4||0xc8;return function(_0xb409b5){if(_0xb409b5){return _0x22b7d2['status'](_0x1a87f4)[_0xbb1a('0x1c')](_0xb409b5);}};}function respondWithFilteredResult(_0x31f3da,_0x45be32){return function(_0x142d3c){if(_0x142d3c){var _0x1a00e3=typeof _0x45be32[_0xbb1a('0x1d')]===_0xbb1a('0x1e')&&typeof _0x45be32[_0xbb1a('0x1f')]==='undefined';var _0x4f7a79=_0x142d3c['count'];var _0x49b8d1=_0x1a00e3?0x0:_0x45be32[_0xbb1a('0x1d')];var _0x5d89b1=_0x1a00e3?_0x142d3c['count']:_0x45be32[_0xbb1a('0x1d')]+_0x45be32[_0xbb1a('0x1f')];var _0x2cefed;if(_0x5d89b1>=_0x4f7a79){_0x5d89b1=_0x4f7a79;_0x2cefed=0xc8;}else{_0x2cefed=0xce;}_0x31f3da[_0xbb1a('0x1a')](_0x2cefed);return _0x31f3da['set'](_0xbb1a('0x20'),_0x49b8d1+'-'+_0x5d89b1+'/'+_0x4f7a79)[_0xbb1a('0x1c')](_0x142d3c);}return null;};}function patchUpdates(_0xfabd72){return function(_0x1de59e){try{jsonpatch['apply'](_0x1de59e,_0xfabd72,!![]);}catch(_0x486f7c){return BPromise[_0xbb1a('0x21')](_0x486f7c);}return _0x1de59e[_0xbb1a('0x22')]();};}function saveUpdates(_0xc4cc65,_0x58f209){return function(_0x23745e){if(_0x23745e){return _0x23745e[_0xbb1a('0x23')](_0xc4cc65)[_0xbb1a('0x24')](function(_0x1e6bec){return _0x1e6bec;});}return null;};}function removeEntity(_0x5a03b1,_0x822a59){return function(_0x5f1539){if(_0x5f1539){return _0x5f1539[_0xbb1a('0x25')]()[_0xbb1a('0x24')](function(){_0x5a03b1[_0xbb1a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2237,_0x5689db){return function(_0x517652){if(!_0x517652){_0x3a2237['sendStatus'](0x194);}return _0x517652;};}function handleError(_0x5da1cc,_0x33581f){_0x33581f=_0x33581f||0x1f4;return function(_0x3db7c7){logger[_0xbb1a('0x26')](_0x3db7c7['stack']);if(_0x3db7c7['name']){delete _0x3db7c7[_0xbb1a('0x27')];}_0x5da1cc[_0xbb1a('0x1a')](_0x33581f)['send'](_0x3db7c7);};}exports[_0xbb1a('0x28')]=function(_0x167a35,_0x255146){var _0x27af0b={},_0x41c117={},_0x242aa5={'count':0x0,'rows':[]};var _0x58c73f=_['map'](db[_0xbb1a('0x29')][_0xbb1a('0x2a')],function(_0x506756){return{'name':_0x506756[_0xbb1a('0x2b')],'type':_0x506756[_0xbb1a('0x2c')][_0xbb1a('0x2d')]};});_0x41c117[_0xbb1a('0x2e')]=_[_0xbb1a('0x2f')](_0x58c73f,'name');_0x41c117[_0xbb1a('0x30')]=_[_0xbb1a('0x31')](_0x167a35[_0xbb1a('0x30')]);_0x41c117[_0xbb1a('0x32')]=_[_0xbb1a('0x33')](_0x41c117['model'],_0x41c117[_0xbb1a('0x30')]);_0x27af0b[_0xbb1a('0x34')]=_['intersection'](_0x41c117['model'],qs[_0xbb1a('0x35')](_0x167a35['query']['fields']));_0x27af0b[_0xbb1a('0x34')]=_0x27af0b[_0xbb1a('0x34')][_0xbb1a('0x36')]?_0x27af0b[_0xbb1a('0x34')]:_0x41c117['model'];if(!_0x167a35[_0xbb1a('0x30')][_0xbb1a('0x37')](_0xbb1a('0x38'))){_0x27af0b[_0xbb1a('0x1f')]=qs[_0xbb1a('0x1f')](_0x167a35[_0xbb1a('0x30')][_0xbb1a('0x1f')]);_0x27af0b[_0xbb1a('0x1d')]=qs[_0xbb1a('0x1d')](_0x167a35[_0xbb1a('0x30')]['offset']);}_0x27af0b[_0xbb1a('0x39')]=qs[_0xbb1a('0x3a')](_0x167a35['query'][_0xbb1a('0x3a')]);_0x27af0b[_0xbb1a('0x3b')]=qs[_0xbb1a('0x32')](_['pick'](_0x167a35[_0xbb1a('0x30')],_0x41c117[_0xbb1a('0x32')]),_0x58c73f);if(_0x167a35[_0xbb1a('0x30')][_0xbb1a('0x3c')]){_0x27af0b[_0xbb1a('0x3b')]=_[_0xbb1a('0x3d')](_0x27af0b[_0xbb1a('0x3b')],{'$or':_[_0xbb1a('0x2f')](_0x58c73f,function(_0x1666e5){if(_0x1666e5[_0xbb1a('0x2c')]!=='VIRTUAL'){var _0xb6c59b={};_0xb6c59b[_0x1666e5[_0xbb1a('0x27')]]={'$like':'%'+_0x167a35['query']['filter']+'%'};return _0xb6c59b;}})});}_0x27af0b=_['merge']({},_0x27af0b,_0x167a35['options']);var _0x50ee40={'where':_0x27af0b[_0xbb1a('0x3b')]};return db[_0xbb1a('0x29')][_0xbb1a('0x3e')](_0x50ee40)[_0xbb1a('0x24')](function(_0x52f540){_0x242aa5[_0xbb1a('0x3e')]=_0x52f540;if(_0x167a35[_0xbb1a('0x30')][_0xbb1a('0x3f')]){_0x27af0b[_0xbb1a('0x40')]=[{'all':!![]}];}return db[_0xbb1a('0x29')][_0xbb1a('0x41')](_0x27af0b);})[_0xbb1a('0x24')](function(_0x1ed6d1){_0x242aa5[_0xbb1a('0x42')]=_0x1ed6d1;return _0x242aa5;})[_0xbb1a('0x24')](respondWithFilteredResult(_0x255146,_0x27af0b))[_0xbb1a('0x43')](handleError(_0x255146,null));};exports[_0xbb1a('0x44')]=function(_0x2326f8,_0x37913b){var _0x2537aa={'raw':!![],'where':{'id':_0x2326f8[_0xbb1a('0x45')]['id']}},_0x4a96a7={};_0x4a96a7[_0xbb1a('0x2e')]=_['keys'](db[_0xbb1a('0x29')][_0xbb1a('0x2a')]);_0x4a96a7[_0xbb1a('0x30')]=_['keys'](_0x2326f8['query']);_0x4a96a7[_0xbb1a('0x32')]=_[_0xbb1a('0x33')](_0x4a96a7[_0xbb1a('0x2e')],_0x4a96a7[_0xbb1a('0x30')]);_0x2537aa['attributes']=_[_0xbb1a('0x33')](_0x4a96a7['model'],qs['fields'](_0x2326f8[_0xbb1a('0x30')][_0xbb1a('0x35')]));_0x2537aa[_0xbb1a('0x34')]=_0x2537aa[_0xbb1a('0x34')]['length']?_0x2537aa[_0xbb1a('0x34')]:_0x4a96a7[_0xbb1a('0x2e')];if(_0x2326f8['query'][_0xbb1a('0x3f')]){_0x2537aa['include']=[{'all':!![]}];}_0x2537aa=_[_0xbb1a('0x3d')]({},_0x2537aa,_0x2326f8[_0xbb1a('0x46')]);return db[_0xbb1a('0x29')]['find'](_0x2537aa)['then'](handleEntityNotFound(_0x37913b,null))[_0xbb1a('0x24')](respondWithResult(_0x37913b,null))[_0xbb1a('0x43')](handleError(_0x37913b,null));};exports[_0xbb1a('0x47')]=function(_0x1fba74,_0x698b66){return db[_0xbb1a('0x29')]['create'](_0x1fba74[_0xbb1a('0x48')],{})[_0xbb1a('0x24')](respondWithResult(_0x698b66,0xc9))[_0xbb1a('0x43')](handleError(_0x698b66,null));};exports[_0xbb1a('0x23')]=function(_0x4954ef,_0x2553e3){if(_0x4954ef[_0xbb1a('0x48')]['id']){delete _0x4954ef[_0xbb1a('0x48')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x4954ef[_0xbb1a('0x45')]['id']}})[_0xbb1a('0x24')](handleEntityNotFound(_0x2553e3,null))[_0xbb1a('0x24')](saveUpdates(_0x4954ef[_0xbb1a('0x48')],null))[_0xbb1a('0x24')](respondWithResult(_0x2553e3,null))[_0xbb1a('0x43')](handleError(_0x2553e3,null));};exports[_0xbb1a('0x25')]=function(_0x74932f,_0x1d7791){return db['OpenchannelTransferReport'][_0xbb1a('0x49')]({'where':{'id':_0x74932f['params']['id']}})[_0xbb1a('0x24')](handleEntityNotFound(_0x1d7791,null))[_0xbb1a('0x24')](removeEntity(_0x1d7791,null))[_0xbb1a('0x43')](handleError(_0x1d7791,null));};exports[_0xbb1a('0x4a')]=function(_0x55b49e,_0x4b1bae){return db[_0xbb1a('0x29')][_0xbb1a('0x4a')]()[_0xbb1a('0x24')](respondWithResult(_0x4b1bae,null))[_0xbb1a('0x43')](handleError(_0x4b1bae,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a7d9f9c..a448b2e 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 _0xfac9=['rimraf','../../config/environment','define','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','path'];(function(_0x2efe65,_0x2a975f){var _0xc0e056=function(_0x240eb8){while(--_0x240eb8){_0x2efe65['push'](_0x2efe65['shift']());}};_0xc0e056(++_0x2a975f);}(_0xfac9,0xc0));var _0x9fac=function(_0x598344,_0x234925){_0x598344=_0x598344-0x0;var _0x10c645=_0xfac9[_0x598344];return _0x10c645;};'use strict';var _=require(_0x9fac('0x0'));var util=require(_0x9fac('0x1'));var logger=require('../../config/logger')(_0x9fac('0x2'));var moment=require(_0x9fac('0x3'));var BPromise=require(_0x9fac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fac('0x5'));var rimraf=require(_0x9fac('0x6'));var config=require(_0x9fac('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x1a5a9f,_0x128921){return _0x1a5a9f[_0x9fac('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x9fac('0x9'),'paranoid':![],'indexes':[{'name':_0x9fac('0xa'),'fields':[_0x9fac('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4769=['define','OpenchannelTransferReport','uniqueid','lodash','api','moment','bluebird','rimraf','./openchannelTransferReport.attributes','exports'];(function(_0x39628c,_0x2eb8c4){var _0x2b0532=function(_0x87cc3b){while(--_0x87cc3b){_0x39628c['push'](_0x39628c['shift']());}};_0x2b0532(++_0x2eb8c4);}(_0x4769,0x1cf));var _0x9476=function(_0x3322ae,_0x4cba6e){_0x3322ae=_0x3322ae-0x0;var _0x32ff57=_0x4769[_0x3322ae];return _0x32ff57;};'use strict';var _=require(_0x9476('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9476('0x1'));var moment=require(_0x9476('0x2'));var BPromise=require(_0x9476('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9476('0x4'));var config=require('../../config/environment');var attributes=require(_0x9476('0x5'));module[_0x9476('0x6')]=function(_0xe3cc4a,_0x4b3007){return _0xe3cc4a[_0x9476('0x7')](_0x9476('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9476('0x9'),'fields':[_0x9476('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4177a77..644d6bb 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(_0x5bf9e0,_0x400291){var _0x2d4653=function(_0x365a64){while(--_0x365a64){_0x5bf9e0['push'](_0x5bf9e0['shift']());}};_0x2d4653(++_0x400291);}(_0xac31,0xca));var _0x1ac3=function(_0xf5c9d2,_0x6a0b7a){_0xf5c9d2=_0xf5c9d2-0x0;var _0x284675=_0xac31[_0xf5c9d2];return _0x284675;};'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 _0x9c5a=['http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x5dbf37,_0x2d14e8){var _0x3e11b4=function(_0x2983a5){while(--_0x2983a5){_0x5dbf37['push'](_0x5dbf37['shift']());}};_0x3e11b4(++_0x2d14e8);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x2ac783,_0xd9ad72){_0x2ac783=_0x2ac783-0x0;var _0x35f174=_0x9c5a[_0x2ac783];return _0x35f174;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var moment=require('moment');var BPromise=require(_0xa9c5('0x2'));var rs=require(_0xa9c5('0x3'));var fs=require('fs');var Redis=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9c5('0x6'))(_0xa9c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9c5('0x8'));var client=jayson['client'][_0xa9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3df556,_0x4cb597,_0x4b6db6){return new BPromise(function(_0x3d6b50,_0x16f331){return client['request'](_0x3df556,_0x4b6db6)[_0xa9c5('0xa')](function(_0x97f9e2){logger['info'](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4cb597,_0xa9c5('0xc'),JSON[_0xa9c5('0xd')](_0x97f9e2));if(_0x97f9e2[_0xa9c5('0xe')]){if(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0xf')]===0x1f4){logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x16f331(_0x97f9e2[_0xa9c5('0xe')]['message']);}logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x3d6b50(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);}else{logger[_0xa9c5('0x11')](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));_0x3d6b50(_0x97f9e2[_0xa9c5('0x12')]['message']);}})[_0xa9c5('0x13')](function(_0xd85c32){logger[_0xa9c5('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4cb597,_0xd85c32);_0x16f331(_0xd85c32);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index f152e56..1b58b76 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 _0xafac=['isAuthenticated','index','/:id','show','post','create','put','delete','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xafac,0x1f3));var _0xcafa=function(_0x18f90e,_0x25a7f8){_0x18f90e=_0x18f90e-0x0;var _0x11cb87=_0xafac[_0x18f90e];return _0x11cb87;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcafa('0x0'));var timeout=require(_0xcafa('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcafa('0x2'));var config=require(_0xcafa('0x3'));var controller=require(_0xcafa('0x4'));router['get']('/',auth[_0xcafa('0x5')](),controller[_0xcafa('0x6')]);router['get'](_0xcafa('0x7'),auth[_0xcafa('0x5')](),controller[_0xcafa('0x8')]);router[_0xcafa('0x9')]('/',auth[_0xcafa('0x5')](),controller[_0xcafa('0xa')]);router[_0xcafa('0xb')]('/:id',auth[_0xcafa('0x5')](),controller['update']);router[_0xcafa('0xc')](_0xcafa('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xcafa('0xd')]=router; \ No newline at end of file +var _0xd189=['index','show','post','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x4cf76f,_0x4e3488){var _0x387bb5=function(_0x5f5870){while(--_0x5f5870){_0x4cf76f['push'](_0x4cf76f['shift']());}};_0x387bb5(++_0x4e3488);}(_0xd189,0x9f));var _0x9d18=function(_0x15e7fc,_0x19803a){_0x15e7fc=_0x15e7fc-0x0;var _0x41a22f=_0xd189[_0x15e7fc];return _0x41a22f;};'use strict';var multer=require(_0x9d18('0x0'));var util=require(_0x9d18('0x1'));var path=require(_0x9d18('0x2'));var timeout=require(_0x9d18('0x3'));var express=require(_0x9d18('0x4'));var router=express[_0x9d18('0x5')]();var fs_extra=require(_0x9d18('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9d18('0x7'));var config=require(_0x9d18('0x8'));var controller=require(_0x9d18('0x9'));router[_0x9d18('0xa')]('/',auth[_0x9d18('0xb')](),controller[_0x9d18('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9d18('0xd')]);router[_0x9d18('0xe')]('/',auth[_0x9d18('0xb')](),controller[_0x9d18('0xf')]);router['put'](_0x9d18('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9d18('0x11')]('/:id',auth[_0x9d18('0xb')](),controller['destroy']);module[_0x9d18('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9b3fe03..92b7542 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 _0xa7b5=['name','sequelize','exports','STRING'];(function(_0x2d3d3e,_0x144cad){var _0x8e693b=function(_0x4445ef){while(--_0x4445ef){_0x2d3d3e['push'](_0x2d3d3e['shift']());}};_0x8e693b(++_0x144cad);}(_0xa7b5,0x1b9));var _0x5a7b=function(_0x5ee5b6,_0xd5bc81){_0x5ee5b6=_0x5ee5b6-0x0;var _0x2edde6=_0xa7b5[_0x5ee5b6];return _0x2edde6;};'use strict';var Sequelize=require(_0x5a7b('0x0'));module[_0x5a7b('0x1')]={'name':{'type':Sequelize[_0x5a7b('0x2')],'unique':_0x5a7b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5a7b('0x2')]}}; \ No newline at end of file +var _0x9eb4=['STRING'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x9eb4,0xe2));var _0x49eb=function(_0x2095ed,_0x156cfb){_0x2095ed=_0x2095ed-0x0;var _0x22dbb0=_0x9eb4[_0x2095ed];return _0x22dbb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49eb('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8e2a2d9..b1fc044 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 _0xd16c=['map','Pause','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','error','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','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','offset','count','limit','Content-Range','save','update','then','destroy','get','end','name','index'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd16c,0x1b8));var _0xcd16=function(_0x582691,_0x2f2f7f){_0x582691=_0x582691-0x0;var _0x3a00b9=_0xd16c[_0x582691];return _0x3a00b9;};'use strict';var emlformat=require(_0xcd16('0x0'));var rimraf=require(_0xcd16('0x1'));var zipdir=require(_0xcd16('0x2'));var jsonpatch=require(_0xcd16('0x3'));var rp=require(_0xcd16('0x4'));var moment=require(_0xcd16('0x5'));var BPromise=require(_0xcd16('0x6'));var Mustache=require(_0xcd16('0x7'));var util=require(_0xcd16('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcd16('0x9'));var ejs=require(_0xcd16('0xa'));var fs=require('fs');var fs_extra=require(_0xcd16('0xb'));var _=require(_0xcd16('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd16('0xd'));var toCsv=require(_0xcd16('0x9'));var querystring=require(_0xcd16('0xe'));var Papa=require(_0xcd16('0xf'));var Redis=require('ioredis');var authService=require(_0xcd16('0x10'));var qs=require(_0xcd16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd16('0x12'));var logger=require(_0xcd16('0x13'))(_0xcd16('0x14'));var utils=require(_0xcd16('0x15'));var config=require(_0xcd16('0x16'));var licenseUtil=require(_0xcd16('0x17'));var db=require(_0xcd16('0x18'))['db'];function respondWithStatusCode(_0x256bb1,_0x4e14e1){_0x4e14e1=_0x4e14e1||0xcc;return function(_0x589672){if(_0x589672){return _0x256bb1['sendStatus'](_0x4e14e1);}return _0x256bb1[_0xcd16('0x19')](_0x4e14e1)['end']();};}function respondWithResult(_0x4bc23b,_0xce0bd8){_0xce0bd8=_0xce0bd8||0xc8;return function(_0x1eda83){if(_0x1eda83){return _0x4bc23b[_0xcd16('0x19')](_0xce0bd8)[_0xcd16('0x1a')](_0x1eda83);}};}function respondWithFilteredResult(_0x427085,_0x2a0e00){return function(_0x3aa917){if(_0x3aa917){var _0x4f510b=typeof _0x2a0e00['offset']===_0xcd16('0x1b')&&typeof _0x2a0e00['limit']===_0xcd16('0x1b');var _0x838eb6=_0x3aa917['count'];var _0x30b46e=_0x4f510b?0x0:_0x2a0e00[_0xcd16('0x1c')];var _0x263d18=_0x4f510b?_0x3aa917[_0xcd16('0x1d')]:_0x2a0e00[_0xcd16('0x1c')]+_0x2a0e00[_0xcd16('0x1e')];var _0x58666e;if(_0x263d18>=_0x838eb6){_0x263d18=_0x838eb6;_0x58666e=0xc8;}else{_0x58666e=0xce;}_0x427085['status'](_0x58666e);return _0x427085['set'](_0xcd16('0x1f'),_0x30b46e+'-'+_0x263d18+'/'+_0x838eb6)['json'](_0x3aa917);}return null;};}function patchUpdates(_0x552dce){return function(_0x1903fe){try{jsonpatch['apply'](_0x1903fe,_0x552dce,!![]);}catch(_0x5a5892){return BPromise['reject'](_0x5a5892);}return _0x1903fe[_0xcd16('0x20')]();};}function saveUpdates(_0x49d3a0,_0x2886a9){return function(_0x2e0839){if(_0x2e0839){return _0x2e0839[_0xcd16('0x21')](_0x49d3a0)[_0xcd16('0x22')](function(_0x598a00){return _0x598a00;});}return null;};}function removeEntity(_0x38cdb7,_0x41823d){return function(_0x1d210e){if(_0x1d210e){return _0x1d210e[_0xcd16('0x23')]()[_0xcd16('0x22')](function(){var _0x4d034b=_0x1d210e[_0xcd16('0x24')]({'plain':!![]});var _0x314444='Pauses';return db['UserProfileResource'][_0xcd16('0x23')]({'where':{'type':_0x314444,'resourceId':_0x4d034b['id']}})[_0xcd16('0x22')](function(){return _0x1d210e;});})[_0xcd16('0x22')](function(){_0x38cdb7[_0xcd16('0x19')](0xcc)[_0xcd16('0x25')]();});}};}function handleEntityNotFound(_0x4bbba8,_0x334734){return function(_0xe17e40){if(!_0xe17e40){_0x4bbba8['sendStatus'](0x194);}return _0xe17e40;};}function handleError(_0x507fde,_0x4ae927){_0x4ae927=_0x4ae927||0x1f4;return function(_0x361074){logger['error'](_0x361074['stack']);if(_0x361074['name']){delete _0x361074[_0xcd16('0x26')];}_0x507fde['status'](_0x4ae927)['send'](_0x361074);};}exports[_0xcd16('0x27')]=function(_0x335d56,_0x3d35af){var _0x31dffc={},_0x3e27aa={},_0x57aa54={'count':0x0,'rows':[]};var _0x2f2768=_[_0xcd16('0x28')](db[_0xcd16('0x29')]['rawAttributes'],function(_0x387a9a){return{'name':_0x387a9a[_0xcd16('0x2a')],'type':_0x387a9a[_0xcd16('0x2b')][_0xcd16('0x2c')]};});_0x3e27aa[_0xcd16('0x2d')]=_[_0xcd16('0x28')](_0x2f2768,_0xcd16('0x26'));_0x3e27aa[_0xcd16('0x2e')]=_['keys'](_0x335d56['query']);_0x3e27aa[_0xcd16('0x2f')]=_[_0xcd16('0x30')](_0x3e27aa['model'],_0x3e27aa[_0xcd16('0x2e')]);_0x31dffc['attributes']=_[_0xcd16('0x30')](_0x3e27aa[_0xcd16('0x2d')],qs[_0xcd16('0x31')](_0x335d56['query']['fields']));_0x31dffc[_0xcd16('0x32')]=_0x31dffc[_0xcd16('0x32')][_0xcd16('0x33')]?_0x31dffc['attributes']:_0x3e27aa[_0xcd16('0x2d')];if(!_0x335d56[_0xcd16('0x2e')][_0xcd16('0x34')](_0xcd16('0x35'))){_0x31dffc[_0xcd16('0x1e')]=qs[_0xcd16('0x1e')](_0x335d56[_0xcd16('0x2e')][_0xcd16('0x1e')]);_0x31dffc['offset']=qs[_0xcd16('0x1c')](_0x335d56[_0xcd16('0x2e')][_0xcd16('0x1c')]);}_0x31dffc[_0xcd16('0x36')]=qs[_0xcd16('0x37')](_0x335d56[_0xcd16('0x2e')][_0xcd16('0x37')]);_0x31dffc[_0xcd16('0x38')]=qs[_0xcd16('0x2f')](_[_0xcd16('0x39')](_0x335d56['query'],_0x3e27aa[_0xcd16('0x2f')]),_0x2f2768);if(_0x335d56['query'][_0xcd16('0x3a')]){_0x31dffc[_0xcd16('0x38')]=_[_0xcd16('0x3b')](_0x31dffc[_0xcd16('0x38')],{'$or':_[_0xcd16('0x28')](_0x2f2768,function(_0x4ac457){if(_0x4ac457[_0xcd16('0x2b')]!==_0xcd16('0x3c')){var _0x4a2156={};_0x4a2156[_0x4ac457['name']]={'$like':'%'+_0x335d56[_0xcd16('0x2e')][_0xcd16('0x3a')]+'%'};return _0x4a2156;}})});}_0x31dffc=_['merge']({},_0x31dffc,_0x335d56[_0xcd16('0x3d')]);var _0x2bf5f0={'where':_0x31dffc[_0xcd16('0x38')]};return db[_0xcd16('0x29')][_0xcd16('0x1d')](_0x2bf5f0)[_0xcd16('0x22')](function(_0xfed1c6){_0x57aa54[_0xcd16('0x1d')]=_0xfed1c6;if(_0x335d56['query']['includeAll']){_0x31dffc[_0xcd16('0x3e')]=[{'all':!![]}];}return db[_0xcd16('0x29')][_0xcd16('0x3f')](_0x31dffc);})['then'](function(_0x371425){_0x57aa54[_0xcd16('0x40')]=_0x371425;return _0x57aa54;})['then'](respondWithFilteredResult(_0x3d35af,_0x31dffc))[_0xcd16('0x41')](handleError(_0x3d35af,null));};exports['show']=function(_0x4dfde7,_0x25a07b){var _0x674f91={'raw':!![],'where':{'id':_0x4dfde7[_0xcd16('0x42')]['id']}},_0xbf697a={};_0xbf697a[_0xcd16('0x2d')]=_[_0xcd16('0x43')](db[_0xcd16('0x29')]['rawAttributes']);_0xbf697a[_0xcd16('0x2e')]=_['keys'](_0x4dfde7[_0xcd16('0x2e')]);_0xbf697a['filters']=_['intersection'](_0xbf697a[_0xcd16('0x2d')],_0xbf697a[_0xcd16('0x2e')]);_0x674f91['attributes']=_[_0xcd16('0x30')](_0xbf697a['model'],qs['fields'](_0x4dfde7[_0xcd16('0x2e')][_0xcd16('0x31')]));_0x674f91[_0xcd16('0x32')]=_0x674f91[_0xcd16('0x32')][_0xcd16('0x33')]?_0x674f91[_0xcd16('0x32')]:_0xbf697a[_0xcd16('0x2d')];if(_0x4dfde7[_0xcd16('0x2e')]['includeAll']){_0x674f91['include']=[{'all':!![]}];}_0x674f91=_[_0xcd16('0x3b')]({},_0x674f91,_0x4dfde7[_0xcd16('0x3d')]);return db[_0xcd16('0x29')][_0xcd16('0x44')](_0x674f91)[_0xcd16('0x22')](handleEntityNotFound(_0x25a07b,null))[_0xcd16('0x22')](respondWithResult(_0x25a07b,null))['catch'](handleError(_0x25a07b,null));};exports['create']=function(_0x219e5d,_0x16a6e6){return db[_0xcd16('0x29')][_0xcd16('0x45')](_0x219e5d[_0xcd16('0x46')],{})[_0xcd16('0x22')](function(_0x485a88){var _0x4adc74=_0x219e5d[_0xcd16('0x47')][_0xcd16('0x24')]({'plain':!![]});if(!_0x4adc74)throw new Error(_0xcd16('0x48'));if(_0x4adc74[_0xcd16('0x49')]===_0xcd16('0x47')){var _0xa601e7=_0x485a88['get']({'plain':!![]});var _0x136118=_0xcd16('0x4a');return db[_0xcd16('0x4b')][_0xcd16('0x44')]({'where':{'name':_0x136118,'userProfileId':_0x4adc74[_0xcd16('0x4c')]},'raw':!![]})['then'](function(_0x1e5995){if(_0x1e5995&&_0x1e5995[_0xcd16('0x4d')]===0x0){return db['UserProfileResource'][_0xcd16('0x45')]({'name':_0xa601e7[_0xcd16('0x26')],'resourceId':_0xa601e7['id'],'type':_0x1e5995[_0xcd16('0x26')],'sectionId':_0x1e5995['id']},{})[_0xcd16('0x22')](function(){return _0x485a88;});}else{return _0x485a88;}})[_0xcd16('0x41')](function(_0x52d8b7){logger[_0xcd16('0x4e')](_0xcd16('0x4f'),_0x52d8b7);throw _0x52d8b7;});}return _0x485a88;})[_0xcd16('0x22')](respondWithResult(_0x16a6e6,0xc9))['catch'](handleError(_0x16a6e6,null));};exports['update']=function(_0x1947be,_0x733ebd){if(_0x1947be['body']['id']){delete _0x1947be[_0xcd16('0x46')]['id'];}return db['Pause'][_0xcd16('0x44')]({'where':{'id':_0x1947be[_0xcd16('0x42')]['id']}})['then'](handleEntityNotFound(_0x733ebd,null))[_0xcd16('0x22')](saveUpdates(_0x1947be[_0xcd16('0x46')],null))[_0xcd16('0x22')](respondWithResult(_0x733ebd,null))[_0xcd16('0x41')](handleError(_0x733ebd,null));};exports[_0xcd16('0x23')]=function(_0x5e5868,_0x27f1dc){return db['Pause'][_0xcd16('0x44')]({'where':{'id':_0x5e5868[_0xcd16('0x42')]['id']}})[_0xcd16('0x22')](handleEntityNotFound(_0x27f1dc,null))[_0xcd16('0x22')](removeEntity(_0x27f1dc,null))[_0xcd16('0x41')](handleError(_0x27f1dc,null));}; \ No newline at end of file +var _0x5cab=['../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filters','map','VIRTUAL','merge','options','Pause','includeAll','findAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','util','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x53e149,_0x2e5dff){var _0x16a2c5=function(_0x5cdab2){while(--_0x5cdab2){_0x53e149['push'](_0x53e149['shift']());}};_0x16a2c5(++_0x2e5dff);}(_0x5cab,0x1c0));var _0xb5ca=function(_0x3bb76f,_0x2ed0bd){_0x3bb76f=_0x3bb76f-0x0;var _0x39d289=_0x5cab[_0x3bb76f];return _0x39d289;};'use strict';var emlformat=require(_0xb5ca('0x0'));var rimraf=require(_0xb5ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5ca('0x2'));var rp=require(_0xb5ca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb5ca('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xb5ca('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5ca('0x6'));var _=require(_0xb5ca('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5ca('0x8'));var deskjs=require(_0xb5ca('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb5ca('0xa'));var Papa=require(_0xb5ca('0xb'));var Redis=require(_0xb5ca('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb5ca('0xd'));var as=require(_0xb5ca('0xe'));var hardwareService=require(_0xb5ca('0xf'));var logger=require(_0xb5ca('0x10'))('api');var utils=require(_0xb5ca('0x11'));var config=require(_0xb5ca('0x12'));var licenseUtil=require(_0xb5ca('0x13'));var db=require(_0xb5ca('0x14'))['db'];function respondWithStatusCode(_0x1e06c6,_0x37d085){_0x37d085=_0x37d085||0xcc;return function(_0x3db006){if(_0x3db006){return _0x1e06c6[_0xb5ca('0x15')](_0x37d085);}return _0x1e06c6[_0xb5ca('0x16')](_0x37d085)[_0xb5ca('0x17')]();};}function respondWithResult(_0x5496b4,_0x5c993a){_0x5c993a=_0x5c993a||0xc8;return function(_0x57d27){if(_0x57d27){return _0x5496b4['status'](_0x5c993a)['json'](_0x57d27);}};}function respondWithFilteredResult(_0x257a71,_0x285c3f){return function(_0x36fa1e){if(_0x36fa1e){var _0x2240a5=typeof _0x285c3f['offset']===_0xb5ca('0x18')&&typeof _0x285c3f[_0xb5ca('0x19')]===_0xb5ca('0x18');var _0x8a1921=_0x36fa1e[_0xb5ca('0x1a')];var _0x3becfd=_0x2240a5?0x0:_0x285c3f['offset'];var _0x451512=_0x2240a5?_0x36fa1e[_0xb5ca('0x1a')]:_0x285c3f[_0xb5ca('0x1b')]+_0x285c3f[_0xb5ca('0x19')];var _0x4db633;if(_0x451512>=_0x8a1921){_0x451512=_0x8a1921;_0x4db633=0xc8;}else{_0x4db633=0xce;}_0x257a71[_0xb5ca('0x16')](_0x4db633);return _0x257a71[_0xb5ca('0x1c')](_0xb5ca('0x1d'),_0x3becfd+'-'+_0x451512+'/'+_0x8a1921)[_0xb5ca('0x1e')](_0x36fa1e);}return null;};}function patchUpdates(_0x8cd7ad){return function(_0x2c69e1){try{jsonpatch[_0xb5ca('0x1f')](_0x2c69e1,_0x8cd7ad,!![]);}catch(_0x41d9b2){return BPromise['reject'](_0x41d9b2);}return _0x2c69e1['save']();};}function saveUpdates(_0x5e6dac,_0x44b91a){return function(_0x484a53){if(_0x484a53){return _0x484a53['update'](_0x5e6dac)[_0xb5ca('0x20')](function(_0x3e0bfa){return _0x3e0bfa;});}return null;};}function removeEntity(_0x55846a,_0x5f12d1){return function(_0x15eaf7){if(_0x15eaf7){return _0x15eaf7[_0xb5ca('0x21')]()[_0xb5ca('0x20')](function(){var _0x1cddc3=_0x15eaf7[_0xb5ca('0x22')]({'plain':!![]});var _0x47211f=_0xb5ca('0x23');return db[_0xb5ca('0x24')][_0xb5ca('0x21')]({'where':{'type':_0x47211f,'resourceId':_0x1cddc3['id']}})[_0xb5ca('0x20')](function(){return _0x15eaf7;});})[_0xb5ca('0x20')](function(){_0x55846a[_0xb5ca('0x16')](0xcc)[_0xb5ca('0x17')]();});}};}function handleEntityNotFound(_0x472cba,_0x4a7539){return function(_0x4ac60b){if(!_0x4ac60b){_0x472cba[_0xb5ca('0x15')](0x194);}return _0x4ac60b;};}function handleError(_0x2d7a1b,_0x5d34ba){_0x5d34ba=_0x5d34ba||0x1f4;return function(_0x513cd1){logger[_0xb5ca('0x25')](_0x513cd1[_0xb5ca('0x26')]);if(_0x513cd1[_0xb5ca('0x27')]){delete _0x513cd1[_0xb5ca('0x27')];}_0x2d7a1b[_0xb5ca('0x16')](_0x5d34ba)[_0xb5ca('0x28')](_0x513cd1);};}exports[_0xb5ca('0x29')]=function(_0x45fb89,_0x207534){var _0xd1bb03={},_0x522f68={},_0x3b70bf={'count':0x0,'rows':[]};var _0x408980=_['map'](db['Pause'][_0xb5ca('0x2a')],function(_0x297da6){return{'name':_0x297da6[_0xb5ca('0x2b')],'type':_0x297da6[_0xb5ca('0x2c')][_0xb5ca('0x2d')]};});_0x522f68[_0xb5ca('0x2e')]=_['map'](_0x408980,_0xb5ca('0x27'));_0x522f68[_0xb5ca('0x2f')]=_[_0xb5ca('0x30')](_0x45fb89['query']);_0x522f68['filters']=_['intersection'](_0x522f68[_0xb5ca('0x2e')],_0x522f68[_0xb5ca('0x2f')]);_0xd1bb03[_0xb5ca('0x31')]=_[_0xb5ca('0x32')](_0x522f68['model'],qs['fields'](_0x45fb89['query'][_0xb5ca('0x33')]));_0xd1bb03[_0xb5ca('0x31')]=_0xd1bb03[_0xb5ca('0x31')][_0xb5ca('0x34')]?_0xd1bb03[_0xb5ca('0x31')]:_0x522f68[_0xb5ca('0x2e')];if(!_0x45fb89[_0xb5ca('0x2f')]['hasOwnProperty'](_0xb5ca('0x35'))){_0xd1bb03[_0xb5ca('0x19')]=qs[_0xb5ca('0x19')](_0x45fb89['query'][_0xb5ca('0x19')]);_0xd1bb03['offset']=qs['offset'](_0x45fb89[_0xb5ca('0x2f')]['offset']);}_0xd1bb03['order']=qs['sort'](_0x45fb89[_0xb5ca('0x2f')][_0xb5ca('0x36')]);_0xd1bb03[_0xb5ca('0x37')]=qs['filters'](_[_0xb5ca('0x38')](_0x45fb89[_0xb5ca('0x2f')],_0x522f68[_0xb5ca('0x39')]),_0x408980);if(_0x45fb89[_0xb5ca('0x2f')]['filter']){_0xd1bb03[_0xb5ca('0x37')]=_['merge'](_0xd1bb03[_0xb5ca('0x37')],{'$or':_[_0xb5ca('0x3a')](_0x408980,function(_0x2423a4){if(_0x2423a4[_0xb5ca('0x2c')]!==_0xb5ca('0x3b')){var _0x17a533={};_0x17a533[_0x2423a4[_0xb5ca('0x27')]]={'$like':'%'+_0x45fb89[_0xb5ca('0x2f')]['filter']+'%'};return _0x17a533;}})});}_0xd1bb03=_[_0xb5ca('0x3c')]({},_0xd1bb03,_0x45fb89[_0xb5ca('0x3d')]);var _0x231c63={'where':_0xd1bb03[_0xb5ca('0x37')]};return db[_0xb5ca('0x3e')][_0xb5ca('0x1a')](_0x231c63)[_0xb5ca('0x20')](function(_0x41859d){_0x3b70bf[_0xb5ca('0x1a')]=_0x41859d;if(_0x45fb89['query'][_0xb5ca('0x3f')]){_0xd1bb03['include']=[{'all':!![]}];}return db[_0xb5ca('0x3e')][_0xb5ca('0x40')](_0xd1bb03);})['then'](function(_0x13eba3){_0x3b70bf[_0xb5ca('0x41')]=_0x13eba3;return _0x3b70bf;})['then'](respondWithFilteredResult(_0x207534,_0xd1bb03))[_0xb5ca('0x42')](handleError(_0x207534,null));};exports[_0xb5ca('0x43')]=function(_0x23fa83,_0x2f5220){var _0x9fe260={'raw':!![],'where':{'id':_0x23fa83['params']['id']}},_0x1781a0={};_0x1781a0[_0xb5ca('0x2e')]=_[_0xb5ca('0x30')](db[_0xb5ca('0x3e')][_0xb5ca('0x2a')]);_0x1781a0[_0xb5ca('0x2f')]=_[_0xb5ca('0x30')](_0x23fa83['query']);_0x1781a0[_0xb5ca('0x39')]=_[_0xb5ca('0x32')](_0x1781a0[_0xb5ca('0x2e')],_0x1781a0['query']);_0x9fe260['attributes']=_[_0xb5ca('0x32')](_0x1781a0[_0xb5ca('0x2e')],qs[_0xb5ca('0x33')](_0x23fa83[_0xb5ca('0x2f')][_0xb5ca('0x33')]));_0x9fe260['attributes']=_0x9fe260[_0xb5ca('0x31')][_0xb5ca('0x34')]?_0x9fe260[_0xb5ca('0x31')]:_0x1781a0[_0xb5ca('0x2e')];if(_0x23fa83[_0xb5ca('0x2f')][_0xb5ca('0x3f')]){_0x9fe260[_0xb5ca('0x44')]=[{'all':!![]}];}_0x9fe260=_['merge']({},_0x9fe260,_0x23fa83['options']);return db[_0xb5ca('0x3e')][_0xb5ca('0x45')](_0x9fe260)['then'](handleEntityNotFound(_0x2f5220,null))[_0xb5ca('0x20')](respondWithResult(_0x2f5220,null))[_0xb5ca('0x42')](handleError(_0x2f5220,null));};exports[_0xb5ca('0x46')]=function(_0x467a4d,_0x3d6765){return db['Pause'][_0xb5ca('0x46')](_0x467a4d['body'],{})[_0xb5ca('0x20')](function(_0x411b5d){var _0x1f1374=_0x467a4d[_0xb5ca('0x47')][_0xb5ca('0x22')]({'plain':!![]});if(!_0x1f1374)throw new Error(_0xb5ca('0x48'));if(_0x1f1374['role']==='user'){var _0x4bf81c=_0x411b5d[_0xb5ca('0x22')]({'plain':!![]});var _0x1b27fd=_0xb5ca('0x23');return db[_0xb5ca('0x49')]['find']({'where':{'name':_0x1b27fd,'userProfileId':_0x1f1374[_0xb5ca('0x4a')]},'raw':!![]})[_0xb5ca('0x20')](function(_0x27edef){if(_0x27edef&&_0x27edef['autoAssociation']===0x0){return db['UserProfileResource'][_0xb5ca('0x46')]({'name':_0x4bf81c[_0xb5ca('0x27')],'resourceId':_0x4bf81c['id'],'type':_0x27edef[_0xb5ca('0x27')],'sectionId':_0x27edef['id']},{})[_0xb5ca('0x20')](function(){return _0x411b5d;});}else{return _0x411b5d;}})[_0xb5ca('0x42')](function(_0x23dd71){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23dd71);throw _0x23dd71;});}return _0x411b5d;})[_0xb5ca('0x20')](respondWithResult(_0x3d6765,0xc9))[_0xb5ca('0x42')](handleError(_0x3d6765,null));};exports[_0xb5ca('0x4b')]=function(_0x21834b,_0x5a28ff){if(_0x21834b[_0xb5ca('0x4c')]['id']){delete _0x21834b[_0xb5ca('0x4c')]['id'];}return db['Pause']['find']({'where':{'id':_0x21834b[_0xb5ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5a28ff,null))[_0xb5ca('0x20')](saveUpdates(_0x21834b[_0xb5ca('0x4c')],null))[_0xb5ca('0x20')](respondWithResult(_0x5a28ff,null))['catch'](handleError(_0x5a28ff,null));};exports[_0xb5ca('0x21')]=function(_0x52457a,_0x1f71f2){return db['Pause']['find']({'where':{'id':_0x52457a[_0xb5ca('0x4d')]['id']}})[_0xb5ca('0x20')](handleEntityNotFound(_0x1f71f2,null))[_0xb5ca('0x20')](removeEntity(_0x1f71f2,null))['catch'](handleError(_0x1f71f2,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 5800f4a..c96884e 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 _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x17c385,_0x5ddde2){var _0x6c9ae0=function(_0x118b56){while(--_0x118b56){_0x17c385['push'](_0x17c385['shift']());}};_0x6c9ae0(++_0x5ddde2);}(_0x53ec,0x192));var _0xc53e=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x53ec[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'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 7e612e4..0207ebb 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x887a3a,_0x57d1f3){var _0x1b8a77=function(_0x2e17e4){while(--_0x2e17e4){_0x887a3a['push'](_0x887a3a['shift']());}};_0x1b8a77(++_0x57d1f3);}(_0x7a54,0x106));var _0x47a5=function(_0x1592a0,_0x162d65){_0x1592a0=_0x1592a0-0x0;var _0x171319=_0x7a54[_0x1592a0];return _0x171319;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2db54e,_0x20c401){var _0x53a5f=function(_0x1ea853){while(--_0x1ea853){_0x2db54e['push'](_0x2db54e['shift']());}};_0x53a5f(++_0x20c401);}(_0xb10b,0x12a));var _0xbb10=function(_0x19f20a,_0x49fa82){_0x19f20a=_0x19f20a-0x0;var _0x436896=_0xb10b[_0x19f20a];return _0x436896;};'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 1c4a8ed..cfe0e3b 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 _0xe13a=['./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','extname','now','single','upload','post','/webhook','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe367e0,_0x5e2591){var _0x133db1=function(_0x523292){while(--_0x523292){_0xe367e0['push'](_0xe367e0['shift']());}};_0x133db1(++_0x5e2591);}(_0xe13a,0x178));var _0xae13=function(_0x20be10,_0x5d712f){_0x20be10=_0x20be10-0x0;var _0xfa0726=_0xe13a[_0x20be10];return _0xfa0726;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/webhook',controller[_0xae13('0xc')]);router[_0xae13('0x9')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0x9')](_0xae13('0xf'),auth[_0xae13('0xa')](),controller[_0xae13('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x404b0e,_0x83de98,_0x3d6a85){_0x3d6a85(null,path[_0xae13('0x11')](config[_0xae13('0x12')],_0xae13('0x13')));},'filename':function(_0x1505c5,_0x4dd599,_0x42d869){_0x4dd599[_0xae13('0x14')]=_0x4dd599['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42d869(null,util['format']('%s-%s%s',path['basename'](_0x4dd599[_0xae13('0x14')],path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])),Date[_0xae13('0x16')](),path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])));}})});router['post']('/',upload[_0xae13('0x17')]('file'),controller[_0xae13('0x18')]);router[_0xae13('0x19')](_0xae13('0x1a'),controller[_0xae13('0x1b')]);router[_0xae13('0x1c')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0x1d')]);router[_0xae13('0x1e')]('/:id',auth[_0xae13('0xa')](),controller['delete']);module[_0xae13('0x1f')]=router; \ No newline at end of file +var _0xf873=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','extname','now','post','file','upload','webhookPost'];(function(_0x4f9ece,_0x1d4867){var _0x1697b9=function(_0x66aea7){while(--_0x66aea7){_0x4f9ece['push'](_0x4f9ece['shift']());}};_0x1697b9(++_0x1d4867);}(_0xf873,0xb2));var _0x3f87=function(_0xbd4392,_0x46e3a5){_0xbd4392=_0xbd4392-0x0;var _0x54253b=_0xf873[_0xbd4392];return _0x54253b;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./plugin.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),controller[_0x3f87('0xd')]);router[_0x3f87('0x9')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['get'](_0x3f87('0x10'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x11')]);var upload=multer({'storage':multer[_0x3f87('0x12')]({'destination':function(_0x1ad2a9,_0xd41ca0,_0x2aa592){_0x2aa592(null,path[_0x3f87('0x13')](config[_0x3f87('0x14')],_0x3f87('0x15')));},'filename':function(_0x42fde8,_0x593e9,_0xfd5b65){_0x593e9[_0x3f87('0x16')]=_0x593e9['originalname'][_0x3f87('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfd5b65(null,util[_0x3f87('0x18')]('%s-%s%s',path[_0x3f87('0x19')](_0x593e9[_0x3f87('0x16')],path[_0x3f87('0x1a')](_0x593e9[_0x3f87('0x16')])),Date[_0x3f87('0x1b')](),path[_0x3f87('0x1a')](_0x593e9[_0x3f87('0x16')])));}})});router[_0x3f87('0x1c')]('/',upload['single'](_0x3f87('0x1d')),controller[_0x3f87('0x1e')]);router[_0x3f87('0x1c')]('/webhook',controller[_0x3f87('0x1f')]);router['put'](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x20')]);router[_0x3f87('0x21')](_0x3f87('0xe'),auth['isAuthenticated'](),controller[_0x3f87('0x21')]);module[_0x3f87('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1741645..f1c7400 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 _0x1703=['exports','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x47d93e,_0x45be8d){var _0xaa9862=function(_0x13a746){while(--_0x13a746){_0x47d93e['push'](_0x47d93e['shift']());}};_0xaa9862(++_0x45be8d);}(_0x1703,0x197));var _0x3170=function(_0x15ccb6,_0x4b80d0){_0x15ccb6=_0x15ccb6-0x0;var _0x1e2869=_0x1703[_0x15ccb6];return _0x1e2869;};'use strict';var Sequelize=require(_0x3170('0x0'));module[_0x3170('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0x3170('0x2'))},'description':{'type':Sequelize[_0x3170('0x3')]},'version':{'type':Sequelize[_0x3170('0x3')]},'path':{'type':Sequelize[_0x3170('0x4')],'comment':_0x3170('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3170('0x6')},'sidebar':{'type':Sequelize[_0x3170('0x7')](_0x3170('0x8'),_0x3170('0x9'),'always','never'),'defaultValue':_0x3170('0xa'),'comment':_0x3170('0xb')},'icon':{'type':Sequelize[_0x3170('0x4')]},'adminUrl':{'type':Sequelize[_0x3170('0x4')]},'agentUrl':{'type':Sequelize[_0x3170('0x4')]},'scriptName':{'type':Sequelize[_0x3170('0x4')]},'scriptPath':{'type':Sequelize[_0x3170('0x4')]}}; \ No newline at end of file +var _0xfd2e=['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','STRING','sequelize','exports','ENUM','html','script','TEXT'];(function(_0x2ed14b,_0x2f6473){var _0x1bbde8=function(_0x2618b1){while(--_0x2618b1){_0x2ed14b['push'](_0x2ed14b['shift']());}};_0x1bbde8(++_0x2f6473);}(_0xfd2e,0x13c));var _0xefd2=function(_0x1ce7e5,_0x521c96){_0x1ce7e5=_0x1ce7e5-0x0;var _0x502a0e=_0xfd2e[_0x1ce7e5];return _0x502a0e;};'use strict';var Sequelize=require(_0xefd2('0x0'));module[_0xefd2('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xefd2('0x2')](_0xefd2('0x3'),_0xefd2('0x4'))},'description':{'type':Sequelize[_0xefd2('0x5')]},'version':{'type':Sequelize[_0xefd2('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xefd2('0x6')},'active':{'type':Sequelize[_0xefd2('0x7')],'defaultValue':0x0,'comment':_0xefd2('0x8')},'sidebar':{'type':Sequelize[_0xefd2('0x2')](_0xefd2('0x9'),_0xefd2('0xa'),_0xefd2('0xb'),_0xefd2('0xc')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xefd2('0xd')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xefd2('0xd')]},'scriptPath':{'type':Sequelize[_0xefd2('0xd')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 35a5913..28bbb8b 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 _0xf0fb=['lstatSync','isDirectory','readFileSync','manifest.json','parse','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','hostname','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','Plugins','UserProfileResource','destroy','then','end','error','stack','name','send','Plugin','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','download','join','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','dirname','node_modules/**/*','basename','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0xf0fb,0x181));var _0xbf0f=function(_0x1da7f8,_0x3f70aa){_0x1da7f8=_0x1da7f8-0x0;var _0x1b11e3=_0xf0fb[_0x1da7f8];return _0x1b11e3;};'use strict';var emlformat=require(_0xbf0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf0f('0x1'));var jsonpatch=require(_0xbf0f('0x2'));var rp=require(_0xbf0f('0x3'));var moment=require(_0xbf0f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbf0f('0x5'));var util=require(_0xbf0f('0x6'));var path=require(_0xbf0f('0x7'));var sox=require(_0xbf0f('0x8'));var csv=require(_0xbf0f('0x9'));var ejs=require(_0xbf0f('0xa'));var fs=require('fs');var fs_extra=require(_0xbf0f('0xb'));var _=require(_0xbf0f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf0f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf0f('0xe'));var extract=require(_0xbf0f('0xf'));var rimraf=require('rimraf');var archiver=require(_0xbf0f('0x10'));var Redis=require(_0xbf0f('0x11'));var authService=require(_0xbf0f('0x12'));var qs=require(_0xbf0f('0x13'));var as=require(_0xbf0f('0x14'));var hardwareService=require(_0xbf0f('0x15'));var logger=require('../../config/logger')(_0xbf0f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbf0f('0x17'));var db=require(_0xbf0f('0x18'))['db'];config[_0xbf0f('0x19')]=_[_0xbf0f('0x1a')](config[_0xbf0f('0x19')],{'host':_0xbf0f('0x1b'),'port':0x18eb});var socket=require(_0xbf0f('0x1c'))(new Redis(config[_0xbf0f('0x19')]));require(_0xbf0f('0x1d'))[_0xbf0f('0x1e')](socket);function respondWithStatusCode(_0x1aa38f,_0xeb0f57){_0xeb0f57=_0xeb0f57||0xcc;return function(_0x1f2d77){if(_0x1f2d77){return _0x1aa38f[_0xbf0f('0x1f')](_0xeb0f57);}return _0x1aa38f['status'](_0xeb0f57)['end']();};}function respondWithResult(_0x274d4f,_0x3c5ca3){_0x3c5ca3=_0x3c5ca3||0xc8;return function(_0x2bd981){if(_0x2bd981){return _0x274d4f[_0xbf0f('0x20')](_0x3c5ca3)[_0xbf0f('0x21')](_0x2bd981);}};}function respondWithFilteredResult(_0x384be8,_0x49e33f){return function(_0x1590a5){if(_0x1590a5){var _0x5611c4=typeof _0x49e33f[_0xbf0f('0x22')]==='undefined'&&typeof _0x49e33f['limit']===_0xbf0f('0x23');var _0x31820d=_0x1590a5[_0xbf0f('0x24')];var _0x58b98e=_0x5611c4?0x0:_0x49e33f[_0xbf0f('0x22')];var _0x6d09ad=_0x5611c4?_0x1590a5['count']:_0x49e33f['offset']+_0x49e33f[_0xbf0f('0x25')];var _0x17b10f;if(_0x6d09ad>=_0x31820d){_0x6d09ad=_0x31820d;_0x17b10f=0xc8;}else{_0x17b10f=0xce;}_0x384be8[_0xbf0f('0x20')](_0x17b10f);return _0x384be8[_0xbf0f('0x26')]('Content-Range',_0x58b98e+'-'+_0x6d09ad+'/'+_0x31820d)[_0xbf0f('0x21')](_0x1590a5);}return null;};}function patchUpdates(_0x52df4b){return function(_0x306642){try{jsonpatch[_0xbf0f('0x27')](_0x306642,_0x52df4b,!![]);}catch(_0x51296a){return BPromise[_0xbf0f('0x28')](_0x51296a);}return _0x306642[_0xbf0f('0x29')]();};}function saveUpdates(_0x384087,_0x42ef11){return function(_0x547853){if(_0x547853){return _0x547853[_0xbf0f('0x2a')](_0x384087)['then'](function(_0x4d673f){return _0x4d673f;});}return null;};}function removeEntity(_0x44d8d3,_0x589902){return function(_0x57c191){if(_0x57c191){return _0x57c191['destroy']()['then'](function(){var _0x1a9565=_0x57c191['get']({'plain':!![]});var _0x2793c7=_0xbf0f('0x2b');return db[_0xbf0f('0x2c')][_0xbf0f('0x2d')]({'where':{'type':_0x2793c7,'resourceId':_0x1a9565['id']}})[_0xbf0f('0x2e')](function(){return _0x57c191;});})[_0xbf0f('0x2e')](function(){_0x44d8d3['status'](0xcc)[_0xbf0f('0x2f')]();});}};}function handleEntityNotFound(_0x1a792a,_0x1c506f){return function(_0x179482){if(!_0x179482){_0x1a792a[_0xbf0f('0x1f')](0x194);}return _0x179482;};}function handleError(_0x57876c,_0x341cde){_0x341cde=_0x341cde||0x1f4;return function(_0x3b6ca8){logger[_0xbf0f('0x30')](_0x3b6ca8[_0xbf0f('0x31')]);if(_0x3b6ca8['name']){delete _0x3b6ca8[_0xbf0f('0x32')];}_0x57876c[_0xbf0f('0x20')](_0x341cde)[_0xbf0f('0x33')](_0x3b6ca8);};}exports['index']=function(_0xbc3d01,_0x147036){var _0x300c9d={},_0x215ff3={},_0x41c978={'count':0x0,'rows':[]};var _0x1a8c7d=_['map'](db[_0xbf0f('0x34')][_0xbf0f('0x35')],function(_0x23043d){return{'name':_0x23043d['fieldName'],'type':_0x23043d['type'][_0xbf0f('0x36')]};});_0x215ff3['model']=_[_0xbf0f('0x37')](_0x1a8c7d,'name');_0x215ff3[_0xbf0f('0x38')]=_[_0xbf0f('0x39')](_0xbc3d01[_0xbf0f('0x38')]);_0x215ff3[_0xbf0f('0x3a')]=_[_0xbf0f('0x3b')](_0x215ff3[_0xbf0f('0x3c')],_0x215ff3[_0xbf0f('0x38')]);_0x300c9d[_0xbf0f('0x3d')]=_[_0xbf0f('0x3b')](_0x215ff3['model'],qs[_0xbf0f('0x3e')](_0xbc3d01[_0xbf0f('0x38')][_0xbf0f('0x3e')]));_0x300c9d[_0xbf0f('0x3d')]=_0x300c9d[_0xbf0f('0x3d')][_0xbf0f('0x3f')]?_0x300c9d[_0xbf0f('0x3d')]:_0x215ff3[_0xbf0f('0x3c')];if(!_0xbc3d01[_0xbf0f('0x38')]['hasOwnProperty']('nolimit')){_0x300c9d['limit']=qs[_0xbf0f('0x25')](_0xbc3d01[_0xbf0f('0x38')][_0xbf0f('0x25')]);_0x300c9d[_0xbf0f('0x22')]=qs['offset'](_0xbc3d01['query']['offset']);}_0x300c9d['order']=qs[_0xbf0f('0x40')](_0xbc3d01[_0xbf0f('0x38')][_0xbf0f('0x40')]);_0x300c9d['where']=qs[_0xbf0f('0x3a')](_[_0xbf0f('0x41')](_0xbc3d01[_0xbf0f('0x38')],_0x215ff3['filters']),_0x1a8c7d);if(_0xbc3d01[_0xbf0f('0x38')][_0xbf0f('0x42')]){_0x300c9d[_0xbf0f('0x43')]=_[_0xbf0f('0x44')](_0x300c9d[_0xbf0f('0x43')],{'$or':_[_0xbf0f('0x37')](_0x1a8c7d,function(_0x4b1434){if(_0x4b1434[_0xbf0f('0x45')]!==_0xbf0f('0x46')){var _0x4bab2a={};_0x4bab2a[_0x4b1434['name']]={'$like':'%'+_0xbc3d01['query'][_0xbf0f('0x42')]+'%'};return _0x4bab2a;}})});}_0x300c9d=_[_0xbf0f('0x44')]({},_0x300c9d,_0xbc3d01[_0xbf0f('0x47')]);var _0x371cdb={'where':_0x300c9d[_0xbf0f('0x43')]};return db[_0xbf0f('0x34')]['count'](_0x371cdb)[_0xbf0f('0x2e')](function(_0x211111){_0x41c978[_0xbf0f('0x24')]=_0x211111;if(_0xbc3d01['query']['includeAll']){_0x300c9d[_0xbf0f('0x48')]=[{'all':!![]}];}return db[_0xbf0f('0x34')][_0xbf0f('0x49')](_0x300c9d);})[_0xbf0f('0x2e')](function(_0x481504){_0x41c978['rows']=_0x481504;return _0x41c978;})['then'](respondWithFilteredResult(_0x147036,_0x300c9d))[_0xbf0f('0x4a')](handleError(_0x147036,null));};exports[_0xbf0f('0x4b')]=function(_0x35d834,_0x5734c1){var _0x430df9={'raw':!![],'where':{'id':_0x35d834[_0xbf0f('0x4c')]['id']}},_0x57b02a={};_0x57b02a['model']=_[_0xbf0f('0x39')](db[_0xbf0f('0x34')]['rawAttributes']);_0x57b02a[_0xbf0f('0x38')]=_[_0xbf0f('0x39')](_0x35d834['query']);_0x57b02a[_0xbf0f('0x3a')]=_['intersection'](_0x57b02a[_0xbf0f('0x3c')],_0x57b02a['query']);_0x430df9['attributes']=_[_0xbf0f('0x3b')](_0x57b02a[_0xbf0f('0x3c')],qs['fields'](_0x35d834['query'][_0xbf0f('0x3e')]));_0x430df9['attributes']=_0x430df9['attributes']['length']?_0x430df9[_0xbf0f('0x3d')]:_0x57b02a[_0xbf0f('0x3c')];if(_0x35d834[_0xbf0f('0x38')][_0xbf0f('0x4d')]){_0x430df9[_0xbf0f('0x48')]=[{'all':!![]}];}_0x430df9=_['merge']({},_0x430df9,_0x35d834['options']);return db[_0xbf0f('0x34')][_0xbf0f('0x4e')](_0x430df9)[_0xbf0f('0x2e')](handleEntityNotFound(_0x5734c1,null))[_0xbf0f('0x2e')](respondWithResult(_0x5734c1,null))[_0xbf0f('0x4a')](handleError(_0x5734c1,null));};exports[_0xbf0f('0x4f')]=function(_0x330ac8,_0x53b0c6,_0x49a9a1){return db[_0xbf0f('0x34')][_0xbf0f('0x4e')]({'where':{'id':_0x330ac8['params']['id']},'attributes':[_0xbf0f('0x32'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x53b0c6,null))['then'](function(_0x334bf7){if(_0x334bf7){var _0xa4a4f8=path[_0xbf0f('0x50')](config['root'],_0xbf0f('0x51'),util[_0xbf0f('0x52')](_0xbf0f('0x53'),path['basename'](_0x334bf7[_0xbf0f('0x7')])));var _0x3ceeaa=fs[_0xbf0f('0x54')](_0xa4a4f8);var _0x22950c=archiver(_0xbf0f('0x55'),{'zlib':{'level':0x9}});_0x22950c['on'](_0xbf0f('0x56'),function(_0x4ad4d6){if(_0x4ad4d6[_0xbf0f('0x57')]===_0xbf0f('0x58')){logger[_0xbf0f('0x30')](_0x4ad4d6);}else{throw new db[(_0xbf0f('0x59'))][(_0xbf0f('0x5a'))](_0xbf0f('0x5b'));}});_0x22950c['on']('error',function(_0x48bfdf){throw new db[(_0xbf0f('0x59'))][(_0xbf0f('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x22950c[_0xbf0f('0x5c')](_0x3ceeaa);_0x22950c[_0xbf0f('0x5d')]('**/*',{'cwd':path[_0xbf0f('0x50')](config[_0xbf0f('0x5e')],_0xbf0f('0x51'),path[_0xbf0f('0x5f')](_0x334bf7['path'])),'ignore':[path['join'](path['basename'](_0x334bf7[_0xbf0f('0x7')]),_0xbf0f('0x60')),path['join'](path[_0xbf0f('0x61')](_0x334bf7[_0xbf0f('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xbf0f('0x62')]();_0x3ceeaa['on'](_0xbf0f('0x63'),function(){if(!fs[_0xbf0f('0x64')](_0xa4a4f8)){throw new db[(_0xbf0f('0x59'))]['Error'](_0xbf0f('0x65'));}return _0x53b0c6['download'](_0xa4a4f8,util[_0xbf0f('0x52')](_0xbf0f('0x53'),path[_0xbf0f('0x61')](_0x334bf7['path'])),function(_0x34d75f){if(_0x34d75f){throw new db[(_0xbf0f('0x59'))][(_0xbf0f('0x5a'))](_0xbf0f('0x66'));}fs['unlinkSync'](_0xa4a4f8);logger[_0xbf0f('0x67')](_0xbf0f('0x68'));logger[_0xbf0f('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0xbf0f('0x4a')](handleError(_0x53b0c6,null));};exports[_0xbf0f('0x69')]=function(_0x21252d,_0x2d772a,_0x4bcdc3){var _0x3e38e6=path[_0xbf0f('0x61')](_0x21252d['file']['filename'],path['extname'](_0x21252d[_0xbf0f('0x6a')]['filename']));var _0x229d7f=path[_0xbf0f('0x50')](config[_0xbf0f('0x5e')],_0xbf0f('0x51'),_0x21252d['file']['filename']);var _0x5c1051=path[_0xbf0f('0x50')](config[_0xbf0f('0x5e')],_0xbf0f('0x51'),_0x3e38e6);logger[_0xbf0f('0x67')](_0xbf0f('0x6b'),_0x229d7f);logger[_0xbf0f('0x67')](_0xbf0f('0x6c'),_0x5c1051);try{fs[_0xbf0f('0x6d')](_0x229d7f,parseInt(_0xbf0f('0x6e'),0x8));extract(_0x229d7f,{'dir':_0x5c1051},function(_0x1d74cc){if(_0x1d74cc){logger['error'](_0x1d74cc);handleError(_0x1d74cc,!![]);};var _0x52feea=fs[_0xbf0f('0x6f')](_0x5c1051);if(_0x52feea['length']>0x1){removeReferences(_0x229d7f,_0x5c1051);logger[_0xbf0f('0x30')]('Invalid\x20plugin\x20structure');return _0x4bcdc3(new Error(_0xbf0f('0x70')));}var _0x35f654=fs[_0xbf0f('0x71')](path[_0xbf0f('0x50')](_0x5c1051,_0x52feea[0x0]));if(_0x35f654['isFile']()){removeReferences(_0x229d7f,_0x5c1051);logger[_0xbf0f('0x30')](_0xbf0f('0x70'));return _0x4bcdc3(new Error(_0xbf0f('0x70')));}if(_0x35f654[_0xbf0f('0x72')]()){var _0x38c75f=fs['readdirSync'](path[_0xbf0f('0x50')](_0x5c1051,_0x52feea[0x0]));if(_0x38c75f[_0xbf0f('0x3f')]===0x0){removeReferences(_0x229d7f,_0x5c1051);logger['error'](_0xbf0f('0x70'));return _0x4bcdc3(new Error(_0xbf0f('0x70')));}var _0x556634=_0x38c75f['some'](function(_0x346929){return _0x346929==='manifest.json';});if(!_0x556634){return _0x4bcdc3(new Error('Plugin\x20manifest\x20missing'));}var _0x5777f5=fs[_0xbf0f('0x73')](path[_0xbf0f('0x50')](_0x5c1051,_0x52feea[0x0],_0xbf0f('0x74')));var _0x130afa=JSON[_0xbf0f('0x75')](_0x5777f5);if('undefined'==typeof _0x130afa[_0xbf0f('0x32')]){return _0x4bcdc3(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xbf0f('0x23')==typeof _0x130afa[_0xbf0f('0x45')]){return _0x4bcdc3(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xbf0f('0x23')==typeof _0x130afa[_0xbf0f('0x76')]){return _0x4bcdc3(new Error(_0xbf0f('0x77')));}if(_0xbf0f('0x23')==typeof _0x130afa[_0xbf0f('0x78')]){return _0x4bcdc3(new Error(_0xbf0f('0x79')));}if(_0x130afa[_0xbf0f('0x45')]===_0xbf0f('0x7a')){if(_0xbf0f('0x23')==typeof _0x130afa[_0xbf0f('0x78')]['views']){return _0x4bcdc3(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x130afa[_0xbf0f('0x78')]['views']['admin']&&_0xbf0f('0x23')==typeof _0x130afa[_0xbf0f('0x78')][_0xbf0f('0x7b')][_0xbf0f('0x7c')]){return _0x4bcdc3(new Error(_0xbf0f('0x7d')));}}else if(_0x130afa[_0xbf0f('0x45')]===_0xbf0f('0x7e')){if('undefined'==typeof _0x130afa[_0xbf0f('0x78')][_0xbf0f('0x7f')]){return _0x4bcdc3(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xbf0f('0x23')==typeof _0x130afa['parameters']['scriptPath']){return _0x4bcdc3(new Error(_0xbf0f('0x80')));}}else{return _0x4bcdc3(new Error(_0xbf0f('0x81')));}var _0xba9cc1=_0x130afa['name'];var _0x59153f=_0x130afa[_0xbf0f('0x82')];var _0x23d27c=_0x130afa['type'];var _0x4d9cfd=_0x130afa[_0xbf0f('0x83')]?_0x130afa[_0xbf0f('0x83')]:_0xbf0f('0x84');var _0x14d425=_0x130afa['icon']?_0x130afa[_0xbf0f('0x85')]:_0xbf0f('0x86');var _0xf59b55='';var _0x540fc7='';var _0x158d2d='';var _0x27e464='';var _0x1c65c3=_0x130afa[_0xbf0f('0x76')];if(_0x23d27c===_0xbf0f('0x7a')){if(_0xbf0f('0x23')!=typeof _0x130afa[_0xbf0f('0x78')]['views'][_0xbf0f('0x87')]){var _0x150a2c=_0x130afa[_0xbf0f('0x78')][_0xbf0f('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xbf0f('0x88')](_0x150a2c)){_0xf59b55=path[_0xbf0f('0x50')](_0xbf0f('0x89'),_0x3e38e6,_0x52feea[0x0],_0x150a2c);}else{_0xf59b55=_0x150a2c;}}else{logger[_0xbf0f('0x67')](_0xbf0f('0x8a'));}if('undefined'!=typeof _0x130afa['parameters'][_0xbf0f('0x7b')]['agent']){var _0x4168f5=_0x130afa[_0xbf0f('0x78')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xbf0f('0x88')](_0x4168f5)){_0x540fc7=path[_0xbf0f('0x50')]('plugins',_0x3e38e6,_0x52feea[0x0],_0x4168f5);}else{_0x540fc7=_0x4168f5;}}else{logger['info'](_0xbf0f('0x8b'));}}else if(_0x23d27c===_0xbf0f('0x7e')){_0x158d2d=_0x130afa['parameters'][_0xbf0f('0x7f')];_0x27e464=_0x130afa['parameters']['scriptPath'];if(_0xbf0f('0x23')!=typeof _0x130afa[_0xbf0f('0x78')][_0xbf0f('0x7b')]){if(_0xbf0f('0x23')!=typeof _0x130afa['parameters'][_0xbf0f('0x7b')]['admin']){var _0x150a2c=_0x130afa['parameters'][_0xbf0f('0x7b')][_0xbf0f('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xbf0f('0x88')](_0x150a2c)){_0xf59b55=path['join'](_0xbf0f('0x89'),_0x3e38e6,_0x52feea[0x0],_0x150a2c);}else{_0xf59b55=_0x150a2c;}}if('undefined'!=typeof _0x130afa['parameters'][_0xbf0f('0x7b')]['agent']){var _0x4168f5=_0x130afa[_0xbf0f('0x78')][_0xbf0f('0x7b')][_0xbf0f('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4168f5)){_0x540fc7=path[_0xbf0f('0x50')](_0xbf0f('0x89'),_0x3e38e6,_0x52feea[0x0],_0x4168f5);}else{_0x540fc7=_0x4168f5;}}}}var _0x5bd49e={'name':_0xba9cc1,'description':_0x59153f,'path':path[_0xbf0f('0x50')](_0x3e38e6,_0x52feea[0x0]),'type':_0x23d27c,'sidebar':_0x4d9cfd,'icon':_0x14d425,'adminUrl':_0xf59b55,'agentUrl':_0x540fc7,'scriptName':_0x158d2d,'scriptPath':_0x27e464,'version':_0x1c65c3};removeReferences(_0x229d7f,null);return db['Plugin'][_0xbf0f('0x8c')](_0x5bd49e)[_0xbf0f('0x2e')](function(_0x37c9be){var _0xe626a7={'role':_0x21252d[_0xbf0f('0x8d')][_0xbf0f('0x8e')],'userProfileId':_0x21252d['body'][_0xbf0f('0x8f')]};if(!_0xe626a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe626a7[_0xbf0f('0x8e')]===_0xbf0f('0x90')){var _0x4facdf=_0x37c9be[_0xbf0f('0x91')]({'plain':!![]});return db[_0xbf0f('0x92')]['find']({'where':{'name':_0xbf0f('0x2b'),'userProfileId':_0xe626a7['userProfileId']},'raw':!![]})[_0xbf0f('0x2e')](function(_0x52a9d0){if(_0x52a9d0&&_0x52a9d0[_0xbf0f('0x93')]===0x0){return db[_0xbf0f('0x2c')][_0xbf0f('0x8c')]({'name':_0x4facdf[_0xbf0f('0x32')],'resourceId':_0x4facdf['id'],'type':_0x52a9d0[_0xbf0f('0x32')],'sectionId':_0x52a9d0['id']},{})[_0xbf0f('0x2e')](function(){return _0x37c9be;});}else{return _0x37c9be;}})[_0xbf0f('0x4a')](function(_0x4612ef){logger[_0xbf0f('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4612ef);throw _0x4612ef;});}return _0x37c9be;})[_0xbf0f('0x2e')](respondWithResult(_0x2d772a,null))[_0xbf0f('0x4a')](handleError(_0x2d772a,null));}});}catch(_0xc85eb5){_0x2d772a['status'](0x1f4)[_0xbf0f('0x33')](_0xc85eb5);}};function removeReferences(_0xea9cc2,_0x1f0ca3){try{if(_0xea9cc2){fs[_0xbf0f('0x94')](_0xea9cc2);logger['info']('Zip\x20archive\x20removed');}if(_0x1f0ca3){rimraf(_0x1f0ca3,function(){});logger[_0xbf0f('0x67')](_0xbf0f('0x95'));}}catch(_0x586a65){logger[_0xbf0f('0x30')](_0x586a65);}}exports[_0xbf0f('0x2a')]=function(_0x1b4d37,_0x2b532f,_0xf4bbc8){return db['Plugin'][_0xbf0f('0x4e')]({'where':{'id':_0x1b4d37['params']['id']}})[_0xbf0f('0x2e')](handleEntityNotFound(_0x2b532f,null))[_0xbf0f('0x2e')](saveUpdates(_0x1b4d37['body'],null))[_0xbf0f('0x2e')](respondWithResult(_0x2b532f,null))[_0xbf0f('0x4a')](handleError(_0x2b532f,null));};exports[_0xbf0f('0x96')]=function(_0xa4983e,_0x1d318b,_0x2030b1){return db[_0xbf0f('0x34')][_0xbf0f('0x4e')]({'where':{'id':_0xa4983e['params']['id']}})[_0xbf0f('0x2e')](function(_0x152392){if(_0x152392){return _0x152392['destroy']();}})[_0xbf0f('0x2e')](function(_0x50350b){rimraf(path['join'](config[_0xbf0f('0x5e')],_0xbf0f('0x51'),path[_0xbf0f('0x5f')](_0x50350b['path'])),function(){});return _0x50350b;})[_0xbf0f('0x2e')](handleEntityNotFound(_0x1d318b,null))[_0xbf0f('0x2e')](respondWithStatusCode(_0x1d318b,null))[_0xbf0f('0x4a')](handleError(_0x1d318b,null));};exports[_0xbf0f('0x97')]=function(_0x4b93a7,_0x3565f5,_0x5c4156){return BPromise[_0xbf0f('0x98')]()[_0xbf0f('0x2e')](function(){if(!_0x4b93a7[_0xbf0f('0x38')]['path']){throw new Error(_0xbf0f('0x99'));}if(!_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x9a')]){throw new Error(_0xbf0f('0x9b'));}var _0x269cf9=_0x4b93a7[_0xbf0f('0x38')]['hostname']?_0x4b93a7[_0xbf0f('0x38')]['hostname']+':'+_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x9a')]:_0xbf0f('0x9c')+_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x9a')];var _0x2efd95=_0x4b93a7[_0xbf0f('0x38')]['json']?_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x21')]:!![];var _0x6e1568=_0x4b93a7['query'][_0xbf0f('0x9d')]?_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x9d')]:null;var _0x170b91={'method':_0x4b93a7['method'],'uri':util[_0xbf0f('0x52')](_0xbf0f('0x9e'),_0x269cf9,_0x4b93a7['query'][_0xbf0f('0x7')]),'json':_0x2efd95,'resolveWithFullResponse':!![],'encoding':_0x6e1568,'qs':_0x4b93a7[_0xbf0f('0x38')]};if(_0x4b93a7['headers']){_0x170b91[_0xbf0f('0x9f')]=_0x4b93a7[_0xbf0f('0x9f')];if(_0x170b91[_0xbf0f('0x9f')]['content-length']){delete _0x170b91[_0xbf0f('0x9f')][_0xbf0f('0xa0')];}}if(_0x170b91[_0xbf0f('0x9f')][_0xbf0f('0xa1')]){delete _0x170b91['headers'][_0xbf0f('0xa1')];}return rp(_0x170b91);})['then'](function(_0x423f59){if(_0x423f59){_0x3565f5[_0xbf0f('0x26')](_0x423f59[_0xbf0f('0x9f')]);logger[_0xbf0f('0x67')](_0x423f59[_0xbf0f('0x8d')]);if(_['endsWith'](_0x4b93a7[_0xbf0f('0x38')][_0xbf0f('0x7')],_0xbf0f('0x4f'))&&_0x423f59['statusCode']==0x1f4){return _0x3565f5[_0xbf0f('0x1f')](_0x423f59[_0xbf0f('0xa2')]);}else{return _0x3565f5['status'](_0x423f59[_0xbf0f('0xa2')])[_0xbf0f('0x33')](_0x423f59[_0xbf0f('0x8d')]);}}else{return _0x3565f5[_0xbf0f('0x1f')](0xc8);}})['catch'](handleError(_0x3565f5,null));};exports[_0xbf0f('0xa3')]=function(_0x428e36,_0x32569e,_0x2da456){return BPromise['resolve']()[_0xbf0f('0x2e')](function(){if(!_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x7')]){throw new Error(_0xbf0f('0x99'));}if(!_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x9a')]){throw new Error(_0xbf0f('0x9b'));}var _0x22d602=_0x428e36['query'][_0xbf0f('0xa4')]?_0x428e36[_0xbf0f('0x38')][_0xbf0f('0xa4')]+':'+_0x428e36['query'][_0xbf0f('0x9a')]:_0xbf0f('0x9c')+_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x9a')];var _0x2472af=_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x21')]?_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x21')]:!![];var _0x3bae27=_0x428e36[_0xbf0f('0x38')][_0xbf0f('0x9d')]?_0x428e36[_0xbf0f('0x38')]['encoding']:null;var _0x4199b5={'method':_0x428e36[_0xbf0f('0xa5')],'uri':util[_0xbf0f('0x52')](_0xbf0f('0x9e'),_0x22d602,_0x428e36['query'][_0xbf0f('0x7')]),'json':_0x2472af,'resolveWithFullResponse':!![],'encoding':_0x3bae27,'body':_0x428e36[_0xbf0f('0x8d')]};if(_0x428e36['headers']){_0x4199b5[_0xbf0f('0x9f')]=_0x428e36[_0xbf0f('0x9f')];if(_0x4199b5['headers'][_0xbf0f('0xa0')]){delete _0x4199b5[_0xbf0f('0x9f')][_0xbf0f('0xa0')];}}if(_0x4199b5['headers'][_0xbf0f('0xa1')]){delete _0x4199b5[_0xbf0f('0x9f')][_0xbf0f('0xa1')];}return rp(_0x4199b5);})[_0xbf0f('0x2e')](function(_0x5c52f7){if(_0x5c52f7){_0x32569e[_0xbf0f('0x26')](_0x5c52f7[_0xbf0f('0x9f')]);logger[_0xbf0f('0x67')](_0x5c52f7[_0xbf0f('0x8d')]);return _0x32569e['status'](_0x5c52f7[_0xbf0f('0xa2')])[_0xbf0f('0x33')](_0x5c52f7[_0xbf0f('0x8d')]);}else{return _0x32569e['sendStatus'](0xc8);}})['catch'](handleError(_0x32569e,null));}; \ No newline at end of file +var _0xf4bf=['Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','content-type','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','get','Plugins','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','fields','find','download','path','join','server/files/plugins','format','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x111d83,_0x39ec2c){var _0x4c59d3=function(_0x166aad){while(--_0x166aad){_0x111d83['push'](_0x111d83['shift']());}};_0x4c59d3(++_0x39ec2c);}(_0xf4bf,0xbf));var _0xff4b=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0xf4bf[_0x87506e];return _0x5496a4;};'use strict';var emlformat=require(_0xff4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff4b('0x1'));var jsonpatch=require(_0xff4b('0x2'));var rp=require('request-promise');var moment=require(_0xff4b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff4b('0x4'));var util=require(_0xff4b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xff4b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff4b('0x7'));var _=require(_0xff4b('0x8'));var squel=require(_0xff4b('0x9'));var crypto=require(_0xff4b('0xa'));var jsforce=require(_0xff4b('0xb'));var deskjs=require(_0xff4b('0xc'));var toCsv=require(_0xff4b('0x6'));var querystring=require('querystring');var Papa=require(_0xff4b('0xd'));var extract=require(_0xff4b('0xe'));var rimraf=require(_0xff4b('0xf'));var archiver=require(_0xff4b('0x10'));var Redis=require(_0xff4b('0x11'));var authService=require(_0xff4b('0x12'));var qs=require(_0xff4b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff4b('0x14'))(_0xff4b('0x15'));var utils=require(_0xff4b('0x16'));var config=require(_0xff4b('0x17'));var licenseUtil=require(_0xff4b('0x18'));var db=require(_0xff4b('0x19'))['db'];config[_0xff4b('0x1a')]=_[_0xff4b('0x1b')](config[_0xff4b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff4b('0x1c'))(new Redis(config['redis']));require(_0xff4b('0x1d'))[_0xff4b('0x1e')](socket);function respondWithStatusCode(_0x68ddfe,_0x4a977b){_0x4a977b=_0x4a977b||0xcc;return function(_0x523bab){if(_0x523bab){return _0x68ddfe[_0xff4b('0x1f')](_0x4a977b);}return _0x68ddfe[_0xff4b('0x20')](_0x4a977b)[_0xff4b('0x21')]();};}function respondWithResult(_0x3654d1,_0x5b961b){_0x5b961b=_0x5b961b||0xc8;return function(_0x10764e){if(_0x10764e){return _0x3654d1[_0xff4b('0x20')](_0x5b961b)[_0xff4b('0x22')](_0x10764e);}};}function respondWithFilteredResult(_0x5ab44f,_0x28aec2){return function(_0x2ddb66){if(_0x2ddb66){var _0x4863f6=typeof _0x28aec2['offset']===_0xff4b('0x23')&&typeof _0x28aec2[_0xff4b('0x24')]===_0xff4b('0x23');var _0x398255=_0x2ddb66[_0xff4b('0x25')];var _0x34ab5b=_0x4863f6?0x0:_0x28aec2[_0xff4b('0x26')];var _0x4a0284=_0x4863f6?_0x2ddb66['count']:_0x28aec2[_0xff4b('0x26')]+_0x28aec2[_0xff4b('0x24')];var _0x3b10e7;if(_0x4a0284>=_0x398255){_0x4a0284=_0x398255;_0x3b10e7=0xc8;}else{_0x3b10e7=0xce;}_0x5ab44f['status'](_0x3b10e7);return _0x5ab44f[_0xff4b('0x27')]('Content-Range',_0x34ab5b+'-'+_0x4a0284+'/'+_0x398255)[_0xff4b('0x22')](_0x2ddb66);}return null;};}function patchUpdates(_0x4e880c){return function(_0x5590c6){try{jsonpatch[_0xff4b('0x28')](_0x5590c6,_0x4e880c,!![]);}catch(_0x7f164f){return BPromise[_0xff4b('0x29')](_0x7f164f);}return _0x5590c6['save']();};}function saveUpdates(_0x5bf566,_0x484a6a){return function(_0x309b8d){if(_0x309b8d){return _0x309b8d[_0xff4b('0x2a')](_0x5bf566)[_0xff4b('0x2b')](function(_0x14c778){return _0x14c778;});}return null;};}function removeEntity(_0x3db192,_0x10f3e2){return function(_0x27aed5){if(_0x27aed5){return _0x27aed5[_0xff4b('0x2c')]()['then'](function(){var _0x5f45d6=_0x27aed5[_0xff4b('0x2d')]({'plain':!![]});var _0x1e8e72=_0xff4b('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x1e8e72,'resourceId':_0x5f45d6['id']}})[_0xff4b('0x2b')](function(){return _0x27aed5;});})[_0xff4b('0x2b')](function(){_0x3db192['status'](0xcc)[_0xff4b('0x21')]();});}};}function handleEntityNotFound(_0x348f4d,_0x339eb6){return function(_0x57b04a){if(!_0x57b04a){_0x348f4d[_0xff4b('0x1f')](0x194);}return _0x57b04a;};}function handleError(_0x2dd0ba,_0x5f11cc){_0x5f11cc=_0x5f11cc||0x1f4;return function(_0x5f53f6){logger[_0xff4b('0x2f')](_0x5f53f6[_0xff4b('0x30')]);if(_0x5f53f6[_0xff4b('0x31')]){delete _0x5f53f6[_0xff4b('0x31')];}_0x2dd0ba[_0xff4b('0x20')](_0x5f11cc)[_0xff4b('0x32')](_0x5f53f6);};}exports[_0xff4b('0x33')]=function(_0x409000,_0x587d5e){var _0x43dc76={},_0x4786a1={},_0x2728af={'count':0x0,'rows':[]};var _0x2638c2=_[_0xff4b('0x34')](db[_0xff4b('0x35')][_0xff4b('0x36')],function(_0x188eb3){return{'name':_0x188eb3[_0xff4b('0x37')],'type':_0x188eb3[_0xff4b('0x38')][_0xff4b('0x39')]};});_0x4786a1['model']=_['map'](_0x2638c2,_0xff4b('0x31'));_0x4786a1['query']=_['keys'](_0x409000[_0xff4b('0x3a')]);_0x4786a1[_0xff4b('0x3b')]=_[_0xff4b('0x3c')](_0x4786a1[_0xff4b('0x3d')],_0x4786a1[_0xff4b('0x3a')]);_0x43dc76[_0xff4b('0x3e')]=_[_0xff4b('0x3c')](_0x4786a1[_0xff4b('0x3d')],qs['fields'](_0x409000['query']['fields']));_0x43dc76[_0xff4b('0x3e')]=_0x43dc76[_0xff4b('0x3e')][_0xff4b('0x3f')]?_0x43dc76[_0xff4b('0x3e')]:_0x4786a1[_0xff4b('0x3d')];if(!_0x409000['query'][_0xff4b('0x40')](_0xff4b('0x41'))){_0x43dc76[_0xff4b('0x24')]=qs[_0xff4b('0x24')](_0x409000[_0xff4b('0x3a')]['limit']);_0x43dc76[_0xff4b('0x26')]=qs[_0xff4b('0x26')](_0x409000[_0xff4b('0x3a')]['offset']);}_0x43dc76[_0xff4b('0x42')]=qs[_0xff4b('0x43')](_0x409000[_0xff4b('0x3a')][_0xff4b('0x43')]);_0x43dc76['where']=qs['filters'](_['pick'](_0x409000[_0xff4b('0x3a')],_0x4786a1['filters']),_0x2638c2);if(_0x409000[_0xff4b('0x3a')][_0xff4b('0x44')]){_0x43dc76[_0xff4b('0x45')]=_[_0xff4b('0x46')](_0x43dc76[_0xff4b('0x45')],{'$or':_[_0xff4b('0x34')](_0x2638c2,function(_0x224094){if(_0x224094[_0xff4b('0x38')]!==_0xff4b('0x47')){var _0x10fede={};_0x10fede[_0x224094[_0xff4b('0x31')]]={'$like':'%'+_0x409000[_0xff4b('0x3a')][_0xff4b('0x44')]+'%'};return _0x10fede;}})});}_0x43dc76=_[_0xff4b('0x46')]({},_0x43dc76,_0x409000[_0xff4b('0x48')]);var _0x420714={'where':_0x43dc76[_0xff4b('0x45')]};return db[_0xff4b('0x35')][_0xff4b('0x25')](_0x420714)[_0xff4b('0x2b')](function(_0x219a22){_0x2728af[_0xff4b('0x25')]=_0x219a22;if(_0x409000[_0xff4b('0x3a')][_0xff4b('0x49')]){_0x43dc76[_0xff4b('0x4a')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x43dc76);})[_0xff4b('0x2b')](function(_0x4f3b6){_0x2728af[_0xff4b('0x4b')]=_0x4f3b6;return _0x2728af;})[_0xff4b('0x2b')](respondWithFilteredResult(_0x587d5e,_0x43dc76))[_0xff4b('0x4c')](handleError(_0x587d5e,null));};exports[_0xff4b('0x4d')]=function(_0xef1dcb,_0xccd49b){var _0x4ab072={'raw':!![],'where':{'id':_0xef1dcb[_0xff4b('0x4e')]['id']}},_0x20a79a={};_0x20a79a['model']=_[_0xff4b('0x4f')](db[_0xff4b('0x35')]['rawAttributes']);_0x20a79a[_0xff4b('0x3a')]=_[_0xff4b('0x4f')](_0xef1dcb['query']);_0x20a79a[_0xff4b('0x3b')]=_[_0xff4b('0x3c')](_0x20a79a[_0xff4b('0x3d')],_0x20a79a[_0xff4b('0x3a')]);_0x4ab072['attributes']=_['intersection'](_0x20a79a['model'],qs['fields'](_0xef1dcb[_0xff4b('0x3a')][_0xff4b('0x50')]));_0x4ab072[_0xff4b('0x3e')]=_0x4ab072[_0xff4b('0x3e')][_0xff4b('0x3f')]?_0x4ab072['attributes']:_0x20a79a[_0xff4b('0x3d')];if(_0xef1dcb[_0xff4b('0x3a')][_0xff4b('0x49')]){_0x4ab072['include']=[{'all':!![]}];}_0x4ab072=_[_0xff4b('0x46')]({},_0x4ab072,_0xef1dcb[_0xff4b('0x48')]);return db[_0xff4b('0x35')][_0xff4b('0x51')](_0x4ab072)[_0xff4b('0x2b')](handleEntityNotFound(_0xccd49b,null))[_0xff4b('0x2b')](respondWithResult(_0xccd49b,null))[_0xff4b('0x4c')](handleError(_0xccd49b,null));};exports[_0xff4b('0x52')]=function(_0x40d654,_0x54dc7c,_0x104b0d){return db['Plugin'][_0xff4b('0x51')]({'where':{'id':_0x40d654['params']['id']},'attributes':[_0xff4b('0x31'),_0xff4b('0x53')],'raw':!![]})[_0xff4b('0x2b')](handleEntityNotFound(_0x54dc7c,null))['then'](function(_0x33f062){if(_0x33f062){var _0x203f0c=path[_0xff4b('0x54')](config['root'],_0xff4b('0x55'),util[_0xff4b('0x56')]('%s.zip',path[_0xff4b('0x57')](_0x33f062[_0xff4b('0x53')])));var _0x325c2e=fs[_0xff4b('0x58')](_0x203f0c);var _0x252dee=archiver(_0xff4b('0x59'),{'zlib':{'level':0x9}});_0x252dee['on'](_0xff4b('0x5a'),function(_0x3e8ee7){if(_0x3e8ee7['code']===_0xff4b('0x5b')){logger[_0xff4b('0x2f')](_0x3e8ee7);}else{throw new db[(_0xff4b('0x5c'))]['Error'](_0xff4b('0x5d'));}});_0x252dee['on'](_0xff4b('0x2f'),function(_0x16ef9e){throw new db[(_0xff4b('0x5c'))][(_0xff4b('0x5e'))](_0xff4b('0x5d'));});_0x252dee[_0xff4b('0x5f')](_0x325c2e);_0x252dee[_0xff4b('0x60')](_0xff4b('0x61'),{'cwd':path['join'](config[_0xff4b('0x62')],_0xff4b('0x55'),path[_0xff4b('0x63')](_0x33f062['path'])),'ignore':[path[_0xff4b('0x54')](path[_0xff4b('0x57')](_0x33f062[_0xff4b('0x53')]),_0xff4b('0x64')),path['join'](path[_0xff4b('0x57')](_0x33f062[_0xff4b('0x53')]),_0xff4b('0x65'))],'nodir':!![]})[_0xff4b('0x66')]();_0x325c2e['on']('close',function(){if(!fs[_0xff4b('0x67')](_0x203f0c)){throw new db[(_0xff4b('0x5c'))]['Error'](_0xff4b('0x68'));}return _0x54dc7c[_0xff4b('0x52')](_0x203f0c,util['format'](_0xff4b('0x69'),path['basename'](_0x33f062[_0xff4b('0x53')])),function(_0x4e03c3){if(_0x4e03c3){throw new db['Sequelize'][(_0xff4b('0x5e'))](_0xff4b('0x6a'));}fs[_0xff4b('0x6b')](_0x203f0c);logger[_0xff4b('0x6c')](_0xff4b('0x6d'));logger[_0xff4b('0x6c')](_0xff4b('0x6e'));});});}return null;})[_0xff4b('0x4c')](handleError(_0x54dc7c,null));};exports[_0xff4b('0x6f')]=function(_0x583f8e,_0x4d70fd,_0x3e5da3){var _0x59f00f=path[_0xff4b('0x57')](_0x583f8e[_0xff4b('0x70')][_0xff4b('0x71')],path[_0xff4b('0x72')](_0x583f8e[_0xff4b('0x70')][_0xff4b('0x71')]));var _0x2b53d6=path[_0xff4b('0x54')](config['root'],_0xff4b('0x55'),_0x583f8e[_0xff4b('0x70')][_0xff4b('0x71')]);var _0x10340a=path[_0xff4b('0x54')](config[_0xff4b('0x62')],'server/files/plugins',_0x59f00f);logger['info'](_0xff4b('0x73'),_0x2b53d6);logger[_0xff4b('0x6c')](_0xff4b('0x74'),_0x10340a);try{fs[_0xff4b('0x75')](_0x2b53d6,parseInt('0777',0x8));extract(_0x2b53d6,{'dir':_0x10340a},function(_0xb67fa2){if(_0xb67fa2){logger['error'](_0xb67fa2);handleError(_0xb67fa2,!![]);};var _0x1a2a27=fs['readdirSync'](_0x10340a);if(_0x1a2a27['length']>0x1){removeReferences(_0x2b53d6,_0x10340a);logger[_0xff4b('0x2f')](_0xff4b('0x76'));return _0x3e5da3(new Error(_0xff4b('0x76')));}var _0xb715c3=fs[_0xff4b('0x77')](path[_0xff4b('0x54')](_0x10340a,_0x1a2a27[0x0]));if(_0xb715c3['isFile']()){removeReferences(_0x2b53d6,_0x10340a);logger[_0xff4b('0x2f')]('Invalid\x20plugin\x20structure');return _0x3e5da3(new Error('Invalid\x20plugin\x20structure'));}if(_0xb715c3['isDirectory']()){var _0x1bf822=fs[_0xff4b('0x78')](path[_0xff4b('0x54')](_0x10340a,_0x1a2a27[0x0]));if(_0x1bf822[_0xff4b('0x3f')]===0x0){removeReferences(_0x2b53d6,_0x10340a);logger['error'](_0xff4b('0x76'));return _0x3e5da3(new Error(_0xff4b('0x76')));}var _0x342813=_0x1bf822[_0xff4b('0x79')](function(_0x292410){return _0x292410==='manifest.json';});if(!_0x342813){return _0x3e5da3(new Error(_0xff4b('0x7a')));}var _0x4b380c=fs['readFileSync'](path[_0xff4b('0x54')](_0x10340a,_0x1a2a27[0x0],_0xff4b('0x7b')));var _0x23aa0e=JSON[_0xff4b('0x7c')](_0x4b380c);if('undefined'==typeof _0x23aa0e['name']){return _0x3e5da3(new Error(_0xff4b('0x7d')));}if('undefined'==typeof _0x23aa0e['type']){return _0x3e5da3(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xff4b('0x23')==typeof _0x23aa0e[_0xff4b('0x7e')]){return _0x3e5da3(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xff4b('0x23')==typeof _0x23aa0e[_0xff4b('0x7f')]){return _0x3e5da3(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x23aa0e[_0xff4b('0x38')]===_0xff4b('0x80')){if('undefined'==typeof _0x23aa0e['parameters']['views']){return _0x3e5da3(new Error(_0xff4b('0x81')));}if('undefined'==typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')][_0xff4b('0x83')]&&'undefined'==typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')]['agent']){return _0x3e5da3(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x23aa0e[_0xff4b('0x38')]===_0xff4b('0x84')){if(_0xff4b('0x23')==typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x85')]){return _0x3e5da3(new Error(_0xff4b('0x86')));}if('undefined'==typeof _0x23aa0e['parameters'][_0xff4b('0x87')]){return _0x3e5da3(new Error(_0xff4b('0x88')));}}else{return _0x3e5da3(new Error(_0xff4b('0x89')));}var _0x5d9b1d=_0x23aa0e[_0xff4b('0x31')];var _0x2bf7d9=_0x23aa0e[_0xff4b('0x8a')];var _0x2249a9=_0x23aa0e[_0xff4b('0x38')];var _0x3bbae0=_0x23aa0e['sidebar']?_0x23aa0e[_0xff4b('0x8b')]:_0xff4b('0x8c');var _0x4db278=_0x23aa0e[_0xff4b('0x8d')]?_0x23aa0e[_0xff4b('0x8d')]:_0xff4b('0x8e');var _0x158173='';var _0x5f204d='';var _0x41ea6d='';var _0x4559a6='';var _0x17fc6e=_0x23aa0e['version'];if(_0x2249a9==='html'){if(_0xff4b('0x23')!=typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')][_0xff4b('0x83')]){var _0x5c25b4=_0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c25b4)){_0x158173=path[_0xff4b('0x54')](_0xff4b('0x8f'),_0x59f00f,_0x1a2a27[0x0],_0x5c25b4);}else{_0x158173=_0x5c25b4;}}else{logger[_0xff4b('0x6c')](_0xff4b('0x90'));}if(_0xff4b('0x23')!=typeof _0x23aa0e[_0xff4b('0x7f')]['views'][_0xff4b('0x91')]){var _0x212b2d=_0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')][_0xff4b('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xff4b('0x92')](_0x212b2d)){_0x5f204d=path['join']('plugins',_0x59f00f,_0x1a2a27[0x0],_0x212b2d);}else{_0x5f204d=_0x212b2d;}}else{logger[_0xff4b('0x6c')](_0xff4b('0x93'));}}else if(_0x2249a9==='script'){_0x41ea6d=_0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x85')];_0x4559a6=_0x23aa0e[_0xff4b('0x7f')]['scriptPath'];if('undefined'!=typeof _0x23aa0e[_0xff4b('0x7f')]['views']){if(_0xff4b('0x23')!=typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')]['admin']){var _0x5c25b4=_0x23aa0e['parameters'][_0xff4b('0x82')][_0xff4b('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xff4b('0x92')](_0x5c25b4)){_0x158173=path['join'](_0xff4b('0x8f'),_0x59f00f,_0x1a2a27[0x0],_0x5c25b4);}else{_0x158173=_0x5c25b4;}}if(_0xff4b('0x23')!=typeof _0x23aa0e[_0xff4b('0x7f')][_0xff4b('0x82')][_0xff4b('0x91')]){var _0x212b2d=_0x23aa0e['parameters'][_0xff4b('0x82')][_0xff4b('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xff4b('0x92')](_0x212b2d)){_0x5f204d=path['join'](_0xff4b('0x8f'),_0x59f00f,_0x1a2a27[0x0],_0x212b2d);}else{_0x5f204d=_0x212b2d;}}}}var _0xd865f7={'name':_0x5d9b1d,'description':_0x2bf7d9,'path':path['join'](_0x59f00f,_0x1a2a27[0x0]),'type':_0x2249a9,'sidebar':_0x3bbae0,'icon':_0x4db278,'adminUrl':_0x158173,'agentUrl':_0x5f204d,'scriptName':_0x41ea6d,'scriptPath':_0x4559a6,'version':_0x17fc6e};removeReferences(_0x2b53d6,null);return db[_0xff4b('0x35')]['create'](_0xd865f7)[_0xff4b('0x2b')](function(_0x25e313){var _0x223818={'role':_0x583f8e[_0xff4b('0x94')][_0xff4b('0x95')],'userProfileId':_0x583f8e[_0xff4b('0x94')][_0xff4b('0x96')]};if(!_0x223818)throw new Error(_0xff4b('0x97'));if(_0x223818['role']===_0xff4b('0x98')){var _0x2fd36d=_0x25e313['get']({'plain':!![]});return db[_0xff4b('0x99')][_0xff4b('0x51')]({'where':{'name':_0xff4b('0x2e'),'userProfileId':_0x223818['userProfileId']},'raw':!![]})[_0xff4b('0x2b')](function(_0x43f446){if(_0x43f446&&_0x43f446[_0xff4b('0x9a')]===0x0){return db['UserProfileResource'][_0xff4b('0x9b')]({'name':_0x2fd36d[_0xff4b('0x31')],'resourceId':_0x2fd36d['id'],'type':_0x43f446[_0xff4b('0x31')],'sectionId':_0x43f446['id']},{})[_0xff4b('0x2b')](function(){return _0x25e313;});}else{return _0x25e313;}})[_0xff4b('0x4c')](function(_0x49527e){logger[_0xff4b('0x2f')](_0xff4b('0x9c'),_0x49527e);throw _0x49527e;});}return _0x25e313;})[_0xff4b('0x2b')](respondWithResult(_0x4d70fd,null))['catch'](handleError(_0x4d70fd,null));}});}catch(_0x1273ee){_0x4d70fd[_0xff4b('0x20')](0x1f4)[_0xff4b('0x32')](_0x1273ee);}};function removeReferences(_0x3030f1,_0x1e94df){try{if(_0x3030f1){fs[_0xff4b('0x6b')](_0x3030f1);logger[_0xff4b('0x6c')](_0xff4b('0x9d'));}if(_0x1e94df){rimraf(_0x1e94df,function(){});logger[_0xff4b('0x6c')](_0xff4b('0x9e'));}}catch(_0x47005b){logger[_0xff4b('0x2f')](_0x47005b);}}exports['update']=function(_0x22c2a8,_0x35830a,_0x4cd9d2){return db[_0xff4b('0x35')][_0xff4b('0x51')]({'where':{'id':_0x22c2a8[_0xff4b('0x4e')]['id']}})[_0xff4b('0x2b')](handleEntityNotFound(_0x35830a,null))[_0xff4b('0x2b')](saveUpdates(_0x22c2a8[_0xff4b('0x94')],null))[_0xff4b('0x2b')](respondWithResult(_0x35830a,null))[_0xff4b('0x4c')](handleError(_0x35830a,null));};exports['delete']=function(_0x55d469,_0x33c047,_0x2fba4b){return db['Plugin']['find']({'where':{'id':_0x55d469['params']['id']}})[_0xff4b('0x2b')](function(_0x417519){if(_0x417519){return _0x417519['destroy']();}})['then'](function(_0x1e314c){rimraf(path[_0xff4b('0x54')](config[_0xff4b('0x62')],_0xff4b('0x55'),path[_0xff4b('0x63')](_0x1e314c['path'])),function(){});return _0x1e314c;})[_0xff4b('0x2b')](handleEntityNotFound(_0x33c047,null))[_0xff4b('0x2b')](respondWithStatusCode(_0x33c047,null))[_0xff4b('0x4c')](handleError(_0x33c047,null));};exports[_0xff4b('0x9f')]=function(_0x395214,_0xbfee80,_0x3653ab){return BPromise[_0xff4b('0xa0')]()[_0xff4b('0x2b')](function(){if(!_0x395214[_0xff4b('0x3a')][_0xff4b('0x53')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x395214['query'][_0xff4b('0xa1')]){throw new Error(_0xff4b('0xa2'));}var _0x3c52ee=_0x395214[_0xff4b('0x3a')]['hostname']?_0x395214[_0xff4b('0x3a')][_0xff4b('0xa3')]+':'+_0x395214[_0xff4b('0x3a')]['port']:'http://localhost:'+_0x395214[_0xff4b('0x3a')][_0xff4b('0xa1')];var _0x11106e=_0x395214[_0xff4b('0x3a')][_0xff4b('0x22')]?_0x395214[_0xff4b('0x3a')][_0xff4b('0x22')]:!![];var _0x1e25a2=_0x395214[_0xff4b('0x3a')][_0xff4b('0xa4')]?_0x395214[_0xff4b('0x3a')][_0xff4b('0xa4')]:null;var _0x27d757={'method':_0x395214[_0xff4b('0xa5')],'uri':util[_0xff4b('0x56')](_0xff4b('0xa6'),_0x3c52ee,_0x395214[_0xff4b('0x3a')][_0xff4b('0x53')]),'json':_0x11106e,'resolveWithFullResponse':!![],'encoding':_0x1e25a2,'qs':_0x395214[_0xff4b('0x3a')]};if(_0x395214['headers']){_0x27d757['headers']=_0x395214[_0xff4b('0xa7')];if(_0x27d757['headers'][_0xff4b('0xa8')]){delete _0x27d757['headers'][_0xff4b('0xa8')];}}if(_0x27d757['headers']['content-type']){delete _0x27d757[_0xff4b('0xa7')]['content-type'];}return rp(_0x27d757);})[_0xff4b('0x2b')](function(_0x3b934e){if(_0x3b934e){_0xbfee80['set'](_0x3b934e[_0xff4b('0xa7')]);logger[_0xff4b('0x6c')](_0x3b934e[_0xff4b('0x94')]);if(_[_0xff4b('0xa9')](_0x395214[_0xff4b('0x3a')]['path'],_0xff4b('0x52'))&&_0x3b934e[_0xff4b('0xaa')]==0x1f4){return _0xbfee80[_0xff4b('0x1f')](_0x3b934e[_0xff4b('0xaa')]);}else{return _0xbfee80[_0xff4b('0x20')](_0x3b934e[_0xff4b('0xaa')])['send'](_0x3b934e[_0xff4b('0x94')]);}}else{return _0xbfee80[_0xff4b('0x1f')](0xc8);}})['catch'](handleError(_0xbfee80,null));};exports[_0xff4b('0xab')]=function(_0x158864,_0x43f48c,_0x3bb9f6){return BPromise[_0xff4b('0xa0')]()[_0xff4b('0x2b')](function(){if(!_0x158864[_0xff4b('0x3a')]['path']){throw new Error(_0xff4b('0xac'));}if(!_0x158864['query'][_0xff4b('0xa1')]){throw new Error(_0xff4b('0xa2'));}var _0x3caa21=_0x158864[_0xff4b('0x3a')][_0xff4b('0xa3')]?_0x158864['query']['hostname']+':'+_0x158864[_0xff4b('0x3a')][_0xff4b('0xa1')]:'http://localhost:'+_0x158864['query'][_0xff4b('0xa1')];var _0x1afa86=_0x158864[_0xff4b('0x3a')][_0xff4b('0x22')]?_0x158864[_0xff4b('0x3a')][_0xff4b('0x22')]:!![];var _0x2aa816=_0x158864['query'][_0xff4b('0xa4')]?_0x158864[_0xff4b('0x3a')]['encoding']:null;var _0x40cbf8={'method':_0x158864[_0xff4b('0xa5')],'uri':util[_0xff4b('0x56')]('%s%s',_0x3caa21,_0x158864[_0xff4b('0x3a')][_0xff4b('0x53')]),'json':_0x1afa86,'resolveWithFullResponse':!![],'encoding':_0x2aa816,'body':_0x158864[_0xff4b('0x94')]};if(_0x158864[_0xff4b('0xa7')]){_0x40cbf8[_0xff4b('0xa7')]=_0x158864[_0xff4b('0xa7')];if(_0x40cbf8[_0xff4b('0xa7')][_0xff4b('0xa8')]){delete _0x40cbf8[_0xff4b('0xa7')][_0xff4b('0xa8')];}}if(_0x40cbf8[_0xff4b('0xa7')][_0xff4b('0xad')]){delete _0x40cbf8['headers'][_0xff4b('0xad')];}return rp(_0x40cbf8);})['then'](function(_0x2caf31){if(_0x2caf31){_0x43f48c[_0xff4b('0x27')](_0x2caf31[_0xff4b('0xa7')]);logger[_0xff4b('0x6c')](_0x2caf31[_0xff4b('0x94')]);return _0x43f48c[_0xff4b('0x20')](_0x2caf31[_0xff4b('0xaa')])[_0xff4b('0x32')](_0x2caf31['body']);}else{return _0x43f48c[_0xff4b('0x1f')](0xc8);}})[_0xff4b('0x4c')](handleError(_0x43f48c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 03a8940..2da9b73 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 _0x04f9=['Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5e4e0d,_0x50999d){var _0x30be72=function(_0x2d88d2){while(--_0x2d88d2){_0x5e4e0d['push'](_0x5e4e0d['shift']());}};_0x30be72(++_0x50999d);}(_0x04f9,0xb3));var _0x904f=function(_0x390c12,_0x2a3434){_0x390c12=_0x390c12-0x0;var _0x3cafca=_0x04f9[_0x390c12];return _0x3cafca;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x904f('0x0'))['db'][_0x904f('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x904f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x904f('0x3'),'afterDestroy':_0x904f('0x4')};function emitEvent(_0x123003){return function(_0x8cc251,_0x243fb2,_0x43a7b4){PluginEvents['emit'](_0x123003+':'+_0x8cc251['id'],_0x8cc251);PluginEvents[_0x904f('0x5')](_0x123003,_0x8cc251);_0x43a7b4(null);};}for(var e in events){if(events[_0x904f('0x6')](e)){var event=events[e];Plugin[_0x904f('0x7')](e,emitEvent(event));}}module[_0x904f('0x8')]=PluginEvents; \ No newline at end of file +var _0xb296=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3c3ac4,_0x28c301){var _0x4b64b0=function(_0x257ebf){while(--_0x257ebf){_0x3c3ac4['push'](_0x3c3ac4['shift']());}};_0x4b64b0(++_0x28c301);}(_0xb296,0xa3));var _0x6b29=function(_0xcdbb9d,_0xc21396){_0xcdbb9d=_0xcdbb9d-0x0;var _0xfcce08=_0xb296[_0xcdbb9d];return _0xfcce08;};'use strict';var EventEmitter=require(_0x6b29('0x0'));var Plugin=require(_0x6b29('0x1'))['db'][_0x6b29('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6b29('0x3')](0x0);var events={'afterCreate':_0x6b29('0x4'),'afterUpdate':_0x6b29('0x5'),'afterDestroy':_0x6b29('0x6')};function emitEvent(_0x48e967){return function(_0x3ff65c,_0x5c1cf5,_0x50a1ba){PluginEvents[_0x6b29('0x7')](_0x48e967+':'+_0x3ff65c['id'],_0x3ff65c);PluginEvents['emit'](_0x48e967,_0x3ff65c);_0x50a1ba(null);};}for(var e in events){if(events[_0x6b29('0x8')](e)){var event=events[e];Plugin[_0x6b29('0x9')](e,emitEvent(event));}}module[_0x6b29('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b9db430..f7f99e6 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 _0x905c=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','util'];(function(_0x52e4b8,_0x5b33aa){var _0x58b976=function(_0x2c326b){while(--_0x2c326b){_0x52e4b8['push'](_0x52e4b8['shift']());}};_0x58b976(++_0x5b33aa);}(_0x905c,0x14e));var _0xc905=function(_0x504311,_0x406462){_0x504311=_0x504311-0x0;var _0x150624=_0x905c[_0x504311];return _0x150624;};'use strict';var _=require(_0xc905('0x0'));var util=require(_0xc905('0x1'));var logger=require(_0xc905('0x2'))(_0xc905('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc905('0x4'));var fs=require('fs');var path=require(_0xc905('0x5'));var rimraf=require(_0xc905('0x6'));var config=require(_0xc905('0x7'));var attributes=require('./plugin.attributes');module[_0xc905('0x8')]=function(_0x1a4087,_0x3ab135){return _0x1a4087[_0xc905('0x9')](_0xc905('0xa'),attributes,{'tableName':_0xc905('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac95=['api','request-promise','path','../../config/environment','./plugin.attributes','define','lodash','util','../../config/logger'];(function(_0x5cdf3c,_0x233f63){var _0x515b20=function(_0x10ef8c){while(--_0x10ef8c){_0x5cdf3c['push'](_0x5cdf3c['shift']());}};_0x515b20(++_0x233f63);}(_0xac95,0xa8));var _0x5ac9=function(_0x1da14c,_0x1c981d){_0x1da14c=_0x1da14c-0x0;var _0x955527=_0xac95[_0x1da14c];return _0x955527;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var logger=require(_0x5ac9('0x2'))(_0x5ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ac9('0x4'));var fs=require('fs');var path=require(_0x5ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x5ac9('0x6'));var attributes=require(_0x5ac9('0x7'));module['exports']=function(_0x1dc09a,_0x2bb4da){return _0x1dc09a[_0x5ac9('0x8')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index f087407..5b047ef 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 _0x0f4e=['catch','Plugin,\x20%s,\x20%s','CreatePlugin','Plugin','create','body','options','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','request\x20sent','stringify','error','code','message','info'];(function(_0x1cdab3,_0x3f9551){var _0x33cc56=function(_0x32286d){while(--_0x32286d){_0x1cdab3['push'](_0x1cdab3['shift']());}};_0x33cc56(++_0x3f9551);}(_0x0f4e,0x166));var _0xe0f4=function(_0x5c8643,_0x4f7c4d){_0x5c8643=_0x5c8643-0x0;var _0x546259=_0x0f4e[_0x5c8643];return _0x546259;};'use strict';var _=require(_0xe0f4('0x0'));var util=require('util');var moment=require(_0xe0f4('0x1'));var BPromise=require(_0xe0f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0f4('0x3'));var logger=require(_0xe0f4('0x4'))(_0xe0f4('0x5'));var config=require('../../config/environment');var jayson=require(_0xe0f4('0x6'));var client=jayson[_0xe0f4('0x7')][_0xe0f4('0x8')]({'port':0x232a});config[_0xe0f4('0x9')]=_['defaults'](config[_0xe0f4('0x9')],{'host':_0xe0f4('0xa'),'port':0x18eb});var socket=require(_0xe0f4('0xb'))(new Redis(config[_0xe0f4('0x9')]));require('./plugin.socket')[_0xe0f4('0xc')](socket);function respondWithRpcPromise(_0x13f13e,_0x3e49bf,_0x253836){return new BPromise(function(_0x377d72,_0x2304cd){return client[_0xe0f4('0xd')](_0x13f13e,_0x253836)['then'](function(_0x2fa046){logger['info']('Plugin,\x20%s,\x20%s',_0x3e49bf,_0xe0f4('0xe'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x3e49bf,'request\x20sent',JSON[_0xe0f4('0xf')](_0x2fa046));if(_0x2fa046[_0xe0f4('0x10')]){if(_0x2fa046[_0xe0f4('0x10')][_0xe0f4('0x11')]===0x1f4){logger[_0xe0f4('0x10')]('Plugin,\x20%s,\x20%s',_0x3e49bf,_0x2fa046['error']['message']);return _0x2304cd(_0x2fa046[_0xe0f4('0x10')][_0xe0f4('0x12')]);}logger[_0xe0f4('0x10')]('Plugin,\x20%s,\x20%s',_0x3e49bf,_0x2fa046['error'][_0xe0f4('0x12')]);return _0x377d72(_0x2fa046[_0xe0f4('0x10')][_0xe0f4('0x12')]);}else{logger[_0xe0f4('0x13')]('Plugin,\x20%s,\x20%s',_0x3e49bf,_0xe0f4('0xe'));_0x377d72(_0x2fa046['result'][_0xe0f4('0x12')]);}})[_0xe0f4('0x14')](function(_0x569434){logger[_0xe0f4('0x10')](_0xe0f4('0x15'),_0x3e49bf,_0x569434);_0x2304cd(_0x569434);});});}exports[_0xe0f4('0x16')]=function(_0x3b95b1){var _0x5e7e98=this;return new Promise(function(_0x968291,_0x2654c8){return db[_0xe0f4('0x17')][_0xe0f4('0x18')](_0x3b95b1[_0xe0f4('0x19')],{'raw':_0x3b95b1[_0xe0f4('0x1a')]?_0x3b95b1[_0xe0f4('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x555538){logger[_0xe0f4('0x13')](_0xe0f4('0x16'),_0x3b95b1);logger['debug'](_0xe0f4('0x16'),_0x3b95b1,JSON['stringify'](_0x555538));_0x968291(_0x555538);})['catch'](function(_0xf2230d){logger[_0xe0f4('0x10')](_0xe0f4('0x16'),_0xf2230d[_0xe0f4('0x12')],_0x3b95b1);_0x2654c8(_0x5e7e98[_0xe0f4('0x10')](0x1f4,_0xf2230d['message']));});});}; \ No newline at end of file +var _0x72f8=['rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4f3f71,_0x1e35ce){var _0x559c25=function(_0x1d874e){while(--_0x1d874e){_0x4f3f71['push'](_0x4f3f71['shift']());}};_0x559c25(++_0x1e35ce);}(_0x72f8,0xa7));var _0x872f=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x72f8[_0xa60623];return _0x4a6487;};'use strict';var _=require(_0x872f('0x0'));var util=require(_0x872f('0x1'));var moment=require(_0x872f('0x2'));var BPromise=require(_0x872f('0x3'));var rs=require(_0x872f('0x4'));var fs=require('fs');var Redis=require(_0x872f('0x5'));var db=require(_0x872f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x872f('0x7'))(_0x872f('0x8'));var config=require(_0x872f('0x9'));var jayson=require(_0x872f('0xa'));var client=jayson['client'][_0x872f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x872f('0xc')],{'host':_0x872f('0xd'),'port':0x18eb});var socket=require(_0x872f('0xe'))(new Redis(config['redis']));require(_0x872f('0xf'))[_0x872f('0x10')](socket);function respondWithRpcPromise(_0x2b50c0,_0x5961bf,_0x6cf758){return new BPromise(function(_0x418fca,_0x579ae4){return client[_0x872f('0x11')](_0x2b50c0,_0x6cf758)[_0x872f('0x12')](function(_0x20e9e2){logger[_0x872f('0x13')](_0x872f('0x14'),_0x5961bf,'request\x20sent');logger[_0x872f('0x15')](_0x872f('0x16'),_0x5961bf,'request\x20sent',JSON['stringify'](_0x20e9e2));if(_0x20e9e2['error']){if(_0x20e9e2['error'][_0x872f('0x17')]===0x1f4){logger[_0x872f('0x18')](_0x872f('0x14'),_0x5961bf,_0x20e9e2[_0x872f('0x18')][_0x872f('0x19')]);return _0x579ae4(_0x20e9e2[_0x872f('0x18')][_0x872f('0x19')]);}logger[_0x872f('0x18')](_0x872f('0x14'),_0x5961bf,_0x20e9e2[_0x872f('0x18')][_0x872f('0x19')]);return _0x418fca(_0x20e9e2['error'][_0x872f('0x19')]);}else{logger[_0x872f('0x13')](_0x872f('0x14'),_0x5961bf,_0x872f('0x1a'));_0x418fca(_0x20e9e2['result']['message']);}})[_0x872f('0x1b')](function(_0x53f11d){logger['error'](_0x872f('0x14'),_0x5961bf,_0x53f11d);_0x579ae4(_0x53f11d);});});}exports[_0x872f('0x1c')]=function(_0x357c74){var _0x50b79e=this;return new Promise(function(_0x538d57,_0x5a6330){return db[_0x872f('0x1d')][_0x872f('0x1e')](_0x357c74[_0x872f('0x1f')],{'raw':_0x357c74[_0x872f('0x20')]?_0x357c74[_0x872f('0x20')][_0x872f('0x21')]===undefined?!![]:![]:!![]})[_0x872f('0x12')](function(_0x1f5fc8){logger[_0x872f('0x13')](_0x872f('0x1c'),_0x357c74);logger[_0x872f('0x15')](_0x872f('0x1c'),_0x357c74,JSON[_0x872f('0x22')](_0x1f5fc8));_0x538d57(_0x1f5fc8);})[_0x872f('0x1b')](function(_0x5aabc1){logger[_0x872f('0x18')](_0x872f('0x1c'),_0x5aabc1[_0x872f('0x19')],_0x357c74);_0x5a6330(_0x50b79e[_0x872f('0x18')](0x1f4,_0x5aabc1[_0x872f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 59644f9..0e2f9ee 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 _0x954a=['save','emit','removeListener','register','length','plugin:'];(function(_0x3a8a78,_0x138a67){var _0x2ed472=function(_0x5c1a13){while(--_0x5c1a13){_0x3a8a78['push'](_0x3a8a78['shift']());}};_0x2ed472(++_0x138a67);}(_0x954a,0x72));var _0xa954=function(_0x318b7b,_0x5a9000){_0x318b7b=_0x318b7b-0x0;var _0x594b63=_0x954a[_0x318b7b];return _0x594b63;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xa954('0x0'),'remove','update'];function createListener(_0x48f6be,_0x2c3f9a){return function(_0x31b322){_0x2c3f9a[_0xa954('0x1')](_0x48f6be,_0x31b322);};}function removeListener(_0x4a093d,_0x5378b2){return function(){PluginEvents[_0xa954('0x2')](_0x4a093d,_0x5378b2);};}exports[_0xa954('0x3')]=function(_0x5033b3){for(var _0x3dab12=0x0,_0x27b6a8=events[_0xa954('0x4')];_0x3dab12<_0x27b6a8;_0x3dab12++){var _0x1ac836=events[_0x3dab12];var _0x3224e7=createListener(_0xa954('0x5')+_0x1ac836,_0x5033b3);PluginEvents['on'](_0x1ac836,_0x3224e7);}}; \ No newline at end of file +var _0x2006=['length','./plugin.events','save','update','emit','removeListener'];(function(_0x54a2f4,_0x47fb9b){var _0x1a4e8e=function(_0x2513db){while(--_0x2513db){_0x54a2f4['push'](_0x54a2f4['shift']());}};_0x1a4e8e(++_0x47fb9b);}(_0x2006,0x127));var _0x6200=function(_0x45fe53,_0x2db07a){_0x45fe53=_0x45fe53-0x0;var _0x5ca306=_0x2006[_0x45fe53];return _0x5ca306;};'use strict';var PluginEvents=require(_0x6200('0x0'));var events=[_0x6200('0x1'),'remove',_0x6200('0x2')];function createListener(_0x4c2ea5,_0x5a60f6){return function(_0x134919){_0x5a60f6[_0x6200('0x3')](_0x4c2ea5,_0x134919);};}function removeListener(_0x318725,_0x2930e1){return function(){PluginEvents[_0x6200('0x4')](_0x318725,_0x2930e1);};}exports['register']=function(_0x529902){for(var _0x2709da=0x0,_0x59ff05=events[_0x6200('0x5')];_0x2709da<_0x59ff05;_0x2709da++){var _0x2d84f7=events[_0x2709da];var _0x275a92=createListener('plugin:'+_0x2d84f7,_0x529902);PluginEvents['on'](_0x2d84f7,_0x275a92);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index fc4f0ba..5d39880 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(_0x367b09,_0x154456){var _0x5a1f82=function(_0x1472e2){while(--_0x1472e2){_0x367b09['push'](_0x367b09['shift']());}};_0x5a1f82(++_0x154456);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x4a42ca,_0x4beefe){var _0x23a3f6=function(_0xb584b1){while(--_0xb584b1){_0x4a42ca['push'](_0x4a42ca['shift']());}};_0x23a3f6(++_0x4beefe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 df6979f..7c434d3 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 _0x2dae=['stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error'];(function(_0x37f89c,_0x49a16c){var _0x4ebeac=function(_0x3147a7){while(--_0x3147a7){_0x37f89c['push'](_0x37f89c['shift']());}};_0x4ebeac(++_0x49a16c);}(_0x2dae,0xc3));var _0xe2da=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x2dae[_0x287a47];return _0x3fb726;};'use strict';var _=require(_0xe2da('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var path=require(_0xe2da('0x3'));var exec=require(_0xe2da('0x4'))[_0xe2da('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x25b9f2,_0x439b5d){return function(_0x77e45e){if(!_0x77e45e){_0x25b9f2[_0xe2da('0x6')](0x194);;}return _0x77e45e;};}function respondWithResult(_0x523c60,_0x3e3e25){_0x3e3e25=_0x3e3e25||0xc8;return function(_0x89c70b){if(_0x89c70b){return _0x523c60[_0xe2da('0x7')](_0x3e3e25)[_0xe2da('0x8')](_0x89c70b);}return null;};}function handleError(_0x238da3,_0x1c71ea){_0x1c71ea=_0x1c71ea||0x1f4;return function(_0x29960a){logger[_0xe2da('0x9')](_0x29960a[_0xe2da('0xa')]);if(_0x29960a['name']){delete _0x29960a[_0xe2da('0xb')];}_0x238da3[_0xe2da('0x7')](_0x1c71ea)[_0xe2da('0xc')](_0x29960a);};}function execChildProcess(){return new BPromise(function(_0x17086c,_0x3c1309){exec(_0xe2da('0xd'),function(_0x1a29b9,_0x173244,_0x5aab71){logger[_0xe2da('0xe')](_0x173244);logger['info'](_0x5aab71);if(_0x1a29b9){logger[_0xe2da('0x9')](_0x1a29b9);return _0x3c1309(_0x1a29b9);}return _0x17086c(_0x173244);});});}exports[_0xe2da('0xf')]=function(_0x37064e,_0x411b9f){return pm2[_0xe2da('0x10')]()[_0xe2da('0x11')](function(_0x295a86){if(_0x295a86){var _0x48584b=_[_0xe2da('0x12')](_0x295a86,function(_0x5e1702){return _0x5e1702['name']===_0xe2da('0x13')||_0x5e1702[_0xe2da('0xb')]===_0xe2da('0x14');});return{'rows':_0x48584b,'count':_0x48584b['length']};}return null;})[_0xe2da('0x11')](respondWithResult(_0x411b9f,null))[_0xe2da('0x15')](handleError(_0x411b9f,null));};exports[_0xe2da('0x16')]=function(_0x33568f,_0x4e1623){return pm2[_0xe2da('0x17')](_0x33568f[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x4e1623,null))[_0xe2da('0x11')](handleEntityNotFound(_0x4e1623,null))[_0xe2da('0x15')](handleError(_0x4e1623,null));};exports['create']=function(_0x56eeb1,_0x2e16b2){if(_0x56eeb1['body'][_0xe2da('0xb')]&&_0x56eeb1[_0xe2da('0x19')][_0xe2da('0x1a')]){var _0x203d36=path[_0xe2da('0x1b')](__dirname,_0xe2da('0x1c'),_0x56eeb1['body'][_0xe2da('0x1a')]);var _0x53cc4e=process[_0xe2da('0x1d')]();process[_0xe2da('0x1e')](path[_0xe2da('0x1f')](_0x203d36));return execChildProcess()[_0xe2da('0x11')](function(_0x30dea4){process[_0xe2da('0x1e')](_0x53cc4e);return pm2[_0xe2da('0x20')]({'name':_0x56eeb1[_0xe2da('0x19')]['name'],'script':_0x203d36});})[_0xe2da('0x11')](function(_0x357bff){pm2[_0xe2da('0x21')]();return _0x357bff[0x0];})[_0xe2da('0x11')](respondWithResult(_0x2e16b2,0xc9))[_0xe2da('0x15')](handleError(_0x2e16b2,null));}else{return _0x2e16b2[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xe2da('0x22')]=function(_0x3e23d7,_0x1dc228){if(_0x3e23d7[_0xe2da('0x19')]['id']){delete _0x3e23d7[_0xe2da('0x19')]['id'];}var _0x2b6c9e={'online':_0xe2da('0x23'),'stopped':_0xe2da('0x24')};if(_0x2b6c9e['hasOwnProperty'](_0x3e23d7['body']['status'])){return pm2[_0x2b6c9e[_0x3e23d7[_0xe2da('0x19')][_0xe2da('0x7')]]](_0x3e23d7[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x1dc228,0xc8))['catch'](handleError(_0x1dc228,null));}else{return _0x1dc228['status'](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x25')});}};exports[_0xe2da('0x26')]=function(_0x39f983,_0x7ab5ee){if(_0x39f983[_0xe2da('0x19')]['id']){delete _0x39f983[_0xe2da('0x19')]['id'];}if(_0x39f983[_0xe2da('0x18')]['id']){return pm2[_0xe2da('0x27')](_0x39f983['params']['id'])['then'](function(_0x672767){pm2[_0xe2da('0x21')]();return _0x672767[0x0];})[_0xe2da('0x11')](respondWithResult(_0x7ab5ee,null))[_0xe2da('0x15')](handleError(_0x7ab5ee,null));}else{return _0x7ab5ee[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x28')});}}; \ No newline at end of file +var _0x5b02=['../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','catch','show','describe','params','create','body','script','join'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0x5b02,0xe9));var _0x25b0=function(_0x330dad,_0x2b4753){_0x330dad=_0x330dad-0x0;var _0x452d85=_0x5b02[_0x330dad];return _0x452d85;};'use strict';var _=require(_0x25b0('0x0'));var pm2=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var path=require('path');var exec=require('child_process')[_0x25b0('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e1d20,_0x31c9c2){return function(_0x38dc14){if(!_0x38dc14){_0x3e1d20[_0x25b0('0x5')](0x194);;}return _0x38dc14;};}function respondWithResult(_0x2d84a9,_0x4eea55){_0x4eea55=_0x4eea55||0xc8;return function(_0x1d82c6){if(_0x1d82c6){return _0x2d84a9[_0x25b0('0x6')](_0x4eea55)['json'](_0x1d82c6);}return null;};}function handleError(_0x412954,_0x4d3e71){_0x4d3e71=_0x4d3e71||0x1f4;return function(_0x56feca){logger[_0x25b0('0x7')](_0x56feca[_0x25b0('0x8')]);if(_0x56feca[_0x25b0('0x9')]){delete _0x56feca['name'];}_0x412954[_0x25b0('0x6')](_0x4d3e71)[_0x25b0('0xa')](_0x56feca);};}function execChildProcess(){return new BPromise(function(_0x135afb,_0x250d31){exec(_0x25b0('0xb'),function(_0x2f57af,_0x44afbc,_0x10c3fb){logger[_0x25b0('0xc')](_0x44afbc);logger[_0x25b0('0xc')](_0x10c3fb);if(_0x2f57af){logger[_0x25b0('0x7')](_0x2f57af);return _0x250d31(_0x2f57af);}return _0x135afb(_0x44afbc);});});}exports[_0x25b0('0xd')]=function(_0x2048dc,_0x3655c2){return pm2[_0x25b0('0xe')]()[_0x25b0('0xf')](function(_0x293203){if(_0x293203){var _0x211658=_[_0x25b0('0x10')](_0x293203,function(_0x3b89e7){return _0x3b89e7[_0x25b0('0x9')]==='express'||_0x3b89e7['name']===_0x25b0('0x11');});return{'rows':_0x211658,'count':_0x211658['length']};}return null;})[_0x25b0('0xf')](respondWithResult(_0x3655c2,null))[_0x25b0('0x12')](handleError(_0x3655c2,null));};exports[_0x25b0('0x13')]=function(_0x3267b9,_0x5e3a3a){return pm2[_0x25b0('0x14')](_0x3267b9[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x5e3a3a,null))[_0x25b0('0xf')](handleEntityNotFound(_0x5e3a3a,null))[_0x25b0('0x12')](handleError(_0x5e3a3a,null));};exports[_0x25b0('0x16')]=function(_0x54f458,_0x348d36){if(_0x54f458[_0x25b0('0x17')][_0x25b0('0x9')]&&_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]){var _0xea4162=path[_0x25b0('0x19')](__dirname,_0x25b0('0x1a'),_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]);var _0x2b2eda=process[_0x25b0('0x1b')]();process['chdir'](path[_0x25b0('0x1c')](_0xea4162));return execChildProcess()[_0x25b0('0xf')](function(_0x517ec5){process[_0x25b0('0x1d')](_0x2b2eda);return pm2[_0x25b0('0x1e')]({'name':_0x54f458[_0x25b0('0x17')]['name'],'script':_0xea4162});})['then'](function(_0x50089e){pm2[_0x25b0('0x1f')]();return _0x50089e[0x0];})[_0x25b0('0xf')](respondWithResult(_0x348d36,0xc9))[_0x25b0('0x12')](handleError(_0x348d36,null));}else{return _0x348d36[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x20')});}};exports[_0x25b0('0x21')]=function(_0x75ce7a,_0x22e024){if(_0x75ce7a['body']['id']){delete _0x75ce7a[_0x25b0('0x17')]['id'];}var _0xbfba84={'online':'restart','stopped':'stop'};if(_0xbfba84['hasOwnProperty'](_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')])){return pm2[_0xbfba84[_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')]]](_0x75ce7a[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x22e024,0xc8))[_0x25b0('0x12')](handleError(_0x22e024,null));}else{return _0x22e024[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x22')});}};exports[_0x25b0('0x23')]=function(_0x3161c1,_0x1ea374){if(_0x3161c1['body']['id']){delete _0x3161c1['body']['id'];}if(_0x3161c1[_0x25b0('0x15')]['id']){return pm2['delete'](_0x3161c1['params']['id'])[_0x25b0('0xf')](function(_0x419975){pm2[_0x25b0('0x1f')]();return _0x419975[0x0];})[_0x25b0('0xf')](respondWithResult(_0x1ea374,null))[_0x25b0('0x12')](handleError(_0x1ea374,null));}else{return _0x1ea374['status'](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index facc457..77f239e 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 _0x9536=['isAuthenticated','express','../../components/auth/service','./realtime.controller','get','/queues'];(function(_0x4d53bf,_0xed9eb3){var _0x28135a=function(_0x41e173){while(--_0x41e173){_0x4d53bf['push'](_0x4d53bf['shift']());}};_0x28135a(++_0xed9eb3);}(_0x9536,0x67));var _0x6953=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x9536[_0x4347ec];return _0x4c8314;};'use strict';var express=require(_0x6953('0x0'));var router=express['Router']();var auth=require(_0x6953('0x1'));var controller=require(_0x6953('0x2'));router[_0x6953('0x3')]('/agents',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x6953('0x4'),auth[_0x6953('0x5')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0x5409=['getQueues','express','Router','./realtime.controller','/agents','isAuthenticated','get'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x5409,0xc5));var _0x9540=function(_0x5cf02e,_0x3bbd3b){_0x5cf02e=_0x5cf02e-0x0;var _0x5e919b=_0x5409[_0x5cf02e];return _0x5e919b;};'use strict';var express=require(_0x9540('0x0'));var router=express[_0x9540('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9540('0x2'));router['get'](_0x9540('0x3'),auth[_0x9540('0x4')](),controller['getAgents']);router[_0x9540('0x5')]('/queues',auth[_0x9540('0x4')](),controller[_0x9540('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8d25a4c..49e0116 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 _0x9c5a=['split','pick','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','outbound','dialActive','dialMethod','QueueCampaigns','Queues','name','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','isValidChannel','format','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','online','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','merge','globalStatus','pause','Status','fields'];(function(_0x4a1b1f,_0x245607){var _0x1ffdef=function(_0x37fecc){while(--_0x37fecc){_0x4a1b1f['push'](_0x4a1b1f['shift']());}};_0x1ffdef(++_0x245607);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x2604ad,_0x4f6ddc){_0x2604ad=_0x2604ad-0x0;var _0x2e1c2f=_0x9c5a[_0x2604ad];return _0x2e1c2f;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xa9c5('0x2'));var qs=require(_0xa9c5('0x3'));var utils=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0xa9c5('0x6')];var APIHandleError=require(_0xa9c5('0x7'))['handleError'];function respondWithFilteredResult(_0x1e3c83,_0x4d9c7a){return function(_0x394d84){if(_0x394d84){var _0x3df556=typeof _0x4d9c7a['offset']==='undefined'&&typeof _0x4d9c7a[_0xa9c5('0x8')]===_0xa9c5('0x9');var _0x52afb2=_0x394d84[_0xa9c5('0xa')];var _0x97f9e2=_0x3df556?0x0:_0x4d9c7a['offset'];var _0x2e4f45=_0x3df556?_0x394d84[_0xa9c5('0xa')]:_0x4d9c7a['offset']+_0x4d9c7a['limit'];var _0x38e106;if(_0x2e4f45>=_0x52afb2){_0x2e4f45=_0x52afb2;_0x38e106=0xc8;}else{_0x38e106=0xce;}_0x1e3c83[_0xa9c5('0xb')](_0x38e106);return _0x1e3c83[_0xa9c5('0xc')](_0xa9c5('0xd'),_0x97f9e2+'-'+_0x2e4f45+'/'+_0x52afb2)[_0xa9c5('0xe')](_0x394d84);}return null;};}exports[_0xa9c5('0xf')]=function(_0x51c8d,_0x42d5cf){var _0x3c5ac7={'count':0x0,'rows':[]};var _0x1ea48={};var _0x5915ad;var _0x390ca2=utils[_0xa9c5('0x10')]();var _0x7df76d;var _0x3806c4;var _0x418ca5=_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x12')];var _0x40b001=_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x13')];var _0x4bb57e=_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x14')];var _0x1ee5ac=_0x40b001==='pause'||_0x40b001===_0xa9c5('0x15')?!![]:![];var _0x1142d9=[];var _0x2b9ac5;var _0x3b8cf7;Promise[_0xa9c5('0x16')]()[_0xa9c5('0x17')](function(){if(_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x18')]){if(!utils[_0xa9c5('0x19')](_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x18')])){throw new APIBadRequestError(util[_0xa9c5('0x1a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x18')]));}_0x5915ad=_0x51c8d['query']['channel'][_0xa9c5('0x1b')]();}if(!_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x1c')]||!_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x1c')][_0xa9c5('0x1d')]('globalStatus')){_0x51c8d['query'][_0xa9c5('0x1c')]=rta[_0xa9c5('0x1e')](_0x51c8d['query'][_0xa9c5('0x1c')]);return;}var _0x424b4c=rta[_0xa9c5('0x1f')](_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x1c')]);_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x1c')]=_0x424b4c['fields']['join'](',');_0x2b9ac5=_0x424b4c[_0xa9c5('0x20')];})['then'](function(){if(!_0x418ca5){return[];}return rta[_0xa9c5('0x21')](_0x418ca5,_0x5915ad);})[_0xa9c5('0x17')](function(_0x4caefa){_0x1142d9=_0x4caefa;return rta[_0xa9c5('0x22')]();})[_0xa9c5('0x17')](function(_0x5f468b){_0x3806c4=_0x5f468b[_0xa9c5('0x23')];if((!_0x40b001||_0x1ee5ac)&&!_0x2b9ac5){return _0x1142d9;}if(_0x2b9ac5&&!_0x40b001){return rta[_0xa9c5('0x24')](_0x3806c4,_0x1142d9,_0x2b9ac5);}else{return rta[_0xa9c5('0x25')](_0x3806c4,_0x1142d9,_0x40b001);}})[_0xa9c5('0x17')](function(_0x325c65){_0x1142d9=_0x325c65;var _0x4f6e70=![];if(_0x1142d9[_0xa9c5('0x26')]===0x0){if(_0x418ca5||_0x40b001){_0x4f6e70=!![];}if(_0x1ee5ac){_0x4f6e70=![];}}if(_0x4f6e70){return _0x3c5ac7;}var _0x4cee90=_[_0xa9c5('0x27')](db[_0xa9c5('0x28')][_0xa9c5('0x29')],function(_0x541475){return{'name':_0x541475[_0xa9c5('0x2a')],'type':_0x541475[_0xa9c5('0x2b')]['key']};});_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x2c')]=_0xa9c5('0x2d');_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x2e')]=!![];_0x1ea48=qs[_0xa9c5('0x2f')](_0x4cee90,_0x51c8d);_0x1ea48[_0xa9c5('0x30')]=!![];var _0x4b9104=[];if(_0x1142d9[_0xa9c5('0x26')]>0x0){_0x4b9104[_0xa9c5('0x31')]({'id':{'$in':_0x1142d9}});if(_0x2b9ac5&&!_0x40b001){_0x3b8cf7=[db[_0xa9c5('0x32')][_0xa9c5('0x33')](_0xa9c5('0x34')+_0x1142d9+')')];_0x1ea48[_0xa9c5('0x20')]=_0x3b8cf7;}}if(_0x1ee5ac){_0x390ca2[_0xa9c5('0x35')](function(_0x36b599){var _0x57ebb7=!![];if(_0x40b001==='*pause'&&_0x5915ad!==_0x36b599){_0x57ebb7=![];}_0x4b9104[_0xa9c5('0x31')]({[_0x36b599+_0xa9c5('0x36')]:_0x57ebb7});});if(_0x4bb57e){_0x4b9104[_0xa9c5('0x31')]({'pauseType':_0x4bb57e});}}else if(_0x40b001){_0x390ca2[_0xa9c5('0x35')](function(_0x296116){_0x4b9104[_0xa9c5('0x31')]({[_0x296116+'Pause']:![]});});}_0x1ea48['where']=_['merge'](_0x1ea48[_0xa9c5('0x37')],{'$and':_0x4b9104});if(_0x51c8d[_0xa9c5('0x38')]['role']===_0xa9c5('0x38')){var _0x56eb82={'params':{'id':_0x51c8d[_0xa9c5('0x38')][_0xa9c5('0x39')]},'query':{'section':_0xa9c5('0x3a'),'role':_0xa9c5('0x2d'),'online':!![],'raw':!![],'ids':_0x1142d9,'customSorting':_0x3b8cf7}};if(_0x1ee5ac){_0x56eb82['query'][_0xa9c5('0x3b')]=_0x4b9104;}_0x56eb82[_0xa9c5('0x11')]=Object[_0xa9c5('0x3c')](_0x56eb82[_0xa9c5('0x11')],_0x51c8d[_0xa9c5('0x11')]);delete _0x56eb82[_0xa9c5('0x11')]['id'];return db[_0xa9c5('0x3d')][_0xa9c5('0x3e')](_0x56eb82);}return db['User'][_0xa9c5('0x3f')](_0x1ea48);})[_0xa9c5('0x17')](function(_0x841c18){_0x3c5ac7[_0xa9c5('0xa')]=_0x841c18[_0xa9c5('0xa')];_0x7df76d=_0x841c18[_0xa9c5('0x23')];return _0x7df76d['map'](function(_0x307736){var _0x5b7a0a=_[_0xa9c5('0x40')](_0x3806c4,['id',_0x307736['id']]);if(_0x5b7a0a){var _0x5c89e7=rta[_0xa9c5('0x41')](_0x5b7a0a);_[_0xa9c5('0x42')](_0x307736,_0x5c89e7);}_0x307736[_0xa9c5('0x43')]=rta['getAgentStatus'](_0x307736);if(_0x307736[_0xa9c5('0x43')][_0xa9c5('0x1d')](_0xa9c5('0x44'))){_0x390ca2[_0xa9c5('0x35')](function(_0x5914d2){if(_0x307736[_0x5914d2+_0xa9c5('0x36')]){_0x307736[_0x5914d2+_0xa9c5('0x45')]=_0xa9c5('0x44');}});}return _0x307736;});})[_0xa9c5('0x17')](function(_0x2a6b48){if(!_0x2b9ac5||_0x3b8cf7){return _0x2a6b48;}return rta['sortAgentsByStatus'](_0x2a6b48,_0x2b9ac5);})[_0xa9c5('0x17')](function(_0x566b60){var _0x1de605=null;if(_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x46')]){var _0xc8fca4=_0x51c8d[_0xa9c5('0x11')][_0xa9c5('0x46')][_0xa9c5('0x47')](',');_0x1de605=_0x566b60[_0xa9c5('0x27')](function(_0x1f895a){return _[_0xa9c5('0x48')](_0x1f895a,_0xc8fca4);});}_0x3c5ac7['rows']=_0x1de605||_0x566b60;return _0x3c5ac7;})[_0xa9c5('0x17')](respondWithFilteredResult(_0x42d5cf,_0x1ea48))[_0xa9c5('0x49')](APIHandleError(_0x42d5cf));};exports[_0xa9c5('0x4a')]=function(_0x31611d,_0x43bd4b){var _0x3794d2={'count':0x0,'rows':[]};var _0x583ec9={};var _0x4194c8;var _0x2ba81e;var _0x557c21;Promise['resolve']()['then'](function(){if(_0x31611d['query']['channel']){if(!utils[_0xa9c5('0x19')](_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x18')])){throw new APIBadRequestError(util[_0xa9c5('0x1a')](_0xa9c5('0x4b'),_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x18')]));}_0x4194c8=_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x18')][_0xa9c5('0x1b')]();}var _0x414ffb=_[_0xa9c5('0x4c')](_0x4194c8)+_0xa9c5('0x4d');var _0x4bf8b4=_[_0xa9c5('0x27')](db[_0x414ffb]['rawAttributes'],function(_0x447335){return{'name':_0x447335[_0xa9c5('0x2a')],'type':_0x447335['type']['key']};});if(!_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x46')]){var _0xeb0720=['id','name'];if(_0x4194c8==='voice'){_0xeb0720[_0xa9c5('0x31')](_0xa9c5('0x2b'));if(_0x31611d['query'][_0xa9c5('0x2b')]===_0xa9c5('0x4e')){_0xeb0720[_0xa9c5('0x31')]([_0xa9c5('0x4f'),_0xa9c5('0x50')]);}}_0x31611d[_0xa9c5('0x11')]['fields']=_0xeb0720['join'](',');}_0x583ec9=qs['getOptions'](_0x4bf8b4,_0x31611d);if(_0x31611d[_0xa9c5('0x38')][_0xa9c5('0x2c')]===_0xa9c5('0x38')){var _0xef4d2={'params':{'id':_0x31611d[_0xa9c5('0x38')][_0xa9c5('0x39')]},'query':{'section':_0x4194c8==='voice'&&_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x2b')]===_0xa9c5('0x4e')?_0xa9c5('0x51'):_[_0xa9c5('0x4c')](_0x4194c8)+_0xa9c5('0x52'),'type':_0x31611d['query']['type'],'nolimit':!![],'sort':_0xa9c5('0x53'),'filter':_0x31611d['query'][_0xa9c5('0x54')]}};_0xef4d2['query']=Object[_0xa9c5('0x3c')](_0xef4d2[_0xa9c5('0x11')],_0x31611d[_0xa9c5('0x11')]);delete _0xef4d2['query']['id'];return db[_0xa9c5('0x3d')][_0xa9c5('0x3e')](_0xef4d2);}return db[_0x414ffb][_0xa9c5('0x3f')](_0x583ec9);})[_0xa9c5('0x17')](function(_0x539672){_0x3794d2['count']=_0x539672[_0xa9c5('0xa')];_0x2ba81e=_0x539672[_0xa9c5('0x23')];return rtq[_0xa9c5('0x55')](_0x31611d,_0x4194c8);})['then'](function(_0x31e12e){_0x557c21=_0x31e12e[_0xa9c5('0x23')];return rtq[_0xa9c5('0x56')](_0x2ba81e,_0x557c21,_0x4194c8,_0x31611d[_0xa9c5('0x11')][_0xa9c5('0x2b')]);})[_0xa9c5('0x17')](function(_0x24fc67){_0x3794d2[_0xa9c5('0x23')]=_0x24fc67;return _0x3794d2;})['then'](respondWithFilteredResult(_0x43bd4b,_0x583ec9))[_0xa9c5('0x49')](APIHandleError(_0x43bd4b));}; \ No newline at end of file +var _0xa41a=['includes','Status','sortAgentsByStatus','fields','split','getQueues','startCase','Queue','rawAttributes','type','name','voice','outbound','dialActive','dialMethod','join','role','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','undefined','limit','count','offset','set','Content-Range','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','fieldName','key','online','getOptions','raw','push','sequelize','literal','forEach','Pause','merge','where','user','userProfileId','Agents','agent','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','getAgentStatus'];(function(_0x30545c,_0x6732d6){var _0x160a05=function(_0x274bf7){while(--_0x274bf7){_0x30545c['push'](_0x30545c['shift']());}};_0x160a05(++_0x6732d6);}(_0xa41a,0x6b));var _0xaa41=function(_0x2d0729,_0xd751ff){_0x2d0729=_0x2d0729-0x0;var _0x325003=_0xa41a[_0x2d0729];return _0x325003;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xaa41('0x2'));var qs=require(_0xaa41('0x3'));var utils=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var APIBadRequestError=require(_0xaa41('0x6'))[_0xaa41('0x7')];var APIHandleError=require(_0xaa41('0x6'))[_0xaa41('0x8')];function respondWithFilteredResult(_0x5dad7c,_0x2122a0){return function(_0x1ec9d4){if(_0x1ec9d4){var _0x54bc5a=typeof _0x2122a0['offset']===_0xaa41('0x9')&&typeof _0x2122a0[_0xaa41('0xa')]==='undefined';var _0x31df43=_0x1ec9d4[_0xaa41('0xb')];var _0x409dab=_0x54bc5a?0x0:_0x2122a0[_0xaa41('0xc')];var _0x4263d6=_0x54bc5a?_0x1ec9d4[_0xaa41('0xb')]:_0x2122a0[_0xaa41('0xc')]+_0x2122a0[_0xaa41('0xa')];var _0x1c291e;if(_0x4263d6>=_0x31df43){_0x4263d6=_0x31df43;_0x1c291e=0xc8;}else{_0x1c291e=0xce;}_0x5dad7c['status'](_0x1c291e);return _0x5dad7c[_0xaa41('0xd')](_0xaa41('0xe'),_0x409dab+'-'+_0x4263d6+'/'+_0x31df43)['json'](_0x1ec9d4);}return null;};}exports['getAgents']=function(_0x1d0a54,_0x518b5b){var _0x19bd69={'count':0x0,'rows':[]};var _0x12d9e6={};var _0x2f64bc;var _0x889d44=utils[_0xaa41('0xf')]();var _0x4eaf81;var _0x1e9d7f;var _0x178170=_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x11')];var _0x2a6988=_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x12')];var _0x550ad5=_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x13')];var _0x4210fa=_0x2a6988===_0xaa41('0x14')||_0x2a6988===_0xaa41('0x15')?!![]:![];var _0xd20ddf=[];var _0x29efe5;var _0x46e6d3;Promise[_0xaa41('0x16')]()['then'](function(){if(_0x1d0a54['query'][_0xaa41('0x17')]){if(!utils[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x10')]['channel'])){throw new APIBadRequestError(util[_0xaa41('0x19')](_0xaa41('0x1a'),_0x1d0a54['query']['channel']));}_0x2f64bc=_0x1d0a54[_0xaa41('0x10')]['channel'][_0xaa41('0x1b')]();}if(!_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x1c')]||!_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x1c')]['includes'](_0xaa41('0x1d'))){_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x1c')]=rta[_0xaa41('0x1e')](_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x1c')]);return;}var _0x5c3074=rta['getUpdatedSortOptions'](_0x1d0a54[_0xaa41('0x10')]['sort']);_0x1d0a54['query'][_0xaa41('0x1c')]=_0x5c3074['fields']['join'](',');_0x29efe5=_0x5c3074[_0xaa41('0x1f')];})[_0xaa41('0x20')](function(){if(!_0x178170){return[];}return rta[_0xaa41('0x21')](_0x178170,_0x2f64bc);})[_0xaa41('0x20')](function(_0x3f5272){_0xd20ddf=_0x3f5272;return rta[_0xaa41('0x22')]();})['then'](function(_0x30a174){_0x1e9d7f=_0x30a174[_0xaa41('0x23')];if((!_0x2a6988||_0x4210fa)&&!_0x29efe5){return _0xd20ddf;}if(_0x29efe5&&!_0x2a6988){return rta[_0xaa41('0x24')](_0x1e9d7f,_0xd20ddf,_0x29efe5);}else{return rta[_0xaa41('0x25')](_0x1e9d7f,_0xd20ddf,_0x2a6988);}})[_0xaa41('0x20')](function(_0x4466a3){_0xd20ddf=_0x4466a3;var _0x30f88e=![];if(_0xd20ddf[_0xaa41('0x26')]===0x0){if(_0x178170||_0x2a6988){_0x30f88e=!![];}if(_0x4210fa){_0x30f88e=![];}}if(_0x30f88e){return _0x19bd69;}var _0x4b1800=_[_0xaa41('0x27')](db['User']['rawAttributes'],function(_0x714537){return{'name':_0x714537[_0xaa41('0x28')],'type':_0x714537['type'][_0xaa41('0x29')]};});_0x1d0a54[_0xaa41('0x10')]['role']='agent';_0x1d0a54['query'][_0xaa41('0x2a')]=!![];_0x12d9e6=qs[_0xaa41('0x2b')](_0x4b1800,_0x1d0a54);_0x12d9e6[_0xaa41('0x2c')]=!![];var _0x38afc4=[];if(_0xd20ddf['length']>0x0){_0x38afc4[_0xaa41('0x2d')]({'id':{'$in':_0xd20ddf}});if(_0x29efe5&&!_0x2a6988){_0x46e6d3=[db[_0xaa41('0x2e')][_0xaa41('0x2f')]('FIELD(id,'+_0xd20ddf+')')];_0x12d9e6[_0xaa41('0x1f')]=_0x46e6d3;}}if(_0x4210fa){_0x889d44[_0xaa41('0x30')](function(_0x321eb7){var _0x57ab80=!![];if(_0x2a6988===_0xaa41('0x15')&&_0x2f64bc!==_0x321eb7){_0x57ab80=![];}_0x38afc4[_0xaa41('0x2d')]({[_0x321eb7+'Pause']:_0x57ab80});});if(_0x550ad5){_0x38afc4[_0xaa41('0x2d')]({'pauseType':_0x550ad5});}}else if(_0x2a6988){_0x889d44[_0xaa41('0x30')](function(_0x2298ed){_0x38afc4['push']({[_0x2298ed+_0xaa41('0x31')]:![]});});}_0x12d9e6['where']=_[_0xaa41('0x32')](_0x12d9e6[_0xaa41('0x33')],{'$and':_0x38afc4});if(_0x1d0a54[_0xaa41('0x34')]['role']==='user'){var _0x4cdd42={'params':{'id':_0x1d0a54[_0xaa41('0x34')][_0xaa41('0x35')]},'query':{'section':_0xaa41('0x36'),'role':_0xaa41('0x37'),'online':!![],'raw':!![],'ids':_0xd20ddf,'customSorting':_0x46e6d3}};if(_0x4210fa){_0x4cdd42['query']['extraQueryConditions']=_0x38afc4;}_0x4cdd42[_0xaa41('0x10')]=Object[_0xaa41('0x38')](_0x4cdd42[_0xaa41('0x10')],_0x1d0a54[_0xaa41('0x10')]);delete _0x4cdd42[_0xaa41('0x10')]['id'];return db[_0xaa41('0x39')][_0xaa41('0x3a')](_0x4cdd42);}return db['User'][_0xaa41('0x3b')](_0x12d9e6);})[_0xaa41('0x20')](function(_0x5caf76){_0x19bd69[_0xaa41('0xb')]=_0x5caf76['count'];_0x4eaf81=_0x5caf76['rows'];return _0x4eaf81[_0xaa41('0x27')](function(_0x275fa3){var _0x5eae08=_[_0xaa41('0x3c')](_0x1e9d7f,['id',_0x275fa3['id']]);if(_0x5eae08){var _0x563687=rta[_0xaa41('0x3d')](_0x5eae08);_[_0xaa41('0x32')](_0x275fa3,_0x563687);}_0x275fa3[_0xaa41('0x1d')]=rta[_0xaa41('0x3e')](_0x275fa3);if(_0x275fa3[_0xaa41('0x1d')][_0xaa41('0x3f')](_0xaa41('0x14'))){_0x889d44[_0xaa41('0x30')](function(_0x5d9b22){if(_0x275fa3[_0x5d9b22+_0xaa41('0x31')]){_0x275fa3[_0x5d9b22+_0xaa41('0x40')]=_0xaa41('0x14');}});}return _0x275fa3;});})[_0xaa41('0x20')](function(_0xc84fb8){if(!_0x29efe5||_0x46e6d3){return _0xc84fb8;}return rta[_0xaa41('0x41')](_0xc84fb8,_0x29efe5);})['then'](function(_0x5bb318){var _0x87e2f4=null;if(_0x1d0a54['query'][_0xaa41('0x42')]){var _0x215896=_0x1d0a54[_0xaa41('0x10')][_0xaa41('0x42')][_0xaa41('0x43')](',');_0x87e2f4=_0x5bb318[_0xaa41('0x27')](function(_0x2db8d6){return _['pick'](_0x2db8d6,_0x215896);});}_0x19bd69[_0xaa41('0x23')]=_0x87e2f4||_0x5bb318;return _0x19bd69;})['then'](respondWithFilteredResult(_0x518b5b,_0x12d9e6))['catch'](APIHandleError(_0x518b5b));};exports[_0xaa41('0x44')]=function(_0x5ee127,_0x57240d){var _0x5274c9={'count':0x0,'rows':[]};var _0x3bad48={};var _0x525b09;var _0x46888a;var _0x198716;Promise['resolve']()['then'](function(){if(_0x5ee127[_0xaa41('0x10')][_0xaa41('0x17')]){if(!utils[_0xaa41('0x18')](_0x5ee127[_0xaa41('0x10')][_0xaa41('0x17')])){throw new APIBadRequestError(util[_0xaa41('0x19')](_0xaa41('0x1a'),_0x5ee127[_0xaa41('0x10')][_0xaa41('0x17')]));}_0x525b09=_0x5ee127['query'][_0xaa41('0x17')][_0xaa41('0x1b')]();}var _0x214ca4=_[_0xaa41('0x45')](_0x525b09)+_0xaa41('0x46');var _0x1d6112=_['map'](db[_0x214ca4][_0xaa41('0x47')],function(_0x16bd22){return{'name':_0x16bd22[_0xaa41('0x28')],'type':_0x16bd22[_0xaa41('0x48')]['key']};});if(!_0x5ee127[_0xaa41('0x10')]['fields']){var _0x49fedd=['id',_0xaa41('0x49')];if(_0x525b09===_0xaa41('0x4a')){_0x49fedd[_0xaa41('0x2d')]('type');if(_0x5ee127[_0xaa41('0x10')][_0xaa41('0x48')]===_0xaa41('0x4b')){_0x49fedd['push']([_0xaa41('0x4c'),_0xaa41('0x4d')]);}}_0x5ee127[_0xaa41('0x10')][_0xaa41('0x42')]=_0x49fedd[_0xaa41('0x4e')](',');}_0x3bad48=qs[_0xaa41('0x2b')](_0x1d6112,_0x5ee127);if(_0x5ee127[_0xaa41('0x34')][_0xaa41('0x4f')]==='user'){var _0x9f0a81={'params':{'id':_0x5ee127['user']['userProfileId']},'query':{'section':_0x525b09===_0xaa41('0x4a')&&_0x5ee127[_0xaa41('0x10')][_0xaa41('0x48')]===_0xaa41('0x4b')?_0xaa41('0x50'):_[_0xaa41('0x45')](_0x525b09)+_0xaa41('0x51'),'type':_0x5ee127[_0xaa41('0x10')]['type'],'nolimit':!![],'sort':_0xaa41('0x49'),'filter':_0x5ee127[_0xaa41('0x10')][_0xaa41('0x52')]}};_0x9f0a81['query']=Object[_0xaa41('0x38')](_0x9f0a81[_0xaa41('0x10')],_0x5ee127['query']);delete _0x9f0a81[_0xaa41('0x10')]['id'];return db[_0xaa41('0x39')][_0xaa41('0x3a')](_0x9f0a81);}return db[_0x214ca4]['findAndCountAll'](_0x3bad48);})[_0xaa41('0x20')](function(_0xc8e626){_0x5274c9['count']=_0xc8e626['count'];_0x46888a=_0xc8e626[_0xaa41('0x23')];return rtq[_0xaa41('0x53')](_0x5ee127,_0x525b09);})[_0xaa41('0x20')](function(_0x4d20c6){_0x198716=_0x4d20c6[_0xaa41('0x23')];return rtq[_0xaa41('0x54')](_0x46888a,_0x198716,_0x525b09,_0x5ee127[_0xaa41('0x10')][_0xaa41('0x48')]);})[_0xaa41('0x20')](function(_0x5ccdc5){_0x5274c9[_0xaa41('0x23')]=_0x5ccdc5;return _0x5274c9;})['then'](respondWithFilteredResult(_0x57240d,_0x3bad48))['catch'](APIHandleError(_0x57240d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 22abadc..74c9b7a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x17eed7,_0x294cfc){var _0x1715fc=function(_0x1aa92e){while(--_0x1aa92e){_0x17eed7['push'](_0x17eed7['shift']());}};_0x1715fc(++_0x294cfc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x38f2c7,_0x342fb9){var _0x1fd721=function(_0x1e1e51){while(--_0x1e1e51){_0x38f2c7['push'](_0x38f2c7['shift']());}};_0x1fd721(++_0x342fb9);}(_0xe706,0xa3));var _0x6e70=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0xe706[_0x340da7];return _0x43b466;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 357ec02..74fa20e 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 _0x64f5=['STRING','sequelize','DATE'];(function(_0x42680d,_0x5620de){var _0x1f62fa=function(_0x55d642){while(--_0x55d642){_0x42680d['push'](_0x42680d['shift']());}};_0x1f62fa(++_0x5620de);}(_0x64f5,0x17e));var _0x564f=function(_0x17019d,_0x5b12cf){_0x17019d=_0x17019d-0x0;var _0x9583d6=_0x64f5[_0x17019d];return _0x9583d6;};'use strict';var Sequelize=require(_0x564f('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x564f('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x564f('0x1')]},'responsetime':{'type':Sequelize[_0x564f('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x564f('0x2')]},'campaigntype':{'type':Sequelize[_0x564f('0x2')]},'membername':{'type':Sequelize[_0x564f('0x2')]}}; \ No newline at end of file +var _0x9efe=['STRING','DATE','exports','INTEGER'];(function(_0x5d73eb,_0x417b0c){var _0x529461=function(_0x2efbeb){while(--_0x2efbeb){_0x5d73eb['push'](_0x5d73eb['shift']());}};_0x529461(++_0x417b0c);}(_0x9efe,0xca));var _0xe9ef=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x9efe[_0x224f65];return _0x3f921c;};'use strict';var Sequelize=require('sequelize');module[_0xe9ef('0x0')]={'state':{'type':Sequelize[_0xe9ef('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe9ef('0x2')]},'scheduledat':{'type':Sequelize[_0xe9ef('0x3')]},'uniqueid':{'type':Sequelize[_0xe9ef('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe9ef('0x3')]},'ringtime':{'type':Sequelize[_0xe9ef('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe9ef('0x2')]},'campaigntype':{'type':Sequelize[_0xe9ef('0x2')]},'membername':{'type':Sequelize[_0xe9ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ad2b746..87c5cad 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 _0xbddc=['../../config/logger','api','bluebird','path','rimraf','exports','define','report_agent_preview','lodash','util'];(function(_0x119b34,_0x4d353f){var _0x50ec6e=function(_0x578f69){while(--_0x578f69){_0x119b34['push'](_0x119b34['shift']());}};_0x50ec6e(++_0x4d353f);}(_0xbddc,0x76));var _0xcbdd=function(_0x287a0c,_0x14b3fc){_0x287a0c=_0x287a0c-0x0;var _0xac4149=_0xbddc[_0x287a0c];return _0xac4149;};'use strict';var _=require(_0xcbdd('0x0'));var util=require(_0xcbdd('0x1'));var logger=require(_0xcbdd('0x2'))(_0xcbdd('0x3'));var moment=require('moment');var BPromise=require(_0xcbdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbdd('0x5'));var rimraf=require(_0xcbdd('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xcbdd('0x7')]=function(_0x44901c,_0x49cecc){return _0x44901c[_0xcbdd('0x8')]('ReportAgentPreview',attributes,{'tableName':_0xcbdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9403=['path','rimraf','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment'];(function(_0x2970b9,_0x1465f6){var _0x591893=function(_0x2e371a){while(--_0x2e371a){_0x2970b9['push'](_0x2970b9['shift']());}};_0x591893(++_0x1465f6);}(_0x9403,0xa6));var _0x3940=function(_0x443672,_0x548123){_0x443672=_0x443672-0x0;var _0x72be21=_0x9403[_0x443672];return _0x72be21;};'use strict';var _=require(_0x3940('0x0'));var util=require(_0x3940('0x1'));var logger=require(_0x3940('0x2'))(_0x3940('0x3'));var moment=require(_0x3940('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3940('0x5'));var rimraf=require(_0x3940('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x58ab9b,_0x2415bd){return _0x58ab9b[_0x3940('0x7')](_0x3940('0x8'),attributes,{'tableName':'report_agent_preview','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 eba5bb8..5f8d8ad 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 _0xa645=['options','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','create'];(function(_0x2c9712,_0x51ae4b){var _0xc1c09d=function(_0x102063){while(--_0x102063){_0x2c9712['push'](_0x2c9712['shift']());}};_0xc1c09d(++_0x51ae4b);}(_0xa645,0xbf));var _0x5a64=function(_0x14e126,_0x4ced47){_0x14e126=_0x14e126-0x0;var _0x53fd17=_0xa645[_0x14e126];return _0x53fd17;};'use strict';var _=require(_0x5a64('0x0'));var util=require('util');var moment=require(_0x5a64('0x1'));var BPromise=require(_0x5a64('0x2'));var rs=require(_0x5a64('0x3'));var fs=require('fs');var Redis=require(_0x5a64('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a64('0x5'));var logger=require(_0x5a64('0x6'))(_0x5a64('0x7'));var config=require(_0x5a64('0x8'));var jayson=require(_0x5a64('0x9'));var client=jayson[_0x5a64('0xa')][_0x5a64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fcd6f,_0x199d61,_0x503bbc){return new BPromise(function(_0x37831c,_0x5c01e0){return client['request'](_0x4fcd6f,_0x503bbc)[_0x5a64('0xc')](function(_0x32a100){logger[_0x5a64('0xd')](_0x5a64('0xe'),_0x199d61,'request\x20sent');logger['debug'](_0x5a64('0xf'),_0x199d61,_0x5a64('0x10'),JSON[_0x5a64('0x11')](_0x32a100));if(_0x32a100[_0x5a64('0x12')]){if(_0x32a100[_0x5a64('0x12')][_0x5a64('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x199d61,_0x32a100[_0x5a64('0x12')][_0x5a64('0x14')]);return _0x5c01e0(_0x32a100[_0x5a64('0x12')][_0x5a64('0x14')]);}logger[_0x5a64('0x12')](_0x5a64('0xe'),_0x199d61,_0x32a100['error'][_0x5a64('0x14')]);return _0x37831c(_0x32a100[_0x5a64('0x12')][_0x5a64('0x14')]);}else{logger[_0x5a64('0xd')](_0x5a64('0xe'),_0x199d61,_0x5a64('0x10'));_0x37831c(_0x32a100[_0x5a64('0x15')][_0x5a64('0x14')]);}})[_0x5a64('0x16')](function(_0x5f1e5c){logger[_0x5a64('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x199d61,_0x5f1e5c);_0x5c01e0(_0x5f1e5c);});});}exports[_0x5a64('0x17')]=function(_0x2f204d){var _0x17d04c=this;return new Promise(function(_0x4bd880,_0x1b648f){return db['ReportAgentPreview'][_0x5a64('0x18')](_0x2f204d['body'],{'raw':_0x2f204d[_0x5a64('0x19')]?_0x2f204d[_0x5a64('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x5a64('0xc')](function(_0x3a1cc2){logger[_0x5a64('0xd')](_0x5a64('0x17'),_0x2f204d);logger[_0x5a64('0x1a')](_0x5a64('0x17'),_0x2f204d,JSON['stringify'](_0x3a1cc2));_0x4bd880(_0x3a1cc2);})[_0x5a64('0x16')](function(_0x58cc1e){logger[_0x5a64('0x12')](_0x5a64('0x17'),_0x58cc1e[_0x5a64('0x14')],_0x2f204d);_0x1b648f(_0x17d04c[_0x5a64('0x12')](0x1f4,_0x58cc1e[_0x5a64('0x14')]));});});}; \ No newline at end of file +var _0x147b=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','request','then','info','request\x20sent','debug'];(function(_0x5eed96,_0x14c53c){var _0x1200cf=function(_0x1bcdc8){while(--_0x1bcdc8){_0x5eed96['push'](_0x5eed96['shift']());}};_0x1200cf(++_0x14c53c);}(_0x147b,0xb6));var _0xb147=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x147b[_0xa45395];return _0x3c83d2;};'use strict';var _=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var moment=require(_0xb147('0x2'));var BPromise=require(_0xb147('0x3'));var rs=require(_0xb147('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb147('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb147('0x6'));var config=require(_0xb147('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb147('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eccf0,_0x39f15c,_0xaf7efe){return new BPromise(function(_0xe56109,_0x3af053){return client[_0xb147('0x9')](_0x1eccf0,_0xaf7efe)[_0xb147('0xa')](function(_0x1d163a){logger[_0xb147('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x39f15c,_0xb147('0xc'));logger[_0xb147('0xd')](_0xb147('0xe'),_0x39f15c,_0xb147('0xc'),JSON[_0xb147('0xf')](_0x1d163a));if(_0x1d163a[_0xb147('0x10')]){if(_0x1d163a[_0xb147('0x10')][_0xb147('0x11')]===0x1f4){logger['error'](_0xb147('0x12'),_0x39f15c,_0x1d163a[_0xb147('0x10')][_0xb147('0x13')]);return _0x3af053(_0x1d163a['error'][_0xb147('0x13')]);}logger[_0xb147('0x10')](_0xb147('0x12'),_0x39f15c,_0x1d163a[_0xb147('0x10')][_0xb147('0x13')]);return _0xe56109(_0x1d163a[_0xb147('0x10')][_0xb147('0x13')]);}else{logger[_0xb147('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x39f15c,'request\x20sent');_0xe56109(_0x1d163a[_0xb147('0x14')][_0xb147('0x13')]);}})[_0xb147('0x15')](function(_0x513fd5){logger[_0xb147('0x10')](_0xb147('0x12'),_0x39f15c,_0x513fd5);_0x3af053(_0x513fd5);});});}exports['CreateReportAgentPreview']=function(_0x360482){var _0x34205c=this;return new Promise(function(_0x7f37d6,_0x127436){return db[_0xb147('0x16')][_0xb147('0x17')](_0x360482[_0xb147('0x18')],{'raw':_0x360482[_0xb147('0x19')]?_0x360482['options'][_0xb147('0x1a')]===undefined?!![]:![]:!![]})[_0xb147('0xa')](function(_0x2c9381){logger[_0xb147('0xb')](_0xb147('0x1b'),_0x360482);logger[_0xb147('0xd')](_0xb147('0x1b'),_0x360482,JSON[_0xb147('0xf')](_0x2c9381));_0x7f37d6(_0x2c9381);})[_0xb147('0x15')](function(_0x29367e){logger[_0xb147('0x10')]('CreateReportAgentPreview',_0x29367e[_0xb147('0x13')],_0x360482);_0x127436(_0x34205c[_0xb147('0x10')](0x1f4,_0x29367e[_0xb147('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a9f394e..1ce076a 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 _0x6300=['/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','express','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues'];(function(_0x4c5fd9,_0x44489f){var _0x434ea6=function(_0x314ef5){while(--_0x314ef5){_0x4c5fd9['push'](_0x4c5fd9['shift']());}};_0x434ea6(++_0x44489f);}(_0x6300,0x1ae));var _0x0630=function(_0x7f7c7e,_0x2fae6a){_0x7f7c7e=_0x7f7c7e-0x0;var _0x5bebab=_0x6300[_0x7f7c7e];return _0x5bebab;};'use strict';var multer=require(_0x0630('0x0'));var util=require('util');var path=require('path');var express=require(_0x0630('0x1'));var router=express['Router']();var auth=require(_0x0630('0x2'));var controller=require(_0x0630('0x3'));router['get']('/voice/channels',auth[_0x0630('0x4')](),controller[_0x0630('0x5')]);router['get'](_0x0630('0x6'),auth[_0x0630('0x4')](),controller[_0x0630('0x7')]);router[_0x0630('0x8')](_0x0630('0x9'),auth[_0x0630('0x4')](),controller[_0x0630('0xa')]);router['get']('/voice/queues',auth[_0x0630('0x4')](),controller[_0x0630('0xb')]);router['get'](_0x0630('0xc'),auth[_0x0630('0x4')](),controller[_0x0630('0xd')]);router[_0x0630('0x8')](_0x0630('0xe'),auth[_0x0630('0x4')](),controller[_0x0630('0xf')]);router[_0x0630('0x8')](_0x0630('0x10'),auth[_0x0630('0x4')](),controller[_0x0630('0x11')]);router[_0x0630('0x8')](_0x0630('0x12'),auth[_0x0630('0x4')](),controller[_0x0630('0x13')]);router[_0x0630('0x8')]('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router[_0x0630('0x8')](_0x0630('0x14'),auth[_0x0630('0x4')](),controller['whatsappQueues']);router['get'](_0x0630('0x15'),auth[_0x0630('0x4')](),controller[_0x0630('0x16')]);router[_0x0630('0x8')](_0x0630('0x17'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x0630('0x8')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x0630('0x18')]);router[_0x0630('0x8')](_0x0630('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x0630('0x8')](_0x0630('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x0630('0x8')](_0x0630('0x1b'),auth[_0x0630('0x4')](),controller[_0x0630('0x1c')]);router['get']('/voice/queues/:id',auth[_0x0630('0x4')](),controller['showVoiceQueues']);router[_0x0630('0x1d')](_0x0630('0x1e'),auth[_0x0630('0x4')](),controller['updateVoiceQueue']);router['get'](_0x0630('0x1f'),auth['isAuthenticated'](),controller[_0x0630('0x20')]);router[_0x0630('0x8')](_0x0630('0x21'),auth[_0x0630('0x4')](),controller[_0x0630('0x22')]);router[_0x0630('0x8')](_0x0630('0x23'),auth['isAuthenticated'](),controller[_0x0630('0x24')]);router[_0x0630('0x1d')](_0x0630('0x25'),auth[_0x0630('0x4')](),controller['agentCapacity']);router[_0x0630('0x8')](_0x0630('0x26'),auth[_0x0630('0x4')](),controller['telephones']);router['get'](_0x0630('0x27'),auth[_0x0630('0x4')](),controller[_0x0630('0x28')]);router['get'](_0x0630('0x29'),auth[_0x0630('0x4')](),controller[_0x0630('0x2a')]);router['get']('/fax/accounts',auth[_0x0630('0x4')](),controller['faxAccounts']);router[_0x0630('0x8')](_0x0630('0x2b'),auth[_0x0630('0x4')](),controller[_0x0630('0x2c')]);router['get'](_0x0630('0x2d'),auth['isAuthenticated'](),controller[_0x0630('0x2e')]);router['get'](_0x0630('0x2f'),auth[_0x0630('0x4')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x0630('0x30'),auth[_0x0630('0x4')](),controller[_0x0630('0x31')]);router['get'](_0x0630('0x32'),auth[_0x0630('0x4')](),controller[_0x0630('0x33')]);router['get'](_0x0630('0x34'),auth['isAuthenticated'](),controller[_0x0630('0x35')]);router['get'](_0x0630('0x36'),auth[_0x0630('0x4')](),controller[_0x0630('0x37')]);router[_0x0630('0x38')](_0x0630('0x39'),auth['isAuthenticated'](),controller[_0x0630('0x3a')](_0x0630('0x3b')));router[_0x0630('0x8')]('/mail/queues/:id',auth[_0x0630('0x4')](),controller[_0x0630('0x3c')]);router[_0x0630('0x38')](_0x0630('0x3d'),auth[_0x0630('0x4')](),controller[_0x0630('0x3a')](_0x0630('0x3e')));router['get']('/chat/queues/:id',auth[_0x0630('0x4')](),controller[_0x0630('0x3f')]);router[_0x0630('0x38')](_0x0630('0x40'),auth['isAuthenticated'](),controller[_0x0630('0x3a')](_0x0630('0x41')));router[_0x0630('0x8')](_0x0630('0x42'),auth[_0x0630('0x4')](),controller[_0x0630('0x43')]);router[_0x0630('0x38')](_0x0630('0x44'),auth[_0x0630('0x4')](),controller[_0x0630('0x3a')](_0x0630('0x45')));router[_0x0630('0x8')](_0x0630('0x46'),auth['isAuthenticated'](),controller[_0x0630('0x47')]);router['post'](_0x0630('0x48'),auth[_0x0630('0x4')](),controller[_0x0630('0x3a')](_0x0630('0x49')));router[_0x0630('0x38')](_0x0630('0x4a'),auth[_0x0630('0x4')](),controller[_0x0630('0x3a')](_0x0630('0x4b')));router['get'](_0x0630('0x4c'),auth[_0x0630('0x4')](),controller[_0x0630('0x4d')]);router['get'](_0x0630('0x4e'),auth[_0x0630('0x4')](),controller[_0x0630('0x4f')]);router[_0x0630('0x38')](_0x0630('0x50'),auth[_0x0630('0x4')](),controller[_0x0630('0x51')]);module[_0x0630('0x52')]=router; \ No newline at end of file +var _0xd3b0=['showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id'];(function(_0x351bdd,_0x28867c){var _0x51c235=function(_0x393d76){while(--_0x393d76){_0x351bdd['push'](_0x351bdd['shift']());}};_0x51c235(++_0x28867c);}(_0xd3b0,0x1f4));var _0x0d3b=function(_0x184745,_0x56d423){_0x184745=_0x184745-0x0;var _0xe7bb23=_0xd3b0[_0x184745];return _0xe7bb23;};'use strict';var multer=require(_0x0d3b('0x0'));var util=require(_0x0d3b('0x1'));var path=require(_0x0d3b('0x2'));var express=require(_0x0d3b('0x3'));var router=express[_0x0d3b('0x4')]();var auth=require(_0x0d3b('0x5'));var controller=require(_0x0d3b('0x6'));router[_0x0d3b('0x7')](_0x0d3b('0x8'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0xa')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x0d3b('0x9')](),controller[_0x0d3b('0xb')]);router[_0x0d3b('0x7')](_0x0d3b('0xc'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0xd')]);router[_0x0d3b('0x7')](_0x0d3b('0xe'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x0d3b('0x7')](_0x0d3b('0xf'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x10')]);router[_0x0d3b('0x7')](_0x0d3b('0x11'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x12')]);router[_0x0d3b('0x7')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x0d3b('0x13')]);router['get'](_0x0d3b('0x14'),auth[_0x0d3b('0x9')](),controller['openchannelQueues']);router[_0x0d3b('0x7')]('/sms/queues',auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x15')]);router['get'](_0x0d3b('0x16'),auth[_0x0d3b('0x9')](),controller['whatsappQueues']);router[_0x0d3b('0x7')](_0x0d3b('0x17'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x18')]);router[_0x0d3b('0x7')](_0x0d3b('0x19'),auth[_0x0d3b('0x9')](),controller['voiceQueuesPreview']);router[_0x0d3b('0x7')](_0x0d3b('0x1a'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x1b')]);router[_0x0d3b('0x7')](_0x0d3b('0x1c'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x1d')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x0d3b('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x0d3b('0x7')](_0x0d3b('0x1e'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x1f')]);router[_0x0d3b('0x7')](_0x0d3b('0x20'),auth['isAuthenticated'](),controller[_0x0d3b('0x21')]);router[_0x0d3b('0x22')](_0x0d3b('0x20'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x23')]);router[_0x0d3b('0x7')](_0x0d3b('0x24'),auth['isAuthenticated'](),controller[_0x0d3b('0x25')]);router['get'](_0x0d3b('0x26'),auth[_0x0d3b('0x9')](),controller['outboundChannels']);router['get'](_0x0d3b('0x27'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x28')]);router[_0x0d3b('0x22')](_0x0d3b('0x29'),auth[_0x0d3b('0x9')](),controller['agentCapacity']);router[_0x0d3b('0x7')](_0x0d3b('0x2a'),auth[_0x0d3b('0x9')](),controller['telephones']);router['get'](_0x0d3b('0x2b'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x2c')]);router[_0x0d3b('0x7')](_0x0d3b('0x2d'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x2e')]);router[_0x0d3b('0x7')]('/fax/accounts',auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x2f')]);router[_0x0d3b('0x7')](_0x0d3b('0x30'),auth[_0x0d3b('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0x0d3b('0x7')](_0x0d3b('0x31'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x32')]);router[_0x0d3b('0x7')](_0x0d3b('0x33'),auth['isAuthenticated'](),controller[_0x0d3b('0x34')]);router[_0x0d3b('0x7')](_0x0d3b('0x35'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x36')]);router[_0x0d3b('0x7')](_0x0d3b('0x37'),auth['isAuthenticated'](),controller[_0x0d3b('0x38')]);router[_0x0d3b('0x7')](_0x0d3b('0x39'),auth[_0x0d3b('0x9')](),controller['whatsappQueuesWaitingInteractions']);router[_0x0d3b('0x7')](_0x0d3b('0x3a'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x3b')]);router[_0x0d3b('0x3c')](_0x0d3b('0x3d'),auth['isAuthenticated'](),controller[_0x0d3b('0x3e')]('mail'));router['get']('/mail/queues/:id',auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x3f')]);router[_0x0d3b('0x3c')](_0x0d3b('0x40'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x3e')](_0x0d3b('0x41')));router[_0x0d3b('0x7')](_0x0d3b('0x42'),auth['isAuthenticated'](),controller[_0x0d3b('0x43')]);router['post']('/fax/queues/:id/notify',auth[_0x0d3b('0x9')](),controller['queueNotify'](_0x0d3b('0x44')));router['get'](_0x0d3b('0x45'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post'](_0x0d3b('0x46'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x3e')]('openchannel'));router[_0x0d3b('0x7')](_0x0d3b('0x47'),auth[_0x0d3b('0x9')](),controller['showOpenchannelQueues']);router[_0x0d3b('0x3c')](_0x0d3b('0x48'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x3e')](_0x0d3b('0x49')));router[_0x0d3b('0x3c')](_0x0d3b('0x4a'),auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router['get'](_0x0d3b('0x4b'),auth['isAuthenticated'](),controller[_0x0d3b('0x4c')]);router['get'](_0x0d3b('0x4d'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router['post'](_0x0d3b('0x4e'),auth[_0x0d3b('0x9')](),controller[_0x0d3b('0x4f')]);module[_0x0d3b('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5cf5b72..f78057b 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 _0xa89a=['faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','agent','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','code','message','catch','json','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','user','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa89a,0xa8));var _0xaa89=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa89a[_0x13e741];return _0x3f8bb3;};'use strict';var BPromise=require(_0xaa89('0x0'));var moment=require(_0xaa89('0x1'));var _=require('lodash');var util=require(_0xaa89('0x2'));var db=require(_0xaa89('0x3'))['db'];var logger=require(_0xaa89('0x4'))(_0xaa89('0x5'));var jayson=require(_0xaa89('0x6'));var amiClient=jayson[_0xaa89('0x7')][_0xaa89('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa89('0x7')][_0xaa89('0x8')]({'port':0x232b});var routingClient=jayson[_0xaa89('0x7')][_0xaa89('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48cb49,_0x2eec7f,_0x3ef832){return new BPromise(function(_0x5a59d1,_0x3007d9){var _0x149596=_0x3ef832?_0x3ef832:amiClient;return _0x149596['request'](_0x48cb49,_0x2eec7f)['then'](function(_0x520fd2){if(_0x520fd2[_0xaa89('0x9')]){if(_0x520fd2['error'][_0xaa89('0xa')]===0x1f4){return _0x3007d9(_0x520fd2[_0xaa89('0x9')][_0xaa89('0xb')]);}return _0x5a59d1(_0x520fd2[_0xaa89('0x9')][_0xaa89('0xb')]);}else{_0x5a59d1(_0x520fd2['result']);}})[_0xaa89('0xc')](function(_0x3e8f83){_0x3007d9(_0x3e8f83);});});}function respondWithResult(_0xbf0d67,_0x2113fb){_0x2113fb=_0x2113fb||0xc8;return function(_0x106367){if(_0x106367){return _0xbf0d67['status'](_0x2113fb)[_0xaa89('0xd')](_0x106367);}return _0xbf0d67['sendStatus'](0x194);};}function handleError(_0x27a006,_0x7fad75){_0x7fad75=_0x7fad75||0x1f4;return function(_0x4b7864){logger[_0xaa89('0x9')](_0x4b7864['stack']);if(_0x4b7864[_0xaa89('0xe')]){delete _0x4b7864['name'];}_0x27a006[_0xaa89('0xf')](_0x7fad75)[_0xaa89('0x10')](_0x4b7864);};}function findById(_0x51ff46){return function(_0x5bd4ec){if(!_[_0xaa89('0x11')](_0x51ff46)&&!_['isNil'](_0x5bd4ec)&&!_[_0xaa89('0x11')](_0x5bd4ec[_0xaa89('0x12')])){return _[_0xaa89('0x13')](_0x5bd4ec[_0xaa89('0x12')],function(_0x265282){return _0x265282['id']==_0x51ff46;});}return null;};}exports[_0xaa89('0x14')]=function(_0x313623,_0x1f6b68){return respondWithRpcPromise(_0xaa89('0x15'),_0x313623[_0xaa89('0x16')])[_0xaa89('0x17')](respondWithResult(_0x1f6b68,null))[_0xaa89('0xc')](handleError(_0x1f6b68,null));};exports['voiceChannelMixMonitor']=function(_0xd2980e,_0x302af){return respondWithRpcPromise(_0xaa89('0x18'),_[_0xaa89('0x19')](_0xd2980e[_0xaa89('0x16')],_0xd2980e[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x302af,null))['catch'](handleError(_0x302af,null));};exports['voiceChannelStopMixMonitor']=function(_0x3f748b,_0x35d520){return respondWithRpcPromise(_0xaa89('0x1b'),_[_0xaa89('0x19')](_0x3f748b['query'],_0x3f748b[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x35d520,null))[_0xaa89('0xc')](handleError(_0x35d520,null));};exports['voiceQueues']=function(_0x1e44e8,_0xa157df){return respondWithRpcPromise(_0xaa89('0x1c'),_0x1e44e8[_0xaa89('0x16')])['then'](respondWithResult(_0xa157df,null))[_0xaa89('0xc')](handleError(_0xa157df,null));};exports[_0xaa89('0x1d')]=function(_0x413734,_0x20b1ea){return respondWithRpcPromise(_0xaa89('0x1c'),_0x413734[_0xaa89('0x16')])['then'](findById(_0x413734[_0xaa89('0x1a')]['id']))[_0xaa89('0x17')](respondWithResult(_0x20b1ea,null))[_0xaa89('0xc')](handleError(_0x20b1ea,null));};exports[_0xaa89('0x1e')]=function(_0x292be0,_0x29c78b){return respondWithRpcPromise(_0xaa89('0x1f'),_[_0xaa89('0x19')](_0x292be0[_0xaa89('0x20')],_0x292be0[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x29c78b,null))[_0xaa89('0xc')](handleError(_0x29c78b,null));};exports[_0xaa89('0x21')]=function(_0x28f3fb,_0xa6328a){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x28f3fb['query'],_0x28f3fb[_0xaa89('0x1a')]))['then'](respondWithResult(_0xa6328a,null))[_0xaa89('0xc')](handleError(_0xa6328a,null));};exports[_0xaa89('0x22')]=function(_0x1dadd9,_0x5c0b8a){return respondWithRpcPromise('VoiceQueuesChannels',_0x1dadd9[_0xaa89('0x16')])[_0xaa89('0x17')](respondWithResult(_0x5c0b8a,null))[_0xaa89('0xc')](handleError(_0x5c0b8a,null));};exports['voiceQueuesChannel']=function(_0x17dc55,_0x31ac58){return respondWithRpcPromise(_0xaa89('0x23'),_[_0xaa89('0x19')](_0x17dc55['query'],_0x17dc55[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x31ac58,null))['catch'](handleError(_0x31ac58,null));};exports[_0xaa89('0x24')]=function(_0x2c62c3,_0x334060){return respondWithRpcPromise(_0xaa89('0x25'),_[_0xaa89('0x19')](_0x2c62c3[_0xaa89('0x16')],_0x2c62c3[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x334060,null))[_0xaa89('0xc')](handleError(_0x334060,null));};exports[_0xaa89('0x26')]=function(_0x1bdbdd,_0x58d4a8){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa89('0x19')](_0x1bdbdd[_0xaa89('0x16')],_0x1bdbdd[_0xaa89('0x1a')]))[_0xaa89('0x17')](respondWithResult(_0x58d4a8,null))[_0xaa89('0xc')](handleError(_0x58d4a8,null));};exports[_0xaa89('0x27')]=function(_0x1b7831,_0x9f6e9a){return respondWithRpcPromise(_0xaa89('0x28'),_0x1b7831['query'])[_0xaa89('0x17')](respondWithResult(_0x9f6e9a,null))[_0xaa89('0xc')](handleError(_0x9f6e9a,null));};exports[_0xaa89('0x29')]=function(_0xf226f1,_0xa24990){return respondWithRpcPromise(_0xaa89('0x2a'),_0xf226f1[_0xaa89('0x16')])['then'](respondWithResult(_0xa24990,null))[_0xaa89('0xc')](handleError(_0xa24990,null));};exports['agents']=function(_0x1f56a3,_0x33ce1c){var _0x5293e4;return respondWithRpcPromise(_0xaa89('0x2b'),_0x1f56a3[_0xaa89('0x16')])['then'](function(_0x5225b){_0x5293e4=_0x5225b;return respondWithRpcPromise(_0xaa89('0x2b'),_0x1f56a3[_0xaa89('0x16')],routingClient);})[_0xaa89('0x17')](function(_0x269276){return _[_0xaa89('0x19')]({},_0x269276,_0x5293e4);})['then'](respondWithResult(_0x33ce1c,null))['catch'](handleError(_0x33ce1c,null));};exports[_0xaa89('0x2c')]=function(_0x8a4f93,_0x16b545){if(_0x8a4f93['body']&&_0x8a4f93[_0xaa89('0x20')][_0xaa89('0x2d')]&&_0x8a4f93['user']&&_0x8a4f93['user'][_0xaa89('0xe')]){for(var _0x424e88 in _0x8a4f93[_0xaa89('0x20')][_0xaa89('0x2d')]){if(_0x8a4f93[_0xaa89('0x20')][_0xaa89('0x2d')][_0xaa89('0x2e')](_0x424e88)){db[_0xaa89('0x2f')]['findAll']({'where':{'channel':_0x424e88,'membername':_0x8a4f93[_0xaa89('0x30')][_0xaa89('0xe')],'type':_0xaa89('0x31'),'exitAt':null,'uniqueid':_0x8a4f93[_0xaa89('0x20')][_0xaa89('0x2d')][_0x424e88]&&_0x8a4f93[_0xaa89('0x20')]['interaction'][_0x424e88][_0xaa89('0x32')]?{'$notIn':_0x8a4f93['body']['interaction'][_0x424e88]}:{'$ne':null}}})[_0xaa89('0x17')](function(_0x30ae71){var _0x4133f1=moment()['format'](_0xaa89('0x33'));for(var _0x3a677a=0x0,_0x5f0273=_0x30ae71[_0xaa89('0x32')];_0x3a677a<_0x5f0273;_0x3a677a+=0x1){_0x30ae71[_0x3a677a][_0xaa89('0x34')]({'exitAt':_0x4133f1});}});for(var _0x2dd488=0x0;_0x2dd488<_0x8a4f93[_0xaa89('0x20')][_0xaa89('0x2d')][_0x424e88][_0xaa89('0x32')];_0x2dd488+=0x1){db[_0xaa89('0x2f')][_0xaa89('0x35')]({'where':{'channel':_0x424e88,'membername':_0x8a4f93[_0xaa89('0x30')][_0xaa89('0xe')],'type':'INTERACTION','uniqueid':_0x8a4f93['body']['interaction'][_0x424e88][_0x2dd488],'exitAt':null},'defaults':{'channel':_0x424e88,'membername':_0x8a4f93[_0xaa89('0x30')][_0xaa89('0xe')],'interface':_[_0xaa89('0x11')](_0x8a4f93[_0xaa89('0x30')][_0xaa89('0x36')])?util[_0xaa89('0x37')](_0xaa89('0x38'),_0x8a4f93['user'][_0xaa89('0xe')]):_0x8a4f93[_0xaa89('0x30')][_0xaa89('0x36')],'type':_0xaa89('0x31'),'enterAt':moment()[_0xaa89('0x37')](_0xaa89('0x33')),'role':'agent','internal':_0x8a4f93[_0xaa89('0x30')][_0xaa89('0x39')],'uniqueid':_0x8a4f93[_0xaa89('0x20')]['interaction'][_0x424e88][_0x2dd488]}});}}}}return respondWithRpcPromise(_0xaa89('0x3a'),{'id':_0x8a4f93[_0xaa89('0x1a')]['id'],'capacity':_0x8a4f93[_0xaa89('0x20')][_0xaa89('0x3b')]},routingClient)[_0xaa89('0x17')](respondWithResult(_0x16b545,null))[_0xaa89('0xc')](handleError(_0x16b545,null));};exports[_0xaa89('0x3c')]=function(_0x7c62fd,_0x5c1a3){return respondWithRpcPromise(_0xaa89('0x3d'),_0x7c62fd[_0xaa89('0x16')])[_0xaa89('0x17')](respondWithResult(_0x5c1a3,null))['catch'](handleError(_0x5c1a3,null));};exports[_0xaa89('0x3e')]=function(_0x1f4a20,_0x2e85ec){return respondWithRpcPromise(_0xaa89('0x3f'),_0x1f4a20['query'])[_0xaa89('0x17')](respondWithResult(_0x2e85ec,null))[_0xaa89('0xc')](handleError(_0x2e85ec,null));};exports[_0xaa89('0x40')]=function(_0x346697,_0x144be5){return respondWithRpcPromise(_0xaa89('0x41'),_0x346697[_0xaa89('0x16')])['then'](respondWithResult(_0x144be5,null))[_0xaa89('0xc')](handleError(_0x144be5,null));};exports['chatQueues']=function(_0x423196,_0x5d7f94){return respondWithRpcPromise(_0xaa89('0x42'),_0x423196[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x5d7f94,null))[_0xaa89('0xc')](handleError(_0x5d7f94,null));};exports['showChatQueues']=function(_0x129371,_0x149389){return respondWithRpcPromise(_0xaa89('0x42'),_0x129371['query'],routingClient)['then'](findById(_0x129371['params']['id']))[_0xaa89('0x17')](respondWithResult(_0x149389,null))[_0xaa89('0xc')](handleError(_0x149389,null));};exports[_0xaa89('0x43')]=function(_0x5d6fe3,_0xaf978a){return respondWithRpcPromise(_0xaa89('0x44'),_0x5d6fe3[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](respondWithResult(_0xaf978a,null))['catch'](handleError(_0xaf978a,null));};exports[_0xaa89('0x45')]=function(_0x3f9840,_0x4b4912){return respondWithRpcPromise(_0xaa89('0x44'),_0x3f9840[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](findById(_0x3f9840['params']['id']))['then'](respondWithResult(_0x4b4912,null))['catch'](handleError(_0x4b4912,null));};exports['mailAccounts']=function(_0x5eb9f0,_0x3be6d7){return respondWithRpcPromise(_0xaa89('0x46'),_0x5eb9f0[_0xaa89('0x16')],mailClient)[_0xaa89('0x17')](respondWithResult(_0x3be6d7,null))[_0xaa89('0xc')](handleError(_0x3be6d7,null));};exports['openchannelQueues']=function(_0x5a1cae,_0x1f1eed){return respondWithRpcPromise(_0xaa89('0x47'),_0x5a1cae[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x1f1eed,null))['catch'](handleError(_0x1f1eed,null));};exports[_0xaa89('0x48')]=function(_0x5c14dd,_0x209124){return respondWithRpcPromise('OpenchannelQueues',_0x5c14dd[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](findById(_0x5c14dd['params']['id']))[_0xaa89('0x17')](respondWithResult(_0x209124,null))[_0xaa89('0xc')](handleError(_0x209124,null));};exports[_0xaa89('0x49')]=function(_0x1858f8,_0x4993f8){return respondWithRpcPromise(_0xaa89('0x4a'),_0x1858f8[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x4993f8,null))[_0xaa89('0xc')](handleError(_0x4993f8,null));};exports[_0xaa89('0x4b')]=function(_0x5df326,_0x503556){return respondWithRpcPromise(_0xaa89('0x4a'),_0x5df326[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](findById(_0x5df326[_0xaa89('0x1a')]['id']))[_0xaa89('0x17')](respondWithResult(_0x503556,null))[_0xaa89('0xc')](handleError(_0x503556,null));};exports[_0xaa89('0x4c')]=function(_0x2e40f2,_0x21e8a8){return respondWithRpcPromise(_0xaa89('0x4d'),_0x2e40f2[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x21e8a8,null))[_0xaa89('0xc')](handleError(_0x21e8a8,null));};exports[_0xaa89('0x4e')]=function(_0x30fe79,_0x465aef){return respondWithRpcPromise(_0xaa89('0x4d'),_0x30fe79['query'],routingClient)[_0xaa89('0x17')](findById(_0x30fe79[_0xaa89('0x1a')]['id']))['then'](respondWithResult(_0x465aef,null))[_0xaa89('0xc')](handleError(_0x465aef,null));};exports[_0xaa89('0x4f')]=function(_0x225ffd,_0x2f4da9){return respondWithRpcPromise(_0xaa89('0x50'),_0x225ffd['query'],routingClient)[_0xaa89('0x17')](respondWithResult(_0x2f4da9,null))[_0xaa89('0xc')](handleError(_0x2f4da9,null));};exports[_0xaa89('0x51')]=function(_0x52d1f6,_0x264c8a){return respondWithRpcPromise('FaxQueues',_0x52d1f6[_0xaa89('0x16')],routingClient)['then'](findById(_0x52d1f6[_0xaa89('0x1a')]['id']))['then'](respondWithResult(_0x264c8a,null))[_0xaa89('0xc')](handleError(_0x264c8a,null));};exports[_0xaa89('0x52')]=function(_0x1b264c,_0x4f1ad9){return respondWithRpcPromise('FaxAccounts',_0x1b264c[_0xaa89('0x16')])[_0xaa89('0x17')](respondWithResult(_0x4f1ad9,null))['catch'](handleError(_0x4f1ad9,null));};exports[_0xaa89('0x53')]=function(_0x2ccdfa,_0x48638c){return respondWithRpcPromise(_0xaa89('0x54'),_0x2ccdfa['query'],routingClient)[_0xaa89('0x17')](respondWithResult(_0x48638c,null))[_0xaa89('0xc')](handleError(_0x48638c,null));};exports['mailQueuesWaitingInteractions']=function(_0x40545e,_0x413380){return respondWithRpcPromise(_0xaa89('0x55'),_0x40545e[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x413380,null))['catch'](handleError(_0x413380,null));};exports[_0xaa89('0x56')]=function(_0x5da286,_0x3c604f){return respondWithRpcPromise(_0xaa89('0x57'),_0x5da286['query'],routingClient)[_0xaa89('0x17')](respondWithResult(_0x3c604f,null))[_0xaa89('0xc')](handleError(_0x3c604f,null));};exports[_0xaa89('0x58')]=function(_0x406d37,_0x201237){return respondWithRpcPromise(_0xaa89('0x57'),_0x406d37['query'],routingClient)['then'](function(_0x4f69bc){if(_0x406d37['query'][_0xaa89('0x59')]!==undefined){var _0x2b6111=_(_0x4f69bc[_0xaa89('0x12')])['filter']([_0x406d37[_0xaa89('0x16')][_0xaa89('0x59')],_0x406d37[_0xaa89('0x1a')]['id']])[_0xaa89('0x5a')](_0xaa89('0x5b'))['uniq']()[_0xaa89('0x5c')]();return _0x4f69bc['rows'][_0xaa89('0x5d')](function(_0x5bcf28){return _0x2b6111[_0xaa89('0x5e')](_0x5bcf28['queue_id'])>-0x1;});}else{return _0x4f69bc[_0xaa89('0x12')][_0xaa89('0x5d')](function(_0x2e1c3b){return _0x2e1c3b[_0xaa89('0x5b')]===parseInt(_0x406d37[_0xaa89('0x1a')]['id']);});}})[_0xaa89('0x17')](respondWithResult(_0x201237,null))[_0xaa89('0xc')](handleError(_0x201237,null));};exports[_0xaa89('0x5f')]=function(_0x437340,_0x2df1a9){return respondWithRpcPromise(_0xaa89('0x60'),_0x437340[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](respondWithResult(_0x2df1a9,null))[_0xaa89('0xc')](handleError(_0x2df1a9,null));};exports[_0xaa89('0x61')]=function(_0x5b3e58,_0x26fdb2){return respondWithRpcPromise(_0xaa89('0x62'),_0x5b3e58[_0xaa89('0x16')],routingClient)['then'](respondWithResult(_0x26fdb2,null))[_0xaa89('0xc')](handleError(_0x26fdb2,null));};exports[_0xaa89('0x63')]=function(_0x266344,_0x20fb77){return respondWithRpcPromise(_0xaa89('0x64'),_0x266344[_0xaa89('0x16')],routingClient)[_0xaa89('0x17')](respondWithResult(_0x20fb77,null))[_0xaa89('0xc')](handleError(_0x20fb77,null));};exports[_0xaa89('0x65')]=function(_0x5a1236){return function(_0x27d4e9,_0x565ebd){var _0x221f6b,_0x1ab1b4;var _0x188018=_[_0xaa89('0x66')](_0x5a1236);var _0x5af4da=_0x5a1236===_0xaa89('0x67')?'Website':_0xaa89('0x68');return db[_0x188018+'Queue'][_0xaa89('0x69')]({'raw':!![],'where':{'id':_0x27d4e9[_0xaa89('0x1a')]['id']}})[_0xaa89('0x17')](function(_0x4f2a8a){if(_[_0xaa89('0x11')](_0x4f2a8a)){throw new Error(_0x188018+_0xaa89('0x6a'));}_0x221f6b=_0x4f2a8a;return db[_0x188018+'Message'][_0xaa89('0x69')]({'where':{'id':_0x27d4e9[_0xaa89('0x20')][_0xaa89('0x6b')]},'include':[{'model':db[_0x188018+_0xaa89('0x6c')],'as':_0xaa89('0x6c')},{'model':db[_0x188018+_0x5af4da],'as':_0xaa89('0x68')}]});})[_0xaa89('0x17')](function(_0x409165){if(_[_0xaa89('0x11')](_0x409165)){throw new Error(_0x188018+_0xaa89('0x6d'));}_0x1ab1b4=_0x409165;return _0x409165['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xaa89('0x17')](function(){var _0x21b185={'uniqueid':_0x5a1236+'.'+_0x1ab1b4['id']+'.'+_0x1ab1b4[_0xaa89('0x6c')]['id'],'FromUserId':_0x27d4e9[_0xaa89('0x30')]['id'],'type':_0xaa89('0x6e')};_0x21b185[_0x188018+_0xaa89('0x6f')]=_0x1ab1b4['id'];_0x21b185[_0x188018+_0xaa89('0x70')]=_0x1ab1b4['Interaction']['id'];_0x21b185[_0xaa89('0x71')+_0x188018+_0x5af4da+'Id']=_0x1ab1b4['Account']['id'];_0x21b185['To'+_0x188018+_0xaa89('0x72')]=_0x221f6b['id'];return db[_0x188018+'TransferReport'][_0xaa89('0x73')](_0x21b185);})[_0xaa89('0x17')](function(){return respondWithRpcPromise('Start',{'channel':_0x5a1236,'interaction':_0x1ab1b4[_0xaa89('0x6c')],'message':_0x1ab1b4,'account':_0x1ab1b4[_0xaa89('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa89('0x6e'),'appdata':_0x221f6b[_0xaa89('0xe')]+','+(_0x1ab1b4[_0xaa89('0x68')][_0xaa89('0x74')]||0x12c),'interval':_0xaa89('0x75')}]},routingClient);})[_0xaa89('0x17')](respondWithResult(_0x565ebd,null))['catch'](handleError(_0x565ebd,null));};};exports[_0xaa89('0x76')]=function(_0xeae846,_0x4e3d47){var _0x55ac92,_0x4f3a16;if(_[_0xaa89('0x11')](_0xeae846[_0xaa89('0x20')][_0xaa89('0x77')])){throw new Error(_0xaa89('0x78'));}var _0xfbd9d6=_0xeae846['body'][_0xaa89('0x77')];var _0x5cf206=_['capitalize'](_0xfbd9d6);var _0x568182=_0xfbd9d6==='chat'?_0xaa89('0x79'):_0xaa89('0x68');return db['User']['findOne']({'raw':!![],'where':{'id':_0xeae846[_0xaa89('0x1a')]['id'],'role':_0xaa89('0x7a')}})['then'](function(_0x5514bc){if(_['isNil'](_0x5514bc)){throw new Error('Agent\x20not\x20found');}_0x55ac92=_0x5514bc;return db[_0x5cf206+_0xaa89('0x7b')]['findOne']({'where':{'id':_0xeae846[_0xaa89('0x20')][_0xaa89('0x6b')]},'include':[{'model':db[_0x5cf206+_0xaa89('0x6c')],'as':_0xaa89('0x6c')},{'model':db[_0x5cf206+_0x568182],'as':_0xaa89('0x68')}]});})[_0xaa89('0x17')](function(_0x2b39a0){if(_[_0xaa89('0x11')](_0x2b39a0)){throw new Error(_0x5cf206+'\x20Message\x20not\x20found');}_0x4f3a16=_0x2b39a0;return _0x2b39a0['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xaa89('0x17')](function(){var _0x5c883f={'uniqueid':_0xfbd9d6+'.'+_0x4f3a16['id']+'.'+_0x4f3a16[_0xaa89('0x6c')]['id'],'FromUserId':_0xeae846[_0xaa89('0x30')]['id'],'type':_0xaa89('0x7a'),'ToUserId':_0x55ac92['id']};_0x5c883f[_0x5cf206+_0xaa89('0x6f')]=_0x4f3a16['id'];_0x5c883f[_0x5cf206+'InteractionId']=_0x4f3a16[_0xaa89('0x6c')]['id'];_0x5c883f[_0xaa89('0x71')+_0x5cf206+_0x568182+'Id']=_0x4f3a16['Account']['id'];return db[_0x5cf206+'TransferReport'][_0xaa89('0x73')](_0x5c883f);})[_0xaa89('0x17')](function(){return respondWithRpcPromise('Start',{'channel':_0xfbd9d6,'interaction':_0x4f3a16[_0xaa89('0x6c')],'message':_0x4f3a16,'account':_0x4f3a16[_0xaa89('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x55ac92[_0xaa89('0xe')]+','+(_0x4f3a16[_0xaa89('0x68')][_0xaa89('0x7c')]||0x12c),'interval':_0xaa89('0x75')}]},routingClient);})['then'](respondWithResult(_0x4e3d47,null))['catch'](handleError(_0x4e3d47,null));}; \ No newline at end of file +var _0x1095=['InteractionId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','agentTransferTimeout','lodash','util','../../config/logger','http','client','request','error','code','message','result','json','stack','name','status','isNil','rows','find','VoiceChannels','query','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','INTERACTION','interaction','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId'];(function(_0x119cd9,_0x5f2c6b){var _0x53c8b0=function(_0x498303){while(--_0x498303){_0x119cd9['push'](_0x119cd9['shift']());}};_0x53c8b0(++_0x5f2c6b);}(_0x1095,0x88));var _0x5109=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x1095[_0x2a6809];return _0x11c371;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x5109('0x0'));var util=require(_0x5109('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x5109('0x2'))('api');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x5109('0x3')]({'port':0x232a});var mailClient=jayson['client'][_0x5109('0x3')]({'port':0x232b});var routingClient=jayson[_0x5109('0x4')][_0x5109('0x3')]({'port':0x232c});function respondWithRpcPromise(_0x2fb127,_0x29d8ad,_0x4d8640){return new BPromise(function(_0x4185af,_0x2830fe){var _0x530ba8=_0x4d8640?_0x4d8640:amiClient;return _0x530ba8[_0x5109('0x5')](_0x2fb127,_0x29d8ad)['then'](function(_0xd42a44){if(_0xd42a44[_0x5109('0x6')]){if(_0xd42a44['error'][_0x5109('0x7')]===0x1f4){return _0x2830fe(_0xd42a44[_0x5109('0x6')][_0x5109('0x8')]);}return _0x4185af(_0xd42a44[_0x5109('0x6')][_0x5109('0x8')]);}else{_0x4185af(_0xd42a44[_0x5109('0x9')]);}})['catch'](function(_0x1e0f73){_0x2830fe(_0x1e0f73);});});}function respondWithResult(_0x39d503,_0xc3a8cc){_0xc3a8cc=_0xc3a8cc||0xc8;return function(_0x1aea2a){if(_0x1aea2a){return _0x39d503['status'](_0xc3a8cc)[_0x5109('0xa')](_0x1aea2a);}return _0x39d503['sendStatus'](0x194);};}function handleError(_0x4d8c4c,_0x1de859){_0x1de859=_0x1de859||0x1f4;return function(_0x14c7fd){logger[_0x5109('0x6')](_0x14c7fd[_0x5109('0xb')]);if(_0x14c7fd[_0x5109('0xc')]){delete _0x14c7fd[_0x5109('0xc')];}_0x4d8c4c[_0x5109('0xd')](_0x1de859)['send'](_0x14c7fd);};}function findById(_0x56fedb){return function(_0x320a78){if(!_[_0x5109('0xe')](_0x56fedb)&&!_[_0x5109('0xe')](_0x320a78)&&!_[_0x5109('0xe')](_0x320a78[_0x5109('0xf')])){return _[_0x5109('0x10')](_0x320a78[_0x5109('0xf')],function(_0x28771e){return _0x28771e['id']==_0x56fedb;});}return null;};}exports['voiceChannels']=function(_0x1b9d52,_0x1863ec){return respondWithRpcPromise(_0x5109('0x11'),_0x1b9d52[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0x1863ec,null))[_0x5109('0x14')](handleError(_0x1863ec,null));};exports[_0x5109('0x15')]=function(_0x404b03,_0x2950de){return respondWithRpcPromise(_0x5109('0x16'),_['merge'](_0x404b03['query'],_0x404b03['params']))[_0x5109('0x13')](respondWithResult(_0x2950de,null))[_0x5109('0x14')](handleError(_0x2950de,null));};exports['voiceChannelStopMixMonitor']=function(_0x882fff,_0x50e519){return respondWithRpcPromise(_0x5109('0x17'),_['merge'](_0x882fff[_0x5109('0x12')],_0x882fff[_0x5109('0x18')]))['then'](respondWithResult(_0x50e519,null))['catch'](handleError(_0x50e519,null));};exports[_0x5109('0x19')]=function(_0x2416f5,_0xe57de6){return respondWithRpcPromise('VoiceQueues',_0x2416f5[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0xe57de6,null))['catch'](handleError(_0xe57de6,null));};exports[_0x5109('0x1a')]=function(_0x1a46ad,_0x4ffb1f){return respondWithRpcPromise(_0x5109('0x1b'),_0x1a46ad['query'])[_0x5109('0x13')](findById(_0x1a46ad['params']['id']))['then'](respondWithResult(_0x4ffb1f,null))[_0x5109('0x14')](handleError(_0x4ffb1f,null));};exports[_0x5109('0x1c')]=function(_0x4cd61a,_0x4fc959){return respondWithRpcPromise(_0x5109('0x1d'),_['merge'](_0x4cd61a[_0x5109('0x1e')],_0x4cd61a[_0x5109('0x18')]))[_0x5109('0x13')](respondWithResult(_0x4fc959,null))[_0x5109('0x14')](handleError(_0x4fc959,null));};exports[_0x5109('0x1f')]=function(_0xffe249,_0x14ae6b){return respondWithRpcPromise(_0x5109('0x20'),_[_0x5109('0x21')](_0xffe249[_0x5109('0x12')],_0xffe249['params']))[_0x5109('0x13')](respondWithResult(_0x14ae6b,null))[_0x5109('0x14')](handleError(_0x14ae6b,null));};exports[_0x5109('0x22')]=function(_0x1fb146,_0x8582e){return respondWithRpcPromise(_0x5109('0x23'),_0x1fb146['query'])['then'](respondWithResult(_0x8582e,null))[_0x5109('0x14')](handleError(_0x8582e,null));};exports[_0x5109('0x24')]=function(_0x5f1dd8,_0x4e1e1e){return respondWithRpcPromise(_0x5109('0x25'),_[_0x5109('0x21')](_0x5f1dd8[_0x5109('0x12')],_0x5f1dd8[_0x5109('0x18')]))[_0x5109('0x13')](respondWithResult(_0x4e1e1e,null))[_0x5109('0x14')](handleError(_0x4e1e1e,null));};exports[_0x5109('0x26')]=function(_0x3e1968,_0x4bf263){return respondWithRpcPromise(_0x5109('0x27'),_[_0x5109('0x21')](_0x3e1968[_0x5109('0x12')],_0x3e1968[_0x5109('0x18')]))[_0x5109('0x13')](respondWithResult(_0x4bf263,null))['catch'](handleError(_0x4bf263,null));};exports[_0x5109('0x28')]=function(_0x28f5ef,_0x3abc91){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x28f5ef[_0x5109('0x12')],_0x28f5ef[_0x5109('0x18')]))[_0x5109('0x13')](respondWithResult(_0x3abc91,null))[_0x5109('0x14')](handleError(_0x3abc91,null));};exports[_0x5109('0x29')]=function(_0x4603d4,_0x45312f){return respondWithRpcPromise(_0x5109('0x2a'),_0x4603d4[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0x45312f,null))[_0x5109('0x14')](handleError(_0x45312f,null));};exports[_0x5109('0x2b')]=function(_0x50051c,_0x4a6508){return respondWithRpcPromise(_0x5109('0x2c'),_0x50051c[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0x4a6508,null))[_0x5109('0x14')](handleError(_0x4a6508,null));};exports[_0x5109('0x2d')]=function(_0x35e281,_0x233b61){var _0x366ed8;return respondWithRpcPromise(_0x5109('0x2e'),_0x35e281[_0x5109('0x12')])[_0x5109('0x13')](function(_0x5c3de5){_0x366ed8=_0x5c3de5;return respondWithRpcPromise(_0x5109('0x2e'),_0x35e281[_0x5109('0x12')],routingClient);})[_0x5109('0x13')](function(_0x3abaf8){return _[_0x5109('0x21')]({},_0x3abaf8,_0x366ed8);})[_0x5109('0x13')](respondWithResult(_0x233b61,null))['catch'](handleError(_0x233b61,null));};exports[_0x5109('0x2f')]=function(_0x506372,_0x31172e){if(_0x506372[_0x5109('0x1e')]&&_0x506372['body']['interaction']&&_0x506372[_0x5109('0x30')]&&_0x506372[_0x5109('0x30')][_0x5109('0xc')]){for(var _0x55340b in _0x506372[_0x5109('0x1e')]['interaction']){if(_0x506372[_0x5109('0x1e')]['interaction'][_0x5109('0x31')](_0x55340b)){db[_0x5109('0x32')]['findAll']({'where':{'channel':_0x55340b,'membername':_0x506372['user']['name'],'type':_0x5109('0x33'),'exitAt':null,'uniqueid':_0x506372[_0x5109('0x1e')]['interaction'][_0x55340b]&&_0x506372[_0x5109('0x1e')][_0x5109('0x34')][_0x55340b][_0x5109('0x35')]?{'$notIn':_0x506372[_0x5109('0x1e')][_0x5109('0x34')][_0x55340b]}:{'$ne':null}}})['then'](function(_0x3783dc){var _0x282d4c=moment()['format'](_0x5109('0x36'));for(var _0x3022dc=0x0,_0x5b79c8=_0x3783dc[_0x5109('0x35')];_0x3022dc<_0x5b79c8;_0x3022dc+=0x1){_0x3783dc[_0x3022dc][_0x5109('0x37')]({'exitAt':_0x282d4c});}});for(var _0x3ae93e=0x0;_0x3ae93e<_0x506372[_0x5109('0x1e')]['interaction'][_0x55340b][_0x5109('0x35')];_0x3ae93e+=0x1){db[_0x5109('0x32')][_0x5109('0x38')]({'where':{'channel':_0x55340b,'membername':_0x506372[_0x5109('0x30')]['name'],'type':'INTERACTION','uniqueid':_0x506372[_0x5109('0x1e')][_0x5109('0x34')][_0x55340b][_0x3ae93e],'exitAt':null},'defaults':{'channel':_0x55340b,'membername':_0x506372[_0x5109('0x30')][_0x5109('0xc')],'interface':_[_0x5109('0xe')](_0x506372[_0x5109('0x30')][_0x5109('0x39')])?util[_0x5109('0x3a')](_0x5109('0x3b'),_0x506372[_0x5109('0x30')]['name']):_0x506372[_0x5109('0x30')]['interface'],'type':'INTERACTION','enterAt':moment()[_0x5109('0x3a')](_0x5109('0x36')),'role':_0x5109('0x3c'),'internal':_0x506372[_0x5109('0x30')][_0x5109('0x3d')],'uniqueid':_0x506372[_0x5109('0x1e')][_0x5109('0x34')][_0x55340b][_0x3ae93e]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x506372[_0x5109('0x18')]['id'],'capacity':_0x506372[_0x5109('0x1e')]['capacity']},routingClient)[_0x5109('0x13')](respondWithResult(_0x31172e,null))['catch'](handleError(_0x31172e,null));};exports[_0x5109('0x3e')]=function(_0x2cdd10,_0xe94d8){return respondWithRpcPromise('Telephones',_0x2cdd10['query'])[_0x5109('0x13')](respondWithResult(_0xe94d8,null))['catch'](handleError(_0xe94d8,null));};exports[_0x5109('0x3f')]=function(_0x46ed51,_0xcb95b9){return respondWithRpcPromise('Trunks',_0x46ed51[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0xcb95b9,null))['catch'](handleError(_0xcb95b9,null));};exports[_0x5109('0x40')]=function(_0x36efd0,_0x428e0f){return respondWithRpcPromise(_0x5109('0x41'),_0x36efd0[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0x428e0f,null))[_0x5109('0x14')](handleError(_0x428e0f,null));};exports[_0x5109('0x42')]=function(_0x37976b,_0x3a0b3d){return respondWithRpcPromise('ChatQueues',_0x37976b[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x3a0b3d,null))[_0x5109('0x14')](handleError(_0x3a0b3d,null));};exports[_0x5109('0x43')]=function(_0x39462a,_0x5dc1ce){return respondWithRpcPromise(_0x5109('0x44'),_0x39462a[_0x5109('0x12')],routingClient)[_0x5109('0x13')](findById(_0x39462a[_0x5109('0x18')]['id']))[_0x5109('0x13')](respondWithResult(_0x5dc1ce,null))['catch'](handleError(_0x5dc1ce,null));};exports[_0x5109('0x45')]=function(_0x120cc5,_0x3a29e9){return respondWithRpcPromise(_0x5109('0x46'),_0x120cc5['query'],routingClient)[_0x5109('0x13')](respondWithResult(_0x3a29e9,null))[_0x5109('0x14')](handleError(_0x3a29e9,null));};exports[_0x5109('0x47')]=function(_0x2e491c,_0x4e6d13){return respondWithRpcPromise(_0x5109('0x46'),_0x2e491c[_0x5109('0x12')],routingClient)['then'](findById(_0x2e491c[_0x5109('0x18')]['id']))[_0x5109('0x13')](respondWithResult(_0x4e6d13,null))[_0x5109('0x14')](handleError(_0x4e6d13,null));};exports[_0x5109('0x48')]=function(_0x51ce9f,_0x5a3b18){return respondWithRpcPromise(_0x5109('0x49'),_0x51ce9f[_0x5109('0x12')],mailClient)[_0x5109('0x13')](respondWithResult(_0x5a3b18,null))[_0x5109('0x14')](handleError(_0x5a3b18,null));};exports['openchannelQueues']=function(_0x224293,_0x119df0){return respondWithRpcPromise(_0x5109('0x4a'),_0x224293[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x119df0,null))[_0x5109('0x14')](handleError(_0x119df0,null));};exports['showOpenchannelQueues']=function(_0x113481,_0x4c0f6a){return respondWithRpcPromise(_0x5109('0x4a'),_0x113481[_0x5109('0x12')],routingClient)[_0x5109('0x13')](findById(_0x113481[_0x5109('0x18')]['id']))['then'](respondWithResult(_0x4c0f6a,null))[_0x5109('0x14')](handleError(_0x4c0f6a,null));};exports[_0x5109('0x4b')]=function(_0x3c8097,_0xd27aa3){return respondWithRpcPromise(_0x5109('0x4c'),_0x3c8097[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0xd27aa3,null))[_0x5109('0x14')](handleError(_0xd27aa3,null));};exports[_0x5109('0x4d')]=function(_0xf71af0,_0x3b44fd){return respondWithRpcPromise(_0x5109('0x4c'),_0xf71af0[_0x5109('0x12')],routingClient)[_0x5109('0x13')](findById(_0xf71af0[_0x5109('0x18')]['id']))[_0x5109('0x13')](respondWithResult(_0x3b44fd,null))['catch'](handleError(_0x3b44fd,null));};exports[_0x5109('0x4e')]=function(_0x491e48,_0x377305){return respondWithRpcPromise(_0x5109('0x4f'),_0x491e48[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x377305,null))[_0x5109('0x14')](handleError(_0x377305,null));};exports['showWhatsappQueues']=function(_0x41a010,_0x344128){return respondWithRpcPromise(_0x5109('0x4f'),_0x41a010[_0x5109('0x12')],routingClient)['then'](findById(_0x41a010[_0x5109('0x18')]['id']))[_0x5109('0x13')](respondWithResult(_0x344128,null))[_0x5109('0x14')](handleError(_0x344128,null));};exports['faxQueues']=function(_0x5840c6,_0x24d63f){return respondWithRpcPromise('FaxQueues',_0x5840c6[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x24d63f,null))[_0x5109('0x14')](handleError(_0x24d63f,null));};exports['showFaxQueues']=function(_0x39da0b,_0x1d076c){return respondWithRpcPromise('FaxQueues',_0x39da0b[_0x5109('0x12')],routingClient)[_0x5109('0x13')](findById(_0x39da0b['params']['id']))[_0x5109('0x13')](respondWithResult(_0x1d076c,null))[_0x5109('0x14')](handleError(_0x1d076c,null));};exports['faxAccounts']=function(_0x11d4e0,_0x3a2258){return respondWithRpcPromise(_0x5109('0x50'),_0x11d4e0[_0x5109('0x12')])[_0x5109('0x13')](respondWithResult(_0x3a2258,null))['catch'](handleError(_0x3a2258,null));};exports[_0x5109('0x51')]=function(_0x3b8044,_0x29cf8e){return respondWithRpcPromise(_0x5109('0x52'),_0x3b8044[_0x5109('0x12')],routingClient)['then'](respondWithResult(_0x29cf8e,null))['catch'](handleError(_0x29cf8e,null));};exports[_0x5109('0x53')]=function(_0x5eecf2,_0x43c5fd){return respondWithRpcPromise(_0x5109('0x54'),_0x5eecf2[_0x5109('0x12')],routingClient)['then'](respondWithResult(_0x43c5fd,null))[_0x5109('0x14')](handleError(_0x43c5fd,null));};exports[_0x5109('0x55')]=function(_0x35da51,_0x2f2476){return respondWithRpcPromise(_0x5109('0x56'),_0x35da51[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x2f2476,null))[_0x5109('0x14')](handleError(_0x2f2476,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5236d4,_0x3a84e2){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5236d4[_0x5109('0x12')],routingClient)['then'](function(_0x52b04a){if(_0x5236d4['query'][_0x5109('0x57')]!==undefined){var _0x9edcb2=_(_0x52b04a['rows'])[_0x5109('0x58')]([_0x5236d4[_0x5109('0x12')]['type'],_0x5236d4['params']['id']])['map'](_0x5109('0x59'))[_0x5109('0x5a')]()['value']();return _0x52b04a[_0x5109('0xf')][_0x5109('0x58')](function(_0x57ab4b){return _0x9edcb2[_0x5109('0x5b')](_0x57ab4b[_0x5109('0x59')])>-0x1;});}else{return _0x52b04a[_0x5109('0xf')][_0x5109('0x58')](function(_0x281e0c){return _0x281e0c[_0x5109('0x59')]===parseInt(_0x5236d4[_0x5109('0x18')]['id']);});}})[_0x5109('0x13')](respondWithResult(_0x3a84e2,null))[_0x5109('0x14')](handleError(_0x3a84e2,null));};exports[_0x5109('0x5c')]=function(_0x2549f2,_0x2898a0){return respondWithRpcPromise(_0x5109('0x5d'),_0x2549f2['query'],routingClient)[_0x5109('0x13')](respondWithResult(_0x2898a0,null))[_0x5109('0x14')](handleError(_0x2898a0,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2fee28,_0x198ede){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2fee28[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x198ede,null))[_0x5109('0x14')](handleError(_0x198ede,null));};exports[_0x5109('0x5e')]=function(_0x4d4f85,_0x1a4cf9){return respondWithRpcPromise(_0x5109('0x5f'),_0x4d4f85[_0x5109('0x12')],routingClient)[_0x5109('0x13')](respondWithResult(_0x1a4cf9,null))[_0x5109('0x14')](handleError(_0x1a4cf9,null));};exports[_0x5109('0x60')]=function(_0x1f955f){return function(_0x4a1013,_0xeaaf21){var _0x5d3d78,_0x42048a;var _0x3931a9=_[_0x5109('0x61')](_0x1f955f);var _0x104123=_0x1f955f===_0x5109('0x62')?_0x5109('0x63'):_0x5109('0x64');return db[_0x3931a9+'Queue'][_0x5109('0x65')]({'raw':!![],'where':{'id':_0x4a1013['params']['id']}})[_0x5109('0x13')](function(_0x1fb57a){if(_[_0x5109('0xe')](_0x1fb57a)){throw new Error(_0x3931a9+_0x5109('0x66'));}_0x5d3d78=_0x1fb57a;return db[_0x3931a9+_0x5109('0x67')][_0x5109('0x65')]({'where':{'id':_0x4a1013[_0x5109('0x1e')][_0x5109('0x68')]},'include':[{'model':db[_0x3931a9+'Interaction'],'as':_0x5109('0x69')},{'model':db[_0x3931a9+_0x104123],'as':_0x5109('0x64')}]});})[_0x5109('0x13')](function(_0x5e2d4f){if(_['isNil'](_0x5e2d4f)){throw new Error(_0x3931a9+_0x5109('0x6a'));}_0x42048a=_0x5e2d4f;return _0x5e2d4f[_0x5109('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1f1c85={'uniqueid':_0x1f955f+'.'+_0x42048a['id']+'.'+_0x42048a[_0x5109('0x69')]['id'],'FromUserId':_0x4a1013[_0x5109('0x30')]['id'],'type':_0x5109('0x6c')};_0x1f1c85[_0x3931a9+_0x5109('0x6d')]=_0x42048a['id'];_0x1f1c85[_0x3931a9+_0x5109('0x6e')]=_0x42048a[_0x5109('0x69')]['id'];_0x1f1c85[_0x5109('0x6f')+_0x3931a9+_0x104123+'Id']=_0x42048a[_0x5109('0x64')]['id'];_0x1f1c85['To'+_0x3931a9+_0x5109('0x70')]=_0x5d3d78['id'];return db[_0x3931a9+_0x5109('0x71')][_0x5109('0x72')](_0x1f1c85);})[_0x5109('0x13')](function(){return respondWithRpcPromise(_0x5109('0x73'),{'channel':_0x1f955f,'interaction':_0x42048a[_0x5109('0x69')],'message':_0x42048a,'account':_0x42048a[_0x5109('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5109('0x6c'),'appdata':_0x5d3d78[_0x5109('0xc')]+','+(_0x42048a[_0x5109('0x64')]['queueTransferTimeout']||0x12c),'interval':_0x5109('0x74')}]},routingClient);})[_0x5109('0x13')](respondWithResult(_0xeaaf21,null))['catch'](handleError(_0xeaaf21,null));};};exports[_0x5109('0x75')]=function(_0x2d2301,_0x2c7bf9){var _0x1920de,_0x1d117a;if(_[_0x5109('0xe')](_0x2d2301[_0x5109('0x1e')][_0x5109('0x76')])){throw new Error(_0x5109('0x77'));}var _0x507523=_0x2d2301['body'][_0x5109('0x76')];var _0x176a46=_['capitalize'](_0x507523);var _0x95792c=_0x507523==='chat'?_0x5109('0x63'):_0x5109('0x64');return db[_0x5109('0x78')][_0x5109('0x65')]({'raw':!![],'where':{'id':_0x2d2301[_0x5109('0x18')]['id'],'role':_0x5109('0x3c')}})[_0x5109('0x13')](function(_0x1f6d4a){if(_[_0x5109('0xe')](_0x1f6d4a)){throw new Error(_0x5109('0x79'));}_0x1920de=_0x1f6d4a;return db[_0x176a46+'Message'][_0x5109('0x65')]({'where':{'id':_0x2d2301[_0x5109('0x1e')][_0x5109('0x68')]},'include':[{'model':db[_0x176a46+'Interaction'],'as':'Interaction'},{'model':db[_0x176a46+_0x95792c],'as':_0x5109('0x64')}]});})['then'](function(_0x4cf05f){if(_[_0x5109('0xe')](_0x4cf05f)){throw new Error(_0x176a46+_0x5109('0x6a'));}_0x1d117a=_0x4cf05f;return _0x4cf05f[_0x5109('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5109('0x13')](function(){var _0x4ff585={'uniqueid':_0x507523+'.'+_0x1d117a['id']+'.'+_0x1d117a[_0x5109('0x69')]['id'],'FromUserId':_0x2d2301[_0x5109('0x30')]['id'],'type':_0x5109('0x3c'),'ToUserId':_0x1920de['id']};_0x4ff585[_0x176a46+_0x5109('0x6d')]=_0x1d117a['id'];_0x4ff585[_0x176a46+'InteractionId']=_0x1d117a[_0x5109('0x69')]['id'];_0x4ff585['From'+_0x176a46+_0x95792c+'Id']=_0x1d117a[_0x5109('0x64')]['id'];return db[_0x176a46+'TransferReport']['create'](_0x4ff585);})[_0x5109('0x13')](function(){return respondWithRpcPromise(_0x5109('0x73'),{'channel':_0x507523,'interaction':_0x1d117a[_0x5109('0x69')],'message':_0x1d117a,'account':_0x1d117a['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x5109('0x3c'),'appdata':_0x1920de['name']+','+(_0x1d117a[_0x5109('0x64')][_0x5109('0x7a')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x2c7bf9,null))['catch'](handleError(_0x2c7bf9,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fff8a2f..586dab5 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 _0x2fc5=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','run','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x200661,_0x2a73b7){var _0x3a51a5=function(_0x587f16){while(--_0x587f16){_0x200661['push'](_0x200661['shift']());}};_0x3a51a5(++_0x2a73b7);}(_0x2fc5,0x13b));var _0x52fc=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x2fc5[_0x5550b3];return _0x4b8fc4;};'use strict';var multer=require(_0x52fc('0x0'));var util=require('util');var path=require(_0x52fc('0x1'));var timeout=require(_0x52fc('0x2'));var express=require(_0x52fc('0x3'));var router=express['Router']();var fs_extra=require(_0x52fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52fc('0x5'));var config=require(_0x52fc('0x6'));var controller=require(_0x52fc('0x7'));router[_0x52fc('0x8')]('/',auth[_0x52fc('0x9')](),controller[_0x52fc('0xa')]);router[_0x52fc('0x8')]('/:id',auth[_0x52fc('0x9')](),controller[_0x52fc('0xb')]);router[_0x52fc('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x52fc('0xc')]);router[_0x52fc('0xd')]('/',auth[_0x52fc('0x9')](),controller[_0x52fc('0xe')]);router['put'](_0x52fc('0xf'),auth[_0x52fc('0x9')](),controller[_0x52fc('0x10')]);router[_0x52fc('0x11')](_0x52fc('0xf'),auth[_0x52fc('0x9')](),controller[_0x52fc('0x12')]);module[_0x52fc('0x13')]=router; \ No newline at end of file +var _0xf62e=['../../config/environment','isAuthenticated','/:id','show','get','/:id/run','run','post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x177a1a,_0x1ee104){var _0x25e096=function(_0x1946ad){while(--_0x1946ad){_0x177a1a['push'](_0x177a1a['shift']());}};_0x25e096(++_0x1ee104);}(_0xf62e,0xc1));var _0xef62=function(_0xe8d593,_0x4c69dc){_0xe8d593=_0xe8d593-0x0;var _0x212d07=_0xf62e[_0xe8d593];return _0x212d07;};'use strict';var multer=require(_0xef62('0x0'));var util=require(_0xef62('0x1'));var path=require(_0xef62('0x2'));var timeout=require(_0xef62('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef62('0x4'));var auth=require(_0xef62('0x5'));var interaction=require(_0xef62('0x6'));var config=require(_0xef62('0x7'));var controller=require('./schedule.controller');router['get']('/',auth[_0xef62('0x8')](),controller['index']);router['get'](_0xef62('0x9'),auth['isAuthenticated'](),controller[_0xef62('0xa')]);router[_0xef62('0xb')](_0xef62('0xc'),auth[_0xef62('0x8')](),controller[_0xef62('0xd')]);router[_0xef62('0xe')]('/',auth[_0xef62('0x8')](),controller[_0xef62('0xf')]);router[_0xef62('0x10')](_0xef62('0x9'),auth[_0xef62('0x8')](),controller[_0xef62('0x11')]);router[_0xef62('0x12')](_0xef62('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xef62('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a8c5502..545266b 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 _0x0057=['csv','pdf','default','custom','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0x13f3c1,_0x4b24c1){var _0x5e0b7c=function(_0x40864c){while(--_0x40864c){_0x13f3c1['push'](_0x13f3c1['shift']());}};_0x5e0b7c(++_0x4b24c1);}(_0x0057,0x1be));var _0x7005=function(_0x13ca76,_0x11dfbd){_0x13ca76=_0x13ca76-0x0;var _0xcc9566=_0x0057[_0x13ca76];return _0xcc9566;};'use strict';var Sequelize=require(_0x7005('0x0'));module[_0x7005('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7005('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7005('0x3')],'allowNull':![],'defaultValue':_0x7005('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7005('0x5')](_0x7005('0x6'),_0x7005('0x7'),_0x7005('0x8'),_0x7005('0x9'),_0x7005('0xa'),_0x7005('0xb'),_0x7005('0xc')),'allowNull':![],'defaultValue':_0x7005('0xa')},'output':{'type':Sequelize[_0x7005('0x5')](_0x7005('0xd'),_0x7005('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0x7005('0xd')},'type':{'type':Sequelize[_0x7005('0x5')]('custom',_0x7005('0xf')),'allowNull':![],'defaultValue':_0x7005('0x10')},'sendMail':{'type':Sequelize[_0x7005('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x7005('0x3')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x7005('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9da8=['BOOLEAN','DATE','INTEGER','weeks','days','hours','ENUM','pdf','csv','custom','TEXT','sequelize','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9da8,0x1e7));var _0x89da=function(_0x31c04d,_0x59a5d5){_0x31c04d=_0x31c04d-0x0;var _0x3fd81b=_0x9da8[_0x31c04d];return _0x3fd81b;};'use strict';var Sequelize=require(_0x89da('0x0'));module[_0x89da('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x89da('0x2')]},'active':{'type':Sequelize[_0x89da('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x89da('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x89da('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x89da('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x89da('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters','months',_0x89da('0x6'),_0x89da('0x7'),_0x89da('0x8'),'minutes'),'allowNull':![],'defaultValue':_0x89da('0x7')},'output':{'type':Sequelize[_0x89da('0x9')]('csv',_0x89da('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0x89da('0xb')},'type':{'type':Sequelize['ENUM'](_0x89da('0xc'),'default'),'allowNull':![],'defaultValue':_0x89da('0xc')},'sendMail':{'type':Sequelize[_0x89da('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x89da('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x89da('0xd')]},'sendIfEmpty':{'type':Sequelize[_0x89da('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 2fdd7ac..24b01f7 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 _0x9028=['UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','Scheduler','UserProfileResource','destroy','end','error','stack','name','map','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','Schedule','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x4ad5bb,_0x8a0632){var _0x4ebe12=function(_0xa3be23){while(--_0xa3be23){_0x4ad5bb['push'](_0x4ad5bb['shift']());}};_0x4ebe12(++_0x8a0632);}(_0x9028,0x1ba));var _0x8902=function(_0x2ed5ea,_0x2efd04){_0x2ed5ea=_0x2ed5ea-0x0;var _0x4b5e98=_0x9028[_0x2ed5ea];return _0x4b5e98;};'use strict';var emlformat=require(_0x8902('0x0'));var rimraf=require(_0x8902('0x1'));var zipdir=require(_0x8902('0x2'));var jsonpatch=require(_0x8902('0x3'));var rp=require(_0x8902('0x4'));var moment=require(_0x8902('0x5'));var BPromise=require(_0x8902('0x6'));var Mustache=require(_0x8902('0x7'));var util=require(_0x8902('0x8'));var path=require(_0x8902('0x9'));var sox=require('sox');var csv=require(_0x8902('0xa'));var ejs=require(_0x8902('0xb'));var fs=require('fs');var fs_extra=require(_0x8902('0xc'));var _=require(_0x8902('0xd'));var squel=require(_0x8902('0xe'));var crypto=require(_0x8902('0xf'));var jsforce=require(_0x8902('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8902('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8902('0x11'));var authService=require(_0x8902('0x12'));var qs=require(_0x8902('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8902('0x14'));var logger=require(_0x8902('0x15'))(_0x8902('0x16'));var utils=require(_0x8902('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8902('0x18'));var db=require(_0x8902('0x19'))['db'];function respondWithStatusCode(_0x2081be,_0x582e11){_0x582e11=_0x582e11||0xcc;return function(_0x1f29e3){if(_0x1f29e3){return _0x2081be[_0x8902('0x1a')](_0x582e11);}return _0x2081be[_0x8902('0x1b')](_0x582e11)['end']();};}function respondWithResult(_0x289333,_0x3a474a){_0x3a474a=_0x3a474a||0xc8;return function(_0x438d0f){if(_0x438d0f){return _0x289333[_0x8902('0x1b')](_0x3a474a)[_0x8902('0x1c')](_0x438d0f);}};}function respondWithFilteredResult(_0x452437,_0x3cb815){return function(_0x13b6f7){if(_0x13b6f7){var _0x5767f2=typeof _0x3cb815['offset']===_0x8902('0x1d')&&typeof _0x3cb815[_0x8902('0x1e')]===_0x8902('0x1d');var _0x2363db=_0x13b6f7[_0x8902('0x1f')];var _0x2ecc24=_0x5767f2?0x0:_0x3cb815['offset'];var _0x395348=_0x5767f2?_0x13b6f7[_0x8902('0x1f')]:_0x3cb815['offset']+_0x3cb815[_0x8902('0x1e')];var _0x323200;if(_0x395348>=_0x2363db){_0x395348=_0x2363db;_0x323200=0xc8;}else{_0x323200=0xce;}_0x452437[_0x8902('0x1b')](_0x323200);return _0x452437[_0x8902('0x20')](_0x8902('0x21'),_0x2ecc24+'-'+_0x395348+'/'+_0x2363db)['json'](_0x13b6f7);}return null;};}function patchUpdates(_0x184d33){return function(_0xfd3d3){try{jsonpatch[_0x8902('0x22')](_0xfd3d3,_0x184d33,!![]);}catch(_0x52ee9f){return BPromise[_0x8902('0x23')](_0x52ee9f);}return _0xfd3d3[_0x8902('0x24')]();};}function saveUpdates(_0x3e607e,_0x20e48f){return function(_0x2f6dd9){if(_0x2f6dd9){return _0x2f6dd9['update'](_0x3e607e)[_0x8902('0x25')](function(_0x4e396d){return _0x4e396d;});}return null;};}function removeEntity(_0x3a1054,_0x2ff3db){return function(_0x4aee8b){if(_0x4aee8b){return _0x4aee8b['destroy']()['then'](function(){var _0x46b7de=_0x4aee8b[_0x8902('0x26')]({'plain':!![]});var _0xf747d3=_0x8902('0x27');return db[_0x8902('0x28')][_0x8902('0x29')]({'where':{'type':_0xf747d3,'resourceId':_0x46b7de['id']}})[_0x8902('0x25')](function(){return _0x4aee8b;});})[_0x8902('0x25')](function(){_0x3a1054[_0x8902('0x1b')](0xcc)[_0x8902('0x2a')]();});}};}function handleEntityNotFound(_0x15a100,_0x2c1fad){return function(_0x5532d6){if(!_0x5532d6){_0x15a100[_0x8902('0x1a')](0x194);}return _0x5532d6;};}function handleError(_0x34f90d,_0xcbc131){_0xcbc131=_0xcbc131||0x1f4;return function(_0x2ac85c){logger[_0x8902('0x2b')](_0x2ac85c[_0x8902('0x2c')]);if(_0x2ac85c['name']){delete _0x2ac85c[_0x8902('0x2d')];}_0x34f90d[_0x8902('0x1b')](_0xcbc131)['send'](_0x2ac85c);};}exports['index']=function(_0x5c133f,_0x17add2){var _0x37a7c8={},_0x5ab00e={},_0x20f39c={'count':0x0,'rows':[]};var _0x53d1f6=_[_0x8902('0x2e')](db['Schedule'][_0x8902('0x2f')],function(_0x1b7cd5){return{'name':_0x1b7cd5['fieldName'],'type':_0x1b7cd5[_0x8902('0x30')][_0x8902('0x31')]};});_0x5ab00e[_0x8902('0x32')]=_[_0x8902('0x2e')](_0x53d1f6,'name');_0x5ab00e['query']=_[_0x8902('0x33')](_0x5c133f[_0x8902('0x34')]);_0x5ab00e['filters']=_[_0x8902('0x35')](_0x5ab00e['model'],_0x5ab00e[_0x8902('0x34')]);_0x37a7c8['attributes']=_[_0x8902('0x35')](_0x5ab00e[_0x8902('0x32')],qs[_0x8902('0x36')](_0x5c133f[_0x8902('0x34')][_0x8902('0x36')]));_0x37a7c8['attributes']=_0x37a7c8[_0x8902('0x37')][_0x8902('0x38')]?_0x37a7c8[_0x8902('0x37')]:_0x5ab00e[_0x8902('0x32')];if(!_0x5c133f[_0x8902('0x34')][_0x8902('0x39')](_0x8902('0x3a'))){_0x37a7c8[_0x8902('0x1e')]=qs[_0x8902('0x1e')](_0x5c133f[_0x8902('0x34')]['limit']);_0x37a7c8[_0x8902('0x3b')]=qs['offset'](_0x5c133f['query'][_0x8902('0x3b')]);}_0x37a7c8[_0x8902('0x3c')]=qs['sort'](_0x5c133f['query'][_0x8902('0x3d')]);_0x37a7c8[_0x8902('0x3e')]=qs[_0x8902('0x3f')](_[_0x8902('0x40')](_0x5c133f[_0x8902('0x34')],_0x5ab00e[_0x8902('0x3f')]),_0x53d1f6);if(_0x5c133f[_0x8902('0x34')][_0x8902('0x41')]){_0x37a7c8[_0x8902('0x3e')]=_['merge'](_0x37a7c8[_0x8902('0x3e')],{'$or':_[_0x8902('0x2e')](_0x53d1f6,function(_0x1024bb){if(_0x1024bb[_0x8902('0x30')]!==_0x8902('0x42')){var _0x319be9={};_0x319be9[_0x1024bb[_0x8902('0x2d')]]={'$like':'%'+_0x5c133f[_0x8902('0x34')][_0x8902('0x41')]+'%'};return _0x319be9;}})});}_0x37a7c8=_[_0x8902('0x43')]({},_0x37a7c8,_0x5c133f['options']);var _0x159b8c={'where':_0x37a7c8['where']};return db['Schedule'][_0x8902('0x1f')](_0x159b8c)[_0x8902('0x25')](function(_0x5687ea){_0x20f39c[_0x8902('0x1f')]=_0x5687ea;if(_0x5c133f[_0x8902('0x34')][_0x8902('0x44')]){_0x37a7c8[_0x8902('0x45')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x37a7c8);})['then'](function(_0x2cb39a){_0x20f39c[_0x8902('0x46')]=_0x2cb39a;return _0x20f39c;})[_0x8902('0x25')](respondWithFilteredResult(_0x17add2,_0x37a7c8))[_0x8902('0x47')](handleError(_0x17add2,null));};exports[_0x8902('0x48')]=function(_0x22be6c,_0x4ae1c7){var _0x207a49={'raw':![],'where':{'id':_0x22be6c[_0x8902('0x49')]['id']}},_0x22edeb={};_0x22edeb[_0x8902('0x32')]=_['keys'](db[_0x8902('0x4a')][_0x8902('0x2f')]);_0x22edeb[_0x8902('0x34')]=_['keys'](_0x22be6c[_0x8902('0x34')]);_0x22edeb[_0x8902('0x3f')]=_[_0x8902('0x35')](_0x22edeb[_0x8902('0x32')],_0x22edeb[_0x8902('0x34')]);_0x207a49[_0x8902('0x37')]=_[_0x8902('0x35')](_0x22edeb[_0x8902('0x32')],qs[_0x8902('0x36')](_0x22be6c[_0x8902('0x34')]['fields']));_0x207a49[_0x8902('0x37')]=_0x207a49[_0x8902('0x37')][_0x8902('0x38')]?_0x207a49['attributes']:_0x22edeb[_0x8902('0x32')];if(_0x22be6c[_0x8902('0x34')][_0x8902('0x44')]){_0x207a49[_0x8902('0x45')]=[{'all':!![]}];}_0x207a49=_[_0x8902('0x43')]({},_0x207a49,_0x22be6c['options']);return db[_0x8902('0x4a')]['find'](_0x207a49)['then'](handleEntityNotFound(_0x4ae1c7,null))[_0x8902('0x25')](respondWithResult(_0x4ae1c7,null))[_0x8902('0x47')](handleError(_0x4ae1c7,null));};exports['create']=function(_0x1f513c,_0x378c26){return db['Schedule'][_0x8902('0x4b')](_0x1f513c[_0x8902('0x4c')],{})['then'](function(_0xe5f524){var _0x3063ea=_0x1f513c[_0x8902('0x4d')][_0x8902('0x26')]({'plain':!![]});if(!_0x3063ea)throw new Error(_0x8902('0x4e'));if(_0x3063ea[_0x8902('0x4f')]===_0x8902('0x4d')){var _0x5eef24=_0xe5f524[_0x8902('0x26')]({'plain':!![]});var _0x4d3516='Scheduler';return db[_0x8902('0x50')][_0x8902('0x51')]({'where':{'name':_0x4d3516,'userProfileId':_0x3063ea['userProfileId']},'raw':!![]})[_0x8902('0x25')](function(_0x1680a1){if(_0x1680a1&&_0x1680a1[_0x8902('0x52')]===0x0){return db['UserProfileResource'][_0x8902('0x4b')]({'name':_0x5eef24[_0x8902('0x2d')],'resourceId':_0x5eef24['id'],'type':_0x1680a1['name'],'sectionId':_0x1680a1['id']},{})[_0x8902('0x25')](function(){return _0xe5f524;});}else{return _0xe5f524;}})[_0x8902('0x47')](function(_0x3502ec){logger[_0x8902('0x2b')](_0x8902('0x53'),_0x3502ec);throw _0x3502ec;});}return _0xe5f524;})['then'](respondWithResult(_0x378c26,0xc9))[_0x8902('0x47')](handleError(_0x378c26,null));};exports[_0x8902('0x54')]=function(_0x124894,_0x28938f){if(_0x124894['body']['id']){delete _0x124894['body']['id'];}return db[_0x8902('0x4a')][_0x8902('0x51')]({'where':{'id':_0x124894[_0x8902('0x49')]['id']}})[_0x8902('0x25')](handleEntityNotFound(_0x28938f,null))[_0x8902('0x25')](saveUpdates(_0x124894[_0x8902('0x4c')],null))[_0x8902('0x25')](respondWithResult(_0x28938f,null))[_0x8902('0x47')](handleError(_0x28938f,null));};exports[_0x8902('0x29')]=function(_0x371d46,_0x49b1d9){return db['Schedule'][_0x8902('0x51')]({'where':{'id':_0x371d46[_0x8902('0x49')]['id']}})[_0x8902('0x25')](handleEntityNotFound(_0x49b1d9,null))[_0x8902('0x25')](removeEntity(_0x49b1d9,null))[_0x8902('0x47')](handleError(_0x49b1d9,null));};exports['run']=function(_0x40ec6f,_0x5032d5,_0x404a57){var _0x343dcd=require(_0x8902('0x55'));return db['Schedule'][_0x8902('0x51')]({'where':{'id':_0x40ec6f[_0x8902('0x49')]['id']},'raw':!![]})[_0x8902('0x25')](handleEntityNotFound(_0x5032d5,null))[_0x8902('0x25')](function(){_0x343dcd[_0x8902('0x56')](_0x40ec6f[_0x8902('0x49')]['id']);})[_0x8902('0x25')](respondWithStatusCode(_0x5032d5,null))['catch'](handleError(_0x5032d5,null));}; \ No newline at end of file +var _0x0f43=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','find','create','user','role'];(function(_0x2b1c89,_0x399b27){var _0x1d495e=function(_0x7eea0){while(--_0x7eea0){_0x2b1c89['push'](_0x2b1c89['shift']());}};_0x1d495e(++_0x399b27);}(_0x0f43,0xab));var _0x30f4=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x0f43[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30f4('0x0'));var rp=require('request-promise');var moment=require(_0x30f4('0x1'));var BPromise=require(_0x30f4('0x2'));var Mustache=require('mustache');var util=require(_0x30f4('0x3'));var path=require(_0x30f4('0x4'));var sox=require(_0x30f4('0x5'));var csv=require(_0x30f4('0x6'));var ejs=require(_0x30f4('0x7'));var fs=require('fs');var fs_extra=require(_0x30f4('0x8'));var _=require('lodash');var squel=require(_0x30f4('0x9'));var crypto=require('crypto');var jsforce=require(_0x30f4('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x30f4('0xb'));var Papa=require('papaparse');var Redis=require(_0x30f4('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x30f4('0xd'));var as=require(_0x30f4('0xe'));var hardwareService=require(_0x30f4('0xf'));var logger=require(_0x30f4('0x10'))(_0x30f4('0x11'));var utils=require(_0x30f4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x30f4('0x13'));var db=require(_0x30f4('0x14'))['db'];function respondWithStatusCode(_0x45b055,_0x5c6b6f){_0x5c6b6f=_0x5c6b6f||0xcc;return function(_0x436b1f){if(_0x436b1f){return _0x45b055[_0x30f4('0x15')](_0x5c6b6f);}return _0x45b055[_0x30f4('0x16')](_0x5c6b6f)[_0x30f4('0x17')]();};}function respondWithResult(_0x51a184,_0x918767){_0x918767=_0x918767||0xc8;return function(_0xb2177b){if(_0xb2177b){return _0x51a184[_0x30f4('0x16')](_0x918767)['json'](_0xb2177b);}};}function respondWithFilteredResult(_0x47d65d,_0x31a9aa){return function(_0x2045f8){if(_0x2045f8){var _0x3bf38f=typeof _0x31a9aa[_0x30f4('0x18')]===_0x30f4('0x19')&&typeof _0x31a9aa['limit']===_0x30f4('0x19');var _0xaec24a=_0x2045f8[_0x30f4('0x1a')];var _0x5b09d3=_0x3bf38f?0x0:_0x31a9aa[_0x30f4('0x18')];var _0x61aec0=_0x3bf38f?_0x2045f8[_0x30f4('0x1a')]:_0x31a9aa[_0x30f4('0x18')]+_0x31a9aa[_0x30f4('0x1b')];var _0x348181;if(_0x61aec0>=_0xaec24a){_0x61aec0=_0xaec24a;_0x348181=0xc8;}else{_0x348181=0xce;}_0x47d65d[_0x30f4('0x16')](_0x348181);return _0x47d65d['set'](_0x30f4('0x1c'),_0x5b09d3+'-'+_0x61aec0+'/'+_0xaec24a)[_0x30f4('0x1d')](_0x2045f8);}return null;};}function patchUpdates(_0x1b0826){return function(_0x463d17){try{jsonpatch[_0x30f4('0x1e')](_0x463d17,_0x1b0826,!![]);}catch(_0xdff1c8){return BPromise[_0x30f4('0x1f')](_0xdff1c8);}return _0x463d17[_0x30f4('0x20')]();};}function saveUpdates(_0x243a64,_0x419276){return function(_0x5c9dff){if(_0x5c9dff){return _0x5c9dff[_0x30f4('0x21')](_0x243a64)[_0x30f4('0x22')](function(_0x5338c6){return _0x5338c6;});}return null;};}function removeEntity(_0x199204,_0x21c4fb){return function(_0x4c39b3){if(_0x4c39b3){return _0x4c39b3['destroy']()['then'](function(){var _0x5daab2=_0x4c39b3[_0x30f4('0x23')]({'plain':!![]});var _0x59704c=_0x30f4('0x24');return db[_0x30f4('0x25')][_0x30f4('0x26')]({'where':{'type':_0x59704c,'resourceId':_0x5daab2['id']}})['then'](function(){return _0x4c39b3;});})[_0x30f4('0x22')](function(){_0x199204['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc5b9d,_0x3fb749){return function(_0xdda3ce){if(!_0xdda3ce){_0xbc5b9d[_0x30f4('0x15')](0x194);}return _0xdda3ce;};}function handleError(_0x319b84,_0x1a503e){_0x1a503e=_0x1a503e||0x1f4;return function(_0x2f5e3b){logger[_0x30f4('0x27')](_0x2f5e3b[_0x30f4('0x28')]);if(_0x2f5e3b[_0x30f4('0x29')]){delete _0x2f5e3b['name'];}_0x319b84[_0x30f4('0x16')](_0x1a503e)[_0x30f4('0x2a')](_0x2f5e3b);};}exports[_0x30f4('0x2b')]=function(_0x6f7ffb,_0x32a0eb){var _0x38b599={},_0x32c689={},_0x1c2987={'count':0x0,'rows':[]};var _0x39444c=_[_0x30f4('0x2c')](db[_0x30f4('0x2d')][_0x30f4('0x2e')],function(_0x4c35e9){return{'name':_0x4c35e9['fieldName'],'type':_0x4c35e9['type'][_0x30f4('0x2f')]};});_0x32c689['model']=_['map'](_0x39444c,_0x30f4('0x29'));_0x32c689[_0x30f4('0x30')]=_[_0x30f4('0x31')](_0x6f7ffb[_0x30f4('0x30')]);_0x32c689[_0x30f4('0x32')]=_['intersection'](_0x32c689[_0x30f4('0x33')],_0x32c689['query']);_0x38b599[_0x30f4('0x34')]=_[_0x30f4('0x35')](_0x32c689[_0x30f4('0x33')],qs[_0x30f4('0x36')](_0x6f7ffb[_0x30f4('0x30')]['fields']));_0x38b599[_0x30f4('0x34')]=_0x38b599[_0x30f4('0x34')]['length']?_0x38b599[_0x30f4('0x34')]:_0x32c689[_0x30f4('0x33')];if(!_0x6f7ffb[_0x30f4('0x30')][_0x30f4('0x37')](_0x30f4('0x38'))){_0x38b599[_0x30f4('0x1b')]=qs['limit'](_0x6f7ffb['query']['limit']);_0x38b599['offset']=qs['offset'](_0x6f7ffb[_0x30f4('0x30')][_0x30f4('0x18')]);}_0x38b599[_0x30f4('0x39')]=qs[_0x30f4('0x3a')](_0x6f7ffb[_0x30f4('0x30')][_0x30f4('0x3a')]);_0x38b599[_0x30f4('0x3b')]=qs[_0x30f4('0x32')](_[_0x30f4('0x3c')](_0x6f7ffb[_0x30f4('0x30')],_0x32c689[_0x30f4('0x32')]),_0x39444c);if(_0x6f7ffb['query'][_0x30f4('0x3d')]){_0x38b599['where']=_[_0x30f4('0x3e')](_0x38b599[_0x30f4('0x3b')],{'$or':_[_0x30f4('0x2c')](_0x39444c,function(_0x3e8631){if(_0x3e8631['type']!==_0x30f4('0x3f')){var _0x14df5c={};_0x14df5c[_0x3e8631[_0x30f4('0x29')]]={'$like':'%'+_0x6f7ffb[_0x30f4('0x30')]['filter']+'%'};return _0x14df5c;}})});}_0x38b599=_['merge']({},_0x38b599,_0x6f7ffb[_0x30f4('0x40')]);var _0x46b0c0={'where':_0x38b599['where']};return db['Schedule'][_0x30f4('0x1a')](_0x46b0c0)['then'](function(_0x4e67e4){_0x1c2987[_0x30f4('0x1a')]=_0x4e67e4;if(_0x6f7ffb['query'][_0x30f4('0x41')]){_0x38b599[_0x30f4('0x42')]=[{'all':!![]}];}return db[_0x30f4('0x2d')]['findAll'](_0x38b599);})[_0x30f4('0x22')](function(_0x4ce83b){_0x1c2987['rows']=_0x4ce83b;return _0x1c2987;})[_0x30f4('0x22')](respondWithFilteredResult(_0x32a0eb,_0x38b599))[_0x30f4('0x43')](handleError(_0x32a0eb,null));};exports[_0x30f4('0x44')]=function(_0x1e00c3,_0x307fa5){var _0x59908c={'raw':![],'where':{'id':_0x1e00c3[_0x30f4('0x45')]['id']}},_0x59640={};_0x59640[_0x30f4('0x33')]=_[_0x30f4('0x31')](db[_0x30f4('0x2d')][_0x30f4('0x2e')]);_0x59640['query']=_['keys'](_0x1e00c3[_0x30f4('0x30')]);_0x59640[_0x30f4('0x32')]=_[_0x30f4('0x35')](_0x59640[_0x30f4('0x33')],_0x59640[_0x30f4('0x30')]);_0x59908c[_0x30f4('0x34')]=_[_0x30f4('0x35')](_0x59640['model'],qs['fields'](_0x1e00c3[_0x30f4('0x30')][_0x30f4('0x36')]));_0x59908c[_0x30f4('0x34')]=_0x59908c[_0x30f4('0x34')][_0x30f4('0x46')]?_0x59908c[_0x30f4('0x34')]:_0x59640[_0x30f4('0x33')];if(_0x1e00c3[_0x30f4('0x30')][_0x30f4('0x41')]){_0x59908c[_0x30f4('0x42')]=[{'all':!![]}];}_0x59908c=_[_0x30f4('0x3e')]({},_0x59908c,_0x1e00c3['options']);return db['Schedule'][_0x30f4('0x47')](_0x59908c)['then'](handleEntityNotFound(_0x307fa5,null))[_0x30f4('0x22')](respondWithResult(_0x307fa5,null))[_0x30f4('0x43')](handleError(_0x307fa5,null));};exports[_0x30f4('0x48')]=function(_0x2504ec,_0x128462){return db[_0x30f4('0x2d')][_0x30f4('0x48')](_0x2504ec['body'],{})[_0x30f4('0x22')](function(_0x169862){var _0x3443f3=_0x2504ec[_0x30f4('0x49')][_0x30f4('0x23')]({'plain':!![]});if(!_0x3443f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3443f3[_0x30f4('0x4a')]===_0x30f4('0x49')){var _0x296c45=_0x169862['get']({'plain':!![]});var _0x29ab07=_0x30f4('0x24');return db[_0x30f4('0x4b')][_0x30f4('0x47')]({'where':{'name':_0x29ab07,'userProfileId':_0x3443f3[_0x30f4('0x4c')]},'raw':!![]})[_0x30f4('0x22')](function(_0x27ee9e){if(_0x27ee9e&&_0x27ee9e[_0x30f4('0x4d')]===0x0){return db[_0x30f4('0x25')][_0x30f4('0x48')]({'name':_0x296c45['name'],'resourceId':_0x296c45['id'],'type':_0x27ee9e[_0x30f4('0x29')],'sectionId':_0x27ee9e['id']},{})[_0x30f4('0x22')](function(){return _0x169862;});}else{return _0x169862;}})[_0x30f4('0x43')](function(_0x18a378){logger['error'](_0x30f4('0x4e'),_0x18a378);throw _0x18a378;});}return _0x169862;})[_0x30f4('0x22')](respondWithResult(_0x128462,0xc9))[_0x30f4('0x43')](handleError(_0x128462,null));};exports[_0x30f4('0x21')]=function(_0x5f4558,_0x300ade){if(_0x5f4558[_0x30f4('0x4f')]['id']){delete _0x5f4558[_0x30f4('0x4f')]['id'];}return db[_0x30f4('0x2d')][_0x30f4('0x47')]({'where':{'id':_0x5f4558['params']['id']}})[_0x30f4('0x22')](handleEntityNotFound(_0x300ade,null))[_0x30f4('0x22')](saveUpdates(_0x5f4558[_0x30f4('0x4f')],null))['then'](respondWithResult(_0x300ade,null))[_0x30f4('0x43')](handleError(_0x300ade,null));};exports[_0x30f4('0x26')]=function(_0x7b2764,_0x3adea3){return db[_0x30f4('0x2d')]['find']({'where':{'id':_0x7b2764[_0x30f4('0x45')]['id']}})[_0x30f4('0x22')](handleEntityNotFound(_0x3adea3,null))['then'](removeEntity(_0x3adea3,null))[_0x30f4('0x43')](handleError(_0x3adea3,null));};exports[_0x30f4('0x50')]=function(_0x474645,_0x159539,_0x34df56){var _0x554c74=require(_0x30f4('0x51'));return db[_0x30f4('0x2d')][_0x30f4('0x47')]({'where':{'id':_0x474645['params']['id']},'raw':!![]})[_0x30f4('0x22')](handleEntityNotFound(_0x159539,null))[_0x30f4('0x22')](function(){_0x554c74[_0x30f4('0x50')](_0x474645[_0x30f4('0x45')]['id']);})[_0x30f4('0x22')](respondWithStatusCode(_0x159539,null))[_0x30f4('0x43')](handleError(_0x159539,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c20185c..be1f840 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 _0x6cca=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b28ae,_0x5c891f){var _0x914c90=function(_0x2ed6bb){while(--_0x2ed6bb){_0x5b28ae['push'](_0x5b28ae['shift']());}};_0x914c90(++_0x5c891f);}(_0x6cca,0xff));var _0xa6cc=function(_0x524343,_0xbc7a9b){_0x524343=_0x524343-0x0;var _0x48b1f1=_0x6cca[_0x524343];return _0x48b1f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6cc('0x0'))(_0xa6cc('0x1'));var moment=require(_0xa6cc('0x2'));var BPromise=require(_0xa6cc('0x3'));var rp=require(_0xa6cc('0x4'));var fs=require('fs');var path=require(_0xa6cc('0x5'));var rimraf=require(_0xa6cc('0x6'));var config=require(_0xa6cc('0x7'));var attributes=require(_0xa6cc('0x8'));module[_0xa6cc('0x9')]=function(_0x1b0b21,_0x2b1c51){return _0x1b0b21[_0xa6cc('0xa')](_0xa6cc('0xb'),attributes,{'tableName':_0xa6cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaea0=['path','../../config/environment','Schedule','tools_schedules','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xaea0,0x163));var _0x0aea=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xaea0[_0x163040];return _0x364667;};'use strict';var _=require(_0x0aea('0x0'));var util=require('util');var logger=require(_0x0aea('0x1'))(_0x0aea('0x2'));var moment=require(_0x0aea('0x3'));var BPromise=require(_0x0aea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0aea('0x5'));var rimraf=require('rimraf');var config=require(_0x0aea('0x6'));var attributes=require('./schedule.attributes');module['exports']=function(_0x1ec4b5,_0x2fb1d3){return _0x1ec4b5['define'](_0x0aea('0x7'),attributes,{'tableName':_0x0aea('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 be4956f..eacb0a0 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 _0xc185=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s','message','catch','util'];(function(_0x1e7835,_0x2a7635){var _0x28fee5=function(_0x105b32){while(--_0x105b32){_0x1e7835['push'](_0x1e7835['shift']());}};_0x28fee5(++_0x2a7635);}(_0xc185,0x1b4));var _0x5c18=function(_0x23b1dc,_0x56e39a){_0x23b1dc=_0x23b1dc-0x0;var _0x3aa141=_0xc185[_0x23b1dc];return _0x3aa141;};'use strict';var _=require('lodash');var util=require(_0x5c18('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c18('0x1'));var fs=require('fs');var Redis=require(_0x5c18('0x2'));var db=require(_0x5c18('0x3'))['db'];var utils=require(_0x5c18('0x4'));var logger=require(_0x5c18('0x5'))(_0x5c18('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5c18('0x7')][_0x5c18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d198d,_0x47d957,_0x297c7c){return new BPromise(function(_0x528a08,_0x1f0edd){return client['request'](_0x1d198d,_0x297c7c)[_0x5c18('0x9')](function(_0x3d368f){logger['info']('Schedule,\x20%s,\x20%s',_0x47d957,'request\x20sent');logger[_0x5c18('0xa')](_0x5c18('0xb'),_0x47d957,_0x5c18('0xc'),JSON[_0x5c18('0xd')](_0x3d368f));if(_0x3d368f[_0x5c18('0xe')]){if(_0x3d368f[_0x5c18('0xe')][_0x5c18('0xf')]===0x1f4){logger[_0x5c18('0xe')](_0x5c18('0x10'),_0x47d957,_0x3d368f['error']['message']);return _0x1f0edd(_0x3d368f[_0x5c18('0xe')]['message']);}logger[_0x5c18('0xe')]('Schedule,\x20%s,\x20%s',_0x47d957,_0x3d368f['error'][_0x5c18('0x11')]);return _0x528a08(_0x3d368f['error'][_0x5c18('0x11')]);}else{logger['info'](_0x5c18('0x10'),_0x47d957,_0x5c18('0xc'));_0x528a08(_0x3d368f['result'][_0x5c18('0x11')]);}})[_0x5c18('0x12')](function(_0x5084a4){logger[_0x5c18('0xe')](_0x5c18('0x10'),_0x47d957,_0x5084a4);_0x1f0edd(_0x5084a4);});});} \ No newline at end of file +var _0xf9e2=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xf9e2,0x107));var _0x2f9e=function(_0x1cf2b3,_0x4c35af){_0x1cf2b3=_0x1cf2b3-0x0;var _0x3a53c9=_0xf9e2[_0x1cf2b3];return _0x3a53c9;};'use strict';var _=require(_0x2f9e('0x0'));var util=require('util');var moment=require(_0x2f9e('0x1'));var BPromise=require(_0x2f9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f9e('0x3'));var db=require(_0x2f9e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f9e('0x5'))(_0x2f9e('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f9e('0x7'));var client=jayson[_0x2f9e('0x8')][_0x2f9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x540ef7,_0x119ed6,_0x5c81ea){return new BPromise(function(_0x44f9fb,_0x38c729){return client[_0x2f9e('0xa')](_0x540ef7,_0x5c81ea)[_0x2f9e('0xb')](function(_0x1e0517){logger[_0x2f9e('0xc')](_0x2f9e('0xd'),_0x119ed6,_0x2f9e('0xe'));logger[_0x2f9e('0xf')](_0x2f9e('0x10'),_0x119ed6,_0x2f9e('0xe'),JSON['stringify'](_0x1e0517));if(_0x1e0517[_0x2f9e('0x11')]){if(_0x1e0517['error'][_0x2f9e('0x12')]===0x1f4){logger[_0x2f9e('0x11')](_0x2f9e('0xd'),_0x119ed6,_0x1e0517[_0x2f9e('0x11')][_0x2f9e('0x13')]);return _0x38c729(_0x1e0517[_0x2f9e('0x11')][_0x2f9e('0x13')]);}logger[_0x2f9e('0x11')](_0x2f9e('0xd'),_0x119ed6,_0x1e0517[_0x2f9e('0x11')][_0x2f9e('0x13')]);return _0x44f9fb(_0x1e0517[_0x2f9e('0x11')][_0x2f9e('0x13')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x119ed6,_0x2f9e('0xe'));_0x44f9fb(_0x1e0517[_0x2f9e('0x14')][_0x2f9e('0x13')]);}})[_0x2f9e('0x15')](function(_0x329f6d){logger[_0x2f9e('0x11')]('Schedule,\x20%s,\x20%s',_0x119ed6,_0x329f6d);_0x38c729(_0x329f6d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f5cbdb4..eba716f 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 _0xf010=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x589e48,_0x363b8f){var _0x38aebd=function(_0x3536bf){while(--_0x3536bf){_0x589e48['push'](_0x589e48['shift']());}};_0x38aebd(++_0x363b8f);}(_0xf010,0x80));var _0x0f01=function(_0x3e88de,_0x4f4997){_0x3e88de=_0x3e88de-0x0;var _0x466cd6=_0xf010[_0x3e88de];return _0x466cd6;};'use strict';var multer=require(_0x0f01('0x0'));var util=require('util');var path=require(_0x0f01('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f01('0x2'));var router=express[_0x0f01('0x3')]();var fs_extra=require(_0x0f01('0x4'));var auth=require(_0x0f01('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f01('0x6'));var controller=require('./screenRecording.controller');router[_0x0f01('0x7')]('/',auth[_0x0f01('0x8')](),controller[_0x0f01('0x9')]);router[_0x0f01('0x7')](_0x0f01('0xa'),auth[_0x0f01('0x8')](),controller[_0x0f01('0xb')]);router[_0x0f01('0x7')](_0x0f01('0xc'),auth[_0x0f01('0x8')](),controller[_0x0f01('0xd')]);router[_0x0f01('0x7')]('/:id/download',auth[_0x0f01('0x8')](),controller[_0x0f01('0xe')]);router[_0x0f01('0xf')]('/',auth[_0x0f01('0x8')](),controller[_0x0f01('0x10')]);router[_0x0f01('0x11')]('/:id',auth[_0x0f01('0x8')](),controller[_0x0f01('0x12')]);router[_0x0f01('0x13')](_0x0f01('0xc'),auth[_0x0f01('0x8')](),controller[_0x0f01('0x14')]);module[_0x0f01('0x15')]=router; \ No newline at end of file +var _0x034a=['/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','put'];(function(_0x3ee35a,_0x59dff6){var _0x51be1c=function(_0x55401d){while(--_0x55401d){_0x3ee35a['push'](_0x3ee35a['shift']());}};_0x51be1c(++_0x59dff6);}(_0x034a,0xdb));var _0xa034=function(_0x14c552,_0x600898){_0x14c552=_0x14c552-0x0;var _0x3221a3=_0x034a[_0x14c552];return _0x3221a3;};'use strict';var multer=require(_0xa034('0x0'));var util=require(_0xa034('0x1'));var path=require(_0xa034('0x2'));var timeout=require(_0xa034('0x3'));var express=require(_0xa034('0x4'));var router=express[_0xa034('0x5')]();var fs_extra=require(_0xa034('0x6'));var auth=require(_0xa034('0x7'));var interaction=require(_0xa034('0x8'));var config=require(_0xa034('0x9'));var controller=require('./screenRecording.controller');router[_0xa034('0xa')]('/',auth['isAuthenticated'](),controller[_0xa034('0xb')]);router[_0xa034('0xa')](_0xa034('0xc'),auth[_0xa034('0xd')](),controller[_0xa034('0xe')]);router['get']('/:id',auth[_0xa034('0xd')](),controller[_0xa034('0xf')]);router[_0xa034('0xa')](_0xa034('0x10'),auth[_0xa034('0xd')](),controller[_0xa034('0x11')]);router[_0xa034('0x12')]('/',auth['isAuthenticated'](),controller[_0xa034('0x13')]);router[_0xa034('0x14')](_0xa034('0x15'),auth['isAuthenticated'](),controller[_0xa034('0x16')]);router[_0xa034('0x17')](_0xa034('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 621d4d2..4ec6740 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 _0xe3b3=['VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports'];(function(_0x8dd399,_0x4ca12d){var _0x2c072d=function(_0xc8bcea){while(--_0xc8bcea){_0x8dd399['push'](_0x8dd399['shift']());}};_0x2c072d(++_0x4ca12d);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x2b6e90,_0x25c2b5){_0x2b6e90=_0x2b6e90-0x0;var _0x323f03=_0xe3b3[_0x2b6e90];return _0x323f03;};'use strict';var Sequelize=require(_0x3e3b('0x0'));var moment=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var config=require(_0x3e3b('0x3'));module[_0x3e3b('0x4')]={'format':{'type':Sequelize[_0x3e3b('0x5')],'get':function(){return this[_0x3e3b('0x6')](_0x3e3b('0x7'))?path[_0x3e3b('0x8')](this[_0x3e3b('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x3e3b('0x9')]},'channel':{'type':Sequelize[_0x3e3b('0x9')]},'value':{'type':Sequelize[_0x3e3b('0x9')],'set':function(_0x57c8f9){var _0x11ed30=_0x57c8f9[_0x3e3b('0xa')](/\\/g,'/');this[_0x3e3b('0xb')](_0x3e3b('0x7'),_0x11ed30);}},'rating':{'type':Sequelize[_0x3e3b('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3e3b('0xc')],'set':function(_0x214205){this[_0x3e3b('0xb')](_0x3e3b('0xd'),moment()['subtract'](_0x214205,'ms'));this[_0x3e3b('0xb')]('closedAt',moment());this[_0x3e3b('0xb')](_0x3e3b('0xe'),_0x214205);}},'startedAt':{'type':Sequelize[_0x3e3b('0xf')],'get':function(){return moment(this[_0x3e3b('0x6')](_0x3e3b('0xd')))[_0x3e3b('0x10')](_0x3e3b('0x11'))[_0x3e3b('0x12')]();}},'closedAt':{'type':Sequelize[_0x3e3b('0xf')],'get':function(){return moment(this[_0x3e3b('0x6')](_0x3e3b('0x13')))[_0x3e3b('0x10')](_0x3e3b('0x11'))[_0x3e3b('0x12')]();}},'createdAt':{'type':Sequelize[_0x3e3b('0xf')],'get':function(){return moment(this[_0x3e3b('0x6')](_0x3e3b('0x14')))['format'](_0x3e3b('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x3e3b('0xf')],'get':function(){return moment(this[_0x3e3b('0x6')](_0x3e3b('0x15')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x6edc=['setDataValue','INTEGER','startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','closedAt','format','createdAt','updatedAt','toString','sequelize','moment','path','../../config/environment','getDataValue','value','extname','STRING'];(function(_0x4f93d7,_0x14f218){var _0x432f18=function(_0x346252){while(--_0x346252){_0x4f93d7['push'](_0x4f93d7['shift']());}};_0x432f18(++_0x14f218);}(_0x6edc,0x138));var _0xc6ed=function(_0x28a3b2,_0x8afb4f){_0x28a3b2=_0x28a3b2-0x0;var _0x429d03=_0x6edc[_0x28a3b2];return _0x429d03;};'use strict';var Sequelize=require(_0xc6ed('0x0'));var moment=require(_0xc6ed('0x1'));var path=require(_0xc6ed('0x2'));var config=require(_0xc6ed('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc6ed('0x4')](_0xc6ed('0x5'))?path[_0xc6ed('0x6')](this[_0xc6ed('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xc6ed('0x7')]},'channel':{'type':Sequelize[_0xc6ed('0x7')]},'value':{'type':Sequelize[_0xc6ed('0x7')],'set':function(_0x548a14){var _0x274b0d=_0x548a14['replace'](/\\/g,'/');this[_0xc6ed('0x8')](_0xc6ed('0x5'),_0x274b0d);}},'rating':{'type':Sequelize[_0xc6ed('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc6ed('0x9')],'set':function(_0x496e6a){this[_0xc6ed('0x8')](_0xc6ed('0xa'),moment()[_0xc6ed('0xb')](_0x496e6a,'ms'));this['setDataValue']('closedAt',moment());this[_0xc6ed('0x8')](_0xc6ed('0xc'),_0x496e6a);}},'startedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0xa')))['format'](_0xc6ed('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this['getDataValue'](_0xc6ed('0xf')))[_0xc6ed('0x10')](_0xc6ed('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0x11')))['format'](_0xc6ed('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0x12')))['format'](_0xc6ed('0xe'))[_0xc6ed('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 16143a9..483708c 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 _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x4a1e37,_0x2eef28){var _0xeb1f8b=function(_0x5854e6){while(--_0x5854e6){_0x4a1e37['push'](_0x4a1e37['shift']());}};_0xeb1f8b(++_0x2eef28);}(_0x5fd1,0x155));var _0x15fd=function(_0x197287,_0x4c3d16){_0x197287=_0x197287-0x0;var _0xae25c4=_0x5fd1[_0x197287];return _0xae25c4;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file +var _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x4a5efe,_0x4248fb){var _0x1c719a=function(_0x43fd88){while(--_0x43fd88){_0x4a5efe['push'](_0x4a5efe['shift']());}};_0x1c719a(++_0x4248fb);}(_0xed1f,0x6a));var _0xfed1=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xed1f[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 47fe7f5..e7e8092 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 _0x423f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','interactionid'];(function(_0x3fe83e,_0x220d19){var _0x17ace8=function(_0x462d00){while(--_0x462d00){_0x3fe83e['push'](_0x3fe83e['shift']());}};_0x17ace8(++_0x220d19);}(_0x423f,0x1d4));var _0xf423=function(_0x3e5a02,_0x20bff1){_0x3e5a02=_0x3e5a02-0x0;var _0x5a204d=_0x423f[_0x3e5a02];return _0x5a204d;};'use strict';var _=require(_0xf423('0x0'));var util=require(_0xf423('0x1'));var logger=require(_0xf423('0x2'))(_0xf423('0x3'));var moment=require(_0xf423('0x4'));var BPromise=require(_0xf423('0x5'));var rp=require(_0xf423('0x6'));var fs=require('fs');var path=require(_0xf423('0x7'));var rimraf=require('rimraf');var config=require(_0xf423('0x8'));var attributes=require(_0xf423('0x9'));module[_0xf423('0xa')]=function(_0x28d05f,_0x2ee616){return _0x28d05f['define'](_0xf423('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xf423('0xc'),'fields':[_0xf423('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f5d=['ScreenRecording','screen_recordings','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x12f171,_0x4d1aa7){var _0x3f0c11=function(_0x20fac6){while(--_0x20fac6){_0x12f171['push'](_0x12f171['shift']());}};_0x3f0c11(++_0x4d1aa7);}(_0x8f5d,0xa4));var _0xd8f5=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x8f5d[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd8f5('0x0'))(_0xd8f5('0x1'));var moment=require(_0xd8f5('0x2'));var BPromise=require(_0xd8f5('0x3'));var rp=require(_0xd8f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8f5('0x5'));var attributes=require('./screenRecording.attributes');module[_0xd8f5('0x6')]=function(_0x9ef1bd,_0x19b421){return _0x9ef1bd['define'](_0xd8f5('0x7'),attributes,{'tableName':_0xd8f5('0x8'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7573144..4ea9a9a 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 _0xc68e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc68e,0xe2));var _0xec68=function(_0x3fbbd4,_0x50e8d1){_0x3fbbd4=_0x3fbbd4-0x0;var _0xfe103c=_0xc68e[_0x3fbbd4];return _0xfe103c;};'use strict';var _=require(_0xec68('0x0'));var util=require(_0xec68('0x1'));var moment=require(_0xec68('0x2'));var BPromise=require(_0xec68('0x3'));var rs=require(_0xec68('0x4'));var fs=require('fs');var Redis=require(_0xec68('0x5'));var db=require(_0xec68('0x6'))['db'];var utils=require(_0xec68('0x7'));var logger=require(_0xec68('0x8'))('rpc');var config=require(_0xec68('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xec68('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e632a,_0x4c813a,_0x4476a5){return new BPromise(function(_0x1434b7,_0x4d5024){return client[_0xec68('0xb')](_0x1e632a,_0x4476a5)[_0xec68('0xc')](function(_0x8fcd7e){logger['info'](_0xec68('0xd'),_0x4c813a,'request\x20sent');logger[_0xec68('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4c813a,_0xec68('0xf'),JSON[_0xec68('0x10')](_0x8fcd7e));if(_0x8fcd7e['error']){if(_0x8fcd7e[_0xec68('0x11')][_0xec68('0x12')]===0x1f4){logger[_0xec68('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4c813a,_0x8fcd7e[_0xec68('0x11')]['message']);return _0x4d5024(_0x8fcd7e[_0xec68('0x11')]['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4c813a,_0x8fcd7e[_0xec68('0x11')][_0xec68('0x13')]);return _0x1434b7(_0x8fcd7e[_0xec68('0x11')][_0xec68('0x13')]);}else{logger[_0xec68('0x14')](_0xec68('0xd'),_0x4c813a,_0xec68('0xf'));_0x1434b7(_0x8fcd7e[_0xec68('0x15')][_0xec68('0x13')]);}})[_0xec68('0x16')](function(_0x520610){logger[_0xec68('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4c813a,_0x520610);_0x4d5024(_0x520610);});});} \ No newline at end of file +var _0x016a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x393f6e,_0x5c1072){var _0x5c5083=function(_0x442603){while(--_0x442603){_0x393f6e['push'](_0x393f6e['shift']());}};_0x5c5083(++_0x5c1072);}(_0x016a,0x79));var _0xa016=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x016a[_0x59c301];return _0x3866b9;};'use strict';var _=require('lodash');var util=require(_0xa016('0x0'));var moment=require(_0xa016('0x1'));var BPromise=require(_0xa016('0x2'));var rs=require(_0xa016('0x3'));var fs=require('fs');var Redis=require(_0xa016('0x4'));var db=require(_0xa016('0x5'))['db'];var utils=require(_0xa016('0x6'));var logger=require(_0xa016('0x7'))(_0xa016('0x8'));var config=require('../../config/environment');var jayson=require(_0xa016('0x9'));var client=jayson[_0xa016('0xa')][_0xa016('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x145acc,_0x5d12ab,_0x4cf701){return new BPromise(function(_0x2ffd13,_0x1593d2){return client[_0xa016('0xc')](_0x145acc,_0x4cf701)[_0xa016('0xd')](function(_0x49c6e7){logger[_0xa016('0xe')](_0xa016('0xf'),_0x5d12ab,_0xa016('0x10'));logger[_0xa016('0x11')](_0xa016('0x12'),_0x5d12ab,_0xa016('0x10'),JSON[_0xa016('0x13')](_0x49c6e7));if(_0x49c6e7[_0xa016('0x14')]){if(_0x49c6e7['error'][_0xa016('0x15')]===0x1f4){logger[_0xa016('0x14')](_0xa016('0xf'),_0x5d12ab,_0x49c6e7['error'][_0xa016('0x16')]);return _0x1593d2(_0x49c6e7[_0xa016('0x14')][_0xa016('0x16')]);}logger[_0xa016('0x14')](_0xa016('0xf'),_0x5d12ab,_0x49c6e7[_0xa016('0x14')][_0xa016('0x16')]);return _0x2ffd13(_0x49c6e7[_0xa016('0x14')][_0xa016('0x16')]);}else{logger[_0xa016('0xe')](_0xa016('0xf'),_0x5d12ab,'request\x20sent');_0x2ffd13(_0x49c6e7[_0xa016('0x17')][_0xa016('0x16')]);}})[_0xa016('0x18')](function(_0xad4558){logger[_0xa016('0x14')](_0xa016('0xf'),_0x5d12ab,_0xad4558);_0x1593d2(_0xad4558);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 04d2e47..4381629 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 _0x5d40=['format','%s%s','logo','extname','originalname','post','single','file','addLogo','addLogoLogin','favicon','addFavicon','put','/:id','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/now','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/'];(function(_0x5c6476,_0x530367){var _0x1ee5e2=function(_0x516ac1){while(--_0x516ac1){_0x5c6476['push'](_0x5c6476['shift']());}};_0x1ee5e2(++_0x530367);}(_0x5d40,0x1bd));var _0x05d4=function(_0x3b58c0,_0x3c8ccb){_0x3b58c0=_0x3b58c0-0x0;var _0x5bfdba=_0x5d40[_0x3b58c0];return _0x5bfdba;};'use strict';var multer=require(_0x05d4('0x0'));var util=require('util');var path=require(_0x05d4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x05d4('0x2')]();var fs_extra=require(_0x05d4('0x3'));var auth=require(_0x05d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05d4('0x5'));var controller=require('./setting.controller');router[_0x05d4('0x6')]('/',auth[_0x05d4('0x7')](),controller[_0x05d4('0x8')]);router[_0x05d4('0x6')](_0x05d4('0x9'),controller[_0x05d4('0xa')]);router[_0x05d4('0x6')]('/:id',controller[_0x05d4('0xb')]);router[_0x05d4('0x6')](_0x05d4('0xc'),controller['getLogo']);router[_0x05d4('0x6')](_0x05d4('0xd'),controller[_0x05d4('0xe')]);router[_0x05d4('0x6')](_0x05d4('0xf'),controller[_0x05d4('0x10')]);router[_0x05d4('0x6')](_0x05d4('0x11'),controller['getPreferred']);router[_0x05d4('0x6')](_0x05d4('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x05d4('0x13')]({'destination':function(_0x37cfc8,_0x40297f,_0x437da4){_0x437da4(null,path[_0x05d4('0x14')](config[_0x05d4('0x15')],_0x05d4('0x16')));},'filename':function(_0x37500b,_0x197a65,_0x3b166f){_0x3b166f(null,util[_0x05d4('0x17')](_0x05d4('0x18'),_0x05d4('0x19'),path[_0x05d4('0x1a')](_0x197a65[_0x05d4('0x1b')])));}})});router[_0x05d4('0x1c')](_0x05d4('0xc'),upload[_0x05d4('0x1d')](_0x05d4('0x1e')),controller[_0x05d4('0x1f')]);var upload=multer({'storage':multer[_0x05d4('0x13')]({'destination':function(_0x15c652,_0x41370e,_0x2b6c00){_0x2b6c00(null,path[_0x05d4('0x14')](config[_0x05d4('0x15')],_0x05d4('0x16')));},'filename':function(_0x4e5aa3,_0x1bb3df,_0x577059){_0x577059(null,util[_0x05d4('0x17')](_0x05d4('0x18'),'logologin',path[_0x05d4('0x1a')](_0x1bb3df[_0x05d4('0x1b')])));}})});router[_0x05d4('0x1c')]('/:id/logo_login',upload[_0x05d4('0x1d')](_0x05d4('0x1e')),controller[_0x05d4('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x177f26,_0x4d0882,_0x46ba98){_0x46ba98(null,path[_0x05d4('0x14')](config[_0x05d4('0x15')],_0x05d4('0x16')));},'filename':function(_0x4624f4,_0x24f21b,_0x40566d){_0x40566d(null,util['format']('%s%s','preferred',path[_0x05d4('0x1a')](_0x24f21b[_0x05d4('0x1b')])));}})});router[_0x05d4('0x1c')]('/:id/preferred',upload[_0x05d4('0x1d')](_0x05d4('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0x05d4('0x13')]({'destination':function(_0x476dfc,_0x583302,_0x403637){_0x403637(null,path[_0x05d4('0x14')](config[_0x05d4('0x15')],_0x05d4('0x16')));},'filename':function(_0x1d0b6b,_0x4be3fc,_0x53c5df){_0x53c5df(null,util['format']('%s%s',_0x05d4('0x21'),path[_0x05d4('0x1a')](_0x4be3fc['originalname'])));}})});router[_0x05d4('0x1c')](_0x05d4('0x12'),upload[_0x05d4('0x1d')]('file'),controller[_0x05d4('0x22')]);router[_0x05d4('0x23')](_0x05d4('0x24'),auth['isAuthenticated'](),controller[_0x05d4('0x25')]);module[_0x05d4('0x26')]=router; \ No newline at end of file +var _0x6946=['format','%s%s','logo','extname','post','file','addLogo','server/files/images/logos/','logologin','originalname','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root'];(function(_0x2952ab,_0x32ba5b){var _0x462bee=function(_0xc0aff5){while(--_0xc0aff5){_0x2952ab['push'](_0x2952ab['shift']());}};_0x462bee(++_0x32ba5b);}(_0x6946,0x1a0));var _0x6694=function(_0x141e95,_0x12dd9d){_0x141e95=_0x141e95-0x0;var _0x501b36=_0x6946[_0x141e95];return _0x501b36;};'use strict';var multer=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var path=require(_0x6694('0x2'));var timeout=require('connect-timeout');var express=require(_0x6694('0x3'));var router=express['Router']();var fs_extra=require(_0x6694('0x4'));var auth=require(_0x6694('0x5'));var interaction=require(_0x6694('0x6'));var config=require(_0x6694('0x7'));var controller=require(_0x6694('0x8'));router[_0x6694('0x9')]('/',auth[_0x6694('0xa')](),controller['index']);router['get'](_0x6694('0xb'),controller[_0x6694('0xc')]);router[_0x6694('0x9')](_0x6694('0xd'),controller[_0x6694('0xe')]);router[_0x6694('0x9')](_0x6694('0xf'),controller[_0x6694('0x10')]);router['get']('/:id/logo_login',controller[_0x6694('0x11')]);router[_0x6694('0x9')]('/:id/gdpr',controller['gdpr']);router[_0x6694('0x9')](_0x6694('0x12'),controller[_0x6694('0x13')]);router[_0x6694('0x9')]('/:id/favicon',controller[_0x6694('0x14')]);var upload=multer({'storage':multer[_0x6694('0x15')]({'destination':function(_0xe4c4fb,_0x2d5c8c,_0x1ff1c8){_0x1ff1c8(null,path[_0x6694('0x16')](config[_0x6694('0x17')],'server/files/images/logos/'));},'filename':function(_0x5f2735,_0x14a334,_0x560874){_0x560874(null,util[_0x6694('0x18')](_0x6694('0x19'),_0x6694('0x1a'),path[_0x6694('0x1b')](_0x14a334['originalname'])));}})});router[_0x6694('0x1c')](_0x6694('0xf'),upload['single'](_0x6694('0x1d')),controller[_0x6694('0x1e')]);var upload=multer({'storage':multer[_0x6694('0x15')]({'destination':function(_0x363eb6,_0xef1339,_0x57f27d){_0x57f27d(null,path['join'](config[_0x6694('0x17')],_0x6694('0x1f')));},'filename':function(_0x2e743c,_0x4cf4ee,_0x2c8447){_0x2c8447(null,util[_0x6694('0x18')](_0x6694('0x19'),_0x6694('0x20'),path[_0x6694('0x1b')](_0x4cf4ee[_0x6694('0x21')])));}})});router[_0x6694('0x1c')](_0x6694('0x22'),upload[_0x6694('0x23')]('file'),controller[_0x6694('0x24')]);var upload=multer({'storage':multer[_0x6694('0x15')]({'destination':function(_0x2bad7d,_0xbe7732,_0x8fa6a){_0x8fa6a(null,path['join'](config[_0x6694('0x17')],'server/files/images/logos/'));},'filename':function(_0x16f5a1,_0x459a84,_0x49944e){_0x49944e(null,util[_0x6694('0x18')](_0x6694('0x19'),_0x6694('0x25'),path[_0x6694('0x1b')](_0x459a84[_0x6694('0x21')])));}})});router[_0x6694('0x1c')]('/:id/preferred',upload[_0x6694('0x23')](_0x6694('0x1d')),controller[_0x6694('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ea9c9,_0x2815e4,_0x3d3f9e){_0x3d3f9e(null,path[_0x6694('0x16')](config[_0x6694('0x17')],_0x6694('0x1f')));},'filename':function(_0x58cea1,_0x3e90e2,_0x48e7d3){_0x48e7d3(null,util[_0x6694('0x18')](_0x6694('0x19'),_0x6694('0x27'),path[_0x6694('0x1b')](_0x3e90e2[_0x6694('0x21')])));}})});router[_0x6694('0x1c')](_0x6694('0x28'),upload['single'](_0x6694('0x1d')),controller[_0x6694('0x29')]);router[_0x6694('0x2a')](_0x6694('0xd'),auth[_0x6694('0xa')](),controller[_0x6694('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4872aa4..cb76a86 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(_0x2786a4,_0x413424){var _0x469ef0=function(_0x2dfaca){while(--_0x2dfaca){_0x2786a4['push'](_0x2786a4['shift']());}};_0x469ef0(++_0x413424);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x26678e,_0x46f3bc){var _0x7be478=function(_0x5a9b39){while(--_0x5a9b39){_0x26678e['push'](_0x26678e['shift']());}};_0x7be478(++_0x46f3bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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 586fc59..76250e3 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 _0x636d=['util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Setting,\x20%s,\x20%s','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','destroy','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','intersection','includeAll','body','find','addLogo','filename','file','loginLogo','getLogo','server/files/images/logos','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','Sequelize','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x5002ac,_0x12b6cc){var _0x346858=function(_0x37cd09){while(--_0x37cd09){_0x5002ac['push'](_0x5002ac['shift']());}};_0x346858(++_0x12b6cc);}(_0x636d,0xf0));var _0xd636=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x636d[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xd636('0x0'));var rimraf=require(_0xd636('0x1'));var zipdir=require(_0xd636('0x2'));var jsonpatch=require(_0xd636('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd636('0x4'));var Mustache=require(_0xd636('0x5'));var util=require(_0xd636('0x6'));var path=require(_0xd636('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd636('0x8'));var fs=require('fs');var fs_extra=require(_0xd636('0x9'));var _=require('lodash');var squel=require(_0xd636('0xa'));var crypto=require('crypto');var jsforce=require(_0xd636('0xb'));var deskjs=require(_0xd636('0xc'));var toCsv=require(_0xd636('0xd'));var querystring=require(_0xd636('0xe'));var Papa=require(_0xd636('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd636('0x10'));var hardwareService=require(_0xd636('0x11'));var logger=require(_0xd636('0x12'))(_0xd636('0x13'));var utils=require(_0xd636('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd636('0x15'));var db=require(_0xd636('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd636('0x17')][_0xd636('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x25bbe8,_0x490c9f,_0x505516,_0x13e0b4){return new BPromise(function(_0x3ad78d,_0xb7c324){var _0x14fb23=_0x13e0b4||client;return _0x14fb23[_0xd636('0x19')](_0x25bbe8,_0x505516)['then'](function(_0x514671){logger[_0xd636('0x1a')]('Setting,\x20%s,\x20%s',_0x490c9f,'request\x20sent');logger[_0xd636('0x1b')](_0xd636('0x1c'),_0x490c9f,_0xd636('0x1d'),JSON[_0xd636('0x1e')](_0x514671));if(_0x514671[_0xd636('0x1f')]){if(_0x514671[_0xd636('0x1f')][_0xd636('0x20')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x490c9f,_0x514671['error'][_0xd636('0x21')]);return _0xb7c324(_0x514671[_0xd636('0x1f')][_0xd636('0x21')]);}logger[_0xd636('0x1f')](_0xd636('0x22'),_0x490c9f,_0x514671[_0xd636('0x1f')][_0xd636('0x21')]);return _0x3ad78d(_0x514671[_0xd636('0x1f')][_0xd636('0x21')]);}else{logger[_0xd636('0x1a')]('Setting,\x20%s,\x20%s',_0x490c9f,_0xd636('0x1d'));_0x3ad78d(_0x514671['result'][_0xd636('0x21')]);}})[_0xd636('0x23')](function(_0x20d047){logger[_0xd636('0x1f')]('Setting,\x20%s,\x20%s',_0x490c9f,_0x20d047);_0xb7c324(_0x20d047);});});}function respondWithStatusCode(_0x2a264a,_0x35b2f6){_0x35b2f6=_0x35b2f6||0xcc;return function(_0x1f29ea){if(_0x1f29ea){return _0x2a264a[_0xd636('0x24')](_0x35b2f6);}return _0x2a264a[_0xd636('0x25')](_0x35b2f6)['end']();};}function respondWithResult(_0x13ebe6,_0x2d5d4b){_0x2d5d4b=_0x2d5d4b||0xc8;return function(_0x310535){if(_0x310535){return _0x13ebe6['status'](_0x2d5d4b)['json'](_0x310535);}};}function respondWithFilteredResult(_0x611c9,_0x44acf0){return function(_0x4fc4f9){if(_0x4fc4f9){var _0x19537a=typeof _0x44acf0[_0xd636('0x26')]==='undefined'&&typeof _0x44acf0[_0xd636('0x27')]===_0xd636('0x28');var _0x35ecaa=_0x4fc4f9['count'];var _0x4e8261=_0x19537a?0x0:_0x44acf0[_0xd636('0x26')];var _0x4cb693=_0x19537a?_0x4fc4f9[_0xd636('0x29')]:_0x44acf0[_0xd636('0x26')]+_0x44acf0[_0xd636('0x27')];var _0x2c00af;if(_0x4cb693>=_0x35ecaa){_0x4cb693=_0x35ecaa;_0x2c00af=0xc8;}else{_0x2c00af=0xce;}_0x611c9[_0xd636('0x25')](_0x2c00af);return _0x611c9[_0xd636('0x2a')](_0xd636('0x2b'),_0x4e8261+'-'+_0x4cb693+'/'+_0x35ecaa)[_0xd636('0x2c')](_0x4fc4f9);}return null;};}function patchUpdates(_0x3e66da){return function(_0x10b77){try{jsonpatch['apply'](_0x10b77,_0x3e66da,!![]);}catch(_0x38c6a0){return BPromise[_0xd636('0x2d')](_0x38c6a0);}return _0x10b77[_0xd636('0x2e')]();};}function saveUpdates(_0xeebcc1,_0x7e67e4){return function(_0x1ff8ac){if(_0x1ff8ac){return _0x1ff8ac['update'](_0xeebcc1)[_0xd636('0x2f')](function(_0x4cc277){return _0x4cc277;});}return null;};}function removeEntity(_0x226937,_0x2afdca){return function(_0x1b060e){if(_0x1b060e){return _0x1b060e[_0xd636('0x30')]()[_0xd636('0x2f')](function(){_0x226937[_0xd636('0x25')](0xcc)[_0xd636('0x31')]();});}};}function handleEntityNotFound(_0x2119e7,_0x57913e){return function(_0x3b2c96){if(!_0x3b2c96){_0x2119e7[_0xd636('0x24')](0x194);}return _0x3b2c96;};}function handleError(_0x293bb4,_0x1d83f8){_0x1d83f8=_0x1d83f8||0x1f4;return function(_0x401872){logger[_0xd636('0x1f')](_0x401872[_0xd636('0x32')]);if(_0x401872[_0xd636('0x33')]){delete _0x401872[_0xd636('0x33')];}_0x293bb4[_0xd636('0x25')](_0x1d83f8)[_0xd636('0x34')](_0x401872);};}exports[_0xd636('0x35')]=function(_0x1e4012,_0x3c714c){var _0x10a7ab={},_0x3151d9={},_0x4c5696={'count':0x0,'rows':[]};var _0xdefc30=_[_0xd636('0x36')](db[_0xd636('0x37')][_0xd636('0x38')],function(_0x31cd56){return{'name':_0x31cd56[_0xd636('0x39')],'type':_0x31cd56[_0xd636('0x3a')][_0xd636('0x3b')]};});_0x3151d9[_0xd636('0x3c')]=_['map'](_0xdefc30,_0xd636('0x33'));_0x3151d9[_0xd636('0x3d')]=_[_0xd636('0x3e')](_0x1e4012[_0xd636('0x3d')]);_0x3151d9[_0xd636('0x3f')]=_['intersection'](_0x3151d9[_0xd636('0x3c')],_0x3151d9['query']);_0x10a7ab[_0xd636('0x40')]=_['intersection'](_0x3151d9['model'],qs[_0xd636('0x41')](_0x1e4012[_0xd636('0x3d')][_0xd636('0x41')]));_0x10a7ab['attributes']=_0x10a7ab['attributes'][_0xd636('0x42')]?_0x10a7ab[_0xd636('0x40')]:_0x3151d9[_0xd636('0x3c')];if(!_0x1e4012['query']['hasOwnProperty'](_0xd636('0x43'))){_0x10a7ab[_0xd636('0x27')]=qs['limit'](_0x1e4012[_0xd636('0x3d')][_0xd636('0x27')]);_0x10a7ab[_0xd636('0x26')]=qs[_0xd636('0x26')](_0x1e4012['query'][_0xd636('0x26')]);}_0x10a7ab[_0xd636('0x44')]=qs[_0xd636('0x45')](_0x1e4012['query'][_0xd636('0x45')]);_0x10a7ab[_0xd636('0x46')]=qs[_0xd636('0x3f')](_[_0xd636('0x47')](_0x1e4012[_0xd636('0x3d')],_0x3151d9[_0xd636('0x3f')]),_0xdefc30);if(_0x1e4012['query'][_0xd636('0x48')]){_0x10a7ab[_0xd636('0x46')]=_['merge'](_0x10a7ab[_0xd636('0x46')],{'$or':_[_0xd636('0x36')](_0xdefc30,function(_0x12d911){if(_0x12d911[_0xd636('0x3a')]!==_0xd636('0x49')){var _0x2a2b91={};_0x2a2b91[_0x12d911[_0xd636('0x33')]]={'$like':'%'+_0x1e4012[_0xd636('0x3d')]['filter']+'%'};return _0x2a2b91;}})});}_0x10a7ab=_[_0xd636('0x4a')]({},_0x10a7ab,_0x1e4012[_0xd636('0x4b')]);var _0x53e6f3={'where':_0x10a7ab['where']};return db[_0xd636('0x37')][_0xd636('0x29')](_0x53e6f3)['then'](function(_0x62cffb){_0x4c5696[_0xd636('0x29')]=_0x62cffb;if(_0x1e4012[_0xd636('0x3d')]['includeAll']){_0x10a7ab[_0xd636('0x4c')]=[{'all':!![]}];}return db[_0xd636('0x37')][_0xd636('0x4d')](_0x10a7ab);})[_0xd636('0x2f')](function(_0x4ad292){_0x4c5696['rows']=_0x4ad292;return _0x4c5696;})[_0xd636('0x2f')](respondWithFilteredResult(_0x3c714c,_0x10a7ab))[_0xd636('0x23')](handleError(_0x3c714c,null));};exports[_0xd636('0x4e')]=function(_0x563aba,_0x5a5029){var _0x9e09cd={'raw':![],'where':{'id':_0x563aba[_0xd636('0x4f')]['id']}},_0x3d58c1={};_0x3d58c1[_0xd636('0x3c')]=_[_0xd636('0x3e')](db[_0xd636('0x37')]['rawAttributes']);_0x3d58c1[_0xd636('0x3d')]=_[_0xd636('0x3e')](_0x563aba[_0xd636('0x3d')]);_0x3d58c1['filters']=_['intersection'](_0x3d58c1['model'],_0x3d58c1[_0xd636('0x3d')]);_0x9e09cd[_0xd636('0x40')]=_[_0xd636('0x50')](_0x3d58c1[_0xd636('0x3c')],qs['fields'](_0x563aba[_0xd636('0x3d')][_0xd636('0x41')]));_0x9e09cd['attributes']=_0x9e09cd[_0xd636('0x40')][_0xd636('0x42')]?_0x9e09cd[_0xd636('0x40')]:_0x3d58c1[_0xd636('0x3c')];if(_0x563aba['query'][_0xd636('0x51')]){_0x9e09cd[_0xd636('0x4c')]=[{'all':!![]}];}_0x9e09cd=_[_0xd636('0x4a')]({},_0x9e09cd,_0x563aba[_0xd636('0x4b')]);return db[_0xd636('0x37')]['find'](_0x9e09cd)[_0xd636('0x2f')](handleEntityNotFound(_0x5a5029,null))[_0xd636('0x2f')](respondWithResult(_0x5a5029,null))['catch'](handleError(_0x5a5029,null));};exports['update']=function(_0x102a1c,_0x2b98ab){if(_0x102a1c[_0xd636('0x52')]['id']){delete _0x102a1c[_0xd636('0x52')]['id'];}return db['Setting'][_0xd636('0x53')]({'where':{'id':_0x102a1c['params']['id']}})['then'](handleEntityNotFound(_0x2b98ab,null))[_0xd636('0x2f')](saveUpdates(_0x102a1c[_0xd636('0x52')],null))[_0xd636('0x2f')](respondWithResult(_0x2b98ab,null))[_0xd636('0x23')](handleError(_0x2b98ab,null));};exports[_0xd636('0x54')]=function(_0x2b876a,_0x38e8dc,_0x299184){if(_0x2b876a['file']&&_0x2b876a['file']['filename']){_0x2b876a[_0xd636('0x52')]['logo']=_0x2b876a['file'][_0xd636('0x55')];}return db['Setting']['find']({'where':{'id':_0x2b876a['params']['id']}})['then'](handleEntityNotFound(_0x38e8dc,null))[_0xd636('0x2f')](saveUpdates(_0x2b876a[_0xd636('0x52')],null))[_0xd636('0x2f')](respondWithResult(_0x38e8dc,null))['catch'](handleError(_0x38e8dc,null));};exports['addLogoLogin']=function(_0x3ac739,_0x4fabda,_0x381315){if(_0x3ac739['file']&&_0x3ac739[_0xd636('0x56')]['filename']){_0x3ac739['body'][_0xd636('0x57')]=_0x3ac739['file']['filename'];}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x3ac739[_0xd636('0x4f')]['id']}})[_0xd636('0x2f')](handleEntityNotFound(_0x4fabda,null))[_0xd636('0x2f')](saveUpdates(_0x3ac739[_0xd636('0x52')],null))[_0xd636('0x2f')](respondWithResult(_0x4fabda,null))[_0xd636('0x23')](handleError(_0x4fabda,null));};var utilLicense=require(_0xd636('0x15'));exports[_0xd636('0x58')]=function(_0x5dd9fd,_0x424bdd,_0x507ccb){var _0x20b218=_0xd636('0x59');var _0x1a1f35={'custom':![]};return utilLicense['getLicense']()[_0xd636('0x2f')](function(_0x333825){if(_0x333825){_0x1a1f35=_0x333825;}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x5dd9fd['params']['id']},'attributes':[_0xd636('0x5a'),'loginLogo','preferred',_0xd636('0x5b'),_0xd636('0x5c'),_0xd636('0x5d'),_0xd636('0x5e'),_0xd636('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x424bdd,null))[_0xd636('0x2f')](function(_0x499d9d){if(_0x499d9d){var _0x27988a=_0x499d9d[_0xd636('0x5a')]&&fs[_0xd636('0x60')](path[_0xd636('0x61')](config[_0xd636('0x62')],_0x20b218,_[_0xd636('0x63')](_0x499d9d[_0xd636('0x5a')])))?path[_0xd636('0x61')](config[_0xd636('0x62')],_0x20b218,_[_0xd636('0x63')](_0x499d9d[_0xd636('0x5a')])):path['join'](config[_0xd636('0x62')],_0x20b218,_[_0xd636('0x63')]('default_logo.svg'));var _0x5d0db1=_0xd636('0x64')+_[_0xd636('0x65')](_0xd636('0x5a'));if(_0x499d9d[_0x5d0db1]||!_0x1a1f35[_0xd636('0x66')]){_0x27988a=path[_0xd636('0x61')](config[_0xd636('0x62')],_0x20b218,_['toLower'](_0xd636('0x67')));}if(!fs[_0xd636('0x60')](_0x27988a)){throw new db['Sequelize'][(_0xd636('0x68'))](_[_0xd636('0x65')](_0xd636('0x5a'))+_0xd636('0x69'));}return _0x424bdd[_0xd636('0x6a')](_0x27988a);}})[_0xd636('0x23')](handleError(_0x424bdd,null));};var utilLicense=require(_0xd636('0x15'));exports[_0xd636('0x6b')]=function(_0xfdddac,_0x3bef66,_0x1882fa){var _0x55b24b='server/files/images/logos';var _0x4c8ff1={'custom':![]};return utilLicense[_0xd636('0x6c')]()[_0xd636('0x2f')](function(_0x25fea2){if(_0x25fea2){_0x4c8ff1=_0x25fea2;}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0xfdddac[_0xd636('0x4f')]['id']},'attributes':[_0xd636('0x5a'),_0xd636('0x57'),'preferred',_0xd636('0x5b'),_0xd636('0x5c'),_0xd636('0x5d'),_0xd636('0x5e'),_0xd636('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x3bef66,null))[_0xd636('0x2f')](function(_0x2c88d0){if(_0x2c88d0){var _0x48da60=_0x2c88d0[_0xd636('0x57')]&&fs[_0xd636('0x60')](path[_0xd636('0x61')](config[_0xd636('0x62')],_0x55b24b,_['toLower'](_0x2c88d0[_0xd636('0x57')])))?path[_0xd636('0x61')](config[_0xd636('0x62')],_0x55b24b,_['toLower'](_0x2c88d0[_0xd636('0x57')])):path[_0xd636('0x61')](config[_0xd636('0x62')],_0x55b24b,_[_0xd636('0x63')](_0xd636('0x6d')));var _0x95caab=_0xd636('0x64')+_[_0xd636('0x65')](_0xd636('0x57'));if(_0x2c88d0[_0x95caab]||!_0x4c8ff1[_0xd636('0x66')]){_0x48da60=path[_0xd636('0x61')](config['root'],_0x55b24b,_[_0xd636('0x63')](_0xd636('0x6d')));}if(!fs['existsSync'](_0x48da60)){throw new db['Sequelize']['ValidationError'](_[_0xd636('0x65')]('loginLogo')+_0xd636('0x69'));}return _0x3bef66[_0xd636('0x6a')](_0x48da60);}})[_0xd636('0x23')](handleError(_0x3bef66,null));};exports['gdpr']=function(_0xc8fe4e,_0x20c66e){return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0xc8fe4e[_0xd636('0x4f')]['id']},'attributes':[_0xd636('0x6e')]})['then'](respondWithResult(_0x20c66e,null))[_0xd636('0x23')](handleError(_0x20c66e,null));};exports[_0xd636('0x6f')]=function(_0x2c944f,_0x5c79c9,_0x3cf48f){if(_0x2c944f[_0xd636('0x56')]&&_0x2c944f[_0xd636('0x56')][_0xd636('0x55')]){_0x2c944f['body'][_0xd636('0x70')]=_0x2c944f[_0xd636('0x56')]['filename'];}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x2c944f[_0xd636('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c79c9,null))[_0xd636('0x2f')](saveUpdates(_0x2c944f[_0xd636('0x52')],null))[_0xd636('0x2f')](respondWithResult(_0x5c79c9,null))[_0xd636('0x23')](handleError(_0x5c79c9,null));};var utilLicense=require(_0xd636('0x15'));exports[_0xd636('0x71')]=function(_0x317878,_0x1ef325,_0x3ca6c4){var _0x54af66=_0xd636('0x59');var _0x5b4c2a={'custom':![]};return utilLicense[_0xd636('0x6c')]()[_0xd636('0x2f')](function(_0x454be4){if(_0x454be4){_0x5b4c2a=_0x454be4;}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x317878[_0xd636('0x4f')]['id']},'attributes':[_0xd636('0x5a'),_0xd636('0x57'),'preferred',_0xd636('0x5b'),_0xd636('0x5c'),_0xd636('0x5d'),'defaultPreferred',_0xd636('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x1ef325,null))[_0xd636('0x2f')](function(_0x2e71e6){if(_0x2e71e6){var _0x1a4780=_0x2e71e6[_0xd636('0x70')]&&fs[_0xd636('0x60')](path[_0xd636('0x61')](config[_0xd636('0x62')],_0x54af66,_['toLower'](_0x2e71e6[_0xd636('0x70')])))?path[_0xd636('0x61')](config[_0xd636('0x62')],_0x54af66,_['toLower'](_0x2e71e6[_0xd636('0x70')])):path[_0xd636('0x61')](config[_0xd636('0x62')],_0x54af66,_['toLower'](_0xd636('0x72')));var _0x2f927d=_0xd636('0x64')+_['upperFirst'](_0xd636('0x70'));if(_0x2e71e6[_0x2f927d]||!_0x5b4c2a[_0xd636('0x66')]||!_0x5b4c2a[_0xd636('0x70')]){_0x1a4780=path['join'](config['root'],_0x54af66,_[_0xd636('0x63')](_0xd636('0x72')));}if(!fs['existsSync'](_0x1a4780)){throw new db[(_0xd636('0x73'))]['ValidationError'](_[_0xd636('0x65')]('preferred')+_0xd636('0x69'));}return _0x1ef325[_0xd636('0x6a')](_0x1a4780);}})[_0xd636('0x23')](handleError(_0x1ef325,null));};exports[_0xd636('0x74')]=function(_0x506898,_0x47f460,_0x4918f0){if(_0x506898['file']&&_0x506898[_0xd636('0x56')]['filename']){_0x506898['body'][_0xd636('0x5b')]=_0x506898['file']['filename'];}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x506898[_0xd636('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47f460,null))['then'](saveUpdates(_0x506898[_0xd636('0x52')],null))[_0xd636('0x2f')](respondWithResult(_0x47f460,null))[_0xd636('0x23')](handleError(_0x47f460,null));};var utilLicense=require(_0xd636('0x15'));exports[_0xd636('0x75')]=function(_0x38bad1,_0x5403f1,_0x3b1793){var _0x4d57fe=_0xd636('0x59');var _0x1d243e={'custom':![]};return utilLicense[_0xd636('0x6c')]()['then'](function(_0x440e36){if(_0x440e36){_0x1d243e=_0x440e36;}return db[_0xd636('0x37')][_0xd636('0x53')]({'where':{'id':_0x38bad1['params']['id']},'attributes':['logo',_0xd636('0x57'),_0xd636('0x70'),_0xd636('0x5b'),_0xd636('0x5c'),_0xd636('0x5d'),_0xd636('0x5e'),_0xd636('0x5f')],'raw':!![]});})[_0xd636('0x2f')](handleEntityNotFound(_0x5403f1,null))[_0xd636('0x2f')](function(_0x116ed6){if(_0x116ed6){var _0x88e3e8=_0x116ed6[_0xd636('0x5b')]&&fs[_0xd636('0x60')](path['join'](config[_0xd636('0x62')],_0x4d57fe,_[_0xd636('0x63')](_0x116ed6['favicon'])))?path[_0xd636('0x61')](config[_0xd636('0x62')],_0x4d57fe,_[_0xd636('0x63')](_0x116ed6[_0xd636('0x5b')])):path[_0xd636('0x61')](config[_0xd636('0x62')],_0x4d57fe,_[_0xd636('0x63')](_0xd636('0x76')));var _0x3d9a8a=_0xd636('0x64')+_[_0xd636('0x65')]('favicon');if(_0x116ed6[_0x3d9a8a]||!_0x1d243e[_0xd636('0x66')]){_0x88e3e8=path['join'](config['root'],_0x4d57fe,_[_0xd636('0x63')](_0xd636('0x76')));}if(!fs[_0xd636('0x60')](_0x88e3e8)){throw new db[(_0xd636('0x73'))][(_0xd636('0x68'))](_[_0xd636('0x65')](_0xd636('0x5b'))+'\x20not\x20found');}return _0x5403f1[_0xd636('0x6a')](_0x88e3e8);}})['catch'](handleError(_0x5403f1,null));};exports['getDate']=function(_0x2218c7,_0x11c4ef){var _0x24b955={'offset':moment()[_0xd636('0x77')]()};_0x24b955[_0xd636('0x78')]=moment()[_0xd636('0x77')](_0x24b955[_0xd636('0x26')])[_0xd636('0x79')](_0xd636('0x7a'));return _0x11c4ef[_0xd636('0x25')](0xc8)[_0xd636('0x34')](_0x24b955);}; \ No newline at end of file +var _0xc8b0=['update','destroy','stack','name','index','map','Setting','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','body','find','addLogo','file','logo','filename','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','join','toLower','default_logo.svg','upperFirst','existsSync','download','getLogoLogin','preferred','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default','Sequelize','addFavicon','getFavicon','custom','default_favicon.ico','getDate','utcOffset','now','send','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','Setting,\x20%s,\x20%s','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc8b0,0x1cc));var _0x0c8b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc8b0[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x0c8b('0x0'));var rimraf=require(_0x0c8b('0x1'));var zipdir=require(_0x0c8b('0x2'));var jsonpatch=require(_0x0c8b('0x3'));var rp=require(_0x0c8b('0x4'));var moment=require(_0x0c8b('0x5'));var BPromise=require(_0x0c8b('0x6'));var Mustache=require(_0x0c8b('0x7'));var util=require(_0x0c8b('0x8'));var path=require(_0x0c8b('0x9'));var sox=require(_0x0c8b('0xa'));var csv=require(_0x0c8b('0xb'));var ejs=require(_0x0c8b('0xc'));var fs=require('fs');var fs_extra=require(_0x0c8b('0xd'));var _=require(_0x0c8b('0xe'));var squel=require('squel');var crypto=require(_0x0c8b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0c8b('0x10'));var toCsv=require(_0x0c8b('0xb'));var querystring=require(_0x0c8b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c8b('0x12'));var qs=require(_0x0c8b('0x13'));var as=require(_0x0c8b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c8b('0x15'))(_0x0c8b('0x16'));var utils=require(_0x0c8b('0x17'));var config=require(_0x0c8b('0x18'));var licenseUtil=require(_0x0c8b('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0c8b('0x1a'));var client=jayson[_0x0c8b('0x1b')][_0x0c8b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2baf59,_0x47246a,_0x4b202b,_0x1af8c2){return new BPromise(function(_0x3b1b4d,_0x5c44f0){var _0x4d47ba=_0x1af8c2||client;return _0x4d47ba[_0x0c8b('0x1d')](_0x2baf59,_0x4b202b)[_0x0c8b('0x1e')](function(_0x582e44){logger[_0x0c8b('0x1f')]('Setting,\x20%s,\x20%s',_0x47246a,_0x0c8b('0x20'));logger[_0x0c8b('0x21')](_0x0c8b('0x22'),_0x47246a,_0x0c8b('0x20'),JSON['stringify'](_0x582e44));if(_0x582e44[_0x0c8b('0x23')]){if(_0x582e44[_0x0c8b('0x23')]['code']===0x1f4){logger[_0x0c8b('0x23')]('Setting,\x20%s,\x20%s',_0x47246a,_0x582e44['error']['message']);return _0x5c44f0(_0x582e44[_0x0c8b('0x23')][_0x0c8b('0x24')]);}logger[_0x0c8b('0x23')](_0x0c8b('0x25'),_0x47246a,_0x582e44['error'][_0x0c8b('0x24')]);return _0x3b1b4d(_0x582e44[_0x0c8b('0x23')][_0x0c8b('0x24')]);}else{logger['info'](_0x0c8b('0x25'),_0x47246a,_0x0c8b('0x20'));_0x3b1b4d(_0x582e44[_0x0c8b('0x26')][_0x0c8b('0x24')]);}})['catch'](function(_0x39a559){logger['error'](_0x0c8b('0x25'),_0x47246a,_0x39a559);_0x5c44f0(_0x39a559);});});}function respondWithStatusCode(_0x1dafe0,_0x1572ae){_0x1572ae=_0x1572ae||0xcc;return function(_0x29ab10){if(_0x29ab10){return _0x1dafe0[_0x0c8b('0x27')](_0x1572ae);}return _0x1dafe0[_0x0c8b('0x28')](_0x1572ae)[_0x0c8b('0x29')]();};}function respondWithResult(_0xe42e83,_0x55789b){_0x55789b=_0x55789b||0xc8;return function(_0x5cf080){if(_0x5cf080){return _0xe42e83[_0x0c8b('0x28')](_0x55789b)['json'](_0x5cf080);}};}function respondWithFilteredResult(_0x304d52,_0x57a413){return function(_0x1a242b){if(_0x1a242b){var _0x1cf823=typeof _0x57a413[_0x0c8b('0x2a')]===_0x0c8b('0x2b')&&typeof _0x57a413['limit']==='undefined';var _0x1e3185=_0x1a242b[_0x0c8b('0x2c')];var _0x48da90=_0x1cf823?0x0:_0x57a413[_0x0c8b('0x2a')];var _0x31bf70=_0x1cf823?_0x1a242b[_0x0c8b('0x2c')]:_0x57a413[_0x0c8b('0x2a')]+_0x57a413[_0x0c8b('0x2d')];var _0x240513;if(_0x31bf70>=_0x1e3185){_0x31bf70=_0x1e3185;_0x240513=0xc8;}else{_0x240513=0xce;}_0x304d52[_0x0c8b('0x28')](_0x240513);return _0x304d52[_0x0c8b('0x2e')](_0x0c8b('0x2f'),_0x48da90+'-'+_0x31bf70+'/'+_0x1e3185)[_0x0c8b('0x30')](_0x1a242b);}return null;};}function patchUpdates(_0x5f4c1b){return function(_0x8f43ba){try{jsonpatch[_0x0c8b('0x31')](_0x8f43ba,_0x5f4c1b,!![]);}catch(_0x18344d){return BPromise[_0x0c8b('0x32')](_0x18344d);}return _0x8f43ba[_0x0c8b('0x33')]();};}function saveUpdates(_0x20c9f5,_0x4d5787){return function(_0x5e6a81){if(_0x5e6a81){return _0x5e6a81[_0x0c8b('0x34')](_0x20c9f5)[_0x0c8b('0x1e')](function(_0x175197){return _0x175197;});}return null;};}function removeEntity(_0x4fc25b,_0x4e8868){return function(_0x2b7da0){if(_0x2b7da0){return _0x2b7da0[_0x0c8b('0x35')]()[_0x0c8b('0x1e')](function(){_0x4fc25b['status'](0xcc)[_0x0c8b('0x29')]();});}};}function handleEntityNotFound(_0x2e2625,_0x2c1826){return function(_0x51b0e9){if(!_0x51b0e9){_0x2e2625[_0x0c8b('0x27')](0x194);}return _0x51b0e9;};}function handleError(_0x5a7723,_0x11a9e6){_0x11a9e6=_0x11a9e6||0x1f4;return function(_0x3394ae){logger[_0x0c8b('0x23')](_0x3394ae[_0x0c8b('0x36')]);if(_0x3394ae[_0x0c8b('0x37')]){delete _0x3394ae[_0x0c8b('0x37')];}_0x5a7723[_0x0c8b('0x28')](_0x11a9e6)['send'](_0x3394ae);};}exports[_0x0c8b('0x38')]=function(_0x5363a0,_0x475e97){var _0x431c79={},_0x2ea420={},_0x1ed28d={'count':0x0,'rows':[]};var _0x37f05e=_[_0x0c8b('0x39')](db[_0x0c8b('0x3a')][_0x0c8b('0x3b')],function(_0x423e8d){return{'name':_0x423e8d['fieldName'],'type':_0x423e8d[_0x0c8b('0x3c')][_0x0c8b('0x3d')]};});_0x2ea420[_0x0c8b('0x3e')]=_[_0x0c8b('0x39')](_0x37f05e,_0x0c8b('0x37'));_0x2ea420[_0x0c8b('0x3f')]=_[_0x0c8b('0x40')](_0x5363a0[_0x0c8b('0x3f')]);_0x2ea420['filters']=_[_0x0c8b('0x41')](_0x2ea420['model'],_0x2ea420[_0x0c8b('0x3f')]);_0x431c79[_0x0c8b('0x42')]=_['intersection'](_0x2ea420[_0x0c8b('0x3e')],qs[_0x0c8b('0x43')](_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x43')]));_0x431c79['attributes']=_0x431c79[_0x0c8b('0x42')][_0x0c8b('0x44')]?_0x431c79[_0x0c8b('0x42')]:_0x2ea420[_0x0c8b('0x3e')];if(!_0x5363a0['query'][_0x0c8b('0x45')]('nolimit')){_0x431c79[_0x0c8b('0x2d')]=qs['limit'](_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x2d')]);_0x431c79['offset']=qs[_0x0c8b('0x2a')](_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x2a')]);}_0x431c79[_0x0c8b('0x46')]=qs[_0x0c8b('0x47')](_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x47')]);_0x431c79[_0x0c8b('0x48')]=qs[_0x0c8b('0x49')](_[_0x0c8b('0x4a')](_0x5363a0[_0x0c8b('0x3f')],_0x2ea420[_0x0c8b('0x49')]),_0x37f05e);if(_0x5363a0[_0x0c8b('0x3f')]['filter']){_0x431c79[_0x0c8b('0x48')]=_[_0x0c8b('0x4b')](_0x431c79[_0x0c8b('0x48')],{'$or':_[_0x0c8b('0x39')](_0x37f05e,function(_0x514e9b){if(_0x514e9b[_0x0c8b('0x3c')]!==_0x0c8b('0x4c')){var _0x570448={};_0x570448[_0x514e9b['name']]={'$like':'%'+_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x4d')]+'%'};return _0x570448;}})});}_0x431c79=_[_0x0c8b('0x4b')]({},_0x431c79,_0x5363a0['options']);var _0x547d7f={'where':_0x431c79[_0x0c8b('0x48')]};return db['Setting']['count'](_0x547d7f)[_0x0c8b('0x1e')](function(_0x73bfbe){_0x1ed28d[_0x0c8b('0x2c')]=_0x73bfbe;if(_0x5363a0[_0x0c8b('0x3f')][_0x0c8b('0x4e')]){_0x431c79[_0x0c8b('0x4f')]=[{'all':!![]}];}return db['Setting'][_0x0c8b('0x50')](_0x431c79);})[_0x0c8b('0x1e')](function(_0x3f2e5c){_0x1ed28d[_0x0c8b('0x51')]=_0x3f2e5c;return _0x1ed28d;})[_0x0c8b('0x1e')](respondWithFilteredResult(_0x475e97,_0x431c79))[_0x0c8b('0x52')](handleError(_0x475e97,null));};exports[_0x0c8b('0x53')]=function(_0x55c379,_0x5dd175){var _0x33e8f9={'raw':![],'where':{'id':_0x55c379[_0x0c8b('0x54')]['id']}},_0x3d497c={};_0x3d497c['model']=_[_0x0c8b('0x40')](db['Setting']['rawAttributes']);_0x3d497c[_0x0c8b('0x3f')]=_[_0x0c8b('0x40')](_0x55c379[_0x0c8b('0x3f')]);_0x3d497c[_0x0c8b('0x49')]=_['intersection'](_0x3d497c[_0x0c8b('0x3e')],_0x3d497c[_0x0c8b('0x3f')]);_0x33e8f9[_0x0c8b('0x42')]=_[_0x0c8b('0x41')](_0x3d497c[_0x0c8b('0x3e')],qs[_0x0c8b('0x43')](_0x55c379[_0x0c8b('0x3f')][_0x0c8b('0x43')]));_0x33e8f9[_0x0c8b('0x42')]=_0x33e8f9[_0x0c8b('0x42')]['length']?_0x33e8f9['attributes']:_0x3d497c[_0x0c8b('0x3e')];if(_0x55c379[_0x0c8b('0x3f')][_0x0c8b('0x4e')]){_0x33e8f9['include']=[{'all':!![]}];}_0x33e8f9=_['merge']({},_0x33e8f9,_0x55c379[_0x0c8b('0x55')]);return db[_0x0c8b('0x3a')]['find'](_0x33e8f9)[_0x0c8b('0x1e')](handleEntityNotFound(_0x5dd175,null))[_0x0c8b('0x1e')](respondWithResult(_0x5dd175,null))[_0x0c8b('0x52')](handleError(_0x5dd175,null));};exports[_0x0c8b('0x34')]=function(_0x2680e7,_0x4fbfa0){if(_0x2680e7[_0x0c8b('0x56')]['id']){delete _0x2680e7[_0x0c8b('0x56')]['id'];}return db['Setting'][_0x0c8b('0x57')]({'where':{'id':_0x2680e7[_0x0c8b('0x54')]['id']}})[_0x0c8b('0x1e')](handleEntityNotFound(_0x4fbfa0,null))[_0x0c8b('0x1e')](saveUpdates(_0x2680e7[_0x0c8b('0x56')],null))[_0x0c8b('0x1e')](respondWithResult(_0x4fbfa0,null))['catch'](handleError(_0x4fbfa0,null));};exports[_0x0c8b('0x58')]=function(_0x4c79da,_0x29bd4a,_0x4d1275){if(_0x4c79da[_0x0c8b('0x59')]&&_0x4c79da[_0x0c8b('0x59')]['filename']){_0x4c79da['body'][_0x0c8b('0x5a')]=_0x4c79da[_0x0c8b('0x59')][_0x0c8b('0x5b')];}return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x4c79da['params']['id']}})[_0x0c8b('0x1e')](handleEntityNotFound(_0x29bd4a,null))[_0x0c8b('0x1e')](saveUpdates(_0x4c79da[_0x0c8b('0x56')],null))[_0x0c8b('0x1e')](respondWithResult(_0x29bd4a,null))['catch'](handleError(_0x29bd4a,null));};exports['addLogoLogin']=function(_0x15377f,_0x3e3b78,_0x413661){if(_0x15377f[_0x0c8b('0x59')]&&_0x15377f[_0x0c8b('0x59')]['filename']){_0x15377f['body'][_0x0c8b('0x5c')]=_0x15377f[_0x0c8b('0x59')]['filename'];}return db[_0x0c8b('0x3a')]['find']({'where':{'id':_0x15377f[_0x0c8b('0x54')]['id']}})[_0x0c8b('0x1e')](handleEntityNotFound(_0x3e3b78,null))[_0x0c8b('0x1e')](saveUpdates(_0x15377f[_0x0c8b('0x56')],null))['then'](respondWithResult(_0x3e3b78,null))[_0x0c8b('0x52')](handleError(_0x3e3b78,null));};var utilLicense=require(_0x0c8b('0x19'));exports[_0x0c8b('0x5d')]=function(_0x348d88,_0x23a47c,_0x4613aa){var _0x4eac86=_0x0c8b('0x5e');var _0x2ec909={'custom':![]};return utilLicense[_0x0c8b('0x5f')]()[_0x0c8b('0x1e')](function(_0x2bb518){if(_0x2bb518){_0x2ec909=_0x2bb518;}return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x348d88[_0x0c8b('0x54')]['id']},'attributes':[_0x0c8b('0x5a'),'loginLogo','preferred',_0x0c8b('0x60'),_0x0c8b('0x61'),_0x0c8b('0x62'),_0x0c8b('0x63'),_0x0c8b('0x64')],'raw':!![]});})[_0x0c8b('0x1e')](handleEntityNotFound(_0x23a47c,null))[_0x0c8b('0x1e')](function(_0x11012f){if(_0x11012f){var _0xe664a9=_0x11012f[_0x0c8b('0x5a')]&&fs['existsSync'](path['join'](config[_0x0c8b('0x65')],_0x4eac86,_['toLower'](_0x11012f['logo'])))?path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x4eac86,_[_0x0c8b('0x67')](_0x11012f[_0x0c8b('0x5a')])):path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x4eac86,_[_0x0c8b('0x67')](_0x0c8b('0x68')));var _0x22a6e8='default'+_[_0x0c8b('0x69')](_0x0c8b('0x5a'));if(_0x11012f[_0x22a6e8]||!_0x2ec909['custom']){_0xe664a9=path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x4eac86,_[_0x0c8b('0x67')](_0x0c8b('0x68')));}if(!fs[_0x0c8b('0x6a')](_0xe664a9)){throw new db['Sequelize']['ValidationError'](_[_0x0c8b('0x69')](_0x0c8b('0x5a'))+'\x20not\x20found');}return _0x23a47c[_0x0c8b('0x6b')](_0xe664a9);}})[_0x0c8b('0x52')](handleError(_0x23a47c,null));};var utilLicense=require('../../config/license/util');exports[_0x0c8b('0x6c')]=function(_0x48bb1e,_0x408ba5,_0x2e7e54){var _0x1e9110=_0x0c8b('0x5e');var _0x2b0fd9={'custom':![]};return utilLicense[_0x0c8b('0x5f')]()[_0x0c8b('0x1e')](function(_0x220448){if(_0x220448){_0x2b0fd9=_0x220448;}return db['Setting'][_0x0c8b('0x57')]({'where':{'id':_0x48bb1e[_0x0c8b('0x54')]['id']},'attributes':[_0x0c8b('0x5a'),'loginLogo',_0x0c8b('0x6d'),_0x0c8b('0x60'),_0x0c8b('0x61'),'defaultLoginLogo','defaultPreferred',_0x0c8b('0x64')],'raw':!![]});})[_0x0c8b('0x1e')](handleEntityNotFound(_0x408ba5,null))['then'](function(_0x107ee2){if(_0x107ee2){var _0xf56cbc=_0x107ee2[_0x0c8b('0x5c')]&&fs[_0x0c8b('0x6a')](path['join'](config[_0x0c8b('0x65')],_0x1e9110,_[_0x0c8b('0x67')](_0x107ee2[_0x0c8b('0x5c')])))?path[_0x0c8b('0x66')](config['root'],_0x1e9110,_[_0x0c8b('0x67')](_0x107ee2['loginLogo'])):path['join'](config['root'],_0x1e9110,_[_0x0c8b('0x67')](_0x0c8b('0x6e')));var _0x29d6f7='default'+_[_0x0c8b('0x69')](_0x0c8b('0x5c'));if(_0x107ee2[_0x29d6f7]||!_0x2b0fd9['custom']){_0xf56cbc=path['join'](config[_0x0c8b('0x65')],_0x1e9110,_[_0x0c8b('0x67')](_0x0c8b('0x6e')));}if(!fs[_0x0c8b('0x6a')](_0xf56cbc)){throw new db['Sequelize'][(_0x0c8b('0x6f'))](_[_0x0c8b('0x69')](_0x0c8b('0x5c'))+_0x0c8b('0x70'));}return _0x408ba5[_0x0c8b('0x6b')](_0xf56cbc);}})[_0x0c8b('0x52')](handleError(_0x408ba5,null));};exports[_0x0c8b('0x71')]=function(_0x41d4c2,_0x27b942){return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x41d4c2[_0x0c8b('0x54')]['id']},'attributes':[_0x0c8b('0x72')]})[_0x0c8b('0x1e')](respondWithResult(_0x27b942,null))['catch'](handleError(_0x27b942,null));};exports[_0x0c8b('0x73')]=function(_0x4e38ad,_0x4aface,_0x4991a8){if(_0x4e38ad[_0x0c8b('0x59')]&&_0x4e38ad[_0x0c8b('0x59')][_0x0c8b('0x5b')]){_0x4e38ad['body'][_0x0c8b('0x6d')]=_0x4e38ad['file'][_0x0c8b('0x5b')];}return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x4e38ad[_0x0c8b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4aface,null))['then'](saveUpdates(_0x4e38ad[_0x0c8b('0x56')],null))[_0x0c8b('0x1e')](respondWithResult(_0x4aface,null))['catch'](handleError(_0x4aface,null));};var utilLicense=require('../../config/license/util');exports[_0x0c8b('0x74')]=function(_0x21d3ea,_0x5971a9,_0x40e739){var _0x2df664='server/files/images/logos';var _0x14b9bf={'custom':![]};return utilLicense['getLicense']()[_0x0c8b('0x1e')](function(_0x414357){if(_0x414357){_0x14b9bf=_0x414357;}return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x21d3ea[_0x0c8b('0x54')]['id']},'attributes':[_0x0c8b('0x5a'),_0x0c8b('0x5c'),_0x0c8b('0x6d'),'favicon',_0x0c8b('0x61'),_0x0c8b('0x62'),_0x0c8b('0x63'),_0x0c8b('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x5971a9,null))[_0x0c8b('0x1e')](function(_0x42392e){if(_0x42392e){var _0x254c2a=_0x42392e[_0x0c8b('0x6d')]&&fs[_0x0c8b('0x6a')](path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x2df664,_[_0x0c8b('0x67')](_0x42392e['preferred'])))?path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x2df664,_[_0x0c8b('0x67')](_0x42392e[_0x0c8b('0x6d')])):path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x2df664,_[_0x0c8b('0x67')](_0x0c8b('0x75')));var _0xc170eb=_0x0c8b('0x76')+_[_0x0c8b('0x69')]('preferred');if(_0x42392e[_0xc170eb]||!_0x14b9bf['custom']||!_0x14b9bf[_0x0c8b('0x6d')]){_0x254c2a=path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x2df664,_['toLower'](_0x0c8b('0x75')));}if(!fs['existsSync'](_0x254c2a)){throw new db[(_0x0c8b('0x77'))][(_0x0c8b('0x6f'))](_[_0x0c8b('0x69')](_0x0c8b('0x6d'))+_0x0c8b('0x70'));}return _0x5971a9[_0x0c8b('0x6b')](_0x254c2a);}})[_0x0c8b('0x52')](handleError(_0x5971a9,null));};exports[_0x0c8b('0x78')]=function(_0x1bd48f,_0x531dcc,_0x4a8783){if(_0x1bd48f[_0x0c8b('0x59')]&&_0x1bd48f[_0x0c8b('0x59')][_0x0c8b('0x5b')]){_0x1bd48f[_0x0c8b('0x56')]['favicon']=_0x1bd48f[_0x0c8b('0x59')][_0x0c8b('0x5b')];}return db[_0x0c8b('0x3a')][_0x0c8b('0x57')]({'where':{'id':_0x1bd48f[_0x0c8b('0x54')]['id']}})['then'](handleEntityNotFound(_0x531dcc,null))[_0x0c8b('0x1e')](saveUpdates(_0x1bd48f[_0x0c8b('0x56')],null))['then'](respondWithResult(_0x531dcc,null))[_0x0c8b('0x52')](handleError(_0x531dcc,null));};var utilLicense=require('../../config/license/util');exports[_0x0c8b('0x79')]=function(_0x41139b,_0x39c77c,_0x1de03f){var _0x5608a8='server/files/images/logos';var _0x2ed8de={'custom':![]};return utilLicense[_0x0c8b('0x5f')]()['then'](function(_0x132688){if(_0x132688){_0x2ed8de=_0x132688;}return db[_0x0c8b('0x3a')]['find']({'where':{'id':_0x41139b[_0x0c8b('0x54')]['id']},'attributes':['logo',_0x0c8b('0x5c'),'preferred',_0x0c8b('0x60'),_0x0c8b('0x61'),_0x0c8b('0x62'),_0x0c8b('0x63'),_0x0c8b('0x64')],'raw':!![]});})[_0x0c8b('0x1e')](handleEntityNotFound(_0x39c77c,null))['then'](function(_0x35531f){if(_0x35531f){var _0x4a0cb4=_0x35531f['favicon']&&fs[_0x0c8b('0x6a')](path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x5608a8,_[_0x0c8b('0x67')](_0x35531f[_0x0c8b('0x60')])))?path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x5608a8,_['toLower'](_0x35531f[_0x0c8b('0x60')])):path['join'](config['root'],_0x5608a8,_[_0x0c8b('0x67')]('default_favicon.ico'));var _0x39839d='default'+_[_0x0c8b('0x69')]('favicon');if(_0x35531f[_0x39839d]||!_0x2ed8de[_0x0c8b('0x7a')]){_0x4a0cb4=path[_0x0c8b('0x66')](config[_0x0c8b('0x65')],_0x5608a8,_['toLower'](_0x0c8b('0x7b')));}if(!fs[_0x0c8b('0x6a')](_0x4a0cb4)){throw new db[(_0x0c8b('0x77'))][(_0x0c8b('0x6f'))](_[_0x0c8b('0x69')](_0x0c8b('0x60'))+_0x0c8b('0x70'));}return _0x39c77c['download'](_0x4a0cb4);}})['catch'](handleError(_0x39c77c,null));};exports[_0x0c8b('0x7c')]=function(_0x52dca9,_0x481c14){var _0x411df6={'offset':moment()[_0x0c8b('0x7d')]()};_0x411df6[_0x0c8b('0x7e')]=moment()[_0x0c8b('0x7d')](_0x411df6['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x481c14['status'](0xc8)[_0x0c8b('0x7f')](_0x411df6);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 85785c5..a38ddc6 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x7217,0x19e));var _0x7721=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7217[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x008c,0x188));var _0xc008=function(_0x3adc9f,_0x5d49d5){_0x3adc9f=_0x3adc9f-0x0;var _0x432a40=_0x008c[_0x3adc9f];return _0x432a40;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'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 1f96529..971a325 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 _0x3a9c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','Setting','find','options','where','attributes','model','include','map','then','ShowSetting','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3a9c,0x1b4));var _0xc3a9=function(_0x20218b,_0x1a0134){_0x20218b=_0x20218b-0x0;var _0x224afd=_0x3a9c[_0x20218b];return _0x224afd;};'use strict';var _=require(_0xc3a9('0x0'));var util=require(_0xc3a9('0x1'));var moment=require(_0xc3a9('0x2'));var BPromise=require(_0xc3a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3a9('0x4'));var db=require(_0xc3a9('0x5'))['db'];var utils=require(_0xc3a9('0x6'));var logger=require(_0xc3a9('0x7'))(_0xc3a9('0x8'));var config=require(_0xc3a9('0x9'));var jayson=require(_0xc3a9('0xa'));var client=jayson['client'][_0xc3a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x597b86,_0x33a190,_0x569168){return new BPromise(function(_0x490117,_0x153ab3){return client[_0xc3a9('0xc')](_0x597b86,_0x569168)['then'](function(_0x5b76b2){logger[_0xc3a9('0xd')]('Setting,\x20%s,\x20%s',_0x33a190,_0xc3a9('0xe'));logger[_0xc3a9('0xf')](_0xc3a9('0x10'),_0x33a190,'request\x20sent',JSON[_0xc3a9('0x11')](_0x5b76b2));if(_0x5b76b2['error']){if(_0x5b76b2[_0xc3a9('0x12')][_0xc3a9('0x13')]===0x1f4){logger[_0xc3a9('0x12')](_0xc3a9('0x14'),_0x33a190,_0x5b76b2['error']['message']);return _0x153ab3(_0x5b76b2[_0xc3a9('0x12')][_0xc3a9('0x15')]);}logger[_0xc3a9('0x12')](_0xc3a9('0x14'),_0x33a190,_0x5b76b2[_0xc3a9('0x12')][_0xc3a9('0x15')]);return _0x490117(_0x5b76b2[_0xc3a9('0x12')]['message']);}else{logger[_0xc3a9('0xd')]('Setting,\x20%s,\x20%s',_0x33a190,'request\x20sent');_0x490117(_0x5b76b2[_0xc3a9('0x16')][_0xc3a9('0x15')]);}})[_0xc3a9('0x17')](function(_0x3c91ed){logger[_0xc3a9('0x12')](_0xc3a9('0x14'),_0x33a190,_0x3c91ed);_0x153ab3(_0x3c91ed);});});}exports['ShowSetting']=function(_0xb1ad88){var _0x24091a=this;return new Promise(function(_0x2cf087,_0x587546){return db[_0xc3a9('0x18')][_0xc3a9('0x19')]({'raw':_0xb1ad88[_0xc3a9('0x1a')]?_0xb1ad88[_0xc3a9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xb1ad88[_0xc3a9('0x1a')]?_0xb1ad88['options'][_0xc3a9('0x1b')]||null:null,'attributes':_0xb1ad88[_0xc3a9('0x1a')]?_0xb1ad88[_0xc3a9('0x1a')][_0xc3a9('0x1c')]||null:null,'include':_0xb1ad88['options']?_0xb1ad88[_0xc3a9('0x1a')]['include']?_['map'](_0xb1ad88[_0xc3a9('0x1a')]['include'],function(_0x29a7d2){return{'model':db[_0x29a7d2[_0xc3a9('0x1d')]],'as':_0x29a7d2['as'],'attributes':_0x29a7d2[_0xc3a9('0x1c')],'include':_0x29a7d2[_0xc3a9('0x1e')]?_[_0xc3a9('0x1f')](_0x29a7d2['include'],function(_0x2ff6f0){return{'model':db[_0x2ff6f0[_0xc3a9('0x1d')]],'as':_0x2ff6f0['as'],'attributes':_0x2ff6f0['attributes'],'include':_0x2ff6f0[_0xc3a9('0x1e')]?_[_0xc3a9('0x1f')](_0x2ff6f0[_0xc3a9('0x1e')],function(_0x553a83){return{'model':db[_0x553a83[_0xc3a9('0x1d')]],'as':_0x553a83['as'],'attributes':_0x553a83[_0xc3a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc3a9('0x20')](function(_0x35ae0b){logger[_0xc3a9('0xd')](_0xc3a9('0x21'),_0xb1ad88);logger[_0xc3a9('0xf')](_0xc3a9('0x21'),_0xb1ad88,JSON[_0xc3a9('0x11')](_0x35ae0b));_0x2cf087(_0x35ae0b);})['catch'](function(_0x226e08){logger[_0xc3a9('0x12')](_0xc3a9('0x21'),_0x226e08[_0xc3a9('0x15')],_0xb1ad88);_0x587546(_0x24091a[_0xc3a9('0x12')](0x1f4,_0x226e08[_0xc3a9('0x15')]));});});}; \ No newline at end of file +var _0x3fe5=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3fe5,0x193));var _0x53fe=function(_0x44f2b6,_0x55ae93){_0x44f2b6=_0x44f2b6-0x0;var _0x436887=_0x3fe5[_0x44f2b6];return _0x436887;};'use strict';var _=require('lodash');var util=require(_0x53fe('0x0'));var moment=require(_0x53fe('0x1'));var BPromise=require(_0x53fe('0x2'));var rs=require(_0x53fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x53fe('0x5'));var config=require(_0x53fe('0x6'));var jayson=require(_0x53fe('0x7'));var client=jayson[_0x53fe('0x8')][_0x53fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30dd77,_0x2bb423,_0x2a112f){return new BPromise(function(_0x1391c1,_0x4d6e2c){return client['request'](_0x30dd77,_0x2a112f)['then'](function(_0x44ff56){logger[_0x53fe('0xa')](_0x53fe('0xb'),_0x2bb423,_0x53fe('0xc'));logger[_0x53fe('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x2bb423,'request\x20sent',JSON[_0x53fe('0xe')](_0x44ff56));if(_0x44ff56[_0x53fe('0xf')]){if(_0x44ff56[_0x53fe('0xf')][_0x53fe('0x10')]===0x1f4){logger['error'](_0x53fe('0xb'),_0x2bb423,_0x44ff56[_0x53fe('0xf')][_0x53fe('0x11')]);return _0x4d6e2c(_0x44ff56['error'][_0x53fe('0x11')]);}logger['error']('Setting,\x20%s,\x20%s',_0x2bb423,_0x44ff56[_0x53fe('0xf')][_0x53fe('0x11')]);return _0x1391c1(_0x44ff56[_0x53fe('0xf')]['message']);}else{logger['info'](_0x53fe('0xb'),_0x2bb423,_0x53fe('0xc'));_0x1391c1(_0x44ff56[_0x53fe('0x12')][_0x53fe('0x11')]);}})[_0x53fe('0x13')](function(_0x5010f0){logger[_0x53fe('0xf')](_0x53fe('0xb'),_0x2bb423,_0x5010f0);_0x4d6e2c(_0x5010f0);});});}exports[_0x53fe('0x14')]=function(_0xa96622){var _0x47008e=this;return new Promise(function(_0x5cf3eb,_0x1e4641){return db[_0x53fe('0x15')][_0x53fe('0x16')]({'raw':_0xa96622[_0x53fe('0x17')]?_0xa96622[_0x53fe('0x17')][_0x53fe('0x18')]===undefined?!![]:![]:!![],'where':_0xa96622[_0x53fe('0x17')]?_0xa96622[_0x53fe('0x17')][_0x53fe('0x19')]||null:null,'attributes':_0xa96622['options']?_0xa96622[_0x53fe('0x17')][_0x53fe('0x1a')]||null:null,'include':_0xa96622['options']?_0xa96622[_0x53fe('0x17')][_0x53fe('0x1b')]?_[_0x53fe('0x1c')](_0xa96622[_0x53fe('0x17')][_0x53fe('0x1b')],function(_0x164e85){return{'model':db[_0x164e85[_0x53fe('0x1d')]],'as':_0x164e85['as'],'attributes':_0x164e85[_0x53fe('0x1a')],'include':_0x164e85['include']?_[_0x53fe('0x1c')](_0x164e85[_0x53fe('0x1b')],function(_0xa3a045){return{'model':db[_0xa3a045[_0x53fe('0x1d')]],'as':_0xa3a045['as'],'attributes':_0xa3a045[_0x53fe('0x1a')],'include':_0xa3a045[_0x53fe('0x1b')]?_[_0x53fe('0x1c')](_0xa3a045[_0x53fe('0x1b')],function(_0x37363b){return{'model':db[_0x37363b[_0x53fe('0x1d')]],'as':_0x37363b['as'],'attributes':_0x37363b[_0x53fe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x53fe('0x1e')](function(_0x51fc99){logger[_0x53fe('0xa')](_0x53fe('0x14'),_0xa96622);logger[_0x53fe('0xd')](_0x53fe('0x14'),_0xa96622,JSON[_0x53fe('0xe')](_0x51fc99));_0x5cf3eb(_0x51fc99);})['catch'](function(_0x2375bb){logger[_0x53fe('0xf')](_0x53fe('0x14'),_0x2375bb[_0x53fe('0x11')],_0xa96622);_0x1e4641(_0x47008e[_0x53fe('0xf')](0x1f4,_0x2375bb[_0x53fe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 56c5013..2b3c93d 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x12fca0,_0x194bed){var _0x29f501=function(_0x11f1fe){while(--_0x11f1fe){_0x12fca0['push'](_0x12fca0['shift']());}};_0x29f501(++_0x194bed);}(_0x6aa7,0x178));var _0x76aa=function(_0x1874e6,_0x1e4629){_0x1874e6=_0x1874e6-0x0;var _0x29e990=_0x6aa7[_0x1874e6];return _0x29e990;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x2db59f,_0x236c36){var _0x8e74b8=function(_0x230da4){while(--_0x230da4){_0x2db59f['push'](_0x2db59f['shift']());}};_0x8e74b8(++_0x236c36);}(_0x326f,0xd1));var _0xf326=function(_0x340adf,_0x1f7497){_0x340adf=_0x340adf-0x0;var _0x1246da=_0x326f[_0x340adf];return _0x1246da;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('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 7cd2523..cfca43d 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 _0x6228=['ENUM','twilio','skebby','connectel','clicksend','clickatell','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0xbf993a,_0x3f08b4){var _0xc473f6=function(_0x1d7dc3){while(--_0x1d7dc3){_0xbf993a['push'](_0xbf993a['shift']());}};_0xc473f6(++_0x3f08b4);}(_0x6228,0x13c));var _0x8622=function(_0x1e06c4,_0x38a792){_0x1e06c4=_0x1e06c4-0x0;var _0x529a41=_0x6228[_0x1e06c4];return _0x529a41;};'use strict';var Sequelize=require(_0x8622('0x0'));var rs=require(_0x8622('0x1'));module[_0x8622('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x8622('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8622('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x8622('0x4')],'defaultValue':function(){return rs[_0x8622('0x5')]();}},'phone':{'type':Sequelize[_0x8622('0x4')]},'type':{'type':Sequelize[_0x8622('0x6')](_0x8622('0x7'),_0x8622('0x8'),_0x8622('0x9'),_0x8622('0xa'),'plivo',_0x8622('0xb'),'bandwidth',_0x8622('0xc'),_0x8622('0xd'),_0x8622('0xe'))},'accountSid':{'type':Sequelize[_0x8622('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x8622('0x4')]},'smsMethod':{'type':Sequelize[_0x8622('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x8622('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x8622('0x4')]},'applicationId':{'type':Sequelize[_0x8622('0x4')]},'accountId':{'type':Sequelize[_0x8622('0x4')]},'senderString':{'type':Sequelize[_0x8622('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8622('0x4')]},'notificationTemplate':{'type':Sequelize[_0x8622('0xf')],'defaultValue':function(){return _0x8622('0x10');}},'notificationSound':{'type':Sequelize[_0x8622('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8622('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8622('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8622('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8622('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8622('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8622('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8622('0x12')],'comment':_0x8622('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x8622('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xecf4cc){if(!_0xecf4cc)this[_0x8622('0x14')](_0x8622('0x15'),null);this[_0x8622('0x14')](_0x8622('0x16'),_0xecf4cc);}}}; \ No newline at end of file +var _0xb62e=['TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN'];(function(_0x21b1fa,_0x501f8c){var _0x536899=function(_0x24b7b0){while(--_0x24b7b0){_0x21b1fa['push'](_0x21b1fa['shift']());}};_0x536899(++_0x501f8c);}(_0xb62e,0x12d));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xeb62('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xeb62('0x1')],'unique':_0xeb62('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xeb62('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeb62('0x3')]();}},'phone':{'type':Sequelize[_0xeb62('0x1')]},'type':{'type':Sequelize[_0xeb62('0x4')](_0xeb62('0x5'),'skebby',_0xeb62('0x6'),_0xeb62('0x7'),_0xeb62('0x8'),_0xeb62('0x9'),_0xeb62('0xa'),_0xeb62('0xb'),_0xeb62('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xeb62('0x1')]},'authId':{'type':Sequelize[_0xeb62('0x1')]},'authToken':{'type':Sequelize[_0xeb62('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xeb62('0x1')]},'password':{'type':Sequelize[_0xeb62('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xeb62('0x1')]},'accountId':{'type':Sequelize[_0xeb62('0x1')]},'senderString':{'type':Sequelize[_0xeb62('0x1')]},'deliveryReport':{'type':Sequelize[_0xeb62('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xeb62('0x1')]},'notificationTemplate':{'type':Sequelize[_0xeb62('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xeb62('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeb62('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeb62('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeb62('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeb62('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xeb62('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xeb62('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xeb62('0xd')],'defaultValue':![],'comment':_0xeb62('0x11'),'set':function(_0x5db247){if(!_0x5db247)this['setDataValue'](_0xeb62('0x12'),null);this[_0xeb62('0x13')](_0xeb62('0x14'),_0x5db247);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 98d8c3c..a382278 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 _0x97b0=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','SmsAccount','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','SmsAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','includeAll','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','createdAt','difference','updatedAt','ListId','mobile','twilio','From','MessageSid','skebby','from','sender','text','connectel','clicksend','messageId','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','omit','Contacts','contact','spread','interaction','created','autoclose','applications','push','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','color','tag','SmsInteraction','List','defaults','user','out','Messages','SmsMessage','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','message_id','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','get','SmsAccounts','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x97b0,0x179));var _0x097b=function(_0x4da653,_0x490bc8){_0x4da653=_0x4da653-0x0;var _0xcdd373=_0x97b0[_0x4da653];return _0xcdd373;};'use strict';var emlformat=require(_0x097b('0x0'));var rimraf=require(_0x097b('0x1'));var zipdir=require(_0x097b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x097b('0x3'));var moment=require(_0x097b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x097b('0x5'));var util=require(_0x097b('0x6'));var path=require('path');var sox=require(_0x097b('0x7'));var csv=require('to-csv');var ejs=require(_0x097b('0x8'));var fs=require('fs');var fs_extra=require(_0x097b('0x9'));var _=require('lodash');var squel=require(_0x097b('0xa'));var crypto=require(_0x097b('0xb'));var jsforce=require(_0x097b('0xc'));var deskjs=require(_0x097b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x097b('0xe'));var Papa=require(_0x097b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x097b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x097b('0x11'))(_0x097b('0x12'));var utils=require(_0x097b('0x13'));var config=require(_0x097b('0x14'));var licenseUtil=require(_0x097b('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x097b('0x16')],{'host':_0x097b('0x17'),'port':0x18eb});var socket=require(_0x097b('0x18'))(new Redis(config['redis']));require(_0x097b('0x19'))['register'](socket);var jayson=require(_0x097b('0x1a'));var client=jayson['client'][_0x097b('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x49e17f,_0x3abbee,_0x294976,_0x4731e4){return new BPromise(function(_0x183e2a,_0x1e3e14){var _0x33cb9a=_0x4731e4||client;return _0x33cb9a[_0x097b('0x1c')](_0x49e17f,_0x294976)['then'](function(_0x15f777){logger[_0x097b('0x1d')](_0x097b('0x1e'),_0x3abbee,_0x097b('0x1f'));logger[_0x097b('0x20')](_0x097b('0x21'),_0x3abbee,_0x097b('0x1f'),JSON[_0x097b('0x22')](_0x15f777));if(_0x15f777[_0x097b('0x23')]){if(_0x15f777['error']['code']===0x1f4){logger['error'](_0x097b('0x1e'),_0x3abbee,_0x15f777[_0x097b('0x23')][_0x097b('0x24')]);return _0x1e3e14(_0x15f777[_0x097b('0x23')][_0x097b('0x24')]);}logger[_0x097b('0x23')](_0x097b('0x1e'),_0x3abbee,_0x15f777[_0x097b('0x23')]['message']);return _0x183e2a(_0x15f777['error'][_0x097b('0x24')]);}else{logger[_0x097b('0x1d')](_0x097b('0x1e'),_0x3abbee,'request\x20sent');_0x183e2a(_0x15f777['result'][_0x097b('0x24')]);}})[_0x097b('0x25')](function(_0x1f2333){logger['error'](_0x097b('0x1e'),_0x3abbee,_0x1f2333);_0x1e3e14(_0x1f2333);});});}function respondWithStatusCode(_0x114792,_0x49f43e){_0x49f43e=_0x49f43e||0xcc;return function(_0x2c8d89){if(_0x2c8d89){return _0x114792[_0x097b('0x26')](_0x49f43e);}return _0x114792['status'](_0x49f43e)[_0x097b('0x27')]();};}function respondWithResult(_0x3e03db,_0xaee3d8){_0xaee3d8=_0xaee3d8||0xc8;return function(_0x15a529){if(_0x15a529){return _0x3e03db[_0x097b('0x28')](_0xaee3d8)[_0x097b('0x29')](_0x15a529);}};}function respondWithFilteredResult(_0x3cf8f4,_0x226b03){return function(_0x266a1a){if(_0x266a1a){var _0x5aba6b=typeof _0x226b03[_0x097b('0x2a')]===_0x097b('0x2b')&&typeof _0x226b03[_0x097b('0x2c')]===_0x097b('0x2b');var _0x357def=_0x266a1a['count'];var _0x3c737b=_0x5aba6b?0x0:_0x226b03[_0x097b('0x2a')];var _0x48cb00=_0x5aba6b?_0x266a1a[_0x097b('0x2d')]:_0x226b03['offset']+_0x226b03['limit'];var _0x181fe0;if(_0x48cb00>=_0x357def){_0x48cb00=_0x357def;_0x181fe0=0xc8;}else{_0x181fe0=0xce;}_0x3cf8f4['status'](_0x181fe0);return _0x3cf8f4['set'](_0x097b('0x2e'),_0x3c737b+'-'+_0x48cb00+'/'+_0x357def)[_0x097b('0x29')](_0x266a1a);}return null;};}function patchUpdates(_0x2976f6){return function(_0x2717c4){try{jsonpatch['apply'](_0x2717c4,_0x2976f6,!![]);}catch(_0x8cc23b){return BPromise[_0x097b('0x2f')](_0x8cc23b);}return _0x2717c4[_0x097b('0x30')]();};}function saveUpdates(_0xb824af,_0x4787b7){return function(_0x428389){if(_0x428389){return _0x428389['update'](_0xb824af)[_0x097b('0x31')](function(_0x4f2611){return _0x4f2611;});}return null;};}function removeEntity(_0x124a06,_0x1b6b48){return function(_0x23653d){if(_0x23653d){return _0x23653d[_0x097b('0x32')]()['then'](function(){var _0x159e49=_0x23653d[_0x097b('0x33')]({'plain':!![]});var _0x5ac67e=_0x097b('0x34');return db['UserProfileResource'][_0x097b('0x32')]({'where':{'type':_0x5ac67e,'resourceId':_0x159e49['id']}})[_0x097b('0x31')](function(){return _0x23653d;});})[_0x097b('0x31')](function(){_0x124a06[_0x097b('0x28')](0xcc)[_0x097b('0x27')]();});}};}function handleEntityNotFound(_0x12e6c0,_0x154cb4){return function(_0x1e6c42){if(!_0x1e6c42){_0x12e6c0[_0x097b('0x26')](0x194);}return _0x1e6c42;};}function handleError(_0xb733b9,_0x2f824b){_0x2f824b=_0x2f824b||0x1f4;return function(_0x22a20f){logger[_0x097b('0x23')](_0x22a20f['stack']);if(_0x22a20f[_0x097b('0x35')]){delete _0x22a20f[_0x097b('0x35')];}_0xb733b9[_0x097b('0x28')](_0x2f824b)[_0x097b('0x36')](_0x22a20f);};}exports[_0x097b('0x37')]=function(_0xdf9752,_0x19f1c9){var _0x5e210f={'include':[{'model':db[_0x097b('0x38')],'as':_0x097b('0x39')}]},_0x56bf63={},_0x3e2bd6={'count':0x0,'rows':[]};var _0x4b7cfe=_[_0x097b('0x3a')](db['SmsAccount'][_0x097b('0x3b')],function(_0x5f02f3){return{'name':_0x5f02f3[_0x097b('0x3c')],'type':_0x5f02f3[_0x097b('0x3d')][_0x097b('0x3e')]};});_0x56bf63[_0x097b('0x3f')]=_[_0x097b('0x3a')](_0x4b7cfe,'name');_0x56bf63['query']=_[_0x097b('0x40')](_0xdf9752[_0x097b('0x41')]);_0x56bf63[_0x097b('0x42')]=_[_0x097b('0x43')](_0x56bf63[_0x097b('0x3f')],_0x56bf63[_0x097b('0x41')]);_0x5e210f[_0x097b('0x44')]=_['intersection'](_0x56bf63[_0x097b('0x3f')],qs[_0x097b('0x45')](_0xdf9752[_0x097b('0x41')]['fields']));_0x5e210f['attributes']=_0x5e210f[_0x097b('0x44')][_0x097b('0x46')]?_0x5e210f[_0x097b('0x44')]:_0x56bf63[_0x097b('0x3f')];if(!_0xdf9752[_0x097b('0x41')][_0x097b('0x47')](_0x097b('0x48'))){_0x5e210f[_0x097b('0x2c')]=qs[_0x097b('0x2c')](_0xdf9752[_0x097b('0x41')][_0x097b('0x2c')]);_0x5e210f['offset']=qs[_0x097b('0x2a')](_0xdf9752[_0x097b('0x41')]['offset']);}_0x5e210f[_0x097b('0x49')]=qs[_0x097b('0x4a')](_0xdf9752[_0x097b('0x41')]['sort']);_0x5e210f['where']=qs[_0x097b('0x42')](_[_0x097b('0x4b')](_0xdf9752[_0x097b('0x41')],_0x56bf63[_0x097b('0x42')]),_0x4b7cfe);if(_0xdf9752['query'][_0x097b('0x4c')]){_0x5e210f[_0x097b('0x4d')]=_[_0x097b('0x4e')](_0x5e210f['where'],{'$or':_[_0x097b('0x3a')](_0x4b7cfe,function(_0x34463d){if(_0x34463d['type']!=='VIRTUAL'){var _0x59ec82={};_0x59ec82[_0x34463d[_0x097b('0x35')]]={'$like':'%'+_0xdf9752[_0x097b('0x41')][_0x097b('0x4c')]+'%'};return _0x59ec82;}})});}_0x5e210f=_[_0x097b('0x4e')]({},_0x5e210f,_0xdf9752[_0x097b('0x4f')]);var _0x22dd83={'where':_0x5e210f[_0x097b('0x4d')]};return db['SmsAccount']['count'](_0x22dd83)[_0x097b('0x31')](function(_0x23a223){_0x3e2bd6[_0x097b('0x2d')]=_0x23a223;if(_0xdf9752[_0x097b('0x41')]['includeAll']){_0x5e210f[_0x097b('0x50')]=[{'all':!![]}];}return db[_0x097b('0x51')]['findAll'](_0x5e210f);})[_0x097b('0x31')](function(_0x30c15a){_0x3e2bd6[_0x097b('0x52')]=_0x30c15a;return _0x3e2bd6;})[_0x097b('0x31')](respondWithFilteredResult(_0x19f1c9,_0x5e210f))[_0x097b('0x25')](handleError(_0x19f1c9,null));};exports[_0x097b('0x53')]=function(_0x4c5b4a,_0x222eee){var _0x22b4e0={'raw':![],'where':{'id':_0x4c5b4a[_0x097b('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x39e4b7={};_0x39e4b7[_0x097b('0x3f')]=_['keys'](db[_0x097b('0x51')]['rawAttributes']);_0x39e4b7[_0x097b('0x41')]=_[_0x097b('0x40')](_0x4c5b4a[_0x097b('0x41')]);_0x39e4b7['filters']=_['intersection'](_0x39e4b7['model'],_0x39e4b7['query']);_0x22b4e0['attributes']=_[_0x097b('0x43')](_0x39e4b7[_0x097b('0x3f')],qs[_0x097b('0x45')](_0x4c5b4a[_0x097b('0x41')][_0x097b('0x45')]));_0x22b4e0[_0x097b('0x44')]=_0x22b4e0['attributes'][_0x097b('0x46')]?_0x22b4e0[_0x097b('0x44')]:_0x39e4b7['model'];if(_0x4c5b4a['query']['includeAll']){_0x22b4e0[_0x097b('0x50')]=[{'all':!![]}];}_0x22b4e0=_[_0x097b('0x4e')]({},_0x22b4e0,_0x4c5b4a[_0x097b('0x4f')]);return db[_0x097b('0x51')][_0x097b('0x55')](_0x22b4e0)['then'](handleEntityNotFound(_0x222eee,null))['then'](respondWithResult(_0x222eee,null))[_0x097b('0x25')](handleError(_0x222eee,null));};exports[_0x097b('0x56')]=function(_0x381007,_0xef6f86){return db['SmsAccount'][_0x097b('0x56')](_0x381007[_0x097b('0x57')],{})[_0x097b('0x31')](function(_0x13f4dd){var _0x30c985=_0x381007['user'][_0x097b('0x33')]({'plain':!![]});if(!_0x30c985)throw new Error(_0x097b('0x58'));if(_0x30c985[_0x097b('0x59')]==='user'){var _0x147ebc=_0x13f4dd['get']({'plain':!![]});var _0x400465=_0x097b('0x34');return db['UserProfileSection'][_0x097b('0x55')]({'where':{'name':_0x400465,'userProfileId':_0x30c985[_0x097b('0x5a')]},'raw':!![]})[_0x097b('0x31')](function(_0x641e03){if(_0x641e03&&_0x641e03[_0x097b('0x5b')]===0x0){return db['UserProfileResource'][_0x097b('0x56')]({'name':_0x147ebc[_0x097b('0x35')],'resourceId':_0x147ebc['id'],'type':_0x641e03[_0x097b('0x35')],'sectionId':_0x641e03['id']},{})[_0x097b('0x31')](function(){return _0x13f4dd;});}else{return _0x13f4dd;}})[_0x097b('0x25')](function(_0x22bcd9){logger['error'](_0x097b('0x5c'),_0x22bcd9);throw _0x22bcd9;});}return _0x13f4dd;})[_0x097b('0x31')](respondWithResult(_0xef6f86,0xc9))['catch'](handleError(_0xef6f86,null));};exports[_0x097b('0x5d')]=function(_0x4100f1,_0xd35552){if(_0x4100f1['body']['id']){delete _0x4100f1[_0x097b('0x57')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4100f1[_0x097b('0x54')]['id']},'include':[{'model':db[_0x097b('0x38')],'as':_0x097b('0x39')}]})[_0x097b('0x31')](handleEntityNotFound(_0xd35552,null))[_0x097b('0x31')](saveUpdates(_0x4100f1[_0x097b('0x57')],null))['then'](respondWithResult(_0xd35552,null))['catch'](handleError(_0xd35552,null));};exports['destroy']=function(_0xf7c868,_0x14517c){return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0xf7c868['params']['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x14517c,null))[_0x097b('0x31')](removeEntity(_0x14517c,null))['catch'](handleError(_0x14517c,null));};exports[_0x097b('0x5e')]=function(_0xd0faff,_0x12f621){return db[_0x097b('0x51')][_0x097b('0x5e')]()[_0x097b('0x31')](respondWithResult(_0x12f621,null))[_0x097b('0x25')](handleError(_0x12f621,null));};exports['addDisposition']=function(_0x318598,_0x44cc34,_0x5e72cc){if(_0x318598[_0x097b('0x57')]['id']){delete _0x318598[_0x097b('0x57')]['id'];}return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0x318598['params']['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x44cc34,null))[_0x097b('0x31')](function(_0x4abd6b){if(_0x4abd6b){_0x318598[_0x097b('0x57')]['SmsAccountId']=_0x4abd6b['id'];return db[_0x097b('0x5f')]['create'](_0x318598[_0x097b('0x57')]);}})[_0x097b('0x31')](respondWithResult(_0x44cc34,null))[_0x097b('0x25')](handleError(_0x44cc34,null));};exports[_0x097b('0x60')]=function(_0x1ade13,_0xc8ea90,_0x537fac){var _0x1d1ae0={'raw':![],'where':{}};var _0x1bf22b={};var _0x226a6a={'count':0x0,'rows':[]};return db[_0x097b('0x51')][_0x097b('0x61')]({'where':{'id':_0x1ade13[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0xc8ea90,null))[_0x097b('0x31')](function(_0x360af8){if(_0x360af8){_0x1bf22b[_0x097b('0x3f')]=_['keys'](db[_0x097b('0x5f')]['rawAttributes']);_0x1bf22b[_0x097b('0x41')]=_[_0x097b('0x40')](_0x1ade13['query']);_0x1bf22b[_0x097b('0x42')]=_[_0x097b('0x43')](_0x1bf22b['model'],_0x1bf22b['query']);_0x1d1ae0['attributes']=_[_0x097b('0x43')](_0x1bf22b['model'],qs['fields'](_0x1ade13[_0x097b('0x41')]['fields']));_0x1d1ae0[_0x097b('0x44')]=_0x1d1ae0['attributes'][_0x097b('0x46')]?_0x1d1ae0[_0x097b('0x44')]:_0x1bf22b[_0x097b('0x3f')];if(!_0x1ade13[_0x097b('0x41')][_0x097b('0x47')](_0x097b('0x48'))){_0x1d1ae0[_0x097b('0x2c')]=qs['limit'](_0x1ade13['query'][_0x097b('0x2c')]);_0x1d1ae0[_0x097b('0x2a')]=qs['offset'](_0x1ade13[_0x097b('0x41')][_0x097b('0x2a')]);}_0x1d1ae0['order']=qs['sort'](_0x1ade13[_0x097b('0x41')][_0x097b('0x4a')]);_0x1d1ae0['where']=qs[_0x097b('0x42')](_[_0x097b('0x4b')](_0x1ade13[_0x097b('0x41')],_0x1bf22b[_0x097b('0x42')]));_0x1d1ae0[_0x097b('0x4d')][_0x097b('0x62')]=_0x360af8['id'];if(_0x1ade13[_0x097b('0x41')]['filter']){_0x1d1ae0[_0x097b('0x4d')]=_['merge'](_0x1d1ae0[_0x097b('0x4d')],{'$or':_['map'](_0x1d1ae0[_0x097b('0x44')],function(_0xfaaca5){var _0x52167d={};_0x52167d[_0xfaaca5]={'$like':'%'+_0x1ade13[_0x097b('0x41')][_0x097b('0x4c')]+'%'};return _0x52167d;})});}_0x1d1ae0=_[_0x097b('0x4e')]({},_0x1d1ae0,_0x1ade13[_0x097b('0x4f')]);return db[_0x097b('0x5f')]['count']({'where':_0x1d1ae0[_0x097b('0x4d')]})[_0x097b('0x31')](function(_0x4158b8){_0x226a6a['count']=_0x4158b8;if(_0x1ade13[_0x097b('0x41')]['includeAll']){_0x1d1ae0[_0x097b('0x50')]=[{'all':!![]}];}return db[_0x097b('0x5f')][_0x097b('0x63')](_0x1d1ae0);})[_0x097b('0x31')](function(_0x154a13){_0x226a6a[_0x097b('0x52')]=_0x154a13;return _0x226a6a;});}})[_0x097b('0x31')](respondWithFilteredResult(_0xc8ea90,_0x1d1ae0))[_0x097b('0x25')](handleError(_0xc8ea90,null));};exports[_0x097b('0x64')]=function(_0x1fe3d1,_0xb28925,_0x5b4cf0){return db[_0x097b('0x51')]['find']({'where':{'id':_0x1fe3d1[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0xb28925,null))[_0x097b('0x31')](function(_0x3640d2){if(_0x3640d2){return _0x3640d2[_0x097b('0x64')](_0x1fe3d1[_0x097b('0x41')]['ids']);}})[_0x097b('0x31')](respondWithStatusCode(_0xb28925,null))[_0x097b('0x25')](handleError(_0xb28925,null));};exports[_0x097b('0x65')]=function(_0x3e8909,_0x4de562,_0x5ae270){if(_0x3e8909[_0x097b('0x57')]['id']){delete _0x3e8909[_0x097b('0x57')]['id'];}return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0x3e8909['params']['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x4de562,null))[_0x097b('0x31')](function(_0x40123b){if(_0x40123b){_0x3e8909['body'][_0x097b('0x62')]=_0x40123b['id'];return db[_0x097b('0x66')][_0x097b('0x56')](_0x3e8909[_0x097b('0x57')]);}})['then'](respondWithResult(_0x4de562,null))['catch'](handleError(_0x4de562,null));};exports[_0x097b('0x67')]=function(_0x1f9a87,_0x50ce1a,_0xe8196e){var _0x3171a5={'raw':![],'where':{}};var _0x428e69={};var _0x16ade1={'count':0x0,'rows':[]};return db[_0x097b('0x51')][_0x097b('0x61')]({'where':{'id':_0x1f9a87[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x50ce1a,null))['then'](function(_0x4d75bc){if(_0x4d75bc){_0x428e69[_0x097b('0x3f')]=_['keys'](db[_0x097b('0x66')][_0x097b('0x3b')]);_0x428e69[_0x097b('0x41')]=_[_0x097b('0x40')](_0x1f9a87[_0x097b('0x41')]);_0x428e69[_0x097b('0x42')]=_[_0x097b('0x43')](_0x428e69[_0x097b('0x3f')],_0x428e69[_0x097b('0x41')]);_0x3171a5[_0x097b('0x44')]=_['intersection'](_0x428e69[_0x097b('0x3f')],qs['fields'](_0x1f9a87[_0x097b('0x41')][_0x097b('0x45')]));_0x3171a5[_0x097b('0x44')]=_0x3171a5['attributes'][_0x097b('0x46')]?_0x3171a5[_0x097b('0x44')]:_0x428e69[_0x097b('0x3f')];if(!_0x1f9a87[_0x097b('0x41')][_0x097b('0x47')](_0x097b('0x48'))){_0x3171a5[_0x097b('0x2c')]=qs['limit'](_0x1f9a87[_0x097b('0x41')][_0x097b('0x2c')]);_0x3171a5[_0x097b('0x2a')]=qs[_0x097b('0x2a')](_0x1f9a87[_0x097b('0x41')][_0x097b('0x2a')]);}_0x3171a5[_0x097b('0x49')]=qs['sort'](_0x1f9a87[_0x097b('0x41')][_0x097b('0x4a')]);_0x3171a5[_0x097b('0x4d')]=qs['filters'](_['pick'](_0x1f9a87['query'],_0x428e69[_0x097b('0x42')]));_0x3171a5[_0x097b('0x4d')][_0x097b('0x62')]=_0x4d75bc['id'];if(_0x1f9a87[_0x097b('0x41')][_0x097b('0x4c')]){_0x3171a5[_0x097b('0x4d')]=_[_0x097b('0x4e')](_0x3171a5['where'],{'$or':_[_0x097b('0x3a')](_0x3171a5['attributes'],function(_0x151513){var _0x749849={};_0x749849[_0x151513]={'$like':'%'+_0x1f9a87['query']['filter']+'%'};return _0x749849;})});}_0x3171a5=_[_0x097b('0x4e')]({},_0x3171a5,_0x1f9a87['options']);return db[_0x097b('0x66')][_0x097b('0x2d')]({'where':_0x3171a5[_0x097b('0x4d')]})[_0x097b('0x31')](function(_0x563111){_0x16ade1[_0x097b('0x2d')]=_0x563111;if(_0x1f9a87[_0x097b('0x41')][_0x097b('0x68')]){_0x3171a5['include']=[{'all':!![]}];}return db[_0x097b('0x66')][_0x097b('0x63')](_0x3171a5);})[_0x097b('0x31')](function(_0x162c71){_0x16ade1[_0x097b('0x52')]=_0x162c71;return _0x16ade1;});}})[_0x097b('0x31')](respondWithFilteredResult(_0x50ce1a,_0x3171a5))[_0x097b('0x25')](handleError(_0x50ce1a,null));};exports[_0x097b('0x69')]=function(_0x1f8107,_0x463b21,_0x48aa1b){return db[_0x097b('0x51')]['find']({'where':{'id':_0x1f8107['params']['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x463b21,null))[_0x097b('0x31')](function(_0x28b780){if(_0x28b780){return _0x28b780[_0x097b('0x69')](_0x1f8107[_0x097b('0x41')][_0x097b('0x6a')]);}})[_0x097b('0x31')](respondWithStatusCode(_0x463b21,null))['catch'](handleError(_0x463b21,null));};exports[_0x097b('0x6b')]=function(_0xd335a4,_0xd722ff,_0x3670ba){var _0x5693a8={'channel':_0x097b('0x6c')};var _0x1dd4ae=[];var _0x198cd7=[];var _0x12218b={};return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0xd335a4[_0x097b('0x54')]['id']},'include':[{'model':db[_0x097b('0x6d')],'as':_0x097b('0x6e')}]})[_0x097b('0x31')](handleEntityNotFound(_0xd722ff,null))[_0x097b('0x31')](function(_0x9d0b14){_0x5693a8[_0x097b('0x6f')]=_0x9d0b14;_0x5693a8['applications']=_[_0x097b('0x70')](_0x9d0b14[_0x097b('0x6e')],[_0x097b('0x71')],[_0x097b('0x72')]);if(_0x5693a8[_0x097b('0x6f')][_0x097b('0x6e')]){delete _0x5693a8[_0x097b('0x6f')][_0x097b('0x6e')];}return db[_0x097b('0x73')][_0x097b('0x5e')]();})[_0x097b('0x31')](function(_0x27a6b0){if(!_0x27a6b0){throw new db[(_0x097b('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x1dd4ae=_['difference'](_['keys'](_0x27a6b0),[_0x097b('0x75'),'updatedAt']);_0x198cd7=_[_0x097b('0x76')](_[_0x097b('0x40')](_0x27a6b0),[_0x097b('0x75'),_0x097b('0x77'),'CompanyId',_0x097b('0x78')]);_0x5693a8[_0x097b('0x57')]={'mapKey':_0x097b('0x79')};if(_0x5693a8[_0x097b('0x6f')]['type']){switch(_0x5693a8[_0x097b('0x6f')]['type']){case _0x097b('0x7a'):_0x5693a8['body']['from']=_0xd335a4[_0x097b('0x57')][_0x097b('0x7b')];_0x5693a8['body'][_0x097b('0x57')]=_0xd335a4[_0x097b('0x57')]['Body'];_0x5693a8['body']['messageId']=_0xd335a4[_0x097b('0x57')][_0x097b('0x7c')];break;case _0x097b('0x7d'):_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')]='+'+_0xd335a4[_0x097b('0x57')][_0x097b('0x7f')];_0x5693a8[_0x097b('0x57')]['body']=_0xd335a4['body'][_0x097b('0x80')];break;case _0x097b('0x81'):_0x5693a8['body'][_0x097b('0x7e')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x7e')];_0x5693a8['body']['body']=_0xd335a4[_0x097b('0x57')]['message'];break;case _0x097b('0x82'):_0x5693a8[_0x097b('0x57')]['from']=_0xd335a4[_0x097b('0x57')][_0x097b('0x7e')];_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x57')];_0x5693a8[_0x097b('0x57')][_0x097b('0x83')]=_0xd335a4[_0x097b('0x57')]['message_id'];break;case'plivo':_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x7b')];_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]=_0xd335a4['body'][_0x097b('0x84')];_0x5693a8[_0x097b('0x57')][_0x097b('0x83')]=_0xd335a4[_0x097b('0x57')]['MessageUUID'];break;case _0x097b('0x85'):_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')]='+'+_0xd335a4[_0x097b('0x57')][_0x097b('0x86')][0x0][_0x097b('0x7e')];_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]=_0xd335a4['body']['results'][0x0][_0x097b('0x80')];_0x5693a8[_0x097b('0x57')][_0x097b('0x83')]=_0xd335a4[_0x097b('0x57')]['results'][0x0][_0x097b('0x83')];break;case _0x097b('0x87'):_0x5693a8['body'][_0x097b('0x7e')]=_0xd335a4['body'][_0x097b('0x88')];_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]=_0xd335a4[_0x097b('0x57')]['segmentedMessage'][_0x097b('0x24')];break;case _0x097b('0x89'):_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')]=_0xd335a4['body'][_0x097b('0x8a')];_0x5693a8['body'][_0x097b('0x57')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x80')];_0x5693a8[_0x097b('0x57')][_0x097b('0x83')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x8b')];break;case _0x097b('0x8c'):_0x5693a8[_0x097b('0x57')]['messageId']=_0xd335a4[_0x097b('0x57')][0x0][_0x097b('0x24')]['id'];_0x5693a8[_0x097b('0x57')]['from']=_0xd335a4[_0x097b('0x57')][0x0][_0x097b('0x24')][_0x097b('0x7e')];_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]=_0xd335a4[_0x097b('0x57')][0x0][_0x097b('0x24')]['text'];break;case'intelepeer':_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x7e')];_0x5693a8[_0x097b('0x57')]['body']=_0xd335a4[_0x097b('0x57')][_0x097b('0x24')];_0x5693a8['body'][_0x097b('0x83')]=_0xd335a4[_0x097b('0x57')][_0x097b('0x8d')];break;}}if(_0x5693a8[_0x097b('0x57')]['id']){delete _0x5693a8[_0x097b('0x57')]['id'];}if(_['isNil'](_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')])){throw new db[(_0x097b('0x74'))][(_0x097b('0x8e'))]('from\x20is\x20mandatory');}if(_[_0x097b('0x8f')](_0x5693a8[_0x097b('0x57')][_0x097b('0x57')])||_0x5693a8[_0x097b('0x57')][_0x097b('0x57')]===''){throw new db[(_0x097b('0x74'))][(_0x097b('0x8e'))](_0x097b('0x90'));}if(_[_0x097b('0x8f')](_0x5693a8['body'][_0x097b('0x91')])){throw new db[(_0x097b('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x198cd7);}if(!_[_0x097b('0x92')](_0x198cd7,_0x5693a8[_0x097b('0x57')][_0x097b('0x91')])){throw new db[(_0x097b('0x74'))][(_0x097b('0x8e'))](_0x097b('0x93')+_0x198cd7);}_0x12218b[_0x5693a8[_0x097b('0x57')][_0x097b('0x91')]]=_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')];return db[_0x097b('0x94')]['find']({'where':{'id':_0x5693a8[_0x097b('0x6f')][_0x097b('0x78')]},'include':[{'model':db[_0x097b('0x73')],'as':'Contacts','where':_0x12218b,'limit':0x1,'order':[[_0x097b('0x77'),_0x097b('0x95')]]}]});})[_0x097b('0x31')](handleEntityNotFound(_0xd722ff,null))['then'](function(_0xe59864){if(_0xe59864){_0x5693a8['list']=_[_0x097b('0x96')](_0xe59864,[_0x097b('0x97')]);if(_0xe59864[_0x097b('0x97')][_0x097b('0x46')]){return _0xe59864['Contacts'][0x0];}var _0x29f90e=_['defaults'](_0x5693a8[_0x097b('0x57')],{'firstName':_0x5693a8['body'][_0x097b('0x7e')],'ListId':_0xe59864['id']});_0x29f90e[_0x5693a8[_0x097b('0x57')][_0x097b('0x91')]]=_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')];return db['CmContact']['create'](_0x29f90e,{'fields':_0x1dd4ae,'raw':!![]});}})[_0x097b('0x31')](handleEntityNotFound(_0xd722ff,null))['then'](function(_0x27dea6){if(_0x27dea6){_0x5693a8[_0x097b('0x98')]=_0x27dea6;var _0x29cc29={'ContactId':_0x27dea6['id'],'phone':_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')],'SmsAccountId':_0xd335a4['params']['id']};var _0x4af43a={'ContactId':_0x27dea6['id'],'SmsAccountId':_0xd335a4['params']['id'],'closed':![]};return db['SmsInteraction'][_0x097b('0x55')]({'where':_0x4af43a})[_0x097b('0x31')](function(_0x4828ac){if(_0x4828ac){return[_0x4828ac,![]];}return db['SmsInteraction']['create'](_0x29cc29)['then'](function(_0x3606b1){return[_0x3606b1,!![]];});});}})[_0x097b('0x99')](function(_0x5df032,_0x2e3a35){_0x5693a8['interaction']=_0x5df032[_0x097b('0x33')]({'plain':!![]});_0x5693a8[_0x097b('0x9a')][_0x097b('0x9b')]=![];if(_0x2e3a35){if(_0x5693a8[_0x097b('0x6f')][_0x097b('0x9c')]){_0x5693a8[_0x097b('0x9d')][_0x097b('0x9e')]({'id':0x0,'priority':_0x5693a8[_0x097b('0x9d')][_0x097b('0x46')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x097b('0x9f')});}_0x5693a8[_0x097b('0x9a')][_0x097b('0x9b')]=!![];}return db['SmsMessage'][_0x097b('0x56')]({'phone':_0x5693a8[_0x097b('0x57')][_0x097b('0x7e')],'messageId':_0x5693a8[_0x097b('0x57')]['messageId'],'body':_0x5693a8['body'][_0x097b('0x57')],'SmsAccountId':_0xd335a4[_0x097b('0x54')]['id'],'SmsInteractionId':_0x5df032['id'],'direction':'in','ContactId':_0x5df032[_0x097b('0xa0')],'AttachmentId':_0x5693a8[_0x097b('0x57')][_0x097b('0xa1')]});})[_0x097b('0x31')](function(_0x243cb7){_0x5693a8['message']=_0x243cb7;if(_0x5693a8[_0x097b('0x9a')][_0x097b('0xa2')]){return db['User'][_0x097b('0x55')]({'attributes':['id',_0x097b('0x35')],'where':{'id':_0x5693a8[_0x097b('0x9a')][_0x097b('0xa2')]}})[_0x097b('0x31')](function(_0x523c6d){if(_0x523c6d){_0x5693a8['applications'][_0x097b('0xa3')]({'id':0x0,'priority':0x0,'app':_0x097b('0xa4'),'appdata':_0x523c6d[_0x097b('0x35')]+','+(_0x5693a8[_0x097b('0x6f')][_0x097b('0xa5')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x097b('0xa6'),_0x097b('0xa7'),_0x5693a8);});}return respondWithRpcPromise('Start',_0x097b('0xa7'),_0x5693a8);})[_0x097b('0x31')](function(_0x299902){if(_0x299902){var _0x5073ca=0xc8;var _0x53f67f=_0x097b('0xa8');logger[_0x097b('0x1d')](_0x097b('0x21'),_0x53f67f,_0x5073ca,_0x097b('0xa9'));logger[_0x097b('0x20')](_0x097b('0xaa'),_0x53f67f,_0x5073ca,'entity\x20found',JSON['stringify'](_0x299902));if(_0x5693a8[_0x097b('0x6f')][_0x097b('0x3d')]===_0x097b('0x7a')){return _0xd722ff[_0x097b('0x28')](_0x5073ca)['set'](_0x097b('0xab'),_0x097b('0xac'))[_0x097b('0x36')](_0x097b('0xad'));}else{return _0xd722ff[_0x097b('0x28')](_0x5073ca)['json'](_0x299902);}}})['catch'](handleError(_0xd722ff,null));};exports[_0x097b('0xae')]=function(_0x345759,_0x54a9e3){var _0x9728ce=_0x345759[_0x097b('0x54')]['id'];var _0x3adc4b=_0x345759['body'];var _0x25b722=0xc8;var _0x2830c0=null;return db[_0x097b('0xaf')]['transaction']({'isolationLevel':db[_0x097b('0xaf')][_0x097b('0xb0')][_0x097b('0xb1')]['READ_COMMITTED']},function(_0x11ce5d){return db[_0x097b('0x51')]['findOne']({'where':{'id':_0x9728ce},'transaction':_0x11ce5d})[_0x097b('0x31')](function(_0x5204b8){if(_0x5204b8){return db[_0x097b('0x6d')][_0x097b('0x32')]({'where':{'SmsAccountId':_0x9728ce},'transaction':_0x11ce5d})[_0x097b('0x31')](function(){var _0x50df71=_[_0x097b('0x3a')](_0x3adc4b,function(_0x4bf716){_0x4bf716[_0x097b('0x62')]=_0x9728ce;return _0x4bf716;});return db['SmsApplication'][_0x097b('0xb2')](_0x50df71,{'transaction':_0x11ce5d});});}else{_0x25b722=0x194;_0x2830c0=[];}});})[_0x097b('0x31')](function(){if(_0x25b722!==0x194){return db[_0x097b('0x6d')][_0x097b('0xb3')]({'where':{'SmsAccountId':_0x9728ce},'order':_0x097b('0x71')})['then'](function(_0x102daf){_0x2830c0=_0x102daf;});}})[_0x097b('0x25')](function(_0x4d2625){_0x25b722=0x1f4;logger[_0x097b('0x23')](_0x4d2625[_0x097b('0xb4')]);if(_0x4d2625[_0x097b('0x35')]){delete _0x4d2625['name'];}_0x2830c0=_0x4d2625;})[_0x097b('0xb5')](function(){if(_0x2830c0===null){_0x54a9e3[_0x097b('0x26')](_0x25b722);}else{if(_0x25b722===0x1f4){_0x54a9e3[_0x097b('0x28')](_0x25b722)[_0x097b('0x36')](_0x2830c0);}else{_0x54a9e3[_0x097b('0x28')](_0x25b722)['json'](_0x2830c0);}}});};exports[_0x097b('0xb6')]=function(_0x59f882,_0x1e2a56,_0x339196){var _0x59c295={};var _0x5aff89={};var _0x41aa52;var _0x5cb2df;return db['SmsAccount'][_0x097b('0x61')]({'where':{'id':_0x59f882[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x1e2a56,null))[_0x097b('0x31')](function(_0x27fb03){if(_0x27fb03){_0x41aa52=_0x27fb03;_0x5aff89['model']=_[_0x097b('0x40')](db[_0x097b('0x6d')][_0x097b('0x3b')]);_0x5aff89[_0x097b('0x41')]=_['keys'](_0x59f882['query']);_0x5aff89[_0x097b('0x42')]=_[_0x097b('0x43')](_0x5aff89['model'],_0x5aff89[_0x097b('0x41')]);_0x59c295[_0x097b('0x44')]=_[_0x097b('0x43')](_0x5aff89['model'],qs[_0x097b('0x45')](_0x59f882[_0x097b('0x41')][_0x097b('0x45')]));_0x59c295[_0x097b('0x44')]=_0x59c295['attributes'][_0x097b('0x46')]?_0x59c295[_0x097b('0x44')]:_0x5aff89[_0x097b('0x3f')];_0x59c295[_0x097b('0x49')]=qs[_0x097b('0x4a')](_0x59f882['query']['sort']);_0x59c295[_0x097b('0x4d')]=qs['filters'](_[_0x097b('0x4b')](_0x59f882['query'],_0x5aff89[_0x097b('0x42')]));if(_0x59f882[_0x097b('0x41')][_0x097b('0x4c')]){_0x59c295[_0x097b('0x4d')]=_['merge'](_0x59c295[_0x097b('0x4d')],{'$or':_[_0x097b('0x3a')](_0x59c295[_0x097b('0x44')],function(_0x444e27){var _0x2ee577={};_0x2ee577[_0x444e27]={'$like':'%'+_0x59f882['query']['filter']+'%'};return _0x2ee577;})});}_0x59c295=_['merge']({},_0x59c295,_0x59f882['options']);return _0x41aa52['getApplications'](_0x59c295);}})[_0x097b('0x31')](function(_0x9cbf68){if(_0x9cbf68){_0x5cb2df=_0x9cbf68[_0x097b('0x46')];if(!_0x59f882[_0x097b('0x41')][_0x097b('0x47')]('nolimit')){_0x59c295[_0x097b('0x2c')]=qs[_0x097b('0x2c')](_0x59f882[_0x097b('0x41')][_0x097b('0x2c')]);_0x59c295['offset']=qs[_0x097b('0x2a')](_0x59f882[_0x097b('0x41')][_0x097b('0x2a')]);}return _0x41aa52[_0x097b('0xb6')](_0x59c295);}})[_0x097b('0x31')](function(_0x2a70bc){if(_0x2a70bc){return _0x2a70bc?{'count':_0x5cb2df,'rows':_0x2a70bc}:null;}})[_0x097b('0x31')](respondWithResult(_0x1e2a56,null))['catch'](handleError(_0x1e2a56,null));};exports[_0x097b('0xb7')]=function(_0x56209c,_0x2305f6,_0x2a6d42){var _0x39e75f={'raw':![],'where':{}};var _0x41243c={};var _0x21131b={'count':0x0,'rows':[]};return db[_0x097b('0x51')]['findOne']({'where':{'id':_0x56209c['params']['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x2305f6,null))[_0x097b('0x31')](function(_0x48ba31){if(_0x48ba31){_0x41243c[_0x097b('0x3f')]=_[_0x097b('0x40')](db['SmsInteraction'][_0x097b('0x3b')]);_0x41243c[_0x097b('0x41')]=_['keys'](_0x56209c[_0x097b('0x41')]);_0x41243c[_0x097b('0x42')]=_['intersection'](_0x41243c[_0x097b('0x3f')],_0x41243c['query']);_0x39e75f[_0x097b('0x44')]=_['intersection'](_0x41243c[_0x097b('0x3f')],qs[_0x097b('0x45')](_0x56209c['query']['fields']));_0x39e75f[_0x097b('0x44')]=_0x39e75f[_0x097b('0x44')]['length']?_0x39e75f[_0x097b('0x44')]:_0x41243c[_0x097b('0x3f')];if(!_0x56209c[_0x097b('0x41')][_0x097b('0x47')]('nolimit')){_0x39e75f[_0x097b('0x2c')]=qs[_0x097b('0x2c')](_0x56209c[_0x097b('0x41')][_0x097b('0x2c')]);_0x39e75f['offset']=qs[_0x097b('0x2a')](_0x56209c['query']['offset']);}_0x39e75f[_0x097b('0x49')]=qs['sort'](_0x56209c[_0x097b('0x41')][_0x097b('0x4a')]);_0x39e75f[_0x097b('0x4d')]=qs[_0x097b('0x42')](_[_0x097b('0x4b')](_0x56209c[_0x097b('0x41')],_0x41243c[_0x097b('0x42')]));_0x39e75f['where'][_0x097b('0x62')]=_0x48ba31['id'];if(_0x56209c[_0x097b('0x41')][_0x097b('0x4c')]){_0x39e75f[_0x097b('0x4d')]=_['merge'](_0x39e75f[_0x097b('0x4d')],{'$or':_[_0x097b('0x3a')](_0x39e75f[_0x097b('0x44')],function(_0x1dd9f7){var _0x553915={};_0x553915[_0x1dd9f7]={'$like':'%'+_0x56209c[_0x097b('0x41')]['filter']+'%'};return _0x553915;})});}_0x39e75f=_[_0x097b('0x4e')]({},_0x39e75f,_0x56209c[_0x097b('0x4f')]);return db['SmsInteraction'][_0x097b('0x2d')]({'where':_0x39e75f[_0x097b('0x4d')]})[_0x097b('0x31')](function(_0x17e000){_0x21131b[_0x097b('0x2d')]=_0x17e000;if(_0x56209c['query'][_0x097b('0x68')]){_0x39e75f[_0x097b('0x50')]=[{'model':db[_0x097b('0x73')],'as':_0x097b('0xb8'),'required':![]},{'model':db[_0x097b('0xb9')],'as':_0x097b('0xba'),'attributes':[_0x097b('0x35'),_0x097b('0xbb'),_0x097b('0xbc')],'required':![]},{'model':db['Tag'],'as':_0x097b('0xbd'),'attributes':['id',_0x097b('0x35'),_0x097b('0xbe')],'where':_0x56209c[_0x097b('0x41')][_0x097b('0xbf')]?{'id':_0x56209c[_0x097b('0x41')]['tag']}:undefined,'required':_0x56209c[_0x097b('0x41')][_0x097b('0xbf')]?!![]:![]}];}return db[_0x097b('0xc0')][_0x097b('0x63')](_0x39e75f);})[_0x097b('0x31')](function(_0x91da58){_0x21131b[_0x097b('0x52')]=_0x91da58;return _0x21131b;});}})['then'](respondWithFilteredResult(_0x2305f6,_0x39e75f))['catch'](handleError(_0x2305f6,null));};exports[_0x097b('0x36')]=function(_0x3d2399,_0x6a090b,_0x1eb0c5){var _0x5e641c,_0x2ddd30,_0x272325;if(_[_0x097b('0x8f')](_0x3d2399[_0x097b('0x57')][_0x097b('0x57')])||_0x3d2399['body'][_0x097b('0x57')]===''){throw new db[(_0x097b('0x74'))]['ValidationError'](_0x097b('0x90'));}if(_[_0x097b('0x8f')](_0x3d2399[_0x097b('0x57')]['to'])){throw new db['Sequelize'][(_0x097b('0x8e'))]('to\x20is\x20mandatory');}_0x5e641c=_0x3d2399[_0x097b('0x57')]['to'];return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0x3d2399['params']['id']},'include':[{'model':db[_0x097b('0x94')],'as':_0x097b('0xc1'),'include':[{'model':db[_0x097b('0x73')],'as':_0x097b('0x97'),'where':{'mobile':_0x5e641c},'limit':0x1,'order':[[_0x097b('0x77'),_0x097b('0x95')]]}]}]})['then'](handleEntityNotFound(_0x6a090b,null))[_0x097b('0x31')](function(_0x27e6c6){if(_0x27e6c6&&_0x27e6c6[_0x097b('0xc1')]){_0x2ddd30=_0x27e6c6[_0x097b('0x33')]({'plain':!![]});if(_0x2ddd30[_0x097b('0xc1')]&&_0x2ddd30[_0x097b('0xc1')][_0x097b('0x97')][_0x097b('0x46')]){return _0x2ddd30[_0x097b('0xc1')]['Contacts'][0x0];}return db[_0x097b('0x73')]['create'](_[_0x097b('0xc2')](_0x3d2399[_0x097b('0x57')],{'firstName':_0x5e641c,'mobile':_0x5e641c,'phone':_0x5e641c,'ListId':_0x2ddd30['ListId']}));}})[_0x097b('0x31')](handleEntityNotFound(_0x6a090b,null))['then'](function(_0x5b7561){if(_0x5b7561){_0x272325=_0x5b7561;return db[_0x097b('0xc0')][_0x097b('0x55')]({'where':{'ContactId':_0x272325['id'],'closed':![],'SmsAccountId':_0x2ddd30['id']}})[_0x097b('0x31')](function(_0x5458ce){if(_0x5458ce){return[_0x5458ce,![]];}return db['SmsInteraction'][_0x097b('0x56')]({'UserId':_0x3d2399[_0x097b('0xc3')]['id'],'ContactId':_0x272325['id'],'SmsAccountId':_0x2ddd30['id'],'phone':_0x5e641c,'firstMsgDirection':_0x097b('0xc4'),'Messages':[_[_0x097b('0x4e')](_0x3d2399[_0x097b('0x57')],{'read':![],'body':_0x3d2399[_0x097b('0x57')]['body'],'phone':_0x5e641c,'SmsAccountId':_0x2ddd30['id'],'UserId':_0x3d2399['user']['id'],'ContactId':_0x272325['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x097b('0xc5')}]})[_0x097b('0x31')](function(_0x3367d7){return[_0x3367d7,!![]];});});}})[_0x097b('0x99')](function(_0x126097,_0x4c356a){if(_0x4c356a){return _0x126097;}return db[_0x097b('0xc6')]['create'](_[_0x097b('0x4e')](_0x3d2399['body'],{'read':![],'body':_0x3d2399[_0x097b('0x57')][_0x097b('0x57')],'phone':_0x5e641c,'SmsAccountId':_0x2ddd30['id'],'SmsInteractionId':_0x126097['id'],'UserId':_0x3d2399[_0x097b('0xc3')]['id'],'ContactId':_0x272325['id']}))[_0x097b('0x31')](function(_0x594e82){_0x126097[_0x097b('0xc7')][_0x097b('0xc5')]=[];_0x126097['dataValues'][_0x097b('0xc5')][_0x097b('0x9e')](_0x594e82['dataValues']);return _0x126097;});})[_0x097b('0x31')](respondWithResult(_0x6a090b,null))[_0x097b('0x25')](handleError(_0x6a090b,null));};exports[_0x097b('0x28')]=function(_0x22d6db,_0x4d6278,_0x214377){if(_0x22d6db[_0x097b('0x57')]['id']){delete _0x22d6db[_0x097b('0x57')]['id'];}var _0x508143,_0x417be8,_0x167b7b;return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0x22d6db[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x4d6278,null))[_0x097b('0x31')](function(_0x45e1d7){if(_0x45e1d7){_0x167b7b=_0x45e1d7;logger[_0x097b('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x097b('0xc8'),_0x45e1d7[_0x097b('0x3d')],util[_0x097b('0xc9')](_0x22d6db[_0x097b('0x57')],{'showHidden':![],'depth':null}));switch(_0x45e1d7[_0x097b('0x3d')]){case _0x097b('0x7d'):if(_0x22d6db[_0x097b('0x57')][_0x097b('0xca')]&&_0x22d6db[_0x097b('0x57')][_0x097b('0x28')]){_0x417be8=_0x22d6db['body'][_0x097b('0x28')];return db[_0x097b('0xc6')]['find']({'where':{'messageId':_0x22d6db[_0x097b('0x57')][_0x097b('0xca')]}});}break;case'connectel':if(_0x22d6db[_0x097b('0x57')]['requestid']&&_0x22d6db[_0x097b('0x57')]['statusInt']){_0x417be8=_0x22d6db[_0x097b('0x57')]['statusInt'];return db[_0x097b('0xc6')]['find']({'where':{'messageId':_0x22d6db[_0x097b('0x57')][_0x097b('0xcb')]}});}break;case _0x097b('0x82'):if(_0x22d6db[_0x097b('0x57')][_0x097b('0xcc')]&&_0x22d6db[_0x097b('0x57')]['status_code']){_0x417be8=_0x22d6db[_0x097b('0x57')][_0x097b('0xcd')];return db['SmsMessage']['find']({'where':{'messageId':_0x22d6db['body']['message_id']}});}break;case _0x097b('0x85'):var _0x374676=_0x22d6db['body']['results'][0x0];if(_0x374676[_0x097b('0x83')]&&_0x374676[_0x097b('0x28')][_0x097b('0xce')]===_0x097b('0xcf')){_0x417be8=_0x374676[_0x097b('0x28')][_0x097b('0xce')];return db[_0x097b('0xc6')][_0x097b('0x55')]({'where':{'messageId':_0x374676[_0x097b('0x83')]}});}break;case _0x097b('0x89'):if(_0x22d6db['body'][_0x097b('0x83')]&&_0x22d6db['body'][_0x097b('0x28')]){_0x417be8=_0x22d6db[_0x097b('0x57')][_0x097b('0x28')];return db['SmsMessage'][_0x097b('0x55')]({'where':{'messageId':_0x22d6db[_0x097b('0x57')][_0x097b('0x83')]}});}break;case _0x097b('0x8c'):if(_0x22d6db[_0x097b('0x57')][0x0][_0x097b('0x24')]['id']){_0x417be8=_0x22d6db[_0x097b('0x57')][0x0]['type'];return db['SmsMessage']['find']({'where':{'messageId':_0x22d6db[_0x097b('0x57')][0x0][_0x097b('0x24')]['id']}});}break;case _0x097b('0xd0'):if(_0x22d6db['body'][_0x097b('0xd1')]&&_0x22d6db[_0x097b('0x57')][_0x097b('0x28')]){_0x417be8=_0x22d6db[_0x097b('0x57')][_0x097b('0x28')];return db['SmsMessage']['find']({'where':{'messageId':_0x22d6db[_0x097b('0x57')][_0x097b('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x4d6278,null))[_0x097b('0x31')](function(_0x358023){if(_0x358023){_0x508143=_0x358023;switch(_0x167b7b[_0x097b('0x3d')]){case'skebby':if(_0x417be8==='DELIVERED'){return _0x508143[_0x097b('0x5d')]({'read':!![]});}else{logger[_0x097b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x097b('0x28'),_0x097b('0x7d'),util['inspect'](_0x22d6db['body'],{'showHidden':![],'depth':null}));}break;case _0x097b('0x81'):if(_0x417be8==='1'){return _0x508143[_0x097b('0x5d')]({'read':!![]});}else{logger['error'](_0x097b('0x21'),_0x097b('0x28'),_0x097b('0x7d'),util['inspect'](_0x22d6db[_0x097b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x097b('0x82'):if(!_0x22d6db['body'][_0x097b('0xd2')]&&_0x417be8>=0xc8&&_0x417be8<=0xce){return _0x508143['update']({'read':!![]});}else{logger['error'](_0x097b('0x21'),'status',_0x097b('0x82'),util['inspect'](_0x22d6db[_0x097b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x097b('0x85'):var _0x21fa3b=_0x22d6db[_0x097b('0x57')][_0x097b('0x86')][0x0];if(_0x21fa3b['status'][_0x097b('0xce')]==='DELIVERED'){return _0x508143['update']({'read':!![]});}else{logger[_0x097b('0x23')](_0x097b('0x21'),'status',_0x097b('0x85'),util[_0x097b('0xc9')](_0x22d6db['body'],{'showHidden':![],'depth':null}));}break;case _0x097b('0x89'):if(_0x417be8=='DELIVERED_TO_GATEWAY'||_0x417be8=='RECEIVED_BY_RECIPIENT'){return _0x508143[_0x097b('0x5d')]({'read':!![]});}else{logger[_0x097b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clickatell',util[_0x097b('0xc9')](_0x22d6db['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x417be8=='message-delivered'){return _0x508143['update']({'read':!![]});}else{logger[_0x097b('0x23')](_0x097b('0x21'),_0x097b('0x28'),_0x097b('0x8c'),util['inspect'](_0x22d6db[_0x097b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x097b('0xd0'):if(_0x417be8===_0x097b('0xd3')||_0x417be8===_0x097b('0xd4')){return _0x508143[_0x097b('0x5d')]({'read':!![]});}else{logger[_0x097b('0x23')](_0x097b('0x21'),_0x097b('0x28'),'intelepeer',util[_0x097b('0xc9')](_0x22d6db[_0x097b('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x508143;}})[_0x097b('0x31')](respondWithResult(_0x4d6278,null))['catch'](handleError(_0x4d6278,null));};exports[_0x097b('0xd5')]=function(_0x207837,_0x4162f6,_0x455da3){var _0x1197be,_0x200263,_0x511a0b;return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0x207837[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0x4162f6,null))[_0x097b('0x31')](function(_0x3fa571){if(_0x3fa571){_0x511a0b=_0x3fa571;logger[_0x097b('0x20')](_0x097b('0x21'),_0x097b('0x28'),_0x097b('0xc8'),_0x3fa571['type'],util['inspect'](_0x207837[_0x097b('0x41')],{'showHidden':![],'depth':null}));switch(_0x3fa571['type']){case'csc':if(_0x207837[_0x097b('0x41')][_0x097b('0xd6')]&&_0x207837['query'][_0x097b('0xd7')]){_0x200263=_0x207837[_0x097b('0x41')][_0x097b('0xd7')];return db[_0x097b('0xc6')]['find']({'where':{'messageId':_0x207837[_0x097b('0x41')][_0x097b('0xd6')]}});}break;}}})[_0x097b('0x31')](handleEntityNotFound(_0x4162f6,null))['then'](function(_0x10911d){if(_0x10911d){_0x1197be=_0x10911d;switch(_0x511a0b[_0x097b('0x3d')]){case _0x097b('0x87'):if(_0x200263==='2'||_0x200263==='6'){return _0x1197be[_0x097b('0x5d')]({'read':!![]});}else{logger[_0x097b('0x23')](_0x097b('0x21'),_0x097b('0x28'),_0x097b('0x87'),util[_0x097b('0xc9')](_0x207837[_0x097b('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1197be;}})[_0x097b('0x31')](respondWithResult(_0x4162f6,null))['catch'](handleError(_0x4162f6,null));};exports['addAgents']=function(_0xa1d242,_0xb74469,_0x1e2b44){return db[_0x097b('0x51')][_0x097b('0x55')]({'where':{'id':_0xa1d242[_0x097b('0x54')]['id']}})[_0x097b('0x31')](handleEntityNotFound(_0xb74469,null))[_0x097b('0x31')](function(_0x3664b6){if(_0x3664b6){return _0x3664b6[_0x097b('0xd8')](_0xa1d242[_0x097b('0x57')][_0x097b('0x6a')],_[_0x097b('0x96')](_0xa1d242[_0x097b('0x57')],['ids','id'])||{})[_0x097b('0x99')](function(_0x576038){for(var _0x201520=0x0;_0x201520<_0xa1d242[_0x097b('0x57')]['ids'][_0x097b('0x46')];_0x201520+=0x1){socket['emit'](_0x097b('0xd9'),{'UserId':Number(_0xa1d242[_0x097b('0x57')]['ids'][_0x201520]),'SmsAccountId':Number(_0xa1d242[_0x097b('0x54')]['id'])});}return _0x576038;});}})[_0x097b('0x31')](respondWithResult(_0xb74469,null))[_0x097b('0x25')](handleError(_0xb74469,null));};exports[_0x097b('0xda')]=function(_0x1818a8,_0x14de1e,_0x556d48){return db[_0x097b('0x51')]['find']({'where':{'id':_0x1818a8['params']['id']}})['then'](handleEntityNotFound(_0x14de1e,null))[_0x097b('0x31')](function(_0x19ca28){if(_0x19ca28){return _0x19ca28[_0x097b('0xda')](_0x1818a8['query'][_0x097b('0x6a')])[_0x097b('0x31')](function(){if(_['isArray'](_0x1818a8[_0x097b('0x41')]['ids'])){for(var _0x3f662=0x0;_0x3f662<_0x1818a8[_0x097b('0x41')][_0x097b('0x6a')][_0x097b('0x46')];_0x3f662+=0x1){socket[_0x097b('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x1818a8[_0x097b('0x41')][_0x097b('0x6a')][_0x3f662]),'SmsAccountId':Number(_0x1818a8[_0x097b('0x54')]['id'])});}}else{socket[_0x097b('0xdb')](_0x097b('0xdc'),{'UserId':Number(_0x1818a8['query'][_0x097b('0x6a')]),'SmsAccountId':Number(_0x1818a8[_0x097b('0x54')]['id'])});}});}})[_0x097b('0x31')](respondWithStatusCode(_0x14de1e,null))[_0x097b('0x25')](handleError(_0x14de1e,null));};exports[_0x097b('0xdd')]=function(_0x5036d7,_0x2ceecf,_0x4e8dfb){var _0x533362={};var _0x3ac184={};var _0x495c73;var _0x3c3458;return db['SmsAccount'][_0x097b('0x61')]({'where':{'id':_0x5036d7[_0x097b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2ceecf,null))[_0x097b('0x31')](function(_0x1f07ac){if(_0x1f07ac){_0x495c73=_0x1f07ac;_0x3ac184[_0x097b('0x3f')]=_['keys'](db[_0x097b('0xb9')][_0x097b('0x3b')]);_0x3ac184[_0x097b('0x41')]=_[_0x097b('0x40')](_0x5036d7['query']);_0x3ac184[_0x097b('0x42')]=_[_0x097b('0x43')](_0x3ac184[_0x097b('0x3f')],_0x3ac184[_0x097b('0x41')]);_0x533362['attributes']=_[_0x097b('0x43')](_0x3ac184[_0x097b('0x3f')],qs[_0x097b('0x45')](_0x5036d7[_0x097b('0x41')][_0x097b('0x45')]));_0x533362[_0x097b('0x44')]=_0x533362[_0x097b('0x44')]['length']?_0x533362[_0x097b('0x44')]:_0x3ac184[_0x097b('0x3f')];_0x533362[_0x097b('0x49')]=qs[_0x097b('0x4a')](_0x5036d7['query'][_0x097b('0x4a')]);_0x533362[_0x097b('0x4d')]=qs[_0x097b('0x42')](_[_0x097b('0x4b')](_0x5036d7[_0x097b('0x41')],_0x3ac184['filters']));if(_0x5036d7[_0x097b('0x41')][_0x097b('0x4c')]){_0x533362[_0x097b('0x4d')]=_['merge'](_0x533362[_0x097b('0x4d')],{'$or':_[_0x097b('0x3a')](_0x533362[_0x097b('0x44')],function(_0x30058e){var _0x3b2e02={};_0x3b2e02[_0x30058e]={'$like':'%'+_0x5036d7[_0x097b('0x41')][_0x097b('0x4c')]+'%'};return _0x3b2e02;})});}_0x533362=_['merge']({},_0x533362,_0x5036d7[_0x097b('0x4f')]);return _0x495c73[_0x097b('0xdd')](_0x533362);}})['then'](function(_0xd0fbc2){if(_0xd0fbc2){_0x3c3458=_0xd0fbc2[_0x097b('0x46')];if(!_0x5036d7[_0x097b('0x41')][_0x097b('0x47')]('nolimit')){_0x533362[_0x097b('0x2c')]=qs['limit'](_0x5036d7[_0x097b('0x41')][_0x097b('0x2c')]);_0x533362['offset']=qs[_0x097b('0x2a')](_0x5036d7[_0x097b('0x41')][_0x097b('0x2a')]);}return _0x495c73[_0x097b('0xdd')](_0x533362);}})[_0x097b('0x31')](function(_0x680246){if(_0x680246){return _0x680246?{'count':_0x3c3458,'rows':_0x680246}:null;}})[_0x097b('0x31')](respondWithResult(_0x2ceecf,null))[_0x097b('0x25')](handleError(_0x2ceecf,null));}; \ No newline at end of file +var _0xa2c2=['asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','Body','messageId','MessageSid','skebby','from','text','connectel','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','applications','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','end','stack','name','send','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','show','params','mandatoryDispositionPause','keys','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','notify','sms','Applications','account','orderBy','priority'];(function(_0x144c37,_0x5508f7){var _0x298904=function(_0x275ea8){while(--_0x275ea8){_0x144c37['push'](_0x144c37['shift']());}};_0x298904(++_0x5508f7);}(_0xa2c2,0x78));var _0x2a2c=function(_0x33f81a,_0x48a3fc){_0x33f81a=_0x33f81a-0x0;var _0xdab9e9=_0xa2c2[_0x33f81a];return _0xdab9e9;};'use strict';var emlformat=require(_0x2a2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a2c('0x1'));var jsonpatch=require(_0x2a2c('0x2'));var rp=require('request-promise');var moment=require(_0x2a2c('0x3'));var BPromise=require(_0x2a2c('0x4'));var Mustache=require(_0x2a2c('0x5'));var util=require('util');var path=require(_0x2a2c('0x6'));var sox=require(_0x2a2c('0x7'));var csv=require(_0x2a2c('0x8'));var ejs=require(_0x2a2c('0x9'));var fs=require('fs');var fs_extra=require(_0x2a2c('0xa'));var _=require(_0x2a2c('0xb'));var squel=require(_0x2a2c('0xc'));var crypto=require(_0x2a2c('0xd'));var jsforce=require(_0x2a2c('0xe'));var deskjs=require(_0x2a2c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2a2c('0x10'));var Papa=require(_0x2a2c('0x11'));var Redis=require(_0x2a2c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a2c('0x13'));var logger=require('../../config/logger')(_0x2a2c('0x14'));var utils=require('../../config/utils');var config=require(_0x2a2c('0x15'));var licenseUtil=require(_0x2a2c('0x16'));var db=require(_0x2a2c('0x17'))['db'];config[_0x2a2c('0x18')]=_[_0x2a2c('0x19')](config[_0x2a2c('0x18')],{'host':_0x2a2c('0x1a'),'port':0x18eb});var socket=require(_0x2a2c('0x1b'))(new Redis(config[_0x2a2c('0x18')]));require(_0x2a2c('0x1c'))[_0x2a2c('0x1d')](socket);var jayson=require(_0x2a2c('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x49df93,_0x1de88e,_0x2bfd0f,_0x25f252){return new BPromise(function(_0x65edd9,_0x2e9ad8){var _0x6fb800=_0x25f252||client;return _0x6fb800['request'](_0x49df93,_0x2bfd0f)[_0x2a2c('0x1f')](function(_0x2c8b84){logger[_0x2a2c('0x20')](_0x2a2c('0x21'),_0x1de88e,'request\x20sent');logger[_0x2a2c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1de88e,_0x2a2c('0x23'),JSON[_0x2a2c('0x24')](_0x2c8b84));if(_0x2c8b84[_0x2a2c('0x25')]){if(_0x2c8b84[_0x2a2c('0x25')][_0x2a2c('0x26')]===0x1f4){logger[_0x2a2c('0x25')](_0x2a2c('0x21'),_0x1de88e,_0x2c8b84['error'][_0x2a2c('0x27')]);return _0x2e9ad8(_0x2c8b84[_0x2a2c('0x25')]['message']);}logger[_0x2a2c('0x25')]('SmsAccount,\x20%s,\x20%s',_0x1de88e,_0x2c8b84['error'][_0x2a2c('0x27')]);return _0x65edd9(_0x2c8b84[_0x2a2c('0x25')][_0x2a2c('0x27')]);}else{logger[_0x2a2c('0x20')](_0x2a2c('0x21'),_0x1de88e,'request\x20sent');_0x65edd9(_0x2c8b84['result'][_0x2a2c('0x27')]);}})[_0x2a2c('0x28')](function(_0x3e7994){logger[_0x2a2c('0x25')](_0x2a2c('0x21'),_0x1de88e,_0x3e7994);_0x2e9ad8(_0x3e7994);});});}function respondWithStatusCode(_0x4548af,_0x45c96e){_0x45c96e=_0x45c96e||0xcc;return function(_0x478f4f){if(_0x478f4f){return _0x4548af[_0x2a2c('0x29')](_0x45c96e);}return _0x4548af['status'](_0x45c96e)['end']();};}function respondWithResult(_0x258cc2,_0x47f3d1){_0x47f3d1=_0x47f3d1||0xc8;return function(_0x17e644){if(_0x17e644){return _0x258cc2[_0x2a2c('0x2a')](_0x47f3d1)[_0x2a2c('0x2b')](_0x17e644);}};}function respondWithFilteredResult(_0x45232e,_0xa412e4){return function(_0x4593a6){if(_0x4593a6){var _0x27a651=typeof _0xa412e4[_0x2a2c('0x2c')]==='undefined'&&typeof _0xa412e4[_0x2a2c('0x2d')]===_0x2a2c('0x2e');var _0x31e947=_0x4593a6['count'];var _0x10fd29=_0x27a651?0x0:_0xa412e4[_0x2a2c('0x2c')];var _0x45b256=_0x27a651?_0x4593a6[_0x2a2c('0x2f')]:_0xa412e4[_0x2a2c('0x2c')]+_0xa412e4[_0x2a2c('0x2d')];var _0x191d9e;if(_0x45b256>=_0x31e947){_0x45b256=_0x31e947;_0x191d9e=0xc8;}else{_0x191d9e=0xce;}_0x45232e[_0x2a2c('0x2a')](_0x191d9e);return _0x45232e[_0x2a2c('0x30')](_0x2a2c('0x31'),_0x10fd29+'-'+_0x45b256+'/'+_0x31e947)[_0x2a2c('0x2b')](_0x4593a6);}return null;};}function patchUpdates(_0x2f156b){return function(_0x3d3551){try{jsonpatch[_0x2a2c('0x32')](_0x3d3551,_0x2f156b,!![]);}catch(_0x2574ef){return BPromise[_0x2a2c('0x33')](_0x2574ef);}return _0x3d3551[_0x2a2c('0x34')]();};}function saveUpdates(_0x3385e7,_0x20175e){return function(_0x37de2d){if(_0x37de2d){return _0x37de2d[_0x2a2c('0x35')](_0x3385e7)['then'](function(_0x242db6){return _0x242db6;});}return null;};}function removeEntity(_0x43fa0e,_0x4cc183){return function(_0x31affa){if(_0x31affa){return _0x31affa[_0x2a2c('0x36')]()['then'](function(){var _0x44e630=_0x31affa['get']({'plain':!![]});var _0x3223c5=_0x2a2c('0x37');return db[_0x2a2c('0x38')]['destroy']({'where':{'type':_0x3223c5,'resourceId':_0x44e630['id']}})[_0x2a2c('0x1f')](function(){return _0x31affa;});})[_0x2a2c('0x1f')](function(){_0x43fa0e[_0x2a2c('0x2a')](0xcc)[_0x2a2c('0x39')]();});}};}function handleEntityNotFound(_0x54dc7f,_0x2f67b3){return function(_0x490c49){if(!_0x490c49){_0x54dc7f[_0x2a2c('0x29')](0x194);}return _0x490c49;};}function handleError(_0x1d5ad8,_0x40361c){_0x40361c=_0x40361c||0x1f4;return function(_0x4f24f0){logger[_0x2a2c('0x25')](_0x4f24f0[_0x2a2c('0x3a')]);if(_0x4f24f0[_0x2a2c('0x3b')]){delete _0x4f24f0[_0x2a2c('0x3b')];}_0x1d5ad8[_0x2a2c('0x2a')](_0x40361c)[_0x2a2c('0x3c')](_0x4f24f0);};}exports['index']=function(_0x14ce21,_0x4448f8){var _0x4999e7={'include':[{'model':db[_0x2a2c('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5b9ab9={},_0x28b962={'count':0x0,'rows':[]};var _0x13e929=_[_0x2a2c('0x3e')](db[_0x2a2c('0x3f')][_0x2a2c('0x40')],function(_0x19d03e){return{'name':_0x19d03e[_0x2a2c('0x41')],'type':_0x19d03e[_0x2a2c('0x42')][_0x2a2c('0x43')]};});_0x5b9ab9[_0x2a2c('0x44')]=_[_0x2a2c('0x3e')](_0x13e929,_0x2a2c('0x3b'));_0x5b9ab9[_0x2a2c('0x45')]=_['keys'](_0x14ce21[_0x2a2c('0x45')]);_0x5b9ab9[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0x5b9ab9[_0x2a2c('0x44')],_0x5b9ab9[_0x2a2c('0x45')]);_0x4999e7['attributes']=_[_0x2a2c('0x47')](_0x5b9ab9[_0x2a2c('0x44')],qs[_0x2a2c('0x48')](_0x14ce21['query']['fields']));_0x4999e7[_0x2a2c('0x49')]=_0x4999e7['attributes'][_0x2a2c('0x4a')]?_0x4999e7[_0x2a2c('0x49')]:_0x5b9ab9[_0x2a2c('0x44')];if(!_0x14ce21['query'][_0x2a2c('0x4b')]('nolimit')){_0x4999e7[_0x2a2c('0x2d')]=qs[_0x2a2c('0x2d')](_0x14ce21['query'][_0x2a2c('0x2d')]);_0x4999e7[_0x2a2c('0x2c')]=qs[_0x2a2c('0x2c')](_0x14ce21[_0x2a2c('0x45')][_0x2a2c('0x2c')]);}_0x4999e7[_0x2a2c('0x4c')]=qs[_0x2a2c('0x4d')](_0x14ce21[_0x2a2c('0x45')][_0x2a2c('0x4d')]);_0x4999e7[_0x2a2c('0x4e')]=qs[_0x2a2c('0x46')](_['pick'](_0x14ce21[_0x2a2c('0x45')],_0x5b9ab9['filters']),_0x13e929);if(_0x14ce21[_0x2a2c('0x45')][_0x2a2c('0x4f')]){_0x4999e7[_0x2a2c('0x4e')]=_[_0x2a2c('0x50')](_0x4999e7[_0x2a2c('0x4e')],{'$or':_[_0x2a2c('0x3e')](_0x13e929,function(_0x3cff8e){if(_0x3cff8e['type']!==_0x2a2c('0x51')){var _0x32e095={};_0x32e095[_0x3cff8e['name']]={'$like':'%'+_0x14ce21[_0x2a2c('0x45')][_0x2a2c('0x4f')]+'%'};return _0x32e095;}})});}_0x4999e7=_[_0x2a2c('0x50')]({},_0x4999e7,_0x14ce21['options']);var _0x37d475={'where':_0x4999e7[_0x2a2c('0x4e')]};return db[_0x2a2c('0x3f')][_0x2a2c('0x2f')](_0x37d475)[_0x2a2c('0x1f')](function(_0x439a01){_0x28b962['count']=_0x439a01;if(_0x14ce21[_0x2a2c('0x45')][_0x2a2c('0x52')]){_0x4999e7['include']=[{'all':!![]}];}return db[_0x2a2c('0x3f')]['findAll'](_0x4999e7);})['then'](function(_0x21176a){_0x28b962[_0x2a2c('0x53')]=_0x21176a;return _0x28b962;})[_0x2a2c('0x1f')](respondWithFilteredResult(_0x4448f8,_0x4999e7))['catch'](handleError(_0x4448f8,null));};exports[_0x2a2c('0x54')]=function(_0x192c5f,_0x61bfa){var _0x234321={'raw':![],'where':{'id':_0x192c5f[_0x2a2c('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x2a2c('0x56')}]},_0xdbf72a={};_0xdbf72a[_0x2a2c('0x44')]=_[_0x2a2c('0x57')](db[_0x2a2c('0x3f')][_0x2a2c('0x40')]);_0xdbf72a[_0x2a2c('0x45')]=_[_0x2a2c('0x57')](_0x192c5f['query']);_0xdbf72a[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0xdbf72a[_0x2a2c('0x44')],_0xdbf72a['query']);_0x234321[_0x2a2c('0x49')]=_[_0x2a2c('0x47')](_0xdbf72a[_0x2a2c('0x44')],qs['fields'](_0x192c5f[_0x2a2c('0x45')][_0x2a2c('0x48')]));_0x234321['attributes']=_0x234321[_0x2a2c('0x49')][_0x2a2c('0x4a')]?_0x234321[_0x2a2c('0x49')]:_0xdbf72a[_0x2a2c('0x44')];if(_0x192c5f[_0x2a2c('0x45')]['includeAll']){_0x234321[_0x2a2c('0x58')]=[{'all':!![]}];}_0x234321=_['merge']({},_0x234321,_0x192c5f[_0x2a2c('0x59')]);return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')](_0x234321)[_0x2a2c('0x1f')](handleEntityNotFound(_0x61bfa,null))[_0x2a2c('0x1f')](respondWithResult(_0x61bfa,null))[_0x2a2c('0x28')](handleError(_0x61bfa,null));};exports[_0x2a2c('0x5b')]=function(_0x361c26,_0x5b4c16){return db[_0x2a2c('0x3f')]['create'](_0x361c26['body'],{})['then'](function(_0x5c5a55){var _0x2bd673=_0x361c26[_0x2a2c('0x5c')][_0x2a2c('0x5d')]({'plain':!![]});if(!_0x2bd673)throw new Error(_0x2a2c('0x5e'));if(_0x2bd673[_0x2a2c('0x5f')]===_0x2a2c('0x5c')){var _0x403379=_0x5c5a55[_0x2a2c('0x5d')]({'plain':!![]});var _0x362230=_0x2a2c('0x37');return db['UserProfileSection'][_0x2a2c('0x5a')]({'where':{'name':_0x362230,'userProfileId':_0x2bd673[_0x2a2c('0x60')]},'raw':!![]})[_0x2a2c('0x1f')](function(_0x515605){if(_0x515605&&_0x515605['autoAssociation']===0x0){return db[_0x2a2c('0x38')]['create']({'name':_0x403379['name'],'resourceId':_0x403379['id'],'type':_0x515605[_0x2a2c('0x3b')],'sectionId':_0x515605['id']},{})[_0x2a2c('0x1f')](function(){return _0x5c5a55;});}else{return _0x5c5a55;}})[_0x2a2c('0x28')](function(_0x2f4f04){logger['error'](_0x2a2c('0x61'),_0x2f4f04);throw _0x2f4f04;});}return _0x5c5a55;})[_0x2a2c('0x1f')](respondWithResult(_0x5b4c16,0xc9))[_0x2a2c('0x28')](handleError(_0x5b4c16,null));};exports['update']=function(_0x391c41,_0x5095bc){if(_0x391c41['body']['id']){delete _0x391c41['body']['id'];}return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x391c41[_0x2a2c('0x55')]['id']},'include':[{'model':db[_0x2a2c('0x3d')],'as':_0x2a2c('0x56')}]})['then'](handleEntityNotFound(_0x5095bc,null))[_0x2a2c('0x1f')](saveUpdates(_0x391c41[_0x2a2c('0x62')],null))['then'](respondWithResult(_0x5095bc,null))[_0x2a2c('0x28')](handleError(_0x5095bc,null));};exports[_0x2a2c('0x36')]=function(_0x42f5f5,_0x1bcf9e){return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x42f5f5[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x1bcf9e,null))[_0x2a2c('0x1f')](removeEntity(_0x1bcf9e,null))[_0x2a2c('0x28')](handleError(_0x1bcf9e,null));};exports[_0x2a2c('0x63')]=function(_0x45c5ad,_0xa16caf){return db[_0x2a2c('0x3f')][_0x2a2c('0x63')]()[_0x2a2c('0x1f')](respondWithResult(_0xa16caf,null))[_0x2a2c('0x28')](handleError(_0xa16caf,null));};exports[_0x2a2c('0x64')]=function(_0x2b17c0,_0x64d341,_0x5bf9d8){if(_0x2b17c0[_0x2a2c('0x62')]['id']){delete _0x2b17c0[_0x2a2c('0x62')]['id'];}return db['SmsAccount'][_0x2a2c('0x5a')]({'where':{'id':_0x2b17c0[_0x2a2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x64d341,null))[_0x2a2c('0x1f')](function(_0x1fe3fe){if(_0x1fe3fe){_0x2b17c0['body'][_0x2a2c('0x65')]=_0x1fe3fe['id'];return db[_0x2a2c('0x66')]['create'](_0x2b17c0[_0x2a2c('0x62')]);}})[_0x2a2c('0x1f')](respondWithResult(_0x64d341,null))[_0x2a2c('0x28')](handleError(_0x64d341,null));};exports[_0x2a2c('0x67')]=function(_0x3710d5,_0x1cb252,_0x48f8b9){var _0x5c30eb={'raw':![],'where':{}};var _0x1a96fc={};var _0x1ff1c8={'count':0x0,'rows':[]};return db[_0x2a2c('0x3f')]['findOne']({'where':{'id':_0x3710d5[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x1cb252,null))[_0x2a2c('0x1f')](function(_0x500a03){if(_0x500a03){_0x1a96fc[_0x2a2c('0x44')]=_[_0x2a2c('0x57')](db[_0x2a2c('0x66')][_0x2a2c('0x40')]);_0x1a96fc[_0x2a2c('0x45')]=_['keys'](_0x3710d5[_0x2a2c('0x45')]);_0x1a96fc[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0x1a96fc['model'],_0x1a96fc[_0x2a2c('0x45')]);_0x5c30eb[_0x2a2c('0x49')]=_[_0x2a2c('0x47')](_0x1a96fc[_0x2a2c('0x44')],qs[_0x2a2c('0x48')](_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x48')]));_0x5c30eb[_0x2a2c('0x49')]=_0x5c30eb[_0x2a2c('0x49')][_0x2a2c('0x4a')]?_0x5c30eb[_0x2a2c('0x49')]:_0x1a96fc[_0x2a2c('0x44')];if(!_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x4b')]('nolimit')){_0x5c30eb[_0x2a2c('0x2d')]=qs[_0x2a2c('0x2d')](_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x2d')]);_0x5c30eb[_0x2a2c('0x2c')]=qs[_0x2a2c('0x2c')](_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x2c')]);}_0x5c30eb[_0x2a2c('0x4c')]=qs[_0x2a2c('0x4d')](_0x3710d5['query'][_0x2a2c('0x4d')]);_0x5c30eb[_0x2a2c('0x4e')]=qs[_0x2a2c('0x46')](_[_0x2a2c('0x68')](_0x3710d5['query'],_0x1a96fc[_0x2a2c('0x46')]));_0x5c30eb[_0x2a2c('0x4e')][_0x2a2c('0x65')]=_0x500a03['id'];if(_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x4f')]){_0x5c30eb[_0x2a2c('0x4e')]=_[_0x2a2c('0x50')](_0x5c30eb[_0x2a2c('0x4e')],{'$or':_[_0x2a2c('0x3e')](_0x5c30eb[_0x2a2c('0x49')],function(_0x2a0fcb){var _0x5e9b86={};_0x5e9b86[_0x2a0fcb]={'$like':'%'+_0x3710d5['query']['filter']+'%'};return _0x5e9b86;})});}_0x5c30eb=_[_0x2a2c('0x50')]({},_0x5c30eb,_0x3710d5['options']);return db['Disposition'][_0x2a2c('0x2f')]({'where':_0x5c30eb[_0x2a2c('0x4e')]})[_0x2a2c('0x1f')](function(_0xeb82fc){_0x1ff1c8[_0x2a2c('0x2f')]=_0xeb82fc;if(_0x3710d5[_0x2a2c('0x45')][_0x2a2c('0x52')]){_0x5c30eb['include']=[{'all':!![]}];}return db[_0x2a2c('0x66')]['findAll'](_0x5c30eb);})['then'](function(_0x4324ba){_0x1ff1c8[_0x2a2c('0x53')]=_0x4324ba;return _0x1ff1c8;});}})['then'](respondWithFilteredResult(_0x1cb252,_0x5c30eb))[_0x2a2c('0x28')](handleError(_0x1cb252,null));};exports[_0x2a2c('0x69')]=function(_0x4deb03,_0x2e3086,_0x5b02f8){return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x4deb03[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x2e3086,null))[_0x2a2c('0x1f')](function(_0x575611){if(_0x575611){return _0x575611[_0x2a2c('0x69')](_0x4deb03[_0x2a2c('0x45')]['ids']);}})[_0x2a2c('0x1f')](respondWithStatusCode(_0x2e3086,null))[_0x2a2c('0x28')](handleError(_0x2e3086,null));};exports[_0x2a2c('0x6a')]=function(_0x4faa30,_0x3fa311,_0x402502){if(_0x4faa30[_0x2a2c('0x62')]['id']){delete _0x4faa30[_0x2a2c('0x62')]['id'];}return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x4faa30[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x3fa311,null))[_0x2a2c('0x1f')](function(_0x1d486c){if(_0x1d486c){_0x4faa30[_0x2a2c('0x62')][_0x2a2c('0x65')]=_0x1d486c['id'];return db[_0x2a2c('0x6b')][_0x2a2c('0x5b')](_0x4faa30[_0x2a2c('0x62')]);}})[_0x2a2c('0x1f')](respondWithResult(_0x3fa311,null))[_0x2a2c('0x28')](handleError(_0x3fa311,null));};exports[_0x2a2c('0x6c')]=function(_0x183c06,_0x2644d2,_0x9de46d){var _0x1bc944={'raw':![],'where':{}};var _0x3f2e97={};var _0x48cd17={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2a2c('0x6d')]({'where':{'id':_0x183c06['params']['id']}})['then'](handleEntityNotFound(_0x2644d2,null))[_0x2a2c('0x1f')](function(_0x218cc4){if(_0x218cc4){_0x3f2e97['model']=_[_0x2a2c('0x57')](db[_0x2a2c('0x6b')]['rawAttributes']);_0x3f2e97[_0x2a2c('0x45')]=_[_0x2a2c('0x57')](_0x183c06[_0x2a2c('0x45')]);_0x3f2e97['filters']=_[_0x2a2c('0x47')](_0x3f2e97['model'],_0x3f2e97[_0x2a2c('0x45')]);_0x1bc944[_0x2a2c('0x49')]=_[_0x2a2c('0x47')](_0x3f2e97[_0x2a2c('0x44')],qs[_0x2a2c('0x48')](_0x183c06[_0x2a2c('0x45')]['fields']));_0x1bc944[_0x2a2c('0x49')]=_0x1bc944[_0x2a2c('0x49')][_0x2a2c('0x4a')]?_0x1bc944['attributes']:_0x3f2e97[_0x2a2c('0x44')];if(!_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x4b')](_0x2a2c('0x6e'))){_0x1bc944['limit']=qs[_0x2a2c('0x2d')](_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x2d')]);_0x1bc944[_0x2a2c('0x2c')]=qs[_0x2a2c('0x2c')](_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x2c')]);}_0x1bc944[_0x2a2c('0x4c')]=qs[_0x2a2c('0x4d')](_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x4d')]);_0x1bc944[_0x2a2c('0x4e')]=qs[_0x2a2c('0x46')](_[_0x2a2c('0x68')](_0x183c06['query'],_0x3f2e97['filters']));_0x1bc944[_0x2a2c('0x4e')][_0x2a2c('0x65')]=_0x218cc4['id'];if(_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x4f')]){_0x1bc944['where']=_[_0x2a2c('0x50')](_0x1bc944[_0x2a2c('0x4e')],{'$or':_[_0x2a2c('0x3e')](_0x1bc944['attributes'],function(_0xb9279d){var _0x379273={};_0x379273[_0xb9279d]={'$like':'%'+_0x183c06[_0x2a2c('0x45')][_0x2a2c('0x4f')]+'%'};return _0x379273;})});}_0x1bc944=_[_0x2a2c('0x50')]({},_0x1bc944,_0x183c06[_0x2a2c('0x59')]);return db[_0x2a2c('0x6b')][_0x2a2c('0x2f')]({'where':_0x1bc944[_0x2a2c('0x4e')]})[_0x2a2c('0x1f')](function(_0x16c599){_0x48cd17[_0x2a2c('0x2f')]=_0x16c599;if(_0x183c06['query']['includeAll']){_0x1bc944[_0x2a2c('0x58')]=[{'all':!![]}];}return db[_0x2a2c('0x6b')]['findAll'](_0x1bc944);})[_0x2a2c('0x1f')](function(_0x863a25){_0x48cd17[_0x2a2c('0x53')]=_0x863a25;return _0x48cd17;});}})[_0x2a2c('0x1f')](respondWithFilteredResult(_0x2644d2,_0x1bc944))[_0x2a2c('0x28')](handleError(_0x2644d2,null));};exports['removeAnswers']=function(_0x2c260b,_0x220740,_0x534430){return db['SmsAccount']['find']({'where':{'id':_0x2c260b['params']['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x220740,null))[_0x2a2c('0x1f')](function(_0x309651){if(_0x309651){return _0x309651[_0x2a2c('0x6f')](_0x2c260b[_0x2a2c('0x45')]['ids']);}})[_0x2a2c('0x1f')](respondWithStatusCode(_0x220740,null))[_0x2a2c('0x28')](handleError(_0x220740,null));};exports[_0x2a2c('0x70')]=function(_0x23c09f,_0x46c0c0,_0x135aaa){var _0x3b1cff={'channel':_0x2a2c('0x71')};var _0x59939c=[];var _0x1954ae=[];var _0x1e83f5={};return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x23c09f['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x2a2c('0x72')}]})['then'](handleEntityNotFound(_0x46c0c0,null))[_0x2a2c('0x1f')](function(_0x270bdd){_0x3b1cff[_0x2a2c('0x73')]=_0x270bdd;_0x3b1cff['applications']=_[_0x2a2c('0x74')](_0x270bdd[_0x2a2c('0x72')],[_0x2a2c('0x75')],[_0x2a2c('0x76')]);if(_0x3b1cff[_0x2a2c('0x73')][_0x2a2c('0x72')]){delete _0x3b1cff[_0x2a2c('0x73')][_0x2a2c('0x72')];}return db['CmContact'][_0x2a2c('0x63')]();})[_0x2a2c('0x1f')](function(_0x41741d){if(!_0x41741d){throw new db[(_0x2a2c('0x77'))][(_0x2a2c('0x78'))](_0x2a2c('0x79'));}_0x59939c=_[_0x2a2c('0x7a')](_[_0x2a2c('0x57')](_0x41741d),[_0x2a2c('0x7b'),_0x2a2c('0x7c')]);_0x1954ae=_[_0x2a2c('0x7a')](_[_0x2a2c('0x57')](_0x41741d),[_0x2a2c('0x7b'),_0x2a2c('0x7c'),_0x2a2c('0x7d'),_0x2a2c('0x7e')]);_0x3b1cff[_0x2a2c('0x62')]={'mapKey':_0x2a2c('0x7f')};if(_0x3b1cff[_0x2a2c('0x73')]['type']){switch(_0x3b1cff['account'][_0x2a2c('0x42')]){case'twilio':_0x3b1cff[_0x2a2c('0x62')]['from']=_0x23c09f[_0x2a2c('0x62')]['From'];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x80')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x81')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x82')];break;case _0x2a2c('0x83'):_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]='+'+_0x23c09f['body']['sender'];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x85')];break;case _0x2a2c('0x86'):_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x84')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x27')];break;case'clicksend':_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]=_0x23c09f['body'][_0x2a2c('0x84')];_0x3b1cff[_0x2a2c('0x62')]['body']=_0x23c09f[_0x2a2c('0x62')]['body'];_0x3b1cff[_0x2a2c('0x62')]['messageId']=_0x23c09f[_0x2a2c('0x62')]['message_id'];break;case'plivo':_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x87')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f['body'][_0x2a2c('0x88')];_0x3b1cff[_0x2a2c('0x62')]['messageId']=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x89')];break;case _0x2a2c('0x8a'):_0x3b1cff['body'][_0x2a2c('0x84')]='+'+_0x23c09f[_0x2a2c('0x62')]['results'][0x0]['from'];_0x3b1cff['body'][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x8b')][0x0]['text'];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x81')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x8b')][0x0][_0x2a2c('0x81')];break;case _0x2a2c('0x8c'):_0x3b1cff[_0x2a2c('0x62')]['from']=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x8d')];_0x3b1cff['body']['body']=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x8e')][_0x2a2c('0x27')];break;case _0x2a2c('0x8f'):_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x90')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x85')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x81')]=_0x23c09f['body'][_0x2a2c('0x91')];break;case _0x2a2c('0x92'):_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x81')]=_0x23c09f['body'][0x0][_0x2a2c('0x27')]['id'];_0x3b1cff['body'][_0x2a2c('0x84')]=_0x23c09f[_0x2a2c('0x62')][0x0][_0x2a2c('0x27')][_0x2a2c('0x84')];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][0x0]['message']['text'];break;case _0x2a2c('0x93'):_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')]=_0x23c09f[_0x2a2c('0x62')]['from'];_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x62')]=_0x23c09f[_0x2a2c('0x62')][_0x2a2c('0x27')];_0x3b1cff['body'][_0x2a2c('0x81')]=_0x23c09f['body'][_0x2a2c('0x94')];break;}}if(_0x3b1cff[_0x2a2c('0x62')]['id']){delete _0x3b1cff[_0x2a2c('0x62')]['id'];}if(_[_0x2a2c('0x95')](_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')])){throw new db[(_0x2a2c('0x77'))][(_0x2a2c('0x78'))](_0x2a2c('0x96'));}if(_[_0x2a2c('0x95')](_0x3b1cff[_0x2a2c('0x62')]['body'])||_0x3b1cff[_0x2a2c('0x62')]['body']===''){throw new db[(_0x2a2c('0x77'))][(_0x2a2c('0x78'))](_0x2a2c('0x97'));}if(_[_0x2a2c('0x95')](_0x3b1cff[_0x2a2c('0x62')]['mapKey'])){throw new db[(_0x2a2c('0x77'))]['ValidationError'](_0x2a2c('0x98')+_0x1954ae);}if(!_[_0x2a2c('0x99')](_0x1954ae,_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x9a')])){throw new db[(_0x2a2c('0x77'))]['ValidationError'](_0x2a2c('0x9b')+_0x1954ae);}_0x1e83f5[_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x9a')]]=_0x3b1cff['body'][_0x2a2c('0x84')];return db[_0x2a2c('0x9c')]['find']({'where':{'id':_0x3b1cff['account'][_0x2a2c('0x7e')]},'include':[{'model':db[_0x2a2c('0x9d')],'as':_0x2a2c('0x9e'),'where':_0x1e83f5,'limit':0x1,'order':[[_0x2a2c('0x7c'),'DESC']]}]});})[_0x2a2c('0x1f')](handleEntityNotFound(_0x46c0c0,null))[_0x2a2c('0x1f')](function(_0x3363f0){if(_0x3363f0){_0x3b1cff[_0x2a2c('0x9f')]=_[_0x2a2c('0xa0')](_0x3363f0,[_0x2a2c('0x9e')]);if(_0x3363f0[_0x2a2c('0x9e')][_0x2a2c('0x4a')]){return _0x3363f0[_0x2a2c('0x9e')][0x0];}var _0x34773e=_[_0x2a2c('0x19')](_0x3b1cff[_0x2a2c('0x62')],{'firstName':_0x3b1cff[_0x2a2c('0x62')]['from'],'ListId':_0x3363f0['id']});_0x34773e[_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x9a')]]=_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')];return db[_0x2a2c('0x9d')][_0x2a2c('0x5b')](_0x34773e,{'fields':_0x59939c,'raw':!![]});}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x46c0c0,null))[_0x2a2c('0x1f')](function(_0x41da73){if(_0x41da73){_0x3b1cff[_0x2a2c('0xa1')]=_0x41da73;var _0x397c95={'ContactId':_0x41da73['id'],'phone':_0x3b1cff[_0x2a2c('0x62')]['from'],'SmsAccountId':_0x23c09f['params']['id']};var _0x4364d8={'ContactId':_0x41da73['id'],'SmsAccountId':_0x23c09f[_0x2a2c('0x55')]['id'],'closed':![]};return db[_0x2a2c('0xa2')]['find']({'where':_0x4364d8})['then'](function(_0x35c087){if(_0x35c087){return[_0x35c087,![]];}return db[_0x2a2c('0xa2')]['create'](_0x397c95)['then'](function(_0x5dae4d){return[_0x5dae4d,!![]];});});}})[_0x2a2c('0xa3')](function(_0x3ff0a3,_0x499701){_0x3b1cff[_0x2a2c('0xa4')]=_0x3ff0a3[_0x2a2c('0x5d')]({'plain':!![]});_0x3b1cff[_0x2a2c('0xa4')][_0x2a2c('0xa5')]=![];if(_0x499701){if(_0x3b1cff[_0x2a2c('0x73')][_0x2a2c('0xa6')]){_0x3b1cff['applications'][_0x2a2c('0xa7')]({'id':0x0,'priority':_0x3b1cff['applications'][_0x2a2c('0x4a')]+0x1,'app':_0x2a2c('0xa8'),'appdata':_0x2a2c('0xa9'),'interval':'*,*,*,*'});}_0x3b1cff['interaction'][_0x2a2c('0xa5')]=!![];}return db[_0x2a2c('0xaa')][_0x2a2c('0x5b')]({'phone':_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0x84')],'messageId':_0x3b1cff[_0x2a2c('0x62')]['messageId'],'body':_0x3b1cff['body'][_0x2a2c('0x62')],'SmsAccountId':_0x23c09f['params']['id'],'SmsInteractionId':_0x3ff0a3['id'],'direction':'in','ContactId':_0x3ff0a3[_0x2a2c('0xab')],'AttachmentId':_0x3b1cff[_0x2a2c('0x62')][_0x2a2c('0xac')]});})[_0x2a2c('0x1f')](function(_0x50f361){_0x3b1cff['message']=_0x50f361;if(_0x3b1cff[_0x2a2c('0xa4')][_0x2a2c('0xad')]){return db['User'][_0x2a2c('0x5a')]({'attributes':['id',_0x2a2c('0x3b')],'where':{'id':_0x3b1cff['interaction'][_0x2a2c('0xad')]}})[_0x2a2c('0x1f')](function(_0xc2d73d){if(_0xc2d73d){_0x3b1cff[_0x2a2c('0xae')][_0x2a2c('0xaf')]({'id':0x0,'priority':0x0,'app':_0x2a2c('0xb0'),'appdata':_0xc2d73d['name']+','+(_0x3b1cff[_0x2a2c('0x73')][_0x2a2c('0xb1')]||0xa),'interval':_0x2a2c('0xb2')});}return respondWithRpcPromise('Start',_0x2a2c('0xb3'),_0x3b1cff);});}return respondWithRpcPromise('Start',_0x2a2c('0xb3'),_0x3b1cff);})['then'](function(_0x1c7c3b){if(_0x1c7c3b){var _0x4f9658=0xc8;var _0x2c4567=_0x2a2c('0xb4');logger[_0x2a2c('0x20')](_0x2a2c('0xb5'),_0x2c4567,_0x4f9658,_0x2a2c('0xb6'));logger[_0x2a2c('0x22')](_0x2a2c('0xb7'),_0x2c4567,_0x4f9658,_0x2a2c('0xb6'),JSON[_0x2a2c('0x24')](_0x1c7c3b));if(_0x3b1cff[_0x2a2c('0x73')][_0x2a2c('0x42')]===_0x2a2c('0xb8')){return _0x46c0c0['status'](_0x4f9658)['set'](_0x2a2c('0xb9'),_0x2a2c('0xba'))[_0x2a2c('0x3c')](_0x2a2c('0xbb'));}else{return _0x46c0c0[_0x2a2c('0x2a')](_0x4f9658)['json'](_0x1c7c3b);}}})[_0x2a2c('0x28')](handleError(_0x46c0c0,null));};exports[_0x2a2c('0xbc')]=function(_0x131a5f,_0x51d34a){var _0x38a216=_0x131a5f[_0x2a2c('0x55')]['id'];var _0x20a63c=_0x131a5f[_0x2a2c('0x62')];var _0x1aebda=0xc8;var _0x3af0c5=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2a2c('0xbd')][_0x2a2c('0xbe')][_0x2a2c('0xbf')]['READ_COMMITTED']},function(_0x1e2f63){return db[_0x2a2c('0x3f')][_0x2a2c('0x6d')]({'where':{'id':_0x38a216},'transaction':_0x1e2f63})[_0x2a2c('0x1f')](function(_0x3e626b){if(_0x3e626b){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x38a216},'transaction':_0x1e2f63})['then'](function(){var _0x52a82d=_[_0x2a2c('0x3e')](_0x20a63c,function(_0x4b371e){_0x4b371e[_0x2a2c('0x65')]=_0x38a216;return _0x4b371e;});return db[_0x2a2c('0xc0')][_0x2a2c('0xc1')](_0x52a82d,{'transaction':_0x1e2f63});});}else{_0x1aebda=0x194;_0x3af0c5=[];}});})['then'](function(){if(_0x1aebda!==0x194){return db[_0x2a2c('0xc0')][_0x2a2c('0xc2')]({'where':{'SmsAccountId':_0x38a216},'order':_0x2a2c('0x75')})['then'](function(_0x5d5b96){_0x3af0c5=_0x5d5b96;});}})[_0x2a2c('0x28')](function(_0x27e629){_0x1aebda=0x1f4;logger[_0x2a2c('0x25')](_0x27e629[_0x2a2c('0x3a')]);if(_0x27e629['name']){delete _0x27e629[_0x2a2c('0x3b')];}_0x3af0c5=_0x27e629;})[_0x2a2c('0xc3')](function(){if(_0x3af0c5===null){_0x51d34a[_0x2a2c('0x29')](_0x1aebda);}else{if(_0x1aebda===0x1f4){_0x51d34a['status'](_0x1aebda)[_0x2a2c('0x3c')](_0x3af0c5);}else{_0x51d34a[_0x2a2c('0x2a')](_0x1aebda)['json'](_0x3af0c5);}}});};exports[_0x2a2c('0xc4')]=function(_0x5a7c15,_0x9ab070,_0x49d91f){var _0x5217d2={};var _0xc84d8a={};var _0x30c363;var _0x37af5a;return db[_0x2a2c('0x3f')]['findOne']({'where':{'id':_0x5a7c15[_0x2a2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x9ab070,null))[_0x2a2c('0x1f')](function(_0x137d12){if(_0x137d12){_0x30c363=_0x137d12;_0xc84d8a[_0x2a2c('0x44')]=_[_0x2a2c('0x57')](db[_0x2a2c('0xc0')][_0x2a2c('0x40')]);_0xc84d8a['query']=_['keys'](_0x5a7c15[_0x2a2c('0x45')]);_0xc84d8a[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0xc84d8a[_0x2a2c('0x44')],_0xc84d8a[_0x2a2c('0x45')]);_0x5217d2[_0x2a2c('0x49')]=_['intersection'](_0xc84d8a[_0x2a2c('0x44')],qs[_0x2a2c('0x48')](_0x5a7c15[_0x2a2c('0x45')][_0x2a2c('0x48')]));_0x5217d2['attributes']=_0x5217d2['attributes'][_0x2a2c('0x4a')]?_0x5217d2['attributes']:_0xc84d8a['model'];_0x5217d2[_0x2a2c('0x4c')]=qs[_0x2a2c('0x4d')](_0x5a7c15[_0x2a2c('0x45')]['sort']);_0x5217d2[_0x2a2c('0x4e')]=qs['filters'](_['pick'](_0x5a7c15[_0x2a2c('0x45')],_0xc84d8a[_0x2a2c('0x46')]));if(_0x5a7c15['query'][_0x2a2c('0x4f')]){_0x5217d2[_0x2a2c('0x4e')]=_['merge'](_0x5217d2[_0x2a2c('0x4e')],{'$or':_[_0x2a2c('0x3e')](_0x5217d2['attributes'],function(_0x1fbfb1){var _0x4069e3={};_0x4069e3[_0x1fbfb1]={'$like':'%'+_0x5a7c15['query']['filter']+'%'};return _0x4069e3;})});}_0x5217d2=_[_0x2a2c('0x50')]({},_0x5217d2,_0x5a7c15['options']);return _0x30c363[_0x2a2c('0xc4')](_0x5217d2);}})[_0x2a2c('0x1f')](function(_0x2a3c33){if(_0x2a3c33){_0x37af5a=_0x2a3c33['length'];if(!_0x5a7c15['query'][_0x2a2c('0x4b')]('nolimit')){_0x5217d2[_0x2a2c('0x2d')]=qs[_0x2a2c('0x2d')](_0x5a7c15['query'][_0x2a2c('0x2d')]);_0x5217d2[_0x2a2c('0x2c')]=qs[_0x2a2c('0x2c')](_0x5a7c15[_0x2a2c('0x45')]['offset']);}return _0x30c363['getApplications'](_0x5217d2);}})[_0x2a2c('0x1f')](function(_0x66628b){if(_0x66628b){return _0x66628b?{'count':_0x37af5a,'rows':_0x66628b}:null;}})['then'](respondWithResult(_0x9ab070,null))[_0x2a2c('0x28')](handleError(_0x9ab070,null));};exports[_0x2a2c('0xc5')]=function(_0x5c3746,_0x5c4d76,_0x1bf9da){var _0x3bbb0d={'raw':![],'where':{}};var _0x47f87e={};var _0x5ad974={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2a2c('0x6d')]({'where':{'id':_0x5c3746[_0x2a2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c4d76,null))[_0x2a2c('0x1f')](function(_0x5cc2fe){if(_0x5cc2fe){_0x47f87e[_0x2a2c('0x44')]=_[_0x2a2c('0x57')](db['SmsInteraction']['rawAttributes']);_0x47f87e['query']=_[_0x2a2c('0x57')](_0x5c3746[_0x2a2c('0x45')]);_0x47f87e[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0x47f87e[_0x2a2c('0x44')],_0x47f87e[_0x2a2c('0x45')]);_0x3bbb0d[_0x2a2c('0x49')]=_['intersection'](_0x47f87e['model'],qs[_0x2a2c('0x48')](_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x48')]));_0x3bbb0d[_0x2a2c('0x49')]=_0x3bbb0d[_0x2a2c('0x49')]['length']?_0x3bbb0d['attributes']:_0x47f87e['model'];if(!_0x5c3746['query'][_0x2a2c('0x4b')](_0x2a2c('0x6e'))){_0x3bbb0d[_0x2a2c('0x2d')]=qs[_0x2a2c('0x2d')](_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x2d')]);_0x3bbb0d[_0x2a2c('0x2c')]=qs['offset'](_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x2c')]);}_0x3bbb0d['order']=qs[_0x2a2c('0x4d')](_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x4d')]);_0x3bbb0d[_0x2a2c('0x4e')]=qs[_0x2a2c('0x46')](_[_0x2a2c('0x68')](_0x5c3746[_0x2a2c('0x45')],_0x47f87e[_0x2a2c('0x46')]));_0x3bbb0d[_0x2a2c('0x4e')][_0x2a2c('0x65')]=_0x5cc2fe['id'];if(_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x4f')]){_0x3bbb0d['where']=_[_0x2a2c('0x50')](_0x3bbb0d[_0x2a2c('0x4e')],{'$or':_[_0x2a2c('0x3e')](_0x3bbb0d[_0x2a2c('0x49')],function(_0x1ee09f){var _0x4b4d1c={};_0x4b4d1c[_0x1ee09f]={'$like':'%'+_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x4f')]+'%'};return _0x4b4d1c;})});}_0x3bbb0d=_['merge']({},_0x3bbb0d,_0x5c3746[_0x2a2c('0x59')]);return db[_0x2a2c('0xa2')][_0x2a2c('0x2f')]({'where':_0x3bbb0d[_0x2a2c('0x4e')]})[_0x2a2c('0x1f')](function(_0x55f76b){_0x5ad974[_0x2a2c('0x2f')]=_0x55f76b;if(_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0x52')]){_0x3bbb0d['include']=[{'model':db[_0x2a2c('0x9d')],'as':_0x2a2c('0xc6'),'required':![]},{'model':db[_0x2a2c('0xc7')],'as':'Owner','attributes':[_0x2a2c('0x3b'),_0x2a2c('0xc8'),_0x2a2c('0xc9')],'required':![]},{'model':db[_0x2a2c('0xca')],'as':_0x2a2c('0xcb'),'attributes':['id','name',_0x2a2c('0xcc')],'where':_0x5c3746['query'][_0x2a2c('0xcd')]?{'id':_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0xcd')]}:undefined,'required':_0x5c3746[_0x2a2c('0x45')][_0x2a2c('0xcd')]?!![]:![]}];}return db[_0x2a2c('0xa2')]['findAll'](_0x3bbb0d);})[_0x2a2c('0x1f')](function(_0x18ff76){_0x5ad974['rows']=_0x18ff76;return _0x5ad974;});}})[_0x2a2c('0x1f')](respondWithFilteredResult(_0x5c4d76,_0x3bbb0d))[_0x2a2c('0x28')](handleError(_0x5c4d76,null));};exports[_0x2a2c('0x3c')]=function(_0x2fba22,_0x1017c6,_0x162fd2){var _0x5bf28a,_0x430760,_0x313715;if(_[_0x2a2c('0x95')](_0x2fba22['body'][_0x2a2c('0x62')])||_0x2fba22[_0x2a2c('0x62')]['body']===''){throw new db['Sequelize'][(_0x2a2c('0x78'))](_0x2a2c('0x97'));}if(_[_0x2a2c('0x95')](_0x2fba22[_0x2a2c('0x62')]['to'])){throw new db['Sequelize'][(_0x2a2c('0x78'))](_0x2a2c('0xce'));}_0x5bf28a=_0x2fba22['body']['to'];return db[_0x2a2c('0x3f')]['find']({'where':{'id':_0x2fba22[_0x2a2c('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x2a2c('0xcf'),'include':[{'model':db['CmContact'],'as':_0x2a2c('0x9e'),'where':{'mobile':_0x5bf28a},'limit':0x1,'order':[[_0x2a2c('0x7c'),_0x2a2c('0xd0')]]}]}]})[_0x2a2c('0x1f')](handleEntityNotFound(_0x1017c6,null))[_0x2a2c('0x1f')](function(_0x2f9ca4){if(_0x2f9ca4&&_0x2f9ca4[_0x2a2c('0xcf')]){_0x430760=_0x2f9ca4['get']({'plain':!![]});if(_0x430760[_0x2a2c('0xcf')]&&_0x430760['List'][_0x2a2c('0x9e')][_0x2a2c('0x4a')]){return _0x430760['List'][_0x2a2c('0x9e')][0x0];}return db[_0x2a2c('0x9d')][_0x2a2c('0x5b')](_['defaults'](_0x2fba22['body'],{'firstName':_0x5bf28a,'mobile':_0x5bf28a,'phone':_0x5bf28a,'ListId':_0x430760[_0x2a2c('0x7e')]}));}})['then'](handleEntityNotFound(_0x1017c6,null))[_0x2a2c('0x1f')](function(_0x5ef165){if(_0x5ef165){_0x313715=_0x5ef165;return db[_0x2a2c('0xa2')][_0x2a2c('0x5a')]({'where':{'ContactId':_0x313715['id'],'closed':![],'SmsAccountId':_0x430760['id']}})[_0x2a2c('0x1f')](function(_0x2954af){if(_0x2954af){return[_0x2954af,![]];}return db['SmsInteraction'][_0x2a2c('0x5b')]({'UserId':_0x2fba22[_0x2a2c('0x5c')]['id'],'ContactId':_0x313715['id'],'SmsAccountId':_0x430760['id'],'phone':_0x5bf28a,'firstMsgDirection':_0x2a2c('0xd1'),'Messages':[_['merge'](_0x2fba22[_0x2a2c('0x62')],{'read':![],'body':_0x2fba22[_0x2a2c('0x62')][_0x2a2c('0x62')],'phone':_0x5bf28a,'SmsAccountId':_0x430760['id'],'UserId':_0x2fba22[_0x2a2c('0x5c')]['id'],'ContactId':_0x313715['id']})]},{'include':[{'model':db[_0x2a2c('0xaa')],'as':_0x2a2c('0xd2')}]})[_0x2a2c('0x1f')](function(_0x5b8016){return[_0x5b8016,!![]];});});}})[_0x2a2c('0xa3')](function(_0x32b564,_0x2fc769){if(_0x2fc769){return _0x32b564;}return db['SmsMessage'][_0x2a2c('0x5b')](_[_0x2a2c('0x50')](_0x2fba22[_0x2a2c('0x62')],{'read':![],'body':_0x2fba22[_0x2a2c('0x62')][_0x2a2c('0x62')],'phone':_0x5bf28a,'SmsAccountId':_0x430760['id'],'SmsInteractionId':_0x32b564['id'],'UserId':_0x2fba22[_0x2a2c('0x5c')]['id'],'ContactId':_0x313715['id']}))[_0x2a2c('0x1f')](function(_0x34c8bd){_0x32b564[_0x2a2c('0xd3')][_0x2a2c('0xd2')]=[];_0x32b564[_0x2a2c('0xd3')]['Messages'][_0x2a2c('0xa7')](_0x34c8bd[_0x2a2c('0xd3')]);return _0x32b564;});})[_0x2a2c('0x1f')](respondWithResult(_0x1017c6,null))[_0x2a2c('0x28')](handleError(_0x1017c6,null));};exports['status']=function(_0x388400,_0xfc8b84,_0x235588){if(_0x388400['body']['id']){delete _0x388400['body']['id'];}var _0x3a8ade,_0x3cf30b,_0x3b3ee7;return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x388400[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0xfc8b84,null))[_0x2a2c('0x1f')](function(_0x5191f6){if(_0x5191f6){_0x3b3ee7=_0x5191f6;logger[_0x2a2c('0x22')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0xd4'),_0x5191f6['type'],util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));switch(_0x5191f6[_0x2a2c('0x42')]){case'skebby':if(_0x388400[_0x2a2c('0x62')][_0x2a2c('0xd6')]&&_0x388400[_0x2a2c('0x62')]['status']){_0x3cf30b=_0x388400[_0x2a2c('0x62')]['status'];return db[_0x2a2c('0xaa')][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400[_0x2a2c('0x62')][_0x2a2c('0xd6')]}});}break;case'connectel':if(_0x388400['body'][_0x2a2c('0xd7')]&&_0x388400[_0x2a2c('0x62')][_0x2a2c('0xd8')]){_0x3cf30b=_0x388400['body']['statusInt'];return db[_0x2a2c('0xaa')][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400[_0x2a2c('0x62')][_0x2a2c('0xd7')]}});}break;case _0x2a2c('0xd9'):if(_0x388400[_0x2a2c('0x62')]['message_id']&&_0x388400[_0x2a2c('0x62')][_0x2a2c('0xda')]){_0x3cf30b=_0x388400[_0x2a2c('0x62')]['status_code'];return db[_0x2a2c('0xaa')][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400['body']['message_id']}});}break;case'infobip':var _0x1ecca6=_0x388400[_0x2a2c('0x62')][_0x2a2c('0x8b')][0x0];if(_0x1ecca6[_0x2a2c('0x81')]&&_0x1ecca6[_0x2a2c('0x2a')][_0x2a2c('0xdb')]===_0x2a2c('0xdc')){_0x3cf30b=_0x1ecca6[_0x2a2c('0x2a')][_0x2a2c('0xdb')];return db[_0x2a2c('0xaa')][_0x2a2c('0x5a')]({'where':{'messageId':_0x1ecca6[_0x2a2c('0x81')]}});}break;case _0x2a2c('0x8f'):if(_0x388400['body']['messageId']&&_0x388400[_0x2a2c('0x62')][_0x2a2c('0x2a')]){_0x3cf30b=_0x388400[_0x2a2c('0x62')][_0x2a2c('0x2a')];return db['SmsMessage'][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400['body']['messageId']}});}break;case _0x2a2c('0x92'):if(_0x388400['body'][0x0][_0x2a2c('0x27')]['id']){_0x3cf30b=_0x388400['body'][0x0][_0x2a2c('0x42')];return db[_0x2a2c('0xaa')][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400[_0x2a2c('0x62')][0x0][_0x2a2c('0x27')]['id']}});}break;case _0x2a2c('0x93'):if(_0x388400[_0x2a2c('0x62')][_0x2a2c('0xdd')]&&_0x388400[_0x2a2c('0x62')][_0x2a2c('0x2a')]){_0x3cf30b=_0x388400[_0x2a2c('0x62')][_0x2a2c('0x2a')];return db['SmsMessage'][_0x2a2c('0x5a')]({'where':{'messageId':_0x388400[_0x2a2c('0x62')][_0x2a2c('0xdd')]}});}break;}}})[_0x2a2c('0x1f')](handleEntityNotFound(_0xfc8b84,null))[_0x2a2c('0x1f')](function(_0x508376){if(_0x508376){_0x3a8ade=_0x508376;switch(_0x3b3ee7[_0x2a2c('0x42')]){case _0x2a2c('0x83'):if(_0x3cf30b==='DELIVERED'){return _0x3a8ade[_0x2a2c('0x35')]({'read':!![]});}else{logger[_0x2a2c('0x25')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),'skebby',util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a2c('0x86'):if(_0x3cf30b==='1'){return _0x3a8ade['update']({'read':!![]});}else{logger['error'](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0x83'),util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a2c('0xd9'):if(!_0x388400[_0x2a2c('0x62')][_0x2a2c('0xde')]&&_0x3cf30b>=0xc8&&_0x3cf30b<=0xce){return _0x3a8ade[_0x2a2c('0x35')]({'read':!![]});}else{logger[_0x2a2c('0x25')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),'clicksend',util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a2c('0x8a'):var _0xe57dbc=_0x388400[_0x2a2c('0x62')][_0x2a2c('0x8b')][0x0];if(_0xe57dbc['status']['groupName']==='DELIVERED'){return _0x3a8ade['update']({'read':!![]});}else{logger[_0x2a2c('0x25')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0x8a'),util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a2c('0x8f'):if(_0x3cf30b==_0x2a2c('0xdf')||_0x3cf30b==_0x2a2c('0xe0')){return _0x3a8ade[_0x2a2c('0x35')]({'read':!![]});}else{logger[_0x2a2c('0x25')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0x8f'),util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3cf30b==_0x2a2c('0xe1')){return _0x3a8ade[_0x2a2c('0x35')]({'read':!![]});}else{logger[_0x2a2c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2a2c('0x92'),util[_0x2a2c('0xd5')](_0x388400[_0x2a2c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a2c('0x93'):if(_0x3cf30b===_0x2a2c('0xe2')||_0x3cf30b==='ACCEPTD'){return _0x3a8ade[_0x2a2c('0x35')]({'read':!![]});}else{logger[_0x2a2c('0x25')](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0x93'),util['inspect'](_0x388400['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a8ade;}})[_0x2a2c('0x1f')](respondWithResult(_0xfc8b84,null))[_0x2a2c('0x28')](handleError(_0xfc8b84,null));};exports[_0x2a2c('0xe3')]=function(_0x49c8f3,_0x16ba81,_0x4d7230){var _0x414108,_0x5cccc3,_0x343989;return db['SmsAccount']['find']({'where':{'id':_0x49c8f3[_0x2a2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x16ba81,null))['then'](function(_0x553bfb){if(_0x553bfb){_0x343989=_0x553bfb;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a2c('0x2a'),_0x2a2c('0xd4'),_0x553bfb[_0x2a2c('0x42')],util[_0x2a2c('0xd5')](_0x49c8f3['query'],{'showHidden':![],'depth':null}));switch(_0x553bfb['type']){case _0x2a2c('0x8c'):if(_0x49c8f3[_0x2a2c('0x45')][_0x2a2c('0xe4')]&&_0x49c8f3['query'][_0x2a2c('0xe5')]){_0x5cccc3=_0x49c8f3[_0x2a2c('0x45')][_0x2a2c('0xe5')];return db['SmsMessage']['find']({'where':{'messageId':_0x49c8f3[_0x2a2c('0x45')]['message-id']}});}break;}}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x16ba81,null))[_0x2a2c('0x1f')](function(_0x426128){if(_0x426128){_0x414108=_0x426128;switch(_0x343989[_0x2a2c('0x42')]){case'csc':if(_0x5cccc3==='2'||_0x5cccc3==='6'){return _0x414108[_0x2a2c('0x35')]({'read':!![]});}else{logger['error'](_0x2a2c('0xb5'),_0x2a2c('0x2a'),_0x2a2c('0x8c'),util[_0x2a2c('0xd5')](_0x49c8f3[_0x2a2c('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x414108;}})[_0x2a2c('0x1f')](respondWithResult(_0x16ba81,null))[_0x2a2c('0x28')](handleError(_0x16ba81,null));};exports[_0x2a2c('0xe6')]=function(_0x935fbc,_0x2ac86c,_0x6b0061){return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x935fbc[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x2ac86c,null))[_0x2a2c('0x1f')](function(_0x144f82){if(_0x144f82){return _0x144f82[_0x2a2c('0xe6')](_0x935fbc[_0x2a2c('0x62')]['ids'],_[_0x2a2c('0xa0')](_0x935fbc[_0x2a2c('0x62')],['ids','id'])||{})[_0x2a2c('0xa3')](function(_0x50367b){for(var _0x1432bc=0x0;_0x1432bc<_0x935fbc[_0x2a2c('0x62')][_0x2a2c('0xe7')][_0x2a2c('0x4a')];_0x1432bc+=0x1){socket[_0x2a2c('0xe8')](_0x2a2c('0xe9'),{'UserId':Number(_0x935fbc[_0x2a2c('0x62')]['ids'][_0x1432bc]),'SmsAccountId':Number(_0x935fbc[_0x2a2c('0x55')]['id'])});}return _0x50367b;});}})[_0x2a2c('0x1f')](respondWithResult(_0x2ac86c,null))[_0x2a2c('0x28')](handleError(_0x2ac86c,null));};exports[_0x2a2c('0xea')]=function(_0x47ef05,_0x26c1de,_0x142216){return db[_0x2a2c('0x3f')][_0x2a2c('0x5a')]({'where':{'id':_0x47ef05[_0x2a2c('0x55')]['id']}})[_0x2a2c('0x1f')](handleEntityNotFound(_0x26c1de,null))[_0x2a2c('0x1f')](function(_0x400ae5){if(_0x400ae5){return _0x400ae5[_0x2a2c('0xea')](_0x47ef05['query'][_0x2a2c('0xe7')])[_0x2a2c('0x1f')](function(){if(_[_0x2a2c('0xeb')](_0x47ef05['query'][_0x2a2c('0xe7')])){for(var _0x3dbd43=0x0;_0x3dbd43<_0x47ef05[_0x2a2c('0x45')][_0x2a2c('0xe7')][_0x2a2c('0x4a')];_0x3dbd43+=0x1){socket[_0x2a2c('0xe8')](_0x2a2c('0xec'),{'UserId':Number(_0x47ef05[_0x2a2c('0x45')]['ids'][_0x3dbd43]),'SmsAccountId':Number(_0x47ef05[_0x2a2c('0x55')]['id'])});}}else{socket[_0x2a2c('0xe8')](_0x2a2c('0xec'),{'UserId':Number(_0x47ef05[_0x2a2c('0x45')][_0x2a2c('0xe7')]),'SmsAccountId':Number(_0x47ef05['params']['id'])});}});}})['then'](respondWithStatusCode(_0x26c1de,null))[_0x2a2c('0x28')](handleError(_0x26c1de,null));};exports[_0x2a2c('0xed')]=function(_0x4ed499,_0x32106e,_0x510618){var _0x3be89f={};var _0x19b089={};var _0x5b3f67;var _0x1f37ac;return db[_0x2a2c('0x3f')][_0x2a2c('0x6d')]({'where':{'id':_0x4ed499[_0x2a2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x32106e,null))[_0x2a2c('0x1f')](function(_0x19e5fd){if(_0x19e5fd){_0x5b3f67=_0x19e5fd;_0x19b089['model']=_[_0x2a2c('0x57')](db[_0x2a2c('0xc7')][_0x2a2c('0x40')]);_0x19b089[_0x2a2c('0x45')]=_[_0x2a2c('0x57')](_0x4ed499[_0x2a2c('0x45')]);_0x19b089[_0x2a2c('0x46')]=_[_0x2a2c('0x47')](_0x19b089['model'],_0x19b089[_0x2a2c('0x45')]);_0x3be89f[_0x2a2c('0x49')]=_['intersection'](_0x19b089['model'],qs[_0x2a2c('0x48')](_0x4ed499[_0x2a2c('0x45')][_0x2a2c('0x48')]));_0x3be89f[_0x2a2c('0x49')]=_0x3be89f[_0x2a2c('0x49')]['length']?_0x3be89f[_0x2a2c('0x49')]:_0x19b089['model'];_0x3be89f['order']=qs[_0x2a2c('0x4d')](_0x4ed499[_0x2a2c('0x45')]['sort']);_0x3be89f[_0x2a2c('0x4e')]=qs[_0x2a2c('0x46')](_[_0x2a2c('0x68')](_0x4ed499['query'],_0x19b089[_0x2a2c('0x46')]));if(_0x4ed499['query'][_0x2a2c('0x4f')]){_0x3be89f[_0x2a2c('0x4e')]=_[_0x2a2c('0x50')](_0x3be89f[_0x2a2c('0x4e')],{'$or':_['map'](_0x3be89f['attributes'],function(_0x398897){var _0x4cda9e={};_0x4cda9e[_0x398897]={'$like':'%'+_0x4ed499[_0x2a2c('0x45')]['filter']+'%'};return _0x4cda9e;})});}_0x3be89f=_[_0x2a2c('0x50')]({},_0x3be89f,_0x4ed499['options']);return _0x5b3f67[_0x2a2c('0xed')](_0x3be89f);}})['then'](function(_0x2bdcf9){if(_0x2bdcf9){_0x1f37ac=_0x2bdcf9[_0x2a2c('0x4a')];if(!_0x4ed499['query'][_0x2a2c('0x4b')](_0x2a2c('0x6e'))){_0x3be89f['limit']=qs[_0x2a2c('0x2d')](_0x4ed499[_0x2a2c('0x45')][_0x2a2c('0x2d')]);_0x3be89f[_0x2a2c('0x2c')]=qs[_0x2a2c('0x2c')](_0x4ed499[_0x2a2c('0x45')][_0x2a2c('0x2c')]);}return _0x5b3f67['getAgents'](_0x3be89f);}})[_0x2a2c('0x1f')](function(_0xd3de1b){if(_0xd3de1b){return _0xd3de1b?{'count':_0x1f37ac,'rows':_0xd3de1b}:null;}})['then'](respondWithResult(_0x32106e,null))[_0x2a2c('0x28')](handleError(_0x32106e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 71b8215..f2948b1 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 _0x0f03=['hasOwnProperty','hook','events','SmsAccount','save','update','emit'];(function(_0x38dfa8,_0x4ddb0f){var _0x585fcc=function(_0x202e11){while(--_0x202e11){_0x38dfa8['push'](_0x38dfa8['shift']());}};_0x585fcc(++_0x4ddb0f);}(_0x0f03,0xdb));var _0x30f0=function(_0x2842cd,_0x311d01){_0x2842cd=_0x2842cd-0x0;var _0x5bfe3b=_0x0f03[_0x2842cd];return _0x5bfe3b;};'use strict';var EventEmitter=require(_0x30f0('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x30f0('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x30f0('0x2'),'afterUpdate':_0x30f0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x526df7){return function(_0x349b10,_0x58e8d8,_0x566bc6){SmsAccountEvents[_0x30f0('0x4')](_0x526df7+':'+_0x349b10['id'],_0x349b10);SmsAccountEvents[_0x30f0('0x4')](_0x526df7,_0x349b10);_0x566bc6(null);};}for(var e in events){if(events[_0x30f0('0x5')](e)){var event=events[e];SmsAccount[_0x30f0('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x3f11=['SmsAccount','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3f11,0x16e));var _0x13f1=function(_0x4411e3,_0x5062e5){_0x4411e3=_0x4411e3-0x0;var _0x4b11c3=_0x3f11[_0x4411e3];return _0x4b11c3;};'use strict';var EventEmitter=require(_0x13f1('0x0'));var SmsAccount=require(_0x13f1('0x1'))['db'][_0x13f1('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x13f1('0x3')](0x0);var events={'afterCreate':_0x13f1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x243c1c){return function(_0x432414,_0x1cfe7f,_0x5de043){SmsAccountEvents['emit'](_0x243c1c+':'+_0x432414['id'],_0x432414);SmsAccountEvents[_0x13f1('0x5')](_0x243c1c,_0x432414);_0x5de043(null);};}for(var e in events){if(events[_0x13f1('0x6')](e)){var event=events[e];SmsAccount[_0x13f1('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 efed010..3262f5c 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 _0xf08c=['sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x27e1d5,_0x1ea0cf){var _0x2ccfbc=function(_0x2125b3){while(--_0x2125b3){_0x27e1d5['push'](_0x27e1d5['shift']());}};_0x2ccfbc(++_0x1ea0cf);}(_0xf08c,0xb5));var _0xcf08=function(_0x10444f,_0x418bb7){_0x10444f=_0x10444f-0x0;var _0x3722cd=_0xf08c[_0x10444f];return _0x3722cd;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var logger=require(_0xcf08('0x2'))('api');var moment=require(_0xcf08('0x3'));var BPromise=require(_0xcf08('0x4'));var rp=require(_0xcf08('0x5'));var fs=require('fs');var path=require(_0xcf08('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf08('0x7'));module[_0xcf08('0x8')]=function(_0x5f1020,_0x346b93){return _0x5f1020[_0xcf08('0x9')](_0xcf08('0xa'),attributes,{'tableName':_0xcf08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8358=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash'];(function(_0x2d5239,_0x21dfeb){var _0xff776d=function(_0x1c8d47){while(--_0x1c8d47){_0x2d5239['push'](_0x2d5239['shift']());}};_0xff776d(++_0x21dfeb);}(_0x8358,0x1eb));var _0x8835=function(_0x1e599e,_0xb41ef){_0x1e599e=_0x1e599e-0x0;var _0x1d7798=_0x8358[_0x1e599e];return _0x1d7798;};'use strict';var _=require(_0x8835('0x0'));var util=require('util');var logger=require(_0x8835('0x1'))(_0x8835('0x2'));var moment=require(_0x8835('0x3'));var BPromise=require(_0x8835('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8835('0x5'));var rimraf=require(_0x8835('0x6'));var config=require(_0x8835('0x7'));var attributes=require('./smsAccount.attributes');module[_0x8835('0x8')]=function(_0x33eb29,_0x26dfac){return _0x33eb29[_0x8835('0x9')](_0x8835('0xa'),attributes,{'tableName':_0x8835('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index c34ebd9..bed8f84 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 _0x6312=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','lodash'];(function(_0x5384ae,_0x32e603){var _0x4bcf2d=function(_0x5c8e1b){while(--_0x5c8e1b){_0x5384ae['push'](_0x5384ae['shift']());}};_0x4bcf2d(++_0x32e603);}(_0x6312,0x71));var _0x2631=function(_0x34aaef,_0x2bbc2a){_0x34aaef=_0x34aaef-0x0;var _0x582365=_0x6312[_0x34aaef];return _0x582365;};'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('../../config/utils');var logger=require(_0x2631('0x7'))(_0x2631('0x8'));var config=require('../../config/environment');var jayson=require(_0x2631('0x9'));var client=jayson[_0x2631('0xa')][_0x2631('0xb')]({'port':0x232a});config[_0x2631('0xc')]=_[_0x2631('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2631('0xe'))(new Redis(config[_0x2631('0xc')]));require(_0x2631('0xf'))['register'](socket);function respondWithRpcPromise(_0x45b7dd,_0x4f70e6,_0x2db298){return new BPromise(function(_0x536b5b,_0x2a718b){return client['request'](_0x45b7dd,_0x2db298)[_0x2631('0x10')](function(_0x2ba8d9){logger[_0x2631('0x11')]('SmsAccount,\x20%s,\x20%s',_0x4f70e6,_0x2631('0x12'));logger[_0x2631('0x13')](_0x2631('0x14'),_0x4f70e6,_0x2631('0x12'),JSON[_0x2631('0x15')](_0x2ba8d9));if(_0x2ba8d9[_0x2631('0x16')]){if(_0x2ba8d9['error'][_0x2631('0x17')]===0x1f4){logger['error'](_0x2631('0x18'),_0x4f70e6,_0x2ba8d9[_0x2631('0x16')][_0x2631('0x19')]);return _0x2a718b(_0x2ba8d9['error']['message']);}logger[_0x2631('0x16')](_0x2631('0x18'),_0x4f70e6,_0x2ba8d9[_0x2631('0x16')][_0x2631('0x19')]);return _0x536b5b(_0x2ba8d9[_0x2631('0x16')][_0x2631('0x19')]);}else{logger[_0x2631('0x11')](_0x2631('0x18'),_0x4f70e6,_0x2631('0x12'));_0x536b5b(_0x2ba8d9[_0x2631('0x1a')][_0x2631('0x19')]);}})[_0x2631('0x1b')](function(_0x544558){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4f70e6,_0x544558);_0x2a718b(_0x544558);});});}exports[_0x2631('0x1c')]=function(_0x1f9570){var _0x14edc1=this;return new Promise(function(_0x1f7cf5,_0x1b8e92){return db[_0x2631('0x1d')][_0x2631('0x1e')]({'raw':_0x1f9570[_0x2631('0x1f')]?_0x1f9570['options'][_0x2631('0x20')]===undefined?!![]:![]:!![],'where':_0x1f9570[_0x2631('0x1f')]?_0x1f9570[_0x2631('0x1f')][_0x2631('0x21')]||null:null,'attributes':_0x1f9570[_0x2631('0x1f')]?_0x1f9570[_0x2631('0x1f')]['attributes']||null:null,'include':_0x1f9570[_0x2631('0x1f')]?_0x1f9570['options'][_0x2631('0x22')]?_[_0x2631('0x23')](_0x1f9570[_0x2631('0x1f')][_0x2631('0x22')],function(_0x16df81){return{'model':db[_0x16df81[_0x2631('0x24')]],'as':_0x16df81['as'],'attributes':_0x16df81[_0x2631('0x25')],'include':_0x16df81[_0x2631('0x22')]?_[_0x2631('0x23')](_0x16df81[_0x2631('0x22')],function(_0x164b1b){return{'model':db[_0x164b1b[_0x2631('0x24')]],'as':_0x164b1b['as'],'attributes':_0x164b1b['attributes'],'include':_0x164b1b[_0x2631('0x22')]?_[_0x2631('0x23')](_0x164b1b[_0x2631('0x22')],function(_0x566f18){return{'model':db[_0x566f18[_0x2631('0x24')]],'as':_0x566f18['as'],'attributes':_0x566f18[_0x2631('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x327cc9){logger[_0x2631('0x11')](_0x2631('0x1c'),_0x1f9570);logger[_0x2631('0x13')](_0x2631('0x1c'),_0x1f9570,JSON['stringify'](_0x327cc9));_0x1f7cf5(_0x327cc9);})[_0x2631('0x1b')](function(_0x35b0ce){logger[_0x2631('0x16')]('ShowSmsAccount',_0x35b0ce[_0x2631('0x19')],_0x1f9570);_0x1b8e92(_0x14edc1['error'](0x1f4,_0x35b0ce[_0x2631('0x19')]));});});}; \ No newline at end of file +var _0x1e2d=['attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw'];(function(_0x2f6ae4,_0x1b5b34){var _0xdc9131=function(_0x6d845){while(--_0x6d845){_0x2f6ae4['push'](_0x2f6ae4['shift']());}};_0xdc9131(++_0x1b5b34);}(_0x1e2d,0x163));var _0xd1e2=function(_0x26e0da,_0x3e961b){_0x26e0da=_0x26e0da-0x0;var _0x221753=_0x1e2d[_0x26e0da];return _0x221753;};'use strict';var _=require('lodash');var util=require(_0xd1e2('0x0'));var moment=require(_0xd1e2('0x1'));var BPromise=require(_0xd1e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e2('0x3'));var db=require(_0xd1e2('0x4'))['db'];var utils=require(_0xd1e2('0x5'));var logger=require(_0xd1e2('0x6'))(_0xd1e2('0x7'));var config=require(_0xd1e2('0x8'));var jayson=require(_0xd1e2('0x9'));var client=jayson[_0xd1e2('0xa')][_0xd1e2('0xb')]({'port':0x232a});config[_0xd1e2('0xc')]=_[_0xd1e2('0xd')](config[_0xd1e2('0xc')],{'host':_0xd1e2('0xe'),'port':0x18eb});var socket=require(_0xd1e2('0xf'))(new Redis(config[_0xd1e2('0xc')]));require(_0xd1e2('0x10'))['register'](socket);function respondWithRpcPromise(_0x1bca90,_0x20fa27,_0x1382ce){return new BPromise(function(_0x13280b,_0xff931f){return client[_0xd1e2('0x11')](_0x1bca90,_0x1382ce)[_0xd1e2('0x12')](function(_0x150aad){logger[_0xd1e2('0x13')](_0xd1e2('0x14'),_0x20fa27,_0xd1e2('0x15'));logger[_0xd1e2('0x16')](_0xd1e2('0x17'),_0x20fa27,_0xd1e2('0x15'),JSON[_0xd1e2('0x18')](_0x150aad));if(_0x150aad[_0xd1e2('0x19')]){if(_0x150aad[_0xd1e2('0x19')][_0xd1e2('0x1a')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x20fa27,_0x150aad['error'][_0xd1e2('0x1b')]);return _0xff931f(_0x150aad['error']['message']);}logger[_0xd1e2('0x19')](_0xd1e2('0x14'),_0x20fa27,_0x150aad[_0xd1e2('0x19')][_0xd1e2('0x1b')]);return _0x13280b(_0x150aad['error'][_0xd1e2('0x1b')]);}else{logger[_0xd1e2('0x13')](_0xd1e2('0x14'),_0x20fa27,'request\x20sent');_0x13280b(_0x150aad[_0xd1e2('0x1c')][_0xd1e2('0x1b')]);}})[_0xd1e2('0x1d')](function(_0x3e2bb6){logger[_0xd1e2('0x19')](_0xd1e2('0x14'),_0x20fa27,_0x3e2bb6);_0xff931f(_0x3e2bb6);});});}exports[_0xd1e2('0x1e')]=function(_0x5001db){var _0x515fa9=this;return new Promise(function(_0x5c541e,_0xef6d63){return db[_0xd1e2('0x1f')][_0xd1e2('0x20')]({'raw':_0x5001db[_0xd1e2('0x21')]?_0x5001db[_0xd1e2('0x21')][_0xd1e2('0x22')]===undefined?!![]:![]:!![],'where':_0x5001db[_0xd1e2('0x21')]?_0x5001db[_0xd1e2('0x21')]['where']||null:null,'attributes':_0x5001db['options']?_0x5001db[_0xd1e2('0x21')][_0xd1e2('0x23')]||null:null,'include':_0x5001db[_0xd1e2('0x21')]?_0x5001db['options'][_0xd1e2('0x24')]?_[_0xd1e2('0x25')](_0x5001db[_0xd1e2('0x21')][_0xd1e2('0x24')],function(_0x1b9001){return{'model':db[_0x1b9001[_0xd1e2('0x26')]],'as':_0x1b9001['as'],'attributes':_0x1b9001[_0xd1e2('0x23')],'include':_0x1b9001[_0xd1e2('0x24')]?_['map'](_0x1b9001[_0xd1e2('0x24')],function(_0x10c592){return{'model':db[_0x10c592[_0xd1e2('0x26')]],'as':_0x10c592['as'],'attributes':_0x10c592[_0xd1e2('0x23')],'include':_0x10c592['include']?_[_0xd1e2('0x25')](_0x10c592[_0xd1e2('0x24')],function(_0x5b31b8){return{'model':db[_0x5b31b8[_0xd1e2('0x26')]],'as':_0x5b31b8['as'],'attributes':_0x5b31b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1e2('0x12')](function(_0x36e6f6){logger['info'](_0xd1e2('0x1e'),_0x5001db);logger[_0xd1e2('0x16')](_0xd1e2('0x1e'),_0x5001db,JSON['stringify'](_0x36e6f6));_0x5c541e(_0x36e6f6);})[_0xd1e2('0x1d')](function(_0x1a5c93){logger[_0xd1e2('0x19')](_0xd1e2('0x1e'),_0x1a5c93[_0xd1e2('0x1b')],_0x5001db);_0xef6d63(_0x515fa9['error'](0x1f4,_0x1a5c93[_0xd1e2('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bed2fc2..01878d1 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 84a0a35..4ec531b 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a184b,_0x457876){var _0x713964=function(_0x1f6d49){while(--_0x1f6d49){_0x5a184b['push'](_0x5a184b['shift']());}};_0x713964(++_0x457876);}(_0x34e8,0x12c));var _0x834e=function(_0xa67e94,_0x555af3){_0xa67e94=_0xa67e94-0x0;var _0x40d32f=_0x34e8[_0xa67e94];return _0x40d32f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x24c75d,_0x205a28){var _0x4fffe7=function(_0x5a9e5d){while(--_0x5a9e5d){_0x24c75d['push'](_0x24c75d['shift']());}};_0x4fffe7(++_0x205a28);}(_0x7217,0x19e));var _0x7721=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x7217[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 238996a..a32e78c 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 _0x5d17=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x478de9,_0x46cae4){var _0x8df4a4=function(_0x3606ab){while(--_0x3606ab){_0x478de9['push'](_0x478de9['shift']());}};_0x8df4a4(++_0x46cae4);}(_0x5d17,0xb8));var _0x75d1=function(_0x5a516a,_0x541200){_0x5a516a=_0x5a516a-0x0;var _0x38c0d9=_0x5d17[_0x5a516a];return _0x38c0d9;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'priority':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x75d1('0x3')],'allowNull':![],'defaultValue':_0x75d1('0x4')},'appdata':{'type':Sequelize[_0x75d1('0x5')]()},'description':{'type':Sequelize[_0x75d1('0x3')]},'interval':{'type':Sequelize[_0x75d1('0x3')],'defaultValue':_0x75d1('0x6')}}; \ No newline at end of file +var _0xaf5c=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x3a9b01,_0x309cef){var _0x1297ab=function(_0x155b37){while(--_0x155b37){_0x3a9b01['push'](_0x3a9b01['shift']());}};_0x1297ab(++_0x309cef);}(_0xaf5c,0x1d5));var _0xcaf5=function(_0x2879db,_0x3e79f8){_0x2879db=_0x2879db-0x0;var _0x2c3fa3=_0xaf5c[_0x2879db];return _0x2c3fa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xcaf5('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xcaf5('0x1')],'allowNull':![],'defaultValue':_0xcaf5('0x2')},'appdata':{'type':Sequelize[_0xcaf5('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcaf5('0x1')],'defaultValue':_0xcaf5('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 878eb2c..8988e76 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 _0xd6c7=['request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','SmsApplication','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','order','where','pick','filters','merge','filter','options','findAll','rows','catch','params','length','includeAll','find','create','body','destroy','eml-format','rimraf'];(function(_0x4d8ad6,_0x5f0836){var _0x196d20=function(_0xe5c97a){while(--_0xe5c97a){_0x4d8ad6['push'](_0x4d8ad6['shift']());}};_0x196d20(++_0x5f0836);}(_0xd6c7,0xca));var _0x7d6c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xd6c7[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x7d6c('0x0'));var rimraf=require(_0x7d6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d6c('0x2'));var moment=require(_0x7d6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7d6c('0x4'));var util=require('util');var path=require(_0x7d6c('0x5'));var sox=require(_0x7d6c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d6c('0x7'));var _=require(_0x7d6c('0x8'));var squel=require(_0x7d6c('0x9'));var crypto=require('crypto');var jsforce=require(_0x7d6c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7d6c('0xb'));var querystring=require(_0x7d6c('0xc'));var Papa=require(_0x7d6c('0xd'));var Redis=require('ioredis');var authService=require(_0x7d6c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7d6c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d6c('0x10'))(_0x7d6c('0x11'));var utils=require(_0x7d6c('0x12'));var config=require(_0x7d6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d6c('0x14'))['db'];function respondWithStatusCode(_0x53e876,_0x1886ea){_0x1886ea=_0x1886ea||0xcc;return function(_0x9f739a){if(_0x9f739a){return _0x53e876[_0x7d6c('0x15')](_0x1886ea);}return _0x53e876['status'](_0x1886ea)['end']();};}function respondWithResult(_0x551963,_0x46c6eb){_0x46c6eb=_0x46c6eb||0xc8;return function(_0x5d6d23){if(_0x5d6d23){return _0x551963[_0x7d6c('0x16')](_0x46c6eb)['json'](_0x5d6d23);}};}function respondWithFilteredResult(_0x38e87d,_0x4918f9){return function(_0x234f68){if(_0x234f68){var _0x2bf09d=typeof _0x4918f9[_0x7d6c('0x17')]===_0x7d6c('0x18')&&typeof _0x4918f9[_0x7d6c('0x19')]===_0x7d6c('0x18');var _0x220fa2=_0x234f68[_0x7d6c('0x1a')];var _0x50b404=_0x2bf09d?0x0:_0x4918f9[_0x7d6c('0x17')];var _0x5eb733=_0x2bf09d?_0x234f68['count']:_0x4918f9[_0x7d6c('0x17')]+_0x4918f9[_0x7d6c('0x19')];var _0x39c91d;if(_0x5eb733>=_0x220fa2){_0x5eb733=_0x220fa2;_0x39c91d=0xc8;}else{_0x39c91d=0xce;}_0x38e87d['status'](_0x39c91d);return _0x38e87d[_0x7d6c('0x1b')](_0x7d6c('0x1c'),_0x50b404+'-'+_0x5eb733+'/'+_0x220fa2)[_0x7d6c('0x1d')](_0x234f68);}return null;};}function patchUpdates(_0x51122f){return function(_0x102489){try{jsonpatch[_0x7d6c('0x1e')](_0x102489,_0x51122f,!![]);}catch(_0x43d5f5){return BPromise[_0x7d6c('0x1f')](_0x43d5f5);}return _0x102489[_0x7d6c('0x20')]();};}function saveUpdates(_0x2a035e,_0x191813){return function(_0x474db8){if(_0x474db8){return _0x474db8['update'](_0x2a035e)['then'](function(_0x837772){return _0x837772;});}return null;};}function removeEntity(_0x44accf,_0x10579b){return function(_0x1910ea){if(_0x1910ea){return _0x1910ea['destroy']()[_0x7d6c('0x21')](function(){_0x44accf['status'](0xcc)[_0x7d6c('0x22')]();});}};}function handleEntityNotFound(_0x52a12c,_0x41002c){return function(_0x20b6e9){if(!_0x20b6e9){_0x52a12c['sendStatus'](0x194);}return _0x20b6e9;};}function handleError(_0xf4dc9d,_0x23b3f4){_0x23b3f4=_0x23b3f4||0x1f4;return function(_0x36ee82){logger[_0x7d6c('0x23')](_0x36ee82[_0x7d6c('0x24')]);if(_0x36ee82[_0x7d6c('0x25')]){delete _0x36ee82[_0x7d6c('0x25')];}_0xf4dc9d[_0x7d6c('0x16')](_0x23b3f4)[_0x7d6c('0x26')](_0x36ee82);};}exports[_0x7d6c('0x27')]=function(_0x4542d7,_0x2a88f0){var _0x10374d={},_0x154d5a={},_0x2b5ac9={'count':0x0,'rows':[]};var _0x3fb345=_['map'](db[_0x7d6c('0x28')][_0x7d6c('0x29')],function(_0x4b9681){return{'name':_0x4b9681['fieldName'],'type':_0x4b9681[_0x7d6c('0x2a')][_0x7d6c('0x2b')]};});_0x154d5a[_0x7d6c('0x2c')]=_[_0x7d6c('0x2d')](_0x3fb345,_0x7d6c('0x25'));_0x154d5a['query']=_[_0x7d6c('0x2e')](_0x4542d7[_0x7d6c('0x2f')]);_0x154d5a['filters']=_[_0x7d6c('0x30')](_0x154d5a[_0x7d6c('0x2c')],_0x154d5a[_0x7d6c('0x2f')]);_0x10374d['attributes']=_[_0x7d6c('0x30')](_0x154d5a[_0x7d6c('0x2c')],qs[_0x7d6c('0x31')](_0x4542d7[_0x7d6c('0x2f')][_0x7d6c('0x31')]));_0x10374d[_0x7d6c('0x32')]=_0x10374d['attributes']['length']?_0x10374d[_0x7d6c('0x32')]:_0x154d5a[_0x7d6c('0x2c')];if(!_0x4542d7[_0x7d6c('0x2f')]['hasOwnProperty']('nolimit')){_0x10374d[_0x7d6c('0x19')]=qs[_0x7d6c('0x19')](_0x4542d7[_0x7d6c('0x2f')][_0x7d6c('0x19')]);_0x10374d[_0x7d6c('0x17')]=qs[_0x7d6c('0x17')](_0x4542d7[_0x7d6c('0x2f')]['offset']);}_0x10374d[_0x7d6c('0x33')]=qs['sort'](_0x4542d7[_0x7d6c('0x2f')]['sort']);_0x10374d[_0x7d6c('0x34')]=qs['filters'](_[_0x7d6c('0x35')](_0x4542d7[_0x7d6c('0x2f')],_0x154d5a[_0x7d6c('0x36')]),_0x3fb345);if(_0x4542d7[_0x7d6c('0x2f')]['filter']){_0x10374d[_0x7d6c('0x34')]=_[_0x7d6c('0x37')](_0x10374d[_0x7d6c('0x34')],{'$or':_[_0x7d6c('0x2d')](_0x3fb345,function(_0x2727ba){if(_0x2727ba[_0x7d6c('0x2a')]!=='VIRTUAL'){var _0x990e38={};_0x990e38[_0x2727ba[_0x7d6c('0x25')]]={'$like':'%'+_0x4542d7['query'][_0x7d6c('0x38')]+'%'};return _0x990e38;}})});}_0x10374d=_[_0x7d6c('0x37')]({},_0x10374d,_0x4542d7[_0x7d6c('0x39')]);var _0x292a05={'where':_0x10374d[_0x7d6c('0x34')]};return db[_0x7d6c('0x28')][_0x7d6c('0x1a')](_0x292a05)[_0x7d6c('0x21')](function(_0x171ec8){_0x2b5ac9[_0x7d6c('0x1a')]=_0x171ec8;if(_0x4542d7[_0x7d6c('0x2f')]['includeAll']){_0x10374d['include']=[{'all':!![]}];}return db[_0x7d6c('0x28')][_0x7d6c('0x3a')](_0x10374d);})['then'](function(_0xbd0a3d){_0x2b5ac9[_0x7d6c('0x3b')]=_0xbd0a3d;return _0x2b5ac9;})['then'](respondWithFilteredResult(_0x2a88f0,_0x10374d))[_0x7d6c('0x3c')](handleError(_0x2a88f0,null));};exports['show']=function(_0x40d0dc,_0x5b5bcb){var _0x35446f={'raw':!![],'where':{'id':_0x40d0dc[_0x7d6c('0x3d')]['id']}},_0x24f1f8={};_0x24f1f8[_0x7d6c('0x2c')]=_[_0x7d6c('0x2e')](db[_0x7d6c('0x28')]['rawAttributes']);_0x24f1f8[_0x7d6c('0x2f')]=_[_0x7d6c('0x2e')](_0x40d0dc['query']);_0x24f1f8[_0x7d6c('0x36')]=_[_0x7d6c('0x30')](_0x24f1f8[_0x7d6c('0x2c')],_0x24f1f8[_0x7d6c('0x2f')]);_0x35446f[_0x7d6c('0x32')]=_[_0x7d6c('0x30')](_0x24f1f8['model'],qs[_0x7d6c('0x31')](_0x40d0dc['query'][_0x7d6c('0x31')]));_0x35446f[_0x7d6c('0x32')]=_0x35446f['attributes'][_0x7d6c('0x3e')]?_0x35446f[_0x7d6c('0x32')]:_0x24f1f8[_0x7d6c('0x2c')];if(_0x40d0dc[_0x7d6c('0x2f')][_0x7d6c('0x3f')]){_0x35446f['include']=[{'all':!![]}];}_0x35446f=_[_0x7d6c('0x37')]({},_0x35446f,_0x40d0dc[_0x7d6c('0x39')]);return db[_0x7d6c('0x28')][_0x7d6c('0x40')](_0x35446f)['then'](handleEntityNotFound(_0x5b5bcb,null))['then'](respondWithResult(_0x5b5bcb,null))[_0x7d6c('0x3c')](handleError(_0x5b5bcb,null));};exports[_0x7d6c('0x41')]=function(_0x325b47,_0x26ae4b){return db[_0x7d6c('0x28')][_0x7d6c('0x41')](_0x325b47[_0x7d6c('0x42')],{})[_0x7d6c('0x21')](respondWithResult(_0x26ae4b,0xc9))[_0x7d6c('0x3c')](handleError(_0x26ae4b,null));};exports['update']=function(_0x1f252f,_0xa61a1e){if(_0x1f252f['body']['id']){delete _0x1f252f['body']['id'];}return db[_0x7d6c('0x28')][_0x7d6c('0x40')]({'where':{'id':_0x1f252f[_0x7d6c('0x3d')]['id']}})[_0x7d6c('0x21')](handleEntityNotFound(_0xa61a1e,null))['then'](saveUpdates(_0x1f252f[_0x7d6c('0x42')],null))['then'](respondWithResult(_0xa61a1e,null))['catch'](handleError(_0xa61a1e,null));};exports[_0x7d6c('0x43')]=function(_0x248ef3,_0xddfca8){return db[_0x7d6c('0x28')][_0x7d6c('0x40')]({'where':{'id':_0x248ef3[_0x7d6c('0x3d')]['id']}})[_0x7d6c('0x21')](handleEntityNotFound(_0xddfca8,null))['then'](removeEntity(_0xddfca8,null))['catch'](handleError(_0xddfca8,null));}; \ No newline at end of file +var _0x349e=['fieldName','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','find','eml-format','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','SmsApplication','rawAttributes'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x349e,0x1f0));var _0xe349=function(_0x2179df,_0x52f919){_0x2179df=_0x2179df-0x0;var _0x3f354e=_0x349e[_0x2179df];return _0x3f354e;};'use strict';var emlformat=require(_0xe349('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe349('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe349('0x2'));var util=require(_0xe349('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xe349('0x4'));var ejs=require(_0xe349('0x5'));var fs=require('fs');var fs_extra=require(_0xe349('0x6'));var _=require(_0xe349('0x7'));var squel=require(_0xe349('0x8'));var crypto=require('crypto');var jsforce=require(_0xe349('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe349('0x4'));var querystring=require(_0xe349('0xa'));var Papa=require(_0xe349('0xb'));var Redis=require(_0xe349('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe349('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe349('0xe'))(_0xe349('0xf'));var utils=require(_0xe349('0x10'));var config=require(_0xe349('0x11'));var licenseUtil=require(_0xe349('0x12'));var db=require(_0xe349('0x13'))['db'];function respondWithStatusCode(_0x5dfbbb,_0x4d265d){_0x4d265d=_0x4d265d||0xcc;return function(_0x5527a0){if(_0x5527a0){return _0x5dfbbb[_0xe349('0x14')](_0x4d265d);}return _0x5dfbbb[_0xe349('0x15')](_0x4d265d)['end']();};}function respondWithResult(_0x4e7f81,_0xfd8132){_0xfd8132=_0xfd8132||0xc8;return function(_0x2c729f){if(_0x2c729f){return _0x4e7f81[_0xe349('0x15')](_0xfd8132)[_0xe349('0x16')](_0x2c729f);}};}function respondWithFilteredResult(_0x4e71ca,_0xfc0b94){return function(_0x45a928){if(_0x45a928){var _0xf4f3f3=typeof _0xfc0b94['offset']===_0xe349('0x17')&&typeof _0xfc0b94[_0xe349('0x18')]==='undefined';var _0xf00eec=_0x45a928[_0xe349('0x19')];var _0x1ac7df=_0xf4f3f3?0x0:_0xfc0b94['offset'];var _0x142948=_0xf4f3f3?_0x45a928[_0xe349('0x19')]:_0xfc0b94[_0xe349('0x1a')]+_0xfc0b94[_0xe349('0x18')];var _0x454917;if(_0x142948>=_0xf00eec){_0x142948=_0xf00eec;_0x454917=0xc8;}else{_0x454917=0xce;}_0x4e71ca['status'](_0x454917);return _0x4e71ca[_0xe349('0x1b')](_0xe349('0x1c'),_0x1ac7df+'-'+_0x142948+'/'+_0xf00eec)[_0xe349('0x16')](_0x45a928);}return null;};}function patchUpdates(_0x8b57){return function(_0x3fe4fd){try{jsonpatch[_0xe349('0x1d')](_0x3fe4fd,_0x8b57,!![]);}catch(_0x1c2df2){return BPromise[_0xe349('0x1e')](_0x1c2df2);}return _0x3fe4fd[_0xe349('0x1f')]();};}function saveUpdates(_0x1589ba,_0x373126){return function(_0x585757){if(_0x585757){return _0x585757[_0xe349('0x20')](_0x1589ba)[_0xe349('0x21')](function(_0x793299){return _0x793299;});}return null;};}function removeEntity(_0x955499,_0x4f3b70){return function(_0x7299d4){if(_0x7299d4){return _0x7299d4[_0xe349('0x22')]()[_0xe349('0x21')](function(){_0x955499[_0xe349('0x15')](0xcc)[_0xe349('0x23')]();});}};}function handleEntityNotFound(_0x591268,_0x3d9af1){return function(_0x5deeba){if(!_0x5deeba){_0x591268[_0xe349('0x14')](0x194);}return _0x5deeba;};}function handleError(_0x42fc78,_0x520985){_0x520985=_0x520985||0x1f4;return function(_0x47456d){logger['error'](_0x47456d['stack']);if(_0x47456d['name']){delete _0x47456d[_0xe349('0x24')];}_0x42fc78[_0xe349('0x15')](_0x520985)[_0xe349('0x25')](_0x47456d);};}exports['index']=function(_0x5cc3f9,_0x7079b9){var _0x1222b6={},_0x535bb0={},_0x4ca872={'count':0x0,'rows':[]};var _0x2b5326=_['map'](db[_0xe349('0x26')][_0xe349('0x27')],function(_0x5d7ac6){return{'name':_0x5d7ac6[_0xe349('0x28')],'type':_0x5d7ac6['type']['key']};});_0x535bb0[_0xe349('0x29')]=_[_0xe349('0x2a')](_0x2b5326,_0xe349('0x24'));_0x535bb0[_0xe349('0x2b')]=_[_0xe349('0x2c')](_0x5cc3f9[_0xe349('0x2b')]);_0x535bb0[_0xe349('0x2d')]=_[_0xe349('0x2e')](_0x535bb0[_0xe349('0x29')],_0x535bb0['query']);_0x1222b6['attributes']=_[_0xe349('0x2e')](_0x535bb0['model'],qs['fields'](_0x5cc3f9['query'][_0xe349('0x2f')]));_0x1222b6[_0xe349('0x30')]=_0x1222b6[_0xe349('0x30')]['length']?_0x1222b6[_0xe349('0x30')]:_0x535bb0['model'];if(!_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x31')](_0xe349('0x32'))){_0x1222b6['limit']=qs['limit'](_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x18')]);_0x1222b6['offset']=qs[_0xe349('0x1a')](_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x1a')]);}_0x1222b6[_0xe349('0x33')]=qs[_0xe349('0x34')](_0x5cc3f9[_0xe349('0x2b')]['sort']);_0x1222b6[_0xe349('0x35')]=qs[_0xe349('0x2d')](_[_0xe349('0x36')](_0x5cc3f9['query'],_0x535bb0[_0xe349('0x2d')]),_0x2b5326);if(_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x37')]){_0x1222b6[_0xe349('0x35')]=_['merge'](_0x1222b6[_0xe349('0x35')],{'$or':_[_0xe349('0x2a')](_0x2b5326,function(_0xa2c46a){if(_0xa2c46a[_0xe349('0x38')]!==_0xe349('0x39')){var _0x4bba4b={};_0x4bba4b[_0xa2c46a[_0xe349('0x24')]]={'$like':'%'+_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x37')]+'%'};return _0x4bba4b;}})});}_0x1222b6=_[_0xe349('0x3a')]({},_0x1222b6,_0x5cc3f9[_0xe349('0x3b')]);var _0x17ef9e={'where':_0x1222b6['where']};return db[_0xe349('0x26')]['count'](_0x17ef9e)[_0xe349('0x21')](function(_0x3bb1c5){_0x4ca872[_0xe349('0x19')]=_0x3bb1c5;if(_0x5cc3f9[_0xe349('0x2b')][_0xe349('0x3c')]){_0x1222b6[_0xe349('0x3d')]=[{'all':!![]}];}return db[_0xe349('0x26')]['findAll'](_0x1222b6);})[_0xe349('0x21')](function(_0x186788){_0x4ca872['rows']=_0x186788;return _0x4ca872;})[_0xe349('0x21')](respondWithFilteredResult(_0x7079b9,_0x1222b6))[_0xe349('0x3e')](handleError(_0x7079b9,null));};exports[_0xe349('0x3f')]=function(_0x34381d,_0x586dee){var _0x32f07a={'raw':!![],'where':{'id':_0x34381d[_0xe349('0x40')]['id']}},_0x26e0d6={};_0x26e0d6[_0xe349('0x29')]=_['keys'](db[_0xe349('0x26')]['rawAttributes']);_0x26e0d6['query']=_['keys'](_0x34381d[_0xe349('0x2b')]);_0x26e0d6[_0xe349('0x2d')]=_['intersection'](_0x26e0d6[_0xe349('0x29')],_0x26e0d6[_0xe349('0x2b')]);_0x32f07a[_0xe349('0x30')]=_[_0xe349('0x2e')](_0x26e0d6[_0xe349('0x29')],qs[_0xe349('0x2f')](_0x34381d[_0xe349('0x2b')]['fields']));_0x32f07a[_0xe349('0x30')]=_0x32f07a[_0xe349('0x30')]['length']?_0x32f07a[_0xe349('0x30')]:_0x26e0d6[_0xe349('0x29')];if(_0x34381d[_0xe349('0x2b')][_0xe349('0x3c')]){_0x32f07a[_0xe349('0x3d')]=[{'all':!![]}];}_0x32f07a=_[_0xe349('0x3a')]({},_0x32f07a,_0x34381d['options']);return db[_0xe349('0x26')]['find'](_0x32f07a)['then'](handleEntityNotFound(_0x586dee,null))[_0xe349('0x21')](respondWithResult(_0x586dee,null))[_0xe349('0x3e')](handleError(_0x586dee,null));};exports[_0xe349('0x41')]=function(_0x4620be,_0x5766ee){return db[_0xe349('0x26')][_0xe349('0x41')](_0x4620be['body'],{})[_0xe349('0x21')](respondWithResult(_0x5766ee,0xc9))[_0xe349('0x3e')](handleError(_0x5766ee,null));};exports[_0xe349('0x20')]=function(_0x2ae51e,_0xfe5629){if(_0x2ae51e['body']['id']){delete _0x2ae51e['body']['id'];}return db['SmsApplication'][_0xe349('0x42')]({'where':{'id':_0x2ae51e[_0xe349('0x40')]['id']}})[_0xe349('0x21')](handleEntityNotFound(_0xfe5629,null))['then'](saveUpdates(_0x2ae51e['body'],null))[_0xe349('0x21')](respondWithResult(_0xfe5629,null))[_0xe349('0x3e')](handleError(_0xfe5629,null));};exports[_0xe349('0x22')]=function(_0x42f898,_0x453602){return db[_0xe349('0x26')][_0xe349('0x42')]({'where':{'id':_0x42f898[_0xe349('0x40')]['id']}})['then'](handleEntityNotFound(_0x453602,null))['then'](removeEntity(_0x453602,null))[_0xe349('0x3e')](handleError(_0x453602,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index dc1e284..1f345a2 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 _0x4000=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','define','SmsApplication','utf8mb4'];(function(_0x5ac531,_0x3bb175){var _0x3510dd=function(_0x4d3b1e){while(--_0x4d3b1e){_0x5ac531['push'](_0x5ac531['shift']());}};_0x3510dd(++_0x3bb175);}(_0x4000,0x199));var _0x0400=function(_0x26e0f2,_0x5ed560){_0x26e0f2=_0x26e0f2-0x0;var _0x1bad88=_0x4000[_0x26e0f2];return _0x1bad88;};'use strict';var _=require(_0x0400('0x0'));var util=require(_0x0400('0x1'));var logger=require(_0x0400('0x2'))('api');var moment=require(_0x0400('0x3'));var BPromise=require(_0x0400('0x4'));var rp=require(_0x0400('0x5'));var fs=require('fs');var path=require(_0x0400('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x0400('0x7')]=function(_0x58f398,_0x1f668f){return _0x58f398[_0x0400('0x8')](_0x0400('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0400('0xa'),'collate':_0x0400('0xb')});}; \ No newline at end of file +var _0x7a94=['moment','bluebird','path','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x2f4c68,_0x71994){var _0xe57292=function(_0x19f7ad){while(--_0x19f7ad){_0x2f4c68['push'](_0x2f4c68['shift']());}};_0xe57292(++_0x71994);}(_0x7a94,0x1c5));var _0x47a9=function(_0x18770e,_0x1cdf36){_0x18770e=_0x18770e-0x0;var _0x4282e6=_0x7a94[_0x18770e];return _0x4282e6;};'use strict';var _=require('lodash');var util=require(_0x47a9('0x0'));var logger=require(_0x47a9('0x1'))(_0x47a9('0x2'));var moment=require(_0x47a9('0x3'));var BPromise=require(_0x47a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x47a9('0x6'));module['exports']=function(_0x2f5589,_0x6d7a2f){return _0x2f5589[_0x47a9('0x7')](_0x47a9('0x8'),attributes,{'tableName':_0x47a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x47a9('0xa'),'collate':_0x47a9('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index bdfd6b8..50f53fe 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 _0x9e69=['rpc','../../config/environment','jayson/promise','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9e69,0x150));var _0x99e6=function(_0x4a1efd,_0x57b22d){_0x4a1efd=_0x4a1efd-0x0;var _0x4c842c=_0x9e69[_0x4a1efd];return _0x4c842c;};'use strict';var _=require('lodash');var util=require(_0x99e6('0x0'));var moment=require(_0x99e6('0x1'));var BPromise=require(_0x99e6('0x2'));var rs=require(_0x99e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99e6('0x4'))['db'];var utils=require(_0x99e6('0x5'));var logger=require('../../config/logger')(_0x99e6('0x6'));var config=require(_0x99e6('0x7'));var jayson=require(_0x99e6('0x8'));var client=jayson['client'][_0x99e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cf241,_0x41635b,_0x58eb2d){return new BPromise(function(_0x3424c5,_0x305140){return client['request'](_0x3cf241,_0x58eb2d)[_0x99e6('0xa')](function(_0x133169){logger['info'](_0x99e6('0xb'),_0x41635b,_0x99e6('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x41635b,_0x99e6('0xc'),JSON[_0x99e6('0xd')](_0x133169));if(_0x133169[_0x99e6('0xe')]){if(_0x133169[_0x99e6('0xe')][_0x99e6('0xf')]===0x1f4){logger[_0x99e6('0xe')]('SmsApplication,\x20%s,\x20%s',_0x41635b,_0x133169[_0x99e6('0xe')][_0x99e6('0x10')]);return _0x305140(_0x133169[_0x99e6('0xe')]['message']);}logger[_0x99e6('0xe')](_0x99e6('0xb'),_0x41635b,_0x133169[_0x99e6('0xe')]['message']);return _0x3424c5(_0x133169['error']['message']);}else{logger[_0x99e6('0x11')](_0x99e6('0xb'),_0x41635b,_0x99e6('0xc'));_0x3424c5(_0x133169['result'][_0x99e6('0x10')]);}})[_0x99e6('0x12')](function(_0xebfd62){logger[_0x99e6('0xe')](_0x99e6('0xb'),_0x41635b,_0xebfd62);_0x305140(_0xebfd62);});});} \ No newline at end of file +var _0xe98f=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3a047c,_0xdd39e7){var _0x12985b=function(_0x4a19a6){while(--_0x4a19a6){_0x3a047c['push'](_0x3a047c['shift']());}};_0x12985b(++_0xdd39e7);}(_0xe98f,0xde));var _0xfe98=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe98f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var moment=require(_0xfe98('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe98('0x2'));var fs=require('fs');var Redis=require(_0xfe98('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe98('0x4'))('rpc');var config=require(_0xfe98('0x5'));var jayson=require(_0xfe98('0x6'));var client=jayson['client'][_0xfe98('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x585363,_0x39bc9f,_0x2721d1){return new BPromise(function(_0x3cbc45,_0x502d20){return client[_0xfe98('0x8')](_0x585363,_0x2721d1)[_0xfe98('0x9')](function(_0x57fc24){logger[_0xfe98('0xa')](_0xfe98('0xb'),_0x39bc9f,_0xfe98('0xc'));logger[_0xfe98('0xd')](_0xfe98('0xe'),_0x39bc9f,_0xfe98('0xc'),JSON['stringify'](_0x57fc24));if(_0x57fc24[_0xfe98('0xf')]){if(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x10')]===0x1f4){logger[_0xfe98('0xf')](_0xfe98('0xb'),_0x39bc9f,_0x57fc24['error'][_0xfe98('0x11')]);return _0x502d20(_0x57fc24[_0xfe98('0xf')]['message']);}logger[_0xfe98('0xf')]('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);return _0x3cbc45(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);}else{logger['info'](_0xfe98('0xb'),_0x39bc9f,'request\x20sent');_0x3cbc45(_0x57fc24[_0xfe98('0x12')][_0xfe98('0x11')]);}})[_0xfe98('0x13')](function(_0x476932){logger['error']('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x476932);_0x502d20(_0x476932);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index d7d2ac0..9115659 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 _0x9c00=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags'];(function(_0x19942a,_0x297d8b){var _0xe4577c=function(_0x35e90c){while(--_0x35e90c){_0x19942a['push'](_0x19942a['shift']());}};_0xe4577c(++_0x297d8b);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0x9c00[_0x4a563b];return _0x2935ef;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0x8')](_0x09c0('0xf'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0x11')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x11')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x11')](_0x09c0('0x14'),auth[_0x09c0('0xa')](),interaction[_0x09c0('0x15')](_0x09c0('0x16'),_0x09c0('0x17')),controller[_0x09c0('0x18')]);router[_0x09c0('0x19')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x09c0('0x1b')),controller[_0x09c0('0x1c')]);router[_0x09c0('0x1d')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction[_0x09c0('0x15')]('sms','smsinteraction:destroy'),controller[_0x09c0('0x1e')]);router['delete'](_0x09c0('0x14'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x4213=['download','post','create','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4213,0x77));var _0x3421=function(_0xee05c6,_0x544c85){_0xee05c6=_0xee05c6-0x0;var _0xe21efc=_0x4213[_0xee05c6];return _0xe21efc;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/messages',auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x13')]);router['post'](_0x3421('0x14'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router[_0x3421('0x12')](_0x3421('0x16'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')]('sms',_0x3421('0x18')),controller['addTags']);router[_0x3421('0x19')](_0x3421('0xe'),auth['isAuthenticated'](),interaction[_0x3421('0x17')]('sms',_0x3421('0x1a')),controller[_0x3421('0x1b')]);router['delete'](_0x3421('0xe'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')](_0x3421('0x1c'),_0x3421('0x1d')),controller[_0x3421('0x1e')]);router[_0x3421('0x1f')](_0x3421('0x16'),auth[_0x3421('0xa')](),controller[_0x3421('0x20')]);module[_0x3421('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 034f212..48c36cb 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 _0xac9d=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xac9d,0x14d));var _0xdac9=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0xac9d[_0x3a8dc1];return _0x4b3595;};'use strict';var Sequelize=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));module[_0xdac9('0x2')]={'closed':{'type':Sequelize[_0xdac9('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdac9('0x4')]},'disposition':{'type':Sequelize[_0xdac9('0x5')]},'secondDisposition':{'type':Sequelize[_0xdac9('0x5')]},'thirdDisposition':{'type':Sequelize[_0xdac9('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdac9('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xdac9('0x6')]('in',_0xdac9('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdac9('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xdac9('0x6')]('in',_0xdac9('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdac9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5581=['out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x313c92,_0x5d9943){var _0x8ddf39=function(_0x5c8fe7){while(--_0x5c8fe7){_0x313c92['push'](_0x313c92['shift']());}};_0x8ddf39(++_0x5d9943);}(_0x5581,0x115));var _0x1558=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5581[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x1558('0x0'));var moment=require('moment');module[_0x1558('0x1')]={'closed':{'type':Sequelize[_0x1558('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1558('0x3')]},'disposition':{'type':Sequelize[_0x1558('0x4')]},'secondDisposition':{'type':Sequelize[_0x1558('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1558('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1558('0x4')]},'read1stAt':{'type':Sequelize[_0x1558('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1558('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1558('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1558('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1558('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 6ad06c7..110fc07 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 _0x6a7c=['System','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','sendStatus','rimraf','moment','bluebird','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','api','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','end','status','json','offset','limit','set','Content-Range','then','destroy','error','stack','name','index','map','SmsInteraction','rawAttributes','type','key','getOptions','findAll','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','create','body','find','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','SmsInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','createdAt','closed','closedAt','disposition','out'];(function(_0x35d03a,_0x3c8bc6){var _0x448841=function(_0x5cf8cf){while(--_0x5cf8cf){_0x35d03a['push'](_0x35d03a['shift']());}};_0x448841(++_0x3c8bc6);}(_0x6a7c,0x1e7));var _0xc6a7=function(_0x5d5fc4,_0x47b71b){_0x5d5fc4=_0x5d5fc4-0x0;var _0x5393d1=_0x6a7c[_0x5d5fc4];return _0x5393d1;};'use strict';var rimraf=require(_0xc6a7('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc6a7('0x1'));var BPromise=require(_0xc6a7('0x2'));var util=require('util');var path=require('path');var ejs=require(_0xc6a7('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc6a7('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0xc6a7('0x5'));var pdf=require(_0xc6a7('0x6'));var logger=require('../../config/logger')(_0xc6a7('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc6a7('0x8')]=_[_0xc6a7('0x9')](config[_0xc6a7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6a7('0xa'))(new Redis(config['redis']));require(_0xc6a7('0xb'))[_0xc6a7('0xc')](socket);function respondWithStatusCode(_0x5f55da,_0x1cac48){_0x1cac48=_0x1cac48||0xcc;return function(_0x5563bd){if(_0x5563bd){return _0x5f55da['sendStatus'](_0x1cac48);}return _0x5f55da['status'](_0x1cac48)[_0xc6a7('0xd')]();};}function respondWithResult(_0x137cf7,_0x4c09c3){_0x4c09c3=_0x4c09c3||0xc8;return function(_0x3f33e6){if(_0x3f33e6){return _0x137cf7[_0xc6a7('0xe')](_0x4c09c3)[_0xc6a7('0xf')](_0x3f33e6);}};}function respondWithFilteredResult(_0x48745e,_0x303dae){return function(_0x1992b7){if(_0x1992b7){var _0x343b6c=typeof _0x303dae[_0xc6a7('0x10')]==='undefined'&&typeof _0x303dae[_0xc6a7('0x11')]==='undefined';var _0xd86f61=_0x1992b7['count'];var _0xfa6d0c=_0x343b6c?0x0:_0x303dae[_0xc6a7('0x10')];var _0x3a6c95=_0x343b6c?_0x1992b7['count']:_0x303dae[_0xc6a7('0x10')]+_0x303dae['limit'];var _0x31932b;if(_0x3a6c95>=_0xd86f61){_0x3a6c95=_0xd86f61;_0x31932b=0xc8;}else{_0x31932b=0xce;}_0x48745e[_0xc6a7('0xe')](_0x31932b);return _0x48745e[_0xc6a7('0x12')](_0xc6a7('0x13'),_0xfa6d0c+'-'+_0x3a6c95+'/'+_0xd86f61)['json'](_0x1992b7);}return null;};}function saveUpdates(_0x16547e){return function(_0x19686d){if(_0x19686d){return _0x19686d['update'](_0x16547e)[_0xc6a7('0x14')](function(_0x252407){return _0x252407;});}return null;};}function removeEntity(_0x48faee){return function(_0x21b2b0){if(_0x21b2b0){return _0x21b2b0[_0xc6a7('0x15')]()['then'](function(){_0x48faee[_0xc6a7('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc31b){return function(_0x23bc78){if(!_0x23bc78){_0x5cc31b['sendStatus'](0x194);}return _0x23bc78;};}function handleError(_0x34ef6,_0x5da01b){_0x5da01b=_0x5da01b||0x1f4;return function(_0x51c92e){logger[_0xc6a7('0x16')](_0x51c92e[_0xc6a7('0x17')]);if(_0x51c92e['name']){delete _0x51c92e[_0xc6a7('0x18')];}_0x34ef6['status'](_0x5da01b)['send'](_0x51c92e);};}exports[_0xc6a7('0x19')]=function(_0x391fc6,_0x17f857){var _0x3efc8b={};var _0x320c45=_[_0xc6a7('0x1a')](db[_0xc6a7('0x1b')][_0xc6a7('0x1c')],function(_0x446ae8){return{'name':_0x446ae8['fieldName'],'type':_0x446ae8[_0xc6a7('0x1d')][_0xc6a7('0x1e')]};});_0x3efc8b=qs[_0xc6a7('0x1f')](_0x320c45,_0x391fc6);return interaction[_0xc6a7('0x20')]('sms',_0x391fc6[_0xc6a7('0x21')],_0x391fc6[_0xc6a7('0x22')],_0x3efc8b,_0x320c45)[_0xc6a7('0x14')](respondWithFilteredResult(_0x17f857,_0x3efc8b))[_0xc6a7('0x23')](handleError(_0x17f857,null));};exports[_0xc6a7('0x24')]=function(_0x25b592,_0x1c62af){var _0x15008d={'raw':![],'where':{'id':_0x25b592[_0xc6a7('0x25')]['id']}},_0x158ea0={};_0x158ea0[_0xc6a7('0x26')]=_[_0xc6a7('0x27')](db['SmsInteraction'][_0xc6a7('0x1c')]);_0x158ea0[_0xc6a7('0x21')]=_['keys'](_0x25b592[_0xc6a7('0x21')]);_0x158ea0[_0xc6a7('0x28')]=_[_0xc6a7('0x29')](_0x158ea0[_0xc6a7('0x26')],_0x158ea0[_0xc6a7('0x21')]);_0x15008d[_0xc6a7('0x2a')]=_[_0xc6a7('0x29')](_0x158ea0[_0xc6a7('0x26')],qs[_0xc6a7('0x2b')](_0x25b592['query'][_0xc6a7('0x2b')]));_0x15008d[_0xc6a7('0x2a')]=_0x15008d[_0xc6a7('0x2a')]['length']?_0x15008d['attributes']:_0x158ea0['model'];if(_0x25b592[_0xc6a7('0x21')][_0xc6a7('0x2c')]){_0x15008d[_0xc6a7('0x2d')]=[{'all':!![]}];}_0x15008d=_['merge']({},_0x15008d,_0x25b592[_0xc6a7('0x2e')]);return db[_0xc6a7('0x1b')]['find'](_0x15008d)[_0xc6a7('0x14')](handleEntityNotFound(_0x1c62af,null))[_0xc6a7('0x14')](respondWithResult(_0x1c62af,null))[_0xc6a7('0x23')](handleError(_0x1c62af,null));};exports[_0xc6a7('0x2f')]=function(_0x2e0539,_0x5b884f){return db['SmsInteraction'][_0xc6a7('0x2f')](_0x2e0539['body'],{})[_0xc6a7('0x14')](respondWithResult(_0x5b884f,0xc9))[_0xc6a7('0x23')](handleError(_0x5b884f,null));};exports['update']=function(_0x2b257b,_0x4bd880){if(_0x2b257b[_0xc6a7('0x30')]['id']){delete _0x2b257b[_0xc6a7('0x30')]['id'];}return db[_0xc6a7('0x1b')][_0xc6a7('0x31')]({'where':{'id':_0x2b257b[_0xc6a7('0x25')]['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x4bd880,null))[_0xc6a7('0x14')](saveUpdates(_0x2b257b['body'],null))[_0xc6a7('0x14')](respondWithResult(_0x4bd880,null))[_0xc6a7('0x23')](handleError(_0x4bd880,null));};exports[_0xc6a7('0x15')]=function(_0x5905ac,_0x45dfe0){return db[_0xc6a7('0x1b')][_0xc6a7('0x31')]({'where':{'id':_0x5905ac[_0xc6a7('0x25')]['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x45dfe0,null))[_0xc6a7('0x14')](removeEntity(_0x45dfe0,null))['catch'](handleError(_0x45dfe0,null));};exports[_0xc6a7('0x32')]=function(_0xe6cb1d,_0x54ae4e){return db[_0xc6a7('0x1b')]['describe']()['then'](respondWithResult(_0x54ae4e,null))[_0xc6a7('0x23')](handleError(_0x54ae4e,null));};exports[_0xc6a7('0x33')]=function(_0x1e125c,_0x2a07ea){return db[_0xc6a7('0x34')]['find']({'where':{'id':_0x1e125c[_0xc6a7('0x25')]['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x2a07ea,null))[_0xc6a7('0x14')](function(_0x18a7ec){if(_0x18a7ec){return _0x18a7ec[_0xc6a7('0x33')](_0x1e125c['body']['ids'],_[_0xc6a7('0x35')](_0x1e125c['body'],[_0xc6a7('0x36'),'id'])||{});}})[_0xc6a7('0x14')](respondWithResult(_0x2a07ea,null))[_0xc6a7('0x23')](handleError(_0x2a07ea,null));};exports[_0xc6a7('0x37')]=function(_0x728971,_0x43f8a1){var _0x253e40={'raw':![],'where':{}};var _0x5c1612={};var _0x2dbf61={'count':0x0,'rows':[]};return db[_0xc6a7('0x1b')][_0xc6a7('0x38')]({'where':{'id':_0x728971[_0xc6a7('0x25')]['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x43f8a1,null))['then'](function(_0x3e4763){if(_0x3e4763){_0x5c1612[_0xc6a7('0x26')]=_[_0xc6a7('0x27')](db['SmsMessage']['rawAttributes']);_0x5c1612[_0xc6a7('0x21')]=_['keys'](_0x728971[_0xc6a7('0x21')]);_0x5c1612['filters']=_[_0xc6a7('0x29')](_0x5c1612[_0xc6a7('0x26')],_0x5c1612[_0xc6a7('0x21')]);_0x253e40['attributes']=_[_0xc6a7('0x29')](_0x5c1612[_0xc6a7('0x26')],qs['fields'](_0x728971['query'][_0xc6a7('0x2b')]));_0x253e40[_0xc6a7('0x2a')]=_0x253e40['attributes'][_0xc6a7('0x39')]?_0x253e40['attributes']:_0x5c1612['model'];if(!_0x728971[_0xc6a7('0x21')][_0xc6a7('0x3a')](_0xc6a7('0x3b'))){_0x253e40['limit']=qs[_0xc6a7('0x11')](_0x728971[_0xc6a7('0x21')][_0xc6a7('0x11')]);_0x253e40[_0xc6a7('0x10')]=qs[_0xc6a7('0x10')](_0x728971[_0xc6a7('0x21')][_0xc6a7('0x10')]);}_0x253e40['order']=qs[_0xc6a7('0x3c')](_0x728971['query'][_0xc6a7('0x3c')]);_0x253e40[_0xc6a7('0x3d')]=qs[_0xc6a7('0x28')](_['pick'](_0x728971[_0xc6a7('0x21')],_0x5c1612['filters']));_0x253e40['where'][_0xc6a7('0x3e')]=_0x3e4763['id'];if(_0x728971[_0xc6a7('0x21')][_0xc6a7('0x3f')]){_0x253e40['where']=_[_0xc6a7('0x40')](_0x253e40[_0xc6a7('0x3d')],{'$or':_['map'](_0x253e40[_0xc6a7('0x2a')],function(_0x3a0b39){var _0x1c33a1={};_0x1c33a1[_0x3a0b39]={'$like':'%'+_0x728971[_0xc6a7('0x21')]['filter']+'%'};return _0x1c33a1;})});}if(_0x728971['query'][_0xc6a7('0x41')]){var _0x5344f5=_0x728971[_0xc6a7('0x21')]['$gte'][_0xc6a7('0x42')](',');var _0x565349={};_0x565349[_0x5344f5[0x0]]={'$gte':moment(_0x5344f5[0x1])[_0xc6a7('0x43')](_0xc6a7('0x44'))};_0x253e40[_0xc6a7('0x3d')]=_[_0xc6a7('0x40')](_0x253e40[_0xc6a7('0x3d')],_0x565349);}_0x253e40=_['merge']({},_0x253e40,_0x728971[_0xc6a7('0x2e')]);return db[_0xc6a7('0x34')]['count']({'where':_0x253e40['where']})['then'](function(_0x57de71){_0x2dbf61[_0xc6a7('0x45')]=_0x57de71;if(_0x728971[_0xc6a7('0x21')]['includeAll']){_0x253e40[_0xc6a7('0x2d')]=[{'all':!![]}];}return db[_0xc6a7('0x34')][_0xc6a7('0x20')](_0x253e40);})[_0xc6a7('0x14')](function(_0x4bfc6e){_0x2dbf61['rows']=_0x4bfc6e;return _0x2dbf61;});}})['then'](respondWithFilteredResult(_0x43f8a1,_0x253e40))[_0xc6a7('0x23')](handleError(_0x43f8a1,null));};exports[_0xc6a7('0x46')]=function(_0x586104,_0x346be7){return db[_0xc6a7('0x1b')][_0xc6a7('0x31')]({'where':{'id':_0x586104['params']['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x346be7,null))[_0xc6a7('0x14')](function(_0x4010cc){if(_0x4010cc){return _0x4010cc[_0xc6a7('0x47')](_0x586104['body']['ids'],_[_0xc6a7('0x35')](_0x586104[_0xc6a7('0x30')],['ids','id'])||{})[_0xc6a7('0x48')](function(){return db[_0xc6a7('0x49')][_0xc6a7('0x20')]({'attributes':['id',_0xc6a7('0x18'),_0xc6a7('0x4a')],'where':{'id':_0x586104[_0xc6a7('0x30')][_0xc6a7('0x36')]}});})[_0xc6a7('0x14')](function(_0x22ad06){socket[_0xc6a7('0x4b')](_0xc6a7('0x4c'),{'id':Number(_0x586104[_0xc6a7('0x25')]['id']),'tags':_0x22ad06||[]});return{'id':Number(_0x586104['params']['id']),'tags':_0x22ad06||[]};});}})['then'](respondWithResult(_0x346be7,null))[_0xc6a7('0x23')](handleError(_0x346be7,null));};exports[_0xc6a7('0x4d')]=function(_0x2138ba,_0x2731c3){return db[_0xc6a7('0x1b')][_0xc6a7('0x31')]({'where':{'id':_0x2138ba[_0xc6a7('0x25')]['id']}})[_0xc6a7('0x14')](handleEntityNotFound(_0x2731c3,null))['then'](function(_0x493f6d){if(_0x493f6d){return _0x493f6d[_0xc6a7('0x4d')](_0x2138ba[_0xc6a7('0x21')]['ids']);}})[_0xc6a7('0x14')](respondWithStatusCode(_0x2731c3,null))[_0xc6a7('0x23')](handleError(_0x2731c3,null));};exports[_0xc6a7('0x4e')]=function(_0x4d9c2f,_0x390a33){var _0x4bdc71=moment()[_0xc6a7('0x4f')]()[_0xc6a7('0x50')]();var _0x382a87=path[_0xc6a7('0x51')](config[_0xc6a7('0x52')],_0xc6a7('0x53'),_0xc6a7('0x54'),_0xc6a7('0x55'));var _0x3ccae6=path[_0xc6a7('0x51')](_0x382a87,_0x4bdc71);var _0x8c2a8=util[_0xc6a7('0x43')](_0xc6a7('0x56'),_0x4d9c2f[_0xc6a7('0x25')]['id'],_0x4bdc71);var _0x64988f=path[_0xc6a7('0x51')](_0x382a87,_0x8c2a8);var _0x537da7=[];_0x537da7[_0xc6a7('0x57')]({'model':db[_0xc6a7('0x58')],'as':_0xc6a7('0x58'),'attributes':['id',_0xc6a7('0x59')],'raw':!![]});_0x537da7[_0xc6a7('0x57')]({'model':db[_0xc6a7('0x5a')],'as':_0xc6a7('0x5b'),'attributes':['id',_0xc6a7('0x5c'),_0xc6a7('0x5d')],'raw':!![]});var _0x2cf649=[{'model':db['SmsMessage'],'as':_0xc6a7('0x5e'),'attributes':['id',_0xc6a7('0x30'),'createdAt',_0xc6a7('0x5f'),_0xc6a7('0x60'),'read'],'include':_0x537da7}];_0x2cf649['push']({'model':db[_0xc6a7('0x61')],'as':_0xc6a7('0x62'),'attributes':['id',_0xc6a7('0x18')]});_0x2cf649['push']({'model':db[_0xc6a7('0x58')],'as':_0xc6a7('0x63'),'attributes':['id',_0xc6a7('0x59')]});return db[_0xc6a7('0x1b')][_0xc6a7('0x31')]({'where':{'id':_0x4d9c2f['params']['id']},'include':_0x2cf649})[_0xc6a7('0x14')](handleEntityNotFound(_0x390a33,null))[_0xc6a7('0x14')](function(_0x49f30d){if(_0x49f30d){var _0x2c84d5=_0x49f30d[_0xc6a7('0x64')]({'plain':!![]});fs[_0xc6a7('0x65')](_0x3ccae6);var _0x16e31a={'channel':'Sms','account':_0x2c84d5[_0xc6a7('0x62')][_0xc6a7('0x18')],'agent':_0x2c84d5['Owner']?_0x2c84d5[_0xc6a7('0x63')][_0xc6a7('0x59')]:_0xc6a7('0x66'),'createdAt':moment(_0x2c84d5[_0xc6a7('0x67')])[_0xc6a7('0x43')](_0xc6a7('0x44'))[_0xc6a7('0x50')](),'closedAt':_0x2c84d5[_0xc6a7('0x68')]?moment(_0x2c84d5[_0xc6a7('0x69')])[_0xc6a7('0x43')](_0xc6a7('0x44'))[_0xc6a7('0x50')]():'','disposition':_0x2c84d5[_0xc6a7('0x6a')],'messages':_(_0x2c84d5[_0xc6a7('0x5e')])[_0xc6a7('0x3f')]({'secret':![]})[_0xc6a7('0x1a')](function(_0x483324){return{'date':moment(_0x483324['createdAt'])[_0xc6a7('0x43')](_0xc6a7('0x44'))[_0xc6a7('0x50')](),'sender':_0x483324[_0xc6a7('0x5f')]===_0xc6a7('0x6b')?_0x483324['User']?_0x483324[_0xc6a7('0x58')]['fullname']:_0xc6a7('0x6c'):_0x483324[_0xc6a7('0x5b')]['firstName']+(_0x483324[_0xc6a7('0x5b')][_0xc6a7('0x5d')]?'\x20'+_0x483324[_0xc6a7('0x5b')][_0xc6a7('0x5d')]:''),'body':_0x483324[_0xc6a7('0x30')],'direction':_0x483324['direction']===_0xc6a7('0x6b')?'A':'C','secret':_0x483324['secret'],'read':_0x483324[_0xc6a7('0x6d')]};})[_0xc6a7('0x6e')]()};return ejs[_0xc6a7('0x6f')](path[_0xc6a7('0x51')](config['root'],'server',_0xc6a7('0x70'),_0xc6a7('0x71')),{'interaction':_0x16e31a})[_0xc6a7('0x14')](function(_0x336d67){var _0x4622a0=path['join'](_0x3ccae6,_0xc6a7('0x72')+_0x2c84d5['id']+'-'+_0x4bdc71+_0xc6a7('0x73'));var _0x224797={'path':_0x4622a0,'channel':_0xc6a7('0x74'),'interactionId':_0x2c84d5['id']};return pdf[_0xc6a7('0x75')](_0x336d67,_0x224797);})[_0xc6a7('0x14')](function(){return new BPromise(function(_0x3b29bb,_0x23de26){zipdir(_0x3ccae6,{'saveTo':_0x64988f},function(_0x200b3a,_0x13459a){if(_0x200b3a)return _0x23de26(_0x200b3a);return _0x3b29bb(_0x13459a);});})['then'](function(){return new BPromise(function(_0x3c2931,_0x50b18c){rimraf(_0x3ccae6,function(_0x5939b2){if(_0x5939b2)_0x50b18c(_0x5939b2);return _0x3c2931();});});})[_0xc6a7('0x14')](function(){return _0x390a33[_0xc6a7('0x4e')](_0x64988f,_0x8c2a8,function(_0x2593e0){if(_0x2593e0){console['log']('err',_0x2593e0);}else{fs['unlinkSync'](_0x64988f);}});});});}else{return _0x390a33[_0xc6a7('0x76')](0xc8);}})[_0xc6a7('0x23')](handleError(_0x390a33,null));}; \ No newline at end of file +var _0x91fd=['length','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','smsInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','join','transcript-%d-%s.zip','push','fullname','CmContact','Contact','lastName','Messages','createdAt','direction','secret','read','Account','get','mkdirSync','Sms','Owner','closedAt','disposition','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','then','destroy','error','stack','name','send','index','map','rawAttributes','key','findAll','sms','query','user','catch','show','model','SmsInteraction','keys','intersection','attributes','fields'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x91fd,0xc1));var _0xd91f=function(_0x104487,_0x58cf49){_0x104487=_0x104487-0x0;var _0x242811=_0x91fd[_0x104487];return _0x242811;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd91f('0x0'));var moment=require('moment');var BPromise=require(_0xd91f('0x1'));var util=require(_0xd91f('0x2'));var path=require(_0xd91f('0x3'));var ejs=require(_0xd91f('0x4'));var fs=require('fs');var _=require(_0xd91f('0x5'));var Redis=require(_0xd91f('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xd91f('0x7'));var pdf=require(_0xd91f('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xd91f('0x9'));var db=require('../../mysqldb')['db'];config[_0xd91f('0xa')]=_[_0xd91f('0xb')](config[_0xd91f('0xa')],{'host':_0xd91f('0xc'),'port':0x18eb});var socket=require(_0xd91f('0xd'))(new Redis(config[_0xd91f('0xa')]));require(_0xd91f('0xe'))[_0xd91f('0xf')](socket);function respondWithStatusCode(_0x28de16,_0x466833){_0x466833=_0x466833||0xcc;return function(_0x2fd014){if(_0x2fd014){return _0x28de16[_0xd91f('0x10')](_0x466833);}return _0x28de16[_0xd91f('0x11')](_0x466833)[_0xd91f('0x12')]();};}function respondWithResult(_0x22b24b,_0x53d28a){_0x53d28a=_0x53d28a||0xc8;return function(_0x21d48a){if(_0x21d48a){return _0x22b24b['status'](_0x53d28a)[_0xd91f('0x13')](_0x21d48a);}};}function respondWithFilteredResult(_0x11474f,_0x4f3a01){return function(_0x18cb79){if(_0x18cb79){var _0x3a829d=typeof _0x4f3a01['offset']===_0xd91f('0x14')&&typeof _0x4f3a01['limit']==='undefined';var _0x1fc021=_0x18cb79[_0xd91f('0x15')];var _0x15631a=_0x3a829d?0x0:_0x4f3a01[_0xd91f('0x16')];var _0x282524=_0x3a829d?_0x18cb79[_0xd91f('0x15')]:_0x4f3a01[_0xd91f('0x16')]+_0x4f3a01[_0xd91f('0x17')];var _0x34752f;if(_0x282524>=_0x1fc021){_0x282524=_0x1fc021;_0x34752f=0xc8;}else{_0x34752f=0xce;}_0x11474f[_0xd91f('0x11')](_0x34752f);return _0x11474f[_0xd91f('0x18')]('Content-Range',_0x15631a+'-'+_0x282524+'/'+_0x1fc021)[_0xd91f('0x13')](_0x18cb79);}return null;};}function saveUpdates(_0x255590){return function(_0x314c93){if(_0x314c93){return _0x314c93['update'](_0x255590)[_0xd91f('0x19')](function(_0x68393f){return _0x68393f;});}return null;};}function removeEntity(_0xac557){return function(_0x4b4c6b){if(_0x4b4c6b){return _0x4b4c6b[_0xd91f('0x1a')]()['then'](function(){_0xac557[_0xd91f('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c154){return function(_0x55056d){if(!_0x55056d){_0x31c154[_0xd91f('0x10')](0x194);}return _0x55056d;};}function handleError(_0x565f11,_0x26c7bd){_0x26c7bd=_0x26c7bd||0x1f4;return function(_0x4621ba){logger[_0xd91f('0x1b')](_0x4621ba[_0xd91f('0x1c')]);if(_0x4621ba[_0xd91f('0x1d')]){delete _0x4621ba['name'];}_0x565f11[_0xd91f('0x11')](_0x26c7bd)[_0xd91f('0x1e')](_0x4621ba);};}exports[_0xd91f('0x1f')]=function(_0x294132,_0x5b6eb2){var _0x1adb91={};var _0x3f77b6=_[_0xd91f('0x20')](db['SmsInteraction'][_0xd91f('0x21')],function(_0x275774){return{'name':_0x275774['fieldName'],'type':_0x275774['type'][_0xd91f('0x22')]};});_0x1adb91=qs['getOptions'](_0x3f77b6,_0x294132);return interaction[_0xd91f('0x23')](_0xd91f('0x24'),_0x294132[_0xd91f('0x25')],_0x294132[_0xd91f('0x26')],_0x1adb91,_0x3f77b6)[_0xd91f('0x19')](respondWithFilteredResult(_0x5b6eb2,_0x1adb91))[_0xd91f('0x27')](handleError(_0x5b6eb2,null));};exports[_0xd91f('0x28')]=function(_0x2ab928,_0x1d33e2){var _0x324731={'raw':![],'where':{'id':_0x2ab928['params']['id']}},_0x195f29={};_0x195f29[_0xd91f('0x29')]=_['keys'](db[_0xd91f('0x2a')][_0xd91f('0x21')]);_0x195f29[_0xd91f('0x25')]=_[_0xd91f('0x2b')](_0x2ab928[_0xd91f('0x25')]);_0x195f29['filters']=_[_0xd91f('0x2c')](_0x195f29[_0xd91f('0x29')],_0x195f29[_0xd91f('0x25')]);_0x324731[_0xd91f('0x2d')]=_[_0xd91f('0x2c')](_0x195f29[_0xd91f('0x29')],qs[_0xd91f('0x2e')](_0x2ab928['query'][_0xd91f('0x2e')]));_0x324731[_0xd91f('0x2d')]=_0x324731[_0xd91f('0x2d')][_0xd91f('0x2f')]?_0x324731[_0xd91f('0x2d')]:_0x195f29[_0xd91f('0x29')];if(_0x2ab928[_0xd91f('0x25')][_0xd91f('0x30')]){_0x324731[_0xd91f('0x31')]=[{'all':!![]}];}_0x324731=_[_0xd91f('0x32')]({},_0x324731,_0x2ab928[_0xd91f('0x33')]);return db[_0xd91f('0x2a')][_0xd91f('0x34')](_0x324731)['then'](handleEntityNotFound(_0x1d33e2,null))[_0xd91f('0x19')](respondWithResult(_0x1d33e2,null))['catch'](handleError(_0x1d33e2,null));};exports[_0xd91f('0x35')]=function(_0x33be54,_0x34e558){return db['SmsInteraction'][_0xd91f('0x35')](_0x33be54[_0xd91f('0x36')],{})[_0xd91f('0x19')](respondWithResult(_0x34e558,0xc9))['catch'](handleError(_0x34e558,null));};exports[_0xd91f('0x37')]=function(_0x20fb00,_0xd59c10){if(_0x20fb00['body']['id']){delete _0x20fb00['body']['id'];}return db[_0xd91f('0x2a')][_0xd91f('0x34')]({'where':{'id':_0x20fb00[_0xd91f('0x38')]['id']}})[_0xd91f('0x19')](handleEntityNotFound(_0xd59c10,null))[_0xd91f('0x19')](saveUpdates(_0x20fb00[_0xd91f('0x36')],null))[_0xd91f('0x19')](respondWithResult(_0xd59c10,null))[_0xd91f('0x27')](handleError(_0xd59c10,null));};exports[_0xd91f('0x1a')]=function(_0x51b797,_0x2de00f){return db[_0xd91f('0x2a')][_0xd91f('0x34')]({'where':{'id':_0x51b797['params']['id']}})['then'](handleEntityNotFound(_0x2de00f,null))[_0xd91f('0x19')](removeEntity(_0x2de00f,null))[_0xd91f('0x27')](handleError(_0x2de00f,null));};exports[_0xd91f('0x39')]=function(_0x4d0678,_0xbc5c16){return db['SmsInteraction']['describe']()[_0xd91f('0x19')](respondWithResult(_0xbc5c16,null))[_0xd91f('0x27')](handleError(_0xbc5c16,null));};exports[_0xd91f('0x3a')]=function(_0x4999ab,_0x243fb6){return db[_0xd91f('0x3b')][_0xd91f('0x34')]({'where':{'id':_0x4999ab['params']['id']}})[_0xd91f('0x19')](handleEntityNotFound(_0x243fb6,null))['then'](function(_0x509a61){if(_0x509a61){return _0x509a61[_0xd91f('0x3a')](_0x4999ab['body']['ids'],_[_0xd91f('0x3c')](_0x4999ab['body'],[_0xd91f('0x3d'),'id'])||{});}})[_0xd91f('0x19')](respondWithResult(_0x243fb6,null))[_0xd91f('0x27')](handleError(_0x243fb6,null));};exports[_0xd91f('0x3e')]=function(_0x58b7e4,_0x4f2478){var _0x185bea={'raw':![],'where':{}};var _0x1c5ea8={};var _0x1625c9={'count':0x0,'rows':[]};return db[_0xd91f('0x2a')][_0xd91f('0x3f')]({'where':{'id':_0x58b7e4['params']['id']}})[_0xd91f('0x19')](handleEntityNotFound(_0x4f2478,null))['then'](function(_0x9bb419){if(_0x9bb419){_0x1c5ea8[_0xd91f('0x29')]=_[_0xd91f('0x2b')](db[_0xd91f('0x3b')][_0xd91f('0x21')]);_0x1c5ea8['query']=_[_0xd91f('0x2b')](_0x58b7e4['query']);_0x1c5ea8[_0xd91f('0x40')]=_['intersection'](_0x1c5ea8[_0xd91f('0x29')],_0x1c5ea8[_0xd91f('0x25')]);_0x185bea['attributes']=_[_0xd91f('0x2c')](_0x1c5ea8[_0xd91f('0x29')],qs[_0xd91f('0x2e')](_0x58b7e4['query'][_0xd91f('0x2e')]));_0x185bea[_0xd91f('0x2d')]=_0x185bea['attributes'][_0xd91f('0x2f')]?_0x185bea[_0xd91f('0x2d')]:_0x1c5ea8[_0xd91f('0x29')];if(!_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x41')](_0xd91f('0x42'))){_0x185bea[_0xd91f('0x17')]=qs['limit'](_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x17')]);_0x185bea['offset']=qs[_0xd91f('0x16')](_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x16')]);}_0x185bea[_0xd91f('0x43')]=qs[_0xd91f('0x44')](_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x44')]);_0x185bea[_0xd91f('0x45')]=qs[_0xd91f('0x40')](_['pick'](_0x58b7e4['query'],_0x1c5ea8[_0xd91f('0x40')]));_0x185bea[_0xd91f('0x45')][_0xd91f('0x46')]=_0x9bb419['id'];if(_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x47')]){_0x185bea['where']=_[_0xd91f('0x32')](_0x185bea[_0xd91f('0x45')],{'$or':_['map'](_0x185bea[_0xd91f('0x2d')],function(_0x23d1f8){var _0x4879f1={};_0x4879f1[_0x23d1f8]={'$like':'%'+_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x47')]+'%'};return _0x4879f1;})});}if(_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x48')]){var _0x12db37=_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x48')][_0xd91f('0x49')](',');var _0x4fce4e={};_0x4fce4e[_0x12db37[0x0]]={'$gte':moment(_0x12db37[0x1])[_0xd91f('0x4a')](_0xd91f('0x4b'))};_0x185bea[_0xd91f('0x45')]=_[_0xd91f('0x32')](_0x185bea[_0xd91f('0x45')],_0x4fce4e);}_0x185bea=_[_0xd91f('0x32')]({},_0x185bea,_0x58b7e4['options']);return db[_0xd91f('0x3b')][_0xd91f('0x15')]({'where':_0x185bea[_0xd91f('0x45')]})[_0xd91f('0x19')](function(_0xed961){_0x1625c9['count']=_0xed961;if(_0x58b7e4[_0xd91f('0x25')][_0xd91f('0x30')]){_0x185bea['include']=[{'all':!![]}];}return db[_0xd91f('0x3b')][_0xd91f('0x23')](_0x185bea);})[_0xd91f('0x19')](function(_0x53553f){_0x1625c9[_0xd91f('0x4c')]=_0x53553f;return _0x1625c9;});}})[_0xd91f('0x19')](respondWithFilteredResult(_0x4f2478,_0x185bea))[_0xd91f('0x27')](handleError(_0x4f2478,null));};exports[_0xd91f('0x4d')]=function(_0x536a3f,_0x36a5d9){return db[_0xd91f('0x2a')][_0xd91f('0x34')]({'where':{'id':_0x536a3f[_0xd91f('0x38')]['id']}})[_0xd91f('0x19')](handleEntityNotFound(_0x36a5d9,null))['then'](function(_0x210d94){if(_0x210d94){return _0x210d94[_0xd91f('0x4e')](_0x536a3f[_0xd91f('0x36')][_0xd91f('0x3d')],_[_0xd91f('0x3c')](_0x536a3f[_0xd91f('0x36')],[_0xd91f('0x3d'),'id'])||{})['spread'](function(){return db[_0xd91f('0x4f')][_0xd91f('0x23')]({'attributes':['id',_0xd91f('0x1d'),_0xd91f('0x50')],'where':{'id':_0x536a3f[_0xd91f('0x36')][_0xd91f('0x3d')]}});})['then'](function(_0x27e52a){socket['emit'](_0xd91f('0x51'),{'id':Number(_0x536a3f[_0xd91f('0x38')]['id']),'tags':_0x27e52a||[]});return{'id':Number(_0x536a3f[_0xd91f('0x38')]['id']),'tags':_0x27e52a||[]};});}})[_0xd91f('0x19')](respondWithResult(_0x36a5d9,null))[_0xd91f('0x27')](handleError(_0x36a5d9,null));};exports[_0xd91f('0x52')]=function(_0x2a65b4,_0x4367d4){return db[_0xd91f('0x2a')]['find']({'where':{'id':_0x2a65b4['params']['id']}})[_0xd91f('0x19')](handleEntityNotFound(_0x4367d4,null))[_0xd91f('0x19')](function(_0x483b32){if(_0x483b32){return _0x483b32['removeTags'](_0x2a65b4['query'][_0xd91f('0x3d')]);}})[_0xd91f('0x19')](respondWithStatusCode(_0x4367d4,null))[_0xd91f('0x27')](handleError(_0x4367d4,null));};exports[_0xd91f('0x53')]=function(_0x4e9790,_0x59aa53){var _0x5701a6=moment()[_0xd91f('0x54')]()[_0xd91f('0x55')]();var _0x4c1fee=path['join'](config['root'],_0xd91f('0x56'),_0xd91f('0x57'),_0xd91f('0x58'));var _0x29b169=path[_0xd91f('0x59')](_0x4c1fee,_0x5701a6);var _0x28760a=util[_0xd91f('0x4a')](_0xd91f('0x5a'),_0x4e9790[_0xd91f('0x38')]['id'],_0x5701a6);var _0x16fe0d=path[_0xd91f('0x59')](_0x4c1fee,_0x28760a);var _0x5f05a7=[];_0x5f05a7[_0xd91f('0x5b')]({'model':db['User'],'as':'User','attributes':['id',_0xd91f('0x5c')],'raw':!![]});_0x5f05a7['push']({'model':db[_0xd91f('0x5d')],'as':_0xd91f('0x5e'),'attributes':['id','firstName',_0xd91f('0x5f')],'raw':!![]});var _0x3d9b26=[{'model':db[_0xd91f('0x3b')],'as':_0xd91f('0x60'),'attributes':['id',_0xd91f('0x36'),_0xd91f('0x61'),_0xd91f('0x62'),_0xd91f('0x63'),_0xd91f('0x64')],'include':_0x5f05a7}];_0x3d9b26[_0xd91f('0x5b')]({'model':db['SmsAccount'],'as':_0xd91f('0x65'),'attributes':['id','name']});_0x3d9b26[_0xd91f('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd91f('0x5c')]});return db['SmsInteraction'][_0xd91f('0x34')]({'where':{'id':_0x4e9790['params']['id']},'include':_0x3d9b26})['then'](handleEntityNotFound(_0x59aa53,null))[_0xd91f('0x19')](function(_0x3f633e){if(_0x3f633e){var _0x137787=_0x3f633e[_0xd91f('0x66')]({'plain':!![]});fs[_0xd91f('0x67')](_0x29b169);var _0x29f96f={'channel':_0xd91f('0x68'),'account':_0x137787[_0xd91f('0x65')]['name'],'agent':_0x137787[_0xd91f('0x69')]?_0x137787['Owner'][_0xd91f('0x5c')]:'N.A.','createdAt':moment(_0x137787[_0xd91f('0x61')])[_0xd91f('0x4a')](_0xd91f('0x4b'))['toString'](),'closedAt':_0x137787['closed']?moment(_0x137787[_0xd91f('0x6a')])[_0xd91f('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x137787[_0xd91f('0x6b')],'messages':_(_0x137787[_0xd91f('0x60')])[_0xd91f('0x47')]({'secret':![]})[_0xd91f('0x20')](function(_0x466272){return{'date':moment(_0x466272[_0xd91f('0x61')])[_0xd91f('0x4a')](_0xd91f('0x4b'))[_0xd91f('0x55')](),'sender':_0x466272['direction']===_0xd91f('0x6c')?_0x466272['User']?_0x466272['User']['fullname']:_0xd91f('0x6d'):_0x466272[_0xd91f('0x5e')][_0xd91f('0x6e')]+(_0x466272['Contact'][_0xd91f('0x5f')]?'\x20'+_0x466272[_0xd91f('0x5e')][_0xd91f('0x5f')]:''),'body':_0x466272[_0xd91f('0x36')],'direction':_0x466272[_0xd91f('0x62')]===_0xd91f('0x6c')?'A':'C','secret':_0x466272[_0xd91f('0x63')],'read':_0x466272[_0xd91f('0x64')]};})[_0xd91f('0x6f')]()};return ejs[_0xd91f('0x70')](path[_0xd91f('0x59')](config['root'],'server',_0xd91f('0x71'),_0xd91f('0x72')),{'interaction':_0x29f96f})[_0xd91f('0x19')](function(_0x183970){var _0x1a770e=path[_0xd91f('0x59')](_0x29b169,_0xd91f('0x73')+_0x137787['id']+'-'+_0x5701a6+_0xd91f('0x74'));var _0x131530={'path':_0x1a770e,'channel':_0xd91f('0x68'),'interactionId':_0x137787['id']};return pdf['createPdfFromHTML'](_0x183970,_0x131530);})[_0xd91f('0x19')](function(){return new BPromise(function(_0x1c5e32,_0x39d2a9){zipdir(_0x29b169,{'saveTo':_0x16fe0d},function(_0x18a14c,_0x5955bb){if(_0x18a14c)return _0x39d2a9(_0x18a14c);return _0x1c5e32(_0x5955bb);});})[_0xd91f('0x19')](function(){return new BPromise(function(_0xa12431,_0x4dafac){rimraf(_0x29b169,function(_0x56f31f){if(_0x56f31f)_0x4dafac(_0x56f31f);return _0xa12431();});});})[_0xd91f('0x19')](function(){return _0x59aa53[_0xd91f('0x53')](_0x16fe0d,_0x28760a,function(_0x38b177){if(_0x38b177){console[_0xd91f('0x75')](_0xd91f('0x76'),_0x38b177);}else{fs[_0xd91f('0x77')](_0x16fe0d);}});});});}else{return _0x59aa53[_0xd91f('0x10')](0xc8);}})[_0xd91f('0x27')](handleError(_0x59aa53,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index b287540..2c6435a 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1775=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x470607,_0x2a48b2){var _0x262a12=function(_0x1a5eb9){while(--_0x1a5eb9){_0x470607['push'](_0x470607['shift']());}};_0x262a12(++_0x2a48b2);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var SmsMessage=require(_0x5177('0x0'))['db'][_0x5177('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5177('0x3')](0x0);var events={'afterCreate':_0x5177('0x4'),'afterUpdate':_0x5177('0x5'),'afterDestroy':_0x5177('0x6')};function emitEvent(_0x359401){return function(_0x51275f,_0x159a20,_0x2c5c42){_0x51275f[_0x5177('0x7')]({'attributes':['id'],'raw':!![]})[_0x5177('0x8')](function(_0x300b43){_0x51275f[_0x5177('0x9')](_0x5177('0xa'),_0x300b43[_0x5177('0xb')](function(_0x16e7a7){return{'id':_0x16e7a7['id']};}));return SmsMessage[_0x5177('0xc')]({'where':{'SmsInteractionId':_0x51275f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5177('0x8')](function(_0x206035){_0x51275f['setDataValue']('unreadMessages',_0x206035[_0x5177('0xd')]);SmsInteractionEvents[_0x5177('0xe')](_0x359401+':'+_0x51275f['id'],_0x51275f);SmsInteractionEvents[_0x5177('0xe')](_0x359401,_0x51275f);_0x2c5c42(null);})[_0x5177('0xf')](_0x2c5c42(null));};}for(var e in events){if(events[_0x5177('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5177('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0xee6ff0,_0x24af30){var _0xe949a1=function(_0xd6a5a5){while(--_0xd6a5a5){_0xee6ff0['push'](_0xee6ff0['shift']());}};_0xe949a1(++_0x24af30);}(_0x583c,0x12b));var _0xc583=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x583c[_0x32f9ca];return _0x52e083;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c67868a..caf0cf9 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 _0x07f4=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','closedAt','format'];(function(_0x38731b,_0x5b9af3){var _0x4ad732=function(_0x2b4307){while(--_0x2b4307){_0x38731b['push'](_0x38731b['shift']());}};_0x4ad732(++_0x5b9af3);}(_0x07f4,0x15f));var _0x407f=function(_0x2c58e3,_0x21741f){_0x2c58e3=_0x2c58e3-0x0;var _0x16b6ed=_0x07f4[_0x2c58e3];return _0x16b6ed;};'use strict';var _=require('lodash');var util=require(_0x407f('0x0'));var logger=require(_0x407f('0x1'))(_0x407f('0x2'));var moment=require(_0x407f('0x3'));var BPromise=require(_0x407f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x407f('0x5'));var rimraf=require(_0x407f('0x6'));var config=require(_0x407f('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x4717e5,_0xb66288){return _0x4717e5[_0x407f('0x8')](_0x407f('0x9'),attributes,{'tableName':_0x407f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bc2bb,_0x28ef74,_0x1cde98){if(_0x5bc2bb['changed']('closed')){_0x5bc2bb[_0x407f('0xb')]=moment()[_0x407f('0xc')](_0x407f('0xd'));}_0x1cde98(null,_0x5bc2bb);}}});}; \ No newline at end of file +var _0x41ce=['changed','closed','format','lodash','util','api','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions'];(function(_0x16aeee,_0x387a62){var _0x2b0820=function(_0x527017){while(--_0x527017){_0x16aeee['push'](_0x16aeee['shift']());}};_0x2b0820(++_0x387a62);}(_0x41ce,0x16f));var _0xe41c=function(_0x45761e,_0x1e9fde){_0x45761e=_0x45761e-0x0;var _0x2c7e9d=_0x41ce[_0x45761e];return _0x2c7e9d;};'use strict';var _=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var logger=require('../../config/logger')(_0xe41c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe41c('0x3'));var fs=require('fs');var path=require(_0xe41c('0x4'));var rimraf=require(_0xe41c('0x5'));var config=require(_0xe41c('0x6'));var attributes=require(_0xe41c('0x7'));module[_0xe41c('0x8')]=function(_0x54c9d0,_0x4358a1){return _0x54c9d0['define'](_0xe41c('0x9'),attributes,{'tableName':_0xe41c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3adc52,_0x16bb1f,_0x4377b7){if(_0x3adc52[_0xe41c('0xb')](_0xe41c('0xc'))){_0x3adc52['closedAt']=moment()[_0xe41c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4377b7(null,_0x3adc52);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 371c01e..d550a23 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 _0xb0e7=['SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','attributes','limit','then','info','debug','AddTagsToSmsInteraction','find','where','body','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./smsInteraction.socket','register','request'];(function(_0x4657ec,_0xf2001a){var _0x572e88=function(_0xea4f06){while(--_0xea4f06){_0x4657ec['push'](_0x4657ec['shift']());}};_0x572e88(++_0xf2001a);}(_0xb0e7,0x173));var _0x7b0e=function(_0x5fcd98,_0x4c9805){_0x5fcd98=_0x5fcd98-0x0;var _0x1a9be7=_0xb0e7[_0x5fcd98];return _0x1a9be7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b0e('0x0'));var BPromise=require(_0x7b0e('0x1'));var rs=require(_0x7b0e('0x2'));var fs=require('fs');var Redis=require(_0x7b0e('0x3'));var db=require(_0x7b0e('0x4'))['db'];var utils=require(_0x7b0e('0x5'));var logger=require(_0x7b0e('0x6'))(_0x7b0e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b0e('0x8'));var client=jayson[_0x7b0e('0x9')][_0x7b0e('0xa')]({'port':0x232a});config[_0x7b0e('0xb')]=_[_0x7b0e('0xc')](config[_0x7b0e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b0e('0xb')]));require(_0x7b0e('0xd'))[_0x7b0e('0xe')](socket);function respondWithRpcPromise(_0x134f5f,_0x30a94a,_0x133faa){return new BPromise(function(_0x5496e2,_0x47e670){return client[_0x7b0e('0xf')](_0x134f5f,_0x133faa)['then'](function(_0x5cf32e){logger['info'](_0x7b0e('0x10'),_0x30a94a,_0x7b0e('0x11'));logger['debug'](_0x7b0e('0x12'),_0x30a94a,_0x7b0e('0x11'),JSON[_0x7b0e('0x13')](_0x5cf32e));if(_0x5cf32e[_0x7b0e('0x14')]){if(_0x5cf32e['error'][_0x7b0e('0x15')]===0x1f4){logger['error'](_0x7b0e('0x10'),_0x30a94a,_0x5cf32e[_0x7b0e('0x14')][_0x7b0e('0x16')]);return _0x47e670(_0x5cf32e[_0x7b0e('0x14')][_0x7b0e('0x16')]);}logger['error'](_0x7b0e('0x10'),_0x30a94a,_0x5cf32e['error'][_0x7b0e('0x16')]);return _0x5496e2(_0x5cf32e['error'][_0x7b0e('0x16')]);}else{logger['info'](_0x7b0e('0x10'),_0x30a94a,'request\x20sent');_0x5496e2(_0x5cf32e[_0x7b0e('0x17')][_0x7b0e('0x16')]);}})[_0x7b0e('0x18')](function(_0x4fba64){logger[_0x7b0e('0x14')](_0x7b0e('0x10'),_0x30a94a,_0x4fba64);_0x47e670(_0x4fba64);});});}exports[_0x7b0e('0x19')]=function(_0x3583d3){var _0x32b5b7=this;return new Promise(function(_0x40ba73,_0xb4e5c8){return db[_0x7b0e('0x1a')][_0x7b0e('0x1b')](_0x3583d3['body'],{'raw':_0x3583d3[_0x7b0e('0x1c')]?_0x3583d3[_0x7b0e('0x1c')][_0x7b0e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3583d3['options']?_0x3583d3[_0x7b0e('0x1c')]['where']||null:null,'attributes':_0x3583d3[_0x7b0e('0x1c')]?_0x3583d3[_0x7b0e('0x1c')][_0x7b0e('0x1e')]||null:null,'limit':_0x3583d3[_0x7b0e('0x1c')]?_0x3583d3[_0x7b0e('0x1c')][_0x7b0e('0x1f')]||null:null})[_0x7b0e('0x20')](function(_0x27b1c8){logger[_0x7b0e('0x21')]('UpdateSmsInteraction',_0x3583d3);logger[_0x7b0e('0x22')](_0x7b0e('0x19'),_0x3583d3,JSON[_0x7b0e('0x13')](_0x27b1c8));_0x40ba73(_0x27b1c8);})[_0x7b0e('0x18')](function(_0xbd4eb){logger['error'](_0x7b0e('0x19'),_0xbd4eb[_0x7b0e('0x16')],_0x3583d3);_0xb4e5c8(_0x32b5b7[_0x7b0e('0x14')](0x1f4,_0xbd4eb[_0x7b0e('0x16')]));});});};exports[_0x7b0e('0x23')]=function(_0x5a2f2c){return new Promise(function(_0x21c82d,_0x1384f3){return db[_0x7b0e('0x1a')][_0x7b0e('0x24')]({'where':_0x5a2f2c['options']?_0x5a2f2c[_0x7b0e('0x1c')][_0x7b0e('0x25')]||null:null})[_0x7b0e('0x20')](function(_0xb1f0f1){if(_0xb1f0f1){return _0xb1f0f1['addTags'](_0x5a2f2c[_0x7b0e('0x26')][_0x7b0e('0x27')],_[_0x7b0e('0x28')](_0x5a2f2c['body'],[_0x7b0e('0x27'),'id'])||{});}})[_0x7b0e('0x29')](function(_0x16564d){logger[_0x7b0e('0x21')](_0x7b0e('0x2a'),_0x5a2f2c);logger[_0x7b0e('0x22')](_0x7b0e('0x2a'),_0x5a2f2c,JSON[_0x7b0e('0x13')](_0x16564d));_0x21c82d(_0x16564d);})['catch'](function(_0xba2224){logger['error'](_0x7b0e('0x2a'),_0xba2224[_0x7b0e('0x16')],_0x5a2f2c);_0x1384f3(_this[_0x7b0e('0x14')](0x1f4,_0xba2224[_0x7b0e('0x16')]));});});}; \ No newline at end of file +var _0xf6be=['redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','UpdateSmsInteraction','update','body','options','raw','attributes','limit','stringify','catch','AddTagsToSmsInteraction','SmsInteraction','find','where','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6be,0x14f));var _0xef6b=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xf6be[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef6b('0x0'));var BPromise=require(_0xef6b('0x1'));var rs=require(_0xef6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef6b('0x3'))(_0xef6b('0x4'));var config=require(_0xef6b('0x5'));var jayson=require(_0xef6b('0x6'));var client=jayson[_0xef6b('0x7')][_0xef6b('0x8')]({'port':0x232a});config[_0xef6b('0x9')]=_['defaults'](config[_0xef6b('0x9')],{'host':_0xef6b('0xa'),'port':0x18eb});var socket=require(_0xef6b('0xb'))(new Redis(config[_0xef6b('0x9')]));require(_0xef6b('0xc'))[_0xef6b('0xd')](socket);function respondWithRpcPromise(_0x2400de,_0x14b358,_0x1473ba){return new BPromise(function(_0x1bfde0,_0x896212){return client[_0xef6b('0xe')](_0x2400de,_0x1473ba)[_0xef6b('0xf')](function(_0x2869bb){logger[_0xef6b('0x10')](_0xef6b('0x11'),_0x14b358,'request\x20sent');logger[_0xef6b('0x12')](_0xef6b('0x13'),_0x14b358,'request\x20sent',JSON['stringify'](_0x2869bb));if(_0x2869bb[_0xef6b('0x14')]){if(_0x2869bb[_0xef6b('0x14')][_0xef6b('0x15')]===0x1f4){logger[_0xef6b('0x14')](_0xef6b('0x11'),_0x14b358,_0x2869bb[_0xef6b('0x14')][_0xef6b('0x16')]);return _0x896212(_0x2869bb[_0xef6b('0x14')][_0xef6b('0x16')]);}logger[_0xef6b('0x14')](_0xef6b('0x11'),_0x14b358,_0x2869bb[_0xef6b('0x14')][_0xef6b('0x16')]);return _0x1bfde0(_0x2869bb[_0xef6b('0x14')][_0xef6b('0x16')]);}else{logger[_0xef6b('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x14b358,_0xef6b('0x17'));_0x1bfde0(_0x2869bb[_0xef6b('0x18')]['message']);}})['catch'](function(_0x4fbdff){logger['error'](_0xef6b('0x11'),_0x14b358,_0x4fbdff);_0x896212(_0x4fbdff);});});}exports[_0xef6b('0x19')]=function(_0x14bdc8){var _0x1f7cee=this;return new Promise(function(_0x406b6f,_0x5d1aae){return db['SmsInteraction'][_0xef6b('0x1a')](_0x14bdc8[_0xef6b('0x1b')],{'raw':_0x14bdc8[_0xef6b('0x1c')]?_0x14bdc8[_0xef6b('0x1c')][_0xef6b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14bdc8[_0xef6b('0x1c')]?_0x14bdc8['options']['where']||null:null,'attributes':_0x14bdc8[_0xef6b('0x1c')]?_0x14bdc8['options'][_0xef6b('0x1e')]||null:null,'limit':_0x14bdc8[_0xef6b('0x1c')]?_0x14bdc8[_0xef6b('0x1c')][_0xef6b('0x1f')]||null:null})[_0xef6b('0xf')](function(_0x25d1b4){logger[_0xef6b('0x10')]('UpdateSmsInteraction',_0x14bdc8);logger[_0xef6b('0x12')]('UpdateSmsInteraction',_0x14bdc8,JSON[_0xef6b('0x20')](_0x25d1b4));_0x406b6f(_0x25d1b4);})[_0xef6b('0x21')](function(_0x51f05c){logger[_0xef6b('0x14')]('UpdateSmsInteraction',_0x51f05c[_0xef6b('0x16')],_0x14bdc8);_0x5d1aae(_0x1f7cee[_0xef6b('0x14')](0x1f4,_0x51f05c[_0xef6b('0x16')]));});});};exports[_0xef6b('0x22')]=function(_0x5f3dba){return new Promise(function(_0x2ce23b,_0x196043){return db[_0xef6b('0x23')][_0xef6b('0x24')]({'where':_0x5f3dba[_0xef6b('0x1c')]?_0x5f3dba['options'][_0xef6b('0x25')]||null:null})['then'](function(_0x31b0eb){if(_0x31b0eb){return _0x31b0eb[_0xef6b('0x26')](_0x5f3dba['body'][_0xef6b('0x27')],_[_0xef6b('0x28')](_0x5f3dba['body'],[_0xef6b('0x27'),'id'])||{});}})[_0xef6b('0x29')](function(_0x288582){logger[_0xef6b('0x10')](_0xef6b('0x2a'),_0x5f3dba);logger['debug']('AddTags',_0x5f3dba,JSON['stringify'](_0x288582));_0x2ce23b(_0x288582);})['catch'](function(_0x47437c){logger[_0xef6b('0x14')](_0xef6b('0x2a'),_0x47437c[_0xef6b('0x16')],_0x5f3dba);_0x196043(_this['error'](0x1f4,_0x47437c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index cfc4fe6..04a4b49 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 _0x64b0=['remove','update','emit','removeListener','register','length','./smsInteraction.events','save'];(function(_0x72cc4f,_0x38df3b){var _0x3c14d5=function(_0x10d93b){while(--_0x10d93b){_0x72cc4f['push'](_0x72cc4f['shift']());}};_0x3c14d5(++_0x38df3b);}(_0x64b0,0xe6));var _0x064b=function(_0xb59078,_0x2aff7a){_0xb59078=_0xb59078-0x0;var _0x26e5b3=_0x64b0[_0xb59078];return _0x26e5b3;};'use strict';var SmsInteractionEvents=require(_0x064b('0x0'));var events=[_0x064b('0x1'),_0x064b('0x2'),_0x064b('0x3')];function createListener(_0x179b7b,_0x71ae59){return function(_0x3f2fca){_0x71ae59[_0x064b('0x4')](_0x179b7b,_0x3f2fca);};}function removeListener(_0xfdca5,_0x48d7a0){return function(){SmsInteractionEvents[_0x064b('0x5')](_0xfdca5,_0x48d7a0);};}exports[_0x064b('0x6')]=function(_0x3d7e5b){for(var _0x4dc6d6=0x0,_0x441bdb=events[_0x064b('0x7')];_0x4dc6d6<_0x441bdb;_0x4dc6d6++){var _0x415da5=events[_0x4dc6d6];var _0x34c152=createListener('smsInteraction:'+_0x415da5,_0x3d7e5b);SmsInteractionEvents['on'](_0x415da5,_0x34c152);}}; \ No newline at end of file +var _0x3de6=['removeListener','register','smsInteraction:','./smsInteraction.events','save','update','emit'];(function(_0x4ace84,_0x4a8422){var _0x18459c=function(_0x43f35a){while(--_0x43f35a){_0x4ace84['push'](_0x4ace84['shift']());}};_0x18459c(++_0x4a8422);}(_0x3de6,0x153));var _0x63de=function(_0x5b839f,_0x5c7858){_0x5b839f=_0x5b839f-0x0;var _0x5c2336=_0x3de6[_0x5b839f];return _0x5c2336;};'use strict';var SmsInteractionEvents=require(_0x63de('0x0'));var events=[_0x63de('0x1'),'remove',_0x63de('0x2')];function createListener(_0x2f5861,_0x40eac1){return function(_0x44a550){_0x40eac1[_0x63de('0x3')](_0x2f5861,_0x44a550);};}function removeListener(_0x166923,_0x3fa913){return function(){SmsInteractionEvents[_0x63de('0x4')](_0x166923,_0x3fa913);};}exports[_0x63de('0x5')]=function(_0x2e5178){for(var _0x5661d8=0x0,_0x340647=events['length'];_0x5661d8<_0x340647;_0x5661d8++){var _0x1b6d75=events[_0x5661d8];var _0x36e591=createListener(_0x63de('0x6')+_0x1b6d75,_0x2e5178);SmsInteractionEvents['on'](_0x1b6d75,_0x36e591);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6cc339b..755895e 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 _0x6262=['/:id/reject','reject','destroy','exports','util','connect-timeout','express','Router','../../config/environment','get','index','isAuthenticated','describe','/:id','tracked','sms','smsmessage:create','create','status','update','/:id/accept','put'];(function(_0x2204ff,_0x3c4b02){var _0x53c57d=function(_0x182323){while(--_0x182323){_0x2204ff['push'](_0x2204ff['shift']());}};_0x53c57d(++_0x3c4b02);}(_0x6262,0x72));var _0x2626=function(_0x4f9673,_0x4313bd){_0x4f9673=_0x4f9673-0x0;var _0x337e5e=_0x6262[_0x4f9673];return _0x337e5e;};'use strict';var multer=require('multer');var util=require(_0x2626('0x0'));var path=require('path');var timeout=require(_0x2626('0x1'));var express=require(_0x2626('0x2'));var router=express[_0x2626('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2626('0x4'));var controller=require('./smsMessage.controller');router[_0x2626('0x5')]('/',auth['isAuthenticated'](),controller[_0x2626('0x6')]);router['get']('/describe',auth[_0x2626('0x7')](),controller[_0x2626('0x8')]);router[_0x2626('0x5')](_0x2626('0x9'),auth[_0x2626('0x7')](),controller['show']);router['post']('/',auth[_0x2626('0x7')](),interaction[_0x2626('0xa')](_0x2626('0xb'),_0x2626('0xc')),controller[_0x2626('0xd')]);router['post']('/:id/status',controller[_0x2626('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2626('0xf')]);router['put'](_0x2626('0x10'),auth[_0x2626('0x7')](),controller['accept']);router[_0x2626('0x11')](_0x2626('0x12'),auth[_0x2626('0x7')](),controller[_0x2626('0x13')]);router['delete'](_0x2626('0x9'),auth[_0x2626('0x7')](),controller[_0x2626('0x14')]);module[_0x2626('0x15')]=router; \ No newline at end of file +var _0xda44=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','smsmessage:create','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x33afa5,_0xf82d17){var _0x1f326b=function(_0x37fd4d){while(--_0x37fd4d){_0x33afa5['push'](_0x33afa5['shift']());}};_0x1f326b(++_0xf82d17);}(_0xda44,0x175));var _0x4da4=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xda44[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x4da4('0x0'));var util=require(_0x4da4('0x1'));var path=require(_0x4da4('0x2'));var timeout=require(_0x4da4('0x3'));var express=require(_0x4da4('0x4'));var router=express[_0x4da4('0x5')]();var fs_extra=require(_0x4da4('0x6'));var auth=require(_0x4da4('0x7'));var interaction=require(_0x4da4('0x8'));var config=require(_0x4da4('0x9'));var controller=require(_0x4da4('0xa'));router['get']('/',auth[_0x4da4('0xb')](),controller[_0x4da4('0xc')]);router[_0x4da4('0xd')](_0x4da4('0xe'),auth[_0x4da4('0xb')](),controller[_0x4da4('0xf')]);router[_0x4da4('0xd')](_0x4da4('0x10'),auth[_0x4da4('0xb')](),controller[_0x4da4('0x11')]);router[_0x4da4('0x12')]('/',auth[_0x4da4('0xb')](),interaction[_0x4da4('0x13')]('sms',_0x4da4('0x14')),controller[_0x4da4('0x15')]);router[_0x4da4('0x12')](_0x4da4('0x16'),controller['status']);router[_0x4da4('0x17')](_0x4da4('0x10'),auth[_0x4da4('0xb')](),controller['update']);router[_0x4da4('0x17')](_0x4da4('0x18'),auth[_0x4da4('0xb')](),controller[_0x4da4('0x19')]);router[_0x4da4('0x17')](_0x4da4('0x1a'),auth[_0x4da4('0xb')](),controller[_0x4da4('0x1b')]);router[_0x4da4('0x1c')](_0x4da4('0x10'),auth[_0x4da4('0xb')](),controller[_0x4da4('0x1d')]);module[_0x4da4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 0a44263..ef0936c 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 _0xa1cc=['STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium','out'];(function(_0x1d3e0c,_0x3c2071){var _0x372ce3=function(_0x54f852){while(--_0x54f852){_0x1d3e0c['push'](_0x1d3e0c['shift']());}};_0x372ce3(++_0x3c2071);}(_0xa1cc,0x93));var _0xca1c=function(_0x5ca712,_0x232230){_0x5ca712=_0x5ca712-0x0;var _0x4fc4a2=_0xa1cc[_0x5ca712];return _0x4fc4a2;};'use strict';var Sequelize=require(_0xca1c('0x0'));module[_0xca1c('0x1')]={'body':{'type':Sequelize[_0xca1c('0x2')](_0xca1c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xca1c('0x4')),'defaultValue':_0xca1c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xca1c('0x5')](0xbe)},'phone':{'type':Sequelize[_0xca1c('0x5')]},'readAt':{'type':Sequelize[_0xca1c('0x6')]},'secret':{'type':Sequelize[_0xca1c('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xca1c('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x30a7=['out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x30a7,0xf1));var _0x730a=function(_0x23c134,_0x4ee6a3){_0x23c134=_0x23c134-0x0;var _0x27f2a0=_0x30a7[_0x23c134];return _0x27f2a0;};'use strict';var Sequelize=require('sequelize');module[_0x730a('0x0')]={'body':{'type':Sequelize[_0x730a('0x1')](_0x730a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x730a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x730a('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x730a('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x730a('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x730a('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 73269d7..968d121 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 _0x3b90=['motionChannel','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','User','interface','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','undefined','limit','count','offset','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsMessage','findAll','rows','show','params','create','body','find','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','SIP/%s'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x3b90,0x143));var _0x03b9=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x3b90[_0x3fc97b];return _0x3a0c82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03b9('0x0'));var zipdir=require(_0x03b9('0x1'));var jsonpatch=require(_0x03b9('0x2'));var rp=require(_0x03b9('0x3'));var moment=require(_0x03b9('0x4'));var BPromise=require(_0x03b9('0x5'));var Mustache=require(_0x03b9('0x6'));var util=require(_0x03b9('0x7'));var path=require('path');var sox=require(_0x03b9('0x8'));var csv=require('to-csv');var ejs=require(_0x03b9('0x9'));var fs=require('fs');var fs_extra=require(_0x03b9('0xa'));var _=require(_0x03b9('0xb'));var squel=require(_0x03b9('0xc'));var crypto=require(_0x03b9('0xd'));var jsforce=require(_0x03b9('0xe'));var deskjs=require(_0x03b9('0xf'));var toCsv=require(_0x03b9('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03b9('0x11'));var qs=require(_0x03b9('0x12'));var as=require(_0x03b9('0x13'));var hardwareService=require(_0x03b9('0x14'));var logger=require('../../config/logger')(_0x03b9('0x15'));var utils=require(_0x03b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x03b9('0x17'));var db=require(_0x03b9('0x18'))['db'];config[_0x03b9('0x19')]=_[_0x03b9('0x1a')](config[_0x03b9('0x19')],{'host':_0x03b9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03b9('0x19')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x03b9('0x1c'));var client=jayson[_0x03b9('0x1d')][_0x03b9('0x1e')]({'port':0x232c});var client9002=jayson[_0x03b9('0x1d')][_0x03b9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2622d4,_0x43ee7e,_0x1d2f67,_0x4c1b0b){return new BPromise(function(_0x327f8e,_0x5d3dfb){var _0x5dc485=_0x4c1b0b||client;return _0x5dc485['request'](_0x2622d4,_0x1d2f67)[_0x03b9('0x1f')](function(_0x1a90e6){logger[_0x03b9('0x20')](_0x03b9('0x21'),_0x43ee7e,_0x03b9('0x22'));logger[_0x03b9('0x23')](_0x03b9('0x24'),_0x43ee7e,_0x03b9('0x22'),JSON[_0x03b9('0x25')](_0x1a90e6));if(_0x1a90e6['error']){if(_0x1a90e6[_0x03b9('0x26')][_0x03b9('0x27')]===0x1f4){logger[_0x03b9('0x26')]('SmsMessage,\x20%s,\x20%s',_0x43ee7e,_0x1a90e6[_0x03b9('0x26')][_0x03b9('0x28')]);return _0x5d3dfb(_0x1a90e6[_0x03b9('0x26')][_0x03b9('0x28')]);}logger['error'](_0x03b9('0x21'),_0x43ee7e,_0x1a90e6['error'][_0x03b9('0x28')]);return _0x327f8e(_0x1a90e6[_0x03b9('0x26')][_0x03b9('0x28')]);}else{logger['info'](_0x03b9('0x21'),_0x43ee7e,_0x03b9('0x22'));_0x327f8e(_0x1a90e6[_0x03b9('0x29')][_0x03b9('0x28')]);}})[_0x03b9('0x2a')](function(_0x312f59){logger[_0x03b9('0x26')](_0x03b9('0x21'),_0x43ee7e,_0x312f59);_0x5d3dfb(_0x312f59);});});}function respondWithStatusCode(_0x3c676c,_0x191abc){_0x191abc=_0x191abc||0xcc;return function(_0x34a176){if(_0x34a176){return _0x3c676c['sendStatus'](_0x191abc);}return _0x3c676c['status'](_0x191abc)['end']();};}function respondWithResult(_0x45adde,_0x4cbc6d){_0x4cbc6d=_0x4cbc6d||0xc8;return function(_0x4e98b8){if(_0x4e98b8){return _0x45adde[_0x03b9('0x2b')](_0x4cbc6d)['json'](_0x4e98b8);}};}function respondWithFilteredResult(_0xf20dac,_0x3304d3){return function(_0x7ad0cf){if(_0x7ad0cf){var _0x22373f=typeof _0x3304d3['offset']===_0x03b9('0x2c')&&typeof _0x3304d3[_0x03b9('0x2d')]===_0x03b9('0x2c');var _0xd34ec=_0x7ad0cf[_0x03b9('0x2e')];var _0x115a73=_0x22373f?0x0:_0x3304d3[_0x03b9('0x2f')];var _0x380782=_0x22373f?_0x7ad0cf[_0x03b9('0x2e')]:_0x3304d3[_0x03b9('0x2f')]+_0x3304d3[_0x03b9('0x2d')];var _0x51873a;if(_0x380782>=_0xd34ec){_0x380782=_0xd34ec;_0x51873a=0xc8;}else{_0x51873a=0xce;}_0xf20dac['status'](_0x51873a);return _0xf20dac['set'](_0x03b9('0x30'),_0x115a73+'-'+_0x380782+'/'+_0xd34ec)[_0x03b9('0x31')](_0x7ad0cf);}return null;};}function patchUpdates(_0x1f4f4f){return function(_0x5aeded){try{jsonpatch['apply'](_0x5aeded,_0x1f4f4f,!![]);}catch(_0x5a9ed0){return BPromise[_0x03b9('0x32')](_0x5a9ed0);}return _0x5aeded[_0x03b9('0x33')]();};}function saveUpdates(_0x3d6bd9,_0x5b54be){return function(_0x266762){if(_0x266762){return _0x266762[_0x03b9('0x34')](_0x3d6bd9)[_0x03b9('0x1f')](function(_0x2987f5){return _0x2987f5;});}return null;};}function removeEntity(_0x474650,_0x125f81){return function(_0x8352a9){if(_0x8352a9){return _0x8352a9[_0x03b9('0x35')]()[_0x03b9('0x1f')](function(){_0x474650[_0x03b9('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b520c,_0x187917){return function(_0xca3999){if(!_0xca3999){_0x4b520c[_0x03b9('0x36')](0x194);}return _0xca3999;};}function handleError(_0x1be913,_0x37106c){_0x37106c=_0x37106c||0x1f4;return function(_0x126e74){logger['error'](_0x126e74[_0x03b9('0x37')]);if(_0x126e74['name']){delete _0x126e74[_0x03b9('0x38')];}_0x1be913[_0x03b9('0x2b')](_0x37106c)[_0x03b9('0x39')](_0x126e74);};}exports[_0x03b9('0x3a')]=function(_0x53d551,_0x3d2f3a){var _0x508649={},_0x216ea3={},_0x4f15b5={'count':0x0,'rows':[]};var _0x592c57=_[_0x03b9('0x3b')](db['SmsMessage'][_0x03b9('0x3c')],function(_0x52aec9){return{'name':_0x52aec9[_0x03b9('0x3d')],'type':_0x52aec9[_0x03b9('0x3e')][_0x03b9('0x3f')]};});_0x216ea3[_0x03b9('0x40')]=_[_0x03b9('0x3b')](_0x592c57,'name');_0x216ea3[_0x03b9('0x41')]=_[_0x03b9('0x42')](_0x53d551[_0x03b9('0x41')]);_0x216ea3[_0x03b9('0x43')]=_[_0x03b9('0x44')](_0x216ea3[_0x03b9('0x40')],_0x216ea3[_0x03b9('0x41')]);_0x508649[_0x03b9('0x45')]=_[_0x03b9('0x44')](_0x216ea3[_0x03b9('0x40')],qs['fields'](_0x53d551['query'][_0x03b9('0x46')]));_0x508649[_0x03b9('0x45')]=_0x508649['attributes'][_0x03b9('0x47')]?_0x508649[_0x03b9('0x45')]:_0x216ea3[_0x03b9('0x40')];if(!_0x53d551[_0x03b9('0x41')][_0x03b9('0x48')](_0x03b9('0x49'))){_0x508649['limit']=qs[_0x03b9('0x2d')](_0x53d551[_0x03b9('0x41')][_0x03b9('0x2d')]);_0x508649[_0x03b9('0x2f')]=qs['offset'](_0x53d551['query'][_0x03b9('0x2f')]);}_0x508649[_0x03b9('0x4a')]=qs[_0x03b9('0x4b')](_0x53d551[_0x03b9('0x41')][_0x03b9('0x4b')]);_0x508649[_0x03b9('0x4c')]=qs[_0x03b9('0x43')](_[_0x03b9('0x4d')](_0x53d551[_0x03b9('0x41')],_0x216ea3[_0x03b9('0x43')]),_0x592c57);if(_0x53d551[_0x03b9('0x41')][_0x03b9('0x4e')]){_0x508649['where']=_[_0x03b9('0x4f')](_0x508649[_0x03b9('0x4c')],{'$or':_[_0x03b9('0x3b')](_0x592c57,function(_0x3251c7){if(_0x3251c7['type']!==_0x03b9('0x50')){var _0x460442={};_0x460442[_0x3251c7[_0x03b9('0x38')]]={'$like':'%'+_0x53d551[_0x03b9('0x41')][_0x03b9('0x4e')]+'%'};return _0x460442;}})});}_0x508649=_[_0x03b9('0x4f')]({},_0x508649,_0x53d551[_0x03b9('0x51')]);var _0x4183ac={'where':_0x508649['where']};return db['SmsMessage'][_0x03b9('0x2e')](_0x4183ac)[_0x03b9('0x1f')](function(_0x1ecf5b){_0x4f15b5[_0x03b9('0x2e')]=_0x1ecf5b;if(_0x53d551[_0x03b9('0x41')][_0x03b9('0x52')]){_0x508649[_0x03b9('0x53')]=[{'all':!![]}];}return db[_0x03b9('0x54')][_0x03b9('0x55')](_0x508649);})[_0x03b9('0x1f')](function(_0x27270b){_0x4f15b5[_0x03b9('0x56')]=_0x27270b;return _0x4f15b5;})[_0x03b9('0x1f')](respondWithFilteredResult(_0x3d2f3a,_0x508649))['catch'](handleError(_0x3d2f3a,null));};exports[_0x03b9('0x57')]=function(_0x44fd08,_0x1f0513){var _0x5a715b={'raw':!![],'where':{'id':_0x44fd08[_0x03b9('0x58')]['id']}},_0x13a091={};_0x13a091[_0x03b9('0x40')]=_[_0x03b9('0x42')](db[_0x03b9('0x54')]['rawAttributes']);_0x13a091[_0x03b9('0x41')]=_['keys'](_0x44fd08[_0x03b9('0x41')]);_0x13a091[_0x03b9('0x43')]=_['intersection'](_0x13a091['model'],_0x13a091[_0x03b9('0x41')]);_0x5a715b[_0x03b9('0x45')]=_[_0x03b9('0x44')](_0x13a091[_0x03b9('0x40')],qs[_0x03b9('0x46')](_0x44fd08[_0x03b9('0x41')][_0x03b9('0x46')]));_0x5a715b[_0x03b9('0x45')]=_0x5a715b[_0x03b9('0x45')][_0x03b9('0x47')]?_0x5a715b['attributes']:_0x13a091[_0x03b9('0x40')];if(_0x44fd08[_0x03b9('0x41')]['includeAll']){_0x5a715b[_0x03b9('0x53')]=[{'all':!![]}];}_0x5a715b=_[_0x03b9('0x4f')]({},_0x5a715b,_0x44fd08[_0x03b9('0x51')]);return db[_0x03b9('0x54')]['find'](_0x5a715b)[_0x03b9('0x1f')](handleEntityNotFound(_0x1f0513,null))[_0x03b9('0x1f')](respondWithResult(_0x1f0513,null))[_0x03b9('0x2a')](handleError(_0x1f0513,null));};exports[_0x03b9('0x59')]=function(_0x55b242,_0x30621e){return db[_0x03b9('0x54')][_0x03b9('0x59')](_0x55b242[_0x03b9('0x5a')],{})[_0x03b9('0x1f')](respondWithResult(_0x30621e,0xc9))['catch'](handleError(_0x30621e,null));};exports['update']=function(_0x20a790,_0x4f8c8b){if(_0x20a790[_0x03b9('0x5a')]['id']){delete _0x20a790['body']['id'];}return db[_0x03b9('0x54')][_0x03b9('0x5b')]({'where':{'id':_0x20a790[_0x03b9('0x58')]['id']}})[_0x03b9('0x1f')](handleEntityNotFound(_0x4f8c8b,null))[_0x03b9('0x1f')](saveUpdates(_0x20a790[_0x03b9('0x5a')],null))['then'](respondWithResult(_0x4f8c8b,null))[_0x03b9('0x2a')](handleError(_0x4f8c8b,null));};exports['destroy']=function(_0x4e8278,_0x461bc7){return db[_0x03b9('0x54')][_0x03b9('0x5b')]({'where':{'id':_0x4e8278[_0x03b9('0x58')]['id']}})[_0x03b9('0x1f')](handleEntityNotFound(_0x461bc7,null))['then'](removeEntity(_0x461bc7,null))[_0x03b9('0x2a')](handleError(_0x461bc7,null));};exports[_0x03b9('0x5c')]=function(_0x1e5010,_0x32c226){return db[_0x03b9('0x54')][_0x03b9('0x5c')]()[_0x03b9('0x1f')](respondWithResult(_0x32c226,null))[_0x03b9('0x2a')](handleError(_0x32c226,null));};var interaction_log=require(_0x03b9('0x5d'))(_0x03b9('0x5e'));exports[_0x03b9('0x5f')]=function(_0x1e73fc,_0x30848a,_0x191df9){var _0x4be475={'agent':{},'channel':_0x03b9('0x60')};if(_0x1e73fc[_0x03b9('0x5a')]['id']){delete _0x1e73fc[_0x03b9('0x5a')]['id'];}_0x1e73fc[_0x03b9('0x5a')][_0x03b9('0x61')]=!![];_0x1e73fc[_0x03b9('0x5a')][_0x03b9('0x62')]=moment()[_0x03b9('0x63')](_0x03b9('0x64'));_0x1e73fc[_0x03b9('0x5a')]['UserId']=_0x1e73fc[_0x03b9('0x5a')][_0x03b9('0x65')]||_0x1e73fc['user']['id'];_0x4be475[_0x03b9('0x66')]['id']=_0x1e73fc[_0x03b9('0x5a')][_0x03b9('0x65')];return db[_0x03b9('0x54')][_0x03b9('0x5b')]({'where':{'id':_0x1e73fc[_0x03b9('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30848a,null))['then'](saveUpdates(_0x1e73fc['body'],null))['then'](function(_0x2feaa5){if(_0x2feaa5){_0x4be475[_0x03b9('0x28')]=_0x2feaa5['get']({'plain':!![]});return db[_0x03b9('0x67')][_0x03b9('0x5b')]({'where':{'id':_0x2feaa5[_0x03b9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x30848a,null))['then'](function(_0x5d1e5b){if(_0x5d1e5b){return _0x5d1e5b[_0x03b9('0x34')]({'UserId':_0x1e73fc[_0x03b9('0x5a')]['UserId'],'read1stAt':_[_0x03b9('0x69')](_0x5d1e5b[_0x03b9('0x6a')])?moment()[_0x03b9('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x03b9('0x1f')](function(_0x5f812d){if(_0x5f812d){_0x4be475[_0x03b9('0x6b')]=_0x5f812d[_0x03b9('0x6c')]({'plain':!![]});interaction_log['info'](_0x03b9('0x6d'),_0x1e73fc[_0x03b9('0x6e')]['id'],_0x1e73fc[_0x03b9('0x6e')][_0x03b9('0x38')],_0x1e73fc[_0x03b9('0x6e')][_0x03b9('0x6f')],_0x4be475['interaction']['id'],_0x1e73fc[_0x03b9('0x5a')]?JSON[_0x03b9('0x25')](_0x1e73fc['body']):'null');return respondWithRpcPromise(_0x03b9('0x70'),'acceptMessage',_0x4be475);}return null;})['then'](function(_0x245fd2){var _0x5938b1=_0x03b9('0x71')+_0x245fd2[_0x03b9('0x28')][_0x03b9('0x72')];return db[_0x03b9('0x73')][_0x03b9('0x41')](_0x5938b1,{'type':db[_0x03b9('0x74')][_0x03b9('0x75')][_0x03b9('0x76')],'raw':!![]})[_0x03b9('0x1f')](function(_0x7efa15){return _0x7efa15;});})[_0x03b9('0x1f')](function(_0x333a2e){if(_0x333a2e){_0x4be475[_0x03b9('0x28')][_0x03b9('0x77')]=_0x333a2e[0x0];if(!_0x1e73fc[_0x03b9('0x5a')]['UserId'])return;return db['User'][_0x03b9('0x5b')]({'where':{'id':_0x1e73fc['body'][_0x03b9('0x65')],'role':_0x03b9('0x66')},'attributes':['id','name','fullname',_0x03b9('0x78'),_0x03b9('0x79')],'raw':!![]});}return null;})['then'](function(_0x17926f){if(!_0x17926f)return null;_0x4be475[_0x03b9('0x28')][_0x03b9('0x66')]=_0x17926f;return _0x4be475;})[_0x03b9('0x1f')](function(_0x35aaf6){if(_0x35aaf6){if(_0x1e73fc[_0x03b9('0x5a')][_0x03b9('0x7a')]){_0x4be475[_0x03b9('0x28')]['interface']=util[_0x03b9('0x63')](_0x03b9('0x7b'),_0x1e73fc[_0x03b9('0x6e')][_0x03b9('0x38')]);_0x4be475[_0x03b9('0x28')]['channel']=_0x4be475['channel'];_0x4be475[_0x03b9('0x28')][_0x03b9('0x7c')]=_0x4be475[_0x03b9('0x7d')];_0x4be475[_0x03b9('0x28')][_0x03b9('0x7e')]=_0x03b9('0x5f');return respondWithRpcPromise(_0x03b9('0x7f'),_0x03b9('0x7f'),{'event':_0x03b9('0x80'),'message':_0x4be475[_0x03b9('0x28')]},client9002)[_0x03b9('0x1f')](function(){return _0x4be475;});}return _0x4be475;}return null;})[_0x03b9('0x1f')](respondWithResult(_0x30848a,null))[_0x03b9('0x2a')](handleError(_0x30848a,null));};var interaction_log=require(_0x03b9('0x5d'))(_0x03b9('0x5e'));exports[_0x03b9('0x32')]=function(_0x45dbee,_0x2e523a,_0x11886e){var _0xb830db={'agent':{},'channel':'sms'};if(_0x45dbee['body']['id']){delete _0x45dbee[_0x03b9('0x5a')]['id'];}_0x45dbee[_0x03b9('0x5a')][_0x03b9('0x65')]=_0x45dbee[_0x03b9('0x5a')][_0x03b9('0x65')]||_0x45dbee[_0x03b9('0x6e')]['id'];_0xb830db[_0x03b9('0x66')]['id']=_0x45dbee[_0x03b9('0x5a')][_0x03b9('0x65')];return db[_0x03b9('0x54')][_0x03b9('0x5b')]({'where':{'id':_0x45dbee[_0x03b9('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e523a,null))[_0x03b9('0x1f')](function(_0x539c85){if(_0x539c85){_0xb830db[_0x03b9('0x28')]=_0x539c85[_0x03b9('0x6c')]({'plain':!![]});return db[_0x03b9('0x67')][_0x03b9('0x5b')]({'where':{'id':_0x539c85[_0x03b9('0x68')]}});}return null;})[_0x03b9('0x1f')](handleEntityNotFound(_0x2e523a,null))[_0x03b9('0x1f')](function(_0x50b36f){if(_0x50b36f){_0xb830db[_0x03b9('0x6b')]=_0x50b36f['get']({'plain':!![]});interaction_log[_0x03b9('0x20')](_0x03b9('0x81'),_0x45dbee[_0x03b9('0x6e')]['id'],_0x45dbee['user'][_0x03b9('0x38')],_0x45dbee[_0x03b9('0x6e')][_0x03b9('0x6f')],_0xb830db['interaction']['id'],_0x45dbee[_0x03b9('0x5a')]?JSON['stringify'](_0x45dbee[_0x03b9('0x5a')]):_0x03b9('0x82'));return respondWithRpcPromise('RejectMessage',_0x03b9('0x83'),_0xb830db);}return null;})[_0x03b9('0x1f')](function(_0x1fc51f){var _0x3ecec8=_0x03b9('0x71')+_0x1fc51f[_0x03b9('0x28')][_0x03b9('0x72')];return db[_0x03b9('0x73')][_0x03b9('0x41')](_0x3ecec8,{'type':db['Sequelize'][_0x03b9('0x75')][_0x03b9('0x76')],'raw':!![]})['then'](function(_0x3a7f45){return _0x3a7f45;});})[_0x03b9('0x1f')](function(_0xe4f422){if(_0xe4f422){_0xb830db[_0x03b9('0x28')][_0x03b9('0x77')]=_0xe4f422[0x0];if(!_0x45dbee[_0x03b9('0x5a')][_0x03b9('0x65')])return;return db[_0x03b9('0x84')][_0x03b9('0x5b')]({'where':{'id':_0x45dbee['body'][_0x03b9('0x65')],'role':'agent'},'attributes':['id',_0x03b9('0x38'),'fullname',_0x03b9('0x78'),'internal'],'raw':!![]});}return null;})[_0x03b9('0x1f')](function(_0x1b5854){if(!_0x1b5854)return null;_0xb830db[_0x03b9('0x28')]['agent']=_0x1b5854;return _0xb830db;})['then'](function(_0x615a2e){if(_0x615a2e){_0x615a2e[_0x03b9('0x28')][_0x03b9('0x85')]=util[_0x03b9('0x63')](_0x03b9('0x7b'),_0x45dbee[_0x03b9('0x6e')]['name']);_0x615a2e[_0x03b9('0x28')]['channel']=_0xb830db['channel'];_0x615a2e[_0x03b9('0x28')][_0x03b9('0x7c')]=_0xb830db[_0x03b9('0x7d')];_0x615a2e[_0x03b9('0x28')]['event']=_0x03b9('0x32');respondWithRpcPromise('EventManager',_0x03b9('0x7f'),{'event':_0x03b9('0x86'),'message':_0x615a2e[_0x03b9('0x28')]},client9002);return _0xb830db;}return null;})[_0x03b9('0x1f')](respondWithResult(_0x2e523a,null))[_0x03b9('0x2a')](handleError(_0x2e523a,null));};exports[_0x03b9('0x2b')]=function(_0x2ffab8,_0x4df91f,_0x2303d1){if(_0x2ffab8['body']['id']){delete _0x2ffab8['body']['id'];}var _0x531042;return db[_0x03b9('0x54')][_0x03b9('0x5b')]({'where':{'id':_0x2ffab8[_0x03b9('0x58')]['id']}})['then'](handleEntityNotFound(_0x4df91f,null))[_0x03b9('0x1f')](function(_0x34c8a7){if(_0x34c8a7){_0x531042=_0x34c8a7;return db[_0x03b9('0x87')][_0x03b9('0x5b')]({'where':{'id':_0x34c8a7[_0x03b9('0x88')]}});}})[_0x03b9('0x1f')](handleEntityNotFound(_0x4df91f,null))['then'](function(_0x56ef44){if(_0x56ef44){logger[_0x03b9('0x23')](_0x03b9('0x24'),_0x03b9('0x2b'),'received\x20delivery\x20report\x20from',_0x56ef44[_0x03b9('0x3e')],util[_0x03b9('0x89')](_0x2ffab8['body'],{'showHidden':![],'depth':null}));switch(_0x56ef44[_0x03b9('0x3e')]){case _0x03b9('0x8a'):if(_0x2ffab8[_0x03b9('0x5a')][_0x03b9('0x8b')]&&_0x2ffab8[_0x03b9('0x5a')]['MessageSid']===_0x531042[_0x03b9('0x8c')]){return _0x531042[_0x03b9('0x34')]({'read':!![]});}else{logger[_0x03b9('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x03b9('0x2b'),'twilio',util[_0x03b9('0x89')](_0x2ffab8[_0x03b9('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x03b9('0x8d'):if(_0x2ffab8[_0x03b9('0x5a')][_0x03b9('0x8e')]&&_0x2ffab8[_0x03b9('0x5a')][_0x03b9('0x8e')]===_0x531042[_0x03b9('0x8c')]&&_[_0x03b9('0x8f')]([_0x03b9('0x90'),'delivered'],_0x2ffab8[_0x03b9('0x5a')]['Status'])>=0x0){return _0x531042[_0x03b9('0x34')]({'read':!![]});}else{logger[_0x03b9('0x26')](_0x03b9('0x91'),'status','plivio',util[_0x03b9('0x89')](_0x2ffab8[_0x03b9('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x03b9('0x92'):var _0x428ffc=_0x2ffab8[_0x03b9('0x5a')]['results'][0x0];if(_0x428ffc[_0x03b9('0x2b')][_0x03b9('0x93')]===_0x03b9('0x94')){return _0x531042[_0x03b9('0x34')]({'read':!![]});}else{logger[_0x03b9('0x26')](_0x03b9('0x91'),'status',_0x03b9('0x92'),util['inspect'](_0x2ffab8[_0x03b9('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x531042;}})[_0x03b9('0x1f')](respondWithResult(_0x4df91f,null))['catch'](handleError(_0x4df91f,null));}; \ No newline at end of file +var _0xa1cc=['ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','register','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','stack','name','index','map','SmsMessage','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','describe','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','QueryTypes','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','plivo','MessageUUID','sent','delivered','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x4250b4,_0x3fd543){var _0x8a4807=function(_0x147c84){while(--_0x147c84){_0x4250b4['push'](_0x4250b4['shift']());}};_0x8a4807(++_0x3fd543);}(_0xa1cc,0x10f));var _0xca1c=function(_0x2f4353,_0x3bb304){_0x2f4353=_0x2f4353-0x0;var _0x5e73ed=_0xa1cc[_0x2f4353];return _0x5e73ed;};'use strict';var emlformat=require(_0xca1c('0x0'));var rimraf=require(_0xca1c('0x1'));var zipdir=require(_0xca1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca1c('0x3'));var moment=require(_0xca1c('0x4'));var BPromise=require(_0xca1c('0x5'));var Mustache=require('mustache');var util=require(_0xca1c('0x6'));var path=require('path');var sox=require(_0xca1c('0x7'));var csv=require(_0xca1c('0x8'));var ejs=require(_0xca1c('0x9'));var fs=require('fs');var fs_extra=require(_0xca1c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xca1c('0xb'));var jsforce=require(_0xca1c('0xc'));var deskjs=require(_0xca1c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca1c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xca1c('0xf'));var as=require(_0xca1c('0x10'));var hardwareService=require(_0xca1c('0x11'));var logger=require(_0xca1c('0x12'))(_0xca1c('0x13'));var utils=require('../../config/utils');var config=require(_0xca1c('0x14'));var licenseUtil=require(_0xca1c('0x15'));var db=require('../../mysqldb')['db'];config[_0xca1c('0x16')]=_['defaults'](config[_0xca1c('0x16')],{'host':_0xca1c('0x17'),'port':0x18eb});var socket=require(_0xca1c('0x18'))(new Redis(config['redis']));require(_0xca1c('0x19'))[_0xca1c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xca1c('0x1b')]({'port':0x232c});var client9002=jayson[_0xca1c('0x1c')][_0xca1c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x18e6ac,_0x2644f0,_0x3ba29e,_0x1347cf){return new BPromise(function(_0x357321,_0x12a7f5){var _0x882fd4=_0x1347cf||client;return _0x882fd4[_0xca1c('0x1d')](_0x18e6ac,_0x3ba29e)[_0xca1c('0x1e')](function(_0x14480c){logger[_0xca1c('0x1f')](_0xca1c('0x20'),_0x2644f0,_0xca1c('0x21'));logger['debug'](_0xca1c('0x22'),_0x2644f0,_0xca1c('0x21'),JSON['stringify'](_0x14480c));if(_0x14480c['error']){if(_0x14480c[_0xca1c('0x23')][_0xca1c('0x24')]===0x1f4){logger[_0xca1c('0x23')](_0xca1c('0x20'),_0x2644f0,_0x14480c[_0xca1c('0x23')][_0xca1c('0x25')]);return _0x12a7f5(_0x14480c[_0xca1c('0x23')]['message']);}logger[_0xca1c('0x23')]('SmsMessage,\x20%s,\x20%s',_0x2644f0,_0x14480c[_0xca1c('0x23')][_0xca1c('0x25')]);return _0x357321(_0x14480c[_0xca1c('0x23')][_0xca1c('0x25')]);}else{logger['info'](_0xca1c('0x20'),_0x2644f0,_0xca1c('0x21'));_0x357321(_0x14480c['result'][_0xca1c('0x25')]);}})['catch'](function(_0x1639da){logger[_0xca1c('0x23')](_0xca1c('0x20'),_0x2644f0,_0x1639da);_0x12a7f5(_0x1639da);});});}function respondWithStatusCode(_0x77ea99,_0x4aacb8){_0x4aacb8=_0x4aacb8||0xcc;return function(_0x1c3056){if(_0x1c3056){return _0x77ea99[_0xca1c('0x26')](_0x4aacb8);}return _0x77ea99[_0xca1c('0x27')](_0x4aacb8)[_0xca1c('0x28')]();};}function respondWithResult(_0x1bb670,_0x40a8ca){_0x40a8ca=_0x40a8ca||0xc8;return function(_0x3d5ee4){if(_0x3d5ee4){return _0x1bb670['status'](_0x40a8ca)[_0xca1c('0x29')](_0x3d5ee4);}};}function respondWithFilteredResult(_0x5408c6,_0x573fc){return function(_0x31042a){if(_0x31042a){var _0x4a2406=typeof _0x573fc[_0xca1c('0x2a')]===_0xca1c('0x2b')&&typeof _0x573fc[_0xca1c('0x2c')]===_0xca1c('0x2b');var _0x55cc6d=_0x31042a[_0xca1c('0x2d')];var _0x267c92=_0x4a2406?0x0:_0x573fc[_0xca1c('0x2a')];var _0x3f5335=_0x4a2406?_0x31042a['count']:_0x573fc[_0xca1c('0x2a')]+_0x573fc['limit'];var _0x4eb986;if(_0x3f5335>=_0x55cc6d){_0x3f5335=_0x55cc6d;_0x4eb986=0xc8;}else{_0x4eb986=0xce;}_0x5408c6[_0xca1c('0x27')](_0x4eb986);return _0x5408c6[_0xca1c('0x2e')](_0xca1c('0x2f'),_0x267c92+'-'+_0x3f5335+'/'+_0x55cc6d)[_0xca1c('0x29')](_0x31042a);}return null;};}function patchUpdates(_0x451179){return function(_0x48fa20){try{jsonpatch['apply'](_0x48fa20,_0x451179,!![]);}catch(_0xedeaba){return BPromise[_0xca1c('0x30')](_0xedeaba);}return _0x48fa20[_0xca1c('0x31')]();};}function saveUpdates(_0x1e3273,_0x24aba6){return function(_0x5d2ab9){if(_0x5d2ab9){return _0x5d2ab9[_0xca1c('0x32')](_0x1e3273)['then'](function(_0x5b8a94){return _0x5b8a94;});}return null;};}function removeEntity(_0x4737bf,_0x3a9642){return function(_0x3aa3bc){if(_0x3aa3bc){return _0x3aa3bc['destroy']()[_0xca1c('0x1e')](function(){_0x4737bf[_0xca1c('0x27')](0xcc)[_0xca1c('0x28')]();});}};}function handleEntityNotFound(_0x10b31c,_0x57a0fc){return function(_0x3fdfdd){if(!_0x3fdfdd){_0x10b31c[_0xca1c('0x26')](0x194);}return _0x3fdfdd;};}function handleError(_0x2742d6,_0x3d3ac3){_0x3d3ac3=_0x3d3ac3||0x1f4;return function(_0xb5f2f8){logger[_0xca1c('0x23')](_0xb5f2f8[_0xca1c('0x33')]);if(_0xb5f2f8['name']){delete _0xb5f2f8[_0xca1c('0x34')];}_0x2742d6[_0xca1c('0x27')](_0x3d3ac3)['send'](_0xb5f2f8);};}exports[_0xca1c('0x35')]=function(_0x1cc798,_0x50b0ff){var _0x324cc3={},_0x2b3540={},_0x9b282f={'count':0x0,'rows':[]};var _0x4e66f9=_[_0xca1c('0x36')](db[_0xca1c('0x37')]['rawAttributes'],function(_0x2ffdab){return{'name':_0x2ffdab['fieldName'],'type':_0x2ffdab['type'][_0xca1c('0x38')]};});_0x2b3540[_0xca1c('0x39')]=_[_0xca1c('0x36')](_0x4e66f9,'name');_0x2b3540[_0xca1c('0x3a')]=_[_0xca1c('0x3b')](_0x1cc798[_0xca1c('0x3a')]);_0x2b3540[_0xca1c('0x3c')]=_[_0xca1c('0x3d')](_0x2b3540[_0xca1c('0x39')],_0x2b3540[_0xca1c('0x3a')]);_0x324cc3[_0xca1c('0x3e')]=_[_0xca1c('0x3d')](_0x2b3540[_0xca1c('0x39')],qs[_0xca1c('0x3f')](_0x1cc798[_0xca1c('0x3a')][_0xca1c('0x3f')]));_0x324cc3[_0xca1c('0x3e')]=_0x324cc3[_0xca1c('0x3e')][_0xca1c('0x40')]?_0x324cc3['attributes']:_0x2b3540[_0xca1c('0x39')];if(!_0x1cc798[_0xca1c('0x3a')]['hasOwnProperty'](_0xca1c('0x41'))){_0x324cc3[_0xca1c('0x2c')]=qs[_0xca1c('0x2c')](_0x1cc798[_0xca1c('0x3a')][_0xca1c('0x2c')]);_0x324cc3[_0xca1c('0x2a')]=qs[_0xca1c('0x2a')](_0x1cc798['query']['offset']);}_0x324cc3[_0xca1c('0x42')]=qs[_0xca1c('0x43')](_0x1cc798[_0xca1c('0x3a')]['sort']);_0x324cc3[_0xca1c('0x44')]=qs[_0xca1c('0x3c')](_['pick'](_0x1cc798[_0xca1c('0x3a')],_0x2b3540[_0xca1c('0x3c')]),_0x4e66f9);if(_0x1cc798[_0xca1c('0x3a')][_0xca1c('0x45')]){_0x324cc3['where']=_[_0xca1c('0x46')](_0x324cc3['where'],{'$or':_[_0xca1c('0x36')](_0x4e66f9,function(_0x57b3c4){if(_0x57b3c4[_0xca1c('0x47')]!==_0xca1c('0x48')){var _0x5a76d9={};_0x5a76d9[_0x57b3c4['name']]={'$like':'%'+_0x1cc798[_0xca1c('0x3a')][_0xca1c('0x45')]+'%'};return _0x5a76d9;}})});}_0x324cc3=_[_0xca1c('0x46')]({},_0x324cc3,_0x1cc798[_0xca1c('0x49')]);var _0x39d95f={'where':_0x324cc3[_0xca1c('0x44')]};return db[_0xca1c('0x37')][_0xca1c('0x2d')](_0x39d95f)['then'](function(_0xe1d343){_0x9b282f[_0xca1c('0x2d')]=_0xe1d343;if(_0x1cc798[_0xca1c('0x3a')][_0xca1c('0x4a')]){_0x324cc3[_0xca1c('0x4b')]=[{'all':!![]}];}return db[_0xca1c('0x37')][_0xca1c('0x4c')](_0x324cc3);})[_0xca1c('0x1e')](function(_0x1ee559){_0x9b282f[_0xca1c('0x4d')]=_0x1ee559;return _0x9b282f;})[_0xca1c('0x1e')](respondWithFilteredResult(_0x50b0ff,_0x324cc3))['catch'](handleError(_0x50b0ff,null));};exports[_0xca1c('0x4e')]=function(_0x29e65a,_0x472bf4){var _0x55c6c2={'raw':!![],'where':{'id':_0x29e65a[_0xca1c('0x4f')]['id']}},_0x51c889={};_0x51c889[_0xca1c('0x39')]=_[_0xca1c('0x3b')](db['SmsMessage']['rawAttributes']);_0x51c889[_0xca1c('0x3a')]=_[_0xca1c('0x3b')](_0x29e65a['query']);_0x51c889[_0xca1c('0x3c')]=_['intersection'](_0x51c889[_0xca1c('0x39')],_0x51c889[_0xca1c('0x3a')]);_0x55c6c2['attributes']=_[_0xca1c('0x3d')](_0x51c889[_0xca1c('0x39')],qs[_0xca1c('0x3f')](_0x29e65a[_0xca1c('0x3a')][_0xca1c('0x3f')]));_0x55c6c2[_0xca1c('0x3e')]=_0x55c6c2['attributes'][_0xca1c('0x40')]?_0x55c6c2['attributes']:_0x51c889['model'];if(_0x29e65a['query'][_0xca1c('0x4a')]){_0x55c6c2['include']=[{'all':!![]}];}_0x55c6c2=_[_0xca1c('0x46')]({},_0x55c6c2,_0x29e65a[_0xca1c('0x49')]);return db[_0xca1c('0x37')][_0xca1c('0x50')](_0x55c6c2)[_0xca1c('0x1e')](handleEntityNotFound(_0x472bf4,null))[_0xca1c('0x1e')](respondWithResult(_0x472bf4,null))['catch'](handleError(_0x472bf4,null));};exports[_0xca1c('0x51')]=function(_0xc9234a,_0xa560){return db[_0xca1c('0x37')]['create'](_0xc9234a[_0xca1c('0x52')],{})['then'](respondWithResult(_0xa560,0xc9))[_0xca1c('0x53')](handleError(_0xa560,null));};exports[_0xca1c('0x32')]=function(_0x14421c,_0x27c456){if(_0x14421c[_0xca1c('0x52')]['id']){delete _0x14421c[_0xca1c('0x52')]['id'];}return db[_0xca1c('0x37')][_0xca1c('0x50')]({'where':{'id':_0x14421c['params']['id']}})[_0xca1c('0x1e')](handleEntityNotFound(_0x27c456,null))[_0xca1c('0x1e')](saveUpdates(_0x14421c[_0xca1c('0x52')],null))[_0xca1c('0x1e')](respondWithResult(_0x27c456,null))[_0xca1c('0x53')](handleError(_0x27c456,null));};exports[_0xca1c('0x54')]=function(_0x20506c,_0x157ee4){return db[_0xca1c('0x37')][_0xca1c('0x50')]({'where':{'id':_0x20506c[_0xca1c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x157ee4,null))[_0xca1c('0x1e')](removeEntity(_0x157ee4,null))[_0xca1c('0x53')](handleError(_0x157ee4,null));};exports[_0xca1c('0x55')]=function(_0x4c5d1a,_0x1a2ec9){return db[_0xca1c('0x37')][_0xca1c('0x55')]()[_0xca1c('0x1e')](respondWithResult(_0x1a2ec9,null))[_0xca1c('0x53')](handleError(_0x1a2ec9,null));};var interaction_log=require(_0xca1c('0x12'))('sms-interactions');exports['accept']=function(_0x1aa777,_0x22c09d,_0x36fa2f){var _0x2a3a53={'agent':{},'channel':_0xca1c('0x56')};if(_0x1aa777[_0xca1c('0x52')]['id']){delete _0x1aa777['body']['id'];}_0x1aa777[_0xca1c('0x52')]['read']=!![];_0x1aa777[_0xca1c('0x52')]['readAt']=moment()[_0xca1c('0x57')](_0xca1c('0x58'));_0x1aa777[_0xca1c('0x52')][_0xca1c('0x59')]=_0x1aa777['body'][_0xca1c('0x59')]||_0x1aa777['user']['id'];_0x2a3a53[_0xca1c('0x5a')]['id']=_0x1aa777[_0xca1c('0x52')][_0xca1c('0x59')];return db[_0xca1c('0x37')]['find']({'where':{'id':_0x1aa777[_0xca1c('0x4f')]['id'],'UserId':null}})[_0xca1c('0x1e')](handleEntityNotFound(_0x22c09d,null))[_0xca1c('0x1e')](saveUpdates(_0x1aa777[_0xca1c('0x52')],null))[_0xca1c('0x1e')](function(_0x346cb1){if(_0x346cb1){_0x2a3a53[_0xca1c('0x25')]=_0x346cb1[_0xca1c('0x5b')]({'plain':!![]});return db[_0xca1c('0x5c')]['find']({'where':{'id':_0x346cb1[_0xca1c('0x5d')]}});}return null;})[_0xca1c('0x1e')](handleEntityNotFound(_0x22c09d,null))[_0xca1c('0x1e')](function(_0xc2bd7d){if(_0xc2bd7d){return _0xc2bd7d[_0xca1c('0x32')]({'UserId':_0x1aa777[_0xca1c('0x52')]['UserId'],'read1stAt':_[_0xca1c('0x5e')](_0xc2bd7d[_0xca1c('0x5f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xca1c('0x1e')](function(_0x198107){if(_0x198107){_0x2a3a53[_0xca1c('0x60')]=_0x198107['get']({'plain':!![]});interaction_log[_0xca1c('0x1f')](_0xca1c('0x61'),_0x1aa777[_0xca1c('0x62')]['id'],_0x1aa777[_0xca1c('0x62')]['name'],_0x1aa777[_0xca1c('0x62')]['role'],_0x2a3a53['interaction']['id'],_0x1aa777[_0xca1c('0x52')]?JSON[_0xca1c('0x63')](_0x1aa777[_0xca1c('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0xca1c('0x64'),_0x2a3a53);}return null;})[_0xca1c('0x1e')](function(_0x315c53){var _0x86fe23=_0xca1c('0x65')+_0x315c53[_0xca1c('0x25')][_0xca1c('0x66')];return db[_0xca1c('0x67')][_0xca1c('0x3a')](_0x86fe23,{'type':db[_0xca1c('0x68')]['QueryTypes'][_0xca1c('0x69')],'raw':!![]})[_0xca1c('0x1e')](function(_0x156106){return _0x156106;});})[_0xca1c('0x1e')](function(_0x3da34d){if(_0x3da34d){_0x2a3a53[_0xca1c('0x25')][_0xca1c('0x6a')]=_0x3da34d[0x0];if(!_0x1aa777[_0xca1c('0x52')][_0xca1c('0x59')])return;return db[_0xca1c('0x6b')][_0xca1c('0x50')]({'where':{'id':_0x1aa777[_0xca1c('0x52')]['UserId'],'role':_0xca1c('0x5a')},'attributes':['id',_0xca1c('0x34'),_0xca1c('0x6c'),_0xca1c('0x6d'),_0xca1c('0x6e')],'raw':!![]});}return null;})[_0xca1c('0x1e')](function(_0x38a017){if(!_0x38a017)return null;_0x2a3a53['message'][_0xca1c('0x5a')]=_0x38a017;return _0x2a3a53;})[_0xca1c('0x1e')](function(_0x17101a){if(_0x17101a){if(_0x1aa777[_0xca1c('0x52')]['manual']){_0x2a3a53['message'][_0xca1c('0x6f')]=util[_0xca1c('0x57')](_0xca1c('0x70'),_0x1aa777[_0xca1c('0x62')]['name']);_0x2a3a53[_0xca1c('0x25')][_0xca1c('0x71')]=_0x2a3a53[_0xca1c('0x71')];_0x2a3a53[_0xca1c('0x25')][_0xca1c('0x72')]=_0x2a3a53['channel'];_0x2a3a53[_0xca1c('0x25')][_0xca1c('0x73')]=_0xca1c('0x74');return respondWithRpcPromise(_0xca1c('0x75'),'EventManager',{'event':_0xca1c('0x76'),'message':_0x2a3a53[_0xca1c('0x25')]},client9002)[_0xca1c('0x1e')](function(){return _0x2a3a53;});}return _0x2a3a53;}return null;})['then'](respondWithResult(_0x22c09d,null))[_0xca1c('0x53')](handleError(_0x22c09d,null));};var interaction_log=require('../../config/logger')(_0xca1c('0x77'));exports[_0xca1c('0x30')]=function(_0x10eb77,_0x39f7a8,_0x568e0e){var _0x2a97d7={'agent':{},'channel':_0xca1c('0x56')};if(_0x10eb77[_0xca1c('0x52')]['id']){delete _0x10eb77['body']['id'];}_0x10eb77[_0xca1c('0x52')][_0xca1c('0x59')]=_0x10eb77[_0xca1c('0x52')][_0xca1c('0x59')]||_0x10eb77['user']['id'];_0x2a97d7[_0xca1c('0x5a')]['id']=_0x10eb77[_0xca1c('0x52')]['UserId'];return db[_0xca1c('0x37')]['find']({'where':{'id':_0x10eb77[_0xca1c('0x4f')]['id'],'UserId':null}})[_0xca1c('0x1e')](handleEntityNotFound(_0x39f7a8,null))[_0xca1c('0x1e')](function(_0x42a929){if(_0x42a929){_0x2a97d7[_0xca1c('0x25')]=_0x42a929[_0xca1c('0x5b')]({'plain':!![]});return db[_0xca1c('0x5c')]['find']({'where':{'id':_0x42a929['SmsInteractionId']}});}return null;})[_0xca1c('0x1e')](handleEntityNotFound(_0x39f7a8,null))[_0xca1c('0x1e')](function(_0x19c400){if(_0x19c400){_0x2a97d7[_0xca1c('0x60')]=_0x19c400[_0xca1c('0x5b')]({'plain':!![]});interaction_log[_0xca1c('0x1f')](_0xca1c('0x78'),_0x10eb77[_0xca1c('0x62')]['id'],_0x10eb77['user'][_0xca1c('0x34')],_0x10eb77[_0xca1c('0x62')]['role'],_0x2a97d7[_0xca1c('0x60')]['id'],_0x10eb77[_0xca1c('0x52')]?JSON[_0xca1c('0x63')](_0x10eb77['body']):_0xca1c('0x79'));return respondWithRpcPromise(_0xca1c('0x7a'),'rejectMessage',_0x2a97d7);}return null;})[_0xca1c('0x1e')](function(_0xc8311c){var _0x38b6e8=_0xca1c('0x65')+_0xc8311c['message'][_0xca1c('0x66')];return db[_0xca1c('0x67')]['query'](_0x38b6e8,{'type':db['Sequelize'][_0xca1c('0x7b')][_0xca1c('0x69')],'raw':!![]})[_0xca1c('0x1e')](function(_0x5489ef){return _0x5489ef;});})[_0xca1c('0x1e')](function(_0x2f59ce){if(_0x2f59ce){_0x2a97d7[_0xca1c('0x25')][_0xca1c('0x6a')]=_0x2f59ce[0x0];if(!_0x10eb77[_0xca1c('0x52')]['UserId'])return;return db[_0xca1c('0x6b')][_0xca1c('0x50')]({'where':{'id':_0x10eb77[_0xca1c('0x52')][_0xca1c('0x59')],'role':_0xca1c('0x5a')},'attributes':['id',_0xca1c('0x34'),'fullname',_0xca1c('0x6d'),_0xca1c('0x6e')],'raw':!![]});}return null;})[_0xca1c('0x1e')](function(_0xf06fb){if(!_0xf06fb)return null;_0x2a97d7['message'][_0xca1c('0x5a')]=_0xf06fb;return _0x2a97d7;})[_0xca1c('0x1e')](function(_0x11530){if(_0x11530){_0x11530[_0xca1c('0x25')][_0xca1c('0x6f')]=util[_0xca1c('0x57')](_0xca1c('0x70'),_0x10eb77[_0xca1c('0x62')][_0xca1c('0x34')]);_0x11530['message'][_0xca1c('0x71')]=_0x2a97d7['channel'];_0x11530['message'][_0xca1c('0x72')]=_0x2a97d7[_0xca1c('0x71')];_0x11530[_0xca1c('0x25')][_0xca1c('0x73')]=_0xca1c('0x30');respondWithRpcPromise(_0xca1c('0x75'),'EventManager',{'event':'rejectmessage','message':_0x11530[_0xca1c('0x25')]},client9002);return _0x2a97d7;}return null;})['then'](respondWithResult(_0x39f7a8,null))[_0xca1c('0x53')](handleError(_0x39f7a8,null));};exports['status']=function(_0x470229,_0x3e2718,_0x498ca8){if(_0x470229[_0xca1c('0x52')]['id']){delete _0x470229[_0xca1c('0x52')]['id'];}var _0x2e3bd8;return db[_0xca1c('0x37')][_0xca1c('0x50')]({'where':{'id':_0x470229[_0xca1c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3e2718,null))[_0xca1c('0x1e')](function(_0xc977b9){if(_0xc977b9){_0x2e3bd8=_0xc977b9;return db[_0xca1c('0x7c')][_0xca1c('0x50')]({'where':{'id':_0xc977b9[_0xca1c('0x7d')]}});}})[_0xca1c('0x1e')](handleEntityNotFound(_0x3e2718,null))[_0xca1c('0x1e')](function(_0x414e65){if(_0x414e65){logger[_0xca1c('0x7e')](_0xca1c('0x22'),_0xca1c('0x27'),_0xca1c('0x7f'),_0x414e65[_0xca1c('0x47')],util['inspect'](_0x470229[_0xca1c('0x52')],{'showHidden':![],'depth':null}));switch(_0x414e65[_0xca1c('0x47')]){case'twilio':if(_0x470229[_0xca1c('0x52')]['MessageSid']&&_0x470229[_0xca1c('0x52')]['MessageSid']===_0x2e3bd8[_0xca1c('0x80')]){return _0x2e3bd8['update']({'read':!![]});}else{logger[_0xca1c('0x23')](_0xca1c('0x81'),_0xca1c('0x27'),_0xca1c('0x82'),util[_0xca1c('0x83')](_0x470229[_0xca1c('0x52')],{'showHidden':![],'depth':null}));}break;case _0xca1c('0x84'):if(_0x470229[_0xca1c('0x52')][_0xca1c('0x85')]&&_0x470229[_0xca1c('0x52')][_0xca1c('0x85')]===_0x2e3bd8['messageId']&&_['indexOf']([_0xca1c('0x86'),_0xca1c('0x87')],_0x470229['body']['Status'])>=0x0){return _0x2e3bd8['update']({'read':!![]});}else{logger[_0xca1c('0x23')](_0xca1c('0x81'),_0xca1c('0x27'),_0xca1c('0x88'),util['inspect'](_0x470229['body'],{'showHidden':![],'depth':null}));}break;case _0xca1c('0x89'):var _0x269e69=_0x470229[_0xca1c('0x52')]['results'][0x0];if(_0x269e69[_0xca1c('0x27')][_0xca1c('0x8a')]===_0xca1c('0x8b')){return _0x2e3bd8['update']({'read':!![]});}else{logger[_0xca1c('0x23')](_0xca1c('0x81'),_0xca1c('0x27'),_0xca1c('0x89'),util[_0xca1c('0x83')](_0x470229[_0xca1c('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x2e3bd8;}})[_0xca1c('0x1e')](respondWithResult(_0x3e2718,null))[_0xca1c('0x53')](handleError(_0x3e2718,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8f44aa5..bb6967b 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 _0xe6f7=['hasOwnProperty','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','update','emit'];(function(_0x512892,_0x37ab20){var _0x482f09=function(_0xeb9be2){while(--_0xeb9be2){_0x512892['push'](_0x512892['shift']());}};_0x482f09(++_0x37ab20);}(_0xe6f7,0x10b));var _0x7e6f=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0xe6f7[_0x60df74];return _0x5ee872;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x7e6f('0x0'))['db'][_0x7e6f('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7e6f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e6f('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc79ac2){return function(_0x31f522,_0x110601,_0x1dc658){SmsMessageEvents['emit'](_0xc79ac2+':'+_0x31f522['id'],_0x31f522);SmsMessageEvents[_0x7e6f('0x4')](_0xc79ac2,_0x31f522);_0x1dc658(null);};}for(var e in events){if(events[_0x7e6f('0x5')](e)){var event=events[e];SmsMessage[_0x7e6f('0x6')](e,emitEvent(event));}}module[_0x7e6f('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xe34f=['hasOwnProperty','exports','../../mysqldb','SmsMessage','setMaxListeners','save','emit'];(function(_0x5d74b6,_0xe9b6c0){var _0x15807e=function(_0x4264d9){while(--_0x4264d9){_0x5d74b6['push'](_0x5d74b6['shift']());}};_0x15807e(++_0xe9b6c0);}(_0xe34f,0x183));var _0xfe34=function(_0x3e07f8,_0x16373c){_0x3e07f8=_0x3e07f8-0x0;var _0x5caed4=_0xe34f[_0x3e07f8];return _0x5caed4;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xfe34('0x0'))['db'][_0xfe34('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xfe34('0x2')](0x0);var events={'afterCreate':_0xfe34('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12f9d4){return function(_0x4ea6e1,_0x129384,_0x501667){SmsMessageEvents[_0xfe34('0x4')](_0x12f9d4+':'+_0x4ea6e1['id'],_0x4ea6e1);SmsMessageEvents[_0xfe34('0x4')](_0x12f9d4,_0x4ea6e1);_0x501667(null);};}for(var e in events){if(events[_0xfe34('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xfe34('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f47fca5..fb42ace 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 _0x9d0b=['/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','sort','length','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','lodash','util','api','moment','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','findOne','then','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','read','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','infobip','baseUrl'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9d0b,0xa3));var _0xb9d0=function(_0x3f8080,_0x46a7e0){_0x3f8080=_0x3f8080-0x0;var _0x5eae36=_0x9d0b[_0x3f8080];return _0x5eae36;};'use strict';var _=require(_0xb9d0('0x0'));var util=require(_0xb9d0('0x1'));var logger=require('../../config/logger')(_0xb9d0('0x2'));var moment=require(_0xb9d0('0x3'));var BPromise=require(_0xb9d0('0x4'));var rp=require(_0xb9d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9d0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb9d0('0x7'));module[_0xb9d0('0x8')]=function(_0x4faf32,_0x192904){return _0x4faf32[_0xb9d0('0x9')](_0xb9d0('0xa'),attributes,{'tableName':_0xb9d0('0xb'),'paranoid':![],'indexes':[{'name':_0xb9d0('0xc'),'fields':[_0xb9d0('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xb9d0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4173a6,_0x44e3cc,_0x26a4f6){var _0xd8057b=_0x4faf32[_0xb9d0('0xe')];var _0x25883e=_0x4173a6['get']({'plain':!![]});if(_0x25883e['direction'][_0xb9d0('0xf')]()==='in'||_0x25883e[_0xb9d0('0x10')][_0xb9d0('0xf')]()===_0xb9d0('0x11')&&!_0x25883e[_0xb9d0('0x12')]&&!_[_0xb9d0('0x13')](_0x25883e[_0xb9d0('0x14')])&&!_[_0xb9d0('0x13')](_0x25883e[_0xb9d0('0x15')])){_0xd8057b['SmsInteraction'][_0xb9d0('0x16')]({'where':{'id':_0x25883e['SmsInteractionId']}})[_0xb9d0('0x17')](function(_0x419914){if(_0x419914){_0x419914['update']({'lastMsgAt':_0x25883e[_0xb9d0('0x18')],'lastMsgDirection':_0x25883e[_0xb9d0('0x10')][_0xb9d0('0xf')]()});}})[_0xb9d0('0x19')](function(_0x1ea268){console[_0xb9d0('0x1a')](_0x1ea268);});}if(_0x25883e[_0xb9d0('0x10')]===_0xb9d0('0x11')&&!_0x25883e[_0xb9d0('0x12')]){var _0xe6492f;_0xd8057b[_0xb9d0('0x1b')]['find']({'where':{'id':_0x25883e[_0xb9d0('0x1c')]},'raw':!![]})['then'](function(_0x422993){_0xe6492f=_0x422993;if(_0xe6492f&&_0xe6492f[_0xb9d0('0x1d')]){switch(_0xe6492f[_0xb9d0('0x1d')]){case _0xb9d0('0x1e'):var _0x46e7df=require('twilio');if(_0xe6492f[_0xb9d0('0x1f')]&&_0xe6492f[_0xb9d0('0x20')]&&_0xe6492f[_0xb9d0('0x21')]){var _0x49988b=new _0x46e7df(_0xe6492f[_0xb9d0('0x1f')],_0xe6492f[_0xb9d0('0x20')]);_0x49988b[_0xb9d0('0x22')][_0xb9d0('0x23')]({'body':_0x25883e[_0xb9d0('0x24')],'to':_0x25883e[_0xb9d0('0x21')],'from':_0xe6492f['phone'],'statusCallback':_0xe6492f[_0xb9d0('0x25')]+_0xb9d0('0x26')+_0x25883e['id']+_0xb9d0('0x27')+_0xe6492f[_0xb9d0('0x28')]})[_0xb9d0('0x17')](function(_0x2a9f67){if(_0x2a9f67['sid']){return _0x4173a6[_0xb9d0('0x29')]({'messageId':_0x2a9f67[_0xb9d0('0x2a')]});}})[_0xb9d0('0x19')](function(_0x48759f){logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x1e'),util[_0xb9d0('0x2d')](_0x48759f,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate',_0xb9d0('0x1e'),_0xb9d0('0x2e'));}break;case _0xb9d0('0x2f'):var _0x3bb451=_0xb9d0('0x30');if(_0xe6492f['username']&&_0xe6492f[_0xb9d0('0x31')]){var _0x33c14e={'recipient':[_0x25883e[_0xb9d0('0x21')]],'message':_0x25883e['body'],'message_type':_0xe6492f[_0xb9d0('0x32')]};if(_0xe6492f['smsMethod']&&_0xe6492f['smsMethod']!=='SI'){_0x33c14e[_0xb9d0('0x33')]=_0xe6492f[_0xb9d0('0x21')];}var _0x4578bf={'url':_0x3bb451+_0xb9d0('0x34')+_0xe6492f['username']+_0xb9d0('0x35')+_0xe6492f['password'],'method':_0xb9d0('0x36')};rp(_0x4578bf)[_0xb9d0('0x17')](function(_0x2c50fe){var _0x5553f1=_0x2c50fe[_0xb9d0('0x37')](';');var _0x5a7f4e={'user_key':_0x5553f1[0x0],'session_key':_0x5553f1[0x1]};_0x4578bf={'url':_0x3bb451+_0xb9d0('0x38'),'method':_0xb9d0('0x39'),'headers':{'user_key':_0x5a7f4e[_0xb9d0('0x3a')],'Session_key':_0x5a7f4e['session_key']},'json':!![],'body':_0x33c14e};return rp(_0x4578bf);})[_0xb9d0('0x17')](function(_0x3bf270){if(_0x3bf270['total_sent']>=0x1){var _0x507716={'messageId':_0x3bf270[_0xb9d0('0x3b')]};if(_0xe6492f[_0xb9d0('0x32')]!=='GP'||!_0xe6492f[_0xb9d0('0x3c')]){_0x507716['read']=!![];}return _0x4173a6['update'](_0x507716);}else{return logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x2f'),util[_0xb9d0('0x2d')](_0x3bf270,{'showHidden':![],'depth':null}));}})[_0xb9d0('0x19')](function(_0x254e94){return logger['error'](_0xb9d0('0x2b'),'afterCreate',_0xb9d0('0x2f'),util[_0xb9d0('0x2d')](_0x254e94,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb9d0('0x2f'),_0xb9d0('0x3d'));}break;case _0xb9d0('0x3e'):if(_0xe6492f[_0xb9d0('0x20')]){var _0x3d0ebb={'recipient':_0x25883e[_0xb9d0('0x21')],'message':_0x25883e['body'],'sender':_0xe6492f[_0xb9d0('0x3f')]||_0xe6492f[_0xb9d0('0x21')],'authorization':_0xe6492f[_0xb9d0('0x20')]};var _0x44e3cc={'method':_0xb9d0('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x3d0ebb,'json':!![]};rp(_0x44e3cc)['then'](function(_0x8d108d){var _0x40e9d7={'messageId':_0x8d108d['requestid']};if(!_0xe6492f[_0xb9d0('0x3c')]){_0x40e9d7[_0xb9d0('0x40')]=!![];}return _0x4173a6[_0xb9d0('0x29')](_0x40e9d7);})[_0xb9d0('0x19')](function(_0xb40ce4){logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x3e'),util[_0xb9d0('0x2d')](_0xb40ce4,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate','connectel',_0xb9d0('0x41'));}break;case _0xb9d0('0x42'):if(_0xe6492f[_0xb9d0('0x43')]&&_0xe6492f[_0xb9d0('0x31')]){var _0x3d0ebb={'messages':[{'source':_0xb9d0('0x44'),'to':_0x25883e['phone'],'body':_0x25883e['body'],'from':_0xe6492f[_0xb9d0('0x3f')]||_0xe6492f[_0xb9d0('0x21')]}]};var _0x3b81e8=util[_0xb9d0('0x45')](_0xb9d0('0x46'),_0xe6492f[_0xb9d0('0x43')],_0xe6492f[_0xb9d0('0x31')]);var _0x44e3cc={'method':_0xb9d0('0x39'),'uri':_0xb9d0('0x47'),'body':_0x3d0ebb,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3b81e8)[_0xb9d0('0x48')](_0xb9d0('0x49')))},'json':!![]};rp(_0x44e3cc)[_0xb9d0('0x17')](function(_0x1e96f5){if(_0x1e96f5[_0xb9d0('0x4a')]>=0xc8&&_0x1e96f5[_0xb9d0('0x4a')]<=0xce){if(_0x1e96f5[_0xb9d0('0x4b')]&&_0x1e96f5[_0xb9d0('0x4b')][_0xb9d0('0x4c')]>0x0){var _0x45a8c1=_[_0xb9d0('0x4d')](_0x1e96f5['data'][_0xb9d0('0x22')]);var _0x430b77={'messageId':_0x45a8c1[_0xb9d0('0x4e')]};if(!_0xe6492f[_0xb9d0('0x3c')]){_0x430b77[_0xb9d0('0x40')]=!![];}return _0x4173a6[_0xb9d0('0x29')](_0x430b77);}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate',_0xb9d0('0x4f'),util['inspect'](_0x1e96f5,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb9d0('0x2b'),'afterCreate',_0xb9d0('0x4f'),util[_0xb9d0('0x2d')](_0x1e96f5,{'showHidden':![],'depth':null}));}})[_0xb9d0('0x19')](function(_0x140608){logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0xb9d0('0x2d')](_0x140608,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x4f'),_0xb9d0('0x3d'));}break;case _0xb9d0('0x50'):if(_0xe6492f[_0xb9d0('0x51')]&&_0xe6492f[_0xb9d0('0x20')]){var _0x3d0ebb={'dst':_0x25883e[_0xb9d0('0x21')],'text':_0x25883e[_0xb9d0('0x24')],'src':_0xe6492f[_0xb9d0('0x3f')]||_0xe6492f[_0xb9d0('0x21')],'url':_0xe6492f[_0xb9d0('0x25')]+_0xb9d0('0x26')+_0x25883e['id']+'/status?token='+_0xe6492f[_0xb9d0('0x28')]};var _0x3b81e8=util[_0xb9d0('0x45')]('%s:%s',_0xe6492f[_0xb9d0('0x51')],_0xe6492f[_0xb9d0('0x20')]);var _0x44e3cc={'method':'POST','uri':util[_0xb9d0('0x45')](_0xb9d0('0x52'),_0xe6492f[_0xb9d0('0x51')]),'body':_0x3d0ebb,'headers':{'Authorization':util[_0xb9d0('0x45')](_0xb9d0('0x53'),new Buffer(_0x3b81e8)[_0xb9d0('0x48')](_0xb9d0('0x49')))},'json':!![]};rp(_0x44e3cc)[_0xb9d0('0x17')](function(_0x2c0616){var _0x35e67d={'messageId':_0x2c0616[_0xb9d0('0x54')][0x0]};return _0x4173a6[_0xb9d0('0x29')](_0x35e67d);})[_0xb9d0('0x19')](function(_0x3cd748){logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x50'),util['inspect'](_0x3cd748,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb9d0('0x55'):if(_0xe6492f[_0xb9d0('0x43')]&&_0xe6492f[_0xb9d0('0x31')]){if(_0xe6492f[_0xb9d0('0x56')]){var _0x507365={'method':_0xb9d0('0x39'),'uri':_0xe6492f['baseUrl']+_0xb9d0('0x57'),'body':{'username':_0xe6492f[_0xb9d0('0x43')],'password':_0xe6492f[_0xb9d0('0x31')]},'json':!![]};return rp(_0x507365)[_0xb9d0('0x17')](function(_0x39a65c){var _0x5d9867={'method':'POST','uri':_0xe6492f['baseUrl']+_0xb9d0('0x58'),'body':{'messages':[{'from':_0xe6492f[_0xb9d0('0x21')],'destinations':[{'to':_0x25883e[_0xb9d0('0x21')]}],'text':_0x25883e[_0xb9d0('0x24')],'notifyUrl':_0xe6492f['remote']+_0xb9d0('0x26')+_0x25883e['id']+_0xb9d0('0x27')+_0xe6492f['token'],'notifyContentType':_0xb9d0('0x59'),'callbackData':_0xe6492f[_0xb9d0('0x21')]+';'+_0x25883e[_0xb9d0('0x24')]}]},'headers':{'Authorization':_0xb9d0('0x5a')+_0x39a65c[_0xb9d0('0x28')]},'json':!![]};return rp(_0x5d9867)[_0xb9d0('0x17')](function(_0x55bb2a){if(_0x55bb2a[_0xb9d0('0x22')]){var _0x16119={'messageId':_0x55bb2a[_0xb9d0('0x22')][0x0][_0xb9d0('0xc')]};if(!_0xe6492f[_0xb9d0('0x3c')]){_0x16119[_0xb9d0('0x40')]=!![];}return _0x4173a6[_0xb9d0('0x29')](_0x16119);}else{return logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate','infobip',util[_0xb9d0('0x2d')](_0x55bb2a,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2e3da7){return logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb9d0('0x2c'),'infobip',util[_0xb9d0('0x2d')](_0x2e3da7,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x55'),_0xb9d0('0x5b'));}}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x55'),_0xb9d0('0x3d'));}break;case _0xb9d0('0x5c'):var _0x49d8ce=require(_0xb9d0('0x5d'));if(_0xe6492f['apiKey']){var _0xdab4d9={};_0xdab4d9[_0xb9d0('0x5e')]=_0xe6492f[_0xb9d0('0x43')];_0xdab4d9['phone']=_0x25883e[_0xb9d0('0x21')];_0xdab4d9[_0xb9d0('0x33')]=_0xe6492f[_0xb9d0('0x21')];_0xdab4d9[_0xb9d0('0x5f')]=_0x25883e[_0xb9d0('0x24')];_0xdab4d9[_0xb9d0('0x60')]=+new Date();var _0x35f31e='';var _0x114533='';var _0x43504b=Object['keys'](_0xdab4d9);_0x43504b[_0xb9d0('0x61')]();for(var _0x1ebb47=0x0;_0x1ebb47<_0x43504b[_0xb9d0('0x62')];_0x1ebb47++){if(_0x35f31e!=''){_0x35f31e+='&';}_0x35f31e+=_0x43504b[_0x1ebb47]+'='+encodeURIComponent(_0xdab4d9[_0x43504b[_0x1ebb47]]);_0x114533+=_0xdab4d9[_0x43504b[_0x1ebb47]];}_0x114533+=_0xe6492f[_0xb9d0('0x63')];_0x114533=_0x49d8ce[_0xb9d0('0x64')]('md5')[_0xb9d0('0x29')](_0x114533)[_0xb9d0('0x65')](_0xb9d0('0x66'));if(_0x35f31e!==''){_0x35f31e+='&';}_0x35f31e+=_0xb9d0('0x67')+_0x114533;var _0x4578bf={'method':_0xb9d0('0x36'),'uri':_0xe6492f[_0xb9d0('0x56')]+_0xb9d0('0x68')+_0x35f31e,'json':!![]};return rp(_0x4578bf)[_0xb9d0('0x17')](function(_0x2d8061){var _0x7c1b4b=Object[_0xb9d0('0x69')](_0x2d8061);if(_0x2d8061[_0x7c1b4b[0x0]][_0xb9d0('0x1a')]&&parseInt(_0x2d8061[_0x7c1b4b[0x0]][_0xb9d0('0x1a')])===0x0){var _0x13b3fe={'messageId':_0x2d8061[_0x7c1b4b[0x0]][_0xb9d0('0x6a')]};if(!_0xe6492f[_0xb9d0('0x3c')]){_0x13b3fe['read']=!![];}return _0x4173a6[_0xb9d0('0x29')](_0x13b3fe);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb9d0('0x2c'),'csc',util[_0xb9d0('0x2d')](_0x2d8061[_0xb9d0('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4bc304){return logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x5c'),util['inspect'](_0x4bc304,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x5c'),_0xb9d0('0x6b'));}break;case _0xb9d0('0x6c'):if(_0xe6492f['apiKey']){var _0x13e974={'method':_0xb9d0('0x39'),'uri':_0xb9d0('0x6d'),'headers':{'Authorization':_0xe6492f[_0xb9d0('0x63')]},'body':{'content':_0x25883e['body'],'to':[_0x25883e[_0xb9d0('0x21')]],'from':_0xe6492f['phone'],'binary':![],'clientMessageId':_0xb9d0('0x6e'),'charset':_0xb9d0('0x6f')},'json':!![]};rp(_0x13e974)[_0xb9d0('0x17')](function(_0x96c9c6){if(!_0x96c9c6[_0xb9d0('0x1a')]){var _0x1f6a98={'messageId':_0x96c9c6['messages'][0x0]['apiMessageId']};if(!_0xe6492f[_0xb9d0('0x3c')]){_0x1f6a98[_0xb9d0('0x40')]=!![];}return _0x4173a6[_0xb9d0('0x29')](_0x1f6a98);}else{return logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb9d0('0x2c'),'clickatell',util[_0xb9d0('0x2d')](_0x96c9c6[_0xb9d0('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3325a7){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb9d0('0x6c'),util[_0xb9d0('0x2d')](_0x3325a7,{'showHidden':![],'depth':null}));});}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0xb9d0('0x70'):if(_0xe6492f[_0xb9d0('0x43')]&&_0xe6492f[_0xb9d0('0x31')]){var _0x3b81e8=util[_0xb9d0('0x45')](_0xb9d0('0x46'),_0xe6492f[_0xb9d0('0x43')],_0xe6492f[_0xb9d0('0x31')]);var _0x44e3cc={'method':_0xb9d0('0x39'),'uri':_0xb9d0('0x71')+_0xe6492f[_0xb9d0('0x72')]+_0xb9d0('0x73'),'body':{'to':[_0x25883e[_0xb9d0('0x21')]],'text':_0x25883e[_0xb9d0('0x24')],'from':_0xe6492f['phone'],'applicationId':_0xe6492f[_0xb9d0('0x74')]},'headers':{'Authorization':util[_0xb9d0('0x45')]('Basic\x20%s',new Buffer(_0x3b81e8)[_0xb9d0('0x48')]('base64'))},'json':!![]};rp(_0x44e3cc)[_0xb9d0('0x17')](function(_0x1ec1a3){if(_0x1ec1a3['id']){var _0x2106c9={'messageId':_0x1ec1a3['id']};return _0x4173a6[_0xb9d0('0x29')](_0x2106c9);}else{logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x70'),util['inspect'](_0x1ec1a3,{'showHidden':![],'depth':null}));}})[_0xb9d0('0x19')](function(_0x4c4699){logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate',_0xb9d0('0x70'),util['inspect'](_0x4c4699,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb9d0('0x2b'),_0xb9d0('0x2c'),_0xb9d0('0x70'),_0xb9d0('0x3d'));}break;case _0xb9d0('0x75'):if(_0xe6492f['apiKey']){var _0x466422={};var _0x4578bf={'method':_0xb9d0('0x39'),'uri':_0xb9d0('0x76'),'headers':{'Authorization':'Bearer\x20'+_0xe6492f[_0xb9d0('0x63')],'Content-Type':_0xb9d0('0x59')},'body':{'from':_0xe6492f[_0xb9d0('0x21')],'to':_0x25883e[_0xb9d0('0x21')],'text':_0x25883e[_0xb9d0('0x24')]},'json':!![]};return rp(_0x4578bf)[_0xb9d0('0x17')](function(_0x2151e7){if(_0x2151e7[_0xb9d0('0x77')]==0xca){_0x466422[_0xb9d0('0x78')]=_0x2151e7;var _0x3b7630={'method':_0xb9d0('0x39'),'uri':_0xb9d0('0x79'),'headers':{'Authorization':_0xb9d0('0x7a')+_0xe6492f[_0xb9d0('0x63')],'Content-Type':_0xb9d0('0x59')},'body':{'refid':_0x466422[_0xb9d0('0x78')][_0xb9d0('0x7b')]},'json':!![]};return rp(_0x3b7630)['then'](function(_0x114a93){_0x466422[_0xb9d0('0x7c')]=_0x114a93;var _0x3ae6b8={'messageId':_0x466422['message']['refid'],'read':!![]};return _0x4173a6['update'](_0x3ae6b8);});}else{return logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb9d0('0x2c'),_0xb9d0('0x75'),util[_0xb9d0('0x2d')](_0x2151e7,{'showHidden':![],'depth':null}));}})[_0xb9d0('0x19')](function(_0x301eae){return logger[_0xb9d0('0x1a')](_0xb9d0('0x2b'),'afterCreate','intelepeer',util['inspect'](_0x301eae,{'showHidden':![],'depth':null}));});}else{return logger[_0xb9d0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb9d0('0x2c'),_0xb9d0('0x75'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x26a4f6();});}else{_0x26a4f6();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1277=['../../config/environment','exports','define','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','catch','error','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','messages','create','remote','/status?token=','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','GET','sms','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','createHash','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x48a082,_0x2a26b9){var _0xf69a35=function(_0x210e57){while(--_0x210e57){_0x48a082['push'](_0x48a082['shift']());}};_0xf69a35(++_0x2a26b9);}(_0x1277,0x16e));var _0x7127=function(_0x46e754,_0x29ea33){_0x46e754=_0x46e754-0x0;var _0x4cab18=_0x1277[_0x46e754];return _0x4cab18;};'use strict';var _=require(_0x7127('0x0'));var util=require(_0x7127('0x1'));var logger=require(_0x7127('0x2'))(_0x7127('0x3'));var moment=require(_0x7127('0x4'));var BPromise=require(_0x7127('0x5'));var rp=require(_0x7127('0x6'));var fs=require('fs');var path=require(_0x7127('0x7'));var rimraf=require(_0x7127('0x8'));var config=require(_0x7127('0x9'));var attributes=require('./smsMessage.attributes');module[_0x7127('0xa')]=function(_0x52ef66,_0x42d305){return _0x52ef66[_0x7127('0xb')]('SmsMessage',attributes,{'tableName':_0x7127('0xc'),'paranoid':![],'indexes':[{'name':_0x7127('0xd'),'fields':[_0x7127('0xd')]},{'name':'fti_sms_messages','fields':[_0x7127('0xe')],'type':_0x7127('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x499c8f,_0x3ac85b,_0x275547){var _0x12eef6=_0x52ef66[_0x7127('0x10')];var _0x55752e=_0x499c8f[_0x7127('0x11')]({'plain':!![]});if(_0x55752e[_0x7127('0x12')][_0x7127('0x13')]()==='in'||_0x55752e['direction'][_0x7127('0x13')]()==='out'&&!_0x55752e[_0x7127('0x14')]&&!_['isNil'](_0x55752e[_0x7127('0x15')])&&!_[_0x7127('0x16')](_0x55752e[_0x7127('0x17')])){_0x12eef6[_0x7127('0x18')][_0x7127('0x19')]({'where':{'id':_0x55752e[_0x7127('0x17')]}})['then'](function(_0x4a9709){if(_0x4a9709){_0x4a9709[_0x7127('0x1a')]({'lastMsgAt':_0x55752e[_0x7127('0x1b')],'lastMsgDirection':_0x55752e[_0x7127('0x12')][_0x7127('0x13')]()});}})[_0x7127('0x1c')](function(_0x1260af){console[_0x7127('0x1d')](_0x1260af);});}if(_0x55752e[_0x7127('0x12')]==='out'&&!_0x55752e[_0x7127('0x14')]){var _0x274ba2;_0x12eef6['SmsAccount'][_0x7127('0x1e')]({'where':{'id':_0x55752e[_0x7127('0x1f')]},'raw':!![]})[_0x7127('0x20')](function(_0x500cd1){_0x274ba2=_0x500cd1;if(_0x274ba2&&_0x274ba2[_0x7127('0x21')]){switch(_0x274ba2[_0x7127('0x21')]){case _0x7127('0x22'):var _0x5d904b=require(_0x7127('0x22'));if(_0x274ba2[_0x7127('0x23')]&&_0x274ba2['authToken']&&_0x274ba2[_0x7127('0x24')]){var _0x289805=new _0x5d904b(_0x274ba2['accountSid'],_0x274ba2[_0x7127('0x25')]);_0x289805[_0x7127('0x26')][_0x7127('0x27')]({'body':_0x55752e[_0x7127('0xe')],'to':_0x55752e[_0x7127('0x24')],'from':_0x274ba2[_0x7127('0x24')],'statusCallback':_0x274ba2[_0x7127('0x28')]+'/api/sms/messages/'+_0x55752e['id']+_0x7127('0x29')+_0x274ba2['token']})[_0x7127('0x20')](function(_0x191940){if(_0x191940['sid']){return _0x499c8f[_0x7127('0x1a')]({'messageId':_0x191940[_0x7127('0x2a')]});}})[_0x7127('0x1c')](function(_0x12397d){logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),_0x7127('0x22'),util[_0x7127('0x2c')](_0x12397d,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x22'),_0x7127('0x2e'));}break;case _0x7127('0x2f'):var _0x5e906e=_0x7127('0x30');if(_0x274ba2[_0x7127('0x31')]&&_0x274ba2['password']){var _0x3197e4={'recipient':[_0x55752e['phone']],'message':_0x55752e[_0x7127('0xe')],'message_type':_0x274ba2[_0x7127('0x32')]};if(_0x274ba2[_0x7127('0x32')]&&_0x274ba2[_0x7127('0x32')]!=='SI'){_0x3197e4[_0x7127('0x33')]=_0x274ba2['phone'];}var _0x3c7514={'url':_0x5e906e+_0x7127('0x34')+_0x274ba2[_0x7127('0x31')]+'&password='+_0x274ba2[_0x7127('0x35')],'method':_0x7127('0x36')};rp(_0x3c7514)['then'](function(_0x1303f5){var _0x28b689=_0x1303f5['split'](';');var _0x44f772={'user_key':_0x28b689[0x0],'session_key':_0x28b689[0x1]};_0x3c7514={'url':_0x5e906e+_0x7127('0x37'),'method':'POST','headers':{'user_key':_0x44f772[_0x7127('0x38')],'Session_key':_0x44f772[_0x7127('0x39')]},'json':!![],'body':_0x3197e4};return rp(_0x3c7514);})[_0x7127('0x20')](function(_0x157d1a){if(_0x157d1a[_0x7127('0x3a')]>=0x1){var _0x5d752b={'messageId':_0x157d1a['internal_order_id']};if(_0x274ba2['smsMethod']!=='GP'||!_0x274ba2[_0x7127('0x3b')]){_0x5d752b[_0x7127('0x3c')]=!![];}return _0x499c8f[_0x7127('0x1a')](_0x5d752b);}else{return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'skebby',util['inspect'](_0x157d1a,{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x58b67c){return logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),'skebby',util[_0x7127('0x2c')](_0x58b67c,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'skebby',_0x7127('0x3d'));}break;case'connectel':if(_0x274ba2[_0x7127('0x25')]){var _0x7a4a1b={'recipient':_0x55752e[_0x7127('0x24')],'message':_0x55752e['body'],'sender':_0x274ba2[_0x7127('0x3e')]||_0x274ba2[_0x7127('0x24')],'authorization':_0x274ba2[_0x7127('0x25')]};var _0x3ac85b={'method':_0x7127('0x3f'),'uri':_0x7127('0x40'),'body':_0x7a4a1b,'json':!![]};rp(_0x3ac85b)[_0x7127('0x20')](function(_0x28f924){var _0x3f8af5={'messageId':_0x28f924['requestid']};if(!_0x274ba2[_0x7127('0x3b')]){_0x3f8af5['read']=!![];}return _0x499c8f[_0x7127('0x1a')](_0x3f8af5);})['catch'](function(_0x447db8){logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x41'),util[_0x7127('0x2c')](_0x447db8,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),'connectel',_0x7127('0x42'));}break;case _0x7127('0x43'):if(_0x274ba2[_0x7127('0x31')]&&_0x274ba2[_0x7127('0x35')]){var _0x7a4a1b={'messages':[{'source':'xCALLY\x20Motion','to':_0x55752e[_0x7127('0x24')],'body':_0x55752e['body'],'from':_0x274ba2[_0x7127('0x3e')]||_0x274ba2[_0x7127('0x24')]}]};var _0x45c55c=util[_0x7127('0x44')](_0x7127('0x45'),_0x274ba2[_0x7127('0x31')],_0x274ba2[_0x7127('0x35')]);var _0x3ac85b={'method':_0x7127('0x3f'),'uri':_0x7127('0x46'),'body':_0x7a4a1b,'headers':{'Authorization':util[_0x7127('0x44')]('Basic\x20%s',new Buffer(_0x45c55c)[_0x7127('0x47')](_0x7127('0x48')))},'json':!![]};rp(_0x3ac85b)['then'](function(_0x8dc319){if(_0x8dc319['http_code']>=0xc8&&_0x8dc319[_0x7127('0x49')]<=0xce){if(_0x8dc319['data']&&_0x8dc319[_0x7127('0x4a')][_0x7127('0x4b')]>0x0){var _0x24774e=_[_0x7127('0x4c')](_0x8dc319[_0x7127('0x4a')][_0x7127('0x26')]);var _0x514d75={'messageId':_0x24774e[_0x7127('0x4d')]};if(!_0x274ba2[_0x7127('0x3b')]){_0x514d75[_0x7127('0x3c')]=!![];}return _0x499c8f[_0x7127('0x1a')](_0x514d75);}else{logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),_0x7127('0x4e'),util[_0x7127('0x2c')](_0x8dc319,{'showHidden':![],'depth':null}));}}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'clickSend',util[_0x7127('0x2c')](_0x8dc319,{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x2dd300){logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7127('0x4e'),util[_0x7127('0x2c')](_0x2dd300,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'clickSend',_0x7127('0x3d'));}break;case _0x7127('0x4f'):if(_0x274ba2[_0x7127('0x50')]&&_0x274ba2[_0x7127('0x25')]){var _0x7a4a1b={'dst':_0x55752e[_0x7127('0x24')],'text':_0x55752e[_0x7127('0xe')],'src':_0x274ba2[_0x7127('0x3e')]||_0x274ba2[_0x7127('0x24')],'url':_0x274ba2[_0x7127('0x28')]+_0x7127('0x51')+_0x55752e['id']+'/status?token='+_0x274ba2[_0x7127('0x52')]};var _0x45c55c=util[_0x7127('0x44')](_0x7127('0x45'),_0x274ba2[_0x7127('0x50')],_0x274ba2[_0x7127('0x25')]);var _0x3ac85b={'method':'POST','uri':util['format'](_0x7127('0x53'),_0x274ba2[_0x7127('0x50')]),'body':_0x7a4a1b,'headers':{'Authorization':util[_0x7127('0x44')](_0x7127('0x54'),new Buffer(_0x45c55c)[_0x7127('0x47')](_0x7127('0x48')))},'json':!![]};rp(_0x3ac85b)['then'](function(_0x35212f){var _0x3707c8={'messageId':_0x35212f[_0x7127('0x55')][0x0]};return _0x499c8f[_0x7127('0x1a')](_0x3707c8);})[_0x7127('0x1c')](function(_0x2ddf6a){logger[_0x7127('0x1d')](_0x7127('0x2d'),'afterCreate','plivo',util[_0x7127('0x2c')](_0x2ddf6a,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x7127('0x56'):if(_0x274ba2[_0x7127('0x31')]&&_0x274ba2[_0x7127('0x35')]){if(_0x274ba2['baseUrl']){var _0x5002b2={'method':_0x7127('0x3f'),'uri':_0x274ba2['baseUrl']+_0x7127('0x57'),'body':{'username':_0x274ba2[_0x7127('0x31')],'password':_0x274ba2[_0x7127('0x35')]},'json':!![]};return rp(_0x5002b2)['then'](function(_0x1a436a){var _0x2c4b0f={'method':_0x7127('0x3f'),'uri':_0x274ba2[_0x7127('0x58')]+_0x7127('0x59'),'body':{'messages':[{'from':_0x274ba2['phone'],'destinations':[{'to':_0x55752e[_0x7127('0x24')]}],'text':_0x55752e['body'],'notifyUrl':_0x274ba2[_0x7127('0x28')]+_0x7127('0x51')+_0x55752e['id']+_0x7127('0x29')+_0x274ba2[_0x7127('0x52')],'notifyContentType':_0x7127('0x5a'),'callbackData':_0x274ba2['phone']+';'+_0x55752e['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x1a436a['token']},'json':!![]};return rp(_0x2c4b0f)['then'](function(_0x5560f8){if(_0x5560f8['messages']){var _0x21805b={'messageId':_0x5560f8['messages'][0x0][_0x7127('0xd')]};if(!_0x274ba2[_0x7127('0x3b')]){_0x21805b[_0x7127('0x3c')]=!![];}return _0x499c8f[_0x7127('0x1a')](_0x21805b);}else{return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'infobip',util[_0x7127('0x2c')](_0x5560f8,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2cc608){return logger[_0x7127('0x1d')](_0x7127('0x2d'),'afterCreate',_0x7127('0x56'),util[_0x7127('0x2c')](_0x2cc608,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),_0x7127('0x56'),_0x7127('0x5b'));}}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x56'),_0x7127('0x3d'));}break;case _0x7127('0x5c'):var _0xb78c05=require(_0x7127('0x5d'));if(_0x274ba2[_0x7127('0x5e')]){var _0x2976d6={};_0x2976d6[_0x7127('0x5f')]=_0x274ba2[_0x7127('0x31')];_0x2976d6[_0x7127('0x24')]=_0x55752e[_0x7127('0x24')];_0x2976d6[_0x7127('0x33')]=_0x274ba2['phone'];_0x2976d6['text']=_0x55752e[_0x7127('0xe')];_0x2976d6[_0x7127('0x60')]=+new Date();var _0x33a1fa='';var _0x4a9421='';var _0x3c5a7d=Object[_0x7127('0x61')](_0x2976d6);_0x3c5a7d[_0x7127('0x62')]();for(var _0x4ee2f2=0x0;_0x4ee2f2<_0x3c5a7d['length'];_0x4ee2f2++){if(_0x33a1fa!=''){_0x33a1fa+='&';}_0x33a1fa+=_0x3c5a7d[_0x4ee2f2]+'='+encodeURIComponent(_0x2976d6[_0x3c5a7d[_0x4ee2f2]]);_0x4a9421+=_0x2976d6[_0x3c5a7d[_0x4ee2f2]];}_0x4a9421+=_0x274ba2[_0x7127('0x5e')];_0x4a9421=_0xb78c05[_0x7127('0x63')]('md5')['update'](_0x4a9421)[_0x7127('0x64')](_0x7127('0x65'));if(_0x33a1fa!==''){_0x33a1fa+='&';}_0x33a1fa+=_0x7127('0x66')+_0x4a9421;var _0x3c7514={'method':_0x7127('0x36'),'uri':_0x274ba2[_0x7127('0x58')]+_0x7127('0x67')+_0x33a1fa,'json':!![]};return rp(_0x3c7514)[_0x7127('0x20')](function(_0x4e088d){var _0x2125f8=Object[_0x7127('0x61')](_0x4e088d);if(_0x4e088d[_0x2125f8[0x0]][_0x7127('0x1d')]&&parseInt(_0x4e088d[_0x2125f8[0x0]]['error'])===0x0){var _0x40202c={'messageId':_0x4e088d[_0x2125f8[0x0]]['id_sms']};if(!_0x274ba2[_0x7127('0x3b')]){_0x40202c[_0x7127('0x3c')]=!![];}return _0x499c8f[_0x7127('0x1a')](_0x40202c);}else{return logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),_0x7127('0x5c'),util['inspect'](_0x4e088d['error'],{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x3c7404){return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'csc',util['inspect'](_0x3c7404,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'csc',_0x7127('0x68'));}break;case _0x7127('0x69'):if(_0x274ba2[_0x7127('0x5e')]){var _0xe2dfea={'method':_0x7127('0x3f'),'uri':_0x7127('0x6a'),'headers':{'Authorization':_0x274ba2[_0x7127('0x5e')]},'body':{'content':_0x55752e['body'],'to':[_0x55752e[_0x7127('0x24')]],'from':_0x274ba2[_0x7127('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x7127('0x6b')},'json':!![]};rp(_0xe2dfea)[_0x7127('0x20')](function(_0x52ad70){if(!_0x52ad70[_0x7127('0x1d')]){var _0x46d6a6={'messageId':_0x52ad70[_0x7127('0x26')][0x0][_0x7127('0x6c')]};if(!_0x274ba2[_0x7127('0x3b')]){_0x46d6a6['read']=!![];}return _0x499c8f[_0x7127('0x1a')](_0x46d6a6);}else{return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x69'),util[_0x7127('0x2c')](_0x52ad70[_0x7127('0x1d')],{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x2f9b74){return logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),'clickatell',util[_0x7127('0x2c')](_0x2f9b74,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x69'),_0x7127('0x68'));}break;case _0x7127('0x6d'):if(_0x274ba2[_0x7127('0x31')]&&_0x274ba2[_0x7127('0x35')]){var _0x45c55c=util['format'](_0x7127('0x45'),_0x274ba2['username'],_0x274ba2[_0x7127('0x35')]);var _0x3ac85b={'method':_0x7127('0x3f'),'uri':_0x7127('0x6e')+_0x274ba2[_0x7127('0x6f')]+_0x7127('0x70'),'body':{'to':[_0x55752e[_0x7127('0x24')]],'text':_0x55752e[_0x7127('0xe')],'from':_0x274ba2[_0x7127('0x24')],'applicationId':_0x274ba2[_0x7127('0x71')]},'headers':{'Authorization':util['format'](_0x7127('0x54'),new Buffer(_0x45c55c)['toString'](_0x7127('0x48')))},'json':!![]};rp(_0x3ac85b)['then'](function(_0x4c4b88){if(_0x4c4b88['id']){var _0x5485be={'messageId':_0x4c4b88['id']};return _0x499c8f['update'](_0x5485be);}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),'afterCreate',_0x7127('0x6d'),util[_0x7127('0x2c')](_0x4c4b88,{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x1bfdc8){logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),'bandwidth',util['inspect'](_0x1bfdc8,{'showHidden':![],'depth':null}));});}else{logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7127('0x72'):if(_0x274ba2[_0x7127('0x5e')]){var _0x52aefe={};var _0x3c7514={'method':_0x7127('0x3f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x7127('0x73')+_0x274ba2[_0x7127('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x274ba2['phone'],'to':_0x55752e[_0x7127('0x24')],'text':_0x55752e[_0x7127('0xe')]},'json':!![]};return rp(_0x3c7514)[_0x7127('0x20')](function(_0x2271cd){if(_0x2271cd[_0x7127('0x74')]==0xca){_0x52aefe['message']=_0x2271cd;var _0x1c7aac={'method':_0x7127('0x3f'),'uri':_0x7127('0x75'),'headers':{'Authorization':'Bearer\x20'+_0x274ba2[_0x7127('0x5e')],'Content-Type':_0x7127('0x5a')},'body':{'refid':_0x52aefe[_0x7127('0x76')]['refid']},'json':!![]};return rp(_0x1c7aac)[_0x7127('0x20')](function(_0x4fe922){_0x52aefe[_0x7127('0x77')]=_0x4fe922;var _0x5747cf={'messageId':_0x52aefe[_0x7127('0x76')][_0x7127('0x78')],'read':!![]};return _0x499c8f[_0x7127('0x1a')](_0x5747cf);});}else{return logger[_0x7127('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7127('0x2b'),_0x7127('0x72'),util['inspect'](_0x2271cd,{'showHidden':![],'depth':null}));}})[_0x7127('0x1c')](function(_0x4ce4e0){return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x72'),util['inspect'](_0x4ce4e0,{'showHidden':![],'depth':null}));});}else{return logger[_0x7127('0x1d')](_0x7127('0x2d'),_0x7127('0x2b'),_0x7127('0x72'),_0x7127('0x79'));}break;}}})[_0x7127('0x7a')](function(){_0x275547();});}else{_0x275547();}}},'charset':_0x7127('0x7b'),'collate':_0x7127('0x7c')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 40855b6..3653f55 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 _0x2db5=['socket.io-emitter','./smsMessage.socket','register','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x2db5,0x8f));var _0x52db=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x2db5[_0x4bc428];return _0x3ca37f;};'use strict';var _=require(_0x52db('0x0'));var util=require(_0x52db('0x1'));var moment=require(_0x52db('0x2'));var BPromise=require('bluebird');var rs=require(_0x52db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52db('0x4'))['db'];var utils=require(_0x52db('0x5'));var logger=require('../../config/logger')(_0x52db('0x6'));var config=require('../../config/environment');var jayson=require(_0x52db('0x7'));var client=jayson[_0x52db('0x8')][_0x52db('0x9')]({'port':0x232a});config[_0x52db('0xa')]=_[_0x52db('0xb')](config[_0x52db('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x52db('0xc'))(new Redis(config[_0x52db('0xa')]));require(_0x52db('0xd'))[_0x52db('0xe')](socket);function respondWithRpcPromise(_0x4c53bd,_0x1c4a7d,_0x3bf4ef){return new BPromise(function(_0x31cb8d,_0x39cd9b){return client['request'](_0x4c53bd,_0x3bf4ef)['then'](function(_0x1d83b0){logger[_0x52db('0xf')](_0x52db('0x10'),_0x1c4a7d,_0x52db('0x11'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c4a7d,_0x52db('0x11'),JSON[_0x52db('0x12')](_0x1d83b0));if(_0x1d83b0[_0x52db('0x13')]){if(_0x1d83b0[_0x52db('0x13')]['code']===0x1f4){logger[_0x52db('0x13')](_0x52db('0x10'),_0x1c4a7d,_0x1d83b0[_0x52db('0x13')][_0x52db('0x14')]);return _0x39cd9b(_0x1d83b0['error'][_0x52db('0x14')]);}logger[_0x52db('0x13')](_0x52db('0x10'),_0x1c4a7d,_0x1d83b0[_0x52db('0x13')][_0x52db('0x14')]);return _0x31cb8d(_0x1d83b0[_0x52db('0x13')][_0x52db('0x14')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x1c4a7d,_0x52db('0x11'));_0x31cb8d(_0x1d83b0[_0x52db('0x15')][_0x52db('0x14')]);}})[_0x52db('0x16')](function(_0x5e3fd4){logger[_0x52db('0x13')](_0x52db('0x10'),_0x1c4a7d,_0x5e3fd4);_0x39cd9b(_0x5e3fd4);});});}exports[_0x52db('0x17')]=function(_0x1067ba){var _0x27de9c=this;return new Promise(function(_0x2b65b6,_0x141baa){return db[_0x52db('0x18')][_0x52db('0x19')](_0x1067ba[_0x52db('0x1a')],{'raw':_0x1067ba[_0x52db('0x1b')]?_0x1067ba['options'][_0x52db('0x1c')]===undefined?!![]:![]:!![]})[_0x52db('0x1d')](function(_0x46aced){logger['info'](_0x52db('0x17'),_0x1067ba);logger[_0x52db('0x1e')](_0x52db('0x17'),_0x1067ba,JSON['stringify'](_0x46aced));_0x2b65b6(_0x46aced);})[_0x52db('0x16')](function(_0x62cf5b){logger[_0x52db('0x13')](_0x52db('0x17'),_0x62cf5b[_0x52db('0x14')],_0x1067ba);_0x141baa(_0x27de9c[_0x52db('0x13')](0x1f4,_0x62cf5b[_0x52db('0x14')]));});});}; \ No newline at end of file +var _0xe007=['request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug'];(function(_0x22de9b,_0x3550cc){var _0x2ff6a9=function(_0x54155e){while(--_0x54155e){_0x22de9b['push'](_0x22de9b['shift']());}};_0x2ff6a9(++_0x3550cc);}(_0xe007,0xb6));var _0x7e00=function(_0x4d5e31,_0xe5acde){_0x4d5e31=_0x4d5e31-0x0;var _0x36b657=_0xe007[_0x4d5e31];return _0x36b657;};'use strict';var _=require(_0x7e00('0x0'));var util=require(_0x7e00('0x1'));var moment=require('moment');var BPromise=require(_0x7e00('0x2'));var rs=require(_0x7e00('0x3'));var fs=require('fs');var Redis=require(_0x7e00('0x4'));var db=require(_0x7e00('0x5'))['db'];var utils=require(_0x7e00('0x6'));var logger=require('../../config/logger')(_0x7e00('0x7'));var config=require(_0x7e00('0x8'));var jayson=require(_0x7e00('0x9'));var client=jayson[_0x7e00('0xa')]['http']({'port':0x232a});config[_0x7e00('0xb')]=_[_0x7e00('0xc')](config[_0x7e00('0xb')],{'host':_0x7e00('0xd'),'port':0x18eb});var socket=require(_0x7e00('0xe'))(new Redis(config[_0x7e00('0xb')]));require(_0x7e00('0xf'))[_0x7e00('0x10')](socket);function respondWithRpcPromise(_0x4850b8,_0x243aaa,_0x59b3fc){return new BPromise(function(_0x2d1256,_0x232ec0){return client[_0x7e00('0x11')](_0x4850b8,_0x59b3fc)[_0x7e00('0x12')](function(_0x11c830){logger[_0x7e00('0x13')](_0x7e00('0x14'),_0x243aaa,'request\x20sent');logger[_0x7e00('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x243aaa,_0x7e00('0x16'),JSON[_0x7e00('0x17')](_0x11c830));if(_0x11c830[_0x7e00('0x18')]){if(_0x11c830[_0x7e00('0x18')][_0x7e00('0x19')]===0x1f4){logger[_0x7e00('0x18')](_0x7e00('0x14'),_0x243aaa,_0x11c830[_0x7e00('0x18')]['message']);return _0x232ec0(_0x11c830[_0x7e00('0x18')][_0x7e00('0x1a')]);}logger[_0x7e00('0x18')]('SmsMessage,\x20%s,\x20%s',_0x243aaa,_0x11c830[_0x7e00('0x18')][_0x7e00('0x1a')]);return _0x2d1256(_0x11c830[_0x7e00('0x18')][_0x7e00('0x1a')]);}else{logger[_0x7e00('0x13')]('SmsMessage,\x20%s,\x20%s',_0x243aaa,'request\x20sent');_0x2d1256(_0x11c830[_0x7e00('0x1b')]['message']);}})[_0x7e00('0x1c')](function(_0x1c24c5){logger[_0x7e00('0x18')](_0x7e00('0x14'),_0x243aaa,_0x1c24c5);_0x232ec0(_0x1c24c5);});});}exports[_0x7e00('0x1d')]=function(_0x40c471){var _0x79cc31=this;return new Promise(function(_0x44ab6f,_0x7c6184){return db[_0x7e00('0x1e')][_0x7e00('0x1f')](_0x40c471[_0x7e00('0x20')],{'raw':_0x40c471['options']?_0x40c471[_0x7e00('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x7e00('0x12')](function(_0x266180){logger[_0x7e00('0x13')](_0x7e00('0x1d'),_0x40c471);logger[_0x7e00('0x15')]('CreateSmsMessage',_0x40c471,JSON[_0x7e00('0x17')](_0x266180));_0x44ab6f(_0x266180);})['catch'](function(_0x12a582){logger[_0x7e00('0x18')]('CreateSmsMessage',_0x12a582[_0x7e00('0x1a')],_0x40c471);_0x7c6184(_0x79cc31[_0x7e00('0x18')](0x1f4,_0x12a582[_0x7e00('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d9affbe..4cc5c69 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 _0xf427=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xf427,0xe5));var _0x7f42=function(_0x5ede4e,_0x3085fd){_0x5ede4e=_0x5ede4e-0x0;var _0x5d1e52=_0xf427[_0x5ede4e];return _0x5d1e52;};'use strict';var SmsMessageEvents=require(_0x7f42('0x0'));var events=[_0x7f42('0x1'),_0x7f42('0x2'),'update'];function createListener(_0x2be482,_0x1f7146){return function(_0x57ea4b){_0x1f7146[_0x7f42('0x3')](_0x2be482,_0x57ea4b);};}function removeListener(_0x449026,_0x1cb3a1){return function(){SmsMessageEvents[_0x7f42('0x4')](_0x449026,_0x1cb3a1);};}exports[_0x7f42('0x5')]=function(_0x4abd01){for(var _0x522aca=0x0,_0x5cdac2=events[_0x7f42('0x6')];_0x522aca<_0x5cdac2;_0x522aca++){var _0x596801=events[_0x522aca];var _0x12a6da=createListener(_0x7f42('0x7')+_0x596801,_0x4abd01);SmsMessageEvents['on'](_0x596801,_0x12a6da);}}; \ No newline at end of file +var _0xc6df=['removeListener','register','length','smsMessage:','./smsMessage.events','emit'];(function(_0x5ac1ae,_0x2bbf6d){var _0x2ca11f=function(_0x1a8b4f){while(--_0x1a8b4f){_0x5ac1ae['push'](_0x5ac1ae['shift']());}};_0x2ca11f(++_0x2bbf6d);}(_0xc6df,0x76));var _0xfc6d=function(_0x5d005e,_0x47ae13){_0x5d005e=_0x5d005e-0x0;var _0x3c6f48=_0xc6df[_0x5d005e];return _0x3c6f48;};'use strict';var SmsMessageEvents=require(_0xfc6d('0x0'));var events=['save','remove','update'];function createListener(_0x5b9d9e,_0x5e0885){return function(_0x1b8e52){_0x5e0885[_0xfc6d('0x1')](_0x5b9d9e,_0x1b8e52);};}function removeListener(_0x5014ed,_0xd97d1c){return function(){SmsMessageEvents[_0xfc6d('0x2')](_0x5014ed,_0xd97d1c);};}exports[_0xfc6d('0x3')]=function(_0x586b4c){for(var _0x443c8c=0x0,_0x35f590=events[_0xfc6d('0x4')];_0x443c8c<_0x35f590;_0x443c8c++){var _0x5d2c88=events[_0x443c8c];var _0x141c9c=createListener(_0xfc6d('0x5')+_0x5d2c88,_0x586b4c);SmsMessageEvents['on'](_0x5d2c88,_0x141c9c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 19fe996..72b7b5a 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 _0xf83d=['fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','multer','path','express'];(function(_0x33ada6,_0x3a5024){var _0x8f0234=function(_0x41e29e){while(--_0x41e29e){_0x33ada6['push'](_0x33ada6['shift']());}};_0x8f0234(++_0x3a5024);}(_0xf83d,0xab));var _0xdf83=function(_0x12b4b6,_0x4dfc5b){_0x12b4b6=_0x12b4b6-0x0;var _0xa7009e=_0xf83d[_0x12b4b6];return _0xa7009e;};'use strict';var multer=require(_0xdf83('0x0'));var util=require('util');var path=require(_0xdf83('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf83('0x2'));var router=express['Router']();var fs_extra=require(_0xdf83('0x3'));var auth=require(_0xdf83('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdf83('0x5'));var controller=require(_0xdf83('0x6'));router[_0xdf83('0x7')]('/',auth[_0xdf83('0x8')](),controller['index']);router[_0xdf83('0x7')](_0xdf83('0x9'),auth[_0xdf83('0x8')](),controller[_0xdf83('0xa')]);router[_0xdf83('0x7')](_0xdf83('0xb'),auth[_0xdf83('0x8')](),controller[_0xdf83('0xc')]);router[_0xdf83('0x7')](_0xdf83('0xd'),auth[_0xdf83('0x8')](),controller[_0xdf83('0xe')]);router[_0xdf83('0x7')]('/:id/teams',auth[_0xdf83('0x8')](),controller[_0xdf83('0xf')]);router[_0xdf83('0x7')](_0xdf83('0x10'),auth[_0xdf83('0x8')](),controller[_0xdf83('0x11')]);router[_0xdf83('0x12')]('/',auth[_0xdf83('0x8')](),controller[_0xdf83('0x13')]);router['post']('/:id/teams',auth[_0xdf83('0x8')](),controller[_0xdf83('0x14')]);router['post'](_0xdf83('0x10'),auth[_0xdf83('0x8')](),controller[_0xdf83('0x15')]);router[_0xdf83('0x16')](_0xdf83('0xb'),auth[_0xdf83('0x8')](),controller['update']);router['delete'](_0xdf83('0xb'),auth[_0xdf83('0x8')](),controller[_0xdf83('0x17')]);router[_0xdf83('0x18')](_0xdf83('0x19'),auth[_0xdf83('0x8')](),controller[_0xdf83('0x1a')]);router[_0xdf83('0x18')]('/:id/users',auth[_0xdf83('0x8')](),controller[_0xdf83('0x1b')]);module[_0xdf83('0x1c')]=router; \ No newline at end of file +var _0x0855=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','/describe','get','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x57d2d0,_0x4c59b8){var _0x4b1025=function(_0x55448d){while(--_0x55448d){_0x57d2d0['push'](_0x57d2d0['shift']());}};_0x4b1025(++_0x4c59b8);}(_0x0855,0x7a));var _0x5085=function(_0x47b497,_0x5af2ed){_0x47b497=_0x47b497-0x0;var _0x39c0f3=_0x0855[_0x47b497];return _0x39c0f3;};'use strict';var multer=require(_0x5085('0x0'));var util=require(_0x5085('0x1'));var path=require(_0x5085('0x2'));var timeout=require(_0x5085('0x3'));var express=require(_0x5085('0x4'));var router=express[_0x5085('0x5')]();var fs_extra=require(_0x5085('0x6'));var auth=require(_0x5085('0x7'));var interaction=require(_0x5085('0x8'));var config=require(_0x5085('0x9'));var controller=require(_0x5085('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x5085('0xb')]);router['get'](_0x5085('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5085('0xd')](_0x5085('0xe'),auth[_0x5085('0xf')](),controller['show']);router[_0x5085('0xd')](_0x5085('0x10'),auth[_0x5085('0xf')](),controller[_0x5085('0x11')]);router[_0x5085('0xd')](_0x5085('0x12'),auth[_0x5085('0xf')](),controller[_0x5085('0x13')]);router[_0x5085('0xd')]('/:id/users',auth[_0x5085('0xf')](),controller[_0x5085('0x14')]);router[_0x5085('0x15')]('/',auth[_0x5085('0xf')](),controller['create']);router[_0x5085('0x15')](_0x5085('0x12'),auth['isAuthenticated'](),controller[_0x5085('0x16')]);router['post'](_0x5085('0x17'),auth['isAuthenticated'](),controller[_0x5085('0x18')]);router[_0x5085('0x19')](_0x5085('0xe'),auth[_0x5085('0xf')](),controller[_0x5085('0x1a')]);router['delete'](_0x5085('0xe'),auth['isAuthenticated'](),controller[_0x5085('0x1b')]);router['delete']('/:id/teams',auth[_0x5085('0xf')](),controller[_0x5085('0x1c')]);router[_0x5085('0x1d')](_0x5085('0x17'),auth[_0x5085('0xf')](),controller[_0x5085('0x1e')]);module[_0x5085('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 3c7cbf1..9c95fae 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 _0xf7e1=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0xbe9db0,_0x3f9827){var _0x20de61=function(_0x5e91e7){while(--_0x5e91e7){_0xbe9db0['push'](_0xbe9db0['shift']());}};_0x20de61(++_0x3f9827);}(_0xf7e1,0xeb));var _0x1f7e=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xf7e1[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require(_0x1f7e('0x0'));module[_0x1f7e('0x1')]={'name':{'type':Sequelize[_0x1f7e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1f7e('0x2')]},'timeout':{'type':Sequelize[_0x1f7e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1f7e('0x4')](_0x1f7e('0x5'),_0x1f7e('0x6'),_0x1f7e('0x7'))}}; \ No newline at end of file +var _0xaf41=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x354181,_0x12bd72){var _0xfbb67a=function(_0x1e174f){while(--_0x1e174f){_0x354181['push'](_0x354181['shift']());}};_0xfbb67a(++_0x12bd72);}(_0xaf41,0xb0));var _0x1af4=function(_0x51228d,_0x4fa2b0){_0x51228d=_0x51228d-0x0;var _0x51a599=_0xaf41[_0x51228d];return _0x51a599;};'use strict';var Sequelize=require(_0x1af4('0x0'));module['exports']={'name':{'type':Sequelize[_0x1af4('0x1')],'unique':_0x1af4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1af4('0x1')]},'timeout':{'type':Sequelize[_0x1af4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1af4('0x4')]('rrmemory',_0x1af4('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 66a93b3..fceaae5 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 _0x68a1=['path','sox','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','describe','findOne','UserSmsQueue','order','SmsQueueId','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','ids','Team','User','online','voicePause','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','forEach','userSmsQueue:remove','addAgents','spread','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3590f8,_0x3da7da){var _0x2b744c=function(_0x2ef026){while(--_0x2ef026){_0x3590f8['push'](_0x3590f8['shift']());}};_0x2b744c(++_0x3da7da);}(_0x68a1,0x89));var _0x168a=function(_0x3d4bbe,_0x5d0d3c){_0x3d4bbe=_0x3d4bbe-0x0;var _0x2c429b=_0x68a1[_0x3d4bbe];return _0x2c429b;};'use strict';var emlformat=require(_0x168a('0x0'));var rimraf=require(_0x168a('0x1'));var zipdir=require(_0x168a('0x2'));var jsonpatch=require(_0x168a('0x3'));var rp=require('request-promise');var moment=require(_0x168a('0x4'));var BPromise=require(_0x168a('0x5'));var Mustache=require(_0x168a('0x6'));var util=require('util');var path=require(_0x168a('0x7'));var sox=require(_0x168a('0x8'));var csv=require(_0x168a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x168a('0xa'));var _=require(_0x168a('0xb'));var squel=require(_0x168a('0xc'));var crypto=require('crypto');var jsforce=require(_0x168a('0xd'));var deskjs=require(_0x168a('0xe'));var toCsv=require(_0x168a('0x9'));var querystring=require(_0x168a('0xf'));var Papa=require(_0x168a('0x10'));var Redis=require(_0x168a('0x11'));var authService=require(_0x168a('0x12'));var qs=require(_0x168a('0x13'));var as=require(_0x168a('0x14'));var hardwareService=require(_0x168a('0x15'));var logger=require(_0x168a('0x16'))(_0x168a('0x17'));var utils=require(_0x168a('0x18'));var config=require(_0x168a('0x19'));var licenseUtil=require(_0x168a('0x1a'));var db=require(_0x168a('0x1b'))['db'];config[_0x168a('0x1c')]=_[_0x168a('0x1d')](config[_0x168a('0x1c')],{'host':_0x168a('0x1e'),'port':0x18eb});var socket=require(_0x168a('0x1f'))(new Redis(config['redis']));require(_0x168a('0x20'))['register'](socket);function respondWithStatusCode(_0x2c4f1c,_0x1e1b41){_0x1e1b41=_0x1e1b41||0xcc;return function(_0x12612e){if(_0x12612e){return _0x2c4f1c['sendStatus'](_0x1e1b41);}return _0x2c4f1c[_0x168a('0x21')](_0x1e1b41)['end']();};}function respondWithResult(_0x55659b,_0x3be49f){_0x3be49f=_0x3be49f||0xc8;return function(_0x533d12){if(_0x533d12){return _0x55659b[_0x168a('0x21')](_0x3be49f)[_0x168a('0x22')](_0x533d12);}};}function respondWithFilteredResult(_0x54fd8c,_0x4ed54e){return function(_0x647cc6){if(_0x647cc6){var _0x1e09ef=typeof _0x4ed54e[_0x168a('0x23')]==='undefined'&&typeof _0x4ed54e[_0x168a('0x24')]===_0x168a('0x25');var _0x5984fd=_0x647cc6[_0x168a('0x26')];var _0x2a18d1=_0x1e09ef?0x0:_0x4ed54e[_0x168a('0x23')];var _0x2a4b06=_0x1e09ef?_0x647cc6[_0x168a('0x26')]:_0x4ed54e['offset']+_0x4ed54e[_0x168a('0x24')];var _0x3c59d3;if(_0x2a4b06>=_0x5984fd){_0x2a4b06=_0x5984fd;_0x3c59d3=0xc8;}else{_0x3c59d3=0xce;}_0x54fd8c[_0x168a('0x21')](_0x3c59d3);return _0x54fd8c['set']('Content-Range',_0x2a18d1+'-'+_0x2a4b06+'/'+_0x5984fd)[_0x168a('0x22')](_0x647cc6);}return null;};}function patchUpdates(_0x1fab6a){return function(_0x2ad047){try{jsonpatch[_0x168a('0x27')](_0x2ad047,_0x1fab6a,!![]);}catch(_0x162d55){return BPromise[_0x168a('0x28')](_0x162d55);}return _0x2ad047[_0x168a('0x29')]();};}function saveUpdates(_0x329ac9,_0x3bef83){return function(_0x1b6287){if(_0x1b6287){return _0x1b6287['update'](_0x329ac9)[_0x168a('0x2a')](function(_0x577a43){return _0x577a43;});}return null;};}function removeEntity(_0x144aa9,_0x207e1b){return function(_0x2a52f1){if(_0x2a52f1){return _0x2a52f1[_0x168a('0x2b')]()[_0x168a('0x2a')](function(){var _0x2906ac=_0x2a52f1[_0x168a('0x2c')]({'plain':!![]});var _0x12e495=_0x168a('0x2d');return db[_0x168a('0x2e')][_0x168a('0x2b')]({'where':{'type':_0x12e495,'resourceId':_0x2906ac['id']}})['then'](function(){return _0x2a52f1;});})[_0x168a('0x2a')](function(){_0x144aa9[_0x168a('0x21')](0xcc)[_0x168a('0x2f')]();});}};}function handleEntityNotFound(_0x2e5426,_0x10d4b4){return function(_0x4d80d9){if(!_0x4d80d9){_0x2e5426[_0x168a('0x30')](0x194);}return _0x4d80d9;};}function handleError(_0x2a0033,_0x17c61e){_0x17c61e=_0x17c61e||0x1f4;return function(_0x4a437e){logger[_0x168a('0x31')](_0x4a437e[_0x168a('0x32')]);if(_0x4a437e[_0x168a('0x33')]){delete _0x4a437e[_0x168a('0x33')];}_0x2a0033[_0x168a('0x21')](_0x17c61e)[_0x168a('0x34')](_0x4a437e);};}exports[_0x168a('0x35')]=function(_0x446427,_0x24501e){var _0x51d7b9={},_0x74112c={},_0x3027dd={'count':0x0,'rows':[]};var _0x325c92=_[_0x168a('0x36')](db[_0x168a('0x37')][_0x168a('0x38')],function(_0x379e6c){return{'name':_0x379e6c[_0x168a('0x39')],'type':_0x379e6c[_0x168a('0x3a')]['key']};});_0x74112c['model']=_[_0x168a('0x36')](_0x325c92,'name');_0x74112c[_0x168a('0x3b')]=_[_0x168a('0x3c')](_0x446427[_0x168a('0x3b')]);_0x74112c[_0x168a('0x3d')]=_[_0x168a('0x3e')](_0x74112c[_0x168a('0x3f')],_0x74112c[_0x168a('0x3b')]);_0x51d7b9[_0x168a('0x40')]=_[_0x168a('0x3e')](_0x74112c[_0x168a('0x3f')],qs[_0x168a('0x41')](_0x446427[_0x168a('0x3b')][_0x168a('0x41')]));_0x51d7b9[_0x168a('0x40')]=_0x51d7b9[_0x168a('0x40')][_0x168a('0x42')]?_0x51d7b9[_0x168a('0x40')]:_0x74112c[_0x168a('0x3f')];if(!_0x446427['query'][_0x168a('0x43')](_0x168a('0x44'))){_0x51d7b9[_0x168a('0x24')]=qs[_0x168a('0x24')](_0x446427[_0x168a('0x3b')][_0x168a('0x24')]);_0x51d7b9['offset']=qs['offset'](_0x446427[_0x168a('0x3b')][_0x168a('0x23')]);}_0x51d7b9['order']=qs[_0x168a('0x45')](_0x446427[_0x168a('0x3b')][_0x168a('0x45')]);_0x51d7b9['where']=qs[_0x168a('0x3d')](_[_0x168a('0x46')](_0x446427['query'],_0x74112c[_0x168a('0x3d')]),_0x325c92);if(_0x446427[_0x168a('0x3b')][_0x168a('0x47')]){_0x51d7b9[_0x168a('0x48')]=_[_0x168a('0x49')](_0x51d7b9[_0x168a('0x48')],{'$or':_[_0x168a('0x36')](_0x325c92,function(_0x15a713){if(_0x15a713['type']!==_0x168a('0x4a')){var _0x6ee52b={};_0x6ee52b[_0x15a713['name']]={'$like':'%'+_0x446427[_0x168a('0x3b')][_0x168a('0x47')]+'%'};return _0x6ee52b;}})});}_0x51d7b9=_['merge']({},_0x51d7b9,_0x446427[_0x168a('0x4b')]);var _0x193c0b={'where':_0x51d7b9[_0x168a('0x48')]};return db[_0x168a('0x37')][_0x168a('0x26')](_0x193c0b)[_0x168a('0x2a')](function(_0xf570ae){_0x3027dd[_0x168a('0x26')]=_0xf570ae;if(_0x446427['query'][_0x168a('0x4c')]){_0x51d7b9[_0x168a('0x4d')]=[{'all':!![]}];}return db[_0x168a('0x37')][_0x168a('0x4e')](_0x51d7b9);})[_0x168a('0x2a')](function(_0x81dada){_0x3027dd[_0x168a('0x4f')]=_0x81dada;return _0x3027dd;})['then'](respondWithFilteredResult(_0x24501e,_0x51d7b9))['catch'](handleError(_0x24501e,null));};exports[_0x168a('0x50')]=function(_0x3bf153,_0x4e47c2){var _0x1dee6b={'raw':!![],'where':{'id':_0x3bf153[_0x168a('0x51')]['id']}},_0xb62928={};_0xb62928['model']=_['keys'](db[_0x168a('0x37')]['rawAttributes']);_0xb62928['query']=_[_0x168a('0x3c')](_0x3bf153[_0x168a('0x3b')]);_0xb62928[_0x168a('0x3d')]=_[_0x168a('0x3e')](_0xb62928[_0x168a('0x3f')],_0xb62928[_0x168a('0x3b')]);_0x1dee6b['attributes']=_[_0x168a('0x3e')](_0xb62928['model'],qs['fields'](_0x3bf153[_0x168a('0x3b')]['fields']));_0x1dee6b[_0x168a('0x40')]=_0x1dee6b[_0x168a('0x40')][_0x168a('0x42')]?_0x1dee6b[_0x168a('0x40')]:_0xb62928[_0x168a('0x3f')];if(_0x3bf153[_0x168a('0x3b')][_0x168a('0x4c')]){_0x1dee6b['include']=[{'all':!![]}];}_0x1dee6b=_[_0x168a('0x49')]({},_0x1dee6b,_0x3bf153[_0x168a('0x4b')]);return db['SmsQueue']['find'](_0x1dee6b)[_0x168a('0x2a')](handleEntityNotFound(_0x4e47c2,null))[_0x168a('0x2a')](respondWithResult(_0x4e47c2,null))[_0x168a('0x52')](handleError(_0x4e47c2,null));};exports[_0x168a('0x53')]=function(_0x3d1955,_0x434446){return db[_0x168a('0x37')][_0x168a('0x53')](_0x3d1955[_0x168a('0x54')],{})[_0x168a('0x2a')](function(_0x12ff02){var _0x334643=_0x3d1955[_0x168a('0x55')][_0x168a('0x2c')]({'plain':!![]});if(!_0x334643)throw new Error(_0x168a('0x56'));if(_0x334643[_0x168a('0x57')]===_0x168a('0x55')){var _0x29c816=_0x12ff02['get']({'plain':!![]});var _0x5eb472='SmsQueues';return db['UserProfileSection'][_0x168a('0x58')]({'where':{'name':_0x5eb472,'userProfileId':_0x334643[_0x168a('0x59')]},'raw':!![]})[_0x168a('0x2a')](function(_0x2e18b2){if(_0x2e18b2&&_0x2e18b2['autoAssociation']===0x0){return db[_0x168a('0x2e')][_0x168a('0x53')]({'name':_0x29c816[_0x168a('0x33')],'resourceId':_0x29c816['id'],'type':_0x2e18b2['name'],'sectionId':_0x2e18b2['id']},{})['then'](function(){return _0x12ff02;});}else{return _0x12ff02;}})[_0x168a('0x52')](function(_0x596c65){logger[_0x168a('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x596c65);throw _0x596c65;});}return _0x12ff02;})[_0x168a('0x2a')](respondWithResult(_0x434446,0xc9))[_0x168a('0x52')](handleError(_0x434446,null));};exports['update']=function(_0x4b41e5,_0x275dca){if(_0x4b41e5['body']['id']){delete _0x4b41e5['body']['id'];}return db['SmsQueue'][_0x168a('0x58')]({'where':{'id':_0x4b41e5[_0x168a('0x51')]['id']}})['then'](handleEntityNotFound(_0x275dca,null))[_0x168a('0x2a')](saveUpdates(_0x4b41e5['body'],null))[_0x168a('0x2a')](respondWithResult(_0x275dca,null))[_0x168a('0x52')](handleError(_0x275dca,null));};exports[_0x168a('0x2b')]=function(_0x305c8d,_0x223cf7){return db[_0x168a('0x37')][_0x168a('0x58')]({'where':{'id':_0x305c8d['params']['id']}})[_0x168a('0x2a')](handleEntityNotFound(_0x223cf7,null))['then'](removeEntity(_0x223cf7,null))[_0x168a('0x52')](handleError(_0x223cf7,null));};exports[_0x168a('0x5a')]=function(_0x204ca3,_0x29b6e4){return db['SmsQueue']['describe']()[_0x168a('0x2a')](respondWithResult(_0x29b6e4,null))[_0x168a('0x52')](handleError(_0x29b6e4,null));};exports['getMembers']=function(_0x3d5fdb,_0x4a3971,_0x3cb769){var _0x2a5bff={'raw':!![],'where':{}},_0x3ca755={},_0x5b4c7b;return db[_0x168a('0x37')][_0x168a('0x5b')]({'where':{'id':_0x3d5fdb[_0x168a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a3971,null))[_0x168a('0x2a')](function(_0x20e4a){if(_0x20e4a){_0x5b4c7b=_0x20e4a['get']({'plain':!![]});_0x3ca755['model']=_[_0x168a('0x3c')](db[_0x168a('0x5c')][_0x168a('0x38')]);_0x3ca755[_0x168a('0x3b')]=_[_0x168a('0x3c')](_0x3d5fdb[_0x168a('0x3b')]);_0x3ca755[_0x168a('0x3d')]=_[_0x168a('0x3e')](_0x3ca755[_0x168a('0x3f')],_0x3ca755['query']);_0x2a5bff[_0x168a('0x40')]=_[_0x168a('0x3e')](_0x3ca755['model'],qs[_0x168a('0x41')](_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x41')]));_0x2a5bff[_0x168a('0x40')]=_0x2a5bff[_0x168a('0x40')][_0x168a('0x42')]?_0x2a5bff[_0x168a('0x40')]:_0x3ca755[_0x168a('0x3f')];if(!_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x43')](_0x168a('0x44'))){_0x2a5bff['limit']=qs[_0x168a('0x24')](_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x24')]);_0x2a5bff[_0x168a('0x23')]=qs[_0x168a('0x23')](_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x23')]);}_0x2a5bff[_0x168a('0x5d')]=qs[_0x168a('0x45')](_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x45')]);_0x2a5bff['where']=qs[_0x168a('0x3d')](_[_0x168a('0x46')](_0x3d5fdb[_0x168a('0x3b')],_0x3ca755[_0x168a('0x3d')]));_0x2a5bff[_0x168a('0x48')][_0x168a('0x5e')]=_0x20e4a['id'];if(_0x3d5fdb[_0x168a('0x3b')][_0x168a('0x47')]){_0x2a5bff[_0x168a('0x48')]=_[_0x168a('0x49')](_0x2a5bff['where'],{'$or':_[_0x168a('0x36')](_0x2a5bff[_0x168a('0x40')],function(_0x2bc64e){var _0x3aa8e6={};_0x3aa8e6[_0x2bc64e]={'$like':'%'+_0x3d5fdb['query'][_0x168a('0x47')]+'%'};return _0x3aa8e6;})});}_0x2a5bff=_[_0x168a('0x49')]({},_0x2a5bff,_0x3d5fdb[_0x168a('0x4b')]);return db[_0x168a('0x5c')][_0x168a('0x4e')](_0x2a5bff);}})[_0x168a('0x2a')](function(_0x16aed8){if(_0x16aed8){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x16aed8,_0x168a('0x5f')),'role':_0x168a('0x60')},'attributes':['id',_0x168a('0x33'),_0x168a('0x61'),_0x168a('0x62'),_0x168a('0x63')]});}})[_0x168a('0x2a')](function(_0xf6ae5e){if(_0xf6ae5e){return{'count':_0xf6ae5e[_0x168a('0x26')],'rows':_[_0x168a('0x36')](_0xf6ae5e['rows'],function(_0x22c206){return{'membername':_0x22c206[_0x168a('0x33')],'UserId':_0x22c206['id'],'queue_name':_0x5b4c7b[_0x168a('0x33')],'SmsQueueId':_0x5b4c7b['id'],'interface':util[_0x168a('0x64')]('%s/%s',_0x168a('0x65'),_0x22c206[_0x168a('0x33')]),'penalty':0x0,'paused':_0x22c206[_0x168a('0x61')],'createdAt':_0x22c206[_0x168a('0x63')],'updatedAt':_0x22c206['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x168a('0x2a')](respondWithFilteredResult(_0x4a3971,_0x2a5bff))['catch'](handleError(_0x4a3971,null));};exports[_0x168a('0x66')]=function(_0x1bb461,_0x374a0f,_0x6e2c7){var _0x18a6d2={};var _0x5b843c={};var _0x43adf6;var _0x2d89f8;return db[_0x168a('0x37')]['findOne']({'where':{'id':_0x1bb461[_0x168a('0x51')]['id']}})[_0x168a('0x2a')](handleEntityNotFound(_0x374a0f,null))['then'](function(_0x519fde){if(_0x519fde){_0x43adf6=_0x519fde;_0x5b843c[_0x168a('0x3f')]=_[_0x168a('0x3c')](db['Team'][_0x168a('0x38')]);_0x5b843c[_0x168a('0x3b')]=_['keys'](_0x1bb461['query']);_0x5b843c['filters']=_[_0x168a('0x3e')](_0x5b843c[_0x168a('0x3f')],_0x5b843c[_0x168a('0x3b')]);_0x18a6d2[_0x168a('0x40')]=_[_0x168a('0x3e')](_0x5b843c[_0x168a('0x3f')],qs[_0x168a('0x41')](_0x1bb461[_0x168a('0x3b')][_0x168a('0x41')]));_0x18a6d2[_0x168a('0x40')]=_0x18a6d2['attributes'][_0x168a('0x42')]?_0x18a6d2['attributes']:_0x5b843c[_0x168a('0x3f')];_0x18a6d2[_0x168a('0x5d')]=qs[_0x168a('0x45')](_0x1bb461[_0x168a('0x3b')]['sort']);_0x18a6d2[_0x168a('0x48')]=qs[_0x168a('0x3d')](_[_0x168a('0x46')](_0x1bb461[_0x168a('0x3b')],_0x5b843c[_0x168a('0x3d')]));if(_0x1bb461[_0x168a('0x3b')]['filter']){_0x18a6d2[_0x168a('0x48')]=_[_0x168a('0x49')](_0x18a6d2['where'],{'$or':_[_0x168a('0x36')](_0x18a6d2[_0x168a('0x40')],function(_0x2045be){var _0x49eaa5={};_0x49eaa5[_0x2045be]={'$like':'%'+_0x1bb461[_0x168a('0x3b')]['filter']+'%'};return _0x49eaa5;})});}_0x18a6d2=_[_0x168a('0x49')]({},_0x18a6d2,_0x1bb461['options']);return _0x43adf6[_0x168a('0x66')](_0x18a6d2);}})[_0x168a('0x2a')](function(_0x47f6be){if(_0x47f6be){_0x2d89f8=_0x47f6be[_0x168a('0x42')];if(!_0x1bb461[_0x168a('0x3b')][_0x168a('0x43')]('nolimit')){_0x18a6d2[_0x168a('0x24')]=qs[_0x168a('0x24')](_0x1bb461[_0x168a('0x3b')][_0x168a('0x24')]);_0x18a6d2[_0x168a('0x23')]=qs['offset'](_0x1bb461['query'][_0x168a('0x23')]);}return _0x43adf6[_0x168a('0x66')](_0x18a6d2);}})['then'](function(_0x387d86){if(_0x387d86){return _0x387d86?{'count':_0x2d89f8,'rows':_0x387d86}:null;}})[_0x168a('0x2a')](respondWithResult(_0x374a0f,null))[_0x168a('0x52')](handleError(_0x374a0f,null));};exports['addTeams']=function(_0x197d1d,_0x2c1809,_0x240e38){var _0x46df14=_0x197d1d[_0x168a('0x54')][_0x168a('0x67')];return db[_0x168a('0x68')][_0x168a('0x4e')]({'where':{'id':_0x46df14},'attributes':['id'],'include':[{'model':db[_0x168a('0x69')],'as':'Agents','attributes':['id','name',_0x168a('0x6a'),_0x168a('0x6b'),'interface'],'raw':!![]}]})[_0x168a('0x2a')](function(_0x28ac72){if(_0x28ac72){var _0x452594=_[_0x168a('0x6c')](_0x28ac72,function(_0x4597dd){var _0x8b0054=_0x4597dd[_0x168a('0x2c')]({'plain':!![]});return _0x8b0054[_0x168a('0x6d')];});return db[_0x168a('0x37')][_0x168a('0x58')]({'where':{'id':_0x197d1d['params']['id']}})['then'](function(_0x52fc94){return db[_0x168a('0x6e')][_0x168a('0x6f')](function(_0x58cca0){return _0x52fc94[_0x168a('0x70')](_0x46df14,{'transaction':_0x58cca0})[_0x168a('0x2a')](function(){return BPromise['each'](_0x452594,function(_0x20a786){return db[_0x168a('0x5c')][_0x168a('0x71')]({'where':{'UserId':_0x20a786['id'],'SmsQueueId':_0x197d1d['params']['id']},'transaction':_0x58cca0});});})[_0x168a('0x2a')](function(){_0x452594['forEach'](function(_0x972ffc){socket['emit'](_0x168a('0x72'),{'UserId':_0x972ffc['id'],'SmsQueueId':_0x52fc94['id']});});});});});}})[_0x168a('0x2a')](respondWithStatusCode(_0x2c1809,null))[_0x168a('0x52')](handleError(_0x2c1809,null));};exports[_0x168a('0x73')]=function(_0x400d0e,_0x45c0b4,_0x980f10){return db[_0x168a('0x68')][_0x168a('0x4e')]({'where':{'id':_0x400d0e[_0x168a('0x3b')][_0x168a('0x67')]},'attributes':['id'],'include':[{'model':db[_0x168a('0x69')],'as':_0x168a('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x168a('0x2a')](handleEntityNotFound(_0x45c0b4,null))[_0x168a('0x2a')](function(_0x5663f2){var _0x2a03a3=_[_0x168a('0x36')](_0x5663f2,'id');var _0x2e2b95=[];var _0x49f5e1=[];var _0x13c34a=squel[_0x168a('0x74')]();_0x13c34a[_0x168a('0x75')](_0x168a('0x76'))[_0x168a('0x77')](_0x168a('0x78'),'tq')[_0x168a('0x79')](_0x168a('0x7a'),'ut',_0x168a('0x7b'))[_0x168a('0x48')](_0x168a('0x7c'),_0x400d0e[_0x168a('0x51')]['id']);for(var _0x497125=0x0;_0x497125<_0x5663f2[_0x168a('0x42')];_0x497125+=0x1){let _0x4fef35=_0x5663f2[_0x497125];for(var _0x24fc30=0x0;_0x24fc30<_0x4fef35[_0x168a('0x6d')][_0x168a('0x42')];_0x24fc30+=0x1){let _0x5f5393=_0x4fef35[_0x168a('0x6d')][_0x24fc30];var _0x179056=_0x13c34a[_0x168a('0x7d')]();_0x179056[_0x168a('0x48')](_0x168a('0x7e'),_0x5f5393['id']);_0x49f5e1[_0x168a('0x7f')](db[_0x168a('0x6e')]['query'](_0x179056[_0x168a('0x80')](),{'type':db[_0x168a('0x6e')][_0x168a('0x81')][_0x168a('0x82')]})[_0x168a('0x2a')](function(_0xb0988a){if(_0xb0988a[_0x168a('0x42')]===0x1){return _0x5f5393['id'];}else{var _0x496845=_[_0x168a('0x83')](_[_0x168a('0x36')](_0xb0988a,_0x168a('0x84')),function(_0x2490e9){return _['includes'](_0x2a03a3,_0x2490e9);});if(_0x496845){return _0x5f5393['id'];}}}));}}return BPromise[_0x168a('0x85')](_0x49f5e1)[_0x168a('0x2a')](function(_0x4812e4){_0x2e2b95=_(_0x2e2b95)[_0x168a('0x86')](_0x4812e4)[_0x168a('0x87')]()[_0x168a('0x88')]();return db[_0x168a('0x37')][_0x168a('0x58')]({'where':{'id':_0x400d0e['params']['id']}})[_0x168a('0x2a')](function(_0x2f8a1e){return db['sequelize'][_0x168a('0x6f')](function(_0x41e563){return _0x2f8a1e[_0x168a('0x73')](_0x400d0e[_0x168a('0x3b')]['ids'],{'transaction':_0x41e563})['then'](function(){if(!_['isEmpty'](_0x2e2b95)){return _0x2f8a1e[_0x168a('0x89')](_0x2e2b95,{'transaction':_0x41e563});}})[_0x168a('0x2a')](function(){_0x2e2b95[_0x168a('0x8a')](function(_0x182cf4){socket['emit'](_0x168a('0x8b'),{'UserId':_0x182cf4,'SmsQueueId':_0x2f8a1e['id']});});});});});});})[_0x168a('0x2a')](respondWithStatusCode(_0x45c0b4,null))['catch'](handleError(_0x45c0b4,null));};exports[_0x168a('0x8c')]=function(_0x337717,_0x323812,_0x391aa6){return db[_0x168a('0x37')]['find']({'where':{'id':_0x337717['params']['id']}})[_0x168a('0x2a')](handleEntityNotFound(_0x323812,null))[_0x168a('0x2a')](function(_0x100504){if(_0x100504){return _0x100504[_0x168a('0x8c')](_0x337717[_0x168a('0x54')][_0x168a('0x67')],_['omit'](_0x337717[_0x168a('0x54')],[_0x168a('0x67'),'id'])||{})[_0x168a('0x8d')](function(_0x434040){for(var _0x24e86b=0x0;_0x24e86b<_0x337717[_0x168a('0x54')]['ids'][_0x168a('0x42')];_0x24e86b+=0x1){socket['emit'](_0x168a('0x72'),{'UserId':Number(_0x337717[_0x168a('0x54')][_0x168a('0x67')][_0x24e86b]),'SmsQueueId':Number(_0x337717[_0x168a('0x51')]['id'])});}return _0x434040;});}})['then'](respondWithResult(_0x323812,null))[_0x168a('0x52')](handleError(_0x323812,null));};exports['removeAgents']=function(_0xdf0740,_0x41326a,_0x560d70){return db['SmsQueue'][_0x168a('0x58')]({'where':{'id':_0xdf0740[_0x168a('0x51')]['id']}})[_0x168a('0x2a')](handleEntityNotFound(_0x41326a,null))[_0x168a('0x2a')](function(_0x337fbc){if(_0x337fbc){return _0x337fbc[_0x168a('0x89')](_0xdf0740[_0x168a('0x3b')]['ids'])[_0x168a('0x2a')](function(){if(_['isArray'](_0xdf0740[_0x168a('0x3b')][_0x168a('0x67')])){for(var _0x53d27c=0x0;_0x53d27c<_0xdf0740[_0x168a('0x3b')][_0x168a('0x67')][_0x168a('0x42')];_0x53d27c+=0x1){socket[_0x168a('0x8e')]('userSmsQueue:remove',{'UserId':Number(_0xdf0740[_0x168a('0x3b')][_0x168a('0x67')][_0x53d27c]),'SmsQueueId':Number(_0xdf0740[_0x168a('0x51')]['id'])});}}else{socket[_0x168a('0x8e')]('userSmsQueue:remove',{'UserId':Number(_0xdf0740['query'][_0x168a('0x67')]),'SmsQueueId':Number(_0xdf0740[_0x168a('0x51')]['id'])});}});}})[_0x168a('0x2a')](respondWithStatusCode(_0x41326a,null))[_0x168a('0x52')](handleError(_0x41326a,null));};exports['getAgents']=function(_0x2d8661,_0x4fff4a,_0x596627){var _0x3fe8e9={};var _0x5ca508={};var _0x48a806;var _0x2208e2;return db['SmsQueue'][_0x168a('0x5b')]({'where':{'id':_0x2d8661['params']['id']}})['then'](handleEntityNotFound(_0x4fff4a,null))[_0x168a('0x2a')](function(_0xb89b7){if(_0xb89b7){_0x48a806=_0xb89b7;_0x5ca508[_0x168a('0x3f')]=_['keys'](db[_0x168a('0x69')][_0x168a('0x38')]);_0x5ca508[_0x168a('0x3b')]=_[_0x168a('0x3c')](_0x2d8661[_0x168a('0x3b')]);_0x5ca508['filters']=_[_0x168a('0x3e')](_0x5ca508[_0x168a('0x3f')],_0x5ca508[_0x168a('0x3b')]);_0x3fe8e9[_0x168a('0x40')]=_[_0x168a('0x3e')](_0x5ca508[_0x168a('0x3f')],qs['fields'](_0x2d8661['query'][_0x168a('0x41')]));_0x3fe8e9[_0x168a('0x40')]=_0x3fe8e9[_0x168a('0x40')][_0x168a('0x42')]?_0x3fe8e9[_0x168a('0x40')]:_0x5ca508['model'];_0x3fe8e9[_0x168a('0x5d')]=qs[_0x168a('0x45')](_0x2d8661[_0x168a('0x3b')][_0x168a('0x45')]);_0x3fe8e9[_0x168a('0x48')]=qs[_0x168a('0x3d')](_[_0x168a('0x46')](_0x2d8661[_0x168a('0x3b')],_0x5ca508['filters']));if(_0x2d8661[_0x168a('0x3b')][_0x168a('0x47')]){_0x3fe8e9['where']=_['merge'](_0x3fe8e9['where'],{'$or':_[_0x168a('0x36')](_0x3fe8e9['attributes'],function(_0x150486){var _0x3d2f19={};_0x3d2f19[_0x150486]={'$like':'%'+_0x2d8661[_0x168a('0x3b')]['filter']+'%'};return _0x3d2f19;})});}_0x3fe8e9=_[_0x168a('0x49')]({},_0x3fe8e9,_0x2d8661[_0x168a('0x4b')]);return _0x48a806['getAgents'](_0x3fe8e9);}})[_0x168a('0x2a')](function(_0x211a09){if(_0x211a09){_0x2208e2=_0x211a09[_0x168a('0x42')];if(!_0x2d8661[_0x168a('0x3b')][_0x168a('0x43')](_0x168a('0x44'))){_0x3fe8e9['limit']=qs['limit'](_0x2d8661[_0x168a('0x3b')][_0x168a('0x24')]);_0x3fe8e9[_0x168a('0x23')]=qs[_0x168a('0x23')](_0x2d8661[_0x168a('0x3b')][_0x168a('0x23')]);}return _0x48a806[_0x168a('0x8f')](_0x3fe8e9);}})[_0x168a('0x2a')](function(_0x2750c7){if(_0x2750c7){return _0x2750c7?{'count':_0x2208e2,'rows':_0x2750c7}:null;}})[_0x168a('0x2a')](respondWithResult(_0x4fff4a,null))[_0x168a('0x52')](handleError(_0x4fff4a,null));}; \ No newline at end of file +var _0xb0cf=['SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','rows','format','%s/%s','SIP','createdAt','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','catch','show','params','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','describe','findOne','UserSmsQueue','hasOwnProperty','pick'];(function(_0x2ec9c0,_0x199458){var _0x367291=function(_0x43cffc){while(--_0x43cffc){_0x2ec9c0['push'](_0x2ec9c0['shift']());}};_0x367291(++_0x199458);}(_0xb0cf,0xc3));var _0xfb0c=function(_0x1e1639,_0x352143){_0x1e1639=_0x1e1639-0x0;var _0x29893c=_0xb0cf[_0x1e1639];return _0x29893c;};'use strict';var emlformat=require(_0xfb0c('0x0'));var rimraf=require(_0xfb0c('0x1'));var zipdir=require(_0xfb0c('0x2'));var jsonpatch=require(_0xfb0c('0x3'));var rp=require(_0xfb0c('0x4'));var moment=require(_0xfb0c('0x5'));var BPromise=require(_0xfb0c('0x6'));var Mustache=require('mustache');var util=require(_0xfb0c('0x7'));var path=require(_0xfb0c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfb0c('0x9'));var fs=require('fs');var fs_extra=require(_0xfb0c('0xa'));var _=require(_0xfb0c('0xb'));var squel=require(_0xfb0c('0xc'));var crypto=require(_0xfb0c('0xd'));var jsforce=require(_0xfb0c('0xe'));var deskjs=require(_0xfb0c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfb0c('0x10'));var Papa=require(_0xfb0c('0x11'));var Redis=require(_0xfb0c('0x12'));var authService=require(_0xfb0c('0x13'));var qs=require(_0xfb0c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb0c('0x15'));var logger=require(_0xfb0c('0x16'))(_0xfb0c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb0c('0x18'))['db'];config[_0xfb0c('0x19')]=_[_0xfb0c('0x1a')](config['redis'],{'host':_0xfb0c('0x1b'),'port':0x18eb});var socket=require(_0xfb0c('0x1c'))(new Redis(config[_0xfb0c('0x19')]));require(_0xfb0c('0x1d'))[_0xfb0c('0x1e')](socket);function respondWithStatusCode(_0x4960f9,_0x2f6a1f){_0x2f6a1f=_0x2f6a1f||0xcc;return function(_0x56acd8){if(_0x56acd8){return _0x4960f9[_0xfb0c('0x1f')](_0x2f6a1f);}return _0x4960f9[_0xfb0c('0x20')](_0x2f6a1f)[_0xfb0c('0x21')]();};}function respondWithResult(_0x3a7032,_0x2b71a6){_0x2b71a6=_0x2b71a6||0xc8;return function(_0x282f4a){if(_0x282f4a){return _0x3a7032[_0xfb0c('0x20')](_0x2b71a6)[_0xfb0c('0x22')](_0x282f4a);}};}function respondWithFilteredResult(_0x1944d2,_0x1d6661){return function(_0x2c85cb){if(_0x2c85cb){var _0x2f9f1d=typeof _0x1d6661[_0xfb0c('0x23')]==='undefined'&&typeof _0x1d6661[_0xfb0c('0x24')]===_0xfb0c('0x25');var _0x59f1b9=_0x2c85cb['count'];var _0x1aa9de=_0x2f9f1d?0x0:_0x1d6661[_0xfb0c('0x23')];var _0x4206ea=_0x2f9f1d?_0x2c85cb[_0xfb0c('0x26')]:_0x1d6661[_0xfb0c('0x23')]+_0x1d6661[_0xfb0c('0x24')];var _0x45baef;if(_0x4206ea>=_0x59f1b9){_0x4206ea=_0x59f1b9;_0x45baef=0xc8;}else{_0x45baef=0xce;}_0x1944d2[_0xfb0c('0x20')](_0x45baef);return _0x1944d2[_0xfb0c('0x27')]('Content-Range',_0x1aa9de+'-'+_0x4206ea+'/'+_0x59f1b9)[_0xfb0c('0x22')](_0x2c85cb);}return null;};}function patchUpdates(_0x29a0ed){return function(_0xcfb8eb){try{jsonpatch['apply'](_0xcfb8eb,_0x29a0ed,!![]);}catch(_0x5b8e76){return BPromise[_0xfb0c('0x28')](_0x5b8e76);}return _0xcfb8eb[_0xfb0c('0x29')]();};}function saveUpdates(_0x153a24,_0x3536ec){return function(_0x387ac6){if(_0x387ac6){return _0x387ac6[_0xfb0c('0x2a')](_0x153a24)[_0xfb0c('0x2b')](function(_0x17ac8f){return _0x17ac8f;});}return null;};}function removeEntity(_0x338b0b,_0x2509ef){return function(_0x2fbc59){if(_0x2fbc59){return _0x2fbc59[_0xfb0c('0x2c')]()[_0xfb0c('0x2b')](function(){var _0x5d9d48=_0x2fbc59[_0xfb0c('0x2d')]({'plain':!![]});var _0x2165d3=_0xfb0c('0x2e');return db[_0xfb0c('0x2f')][_0xfb0c('0x2c')]({'where':{'type':_0x2165d3,'resourceId':_0x5d9d48['id']}})[_0xfb0c('0x2b')](function(){return _0x2fbc59;});})['then'](function(){_0x338b0b[_0xfb0c('0x20')](0xcc)[_0xfb0c('0x21')]();});}};}function handleEntityNotFound(_0x593bb2,_0x233826){return function(_0x3a8db5){if(!_0x3a8db5){_0x593bb2[_0xfb0c('0x1f')](0x194);}return _0x3a8db5;};}function handleError(_0x4fcd8e,_0x479a94){_0x479a94=_0x479a94||0x1f4;return function(_0x443862){logger[_0xfb0c('0x30')](_0x443862[_0xfb0c('0x31')]);if(_0x443862['name']){delete _0x443862['name'];}_0x4fcd8e['status'](_0x479a94)[_0xfb0c('0x32')](_0x443862);};}exports['index']=function(_0x4eb710,_0x12512e){var _0x163f15={},_0xd17ad5={},_0x188eaf={'count':0x0,'rows':[]};var _0x46abcf=_[_0xfb0c('0x33')](db['SmsQueue'][_0xfb0c('0x34')],function(_0x33b8c1){return{'name':_0x33b8c1[_0xfb0c('0x35')],'type':_0x33b8c1[_0xfb0c('0x36')]['key']};});_0xd17ad5[_0xfb0c('0x37')]=_[_0xfb0c('0x33')](_0x46abcf,_0xfb0c('0x38'));_0xd17ad5[_0xfb0c('0x39')]=_[_0xfb0c('0x3a')](_0x4eb710[_0xfb0c('0x39')]);_0xd17ad5['filters']=_[_0xfb0c('0x3b')](_0xd17ad5['model'],_0xd17ad5[_0xfb0c('0x39')]);_0x163f15[_0xfb0c('0x3c')]=_['intersection'](_0xd17ad5[_0xfb0c('0x37')],qs[_0xfb0c('0x3d')](_0x4eb710[_0xfb0c('0x39')][_0xfb0c('0x3d')]));_0x163f15[_0xfb0c('0x3c')]=_0x163f15[_0xfb0c('0x3c')][_0xfb0c('0x3e')]?_0x163f15[_0xfb0c('0x3c')]:_0xd17ad5[_0xfb0c('0x37')];if(!_0x4eb710[_0xfb0c('0x39')]['hasOwnProperty'](_0xfb0c('0x3f'))){_0x163f15[_0xfb0c('0x24')]=qs[_0xfb0c('0x24')](_0x4eb710[_0xfb0c('0x39')]['limit']);_0x163f15['offset']=qs[_0xfb0c('0x23')](_0x4eb710[_0xfb0c('0x39')][_0xfb0c('0x23')]);}_0x163f15[_0xfb0c('0x40')]=qs[_0xfb0c('0x41')](_0x4eb710[_0xfb0c('0x39')][_0xfb0c('0x41')]);_0x163f15[_0xfb0c('0x42')]=qs[_0xfb0c('0x43')](_['pick'](_0x4eb710['query'],_0xd17ad5[_0xfb0c('0x43')]),_0x46abcf);if(_0x4eb710[_0xfb0c('0x39')][_0xfb0c('0x44')]){_0x163f15[_0xfb0c('0x42')]=_[_0xfb0c('0x45')](_0x163f15[_0xfb0c('0x42')],{'$or':_['map'](_0x46abcf,function(_0xf1e133){if(_0xf1e133[_0xfb0c('0x36')]!==_0xfb0c('0x46')){var _0x393160={};_0x393160[_0xf1e133['name']]={'$like':'%'+_0x4eb710['query'][_0xfb0c('0x44')]+'%'};return _0x393160;}})});}_0x163f15=_[_0xfb0c('0x45')]({},_0x163f15,_0x4eb710[_0xfb0c('0x47')]);var _0x5d06ef={'where':_0x163f15[_0xfb0c('0x42')]};return db[_0xfb0c('0x48')][_0xfb0c('0x26')](_0x5d06ef)[_0xfb0c('0x2b')](function(_0x118408){_0x188eaf[_0xfb0c('0x26')]=_0x118408;if(_0x4eb710[_0xfb0c('0x39')][_0xfb0c('0x49')]){_0x163f15[_0xfb0c('0x4a')]=[{'all':!![]}];}return db[_0xfb0c('0x48')]['findAll'](_0x163f15);})['then'](function(_0x2cbfec){_0x188eaf['rows']=_0x2cbfec;return _0x188eaf;})['then'](respondWithFilteredResult(_0x12512e,_0x163f15))[_0xfb0c('0x4b')](handleError(_0x12512e,null));};exports[_0xfb0c('0x4c')]=function(_0x17d8c7,_0x4b4d71){var _0x188b32={'raw':!![],'where':{'id':_0x17d8c7[_0xfb0c('0x4d')]['id']}},_0x49f3b0={};_0x49f3b0['model']=_[_0xfb0c('0x3a')](db[_0xfb0c('0x48')]['rawAttributes']);_0x49f3b0[_0xfb0c('0x39')]=_[_0xfb0c('0x3a')](_0x17d8c7[_0xfb0c('0x39')]);_0x49f3b0[_0xfb0c('0x43')]=_[_0xfb0c('0x3b')](_0x49f3b0['model'],_0x49f3b0['query']);_0x188b32[_0xfb0c('0x3c')]=_[_0xfb0c('0x3b')](_0x49f3b0[_0xfb0c('0x37')],qs[_0xfb0c('0x3d')](_0x17d8c7[_0xfb0c('0x39')][_0xfb0c('0x3d')]));_0x188b32[_0xfb0c('0x3c')]=_0x188b32['attributes'][_0xfb0c('0x3e')]?_0x188b32['attributes']:_0x49f3b0[_0xfb0c('0x37')];if(_0x17d8c7['query'][_0xfb0c('0x49')]){_0x188b32[_0xfb0c('0x4a')]=[{'all':!![]}];}_0x188b32=_['merge']({},_0x188b32,_0x17d8c7[_0xfb0c('0x47')]);return db[_0xfb0c('0x48')][_0xfb0c('0x4e')](_0x188b32)[_0xfb0c('0x2b')](handleEntityNotFound(_0x4b4d71,null))['then'](respondWithResult(_0x4b4d71,null))[_0xfb0c('0x4b')](handleError(_0x4b4d71,null));};exports[_0xfb0c('0x4f')]=function(_0x4b1b2b,_0x1da61f){return db[_0xfb0c('0x48')][_0xfb0c('0x4f')](_0x4b1b2b['body'],{})['then'](function(_0x3369da){var _0x5e5430=_0x4b1b2b[_0xfb0c('0x50')][_0xfb0c('0x2d')]({'plain':!![]});if(!_0x5e5430)throw new Error(_0xfb0c('0x51'));if(_0x5e5430[_0xfb0c('0x52')]===_0xfb0c('0x50')){var _0x385f74=_0x3369da[_0xfb0c('0x2d')]({'plain':!![]});var _0x30bab2=_0xfb0c('0x2e');return db[_0xfb0c('0x53')][_0xfb0c('0x4e')]({'where':{'name':_0x30bab2,'userProfileId':_0x5e5430[_0xfb0c('0x54')]},'raw':!![]})[_0xfb0c('0x2b')](function(_0x13f262){if(_0x13f262&&_0x13f262[_0xfb0c('0x55')]===0x0){return db[_0xfb0c('0x2f')]['create']({'name':_0x385f74['name'],'resourceId':_0x385f74['id'],'type':_0x13f262['name'],'sectionId':_0x13f262['id']},{})['then'](function(){return _0x3369da;});}else{return _0x3369da;}})[_0xfb0c('0x4b')](function(_0x1a1ba9){logger[_0xfb0c('0x30')](_0xfb0c('0x56'),_0x1a1ba9);throw _0x1a1ba9;});}return _0x3369da;})[_0xfb0c('0x2b')](respondWithResult(_0x1da61f,0xc9))[_0xfb0c('0x4b')](handleError(_0x1da61f,null));};exports[_0xfb0c('0x2a')]=function(_0x5bbd58,_0x19a0f7){if(_0x5bbd58[_0xfb0c('0x57')]['id']){delete _0x5bbd58['body']['id'];}return db[_0xfb0c('0x48')][_0xfb0c('0x4e')]({'where':{'id':_0x5bbd58[_0xfb0c('0x4d')]['id']}})[_0xfb0c('0x2b')](handleEntityNotFound(_0x19a0f7,null))[_0xfb0c('0x2b')](saveUpdates(_0x5bbd58[_0xfb0c('0x57')],null))[_0xfb0c('0x2b')](respondWithResult(_0x19a0f7,null))[_0xfb0c('0x4b')](handleError(_0x19a0f7,null));};exports[_0xfb0c('0x2c')]=function(_0x1b48e9,_0x489f6b){return db[_0xfb0c('0x48')][_0xfb0c('0x4e')]({'where':{'id':_0x1b48e9[_0xfb0c('0x4d')]['id']}})[_0xfb0c('0x2b')](handleEntityNotFound(_0x489f6b,null))[_0xfb0c('0x2b')](removeEntity(_0x489f6b,null))[_0xfb0c('0x4b')](handleError(_0x489f6b,null));};exports[_0xfb0c('0x58')]=function(_0x1282c0,_0x544a0b){return db[_0xfb0c('0x48')][_0xfb0c('0x58')]()[_0xfb0c('0x2b')](respondWithResult(_0x544a0b,null))[_0xfb0c('0x4b')](handleError(_0x544a0b,null));};exports['getMembers']=function(_0x5372c6,_0x5283a9,_0x2e041a){var _0x333268={'raw':!![],'where':{}},_0x38c56e={},_0x52166e;return db['SmsQueue'][_0xfb0c('0x59')]({'where':{'id':_0x5372c6[_0xfb0c('0x4d')]['id']}})[_0xfb0c('0x2b')](handleEntityNotFound(_0x5283a9,null))[_0xfb0c('0x2b')](function(_0x430faa){if(_0x430faa){_0x52166e=_0x430faa[_0xfb0c('0x2d')]({'plain':!![]});_0x38c56e[_0xfb0c('0x37')]=_[_0xfb0c('0x3a')](db[_0xfb0c('0x5a')][_0xfb0c('0x34')]);_0x38c56e[_0xfb0c('0x39')]=_[_0xfb0c('0x3a')](_0x5372c6[_0xfb0c('0x39')]);_0x38c56e['filters']=_[_0xfb0c('0x3b')](_0x38c56e[_0xfb0c('0x37')],_0x38c56e[_0xfb0c('0x39')]);_0x333268[_0xfb0c('0x3c')]=_[_0xfb0c('0x3b')](_0x38c56e[_0xfb0c('0x37')],qs[_0xfb0c('0x3d')](_0x5372c6['query']['fields']));_0x333268['attributes']=_0x333268['attributes'][_0xfb0c('0x3e')]?_0x333268['attributes']:_0x38c56e['model'];if(!_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x5b')](_0xfb0c('0x3f'))){_0x333268[_0xfb0c('0x24')]=qs[_0xfb0c('0x24')](_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x24')]);_0x333268[_0xfb0c('0x23')]=qs['offset'](_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x23')]);}_0x333268[_0xfb0c('0x40')]=qs[_0xfb0c('0x41')](_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x41')]);_0x333268[_0xfb0c('0x42')]=qs[_0xfb0c('0x43')](_[_0xfb0c('0x5c')](_0x5372c6['query'],_0x38c56e[_0xfb0c('0x43')]));_0x333268[_0xfb0c('0x42')][_0xfb0c('0x5d')]=_0x430faa['id'];if(_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x44')]){_0x333268[_0xfb0c('0x42')]=_[_0xfb0c('0x45')](_0x333268[_0xfb0c('0x42')],{'$or':_[_0xfb0c('0x33')](_0x333268['attributes'],function(_0x5a857a){var _0x2ed064={};_0x2ed064[_0x5a857a]={'$like':'%'+_0x5372c6[_0xfb0c('0x39')][_0xfb0c('0x44')]+'%'};return _0x2ed064;})});}_0x333268=_[_0xfb0c('0x45')]({},_0x333268,_0x5372c6[_0xfb0c('0x47')]);return db['UserSmsQueue'][_0xfb0c('0x5e')](_0x333268);}})[_0xfb0c('0x2b')](function(_0x168f69){if(_0x168f69){return db[_0xfb0c('0x5f')][_0xfb0c('0x60')]({'where':{'id':_[_0xfb0c('0x33')](_0x168f69,_0xfb0c('0x61')),'role':_0xfb0c('0x62')},'attributes':['id',_0xfb0c('0x38'),_0xfb0c('0x63'),'updatedAt','createdAt']});}})[_0xfb0c('0x2b')](function(_0x2a5498){if(_0x2a5498){return{'count':_0x2a5498['count'],'rows':_['map'](_0x2a5498[_0xfb0c('0x64')],function(_0x5b3ad8){return{'membername':_0x5b3ad8[_0xfb0c('0x38')],'UserId':_0x5b3ad8['id'],'queue_name':_0x52166e[_0xfb0c('0x38')],'SmsQueueId':_0x52166e['id'],'interface':util[_0xfb0c('0x65')](_0xfb0c('0x66'),_0xfb0c('0x67'),_0x5b3ad8[_0xfb0c('0x38')]),'penalty':0x0,'paused':_0x5b3ad8['smsPause'],'createdAt':_0x5b3ad8[_0xfb0c('0x68')],'updatedAt':_0x5b3ad8[_0xfb0c('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfb0c('0x2b')](respondWithFilteredResult(_0x5283a9,_0x333268))[_0xfb0c('0x4b')](handleError(_0x5283a9,null));};exports['getTeams']=function(_0x895350,_0x10e50d,_0x3c7670){var _0x1c48df={};var _0x1334d2={};var _0x4a4d1c;var _0x1a13ee;return db['SmsQueue']['findOne']({'where':{'id':_0x895350[_0xfb0c('0x4d')]['id']}})[_0xfb0c('0x2b')](handleEntityNotFound(_0x10e50d,null))[_0xfb0c('0x2b')](function(_0x21bfd0){if(_0x21bfd0){_0x4a4d1c=_0x21bfd0;_0x1334d2['model']=_[_0xfb0c('0x3a')](db['Team'][_0xfb0c('0x34')]);_0x1334d2[_0xfb0c('0x39')]=_[_0xfb0c('0x3a')](_0x895350[_0xfb0c('0x39')]);_0x1334d2[_0xfb0c('0x43')]=_[_0xfb0c('0x3b')](_0x1334d2[_0xfb0c('0x37')],_0x1334d2['query']);_0x1c48df['attributes']=_[_0xfb0c('0x3b')](_0x1334d2[_0xfb0c('0x37')],qs[_0xfb0c('0x3d')](_0x895350[_0xfb0c('0x39')][_0xfb0c('0x3d')]));_0x1c48df[_0xfb0c('0x3c')]=_0x1c48df[_0xfb0c('0x3c')]['length']?_0x1c48df['attributes']:_0x1334d2[_0xfb0c('0x37')];_0x1c48df['order']=qs[_0xfb0c('0x41')](_0x895350[_0xfb0c('0x39')][_0xfb0c('0x41')]);_0x1c48df[_0xfb0c('0x42')]=qs['filters'](_[_0xfb0c('0x5c')](_0x895350[_0xfb0c('0x39')],_0x1334d2[_0xfb0c('0x43')]));if(_0x895350[_0xfb0c('0x39')]['filter']){_0x1c48df['where']=_[_0xfb0c('0x45')](_0x1c48df[_0xfb0c('0x42')],{'$or':_[_0xfb0c('0x33')](_0x1c48df[_0xfb0c('0x3c')],function(_0x3ffd25){var _0x101650={};_0x101650[_0x3ffd25]={'$like':'%'+_0x895350['query'][_0xfb0c('0x44')]+'%'};return _0x101650;})});}_0x1c48df=_['merge']({},_0x1c48df,_0x895350['options']);return _0x4a4d1c[_0xfb0c('0x6a')](_0x1c48df);}})['then'](function(_0x32d1b3){if(_0x32d1b3){_0x1a13ee=_0x32d1b3['length'];if(!_0x895350[_0xfb0c('0x39')][_0xfb0c('0x5b')]('nolimit')){_0x1c48df['limit']=qs['limit'](_0x895350[_0xfb0c('0x39')][_0xfb0c('0x24')]);_0x1c48df[_0xfb0c('0x23')]=qs[_0xfb0c('0x23')](_0x895350[_0xfb0c('0x39')][_0xfb0c('0x23')]);}return _0x4a4d1c[_0xfb0c('0x6a')](_0x1c48df);}})[_0xfb0c('0x2b')](function(_0x3ace63){if(_0x3ace63){return _0x3ace63?{'count':_0x1a13ee,'rows':_0x3ace63}:null;}})[_0xfb0c('0x2b')](respondWithResult(_0x10e50d,null))['catch'](handleError(_0x10e50d,null));};exports['addTeams']=function(_0x6e92e0,_0x33f213,_0x36a985){var _0x1edf31=_0x6e92e0[_0xfb0c('0x57')][_0xfb0c('0x6b')];return db[_0xfb0c('0x6c')]['findAll']({'where':{'id':_0x1edf31},'attributes':['id'],'include':[{'model':db[_0xfb0c('0x5f')],'as':_0xfb0c('0x6d'),'attributes':['id',_0xfb0c('0x38'),_0xfb0c('0x6e'),_0xfb0c('0x6f'),_0xfb0c('0x70')],'raw':!![]}]})[_0xfb0c('0x2b')](function(_0x1a360a){if(_0x1a360a){var _0x3ac58a=_[_0xfb0c('0x71')](_0x1a360a,function(_0x35eec2){var _0x3d8205=_0x35eec2[_0xfb0c('0x2d')]({'plain':!![]});return _0x3d8205[_0xfb0c('0x6d')];});return db[_0xfb0c('0x48')]['find']({'where':{'id':_0x6e92e0['params']['id']}})[_0xfb0c('0x2b')](function(_0x350698){return db[_0xfb0c('0x72')][_0xfb0c('0x73')](function(_0x5eb49b){return _0x350698[_0xfb0c('0x74')](_0x1edf31,{'transaction':_0x5eb49b})['then'](function(){return BPromise['each'](_0x3ac58a,function(_0x2d7e93){return db[_0xfb0c('0x5a')][_0xfb0c('0x75')]({'where':{'UserId':_0x2d7e93['id'],'SmsQueueId':_0x6e92e0[_0xfb0c('0x4d')]['id']},'transaction':_0x5eb49b});});})['then'](function(){_0x3ac58a[_0xfb0c('0x76')](function(_0x386f3a){socket[_0xfb0c('0x77')](_0xfb0c('0x78'),{'UserId':_0x386f3a['id'],'SmsQueueId':_0x350698['id']});});});});});}})[_0xfb0c('0x2b')](respondWithStatusCode(_0x33f213,null))[_0xfb0c('0x4b')](handleError(_0x33f213,null));};exports[_0xfb0c('0x79')]=function(_0x424782,_0x291e50,_0x238ecb){return db[_0xfb0c('0x6c')][_0xfb0c('0x5e')]({'where':{'id':_0x424782[_0xfb0c('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfb0c('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfb0c('0x2b')](handleEntityNotFound(_0x291e50,null))[_0xfb0c('0x2b')](function(_0x82ddaf){var _0x357864=_[_0xfb0c('0x33')](_0x82ddaf,'id');var _0x53e4b4=[];var _0x5cc906=[];var _0x39ca70=squel[_0xfb0c('0x7a')]();_0x39ca70[_0xfb0c('0x7b')]('tq.TeamId')[_0xfb0c('0x7c')]('team_has_sms_queues','tq')['join'](_0xfb0c('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfb0c('0x42')](_0xfb0c('0x7e'),_0x424782[_0xfb0c('0x4d')]['id']);for(var _0x386571=0x0;_0x386571<_0x82ddaf[_0xfb0c('0x3e')];_0x386571+=0x1){let _0x22a1f0=_0x82ddaf[_0x386571];for(var _0x4fcf1f=0x0;_0x4fcf1f<_0x22a1f0['Agents']['length'];_0x4fcf1f+=0x1){let _0x3d80c9=_0x22a1f0[_0xfb0c('0x6d')][_0x4fcf1f];var _0x5b12c5=_0x39ca70[_0xfb0c('0x7f')]();_0x5b12c5[_0xfb0c('0x42')](_0xfb0c('0x80'),_0x3d80c9['id']);_0x5cc906[_0xfb0c('0x81')](db[_0xfb0c('0x72')][_0xfb0c('0x39')](_0x5b12c5[_0xfb0c('0x82')](),{'type':db[_0xfb0c('0x72')]['QueryTypes'][_0xfb0c('0x83')]})[_0xfb0c('0x2b')](function(_0x4bd623){if(_0x4bd623[_0xfb0c('0x3e')]===0x1){return _0x3d80c9['id'];}else{var _0x58760a=_[_0xfb0c('0x84')](_[_0xfb0c('0x33')](_0x4bd623,_0xfb0c('0x85')),function(_0x45d929){return _[_0xfb0c('0x86')](_0x357864,_0x45d929);});if(_0x58760a){return _0x3d80c9['id'];}}}));}}return BPromise[_0xfb0c('0x87')](_0x5cc906)['then'](function(_0x1f8a9a){_0x53e4b4=_(_0x53e4b4)[_0xfb0c('0x88')](_0x1f8a9a)[_0xfb0c('0x89')]()[_0xfb0c('0x8a')]();return db[_0xfb0c('0x48')]['find']({'where':{'id':_0x424782['params']['id']}})['then'](function(_0x1026d1){return db[_0xfb0c('0x72')][_0xfb0c('0x73')](function(_0x2b026a){return _0x1026d1['removeTeams'](_0x424782[_0xfb0c('0x39')][_0xfb0c('0x6b')],{'transaction':_0x2b026a})[_0xfb0c('0x2b')](function(){if(!_['isEmpty'](_0x53e4b4)){return _0x1026d1[_0xfb0c('0x8b')](_0x53e4b4,{'transaction':_0x2b026a});}})[_0xfb0c('0x2b')](function(){_0x53e4b4[_0xfb0c('0x76')](function(_0x32e71b){socket['emit']('userSmsQueue:remove',{'UserId':_0x32e71b,'SmsQueueId':_0x1026d1['id']});});});});});});})[_0xfb0c('0x2b')](respondWithStatusCode(_0x291e50,null))['catch'](handleError(_0x291e50,null));};exports[_0xfb0c('0x8c')]=function(_0x240d1f,_0x2050ba,_0xaac458){return db[_0xfb0c('0x48')]['find']({'where':{'id':_0x240d1f[_0xfb0c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2050ba,null))[_0xfb0c('0x2b')](function(_0x14efd7){if(_0x14efd7){return _0x14efd7['addAgents'](_0x240d1f[_0xfb0c('0x57')][_0xfb0c('0x6b')],_[_0xfb0c('0x8d')](_0x240d1f[_0xfb0c('0x57')],[_0xfb0c('0x6b'),'id'])||{})['spread'](function(_0x3d3d87){for(var _0x3d257a=0x0;_0x3d257a<_0x240d1f[_0xfb0c('0x57')][_0xfb0c('0x6b')][_0xfb0c('0x3e')];_0x3d257a+=0x1){socket[_0xfb0c('0x77')](_0xfb0c('0x78'),{'UserId':Number(_0x240d1f[_0xfb0c('0x57')][_0xfb0c('0x6b')][_0x3d257a]),'SmsQueueId':Number(_0x240d1f[_0xfb0c('0x4d')]['id'])});}return _0x3d3d87;});}})[_0xfb0c('0x2b')](respondWithResult(_0x2050ba,null))[_0xfb0c('0x4b')](handleError(_0x2050ba,null));};exports[_0xfb0c('0x8b')]=function(_0xa2b3fa,_0x412a2d,_0x1f1708){return db[_0xfb0c('0x48')][_0xfb0c('0x4e')]({'where':{'id':_0xa2b3fa['params']['id']}})['then'](handleEntityNotFound(_0x412a2d,null))[_0xfb0c('0x2b')](function(_0x2a77e6){if(_0x2a77e6){return _0x2a77e6[_0xfb0c('0x8b')](_0xa2b3fa[_0xfb0c('0x39')][_0xfb0c('0x6b')])[_0xfb0c('0x2b')](function(){if(_['isArray'](_0xa2b3fa[_0xfb0c('0x39')][_0xfb0c('0x6b')])){for(var _0x4e5771=0x0;_0x4e5771<_0xa2b3fa[_0xfb0c('0x39')][_0xfb0c('0x6b')][_0xfb0c('0x3e')];_0x4e5771+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0xa2b3fa[_0xfb0c('0x39')]['ids'][_0x4e5771]),'SmsQueueId':Number(_0xa2b3fa['params']['id'])});}}else{socket[_0xfb0c('0x77')](_0xfb0c('0x8e'),{'UserId':Number(_0xa2b3fa['query'][_0xfb0c('0x6b')]),'SmsQueueId':Number(_0xa2b3fa['params']['id'])});}});}})[_0xfb0c('0x2b')](respondWithStatusCode(_0x412a2d,null))[_0xfb0c('0x4b')](handleError(_0x412a2d,null));};exports['getAgents']=function(_0xf14604,_0x47e483,_0x1f76d2){var _0x1457bd={};var _0x582cab={};var _0xab1c7c;var _0x26de64;return db[_0xfb0c('0x48')][_0xfb0c('0x59')]({'where':{'id':_0xf14604[_0xfb0c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x47e483,null))['then'](function(_0x184e30){if(_0x184e30){_0xab1c7c=_0x184e30;_0x582cab[_0xfb0c('0x37')]=_['keys'](db[_0xfb0c('0x5f')][_0xfb0c('0x34')]);_0x582cab['query']=_[_0xfb0c('0x3a')](_0xf14604[_0xfb0c('0x39')]);_0x582cab[_0xfb0c('0x43')]=_[_0xfb0c('0x3b')](_0x582cab['model'],_0x582cab['query']);_0x1457bd[_0xfb0c('0x3c')]=_[_0xfb0c('0x3b')](_0x582cab[_0xfb0c('0x37')],qs[_0xfb0c('0x3d')](_0xf14604['query'][_0xfb0c('0x3d')]));_0x1457bd[_0xfb0c('0x3c')]=_0x1457bd[_0xfb0c('0x3c')]['length']?_0x1457bd['attributes']:_0x582cab[_0xfb0c('0x37')];_0x1457bd[_0xfb0c('0x40')]=qs['sort'](_0xf14604[_0xfb0c('0x39')][_0xfb0c('0x41')]);_0x1457bd[_0xfb0c('0x42')]=qs['filters'](_[_0xfb0c('0x5c')](_0xf14604['query'],_0x582cab[_0xfb0c('0x43')]));if(_0xf14604[_0xfb0c('0x39')][_0xfb0c('0x44')]){_0x1457bd[_0xfb0c('0x42')]=_[_0xfb0c('0x45')](_0x1457bd[_0xfb0c('0x42')],{'$or':_[_0xfb0c('0x33')](_0x1457bd['attributes'],function(_0x2f822a){var _0x57a676={};_0x57a676[_0x2f822a]={'$like':'%'+_0xf14604[_0xfb0c('0x39')][_0xfb0c('0x44')]+'%'};return _0x57a676;})});}_0x1457bd=_[_0xfb0c('0x45')]({},_0x1457bd,_0xf14604[_0xfb0c('0x47')]);return _0xab1c7c[_0xfb0c('0x8f')](_0x1457bd);}})[_0xfb0c('0x2b')](function(_0x1f7112){if(_0x1f7112){_0x26de64=_0x1f7112[_0xfb0c('0x3e')];if(!_0xf14604[_0xfb0c('0x39')]['hasOwnProperty']('nolimit')){_0x1457bd[_0xfb0c('0x24')]=qs[_0xfb0c('0x24')](_0xf14604[_0xfb0c('0x39')][_0xfb0c('0x24')]);_0x1457bd[_0xfb0c('0x23')]=qs[_0xfb0c('0x23')](_0xf14604[_0xfb0c('0x39')][_0xfb0c('0x23')]);}return _0xab1c7c['getAgents'](_0x1457bd);}})[_0xfb0c('0x2b')](function(_0x201477){if(_0x201477){return _0x201477?{'count':_0x26de64,'rows':_0x201477}:null;}})['then'](respondWithResult(_0x47e483,null))[_0xfb0c('0x4b')](handleError(_0x47e483,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ddb5bed..f48e13b 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 _0x8c4b=['remove','emit','exports','events','save'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0x8c4b,0x1a2));var _0xb8c4=function(_0x289c1e,_0x1b3421){_0x289c1e=_0x289c1e-0x0;var _0x58555c=_0x8c4b[_0x289c1e];return _0x58555c;};'use strict';var EventEmitter=require(_0xb8c4('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8c4('0x1'),'afterUpdate':'update','afterDestroy':_0xb8c4('0x2')};function emitEvent(_0xccc8a8){return function(_0x33aeec,_0x5453b0,_0x4310f5){SmsQueueEvents[_0xb8c4('0x3')](_0xccc8a8+':'+_0x33aeec['id'],_0x33aeec);SmsQueueEvents[_0xb8c4('0x3')](_0xccc8a8,_0x33aeec);_0x4310f5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xb8c4('0x4')]=SmsQueueEvents; \ No newline at end of file +var _0x399e=['update','remove','emit','hook','exports','events'];(function(_0x53284b,_0x11028b){var _0x39dc7d=function(_0x2d117b){while(--_0x2d117b){_0x53284b['push'](_0x53284b['shift']());}};_0x39dc7d(++_0x11028b);}(_0x399e,0xcb));var _0xe399=function(_0x5e6fca,_0x540568){_0x5e6fca=_0x5e6fca-0x0;var _0x505941=_0x399e[_0x5e6fca];return _0x505941;};'use strict';var EventEmitter=require(_0xe399('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe399('0x1'),'afterDestroy':_0xe399('0x2')};function emitEvent(_0x4f3083){return function(_0x5abe1b,_0x2c6c84,_0x279108){SmsQueueEvents[_0xe399('0x3')](_0x4f3083+':'+_0x5abe1b['id'],_0x5abe1b);SmsQueueEvents[_0xe399('0x3')](_0x4f3083,_0x5abe1b);_0x279108(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xe399('0x4')](e,emitEvent(event));}}module[_0xe399('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b463256..4ec22cf 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 _0x9190=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9190,0x185));var _0x0919=function(_0x4e311a,_0x472e6b){_0x4e311a=_0x4e311a-0x0;var _0x119e3c=_0x9190[_0x4e311a];return _0x119e3c;};'use strict';var _=require('lodash');var util=require(_0x0919('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0919('0x1'));var BPromise=require(_0x0919('0x2'));var rp=require(_0x0919('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0919('0x4'));var config=require(_0x0919('0x5'));var attributes=require(_0x0919('0x6'));module['exports']=function(_0x2b9a7e,_0x576ebe){return _0x2b9a7e[_0x0919('0x7')](_0x0919('0x8'),attributes,{'tableName':_0x0919('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc182=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xc4d1c6,_0x4b6ee9){var _0xfd4b3b=function(_0x111b7a){while(--_0x111b7a){_0xc4d1c6['push'](_0xc4d1c6['shift']());}};_0xfd4b3b(++_0x4b6ee9);}(_0xc182,0x181));var _0x2c18=function(_0x18632c,_0x4fcc66){_0x18632c=_0x18632c-0x0;var _0xc8be97=_0xc182[_0x18632c];return _0xc8be97;};'use strict';var _=require(_0x2c18('0x0'));var util=require(_0x2c18('0x1'));var logger=require('../../config/logger')(_0x2c18('0x2'));var moment=require(_0x2c18('0x3'));var BPromise=require(_0x2c18('0x4'));var rp=require(_0x2c18('0x5'));var fs=require('fs');var path=require(_0x2c18('0x6'));var rimraf=require(_0x2c18('0x7'));var config=require(_0x2c18('0x8'));var attributes=require(_0x2c18('0x9'));module[_0x2c18('0xa')]=function(_0x4d2053,_0x18616b){return _0x4d2053[_0x2c18('0xb')](_0x2c18('0xc'),attributes,{'tableName':_0x2c18('0xd'),'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 d0ef226..e549fbb 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 _0x79a7=['map','model','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include'];(function(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0x79a7,0x133));var _0x779a=function(_0x1df3e7,_0x229184){_0x1df3e7=_0x1df3e7-0x0;var _0x1f2d59=_0x79a7[_0x1df3e7];return _0x1f2d59;};'use strict';var _=require(_0x779a('0x0'));var util=require(_0x779a('0x1'));var moment=require(_0x779a('0x2'));var BPromise=require('bluebird');var rs=require(_0x779a('0x3'));var fs=require('fs');var Redis=require(_0x779a('0x4'));var db=require(_0x779a('0x5'))['db'];var utils=require(_0x779a('0x6'));var logger=require('../../config/logger')(_0x779a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x779a('0x8')][_0x779a('0x9')]({'port':0x232a});config['redis']=_[_0x779a('0xa')](config['redis'],{'host':_0x779a('0xb'),'port':0x18eb});var socket=require(_0x779a('0xc'))(new Redis(config[_0x779a('0xd')]));require(_0x779a('0xe'))[_0x779a('0xf')](socket);function respondWithRpcPromise(_0x4628db,_0x340f90,_0x26a036){return new BPromise(function(_0x370b09,_0x4ebbe2){return client['request'](_0x4628db,_0x26a036)[_0x779a('0x10')](function(_0x43790e){logger['info'](_0x779a('0x11'),_0x340f90,_0x779a('0x12'));logger[_0x779a('0x13')](_0x779a('0x14'),_0x340f90,_0x779a('0x12'),JSON[_0x779a('0x15')](_0x43790e));if(_0x43790e[_0x779a('0x16')]){if(_0x43790e['error'][_0x779a('0x17')]===0x1f4){logger[_0x779a('0x16')]('SmsQueue,\x20%s,\x20%s',_0x340f90,_0x43790e[_0x779a('0x16')]['message']);return _0x4ebbe2(_0x43790e['error']['message']);}logger[_0x779a('0x16')](_0x779a('0x11'),_0x340f90,_0x43790e['error'][_0x779a('0x18')]);return _0x370b09(_0x43790e['error'][_0x779a('0x18')]);}else{logger[_0x779a('0x19')](_0x779a('0x11'),_0x340f90,_0x779a('0x12'));_0x370b09(_0x43790e['result'][_0x779a('0x18')]);}})[_0x779a('0x1a')](function(_0x3d3447){logger[_0x779a('0x16')](_0x779a('0x11'),_0x340f90,_0x3d3447);_0x4ebbe2(_0x3d3447);});});}exports[_0x779a('0x1b')]=function(_0x58df9a){var _0x35fb09=this;return new Promise(function(_0x146397,_0x4676c3){return db[_0x779a('0x1c')][_0x779a('0x1d')]({'raw':_0x58df9a[_0x779a('0x1e')]?_0x58df9a[_0x779a('0x1e')][_0x779a('0x1f')]===undefined?!![]:![]:!![],'where':_0x58df9a[_0x779a('0x1e')]?_0x58df9a[_0x779a('0x1e')][_0x779a('0x20')]||null:null,'attributes':_0x58df9a[_0x779a('0x1e')]?_0x58df9a[_0x779a('0x1e')][_0x779a('0x21')]||null:null,'limit':_0x58df9a[_0x779a('0x1e')]?_0x58df9a[_0x779a('0x1e')]['limit']||null:null,'include':_0x58df9a[_0x779a('0x1e')]?_0x58df9a[_0x779a('0x1e')][_0x779a('0x22')]?_[_0x779a('0x23')](_0x58df9a[_0x779a('0x1e')][_0x779a('0x22')],function(_0x318d1c){return{'model':db[_0x318d1c[_0x779a('0x24')]],'as':_0x318d1c['as'],'attributes':_0x318d1c[_0x779a('0x21')],'include':_0x318d1c['include']?_[_0x779a('0x23')](_0x318d1c[_0x779a('0x22')],function(_0x514f45){return{'model':db[_0x514f45['model']],'as':_0x514f45['as'],'attributes':_0x514f45[_0x779a('0x21')],'include':_0x514f45[_0x779a('0x22')]?_[_0x779a('0x23')](_0x514f45['include'],function(_0x138e32){return{'model':db[_0x138e32[_0x779a('0x24')]],'as':_0x138e32['as'],'attributes':_0x138e32[_0x779a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x237009){logger[_0x779a('0x19')](_0x779a('0x1b'),_0x58df9a);logger[_0x779a('0x13')](_0x779a('0x1b'),_0x58df9a,JSON[_0x779a('0x15')](_0x237009));_0x146397(_0x237009);})['catch'](function(_0x519e11){logger[_0x779a('0x16')](_0x779a('0x1b'),_0x519e11[_0x779a('0x18')],_0x58df9a);_0x4676c3(_0x35fb09[_0x779a('0x16')](0x1f4,_0x519e11[_0x779a('0x18')]));});});};exports[_0x779a('0x25')]=function(_0x522070){var _0x3ad3d6=this;return new Promise(function(_0xd3498d,_0x1ca2f1){return db['SmsQueue']['find']({'raw':_0x522070[_0x779a('0x1e')]?_0x522070[_0x779a('0x1e')][_0x779a('0x1f')]===undefined?!![]:![]:!![],'where':_0x522070[_0x779a('0x1e')]?_0x522070['options'][_0x779a('0x20')]||null:null,'attributes':_0x522070[_0x779a('0x1e')]?_0x522070[_0x779a('0x1e')][_0x779a('0x21')]||null:null,'include':_0x522070[_0x779a('0x1e')]?_0x522070[_0x779a('0x1e')][_0x779a('0x22')]?_[_0x779a('0x23')](_0x522070[_0x779a('0x1e')]['include'],function(_0x2ed7a6){return{'model':db[_0x2ed7a6['model']],'as':_0x2ed7a6['as'],'attributes':_0x2ed7a6[_0x779a('0x21')],'include':_0x2ed7a6[_0x779a('0x22')]?_[_0x779a('0x23')](_0x2ed7a6[_0x779a('0x22')],function(_0x13af68){return{'model':db[_0x13af68[_0x779a('0x24')]],'as':_0x13af68['as'],'attributes':_0x13af68['attributes'],'include':_0x13af68[_0x779a('0x22')]?_[_0x779a('0x23')](_0x13af68[_0x779a('0x22')],function(_0x19711b){return{'model':db[_0x19711b[_0x779a('0x24')]],'as':_0x19711b['as'],'attributes':_0x19711b[_0x779a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x779a('0x10')](function(_0x32fc33){logger[_0x779a('0x19')](_0x779a('0x25'),_0x522070);logger['debug']('ShowSmsQueue',_0x522070,JSON[_0x779a('0x15')](_0x32fc33));_0xd3498d(_0x32fc33);})[_0x779a('0x1a')](function(_0x168f91){logger[_0x779a('0x16')](_0x779a('0x25'),_0x168f91['message'],_0x522070);_0x1ca2f1(_0x3ad3d6[_0x779a('0x16')](0x1f4,_0x168f91['message']));});});}; \ No newline at end of file +var _0x72e1=['raw','where','limit','include','map','model','attributes','ShowSmsQueue','find','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x3856f4,_0x450645){var _0x447b24=function(_0x8d788c){while(--_0x8d788c){_0x3856f4['push'](_0x3856f4['shift']());}};_0x447b24(++_0x450645);}(_0x72e1,0x122));var _0x172e=function(_0x2882ab,_0x42ec28){_0x2882ab=_0x2882ab-0x0;var _0x11b5c3=_0x72e1[_0x2882ab];return _0x11b5c3;};'use strict';var _=require(_0x172e('0x0'));var util=require(_0x172e('0x1'));var moment=require(_0x172e('0x2'));var BPromise=require(_0x172e('0x3'));var rs=require(_0x172e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x172e('0x5'));var logger=require(_0x172e('0x6'))(_0x172e('0x7'));var config=require(_0x172e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x172e('0x9')]=_[_0x172e('0xa')](config[_0x172e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x172e('0xb'))(new Redis(config['redis']));require(_0x172e('0xc'))[_0x172e('0xd')](socket);function respondWithRpcPromise(_0x182140,_0x418e68,_0xe57f73){return new BPromise(function(_0xc556c7,_0x362384){return client[_0x172e('0xe')](_0x182140,_0xe57f73)[_0x172e('0xf')](function(_0x3dc0d6){logger[_0x172e('0x10')](_0x172e('0x11'),_0x418e68,_0x172e('0x12'));logger['debug'](_0x172e('0x13'),_0x418e68,_0x172e('0x12'),JSON[_0x172e('0x14')](_0x3dc0d6));if(_0x3dc0d6[_0x172e('0x15')]){if(_0x3dc0d6[_0x172e('0x15')][_0x172e('0x16')]===0x1f4){logger[_0x172e('0x15')]('SmsQueue,\x20%s,\x20%s',_0x418e68,_0x3dc0d6[_0x172e('0x15')][_0x172e('0x17')]);return _0x362384(_0x3dc0d6['error'][_0x172e('0x17')]);}logger[_0x172e('0x15')](_0x172e('0x11'),_0x418e68,_0x3dc0d6[_0x172e('0x15')][_0x172e('0x17')]);return _0xc556c7(_0x3dc0d6[_0x172e('0x15')][_0x172e('0x17')]);}else{logger[_0x172e('0x10')](_0x172e('0x11'),_0x418e68,_0x172e('0x12'));_0xc556c7(_0x3dc0d6[_0x172e('0x18')][_0x172e('0x17')]);}})[_0x172e('0x19')](function(_0x447aeb){logger[_0x172e('0x15')](_0x172e('0x11'),_0x418e68,_0x447aeb);_0x362384(_0x447aeb);});});}exports[_0x172e('0x1a')]=function(_0x536772){var _0x56306e=this;return new Promise(function(_0x13a633,_0x44e849){return db[_0x172e('0x1b')][_0x172e('0x1c')]({'raw':_0x536772[_0x172e('0x1d')]?_0x536772[_0x172e('0x1d')][_0x172e('0x1e')]===undefined?!![]:![]:!![],'where':_0x536772[_0x172e('0x1d')]?_0x536772[_0x172e('0x1d')][_0x172e('0x1f')]||null:null,'attributes':_0x536772[_0x172e('0x1d')]?_0x536772[_0x172e('0x1d')]['attributes']||null:null,'limit':_0x536772[_0x172e('0x1d')]?_0x536772['options'][_0x172e('0x20')]||null:null,'include':_0x536772[_0x172e('0x1d')]?_0x536772[_0x172e('0x1d')][_0x172e('0x21')]?_[_0x172e('0x22')](_0x536772['options'][_0x172e('0x21')],function(_0x45b5f5){return{'model':db[_0x45b5f5[_0x172e('0x23')]],'as':_0x45b5f5['as'],'attributes':_0x45b5f5['attributes'],'include':_0x45b5f5[_0x172e('0x21')]?_[_0x172e('0x22')](_0x45b5f5[_0x172e('0x21')],function(_0x5825e8){return{'model':db[_0x5825e8[_0x172e('0x23')]],'as':_0x5825e8['as'],'attributes':_0x5825e8[_0x172e('0x24')],'include':_0x5825e8[_0x172e('0x21')]?_[_0x172e('0x22')](_0x5825e8[_0x172e('0x21')],function(_0x1f81dc){return{'model':db[_0x1f81dc[_0x172e('0x23')]],'as':_0x1f81dc['as'],'attributes':_0x1f81dc[_0x172e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x172e('0xf')](function(_0x1f64a7){logger[_0x172e('0x10')](_0x172e('0x1a'),_0x536772);logger['debug'](_0x172e('0x1a'),_0x536772,JSON[_0x172e('0x14')](_0x1f64a7));_0x13a633(_0x1f64a7);})[_0x172e('0x19')](function(_0x86a3d5){logger['error'](_0x172e('0x1a'),_0x86a3d5[_0x172e('0x17')],_0x536772);_0x44e849(_0x56306e[_0x172e('0x15')](0x1f4,_0x86a3d5[_0x172e('0x17')]));});});};exports[_0x172e('0x25')]=function(_0x47d8d2){var _0x556a00=this;return new Promise(function(_0x726bca,_0x3b57c){return db[_0x172e('0x1b')][_0x172e('0x26')]({'raw':_0x47d8d2[_0x172e('0x1d')]?_0x47d8d2['options'][_0x172e('0x1e')]===undefined?!![]:![]:!![],'where':_0x47d8d2[_0x172e('0x1d')]?_0x47d8d2['options']['where']||null:null,'attributes':_0x47d8d2['options']?_0x47d8d2[_0x172e('0x1d')]['attributes']||null:null,'include':_0x47d8d2['options']?_0x47d8d2[_0x172e('0x1d')][_0x172e('0x21')]?_['map'](_0x47d8d2[_0x172e('0x1d')][_0x172e('0x21')],function(_0x1b7245){return{'model':db[_0x1b7245[_0x172e('0x23')]],'as':_0x1b7245['as'],'attributes':_0x1b7245[_0x172e('0x24')],'include':_0x1b7245[_0x172e('0x21')]?_['map'](_0x1b7245[_0x172e('0x21')],function(_0x5a7ddc){return{'model':db[_0x5a7ddc['model']],'as':_0x5a7ddc['as'],'attributes':_0x5a7ddc[_0x172e('0x24')],'include':_0x5a7ddc[_0x172e('0x21')]?_['map'](_0x5a7ddc[_0x172e('0x21')],function(_0x4b3de3){return{'model':db[_0x4b3de3['model']],'as':_0x4b3de3['as'],'attributes':_0x4b3de3[_0x172e('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18d5fb){logger['info'](_0x172e('0x25'),_0x47d8d2);logger[_0x172e('0x27')]('ShowSmsQueue',_0x47d8d2,JSON[_0x172e('0x14')](_0x18d5fb));_0x726bca(_0x18d5fb);})[_0x172e('0x19')](function(_0x55157c){logger[_0x172e('0x15')]('ShowSmsQueue',_0x55157c['message'],_0x47d8d2);_0x3b57c(_0x556a00[_0x172e('0x15')](0x1f4,_0x55157c[_0x172e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fd89ae0..0a953d3 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 _0x8d04=['update','emit','register','length','save','remove'];(function(_0x451952,_0x55aa94){var _0x14e7fa=function(_0x4af599){while(--_0x4af599){_0x451952['push'](_0x451952['shift']());}};_0x14e7fa(++_0x55aa94);}(_0x8d04,0x15a));var _0x48d0=function(_0x4feea8,_0x58fbec){_0x4feea8=_0x4feea8-0x0;var _0x85300a=_0x8d04[_0x4feea8];return _0x85300a;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x48d0('0x0'),_0x48d0('0x1'),_0x48d0('0x2')];function createListener(_0x2e4e2f,_0x35ac7b){return function(_0x2b4520){_0x35ac7b[_0x48d0('0x3')](_0x2e4e2f,_0x2b4520);};}function removeListener(_0x5b43c2,_0x56ca16){return function(){SmsQueueEvents['removeListener'](_0x5b43c2,_0x56ca16);};}exports[_0x48d0('0x4')]=function(_0x504bf0){for(var _0x376d48=0x0,_0x4a1ffe=events[_0x48d0('0x5')];_0x376d48<_0x4a1ffe;_0x376d48++){var _0x2dc384=events[_0x376d48];var _0x5774d2=createListener('smsQueue:'+_0x2dc384,_0x504bf0);SmsQueueEvents['on'](_0x2dc384,_0x5774d2);}}; \ No newline at end of file +var _0x98fc=['save','remove','emit','removeListener','length','smsQueue:'];(function(_0x39580c,_0x22425c){var _0x1a4cd8=function(_0x42ee09){while(--_0x42ee09){_0x39580c['push'](_0x39580c['shift']());}};_0x1a4cd8(++_0x22425c);}(_0x98fc,0x66));var _0xc98f=function(_0x1f6e71,_0x19360b){_0x1f6e71=_0x1f6e71-0x0;var _0x2271aa=_0x98fc[_0x1f6e71];return _0x2271aa;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xc98f('0x0'),_0xc98f('0x1'),'update'];function createListener(_0x411e8e,_0x53394a){return function(_0x58c9e2){_0x53394a[_0xc98f('0x2')](_0x411e8e,_0x58c9e2);};}function removeListener(_0x405990,_0x1da1f2){return function(){SmsQueueEvents[_0xc98f('0x3')](_0x405990,_0x1da1f2);};}exports['register']=function(_0x53db69){for(var _0xb852f7=0x0,_0x2407f9=events[_0xc98f('0x4')];_0xb852f7<_0x2407f9;_0xb852f7++){var _0x11358f=events[_0xb852f7];var _0x11a701=createListener(_0xc98f('0x5')+_0x11358f,_0x53db69);SmsQueueEvents['on'](_0x11358f,_0x11a701);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index fa8757e..dcf7862 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 _0x897d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update'];(function(_0x24fbe9,_0x59e9c7){var _0x2e0ac2=function(_0x1495a9){while(--_0x1495a9){_0x24fbe9['push'](_0x24fbe9['shift']());}};_0x2e0ac2(++_0x59e9c7);}(_0x897d,0x80));var _0xd897=function(_0x3cc350,_0x1b9165){_0x3cc350=_0x3cc350-0x0;var _0xf1f537=_0x897d[_0x3cc350];return _0xf1f537;};'use strict';var multer=require(_0xd897('0x0'));var util=require(_0xd897('0x1'));var path=require(_0xd897('0x2'));var timeout=require(_0xd897('0x3'));var express=require(_0xd897('0x4'));var router=express[_0xd897('0x5')]();var fs_extra=require(_0xd897('0x6'));var auth=require(_0xd897('0x7'));var interaction=require(_0xd897('0x8'));var config=require(_0xd897('0x9'));var controller=require(_0xd897('0xa'));router[_0xd897('0xb')]('/',auth[_0xd897('0xc')](),controller[_0xd897('0xd')]);router[_0xd897('0xb')](_0xd897('0xe'),auth[_0xd897('0xc')](),controller[_0xd897('0xf')]);router[_0xd897('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xd897('0x10')]);router[_0xd897('0x11')]('/',auth['isAuthenticated'](),controller[_0xd897('0x12')]);router[_0xd897('0x13')](_0xd897('0x14'),auth[_0xd897('0xc')](),controller[_0xd897('0x15')]);router[_0xd897('0x16')]('/:id',auth[_0xd897('0xc')](),controller[_0xd897('0x17')]);module[_0xd897('0x18')]=router; \ No newline at end of file +var _0xf3cc=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x4a0f60,_0x298c30){_0x4a0f60=_0x4a0f60-0x0;var _0x59b579=_0xf3cc[_0x4a0f60];return _0x59b579;};'use strict';var multer=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var path=require(_0xcf3c('0x2'));var timeout=require(_0xcf3c('0x3'));var express=require('express');var router=express[_0xcf3c('0x4')]();var fs_extra=require(_0xcf3c('0x5'));var auth=require(_0xcf3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf3c('0x7'));var controller=require(_0xcf3c('0x8'));router['get']('/',auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xa')]);router[_0xcf3c('0xb')](_0xcf3c('0xc'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xd')]);router[_0xcf3c('0xb')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcf3c('0x10')]);router[_0xcf3c('0x11')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0x12')]);router[_0xcf3c('0x13')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller['destroy']);module[_0xcf3c('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index bba53b0..62d98b0 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 _0x9208=['moment','sequelize','STRING','DATE'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9208,0x108));var _0x8920=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9208[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x8920('0x0'));var Sequelize=require(_0x8920('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8920('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8920('0x3')]},'acceptAt':{'type':Sequelize[_0x8920('0x3')]},'exitAt':{'type':Sequelize[_0x8920('0x3')]},'reason':{'type':Sequelize[_0x8920('0x2')]}}; \ No newline at end of file +var _0x5ba4=['moment','sequelize','exports','STRING','DATE'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5ba4,0x136));var _0x45ba=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x5ba4[_0x4ae625];return _0x31accf;};'use strict';var moment=require(_0x45ba('0x0'));var Sequelize=require(_0x45ba('0x1'));module[_0x45ba('0x2')]={'uniqueid':{'type':Sequelize[_0x45ba('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x45ba('0x4')]},'exitAt':{'type':Sequelize[_0x45ba('0x4')]},'reason':{'type':Sequelize[_0x45ba('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 283ceac..bea56dc 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 _0x2131=['hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','query','keys','model','attributes','intersection','fields'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x2131,0xee));var _0x1213=function(_0x58eed6,_0x49a046){_0x58eed6=_0x58eed6-0x0;var _0x381fa7=_0x2131[_0x58eed6];return _0x381fa7;};'use strict';var emlformat=require(_0x1213('0x0'));var rimraf=require(_0x1213('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1213('0x2'));var rp=require(_0x1213('0x3'));var moment=require(_0x1213('0x4'));var BPromise=require(_0x1213('0x5'));var Mustache=require('mustache');var util=require(_0x1213('0x6'));var path=require('path');var sox=require(_0x1213('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1213('0x8'));var _=require(_0x1213('0x9'));var squel=require(_0x1213('0xa'));var crypto=require('crypto');var jsforce=require(_0x1213('0xb'));var deskjs=require(_0x1213('0xc'));var toCsv=require(_0x1213('0xd'));var querystring=require(_0x1213('0xe'));var Papa=require(_0x1213('0xf'));var Redis=require(_0x1213('0x10'));var authService=require(_0x1213('0x11'));var qs=require(_0x1213('0x12'));var as=require(_0x1213('0x13'));var hardwareService=require(_0x1213('0x14'));var logger=require(_0x1213('0x15'))(_0x1213('0x16'));var utils=require(_0x1213('0x17'));var config=require(_0x1213('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1213('0x19'))['db'];function respondWithStatusCode(_0x16c1a7,_0x4ed76f){_0x4ed76f=_0x4ed76f||0xcc;return function(_0x280a2e){if(_0x280a2e){return _0x16c1a7['sendStatus'](_0x4ed76f);}return _0x16c1a7[_0x1213('0x1a')](_0x4ed76f)[_0x1213('0x1b')]();};}function respondWithResult(_0x288236,_0x940da5){_0x940da5=_0x940da5||0xc8;return function(_0x217081){if(_0x217081){return _0x288236[_0x1213('0x1a')](_0x940da5)[_0x1213('0x1c')](_0x217081);}};}function respondWithFilteredResult(_0x49aeb0,_0x464dbe){return function(_0x1379c9){if(_0x1379c9){var _0x391b54=typeof _0x464dbe[_0x1213('0x1d')]===_0x1213('0x1e')&&typeof _0x464dbe['limit']===_0x1213('0x1e');var _0x11069f=_0x1379c9[_0x1213('0x1f')];var _0x35b1da=_0x391b54?0x0:_0x464dbe['offset'];var _0x1388ae=_0x391b54?_0x1379c9['count']:_0x464dbe['offset']+_0x464dbe[_0x1213('0x20')];var _0x3e4a0d;if(_0x1388ae>=_0x11069f){_0x1388ae=_0x11069f;_0x3e4a0d=0xc8;}else{_0x3e4a0d=0xce;}_0x49aeb0[_0x1213('0x1a')](_0x3e4a0d);return _0x49aeb0[_0x1213('0x21')]('Content-Range',_0x35b1da+'-'+_0x1388ae+'/'+_0x11069f)['json'](_0x1379c9);}return null;};}function patchUpdates(_0x28a167){return function(_0x2130ed){try{jsonpatch[_0x1213('0x22')](_0x2130ed,_0x28a167,!![]);}catch(_0x416a17){return BPromise['reject'](_0x416a17);}return _0x2130ed[_0x1213('0x23')]();};}function saveUpdates(_0x56fbce,_0x45a0e6){return function(_0x177be3){if(_0x177be3){return _0x177be3[_0x1213('0x24')](_0x56fbce)[_0x1213('0x25')](function(_0x3411a6){return _0x3411a6;});}return null;};}function removeEntity(_0x4485a8,_0x2109ed){return function(_0x47e0b1){if(_0x47e0b1){return _0x47e0b1['destroy']()['then'](function(){_0x4485a8[_0x1213('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3914e2,_0x4c1eff){return function(_0x1f466b){if(!_0x1f466b){_0x3914e2[_0x1213('0x26')](0x194);}return _0x1f466b;};}function handleError(_0x23b094,_0x169363){_0x169363=_0x169363||0x1f4;return function(_0x5df0d7){logger[_0x1213('0x27')](_0x5df0d7[_0x1213('0x28')]);if(_0x5df0d7[_0x1213('0x29')]){delete _0x5df0d7[_0x1213('0x29')];}_0x23b094[_0x1213('0x1a')](_0x169363)['send'](_0x5df0d7);};}exports[_0x1213('0x2a')]=function(_0x3e1784,_0x57e77b){var _0x36d792={},_0x1deb8a={},_0x3b7ab3={'count':0x0,'rows':[]};var _0x22a333=_[_0x1213('0x2b')](db[_0x1213('0x2c')][_0x1213('0x2d')],function(_0x4fa56b){return{'name':_0x4fa56b['fieldName'],'type':_0x4fa56b[_0x1213('0x2e')][_0x1213('0x2f')]};});_0x1deb8a['model']=_[_0x1213('0x2b')](_0x22a333,_0x1213('0x29'));_0x1deb8a[_0x1213('0x30')]=_[_0x1213('0x31')](_0x3e1784[_0x1213('0x30')]);_0x1deb8a['filters']=_['intersection'](_0x1deb8a[_0x1213('0x32')],_0x1deb8a[_0x1213('0x30')]);_0x36d792[_0x1213('0x33')]=_[_0x1213('0x34')](_0x1deb8a[_0x1213('0x32')],qs[_0x1213('0x35')](_0x3e1784['query'][_0x1213('0x35')]));_0x36d792[_0x1213('0x33')]=_0x36d792[_0x1213('0x33')]['length']?_0x36d792[_0x1213('0x33')]:_0x1deb8a[_0x1213('0x32')];if(!_0x3e1784[_0x1213('0x30')][_0x1213('0x36')]('nolimit')){_0x36d792[_0x1213('0x20')]=qs[_0x1213('0x20')](_0x3e1784[_0x1213('0x30')][_0x1213('0x20')]);_0x36d792[_0x1213('0x1d')]=qs[_0x1213('0x1d')](_0x3e1784['query'][_0x1213('0x1d')]);}_0x36d792[_0x1213('0x37')]=qs[_0x1213('0x38')](_0x3e1784['query'][_0x1213('0x38')]);_0x36d792[_0x1213('0x39')]=qs[_0x1213('0x3a')](_['pick'](_0x3e1784[_0x1213('0x30')],_0x1deb8a['filters']),_0x22a333);if(_0x3e1784[_0x1213('0x30')][_0x1213('0x3b')]){_0x36d792['where']=_['merge'](_0x36d792[_0x1213('0x39')],{'$or':_['map'](_0x22a333,function(_0x3a1435){if(_0x3a1435['type']!==_0x1213('0x3c')){var _0x122ca5={};_0x122ca5[_0x3a1435[_0x1213('0x29')]]={'$like':'%'+_0x3e1784[_0x1213('0x30')][_0x1213('0x3b')]+'%'};return _0x122ca5;}})});}_0x36d792=_[_0x1213('0x3d')]({},_0x36d792,_0x3e1784[_0x1213('0x3e')]);var _0x21686f={'where':_0x36d792[_0x1213('0x39')]};return db['SmsQueueReport'][_0x1213('0x1f')](_0x21686f)[_0x1213('0x25')](function(_0x184ab5){_0x3b7ab3[_0x1213('0x1f')]=_0x184ab5;if(_0x3e1784[_0x1213('0x30')][_0x1213('0x3f')]){_0x36d792[_0x1213('0x40')]=[{'all':!![]}];}return db[_0x1213('0x2c')]['findAll'](_0x36d792);})[_0x1213('0x25')](function(_0x4dceb3){_0x3b7ab3['rows']=_0x4dceb3;return _0x3b7ab3;})[_0x1213('0x25')](respondWithFilteredResult(_0x57e77b,_0x36d792))['catch'](handleError(_0x57e77b,null));};exports[_0x1213('0x41')]=function(_0x3752ad,_0x49a8de){var _0x56b2a3={'raw':!![],'where':{'id':_0x3752ad[_0x1213('0x42')]['id']}},_0x10bc63={};_0x10bc63[_0x1213('0x32')]=_['keys'](db['SmsQueueReport'][_0x1213('0x2d')]);_0x10bc63[_0x1213('0x30')]=_['keys'](_0x3752ad['query']);_0x10bc63[_0x1213('0x3a')]=_[_0x1213('0x34')](_0x10bc63[_0x1213('0x32')],_0x10bc63[_0x1213('0x30')]);_0x56b2a3['attributes']=_[_0x1213('0x34')](_0x10bc63['model'],qs['fields'](_0x3752ad[_0x1213('0x30')]['fields']));_0x56b2a3[_0x1213('0x33')]=_0x56b2a3['attributes']['length']?_0x56b2a3[_0x1213('0x33')]:_0x10bc63[_0x1213('0x32')];if(_0x3752ad['query']['includeAll']){_0x56b2a3[_0x1213('0x40')]=[{'all':!![]}];}_0x56b2a3=_[_0x1213('0x3d')]({},_0x56b2a3,_0x3752ad['options']);return db[_0x1213('0x2c')][_0x1213('0x43')](_0x56b2a3)[_0x1213('0x25')](handleEntityNotFound(_0x49a8de,null))['then'](respondWithResult(_0x49a8de,null))[_0x1213('0x44')](handleError(_0x49a8de,null));};exports['create']=function(_0x17b729,_0x592ce0){return db[_0x1213('0x2c')][_0x1213('0x45')](_0x17b729['body'],{})['then'](respondWithResult(_0x592ce0,0xc9))[_0x1213('0x44')](handleError(_0x592ce0,null));};exports['update']=function(_0x5cc6dc,_0x3b8eed){if(_0x5cc6dc[_0x1213('0x46')]['id']){delete _0x5cc6dc[_0x1213('0x46')]['id'];}return db['SmsQueueReport'][_0x1213('0x43')]({'where':{'id':_0x5cc6dc[_0x1213('0x42')]['id']}})[_0x1213('0x25')](handleEntityNotFound(_0x3b8eed,null))[_0x1213('0x25')](saveUpdates(_0x5cc6dc[_0x1213('0x46')],null))[_0x1213('0x25')](respondWithResult(_0x3b8eed,null))[_0x1213('0x44')](handleError(_0x3b8eed,null));};exports[_0x1213('0x47')]=function(_0x143f27,_0x1972f4){return db[_0x1213('0x2c')][_0x1213('0x43')]({'where':{'id':_0x143f27[_0x1213('0x42')]['id']}})[_0x1213('0x25')](handleEntityNotFound(_0x1972f4,null))[_0x1213('0x25')](removeEntity(_0x1972f4,null))[_0x1213('0x44')](handleError(_0x1972f4,null));};exports[_0x1213('0x48')]=function(_0x36fd47,_0x5e5ff6){return db[_0x1213('0x2c')][_0x1213('0x48')]()['then'](respondWithResult(_0x5e5ff6,null))[_0x1213('0x44')](handleError(_0x5e5ff6,null));}; \ No newline at end of file +var _0xf94f=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x51a5ad,_0xb87632){var _0x3c00a5=function(_0x11a338){while(--_0x11a338){_0x51a5ad['push'](_0x51a5ad['shift']());}};_0x3c00a5(++_0xb87632);}(_0xf94f,0x64));var _0xff94=function(_0x409c1a,_0x2e4ca7){_0x409c1a=_0x409c1a-0x0;var _0x40f7dd=_0xf94f[_0x409c1a];return _0x40f7dd;};'use strict';var emlformat=require(_0xff94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff94('0x1'));var jsonpatch=require(_0xff94('0x2'));var rp=require(_0xff94('0x3'));var moment=require(_0xff94('0x4'));var BPromise=require(_0xff94('0x5'));var Mustache=require('mustache');var util=require(_0xff94('0x6'));var path=require(_0xff94('0x7'));var sox=require(_0xff94('0x8'));var csv=require(_0xff94('0x9'));var ejs=require(_0xff94('0xa'));var fs=require('fs');var fs_extra=require(_0xff94('0xb'));var _=require(_0xff94('0xc'));var squel=require(_0xff94('0xd'));var crypto=require('crypto');var jsforce=require(_0xff94('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff94('0xf'));var Papa=require(_0xff94('0x10'));var Redis=require(_0xff94('0x11'));var authService=require(_0xff94('0x12'));var qs=require(_0xff94('0x13'));var as=require(_0xff94('0x14'));var hardwareService=require(_0xff94('0x15'));var logger=require(_0xff94('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xff94('0x17'));var licenseUtil=require(_0xff94('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302b9b,_0x2d9f46){_0x2d9f46=_0x2d9f46||0xcc;return function(_0x578b42){if(_0x578b42){return _0x302b9b['sendStatus'](_0x2d9f46);}return _0x302b9b[_0xff94('0x19')](_0x2d9f46)[_0xff94('0x1a')]();};}function respondWithResult(_0x26102d,_0x25c718){_0x25c718=_0x25c718||0xc8;return function(_0x106696){if(_0x106696){return _0x26102d[_0xff94('0x19')](_0x25c718)[_0xff94('0x1b')](_0x106696);}};}function respondWithFilteredResult(_0x5337af,_0x11f5c9){return function(_0x3e85e3){if(_0x3e85e3){var _0xc27aba=typeof _0x11f5c9[_0xff94('0x1c')]===_0xff94('0x1d')&&typeof _0x11f5c9[_0xff94('0x1e')]===_0xff94('0x1d');var _0x4245c7=_0x3e85e3[_0xff94('0x1f')];var _0x3c8063=_0xc27aba?0x0:_0x11f5c9[_0xff94('0x1c')];var _0x162720=_0xc27aba?_0x3e85e3[_0xff94('0x1f')]:_0x11f5c9[_0xff94('0x1c')]+_0x11f5c9[_0xff94('0x1e')];var _0x40d447;if(_0x162720>=_0x4245c7){_0x162720=_0x4245c7;_0x40d447=0xc8;}else{_0x40d447=0xce;}_0x5337af['status'](_0x40d447);return _0x5337af[_0xff94('0x20')](_0xff94('0x21'),_0x3c8063+'-'+_0x162720+'/'+_0x4245c7)['json'](_0x3e85e3);}return null;};}function patchUpdates(_0x30e5c1){return function(_0x403a4d){try{jsonpatch[_0xff94('0x22')](_0x403a4d,_0x30e5c1,!![]);}catch(_0x3d3b46){return BPromise['reject'](_0x3d3b46);}return _0x403a4d[_0xff94('0x23')]();};}function saveUpdates(_0x525332,_0xa220d1){return function(_0x4c0c6d){if(_0x4c0c6d){return _0x4c0c6d['update'](_0x525332)[_0xff94('0x24')](function(_0x9e2d8){return _0x9e2d8;});}return null;};}function removeEntity(_0x13be5e,_0x5ed14b){return function(_0x324f17){if(_0x324f17){return _0x324f17[_0xff94('0x25')]()[_0xff94('0x24')](function(){_0x13be5e[_0xff94('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b925c,_0x1dc172){return function(_0xc75d0){if(!_0xc75d0){_0x5b925c[_0xff94('0x26')](0x194);}return _0xc75d0;};}function handleError(_0x112af6,_0x50fbd0){_0x50fbd0=_0x50fbd0||0x1f4;return function(_0x3f4d3b){logger[_0xff94('0x27')](_0x3f4d3b[_0xff94('0x28')]);if(_0x3f4d3b[_0xff94('0x29')]){delete _0x3f4d3b[_0xff94('0x29')];}_0x112af6[_0xff94('0x19')](_0x50fbd0)[_0xff94('0x2a')](_0x3f4d3b);};}exports[_0xff94('0x2b')]=function(_0xc592e,_0x1091d7){var _0x3df7ab={},_0x4a0edf={},_0x214c33={'count':0x0,'rows':[]};var _0x2eb93b=_[_0xff94('0x2c')](db[_0xff94('0x2d')]['rawAttributes'],function(_0x2ebdc5){return{'name':_0x2ebdc5[_0xff94('0x2e')],'type':_0x2ebdc5['type'][_0xff94('0x2f')]};});_0x4a0edf[_0xff94('0x30')]=_[_0xff94('0x2c')](_0x2eb93b,_0xff94('0x29'));_0x4a0edf[_0xff94('0x31')]=_[_0xff94('0x32')](_0xc592e[_0xff94('0x31')]);_0x4a0edf[_0xff94('0x33')]=_[_0xff94('0x34')](_0x4a0edf[_0xff94('0x30')],_0x4a0edf[_0xff94('0x31')]);_0x3df7ab[_0xff94('0x35')]=_[_0xff94('0x34')](_0x4a0edf[_0xff94('0x30')],qs['fields'](_0xc592e[_0xff94('0x31')][_0xff94('0x36')]));_0x3df7ab[_0xff94('0x35')]=_0x3df7ab[_0xff94('0x35')][_0xff94('0x37')]?_0x3df7ab['attributes']:_0x4a0edf['model'];if(!_0xc592e[_0xff94('0x31')]['hasOwnProperty'](_0xff94('0x38'))){_0x3df7ab['limit']=qs['limit'](_0xc592e[_0xff94('0x31')][_0xff94('0x1e')]);_0x3df7ab[_0xff94('0x1c')]=qs[_0xff94('0x1c')](_0xc592e[_0xff94('0x31')]['offset']);}_0x3df7ab[_0xff94('0x39')]=qs[_0xff94('0x3a')](_0xc592e[_0xff94('0x31')][_0xff94('0x3a')]);_0x3df7ab[_0xff94('0x3b')]=qs[_0xff94('0x33')](_[_0xff94('0x3c')](_0xc592e[_0xff94('0x31')],_0x4a0edf[_0xff94('0x33')]),_0x2eb93b);if(_0xc592e[_0xff94('0x31')][_0xff94('0x3d')]){_0x3df7ab['where']=_[_0xff94('0x3e')](_0x3df7ab[_0xff94('0x3b')],{'$or':_['map'](_0x2eb93b,function(_0x27404a){if(_0x27404a[_0xff94('0x3f')]!==_0xff94('0x40')){var _0x44f741={};_0x44f741[_0x27404a[_0xff94('0x29')]]={'$like':'%'+_0xc592e[_0xff94('0x31')][_0xff94('0x3d')]+'%'};return _0x44f741;}})});}_0x3df7ab=_[_0xff94('0x3e')]({},_0x3df7ab,_0xc592e[_0xff94('0x41')]);var _0x49a2e6={'where':_0x3df7ab[_0xff94('0x3b')]};return db[_0xff94('0x2d')][_0xff94('0x1f')](_0x49a2e6)[_0xff94('0x24')](function(_0x594adb){_0x214c33[_0xff94('0x1f')]=_0x594adb;if(_0xc592e[_0xff94('0x31')][_0xff94('0x42')]){_0x3df7ab[_0xff94('0x43')]=[{'all':!![]}];}return db[_0xff94('0x2d')]['findAll'](_0x3df7ab);})['then'](function(_0x2910eb){_0x214c33[_0xff94('0x44')]=_0x2910eb;return _0x214c33;})[_0xff94('0x24')](respondWithFilteredResult(_0x1091d7,_0x3df7ab))[_0xff94('0x45')](handleError(_0x1091d7,null));};exports['show']=function(_0x1acacc,_0x1f2c4e){var _0x2b7f56={'raw':!![],'where':{'id':_0x1acacc[_0xff94('0x46')]['id']}},_0x15887e={};_0x15887e[_0xff94('0x30')]=_[_0xff94('0x32')](db[_0xff94('0x2d')][_0xff94('0x47')]);_0x15887e[_0xff94('0x31')]=_[_0xff94('0x32')](_0x1acacc['query']);_0x15887e[_0xff94('0x33')]=_['intersection'](_0x15887e[_0xff94('0x30')],_0x15887e['query']);_0x2b7f56[_0xff94('0x35')]=_['intersection'](_0x15887e[_0xff94('0x30')],qs['fields'](_0x1acacc[_0xff94('0x31')][_0xff94('0x36')]));_0x2b7f56['attributes']=_0x2b7f56[_0xff94('0x35')]['length']?_0x2b7f56[_0xff94('0x35')]:_0x15887e[_0xff94('0x30')];if(_0x1acacc[_0xff94('0x31')][_0xff94('0x42')]){_0x2b7f56[_0xff94('0x43')]=[{'all':!![]}];}_0x2b7f56=_[_0xff94('0x3e')]({},_0x2b7f56,_0x1acacc[_0xff94('0x41')]);return db[_0xff94('0x2d')][_0xff94('0x48')](_0x2b7f56)[_0xff94('0x24')](handleEntityNotFound(_0x1f2c4e,null))[_0xff94('0x24')](respondWithResult(_0x1f2c4e,null))['catch'](handleError(_0x1f2c4e,null));};exports[_0xff94('0x49')]=function(_0x2f76c9,_0x1b96d7){return db[_0xff94('0x2d')]['create'](_0x2f76c9[_0xff94('0x4a')],{})[_0xff94('0x24')](respondWithResult(_0x1b96d7,0xc9))[_0xff94('0x45')](handleError(_0x1b96d7,null));};exports[_0xff94('0x4b')]=function(_0x1cf9b6,_0x3ff7cb){if(_0x1cf9b6[_0xff94('0x4a')]['id']){delete _0x1cf9b6[_0xff94('0x4a')]['id'];}return db[_0xff94('0x2d')][_0xff94('0x48')]({'where':{'id':_0x1cf9b6[_0xff94('0x46')]['id']}})[_0xff94('0x24')](handleEntityNotFound(_0x3ff7cb,null))[_0xff94('0x24')](saveUpdates(_0x1cf9b6['body'],null))[_0xff94('0x24')](respondWithResult(_0x3ff7cb,null))[_0xff94('0x45')](handleError(_0x3ff7cb,null));};exports['destroy']=function(_0x3ea2b2,_0x1f1b0b){return db['SmsQueueReport'][_0xff94('0x48')]({'where':{'id':_0x3ea2b2[_0xff94('0x46')]['id']}})[_0xff94('0x24')](handleEntityNotFound(_0x1f1b0b,null))[_0xff94('0x24')](removeEntity(_0x1f1b0b,null))[_0xff94('0x45')](handleError(_0x1f1b0b,null));};exports['describe']=function(_0x269908,_0x1c70d4){return db[_0xff94('0x2d')][_0xff94('0x4c')]()[_0xff94('0x24')](respondWithResult(_0x1c70d4,null))[_0xff94('0x45')](handleError(_0x1c70d4,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f9bbaf6..0d8dfe7 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x7e9167,_0x27917a){var _0x42160d=function(_0x20d9d5){while(--_0x20d9d5){_0x7e9167['push'](_0x7e9167['shift']());}};_0x42160d(++_0x27917a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2e5860,_0x56363c){var _0x3c477c=function(_0x1e07fa){while(--_0x1e07fa){_0x2e5860['push'](_0x2e5860['shift']());}};_0x3c477c(++_0x56363c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c6fb0b6..989e993 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 _0x6e57=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','where','attributes','lodash','util'];(function(_0x14695e,_0x4570f7){var _0x26fc6b=function(_0x36c2de){while(--_0x36c2de){_0x14695e['push'](_0x14695e['shift']());}};_0x26fc6b(++_0x4570f7);}(_0x6e57,0x106));var _0x76e5=function(_0x51bc0e,_0x2753cc){_0x51bc0e=_0x51bc0e-0x0;var _0x1b47c6=_0x6e57[_0x51bc0e];return _0x1b47c6;};'use strict';var _=require(_0x76e5('0x0'));var util=require(_0x76e5('0x1'));var moment=require('moment');var BPromise=require(_0x76e5('0x2'));var rs=require(_0x76e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76e5('0x4'))['db'];var utils=require(_0x76e5('0x5'));var logger=require(_0x76e5('0x6'))('rpc');var config=require(_0x76e5('0x7'));var jayson=require(_0x76e5('0x8'));var client=jayson[_0x76e5('0x9')][_0x76e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7bb946,_0x1bcc47,_0x550213){return new BPromise(function(_0x43dfd5,_0x50ab9b){return client[_0x76e5('0xb')](_0x7bb946,_0x550213)[_0x76e5('0xc')](function(_0x389143){logger[_0x76e5('0xd')](_0x76e5('0xe'),_0x1bcc47,_0x76e5('0xf'));logger[_0x76e5('0x10')](_0x76e5('0x11'),_0x1bcc47,_0x76e5('0xf'),JSON[_0x76e5('0x12')](_0x389143));if(_0x389143['error']){if(_0x389143[_0x76e5('0x13')][_0x76e5('0x14')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x1bcc47,_0x389143[_0x76e5('0x13')][_0x76e5('0x15')]);return _0x50ab9b(_0x389143[_0x76e5('0x13')][_0x76e5('0x15')]);}logger['error'](_0x76e5('0xe'),_0x1bcc47,_0x389143[_0x76e5('0x13')]['message']);return _0x43dfd5(_0x389143[_0x76e5('0x13')]['message']);}else{logger[_0x76e5('0xd')](_0x76e5('0xe'),_0x1bcc47,_0x76e5('0xf'));_0x43dfd5(_0x389143[_0x76e5('0x16')][_0x76e5('0x15')]);}})[_0x76e5('0x17')](function(_0x26f04b){logger[_0x76e5('0x13')](_0x76e5('0xe'),_0x1bcc47,_0x26f04b);_0x50ab9b(_0x26f04b);});});}exports[_0x76e5('0x18')]=function(_0x41a62f){var _0x3c73d1=this;return new Promise(function(_0x38191e,_0x3ab755){return db[_0x76e5('0x19')][_0x76e5('0x1a')](_0x41a62f[_0x76e5('0x1b')],{'raw':_0x41a62f[_0x76e5('0x1c')]?_0x41a62f[_0x76e5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x76e5('0xc')](function(_0x29315b){logger['info'](_0x76e5('0x18'),_0x41a62f);logger['debug'](_0x76e5('0x18'),_0x41a62f,JSON['stringify'](_0x29315b));_0x38191e(_0x29315b);})[_0x76e5('0x17')](function(_0x361950){logger['error'](_0x76e5('0x18'),_0x361950[_0x76e5('0x15')],_0x41a62f);_0x3ab755(_0x3c73d1[_0x76e5('0x13')](0x1f4,_0x361950[_0x76e5('0x15')]));});});};exports[_0x76e5('0x1d')]=function(_0x587ac0){var _0x1dbdbc=this;return new Promise(function(_0x4bed96,_0x93cc93){return db[_0x76e5('0x19')][_0x76e5('0x1e')](_0x587ac0['body'],{'raw':_0x587ac0[_0x76e5('0x1c')]?_0x587ac0[_0x76e5('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x587ac0['options']?_0x587ac0[_0x76e5('0x1c')][_0x76e5('0x1f')]||null:null,'attributes':_0x587ac0[_0x76e5('0x1c')]?_0x587ac0['options'][_0x76e5('0x20')]||null:null,'limit':_0x587ac0['options']?_0x587ac0['options']['limit']||null:null})[_0x76e5('0xc')](function(_0x1056fc){logger[_0x76e5('0xd')](_0x76e5('0x1d'),_0x587ac0);logger[_0x76e5('0x10')]('UpdateSmsQueueReport',_0x587ac0,JSON[_0x76e5('0x12')](_0x1056fc));_0x4bed96(_0x1056fc);})['catch'](function(_0x4001fe){logger[_0x76e5('0x13')]('UpdateSmsQueueReport',_0x4001fe['message'],_0x587ac0);_0x93cc93(_0x1dbdbc[_0x76e5('0x13')](0x1f4,_0x4001fe[_0x76e5('0x15')]));});});}; \ No newline at end of file +var _0xf7bb=['attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','options','raw','update','body'];(function(_0x3add96,_0x1e76f8){var _0x2f43fb=function(_0x178048){while(--_0x178048){_0x3add96['push'](_0x3add96['shift']());}};_0x2f43fb(++_0x1e76f8);}(_0xf7bb,0x179));var _0xbf7b=function(_0x333409,_0x8bdf47){_0x333409=_0x333409-0x0;var _0x3649f1=_0xf7bb[_0x333409];return _0x3649f1;};'use strict';var _=require(_0xbf7b('0x0'));var util=require(_0xbf7b('0x1'));var moment=require(_0xbf7b('0x2'));var BPromise=require(_0xbf7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf7b('0x4'));var db=require(_0xbf7b('0x5'))['db'];var utils=require(_0xbf7b('0x6'));var logger=require(_0xbf7b('0x7'))(_0xbf7b('0x8'));var config=require(_0xbf7b('0x9'));var jayson=require(_0xbf7b('0xa'));var client=jayson[_0xbf7b('0xb')][_0xbf7b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c88fd,_0x5ac06a,_0x9fa768){return new BPromise(function(_0x2a891e,_0x57fe49){return client[_0xbf7b('0xd')](_0x3c88fd,_0x9fa768)[_0xbf7b('0xe')](function(_0x1cc27c){logger[_0xbf7b('0xf')](_0xbf7b('0x10'),_0x5ac06a,_0xbf7b('0x11'));logger[_0xbf7b('0x12')](_0xbf7b('0x13'),_0x5ac06a,_0xbf7b('0x11'),JSON[_0xbf7b('0x14')](_0x1cc27c));if(_0x1cc27c[_0xbf7b('0x15')]){if(_0x1cc27c[_0xbf7b('0x15')][_0xbf7b('0x16')]===0x1f4){logger[_0xbf7b('0x15')](_0xbf7b('0x10'),_0x5ac06a,_0x1cc27c[_0xbf7b('0x15')]['message']);return _0x57fe49(_0x1cc27c[_0xbf7b('0x15')][_0xbf7b('0x17')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x5ac06a,_0x1cc27c['error'][_0xbf7b('0x17')]);return _0x2a891e(_0x1cc27c['error'][_0xbf7b('0x17')]);}else{logger[_0xbf7b('0xf')](_0xbf7b('0x10'),_0x5ac06a,_0xbf7b('0x11'));_0x2a891e(_0x1cc27c[_0xbf7b('0x18')]['message']);}})[_0xbf7b('0x19')](function(_0x2d5ccc){logger[_0xbf7b('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x5ac06a,_0x2d5ccc);_0x57fe49(_0x2d5ccc);});});}exports[_0xbf7b('0x1a')]=function(_0x4b2d14){var _0x16a7ba=this;return new Promise(function(_0x24aa27,_0x45e59f){return db['SmsQueueReport']['create'](_0x4b2d14['body'],{'raw':_0x4b2d14[_0xbf7b('0x1b')]?_0x4b2d14[_0xbf7b('0x1b')][_0xbf7b('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1159b3){logger[_0xbf7b('0xf')](_0xbf7b('0x1a'),_0x4b2d14);logger[_0xbf7b('0x12')](_0xbf7b('0x1a'),_0x4b2d14,JSON[_0xbf7b('0x14')](_0x1159b3));_0x24aa27(_0x1159b3);})[_0xbf7b('0x19')](function(_0x26b034){logger[_0xbf7b('0x15')](_0xbf7b('0x1a'),_0x26b034[_0xbf7b('0x17')],_0x4b2d14);_0x45e59f(_0x16a7ba[_0xbf7b('0x15')](0x1f4,_0x26b034[_0xbf7b('0x17')]));});});};exports['UpdateSmsQueueReport']=function(_0x50babd){var _0x1a6ec1=this;return new Promise(function(_0x14a445,_0x583800){return db['SmsQueueReport'][_0xbf7b('0x1d')](_0x50babd[_0xbf7b('0x1e')],{'raw':_0x50babd[_0xbf7b('0x1b')]?_0x50babd['options'][_0xbf7b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50babd[_0xbf7b('0x1b')]?_0x50babd[_0xbf7b('0x1b')]['where']||null:null,'attributes':_0x50babd[_0xbf7b('0x1b')]?_0x50babd['options'][_0xbf7b('0x1f')]||null:null,'limit':_0x50babd[_0xbf7b('0x1b')]?_0x50babd[_0xbf7b('0x1b')][_0xbf7b('0x20')]||null:null})[_0xbf7b('0xe')](function(_0x19fbe3){logger[_0xbf7b('0xf')](_0xbf7b('0x21'),_0x50babd);logger[_0xbf7b('0x12')](_0xbf7b('0x21'),_0x50babd,JSON[_0xbf7b('0x14')](_0x19fbe3));_0x14a445(_0x19fbe3);})['catch'](function(_0x620089){logger['error'](_0xbf7b('0x21'),_0x620089[_0xbf7b('0x17')],_0x50babd);_0x583800(_0x1a6ec1[_0xbf7b('0x15')](0x1f4,_0x620089[_0xbf7b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b21f02e..0c653e0 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 _0xc492=['/:id','post','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe'];(function(_0x94bb16,_0x197164){var _0x3a0863=function(_0x144e70){while(--_0x144e70){_0x94bb16['push'](_0x94bb16['shift']());}};_0x3a0863(++_0x197164);}(_0xc492,0xd7));var _0x2c49=function(_0xe3eb8f,_0x4a594d){_0xe3eb8f=_0xe3eb8f-0x0;var _0x2829b7=_0xc492[_0xe3eb8f];return _0x2829b7;};'use strict';var multer=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var path=require(_0x2c49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c49('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var controller=require('./smsTransferReport.controller');router[_0x2c49('0x6')]('/',auth['isAuthenticated'](),controller[_0x2c49('0x7')]);router[_0x2c49('0x6')]('/describe',auth[_0x2c49('0x8')](),controller[_0x2c49('0x9')]);router[_0x2c49('0x6')](_0x2c49('0xa'),auth[_0x2c49('0x8')](),controller['show']);router[_0x2c49('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x2c49('0x8')](),controller['update']);router[_0x2c49('0xc')](_0x2c49('0xa'),auth['isAuthenticated'](),controller[_0x2c49('0xd')]);module[_0x2c49('0xe')]=router; \ No newline at end of file +var _0x6c32=['get','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller'];(function(_0x271345,_0x165229){var _0x6dad70=function(_0x1f0480){while(--_0x1f0480){_0x271345['push'](_0x271345['shift']());}};_0x6dad70(++_0x165229);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var path=require(_0x26c3('0x2'));var timeout=require(_0x26c3('0x3'));var express=require(_0x26c3('0x4'));var router=express[_0x26c3('0x5')]();var fs_extra=require(_0x26c3('0x6'));var auth=require(_0x26c3('0x7'));var interaction=require(_0x26c3('0x8'));var config=require('../../config/environment');var controller=require(_0x26c3('0x9'));router[_0x26c3('0xa')]('/',auth[_0x26c3('0xb')](),controller['index']);router[_0x26c3('0xa')]('/describe',auth[_0x26c3('0xb')](),controller[_0x26c3('0xc')]);router[_0x26c3('0xa')](_0x26c3('0xd'),auth[_0x26c3('0xb')](),controller[_0x26c3('0xe')]);router[_0x26c3('0xf')]('/',auth[_0x26c3('0xb')](),controller[_0x26c3('0x10')]);router[_0x26c3('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x26c3('0xd'),auth[_0x26c3('0xb')](),controller[_0x26c3('0x12')]);module[_0x26c3('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index d4830ad..ac91225 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x39a387,_0x496459){var _0x4d9420=function(_0x2b9cda){while(--_0x2b9cda){_0x39a387['push'](_0x39a387['shift']());}};_0x4d9420(++_0x496459);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x11731f,_0x2271b5){var _0x14587c=function(_0x31e014){while(--_0x31e014){_0x11731f['push'](_0x11731f['shift']());}};_0x14587c(++_0x2271b5);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a97b652..090e3bd 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 _0x26b6=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','error','stack','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','name','includeAll','findAll','then','rows','catch','show','params','keys','length','include','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x26b6,0x7a));var _0x626b=function(_0x55f79f,_0x22f4fe){_0x55f79f=_0x55f79f-0x0;var _0x15f66f=_0x26b6[_0x55f79f];return _0x15f66f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x626b('0x0'));var zipdir=require(_0x626b('0x1'));var jsonpatch=require(_0x626b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x626b('0x3'));var Mustache=require(_0x626b('0x4'));var util=require(_0x626b('0x5'));var path=require(_0x626b('0x6'));var sox=require('sox');var csv=require(_0x626b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x626b('0x8'));var squel=require(_0x626b('0x9'));var crypto=require(_0x626b('0xa'));var jsforce=require(_0x626b('0xb'));var deskjs=require(_0x626b('0xc'));var toCsv=require(_0x626b('0x7'));var querystring=require(_0x626b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x626b('0xe'));var qs=require(_0x626b('0xf'));var as=require(_0x626b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x626b('0x11'));var utils=require(_0x626b('0x12'));var config=require(_0x626b('0x13'));var licenseUtil=require(_0x626b('0x14'));var db=require(_0x626b('0x15'))['db'];function respondWithStatusCode(_0x303ed4,_0x1e1819){_0x1e1819=_0x1e1819||0xcc;return function(_0x4e452c){if(_0x4e452c){return _0x303ed4[_0x626b('0x16')](_0x1e1819);}return _0x303ed4[_0x626b('0x17')](_0x1e1819)[_0x626b('0x18')]();};}function respondWithResult(_0x50750e,_0x495226){_0x495226=_0x495226||0xc8;return function(_0x4b8bd0){if(_0x4b8bd0){return _0x50750e['status'](_0x495226)[_0x626b('0x19')](_0x4b8bd0);}};}function respondWithFilteredResult(_0x1c8527,_0x2f2ab8){return function(_0x4b8db3){if(_0x4b8db3){var _0x275da3=typeof _0x2f2ab8[_0x626b('0x1a')]===_0x626b('0x1b')&&typeof _0x2f2ab8[_0x626b('0x1c')]==='undefined';var _0x9324df=_0x4b8db3[_0x626b('0x1d')];var _0x5d65e3=_0x275da3?0x0:_0x2f2ab8[_0x626b('0x1a')];var _0x503ef1=_0x275da3?_0x4b8db3[_0x626b('0x1d')]:_0x2f2ab8[_0x626b('0x1a')]+_0x2f2ab8[_0x626b('0x1c')];var _0x34056e;if(_0x503ef1>=_0x9324df){_0x503ef1=_0x9324df;_0x34056e=0xc8;}else{_0x34056e=0xce;}_0x1c8527[_0x626b('0x17')](_0x34056e);return _0x1c8527[_0x626b('0x1e')](_0x626b('0x1f'),_0x5d65e3+'-'+_0x503ef1+'/'+_0x9324df)[_0x626b('0x19')](_0x4b8db3);}return null;};}function patchUpdates(_0x94f00c){return function(_0x387346){try{jsonpatch['apply'](_0x387346,_0x94f00c,!![]);}catch(_0x393698){return BPromise['reject'](_0x393698);}return _0x387346['save']();};}function saveUpdates(_0x2948ef,_0x5628b5){return function(_0x2a7db6){if(_0x2a7db6){return _0x2a7db6[_0x626b('0x20')](_0x2948ef)['then'](function(_0x5386cd){return _0x5386cd;});}return null;};}function removeEntity(_0x4f262e,_0x4a7cbe){return function(_0x2c2375){if(_0x2c2375){return _0x2c2375[_0x626b('0x21')]()['then'](function(){_0x4f262e[_0x626b('0x17')](0xcc)[_0x626b('0x18')]();});}};}function handleEntityNotFound(_0x35103b,_0x1d4c3f){return function(_0x436228){if(!_0x436228){_0x35103b[_0x626b('0x16')](0x194);}return _0x436228;};}function handleError(_0x2e5c64,_0x3bba09){_0x3bba09=_0x3bba09||0x1f4;return function(_0x4553b0){logger[_0x626b('0x22')](_0x4553b0[_0x626b('0x23')]);if(_0x4553b0['name']){delete _0x4553b0['name'];}_0x2e5c64['status'](_0x3bba09)[_0x626b('0x24')](_0x4553b0);};}exports['index']=function(_0x5215aa,_0x479376){var _0x1b99d7={},_0x5ceee6={},_0x23aba6={'count':0x0,'rows':[]};var _0x5e8839=_[_0x626b('0x25')](db[_0x626b('0x26')][_0x626b('0x27')],function(_0x59ff4b){return{'name':_0x59ff4b[_0x626b('0x28')],'type':_0x59ff4b[_0x626b('0x29')][_0x626b('0x2a')]};});_0x5ceee6[_0x626b('0x2b')]=_[_0x626b('0x25')](_0x5e8839,'name');_0x5ceee6[_0x626b('0x2c')]=_['keys'](_0x5215aa[_0x626b('0x2c')]);_0x5ceee6[_0x626b('0x2d')]=_['intersection'](_0x5ceee6[_0x626b('0x2b')],_0x5ceee6['query']);_0x1b99d7[_0x626b('0x2e')]=_[_0x626b('0x2f')](_0x5ceee6[_0x626b('0x2b')],qs[_0x626b('0x30')](_0x5215aa[_0x626b('0x2c')]['fields']));_0x1b99d7[_0x626b('0x2e')]=_0x1b99d7[_0x626b('0x2e')]['length']?_0x1b99d7[_0x626b('0x2e')]:_0x5ceee6[_0x626b('0x2b')];if(!_0x5215aa[_0x626b('0x2c')]['hasOwnProperty'](_0x626b('0x31'))){_0x1b99d7[_0x626b('0x1c')]=qs[_0x626b('0x1c')](_0x5215aa['query'][_0x626b('0x1c')]);_0x1b99d7[_0x626b('0x1a')]=qs[_0x626b('0x1a')](_0x5215aa[_0x626b('0x2c')]['offset']);}_0x1b99d7['order']=qs[_0x626b('0x32')](_0x5215aa[_0x626b('0x2c')]['sort']);_0x1b99d7[_0x626b('0x33')]=qs['filters'](_['pick'](_0x5215aa[_0x626b('0x2c')],_0x5ceee6[_0x626b('0x2d')]),_0x5e8839);if(_0x5215aa[_0x626b('0x2c')][_0x626b('0x34')]){_0x1b99d7[_0x626b('0x33')]=_[_0x626b('0x35')](_0x1b99d7[_0x626b('0x33')],{'$or':_[_0x626b('0x25')](_0x5e8839,function(_0x4bdc04){if(_0x4bdc04[_0x626b('0x29')]!=='VIRTUAL'){var _0x1cddda={};_0x1cddda[_0x4bdc04[_0x626b('0x36')]]={'$like':'%'+_0x5215aa[_0x626b('0x2c')][_0x626b('0x34')]+'%'};return _0x1cddda;}})});}_0x1b99d7=_[_0x626b('0x35')]({},_0x1b99d7,_0x5215aa['options']);var _0x3f321a={'where':_0x1b99d7[_0x626b('0x33')]};return db[_0x626b('0x26')][_0x626b('0x1d')](_0x3f321a)['then'](function(_0x4ad732){_0x23aba6[_0x626b('0x1d')]=_0x4ad732;if(_0x5215aa['query'][_0x626b('0x37')]){_0x1b99d7['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x626b('0x38')](_0x1b99d7);})[_0x626b('0x39')](function(_0x15abb5){_0x23aba6[_0x626b('0x3a')]=_0x15abb5;return _0x23aba6;})[_0x626b('0x39')](respondWithFilteredResult(_0x479376,_0x1b99d7))[_0x626b('0x3b')](handleError(_0x479376,null));};exports[_0x626b('0x3c')]=function(_0x4cc244,_0x4c0014){var _0x2cc014={'raw':!![],'where':{'id':_0x4cc244[_0x626b('0x3d')]['id']}},_0x315d10={};_0x315d10[_0x626b('0x2b')]=_['keys'](db[_0x626b('0x26')][_0x626b('0x27')]);_0x315d10['query']=_[_0x626b('0x3e')](_0x4cc244[_0x626b('0x2c')]);_0x315d10[_0x626b('0x2d')]=_[_0x626b('0x2f')](_0x315d10[_0x626b('0x2b')],_0x315d10[_0x626b('0x2c')]);_0x2cc014[_0x626b('0x2e')]=_['intersection'](_0x315d10[_0x626b('0x2b')],qs[_0x626b('0x30')](_0x4cc244['query'][_0x626b('0x30')]));_0x2cc014[_0x626b('0x2e')]=_0x2cc014[_0x626b('0x2e')][_0x626b('0x3f')]?_0x2cc014[_0x626b('0x2e')]:_0x315d10[_0x626b('0x2b')];if(_0x4cc244['query'][_0x626b('0x37')]){_0x2cc014[_0x626b('0x40')]=[{'all':!![]}];}_0x2cc014=_[_0x626b('0x35')]({},_0x2cc014,_0x4cc244[_0x626b('0x41')]);return db[_0x626b('0x26')][_0x626b('0x42')](_0x2cc014)[_0x626b('0x39')](handleEntityNotFound(_0x4c0014,null))[_0x626b('0x39')](respondWithResult(_0x4c0014,null))[_0x626b('0x3b')](handleError(_0x4c0014,null));};exports[_0x626b('0x43')]=function(_0x4da390,_0x1810fb){return db[_0x626b('0x26')][_0x626b('0x43')](_0x4da390[_0x626b('0x44')],{})['then'](respondWithResult(_0x1810fb,0xc9))['catch'](handleError(_0x1810fb,null));};exports[_0x626b('0x20')]=function(_0x57e5b5,_0x1f2a18){if(_0x57e5b5[_0x626b('0x44')]['id']){delete _0x57e5b5[_0x626b('0x44')]['id'];}return db[_0x626b('0x26')][_0x626b('0x42')]({'where':{'id':_0x57e5b5[_0x626b('0x3d')]['id']}})[_0x626b('0x39')](handleEntityNotFound(_0x1f2a18,null))['then'](saveUpdates(_0x57e5b5['body'],null))[_0x626b('0x39')](respondWithResult(_0x1f2a18,null))[_0x626b('0x3b')](handleError(_0x1f2a18,null));};exports[_0x626b('0x21')]=function(_0x4a6a3b,_0x122d2f){return db[_0x626b('0x26')][_0x626b('0x42')]({'where':{'id':_0x4a6a3b['params']['id']}})['then'](handleEntityNotFound(_0x122d2f,null))[_0x626b('0x39')](removeEntity(_0x122d2f,null))[_0x626b('0x3b')](handleError(_0x122d2f,null));};exports[_0x626b('0x45')]=function(_0xa35f67,_0x64a9ae){return db[_0x626b('0x26')][_0x626b('0x45')]()[_0x626b('0x39')](respondWithResult(_0x64a9ae,null))['catch'](handleError(_0x64a9ae,null));}; \ No newline at end of file +var _0xbdff=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x3f7101,_0x3af08b){var _0x1a30a0=function(_0x750e5b){while(--_0x750e5b){_0x3f7101['push'](_0x3f7101['shift']());}};_0x1a30a0(++_0x3af08b);}(_0xbdff,0x12c));var _0xfbdf=function(_0x34eb18,_0x4ffc3b){_0x34eb18=_0x34eb18-0x0;var _0x234bc2=_0xbdff[_0x34eb18];return _0x234bc2;};'use strict';var emlformat=require(_0xfbdf('0x0'));var rimraf=require(_0xfbdf('0x1'));var zipdir=require(_0xfbdf('0x2'));var jsonpatch=require(_0xfbdf('0x3'));var rp=require(_0xfbdf('0x4'));var moment=require(_0xfbdf('0x5'));var BPromise=require(_0xfbdf('0x6'));var Mustache=require(_0xfbdf('0x7'));var util=require(_0xfbdf('0x8'));var path=require(_0xfbdf('0x9'));var sox=require(_0xfbdf('0xa'));var csv=require(_0xfbdf('0xb'));var ejs=require(_0xfbdf('0xc'));var fs=require('fs');var fs_extra=require(_0xfbdf('0xd'));var _=require(_0xfbdf('0xe'));var squel=require(_0xfbdf('0xf'));var crypto=require(_0xfbdf('0x10'));var jsforce=require(_0xfbdf('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfbdf('0xb'));var querystring=require(_0xfbdf('0x12'));var Papa=require(_0xfbdf('0x13'));var Redis=require('ioredis');var authService=require(_0xfbdf('0x14'));var qs=require(_0xfbdf('0x15'));var as=require(_0xfbdf('0x16'));var hardwareService=require(_0xfbdf('0x17'));var logger=require(_0xfbdf('0x18'))(_0xfbdf('0x19'));var utils=require('../../config/utils');var config=require(_0xfbdf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbdf('0x1b'))['db'];function respondWithStatusCode(_0x37b670,_0x348823){_0x348823=_0x348823||0xcc;return function(_0x469cad){if(_0x469cad){return _0x37b670[_0xfbdf('0x1c')](_0x348823);}return _0x37b670[_0xfbdf('0x1d')](_0x348823)[_0xfbdf('0x1e')]();};}function respondWithResult(_0x4378ae,_0x16dc92){_0x16dc92=_0x16dc92||0xc8;return function(_0x304ad7){if(_0x304ad7){return _0x4378ae['status'](_0x16dc92)[_0xfbdf('0x1f')](_0x304ad7);}};}function respondWithFilteredResult(_0x571394,_0x3d50bb){return function(_0x4a21ae){if(_0x4a21ae){var _0x180deb=typeof _0x3d50bb[_0xfbdf('0x20')]===_0xfbdf('0x21')&&typeof _0x3d50bb[_0xfbdf('0x22')]===_0xfbdf('0x21');var _0x1e927f=_0x4a21ae['count'];var _0x618015=_0x180deb?0x0:_0x3d50bb['offset'];var _0x4a8688=_0x180deb?_0x4a21ae[_0xfbdf('0x23')]:_0x3d50bb[_0xfbdf('0x20')]+_0x3d50bb[_0xfbdf('0x22')];var _0x17b2d9;if(_0x4a8688>=_0x1e927f){_0x4a8688=_0x1e927f;_0x17b2d9=0xc8;}else{_0x17b2d9=0xce;}_0x571394['status'](_0x17b2d9);return _0x571394[_0xfbdf('0x24')](_0xfbdf('0x25'),_0x618015+'-'+_0x4a8688+'/'+_0x1e927f)['json'](_0x4a21ae);}return null;};}function patchUpdates(_0x3ba312){return function(_0x405511){try{jsonpatch['apply'](_0x405511,_0x3ba312,!![]);}catch(_0x32ed3f){return BPromise[_0xfbdf('0x26')](_0x32ed3f);}return _0x405511[_0xfbdf('0x27')]();};}function saveUpdates(_0x2d29c8,_0x1ecfb0){return function(_0x23de3e){if(_0x23de3e){return _0x23de3e['update'](_0x2d29c8)[_0xfbdf('0x28')](function(_0x258eee){return _0x258eee;});}return null;};}function removeEntity(_0xb7eb7b,_0x6ca470){return function(_0x2212d1){if(_0x2212d1){return _0x2212d1['destroy']()[_0xfbdf('0x28')](function(){_0xb7eb7b[_0xfbdf('0x1d')](0xcc)[_0xfbdf('0x1e')]();});}};}function handleEntityNotFound(_0x4822f3,_0x561826){return function(_0x1bd220){if(!_0x1bd220){_0x4822f3[_0xfbdf('0x1c')](0x194);}return _0x1bd220;};}function handleError(_0x1c007a,_0x5275cd){_0x5275cd=_0x5275cd||0x1f4;return function(_0x1474c7){logger['error'](_0x1474c7[_0xfbdf('0x29')]);if(_0x1474c7['name']){delete _0x1474c7[_0xfbdf('0x2a')];}_0x1c007a['status'](_0x5275cd)[_0xfbdf('0x2b')](_0x1474c7);};}exports[_0xfbdf('0x2c')]=function(_0xc5ab98,_0xd38de4){var _0x5d8f84={},_0x33b8b7={},_0x4d356f={'count':0x0,'rows':[]};var _0x97e0f3=_['map'](db[_0xfbdf('0x2d')][_0xfbdf('0x2e')],function(_0x4e9c4c){return{'name':_0x4e9c4c[_0xfbdf('0x2f')],'type':_0x4e9c4c[_0xfbdf('0x30')][_0xfbdf('0x31')]};});_0x33b8b7['model']=_[_0xfbdf('0x32')](_0x97e0f3,'name');_0x33b8b7[_0xfbdf('0x33')]=_[_0xfbdf('0x34')](_0xc5ab98[_0xfbdf('0x33')]);_0x33b8b7[_0xfbdf('0x35')]=_[_0xfbdf('0x36')](_0x33b8b7[_0xfbdf('0x37')],_0x33b8b7[_0xfbdf('0x33')]);_0x5d8f84[_0xfbdf('0x38')]=_[_0xfbdf('0x36')](_0x33b8b7['model'],qs['fields'](_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x39')]));_0x5d8f84['attributes']=_0x5d8f84[_0xfbdf('0x38')][_0xfbdf('0x3a')]?_0x5d8f84[_0xfbdf('0x38')]:_0x33b8b7['model'];if(!_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x3b')](_0xfbdf('0x3c'))){_0x5d8f84['limit']=qs[_0xfbdf('0x22')](_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x22')]);_0x5d8f84[_0xfbdf('0x20')]=qs['offset'](_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x20')]);}_0x5d8f84[_0xfbdf('0x3d')]=qs['sort'](_0xc5ab98['query'][_0xfbdf('0x3e')]);_0x5d8f84[_0xfbdf('0x3f')]=qs['filters'](_[_0xfbdf('0x40')](_0xc5ab98[_0xfbdf('0x33')],_0x33b8b7[_0xfbdf('0x35')]),_0x97e0f3);if(_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x41')]){_0x5d8f84[_0xfbdf('0x3f')]=_['merge'](_0x5d8f84['where'],{'$or':_[_0xfbdf('0x32')](_0x97e0f3,function(_0x589298){if(_0x589298[_0xfbdf('0x30')]!==_0xfbdf('0x42')){var _0x3ca4df={};_0x3ca4df[_0x589298[_0xfbdf('0x2a')]]={'$like':'%'+_0xc5ab98['query'][_0xfbdf('0x41')]+'%'};return _0x3ca4df;}})});}_0x5d8f84=_[_0xfbdf('0x43')]({},_0x5d8f84,_0xc5ab98[_0xfbdf('0x44')]);var _0x26de34={'where':_0x5d8f84['where']};return db['SmsTransferReport'][_0xfbdf('0x23')](_0x26de34)[_0xfbdf('0x28')](function(_0x5b189a){_0x4d356f['count']=_0x5b189a;if(_0xc5ab98[_0xfbdf('0x33')][_0xfbdf('0x45')]){_0x5d8f84[_0xfbdf('0x46')]=[{'all':!![]}];}return db[_0xfbdf('0x2d')][_0xfbdf('0x47')](_0x5d8f84);})[_0xfbdf('0x28')](function(_0x1bc706){_0x4d356f[_0xfbdf('0x48')]=_0x1bc706;return _0x4d356f;})[_0xfbdf('0x28')](respondWithFilteredResult(_0xd38de4,_0x5d8f84))['catch'](handleError(_0xd38de4,null));};exports[_0xfbdf('0x49')]=function(_0x5ecef2,_0x1e0dfe){var _0x1130e8={'raw':!![],'where':{'id':_0x5ecef2[_0xfbdf('0x4a')]['id']}},_0x4d1425={};_0x4d1425[_0xfbdf('0x37')]=_[_0xfbdf('0x34')](db[_0xfbdf('0x2d')][_0xfbdf('0x2e')]);_0x4d1425[_0xfbdf('0x33')]=_[_0xfbdf('0x34')](_0x5ecef2[_0xfbdf('0x33')]);_0x4d1425['filters']=_['intersection'](_0x4d1425[_0xfbdf('0x37')],_0x4d1425[_0xfbdf('0x33')]);_0x1130e8[_0xfbdf('0x38')]=_[_0xfbdf('0x36')](_0x4d1425[_0xfbdf('0x37')],qs[_0xfbdf('0x39')](_0x5ecef2[_0xfbdf('0x33')][_0xfbdf('0x39')]));_0x1130e8[_0xfbdf('0x38')]=_0x1130e8[_0xfbdf('0x38')][_0xfbdf('0x3a')]?_0x1130e8[_0xfbdf('0x38')]:_0x4d1425[_0xfbdf('0x37')];if(_0x5ecef2[_0xfbdf('0x33')][_0xfbdf('0x45')]){_0x1130e8[_0xfbdf('0x46')]=[{'all':!![]}];}_0x1130e8=_[_0xfbdf('0x43')]({},_0x1130e8,_0x5ecef2[_0xfbdf('0x44')]);return db[_0xfbdf('0x2d')][_0xfbdf('0x4b')](_0x1130e8)[_0xfbdf('0x28')](handleEntityNotFound(_0x1e0dfe,null))['then'](respondWithResult(_0x1e0dfe,null))[_0xfbdf('0x4c')](handleError(_0x1e0dfe,null));};exports[_0xfbdf('0x4d')]=function(_0x1a29f5,_0x113741){return db[_0xfbdf('0x2d')][_0xfbdf('0x4d')](_0x1a29f5[_0xfbdf('0x4e')],{})[_0xfbdf('0x28')](respondWithResult(_0x113741,0xc9))[_0xfbdf('0x4c')](handleError(_0x113741,null));};exports[_0xfbdf('0x4f')]=function(_0x557073,_0x51cf07){if(_0x557073['body']['id']){delete _0x557073[_0xfbdf('0x4e')]['id'];}return db[_0xfbdf('0x2d')]['find']({'where':{'id':_0x557073[_0xfbdf('0x4a')]['id']}})[_0xfbdf('0x28')](handleEntityNotFound(_0x51cf07,null))[_0xfbdf('0x28')](saveUpdates(_0x557073[_0xfbdf('0x4e')],null))['then'](respondWithResult(_0x51cf07,null))[_0xfbdf('0x4c')](handleError(_0x51cf07,null));};exports[_0xfbdf('0x50')]=function(_0xcdb0d9,_0x5d4ea8){return db[_0xfbdf('0x2d')][_0xfbdf('0x4b')]({'where':{'id':_0xcdb0d9[_0xfbdf('0x4a')]['id']}})[_0xfbdf('0x28')](handleEntityNotFound(_0x5d4ea8,null))['then'](removeEntity(_0x5d4ea8,null))['catch'](handleError(_0x5d4ea8,null));};exports[_0xfbdf('0x51')]=function(_0x1e3ff3,_0x1b7644){return db[_0xfbdf('0x2d')][_0xfbdf('0x51')]()[_0xfbdf('0x28')](respondWithResult(_0x1b7644,null))[_0xfbdf('0x4c')](handleError(_0x1b7644,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5681075..93109c0 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 _0x029b=['define','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise','path','./smsTransferReport.attributes','exports'];(function(_0x5e74ee,_0x2a4d64){var _0x20983d=function(_0x2a9374){while(--_0x2a9374){_0x5e74ee['push'](_0x5e74ee['shift']());}};_0x20983d(++_0x2a4d64);}(_0x029b,0x66));var _0xb029=function(_0x469279,_0x2ae8af){_0x469279=_0x469279-0x0;var _0x414237=_0x029b[_0x469279];return _0x414237;};'use strict';var _=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var logger=require('../../config/logger')(_0xb029('0x2'));var moment=require(_0xb029('0x3'));var BPromise=require('bluebird');var rp=require(_0xb029('0x4'));var fs=require('fs');var path=require(_0xb029('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb029('0x6'));module[_0xb029('0x7')]=function(_0x7836f0,_0x448fc5){return _0x7836f0[_0xb029('0x8')]('SmsTransferReport',attributes,{'tableName':_0xb029('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb029('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x761e=['../../config/logger','api','moment','bluebird','request-promise','path','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0x761e,0x14e));var _0xe761=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x761e[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var logger=require(_0xe761('0x2'))(_0xe761('0x3'));var moment=require(_0xe761('0x4'));var BPromise=require(_0xe761('0x5'));var rp=require(_0xe761('0x6'));var fs=require('fs');var path=require(_0xe761('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe761('0x8'));module[_0xe761('0x9')]=function(_0x4c35b7,_0xbe7b6d){return _0x4c35b7[_0xe761('0xa')](_0xe761('0xb'),attributes,{'tableName':_0xe761('0xc'),'paranoid':![],'indexes':[{'name':_0xe761('0xd'),'fields':[_0xe761('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index ee3f609..a3ba16c 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 _0xc474=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x252eb1,_0x31dbb5){var _0x2c54a0=function(_0x4d617c){while(--_0x4d617c){_0x252eb1['push'](_0x252eb1['shift']());}};_0x2c54a0(++_0x31dbb5);}(_0xc474,0xfc));var _0x4c47=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc474[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var moment=require(_0x4c47('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c47('0x3'));var fs=require('fs');var Redis=require(_0x4c47('0x4'));var db=require(_0x4c47('0x5'))['db'];var utils=require(_0x4c47('0x6'));var logger=require(_0x4c47('0x7'))(_0x4c47('0x8'));var config=require(_0x4c47('0x9'));var jayson=require(_0x4c47('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6aeef8,_0x255b6e,_0x275a64){return new BPromise(function(_0x35a093,_0x2593c2){return client['request'](_0x6aeef8,_0x275a64)[_0x4c47('0xb')](function(_0x1d2f5c){logger['info'](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));logger[_0x4c47('0xe')](_0x4c47('0xf'),_0x255b6e,'request\x20sent',JSON[_0x4c47('0x10')](_0x1d2f5c));if(_0x1d2f5c['error']){if(_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x12')]===0x1f4){logger[_0x4c47('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x2593c2(_0x1d2f5c['error'][_0x4c47('0x13')]);}logger['error'](_0x4c47('0xc'),_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x35a093(_0x1d2f5c[_0x4c47('0x11')]['message']);}else{logger[_0x4c47('0x14')](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));_0x35a093(_0x1d2f5c[_0x4c47('0x15')]['message']);}})['catch'](function(_0x5afffc){logger[_0x4c47('0x11')](_0x4c47('0xc'),_0x255b6e,_0x5afffc);_0x2593c2(_0x5afffc);});});} \ No newline at end of file +var _0x7da7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x361b37,_0xc5a7ee){var _0x80ed9b=function(_0x1b5390){while(--_0x1b5390){_0x361b37['push'](_0x361b37['shift']());}};_0x80ed9b(++_0xc5a7ee);}(_0x7da7,0x10d));var _0x77da=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7da7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){return client[_0x77da('0x9')](_0x30afe0,_0x1191de)[_0x77da('0xa')](function(_0x58f3fe){logger[_0x77da('0xb')](_0x77da('0xc'),_0x47cf1d,_0x77da('0xd'));logger['debug'](_0x77da('0xe'),_0x47cf1d,_0x77da('0xd'),JSON[_0x77da('0xf')](_0x58f3fe));if(_0x58f3fe[_0x77da('0x10')]){if(_0x58f3fe['error'][_0x77da('0x11')]===0x1f4){logger[_0x77da('0x10')](_0x77da('0xc'),_0x47cf1d,_0x58f3fe['error']['message']);return _0x37c5ab(_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);}logger['error'](_0x77da('0xc'),_0x47cf1d,_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);return _0x13992e(_0x58f3fe[_0x77da('0x10')]['message']);}else{logger[_0x77da('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x47cf1d,_0x77da('0xd'));_0x13992e(_0x58f3fe[_0x77da('0x13')][_0x77da('0x12')]);}})[_0x77da('0x14')](function(_0x4ecd98){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x47cf1d,_0x4ecd98);_0x37c5ab(_0x4ecd98);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 142c17f..0e3019c 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 _0xdf99=['basename','extname','post','single','file','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','root','server/files/sounds/original/','originalname','format','%s-%s%s'];(function(_0x2c138f,_0x2fedd8){var _0x30063d=function(_0x29b439){while(--_0x29b439){_0x2c138f['push'](_0x2c138f['shift']());}};_0x30063d(++_0x2fedd8);}(_0xdf99,0x19d));var _0x9df9=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0xdf99[_0x2d9e27];return _0xd35381;};'use strict';var multer=require(_0x9df9('0x0'));var util=require(_0x9df9('0x1'));var path=require('path');var timeout=require(_0x9df9('0x2'));var express=require(_0x9df9('0x3'));var router=express[_0x9df9('0x4')]();var fs_extra=require(_0x9df9('0x5'));var auth=require(_0x9df9('0x6'));var interaction=require(_0x9df9('0x7'));var config=require(_0x9df9('0x8'));var controller=require(_0x9df9('0x9'));router[_0x9df9('0xa')]('/',auth[_0x9df9('0xb')](),controller[_0x9df9('0xc')]);router[_0x9df9('0xa')](_0x9df9('0xd'),auth[_0x9df9('0xb')](),controller[_0x9df9('0xe')]);router[_0x9df9('0xa')]('/:id/download',auth[_0x9df9('0xb')](),controller[_0x9df9('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x427f91,_0x34eacb,_0x1475df){_0x1475df(null,path['join'](config[_0x9df9('0x10')],_0x9df9('0x11')));},'filename':function(_0x1575eb,_0x331a31,_0x28ebfe){_0x331a31[_0x9df9('0x12')]=_0x331a31[_0x9df9('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x28ebfe(null,util[_0x9df9('0x13')](_0x9df9('0x14'),path[_0x9df9('0x15')](_0x331a31[_0x9df9('0x12')],path[_0x9df9('0x16')](_0x331a31[_0x9df9('0x12')])),Date['now'](),path[_0x9df9('0x16')](_0x331a31[_0x9df9('0x12')])));}})});router[_0x9df9('0x17')]('/',upload[_0x9df9('0x18')](_0x9df9('0x19')),controller[_0x9df9('0x1a')]);router[_0x9df9('0x1b')]('/:id',auth[_0x9df9('0xb')](),controller[_0x9df9('0x1c')]);router[_0x9df9('0x1d')](_0x9df9('0xd'),auth[_0x9df9('0xb')](),controller[_0x9df9('0x1d')]);module[_0x9df9('0x1e')]=router; \ No newline at end of file +var _0xabe5=['replace','format','%s-%s%s','extname','now','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','root','server/files/sounds/original/','originalname'];(function(_0x34a34d,_0x3011d9){var _0x5a79aa=function(_0x53cbc5){while(--_0x53cbc5){_0x34a34d['push'](_0x34a34d['shift']());}};_0x5a79aa(++_0x3011d9);}(_0xabe5,0x1eb));var _0x5abe=function(_0x28109a,_0x5f4cf4){_0x28109a=_0x28109a-0x0;var _0x4fbaea=_0xabe5[_0x28109a];return _0x4fbaea;};'use strict';var multer=require(_0x5abe('0x0'));var util=require(_0x5abe('0x1'));var path=require(_0x5abe('0x2'));var timeout=require(_0x5abe('0x3'));var express=require('express');var router=express[_0x5abe('0x4')]();var fs_extra=require(_0x5abe('0x5'));var auth=require(_0x5abe('0x6'));var interaction=require(_0x5abe('0x7'));var config=require('../../config/environment');var controller=require(_0x5abe('0x8'));router[_0x5abe('0x9')]('/',auth['isAuthenticated'](),controller[_0x5abe('0xa')]);router[_0x5abe('0x9')](_0x5abe('0xb'),auth[_0x5abe('0xc')](),controller[_0x5abe('0xd')]);router['get'](_0x5abe('0xe'),auth[_0x5abe('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x5abe('0xf')]({'destination':function(_0x143c4e,_0x34d443,_0x443237){_0x443237(null,path['join'](config[_0x5abe('0x10')],_0x5abe('0x11')));},'filename':function(_0x12a251,_0x5b6a00,_0x1cc5b3){_0x5b6a00[_0x5abe('0x12')]=_0x5b6a00[_0x5abe('0x12')][_0x5abe('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1cc5b3(null,util[_0x5abe('0x14')](_0x5abe('0x15'),path['basename'](_0x5b6a00[_0x5abe('0x12')],path[_0x5abe('0x16')](_0x5b6a00[_0x5abe('0x12')])),Date[_0x5abe('0x17')](),path[_0x5abe('0x16')](_0x5b6a00[_0x5abe('0x12')])));}})});router[_0x5abe('0x18')]('/',upload['single']('file'),controller[_0x5abe('0x19')]);router[_0x5abe('0x1a')](_0x5abe('0xb'),auth[_0x5abe('0xc')](),controller[_0x5abe('0x1b')]);router['delete']('/:id',auth[_0x5abe('0xc')](),controller[_0x5abe('0x1c')]);module[_0x5abe('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c211eda..0972ff7 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 _0xa326=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xa326,0x81));var _0x6a32=function(_0x31e1e5,_0x1677a4){_0x31e1e5=_0x31e1e5-0x0;var _0x153909=_0xa326[_0x31e1e5];return _0x153909;};'use strict';var Sequelize=require(_0x6a32('0x0'));module[_0x6a32('0x1')]={'name':{'type':Sequelize[_0x6a32('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x6a32('0x2')]},'display_name':{'type':Sequelize[_0x6a32('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6a32('0x2')]},'original_format':{'type':Sequelize[_0x6a32('0x2')]},'original_duration':{'type':Sequelize[_0x6a32('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6a32('0x4')]},'original_channelCount':{'type':Sequelize[_0x6a32('0x5')]},'original_bitRate':{'type':Sequelize[_0x6a32('0x4')]},'original_sampleRate':{'type':Sequelize[_0x6a32('0x5')]},'converted_format':{'type':Sequelize[_0x6a32('0x2')]},'converted_duration':{'type':Sequelize[_0x6a32('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x6a32('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6a32('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6a32('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe678=['sequelize','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0xe678,0x1d4));var _0x8e67=function(_0x175ad1,_0x6a5922){_0x175ad1=_0x175ad1-0x0;var _0x487408=_0xe678[_0x175ad1];return _0x487408;};'use strict';var Sequelize=require(_0x8e67('0x0'));module['exports']={'name':{'type':Sequelize[_0x8e67('0x1')],'unique':_0x8e67('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8e67('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x8e67('0x3')]},'original_sampleCount':{'type':Sequelize[_0x8e67('0x4')]},'original_channelCount':{'type':Sequelize[_0x8e67('0x5')]},'original_bitRate':{'type':Sequelize[_0x8e67('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8e67('0x5')]},'converted_format':{'type':Sequelize[_0x8e67('0x1')]},'converted_duration':{'type':Sequelize[_0x8e67('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x8e67('0x5')]},'converted_bitRate':{'type':Sequelize[_0x8e67('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x8e67('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 99ee343..cbc6454 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 _0xb28c=['papaparse','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','apply','reject','get','UserProfileResource','then','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','catch','includeAll','download','find','params','converted_format','existsSync','join','ValidationError','Sound\x20not\x20found','root','server/files/sounds/converted','format','save_name','create','basename','file','extname','originalname','filename','substring','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','original_format','unlinkSync','eml-format','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2cad18,_0xb6c0e){var _0x416f2c=function(_0x57935b){while(--_0x57935b){_0x2cad18['push'](_0x2cad18['shift']());}};_0x416f2c(++_0xb6c0e);}(_0xb28c,0x169));var _0xcb28=function(_0x579090,_0x3f0550){_0x579090=_0x579090-0x0;var _0x53d71f=_0xb28c[_0x579090];return _0x53d71f;};'use strict';var emlformat=require(_0xcb28('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb28('0x1'));var rp=require('request-promise');var moment=require(_0xcb28('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcb28('0x3'));var util=require(_0xcb28('0x4'));var path=require(_0xcb28('0x5'));var sox=require('sox');var csv=require(_0xcb28('0x6'));var ejs=require(_0xcb28('0x7'));var fs=require('fs');var fs_extra=require(_0xcb28('0x8'));var _=require(_0xcb28('0x9'));var squel=require(_0xcb28('0xa'));var crypto=require(_0xcb28('0xb'));var jsforce=require(_0xcb28('0xc'));var deskjs=require(_0xcb28('0xd'));var toCsv=require(_0xcb28('0x6'));var querystring=require('querystring');var Papa=require(_0xcb28('0xe'));var Redis=require(_0xcb28('0xf'));var authService=require(_0xcb28('0x10'));var qs=require(_0xcb28('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb28('0x12'));var logger=require(_0xcb28('0x13'))(_0xcb28('0x14'));var utils=require(_0xcb28('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcb28('0x16'));var db=require(_0xcb28('0x17'))['db'];function respondWithStatusCode(_0x46c1fe,_0x4215d5){_0x4215d5=_0x4215d5||0xcc;return function(_0x18d27e){if(_0x18d27e){return _0x46c1fe[_0xcb28('0x18')](_0x4215d5);}return _0x46c1fe[_0xcb28('0x19')](_0x4215d5)[_0xcb28('0x1a')]();};}function respondWithResult(_0xc25f80,_0x335c47){_0x335c47=_0x335c47||0xc8;return function(_0x1f6328){if(_0x1f6328){return _0xc25f80['status'](_0x335c47)[_0xcb28('0x1b')](_0x1f6328);}};}function respondWithFilteredResult(_0x48438b,_0x1e58eb){return function(_0x40a430){if(_0x40a430){var _0x2ee6d5=typeof _0x1e58eb[_0xcb28('0x1c')]===_0xcb28('0x1d')&&typeof _0x1e58eb[_0xcb28('0x1e')]==='undefined';var _0x349e3a=_0x40a430[_0xcb28('0x1f')];var _0x2b0a20=_0x2ee6d5?0x0:_0x1e58eb[_0xcb28('0x1c')];var _0x327a58=_0x2ee6d5?_0x40a430['count']:_0x1e58eb['offset']+_0x1e58eb[_0xcb28('0x1e')];var _0x5b2489;if(_0x327a58>=_0x349e3a){_0x327a58=_0x349e3a;_0x5b2489=0xc8;}else{_0x5b2489=0xce;}_0x48438b[_0xcb28('0x19')](_0x5b2489);return _0x48438b[_0xcb28('0x20')](_0xcb28('0x21'),_0x2b0a20+'-'+_0x327a58+'/'+_0x349e3a)[_0xcb28('0x1b')](_0x40a430);}return null;};}function patchUpdates(_0x2f7071){return function(_0x23ca3c){try{jsonpatch[_0xcb28('0x22')](_0x23ca3c,_0x2f7071,!![]);}catch(_0x45fe05){return BPromise[_0xcb28('0x23')](_0x45fe05);}return _0x23ca3c['save']();};}function saveUpdates(_0x444e69,_0x55177e){return function(_0xb4bd63){if(_0xb4bd63){return _0xb4bd63['update'](_0x444e69)['then'](function(_0x1ffdb9){return _0x1ffdb9;});}return null;};}function removeEntity(_0x532142,_0x5b21b8){return function(_0x42cc0a){if(_0x42cc0a){return _0x42cc0a['destroy']()['then'](function(){var _0x517d7c=_0x42cc0a[_0xcb28('0x24')]({'plain':!![]});var _0x10990f='Sounds';return db[_0xcb28('0x25')]['destroy']({'where':{'type':_0x10990f,'resourceId':_0x517d7c['id']}})[_0xcb28('0x26')](function(){return _0x42cc0a;});})[_0xcb28('0x26')](function(){_0x532142[_0xcb28('0x19')](0xcc)[_0xcb28('0x1a')]();});}};}function handleEntityNotFound(_0x5af7b0,_0x2143e5){return function(_0x48a0c5){if(!_0x48a0c5){_0x5af7b0['sendStatus'](0x194);}return _0x48a0c5;};}function handleError(_0x49e866,_0x7b89c7){_0x7b89c7=_0x7b89c7||0x1f4;return function(_0x4bb316){logger[_0xcb28('0x27')](_0x4bb316[_0xcb28('0x28')]);if(_0x4bb316[_0xcb28('0x29')]){delete _0x4bb316[_0xcb28('0x29')];}_0x49e866[_0xcb28('0x19')](_0x7b89c7)[_0xcb28('0x2a')](_0x4bb316);};}exports[_0xcb28('0x2b')]=function(_0x1bb491,_0x9ddcad){var _0x35f3f0={},_0x41f68d={},_0x5547e1={'count':0x0,'rows':[]};var _0x21aa4d=_[_0xcb28('0x2c')](db[_0xcb28('0x2d')][_0xcb28('0x2e')],function(_0x12542d){return{'name':_0x12542d[_0xcb28('0x2f')],'type':_0x12542d['type'][_0xcb28('0x30')]};});_0x41f68d[_0xcb28('0x31')]=_[_0xcb28('0x2c')](_0x21aa4d,_0xcb28('0x29'));_0x41f68d[_0xcb28('0x32')]=_[_0xcb28('0x33')](_0x1bb491[_0xcb28('0x32')]);_0x41f68d[_0xcb28('0x34')]=_['intersection'](_0x41f68d['model'],_0x41f68d['query']);_0x35f3f0[_0xcb28('0x35')]=_[_0xcb28('0x36')](_0x41f68d[_0xcb28('0x31')],qs[_0xcb28('0x37')](_0x1bb491['query']['fields']));_0x35f3f0[_0xcb28('0x35')]=_0x35f3f0['attributes'][_0xcb28('0x38')]?_0x35f3f0[_0xcb28('0x35')]:_0x41f68d[_0xcb28('0x31')];if(!_0x1bb491[_0xcb28('0x32')]['hasOwnProperty'](_0xcb28('0x39'))){_0x35f3f0[_0xcb28('0x1e')]=qs['limit'](_0x1bb491['query'][_0xcb28('0x1e')]);_0x35f3f0['offset']=qs['offset'](_0x1bb491['query']['offset']);}_0x35f3f0[_0xcb28('0x3a')]=qs[_0xcb28('0x3b')](_0x1bb491[_0xcb28('0x32')][_0xcb28('0x3b')]);_0x35f3f0['where']=qs[_0xcb28('0x34')](_[_0xcb28('0x3c')](_0x1bb491[_0xcb28('0x32')],_0x41f68d[_0xcb28('0x34')]),_0x21aa4d);if(_0x1bb491[_0xcb28('0x32')]['filter']){_0x35f3f0['where']=_[_0xcb28('0x3d')](_0x35f3f0[_0xcb28('0x3e')],{'$or':_[_0xcb28('0x2c')](_0x21aa4d,function(_0x5efad4){if(_0x5efad4['type']!==_0xcb28('0x3f')){var _0x47a3b7={};_0x47a3b7[_0x5efad4[_0xcb28('0x29')]]={'$like':'%'+_0x1bb491[_0xcb28('0x32')][_0xcb28('0x40')]+'%'};return _0x47a3b7;}})});}_0x35f3f0=_[_0xcb28('0x3d')]({},_0x35f3f0,_0x1bb491[_0xcb28('0x41')]);var _0xe2847c={'where':_0x35f3f0[_0xcb28('0x3e')]};return db[_0xcb28('0x2d')]['count'](_0xe2847c)['then'](function(_0x3d42df){_0x5547e1[_0xcb28('0x1f')]=_0x3d42df;if(_0x1bb491[_0xcb28('0x32')]['includeAll']){_0x35f3f0[_0xcb28('0x42')]=[{'all':!![]}];}return db[_0xcb28('0x2d')][_0xcb28('0x43')](_0x35f3f0);})[_0xcb28('0x26')](function(_0x49d128){_0x5547e1[_0xcb28('0x44')]=_0x49d128;return _0x5547e1;})[_0xcb28('0x26')](respondWithFilteredResult(_0x9ddcad,_0x35f3f0))[_0xcb28('0x45')](handleError(_0x9ddcad,null));};exports['show']=function(_0x46d204,_0x27c4d8){var _0x4d437d={'raw':!![],'where':{'id':_0x46d204['params']['id']}},_0x4cea53={};_0x4cea53[_0xcb28('0x31')]=_[_0xcb28('0x33')](db[_0xcb28('0x2d')][_0xcb28('0x2e')]);_0x4cea53['query']=_[_0xcb28('0x33')](_0x46d204[_0xcb28('0x32')]);_0x4cea53[_0xcb28('0x34')]=_[_0xcb28('0x36')](_0x4cea53[_0xcb28('0x31')],_0x4cea53['query']);_0x4d437d[_0xcb28('0x35')]=_['intersection'](_0x4cea53[_0xcb28('0x31')],qs[_0xcb28('0x37')](_0x46d204[_0xcb28('0x32')][_0xcb28('0x37')]));_0x4d437d['attributes']=_0x4d437d[_0xcb28('0x35')]['length']?_0x4d437d[_0xcb28('0x35')]:_0x4cea53[_0xcb28('0x31')];if(_0x46d204['query'][_0xcb28('0x46')]){_0x4d437d[_0xcb28('0x42')]=[{'all':!![]}];}_0x4d437d=_[_0xcb28('0x3d')]({},_0x4d437d,_0x46d204[_0xcb28('0x41')]);return db[_0xcb28('0x2d')]['find'](_0x4d437d)[_0xcb28('0x26')](handleEntityNotFound(_0x27c4d8,null))[_0xcb28('0x26')](respondWithResult(_0x27c4d8,null))[_0xcb28('0x45')](handleError(_0x27c4d8,null));};exports[_0xcb28('0x47')]=function(_0x390053,_0x22171f,_0x3470ac){return db[_0xcb28('0x2d')][_0xcb28('0x48')]({'where':{'id':_0x390053[_0xcb28('0x49')]['id']},'attributes':['name','save_name',_0xcb28('0x4a')],'raw':!![]})[_0xcb28('0x26')](handleEntityNotFound(_0x22171f,null))[_0xcb28('0x26')](function(_0x2cabad){if(_0x2cabad){if(!fs[_0xcb28('0x4b')](path[_0xcb28('0x4c')](config['root'],'server/files/sounds/converted',_0x2cabad['save_name']+'.'+_0x2cabad['converted_format']))){throw new db['Sequelize'][(_0xcb28('0x4d'))](_0xcb28('0x4e'));}return _0x22171f[_0xcb28('0x47')](path[_0xcb28('0x4c')](config[_0xcb28('0x4f')],_0xcb28('0x50'),util[_0xcb28('0x51')]('%s.%s',_0x2cabad[_0xcb28('0x52')],_0x2cabad[_0xcb28('0x4a')])),util[_0xcb28('0x51')]('%s.%s',_0x2cabad['name'],_0x2cabad[_0xcb28('0x4a')]));}return null;})[_0xcb28('0x45')](handleError(_0x22171f,null));};exports[_0xcb28('0x53')]=function(_0x36d935,_0x48d8fe,_0x23e355){var _0x5df4b9={'name':path[_0xcb28('0x54')](_0x36d935[_0xcb28('0x55')]['originalname'],path[_0xcb28('0x56')](_0x36d935['file'][_0xcb28('0x57')])),'save_name':path[_0xcb28('0x54')](_0x36d935[_0xcb28('0x55')][_0xcb28('0x58')],path[_0xcb28('0x56')](_0x36d935[_0xcb28('0x55')][_0xcb28('0x58')])),'original_format':path['extname'](_0x36d935[_0xcb28('0x55')][_0xcb28('0x57')])[_0xcb28('0x59')](0x1),'converted_format':'wav'};var _0x581f90=path[_0xcb28('0x4c')](config[_0xcb28('0x4f')],_0xcb28('0x5a'),_0x36d935[_0xcb28('0x55')]['filename']);var _0x326409=path['join'](config[_0xcb28('0x4f')],_0xcb28('0x50'),util[_0xcb28('0x51')](_0xcb28('0x5b'),path[_0xcb28('0x54')](_0x36d935[_0xcb28('0x55')][_0xcb28('0x58')],path[_0xcb28('0x56')](_0x36d935[_0xcb28('0x55')]['filename'])),_0x5df4b9['converted_format']));logger[_0xcb28('0x5c')](_0xcb28('0x5d'),_0x581f90);logger[_0xcb28('0x5c')](_0xcb28('0x5e'),_0x326409);try{fs[_0xcb28('0x5f')](_0x581f90,parseInt(_0xcb28('0x60'),0x8));var _0x8c6c07=sox[_0xcb28('0x61')](_0x581f90,_0x326409,{'sampleRate':0x1f40,'format':_0xcb28('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x8c6c07['on'](_0xcb28('0x27'),function(_0x434cf6){fs['unlinkSync'](_0x581f90);_0x48d8fe[_0xcb28('0x19')](0x1f4)[_0xcb28('0x2a')](_0x434cf6);});_0x8c6c07['on']('src',function(_0x2f2fa5){_0x5df4b9[_0xcb28('0x63')]=isNaN(_0x2f2fa5[_0xcb28('0x64')])?null:_0x2f2fa5[_0xcb28('0x64')]*0x3e8;_0x5df4b9[_0xcb28('0x65')]=isNaN(_0x2f2fa5[_0xcb28('0x66')])?null:_0x2f2fa5[_0xcb28('0x66')];_0x5df4b9[_0xcb28('0x67')]=isNaN(_0x2f2fa5[_0xcb28('0x68')])?null:_0x2f2fa5['channelCount'];_0x5df4b9[_0xcb28('0x69')]=isNaN(_0x2f2fa5[_0xcb28('0x6a')])?null:_0x2f2fa5[_0xcb28('0x6a')];_0x5df4b9[_0xcb28('0x6b')]=isNaN(_0x2f2fa5[_0xcb28('0x6c')])?null:_0x2f2fa5[_0xcb28('0x6c')];});_0x8c6c07['on']('dest',function(_0x504b00){_0x5df4b9[_0xcb28('0x6d')]=isNaN(_0x504b00[_0xcb28('0x64')])?null:_0x504b00[_0xcb28('0x64')]*0x3e8;_0x5df4b9[_0xcb28('0x6e')]=isNaN(_0x504b00[_0xcb28('0x66')])?null:_0x504b00[_0xcb28('0x66')];_0x5df4b9[_0xcb28('0x6f')]=isNaN(_0x504b00['channelCount'])?null:_0x504b00[_0xcb28('0x68')];_0x5df4b9[_0xcb28('0x70')]=isNaN(_0x504b00[_0xcb28('0x6a')])?null:_0x504b00['bitRate'];_0x5df4b9['converted_sampleRate']=isNaN(_0x504b00[_0xcb28('0x6c')])?null:_0x504b00[_0xcb28('0x6c')];});_0x8c6c07['on'](_0xcb28('0x1a'),function(){fs[_0xcb28('0x5f')](_0x326409,parseInt(_0xcb28('0x60'),0x8));return db[_0xcb28('0x2d')][_0xcb28('0x53')](_0x5df4b9)[_0xcb28('0x26')](function(_0xb57b36){var _0x51a619={'role':_0x36d935[_0xcb28('0x71')][_0xcb28('0x72')],'userProfileId':_0x36d935[_0xcb28('0x71')][_0xcb28('0x73')]};if(!_0x51a619)throw new Error(_0xcb28('0x74'));if(_0x51a619['role']==='user'){var _0x56a9d6=_0xb57b36[_0xcb28('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xcb28('0x48')]({'where':{'name':_0xcb28('0x75'),'userProfileId':_0x51a619[_0xcb28('0x73')]},'raw':!![]})[_0xcb28('0x26')](function(_0x2f1b37){if(_0x2f1b37&&_0x2f1b37[_0xcb28('0x76')]===0x0){return db['UserProfileResource'][_0xcb28('0x53')]({'name':_0x56a9d6[_0xcb28('0x29')],'resourceId':_0x56a9d6['id'],'type':_0x2f1b37['name'],'sectionId':_0x2f1b37['id']},{})[_0xcb28('0x26')](function(){return _0xb57b36;});}else{return _0xb57b36;}})[_0xcb28('0x45')](function(_0x4dd7c3){logger['error'](_0xcb28('0x77'),_0x4dd7c3);throw _0x4dd7c3;});}return _0xb57b36;})['then'](respondWithResult(_0x48d8fe,null))[_0xcb28('0x45')](handleError(_0x48d8fe,null));});_0x8c6c07[_0xcb28('0x78')]();}catch(_0x890c9a){_0x48d8fe['status'](0x1f4)[_0xcb28('0x2a')](_0x890c9a);}};exports[_0xcb28('0x79')]=function(_0x5d88cf,_0x3a2299,_0x364694){return db[_0xcb28('0x2d')][_0xcb28('0x48')]({'where':{'id':_0x5d88cf[_0xcb28('0x49')]['id']}})[_0xcb28('0x26')](handleEntityNotFound(_0x3a2299,null))['then'](saveUpdates(_[_0xcb28('0x3c')](_0x5d88cf[_0xcb28('0x71')],[_0xcb28('0x29'),'description']),null))[_0xcb28('0x26')](respondWithResult(_0x3a2299,null))[_0xcb28('0x45')](handleError(_0x3a2299,null));};exports[_0xcb28('0x7a')]=function(_0x41f4ea,_0x2f2658,_0x46fd80){return db[_0xcb28('0x2d')][_0xcb28('0x48')]({'where':{'id':_0x41f4ea['params']['id']}})['then'](function(_0x30e663){if(_0x30e663){return _0x30e663['destroy']();}})['then'](function(_0x446bbc){var _0x5ebd87=path[_0xcb28('0x4c')](config['root'],_0xcb28('0x5a'),util[_0xcb28('0x51')](_0xcb28('0x5b'),_0x446bbc[_0xcb28('0x52')],_0x446bbc[_0xcb28('0x7b')]));var _0x168451=path[_0xcb28('0x4c')](config[_0xcb28('0x4f')],_0xcb28('0x50'),util['format'](_0xcb28('0x5b'),_0x446bbc[_0xcb28('0x52')],_0x446bbc[_0xcb28('0x4a')]));fs['unlinkSync'](_0x5ebd87);fs[_0xcb28('0x7c')](_0x168451);return _0x446bbc;})[_0xcb28('0x26')](function(_0x2865fe){if(_0x2865fe){return _0x2f2658['status'](0xcc)[_0xcb28('0x1a')]();}})[_0xcb28('0x26')](handleEntityNotFound(_0x2f2658,null))[_0xcb28('0x45')](handleError(_0x2f2658,null));}; \ No newline at end of file +var _0xd086=['rows','catch','show','include','download','find','save_name','converted_format','root','server/files/sounds/converted','Sequelize','ValidationError','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','params','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','end','error','name','send','index','map','Sound','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','findAll'];(function(_0x3b4d7a,_0x240c00){var _0x97bfa1=function(_0x4b4ab9){while(--_0x4b4ab9){_0x3b4d7a['push'](_0x3b4d7a['shift']());}};_0x97bfa1(++_0x240c00);}(_0xd086,0x130));var _0x6d08=function(_0x49527,_0x34587c){_0x49527=_0x49527-0x0;var _0x4ab74a=_0xd086[_0x49527];return _0x4ab74a;};'use strict';var emlformat=require(_0x6d08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d08('0x1'));var jsonpatch=require(_0x6d08('0x2'));var rp=require('request-promise');var moment=require(_0x6d08('0x3'));var BPromise=require(_0x6d08('0x4'));var Mustache=require('mustache');var util=require(_0x6d08('0x5'));var path=require(_0x6d08('0x6'));var sox=require('sox');var csv=require(_0x6d08('0x7'));var ejs=require(_0x6d08('0x8'));var fs=require('fs');var fs_extra=require(_0x6d08('0x9'));var _=require(_0x6d08('0xa'));var squel=require(_0x6d08('0xb'));var crypto=require(_0x6d08('0xc'));var jsforce=require(_0x6d08('0xd'));var deskjs=require(_0x6d08('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d08('0xf'));var authService=require(_0x6d08('0x10'));var qs=require(_0x6d08('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d08('0x12'));var logger=require(_0x6d08('0x13'))(_0x6d08('0x14'));var utils=require(_0x6d08('0x15'));var config=require(_0x6d08('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d08('0x17'))['db'];function respondWithStatusCode(_0x59980d,_0x395728){_0x395728=_0x395728||0xcc;return function(_0x3e712c){if(_0x3e712c){return _0x59980d[_0x6d08('0x18')](_0x395728);}return _0x59980d[_0x6d08('0x19')](_0x395728)['end']();};}function respondWithResult(_0x79c287,_0x56ceac){_0x56ceac=_0x56ceac||0xc8;return function(_0x4ca3f6){if(_0x4ca3f6){return _0x79c287[_0x6d08('0x19')](_0x56ceac)[_0x6d08('0x1a')](_0x4ca3f6);}};}function respondWithFilteredResult(_0x6e26f1,_0x1dcc55){return function(_0x480a80){if(_0x480a80){var _0x5713b4=typeof _0x1dcc55[_0x6d08('0x1b')]===_0x6d08('0x1c')&&typeof _0x1dcc55[_0x6d08('0x1d')]===_0x6d08('0x1c');var _0x2edf79=_0x480a80[_0x6d08('0x1e')];var _0x18e74e=_0x5713b4?0x0:_0x1dcc55[_0x6d08('0x1b')];var _0x40f0d8=_0x5713b4?_0x480a80['count']:_0x1dcc55[_0x6d08('0x1b')]+_0x1dcc55['limit'];var _0x203e38;if(_0x40f0d8>=_0x2edf79){_0x40f0d8=_0x2edf79;_0x203e38=0xc8;}else{_0x203e38=0xce;}_0x6e26f1[_0x6d08('0x19')](_0x203e38);return _0x6e26f1[_0x6d08('0x1f')]('Content-Range',_0x18e74e+'-'+_0x40f0d8+'/'+_0x2edf79)[_0x6d08('0x1a')](_0x480a80);}return null;};}function patchUpdates(_0x5f16f5){return function(_0x179024){try{jsonpatch[_0x6d08('0x20')](_0x179024,_0x5f16f5,!![]);}catch(_0x1b9f4f){return BPromise['reject'](_0x1b9f4f);}return _0x179024[_0x6d08('0x21')]();};}function saveUpdates(_0xc8daf2,_0x26a7df){return function(_0x41c7ed){if(_0x41c7ed){return _0x41c7ed[_0x6d08('0x22')](_0xc8daf2)[_0x6d08('0x23')](function(_0x3fdeba){return _0x3fdeba;});}return null;};}function removeEntity(_0x11097c,_0x415b02){return function(_0x382d83){if(_0x382d83){return _0x382d83[_0x6d08('0x24')]()[_0x6d08('0x23')](function(){var _0x2badd8=_0x382d83[_0x6d08('0x25')]({'plain':!![]});var _0x476201='Sounds';return db[_0x6d08('0x26')]['destroy']({'where':{'type':_0x476201,'resourceId':_0x2badd8['id']}})[_0x6d08('0x23')](function(){return _0x382d83;});})[_0x6d08('0x23')](function(){_0x11097c['status'](0xcc)[_0x6d08('0x27')]();});}};}function handleEntityNotFound(_0x478cad,_0x3e94aa){return function(_0x4a12bd){if(!_0x4a12bd){_0x478cad[_0x6d08('0x18')](0x194);}return _0x4a12bd;};}function handleError(_0x406b2d,_0x2ab8c2){_0x2ab8c2=_0x2ab8c2||0x1f4;return function(_0x324de8){logger[_0x6d08('0x28')](_0x324de8['stack']);if(_0x324de8[_0x6d08('0x29')]){delete _0x324de8[_0x6d08('0x29')];}_0x406b2d[_0x6d08('0x19')](_0x2ab8c2)[_0x6d08('0x2a')](_0x324de8);};}exports[_0x6d08('0x2b')]=function(_0x5839b0,_0x3cb508){var _0x37cd3c={},_0x4d1338={},_0x226faf={'count':0x0,'rows':[]};var _0x5a25d5=_[_0x6d08('0x2c')](db[_0x6d08('0x2d')][_0x6d08('0x2e')],function(_0x14f7a3){return{'name':_0x14f7a3[_0x6d08('0x2f')],'type':_0x14f7a3['type']['key']};});_0x4d1338[_0x6d08('0x30')]=_['map'](_0x5a25d5,_0x6d08('0x29'));_0x4d1338[_0x6d08('0x31')]=_[_0x6d08('0x32')](_0x5839b0[_0x6d08('0x31')]);_0x4d1338[_0x6d08('0x33')]=_[_0x6d08('0x34')](_0x4d1338['model'],_0x4d1338[_0x6d08('0x31')]);_0x37cd3c[_0x6d08('0x35')]=_['intersection'](_0x4d1338[_0x6d08('0x30')],qs[_0x6d08('0x36')](_0x5839b0[_0x6d08('0x31')][_0x6d08('0x36')]));_0x37cd3c[_0x6d08('0x35')]=_0x37cd3c[_0x6d08('0x35')][_0x6d08('0x37')]?_0x37cd3c[_0x6d08('0x35')]:_0x4d1338[_0x6d08('0x30')];if(!_0x5839b0[_0x6d08('0x31')][_0x6d08('0x38')]('nolimit')){_0x37cd3c[_0x6d08('0x1d')]=qs[_0x6d08('0x1d')](_0x5839b0[_0x6d08('0x31')]['limit']);_0x37cd3c['offset']=qs['offset'](_0x5839b0[_0x6d08('0x31')][_0x6d08('0x1b')]);}_0x37cd3c[_0x6d08('0x39')]=qs[_0x6d08('0x3a')](_0x5839b0[_0x6d08('0x31')]['sort']);_0x37cd3c['where']=qs[_0x6d08('0x33')](_[_0x6d08('0x3b')](_0x5839b0['query'],_0x4d1338[_0x6d08('0x33')]),_0x5a25d5);if(_0x5839b0[_0x6d08('0x31')]['filter']){_0x37cd3c[_0x6d08('0x3c')]=_[_0x6d08('0x3d')](_0x37cd3c[_0x6d08('0x3c')],{'$or':_[_0x6d08('0x2c')](_0x5a25d5,function(_0xaa6379){if(_0xaa6379[_0x6d08('0x3e')]!==_0x6d08('0x3f')){var _0x20ed1a={};_0x20ed1a[_0xaa6379[_0x6d08('0x29')]]={'$like':'%'+_0x5839b0[_0x6d08('0x31')][_0x6d08('0x40')]+'%'};return _0x20ed1a;}})});}_0x37cd3c=_[_0x6d08('0x3d')]({},_0x37cd3c,_0x5839b0[_0x6d08('0x41')]);var _0x239ef4={'where':_0x37cd3c['where']};return db[_0x6d08('0x2d')][_0x6d08('0x1e')](_0x239ef4)[_0x6d08('0x23')](function(_0x1a25c6){_0x226faf[_0x6d08('0x1e')]=_0x1a25c6;if(_0x5839b0[_0x6d08('0x31')][_0x6d08('0x42')]){_0x37cd3c['include']=[{'all':!![]}];}return db['Sound'][_0x6d08('0x43')](_0x37cd3c);})['then'](function(_0xcddcae){_0x226faf[_0x6d08('0x44')]=_0xcddcae;return _0x226faf;})[_0x6d08('0x23')](respondWithFilteredResult(_0x3cb508,_0x37cd3c))[_0x6d08('0x45')](handleError(_0x3cb508,null));};exports[_0x6d08('0x46')]=function(_0x209ae9,_0xcfaaa){var _0x4cee83={'raw':!![],'where':{'id':_0x209ae9['params']['id']}},_0x5cf7f9={};_0x5cf7f9['model']=_[_0x6d08('0x32')](db[_0x6d08('0x2d')]['rawAttributes']);_0x5cf7f9[_0x6d08('0x31')]=_['keys'](_0x209ae9[_0x6d08('0x31')]);_0x5cf7f9[_0x6d08('0x33')]=_['intersection'](_0x5cf7f9[_0x6d08('0x30')],_0x5cf7f9[_0x6d08('0x31')]);_0x4cee83['attributes']=_[_0x6d08('0x34')](_0x5cf7f9[_0x6d08('0x30')],qs[_0x6d08('0x36')](_0x209ae9[_0x6d08('0x31')][_0x6d08('0x36')]));_0x4cee83[_0x6d08('0x35')]=_0x4cee83['attributes']['length']?_0x4cee83[_0x6d08('0x35')]:_0x5cf7f9[_0x6d08('0x30')];if(_0x209ae9[_0x6d08('0x31')]['includeAll']){_0x4cee83[_0x6d08('0x47')]=[{'all':!![]}];}_0x4cee83=_[_0x6d08('0x3d')]({},_0x4cee83,_0x209ae9['options']);return db[_0x6d08('0x2d')]['find'](_0x4cee83)[_0x6d08('0x23')](handleEntityNotFound(_0xcfaaa,null))[_0x6d08('0x23')](respondWithResult(_0xcfaaa,null))[_0x6d08('0x45')](handleError(_0xcfaaa,null));};exports[_0x6d08('0x48')]=function(_0x1306e0,_0x2071b4,_0x295229){return db[_0x6d08('0x2d')][_0x6d08('0x49')]({'where':{'id':_0x1306e0['params']['id']},'attributes':[_0x6d08('0x29'),_0x6d08('0x4a'),_0x6d08('0x4b')],'raw':!![]})[_0x6d08('0x23')](handleEntityNotFound(_0x2071b4,null))[_0x6d08('0x23')](function(_0x10ae5e){if(_0x10ae5e){if(!fs['existsSync'](path['join'](config[_0x6d08('0x4c')],_0x6d08('0x4d'),_0x10ae5e[_0x6d08('0x4a')]+'.'+_0x10ae5e['converted_format']))){throw new db[(_0x6d08('0x4e'))][(_0x6d08('0x4f'))]('Sound\x20not\x20found');}return _0x2071b4[_0x6d08('0x48')](path[_0x6d08('0x50')](config[_0x6d08('0x4c')],_0x6d08('0x4d'),util[_0x6d08('0x51')]('%s.%s',_0x10ae5e[_0x6d08('0x4a')],_0x10ae5e[_0x6d08('0x4b')])),util['format'](_0x6d08('0x52'),_0x10ae5e[_0x6d08('0x29')],_0x10ae5e['converted_format']));}return null;})['catch'](handleError(_0x2071b4,null));};exports[_0x6d08('0x53')]=function(_0x27afe3,_0x227012,_0x36d166){var _0x4227af={'name':path[_0x6d08('0x54')](_0x27afe3[_0x6d08('0x55')][_0x6d08('0x56')],path[_0x6d08('0x57')](_0x27afe3[_0x6d08('0x55')][_0x6d08('0x56')])),'save_name':path[_0x6d08('0x54')](_0x27afe3['file'][_0x6d08('0x58')],path[_0x6d08('0x57')](_0x27afe3[_0x6d08('0x55')][_0x6d08('0x58')])),'original_format':path[_0x6d08('0x57')](_0x27afe3[_0x6d08('0x55')]['originalname'])[_0x6d08('0x59')](0x1),'converted_format':_0x6d08('0x5a')};var _0x3dd83c=path[_0x6d08('0x50')](config[_0x6d08('0x4c')],'server/files/sounds/original',_0x27afe3[_0x6d08('0x55')]['filename']);var _0x5a987c=path[_0x6d08('0x50')](config['root'],_0x6d08('0x4d'),util['format'](_0x6d08('0x52'),path[_0x6d08('0x54')](_0x27afe3[_0x6d08('0x55')][_0x6d08('0x58')],path['extname'](_0x27afe3[_0x6d08('0x55')][_0x6d08('0x58')])),_0x4227af[_0x6d08('0x4b')]));logger[_0x6d08('0x5b')](_0x6d08('0x5c'),_0x3dd83c);logger[_0x6d08('0x5b')](_0x6d08('0x5d'),_0x5a987c);try{fs[_0x6d08('0x5e')](_0x3dd83c,parseInt(_0x6d08('0x5f'),0x8));var _0x31517c=sox['transcode'](_0x3dd83c,_0x5a987c,{'sampleRate':0x1f40,'format':_0x6d08('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x31517c['on'](_0x6d08('0x28'),function(_0x9a32c2){fs[_0x6d08('0x60')](_0x3dd83c);_0x227012[_0x6d08('0x19')](0x1f4)[_0x6d08('0x2a')](_0x9a32c2);});_0x31517c['on']('src',function(_0x3dd683){_0x4227af[_0x6d08('0x61')]=isNaN(_0x3dd683['duration'])?null:_0x3dd683[_0x6d08('0x62')]*0x3e8;_0x4227af[_0x6d08('0x63')]=isNaN(_0x3dd683[_0x6d08('0x64')])?null:_0x3dd683[_0x6d08('0x64')];_0x4227af[_0x6d08('0x65')]=isNaN(_0x3dd683[_0x6d08('0x66')])?null:_0x3dd683[_0x6d08('0x66')];_0x4227af[_0x6d08('0x67')]=isNaN(_0x3dd683[_0x6d08('0x68')])?null:_0x3dd683[_0x6d08('0x68')];_0x4227af[_0x6d08('0x69')]=isNaN(_0x3dd683['sampleRate'])?null:_0x3dd683[_0x6d08('0x6a')];});_0x31517c['on']('dest',function(_0x4a6e5a){_0x4227af[_0x6d08('0x6b')]=isNaN(_0x4a6e5a[_0x6d08('0x62')])?null:_0x4a6e5a[_0x6d08('0x62')]*0x3e8;_0x4227af[_0x6d08('0x6c')]=isNaN(_0x4a6e5a[_0x6d08('0x64')])?null:_0x4a6e5a[_0x6d08('0x64')];_0x4227af[_0x6d08('0x6d')]=isNaN(_0x4a6e5a[_0x6d08('0x66')])?null:_0x4a6e5a[_0x6d08('0x66')];_0x4227af['converted_bitRate']=isNaN(_0x4a6e5a[_0x6d08('0x68')])?null:_0x4a6e5a[_0x6d08('0x68')];_0x4227af['converted_sampleRate']=isNaN(_0x4a6e5a[_0x6d08('0x6a')])?null:_0x4a6e5a[_0x6d08('0x6a')];});_0x31517c['on']('end',function(){fs['chmodSync'](_0x5a987c,parseInt(_0x6d08('0x5f'),0x8));return db[_0x6d08('0x2d')][_0x6d08('0x53')](_0x4227af)[_0x6d08('0x23')](function(_0x4d3dd9){var _0x379e4c={'role':_0x27afe3[_0x6d08('0x6e')][_0x6d08('0x6f')],'userProfileId':_0x27afe3[_0x6d08('0x6e')][_0x6d08('0x70')]};if(!_0x379e4c)throw new Error(_0x6d08('0x71'));if(_0x379e4c['role']===_0x6d08('0x72')){var _0x128e0e=_0x4d3dd9[_0x6d08('0x25')]({'plain':!![]});return db[_0x6d08('0x73')][_0x6d08('0x49')]({'where':{'name':_0x6d08('0x74'),'userProfileId':_0x379e4c[_0x6d08('0x70')]},'raw':!![]})['then'](function(_0x1a4009){if(_0x1a4009&&_0x1a4009[_0x6d08('0x75')]===0x0){return db[_0x6d08('0x26')][_0x6d08('0x53')]({'name':_0x128e0e[_0x6d08('0x29')],'resourceId':_0x128e0e['id'],'type':_0x1a4009[_0x6d08('0x29')],'sectionId':_0x1a4009['id']},{})[_0x6d08('0x23')](function(){return _0x4d3dd9;});}else{return _0x4d3dd9;}})[_0x6d08('0x45')](function(_0x439968){logger[_0x6d08('0x28')](_0x6d08('0x76'),_0x439968);throw _0x439968;});}return _0x4d3dd9;})['then'](respondWithResult(_0x227012,null))[_0x6d08('0x45')](handleError(_0x227012,null));});_0x31517c[_0x6d08('0x77')]();}catch(_0x3bdb7f){_0x227012['status'](0x1f4)['send'](_0x3bdb7f);}};exports[_0x6d08('0x22')]=function(_0x3940f2,_0x35d403,_0x1c68d0){return db[_0x6d08('0x2d')]['find']({'where':{'id':_0x3940f2['params']['id']}})[_0x6d08('0x23')](handleEntityNotFound(_0x35d403,null))[_0x6d08('0x23')](saveUpdates(_[_0x6d08('0x3b')](_0x3940f2[_0x6d08('0x6e')],['name',_0x6d08('0x78')]),null))[_0x6d08('0x23')](respondWithResult(_0x35d403,null))['catch'](handleError(_0x35d403,null));};exports['delete']=function(_0xbdd4b4,_0x4e91d5,_0x17ae5b){return db[_0x6d08('0x2d')]['find']({'where':{'id':_0xbdd4b4[_0x6d08('0x79')]['id']}})['then'](function(_0x4b7993){if(_0x4b7993){return _0x4b7993[_0x6d08('0x24')]();}})[_0x6d08('0x23')](function(_0x500057){var _0x49f982=path[_0x6d08('0x50')](config[_0x6d08('0x4c')],_0x6d08('0x7a'),util[_0x6d08('0x51')](_0x6d08('0x52'),_0x500057[_0x6d08('0x4a')],_0x500057[_0x6d08('0x7b')]));var _0x55aa71=path[_0x6d08('0x50')](config[_0x6d08('0x4c')],_0x6d08('0x4d'),util[_0x6d08('0x51')](_0x6d08('0x52'),_0x500057[_0x6d08('0x4a')],_0x500057[_0x6d08('0x4b')]));fs[_0x6d08('0x60')](_0x49f982);fs['unlinkSync'](_0x55aa71);return _0x500057;})[_0x6d08('0x23')](function(_0xb14b8b){if(_0xb14b8b){return _0x4e91d5[_0x6d08('0x19')](0xcc)[_0x6d08('0x27')]();}})[_0x6d08('0x23')](handleEntityNotFound(_0x4e91d5,null))[_0x6d08('0x45')](handleError(_0x4e91d5,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 8c1aefe..e8be42a 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 _0x4a9d=['tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x4a9d,0x1f0));var _0xd4a9=function(_0x36678c,_0x340c57){_0x36678c=_0x36678c-0x0;var _0x4ca13d=_0x4a9d[_0x36678c];return _0x4ca13d;};'use strict';var _=require(_0xd4a9('0x0'));var util=require('util');var logger=require(_0xd4a9('0x1'))(_0xd4a9('0x2'));var moment=require(_0xd4a9('0x3'));var BPromise=require(_0xd4a9('0x4'));var rp=require(_0xd4a9('0x5'));var fs=require('fs');var path=require(_0xd4a9('0x6'));var rimraf=require(_0xd4a9('0x7'));var config=require(_0xd4a9('0x8'));var attributes=require('./sound.attributes');module['exports']=function(_0x38a971,_0x43b087){return _0x38a971[_0xd4a9('0x9')]('Sound',attributes,{'tableName':_0xd4a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5373=['request-promise','path','rimraf','../../config/environment','Sound','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x43bd62,_0x107420){var _0x22321c=function(_0x5ed92c){while(--_0x5ed92c){_0x43bd62['push'](_0x43bd62['shift']());}};_0x22321c(++_0x107420);}(_0x5373,0x139));var _0x3537=function(_0x332f6b,_0xc61e1e){_0x332f6b=_0x332f6b-0x0;var _0x5221d5=_0x5373[_0x332f6b];return _0x5221d5;};'use strict';var _=require(_0x3537('0x0'));var util=require(_0x3537('0x1'));var logger=require(_0x3537('0x2'))(_0x3537('0x3'));var moment=require(_0x3537('0x4'));var BPromise=require(_0x3537('0x5'));var rp=require(_0x3537('0x6'));var fs=require('fs');var path=require(_0x3537('0x7'));var rimraf=require(_0x3537('0x8'));var config=require(_0x3537('0x9'));var attributes=require('./sound.attributes');module['exports']=function(_0x1d50d8,_0x59e7fa){return _0x1d50d8['define'](_0x3537('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 6048868..0e3ea93 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 _0x2c62=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util'];(function(_0x117b82,_0x13554b){var _0x3a8975=function(_0x54d531){while(--_0x54d531){_0x117b82['push'](_0x117b82['shift']());}};_0x3a8975(++_0x13554b);}(_0x2c62,0x174));var _0x22c6=function(_0x2833b8,_0x3e23bd){_0x2833b8=_0x2833b8-0x0;var _0x437bac=_0x2c62[_0x2833b8];return _0x437bac;};'use strict';var _=require(_0x22c6('0x0'));var util=require(_0x22c6('0x1'));var moment=require(_0x22c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x22c6('0x3'));var fs=require('fs');var Redis=require(_0x22c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x22c6('0x5'));var logger=require(_0x22c6('0x6'))(_0x22c6('0x7'));var config=require(_0x22c6('0x8'));var jayson=require(_0x22c6('0x9'));var client=jayson[_0x22c6('0xa')][_0x22c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c0836,_0x1a907c,_0xa38cbb){return new BPromise(function(_0x42dedd,_0x24de9c){return client[_0x22c6('0xc')](_0x3c0836,_0xa38cbb)[_0x22c6('0xd')](function(_0x6c7027){logger[_0x22c6('0xe')](_0x22c6('0xf'),_0x1a907c,_0x22c6('0x10'));logger[_0x22c6('0x11')](_0x22c6('0x12'),_0x1a907c,_0x22c6('0x10'),JSON[_0x22c6('0x13')](_0x6c7027));if(_0x6c7027[_0x22c6('0x14')]){if(_0x6c7027['error'][_0x22c6('0x15')]===0x1f4){logger[_0x22c6('0x14')](_0x22c6('0xf'),_0x1a907c,_0x6c7027[_0x22c6('0x14')][_0x22c6('0x16')]);return _0x24de9c(_0x6c7027['error']['message']);}logger[_0x22c6('0x14')](_0x22c6('0xf'),_0x1a907c,_0x6c7027[_0x22c6('0x14')]['message']);return _0x42dedd(_0x6c7027[_0x22c6('0x14')][_0x22c6('0x16')]);}else{logger[_0x22c6('0xe')](_0x22c6('0xf'),_0x1a907c,_0x22c6('0x10'));_0x42dedd(_0x6c7027['result'][_0x22c6('0x16')]);}})[_0x22c6('0x17')](function(_0x3e1e10){logger[_0x22c6('0x14')](_0x22c6('0xf'),_0x1a907c,_0x3e1e10);_0x24de9c(_0x3e1e10);});});}exports[_0x22c6('0x18')]=function(_0x2a41d8){var _0x4e5b80=this;return new Promise(function(_0x1f290e,_0x197eeb){return db[_0x22c6('0x19')][_0x22c6('0x1a')]({'raw':_0x2a41d8[_0x22c6('0x1b')]?_0x2a41d8[_0x22c6('0x1b')][_0x22c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a41d8[_0x22c6('0x1b')]?_0x2a41d8[_0x22c6('0x1b')][_0x22c6('0x1d')]||null:null,'attributes':_0x2a41d8[_0x22c6('0x1b')]?_0x2a41d8[_0x22c6('0x1b')][_0x22c6('0x1e')]||null:null,'include':_0x2a41d8[_0x22c6('0x1b')]?_0x2a41d8[_0x22c6('0x1b')][_0x22c6('0x1f')]?_[_0x22c6('0x20')](_0x2a41d8[_0x22c6('0x1b')][_0x22c6('0x1f')],function(_0xc0805d){return{'model':db[_0xc0805d[_0x22c6('0x21')]],'as':_0xc0805d['as'],'attributes':_0xc0805d[_0x22c6('0x1e')],'include':_0xc0805d[_0x22c6('0x1f')]?_['map'](_0xc0805d[_0x22c6('0x1f')],function(_0x1f79f0){return{'model':db[_0x1f79f0[_0x22c6('0x21')]],'as':_0x1f79f0['as'],'attributes':_0x1f79f0[_0x22c6('0x1e')],'include':_0x1f79f0['include']?_[_0x22c6('0x20')](_0x1f79f0['include'],function(_0x2a67f4){return{'model':db[_0x2a67f4['model']],'as':_0x2a67f4['as'],'attributes':_0x2a67f4[_0x22c6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b519){logger['info'](_0x22c6('0x18'),_0x2a41d8);logger[_0x22c6('0x11')](_0x22c6('0x18'),_0x2a41d8,JSON[_0x22c6('0x13')](_0x5b519));_0x1f290e(_0x5b519);})[_0x22c6('0x17')](function(_0x3de790){logger[_0x22c6('0x14')]('ShowSound',_0x3de790[_0x22c6('0x16')],_0x2a41d8);_0x197eeb(_0x4e5b80['error'](0x1f4,_0x3de790[_0x22c6('0x16')]));});});}; \ No newline at end of file +var _0x54ab=['model','debug','catch','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSound','Sound','find','options','raw','attributes','map','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x54ab,0x1e3));var _0xb54a=function(_0x30207d,_0x9a4466){_0x30207d=_0x30207d-0x0;var _0x282210=_0x54ab[_0x30207d];return _0x282210;};'use strict';var _=require(_0xb54a('0x0'));var util=require('util');var moment=require(_0xb54a('0x1'));var BPromise=require(_0xb54a('0x2'));var rs=require(_0xb54a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb54a('0x4'));var config=require(_0xb54a('0x5'));var jayson=require(_0xb54a('0x6'));var client=jayson[_0xb54a('0x7')][_0xb54a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d841d,_0x1094a0,_0x21c181){return new BPromise(function(_0x2b0aa6,_0x474bed){return client[_0xb54a('0x9')](_0x1d841d,_0x21c181)[_0xb54a('0xa')](function(_0x53468f){logger[_0xb54a('0xb')](_0xb54a('0xc'),_0x1094a0,_0xb54a('0xd'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x1094a0,'request\x20sent',JSON[_0xb54a('0xe')](_0x53468f));if(_0x53468f['error']){if(_0x53468f[_0xb54a('0xf')][_0xb54a('0x10')]===0x1f4){logger['error'](_0xb54a('0xc'),_0x1094a0,_0x53468f[_0xb54a('0xf')][_0xb54a('0x11')]);return _0x474bed(_0x53468f[_0xb54a('0xf')][_0xb54a('0x11')]);}logger[_0xb54a('0xf')](_0xb54a('0xc'),_0x1094a0,_0x53468f[_0xb54a('0xf')]['message']);return _0x2b0aa6(_0x53468f[_0xb54a('0xf')][_0xb54a('0x11')]);}else{logger[_0xb54a('0xb')](_0xb54a('0xc'),_0x1094a0,'request\x20sent');_0x2b0aa6(_0x53468f[_0xb54a('0x12')][_0xb54a('0x11')]);}})['catch'](function(_0x432807){logger[_0xb54a('0xf')](_0xb54a('0xc'),_0x1094a0,_0x432807);_0x474bed(_0x432807);});});}exports[_0xb54a('0x13')]=function(_0xa9ea1c){var _0xb8835b=this;return new Promise(function(_0x3f6951,_0x585ca0){return db[_0xb54a('0x14')][_0xb54a('0x15')]({'raw':_0xa9ea1c[_0xb54a('0x16')]?_0xa9ea1c[_0xb54a('0x16')][_0xb54a('0x17')]===undefined?!![]:![]:!![],'where':_0xa9ea1c[_0xb54a('0x16')]?_0xa9ea1c['options']['where']||null:null,'attributes':_0xa9ea1c[_0xb54a('0x16')]?_0xa9ea1c[_0xb54a('0x16')][_0xb54a('0x18')]||null:null,'include':_0xa9ea1c[_0xb54a('0x16')]?_0xa9ea1c[_0xb54a('0x16')]['include']?_[_0xb54a('0x19')](_0xa9ea1c[_0xb54a('0x16')][_0xb54a('0x1a')],function(_0x1346c6){return{'model':db[_0x1346c6['model']],'as':_0x1346c6['as'],'attributes':_0x1346c6[_0xb54a('0x18')],'include':_0x1346c6[_0xb54a('0x1a')]?_[_0xb54a('0x19')](_0x1346c6[_0xb54a('0x1a')],function(_0x5576ff){return{'model':db[_0x5576ff['model']],'as':_0x5576ff['as'],'attributes':_0x5576ff[_0xb54a('0x18')],'include':_0x5576ff['include']?_[_0xb54a('0x19')](_0x5576ff['include'],function(_0x5aec76){return{'model':db[_0x5aec76[_0xb54a('0x1b')]],'as':_0x5aec76['as'],'attributes':_0x5aec76['attributes']};}):[]};}):[]};}):[]:[]})[_0xb54a('0xa')](function(_0x15155e){logger[_0xb54a('0xb')]('ShowSound',_0xa9ea1c);logger[_0xb54a('0x1c')]('ShowSound',_0xa9ea1c,JSON['stringify'](_0x15155e));_0x3f6951(_0x15155e);})[_0xb54a('0x1d')](function(_0x246973){logger[_0xb54a('0xf')]('ShowSound',_0x246973[_0xb54a('0x11')],_0xa9ea1c);_0x585ca0(_0xb8835b[_0xb54a('0xf')](0x1f4,_0x246973[_0xb54a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 8ca56a0..ef9ce1d 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 _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa6985f,_0x42e952){var _0x580456=function(_0x3a8fdf){while(--_0x3a8fdf){_0xa6985f['push'](_0xa6985f['shift']());}};_0x580456(++_0x42e952);}(_0xb10b,0x12a));var _0xbb10=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xb10b[_0x34df4a];return _0x145c69;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7837ff,_0x192867){_0x7837ff=_0x7837ff-0x0;var _0x1cbbb7=_0x9ffd[_0x7837ff];return _0x1cbbb7;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index faaf0f1..d73467b 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 _0xb8f5=['out','sequelize','STRING','TEXT'];(function(_0x53ab44,_0x4bfcf1){var _0x3c807c=function(_0x393fb8){while(--_0x393fb8){_0x53ab44['push'](_0x53ab44['shift']());}};_0x3c807c(++_0x4bfcf1);}(_0xb8f5,0x1e5));var _0x5b8f=function(_0x98732d,_0x1f4a00){_0x98732d=_0x98732d-0x0;var _0x7c5b39=_0xb8f5[_0x98732d];return _0x7c5b39;};'use strict';var Sequelize=require(_0x5b8f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5b8f('0x1')]},'body':{'type':Sequelize[_0x5b8f('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x5b8f('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5b8f('0x1')]},'providerResponse':{'type':Sequelize[_0x5b8f('0x2')]}}; \ No newline at end of file +var _0x10a3=['out','STRING','TEXT','medium','ENUM'];(function(_0x4f5670,_0x3ef7e4){var _0x5a7277=function(_0x1de56f){while(--_0x1de56f){_0x4f5670['push'](_0x4f5670['shift']());}};_0x5a7277(++_0x3ef7e4);}(_0x10a3,0x13c));var _0x310a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x10a3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x310a('0x0')]},'body':{'type':Sequelize[_0x310a('0x1')](_0x310a('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x310a('0x3')]('in','out'),'defaultValue':_0x310a('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x310a('0x0')]},'providerResponse':{'type':Sequelize[_0x310a('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 8e377cc..37e3d90 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 _0xd11e=['includeAll','findAll','show','params','keys','include','find','create','body','catch','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','SquareMessage','then'];(function(_0x3d1996,_0x1f08f0){var _0x550afd=function(_0xb3b511){while(--_0xb3b511){_0x3d1996['push'](_0x3d1996['shift']());}};_0x550afd(++_0x1f08f0);}(_0xd11e,0xe6));var _0xed11=function(_0x3dfd85,_0xdb7477){_0x3dfd85=_0x3dfd85-0x0;var _0x821273=_0xd11e[_0x3dfd85];return _0x821273;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed11('0x0'));var zipdir=require(_0xed11('0x1'));var jsonpatch=require(_0xed11('0x2'));var rp=require(_0xed11('0x3'));var moment=require(_0xed11('0x4'));var BPromise=require(_0xed11('0x5'));var Mustache=require(_0xed11('0x6'));var util=require('util');var path=require(_0xed11('0x7'));var sox=require(_0xed11('0x8'));var csv=require(_0xed11('0x9'));var ejs=require(_0xed11('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed11('0xb'));var squel=require(_0xed11('0xc'));var crypto=require(_0xed11('0xd'));var jsforce=require(_0xed11('0xe'));var deskjs=require(_0xed11('0xf'));var toCsv=require(_0xed11('0x9'));var querystring=require('querystring');var Papa=require(_0xed11('0x10'));var Redis=require('ioredis');var authService=require(_0xed11('0x11'));var qs=require(_0xed11('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xed11('0x13'))(_0xed11('0x14'));var utils=require(_0xed11('0x15'));var config=require(_0xed11('0x16'));var licenseUtil=require(_0xed11('0x17'));var db=require(_0xed11('0x18'))['db'];function respondWithStatusCode(_0x1e6e0e,_0xa8f148){_0xa8f148=_0xa8f148||0xcc;return function(_0x75cfb8){if(_0x75cfb8){return _0x1e6e0e['sendStatus'](_0xa8f148);}return _0x1e6e0e[_0xed11('0x19')](_0xa8f148)['end']();};}function respondWithResult(_0x4445e9,_0x335b8e){_0x335b8e=_0x335b8e||0xc8;return function(_0x18272b){if(_0x18272b){return _0x4445e9['status'](_0x335b8e)[_0xed11('0x1a')](_0x18272b);}};}function respondWithFilteredResult(_0x59d68d,_0x478d15){return function(_0x33461f){if(_0x33461f){var _0x441dbc=typeof _0x478d15[_0xed11('0x1b')]===_0xed11('0x1c')&&typeof _0x478d15[_0xed11('0x1d')]===_0xed11('0x1c');var _0x3f335b=_0x33461f[_0xed11('0x1e')];var _0x31e500=_0x441dbc?0x0:_0x478d15['offset'];var _0x29c03a=_0x441dbc?_0x33461f['count']:_0x478d15[_0xed11('0x1b')]+_0x478d15[_0xed11('0x1d')];var _0x2cd42e;if(_0x29c03a>=_0x3f335b){_0x29c03a=_0x3f335b;_0x2cd42e=0xc8;}else{_0x2cd42e=0xce;}_0x59d68d['status'](_0x2cd42e);return _0x59d68d[_0xed11('0x1f')](_0xed11('0x20'),_0x31e500+'-'+_0x29c03a+'/'+_0x3f335b)['json'](_0x33461f);}return null;};}function patchUpdates(_0x1f3e8c){return function(_0x2ccb20){try{jsonpatch[_0xed11('0x21')](_0x2ccb20,_0x1f3e8c,!![]);}catch(_0x5c1515){return BPromise['reject'](_0x5c1515);}return _0x2ccb20['save']();};}function saveUpdates(_0x2c5f1a,_0x10bf4b){return function(_0x598456){if(_0x598456){return _0x598456['update'](_0x2c5f1a)['then'](function(_0x26108e){return _0x26108e;});}return null;};}function removeEntity(_0x2ba66a,_0x4e848e){return function(_0x402585){if(_0x402585){return _0x402585[_0xed11('0x22')]()['then'](function(){_0x2ba66a[_0xed11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454ccf,_0x1cbb1c){return function(_0x13a73e){if(!_0x13a73e){_0x454ccf[_0xed11('0x23')](0x194);}return _0x13a73e;};}function handleError(_0x59da0c,_0xa511c7){_0xa511c7=_0xa511c7||0x1f4;return function(_0x3e3328){logger[_0xed11('0x24')](_0x3e3328[_0xed11('0x25')]);if(_0x3e3328[_0xed11('0x26')]){delete _0x3e3328[_0xed11('0x26')];}_0x59da0c[_0xed11('0x19')](_0xa511c7)[_0xed11('0x27')](_0x3e3328);};}exports[_0xed11('0x28')]=function(_0x16ffca,_0xca6f9f){var _0x1b2f66={},_0x5b9baa={},_0x43678a={'count':0x0,'rows':[]};var _0x59b218=_['map'](db['SquareMessage'][_0xed11('0x29')],function(_0x12ee31){return{'name':_0x12ee31[_0xed11('0x2a')],'type':_0x12ee31['type'][_0xed11('0x2b')]};});_0x5b9baa[_0xed11('0x2c')]=_['map'](_0x59b218,_0xed11('0x26'));_0x5b9baa[_0xed11('0x2d')]=_['keys'](_0x16ffca[_0xed11('0x2d')]);_0x5b9baa[_0xed11('0x2e')]=_[_0xed11('0x2f')](_0x5b9baa[_0xed11('0x2c')],_0x5b9baa['query']);_0x1b2f66[_0xed11('0x30')]=_['intersection'](_0x5b9baa[_0xed11('0x2c')],qs[_0xed11('0x31')](_0x16ffca[_0xed11('0x2d')][_0xed11('0x31')]));_0x1b2f66[_0xed11('0x30')]=_0x1b2f66['attributes'][_0xed11('0x32')]?_0x1b2f66[_0xed11('0x30')]:_0x5b9baa[_0xed11('0x2c')];if(!_0x16ffca[_0xed11('0x2d')][_0xed11('0x33')]('nolimit')){_0x1b2f66[_0xed11('0x1d')]=qs['limit'](_0x16ffca[_0xed11('0x2d')][_0xed11('0x1d')]);_0x1b2f66[_0xed11('0x1b')]=qs['offset'](_0x16ffca[_0xed11('0x2d')][_0xed11('0x1b')]);}_0x1b2f66[_0xed11('0x34')]=qs[_0xed11('0x35')](_0x16ffca['query'][_0xed11('0x35')]);_0x1b2f66['where']=qs[_0xed11('0x2e')](_[_0xed11('0x36')](_0x16ffca['query'],_0x5b9baa[_0xed11('0x2e')]),_0x59b218);if(_0x16ffca[_0xed11('0x2d')]['filter']){_0x1b2f66[_0xed11('0x37')]=_[_0xed11('0x38')](_0x1b2f66[_0xed11('0x37')],{'$or':_['map'](_0x59b218,function(_0x54b8f2){if(_0x54b8f2['type']!==_0xed11('0x39')){var _0x8359c5={};_0x8359c5[_0x54b8f2[_0xed11('0x26')]]={'$like':'%'+_0x16ffca['query'][_0xed11('0x3a')]+'%'};return _0x8359c5;}})});}_0x1b2f66=_['merge']({},_0x1b2f66,_0x16ffca[_0xed11('0x3b')]);var _0x26404c={'where':_0x1b2f66['where']};return db[_0xed11('0x3c')][_0xed11('0x1e')](_0x26404c)[_0xed11('0x3d')](function(_0x5edcd2){_0x43678a[_0xed11('0x1e')]=_0x5edcd2;if(_0x16ffca[_0xed11('0x2d')][_0xed11('0x3e')]){_0x1b2f66['include']=[{'all':!![]}];}return db[_0xed11('0x3c')][_0xed11('0x3f')](_0x1b2f66);})[_0xed11('0x3d')](function(_0x5dc708){_0x43678a['rows']=_0x5dc708;return _0x43678a;})[_0xed11('0x3d')](respondWithFilteredResult(_0xca6f9f,_0x1b2f66))['catch'](handleError(_0xca6f9f,null));};exports[_0xed11('0x40')]=function(_0x2548ab,_0x53c9db){var _0x43082b={'raw':!![],'where':{'id':_0x2548ab[_0xed11('0x41')]['id']}},_0x133e95={};_0x133e95[_0xed11('0x2c')]=_['keys'](db[_0xed11('0x3c')][_0xed11('0x29')]);_0x133e95[_0xed11('0x2d')]=_[_0xed11('0x42')](_0x2548ab[_0xed11('0x2d')]);_0x133e95[_0xed11('0x2e')]=_['intersection'](_0x133e95['model'],_0x133e95['query']);_0x43082b['attributes']=_[_0xed11('0x2f')](_0x133e95[_0xed11('0x2c')],qs[_0xed11('0x31')](_0x2548ab['query'][_0xed11('0x31')]));_0x43082b['attributes']=_0x43082b[_0xed11('0x30')][_0xed11('0x32')]?_0x43082b['attributes']:_0x133e95['model'];if(_0x2548ab[_0xed11('0x2d')][_0xed11('0x3e')]){_0x43082b[_0xed11('0x43')]=[{'all':!![]}];}_0x43082b=_['merge']({},_0x43082b,_0x2548ab[_0xed11('0x3b')]);return db['SquareMessage'][_0xed11('0x44')](_0x43082b)[_0xed11('0x3d')](handleEntityNotFound(_0x53c9db,null))[_0xed11('0x3d')](respondWithResult(_0x53c9db,null))['catch'](handleError(_0x53c9db,null));};exports[_0xed11('0x45')]=function(_0x200966,_0x381635){return db[_0xed11('0x3c')][_0xed11('0x45')](_0x200966[_0xed11('0x46')],{})['then'](respondWithResult(_0x381635,0xc9))[_0xed11('0x47')](handleError(_0x381635,null));};exports[_0xed11('0x48')]=function(_0x3da873,_0x114256){if(_0x3da873[_0xed11('0x46')]['id']){delete _0x3da873['body']['id'];}return db[_0xed11('0x3c')][_0xed11('0x44')]({'where':{'id':_0x3da873[_0xed11('0x41')]['id']}})[_0xed11('0x3d')](handleEntityNotFound(_0x114256,null))['then'](saveUpdates(_0x3da873[_0xed11('0x46')],null))[_0xed11('0x3d')](respondWithResult(_0x114256,null))[_0xed11('0x47')](handleError(_0x114256,null));};exports[_0xed11('0x22')]=function(_0x1b675e,_0x5d159b){return db['SquareMessage'][_0xed11('0x44')]({'where':{'id':_0x1b675e[_0xed11('0x41')]['id']}})[_0xed11('0x3d')](handleEntityNotFound(_0x5d159b,null))[_0xed11('0x3d')](removeEntity(_0x5d159b,null))[_0xed11('0x47')](handleError(_0x5d159b,null));}; \ No newline at end of file +var _0xa287=['includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','SquareMessage'];(function(_0x519b10,_0x13e494){var _0x164cb3=function(_0x5e5420){while(--_0x5e5420){_0x519b10['push'](_0x519b10['shift']());}};_0x164cb3(++_0x13e494);}(_0xa287,0xe0));var _0x7a28=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0xa287[_0x5f3562];return _0x1b39b4;};'use strict';var emlformat=require(_0x7a28('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a28('0x1'));var rp=require('request-promise');var moment=require(_0x7a28('0x2'));var BPromise=require(_0x7a28('0x3'));var Mustache=require(_0x7a28('0x4'));var util=require(_0x7a28('0x5'));var path=require(_0x7a28('0x6'));var sox=require(_0x7a28('0x7'));var csv=require(_0x7a28('0x8'));var ejs=require(_0x7a28('0x9'));var fs=require('fs');var fs_extra=require(_0x7a28('0xa'));var _=require(_0x7a28('0xb'));var squel=require(_0x7a28('0xc'));var crypto=require(_0x7a28('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7a28('0xe'));var toCsv=require(_0x7a28('0x8'));var querystring=require(_0x7a28('0xf'));var Papa=require(_0x7a28('0x10'));var Redis=require('ioredis');var authService=require(_0x7a28('0x11'));var qs=require(_0x7a28('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a28('0x13'));var logger=require(_0x7a28('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7a28('0x15'));var licenseUtil=require(_0x7a28('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10ff5e,_0xf934c1){_0xf934c1=_0xf934c1||0xcc;return function(_0x5c1d55){if(_0x5c1d55){return _0x10ff5e[_0x7a28('0x17')](_0xf934c1);}return _0x10ff5e['status'](_0xf934c1)[_0x7a28('0x18')]();};}function respondWithResult(_0x3e4b8f,_0x1a7e14){_0x1a7e14=_0x1a7e14||0xc8;return function(_0xc6f7ff){if(_0xc6f7ff){return _0x3e4b8f['status'](_0x1a7e14)[_0x7a28('0x19')](_0xc6f7ff);}};}function respondWithFilteredResult(_0x1db255,_0x28c3e8){return function(_0x5b902e){if(_0x5b902e){var _0x4fccd8=typeof _0x28c3e8[_0x7a28('0x1a')]===_0x7a28('0x1b')&&typeof _0x28c3e8[_0x7a28('0x1c')]===_0x7a28('0x1b');var _0x35940f=_0x5b902e[_0x7a28('0x1d')];var _0xb1679c=_0x4fccd8?0x0:_0x28c3e8[_0x7a28('0x1a')];var _0x53c968=_0x4fccd8?_0x5b902e[_0x7a28('0x1d')]:_0x28c3e8[_0x7a28('0x1a')]+_0x28c3e8[_0x7a28('0x1c')];var _0x5a272d;if(_0x53c968>=_0x35940f){_0x53c968=_0x35940f;_0x5a272d=0xc8;}else{_0x5a272d=0xce;}_0x1db255[_0x7a28('0x1e')](_0x5a272d);return _0x1db255[_0x7a28('0x1f')]('Content-Range',_0xb1679c+'-'+_0x53c968+'/'+_0x35940f)['json'](_0x5b902e);}return null;};}function patchUpdates(_0x5d7d82){return function(_0x4fcb8b){try{jsonpatch[_0x7a28('0x20')](_0x4fcb8b,_0x5d7d82,!![]);}catch(_0x35835a){return BPromise['reject'](_0x35835a);}return _0x4fcb8b['save']();};}function saveUpdates(_0x50290e,_0x2e6006){return function(_0x27a16d){if(_0x27a16d){return _0x27a16d[_0x7a28('0x21')](_0x50290e)[_0x7a28('0x22')](function(_0x366a1c){return _0x366a1c;});}return null;};}function removeEntity(_0x4e72d9,_0x53e473){return function(_0x390288){if(_0x390288){return _0x390288['destroy']()[_0x7a28('0x22')](function(){_0x4e72d9[_0x7a28('0x1e')](0xcc)[_0x7a28('0x18')]();});}};}function handleEntityNotFound(_0x34fe9e,_0x264074){return function(_0x553564){if(!_0x553564){_0x34fe9e[_0x7a28('0x17')](0x194);}return _0x553564;};}function handleError(_0x1f48be,_0x16c22b){_0x16c22b=_0x16c22b||0x1f4;return function(_0x1db9b2){logger[_0x7a28('0x23')](_0x1db9b2[_0x7a28('0x24')]);if(_0x1db9b2[_0x7a28('0x25')]){delete _0x1db9b2[_0x7a28('0x25')];}_0x1f48be['status'](_0x16c22b)[_0x7a28('0x26')](_0x1db9b2);};}exports[_0x7a28('0x27')]=function(_0x5cfe10,_0x355f47){var _0x493615={},_0x4ed662={},_0x294f2f={'count':0x0,'rows':[]};var _0x5dd2bf=_['map'](db['SquareMessage'][_0x7a28('0x28')],function(_0x4ae416){return{'name':_0x4ae416[_0x7a28('0x29')],'type':_0x4ae416['type'][_0x7a28('0x2a')]};});_0x4ed662[_0x7a28('0x2b')]=_[_0x7a28('0x2c')](_0x5dd2bf,'name');_0x4ed662[_0x7a28('0x2d')]=_[_0x7a28('0x2e')](_0x5cfe10['query']);_0x4ed662[_0x7a28('0x2f')]=_[_0x7a28('0x30')](_0x4ed662[_0x7a28('0x2b')],_0x4ed662[_0x7a28('0x2d')]);_0x493615[_0x7a28('0x31')]=_[_0x7a28('0x30')](_0x4ed662[_0x7a28('0x2b')],qs[_0x7a28('0x32')](_0x5cfe10[_0x7a28('0x2d')][_0x7a28('0x32')]));_0x493615[_0x7a28('0x31')]=_0x493615['attributes'][_0x7a28('0x33')]?_0x493615[_0x7a28('0x31')]:_0x4ed662['model'];if(!_0x5cfe10[_0x7a28('0x2d')][_0x7a28('0x34')]('nolimit')){_0x493615[_0x7a28('0x1c')]=qs['limit'](_0x5cfe10['query'][_0x7a28('0x1c')]);_0x493615[_0x7a28('0x1a')]=qs[_0x7a28('0x1a')](_0x5cfe10['query']['offset']);}_0x493615[_0x7a28('0x35')]=qs[_0x7a28('0x36')](_0x5cfe10[_0x7a28('0x2d')][_0x7a28('0x36')]);_0x493615['where']=qs[_0x7a28('0x2f')](_['pick'](_0x5cfe10[_0x7a28('0x2d')],_0x4ed662[_0x7a28('0x2f')]),_0x5dd2bf);if(_0x5cfe10[_0x7a28('0x2d')][_0x7a28('0x37')]){_0x493615[_0x7a28('0x38')]=_[_0x7a28('0x39')](_0x493615[_0x7a28('0x38')],{'$or':_[_0x7a28('0x2c')](_0x5dd2bf,function(_0x20b8d4){if(_0x20b8d4['type']!=='VIRTUAL'){var _0x27cd34={};_0x27cd34[_0x20b8d4[_0x7a28('0x25')]]={'$like':'%'+_0x5cfe10['query'][_0x7a28('0x37')]+'%'};return _0x27cd34;}})});}_0x493615=_[_0x7a28('0x39')]({},_0x493615,_0x5cfe10[_0x7a28('0x3a')]);var _0x1daa36={'where':_0x493615[_0x7a28('0x38')]};return db[_0x7a28('0x3b')][_0x7a28('0x1d')](_0x1daa36)[_0x7a28('0x22')](function(_0x2dbc16){_0x294f2f[_0x7a28('0x1d')]=_0x2dbc16;if(_0x5cfe10[_0x7a28('0x2d')][_0x7a28('0x3c')]){_0x493615[_0x7a28('0x3d')]=[{'all':!![]}];}return db[_0x7a28('0x3b')][_0x7a28('0x3e')](_0x493615);})[_0x7a28('0x22')](function(_0x39259d){_0x294f2f[_0x7a28('0x3f')]=_0x39259d;return _0x294f2f;})[_0x7a28('0x22')](respondWithFilteredResult(_0x355f47,_0x493615))['catch'](handleError(_0x355f47,null));};exports[_0x7a28('0x40')]=function(_0x129b3a,_0x1c7d62){var _0x1140e5={'raw':!![],'where':{'id':_0x129b3a[_0x7a28('0x41')]['id']}},_0x284fa3={};_0x284fa3[_0x7a28('0x2b')]=_['keys'](db[_0x7a28('0x3b')][_0x7a28('0x28')]);_0x284fa3[_0x7a28('0x2d')]=_[_0x7a28('0x2e')](_0x129b3a['query']);_0x284fa3[_0x7a28('0x2f')]=_[_0x7a28('0x30')](_0x284fa3[_0x7a28('0x2b')],_0x284fa3[_0x7a28('0x2d')]);_0x1140e5[_0x7a28('0x31')]=_[_0x7a28('0x30')](_0x284fa3[_0x7a28('0x2b')],qs[_0x7a28('0x32')](_0x129b3a[_0x7a28('0x2d')][_0x7a28('0x32')]));_0x1140e5[_0x7a28('0x31')]=_0x1140e5[_0x7a28('0x31')][_0x7a28('0x33')]?_0x1140e5[_0x7a28('0x31')]:_0x284fa3[_0x7a28('0x2b')];if(_0x129b3a['query'][_0x7a28('0x3c')]){_0x1140e5[_0x7a28('0x3d')]=[{'all':!![]}];}_0x1140e5=_[_0x7a28('0x39')]({},_0x1140e5,_0x129b3a[_0x7a28('0x3a')]);return db[_0x7a28('0x3b')][_0x7a28('0x42')](_0x1140e5)['then'](handleEntityNotFound(_0x1c7d62,null))['then'](respondWithResult(_0x1c7d62,null))[_0x7a28('0x43')](handleError(_0x1c7d62,null));};exports[_0x7a28('0x44')]=function(_0x2d8c9e,_0x59f8f0){return db[_0x7a28('0x3b')][_0x7a28('0x44')](_0x2d8c9e[_0x7a28('0x45')],{})[_0x7a28('0x22')](respondWithResult(_0x59f8f0,0xc9))[_0x7a28('0x43')](handleError(_0x59f8f0,null));};exports[_0x7a28('0x21')]=function(_0x585a45,_0x4bf48d){if(_0x585a45[_0x7a28('0x45')]['id']){delete _0x585a45[_0x7a28('0x45')]['id'];}return db[_0x7a28('0x3b')][_0x7a28('0x42')]({'where':{'id':_0x585a45[_0x7a28('0x41')]['id']}})[_0x7a28('0x22')](handleEntityNotFound(_0x4bf48d,null))[_0x7a28('0x22')](saveUpdates(_0x585a45[_0x7a28('0x45')],null))[_0x7a28('0x22')](respondWithResult(_0x4bf48d,null))[_0x7a28('0x43')](handleError(_0x4bf48d,null));};exports[_0x7a28('0x46')]=function(_0x24d268,_0x274cfe){return db[_0x7a28('0x3b')][_0x7a28('0x42')]({'where':{'id':_0x24d268['params']['id']}})['then'](handleEntityNotFound(_0x274cfe,null))[_0x7a28('0x22')](removeEntity(_0x274cfe,null))[_0x7a28('0x43')](handleError(_0x274cfe,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b9be52e..bdbfe25 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 _0x2fbf=['request-promise','path','rimraf','../../config/environment','exports','square_messages','util','../../config/logger','api','moment','bluebird'];(function(_0x241397,_0x48176d){var _0x26456f=function(_0x2a9cc0){while(--_0x2a9cc0){_0x241397['push'](_0x241397['shift']());}};_0x26456f(++_0x48176d);}(_0x2fbf,0x15b));var _0xf2fb=function(_0x52c10b,_0x4e5667){_0x52c10b=_0x52c10b-0x0;var _0x39c479=_0x2fbf[_0x52c10b];return _0x39c479;};'use strict';var _=require('lodash');var util=require(_0xf2fb('0x0'));var logger=require(_0xf2fb('0x1'))(_0xf2fb('0x2'));var moment=require(_0xf2fb('0x3'));var BPromise=require(_0xf2fb('0x4'));var rp=require(_0xf2fb('0x5'));var fs=require('fs');var path=require(_0xf2fb('0x6'));var rimraf=require(_0xf2fb('0x7'));var config=require(_0xf2fb('0x8'));var attributes=require('./squareMessage.attributes');module[_0xf2fb('0x9')]=function(_0x3c935b,_0x44c654){return _0x3c935b['define']('SquareMessage',attributes,{'tableName':_0xf2fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9169=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SquareMessage','util','../../config/logger'];(function(_0x5b58b2,_0x4e32d4){var _0x23f5d6=function(_0x4bf5f3){while(--_0x4bf5f3){_0x5b58b2['push'](_0x5b58b2['shift']());}};_0x23f5d6(++_0x4e32d4);}(_0x9169,0xb9));var _0x9916=function(_0x23fd1b,_0x469cab){_0x23fd1b=_0x23fd1b-0x0;var _0x304e83=_0x9169[_0x23fd1b];return _0x304e83;};'use strict';var _=require('lodash');var util=require(_0x9916('0x0'));var logger=require(_0x9916('0x1'))(_0x9916('0x2'));var moment=require(_0x9916('0x3'));var BPromise=require(_0x9916('0x4'));var rp=require(_0x9916('0x5'));var fs=require('fs');var path=require(_0x9916('0x6'));var rimraf=require('rimraf');var config=require(_0x9916('0x7'));var attributes=require('./squareMessage.attributes');module[_0x9916('0x8')]=function(_0x5b7dc1,_0x217a04){return _0x5b7dc1[_0x9916('0x9')](_0x9916('0xa'),attributes,{'tableName':'square_messages','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 2146af2..acfdf9b 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 _0xeaca=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','then','stringify','lodash','bluebird'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xeaca,0x1da));var _0xaeac=function(_0x349a5b,_0x5cab1a){_0x349a5b=_0x349a5b-0x0;var _0x1875bd=_0xeaca[_0x349a5b];return _0x1875bd;};'use strict';var _=require(_0xaeac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaeac('0x1'));var rs=require(_0xaeac('0x2'));var fs=require('fs');var Redis=require(_0xaeac('0x3'));var db=require(_0xaeac('0x4'))['db'];var utils=require(_0xaeac('0x5'));var logger=require('../../config/logger')(_0xaeac('0x6'));var config=require(_0xaeac('0x7'));var jayson=require(_0xaeac('0x8'));var client=jayson[_0xaeac('0x9')][_0xaeac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44b83b,_0x3ef3bb,_0x5f3c1c){return new BPromise(function(_0x5db5a1,_0x3be650){return client['request'](_0x44b83b,_0x5f3c1c)['then'](function(_0x8c6c07){logger[_0xaeac('0xb')](_0xaeac('0xc'),_0x3ef3bb,_0xaeac('0xd'));logger[_0xaeac('0xe')](_0xaeac('0xf'),_0x3ef3bb,'request\x20sent',JSON['stringify'](_0x8c6c07));if(_0x8c6c07[_0xaeac('0x10')]){if(_0x8c6c07[_0xaeac('0x10')][_0xaeac('0x11')]===0x1f4){logger[_0xaeac('0x10')](_0xaeac('0xc'),_0x3ef3bb,_0x8c6c07['error'][_0xaeac('0x12')]);return _0x3be650(_0x8c6c07[_0xaeac('0x10')]['message']);}logger['error'](_0xaeac('0xc'),_0x3ef3bb,_0x8c6c07[_0xaeac('0x10')][_0xaeac('0x12')]);return _0x5db5a1(_0x8c6c07[_0xaeac('0x10')]['message']);}else{logger[_0xaeac('0xb')](_0xaeac('0xc'),_0x3ef3bb,_0xaeac('0xd'));_0x5db5a1(_0x8c6c07[_0xaeac('0x13')][_0xaeac('0x12')]);}})[_0xaeac('0x14')](function(_0x398ed8){logger[_0xaeac('0x10')](_0xaeac('0xc'),_0x3ef3bb,_0x398ed8);_0x3be650(_0x398ed8);});});}exports[_0xaeac('0x15')]=function(_0x1a11b6){var _0x55698a=this;return new Promise(function(_0x242d68,_0x1948d7){return db['SquareMessage'][_0xaeac('0x16')](_0x1a11b6[_0xaeac('0x17')],{'raw':_0x1a11b6[_0xaeac('0x18')]?_0x1a11b6[_0xaeac('0x18')][_0xaeac('0x19')]===undefined?!![]:![]:!![]})[_0xaeac('0x1a')](function(_0x38eb20){logger[_0xaeac('0xb')](_0xaeac('0x15'),_0x1a11b6);logger['debug']('CreateSquareMessage',_0x1a11b6,JSON[_0xaeac('0x1b')](_0x38eb20));_0x242d68(_0x38eb20);})[_0xaeac('0x14')](function(_0x263028){logger[_0xaeac('0x10')](_0xaeac('0x15'),_0x263028[_0xaeac('0x12')],_0x1a11b6);_0x1948d7(_0x55698a[_0xaeac('0x10')](0x1f4,_0x263028['message']));});});}; \ No newline at end of file +var _0x35af=['stringify','error','code','message','result','CreateSquareMessage','SquareMessage','body','options','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4fbcca,_0xcfed06){var _0x2152c8=function(_0x57df99){while(--_0x57df99){_0x4fbcca['push'](_0x4fbcca['shift']());}};_0x2152c8(++_0xcfed06);}(_0x35af,0x119));var _0xf35a=function(_0x2b0e5f,_0x437f0c){_0x2b0e5f=_0x2b0e5f-0x0;var _0x2cfa56=_0x35af[_0x2b0e5f];return _0x2cfa56;};'use strict';var _=require(_0xf35a('0x0'));var util=require(_0xf35a('0x1'));var moment=require(_0xf35a('0x2'));var BPromise=require(_0xf35a('0x3'));var rs=require(_0xf35a('0x4'));var fs=require('fs');var Redis=require(_0xf35a('0x5'));var db=require(_0xf35a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf35a('0x7'))(_0xf35a('0x8'));var config=require('../../config/environment');var jayson=require(_0xf35a('0x9'));var client=jayson[_0xf35a('0xa')][_0xf35a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a7db,_0x5636fe,_0x458d4b){return new BPromise(function(_0x1db023,_0x3fb623){return client['request'](_0x53a7db,_0x458d4b)['then'](function(_0x13d385){logger[_0xf35a('0xc')](_0xf35a('0xd'),_0x5636fe,_0xf35a('0xe'));logger['debug'](_0xf35a('0xf'),_0x5636fe,_0xf35a('0xe'),JSON[_0xf35a('0x10')](_0x13d385));if(_0x13d385[_0xf35a('0x11')]){if(_0x13d385[_0xf35a('0x11')][_0xf35a('0x12')]===0x1f4){logger[_0xf35a('0x11')]('SquareMessage,\x20%s,\x20%s',_0x5636fe,_0x13d385[_0xf35a('0x11')][_0xf35a('0x13')]);return _0x3fb623(_0x13d385['error'][_0xf35a('0x13')]);}logger[_0xf35a('0x11')](_0xf35a('0xd'),_0x5636fe,_0x13d385[_0xf35a('0x11')][_0xf35a('0x13')]);return _0x1db023(_0x13d385[_0xf35a('0x11')][_0xf35a('0x13')]);}else{logger[_0xf35a('0xc')](_0xf35a('0xd'),_0x5636fe,_0xf35a('0xe'));_0x1db023(_0x13d385[_0xf35a('0x14')][_0xf35a('0x13')]);}})['catch'](function(_0x3b53d1){logger['error'](_0xf35a('0xd'),_0x5636fe,_0x3b53d1);_0x3fb623(_0x3b53d1);});});}exports[_0xf35a('0x15')]=function(_0x9619a3){var _0x52017a=this;return new Promise(function(_0x37bfb9,_0x2b7e9e){return db[_0xf35a('0x16')]['create'](_0x9619a3[_0xf35a('0x17')],{'raw':_0x9619a3['options']?_0x9619a3[_0xf35a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf35a('0x19')](function(_0xa5979c){logger[_0xf35a('0xc')](_0xf35a('0x15'),_0x9619a3);logger[_0xf35a('0x1a')]('CreateSquareMessage',_0x9619a3,JSON[_0xf35a('0x10')](_0xa5979c));_0x37bfb9(_0xa5979c);})['catch'](function(_0x17ad3f){logger['error']('CreateSquareMessage',_0x17ad3f[_0xf35a('0x13')],_0x9619a3);_0x2b7e9e(_0x52017a[_0xf35a('0x11')](0x1f4,_0x17ad3f[_0xf35a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 56f18d4..fecfc27 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 _0x4d0d=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','put','update'];(function(_0x453c5e,_0xc3071a){var _0x5f35e8=function(_0x5b8d7b){while(--_0x5b8d7b){_0x453c5e['push'](_0x453c5e['shift']());}};_0x5f35e8(++_0xc3071a);}(_0x4d0d,0x1e4));var _0xd4d0=function(_0x3c201f,_0x5cfe31){_0x3c201f=_0x3c201f-0x0;var _0x5a0ae2=_0x4d0d[_0x3c201f];return _0x5a0ae2;};'use strict';var multer=require('multer');var util=require(_0xd4d0('0x0'));var path=require(_0xd4d0('0x1'));var timeout=require(_0xd4d0('0x2'));var express=require(_0xd4d0('0x3'));var router=express[_0xd4d0('0x4')]();var fs_extra=require(_0xd4d0('0x5'));var auth=require(_0xd4d0('0x6'));var interaction=require(_0xd4d0('0x7'));var config=require(_0xd4d0('0x8'));var controller=require(_0xd4d0('0x9'));router[_0xd4d0('0xa')]('/',auth[_0xd4d0('0xb')](),controller[_0xd4d0('0xc')]);router[_0xd4d0('0xa')](_0xd4d0('0xd'),auth[_0xd4d0('0xb')](),controller['show']);router[_0xd4d0('0xa')](_0xd4d0('0xe'),auth[_0xd4d0('0xb')](),timeout(_0xd4d0('0xf')),controller[_0xd4d0('0x10')]);router[_0xd4d0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4d0('0x12')]('/:id',auth[_0xd4d0('0xb')](),controller[_0xd4d0('0x13')]);router['delete']('/:id',auth[_0xd4d0('0xb')](),controller['destroy']);module[_0xd4d0('0x14')]=router; \ No newline at end of file +var _0xecb8=['./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','test','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x209158,_0x40756b){var _0x166f84=function(_0x57bcb6){while(--_0x57bcb6){_0x209158['push'](_0x209158['shift']());}};_0x166f84(++_0x40756b);}(_0xecb8,0x1b0));var _0x8ecb=function(_0x1cabf4,_0x2842df){_0x1cabf4=_0x1cabf4-0x0;var _0x8a7fa1=_0xecb8[_0x1cabf4];return _0x8a7fa1;};'use strict';var multer=require(_0x8ecb('0x0'));var util=require(_0x8ecb('0x1'));var path=require('path');var timeout=require(_0x8ecb('0x2'));var express=require(_0x8ecb('0x3'));var router=express[_0x8ecb('0x4')]();var fs_extra=require(_0x8ecb('0x5'));var auth=require(_0x8ecb('0x6'));var interaction=require(_0x8ecb('0x7'));var config=require(_0x8ecb('0x8'));var controller=require(_0x8ecb('0x9'));router[_0x8ecb('0xa')]('/',auth[_0x8ecb('0xb')](),controller['index']);router['get'](_0x8ecb('0xc'),auth['isAuthenticated'](),controller[_0x8ecb('0xd')]);router['get'](_0x8ecb('0xe'),auth[_0x8ecb('0xb')](),timeout(_0x8ecb('0xf')),controller[_0x8ecb('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8ecb('0x11')]);router[_0x8ecb('0x12')]('/:id',auth[_0x8ecb('0xb')](),controller[_0x8ecb('0x13')]);router['delete'](_0x8ecb('0xc'),auth[_0x8ecb('0xb')](),controller[_0x8ecb('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index d30cf5c..afb457c 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 _0x738c=['exports','STRING'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0x738c,0x1e8));var _0xc738=function(_0x24789d,_0x292a4b){_0x24789d=_0x24789d-0x0;var _0x45f2cc=_0x738c[_0x24789d];return _0x45f2cc;};'use strict';var Sequelize=require('sequelize');module[_0xc738('0x0')]={'name':{'type':Sequelize[_0xc738('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc738('0x1')]},'description':{'type':Sequelize[_0xc738('0x1')]}}; \ No newline at end of file +var _0xdcf9=['exports','STRING','name','sequelize'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xdcf9,0x7b));var _0x9dcf=function(_0x10b31d,_0x42b5c1){_0x10b31d=_0x10b31d-0x0;var _0x491f57=_0xdcf9[_0x10b31d];return _0x491f57;};'use strict';var Sequelize=require(_0x9dcf('0x0'));module[_0x9dcf('0x1')]={'name':{'type':Sequelize[_0x9dcf('0x2')],'unique':_0x9dcf('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x9dcf('0x2')]},'description':{'type':Sequelize[_0x9dcf('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index bfeeb62..4d5b01b 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 _0xd25f=['merge','VIRTUAL','filter','options','count','findAll','rows','catch','show','params','fields','includeAll','include','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','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','sendStatus','error','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','filters','attributes','intersection','query','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x16121b,_0x35817c){var _0x2942bb=function(_0x17dd74){while(--_0x17dd74){_0x16121b['push'](_0x16121b['shift']());}};_0x2942bb(++_0x35817c);}(_0xd25f,0x126));var _0xfd25=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xd25f[_0x57474e];return _0xfaae8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfd25('0x0'));var zipdir=require(_0xfd25('0x1'));var jsonpatch=require(_0xfd25('0x2'));var rp=require(_0xfd25('0x3'));var moment=require('moment');var BPromise=require(_0xfd25('0x4'));var Mustache=require(_0xfd25('0x5'));var util=require(_0xfd25('0x6'));var path=require(_0xfd25('0x7'));var sox=require('sox');var csv=require(_0xfd25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd25('0x9'));var squel=require(_0xfd25('0xa'));var crypto=require(_0xfd25('0xb'));var jsforce=require(_0xfd25('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfd25('0x8'));var querystring=require(_0xfd25('0xd'));var Papa=require(_0xfd25('0xe'));var Redis=require('ioredis');var authService=require(_0xfd25('0xf'));var qs=require(_0xfd25('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd25('0x11'));var logger=require(_0xfd25('0x12'))(_0xfd25('0x13'));var utils=require(_0xfd25('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfd25('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5946ba,_0xcf6568){_0xcf6568=_0xcf6568||0xcc;return function(_0x5260f4){if(_0x5260f4){return _0x5946ba['sendStatus'](_0xcf6568);}return _0x5946ba[_0xfd25('0x16')](_0xcf6568)[_0xfd25('0x17')]();};}function respondWithResult(_0x5d6ea3,_0x1067fa){_0x1067fa=_0x1067fa||0xc8;return function(_0x530306){if(_0x530306){return _0x5d6ea3[_0xfd25('0x16')](_0x1067fa)[_0xfd25('0x18')](_0x530306);}};}function respondWithFilteredResult(_0x16eb83,_0x14df8a){return function(_0x2dab1d){if(_0x2dab1d){var _0x12fe6d=typeof _0x14df8a[_0xfd25('0x19')]===_0xfd25('0x1a')&&typeof _0x14df8a[_0xfd25('0x1b')]==='undefined';var _0xc80fb2=_0x2dab1d['count'];var _0xfb6ece=_0x12fe6d?0x0:_0x14df8a[_0xfd25('0x19')];var _0x23d92c=_0x12fe6d?_0x2dab1d['count']:_0x14df8a['offset']+_0x14df8a[_0xfd25('0x1b')];var _0x49b633;if(_0x23d92c>=_0xc80fb2){_0x23d92c=_0xc80fb2;_0x49b633=0xc8;}else{_0x49b633=0xce;}_0x16eb83[_0xfd25('0x16')](_0x49b633);return _0x16eb83[_0xfd25('0x1c')](_0xfd25('0x1d'),_0xfb6ece+'-'+_0x23d92c+'/'+_0xc80fb2)[_0xfd25('0x18')](_0x2dab1d);}return null;};}function patchUpdates(_0x3c43a6){return function(_0x172f72){try{jsonpatch[_0xfd25('0x1e')](_0x172f72,_0x3c43a6,!![]);}catch(_0x7c8f32){return BPromise[_0xfd25('0x1f')](_0x7c8f32);}return _0x172f72[_0xfd25('0x20')]();};}function saveUpdates(_0x684e86,_0x419265){return function(_0x13a6f3){if(_0x13a6f3){return _0x13a6f3[_0xfd25('0x21')](_0x684e86)['then'](function(_0x334bb6){return _0x334bb6;});}return null;};}function removeEntity(_0x2f97c5,_0x3d008a){return function(_0x1d8a7c){if(_0x1d8a7c){return _0x1d8a7c['destroy']()[_0xfd25('0x22')](function(){var _0x492510=_0x1d8a7c[_0xfd25('0x23')]({'plain':!![]});var _0x5672c0=_0xfd25('0x24');return db[_0xfd25('0x25')][_0xfd25('0x26')]({'where':{'type':_0x5672c0,'resourceId':_0x492510['id']}})['then'](function(){return _0x1d8a7c;});})['then'](function(){_0x2f97c5[_0xfd25('0x16')](0xcc)[_0xfd25('0x17')]();});}};}function handleEntityNotFound(_0x378e6d,_0x5a70ef){return function(_0xabca15){if(!_0xabca15){_0x378e6d[_0xfd25('0x27')](0x194);}return _0xabca15;};}function handleError(_0xcb8bd0,_0xe5adc9){_0xe5adc9=_0xe5adc9||0x1f4;return function(_0x2ddd41){logger[_0xfd25('0x28')](_0x2ddd41['stack']);if(_0x2ddd41[_0xfd25('0x29')]){delete _0x2ddd41['name'];}_0xcb8bd0[_0xfd25('0x16')](_0xe5adc9)['send'](_0x2ddd41);};}exports[_0xfd25('0x2a')]=function(_0x4c0b1a,_0x344844){var _0x3c60cc={},_0x10dde4={},_0x524391={'count':0x0,'rows':[]};var _0x22a525=_[_0xfd25('0x2b')](db[_0xfd25('0x2c')][_0xfd25('0x2d')],function(_0x36b2b8){return{'name':_0x36b2b8[_0xfd25('0x2e')],'type':_0x36b2b8[_0xfd25('0x2f')][_0xfd25('0x30')]};});_0x10dde4[_0xfd25('0x31')]=_[_0xfd25('0x2b')](_0x22a525,_0xfd25('0x29'));_0x10dde4['query']=_[_0xfd25('0x32')](_0x4c0b1a['query']);_0x10dde4[_0xfd25('0x33')]=_['intersection'](_0x10dde4[_0xfd25('0x31')],_0x10dde4['query']);_0x3c60cc[_0xfd25('0x34')]=_[_0xfd25('0x35')](_0x10dde4[_0xfd25('0x31')],qs['fields'](_0x4c0b1a[_0xfd25('0x36')]['fields']));_0x3c60cc[_0xfd25('0x34')]=_0x3c60cc[_0xfd25('0x34')][_0xfd25('0x37')]?_0x3c60cc['attributes']:_0x10dde4[_0xfd25('0x31')];if(!_0x4c0b1a['query'][_0xfd25('0x38')](_0xfd25('0x39'))){_0x3c60cc[_0xfd25('0x1b')]=qs[_0xfd25('0x1b')](_0x4c0b1a[_0xfd25('0x36')][_0xfd25('0x1b')]);_0x3c60cc[_0xfd25('0x19')]=qs[_0xfd25('0x19')](_0x4c0b1a[_0xfd25('0x36')]['offset']);}_0x3c60cc[_0xfd25('0x3a')]=qs[_0xfd25('0x3b')](_0x4c0b1a['query'][_0xfd25('0x3b')]);_0x3c60cc[_0xfd25('0x3c')]=qs['filters'](_[_0xfd25('0x3d')](_0x4c0b1a[_0xfd25('0x36')],_0x10dde4[_0xfd25('0x33')]),_0x22a525);if(_0x4c0b1a['query']['filter']){_0x3c60cc[_0xfd25('0x3c')]=_[_0xfd25('0x3e')](_0x3c60cc[_0xfd25('0x3c')],{'$or':_[_0xfd25('0x2b')](_0x22a525,function(_0x39d416){if(_0x39d416[_0xfd25('0x2f')]!==_0xfd25('0x3f')){var _0x49e4bb={};_0x49e4bb[_0x39d416[_0xfd25('0x29')]]={'$like':'%'+_0x4c0b1a[_0xfd25('0x36')][_0xfd25('0x40')]+'%'};return _0x49e4bb;}})});}_0x3c60cc=_[_0xfd25('0x3e')]({},_0x3c60cc,_0x4c0b1a[_0xfd25('0x41')]);var _0x297d43={'where':_0x3c60cc['where']};return db[_0xfd25('0x2c')][_0xfd25('0x42')](_0x297d43)['then'](function(_0x21f23e){_0x524391[_0xfd25('0x42')]=_0x21f23e;if(_0x4c0b1a[_0xfd25('0x36')]['includeAll']){_0x3c60cc['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xfd25('0x43')](_0x3c60cc);})[_0xfd25('0x22')](function(_0x167510){_0x524391[_0xfd25('0x44')]=_0x167510;return _0x524391;})['then'](respondWithFilteredResult(_0x344844,_0x3c60cc))[_0xfd25('0x45')](handleError(_0x344844,null));};exports[_0xfd25('0x46')]=function(_0x55d1f3,_0x5b9ab4){var _0x28dec0={'raw':!![],'where':{'id':_0x55d1f3[_0xfd25('0x47')]['id']}},_0x58a536={};_0x58a536[_0xfd25('0x31')]=_[_0xfd25('0x32')](db[_0xfd25('0x2c')][_0xfd25('0x2d')]);_0x58a536[_0xfd25('0x36')]=_[_0xfd25('0x32')](_0x55d1f3[_0xfd25('0x36')]);_0x58a536['filters']=_[_0xfd25('0x35')](_0x58a536['model'],_0x58a536[_0xfd25('0x36')]);_0x28dec0[_0xfd25('0x34')]=_[_0xfd25('0x35')](_0x58a536[_0xfd25('0x31')],qs['fields'](_0x55d1f3[_0xfd25('0x36')][_0xfd25('0x48')]));_0x28dec0[_0xfd25('0x34')]=_0x28dec0['attributes'][_0xfd25('0x37')]?_0x28dec0['attributes']:_0x58a536['model'];if(_0x55d1f3[_0xfd25('0x36')][_0xfd25('0x49')]){_0x28dec0[_0xfd25('0x4a')]=[{'all':!![]}];}_0x28dec0=_[_0xfd25('0x3e')]({},_0x28dec0,_0x55d1f3[_0xfd25('0x41')]);return db[_0xfd25('0x2c')][_0xfd25('0x4b')](_0x28dec0)['then'](handleEntityNotFound(_0x5b9ab4,null))[_0xfd25('0x22')](respondWithResult(_0x5b9ab4,null))[_0xfd25('0x45')](handleError(_0x5b9ab4,null));};exports[_0xfd25('0x4c')]=function(_0xc8519b,_0x51058f){return db[_0xfd25('0x2c')][_0xfd25('0x4c')](_0xc8519b['body'],{})[_0xfd25('0x22')](function(_0x429f7a){var _0x2d71a6=_0xc8519b[_0xfd25('0x4d')]['get']({'plain':!![]});if(!_0x2d71a6)throw new Error(_0xfd25('0x4e'));if(_0x2d71a6[_0xfd25('0x4f')]===_0xfd25('0x4d')){var _0x4d6cd7=_0x429f7a[_0xfd25('0x23')]({'plain':!![]});var _0x25e940=_0xfd25('0x24');return db[_0xfd25('0x50')]['find']({'where':{'name':_0x25e940,'userProfileId':_0x2d71a6['userProfileId']},'raw':!![]})[_0xfd25('0x22')](function(_0x1ca790){if(_0x1ca790&&_0x1ca790[_0xfd25('0x51')]===0x0){return db['UserProfileResource'][_0xfd25('0x4c')]({'name':_0x4d6cd7[_0xfd25('0x29')],'resourceId':_0x4d6cd7['id'],'type':_0x1ca790[_0xfd25('0x29')],'sectionId':_0x1ca790['id']},{})[_0xfd25('0x22')](function(){return _0x429f7a;});}else{return _0x429f7a;}})['catch'](function(_0x2aaa91){logger['error'](_0xfd25('0x52'),_0x2aaa91);throw _0x2aaa91;});}return _0x429f7a;})[_0xfd25('0x22')](respondWithResult(_0x51058f,0xc9))[_0xfd25('0x45')](handleError(_0x51058f,null));};exports[_0xfd25('0x21')]=function(_0x35951d,_0x446098){if(_0x35951d[_0xfd25('0x53')]['id']){delete _0x35951d['body']['id'];}return db[_0xfd25('0x2c')]['find']({'where':{'id':_0x35951d[_0xfd25('0x47')]['id']}})[_0xfd25('0x22')](handleEntityNotFound(_0x446098,null))[_0xfd25('0x22')](saveUpdates(_0x35951d['body'],null))[_0xfd25('0x22')](respondWithResult(_0x446098,null))[_0xfd25('0x45')](handleError(_0x446098,null));};exports[_0xfd25('0x26')]=function(_0x14f5e1,_0x4da9db){return db[_0xfd25('0x2c')][_0xfd25('0x4b')]({'where':{'id':_0x14f5e1['params']['id']}})[_0xfd25('0x22')](handleEntityNotFound(_0x4da9db,null))[_0xfd25('0x22')](removeEntity(_0x4da9db,null))['catch'](handleError(_0x4da9db,null));};exports[_0xfd25('0x54')]=function(_0x5116c2,_0x1d95ba,_0x1c9fa0){var _0x45c2fa;return db['SquareOdbc'][_0xfd25('0x4b')]({'where':{'id':_0x5116c2[_0xfd25('0x47')]['id']},'attributes':['id',_0xfd25('0x55')]})['then'](handleEntityNotFound(_0x1d95ba,null))[_0xfd25('0x22')](function(_0x487bfa){if(_0x487bfa){var _0x1346ca=require(_0xfd25('0x56'))();_0x1346ca[_0xfd25('0x57')](_0x487bfa['dsn']);_0x1346ca[_0xfd25('0x58')]();return _0x487bfa;}})['then'](respondWithResult(_0x1d95ba,null))[_0xfd25('0x45')](handleError(_0x1d95ba,null));}; \ No newline at end of file +var _0x99ff=['fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','catch','error','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','sendStatus','stack','name','index','map','SquareOdbc','rawAttributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x99ff,0x1e5));var _0xf99f=function(_0x3eae8d,_0x331b35){_0x3eae8d=_0x3eae8d-0x0;var _0x360920=_0x99ff[_0x3eae8d];return _0x360920;};'use strict';var emlformat=require(_0xf99f('0x0'));var rimraf=require(_0xf99f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf99f('0x2'));var rp=require('request-promise');var moment=require(_0xf99f('0x3'));var BPromise=require(_0xf99f('0x4'));var Mustache=require(_0xf99f('0x5'));var util=require('util');var path=require(_0xf99f('0x6'));var sox=require('sox');var csv=require(_0xf99f('0x7'));var ejs=require(_0xf99f('0x8'));var fs=require('fs');var fs_extra=require(_0xf99f('0x9'));var _=require(_0xf99f('0xa'));var squel=require(_0xf99f('0xb'));var crypto=require(_0xf99f('0xc'));var jsforce=require(_0xf99f('0xd'));var deskjs=require(_0xf99f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf99f('0xf'));var Papa=require(_0xf99f('0x10'));var Redis=require('ioredis');var authService=require(_0xf99f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf99f('0x12'));var hardwareService=require(_0xf99f('0x13'));var logger=require(_0xf99f('0x14'))('api');var utils=require(_0xf99f('0x15'));var config=require(_0xf99f('0x16'));var licenseUtil=require(_0xf99f('0x17'));var db=require(_0xf99f('0x18'))['db'];function respondWithStatusCode(_0x2a02bb,_0x2d8229){_0x2d8229=_0x2d8229||0xcc;return function(_0x1df755){if(_0x1df755){return _0x2a02bb['sendStatus'](_0x2d8229);}return _0x2a02bb['status'](_0x2d8229)[_0xf99f('0x19')]();};}function respondWithResult(_0x4aa094,_0xe526c6){_0xe526c6=_0xe526c6||0xc8;return function(_0x23c561){if(_0x23c561){return _0x4aa094[_0xf99f('0x1a')](_0xe526c6)[_0xf99f('0x1b')](_0x23c561);}};}function respondWithFilteredResult(_0x2ae8b0,_0xa083e0){return function(_0x94caf2){if(_0x94caf2){var _0x5817de=typeof _0xa083e0[_0xf99f('0x1c')]===_0xf99f('0x1d')&&typeof _0xa083e0[_0xf99f('0x1e')]===_0xf99f('0x1d');var _0x1557c0=_0x94caf2[_0xf99f('0x1f')];var _0x17369f=_0x5817de?0x0:_0xa083e0[_0xf99f('0x1c')];var _0x5e5bcd=_0x5817de?_0x94caf2[_0xf99f('0x1f')]:_0xa083e0[_0xf99f('0x1c')]+_0xa083e0[_0xf99f('0x1e')];var _0x41846c;if(_0x5e5bcd>=_0x1557c0){_0x5e5bcd=_0x1557c0;_0x41846c=0xc8;}else{_0x41846c=0xce;}_0x2ae8b0[_0xf99f('0x1a')](_0x41846c);return _0x2ae8b0[_0xf99f('0x20')](_0xf99f('0x21'),_0x17369f+'-'+_0x5e5bcd+'/'+_0x1557c0)[_0xf99f('0x1b')](_0x94caf2);}return null;};}function patchUpdates(_0x2d8c76){return function(_0x25afbf){try{jsonpatch[_0xf99f('0x22')](_0x25afbf,_0x2d8c76,!![]);}catch(_0x529236){return BPromise[_0xf99f('0x23')](_0x529236);}return _0x25afbf[_0xf99f('0x24')]();};}function saveUpdates(_0xba446a,_0x18a843){return function(_0x3961c6){if(_0x3961c6){return _0x3961c6[_0xf99f('0x25')](_0xba446a)[_0xf99f('0x26')](function(_0x3d62b7){return _0x3d62b7;});}return null;};}function removeEntity(_0x3aa8f1,_0x117aba){return function(_0x1e1e78){if(_0x1e1e78){return _0x1e1e78[_0xf99f('0x27')]()[_0xf99f('0x26')](function(){var _0x263da8=_0x1e1e78['get']({'plain':!![]});var _0x249e94=_0xf99f('0x28');return db[_0xf99f('0x29')][_0xf99f('0x27')]({'where':{'type':_0x249e94,'resourceId':_0x263da8['id']}})[_0xf99f('0x26')](function(){return _0x1e1e78;});})['then'](function(){_0x3aa8f1['status'](0xcc)[_0xf99f('0x19')]();});}};}function handleEntityNotFound(_0x384e0f,_0x2111dd){return function(_0x333396){if(!_0x333396){_0x384e0f[_0xf99f('0x2a')](0x194);}return _0x333396;};}function handleError(_0x442990,_0x4be0e4){_0x4be0e4=_0x4be0e4||0x1f4;return function(_0x2b2cbc){logger['error'](_0x2b2cbc[_0xf99f('0x2b')]);if(_0x2b2cbc[_0xf99f('0x2c')]){delete _0x2b2cbc[_0xf99f('0x2c')];}_0x442990[_0xf99f('0x1a')](_0x4be0e4)['send'](_0x2b2cbc);};}exports[_0xf99f('0x2d')]=function(_0x3ccdf5,_0xfe0bbb){var _0x4261c3={},_0x81ac7b={},_0x2478ad={'count':0x0,'rows':[]};var _0x162298=_[_0xf99f('0x2e')](db[_0xf99f('0x2f')][_0xf99f('0x30')],function(_0x79c2d9){return{'name':_0x79c2d9[_0xf99f('0x31')],'type':_0x79c2d9[_0xf99f('0x32')][_0xf99f('0x33')]};});_0x81ac7b['model']=_['map'](_0x162298,_0xf99f('0x2c'));_0x81ac7b[_0xf99f('0x34')]=_[_0xf99f('0x35')](_0x3ccdf5[_0xf99f('0x34')]);_0x81ac7b['filters']=_[_0xf99f('0x36')](_0x81ac7b[_0xf99f('0x37')],_0x81ac7b[_0xf99f('0x34')]);_0x4261c3[_0xf99f('0x38')]=_[_0xf99f('0x36')](_0x81ac7b['model'],qs[_0xf99f('0x39')](_0x3ccdf5['query']['fields']));_0x4261c3[_0xf99f('0x38')]=_0x4261c3[_0xf99f('0x38')][_0xf99f('0x3a')]?_0x4261c3['attributes']:_0x81ac7b['model'];if(!_0x3ccdf5['query'][_0xf99f('0x3b')](_0xf99f('0x3c'))){_0x4261c3[_0xf99f('0x1e')]=qs[_0xf99f('0x1e')](_0x3ccdf5[_0xf99f('0x34')]['limit']);_0x4261c3[_0xf99f('0x1c')]=qs[_0xf99f('0x1c')](_0x3ccdf5['query'][_0xf99f('0x1c')]);}_0x4261c3['order']=qs[_0xf99f('0x3d')](_0x3ccdf5['query'][_0xf99f('0x3d')]);_0x4261c3[_0xf99f('0x3e')]=qs[_0xf99f('0x3f')](_['pick'](_0x3ccdf5['query'],_0x81ac7b[_0xf99f('0x3f')]),_0x162298);if(_0x3ccdf5['query'][_0xf99f('0x40')]){_0x4261c3[_0xf99f('0x3e')]=_['merge'](_0x4261c3[_0xf99f('0x3e')],{'$or':_[_0xf99f('0x2e')](_0x162298,function(_0x372453){if(_0x372453[_0xf99f('0x32')]!==_0xf99f('0x41')){var _0x38e5bc={};_0x38e5bc[_0x372453[_0xf99f('0x2c')]]={'$like':'%'+_0x3ccdf5[_0xf99f('0x34')]['filter']+'%'};return _0x38e5bc;}})});}_0x4261c3=_[_0xf99f('0x42')]({},_0x4261c3,_0x3ccdf5[_0xf99f('0x43')]);var _0x157326={'where':_0x4261c3[_0xf99f('0x3e')]};return db[_0xf99f('0x2f')]['count'](_0x157326)['then'](function(_0x3c1403){_0x2478ad['count']=_0x3c1403;if(_0x3ccdf5[_0xf99f('0x34')][_0xf99f('0x44')]){_0x4261c3[_0xf99f('0x45')]=[{'all':!![]}];}return db[_0xf99f('0x2f')][_0xf99f('0x46')](_0x4261c3);})['then'](function(_0x3dcb91){_0x2478ad['rows']=_0x3dcb91;return _0x2478ad;})[_0xf99f('0x26')](respondWithFilteredResult(_0xfe0bbb,_0x4261c3))['catch'](handleError(_0xfe0bbb,null));};exports[_0xf99f('0x47')]=function(_0x43b770,_0x256be9){var _0x3254cd={'raw':!![],'where':{'id':_0x43b770[_0xf99f('0x48')]['id']}},_0x37cdf0={};_0x37cdf0['model']=_[_0xf99f('0x35')](db[_0xf99f('0x2f')]['rawAttributes']);_0x37cdf0['query']=_[_0xf99f('0x35')](_0x43b770[_0xf99f('0x34')]);_0x37cdf0[_0xf99f('0x3f')]=_[_0xf99f('0x36')](_0x37cdf0['model'],_0x37cdf0[_0xf99f('0x34')]);_0x3254cd[_0xf99f('0x38')]=_[_0xf99f('0x36')](_0x37cdf0[_0xf99f('0x37')],qs[_0xf99f('0x39')](_0x43b770[_0xf99f('0x34')]['fields']));_0x3254cd['attributes']=_0x3254cd[_0xf99f('0x38')][_0xf99f('0x3a')]?_0x3254cd['attributes']:_0x37cdf0[_0xf99f('0x37')];if(_0x43b770[_0xf99f('0x34')][_0xf99f('0x44')]){_0x3254cd[_0xf99f('0x45')]=[{'all':!![]}];}_0x3254cd=_[_0xf99f('0x42')]({},_0x3254cd,_0x43b770['options']);return db[_0xf99f('0x2f')]['find'](_0x3254cd)[_0xf99f('0x26')](handleEntityNotFound(_0x256be9,null))[_0xf99f('0x26')](respondWithResult(_0x256be9,null))['catch'](handleError(_0x256be9,null));};exports[_0xf99f('0x49')]=function(_0x10cb0d,_0x24dda8){return db[_0xf99f('0x2f')][_0xf99f('0x49')](_0x10cb0d[_0xf99f('0x4a')],{})['then'](function(_0xa290e7){var _0x362c3e=_0x10cb0d[_0xf99f('0x4b')][_0xf99f('0x4c')]({'plain':!![]});if(!_0x362c3e)throw new Error(_0xf99f('0x4d'));if(_0x362c3e[_0xf99f('0x4e')]===_0xf99f('0x4b')){var _0x551a56=_0xa290e7[_0xf99f('0x4c')]({'plain':!![]});var _0x4945f5=_0xf99f('0x28');return db[_0xf99f('0x4f')][_0xf99f('0x50')]({'where':{'name':_0x4945f5,'userProfileId':_0x362c3e['userProfileId']},'raw':!![]})[_0xf99f('0x26')](function(_0x26cea3){if(_0x26cea3&&_0x26cea3[_0xf99f('0x51')]===0x0){return db[_0xf99f('0x29')]['create']({'name':_0x551a56[_0xf99f('0x2c')],'resourceId':_0x551a56['id'],'type':_0x26cea3['name'],'sectionId':_0x26cea3['id']},{})[_0xf99f('0x26')](function(){return _0xa290e7;});}else{return _0xa290e7;}})[_0xf99f('0x52')](function(_0xbc4f8e){logger[_0xf99f('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbc4f8e);throw _0xbc4f8e;});}return _0xa290e7;})['then'](respondWithResult(_0x24dda8,0xc9))[_0xf99f('0x52')](handleError(_0x24dda8,null));};exports[_0xf99f('0x25')]=function(_0x3b760c,_0x27cba3){if(_0x3b760c[_0xf99f('0x4a')]['id']){delete _0x3b760c[_0xf99f('0x4a')]['id'];}return db['SquareOdbc'][_0xf99f('0x50')]({'where':{'id':_0x3b760c[_0xf99f('0x48')]['id']}})[_0xf99f('0x26')](handleEntityNotFound(_0x27cba3,null))[_0xf99f('0x26')](saveUpdates(_0x3b760c[_0xf99f('0x4a')],null))[_0xf99f('0x26')](respondWithResult(_0x27cba3,null))['catch'](handleError(_0x27cba3,null));};exports[_0xf99f('0x27')]=function(_0x2ff08d,_0xfc818c){return db[_0xf99f('0x2f')][_0xf99f('0x50')]({'where':{'id':_0x2ff08d[_0xf99f('0x48')]['id']}})[_0xf99f('0x26')](handleEntityNotFound(_0xfc818c,null))[_0xf99f('0x26')](removeEntity(_0xfc818c,null))[_0xf99f('0x52')](handleError(_0xfc818c,null));};exports[_0xf99f('0x54')]=function(_0x3f94f9,_0x2a362c,_0x4ea270){var _0x402492;return db[_0xf99f('0x2f')]['find']({'where':{'id':_0x3f94f9[_0xf99f('0x48')]['id']},'attributes':['id',_0xf99f('0x55')]})['then'](handleEntityNotFound(_0x2a362c,null))[_0xf99f('0x26')](function(_0x4bf398){if(_0x4bf398){var _0x2db7a7=require(_0xf99f('0x56'))();_0x2db7a7[_0xf99f('0x57')](_0x4bf398[_0xf99f('0x55')]);_0x2db7a7[_0xf99f('0x58')]();return _0x4bf398;}})['then'](respondWithResult(_0x2a362c,null))['catch'](handleError(_0x2a362c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c42d5d6..e37a77e 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 _0x0e5e=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x0e5e,0xd0));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var logger=require(_0xe0e5('0x2'))(_0xe0e5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0e5('0x5'));var config=require(_0xe0e5('0x6'));var attributes=require('./squareOdbc.attributes');module[_0xe0e5('0x7')]=function(_0x57e216,_0x4d5b42){return _0x57e216[_0xe0e5('0x8')](_0xe0e5('0x9'),attributes,{'tableName':_0xe0e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a33=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','bluebird'];(function(_0x1e7e85,_0x5c747f){var _0x2f15b1=function(_0x24f14a){while(--_0x24f14a){_0x1e7e85['push'](_0x1e7e85['shift']());}};_0x2f15b1(++_0x5c747f);}(_0x6a33,0x1ad));var _0x36a3=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x6a33[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x36a3('0x0'));var util=require(_0x36a3('0x1'));var logger=require(_0x36a3('0x2'))(_0x36a3('0x3'));var moment=require('moment');var BPromise=require(_0x36a3('0x4'));var rp=require(_0x36a3('0x5'));var fs=require('fs');var path=require(_0x36a3('0x6'));var rimraf=require(_0x36a3('0x7'));var config=require(_0x36a3('0x8'));var attributes=require(_0x36a3('0x9'));module[_0x36a3('0xa')]=function(_0x9f5a10,_0x2ae6e0){return _0x9f5a10[_0x36a3('0xb')](_0x36a3('0xc'),attributes,{'tableName':_0x36a3('0xd'),'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 dd6a557..a907041 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 _0x1a91=['jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','include','model','map','ShowSquareOdbc','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x325bc4,_0x4df462){var _0x330091=function(_0x22db60){while(--_0x22db60){_0x325bc4['push'](_0x325bc4['shift']());}};_0x330091(++_0x4df462);}(_0x1a91,0x1e9));var _0x11a9=function(_0x57cf4e,_0x3d855c){_0x57cf4e=_0x57cf4e-0x0;var _0x10b4f5=_0x1a91[_0x57cf4e];return _0x10b4f5;};'use strict';var _=require(_0x11a9('0x0'));var util=require(_0x11a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11a9('0x2'));var fs=require('fs');var Redis=require(_0x11a9('0x3'));var db=require(_0x11a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x11a9('0x5'))('rpc');var config=require(_0x11a9('0x6'));var jayson=require(_0x11a9('0x7'));var client=jayson[_0x11a9('0x8')][_0x11a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24ae34,_0x3f35ea,_0x297a82){return new BPromise(function(_0x5dd9f6,_0x4d514c){return client[_0x11a9('0xa')](_0x24ae34,_0x297a82)[_0x11a9('0xb')](function(_0x31f60d){logger[_0x11a9('0xc')](_0x11a9('0xd'),_0x3f35ea,_0x11a9('0xe'));logger['debug'](_0x11a9('0xf'),_0x3f35ea,_0x11a9('0xe'),JSON[_0x11a9('0x10')](_0x31f60d));if(_0x31f60d[_0x11a9('0x11')]){if(_0x31f60d['error'][_0x11a9('0x12')]===0x1f4){logger['error'](_0x11a9('0xd'),_0x3f35ea,_0x31f60d[_0x11a9('0x11')][_0x11a9('0x13')]);return _0x4d514c(_0x31f60d[_0x11a9('0x11')]['message']);}logger['error'](_0x11a9('0xd'),_0x3f35ea,_0x31f60d[_0x11a9('0x11')]['message']);return _0x5dd9f6(_0x31f60d[_0x11a9('0x11')][_0x11a9('0x13')]);}else{logger[_0x11a9('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x3f35ea,_0x11a9('0xe'));_0x5dd9f6(_0x31f60d[_0x11a9('0x14')][_0x11a9('0x13')]);}})[_0x11a9('0x15')](function(_0x493c1b){logger[_0x11a9('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x3f35ea,_0x493c1b);_0x4d514c(_0x493c1b);});});}exports['ShowSquareOdbc']=function(_0x304b39){var _0x3cd4fd=this;return new Promise(function(_0x9844fb,_0x40f41b){return db['SquareOdbc']['find']({'raw':_0x304b39[_0x11a9('0x16')]?_0x304b39['options'][_0x11a9('0x17')]===undefined?!![]:![]:!![],'where':_0x304b39['options']?_0x304b39[_0x11a9('0x16')][_0x11a9('0x18')]||null:null,'attributes':_0x304b39[_0x11a9('0x16')]?_0x304b39[_0x11a9('0x16')][_0x11a9('0x19')]||null:null,'include':_0x304b39[_0x11a9('0x16')]?_0x304b39[_0x11a9('0x16')][_0x11a9('0x1a')]?_['map'](_0x304b39[_0x11a9('0x16')][_0x11a9('0x1a')],function(_0x4738c0){return{'model':db[_0x4738c0[_0x11a9('0x1b')]],'as':_0x4738c0['as'],'attributes':_0x4738c0[_0x11a9('0x19')],'include':_0x4738c0[_0x11a9('0x1a')]?_['map'](_0x4738c0[_0x11a9('0x1a')],function(_0x362470){return{'model':db[_0x362470['model']],'as':_0x362470['as'],'attributes':_0x362470[_0x11a9('0x19')],'include':_0x362470[_0x11a9('0x1a')]?_[_0x11a9('0x1c')](_0x362470[_0x11a9('0x1a')],function(_0x339190){return{'model':db[_0x339190[_0x11a9('0x1b')]],'as':_0x339190['as'],'attributes':_0x339190[_0x11a9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x11a9('0xb')](function(_0x3f4430){logger['info'](_0x11a9('0x1d'),_0x304b39);logger[_0x11a9('0x1e')]('ShowSquareOdbc',_0x304b39,JSON[_0x11a9('0x10')](_0x3f4430));_0x9844fb(_0x3f4430);})[_0x11a9('0x15')](function(_0x1052b7){logger[_0x11a9('0x11')]('ShowSquareOdbc',_0x1052b7[_0x11a9('0x13')],_0x304b39);_0x40f41b(_0x3cd4fd['error'](0x1f4,_0x1052b7[_0x11a9('0x13')]));});});}; \ No newline at end of file +var _0x401e=['debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','include','map','model','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent'];(function(_0x566aeb,_0x12ed7d){var _0x40ca61=function(_0x464379){while(--_0x464379){_0x566aeb['push'](_0x566aeb['shift']());}};_0x40ca61(++_0x12ed7d);}(_0x401e,0x192));var _0xe401=function(_0x20dd87,_0x510d8b){_0x20dd87=_0x20dd87-0x0;var _0x31d72f=_0x401e[_0x20dd87];return _0x31d72f;};'use strict';var _=require('lodash');var util=require(_0xe401('0x0'));var moment=require(_0xe401('0x1'));var BPromise=require(_0xe401('0x2'));var rs=require(_0xe401('0x3'));var fs=require('fs');var Redis=require(_0xe401('0x4'));var db=require(_0xe401('0x5'))['db'];var utils=require(_0xe401('0x6'));var logger=require(_0xe401('0x7'))(_0xe401('0x8'));var config=require(_0xe401('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe401('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f62bf,_0x2bdbc1,_0x543362){return new BPromise(function(_0x1d01f2,_0x5088c5){return client[_0xe401('0xb')](_0x2f62bf,_0x543362)['then'](function(_0x18ef9d){logger[_0xe401('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x2bdbc1,_0xe401('0xd'));logger[_0xe401('0xe')](_0xe401('0xf'),_0x2bdbc1,_0xe401('0xd'),JSON['stringify'](_0x18ef9d));if(_0x18ef9d[_0xe401('0x10')]){if(_0x18ef9d[_0xe401('0x10')][_0xe401('0x11')]===0x1f4){logger[_0xe401('0x10')](_0xe401('0x12'),_0x2bdbc1,_0x18ef9d[_0xe401('0x10')]['message']);return _0x5088c5(_0x18ef9d[_0xe401('0x10')]['message']);}logger[_0xe401('0x10')](_0xe401('0x12'),_0x2bdbc1,_0x18ef9d[_0xe401('0x10')][_0xe401('0x13')]);return _0x1d01f2(_0x18ef9d['error'][_0xe401('0x13')]);}else{logger[_0xe401('0xc')](_0xe401('0x12'),_0x2bdbc1,_0xe401('0xd'));_0x1d01f2(_0x18ef9d[_0xe401('0x14')][_0xe401('0x13')]);}})[_0xe401('0x15')](function(_0x4a0d1f){logger['error'](_0xe401('0x12'),_0x2bdbc1,_0x4a0d1f);_0x5088c5(_0x4a0d1f);});});}exports[_0xe401('0x16')]=function(_0x10da15){var _0x6fd31d=this;return new Promise(function(_0x561306,_0x5eff91){return db[_0xe401('0x17')]['find']({'raw':_0x10da15[_0xe401('0x18')]?_0x10da15[_0xe401('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x10da15[_0xe401('0x18')]?_0x10da15[_0xe401('0x18')][_0xe401('0x19')]||null:null,'attributes':_0x10da15['options']?_0x10da15[_0xe401('0x18')][_0xe401('0x1a')]||null:null,'include':_0x10da15['options']?_0x10da15[_0xe401('0x18')][_0xe401('0x1b')]?_[_0xe401('0x1c')](_0x10da15[_0xe401('0x18')][_0xe401('0x1b')],function(_0x9222ac){return{'model':db[_0x9222ac[_0xe401('0x1d')]],'as':_0x9222ac['as'],'attributes':_0x9222ac['attributes'],'include':_0x9222ac[_0xe401('0x1b')]?_['map'](_0x9222ac['include'],function(_0x5a109c){return{'model':db[_0x5a109c['model']],'as':_0x5a109c['as'],'attributes':_0x5a109c[_0xe401('0x1a')],'include':_0x5a109c[_0xe401('0x1b')]?_[_0xe401('0x1c')](_0x5a109c[_0xe401('0x1b')],function(_0x3deb06){return{'model':db[_0x3deb06[_0xe401('0x1d')]],'as':_0x3deb06['as'],'attributes':_0x3deb06[_0xe401('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe401('0x1e')](function(_0x17a31d){logger[_0xe401('0xc')]('ShowSquareOdbc',_0x10da15);logger[_0xe401('0xe')](_0xe401('0x16'),_0x10da15,JSON[_0xe401('0x1f')](_0x17a31d));_0x561306(_0x17a31d);})[_0xe401('0x15')](function(_0x52a598){logger[_0xe401('0x10')](_0xe401('0x16'),_0x52a598[_0xe401('0x13')],_0x10da15);_0x5eff91(_0x6fd31d[_0xe401('0x10')](0x1f4,_0x52a598['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3fed2a1..d852bfd 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 _0xca37=['../../components/interaction/service','get','show','post','isAuthenticated','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x42f89b,_0x382051){var _0x41efaa=function(_0x221df8){while(--_0x221df8){_0x42f89b['push'](_0x42f89b['shift']());}};_0x41efaa(++_0x382051);}(_0xca37,0x187));var _0x7ca3=function(_0x9e6a42,_0xbf7804){_0x9e6a42=_0x9e6a42-0x0;var _0x289fcb=_0xca37[_0x9e6a42];return _0x289fcb;};'use strict';var multer=require(_0x7ca3('0x0'));var util=require(_0x7ca3('0x1'));var path=require(_0x7ca3('0x2'));var timeout=require(_0x7ca3('0x3'));var express=require(_0x7ca3('0x4'));var router=express[_0x7ca3('0x5')]();var fs_extra=require(_0x7ca3('0x6'));var auth=require(_0x7ca3('0x7'));var interaction=require(_0x7ca3('0x8'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x7ca3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7ca3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7ca3('0xa')]);router[_0x7ca3('0xb')]('/',auth[_0x7ca3('0xc')](),controller[_0x7ca3('0xd')]);router[_0x7ca3('0xe')]('/:id',auth[_0x7ca3('0xc')](),controller[_0x7ca3('0xf')]);router[_0x7ca3('0x10')](_0x7ca3('0x11'),auth[_0x7ca3('0xc')](),controller['destroy']);module[_0x7ca3('0x12')]=router; \ No newline at end of file +var _0x6f35=['path','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util'];(function(_0x172c61,_0x581387){var _0x462df7=function(_0x1973bd){while(--_0x1973bd){_0x172c61['push'](_0x172c61['shift']());}};_0x462df7(++_0x581387);}(_0x6f35,0x1c0));var _0x56f3=function(_0x1f812,_0x455a7b){_0x1f812=_0x1f812-0x0;var _0x1f6547=_0x6f35[_0x1f812];return _0x1f6547;};'use strict';var multer=require(_0x56f3('0x0'));var util=require(_0x56f3('0x1'));var path=require(_0x56f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x56f3('0x3'));var router=express[_0x56f3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x56f3('0x5'));var config=require(_0x56f3('0x6'));var controller=require(_0x56f3('0x7'));router[_0x56f3('0x8')]('/',auth[_0x56f3('0x9')](),controller[_0x56f3('0xa')]);router[_0x56f3('0x8')](_0x56f3('0xb'),auth[_0x56f3('0x9')](),controller[_0x56f3('0xc')]);router[_0x56f3('0xd')]('/',auth[_0x56f3('0x9')](),controller['create']);router['put'](_0x56f3('0xb'),auth[_0x56f3('0x9')](),controller[_0x56f3('0xe')]);router[_0x56f3('0xf')]('/:id',auth[_0x56f3('0x9')](),controller[_0x56f3('0x10')]);module[_0x56f3('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index d033d7f..10d2919 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 _0x6054=['TEXT','getDataValue','preproduction','utf8','BLOB','long','production','toString','DATE','sequelize','STRING'];(function(_0x2e7c1b,_0x232f79){var _0x42f565=function(_0x31ee5a){while(--_0x31ee5a){_0x2e7c1b['push'](_0x2e7c1b['shift']());}};_0x42f565(++_0x232f79);}(_0x6054,0x127));var _0x4605=function(_0x588370,_0x4563b9){_0x588370=_0x588370-0x0;var _0x1b0dc1=_0x6054[_0x588370];return _0x1b0dc1;};'use strict';var Sequelize=require(_0x4605('0x0'));module['exports']={'name':{'type':Sequelize[_0x4605('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4605('0x1')]},'notes':{'type':Sequelize[_0x4605('0x2')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x4605('0x3')](_0x4605('0x4'))){return this[_0x4605('0x3')](_0x4605('0x4'))['toString'](_0x4605('0x5'));}}},'production':{'type':Sequelize[_0x4605('0x6')](_0x4605('0x7')),'get':function(){if(this[_0x4605('0x3')](_0x4605('0x8'))){return this['getDataValue'](_0x4605('0x8'))[_0x4605('0x9')](_0x4605('0x5'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4605('0xa')]}}; \ No newline at end of file +var _0xe4f4=['preproduction','toString','utf8','production','DATE','exports','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xe4f4,0x89));var _0x4e4f=function(_0x353cd6,_0xc795f6){_0x353cd6=_0x353cd6-0x0;var _0x55712a=_0xe4f4[_0x353cd6];return _0x55712a;};'use strict';var Sequelize=require('sequelize');module[_0x4e4f('0x0')]={'name':{'type':Sequelize[_0x4e4f('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4e4f('0x1')]},'notes':{'type':Sequelize[_0x4e4f('0x2')]},'preproduction':{'type':Sequelize[_0x4e4f('0x3')](_0x4e4f('0x4')),'get':function(){if(this[_0x4e4f('0x5')](_0x4e4f('0x6'))){return this[_0x4e4f('0x5')]('preproduction')[_0x4e4f('0x7')](_0x4e4f('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x4e4f('0x4')),'get':function(){if(this[_0x4e4f('0x5')]('production')){return this[_0x4e4f('0x5')](_0x4e4f('0x9'))[_0x4e4f('0x7')](_0x4e4f('0x8'));}}},'savedAt':{'type':Sequelize[_0x4e4f('0xa')]},'publishedAt':{'type':Sequelize[_0x4e4f('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index db996fe..0b3e76a 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 _0x33f0=['query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','production','find','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','socket.io-emitter','./squareProject.socket','status','json','offset','limit','undefined','count','Content-Range','then','destroy','get','SquareProjects','publish','agi','stringify','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model'];(function(_0x38d9cb,_0x30654d){var _0x15102a=function(_0x13db6b){while(--_0x13db6b){_0x38d9cb['push'](_0x38d9cb['shift']());}};_0x15102a(++_0x30654d);}(_0x33f0,0xaf));var _0x033f=function(_0x2b3047,_0x2db9a6){_0x2b3047=_0x2b3047-0x0;var _0xaab947=_0x33f0[_0x2b3047];return _0xaab947;};'use strict';var _=require(_0x033f('0x0'));var Redis=require(_0x033f('0x1'));var qs=require(_0x033f('0x2'));var logger=require(_0x033f('0x3'))(_0x033f('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x033f('0x5')]=_['defaults'](config[_0x033f('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x033f('0x6'))(new Redis(config[_0x033f('0x5')]));require(_0x033f('0x7'))['register'](socket);function respondWithResult(_0x4e510b,_0x3fdcd9){_0x3fdcd9=_0x3fdcd9||0xc8;return function(_0x51850d){if(_0x51850d){return _0x4e510b[_0x033f('0x8')](_0x3fdcd9)[_0x033f('0x9')](_0x51850d);}};}function respondWithFilteredResult(_0x5898d2,_0x12fe36){return function(_0x3c16a2){if(_0x3c16a2){var _0xbe9d45=typeof _0x12fe36[_0x033f('0xa')]==='undefined'&&typeof _0x12fe36[_0x033f('0xb')]===_0x033f('0xc');var _0xab3c8a=_0x3c16a2[_0x033f('0xd')];var _0x378a49=_0xbe9d45?0x0:_0x12fe36['offset'];var _0x2123f7=_0xbe9d45?_0x3c16a2[_0x033f('0xd')]:_0x12fe36[_0x033f('0xa')]+_0x12fe36['limit'];var _0x4c6b2c;if(_0x2123f7>=_0xab3c8a){_0x2123f7=_0xab3c8a;_0x4c6b2c=0xc8;}else{_0x4c6b2c=0xce;}_0x5898d2[_0x033f('0x8')](_0x4c6b2c);return _0x5898d2['set'](_0x033f('0xe'),_0x378a49+'-'+_0x2123f7+'/'+_0xab3c8a)[_0x033f('0x9')](_0x3c16a2);}return null;};}function saveUpdates(_0x26d18d){return function(_0x4fddef){if(_0x4fddef){return _0x4fddef['update'](_0x26d18d)[_0x033f('0xf')](function(_0x474bd6){return _0x474bd6;});}return null;};}function removeEntity(_0x2ba728){return function(_0x173049){if(_0x173049){return _0x173049[_0x033f('0x10')]()[_0x033f('0xf')](function(){var _0x4086cc=_0x173049[_0x033f('0x11')]({'plain':!![]});var _0x256434=_0x033f('0x12');return db['UserProfileResource']['destroy']({'where':{'type':_0x256434,'resourceId':_0x4086cc['id']}})[_0x033f('0xf')](function(){return _0x173049;});})['then'](function(){var _0x6013a0=new Redis(config[_0x033f('0x5')]);_0x6013a0[_0x033f('0x13')](_0x033f('0x14'),JSON[_0x033f('0x15')]({'id':_0x173049['id'],'deleted':!![]}));})[_0x033f('0xf')](function(){_0x2ba728[_0x033f('0x8')](0xcc)[_0x033f('0x16')]();});}};}function handleEntityNotFound(_0x1a97c2){return function(_0x4d463d){if(!_0x4d463d){_0x1a97c2[_0x033f('0x17')](0x194);}return _0x4d463d;};}function handleError(_0x3e76b0,_0x851665){_0x851665=_0x851665||0x1f4;return function(_0x30765d){logger[_0x033f('0x18')](_0x30765d[_0x033f('0x19')]);if(_0x30765d[_0x033f('0x1a')]){delete _0x30765d['name'];}_0x3e76b0[_0x033f('0x8')](_0x851665)[_0x033f('0x1b')](_0x30765d);};}exports['index']=function(_0x20d7b2,_0x47fc2c){var _0x1cfba7={},_0x4317d4={},_0x57ca78={'count':0x0,'rows':[]};var _0x3b060d=_[_0x033f('0x1c')](db[_0x033f('0x1d')][_0x033f('0x1e')],function(_0x53a989){return{'name':_0x53a989[_0x033f('0x1f')],'type':_0x53a989[_0x033f('0x20')][_0x033f('0x21')]};});_0x4317d4[_0x033f('0x22')]=_[_0x033f('0x1c')](_0x3b060d,_0x033f('0x1a'));_0x4317d4[_0x033f('0x23')]=_[_0x033f('0x24')](_0x20d7b2['query']);_0x4317d4[_0x033f('0x25')]=_['intersection'](_0x4317d4['model'],_0x4317d4['query']);_0x1cfba7[_0x033f('0x26')]=_[_0x033f('0x27')](_0x4317d4[_0x033f('0x22')],qs[_0x033f('0x28')](_0x20d7b2[_0x033f('0x23')][_0x033f('0x28')]));_0x1cfba7[_0x033f('0x26')]=_0x1cfba7[_0x033f('0x26')][_0x033f('0x29')]?_0x1cfba7[_0x033f('0x26')]:_0x4317d4[_0x033f('0x22')];if(!_0x20d7b2[_0x033f('0x23')][_0x033f('0x2a')](_0x033f('0x2b'))){_0x1cfba7[_0x033f('0xb')]=qs['limit'](_0x20d7b2[_0x033f('0x23')][_0x033f('0xb')]);_0x1cfba7[_0x033f('0xa')]=qs[_0x033f('0xa')](_0x20d7b2['query'][_0x033f('0xa')]);}_0x1cfba7[_0x033f('0x2c')]=qs[_0x033f('0x2d')](_0x20d7b2[_0x033f('0x23')]['sort']);_0x1cfba7[_0x033f('0x2e')]=qs[_0x033f('0x25')](_[_0x033f('0x2f')](_0x20d7b2[_0x033f('0x23')],_0x4317d4[_0x033f('0x25')]),_0x3b060d);if(_0x20d7b2[_0x033f('0x23')][_0x033f('0x30')]){_0x1cfba7['where']=_[_0x033f('0x31')](_0x1cfba7[_0x033f('0x2e')],{'$or':_[_0x033f('0x1c')](_0x3b060d,function(_0x5e0e2d){if(_0x5e0e2d[_0x033f('0x20')]!==_0x033f('0x32')){var _0x2390f3={};_0x2390f3[_0x5e0e2d[_0x033f('0x1a')]]={'$like':'%'+_0x20d7b2[_0x033f('0x23')][_0x033f('0x30')]+'%'};return _0x2390f3;}})});}_0x1cfba7=_['merge']({},_0x1cfba7,_0x20d7b2[_0x033f('0x33')]);var _0x4e5392={'where':_0x1cfba7[_0x033f('0x2e')]};return db['SquareProject'][_0x033f('0xd')](_0x4e5392)['then'](function(_0x5882ad){_0x57ca78[_0x033f('0xd')]=_0x5882ad;if(_0x20d7b2[_0x033f('0x23')][_0x033f('0x34')]){_0x1cfba7[_0x033f('0x35')]=[{'all':!![]}];}return db[_0x033f('0x1d')][_0x033f('0x36')](_0x1cfba7);})['then'](function(_0xb3b5cd){_0x57ca78[_0x033f('0x37')]=_0xb3b5cd;return _0x57ca78;})['then'](respondWithFilteredResult(_0x47fc2c,_0x1cfba7))['catch'](handleError(_0x47fc2c,null));};exports[_0x033f('0x38')]=function(_0x463c46,_0x33b217){var _0x262f70={'raw':![],'where':{'id':_0x463c46[_0x033f('0x39')]['id']}},_0x587d9e={};_0x587d9e[_0x033f('0x22')]=_[_0x033f('0x24')](db['SquareProject']['rawAttributes']);_0x587d9e[_0x033f('0x23')]=_['keys'](_0x463c46[_0x033f('0x23')]);_0x587d9e[_0x033f('0x25')]=_[_0x033f('0x27')](_0x587d9e[_0x033f('0x22')],_0x587d9e['query']);_0x262f70[_0x033f('0x26')]=_[_0x033f('0x27')](_0x587d9e[_0x033f('0x22')],qs[_0x033f('0x28')](_0x463c46['query'][_0x033f('0x28')]));_0x262f70[_0x033f('0x26')]=_0x262f70['attributes'][_0x033f('0x29')]?_0x262f70['attributes']:_0x587d9e['model'];if(_0x463c46[_0x033f('0x23')][_0x033f('0x34')]){_0x262f70[_0x033f('0x35')]=[{'all':!![]}];}_0x262f70=_[_0x033f('0x31')]({},_0x262f70,_0x463c46[_0x033f('0x33')]);return db['SquareProject']['find'](_0x262f70)[_0x033f('0xf')](handleEntityNotFound(_0x33b217,null))[_0x033f('0xf')](respondWithResult(_0x33b217,null))[_0x033f('0x3a')](handleError(_0x33b217,null));};exports['create']=function(_0x41acbb,_0x54aa77){return db[_0x033f('0x1d')][_0x033f('0x3b')](_0x41acbb[_0x033f('0x3c')],{})['then'](function(_0x6799b3){var _0x497b7d=_0x41acbb[_0x033f('0x3d')][_0x033f('0x11')]({'plain':!![]});if(!_0x497b7d)throw new Error(_0x033f('0x3e'));if(_0x497b7d[_0x033f('0x3f')]==='user'){var _0x2f3e35=_0x6799b3[_0x033f('0x11')]({'plain':!![]});var _0x324fbb=_0x033f('0x12');return db[_0x033f('0x40')]['find']({'where':{'name':_0x324fbb,'userProfileId':_0x497b7d[_0x033f('0x41')]},'raw':!![]})['then'](function(_0x6fe645){if(_0x6fe645&&_0x6fe645[_0x033f('0x42')]===0x0){return db[_0x033f('0x43')][_0x033f('0x3b')]({'name':_0x2f3e35[_0x033f('0x1a')],'resourceId':_0x2f3e35['id'],'type':_0x6fe645['name'],'sectionId':_0x6fe645['id']},{})[_0x033f('0xf')](function(){return _0x6799b3;});}else{return _0x6799b3;}})[_0x033f('0x3a')](function(_0x56049a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56049a);throw _0x56049a;});}return _0x6799b3;})[_0x033f('0xf')](respondWithResult(_0x54aa77,0xc9))[_0x033f('0x3a')](handleError(_0x54aa77,null));};exports['update']=function(_0x27cbc9,_0x3e449e){if(_0x27cbc9[_0x033f('0x3c')]['id']){delete _0x27cbc9[_0x033f('0x3c')]['id'];}return db[_0x033f('0x1d')]['find']({'where':{'id':_0x27cbc9[_0x033f('0x39')]['id']}})[_0x033f('0xf')](handleEntityNotFound(_0x3e449e,null))[_0x033f('0xf')](saveUpdates(_0x27cbc9['body'],null))[_0x033f('0xf')](function(_0x23d3cf){if(!_0x23d3cf)return;var _0x2c77e1=_0x23d3cf['get']({'plain':!![]});return _0x2c77e1;})[_0x033f('0xf')](function(_0x47ca2e){var _0xd4d43d=new Redis(config[_0x033f('0x5')]);_0xd4d43d[_0x033f('0x13')]('agi',JSON['stringify'](_['pick'](_0x47ca2e,['id',_0x033f('0x1a'),_0x033f('0x44')])));return _0x47ca2e;})[_0x033f('0xf')](respondWithResult(_0x3e449e,null))[_0x033f('0x3a')](handleError(_0x3e449e,null));};exports[_0x033f('0x10')]=function(_0x4da150,_0x49aba1){return db['SquareProject'][_0x033f('0x45')]({'where':{'id':_0x4da150['params']['id']}})[_0x033f('0xf')](handleEntityNotFound(_0x49aba1,null))[_0x033f('0xf')](removeEntity(_0x49aba1,null))['catch'](handleError(_0x49aba1,null));}; \ No newline at end of file +var _0x9f8b=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','body','params','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','UserProfileResource','destroy','agi','stringify','end','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','key','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty'];(function(_0x46d441,_0x392c98){var _0x419105=function(_0x5b95c4){while(--_0x5b95c4){_0x46d441['push'](_0x46d441['shift']());}};_0x419105(++_0x392c98);}(_0x9f8b,0x1b6));var _0xb9f8=function(_0x8b1bec,_0x1c8e41){_0x8b1bec=_0x8b1bec-0x0;var _0x29b1d8=_0x9f8b[_0x8b1bec];return _0x29b1d8;};'use strict';var _=require(_0xb9f8('0x0'));var Redis=require(_0xb9f8('0x1'));var qs=require(_0xb9f8('0x2'));var logger=require(_0xb9f8('0x3'))(_0xb9f8('0x4'));var config=require(_0xb9f8('0x5'));var db=require(_0xb9f8('0x6'))['db'];config[_0xb9f8('0x7')]=_['defaults'](config['redis'],{'host':_0xb9f8('0x8'),'port':0x18eb});var socket=require(_0xb9f8('0x9'))(new Redis(config[_0xb9f8('0x7')]));require(_0xb9f8('0xa'))[_0xb9f8('0xb')](socket);function respondWithResult(_0x5b4264,_0x405210){_0x405210=_0x405210||0xc8;return function(_0x2ca9a6){if(_0x2ca9a6){return _0x5b4264[_0xb9f8('0xc')](_0x405210)[_0xb9f8('0xd')](_0x2ca9a6);}};}function respondWithFilteredResult(_0x2d35b2,_0x39b3b0){return function(_0x520f80){if(_0x520f80){var _0x57e82e=typeof _0x39b3b0[_0xb9f8('0xe')]===_0xb9f8('0xf')&&typeof _0x39b3b0[_0xb9f8('0x10')]==='undefined';var _0x67fdb1=_0x520f80[_0xb9f8('0x11')];var _0x369a9a=_0x57e82e?0x0:_0x39b3b0[_0xb9f8('0xe')];var _0x4d3860=_0x57e82e?_0x520f80['count']:_0x39b3b0[_0xb9f8('0xe')]+_0x39b3b0[_0xb9f8('0x10')];var _0x553338;if(_0x4d3860>=_0x67fdb1){_0x4d3860=_0x67fdb1;_0x553338=0xc8;}else{_0x553338=0xce;}_0x2d35b2[_0xb9f8('0xc')](_0x553338);return _0x2d35b2[_0xb9f8('0x12')](_0xb9f8('0x13'),_0x369a9a+'-'+_0x4d3860+'/'+_0x67fdb1)[_0xb9f8('0xd')](_0x520f80);}return null;};}function saveUpdates(_0x1e731b){return function(_0x380d8a){if(_0x380d8a){return _0x380d8a[_0xb9f8('0x14')](_0x1e731b)[_0xb9f8('0x15')](function(_0xbc017d){return _0xbc017d;});}return null;};}function removeEntity(_0x1962b6){return function(_0x39a773){if(_0x39a773){return _0x39a773['destroy']()[_0xb9f8('0x15')](function(){var _0x7f3a08=_0x39a773['get']({'plain':!![]});var _0x2ffdb7='SquareProjects';return db[_0xb9f8('0x16')][_0xb9f8('0x17')]({'where':{'type':_0x2ffdb7,'resourceId':_0x7f3a08['id']}})[_0xb9f8('0x15')](function(){return _0x39a773;});})[_0xb9f8('0x15')](function(){var _0x11e3cd=new Redis(config[_0xb9f8('0x7')]);_0x11e3cd['publish'](_0xb9f8('0x18'),JSON[_0xb9f8('0x19')]({'id':_0x39a773['id'],'deleted':!![]}));})[_0xb9f8('0x15')](function(){_0x1962b6['status'](0xcc)[_0xb9f8('0x1a')]();});}};}function handleEntityNotFound(_0x5b1a0f){return function(_0x354701){if(!_0x354701){_0x5b1a0f[_0xb9f8('0x1b')](0x194);}return _0x354701;};}function handleError(_0xb2be3e,_0x2ecd42){_0x2ecd42=_0x2ecd42||0x1f4;return function(_0x3d0ee5){logger[_0xb9f8('0x1c')](_0x3d0ee5[_0xb9f8('0x1d')]);if(_0x3d0ee5['name']){delete _0x3d0ee5[_0xb9f8('0x1e')];}_0xb2be3e[_0xb9f8('0xc')](_0x2ecd42)['send'](_0x3d0ee5);};}exports[_0xb9f8('0x1f')]=function(_0x34b65b,_0x17d038){var _0x4c423a={},_0x33b412={},_0x4b414b={'count':0x0,'rows':[]};var _0x10b7cf=_[_0xb9f8('0x20')](db[_0xb9f8('0x21')][_0xb9f8('0x22')],function(_0x2e6cf6){return{'name':_0x2e6cf6[_0xb9f8('0x23')],'type':_0x2e6cf6['type'][_0xb9f8('0x24')]};});_0x33b412['model']=_['map'](_0x10b7cf,_0xb9f8('0x1e'));_0x33b412['query']=_[_0xb9f8('0x25')](_0x34b65b['query']);_0x33b412[_0xb9f8('0x26')]=_[_0xb9f8('0x27')](_0x33b412[_0xb9f8('0x28')],_0x33b412[_0xb9f8('0x29')]);_0x4c423a['attributes']=_['intersection'](_0x33b412[_0xb9f8('0x28')],qs['fields'](_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0x2a')]));_0x4c423a[_0xb9f8('0x2b')]=_0x4c423a[_0xb9f8('0x2b')]['length']?_0x4c423a[_0xb9f8('0x2b')]:_0x33b412[_0xb9f8('0x28')];if(!_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0x2c')]('nolimit')){_0x4c423a[_0xb9f8('0x10')]=qs[_0xb9f8('0x10')](_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0x10')]);_0x4c423a[_0xb9f8('0xe')]=qs[_0xb9f8('0xe')](_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0xe')]);}_0x4c423a[_0xb9f8('0x2d')]=qs[_0xb9f8('0x2e')](_0x34b65b['query'][_0xb9f8('0x2e')]);_0x4c423a[_0xb9f8('0x2f')]=qs['filters'](_[_0xb9f8('0x30')](_0x34b65b[_0xb9f8('0x29')],_0x33b412[_0xb9f8('0x26')]),_0x10b7cf);if(_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0x31')]){_0x4c423a['where']=_[_0xb9f8('0x32')](_0x4c423a[_0xb9f8('0x2f')],{'$or':_[_0xb9f8('0x20')](_0x10b7cf,function(_0x5ba4a2){if(_0x5ba4a2['type']!==_0xb9f8('0x33')){var _0x10ea20={};_0x10ea20[_0x5ba4a2[_0xb9f8('0x1e')]]={'$like':'%'+_0x34b65b['query']['filter']+'%'};return _0x10ea20;}})});}_0x4c423a=_[_0xb9f8('0x32')]({},_0x4c423a,_0x34b65b[_0xb9f8('0x34')]);var _0x59084a={'where':_0x4c423a['where']};return db['SquareProject'][_0xb9f8('0x11')](_0x59084a)[_0xb9f8('0x15')](function(_0x5584a3){_0x4b414b[_0xb9f8('0x11')]=_0x5584a3;if(_0x34b65b[_0xb9f8('0x29')][_0xb9f8('0x35')]){_0x4c423a[_0xb9f8('0x36')]=[{'all':!![]}];}return db[_0xb9f8('0x21')][_0xb9f8('0x37')](_0x4c423a);})[_0xb9f8('0x15')](function(_0x578f65){_0x4b414b['rows']=_0x578f65;return _0x4b414b;})[_0xb9f8('0x15')](respondWithFilteredResult(_0x17d038,_0x4c423a))[_0xb9f8('0x38')](handleError(_0x17d038,null));};exports['show']=function(_0x4baa49,_0x127ebc){var _0x1ef660={'raw':![],'where':{'id':_0x4baa49['params']['id']}},_0x502fa4={};_0x502fa4[_0xb9f8('0x28')]=_['keys'](db[_0xb9f8('0x21')][_0xb9f8('0x22')]);_0x502fa4[_0xb9f8('0x29')]=_[_0xb9f8('0x25')](_0x4baa49[_0xb9f8('0x29')]);_0x502fa4[_0xb9f8('0x26')]=_['intersection'](_0x502fa4['model'],_0x502fa4[_0xb9f8('0x29')]);_0x1ef660[_0xb9f8('0x2b')]=_[_0xb9f8('0x27')](_0x502fa4['model'],qs[_0xb9f8('0x2a')](_0x4baa49[_0xb9f8('0x29')]['fields']));_0x1ef660[_0xb9f8('0x2b')]=_0x1ef660[_0xb9f8('0x2b')][_0xb9f8('0x39')]?_0x1ef660['attributes']:_0x502fa4[_0xb9f8('0x28')];if(_0x4baa49[_0xb9f8('0x29')]['includeAll']){_0x1ef660['include']=[{'all':!![]}];}_0x1ef660=_['merge']({},_0x1ef660,_0x4baa49[_0xb9f8('0x34')]);return db[_0xb9f8('0x21')][_0xb9f8('0x3a')](_0x1ef660)[_0xb9f8('0x15')](handleEntityNotFound(_0x127ebc,null))['then'](respondWithResult(_0x127ebc,null))['catch'](handleError(_0x127ebc,null));};exports['create']=function(_0xc3b0b1,_0x1d1a2d){return db[_0xb9f8('0x21')][_0xb9f8('0x3b')](_0xc3b0b1['body'],{})['then'](function(_0x5e4a85){var _0x1cd57b=_0xc3b0b1['user'][_0xb9f8('0x3c')]({'plain':!![]});if(!_0x1cd57b)throw new Error(_0xb9f8('0x3d'));if(_0x1cd57b[_0xb9f8('0x3e')]===_0xb9f8('0x3f')){var _0x307e67=_0x5e4a85[_0xb9f8('0x3c')]({'plain':!![]});var _0x5f87cf='SquareProjects';return db[_0xb9f8('0x40')]['find']({'where':{'name':_0x5f87cf,'userProfileId':_0x1cd57b['userProfileId']},'raw':!![]})[_0xb9f8('0x15')](function(_0x505b3a){if(_0x505b3a&&_0x505b3a[_0xb9f8('0x41')]===0x0){return db[_0xb9f8('0x16')][_0xb9f8('0x3b')]({'name':_0x307e67['name'],'resourceId':_0x307e67['id'],'type':_0x505b3a['name'],'sectionId':_0x505b3a['id']},{})[_0xb9f8('0x15')](function(){return _0x5e4a85;});}else{return _0x5e4a85;}})['catch'](function(_0x4cdd9d){logger[_0xb9f8('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cdd9d);throw _0x4cdd9d;});}return _0x5e4a85;})[_0xb9f8('0x15')](respondWithResult(_0x1d1a2d,0xc9))['catch'](handleError(_0x1d1a2d,null));};exports[_0xb9f8('0x14')]=function(_0x2f1f9b,_0x16c818){if(_0x2f1f9b[_0xb9f8('0x42')]['id']){delete _0x2f1f9b[_0xb9f8('0x42')]['id'];}return db[_0xb9f8('0x21')]['find']({'where':{'id':_0x2f1f9b[_0xb9f8('0x43')]['id']}})['then'](handleEntityNotFound(_0x16c818,null))[_0xb9f8('0x15')](saveUpdates(_0x2f1f9b[_0xb9f8('0x42')],null))[_0xb9f8('0x15')](function(_0x2d4bc1){if(!_0x2d4bc1)return;var _0x385b89=_0x2d4bc1[_0xb9f8('0x3c')]({'plain':!![]});return _0x385b89;})[_0xb9f8('0x15')](function(_0x19ac38){var _0x12f698=new Redis(config[_0xb9f8('0x7')]);_0x12f698['publish'](_0xb9f8('0x18'),JSON[_0xb9f8('0x19')](_[_0xb9f8('0x30')](_0x19ac38,['id',_0xb9f8('0x1e'),_0xb9f8('0x44')])));return _0x19ac38;})[_0xb9f8('0x15')](respondWithResult(_0x16c818,null))[_0xb9f8('0x38')](handleError(_0x16c818,null));};exports[_0xb9f8('0x17')]=function(_0x3f8326,_0xe56239){return db[_0xb9f8('0x21')][_0xb9f8('0x3a')]({'where':{'id':_0x3f8326['params']['id']}})['then'](handleEntityNotFound(_0xe56239,null))[_0xb9f8('0x15')](removeEntity(_0xe56239,null))[_0xb9f8('0x38')](handleError(_0xe56239,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d3b1c1c..a0e0791 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 _0x32ed=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x1f94ab,_0x1be620){var _0xcab065=function(_0x4161a0){while(--_0x4161a0){_0x1f94ab['push'](_0x1f94ab['shift']());}};_0xcab065(++_0x1be620);}(_0x32ed,0x11f));var _0xd32e=function(_0x2711b2,_0x187b7d){_0x2711b2=_0x2711b2-0x0;var _0x33cdef=_0x32ed[_0x2711b2];return _0x33cdef;};'use strict';var EventEmitter=require(_0xd32e('0x0'));var SquareProject=require(_0xd32e('0x1'))['db'][_0xd32e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd32e('0x3')](0x0);var events={'afterCreate':_0xd32e('0x4'),'afterUpdate':_0xd32e('0x5'),'afterDestroy':_0xd32e('0x6')};function emitEvent(_0x2f7148){return function(_0x2d2289,_0x3b1103,_0x307640){SquareProjectEvents[_0xd32e('0x7')](_0x2f7148+':'+_0x2d2289['id'],_0x2d2289);SquareProjectEvents[_0xd32e('0x7')](_0x2f7148,_0x2d2289);_0x307640(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xd32e('0x8')](e,emitEvent(event));}}module[_0xd32e('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x6d40=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject'];(function(_0x448410,_0x1f7ad5){var _0x26c76e=function(_0x259afc){while(--_0x259afc){_0x448410['push'](_0x448410['shift']());}};_0x26c76e(++_0x1f7ad5);}(_0x6d40,0x16f));var _0x06d4=function(_0x565f43,_0x50cd2c){_0x565f43=_0x565f43-0x0;var _0xf3dbac=_0x6d40[_0x565f43];return _0xf3dbac;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x06d4('0x0'))['db'][_0x06d4('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x06d4('0x2')](0x0);var events={'afterCreate':_0x06d4('0x3'),'afterUpdate':'update','afterDestroy':_0x06d4('0x4')};function emitEvent(_0x243ec5){return function(_0x483a03,_0x12181c,_0x5f41f5){SquareProjectEvents[_0x06d4('0x5')](_0x243ec5+':'+_0x483a03['id'],_0x483a03);SquareProjectEvents[_0x06d4('0x5')](_0x243ec5,_0x483a03);_0x5f41f5(null);};}for(var e in events){if(events[_0x06d4('0x6')](e)){var event=events[e];SquareProject[_0x06d4('0x7')](e,emitEvent(event));}}module[_0x06d4('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 86decdf..13c5768 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 _0x75b5=['changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x28098d,_0xdaed8e){var _0xc6a35f=function(_0x57ebff){while(--_0x57ebff){_0x28098d['push'](_0x28098d['shift']());}};_0xc6a35f(++_0xdaed8e);}(_0x75b5,0x78));var _0x575b=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x75b5[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x575b('0x0'));var util=require(_0x575b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x575b('0x2'));var BPromise=require(_0x575b('0x3'));var rp=require(_0x575b('0x4'));var fs=require('fs');var path=require(_0x575b('0x5'));var rimraf=require(_0x575b('0x6'));var config=require(_0x575b('0x7'));var attributes=require(_0x575b('0x8'));module[_0x575b('0x9')]=function(_0x5c0e1f,_0x3a8416){return _0x5c0e1f[_0x575b('0xa')](_0x575b('0xb'),attributes,{'tableName':_0x575b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5dfea4,_0x534b82,_0x2f2810){if(_0x5dfea4[_0x575b('0xd')](_0x575b('0xe'))){_0x5dfea4['savedAt']=moment()[_0x575b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5dfea4[_0x575b('0xd')](_0x575b('0x10'))){_0x5dfea4[_0x575b('0x11')]=moment()[_0x575b('0xf')](_0x575b('0x12'));}_0x2f2810(null,_0x5dfea4);}}});}; \ No newline at end of file +var _0x5876=['moment','request-promise','path','exports','define','SquareProject','square_projects','changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x5876,0x150));var _0x6587=function(_0x389b98,_0x58b439){_0x389b98=_0x389b98-0x0;var _0x65b7c6=_0x5876[_0x389b98];return _0x65b7c6;};'use strict';var _=require(_0x6587('0x0'));var util=require(_0x6587('0x1'));var logger=require(_0x6587('0x2'))(_0x6587('0x3'));var moment=require(_0x6587('0x4'));var BPromise=require('bluebird');var rp=require(_0x6587('0x5'));var fs=require('fs');var path=require(_0x6587('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x6587('0x7')]=function(_0x16693a,_0x37a7e6){return _0x16693a[_0x6587('0x8')](_0x6587('0x9'),attributes,{'tableName':_0x6587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a5d9a,_0x43f23b,_0x594444){if(_0x1a5d9a[_0x6587('0xb')](_0x6587('0xc'))){_0x1a5d9a['savedAt']=moment()[_0x6587('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1a5d9a[_0x6587('0xb')](_0x6587('0xe'))){_0x1a5d9a[_0x6587('0xf')]=moment()['format'](_0x6587('0x10'));}_0x594444(null,_0x1a5d9a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e2f16e1..edea967 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 _0x92eb=['then','info','stringify','catch','message','ShowSquareProject','find','debug','error','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','map','model'];(function(_0x599a6f,_0x5a93ca){var _0xf9ed32=function(_0xb2fbb){while(--_0xb2fbb){_0x599a6f['push'](_0x599a6f['shift']());}};_0xf9ed32(++_0x5a93ca);}(_0x92eb,0x9a));var _0xb92e=function(_0x4fa602,_0x3734d8){_0x4fa602=_0x4fa602-0x0;var _0x4d6aa6=_0x92eb[_0x4fa602];return _0x4d6aa6;};'use strict';var _=require(_0xb92e('0x0'));var Redis=require(_0xb92e('0x1'));var db=require(_0xb92e('0x2'))['db'];var logger=require(_0xb92e('0x3'))(_0xb92e('0x4'));var config=require('../../config/environment');config[_0xb92e('0x5')]=_[_0xb92e('0x6')](config[_0xb92e('0x5')],{'host':_0xb92e('0x7'),'port':0x18eb});var socket=require(_0xb92e('0x8'))(new Redis(config[_0xb92e('0x5')]));require('./squareProject.socket')[_0xb92e('0x9')](socket);exports[_0xb92e('0xa')]=function(_0x23c305){var _0x297411=this;return new Promise(function(_0x437fdc,_0x17cd4f){return db[_0xb92e('0xb')][_0xb92e('0xc')]({'raw':_0x23c305[_0xb92e('0xd')]?_0x23c305[_0xb92e('0xd')][_0xb92e('0xe')]===undefined?!![]:![]:!![],'where':_0x23c305[_0xb92e('0xd')]?_0x23c305[_0xb92e('0xd')][_0xb92e('0xf')]||null:null,'attributes':_0x23c305['options']?_0x23c305[_0xb92e('0xd')][_0xb92e('0x10')]||null:null,'limit':_0x23c305[_0xb92e('0xd')]?_0x23c305['options']['limit']||null:null,'include':_0x23c305['options']?_0x23c305['options'][_0xb92e('0x11')]?_[_0xb92e('0x12')](_0x23c305[_0xb92e('0xd')]['include'],function(_0x3edffa){return{'model':db[_0x3edffa[_0xb92e('0x13')]],'as':_0x3edffa['as'],'attributes':_0x3edffa[_0xb92e('0x10')],'include':_0x3edffa[_0xb92e('0x11')]?_['map'](_0x3edffa['include'],function(_0xa0f696){return{'model':db[_0xa0f696[_0xb92e('0x13')]],'as':_0xa0f696['as'],'attributes':_0xa0f696[_0xb92e('0x10')],'include':_0xa0f696[_0xb92e('0x11')]?_['map'](_0xa0f696['include'],function(_0xeef359){return{'model':db[_0xeef359[_0xb92e('0x13')]],'as':_0xeef359['as'],'attributes':_0xeef359[_0xb92e('0x10')]};}):[]};}):[]};}):[]:[]})[_0xb92e('0x14')](function(_0x1018fd){logger[_0xb92e('0x15')](_0xb92e('0xa'),_0x23c305);logger['debug'](_0xb92e('0xa'),_0x23c305,JSON[_0xb92e('0x16')](_0x1018fd));_0x437fdc(_0x1018fd);})[_0xb92e('0x17')](function(_0x17eb48){logger['error'](_0xb92e('0xa'),_0x17eb48[_0xb92e('0x18')],_0x23c305);_0x17cd4f(_0x297411['error'](0x1f4,_0x17eb48[_0xb92e('0x18')]));});});};exports[_0xb92e('0x19')]=function(_0x59a5b8){var _0x5d5143=this;return new Promise(function(_0x384bfd,_0x273957){return db[_0xb92e('0xb')][_0xb92e('0x1a')]({'raw':_0x59a5b8[_0xb92e('0xd')]?_0x59a5b8[_0xb92e('0xd')][_0xb92e('0xe')]===undefined?!![]:![]:!![],'where':_0x59a5b8[_0xb92e('0xd')]?_0x59a5b8['options'][_0xb92e('0xf')]||null:null,'attributes':_0x59a5b8[_0xb92e('0xd')]?_0x59a5b8[_0xb92e('0xd')][_0xb92e('0x10')]||null:null,'include':_0x59a5b8[_0xb92e('0xd')]?_0x59a5b8[_0xb92e('0xd')][_0xb92e('0x11')]?_[_0xb92e('0x12')](_0x59a5b8[_0xb92e('0xd')][_0xb92e('0x11')],function(_0x3d2cff){return{'model':db[_0x3d2cff[_0xb92e('0x13')]],'as':_0x3d2cff['as'],'attributes':_0x3d2cff[_0xb92e('0x10')],'include':_0x3d2cff[_0xb92e('0x11')]?_[_0xb92e('0x12')](_0x3d2cff[_0xb92e('0x11')],function(_0x95cdcd){return{'model':db[_0x95cdcd[_0xb92e('0x13')]],'as':_0x95cdcd['as'],'attributes':_0x95cdcd['attributes'],'include':_0x95cdcd[_0xb92e('0x11')]?_[_0xb92e('0x12')](_0x95cdcd[_0xb92e('0x11')],function(_0x1b664f){return{'model':db[_0x1b664f[_0xb92e('0x13')]],'as':_0x1b664f['as'],'attributes':_0x1b664f[_0xb92e('0x10')]};}):[]};}):[]};}):[]:[]})[_0xb92e('0x14')](function(_0x259e51){logger[_0xb92e('0x15')](_0xb92e('0x19'),_0x59a5b8);logger[_0xb92e('0x1b')](_0xb92e('0x19'),_0x59a5b8,JSON[_0xb92e('0x16')](_0x259e51));_0x384bfd(_0x259e51);})[_0xb92e('0x17')](function(_0x308a96){logger[_0xb92e('0x1c')](_0xb92e('0x19'),_0x308a96['message'],_0x59a5b8);_0x273957(_0x5d5143[_0xb92e('0x1c')](0x1f4,_0x308a96[_0xb92e('0x18')]));});});}; \ No newline at end of file +var _0x8f0e=['register','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','info','debug','catch','error','message','ShowSquareProject','find','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8f0e,0x1e4));var _0xe8f0=function(_0x3aa9b1,_0x343571){_0x3aa9b1=_0x3aa9b1-0x0;var _0x28f995=_0x8f0e[_0x3aa9b1];return _0x28f995;};'use strict';var _=require(_0xe8f0('0x0'));var Redis=require(_0xe8f0('0x1'));var db=require(_0xe8f0('0x2'))['db'];var logger=require(_0xe8f0('0x3'))(_0xe8f0('0x4'));var config=require(_0xe8f0('0x5'));config['redis']=_[_0xe8f0('0x6')](config[_0xe8f0('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8f0('0x8'))(new Redis(config[_0xe8f0('0x7')]));require('./squareProject.socket')[_0xe8f0('0x9')](socket);exports[_0xe8f0('0xa')]=function(_0x51f078){var _0x1243a4=this;return new Promise(function(_0x3fe82d,_0x4659ac){return db[_0xe8f0('0xb')]['findAll']({'raw':_0x51f078[_0xe8f0('0xc')]?_0x51f078[_0xe8f0('0xc')][_0xe8f0('0xd')]===undefined?!![]:![]:!![],'where':_0x51f078[_0xe8f0('0xc')]?_0x51f078[_0xe8f0('0xc')][_0xe8f0('0xe')]||null:null,'attributes':_0x51f078[_0xe8f0('0xc')]?_0x51f078[_0xe8f0('0xc')][_0xe8f0('0xf')]||null:null,'limit':_0x51f078[_0xe8f0('0xc')]?_0x51f078[_0xe8f0('0xc')][_0xe8f0('0x10')]||null:null,'include':_0x51f078[_0xe8f0('0xc')]?_0x51f078[_0xe8f0('0xc')][_0xe8f0('0x11')]?_[_0xe8f0('0x12')](_0x51f078[_0xe8f0('0xc')][_0xe8f0('0x11')],function(_0x2c5cd8){return{'model':db[_0x2c5cd8[_0xe8f0('0x13')]],'as':_0x2c5cd8['as'],'attributes':_0x2c5cd8[_0xe8f0('0xf')],'include':_0x2c5cd8[_0xe8f0('0x11')]?_['map'](_0x2c5cd8[_0xe8f0('0x11')],function(_0x4fed90){return{'model':db[_0x4fed90['model']],'as':_0x4fed90['as'],'attributes':_0x4fed90[_0xe8f0('0xf')],'include':_0x4fed90[_0xe8f0('0x11')]?_[_0xe8f0('0x12')](_0x4fed90[_0xe8f0('0x11')],function(_0x631132){return{'model':db[_0x631132[_0xe8f0('0x13')]],'as':_0x631132['as'],'attributes':_0x631132[_0xe8f0('0xf')]};}):[]};}):[]};}):[]:[]})[_0xe8f0('0x14')](function(_0x328858){logger[_0xe8f0('0x15')](_0xe8f0('0xa'),_0x51f078);logger[_0xe8f0('0x16')](_0xe8f0('0xa'),_0x51f078,JSON['stringify'](_0x328858));_0x3fe82d(_0x328858);})[_0xe8f0('0x17')](function(_0x341aa2){logger[_0xe8f0('0x18')](_0xe8f0('0xa'),_0x341aa2[_0xe8f0('0x19')],_0x51f078);_0x4659ac(_0x1243a4[_0xe8f0('0x18')](0x1f4,_0x341aa2['message']));});});};exports[_0xe8f0('0x1a')]=function(_0x9c70c0){var _0x1d10c5=this;return new Promise(function(_0x5466e5,_0x3e7ea7){return db[_0xe8f0('0xb')][_0xe8f0('0x1b')]({'raw':_0x9c70c0[_0xe8f0('0xc')]?_0x9c70c0[_0xe8f0('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x9c70c0[_0xe8f0('0xc')]?_0x9c70c0[_0xe8f0('0xc')][_0xe8f0('0xe')]||null:null,'attributes':_0x9c70c0[_0xe8f0('0xc')]?_0x9c70c0['options']['attributes']||null:null,'include':_0x9c70c0[_0xe8f0('0xc')]?_0x9c70c0['options'][_0xe8f0('0x11')]?_[_0xe8f0('0x12')](_0x9c70c0['options']['include'],function(_0x549871){return{'model':db[_0x549871[_0xe8f0('0x13')]],'as':_0x549871['as'],'attributes':_0x549871['attributes'],'include':_0x549871[_0xe8f0('0x11')]?_['map'](_0x549871[_0xe8f0('0x11')],function(_0x1717ae){return{'model':db[_0x1717ae['model']],'as':_0x1717ae['as'],'attributes':_0x1717ae[_0xe8f0('0xf')],'include':_0x1717ae[_0xe8f0('0x11')]?_[_0xe8f0('0x12')](_0x1717ae[_0xe8f0('0x11')],function(_0x3216e2){return{'model':db[_0x3216e2['model']],'as':_0x3216e2['as'],'attributes':_0x3216e2[_0xe8f0('0xf')]};}):[]};}):[]};}):[]:[]})[_0xe8f0('0x14')](function(_0x4720e3){logger[_0xe8f0('0x15')](_0xe8f0('0x1a'),_0x9c70c0);logger[_0xe8f0('0x16')]('ShowSquareProject',_0x9c70c0,JSON[_0xe8f0('0x1c')](_0x4720e3));_0x5466e5(_0x4720e3);})[_0xe8f0('0x17')](function(_0x555e4b){logger[_0xe8f0('0x18')](_0xe8f0('0x1a'),_0x555e4b['message'],_0x9c70c0);_0x3e7ea7(_0x1d10c5['error'](0x1f4,_0x555e4b[_0xe8f0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ce7be01..ac67764 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 _0x2610=['squareProject:','./squareProject.events','save','remove','emit','removeListener','register'];(function(_0x5cd2ab,_0x2d162b){var _0x4663db=function(_0x54a66d){while(--_0x54a66d){_0x5cd2ab['push'](_0x5cd2ab['shift']());}};_0x4663db(++_0x2d162b);}(_0x2610,0xfd));var _0x0261=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x2610[_0x51cc1d];return _0x2eb9f2;};'use strict';var SquareProjectEvents=require(_0x0261('0x0'));var events=[_0x0261('0x1'),_0x0261('0x2'),'update'];function createListener(_0x2da022,_0x3951c2){return function(_0x7640df){_0x3951c2[_0x0261('0x3')](_0x2da022,_0x7640df);};}function removeListener(_0x1567eb,_0xae6050){return function(){SquareProjectEvents[_0x0261('0x4')](_0x1567eb,_0xae6050);};}exports[_0x0261('0x5')]=function(_0x2c68a2){for(var _0x497434=0x0,_0x573742=events['length'];_0x497434<_0x573742;_0x497434++){var _0x151a21=events[_0x497434];var _0x1c5652=createListener(_0x0261('0x6')+_0x151a21,_0x2c68a2);SquareProjectEvents['on'](_0x151a21,_0x1c5652);}}; \ No newline at end of file +var _0x53c9=['remove','update','register','squareProject:','save'];(function(_0x487e1a,_0x30a59a){var _0x517231=function(_0x1db838){while(--_0x1db838){_0x487e1a['push'](_0x487e1a['shift']());}};_0x517231(++_0x30a59a);}(_0x53c9,0x1cb));var _0x953c=function(_0x2e0876,_0x676cc1){_0x2e0876=_0x2e0876-0x0;var _0x6be532=_0x53c9[_0x2e0876];return _0x6be532;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x953c('0x0'),_0x953c('0x1'),_0x953c('0x2')];function createListener(_0x1b3020,_0x2296ab){return function(_0x110e6f){_0x2296ab['emit'](_0x1b3020,_0x110e6f);};}function removeListener(_0x381152,_0x36fbdf){return function(){SquareProjectEvents['removeListener'](_0x381152,_0x36fbdf);};}exports[_0x953c('0x3')]=function(_0x19fb1a){for(var _0x45c248=0x0,_0x29a5a8=events['length'];_0x45c248<_0x29a5a8;_0x45c248++){var _0x2391bc=events[_0x45c248];var _0x35387e=createListener(_0x953c('0x4')+_0x2391bc,_0x19fb1a);SquareProjectEvents['on'](_0x2391bc,_0x35387e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bcbd0b7..7171baa 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x3682f4,_0x400c9c){var _0x4b76c8=function(_0x15d78b){while(--_0x15d78b){_0x3682f4['push'](_0x3682f4['shift']());}};_0x4b76c8(++_0x400c9c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'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['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3c78d6,_0x2b37fd){var _0x22f1ce=function(_0x1325f5){while(--_0x1325f5){_0x3c78d6['push'](_0x3c78d6['shift']());}};_0x22f1ce(++_0x2b37fd);}(_0x4975,0x86));var _0x5497=function(_0x3f59a8,_0x4569d6){_0x3f59a8=_0x3f59a8-0x0;var _0x1a84de=_0x4975[_0x3f59a8];return _0x1a84de;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6aca92f..0b93a31 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 _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x3809b2,_0x53a675){var _0x49c253=function(_0x5d3e4a){while(--_0x5d3e4a){_0x3809b2['push'](_0x3809b2['shift']());}};_0x49c253(++_0x53a675);}(_0x425d,0x1e0));var _0xd425=function(_0x93a23e,_0xa070c0){_0x93a23e=_0x93a23e-0x0;var _0x449575=_0x425d[_0x93a23e];return _0x449575;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}}; \ No newline at end of file +var _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x2af11a,_0x443532){var _0x40d52e=function(_0xcfe7b2){while(--_0xcfe7b2){_0x2af11a['push'](_0x2af11a['shift']());}};_0x40d52e(++_0x443532);}(_0xac31,0xca));var _0x1ac3=function(_0x37d588,_0x5a48c7){_0x37d588=_0x37d588-0x0;var _0x39ff79=_0xac31[_0x37d588];return _0x39ff79;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4714481..f3b5247 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 _0x0d05=['extname','unlink','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','merge','create','body','update','find','uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x0d05,0xd0));var _0x50d0=function(_0x3d6907,_0x2f08fb){_0x3d6907=_0x3d6907-0x0;var _0x2ab3aa=_0x0d05[_0x3d6907];return _0x2ab3aa;};'use strict';var emlformat=require(_0x50d0('0x0'));var rimraf=require(_0x50d0('0x1'));var zipdir=require(_0x50d0('0x2'));var jsonpatch=require(_0x50d0('0x3'));var rp=require(_0x50d0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50d0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x50d0('0x6'));var csv=require(_0x50d0('0x7'));var ejs=require(_0x50d0('0x8'));var fs=require('fs');var fs_extra=require(_0x50d0('0x9'));var _=require(_0x50d0('0xa'));var squel=require(_0x50d0('0xb'));var crypto=require(_0x50d0('0xc'));var jsforce=require(_0x50d0('0xd'));var deskjs=require(_0x50d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x50d0('0xf'));var Papa=require(_0x50d0('0x10'));var Redis=require(_0x50d0('0x11'));var authService=require(_0x50d0('0x12'));var qs=require(_0x50d0('0x13'));var as=require(_0x50d0('0x14'));var hardwareService=require(_0x50d0('0x15'));var logger=require('../../config/logger')(_0x50d0('0x16'));var utils=require(_0x50d0('0x17'));var config=require(_0x50d0('0x18'));var licenseUtil=require(_0x50d0('0x19'));var db=require(_0x50d0('0x1a'))['db'];function respondWithStatusCode(_0x4d5cdc,_0x410f48){_0x410f48=_0x410f48||0xcc;return function(_0x4f0a76){if(_0x4f0a76){return _0x4d5cdc[_0x50d0('0x1b')](_0x410f48);}return _0x4d5cdc['status'](_0x410f48)[_0x50d0('0x1c')]();};}function respondWithResult(_0x44d54b,_0x2170fd){_0x2170fd=_0x2170fd||0xc8;return function(_0x59f885){if(_0x59f885){return _0x44d54b[_0x50d0('0x1d')](_0x2170fd)['json'](_0x59f885);}};}function respondWithFilteredResult(_0x28ecdc,_0x490a20){return function(_0xf9110){if(_0xf9110){var _0x28d453=typeof _0x490a20[_0x50d0('0x1e')]===_0x50d0('0x1f')&&typeof _0x490a20[_0x50d0('0x20')]===_0x50d0('0x1f');var _0x2af4b7=_0xf9110[_0x50d0('0x21')];var _0x3f7b8b=_0x28d453?0x0:_0x490a20[_0x50d0('0x1e')];var _0x44e0cf=_0x28d453?_0xf9110[_0x50d0('0x21')]:_0x490a20['offset']+_0x490a20[_0x50d0('0x20')];var _0x371ca4;if(_0x44e0cf>=_0x2af4b7){_0x44e0cf=_0x2af4b7;_0x371ca4=0xc8;}else{_0x371ca4=0xce;}_0x28ecdc[_0x50d0('0x1d')](_0x371ca4);return _0x28ecdc[_0x50d0('0x22')](_0x50d0('0x23'),_0x3f7b8b+'-'+_0x44e0cf+'/'+_0x2af4b7)[_0x50d0('0x24')](_0xf9110);}return null;};}function patchUpdates(_0x173fdf){return function(_0x3f9066){try{jsonpatch[_0x50d0('0x25')](_0x3f9066,_0x173fdf,!![]);}catch(_0x419198){return BPromise[_0x50d0('0x26')](_0x419198);}return _0x3f9066[_0x50d0('0x27')]();};}function saveUpdates(_0x391dba,_0x1b3c26){return function(_0x57a5f3){if(_0x57a5f3){return _0x57a5f3['update'](_0x391dba)[_0x50d0('0x28')](function(_0x4a61b6){return _0x4a61b6;});}return null;};}function removeEntity(_0x4c3a8b,_0x55027c){return function(_0x1f4fd0){if(_0x1f4fd0){return _0x1f4fd0[_0x50d0('0x29')]()[_0x50d0('0x28')](function(){_0x4c3a8b[_0x50d0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3122b3,_0x4787df){return function(_0x43724a){if(!_0x43724a){_0x3122b3[_0x50d0('0x1b')](0x194);}return _0x43724a;};}function handleError(_0x2d1940,_0x234893){_0x234893=_0x234893||0x1f4;return function(_0x27ae33){logger[_0x50d0('0x2a')](_0x27ae33[_0x50d0('0x2b')]);if(_0x27ae33[_0x50d0('0x2c')]){delete _0x27ae33[_0x50d0('0x2c')];}_0x2d1940[_0x50d0('0x1d')](_0x234893)[_0x50d0('0x2d')](_0x27ae33);};}exports[_0x50d0('0x2e')]=function(_0x2f2ee2,_0x3727b3){var _0x26db0a={},_0x6e1a4d={},_0x3264fa={'count':0x0,'rows':[]};var _0x45c3ed=_[_0x50d0('0x2f')](db[_0x50d0('0x30')][_0x50d0('0x31')],function(_0x196d2a){return{'name':_0x196d2a[_0x50d0('0x32')],'type':_0x196d2a[_0x50d0('0x33')][_0x50d0('0x34')]};});_0x6e1a4d[_0x50d0('0x35')]=_[_0x50d0('0x2f')](_0x45c3ed,_0x50d0('0x2c'));_0x6e1a4d[_0x50d0('0x36')]=_[_0x50d0('0x37')](_0x2f2ee2[_0x50d0('0x36')]);_0x6e1a4d[_0x50d0('0x38')]=_[_0x50d0('0x39')](_0x6e1a4d[_0x50d0('0x35')],_0x6e1a4d[_0x50d0('0x36')]);_0x26db0a[_0x50d0('0x3a')]=_[_0x50d0('0x39')](_0x6e1a4d[_0x50d0('0x35')],qs[_0x50d0('0x3b')](_0x2f2ee2[_0x50d0('0x36')]['fields']));_0x26db0a['attributes']=_0x26db0a['attributes'][_0x50d0('0x3c')]?_0x26db0a['attributes']:_0x6e1a4d[_0x50d0('0x35')];if(!_0x2f2ee2[_0x50d0('0x36')][_0x50d0('0x3d')]('nolimit')){_0x26db0a['limit']=qs[_0x50d0('0x20')](_0x2f2ee2[_0x50d0('0x36')][_0x50d0('0x20')]);_0x26db0a[_0x50d0('0x1e')]=qs[_0x50d0('0x1e')](_0x2f2ee2[_0x50d0('0x36')][_0x50d0('0x1e')]);}_0x26db0a[_0x50d0('0x3e')]=qs[_0x50d0('0x3f')](_0x2f2ee2['query'][_0x50d0('0x3f')]);_0x26db0a[_0x50d0('0x40')]=qs[_0x50d0('0x38')](_[_0x50d0('0x41')](_0x2f2ee2[_0x50d0('0x36')],_0x6e1a4d[_0x50d0('0x38')]),_0x45c3ed);if(_0x2f2ee2[_0x50d0('0x36')][_0x50d0('0x42')]){_0x26db0a['where']=_['merge'](_0x26db0a[_0x50d0('0x40')],{'$or':_['map'](_0x45c3ed,function(_0x698173){if(_0x698173[_0x50d0('0x33')]!==_0x50d0('0x43')){var _0x28f9c1={};_0x28f9c1[_0x698173['name']]={'$like':'%'+_0x2f2ee2[_0x50d0('0x36')]['filter']+'%'};return _0x28f9c1;}})});}_0x26db0a=_['merge']({},_0x26db0a,_0x2f2ee2[_0x50d0('0x44')]);var _0x283216={'where':_0x26db0a[_0x50d0('0x40')]};return db['SquareRecording']['count'](_0x283216)['then'](function(_0x165fc3){_0x3264fa[_0x50d0('0x21')]=_0x165fc3;if(_0x2f2ee2[_0x50d0('0x36')]['includeAll']){_0x26db0a[_0x50d0('0x45')]=[{'all':!![]}];}return db[_0x50d0('0x30')][_0x50d0('0x46')](_0x26db0a);})['then'](function(_0x2a0860){_0x3264fa[_0x50d0('0x47')]=_0x2a0860;return _0x3264fa;})[_0x50d0('0x28')](respondWithFilteredResult(_0x3727b3,_0x26db0a))[_0x50d0('0x48')](handleError(_0x3727b3,null));};exports[_0x50d0('0x49')]=function(_0x4ede83,_0x4d5b87){var _0x18c10f={'raw':!![],'where':{'id':_0x4ede83[_0x50d0('0x4a')]['id']}},_0x13cc76={};_0x13cc76[_0x50d0('0x35')]=_[_0x50d0('0x37')](db['SquareRecording']['rawAttributes']);_0x13cc76['query']=_[_0x50d0('0x37')](_0x4ede83['query']);_0x13cc76[_0x50d0('0x38')]=_['intersection'](_0x13cc76['model'],_0x13cc76[_0x50d0('0x36')]);_0x18c10f[_0x50d0('0x3a')]=_[_0x50d0('0x39')](_0x13cc76[_0x50d0('0x35')],qs[_0x50d0('0x3b')](_0x4ede83['query'][_0x50d0('0x3b')]));_0x18c10f[_0x50d0('0x3a')]=_0x18c10f['attributes'][_0x50d0('0x3c')]?_0x18c10f[_0x50d0('0x3a')]:_0x13cc76['model'];if(_0x4ede83['query']['includeAll']){_0x18c10f[_0x50d0('0x45')]=[{'all':!![]}];}_0x18c10f=_[_0x50d0('0x4b')]({},_0x18c10f,_0x4ede83['options']);return db[_0x50d0('0x30')]['find'](_0x18c10f)['then'](handleEntityNotFound(_0x4d5b87,null))[_0x50d0('0x28')](respondWithResult(_0x4d5b87,null))['catch'](handleError(_0x4d5b87,null));};exports[_0x50d0('0x4c')]=function(_0x4cc9c9,_0x8f9ee0){return db[_0x50d0('0x30')][_0x50d0('0x4c')](_0x4cc9c9[_0x50d0('0x4d')],{})['then'](respondWithResult(_0x8f9ee0,0xc9))[_0x50d0('0x48')](handleError(_0x8f9ee0,null));};exports[_0x50d0('0x4e')]=function(_0x36f5e2,_0x2f05a1){if(_0x36f5e2[_0x50d0('0x4d')]['id']){delete _0x36f5e2['body']['id'];}return db[_0x50d0('0x30')][_0x50d0('0x4f')]({'where':{'id':_0x36f5e2[_0x50d0('0x4a')]['id']}})[_0x50d0('0x28')](handleEntityNotFound(_0x2f05a1,null))[_0x50d0('0x28')](saveUpdates(_0x36f5e2['body'],null))[_0x50d0('0x28')](respondWithResult(_0x2f05a1,null))[_0x50d0('0x48')](handleError(_0x2f05a1,null));};exports['download']=function(_0x793c4c,_0x1560d0,_0xaa57a9){var _0x1b0ca6=require('../../components/encryptor');var _0x760634=![];var _0x198472={};if(_0x793c4c['query'][_0x50d0('0x33')]&&_0x793c4c[_0x50d0('0x36')][_0x50d0('0x33')]===_0x50d0('0x50')){_0x198472[_0x50d0('0x50')]=_0x793c4c['params']['id'];}else{_0x198472['id']=_0x793c4c[_0x50d0('0x4a')]['id'];}return db['SquareRecording'][_0x50d0('0x4f')]({'where':_0x198472,'attributes':['id',_0x50d0('0x51'),'filename'],'raw':!![]})[_0x50d0('0x28')](handleEntityNotFound(_0x1560d0,null))['then'](function(_0x5365bc){if(_0x5365bc){var _0x45ea5b=_0x5365bc[_0x50d0('0x51')];var _0xa15ec1=util[_0x50d0('0x52')]('%s.cypher',_0x45ea5b);if(fs[_0x50d0('0x53')](_0xa15ec1)){_0x760634=!![];return _0x1b0ca6[_0x50d0('0x54')](_0xa15ec1,_0x45ea5b,config[_0x50d0('0x55')][_0x50d0('0x56')])[_0x50d0('0x28')](function(){return _0x5365bc;});}return _0x5365bc;}})[_0x50d0('0x28')](function(_0xb344c1){if(_0xb344c1){var _0x3407c1=_0xb344c1[_0x50d0('0x51')];if(!fs[_0x50d0('0x53')](_0x3407c1)){throw new db[(_0x50d0('0x57'))][(_0x50d0('0x58'))](_0x50d0('0x59'));}if(_0xb344c1[_0x50d0('0x5a')]){return _0x1560d0[_0x50d0('0x5b')](_0x3407c1,_0xb344c1[_0x50d0('0x5a')]+path[_0x50d0('0x5c')](_0x3407c1),function(){if(_0x760634){fs[_0x50d0('0x5d')](_0x3407c1);}});}else{return _0x1560d0[_0x50d0('0x5b')](_0x3407c1,function(_0x44a78b){if(_0x760634){fs[_0x50d0('0x5d')](_0x3407c1);}});}}})[_0x50d0('0x48')](function(_0x34a7ff){if(_0x34a7ff['message']==='SquareRecording\x20not\x20found'){_0x1560d0['status'](0x194)[_0x50d0('0x2d')]('Not\x20found');}else{return handleError(_0x1560d0,null);}});};exports[_0x50d0('0x29')]=function(_0x1d35bc,_0x54b68a){return db[_0x50d0('0x30')]['find']({'where':{'id':_0x1d35bc[_0x50d0('0x4a')]['id']}})['then'](function(_0x5e0793){if(_['isNil'](_0x5e0793)){throw new ReferenceError(_0x50d0('0x5e'));}return _0x5e0793;})[_0x50d0('0x28')](function(_0x496162){var _0x47d481=_0x496162[_0x50d0('0x51')];logger[_0x50d0('0x5f')](_0x50d0('0x60'),_0x47d481);if(!_[_0x50d0('0x61')](_0x496162[_0x50d0('0x51')])&&fs[_0x50d0('0x53')](_0x47d481)){logger[_0x50d0('0x5f')]('File:\x20\x22'+_0x47d481+_0x50d0('0x62'));fs['unlinkSync'](_0x47d481);}_0x47d481=_0x47d481+_0x50d0('0x63');if(!_[_0x50d0('0x61')](_0x496162[_0x50d0('0x51')])&&fs[_0x50d0('0x53')](_0x47d481)){logger[_0x50d0('0x5f')]('File:\x20\x22'+_0x47d481+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x47d481);}return _0x496162;})['then'](function(_0x11ab02){if(!_0x11ab02)throw new InternalError();return _0x11ab02[_0x50d0('0x29')]();})['then'](function(){_0x54b68a[_0x50d0('0x1d')](0xcc)[_0x50d0('0x1c')]();})[_0x50d0('0x48')](handleError(_0x54b68a,null));}; \ No newline at end of file +var _0x68de=['path','sox','to-csv','ejs','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','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','SquareRecording','includeAll','findAll','catch','show','params','keys','find','create','body','update','download','uniqueid','savePath','filename','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4ccde2,_0x31bfb9){var _0x1e011d=function(_0x17bb70){while(--_0x17bb70){_0x4ccde2['push'](_0x4ccde2['shift']());}};_0x1e011d(++_0x31bfb9);}(_0x68de,0x1e6));var _0xe68d=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x68de[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0xe68d('0x0'));var rimraf=require(_0xe68d('0x1'));var zipdir=require(_0xe68d('0x2'));var jsonpatch=require(_0xe68d('0x3'));var rp=require(_0xe68d('0x4'));var moment=require(_0xe68d('0x5'));var BPromise=require(_0xe68d('0x6'));var Mustache=require(_0xe68d('0x7'));var util=require(_0xe68d('0x8'));var path=require(_0xe68d('0x9'));var sox=require(_0xe68d('0xa'));var csv=require(_0xe68d('0xb'));var ejs=require(_0xe68d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe68d('0xd'));var squel=require('squel');var crypto=require(_0xe68d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe68d('0xf'));var toCsv=require(_0xe68d('0xb'));var querystring=require(_0xe68d('0x10'));var Papa=require(_0xe68d('0x11'));var Redis=require('ioredis');var authService=require(_0xe68d('0x12'));var qs=require(_0xe68d('0x13'));var as=require(_0xe68d('0x14'));var hardwareService=require(_0xe68d('0x15'));var logger=require(_0xe68d('0x16'))(_0xe68d('0x17'));var utils=require(_0xe68d('0x18'));var config=require(_0xe68d('0x19'));var licenseUtil=require(_0xe68d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29457f,_0x44aba3){_0x44aba3=_0x44aba3||0xcc;return function(_0x5127d2){if(_0x5127d2){return _0x29457f[_0xe68d('0x1b')](_0x44aba3);}return _0x29457f['status'](_0x44aba3)[_0xe68d('0x1c')]();};}function respondWithResult(_0x2f407c,_0x28c883){_0x28c883=_0x28c883||0xc8;return function(_0x53742e){if(_0x53742e){return _0x2f407c[_0xe68d('0x1d')](_0x28c883)[_0xe68d('0x1e')](_0x53742e);}};}function respondWithFilteredResult(_0x1fb70e,_0x4755f8){return function(_0xe317cc){if(_0xe317cc){var _0x7c7f7d=typeof _0x4755f8[_0xe68d('0x1f')]==='undefined'&&typeof _0x4755f8[_0xe68d('0x20')]===_0xe68d('0x21');var _0x5a9763=_0xe317cc[_0xe68d('0x22')];var _0xf9e76=_0x7c7f7d?0x0:_0x4755f8[_0xe68d('0x1f')];var _0x294a2a=_0x7c7f7d?_0xe317cc['count']:_0x4755f8[_0xe68d('0x1f')]+_0x4755f8[_0xe68d('0x20')];var _0x55fe2;if(_0x294a2a>=_0x5a9763){_0x294a2a=_0x5a9763;_0x55fe2=0xc8;}else{_0x55fe2=0xce;}_0x1fb70e['status'](_0x55fe2);return _0x1fb70e[_0xe68d('0x23')](_0xe68d('0x24'),_0xf9e76+'-'+_0x294a2a+'/'+_0x5a9763)['json'](_0xe317cc);}return null;};}function patchUpdates(_0xe3e555){return function(_0x4dce92){try{jsonpatch[_0xe68d('0x25')](_0x4dce92,_0xe3e555,!![]);}catch(_0x197816){return BPromise[_0xe68d('0x26')](_0x197816);}return _0x4dce92[_0xe68d('0x27')]();};}function saveUpdates(_0x146d26,_0x48097c){return function(_0x1e246d){if(_0x1e246d){return _0x1e246d['update'](_0x146d26)[_0xe68d('0x28')](function(_0x22ac83){return _0x22ac83;});}return null;};}function removeEntity(_0x25c08e,_0x362362){return function(_0x4573de){if(_0x4573de){return _0x4573de[_0xe68d('0x29')]()[_0xe68d('0x28')](function(){_0x25c08e[_0xe68d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b39ae,_0x15e2e7){return function(_0x1756a7){if(!_0x1756a7){_0x2b39ae[_0xe68d('0x1b')](0x194);}return _0x1756a7;};}function handleError(_0x22d71f,_0x1ebc25){_0x1ebc25=_0x1ebc25||0x1f4;return function(_0x470f5e){logger[_0xe68d('0x2a')](_0x470f5e['stack']);if(_0x470f5e[_0xe68d('0x2b')]){delete _0x470f5e[_0xe68d('0x2b')];}_0x22d71f[_0xe68d('0x1d')](_0x1ebc25)[_0xe68d('0x2c')](_0x470f5e);};}exports['index']=function(_0x3f2b66,_0x1aadce){var _0x65f9df={},_0x2978c7={},_0x44f9b5={'count':0x0,'rows':[]};var _0x3d6705=_[_0xe68d('0x2d')](db['SquareRecording'][_0xe68d('0x2e')],function(_0x6bb11d){return{'name':_0x6bb11d[_0xe68d('0x2f')],'type':_0x6bb11d[_0xe68d('0x30')][_0xe68d('0x31')]};});_0x2978c7[_0xe68d('0x32')]=_[_0xe68d('0x2d')](_0x3d6705,_0xe68d('0x2b'));_0x2978c7[_0xe68d('0x33')]=_['keys'](_0x3f2b66[_0xe68d('0x33')]);_0x2978c7[_0xe68d('0x34')]=_[_0xe68d('0x35')](_0x2978c7[_0xe68d('0x32')],_0x2978c7[_0xe68d('0x33')]);_0x65f9df[_0xe68d('0x36')]=_[_0xe68d('0x35')](_0x2978c7[_0xe68d('0x32')],qs['fields'](_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x37')]));_0x65f9df[_0xe68d('0x36')]=_0x65f9df[_0xe68d('0x36')][_0xe68d('0x38')]?_0x65f9df[_0xe68d('0x36')]:_0x2978c7[_0xe68d('0x32')];if(!_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x39')]('nolimit')){_0x65f9df[_0xe68d('0x20')]=qs[_0xe68d('0x20')](_0x3f2b66['query'][_0xe68d('0x20')]);_0x65f9df['offset']=qs[_0xe68d('0x1f')](_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x1f')]);}_0x65f9df['order']=qs[_0xe68d('0x3a')](_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x3a')]);_0x65f9df[_0xe68d('0x3b')]=qs['filters'](_[_0xe68d('0x3c')](_0x3f2b66[_0xe68d('0x33')],_0x2978c7['filters']),_0x3d6705);if(_0x3f2b66[_0xe68d('0x33')]['filter']){_0x65f9df[_0xe68d('0x3b')]=_[_0xe68d('0x3d')](_0x65f9df[_0xe68d('0x3b')],{'$or':_[_0xe68d('0x2d')](_0x3d6705,function(_0x1dcaf0){if(_0x1dcaf0[_0xe68d('0x30')]!==_0xe68d('0x3e')){var _0x3b21b1={};_0x3b21b1[_0x1dcaf0[_0xe68d('0x2b')]]={'$like':'%'+_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x3f')]+'%'};return _0x3b21b1;}})});}_0x65f9df=_[_0xe68d('0x3d')]({},_0x65f9df,_0x3f2b66[_0xe68d('0x40')]);var _0x103003={'where':_0x65f9df[_0xe68d('0x3b')]};return db[_0xe68d('0x41')][_0xe68d('0x22')](_0x103003)['then'](function(_0x12c539){_0x44f9b5[_0xe68d('0x22')]=_0x12c539;if(_0x3f2b66[_0xe68d('0x33')][_0xe68d('0x42')]){_0x65f9df['include']=[{'all':!![]}];}return db[_0xe68d('0x41')][_0xe68d('0x43')](_0x65f9df);})['then'](function(_0x13a338){_0x44f9b5['rows']=_0x13a338;return _0x44f9b5;})['then'](respondWithFilteredResult(_0x1aadce,_0x65f9df))[_0xe68d('0x44')](handleError(_0x1aadce,null));};exports[_0xe68d('0x45')]=function(_0x36a237,_0x33c7a0){var _0x3b157e={'raw':!![],'where':{'id':_0x36a237[_0xe68d('0x46')]['id']}},_0x490785={};_0x490785[_0xe68d('0x32')]=_[_0xe68d('0x47')](db[_0xe68d('0x41')][_0xe68d('0x2e')]);_0x490785['query']=_['keys'](_0x36a237[_0xe68d('0x33')]);_0x490785[_0xe68d('0x34')]=_['intersection'](_0x490785[_0xe68d('0x32')],_0x490785[_0xe68d('0x33')]);_0x3b157e[_0xe68d('0x36')]=_[_0xe68d('0x35')](_0x490785[_0xe68d('0x32')],qs[_0xe68d('0x37')](_0x36a237[_0xe68d('0x33')][_0xe68d('0x37')]));_0x3b157e['attributes']=_0x3b157e['attributes'][_0xe68d('0x38')]?_0x3b157e[_0xe68d('0x36')]:_0x490785[_0xe68d('0x32')];if(_0x36a237['query'][_0xe68d('0x42')]){_0x3b157e['include']=[{'all':!![]}];}_0x3b157e=_[_0xe68d('0x3d')]({},_0x3b157e,_0x36a237['options']);return db['SquareRecording'][_0xe68d('0x48')](_0x3b157e)[_0xe68d('0x28')](handleEntityNotFound(_0x33c7a0,null))[_0xe68d('0x28')](respondWithResult(_0x33c7a0,null))[_0xe68d('0x44')](handleError(_0x33c7a0,null));};exports[_0xe68d('0x49')]=function(_0x50f051,_0x3de98a){return db[_0xe68d('0x41')][_0xe68d('0x49')](_0x50f051[_0xe68d('0x4a')],{})[_0xe68d('0x28')](respondWithResult(_0x3de98a,0xc9))['catch'](handleError(_0x3de98a,null));};exports[_0xe68d('0x4b')]=function(_0x56b4a5,_0x164deb){if(_0x56b4a5['body']['id']){delete _0x56b4a5[_0xe68d('0x4a')]['id'];}return db[_0xe68d('0x41')][_0xe68d('0x48')]({'where':{'id':_0x56b4a5['params']['id']}})['then'](handleEntityNotFound(_0x164deb,null))['then'](saveUpdates(_0x56b4a5[_0xe68d('0x4a')],null))[_0xe68d('0x28')](respondWithResult(_0x164deb,null))[_0xe68d('0x44')](handleError(_0x164deb,null));};exports[_0xe68d('0x4c')]=function(_0x138953,_0xdf615a,_0x30f624){var _0x136bcc=require('../../components/encryptor');var _0x2a6db2=![];var _0x1bf3e3={};if(_0x138953[_0xe68d('0x33')]['type']&&_0x138953[_0xe68d('0x33')][_0xe68d('0x30')]===_0xe68d('0x4d')){_0x1bf3e3[_0xe68d('0x4d')]=_0x138953[_0xe68d('0x46')]['id'];}else{_0x1bf3e3['id']=_0x138953[_0xe68d('0x46')]['id'];}return db[_0xe68d('0x41')][_0xe68d('0x48')]({'where':_0x1bf3e3,'attributes':['id',_0xe68d('0x4e'),_0xe68d('0x4f')],'raw':!![]})[_0xe68d('0x28')](handleEntityNotFound(_0xdf615a,null))[_0xe68d('0x28')](function(_0x4c16fc){if(_0x4c16fc){var _0x4ff148=_0x4c16fc[_0xe68d('0x4e')];var _0x2ea07e=util[_0xe68d('0x50')]('%s.cypher',_0x4ff148);if(fs['existsSync'](_0x2ea07e)){_0x2a6db2=!![];return _0x136bcc[_0xe68d('0x51')](_0x2ea07e,_0x4ff148,config[_0xe68d('0x52')][_0xe68d('0x53')])[_0xe68d('0x28')](function(){return _0x4c16fc;});}return _0x4c16fc;}})[_0xe68d('0x28')](function(_0x5541fe){if(_0x5541fe){var _0x5cf524=_0x5541fe[_0xe68d('0x4e')];if(!fs[_0xe68d('0x54')](_0x5cf524)){throw new db[(_0xe68d('0x55'))][(_0xe68d('0x56'))]('SquareRecording\x20not\x20found');}if(_0x5541fe[_0xe68d('0x4f')]){return _0xdf615a['download'](_0x5cf524,_0x5541fe[_0xe68d('0x4f')]+path[_0xe68d('0x57')](_0x5cf524),function(){if(_0x2a6db2){fs[_0xe68d('0x58')](_0x5cf524);}});}else{return _0xdf615a[_0xe68d('0x4c')](_0x5cf524,function(_0x4a01d9){if(_0x2a6db2){fs['unlink'](_0x5cf524);}});}}})['catch'](function(_0x593594){if(_0x593594[_0xe68d('0x59')]===_0xe68d('0x5a')){_0xdf615a['status'](0x194)['send'](_0xe68d('0x5b'));}else{return handleError(_0xdf615a,null);}});};exports[_0xe68d('0x29')]=function(_0x599a43,_0x4d3240){return db[_0xe68d('0x41')][_0xe68d('0x48')]({'where':{'id':_0x599a43[_0xe68d('0x46')]['id']}})[_0xe68d('0x28')](function(_0x3346e3){if(_[_0xe68d('0x5c')](_0x3346e3)){throw new ReferenceError(_0xe68d('0x5d'));}return _0x3346e3;})['then'](function(_0x3acc2f){var _0x35a184=_0x3acc2f['savePath'];logger[_0xe68d('0x5e')](_0xe68d('0x5f'),_0x35a184);if(!_[_0xe68d('0x5c')](_0x3acc2f[_0xe68d('0x4e')])&&fs[_0xe68d('0x54')](_0x35a184)){logger['info']('File:\x20\x22'+_0x35a184+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe68d('0x60')](_0x35a184);}_0x35a184=_0x35a184+'.cypher';if(!_[_0xe68d('0x5c')](_0x3acc2f[_0xe68d('0x4e')])&&fs[_0xe68d('0x54')](_0x35a184)){logger[_0xe68d('0x5e')](_0xe68d('0x61')+_0x35a184+_0xe68d('0x62'));fs[_0xe68d('0x60')](_0x35a184);}return _0x3acc2f;})[_0xe68d('0x28')](function(_0x484e3f){if(!_0x484e3f)throw new InternalError();return _0x484e3f['destroy']();})[_0xe68d('0x28')](function(){_0x4d3240['status'](0xcc)[_0xe68d('0x1c')]();})[_0xe68d('0x44')](handleError(_0x4d3240,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8a4dc21..4bcc84d 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 _0x8af6=['rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x155a7e,_0x4af489){var _0x5704cc=function(_0x5e3339){while(--_0x5e3339){_0x155a7e['push'](_0x155a7e['shift']());}};_0x5704cc(++_0x4af489);}(_0x8af6,0x76));var _0x68af=function(_0x43b477,_0x27f967){_0x43b477=_0x43b477-0x0;var _0x54f832=_0x8af6[_0x43b477];return _0x54f832;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var logger=require(_0x68af('0x2'))(_0x68af('0x3'));var moment=require(_0x68af('0x4'));var BPromise=require(_0x68af('0x5'));var rp=require(_0x68af('0x6'));var fs=require('fs');var path=require(_0x68af('0x7'));var rimraf=require(_0x68af('0x8'));var config=require(_0x68af('0x9'));var attributes=require('./squareRecording.attributes');module[_0x68af('0xa')]=function(_0x5a23da,_0x36e91a){return _0x5a23da[_0x68af('0xb')](_0x68af('0xc'),attributes,{'tableName':_0x68af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa64=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','api','bluebird','request-promise','path'];(function(_0x583761,_0x119f81){var _0x4b72f0=function(_0x351cad){while(--_0x351cad){_0x583761['push'](_0x583761['shift']());}};_0x4b72f0(++_0x119f81);}(_0xaa64,0xf7));var _0x4aa6=function(_0xeb7b15,_0x3faeb1){_0xeb7b15=_0xeb7b15-0x0;var _0x2107ee=_0xaa64[_0xeb7b15];return _0x2107ee;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var logger=require('../../config/logger')(_0x4aa6('0x2'));var moment=require('moment');var BPromise=require(_0x4aa6('0x3'));var rp=require(_0x4aa6('0x4'));var fs=require('fs');var path=require(_0x4aa6('0x5'));var rimraf=require('rimraf');var config=require(_0x4aa6('0x6'));var attributes=require(_0x4aa6('0x7'));module[_0x4aa6('0x8')]=function(_0x37a260,_0x426bd6){return _0x37a260[_0x4aa6('0x9')](_0x4aa6('0xa'),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 3396591..a9fbf7c 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 _0x5bfb=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','create','options','raw','CreateSquareRecording','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x5bfb,0x184));var _0xb5bf=function(_0x44e3eb,_0x2559ee){_0x44e3eb=_0x44e3eb-0x0;var _0x259e61=_0x5bfb[_0x44e3eb];return _0x259e61;};'use strict';var _=require('lodash');var util=require(_0xb5bf('0x0'));var moment=require(_0xb5bf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5bf('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5bf('0x3'))(_0xb5bf('0x4'));var config=require(_0xb5bf('0x5'));var jayson=require(_0xb5bf('0x6'));var client=jayson['client'][_0xb5bf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7ed9a3,_0x2fd8cd,_0x5386fd){return new BPromise(function(_0x441313,_0x513ffc){return client['request'](_0x7ed9a3,_0x5386fd)[_0xb5bf('0x8')](function(_0xb8f56d){logger[_0xb5bf('0x9')](_0xb5bf('0xa'),_0x2fd8cd,_0xb5bf('0xb'));logger[_0xb5bf('0xc')](_0xb5bf('0xd'),_0x2fd8cd,_0xb5bf('0xb'),JSON[_0xb5bf('0xe')](_0xb8f56d));if(_0xb8f56d[_0xb5bf('0xf')]){if(_0xb8f56d[_0xb5bf('0xf')][_0xb5bf('0x10')]===0x1f4){logger[_0xb5bf('0xf')](_0xb5bf('0xa'),_0x2fd8cd,_0xb8f56d[_0xb5bf('0xf')][_0xb5bf('0x11')]);return _0x513ffc(_0xb8f56d['error'][_0xb5bf('0x11')]);}logger[_0xb5bf('0xf')](_0xb5bf('0xa'),_0x2fd8cd,_0xb8f56d['error']['message']);return _0x441313(_0xb8f56d[_0xb5bf('0xf')][_0xb5bf('0x11')]);}else{logger['info'](_0xb5bf('0xa'),_0x2fd8cd,_0xb5bf('0xb'));_0x441313(_0xb8f56d[_0xb5bf('0x12')][_0xb5bf('0x11')]);}})[_0xb5bf('0x13')](function(_0x15613f){logger[_0xb5bf('0xf')](_0xb5bf('0xa'),_0x2fd8cd,_0x15613f);_0x513ffc(_0x15613f);});});}exports['CreateSquareRecording']=function(_0x142bfd){var _0x57ad16=this;return new Promise(function(_0x9727e4,_0x105281){return db[_0xb5bf('0x14')][_0xb5bf('0x15')](_0x142bfd['body'],{'raw':_0x142bfd[_0xb5bf('0x16')]?_0x142bfd[_0xb5bf('0x16')][_0xb5bf('0x17')]===undefined?!![]:![]:!![]})[_0xb5bf('0x8')](function(_0x2f775b){logger[_0xb5bf('0x9')](_0xb5bf('0x18'),_0x142bfd);logger[_0xb5bf('0xc')](_0xb5bf('0x18'),_0x142bfd,JSON['stringify'](_0x2f775b));_0x9727e4(_0x2f775b);})['catch'](function(_0x4d1d2d){logger[_0xb5bf('0xf')](_0xb5bf('0x18'),_0x4d1d2d[_0xb5bf('0x11')],_0x142bfd);_0x105281(_0x57ad16[_0xb5bf('0xf')](0x1f4,_0x4d1d2d[_0xb5bf('0x11')]));});});}; \ No newline at end of file +var _0x3ee5=['../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1df9a2,_0x53b7c8){var _0x555a87=function(_0x3495e0){while(--_0x3495e0){_0x1df9a2['push'](_0x1df9a2['shift']());}};_0x555a87(++_0x53b7c8);}(_0x3ee5,0xe8));var _0x53ee=function(_0xf3ed1a,_0x175c35){_0xf3ed1a=_0xf3ed1a-0x0;var _0x4914da=_0x3ee5[_0xf3ed1a];return _0x4914da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53ee('0x0'));var BPromise=require(_0x53ee('0x1'));var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson['client'][_0x53ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37e1d7,_0x3df953,_0x38b039){return new BPromise(function(_0x5ce4e4,_0xe761c7){return client[_0x53ee('0xb')](_0x37e1d7,_0x38b039)[_0x53ee('0xc')](function(_0x426337){logger[_0x53ee('0xd')](_0x53ee('0xe'),_0x3df953,_0x53ee('0xf'));logger['debug'](_0x53ee('0x10'),_0x3df953,_0x53ee('0xf'),JSON['stringify'](_0x426337));if(_0x426337[_0x53ee('0x11')]){if(_0x426337['error'][_0x53ee('0x12')]===0x1f4){logger['error'](_0x53ee('0xe'),_0x3df953,_0x426337['error'][_0x53ee('0x13')]);return _0xe761c7(_0x426337[_0x53ee('0x11')]['message']);}logger[_0x53ee('0x11')](_0x53ee('0xe'),_0x3df953,_0x426337['error'][_0x53ee('0x13')]);return _0x5ce4e4(_0x426337[_0x53ee('0x11')][_0x53ee('0x13')]);}else{logger[_0x53ee('0xd')](_0x53ee('0xe'),_0x3df953,_0x53ee('0xf'));_0x5ce4e4(_0x426337[_0x53ee('0x14')][_0x53ee('0x13')]);}})[_0x53ee('0x15')](function(_0x4bc490){logger[_0x53ee('0x11')](_0x53ee('0xe'),_0x3df953,_0x4bc490);_0xe761c7(_0x4bc490);});});}exports['CreateSquareRecording']=function(_0x5617be){var _0x23291b=this;return new Promise(function(_0x1976fd,_0x35dd82){return db[_0x53ee('0x16')][_0x53ee('0x17')](_0x5617be[_0x53ee('0x18')],{'raw':_0x5617be[_0x53ee('0x19')]?_0x5617be[_0x53ee('0x19')][_0x53ee('0x1a')]===undefined?!![]:![]:!![]})[_0x53ee('0xc')](function(_0x53a071){logger['info'](_0x53ee('0x1b'),_0x5617be);logger[_0x53ee('0x1c')]('CreateSquareRecording',_0x5617be,JSON[_0x53ee('0x1d')](_0x53a071));_0x1976fd(_0x53a071);})[_0x53ee('0x15')](function(_0x5a6635){logger[_0x53ee('0x11')](_0x53ee('0x1b'),_0x5a6635[_0x53ee('0x13')],_0x5617be);_0x35dd82(_0x23291b['error'](0x1f4,_0x5a6635[_0x53ee('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0fb03ff..c24a806 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(_0x3a8b7c,_0x3e5db2){var _0x40eb80=function(_0x8db6a3){while(--_0x8db6a3){_0x3a8b7c['push'](_0x3a8b7c['shift']());}};_0x40eb80(++_0x3e5db2);}(_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(_0xe4bc5b,_0x47d956){var _0x3efc28=function(_0x4268a3){while(--_0x4268a3){_0xe4bc5b['push'](_0xe4bc5b['shift']());}};_0x3efc28(++_0x47d956);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ed0d5,_0x5f0e1f){_0x3ed0d5=_0x3ed0d5-0x0;var _0x5e4563=_0xb10b[_0x3ed0d5];return _0x5e4563;};'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 6bfe859..4e5f1c3 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 _0x3fd2=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x253a90,_0x300c72){var _0x2e1b5e=function(_0x3b1e4f){while(--_0x3b1e4f){_0x253a90['push'](_0x253a90['shift']());}};_0x2e1b5e(++_0x300c72);}(_0x3fd2,0x15f));var _0x23fd=function(_0x16a23f,_0x39df07){_0x16a23f=_0x16a23f-0x0;var _0x242300=_0x3fd2[_0x16a23f];return _0x242300;};'use strict';var Sequelize=require(_0x23fd('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x23fd('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x23fd('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x23fd('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x23fd('0x1')]},'callerid':{'type':Sequelize[_0x23fd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x23fd('0x1')]},'callingani2':{'type':Sequelize[_0x23fd('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x23fd('0x1')]},'extension':{'type':Sequelize[_0x23fd('0x1')]},'priority':{'type':Sequelize[_0x23fd('0x1')]},'enhanced':{'type':Sequelize[_0x23fd('0x1')]},'accountcode':{'type':Sequelize[_0x23fd('0x1')]},'threadid':{'type':Sequelize[_0x23fd('0x1')]},'project_name':{'type':Sequelize[_0x23fd('0x1')]},'joinAt':{'type':Sequelize[_0x23fd('0x2')]},'leaveAt':{'type':Sequelize[_0x23fd('0x2')]},'bot':{'type':Sequelize[_0x23fd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xeca8=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeca8,0x1f2));var _0x8eca=function(_0x43cf32,_0x3128a1){_0x43cf32=_0x43cf32-0x0;var _0x265761=_0xeca8[_0x43cf32];return _0x265761;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'network':{'type':Sequelize[_0x8eca('0x2')]},'network_script':{'type':Sequelize[_0x8eca('0x2')]},'request':{'type':Sequelize[_0x8eca('0x2')]},'channel':{'type':Sequelize[_0x8eca('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8eca('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x8eca('0x2')]},'callerid':{'type':Sequelize[_0x8eca('0x2')]},'calleridname':{'type':Sequelize[_0x8eca('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x8eca('0x2')]},'callington':{'type':Sequelize[_0x8eca('0x2')]},'callingtns':{'type':Sequelize[_0x8eca('0x2')]},'dnid':{'type':Sequelize[_0x8eca('0x2')]},'rdnis':{'type':Sequelize[_0x8eca('0x2')]},'context':{'type':Sequelize[_0x8eca('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8eca('0x2')]},'enhanced':{'type':Sequelize[_0x8eca('0x2')]},'accountcode':{'type':Sequelize[_0x8eca('0x2')]},'threadid':{'type':Sequelize[_0x8eca('0x2')]},'project_name':{'type':Sequelize[_0x8eca('0x2')]},'joinAt':{'type':Sequelize[_0x8eca('0x3')]},'leaveAt':{'type':Sequelize[_0x8eca('0x3')]},'bot':{'type':Sequelize[_0x8eca('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 3ecc09f..166a114 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 _0x90f9=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x25038b,_0x24ca29){var _0x28e79c=function(_0xdc8eea){while(--_0xdc8eea){_0x25038b['push'](_0x25038b['shift']());}};_0x28e79c(++_0x24ca29);}(_0x90f9,0xee));var _0x990f=function(_0xb786c3,_0x990f9c){_0xb786c3=_0xb786c3-0x0;var _0x586af3=_0x90f9[_0xb786c3];return _0x586af3;};'use strict';var emlformat=require(_0x990f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x990f('0x1'));var moment=require(_0x990f('0x2'));var BPromise=require(_0x990f('0x3'));var Mustache=require('mustache');var util=require(_0x990f('0x4'));var path=require('path');var sox=require(_0x990f('0x5'));var csv=require(_0x990f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x990f('0x7'));var _=require('lodash');var squel=require(_0x990f('0x8'));var crypto=require(_0x990f('0x9'));var jsforce=require(_0x990f('0xa'));var deskjs=require(_0x990f('0xb'));var toCsv=require(_0x990f('0x6'));var querystring=require(_0x990f('0xc'));var Papa=require(_0x990f('0xd'));var Redis=require('ioredis');var authService=require(_0x990f('0xe'));var qs=require(_0x990f('0xf'));var as=require(_0x990f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x990f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x990f('0x12'));var db=require(_0x990f('0x13'))['db'];function respondWithStatusCode(_0xa68943,_0x26edb8){_0x26edb8=_0x26edb8||0xcc;return function(_0x3cc138){if(_0x3cc138){return _0xa68943[_0x990f('0x14')](_0x26edb8);}return _0xa68943['status'](_0x26edb8)[_0x990f('0x15')]();};}function respondWithResult(_0x4d9cea,_0x931e32){_0x931e32=_0x931e32||0xc8;return function(_0x3d05ee){if(_0x3d05ee){return _0x4d9cea[_0x990f('0x16')](_0x931e32)[_0x990f('0x17')](_0x3d05ee);}};}function respondWithFilteredResult(_0x36f99e,_0x9b1d61){return function(_0xcd3c01){if(_0xcd3c01){var _0x4bbd6b=typeof _0x9b1d61[_0x990f('0x18')]===_0x990f('0x19')&&typeof _0x9b1d61[_0x990f('0x1a')]==='undefined';var _0x4f360b=_0xcd3c01[_0x990f('0x1b')];var _0x1ddb34=_0x4bbd6b?0x0:_0x9b1d61[_0x990f('0x18')];var _0x368ccb=_0x4bbd6b?_0xcd3c01['count']:_0x9b1d61[_0x990f('0x18')]+_0x9b1d61[_0x990f('0x1a')];var _0x583308;if(_0x368ccb>=_0x4f360b){_0x368ccb=_0x4f360b;_0x583308=0xc8;}else{_0x583308=0xce;}_0x36f99e['status'](_0x583308);return _0x36f99e[_0x990f('0x1c')](_0x990f('0x1d'),_0x1ddb34+'-'+_0x368ccb+'/'+_0x4f360b)['json'](_0xcd3c01);}return null;};}function patchUpdates(_0x312b1e){return function(_0x2d32b7){try{jsonpatch[_0x990f('0x1e')](_0x2d32b7,_0x312b1e,!![]);}catch(_0x5221b8){return BPromise[_0x990f('0x1f')](_0x5221b8);}return _0x2d32b7[_0x990f('0x20')]();};}function saveUpdates(_0x296979,_0x7d5ecb){return function(_0x3910c5){if(_0x3910c5){return _0x3910c5[_0x990f('0x21')](_0x296979)[_0x990f('0x22')](function(_0x4471b8){return _0x4471b8;});}return null;};}function removeEntity(_0x18e299,_0x354ec0){return function(_0x13642d){if(_0x13642d){return _0x13642d[_0x990f('0x23')]()[_0x990f('0x22')](function(){_0x18e299['status'](0xcc)[_0x990f('0x15')]();});}};}function handleEntityNotFound(_0x3d41ee,_0xc3cde){return function(_0x3f9114){if(!_0x3f9114){_0x3d41ee[_0x990f('0x14')](0x194);}return _0x3f9114;};}function handleError(_0x44f0c9,_0x40bd30){_0x40bd30=_0x40bd30||0x1f4;return function(_0xde40d3){logger[_0x990f('0x24')](_0xde40d3[_0x990f('0x25')]);if(_0xde40d3[_0x990f('0x26')]){delete _0xde40d3[_0x990f('0x26')];}_0x44f0c9[_0x990f('0x16')](_0x40bd30)[_0x990f('0x27')](_0xde40d3);};}exports['index']=function(_0x254e84,_0x3b3d26){var _0x433e5b={},_0x17b53c={},_0x209194={'count':0x0,'rows':[]};var _0x2e1366=_[_0x990f('0x28')](db[_0x990f('0x29')][_0x990f('0x2a')],function(_0x387b4e){return{'name':_0x387b4e['fieldName'],'type':_0x387b4e[_0x990f('0x2b')][_0x990f('0x2c')]};});_0x17b53c[_0x990f('0x2d')]=_['map'](_0x2e1366,_0x990f('0x26'));_0x17b53c[_0x990f('0x2e')]=_[_0x990f('0x2f')](_0x254e84[_0x990f('0x2e')]);_0x17b53c[_0x990f('0x30')]=_[_0x990f('0x31')](_0x17b53c[_0x990f('0x2d')],_0x17b53c[_0x990f('0x2e')]);_0x433e5b[_0x990f('0x32')]=_['intersection'](_0x17b53c[_0x990f('0x2d')],qs[_0x990f('0x33')](_0x254e84[_0x990f('0x2e')][_0x990f('0x33')]));_0x433e5b[_0x990f('0x32')]=_0x433e5b[_0x990f('0x32')][_0x990f('0x34')]?_0x433e5b['attributes']:_0x17b53c['model'];if(!_0x254e84[_0x990f('0x2e')][_0x990f('0x35')](_0x990f('0x36'))){_0x433e5b[_0x990f('0x1a')]=qs[_0x990f('0x1a')](_0x254e84[_0x990f('0x2e')][_0x990f('0x1a')]);_0x433e5b[_0x990f('0x18')]=qs['offset'](_0x254e84['query']['offset']);}_0x433e5b[_0x990f('0x37')]=qs[_0x990f('0x38')](_0x254e84[_0x990f('0x2e')][_0x990f('0x38')]);_0x433e5b[_0x990f('0x39')]=qs['filters'](_[_0x990f('0x3a')](_0x254e84['query'],_0x17b53c[_0x990f('0x30')]),_0x2e1366);if(_0x254e84[_0x990f('0x2e')][_0x990f('0x3b')]){_0x433e5b[_0x990f('0x39')]=_[_0x990f('0x3c')](_0x433e5b[_0x990f('0x39')],{'$or':_['map'](_0x2e1366,function(_0x8e7a92){if(_0x8e7a92[_0x990f('0x2b')]!==_0x990f('0x3d')){var _0x3e6f78={};_0x3e6f78[_0x8e7a92[_0x990f('0x26')]]={'$like':'%'+_0x254e84['query']['filter']+'%'};return _0x3e6f78;}})});}_0x433e5b=_['merge']({},_0x433e5b,_0x254e84[_0x990f('0x3e')]);var _0x47b084={'where':_0x433e5b[_0x990f('0x39')]};return db[_0x990f('0x29')][_0x990f('0x1b')](_0x47b084)[_0x990f('0x22')](function(_0x31124f){_0x209194['count']=_0x31124f;if(_0x254e84['query'][_0x990f('0x3f')]){_0x433e5b[_0x990f('0x40')]=[{'all':!![]}];}return db[_0x990f('0x29')][_0x990f('0x41')](_0x433e5b);})[_0x990f('0x22')](function(_0x420fa0){_0x209194['rows']=_0x420fa0;return _0x209194;})['then'](respondWithFilteredResult(_0x3b3d26,_0x433e5b))[_0x990f('0x42')](handleError(_0x3b3d26,null));};exports[_0x990f('0x43')]=function(_0x5085f9,_0x4da70f){var _0x463b42={'raw':!![],'where':{'id':_0x5085f9[_0x990f('0x44')]['id']}},_0x57be61={};_0x57be61[_0x990f('0x2d')]=_[_0x990f('0x2f')](db[_0x990f('0x29')]['rawAttributes']);_0x57be61[_0x990f('0x2e')]=_['keys'](_0x5085f9['query']);_0x57be61[_0x990f('0x30')]=_['intersection'](_0x57be61[_0x990f('0x2d')],_0x57be61[_0x990f('0x2e')]);_0x463b42[_0x990f('0x32')]=_[_0x990f('0x31')](_0x57be61['model'],qs[_0x990f('0x33')](_0x5085f9[_0x990f('0x2e')]['fields']));_0x463b42[_0x990f('0x32')]=_0x463b42['attributes']['length']?_0x463b42[_0x990f('0x32')]:_0x57be61['model'];if(_0x5085f9[_0x990f('0x2e')][_0x990f('0x3f')]){_0x463b42[_0x990f('0x40')]=[{'all':!![]}];}_0x463b42=_[_0x990f('0x3c')]({},_0x463b42,_0x5085f9[_0x990f('0x3e')]);return db[_0x990f('0x29')][_0x990f('0x45')](_0x463b42)[_0x990f('0x22')](handleEntityNotFound(_0x4da70f,null))[_0x990f('0x22')](respondWithResult(_0x4da70f,null))[_0x990f('0x42')](handleError(_0x4da70f,null));};exports[_0x990f('0x46')]=function(_0x3e3231,_0x1f64ca){return db[_0x990f('0x29')][_0x990f('0x46')](_0x3e3231['body'],{})[_0x990f('0x22')](respondWithResult(_0x1f64ca,0xc9))[_0x990f('0x42')](handleError(_0x1f64ca,null));};exports[_0x990f('0x21')]=function(_0x3886be,_0x2f3fbb){if(_0x3886be[_0x990f('0x47')]['id']){delete _0x3886be[_0x990f('0x47')]['id'];}return db['SquareReport'][_0x990f('0x45')]({'where':{'id':_0x3886be[_0x990f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f3fbb,null))['then'](saveUpdates(_0x3886be[_0x990f('0x47')],null))[_0x990f('0x22')](respondWithResult(_0x2f3fbb,null))[_0x990f('0x42')](handleError(_0x2f3fbb,null));};exports[_0x990f('0x23')]=function(_0x4957fb,_0x24af5d){return db['SquareReport'][_0x990f('0x45')]({'where':{'id':_0x4957fb[_0x990f('0x44')]['id']}})[_0x990f('0x22')](handleEntityNotFound(_0x24af5d,null))['then'](removeEntity(_0x24af5d,null))[_0x990f('0x42')](handleError(_0x24af5d,null));};exports['describe']=function(_0x2eb8c8,_0x425a30){return db[_0x990f('0x29')]['describe']()[_0x990f('0x22')](respondWithResult(_0x425a30,null))[_0x990f('0x42')](handleError(_0x425a30,null));}; \ No newline at end of file +var _0x3c51=['../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3f959a,_0x4128e9){var _0x28c9e7=function(_0x39ceb1){while(--_0x39ceb1){_0x3f959a['push'](_0x3f959a['shift']());}};_0x28c9e7(++_0x4128e9);}(_0x3c51,0x1b7));var _0x13c5=function(_0xb4830c,_0x4bfa24){_0xb4830c=_0xb4830c-0x0;var _0x4cb0c0=_0x3c51[_0xb4830c];return _0x4cb0c0;};'use strict';var emlformat=require(_0x13c5('0x0'));var rimraf=require(_0x13c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13c5('0x2'));var moment=require(_0x13c5('0x3'));var BPromise=require(_0x13c5('0x4'));var Mustache=require(_0x13c5('0x5'));var util=require(_0x13c5('0x6'));var path=require('path');var sox=require(_0x13c5('0x7'));var csv=require(_0x13c5('0x8'));var ejs=require(_0x13c5('0x9'));var fs=require('fs');var fs_extra=require(_0x13c5('0xa'));var _=require('lodash');var squel=require(_0x13c5('0xb'));var crypto=require(_0x13c5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x13c5('0xd'));var toCsv=require(_0x13c5('0x8'));var querystring=require(_0x13c5('0xe'));var Papa=require(_0x13c5('0xf'));var Redis=require(_0x13c5('0x10'));var authService=require(_0x13c5('0x11'));var qs=require(_0x13c5('0x12'));var as=require(_0x13c5('0x13'));var hardwareService=require(_0x13c5('0x14'));var logger=require(_0x13c5('0x15'))('api');var utils=require(_0x13c5('0x16'));var config=require(_0x13c5('0x17'));var licenseUtil=require(_0x13c5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d45fd,_0x16a6dd){_0x16a6dd=_0x16a6dd||0xcc;return function(_0x26b021){if(_0x26b021){return _0x3d45fd[_0x13c5('0x19')](_0x16a6dd);}return _0x3d45fd[_0x13c5('0x1a')](_0x16a6dd)[_0x13c5('0x1b')]();};}function respondWithResult(_0x2f7538,_0x3b9602){_0x3b9602=_0x3b9602||0xc8;return function(_0x2c7dad){if(_0x2c7dad){return _0x2f7538['status'](_0x3b9602)[_0x13c5('0x1c')](_0x2c7dad);}};}function respondWithFilteredResult(_0x4ec529,_0xd3046){return function(_0x713229){if(_0x713229){var _0x4bab34=typeof _0xd3046['offset']==='undefined'&&typeof _0xd3046[_0x13c5('0x1d')]===_0x13c5('0x1e');var _0xf49d08=_0x713229[_0x13c5('0x1f')];var _0x98542f=_0x4bab34?0x0:_0xd3046[_0x13c5('0x20')];var _0x152720=_0x4bab34?_0x713229[_0x13c5('0x1f')]:_0xd3046[_0x13c5('0x20')]+_0xd3046['limit'];var _0x38a8c6;if(_0x152720>=_0xf49d08){_0x152720=_0xf49d08;_0x38a8c6=0xc8;}else{_0x38a8c6=0xce;}_0x4ec529[_0x13c5('0x1a')](_0x38a8c6);return _0x4ec529['set'](_0x13c5('0x21'),_0x98542f+'-'+_0x152720+'/'+_0xf49d08)['json'](_0x713229);}return null;};}function patchUpdates(_0x30d09e){return function(_0x4c8995){try{jsonpatch[_0x13c5('0x22')](_0x4c8995,_0x30d09e,!![]);}catch(_0x43301d){return BPromise[_0x13c5('0x23')](_0x43301d);}return _0x4c8995[_0x13c5('0x24')]();};}function saveUpdates(_0x5c6e14,_0x2a0914){return function(_0x417ec4){if(_0x417ec4){return _0x417ec4[_0x13c5('0x25')](_0x5c6e14)[_0x13c5('0x26')](function(_0x52cc7a){return _0x52cc7a;});}return null;};}function removeEntity(_0x12aa36,_0x2e85fb){return function(_0x280d32){if(_0x280d32){return _0x280d32[_0x13c5('0x27')]()['then'](function(){_0x12aa36[_0x13c5('0x1a')](0xcc)[_0x13c5('0x1b')]();});}};}function handleEntityNotFound(_0x4a69db,_0x562c3f){return function(_0xb0daa1){if(!_0xb0daa1){_0x4a69db[_0x13c5('0x19')](0x194);}return _0xb0daa1;};}function handleError(_0x129c20,_0xfcc2de){_0xfcc2de=_0xfcc2de||0x1f4;return function(_0x20affc){logger[_0x13c5('0x28')](_0x20affc['stack']);if(_0x20affc['name']){delete _0x20affc[_0x13c5('0x29')];}_0x129c20['status'](_0xfcc2de)[_0x13c5('0x2a')](_0x20affc);};}exports[_0x13c5('0x2b')]=function(_0x32edf8,_0xcb8262){var _0x38f66f={},_0x159d1b={},_0x28ef07={'count':0x0,'rows':[]};var _0x3a5674=_[_0x13c5('0x2c')](db[_0x13c5('0x2d')][_0x13c5('0x2e')],function(_0x28b4b7){return{'name':_0x28b4b7[_0x13c5('0x2f')],'type':_0x28b4b7[_0x13c5('0x30')][_0x13c5('0x31')]};});_0x159d1b['model']=_[_0x13c5('0x2c')](_0x3a5674,_0x13c5('0x29'));_0x159d1b[_0x13c5('0x32')]=_[_0x13c5('0x33')](_0x32edf8['query']);_0x159d1b['filters']=_['intersection'](_0x159d1b[_0x13c5('0x34')],_0x159d1b[_0x13c5('0x32')]);_0x38f66f[_0x13c5('0x35')]=_['intersection'](_0x159d1b[_0x13c5('0x34')],qs[_0x13c5('0x36')](_0x32edf8[_0x13c5('0x32')][_0x13c5('0x36')]));_0x38f66f['attributes']=_0x38f66f['attributes'][_0x13c5('0x37')]?_0x38f66f[_0x13c5('0x35')]:_0x159d1b['model'];if(!_0x32edf8[_0x13c5('0x32')][_0x13c5('0x38')](_0x13c5('0x39'))){_0x38f66f[_0x13c5('0x1d')]=qs['limit'](_0x32edf8[_0x13c5('0x32')][_0x13c5('0x1d')]);_0x38f66f[_0x13c5('0x20')]=qs[_0x13c5('0x20')](_0x32edf8[_0x13c5('0x32')][_0x13c5('0x20')]);}_0x38f66f[_0x13c5('0x3a')]=qs[_0x13c5('0x3b')](_0x32edf8['query']['sort']);_0x38f66f['where']=qs[_0x13c5('0x3c')](_[_0x13c5('0x3d')](_0x32edf8['query'],_0x159d1b[_0x13c5('0x3c')]),_0x3a5674);if(_0x32edf8[_0x13c5('0x32')][_0x13c5('0x3e')]){_0x38f66f[_0x13c5('0x3f')]=_[_0x13c5('0x40')](_0x38f66f[_0x13c5('0x3f')],{'$or':_[_0x13c5('0x2c')](_0x3a5674,function(_0x4a960b){if(_0x4a960b['type']!=='VIRTUAL'){var _0x24857={};_0x24857[_0x4a960b[_0x13c5('0x29')]]={'$like':'%'+_0x32edf8[_0x13c5('0x32')][_0x13c5('0x3e')]+'%'};return _0x24857;}})});}_0x38f66f=_[_0x13c5('0x40')]({},_0x38f66f,_0x32edf8[_0x13c5('0x41')]);var _0x599e47={'where':_0x38f66f[_0x13c5('0x3f')]};return db[_0x13c5('0x2d')][_0x13c5('0x1f')](_0x599e47)[_0x13c5('0x26')](function(_0x218d08){_0x28ef07['count']=_0x218d08;if(_0x32edf8['query'][_0x13c5('0x42')]){_0x38f66f[_0x13c5('0x43')]=[{'all':!![]}];}return db[_0x13c5('0x2d')]['findAll'](_0x38f66f);})[_0x13c5('0x26')](function(_0x3affc6){_0x28ef07[_0x13c5('0x44')]=_0x3affc6;return _0x28ef07;})[_0x13c5('0x26')](respondWithFilteredResult(_0xcb8262,_0x38f66f))[_0x13c5('0x45')](handleError(_0xcb8262,null));};exports[_0x13c5('0x46')]=function(_0x4ad987,_0x142853){var _0x55c3dd={'raw':!![],'where':{'id':_0x4ad987[_0x13c5('0x47')]['id']}},_0x2f0a19={};_0x2f0a19[_0x13c5('0x34')]=_['keys'](db[_0x13c5('0x2d')][_0x13c5('0x2e')]);_0x2f0a19['query']=_[_0x13c5('0x33')](_0x4ad987[_0x13c5('0x32')]);_0x2f0a19[_0x13c5('0x3c')]=_[_0x13c5('0x48')](_0x2f0a19[_0x13c5('0x34')],_0x2f0a19[_0x13c5('0x32')]);_0x55c3dd[_0x13c5('0x35')]=_['intersection'](_0x2f0a19[_0x13c5('0x34')],qs[_0x13c5('0x36')](_0x4ad987[_0x13c5('0x32')][_0x13c5('0x36')]));_0x55c3dd[_0x13c5('0x35')]=_0x55c3dd['attributes']['length']?_0x55c3dd[_0x13c5('0x35')]:_0x2f0a19['model'];if(_0x4ad987[_0x13c5('0x32')][_0x13c5('0x42')]){_0x55c3dd[_0x13c5('0x43')]=[{'all':!![]}];}_0x55c3dd=_['merge']({},_0x55c3dd,_0x4ad987[_0x13c5('0x41')]);return db['SquareReport'][_0x13c5('0x49')](_0x55c3dd)[_0x13c5('0x26')](handleEntityNotFound(_0x142853,null))['then'](respondWithResult(_0x142853,null))[_0x13c5('0x45')](handleError(_0x142853,null));};exports[_0x13c5('0x4a')]=function(_0x26986c,_0x5de616){return db[_0x13c5('0x2d')]['create'](_0x26986c['body'],{})['then'](respondWithResult(_0x5de616,0xc9))[_0x13c5('0x45')](handleError(_0x5de616,null));};exports[_0x13c5('0x25')]=function(_0x1235e2,_0x524f63){if(_0x1235e2[_0x13c5('0x4b')]['id']){delete _0x1235e2[_0x13c5('0x4b')]['id'];}return db[_0x13c5('0x2d')][_0x13c5('0x49')]({'where':{'id':_0x1235e2['params']['id']}})[_0x13c5('0x26')](handleEntityNotFound(_0x524f63,null))['then'](saveUpdates(_0x1235e2[_0x13c5('0x4b')],null))['then'](respondWithResult(_0x524f63,null))['catch'](handleError(_0x524f63,null));};exports[_0x13c5('0x27')]=function(_0x44e424,_0x25d248){return db['SquareReport'][_0x13c5('0x49')]({'where':{'id':_0x44e424[_0x13c5('0x47')]['id']}})[_0x13c5('0x26')](handleEntityNotFound(_0x25d248,null))[_0x13c5('0x26')](removeEntity(_0x25d248,null))[_0x13c5('0x45')](handleError(_0x25d248,null));};exports[_0x13c5('0x4c')]=function(_0x43bffc,_0x5e370a){return db[_0x13c5('0x2d')][_0x13c5('0x4c')]()[_0x13c5('0x26')](respondWithResult(_0x5e370a,null))[_0x13c5('0x45')](handleError(_0x5e370a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index bf8e3c3..2cec427 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 _0x5e7b=['report_square','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport'];(function(_0x5428f5,_0x363285){var _0xf745ce=function(_0x16dbe2){while(--_0x16dbe2){_0x5428f5['push'](_0x5428f5['shift']());}};_0xf745ce(++_0x363285);}(_0x5e7b,0x1a8));var _0xb5e7=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x5e7b[_0xb3b452];return _0x238983;};'use strict';var _=require(_0xb5e7('0x0'));var util=require('util');var logger=require(_0xb5e7('0x1'))(_0xb5e7('0x2'));var moment=require(_0xb5e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5e7('0x4'));var fs=require('fs');var path=require(_0xb5e7('0x5'));var rimraf=require(_0xb5e7('0x6'));var config=require(_0xb5e7('0x7'));var attributes=require(_0xb5e7('0x8'));module[_0xb5e7('0x9')]=function(_0x57a072,_0x4d97fd){return _0x57a072['define'](_0xb5e7('0xa'),attributes,{'tableName':_0xb5e7('0xb'),'paranoid':![],'indexes':[{'name':_0xb5e7('0xc'),'fields':[_0xb5e7('0xd'),'project_name']},{'name':_0xb5e7('0xe'),'fields':[_0xb5e7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef2d=['rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uniqueid','leaveAt','lodash','moment','bluebird','request-promise'];(function(_0x54268e,_0x759f40){var _0x50da50=function(_0x118c3f){while(--_0x118c3f){_0x54268e['push'](_0x54268e['shift']());}};_0x50da50(++_0x759f40);}(_0xef2d,0x140));var _0xdef2=function(_0x4b2468,_0x582ca5){_0x4b2468=_0x4b2468-0x0;var _0x442ee0=_0xef2d[_0x4b2468];return _0x442ee0;};'use strict';var _=require(_0xdef2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdef2('0x1'));var BPromise=require(_0xdef2('0x2'));var rp=require(_0xdef2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdef2('0x4'));var config=require(_0xdef2('0x5'));var attributes=require(_0xdef2('0x6'));module[_0xdef2('0x7')]=function(_0x22dabd,_0x541b53){return _0x22dabd[_0xdef2('0x8')](_0xdef2('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xdef2('0xa'),'project_name']},{'name':_0xdef2('0xb'),'fields':[_0xdef2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index cad9ca5..fbfb6d7 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 _0x7a6e=['../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateSquareReport','options','raw','then','UpdateSquareReport','SquareReport','update','body','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3ae0c8,_0x1d76ce){var _0x2d7472=function(_0x371fc6){while(--_0x371fc6){_0x3ae0c8['push'](_0x3ae0c8['shift']());}};_0x2d7472(++_0x1d76ce);}(_0x7a6e,0xdf));var _0xe7a6=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0x7a6e[_0x4fa738];return _0x55bf55;};'use strict';var _=require(_0xe7a6('0x0'));var util=require(_0xe7a6('0x1'));var moment=require('moment');var BPromise=require(_0xe7a6('0x2'));var rs=require(_0xe7a6('0x3'));var fs=require('fs');var Redis=require(_0xe7a6('0x4'));var db=require(_0xe7a6('0x5'))['db'];var utils=require(_0xe7a6('0x6'));var logger=require('../../config/logger')(_0xe7a6('0x7'));var config=require(_0xe7a6('0x8'));var jayson=require(_0xe7a6('0x9'));var client=jayson[_0xe7a6('0xa')][_0xe7a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31ea19,_0x596032,_0x27b7b3){return new BPromise(function(_0x2c2c8b,_0x3d129b){return client[_0xe7a6('0xc')](_0x31ea19,_0x27b7b3)['then'](function(_0x153303){logger[_0xe7a6('0xd')](_0xe7a6('0xe'),_0x596032,_0xe7a6('0xf'));logger[_0xe7a6('0x10')](_0xe7a6('0x11'),_0x596032,_0xe7a6('0xf'),JSON[_0xe7a6('0x12')](_0x153303));if(_0x153303['error']){if(_0x153303['error'][_0xe7a6('0x13')]===0x1f4){logger['error'](_0xe7a6('0xe'),_0x596032,_0x153303[_0xe7a6('0x14')][_0xe7a6('0x15')]);return _0x3d129b(_0x153303[_0xe7a6('0x14')][_0xe7a6('0x15')]);}logger[_0xe7a6('0x14')]('SquareReport,\x20%s,\x20%s',_0x596032,_0x153303['error']['message']);return _0x2c2c8b(_0x153303[_0xe7a6('0x14')][_0xe7a6('0x15')]);}else{logger['info'](_0xe7a6('0xe'),_0x596032,_0xe7a6('0xf'));_0x2c2c8b(_0x153303[_0xe7a6('0x16')][_0xe7a6('0x15')]);}})[_0xe7a6('0x17')](function(_0x54023f){logger[_0xe7a6('0x14')]('SquareReport,\x20%s,\x20%s',_0x596032,_0x54023f);_0x3d129b(_0x54023f);});});}exports[_0xe7a6('0x18')]=function(_0x161327){var _0x45e654=this;return new Promise(function(_0x5f18a1,_0x2706db){return db['SquareReport']['create'](_0x161327['body'],{'raw':_0x161327[_0xe7a6('0x19')]?_0x161327[_0xe7a6('0x19')][_0xe7a6('0x1a')]===undefined?!![]:![]:!![]})[_0xe7a6('0x1b')](function(_0x589bf5){logger[_0xe7a6('0xd')](_0xe7a6('0x18'),_0x161327);logger[_0xe7a6('0x10')](_0xe7a6('0x18'),_0x161327,JSON[_0xe7a6('0x12')](_0x589bf5));_0x5f18a1(_0x589bf5);})[_0xe7a6('0x17')](function(_0x45b081){logger[_0xe7a6('0x14')](_0xe7a6('0x18'),_0x45b081[_0xe7a6('0x15')],_0x161327);_0x2706db(_0x45e654[_0xe7a6('0x14')](0x1f4,_0x45b081[_0xe7a6('0x15')]));});});};exports[_0xe7a6('0x1c')]=function(_0x2b1290){var _0x2df776=this;return new Promise(function(_0x127c30,_0x5908d2){return db[_0xe7a6('0x1d')][_0xe7a6('0x1e')](_0x2b1290[_0xe7a6('0x1f')],{'raw':_0x2b1290['options']?_0x2b1290['options'][_0xe7a6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1290[_0xe7a6('0x19')]?_0x2b1290[_0xe7a6('0x19')][_0xe7a6('0x20')]||null:null,'attributes':_0x2b1290[_0xe7a6('0x19')]?_0x2b1290['options']['attributes']||null:null,'limit':_0x2b1290[_0xe7a6('0x19')]?_0x2b1290[_0xe7a6('0x19')]['limit']||null:null})[_0xe7a6('0x1b')](function(_0x3a7577){logger[_0xe7a6('0xd')](_0xe7a6('0x1c'),_0x2b1290);logger['debug']('UpdateSquareReport',_0x2b1290,JSON[_0xe7a6('0x12')](_0x3a7577));_0x127c30(_0x3a7577);})[_0xe7a6('0x17')](function(_0x1b0232){logger[_0xe7a6('0x14')](_0xe7a6('0x1c'),_0x1b0232['message'],_0x2b1290);_0x5908d2(_0x2df776[_0xe7a6('0x14')](0x1f4,_0x1b0232[_0xe7a6('0x15')]));});});}; \ No newline at end of file +var _0xbe1e=['then','info','CreateSquareReport','attributes','limit','UpdateSquareReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareReport','body','options','raw'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xbe1e,0x13c));var _0xebe1=function(_0x275f4a,_0x2077d4){_0x275f4a=_0x275f4a-0x0;var _0x4b4a21=_0xbe1e[_0x275f4a];return _0x4b4a21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebe1('0x0'));var BPromise=require(_0xebe1('0x1'));var rs=require(_0xebe1('0x2'));var fs=require('fs');var Redis=require(_0xebe1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xebe1('0x4'));var logger=require(_0xebe1('0x5'))(_0xebe1('0x6'));var config=require(_0xebe1('0x7'));var jayson=require(_0xebe1('0x8'));var client=jayson[_0xebe1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f9d72,_0xd0b327,_0x26e92a){return new BPromise(function(_0x2b8543,_0xb83e4a){return client[_0xebe1('0xa')](_0x4f9d72,_0x26e92a)['then'](function(_0xfb5870){logger['info'](_0xebe1('0xb'),_0xd0b327,_0xebe1('0xc'));logger[_0xebe1('0xd')](_0xebe1('0xe'),_0xd0b327,_0xebe1('0xc'),JSON[_0xebe1('0xf')](_0xfb5870));if(_0xfb5870[_0xebe1('0x10')]){if(_0xfb5870['error'][_0xebe1('0x11')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0xd0b327,_0xfb5870[_0xebe1('0x10')][_0xebe1('0x12')]);return _0xb83e4a(_0xfb5870[_0xebe1('0x10')][_0xebe1('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0xd0b327,_0xfb5870[_0xebe1('0x10')][_0xebe1('0x12')]);return _0x2b8543(_0xfb5870[_0xebe1('0x10')][_0xebe1('0x12')]);}else{logger['info'](_0xebe1('0xb'),_0xd0b327,'request\x20sent');_0x2b8543(_0xfb5870[_0xebe1('0x13')][_0xebe1('0x12')]);}})[_0xebe1('0x14')](function(_0x38880c){logger[_0xebe1('0x10')]('SquareReport,\x20%s,\x20%s',_0xd0b327,_0x38880c);_0xb83e4a(_0x38880c);});});}exports['CreateSquareReport']=function(_0x245208){var _0x9fc61=this;return new Promise(function(_0x51456f,_0x3dc0ce){return db[_0xebe1('0x15')]['create'](_0x245208[_0xebe1('0x16')],{'raw':_0x245208[_0xebe1('0x17')]?_0x245208[_0xebe1('0x17')][_0xebe1('0x18')]===undefined?!![]:![]:!![]})[_0xebe1('0x19')](function(_0x1d1282){logger[_0xebe1('0x1a')](_0xebe1('0x1b'),_0x245208);logger[_0xebe1('0xd')](_0xebe1('0x1b'),_0x245208,JSON[_0xebe1('0xf')](_0x1d1282));_0x51456f(_0x1d1282);})[_0xebe1('0x14')](function(_0x26487e){logger[_0xebe1('0x10')](_0xebe1('0x1b'),_0x26487e[_0xebe1('0x12')],_0x245208);_0x3dc0ce(_0x9fc61[_0xebe1('0x10')](0x1f4,_0x26487e[_0xebe1('0x12')]));});});};exports['UpdateSquareReport']=function(_0x3976ee){var _0x241a76=this;return new Promise(function(_0x4dcb96,_0x5a51d1){return db[_0xebe1('0x15')]['update'](_0x3976ee['body'],{'raw':_0x3976ee[_0xebe1('0x17')]?_0x3976ee['options'][_0xebe1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3976ee[_0xebe1('0x17')]?_0x3976ee[_0xebe1('0x17')]['where']||null:null,'attributes':_0x3976ee['options']?_0x3976ee['options'][_0xebe1('0x1c')]||null:null,'limit':_0x3976ee[_0xebe1('0x17')]?_0x3976ee[_0xebe1('0x17')][_0xebe1('0x1d')]||null:null})['then'](function(_0x241446){logger[_0xebe1('0x1a')]('UpdateSquareReport',_0x3976ee);logger['debug']('UpdateSquareReport',_0x3976ee,JSON[_0xebe1('0xf')](_0x241446));_0x4dcb96(_0x241446);})[_0xebe1('0x14')](function(_0x3a7450){logger[_0xebe1('0x10')](_0xebe1('0x1e'),_0x3a7450[_0xebe1('0x12')],_0x3976ee);_0x5a51d1(_0x241a76['error'](0x1f4,_0x3a7450[_0xebe1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1f8d3ec..4ee9bd9 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 _0x1af5=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','create'];(function(_0x59ced3,_0x387ecc){var _0x353f80=function(_0x5a0afd){while(--_0x5a0afd){_0x59ced3['push'](_0x59ced3['shift']());}};_0x353f80(++_0x387ecc);}(_0x1af5,0xfb));var _0x51af=function(_0x7d8e0d,_0x2b7bb4){_0x7d8e0d=_0x7d8e0d-0x0;var _0x266eed=_0x1af5[_0x7d8e0d];return _0x266eed;};'use strict';var multer=require(_0x51af('0x0'));var util=require(_0x51af('0x1'));var path=require(_0x51af('0x2'));var timeout=require(_0x51af('0x3'));var express=require(_0x51af('0x4'));var router=express['Router']();var fs_extra=require(_0x51af('0x5'));var auth=require(_0x51af('0x6'));var interaction=require(_0x51af('0x7'));var config=require('../../config/environment');var controller=require(_0x51af('0x8'));router[_0x51af('0x9')]('/',auth[_0x51af('0xa')](),controller[_0x51af('0xb')]);router[_0x51af('0x9')]('/describe',auth[_0x51af('0xa')](),controller[_0x51af('0xc')]);router[_0x51af('0x9')](_0x51af('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x51af('0xe')]);router[_0x51af('0xf')](_0x51af('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x51af('0x10')](_0x51af('0xd'),auth['isAuthenticated'](),controller[_0x51af('0x11')]);module[_0x51af('0x12')]=router; \ No newline at end of file +var _0x48b3=['./squareReportDetail.controller','isAuthenticated','index','describe','/:id','post','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x854be7,_0x49f71b){var _0x422af4=function(_0x2faa45){while(--_0x2faa45){_0x854be7['push'](_0x854be7['shift']());}};_0x422af4(++_0x49f71b);}(_0x48b3,0x15d));var _0x348b=function(_0x342c97,_0x47ba3d){_0x342c97=_0x342c97-0x0;var _0x4b39f1=_0x48b3[_0x342c97];return _0x4b39f1;};'use strict';var multer=require(_0x348b('0x0'));var util=require('util');var path=require(_0x348b('0x1'));var timeout=require(_0x348b('0x2'));var express=require('express');var router=express[_0x348b('0x3')]();var fs_extra=require(_0x348b('0x4'));var auth=require(_0x348b('0x5'));var interaction=require(_0x348b('0x6'));var config=require(_0x348b('0x7'));var controller=require(_0x348b('0x8'));router['get']('/',auth[_0x348b('0x9')](),controller[_0x348b('0xa')]);router['get']('/describe',auth[_0x348b('0x9')](),controller[_0x348b('0xb')]);router['get'](_0x348b('0xc'),auth[_0x348b('0x9')](),controller['show']);router[_0x348b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x348b('0xe')](_0x348b('0xc'),auth[_0x348b('0x9')](),controller['update']);router[_0x348b('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x348b('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 1562a47..a4bcb3c 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 _0xa5be=['sequelize','STRING'];(function(_0x3b4e16,_0x543535){var _0x142757=function(_0x56bc75){while(--_0x56bc75){_0x3b4e16['push'](_0x3b4e16['shift']());}};_0x142757(++_0x543535);}(_0xa5be,0xa6));var _0xea5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5be[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xea5b('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xea5b('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xea5b('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd520=['sequelize','exports','STRING'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xd520,0x9c));var _0x0d52=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xd520[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x0d52('0x0'));module[_0x0d52('0x1')]={'uniqueid':{'type':Sequelize[_0x0d52('0x2')]},'node':{'type':Sequelize[_0x0d52('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d52('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e4c8c4b..fd31746 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 _0x2e4d=['fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','keys','length','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','SquareDetailsReport','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x2e4d,0xb0));var _0xd2e4=function(_0x2edacd,_0x56eae5){_0x2edacd=_0x2edacd-0x0;var _0x51e3f6=_0x2e4d[_0x2edacd];return _0x51e3f6;};'use strict';var emlformat=require(_0xd2e4('0x0'));var rimraf=require(_0xd2e4('0x1'));var zipdir=require(_0xd2e4('0x2'));var jsonpatch=require(_0xd2e4('0x3'));var rp=require(_0xd2e4('0x4'));var moment=require('moment');var BPromise=require(_0xd2e4('0x5'));var Mustache=require(_0xd2e4('0x6'));var util=require('util');var path=require(_0xd2e4('0x7'));var sox=require(_0xd2e4('0x8'));var csv=require(_0xd2e4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2e4('0xa'));var _=require(_0xd2e4('0xb'));var squel=require(_0xd2e4('0xc'));var crypto=require(_0xd2e4('0xd'));var jsforce=require(_0xd2e4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd2e4('0x9'));var querystring=require(_0xd2e4('0xf'));var Papa=require(_0xd2e4('0x10'));var Redis=require(_0xd2e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd2e4('0x12'));var as=require(_0xd2e4('0x13'));var hardwareService=require(_0xd2e4('0x14'));var logger=require(_0xd2e4('0x15'))(_0xd2e4('0x16'));var utils=require(_0xd2e4('0x17'));var config=require(_0xd2e4('0x18'));var licenseUtil=require(_0xd2e4('0x19'));var db=require(_0xd2e4('0x1a'))['db'];function respondWithStatusCode(_0x4c1df9,_0x1e67de){_0x1e67de=_0x1e67de||0xcc;return function(_0x101e8e){if(_0x101e8e){return _0x4c1df9['sendStatus'](_0x1e67de);}return _0x4c1df9[_0xd2e4('0x1b')](_0x1e67de)[_0xd2e4('0x1c')]();};}function respondWithResult(_0x33ff06,_0x5b4085){_0x5b4085=_0x5b4085||0xc8;return function(_0x976d08){if(_0x976d08){return _0x33ff06['status'](_0x5b4085)['json'](_0x976d08);}};}function respondWithFilteredResult(_0x5be299,_0x20a915){return function(_0x240dfb){if(_0x240dfb){var _0x373820=typeof _0x20a915['offset']===_0xd2e4('0x1d')&&typeof _0x20a915['limit']==='undefined';var _0xd7720b=_0x240dfb[_0xd2e4('0x1e')];var _0x47ebd8=_0x373820?0x0:_0x20a915[_0xd2e4('0x1f')];var _0x2c1d7b=_0x373820?_0x240dfb[_0xd2e4('0x1e')]:_0x20a915[_0xd2e4('0x1f')]+_0x20a915[_0xd2e4('0x20')];var _0x1e1bd8;if(_0x2c1d7b>=_0xd7720b){_0x2c1d7b=_0xd7720b;_0x1e1bd8=0xc8;}else{_0x1e1bd8=0xce;}_0x5be299[_0xd2e4('0x1b')](_0x1e1bd8);return _0x5be299[_0xd2e4('0x21')](_0xd2e4('0x22'),_0x47ebd8+'-'+_0x2c1d7b+'/'+_0xd7720b)[_0xd2e4('0x23')](_0x240dfb);}return null;};}function patchUpdates(_0x37ce4d){return function(_0x9d807){try{jsonpatch[_0xd2e4('0x24')](_0x9d807,_0x37ce4d,!![]);}catch(_0x408de0){return BPromise[_0xd2e4('0x25')](_0x408de0);}return _0x9d807[_0xd2e4('0x26')]();};}function saveUpdates(_0x19f5c9,_0x6a97d){return function(_0x312b9e){if(_0x312b9e){return _0x312b9e[_0xd2e4('0x27')](_0x19f5c9)[_0xd2e4('0x28')](function(_0x2fcf69){return _0x2fcf69;});}return null;};}function removeEntity(_0x246d8b,_0x5b84ff){return function(_0x205532){if(_0x205532){return _0x205532[_0xd2e4('0x29')]()[_0xd2e4('0x28')](function(){_0x246d8b[_0xd2e4('0x1b')](0xcc)[_0xd2e4('0x1c')]();});}};}function handleEntityNotFound(_0x3dfe78,_0x2b1c47){return function(_0x1b8963){if(!_0x1b8963){_0x3dfe78['sendStatus'](0x194);}return _0x1b8963;};}function handleError(_0x2cce22,_0x3d6b27){_0x3d6b27=_0x3d6b27||0x1f4;return function(_0x2ec01d){logger[_0xd2e4('0x2a')](_0x2ec01d['stack']);if(_0x2ec01d[_0xd2e4('0x2b')]){delete _0x2ec01d['name'];}_0x2cce22['status'](_0x3d6b27)[_0xd2e4('0x2c')](_0x2ec01d);};}exports['index']=function(_0xc912a4,_0x1f9897){var _0x1a9be2={},_0xe3c5c0={},_0x5aca37={'count':0x0,'rows':[]};var _0x1f388d=_['map'](db[_0xd2e4('0x2d')][_0xd2e4('0x2e')],function(_0xf8cdb2){return{'name':_0xf8cdb2[_0xd2e4('0x2f')],'type':_0xf8cdb2['type'][_0xd2e4('0x30')]};});_0xe3c5c0['model']=_[_0xd2e4('0x31')](_0x1f388d,_0xd2e4('0x2b'));_0xe3c5c0['query']=_['keys'](_0xc912a4[_0xd2e4('0x32')]);_0xe3c5c0[_0xd2e4('0x33')]=_[_0xd2e4('0x34')](_0xe3c5c0[_0xd2e4('0x35')],_0xe3c5c0[_0xd2e4('0x32')]);_0x1a9be2[_0xd2e4('0x36')]=_[_0xd2e4('0x34')](_0xe3c5c0['model'],qs[_0xd2e4('0x37')](_0xc912a4['query'][_0xd2e4('0x37')]));_0x1a9be2[_0xd2e4('0x36')]=_0x1a9be2['attributes']['length']?_0x1a9be2['attributes']:_0xe3c5c0[_0xd2e4('0x35')];if(!_0xc912a4[_0xd2e4('0x32')][_0xd2e4('0x38')](_0xd2e4('0x39'))){_0x1a9be2['limit']=qs[_0xd2e4('0x20')](_0xc912a4[_0xd2e4('0x32')]['limit']);_0x1a9be2[_0xd2e4('0x1f')]=qs[_0xd2e4('0x1f')](_0xc912a4[_0xd2e4('0x32')][_0xd2e4('0x1f')]);}_0x1a9be2['order']=qs[_0xd2e4('0x3a')](_0xc912a4[_0xd2e4('0x32')][_0xd2e4('0x3a')]);_0x1a9be2[_0xd2e4('0x3b')]=qs['filters'](_[_0xd2e4('0x3c')](_0xc912a4[_0xd2e4('0x32')],_0xe3c5c0[_0xd2e4('0x33')]),_0x1f388d);if(_0xc912a4['query']['filter']){_0x1a9be2[_0xd2e4('0x3b')]=_[_0xd2e4('0x3d')](_0x1a9be2[_0xd2e4('0x3b')],{'$or':_[_0xd2e4('0x31')](_0x1f388d,function(_0xa15968){if(_0xa15968[_0xd2e4('0x3e')]!==_0xd2e4('0x3f')){var _0x369095={};_0x369095[_0xa15968[_0xd2e4('0x2b')]]={'$like':'%'+_0xc912a4[_0xd2e4('0x32')]['filter']+'%'};return _0x369095;}})});}_0x1a9be2=_[_0xd2e4('0x3d')]({},_0x1a9be2,_0xc912a4[_0xd2e4('0x40')]);var _0x408efa={'where':_0x1a9be2[_0xd2e4('0x3b')]};return db[_0xd2e4('0x2d')]['count'](_0x408efa)[_0xd2e4('0x28')](function(_0x131598){_0x5aca37['count']=_0x131598;if(_0xc912a4[_0xd2e4('0x32')][_0xd2e4('0x41')]){_0x1a9be2[_0xd2e4('0x42')]=[{'all':!![]}];}return db[_0xd2e4('0x2d')][_0xd2e4('0x43')](_0x1a9be2);})[_0xd2e4('0x28')](function(_0x128a3c){_0x5aca37[_0xd2e4('0x44')]=_0x128a3c;return _0x5aca37;})['then'](respondWithFilteredResult(_0x1f9897,_0x1a9be2))['catch'](handleError(_0x1f9897,null));};exports['show']=function(_0x4dc554,_0x57a97f){var _0x5518cd={'raw':!![],'where':{'id':_0x4dc554['params']['id']}},_0x25aaae={};_0x25aaae[_0xd2e4('0x35')]=_[_0xd2e4('0x45')](db[_0xd2e4('0x2d')]['rawAttributes']);_0x25aaae['query']=_['keys'](_0x4dc554[_0xd2e4('0x32')]);_0x25aaae[_0xd2e4('0x33')]=_[_0xd2e4('0x34')](_0x25aaae['model'],_0x25aaae[_0xd2e4('0x32')]);_0x5518cd['attributes']=_['intersection'](_0x25aaae['model'],qs[_0xd2e4('0x37')](_0x4dc554[_0xd2e4('0x32')][_0xd2e4('0x37')]));_0x5518cd[_0xd2e4('0x36')]=_0x5518cd['attributes'][_0xd2e4('0x46')]?_0x5518cd[_0xd2e4('0x36')]:_0x25aaae[_0xd2e4('0x35')];if(_0x4dc554[_0xd2e4('0x32')][_0xd2e4('0x41')]){_0x5518cd[_0xd2e4('0x42')]=[{'all':!![]}];}_0x5518cd=_[_0xd2e4('0x3d')]({},_0x5518cd,_0x4dc554['options']);return db[_0xd2e4('0x2d')][_0xd2e4('0x47')](_0x5518cd)[_0xd2e4('0x28')](handleEntityNotFound(_0x57a97f,null))[_0xd2e4('0x28')](respondWithResult(_0x57a97f,null))['catch'](handleError(_0x57a97f,null));};exports[_0xd2e4('0x48')]=function(_0x12ac50,_0x3dadce){return db[_0xd2e4('0x2d')]['create'](_0x12ac50['body'],{})[_0xd2e4('0x28')](respondWithResult(_0x3dadce,0xc9))[_0xd2e4('0x49')](handleError(_0x3dadce,null));};exports[_0xd2e4('0x27')]=function(_0x35e1cb,_0x400b7d){if(_0x35e1cb['body']['id']){delete _0x35e1cb[_0xd2e4('0x4a')]['id'];}return db[_0xd2e4('0x2d')][_0xd2e4('0x47')]({'where':{'id':_0x35e1cb[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x28')](handleEntityNotFound(_0x400b7d,null))[_0xd2e4('0x28')](saveUpdates(_0x35e1cb[_0xd2e4('0x4a')],null))[_0xd2e4('0x28')](respondWithResult(_0x400b7d,null))[_0xd2e4('0x49')](handleError(_0x400b7d,null));};exports[_0xd2e4('0x29')]=function(_0x2d7cf2,_0x23599e){return db[_0xd2e4('0x2d')][_0xd2e4('0x47')]({'where':{'id':_0x2d7cf2[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23599e,null))['then'](removeEntity(_0x23599e,null))[_0xd2e4('0x49')](handleError(_0x23599e,null));};exports[_0xd2e4('0x4c')]=function(_0x5a1b8e,_0x25e763){return db[_0xd2e4('0x2d')][_0xd2e4('0x4c')]()[_0xd2e4('0x28')](respondWithResult(_0x25e763,null))['catch'](handleError(_0x25e763,null));}; \ No newline at end of file +var _0xccdf=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','SquareDetailsReport','catch','show','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0xccdf,0xbe));var _0xfccd=function(_0x2833dc,_0x4e7cec){_0x2833dc=_0x2833dc-0x0;var _0x401ece=_0xccdf[_0x2833dc];return _0x401ece;};'use strict';var emlformat=require(_0xfccd('0x0'));var rimraf=require(_0xfccd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfccd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfccd('0x3'));var Mustache=require(_0xfccd('0x4'));var util=require('util');var path=require(_0xfccd('0x5'));var sox=require(_0xfccd('0x6'));var csv=require(_0xfccd('0x7'));var ejs=require(_0xfccd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfccd('0x9'));var squel=require('squel');var crypto=require(_0xfccd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfccd('0xb'));var toCsv=require(_0xfccd('0x7'));var querystring=require(_0xfccd('0xc'));var Papa=require(_0xfccd('0xd'));var Redis=require(_0xfccd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfccd('0xf'));var hardwareService=require(_0xfccd('0x10'));var logger=require(_0xfccd('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfccd('0x12'));var licenseUtil=require(_0xfccd('0x13'));var db=require(_0xfccd('0x14'))['db'];function respondWithStatusCode(_0x1540a7,_0x4415c3){_0x4415c3=_0x4415c3||0xcc;return function(_0x1a9bb6){if(_0x1a9bb6){return _0x1540a7[_0xfccd('0x15')](_0x4415c3);}return _0x1540a7[_0xfccd('0x16')](_0x4415c3)[_0xfccd('0x17')]();};}function respondWithResult(_0x1497b4,_0x2bd703){_0x2bd703=_0x2bd703||0xc8;return function(_0x261a8d){if(_0x261a8d){return _0x1497b4[_0xfccd('0x16')](_0x2bd703)['json'](_0x261a8d);}};}function respondWithFilteredResult(_0x266921,_0x83ed8c){return function(_0x324ab5){if(_0x324ab5){var _0x254752=typeof _0x83ed8c[_0xfccd('0x18')]===_0xfccd('0x19')&&typeof _0x83ed8c[_0xfccd('0x1a')]===_0xfccd('0x19');var _0x3f743a=_0x324ab5['count'];var _0x129c85=_0x254752?0x0:_0x83ed8c['offset'];var _0xa4adf2=_0x254752?_0x324ab5[_0xfccd('0x1b')]:_0x83ed8c[_0xfccd('0x18')]+_0x83ed8c[_0xfccd('0x1a')];var _0xbac53;if(_0xa4adf2>=_0x3f743a){_0xa4adf2=_0x3f743a;_0xbac53=0xc8;}else{_0xbac53=0xce;}_0x266921['status'](_0xbac53);return _0x266921[_0xfccd('0x1c')](_0xfccd('0x1d'),_0x129c85+'-'+_0xa4adf2+'/'+_0x3f743a)[_0xfccd('0x1e')](_0x324ab5);}return null;};}function patchUpdates(_0x23c678){return function(_0x272e75){try{jsonpatch['apply'](_0x272e75,_0x23c678,!![]);}catch(_0xcdf9db){return BPromise[_0xfccd('0x1f')](_0xcdf9db);}return _0x272e75[_0xfccd('0x20')]();};}function saveUpdates(_0x27c725,_0x464ca8){return function(_0x473579){if(_0x473579){return _0x473579[_0xfccd('0x21')](_0x27c725)[_0xfccd('0x22')](function(_0x2f27fc){return _0x2f27fc;});}return null;};}function removeEntity(_0x550686,_0x586a9c){return function(_0x494472){if(_0x494472){return _0x494472[_0xfccd('0x23')]()['then'](function(){_0x550686[_0xfccd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2efcf1,_0x4ebec7){return function(_0x3ac7cc){if(!_0x3ac7cc){_0x2efcf1['sendStatus'](0x194);}return _0x3ac7cc;};}function handleError(_0x4fe4ca,_0x272706){_0x272706=_0x272706||0x1f4;return function(_0x32620c){logger[_0xfccd('0x24')](_0x32620c[_0xfccd('0x25')]);if(_0x32620c['name']){delete _0x32620c[_0xfccd('0x26')];}_0x4fe4ca[_0xfccd('0x16')](_0x272706)[_0xfccd('0x27')](_0x32620c);};}exports[_0xfccd('0x28')]=function(_0x135919,_0xa8dad0){var _0x17ed04={},_0x574fb8={},_0x2bd1af={'count':0x0,'rows':[]};var _0x44e647=_[_0xfccd('0x29')](db['SquareDetailsReport'][_0xfccd('0x2a')],function(_0x39fcc4){return{'name':_0x39fcc4['fieldName'],'type':_0x39fcc4['type'][_0xfccd('0x2b')]};});_0x574fb8[_0xfccd('0x2c')]=_[_0xfccd('0x29')](_0x44e647,_0xfccd('0x26'));_0x574fb8[_0xfccd('0x2d')]=_[_0xfccd('0x2e')](_0x135919[_0xfccd('0x2d')]);_0x574fb8['filters']=_['intersection'](_0x574fb8[_0xfccd('0x2c')],_0x574fb8[_0xfccd('0x2d')]);_0x17ed04[_0xfccd('0x2f')]=_[_0xfccd('0x30')](_0x574fb8[_0xfccd('0x2c')],qs['fields'](_0x135919[_0xfccd('0x2d')][_0xfccd('0x31')]));_0x17ed04[_0xfccd('0x2f')]=_0x17ed04[_0xfccd('0x2f')][_0xfccd('0x32')]?_0x17ed04[_0xfccd('0x2f')]:_0x574fb8[_0xfccd('0x2c')];if(!_0x135919[_0xfccd('0x2d')][_0xfccd('0x33')]('nolimit')){_0x17ed04[_0xfccd('0x1a')]=qs['limit'](_0x135919[_0xfccd('0x2d')][_0xfccd('0x1a')]);_0x17ed04[_0xfccd('0x18')]=qs[_0xfccd('0x18')](_0x135919[_0xfccd('0x2d')][_0xfccd('0x18')]);}_0x17ed04[_0xfccd('0x34')]=qs[_0xfccd('0x35')](_0x135919[_0xfccd('0x2d')][_0xfccd('0x35')]);_0x17ed04[_0xfccd('0x36')]=qs[_0xfccd('0x37')](_[_0xfccd('0x38')](_0x135919[_0xfccd('0x2d')],_0x574fb8[_0xfccd('0x37')]),_0x44e647);if(_0x135919[_0xfccd('0x2d')][_0xfccd('0x39')]){_0x17ed04[_0xfccd('0x36')]=_[_0xfccd('0x3a')](_0x17ed04[_0xfccd('0x36')],{'$or':_[_0xfccd('0x29')](_0x44e647,function(_0xd5ce62){if(_0xd5ce62[_0xfccd('0x3b')]!=='VIRTUAL'){var _0x19801f={};_0x19801f[_0xd5ce62[_0xfccd('0x26')]]={'$like':'%'+_0x135919['query'][_0xfccd('0x39')]+'%'};return _0x19801f;}})});}_0x17ed04=_['merge']({},_0x17ed04,_0x135919[_0xfccd('0x3c')]);var _0x22f120={'where':_0x17ed04['where']};return db['SquareDetailsReport'][_0xfccd('0x1b')](_0x22f120)[_0xfccd('0x22')](function(_0x216211){_0x2bd1af[_0xfccd('0x1b')]=_0x216211;if(_0x135919['query'][_0xfccd('0x3d')]){_0x17ed04[_0xfccd('0x3e')]=[{'all':!![]}];}return db[_0xfccd('0x3f')]['findAll'](_0x17ed04);})[_0xfccd('0x22')](function(_0x8a8418){_0x2bd1af['rows']=_0x8a8418;return _0x2bd1af;})[_0xfccd('0x22')](respondWithFilteredResult(_0xa8dad0,_0x17ed04))[_0xfccd('0x40')](handleError(_0xa8dad0,null));};exports[_0xfccd('0x41')]=function(_0x54fbeb,_0x2c133f){var _0x473673={'raw':!![],'where':{'id':_0x54fbeb['params']['id']}},_0x88da11={};_0x88da11['model']=_['keys'](db[_0xfccd('0x3f')][_0xfccd('0x2a')]);_0x88da11[_0xfccd('0x2d')]=_[_0xfccd('0x2e')](_0x54fbeb[_0xfccd('0x2d')]);_0x88da11[_0xfccd('0x37')]=_[_0xfccd('0x30')](_0x88da11[_0xfccd('0x2c')],_0x88da11[_0xfccd('0x2d')]);_0x473673['attributes']=_['intersection'](_0x88da11[_0xfccd('0x2c')],qs[_0xfccd('0x31')](_0x54fbeb[_0xfccd('0x2d')]['fields']));_0x473673['attributes']=_0x473673[_0xfccd('0x2f')][_0xfccd('0x32')]?_0x473673[_0xfccd('0x2f')]:_0x88da11[_0xfccd('0x2c')];if(_0x54fbeb['query'][_0xfccd('0x3d')]){_0x473673['include']=[{'all':!![]}];}_0x473673=_[_0xfccd('0x3a')]({},_0x473673,_0x54fbeb[_0xfccd('0x3c')]);return db[_0xfccd('0x3f')][_0xfccd('0x42')](_0x473673)[_0xfccd('0x22')](handleEntityNotFound(_0x2c133f,null))[_0xfccd('0x22')](respondWithResult(_0x2c133f,null))['catch'](handleError(_0x2c133f,null));};exports[_0xfccd('0x43')]=function(_0xf02981,_0x7f2bfc){return db[_0xfccd('0x3f')][_0xfccd('0x43')](_0xf02981[_0xfccd('0x44')],{})[_0xfccd('0x22')](respondWithResult(_0x7f2bfc,0xc9))['catch'](handleError(_0x7f2bfc,null));};exports[_0xfccd('0x21')]=function(_0x5520e6,_0x342316){if(_0x5520e6[_0xfccd('0x44')]['id']){delete _0x5520e6[_0xfccd('0x44')]['id'];}return db[_0xfccd('0x3f')][_0xfccd('0x42')]({'where':{'id':_0x5520e6['params']['id']}})['then'](handleEntityNotFound(_0x342316,null))[_0xfccd('0x22')](saveUpdates(_0x5520e6['body'],null))[_0xfccd('0x22')](respondWithResult(_0x342316,null))[_0xfccd('0x40')](handleError(_0x342316,null));};exports[_0xfccd('0x23')]=function(_0x4c87f3,_0x25cac2){return db[_0xfccd('0x3f')][_0xfccd('0x42')]({'where':{'id':_0x4c87f3['params']['id']}})[_0xfccd('0x22')](handleEntityNotFound(_0x25cac2,null))[_0xfccd('0x22')](removeEntity(_0x25cac2,null))[_0xfccd('0x40')](handleError(_0x25cac2,null));};exports[_0xfccd('0x45')]=function(_0x5190b2,_0x21da78){return db[_0xfccd('0x3f')][_0xfccd('0x45')]()[_0xfccd('0x22')](respondWithResult(_0x21da78,null))[_0xfccd('0x40')](handleError(_0x21da78,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 710f637..1a31891 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 _0xeaca=['rimraf','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x38bc4c,_0x42183d){var _0x176d7e=function(_0x273a7e){while(--_0x273a7e){_0x38bc4c['push'](_0x38bc4c['shift']());}};_0x176d7e(++_0x42183d);}(_0xeaca,0x1b1));var _0xaeac=function(_0x17363e,_0x5f0446){_0x17363e=_0x17363e-0x0;var _0x596c03=_0xeaca[_0x17363e];return _0x596c03;};'use strict';var _=require(_0xaeac('0x0'));var util=require(_0xaeac('0x1'));var logger=require(_0xaeac('0x2'))(_0xaeac('0x3'));var moment=require(_0xaeac('0x4'));var BPromise=require('bluebird');var rp=require(_0xaeac('0x5'));var fs=require('fs');var path=require(_0xaeac('0x6'));var rimraf=require(_0xaeac('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x867d05,_0x78140e){return _0x867d05['define'](_0xaeac('0x8'),attributes,{'tableName':_0xaeac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b7c=['../../config/logger','api','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','define','report_square_details','lodash'];(function(_0x42fba4,_0x588b08){var _0x362ebf=function(_0x767897){while(--_0x767897){_0x42fba4['push'](_0x42fba4['shift']());}};_0x362ebf(++_0x588b08);}(_0x8b7c,0x11f));var _0xc8b7=function(_0x5dd69b,_0x118e05){_0x5dd69b=_0x5dd69b-0x0;var _0x1bc678=_0x8b7c[_0x5dd69b];return _0x1bc678;};'use strict';var _=require(_0xc8b7('0x0'));var util=require('util');var logger=require(_0xc8b7('0x1'))(_0xc8b7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc8b7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8b7('0x4'));var config=require(_0xc8b7('0x5'));var attributes=require(_0xc8b7('0x6'));module['exports']=function(_0x24a70b,_0x11c656){return _0x24a70b[_0xc8b7('0x7')]('SquareDetailsReport',attributes,{'tableName':_0xc8b7('0x8'),'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 52675a3..8f95e99 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 _0x36ee=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw'];(function(_0x25047b,_0x5e8acd){var _0x25d729=function(_0x273c23){while(--_0x273c23){_0x25047b['push'](_0x25047b['shift']());}};_0x25d729(++_0x5e8acd);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')](_0x2184ae['body'],{'raw':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21e95e){logger[_0xe36e('0x15')](_0xe36e('0x18'),_0x2184ae);logger[_0xe36e('0xe')](_0xe36e('0x18'),_0x2184ae,JSON[_0xe36e('0x11')](_0x21e95e));_0x21d9a3(_0x21e95e);})['catch'](function(_0xd71137){logger[_0xe36e('0x12')](_0xe36e('0x18'),_0xd71137[_0xe36e('0x14')],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0xd71137['message']));});});}; \ No newline at end of file +var _0xae60=['client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x84c858,_0x32c06a){var _0x566333=function(_0x21489d){while(--_0x21489d){_0x84c858['push'](_0x84c858['shift']());}};_0x566333(++_0x32c06a);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xae60[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')](_0xda4f01[_0x0ae6('0x1a')],{'raw':_0xda4f01[_0x0ae6('0x1b')]?_0xda4f01['options'][_0x0ae6('0x1c')]===undefined?!![]:![]:!![]})[_0x0ae6('0xb')](function(_0x140a3b){logger[_0x0ae6('0xc')](_0x0ae6('0x17'),_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0x140a3b));_0x2fdf25(_0x140a3b);})['catch'](function(_0x39b22e){logger[_0x0ae6('0x12')](_0x0ae6('0x17'),_0x39b22e[_0x0ae6('0x14')],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x39b22e['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3ff5ae0..ef39343 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 _0x52dd=['get','isAuthenticated','index','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52dd,0x125));var _0xd52d=function(_0x568303,_0x3b8900){_0x568303=_0x568303-0x0;var _0x1c2623=_0x52dd[_0x568303];return _0x1c2623;};'use strict';var express=require(_0xd52d('0x0'));var router=express[_0xd52d('0x1')]();var auth=require(_0xd52d('0x2'));var controller=require(_0xd52d('0x3'));router[_0xd52d('0x4')]('/',auth[_0xd52d('0x5')](),controller[_0xd52d('0x6')]);router[_0xd52d('0x4')]('/process/:pid/kill',auth[_0xd52d('0x5')](),controller[_0xd52d('0x7')]);module[_0xd52d('0x8')]=router; \ No newline at end of file +var _0x929a=['../../components/auth/service','./system.controller','isAuthenticated','index','get','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x44266b,_0x4c6155){var _0x44ac03=function(_0x3a4032){while(--_0x3a4032){_0x44266b['push'](_0x44266b['shift']());}};_0x44ac03(++_0x4c6155);}(_0x929a,0x1d4));var _0xa929=function(_0x24dafd,_0x1a8af9){_0x24dafd=_0x24dafd-0x0;var _0x5e8ef6=_0x929a[_0x24dafd];return _0x5e8ef6;};'use strict';var express=require(_0xa929('0x0'));var router=express[_0xa929('0x1')]();var auth=require(_0xa929('0x2'));var controller=require(_0xa929('0x3'));router['get']('/',auth[_0xa929('0x4')](),controller[_0xa929('0x5')]);router[_0xa929('0x6')](_0xa929('0x7'),auth[_0xa929('0x4')](),controller[_0xa929('0x8')]);module[_0xa929('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 4d06a21..256b38c 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 _0xedd0=['getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send'];(function(_0x34aecc,_0x15b313){var _0x4d47e6=function(_0x5999a7){while(--_0x5999a7){_0x34aecc['push'](_0x34aecc['shift']());}};_0x4d47e6(++_0x15b313);}(_0xedd0,0xac));var _0x0edd=function(_0x22045f,_0x344f88){_0x22045f=_0x22045f-0x0;var _0x32486d=_0xedd0[_0x22045f];return _0x32486d;};'use strict';var info=require(_0x0edd('0x0'));var exec=require(_0x0edd('0x1'))[_0x0edd('0x2')];var logger=require(_0x0edd('0x3'))(_0x0edd('0x4'));var util=require(_0x0edd('0x5'));var BPromise=require(_0x0edd('0x6'));var _=require(_0x0edd('0x7'));function handleError(_0x1c3088,_0x5ce2ed,_0x165358){_0x5ce2ed=_0x5ce2ed||0x1f4;return function(_0x88e0cf){logger[_0x0edd('0x8')](_0x0edd('0x9'),_0x165358,_0x5ce2ed,util[_0x0edd('0xa')](_0x88e0cf,{'showHidden':![],'depth':null}));delete _0x88e0cf[_0x0edd('0xb')];_0x1c3088[_0x0edd('0xc')](_0x5ce2ed)[_0x0edd('0xd')](_0x88e0cf);};}exports['index']=function(_0x18887a,_0x50c948){return info[_0x0edd('0xe')]()[_0x0edd('0xf')](function(_0x5e4b45){return _0x50c948[_0x0edd('0xc')](0xc8)[_0x0edd('0x10')](_0x5e4b45);})[_0x0edd('0x11')](function(_0xb1e437){return _0x50c948[_0x0edd('0xc')](0x1f4)[_0x0edd('0x10')](_0xb1e437);});};exports['killProcess']=function(_0x418e5b,_0x4a8ade){var _0x4fefcd=[_0x0edd('0x12')];return new BPromise(function(_0x2ceacc,_0x227896){return exec(util[_0x0edd('0x13')](_0x0edd('0x14'),_0x418e5b[_0x0edd('0x15')][_0x0edd('0x16')]),function(_0x1d54d5,_0x34f405,_0x2dec9e){if(_0x1d54d5){return _0x227896(_0x1d54d5);}return _0x2ceacc(_0x34f405);});})['then'](function(_0x5c5c22){var _0x5b8b4e=![];var _0x4f2d21=_0x5c5c22[_0x0edd('0x17')](/\n/);for(var _0x3bd27c=0x0,_0x427a18=_0x4fefcd[_0x0edd('0x18')];_0x3bd27c<_0x427a18,_0x5b8b4e===![];_0x3bd27c+=0x1){if(_0x5c5c22[_0x0edd('0x19')](_0x4fefcd[_0x3bd27c])>=0x0){_0x5b8b4e=!![];}}if(!_0x5b8b4e){throw new Error(util[_0x0edd('0x13')](_0x0edd('0x1a'),_0x418e5b[_0x0edd('0x15')][_0x0edd('0x16')]));}process[_0x0edd('0x1b')](_0x418e5b[_0x0edd('0x15')][_0x0edd('0x16')],_0x0edd('0x1c'));return _0x4a8ade[_0x0edd('0xc')](0xc8)[_0x0edd('0x10')]({'message':util[_0x0edd('0x13')](_0x0edd('0x1d'),_0x418e5b[_0x0edd('0x15')][_0x0edd('0x16')])});})[_0x0edd('0x11')](handleError(_0x4a8ade,null,_0x0edd('0x1e')));}; \ No newline at end of file +var _0x7cf9=['SIGINT','json','systeminformation','child_process','exec','../../config/logger','lodash','inspect','name','status','send','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill'];(function(_0xd1bd2b,_0x43ead3){var _0x466676=function(_0x4062eb){while(--_0x4062eb){_0xd1bd2b['push'](_0xd1bd2b['shift']());}};_0x466676(++_0x43ead3);}(_0x7cf9,0x120));var _0x97cf=function(_0x349de1,_0x49fb3b){_0x349de1=_0x349de1-0x0;var _0x15c4e5=_0x7cf9[_0x349de1];return _0x15c4e5;};'use strict';var info=require(_0x97cf('0x0'));var exec=require(_0x97cf('0x1'))[_0x97cf('0x2')];var logger=require(_0x97cf('0x3'))('api');var util=require('util');var BPromise=require('bluebird');var _=require(_0x97cf('0x4'));function handleError(_0x18a895,_0x303a66,_0x40274a){_0x303a66=_0x303a66||0x1f4;return function(_0x2ef0c9){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x40274a,_0x303a66,util[_0x97cf('0x5')](_0x2ef0c9,{'showHidden':![],'depth':null}));delete _0x2ef0c9[_0x97cf('0x6')];_0x18a895[_0x97cf('0x7')](_0x303a66)[_0x97cf('0x8')](_0x2ef0c9);};}exports[_0x97cf('0x9')]=function(_0x473ad0,_0x33bc55){return info[_0x97cf('0xa')]()[_0x97cf('0xb')](function(_0x352920){return _0x33bc55[_0x97cf('0x7')](0xc8)['json'](_0x352920);})[_0x97cf('0xc')](function(_0x12cbe7){return _0x33bc55[_0x97cf('0x7')](0x1f4)['json'](_0x12cbe7);});};exports[_0x97cf('0xd')]=function(_0x112572,_0x368988){var _0x884931=[_0x97cf('0xe')];return new BPromise(function(_0x155ee0,_0x26fff9){return exec(util[_0x97cf('0xf')](_0x97cf('0x10'),_0x112572['params'][_0x97cf('0x11')]),function(_0x1c8b80,_0x548ef4,_0x14c391){if(_0x1c8b80){return _0x26fff9(_0x1c8b80);}return _0x155ee0(_0x548ef4);});})['then'](function(_0x579bb3){var _0xecf317=![];var _0x3bec0f=_0x579bb3[_0x97cf('0x12')](/\n/);for(var _0x145cce=0x0,_0x1d34db=_0x884931[_0x97cf('0x13')];_0x145cce<_0x1d34db,_0xecf317===![];_0x145cce+=0x1){if(_0x579bb3[_0x97cf('0x14')](_0x884931[_0x145cce])>=0x0){_0xecf317=!![];}}if(!_0xecf317){throw new Error(util[_0x97cf('0xf')](_0x97cf('0x15'),_0x112572[_0x97cf('0x16')][_0x97cf('0x11')]));}process[_0x97cf('0x17')](_0x112572[_0x97cf('0x16')][_0x97cf('0x11')],_0x97cf('0x18'));return _0x368988[_0x97cf('0x7')](0xc8)[_0x97cf('0x19')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x112572[_0x97cf('0x16')][_0x97cf('0x11')])});})[_0x97cf('0xc')](handleError(_0x368988,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 52f7154..6b03b04 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 _0xff84=['/:id','show','post','create','put','update','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index'];(function(_0x3505a5,_0x2a9859){var _0x14bf20=function(_0x1ca098){while(--_0x1ca098){_0x3505a5['push'](_0x3505a5['shift']());}};_0x14bf20(++_0x2a9859);}(_0xff84,0x13a));var _0x4ff8=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xff84[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4ff8('0x0'));var express=require(_0x4ff8('0x1'));var router=express['Router']();var fs_extra=require(_0x4ff8('0x2'));var auth=require(_0x4ff8('0x3'));var interaction=require(_0x4ff8('0x4'));var config=require(_0x4ff8('0x5'));var controller=require(_0x4ff8('0x6'));router[_0x4ff8('0x7')]('/',auth[_0x4ff8('0x8')](),controller[_0x4ff8('0x9')]);router[_0x4ff8('0x7')](_0x4ff8('0xa'),auth[_0x4ff8('0x8')](),controller[_0x4ff8('0xb')]);router[_0x4ff8('0xc')]('/',auth['isAuthenticated'](),controller[_0x4ff8('0xd')]);router[_0x4ff8('0xe')](_0x4ff8('0xa'),auth[_0x4ff8('0x8')](),controller[_0x4ff8('0xf')]);router['delete'](_0x4ff8('0xa'),auth[_0x4ff8('0x8')](),controller[_0x4ff8('0x10')]);module[_0x4ff8('0x11')]=router; \ No newline at end of file +var _0xe334=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5ba435,_0x34aa9e){var _0x17d643=function(_0x2a0c5e){while(--_0x2a0c5e){_0x5ba435['push'](_0x5ba435['shift']());}};_0x17d643(++_0x34aa9e);}(_0xe334,0x1aa));var _0x4e33=function(_0x5458fc,_0x1a3db3){_0x5458fc=_0x5458fc-0x0;var _0x12604e=_0xe334[_0x5458fc];return _0x12604e;};'use strict';var multer=require('multer');var util=require(_0x4e33('0x0'));var path=require(_0x4e33('0x1'));var timeout=require(_0x4e33('0x2'));var express=require(_0x4e33('0x3'));var router=express[_0x4e33('0x4')]();var fs_extra=require(_0x4e33('0x5'));var auth=require(_0x4e33('0x6'));var interaction=require(_0x4e33('0x7'));var config=require(_0x4e33('0x8'));var controller=require('./tag.controller');router[_0x4e33('0x9')]('/',auth[_0x4e33('0xa')](),controller[_0x4e33('0xb')]);router['get'](_0x4e33('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4e33('0xa')](),controller[_0x4e33('0xd')]);router['put'](_0x4e33('0xc'),auth[_0x4e33('0xa')](),controller['update']);router['delete'](_0x4e33('0xc'),auth['isAuthenticated'](),controller[_0x4e33('0xe')]);module[_0x4e33('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d8ad526..62b9676 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 _0x0457=['STRING','#0091EA','exports'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0x0457,0x11f));var _0x7045=function(_0x4368c4,_0x2b8702){_0x4368c4=_0x4368c4-0x0;var _0x1e6c6f=_0x0457[_0x4368c4];return _0x1e6c6f;};'use strict';var Sequelize=require('sequelize');module[_0x7045('0x0')]={'name':{'type':Sequelize[_0x7045('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7045('0x1')],'defaultValue':_0x7045('0x2')},'description':{'type':Sequelize[_0x7045('0x1')]}}; \ No newline at end of file +var _0xde6f=['STRING','name'];(function(_0x3594d3,_0x57589a){var _0x4011a2=function(_0x5ac163){while(--_0x5ac163){_0x3594d3['push'](_0x3594d3['shift']());}};_0x4011a2(++_0x57589a);}(_0xde6f,0x84));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfde6('0x0')],'unique':_0xfde6('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xfde6('0x0')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xfde6('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6f41b05..c4f8fb4 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 _0x684c=['includeAll','rows','params','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','Tags','UserProfileResource','then','error','name','send','index','map','Tag','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options'];(function(_0x27603b,_0x494c3c){var _0x16a74b=function(_0x2cb8bf){while(--_0x2cb8bf){_0x27603b['push'](_0x27603b['shift']());}};_0x16a74b(++_0x494c3c);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){var _0x4e68e0=_0xd2a943['get']({'plain':!![]});var _0x27c7cc=_0xc684('0x27');return db[_0xc684('0x28')]['destroy']({'where':{'type':_0x27c7cc,'resourceId':_0x4e68e0['id']}})[_0xc684('0x29')](function(){return _0xd2a943;});})['then'](function(){_0x41162b[_0xc684('0x1e')](0xcc)[_0xc684('0x1d')]();});}};}function handleEntityNotFound(_0x13e09d,_0x49dad1){return function(_0x1f8e85){if(!_0x1f8e85){_0x13e09d['sendStatus'](0x194);}return _0x1f8e85;};}function handleError(_0x279998,_0x640ca1){_0x640ca1=_0x640ca1||0x1f4;return function(_0x210dcd){logger[_0xc684('0x2a')](_0x210dcd['stack']);if(_0x210dcd[_0xc684('0x2b')]){delete _0x210dcd[_0xc684('0x2b')];}_0x279998[_0xc684('0x1e')](_0x640ca1)[_0xc684('0x2c')](_0x210dcd);};}exports[_0xc684('0x2d')]=function(_0x1e029c,_0x10db0d){var _0x3abd2d={},_0x4df4d4={},_0x5c47ab={'count':0x0,'rows':[]};var _0x4e1d09=_[_0xc684('0x2e')](db[_0xc684('0x2f')]['rawAttributes'],function(_0x4e46c2){return{'name':_0x4e46c2[_0xc684('0x30')],'type':_0x4e46c2['type'][_0xc684('0x31')]};});_0x4df4d4[_0xc684('0x32')]=_[_0xc684('0x2e')](_0x4e1d09,'name');_0x4df4d4['query']=_[_0xc684('0x33')](_0x1e029c[_0xc684('0x34')]);_0x4df4d4['filters']=_['intersection'](_0x4df4d4[_0xc684('0x32')],_0x4df4d4[_0xc684('0x34')]);_0x3abd2d[_0xc684('0x35')]=_[_0xc684('0x36')](_0x4df4d4[_0xc684('0x32')],qs[_0xc684('0x37')](_0x1e029c['query'][_0xc684('0x37')]));_0x3abd2d['attributes']=_0x3abd2d['attributes'][_0xc684('0x38')]?_0x3abd2d[_0xc684('0x35')]:_0x4df4d4['model'];if(!_0x1e029c['query'][_0xc684('0x39')](_0xc684('0x3a'))){_0x3abd2d[_0xc684('0x22')]=qs[_0xc684('0x22')](_0x1e029c[_0xc684('0x34')]['limit']);_0x3abd2d[_0xc684('0x21')]=qs[_0xc684('0x21')](_0x1e029c['query']['offset']);}_0x3abd2d[_0xc684('0x3b')]=qs[_0xc684('0x3c')](_0x1e029c[_0xc684('0x34')][_0xc684('0x3c')]);_0x3abd2d[_0xc684('0x3d')]=qs[_0xc684('0x3e')](_[_0xc684('0x3f')](_0x1e029c['query'],_0x4df4d4['filters']),_0x4e1d09);if(_0x1e029c[_0xc684('0x34')][_0xc684('0x40')]){_0x3abd2d['where']=_['merge'](_0x3abd2d['where'],{'$or':_[_0xc684('0x2e')](_0x4e1d09,function(_0x4a9320){if(_0x4a9320[_0xc684('0x41')]!==_0xc684('0x42')){var _0x2649ee={};_0x2649ee[_0x4a9320['name']]={'$like':'%'+_0x1e029c[_0xc684('0x34')]['filter']+'%'};return _0x2649ee;}})});}_0x3abd2d=_[_0xc684('0x43')]({},_0x3abd2d,_0x1e029c[_0xc684('0x44')]);var _0x380e7c={'where':_0x3abd2d[_0xc684('0x3d')]};return db['Tag'][_0xc684('0x20')](_0x380e7c)[_0xc684('0x29')](function(_0xd9eae7){_0x5c47ab[_0xc684('0x20')]=_0xd9eae7;if(_0x1e029c[_0xc684('0x34')][_0xc684('0x45')]){_0x3abd2d['include']=[{'all':!![]}];}return db[_0xc684('0x2f')]['findAll'](_0x3abd2d);})['then'](function(_0x46c6ad){_0x5c47ab[_0xc684('0x46')]=_0x46c6ad;return _0x5c47ab;})[_0xc684('0x29')](respondWithFilteredResult(_0x10db0d,_0x3abd2d))['catch'](handleError(_0x10db0d,null));};exports['show']=function(_0x4f288b,_0x4ebd3e){var _0x4d0586={'raw':!![],'where':{'id':_0x4f288b[_0xc684('0x47')]['id']}},_0x189b26={};_0x189b26[_0xc684('0x32')]=_['keys'](db[_0xc684('0x2f')]['rawAttributes']);_0x189b26[_0xc684('0x34')]=_['keys'](_0x4f288b[_0xc684('0x34')]);_0x189b26[_0xc684('0x3e')]=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],_0x189b26[_0xc684('0x34')]);_0x4d0586['attributes']=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],qs[_0xc684('0x37')](_0x4f288b[_0xc684('0x34')][_0xc684('0x37')]));_0x4d0586[_0xc684('0x35')]=_0x4d0586[_0xc684('0x35')][_0xc684('0x38')]?_0x4d0586[_0xc684('0x35')]:_0x189b26['model'];if(_0x4f288b[_0xc684('0x34')][_0xc684('0x45')]){_0x4d0586['include']=[{'all':!![]}];}_0x4d0586=_[_0xc684('0x43')]({},_0x4d0586,_0x4f288b['options']);return db[_0xc684('0x2f')]['find'](_0x4d0586)[_0xc684('0x29')](handleEntityNotFound(_0x4ebd3e,null))[_0xc684('0x29')](respondWithResult(_0x4ebd3e,null))[_0xc684('0x48')](handleError(_0x4ebd3e,null));};exports[_0xc684('0x49')]=function(_0x1bfd8d,_0x1fde57){return db[_0xc684('0x2f')][_0xc684('0x49')](_0x1bfd8d[_0xc684('0x4a')],{})[_0xc684('0x29')](function(_0x4abd04){var _0x16951f=_0x1bfd8d[_0xc684('0x4b')]['get']({'plain':!![]});if(!_0x16951f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16951f['role']===_0xc684('0x4b')){var _0x1304a2=_0x4abd04[_0xc684('0x4c')]({'plain':!![]});var _0x34b2cd=_0xc684('0x27');return db[_0xc684('0x4d')]['find']({'where':{'name':_0x34b2cd,'userProfileId':_0x16951f[_0xc684('0x4e')]},'raw':!![]})[_0xc684('0x29')](function(_0x16f039){if(_0x16f039&&_0x16f039[_0xc684('0x4f')]===0x0){return db[_0xc684('0x28')]['create']({'name':_0x1304a2[_0xc684('0x2b')],'resourceId':_0x1304a2['id'],'type':_0x16f039[_0xc684('0x2b')],'sectionId':_0x16f039['id']},{})['then'](function(){return _0x4abd04;});}else{return _0x4abd04;}})[_0xc684('0x48')](function(_0x7af88c){logger[_0xc684('0x2a')](_0xc684('0x50'),_0x7af88c);throw _0x7af88c;});}return _0x4abd04;})[_0xc684('0x29')](respondWithResult(_0x1fde57,0xc9))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x51')]=function(_0x4d3484,_0x3c6f05){if(_0x4d3484[_0xc684('0x4a')]['id']){delete _0x4d3484[_0xc684('0x4a')]['id'];}return db[_0xc684('0x2f')][_0xc684('0x52')]({'where':{'id':_0x4d3484[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x3c6f05,null))[_0xc684('0x29')](saveUpdates(_0x4d3484[_0xc684('0x4a')],null))['then'](respondWithResult(_0x3c6f05,null))['catch'](handleError(_0x3c6f05,null));};exports[_0xc684('0x53')]=function(_0x49218e,_0x2b2d54){return db['Tag']['find']({'where':{'id':_0x49218e[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x2b2d54,null))[_0xc684('0x29')](removeEntity(_0x2b2d54,null))[_0xc684('0x48')](handleError(_0x2b2d54,null));}; \ No newline at end of file +var _0xad8a=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','map','Tag','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','fields','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x3062cb,_0x44ca12){var _0xf29731=function(_0x11fc4b){while(--_0x11fc4b){_0x3062cb['push'](_0x3062cb['shift']());}};_0xf29731(++_0x44ca12);}(_0xad8a,0xb0));var _0xaad8=function(_0x4639be,_0x16bbb5){_0x4639be=_0x4639be-0x0;var _0x171159=_0xad8a[_0x4639be];return _0x171159;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){var _0x477d29=_0x1daacf[_0xaad8('0x2a')]({'plain':!![]});var _0x1bbac4=_0xaad8('0x2b');return db[_0xaad8('0x2c')][_0xaad8('0x29')]({'where':{'type':_0x1bbac4,'resourceId':_0x477d29['id']}})[_0xaad8('0x28')](function(){return _0x1daacf;});})['then'](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x3f066f,_0x47b7a2){return function(_0x237c67){if(!_0x237c67){_0x3f066f[_0xaad8('0x1b')](0x194);}return _0x237c67;};}function handleError(_0x36b180,_0x1ca776){_0x1ca776=_0x1ca776||0x1f4;return function(_0x24c01d){logger['error'](_0x24c01d[_0xaad8('0x2d')]);if(_0x24c01d[_0xaad8('0x2e')]){delete _0x24c01d[_0xaad8('0x2e')];}_0x36b180[_0xaad8('0x1c')](_0x1ca776)[_0xaad8('0x2f')](_0x24c01d);};}exports['index']=function(_0x78c862,_0x4030ea){var _0x20ea82={},_0x22f47a={},_0x47ffb7={'count':0x0,'rows':[]};var _0x30b0e2=_[_0xaad8('0x30')](db[_0xaad8('0x31')][_0xaad8('0x32')],function(_0x254ee5){return{'name':_0x254ee5['fieldName'],'type':_0x254ee5[_0xaad8('0x33')][_0xaad8('0x34')]};});_0x22f47a['model']=_['map'](_0x30b0e2,_0xaad8('0x2e'));_0x22f47a[_0xaad8('0x35')]=_[_0xaad8('0x36')](_0x78c862[_0xaad8('0x35')]);_0x22f47a['filters']=_[_0xaad8('0x37')](_0x22f47a[_0xaad8('0x38')],_0x22f47a['query']);_0x20ea82['attributes']=_[_0xaad8('0x37')](_0x22f47a[_0xaad8('0x38')],qs['fields'](_0x78c862[_0xaad8('0x35')]['fields']));_0x20ea82['attributes']=_0x20ea82[_0xaad8('0x39')][_0xaad8('0x3a')]?_0x20ea82['attributes']:_0x22f47a[_0xaad8('0x38')];if(!_0x78c862[_0xaad8('0x35')][_0xaad8('0x3b')](_0xaad8('0x3c'))){_0x20ea82['limit']=qs[_0xaad8('0x20')](_0x78c862[_0xaad8('0x35')][_0xaad8('0x20')]);_0x20ea82[_0xaad8('0x3d')]=qs[_0xaad8('0x3d')](_0x78c862[_0xaad8('0x35')]['offset']);}_0x20ea82[_0xaad8('0x3e')]=qs[_0xaad8('0x3f')](_0x78c862[_0xaad8('0x35')]['sort']);_0x20ea82[_0xaad8('0x40')]=qs[_0xaad8('0x41')](_[_0xaad8('0x42')](_0x78c862[_0xaad8('0x35')],_0x22f47a[_0xaad8('0x41')]),_0x30b0e2);if(_0x78c862[_0xaad8('0x35')][_0xaad8('0x43')]){_0x20ea82['where']=_[_0xaad8('0x44')](_0x20ea82[_0xaad8('0x40')],{'$or':_[_0xaad8('0x30')](_0x30b0e2,function(_0x25c0a4){if(_0x25c0a4[_0xaad8('0x33')]!==_0xaad8('0x45')){var _0x4e4081={};_0x4e4081[_0x25c0a4[_0xaad8('0x2e')]]={'$like':'%'+_0x78c862[_0xaad8('0x35')][_0xaad8('0x43')]+'%'};return _0x4e4081;}})});}_0x20ea82=_[_0xaad8('0x44')]({},_0x20ea82,_0x78c862['options']);var _0x543761={'where':_0x20ea82['where']};return db[_0xaad8('0x31')][_0xaad8('0x21')](_0x543761)[_0xaad8('0x28')](function(_0x5bb668){_0x47ffb7[_0xaad8('0x21')]=_0x5bb668;if(_0x78c862[_0xaad8('0x35')]['includeAll']){_0x20ea82[_0xaad8('0x46')]=[{'all':!![]}];}return db[_0xaad8('0x31')][_0xaad8('0x47')](_0x20ea82);})[_0xaad8('0x28')](function(_0x3933ac){_0x47ffb7[_0xaad8('0x48')]=_0x3933ac;return _0x47ffb7;})[_0xaad8('0x28')](respondWithFilteredResult(_0x4030ea,_0x20ea82))[_0xaad8('0x49')](handleError(_0x4030ea,null));};exports[_0xaad8('0x4a')]=function(_0xbd5191,_0x29432a){var _0x241ceb={'raw':!![],'where':{'id':_0xbd5191['params']['id']}},_0x4b5b76={};_0x4b5b76['model']=_[_0xaad8('0x36')](db['Tag'][_0xaad8('0x32')]);_0x4b5b76['query']=_['keys'](_0xbd5191[_0xaad8('0x35')]);_0x4b5b76['filters']=_[_0xaad8('0x37')](_0x4b5b76[_0xaad8('0x38')],_0x4b5b76[_0xaad8('0x35')]);_0x241ceb[_0xaad8('0x39')]=_[_0xaad8('0x37')](_0x4b5b76[_0xaad8('0x38')],qs[_0xaad8('0x4b')](_0xbd5191[_0xaad8('0x35')][_0xaad8('0x4b')]));_0x241ceb[_0xaad8('0x39')]=_0x241ceb[_0xaad8('0x39')][_0xaad8('0x3a')]?_0x241ceb[_0xaad8('0x39')]:_0x4b5b76[_0xaad8('0x38')];if(_0xbd5191[_0xaad8('0x35')]['includeAll']){_0x241ceb['include']=[{'all':!![]}];}_0x241ceb=_[_0xaad8('0x44')]({},_0x241ceb,_0xbd5191[_0xaad8('0x4c')]);return db[_0xaad8('0x31')]['find'](_0x241ceb)['then'](handleEntityNotFound(_0x29432a,null))[_0xaad8('0x28')](respondWithResult(_0x29432a,null))['catch'](handleError(_0x29432a,null));};exports[_0xaad8('0x4d')]=function(_0x1560ef,_0x313824){return db[_0xaad8('0x31')][_0xaad8('0x4d')](_0x1560ef[_0xaad8('0x4e')],{})[_0xaad8('0x28')](function(_0x23de0a){var _0xb19607=_0x1560ef['user'][_0xaad8('0x2a')]({'plain':!![]});if(!_0xb19607)throw new Error(_0xaad8('0x4f'));if(_0xb19607['role']===_0xaad8('0x50')){var _0x5e5ef1=_0x23de0a[_0xaad8('0x2a')]({'plain':!![]});var _0x15cb03=_0xaad8('0x2b');return db[_0xaad8('0x51')][_0xaad8('0x52')]({'where':{'name':_0x15cb03,'userProfileId':_0xb19607[_0xaad8('0x53')]},'raw':!![]})[_0xaad8('0x28')](function(_0x325a49){if(_0x325a49&&_0x325a49[_0xaad8('0x54')]===0x0){return db['UserProfileResource'][_0xaad8('0x4d')]({'name':_0x5e5ef1[_0xaad8('0x2e')],'resourceId':_0x5e5ef1['id'],'type':_0x325a49[_0xaad8('0x2e')],'sectionId':_0x325a49['id']},{})[_0xaad8('0x28')](function(){return _0x23de0a;});}else{return _0x23de0a;}})[_0xaad8('0x49')](function(_0x9bf893){logger['error'](_0xaad8('0x55'),_0x9bf893);throw _0x9bf893;});}return _0x23de0a;})[_0xaad8('0x28')](respondWithResult(_0x313824,0xc9))['catch'](handleError(_0x313824,null));};exports['update']=function(_0x33e743,_0x1202d4){if(_0x33e743[_0xaad8('0x4e')]['id']){delete _0x33e743[_0xaad8('0x4e')]['id'];}return db[_0xaad8('0x31')][_0xaad8('0x52')]({'where':{'id':_0x33e743['params']['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x1202d4,null))[_0xaad8('0x28')](saveUpdates(_0x33e743[_0xaad8('0x4e')],null))[_0xaad8('0x28')](respondWithResult(_0x1202d4,null))[_0xaad8('0x49')](handleError(_0x1202d4,null));};exports['destroy']=function(_0x5ddb77,_0x48edf6){return db[_0xaad8('0x31')][_0xaad8('0x52')]({'where':{'id':_0x5ddb77['params']['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x48edf6,null))[_0xaad8('0x28')](removeEntity(_0x48edf6,null))[_0xaad8('0x49')](handleError(_0x48edf6,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c51356c..8554b73 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 _0x58b7=['Tag','tools_tags','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x2599cd,_0x5de45d){var _0x47603a=function(_0x20b321){while(--_0x20b321){_0x2599cd['push'](_0x2599cd['shift']());}};_0x47603a(++_0x5de45d);}(_0x58b7,0x16e));var _0x758b=function(_0x2fefc2,_0x447d59){_0x2fefc2=_0x2fefc2-0x0;var _0x121689=_0x58b7[_0x2fefc2];return _0x121689;};'use strict';var _=require(_0x758b('0x0'));var util=require(_0x758b('0x1'));var logger=require(_0x758b('0x2'))('api');var moment=require(_0x758b('0x3'));var BPromise=require(_0x758b('0x4'));var rp=require(_0x758b('0x5'));var fs=require('fs');var path=require(_0x758b('0x6'));var rimraf=require(_0x758b('0x7'));var config=require(_0x758b('0x8'));var attributes=require(_0x758b('0x9'));module[_0x758b('0xa')]=function(_0xad74f1,_0x43972c){return _0xad74f1[_0x758b('0xb')](_0x758b('0xc'),attributes,{'tableName':_0x758b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95db=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Tag','lodash','moment'];(function(_0x4f19ab,_0x301feb){var _0x1fe1e9=function(_0x188294){while(--_0x188294){_0x4f19ab['push'](_0x4f19ab['shift']());}};_0x1fe1e9(++_0x301feb);}(_0x95db,0x1a2));var _0xb95d=function(_0x3922d1,_0x29d704){_0x3922d1=_0x3922d1-0x0;var _0x1fa4c9=_0x95db[_0x3922d1];return _0x1fa4c9;};'use strict';var _=require(_0xb95d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb95d('0x1'));var BPromise=require(_0xb95d('0x2'));var rp=require(_0xb95d('0x3'));var fs=require('fs');var path=require(_0xb95d('0x4'));var rimraf=require(_0xb95d('0x5'));var config=require(_0xb95d('0x6'));var attributes=require('./tag.attributes');module[_0xb95d('0x7')]=function(_0x4e4cac,_0xcf9d14){return _0x4e4cac[_0xb95d('0x8')](_0xb95d('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index cc823b2..43aa414 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 _0xb7c8=['error','Tag,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0xbb3ddd,_0x32bd18){var _0x3768f2=function(_0x545d84){while(--_0x545d84){_0xbb3ddd['push'](_0xbb3ddd['shift']());}};_0x3768f2(++_0x32bd18);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5f93b4,_0x546235){_0x5f93b4=_0x5f93b4-0x0;var _0x433104=_0xb7c8[_0x5f93b4];return _0x433104;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var BPromise=require(_0x8b7c('0x2'));var rs=require(_0x8b7c('0x3'));var fs=require('fs');var Redis=require(_0x8b7c('0x4'));var db=require(_0x8b7c('0x5'))['db'];var utils=require(_0x8b7c('0x6'));var logger=require('../../config/logger')(_0x8b7c('0x7'));var config=require(_0x8b7c('0x8'));var jayson=require(_0x8b7c('0x9'));var client=jayson[_0x8b7c('0xa')][_0x8b7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12665c,_0x7a3850,_0x3c8fd6){return new BPromise(function(_0x6afb55,_0x30a924){return client[_0x8b7c('0xc')](_0x12665c,_0x3c8fd6)[_0x8b7c('0xd')](function(_0x48370e){logger[_0x8b7c('0xe')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'));logger[_0x8b7c('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'),JSON[_0x8b7c('0x11')](_0x48370e));if(_0x48370e[_0x8b7c('0x12')]){if(_0x48370e['error']['code']===0x1f4){logger[_0x8b7c('0x12')](_0x8b7c('0x13'),_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x30a924(_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);}logger[_0x8b7c('0x12')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x6afb55(_0x48370e[_0x8b7c('0x12')]['message']);}else{logger[_0x8b7c('0xe')](_0x8b7c('0x13'),_0x7a3850,'request\x20sent');_0x6afb55(_0x48370e[_0x8b7c('0x15')][_0x8b7c('0x14')]);}})[_0x8b7c('0x16')](function(_0x1682fd){logger[_0x8b7c('0x12')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x1682fd);_0x30a924(_0x1682fd);});});} \ No newline at end of file +var _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5577,0x1b4));var _0x7557=function(_0x56698c,_0x1f490d){_0x56698c=_0x56698c-0x0;var _0x458f04=_0x5577[_0x56698c];return _0x458f04;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('Tag,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('Tag,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2255273..43b4b26 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 cb9c4d2..f344619 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(_0x13773f,_0x2353c6){var _0x218996=function(_0x510b12){while(--_0x510b12){_0x13773f['push'](_0x13773f['shift']());}};_0x218996(++_0x2353c6);}(_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(_0x7decc8,_0x3ebc3f){var _0x4034cd=function(_0x3de54e){while(--_0x3de54e){_0x7decc8['push'](_0x7decc8['shift']());}};_0x4034cd(++_0x3ebc3f);}(_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 5fb06af..ab6a59f 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 _0x804e=['SIP/%s','all','spread','Fax','removeAgents','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','error','stack','name','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','then','rows','catch','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','SELECT','UserId','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','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','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','Queue','order','sort','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Openchannel','Whatsapp','transaction','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format'];(function(_0x26436c,_0x1ecfcb){var _0x17dc08=function(_0x21f562){while(--_0x21f562){_0x26436c['push'](_0x26436c['shift']());}};_0x17dc08(++_0x1ecfcb);}(_0x804e,0x14a));var _0xe804=function(_0x63f69d,_0x425ad8){_0x63f69d=_0x63f69d-0x0;var _0x1d2399=_0x804e[_0x63f69d];return _0x1d2399;};'use strict';var emlformat=require(_0xe804('0x0'));var rimraf=require(_0xe804('0x1'));var zipdir=require(_0xe804('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe804('0x3'));var moment=require(_0xe804('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe804('0x5'));var util=require(_0xe804('0x6'));var path=require(_0xe804('0x7'));var sox=require(_0xe804('0x8'));var csv=require(_0xe804('0x9'));var ejs=require(_0xe804('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe804('0xb'));var squel=require(_0xe804('0xc'));var crypto=require(_0xe804('0xd'));var jsforce=require(_0xe804('0xe'));var deskjs=require(_0xe804('0xf'));var toCsv=require(_0xe804('0x9'));var querystring=require('querystring');var Papa=require(_0xe804('0x10'));var Redis=require('ioredis');var authService=require(_0xe804('0x11'));var qs=require(_0xe804('0x12'));var as=require(_0xe804('0x13'));var hardwareService=require(_0xe804('0x14'));var logger=require(_0xe804('0x15'))(_0xe804('0x16'));var utils=require(_0xe804('0x17'));var config=require(_0xe804('0x18'));var licenseUtil=require(_0xe804('0x19'));var db=require('../../mysqldb')['db'];config[_0xe804('0x1a')]=_[_0xe804('0x1b')](config[_0xe804('0x1a')],{'host':_0xe804('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe804('0x1a')]));require(_0xe804('0x1d'))['register'](socket);function respondWithStatusCode(_0x1f2892,_0x8a86a5){_0x8a86a5=_0x8a86a5||0xcc;return function(_0x1c32bc){if(_0x1c32bc){return _0x1f2892[_0xe804('0x1e')](_0x8a86a5);}return _0x1f2892[_0xe804('0x1f')](_0x8a86a5)[_0xe804('0x20')]();};}function respondWithResult(_0x312ee5,_0x422fa6){_0x422fa6=_0x422fa6||0xc8;return function(_0x1292f4){if(_0x1292f4){return _0x312ee5[_0xe804('0x1f')](_0x422fa6)[_0xe804('0x21')](_0x1292f4);}};}function respondWithFilteredResult(_0x44ceed,_0x9745ad){return function(_0x2d74fd){if(_0x2d74fd){var _0x29b7f5=typeof _0x9745ad[_0xe804('0x22')]===_0xe804('0x23')&&typeof _0x9745ad[_0xe804('0x24')]===_0xe804('0x23');var _0x495b20=_0x2d74fd[_0xe804('0x25')];var _0x24da32=_0x29b7f5?0x0:_0x9745ad[_0xe804('0x22')];var _0x371ddc=_0x29b7f5?_0x2d74fd[_0xe804('0x25')]:_0x9745ad[_0xe804('0x22')]+_0x9745ad['limit'];var _0x566ed3;if(_0x371ddc>=_0x495b20){_0x371ddc=_0x495b20;_0x566ed3=0xc8;}else{_0x566ed3=0xce;}_0x44ceed['status'](_0x566ed3);return _0x44ceed[_0xe804('0x26')]('Content-Range',_0x24da32+'-'+_0x371ddc+'/'+_0x495b20)[_0xe804('0x21')](_0x2d74fd);}return null;};}function patchUpdates(_0x51ddd1){return function(_0x250bff){try{jsonpatch[_0xe804('0x27')](_0x250bff,_0x51ddd1,!![]);}catch(_0x22edd4){return BPromise['reject'](_0x22edd4);}return _0x250bff[_0xe804('0x28')]();};}function saveUpdates(_0x1c28cb,_0x21a6c6){return function(_0x28ac76){if(_0x28ac76){return _0x28ac76[_0xe804('0x29')](_0x1c28cb)['then'](function(_0x28f969){return _0x28f969;});}return null;};}function handleEntityNotFound(_0x3e5415,_0x5c5947){return function(_0x462737){if(!_0x462737){_0x3e5415[_0xe804('0x1e')](0x194);}return _0x462737;};}function handleError(_0x54dae1,_0x13b0df){_0x13b0df=_0x13b0df||0x1f4;return function(_0x126163){logger[_0xe804('0x2a')](_0x126163[_0xe804('0x2b')]);if(_0x126163[_0xe804('0x2c')]){delete _0x126163[_0xe804('0x2c')];}_0x54dae1['status'](_0x13b0df)['send'](_0x126163);};}exports[_0xe804('0x2d')]=function(_0x3ebc7b,_0x2cbe51){var _0x18db0d={},_0x3701f8={},_0x329e23={'count':0x0,'rows':[]};var _0x4d2bdd=_[_0xe804('0x2e')](db[_0xe804('0x2f')][_0xe804('0x30')],function(_0x325eb0){return{'name':_0x325eb0[_0xe804('0x31')],'type':_0x325eb0[_0xe804('0x32')]['key']};});_0x3701f8[_0xe804('0x33')]=_[_0xe804('0x2e')](_0x4d2bdd,_0xe804('0x2c'));_0x3701f8[_0xe804('0x34')]=_[_0xe804('0x35')](_0x3ebc7b[_0xe804('0x34')]);_0x3701f8[_0xe804('0x36')]=_[_0xe804('0x37')](_0x3701f8[_0xe804('0x33')],_0x3701f8[_0xe804('0x34')]);_0x18db0d[_0xe804('0x38')]=_['intersection'](_0x3701f8['model'],qs['fields'](_0x3ebc7b['query']['fields']));_0x18db0d['attributes']=_0x18db0d[_0xe804('0x38')][_0xe804('0x39')]?_0x18db0d[_0xe804('0x38')]:_0x3701f8['model'];if(!_0x3ebc7b['query']['hasOwnProperty'](_0xe804('0x3a'))){_0x18db0d[_0xe804('0x24')]=qs['limit'](_0x3ebc7b[_0xe804('0x34')]['limit']);_0x18db0d['offset']=qs['offset'](_0x3ebc7b['query'][_0xe804('0x22')]);}_0x18db0d['order']=qs['sort'](_0x3ebc7b[_0xe804('0x34')]['sort']);_0x18db0d[_0xe804('0x3b')]=qs[_0xe804('0x36')](_[_0xe804('0x3c')](_0x3ebc7b[_0xe804('0x34')],_0x3701f8[_0xe804('0x36')]),_0x4d2bdd);if(_0x3ebc7b[_0xe804('0x34')]['filter']){_0x18db0d[_0xe804('0x3b')]=_[_0xe804('0x3d')](_0x18db0d['where'],{'$or':_[_0xe804('0x2e')](_0x4d2bdd,function(_0xc874fa){if(_0xc874fa['type']!==_0xe804('0x3e')){var _0x3c14a0={};_0x3c14a0[_0xc874fa['name']]={'$like':'%'+_0x3ebc7b[_0xe804('0x34')][_0xe804('0x3f')]+'%'};return _0x3c14a0;}})});}_0x18db0d=_['merge']({},_0x18db0d,_0x3ebc7b[_0xe804('0x40')]);var _0x2fda5f={'where':_0x18db0d['where']};return db[_0xe804('0x2f')][_0xe804('0x25')](_0x2fda5f)['then'](function(_0x34be0d){_0x329e23['count']=_0x34be0d;if(_0x3ebc7b[_0xe804('0x34')][_0xe804('0x41')]){_0x18db0d['include']=[{'all':!![]}];}return db[_0xe804('0x2f')][_0xe804('0x42')](_0x18db0d);})[_0xe804('0x43')](function(_0x579b6d){_0x329e23[_0xe804('0x44')]=_0x579b6d;return _0x329e23;})[_0xe804('0x43')](respondWithFilteredResult(_0x2cbe51,_0x18db0d))[_0xe804('0x45')](handleError(_0x2cbe51,null));};exports['show']=function(_0x3819d7,_0x124794){var _0x38cbe9={'raw':![],'where':{'id':_0x3819d7['params']['id']}},_0x1a6d18={};_0x1a6d18[_0xe804('0x33')]=_[_0xe804('0x35')](db[_0xe804('0x2f')][_0xe804('0x30')]);_0x1a6d18['query']=_[_0xe804('0x35')](_0x3819d7['query']);_0x1a6d18[_0xe804('0x36')]=_[_0xe804('0x37')](_0x1a6d18[_0xe804('0x33')],_0x1a6d18[_0xe804('0x34')]);_0x38cbe9['attributes']=_[_0xe804('0x37')](_0x1a6d18[_0xe804('0x33')],qs[_0xe804('0x46')](_0x3819d7[_0xe804('0x34')][_0xe804('0x46')]));_0x38cbe9[_0xe804('0x38')]=_0x38cbe9[_0xe804('0x38')][_0xe804('0x39')]?_0x38cbe9[_0xe804('0x38')]:_0x1a6d18[_0xe804('0x33')];if(_0x3819d7[_0xe804('0x34')][_0xe804('0x41')]){_0x38cbe9[_0xe804('0x47')]=[{'all':!![]}];}_0x38cbe9=_[_0xe804('0x3d')]({},_0x38cbe9,_0x3819d7[_0xe804('0x40')]);return db[_0xe804('0x2f')]['find'](_0x38cbe9)[_0xe804('0x43')](handleEntityNotFound(_0x124794,null))['then'](respondWithResult(_0x124794,null))[_0xe804('0x45')](handleError(_0x124794,null));};exports[_0xe804('0x48')]=function(_0x3e3fe0,_0x49a862){return db[_0xe804('0x2f')][_0xe804('0x48')](_0x3e3fe0['body'],{})[_0xe804('0x43')](function(_0x3d6167){var _0x3d401d=_0x3e3fe0[_0xe804('0x49')]['get']({'plain':!![]});if(!_0x3d401d)throw new Error(_0xe804('0x4a'));if(_0x3d401d[_0xe804('0x4b')]==='user'){var _0x1f2837=_0x3d6167[_0xe804('0x4c')]({'plain':!![]});var _0x16eb70=_0xe804('0x4d');return db[_0xe804('0x4e')][_0xe804('0x4f')]({'where':{'name':_0x16eb70,'userProfileId':_0x3d401d[_0xe804('0x50')]},'raw':!![]})['then'](function(_0x2545b1){if(_0x2545b1&&_0x2545b1['autoAssociation']===0x0){return db['UserProfileResource'][_0xe804('0x48')]({'name':_0x1f2837[_0xe804('0x2c')],'resourceId':_0x1f2837['id'],'type':_0x2545b1[_0xe804('0x2c')],'sectionId':_0x2545b1['id']},{})[_0xe804('0x43')](function(){return _0x3d6167;});}else{return _0x3d6167;}})[_0xe804('0x45')](function(_0x4640a5){logger[_0xe804('0x2a')](_0xe804('0x51'),_0x4640a5);throw _0x4640a5;});}return _0x3d6167;})[_0xe804('0x43')](respondWithResult(_0x49a862,0xc9))[_0xe804('0x45')](handleError(_0x49a862,null));};exports[_0xe804('0x29')]=function(_0x22e640,_0x15d69d){if(_0x22e640[_0xe804('0x52')]['id']){delete _0x22e640[_0xe804('0x52')]['id'];}return db[_0xe804('0x2f')][_0xe804('0x4f')]({'where':{'id':_0x22e640[_0xe804('0x53')]['id']}})[_0xe804('0x43')](handleEntityNotFound(_0x15d69d,null))[_0xe804('0x43')](saveUpdates(_0x22e640[_0xe804('0x52')],null))[_0xe804('0x43')](respondWithResult(_0x15d69d,null))[_0xe804('0x45')](handleError(_0x15d69d,null));};exports[_0xe804('0x54')]=function(_0x2a021c,_0x33c12d){var _0x2c5a04=_0x2a021c[_0xe804('0x53')]['id'];var _0x34fc5f=[];return db['sequelize']['transaction'](function(_0x240b34){var _0x579a4b=_0xe804('0x55')+_0x2c5a04;return db[_0xe804('0x56')][_0xe804('0x34')](_0x579a4b,{'type':db['Sequelize'][_0xe804('0x57')][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34})[_0xe804('0x43')](function(_0x57b52c){_0x34fc5f=_[_0xe804('0x2e')](_0x57b52c,function(_0x2b0482){return Number(_0x2b0482[_0xe804('0x59')]);});})[_0xe804('0x43')](function(){var _0x53cdf2='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2c5a04;return db[_0xe804('0x56')]['query'](_0x53cdf2,{'type':db[_0xe804('0x5a')]['QueryTypes'][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0x2f0013){var _0x350765=_[_0xe804('0x2e')](_0x2f0013,function(_0x22529b){return Number(_0x22529b[_0xe804('0x5b')]);});return db[_0xe804('0x5c')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'VoiceQueueId':{'$in':_0x350765}},'transaction':_0x240b34});})['then'](function(){var _0x2aaa8a=_0xe804('0x5d')+_0x2c5a04;return db[_0xe804('0x56')][_0xe804('0x34')](_0x2aaa8a,{'type':db[_0xe804('0x5a')][_0xe804('0x57')][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0x10113d){var _0x20627b=_[_0xe804('0x2e')](_0x10113d,function(_0x3d8f62){return Number(_0x3d8f62[_0xe804('0x5e')]);});return db[_0xe804('0x5f')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'MailQueueId':{'$in':_0x20627b}},'transaction':_0x240b34});})['then'](function(){var _0x3d3b9f=_0xe804('0x60')+_0x2c5a04;return db['sequelize'][_0xe804('0x34')](_0x3d3b9f,{'type':db['Sequelize'][_0xe804('0x57')]['SELECT'],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0x159b97){var _0x542627=_[_0xe804('0x2e')](_0x159b97,function(_0x2132b0){return Number(_0x2132b0[_0xe804('0x61')]);});return db[_0xe804('0x62')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'SmsQueueId':{'$in':_0x542627}},'transaction':_0x240b34});})[_0xe804('0x43')](function(){var _0x7449c2=_0xe804('0x63')+_0x2c5a04;return db[_0xe804('0x56')]['query'](_0x7449c2,{'type':db['Sequelize'][_0xe804('0x57')][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0xbe486b){var _0x3f87f5=_[_0xe804('0x2e')](_0xbe486b,function(_0x5ca025){return Number(_0x5ca025[_0xe804('0x64')]);});return db[_0xe804('0x65')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'ChatQueueId':{'$in':_0x3f87f5}},'transaction':_0x240b34});})[_0xe804('0x43')](function(){var _0xcf7fcd=_0xe804('0x66')+_0x2c5a04;return db[_0xe804('0x56')]['query'](_0xcf7fcd,{'type':db[_0xe804('0x5a')][_0xe804('0x57')][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0x2a4070){var _0x812a01=_[_0xe804('0x2e')](_0x2a4070,function(_0x4bbfa9){return Number(_0x4bbfa9[_0xe804('0x67')]);});return db[_0xe804('0x68')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'FaxQueueId':{'$in':_0x812a01}},'transaction':_0x240b34});})[_0xe804('0x43')](function(){var _0x3c908f=_0xe804('0x69')+_0x2c5a04;return db[_0xe804('0x56')][_0xe804('0x34')](_0x3c908f,{'type':db[_0xe804('0x5a')][_0xe804('0x57')][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})['then'](function(_0x3bb64a){var _0x255914=_[_0xe804('0x2e')](_0x3bb64a,function(_0x636097){return Number(_0x636097[_0xe804('0x6a')]);});return db[_0xe804('0x6b')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'OpenchannelQueueId':{'$in':_0x255914}},'transaction':_0x240b34});})['then'](function(){var _0xf36330='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2c5a04;return db[_0xe804('0x56')]['query'](_0xf36330,{'type':db[_0xe804('0x5a')]['QueryTypes'][_0xe804('0x58')],'raw':!![],'transaction':_0x240b34});})[_0xe804('0x43')](function(_0x54108f){var _0x4f74f8=_[_0xe804('0x2e')](_0x54108f,function(_0xd60780){return Number(_0xd60780[_0xe804('0x6c')]);});return db['UserWhatsappQueue'][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'WhatsappQueueId':{'$in':_0x4f74f8}},'transaction':_0x240b34});})['then'](function(){return db[_0xe804('0x6d')][_0xe804('0x4f')]({'where':{'TeamId':_0x2c5a04}});})[_0xe804('0x43')](function(_0x2153a0){if(_0x2153a0===null){return;}return db[_0xe804('0x6e')][_0xe804('0x54')]({'where':{'UserId':{'$in':_0x34fc5f},'VoicePrefixId':_0x2153a0[_0xe804('0x6f')]},'transaction':_0x240b34});})[_0xe804('0x43')](function(){return db[_0xe804('0x2f')][_0xe804('0x54')]({'where':{'id':_0x2c5a04},'cascade':!![],'transaction':_0x240b34});})['then'](function(_0x368f76){if(_0x368f76===0x0){_0x33c12d['sendStatus'](0x194);}else{return db['UserProfileResource'][_0xe804('0x54')]({'where':{'type':_0xe804('0x4d'),'resourceId':_0x2c5a04},'cascade':!![],'transaction':_0x240b34})['then'](function(){_0x33c12d['status'](0xcc)[_0xe804('0x20')]();});}})[_0xe804('0x45')](function(_0x1eaddd){_0x33c12d['status'](0x1f4)[_0xe804('0x70')](_0x1eaddd);});});};exports[_0xe804('0x71')]=function(_0x394f61,_0xe4256d,_0x3bccc7){return db['Team'][_0xe804('0x72')]({'where':{'id':_0x394f61[_0xe804('0x53')]['id']}})[_0xe804('0x43')](handleEntityNotFound(_0xe4256d,null))[_0xe804('0x43')](function(_0x8836a9){if(!_0x394f61[_0xe804('0x34')]['channel']||!utils[_0xe804('0x73')](_0x394f61['query']['channel'])){throw new db['Sequelize'][(_0xe804('0x74'))](_0xe804('0x75'));}var _0x273d43={};var _0x201453={};_0x201453[_0xe804('0x33')]=_[_0xe804('0x35')](db[_[_0xe804('0x76')](_0x394f61[_0xe804('0x34')][_0xe804('0x77')]['toLowerCase']())+_0xe804('0x78')][_0xe804('0x30')]);_0x201453[_0xe804('0x34')]=_[_0xe804('0x35')](_0x394f61['query']);_0x201453[_0xe804('0x36')]=_['intersection'](_0x201453['model'],_0x201453[_0xe804('0x34')]);_0x273d43[_0xe804('0x38')]=_[_0xe804('0x37')](_0x201453[_0xe804('0x33')],qs[_0xe804('0x46')](_0x394f61[_0xe804('0x34')][_0xe804('0x46')]));_0x273d43[_0xe804('0x38')]=_0x273d43[_0xe804('0x38')][_0xe804('0x39')]?_0x273d43[_0xe804('0x38')]:_0x201453[_0xe804('0x33')];_0x273d43[_0xe804('0x24')]=qs['limit'](_0x394f61[_0xe804('0x34')][_0xe804('0x24')]);_0x273d43['offset']=qs['offset'](_0x394f61['query'][_0xe804('0x22')]);_0x273d43[_0xe804('0x79')]=qs['sort'](_0x394f61['query'][_0xe804('0x7a')]);_0x273d43[_0xe804('0x3b')]=qs[_0xe804('0x36')](_['pick'](_0x394f61[_0xe804('0x34')],_0x201453[_0xe804('0x36')]));_0x273d43=_[_0xe804('0x3d')]({},_0x273d43,_0x394f61[_0xe804('0x40')]);return _0x8836a9[_0xe804('0x4c')+_[_0xe804('0x76')](_0x394f61[_0xe804('0x34')]['channel'][_0xe804('0x7b')]())+_0xe804('0x7c')](_0x273d43);})[_0xe804('0x43')](respondWithResult(_0xe4256d,null))[_0xe804('0x45')](handleError(_0xe4256d,null));};exports[_0xe804('0x7d')]=function(_0x56e30f,_0x5418b4,_0x58683e){return db['Team'][_0xe804('0x72')]({'where':{'id':_0x56e30f[_0xe804('0x53')]['id']}})[_0xe804('0x43')](function(_0x33122e){if(_0x33122e){if(!_0x56e30f[_0xe804('0x52')]['channel']||!utils['isValidChannel'](_0x56e30f[_0xe804('0x52')][_0xe804('0x77')])){throw new db[(_0xe804('0x5a'))][(_0xe804('0x74'))](_0xe804('0x75'));}return _0x33122e[_0xe804('0x7e')+_[_0xe804('0x76')](_0x56e30f[_0xe804('0x52')][_0xe804('0x77')]['toLowerCase']())+_0xe804('0x7c')](_0x56e30f[_0xe804('0x52')][_0xe804('0x7f')]);}return null;})[_0xe804('0x43')](handleEntityNotFound(_0x5418b4,null))['then'](respondWithStatusCode(_0x5418b4,null))[_0xe804('0x45')](handleError(_0x5418b4,null));};exports[_0xe804('0x80')]=function(_0x4b952a,_0x30727f,_0x2b1fc5){return db['Team']['findOne']({'where':{'id':_0x4b952a[_0xe804('0x53')]['id']}})[_0xe804('0x43')](function(_0x32e10e){if(_0x32e10e){if(!_0x4b952a[_0xe804('0x34')]['channel']||!utils[_0xe804('0x73')](_0x4b952a['query'][_0xe804('0x77')])){throw new db[(_0xe804('0x5a'))]['ValidationError'](_0xe804('0x75'));}return _0x32e10e[_0xe804('0x81')+_[_0xe804('0x76')](_0x4b952a[_0xe804('0x34')]['channel'][_0xe804('0x7b')]())+_0xe804('0x7c')](_0x4b952a['query'][_0xe804('0x7f')]);}return null;})[_0xe804('0x43')](handleEntityNotFound(_0x30727f,null))[_0xe804('0x43')](respondWithStatusCode(_0x30727f,null))['catch'](handleError(_0x30727f,null));};exports[_0xe804('0x82')]=function(_0x47b67c,_0x5ecc1c){var _0x1e32f5=_[_0xe804('0x83')](_0x47b67c[_0xe804('0x52')][_0xe804('0x7f')])?_0x47b67c[_0xe804('0x52')][_0xe804('0x7f')]:[_0x47b67c['body'][_0xe804('0x7f')]];var _0x1c8eec=_0x47b67c['params']['id'];return db['Team'][_0xe804('0x4f')]({'where':{'id':_0x1c8eec}})['then'](handleEntityNotFound(_0x5ecc1c,null))[_0xe804('0x43')](function(_0x3e333b){if(_0x3e333b){var _0x1b55e3=[_0xe804('0x84'),_0xe804('0x85'),'Mail',_0xe804('0x86'),'Fax',_0xe804('0x87'),_0xe804('0x88')];return db[_0xe804('0x56')][_0xe804('0x89')](function(_0x458244){var _0x13c504=_['map'](_0x1b55e3,function(_0x538570){var _0x57528b={'attributes':['id','name']};if(_0x538570===_0xe804('0x84')){_0x57528b[_0xe804('0x8a')]={'attributes':[_0xe804('0x8b')]};}return _0x3e333b['get'+_0x538570+'Queues'](_0x57528b)[_0xe804('0x43')](function(_0xc0dfc1){var _0x5e4287=_[_0xe804('0x2e')](_0xc0dfc1,function(_0x43f7bd){var _0x26b23d=_[_0xe804('0x2e')](_0x1e32f5,function(_0x2eee29){var _0x127f31={'where':{'UserId':_0x2eee29,[_0x538570+'QueueId']:_0x43f7bd['id']},'transaction':_0x458244};if(_0x538570===_0xe804('0x84')){_0x127f31[_0xe804('0x1b')]={'penalty':_0x43f7bd[_0xe804('0x8c')][_0xe804('0x8b')]};}return db[_0xe804('0x8d')+_0x538570+_0xe804('0x78')][_0xe804('0x8e')](_0x127f31)['then'](function(){socket[_0xe804('0x8f')]('user'+_0x538570+_0xe804('0x90'),{'UserId':_0x2eee29,[_0x538570+_0xe804('0x91')]:_0x43f7bd['id']});if(_0x538570!==_0xe804('0x84')){return;}return db[_0xe804('0x8d')][_0xe804('0x42')]({'where':{'id':_0x1e32f5,'online':0x1},'attributes':['id',_0xe804('0x2c'),_0xe804('0x92'),_0xe804('0x93'),'interface'],'raw':!![]})['then'](function(_0xf8c1e0){var _0x3b4457=_['map'](_0xf8c1e0,function(_0x1a2c4d){return db[_0xe804('0x94')][_0xe804('0x95')]({'membername':_0x1a2c4d[_0xe804('0x2c')],'UserId':_0x1a2c4d['id'],'queue_name':_0x43f7bd[_0xe804('0x2c')],'VoiceQueueId':_0x43f7bd['id'],'interface':_[_0xe804('0x96')](_0x1a2c4d[_0xe804('0x97')])?util[_0xe804('0x98')](_0xe804('0x99'),_0x1a2c4d[_0xe804('0x2c')]):_0x1a2c4d[_0xe804('0x97')],'paused':_0x1a2c4d[_0xe804('0x93')]||![],'penalty':_0x43f7bd[_0xe804('0x8c')][_0xe804('0x8b')]},{'transaction':_0x458244});});return Promise[_0xe804('0x9a')](_0x3b4457);});});});return Promise[_0xe804('0x9a')](_0x26b23d);});return Promise[_0xe804('0x9a')](_0x5e4287);})[_0xe804('0x43')](function(){return db[_0xe804('0x6d')][_0xe804('0x72')]({'where':{'teamId':_0x1c8eec}})[_0xe804('0x43')](function(_0x3961fc){if(_0x3961fc){var _0x4fc1e5=_[_0xe804('0x2e')](_0x1e32f5,function(_0x294759){db['UserVoicePrefix'][_0xe804('0x95')]({'UserId':_0x294759,'VoicePrefixId':_0x3961fc[_0xe804('0x6f')]});});return Promise[_0xe804('0x9a')](_0x4fc1e5);}});});});return Promise[_0xe804('0x9a')](_0x13c504)['then'](function(){return _0x3e333b['addAgents'](_0x1e32f5,{'transaction':_0x458244})[_0xe804('0x9b')](function(_0x17ffdc){return _0x17ffdc;});});});}})[_0xe804('0x43')](respondWithResult(_0x5ecc1c,null))['catch'](handleError(_0x5ecc1c,null));};exports['removeAgents']=function(_0x100951,_0x4314ae){var _0x808ee5=_[_0xe804('0x83')](_0x100951[_0xe804('0x34')]['ids'])?_0x100951['query'][_0xe804('0x7f')]:[_0x100951[_0xe804('0x34')]['ids']];var _0x18ce94=_0x100951['params']['id'];return db[_0xe804('0x2f')]['find']({'where':{'id':_0x18ce94}})[_0xe804('0x43')](handleEntityNotFound(_0x4314ae,null))[_0xe804('0x43')](function(_0x5778f3){if(_0x5778f3){var _0x48b4c0=['Voice',_0xe804('0x85'),'Mail',_0xe804('0x86'),_0xe804('0x9c'),_0xe804('0x87'),'Whatsapp'];return db[_0xe804('0x56')]['transaction'](function(_0x375f75){var _0x35388f=_[_0xe804('0x2e')](_0x48b4c0,function(_0x485dd4){var _0x2841c2={'attributes':['id',_0xe804('0x2c')]};return _0x5778f3[_0xe804('0x4c')+_0x485dd4+_0xe804('0x7c')](_0x2841c2)[_0xe804('0x43')](function(_0x36b1a8){var _0x5565ed=_[_0xe804('0x2e')](_0x36b1a8,function(_0x36f140){return _0x36f140[_0xe804('0x9d')](_0x808ee5,{'transaction':_0x375f75})[_0xe804('0x43')](function(){var _0x5afbe4=_[_0xe804('0x2e')](_0x808ee5,function(_0x118305){socket['emit'](_0xe804('0x49')+_0x485dd4+_0xe804('0x9e'),{'UserId':Number(_0x118305),[_0x485dd4+_0xe804('0x91')]:_0x36f140['id']});if(_0x485dd4!==_0xe804('0x84')){return;}return db[_0xe804('0x94')]['destroy']({'where':{'VoiceQueueId':_0x36f140['id'],'UserId':_0x118305},'transaction':_0x375f75});});return Promise['all'](_0x5afbe4);});});return Promise[_0xe804('0x9a')](_0x5565ed);});});return Promise[_0xe804('0x9a')](_0x35388f)[_0xe804('0x43')](function(){return _0x5778f3[_0xe804('0x9d')](_0x808ee5,{'transaction':_0x375f75});})[_0xe804('0x43')](function(){return db[_0xe804('0x6d')]['findOne']({'where':{'teamId':_0x18ce94}})['then'](function(_0xba3a6d){if(_0xba3a6d){var _0x410df6=_[_0xe804('0x2e')](_0x808ee5,function(_0x5d6a56){db[_0xe804('0x6e')][_0xe804('0x54')]({'where':{'UserId':_0x5d6a56,'VoicePrefixId':_0xba3a6d[_0xe804('0x6f')]}});});return Promise[_0xe804('0x9a')](_0x410df6);}});});});}})[_0xe804('0x43')](respondWithStatusCode(_0x4314ae,null))[_0xe804('0x45')](handleError(_0x4314ae,null));};exports[_0xe804('0x9f')]=function(_0x56e06f,_0x52da16,_0x44091a){var _0x541328={};var _0x229dba={};var _0x3545ca;var _0x3e4ead;return db['Team']['findOne']({'where':{'id':_0x56e06f['params']['id']}})[_0xe804('0x43')](handleEntityNotFound(_0x52da16,null))[_0xe804('0x43')](function(_0x162d5d){if(_0x162d5d){_0x3545ca=_0x162d5d;_0x229dba[_0xe804('0x33')]=_['keys'](db[_0xe804('0x8d')][_0xe804('0x30')]);_0x229dba['query']=_[_0xe804('0x35')](_0x56e06f['query']);_0x229dba[_0xe804('0x36')]=_[_0xe804('0x37')](_0x229dba['model'],_0x229dba['query']);_0x541328['attributes']=_['intersection'](_0x229dba[_0xe804('0x33')],qs[_0xe804('0x46')](_0x56e06f[_0xe804('0x34')][_0xe804('0x46')]));_0x541328[_0xe804('0x38')]=_0x541328[_0xe804('0x38')]['length']?_0x541328[_0xe804('0x38')]:_0x229dba[_0xe804('0x33')];_0x541328[_0xe804('0x79')]=qs[_0xe804('0x7a')](_0x56e06f[_0xe804('0x34')][_0xe804('0x7a')]);_0x541328['where']=qs['filters'](_[_0xe804('0x3c')](_0x56e06f['query'],_0x229dba['filters']));if(_0x56e06f[_0xe804('0x34')][_0xe804('0x3f')]){_0x541328[_0xe804('0x3b')]=_[_0xe804('0x3d')](_0x541328[_0xe804('0x3b')],{'$or':_[_0xe804('0x2e')](_0x541328['attributes'],function(_0x1180b3){var _0x77f567={};_0x77f567[_0x1180b3]={'$like':'%'+_0x56e06f[_0xe804('0x34')][_0xe804('0x3f')]+'%'};return _0x77f567;})});}_0x541328=_[_0xe804('0x3d')]({},_0x541328,_0x56e06f[_0xe804('0x40')]);return _0x3545ca[_0xe804('0x9f')](_0x541328);}})['then'](function(_0xe8c7f8){if(_0xe8c7f8){_0x3e4ead=_0xe8c7f8['length'];if(!_0x56e06f[_0xe804('0x34')][_0xe804('0xa0')](_0xe804('0x3a'))){_0x541328['limit']=qs['limit'](_0x56e06f['query']['limit']);_0x541328[_0xe804('0x22')]=qs['offset'](_0x56e06f[_0xe804('0x34')][_0xe804('0x22')]);}return _0x3545ca[_0xe804('0x9f')](_0x541328);}})['then'](function(_0x362132){if(_0x362132){return _0x362132?{'count':_0x3e4ead,'rows':_0x362132}:null;}})[_0xe804('0x43')](respondWithResult(_0x52da16,null))['catch'](handleError(_0x52da16,null));}; \ No newline at end of file +var _0x12f0=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','Team','then','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','VoicePrefixId','Teams','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','ids','removeQueues','isValidChannel','isArray','Voice','Chat','Mail','Fax','Openchannel','penalty','QueueId','TeamVoiceQueue','findOrCreate','User','online','UserVoiceQueueRt','upsert','isNil','interface','format','voicePause','all','TeamVoicePrefix','UserVoicePrefix','addAgents','removeAgents','Sms','emit','Queue:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util'];(function(_0x305a13,_0x33cfd9){var _0x288cbb=function(_0x32ec25){while(--_0x32ec25){_0x305a13['push'](_0x305a13['shift']());}};_0x288cbb(++_0x33cfd9);}(_0x12f0,0x1a8));var _0x012f=function(_0x73a0ff,_0x3a0d2a){_0x73a0ff=_0x73a0ff-0x0;var _0x1705aa=_0x12f0[_0x73a0ff];return _0x1705aa;};'use strict';var emlformat=require(_0x012f('0x0'));var rimraf=require(_0x012f('0x1'));var zipdir=require(_0x012f('0x2'));var jsonpatch=require(_0x012f('0x3'));var rp=require(_0x012f('0x4'));var moment=require(_0x012f('0x5'));var BPromise=require(_0x012f('0x6'));var Mustache=require(_0x012f('0x7'));var util=require('util');var path=require(_0x012f('0x8'));var sox=require(_0x012f('0x9'));var csv=require(_0x012f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x012f('0xb'));var _=require(_0x012f('0xc'));var squel=require(_0x012f('0xd'));var crypto=require('crypto');var jsforce=require(_0x012f('0xe'));var deskjs=require(_0x012f('0xf'));var toCsv=require(_0x012f('0xa'));var querystring=require(_0x012f('0x10'));var Papa=require('papaparse');var Redis=require(_0x012f('0x11'));var authService=require(_0x012f('0x12'));var qs=require(_0x012f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x012f('0x14'));var logger=require(_0x012f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x012f('0x16'));var db=require(_0x012f('0x17'))['db'];config['redis']=_[_0x012f('0x18')](config[_0x012f('0x19')],{'host':_0x012f('0x1a'),'port':0x18eb});var socket=require(_0x012f('0x1b'))(new Redis(config[_0x012f('0x19')]));require(_0x012f('0x1c'))[_0x012f('0x1d')](socket);function respondWithStatusCode(_0x37d1f2,_0x219315){_0x219315=_0x219315||0xcc;return function(_0x59c9c4){if(_0x59c9c4){return _0x37d1f2[_0x012f('0x1e')](_0x219315);}return _0x37d1f2[_0x012f('0x1f')](_0x219315)[_0x012f('0x20')]();};}function respondWithResult(_0x4f3ad5,_0x5ebc70){_0x5ebc70=_0x5ebc70||0xc8;return function(_0x25f8e5){if(_0x25f8e5){return _0x4f3ad5[_0x012f('0x1f')](_0x5ebc70)[_0x012f('0x21')](_0x25f8e5);}};}function respondWithFilteredResult(_0x57700b,_0x3167d0){return function(_0x5eebde){if(_0x5eebde){var _0x2e40f0=typeof _0x3167d0[_0x012f('0x22')]===_0x012f('0x23')&&typeof _0x3167d0[_0x012f('0x24')]===_0x012f('0x23');var _0x98914e=_0x5eebde['count'];var _0x281aaa=_0x2e40f0?0x0:_0x3167d0[_0x012f('0x22')];var _0x5075c1=_0x2e40f0?_0x5eebde[_0x012f('0x25')]:_0x3167d0[_0x012f('0x22')]+_0x3167d0[_0x012f('0x24')];var _0x19268b;if(_0x5075c1>=_0x98914e){_0x5075c1=_0x98914e;_0x19268b=0xc8;}else{_0x19268b=0xce;}_0x57700b[_0x012f('0x1f')](_0x19268b);return _0x57700b['set'](_0x012f('0x26'),_0x281aaa+'-'+_0x5075c1+'/'+_0x98914e)[_0x012f('0x21')](_0x5eebde);}return null;};}function patchUpdates(_0x455ecc){return function(_0x186f10){try{jsonpatch[_0x012f('0x27')](_0x186f10,_0x455ecc,!![]);}catch(_0x15ad4f){return BPromise['reject'](_0x15ad4f);}return _0x186f10[_0x012f('0x28')]();};}function saveUpdates(_0x5d9cc0,_0x6f2ad7){return function(_0x557948){if(_0x557948){return _0x557948[_0x012f('0x29')](_0x5d9cc0)['then'](function(_0x5eec54){return _0x5eec54;});}return null;};}function handleEntityNotFound(_0x42505d,_0x1de555){return function(_0x22d139){if(!_0x22d139){_0x42505d[_0x012f('0x1e')](0x194);}return _0x22d139;};}function handleError(_0x3f8a13,_0xede548){_0xede548=_0xede548||0x1f4;return function(_0x21e271){logger[_0x012f('0x2a')](_0x21e271[_0x012f('0x2b')]);if(_0x21e271[_0x012f('0x2c')]){delete _0x21e271[_0x012f('0x2c')];}_0x3f8a13[_0x012f('0x1f')](_0xede548)[_0x012f('0x2d')](_0x21e271);};}exports[_0x012f('0x2e')]=function(_0x4854f0,_0x15b313){var _0xaeb8c3={},_0x5a508e={},_0x33f2ff={'count':0x0,'rows':[]};var _0x13c451=_[_0x012f('0x2f')](db['Team'][_0x012f('0x30')],function(_0x5d8392){return{'name':_0x5d8392[_0x012f('0x31')],'type':_0x5d8392['type']['key']};});_0x5a508e[_0x012f('0x32')]=_[_0x012f('0x2f')](_0x13c451,_0x012f('0x2c'));_0x5a508e[_0x012f('0x33')]=_[_0x012f('0x34')](_0x4854f0[_0x012f('0x33')]);_0x5a508e[_0x012f('0x35')]=_['intersection'](_0x5a508e[_0x012f('0x32')],_0x5a508e['query']);_0xaeb8c3[_0x012f('0x36')]=_['intersection'](_0x5a508e[_0x012f('0x32')],qs[_0x012f('0x37')](_0x4854f0[_0x012f('0x33')]['fields']));_0xaeb8c3[_0x012f('0x36')]=_0xaeb8c3[_0x012f('0x36')][_0x012f('0x38')]?_0xaeb8c3[_0x012f('0x36')]:_0x5a508e['model'];if(!_0x4854f0[_0x012f('0x33')][_0x012f('0x39')]('nolimit')){_0xaeb8c3['limit']=qs[_0x012f('0x24')](_0x4854f0['query'][_0x012f('0x24')]);_0xaeb8c3['offset']=qs[_0x012f('0x22')](_0x4854f0[_0x012f('0x33')][_0x012f('0x22')]);}_0xaeb8c3[_0x012f('0x3a')]=qs['sort'](_0x4854f0[_0x012f('0x33')][_0x012f('0x3b')]);_0xaeb8c3[_0x012f('0x3c')]=qs['filters'](_['pick'](_0x4854f0[_0x012f('0x33')],_0x5a508e[_0x012f('0x35')]),_0x13c451);if(_0x4854f0[_0x012f('0x33')][_0x012f('0x3d')]){_0xaeb8c3[_0x012f('0x3c')]=_[_0x012f('0x3e')](_0xaeb8c3[_0x012f('0x3c')],{'$or':_[_0x012f('0x2f')](_0x13c451,function(_0x84c7d9){if(_0x84c7d9[_0x012f('0x3f')]!==_0x012f('0x40')){var _0x11cf4b={};_0x11cf4b[_0x84c7d9['name']]={'$like':'%'+_0x4854f0[_0x012f('0x33')][_0x012f('0x3d')]+'%'};return _0x11cf4b;}})});}_0xaeb8c3=_['merge']({},_0xaeb8c3,_0x4854f0[_0x012f('0x41')]);var _0x4574f4={'where':_0xaeb8c3[_0x012f('0x3c')]};return db[_0x012f('0x42')]['count'](_0x4574f4)[_0x012f('0x43')](function(_0x2ce565){_0x33f2ff['count']=_0x2ce565;if(_0x4854f0['query'][_0x012f('0x44')]){_0xaeb8c3[_0x012f('0x45')]=[{'all':!![]}];}return db[_0x012f('0x42')][_0x012f('0x46')](_0xaeb8c3);})[_0x012f('0x43')](function(_0x1292de){_0x33f2ff[_0x012f('0x47')]=_0x1292de;return _0x33f2ff;})[_0x012f('0x43')](respondWithFilteredResult(_0x15b313,_0xaeb8c3))[_0x012f('0x48')](handleError(_0x15b313,null));};exports['show']=function(_0x1698eb,_0x43d6af){var _0x2e17b1={'raw':![],'where':{'id':_0x1698eb[_0x012f('0x49')]['id']}},_0x536271={};_0x536271[_0x012f('0x32')]=_[_0x012f('0x34')](db[_0x012f('0x42')][_0x012f('0x30')]);_0x536271['query']=_[_0x012f('0x34')](_0x1698eb[_0x012f('0x33')]);_0x536271['filters']=_[_0x012f('0x4a')](_0x536271[_0x012f('0x32')],_0x536271[_0x012f('0x33')]);_0x2e17b1[_0x012f('0x36')]=_[_0x012f('0x4a')](_0x536271[_0x012f('0x32')],qs['fields'](_0x1698eb[_0x012f('0x33')][_0x012f('0x37')]));_0x2e17b1[_0x012f('0x36')]=_0x2e17b1['attributes'][_0x012f('0x38')]?_0x2e17b1[_0x012f('0x36')]:_0x536271[_0x012f('0x32')];if(_0x1698eb[_0x012f('0x33')][_0x012f('0x44')]){_0x2e17b1[_0x012f('0x45')]=[{'all':!![]}];}_0x2e17b1=_['merge']({},_0x2e17b1,_0x1698eb[_0x012f('0x41')]);return db[_0x012f('0x42')][_0x012f('0x4b')](_0x2e17b1)[_0x012f('0x43')](handleEntityNotFound(_0x43d6af,null))[_0x012f('0x43')](respondWithResult(_0x43d6af,null))[_0x012f('0x48')](handleError(_0x43d6af,null));};exports[_0x012f('0x4c')]=function(_0x135449,_0x36939b){return db['Team'][_0x012f('0x4c')](_0x135449[_0x012f('0x4d')],{})['then'](function(_0x38d574){var _0x4f8bef=_0x135449[_0x012f('0x4e')][_0x012f('0x4f')]({'plain':!![]});if(!_0x4f8bef)throw new Error(_0x012f('0x50'));if(_0x4f8bef[_0x012f('0x51')]==='user'){var _0x788cd=_0x38d574[_0x012f('0x4f')]({'plain':!![]});var _0x37909b='Teams';return db['UserProfileSection']['find']({'where':{'name':_0x37909b,'userProfileId':_0x4f8bef[_0x012f('0x52')]},'raw':!![]})['then'](function(_0x533dd5){if(_0x533dd5&&_0x533dd5[_0x012f('0x53')]===0x0){return db[_0x012f('0x54')][_0x012f('0x4c')]({'name':_0x788cd['name'],'resourceId':_0x788cd['id'],'type':_0x533dd5['name'],'sectionId':_0x533dd5['id']},{})['then'](function(){return _0x38d574;});}else{return _0x38d574;}})[_0x012f('0x48')](function(_0x4aac9d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4aac9d);throw _0x4aac9d;});}return _0x38d574;})['then'](respondWithResult(_0x36939b,0xc9))[_0x012f('0x48')](handleError(_0x36939b,null));};exports['update']=function(_0x4626e8,_0x304621){if(_0x4626e8['body']['id']){delete _0x4626e8[_0x012f('0x4d')]['id'];}return db[_0x012f('0x42')][_0x012f('0x4b')]({'where':{'id':_0x4626e8[_0x012f('0x49')]['id']}})[_0x012f('0x43')](handleEntityNotFound(_0x304621,null))[_0x012f('0x43')](saveUpdates(_0x4626e8[_0x012f('0x4d')],null))[_0x012f('0x43')](respondWithResult(_0x304621,null))['catch'](handleError(_0x304621,null));};exports[_0x012f('0x55')]=function(_0x437d75,_0x377fe0){var _0x5927d6=_0x437d75[_0x012f('0x49')]['id'];var _0x389dbb=[];return db[_0x012f('0x56')][_0x012f('0x57')](function(_0x4992d9){var _0x2d9a4c=_0x012f('0x58')+_0x5927d6;return db[_0x012f('0x56')][_0x012f('0x33')](_0x2d9a4c,{'type':db['Sequelize'][_0x012f('0x59')][_0x012f('0x5a')],'raw':!![],'transaction':_0x4992d9})[_0x012f('0x43')](function(_0x1edccc){_0x389dbb=_[_0x012f('0x2f')](_0x1edccc,function(_0x2ace0e){return Number(_0x2ace0e['UserId']);});})[_0x012f('0x43')](function(){var _0xa140e1=_0x012f('0x5b')+_0x5927d6;return db[_0x012f('0x56')]['query'](_0xa140e1,{'type':db[_0x012f('0x5c')]['QueryTypes'][_0x012f('0x5a')],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x30a6f6){var _0x464902=_[_0x012f('0x2f')](_0x30a6f6,function(_0x1624b4){return Number(_0x1624b4[_0x012f('0x5d')]);});return db[_0x012f('0x5e')][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'VoiceQueueId':{'$in':_0x464902}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x2a9cf2='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5927d6;return db['sequelize'][_0x012f('0x33')](_0x2a9cf2,{'type':db[_0x012f('0x5c')][_0x012f('0x59')]['SELECT'],'raw':!![],'transaction':_0x4992d9});})['then'](function(_0x4fcc5d){var _0x4fa387=_[_0x012f('0x2f')](_0x4fcc5d,function(_0x2da23d){return Number(_0x2da23d[_0x012f('0x5f')]);});return db[_0x012f('0x60')][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'MailQueueId':{'$in':_0x4fa387}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x52e873=_0x012f('0x61')+_0x5927d6;return db[_0x012f('0x56')][_0x012f('0x33')](_0x52e873,{'type':db[_0x012f('0x5c')][_0x012f('0x59')][_0x012f('0x5a')],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x59c688){var _0x39c94e=_[_0x012f('0x2f')](_0x59c688,function(_0x36bba6){return Number(_0x36bba6[_0x012f('0x62')]);});return db['UserSmsQueue'][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'SmsQueueId':{'$in':_0x39c94e}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x491f75='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5927d6;return db[_0x012f('0x56')][_0x012f('0x33')](_0x491f75,{'type':db[_0x012f('0x5c')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x13e6a4){var _0x5b4652=_[_0x012f('0x2f')](_0x13e6a4,function(_0xb68598){return Number(_0xb68598[_0x012f('0x63')]);});return db[_0x012f('0x64')][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'ChatQueueId':{'$in':_0x5b4652}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x11ce42=_0x012f('0x65')+_0x5927d6;return db[_0x012f('0x56')]['query'](_0x11ce42,{'type':db[_0x012f('0x5c')][_0x012f('0x59')]['SELECT'],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x4a3d2){var _0x2c3847=_[_0x012f('0x2f')](_0x4a3d2,function(_0x28e437){return Number(_0x28e437[_0x012f('0x66')]);});return db[_0x012f('0x67')][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'FaxQueueId':{'$in':_0x2c3847}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x3cb303='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5927d6;return db[_0x012f('0x56')][_0x012f('0x33')](_0x3cb303,{'type':db[_0x012f('0x5c')]['QueryTypes'][_0x012f('0x5a')],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x54f24e){var _0x1f05e5=_[_0x012f('0x2f')](_0x54f24e,function(_0x1fd11f){return Number(_0x1fd11f['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'OpenchannelQueueId':{'$in':_0x1f05e5}},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){var _0x5cf2b9=_0x012f('0x68')+_0x5927d6;return db[_0x012f('0x56')][_0x012f('0x33')](_0x5cf2b9,{'type':db[_0x012f('0x5c')][_0x012f('0x59')][_0x012f('0x5a')],'raw':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x5bddfb){var _0xf456e7=_[_0x012f('0x2f')](_0x5bddfb,function(_0x33a6e9){return Number(_0x33a6e9['WhatsappQueueId']);});return db[_0x012f('0x69')][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'WhatsappQueueId':{'$in':_0xf456e7}},'transaction':_0x4992d9});})['then'](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x5927d6}});})['then'](function(_0x5df204){if(_0x5df204===null){return;}return db['UserVoicePrefix'][_0x012f('0x55')]({'where':{'UserId':{'$in':_0x389dbb},'VoicePrefixId':_0x5df204[_0x012f('0x6a')]},'transaction':_0x4992d9});})[_0x012f('0x43')](function(){return db[_0x012f('0x42')][_0x012f('0x55')]({'where':{'id':_0x5927d6},'cascade':!![],'transaction':_0x4992d9});})[_0x012f('0x43')](function(_0x2b4760){if(_0x2b4760===0x0){_0x377fe0[_0x012f('0x1e')](0x194);}else{return db[_0x012f('0x54')]['destroy']({'where':{'type':_0x012f('0x6b'),'resourceId':_0x5927d6},'cascade':!![],'transaction':_0x4992d9})[_0x012f('0x43')](function(){_0x377fe0['status'](0xcc)['end']();});}})[_0x012f('0x48')](function(_0x29e9fa){_0x377fe0[_0x012f('0x1f')](0x1f4)[_0x012f('0x2d')](_0x29e9fa);});});};exports['getQueues']=function(_0x5997f0,_0x43b367,_0x48e788){return db[_0x012f('0x42')][_0x012f('0x6c')]({'where':{'id':_0x5997f0[_0x012f('0x49')]['id']}})[_0x012f('0x43')](handleEntityNotFound(_0x43b367,null))[_0x012f('0x43')](function(_0x3aeaf4){if(!_0x5997f0['query'][_0x012f('0x6d')]||!utils['isValidChannel'](_0x5997f0[_0x012f('0x33')][_0x012f('0x6d')])){throw new db['Sequelize'][(_0x012f('0x6e'))](_0x012f('0x6f'));}var _0x4b4175={};var _0x1b506f={};_0x1b506f[_0x012f('0x32')]=_[_0x012f('0x34')](db[_[_0x012f('0x70')](_0x5997f0[_0x012f('0x33')]['channel'][_0x012f('0x71')]())+_0x012f('0x72')]['rawAttributes']);_0x1b506f[_0x012f('0x33')]=_[_0x012f('0x34')](_0x5997f0['query']);_0x1b506f[_0x012f('0x35')]=_[_0x012f('0x4a')](_0x1b506f[_0x012f('0x32')],_0x1b506f[_0x012f('0x33')]);_0x4b4175[_0x012f('0x36')]=_['intersection'](_0x1b506f[_0x012f('0x32')],qs[_0x012f('0x37')](_0x5997f0[_0x012f('0x33')][_0x012f('0x37')]));_0x4b4175[_0x012f('0x36')]=_0x4b4175[_0x012f('0x36')][_0x012f('0x38')]?_0x4b4175[_0x012f('0x36')]:_0x1b506f[_0x012f('0x32')];_0x4b4175[_0x012f('0x24')]=qs[_0x012f('0x24')](_0x5997f0[_0x012f('0x33')][_0x012f('0x24')]);_0x4b4175[_0x012f('0x22')]=qs[_0x012f('0x22')](_0x5997f0[_0x012f('0x33')][_0x012f('0x22')]);_0x4b4175['order']=qs[_0x012f('0x3b')](_0x5997f0[_0x012f('0x33')][_0x012f('0x3b')]);_0x4b4175['where']=qs[_0x012f('0x35')](_[_0x012f('0x73')](_0x5997f0[_0x012f('0x33')],_0x1b506f['filters']));_0x4b4175=_['merge']({},_0x4b4175,_0x5997f0[_0x012f('0x41')]);return _0x3aeaf4[_0x012f('0x4f')+_[_0x012f('0x70')](_0x5997f0[_0x012f('0x33')][_0x012f('0x6d')][_0x012f('0x71')]())+_0x012f('0x74')](_0x4b4175);})['then'](respondWithResult(_0x43b367,null))['catch'](handleError(_0x43b367,null));};exports[_0x012f('0x75')]=function(_0x27c3e9,_0x2d8791,_0x2f4dc5){return db['Team']['findOne']({'where':{'id':_0x27c3e9[_0x012f('0x49')]['id']}})['then'](function(_0x1300f5){if(_0x1300f5){if(!_0x27c3e9[_0x012f('0x4d')]['channel']||!utils['isValidChannel'](_0x27c3e9[_0x012f('0x4d')]['channel'])){throw new db[(_0x012f('0x5c'))][(_0x012f('0x6e'))](_0x012f('0x6f'));}return _0x1300f5['add'+_[_0x012f('0x70')](_0x27c3e9['body'][_0x012f('0x6d')][_0x012f('0x71')]())+_0x012f('0x74')](_0x27c3e9[_0x012f('0x4d')][_0x012f('0x76')]);}return null;})[_0x012f('0x43')](handleEntityNotFound(_0x2d8791,null))[_0x012f('0x43')](respondWithStatusCode(_0x2d8791,null))['catch'](handleError(_0x2d8791,null));};exports[_0x012f('0x77')]=function(_0x358dcc,_0xd07da9,_0xe91ade){return db[_0x012f('0x42')][_0x012f('0x6c')]({'where':{'id':_0x358dcc[_0x012f('0x49')]['id']}})[_0x012f('0x43')](function(_0x1a9d56){if(_0x1a9d56){if(!_0x358dcc[_0x012f('0x33')][_0x012f('0x6d')]||!utils[_0x012f('0x78')](_0x358dcc[_0x012f('0x33')][_0x012f('0x6d')])){throw new db['Sequelize'][(_0x012f('0x6e'))](_0x012f('0x6f'));}return _0x1a9d56['remove'+_[_0x012f('0x70')](_0x358dcc[_0x012f('0x33')][_0x012f('0x6d')]['toLowerCase']())+'Queues'](_0x358dcc[_0x012f('0x33')][_0x012f('0x76')]);}return null;})[_0x012f('0x43')](handleEntityNotFound(_0xd07da9,null))['then'](respondWithStatusCode(_0xd07da9,null))[_0x012f('0x48')](handleError(_0xd07da9,null));};exports['addAgents']=function(_0x5cc79c,_0x251a3c){var _0xb09b3a=_[_0x012f('0x79')](_0x5cc79c[_0x012f('0x4d')]['ids'])?_0x5cc79c[_0x012f('0x4d')][_0x012f('0x76')]:[_0x5cc79c[_0x012f('0x4d')][_0x012f('0x76')]];var _0x408a70=_0x5cc79c[_0x012f('0x49')]['id'];return db['Team']['find']({'where':{'id':_0x408a70}})[_0x012f('0x43')](handleEntityNotFound(_0x251a3c,null))['then'](function(_0x2d52e1){if(_0x2d52e1){var _0x5784e8=[_0x012f('0x7a'),_0x012f('0x7b'),_0x012f('0x7c'),'Sms',_0x012f('0x7d'),_0x012f('0x7e'),'Whatsapp'];return db[_0x012f('0x56')][_0x012f('0x57')](function(_0x4da165){var _0x439321=_[_0x012f('0x2f')](_0x5784e8,function(_0x24fc9e){var _0x1bbbee={'attributes':['id',_0x012f('0x2c')]};if(_0x24fc9e===_0x012f('0x7a')){_0x1bbbee['through']={'attributes':[_0x012f('0x7f')]};}return _0x2d52e1['get'+_0x24fc9e+_0x012f('0x74')](_0x1bbbee)[_0x012f('0x43')](function(_0x50e296){var _0x21df57=_[_0x012f('0x2f')](_0x50e296,function(_0x1141fd){var _0x3b19b5=_[_0x012f('0x2f')](_0xb09b3a,function(_0x1f5dbf){var _0x2d0f64={'where':{'UserId':_0x1f5dbf,[_0x24fc9e+_0x012f('0x80')]:_0x1141fd['id']},'transaction':_0x4da165};if(_0x24fc9e===_0x012f('0x7a')){_0x2d0f64[_0x012f('0x18')]={'penalty':_0x1141fd[_0x012f('0x81')][_0x012f('0x7f')]};}return db['User'+_0x24fc9e+'Queue'][_0x012f('0x82')](_0x2d0f64)[_0x012f('0x43')](function(){socket['emit'](_0x012f('0x4e')+_0x24fc9e+'Queue:save',{'UserId':_0x1f5dbf,[_0x24fc9e+_0x012f('0x80')]:_0x1141fd['id']});if(_0x24fc9e!=='Voice'){return;}return db[_0x012f('0x83')][_0x012f('0x46')]({'where':{'id':_0xb09b3a,'online':0x1},'attributes':['id',_0x012f('0x2c'),_0x012f('0x84'),'voicePause','interface'],'raw':!![]})[_0x012f('0x43')](function(_0x43d75b){var _0x295891=_['map'](_0x43d75b,function(_0x555de4){return db[_0x012f('0x85')][_0x012f('0x86')]({'membername':_0x555de4[_0x012f('0x2c')],'UserId':_0x555de4['id'],'queue_name':_0x1141fd[_0x012f('0x2c')],'VoiceQueueId':_0x1141fd['id'],'interface':_[_0x012f('0x87')](_0x555de4[_0x012f('0x88')])?util[_0x012f('0x89')]('SIP/%s',_0x555de4[_0x012f('0x2c')]):_0x555de4[_0x012f('0x88')],'paused':_0x555de4[_0x012f('0x8a')]||![],'penalty':_0x1141fd[_0x012f('0x81')][_0x012f('0x7f')]},{'transaction':_0x4da165});});return Promise[_0x012f('0x8b')](_0x295891);});});});return Promise[_0x012f('0x8b')](_0x3b19b5);});return Promise[_0x012f('0x8b')](_0x21df57);})[_0x012f('0x43')](function(){return db[_0x012f('0x8c')][_0x012f('0x6c')]({'where':{'teamId':_0x408a70}})[_0x012f('0x43')](function(_0x505b24){if(_0x505b24){var _0x5a0663=_[_0x012f('0x2f')](_0xb09b3a,function(_0x3a21eb){db[_0x012f('0x8d')][_0x012f('0x86')]({'UserId':_0x3a21eb,'VoicePrefixId':_0x505b24['VoicePrefixId']});});return Promise[_0x012f('0x8b')](_0x5a0663);}});});});return Promise[_0x012f('0x8b')](_0x439321)[_0x012f('0x43')](function(){return _0x2d52e1[_0x012f('0x8e')](_0xb09b3a,{'transaction':_0x4da165})['spread'](function(_0x3e0a4b){return _0x3e0a4b;});});});}})[_0x012f('0x43')](respondWithResult(_0x251a3c,null))[_0x012f('0x48')](handleError(_0x251a3c,null));};exports[_0x012f('0x8f')]=function(_0x236bcb,_0x362457){var _0x5398a3=_[_0x012f('0x79')](_0x236bcb[_0x012f('0x33')][_0x012f('0x76')])?_0x236bcb[_0x012f('0x33')][_0x012f('0x76')]:[_0x236bcb[_0x012f('0x33')][_0x012f('0x76')]];var _0x4ae06d=_0x236bcb['params']['id'];return db[_0x012f('0x42')][_0x012f('0x4b')]({'where':{'id':_0x4ae06d}})[_0x012f('0x43')](handleEntityNotFound(_0x362457,null))[_0x012f('0x43')](function(_0x26d37d){if(_0x26d37d){var _0x2f1de=[_0x012f('0x7a'),_0x012f('0x7b'),_0x012f('0x7c'),_0x012f('0x90'),_0x012f('0x7d'),_0x012f('0x7e'),'Whatsapp'];return db[_0x012f('0x56')]['transaction'](function(_0x1df167){var _0x4435c0=_['map'](_0x2f1de,function(_0x25f4f1){var _0x425fa5={'attributes':['id',_0x012f('0x2c')]};return _0x26d37d[_0x012f('0x4f')+_0x25f4f1+_0x012f('0x74')](_0x425fa5)[_0x012f('0x43')](function(_0x894033){var _0x2ec417=_[_0x012f('0x2f')](_0x894033,function(_0x2ce209){return _0x2ce209[_0x012f('0x8f')](_0x5398a3,{'transaction':_0x1df167})[_0x012f('0x43')](function(){var _0x245e8f=_[_0x012f('0x2f')](_0x5398a3,function(_0xb99d0b){socket[_0x012f('0x91')]('user'+_0x25f4f1+_0x012f('0x92'),{'UserId':Number(_0xb99d0b),[_0x25f4f1+_0x012f('0x80')]:_0x2ce209['id']});if(_0x25f4f1!=='Voice'){return;}return db[_0x012f('0x85')][_0x012f('0x55')]({'where':{'VoiceQueueId':_0x2ce209['id'],'UserId':_0xb99d0b},'transaction':_0x1df167});});return Promise['all'](_0x245e8f);});});return Promise[_0x012f('0x8b')](_0x2ec417);});});return Promise[_0x012f('0x8b')](_0x4435c0)['then'](function(){return _0x26d37d[_0x012f('0x8f')](_0x5398a3,{'transaction':_0x1df167});})['then'](function(){return db[_0x012f('0x8c')][_0x012f('0x6c')]({'where':{'teamId':_0x4ae06d}})[_0x012f('0x43')](function(_0xa7860c){if(_0xa7860c){var _0x255832=_['map'](_0x5398a3,function(_0x436708){db['UserVoicePrefix'][_0x012f('0x55')]({'where':{'UserId':_0x436708,'VoicePrefixId':_0xa7860c['VoicePrefixId']}});});return Promise[_0x012f('0x8b')](_0x255832);}});});});}})['then'](respondWithStatusCode(_0x362457,null))['catch'](handleError(_0x362457,null));};exports[_0x012f('0x93')]=function(_0x4511b7,_0x4489cb,_0x3f8c98){var _0xb4d592={};var _0x2833dd={};var _0x21ff0d;var _0x2c8bf;return db[_0x012f('0x42')][_0x012f('0x6c')]({'where':{'id':_0x4511b7[_0x012f('0x49')]['id']}})[_0x012f('0x43')](handleEntityNotFound(_0x4489cb,null))[_0x012f('0x43')](function(_0x4cbd5e){if(_0x4cbd5e){_0x21ff0d=_0x4cbd5e;_0x2833dd[_0x012f('0x32')]=_[_0x012f('0x34')](db[_0x012f('0x83')][_0x012f('0x30')]);_0x2833dd['query']=_['keys'](_0x4511b7[_0x012f('0x33')]);_0x2833dd[_0x012f('0x35')]=_[_0x012f('0x4a')](_0x2833dd[_0x012f('0x32')],_0x2833dd[_0x012f('0x33')]);_0xb4d592[_0x012f('0x36')]=_['intersection'](_0x2833dd[_0x012f('0x32')],qs[_0x012f('0x37')](_0x4511b7['query']['fields']));_0xb4d592['attributes']=_0xb4d592[_0x012f('0x36')][_0x012f('0x38')]?_0xb4d592[_0x012f('0x36')]:_0x2833dd['model'];_0xb4d592['order']=qs[_0x012f('0x3b')](_0x4511b7[_0x012f('0x33')][_0x012f('0x3b')]);_0xb4d592['where']=qs[_0x012f('0x35')](_[_0x012f('0x73')](_0x4511b7[_0x012f('0x33')],_0x2833dd[_0x012f('0x35')]));if(_0x4511b7[_0x012f('0x33')][_0x012f('0x3d')]){_0xb4d592['where']=_[_0x012f('0x3e')](_0xb4d592[_0x012f('0x3c')],{'$or':_[_0x012f('0x2f')](_0xb4d592[_0x012f('0x36')],function(_0x591aa5){var _0x5c626c={};_0x5c626c[_0x591aa5]={'$like':'%'+_0x4511b7[_0x012f('0x33')][_0x012f('0x3d')]+'%'};return _0x5c626c;})});}_0xb4d592=_[_0x012f('0x3e')]({},_0xb4d592,_0x4511b7[_0x012f('0x41')]);return _0x21ff0d[_0x012f('0x93')](_0xb4d592);}})[_0x012f('0x43')](function(_0x4417f3){if(_0x4417f3){_0x2c8bf=_0x4417f3['length'];if(!_0x4511b7[_0x012f('0x33')][_0x012f('0x39')](_0x012f('0x94'))){_0xb4d592[_0x012f('0x24')]=qs[_0x012f('0x24')](_0x4511b7[_0x012f('0x33')][_0x012f('0x24')]);_0xb4d592[_0x012f('0x22')]=qs[_0x012f('0x22')](_0x4511b7[_0x012f('0x33')][_0x012f('0x22')]);}return _0x21ff0d['getAgents'](_0xb4d592);}})[_0x012f('0x43')](function(_0x578f43){if(_0x578f43){return _0x578f43?{'count':_0x2c8bf,'rows':_0x578f43}:null;}})[_0x012f('0x43')](respondWithResult(_0x4489cb,null))[_0x012f('0x48')](handleError(_0x4489cb,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 33257b8..606aa37 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 _0x5865=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook'];(function(_0x570b1a,_0x488ee5){var _0x744f42=function(_0x4ad135){while(--_0x4ad135){_0x570b1a['push'](_0x570b1a['shift']());}};_0x744f42(++_0x488ee5);}(_0x5865,0x79));var _0x5586=function(_0x218f8c,_0x2dee1e){_0x218f8c=_0x218f8c-0x0;var _0x2b37e4=_0x5865[_0x218f8c];return _0x2b37e4;};'use strict';var EventEmitter=require(_0x5586('0x0'));var Team=require(_0x5586('0x1'))['db'][_0x5586('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5586('0x3')](0x0);var events={'afterCreate':_0x5586('0x4'),'afterUpdate':_0x5586('0x5'),'afterDestroy':_0x5586('0x6')};function emitEvent(_0xdc95d1){return function(_0x16c506,_0x4e0dc0,_0x8a7044){TeamEvents[_0x5586('0x7')](_0xdc95d1+':'+_0x16c506['id'],_0x16c506);TeamEvents[_0x5586('0x7')](_0xdc95d1,_0x16c506);_0x8a7044(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x5586('0x8')](e,emitEvent(event));}}module[_0x5586('0x9')]=TeamEvents; \ No newline at end of file +var _0xfec8=['emit','hasOwnProperty','hook','exports','events','save','remove'];(function(_0x5d3267,_0xe106a8){var _0x57dba1=function(_0x22d379){while(--_0x22d379){_0x5d3267['push'](_0x5d3267['shift']());}};_0x57dba1(++_0xe106a8);}(_0xfec8,0x19a));var _0x8fec=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0xfec8[_0xd7b0a4];return _0x184e9e;};'use strict';var EventEmitter=require(_0x8fec('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8fec('0x1'),'afterUpdate':'update','afterDestroy':_0x8fec('0x2')};function emitEvent(_0x4ef389){return function(_0x2db9c8,_0x3178b2,_0x4db8ab){TeamEvents[_0x8fec('0x3')](_0x4ef389+':'+_0x2db9c8['id'],_0x2db9c8);TeamEvents[_0x8fec('0x3')](_0x4ef389,_0x2db9c8);_0x4db8ab(null);};}for(var e in events){if(events[_0x8fec('0x4')](e)){var event=events[e];Team[_0x8fec('0x5')](e,emitEvent(event));}}module[_0x8fec('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 915f85e..2789de1 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 _0x3e9f=['catch','exports','define','teams','Chat','Fax','Mail','Openchannel','Whatsapp','resolve','then','all','lodash','get','Queues','map'];(function(_0x5eb701,_0x123e75){var _0x1fc6cb=function(_0x1c1920){while(--_0x1c1920){_0x5eb701['push'](_0x5eb701['shift']());}};_0x1fc6cb(++_0x123e75);}(_0x3e9f,0x9c));var _0xf3e9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3e9f[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xf3e9('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0xab6a3,_0x3edcf9){var _0x30bf35=_0xf3e9('0x1')+_0x3edcf9+_0xf3e9('0x2');return _0xab6a3[_0x30bf35]()['then'](function(_0x4a5696){return _[_0xf3e9('0x3')](_0x4a5696,function(_0x40e9a5){_0x40e9a5['setDataValue']('channel',_0x3edcf9);return _0x40e9a5;});})[_0xf3e9('0x4')](function(_0x59bb31){throw _0x59bb31;});}module[_0xf3e9('0x5')]=function(_0x4554bc){return _0x4554bc[_0xf3e9('0x6')]('Team',attributes,{'tableName':_0xf3e9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x386af1=this;var _0x3ad17b=[_0xf3e9('0x8'),_0xf3e9('0x9'),_0xf3e9('0xa'),_0xf3e9('0xb'),'Sms','Voice',_0xf3e9('0xc')];return Promise[_0xf3e9('0xd')]()[_0xf3e9('0xe')](function(){var _0xdbe2f7=_[_0xf3e9('0x3')](_0x3ad17b,function(_0x320d80){return getQueuesByChannel(_0x386af1,_0x320d80);});return Promise[_0xf3e9('0xf')](_0xdbe2f7);})[_0xf3e9('0x4')](function(_0x3e1bb7){throw _0x3e1bb7;});}}});}; \ No newline at end of file +var _0xd987=['setDataValue','channel','catch','define','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','map','all','lodash','./team.attributes','get','then'];(function(_0xb5adad,_0x2e59a2){var _0x3558b4=function(_0x1467bf){while(--_0x1467bf){_0xb5adad['push'](_0xb5adad['shift']());}};_0x3558b4(++_0x2e59a2);}(_0xd987,0xe0));var _0x7d98=function(_0x5f483a,_0x4c942d){_0x5f483a=_0x5f483a-0x0;var _0x5bdfb6=_0xd987[_0x5f483a];return _0x5bdfb6;};'use strict';var _=require(_0x7d98('0x0'));var attributes=require(_0x7d98('0x1'));function getQueuesByChannel(_0x30ec3c,_0x211271){var _0x2672f3=_0x7d98('0x2')+_0x211271+'Queues';return _0x30ec3c[_0x2672f3]()[_0x7d98('0x3')](function(_0x1195ba){return _['map'](_0x1195ba,function(_0x41fad2){_0x41fad2[_0x7d98('0x4')](_0x7d98('0x5'),_0x211271);return _0x41fad2;});})[_0x7d98('0x6')](function(_0x1e553c){throw _0x1e553c;});}module['exports']=function(_0x47c699){return _0x47c699[_0x7d98('0x7')]('Team',attributes,{'tableName':_0x7d98('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4ed9da=this;var _0x66ac0c=[_0x7d98('0x9'),_0x7d98('0xa'),_0x7d98('0xb'),_0x7d98('0xc'),_0x7d98('0xd'),_0x7d98('0xe'),_0x7d98('0xf')];return Promise[_0x7d98('0x10')]()[_0x7d98('0x3')](function(){var _0x187cd8=_[_0x7d98('0x11')](_0x66ac0c,function(_0x130989){return getQueuesByChannel(_0x4ed9da,_0x130989);});return Promise[_0x7d98('0x12')](_0x187cd8);})[_0x7d98('0x6')](function(_0x340c22){throw _0x340c22;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e568634..285230e 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 _0xbb32=['error','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./team.socket','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x511ee8,_0x1934be){var _0x4386d6=function(_0x3dfc6f){while(--_0x3dfc6f){_0x511ee8['push'](_0x511ee8['shift']());}};_0x4386d6(++_0x1934be);}(_0xbb32,0xf8));var _0x2bb3=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xbb32[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0x2bb3('0x0'));var util=require(_0x2bb3('0x1'));var moment=require(_0x2bb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x2bb3('0x3'));var fs=require('fs');var Redis=require(_0x2bb3('0x4'));var db=require(_0x2bb3('0x5'))['db'];var utils=require(_0x2bb3('0x6'));var logger=require(_0x2bb3('0x7'))(_0x2bb3('0x8'));var config=require(_0x2bb3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2bb3('0xa')]['http']({'port':0x232a});config[_0x2bb3('0xb')]=_['defaults'](config[_0x2bb3('0xb')],{'host':_0x2bb3('0xc'),'port':0x18eb});var socket=require(_0x2bb3('0xd'))(new Redis(config[_0x2bb3('0xb')]));require(_0x2bb3('0xe'))['register'](socket);function respondWithRpcPromise(_0x2a6b95,_0xcdbca7,_0x529ba2){return new BPromise(function(_0x1f3e0c,_0x54e6a6){return client[_0x2bb3('0xf')](_0x2a6b95,_0x529ba2)[_0x2bb3('0x10')](function(_0x84c9dd){logger[_0x2bb3('0x11')]('Team,\x20%s,\x20%s',_0xcdbca7,_0x2bb3('0x12'));logger[_0x2bb3('0x13')](_0x2bb3('0x14'),_0xcdbca7,'request\x20sent',JSON[_0x2bb3('0x15')](_0x84c9dd));if(_0x84c9dd[_0x2bb3('0x16')]){if(_0x84c9dd[_0x2bb3('0x16')]['code']===0x1f4){logger[_0x2bb3('0x16')](_0x2bb3('0x17'),_0xcdbca7,_0x84c9dd['error']['message']);return _0x54e6a6(_0x84c9dd[_0x2bb3('0x16')][_0x2bb3('0x18')]);}logger[_0x2bb3('0x16')]('Team,\x20%s,\x20%s',_0xcdbca7,_0x84c9dd[_0x2bb3('0x16')][_0x2bb3('0x18')]);return _0x1f3e0c(_0x84c9dd['error']['message']);}else{logger[_0x2bb3('0x11')](_0x2bb3('0x17'),_0xcdbca7,_0x2bb3('0x12'));_0x1f3e0c(_0x84c9dd[_0x2bb3('0x19')]['message']);}})[_0x2bb3('0x1a')](function(_0x23a61b){logger[_0x2bb3('0x16')]('Team,\x20%s,\x20%s',_0xcdbca7,_0x23a61b);_0x54e6a6(_0x23a61b);});});} \ No newline at end of file +var _0x78ce=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x78ce,0xc4));var _0xe78c=function(_0x1c90a7,_0x115e4d){_0x1c90a7=_0x1c90a7-0x0;var _0x408b33=_0x78ce[_0x1c90a7];return _0x408b33;};'use strict';var _=require(_0xe78c('0x0'));var util=require(_0xe78c('0x1'));var moment=require(_0xe78c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe78c('0x3'));var fs=require('fs');var Redis=require(_0xe78c('0x4'));var db=require(_0xe78c('0x5'))['db'];var utils=require(_0xe78c('0x6'));var logger=require('../../config/logger')(_0xe78c('0x7'));var config=require(_0xe78c('0x8'));var jayson=require(_0xe78c('0x9'));var client=jayson[_0xe78c('0xa')][_0xe78c('0xb')]({'port':0x232a});config[_0xe78c('0xc')]=_[_0xe78c('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe78c('0xe'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x3c4e0b,_0xb72cee,_0xcd4819){return new BPromise(function(_0x5544ef,_0x491ad1){return client[_0xe78c('0xf')](_0x3c4e0b,_0xcd4819)[_0xe78c('0x10')](function(_0x5189c0){logger[_0xe78c('0x11')](_0xe78c('0x12'),_0xb72cee,'request\x20sent');logger['debug'](_0xe78c('0x13'),_0xb72cee,_0xe78c('0x14'),JSON['stringify'](_0x5189c0));if(_0x5189c0['error']){if(_0x5189c0[_0xe78c('0x15')][_0xe78c('0x16')]===0x1f4){logger['error'](_0xe78c('0x12'),_0xb72cee,_0x5189c0[_0xe78c('0x15')][_0xe78c('0x17')]);return _0x491ad1(_0x5189c0[_0xe78c('0x15')][_0xe78c('0x17')]);}logger[_0xe78c('0x15')](_0xe78c('0x12'),_0xb72cee,_0x5189c0[_0xe78c('0x15')][_0xe78c('0x17')]);return _0x5544ef(_0x5189c0[_0xe78c('0x15')][_0xe78c('0x17')]);}else{logger[_0xe78c('0x11')](_0xe78c('0x12'),_0xb72cee,'request\x20sent');_0x5544ef(_0x5189c0['result'][_0xe78c('0x17')]);}})[_0xe78c('0x18')](function(_0x870814){logger[_0xe78c('0x15')](_0xe78c('0x12'),_0xb72cee,_0x870814);_0x491ad1(_0x870814);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index eaec1d1..e85ef01 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 _0xd14a=['emit','removeListener','register','length','team:','./team.events','save'];(function(_0x197fdd,_0x48aac0){var _0x501ce8=function(_0x2bcf49){while(--_0x2bcf49){_0x197fdd['push'](_0x197fdd['shift']());}};_0x501ce8(++_0x48aac0);}(_0xd14a,0x1be));var _0xad14=function(_0x219153,_0x31ce82){_0x219153=_0x219153-0x0;var _0x54a0c3=_0xd14a[_0x219153];return _0x54a0c3;};'use strict';var TeamEvents=require(_0xad14('0x0'));var events=[_0xad14('0x1'),'remove','update'];function createListener(_0x2fb04f,_0x1d4eef){return function(_0x1263f5){_0x1d4eef[_0xad14('0x2')](_0x2fb04f,_0x1263f5);};}function removeListener(_0x35fe33,_0x3b2e62){return function(){TeamEvents[_0xad14('0x3')](_0x35fe33,_0x3b2e62);};}exports[_0xad14('0x4')]=function(_0x2c26fe){for(var _0x5e9959=0x0,_0xacdeec=events[_0xad14('0x5')];_0x5e9959<_0xacdeec;_0x5e9959++){var _0x2d9f95=events[_0x5e9959];var _0x1565a7=createListener(_0xad14('0x6')+_0x2d9f95,_0x2c26fe);TeamEvents['on'](_0x2d9f95,_0x1565a7);}}; \ No newline at end of file +var _0xe87e=['register','length','team:','./team.events','save','remove','update','emit','removeListener'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0xe87e,0x17d));var _0xee87=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xe87e[_0x9cfe28];return _0x54a1d0;};'use strict';var TeamEvents=require(_0xee87('0x0'));var events=[_0xee87('0x1'),_0xee87('0x2'),_0xee87('0x3')];function createListener(_0x1224f4,_0x572349){return function(_0x5a1394){_0x572349[_0xee87('0x4')](_0x1224f4,_0x5a1394);};}function removeListener(_0x14b7a8,_0x41d461){return function(){TeamEvents[_0xee87('0x5')](_0x14b7a8,_0x41d461);};}exports[_0xee87('0x6')]=function(_0x46446e){for(var _0x5be499=0x0,_0x589c36=events[_0xee87('0x7')];_0x5be499<_0x589c36;_0x5be499++){var _0x2ee165=events[_0x5be499];var _0x2fda67=createListener(_0xee87('0x8')+_0x2ee165,_0x46446e);TeamEvents['on'](_0x2ee165,_0x2fda67);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index d7c6b58..7b687c8 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 _0x275d=['exports','INTEGER','sequelize'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x275d,0x1a6));var _0xd275=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0x275d[_0x16b1a5];return _0x475e25;};'use strict';var Sequelize=require(_0xd275('0x0'));module[_0xd275('0x1')]={'TeamId':{'type':Sequelize[_0xd275('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd275('0x2')]}}; \ No newline at end of file +var _0x28a1=['INTEGER','sequelize','exports'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0x28a1,0x145));var _0x128a=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x28a1[_0x482214];return _0x38d0cb;};'use strict';var Sequelize=require(_0x128a('0x0'));module[_0x128a('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x128a('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index c881c70..53b54ae 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 _0xa20a=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api','moment','bluebird'];(function(_0x4a1218,_0x3f06b5){var _0x4be416=function(_0x3a1ab5){while(--_0x3a1ab5){_0x4a1218['push'](_0x4a1218['shift']());}};_0x4be416(++_0x3f06b5);}(_0xa20a,0x74));var _0xaa20=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xa20a[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa20('0x0'))(_0xaa20('0x1'));var moment=require(_0xaa20('0x2'));var BPromise=require(_0xaa20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa20('0x4'));var rimraf=require(_0xaa20('0x5'));var config=require(_0xaa20('0x6'));var attributes=require(_0xaa20('0x7'));module[_0xaa20('0x8')]=function(_0x5ac74e,_0x54ecbc){return _0x5ac74e[_0xaa20('0x9')](_0xaa20('0xa'),attributes,{'tableName':_0xaa20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb10=['request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash','util','api','moment'];(function(_0x5120e7,_0x55733b){var _0x14082c=function(_0x19c05d){while(--_0x19c05d){_0x5120e7['push'](_0x5120e7['shift']());}};_0x14082c(++_0x55733b);}(_0xcb10,0x104));var _0x0cb1=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcb10[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var logger=require('../../config/logger')(_0x0cb1('0x2'));var moment=require(_0x0cb1('0x3'));var BPromise=require('bluebird');var rp=require(_0x0cb1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cb1('0x5'));var config=require(_0x0cb1('0x6'));var attributes=require(_0x0cb1('0x7'));module[_0x0cb1('0x8')]=function(_0x430f60,_0x3ee6ec){return _0x430f60[_0x0cb1('0x9')](_0x0cb1('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index fc07bb5..be5fc43 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4d2467,_0x44ba40){var _0x38b296=function(_0x38dea6){while(--_0x38dea6){_0x4d2467['push'](_0x4d2467['shift']());}};_0x38b296(++_0x44ba40);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xcb91[_0x1cd47d];return _0x29d52f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x527c0a,_0x5e3a7f){var _0x46e42b=function(_0x5ce4c3){while(--_0x5ce4c3){_0x527c0a['push'](_0x527c0a['shift']());}};_0x46e42b(++_0x5e3a7f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 59b8380..2e5c9b5 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 _0xe4c7=['sequelize'];(function(_0x36d9ab,_0xd1709a){var _0x302a6a=function(_0x10a29c){while(--_0x10a29c){_0x36d9ab['push'](_0x36d9ab['shift']());}};_0x302a6a(++_0xd1709a);}(_0xe4c7,0x1d5));var _0x7e4c=function(_0xc9bc0f,_0x12e2ac){_0xc9bc0f=_0xc9bc0f-0x0;var _0x4aacbc=_0xe4c7[_0xc9bc0f];return _0x4aacbc;};'use strict';var Sequelize=require(_0x7e4c('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf596=['sequelize','INTEGER'];(function(_0x55be09,_0x62ecca){var _0x60f8f9=function(_0x101030){while(--_0x101030){_0x55be09['push'](_0x55be09['shift']());}};_0x60f8f9(++_0x62ecca);}(_0xf596,0x66));var _0x6f59=function(_0x30845d,_0x1989b2){_0x30845d=_0x30845d-0x0;var _0xff5444=_0xf596[_0x30845d];return _0xff5444;};'use strict';var Sequelize=require(_0x6f59('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6f59('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index a134cd2..ba16f4c 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 _0x99c9=['request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x99c9,0x13c));var _0x999c=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x99c9[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1a5=['bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','../../config/logger','api','moment'];(function(_0x383914,_0x2781f2){var _0x2d812c=function(_0x366f95){while(--_0x366f95){_0x383914['push'](_0x383914['shift']());}};_0x2d812c(++_0x2781f2);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x5e0b58,_0x3632f4){_0x5e0b58=_0x5e0b58-0x0;var _0x235017=_0xa1a5[_0x5e0b58];return _0x235017;};'use strict';var _=require(_0x5a1a('0x0'));var util=require('util');var logger=require(_0x5a1a('0x1'))(_0x5a1a('0x2'));var moment=require(_0x5a1a('0x3'));var BPromise=require(_0x5a1a('0x4'));var rp=require(_0x5a1a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a1a('0x6'));var config=require(_0x5a1a('0x7'));var attributes=require(_0x5a1a('0x8'));module[_0x5a1a('0x9')]=function(_0x1b718f,_0x27f71f){return _0x1b718f[_0x5a1a('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x5a1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index f1d03ef..8e1204e 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 _0x7ee1=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x5234a6,_0x314a5d){var _0x1f8955=function(_0xb6717c){while(--_0xb6717c){_0x5234a6['push'](_0x5234a6['shift']());}};_0x1f8955(++_0x314a5d);}(_0x7ee1,0xab));var _0x17ee=function(_0x1d4a18,_0x4098fc){_0x1d4a18=_0x1d4a18-0x0;var _0x4c785d=_0x7ee1[_0x1d4a18];return _0x4c785d;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rs=require(_0x17ee('0x3'));var fs=require('fs');var Redis=require(_0x17ee('0x4'));var db=require(_0x17ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x17ee('0x7'));var client=jayson[_0x17ee('0x8')][_0x17ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e6b4c,_0x28cc37,_0x59b876){return new BPromise(function(_0x314088,_0x59a51e){return client[_0x17ee('0xa')](_0x3e6b4c,_0x59b876)[_0x17ee('0xb')](function(_0x56b583){logger[_0x17ee('0xc')](_0x17ee('0xd'),_0x28cc37,_0x17ee('0xe'));logger[_0x17ee('0xf')](_0x17ee('0x10'),_0x28cc37,_0x17ee('0xe'),JSON[_0x17ee('0x11')](_0x56b583));if(_0x56b583[_0x17ee('0x12')]){if(_0x56b583[_0x17ee('0x12')][_0x17ee('0x13')]===0x1f4){logger[_0x17ee('0x12')](_0x17ee('0xd'),_0x28cc37,_0x56b583['error'][_0x17ee('0x14')]);return _0x59a51e(_0x56b583[_0x17ee('0x12')]['message']);}logger[_0x17ee('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x28cc37,_0x56b583[_0x17ee('0x12')][_0x17ee('0x14')]);return _0x314088(_0x56b583[_0x17ee('0x12')][_0x17ee('0x14')]);}else{logger['info'](_0x17ee('0xd'),_0x28cc37,_0x17ee('0xe'));_0x314088(_0x56b583[_0x17ee('0x15')]['message']);}})[_0x17ee('0x16')](function(_0x47c346){logger[_0x17ee('0x12')](_0x17ee('0xd'),_0x28cc37,_0x47c346);_0x59a51e(_0x47c346);});});} \ No newline at end of file +var _0x96a2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring'];(function(_0x51a6e8,_0x3e754a){var _0xda6ca=function(_0x2bc0e4){while(--_0x2bc0e4){_0x51a6e8['push'](_0x51a6e8['shift']());}};_0xda6ca(++_0x3e754a);}(_0x96a2,0x96));var _0x296a=function(_0x101c39,_0x145d2c){_0x101c39=_0x101c39-0x0;var _0x484052=_0x96a2[_0x101c39];return _0x484052;};'use strict';var _=require(_0x296a('0x0'));var util=require('util');var moment=require(_0x296a('0x1'));var BPromise=require(_0x296a('0x2'));var rs=require(_0x296a('0x3'));var fs=require('fs');var Redis=require(_0x296a('0x4'));var db=require(_0x296a('0x5'))['db'];var utils=require(_0x296a('0x6'));var logger=require(_0x296a('0x7'))(_0x296a('0x8'));var config=require(_0x296a('0x9'));var jayson=require(_0x296a('0xa'));var client=jayson[_0x296a('0xb')][_0x296a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eb919,_0x273b83,_0x3c3486){return new BPromise(function(_0x3a2b44,_0x17d4d2){return client[_0x296a('0xd')](_0x4eb919,_0x3c3486)['then'](function(_0x307644){logger[_0x296a('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x273b83,_0x296a('0xf'));logger[_0x296a('0x10')](_0x296a('0x11'),_0x273b83,_0x296a('0xf'),JSON[_0x296a('0x12')](_0x307644));if(_0x307644[_0x296a('0x13')]){if(_0x307644[_0x296a('0x13')]['code']===0x1f4){logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644[_0x296a('0x13')][_0x296a('0x15')]);return _0x17d4d2(_0x307644[_0x296a('0x13')]['message']);}logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644['error'][_0x296a('0x15')]);return _0x3a2b44(_0x307644[_0x296a('0x13')][_0x296a('0x15')]);}else{logger[_0x296a('0xe')](_0x296a('0x14'),_0x273b83,_0x296a('0xf'));_0x3a2b44(_0x307644['result'][_0x296a('0x15')]);}})['catch'](function(_0x55864e){logger['error'](_0x296a('0x14'),_0x273b83,_0x55864e);_0x17d4d2(_0x55864e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c9d7ff5..0ce552e 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 _0xa35e=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x228b4e,_0x59ef20){var _0x2de3a1=function(_0x1081b9){while(--_0x1081b9){_0x228b4e['push'](_0x228b4e['shift']());}};_0x2de3a1(++_0x59ef20);}(_0xa35e,0x111));var _0xea35=function(_0x1d1823,_0x3bdc9c){_0x1d1823=_0x1d1823-0x0;var _0x202e3c=_0xa35e[_0x1d1823];return _0x202e3c;};'use strict';var multer=require(_0xea35('0x0'));var util=require('util');var path=require(_0xea35('0x1'));var timeout=require(_0xea35('0x2'));var express=require(_0xea35('0x3'));var router=express[_0xea35('0x4')]();var fs_extra=require(_0xea35('0x5'));var auth=require(_0xea35('0x6'));var interaction=require(_0xea35('0x7'));var config=require(_0xea35('0x8'));var controller=require(_0xea35('0x9'));router[_0xea35('0xa')]('/',auth[_0xea35('0xb')](),controller[_0xea35('0xc')]);router[_0xea35('0xa')](_0xea35('0xd'),auth['isAuthenticated'](),controller[_0xea35('0xe')]);router[_0xea35('0xf')]('/',auth[_0xea35('0xb')](),controller['create']);router[_0xea35('0x10')](_0xea35('0xd'),auth[_0xea35('0xb')](),controller['update']);router[_0xea35('0x11')](_0xea35('0xd'),auth[_0xea35('0xb')](),controller[_0xea35('0x12')]);module[_0xea35('0x13')]=router; \ No newline at end of file +var _0xf970=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','path'];(function(_0x407b72,_0x5e24f9){var _0x507105=function(_0x141f7d){while(--_0x141f7d){_0x407b72['push'](_0x407b72['shift']());}};_0x507105(++_0x5e24f9);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0f97('0x0'));var util=require('util');var path=require(_0x0f97('0x1'));var timeout=require(_0x0f97('0x2'));var express=require(_0x0f97('0x3'));var router=express[_0x0f97('0x4')]();var fs_extra=require(_0x0f97('0x5'));var auth=require(_0x0f97('0x6'));var interaction=require(_0x0f97('0x7'));var config=require('../../config/environment');var controller=require(_0x0f97('0x8'));router[_0x0f97('0x9')]('/',auth[_0x0f97('0xa')](),controller[_0x0f97('0xb')]);router[_0x0f97('0x9')](_0x0f97('0xc'),auth[_0x0f97('0xa')](),controller[_0x0f97('0xd')]);router[_0x0f97('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f97('0xf')]('/:id',auth[_0x0f97('0xa')](),controller[_0x0f97('0x10')]);router[_0x0f97('0x11')]('/:id',auth[_0x0f97('0xa')](),controller['destroy']);module[_0x0f97('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 dde53d8..0e74f47 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 _0x4efc=['exports','TEXT'];(function(_0x3271ef,_0x5c2abf){var _0x1714da=function(_0x2a144d){while(--_0x2a144d){_0x3271ef['push'](_0x3271ef['shift']());}};_0x1714da(++_0x5c2abf);}(_0x4efc,0x1e8));var _0xc4ef=function(_0x5b7257,_0x3e79ac){_0x5b7257=_0x5b7257-0x0;var _0x32bc7a=_0x4efc[_0x5b7257];return _0x32bc7a;};'use strict';var Sequelize=require('sequelize');module[_0xc4ef('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xc4ef('0x1')]}}; \ No newline at end of file +var _0xab0c=['STRING','TEXT','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xab0c,0x1d3));var _0xcab0=function(_0x3ed83e,_0x54b8f0){_0x3ed83e=_0x3ed83e-0x0;var _0x8d9871=_0xab0c[_0x3ed83e];return _0x8d9871;};'use strict';var Sequelize=require(_0xcab0('0x0'));module['exports']={'name':{'type':Sequelize[_0xcab0('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xcab0('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f2d6adb..c1d94f6 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 _0xab3f=['catch','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','Templates','error','name','send','index','map','Template','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows'];(function(_0x98b7e4,_0x14616d){var _0x343cc5=function(_0x226020){while(--_0x226020){_0x98b7e4['push'](_0x98b7e4['shift']());}};_0x343cc5(++_0x14616d);}(_0xab3f,0x193));var _0xfab3=function(_0x992aca,_0x2d6592){_0x992aca=_0x992aca-0x0;var _0x3f1d2e=_0xab3f[_0x992aca];return _0x3f1d2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfab3('0x0'));var zipdir=require(_0xfab3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfab3('0x2'));var moment=require(_0xfab3('0x3'));var BPromise=require(_0xfab3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfab3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfab3('0x6'));var fs=require('fs');var fs_extra=require(_0xfab3('0x7'));var _=require(_0xfab3('0x8'));var squel=require(_0xfab3('0x9'));var crypto=require(_0xfab3('0xa'));var jsforce=require(_0xfab3('0xb'));var deskjs=require(_0xfab3('0xc'));var toCsv=require(_0xfab3('0xd'));var querystring=require(_0xfab3('0xe'));var Papa=require(_0xfab3('0xf'));var Redis=require('ioredis');var authService=require(_0xfab3('0x10'));var qs=require(_0xfab3('0x11'));var as=require(_0xfab3('0x12'));var hardwareService=require(_0xfab3('0x13'));var logger=require(_0xfab3('0x14'))(_0xfab3('0x15'));var utils=require(_0xfab3('0x16'));var config=require(_0xfab3('0x17'));var licenseUtil=require(_0xfab3('0x18'));var db=require(_0xfab3('0x19'))['db'];function respondWithStatusCode(_0x2879ad,_0x461772){_0x461772=_0x461772||0xcc;return function(_0xc09e29){if(_0xc09e29){return _0x2879ad[_0xfab3('0x1a')](_0x461772);}return _0x2879ad[_0xfab3('0x1b')](_0x461772)[_0xfab3('0x1c')]();};}function respondWithResult(_0x52faf5,_0x50ebd0){_0x50ebd0=_0x50ebd0||0xc8;return function(_0x59acc8){if(_0x59acc8){return _0x52faf5[_0xfab3('0x1b')](_0x50ebd0)[_0xfab3('0x1d')](_0x59acc8);}};}function respondWithFilteredResult(_0x3c508f,_0x3446d2){return function(_0x2ff01f){if(_0x2ff01f){var _0x5a215a=typeof _0x3446d2[_0xfab3('0x1e')]===_0xfab3('0x1f')&&typeof _0x3446d2[_0xfab3('0x20')]==='undefined';var _0x5cc41f=_0x2ff01f[_0xfab3('0x21')];var _0x27d4d6=_0x5a215a?0x0:_0x3446d2['offset'];var _0x16bc51=_0x5a215a?_0x2ff01f[_0xfab3('0x21')]:_0x3446d2['offset']+_0x3446d2[_0xfab3('0x20')];var _0x227d05;if(_0x16bc51>=_0x5cc41f){_0x16bc51=_0x5cc41f;_0x227d05=0xc8;}else{_0x227d05=0xce;}_0x3c508f[_0xfab3('0x1b')](_0x227d05);return _0x3c508f['set'](_0xfab3('0x22'),_0x27d4d6+'-'+_0x16bc51+'/'+_0x5cc41f)['json'](_0x2ff01f);}return null;};}function patchUpdates(_0x3ca130){return function(_0x4ecede){try{jsonpatch['apply'](_0x4ecede,_0x3ca130,!![]);}catch(_0xb7f398){return BPromise[_0xfab3('0x23')](_0xb7f398);}return _0x4ecede[_0xfab3('0x24')]();};}function saveUpdates(_0x507ff6,_0x3083f3){return function(_0x1a01c8){if(_0x1a01c8){return _0x1a01c8[_0xfab3('0x25')](_0x507ff6)[_0xfab3('0x26')](function(_0x1d137d){return _0x1d137d;});}return null;};}function removeEntity(_0x36e9d0,_0x444a1b){return function(_0xd70770){if(_0xd70770){return _0xd70770[_0xfab3('0x27')]()[_0xfab3('0x26')](function(){var _0x47f73d=_0xd70770['get']({'plain':!![]});var _0x28a907=_0xfab3('0x28');return db['UserProfileResource'][_0xfab3('0x27')]({'where':{'type':_0x28a907,'resourceId':_0x47f73d['id']}})[_0xfab3('0x26')](function(){return _0xd70770;});})[_0xfab3('0x26')](function(){_0x36e9d0[_0xfab3('0x1b')](0xcc)[_0xfab3('0x1c')]();});}};}function handleEntityNotFound(_0x220e7d,_0x3e25ce){return function(_0x1c625f){if(!_0x1c625f){_0x220e7d[_0xfab3('0x1a')](0x194);}return _0x1c625f;};}function handleError(_0x38fe56,_0x1d50b9){_0x1d50b9=_0x1d50b9||0x1f4;return function(_0x38097b){logger[_0xfab3('0x29')](_0x38097b['stack']);if(_0x38097b[_0xfab3('0x2a')]){delete _0x38097b['name'];}_0x38fe56['status'](_0x1d50b9)[_0xfab3('0x2b')](_0x38097b);};}exports[_0xfab3('0x2c')]=function(_0x4d7f42,_0x198bbd){var _0x125ec1={},_0x410023={},_0x1f63b6={'count':0x0,'rows':[]};var _0x470f7d=_[_0xfab3('0x2d')](db[_0xfab3('0x2e')]['rawAttributes'],function(_0x37ad73){return{'name':_0x37ad73['fieldName'],'type':_0x37ad73[_0xfab3('0x2f')]['key']};});_0x410023[_0xfab3('0x30')]=_[_0xfab3('0x2d')](_0x470f7d,_0xfab3('0x2a'));_0x410023[_0xfab3('0x31')]=_[_0xfab3('0x32')](_0x4d7f42['query']);_0x410023[_0xfab3('0x33')]=_[_0xfab3('0x34')](_0x410023[_0xfab3('0x30')],_0x410023['query']);_0x125ec1[_0xfab3('0x35')]=_['intersection'](_0x410023[_0xfab3('0x30')],qs['fields'](_0x4d7f42[_0xfab3('0x31')]['fields']));_0x125ec1[_0xfab3('0x35')]=_0x125ec1['attributes']['length']?_0x125ec1[_0xfab3('0x35')]:_0x410023[_0xfab3('0x30')];if(!_0x4d7f42['query'][_0xfab3('0x36')](_0xfab3('0x37'))){_0x125ec1[_0xfab3('0x20')]=qs['limit'](_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x20')]);_0x125ec1['offset']=qs['offset'](_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x1e')]);}_0x125ec1[_0xfab3('0x38')]=qs[_0xfab3('0x39')](_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x39')]);_0x125ec1[_0xfab3('0x3a')]=qs[_0xfab3('0x33')](_['pick'](_0x4d7f42[_0xfab3('0x31')],_0x410023['filters']),_0x470f7d);if(_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x3b')]){_0x125ec1['where']=_[_0xfab3('0x3c')](_0x125ec1[_0xfab3('0x3a')],{'$or':_['map'](_0x470f7d,function(_0x39aa77){if(_0x39aa77['type']!=='VIRTUAL'){var _0x392c97={};_0x392c97[_0x39aa77['name']]={'$like':'%'+_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x3b')]+'%'};return _0x392c97;}})});}_0x125ec1=_[_0xfab3('0x3c')]({},_0x125ec1,_0x4d7f42[_0xfab3('0x3d')]);var _0x353892={'where':_0x125ec1[_0xfab3('0x3a')]};return db[_0xfab3('0x2e')][_0xfab3('0x21')](_0x353892)[_0xfab3('0x26')](function(_0x82b667){_0x1f63b6['count']=_0x82b667;if(_0x4d7f42[_0xfab3('0x31')][_0xfab3('0x3e')]){_0x125ec1[_0xfab3('0x3f')]=[{'all':!![]}];}return db[_0xfab3('0x2e')]['findAll'](_0x125ec1);})[_0xfab3('0x26')](function(_0x44a0e2){_0x1f63b6[_0xfab3('0x40')]=_0x44a0e2;return _0x1f63b6;})['then'](respondWithFilteredResult(_0x198bbd,_0x125ec1))[_0xfab3('0x41')](handleError(_0x198bbd,null));};exports['show']=function(_0x2931a2,_0x2ffff9){var _0xe4949a={'raw':!![],'where':{'id':_0x2931a2[_0xfab3('0x42')]['id']}},_0x225d73={};_0x225d73[_0xfab3('0x30')]=_[_0xfab3('0x32')](db['Template'][_0xfab3('0x43')]);_0x225d73[_0xfab3('0x31')]=_[_0xfab3('0x32')](_0x2931a2[_0xfab3('0x31')]);_0x225d73['filters']=_[_0xfab3('0x34')](_0x225d73[_0xfab3('0x30')],_0x225d73[_0xfab3('0x31')]);_0xe4949a[_0xfab3('0x35')]=_['intersection'](_0x225d73[_0xfab3('0x30')],qs[_0xfab3('0x44')](_0x2931a2[_0xfab3('0x31')]['fields']));_0xe4949a[_0xfab3('0x35')]=_0xe4949a[_0xfab3('0x35')]['length']?_0xe4949a[_0xfab3('0x35')]:_0x225d73[_0xfab3('0x30')];if(_0x2931a2[_0xfab3('0x31')][_0xfab3('0x3e')]){_0xe4949a[_0xfab3('0x3f')]=[{'all':!![]}];}_0xe4949a=_['merge']({},_0xe4949a,_0x2931a2['options']);return db[_0xfab3('0x2e')][_0xfab3('0x45')](_0xe4949a)[_0xfab3('0x26')](handleEntityNotFound(_0x2ffff9,null))[_0xfab3('0x26')](respondWithResult(_0x2ffff9,null))['catch'](handleError(_0x2ffff9,null));};exports[_0xfab3('0x46')]=function(_0x4aeadd,_0x43144c){return db[_0xfab3('0x2e')][_0xfab3('0x46')](_0x4aeadd[_0xfab3('0x47')],{})[_0xfab3('0x26')](function(_0x4c807d){var _0xbe2856=_0x4aeadd[_0xfab3('0x48')]['get']({'plain':!![]});if(!_0xbe2856)throw new Error(_0xfab3('0x49'));if(_0xbe2856[_0xfab3('0x4a')]==='user'){var _0x1ab557=_0x4c807d[_0xfab3('0x4b')]({'plain':!![]});var _0xd3c887=_0xfab3('0x28');return db['UserProfileSection'][_0xfab3('0x45')]({'where':{'name':_0xd3c887,'userProfileId':_0xbe2856['userProfileId']},'raw':!![]})['then'](function(_0x5b125e){if(_0x5b125e&&_0x5b125e[_0xfab3('0x4c')]===0x0){return db['UserProfileResource'][_0xfab3('0x46')]({'name':_0x1ab557[_0xfab3('0x2a')],'resourceId':_0x1ab557['id'],'type':_0x5b125e[_0xfab3('0x2a')],'sectionId':_0x5b125e['id']},{})[_0xfab3('0x26')](function(){return _0x4c807d;});}else{return _0x4c807d;}})[_0xfab3('0x41')](function(_0x38240d){logger[_0xfab3('0x29')](_0xfab3('0x4d'),_0x38240d);throw _0x38240d;});}return _0x4c807d;})[_0xfab3('0x26')](respondWithResult(_0x43144c,0xc9))['catch'](handleError(_0x43144c,null));};exports[_0xfab3('0x25')]=function(_0x59a864,_0x33cf41){if(_0x59a864['body']['id']){delete _0x59a864[_0xfab3('0x47')]['id'];}return db['Template'][_0xfab3('0x45')]({'where':{'id':_0x59a864['params']['id']}})['then'](handleEntityNotFound(_0x33cf41,null))[_0xfab3('0x26')](saveUpdates(_0x59a864[_0xfab3('0x47')],null))['then'](respondWithResult(_0x33cf41,null))['catch'](handleError(_0x33cf41,null));};exports[_0xfab3('0x27')]=function(_0x16f1e3,_0x49a758){return db[_0xfab3('0x2e')][_0xfab3('0x45')]({'where':{'id':_0x16f1e3[_0xfab3('0x42')]['id']}})[_0xfab3('0x26')](handleEntityNotFound(_0x49a758,null))[_0xfab3('0x26')](removeEntity(_0x49a758,null))[_0xfab3('0x41')](handleError(_0x49a758,null));}; \ No newline at end of file +var _0xf5e5=['save','then','destroy','get','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf5e5,0xdb));var _0x5f5e=function(_0x520a18,_0x2e7d0a){_0x520a18=_0x520a18-0x0;var _0x5b0ba6=_0xf5e5[_0x520a18];return _0x5b0ba6;};'use strict';var emlformat=require(_0x5f5e('0x0'));var rimraf=require(_0x5f5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f5e('0x2'));var moment=require(_0x5f5e('0x3'));var BPromise=require(_0x5f5e('0x4'));var Mustache=require('mustache');var util=require(_0x5f5e('0x5'));var path=require(_0x5f5e('0x6'));var sox=require(_0x5f5e('0x7'));var csv=require(_0x5f5e('0x8'));var ejs=require(_0x5f5e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f5e('0xa'));var squel=require(_0x5f5e('0xb'));var crypto=require(_0x5f5e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f5e('0xd'));var toCsv=require(_0x5f5e('0x8'));var querystring=require('querystring');var Papa=require(_0x5f5e('0xe'));var Redis=require('ioredis');var authService=require(_0x5f5e('0xf'));var qs=require(_0x5f5e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f5e('0x11'));var utils=require('../../config/utils');var config=require(_0x5f5e('0x12'));var licenseUtil=require(_0x5f5e('0x13'));var db=require(_0x5f5e('0x14'))['db'];function respondWithStatusCode(_0x279532,_0x396763){_0x396763=_0x396763||0xcc;return function(_0x4602f6){if(_0x4602f6){return _0x279532[_0x5f5e('0x15')](_0x396763);}return _0x279532[_0x5f5e('0x16')](_0x396763)[_0x5f5e('0x17')]();};}function respondWithResult(_0x2b7a13,_0x87be4d){_0x87be4d=_0x87be4d||0xc8;return function(_0x4cdd47){if(_0x4cdd47){return _0x2b7a13['status'](_0x87be4d)[_0x5f5e('0x18')](_0x4cdd47);}};}function respondWithFilteredResult(_0x3a1d50,_0x52ecf5){return function(_0x37be7c){if(_0x37be7c){var _0x88d86d=typeof _0x52ecf5['offset']==='undefined'&&typeof _0x52ecf5[_0x5f5e('0x19')]===_0x5f5e('0x1a');var _0x2b9d22=_0x37be7c[_0x5f5e('0x1b')];var _0x5aaef6=_0x88d86d?0x0:_0x52ecf5[_0x5f5e('0x1c')];var _0x223656=_0x88d86d?_0x37be7c[_0x5f5e('0x1b')]:_0x52ecf5[_0x5f5e('0x1c')]+_0x52ecf5[_0x5f5e('0x19')];var _0x3b6da7;if(_0x223656>=_0x2b9d22){_0x223656=_0x2b9d22;_0x3b6da7=0xc8;}else{_0x3b6da7=0xce;}_0x3a1d50['status'](_0x3b6da7);return _0x3a1d50[_0x5f5e('0x1d')](_0x5f5e('0x1e'),_0x5aaef6+'-'+_0x223656+'/'+_0x2b9d22)['json'](_0x37be7c);}return null;};}function patchUpdates(_0x4e8ad4){return function(_0x923480){try{jsonpatch[_0x5f5e('0x1f')](_0x923480,_0x4e8ad4,!![]);}catch(_0x4c0e0e){return BPromise[_0x5f5e('0x20')](_0x4c0e0e);}return _0x923480[_0x5f5e('0x21')]();};}function saveUpdates(_0x13274e,_0x469e8e){return function(_0x1d077f){if(_0x1d077f){return _0x1d077f['update'](_0x13274e)[_0x5f5e('0x22')](function(_0x1794b6){return _0x1794b6;});}return null;};}function removeEntity(_0x2d9ce4,_0x28bbb2){return function(_0x464e42){if(_0x464e42){return _0x464e42[_0x5f5e('0x23')]()['then'](function(){var _0x37d76c=_0x464e42[_0x5f5e('0x24')]({'plain':!![]});var _0x41f5e2='Templates';return db['UserProfileResource'][_0x5f5e('0x23')]({'where':{'type':_0x41f5e2,'resourceId':_0x37d76c['id']}})[_0x5f5e('0x22')](function(){return _0x464e42;});})[_0x5f5e('0x22')](function(){_0x2d9ce4[_0x5f5e('0x16')](0xcc)[_0x5f5e('0x17')]();});}};}function handleEntityNotFound(_0x9b6baf,_0x4e85fc){return function(_0x55a076){if(!_0x55a076){_0x9b6baf['sendStatus'](0x194);}return _0x55a076;};}function handleError(_0x38eacf,_0x2ba4bc){_0x2ba4bc=_0x2ba4bc||0x1f4;return function(_0x1d7003){logger[_0x5f5e('0x25')](_0x1d7003[_0x5f5e('0x26')]);if(_0x1d7003[_0x5f5e('0x27')]){delete _0x1d7003[_0x5f5e('0x27')];}_0x38eacf[_0x5f5e('0x16')](_0x2ba4bc)[_0x5f5e('0x28')](_0x1d7003);};}exports[_0x5f5e('0x29')]=function(_0x3e148e,_0x57a6c2){var _0x13be21={},_0x55c06f={},_0x1d2a69={'count':0x0,'rows':[]};var _0x48c444=_['map'](db[_0x5f5e('0x2a')][_0x5f5e('0x2b')],function(_0x1ae8ff){return{'name':_0x1ae8ff[_0x5f5e('0x2c')],'type':_0x1ae8ff[_0x5f5e('0x2d')][_0x5f5e('0x2e')]};});_0x55c06f['model']=_[_0x5f5e('0x2f')](_0x48c444,'name');_0x55c06f[_0x5f5e('0x30')]=_[_0x5f5e('0x31')](_0x3e148e[_0x5f5e('0x30')]);_0x55c06f[_0x5f5e('0x32')]=_['intersection'](_0x55c06f[_0x5f5e('0x33')],_0x55c06f[_0x5f5e('0x30')]);_0x13be21[_0x5f5e('0x34')]=_[_0x5f5e('0x35')](_0x55c06f[_0x5f5e('0x33')],qs[_0x5f5e('0x36')](_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x36')]));_0x13be21[_0x5f5e('0x34')]=_0x13be21[_0x5f5e('0x34')][_0x5f5e('0x37')]?_0x13be21[_0x5f5e('0x34')]:_0x55c06f[_0x5f5e('0x33')];if(!_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x38')](_0x5f5e('0x39'))){_0x13be21['limit']=qs['limit'](_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x19')]);_0x13be21[_0x5f5e('0x1c')]=qs[_0x5f5e('0x1c')](_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x1c')]);}_0x13be21[_0x5f5e('0x3a')]=qs[_0x5f5e('0x3b')](_0x3e148e['query'][_0x5f5e('0x3b')]);_0x13be21[_0x5f5e('0x3c')]=qs[_0x5f5e('0x32')](_[_0x5f5e('0x3d')](_0x3e148e[_0x5f5e('0x30')],_0x55c06f['filters']),_0x48c444);if(_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x3e')]){_0x13be21[_0x5f5e('0x3c')]=_[_0x5f5e('0x3f')](_0x13be21['where'],{'$or':_[_0x5f5e('0x2f')](_0x48c444,function(_0x5cc88d){if(_0x5cc88d[_0x5f5e('0x2d')]!==_0x5f5e('0x40')){var _0x1f5c99={};_0x1f5c99[_0x5cc88d[_0x5f5e('0x27')]]={'$like':'%'+_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x3e')]+'%'};return _0x1f5c99;}})});}_0x13be21=_[_0x5f5e('0x3f')]({},_0x13be21,_0x3e148e['options']);var _0x2c7586={'where':_0x13be21[_0x5f5e('0x3c')]};return db[_0x5f5e('0x2a')][_0x5f5e('0x1b')](_0x2c7586)['then'](function(_0x564f3c){_0x1d2a69[_0x5f5e('0x1b')]=_0x564f3c;if(_0x3e148e[_0x5f5e('0x30')][_0x5f5e('0x41')]){_0x13be21[_0x5f5e('0x42')]=[{'all':!![]}];}return db['Template'][_0x5f5e('0x43')](_0x13be21);})[_0x5f5e('0x22')](function(_0x1c6265){_0x1d2a69[_0x5f5e('0x44')]=_0x1c6265;return _0x1d2a69;})['then'](respondWithFilteredResult(_0x57a6c2,_0x13be21))[_0x5f5e('0x45')](handleError(_0x57a6c2,null));};exports[_0x5f5e('0x46')]=function(_0x567d94,_0xa69ccc){var _0x429a1f={'raw':!![],'where':{'id':_0x567d94['params']['id']}},_0x58de01={};_0x58de01[_0x5f5e('0x33')]=_['keys'](db[_0x5f5e('0x2a')][_0x5f5e('0x2b')]);_0x58de01[_0x5f5e('0x30')]=_[_0x5f5e('0x31')](_0x567d94[_0x5f5e('0x30')]);_0x58de01['filters']=_[_0x5f5e('0x35')](_0x58de01[_0x5f5e('0x33')],_0x58de01[_0x5f5e('0x30')]);_0x429a1f[_0x5f5e('0x34')]=_[_0x5f5e('0x35')](_0x58de01[_0x5f5e('0x33')],qs[_0x5f5e('0x36')](_0x567d94[_0x5f5e('0x30')][_0x5f5e('0x36')]));_0x429a1f[_0x5f5e('0x34')]=_0x429a1f[_0x5f5e('0x34')][_0x5f5e('0x37')]?_0x429a1f[_0x5f5e('0x34')]:_0x58de01[_0x5f5e('0x33')];if(_0x567d94[_0x5f5e('0x30')][_0x5f5e('0x41')]){_0x429a1f[_0x5f5e('0x42')]=[{'all':!![]}];}_0x429a1f=_[_0x5f5e('0x3f')]({},_0x429a1f,_0x567d94[_0x5f5e('0x47')]);return db[_0x5f5e('0x2a')][_0x5f5e('0x48')](_0x429a1f)[_0x5f5e('0x22')](handleEntityNotFound(_0xa69ccc,null))[_0x5f5e('0x22')](respondWithResult(_0xa69ccc,null))[_0x5f5e('0x45')](handleError(_0xa69ccc,null));};exports['create']=function(_0x5392a8,_0x26a708){return db[_0x5f5e('0x2a')]['create'](_0x5392a8['body'],{})[_0x5f5e('0x22')](function(_0x5aa371){var _0x5c9553=_0x5392a8[_0x5f5e('0x49')]['get']({'plain':!![]});if(!_0x5c9553)throw new Error(_0x5f5e('0x4a'));if(_0x5c9553[_0x5f5e('0x4b')]===_0x5f5e('0x49')){var _0xe6c246=_0x5aa371['get']({'plain':!![]});var _0x18a5c7=_0x5f5e('0x4c');return db['UserProfileSection'][_0x5f5e('0x48')]({'where':{'name':_0x18a5c7,'userProfileId':_0x5c9553[_0x5f5e('0x4d')]},'raw':!![]})['then'](function(_0x535682){if(_0x535682&&_0x535682[_0x5f5e('0x4e')]===0x0){return db[_0x5f5e('0x4f')]['create']({'name':_0xe6c246['name'],'resourceId':_0xe6c246['id'],'type':_0x535682['name'],'sectionId':_0x535682['id']},{})['then'](function(){return _0x5aa371;});}else{return _0x5aa371;}})[_0x5f5e('0x45')](function(_0xdaf9dd){logger[_0x5f5e('0x25')](_0x5f5e('0x50'),_0xdaf9dd);throw _0xdaf9dd;});}return _0x5aa371;})[_0x5f5e('0x22')](respondWithResult(_0x26a708,0xc9))[_0x5f5e('0x45')](handleError(_0x26a708,null));};exports[_0x5f5e('0x51')]=function(_0x426eb8,_0x54953d){if(_0x426eb8[_0x5f5e('0x52')]['id']){delete _0x426eb8[_0x5f5e('0x52')]['id'];}return db[_0x5f5e('0x2a')][_0x5f5e('0x48')]({'where':{'id':_0x426eb8[_0x5f5e('0x53')]['id']}})[_0x5f5e('0x22')](handleEntityNotFound(_0x54953d,null))[_0x5f5e('0x22')](saveUpdates(_0x426eb8[_0x5f5e('0x52')],null))['then'](respondWithResult(_0x54953d,null))[_0x5f5e('0x45')](handleError(_0x54953d,null));};exports[_0x5f5e('0x23')]=function(_0x5852e7,_0x19ab95){return db[_0x5f5e('0x2a')][_0x5f5e('0x48')]({'where':{'id':_0x5852e7[_0x5f5e('0x53')]['id']}})[_0x5f5e('0x22')](handleEntityNotFound(_0x19ab95,null))[_0x5f5e('0x22')](removeEntity(_0x19ab95,null))[_0x5f5e('0x45')](handleError(_0x19ab95,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index fb7a0f9..d77213e 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 _0x0d83=['request-promise','path','rimraf','../../config/environment','./template.attributes','Template','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x55555f,_0x505b88){var _0x208602=function(_0x1cbc63){while(--_0x1cbc63){_0x55555f['push'](_0x55555f['shift']());}};_0x208602(++_0x505b88);}(_0x0d83,0xf7));var _0x30d8=function(_0x39e49f,_0x5dcd18){_0x39e49f=_0x39e49f-0x0;var _0x4b9235=_0x0d83[_0x39e49f];return _0x4b9235;};'use strict';var _=require(_0x30d8('0x0'));var util=require(_0x30d8('0x1'));var logger=require(_0x30d8('0x2'))(_0x30d8('0x3'));var moment=require(_0x30d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x30d8('0x5'));var fs=require('fs');var path=require(_0x30d8('0x6'));var rimraf=require(_0x30d8('0x7'));var config=require(_0x30d8('0x8'));var attributes=require(_0x30d8('0x9'));module['exports']=function(_0xec6907,_0x2e5610){return _0xec6907['define'](_0x30d8('0xa'),attributes,{'tableName':_0x30d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1829=['lodash','util','../../config/logger','api','request-promise','./template.attributes','exports','define','Template','tools_templates'];(function(_0x40b8de,_0x1bc3a5){var _0x137d51=function(_0x1a3d12){while(--_0x1a3d12){_0x40b8de['push'](_0x40b8de['shift']());}};_0x137d51(++_0x1bc3a5);}(_0x1829,0xfa));var _0x9182=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x1829[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x9182('0x0'));var util=require(_0x9182('0x1'));var logger=require(_0x9182('0x2'))(_0x9182('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9182('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9182('0x5'));module[_0x9182('0x6')]=function(_0x220cc1,_0x5213e4){return _0x220cc1[_0x9182('0x7')](_0x9182('0x8'),attributes,{'tableName':_0x9182('0x9'),'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 5998192..1cb76c5 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 _0xbc35=['result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x162b69,_0x590481){var _0x2e7d12=function(_0x505afd){while(--_0x505afd){_0x162b69['push'](_0x162b69['shift']());}};_0x2e7d12(++_0x590481);}(_0xbc35,0x69));var _0x5bc3=function(_0x223271,_0x47b303){_0x223271=_0x223271-0x0;var _0x12cade=_0xbc35[_0x223271];return _0x12cade;};'use strict';var _=require(_0x5bc3('0x0'));var util=require('util');var moment=require(_0x5bc3('0x1'));var BPromise=require('bluebird');var rs=require(_0x5bc3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bc3('0x3'))['db'];var utils=require(_0x5bc3('0x4'));var logger=require('../../config/logger')(_0x5bc3('0x5'));var config=require(_0x5bc3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5bc3('0x7')][_0x5bc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2354e3,_0x9177e7,_0x5c20f2){return new BPromise(function(_0x3b110b,_0x2964a7){return client[_0x5bc3('0x9')](_0x2354e3,_0x5c20f2)[_0x5bc3('0xa')](function(_0x3e9ea8){logger['info'](_0x5bc3('0xb'),_0x9177e7,_0x5bc3('0xc'));logger[_0x5bc3('0xd')](_0x5bc3('0xe'),_0x9177e7,_0x5bc3('0xc'),JSON[_0x5bc3('0xf')](_0x3e9ea8));if(_0x3e9ea8[_0x5bc3('0x10')]){if(_0x3e9ea8['error']['code']===0x1f4){logger[_0x5bc3('0x10')]('Template,\x20%s,\x20%s',_0x9177e7,_0x3e9ea8[_0x5bc3('0x10')]['message']);return _0x2964a7(_0x3e9ea8[_0x5bc3('0x10')]['message']);}logger[_0x5bc3('0x10')](_0x5bc3('0xb'),_0x9177e7,_0x3e9ea8[_0x5bc3('0x10')][_0x5bc3('0x11')]);return _0x3b110b(_0x3e9ea8[_0x5bc3('0x10')]['message']);}else{logger[_0x5bc3('0x12')](_0x5bc3('0xb'),_0x9177e7,_0x5bc3('0xc'));_0x3b110b(_0x3e9ea8[_0x5bc3('0x13')][_0x5bc3('0x11')]);}})[_0x5bc3('0x14')](function(_0x2a9f4d){logger['error'](_0x5bc3('0xb'),_0x9177e7,_0x2a9f4d);_0x2964a7(_0x2a9f4d);});});}exports[_0x5bc3('0x15')]=function(_0x32a8dc){var _0x3c78ee=this;return new Promise(function(_0x93bd89,_0x1ab354){return db['Template'][_0x5bc3('0x16')]({'raw':_0x32a8dc[_0x5bc3('0x17')]?_0x32a8dc[_0x5bc3('0x17')][_0x5bc3('0x18')]===undefined?!![]:![]:!![],'where':_0x32a8dc[_0x5bc3('0x17')]?_0x32a8dc['options'][_0x5bc3('0x19')]||null:null,'attributes':_0x32a8dc[_0x5bc3('0x17')]?_0x32a8dc[_0x5bc3('0x17')]['attributes']||null:null,'limit':_0x32a8dc[_0x5bc3('0x17')]?_0x32a8dc[_0x5bc3('0x17')][_0x5bc3('0x1a')]||null:null,'include':_0x32a8dc[_0x5bc3('0x17')]?_0x32a8dc[_0x5bc3('0x17')][_0x5bc3('0x1b')]?_[_0x5bc3('0x1c')](_0x32a8dc[_0x5bc3('0x17')]['include'],function(_0x1e9e53){return{'model':db[_0x1e9e53[_0x5bc3('0x1d')]],'as':_0x1e9e53['as'],'attributes':_0x1e9e53['attributes'],'include':_0x1e9e53[_0x5bc3('0x1b')]?_[_0x5bc3('0x1c')](_0x1e9e53['include'],function(_0x3df6b7){return{'model':db[_0x3df6b7[_0x5bc3('0x1d')]],'as':_0x3df6b7['as'],'attributes':_0x3df6b7[_0x5bc3('0x1e')],'include':_0x3df6b7[_0x5bc3('0x1b')]?_[_0x5bc3('0x1c')](_0x3df6b7[_0x5bc3('0x1b')],function(_0x295bb6){return{'model':db[_0x295bb6[_0x5bc3('0x1d')]],'as':_0x295bb6['as'],'attributes':_0x295bb6[_0x5bc3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5bc3('0xa')](function(_0x39d1a7){logger[_0x5bc3('0x12')]('GetTemplate',_0x32a8dc);logger[_0x5bc3('0xd')](_0x5bc3('0x15'),_0x32a8dc,JSON[_0x5bc3('0xf')](_0x39d1a7));_0x93bd89(_0x39d1a7);})[_0x5bc3('0x14')](function(_0x131746){logger['error'](_0x5bc3('0x15'),_0x131746[_0x5bc3('0x11')],_0x32a8dc);_0x1ab354(_0x3c78ee[_0x5bc3('0x10')](0x1f4,_0x131746[_0x5bc3('0x11')]));});});}; \ No newline at end of file +var _0x0d94=['util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Template','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','debug','lodash'];(function(_0x4c7095,_0x510858){var _0x202f96=function(_0x3d23ed){while(--_0x3d23ed){_0x4c7095['push'](_0x4c7095['shift']());}};_0x202f96(++_0x510858);}(_0x0d94,0xc5));var _0x40d9=function(_0x439a7f,_0x5b0253){_0x439a7f=_0x439a7f-0x0;var _0x11d326=_0x0d94[_0x439a7f];return _0x11d326;};'use strict';var _=require(_0x40d9('0x0'));var util=require(_0x40d9('0x1'));var moment=require(_0x40d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x40d9('0x4'));var logger=require('../../config/logger')(_0x40d9('0x5'));var config=require(_0x40d9('0x6'));var jayson=require(_0x40d9('0x7'));var client=jayson['client'][_0x40d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x152b1c,_0x5ec2d0,_0x582758){return new BPromise(function(_0x4997c7,_0x40ca87){return client[_0x40d9('0x9')](_0x152b1c,_0x582758)[_0x40d9('0xa')](function(_0x22cd2c){logger['info'](_0x40d9('0xb'),_0x5ec2d0,_0x40d9('0xc'));logger['debug'](_0x40d9('0xd'),_0x5ec2d0,_0x40d9('0xc'),JSON[_0x40d9('0xe')](_0x22cd2c));if(_0x22cd2c[_0x40d9('0xf')]){if(_0x22cd2c[_0x40d9('0xf')][_0x40d9('0x10')]===0x1f4){logger[_0x40d9('0xf')](_0x40d9('0xb'),_0x5ec2d0,_0x22cd2c['error']['message']);return _0x40ca87(_0x22cd2c[_0x40d9('0xf')][_0x40d9('0x11')]);}logger[_0x40d9('0xf')](_0x40d9('0xb'),_0x5ec2d0,_0x22cd2c[_0x40d9('0xf')][_0x40d9('0x11')]);return _0x4997c7(_0x22cd2c[_0x40d9('0xf')][_0x40d9('0x11')]);}else{logger[_0x40d9('0x12')](_0x40d9('0xb'),_0x5ec2d0,'request\x20sent');_0x4997c7(_0x22cd2c[_0x40d9('0x13')][_0x40d9('0x11')]);}})[_0x40d9('0x14')](function(_0x81334e){logger['error'](_0x40d9('0xb'),_0x5ec2d0,_0x81334e);_0x40ca87(_0x81334e);});});}exports['GetTemplate']=function(_0x2e2627){var _0x56e200=this;return new Promise(function(_0x4e5fa1,_0x216ce0){return db[_0x40d9('0x15')][_0x40d9('0x16')]({'raw':_0x2e2627[_0x40d9('0x17')]?_0x2e2627[_0x40d9('0x17')][_0x40d9('0x18')]===undefined?!![]:![]:!![],'where':_0x2e2627[_0x40d9('0x17')]?_0x2e2627[_0x40d9('0x17')][_0x40d9('0x19')]||null:null,'attributes':_0x2e2627[_0x40d9('0x17')]?_0x2e2627['options'][_0x40d9('0x1a')]||null:null,'limit':_0x2e2627[_0x40d9('0x17')]?_0x2e2627['options'][_0x40d9('0x1b')]||null:null,'include':_0x2e2627[_0x40d9('0x17')]?_0x2e2627[_0x40d9('0x17')][_0x40d9('0x1c')]?_[_0x40d9('0x1d')](_0x2e2627[_0x40d9('0x17')][_0x40d9('0x1c')],function(_0xd3fd87){return{'model':db[_0xd3fd87[_0x40d9('0x1e')]],'as':_0xd3fd87['as'],'attributes':_0xd3fd87[_0x40d9('0x1a')],'include':_0xd3fd87[_0x40d9('0x1c')]?_[_0x40d9('0x1d')](_0xd3fd87[_0x40d9('0x1c')],function(_0x5f1a82){return{'model':db[_0x5f1a82[_0x40d9('0x1e')]],'as':_0x5f1a82['as'],'attributes':_0x5f1a82[_0x40d9('0x1a')],'include':_0x5f1a82[_0x40d9('0x1c')]?_['map'](_0x5f1a82['include'],function(_0x5d9a75){return{'model':db[_0x5d9a75['model']],'as':_0x5d9a75['as'],'attributes':_0x5d9a75[_0x40d9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51fdf3){logger[_0x40d9('0x12')](_0x40d9('0x1f'),_0x2e2627);logger[_0x40d9('0x20')](_0x40d9('0x1f'),_0x2e2627,JSON[_0x40d9('0xe')](_0x51fdf3));_0x4e5fa1(_0x51fdf3);})[_0x40d9('0x14')](function(_0x5d7503){logger['error']('GetTemplate',_0x5d7503[_0x40d9('0x11')],_0x2e2627);_0x216ce0(_0x56e200[_0x40d9('0xf')](0x1f4,_0x5d7503[_0x40d9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0c22964..0cecfe9 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 _0x217d=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','/:id/actions','create','addAllCondition','post','addAnyCondition','put','update','delete'];(function(_0x1750a5,_0x4e2311){var _0x17c181=function(_0x148d99){while(--_0x148d99){_0x1750a5['push'](_0x1750a5['shift']());}};_0x17c181(++_0x4e2311);}(_0x217d,0x178));var _0xd217=function(_0x459465,_0x285574){_0x459465=_0x459465-0x0;var _0x21e277=_0x217d[_0x459465];return _0x21e277;};'use strict';var multer=require(_0xd217('0x0'));var util=require(_0xd217('0x1'));var path=require(_0xd217('0x2'));var timeout=require(_0xd217('0x3'));var express=require(_0xd217('0x4'));var router=express['Router']();var fs_extra=require(_0xd217('0x5'));var auth=require(_0xd217('0x6'));var interaction=require(_0xd217('0x7'));var config=require(_0xd217('0x8'));var controller=require(_0xd217('0x9'));router[_0xd217('0xa')]('/',auth['isAuthenticated'](),controller[_0xd217('0xb')]);router[_0xd217('0xa')](_0xd217('0xc'),auth[_0xd217('0xd')](),controller[_0xd217('0xe')]);router['get'](_0xd217('0xf'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xd217('0xa')]('/:id/any_conditions',auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xd217('0xa')](_0xd217('0x10'),auth[_0xd217('0xd')](),controller['getActions']);router['post']('/',auth[_0xd217('0xd')](),controller[_0xd217('0x11')]);router['post'](_0xd217('0xf'),auth['isAuthenticated'](),controller[_0xd217('0x12')]);router[_0xd217('0x13')]('/:id/any_conditions',auth[_0xd217('0xd')](),controller[_0xd217('0x14')]);router[_0xd217('0x13')](_0xd217('0x10'),auth[_0xd217('0xd')](),controller['addAction']);router[_0xd217('0x15')](_0xd217('0xc'),auth[_0xd217('0xd')](),controller[_0xd217('0x16')]);router[_0xd217('0x17')](_0xd217('0xc'),auth[_0xd217('0xd')](),controller['destroy']);module[_0xd217('0x18')]=router; \ No newline at end of file +var _0xdd45=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','get','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0xdd45,0x10a));var _0x5dd4=function(_0x2813c9,_0x59aadd){_0x2813c9=_0x2813c9-0x0;var _0x3867e9=_0xdd45[_0x2813c9];return _0x3867e9;};'use strict';var multer=require(_0x5dd4('0x0'));var util=require('util');var path=require(_0x5dd4('0x1'));var timeout=require(_0x5dd4('0x2'));var express=require(_0x5dd4('0x3'));var router=express[_0x5dd4('0x4')]();var fs_extra=require(_0x5dd4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5dd4('0x6'));var controller=require(_0x5dd4('0x7'));router['get']('/',auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x9')]);router['get'](_0x5dd4('0xa'),auth[_0x5dd4('0x8')](),controller[_0x5dd4('0xb')]);router[_0x5dd4('0xc')](_0x5dd4('0xd'),auth['isAuthenticated'](),controller[_0x5dd4('0xe')]);router[_0x5dd4('0xc')]('/:id/any_conditions',auth[_0x5dd4('0x8')](),controller[_0x5dd4('0xf')]);router[_0x5dd4('0xc')](_0x5dd4('0x10'),auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x11')]);router[_0x5dd4('0x12')]('/',auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x13')]);router[_0x5dd4('0x12')](_0x5dd4('0xd'),auth['isAuthenticated'](),controller[_0x5dd4('0x14')]);router[_0x5dd4('0x12')](_0x5dd4('0x15'),auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x16')]);router[_0x5dd4('0x12')]('/:id/actions',auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x17')]);router[_0x5dd4('0x18')](_0x5dd4('0xa'),auth[_0x5dd4('0x8')](),controller[_0x5dd4('0x19')]);router[_0x5dd4('0x1a')](_0x5dd4('0xa'),auth['isAuthenticated'](),controller[_0x5dd4('0x1b')]);module[_0x5dd4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 19bbe23..d0a537b 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 _0xd479=['BOOLEAN','sequelize','exports','STRING'];(function(_0x56d700,_0xff7740){var _0x2a335c=function(_0x25e1da){while(--_0x25e1da){_0x56d700['push'](_0x56d700['shift']());}};_0x2a335c(++_0xff7740);}(_0xd479,0x179));var _0x9d47=function(_0x2b2833,_0x53db4b){_0x2b2833=_0x2b2833-0x0;var _0x2b2bc3=_0xd479[_0x2b2833];return _0x2b2bc3;};'use strict';var Sequelize=require(_0x9d47('0x0'));module[_0x9d47('0x1')]={'name':{'type':Sequelize[_0x9d47('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9d47('0x2')]},'status':{'type':Sequelize[_0x9d47('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2a9c=['exports','STRING','sequelize'];(function(_0x56c38,_0xe456b1){var _0x4ca365=function(_0x15bbdd){while(--_0x15bbdd){_0x56c38['push'](_0x56c38['shift']());}};_0x4ca365(++_0xe456b1);}(_0x2a9c,0xb6));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc2a9('0x0'));module[_0xc2a9('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc2a9('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 569bf7b..9e683d0 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 _0x74de=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','error','stack','name','send','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','attributes','includeAll','find'];(function(_0x4be788,_0x530bab){var _0x151080=function(_0xbc0a06){while(--_0xbc0a06){_0x4be788['push'](_0x4be788['shift']());}};_0x151080(++_0x530bab);}(_0x74de,0xcd));var _0xe74d=function(_0x21fe12,_0x29aafd){_0x21fe12=_0x21fe12-0x0;var _0x503e30=_0x74de[_0x21fe12];return _0x503e30;};'use strict';var emlformat=require(_0xe74d('0x0'));var rimraf=require(_0xe74d('0x1'));var zipdir=require(_0xe74d('0x2'));var jsonpatch=require(_0xe74d('0x3'));var rp=require(_0xe74d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe74d('0x5'));var util=require(_0xe74d('0x6'));var path=require('path');var sox=require(_0xe74d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe74d('0x8'));var _=require(_0xe74d('0x9'));var squel=require(_0xe74d('0xa'));var crypto=require(_0xe74d('0xb'));var jsforce=require(_0xe74d('0xc'));var deskjs=require(_0xe74d('0xd'));var toCsv=require(_0xe74d('0xe'));var querystring=require(_0xe74d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe74d('0x10'));var hardwareService=require(_0xe74d('0x11'));var logger=require(_0xe74d('0x12'))(_0xe74d('0x13'));var utils=require(_0xe74d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2251d3,_0x31a94b){_0x31a94b=_0x31a94b||0xcc;return function(_0x59028f){if(_0x59028f){return _0x2251d3[_0xe74d('0x15')](_0x31a94b);}return _0x2251d3[_0xe74d('0x16')](_0x31a94b)[_0xe74d('0x17')]();};}function respondWithResult(_0x3ed657,_0x2f739a){_0x2f739a=_0x2f739a||0xc8;return function(_0x2fd60f){if(_0x2fd60f){return _0x3ed657[_0xe74d('0x16')](_0x2f739a)['json'](_0x2fd60f);}};}function respondWithFilteredResult(_0xf663fa,_0x444187){return function(_0x3dcbb9){if(_0x3dcbb9){var _0x6b87be=typeof _0x444187['offset']===_0xe74d('0x18')&&typeof _0x444187[_0xe74d('0x19')]==='undefined';var _0x4548e4=_0x3dcbb9[_0xe74d('0x1a')];var _0x16d071=_0x6b87be?0x0:_0x444187[_0xe74d('0x1b')];var _0x371b53=_0x6b87be?_0x3dcbb9[_0xe74d('0x1a')]:_0x444187[_0xe74d('0x1b')]+_0x444187[_0xe74d('0x19')];var _0xc0cfcd;if(_0x371b53>=_0x4548e4){_0x371b53=_0x4548e4;_0xc0cfcd=0xc8;}else{_0xc0cfcd=0xce;}_0xf663fa[_0xe74d('0x16')](_0xc0cfcd);return _0xf663fa['set'](_0xe74d('0x1c'),_0x16d071+'-'+_0x371b53+'/'+_0x4548e4)[_0xe74d('0x1d')](_0x3dcbb9);}return null;};}function patchUpdates(_0x115110){return function(_0x117754){try{jsonpatch[_0xe74d('0x1e')](_0x117754,_0x115110,!![]);}catch(_0x4aaf2f){return BPromise[_0xe74d('0x1f')](_0x4aaf2f);}return _0x117754[_0xe74d('0x20')]();};}function saveUpdates(_0x3557b7,_0x188550){return function(_0x25994e){if(_0x25994e){return _0x25994e[_0xe74d('0x21')](_0x3557b7)[_0xe74d('0x22')](function(_0x56690e){return _0x56690e;});}return null;};}function removeEntity(_0x10d6b4,_0x215dad){return function(_0x5c429d){if(_0x5c429d){return _0x5c429d[_0xe74d('0x23')]()[_0xe74d('0x22')](function(){var _0x2bad3a=_0x5c429d[_0xe74d('0x24')]({'plain':!![]});var _0x4e781e='Triggers';return db['UserProfileResource'][_0xe74d('0x23')]({'where':{'type':_0x4e781e,'resourceId':_0x2bad3a['id']}})['then'](function(){return _0x5c429d;});})['then'](function(){_0x10d6b4[_0xe74d('0x16')](0xcc)[_0xe74d('0x17')]();});}};}function handleEntityNotFound(_0x5b6e14,_0x58ae83){return function(_0x506d20){if(!_0x506d20){_0x5b6e14[_0xe74d('0x15')](0x194);}return _0x506d20;};}function handleError(_0x18cb03,_0x20e616){_0x20e616=_0x20e616||0x1f4;return function(_0x51247c){logger[_0xe74d('0x25')](_0x51247c[_0xe74d('0x26')]);if(_0x51247c[_0xe74d('0x27')]){delete _0x51247c[_0xe74d('0x27')];}_0x18cb03[_0xe74d('0x16')](_0x20e616)[_0xe74d('0x28')](_0x51247c);};}exports['index']=function(_0x524e6c,_0x1f580d){var _0x3868b3={},_0x55d874={},_0x1a7028={'count':0x0,'rows':[]};var _0x58b3a0=_['map'](db[_0xe74d('0x29')][_0xe74d('0x2a')],function(_0x1fbf6d){return{'name':_0x1fbf6d[_0xe74d('0x2b')],'type':_0x1fbf6d[_0xe74d('0x2c')][_0xe74d('0x2d')]};});_0x55d874[_0xe74d('0x2e')]=_[_0xe74d('0x2f')](_0x58b3a0,_0xe74d('0x27'));_0x55d874[_0xe74d('0x30')]=_[_0xe74d('0x31')](_0x524e6c['query']);_0x55d874[_0xe74d('0x32')]=_['intersection'](_0x55d874[_0xe74d('0x2e')],_0x55d874['query']);_0x3868b3['attributes']=_[_0xe74d('0x33')](_0x55d874['model'],qs[_0xe74d('0x34')](_0x524e6c[_0xe74d('0x30')]['fields']));_0x3868b3['attributes']=_0x3868b3['attributes'][_0xe74d('0x35')]?_0x3868b3['attributes']:_0x55d874[_0xe74d('0x2e')];if(!_0x524e6c[_0xe74d('0x30')][_0xe74d('0x36')](_0xe74d('0x37'))){_0x3868b3[_0xe74d('0x19')]=qs[_0xe74d('0x19')](_0x524e6c['query'][_0xe74d('0x19')]);_0x3868b3[_0xe74d('0x1b')]=qs['offset'](_0x524e6c['query'][_0xe74d('0x1b')]);}_0x3868b3[_0xe74d('0x38')]=qs[_0xe74d('0x39')](_0x524e6c['query']['sort']);_0x3868b3['where']=qs[_0xe74d('0x32')](_[_0xe74d('0x3a')](_0x524e6c['query'],_0x55d874['filters']),_0x58b3a0);if(_0x524e6c['query'][_0xe74d('0x3b')]){_0x3868b3[_0xe74d('0x3c')]=_[_0xe74d('0x3d')](_0x3868b3[_0xe74d('0x3c')],{'$or':_[_0xe74d('0x2f')](_0x58b3a0,function(_0x2f90ba){if(_0x2f90ba[_0xe74d('0x2c')]!==_0xe74d('0x3e')){var _0x21f40c={};_0x21f40c[_0x2f90ba[_0xe74d('0x27')]]={'$like':'%'+_0x524e6c[_0xe74d('0x30')][_0xe74d('0x3b')]+'%'};return _0x21f40c;}})});}_0x3868b3=_[_0xe74d('0x3d')]({},_0x3868b3,_0x524e6c[_0xe74d('0x3f')]);var _0x54e7fb={'where':_0x3868b3['where']};return db[_0xe74d('0x29')]['count'](_0x54e7fb)['then'](function(_0x342980){_0x1a7028[_0xe74d('0x1a')]=_0x342980;if(_0x524e6c[_0xe74d('0x30')]['includeAll']){_0x3868b3[_0xe74d('0x40')]=[{'all':!![]}];}return db['Trigger'][_0xe74d('0x41')](_0x3868b3);})[_0xe74d('0x22')](function(_0x3e3c6f){_0x1a7028['rows']=_0x3e3c6f;return _0x1a7028;})['then'](respondWithFilteredResult(_0x1f580d,_0x3868b3))['catch'](handleError(_0x1f580d,null));};exports[_0xe74d('0x42')]=function(_0x3684c2,_0x79adea){var _0x2b8b40={'raw':![],'where':{'id':_0x3684c2[_0xe74d('0x43')]['id']}},_0x1b538a={};_0x1b538a['model']=_[_0xe74d('0x31')](db[_0xe74d('0x29')]['rawAttributes']);_0x1b538a[_0xe74d('0x30')]=_[_0xe74d('0x31')](_0x3684c2[_0xe74d('0x30')]);_0x1b538a['filters']=_[_0xe74d('0x33')](_0x1b538a[_0xe74d('0x2e')],_0x1b538a[_0xe74d('0x30')]);_0x2b8b40[_0xe74d('0x44')]=_['intersection'](_0x1b538a['model'],qs[_0xe74d('0x34')](_0x3684c2[_0xe74d('0x30')][_0xe74d('0x34')]));_0x2b8b40[_0xe74d('0x44')]=_0x2b8b40['attributes'][_0xe74d('0x35')]?_0x2b8b40[_0xe74d('0x44')]:_0x1b538a['model'];if(_0x3684c2[_0xe74d('0x30')][_0xe74d('0x45')]){_0x2b8b40['include']=[{'all':!![]}];}_0x2b8b40=_['merge']({},_0x2b8b40,_0x3684c2[_0xe74d('0x3f')]);return db['Trigger'][_0xe74d('0x46')](_0x2b8b40)[_0xe74d('0x22')](handleEntityNotFound(_0x79adea,null))[_0xe74d('0x22')](respondWithResult(_0x79adea,null))[_0xe74d('0x47')](handleError(_0x79adea,null));};exports[_0xe74d('0x48')]=function(_0x499708,_0xed24bb){return db['Trigger']['create'](_0x499708[_0xe74d('0x49')],{})[_0xe74d('0x22')](function(_0x317b1a){var _0x58af49=_0x499708[_0xe74d('0x4a')][_0xe74d('0x24')]({'plain':!![]});if(!_0x58af49)throw new Error(_0xe74d('0x4b'));if(_0x58af49['role']===_0xe74d('0x4a')){var _0x256da9=_0x317b1a[_0xe74d('0x24')]({'plain':!![]});var _0x1b1b1e=_0xe74d('0x4c');return db[_0xe74d('0x4d')][_0xe74d('0x46')]({'where':{'name':_0x1b1b1e,'userProfileId':_0x58af49['userProfileId']},'raw':!![]})['then'](function(_0xed1d45){if(_0xed1d45&&_0xed1d45[_0xe74d('0x4e')]===0x0){return db[_0xe74d('0x4f')][_0xe74d('0x48')]({'name':_0x256da9['name'],'resourceId':_0x256da9['id'],'type':_0xed1d45['name'],'sectionId':_0xed1d45['id']},{})['then'](function(){return _0x317b1a;});}else{return _0x317b1a;}})[_0xe74d('0x47')](function(_0x368f43){logger[_0xe74d('0x25')](_0xe74d('0x50'),_0x368f43);throw _0x368f43;});}return _0x317b1a;})['then'](respondWithResult(_0xed24bb,0xc9))['catch'](handleError(_0xed24bb,null));};exports[_0xe74d('0x21')]=function(_0x235719,_0x31e2fa){if(_0x235719[_0xe74d('0x49')]['id']){delete _0x235719[_0xe74d('0x49')]['id'];}return db[_0xe74d('0x29')][_0xe74d('0x46')]({'where':{'id':_0x235719['params']['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x31e2fa,null))[_0xe74d('0x22')](saveUpdates(_0x235719[_0xe74d('0x49')],null))['then'](respondWithResult(_0x31e2fa,null))['catch'](handleError(_0x31e2fa,null));};exports[_0xe74d('0x23')]=function(_0x22bf49,_0x8f5c24){return db[_0xe74d('0x29')][_0xe74d('0x46')]({'where':{'id':_0x22bf49['params']['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x8f5c24,null))[_0xe74d('0x22')](removeEntity(_0x8f5c24,null))[_0xe74d('0x47')](handleError(_0x8f5c24,null));};exports[_0xe74d('0x51')]=function(_0x1adbf9,_0x29743d,_0x42ab0a){if(_0x1adbf9['body']['id']){delete _0x1adbf9[_0xe74d('0x49')]['id'];}return db[_0xe74d('0x29')][_0xe74d('0x46')]({'where':{'id':_0x1adbf9['params']['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x29743d,null))[_0xe74d('0x22')](function(_0xe4b05a){if(_0xe4b05a){_0x1adbf9['body'][_0xe74d('0x52')]=_0xe4b05a['id'];return db[_0xe74d('0x53')]['create'](_0x1adbf9['body']);}})['then'](respondWithResult(_0x29743d,null))[_0xe74d('0x47')](handleError(_0x29743d,null));};exports[_0xe74d('0x54')]=function(_0x481fa7,_0x5c8bf0,_0x47742f){if(_0x481fa7[_0xe74d('0x49')]['id']){delete _0x481fa7['body']['id'];}return db[_0xe74d('0x29')]['find']({'where':{'id':_0x481fa7[_0xe74d('0x43')]['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x5c8bf0,null))[_0xe74d('0x22')](function(_0x48e095){if(_0x48e095){_0x481fa7[_0xe74d('0x49')][_0xe74d('0x55')]=_0x48e095['id'];return db[_0xe74d('0x53')][_0xe74d('0x48')](_0x481fa7[_0xe74d('0x49')]);}})[_0xe74d('0x22')](respondWithResult(_0x5c8bf0,null))[_0xe74d('0x47')](handleError(_0x5c8bf0,null));};exports[_0xe74d('0x56')]=function(_0x2dbb69,_0x12532c,_0x2e8008){var _0x464a5e={};var _0x37b726={};var _0x15ebaf;var _0x29fd49;return db['Trigger'][_0xe74d('0x57')]({'where':{'id':_0x2dbb69[_0xe74d('0x43')]['id']}})['then'](handleEntityNotFound(_0x12532c,null))[_0xe74d('0x22')](function(_0x2c9936){if(_0x2c9936){_0x15ebaf=_0x2c9936;_0x37b726[_0xe74d('0x2e')]=_[_0xe74d('0x31')](db['Condition']['rawAttributes']);_0x37b726[_0xe74d('0x30')]=_['keys'](_0x2dbb69[_0xe74d('0x30')]);_0x37b726[_0xe74d('0x32')]=_['intersection'](_0x37b726[_0xe74d('0x2e')],_0x37b726[_0xe74d('0x30')]);_0x464a5e['attributes']=_[_0xe74d('0x33')](_0x37b726[_0xe74d('0x2e')],qs[_0xe74d('0x34')](_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x34')]));_0x464a5e[_0xe74d('0x44')]=_0x464a5e[_0xe74d('0x44')][_0xe74d('0x35')]?_0x464a5e[_0xe74d('0x44')]:_0x37b726[_0xe74d('0x2e')];_0x464a5e[_0xe74d('0x38')]=qs['sort'](_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x39')]);_0x464a5e[_0xe74d('0x3c')]=qs[_0xe74d('0x32')](_[_0xe74d('0x3a')](_0x2dbb69['query'],_0x37b726[_0xe74d('0x32')]));if(_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x3b')]){_0x464a5e[_0xe74d('0x3c')]=_[_0xe74d('0x3d')](_0x464a5e['where'],{'$or':_['map'](_0x464a5e[_0xe74d('0x44')],function(_0x1037cb){var _0x1c608d={};_0x1c608d[_0x1037cb]={'$like':'%'+_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x3b')]+'%'};return _0x1c608d;})});}_0x464a5e=_[_0xe74d('0x3d')]({},_0x464a5e,_0x2dbb69[_0xe74d('0x3f')]);return _0x15ebaf[_0xe74d('0x56')](_0x464a5e);}})[_0xe74d('0x22')](function(_0x329577){if(_0x329577){_0x29fd49=_0x329577[_0xe74d('0x35')];if(!_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x36')]('nolimit')){_0x464a5e[_0xe74d('0x19')]=qs[_0xe74d('0x19')](_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x19')]);_0x464a5e[_0xe74d('0x1b')]=qs[_0xe74d('0x1b')](_0x2dbb69[_0xe74d('0x30')][_0xe74d('0x1b')]);}return _0x15ebaf[_0xe74d('0x56')](_0x464a5e);}})[_0xe74d('0x22')](function(_0x5e7191){if(_0x5e7191){return _0x5e7191?{'count':_0x29fd49,'rows':_0x5e7191}:null;}})['then'](respondWithResult(_0x12532c,null))[_0xe74d('0x47')](handleError(_0x12532c,null));};exports[_0xe74d('0x58')]=function(_0x188e17,_0x520e7d,_0x25cc46){var _0x17ada8={};var _0x31baa9={};var _0x790133;var _0x27159f;return db[_0xe74d('0x29')][_0xe74d('0x57')]({'where':{'id':_0x188e17[_0xe74d('0x43')]['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x520e7d,null))['then'](function(_0x5da37e){if(_0x5da37e){_0x790133=_0x5da37e;_0x31baa9[_0xe74d('0x2e')]=_[_0xe74d('0x31')](db[_0xe74d('0x53')][_0xe74d('0x2a')]);_0x31baa9['query']=_[_0xe74d('0x31')](_0x188e17[_0xe74d('0x30')]);_0x31baa9[_0xe74d('0x32')]=_[_0xe74d('0x33')](_0x31baa9[_0xe74d('0x2e')],_0x31baa9['query']);_0x17ada8[_0xe74d('0x44')]=_[_0xe74d('0x33')](_0x31baa9['model'],qs['fields'](_0x188e17[_0xe74d('0x30')][_0xe74d('0x34')]));_0x17ada8['attributes']=_0x17ada8['attributes']['length']?_0x17ada8[_0xe74d('0x44')]:_0x31baa9[_0xe74d('0x2e')];_0x17ada8[_0xe74d('0x38')]=qs[_0xe74d('0x39')](_0x188e17[_0xe74d('0x30')]['sort']);_0x17ada8[_0xe74d('0x3c')]=qs[_0xe74d('0x32')](_[_0xe74d('0x3a')](_0x188e17[_0xe74d('0x30')],_0x31baa9[_0xe74d('0x32')]));if(_0x188e17['query'][_0xe74d('0x3b')]){_0x17ada8[_0xe74d('0x3c')]=_[_0xe74d('0x3d')](_0x17ada8[_0xe74d('0x3c')],{'$or':_['map'](_0x17ada8[_0xe74d('0x44')],function(_0x550216){var _0x322a7b={};_0x322a7b[_0x550216]={'$like':'%'+_0x188e17[_0xe74d('0x30')][_0xe74d('0x3b')]+'%'};return _0x322a7b;})});}_0x17ada8=_[_0xe74d('0x3d')]({},_0x17ada8,_0x188e17[_0xe74d('0x3f')]);return _0x790133[_0xe74d('0x58')](_0x17ada8);}})['then'](function(_0x42ffb4){if(_0x42ffb4){_0x27159f=_0x42ffb4['length'];if(!_0x188e17['query'][_0xe74d('0x36')](_0xe74d('0x37'))){_0x17ada8[_0xe74d('0x19')]=qs['limit'](_0x188e17[_0xe74d('0x30')][_0xe74d('0x19')]);_0x17ada8[_0xe74d('0x1b')]=qs['offset'](_0x188e17['query'][_0xe74d('0x1b')]);}return _0x790133['getAnyConditions'](_0x17ada8);}})['then'](function(_0x3be732){if(_0x3be732){return _0x3be732?{'count':_0x27159f,'rows':_0x3be732}:null;}})[_0xe74d('0x22')](respondWithResult(_0x520e7d,null))[_0xe74d('0x47')](handleError(_0x520e7d,null));};exports[_0xe74d('0x59')]=function(_0x28fd67,_0x466ccc,_0xf845e8){if(_0x28fd67['body']['id']){delete _0x28fd67[_0xe74d('0x49')]['id'];}return db[_0xe74d('0x29')][_0xe74d('0x46')]({'where':{'id':_0x28fd67[_0xe74d('0x43')]['id']}})['then'](handleEntityNotFound(_0x466ccc,null))[_0xe74d('0x22')](function(_0x13754a){if(_0x13754a){_0x28fd67['body']['TriggerId']=_0x13754a['id'];return db['Action'][_0xe74d('0x48')](_0x28fd67[_0xe74d('0x49')]);}})[_0xe74d('0x22')](respondWithResult(_0x466ccc,null))[_0xe74d('0x47')](handleError(_0x466ccc,null));};exports[_0xe74d('0x5a')]=function(_0x348035,_0x26b92f,_0x34c267){var _0x5bcb86={};var _0x67bcca={};var _0x579184;var _0x1f5de6;return db[_0xe74d('0x29')][_0xe74d('0x57')]({'where':{'id':_0x348035['params']['id']}})[_0xe74d('0x22')](handleEntityNotFound(_0x26b92f,null))[_0xe74d('0x22')](function(_0x3a5f0f){if(_0x3a5f0f){_0x579184=_0x3a5f0f;_0x67bcca['model']=_[_0xe74d('0x31')](db[_0xe74d('0x5b')][_0xe74d('0x2a')]);_0x67bcca[_0xe74d('0x30')]=_['keys'](_0x348035['query']);_0x67bcca['filters']=_['intersection'](_0x67bcca[_0xe74d('0x2e')],_0x67bcca['query']);_0x5bcb86['attributes']=_['intersection'](_0x67bcca[_0xe74d('0x2e')],qs[_0xe74d('0x34')](_0x348035[_0xe74d('0x30')]['fields']));_0x5bcb86[_0xe74d('0x44')]=_0x5bcb86[_0xe74d('0x44')][_0xe74d('0x35')]?_0x5bcb86[_0xe74d('0x44')]:_0x67bcca[_0xe74d('0x2e')];_0x5bcb86[_0xe74d('0x38')]=qs[_0xe74d('0x39')](_0x348035['query'][_0xe74d('0x39')]);_0x5bcb86['where']=qs[_0xe74d('0x32')](_[_0xe74d('0x3a')](_0x348035[_0xe74d('0x30')],_0x67bcca[_0xe74d('0x32')]));if(_0x348035[_0xe74d('0x30')]['filter']){_0x5bcb86[_0xe74d('0x3c')]=_[_0xe74d('0x3d')](_0x5bcb86[_0xe74d('0x3c')],{'$or':_[_0xe74d('0x2f')](_0x5bcb86[_0xe74d('0x44')],function(_0x515334){var _0xf23f8b={};_0xf23f8b[_0x515334]={'$like':'%'+_0x348035[_0xe74d('0x30')][_0xe74d('0x3b')]+'%'};return _0xf23f8b;})});}_0x5bcb86=_[_0xe74d('0x3d')]({},_0x5bcb86,_0x348035['options']);return _0x579184[_0xe74d('0x5a')](_0x5bcb86);}})[_0xe74d('0x22')](function(_0x544eca){if(_0x544eca){_0x1f5de6=_0x544eca[_0xe74d('0x35')];if(!_0x348035[_0xe74d('0x30')][_0xe74d('0x36')](_0xe74d('0x37'))){_0x5bcb86['limit']=qs['limit'](_0x348035[_0xe74d('0x30')]['limit']);_0x5bcb86[_0xe74d('0x1b')]=qs[_0xe74d('0x1b')](_0x348035['query'][_0xe74d('0x1b')]);}return _0x579184[_0xe74d('0x5a')](_0x5bcb86);}})[_0xe74d('0x22')](function(_0x454523){if(_0x454523){return _0x454523?{'count':_0x1f5de6,'rows':_0x454523}:null;}})[_0xe74d('0x22')](respondWithResult(_0x26b92f,null))[_0xe74d('0x47')](handleError(_0x26b92f,null));}; \ No newline at end of file +var _0x2d16=['eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','Triggers','UserProfileResource','error','stack','index','map','Trigger','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','params','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','length','getAnyConditions','addAction','Action','getActions'];(function(_0x20be43,_0x2ced25){var _0x2d5515=function(_0x43fe37){while(--_0x43fe37){_0x20be43['push'](_0x20be43['shift']());}};_0x2d5515(++_0x2ced25);}(_0x2d16,0x1c2));var _0x62d1=function(_0x57a785,_0x3e6c8f){_0x57a785=_0x57a785-0x0;var _0x36bad0=_0x2d16[_0x57a785];return _0x36bad0;};'use strict';var emlformat=require(_0x62d1('0x0'));var rimraf=require(_0x62d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62d1('0x2'));var rp=require('request-promise');var moment=require(_0x62d1('0x3'));var BPromise=require(_0x62d1('0x4'));var Mustache=require('mustache');var util=require(_0x62d1('0x5'));var path=require(_0x62d1('0x6'));var sox=require(_0x62d1('0x7'));var csv=require(_0x62d1('0x8'));var ejs=require(_0x62d1('0x9'));var fs=require('fs');var fs_extra=require(_0x62d1('0xa'));var _=require(_0x62d1('0xb'));var squel=require('squel');var crypto=require(_0x62d1('0xc'));var jsforce=require(_0x62d1('0xd'));var deskjs=require(_0x62d1('0xe'));var toCsv=require(_0x62d1('0x8'));var querystring=require(_0x62d1('0xf'));var Papa=require(_0x62d1('0x10'));var Redis=require(_0x62d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62d1('0x12'));var as=require(_0x62d1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62d1('0x14'))(_0x62d1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x62d1('0x16'))['db'];function respondWithStatusCode(_0x4ecfa6,_0x46535c){_0x46535c=_0x46535c||0xcc;return function(_0x3720d3){if(_0x3720d3){return _0x4ecfa6['sendStatus'](_0x46535c);}return _0x4ecfa6[_0x62d1('0x17')](_0x46535c)['end']();};}function respondWithResult(_0x174a23,_0x3566aa){_0x3566aa=_0x3566aa||0xc8;return function(_0x212187){if(_0x212187){return _0x174a23[_0x62d1('0x17')](_0x3566aa)[_0x62d1('0x18')](_0x212187);}};}function respondWithFilteredResult(_0x555711,_0x190bad){return function(_0x3554d5){if(_0x3554d5){var _0x2cf8b0=typeof _0x190bad['offset']==='undefined'&&typeof _0x190bad['limit']===_0x62d1('0x19');var _0xdc28e2=_0x3554d5[_0x62d1('0x1a')];var _0x171050=_0x2cf8b0?0x0:_0x190bad[_0x62d1('0x1b')];var _0x5eb10f=_0x2cf8b0?_0x3554d5[_0x62d1('0x1a')]:_0x190bad['offset']+_0x190bad[_0x62d1('0x1c')];var _0x9266a7;if(_0x5eb10f>=_0xdc28e2){_0x5eb10f=_0xdc28e2;_0x9266a7=0xc8;}else{_0x9266a7=0xce;}_0x555711[_0x62d1('0x17')](_0x9266a7);return _0x555711[_0x62d1('0x1d')](_0x62d1('0x1e'),_0x171050+'-'+_0x5eb10f+'/'+_0xdc28e2)[_0x62d1('0x18')](_0x3554d5);}return null;};}function patchUpdates(_0x14204c){return function(_0x437d8e){try{jsonpatch[_0x62d1('0x1f')](_0x437d8e,_0x14204c,!![]);}catch(_0x16e35d){return BPromise['reject'](_0x16e35d);}return _0x437d8e['save']();};}function saveUpdates(_0x243fc4,_0x52b27b){return function(_0x33664b){if(_0x33664b){return _0x33664b[_0x62d1('0x20')](_0x243fc4)[_0x62d1('0x21')](function(_0x3d5752){return _0x3d5752;});}return null;};}function removeEntity(_0x489b79,_0x283bfa){return function(_0x22a810){if(_0x22a810){return _0x22a810[_0x62d1('0x22')]()[_0x62d1('0x21')](function(){var _0x3ec9a2=_0x22a810['get']({'plain':!![]});var _0x1b2cab=_0x62d1('0x23');return db[_0x62d1('0x24')][_0x62d1('0x22')]({'where':{'type':_0x1b2cab,'resourceId':_0x3ec9a2['id']}})[_0x62d1('0x21')](function(){return _0x22a810;});})[_0x62d1('0x21')](function(){_0x489b79['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12756c,_0x531d32){return function(_0x43462c){if(!_0x43462c){_0x12756c['sendStatus'](0x194);}return _0x43462c;};}function handleError(_0x36b74e,_0x95bfd4){_0x95bfd4=_0x95bfd4||0x1f4;return function(_0xb169ea){logger[_0x62d1('0x25')](_0xb169ea[_0x62d1('0x26')]);if(_0xb169ea['name']){delete _0xb169ea['name'];}_0x36b74e['status'](_0x95bfd4)['send'](_0xb169ea);};}exports[_0x62d1('0x27')]=function(_0x1ac747,_0x3851b0){var _0x283b1d={},_0x17bd6b={},_0x4b72f1={'count':0x0,'rows':[]};var _0x34bbed=_[_0x62d1('0x28')](db[_0x62d1('0x29')]['rawAttributes'],function(_0x5b1c5d){return{'name':_0x5b1c5d[_0x62d1('0x2a')],'type':_0x5b1c5d[_0x62d1('0x2b')][_0x62d1('0x2c')]};});_0x17bd6b['model']=_[_0x62d1('0x28')](_0x34bbed,_0x62d1('0x2d'));_0x17bd6b['query']=_[_0x62d1('0x2e')](_0x1ac747[_0x62d1('0x2f')]);_0x17bd6b[_0x62d1('0x30')]=_[_0x62d1('0x31')](_0x17bd6b[_0x62d1('0x32')],_0x17bd6b[_0x62d1('0x2f')]);_0x283b1d[_0x62d1('0x33')]=_[_0x62d1('0x31')](_0x17bd6b[_0x62d1('0x32')],qs[_0x62d1('0x34')](_0x1ac747[_0x62d1('0x2f')][_0x62d1('0x34')]));_0x283b1d[_0x62d1('0x33')]=_0x283b1d[_0x62d1('0x33')]['length']?_0x283b1d[_0x62d1('0x33')]:_0x17bd6b[_0x62d1('0x32')];if(!_0x1ac747[_0x62d1('0x2f')][_0x62d1('0x35')](_0x62d1('0x36'))){_0x283b1d[_0x62d1('0x1c')]=qs[_0x62d1('0x1c')](_0x1ac747['query']['limit']);_0x283b1d['offset']=qs[_0x62d1('0x1b')](_0x1ac747[_0x62d1('0x2f')][_0x62d1('0x1b')]);}_0x283b1d[_0x62d1('0x37')]=qs[_0x62d1('0x38')](_0x1ac747['query']['sort']);_0x283b1d[_0x62d1('0x39')]=qs['filters'](_[_0x62d1('0x3a')](_0x1ac747[_0x62d1('0x2f')],_0x17bd6b[_0x62d1('0x30')]),_0x34bbed);if(_0x1ac747['query'][_0x62d1('0x3b')]){_0x283b1d[_0x62d1('0x39')]=_['merge'](_0x283b1d[_0x62d1('0x39')],{'$or':_['map'](_0x34bbed,function(_0x2eced3){if(_0x2eced3[_0x62d1('0x2b')]!==_0x62d1('0x3c')){var _0x2e77a4={};_0x2e77a4[_0x2eced3[_0x62d1('0x2d')]]={'$like':'%'+_0x1ac747[_0x62d1('0x2f')][_0x62d1('0x3b')]+'%'};return _0x2e77a4;}})});}_0x283b1d=_[_0x62d1('0x3d')]({},_0x283b1d,_0x1ac747[_0x62d1('0x3e')]);var _0x5d28ee={'where':_0x283b1d[_0x62d1('0x39')]};return db['Trigger'][_0x62d1('0x1a')](_0x5d28ee)[_0x62d1('0x21')](function(_0x1b7917){_0x4b72f1[_0x62d1('0x1a')]=_0x1b7917;if(_0x1ac747[_0x62d1('0x2f')][_0x62d1('0x3f')]){_0x283b1d[_0x62d1('0x40')]=[{'all':!![]}];}return db['Trigger'][_0x62d1('0x41')](_0x283b1d);})['then'](function(_0x2accbc){_0x4b72f1['rows']=_0x2accbc;return _0x4b72f1;})[_0x62d1('0x21')](respondWithFilteredResult(_0x3851b0,_0x283b1d))[_0x62d1('0x42')](handleError(_0x3851b0,null));};exports[_0x62d1('0x43')]=function(_0x1bf2c0,_0x57132f){var _0x1fb648={'raw':![],'where':{'id':_0x1bf2c0['params']['id']}},_0x19a3ab={};_0x19a3ab[_0x62d1('0x32')]=_[_0x62d1('0x2e')](db[_0x62d1('0x29')][_0x62d1('0x44')]);_0x19a3ab[_0x62d1('0x2f')]=_[_0x62d1('0x2e')](_0x1bf2c0[_0x62d1('0x2f')]);_0x19a3ab[_0x62d1('0x30')]=_[_0x62d1('0x31')](_0x19a3ab[_0x62d1('0x32')],_0x19a3ab[_0x62d1('0x2f')]);_0x1fb648[_0x62d1('0x33')]=_[_0x62d1('0x31')](_0x19a3ab['model'],qs[_0x62d1('0x34')](_0x1bf2c0[_0x62d1('0x2f')]['fields']));_0x1fb648[_0x62d1('0x33')]=_0x1fb648['attributes']['length']?_0x1fb648[_0x62d1('0x33')]:_0x19a3ab[_0x62d1('0x32')];if(_0x1bf2c0[_0x62d1('0x2f')][_0x62d1('0x3f')]){_0x1fb648[_0x62d1('0x40')]=[{'all':!![]}];}_0x1fb648=_[_0x62d1('0x3d')]({},_0x1fb648,_0x1bf2c0[_0x62d1('0x3e')]);return db[_0x62d1('0x29')]['find'](_0x1fb648)[_0x62d1('0x21')](handleEntityNotFound(_0x57132f,null))[_0x62d1('0x21')](respondWithResult(_0x57132f,null))[_0x62d1('0x42')](handleError(_0x57132f,null));};exports['create']=function(_0x4a2180,_0x1d3399){return db[_0x62d1('0x29')][_0x62d1('0x45')](_0x4a2180['body'],{})['then'](function(_0x314805){var _0x104fbd=_0x4a2180[_0x62d1('0x46')][_0x62d1('0x47')]({'plain':!![]});if(!_0x104fbd)throw new Error(_0x62d1('0x48'));if(_0x104fbd[_0x62d1('0x49')]===_0x62d1('0x46')){var _0x18c206=_0x314805[_0x62d1('0x47')]({'plain':!![]});var _0x25f8a6='Triggers';return db['UserProfileSection'][_0x62d1('0x4a')]({'where':{'name':_0x25f8a6,'userProfileId':_0x104fbd[_0x62d1('0x4b')]},'raw':!![]})[_0x62d1('0x21')](function(_0xc23178){if(_0xc23178&&_0xc23178[_0x62d1('0x4c')]===0x0){return db[_0x62d1('0x24')]['create']({'name':_0x18c206['name'],'resourceId':_0x18c206['id'],'type':_0xc23178[_0x62d1('0x2d')],'sectionId':_0xc23178['id']},{})[_0x62d1('0x21')](function(){return _0x314805;});}else{return _0x314805;}})[_0x62d1('0x42')](function(_0x57bb7f){logger[_0x62d1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57bb7f);throw _0x57bb7f;});}return _0x314805;})[_0x62d1('0x21')](respondWithResult(_0x1d3399,0xc9))[_0x62d1('0x42')](handleError(_0x1d3399,null));};exports[_0x62d1('0x20')]=function(_0x580707,_0x418136){if(_0x580707['body']['id']){delete _0x580707['body']['id'];}return db[_0x62d1('0x29')]['find']({'where':{'id':_0x580707[_0x62d1('0x4d')]['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x418136,null))['then'](saveUpdates(_0x580707[_0x62d1('0x4e')],null))[_0x62d1('0x21')](respondWithResult(_0x418136,null))[_0x62d1('0x42')](handleError(_0x418136,null));};exports[_0x62d1('0x22')]=function(_0x2522e5,_0x1b2723){return db[_0x62d1('0x29')][_0x62d1('0x4a')]({'where':{'id':_0x2522e5[_0x62d1('0x4d')]['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x1b2723,null))[_0x62d1('0x21')](removeEntity(_0x1b2723,null))['catch'](handleError(_0x1b2723,null));};exports[_0x62d1('0x4f')]=function(_0x21a429,_0x2bba4f,_0xb153f){if(_0x21a429['body']['id']){delete _0x21a429[_0x62d1('0x4e')]['id'];}return db[_0x62d1('0x29')][_0x62d1('0x4a')]({'where':{'id':_0x21a429[_0x62d1('0x4d')]['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x2bba4f,null))[_0x62d1('0x21')](function(_0x47b11a){if(_0x47b11a){_0x21a429['body'][_0x62d1('0x50')]=_0x47b11a['id'];return db[_0x62d1('0x51')][_0x62d1('0x45')](_0x21a429[_0x62d1('0x4e')]);}})[_0x62d1('0x21')](respondWithResult(_0x2bba4f,null))['catch'](handleError(_0x2bba4f,null));};exports[_0x62d1('0x52')]=function(_0x4063ca,_0x3b1d02,_0x4453e4){if(_0x4063ca[_0x62d1('0x4e')]['id']){delete _0x4063ca[_0x62d1('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4063ca['params']['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x3b1d02,null))[_0x62d1('0x21')](function(_0x43a84a){if(_0x43a84a){_0x4063ca[_0x62d1('0x4e')]['TriggerAnyId']=_0x43a84a['id'];return db[_0x62d1('0x51')]['create'](_0x4063ca[_0x62d1('0x4e')]);}})[_0x62d1('0x21')](respondWithResult(_0x3b1d02,null))[_0x62d1('0x42')](handleError(_0x3b1d02,null));};exports[_0x62d1('0x53')]=function(_0x975ffb,_0x10d314,_0x3d77a4){var _0x5a129a={};var _0x19d3cb={};var _0x34fe89;var _0x1a9ce2;return db[_0x62d1('0x29')][_0x62d1('0x54')]({'where':{'id':_0x975ffb['params']['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x10d314,null))[_0x62d1('0x21')](function(_0x2d1177){if(_0x2d1177){_0x34fe89=_0x2d1177;_0x19d3cb[_0x62d1('0x32')]=_[_0x62d1('0x2e')](db['Condition'][_0x62d1('0x44')]);_0x19d3cb[_0x62d1('0x2f')]=_[_0x62d1('0x2e')](_0x975ffb[_0x62d1('0x2f')]);_0x19d3cb[_0x62d1('0x30')]=_['intersection'](_0x19d3cb['model'],_0x19d3cb[_0x62d1('0x2f')]);_0x5a129a[_0x62d1('0x33')]=_['intersection'](_0x19d3cb[_0x62d1('0x32')],qs['fields'](_0x975ffb[_0x62d1('0x2f')][_0x62d1('0x34')]));_0x5a129a[_0x62d1('0x33')]=_0x5a129a['attributes'][_0x62d1('0x55')]?_0x5a129a['attributes']:_0x19d3cb[_0x62d1('0x32')];_0x5a129a[_0x62d1('0x37')]=qs[_0x62d1('0x38')](_0x975ffb[_0x62d1('0x2f')]['sort']);_0x5a129a['where']=qs[_0x62d1('0x30')](_[_0x62d1('0x3a')](_0x975ffb['query'],_0x19d3cb['filters']));if(_0x975ffb[_0x62d1('0x2f')][_0x62d1('0x3b')]){_0x5a129a[_0x62d1('0x39')]=_[_0x62d1('0x3d')](_0x5a129a[_0x62d1('0x39')],{'$or':_['map'](_0x5a129a['attributes'],function(_0x5edfa6){var _0x32cb2c={};_0x32cb2c[_0x5edfa6]={'$like':'%'+_0x975ffb[_0x62d1('0x2f')]['filter']+'%'};return _0x32cb2c;})});}_0x5a129a=_['merge']({},_0x5a129a,_0x975ffb[_0x62d1('0x3e')]);return _0x34fe89[_0x62d1('0x53')](_0x5a129a);}})[_0x62d1('0x21')](function(_0x2253fb){if(_0x2253fb){_0x1a9ce2=_0x2253fb['length'];if(!_0x975ffb[_0x62d1('0x2f')]['hasOwnProperty']('nolimit')){_0x5a129a[_0x62d1('0x1c')]=qs[_0x62d1('0x1c')](_0x975ffb[_0x62d1('0x2f')][_0x62d1('0x1c')]);_0x5a129a['offset']=qs[_0x62d1('0x1b')](_0x975ffb[_0x62d1('0x2f')][_0x62d1('0x1b')]);}return _0x34fe89[_0x62d1('0x53')](_0x5a129a);}})['then'](function(_0x265d29){if(_0x265d29){return _0x265d29?{'count':_0x1a9ce2,'rows':_0x265d29}:null;}})[_0x62d1('0x21')](respondWithResult(_0x10d314,null))['catch'](handleError(_0x10d314,null));};exports['getAnyConditions']=function(_0x3e8535,_0x1f11ff,_0x16af21){var _0x73aac6={};var _0x12d4c3={};var _0x442f87;var _0x133734;return db[_0x62d1('0x29')][_0x62d1('0x54')]({'where':{'id':_0x3e8535['params']['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x1f11ff,null))['then'](function(_0xc4041c){if(_0xc4041c){_0x442f87=_0xc4041c;_0x12d4c3[_0x62d1('0x32')]=_['keys'](db[_0x62d1('0x51')][_0x62d1('0x44')]);_0x12d4c3[_0x62d1('0x2f')]=_[_0x62d1('0x2e')](_0x3e8535[_0x62d1('0x2f')]);_0x12d4c3['filters']=_[_0x62d1('0x31')](_0x12d4c3[_0x62d1('0x32')],_0x12d4c3['query']);_0x73aac6[_0x62d1('0x33')]=_[_0x62d1('0x31')](_0x12d4c3[_0x62d1('0x32')],qs[_0x62d1('0x34')](_0x3e8535[_0x62d1('0x2f')][_0x62d1('0x34')]));_0x73aac6[_0x62d1('0x33')]=_0x73aac6[_0x62d1('0x33')]['length']?_0x73aac6[_0x62d1('0x33')]:_0x12d4c3[_0x62d1('0x32')];_0x73aac6[_0x62d1('0x37')]=qs[_0x62d1('0x38')](_0x3e8535[_0x62d1('0x2f')][_0x62d1('0x38')]);_0x73aac6[_0x62d1('0x39')]=qs['filters'](_['pick'](_0x3e8535[_0x62d1('0x2f')],_0x12d4c3[_0x62d1('0x30')]));if(_0x3e8535['query']['filter']){_0x73aac6[_0x62d1('0x39')]=_[_0x62d1('0x3d')](_0x73aac6[_0x62d1('0x39')],{'$or':_[_0x62d1('0x28')](_0x73aac6[_0x62d1('0x33')],function(_0xc2733e){var _0x253f11={};_0x253f11[_0xc2733e]={'$like':'%'+_0x3e8535[_0x62d1('0x2f')][_0x62d1('0x3b')]+'%'};return _0x253f11;})});}_0x73aac6=_[_0x62d1('0x3d')]({},_0x73aac6,_0x3e8535[_0x62d1('0x3e')]);return _0x442f87[_0x62d1('0x56')](_0x73aac6);}})[_0x62d1('0x21')](function(_0x2bb9ba){if(_0x2bb9ba){_0x133734=_0x2bb9ba[_0x62d1('0x55')];if(!_0x3e8535['query'][_0x62d1('0x35')](_0x62d1('0x36'))){_0x73aac6[_0x62d1('0x1c')]=qs[_0x62d1('0x1c')](_0x3e8535[_0x62d1('0x2f')][_0x62d1('0x1c')]);_0x73aac6[_0x62d1('0x1b')]=qs[_0x62d1('0x1b')](_0x3e8535[_0x62d1('0x2f')]['offset']);}return _0x442f87[_0x62d1('0x56')](_0x73aac6);}})['then'](function(_0xed0fae){if(_0xed0fae){return _0xed0fae?{'count':_0x133734,'rows':_0xed0fae}:null;}})['then'](respondWithResult(_0x1f11ff,null))[_0x62d1('0x42')](handleError(_0x1f11ff,null));};exports[_0x62d1('0x57')]=function(_0x433f01,_0x5dade2,_0x105ea7){if(_0x433f01[_0x62d1('0x4e')]['id']){delete _0x433f01[_0x62d1('0x4e')]['id'];}return db[_0x62d1('0x29')][_0x62d1('0x4a')]({'where':{'id':_0x433f01[_0x62d1('0x4d')]['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x5dade2,null))[_0x62d1('0x21')](function(_0x430e1a){if(_0x430e1a){_0x433f01[_0x62d1('0x4e')]['TriggerId']=_0x430e1a['id'];return db[_0x62d1('0x58')][_0x62d1('0x45')](_0x433f01[_0x62d1('0x4e')]);}})['then'](respondWithResult(_0x5dade2,null))[_0x62d1('0x42')](handleError(_0x5dade2,null));};exports[_0x62d1('0x59')]=function(_0x126a65,_0x59f150,_0x892e){var _0x1386f9={};var _0x28ac67={};var _0x552d7a;var _0x3d771e;return db[_0x62d1('0x29')][_0x62d1('0x54')]({'where':{'id':_0x126a65[_0x62d1('0x4d')]['id']}})[_0x62d1('0x21')](handleEntityNotFound(_0x59f150,null))[_0x62d1('0x21')](function(_0x9d4c9){if(_0x9d4c9){_0x552d7a=_0x9d4c9;_0x28ac67[_0x62d1('0x32')]=_['keys'](db['Action'][_0x62d1('0x44')]);_0x28ac67['query']=_[_0x62d1('0x2e')](_0x126a65[_0x62d1('0x2f')]);_0x28ac67[_0x62d1('0x30')]=_[_0x62d1('0x31')](_0x28ac67[_0x62d1('0x32')],_0x28ac67['query']);_0x1386f9['attributes']=_[_0x62d1('0x31')](_0x28ac67[_0x62d1('0x32')],qs[_0x62d1('0x34')](_0x126a65[_0x62d1('0x2f')][_0x62d1('0x34')]));_0x1386f9[_0x62d1('0x33')]=_0x1386f9[_0x62d1('0x33')][_0x62d1('0x55')]?_0x1386f9[_0x62d1('0x33')]:_0x28ac67[_0x62d1('0x32')];_0x1386f9[_0x62d1('0x37')]=qs[_0x62d1('0x38')](_0x126a65[_0x62d1('0x2f')][_0x62d1('0x38')]);_0x1386f9[_0x62d1('0x39')]=qs[_0x62d1('0x30')](_['pick'](_0x126a65[_0x62d1('0x2f')],_0x28ac67['filters']));if(_0x126a65[_0x62d1('0x2f')][_0x62d1('0x3b')]){_0x1386f9[_0x62d1('0x39')]=_[_0x62d1('0x3d')](_0x1386f9[_0x62d1('0x39')],{'$or':_['map'](_0x1386f9['attributes'],function(_0xe27505){var _0x141141={};_0x141141[_0xe27505]={'$like':'%'+_0x126a65[_0x62d1('0x2f')][_0x62d1('0x3b')]+'%'};return _0x141141;})});}_0x1386f9=_[_0x62d1('0x3d')]({},_0x1386f9,_0x126a65[_0x62d1('0x3e')]);return _0x552d7a[_0x62d1('0x59')](_0x1386f9);}})[_0x62d1('0x21')](function(_0x2f2302){if(_0x2f2302){_0x3d771e=_0x2f2302['length'];if(!_0x126a65[_0x62d1('0x2f')][_0x62d1('0x35')]('nolimit')){_0x1386f9['limit']=qs[_0x62d1('0x1c')](_0x126a65[_0x62d1('0x2f')]['limit']);_0x1386f9[_0x62d1('0x1b')]=qs[_0x62d1('0x1b')](_0x126a65[_0x62d1('0x2f')]['offset']);}return _0x552d7a[_0x62d1('0x59')](_0x1386f9);}})[_0x62d1('0x21')](function(_0x57f570){if(_0x57f570){return _0x57f570?{'count':_0x3d771e,'rows':_0x57f570}:null;}})[_0x62d1('0x21')](respondWithResult(_0x59f150,null))[_0x62d1('0x42')](handleError(_0x59f150,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 3974241..76907f7 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 _0x8832=['lodash','util','moment','bluebird','request-promise','rimraf','./trigger.attributes','exports','define','tools_triggers'];(function(_0x541f4e,_0x1aaa66){var _0x48ad45=function(_0x4ae2c4){while(--_0x4ae2c4){_0x541f4e['push'](_0x541f4e['shift']());}};_0x48ad45(++_0x1aaa66);}(_0x8832,0x1f4));var _0x2883=function(_0x1649fe,_0x5916da){_0x1649fe=_0x1649fe-0x0;var _0x473a67=_0x8832[_0x1649fe];return _0x473a67;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('Trigger',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40b5=['bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment'];(function(_0x515bb6,_0x4fdf67){var _0x440f4c=function(_0x342fcb){while(--_0x342fcb){_0x515bb6['push'](_0x515bb6['shift']());}};_0x440f4c(++_0x4fdf67);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var logger=require(_0x540b('0x2'))(_0x540b('0x3'));var moment=require(_0x540b('0x4'));var BPromise=require(_0x540b('0x5'));var rp=require(_0x540b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x540b('0x7'));var config=require(_0x540b('0x8'));var attributes=require(_0x540b('0x9'));module[_0x540b('0xa')]=function(_0x5b75dc,_0x4e0a29){return _0x5b75dc[_0x540b('0xb')](_0x540b('0xc'),attributes,{'tableName':_0x540b('0xd'),'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 2e01ce0..a01d525 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 _0x8a99=['raw','where','map','include','attributes','model','GetTrigger','stringify','ShowTrigger','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trigger','findAll','options'];(function(_0x38d2a7,_0x1d06db){var _0x16313c=function(_0x22d625){while(--_0x22d625){_0x38d2a7['push'](_0x38d2a7['shift']());}};_0x16313c(++_0x1d06db);}(_0x8a99,0xf8));var _0x98a9=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x8a99[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require(_0x98a9('0x0'));var moment=require(_0x98a9('0x1'));var BPromise=require(_0x98a9('0x2'));var rs=require(_0x98a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x98a9('0x5'))('rpc');var config=require(_0x98a9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x98a9('0x7')][_0x98a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aad28,_0x57f534,_0x393c44){return new BPromise(function(_0x12a9c5,_0x3983cd){return client[_0x98a9('0x9')](_0x5aad28,_0x393c44)[_0x98a9('0xa')](function(_0x1b6116){logger[_0x98a9('0xb')](_0x98a9('0xc'),_0x57f534,_0x98a9('0xd'));logger[_0x98a9('0xe')](_0x98a9('0xf'),_0x57f534,_0x98a9('0xd'),JSON['stringify'](_0x1b6116));if(_0x1b6116[_0x98a9('0x10')]){if(_0x1b6116[_0x98a9('0x10')][_0x98a9('0x11')]===0x1f4){logger['error'](_0x98a9('0xc'),_0x57f534,_0x1b6116[_0x98a9('0x10')][_0x98a9('0x12')]);return _0x3983cd(_0x1b6116['error']['message']);}logger[_0x98a9('0x10')](_0x98a9('0xc'),_0x57f534,_0x1b6116[_0x98a9('0x10')]['message']);return _0x12a9c5(_0x1b6116[_0x98a9('0x10')]['message']);}else{logger[_0x98a9('0xb')](_0x98a9('0xc'),_0x57f534,'request\x20sent');_0x12a9c5(_0x1b6116[_0x98a9('0x13')][_0x98a9('0x12')]);}})[_0x98a9('0x14')](function(_0x5616cc){logger['error']('Trigger,\x20%s,\x20%s',_0x57f534,_0x5616cc);_0x3983cd(_0x5616cc);});});}exports['GetTrigger']=function(_0x2f2384){var _0x4e209d=this;return new Promise(function(_0x59cdb3,_0x3e165e){return db[_0x98a9('0x15')][_0x98a9('0x16')]({'raw':_0x2f2384['options']?_0x2f2384[_0x98a9('0x17')][_0x98a9('0x18')]===undefined?!![]:![]:!![],'where':_0x2f2384[_0x98a9('0x17')]?_0x2f2384[_0x98a9('0x17')][_0x98a9('0x19')]||null:null,'attributes':_0x2f2384['options']?_0x2f2384[_0x98a9('0x17')]['attributes']||null:null,'limit':_0x2f2384[_0x98a9('0x17')]?_0x2f2384[_0x98a9('0x17')]['limit']||null:null,'include':_0x2f2384[_0x98a9('0x17')]?_0x2f2384[_0x98a9('0x17')]['include']?_[_0x98a9('0x1a')](_0x2f2384[_0x98a9('0x17')][_0x98a9('0x1b')],function(_0x229d15){return{'model':db[_0x229d15['model']],'as':_0x229d15['as'],'attributes':_0x229d15[_0x98a9('0x1c')],'include':_0x229d15[_0x98a9('0x1b')]?_['map'](_0x229d15['include'],function(_0x5a68ca){return{'model':db[_0x5a68ca['model']],'as':_0x5a68ca['as'],'attributes':_0x5a68ca[_0x98a9('0x1c')],'include':_0x5a68ca['include']?_[_0x98a9('0x1a')](_0x5a68ca['include'],function(_0x1620da){return{'model':db[_0x1620da[_0x98a9('0x1d')]],'as':_0x1620da['as'],'attributes':_0x1620da[_0x98a9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x299f1f){logger['info'](_0x98a9('0x1e'),_0x2f2384);logger[_0x98a9('0xe')](_0x98a9('0x1e'),_0x2f2384,JSON[_0x98a9('0x1f')](_0x299f1f));_0x59cdb3(_0x299f1f);})[_0x98a9('0x14')](function(_0x2c9d53){logger[_0x98a9('0x10')]('GetTrigger',_0x2c9d53['message'],_0x2f2384);_0x3e165e(_0x4e209d[_0x98a9('0x10')](0x1f4,_0x2c9d53[_0x98a9('0x12')]));});});};exports[_0x98a9('0x20')]=function(_0x56ce54){var _0x462a9c=this;return new Promise(function(_0x23413f,_0x21fc99){return db['Trigger'][_0x98a9('0x21')]({'raw':_0x56ce54[_0x98a9('0x17')]?_0x56ce54[_0x98a9('0x17')][_0x98a9('0x18')]===undefined?!![]:![]:!![],'where':_0x56ce54[_0x98a9('0x17')]?_0x56ce54['options']['where']||null:null,'attributes':_0x56ce54[_0x98a9('0x17')]?_0x56ce54[_0x98a9('0x17')][_0x98a9('0x1c')]||null:null,'include':_0x56ce54[_0x98a9('0x17')]?_0x56ce54[_0x98a9('0x17')][_0x98a9('0x1b')]?_['map'](_0x56ce54[_0x98a9('0x17')][_0x98a9('0x1b')],function(_0x2d0ede){return{'model':db[_0x2d0ede['model']],'as':_0x2d0ede['as'],'attributes':_0x2d0ede[_0x98a9('0x1c')],'include':_0x2d0ede[_0x98a9('0x1b')]?_['map'](_0x2d0ede['include'],function(_0x596ed8){return{'model':db[_0x596ed8['model']],'as':_0x596ed8['as'],'attributes':_0x596ed8[_0x98a9('0x1c')],'include':_0x596ed8[_0x98a9('0x1b')]?_['map'](_0x596ed8['include'],function(_0x4ee15d){return{'model':db[_0x4ee15d[_0x98a9('0x1d')]],'as':_0x4ee15d['as'],'attributes':_0x4ee15d[_0x98a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x98a9('0xa')](function(_0x1e1571){logger[_0x98a9('0xb')](_0x98a9('0x20'),_0x56ce54);logger[_0x98a9('0xe')](_0x98a9('0x20'),_0x56ce54,JSON[_0x98a9('0x1f')](_0x1e1571));_0x23413f(_0x1e1571);})[_0x98a9('0x14')](function(_0x687d94){logger[_0x98a9('0x10')]('ShowTrigger',_0x687d94[_0x98a9('0x12')],_0x56ce54);_0x21fc99(_0x462a9c[_0x98a9('0x10')](0x1f4,_0x687d94[_0x98a9('0x12')]));});});}; \ No newline at end of file +var _0xdfe0=['ioredis','../../mysqldb','../../config/utils','jayson/promise','request','then','info','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','ShowTrigger','find','lodash','moment','bluebird'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0xdfe0,0x1ec));var _0x0dfe=function(_0x1fb0d7,_0x480e7a){_0x1fb0d7=_0x1fb0d7-0x0;var _0x4da9e9=_0xdfe0[_0x1fb0d7];return _0x4da9e9;};'use strict';var _=require(_0x0dfe('0x0'));var util=require('util');var moment=require(_0x0dfe('0x1'));var BPromise=require(_0x0dfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfe('0x3'));var db=require(_0x0dfe('0x4'))['db'];var utils=require(_0x0dfe('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0dfe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca60a,_0x200d00,_0x17e472){return new BPromise(function(_0x33a851,_0x311f1d){return client[_0x0dfe('0x7')](_0x4ca60a,_0x17e472)[_0x0dfe('0x8')](function(_0x3560ea){logger[_0x0dfe('0x9')]('Trigger,\x20%s,\x20%s',_0x200d00,'request\x20sent');logger['debug'](_0x0dfe('0xa'),_0x200d00,_0x0dfe('0xb'),JSON[_0x0dfe('0xc')](_0x3560ea));if(_0x3560ea[_0x0dfe('0xd')]){if(_0x3560ea[_0x0dfe('0xd')][_0x0dfe('0xe')]===0x1f4){logger[_0x0dfe('0xd')](_0x0dfe('0xf'),_0x200d00,_0x3560ea[_0x0dfe('0xd')][_0x0dfe('0x10')]);return _0x311f1d(_0x3560ea[_0x0dfe('0xd')][_0x0dfe('0x10')]);}logger['error'](_0x0dfe('0xf'),_0x200d00,_0x3560ea[_0x0dfe('0xd')][_0x0dfe('0x10')]);return _0x33a851(_0x3560ea[_0x0dfe('0xd')][_0x0dfe('0x10')]);}else{logger['info'](_0x0dfe('0xf'),_0x200d00,_0x0dfe('0xb'));_0x33a851(_0x3560ea[_0x0dfe('0x11')]['message']);}})['catch'](function(_0x584827){logger[_0x0dfe('0xd')](_0x0dfe('0xf'),_0x200d00,_0x584827);_0x311f1d(_0x584827);});});}exports[_0x0dfe('0x12')]=function(_0x400030){var _0x454028=this;return new Promise(function(_0x143421,_0x52bcdc){return db[_0x0dfe('0x13')][_0x0dfe('0x14')]({'raw':_0x400030[_0x0dfe('0x15')]?_0x400030['options'][_0x0dfe('0x16')]===undefined?!![]:![]:!![],'where':_0x400030[_0x0dfe('0x15')]?_0x400030['options'][_0x0dfe('0x17')]||null:null,'attributes':_0x400030[_0x0dfe('0x15')]?_0x400030[_0x0dfe('0x15')][_0x0dfe('0x18')]||null:null,'limit':_0x400030[_0x0dfe('0x15')]?_0x400030['options'][_0x0dfe('0x19')]||null:null,'include':_0x400030[_0x0dfe('0x15')]?_0x400030[_0x0dfe('0x15')][_0x0dfe('0x1a')]?_['map'](_0x400030[_0x0dfe('0x15')][_0x0dfe('0x1a')],function(_0x134f48){return{'model':db[_0x134f48[_0x0dfe('0x1b')]],'as':_0x134f48['as'],'attributes':_0x134f48[_0x0dfe('0x18')],'include':_0x134f48[_0x0dfe('0x1a')]?_['map'](_0x134f48['include'],function(_0x215409){return{'model':db[_0x215409[_0x0dfe('0x1b')]],'as':_0x215409['as'],'attributes':_0x215409['attributes'],'include':_0x215409[_0x0dfe('0x1a')]?_[_0x0dfe('0x1c')](_0x215409['include'],function(_0x323f73){return{'model':db[_0x323f73[_0x0dfe('0x1b')]],'as':_0x323f73['as'],'attributes':_0x323f73['attributes']};}):[]};}):[]};}):[]:[]})[_0x0dfe('0x8')](function(_0x4ecb34){logger[_0x0dfe('0x9')](_0x0dfe('0x12'),_0x400030);logger[_0x0dfe('0x1d')](_0x0dfe('0x12'),_0x400030,JSON[_0x0dfe('0xc')](_0x4ecb34));_0x143421(_0x4ecb34);})[_0x0dfe('0x1e')](function(_0x3f63ec){logger[_0x0dfe('0xd')](_0x0dfe('0x12'),_0x3f63ec[_0x0dfe('0x10')],_0x400030);_0x52bcdc(_0x454028[_0x0dfe('0xd')](0x1f4,_0x3f63ec[_0x0dfe('0x10')]));});});};exports[_0x0dfe('0x1f')]=function(_0x1b360c){var _0x1f93b3=this;return new Promise(function(_0x2fb6d1,_0x28f694){return db['Trigger'][_0x0dfe('0x20')]({'raw':_0x1b360c[_0x0dfe('0x15')]?_0x1b360c[_0x0dfe('0x15')][_0x0dfe('0x16')]===undefined?!![]:![]:!![],'where':_0x1b360c[_0x0dfe('0x15')]?_0x1b360c['options'][_0x0dfe('0x17')]||null:null,'attributes':_0x1b360c[_0x0dfe('0x15')]?_0x1b360c[_0x0dfe('0x15')][_0x0dfe('0x18')]||null:null,'include':_0x1b360c[_0x0dfe('0x15')]?_0x1b360c[_0x0dfe('0x15')][_0x0dfe('0x1a')]?_['map'](_0x1b360c[_0x0dfe('0x15')]['include'],function(_0x617723){return{'model':db[_0x617723[_0x0dfe('0x1b')]],'as':_0x617723['as'],'attributes':_0x617723[_0x0dfe('0x18')],'include':_0x617723[_0x0dfe('0x1a')]?_['map'](_0x617723[_0x0dfe('0x1a')],function(_0x2a2fe9){return{'model':db[_0x2a2fe9[_0x0dfe('0x1b')]],'as':_0x2a2fe9['as'],'attributes':_0x2a2fe9[_0x0dfe('0x18')],'include':_0x2a2fe9[_0x0dfe('0x1a')]?_[_0x0dfe('0x1c')](_0x2a2fe9[_0x0dfe('0x1a')],function(_0x3cf9f6){return{'model':db[_0x3cf9f6[_0x0dfe('0x1b')]],'as':_0x3cf9f6['as'],'attributes':_0x3cf9f6[_0x0dfe('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x297414){logger[_0x0dfe('0x9')](_0x0dfe('0x1f'),_0x1b360c);logger[_0x0dfe('0x1d')](_0x0dfe('0x1f'),_0x1b360c,JSON[_0x0dfe('0xc')](_0x297414));_0x2fb6d1(_0x297414);})[_0x0dfe('0x1e')](function(_0x40aea7){logger[_0x0dfe('0xd')](_0x0dfe('0x1f'),_0x40aea7[_0x0dfe('0x10')],_0x1b360c);_0x28f694(_0x1f93b3['error'](0x1f4,_0x40aea7[_0x0dfe('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 847e4f9..1b24cdd 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 _0x73b7=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','multer','util','path'];(function(_0x341eef,_0x52a7b2){var _0x1e0f90=function(_0x222201){while(--_0x222201){_0x341eef['push'](_0x341eef['shift']());}};_0x1e0f90(++_0x52a7b2);}(_0x73b7,0x6b));var _0x773b=function(_0x49ab4c,_0x5afd01){_0x49ab4c=_0x49ab4c-0x0;var _0x36c14b=_0x73b7[_0x49ab4c];return _0x36c14b;};'use strict';var multer=require(_0x773b('0x0'));var util=require(_0x773b('0x1'));var path=require(_0x773b('0x2'));var timeout=require(_0x773b('0x3'));var express=require(_0x773b('0x4'));var router=express['Router']();var fs_extra=require(_0x773b('0x5'));var auth=require(_0x773b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x773b('0x7'));var controller=require(_0x773b('0x8'));router[_0x773b('0x9')]('/',auth[_0x773b('0xa')](),controller[_0x773b('0xb')]);router[_0x773b('0x9')](_0x773b('0xc'),auth[_0x773b('0xa')](),controller[_0x773b('0xd')]);router[_0x773b('0xe')](_0x773b('0xf'),auth['isAuthenticated'](),controller[_0x773b('0x10')]);router[_0x773b('0xe')]('/',auth[_0x773b('0xa')](),controller[_0x773b('0x11')]);router[_0x773b('0x12')](_0x773b('0xc'),auth['isAuthenticated'](),controller[_0x773b('0x13')]);router[_0x773b('0x14')]('/:id',auth[_0x773b('0xa')](),controller[_0x773b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6cb8=['isAuthenticated','index','/:id','post','clone','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6cb8,0x172));var _0x86cb=function(_0x39cae5,_0x18cf74){_0x39cae5=_0x39cae5-0x0;var _0x297ead=_0x6cb8[_0x39cae5];return _0x297ead;};'use strict';var multer=require(_0x86cb('0x0'));var util=require(_0x86cb('0x1'));var path=require('path');var timeout=require(_0x86cb('0x2'));var express=require(_0x86cb('0x3'));var router=express[_0x86cb('0x4')]();var fs_extra=require(_0x86cb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x86cb('0x6'));var config=require(_0x86cb('0x7'));var controller=require(_0x86cb('0x8'));router[_0x86cb('0x9')]('/',auth[_0x86cb('0xa')](),controller[_0x86cb('0xb')]);router[_0x86cb('0x9')](_0x86cb('0xc'),auth[_0x86cb('0xa')](),controller['show']);router[_0x86cb('0xd')]('/:id/clone',auth[_0x86cb('0xa')](),controller[_0x86cb('0xe')]);router[_0x86cb('0xd')]('/',auth[_0x86cb('0xa')](),controller[_0x86cb('0xf')]);router[_0x86cb('0x10')](_0x86cb('0xc'),auth[_0x86cb('0xa')](),controller[_0x86cb('0x11')]);router['delete'](_0x86cb('0xc'),auth[_0x86cb('0xa')](),controller[_0x86cb('0x12')]);module[_0x86cb('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4c54ce6..ae0730e 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 _0x6c91=['originate','uac','uas','fingerprint','passive','actpass','dynamic','update,nonat','sequelize','exports','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','STRING','udp','transport','getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','all','ulaw;alaw;gsm','join','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse'];(function(_0x451b32,_0x1eace6){var _0x4ac489=function(_0x458d72){while(--_0x458d72){_0x451b32['push'](_0x451b32['shift']());}};_0x4ac489(++_0x1eace6);}(_0x6c91,0xcc));var _0x16c9=function(_0x4a7a5a,_0x24e37c){_0x4a7a5a=_0x4a7a5a-0x0;var _0x32f3d1=_0x6c91[_0x4a7a5a];return _0x32f3d1;};'use strict';var Sequelize=require(_0x16c9('0x0'));module[_0x16c9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x16c9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x4'),_0x16c9('0x5'),_0x16c9('0x6')),'allowNull':![],'defaultValue':_0x16c9('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x16c9('0x7')},'callingpres':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x8'),'ALLOWED_PASSED_SCREEN',_0x16c9('0x9'),_0x16c9('0xa'),_0x16c9('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x16c9('0xc')]},'secret':{'type':Sequelize[_0x16c9('0xc')]},'md5secret':{'type':Sequelize[_0x16c9('0xc')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':_0x16c9('0xd'),'set':function(_0x1d81c4){this['setDataValue'](_0x16c9('0xe'),_0x1d81c4?_0x1d81c4['join'](','):null);},'get':function(){return this[_0x16c9('0xf')]('transport')?this[_0x16c9('0xf')](_0x16c9('0xe'))[_0x16c9('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x11'),_0x16c9('0x12'),_0x16c9('0x13'),_0x16c9('0x14'),_0x16c9('0x15')),'defaultValue':_0x16c9('0x11')},'directmedia':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no',_0x16c9('0x17'),_0x16c9('0x18'),_0x16c9('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x16c9('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x16c9('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x16c9('0x1a'),'set':function(_0x31d05f){this[_0x16c9('0x1b')](_0x16c9('0x1c'),_0x31d05f?_0x31d05f['join'](','):null);},'get':function(){return this[_0x16c9('0xf')](_0x16c9('0x1c'))?this[_0x16c9('0xf')](_0x16c9('0x1c'))[_0x16c9('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x16c9('0xc')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x16c9('0xc')]},'namedpickupgroup':{'type':Sequelize[_0x16c9('0xc')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x16c9('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':_0x16c9('0x1d')},'allow':{'type':Sequelize[_0x16c9('0xc')],'allowNull':![],'defaultValue':_0x16c9('0x1e'),'set':function(_0x38183e){this['setDataValue']('allow',_0x38183e?_0x38183e[_0x16c9('0x1f')](';'):_0x16c9('0x1e'));},'get':function(){return this[_0x16c9('0xf')](_0x16c9('0x20'))?this['getDataValue'](_0x16c9('0x20'))[_0x16c9('0x10')](';'):null;},'comment':_0x16c9('0x21')},'autoframing':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'insecure':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':_0x16c9('0x22'),'set':function(_0x546fd4){this[_0x16c9('0x1b')](_0x16c9('0x23'),_0x546fd4?_0x546fd4['join'](','):null);},'get':function(){return this[_0x16c9('0xf')](_0x16c9('0x23'))?this[_0x16c9('0xf')]('insecure')['split'](','):null;},'comment':_0x16c9('0x24')},'trustrpid':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x16c9('0x3')]('yes','no',_0x16c9('0x25'))},'promiscredir':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x16c9('0x26')](0xb)},'setvar':{'type':Sequelize[_0x16c9('0xc')]},'callerid':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x16c9('0x16'),'no'),'defaultValue':_0x16c9('0x16')},'busylevel':{'type':Sequelize[_0x16c9('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x16c9('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x16c9('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x16c9('0xc')]},'videosupport':{'type':Sequelize[_0x16c9('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x16c9('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x27'),_0x16c9('0x28'),_0x16c9('0x29'))},'session_expires':{'type':Sequelize[_0x16c9('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x16c9('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x2a'),_0x16c9('0x2b')),'defaultValue':_0x16c9('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x16c9('0xc')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x16c9('0xc')]},'fromuser':{'type':Sequelize[_0x16c9('0xc')]},'port':{'type':Sequelize[_0x16c9('0x26')](0x5)},'qualify':{'type':Sequelize[_0x16c9('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x16c9('0xc')]},'defaultuser':{'type':Sequelize[_0x16c9('0xc')]},'rtptimeout':{'type':Sequelize[_0x16c9('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x16c9('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x16c9('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x16c9('0xc')]},'callbackextension':{'type':Sequelize[_0x16c9('0xc')]},'timert1':{'type':Sequelize[_0x16c9('0x26')](0xb)},'timerb':{'type':Sequelize[_0x16c9('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x16c9('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x16c9('0xc')]},'contactdeny':{'type':Sequelize[_0x16c9('0xc')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x16c9('0xc')]},'maxforwards':{'type':Sequelize[_0x16c9('0x26')](0xb)},'encryption':{'type':Sequelize[_0x16c9('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'force_avp':{'type':Sequelize[_0x16c9('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x16c9('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x16c9('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no',_0x16c9('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x16c9('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x16c9('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0x16c9('0xc')]},'dtlscipher':{'type':Sequelize[_0x16c9('0xc')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x16c9('0x3')]('active',_0x16c9('0x2d'),_0x16c9('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x16c9('0xc')]},'call_limit':{'type':Sequelize[_0x16c9('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no')},'vmexten':{'type':Sequelize[_0x16c9('0xc')]},'mohinterpret':{'type':Sequelize[_0x16c9('0xc')]},'mohsuggest':{'type':Sequelize[_0x16c9('0xc')]},'parkinglot':{'type':Sequelize[_0x16c9('0xc')]},'description':{'type':Sequelize[_0x16c9('0xc')]},'host':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':_0x16c9('0x2f')},'canreinvite':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x16'),'no','nonat','update',_0x16c9('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x16c9('0xc')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x16c9('0xc')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc5cb=['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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uas','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','peer','friend','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc5cb,0x10a));var _0xbc5c=function(_0x56f5aa,_0xdc8d5b){_0x56f5aa=_0x56f5aa-0x0;var _0x26a03a=_0xc5cb[_0x56f5aa];return _0x26a03a;};'use strict';var Sequelize=require(_0xbc5c('0x0'));module[_0xbc5c('0x1')]={'name':{'type':Sequelize[_0xbc5c('0x2')],'allowNull':![],'unique':_0xbc5c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user',_0xbc5c('0x4')),'allowNull':![],'defaultValue':_0xbc5c('0x5')},'context':{'type':Sequelize[_0xbc5c('0x2')],'allowNull':![],'defaultValue':_0xbc5c('0x6')},'callingpres':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x8'),_0xbc5c('0x9'),'ALLOWED_FAILED_SCREEN',_0xbc5c('0xa'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xbc5c('0xb'),_0xbc5c('0xc'))},'deny':{'type':Sequelize[_0xbc5c('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xbc5c('0x2')]},'md5secret':{'type':Sequelize[_0xbc5c('0x2')]},'remotesecret':{'type':Sequelize[_0xbc5c('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbc5c('0xd'),'set':function(_0x29224b){this[_0xbc5c('0xe')](_0xbc5c('0xf'),_0x29224b?_0x29224b[_0xbc5c('0x10')](','):null);},'get':function(){return this[_0xbc5c('0x11')](_0xbc5c('0xf'))?this['getDataValue'](_0xbc5c('0xf'))[_0xbc5c('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x13'),_0xbc5c('0x14'),_0xbc5c('0x15'),'inband','auto'),'defaultValue':_0xbc5c('0x13')},'directmedia':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no',_0xbc5c('0x17'),_0xbc5c('0x18'),_0xbc5c('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xbc5c('0x2')],'defaultValue':_0xbc5c('0x1a'),'set':function(_0x512924){this[_0xbc5c('0xe')]('nat',_0x512924?_0x512924[_0xbc5c('0x10')](','):null);},'get':function(){return this[_0xbc5c('0x11')](_0xbc5c('0x1b'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xbc5c('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbc5c('0x2')]},'pickupgroup':{'type':Sequelize[_0xbc5c('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xbc5c('0x2')]},'language':{'type':Sequelize[_0xbc5c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbc5c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xbc5c('0x2')],'defaultValue':_0xbc5c('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc5c('0x1e'),'set':function(_0x412fb1){this[_0xbc5c('0xe')]('allow',_0x412fb1?_0x412fb1[_0xbc5c('0x10')](';'):_0xbc5c('0x1e'));},'get':function(){return this[_0xbc5c('0x11')](_0xbc5c('0x1f'))?this[_0xbc5c('0x11')]('allow')['split'](';'):null;},'comment':_0xbc5c('0x20')},'autoframing':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'insecure':{'type':Sequelize[_0xbc5c('0x2')],'defaultValue':_0xbc5c('0x21'),'set':function(_0x2198e0){this['setDataValue'](_0xbc5c('0x22'),_0x2198e0?_0x2198e0['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xbc5c('0x11')](_0xbc5c('0x22'))['split'](','):null;},'comment':_0xbc5c('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0xbc5c('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xbc5c('0x16'),'no',_0xbc5c('0x24'))},'promiscredir':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xbc5c('0x7')]('yes','no')},'accountcode':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'setvar':{'type':Sequelize[_0xbc5c('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xbc5c('0x26')},'amaflags':{'type':Sequelize[_0xbc5c('0x2')]},'callcounter':{'type':Sequelize[_0xbc5c('0x7')]('yes','no'),'defaultValue':_0xbc5c('0x16')},'busylevel':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xbc5c('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xbc5c('0x2')]},'videosupport':{'type':Sequelize[_0xbc5c('0x7')]('yes','no',_0xbc5c('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xbc5c('0x2')]},'session_timers':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x28'),_0xbc5c('0x29'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xbc5c('0x7')]('uac',_0xbc5c('0x2a')),'defaultValue':_0xbc5c('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xbc5c('0x2')]},'regexten':{'type':Sequelize[_0xbc5c('0x2')]},'fromdomain':{'type':Sequelize[_0xbc5c('0x2')]},'fromuser':{'type':Sequelize[_0xbc5c('0x2')]},'port':{'type':Sequelize[_0xbc5c('0x25')](0x5)},'qualify':{'type':Sequelize[_0xbc5c('0x7')]('yes','no'),'defaultValue':_0xbc5c('0x16')},'keepalive':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xbc5c('0x2')]},'defaultuser':{'type':Sequelize[_0xbc5c('0x2')]},'rtptimeout':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xbc5c('0x7')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbc5c('0x2')]},'callbackextension':{'type':Sequelize[_0xbc5c('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xbc5c('0x2')]},'contactdeny':{'type':Sequelize[_0xbc5c('0x2')]},'contactacl':{'type':Sequelize[_0xbc5c('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xbc5c('0x2')]},'use_q850_reason':{'type':Sequelize[_0xbc5c('0x2')]},'maxforwards':{'type':Sequelize[_0xbc5c('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'force_avp':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'icesupport':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xbc5c('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xbc5c('0x2')]},'dtlscipher':{'type':Sequelize[_0xbc5c('0x2')]},'dtlscafile':{'type':Sequelize[_0xbc5c('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xbc5c('0x2b'),'passive',_0xbc5c('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xbc5c('0x7')](_0xbc5c('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbc5c('0x2')]},'recordofffeature':{'type':Sequelize[_0xbc5c('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xbc5c('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xbc5c('0x7')]('yes','no')},'vmexten':{'type':Sequelize[_0xbc5c('0x2')]},'mohinterpret':{'type':Sequelize[_0xbc5c('0x2')]},'mohsuggest':{'type':Sequelize[_0xbc5c('0x2')]},'parkinglot':{'type':Sequelize[_0xbc5c('0x2')]},'description':{'type':Sequelize[_0xbc5c('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbc5c('0x2d')},'canreinvite':{'type':Sequelize['ENUM'](_0xbc5c('0x16'),'no',_0xbc5c('0x17'),_0xbc5c('0x18'),_0xbc5c('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbc5c('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbc5c('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbc5c('0x2')],'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 6da2acc..77cd80b 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 _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x50856f,_0x262f2c){var _0x505ca2=function(_0x4df2f2){while(--_0x4df2f2){_0x50856f['push'](_0x50856f['shift']());}};_0x505ca2(++_0x262f2c);}(_0x9f62,0x154));var _0x29f6=function(_0xc55c7,_0x527f45){_0xc55c7=_0xc55c7-0x0;var _0x4c7456=_0x9f62[_0xc55c7];return _0x4c7456;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file +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(_0x12037b,_0x145c16){var _0x52ac6f=function(_0x42d4b9){while(--_0x42d4b9){_0x12037b['push'](_0x12037b['shift']());}};_0x52ac6f(++_0x145c16);}(_0x54ef,0x112));var _0xf54e=function(_0x82fd1f,_0x101a41){_0x82fd1f=_0x82fd1f-0x0;var _0x179c3a=_0x54ef[_0x82fd1f];return _0x179c3a;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 97f06c3..18ad4ba 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 _0x9cae=['define','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports'];(function(_0x1d4eed,_0x4922b2){var _0x10911b=function(_0x5422ab){while(--_0x5422ab){_0x1d4eed['push'](_0x1d4eed['shift']());}};_0x10911b(++_0x4922b2);}(_0x9cae,0x1cf));var _0xe9ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9cae[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe9ca('0x0'));var util=require(_0xe9ca('0x1'));var logger=require(_0xe9ca('0x2'))(_0xe9ca('0x3'));var moment=require('moment');var BPromise=require(_0xe9ca('0x4'));var rp=require(_0xe9ca('0x5'));var fs=require('fs');var path=require(_0xe9ca('0x6'));var rimraf=require('rimraf');var config=require(_0xe9ca('0x7'));var attributes=require(_0xe9ca('0x8'));module[_0xe9ca('0x9')]=function(_0x504c71,_0x5ae9d3){return _0x504c71[_0xe9ca('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','./trunk.attributes','exports','define'];(function(_0x1c2b80,_0x2e61e6){var _0x46f872=function(_0x259f00){while(--_0x259f00){_0x1c2b80['push'](_0x1c2b80['shift']());}};_0x46f872(++_0x2e61e6);}(_0x3f8a,0xb2));var _0xa3f8=function(_0x584f75,_0x1c5be1){_0x584f75=_0x584f75-0x0;var _0x183456=_0x3f8a[_0x584f75];return _0x183456;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require('../../config/logger')(_0xa3f8('0x2'));var moment=require(_0xa3f8('0x3'));var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3f8('0x6'));module[_0xa3f8('0x7')]=function(_0x4b34b7,_0xc170b2){return _0x4b34b7[_0xa3f8('0x8')](_0xa3f8('0x9'),attributes,{'tableName':_0xa3f8('0xa'),'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 21801e6..d9b5c0c 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 _0xa3f3=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch','GetTrunk','Trunk','options','where','attributes','limit','include','map','model','stringify','ShowTrunk','find','raw','info'];(function(_0x1a017d,_0x79f0c){var _0x2c27b6=function(_0xac772c){while(--_0xac772c){_0x1a017d['push'](_0x1a017d['shift']());}};_0x2c27b6(++_0x79f0c);}(_0xa3f3,0x160));var _0x3a3f=function(_0xa620e6,_0x1f5e33){_0xa620e6=_0xa620e6-0x0;var _0x4755fa=_0xa3f3[_0xa620e6];return _0x4755fa;};'use strict';var _=require(_0x3a3f('0x0'));var util=require(_0x3a3f('0x1'));var moment=require(_0x3a3f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a3f('0x4'))['db'];var utils=require(_0x3a3f('0x5'));var logger=require(_0x3a3f('0x6'))(_0x3a3f('0x7'));var config=require('../../config/environment');var jayson=require(_0x3a3f('0x8'));var client=jayson[_0x3a3f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5367b0,_0x16de48,_0x67388a){return new BPromise(function(_0x45cf95,_0x47ba4f){return client['request'](_0x5367b0,_0x67388a)[_0x3a3f('0xa')](function(_0x502af6){logger['info'](_0x3a3f('0xb'),_0x16de48,_0x3a3f('0xc'));logger[_0x3a3f('0xd')](_0x3a3f('0xe'),_0x16de48,'request\x20sent',JSON['stringify'](_0x502af6));if(_0x502af6['error']){if(_0x502af6[_0x3a3f('0xf')]['code']===0x1f4){logger[_0x3a3f('0xf')](_0x3a3f('0xb'),_0x16de48,_0x502af6[_0x3a3f('0xf')][_0x3a3f('0x10')]);return _0x47ba4f(_0x502af6['error']['message']);}logger['error'](_0x3a3f('0xb'),_0x16de48,_0x502af6[_0x3a3f('0xf')]['message']);return _0x45cf95(_0x502af6['error'][_0x3a3f('0x10')]);}else{logger['info'](_0x3a3f('0xb'),_0x16de48,_0x3a3f('0xc'));_0x45cf95(_0x502af6['result']['message']);}})[_0x3a3f('0x11')](function(_0x764b24){logger[_0x3a3f('0xf')](_0x3a3f('0xb'),_0x16de48,_0x764b24);_0x47ba4f(_0x764b24);});});}exports[_0x3a3f('0x12')]=function(_0x25caf2){var _0x3e7ce3=this;return new Promise(function(_0x14fba6,_0x47142f){return db[_0x3a3f('0x13')]['findAll']({'raw':_0x25caf2[_0x3a3f('0x14')]?_0x25caf2[_0x3a3f('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x25caf2[_0x3a3f('0x14')]?_0x25caf2[_0x3a3f('0x14')][_0x3a3f('0x15')]||null:null,'attributes':_0x25caf2[_0x3a3f('0x14')]?_0x25caf2[_0x3a3f('0x14')][_0x3a3f('0x16')]||null:null,'limit':_0x25caf2[_0x3a3f('0x14')]?_0x25caf2['options'][_0x3a3f('0x17')]||null:null,'include':_0x25caf2[_0x3a3f('0x14')]?_0x25caf2[_0x3a3f('0x14')][_0x3a3f('0x18')]?_[_0x3a3f('0x19')](_0x25caf2['options'][_0x3a3f('0x18')],function(_0x4bb4a4){return{'model':db[_0x4bb4a4[_0x3a3f('0x1a')]],'as':_0x4bb4a4['as'],'attributes':_0x4bb4a4[_0x3a3f('0x16')],'include':_0x4bb4a4[_0x3a3f('0x18')]?_[_0x3a3f('0x19')](_0x4bb4a4['include'],function(_0x5c1f6d){return{'model':db[_0x5c1f6d[_0x3a3f('0x1a')]],'as':_0x5c1f6d['as'],'attributes':_0x5c1f6d[_0x3a3f('0x16')],'include':_0x5c1f6d[_0x3a3f('0x18')]?_[_0x3a3f('0x19')](_0x5c1f6d['include'],function(_0x1b4525){return{'model':db[_0x1b4525[_0x3a3f('0x1a')]],'as':_0x1b4525['as'],'attributes':_0x1b4525[_0x3a3f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3a3f('0xa')](function(_0x44a5b8){logger['info'](_0x3a3f('0x12'),_0x25caf2);logger[_0x3a3f('0xd')](_0x3a3f('0x12'),_0x25caf2,JSON[_0x3a3f('0x1b')](_0x44a5b8));_0x14fba6(_0x44a5b8);})['catch'](function(_0x5b7aa5){logger[_0x3a3f('0xf')](_0x3a3f('0x12'),_0x5b7aa5['message'],_0x25caf2);_0x47142f(_0x3e7ce3[_0x3a3f('0xf')](0x1f4,_0x5b7aa5['message']));});});};exports[_0x3a3f('0x1c')]=function(_0x19691c){var _0x37fd15=this;return new Promise(function(_0x4a4e69,_0x4d352e){return db[_0x3a3f('0x13')][_0x3a3f('0x1d')]({'raw':_0x19691c[_0x3a3f('0x14')]?_0x19691c[_0x3a3f('0x14')][_0x3a3f('0x1e')]===undefined?!![]:![]:!![],'where':_0x19691c[_0x3a3f('0x14')]?_0x19691c[_0x3a3f('0x14')][_0x3a3f('0x15')]||null:null,'attributes':_0x19691c[_0x3a3f('0x14')]?_0x19691c['options'][_0x3a3f('0x16')]||null:null,'include':_0x19691c[_0x3a3f('0x14')]?_0x19691c[_0x3a3f('0x14')][_0x3a3f('0x18')]?_[_0x3a3f('0x19')](_0x19691c[_0x3a3f('0x14')][_0x3a3f('0x18')],function(_0xe088f8){return{'model':db[_0xe088f8[_0x3a3f('0x1a')]],'as':_0xe088f8['as'],'attributes':_0xe088f8[_0x3a3f('0x16')],'include':_0xe088f8['include']?_[_0x3a3f('0x19')](_0xe088f8['include'],function(_0x22670d){return{'model':db[_0x22670d[_0x3a3f('0x1a')]],'as':_0x22670d['as'],'attributes':_0x22670d[_0x3a3f('0x16')],'include':_0x22670d[_0x3a3f('0x18')]?_[_0x3a3f('0x19')](_0x22670d['include'],function(_0xd2cc82){return{'model':db[_0xd2cc82['model']],'as':_0xd2cc82['as'],'attributes':_0xd2cc82[_0x3a3f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3a3f('0xa')](function(_0x718359){logger[_0x3a3f('0x1f')]('ShowTrunk',_0x19691c);logger[_0x3a3f('0xd')](_0x3a3f('0x1c'),_0x19691c,JSON[_0x3a3f('0x1b')](_0x718359));_0x4a4e69(_0x718359);})[_0x3a3f('0x11')](function(_0x360c66){logger['error'](_0x3a3f('0x1c'),_0x360c66[_0x3a3f('0x10')],_0x19691c);_0x4d352e(_0x37fd15['error'](0x1f4,_0x360c66[_0x3a3f('0x10')]));});});}; \ No newline at end of file +var _0x6b68=['../../config/environment','jayson/promise','http','request','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Trunk','findAll','options','raw','attributes','limit','include','map','model','GetTrunk','stringify','where','then','ShowTrunk','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27967e,_0x22b26a){var _0xf96f79=function(_0x137da1){while(--_0x137da1){_0x27967e['push'](_0x27967e['shift']());}};_0xf96f79(++_0x22b26a);}(_0x6b68,0x111));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x86b6('0x0'));var moment=require(_0x86b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x86b6('0x2'));var fs=require('fs');var Redis=require(_0x86b6('0x3'));var db=require(_0x86b6('0x4'))['db'];var utils=require(_0x86b6('0x5'));var logger=require(_0x86b6('0x6'))('rpc');var config=require(_0x86b6('0x7'));var jayson=require(_0x86b6('0x8'));var client=jayson['client'][_0x86b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x457d10,_0x3f133b,_0x197edd){return new BPromise(function(_0x1fe4ef,_0x3fbb95){return client[_0x86b6('0xa')](_0x457d10,_0x197edd)['then'](function(_0x2a9472){logger[_0x86b6('0xb')](_0x86b6('0xc'),_0x3f133b,'request\x20sent');logger[_0x86b6('0xd')](_0x86b6('0xe'),_0x3f133b,_0x86b6('0xf'),JSON['stringify'](_0x2a9472));if(_0x2a9472['error']){if(_0x2a9472[_0x86b6('0x10')][_0x86b6('0x11')]===0x1f4){logger['error'](_0x86b6('0xc'),_0x3f133b,_0x2a9472[_0x86b6('0x10')]['message']);return _0x3fbb95(_0x2a9472[_0x86b6('0x10')]['message']);}logger[_0x86b6('0x10')](_0x86b6('0xc'),_0x3f133b,_0x2a9472['error'][_0x86b6('0x12')]);return _0x1fe4ef(_0x2a9472[_0x86b6('0x10')][_0x86b6('0x12')]);}else{logger[_0x86b6('0xb')](_0x86b6('0xc'),_0x3f133b,'request\x20sent');_0x1fe4ef(_0x2a9472[_0x86b6('0x13')][_0x86b6('0x12')]);}})[_0x86b6('0x14')](function(_0x526845){logger['error'](_0x86b6('0xc'),_0x3f133b,_0x526845);_0x3fbb95(_0x526845);});});}exports['GetTrunk']=function(_0x2231a2){var _0x3ce3a7=this;return new Promise(function(_0x6b6285,_0xcc4cff){return db[_0x86b6('0x15')][_0x86b6('0x16')]({'raw':_0x2231a2[_0x86b6('0x17')]?_0x2231a2[_0x86b6('0x17')][_0x86b6('0x18')]===undefined?!![]:![]:!![],'where':_0x2231a2['options']?_0x2231a2[_0x86b6('0x17')]['where']||null:null,'attributes':_0x2231a2[_0x86b6('0x17')]?_0x2231a2[_0x86b6('0x17')][_0x86b6('0x19')]||null:null,'limit':_0x2231a2['options']?_0x2231a2[_0x86b6('0x17')][_0x86b6('0x1a')]||null:null,'include':_0x2231a2[_0x86b6('0x17')]?_0x2231a2[_0x86b6('0x17')][_0x86b6('0x1b')]?_[_0x86b6('0x1c')](_0x2231a2[_0x86b6('0x17')][_0x86b6('0x1b')],function(_0x3900c6){return{'model':db[_0x3900c6[_0x86b6('0x1d')]],'as':_0x3900c6['as'],'attributes':_0x3900c6[_0x86b6('0x19')],'include':_0x3900c6['include']?_[_0x86b6('0x1c')](_0x3900c6[_0x86b6('0x1b')],function(_0x46d075){return{'model':db[_0x46d075[_0x86b6('0x1d')]],'as':_0x46d075['as'],'attributes':_0x46d075[_0x86b6('0x19')],'include':_0x46d075[_0x86b6('0x1b')]?_[_0x86b6('0x1c')](_0x46d075[_0x86b6('0x1b')],function(_0x1a1d99){return{'model':db[_0x1a1d99[_0x86b6('0x1d')]],'as':_0x1a1d99['as'],'attributes':_0x1a1d99['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c190a){logger['info']('GetTrunk',_0x2231a2);logger[_0x86b6('0xd')](_0x86b6('0x1e'),_0x2231a2,JSON[_0x86b6('0x1f')](_0x1c190a));_0x6b6285(_0x1c190a);})[_0x86b6('0x14')](function(_0x45dd92){logger[_0x86b6('0x10')](_0x86b6('0x1e'),_0x45dd92[_0x86b6('0x12')],_0x2231a2);_0xcc4cff(_0x3ce3a7['error'](0x1f4,_0x45dd92[_0x86b6('0x12')]));});});};exports['ShowTrunk']=function(_0x4516df){var _0xf7b624=this;return new Promise(function(_0x15ce4c,_0x1ebc05){return db[_0x86b6('0x15')]['find']({'raw':_0x4516df['options']?_0x4516df[_0x86b6('0x17')][_0x86b6('0x18')]===undefined?!![]:![]:!![],'where':_0x4516df['options']?_0x4516df[_0x86b6('0x17')][_0x86b6('0x20')]||null:null,'attributes':_0x4516df[_0x86b6('0x17')]?_0x4516df[_0x86b6('0x17')][_0x86b6('0x19')]||null:null,'include':_0x4516df[_0x86b6('0x17')]?_0x4516df[_0x86b6('0x17')]['include']?_['map'](_0x4516df['options'][_0x86b6('0x1b')],function(_0x2fe8ae){return{'model':db[_0x2fe8ae[_0x86b6('0x1d')]],'as':_0x2fe8ae['as'],'attributes':_0x2fe8ae['attributes'],'include':_0x2fe8ae[_0x86b6('0x1b')]?_[_0x86b6('0x1c')](_0x2fe8ae[_0x86b6('0x1b')],function(_0x27f6d1){return{'model':db[_0x27f6d1[_0x86b6('0x1d')]],'as':_0x27f6d1['as'],'attributes':_0x27f6d1[_0x86b6('0x19')],'include':_0x27f6d1[_0x86b6('0x1b')]?_[_0x86b6('0x1c')](_0x27f6d1[_0x86b6('0x1b')],function(_0x11417d){return{'model':db[_0x11417d['model']],'as':_0x11417d['as'],'attributes':_0x11417d['attributes']};}):[]};}):[]};}):[]:[]})[_0x86b6('0x21')](function(_0x2a8610){logger['info'](_0x86b6('0x22'),_0x4516df);logger['debug'](_0x86b6('0x22'),_0x4516df,JSON[_0x86b6('0x1f')](_0x2a8610));_0x15ce4c(_0x2a8610);})[_0x86b6('0x14')](function(_0x5b357d){logger[_0x86b6('0x10')](_0x86b6('0x22'),_0x5b357d[_0x86b6('0x12')],_0x4516df);_0x1ebc05(_0xf7b624[_0x86b6('0x10')](0x1f4,_0x5b357d[_0x86b6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index ddf4ac3..a7d8ff9 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 _0x19db=['express','Router','../../components/auth/service','put','/:id','isAuthenticated','update','exports'];(function(_0x1f6fd5,_0x399cb0){var _0x587d12=function(_0x4d26e8){while(--_0x4d26e8){_0x1f6fd5['push'](_0x1f6fd5['shift']());}};_0x587d12(++_0x399cb0);}(_0x19db,0x128));var _0xb19d=function(_0x776414,_0x10d2de){_0x776414=_0x776414-0x0;var _0x7ec5f6=_0x19db[_0x776414];return _0x7ec5f6;};'use strict';var express=require(_0xb19d('0x0'));var router=express[_0xb19d('0x1')]();var auth=require(_0xb19d('0x2'));var controller=require('./user-setting.controller');router[_0xb19d('0x3')](_0xb19d('0x4'),auth[_0xb19d('0x5')](),controller[_0xb19d('0x6')]);module[_0xb19d('0x7')]=router; \ No newline at end of file +var _0xa5a1=['exports','express','Router','../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','update'];(function(_0x105d2e,_0xefc0f9){var _0x44969d=function(_0x2fca67){while(--_0x2fca67){_0x105d2e['push'](_0x105d2e['shift']());}};_0x44969d(++_0xefc0f9);}(_0xa5a1,0xf1));var _0x1a5a=function(_0x4fe0f2,_0x5dbc89){_0x4fe0f2=_0x4fe0f2-0x0;var _0x982e06=_0xa5a1[_0x4fe0f2];return _0x982e06;};'use strict';var express=require(_0x1a5a('0x0'));var router=express[_0x1a5a('0x1')]();var auth=require(_0x1a5a('0x2'));var controller=require(_0x1a5a('0x3'));router['put'](_0x1a5a('0x4'),auth[_0x1a5a('0x5')](),controller[_0x1a5a('0x6')]);module[_0x1a5a('0x7')]=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 6af7cd5..d897a4a 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 _0x07e0=['exports','ENUM','DATE','INTEGER','UserId','error','warning','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07e0,0x17d));var _0x007e=function(_0x434e1a,_0x16f187){_0x434e1a=_0x434e1a-0x0;var _0x15081a=_0x07e0[_0x434e1a];return _0x15081a;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x007e('0x0'),_0x007e('0x1'),'info',_0x007e('0x2')];module[_0x007e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x007e('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x007e('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x007e('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x007e('0x6')],'unique':_0x007e('0x7')}}; \ No newline at end of file +var _0xdb0e=['ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','warning','exports'];(function(_0x3ac83e,_0x9032a6){var _0x3b0e4e=function(_0xee57aa){while(--_0xee57aa){_0x3ac83e['push'](_0x3ac83e['shift']());}};_0x3b0e4e(++_0x9032a6);}(_0xdb0e,0x1f4));var _0xedb0=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0xdb0e[_0x2ecb67];return _0x168079;};'use strict';var Sequelize=require(_0xedb0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xedb0('0x1'),_0xedb0('0x2'),'info','debug'];module[_0xedb0('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xedb0('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xedb0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xedb0('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xedb0('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xedb0('0x7')],'unique':_0xedb0('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index cb02f69..f90d552 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 _0x8f37=['redis','register','defaults','localhost','json','update','then','error','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','../../mysqldb','socket.io-emitter'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8f37,0x190));var _0x78f3=function(_0x5d71ce,_0x310b0d){_0x5d71ce=_0x5d71ce-0x0;var _0x2352e5=_0x8f37[_0x5d71ce];return _0x2352e5;};'use strict';var _=require(_0x78f3('0x0'));var Redis=require(_0x78f3('0x1'));var logger=require(_0x78f3('0x2'))('api');var config=require('../../config/environment');var db=require(_0x78f3('0x3'))['db'];var socket=require(_0x78f3('0x4'))(new Redis(config[_0x78f3('0x5')]));require('./user-setting.socket')[_0x78f3('0x6')](socket);config['redis']=_[_0x78f3('0x7')](config['redis'],{'host':_0x78f3('0x8'),'port':0x18eb});function respondWithResult(_0x3dc185,_0x492dc7){_0x492dc7=_0x492dc7||0xc8;return function(_0x58bd73){if(_0x58bd73){return _0x3dc185['status'](_0x492dc7)[_0x78f3('0x9')](_0x58bd73);}};}function saveUpdates(_0x423223){return function(_0x552bef){if(_0x552bef){return _0x552bef[_0x78f3('0xa')](_0x423223)[_0x78f3('0xb')](function(_0x268525){return _0x268525;});}return null;};}function handleEntityNotFound(_0x2a0c7a){return function(_0x4437a5){if(!_0x4437a5){_0x2a0c7a['sendStatus'](0x194);}return _0x4437a5;};}function handleError(_0xf1effd,_0x3d5b47){_0x3d5b47=_0x3d5b47||0x1f4;return function(_0x4c57c9){logger[_0x78f3('0xc')](_0x4c57c9[_0x78f3('0xd')]);if(_0x4c57c9[_0x78f3('0xe')]){delete _0x4c57c9['name'];}_0xf1effd[_0x78f3('0xf')](_0x3d5b47)[_0x78f3('0x10')](_0x4c57c9);};}exports[_0x78f3('0xa')]=function(_0x244915,_0x58fe69){if(_0x244915[_0x78f3('0x11')][_0x78f3('0x12')]!==_0x78f3('0x13'))throw new Error(_0x78f3('0x14'));if(isNaN(Number(_0x244915[_0x78f3('0x15')]['id'])))throw new Error(_0x78f3('0x16'));return db[_0x78f3('0x17')][_0x78f3('0x18')]({'where':{'id':_0x244915[_0x78f3('0x15')]['id']}})[_0x78f3('0xb')](handleEntityNotFound(_0x58fe69,null))[_0x78f3('0xb')](saveUpdates(_0x244915[_0x78f3('0x19')],null))[_0x78f3('0xb')](respondWithResult(_0x58fe69,null))[_0x78f3('0x1a')](handleError(_0x58fe69,null));}; \ No newline at end of file +var _0xce9b=['body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','json','update','then','sendStatus','error','stack','name','status','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xce9b,0xc6));var _0xbce9=function(_0x3ce8fe,_0x5c6753){_0x3ce8fe=_0x3ce8fe-0x0;var _0x22f508=_0xce9b[_0x3ce8fe];return _0x22f508;};'use strict';var _=require(_0xbce9('0x0'));var Redis=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var config=require(_0xbce9('0x4'));var db=require(_0xbce9('0x5'))['db'];var socket=require(_0xbce9('0x6'))(new Redis(config[_0xbce9('0x7')]));require('./user-setting.socket')[_0xbce9('0x8')](socket);config[_0xbce9('0x7')]=_[_0xbce9('0x9')](config[_0xbce9('0x7')],{'host':_0xbce9('0xa'),'port':0x18eb});function respondWithResult(_0x2c336a,_0x10a645){_0x10a645=_0x10a645||0xc8;return function(_0x562634){if(_0x562634){return _0x2c336a['status'](_0x10a645)[_0xbce9('0xb')](_0x562634);}};}function saveUpdates(_0x1d9a99){return function(_0x5a5542){if(_0x5a5542){return _0x5a5542[_0xbce9('0xc')](_0x1d9a99)[_0xbce9('0xd')](function(_0x572128){return _0x572128;});}return null;};}function handleEntityNotFound(_0x5b766a){return function(_0x2073ea){if(!_0x2073ea){_0x5b766a[_0xbce9('0xe')](0x194);}return _0x2073ea;};}function handleError(_0x1b980c,_0x4dc9a9){_0x4dc9a9=_0x4dc9a9||0x1f4;return function(_0x48a272){logger[_0xbce9('0xf')](_0x48a272[_0xbce9('0x10')]);if(_0x48a272[_0xbce9('0x11')]){delete _0x48a272[_0xbce9('0x11')];}_0x1b980c[_0xbce9('0x12')](_0x4dc9a9)[_0xbce9('0x13')](_0x48a272);};}exports[_0xbce9('0xc')]=function(_0x540886,_0xa6903c){if(_0x540886[_0xbce9('0x14')]['role']!==_0xbce9('0x15'))throw new Error(_0xbce9('0x16'));if(isNaN(Number(_0x540886[_0xbce9('0x17')]['id'])))throw new Error(_0xbce9('0x18'));return db[_0xbce9('0x19')]['find']({'where':{'id':_0x540886[_0xbce9('0x17')]['id']}})[_0xbce9('0xd')](handleEntityNotFound(_0xa6903c,null))[_0xbce9('0xd')](saveUpdates(_0x540886[_0xbce9('0x1a')],null))[_0xbce9('0xd')](respondWithResult(_0xa6903c,null))[_0xbce9('0x1b')](handleError(_0xa6903c,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 925ce53..850521e 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 _0xb010=['exports','events','UserSetting','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xb010,0xe9));var _0x0b01=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb010[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0x0b01('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x0b01('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0b01('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b01('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50c1be){return function(_0x5aadf4,_0x2963f3,_0x3347c0){UserSettingEvents[_0x0b01('0x4')](_0x50c1be+':'+_0x5aadf4['id'],_0x5aadf4);UserSettingEvents[_0x0b01('0x4')](_0x50c1be,_0x5aadf4);_0x3347c0(null);};}for(var e in events){if(events[_0x0b01('0x5')](e)){var event=events[e];UserSetting[_0x0b01('0x6')](e,emitEvent(event));}}module[_0x0b01('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xebc5=['update','remove','emit','hasOwnProperty','exports','events','UserSetting','setMaxListeners','save'];(function(_0x59400c,_0x364897){var _0x51508d=function(_0x1f7682){while(--_0x1f7682){_0x59400c['push'](_0x59400c['shift']());}};_0x51508d(++_0x364897);}(_0xebc5,0x1f4));var _0x5ebc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xebc5[_0x543084];return _0x306a57;};'use strict';var EventEmitter=require(_0x5ebc('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x5ebc('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x5ebc('0x2')](0x0);var events={'afterCreate':_0x5ebc('0x3'),'afterUpdate':_0x5ebc('0x4'),'afterDestroy':_0x5ebc('0x5')};function emitEvent(_0x43e9eb){return function(_0x33a276,_0x3e3b1c,_0x375de5){UserSettingEvents[_0x5ebc('0x6')](_0x43e9eb+':'+_0x33a276['id'],_0x33a276);UserSettingEvents[_0x5ebc('0x6')](_0x43e9eb,_0x33a276);_0x375de5(null);};}for(var e in events){if(events[_0x5ebc('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x5ebc('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 522ec46..f126352 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 _0xffaa=['exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x9901cf,_0x5018d3){var _0x5795f1=function(_0x5160d4){while(--_0x5160d4){_0x9901cf['push'](_0x9901cf['shift']());}};_0x5795f1(++_0x5018d3);}(_0xffaa,0x130));var _0xaffa=function(_0x26c640,_0x4a8f13){_0x26c640=_0x26c640-0x0;var _0x2c23c4=_0xffaa[_0x26c640];return _0x2c23c4;};'use strict';var attributes=require(_0xaffa('0x0'));module[_0xaffa('0x1')]=function(_0x2c0e94){return _0x2c0e94['define']('UserSetting',attributes,{'tableName':_0xaffa('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2433d9){if(!_0x2433d9[_0xaffa('0x3')])_0x2433d9[_0xaffa('0x4')]=null;else if(_0x2433d9[_0xaffa('0x4')]===null)_0x2433d9[_0xaffa('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xfc75=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x1eba74,_0x21609f){var _0x537bfa=function(_0x2f8e43){while(--_0x2f8e43){_0x1eba74['push'](_0x1eba74['shift']());}};_0x537bfa(++_0x21609f);}(_0xfc75,0xe1));var _0x5fc7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfc75[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x5fc7('0x0'));module[_0x5fc7('0x1')]=function(_0x3d2426){return _0x3d2426[_0x5fc7('0x2')](_0x5fc7('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55314c){if(!_0x55314c[_0x5fc7('0x4')])_0x55314c['clientSideLoggingEnabledSince']=null;else if(_0x55314c[_0x5fc7('0x5')]===null)_0x55314c[_0x5fc7('0x5')]=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 2583cc4..52ba2ae 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 _0x136c=['UserId','register','length','./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x1a9b17,_0x4691de){var _0xaffb34=function(_0x2ebc35){while(--_0x2ebc35){_0x1a9b17['push'](_0x1a9b17['shift']());}};_0xaffb34(++_0x4691de);}(_0x136c,0xae));var _0xc136=function(_0x332525,_0x5c8b85){_0x332525=_0x332525-0x0;var _0x25fe38=_0x136c[_0x332525];return _0x25fe38;};'use strict';var UserSettingEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x55ddf7,_0x19bea9){return function(_0x22bb3d){_0x19bea9[_0xc136('0x3')](_0x55ddf7,_0x22bb3d);if(_0x55ddf7===_0xc136('0x4')){_0x19bea9[_0xc136('0x3')](_0xc136('0x5')+_0x22bb3d[_0xc136('0x6')],_0x22bb3d);}};}exports[_0xc136('0x7')]=function(_0x244c3a){for(var _0x53033c=0x0,_0x2607a6=events[_0xc136('0x8')];_0x53033c<_0x2607a6;_0x53033c++){var _0x10b358=events[_0x53033c];var _0x58ed2e=createListener('user-setting:'+_0x10b358,_0x244c3a);UserSettingEvents['on'](_0x10b358,_0x58ed2e);}}; \ No newline at end of file +var _0xbf5a=['UserId','register','length','user-setting:','./user-setting.events','remove','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x500994,_0x1b11a0){var _0x29fb2a=function(_0x53c72f){while(--_0x53c72f){_0x500994['push'](_0x500994['shift']());}};_0x29fb2a(++_0x1b11a0);}(_0xbf5a,0x16c));var _0xabf5=function(_0x50b213,_0x2460af){_0x50b213=_0x50b213-0x0;var _0x43eb40=_0xbf5a[_0x50b213];return _0x43eb40;};'use strict';var UserSettingEvents=require(_0xabf5('0x0'));var events=['save',_0xabf5('0x1'),_0xabf5('0x2')];function createListener(_0x141b0c,_0x39f536){return function(_0x31a2d){_0x39f536[_0xabf5('0x3')](_0x141b0c,_0x31a2d);if(_0x141b0c===_0xabf5('0x4')){_0x39f536[_0xabf5('0x3')](_0xabf5('0x5')+_0x31a2d[_0xabf5('0x6')],_0x31a2d);}};}exports[_0xabf5('0x7')]=function(_0x4c46fc){for(var _0x32f17d=0x0,_0x1dfe7f=events[_0xabf5('0x8')];_0x32f17d<_0x1dfe7f;_0x32f17d++){var _0x12a821=events[_0x32f17d];var _0x15f970=createListener(_0xabf5('0x9')+_0x12a821,_0x4c46fc);UserSettingEvents['on'](_0x12a821,_0x15f970);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a7d3a67..97d985f 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 _0x8eec=['getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','update','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','path','fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','getPresence','/:id','show'];(function(_0x187948,_0x165bcc){var _0x1418ac=function(_0xa30337){while(--_0xa30337){_0x187948['push'](_0x187948['shift']());}};_0x1418ac(++_0x165bcc);}(_0x8eec,0x19a));var _0xc8ee=function(_0xa63499,_0x26eaff){_0xa63499=_0xa63499-0x0;var _0x10f6ee=_0x8eec[_0xa63499];return _0x10f6ee;};'use strict';var multer=require(_0xc8ee('0x0'));var util=require(_0xc8ee('0x1'));var path=require(_0xc8ee('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc8ee('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc8ee('0x4'));var controller=require('./user.controller');router[_0xc8ee('0x5')]('/',auth[_0xc8ee('0x6')](),controller['index']);router[_0xc8ee('0x5')](_0xc8ee('0x7'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x8')]);router['get'](_0xc8ee('0x9'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0xa')]);router['get']('/presence',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0xb')]);router[_0xc8ee('0x5')](_0xc8ee('0xc'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0xd')]);router[_0xc8ee('0x5')]('/:id/avatar',controller[_0xc8ee('0xe')]);router[_0xc8ee('0x5')](_0xc8ee('0xf'),auth['isAuthenticated'](),controller[_0xc8ee('0x10')]);router[_0xc8ee('0x5')](_0xc8ee('0x11'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x12')]);router[_0xc8ee('0x5')](_0xc8ee('0x13'),auth[_0xc8ee('0x6')](),controller['getQueues']);router[_0xc8ee('0x5')](_0xc8ee('0x14'),auth[_0xc8ee('0x6')](),controller['getVoiceQueuesRt']);router[_0xc8ee('0x5')](_0xc8ee('0x15'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x16')]);router[_0xc8ee('0x5')](_0xc8ee('0x17'),auth[_0xc8ee('0x6')](),controller['getRecordings']);router[_0xc8ee('0x5')](_0xc8ee('0x18'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x19')]);router[_0xc8ee('0x5')]('/:id/chat/interactions',auth[_0xc8ee('0x6')](),controller['getChatInteractions']);router[_0xc8ee('0x5')](_0xc8ee('0x1a'),auth[_0xc8ee('0x6')](),controller['getOpenchannelInteractions']);router[_0xc8ee('0x5')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0xc8ee('0x1b')]);router[_0xc8ee('0x5')](_0xc8ee('0x1c'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x1d')]);router['get'](_0xc8ee('0x1e'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x1f')]);router['get']('/:id/whatsapp/interactions',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x20')]);router[_0xc8ee('0x5')](_0xc8ee('0x21'),auth[_0xc8ee('0x6')](),controller['getTeams']);router[_0xc8ee('0x5')](_0xc8ee('0x22'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x23')]);router[_0xc8ee('0x5')](_0xc8ee('0x24'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x25')]);router['get'](_0xc8ee('0x26'),auth[_0xc8ee('0x6')](),controller['getVoicePrefixes']);router[_0xc8ee('0x5')](_0xc8ee('0x27'),auth[_0xc8ee('0x6')](),controller['getFaxAccounts']);router['get'](_0xc8ee('0x28'),auth[_0xc8ee('0x6')](),controller['getMailAccounts']);router['get'](_0xc8ee('0x29'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x2a')]);router[_0xc8ee('0x5')](_0xc8ee('0x2b'),auth[_0xc8ee('0x6')](),controller['getSmsAccounts']);router[_0xc8ee('0x5')](_0xc8ee('0x2c'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x2d')]);router[_0xc8ee('0x5')](_0xc8ee('0x2e'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x2f')]);router[_0xc8ee('0x5')]('/:id/scheduled_calls',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x30')]);router[_0xc8ee('0x5')](_0xc8ee('0x31'),auth['isAuthenticated'](),controller[_0xc8ee('0x32')]);router['post']('/:id/contacts',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x33')]);router[_0xc8ee('0x34')]('/',auth[_0xc8ee('0x6')](),controller['create']);router[_0xc8ee('0x34')](_0xc8ee('0x35'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x36')]);router[_0xc8ee('0x34')](_0xc8ee('0x13'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x37')]);var upload=multer({'storage':multer[_0xc8ee('0x38')]({'destination':function(_0x343544,_0x37d431,_0x359ca6){_0x359ca6(null,path[_0xc8ee('0x39')](config[_0xc8ee('0x3a')],_0xc8ee('0x3b')));},'filename':function(_0x56f447,_0x44e7f6,_0x584b12){_0x584b12(null,util['format'](_0xc8ee('0x3c'),Date['now'](),_0x44e7f6[_0xc8ee('0x3d')]));}})});router[_0xc8ee('0x34')](_0xc8ee('0x3e'),upload[_0xc8ee('0x3f')](_0xc8ee('0x40')),controller[_0xc8ee('0x41')]);router[_0xc8ee('0x34')](_0xc8ee('0x42'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x43')]);router[_0xc8ee('0x34')](_0xc8ee('0x44'),auth['isAuthenticated'](),controller['logout']);router[_0xc8ee('0x34')]('/:id/pause',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x45')]);router['post'](_0xc8ee('0x46'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x47')]);router[_0xc8ee('0x34')](_0xc8ee('0x21'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc8ee('0x34')](_0xc8ee('0x48'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x49')]);router[_0xc8ee('0x34')](_0xc8ee('0x4a'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x4b')]);router[_0xc8ee('0x34')](_0xc8ee('0x4c'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x4d')]);router[_0xc8ee('0x34')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xc8ee('0x4e')]);router['post'](_0xc8ee('0x4f'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x50')]);router[_0xc8ee('0x34')]('/:id/whatsapp_interactions',auth[_0xc8ee('0x6')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x51')]);router[_0xc8ee('0x34')](_0xc8ee('0x28'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x52')]);router[_0xc8ee('0x34')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xc8ee('0x53')]);router[_0xc8ee('0x34')](_0xc8ee('0x2b'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x54')]);router[_0xc8ee('0x34')](_0xc8ee('0x2c'),auth[_0xc8ee('0x6')](),controller['addChatWebsites']);router[_0xc8ee('0x34')](_0xc8ee('0x2e'),auth[_0xc8ee('0x6')](),controller['addWhatsappAccounts']);router[_0xc8ee('0x34')](_0xc8ee('0x31'),auth[_0xc8ee('0x6')](),controller['createApiKey']);router['put'](_0xc8ee('0xc'),auth['isAuthenticated'](),controller[_0xc8ee('0x55')]);router[_0xc8ee('0x56')](_0xc8ee('0x57'),auth['isAuthenticated'](),controller['changePassword']);router[_0xc8ee('0x58')](_0xc8ee('0x13'),auth['isAuthenticated'](),controller[_0xc8ee('0x59')]);router[_0xc8ee('0x58')](_0xc8ee('0x21'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x5a')]);router[_0xc8ee('0x58')]('/:id',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x5b')]);router['delete'](_0xc8ee('0x48'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x5c')]);router[_0xc8ee('0x58')](_0xc8ee('0x4a'),auth['isAuthenticated'](),controller[_0xc8ee('0x5d')]);router[_0xc8ee('0x58')](_0xc8ee('0x4c'),auth['isAuthenticated'](),controller[_0xc8ee('0x5e')]);router[_0xc8ee('0x58')](_0xc8ee('0x5f'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x60')]);router[_0xc8ee('0x58')](_0xc8ee('0x4f'),auth['isAuthenticated'](),controller[_0xc8ee('0x61')]);router[_0xc8ee('0x58')]('/:id/whatsapp_interactions',auth[_0xc8ee('0x6')](),controller['removeWhatsappInteractions']);router['delete'](_0xc8ee('0x27'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x62')]);router[_0xc8ee('0x58')](_0xc8ee('0x28'),auth['isAuthenticated'](),controller[_0xc8ee('0x63')]);router['delete'](_0xc8ee('0x29'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x64')]);router[_0xc8ee('0x58')](_0xc8ee('0x2b'),auth[_0xc8ee('0x6')](),controller['removeSmsAccounts']);router[_0xc8ee('0x58')](_0xc8ee('0x2c'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x65')]);router[_0xc8ee('0x58')]('/:id/whatsapp_accounts',auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x66')]);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller[_0xc8ee('0x67')]);router[_0xc8ee('0x34')](_0xc8ee('0x68'),auth[_0xc8ee('0x6')](),controller[_0xc8ee('0x69')]);module['exports']=router; \ No newline at end of file +var _0x0009=['root','server/files/images/','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','createApiKey','put','update','/:id/password','changePassword','delete','/:id/teams','removeTeams','destroy','/:id/chat_interactions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join'];(function(_0x52fe2d,_0x227427){var _0xbe709a=function(_0x4f4100){while(--_0x4f4100){_0x52fe2d['push'](_0x52fe2d['shift']());}};_0xbe709a(++_0x227427);}(_0x0009,0x188));var _0x9000=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x0009[_0x291f8b];return _0x275171;};'use strict';var multer=require(_0x9000('0x0'));var util=require('util');var path=require(_0x9000('0x1'));var timeout=require(_0x9000('0x2'));var express=require(_0x9000('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9000('0x4'));var interaction=require(_0x9000('0x5'));var config=require(_0x9000('0x6'));var controller=require(_0x9000('0x7'));router[_0x9000('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9000('0x8')](_0x9000('0x9'),auth[_0x9000('0xa')](),controller[_0x9000('0xb')]);router[_0x9000('0x8')](_0x9000('0xc'),auth['isAuthenticated'](),controller[_0x9000('0xd')]);router[_0x9000('0x8')](_0x9000('0xe'),auth[_0x9000('0xa')](),controller[_0x9000('0xf')]);router[_0x9000('0x8')](_0x9000('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x9000('0x8')](_0x9000('0x11'),controller[_0x9000('0x12')]);router[_0x9000('0x8')](_0x9000('0x13'),auth[_0x9000('0xa')](),controller[_0x9000('0x14')]);router['get'](_0x9000('0x15'),auth['isAuthenticated'](),controller[_0x9000('0x16')]);router[_0x9000('0x8')](_0x9000('0x17'),auth[_0x9000('0xa')](),controller[_0x9000('0x18')]);router[_0x9000('0x8')](_0x9000('0x19'),auth[_0x9000('0xa')](),controller['getVoiceQueuesRt']);router[_0x9000('0x8')](_0x9000('0x1a'),auth[_0x9000('0xa')](),controller['getGroups']);router['get'](_0x9000('0x1b'),auth[_0x9000('0xa')](),controller[_0x9000('0x1c')]);router['get'](_0x9000('0x1d'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x9000('0x8')]('/:id/chat/interactions',auth[_0x9000('0xa')](),controller[_0x9000('0x1e')]);router['get'](_0x9000('0x1f'),auth[_0x9000('0xa')](),controller[_0x9000('0x20')]);router['get'](_0x9000('0x21'),auth[_0x9000('0xa')](),controller[_0x9000('0x22')]);router['get']('/:id/sms/interactions',auth[_0x9000('0xa')](),controller[_0x9000('0x23')]);router[_0x9000('0x8')](_0x9000('0x24'),auth[_0x9000('0xa')](),controller[_0x9000('0x25')]);router[_0x9000('0x8')](_0x9000('0x26'),auth[_0x9000('0xa')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x9000('0xa')](),controller[_0x9000('0x27')]);router[_0x9000('0x8')](_0x9000('0x28'),auth[_0x9000('0xa')](),controller['getLists']);router[_0x9000('0x8')](_0x9000('0x29'),auth[_0x9000('0xa')](),controller[_0x9000('0x2a')]);router['get'](_0x9000('0x2b'),auth[_0x9000('0xa')](),controller[_0x9000('0x2c')]);router['get'](_0x9000('0x2d'),auth[_0x9000('0xa')](),controller[_0x9000('0x2e')]);router[_0x9000('0x8')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x9000('0x2f')]);router[_0x9000('0x8')]('/:id/openchannel_accounts',auth[_0x9000('0xa')](),controller[_0x9000('0x30')]);router['get'](_0x9000('0x31'),auth[_0x9000('0xa')](),controller['getSmsAccounts']);router[_0x9000('0x8')](_0x9000('0x32'),auth['isAuthenticated'](),controller[_0x9000('0x33')]);router['get'](_0x9000('0x34'),auth['isAuthenticated'](),controller[_0x9000('0x35')]);router[_0x9000('0x8')]('/:id/scheduled_calls',auth[_0x9000('0xa')](),controller[_0x9000('0x36')]);router[_0x9000('0x8')](_0x9000('0x37'),auth[_0x9000('0xa')](),controller[_0x9000('0x38')]);router[_0x9000('0x39')](_0x9000('0x15'),auth[_0x9000('0xa')](),controller[_0x9000('0x3a')]);router[_0x9000('0x39')]('/',auth['isAuthenticated'](),controller[_0x9000('0x3b')]);router['post'](_0x9000('0x3c'),auth[_0x9000('0xa')](),controller[_0x9000('0x3d')]);router[_0x9000('0x39')]('/:id/queues',auth[_0x9000('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x9000('0x3e')]({'destination':function(_0x4b5988,_0x2d73bf,_0x1afc16){_0x1afc16(null,path[_0x9000('0x3f')](config[_0x9000('0x40')],_0x9000('0x41')));},'filename':function(_0x56ef77,_0x4426db,_0x298891){_0x298891(null,util['format'](_0x9000('0x42'),Date[_0x9000('0x43')](),_0x4426db[_0x9000('0x44')]));}})});router[_0x9000('0x39')]('/:id/avatar',upload['single'](_0x9000('0x45')),controller[_0x9000('0x46')]);router[_0x9000('0x39')](_0x9000('0x47'),auth[_0x9000('0xa')](),controller[_0x9000('0x48')]);router[_0x9000('0x39')](_0x9000('0x49'),auth[_0x9000('0xa')](),controller['logout']);router[_0x9000('0x39')](_0x9000('0x4a'),auth[_0x9000('0xa')](),controller[_0x9000('0x4b')]);router[_0x9000('0x39')](_0x9000('0x4c'),auth[_0x9000('0xa')](),controller[_0x9000('0x4d')]);router[_0x9000('0x39')]('/:id/teams',auth[_0x9000('0xa')](),controller['addTeams']);router[_0x9000('0x39')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x9000('0x39')]('/:id/mail_interactions',auth[_0x9000('0xa')](),controller['addMailInteractions']);router[_0x9000('0x39')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x9000('0x4e')]);router[_0x9000('0x39')](_0x9000('0x4f'),auth[_0x9000('0xa')](),controller[_0x9000('0x50')]);router['post'](_0x9000('0x51'),auth['isAuthenticated'](),controller[_0x9000('0x52')]);router[_0x9000('0x39')](_0x9000('0x53'),auth[_0x9000('0xa')](),controller[_0x9000('0x54')]);router[_0x9000('0x39')]('/:id/fax_accounts',auth[_0x9000('0xa')](),controller[_0x9000('0x55')]);router[_0x9000('0x39')](_0x9000('0x56'),auth[_0x9000('0xa')](),controller[_0x9000('0x57')]);router[_0x9000('0x39')](_0x9000('0x58'),auth[_0x9000('0xa')](),controller[_0x9000('0x59')]);router[_0x9000('0x39')](_0x9000('0x31'),auth[_0x9000('0xa')](),controller[_0x9000('0x5a')]);router['post']('/:id/chat_websites',auth[_0x9000('0xa')](),controller['addChatWebsites']);router[_0x9000('0x39')](_0x9000('0x34'),auth[_0x9000('0xa')](),controller['addWhatsappAccounts']);router['post'](_0x9000('0x37'),auth[_0x9000('0xa')](),controller[_0x9000('0x5b')]);router[_0x9000('0x5c')](_0x9000('0x10'),auth['isAuthenticated'](),controller[_0x9000('0x5d')]);router[_0x9000('0x5c')](_0x9000('0x5e'),auth[_0x9000('0xa')](),controller[_0x9000('0x5f')]);router[_0x9000('0x60')](_0x9000('0x17'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x9000('0x60')](_0x9000('0x61'),auth['isAuthenticated'](),controller[_0x9000('0x62')]);router[_0x9000('0x60')](_0x9000('0x10'),auth[_0x9000('0xa')](),controller[_0x9000('0x63')]);router['delete'](_0x9000('0x64'),auth[_0x9000('0xa')](),controller['removeChatInteractions']);router[_0x9000('0x60')](_0x9000('0x65'),auth[_0x9000('0xa')](),controller[_0x9000('0x66')]);router[_0x9000('0x60')]('/:id/fax_interactions',auth[_0x9000('0xa')](),controller[_0x9000('0x67')]);router['delete'](_0x9000('0x4f'),auth['isAuthenticated'](),controller[_0x9000('0x68')]);router['delete']('/:id/openchannel_interactions',auth[_0x9000('0xa')](),controller[_0x9000('0x69')]);router['delete'](_0x9000('0x53'),auth[_0x9000('0xa')](),controller['removeWhatsappInteractions']);router[_0x9000('0x60')](_0x9000('0x2d'),auth[_0x9000('0xa')](),controller['removeFaxAccounts']);router['delete'](_0x9000('0x56'),auth['isAuthenticated'](),controller[_0x9000('0x6a')]);router[_0x9000('0x60')]('/:id/openchannel_accounts',auth[_0x9000('0xa')](),controller[_0x9000('0x6b')]);router['delete'](_0x9000('0x31'),auth[_0x9000('0xa')](),controller[_0x9000('0x6c')]);router['delete']('/:id/chat_websites',auth[_0x9000('0xa')](),controller[_0x9000('0x6d')]);router[_0x9000('0x60')](_0x9000('0x34'),auth['isAuthenticated'](),controller[_0x9000('0x6e')]);router[_0x9000('0x60')](_0x9000('0x37'),auth[_0x9000('0xa')](),controller[_0x9000('0x6f')]);router[_0x9000('0x39')]('/:id/messengerSoundNotification',auth[_0x9000('0xa')](),controller[_0x9000('0x70')]);module[_0x9000('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2e76c99..3760acf 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 _0x78a5=['admin','user','agent','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','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]','shortinfo','inband','auto','rfc2833','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','nonat','update','update,nonat','TEXT','wss','avpf','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','blockedAt','loginAttempts','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','toLowerCase'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78a5,0x157));var _0x578a=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x78a5[_0x456a4b];return _0x42957c;};'use strict';var Sequelize=require(_0x578a('0x0'));var moment=require(_0x578a('0x1'));var util=require(_0x578a('0x2'));var _=require('lodash');module[_0x578a('0x3')]={'name':{'type':Sequelize[_0x578a('0x4')],'allowNull':![],'unique':_0x578a('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9._]+$/i},'set':function(_0x1f857f){this[_0x578a('0x6')]('name',_0x1f857f);this[_0x578a('0x6')](_0x578a('0x7'),_0x1f857f);},'comment':_0x578a('0x8')},'fullname':{'type':Sequelize[_0x578a('0x4')],'allowNull':![],'set':function(_0x48b283){this['setDataValue'](_0x578a('0x9'),_0x48b283);this['setDataValue'](_0x578a('0xa'),util[_0x578a('0xb')](_0x578a('0xc'),_0x48b283,this[_0x578a('0xd')](_0x578a('0xe'))));}},'alias':{'type':Sequelize[_0x578a('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4e371f){if(_0x4e371f){this['setDataValue'](_0x578a('0xf'),_0x4e371f[_0x578a('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x578a('0x11'),_0x578a('0x12'),_0x578a('0x13'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x578a('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x578a('0x4')],'defaultValue':_0x578a('0x14')},'internal':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':![],'unique':_0x578a('0xe'),'set':function(_0x5413ec){this[_0x578a('0x6')](_0x578a('0xe'),_0x5413ec);this[_0x578a('0x6')](_0x578a('0x16'),_0x5413ec);this['setDataValue'](_0x578a('0xa'),util[_0x578a('0xb')](_0x578a('0xc'),this[_0x578a('0xd')](_0x578a('0x9')),_0x5413ec));}},'salt':{'type':Sequelize[_0x578a('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x578a('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x578a('0x4')]},'userpic':{'type':Sequelize[_0x578a('0x4')]},'city':{'type':Sequelize[_0x578a('0x4')]},'country':{'type':Sequelize[_0x578a('0x4')]},'online':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x578a('0x18')]},'chatCapacity':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x578a('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x578a('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![],'defaultValue':_0x578a('0x19')},'ipaddr':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x1b'),_0x578a('0x12'),_0x578a('0x1c')),'allowNull':!![],'defaultValue':_0x578a('0x1b')},'context':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![],'defaultValue':_0x578a('0x1d')},'callingpres':{'type':Sequelize[_0x578a('0x1a')]('ALLOWED_NOT_SCREENED',_0x578a('0x1e'),_0x578a('0x1f'),_0x578a('0x20'),_0x578a('0x21'),_0x578a('0x22'),_0x578a('0x23'),_0x578a('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![],'defaultValue':_0x578a('0x25'),'set':function(_0x147128){this[_0x578a('0x6')](_0x578a('0x26'),_0x147128?_0x147128[_0x578a('0x27')](','):null);},'get':function(){return this[_0x578a('0xd')](_0x578a('0x26'))?this[_0x578a('0xd')]('transport')[_0x578a('0x28')](','):null;},'comment':_0x578a('0x29')},'dtmfmode':{'type':Sequelize[_0x578a('0x1a')]('rfc2833','info',_0x578a('0x2a'),_0x578a('0x2b'),_0x578a('0x2c')),'allowNull':!![],'defaultValue':_0x578a('0x2d')},'directmedia':{'type':Sequelize[_0x578a('0x1a')]('yes','no','nonat','update',_0x578a('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x472a7e){this[_0x578a('0x6')](_0x578a('0x30'),_0x472a7e?_0x472a7e[_0x578a('0x27')](','):null);},'get':function(){return this[_0x578a('0xd')](_0x578a('0x30'))?this[_0x578a('0xd')](_0x578a('0x30'))[_0x578a('0x28')](','):null;},'comment':_0x578a('0x31')},'callgroup':{'type':Sequelize[_0x578a('0x4')]},'namedcallgroup':{'type':Sequelize[_0x578a('0x4')]},'pickupgroup':{'type':Sequelize[_0x578a('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x578a('0x4')]},'language':{'type':Sequelize[_0x578a('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x578a('0x4')],'allowNull':![],'defaultValue':_0x578a('0x32')},'allow':{'type':Sequelize[_0x578a('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3551e3){this['setDataValue'](_0x578a('0x33'),_0x3551e3?_0x3551e3[_0x578a('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x578a('0xd')](_0x578a('0x33'))?this['getDataValue'](_0x578a('0x33'))[_0x578a('0x28')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![],'set':function(_0x2c1b8b){this['setDataValue'](_0x578a('0x34'),_0x2c1b8b?_0x2c1b8b[_0x578a('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x578a('0x34'))?this[_0x578a('0xd')](_0x578a('0x34'))['split'](','):null;},'comment':_0x578a('0x35')},'trustrpid':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no',_0x578a('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':_0x578a('0x2f')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no',_0x578a('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x578a('0x38'),_0x578a('0x39'),_0x578a('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x3b'),_0x578a('0x3c')),'allowNull':!![],'defaultValue':_0x578a('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x578a('0x2f')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x578a('0x1a')](_0x578a('0x2f'),'no',_0x578a('0x3d'),_0x578a('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x578a('0x3f'),_0x578a('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x578a('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x578a('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x578a('0x1a')]('yes','no',_0x578a('0x41'),_0x578a('0x42'),_0x578a('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x578a('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x578a('0x18')]},'passwordResetAt':{'type':Sequelize[_0x578a('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x578a('0x44')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4e3fd9){this[_0x578a('0x6')]('showWebBar',_0x4e3fd9);var _0x44c62e=this['get']({'plain':!![]});switch(_0x4e3fd9){case 0x0:case 0x1:var _0x29f8c7=_0x44c62e[_0x578a('0x26')]?_['isArray'](_0x44c62e[_0x578a('0x26')])?_0x44c62e[_0x578a('0x26')][_0x578a('0x27')]():_0x44c62e[_0x578a('0x26')]:_0x578a('0x25');if(_0x29f8c7===_0x578a('0x45')){_0x29f8c7=_0x578a('0x25');}this[_0x578a('0x6')](_0x578a('0x26'),_0x29f8c7);this['setDataValue']('encryption','no');this[_0x578a('0x6')](_0x578a('0x46'),null);this[_0x578a('0x6')]('force_avp',null);this[_0x578a('0x6')](_0x578a('0x47'),null);this['setDataValue']('dtlsenable',null);this[_0x578a('0x6')](_0x578a('0x48'),null);this[_0x578a('0x6')](_0x578a('0x49'),null);this[_0x578a('0x6')](_0x578a('0x4a'),null);this[_0x578a('0x6')](_0x578a('0x4b'),null);this[_0x578a('0x6')](_0x578a('0x4c'),'no');break;case 0x2:this[_0x578a('0x6')](_0x578a('0x26'),_0x578a('0x45'));this[_0x578a('0x6')]('encryption','yes');this[_0x578a('0x6')](_0x578a('0x46'),_0x578a('0x2f'));this[_0x578a('0x6')](_0x578a('0x4d'),_0x578a('0x2f'));this[_0x578a('0x6')](_0x578a('0x47'),_0x578a('0x2f'));this['setDataValue'](_0x578a('0x4e'),_0x578a('0x2f'));this['setDataValue'](_0x578a('0x48'),'no');this[_0x578a('0x6')](_0x578a('0x49'),'actpass');this[_0x578a('0x6')]('dtlscertfile',_0x44c62e[_0x578a('0x4a')]||_0x578a('0x4f'));this[_0x578a('0x6')](_0x578a('0x4b'),_0x44c62e[_0x578a('0x4b')]||_0x578a('0x50'));this[_0x578a('0x6')](_0x578a('0x4c'),_0x578a('0x2f'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x56b07c){this[_0x578a('0x6')](_0x578a('0x51'),_0x56b07c?_0x56b07c[_0x578a('0x27')](','):[]);},'get':function(){return this[_0x578a('0xd')](_0x578a('0x51'))?_['map'](this['getDataValue']('permissions')[_0x578a('0x28')](','),function(_0x4f7278){return parseInt(_0x4f7278,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x578a('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x578a('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x578a('0x52')],'get':function(){return this[_0x578a('0xd')](_0x578a('0x53'))?this[_0x578a('0xd')](_0x578a('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x578a('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x578a('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![],'set':function(_0x4db099){if(typeof _0x4db099===_0x578a('0x54')){var _0x1f1e8e=_0x4db099==='1'?!![]:_0x4db099==='0'?![]:_0x4db099===_0x578a('0x55')?!![]:_0x4db099===_0x578a('0x56')?![]:![];this['setDataValue']('screenrecording',_0x1f1e8e);}else{this[_0x578a('0x6')]('screenrecording',_0x4db099);}}},'blocked':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![],'set':function(_0x388996){this['setDataValue']('blocked',_0x388996);if(_0x388996===!![]){this[_0x578a('0x6')](_0x578a('0x57'),moment());this['setDataValue'](_0x578a('0x58'),0x0);}else{this[_0x578a('0x6')](_0x578a('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x578a('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x578a('0x15')](0x5)[_0x578a('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x578a('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x578a('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x578a('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x53d1=['icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','passive','actpass','TEXT','showWebBar','get','isArray','wss','avpf','force_avp'];(function(_0xae4d23,_0xd31a8){var _0x2a1462=function(_0x3891ef){while(--_0x3891ef){_0xae4d23['push'](_0xae4d23['shift']());}};_0x2a1462(++_0xd31a8);}(_0x53d1,0x73));var _0x153d=function(_0x5a9b11,_0x505157){_0x5a9b11=_0x5a9b11-0x0;var _0x3a7394=_0x53d1[_0x5a9b11];return _0x3a7394;};'use strict';var Sequelize=require(_0x153d('0x0'));var moment=require(_0x153d('0x1'));var util=require('util');var _=require(_0x153d('0x2'));module[_0x153d('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x153d('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9._]+$/i},'set':function(_0x56cd25){this[_0x153d('0x5')](_0x153d('0x4'),_0x56cd25);this[_0x153d('0x5')]('defaultuser',_0x56cd25);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x153d('0x6')],'allowNull':![],'set':function(_0x5d5c04){this['setDataValue'](_0x153d('0x7'),_0x5d5c04);this[_0x153d('0x5')](_0x153d('0x8'),util[_0x153d('0x9')](_0x153d('0xa'),_0x5d5c04,this[_0x153d('0xb')](_0x153d('0xc'))));}},'alias':{'type':Sequelize[_0x153d('0x6')]},'email':{'type':Sequelize[_0x153d('0x6')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4325fb){if(_0x4325fb){this['setDataValue'](_0x153d('0xd'),_0x4325fb['toLowerCase']());}}},'role':{'type':Sequelize[_0x153d('0xe')](_0x153d('0xf'),_0x153d('0x10'),_0x153d('0x11'),_0x153d('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x153d('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x153d('0x6')],'defaultValue':_0x153d('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x153d('0xc'),'set':function(_0xaed40c){this[_0x153d('0x5')]('internal',_0xaed40c);this[_0x153d('0x5')](_0x153d('0x14'),_0xaed40c);this[_0x153d('0x5')](_0x153d('0x8'),util[_0x153d('0x9')](_0x153d('0xa'),this['getDataValue'](_0x153d('0x7')),_0xaed40c));}},'salt':{'type':Sequelize[_0x153d('0x6')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x153d('0x6')]},'userpic':{'type':Sequelize[_0x153d('0x6')]},'city':{'type':Sequelize[_0x153d('0x6')]},'country':{'type':Sequelize[_0x153d('0x6')]},'online':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x153d('0x6')],'defaultValue':_0x153d('0x16')},'lastPauseAt':{'type':Sequelize[_0x153d('0x17')]},'chatCapacity':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x153d('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x153d('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'host':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'defaultValue':_0x153d('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x153d('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x153d('0xe')]('friend',_0x153d('0x10'),_0x153d('0x1a')),'allowNull':!![],'defaultValue':_0x153d('0x1b')},'context':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'defaultValue':_0x153d('0x1c')},'callingpres':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x1d'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x153d('0x1e'),'PROHIB_NOT_SCREENED',_0x153d('0x1f'),'PROHIB_FAILED_SCREEN',_0x153d('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'permit':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'defaultValue':_0x153d('0x21'),'set':function(_0x464507){this[_0x153d('0x5')](_0x153d('0x22'),_0x464507?_0x464507[_0x153d('0x23')](','):null);},'get':function(){return this[_0x153d('0xb')](_0x153d('0x22'))?this['getDataValue'](_0x153d('0x22'))[_0x153d('0x24')](','):null;},'comment':_0x153d('0x25')},'dtmfmode':{'type':Sequelize[_0x153d('0xe')]('rfc2833',_0x153d('0x26'),_0x153d('0x27'),_0x153d('0x28'),_0x153d('0x29')),'allowNull':!![],'defaultValue':_0x153d('0x2a')},'directmedia':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no',_0x153d('0x2c'),_0x153d('0x2d'),_0x153d('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'defaultValue':_0x153d('0x2f'),'set':function(_0x2ed4d7){this[_0x153d('0x5')](_0x153d('0x30'),_0x2ed4d7?_0x2ed4d7['join'](','):null);},'get':function(){return this[_0x153d('0xb')]('nat')?this[_0x153d('0xb')](_0x153d('0x30'))[_0x153d('0x24')](','):null;},'comment':_0x153d('0x31')},'callgroup':{'type':Sequelize[_0x153d('0x6')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x153d('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x153d('0x6')]},'language':{'type':Sequelize[_0x153d('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x153d('0x6')]},'disallow':{'type':Sequelize[_0x153d('0x6')],'allowNull':![],'defaultValue':_0x153d('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1bc14d){this[_0x153d('0x5')](_0x153d('0x33'),_0x1bc14d?_0x1bc14d[_0x153d('0x23')](';'):_0x153d('0x34'));},'get':function(){return this[_0x153d('0xb')](_0x153d('0x33'))?this['getDataValue'](_0x153d('0x33'))[_0x153d('0x24')](';'):null;},'comment':_0x153d('0x35')},'autoframing':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'set':function(_0x351674){this[_0x153d('0x5')](_0x153d('0x36'),_0x351674?_0x351674[_0x153d('0x23')](','):null);},'get':function(){return this[_0x153d('0xb')](_0x153d('0x36'))?this['getDataValue'](_0x153d('0x36'))['split'](','):null;},'comment':_0x153d('0x37')},'trustrpid':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x153d('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![],'defaultValue':_0x153d('0x39')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x153d('0x2b')},'busylevel':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x153d('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'template':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x153d('0x2b'),'no',_0x153d('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x153d('0x3b'),_0x153d('0x3c'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x3d'),_0x153d('0x3e')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x153d('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no',_0x153d('0x3f'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x153d('0xe')]('active',_0x153d('0x40'),_0x153d('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x153d('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x153d('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no',_0x153d('0x2c'),_0x153d('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x153d('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0x153d('0x17')]},'passwordResetAt':{'type':Sequelize[_0x153d('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x153d('0x42')]},'showWebBar':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0,'set':function(_0x4b6ccd){this[_0x153d('0x5')](_0x153d('0x43'),_0x4b6ccd);var _0x2df62b=this[_0x153d('0x44')]({'plain':!![]});switch(_0x4b6ccd){case 0x0:case 0x1:var _0x48912a=_0x2df62b[_0x153d('0x22')]?_[_0x153d('0x45')](_0x2df62b['transport'])?_0x2df62b[_0x153d('0x22')]['join']():_0x2df62b['transport']:_0x153d('0x21');if(_0x48912a===_0x153d('0x46')){_0x48912a=_0x153d('0x21');}this[_0x153d('0x5')](_0x153d('0x22'),_0x48912a);this[_0x153d('0x5')]('encryption','no');this[_0x153d('0x5')](_0x153d('0x47'),null);this[_0x153d('0x5')](_0x153d('0x48'),null);this[_0x153d('0x5')](_0x153d('0x49'),null);this[_0x153d('0x5')](_0x153d('0x4a'),null);this[_0x153d('0x5')](_0x153d('0x4b'),null);this[_0x153d('0x5')](_0x153d('0x4c'),null);this[_0x153d('0x5')](_0x153d('0x4d'),null);this[_0x153d('0x5')](_0x153d('0x4e'),null);this['setDataValue'](_0x153d('0x4f'),'no');break;case 0x2:this[_0x153d('0x5')](_0x153d('0x22'),_0x153d('0x46'));this[_0x153d('0x5')](_0x153d('0x50'),_0x153d('0x2b'));this[_0x153d('0x5')](_0x153d('0x47'),_0x153d('0x2b'));this[_0x153d('0x5')]('force_avp','yes');this[_0x153d('0x5')]('icesupport',_0x153d('0x2b'));this[_0x153d('0x5')]('dtlsenable','yes');this[_0x153d('0x5')](_0x153d('0x4b'),'no');this['setDataValue'](_0x153d('0x4c'),_0x153d('0x41'));this['setDataValue'](_0x153d('0x4d'),_0x2df62b[_0x153d('0x4d')]||_0x153d('0x51'));this['setDataValue'](_0x153d('0x4e'),_0x2df62b[_0x153d('0x4e')]||_0x153d('0x52'));this[_0x153d('0x5')](_0x153d('0x4f'),_0x153d('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x153d('0x42')],'set':function(_0x5db92c){this[_0x153d('0x5')]('permissions',_0x5db92c?_0x5db92c[_0x153d('0x23')](','):[]);},'get':function(){return this[_0x153d('0xb')](_0x153d('0x53'))?_[_0x153d('0x54')](this['getDataValue'](_0x153d('0x53'))['split'](','),function(_0x4abd7e){return parseInt(_0x4abd7e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x153d('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x153d('0x6')]},'phoneBarBusyNumber':{'type':Sequelize[_0x153d('0x6')]},'phoneBarUnconditional':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x153d('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x153d('0xe')](_0x153d('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x153d('0x6')]},'phoneBarEnableJaws':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x153d('0x55')],'get':function(){return this[_0x153d('0xb')](_0x153d('0x56'))?this[_0x153d('0xb')](_0x153d('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x153d('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x153d('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![],'set':function(_0x3396fa){if(typeof _0x3396fa===_0x153d('0x57')){var _0x5bb7a2=_0x3396fa==='1'?!![]:_0x3396fa==='0'?![]:_0x3396fa==='true'?!![]:_0x3396fa===_0x153d('0x58')?![]:![];this[_0x153d('0x5')](_0x153d('0x59'),_0x5bb7a2);}else{this[_0x153d('0x5')](_0x153d('0x59'),_0x3396fa);}}},'blocked':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![],'set':function(_0x4544fc){this[_0x153d('0x5')](_0x153d('0x5a'),_0x4544fc);if(_0x4544fc===!![]){this[_0x153d('0x5')]('blockedAt',moment());this[_0x153d('0x5')](_0x153d('0x5b'),0x0);}else{this[_0x153d('0x5')](_0x153d('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0x153d('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x153d('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x153d('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'messengerSoundNotification':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x153d('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x153d('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x153d('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 292f6ec..5b9d02b 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 _0x0b7f=['102','103','113','110','105','106','107','109','100','114','115','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Telephones','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','voicePause','interface','isValidChannel','Unknown\x20channel','toLowerCase','Queues','penalty','spread','capitalize','QueueId','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','removeQueues','channel','remove','isArray','Queue:remove','addAvatar','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','existsSync','server/files/images/','download','getOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','List','Tag','Tags','color','tag','getQueues','Queue','filters','order','sort','pick','Unknown\x20role','nolimit','getVoiceQueuesRt','hasOwnProperty','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','faxPause','pauseType','lastPauseAt','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','UserVoicePrefix','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','omit','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','FaxAccount','getFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$gt','$lt','$lte','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contains','$any','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unavailable','voiceStatus','busy','slice','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','moment','util','lodash','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','localhost','client','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','agent','emit','userNotification:recalc:','destroy','get','role','admin','Users','Agents','telephone','filter','ignore','map','value','includes','find','name','index','User','fieldName','type','key','salt','getOptions','where','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','rows','chat','dataValues','fax','mail','openchannel','whatsapp','all','show','params','keys','rawAttributes','password','intersection','fields','length','model','merge','options','openTabs','sms','body','describe','addContacts','ids','internal','Setting','validatePasswordPattern','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','VoiceMail','fullname','email','permissions','101'];(function(_0x350930,_0x27e814){var _0xeec4b8=function(_0x216724){while(--_0x216724){_0x350930['push'](_0x350930['shift']());}};_0xeec4b8(++_0x27e814);}(_0x0b7f,0x115));var _0xf0b7=function(_0x195802,_0x3edb16){_0x195802=_0x195802-0x0;var _0x3bb28f=_0x0b7f[_0x195802];return _0x3bb28f;};'use strict';var moment=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xf0b7('0x2'));var squel=require('squel');var jayson=require(_0xf0b7('0x3'));var Redis=require(_0xf0b7('0x4'));var authService=require(_0xf0b7('0x5'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0xf0b7('0x6'))(_0xf0b7('0x7'));var utils=require(_0xf0b7('0x8'));var config=require(_0xf0b7('0x9'));var licenseUtil=require(_0xf0b7('0xa'));var APIBadRequestError=require('../../errors/api')[_0xf0b7('0xb')];var APINotFoundError=require(_0xf0b7('0xc'))[_0xf0b7('0xd')];var APIHandleError=require(_0xf0b7('0xc'))[_0xf0b7('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0xf0b7('0xf'))(new Redis(config['redis']));require('./user.socket')['register'](socket);config[_0xf0b7('0x10')]=_['defaults'](config['redis'],{'host':_0xf0b7('0x11'),'port':0x18eb});var amiClient=jayson[_0xf0b7('0x12')][_0xf0b7('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5eb22,_0x15e3e5,_0x217993,_0xbd18dc){return new Promise(function(_0x1c6800,_0x5ce25d){var _0x4a8173=_0xbd18dc||amiClient;return _0x4a8173[_0xf0b7('0x14')](_0x5eb22,_0x217993)[_0xf0b7('0x15')](function(_0x717ab0){logger[_0xf0b7('0x16')](_0xf0b7('0x17'),_0x15e3e5,'request\x20sent');logger[_0xf0b7('0x18')](_0xf0b7('0x19'),_0x15e3e5,_0xf0b7('0x1a'),JSON[_0xf0b7('0x1b')](_0x717ab0));if(_0x717ab0['error']){if(_0x717ab0[_0xf0b7('0x1c')][_0xf0b7('0x1d')]===0x1f4){logger[_0xf0b7('0x1c')](_0xf0b7('0x17'),_0x15e3e5,_0x717ab0['error'][_0xf0b7('0x1e')]);return _0x5ce25d(_0x717ab0[_0xf0b7('0x1c')][_0xf0b7('0x1e')]);}logger[_0xf0b7('0x1c')](_0xf0b7('0x17'),_0x15e3e5,_0x717ab0['error'][_0xf0b7('0x1e')]);return _0x1c6800(_0x717ab0['error'][_0xf0b7('0x1e')]);}else{logger[_0xf0b7('0x16')](_0xf0b7('0x17'),_0x15e3e5,'request\x20sent');_0x1c6800(_0x717ab0['result'][_0xf0b7('0x1e')]);}})[_0xf0b7('0x1f')](function(_0x360c23){logger[_0xf0b7('0x1c')](_0xf0b7('0x17'),_0x15e3e5,_0x360c23);_0x5ce25d(_0x360c23);});});}function respondWithStatusCode(_0xc36f43,_0x42f97a){_0x42f97a=_0x42f97a||0xcc;return function(_0x2228b4){if(_0x2228b4){return _0xc36f43[_0xf0b7('0x20')](_0x42f97a);}return _0xc36f43['status'](_0x42f97a)[_0xf0b7('0x21')]();};}function respondWithResult(_0x2cfb7b,_0x14782a){_0x14782a=_0x14782a||0xc8;return function(_0x210afa){if(_0x210afa){return _0x2cfb7b[_0xf0b7('0x22')](_0x14782a)[_0xf0b7('0x23')](_0x210afa);}};}function respondWithFilteredResult(_0x4724f1,_0x1bb7cf){return function(_0x66b1dc){if(_0x66b1dc){var _0x2c273e=typeof _0x1bb7cf['offset']===_0xf0b7('0x24')&&typeof _0x1bb7cf[_0xf0b7('0x25')]==='undefined';var _0x1d02e6=_0x66b1dc[_0xf0b7('0x26')];var _0x3709a5=_0x2c273e?0x0:_0x1bb7cf['offset'];var _0x2aedd3=_0x2c273e?_0x66b1dc[_0xf0b7('0x26')]:_0x1bb7cf[_0xf0b7('0x27')]+_0x1bb7cf['limit'];var _0x1cf15d;if(_0x2aedd3>=_0x1d02e6){_0x2aedd3=_0x1d02e6;_0x1cf15d=0xc8;}else{_0x1cf15d=0xce;}_0x4724f1[_0xf0b7('0x22')](_0x1cf15d);return _0x4724f1[_0xf0b7('0x28')](_0xf0b7('0x29'),_0x3709a5+'-'+_0x2aedd3+'/'+_0x1d02e6)[_0xf0b7('0x23')](_0x66b1dc);}return null;};}function saveUpdates(_0x3f764b){return function(_0x10643f){if(_0x10643f){return _0x10643f[_0xf0b7('0x2a')](_0x3f764b)[_0xf0b7('0x15')](function(_0x976a8b){if(_0x976a8b['role']===_0xf0b7('0x2b')){socket[_0xf0b7('0x2c')](_0xf0b7('0x2d')+_0x976a8b['id'],_0x976a8b);}return _0x976a8b;});}return null;};}function removeEntity(_0x4df287){return function(_0x250186){if(_0x250186){return _0x250186[_0xf0b7('0x2e')]()[_0xf0b7('0x15')](function(){var _0x6eaa6d=_0x250186[_0xf0b7('0x2f')]({'plain':!![]});if(_0x6eaa6d[_0xf0b7('0x30')]===_0xf0b7('0x31'))return;var _0x10e670=[{'name':_0xf0b7('0x32'),'value':'user','ignore':!![]},{'name':_0xf0b7('0x33'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xf0b7('0x34'),'ignore':![]}];var _0x4f14dd=_(_0x10e670)[_0xf0b7('0x35')](_0xf0b7('0x36'))[_0xf0b7('0x37')](_0xf0b7('0x38'))['value']();if(_[_0xf0b7('0x39')](_0x4f14dd,_0x6eaa6d[_0xf0b7('0x30')])){return;}var _0x190acf=_[_0xf0b7('0x3a')](_0x10e670,['value',_0x6eaa6d[_0xf0b7('0x30')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x190acf,'resourceId':_0x6eaa6d['id']}})['then'](function(){return _0x250186;});})['then'](function(){_0x4df287[_0xf0b7('0x22')](0xcc)[_0xf0b7('0x21')]();});}};}function handleEntityNotFound(_0x2eea7c){return function(_0xe1d29a){if(!_0xe1d29a){_0x2eea7c[_0xf0b7('0x20')](0x194);}return _0xe1d29a;};}function handleError(_0x7a8fb,_0x3b105c){_0x3b105c=_0x3b105c||0x1f4;return function(_0x299ebf){logger[_0xf0b7('0x1c')](_0x299ebf['stack']);if(_0x299ebf[_0xf0b7('0x3b')]){delete _0x299ebf['name'];}_0x7a8fb[_0xf0b7('0x22')](_0x3b105c)['send'](_0x299ebf);};}exports[_0xf0b7('0x3c')]=function(_0x364b24,_0x3b550a){var _0x4fb5a4={},_0x2c9202={'count':0x0,'rows':[]};var _0x39bde6=_(db[_0xf0b7('0x3d')]['rawAttributes'])[_0xf0b7('0x37')](function(_0x6adffa){return{'name':_0x6adffa[_0xf0b7('0x3e')],'type':_0x6adffa[_0xf0b7('0x3f')][_0xf0b7('0x40')]};})[_0xf0b7('0x35')](function(_0x214f8c){return!_[_0xf0b7('0x39')](['password',_0xf0b7('0x41')],_0x214f8c[_0xf0b7('0x3b')]);})[_0xf0b7('0x38')]();_0x4fb5a4=qs[_0xf0b7('0x42')](_0x39bde6,_0x364b24);var _0x138b46={'where':_0x4fb5a4[_0xf0b7('0x43')]};return db[_0xf0b7('0x3d')][_0xf0b7('0x26')](_0x138b46)[_0xf0b7('0x15')](function(_0x53a6cb){_0x2c9202[_0xf0b7('0x26')]=_0x53a6cb;if(_0x364b24[_0xf0b7('0x44')][_0xf0b7('0x45')]){_0x4fb5a4[_0xf0b7('0x46')]=[{'all':!![]}];}if(_0x364b24['query']['userSetting']===_0xf0b7('0x47')){_0x4fb5a4[_0xf0b7('0x46')]=[{'model':db[_0xf0b7('0x48')],'as':_0xf0b7('0x49')}];}if(!_['includes'](_0x4fb5a4[_0xf0b7('0x4a')],'id')){_0x4fb5a4[_0xf0b7('0x4a')][_0xf0b7('0x4b')]('id');}return db[_0xf0b7('0x3d')][_0xf0b7('0x4c')](_0x4fb5a4);})['then'](function(_0x241b40){_0x2c9202[_0xf0b7('0x4d')]=_0x241b40;if(_0x364b24['query']['openTabs']===_0xf0b7('0x47')){var _0x3a68f5=[];for(var _0x404048=0x0;_0x404048<_0x2c9202[_0xf0b7('0x4d')]['length'];_0x404048++){_0x3a68f5[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x4e'),_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));_0x3a68f5[_0xf0b7('0x4b')](get_open_tabs('sms',_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));_0x3a68f5['push'](get_open_tabs(_0xf0b7('0x50'),_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));_0x3a68f5['push'](get_open_tabs(_0xf0b7('0x51'),_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));_0x3a68f5['push'](get_open_tabs(_0xf0b7('0x52'),_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));_0x3a68f5[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x53'),_0x2c9202[_0xf0b7('0x4d')][_0x404048][_0xf0b7('0x4f')]));}return Promise[_0xf0b7('0x54')](_0x3a68f5)[_0xf0b7('0x15')](function(){return _0x2c9202;});}else{return _0x2c9202;}})[_0xf0b7('0x15')](respondWithFilteredResult(_0x3b550a,_0x4fb5a4))[_0xf0b7('0x1f')](handleError(_0x3b550a,null));};exports[_0xf0b7('0x55')]=function(_0x535653,_0x3cfbf7){var _0x21100c={'raw':![],'where':{'id':_0x535653[_0xf0b7('0x56')]['id']}},_0x373e64={};_0x373e64['model']=_['differenceBy'](_[_0xf0b7('0x57')](db[_0xf0b7('0x3d')][_0xf0b7('0x58')]),[_0xf0b7('0x59'),_0xf0b7('0x41')]);_0x373e64[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x535653['query']);_0x373e64['filters']=_[_0xf0b7('0x5a')](_0x373e64['model'],_0x373e64['query']);_0x21100c[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x373e64['model'],qs[_0xf0b7('0x5b')](_0x535653['query'][_0xf0b7('0x5b')]));_0x21100c[_0xf0b7('0x4a')]=_0x21100c[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x21100c[_0xf0b7('0x4a')]:_0x373e64[_0xf0b7('0x5d')];if(_0x535653[_0xf0b7('0x44')][_0xf0b7('0x45')]){_0x21100c[_0xf0b7('0x46')]=[{'all':!![]}];}if(_0x535653['query']['userSetting']===_0xf0b7('0x47')){_0x21100c['include']=[{'model':db[_0xf0b7('0x48')],'as':_0xf0b7('0x49')}];}_0x21100c=_[_0xf0b7('0x5e')]({},_0x21100c,_0x535653[_0xf0b7('0x5f')]);if(!_[_0xf0b7('0x39')](_0x21100c[_0xf0b7('0x4a')],'id')){_0x21100c[_0xf0b7('0x4a')][_0xf0b7('0x4b')]('id');}return db['User'][_0xf0b7('0x3a')](_0x21100c)[_0xf0b7('0x15')](handleEntityNotFound(_0x3cfbf7,null))[_0xf0b7('0x15')](function(_0x41b171){var _0x51fc16=[];values=_0x41b171;if(_0x535653['query'][_0xf0b7('0x60')]===_0xf0b7('0x47')){_0x51fc16[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x4e'),_0x41b171['dataValues']));_0x51fc16[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x61'),_0x41b171['dataValues']));_0x51fc16[_0xf0b7('0x4b')](get_open_tabs('openchannel',_0x41b171[_0xf0b7('0x4f')]));_0x51fc16[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x53'),_0x41b171[_0xf0b7('0x4f')]));_0x51fc16[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x50'),_0x41b171[_0xf0b7('0x4f')]));_0x51fc16[_0xf0b7('0x4b')](get_open_tabs('mail',_0x41b171[_0xf0b7('0x4f')]));return Promise[_0xf0b7('0x54')](_0x51fc16);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x3cfbf7,null))[_0xf0b7('0x1f')](handleError(_0x3cfbf7,null));};exports[_0xf0b7('0x2a')]=function(_0x389387,_0x4f1e4f){if(_0x389387[_0xf0b7('0x62')]['id']){delete _0x389387['body']['id'];}delete _0x389387[_0xf0b7('0x62')][_0xf0b7('0x30')];return db[_0xf0b7('0x3d')][_0xf0b7('0x3a')]({'where':{'id':_0x389387['params']['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x4f1e4f,null))[_0xf0b7('0x15')](saveUpdates(_0x389387[_0xf0b7('0x62')],null))[_0xf0b7('0x15')](respondWithResult(_0x4f1e4f,null))['catch'](handleError(_0x4f1e4f,null));};exports[_0xf0b7('0x63')]=function(_0x2c132e,_0x522029){return db['User'][_0xf0b7('0x63')]()[_0xf0b7('0x15')](respondWithResult(_0x522029,null))[_0xf0b7('0x1f')](handleError(_0x522029,null));};exports['addContacts']=function(_0x259ed3,_0xc0db18){return db[_0xf0b7('0x3d')]['find']({'where':{'id':_0x259ed3[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0xc0db18,null))['then'](function(_0x201628){if(_0x201628){return _0x201628[_0xf0b7('0x64')](_0x259ed3[_0xf0b7('0x62')][_0xf0b7('0x65')],_['omit'](_0x259ed3['body'],[_0xf0b7('0x65'),'id'])||{});}})[_0xf0b7('0x15')](respondWithResult(_0xc0db18,null))[_0xf0b7('0x1f')](handleError(_0xc0db18,null));};function validateUser(_0xbaf2b8){return new Promise(function(_0x3892ac,_0x310691){if(_0xbaf2b8[_0xf0b7('0x66')])return _0x3892ac(_0xbaf2b8);return db[_0xf0b7('0x67')]['findById'](0x1)['then'](function(_0xce0f8){if(_0xce0f8['securePassword'])authService[_0xf0b7('0x68')](_0xbaf2b8[_0xf0b7('0x59')]);db[_0xf0b7('0x3d')][_0xf0b7('0x69')](_0xf0b7('0x66'))[_0xf0b7('0x15')](function(_0x1cf9a8){if(_['isNil'](_0x1cf9a8)){_0xbaf2b8[_0xf0b7('0x66')]=_0xce0f8['min_internal']||0x1;return;}if(_[_0xf0b7('0x6a')](_0xce0f8[_0xf0b7('0x6b')])||_0xce0f8['min_internal']===_0x1cf9a8){_0xbaf2b8['internal']=_0x1cf9a8+0x1;return;}if(_0xce0f8[_0xf0b7('0x6b')]>_0x1cf9a8){_0xbaf2b8[_0xf0b7('0x66')]=_0xce0f8['min_internal'];return;}return db['sequelize'][_0xf0b7('0x44')](_0xf0b7('0x6c'),{'type':db[_0xf0b7('0x6d')]['QueryTypes'][_0xf0b7('0x6e')]})[_0xf0b7('0x15')](function(_0x4fc443){if(_0x4fc443&&_0x4fc443[_0xf0b7('0x5c')]){for(var _0x639ce=0x0,_0x35b88a=_0x4fc443['length'];_0x639ce<_0x35b88a&&_['isNil'](_0xbaf2b8[_0xf0b7('0x66')]);_0x639ce++){if(_0xce0f8[_0xf0b7('0x6b')]<=_0x4fc443[_0x639ce]['from']){_0xbaf2b8[_0xf0b7('0x66')]=_0x4fc443[_0x639ce][_0xf0b7('0x6f')];}else if(_0xce0f8[_0xf0b7('0x6b')]>_0x4fc443[_0x639ce][_0xf0b7('0x6f')]&&_0xce0f8[_0xf0b7('0x6b')]<=_0x4fc443[_0x639ce]['to']){_0xbaf2b8[_0xf0b7('0x66')]=_0xce0f8[_0xf0b7('0x6b')];}}}if(_['isNil'](_0xbaf2b8[_0xf0b7('0x66')])){_0xbaf2b8[_0xf0b7('0x66')]=_0x1cf9a8+0x1;}return _0x3892ac(_0xbaf2b8);});});})['catch'](function(_0x225361){_0x310691(_0x225361);});});}function updateUser(_0x2a1e29){return new Promise(function(_0x2a80ef,_0x3d4da7){try{if(_0x2a1e29[_0xf0b7('0x70')]){_0x2a1e29['mailbox']=_0x2a1e29[_0xf0b7('0x66')];_0x2a1e29[_0xf0b7('0x71')]={'mailbox':_0x2a1e29['internal'],'password':_0x2a1e29[_0xf0b7('0x59')],'fullname':_0x2a1e29[_0xf0b7('0x72')],'email':_0x2a1e29[_0xf0b7('0x73')]};}if(_0x2a1e29[_0xf0b7('0x30')]==='agent'){if(!_0x2a1e29[_0xf0b7('0x74')])_0x2a1e29[_0xf0b7('0x74')]=[_0xf0b7('0x75'),_0xf0b7('0x76'),_0xf0b7('0x77'),_0xf0b7('0x78'),_0xf0b7('0x79'),'104',_0xf0b7('0x7a'),_0xf0b7('0x7b'),_0xf0b7('0x7c'),'108',_0xf0b7('0x7d'),_0xf0b7('0x7e'),'111',_0xf0b7('0x7f'),_0xf0b7('0x80')];}_0x2a80ef(_0x2a1e29);}catch(_0x1e9311){_0x3d4da7(_0x1e9311);}});}exports['create']=function(_0x553e0e,_0x85dcf5){if(_0x553e0e[_0xf0b7('0x81')][_0xf0b7('0x30')]===_0xf0b7('0x2b'))throw new Error(_0xf0b7('0x82'));if(_0x553e0e['body'][_0xf0b7('0x30')]==='user'&&_0x553e0e[_0xf0b7('0x81')][_0xf0b7('0x30')]!==_0xf0b7('0x31')){throw new Error(_0xf0b7('0x83'));}if(_0x553e0e[_0xf0b7('0x62')][_0xf0b7('0x30')]===_0xf0b7('0x31')&&_0x553e0e[_0xf0b7('0x81')][_0xf0b7('0x30')]!==_0xf0b7('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xf0b7('0x84')]([_0x553e0e[_0xf0b7('0x62')]])[_0xf0b7('0x15')](function(){return validateUser(_0x553e0e[_0xf0b7('0x62')]);})[_0xf0b7('0x15')](function(_0x2f19c0){return updateUser(_0x2f19c0)[_0xf0b7('0x15')](function(_0x589911){if(_0x589911['role']===_0xf0b7('0x31')){_0x589911[_0xf0b7('0x85')]=_0x553e0e['user'][_0xf0b7('0x85')];delete _0x589911[_0xf0b7('0x86')];}return _0x589911;});})[_0xf0b7('0x15')](function(_0x43f1d0){return db[_0xf0b7('0x3d')]['create'](_0x43f1d0,{'include':[{'model':db[_0xf0b7('0x71')],'as':'VoiceMail'}]});})[_0xf0b7('0x15')](function(_0x2e5ae7){if(_0x553e0e[_0xf0b7('0x62')][_0xf0b7('0x30')]===_0xf0b7('0x81'))return _0x2e5ae7;if(_0x553e0e[_0xf0b7('0x81')]['role']!==_0xf0b7('0x81'))return _0x2e5ae7;return db[_0xf0b7('0x87')][_0xf0b7('0x3a')]({'where':{'name':_0x2e5ae7[_0xf0b7('0x30')]===_0xf0b7('0x2b')?_0xf0b7('0x33'):_0xf0b7('0x88'),'userProfileId':_0x553e0e[_0xf0b7('0x81')][_0xf0b7('0x86')]},'raw':!![]})[_0xf0b7('0x15')](function(_0x268f38){if(!_0x268f38||_0x268f38[_0xf0b7('0x89')]!=0x0)return _0x2e5ae7;return db[_0xf0b7('0x8a')][_0xf0b7('0x8b')]({'name':_0x2e5ae7[_0xf0b7('0x3b')],'resourceId':_0x2e5ae7['id'],'type':_0x268f38[_0xf0b7('0x3b')],'sectionId':_0x268f38['id']},{})[_0xf0b7('0x15')](function(){return _0x2e5ae7;});})[_0xf0b7('0x1f')](function(_0x3c1340){logger[_0xf0b7('0x1c')](_0xf0b7('0x8c'),_0x3c1340);throw _0x3c1340;});})[_0xf0b7('0x15')](respondWithResult(_0x85dcf5,0xc9))[_0xf0b7('0x1f')](handleError(_0x85dcf5,null));};exports[_0xf0b7('0x8d')]=function(_0x39320a,_0xb0e1cb){var _0x27a8b9=_0x39320a['body'];var _0x4905bc=[];if(_0x39320a[_0xf0b7('0x81')][_0xf0b7('0x30')]===_0xf0b7('0x2b'))throw new Error(_0xf0b7('0x82'));if(_['some'](_0x27a8b9,['role',_0xf0b7('0x81')])&&_0x39320a[_0xf0b7('0x81')]['role']!=='admin'){throw new Error(_0xf0b7('0x83'));}if(_['some'](_0x27a8b9,[_0xf0b7('0x30'),_0xf0b7('0x31')])&&_0x39320a[_0xf0b7('0x81')][_0xf0b7('0x30')]!=='admin'){throw new Error(_0xf0b7('0x8e'));}return licenseUtil[_0xf0b7('0x84')](_0x27a8b9)[_0xf0b7('0x15')](function(){return validateUser(_0x27a8b9[0x0]);})[_0xf0b7('0x15')](function(){for(var _0x1b2f13=0x1;_0x1b2f13<_0x27a8b9[_0xf0b7('0x5c')];_0x1b2f13++){var _0x43b376=_0x27a8b9[_0x1b2f13-0x1][_0xf0b7('0x66')];if(!_0x27a8b9[_0x1b2f13]['internal'])_0x27a8b9[_0x1b2f13][_0xf0b7('0x66')]=_0x43b376+0x1;_0x4905bc['push'](validateUser(_0x27a8b9[_0x1b2f13]));}return Promise[_0xf0b7('0x54')](_0x4905bc);})[_0xf0b7('0x15')](function(){_0x4905bc=[];for(var _0x453d8f=0x0;_0x453d8f<_0x27a8b9['length'];_0x453d8f++){_0x4905bc[_0xf0b7('0x4b')](updateUser(_0x27a8b9[_0x453d8f]));}return Promise[_0xf0b7('0x54')](_0x4905bc);})[_0xf0b7('0x15')](function(){_0x4905bc=_0x27a8b9[_0xf0b7('0x37')](function(_0x273e29){return db[_0xf0b7('0x3d')][_0xf0b7('0x8b')](_0x273e29,{'include':[{'model':db[_0xf0b7('0x71')],'as':_0xf0b7('0x71')}]})['then'](function(_0x302003){_0x273e29['id']=_0x302003['id'];return _0x273e29;});});return Promise[_0xf0b7('0x54')](_0x4905bc);})['then'](function(_0x3a9f6b){if(_0x39320a[_0xf0b7('0x62')][_0xf0b7('0x30')]===_0xf0b7('0x81'))return _0x3a9f6b;if(_0x39320a['user'][_0xf0b7('0x30')]!==_0xf0b7('0x81'))return _0x3a9f6b;var _0x1d4f0b=_['some'](_0x3a9f6b,function(_0x1b8a10){return _0x1b8a10[_0xf0b7('0x30')]===_0xf0b7('0x2b')||_0x1b8a10[_0xf0b7('0x30')]===_0xf0b7('0x34');});if(!_0x1d4f0b)return _0x3a9f6b;return db[_0xf0b7('0x87')][_0xf0b7('0x4c')]({'where':{'name':{'$or':[_0xf0b7('0x33'),_0xf0b7('0x88')]},'userProfileId':_0x39320a[_0xf0b7('0x81')]['userProfileId']},'raw':!![]})[_0xf0b7('0x15')](function(_0x1cb66b){if(_[_0xf0b7('0x8f')](_0x1cb66b)||!_['some'](_0x1cb66b,[_0xf0b7('0x89'),0x0]))return _0x3a9f6b;_0x4905bc=[];var _0x31342f=_(_0x1cb66b)[_0xf0b7('0x37')](function(_0x52b40a){if(_0x52b40a['autoAssociation']===0x1)return;return _0x52b40a[_0xf0b7('0x3b')]===_0xf0b7('0x33')?_0xf0b7('0x2b'):_0xf0b7('0x34');})[_0xf0b7('0x90')]()[_0xf0b7('0x38')]();for(var _0x92cfe3=0x0;_0x92cfe3<_0x3a9f6b['length'];_0x92cfe3++){if(!_[_0xf0b7('0x39')](_0x31342f,_0x3a9f6b[_0x92cfe3]['role']))return;var _0x9ed7d4=_0x3a9f6b[_0x92cfe3]['role']===_0xf0b7('0x2b')?_0xf0b7('0x33'):_0xf0b7('0x88');_0x4905bc[_0xf0b7('0x4b')](db[_0xf0b7('0x8a')][_0xf0b7('0x8b')]({'name':_0x3a9f6b[_0x92cfe3][_0xf0b7('0x3b')],'resourceId':_0x3a9f6b[_0x92cfe3]['id'],'type':_0x9ed7d4,'sectionId':_[_0xf0b7('0x3a')](_0x1cb66b,['name',_0x9ed7d4])['id']},{}));}return Promise[_0xf0b7('0x54')](_0x4905bc);});})[_0xf0b7('0x15')](respondWithResult(_0xb0e1cb,0xc9))['catch'](handleError(_0xb0e1cb,null));};exports[_0xf0b7('0x91')]=function(_0x577657,_0x43242d){if(_0x577657[_0xf0b7('0x62')]['id']){delete _0x577657[_0xf0b7('0x62')]['id'];}return db['User']['find']({'where':{'id':_0x577657[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](function(_0x213100){if(!_0x213100)return null;if(_0x213100['id']===_0x577657[_0xf0b7('0x81')]['id']){if(!_0x577657[_0xf0b7('0x62')][_0xf0b7('0x92')]||!_0x577657[_0xf0b7('0x62')][_0xf0b7('0x93')]){throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x213100[_0xf0b7('0x96')](_0x577657[_0xf0b7('0x62')]['oldPassword'])){throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))]('Wrong\x20credentials');}if(_0x577657[_0xf0b7('0x62')][_0xf0b7('0x92')]===_0x577657['body'][_0xf0b7('0x93')]){throw new db[(_0xf0b7('0x94'))]['ValidationError'](_0xf0b7('0x97'));}}else if(_0x577657['user']['role']===_0xf0b7('0x31')){if(!_0x577657['body'][_0xf0b7('0x93')]){throw new db['Sequelize'][(_0xf0b7('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x577657[_0xf0b7('0x81')][_0xf0b7('0x30')]===_0xf0b7('0x81')){if(!_0x577657[_0xf0b7('0x62')][_0xf0b7('0x93')]){throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x213100[_0xf0b7('0x30')]!==_0xf0b7('0x2b')){throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0xf0b7('0x95'))](_0xf0b7('0x82'));}return _0x213100;})[_0xf0b7('0x15')](handleEntityNotFound(_0x43242d,null))[_0xf0b7('0x15')](function(_0x4e70b4){return db[_0xf0b7('0x67')][_0xf0b7('0x98')]({'attributes':['id',_0xf0b7('0x99'),_0xf0b7('0x9a'),_0xf0b7('0x9b')]})['then'](function(_0x4c24fa){if(_0x4c24fa['securePassword'])authService[_0xf0b7('0x68')](_0x577657[_0xf0b7('0x62')][_0xf0b7('0x93')]);if(!_0x4c24fa[_0xf0b7('0x9a')]||!_0x4e70b4['previousPasswords'])return _0x4e70b4;authService[_0xf0b7('0x9c')](_0x577657[_0xf0b7('0x62')]['newPassword'],_0x4e70b4[_0xf0b7('0x9d')],_0x4c24fa['passwordHistoryLimit']);return _0x4e70b4;})[_0xf0b7('0x15')](saveUpdates({'password':_0x577657[_0xf0b7('0x62')]['newPassword'],'passwordResetAt':_0x577657['user']['id']==_0x577657[_0xf0b7('0x56')]['id']?moment():null,'previousPasswords':authService[_0xf0b7('0x9e')](_0x577657['body'][_0xf0b7('0x93')],_0x4e70b4[_0xf0b7('0x9d')])},null));})[_0xf0b7('0x15')](respondWithResult(_0x43242d,null))[_0xf0b7('0x1f')](handleError(_0x43242d,null));};exports[_0xf0b7('0x9f')]=function(_0x4fd508,_0x1c43e6){var _0x53824b=_0x4fd508[_0xf0b7('0x62')]['channel'];return db[_0xf0b7('0x3d')]['find']({'where':{'id':_0x4fd508['params']['id']},'attributes':['id',_0xf0b7('0x3b'),_0xf0b7('0x30'),_0xf0b7('0xa0'),'loginInPause',_0xf0b7('0xa1'),_0xf0b7('0xa2')]})[_0xf0b7('0x15')](handleEntityNotFound(_0x1c43e6,null))[_0xf0b7('0x15')](function(_0x2bc4c6){if(_0x2bc4c6){if(!utils[_0xf0b7('0xa3')](_0x53824b)){throw new db[(_0xf0b7('0x94'))]['ValidationError'](_0xf0b7('0xa4'));}return _0x2bc4c6['add'+_['capitalize'](_0x53824b[_0xf0b7('0xa5')]())+_0xf0b7('0xa6')](_0x4fd508[_0xf0b7('0x62')]['ids'],{'penalty':_0x4fd508[_0xf0b7('0x62')][_0xf0b7('0xa7')]||0x0})[_0xf0b7('0xa8')](function(_0x3ffda9){for(var _0xd2cb88=0x0;_0xd2cb88<_0x4fd508[_0xf0b7('0x62')][_0xf0b7('0x65')][_0xf0b7('0x5c')];_0xd2cb88+=0x1){var _0x1afcb5={'UserId':Number(_0x4fd508['params']['id'])};_0x1afcb5[_[_0xf0b7('0xa9')](_0x53824b[_0xf0b7('0xa5')]())+_0xf0b7('0xaa')]=Number(_0x4fd508[_0xf0b7('0x62')][_0xf0b7('0x65')][_0xd2cb88]);socket[_0xf0b7('0x2c')](_0xf0b7('0x81')+_[_0xf0b7('0xa9')](_0x53824b[_0xf0b7('0xa5')]())+_0xf0b7('0xab'),_0x1afcb5);}return _0x3ffda9;})[_0xf0b7('0x15')](function(){if(_0x53824b===_0xf0b7('0xac')){return db[_0xf0b7('0xad')][_0xf0b7('0x4c')]({'where':{'id':_0x4fd508[_0xf0b7('0x62')][_0xf0b7('0x65')]||[]},'raw':!![],'attributes':['id',_0xf0b7('0x3b')]});}})[_0xf0b7('0x15')](function(_0x406325){var _0x23ae35=_0x2bc4c6['get']({'plain':!![]});var _0x173252=[];if(_0x53824b===_0xf0b7('0xac')&&_0x23ae35[_0xf0b7('0x30')]==='agent'&&_0x23ae35['online']){for(let _0x361642=0x0;_0x361642<_0x406325[_0xf0b7('0x5c')];_0x361642+=0x1){_0x173252[_0xf0b7('0x4b')]({'membername':_0x23ae35[_0xf0b7('0x3b')],'UserId':_0x23ae35['id'],'queue_name':_0x406325[_0x361642][_0xf0b7('0x3b')],'VoiceQueueId':_0x406325[_0x361642]['id'],'interface':_[_0xf0b7('0x6a')](_0x23ae35[_0xf0b7('0xa2')])?util[_0xf0b7('0xae')]('SIP/%s',_0x23ae35[_0xf0b7('0x3b')]):_0x23ae35[_0xf0b7('0xa2')],'paused':_0x23ae35['voicePause']||![],'penalty':_0x4fd508[_0xf0b7('0x62')][_0xf0b7('0xa7')]||0x0});}return Promise[_0xf0b7('0x54')](_0x173252[_0xf0b7('0x37')](function(_0x215baa){return db[_0xf0b7('0xaf')]['upsert'](_0x215baa);}));}return _0x2bc4c6;});}})[_0xf0b7('0x15')](respondWithStatusCode(_0x1c43e6,null))[_0xf0b7('0x1f')](handleError(_0x1c43e6,null));};exports[_0xf0b7('0xb0')]=function(_0x4cc518,_0x59d31b){var _0x1a5574,_0x2d639d;return db['User'][_0xf0b7('0x3a')]({'where':{'id':_0x4cc518['params']['id']},'attributes':['id','name',_0xf0b7('0x30')]})[_0xf0b7('0x15')](handleEntityNotFound(_0x59d31b,null))[_0xf0b7('0x15')](function(_0x428677){if(_0x428677){_0x1a5574=_0x428677;if(!_0x4cc518[_0xf0b7('0x44')]['channel']||!utils['isValidChannel'](_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0xb1')])){throw new db[(_0xf0b7('0x94'))]['ValidationError'](_0xf0b7('0xa4'));}return _0x428677[_0xf0b7('0xb2')+_['capitalize'](_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0xb1')][_0xf0b7('0xa5')]())+_0xf0b7('0xa6')](_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0x65')]);}})[_0xf0b7('0x15')](function(_0x44e8d0){if(_[_0xf0b7('0xb3')](_0x4cc518[_0xf0b7('0x44')]['ids'])){for(var _0x46e7b4=0x0;_0x46e7b4<_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0x65')][_0xf0b7('0x5c')];_0x46e7b4+=0x1){_0x2d639d={'UserId':Number(_0x4cc518[_0xf0b7('0x56')]['id'])};_0x2d639d[_[_0xf0b7('0xa9')](_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0xb1')][_0xf0b7('0xa5')]())+_0xf0b7('0xaa')]=Number(_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0x65')][_0x46e7b4]);socket[_0xf0b7('0x2c')]('user'+_[_0xf0b7('0xa9')](_0x4cc518['query']['channel'][_0xf0b7('0xa5')]())+_0xf0b7('0xb4'),_0x2d639d);}}else{_0x2d639d={'UserId':Number(_0x4cc518['params']['id'])};_0x2d639d[_[_0xf0b7('0xa9')](_0x4cc518[_0xf0b7('0x44')]['channel'][_0xf0b7('0xa5')]())+_0xf0b7('0xaa')]=Number(_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0x65')]);socket['emit'](_0xf0b7('0x81')+_['capitalize'](_0x4cc518[_0xf0b7('0x44')]['channel']['toLowerCase']())+_0xf0b7('0xb4'),_0x2d639d);}return _0x44e8d0;})[_0xf0b7('0x15')](function(){if(_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0xb1')]===_0xf0b7('0xac')){return db['UserVoiceQueueRt'][_0xf0b7('0x2e')]({'where':{'UserId':_0x4cc518[_0xf0b7('0x56')]['id'],'VoiceQueueId':_0x4cc518[_0xf0b7('0x44')][_0xf0b7('0x65')]},'individualHooks':!![]})[_0xf0b7('0x15')](function(){return _0x1a5574;});}return _0x1a5574;})['then'](respondWithStatusCode(_0x59d31b,null))['catch'](handleError(_0x59d31b,null));};exports[_0xf0b7('0xb5')]=function(_0x463078,_0x5f55e3){_0x463078[_0xf0b7('0x62')]['userpic']=_0x463078['file']['filename'];return db[_0xf0b7('0x3d')]['find']({'where':{'id':_0x463078['params']['id']}})['then'](handleEntityNotFound(_0x5f55e3,null))['then'](saveUpdates(_0x463078[_0xf0b7('0x62')],null))['then'](respondWithResult(_0x5f55e3,null))[_0xf0b7('0x1f')](handleError(_0x5f55e3,null));};exports[_0xf0b7('0xb6')]=function(_0x1cc288,_0xb194f5){var _0x2ded71=path[_0xf0b7('0xb7')](config[_0xf0b7('0xb8')],_0xf0b7('0xb9'));return db['User'][_0xf0b7('0x3a')]({'where':{'id':_0x1cc288[_0xf0b7('0x56')]['id']},'attributes':['id',_0xf0b7('0xba')],'raw':!![]})[_0xf0b7('0x15')](handleEntityNotFound(_0xb194f5,null))[_0xf0b7('0x15')](function(_0x132d97){if(_0x132d97){if(_[_0xf0b7('0x6a')](_0x132d97[_0xf0b7('0xba')])){return _0xb194f5['download'](_0x2ded71);}else{if(!fs[_0xf0b7('0xbb')](path[_0xf0b7('0xb7')](config['root'],_0xf0b7('0xbc'),_0x132d97[_0xf0b7('0xba')]))){return _0xb194f5[_0xf0b7('0xbd')](_0x2ded71);}return _0xb194f5[_0xf0b7('0xbd')](path[_0xf0b7('0xb7')](config['root'],'server/files/images/',_0x132d97['userpic']));}}})['catch'](handleError(_0xb194f5,null));};exports[_0xf0b7('0xbe')]=function(_0x49925a,_0x3f7820){return db[_0xf0b7('0x3d')][_0xf0b7('0x3a')]({'where':{'id':_0x49925a[_0xf0b7('0x56')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x3f7820,null))[_0xf0b7('0x15')](function(_0x43957d){var _0xf9611b=[];values=_0x43957d[_0xf0b7('0x4f')];_0xf9611b[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x4e'),_0x43957d[_0xf0b7('0x4f')]));_0xf9611b['push'](get_open_tabs(_0xf0b7('0x61'),_0x43957d[_0xf0b7('0x4f')]));_0xf9611b[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x52'),_0x43957d[_0xf0b7('0x4f')]));_0xf9611b[_0xf0b7('0x4b')](get_open_tabs('whatsapp',_0x43957d[_0xf0b7('0x4f')]));_0xf9611b[_0xf0b7('0x4b')](get_open_tabs('fax',_0x43957d[_0xf0b7('0x4f')]));_0xf9611b[_0xf0b7('0x4b')](get_open_tabs(_0xf0b7('0x51'),_0x43957d[_0xf0b7('0x4f')]));return Promise[_0xf0b7('0x54')](_0xf9611b);})[_0xf0b7('0x15')](function(_0x25b059){if(_0x25b059){var _0x3f3d71=_['map'](values['ChatOpenTabs'],function(_0x6f592b){return{'channel':_0xf0b7('0xbf'),'id':_0x6f592b['id'],'createdAt':_0x6f592b[_0xf0b7('0xc0')]};});var _0x2a0477=_[_0xf0b7('0x37')](values[_0xf0b7('0xc1')],function(_0x4d27d8){return{'channel':'FAX','id':_0x4d27d8['id'],'createdAt':_0x4d27d8[_0xf0b7('0xc0')]};});var _0xe27e59=_[_0xf0b7('0x37')](values[_0xf0b7('0xc2')],function(_0x4af227){return{'channel':_0xf0b7('0xc3'),'id':_0x4af227['id'],'createdAt':_0x4af227[_0xf0b7('0xc0')]};});var _0x43ed23=_[_0xf0b7('0x37')](values[_0xf0b7('0xc4')],function(_0xfff2db){return{'channel':_0xf0b7('0xc5'),'id':_0xfff2db['id'],'createdAt':_0xfff2db[_0xf0b7('0xc0')]};});var _0x62ffd1=_[_0xf0b7('0x37')](values[_0xf0b7('0xc6')],function(_0x45ed37){return{'channel':_0xf0b7('0xc7'),'id':_0x45ed37['id'],'createdAt':_0x45ed37[_0xf0b7('0xc0')]};});var _0x2e97ee=_[_0xf0b7('0x37')](values[_0xf0b7('0xc8')],function(_0x138ab6){return{'channel':_0xf0b7('0xc9'),'id':_0x138ab6['id'],'createdAt':_0x138ab6[_0xf0b7('0xc0')]};});var _0x38cad7=_[_0xf0b7('0xca')](_0x3f3d71,_0x2a0477,_0xe27e59,_0x43ed23,_0x62ffd1,_0x2e97ee);var _0x329b22={'count':_0x38cad7[_0xf0b7('0x5c')],'rows':_0x38cad7};return _0x329b22;}else return null;})[_0xf0b7('0x15')](respondWithResult(_0x3f7820,null))[_0xf0b7('0x1f')](handleError(_0x3f7820,null));};exports[_0xf0b7('0xcb')]=function(_0x57b7e0,_0x5c5c40){var _0x116c28={};return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x57b7e0[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](function(_0x7fa0a0){if(!_0x7fa0a0){throw new APINotFoundError(util['format'](_0xf0b7('0xcc'),_0x57b7e0[_0xf0b7('0x56')]['id']));}return contacts[_0xf0b7('0x63')]();})[_0xf0b7('0x15')](function(_0x3eacba){_0x57b7e0[_0xf0b7('0x44')]['User']=_0x57b7e0[_0xf0b7('0x56')]['id'];_0x116c28=qs['getOptions'](_0x3eacba,_0x57b7e0);if(_0x57b7e0['query']['hasOwnProperty']('includeAll')){_0x116c28['include']=[{'model':db['CmList'],'as':_0xf0b7('0xcd'),'required':![]},{'model':db[_0xf0b7('0xce')],'as':_0xf0b7('0xcf'),'attributes':['id',_0xf0b7('0x3b'),_0xf0b7('0xd0')],'where':_0x57b7e0[_0xf0b7('0x44')][_0xf0b7('0xd1')]?{'id':_0x57b7e0[_0xf0b7('0x44')][_0xf0b7('0xd1')]}:undefined,'required':_0x57b7e0[_0xf0b7('0x44')][_0xf0b7('0xd1')]?!![]:![]}];}return contacts[_0xf0b7('0x4c')](_0x57b7e0[_0xf0b7('0x44')],_0x57b7e0[_0xf0b7('0x81')],_0x116c28,_0x3eacba);})[_0xf0b7('0x15')](respondWithFilteredResult(_0x5c5c40,_0x116c28))[_0xf0b7('0x1f')](APIHandleError(_0x5c5c40));};exports[_0xf0b7('0xd2')]=function(_0x2ea28c,_0x19b772){var _0x3ec80a;var _0x1a61fe={};var _0x468dbf;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x2ea28c[_0xf0b7('0x56')]['id']},'attributes':['id',_0xf0b7('0x3b'),_0xf0b7('0x30')]})['then'](handleEntityNotFound(_0x19b772,null))[_0xf0b7('0x15')](function(_0x399dc2){if(!utils[_0xf0b7('0xa3')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0xb1')])){throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))](_0xf0b7('0xa4'));}_0x3ec80a=_0x399dc2;var _0x2918ab={};_0x2918ab[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_[_0xf0b7('0xa9')](_0x2ea28c[_0xf0b7('0x44')]['channel'])+_0xf0b7('0xd3')][_0xf0b7('0x58')]);_0x2918ab[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x2ea28c['query']);_0x2918ab[_0xf0b7('0xd4')]=_['intersection'](_0x2918ab[_0xf0b7('0x5d')],_0x2918ab['query']);_0x1a61fe['attributes']=_[_0xf0b7('0x5a')](_0x2918ab[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x1a61fe[_0xf0b7('0x4a')]=_0x1a61fe[_0xf0b7('0x4a')]['length']?_0x1a61fe[_0xf0b7('0x4a')]:_0x2918ab['model'];_0x1a61fe[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x1a61fe[_0xf0b7('0x43')]=qs['filters'](_[_0xf0b7('0xd7')](_0x2ea28c[_0xf0b7('0x44')],_0x2918ab['filters']));if(_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x1a61fe[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x1a61fe[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x1a61fe[_0xf0b7('0x4a')],function(_0x4f6952){var _0xaea42d={};_0xaea42d[_0x4f6952]={'$like':'%'+_0x2ea28c['query'][_0xf0b7('0x35')]+'%'};return _0xaea42d;})});}_0x1a61fe=_[_0xf0b7('0x5e')]({},_0x1a61fe,_0x2ea28c[_0xf0b7('0x5f')]);switch(_0x3ec80a[_0xf0b7('0x30')]){case _0xf0b7('0x31'):return db[_[_0xf0b7('0xa9')](_0x2ea28c[_0xf0b7('0x44')]['channel'])+_0xf0b7('0xd3')][_0xf0b7('0x4c')](_0x1a61fe);case _0xf0b7('0x81'):case'agent':return _0x3ec80a[_0xf0b7('0x2f')+_[_0xf0b7('0xa9')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0xb1')])+_0xf0b7('0xa6')](_0x1a61fe);default:throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))](_0xf0b7('0xd8'));}})[_0xf0b7('0x15')](function(_0x2ff6b1){_0x468dbf=_0x2ff6b1['length'];if(!_0x2ea28c[_0xf0b7('0x44')]['hasOwnProperty'](_0xf0b7('0xd9'))){_0x1a61fe[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x2ea28c['query'][_0xf0b7('0x25')]);_0x1a61fe[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0x27')]);}switch(_0x3ec80a[_0xf0b7('0x30')]){case _0xf0b7('0x31'):return db[_[_0xf0b7('0xa9')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0xb1')])+_0xf0b7('0xd3')][_0xf0b7('0x4c')](_0x1a61fe);case _0xf0b7('0x81'):case _0xf0b7('0x2b'):return _0x3ec80a[_0xf0b7('0x2f')+_[_0xf0b7('0xa9')](_0x2ea28c[_0xf0b7('0x44')][_0xf0b7('0xb1')])+'Queues'](_0x1a61fe);}})[_0xf0b7('0x15')](function(_0x47ed92){return{'count':_0x468dbf,'rows':_0x47ed92};})[_0xf0b7('0x15')](respondWithResult(_0x19b772,null))['catch'](handleError(_0x19b772,null));};exports[_0xf0b7('0xda')]=function(_0x5b4d0e,_0x4746e9){var _0x30311e={};var _0x96f6e9={};var _0x23cf63;var _0x4c073b;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x5b4d0e[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x4746e9,null))['then'](function(_0x2c1e74){if(_0x2c1e74){_0x23cf63=_0x2c1e74;_0x96f6e9[_0xf0b7('0x5d')]=_['keys'](db[_0xf0b7('0xaf')][_0xf0b7('0x58')]);_0x96f6e9[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x5b4d0e[_0xf0b7('0x44')]);_0x96f6e9[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x96f6e9['model'],_0x96f6e9[_0xf0b7('0x44')]);_0x30311e[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x96f6e9[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x5b4d0e[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x30311e[_0xf0b7('0x4a')]=_0x30311e['attributes'][_0xf0b7('0x5c')]?_0x30311e[_0xf0b7('0x4a')]:_0x96f6e9[_0xf0b7('0x5d')];_0x30311e[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x5b4d0e['query'][_0xf0b7('0xd6')]);_0x30311e[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x5b4d0e[_0xf0b7('0x44')],_0x96f6e9[_0xf0b7('0xd4')]));if(_0x5b4d0e[_0xf0b7('0x44')]['filter']){_0x30311e['where']=_['merge'](_0x30311e[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x30311e[_0xf0b7('0x4a')],function(_0x5f0e11){var _0x1d3bd3={};_0x1d3bd3[_0x5f0e11]={'$like':'%'+_0x5b4d0e[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x1d3bd3;})});}_0x30311e=_[_0xf0b7('0x5e')]({},_0x30311e,_0x5b4d0e[_0xf0b7('0x5f')]);return _0x23cf63[_0xf0b7('0xda')](_0x30311e);}})[_0xf0b7('0x15')](function(_0x2bc354){if(_0x2bc354){_0x4c073b=_0x2bc354[_0xf0b7('0x5c')];if(!_0x5b4d0e[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x30311e[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x5b4d0e[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x30311e['offset']=qs[_0xf0b7('0x27')](_0x5b4d0e['query'][_0xf0b7('0x27')]);}return _0x23cf63[_0xf0b7('0xda')](_0x30311e);}})[_0xf0b7('0x15')](function(_0x506c3b){if(_0x506c3b){return _0x506c3b?{'count':_0x4c073b,'rows':_0x506c3b}:null;}})['then'](respondWithResult(_0x4746e9,null))[_0xf0b7('0x1f')](handleError(_0x4746e9,null));};exports[_0xf0b7('0xdc')]=function(_0x12f160,_0x4c05f0){var _0x20e5e5={};var _0x1b8bce={};var _0x13c3f6;var _0x1d276e;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x12f160['params']['id']}})['then'](handleEntityNotFound(_0x4c05f0,null))['then'](function(_0x193db2){if(_0x193db2){_0x13c3f6=_0x193db2;_0x1b8bce['model']=_['keys'](db['ChatGroup'][_0xf0b7('0x58')]);_0x1b8bce[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x12f160['query']);_0x1b8bce[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x1b8bce[_0xf0b7('0x5d')],_0x1b8bce['query']);_0x20e5e5[_0xf0b7('0x4a')]=_['intersection'](_0x1b8bce['model'],qs['fields'](_0x12f160[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x20e5e5['attributes']=_0x20e5e5['attributes']['length']?_0x20e5e5[_0xf0b7('0x4a')]:_0x1b8bce[_0xf0b7('0x5d')];_0x20e5e5[_0xf0b7('0xd5')]=qs['sort'](_0x12f160[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x20e5e5[_0xf0b7('0x43')]=qs['filters'](_[_0xf0b7('0xd7')](_0x12f160[_0xf0b7('0x44')],_0x1b8bce[_0xf0b7('0xd4')]));if(_0x12f160[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x20e5e5['where']=_[_0xf0b7('0x5e')](_0x20e5e5[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x20e5e5[_0xf0b7('0x4a')],function(_0x74d51c){var _0x4afca7={};_0x4afca7[_0x74d51c]={'$like':'%'+_0x12f160['query'][_0xf0b7('0x35')]+'%'};return _0x4afca7;})});}_0x20e5e5=_[_0xf0b7('0x5e')]({},_0x20e5e5,_0x12f160['options']);return _0x13c3f6[_0xf0b7('0xdc')](_0x20e5e5);}})[_0xf0b7('0x15')](function(_0x17a9a8){if(_0x17a9a8){_0x1d276e=_0x17a9a8['length'];if(!_0x12f160['query']['hasOwnProperty'](_0xf0b7('0xd9'))){_0x20e5e5[_0xf0b7('0x25')]=qs['limit'](_0x12f160[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x20e5e5[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x12f160[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0x13c3f6[_0xf0b7('0xdc')](_0x20e5e5);}})[_0xf0b7('0x15')](function(_0x587d0e){if(_0x587d0e){return _0x587d0e?{'count':_0x1d276e,'rows':_0x587d0e}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x4c05f0,null))[_0xf0b7('0x1f')](handleError(_0x4c05f0,null));};exports['getRecordings']=function(_0x710dcc,_0x453b5d){var _0x10c795={'raw':!![],'where':{}};var _0x17944e={};var _0x41386d={'count':0x0,'rows':[]};return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x710dcc[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x453b5d,null))[_0xf0b7('0x15')](function(_0x5f4dce){if(_0x5f4dce){_0x17944e[_0xf0b7('0x5d')]=_['keys'](db[_0xf0b7('0xdd')][_0xf0b7('0x58')]);_0x17944e[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x710dcc[_0xf0b7('0x44')]);_0x17944e[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x17944e['model'],_0x17944e[_0xf0b7('0x44')]);_0x10c795[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x17944e[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x10c795['attributes']=_0x10c795[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x10c795[_0xf0b7('0x4a')]:_0x17944e[_0xf0b7('0x5d')];if(!_0x710dcc['query'][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x10c795['limit']=qs[_0xf0b7('0x25')](_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x10c795[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x27')]);}_0x10c795[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x710dcc[_0xf0b7('0x44')]['sort']);_0x10c795[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_['pick'](_0x710dcc[_0xf0b7('0x44')],_0x17944e['filters']));_0x10c795[_0xf0b7('0x43')][_0xf0b7('0xde')]=_0x5f4dce['id'];if(_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x10c795[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x10c795['where'],{'$or':_[_0xf0b7('0x37')](_0x10c795[_0xf0b7('0x4a')],function(_0x229a1c){var _0x36f1a2={};_0x36f1a2[_0x229a1c]={'$like':'%'+_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x36f1a2;})});}_0x10c795=_[_0xf0b7('0x5e')]({},_0x10c795,_0x710dcc[_0xf0b7('0x5f')]);return db[_0xf0b7('0xdd')][_0xf0b7('0x26')]({'where':_0x10c795[_0xf0b7('0x43')]})[_0xf0b7('0x15')](function(_0xc03dd3){_0x41386d[_0xf0b7('0x26')]=_0xc03dd3;if(_0x710dcc[_0xf0b7('0x44')][_0xf0b7('0x45')]){_0x10c795[_0xf0b7('0x46')]=[{'all':!![]}];}return db[_0xf0b7('0xdd')][_0xf0b7('0x4c')](_0x10c795);})[_0xf0b7('0x15')](function(_0x2a1cb3){_0x41386d[_0xf0b7('0x4d')]=_0x2a1cb3;return _0x41386d;});}})[_0xf0b7('0x15')](respondWithFilteredResult(_0x453b5d,_0x10c795))[_0xf0b7('0x1f')](handleError(_0x453b5d,null));};exports[_0xf0b7('0xdf')]=function(_0x3279eb,_0x281944){var _0x4c690a={'raw':!![],'where':{}};var _0x4d6588={};var _0x36b77b={'count':0x0,'rows':[]};return db['User'][_0xf0b7('0x98')]({'where':{'id':_0x3279eb[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x281944,null))[_0xf0b7('0x15')](function(_0x186ad4){if(_0x186ad4){_0x4d6588[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_0xf0b7('0xe0')][_0xf0b7('0x58')]);_0x4d6588[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x3279eb[_0xf0b7('0x44')]);_0x4d6588[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x4d6588[_0xf0b7('0x5d')],_0x4d6588[_0xf0b7('0x44')]);_0x4c690a[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x4d6588[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x3279eb[_0xf0b7('0x44')]['fields']));_0x4c690a[_0xf0b7('0x4a')]=_0x4c690a[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x4c690a[_0xf0b7('0x4a')]:_0x4d6588[_0xf0b7('0x5d')];if(!_0x3279eb[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x4c690a[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x3279eb[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x4c690a[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x3279eb[_0xf0b7('0x44')]['offset']);}_0x4c690a[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x3279eb[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x4c690a[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x3279eb[_0xf0b7('0x44')],_0x4d6588[_0xf0b7('0xd4')]));_0x4c690a[_0xf0b7('0x43')][_0xf0b7('0xde')]=_0x186ad4['id'];if(_0x3279eb['query'][_0xf0b7('0x35')]){_0x4c690a[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x4c690a[_0xf0b7('0x43')],{'$or':_['map'](_0x4c690a[_0xf0b7('0x4a')],function(_0x3afe0f){var _0x5ccf2a={};_0x5ccf2a[_0x3afe0f]={'$like':'%'+_0x3279eb[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x5ccf2a;})});}_0x4c690a=_[_0xf0b7('0x5e')]({},_0x4c690a,_0x3279eb[_0xf0b7('0x5f')]);return db[_0xf0b7('0xe0')][_0xf0b7('0x26')]({'where':_0x4c690a['where']})[_0xf0b7('0x15')](function(_0x5c8a83){_0x36b77b[_0xf0b7('0x26')]=_0x5c8a83;if(_0x3279eb['query']['includeAll']){_0x4c690a[_0xf0b7('0x46')]=[{'all':!![]}];}return db[_0xf0b7('0xe0')][_0xf0b7('0x4c')](_0x4c690a);})[_0xf0b7('0x15')](function(_0x51dedf){_0x36b77b[_0xf0b7('0x4d')]=_0x51dedf;return _0x36b77b;});}})['then'](respondWithFilteredResult(_0x281944,_0x4c690a))[_0xf0b7('0x1f')](handleError(_0x281944,null));};exports[_0xf0b7('0xe1')]=function(_0x407b43,_0x581ad0){var _0x508d02={};var _0x8a933={};var _0xa7aaa6;var _0x5ef321;return db['User'][_0xf0b7('0x98')]({'where':{'id':_0x407b43[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x581ad0,null))[_0xf0b7('0x15')](function(_0x2a6265){if(_0x2a6265){_0xa7aaa6=_0x2a6265;_0x8a933[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_0xf0b7('0xe2')]['rawAttributes']);_0x8a933[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x407b43['query']);_0x8a933['filters']=_[_0xf0b7('0x5a')](_0x8a933[_0xf0b7('0x5d')],_0x8a933['query']);_0x508d02[_0xf0b7('0x4a')]=_['intersection'](_0x8a933[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x407b43[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x508d02['attributes']=_0x508d02[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x508d02[_0xf0b7('0x4a')]:_0x8a933[_0xf0b7('0x5d')];_0x508d02[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x407b43['query'][_0xf0b7('0xd6')]);_0x508d02[_0xf0b7('0x43')]=qs['filters'](_['pick'](_0x407b43[_0xf0b7('0x44')],_0x8a933[_0xf0b7('0xd4')]));if(_0x407b43[_0xf0b7('0x44')]['filter']){_0x508d02[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x508d02['where'],{'$or':_[_0xf0b7('0x37')](_0x508d02['attributes'],function(_0x3c3b7e){var _0xe301f4={};_0xe301f4[_0x3c3b7e]={'$like':'%'+_0x407b43[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0xe301f4;})});}_0x508d02=_['merge']({},_0x508d02,_0x407b43[_0xf0b7('0x5f')]);return _0xa7aaa6['getChatInteractions'](_0x508d02);}})[_0xf0b7('0x15')](function(_0x47de9e){if(_0x47de9e){_0x5ef321=_0x47de9e[_0xf0b7('0x5c')];if(!_0x407b43['query'][_0xf0b7('0xdb')]('nolimit')){_0x508d02[_0xf0b7('0x25')]=qs['limit'](_0x407b43[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x508d02[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x407b43[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0xa7aaa6[_0xf0b7('0xe1')](_0x508d02);}})[_0xf0b7('0x15')](function(_0x2ef9a1){if(_0x2ef9a1){return _0x2ef9a1?{'count':_0x5ef321,'rows':_0x2ef9a1}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x581ad0,null))[_0xf0b7('0x1f')](handleError(_0x581ad0,null));};exports[_0xf0b7('0xe3')]=function(_0x32c060,_0x422df6){var _0x4ba925={};var _0x1b0be0={};var _0x4d468e;var _0x1bb58d;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x32c060[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x422df6,null))[_0xf0b7('0x15')](function(_0x161d10){if(_0x161d10){_0x4d468e=_0x161d10;_0x1b0be0[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_0xf0b7('0xe4')][_0xf0b7('0x58')]);_0x1b0be0[_0xf0b7('0x44')]=_['keys'](_0x32c060[_0xf0b7('0x44')]);_0x1b0be0['filters']=_['intersection'](_0x1b0be0[_0xf0b7('0x5d')],_0x1b0be0['query']);_0x4ba925[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x1b0be0['model'],qs[_0xf0b7('0x5b')](_0x32c060[_0xf0b7('0x44')]['fields']));_0x4ba925[_0xf0b7('0x4a')]=_0x4ba925[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x4ba925['attributes']:_0x1b0be0[_0xf0b7('0x5d')];_0x4ba925[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x32c060[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x4ba925[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_['pick'](_0x32c060[_0xf0b7('0x44')],_0x1b0be0[_0xf0b7('0xd4')]));if(_0x32c060[_0xf0b7('0x44')]['filter']){_0x4ba925[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x4ba925[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x4ba925[_0xf0b7('0x4a')],function(_0x2f6360){var _0x5cffd5={};_0x5cffd5[_0x2f6360]={'$like':'%'+_0x32c060[_0xf0b7('0x44')]['filter']+'%'};return _0x5cffd5;})});}_0x4ba925=_['merge']({},_0x4ba925,_0x32c060['options']);return _0x4d468e[_0xf0b7('0xe3')](_0x4ba925);}})[_0xf0b7('0x15')](function(_0xbf1f1f){if(_0xbf1f1f){_0x1bb58d=_0xbf1f1f[_0xf0b7('0x5c')];if(!_0x32c060[_0xf0b7('0x44')][_0xf0b7('0xdb')]('nolimit')){_0x4ba925[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x32c060['query'][_0xf0b7('0x25')]);_0x4ba925[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x32c060['query'][_0xf0b7('0x27')]);}return _0x4d468e[_0xf0b7('0xe3')](_0x4ba925);}})[_0xf0b7('0x15')](function(_0x5b2514){if(_0x5b2514){return _0x5b2514?{'count':_0x1bb58d,'rows':_0x5b2514}:null;}})['then'](respondWithResult(_0x422df6,null))['catch'](handleError(_0x422df6,null));};exports['getMailInteractions']=function(_0x57bc2e,_0x322ac7){var _0x59fcae={'raw':!![],'where':{}};var _0x369603={};var _0x449a63={'count':0x0,'rows':[]};return db['User'][_0xf0b7('0x98')]({'where':{'id':_0x57bc2e[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x322ac7,null))[_0xf0b7('0x15')](function(_0x528957){if(_0x528957){_0x369603[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_0xf0b7('0xe5')][_0xf0b7('0x58')]);_0x369603['query']=_[_0xf0b7('0x57')](_0x57bc2e[_0xf0b7('0x44')]);_0x369603[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x369603[_0xf0b7('0x5d')],_0x369603[_0xf0b7('0x44')]);_0x59fcae['attributes']=_['intersection'](_0x369603[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x57bc2e[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x59fcae[_0xf0b7('0x4a')]=_0x59fcae[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x59fcae[_0xf0b7('0x4a')]:_0x369603['model'];if(!_0x57bc2e[_0xf0b7('0x44')][_0xf0b7('0xdb')]('nolimit')){_0x59fcae['limit']=qs[_0xf0b7('0x25')](_0x57bc2e[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x59fcae[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x57bc2e[_0xf0b7('0x44')][_0xf0b7('0x27')]);}_0x59fcae['order']=qs['sort'](_0x57bc2e[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x59fcae[_0xf0b7('0x43')]=qs['filters'](_[_0xf0b7('0xd7')](_0x57bc2e['query'],_0x369603[_0xf0b7('0xd4')]));_0x59fcae[_0xf0b7('0x43')][_0xf0b7('0xde')]=_0x528957['id'];if(_0x57bc2e[_0xf0b7('0x44')]['filter']){_0x59fcae[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x59fcae['where'],{'$or':_[_0xf0b7('0x37')](_0x59fcae[_0xf0b7('0x4a')],function(_0x492cc5){var _0x2f543b={};_0x2f543b[_0x492cc5]={'$like':'%'+_0x57bc2e['query'][_0xf0b7('0x35')]+'%'};return _0x2f543b;})});}_0x59fcae=_[_0xf0b7('0x5e')]({},_0x59fcae,_0x57bc2e[_0xf0b7('0x5f')]);return db[_0xf0b7('0xe5')][_0xf0b7('0x26')]({'where':_0x59fcae[_0xf0b7('0x43')]})[_0xf0b7('0x15')](function(_0x3d695d){_0x449a63[_0xf0b7('0x26')]=_0x3d695d;if(_0x57bc2e[_0xf0b7('0x44')]['includeAll']){_0x59fcae[_0xf0b7('0x46')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x59fcae);})[_0xf0b7('0x15')](function(_0x31dcf7){_0x449a63[_0xf0b7('0x4d')]=_0x31dcf7;return _0x449a63;});}})[_0xf0b7('0x15')](respondWithFilteredResult(_0x322ac7,_0x59fcae))[_0xf0b7('0x1f')](handleError(_0x322ac7,null));};exports['getSmsInteractions']=function(_0x2e308c,_0x110081){var _0x40c7c9={};var _0x44ee88={};var _0x14e508;var _0x1fa988;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x2e308c[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x110081,null))['then'](function(_0x1df394){if(_0x1df394){_0x14e508=_0x1df394;_0x44ee88['model']=_['keys'](db[_0xf0b7('0xe6')][_0xf0b7('0x58')]);_0x44ee88['query']=_[_0xf0b7('0x57')](_0x2e308c['query']);_0x44ee88['filters']=_[_0xf0b7('0x5a')](_0x44ee88[_0xf0b7('0x5d')],_0x44ee88['query']);_0x40c7c9[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x44ee88['model'],qs[_0xf0b7('0x5b')](_0x2e308c[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x40c7c9['attributes']=_0x40c7c9['attributes']['length']?_0x40c7c9[_0xf0b7('0x4a')]:_0x44ee88[_0xf0b7('0x5d')];_0x40c7c9[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x2e308c['query']['sort']);_0x40c7c9[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x2e308c[_0xf0b7('0x44')],_0x44ee88[_0xf0b7('0xd4')]));if(_0x2e308c['query'][_0xf0b7('0x35')]){_0x40c7c9['where']=_['merge'](_0x40c7c9[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x40c7c9[_0xf0b7('0x4a')],function(_0x46381e){var _0x1cdf21={};_0x1cdf21[_0x46381e]={'$like':'%'+_0x2e308c['query'][_0xf0b7('0x35')]+'%'};return _0x1cdf21;})});}_0x40c7c9=_[_0xf0b7('0x5e')]({},_0x40c7c9,_0x2e308c[_0xf0b7('0x5f')]);return _0x14e508[_0xf0b7('0xe7')](_0x40c7c9);}})[_0xf0b7('0x15')](function(_0x256df3){if(_0x256df3){_0x1fa988=_0x256df3[_0xf0b7('0x5c')];if(!_0x2e308c[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x40c7c9[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x2e308c['query'][_0xf0b7('0x25')]);_0x40c7c9[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x2e308c[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0x14e508[_0xf0b7('0xe7')](_0x40c7c9);}})[_0xf0b7('0x15')](function(_0x50f111){if(_0x50f111){return _0x50f111?{'count':_0x1fa988,'rows':_0x50f111}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x110081,null))[_0xf0b7('0x1f')](handleError(_0x110081,null));};exports[_0xf0b7('0xe8')]=function(_0x3e4349,_0x27712e){var _0x1b1754={};var _0x5bb689={};var _0x39180e;var _0x32c58d;return db[_0xf0b7('0x3d')][_0xf0b7('0x98')]({'where':{'id':_0x3e4349[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x27712e,null))[_0xf0b7('0x15')](function(_0x256130){if(_0x256130){_0x39180e=_0x256130;_0x5bb689[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db[_0xf0b7('0xe9')][_0xf0b7('0x58')]);_0x5bb689[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x3e4349[_0xf0b7('0x44')]);_0x5bb689[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x5bb689[_0xf0b7('0x5d')],_0x5bb689[_0xf0b7('0x44')]);_0x1b1754[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x5bb689[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x3e4349[_0xf0b7('0x44')]['fields']));_0x1b1754[_0xf0b7('0x4a')]=_0x1b1754['attributes'][_0xf0b7('0x5c')]?_0x1b1754['attributes']:_0x5bb689[_0xf0b7('0x5d')];_0x1b1754[_0xf0b7('0xd5')]=qs['sort'](_0x3e4349[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x1b1754['where']=qs[_0xf0b7('0xd4')](_['pick'](_0x3e4349[_0xf0b7('0x44')],_0x5bb689[_0xf0b7('0xd4')]));if(_0x3e4349[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x1b1754['where']=_[_0xf0b7('0x5e')](_0x1b1754[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x1b1754[_0xf0b7('0x4a')],function(_0x506582){var _0x1b3796={};_0x1b3796[_0x506582]={'$like':'%'+_0x3e4349['query'][_0xf0b7('0x35')]+'%'};return _0x1b3796;})});}_0x1b1754=_[_0xf0b7('0x5e')]({},_0x1b1754,_0x3e4349[_0xf0b7('0x5f')]);return _0x39180e[_0xf0b7('0xe8')](_0x1b1754);}})['then'](function(_0x4388eb){if(_0x4388eb){_0x32c58d=_0x4388eb[_0xf0b7('0x5c')];if(!_0x3e4349['query']['hasOwnProperty'](_0xf0b7('0xd9'))){_0x1b1754[_0xf0b7('0x25')]=qs[_0xf0b7('0x25')](_0x3e4349['query'][_0xf0b7('0x25')]);_0x1b1754[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x3e4349[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0x39180e[_0xf0b7('0xe8')](_0x1b1754);}})[_0xf0b7('0x15')](function(_0x5ef32c){if(_0x5ef32c){return _0x5ef32c?{'count':_0x32c58d,'rows':_0x5ef32c}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x27712e,null))[_0xf0b7('0x1f')](handleError(_0x27712e,null));};exports['getWhatsappInteractions']=function(_0x157c36,_0x3b400c){var _0x29356a={};var _0x40c8fb={};var _0x126baf;var _0x5ed906;return db['User']['findOne']({'where':{'id':_0x157c36[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b400c,null))[_0xf0b7('0x15')](function(_0x394d77){if(_0x394d77){_0x126baf=_0x394d77;_0x40c8fb['model']=_['keys'](db[_0xf0b7('0xea')][_0xf0b7('0x58')]);_0x40c8fb['query']=_[_0xf0b7('0x57')](_0x157c36[_0xf0b7('0x44')]);_0x40c8fb[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x40c8fb['model'],_0x40c8fb[_0xf0b7('0x44')]);_0x29356a[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x40c8fb[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x157c36['query'][_0xf0b7('0x5b')]));_0x29356a['attributes']=_0x29356a[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x29356a['attributes']:_0x40c8fb[_0xf0b7('0x5d')];_0x29356a[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x157c36[_0xf0b7('0x44')]['sort']);_0x29356a[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x157c36[_0xf0b7('0x44')],_0x40c8fb[_0xf0b7('0xd4')]));if(_0x157c36[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x29356a[_0xf0b7('0x43')]=_['merge'](_0x29356a[_0xf0b7('0x43')],{'$or':_['map'](_0x29356a['attributes'],function(_0x272ec8){var _0x5394fc={};_0x5394fc[_0x272ec8]={'$like':'%'+_0x157c36[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x5394fc;})});}_0x29356a=_[_0xf0b7('0x5e')]({},_0x29356a,_0x157c36[_0xf0b7('0x5f')]);return _0x126baf[_0xf0b7('0xeb')](_0x29356a);}})['then'](function(_0x12259a){if(_0x12259a){_0x5ed906=_0x12259a[_0xf0b7('0x5c')];if(!_0x157c36[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x29356a['limit']=qs[_0xf0b7('0x25')](_0x157c36[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x29356a[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x157c36[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0x126baf[_0xf0b7('0xeb')](_0x29356a);}})[_0xf0b7('0x15')](function(_0x1b8cf0){if(_0x1b8cf0){return _0x1b8cf0?{'count':_0x5ed906,'rows':_0x1b8cf0}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x3b400c,null))['catch'](handleError(_0x3b400c,null));};exports[_0xf0b7('0xec')]=function(_0x1eb5cc,_0x1d9bc3,_0x14a5cc){var _0x59c76b;var _0x161e20;var _0xc0f950;var _0x40efc4=!_[_0xf0b7('0x6a')](_0x1eb5cc['params']['id'])?_0x1eb5cc[_0xf0b7('0x56')]['id']:!_[_0xf0b7('0x6a')](_0x1eb5cc['user']['id'])?_0x1eb5cc[_0xf0b7('0x81')]['id']:null;return db['User']['find']({'where':{'id':_0x40efc4,'role':{'$or':[_0xf0b7('0x31'),_0xf0b7('0x81'),_0xf0b7('0x2b')]}},'attributes':['id','name','phone',_0xf0b7('0xed'),_0xf0b7('0x30'),_0xf0b7('0x66'),_0xf0b7('0xee')]})[_0xf0b7('0x15')](function(_0x1c7f45){if(_0x1c7f45){if(_0x1c7f45[_0xf0b7('0x30')]==='agent'){_0x59c76b=_0x1c7f45;if(_0x1eb5cc['body'][_0xf0b7('0xa2')]){_0xc0f950=util['format'](_0xf0b7('0xef'),_0x59c76b[_0x1eb5cc['body'][_0xf0b7('0xa2')]]);}else if(_0x1eb5cc['body'][_0xf0b7('0xf0')]){_0xc0f950=util[_0xf0b7('0xae')](_0xf0b7('0xf1'),_0x1eb5cc[_0xf0b7('0x62')][_0xf0b7('0xf0')]);}else{_0xc0f950=util[_0xf0b7('0xae')]('SIP/%s',_0x59c76b['name']);}socket['to'](util[_0xf0b7('0xae')](_0xf0b7('0xf2'),_0x59c76b[_0xf0b7('0x3b')]))[_0xf0b7('0x2c')]('user:forcelogout',{'user':{'id':_0x59c76b['id'],'name':_0x59c76b[_0xf0b7('0x3b')]},'ip':_0x1eb5cc['headers'][_0xf0b7('0xf3')]||_0x1eb5cc['connection']['remoteAddress']||_0x1eb5cc[_0xf0b7('0xf4')][_0xf0b7('0xf5')]||_0x1eb5cc[_0xf0b7('0xf6')]['socket'][_0xf0b7('0xf5')]});return db[_0xf0b7('0xaf')][_0xf0b7('0x2e')]({'where':{'membername':_0x59c76b[_0xf0b7('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0xf0b7('0x94'))][(_0xf0b7('0x95'))](_0xf0b7('0xf7'));}})[_0xf0b7('0x15')](function(){if(_0x59c76b){return _0x59c76b[_0xf0b7('0xf8')]({'raw':!![]});}})[_0xf0b7('0x15')](function(_0x362b5a){if(_0x59c76b){if(_0x362b5a){_0x161e20=_0x362b5a;if(_0x161e20[_0xf0b7('0x5c')]){var _0x5d5423=_0x161e20[_0xf0b7('0x37')](function(_0x2a9e0d){var _0x2903e2={'membername':_0x59c76b['name'],'UserId':_0x59c76b['id'],'queue_name':_0x2a9e0d[_0xf0b7('0x3b')],'VoiceQueueId':_0x2a9e0d['id'],'interface':_0xc0f950,'paused':_0x59c76b[_0xf0b7('0xee')]||![],'penalty':_0x2a9e0d[_0xf0b7('0xf9')]||0x0};return db[_0xf0b7('0xaf')][_0xf0b7('0xfa')](_0x2903e2);});return Promise[_0xf0b7('0x54')](_0x5d5423);}}}})[_0xf0b7('0x15')](function(){if(_0x59c76b){return db[_0xf0b7('0xfb')][_0xf0b7('0x4c')]({'where':{'membername':_0x59c76b[_0xf0b7('0x3b')],'exitAt':null}});}})[_0xf0b7('0x15')](function(_0x35dc7d){if(_0x59c76b){var _0x546320=[];_0x35dc7d[_0xf0b7('0xfc')](function(_0x219a03){_0x546320[_0xf0b7('0x4b')](_0x219a03[_0xf0b7('0x2a')]({'exitAt':moment()[_0xf0b7('0xae')](_0xf0b7('0xfd'))}));});return Promise[_0xf0b7('0x54')](_0x546320);}})['then'](function(){if(_0x59c76b){var _0x450474=[];var _0x3751b5=[];var _0xdee4a2=utils[_0xf0b7('0xfe')]();var _0x56980a={'membername':_0x59c76b[_0xf0b7('0x3b')],'interface':_0xc0f950,'enterAt':moment()[_0xf0b7('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x59c76b['role'],'internal':_0x59c76b['internal']};_0xdee4a2[_0xf0b7('0xfc')](function(_0x572fa4){_0x450474['push'](_[_0xf0b7('0x5e')]({'channel':_0x572fa4,'type':'LOGIN','data1':_0x1eb5cc[_0xf0b7('0x62')][_0xf0b7('0xff')],'data2':_0xc0f950},_0x56980a));if(_0x59c76b[_0xf0b7('0xee')]){_0x3751b5[_0xf0b7('0x4b')](_[_0xf0b7('0x5e')]({'channel':_0x572fa4,'type':_0xf0b7('0x100'),'data1':_0xf0b7('0x101')},_0x56980a));}});return db[_0xf0b7('0xfb')][_0xf0b7('0x8d')](_0x450474[_0xf0b7('0xca')](_0x3751b5),{'individualHooks':!![]});}})[_0xf0b7('0x15')](function(){if(_0x59c76b){return _0x59c76b[_0xf0b7('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xf0b7('0xae')](_0xf0b7('0xfd')),'voicePause':_0x59c76b[_0xf0b7('0xee')]||![],'mailPause':_0x59c76b[_0xf0b7('0xee')]||![],'chatPause':_0x59c76b[_0xf0b7('0xee')]||![],'faxPause':_0x59c76b[_0xf0b7('0xee')]||![],'smsPause':_0x59c76b['loginInPause']||![],'openchannelPause':_0x59c76b[_0xf0b7('0xee')]||![],'whatsappPause':_0x59c76b[_0xf0b7('0xee')]||![],'pauseType':_0x59c76b[_0xf0b7('0xee')]?_0xf0b7('0x101'):null,'interface':_0xc0f950,'lastPauseAt':moment()[_0xf0b7('0xae')](_0xf0b7('0xfd'))});}})['then'](function(_0x36520e){if(_0x1eb5cc[_0xf0b7('0x102')]){return _0x14a5cc();}else{return Promise[_0xf0b7('0x103')](_0x36520e)[_0xf0b7('0x15')](respondWithResult(_0x1d9bc3,null));}})[_0xf0b7('0x1f')](handleError(_0x1d9bc3,null));};exports['logout']=function(_0x4abf5b,_0x6a8f3e){var _0x57ac49;return db['User'][_0xf0b7('0x3a')]({'where':{'id':_0x4abf5b['params']['id'],'role':_0xf0b7('0x2b')},'attributes':['id',_0xf0b7('0x3b'),'role']})['then'](handleEntityNotFound(_0x6a8f3e,null))[_0xf0b7('0x15')](function(_0x334836){if(_0x334836){_0x57ac49=_0x334836;return db['UserVoiceQueueRt'][_0xf0b7('0x2e')]({'where':{'membername':_0x57ac49[_0xf0b7('0x3b')]},'individualHooks':!![]});}})[_0xf0b7('0x15')](function(){return db[_0xf0b7('0xfb')][_0xf0b7('0x4c')]({'where':{'membername':_0x57ac49['name'],'exitAt':null}});})[_0xf0b7('0x15')](function(_0x4fc41b){var _0x1ac490=[];_0x4fc41b[_0xf0b7('0xfc')](function(_0xd73ebf){_0x1ac490[_0xf0b7('0x4b')](_0xd73ebf[_0xf0b7('0x2a')]({'exitAt':moment()[_0xf0b7('0xae')](_0xf0b7('0xfd'))}));});return Promise['all'](_0x1ac490);})[_0xf0b7('0x15')](function(){return _0x57ac49[_0xf0b7('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf0b7('0x15')](respondWithResult(_0x6a8f3e,null))[_0xf0b7('0x1f')](handleError(_0x6a8f3e,null));};exports[_0xf0b7('0x104')]=function(_0x17da34,_0x2a51df){var _0x378d37;return db[_0xf0b7('0xaf')][_0xf0b7('0x2a')]({'paused':0x1},{'where':{'UserId':_0x17da34[_0xf0b7('0x56')]['id']},'individualHooks':!![]})[_0xf0b7('0x15')](function(){return db[_0xf0b7('0x3d')][_0xf0b7('0x3a')]({'where':{'id':_0x17da34[_0xf0b7('0x56')]['id'],'role':_0xf0b7('0x2b')},'attributes':['id',_0xf0b7('0x3b'),'role',_0xf0b7('0x66'),_0xf0b7('0xa2'),_0xf0b7('0xa0')]});})[_0xf0b7('0x15')](handleEntityNotFound(_0x2a51df,null))[_0xf0b7('0x15')](function(_0x26b985){if(_0x26b985){_0x378d37=_0x26b985;return respondWithRpcPromise(_0xf0b7('0x105'),_0xf0b7('0x104'),{'id':_0x378d37['id'],'name':_0x378d37[_0xf0b7('0x3b')],'pause':!![]});}})[_0xf0b7('0x15')](function(){if(_0x378d37){return db[_0xf0b7('0xfb')][_0xf0b7('0x4c')]({'where':{'membername':_0x378d37[_0xf0b7('0x3b')],'type':_0xf0b7('0x100'),'exitAt':null}});}})[_0xf0b7('0x15')](function(_0x508859){if(_0x508859[_0xf0b7('0x5c')]){var _0x19b35a=moment()[_0xf0b7('0xae')](_0xf0b7('0xfd'));for(var _0x4bbc28=0x0,_0x2f385f=_0x508859[_0xf0b7('0x5c')];_0x4bbc28<_0x2f385f;_0x4bbc28++){_0x508859[_0x4bbc28]['updateAttributes']({'exitAt':_0x19b35a});}}})[_0xf0b7('0x15')](function(){var _0x1cb897=[];var _0x67dd5d=utils['getChannels']();_0x67dd5d[_0xf0b7('0xfc')](function(_0x1c6a54){_0x1cb897[_0xf0b7('0x4b')]({'channel':_0x1c6a54,'membername':_0x378d37[_0xf0b7('0x3b')],'interface':_[_0xf0b7('0x6a')](_0x378d37[_0xf0b7('0xa2')])?util[_0xf0b7('0xae')](_0xf0b7('0xf1'),_0x378d37['name']):_0x378d37[_0xf0b7('0xa2')],'type':_0xf0b7('0x100'),'enterAt':moment()[_0xf0b7('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x17da34['body'][_0xf0b7('0x3f')]||_0xf0b7('0x106'),'role':_0x378d37['role'],'internal':_0x378d37['internal']});});return db[_0xf0b7('0xfb')][_0xf0b7('0x8d')](_0x1cb897,{'individualHooks':!![]});})[_0xf0b7('0x15')](function(){return _0x378d37[_0xf0b7('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x17da34['body'][_0xf0b7('0x3f')]||_0xf0b7('0x106'),'lastPauseAt':moment()[_0xf0b7('0xae')](_0xf0b7('0xfd'))});})['then'](respondWithResult(_0x2a51df,null))['catch'](handleError(_0x2a51df,null));};exports[_0xf0b7('0x107')]=function(_0x532ef3,_0x1d8ad1){if(_0x532ef3['body'][_0xf0b7('0xb1')]&&!utils[_0xf0b7('0xa3')](_0x532ef3[_0xf0b7('0x62')][_0xf0b7('0xb1')])){throw new APIBadRequestError(util['format'](_0xf0b7('0x108'),_0x532ef3[_0xf0b7('0x62')][_0xf0b7('0xb1')]));}return db[_0xf0b7('0x3d')][_0xf0b7('0x3a')]({'where':{'id':_0x532ef3[_0xf0b7('0x56')]['id']},'attributes':['id','name',_0xf0b7('0x30'),_0xf0b7('0x66'),_0xf0b7('0xa2'),_0xf0b7('0xa0'),_0xf0b7('0xa1'),'mailPause','chatPause',_0xf0b7('0x109'),'openchannelPause','smsPause','whatsappPause',_0xf0b7('0x10a'),_0xf0b7('0x10b')]})[_0xf0b7('0x15')](function(_0x41789a){if(!_0x41789a){throw new APINotFoundError(util['format'](_0xf0b7('0xcc'),_0x532ef3[_0xf0b7('0x56')]['id']));}return _0x41789a[_0xf0b7('0x107')](_0x532ef3[_0xf0b7('0x62')][_0xf0b7('0xb1')]);})['then'](respondWithResult(_0x1d8ad1,null))['catch'](APIHandleError(_0x1d8ad1));};exports[_0xf0b7('0x10c')]=function(_0x10ddec,_0x4697ac){var _0x555233={};var _0x539d77={};var _0x372fcd;var _0x449fa7;return db['User'][_0xf0b7('0x98')]({'where':{'id':_0x10ddec[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x4697ac,null))['then'](function(_0x26cf4f){if(_0x26cf4f){_0x372fcd=_0x26cf4f;_0x539d77[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db['Team'][_0xf0b7('0x58')]);_0x539d77[_0xf0b7('0x44')]=_['keys'](_0x10ddec[_0xf0b7('0x44')]);_0x539d77[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x539d77[_0xf0b7('0x5d')],_0x539d77['query']);_0x555233[_0xf0b7('0x4a')]=_['intersection'](_0x539d77[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x555233['attributes']=_0x555233['attributes'][_0xf0b7('0x5c')]?_0x555233['attributes']:_0x539d77[_0xf0b7('0x5d')];_0x555233[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x10ddec['query']['sort']);_0x555233[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x10ddec[_0xf0b7('0x44')],_0x539d77[_0xf0b7('0xd4')]));if(_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x555233[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x555233[_0xf0b7('0x43')],{'$or':_['map'](_0x555233[_0xf0b7('0x4a')],function(_0x349056){var _0x4975a4={};_0x4975a4[_0x349056]={'$like':'%'+_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x4975a4;})});}_0x555233=_[_0xf0b7('0x5e')]({},_0x555233,_0x10ddec[_0xf0b7('0x5f')]);return _0x372fcd[_0xf0b7('0x10c')](_0x555233);}})[_0xf0b7('0x15')](function(_0x684d1f){if(_0x684d1f){_0x449fa7=_0x684d1f['length'];if(!_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x555233['limit']=qs[_0xf0b7('0x25')](_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x555233[_0xf0b7('0x27')]=qs['offset'](_0x10ddec[_0xf0b7('0x44')][_0xf0b7('0x27')]);}return _0x372fcd[_0xf0b7('0x10c')](_0x555233);}})[_0xf0b7('0x15')](function(_0x2254db){if(_0x2254db){return _0x2254db?{'count':_0x449fa7,'rows':_0x2254db}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x4697ac,null))[_0xf0b7('0x1f')](handleError(_0x4697ac,null));};exports[_0xf0b7('0x10d')]=function(_0x42b509,_0x4ff02c){var _0x456251=_0x42b509[_0xf0b7('0x56')]['id'];var _0x2095c0=_0x42b509['body']?_0x42b509['body'][_0xf0b7('0x65')]:null;var _0x2e59c0=[];return Promise[_0xf0b7('0x103')]()[_0xf0b7('0x15')](function(){if(!_0x2095c0)throw new APIBadRequestError(_0xf0b7('0x10e'));})['then'](function(){return db[_0xf0b7('0x3d')]['findOne']({'where':{'id':_0x456251}});})['then'](function(_0x5d95c6){if(!_0x5d95c6)throw new APINotFoundError(util[_0xf0b7('0xae')](_0xf0b7('0xcc'),_0x42b509[_0xf0b7('0x56')]['id']));return db[_0xf0b7('0x6d')][_0xf0b7('0x10f')](function(_0x2a162a){return _0x5d95c6[_0xf0b7('0x10d')](_0x2095c0,{'transaction':_0x2a162a})[_0xf0b7('0x15')](function(){return db[_0xf0b7('0x110')]['findAll']({'where':{'id':{'$in':_0x2095c0}}});})[_0xf0b7('0x15')](function(_0x5937f7){var _0x234086=_[_0xf0b7('0x37')](_0x5937f7,function(_0x5f5b41){return _0x5f5b41[_0xf0b7('0x111')]();});return Promise[_0xf0b7('0x54')](_0x234086);})[_0xf0b7('0x15')](function(_0x4c1b28){_0x2e59c0=_['flattenDeep'](_0x4c1b28);var _0x130830=_[_0xf0b7('0x37')](_0x2e59c0,function(_0x29d9c5){return _0x29d9c5[_0xf0b7('0x112')](_0x5d95c6['id'],{'transaction':_0x2a162a});});return Promise['all'](_0x130830);})[_0xf0b7('0x15')](function(){if(!_0x5d95c6['online'])return;var _0x8af659=_[_0xf0b7('0x35')](_0x2e59c0,function(_0x4e2270){return _0x4e2270[_0xf0b7('0x113')]('channel')===_0xf0b7('0x114');});var _0x15584a=_[_0xf0b7('0x37')](_0x8af659,function(_0x29554a){return db[_0xf0b7('0xaf')]['upsert']({'membername':_0x5d95c6['name'],'UserId':_0x5d95c6['id'],'queue_name':_0x29554a['name'],'VoiceQueueId':_0x29554a['id'],'interface':_[_0xf0b7('0x6a')](_0x5d95c6[_0xf0b7('0xa2')])?util[_0xf0b7('0xae')](_0xf0b7('0xf1'),_0x5d95c6[_0xf0b7('0x3b')]):_0x5d95c6['interface'],'paused':_0x5d95c6[_0xf0b7('0xa1')]||![],'penalty':_0x5d95c6[_0xf0b7('0xa7')]},{'transaction':_0x2a162a});});return Promise['all'](_0x15584a);})['then'](function(){return db[_0xf0b7('0x115')][_0xf0b7('0x4c')]({'where':{'teamId':{'$in':_0x2095c0}}});})['then'](function(_0x3e9dcc){var _0x4f8c8b=_[_0xf0b7('0x37')](_0x3e9dcc,function(_0x20a10c){return db['UserVoicePrefix'][_0xf0b7('0x8b')]({'UserId':_0x5d95c6['id'],'VoicePrefixId':_0x20a10c[_0xf0b7('0x116')]},{'transaction':_0x2a162a});});return Promise[_0xf0b7('0x54')](_0x4f8c8b);});});})[_0xf0b7('0x15')](function(){for(var _0x2cc49e=0x0;_0x2cc49e<_0x2e59c0[_0xf0b7('0x5c')];_0x2cc49e++){var _0x17ce1c=_0x2e59c0[_0x2cc49e][_0xf0b7('0x113')](_0xf0b7('0xb1'));var _0x54ba79=_0x17ce1c+_0xf0b7('0xaa');socket[_0xf0b7('0x2c')](_0xf0b7('0x81')+_0x17ce1c+_0xf0b7('0xab'),{'UserId':_0x456251,['queueField']:_0x2e59c0[_0x2cc49e]['id']});}})[_0xf0b7('0x15')](respondWithStatusCode(_0x4ff02c,null))[_0xf0b7('0x1f')](APIHandleError(_0x4ff02c));};exports[_0xf0b7('0x117')]=function(_0x4bfac4,_0x309c92){var _0x3471b6=_0x4bfac4[_0xf0b7('0x56')]['id'];var _0x30da11=null;if(_0x4bfac4[_0xf0b7('0x44')][_0xf0b7('0x65')]){_0x30da11=_[_0xf0b7('0xb3')](_0x4bfac4[_0xf0b7('0x44')][_0xf0b7('0x65')])?_0x4bfac4[_0xf0b7('0x44')]['ids']:[_0x4bfac4[_0xf0b7('0x44')][_0xf0b7('0x65')]];}var _0x2bbf30=[];return Promise[_0xf0b7('0x103')]()[_0xf0b7('0x15')](function(){if(!_0x30da11)throw new APIBadRequestError(_0xf0b7('0x118'));})[_0xf0b7('0x15')](function(){return db['User'][_0xf0b7('0x98')]({'where':{'id':_0x3471b6}});})[_0xf0b7('0x15')](function(_0x34ba1e){if(!_0x34ba1e)throw new APINotFoundError(util[_0xf0b7('0xae')](_0xf0b7('0xcc'),_0x4bfac4[_0xf0b7('0x56')]['id']));return db[_0xf0b7('0x6d')][_0xf0b7('0x10f')](function(_0x9995ed){return _0x34ba1e[_0xf0b7('0x117')](_0x30da11,{'transaction':_0x9995ed})[_0xf0b7('0x15')](function(){return db[_0xf0b7('0x110')][_0xf0b7('0x4c')]({'where':{'id':{'$in':_0x30da11}}});})['then'](function(_0x12e668){var _0x4d0cf0=_[_0xf0b7('0x37')](_0x12e668,function(_0x5b4f40){return _0x5b4f40[_0xf0b7('0x111')]();});return Promise[_0xf0b7('0x54')](_0x4d0cf0);})[_0xf0b7('0x15')](function(_0x52d46d){_0x2bbf30=_[_0xf0b7('0x119')](_0x52d46d);var _0x2730fe=_['map'](_0x2bbf30,function(_0x3d9b58){return _0x3d9b58[_0xf0b7('0x11a')](_0x34ba1e['id'],{'transaction':_0x9995ed});});return Promise[_0xf0b7('0x54')](_0x2730fe);})['then'](function(){if(!_0x34ba1e[_0xf0b7('0xa0')])return;var _0x476b6b=_[_0xf0b7('0x35')](_0x2bbf30,function(_0x110b34){return _0x110b34[_0xf0b7('0x113')](_0xf0b7('0xb1'))==='Voice';});var _0x258dc4=_['map'](_0x476b6b,function(_0x1fea6d){return db[_0xf0b7('0xaf')][_0xf0b7('0x2e')]({'where':{'VoiceQueueId':_0x1fea6d['id'],'UserId':_0x34ba1e['id']},'transaction':_0x9995ed});});return Promise[_0xf0b7('0x54')](_0x258dc4);})[_0xf0b7('0x15')](function(){return db[_0xf0b7('0x115')][_0xf0b7('0x4c')]({'where':{'teamId':{'$in':_0x30da11}}});})[_0xf0b7('0x15')](function(_0x25b6c9){var _0x55012c=_[_0xf0b7('0x37')](_0x25b6c9,function(_0x23ec3c){return db[_0xf0b7('0x11b')][_0xf0b7('0x2e')]({'where':{'UserId':_0x34ba1e['id'],'VoicePrefixId':_0x23ec3c['VoicePrefixId']}},{'transaction':_0x9995ed});});return Promise[_0xf0b7('0x54')](_0x55012c);});});})[_0xf0b7('0x15')](function(){for(var _0x3c5bb4=0x0;_0x3c5bb4<_0x2bbf30[_0xf0b7('0x5c')];_0x3c5bb4++){var _0x59d216=_0x2bbf30[_0x3c5bb4][_0xf0b7('0x113')](_0xf0b7('0xb1'));var _0x4284be=_0x59d216+'QueueId';socket[_0xf0b7('0x2c')](_0xf0b7('0x81')+_0x59d216+'Queue:remove',{'UserId':_0x3471b6,['queueField']:_0x2bbf30[_0x3c5bb4]['id']});}})['then'](respondWithStatusCode(_0x309c92,null))[_0xf0b7('0x1f')](APIHandleError(_0x309c92));};exports['getLists']=function(_0x35750b,_0x54a24d){var _0x4e0ef8={};var _0x237fa8={};var _0x11de03;var _0xffa989;return db[_0xf0b7('0x3d')]['findOne']({'where':{'id':_0x35750b[_0xf0b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x54a24d,null))['then'](function(_0x5a7d84){if(_0x5a7d84){_0x11de03=_0x5a7d84;_0x237fa8[_0xf0b7('0x5d')]=_[_0xf0b7('0x57')](db['CmList'][_0xf0b7('0x58')]);_0x237fa8['query']=_['keys'](_0x35750b[_0xf0b7('0x44')]);_0x237fa8[_0xf0b7('0xd4')]=_[_0xf0b7('0x5a')](_0x237fa8['model'],_0x237fa8[_0xf0b7('0x44')]);_0x4e0ef8[_0xf0b7('0x4a')]=_[_0xf0b7('0x5a')](_0x237fa8[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x35750b[_0xf0b7('0x44')]['fields']));_0x4e0ef8['attributes']=_0x4e0ef8[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x4e0ef8['attributes']:_0x237fa8[_0xf0b7('0x5d')];_0x4e0ef8[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x35750b[_0xf0b7('0x44')][_0xf0b7('0xd6')]);_0x4e0ef8[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x35750b['query'],_0x237fa8[_0xf0b7('0xd4')]));if(_0x35750b[_0xf0b7('0x44')]['filter']){_0x4e0ef8[_0xf0b7('0x43')]=_[_0xf0b7('0x5e')](_0x4e0ef8[_0xf0b7('0x43')],{'$or':_[_0xf0b7('0x37')](_0x4e0ef8[_0xf0b7('0x4a')],function(_0x449a68){var _0x3f5062={};_0x3f5062[_0x449a68]={'$like':'%'+_0x35750b[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0x3f5062;})});}_0x4e0ef8=_[_0xf0b7('0x5e')]({},_0x4e0ef8,_0x35750b['options']);return _0x11de03['getLists'](_0x4e0ef8);}})[_0xf0b7('0x15')](function(_0x19c267){if(_0x19c267){_0xffa989=_0x19c267[_0xf0b7('0x5c')];if(!_0x35750b[_0xf0b7('0x44')][_0xf0b7('0xdb')](_0xf0b7('0xd9'))){_0x4e0ef8[_0xf0b7('0x25')]=qs['limit'](_0x35750b[_0xf0b7('0x44')][_0xf0b7('0x25')]);_0x4e0ef8[_0xf0b7('0x27')]=qs[_0xf0b7('0x27')](_0x35750b['query'][_0xf0b7('0x27')]);}return _0x11de03[_0xf0b7('0x11c')](_0x4e0ef8);}})[_0xf0b7('0x15')](function(_0xba562c){if(_0xba562c){return _0xba562c?{'count':_0xffa989,'rows':_0xba562c}:null;}})[_0xf0b7('0x15')](respondWithResult(_0x54a24d,null))[_0xf0b7('0x1f')](handleError(_0x54a24d,null));};exports[_0xf0b7('0x11d')]=function(_0x46bf4d,_0x573c0e){var _0x163654={};var _0x35ac1e={};var _0x82cc1b;return db['User']['findOne']({'where':{'id':_0x46bf4d[_0xf0b7('0x56')]['id']}})[_0xf0b7('0x15')](handleEntityNotFound(_0x573c0e,null))[_0xf0b7('0x15')](function(_0x14d225){if(_0x14d225){_0x82cc1b=_0x14d225;_0x35ac1e['model']=_[_0xf0b7('0x57')](db['User']['rawAttributes']);_0x35ac1e[_0xf0b7('0x44')]=_[_0xf0b7('0x57')](_0x46bf4d['query']);_0x35ac1e['filters']=_[_0xf0b7('0x5a')](_0x35ac1e[_0xf0b7('0x5d')],_0x35ac1e[_0xf0b7('0x44')]);_0x163654['attributes']=_[_0xf0b7('0x5a')](_0x35ac1e[_0xf0b7('0x5d')],qs[_0xf0b7('0x5b')](_0x46bf4d[_0xf0b7('0x44')][_0xf0b7('0x5b')]));_0x163654[_0xf0b7('0x4a')]=_0x163654[_0xf0b7('0x4a')][_0xf0b7('0x5c')]?_0x163654[_0xf0b7('0x4a')]:_0x35ac1e[_0xf0b7('0x5d')];_0x163654[_0xf0b7('0xd5')]=qs[_0xf0b7('0xd6')](_0x46bf4d[_0xf0b7('0x44')]['sort']);_0x163654[_0xf0b7('0x43')]=qs[_0xf0b7('0xd4')](_[_0xf0b7('0xd7')](_0x46bf4d[_0xf0b7('0x44')],_0x35ac1e[_0xf0b7('0xd4')]));if(_0x46bf4d[_0xf0b7('0x44')][_0xf0b7('0x35')]){_0x163654[_0xf0b7('0x43')]=_['merge'](_0x163654[_0xf0b7('0x43')],{'$or':_['map'](_0x163654[_0xf0b7('0x4a')],function(_0x1fb114){var _0xda6bf5={};_0xda6bf5[_0x1fb114]={'$like':'%'+_0x46bf4d[_0xf0b7('0x44')][_0xf0b7('0x35')]+'%'};return _0xda6bf5;})});}_0x163654[_0xf0b7('0x5d')]=db[_0xf0b7('0x3d')];_0x163654['as']='Agents';_0x163654=_[_0xf0b7('0x5e')]({},_0x163654,_0x46bf4d[_0xf0b7('0x5f')]);return _0x82cc1b['getVoiceQueues']({'include':[_0x163654]});}})[_0xf0b7('0x15')](function(_0x53f7ef){if(_0x53f7ef){var _0x2c4162={},_0x458800=[];for(var _0xec68df=0x0;_0xec68df<_0x53f7ef[_0xf0b7('0x5c')];_0xec68df+=0x1){for(var _0x5dbf27=0x0,_0x47ace1;_0x5dbf27<_0x53f7ef[_0xec68df]['Agents']['length'];_0x5dbf27+=0x1){_0x47ace1=_0x53f7ef[_0xec68df]['Agents'][_0x5dbf27][_0xf0b7('0x2f')]({'plain':!![]});_0x2c4162[_0x47ace1['id']]=_0x47ace1;}}_0x2c4162=_[_0xf0b7('0x11e')](_0x2c4162);for(var _0x113cc8=qs[_0xf0b7('0x27')](_0x46bf4d[_0xf0b7('0x44')][_0xf0b7('0x27')]);_0x113cc8<_0x2c4162[_0xf0b7('0x5c')]&&_0x458800[_0xf0b7('0x5c')]=_0x4391db){_0x12e3a5=_0x4391db;_0xb69ec9=0xc8;}else{_0xb69ec9=0xce;}_0x2131e9['status'](_0xb69ec9);return _0x2131e9[_0xae3d('0x2d')](_0xae3d('0x2e'),_0x54c1e1+'-'+_0x12e3a5+'/'+_0x4391db)['json'](_0x5d45db);}return null;};}function saveUpdates(_0x5c155e){return function(_0x323715){if(_0x323715){return _0x323715[_0xae3d('0x2f')](_0x5c155e)[_0xae3d('0x19')](function(_0x432c04){if(_0x432c04[_0xae3d('0x30')]==='agent'){socket['emit']('userNotification:recalc:'+_0x432c04['id'],_0x432c04);}return _0x432c04;});}return null;};}function removeEntity(_0x5cfdae){return function(_0x90b62a){if(_0x90b62a){return _0x90b62a[_0xae3d('0x31')]()[_0xae3d('0x19')](function(){var _0x54a75c=_0x90b62a[_0xae3d('0x32')]({'plain':!![]});if(_0x54a75c[_0xae3d('0x30')]===_0xae3d('0x33'))return;var _0x3748d2=[{'name':_0xae3d('0x34'),'value':_0xae3d('0x35'),'ignore':!![]},{'name':_0xae3d('0x36'),'value':'agent','ignore':![]},{'name':_0xae3d('0x37'),'value':'telephone','ignore':![]}];var _0x55aae4=_(_0x3748d2)[_0xae3d('0x38')]('ignore')[_0xae3d('0x39')]('value')['value']();if(_[_0xae3d('0x3a')](_0x55aae4,_0x54a75c[_0xae3d('0x30')])){return;}var _0x403484=_['find'](_0x3748d2,[_0xae3d('0x3b'),_0x54a75c['role']])[_0xae3d('0x3c')];return db[_0xae3d('0x3d')][_0xae3d('0x31')]({'where':{'type':_0x403484,'resourceId':_0x54a75c['id']}})[_0xae3d('0x19')](function(){return _0x90b62a;});})[_0xae3d('0x19')](function(){_0x5cfdae[_0xae3d('0x26')](0xcc)[_0xae3d('0x27')]();});}};}function handleEntityNotFound(_0x21d84d){return function(_0x267dff){if(!_0x267dff){_0x21d84d[_0xae3d('0x25')](0x194);}return _0x267dff;};}function handleError(_0x18855c,_0x5543ee){_0x5543ee=_0x5543ee||0x1f4;return function(_0x544269){logger[_0xae3d('0x1f')](_0x544269['stack']);if(_0x544269[_0xae3d('0x3c')]){delete _0x544269[_0xae3d('0x3c')];}_0x18855c[_0xae3d('0x26')](_0x5543ee)[_0xae3d('0x3e')](_0x544269);};}exports[_0xae3d('0x3f')]=function(_0x35db44,_0x238e65){var _0x15350d={},_0x26de54={'count':0x0,'rows':[]};var _0xd8cd66=_(db[_0xae3d('0x40')]['rawAttributes'])[_0xae3d('0x39')](function(_0x3ab6a6){return{'name':_0x3ab6a6[_0xae3d('0x41')],'type':_0x3ab6a6['type']['key']};})[_0xae3d('0x38')](function(_0x190dd4){return!_['includes']([_0xae3d('0x42'),_0xae3d('0x43')],_0x190dd4[_0xae3d('0x3c')]);})[_0xae3d('0x3b')]();_0x15350d=qs[_0xae3d('0x44')](_0xd8cd66,_0x35db44);var _0x1a483a={'where':_0x15350d['where']};return db[_0xae3d('0x40')][_0xae3d('0x2c')](_0x1a483a)[_0xae3d('0x19')](function(_0x938811){_0x26de54[_0xae3d('0x2c')]=_0x938811;if(_0x35db44['query'][_0xae3d('0x45')]){_0x15350d['include']=[{'all':!![]}];}if(_0x35db44[_0xae3d('0x46')][_0xae3d('0x47')]===_0xae3d('0x48')){_0x15350d[_0xae3d('0x49')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_['includes'](_0x15350d[_0xae3d('0x4a')],'id')){_0x15350d[_0xae3d('0x4a')]['push']('id');}return db['User']['findAll'](_0x15350d);})[_0xae3d('0x19')](function(_0x2fdc6e){_0x26de54[_0xae3d('0x4b')]=_0x2fdc6e;if(_0x35db44[_0xae3d('0x46')][_0xae3d('0x4c')]===_0xae3d('0x48')){var _0x42357f=[];for(var _0x5c621e=0x0;_0x5c621e<_0x26de54['rows']['length'];_0x5c621e++){_0x42357f[_0xae3d('0x4d')](get_open_tabs('chat',_0x26de54[_0xae3d('0x4b')][_0x5c621e][_0xae3d('0x4e')]));_0x42357f[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x4f'),_0x26de54[_0xae3d('0x4b')][_0x5c621e][_0xae3d('0x4e')]));_0x42357f[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x50'),_0x26de54[_0xae3d('0x4b')][_0x5c621e][_0xae3d('0x4e')]));_0x42357f[_0xae3d('0x4d')](get_open_tabs('mail',_0x26de54['rows'][_0x5c621e]['dataValues']));_0x42357f[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x51'),_0x26de54[_0xae3d('0x4b')][_0x5c621e][_0xae3d('0x4e')]));_0x42357f['push'](get_open_tabs('whatsapp',_0x26de54[_0xae3d('0x4b')][_0x5c621e][_0xae3d('0x4e')]));}return Promise[_0xae3d('0x52')](_0x42357f)[_0xae3d('0x19')](function(){return _0x26de54;});}else{return _0x26de54;}})['then'](respondWithFilteredResult(_0x238e65,_0x15350d))[_0xae3d('0x24')](handleError(_0x238e65,null));};exports[_0xae3d('0x53')]=function(_0xad005d,_0x455e47){var _0x2a6a24={'raw':![],'where':{'id':_0xad005d[_0xae3d('0x54')]['id']}},_0x38ccf1={};_0x38ccf1[_0xae3d('0x55')]=_[_0xae3d('0x56')](_[_0xae3d('0x57')](db[_0xae3d('0x40')][_0xae3d('0x58')]),['password','salt']);_0x38ccf1['query']=_[_0xae3d('0x57')](_0xad005d[_0xae3d('0x46')]);_0x38ccf1['filters']=_[_0xae3d('0x59')](_0x38ccf1['model'],_0x38ccf1['query']);_0x2a6a24[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x38ccf1[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0xad005d[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x2a6a24[_0xae3d('0x4a')]=_0x2a6a24['attributes'][_0xae3d('0x5b')]?_0x2a6a24[_0xae3d('0x4a')]:_0x38ccf1[_0xae3d('0x55')];if(_0xad005d[_0xae3d('0x46')]['includeAll']){_0x2a6a24[_0xae3d('0x49')]=[{'all':!![]}];}if(_0xad005d[_0xae3d('0x46')][_0xae3d('0x47')]===_0xae3d('0x48')){_0x2a6a24['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x2a6a24=_[_0xae3d('0x5c')]({},_0x2a6a24,_0xad005d['options']);if(!_['includes'](_0x2a6a24[_0xae3d('0x4a')],'id')){_0x2a6a24[_0xae3d('0x4a')][_0xae3d('0x4d')]('id');}return db[_0xae3d('0x40')][_0xae3d('0x5d')](_0x2a6a24)[_0xae3d('0x19')](handleEntityNotFound(_0x455e47,null))['then'](function(_0x42e9af){var _0x4448d5=[];values=_0x42e9af;if(_0xad005d[_0xae3d('0x46')][_0xae3d('0x4c')]===_0xae3d('0x48')){_0x4448d5[_0xae3d('0x4d')](get_open_tabs('chat',_0x42e9af[_0xae3d('0x4e')]));_0x4448d5[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x4f'),_0x42e9af['dataValues']));_0x4448d5['push'](get_open_tabs('openchannel',_0x42e9af[_0xae3d('0x4e')]));_0x4448d5[_0xae3d('0x4d')](get_open_tabs('whatsapp',_0x42e9af[_0xae3d('0x4e')]));_0x4448d5[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x50'),_0x42e9af['dataValues']));_0x4448d5[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x5e'),_0x42e9af[_0xae3d('0x4e')]));return Promise[_0xae3d('0x52')](_0x4448d5);}else{return values;}})[_0xae3d('0x19')](function(){return values;})[_0xae3d('0x19')](respondWithResult(_0x455e47,null))[_0xae3d('0x24')](handleError(_0x455e47,null));};exports[_0xae3d('0x2f')]=function(_0x4c8b7b,_0x49f862){if(_0x4c8b7b[_0xae3d('0x5f')]['id']){delete _0x4c8b7b[_0xae3d('0x5f')]['id'];}delete _0x4c8b7b[_0xae3d('0x5f')]['role'];return db['User'][_0xae3d('0x5d')]({'where':{'id':_0x4c8b7b[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x49f862,null))[_0xae3d('0x19')](saveUpdates(_0x4c8b7b['body'],null))[_0xae3d('0x19')](respondWithResult(_0x49f862,null))[_0xae3d('0x24')](handleError(_0x49f862,null));};exports['describe']=function(_0x19aab4,_0x2c221b){return db[_0xae3d('0x40')][_0xae3d('0x60')]()[_0xae3d('0x19')](respondWithResult(_0x2c221b,null))[_0xae3d('0x24')](handleError(_0x2c221b,null));};exports[_0xae3d('0x61')]=function(_0x551269,_0xe340c1){return db[_0xae3d('0x40')][_0xae3d('0x5d')]({'where':{'id':_0x551269[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0xe340c1,null))['then'](function(_0x18c9b0){if(_0x18c9b0){return _0x18c9b0[_0xae3d('0x61')](_0x551269[_0xae3d('0x5f')][_0xae3d('0x62')],_[_0xae3d('0x63')](_0x551269[_0xae3d('0x5f')],['ids','id'])||{});}})[_0xae3d('0x19')](respondWithResult(_0xe340c1,null))[_0xae3d('0x24')](handleError(_0xe340c1,null));};function validateUser(_0x51a078){return new Promise(function(_0x292b03,_0x343584){if(_0x51a078[_0xae3d('0x64')])return _0x292b03(_0x51a078);return db['Setting']['findById'](0x1)[_0xae3d('0x19')](function(_0xbd425b){if(_0xbd425b[_0xae3d('0x65')])authService[_0xae3d('0x66')](_0x51a078[_0xae3d('0x42')]);db[_0xae3d('0x40')][_0xae3d('0x67')]('internal')[_0xae3d('0x19')](function(_0x2e696d){if(_['isNil'](_0x2e696d)){_0x51a078[_0xae3d('0x64')]=_0xbd425b['min_internal']||0x1;return;}if(_[_0xae3d('0x68')](_0xbd425b[_0xae3d('0x69')])||_0xbd425b[_0xae3d('0x69')]===_0x2e696d){_0x51a078[_0xae3d('0x64')]=_0x2e696d+0x1;return;}if(_0xbd425b[_0xae3d('0x69')]>_0x2e696d){_0x51a078['internal']=_0xbd425b[_0xae3d('0x69')];return;}return db[_0xae3d('0x6a')][_0xae3d('0x46')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0xae3d('0x6b')][_0xae3d('0x6c')]})['then'](function(_0x57eb98){if(_0x57eb98&&_0x57eb98[_0xae3d('0x5b')]){for(var _0x5785d8=0x0,_0x388880=_0x57eb98['length'];_0x5785d8<_0x388880&&_['isNil'](_0x51a078['internal']);_0x5785d8++){if(_0xbd425b['min_internal']<=_0x57eb98[_0x5785d8][_0xae3d('0x6d')]){_0x51a078[_0xae3d('0x64')]=_0x57eb98[_0x5785d8]['from'];}else if(_0xbd425b['min_internal']>_0x57eb98[_0x5785d8][_0xae3d('0x6d')]&&_0xbd425b[_0xae3d('0x69')]<=_0x57eb98[_0x5785d8]['to']){_0x51a078[_0xae3d('0x64')]=_0xbd425b[_0xae3d('0x69')];}}}if(_[_0xae3d('0x68')](_0x51a078[_0xae3d('0x64')])){_0x51a078[_0xae3d('0x64')]=_0x2e696d+0x1;}return _0x292b03(_0x51a078);});});})['catch'](function(_0x21cc63){_0x343584(_0x21cc63);});});}function updateUser(_0x3d6aef){return new Promise(function(_0x199993,_0x1ab2e7){try{if(_0x3d6aef[_0xae3d('0x6e')]){_0x3d6aef[_0xae3d('0x6f')]=_0x3d6aef['internal'];_0x3d6aef[_0xae3d('0x70')]={'mailbox':_0x3d6aef[_0xae3d('0x64')],'password':_0x3d6aef['password'],'fullname':_0x3d6aef['fullname'],'email':_0x3d6aef[_0xae3d('0x71')]};}if(_0x3d6aef[_0xae3d('0x30')]==='agent'){if(!_0x3d6aef[_0xae3d('0x72')])_0x3d6aef[_0xae3d('0x72')]=[_0xae3d('0x73'),'102',_0xae3d('0x74'),_0xae3d('0x75'),'110','104',_0xae3d('0x76'),_0xae3d('0x77'),_0xae3d('0x78'),'108',_0xae3d('0x79'),_0xae3d('0x7a'),'111',_0xae3d('0x7b'),_0xae3d('0x7c')];}_0x199993(_0x3d6aef);}catch(_0x37319e){_0x1ab2e7(_0x37319e);}});}exports['create']=function(_0x46ea6a,_0x290335){if(_0x46ea6a[_0xae3d('0x35')]['role']===_0xae3d('0x7d'))throw new Error('Unauthorized');if(_0x46ea6a[_0xae3d('0x5f')]['role']==='user'&&_0x46ea6a[_0xae3d('0x35')]['role']!==_0xae3d('0x33')){throw new Error(_0xae3d('0x7e'));}if(_0x46ea6a[_0xae3d('0x5f')][_0xae3d('0x30')]==='admin'&&_0x46ea6a[_0xae3d('0x35')][_0xae3d('0x30')]!==_0xae3d('0x33')){throw new Error(_0xae3d('0x7f'));}return licenseUtil[_0xae3d('0x80')]([_0x46ea6a[_0xae3d('0x5f')]])[_0xae3d('0x19')](function(){return validateUser(_0x46ea6a[_0xae3d('0x5f')]);})[_0xae3d('0x19')](function(_0x19f797){return updateUser(_0x19f797)[_0xae3d('0x19')](function(_0x331dbb){if(_0x331dbb[_0xae3d('0x30')]===_0xae3d('0x33')){_0x331dbb[_0xae3d('0x81')]=_0x46ea6a[_0xae3d('0x35')][_0xae3d('0x81')];delete _0x331dbb['userProfileId'];}return _0x331dbb;});})[_0xae3d('0x19')](function(_0x48e648){return db[_0xae3d('0x40')][_0xae3d('0x82')](_0x48e648,{'include':[{'model':db[_0xae3d('0x70')],'as':'VoiceMail'}]});})[_0xae3d('0x19')](function(_0x44127e){if(_0x46ea6a[_0xae3d('0x5f')][_0xae3d('0x30')]===_0xae3d('0x35'))return _0x44127e;if(_0x46ea6a[_0xae3d('0x35')][_0xae3d('0x30')]!==_0xae3d('0x35'))return _0x44127e;return db['UserProfileSection'][_0xae3d('0x5d')]({'where':{'name':_0x44127e[_0xae3d('0x30')]===_0xae3d('0x7d')?'Agents':_0xae3d('0x37'),'userProfileId':_0x46ea6a[_0xae3d('0x35')][_0xae3d('0x83')]},'raw':!![]})['then'](function(_0x3451cf){if(!_0x3451cf||_0x3451cf[_0xae3d('0x84')]!=0x0)return _0x44127e;return db['UserProfileResource'][_0xae3d('0x82')]({'name':_0x44127e['name'],'resourceId':_0x44127e['id'],'type':_0x3451cf[_0xae3d('0x3c')],'sectionId':_0x3451cf['id']},{})['then'](function(){return _0x44127e;});})[_0xae3d('0x24')](function(_0x185439){logger[_0xae3d('0x1f')](_0xae3d('0x85'),_0x185439);throw _0x185439;});})[_0xae3d('0x19')](respondWithResult(_0x290335,0xc9))['catch'](handleError(_0x290335,null));};exports[_0xae3d('0x86')]=function(_0x27cf68,_0x53aeea){var _0x546185=_0x27cf68[_0xae3d('0x5f')];var _0x700176=[];if(_0x27cf68[_0xae3d('0x35')][_0xae3d('0x30')]==='agent')throw new Error(_0xae3d('0x87'));if(_[_0xae3d('0x88')](_0x546185,[_0xae3d('0x30'),'user'])&&_0x27cf68['user'][_0xae3d('0x30')]!=='admin'){throw new Error(_0xae3d('0x7e'));}if(_['some'](_0x546185,[_0xae3d('0x30'),_0xae3d('0x33')])&&_0x27cf68[_0xae3d('0x35')][_0xae3d('0x30')]!=='admin'){throw new Error(_0xae3d('0x89'));}return licenseUtil[_0xae3d('0x80')](_0x546185)[_0xae3d('0x19')](function(){return validateUser(_0x546185[0x0]);})['then'](function(){for(var _0xbe7948=0x1;_0xbe7948<_0x546185['length'];_0xbe7948++){var _0x30a9ee=_0x546185[_0xbe7948-0x1][_0xae3d('0x64')];if(!_0x546185[_0xbe7948]['internal'])_0x546185[_0xbe7948]['internal']=_0x30a9ee+0x1;_0x700176[_0xae3d('0x4d')](validateUser(_0x546185[_0xbe7948]));}return Promise['all'](_0x700176);})['then'](function(){_0x700176=[];for(var _0x1e53a9=0x0;_0x1e53a9<_0x546185['length'];_0x1e53a9++){_0x700176[_0xae3d('0x4d')](updateUser(_0x546185[_0x1e53a9]));}return Promise['all'](_0x700176);})[_0xae3d('0x19')](function(){_0x700176=_0x546185['map'](function(_0x27c0ff){return db['User'][_0xae3d('0x82')](_0x27c0ff,{'include':[{'model':db['VoiceMail'],'as':_0xae3d('0x70')}]})[_0xae3d('0x19')](function(_0x394c78){_0x27c0ff['id']=_0x394c78['id'];return _0x27c0ff;});});return Promise[_0xae3d('0x52')](_0x700176);})[_0xae3d('0x19')](function(_0x1c05a5){if(_0x27cf68[_0xae3d('0x5f')][_0xae3d('0x30')]===_0xae3d('0x35'))return _0x1c05a5;if(_0x27cf68['user'][_0xae3d('0x30')]!==_0xae3d('0x35'))return _0x1c05a5;var _0xca73b8=_[_0xae3d('0x88')](_0x1c05a5,function(_0x3a06eb){return _0x3a06eb['role']===_0xae3d('0x7d')||_0x3a06eb[_0xae3d('0x30')]===_0xae3d('0x8a');});if(!_0xca73b8)return _0x1c05a5;return db['UserProfileSection'][_0xae3d('0x8b')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x27cf68[_0xae3d('0x35')]['userProfileId']},'raw':!![]})[_0xae3d('0x19')](function(_0xb5c810){if(_[_0xae3d('0x8c')](_0xb5c810)||!_[_0xae3d('0x88')](_0xb5c810,[_0xae3d('0x84'),0x0]))return _0x1c05a5;_0x700176=[];var _0x5d1e8e=_(_0xb5c810)[_0xae3d('0x39')](function(_0x4230eb){if(_0x4230eb[_0xae3d('0x84')]===0x1)return;return _0x4230eb[_0xae3d('0x3c')]===_0xae3d('0x36')?_0xae3d('0x7d'):'telephone';})['compact']()['value']();for(var _0x50bb54=0x0;_0x50bb54<_0x1c05a5['length'];_0x50bb54++){if(!_[_0xae3d('0x3a')](_0x5d1e8e,_0x1c05a5[_0x50bb54]['role']))return;var _0x4c55ab=_0x1c05a5[_0x50bb54][_0xae3d('0x30')]===_0xae3d('0x7d')?'Agents':'Telephones';_0x700176[_0xae3d('0x4d')](db[_0xae3d('0x3d')][_0xae3d('0x82')]({'name':_0x1c05a5[_0x50bb54][_0xae3d('0x3c')],'resourceId':_0x1c05a5[_0x50bb54]['id'],'type':_0x4c55ab,'sectionId':_[_0xae3d('0x5d')](_0xb5c810,[_0xae3d('0x3c'),_0x4c55ab])['id']},{}));}return Promise[_0xae3d('0x52')](_0x700176);});})[_0xae3d('0x19')](respondWithResult(_0x53aeea,0xc9))[_0xae3d('0x24')](handleError(_0x53aeea,null));};exports[_0xae3d('0x8d')]=function(_0xce0e1c,_0x15a746){if(_0xce0e1c[_0xae3d('0x5f')]['id']){delete _0xce0e1c['body']['id'];}return db['User'][_0xae3d('0x5d')]({'where':{'id':_0xce0e1c['params']['id']}})[_0xae3d('0x19')](function(_0x409e0b){if(!_0x409e0b)return null;if(_0x409e0b['id']===_0xce0e1c[_0xae3d('0x35')]['id']){if(!_0xce0e1c[_0xae3d('0x5f')]['oldPassword']||!_0xce0e1c[_0xae3d('0x5f')][_0xae3d('0x8e')]){throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x409e0b['authenticate'](_0xce0e1c['body']['oldPassword'])){throw new db['Sequelize'][(_0xae3d('0x90'))](_0xae3d('0x91'));}if(_0xce0e1c[_0xae3d('0x5f')][_0xae3d('0x92')]===_0xce0e1c[_0xae3d('0x5f')]['newPassword']){throw new db[(_0xae3d('0x8f'))]['ValidationError'](_0xae3d('0x93'));}}else if(_0xce0e1c[_0xae3d('0x35')][_0xae3d('0x30')]===_0xae3d('0x33')){if(!_0xce0e1c['body']['newPassword']){throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))](_0xae3d('0x94'));}}else if(_0xce0e1c[_0xae3d('0x35')][_0xae3d('0x30')]===_0xae3d('0x35')){if(!_0xce0e1c[_0xae3d('0x5f')][_0xae3d('0x8e')]){throw new db['Sequelize'][(_0xae3d('0x90'))](_0xae3d('0x94'));}if(_0x409e0b['role']!==_0xae3d('0x7d')){throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))](_0xae3d('0x87'));}}else{throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))]('Unauthorized');}return _0x409e0b;})[_0xae3d('0x19')](handleEntityNotFound(_0x15a746,null))[_0xae3d('0x19')](function(_0x44cfb7){return db[_0xae3d('0x95')][_0xae3d('0x96')]({'attributes':['id',_0xae3d('0x65'),_0xae3d('0x97'),_0xae3d('0x98')]})[_0xae3d('0x19')](function(_0x3933f6){if(_0x3933f6['securePassword'])authService['validatePasswordPattern'](_0xce0e1c[_0xae3d('0x5f')][_0xae3d('0x8e')]);if(!_0x3933f6[_0xae3d('0x97')]||!_0x44cfb7[_0xae3d('0x99')])return _0x44cfb7;authService['validatePasswordHistory'](_0xce0e1c[_0xae3d('0x5f')]['newPassword'],_0x44cfb7['previousPasswords'],_0x3933f6[_0xae3d('0x98')]);return _0x44cfb7;})[_0xae3d('0x19')](saveUpdates({'password':_0xce0e1c[_0xae3d('0x5f')][_0xae3d('0x8e')],'passwordResetAt':_0xce0e1c['user']['id']==_0xce0e1c[_0xae3d('0x54')]['id']?moment():null,'previousPasswords':authService[_0xae3d('0x9a')](_0xce0e1c[_0xae3d('0x5f')]['newPassword'],_0x44cfb7[_0xae3d('0x99')])},null));})[_0xae3d('0x19')](respondWithResult(_0x15a746,null))[_0xae3d('0x24')](handleError(_0x15a746,null));};exports['addQueues']=function(_0x4842d8,_0x235831){var _0x30c8c2=_0x4842d8['body'][_0xae3d('0x9b')];return db[_0xae3d('0x40')][_0xae3d('0x5d')]({'where':{'id':_0x4842d8[_0xae3d('0x54')]['id']},'attributes':['id','name','role','online',_0xae3d('0x9c'),_0xae3d('0x9d'),'interface']})[_0xae3d('0x19')](handleEntityNotFound(_0x235831,null))[_0xae3d('0x19')](function(_0x35b418){if(_0x35b418){if(!utils['isValidChannel'](_0x30c8c2)){throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))](_0xae3d('0x9e'));}return _0x35b418[_0xae3d('0x9f')+_[_0xae3d('0xa0')](_0x30c8c2[_0xae3d('0xa1')]())+_0xae3d('0xa2')](_0x4842d8['body'][_0xae3d('0x62')],{'penalty':_0x4842d8[_0xae3d('0x5f')][_0xae3d('0xa3')]||0x0})[_0xae3d('0xa4')](function(_0x31eb2b){for(var _0x1f1c1c=0x0;_0x1f1c1c<_0x4842d8[_0xae3d('0x5f')][_0xae3d('0x62')]['length'];_0x1f1c1c+=0x1){var _0x2c09c6={'UserId':Number(_0x4842d8[_0xae3d('0x54')]['id'])};_0x2c09c6[_['capitalize'](_0x30c8c2[_0xae3d('0xa1')]())+'QueueId']=Number(_0x4842d8['body']['ids'][_0x1f1c1c]);socket[_0xae3d('0xa5')](_0xae3d('0x35')+_[_0xae3d('0xa0')](_0x30c8c2[_0xae3d('0xa1')]())+'Queue:save',_0x2c09c6);}return _0x31eb2b;})['then'](function(){if(_0x30c8c2===_0xae3d('0xa6')){return db[_0xae3d('0xa7')]['findAll']({'where':{'id':_0x4842d8[_0xae3d('0x5f')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0xae3d('0x19')](function(_0x430f40){var _0x1cf7ca=_0x35b418[_0xae3d('0x32')]({'plain':!![]});var _0x5b6a92=[];if(_0x30c8c2===_0xae3d('0xa6')&&_0x1cf7ca[_0xae3d('0x30')]==='agent'&&_0x1cf7ca[_0xae3d('0xa8')]){for(let _0x478875=0x0;_0x478875<_0x430f40[_0xae3d('0x5b')];_0x478875+=0x1){_0x5b6a92['push']({'membername':_0x1cf7ca[_0xae3d('0x3c')],'UserId':_0x1cf7ca['id'],'queue_name':_0x430f40[_0x478875][_0xae3d('0x3c')],'VoiceQueueId':_0x430f40[_0x478875]['id'],'interface':_[_0xae3d('0x68')](_0x1cf7ca[_0xae3d('0xa9')])?util['format']('SIP/%s',_0x1cf7ca[_0xae3d('0x3c')]):_0x1cf7ca['interface'],'paused':_0x1cf7ca['voicePause']||![],'penalty':_0x4842d8[_0xae3d('0x5f')][_0xae3d('0xa3')]||0x0});}return Promise[_0xae3d('0x52')](_0x5b6a92[_0xae3d('0x39')](function(_0x8d7031){return db[_0xae3d('0xaa')][_0xae3d('0xab')](_0x8d7031);}));}return _0x35b418;});}})[_0xae3d('0x19')](respondWithStatusCode(_0x235831,null))['catch'](handleError(_0x235831,null));};exports[_0xae3d('0xac')]=function(_0x3cf26e,_0x3942ff){var _0x49e4c0,_0x28220d;return db[_0xae3d('0x40')]['find']({'where':{'id':_0x3cf26e[_0xae3d('0x54')]['id']},'attributes':['id',_0xae3d('0x3c'),_0xae3d('0x30')]})[_0xae3d('0x19')](handleEntityNotFound(_0x3942ff,null))[_0xae3d('0x19')](function(_0x2826b0){if(_0x2826b0){_0x49e4c0=_0x2826b0;if(!_0x3cf26e[_0xae3d('0x46')][_0xae3d('0x9b')]||!utils[_0xae3d('0xad')](_0x3cf26e[_0xae3d('0x46')]['channel'])){throw new db['Sequelize'][(_0xae3d('0x90'))](_0xae3d('0x9e'));}return _0x2826b0[_0xae3d('0xae')+_[_0xae3d('0xa0')](_0x3cf26e[_0xae3d('0x46')][_0xae3d('0x9b')]['toLowerCase']())+_0xae3d('0xa2')](_0x3cf26e['query'][_0xae3d('0x62')]);}})['then'](function(_0xb58ccf){if(_[_0xae3d('0xaf')](_0x3cf26e[_0xae3d('0x46')]['ids'])){for(var _0x2825e9=0x0;_0x2825e9<_0x3cf26e['query']['ids']['length'];_0x2825e9+=0x1){_0x28220d={'UserId':Number(_0x3cf26e[_0xae3d('0x54')]['id'])};_0x28220d[_[_0xae3d('0xa0')](_0x3cf26e[_0xae3d('0x46')]['channel'][_0xae3d('0xa1')]())+_0xae3d('0xb0')]=Number(_0x3cf26e[_0xae3d('0x46')][_0xae3d('0x62')][_0x2825e9]);socket[_0xae3d('0xa5')](_0xae3d('0x35')+_[_0xae3d('0xa0')](_0x3cf26e['query']['channel']['toLowerCase']())+_0xae3d('0xb1'),_0x28220d);}}else{_0x28220d={'UserId':Number(_0x3cf26e[_0xae3d('0x54')]['id'])};_0x28220d[_[_0xae3d('0xa0')](_0x3cf26e['query'][_0xae3d('0x9b')][_0xae3d('0xa1')]())+_0xae3d('0xb0')]=Number(_0x3cf26e[_0xae3d('0x46')][_0xae3d('0x62')]);socket[_0xae3d('0xa5')]('user'+_[_0xae3d('0xa0')](_0x3cf26e[_0xae3d('0x46')]['channel']['toLowerCase']())+_0xae3d('0xb1'),_0x28220d);}return _0xb58ccf;})[_0xae3d('0x19')](function(){if(_0x3cf26e['query']['channel']===_0xae3d('0xa6')){return db[_0xae3d('0xaa')][_0xae3d('0x31')]({'where':{'UserId':_0x3cf26e[_0xae3d('0x54')]['id'],'VoiceQueueId':_0x3cf26e['query']['ids']},'individualHooks':!![]})[_0xae3d('0x19')](function(){return _0x49e4c0;});}return _0x49e4c0;})[_0xae3d('0x19')](respondWithStatusCode(_0x3942ff,null))[_0xae3d('0x24')](handleError(_0x3942ff,null));};exports['addAvatar']=function(_0x3a71cc,_0x10faf7){_0x3a71cc[_0xae3d('0x5f')][_0xae3d('0xb2')]=_0x3a71cc['file'][_0xae3d('0xb3')];return db[_0xae3d('0x40')][_0xae3d('0x5d')]({'where':{'id':_0x3a71cc[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x10faf7,null))[_0xae3d('0x19')](saveUpdates(_0x3a71cc[_0xae3d('0x5f')],null))['then'](respondWithResult(_0x10faf7,null))[_0xae3d('0x24')](handleError(_0x10faf7,null));};exports[_0xae3d('0xb4')]=function(_0x244fd3,_0x34c90e){var _0x53945e=path[_0xae3d('0xb5')](config[_0xae3d('0xb6')],_0xae3d('0xb7'));return db[_0xae3d('0x40')][_0xae3d('0x5d')]({'where':{'id':_0x244fd3[_0xae3d('0x54')]['id']},'attributes':['id',_0xae3d('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x34c90e,null))[_0xae3d('0x19')](function(_0x503524){if(_0x503524){if(_['isNil'](_0x503524['userpic'])){return _0x34c90e[_0xae3d('0xb8')](_0x53945e);}else{if(!fs[_0xae3d('0xb9')](path[_0xae3d('0xb5')](config[_0xae3d('0xb6')],_0xae3d('0xba'),_0x503524[_0xae3d('0xb2')]))){return _0x34c90e['download'](_0x53945e);}return _0x34c90e['download'](path[_0xae3d('0xb5')](config[_0xae3d('0xb6')],_0xae3d('0xba'),_0x503524['userpic']));}}})[_0xae3d('0x24')](handleError(_0x34c90e,null));};exports[_0xae3d('0xbb')]=function(_0x8fa3c9,_0x15ea05){return db[_0xae3d('0x40')][_0xae3d('0x5d')]({'where':{'id':_0x8fa3c9[_0xae3d('0x54')]['id']},'attributes':['id']})[_0xae3d('0x19')](handleEntityNotFound(_0x15ea05,null))[_0xae3d('0x19')](function(_0x20974e){var _0x22ff07=[];values=_0x20974e[_0xae3d('0x4e')];_0x22ff07[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0xbc'),_0x20974e[_0xae3d('0x4e')]));_0x22ff07['push'](get_open_tabs(_0xae3d('0x4f'),_0x20974e['dataValues']));_0x22ff07[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x51'),_0x20974e[_0xae3d('0x4e')]));_0x22ff07[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0xbd'),_0x20974e[_0xae3d('0x4e')]));_0x22ff07[_0xae3d('0x4d')](get_open_tabs('fax',_0x20974e[_0xae3d('0x4e')]));_0x22ff07[_0xae3d('0x4d')](get_open_tabs(_0xae3d('0x5e'),_0x20974e['dataValues']));return Promise[_0xae3d('0x52')](_0x22ff07);})['then'](function(_0x9f34be){if(_0x9f34be){var _0x658386=_[_0xae3d('0x39')](values['ChatOpenTabs'],function(_0x22ff21){return{'channel':_0xae3d('0xbe'),'id':_0x22ff21['id'],'createdAt':_0x22ff21[_0xae3d('0xbf')]};});var _0x4c9936=_['map'](values[_0xae3d('0xc0')],function(_0x504340){return{'channel':'FAX','id':_0x504340['id'],'createdAt':_0x504340[_0xae3d('0xbf')]};});var _0x194fd4=_[_0xae3d('0x39')](values[_0xae3d('0xc1')],function(_0x2fbb90){return{'channel':'OPENCHANNEL','id':_0x2fbb90['id'],'createdAt':_0x2fbb90['createdAt']};});var _0x544262=_[_0xae3d('0x39')](values[_0xae3d('0xc2')],function(_0x4e5d82){return{'channel':_0xae3d('0xc3'),'id':_0x4e5d82['id'],'createdAt':_0x4e5d82[_0xae3d('0xbf')]};});var _0x130bc9=_[_0xae3d('0x39')](values[_0xae3d('0xc4')],function(_0x55a165){return{'channel':_0xae3d('0xc5'),'id':_0x55a165['id'],'createdAt':_0x55a165['createdAt']};});var _0x58f79a=_[_0xae3d('0x39')](values['WhatsappOpenTabs'],function(_0x7d6d2d){return{'channel':_0xae3d('0xc6'),'id':_0x7d6d2d['id'],'createdAt':_0x7d6d2d['createdAt']};});var _0x455c5d=_['concat'](_0x658386,_0x4c9936,_0x194fd4,_0x544262,_0x130bc9,_0x58f79a);var _0x261675={'count':_0x455c5d[_0xae3d('0x5b')],'rows':_0x455c5d};return _0x261675;}else return null;})['then'](respondWithResult(_0x15ea05,null))[_0xae3d('0x24')](handleError(_0x15ea05,null));};exports[_0xae3d('0xc7')]=function(_0x5d12c7,_0x48d759){var _0x1a8f2b={};return db['User'][_0xae3d('0x96')]({'where':{'id':_0x5d12c7[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](function(_0x43bb9c){if(!_0x43bb9c){throw new APINotFoundError(util[_0xae3d('0xc8')](_0xae3d('0xc9'),_0x5d12c7[_0xae3d('0x54')]['id']));}return contacts[_0xae3d('0x60')]();})['then'](function(_0x13e865){_0x5d12c7[_0xae3d('0x46')]['User']=_0x5d12c7[_0xae3d('0x54')]['id'];_0x1a8f2b=qs['getOptions'](_0x13e865,_0x5d12c7);if(_0x5d12c7[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0x45'))){_0x1a8f2b[_0xae3d('0x49')]=[{'model':db[_0xae3d('0xcb')],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xae3d('0x3c'),_0xae3d('0xcc')],'where':_0x5d12c7[_0xae3d('0x46')][_0xae3d('0xcd')]?{'id':_0x5d12c7[_0xae3d('0x46')][_0xae3d('0xcd')]}:undefined,'required':_0x5d12c7['query']['tag']?!![]:![]}];}return contacts['findAll'](_0x5d12c7[_0xae3d('0x46')],_0x5d12c7[_0xae3d('0x35')],_0x1a8f2b,_0x13e865);})[_0xae3d('0x19')](respondWithFilteredResult(_0x48d759,_0x1a8f2b))[_0xae3d('0x24')](APIHandleError(_0x48d759));};exports[_0xae3d('0xce')]=function(_0x599e9b,_0x202408){var _0x37aa5d;var _0x366ccc={};var _0x58c4e1;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x599e9b[_0xae3d('0x54')]['id']},'attributes':['id',_0xae3d('0x3c'),_0xae3d('0x30')]})['then'](handleEntityNotFound(_0x202408,null))['then'](function(_0xe32118){if(!utils[_0xae3d('0xad')](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x9b')])){throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))](_0xae3d('0x9e'));}_0x37aa5d=_0xe32118;var _0x137328={};_0x137328[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_[_0xae3d('0xa0')](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x9b')])+_0xae3d('0xcf')][_0xae3d('0x58')]);_0x137328[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x599e9b[_0xae3d('0x46')]);_0x137328['filters']=_[_0xae3d('0x59')](_0x137328['model'],_0x137328[_0xae3d('0x46')]);_0x366ccc[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x137328[_0xae3d('0x55')],qs['fields'](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x366ccc[_0xae3d('0x4a')]=_0x366ccc[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x366ccc[_0xae3d('0x4a')]:_0x137328[_0xae3d('0x55')];_0x366ccc[_0xae3d('0xd0')]=qs['sort'](_0x599e9b['query'][_0xae3d('0xd1')]);_0x366ccc[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0x599e9b[_0xae3d('0x46')],_0x137328['filters']));if(_0x599e9b[_0xae3d('0x46')]['filter']){_0x366ccc[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x366ccc['where'],{'$or':_['map'](_0x366ccc['attributes'],function(_0x4d1a5c){var _0x32e65c={};_0x32e65c[_0x4d1a5c]={'$like':'%'+_0x599e9b['query'][_0xae3d('0x38')]+'%'};return _0x32e65c;})});}_0x366ccc=_[_0xae3d('0x5c')]({},_0x366ccc,_0x599e9b[_0xae3d('0xd4')]);switch(_0x37aa5d[_0xae3d('0x30')]){case'admin':return db[_['capitalize'](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x9b')])+_0xae3d('0xcf')][_0xae3d('0x8b')](_0x366ccc);case _0xae3d('0x35'):case _0xae3d('0x7d'):return _0x37aa5d['get'+_[_0xae3d('0xa0')](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x9b')])+'Queues'](_0x366ccc);default:throw new db[(_0xae3d('0x8f'))]['ValidationError'](_0xae3d('0xd5'));}})['then'](function(_0x1b69bb){_0x58c4e1=_0x1b69bb[_0xae3d('0x5b')];if(!_0x599e9b[_0xae3d('0x46')][_0xae3d('0xca')]('nolimit')){_0x366ccc['limit']=qs[_0xae3d('0x2b')](_0x599e9b[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x366ccc[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x599e9b['query'][_0xae3d('0x29')]);}switch(_0x37aa5d['role']){case _0xae3d('0x33'):return db[_[_0xae3d('0xa0')](_0x599e9b[_0xae3d('0x46')]['channel'])+_0xae3d('0xcf')][_0xae3d('0x8b')](_0x366ccc);case'user':case _0xae3d('0x7d'):return _0x37aa5d[_0xae3d('0x32')+_['capitalize'](_0x599e9b['query'][_0xae3d('0x9b')])+'Queues'](_0x366ccc);}})[_0xae3d('0x19')](function(_0x4c5913){return{'count':_0x58c4e1,'rows':_0x4c5913};})[_0xae3d('0x19')](respondWithResult(_0x202408,null))['catch'](handleError(_0x202408,null));};exports['getVoiceQueuesRt']=function(_0x6b81b4,_0x42670a){var _0x2bdb9c={};var _0x4b5896={};var _0x3406b9;var _0x52435a;return db['User'][_0xae3d('0x96')]({'where':{'id':_0x6b81b4['params']['id']}})['then'](handleEntityNotFound(_0x42670a,null))['then'](function(_0x137dbb){if(_0x137dbb){_0x3406b9=_0x137dbb;_0x4b5896[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0xaa')][_0xae3d('0x58')]);_0x4b5896['query']=_[_0xae3d('0x57')](_0x6b81b4['query']);_0x4b5896[_0xae3d('0xd3')]=_['intersection'](_0x4b5896['model'],_0x4b5896['query']);_0x2bdb9c[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x4b5896[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x6b81b4[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x2bdb9c[_0xae3d('0x4a')]=_0x2bdb9c[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x2bdb9c[_0xae3d('0x4a')]:_0x4b5896[_0xae3d('0x55')];_0x2bdb9c[_0xae3d('0xd0')]=qs['sort'](_0x6b81b4['query'][_0xae3d('0xd1')]);_0x2bdb9c[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_[_0xae3d('0xd6')](_0x6b81b4[_0xae3d('0x46')],_0x4b5896[_0xae3d('0xd3')]));if(_0x6b81b4[_0xae3d('0x46')][_0xae3d('0x38')]){_0x2bdb9c[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x2bdb9c[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0x2bdb9c[_0xae3d('0x4a')],function(_0xa38f4b){var _0x5d8275={};_0x5d8275[_0xa38f4b]={'$like':'%'+_0x6b81b4[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x5d8275;})});}_0x2bdb9c=_['merge']({},_0x2bdb9c,_0x6b81b4[_0xae3d('0xd4')]);return _0x3406b9[_0xae3d('0xd7')](_0x2bdb9c);}})[_0xae3d('0x19')](function(_0x43e030){if(_0x43e030){_0x52435a=_0x43e030['length'];if(!_0x6b81b4[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x2bdb9c[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x6b81b4[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x2bdb9c[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x6b81b4[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x3406b9[_0xae3d('0xd7')](_0x2bdb9c);}})[_0xae3d('0x19')](function(_0x3cfa32){if(_0x3cfa32){return _0x3cfa32?{'count':_0x52435a,'rows':_0x3cfa32}:null;}})[_0xae3d('0x19')](respondWithResult(_0x42670a,null))[_0xae3d('0x24')](handleError(_0x42670a,null));};exports[_0xae3d('0xd9')]=function(_0x51145e,_0x4eddf0){var _0x2d8e07={};var _0x307d5e={};var _0x23dea6;var _0x201984;return db['User'][_0xae3d('0x96')]({'where':{'id':_0x51145e['params']['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x4eddf0,null))['then'](function(_0x2c9c73){if(_0x2c9c73){_0x23dea6=_0x2c9c73;_0x307d5e[_0xae3d('0x55')]=_['keys'](db[_0xae3d('0xda')][_0xae3d('0x58')]);_0x307d5e[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x51145e[_0xae3d('0x46')]);_0x307d5e[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x307d5e[_0xae3d('0x55')],_0x307d5e['query']);_0x2d8e07['attributes']=_[_0xae3d('0x59')](_0x307d5e[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x51145e[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x2d8e07[_0xae3d('0x4a')]=_0x2d8e07[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x2d8e07[_0xae3d('0x4a')]:_0x307d5e[_0xae3d('0x55')];_0x2d8e07[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x51145e[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x2d8e07['where']=qs['filters'](_[_0xae3d('0xd6')](_0x51145e[_0xae3d('0x46')],_0x307d5e[_0xae3d('0xd3')]));if(_0x51145e[_0xae3d('0x46')][_0xae3d('0x38')]){_0x2d8e07[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x2d8e07['where'],{'$or':_[_0xae3d('0x39')](_0x2d8e07['attributes'],function(_0x47e5c1){var _0x58bb34={};_0x58bb34[_0x47e5c1]={'$like':'%'+_0x51145e[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x58bb34;})});}_0x2d8e07=_[_0xae3d('0x5c')]({},_0x2d8e07,_0x51145e[_0xae3d('0xd4')]);return _0x23dea6[_0xae3d('0xd9')](_0x2d8e07);}})[_0xae3d('0x19')](function(_0x6c5043){if(_0x6c5043){_0x201984=_0x6c5043[_0xae3d('0x5b')];if(!_0x51145e[_0xae3d('0x46')][_0xae3d('0xca')]('nolimit')){_0x2d8e07[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x51145e[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x2d8e07[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x51145e[_0xae3d('0x46')]['offset']);}return _0x23dea6[_0xae3d('0xd9')](_0x2d8e07);}})[_0xae3d('0x19')](function(_0x3ecc00){if(_0x3ecc00){return _0x3ecc00?{'count':_0x201984,'rows':_0x3ecc00}:null;}})[_0xae3d('0x19')](respondWithResult(_0x4eddf0,null))['catch'](handleError(_0x4eddf0,null));};exports['getRecordings']=function(_0x3ee2cd,_0x2d3531){var _0x53529d={'raw':!![],'where':{}};var _0x4625a3={};var _0x3f8f19={'count':0x0,'rows':[]};return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x3ee2cd[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x2d3531,null))[_0xae3d('0x19')](function(_0x361d9e){if(_0x361d9e){_0x4625a3['model']=_[_0xae3d('0x57')](db[_0xae3d('0xdb')][_0xae3d('0x58')]);_0x4625a3[_0xae3d('0x46')]=_['keys'](_0x3ee2cd[_0xae3d('0x46')]);_0x4625a3[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x4625a3['model'],_0x4625a3['query']);_0x53529d[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x4625a3[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x3ee2cd[_0xae3d('0x46')]['fields']));_0x53529d[_0xae3d('0x4a')]=_0x53529d[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x53529d['attributes']:_0x4625a3[_0xae3d('0x55')];if(!_0x3ee2cd[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x53529d['limit']=qs[_0xae3d('0x2b')](_0x3ee2cd[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x53529d[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x3ee2cd['query'][_0xae3d('0x29')]);}_0x53529d['order']=qs[_0xae3d('0xd1')](_0x3ee2cd['query']['sort']);_0x53529d['where']=qs['filters'](_[_0xae3d('0xd6')](_0x3ee2cd[_0xae3d('0x46')],_0x4625a3['filters']));_0x53529d[_0xae3d('0xd2')]['UserId']=_0x361d9e['id'];if(_0x3ee2cd[_0xae3d('0x46')][_0xae3d('0x38')]){_0x53529d['where']=_['merge'](_0x53529d[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0x53529d[_0xae3d('0x4a')],function(_0x191c4c){var _0x4a5066={};_0x4a5066[_0x191c4c]={'$like':'%'+_0x3ee2cd['query'][_0xae3d('0x38')]+'%'};return _0x4a5066;})});}_0x53529d=_[_0xae3d('0x5c')]({},_0x53529d,_0x3ee2cd['options']);return db[_0xae3d('0xdb')]['count']({'where':_0x53529d[_0xae3d('0xd2')]})[_0xae3d('0x19')](function(_0x1f835f){_0x3f8f19[_0xae3d('0x2c')]=_0x1f835f;if(_0x3ee2cd[_0xae3d('0x46')][_0xae3d('0x45')]){_0x53529d[_0xae3d('0x49')]=[{'all':!![]}];}return db[_0xae3d('0xdb')][_0xae3d('0x8b')](_0x53529d);})[_0xae3d('0x19')](function(_0x1895f1){_0x3f8f19[_0xae3d('0x4b')]=_0x1895f1;return _0x3f8f19;});}})[_0xae3d('0x19')](respondWithFilteredResult(_0x2d3531,_0x53529d))[_0xae3d('0x24')](handleError(_0x2d3531,null));};exports[_0xae3d('0xdc')]=function(_0xbaa09d,_0x25156f){var _0x36ff79={'raw':!![],'where':{}};var _0x54f128={};var _0x555766={'count':0x0,'rows':[]};return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0xbaa09d[_0xae3d('0x54')]['id']}})['then'](handleEntityNotFound(_0x25156f,null))['then'](function(_0xf26482){if(_0xf26482){_0x54f128[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0xdd')][_0xae3d('0x58')]);_0x54f128[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0xbaa09d['query']);_0x54f128[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x54f128[_0xae3d('0x55')],_0x54f128[_0xae3d('0x46')]);_0x36ff79[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x54f128[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0xbaa09d[_0xae3d('0x46')]['fields']));_0x36ff79[_0xae3d('0x4a')]=_0x36ff79[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x36ff79['attributes']:_0x54f128['model'];if(!_0xbaa09d[_0xae3d('0x46')][_0xae3d('0xca')]('nolimit')){_0x36ff79[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0xbaa09d[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x36ff79['offset']=qs[_0xae3d('0x29')](_0xbaa09d['query'][_0xae3d('0x29')]);}_0x36ff79[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0xbaa09d[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x36ff79[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0xbaa09d[_0xae3d('0x46')],_0x54f128[_0xae3d('0xd3')]));_0x36ff79[_0xae3d('0xd2')][_0xae3d('0xde')]=_0xf26482['id'];if(_0xbaa09d[_0xae3d('0x46')][_0xae3d('0x38')]){_0x36ff79[_0xae3d('0xd2')]=_['merge'](_0x36ff79[_0xae3d('0xd2')],{'$or':_['map'](_0x36ff79[_0xae3d('0x4a')],function(_0x5bca26){var _0x4e2782={};_0x4e2782[_0x5bca26]={'$like':'%'+_0xbaa09d[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x4e2782;})});}_0x36ff79=_[_0xae3d('0x5c')]({},_0x36ff79,_0xbaa09d['options']);return db[_0xae3d('0xdd')][_0xae3d('0x2c')]({'where':_0x36ff79[_0xae3d('0xd2')]})[_0xae3d('0x19')](function(_0x4d1f46){_0x555766[_0xae3d('0x2c')]=_0x4d1f46;if(_0xbaa09d[_0xae3d('0x46')][_0xae3d('0x45')]){_0x36ff79[_0xae3d('0x49')]=[{'all':!![]}];}return db[_0xae3d('0xdd')][_0xae3d('0x8b')](_0x36ff79);})['then'](function(_0xcfa9a6){_0x555766[_0xae3d('0x4b')]=_0xcfa9a6;return _0x555766;});}})[_0xae3d('0x19')](respondWithFilteredResult(_0x25156f,_0x36ff79))[_0xae3d('0x24')](handleError(_0x25156f,null));};exports[_0xae3d('0xdf')]=function(_0x35512d,_0x1d8335){var _0x18b044={};var _0x4ef407={};var _0x2b0cbc;var _0x3af90c;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x35512d[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x1d8335,null))[_0xae3d('0x19')](function(_0x284ffd){if(_0x284ffd){_0x2b0cbc=_0x284ffd;_0x4ef407['model']=_['keys'](db['ChatInteraction'][_0xae3d('0x58')]);_0x4ef407['query']=_[_0xae3d('0x57')](_0x35512d[_0xae3d('0x46')]);_0x4ef407['filters']=_[_0xae3d('0x59')](_0x4ef407[_0xae3d('0x55')],_0x4ef407[_0xae3d('0x46')]);_0x18b044[_0xae3d('0x4a')]=_['intersection'](_0x4ef407['model'],qs[_0xae3d('0x5a')](_0x35512d[_0xae3d('0x46')]['fields']));_0x18b044['attributes']=_0x18b044['attributes'][_0xae3d('0x5b')]?_0x18b044[_0xae3d('0x4a')]:_0x4ef407[_0xae3d('0x55')];_0x18b044[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x35512d[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x18b044[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0x35512d[_0xae3d('0x46')],_0x4ef407[_0xae3d('0xd3')]));if(_0x35512d['query']['filter']){_0x18b044[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x18b044[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0x18b044[_0xae3d('0x4a')],function(_0x4db76a){var _0x4398e2={};_0x4398e2[_0x4db76a]={'$like':'%'+_0x35512d['query'][_0xae3d('0x38')]+'%'};return _0x4398e2;})});}_0x18b044=_['merge']({},_0x18b044,_0x35512d[_0xae3d('0xd4')]);return _0x2b0cbc[_0xae3d('0xdf')](_0x18b044);}})[_0xae3d('0x19')](function(_0x11beb5){if(_0x11beb5){_0x3af90c=_0x11beb5[_0xae3d('0x5b')];if(!_0x35512d['query'][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x18b044[_0xae3d('0x2b')]=qs['limit'](_0x35512d['query'][_0xae3d('0x2b')]);_0x18b044[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x35512d[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x2b0cbc['getChatInteractions'](_0x18b044);}})[_0xae3d('0x19')](function(_0x5b4436){if(_0x5b4436){return _0x5b4436?{'count':_0x3af90c,'rows':_0x5b4436}:null;}})[_0xae3d('0x19')](respondWithResult(_0x1d8335,null))[_0xae3d('0x24')](handleError(_0x1d8335,null));};exports[_0xae3d('0xe0')]=function(_0x3c946c,_0x3f51af){var _0x1f6365={};var _0x270f65={};var _0x32b8f5;var _0x52cada;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x3c946c[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x3f51af,null))[_0xae3d('0x19')](function(_0x2b1fde){if(_0x2b1fde){_0x32b8f5=_0x2b1fde;_0x270f65['model']=_[_0xae3d('0x57')](db[_0xae3d('0xe1')][_0xae3d('0x58')]);_0x270f65[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x3c946c['query']);_0x270f65[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x270f65['model'],_0x270f65[_0xae3d('0x46')]);_0x1f6365[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x270f65[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x3c946c[_0xae3d('0x46')]['fields']));_0x1f6365['attributes']=_0x1f6365[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x1f6365[_0xae3d('0x4a')]:_0x270f65['model'];_0x1f6365['order']=qs[_0xae3d('0xd1')](_0x3c946c[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x1f6365[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_[_0xae3d('0xd6')](_0x3c946c[_0xae3d('0x46')],_0x270f65[_0xae3d('0xd3')]));if(_0x3c946c[_0xae3d('0x46')][_0xae3d('0x38')]){_0x1f6365[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x1f6365[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0x1f6365[_0xae3d('0x4a')],function(_0x1df4e4){var _0x580ef8={};_0x580ef8[_0x1df4e4]={'$like':'%'+_0x3c946c['query'][_0xae3d('0x38')]+'%'};return _0x580ef8;})});}_0x1f6365=_[_0xae3d('0x5c')]({},_0x1f6365,_0x3c946c[_0xae3d('0xd4')]);return _0x32b8f5[_0xae3d('0xe0')](_0x1f6365);}})[_0xae3d('0x19')](function(_0x1772f2){if(_0x1772f2){_0x52cada=_0x1772f2['length'];if(!_0x3c946c[_0xae3d('0x46')]['hasOwnProperty'](_0xae3d('0xd8'))){_0x1f6365['limit']=qs[_0xae3d('0x2b')](_0x3c946c['query'][_0xae3d('0x2b')]);_0x1f6365[_0xae3d('0x29')]=qs['offset'](_0x3c946c['query']['offset']);}return _0x32b8f5['getOpenchannelInteractions'](_0x1f6365);}})['then'](function(_0x1e8a48){if(_0x1e8a48){return _0x1e8a48?{'count':_0x52cada,'rows':_0x1e8a48}:null;}})[_0xae3d('0x19')](respondWithResult(_0x3f51af,null))[_0xae3d('0x24')](handleError(_0x3f51af,null));};exports[_0xae3d('0xe2')]=function(_0x3e9f5e,_0x7c302){var _0x1116fa={'raw':!![],'where':{}};var _0x15093a={};var _0x33352e={'count':0x0,'rows':[]};return db['User'][_0xae3d('0x96')]({'where':{'id':_0x3e9f5e['params']['id']}})['then'](handleEntityNotFound(_0x7c302,null))['then'](function(_0x8bbf91){if(_0x8bbf91){_0x15093a['model']=_[_0xae3d('0x57')](db[_0xae3d('0xe3')][_0xae3d('0x58')]);_0x15093a[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x3e9f5e[_0xae3d('0x46')]);_0x15093a['filters']=_['intersection'](_0x15093a[_0xae3d('0x55')],_0x15093a[_0xae3d('0x46')]);_0x1116fa[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x15093a['model'],qs['fields'](_0x3e9f5e[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x1116fa[_0xae3d('0x4a')]=_0x1116fa['attributes'][_0xae3d('0x5b')]?_0x1116fa[_0xae3d('0x4a')]:_0x15093a[_0xae3d('0x55')];if(!_0x3e9f5e['query']['hasOwnProperty'](_0xae3d('0xd8'))){_0x1116fa['limit']=qs[_0xae3d('0x2b')](_0x3e9f5e[_0xae3d('0x46')]['limit']);_0x1116fa[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x3e9f5e[_0xae3d('0x46')]['offset']);}_0x1116fa[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x3e9f5e[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x1116fa[_0xae3d('0xd2')]=qs['filters'](_[_0xae3d('0xd6')](_0x3e9f5e[_0xae3d('0x46')],_0x15093a[_0xae3d('0xd3')]));_0x1116fa[_0xae3d('0xd2')]['UserId']=_0x8bbf91['id'];if(_0x3e9f5e[_0xae3d('0x46')][_0xae3d('0x38')]){_0x1116fa[_0xae3d('0xd2')]=_['merge'](_0x1116fa['where'],{'$or':_[_0xae3d('0x39')](_0x1116fa[_0xae3d('0x4a')],function(_0xd14b41){var _0x46cf22={};_0x46cf22[_0xd14b41]={'$like':'%'+_0x3e9f5e[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x46cf22;})});}_0x1116fa=_[_0xae3d('0x5c')]({},_0x1116fa,_0x3e9f5e[_0xae3d('0xd4')]);return db[_0xae3d('0xe3')][_0xae3d('0x2c')]({'where':_0x1116fa[_0xae3d('0xd2')]})['then'](function(_0x39ba4d){_0x33352e['count']=_0x39ba4d;if(_0x3e9f5e[_0xae3d('0x46')]['includeAll']){_0x1116fa[_0xae3d('0x49')]=[{'all':!![]}];}return db[_0xae3d('0xe3')]['findAll'](_0x1116fa);})[_0xae3d('0x19')](function(_0x31d8c7){_0x33352e['rows']=_0x31d8c7;return _0x33352e;});}})[_0xae3d('0x19')](respondWithFilteredResult(_0x7c302,_0x1116fa))[_0xae3d('0x24')](handleError(_0x7c302,null));};exports[_0xae3d('0xe4')]=function(_0x5918e8,_0x4cf329){var _0x3b8b32={};var _0x2f9ffe={};var _0xa741b3;var _0x461e36;return db[_0xae3d('0x40')]['findOne']({'where':{'id':_0x5918e8['params']['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x4cf329,null))[_0xae3d('0x19')](function(_0x1592f2){if(_0x1592f2){_0xa741b3=_0x1592f2;_0x2f9ffe[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0xe5')][_0xae3d('0x58')]);_0x2f9ffe[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x5918e8[_0xae3d('0x46')]);_0x2f9ffe[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x2f9ffe[_0xae3d('0x55')],_0x2f9ffe['query']);_0x3b8b32['attributes']=_[_0xae3d('0x59')](_0x2f9ffe[_0xae3d('0x55')],qs['fields'](_0x5918e8[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x3b8b32[_0xae3d('0x4a')]=_0x3b8b32[_0xae3d('0x4a')]['length']?_0x3b8b32[_0xae3d('0x4a')]:_0x2f9ffe[_0xae3d('0x55')];_0x3b8b32[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x5918e8[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x3b8b32[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_[_0xae3d('0xd6')](_0x5918e8[_0xae3d('0x46')],_0x2f9ffe[_0xae3d('0xd3')]));if(_0x5918e8['query']['filter']){_0x3b8b32['where']=_[_0xae3d('0x5c')](_0x3b8b32[_0xae3d('0xd2')],{'$or':_['map'](_0x3b8b32['attributes'],function(_0x49645b){var _0x54e7d6={};_0x54e7d6[_0x49645b]={'$like':'%'+_0x5918e8['query'][_0xae3d('0x38')]+'%'};return _0x54e7d6;})});}_0x3b8b32=_[_0xae3d('0x5c')]({},_0x3b8b32,_0x5918e8[_0xae3d('0xd4')]);return _0xa741b3[_0xae3d('0xe4')](_0x3b8b32);}})[_0xae3d('0x19')](function(_0x5ee6ac){if(_0x5ee6ac){_0x461e36=_0x5ee6ac[_0xae3d('0x5b')];if(!_0x5918e8[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x3b8b32[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x5918e8[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x3b8b32[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x5918e8[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0xa741b3[_0xae3d('0xe4')](_0x3b8b32);}})[_0xae3d('0x19')](function(_0x39f67f){if(_0x39f67f){return _0x39f67f?{'count':_0x461e36,'rows':_0x39f67f}:null;}})[_0xae3d('0x19')](respondWithResult(_0x4cf329,null))['catch'](handleError(_0x4cf329,null));};exports[_0xae3d('0xe6')]=function(_0x22ecdc,_0x2934ba){var _0xa9c3dc={};var _0x5c129c={};var _0x204879;var _0xb7511e;return db['User'][_0xae3d('0x96')]({'where':{'id':_0x22ecdc[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x2934ba,null))[_0xae3d('0x19')](function(_0x1da81d){if(_0x1da81d){_0x204879=_0x1da81d;_0x5c129c['model']=_[_0xae3d('0x57')](db[_0xae3d('0xe7')][_0xae3d('0x58')]);_0x5c129c['query']=_[_0xae3d('0x57')](_0x22ecdc[_0xae3d('0x46')]);_0x5c129c[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x5c129c[_0xae3d('0x55')],_0x5c129c['query']);_0xa9c3dc['attributes']=_[_0xae3d('0x59')](_0x5c129c[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x22ecdc[_0xae3d('0x46')]['fields']));_0xa9c3dc[_0xae3d('0x4a')]=_0xa9c3dc[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0xa9c3dc[_0xae3d('0x4a')]:_0x5c129c[_0xae3d('0x55')];_0xa9c3dc[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x22ecdc[_0xae3d('0x46')]['sort']);_0xa9c3dc[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0x22ecdc[_0xae3d('0x46')],_0x5c129c[_0xae3d('0xd3')]));if(_0x22ecdc[_0xae3d('0x46')][_0xae3d('0x38')]){_0xa9c3dc[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0xa9c3dc[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0xa9c3dc['attributes'],function(_0x283ee2){var _0x1ad452={};_0x1ad452[_0x283ee2]={'$like':'%'+_0x22ecdc[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x1ad452;})});}_0xa9c3dc=_[_0xae3d('0x5c')]({},_0xa9c3dc,_0x22ecdc[_0xae3d('0xd4')]);return _0x204879[_0xae3d('0xe6')](_0xa9c3dc);}})[_0xae3d('0x19')](function(_0x30e3e8){if(_0x30e3e8){_0xb7511e=_0x30e3e8['length'];if(!_0x22ecdc['query']['hasOwnProperty'](_0xae3d('0xd8'))){_0xa9c3dc[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x22ecdc[_0xae3d('0x46')][_0xae3d('0x2b')]);_0xa9c3dc['offset']=qs[_0xae3d('0x29')](_0x22ecdc[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x204879[_0xae3d('0xe6')](_0xa9c3dc);}})[_0xae3d('0x19')](function(_0x3d33dc){if(_0x3d33dc){return _0x3d33dc?{'count':_0xb7511e,'rows':_0x3d33dc}:null;}})['then'](respondWithResult(_0x2934ba,null))[_0xae3d('0x24')](handleError(_0x2934ba,null));};exports[_0xae3d('0xe8')]=function(_0x1f167f,_0x15f524){var _0x590845={};var _0x406e9d={};var _0x454fac;var _0x1f345a;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x1f167f[_0xae3d('0x54')]['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x15f524,null))[_0xae3d('0x19')](function(_0x5c9798){if(_0x5c9798){_0x454fac=_0x5c9798;_0x406e9d[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0xe9')][_0xae3d('0x58')]);_0x406e9d[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x1f167f[_0xae3d('0x46')]);_0x406e9d[_0xae3d('0xd3')]=_['intersection'](_0x406e9d[_0xae3d('0x55')],_0x406e9d['query']);_0x590845[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x406e9d[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x1f167f['query'][_0xae3d('0x5a')]));_0x590845[_0xae3d('0x4a')]=_0x590845[_0xae3d('0x4a')]['length']?_0x590845['attributes']:_0x406e9d['model'];_0x590845[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x1f167f[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x590845[_0xae3d('0xd2')]=qs['filters'](_[_0xae3d('0xd6')](_0x1f167f['query'],_0x406e9d[_0xae3d('0xd3')]));if(_0x1f167f[_0xae3d('0x46')][_0xae3d('0x38')]){_0x590845[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x590845[_0xae3d('0xd2')],{'$or':_['map'](_0x590845[_0xae3d('0x4a')],function(_0x4e8ee1){var _0x553342={};_0x553342[_0x4e8ee1]={'$like':'%'+_0x1f167f['query'][_0xae3d('0x38')]+'%'};return _0x553342;})});}_0x590845=_[_0xae3d('0x5c')]({},_0x590845,_0x1f167f[_0xae3d('0xd4')]);return _0x454fac[_0xae3d('0xe8')](_0x590845);}})[_0xae3d('0x19')](function(_0x42c5d8){if(_0x42c5d8){_0x1f345a=_0x42c5d8[_0xae3d('0x5b')];if(!_0x1f167f[_0xae3d('0x46')]['hasOwnProperty']('nolimit')){_0x590845[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x1f167f[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x590845[_0xae3d('0x29')]=qs['offset'](_0x1f167f[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x454fac[_0xae3d('0xe8')](_0x590845);}})[_0xae3d('0x19')](function(_0x47bfb2){if(_0x47bfb2){return _0x47bfb2?{'count':_0x1f345a,'rows':_0x47bfb2}:null;}})[_0xae3d('0x19')](respondWithResult(_0x15f524,null))[_0xae3d('0x24')](handleError(_0x15f524,null));};exports['login']=function(_0x54e412,_0x121250,_0x3ee5b5){var _0x2ca1e0;var _0x27786f;var _0x577c37;var _0x42ee2d=!_['isNil'](_0x54e412[_0xae3d('0x54')]['id'])?_0x54e412[_0xae3d('0x54')]['id']:!_[_0xae3d('0x68')](_0x54e412[_0xae3d('0x35')]['id'])?_0x54e412[_0xae3d('0x35')]['id']:null;return db['User'][_0xae3d('0x5d')]({'where':{'id':_0x42ee2d,'role':{'$or':[_0xae3d('0x33'),'user',_0xae3d('0x7d')]}},'attributes':['id',_0xae3d('0x3c'),_0xae3d('0xea'),_0xae3d('0xeb'),_0xae3d('0x30'),_0xae3d('0x64'),_0xae3d('0x9c')]})[_0xae3d('0x19')](function(_0x41793c){if(_0x41793c){if(_0x41793c[_0xae3d('0x30')]===_0xae3d('0x7d')){_0x2ca1e0=_0x41793c;if(_0x54e412[_0xae3d('0x5f')]['interface']){_0x577c37=util[_0xae3d('0xc8')](_0xae3d('0xec'),_0x2ca1e0[_0x54e412['body'][_0xae3d('0xa9')]]);}else if(_0x54e412[_0xae3d('0x5f')][_0xae3d('0xed')]){_0x577c37=util[_0xae3d('0xc8')](_0xae3d('0xee'),_0x54e412[_0xae3d('0x5f')][_0xae3d('0xed')]);}else{_0x577c37=util[_0xae3d('0xc8')](_0xae3d('0xee'),_0x2ca1e0[_0xae3d('0x3c')]);}socket['to'](util[_0xae3d('0xc8')](_0xae3d('0xef'),_0x2ca1e0[_0xae3d('0x3c')]))[_0xae3d('0xa5')](_0xae3d('0xf0'),{'user':{'id':_0x2ca1e0['id'],'name':_0x2ca1e0[_0xae3d('0x3c')]},'ip':_0x54e412[_0xae3d('0xf1')][_0xae3d('0xf2')]||_0x54e412['connection'][_0xae3d('0xf3')]||_0x54e412[_0xae3d('0xf4')][_0xae3d('0xf3')]||_0x54e412[_0xae3d('0xf5')]['socket'][_0xae3d('0xf3')]});return db['UserVoiceQueueRt'][_0xae3d('0x31')]({'where':{'membername':_0x2ca1e0[_0xae3d('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0xae3d('0x8f'))][(_0xae3d('0x90'))](_0xae3d('0xf6'));}})['then'](function(){if(_0x2ca1e0){return _0x2ca1e0[_0xae3d('0xf7')]({'raw':!![]});}})[_0xae3d('0x19')](function(_0xd4f7db){if(_0x2ca1e0){if(_0xd4f7db){_0x27786f=_0xd4f7db;if(_0x27786f[_0xae3d('0x5b')]){var _0xecef9f=_0x27786f['map'](function(_0x32a2c5){var _0x866163={'membername':_0x2ca1e0['name'],'UserId':_0x2ca1e0['id'],'queue_name':_0x32a2c5[_0xae3d('0x3c')],'VoiceQueueId':_0x32a2c5['id'],'interface':_0x577c37,'paused':_0x2ca1e0[_0xae3d('0x9c')]||![],'penalty':_0x32a2c5[_0xae3d('0xf8')]||0x0};return db[_0xae3d('0xaa')][_0xae3d('0xab')](_0x866163);});return Promise[_0xae3d('0x52')](_0xecef9f);}}}})[_0xae3d('0x19')](function(){if(_0x2ca1e0){return db[_0xae3d('0xf9')][_0xae3d('0x8b')]({'where':{'membername':_0x2ca1e0[_0xae3d('0x3c')],'exitAt':null}});}})[_0xae3d('0x19')](function(_0x85a7f9){if(_0x2ca1e0){var _0x54bf98=[];_0x85a7f9[_0xae3d('0xfa')](function(_0x58aeac){_0x54bf98[_0xae3d('0x4d')](_0x58aeac[_0xae3d('0x2f')]({'exitAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb'))}));});return Promise[_0xae3d('0x52')](_0x54bf98);}})[_0xae3d('0x19')](function(){if(_0x2ca1e0){var _0x1545e9=[];var _0xdd79d1=[];var _0x8b8933=utils[_0xae3d('0xfc')]();var _0x2a0e89={'membername':_0x2ca1e0[_0xae3d('0x3c')],'interface':_0x577c37,'enterAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb')),'role':_0x2ca1e0[_0xae3d('0x30')],'internal':_0x2ca1e0[_0xae3d('0x64')]};_0x8b8933['forEach'](function(_0x2726f1){_0x1545e9[_0xae3d('0x4d')](_[_0xae3d('0x5c')]({'channel':_0x2726f1,'type':'LOGIN','data1':_0x54e412[_0xae3d('0x5f')][_0xae3d('0xfd')],'data2':_0x577c37},_0x2a0e89));if(_0x2ca1e0[_0xae3d('0x9c')]){_0xdd79d1[_0xae3d('0x4d')](_[_0xae3d('0x5c')]({'channel':_0x2726f1,'type':_0xae3d('0xfe'),'data1':'LOGININPAUSE'},_0x2a0e89));}});return db[_0xae3d('0xf9')]['bulkCreate'](_0x1545e9[_0xae3d('0xff')](_0xdd79d1),{'individualHooks':!![]});}})[_0xae3d('0x19')](function(){if(_0x2ca1e0){return _0x2ca1e0[_0xae3d('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xae3d('0xc8')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2ca1e0['loginInPause']||![],'mailPause':_0x2ca1e0[_0xae3d('0x9c')]||![],'chatPause':_0x2ca1e0[_0xae3d('0x9c')]||![],'faxPause':_0x2ca1e0[_0xae3d('0x9c')]||![],'smsPause':_0x2ca1e0[_0xae3d('0x9c')]||![],'openchannelPause':_0x2ca1e0['loginInPause']||![],'whatsappPause':_0x2ca1e0[_0xae3d('0x9c')]||![],'pauseType':_0x2ca1e0['loginInPause']?'LOGININPAUSE':null,'interface':_0x577c37,'lastPauseAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb'))});}})[_0xae3d('0x19')](function(_0x40fb38){if(_0x54e412[_0xae3d('0x100')]){return _0x3ee5b5();}else{return Promise[_0xae3d('0x101')](_0x40fb38)[_0xae3d('0x19')](respondWithResult(_0x121250,null));}})[_0xae3d('0x24')](handleError(_0x121250,null));};exports[_0xae3d('0x102')]=function(_0x3acbc1,_0x23dbcd){var _0x3b028e;return db[_0xae3d('0x40')]['find']({'where':{'id':_0x3acbc1['params']['id'],'role':_0xae3d('0x7d')},'attributes':['id',_0xae3d('0x3c'),_0xae3d('0x30')]})[_0xae3d('0x19')](handleEntityNotFound(_0x23dbcd,null))[_0xae3d('0x19')](function(_0x514c1a){if(_0x514c1a){_0x3b028e=_0x514c1a;return db[_0xae3d('0xaa')][_0xae3d('0x31')]({'where':{'membername':_0x3b028e['name']},'individualHooks':!![]});}})[_0xae3d('0x19')](function(){return db[_0xae3d('0xf9')][_0xae3d('0x8b')]({'where':{'membername':_0x3b028e[_0xae3d('0x3c')],'exitAt':null}});})['then'](function(_0x5d39d4){var _0x321e82=[];_0x5d39d4['forEach'](function(_0x32d766){_0x321e82[_0xae3d('0x4d')](_0x32d766['update']({'exitAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb'))}));});return Promise[_0xae3d('0x52')](_0x321e82);})[_0xae3d('0x19')](function(){return _0x3b028e[_0xae3d('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x23dbcd,null))['catch'](handleError(_0x23dbcd,null));};exports[_0xae3d('0x103')]=function(_0x625e0a,_0x3516cc){var _0x5b0a23;return db[_0xae3d('0xaa')][_0xae3d('0x2f')]({'paused':0x1},{'where':{'UserId':_0x625e0a[_0xae3d('0x54')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xae3d('0x40')]['find']({'where':{'id':_0x625e0a[_0xae3d('0x54')]['id'],'role':_0xae3d('0x7d')},'attributes':['id',_0xae3d('0x3c'),'role',_0xae3d('0x64'),_0xae3d('0xa9'),_0xae3d('0xa8')]});})[_0xae3d('0x19')](handleEntityNotFound(_0x3516cc,null))[_0xae3d('0x19')](function(_0x1ebd17){if(_0x1ebd17){_0x5b0a23=_0x1ebd17;return respondWithRpcPromise('QueuePause',_0xae3d('0x103'),{'id':_0x5b0a23['id'],'name':_0x5b0a23['name'],'pause':!![]});}})[_0xae3d('0x19')](function(){if(_0x5b0a23){return db[_0xae3d('0xf9')][_0xae3d('0x8b')]({'where':{'membername':_0x5b0a23[_0xae3d('0x3c')],'type':_0xae3d('0xfe'),'exitAt':null}});}})[_0xae3d('0x19')](function(_0x38f841){if(_0x38f841[_0xae3d('0x5b')]){var _0x418bcf=moment()[_0xae3d('0xc8')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3fba32=0x0,_0x3d2332=_0x38f841[_0xae3d('0x5b')];_0x3fba32<_0x3d2332;_0x3fba32++){_0x38f841[_0x3fba32][_0xae3d('0x104')]({'exitAt':_0x418bcf});}}})[_0xae3d('0x19')](function(){var _0x2577b6=[];var _0x29842f=utils[_0xae3d('0xfc')]();_0x29842f['forEach'](function(_0x2f3277){_0x2577b6[_0xae3d('0x4d')]({'channel':_0x2f3277,'membername':_0x5b0a23[_0xae3d('0x3c')],'interface':_[_0xae3d('0x68')](_0x5b0a23[_0xae3d('0xa9')])?util[_0xae3d('0xc8')](_0xae3d('0xee'),_0x5b0a23[_0xae3d('0x3c')]):_0x5b0a23['interface'],'type':'PAUSE','enterAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb')),'data1':_0x625e0a['body']['type']||_0xae3d('0x105'),'role':_0x5b0a23[_0xae3d('0x30')],'internal':_0x5b0a23[_0xae3d('0x64')]});});return db[_0xae3d('0xf9')]['bulkCreate'](_0x2577b6,{'individualHooks':!![]});})[_0xae3d('0x19')](function(){return _0x5b0a23[_0xae3d('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x625e0a[_0xae3d('0x5f')]['type']||_0xae3d('0x105'),'lastPauseAt':moment()[_0xae3d('0xc8')](_0xae3d('0xfb'))});})['then'](respondWithResult(_0x3516cc,null))[_0xae3d('0x24')](handleError(_0x3516cc,null));};exports['unpause']=function(_0x5e6259,_0x225dac){if(_0x5e6259[_0xae3d('0x5f')]['channel']&&!utils[_0xae3d('0xad')](_0x5e6259[_0xae3d('0x5f')]['channel'])){throw new APIBadRequestError(util[_0xae3d('0xc8')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x5e6259[_0xae3d('0x5f')][_0xae3d('0x9b')]));}return db[_0xae3d('0x40')]['find']({'where':{'id':_0x5e6259[_0xae3d('0x54')]['id']},'attributes':['id',_0xae3d('0x3c'),_0xae3d('0x30'),_0xae3d('0x64'),_0xae3d('0xa9'),_0xae3d('0xa8'),_0xae3d('0x9d'),_0xae3d('0x106'),_0xae3d('0x107'),_0xae3d('0x108'),_0xae3d('0x109'),_0xae3d('0x10a'),_0xae3d('0x10b'),_0xae3d('0x10c'),_0xae3d('0x10d')]})['then'](function(_0x2e992a){if(!_0x2e992a){throw new APINotFoundError(util[_0xae3d('0xc8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5e6259[_0xae3d('0x54')]['id']));}return _0x2e992a[_0xae3d('0x10e')](_0x5e6259['body'][_0xae3d('0x9b')]);})['then'](respondWithResult(_0x225dac,null))['catch'](APIHandleError(_0x225dac));};exports['getTeams']=function(_0x1ea2dd,_0xa86a35){var _0x5547cd={};var _0x3038fa={};var _0x1cd7dc;var _0x186da5;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x1ea2dd['params']['id']}})['then'](handleEntityNotFound(_0xa86a35,null))['then'](function(_0x3fba47){if(_0x3fba47){_0x1cd7dc=_0x3fba47;_0x3038fa[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0x10f')][_0xae3d('0x58')]);_0x3038fa['query']=_[_0xae3d('0x57')](_0x1ea2dd[_0xae3d('0x46')]);_0x3038fa[_0xae3d('0xd3')]=_[_0xae3d('0x59')](_0x3038fa[_0xae3d('0x55')],_0x3038fa[_0xae3d('0x46')]);_0x5547cd[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x3038fa[_0xae3d('0x55')],qs['fields'](_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x5547cd[_0xae3d('0x4a')]=_0x5547cd[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x5547cd[_0xae3d('0x4a')]:_0x3038fa[_0xae3d('0x55')];_0x5547cd[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x5547cd[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0x1ea2dd[_0xae3d('0x46')],_0x3038fa[_0xae3d('0xd3')]));if(_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0x38')]){_0x5547cd[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x5547cd['where'],{'$or':_[_0xae3d('0x39')](_0x5547cd[_0xae3d('0x4a')],function(_0x566793){var _0x51bb04={};_0x51bb04[_0x566793]={'$like':'%'+_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x51bb04;})});}_0x5547cd=_[_0xae3d('0x5c')]({},_0x5547cd,_0x1ea2dd[_0xae3d('0xd4')]);return _0x1cd7dc['getTeams'](_0x5547cd);}})[_0xae3d('0x19')](function(_0x32fef2){if(_0x32fef2){_0x186da5=_0x32fef2['length'];if(!_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x5547cd[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x1ea2dd[_0xae3d('0x46')]['limit']);_0x5547cd[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x1ea2dd[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x1cd7dc[_0xae3d('0x110')](_0x5547cd);}})['then'](function(_0x5030fa){if(_0x5030fa){return _0x5030fa?{'count':_0x186da5,'rows':_0x5030fa}:null;}})[_0xae3d('0x19')](respondWithResult(_0xa86a35,null))[_0xae3d('0x24')](handleError(_0xa86a35,null));};exports[_0xae3d('0x111')]=function(_0x535533,_0x1b8ec1){var _0x17a882=_0x535533['params']['id'];var _0x491112=_0x535533['body']?_0x535533[_0xae3d('0x5f')][_0xae3d('0x62')]:null;var _0x57c0d9=[];return Promise['resolve']()['then'](function(){if(!_0x491112)throw new APIBadRequestError(_0xae3d('0x112'));})[_0xae3d('0x19')](function(){return db[_0xae3d('0x40')]['findOne']({'where':{'id':_0x17a882}});})['then'](function(_0x3db6db){if(!_0x3db6db)throw new APINotFoundError(util[_0xae3d('0xc8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x535533[_0xae3d('0x54')]['id']));return db['sequelize']['transaction'](function(_0x9d4469){return _0x3db6db[_0xae3d('0x111')](_0x491112,{'transaction':_0x9d4469})['then'](function(){return db[_0xae3d('0x10f')][_0xae3d('0x8b')]({'where':{'id':{'$in':_0x491112}}});})[_0xae3d('0x19')](function(_0x111c19){var _0x533a5a=_[_0xae3d('0x39')](_0x111c19,function(_0x1ef842){return _0x1ef842[_0xae3d('0x113')]();});return Promise[_0xae3d('0x52')](_0x533a5a);})[_0xae3d('0x19')](function(_0x2a41ae){_0x57c0d9=_[_0xae3d('0x114')](_0x2a41ae);var _0x561c71=_[_0xae3d('0x39')](_0x57c0d9,function(_0x4d14ca){return _0x4d14ca[_0xae3d('0x115')](_0x3db6db['id'],{'transaction':_0x9d4469});});return Promise[_0xae3d('0x52')](_0x561c71);})[_0xae3d('0x19')](function(){if(!_0x3db6db[_0xae3d('0xa8')])return;var _0x1c940a=_['filter'](_0x57c0d9,function(_0x448dcd){return _0x448dcd[_0xae3d('0x116')](_0xae3d('0x9b'))===_0xae3d('0x117');});var _0x5f15c7=_[_0xae3d('0x39')](_0x1c940a,function(_0x22286a){return db[_0xae3d('0xaa')][_0xae3d('0xab')]({'membername':_0x3db6db['name'],'UserId':_0x3db6db['id'],'queue_name':_0x22286a['name'],'VoiceQueueId':_0x22286a['id'],'interface':_['isNil'](_0x3db6db[_0xae3d('0xa9')])?util['format'](_0xae3d('0xee'),_0x3db6db[_0xae3d('0x3c')]):_0x3db6db[_0xae3d('0xa9')],'paused':_0x3db6db[_0xae3d('0x9d')]||![],'penalty':_0x3db6db[_0xae3d('0xa3')]},{'transaction':_0x9d4469});});return Promise[_0xae3d('0x52')](_0x5f15c7);})[_0xae3d('0x19')](function(){return db[_0xae3d('0x118')][_0xae3d('0x8b')]({'where':{'teamId':{'$in':_0x491112}}});})[_0xae3d('0x19')](function(_0x14ca0d){var _0x3d9f2b=_[_0xae3d('0x39')](_0x14ca0d,function(_0x647484){return db[_0xae3d('0x119')]['create']({'UserId':_0x3db6db['id'],'VoicePrefixId':_0x647484[_0xae3d('0x11a')]},{'transaction':_0x9d4469});});return Promise[_0xae3d('0x52')](_0x3d9f2b);});});})['then'](function(){for(var _0x3051c4=0x0;_0x3051c4<_0x57c0d9['length'];_0x3051c4++){var _0x220b61=_0x57c0d9[_0x3051c4]['getDataValue'](_0xae3d('0x9b'));var _0x2d530e=_0x220b61+'QueueId';socket[_0xae3d('0xa5')](_0xae3d('0x35')+_0x220b61+_0xae3d('0x11b'),{'UserId':_0x17a882,['queueField']:_0x57c0d9[_0x3051c4]['id']});}})[_0xae3d('0x19')](respondWithStatusCode(_0x1b8ec1,null))['catch'](APIHandleError(_0x1b8ec1));};exports[_0xae3d('0x11c')]=function(_0x1e8e97,_0x31202c){var _0x48b3e0=_0x1e8e97[_0xae3d('0x54')]['id'];var _0x32abba=null;if(_0x1e8e97[_0xae3d('0x46')][_0xae3d('0x62')]){_0x32abba=_[_0xae3d('0xaf')](_0x1e8e97['query']['ids'])?_0x1e8e97[_0xae3d('0x46')][_0xae3d('0x62')]:[_0x1e8e97[_0xae3d('0x46')][_0xae3d('0x62')]];}var _0x455046=[];return Promise['resolve']()[_0xae3d('0x19')](function(){if(!_0x32abba)throw new APIBadRequestError(_0xae3d('0x11d'));})['then'](function(){return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x48b3e0}});})[_0xae3d('0x19')](function(_0x1d226e){if(!_0x1d226e)throw new APINotFoundError(util[_0xae3d('0xc8')](_0xae3d('0xc9'),_0x1e8e97[_0xae3d('0x54')]['id']));return db[_0xae3d('0x6a')][_0xae3d('0x11e')](function(_0x5241bf){return _0x1d226e[_0xae3d('0x11c')](_0x32abba,{'transaction':_0x5241bf})[_0xae3d('0x19')](function(){return db[_0xae3d('0x10f')][_0xae3d('0x8b')]({'where':{'id':{'$in':_0x32abba}}});})[_0xae3d('0x19')](function(_0x4f1ffe){var _0x40f159=_[_0xae3d('0x39')](_0x4f1ffe,function(_0x333d77){return _0x333d77[_0xae3d('0x113')]();});return Promise[_0xae3d('0x52')](_0x40f159);})[_0xae3d('0x19')](function(_0x2fa7ab){_0x455046=_['flattenDeep'](_0x2fa7ab);var _0x1cd287=_['map'](_0x455046,function(_0x48a161){return _0x48a161[_0xae3d('0x11f')](_0x1d226e['id'],{'transaction':_0x5241bf});});return Promise[_0xae3d('0x52')](_0x1cd287);})['then'](function(){if(!_0x1d226e['online'])return;var _0x5c4b58=_[_0xae3d('0x38')](_0x455046,function(_0x2ab4bb){return _0x2ab4bb['getDataValue'](_0xae3d('0x9b'))===_0xae3d('0x117');});var _0x5dd74e=_[_0xae3d('0x39')](_0x5c4b58,function(_0x4ddeaf){return db[_0xae3d('0xaa')][_0xae3d('0x31')]({'where':{'VoiceQueueId':_0x4ddeaf['id'],'UserId':_0x1d226e['id']},'transaction':_0x5241bf});});return Promise['all'](_0x5dd74e);})[_0xae3d('0x19')](function(){return db['TeamVoicePrefix'][_0xae3d('0x8b')]({'where':{'teamId':{'$in':_0x32abba}}});})[_0xae3d('0x19')](function(_0x1b9c85){var _0x4fec29=_['map'](_0x1b9c85,function(_0x2a28e0){return db['UserVoicePrefix'][_0xae3d('0x31')]({'where':{'UserId':_0x1d226e['id'],'VoicePrefixId':_0x2a28e0[_0xae3d('0x11a')]}},{'transaction':_0x5241bf});});return Promise['all'](_0x4fec29);});});})[_0xae3d('0x19')](function(){for(var _0x39f4ea=0x0;_0x39f4ea<_0x455046[_0xae3d('0x5b')];_0x39f4ea++){var _0x584c3c=_0x455046[_0x39f4ea][_0xae3d('0x116')]('channel');var _0x27e944=_0x584c3c+_0xae3d('0xb0');socket[_0xae3d('0xa5')]('user'+_0x584c3c+_0xae3d('0xb1'),{'UserId':_0x48b3e0,['queueField']:_0x455046[_0x39f4ea]['id']});}})[_0xae3d('0x19')](respondWithStatusCode(_0x31202c,null))[_0xae3d('0x24')](APIHandleError(_0x31202c));};exports['getLists']=function(_0x1cfee6,_0x24274a){var _0x19ca95={};var _0x87cc2f={};var _0x20dfaa;var _0x433d96;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x1cfee6['params']['id']}})[_0xae3d('0x19')](handleEntityNotFound(_0x24274a,null))[_0xae3d('0x19')](function(_0x29aca5){if(_0x29aca5){_0x20dfaa=_0x29aca5;_0x87cc2f[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0xcb')][_0xae3d('0x58')]);_0x87cc2f[_0xae3d('0x46')]=_[_0xae3d('0x57')](_0x1cfee6[_0xae3d('0x46')]);_0x87cc2f[_0xae3d('0xd3')]=_['intersection'](_0x87cc2f['model'],_0x87cc2f[_0xae3d('0x46')]);_0x19ca95[_0xae3d('0x4a')]=_['intersection'](_0x87cc2f[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x1cfee6[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x19ca95[_0xae3d('0x4a')]=_0x19ca95[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x19ca95[_0xae3d('0x4a')]:_0x87cc2f[_0xae3d('0x55')];_0x19ca95[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x1cfee6[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x19ca95[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_[_0xae3d('0xd6')](_0x1cfee6[_0xae3d('0x46')],_0x87cc2f[_0xae3d('0xd3')]));if(_0x1cfee6[_0xae3d('0x46')][_0xae3d('0x38')]){_0x19ca95[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x19ca95['where'],{'$or':_[_0xae3d('0x39')](_0x19ca95[_0xae3d('0x4a')],function(_0x2c3905){var _0x5e1c27={};_0x5e1c27[_0x2c3905]={'$like':'%'+_0x1cfee6['query'][_0xae3d('0x38')]+'%'};return _0x5e1c27;})});}_0x19ca95=_[_0xae3d('0x5c')]({},_0x19ca95,_0x1cfee6[_0xae3d('0xd4')]);return _0x20dfaa[_0xae3d('0x120')](_0x19ca95);}})[_0xae3d('0x19')](function(_0x4b88dc){if(_0x4b88dc){_0x433d96=_0x4b88dc[_0xae3d('0x5b')];if(!_0x1cfee6[_0xae3d('0x46')][_0xae3d('0xca')](_0xae3d('0xd8'))){_0x19ca95[_0xae3d('0x2b')]=qs[_0xae3d('0x2b')](_0x1cfee6[_0xae3d('0x46')][_0xae3d('0x2b')]);_0x19ca95[_0xae3d('0x29')]=qs[_0xae3d('0x29')](_0x1cfee6[_0xae3d('0x46')][_0xae3d('0x29')]);}return _0x20dfaa[_0xae3d('0x120')](_0x19ca95);}})[_0xae3d('0x19')](function(_0x2c9764){if(_0x2c9764){return _0x2c9764?{'count':_0x433d96,'rows':_0x2c9764}:null;}})[_0xae3d('0x19')](respondWithResult(_0x24274a,null))[_0xae3d('0x24')](handleError(_0x24274a,null));};exports[_0xae3d('0x121')]=function(_0x1af371,_0x105b5e){var _0x264a4b={};var _0x3db6e5={};var _0x4d3d79;return db[_0xae3d('0x40')][_0xae3d('0x96')]({'where':{'id':_0x1af371[_0xae3d('0x54')]['id']}})['then'](handleEntityNotFound(_0x105b5e,null))[_0xae3d('0x19')](function(_0x4e2774){if(_0x4e2774){_0x4d3d79=_0x4e2774;_0x3db6e5[_0xae3d('0x55')]=_[_0xae3d('0x57')](db[_0xae3d('0x40')]['rawAttributes']);_0x3db6e5[_0xae3d('0x46')]=_['keys'](_0x1af371[_0xae3d('0x46')]);_0x3db6e5[_0xae3d('0xd3')]=_['intersection'](_0x3db6e5[_0xae3d('0x55')],_0x3db6e5['query']);_0x264a4b[_0xae3d('0x4a')]=_[_0xae3d('0x59')](_0x3db6e5[_0xae3d('0x55')],qs[_0xae3d('0x5a')](_0x1af371[_0xae3d('0x46')][_0xae3d('0x5a')]));_0x264a4b['attributes']=_0x264a4b[_0xae3d('0x4a')][_0xae3d('0x5b')]?_0x264a4b[_0xae3d('0x4a')]:_0x3db6e5['model'];_0x264a4b[_0xae3d('0xd0')]=qs[_0xae3d('0xd1')](_0x1af371[_0xae3d('0x46')][_0xae3d('0xd1')]);_0x264a4b[_0xae3d('0xd2')]=qs[_0xae3d('0xd3')](_['pick'](_0x1af371[_0xae3d('0x46')],_0x3db6e5[_0xae3d('0xd3')]));if(_0x1af371['query'][_0xae3d('0x38')]){_0x264a4b[_0xae3d('0xd2')]=_[_0xae3d('0x5c')](_0x264a4b[_0xae3d('0xd2')],{'$or':_[_0xae3d('0x39')](_0x264a4b[_0xae3d('0x4a')],function(_0x23fc62){var _0x1648ec={};_0x1648ec[_0x23fc62]={'$like':'%'+_0x1af371[_0xae3d('0x46')][_0xae3d('0x38')]+'%'};return _0x1648ec;})});}_0x264a4b['model']=db[_0xae3d('0x40')];_0x264a4b['as']='Agents';_0x264a4b=_[_0xae3d('0x5c')]({},_0x264a4b,_0x1af371[_0xae3d('0xd4')]);return _0x4d3d79[_0xae3d('0xf7')]({'include':[_0x264a4b]});}})[_0xae3d('0x19')](function(_0x8c43ff){if(_0x8c43ff){var _0x2307b7={},_0x5d9bb8=[];for(var _0x408705=0x0;_0x408705<_0x8c43ff[_0xae3d('0x5b')];_0x408705+=0x1){for(var _0x4bedcb=0x0,_0x4ee8e7;_0x4bedcb<_0x8c43ff[_0x408705]['Agents'][_0xae3d('0x5b')];_0x4bedcb+=0x1){_0x4ee8e7=_0x8c43ff[_0x408705][_0xae3d('0x36')][_0x4bedcb][_0xae3d('0x32')]({'plain':!![]});_0x2307b7[_0x4ee8e7['id']]=_0x4ee8e7;}}_0x2307b7=_['values'](_0x2307b7);for(var _0x2dbddd=qs[_0xae3d('0x29')](_0x1af371[_0xae3d('0x46')][_0xae3d('0x29')]);_0x2dbddd<_0x2307b7[_0xae3d('0x5b')]&&_0x5d9bb8['length']=_0x4d2247[_0xef3e('0x50')]){throw new Error(_0xef3e('0x51'));}})[_0xef3e('0x15')](function(){if(_0x227247){return db[_0xef3e('0x27')]['destroy']({'where':{'membername':_0x227247[_0xef3e('0x21')]},'individualHooks':!![]});}})[_0xef3e('0x15')](function(){if(_0x227247){return _0x227247[_0xef3e('0x52')]({'raw':!![]});}})['then'](function(_0x35f873){if(_0x227247){if(_0x35f873){var _0x52ba01=[];_0x4f226c=_0x35f873;if(_0x4f226c[_0xef3e('0x47')]){for(var _0x20fec5=0x0;_0x20fec5<_0x4f226c[_0xef3e('0x47')];_0x20fec5++){_0x52ba01[_0xef3e('0x2f')](db[_0xef3e('0x27')][_0xef3e('0x53')]({'membername':_0x227247['name'],'UserId':_0x227247['id'],'queue_name':_0x4f226c[_0x20fec5][_0xef3e('0x21')],'VoiceQueueId':_0x4f226c[_0x20fec5]['id'],'interface':_0x40d824,'paused':_0x227247[_0xef3e('0x4b')]||![],'penalty':_0x4f226c[_0x20fec5]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xef3e('0x49')](_0x52ba01);}}}})[_0xef3e('0x15')](function(){if(_0x227247){return db['MemberReport'][_0xef3e('0xd')]({'where':{'membername':_0x227247[_0xef3e('0x21')],'exitAt':null}});}})[_0xef3e('0x15')](function(_0x31573e){if(_0x227247){if(_0x31573e&&_0x31573e[_0xef3e('0x47')]){var _0x484f87=[];_0x31573e['forEach'](function(_0x1ee33d){_0x484f87[_0xef3e('0x2f')](_0x1ee33d[_0xef3e('0x28')]({'exitAt':moment()[_0xef3e('0x2b')](_0xef3e('0x2c'))}));});return BPromise[_0xef3e('0x49')](_0x484f87);}}})['then'](function(){if(_0x227247){var _0x40b7ae=[];var _0x51d054=[];var _0x32d05d=utils['getChannels']();var _0x4f0ad8={'membername':_0x227247[_0xef3e('0x21')],'interface':_0x40d824,'enterAt':moment()[_0xef3e('0x2b')](_0xef3e('0x2c')),'role':_0x227247[_0xef3e('0x22')],'internal':_0x227247['internal']};_0x32d05d[_0xef3e('0x48')](function(_0x10ac9a){_0x40b7ae[_0xef3e('0x2f')](_[_0xef3e('0x54')]({'channel':_0x10ac9a,'type':_0xef3e('0x55'),'data1':'callysquare','data2':_0x40d824},_0x4f0ad8));if(_0x227247[_0xef3e('0x4b')]){_0x51d054['push'](_[_0xef3e('0x54')]({'channel':_0x10ac9a,'type':'PAUSE','data1':_0xef3e('0x56')},_0x4f0ad8));}});return db[_0xef3e('0x29')][_0xef3e('0x34')](_0x40b7ae[_0xef3e('0x57')](_0x51d054),{'individualHooks':!![]});}})['then'](function(){if(_0x227247){return _0x227247[_0xef3e('0x28')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x227247['loginInPause']||![],'mailPause':_0x227247[_0xef3e('0x4b')]||![],'chatPause':_0x227247[_0xef3e('0x4b')]||![],'faxPause':_0x227247[_0xef3e('0x4b')]||![],'smsPause':_0x227247[_0xef3e('0x4b')]||![],'openchannelPause':_0x227247['loginInPause']||![],'pauseType':_0x227247[_0xef3e('0x4b')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xef3e('0x2b')](_0xef3e('0x2c')),'interface':_0x40d824});}})['then'](function(_0x29db27){_0x5c1c3f(_0x29db27);})[_0xef3e('0x1f')](function(_0x2b4aa3){_0x150b20(_0x5bf408['error'](0x1f4,_0x2b4aa3[_0xef3e('0x19')]));});});}; \ No newline at end of file +var _0xd352=['YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','PAUSE','body','type','DEFAULT\x20PAUSE','bulkCreate','resolve','channel','isValidChannel','findOne','online','voicePause','mailPause','chatPause','whatsappPause','pauseType','lastPauseAt','unpause','LogoutUser','destroy','push','LoginUser','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','agents','upsert','UserVoiceQueue.penalty','all','callysquare','merge','LOGININPAUSE','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','limit','include','model','attributes','map','then','info','stringify','catch','error','message','find','ShowUser','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','length'];(function(_0x1d9dd7,_0x43d8c){var _0x2740c2=function(_0x433a92){while(--_0x433a92){_0x1d9dd7['push'](_0x1d9dd7['shift']());}};_0x2740c2(++_0x43d8c);}(_0xd352,0x79));var _0x2d35=function(_0x533401,_0x185149){_0x533401=_0x533401-0x0;var _0x1b4dd4=_0xd352[_0x533401];return _0x1b4dd4;};'use strict';var _=require(_0x2d35('0x0'));var util=require(_0x2d35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0x2d35('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2d35('0x3'))(_0x2d35('0x4'));var config=require(_0x2d35('0x5'));config[_0x2d35('0x6')]=_[_0x2d35('0x7')](config[_0x2d35('0x6')],{'host':_0x2d35('0x8'),'port':0x18eb});var socket=require(_0x2d35('0x9'))(new Redis(config['redis']));require(_0x2d35('0xa'))[_0x2d35('0xb')](socket);exports[_0x2d35('0xc')]=function(_0x3bd96a){var _0x475c85=this;return new Promise(function(_0x120b9d,_0x4dd6c9){return db[_0x2d35('0xd')][_0x2d35('0xe')]({'raw':_0x3bd96a['options']?_0x3bd96a[_0x2d35('0xf')][_0x2d35('0x10')]===undefined?!![]:![]:!![],'where':_0x3bd96a[_0x2d35('0xf')]?_0x3bd96a['options'][_0x2d35('0x11')]||null:null,'attributes':_0x3bd96a['options']?_0x3bd96a[_0x2d35('0xf')]['attributes']||null:null,'limit':_0x3bd96a[_0x2d35('0xf')]?_0x3bd96a[_0x2d35('0xf')][_0x2d35('0x12')]||null:null,'include':_0x3bd96a[_0x2d35('0xf')]?_0x3bd96a['options']['include']?_['map'](_0x3bd96a[_0x2d35('0xf')][_0x2d35('0x13')],function(_0x2d64f2){return{'model':db[_0x2d64f2[_0x2d35('0x14')]],'as':_0x2d64f2['as'],'attributes':_0x2d64f2[_0x2d35('0x15')],'include':_0x2d64f2[_0x2d35('0x13')]?_['map'](_0x2d64f2[_0x2d35('0x13')],function(_0x17d478){return{'model':db[_0x17d478[_0x2d35('0x14')]],'as':_0x17d478['as'],'attributes':_0x17d478[_0x2d35('0x15')],'include':_0x17d478[_0x2d35('0x13')]?_[_0x2d35('0x16')](_0x17d478['include'],function(_0x10500b){return{'model':db[_0x10500b[_0x2d35('0x14')]],'as':_0x10500b['as'],'attributes':_0x10500b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d35('0x17')](function(_0x42608c){logger[_0x2d35('0x18')](_0x2d35('0xc'),_0x3bd96a);logger['debug'](_0x2d35('0xc'),_0x3bd96a,JSON[_0x2d35('0x19')](_0x42608c));_0x120b9d(_0x42608c);})[_0x2d35('0x1a')](function(_0xa57c2a){logger[_0x2d35('0x1b')]('GetUser',_0xa57c2a[_0x2d35('0x1c')],_0x3bd96a);_0x4dd6c9(_0x475c85[_0x2d35('0x1b')](0x1f4,_0xa57c2a[_0x2d35('0x1c')]));});});};exports['ShowUser']=function(_0x3da66e){var _0x5c7920=this;return new Promise(function(_0x57486a,_0xc11934){return db[_0x2d35('0xd')][_0x2d35('0x1d')]({'raw':_0x3da66e[_0x2d35('0xf')]?_0x3da66e['options'][_0x2d35('0x10')]===undefined?!![]:![]:!![],'where':_0x3da66e[_0x2d35('0xf')]?_0x3da66e[_0x2d35('0xf')][_0x2d35('0x11')]||null:null,'attributes':_0x3da66e[_0x2d35('0xf')]?_0x3da66e[_0x2d35('0xf')][_0x2d35('0x15')]||null:null,'include':_0x3da66e[_0x2d35('0xf')]?_0x3da66e[_0x2d35('0xf')][_0x2d35('0x13')]?_[_0x2d35('0x16')](_0x3da66e['options']['include'],function(_0x1051d4){return{'model':db[_0x1051d4[_0x2d35('0x14')]],'as':_0x1051d4['as'],'attributes':_0x1051d4[_0x2d35('0x15')],'include':_0x1051d4[_0x2d35('0x13')]?_['map'](_0x1051d4[_0x2d35('0x13')],function(_0x87d1e0){return{'model':db[_0x87d1e0[_0x2d35('0x14')]],'as':_0x87d1e0['as'],'attributes':_0x87d1e0[_0x2d35('0x15')],'include':_0x87d1e0['include']?_[_0x2d35('0x16')](_0x87d1e0[_0x2d35('0x13')],function(_0x1ead1a){return{'model':db[_0x1ead1a[_0x2d35('0x14')]],'as':_0x1ead1a['as'],'attributes':_0x1ead1a[_0x2d35('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2d35('0x17')](function(_0x42a314){logger[_0x2d35('0x18')](_0x2d35('0x1e'),_0x3da66e);logger['debug'](_0x2d35('0x1e'),_0x3da66e,JSON[_0x2d35('0x19')](_0x42a314));_0x57486a(_0x42a314);})[_0x2d35('0x1a')](function(_0x3f6ad6){logger[_0x2d35('0x1b')](_0x2d35('0x1e'),_0x3f6ad6[_0x2d35('0x1c')],_0x3da66e);_0xc11934(_0x5c7920[_0x2d35('0x1b')](0x1f4,_0x3f6ad6['message']));});});};exports[_0x2d35('0x1f')]=function(_0x51f39a){var _0x2b718d;return db['User']['find']({'where':_0x51f39a[_0x2d35('0xf')][_0x2d35('0x11')]||{},'attributes':['id',_0x2d35('0x20'),_0x2d35('0x21'),_0x2d35('0x22'),_0x2d35('0x23')]})[_0x2d35('0x17')](function(_0xb0dcb7){if(!_0xb0dcb7){throw new Error(util[_0x2d35('0x24')](_0x2d35('0x25'),_0x51f39a[_0x2d35('0x26')]['id']));}_0x2b718d=_0xb0dcb7;return db[_0x2d35('0x27')][_0x2d35('0x28')]({'paused':0x1},{'where':{'UserId':_0x2b718d['id']},'individualHooks':!![]});})['then'](function(){return db[_0x2d35('0x29')][_0x2d35('0xe')]({'where':{'membername':_0x2b718d['name'],'type':'PAUSE','exitAt':null}});})[_0x2d35('0x17')](function(_0x1b648c){if(_0x1b648c&&_0x1b648c[_0x2d35('0x2a')]){var _0x3d5ec6=moment()[_0x2d35('0x24')](_0x2d35('0x2b'));for(var _0x5dd0f8=0x0,_0xdc51aa=_0x1b648c[_0x2d35('0x2a')];_0x5dd0f8<_0xdc51aa;_0x5dd0f8++){_0x1b648c[_0x5dd0f8][_0x2d35('0x2c')]({'exitAt':_0x3d5ec6});}}})[_0x2d35('0x17')](function(){var _0x12bb45=[];var _0x325f1f=utils[_0x2d35('0x2d')]();_0x325f1f[_0x2d35('0x2e')](function(_0x3ee056){_0x12bb45['push']({'channel':_0x3ee056,'membername':_0x2b718d[_0x2d35('0x20')],'interface':_[_0x2d35('0x2f')](_0x2b718d['interface'])?util[_0x2d35('0x24')]('SIP/%s',_0x2b718d['name']):_0x2b718d[_0x2d35('0x23')],'type':_0x2d35('0x30'),'enterAt':moment()[_0x2d35('0x24')](_0x2d35('0x2b')),'data1':_0x51f39a[_0x2d35('0x31')][_0x2d35('0x32')]||_0x2d35('0x33'),'role':_0x2b718d['role'],'internal':_0x2b718d[_0x2d35('0x22')],'uniqueid':_0x51f39a['body']['uniqueid']||null});});return db[_0x2d35('0x29')][_0x2d35('0x34')](_0x12bb45,{'individualHooks':!![]});})[_0x2d35('0x17')](function(){return _0x2b718d[_0x2d35('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x51f39a['body']['type']||_0x2d35('0x33'),'lastPauseAt':moment()[_0x2d35('0x24')](_0x2d35('0x2b'))});})[_0x2d35('0x1a')](function(_0x3d21a2){throw _0x3d21a2;});};exports['UnpauseUser']=function(_0x3cb5c7){return Promise[_0x2d35('0x35')]()[_0x2d35('0x17')](function(){if(_0x3cb5c7[_0x2d35('0x31')][_0x2d35('0x36')]&&!utils[_0x2d35('0x37')](_0x3cb5c7['body'][_0x2d35('0x36')])){throw new Error(util[_0x2d35('0x24')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3cb5c7[_0x2d35('0x31')]['channel']));}return db[_0x2d35('0xd')][_0x2d35('0x38')]({'where':_0x3cb5c7[_0x2d35('0xf')][_0x2d35('0x11')]||{},'attributes':['id','name','role','internal',_0x2d35('0x23'),_0x2d35('0x39'),_0x2d35('0x3a'),_0x2d35('0x3b'),_0x2d35('0x3c'),'faxPause','openchannelPause','smsPause',_0x2d35('0x3d'),_0x2d35('0x3e'),_0x2d35('0x3f')]});})[_0x2d35('0x17')](function(_0x3d4a15){if(!_0x3d4a15){throw new Error(util[_0x2d35('0x24')](_0x2d35('0x25'),_0x3cb5c7[_0x2d35('0x26')]['id']));}return _0x3d4a15[_0x2d35('0x40')](_0x3cb5c7[_0x2d35('0x31')]['channel'],'system');})[_0x2d35('0x1a')](function(_0x234179){throw _0x234179;});};exports[_0x2d35('0x41')]=function(_0x54331d){var _0x5f4060=this;return new Promise(function(_0x57d692,_0x583be8){var _0x378bc3;return db['User']['findOne']({'where':_0x54331d['options'][_0x2d35('0x11')]||{},'attributes':['id','name']})['then'](function(_0x182a34){if(_0x182a34){_0x378bc3=_0x182a34;return db[_0x2d35('0x27')][_0x2d35('0x42')]({'where':{'membername':_0x378bc3[_0x2d35('0x20')]},'individualHooks':!![]});}})[_0x2d35('0x17')](function(){if(_0x378bc3){return db[_0x2d35('0x29')]['findAll']({'where':{'membername':_0x378bc3['name'],'exitAt':null}});}})[_0x2d35('0x17')](function(_0x320b95){if(_0x378bc3){if(_0x320b95&&_0x320b95['length']){var _0x16e1ed=[];_0x320b95[_0x2d35('0x2e')](function(_0x52865c){_0x16e1ed[_0x2d35('0x43')](_0x52865c[_0x2d35('0x28')]({'exitAt':moment()['format'](_0x2d35('0x2b'))}));});return BPromise['all'](_0x16e1ed);}}})[_0x2d35('0x17')](function(){if(_0x378bc3){return _0x378bc3['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x2d35('0x17')](function(_0xb28354){_0x57d692(_0xb28354);})[_0x2d35('0x1a')](function(_0x22ec85){_0x583be8(_0x5f4060[_0x2d35('0x1b')](0x1f4,_0x22ec85['message']));});});};exports[_0x2d35('0x44')]=function(_0x5d34dc){var _0x20fa40=this;return new Promise(function(_0x186f4a,_0x5161db){var _0x2cea3d;var _0x16ba64;var _0x3b9587;var _0x3f6f4c;return db['User'][_0x2d35('0x38')]({'where':_0x5d34dc[_0x2d35('0xf')][_0x2d35('0x11')]||{},'attributes':['id',_0x2d35('0x20'),_0x2d35('0x21'),'mobile',_0x2d35('0x45'),_0x2d35('0x22'),_0x2d35('0x46'),_0x2d35('0x23')]})['then'](function(_0x4eebac){if(_0x4eebac){_0x2cea3d=_0x4eebac;_0x3f6f4c=_0x5d34dc['body'][_0x2d35('0x23')]?_0x5d34dc[_0x2d35('0x31')][_0x2d35('0x23')]:util[_0x2d35('0x24')](_0x2d35('0x47'),_0x2cea3d[_0x2d35('0x20')]);return db[_0x2d35('0xd')][_0x2d35('0x48')]({'where':{'role':_0x2d35('0x49'),'online':!![],'id':{'$ne':_0x2cea3d['id']}}});}})[_0x2d35('0x17')](function(_0x4ec445){if(_0x4ec445){_0x3b9587=_0x4ec445;return require(_0x2d35('0x4a'))['getLicense']();}})[_0x2d35('0x17')](function(_0x286f0b){if(_0x286f0b&&_0x286f0b[_0x2d35('0x4b')]&&_0x3b9587>=_0x286f0b[_0x2d35('0x4b')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x2d35('0x17')](function(){if(_0x2cea3d){return db[_0x2d35('0x27')][_0x2d35('0x42')]({'where':{'membername':_0x2cea3d['name']},'individualHooks':!![]});}})[_0x2d35('0x17')](function(){if(_0x2cea3d){return _0x2cea3d['getVoiceQueues']({'raw':!![]});}})[_0x2d35('0x17')](function(_0x5acbd2){if(_0x2cea3d){if(_0x5acbd2){var _0x5f4497=[];_0x16ba64=_0x5acbd2;if(_0x16ba64['length']){for(var _0x3469e6=0x0;_0x3469e6<_0x16ba64[_0x2d35('0x2a')];_0x3469e6++){_0x5f4497[_0x2d35('0x43')](db[_0x2d35('0x27')][_0x2d35('0x4c')]({'membername':_0x2cea3d[_0x2d35('0x20')],'UserId':_0x2cea3d['id'],'queue_name':_0x16ba64[_0x3469e6]['name'],'VoiceQueueId':_0x16ba64[_0x3469e6]['id'],'interface':_0x3f6f4c,'paused':_0x2cea3d[_0x2d35('0x46')]||![],'penalty':_0x16ba64[_0x3469e6][_0x2d35('0x4d')]||0x0}));}return BPromise[_0x2d35('0x4e')](_0x5f4497);}}}})[_0x2d35('0x17')](function(){if(_0x2cea3d){return db['MemberReport'][_0x2d35('0xe')]({'where':{'membername':_0x2cea3d[_0x2d35('0x20')],'exitAt':null}});}})[_0x2d35('0x17')](function(_0x143e95){if(_0x2cea3d){if(_0x143e95&&_0x143e95[_0x2d35('0x2a')]){var _0x35c15c=[];_0x143e95[_0x2d35('0x2e')](function(_0x2d1acd){_0x35c15c[_0x2d35('0x43')](_0x2d1acd[_0x2d35('0x28')]({'exitAt':moment()['format'](_0x2d35('0x2b'))}));});return BPromise['all'](_0x35c15c);}}})['then'](function(){if(_0x2cea3d){var _0x2808ef=[];var _0x5879a8=[];var _0x251bb9=utils[_0x2d35('0x2d')]();var _0x492684={'membername':_0x2cea3d[_0x2d35('0x20')],'interface':_0x3f6f4c,'enterAt':moment()[_0x2d35('0x24')](_0x2d35('0x2b')),'role':_0x2cea3d[_0x2d35('0x21')],'internal':_0x2cea3d[_0x2d35('0x22')]};_0x251bb9[_0x2d35('0x2e')](function(_0x27a48f){_0x2808ef[_0x2d35('0x43')](_['merge']({'channel':_0x27a48f,'type':'LOGIN','data1':_0x2d35('0x4f'),'data2':_0x3f6f4c},_0x492684));if(_0x2cea3d['loginInPause']){_0x5879a8['push'](_[_0x2d35('0x50')]({'channel':_0x27a48f,'type':_0x2d35('0x30'),'data1':_0x2d35('0x51')},_0x492684));}});return db[_0x2d35('0x29')]['bulkCreate'](_0x2808ef['concat'](_0x5879a8),{'individualHooks':!![]});}})[_0x2d35('0x17')](function(){if(_0x2cea3d){return _0x2cea3d[_0x2d35('0x28')]({'online':!![],'lastLoginAt':moment()[_0x2d35('0x24')](_0x2d35('0x2b')),'voicePause':_0x2cea3d[_0x2d35('0x46')]||![],'mailPause':_0x2cea3d[_0x2d35('0x46')]||![],'chatPause':_0x2cea3d[_0x2d35('0x46')]||![],'faxPause':_0x2cea3d[_0x2d35('0x46')]||![],'smsPause':_0x2cea3d[_0x2d35('0x46')]||![],'openchannelPause':_0x2cea3d['loginInPause']||![],'pauseType':_0x2cea3d[_0x2d35('0x46')]?_0x2d35('0x51'):null,'lastPauseAt':moment()['format'](_0x2d35('0x2b')),'interface':_0x3f6f4c});}})['then'](function(_0x47b805){_0x186f4a(_0x47b805);})[_0x2d35('0x1a')](function(_0x41c403){_0x5161db(_0x20fa40[_0x2d35('0x1b')](0x1f4,_0x41c403['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b6ec539..f808731 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 _0xce65=['register','length','user:','save','remove','update','emit','removeListener'];(function(_0x5a3872,_0x442a8f){var _0x5530e2=function(_0x1db5f9){while(--_0x1db5f9){_0x5a3872['push'](_0x5a3872['shift']());}};_0x5530e2(++_0x442a8f);}(_0xce65,0x17b));var _0x5ce6=function(_0x1f474e,_0x467fbf){_0x1f474e=_0x1f474e-0x0;var _0x19b7ad=_0xce65[_0x1f474e];return _0x19b7ad;};'use strict';var UserEvents=require('./user.events');var events=[_0x5ce6('0x0'),_0x5ce6('0x1'),_0x5ce6('0x2')];function createListener(_0x16404c,_0x555a86){return function(_0x229432){_0x555a86[_0x5ce6('0x3')](_0x16404c,_0x229432);};}function removeListener(_0x2700e3,_0x242cfb){return function(){UserEvents[_0x5ce6('0x4')](_0x2700e3,_0x242cfb);};}exports[_0x5ce6('0x5')]=function(_0x2b20bb){for(var _0x35b0ba=0x0,_0x33b458=events[_0x5ce6('0x6')];_0x35b0ba<_0x33b458;_0x35b0ba++){var _0x4f33e2=events[_0x35b0ba];var _0x2b1e9f=createListener(_0x5ce6('0x7')+_0x4f33e2,_0x2b20bb);UserEvents['on'](_0x4f33e2,_0x2b1e9f);}}; \ No newline at end of file +var _0xf283=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x3390dd,_0x206beb){var _0x184b59=function(_0x837ad0){while(--_0x837ad0){_0x3390dd['push'](_0x3390dd['shift']());}};_0x184b59(++_0x206beb);}(_0xf283,0x1bd));var _0x3f28=function(_0x363a25,_0x501880){_0x363a25=_0x363a25-0x0;var _0x51933e=_0xf283[_0x363a25];return _0x51933e;};'use strict';var UserEvents=require(_0x3f28('0x0'));var events=[_0x3f28('0x1'),_0x3f28('0x2'),_0x3f28('0x3')];function createListener(_0x58a868,_0x33ee26){return function(_0xd600f5){_0x33ee26['emit'](_0x58a868,_0xd600f5);};}function removeListener(_0x28d171,_0x26a09e){return function(){UserEvents[_0x3f28('0x4')](_0x28d171,_0x26a09e);};}exports[_0x3f28('0x5')]=function(_0x23a25e){for(var _0x2a1a94=0x0,_0x451e3d=events[_0x3f28('0x6')];_0x2a1a94<_0x451e3d;_0x2a1a94++){var _0x39741f=events[_0x2a1a94];var _0x3fea4e=createListener(_0x3f28('0x7')+_0x39741f,_0x23a25e);UserEvents['on'](_0x39741f,_0x3fea4e);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f624c0d..fe4acf1 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1a13b1,_0x4d1d25){var _0x395e05=function(_0x209692){while(--_0x209692){_0x1a13b1['push'](_0x1a13b1['shift']());}};_0x395e05(++_0x4d1d25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x656639,_0x11fbae){var _0x3fce31=function(_0x564368){while(--_0x564368){_0x656639['push'](_0x656639['shift']());}};_0x3fce31(++_0x11fbae);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xcb91[_0x556bb1];return _0x45455f;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8451463..c6fe55a 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 _0x8ff4=['INTEGER','sequelize'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x8ff4,0x1b3));var _0x48ff=function(_0x37236d,_0x3e8445){_0x37236d=_0x37236d-0x0;var _0x5ea146=_0x8ff4[_0x37236d];return _0x5ea146;};'use strict';var Sequelize=require(_0x48ff('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x48ff('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4304=['INTEGER','sequelize','exports'];(function(_0x10a997,_0x4da7df){var _0x5831f6=function(_0x440165){while(--_0x440165){_0x10a997['push'](_0x10a997['shift']());}};_0x5831f6(++_0x4da7df);}(_0x4304,0xee));var _0x4430=function(_0x3875c2,_0x52b01e){_0x3875c2=_0x3875c2-0x0;var _0x52b45b=_0x4304[_0x3875c2];return _0x52b45b;};'use strict';var Sequelize=require(_0x4430('0x0'));module[_0x4430('0x1')]={'penalty':{'type':Sequelize[_0x4430('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index c778f78..e4fc8e9 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 _0x3955=['request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x11d2fc,_0x22ed07){var _0x7567f6=function(_0x1afc84){while(--_0x1afc84){_0x11d2fc['push'](_0x11d2fc['shift']());}};_0x7567f6(++_0x22ed07);}(_0x3955,0x167));var _0x5395=function(_0x3c798f,_0xa4781e){_0x3c798f=_0x3c798f-0x0;var _0x450a38=_0x3955[_0x3c798f];return _0x450a38;};'use strict';var _=require('lodash');var util=require(_0x5395('0x0'));var logger=require(_0x5395('0x1'))(_0x5395('0x2'));var moment=require(_0x5395('0x3'));var BPromise=require(_0x5395('0x4'));var rp=require(_0x5395('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5395('0x6'));var config=require(_0x5395('0x7'));var attributes=require(_0x5395('0x8'));module[_0x5395('0x9')]=function(_0x410372,_0x380881){return _0x410372[_0x5395('0xa')](_0x5395('0xb'),attributes,{'tableName':_0x5395('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f03=['path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0x7f03,0x1ca));var _0x37f0=function(_0x5774f2,_0x3d198f){_0x5774f2=_0x5774f2-0x0;var _0x52c5be=_0x7f03[_0x5774f2];return _0x52c5be;};'use strict';var _=require(_0x37f0('0x0'));var util=require(_0x37f0('0x1'));var logger=require('../../config/logger')(_0x37f0('0x2'));var moment=require(_0x37f0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37f0('0x4'));var rimraf=require('rimraf');var config=require(_0x37f0('0x5'));var attributes=require(_0x37f0('0x6'));module[_0x37f0('0x7')]=function(_0x30ce1b,_0x250974){return _0x30ce1b[_0x37f0('0x8')](_0x37f0('0x9'),attributes,{'tableName':_0x37f0('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 624c490..e4f5c8e 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 _0xc546=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58bad1,_0xab07ea){var _0x3a7c2e=function(_0x2d55ca){while(--_0x2d55ca){_0x58bad1['push'](_0x58bad1['shift']());}};_0x3a7c2e(++_0xab07ea);}(_0xc546,0xd4));var _0x6c54=function(_0x316f48,_0x5bf57a){_0x316f48=_0x316f48-0x0;var _0x1a180a=_0xc546[_0x316f48];return _0x1a180a;};'use strict';var _=require(_0x6c54('0x0'));var util=require(_0x6c54('0x1'));var moment=require(_0x6c54('0x2'));var BPromise=require(_0x6c54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c54('0x4'));var db=require(_0x6c54('0x5'))['db'];var utils=require(_0x6c54('0x6'));var logger=require(_0x6c54('0x7'))(_0x6c54('0x8'));var config=require(_0x6c54('0x9'));var jayson=require(_0x6c54('0xa'));var client=jayson[_0x6c54('0xb')][_0x6c54('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e1432,_0x21dfb9,_0x2b00ba){return new BPromise(function(_0x524d99,_0x4f5206){return client[_0x6c54('0xd')](_0x3e1432,_0x2b00ba)[_0x6c54('0xe')](function(_0x56a656){logger[_0x6c54('0xf')](_0x6c54('0x10'),_0x21dfb9,_0x6c54('0x11'));logger[_0x6c54('0x12')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x21dfb9,_0x6c54('0x11'),JSON[_0x6c54('0x13')](_0x56a656));if(_0x56a656[_0x6c54('0x14')]){if(_0x56a656[_0x6c54('0x14')][_0x6c54('0x15')]===0x1f4){logger['error'](_0x6c54('0x10'),_0x21dfb9,_0x56a656[_0x6c54('0x14')][_0x6c54('0x16')]);return _0x4f5206(_0x56a656[_0x6c54('0x14')]['message']);}logger[_0x6c54('0x14')](_0x6c54('0x10'),_0x21dfb9,_0x56a656[_0x6c54('0x14')][_0x6c54('0x16')]);return _0x524d99(_0x56a656['error'][_0x6c54('0x16')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x21dfb9,_0x6c54('0x11'));_0x524d99(_0x56a656[_0x6c54('0x17')][_0x6c54('0x16')]);}})[_0x6c54('0x18')](function(_0x3700be){logger[_0x6c54('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x21dfb9,_0x3700be);_0x4f5206(_0x3700be);});});} \ No newline at end of file +var _0x212b=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0xb795ef,_0x3ac5a4){var _0x15f84e=function(_0x1f24d7){while(--_0x1f24d7){_0xb795ef['push'](_0xb795ef['shift']());}};_0x15f84e(++_0x3ac5a4);}(_0x212b,0x1b5));var _0xb212=function(_0xf2ed2d,_0x30e369){_0xf2ed2d=_0xf2ed2d-0x0;var _0xab5f2b=_0x212b[_0xf2ed2d];return _0xab5f2b;};'use strict';var _=require(_0xb212('0x0'));var util=require(_0xb212('0x1'));var moment=require(_0xb212('0x2'));var BPromise=require('bluebird');var rs=require(_0xb212('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb212('0x4'))['db'];var utils=require(_0xb212('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb212('0x6'));var jayson=require(_0xb212('0x7'));var client=jayson['client'][_0xb212('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1073da,_0xd11744,_0x5ef9b0){return new BPromise(function(_0x2300ca,_0x4d955e){return client[_0xb212('0x9')](_0x1073da,_0x5ef9b0)[_0xb212('0xa')](function(_0xc7d2a6){logger[_0xb212('0xb')](_0xb212('0xc'),_0xd11744,_0xb212('0xd'));logger['debug'](_0xb212('0xe'),_0xd11744,_0xb212('0xd'),JSON[_0xb212('0xf')](_0xc7d2a6));if(_0xc7d2a6['error']){if(_0xc7d2a6[_0xb212('0x10')][_0xb212('0x11')]===0x1f4){logger[_0xb212('0x10')](_0xb212('0xc'),_0xd11744,_0xc7d2a6[_0xb212('0x10')]['message']);return _0x4d955e(_0xc7d2a6['error'][_0xb212('0x12')]);}logger[_0xb212('0x10')](_0xb212('0xc'),_0xd11744,_0xc7d2a6[_0xb212('0x10')][_0xb212('0x12')]);return _0x2300ca(_0xc7d2a6['error'][_0xb212('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0xd11744,_0xb212('0xd'));_0x2300ca(_0xc7d2a6[_0xb212('0x13')][_0xb212('0x12')]);}})[_0xb212('0x14')](function(_0x48f59c){logger[_0xb212('0x10')](_0xb212('0xc'),_0xd11744,_0x48f59c);_0x4d955e(_0x48f59c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d7e81ce..239474c 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x14c460,_0x4ceb47){var _0x13e711=function(_0x1de757){while(--_0x1de757){_0x14c460['push'](_0x14c460['shift']());}};_0x13e711(++_0x4ceb47);}(_0xe706,0xa3));var _0x6e70=function(_0x36c0d1,_0x1d9948){_0x36c0d1=_0x36c0d1-0x0;var _0x59c859=_0xe706[_0x36c0d1];return _0x59c859;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3d400e,_0x10cf94){var _0x270c61=function(_0x1d61fc){while(--_0x1d61fc){_0x3d400e['push'](_0x3d400e['shift']());}};_0x270c61(++_0x10cf94);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xcb91[_0x2ae2ad];return _0x26dbd7;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 4f68dca..8d2df24 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 _0x2322=['exports','INTEGER'];(function(_0xebb12,_0x4f3869){var _0x4f3c04=function(_0x3ac428){while(--_0x3ac428){_0xebb12['push'](_0xebb12['shift']());}};_0x4f3c04(++_0x4f3869);}(_0x2322,0xfa));var _0x2232=function(_0x496d23,_0x4356b6){_0x496d23=_0x496d23-0x0;var _0x2638c1=_0x2322[_0x496d23];return _0x2638c1;};'use strict';var Sequelize=require('sequelize');module[_0x2232('0x0')]={'penalty':{'type':Sequelize[_0x2232('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2232('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae0e=['sequelize','INTEGER','STRING'];(function(_0x3a9c61,_0x58c919){var _0x3e05b3=function(_0x530497){while(--_0x530497){_0x3a9c61['push'](_0x3a9c61['shift']());}};_0x3e05b3(++_0x58c919);}(_0xae0e,0xb4));var _0xeae0=function(_0x21c05d,_0x3197dc){_0x21c05d=_0x21c05d-0x0;var _0x2c2cf1=_0xae0e[_0x21c05d];return _0x2c2cf1;};'use strict';var Sequelize=require(_0xeae0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xeae0('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeae0('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeae0('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 4f44b33..8b94b7a 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 _0x4407=['define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x23eae3,_0x10933b){var _0xf76053=function(_0x7ce939){while(--_0x7ce939){_0x23eae3['push'](_0x23eae3['shift']());}};_0xf76053(++_0x10933b);}(_0x4407,0xad));var _0x7440=function(_0x581038,_0x19e78e){_0x581038=_0x581038-0x0;var _0x149690=_0x4407[_0x581038];return _0x149690;};'use strict';var _=require('lodash');var util=require(_0x7440('0x0'));var logger=require(_0x7440('0x1'))(_0x7440('0x2'));var moment=require('moment');var BPromise=require(_0x7440('0x3'));var rp=require(_0x7440('0x4'));var fs=require('fs');var path=require(_0x7440('0x5'));var rimraf=require(_0x7440('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x522782,_0x3ba67b){return _0x522782[_0x7440('0x7')](_0x7440('0x8'),attributes,{'tableName':_0x7440('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93da=['request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','lodash','../../config/logger','api','bluebird'];(function(_0x1d7a74,_0x4402e9){var _0x44df06=function(_0x4f0d69){while(--_0x4f0d69){_0x1d7a74['push'](_0x1d7a74['shift']());}};_0x44df06(++_0x4402e9);}(_0x93da,0xd8));var _0xa93d=function(_0x3707fb,_0x40f632){_0x3707fb=_0x3707fb-0x0;var _0x4b7569=_0x93da[_0x3707fb];return _0x4b7569;};'use strict';var _=require(_0xa93d('0x0'));var util=require('util');var logger=require(_0xa93d('0x1'))(_0xa93d('0x2'));var moment=require('moment');var BPromise=require(_0xa93d('0x3'));var rp=require(_0xa93d('0x4'));var fs=require('fs');var path=require(_0xa93d('0x5'));var rimraf=require(_0xa93d('0x6'));var config=require(_0xa93d('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xa93d('0x8')]=function(_0x1d703c,_0x33bca1){return _0x1d703c[_0xa93d('0x9')](_0xa93d('0xa'),attributes,{'tableName':'user_has_fax_queues','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 9924edd..e87301e 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 _0x96fe=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x96fe,0x17c));var _0xe96f=function(_0x5b8cd3,_0x3012f6){_0x5b8cd3=_0x5b8cd3-0x0;var _0x5a7ca8=_0x96fe[_0x5b8cd3];return _0x5a7ca8;};'use strict';var _=require(_0xe96f('0x0'));var util=require(_0xe96f('0x1'));var moment=require(_0xe96f('0x2'));var BPromise=require(_0xe96f('0x3'));var rs=require(_0xe96f('0x4'));var fs=require('fs');var Redis=require(_0xe96f('0x5'));var db=require(_0xe96f('0x6'))['db'];var utils=require(_0xe96f('0x7'));var logger=require('../../config/logger')(_0xe96f('0x8'));var config=require('../../config/environment');var jayson=require(_0xe96f('0x9'));var client=jayson[_0xe96f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5656f7,_0x4f5ecc,_0x1df5cb){return new BPromise(function(_0x2048fc,_0x17b2e4){return client['request'](_0x5656f7,_0x1df5cb)['then'](function(_0x2e5cb1){logger['info'](_0xe96f('0xb'),_0x4f5ecc,_0xe96f('0xc'));logger[_0xe96f('0xd')](_0xe96f('0xe'),_0x4f5ecc,_0xe96f('0xc'),JSON[_0xe96f('0xf')](_0x2e5cb1));if(_0x2e5cb1[_0xe96f('0x10')]){if(_0x2e5cb1[_0xe96f('0x10')][_0xe96f('0x11')]===0x1f4){logger[_0xe96f('0x10')](_0xe96f('0xb'),_0x4f5ecc,_0x2e5cb1[_0xe96f('0x10')]['message']);return _0x17b2e4(_0x2e5cb1[_0xe96f('0x10')][_0xe96f('0x12')]);}logger[_0xe96f('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x4f5ecc,_0x2e5cb1[_0xe96f('0x10')][_0xe96f('0x12')]);return _0x2048fc(_0x2e5cb1[_0xe96f('0x10')]['message']);}else{logger[_0xe96f('0x13')](_0xe96f('0xb'),_0x4f5ecc,_0xe96f('0xc'));_0x2048fc(_0x2e5cb1[_0xe96f('0x14')]['message']);}})[_0xe96f('0x15')](function(_0x1d410b){logger['error'](_0xe96f('0xb'),_0x4f5ecc,_0x1d410b);_0x17b2e4(_0x1d410b);});});} \ No newline at end of file +var _0x02c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02c1,0x128));var _0x102c=function(_0x12a1de,_0x220be4){_0x12a1de=_0x12a1de-0x0;var _0x167f8d=_0x02c1[_0x12a1de];return _0x167f8d;};'use strict';var _=require(_0x102c('0x0'));var util=require(_0x102c('0x1'));var moment=require(_0x102c('0x2'));var BPromise=require(_0x102c('0x3'));var rs=require(_0x102c('0x4'));var fs=require('fs');var Redis=require(_0x102c('0x5'));var db=require(_0x102c('0x6'))['db'];var utils=require(_0x102c('0x7'));var logger=require(_0x102c('0x8'))(_0x102c('0x9'));var config=require('../../config/environment');var jayson=require(_0x102c('0xa'));var client=jayson[_0x102c('0xb')][_0x102c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38b587,_0x61c19,_0x157e08){return new BPromise(function(_0x5373a0,_0x530dab){return client['request'](_0x38b587,_0x157e08)['then'](function(_0x56bfc0){logger[_0x102c('0xd')](_0x102c('0xe'),_0x61c19,_0x102c('0xf'));logger[_0x102c('0x10')](_0x102c('0x11'),_0x61c19,'request\x20sent',JSON['stringify'](_0x56bfc0));if(_0x56bfc0[_0x102c('0x12')]){if(_0x56bfc0[_0x102c('0x12')][_0x102c('0x13')]===0x1f4){logger[_0x102c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x61c19,_0x56bfc0[_0x102c('0x12')][_0x102c('0x14')]);return _0x530dab(_0x56bfc0[_0x102c('0x12')][_0x102c('0x14')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x61c19,_0x56bfc0[_0x102c('0x12')][_0x102c('0x14')]);return _0x5373a0(_0x56bfc0[_0x102c('0x12')][_0x102c('0x14')]);}else{logger[_0x102c('0xd')](_0x102c('0xe'),_0x61c19,_0x102c('0xf'));_0x5373a0(_0x56bfc0[_0x102c('0x15')][_0x102c('0x14')]);}})[_0x102c('0x16')](function(_0x44cd63){logger['error'](_0x102c('0xe'),_0x61c19,_0x44cd63);_0x530dab(_0x44cd63);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index a554f01..c37fe82 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x42e75c,_0x136223){var _0x42b0b8=function(_0x4bbc58){while(--_0x4bbc58){_0x42e75c['push'](_0x42e75c['shift']());}};_0x42b0b8(++_0x136223);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4a12a1,_0x23f85a){var _0xba5e85=function(_0xf0522a){while(--_0xf0522a){_0x4a12a1['push'](_0x4a12a1['shift']());}};_0xba5e85(++_0x23f85a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9bb59a5..6ffd962 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 _0x1f1c=['INTEGER','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1f1c,0x1c1));var _0xc1f1=function(_0x4ae31e,_0x4c6f66){_0x4ae31e=_0x4ae31e-0x0;var _0x21e027=_0x1f1c[_0x4ae31e];return _0x21e027;};'use strict';var Sequelize=require(_0xc1f1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc1f1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x08d3=['sequelize','exports'];(function(_0x10e108,_0xb7d5f4){var _0x2550c8=function(_0x50c0a5){while(--_0x50c0a5){_0x10e108['push'](_0x10e108['shift']());}};_0x2550c8(++_0xb7d5f4);}(_0x08d3,0x174));var _0x308d=function(_0x530ef0,_0x514c24){_0x530ef0=_0x530ef0-0x0;var _0x34b010=_0x08d3[_0x530ef0];return _0x34b010;};'use strict';var Sequelize=require(_0x308d('0x0'));module[_0x308d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 9156355..c9f421b 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 _0x090d=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x51ba40,_0x511c4b){var _0xffe123=function(_0x1003bc){while(--_0x1003bc){_0x51ba40['push'](_0x51ba40['shift']());}};_0xffe123(++_0x511c4b);}(_0x090d,0x133));var _0xd090=function(_0x54fdea,_0x54c578){_0x54fdea=_0x54fdea-0x0;var _0x58b6d=_0x090d[_0x54fdea];return _0x58b6d;};'use strict';var _=require(_0xd090('0x0'));var util=require(_0xd090('0x1'));var logger=require(_0xd090('0x2'))(_0xd090('0x3'));var moment=require(_0xd090('0x4'));var BPromise=require(_0xd090('0x5'));var rp=require(_0xd090('0x6'));var fs=require('fs');var path=require(_0xd090('0x7'));var rimraf=require(_0xd090('0x8'));var config=require(_0xd090('0x9'));var attributes=require(_0xd090('0xa'));module['exports']=function(_0x3d1406,_0x286361){return _0x3d1406['define'](_0xd090('0xb'),attributes,{'tableName':_0xd090('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec3=['bluebird','request-promise','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7ec3,0x17d));var _0x37ec=function(_0xb7a49c,_0x5b691b){_0xb7a49c=_0xb7a49c-0x0;var _0x5cbc40=_0x7ec3[_0xb7a49c];return _0x5cbc40;};'use strict';var _=require(_0x37ec('0x0'));var util=require(_0x37ec('0x1'));var logger=require(_0x37ec('0x2'))(_0x37ec('0x3'));var moment=require('moment');var BPromise=require(_0x37ec('0x4'));var rp=require(_0x37ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x37ec('0x6'));var attributes=require('./userMailQueue.attributes');module[_0x37ec('0x7')]=function(_0x221cc6,_0x3a5b0b){return _0x221cc6[_0x37ec('0x8')](_0x37ec('0x9'),attributes,{'tableName':_0x37ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 687afc1..2a133a5 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 _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(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4c2c2a,_0x39fc76){_0x4c2c2a=_0x4c2c2a-0x0;var _0x4cff35=_0x1cb9[_0x4c2c2a];return _0x4cff35;};'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 +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c8bfb,_0x216ded){var _0x230ac7=function(_0x5f0baa){while(--_0x5f0baa){_0x4c8bfb['push'](_0x4c8bfb['shift']());}};_0x230ac7(++_0x216ded);}(_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 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']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index 7a95c6b..a6cdd63 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 _0xd5a0=['../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1c1401,_0x2ead41){var _0x11f2ad=function(_0xfc432){while(--_0xfc432){_0x1c1401['push'](_0x1c1401['shift']());}};_0x11f2ad(++_0x2ead41);}(_0xd5a0,0x158));var _0x0d5a=function(_0x500b40,_0x2b4ba1){_0x500b40=_0x500b40-0x0;var _0x24c0e5=_0xd5a0[_0x500b40];return _0x24c0e5;};'use strict';var multer=require(_0x0d5a('0x0'));var util=require(_0x0d5a('0x1'));var path=require(_0x0d5a('0x2'));var timeout=require(_0x0d5a('0x3'));var express=require(_0x0d5a('0x4'));var router=express[_0x0d5a('0x5')]();var fs_extra=require(_0x0d5a('0x6'));var auth=require(_0x0d5a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0d5a('0x8'));var controller=require(_0x0d5a('0x9'));router[_0x0d5a('0xa')]('/',auth[_0x0d5a('0xb')](),controller['sendUserNotification']);module[_0x0d5a('0xc')]=router; \ No newline at end of file +var _0x7e4d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1b3a0d,_0x409937){var _0x5d980b=function(_0x333ffb){while(--_0x333ffb){_0x1b3a0d['push'](_0x1b3a0d['shift']());}};_0x5d980b(++_0x409937);}(_0x7e4d,0x126));var _0xd7e4=function(_0x2dc084,_0x5a928a){_0x2dc084=_0x2dc084-0x0;var _0x53e1ca=_0x7e4d[_0x2dc084];return _0x53e1ca;};'use strict';var multer=require(_0xd7e4('0x0'));var util=require(_0xd7e4('0x1'));var path=require(_0xd7e4('0x2'));var timeout=require(_0xd7e4('0x3'));var express=require(_0xd7e4('0x4'));var router=express[_0xd7e4('0x5')]();var fs_extra=require(_0xd7e4('0x6'));var auth=require(_0xd7e4('0x7'));var interaction=require(_0xd7e4('0x8'));var config=require(_0xd7e4('0x9'));var controller=require(_0xd7e4('0xa'));router[_0xd7e4('0xb')]('/',auth[_0xd7e4('0xc')](),controller[_0xd7e4('0xd')]);module[_0xd7e4('0xe')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 69ea65a..a289e1f 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 _0x00a3=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x27f5de,_0x577080){var _0x484149=function(_0x7e9adb){while(--_0x7e9adb){_0x27f5de['push'](_0x27f5de['shift']());}};_0x484149(++_0x577080);}(_0x00a3,0x10d));var _0x300a=function(_0x4a6f1b,_0x45d811){_0x4a6f1b=_0x4a6f1b-0x0;var _0x31a1bd=_0x00a3[_0x4a6f1b];return _0x31a1bd;};'use strict';var Sequelize=require(_0x300a('0x0'));module[_0x300a('0x1')]={'body':{'type':Sequelize[_0x300a('0x2')]},'senderName':{'type':Sequelize[_0x300a('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x300a('0x3')]},'beep':{'type':Sequelize[_0x300a('0x4')]}}; \ No newline at end of file +var _0x5baf=['TEXT','STRING','sequelize'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x5baf,0x155));var _0xf5ba=function(_0x320373,_0x58db72){_0x320373=_0x320373-0x0;var _0x593e91=_0x5baf[_0x320373];return _0x593e91;};'use strict';var Sequelize=require(_0xf5ba('0x0'));module['exports']={'body':{'type':Sequelize[_0xf5ba('0x1')]},'senderName':{'type':Sequelize[_0xf5ba('0x2')]},'recipientsId':{'type':Sequelize[_0xf5ba('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f175028..22dc1f2 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 _0x45e8=['recipient','emit','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','queue','replace','Queue','ids','push','all','union','findOne','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','TemplateId','Sequelize','hasOwnProperty','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','forEach'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0x45e8,0x1b2));var _0x845e=function(_0xa132f9,_0x32f20d){_0xa132f9=_0xa132f9-0x0;var _0x342190=_0x45e8[_0xa132f9];return _0x342190;};'use strict';var emlformat=require(_0x845e('0x0'));var rimraf=require(_0x845e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x845e('0x2'));var rp=require(_0x845e('0x3'));var moment=require(_0x845e('0x4'));var BPromise=require(_0x845e('0x5'));var Mustache=require(_0x845e('0x6'));var util=require('util');var path=require(_0x845e('0x7'));var sox=require(_0x845e('0x8'));var csv=require(_0x845e('0x9'));var ejs=require(_0x845e('0xa'));var fs=require('fs');var fs_extra=require(_0x845e('0xb'));var _=require(_0x845e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x845e('0x9'));var querystring=require('querystring');var Papa=require(_0x845e('0xd'));var Redis=require(_0x845e('0xe'));var authService=require(_0x845e('0xf'));var qs=require(_0x845e('0x10'));var as=require(_0x845e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x845e('0x12'))(_0x845e('0x13'));var utils=require(_0x845e('0x14'));var config=require(_0x845e('0x15'));var licenseUtil=require(_0x845e('0x16'));var db=require(_0x845e('0x17'))['db'];config[_0x845e('0x18')]=_[_0x845e('0x19')](config['redis'],{'host':_0x845e('0x1a'),'port':0x18eb});var socket=require(_0x845e('0x1b'))(new Redis(config[_0x845e('0x18')]));require(_0x845e('0x1c'))[_0x845e('0x1d')](socket);function respondWithStatusCode(_0x1d0674,_0x1efd5b){_0x1efd5b=_0x1efd5b||0xcc;return function(_0x3f5d8a){if(_0x3f5d8a){return _0x1d0674[_0x845e('0x1e')](_0x1efd5b);}return _0x1d0674['status'](_0x1efd5b)[_0x845e('0x1f')]();};}function respondWithResult(_0x1b40c5,_0x5893d3){_0x5893d3=_0x5893d3||0xc8;return function(_0x55333e){if(_0x55333e){return _0x1b40c5[_0x845e('0x20')](_0x5893d3)[_0x845e('0x21')](_0x55333e);}};}function respondWithFilteredResult(_0x4c4276,_0x280d4c){return function(_0x3473cc){if(_0x3473cc){var _0x3f4c43=typeof _0x280d4c[_0x845e('0x22')]===_0x845e('0x23')&&typeof _0x280d4c['limit']===_0x845e('0x23');var _0x55a070=_0x3473cc[_0x845e('0x24')];var _0x3e5ed2=_0x3f4c43?0x0:_0x280d4c[_0x845e('0x22')];var _0x4842b4=_0x3f4c43?_0x3473cc[_0x845e('0x24')]:_0x280d4c[_0x845e('0x22')]+_0x280d4c[_0x845e('0x25')];var _0x428439;if(_0x4842b4>=_0x55a070){_0x4842b4=_0x55a070;_0x428439=0xc8;}else{_0x428439=0xce;}_0x4c4276[_0x845e('0x20')](_0x428439);return _0x4c4276[_0x845e('0x26')](_0x845e('0x27'),_0x3e5ed2+'-'+_0x4842b4+'/'+_0x55a070)[_0x845e('0x21')](_0x3473cc);}return null;};}function patchUpdates(_0x3639a2){return function(_0xac4a21){try{jsonpatch[_0x845e('0x28')](_0xac4a21,_0x3639a2,!![]);}catch(_0x43e243){return BPromise[_0x845e('0x29')](_0x43e243);}return _0xac4a21[_0x845e('0x2a')]();};}function saveUpdates(_0x23a02a,_0x5ef758){return function(_0x645b2e){if(_0x645b2e){return _0x645b2e[_0x845e('0x2b')](_0x23a02a)[_0x845e('0x2c')](function(_0xb9c6f7){return _0xb9c6f7;});}return null;};}function removeEntity(_0x58c53c,_0x4e0fe3){return function(_0x460c41){if(_0x460c41){return _0x460c41[_0x845e('0x2d')]()[_0x845e('0x2c')](function(){_0x58c53c[_0x845e('0x20')](0xcc)[_0x845e('0x1f')]();});}};}function handleEntityNotFound(_0xdb685b,_0x489a5b){return function(_0x10a620){if(!_0x10a620){_0xdb685b[_0x845e('0x1e')](0x194);}return _0x10a620;};}function handleError(_0x3ce64d,_0x10afe1){_0x10afe1=_0x10afe1||0x1f4;return function(_0x20d7f3){logger[_0x845e('0x2e')](_0x20d7f3[_0x845e('0x2f')]);if(_0x20d7f3[_0x845e('0x30')]){delete _0x20d7f3[_0x845e('0x30')];}_0x3ce64d['status'](_0x10afe1)[_0x845e('0x31')](_0x20d7f3);};}exports[_0x845e('0x32')]=function(_0x46768a,_0x3ccc47,_0xdc6552){if(!_0x46768a[_0x845e('0x33')]['hasOwnProperty']('text')&&!_0x46768a[_0x845e('0x33')]['hasOwnProperty'](_0x845e('0x34'))){throw new db[(_0x845e('0x35'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x46768a[_0x845e('0x33')]['hasOwnProperty'](_0x845e('0x34'))&&!_0x46768a[_0x845e('0x33')][_0x845e('0x36')](_0x845e('0x37'))){throw new db[(_0x845e('0x35'))][(_0x845e('0x38'))](_0x845e('0x39'));}if(!_0x46768a['body'][_0x845e('0x36')](_0x845e('0x3a'))){throw new db['Sequelize'][(_0x845e('0x38'))](_0x845e('0x3b'));}else{try{var _0x224a9c=JSON[_0x845e('0x3c')](_0x46768a['body'][_0x845e('0x3a')]);}catch(_0x259b72){logger['error'](_0x259b72);throw new db[(_0x845e('0x35'))]['ValidationError'](_0x845e('0x3d'));}var _0x279de6=[_0x845e('0x3e'),'faxqueue',_0x845e('0x3f'),_0x845e('0x40'),_0x845e('0x41'),_0x845e('0x42'),_0x845e('0x43'),_0x845e('0x44'),_0x845e('0x45')];if(_['some'](_0x224a9c,function(_0x86da81){return!_[_0x845e('0x46')](_0x279de6,_0x86da81[_0x845e('0x47')]['toLowerCase']());})){throw new db[(_0x845e('0x35'))][(_0x845e('0x38'))](_0x845e('0x48'));}}}var _0x15ea4c={};_0x15ea4c[_0x845e('0x49')]=_0x46768a[_0x845e('0x33')][_0x845e('0x36')](_0x845e('0x49'))?_0x46768a[_0x845e('0x33')][_0x845e('0x49')]:_0x46768a['user'][_0x845e('0x4a')];_0x15ea4c[_0x845e('0x4b')]=_[_0x845e('0x4c')](_0x46768a['body'][_0x845e('0x4b')])?null:_0x46768a[_0x845e('0x33')]['recipientsDescription'];_0x15ea4c[_0x845e('0x4d')]=_0x46768a[_0x845e('0x33')][_0x845e('0x4d')]||![];_0x15ea4c[_0x845e('0x4e')]=_0x46768a[_0x845e('0x45')]['id'];return getContent(_0x46768a[_0x845e('0x33')])[_0x845e('0x2c')](function(_0x513fcc){_0x15ea4c[_0x845e('0x33')]=_0x513fcc;return getRecipients(_0x224a9c);})['then'](function(_0x8e806e){_0x15ea4c['recipientsId']=_[_0x845e('0x4f')](_0x8e806e)[_0x845e('0x50')](',');return db[_0x845e('0x51')][_0x845e('0x52')](function(_0x4c5d1a){return db[_0x845e('0x53')][_0x845e('0x54')](_0x15ea4c,{'raw':!![],'transaction':_0x4c5d1a})[_0x845e('0x2c')](function(_0x1f8893){var _0x992635={'sender':_0x15ea4c[_0x845e('0x49')],'description':_0x15ea4c[_0x845e('0x4b')],'content':_0x15ea4c[_0x845e('0x33')],'beep':_0x15ea4c[_0x845e('0x4d')]};_0x8e806e[_0x845e('0x55')](function(_0x48354b){_0x992635[_0x845e('0x56')]=_0x48354b;socket[_0x845e('0x57')]('userNotification:send',_0x992635);});return _0x1f8893;});});})['then'](respondWithResult(_0x3ccc47,0xc9))['catch'](handleError(_0x3ccc47,null));};function getContent(_0x47380b){return new BPromise(function(_0x2c9089,_0x1b83ae){if(_0x47380b[_0x845e('0x58')]){_0x2c9089(_0x47380b[_0x845e('0x58')]);return;}return db[_0x845e('0x59')]['findOne']({'attributes':[_0x845e('0x5a')],'where':{'id':_0x47380b['TemplateId']},'raw':!![]})[_0x845e('0x2c')](function(_0x540d8d){if(!_0x540d8d)throw new db[(_0x845e('0x35'))][(_0x845e('0x38'))](_0x845e('0x5b'));var _0x2307e5=Mustache[_0x845e('0x5c')](_0x540d8d[_0x845e('0x5a')],_0x47380b[_0x845e('0x37')]);_0x2c9089(_0x2307e5);})[_0x845e('0x5d')](function(_0x52f4de){_0x1b83ae(_0x52f4de);});});}function getRecipients(_0x4210ff){return new BPromise(function(_0x46f65c,_0x5420ae){var _0x5c83ce=[];var _0x4d4c4c=[];_0x4210ff['forEach'](function(_0x51cc50){var _0x502532=_['startCase'](_0x51cc50[_0x845e('0x47')]['toLowerCase']());if(_0x502532==='User'){_0x5c83ce=_['union'](_0x5c83ce,_0x51cc50['ids']);}else{if(_[_0x845e('0x46')](_0x502532,_0x845e('0x5e')))_0x502532=_0x502532[_0x845e('0x5f')](_0x845e('0x5e'),_0x845e('0x60'));_0x51cc50[_0x845e('0x61')][_0x845e('0x55')](function(_0x3e50a5){_0x4d4c4c[_0x845e('0x62')](getAgents(_0x502532,_0x3e50a5));});}});return BPromise[_0x845e('0x63')](_0x4d4c4c)[_0x845e('0x2c')](function(_0x3c4603){_0x5c83ce=_[_0x845e('0x64')](_0x5c83ce,_['flatten'](_0x3c4603));_0x46f65c(_0x5c83ce);})[_0x845e('0x5d')](function(_0x3480ea){_0x5420ae(_0x3480ea);});});}function getAgents(_0x1856b1,_0x40b77d){return new BPromise(function(_0x516e91,_0x35b9e8){return db[_0x1856b1][_0x845e('0x65')]({'where':{'id':_0x40b77d}})[_0x845e('0x2c')](function(_0x179c9b){return _0x179c9b[_0x845e('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50444f){var _0x579769=_[_0x845e('0x67')](_0x50444f,'id');_0x516e91(_0x579769);});})[_0x845e('0x5d')](function(_0x39f56c){_0x35b9e8(_0x39f56c);});});} \ No newline at end of file +var _0x9af7=['recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','includes','queue','Queue','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','sortBy','join','sequelize','UserNotification','forEach'];(function(_0x56092a,_0x291ce5){var _0x1c9558=function(_0x5bf0c5){while(--_0x5bf0c5){_0x56092a['push'](_0x56092a['shift']());}};_0x1c9558(++_0x291ce5);}(_0x9af7,0xdc));var _0x79af=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9af7[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x79af('0x0'));var rimraf=require(_0x79af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79af('0x2'));var rp=require(_0x79af('0x3'));var moment=require(_0x79af('0x4'));var BPromise=require(_0x79af('0x5'));var Mustache=require(_0x79af('0x6'));var util=require(_0x79af('0x7'));var path=require(_0x79af('0x8'));var sox=require(_0x79af('0x9'));var csv=require(_0x79af('0xa'));var ejs=require(_0x79af('0xb'));var fs=require('fs');var fs_extra=require(_0x79af('0xc'));var _=require(_0x79af('0xd'));var squel=require(_0x79af('0xe'));var crypto=require('crypto');var jsforce=require(_0x79af('0xf'));var deskjs=require(_0x79af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x79af('0x11'));var Papa=require(_0x79af('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x79af('0x13'));var hardwareService=require(_0x79af('0x14'));var logger=require(_0x79af('0x15'))(_0x79af('0x16'));var utils=require(_0x79af('0x17'));var config=require(_0x79af('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x79af('0x19'))['db'];config[_0x79af('0x1a')]=_[_0x79af('0x1b')](config[_0x79af('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x79af('0x1c'))(new Redis(config[_0x79af('0x1a')]));require(_0x79af('0x1d'))[_0x79af('0x1e')](socket);function respondWithStatusCode(_0x2b56e0,_0x41271b){_0x41271b=_0x41271b||0xcc;return function(_0x2223ce){if(_0x2223ce){return _0x2b56e0[_0x79af('0x1f')](_0x41271b);}return _0x2b56e0[_0x79af('0x20')](_0x41271b)[_0x79af('0x21')]();};}function respondWithResult(_0x32f1b8,_0x309aa3){_0x309aa3=_0x309aa3||0xc8;return function(_0x370359){if(_0x370359){return _0x32f1b8[_0x79af('0x20')](_0x309aa3)[_0x79af('0x22')](_0x370359);}};}function respondWithFilteredResult(_0x258384,_0x36a4c4){return function(_0x503297){if(_0x503297){var _0x7bcc7b=typeof _0x36a4c4[_0x79af('0x23')]===_0x79af('0x24')&&typeof _0x36a4c4['limit']==='undefined';var _0x5d2d5e=_0x503297[_0x79af('0x25')];var _0x336e12=_0x7bcc7b?0x0:_0x36a4c4[_0x79af('0x23')];var _0xabb6c=_0x7bcc7b?_0x503297[_0x79af('0x25')]:_0x36a4c4[_0x79af('0x23')]+_0x36a4c4[_0x79af('0x26')];var _0xb7f93b;if(_0xabb6c>=_0x5d2d5e){_0xabb6c=_0x5d2d5e;_0xb7f93b=0xc8;}else{_0xb7f93b=0xce;}_0x258384[_0x79af('0x20')](_0xb7f93b);return _0x258384[_0x79af('0x27')]('Content-Range',_0x336e12+'-'+_0xabb6c+'/'+_0x5d2d5e)['json'](_0x503297);}return null;};}function patchUpdates(_0x2d1b78){return function(_0x6cf4d8){try{jsonpatch['apply'](_0x6cf4d8,_0x2d1b78,!![]);}catch(_0x44fb04){return BPromise[_0x79af('0x28')](_0x44fb04);}return _0x6cf4d8[_0x79af('0x29')]();};}function saveUpdates(_0x474eda,_0x1677db){return function(_0x5c24dc){if(_0x5c24dc){return _0x5c24dc[_0x79af('0x2a')](_0x474eda)[_0x79af('0x2b')](function(_0x5d0fdf){return _0x5d0fdf;});}return null;};}function removeEntity(_0x381edf,_0x28889d){return function(_0x1c6971){if(_0x1c6971){return _0x1c6971[_0x79af('0x2c')]()[_0x79af('0x2b')](function(){_0x381edf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7ff78d,_0x4d78bc){return function(_0x855291){if(!_0x855291){_0x7ff78d[_0x79af('0x1f')](0x194);}return _0x855291;};}function handleError(_0x9a7f71,_0x44796d){_0x44796d=_0x44796d||0x1f4;return function(_0x5c4d54){logger[_0x79af('0x2d')](_0x5c4d54[_0x79af('0x2e')]);if(_0x5c4d54[_0x79af('0x2f')]){delete _0x5c4d54['name'];}_0x9a7f71['status'](_0x44796d)['send'](_0x5c4d54);};}exports[_0x79af('0x30')]=function(_0x2b8cc2,_0x58c8a2,_0x468952){if(!_0x2b8cc2[_0x79af('0x31')][_0x79af('0x32')](_0x79af('0x33'))&&!_0x2b8cc2[_0x79af('0x31')][_0x79af('0x32')](_0x79af('0x34'))){throw new db[(_0x79af('0x35'))][(_0x79af('0x36'))](_0x79af('0x37'));}else{if(_0x2b8cc2[_0x79af('0x31')][_0x79af('0x32')](_0x79af('0x34'))&&!_0x2b8cc2[_0x79af('0x31')]['hasOwnProperty'](_0x79af('0x38'))){throw new db[(_0x79af('0x35'))][(_0x79af('0x36'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x2b8cc2['body'][_0x79af('0x32')](_0x79af('0x39'))){throw new db[(_0x79af('0x35'))][(_0x79af('0x36'))](_0x79af('0x3a'));}else{try{var _0xad7957=JSON[_0x79af('0x3b')](_0x2b8cc2['body'][_0x79af('0x39')]);}catch(_0x416d0d){logger['error'](_0x416d0d);throw new db[(_0x79af('0x35'))][(_0x79af('0x36'))](_0x79af('0x3c'));}var _0x3b7654=[_0x79af('0x3d'),_0x79af('0x3e'),_0x79af('0x3f'),_0x79af('0x40'),_0x79af('0x41'),_0x79af('0x42'),_0x79af('0x43'),_0x79af('0x44'),_0x79af('0x45')];if(_['some'](_0xad7957,function(_0x1314fc){return!_['includes'](_0x3b7654,_0x1314fc[_0x79af('0x46')][_0x79af('0x47')]());})){throw new db[(_0x79af('0x35'))]['ValidationError'](_0x79af('0x48'));}}}var _0x1c3ef2={};_0x1c3ef2[_0x79af('0x49')]=_0x2b8cc2[_0x79af('0x31')][_0x79af('0x32')]('senderName')?_0x2b8cc2[_0x79af('0x31')]['senderName']:_0x2b8cc2['user'][_0x79af('0x4a')];_0x1c3ef2[_0x79af('0x4b')]=_[_0x79af('0x4c')](_0x2b8cc2['body'][_0x79af('0x4b')])?null:_0x2b8cc2[_0x79af('0x31')][_0x79af('0x4b')];_0x1c3ef2[_0x79af('0x4d')]=_0x2b8cc2[_0x79af('0x31')][_0x79af('0x4d')]||![];_0x1c3ef2['SenderId']=_0x2b8cc2[_0x79af('0x45')]['id'];return getContent(_0x2b8cc2[_0x79af('0x31')])[_0x79af('0x2b')](function(_0x67b722){_0x1c3ef2['body']=_0x67b722;return getRecipients(_0xad7957);})[_0x79af('0x2b')](function(_0x5ee222){_0x1c3ef2['recipientsId']=_[_0x79af('0x4e')](_0x5ee222)[_0x79af('0x4f')](',');return db[_0x79af('0x50')]['transaction'](function(_0x12f3dc){return db[_0x79af('0x51')]['create'](_0x1c3ef2,{'raw':!![],'transaction':_0x12f3dc})[_0x79af('0x2b')](function(_0x3c0579){var _0x1522c2={'sender':_0x1c3ef2['senderName'],'description':_0x1c3ef2[_0x79af('0x4b')],'content':_0x1c3ef2[_0x79af('0x31')],'beep':_0x1c3ef2['beep']};_0x5ee222[_0x79af('0x52')](function(_0x233068){_0x1522c2[_0x79af('0x53')]=_0x233068;socket[_0x79af('0x54')](_0x79af('0x55'),_0x1522c2);});return _0x3c0579;});});})[_0x79af('0x2b')](respondWithResult(_0x58c8a2,0xc9))[_0x79af('0x56')](handleError(_0x58c8a2,null));};function getContent(_0x30f6f5){return new BPromise(function(_0x3899ac,_0x5b4423){if(_0x30f6f5[_0x79af('0x33')]){_0x3899ac(_0x30f6f5['text']);return;}return db[_0x79af('0x57')]['findOne']({'attributes':[_0x79af('0x58')],'where':{'id':_0x30f6f5[_0x79af('0x34')]},'raw':!![]})[_0x79af('0x2b')](function(_0x2a3053){if(!_0x2a3053)throw new db['Sequelize'][(_0x79af('0x36'))](_0x79af('0x59'));var _0x373f89=Mustache[_0x79af('0x5a')](_0x2a3053[_0x79af('0x58')],_0x30f6f5[_0x79af('0x38')]);_0x3899ac(_0x373f89);})['catch'](function(_0x50033b){_0x5b4423(_0x50033b);});});}function getRecipients(_0x3453d6){return new BPromise(function(_0x3b56ee,_0x5c8499){var _0x11b119=[];var _0x5cbe0f=[];_0x3453d6[_0x79af('0x52')](function(_0x3ee58f){var _0x3f1029=_[_0x79af('0x5b')](_0x3ee58f[_0x79af('0x46')][_0x79af('0x47')]());if(_0x3f1029===_0x79af('0x5c')){_0x11b119=_[_0x79af('0x5d')](_0x11b119,_0x3ee58f['ids']);}else{if(_[_0x79af('0x5e')](_0x3f1029,_0x79af('0x5f')))_0x3f1029=_0x3f1029['replace'](_0x79af('0x5f'),_0x79af('0x60'));_0x3ee58f['ids']['forEach'](function(_0xf34313){_0x5cbe0f[_0x79af('0x61')](getAgents(_0x3f1029,_0xf34313));});}});return BPromise[_0x79af('0x62')](_0x5cbe0f)[_0x79af('0x2b')](function(_0x5a2175){_0x11b119=_[_0x79af('0x5d')](_0x11b119,_['flatten'](_0x5a2175));_0x3b56ee(_0x11b119);})[_0x79af('0x56')](function(_0x57f347){_0x5c8499(_0x57f347);});});}function getAgents(_0x83e2b3,_0xeb236){return new BPromise(function(_0x4ea308,_0xb27d56){return db[_0x83e2b3]['findOne']({'where':{'id':_0xeb236}})['then'](function(_0x114394){return _0x114394[_0x79af('0x63')]({'attributes':['id'],'raw':!![]})[_0x79af('0x2b')](function(_0x153100){var _0xfc2f91=_[_0x79af('0x64')](_0x153100,'id');_0x4ea308(_0xfc2f91);});})[_0x79af('0x56')](function(_0x228bc2){_0xb27d56(_0x228bc2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index d4721e7..138a70f 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 _0xd044=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','save','update'];(function(_0x4eb591,_0x2b1807){var _0x5efd0a=function(_0x174a44){while(--_0x174a44){_0x4eb591['push'](_0x4eb591['shift']());}};_0x5efd0a(++_0x2b1807);}(_0xd044,0x1d1));var _0x4d04=function(_0x1e9761,_0x5be100){_0x1e9761=_0x1e9761-0x0;var _0x419f3e=_0xd044[_0x1e9761];return _0x419f3e;};'use strict';var EventEmitter=require(_0x4d04('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x4d04('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4d04('0x2')](0x0);var events={'afterCreate':_0x4d04('0x3'),'afterUpdate':_0x4d04('0x4'),'afterDestroy':_0x4d04('0x5')};function emitEvent(_0x37dd12){return function(_0x48dda6,_0x592e80,_0x6f61b7){UserNotificationEvents[_0x4d04('0x6')](_0x37dd12+':'+_0x48dda6['id'],_0x48dda6);UserNotificationEvents[_0x4d04('0x6')](_0x37dd12,_0x48dda6);_0x6f61b7(null);};}for(var e in events){if(events[_0x4d04('0x7')](e)){var event=events[e];UserNotification[_0x4d04('0x8')](e,emitEvent(event));}}module[_0x4d04('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x0bdf=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0x0bdf,0x134));var _0xf0bd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0bdf[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xf0bd('0x0'));var UserNotification=require(_0xf0bd('0x1'))['db'][_0xf0bd('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf0bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0bd('0x4')};function emitEvent(_0x2c7c6b){return function(_0x34ce3b,_0x341ebf,_0x6e1a8c){UserNotificationEvents[_0xf0bd('0x5')](_0x2c7c6b+':'+_0x34ce3b['id'],_0x34ce3b);UserNotificationEvents[_0xf0bd('0x5')](_0x2c7c6b,_0x34ce3b);_0x6e1a8c(null);};}for(var e in events){if(events[_0xf0bd('0x6')](e)){var event=events[e];UserNotification[_0xf0bd('0x7')](e,emitEvent(event));}}module[_0xf0bd('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index d27fe59..59baa6f 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 _0x153f=['../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16d6fa,_0xff299f){var _0x4a875e=function(_0x2d6f88){while(--_0x2d6f88){_0x16d6fa['push'](_0x16d6fa['shift']());}};_0x4a875e(++_0xff299f);}(_0x153f,0x10d));var _0xf153=function(_0x2e0507,_0x5406f7){_0x2e0507=_0x2e0507-0x0;var _0x3b3740=_0x153f[_0x2e0507];return _0x3b3740;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf153('0x7'));var attributes=require(_0xf153('0x8'));module['exports']=function(_0x24acac,_0x1693f1){return _0x24acac[_0xf153('0x9')]('UserNotification',attributes,{'tableName':_0xf153('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf153('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1fd0=['UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4c4413,_0x493fba){var _0x33ceec=function(_0x2daede){while(--_0x2daede){_0x4c4413['push'](_0x4c4413['shift']());}};_0x33ceec(++_0x493fba);}(_0x1fd0,0x1bd));var _0x01fd=function(_0xd0a0ae,_0x239a61){_0xd0a0ae=_0xd0a0ae-0x0;var _0x4da1a4=_0x1fd0[_0xd0a0ae];return _0x4da1a4;};'use strict';var _=require(_0x01fd('0x0'));var util=require(_0x01fd('0x1'));var logger=require(_0x01fd('0x2'))(_0x01fd('0x3'));var moment=require('moment');var BPromise=require(_0x01fd('0x4'));var rp=require(_0x01fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01fd('0x6'));var config=require(_0x01fd('0x7'));var attributes=require('./userNotification.attributes');module[_0x01fd('0x8')]=function(_0x1b787c,_0x4f0c8f){return _0x1b787c[_0x01fd('0x9')](_0x01fd('0xa'),attributes,{'tableName':_0x01fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01fd('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 4325d86..e4ab19b 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 _0x7952=['client','http','defaults','localhost','redis','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x32b9c0,_0xca1bd4){var _0x58bc4b=function(_0x356d76){while(--_0x356d76){_0x32b9c0['push'](_0x32b9c0['shift']());}};_0x58bc4b(++_0xca1bd4);}(_0x7952,0x11a));var _0x2795=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x7952[_0x810025];return _0x4dbc81;};'use strict';var _=require(_0x2795('0x0'));var util=require('util');var moment=require(_0x2795('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2795('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2795('0x3'))(_0x2795('0x4'));var config=require('../../config/environment');var jayson=require(_0x2795('0x5'));var client=jayson[_0x2795('0x6')][_0x2795('0x7')]({'port':0x232a});config['redis']=_[_0x2795('0x8')](config['redis'],{'host':_0x2795('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2795('0xa')]));require(_0x2795('0xb'))[_0x2795('0xc')](socket);function respondWithRpcPromise(_0x19a488,_0x44f85b,_0x22da2d){return new BPromise(function(_0x2c0352,_0x1f17be){return client[_0x2795('0xd')](_0x19a488,_0x22da2d)[_0x2795('0xe')](function(_0x21ae9b){logger['info'](_0x2795('0xf'),_0x44f85b,'request\x20sent');logger[_0x2795('0x10')](_0x2795('0x11'),_0x44f85b,_0x2795('0x12'),JSON[_0x2795('0x13')](_0x21ae9b));if(_0x21ae9b['error']){if(_0x21ae9b['error'][_0x2795('0x14')]===0x1f4){logger['error'](_0x2795('0xf'),_0x44f85b,_0x21ae9b[_0x2795('0x15')][_0x2795('0x16')]);return _0x1f17be(_0x21ae9b[_0x2795('0x15')][_0x2795('0x16')]);}logger[_0x2795('0x15')](_0x2795('0xf'),_0x44f85b,_0x21ae9b[_0x2795('0x15')][_0x2795('0x16')]);return _0x2c0352(_0x21ae9b[_0x2795('0x15')][_0x2795('0x16')]);}else{logger['info'](_0x2795('0xf'),_0x44f85b,_0x2795('0x12'));_0x2c0352(_0x21ae9b[_0x2795('0x17')][_0x2795('0x16')]);}})['catch'](function(_0x1a71fe){logger['error'](_0x2795('0xf'),_0x44f85b,_0x1a71fe);_0x1f17be(_0x1a71fe);});});} \ No newline at end of file +var _0x243b=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','request\x20sent','code','error','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x243b,0x103));var _0xb243=function(_0x53ba97,_0x3b286f){_0x53ba97=_0x53ba97-0x0;var _0x47045f=_0x243b[_0x53ba97];return _0x47045f;};'use strict';var _=require(_0xb243('0x0'));var util=require('util');var moment=require(_0xb243('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb243('0x2'))['db'];var utils=require(_0xb243('0x3'));var logger=require(_0xb243('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb243('0x5'));var client=jayson[_0xb243('0x6')]['http']({'port':0x232a});config[_0xb243('0x7')]=_[_0xb243('0x8')](config[_0xb243('0x7')],{'host':_0xb243('0x9'),'port':0x18eb});var socket=require(_0xb243('0xa'))(new Redis(config[_0xb243('0x7')]));require(_0xb243('0xb'))[_0xb243('0xc')](socket);function respondWithRpcPromise(_0x30d4c5,_0x1f1845,_0x1bc47a){return new BPromise(function(_0x7928ec,_0x524f28){return client[_0xb243('0xd')](_0x30d4c5,_0x1bc47a)['then'](function(_0x21c1cd){logger[_0xb243('0xe')]('UserNotification,\x20%s,\x20%s',_0x1f1845,_0xb243('0xf'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x1f1845,_0xb243('0xf'),JSON['stringify'](_0x21c1cd));if(_0x21c1cd['error']){if(_0x21c1cd['error'][_0xb243('0x10')]===0x1f4){logger[_0xb243('0x11')](_0xb243('0x12'),_0x1f1845,_0x21c1cd[_0xb243('0x11')]['message']);return _0x524f28(_0x21c1cd[_0xb243('0x11')][_0xb243('0x13')]);}logger[_0xb243('0x11')](_0xb243('0x12'),_0x1f1845,_0x21c1cd['error'][_0xb243('0x13')]);return _0x7928ec(_0x21c1cd[_0xb243('0x11')][_0xb243('0x13')]);}else{logger[_0xb243('0xe')](_0xb243('0x12'),_0x1f1845,_0xb243('0xf'));_0x7928ec(_0x21c1cd[_0xb243('0x14')][_0xb243('0x13')]);}})[_0xb243('0x15')](function(_0x4f4f6f){logger[_0xb243('0x11')](_0xb243('0x12'),_0x1f1845,_0x4f4f6f);_0x524f28(_0x4f4f6f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index dea8d33..5a93d81 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 _0xbaba=['register','length','userNotification:','save','update','emit','removeListener'];(function(_0x9e445e,_0x5252e6){var _0x494c61=function(_0x26e49a){while(--_0x26e49a){_0x9e445e['push'](_0x9e445e['shift']());}};_0x494c61(++_0x5252e6);}(_0xbaba,0x1a0));var _0xabab=function(_0xf00179,_0x941de5){_0xf00179=_0xf00179-0x0;var _0x3fe830=_0xbaba[_0xf00179];return _0x3fe830;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xabab('0x0'),'remove',_0xabab('0x1')];function createListener(_0x4d7296,_0x5076a6){return function(_0x24c81e){_0x5076a6[_0xabab('0x2')](_0x4d7296,_0x24c81e);};}function removeListener(_0x5e97e0,_0x536490){return function(){UserNotificationEvents[_0xabab('0x3')](_0x5e97e0,_0x536490);};}exports[_0xabab('0x4')]=function(_0x51e278){for(var _0x3a7da7=0x0,_0x4b1d92=events[_0xabab('0x5')];_0x3a7da7<_0x4b1d92;_0x3a7da7++){var _0x48437b=events[_0x3a7da7];var _0x15d8ce=createListener(_0xabab('0x6')+_0x48437b,_0x51e278);UserNotificationEvents['on'](_0x48437b,_0x15d8ce);}}; \ No newline at end of file +var _0x14dd=['userNotification:','./userNotification.events','save','remove','update','removeListener','length'];(function(_0x36113f,_0x46c8c){var _0x4c8bf7=function(_0x58213d){while(--_0x58213d){_0x36113f['push'](_0x36113f['shift']());}};_0x4c8bf7(++_0x46c8c);}(_0x14dd,0x1dd));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var UserNotificationEvents=require(_0xd14d('0x0'));var events=[_0xd14d('0x1'),_0xd14d('0x2'),_0xd14d('0x3')];function createListener(_0x25ffce,_0x5555e1){return function(_0x46ec05){_0x5555e1['emit'](_0x25ffce,_0x46ec05);};}function removeListener(_0x332d92,_0x4cdd5a){return function(){UserNotificationEvents[_0xd14d('0x4')](_0x332d92,_0x4cdd5a);};}exports['register']=function(_0x10cd8c){for(var _0x230169=0x0,_0x1d6ba3=events[_0xd14d('0x5')];_0x230169<_0x1d6ba3;_0x230169++){var _0x556580=events[_0x230169];var _0x59c490=createListener(_0xd14d('0x6')+_0x556580,_0x10cd8c);UserNotificationEvents['on'](_0x556580,_0x59c490);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5d2bb0a..c628012 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(_0x11731f,_0x2271b5){var _0x14587c=function(_0x31e014){while(--_0x31e014){_0x11731f['push'](_0x11731f['shift']());}};_0x14587c(++_0x2271b5);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x56e655,_0x4f1641){var _0x218e9c=function(_0x395952){while(--_0x395952){_0x56e655['push'](_0x56e655['shift']());}};_0x218e9c(++_0x4f1641);}(_0xe706,0xa3));var _0x6e70=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xe706[_0x1f5143];return _0x383a38;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e5e8041..6e864aa 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 _0x404f=['INTEGER','exports'];(function(_0x132a9f,_0x3b095f){var _0xbb6a2e=function(_0x5d2d5f){while(--_0x5d2d5f){_0x132a9f['push'](_0x132a9f['shift']());}};_0xbb6a2e(++_0x3b095f);}(_0x404f,0xf7));var _0xf404=function(_0xcd1765,_0x76fbe){_0xcd1765=_0xcd1765-0x0;var _0x154098=_0x404f[_0xcd1765];return _0x154098;};'use strict';var Sequelize=require('sequelize');module[_0xf404('0x0')]={'penalty':{'type':Sequelize[_0xf404('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x43b8=['sequelize','exports'];(function(_0x41dcab,_0x3cbe3e){var _0x592382=function(_0x86236e){while(--_0x86236e){_0x41dcab['push'](_0x41dcab['shift']());}};_0x592382(++_0x3cbe3e);}(_0x43b8,0x13c));var _0x843b=function(_0x1e660a,_0x5bb483){_0x1e660a=_0x1e660a-0x0;var _0x11507b=_0x43b8[_0x1e660a];return _0x11507b;};'use strict';var Sequelize=require(_0x843b('0x0'));module[_0x843b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index c7abb94..4533fd4 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 _0x6076=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x28fb41,_0x430664){var _0x47cc4d=function(_0x1ba3de){while(--_0x1ba3de){_0x28fb41['push'](_0x28fb41['shift']());}};_0x47cc4d(++_0x430664);}(_0x6076,0x9a));var _0x6607=function(_0x132af9,_0x5596df){_0x132af9=_0x132af9-0x0;var _0xdffe96=_0x6076[_0x132af9];return _0xdffe96;};'use strict';var _=require(_0x6607('0x0'));var util=require(_0x6607('0x1'));var logger=require(_0x6607('0x2'))(_0x6607('0x3'));var moment=require(_0x6607('0x4'));var BPromise=require(_0x6607('0x5'));var rp=require(_0x6607('0x6'));var fs=require('fs');var path=require(_0x6607('0x7'));var rimraf=require(_0x6607('0x8'));var config=require(_0x6607('0x9'));var attributes=require(_0x6607('0xa'));module[_0x6607('0xb')]=function(_0x5ef8ce,_0x54a62b){return _0x5ef8ce['define'](_0x6607('0xc'),attributes,{'tableName':_0x6607('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24dc=['moment','bluebird','request-promise','path','rimraf','exports','UserOpenchannelQueue','util','../../config/logger'];(function(_0x4be30e,_0x5f34ba){var _0x24fd1e=function(_0x2c1784){while(--_0x2c1784){_0x4be30e['push'](_0x4be30e['shift']());}};_0x24fd1e(++_0x5f34ba);}(_0x24dc,0x15d));var _0xc24d=function(_0x226d0e,_0x5682cc){_0x226d0e=_0x226d0e-0x0;var _0x14f1f8=_0x24dc[_0x226d0e];return _0x14f1f8;};'use strict';var _=require('lodash');var util=require(_0xc24d('0x0'));var logger=require(_0xc24d('0x1'))('api');var moment=require(_0xc24d('0x2'));var BPromise=require(_0xc24d('0x3'));var rp=require(_0xc24d('0x4'));var fs=require('fs');var path=require(_0xc24d('0x5'));var rimraf=require(_0xc24d('0x6'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0xc24d('0x7')]=function(_0x25edf0,_0x176374){return _0x25edf0['define'](_0xc24d('0x8'),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 7b5518d..745b75a 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 _0xcbed=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x443d8a,_0x37160d){var _0x464194=function(_0x409a7e){while(--_0x409a7e){_0x443d8a['push'](_0x443d8a['shift']());}};_0x464194(++_0x37160d);}(_0xcbed,0x17f));var _0xdcbe=function(_0x312164,_0x176af4){_0x312164=_0x312164-0x0;var _0x2b56ba=_0xcbed[_0x312164];return _0x2b56ba;};'use strict';var _=require(_0xdcbe('0x0'));var util=require(_0xdcbe('0x1'));var moment=require(_0xdcbe('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcbe('0x3'));var fs=require('fs');var Redis=require(_0xdcbe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcbe('0x5'));var logger=require(_0xdcbe('0x6'))(_0xdcbe('0x7'));var config=require(_0xdcbe('0x8'));var jayson=require(_0xdcbe('0x9'));var client=jayson[_0xdcbe('0xa')][_0xdcbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6adbc1,_0x175ca2,_0x44f7e3){return new BPromise(function(_0x301f34,_0x1136f0){return client[_0xdcbe('0xc')](_0x6adbc1,_0x44f7e3)[_0xdcbe('0xd')](function(_0xda81){logger[_0xdcbe('0xe')](_0xdcbe('0xf'),_0x175ca2,_0xdcbe('0x10'));logger[_0xdcbe('0x11')](_0xdcbe('0x12'),_0x175ca2,_0xdcbe('0x10'),JSON[_0xdcbe('0x13')](_0xda81));if(_0xda81[_0xdcbe('0x14')]){if(_0xda81['error'][_0xdcbe('0x15')]===0x1f4){logger[_0xdcbe('0x14')](_0xdcbe('0xf'),_0x175ca2,_0xda81[_0xdcbe('0x14')][_0xdcbe('0x16')]);return _0x1136f0(_0xda81[_0xdcbe('0x14')]['message']);}logger['error'](_0xdcbe('0xf'),_0x175ca2,_0xda81[_0xdcbe('0x14')][_0xdcbe('0x16')]);return _0x301f34(_0xda81[_0xdcbe('0x14')][_0xdcbe('0x16')]);}else{logger[_0xdcbe('0xe')](_0xdcbe('0xf'),_0x175ca2,_0xdcbe('0x10'));_0x301f34(_0xda81['result']['message']);}})[_0xdcbe('0x17')](function(_0x57fb7b){logger[_0xdcbe('0x14')](_0xdcbe('0xf'),_0x175ca2,_0x57fb7b);_0x1136f0(_0x57fb7b);});});} \ No newline at end of file +var _0x25cf=['error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2ea8f8,_0x434b24){var _0x2fe4d7=function(_0x64fe62){while(--_0x64fe62){_0x2ea8f8['push'](_0x2ea8f8['shift']());}};_0x2fe4d7(++_0x434b24);}(_0x25cf,0x117));var _0xf25c=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x25cf[_0x4bc4c8];return _0x3bb121;};'use strict';var _=require(_0xf25c('0x0'));var util=require(_0xf25c('0x1'));var moment=require(_0xf25c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf25c('0x3'));var fs=require('fs');var Redis=require(_0xf25c('0x4'));var db=require(_0xf25c('0x5'))['db'];var utils=require(_0xf25c('0x6'));var logger=require(_0xf25c('0x7'))('rpc');var config=require(_0xf25c('0x8'));var jayson=require(_0xf25c('0x9'));var client=jayson[_0xf25c('0xa')][_0xf25c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49d43c,_0x27908f,_0x4f206b){return new BPromise(function(_0x4d3e3c,_0x3535d2){return client['request'](_0x49d43c,_0x4f206b)['then'](function(_0x3e9b46){logger[_0xf25c('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x27908f,_0xf25c('0xd'));logger['debug'](_0xf25c('0xe'),_0x27908f,_0xf25c('0xd'),JSON['stringify'](_0x3e9b46));if(_0x3e9b46[_0xf25c('0xf')]){if(_0x3e9b46['error'][_0xf25c('0x10')]===0x1f4){logger[_0xf25c('0xf')](_0xf25c('0x11'),_0x27908f,_0x3e9b46[_0xf25c('0xf')]['message']);return _0x3535d2(_0x3e9b46['error'][_0xf25c('0x12')]);}logger[_0xf25c('0xf')](_0xf25c('0x11'),_0x27908f,_0x3e9b46[_0xf25c('0xf')][_0xf25c('0x12')]);return _0x4d3e3c(_0x3e9b46[_0xf25c('0xf')][_0xf25c('0x12')]);}else{logger[_0xf25c('0xc')](_0xf25c('0x11'),_0x27908f,_0xf25c('0xd'));_0x4d3e3c(_0x3e9b46[_0xf25c('0x13')][_0xf25c('0x12')]);}})[_0xf25c('0x14')](function(_0x135a3c){logger[_0xf25c('0xf')](_0xf25c('0x11'),_0x27908f,_0x135a3c);_0x3535d2(_0x135a3c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8ddf3f7..6d44298 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 _0xba25=['/:id/resources','getResources','post','create','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','getSections'];(function(_0x32862d,_0x288aa1){var _0x3ad761=function(_0x8186a){while(--_0x8186a){_0x32862d['push'](_0x32862d['shift']());}};_0x3ad761(++_0x288aa1);}(_0xba25,0x194));var _0x5ba2=function(_0x2c0e52,_0x4d663d){_0x2c0e52=_0x2c0e52-0x0;var _0x43508c=_0xba25[_0x2c0e52];return _0x43508c;};'use strict';var multer=require('multer');var util=require(_0x5ba2('0x0'));var path=require(_0x5ba2('0x1'));var timeout=require(_0x5ba2('0x2'));var express=require(_0x5ba2('0x3'));var router=express[_0x5ba2('0x4')]();var fs_extra=require(_0x5ba2('0x5'));var auth=require(_0x5ba2('0x6'));var interaction=require(_0x5ba2('0x7'));var config=require(_0x5ba2('0x8'));var controller=require('./userProfile.controller');router[_0x5ba2('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ba2('0xa')]);router[_0x5ba2('0x9')]('/describe',auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xc')]);router[_0x5ba2('0x9')](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xe')]);router['get']('/:id/sections',auth['isAuthenticated'](),controller[_0x5ba2('0xf')]);router['get'](_0x5ba2('0x10'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x11')]);router[_0x5ba2('0x12')]('/',auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x13')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x5ba2('0x14')]);router[_0x5ba2('0x12')](_0x5ba2('0x15'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x16')]);router['post'](_0x5ba2('0x10'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x17')]);router[_0x5ba2('0x18')](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x19')]);router[_0x5ba2('0x1a')](_0x5ba2('0xd'),auth['isAuthenticated'](),controller[_0x5ba2('0x1b')]);router[_0x5ba2('0x1a')](_0x5ba2('0x15'),auth[_0x5ba2('0xb')](),controller['removeSections']);router[_0x5ba2('0x1a')](_0x5ba2('0x10'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x1c')]);module[_0x5ba2('0x1d')]=router; \ No newline at end of file +var _0xc07a=['create','/:id/clone','clone','addSections','addResources','put','update','delete','removeSections','exports','multer','util','express','Router','fs-extra','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','/:id/resources','post'];(function(_0x4f638d,_0x3b790f){var _0x1d74e1=function(_0x445fef){while(--_0x445fef){_0x4f638d['push'](_0x4f638d['shift']());}};_0x1d74e1(++_0x3b790f);}(_0xc07a,0x15c));var _0xac07=function(_0x3c2421,_0x5dcf45){_0x3c2421=_0x3c2421-0x0;var _0x1ae11a=_0xc07a[_0x3c2421];return _0x1ae11a;};'use strict';var multer=require(_0xac07('0x0'));var util=require(_0xac07('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac07('0x2'));var router=express[_0xac07('0x3')]();var fs_extra=require(_0xac07('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac07('0x5'));var controller=require(_0xac07('0x6'));router[_0xac07('0x7')]('/',auth[_0xac07('0x8')](),controller[_0xac07('0x9')]);router[_0xac07('0x7')](_0xac07('0xa'),auth['isAuthenticated'](),controller[_0xac07('0xb')]);router[_0xac07('0x7')](_0xac07('0xc'),auth[_0xac07('0x8')](),controller['show']);router[_0xac07('0x7')](_0xac07('0xd'),auth['isAuthenticated'](),controller['getSections']);router[_0xac07('0x7')](_0xac07('0xe'),auth[_0xac07('0x8')](),controller['getResources']);router[_0xac07('0xf')]('/',auth[_0xac07('0x8')](),controller[_0xac07('0x10')]);router['post'](_0xac07('0x11'),auth[_0xac07('0x8')](),controller[_0xac07('0x12')]);router['post'](_0xac07('0xd'),auth['isAuthenticated'](),controller[_0xac07('0x13')]);router['post'](_0xac07('0xe'),auth[_0xac07('0x8')](),controller[_0xac07('0x14')]);router[_0xac07('0x15')](_0xac07('0xc'),auth[_0xac07('0x8')](),controller[_0xac07('0x16')]);router[_0xac07('0x17')]('/:id',auth[_0xac07('0x8')](),controller['destroy']);router[_0xac07('0x17')](_0xac07('0xd'),auth[_0xac07('0x8')](),controller[_0xac07('0x18')]);router[_0xac07('0x17')]('/:id/resources',auth[_0xac07('0x8')](),controller['removeResources']);module[_0xac07('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 60944e3..b52a9ae 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 _0xa3f7=['name','setDataValue','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x4ba234,_0x2d0e87){var _0x590f3f=function(_0x45d269){while(--_0x45d269){_0x4ba234['push'](_0x4ba234['shift']());}};_0x590f3f(++_0x2d0e87);}(_0xa3f7,0x19b));var _0x7a3f=function(_0x5b01c5,_0x2be704){_0x5b01c5=_0x5b01c5-0x0;var _0x160a82=_0xa3f7[_0x5b01c5];return _0x160a82;};'use strict';var Sequelize=require(_0x7a3f('0x0'));module[_0x7a3f('0x1')]={'name':{'type':Sequelize[_0x7a3f('0x2')],'allowNull':![],'unique':_0x7a3f('0x3')},'crudPermissions':{'type':Sequelize[_0x7a3f('0x2')],'set':function(_0x14e52f){this[_0x7a3f('0x4')]('crudPermissions',_0x14e52f?_0x14e52f['join'](''):[]);},'get':function(){return this[_0x7a3f('0x5')]('crudPermissions')?this['getDataValue'](_0x7a3f('0x6'))[_0x7a3f('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7a3f('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7a3f('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9528=['crudPermissions','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x5a57a1,_0x4156a8){var _0x50b785=function(_0x5278bc){while(--_0x5278bc){_0x5a57a1['push'](_0x5a57a1['shift']());}};_0x50b785(++_0x4156a8);}(_0x9528,0x75));var _0x8952=function(_0x1eb4c1,_0x5d38d3){_0x1eb4c1=_0x1eb4c1-0x0;var _0x201233=_0x9528[_0x1eb4c1];return _0x201233;};'use strict';var Sequelize=require('sequelize');module[_0x8952('0x0')]={'name':{'type':Sequelize[_0x8952('0x1')],'allowNull':![],'unique':_0x8952('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x56c1ab){this['setDataValue'](_0x8952('0x3'),_0x56c1ab?_0x56c1ab[_0x8952('0x4')](''):[]);},'get':function(){return this[_0x8952('0x5')](_0x8952('0x3'))?this['getDataValue']('crudPermissions')[_0x8952('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8952('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8952('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8952('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8952('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8952('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8952('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 85f26b2..2c8043c 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 _0x453d=['count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','filters','intersection','query','fields','attributes','length','nolimit','order','where','pick','filter','type','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','show','keys','merge','find','catch','create','body','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','params','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','destroy','removeSections','ids','includes','enabled','subsections','concat','Dashboard','forEach','push','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','register','sendStatus','status','end','offset','limit','undefined'];(function(_0x1ace26,_0x3466db){var _0x4d04a6=function(_0x12e883){while(--_0x12e883){_0x1ace26['push'](_0x1ace26['shift']());}};_0x4d04a6(++_0x3466db);}(_0x453d,0xc1));var _0xd453=function(_0x1ff6c9,_0x11592d){_0x1ff6c9=_0x1ff6c9-0x0;var _0x31cd52=_0x453d[_0x1ff6c9];return _0x31cd52;};'use strict';var emlformat=require(_0xd453('0x0'));var rimraf=require(_0xd453('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd453('0x2'));var rp=require(_0xd453('0x3'));var moment=require(_0xd453('0x4'));var BPromise=require(_0xd453('0x5'));var Mustache=require('mustache');var util=require(_0xd453('0x6'));var path=require('path');var sox=require(_0xd453('0x7'));var csv=require('to-csv');var ejs=require(_0xd453('0x8'));var fs=require('fs');var fs_extra=require(_0xd453('0x9'));var _=require('lodash');var squel=require(_0xd453('0xa'));var crypto=require('crypto');var jsforce=require(_0xd453('0xb'));var deskjs=require(_0xd453('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd453('0xd'));var Papa=require(_0xd453('0xe'));var Redis=require(_0xd453('0xf'));var authService=require(_0xd453('0x10'));var qs=require(_0xd453('0x11'));var as=require(_0xd453('0x12'));var hardwareService=require(_0xd453('0x13'));var logger=require('../../config/logger')(_0xd453('0x14'));var utils=require(_0xd453('0x15'));var config=require(_0xd453('0x16'));var licenseUtil=require(_0xd453('0x17'));var db=require(_0xd453('0x18'))['db'];config[_0xd453('0x19')]=_[_0xd453('0x1a')](config[_0xd453('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd453('0x19')]));require(_0xd453('0x1b'))[_0xd453('0x1c')](socket);function respondWithStatusCode(_0x58589a,_0x38a6a5){_0x38a6a5=_0x38a6a5||0xcc;return function(_0x1a87e2){if(_0x1a87e2){return _0x58589a[_0xd453('0x1d')](_0x38a6a5);}return _0x58589a[_0xd453('0x1e')](_0x38a6a5)[_0xd453('0x1f')]();};}function respondWithResult(_0x3d4b7d,_0x41c800){_0x41c800=_0x41c800||0xc8;return function(_0x563a07){if(_0x563a07){return _0x3d4b7d[_0xd453('0x1e')](_0x41c800)['json'](_0x563a07);}};}function respondWithFilteredResult(_0x571150,_0x57b222){return function(_0x5920f1){if(_0x5920f1){var _0x273e41=typeof _0x57b222[_0xd453('0x20')]==='undefined'&&typeof _0x57b222[_0xd453('0x21')]===_0xd453('0x22');var _0xfd312a=_0x5920f1[_0xd453('0x23')];var _0x1d1b09=_0x273e41?0x0:_0x57b222[_0xd453('0x20')];var _0x220e2d=_0x273e41?_0x5920f1[_0xd453('0x23')]:_0x57b222['offset']+_0x57b222['limit'];var _0x4952fa;if(_0x220e2d>=_0xfd312a){_0x220e2d=_0xfd312a;_0x4952fa=0xc8;}else{_0x4952fa=0xce;}_0x571150[_0xd453('0x1e')](_0x4952fa);return _0x571150[_0xd453('0x24')](_0xd453('0x25'),_0x1d1b09+'-'+_0x220e2d+'/'+_0xfd312a)['json'](_0x5920f1);}return null;};}function patchUpdates(_0x25968a){return function(_0x5447bb){try{jsonpatch[_0xd453('0x26')](_0x5447bb,_0x25968a,!![]);}catch(_0x11dd36){return BPromise[_0xd453('0x27')](_0x11dd36);}return _0x5447bb[_0xd453('0x28')]();};}function saveUpdates(_0x2a1839,_0x5323f6){return function(_0x413f9e){if(_0x413f9e){return _0x413f9e[_0xd453('0x29')](_0x2a1839)[_0xd453('0x2a')](function(_0x44c62e){return _0x44c62e;});}return null;};}function removeEntity(_0x3e4cee,_0x3c329e){return function(_0x2f736f){if(_0x2f736f){return _0x2f736f['destroy']()[_0xd453('0x2a')](function(){_0x3e4cee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18365d,_0x5edeea){return function(_0x504c46){if(!_0x504c46){_0x18365d[_0xd453('0x1d')](0x194);}return _0x504c46;};}function handleError(_0x5d2c24,_0x4406f6){_0x4406f6=_0x4406f6||0x1f4;return function(_0x115eee){logger[_0xd453('0x2b')](_0x115eee[_0xd453('0x2c')]);if(_0x115eee[_0xd453('0x2d')]){delete _0x115eee[_0xd453('0x2d')];}_0x5d2c24[_0xd453('0x1e')](_0x4406f6)[_0xd453('0x2e')](_0x115eee);};}exports[_0xd453('0x2f')]=function(_0x271a11,_0x5ee453){var _0x19caa3={},_0x56630d={},_0x29760e={'count':0x0,'rows':[]};var _0x5775b3=_[_0xd453('0x30')](db['UserProfile'][_0xd453('0x31')],function(_0x471c3c){return{'name':_0x471c3c[_0xd453('0x32')],'type':_0x471c3c['type']['key']};});_0x56630d[_0xd453('0x33')]=_[_0xd453('0x30')](_0x5775b3,_0xd453('0x2d'));_0x56630d['query']=_['keys'](_0x271a11['query']);_0x56630d[_0xd453('0x34')]=_[_0xd453('0x35')](_0x56630d['model'],_0x56630d['query']);_0x19caa3['attributes']=_['intersection'](_0x56630d[_0xd453('0x33')],qs['fields'](_0x271a11[_0xd453('0x36')][_0xd453('0x37')]));_0x19caa3['attributes']=_0x19caa3[_0xd453('0x38')][_0xd453('0x39')]?_0x19caa3[_0xd453('0x38')]:_0x56630d[_0xd453('0x33')];if(!_0x271a11[_0xd453('0x36')]['hasOwnProperty'](_0xd453('0x3a'))){_0x19caa3[_0xd453('0x21')]=qs[_0xd453('0x21')](_0x271a11[_0xd453('0x36')][_0xd453('0x21')]);_0x19caa3[_0xd453('0x20')]=qs[_0xd453('0x20')](_0x271a11[_0xd453('0x36')][_0xd453('0x20')]);}_0x19caa3[_0xd453('0x3b')]=qs['sort'](_0x271a11[_0xd453('0x36')]['sort']);_0x19caa3[_0xd453('0x3c')]=qs[_0xd453('0x34')](_[_0xd453('0x3d')](_0x271a11[_0xd453('0x36')],_0x56630d[_0xd453('0x34')]),_0x5775b3);if(_0x271a11[_0xd453('0x36')][_0xd453('0x3e')]){_0x19caa3['where']=_['merge'](_0x19caa3[_0xd453('0x3c')],{'$or':_[_0xd453('0x30')](_0x5775b3,function(_0x2a7aa5){if(_0x2a7aa5[_0xd453('0x3f')]!==_0xd453('0x40')){var _0x20504a={};_0x20504a[_0x2a7aa5[_0xd453('0x2d')]]={'$like':'%'+_0x271a11[_0xd453('0x36')][_0xd453('0x3e')]+'%'};return _0x20504a;}})});}_0x19caa3=_['merge']({},_0x19caa3,_0x271a11[_0xd453('0x41')]);var _0x317022={'where':_0x19caa3[_0xd453('0x3c')]};return db[_0xd453('0x42')]['count'](_0x317022)['then'](function(_0x451518){_0x29760e[_0xd453('0x23')]=_0x451518;if(_0x271a11[_0xd453('0x36')][_0xd453('0x43')]){_0x19caa3[_0xd453('0x44')]=[{'all':!![]}];}return db['UserProfile'][_0xd453('0x45')](_0x19caa3);})[_0xd453('0x2a')](function(_0x291de2){_0x29760e[_0xd453('0x46')]=_0x291de2;return _0x29760e;})['then'](respondWithFilteredResult(_0x5ee453,_0x19caa3))['catch'](handleError(_0x5ee453,null));};exports[_0xd453('0x47')]=function(_0x132913,_0x26a680){var _0x1367fe={'raw':![],'where':{'id':_0x132913['params']['id']}},_0x7957a1={};_0x7957a1['model']=_[_0xd453('0x48')](db['UserProfile'][_0xd453('0x31')]);_0x7957a1[_0xd453('0x36')]=_['keys'](_0x132913[_0xd453('0x36')]);_0x7957a1[_0xd453('0x34')]=_[_0xd453('0x35')](_0x7957a1['model'],_0x7957a1[_0xd453('0x36')]);_0x1367fe[_0xd453('0x38')]=_[_0xd453('0x35')](_0x7957a1['model'],qs[_0xd453('0x37')](_0x132913[_0xd453('0x36')][_0xd453('0x37')]));_0x1367fe['attributes']=_0x1367fe[_0xd453('0x38')]['length']?_0x1367fe[_0xd453('0x38')]:_0x7957a1[_0xd453('0x33')];if(_0x132913['query'][_0xd453('0x43')]){_0x1367fe[_0xd453('0x44')]=[{'all':!![]}];}_0x1367fe=_[_0xd453('0x49')]({},_0x1367fe,_0x132913[_0xd453('0x41')]);return db['UserProfile'][_0xd453('0x4a')](_0x1367fe)[_0xd453('0x2a')](handleEntityNotFound(_0x26a680,null))['then'](respondWithResult(_0x26a680,null))[_0xd453('0x4b')](handleError(_0x26a680,null));};exports[_0xd453('0x4c')]=function(_0x5be1b6,_0x5a79d3){return db[_0xd453('0x42')][_0xd453('0x4c')](_0x5be1b6[_0xd453('0x4d')],{})['then'](respondWithResult(_0x5a79d3,0xc9))[_0xd453('0x4b')](handleError(_0x5a79d3,null));};exports['clone']=function(_0x4c647f,_0x441316){var _0x4092de={'where':{'id':_0x4c647f['params']['id']}},_0x456e95={};_0x456e95['model']=_['keys'](db[_0xd453('0x42')][_0xd453('0x31')]);_0x4092de[_0xd453('0x38')]=_[_0xd453('0x35')](_0x456e95[_0xd453('0x33')],qs[_0xd453('0x37')](_0x4c647f[_0xd453('0x36')][_0xd453('0x37')]));_0x4092de['attributes']=_0x4092de[_0xd453('0x38')][_0xd453('0x39')]?_0x4092de[_0xd453('0x38')]:_0x456e95['model'];if(_0x4c647f['query'][_0xd453('0x43')]){_0x4092de[_0xd453('0x44')]=[{'all':!![]}];}_0x4092de=_[_0xd453('0x49')]({},_0x4092de,_0x4c647f[_0xd453('0x41')]);return db[_0xd453('0x42')][_0xd453('0x4a')](_0x4092de)[_0xd453('0x2a')](handleEntityNotFound(_0x441316,null))[_0xd453('0x2a')](function(_0x104d29){if(_0x104d29){var _0x524808=_0x104d29[_0xd453('0x4e')]({'plain':!![]});_0x524808=qs[_0xd453('0x4f')](_0x524808,['id','createdAt',_0xd453('0x50'),_0xd453('0x51')]);_0x4c647f[_0xd453('0x4d')]=_[_0xd453('0x4f')](_0x4c647f[_0xd453('0x4d')],['id',_0xd453('0x52'),_0xd453('0x50')]);return db[_0xd453('0x53')][_0xd453('0x54')](function(_0x360ec2){return db['UserProfile'][_0xd453('0x4c')](_[_0xd453('0x49')](_0x524808,_0x4c647f[_0xd453('0x4d')]),{'include':_0x4c647f['query'][_0xd453('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x360ec2})[_0xd453('0x2a')](function(_0x553c26){var _0x5c5470=_0x553c26[_0xd453('0x4e')]({'plain':!![]});return db[_0xd453('0x55')]['findAll']({'where':{'userProfileId':_0x4c647f[_0xd453('0x56')]['id']},'raw':!![]})['then'](function(_0x168b5f){if(_0x168b5f){return BPromise['each'](_0x168b5f,function(_0xd98cc9){return new BPromise(function(_0x3b579a,_0x21f161){if(_0xd98cc9[_0xd453('0x57')]===null||_0xd98cc9[_0xd453('0x57')]===0x1)_0x3b579a(null);return db['UserProfileResource'][_0xd453('0x45')]({'where':{'sectionId':_0xd98cc9['id']},'raw':!![]})[_0xd453('0x2a')](function(_0x596996){var _0x449ea4=_[_0xd453('0x30')](_0x596996,function(_0x44354c){return qs[_0xd453('0x4f')](_0x44354c,['id',_0xd453('0x52'),_0xd453('0x50'),_0xd453('0x58')]);});_0x3b579a(_0x449ea4);})[_0xd453('0x4b')](function(_0x3413f0){_0x21f161(_0x3413f0);});})['then'](function(_0x60c0e2){var _0x57d12b=qs[_0xd453('0x4f')](_0xd98cc9,['id',_0xd453('0x52'),_0xd453('0x50')]);_0x57d12b[_0xd453('0x59')]=_0x5c5470['id'];if(_0x60c0e2)_0x57d12b[_0xd453('0x5a')]=_0x60c0e2;return _0x57d12b;})[_0xd453('0x2a')](function(_0x192cdf){return db[_0xd453('0x55')]['create'](_0x192cdf,{'include':[{'model':db[_0xd453('0x5b')],'as':_0xd453('0x5a')}],'raw':!![],'transaction':_0x360ec2});});})[_0xd453('0x2a')](function(){return _0x5c5470;});}});});});}})[_0xd453('0x2a')](respondWithResult(_0x441316,0xc9))[_0xd453('0x4b')](handleError(_0x441316,null));};exports[_0xd453('0x29')]=function(_0x1830e7,_0x25b988){if(_0x1830e7[_0xd453('0x4d')]['id']){delete _0x1830e7['body']['id'];}return db[_0xd453('0x42')]['find']({'where':{'id':_0x1830e7[_0xd453('0x56')]['id']}})[_0xd453('0x2a')](handleEntityNotFound(_0x25b988,null))['then'](saveUpdates(_0x1830e7[_0xd453('0x4d')],null))[_0xd453('0x2a')](respondWithResult(_0x25b988,null))[_0xd453('0x4b')](handleError(_0x25b988,null));};exports['destroy']=function(_0x195710,_0x333643){return db['UserProfile']['find']({'where':{'id':_0x195710[_0xd453('0x56')]['id']}})[_0xd453('0x2a')](handleEntityNotFound(_0x333643,null))[_0xd453('0x2a')](removeEntity(_0x333643,null))['catch'](handleError(_0x333643,null));};exports[_0xd453('0x5c')]=function(_0x2b233d,_0x4d1fcb){return db[_0xd453('0x42')][_0xd453('0x5c')]()[_0xd453('0x2a')](respondWithResult(_0x4d1fcb,null))[_0xd453('0x4b')](handleError(_0x4d1fcb,null));};exports[_0xd453('0x5d')]=function(_0x49f431,_0x4aaa61){var _0x325c1f=_0x49f431[_0xd453('0x4d')];return db['UserProfile']['find']({'where':{'id':_0x49f431['params']['id']}})[_0xd453('0x2a')](handleEntityNotFound(_0x4aaa61,null))[_0xd453('0x2a')](function(_0x137c40){if(_0x137c40){return db['sequelize'][_0xd453('0x54')](function(_0x449a84){return db[_0xd453('0x55')][_0xd453('0x5e')]({'where':{'userProfileId':_0x49f431[_0xd453('0x56')]['id'],'sectionId':_['map'](_0x325c1f,function(_0x1eb9e6){return _0x1eb9e6[_0xd453('0x58')];})},'transaction':_0x449a84})['then'](function(){var _0x340a69=_[_0xd453('0x30')](_0x325c1f,function(_0xb3680a){_0xb3680a[_0xd453('0x59')]=_0x49f431['params']['id'];return _0xb3680a;});var _0x488377=[];return BPromise['each'](_0x340a69,function(_0x460d5a){return db[_0xd453('0x55')]['create'](_0x460d5a,{'include':[{'model':db[_0xd453('0x5b')],'as':_0xd453('0x5a')}],'raw':!![],'transaction':_0x449a84})[_0xd453('0x2a')](function(_0x192361){_0x488377['push'](_0x192361[_0xd453('0x4e')]({'plain':!![]}));});})[_0xd453('0x2a')](function(){return _0x488377;});});});}})['then'](function(_0x406a56){return _0x406a56;})[_0xd453('0x2a')](respondWithResult(_0x4aaa61,null))[_0xd453('0x4b')](handleError(_0x4aaa61,null));};exports[_0xd453('0x5f')]=function(_0x3561bb,_0x386d34){var _0xc4c350;return db[_0xd453('0x42')]['find']({'where':{'id':_0x3561bb['params']['id']},'attributes':['id','name']})[_0xd453('0x2a')](handleEntityNotFound(_0x386d34,null))[_0xd453('0x2a')](function(_0x4c7610){if(_0x4c7610){_0xc4c350=_0x4c7610;return db[_0xd453('0x55')][_0xd453('0x5e')]({'where':{'userProfileId':_0x3561bb[_0xd453('0x56')]['id'],'sectionId':_0x3561bb['query'][_0xd453('0x60')]}});}})[_0xd453('0x2a')](function(){return _0xc4c350;})[_0xd453('0x2a')](respondWithStatusCode(_0x386d34,null))['catch'](handleError(_0x386d34,null));};exports['getSections']=function(_0x295e7c,_0xf3ea93){var _0x48fbe7=[];var _0x4b1e2d=[];return db['UserProfileSection'][_0xd453('0x45')]({'where':{'userProfileId':_0x295e7c[_0xd453('0x56')]['id']},'raw':!![]})[_0xd453('0x2a')](function(_0x44b79f){_0x48fbe7=_[_0xd453('0x3e')](_0x44b79f,function(_0x4182b0){return _0x4182b0['enabled']===0x1||_[_0xd453('0x61')]([0x3eb,0x709],_0x4182b0['sectionId']);});if(!_['isEmpty'](_0x48fbe7)){return _['map'](_0x48fbe7,function(_0x3e8377){return _0x3e8377[_0xd453('0x58')];});}else{return;}})['then'](function(_0x4c5807){if(_0x4c5807)_0x4b1e2d=_0x4c5807;if(_[_0xd453('0x61')](_0x4b1e2d,0x64)){var _0xaf9865=_[_0xd453('0x4a')](_0x48fbe7,{'sectionId':0x64});return hasDefaultDashboard(_0xaf9865)['then'](function(_0x32470e){return _['map'](_0x48fbe7,function(_0x4eb2cc){if(_0x4eb2cc[_0xd453('0x58')]===0x64){_0x4eb2cc['subsections']=_0x32470e;}return _0x4eb2cc;});});}else{return;}})['then'](function(_0x43e846){if(_0x43e846)_0x48fbe7=_0x43e846;if(_[_0xd453('0x61')](_0x4b1e2d,0x3eb)){var _0x2308a9=_[_0xd453('0x4a')](_0x48fbe7,{'sectionId':0x3eb});return getCustomDashboards(_0x2308a9)[_0xd453('0x2a')](function(_0x1e53e9){return _[_0xd453('0x30')](_0x48fbe7,function(_0x100237){if(_0x2308a9[_0xd453('0x62')]){if(_0x100237['sectionId']===0x3eb){_0x100237[_0xd453('0x63')]=_0x1e53e9;}}else{if(_0x100237['sectionId']===0x64){if(!_0x100237['subsections']){_0x100237[_0xd453('0x63')]=[];}_0x100237[_0xd453('0x63')]=_0x100237[_0xd453('0x63')][_0xd453('0x64')](_0x1e53e9);}}return _0x100237;});});}else{return;}})['then'](function(_0x12e60a){if(_0x12e60a)_0x48fbe7=_0x12e60a;if(_[_0xd453('0x61')](_0x4b1e2d,0x709)){var _0x3adca4=_[_0xd453('0x4a')](_0x48fbe7,{'sectionId':0x709});return getPlugins(_0x3adca4)[_0xd453('0x2a')](function(_0x53e25f){if(_0x3adca4['enabled']){return _[_0xd453('0x30')](_0x48fbe7,function(_0xfc533a){if(_0xfc533a[_0xd453('0x58')]===0x709){_0xfc533a[_0xd453('0x63')]=_0x53e25f;}return _0xfc533a;});}else{var _0x33a6d0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x53e25f};var _0x3e4ea6=_['map'](_0x48fbe7);_0x3e4ea6['push'](_0x33a6d0);return _0x3e4ea6;}});}else{return;}})[_0xd453('0x2a')](function(_0x672390){if(_0x672390)_0x48fbe7=_0x672390;return _['filter'](_0x48fbe7,[_0xd453('0x62'),0x1]);})['then'](respondWithResult(_0xf3ea93,null))['catch'](handleError(_0xf3ea93,null));};function hasDefaultDashboard(_0x14a92e){var _0x4049d9=[0x65];return new BPromise(function(_0x4f6429,_0x54be73){try{if(_0x14a92e[_0xd453('0x57')]){_0x4f6429(_0x4049d9);}else{return db[_0xd453('0x5b')]['findOne']({'where':{'sectionId':_0x14a92e['id']},'raw':!![]})[_0xd453('0x2a')](function(_0xd32640){_0xd32640?_0x4f6429(_0x4049d9):_0x4f6429();});}}catch(_0x3b5bf7){_0x54be73(_0x3b5bf7);}});}function getCustomDashboards(_0x64b1fe){var _0x2577eb=[];return new BPromise(function(_0x2d52d1,_0x3ee48a){try{if(_0x64b1fe[_0xd453('0x57')]){return db[_0xd453('0x65')][_0xd453('0x45')]({'raw':!![]})[_0xd453('0x2a')](function(_0x39c3bd){_0x39c3bd[_0xd453('0x66')](function(_0x292778){_0x2577eb[_0xd453('0x67')](_0x292778['id']+0x1869f);});_0x2d52d1(_0x2577eb);});}else{return db[_0xd453('0x5b')][_0xd453('0x45')]({'where':{'sectionId':_0x64b1fe['id']},'raw':!![]})[_0xd453('0x2a')](function(_0x5a60a8){_0x5a60a8[_0xd453('0x66')](function(_0x187ee0){_0x2577eb[_0xd453('0x67')](_0x187ee0[_0xd453('0x68')]+0x1869f);});_0x2d52d1(_0x2577eb);});}}catch(_0x2c80bf){_0x3ee48a(_0x2c80bf);}});}function getPlugins(_0x1a7b2b){var _0x30c12b=[];return new BPromise(function(_0x12e2fc,_0x255ee8){try{if(_0x1a7b2b[_0xd453('0x57')]){return db[_0xd453('0x69')][_0xd453('0x45')]({'raw':!![]})[_0xd453('0x2a')](function(_0x4a6497){_0x4a6497[_0xd453('0x66')](function(_0x295d91){_0x30c12b[_0xd453('0x67')](_0x295d91['id']+0x15b38);});_0x12e2fc(_0x30c12b);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1a7b2b['id']},'raw':!![]})['then'](function(_0x2ef3f5){_0x2ef3f5['forEach'](function(_0x334957){_0x30c12b[_0xd453('0x67')](_0x334957['resourceId']+0x15b38);});_0x12e2fc(_0x30c12b);});}}catch(_0x1e1069){_0x255ee8(_0x1e1069);}});}exports[_0xd453('0x6a')]=function(_0x5a03f1,_0x582ff6){return db[_0xd453('0x42')][_0xd453('0x4a')]({'where':{'id':_0x5a03f1[_0xd453('0x56')]['id']}})['then'](handleEntityNotFound(_0x582ff6,null))[_0xd453('0x2a')](function(_0x3dcb36){if(_0x3dcb36){return db[_0xd453('0x53')][_0xd453('0x54')](function(_0x5cf11d){return db[_0xd453('0x55')][_0xd453('0x45')]({'where':{'userProfileId':_0x5a03f1['params']['id']},'attributes':['id'],'raw':!![]})[_0xd453('0x2a')](function(_0x560bce){if(_0x560bce){return db[_0xd453('0x55')]['destroy']({'where':{'userProfileId':_0x5a03f1[_0xd453('0x56')]['id'],'id':_[_0xd453('0x30')](_0x560bce,function(_0x3c12f5){return _0x3c12f5['id'];})},'transaction':_0x5cf11d});}})['then'](function(_0x489abc){var _0x40a892=_[_0xd453('0x30')](_0x5a03f1[_0xd453('0x4d')],function(_0x3db3ad){_0x3db3ad[_0xd453('0x59')]=_0x5a03f1[_0xd453('0x56')]['id'];return _0x3db3ad;});return db['UserProfileSection']['bulkCreate'](_0x40a892,{'raw':!![],'transaction':_0x5cf11d});})[_0xd453('0x2a')](function(_0x2002f7){var _0x77fd0d=_[_0xd453('0x3e')](_[_0xd453('0x30')](_0x2002f7,function(_0x32f8a8){return _0x32f8a8[_0xd453('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x77fd0d){return db['UserProfileSection'][_0xd453('0x45')]({'where':{'userProfileId':_0x5a03f1['params']['id'],'sectionId':_[_0xd453('0x30')](_0x77fd0d,function(_0x2220f3){return _0x2220f3[_0xd453('0x58')];})},'attributes':['id',_0xd453('0x58')],'raw':!![]})[_0xd453('0x2a')](function(_0x13d7b7){var _0x472766=_['map'](_0x5a03f1['body'],function(_0x54dbf3){_0x54dbf3['userProfileId']=_0x5a03f1[_0xd453('0x56')]['id'];return _0x54dbf3;});return db[_0xd453('0x5b')][_0xd453('0x6b')](_0x472766,{'raw':!![],'transaction':_0x5cf11d});});}})[_0xd453('0x4b')](handleError(_0x582ff6,null));});}})['then'](function(_0x40e570){var _0x2a3f45=_[_0xd453('0x30')](_0x40e570,function(_0x54f5ea){return _0x54f5ea[_0xd453('0x4e')]({'plain':!![]});});})[_0xd453('0x2a')](respondWithResult(_0x582ff6,null))[_0xd453('0x4b')](handleError(_0x582ff6,null));};exports[_0xd453('0x6c')]=function(_0x19ce70,_0x37dacf,_0x6ae130){return db['UserProfile'][_0xd453('0x4a')]({'where':{'id':_0x19ce70['params']['id']}})['then'](handleEntityNotFound(_0x37dacf,null))[_0xd453('0x2a')](function(_0x3ff173){if(_0x3ff173){return _0x3ff173[_0xd453('0x6c')](_0x19ce70['query']['ids']);}})[_0xd453('0x2a')](respondWithStatusCode(_0x37dacf,null))[_0xd453('0x4b')](handleError(_0x37dacf,null));};exports['getResources']=function(_0xd38f0,_0x1b469b){var _0xa7b0d2={};if(!_0xd38f0[_0xd453('0x36')][_0xd453('0x6d')])throw new Error(_0xd453('0x6e'));if(!_0xd38f0[_0xd453('0x36')][_0xd453('0x6f')](_0xd453('0x3a'))){_0xa7b0d2['limit']=qs['limit'](_0xd38f0['query']['limit']);_0xa7b0d2['offset']=qs[_0xd453('0x20')](_0xd38f0[_0xd453('0x36')][_0xd453('0x20')]);}return db['UserProfile']['find']({'where':{'id':_0xd38f0[_0xd453('0x56')]['id']}})['then'](function(_0x3d6674){if(!_0x3d6674)throw new Error(_0xd453('0x70')+_0xd38f0[_0xd453('0x56')]['id']);return db['UserProfile'][_0xd453('0x71')](_0xd38f0);})['then'](respondWithFilteredResult(_0x1b469b,_0xa7b0d2))[_0xd453('0x4b')](handleError(_0x1b469b,null));}; \ No newline at end of file +var _0x6515=['push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','UserProfile','filters','find','create','body','clone','createdAt','updatedAt','crudPermissions','sequelize','get','UserProfileSection','findAll','params','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','update','describe','addSections','transaction'];(function(_0x39dc7b,_0x397300){var _0x414a2f=function(_0x1e7445){while(--_0x1e7445){_0x39dc7b['push'](_0x39dc7b['shift']());}};_0x414a2f(++_0x397300);}(_0x6515,0x16f));var _0x5651=function(_0x9735c9,_0x2df051){_0x9735c9=_0x9735c9-0x0;var _0x3ce4d0=_0x6515[_0x9735c9];return _0x3ce4d0;};'use strict';var emlformat=require(_0x5651('0x0'));var rimraf=require(_0x5651('0x1'));var zipdir=require(_0x5651('0x2'));var jsonpatch=require(_0x5651('0x3'));var rp=require('request-promise');var moment=require(_0x5651('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5651('0x5'));var util=require('util');var path=require(_0x5651('0x6'));var sox=require(_0x5651('0x7'));var csv=require(_0x5651('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5651('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5651('0xa'));var jsforce=require(_0x5651('0xb'));var deskjs=require(_0x5651('0xc'));var toCsv=require(_0x5651('0x8'));var querystring=require('querystring');var Papa=require(_0x5651('0xd'));var Redis=require(_0x5651('0xe'));var authService=require(_0x5651('0xf'));var qs=require(_0x5651('0x10'));var as=require(_0x5651('0x11'));var hardwareService=require(_0x5651('0x12'));var logger=require('../../config/logger')(_0x5651('0x13'));var utils=require('../../config/utils');var config=require(_0x5651('0x14'));var licenseUtil=require(_0x5651('0x15'));var db=require('../../mysqldb')['db'];config[_0x5651('0x16')]=_[_0x5651('0x17')](config[_0x5651('0x16')],{'host':_0x5651('0x18'),'port':0x18eb});var socket=require(_0x5651('0x19'))(new Redis(config['redis']));require(_0x5651('0x1a'))[_0x5651('0x1b')](socket);function respondWithStatusCode(_0x5894f5,_0x3f1519){_0x3f1519=_0x3f1519||0xcc;return function(_0x3cad32){if(_0x3cad32){return _0x5894f5[_0x5651('0x1c')](_0x3f1519);}return _0x5894f5[_0x5651('0x1d')](_0x3f1519)[_0x5651('0x1e')]();};}function respondWithResult(_0x46f44e,_0x16ec10){_0x16ec10=_0x16ec10||0xc8;return function(_0xd77176){if(_0xd77176){return _0x46f44e[_0x5651('0x1d')](_0x16ec10)[_0x5651('0x1f')](_0xd77176);}};}function respondWithFilteredResult(_0x61120a,_0x5c775a){return function(_0x181201){if(_0x181201){var _0xee651a=typeof _0x5c775a[_0x5651('0x20')]===_0x5651('0x21')&&typeof _0x5c775a['limit']===_0x5651('0x21');var _0x3eff65=_0x181201[_0x5651('0x22')];var _0x5aae9a=_0xee651a?0x0:_0x5c775a['offset'];var _0xc3f1c5=_0xee651a?_0x181201[_0x5651('0x22')]:_0x5c775a[_0x5651('0x20')]+_0x5c775a['limit'];var _0x77485d;if(_0xc3f1c5>=_0x3eff65){_0xc3f1c5=_0x3eff65;_0x77485d=0xc8;}else{_0x77485d=0xce;}_0x61120a[_0x5651('0x1d')](_0x77485d);return _0x61120a[_0x5651('0x23')](_0x5651('0x24'),_0x5aae9a+'-'+_0xc3f1c5+'/'+_0x3eff65)[_0x5651('0x1f')](_0x181201);}return null;};}function patchUpdates(_0x4a7c25){return function(_0x458580){try{jsonpatch[_0x5651('0x25')](_0x458580,_0x4a7c25,!![]);}catch(_0x4df318){return BPromise[_0x5651('0x26')](_0x4df318);}return _0x458580[_0x5651('0x27')]();};}function saveUpdates(_0xedd757,_0x1bc9b6){return function(_0xac2f9b){if(_0xac2f9b){return _0xac2f9b['update'](_0xedd757)['then'](function(_0x4f1010){return _0x4f1010;});}return null;};}function removeEntity(_0x3d5d5b,_0x35ee48){return function(_0x1394df){if(_0x1394df){return _0x1394df[_0x5651('0x28')]()[_0x5651('0x29')](function(){_0x3d5d5b[_0x5651('0x1d')](0xcc)[_0x5651('0x1e')]();});}};}function handleEntityNotFound(_0x20ca3a,_0x17916b){return function(_0x28bf2f){if(!_0x28bf2f){_0x20ca3a[_0x5651('0x1c')](0x194);}return _0x28bf2f;};}function handleError(_0x26f384,_0x5c7f08){_0x5c7f08=_0x5c7f08||0x1f4;return function(_0x120b68){logger[_0x5651('0x2a')](_0x120b68['stack']);if(_0x120b68[_0x5651('0x2b')]){delete _0x120b68['name'];}_0x26f384[_0x5651('0x1d')](_0x5c7f08)[_0x5651('0x2c')](_0x120b68);};}exports[_0x5651('0x2d')]=function(_0x347226,_0x4b7056){var _0x195ee2={},_0xdc03d2={},_0x4cd252={'count':0x0,'rows':[]};var _0x4783f9=_[_0x5651('0x2e')](db['UserProfile'][_0x5651('0x2f')],function(_0x6eba8e){return{'name':_0x6eba8e[_0x5651('0x30')],'type':_0x6eba8e[_0x5651('0x31')][_0x5651('0x32')]};});_0xdc03d2[_0x5651('0x33')]=_[_0x5651('0x2e')](_0x4783f9,_0x5651('0x2b'));_0xdc03d2[_0x5651('0x34')]=_[_0x5651('0x35')](_0x347226[_0x5651('0x34')]);_0xdc03d2['filters']=_[_0x5651('0x36')](_0xdc03d2[_0x5651('0x33')],_0xdc03d2[_0x5651('0x34')]);_0x195ee2['attributes']=_[_0x5651('0x36')](_0xdc03d2[_0x5651('0x33')],qs[_0x5651('0x37')](_0x347226['query']['fields']));_0x195ee2[_0x5651('0x38')]=_0x195ee2[_0x5651('0x38')][_0x5651('0x39')]?_0x195ee2[_0x5651('0x38')]:_0xdc03d2[_0x5651('0x33')];if(!_0x347226[_0x5651('0x34')][_0x5651('0x3a')](_0x5651('0x3b'))){_0x195ee2[_0x5651('0x3c')]=qs['limit'](_0x347226[_0x5651('0x34')][_0x5651('0x3c')]);_0x195ee2[_0x5651('0x20')]=qs[_0x5651('0x20')](_0x347226['query']['offset']);}_0x195ee2[_0x5651('0x3d')]=qs[_0x5651('0x3e')](_0x347226[_0x5651('0x34')][_0x5651('0x3e')]);_0x195ee2[_0x5651('0x3f')]=qs['filters'](_['pick'](_0x347226['query'],_0xdc03d2['filters']),_0x4783f9);if(_0x347226[_0x5651('0x34')][_0x5651('0x40')]){_0x195ee2[_0x5651('0x3f')]=_[_0x5651('0x41')](_0x195ee2['where'],{'$or':_[_0x5651('0x2e')](_0x4783f9,function(_0x4cc02a){if(_0x4cc02a['type']!==_0x5651('0x42')){var _0x4e623f={};_0x4e623f[_0x4cc02a[_0x5651('0x2b')]]={'$like':'%'+_0x347226['query']['filter']+'%'};return _0x4e623f;}})});}_0x195ee2=_['merge']({},_0x195ee2,_0x347226[_0x5651('0x43')]);var _0xbf3daf={'where':_0x195ee2[_0x5651('0x3f')]};return db['UserProfile'][_0x5651('0x22')](_0xbf3daf)[_0x5651('0x29')](function(_0x11168a){_0x4cd252[_0x5651('0x22')]=_0x11168a;if(_0x347226[_0x5651('0x34')][_0x5651('0x44')]){_0x195ee2[_0x5651('0x45')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x195ee2);})[_0x5651('0x29')](function(_0x29fb1c){_0x4cd252['rows']=_0x29fb1c;return _0x4cd252;})[_0x5651('0x29')](respondWithFilteredResult(_0x4b7056,_0x195ee2))[_0x5651('0x46')](handleError(_0x4b7056,null));};exports[_0x5651('0x47')]=function(_0x1adcbd,_0x40fa86){var _0x7d5d68={'raw':![],'where':{'id':_0x1adcbd['params']['id']}},_0xa406a0={};_0xa406a0[_0x5651('0x33')]=_[_0x5651('0x35')](db[_0x5651('0x48')][_0x5651('0x2f')]);_0xa406a0[_0x5651('0x34')]=_[_0x5651('0x35')](_0x1adcbd[_0x5651('0x34')]);_0xa406a0[_0x5651('0x49')]=_['intersection'](_0xa406a0['model'],_0xa406a0['query']);_0x7d5d68[_0x5651('0x38')]=_[_0x5651('0x36')](_0xa406a0[_0x5651('0x33')],qs[_0x5651('0x37')](_0x1adcbd[_0x5651('0x34')][_0x5651('0x37')]));_0x7d5d68['attributes']=_0x7d5d68[_0x5651('0x38')][_0x5651('0x39')]?_0x7d5d68[_0x5651('0x38')]:_0xa406a0[_0x5651('0x33')];if(_0x1adcbd[_0x5651('0x34')][_0x5651('0x44')]){_0x7d5d68['include']=[{'all':!![]}];}_0x7d5d68=_[_0x5651('0x41')]({},_0x7d5d68,_0x1adcbd['options']);return db[_0x5651('0x48')][_0x5651('0x4a')](_0x7d5d68)[_0x5651('0x29')](handleEntityNotFound(_0x40fa86,null))[_0x5651('0x29')](respondWithResult(_0x40fa86,null))['catch'](handleError(_0x40fa86,null));};exports[_0x5651('0x4b')]=function(_0x1bf57b,_0x933ea3){return db[_0x5651('0x48')]['create'](_0x1bf57b[_0x5651('0x4c')],{})[_0x5651('0x29')](respondWithResult(_0x933ea3,0xc9))['catch'](handleError(_0x933ea3,null));};exports[_0x5651('0x4d')]=function(_0x150508,_0x150d49){var _0x360f19={'where':{'id':_0x150508['params']['id']}},_0x4b9471={};_0x4b9471[_0x5651('0x33')]=_[_0x5651('0x35')](db['UserProfile'][_0x5651('0x2f')]);_0x360f19[_0x5651('0x38')]=_[_0x5651('0x36')](_0x4b9471[_0x5651('0x33')],qs[_0x5651('0x37')](_0x150508[_0x5651('0x34')]['fields']));_0x360f19[_0x5651('0x38')]=_0x360f19['attributes']['length']?_0x360f19[_0x5651('0x38')]:_0x4b9471[_0x5651('0x33')];if(_0x150508['query']['includeAll']){_0x360f19[_0x5651('0x45')]=[{'all':!![]}];}_0x360f19=_['merge']({},_0x360f19,_0x150508['options']);return db['UserProfile'][_0x5651('0x4a')](_0x360f19)[_0x5651('0x29')](handleEntityNotFound(_0x150d49,null))[_0x5651('0x29')](function(_0x1feed6){if(_0x1feed6){var _0x2275f6=_0x1feed6['get']({'plain':!![]});_0x2275f6=qs['omit'](_0x2275f6,['id',_0x5651('0x4e'),_0x5651('0x4f'),_0x5651('0x50')]);_0x150508[_0x5651('0x4c')]=_['omit'](_0x150508['body'],['id',_0x5651('0x4e'),_0x5651('0x4f')]);return db[_0x5651('0x51')]['transaction'](function(_0x2f616b){return db[_0x5651('0x48')][_0x5651('0x4b')](_[_0x5651('0x41')](_0x2275f6,_0x150508[_0x5651('0x4c')]),{'include':_0x150508[_0x5651('0x34')][_0x5651('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x2f616b})['then'](function(_0x5b1b10){var _0x3d2732=_0x5b1b10[_0x5651('0x52')]({'plain':!![]});return db[_0x5651('0x53')][_0x5651('0x54')]({'where':{'userProfileId':_0x150508[_0x5651('0x55')]['id']},'raw':!![]})[_0x5651('0x29')](function(_0x18c2ba){if(_0x18c2ba){return BPromise[_0x5651('0x56')](_0x18c2ba,function(_0x13ed72){return new BPromise(function(_0x4d6d56,_0x59d2b0){if(_0x13ed72[_0x5651('0x57')]===null||_0x13ed72[_0x5651('0x57')]===0x1)_0x4d6d56(null);return db[_0x5651('0x58')]['findAll']({'where':{'sectionId':_0x13ed72['id']},'raw':!![]})[_0x5651('0x29')](function(_0x4f1883){var _0x45816a=_[_0x5651('0x2e')](_0x4f1883,function(_0x1f0dee){return qs[_0x5651('0x59')](_0x1f0dee,['id',_0x5651('0x4e'),_0x5651('0x4f'),_0x5651('0x5a')]);});_0x4d6d56(_0x45816a);})[_0x5651('0x46')](function(_0x3c9d56){_0x59d2b0(_0x3c9d56);});})[_0x5651('0x29')](function(_0x488b3d){var _0x3ce1ae=qs[_0x5651('0x59')](_0x13ed72,['id',_0x5651('0x4e'),_0x5651('0x4f')]);_0x3ce1ae[_0x5651('0x5b')]=_0x3d2732['id'];if(_0x488b3d)_0x3ce1ae[_0x5651('0x5c')]=_0x488b3d;return _0x3ce1ae;})[_0x5651('0x29')](function(_0x3066d1){return db[_0x5651('0x53')][_0x5651('0x4b')](_0x3066d1,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x2f616b});});})[_0x5651('0x29')](function(){return _0x3d2732;});}});});});}})[_0x5651('0x29')](respondWithResult(_0x150d49,0xc9))[_0x5651('0x46')](handleError(_0x150d49,null));};exports[_0x5651('0x5d')]=function(_0x8cf6d3,_0x385ad8){if(_0x8cf6d3[_0x5651('0x4c')]['id']){delete _0x8cf6d3[_0x5651('0x4c')]['id'];}return db[_0x5651('0x48')]['find']({'where':{'id':_0x8cf6d3[_0x5651('0x55')]['id']}})[_0x5651('0x29')](handleEntityNotFound(_0x385ad8,null))['then'](saveUpdates(_0x8cf6d3['body'],null))[_0x5651('0x29')](respondWithResult(_0x385ad8,null))[_0x5651('0x46')](handleError(_0x385ad8,null));};exports[_0x5651('0x28')]=function(_0x16c436,_0x32053a){return db['UserProfile'][_0x5651('0x4a')]({'where':{'id':_0x16c436[_0x5651('0x55')]['id']}})[_0x5651('0x29')](handleEntityNotFound(_0x32053a,null))[_0x5651('0x29')](removeEntity(_0x32053a,null))['catch'](handleError(_0x32053a,null));};exports['describe']=function(_0x5580be,_0x4a6e24){return db[_0x5651('0x48')][_0x5651('0x5e')]()[_0x5651('0x29')](respondWithResult(_0x4a6e24,null))['catch'](handleError(_0x4a6e24,null));};exports[_0x5651('0x5f')]=function(_0x4dce81,_0x58e9f9){var _0xaf90bb=_0x4dce81[_0x5651('0x4c')];return db[_0x5651('0x48')][_0x5651('0x4a')]({'where':{'id':_0x4dce81[_0x5651('0x55')]['id']}})[_0x5651('0x29')](handleEntityNotFound(_0x58e9f9,null))['then'](function(_0x2cd668){if(_0x2cd668){return db['sequelize'][_0x5651('0x60')](function(_0xe0df06){return db[_0x5651('0x53')][_0x5651('0x28')]({'where':{'userProfileId':_0x4dce81[_0x5651('0x55')]['id'],'sectionId':_[_0x5651('0x2e')](_0xaf90bb,function(_0x570a3a){return _0x570a3a['sectionId'];})},'transaction':_0xe0df06})['then'](function(){var _0x5587a5=_[_0x5651('0x2e')](_0xaf90bb,function(_0x11e635){_0x11e635[_0x5651('0x5b')]=_0x4dce81[_0x5651('0x55')]['id'];return _0x11e635;});var _0x443542=[];return BPromise[_0x5651('0x56')](_0x5587a5,function(_0x74014a){return db['UserProfileSection'][_0x5651('0x4b')](_0x74014a,{'include':[{'model':db[_0x5651('0x58')],'as':_0x5651('0x5c')}],'raw':!![],'transaction':_0xe0df06})['then'](function(_0x3126c4){_0x443542[_0x5651('0x61')](_0x3126c4[_0x5651('0x52')]({'plain':!![]}));});})[_0x5651('0x29')](function(){return _0x443542;});});});}})[_0x5651('0x29')](function(_0x20ecc6){return _0x20ecc6;})[_0x5651('0x29')](respondWithResult(_0x58e9f9,null))['catch'](handleError(_0x58e9f9,null));};exports[_0x5651('0x62')]=function(_0x4f2d68,_0x42aa0c){var _0x1b204e;return db[_0x5651('0x48')][_0x5651('0x4a')]({'where':{'id':_0x4f2d68[_0x5651('0x55')]['id']},'attributes':['id',_0x5651('0x2b')]})['then'](handleEntityNotFound(_0x42aa0c,null))['then'](function(_0x58349b){if(_0x58349b){_0x1b204e=_0x58349b;return db[_0x5651('0x53')][_0x5651('0x28')]({'where':{'userProfileId':_0x4f2d68[_0x5651('0x55')]['id'],'sectionId':_0x4f2d68['query'][_0x5651('0x63')]}});}})[_0x5651('0x29')](function(){return _0x1b204e;})['then'](respondWithStatusCode(_0x42aa0c,null))[_0x5651('0x46')](handleError(_0x42aa0c,null));};exports[_0x5651('0x64')]=function(_0x4d694f,_0xd3e2df){var _0x548bf3=[];var _0x4a5029=[];return db[_0x5651('0x53')][_0x5651('0x54')]({'where':{'userProfileId':_0x4d694f[_0x5651('0x55')]['id']},'raw':!![]})['then'](function(_0x3edb6f){_0x548bf3=_['filter'](_0x3edb6f,function(_0x124daf){return _0x124daf['enabled']===0x1||_[_0x5651('0x65')]([0x3eb,0x709],_0x124daf['sectionId']);});if(!_[_0x5651('0x66')](_0x548bf3)){return _[_0x5651('0x2e')](_0x548bf3,function(_0x51b703){return _0x51b703[_0x5651('0x5a')];});}else{return;}})[_0x5651('0x29')](function(_0x23230e){if(_0x23230e)_0x4a5029=_0x23230e;if(_[_0x5651('0x65')](_0x4a5029,0x64)){var _0x22be66=_['find'](_0x548bf3,{'sectionId':0x64});return hasDefaultDashboard(_0x22be66)[_0x5651('0x29')](function(_0x51e5d3){return _['map'](_0x548bf3,function(_0x54b4a7){if(_0x54b4a7[_0x5651('0x5a')]===0x64){_0x54b4a7[_0x5651('0x67')]=_0x51e5d3;}return _0x54b4a7;});});}else{return;}})[_0x5651('0x29')](function(_0x27c4c5){if(_0x27c4c5)_0x548bf3=_0x27c4c5;if(_[_0x5651('0x65')](_0x4a5029,0x3eb)){var _0x7dff32=_['find'](_0x548bf3,{'sectionId':0x3eb});return getCustomDashboards(_0x7dff32)['then'](function(_0x4bb8bb){return _[_0x5651('0x2e')](_0x548bf3,function(_0x38a531){if(_0x7dff32[_0x5651('0x68')]){if(_0x38a531['sectionId']===0x3eb){_0x38a531['subsections']=_0x4bb8bb;}}else{if(_0x38a531[_0x5651('0x5a')]===0x64){if(!_0x38a531['subsections']){_0x38a531[_0x5651('0x67')]=[];}_0x38a531['subsections']=_0x38a531[_0x5651('0x67')]['concat'](_0x4bb8bb);}}return _0x38a531;});});}else{return;}})['then'](function(_0x348067){if(_0x348067)_0x548bf3=_0x348067;if(_['includes'](_0x4a5029,0x709)){var _0x4df87d=_['find'](_0x548bf3,{'sectionId':0x709});return getPlugins(_0x4df87d)[_0x5651('0x29')](function(_0x528fc9){if(_0x4df87d['enabled']){return _['map'](_0x548bf3,function(_0x11b5ae){if(_0x11b5ae[_0x5651('0x5a')]===0x709){_0x11b5ae[_0x5651('0x67')]=_0x528fc9;}return _0x11b5ae;});}else{var _0x51a41f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x528fc9};var _0xe4cd71=_[_0x5651('0x2e')](_0x548bf3);_0xe4cd71[_0x5651('0x61')](_0x51a41f);return _0xe4cd71;}});}else{return;}})[_0x5651('0x29')](function(_0x30e0c5){if(_0x30e0c5)_0x548bf3=_0x30e0c5;return _['filter'](_0x548bf3,[_0x5651('0x68'),0x1]);})[_0x5651('0x29')](respondWithResult(_0xd3e2df,null))[_0x5651('0x46')](handleError(_0xd3e2df,null));};function hasDefaultDashboard(_0x4c90f){var _0x5c0086=[0x65];return new BPromise(function(_0x195b8c,_0x58dd8d){try{if(_0x4c90f[_0x5651('0x57')]){_0x195b8c(_0x5c0086);}else{return db[_0x5651('0x58')][_0x5651('0x69')]({'where':{'sectionId':_0x4c90f['id']},'raw':!![]})['then'](function(_0x5c3496){_0x5c3496?_0x195b8c(_0x5c0086):_0x195b8c();});}}catch(_0x703256){_0x58dd8d(_0x703256);}});}function getCustomDashboards(_0x36a1bb){var _0x52320e=[];return new BPromise(function(_0x46c988,_0x1c6ad2){try{if(_0x36a1bb['autoAssociation']){return db[_0x5651('0x6a')][_0x5651('0x54')]({'raw':!![]})[_0x5651('0x29')](function(_0x41d4ea){_0x41d4ea[_0x5651('0x6b')](function(_0xb9af8b){_0x52320e[_0x5651('0x61')](_0xb9af8b['id']+0x1869f);});_0x46c988(_0x52320e);});}else{return db['UserProfileResource'][_0x5651('0x54')]({'where':{'sectionId':_0x36a1bb['id']},'raw':!![]})['then'](function(_0x5cb10b){_0x5cb10b['forEach'](function(_0x5710a6){_0x52320e[_0x5651('0x61')](_0x5710a6['resourceId']+0x1869f);});_0x46c988(_0x52320e);});}}catch(_0x2bab0f){_0x1c6ad2(_0x2bab0f);}});}function getPlugins(_0x541595){var _0x2a0048=[];return new BPromise(function(_0x3f76d2,_0x3b470d){try{if(_0x541595['autoAssociation']){return db[_0x5651('0x6c')]['findAll']({'raw':!![]})[_0x5651('0x29')](function(_0x5a9188){_0x5a9188[_0x5651('0x6b')](function(_0x2261da){_0x2a0048['push'](_0x2261da['id']+0x15b38);});_0x3f76d2(_0x2a0048);});}else{return db[_0x5651('0x58')][_0x5651('0x54')]({'where':{'sectionId':_0x541595['id']},'raw':!![]})[_0x5651('0x29')](function(_0x3fb89e){_0x3fb89e[_0x5651('0x6b')](function(_0x5b8abb){_0x2a0048[_0x5651('0x61')](_0x5b8abb[_0x5651('0x6d')]+0x15b38);});_0x3f76d2(_0x2a0048);});}}catch(_0x4ab34d){_0x3b470d(_0x4ab34d);}});}exports[_0x5651('0x6e')]=function(_0x3311b6,_0x1cca90){return db['UserProfile'][_0x5651('0x4a')]({'where':{'id':_0x3311b6[_0x5651('0x55')]['id']}})[_0x5651('0x29')](handleEntityNotFound(_0x1cca90,null))[_0x5651('0x29')](function(_0x1f525d){if(_0x1f525d){return db['sequelize'][_0x5651('0x60')](function(_0x51782d){return db[_0x5651('0x53')][_0x5651('0x54')]({'where':{'userProfileId':_0x3311b6[_0x5651('0x55')]['id']},'attributes':['id'],'raw':!![]})[_0x5651('0x29')](function(_0x5374df){if(_0x5374df){return db[_0x5651('0x53')]['destroy']({'where':{'userProfileId':_0x3311b6[_0x5651('0x55')]['id'],'id':_[_0x5651('0x2e')](_0x5374df,function(_0x4d3eb4){return _0x4d3eb4['id'];})},'transaction':_0x51782d});}})['then'](function(_0x5d0120){var _0x12c8b5=_['map'](_0x3311b6[_0x5651('0x4c')],function(_0x3e1bb8){_0x3e1bb8[_0x5651('0x5b')]=_0x3311b6['params']['id'];return _0x3e1bb8;});return db[_0x5651('0x53')][_0x5651('0x6f')](_0x12c8b5,{'raw':!![],'transaction':_0x51782d});})[_0x5651('0x29')](function(_0x79eb85){var _0x3bde46=_[_0x5651('0x40')](_[_0x5651('0x2e')](_0x79eb85,function(_0x5066c4){return _0x5066c4[_0x5651('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x3bde46){return db[_0x5651('0x53')]['findAll']({'where':{'userProfileId':_0x3311b6[_0x5651('0x55')]['id'],'sectionId':_['map'](_0x3bde46,function(_0x3eff31){return _0x3eff31[_0x5651('0x5a')];})},'attributes':['id',_0x5651('0x5a')],'raw':!![]})[_0x5651('0x29')](function(_0x24d087){var _0x2d622b=_[_0x5651('0x2e')](_0x3311b6[_0x5651('0x4c')],function(_0x57ce30){_0x57ce30[_0x5651('0x5b')]=_0x3311b6['params']['id'];return _0x57ce30;});return db[_0x5651('0x58')][_0x5651('0x6f')](_0x2d622b,{'raw':!![],'transaction':_0x51782d});});}})['catch'](handleError(_0x1cca90,null));});}})[_0x5651('0x29')](function(_0x409fd1){var _0x403290=_[_0x5651('0x2e')](_0x409fd1,function(_0x1b713d){return _0x1b713d[_0x5651('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x1cca90,null))[_0x5651('0x46')](handleError(_0x1cca90,null));};exports[_0x5651('0x70')]=function(_0x40fd3e,_0x3fb4b0,_0x5c90f6){return db[_0x5651('0x48')][_0x5651('0x4a')]({'where':{'id':_0x40fd3e[_0x5651('0x55')]['id']}})[_0x5651('0x29')](handleEntityNotFound(_0x3fb4b0,null))[_0x5651('0x29')](function(_0x8edc04){if(_0x8edc04){return _0x8edc04[_0x5651('0x70')](_0x40fd3e[_0x5651('0x34')][_0x5651('0x63')]);}})[_0x5651('0x29')](respondWithStatusCode(_0x3fb4b0,null))[_0x5651('0x46')](handleError(_0x3fb4b0,null));};exports[_0x5651('0x71')]=function(_0x166dd6,_0x1f995a){var _0x51a5d6={};if(!_0x166dd6[_0x5651('0x34')][_0x5651('0x72')])throw new Error('Missing\x20section\x20parameter');if(!_0x166dd6[_0x5651('0x34')][_0x5651('0x3a')](_0x5651('0x3b'))){_0x51a5d6[_0x5651('0x3c')]=qs[_0x5651('0x3c')](_0x166dd6[_0x5651('0x34')][_0x5651('0x3c')]);_0x51a5d6['offset']=qs[_0x5651('0x20')](_0x166dd6[_0x5651('0x34')][_0x5651('0x20')]);}return db[_0x5651('0x48')][_0x5651('0x4a')]({'where':{'id':_0x166dd6['params']['id']}})[_0x5651('0x29')](function(_0x3e2d38){if(!_0x3e2d38)throw new Error(_0x5651('0x73')+_0x166dd6[_0x5651('0x55')]['id']);return db[_0x5651('0x48')][_0x5651('0x71')](_0x166dd6);})['then'](respondWithFilteredResult(_0x1f995a,_0x51a5d6))[_0x5651('0x46')](handleError(_0x1f995a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 438f68b..c35e8fd 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 _0x2eba=['UserProfile','setMaxListeners','save','emit','../../mysqldb'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x2eba,0xc7));var _0xa2eb=function(_0x169723,_0x5b7933){_0x169723=_0x169723-0x0;var _0x21fd85=_0x2eba[_0x169723];return _0x21fd85;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa2eb('0x0'))['db'][_0xa2eb('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa2eb('0x2')](0x0);var events={'afterCreate':_0xa2eb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x45ff67){return function(_0x51ebed,_0x1544ff,_0x3174a0){UserProfileEvents[_0xa2eb('0x4')](_0x45ff67+':'+_0x51ebed['id'],_0x51ebed);UserProfileEvents[_0xa2eb('0x4')](_0x45ff67,_0x51ebed);_0x3174a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x1867=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1622eb,_0xcfa32c){var _0x418ce4=function(_0x4c5cf4){while(--_0x4c5cf4){_0x1622eb['push'](_0x1622eb['shift']());}};_0x418ce4(++_0xcfa32c);}(_0x1867,0xb5));var _0x7186=function(_0x45abed,_0x4407ca){_0x45abed=_0x45abed-0x0;var _0x340e7c=_0x1867[_0x45abed];return _0x340e7c;};'use strict';var EventEmitter=require(_0x7186('0x0'));var UserProfile=require(_0x7186('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7186('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7186('0x3'),'afterDestroy':_0x7186('0x4')};function emitEvent(_0xeb165d){return function(_0xc7f9f0,_0x25d50d,_0x16dcd1){UserProfileEvents[_0x7186('0x5')](_0xeb165d+':'+_0xc7f9f0['id'],_0xc7f9f0);UserProfileEvents[_0x7186('0x5')](_0xeb165d,_0xc7f9f0);_0x16dcd1(null);};}for(var e in events){if(events[_0x7186('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x7186('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8978b9c..2d151e3 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 _0x4610=['Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','InteractionId','ui.createdAt','from','user_has_','query','OpenTabs','define','UserProfile','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','autoAssociation','length','rawAttributes','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','where','merge','key','VIRTUAL','foreignKey','forEach','include','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','associatedResources','map','catch','value','model','then','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','VoiceRecording','Agents','name','User','role','agent','Telephones','telephone','VoiceQueues','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','sounds','Sound','tags','Tag','Template','triggers','trunks','Trunk','variables','Variable','plugins','extractedreports'];(function(_0x55da18,_0x53433f){var _0x3a5deb=function(_0x578d83){while(--_0x578d83){_0x55da18['push'](_0x55da18['shift']());}};_0x3a5deb(++_0x53433f);}(_0x4610,0x1c0));var _0x0461=function(_0x43e97d,_0x56a06b){_0x43e97d=_0x43e97d-0x0;var _0x424cd9=_0x4610[_0x43e97d];return _0x424cd9;};'use strict';var _=require(_0x0461('0x0'));var attributes=require(_0x0461('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x0461('0x2'));module[_0x0461('0x3')]=function(_0x633d7b){var _0x2d4d38=_0x633d7b[_0x0461('0x4')];function _0x336565(_0x31e06f,_0x2a04ab){return new Promise(function(_0x2d9b77,_0x3d34e3){if(!_0x2a04ab)return _0x2d9b77(null);var _0x408ec3=_0x2a04ab[_0x0461('0x5')]?{[_0x2a04ab[_0x0461('0x5')][_0x0461('0x6')]]:_0x2a04ab[_0x0461('0x5')]['value']}:undefined;return _0x2d4d38[_0x31e06f][_0x0461('0x7')]({'where':_0x408ec3,'raw':!![]})['then'](function(_0x18ec18){_0x2a04ab[_0x0461('0x8')]=_[_0x0461('0x9')](_0x18ec18,'id');_0x2d9b77(_0x2a04ab);})[_0x0461('0xa')](function(_0x86a2be){_0x3d34e3(_0x86a2be);});});}function _0x2a00bc(_0x219cc7,_0x483c66){return new Promise(function(_0x4278a5,_0xea4863){var _0x4f2191=_0x219cc7[_0x0461('0x5')]?{[_0x219cc7[_0x0461('0x5')]['field']]:_0x219cc7[_0x0461('0x5')][_0x0461('0xb')]}:undefined;return _0x2d4d38[_0x219cc7[_0x0461('0xc')]][_0x0461('0x7')]({'where':_0x4f2191,'raw':!![]})[_0x0461('0xd')](function(_0x1667bb){_0x483c66['associatedResources']=_[_0x0461('0x9')](_0x1667bb,function(_0x5af25e){return _0x5af25e['name'];});_0x4278a5(_0x483c66);})['catch'](function(_0x1e751f){_0xea4863(_0x1e751f);});});}function _0x5b868e(_0x400488,_0x3f40fd,_0x511709){if(!_0x3f40fd)return Promise['resolve'](null);return new Promise(function(_0x4850a5,_0x131a77){return _0x2d4d38['UserProfileResource'][_0x0461('0x7')]({'where':{'sectionId':_0x3f40fd['id']},'raw':!![]})[_0x0461('0xd')](function(_0x457aed){if(_0x400488[_0x0461('0x6')]&&_0x400488['field']!=='id'){_0x3f40fd['associatedResources']=_[_0x0461('0x9')](_0x457aed,function(_0x473146){return _0x473146[_0x400488[_0x0461('0x6')]];});}else{if(_0x511709===_0x0461('0xe')){_0x3f40fd[_0x0461('0x8')]=_[_0x0461('0x9')](_0x457aed,function(_0x290aea){return{'id':_0x290aea[_0x0461('0xf')],'type':_0x290aea[_0x0461('0x10')]};});}else{_0x3f40fd[_0x0461('0x8')]=_[_0x0461('0x9')](_0x457aed,function(_0x1a868a){return _0x1a868a['resourceId'];});}}_0x4850a5(_0x3f40fd);})['catch'](function(_0xf9d7b6){_0x131a77(_0xf9d7b6);});});}function _0x1fe931(_0x8abb91,_0x2ac60e){var _0x5757e8={'parentSections':[]};switch(_0x8abb91[_0x0461('0x11')]()){case _0x0461('0x12'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x14');break;case _0x0461('0x15'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x16');break;case _0x0461('0x17'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x18');_0x5757e8[_0x0461('0x19')]=[{'name':_0x0461('0x1a'),'field':'name','foreignKey':'projectName'}];break;case _0x0461('0x1b'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x1c');break;case _0x0461('0x1d'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x1e');_0x5757e8[_0x0461('0x19')]=[{'name':_0x0461('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x0461('0x20'):_0x5757e8[_0x0461('0x13')]='CmList';break;case _0x0461('0x21'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x22');break;case _0x0461('0x23'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x24');break;case _0x0461('0x25'):_0x5757e8['childModel']=_0x0461('0x26');break;case _0x0461('0x27'):_0x5757e8[_0x0461('0x13')]='ChatWebsite';break;case'faxqueues':_0x5757e8[_0x0461('0x13')]=_0x0461('0x28');break;case'faxaccounts':_0x5757e8[_0x0461('0x13')]=_0x0461('0x29');break;case _0x0461('0x2a'):case _0x0461('0x2b'):case _0x0461('0x2c'):_0x5757e8['childModel']='VoiceExtension';break;case _0x0461('0x2d'):_0x5757e8['childModel']=_0x0461('0x2e');break;case'voicemails':_0x5757e8[_0x0461('0x13')]='VoiceMail';break;case'voicerecordings':_0x5757e8['childModel']=_0x0461('0x2f');_0x5757e8[_0x0461('0x19')]=[{'name':_0x0461('0x30'),'field':_0x0461('0x31'),'foreignKey':'membername','model':_0x0461('0x32'),'filter':{'field':_0x0461('0x33'),'value':[_0x0461('0x34')]}},{'name':_0x0461('0x35'),'field':_0x0461('0x31'),'foreignKey':'membername','model':'User','filter':{'field':_0x0461('0x33'),'value':[_0x0461('0x36')]}},{'name':_0x0461('0x37'),'field':_0x0461('0x31'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x0461('0x10'),'value':[_0x0461('0x38')]}},{'name':_0x0461('0x39'),'field':_0x0461('0x31'),'foreignKey':'queue','model':_0x0461('0x3a'),'filter':{'field':_0x0461('0x10'),'value':[_0x0461('0x3b')]}}];break;case _0x0461('0x3c'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x3d');break;case _0x0461('0x3e'):_0x5757e8['childModel']=_0x0461('0x3f');break;case _0x0461('0x40'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x41');break;case'ivrcampaigns':_0x5757e8[_0x0461('0x13')]=_0x0461('0x42');break;case _0x0461('0x43'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x44');break;case _0x0461('0x45'):_0x5757e8[_0x0461('0x13')]='MailAccount';break;case _0x0461('0x46'):_0x5757e8['childModel']=_0x0461('0x47');break;case _0x0461('0x48'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x49');break;case _0x0461('0x4a'):_0x5757e8[_0x0461('0x13')]='OpenchannelAccount';break;case _0x0461('0x4b'):_0x5757e8['childModel']=_0x0461('0x4c');break;case _0x0461('0x4d'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x4e');break;case _0x0461('0x4f'):_0x5757e8['childModel']=_0x0461('0x50');break;case _0x0461('0x51'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x52');break;case _0x0461('0x53'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x54');break;case'voicequeues':case _0x0461('0x55'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x3a');if(_0x2ac60e){_0x5757e8[_0x0461('0x19')]=[{'name':_0x0461('0x37')},{'name':'QueueCampaigns'}];}break;case _0x0461('0x56'):case'agents':case _0x0461('0x57'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x32');if(_0x2ac60e){_0x5757e8['parentSections']=[{'name':_0x0461('0x58'),'filter':{'field':_0x0461('0x33'),'value':[_0x0461('0x59'),_0x0461('0x5a')]},'ignore':!![]},{'name':'Agents'},{'name':_0x0461('0x35')}];}break;case _0x0461('0x5b'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x5c');break;case'salesforceaccounts':_0x5757e8[_0x0461('0x13')]=_0x0461('0x5d');break;case _0x0461('0x5e'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x5f');break;case _0x0461('0x60'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x61');break;case'deskaccounts':_0x5757e8[_0x0461('0x13')]=_0x0461('0x62');break;case'zohoaccounts':_0x5757e8[_0x0461('0x13')]=_0x0461('0x63');break;case _0x0461('0x64'):_0x5757e8['childModel']=_0x0461('0x32');break;case _0x0461('0x65'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x66');break;case _0x0461('0x67'):_0x5757e8['childModel']=_0x0461('0x68');break;case _0x0461('0x69'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x6a');break;case'intervals':_0x5757e8['childModel']=_0x0461('0x6b');break;case _0x0461('0x6c'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x6d');break;case'scheduler':_0x5757e8[_0x0461('0x13')]='Schedule';break;case _0x0461('0x6e'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x6f');break;case _0x0461('0x70'):_0x5757e8['childModel']=_0x0461('0x71');break;case'templates':_0x5757e8['childModel']=_0x0461('0x72');break;case _0x0461('0x73'):_0x5757e8[_0x0461('0x13')]='Trigger';break;case _0x0461('0x74'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x75');break;case _0x0461('0x76'):_0x5757e8[_0x0461('0x13')]=_0x0461('0x77');break;case _0x0461('0x78'):_0x5757e8[_0x0461('0x13')]='Plugin';break;case _0x0461('0x79'):_0x5757e8[_0x0461('0x13')]=_0x0461('0xe');_0x5757e8[_0x0461('0x19')]=[{'name':_0x0461('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x0461('0x7b'):_0x5757e8['childModel']=_0x0461('0x7c');break;}return _0x5757e8;}function _0xbe8c31(_0x46ae83,_0x21bcc7){var _0x158f1c=_0x46ae83[_0x0461('0x7d')](0x0)[_0x0461('0x7e')]()+_0x46ae83[_0x0461('0x7f')](0x1);var _0x699b4e={'type':_0x2d4d38['Sequelize']['QueryTypes'][_0x0461('0x80')],'raw':!![]};return new Promise(function(_0x241bc3,_0x56f2c1){var _0x237c2a=squel[_0x0461('0x81')]()['field']('ui.'+_0x158f1c+_0x0461('0x82'),'id')[_0x0461('0x6')](_0x0461('0x83'))[_0x0461('0x84')](_0x0461('0x85')+_0x46ae83+'_interactions','ui')['where']('ui.UserId\x20=\x20?',_0x21bcc7['id']);return _0x2d4d38['sequelize'][_0x0461('0x86')](_0x237c2a['toString'](),_0x699b4e)[_0x0461('0xd')](function(_0x3e4a32){_0x21bcc7[_0x158f1c+_0x0461('0x87')]=_0x3e4a32;_0x241bc3(_0x3e4a32);})[_0x0461('0xa')](function(_0x55f1bd){_0x56f2c1(_0x55f1bd);});});}return _0x633d7b[_0x0461('0x88')](_0x0461('0x89'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x264b3f){var _0x495244={'raw':_0x264b3f[_0x0461('0x86')]['raw'],'where':{}};var _0x1daaaa={};var _0x2f2aed={'count':0x0,'rows':[]};var _0x1a668b=_0x264b3f['query'][_0x0461('0x8a')];var _0x142797=_0x264b3f[_0x0461('0x86')]['mergeResources']||![];var _0x1c16e2=_0x1fe931(_0x1a668b,_0x142797);if(!_0x1c16e2[_0x0461('0x13')])throw new Error(_0x0461('0x8b')+_0x1a668b+'\x27');var _0x446548=[{'name':_0x1a668b}];if(!_[_0x0461('0x8c')](_0x1c16e2['parentSections']))_0x446548=_0x1c16e2['parentSections'];var _0x5975f3=[];for(var _0x443dbe=0x0;_0x443dbe<_0x446548['length'];_0x443dbe++){_0x5975f3[_0x0461('0x8d')](_0x2d4d38[_0x0461('0x8e')][_0x0461('0x8f')]({'where':{'userProfileId':_0x264b3f['params']['id'],'name':_0x446548[_0x443dbe]['name']},'raw':!![]}));}return Promise[_0x0461('0x90')](_0x5975f3)['then'](function(_0x121a95){var _0x2cf2d3=_[_0x0461('0x5')](_0x121a95,function(_0x54cf0f){return _0x54cf0f?_0x54cf0f:undefined;});var _0x1b9d85=_[_0x0461('0x5')](_0x446548,[_0x0461('0x91'),!![]]);var _0x4ac4bb=_['isEmpty'](_0x2cf2d3)&&_[_0x0461('0x8c')](_0x1b9d85)?null:_[_0x0461('0x92')](_0x1b9d85,_0x2cf2d3);if(!_0x4ac4bb)return null;var _0x1627c0=[];for(var _0x50afc7=0x0;_0x50afc7<_0x4ac4bb['length'];_0x50afc7++){var _0x310ca8=_[_0x0461('0x8f')](_0x446548,function(_0x5e09d8){return _0x4ac4bb[_0x50afc7]?_0x5e09d8[_0x0461('0x31')]===_0x4ac4bb[_0x50afc7][_0x0461('0x31')]:null;});if(_0x310ca8){if(_0x4ac4bb[_0x50afc7][_0x0461('0x91')]){_0x1627c0[_0x0461('0x8d')](_0x336565(_0x1c16e2[_0x0461('0x13')],_0x4ac4bb[_0x50afc7]));}else{if(!_0x4ac4bb[_0x50afc7][_0x0461('0x93')]){_0x1627c0['push'](_0x5b868e(_0x310ca8,_0x4ac4bb[_0x50afc7],_0x1c16e2[_0x0461('0x13')]));}else{if(_0x310ca8[_0x0461('0xc')]){_0x1627c0[_0x0461('0x8d')](_0x2a00bc(_0x310ca8,_0x4ac4bb[_0x50afc7]));}}}}}return Promise[_0x0461('0x90')](_0x1627c0);})['then'](function(_0x26496a){var _0x3c2a12=_0x26496a;var _0x5f24e4=null;if(_0x3c2a12){_0x5f24e4=_0x3c2a12[_0x0461('0x94')]===0x1?_0x3c2a12[0x0]:null;}if(!_0x5f24e4&&!_0x3c2a12)return _0x2f2aed;var _0x2f578a=_0x2d4d38[_0x1c16e2[_0x0461('0x13')]][_0x0461('0x95')];_0x1daaaa['model']=_['keys'](_0x2f578a);_0x1daaaa['query']=_[_0x0461('0x96')](_0x264b3f['query']);_0x1daaaa['filters']=_[_0x0461('0x97')](_0x1daaaa['model'],_0x1daaaa[_0x0461('0x86')]);_0x495244['attributes']=_['intersection'](_0x1daaaa[_0x0461('0xc')],qs[_0x0461('0x98')](_0x264b3f[_0x0461('0x86')][_0x0461('0x98')]));_0x495244[_0x0461('0x99')]=_0x495244[_0x0461('0x99')][_0x0461('0x94')]?_0x495244['attributes']:_0x1daaaa[_0x0461('0xc')];if(!_0x264b3f[_0x0461('0x86')][_0x0461('0x9a')](_0x0461('0x9b'))){_0x495244['limit']=qs['limit'](_0x264b3f[_0x0461('0x86')][_0x0461('0x9c')]);_0x495244[_0x0461('0x9d')]=qs[_0x0461('0x9d')](_0x264b3f[_0x0461('0x86')][_0x0461('0x9d')]);}_0x495244[_0x0461('0x9e')]=qs[_0x0461('0x9f')](_0x264b3f['query'][_0x0461('0x9f')]);_0x495244['where']=qs[_0x0461('0xa0')](_[_0x0461('0xa1')](_0x264b3f[_0x0461('0x86')],_0x1daaaa['filters']));if(_0x264b3f['query'][_0x0461('0x5')]){_0x495244[_0x0461('0xa2')]=_[_0x0461('0xa3')](_0x495244[_0x0461('0xa2')],{'$or':_['map'](_0x2f578a,function(_0x473a26){if(_0x473a26[_0x0461('0x10')][_0x0461('0xa4')]!==_0x0461('0xa5')){var _0x88ad61={};_0x88ad61[_0x473a26[_0x0461('0x6')]]={'$like':'%'+_0x264b3f['query'][_0x0461('0x5')]+'%'};return _0x88ad61;}})});}var _0xabba06=[];var _0x5aba5a=null;var _0x2a9db9={};if(_0x5f24e4){_0x5aba5a=_['find'](_0x446548,[_0x0461('0x31'),_0x5f24e4[_0x0461('0x31')]]);if(_0x5aba5a['field']){_0x2a9db9={};if(_0x1c16e2[_0x0461('0x13')]===_0x0461('0xe')){_0x2a9db9[_0x5aba5a['foreignKey']]=_[_0x0461('0x9')](_0x5f24e4[_0x0461('0x8')],'id');}else{_0x2a9db9[_0x5aba5a['foreignKey']]=_0x5f24e4[_0x0461('0x8')];}_0xabba06[_0x0461('0x8d')](_0x2a9db9);}else{_0x495244[_0x0461('0xa2')]['id']=_0x5f24e4[_0x0461('0x8')];}}else{for(var _0x5279f6=0x0;_0x5279f6<_0x3c2a12[_0x0461('0x94')];_0x5279f6++){_0x5aba5a=_[_0x0461('0x8f')](_0x446548,['name',_0x3c2a12[_0x5279f6]['name']]);if(_0x5aba5a[_0x0461('0x6')]){_0x2a9db9={};_0x2a9db9[_0x5aba5a[_0x0461('0xa6')]]=_0x3c2a12[_0x5279f6][_0x0461('0x8')];_0xabba06[_0x0461('0x8d')](_0x2a9db9);}else{if(!_0x495244[_0x0461('0xa2')]['id'])_0x495244[_0x0461('0xa2')]['id']=[];_0x3c2a12[_0x5279f6][_0x0461('0x8')][_0x0461('0xa7')](function(_0x11242f){_0x495244['where']['id'][_0x0461('0x8d')](_0x11242f);});}}}if(!_['isEmpty'](_0xabba06)){_0x495244[_0x0461('0xa2')]=_['merge'](_0x495244[_0x0461('0xa2')],{'$and':{'$or':_0xabba06}});}_0x495244=_['merge']({},_0x495244,_0x264b3f['options']);if(_0x5f24e4&&!_0x5f24e4[_0x0461('0x93')]&&_0x1c16e2[_0x0461('0x13')]===_0x0461('0xe')){if(_0x264b3f[_0x0461('0x86')]['includeAll']){_0x495244[_0x0461('0xa8')]=[{'all':!![]}];}return _0x2d4d38[_0x1c16e2[_0x0461('0x13')]]['findAll'](_0x495244)[_0x0461('0xd')](function(_0x19608b){var _0x8a6d0e=[];_0x19608b[_0x0461('0xa7')](function(_0x41a6d7){var _0x35053d;switch(_0x41a6d7['reportType']){case'default':_0x35053d=_[_0x0461('0x8f')](_0x5f24e4[_0x0461('0x8')],function(_0xa95f52){return _0xa95f52['id']===_0x41a6d7[_0x0461('0xa9')]&&_0xa95f52[_0x0461('0x10')]===_0x0461('0xaa');});break;case _0x0461('0xab'):_0x35053d=_[_0x0461('0x8f')](_0x5f24e4['associatedResources'],function(_0x565115){return _0x565115['id']===_0x41a6d7[_0x0461('0xa9')]&&_0x565115[_0x0461('0x10')]===_0x0461('0xac');});break;}if(_0x35053d)_0x8a6d0e[_0x0461('0x8d')](_0x41a6d7);});_0x2f2aed[_0x0461('0xad')]=_0x8a6d0e[_0x0461('0x94')];_0x2f2aed[_0x0461('0xae')]=_0x8a6d0e;return _0x2f2aed;});}else{if(!_[_0x0461('0x8c')](_0x264b3f[_0x0461('0x86')]['ids'])){_0x495244['where']['id']=_0x495244[_0x0461('0xa2')]['id']?_['intersection'](_0x495244[_0x0461('0xa2')]['id'],_0x264b3f[_0x0461('0x86')][_0x0461('0xaf')]):_0x264b3f[_0x0461('0x86')][_0x0461('0xaf')];if(_0x264b3f[_0x0461('0x86')][_0x0461('0xb0')]){_0x495244[_0x0461('0x9e')]=_0x264b3f[_0x0461('0x86')][_0x0461('0xb0')];}}if(_0x264b3f['query'][_0x0461('0xb1')]){_0x495244['where']=_['merge'](_0x495244[_0x0461('0xa2')],{'$and':_0x264b3f[_0x0461('0x86')][_0x0461('0xb1')]});}return _0x2d4d38[_0x1c16e2[_0x0461('0x13')]][_0x0461('0xad')]({'where':_0x495244[_0x0461('0xa2')]})['then'](function(_0x186a48){_0x2f2aed['count']=_0x186a48;if(_0x264b3f['query'][_0x0461('0xb2')]){if(_0x1c16e2['childModel']===_0x0461('0x1e')){_0x495244[_0x0461('0xa8')]=[{'model':_0x2d4d38['Tag'],'as':'Tags','attributes':['id','name',_0x0461('0xb3')],'required':_0x264b3f[_0x0461('0x86')][_0x0461('0xb4')]?!![]:![]},{'model':_0x2d4d38[_0x0461('0x71')],'as':_0x0461('0xb5'),'attributes':['id',_0x0461('0x31'),'color'],'through':_0x264b3f[_0x0461('0x86')][_0x0461('0xb4')]?{'attributes':[],'where':{'TagId':_0x264b3f[_0x0461('0x86')][_0x0461('0xb4')]||undefined}}:{},'required':_0x264b3f[_0x0461('0x86')]['tag']?!![]:![]}];}else{_0x495244['include']=[{'all':!![]}];}}return _0x2d4d38[_0x1c16e2[_0x0461('0x13')]][_0x0461('0x7')](_0x495244);})['then'](function(_0x571974){_0x2f2aed[_0x0461('0xae')]=_0x571974;if(_0x1a668b===_0x0461('0x30')&&_0x264b3f[_0x0461('0x86')][_0x0461('0xb6')]===_0x0461('0xb7')){var _0x5270c1=[];for(var _0x2c49cd=0x0;_0x2c49cd<_0x2f2aed['rows'][_0x0461('0x94')];_0x2c49cd++){_0x5270c1[_0x0461('0x8d')](_0xbe8c31(_0x0461('0xb8'),_0x2f2aed[_0x0461('0xae')][_0x2c49cd][_0x0461('0xb9')]));_0x5270c1[_0x0461('0x8d')](_0xbe8c31(_0x0461('0xba'),_0x2f2aed[_0x0461('0xae')][_0x2c49cd][_0x0461('0xb9')]));_0x5270c1[_0x0461('0x8d')](_0xbe8c31(_0x0461('0xbb'),_0x2f2aed['rows'][_0x2c49cd]['dataValues']));_0x5270c1['push'](_0xbe8c31(_0x0461('0xbc'),_0x2f2aed[_0x0461('0xae')][_0x2c49cd]['dataValues']));_0x5270c1[_0x0461('0x8d')](_0xbe8c31(_0x0461('0xbd'),_0x2f2aed['rows'][_0x2c49cd]['dataValues']));_0x5270c1['push'](_0xbe8c31('whatsapp',_0x2f2aed[_0x0461('0xae')][_0x2c49cd]['dataValues']));}return Promise[_0x0461('0x90')](_0x5270c1)[_0x0461('0xd')](function(){return _0x2f2aed;});}return _0x2f2aed;});}});}}});}; \ No newline at end of file +var _0xd169=['ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','autoAssociation','keys','filters','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','key','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','./userProfile.attributes','../../components/parsers/qs','exports','models','value','findAll','map','catch','filter','field','model','then','associatedResources','name','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','voicemails','VoiceMail','voicerecordings','VoiceRecording','parentSections','User','agent','Telephones','role','telephone','queue','inbound','QueueCampaigns','VoiceQueue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','VoiceQueues','users','telephones','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','_interactions'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xd169,0x1b0));var _0x9d16=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd169[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var attributes=require(_0x9d16('0x0'));var qs=require(_0x9d16('0x1'));var squel=require('squel');module[_0x9d16('0x2')]=function(_0x58ea9b){var _0x18b9ff=_0x58ea9b[_0x9d16('0x3')];function _0x39f374(_0x38040e,_0x370cb4){return new Promise(function(_0x40d0bb,_0x504972){if(!_0x370cb4)return _0x40d0bb(null);var _0x511d53=_0x370cb4['filter']?{[_0x370cb4['filter']['field']]:_0x370cb4['filter'][_0x9d16('0x4')]}:undefined;return _0x18b9ff[_0x38040e][_0x9d16('0x5')]({'where':_0x511d53,'raw':!![]})['then'](function(_0x33a063){_0x370cb4['associatedResources']=_[_0x9d16('0x6')](_0x33a063,'id');_0x40d0bb(_0x370cb4);})[_0x9d16('0x7')](function(_0x5ec03c){_0x504972(_0x5ec03c);});});}function _0x357388(_0x3ea3a4,_0x4d5e2d){return new Promise(function(_0x19ad9a,_0x565477){var _0x129199=_0x3ea3a4[_0x9d16('0x8')]?{[_0x3ea3a4[_0x9d16('0x8')][_0x9d16('0x9')]]:_0x3ea3a4[_0x9d16('0x8')][_0x9d16('0x4')]}:undefined;return _0x18b9ff[_0x3ea3a4[_0x9d16('0xa')]][_0x9d16('0x5')]({'where':_0x129199,'raw':!![]})[_0x9d16('0xb')](function(_0x439d5f){_0x4d5e2d[_0x9d16('0xc')]=_[_0x9d16('0x6')](_0x439d5f,function(_0x11a60e){return _0x11a60e[_0x9d16('0xd')];});_0x19ad9a(_0x4d5e2d);})[_0x9d16('0x7')](function(_0x426682){_0x565477(_0x426682);});});}function _0x4a6aa4(_0x3e6aa7,_0x2473e7,_0x49483c){if(!_0x2473e7)return Promise['resolve'](null);return new Promise(function(_0x58153e,_0x2dc5b4){return _0x18b9ff['UserProfileResource'][_0x9d16('0x5')]({'where':{'sectionId':_0x2473e7['id']},'raw':!![]})[_0x9d16('0xb')](function(_0x5a03d8){if(_0x3e6aa7[_0x9d16('0x9')]&&_0x3e6aa7[_0x9d16('0x9')]!=='id'){_0x2473e7['associatedResources']=_[_0x9d16('0x6')](_0x5a03d8,function(_0x18afb5){return _0x18afb5[_0x3e6aa7['field']];});}else{if(_0x49483c===_0x9d16('0xe')){_0x2473e7[_0x9d16('0xc')]=_['map'](_0x5a03d8,function(_0xfff93d){return{'id':_0xfff93d['resourceId'],'type':_0xfff93d[_0x9d16('0xf')]};});}else{_0x2473e7[_0x9d16('0xc')]=_[_0x9d16('0x6')](_0x5a03d8,function(_0xb50656){return _0xb50656[_0x9d16('0x10')];});}}_0x58153e(_0x2473e7);})['catch'](function(_0x50330b){_0x2dc5b4(_0x50330b);});});}function _0x5c5960(_0x476e77,_0x4dbee2){var _0x79adb7={'parentSections':[]};switch(_0x476e77[_0x9d16('0x11')]()){case _0x9d16('0x12'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x14');break;case _0x9d16('0x15'):_0x79adb7['childModel']=_0x9d16('0x16');break;case _0x9d16('0x17'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x18');_0x79adb7['parentSections']=[{'name':_0x9d16('0x19'),'field':'name','foreignKey':_0x9d16('0x1a')}];break;case _0x9d16('0x1b'):_0x79adb7[_0x9d16('0x13')]='JscriptyProject';break;case _0x9d16('0x1c'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x1d');_0x79adb7['parentSections']=[{'name':_0x9d16('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x9d16('0x1f'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x20');break;case _0x9d16('0x21'):_0x79adb7['childModel']='CmCompany';break;case'globalcustomfields':_0x79adb7['childModel']=_0x9d16('0x22');break;case'chatqueues':_0x79adb7['childModel']=_0x9d16('0x23');break;case _0x9d16('0x24'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x25');break;case _0x9d16('0x26'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x27');break;case _0x9d16('0x28'):_0x79adb7[_0x9d16('0x13')]='FaxAccount';break;case _0x9d16('0x29'):case'internalroutes':case'outboundroutes':_0x79adb7[_0x9d16('0x13')]='VoiceExtension';break;case'contexts':_0x79adb7[_0x9d16('0x13')]='VoiceContext';break;case _0x9d16('0x2a'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x2b');break;case _0x9d16('0x2c'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x2d');_0x79adb7[_0x9d16('0x2e')]=[{'name':'Agents','field':_0x9d16('0xd'),'foreignKey':'membername','model':_0x9d16('0x2f'),'filter':{'field':'role','value':[_0x9d16('0x30')]}},{'name':_0x9d16('0x31'),'field':_0x9d16('0xd'),'foreignKey':'membername','model':'User','filter':{'field':_0x9d16('0x32'),'value':[_0x9d16('0x33')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x9d16('0x34'),'model':'VoiceQueue','filter':{'field':_0x9d16('0xf'),'value':[_0x9d16('0x35')]}},{'name':_0x9d16('0x36'),'field':_0x9d16('0xd'),'foreignKey':'queue','model':_0x9d16('0x37'),'filter':{'field':_0x9d16('0xf'),'value':['outbound']}}];break;case _0x9d16('0x38'):_0x79adb7['childModel']=_0x9d16('0x39');break;case _0x9d16('0x3a'):_0x79adb7['childModel']=_0x9d16('0x3b');break;case _0x9d16('0x3c'):_0x79adb7['childModel']='VoicePrefix';break;case _0x9d16('0x3d'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x3e');break;case'mailqueues':_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x3f');break;case _0x9d16('0x40'):_0x79adb7['childModel']=_0x9d16('0x41');break;case'mailsubstatuses':_0x79adb7['childModel']=_0x9d16('0x42');break;case'openchannelqueues':_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x43');break;case _0x9d16('0x44'):_0x79adb7['childModel']=_0x9d16('0x45');break;case _0x9d16('0x46'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x47');break;case'smsaccounts':_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x48');break;case'whatsappqueues':_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x49');break;case _0x9d16('0x4a'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x4b');break;case _0x9d16('0x4c'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x4d');break;case'voicequeues':case _0x9d16('0x4e'):_0x79adb7[_0x9d16('0x13')]='VoiceQueue';if(_0x4dbee2){_0x79adb7[_0x9d16('0x2e')]=[{'name':_0x9d16('0x4f')},{'name':_0x9d16('0x36')}];}break;case _0x9d16('0x50'):case'agents':case _0x9d16('0x51'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x2f');if(_0x4dbee2){_0x79adb7['parentSections']=[{'name':'Users','filter':{'field':_0x9d16('0x32'),'value':['admin',_0x9d16('0x52')]},'ignore':!![]},{'name':_0x9d16('0x53')},{'name':_0x9d16('0x31')}];}break;case _0x9d16('0x54'):_0x79adb7['childModel']=_0x9d16('0x55');break;case _0x9d16('0x56'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x57');break;case _0x9d16('0x58'):_0x79adb7[_0x9d16('0x13')]='FreshdeskAccount';break;case _0x9d16('0x59'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x5a');break;case _0x9d16('0x5b'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x5c');break;case _0x9d16('0x5d'):_0x79adb7[_0x9d16('0x13')]='ZohoAccount';break;case _0x9d16('0x5e'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x2f');break;case _0x9d16('0x5f'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x60');break;case _0x9d16('0x61'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x62');break;case _0x9d16('0x63'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x64');break;case _0x9d16('0x65'):_0x79adb7['childModel']=_0x9d16('0x66');break;case _0x9d16('0x67'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x68');break;case _0x9d16('0x69'):_0x79adb7['childModel']=_0x9d16('0x6a');break;case _0x9d16('0x6b'):_0x79adb7['childModel']=_0x9d16('0x6c');break;case'tags':_0x79adb7['childModel']=_0x9d16('0x6d');break;case _0x9d16('0x6e'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x6f');break;case _0x9d16('0x70'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x71');break;case'trunks':_0x79adb7['childModel']=_0x9d16('0x72');break;case _0x9d16('0x73'):_0x79adb7['childModel']=_0x9d16('0x74');break;case _0x9d16('0x75'):_0x79adb7[_0x9d16('0x13')]=_0x9d16('0x76');break;case'extractedreports':_0x79adb7['childModel']=_0x9d16('0xe');_0x79adb7[_0x9d16('0x2e')]=[{'name':_0x9d16('0x77'),'field':'id','foreignKey':_0x9d16('0x78')}];break;case'metrics':_0x79adb7[_0x9d16('0x13')]='AnalyticMetric';break;}return _0x79adb7;}function _0x59822e(_0x5f0ada,_0x33c63c){var _0x3ce689=_0x5f0ada[_0x9d16('0x79')](0x0)[_0x9d16('0x7a')]()+_0x5f0ada[_0x9d16('0x7b')](0x1);var _0x142fc6={'type':_0x18b9ff[_0x9d16('0x7c')][_0x9d16('0x7d')][_0x9d16('0x7e')],'raw':!![]};return new Promise(function(_0x308bdc,_0x591370){var _0x4a5ef3=squel[_0x9d16('0x7f')]()[_0x9d16('0x9')](_0x9d16('0x80')+_0x3ce689+_0x9d16('0x81'),'id')['field'](_0x9d16('0x82'))['from']('user_has_'+_0x5f0ada+_0x9d16('0x83'),'ui')['where'](_0x9d16('0x84'),_0x33c63c['id']);return _0x18b9ff[_0x9d16('0x85')][_0x9d16('0x86')](_0x4a5ef3['toString'](),_0x142fc6)[_0x9d16('0xb')](function(_0x473853){_0x33c63c[_0x3ce689+'OpenTabs']=_0x473853;_0x308bdc(_0x473853);})[_0x9d16('0x7')](function(_0x475479){_0x591370(_0x475479);});});}return _0x58ea9b[_0x9d16('0x87')](_0x9d16('0x88'),attributes,{'tableName':_0x9d16('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x45d71b){var _0x4e2526={'raw':_0x45d71b[_0x9d16('0x86')][_0x9d16('0x8a')],'where':{}};var _0x4a548c={};var _0x792c46={'count':0x0,'rows':[]};var _0x1ac2b6=_0x45d71b['query'][_0x9d16('0x8b')];var _0x4030b3=_0x45d71b[_0x9d16('0x86')][_0x9d16('0x8c')]||![];var _0x8e8698=_0x5c5960(_0x1ac2b6,_0x4030b3);if(!_0x8e8698[_0x9d16('0x13')])throw new Error(_0x9d16('0x8d')+_0x1ac2b6+'\x27');var _0xe81efb=[{'name':_0x1ac2b6}];if(!_['isEmpty'](_0x8e8698[_0x9d16('0x2e')]))_0xe81efb=_0x8e8698['parentSections'];var _0x7860b6=[];for(var _0x8ee75e=0x0;_0x8ee75e<_0xe81efb[_0x9d16('0x8e')];_0x8ee75e++){_0x7860b6[_0x9d16('0x8f')](_0x18b9ff[_0x9d16('0x90')][_0x9d16('0x91')]({'where':{'userProfileId':_0x45d71b[_0x9d16('0x92')]['id'],'name':_0xe81efb[_0x8ee75e][_0x9d16('0xd')]},'raw':!![]}));}return Promise[_0x9d16('0x93')](_0x7860b6)[_0x9d16('0xb')](function(_0x522add){var _0x4fd0a5=_['filter'](_0x522add,function(_0x4e5409){return _0x4e5409?_0x4e5409:undefined;});var _0x4c29ba=_['filter'](_0xe81efb,[_0x9d16('0x94'),!![]]);var _0x1d6f94=_[_0x9d16('0x95')](_0x4fd0a5)&&_['isEmpty'](_0x4c29ba)?null:_['union'](_0x4c29ba,_0x4fd0a5);if(!_0x1d6f94)return null;var _0xfb099d=[];for(var _0x8d8bdf=0x0;_0x8d8bdf<_0x1d6f94[_0x9d16('0x8e')];_0x8d8bdf++){var _0xd3a3e2=_['find'](_0xe81efb,function(_0x4a9e29){return _0x1d6f94[_0x8d8bdf]?_0x4a9e29['name']===_0x1d6f94[_0x8d8bdf][_0x9d16('0xd')]:null;});if(_0xd3a3e2){if(_0x1d6f94[_0x8d8bdf][_0x9d16('0x94')]){_0xfb099d[_0x9d16('0x8f')](_0x39f374(_0x8e8698[_0x9d16('0x13')],_0x1d6f94[_0x8d8bdf]));}else{if(!_0x1d6f94[_0x8d8bdf][_0x9d16('0x96')]){_0xfb099d[_0x9d16('0x8f')](_0x4a6aa4(_0xd3a3e2,_0x1d6f94[_0x8d8bdf],_0x8e8698[_0x9d16('0x13')]));}else{if(_0xd3a3e2['model']){_0xfb099d['push'](_0x357388(_0xd3a3e2,_0x1d6f94[_0x8d8bdf]));}}}}}return Promise[_0x9d16('0x93')](_0xfb099d);})['then'](function(_0x281329){var _0x5f431d=_0x281329;var _0x407e22=null;if(_0x5f431d){_0x407e22=_0x5f431d[_0x9d16('0x8e')]===0x1?_0x5f431d[0x0]:null;}if(!_0x407e22&&!_0x5f431d)return _0x792c46;var _0x259a2f=_0x18b9ff[_0x8e8698[_0x9d16('0x13')]]['rawAttributes'];_0x4a548c[_0x9d16('0xa')]=_[_0x9d16('0x97')](_0x259a2f);_0x4a548c['query']=_['keys'](_0x45d71b[_0x9d16('0x86')]);_0x4a548c[_0x9d16('0x98')]=_['intersection'](_0x4a548c['model'],_0x4a548c[_0x9d16('0x86')]);_0x4e2526[_0x9d16('0x99')]=_['intersection'](_0x4a548c['model'],qs[_0x9d16('0x9a')](_0x45d71b[_0x9d16('0x86')][_0x9d16('0x9a')]));_0x4e2526['attributes']=_0x4e2526[_0x9d16('0x99')][_0x9d16('0x8e')]?_0x4e2526[_0x9d16('0x99')]:_0x4a548c[_0x9d16('0xa')];if(!_0x45d71b['query'][_0x9d16('0x9b')](_0x9d16('0x9c'))){_0x4e2526['limit']=qs['limit'](_0x45d71b[_0x9d16('0x86')]['limit']);_0x4e2526[_0x9d16('0x9d')]=qs[_0x9d16('0x9d')](_0x45d71b[_0x9d16('0x86')]['offset']);}_0x4e2526[_0x9d16('0x9e')]=qs[_0x9d16('0x9f')](_0x45d71b[_0x9d16('0x86')]['sort']);_0x4e2526[_0x9d16('0xa0')]=qs[_0x9d16('0x98')](_[_0x9d16('0xa1')](_0x45d71b['query'],_0x4a548c[_0x9d16('0x98')]));if(_0x45d71b['query'][_0x9d16('0x8')]){_0x4e2526[_0x9d16('0xa0')]=_[_0x9d16('0xa2')](_0x4e2526[_0x9d16('0xa0')],{'$or':_[_0x9d16('0x6')](_0x259a2f,function(_0x3b6d7e){if(_0x3b6d7e[_0x9d16('0xf')][_0x9d16('0xa3')]!=='VIRTUAL'){var _0x2907cf={};_0x2907cf[_0x3b6d7e[_0x9d16('0x9')]]={'$like':'%'+_0x45d71b[_0x9d16('0x86')][_0x9d16('0x8')]+'%'};return _0x2907cf;}})});}var _0x924d2e=[];var _0x2bb2e9=null;var _0x215c5b={};if(_0x407e22){_0x2bb2e9=_[_0x9d16('0x91')](_0xe81efb,['name',_0x407e22[_0x9d16('0xd')]]);if(_0x2bb2e9['field']){_0x215c5b={};if(_0x8e8698[_0x9d16('0x13')]===_0x9d16('0xe')){_0x215c5b[_0x2bb2e9['foreignKey']]=_[_0x9d16('0x6')](_0x407e22[_0x9d16('0xc')],'id');}else{_0x215c5b[_0x2bb2e9[_0x9d16('0xa4')]]=_0x407e22[_0x9d16('0xc')];}_0x924d2e[_0x9d16('0x8f')](_0x215c5b);}else{_0x4e2526['where']['id']=_0x407e22[_0x9d16('0xc')];}}else{for(var _0x142e28=0x0;_0x142e28<_0x5f431d[_0x9d16('0x8e')];_0x142e28++){_0x2bb2e9=_['find'](_0xe81efb,['name',_0x5f431d[_0x142e28][_0x9d16('0xd')]]);if(_0x2bb2e9[_0x9d16('0x9')]){_0x215c5b={};_0x215c5b[_0x2bb2e9['foreignKey']]=_0x5f431d[_0x142e28][_0x9d16('0xc')];_0x924d2e[_0x9d16('0x8f')](_0x215c5b);}else{if(!_0x4e2526[_0x9d16('0xa0')]['id'])_0x4e2526[_0x9d16('0xa0')]['id']=[];_0x5f431d[_0x142e28][_0x9d16('0xc')]['forEach'](function(_0x541713){_0x4e2526[_0x9d16('0xa0')]['id'][_0x9d16('0x8f')](_0x541713);});}}}if(!_[_0x9d16('0x95')](_0x924d2e)){_0x4e2526[_0x9d16('0xa0')]=_[_0x9d16('0xa2')](_0x4e2526[_0x9d16('0xa0')],{'$and':{'$or':_0x924d2e}});}_0x4e2526=_['merge']({},_0x4e2526,_0x45d71b[_0x9d16('0xa5')]);if(_0x407e22&&!_0x407e22[_0x9d16('0x96')]&&_0x8e8698[_0x9d16('0x13')]===_0x9d16('0xe')){if(_0x45d71b['query'][_0x9d16('0xa6')]){_0x4e2526[_0x9d16('0xa7')]=[{'all':!![]}];}return _0x18b9ff[_0x8e8698[_0x9d16('0x13')]][_0x9d16('0x5')](_0x4e2526)['then'](function(_0x43402f){var _0x2d03bf=[];_0x43402f[_0x9d16('0xa8')](function(_0x4ddcca){var _0x5b0c88;switch(_0x4ddcca[_0x9d16('0xa9')]){case _0x9d16('0xaa'):_0x5b0c88=_['find'](_0x407e22[_0x9d16('0xc')],function(_0x403f97){return _0x403f97['id']===_0x4ddcca[_0x9d16('0x78')]&&_0x403f97[_0x9d16('0xf')]===_0x9d16('0xab');});break;case _0x9d16('0xac'):_0x5b0c88=_[_0x9d16('0x91')](_0x407e22[_0x9d16('0xc')],function(_0x122bf4){return _0x122bf4['id']===_0x4ddcca[_0x9d16('0x78')]&&_0x122bf4[_0x9d16('0xf')]===_0x9d16('0xad');});break;}if(_0x5b0c88)_0x2d03bf['push'](_0x4ddcca);});_0x792c46[_0x9d16('0xae')]=_0x2d03bf[_0x9d16('0x8e')];_0x792c46[_0x9d16('0xaf')]=_0x2d03bf;return _0x792c46;});}else{if(!_[_0x9d16('0x95')](_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb0')])){_0x4e2526[_0x9d16('0xa0')]['id']=_0x4e2526[_0x9d16('0xa0')]['id']?_['intersection'](_0x4e2526[_0x9d16('0xa0')]['id'],_0x45d71b['query'][_0x9d16('0xb0')]):_0x45d71b['query'][_0x9d16('0xb0')];if(_0x45d71b['query'][_0x9d16('0xb1')]){_0x4e2526[_0x9d16('0x9e')]=_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb1')];}}if(_0x45d71b[_0x9d16('0x86')]['extraQueryConditions']){_0x4e2526[_0x9d16('0xa0')]=_[_0x9d16('0xa2')](_0x4e2526[_0x9d16('0xa0')],{'$and':_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb2')]});}return _0x18b9ff[_0x8e8698[_0x9d16('0x13')]][_0x9d16('0xae')]({'where':_0x4e2526['where']})[_0x9d16('0xb')](function(_0x4d20b5){_0x792c46['count']=_0x4d20b5;if(_0x45d71b[_0x9d16('0x86')][_0x9d16('0xa6')]){if(_0x8e8698[_0x9d16('0x13')]===_0x9d16('0x1d')){_0x4e2526['include']=[{'model':_0x18b9ff[_0x9d16('0x6d')],'as':'Tags','attributes':['id',_0x9d16('0xd'),_0x9d16('0xb3')],'required':_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb4')]?!![]:![]},{'model':_0x18b9ff['Tag'],'as':_0x9d16('0xb5'),'attributes':['id',_0x9d16('0xd'),'color'],'through':_0x45d71b['query']['tag']?{'attributes':[],'where':{'TagId':_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb4')]||undefined}}:{},'required':_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb4')]?!![]:![]}];}else{_0x4e2526[_0x9d16('0xa7')]=[{'all':!![]}];}}return _0x18b9ff[_0x8e8698[_0x9d16('0x13')]][_0x9d16('0x5')](_0x4e2526);})[_0x9d16('0xb')](function(_0x50ab91){_0x792c46['rows']=_0x50ab91;if(_0x1ac2b6==='Agents'&&_0x45d71b[_0x9d16('0x86')][_0x9d16('0xb6')]===_0x9d16('0xb7')){var _0x2ef35a=[];for(var _0xf93b6b=0x0;_0xf93b6b<_0x792c46[_0x9d16('0xaf')][_0x9d16('0x8e')];_0xf93b6b++){_0x2ef35a['push'](_0x59822e('chat',_0x792c46['rows'][_0xf93b6b][_0x9d16('0xb8')]));_0x2ef35a['push'](_0x59822e(_0x9d16('0xb9'),_0x792c46['rows'][_0xf93b6b][_0x9d16('0xb8')]));_0x2ef35a['push'](_0x59822e(_0x9d16('0xba'),_0x792c46[_0x9d16('0xaf')][_0xf93b6b][_0x9d16('0xb8')]));_0x2ef35a['push'](_0x59822e(_0x9d16('0xbb'),_0x792c46[_0x9d16('0xaf')][_0xf93b6b][_0x9d16('0xb8')]));_0x2ef35a[_0x9d16('0x8f')](_0x59822e('openchannel',_0x792c46[_0x9d16('0xaf')][_0xf93b6b]['dataValues']));_0x2ef35a[_0x9d16('0x8f')](_0x59822e('whatsapp',_0x792c46['rows'][_0xf93b6b]['dataValues']));}return Promise['all'](_0x2ef35a)[_0x9d16('0xb')](function(){return _0x792c46;});}return _0x792c46;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 2bb6227..7a78adb 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 _0xdded=['defaults','localhost','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x584e41,_0x20355b){var _0x5ec08c=function(_0x41818d){while(--_0x41818d){_0x584e41['push'](_0x584e41['shift']());}};_0x5ec08c(++_0x20355b);}(_0xdded,0x17a));var _0xddde=function(_0x52b8f7,_0x26218f){_0x52b8f7=_0x52b8f7-0x0;var _0x1f2ff9=_0xdded[_0x52b8f7];return _0x1f2ff9;};'use strict';var _=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var moment=require(_0xddde('0x2'));var BPromise=require(_0xddde('0x3'));var rs=require(_0xddde('0x4'));var fs=require('fs');var Redis=require(_0xddde('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xddde('0x6'));var logger=require(_0xddde('0x7'))(_0xddde('0x8'));var config=require(_0xddde('0x9'));var jayson=require(_0xddde('0xa'));var client=jayson[_0xddde('0xb')][_0xddde('0xc')]({'port':0x232a});config[_0xddde('0xd')]=_[_0xddde('0xe')](config[_0xddde('0xd')],{'host':_0xddde('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddde('0xd')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x4820a5,_0x438f74,_0x567859){return new BPromise(function(_0x247097,_0x5a01fc){return client[_0xddde('0x10')](_0x4820a5,_0x567859)[_0xddde('0x11')](function(_0xaaed0c){logger[_0xddde('0x12')](_0xddde('0x13'),_0x438f74,_0xddde('0x14'));logger[_0xddde('0x15')](_0xddde('0x16'),_0x438f74,'request\x20sent',JSON[_0xddde('0x17')](_0xaaed0c));if(_0xaaed0c[_0xddde('0x18')]){if(_0xaaed0c[_0xddde('0x18')][_0xddde('0x19')]===0x1f4){logger[_0xddde('0x18')](_0xddde('0x13'),_0x438f74,_0xaaed0c['error'][_0xddde('0x1a')]);return _0x5a01fc(_0xaaed0c[_0xddde('0x18')][_0xddde('0x1a')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x438f74,_0xaaed0c[_0xddde('0x18')]['message']);return _0x247097(_0xaaed0c[_0xddde('0x18')][_0xddde('0x1a')]);}else{logger[_0xddde('0x12')](_0xddde('0x13'),_0x438f74,_0xddde('0x14'));_0x247097(_0xaaed0c['result'][_0xddde('0x1a')]);}})[_0xddde('0x1b')](function(_0x4d251c){logger[_0xddde('0x18')](_0xddde('0x13'),_0x438f74,_0x4d251c);_0x5a01fc(_0x4d251c);});});} \ No newline at end of file +var _0x4744=['defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x55df79,_0x55b40d){var _0xcd674b=function(_0x29153e){while(--_0x29153e){_0x55df79['push'](_0x55df79['shift']());}};_0xcd674b(++_0x55b40d);}(_0x4744,0x107));var _0x4474=function(_0x4d0b17,_0x5e435b){_0x4d0b17=_0x4d0b17-0x0;var _0x1138a3=_0x4744[_0x4d0b17];return _0x1138a3;};'use strict';var _=require(_0x4474('0x0'));var util=require(_0x4474('0x1'));var moment=require('moment');var BPromise=require(_0x4474('0x2'));var rs=require(_0x4474('0x3'));var fs=require('fs');var Redis=require(_0x4474('0x4'));var db=require(_0x4474('0x5'))['db'];var utils=require(_0x4474('0x6'));var logger=require(_0x4474('0x7'))(_0x4474('0x8'));var config=require(_0x4474('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4474('0xa')]({'port':0x232a});config[_0x4474('0xb')]=_[_0x4474('0xc')](config[_0x4474('0xb')],{'host':_0x4474('0xd'),'port':0x18eb});var socket=require(_0x4474('0xe'))(new Redis(config[_0x4474('0xb')]));require('./userProfile.socket')[_0x4474('0xf')](socket);function respondWithRpcPromise(_0x191634,_0x34bbd3,_0x2cefd3){return new BPromise(function(_0x1e14ad,_0x3aab8f){return client[_0x4474('0x10')](_0x191634,_0x2cefd3)['then'](function(_0x4f880c){logger['info']('UserProfile,\x20%s,\x20%s',_0x34bbd3,_0x4474('0x11'));logger[_0x4474('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x34bbd3,_0x4474('0x11'),JSON['stringify'](_0x4f880c));if(_0x4f880c[_0x4474('0x13')]){if(_0x4f880c[_0x4474('0x13')][_0x4474('0x14')]===0x1f4){logger[_0x4474('0x13')](_0x4474('0x15'),_0x34bbd3,_0x4f880c[_0x4474('0x13')][_0x4474('0x16')]);return _0x3aab8f(_0x4f880c[_0x4474('0x13')][_0x4474('0x16')]);}logger['error'](_0x4474('0x15'),_0x34bbd3,_0x4f880c['error']['message']);return _0x1e14ad(_0x4f880c[_0x4474('0x13')][_0x4474('0x16')]);}else{logger['info'](_0x4474('0x15'),_0x34bbd3,_0x4474('0x11'));_0x1e14ad(_0x4f880c[_0x4474('0x17')][_0x4474('0x16')]);}})[_0x4474('0x18')](function(_0x249ae0){logger['error'](_0x4474('0x15'),_0x34bbd3,_0x249ae0);_0x3aab8f(_0x249ae0);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d1e41d7..0524dde 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 _0xcc22=['update','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x2e270b,_0x21c278){var _0x2d08d9=function(_0x3d44a0){while(--_0x3d44a0){_0x2e270b['push'](_0x2e270b['shift']());}};_0x2d08d9(++_0x21c278);}(_0xcc22,0xd5));var _0x2cc2=function(_0x468576,_0x27ff62){_0x468576=_0x468576-0x0;var _0x144d00=_0xcc22[_0x468576];return _0x144d00;};'use strict';var UserProfileEvents=require(_0x2cc2('0x0'));var events=[_0x2cc2('0x1'),_0x2cc2('0x2'),_0x2cc2('0x3')];function createListener(_0x59980e,_0x16acd1){return function(_0x4284a7){_0x16acd1['emit'](_0x59980e,_0x4284a7);};}function removeListener(_0x6cad80,_0x4fbbd3){return function(){UserProfileEvents[_0x2cc2('0x4')](_0x6cad80,_0x4fbbd3);};}exports[_0x2cc2('0x5')]=function(_0x183a64){for(var _0x220b71=0x0,_0x5af82d=events[_0x2cc2('0x6')];_0x220b71<_0x5af82d;_0x220b71++){var _0x2d47e7=events[_0x220b71];var _0x2d581d=createListener(_0x2cc2('0x7')+_0x2d47e7,_0x183a64);UserProfileEvents['on'](_0x2d47e7,_0x2d581d);}}; \ No newline at end of file +var _0x0cc5=['userProfile:','save','remove','update','emit','register','length'];(function(_0xd9442a,_0x29628a){var _0xd3a253=function(_0x2b24e8){while(--_0x2b24e8){_0xd9442a['push'](_0xd9442a['shift']());}};_0xd3a253(++_0x29628a);}(_0x0cc5,0x12e));var _0x50cc=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x0cc5[_0x1d7300];return _0x46ee98;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x50cc('0x0'),_0x50cc('0x1'),_0x50cc('0x2')];function createListener(_0x1814ac,_0x17762b){return function(_0x11adf1){_0x17762b[_0x50cc('0x3')](_0x1814ac,_0x11adf1);};}function removeListener(_0x27a96c,_0x247ab5){return function(){UserProfileEvents['removeListener'](_0x27a96c,_0x247ab5);};}exports[_0x50cc('0x4')]=function(_0x45ee7e){for(var _0x45749a=0x0,_0xc66fc9=events[_0x50cc('0x5')];_0x45749a<_0xc66fc9;_0x45749a++){var _0x501b31=events[_0x45749a];var _0x775bda=createListener(_0x50cc('0x6')+_0x501b31,_0x45ee7e);UserProfileEvents['on'](_0x501b31,_0x775bda);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 76adbd6..3dd4c06 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 _0x0596=['destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x4b2c8c,_0x30859f){var _0x25be52=function(_0x123c9c){while(--_0x123c9c){_0x4b2c8c['push'](_0x4b2c8c['shift']());}};_0x25be52(++_0x30859f);}(_0x0596,0xac));var _0x6059=function(_0x12a965,_0x41d32f){_0x12a965=_0x12a965-0x0;var _0xf8604e=_0x0596[_0x12a965];return _0xf8604e;};'use strict';var multer=require(_0x6059('0x0'));var util=require('util');var path=require(_0x6059('0x1'));var timeout=require(_0x6059('0x2'));var express=require('express');var router=express[_0x6059('0x3')]();var fs_extra=require(_0x6059('0x4'));var auth=require(_0x6059('0x5'));var interaction=require(_0x6059('0x6'));var config=require(_0x6059('0x7'));var controller=require('./userProfileResource.controller');router[_0x6059('0x8')]('/',auth['isAuthenticated'](),controller[_0x6059('0x9')]);router[_0x6059('0x8')](_0x6059('0xa'),auth['isAuthenticated'](),controller[_0x6059('0xb')]);router[_0x6059('0x8')](_0x6059('0xc'),auth[_0x6059('0xd')](),controller[_0x6059('0xe')]);router[_0x6059('0xf')]('/',auth['isAuthenticated'](),controller[_0x6059('0x10')]);router[_0x6059('0x11')](_0x6059('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6059('0x12')]);module['exports']=router; \ No newline at end of file +var _0x943f=['post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x144a3b,_0x4d2102){var _0x399fa2=function(_0x4f38eb){while(--_0x4f38eb){_0x144a3b['push'](_0x144a3b['shift']());}};_0x399fa2(++_0x4d2102);}(_0x943f,0x181));var _0xf943=function(_0x1a9a21,_0x56d62b){_0x1a9a21=_0x1a9a21-0x0;var _0x55c1ce=_0x943f[_0x1a9a21];return _0x55c1ce;};'use strict';var multer=require(_0xf943('0x0'));var util=require('util');var path=require(_0xf943('0x1'));var timeout=require(_0xf943('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf943('0x3'));var interaction=require(_0xf943('0x4'));var config=require(_0xf943('0x5'));var controller=require(_0xf943('0x6'));router[_0xf943('0x7')]('/',auth[_0xf943('0x8')](),controller[_0xf943('0x9')]);router[_0xf943('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf943('0xa')]);router['get']('/:id',auth[_0xf943('0x8')](),controller['show']);router[_0xf943('0xb')]('/',auth[_0xf943('0x8')](),controller['create']);router[_0xf943('0xc')](_0xf943('0xd'),auth[_0xf943('0x8')](),controller[_0xf943('0xe')]);router[_0xf943('0xf')]('/:id',auth[_0xf943('0x8')](),controller[_0xf943('0x10')]);module[_0xf943('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 98fd2f1..4fa945e 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 _0xca87=['INTEGER','exports','STRING'];(function(_0x2b7413,_0x26dfbc){var _0x11cba6=function(_0x416872){while(--_0x416872){_0x2b7413['push'](_0x2b7413['shift']());}};_0x11cba6(++_0x26dfbc);}(_0xca87,0x106));var _0x7ca8=function(_0x277905,_0x3b0146){_0x277905=_0x277905-0x0;var _0x237f0b=_0xca87[_0x277905];return _0x237f0b;};'use strict';var Sequelize=require('sequelize');module[_0x7ca8('0x0')]={'name':{'type':Sequelize[_0x7ca8('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7ca8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7ca8('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0ae7=['sequelize','exports','INTEGER'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0ae7,0xe1));var _0x70ae=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x0ae7[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0x70ae('0x0'));module[_0x70ae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x70ae('0x2')],'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 43f486e..8b0e5a3 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 _0xdb28=['index','UserProfileResource','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x1bf3b8,_0x8edcaa){var _0x52fd20=function(_0x6cadf){while(--_0x6cadf){_0x1bf3b8['push'](_0x1bf3b8['shift']());}};_0x52fd20(++_0x8edcaa);}(_0xdb28,0x106));var _0x8db2=function(_0x1b132,_0x31cce9){_0x1b132=_0x1b132-0x0;var _0x594c1e=_0xdb28[_0x1b132];return _0x594c1e;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file +var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['UserProfileResource'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cebf68c..c8befbd 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 _0x100e=['../../config/environment','./userProfileResource.attributes','define','compositeIndex','resourceId','sectionId','lodash','api','moment','request-promise','path','rimraf'];(function(_0x48401e,_0x2c169f){var _0x31178e=function(_0x145e14){while(--_0x145e14){_0x48401e['push'](_0x48401e['shift']());}};_0x31178e(++_0x2c169f);}(_0x100e,0x1da));var _0xe100=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x100e[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0xe100('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe100('0x1'));var moment=require(_0xe100('0x2'));var BPromise=require('bluebird');var rp=require(_0xe100('0x3'));var fs=require('fs');var path=require(_0xe100('0x4'));var rimraf=require(_0xe100('0x5'));var config=require(_0xe100('0x6'));var attributes=require(_0xe100('0x7'));module['exports']=function(_0x4e3055,_0x40b9cd){return _0x4e3055[_0xe100('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe100('0x9'),'fields':[_0xe100('0xa'),_0xe100('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a03=['../../config/environment','./userProfileResource.attributes','UserProfileResource','compositeIndex','sectionId','lodash','util','moment','path','rimraf'];(function(_0x549c9a,_0x213785){var _0x56c2f9=function(_0x9e70e2){while(--_0x9e70e2){_0x549c9a['push'](_0x549c9a['shift']());}};_0x56c2f9(++_0x213785);}(_0x8a03,0xcd));var _0x38a0=function(_0x9ffe74,_0x57d477){_0x9ffe74=_0x9ffe74-0x0;var _0x220cfa=_0x8a03[_0x9ffe74];return _0x220cfa;};'use strict';var _=require(_0x38a0('0x0'));var util=require(_0x38a0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38a0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x38a0('0x3'));var rimraf=require(_0x38a0('0x4'));var config=require(_0x38a0('0x5'));var attributes=require(_0x38a0('0x6'));module['exports']=function(_0x39d7c6,_0x4c4ecb){return _0x39d7c6['define'](_0x38a0('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x38a0('0x8'),'fields':['resourceId',_0x38a0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 2a1a887..99dc359 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 _0xffbf=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x45d31c,_0xd0b936){var _0x33c23a=function(_0xe014b0){while(--_0xe014b0){_0x45d31c['push'](_0x45d31c['shift']());}};_0x33c23a(++_0xd0b936);}(_0xffbf,0xdb));var _0xfffb=function(_0x52f81d,_0x1dcb31){_0x52f81d=_0x52f81d-0x0;var _0x4e099e=_0xffbf[_0x52f81d];return _0x4e099e;};'use strict';var _=require('lodash');var util=require(_0xfffb('0x0'));var moment=require(_0xfffb('0x1'));var BPromise=require('bluebird');var rs=require(_0xfffb('0x2'));var fs=require('fs');var Redis=require(_0xfffb('0x3'));var db=require(_0xfffb('0x4'))['db'];var utils=require(_0xfffb('0x5'));var logger=require(_0xfffb('0x6'))(_0xfffb('0x7'));var config=require(_0xfffb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfffb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x286994,_0x2d08aa,_0x1dde22){return new BPromise(function(_0x48a649,_0x14356c){return client[_0xfffb('0xa')](_0x286994,_0x1dde22)[_0xfffb('0xb')](function(_0x20dd43){logger[_0xfffb('0xc')](_0xfffb('0xd'),_0x2d08aa,_0xfffb('0xe'));logger[_0xfffb('0xf')](_0xfffb('0x10'),_0x2d08aa,_0xfffb('0xe'),JSON[_0xfffb('0x11')](_0x20dd43));if(_0x20dd43[_0xfffb('0x12')]){if(_0x20dd43[_0xfffb('0x12')][_0xfffb('0x13')]===0x1f4){logger[_0xfffb('0x12')](_0xfffb('0xd'),_0x2d08aa,_0x20dd43[_0xfffb('0x12')][_0xfffb('0x14')]);return _0x14356c(_0x20dd43[_0xfffb('0x12')][_0xfffb('0x14')]);}logger[_0xfffb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2d08aa,_0x20dd43[_0xfffb('0x12')][_0xfffb('0x14')]);return _0x48a649(_0x20dd43[_0xfffb('0x12')]['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x2d08aa,_0xfffb('0xe'));_0x48a649(_0x20dd43[_0xfffb('0x15')]['message']);}})[_0xfffb('0x16')](function(_0x5aae31){logger[_0xfffb('0x12')](_0xfffb('0xd'),_0x2d08aa,_0x5aae31);_0x14356c(_0x5aae31);});});} \ No newline at end of file +var _0x6463=['error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x6463,0xe9));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3646('0x0'));var moment=require('moment');var BPromise=require(_0x3646('0x1'));var rs=require(_0x3646('0x2'));var fs=require('fs');var Redis=require(_0x3646('0x3'));var db=require(_0x3646('0x4'))['db'];var utils=require(_0x3646('0x5'));var logger=require('../../config/logger')(_0x3646('0x6'));var config=require(_0x3646('0x7'));var jayson=require(_0x3646('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x253908,_0x38a2dc,_0x54e64c){return new BPromise(function(_0x4a5e60,_0x29c528){return client[_0x3646('0x9')](_0x253908,_0x54e64c)[_0x3646('0xa')](function(_0xd8a128){logger['info'](_0x3646('0xb'),_0x38a2dc,_0x3646('0xc'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x38a2dc,_0x3646('0xc'),JSON[_0x3646('0xd')](_0xd8a128));if(_0xd8a128[_0x3646('0xe')]){if(_0xd8a128[_0x3646('0xe')]['code']===0x1f4){logger['error'](_0x3646('0xb'),_0x38a2dc,_0xd8a128[_0x3646('0xe')][_0x3646('0xf')]);return _0x29c528(_0xd8a128[_0x3646('0xe')][_0x3646('0xf')]);}logger[_0x3646('0xe')](_0x3646('0xb'),_0x38a2dc,_0xd8a128[_0x3646('0xe')][_0x3646('0xf')]);return _0x4a5e60(_0xd8a128[_0x3646('0xe')]['message']);}else{logger[_0x3646('0x10')](_0x3646('0xb'),_0x38a2dc,_0x3646('0xc'));_0x4a5e60(_0xd8a128[_0x3646('0x11')][_0x3646('0xf')]);}})[_0x3646('0x12')](function(_0x321749){logger[_0x3646('0xe')](_0x3646('0xb'),_0x38a2dc,_0x321749);_0x29c528(_0x321749);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 45b0c0c..acb53b8 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 _0x95fd=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','put','/:id','update','destroy','exports','multer','util','../../components/auth/service'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x95fd,0x1bf));var _0xd95f=function(_0x5ea8e0,_0x4dbeae){_0x5ea8e0=_0x5ea8e0-0x0;var _0x5e302d=_0x95fd[_0x5ea8e0];return _0x5e302d;};'use strict';var multer=require(_0xd95f('0x0'));var util=require(_0xd95f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd95f('0x2'));var interaction=require(_0xd95f('0x3'));var config=require(_0xd95f('0x4'));var controller=require('./userProfileSection.controller');router[_0xd95f('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd95f('0x5')](_0xd95f('0x6'),auth[_0xd95f('0x7')](),controller[_0xd95f('0x8')]);router[_0xd95f('0x5')]('/:id',auth[_0xd95f('0x7')](),controller[_0xd95f('0x9')]);router['post']('/',auth[_0xd95f('0x7')](),controller['create']);router[_0xd95f('0xa')](_0xd95f('0xb'),auth['isAuthenticated'](),controller[_0xd95f('0xc')]);router['delete'](_0xd95f('0xb'),auth[_0xd95f('0x7')](),controller[_0xd95f('0xd')]);module[_0xd95f('0xe')]=router; \ No newline at end of file +var _0x126c=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get'];(function(_0x55b1f5,_0x450e6d){var _0x1557d4=function(_0x114154){while(--_0x114154){_0x55b1f5['push'](_0x55b1f5['shift']());}};_0x1557d4(++_0x450e6d);}(_0x126c,0x64));var _0xc126=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x126c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc126('0x0'));var util=require(_0xc126('0x1'));var path=require(_0xc126('0x2'));var timeout=require('connect-timeout');var express=require(_0xc126('0x3'));var router=express[_0xc126('0x4')]();var fs_extra=require(_0xc126('0x5'));var auth=require(_0xc126('0x6'));var interaction=require(_0xc126('0x7'));var config=require('../../config/environment');var controller=require(_0xc126('0x8'));router[_0xc126('0x9')]('/',auth[_0xc126('0xa')](),controller[_0xc126('0xb')]);router['get'](_0xc126('0xc'),auth[_0xc126('0xa')](),controller[_0xc126('0xd')]);router['get'](_0xc126('0xe'),auth[_0xc126('0xa')](),controller[_0xc126('0xf')]);router[_0xc126('0x10')]('/',auth[_0xc126('0xa')](),controller[_0xc126('0x11')]);router[_0xc126('0x12')]('/:id',auth[_0xc126('0xa')](),controller[_0xc126('0x13')]);router['delete']('/:id',auth[_0xc126('0xa')](),controller[_0xc126('0x14')]);module[_0xc126('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1006bef..0d5f47f 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 _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x4d7f61,_0x19c0c6){var _0xab2779=function(_0x4ed5c1){while(--_0x4ed5c1){_0x4d7f61['push'](_0x4d7f61['shift']());}};_0xab2779(++_0x19c0c6);}(_0x6cb4,0xff));var _0x46cb=function(_0x43d2e8,_0x2a2a33){_0x43d2e8=_0x43d2e8-0x0;var _0xa80c08=_0x6cb4[_0x43d2e8];return _0xa80c08;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}}; \ No newline at end of file +var _0xb574=['BOOLEAN','setDataValue','crudPermissions','sequelize','exports','STRING','INTEGER'];(function(_0x622aa8,_0x1025d1){var _0x308e81=function(_0x1e8a67){while(--_0x1e8a67){_0x622aa8['push'](_0x622aa8['shift']());}};_0x308e81(++_0x1025d1);}(_0xb574,0x106));var _0x4b57=function(_0x174fc3,_0x3f56d8){_0x174fc3=_0x174fc3-0x0;var _0xd373cb=_0xb574[_0x174fc3];return _0xd373cb;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4b57('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4b57('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4b57('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4b57('0x2')],'set':function(_0x168524){this[_0x4b57('0x5')](_0x4b57('0x6'),_0x168524?_0x168524['join'](''):[]);},'get':function(){return this['getDataValue'](_0x4b57('0x6'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9b3a4a6..cb75517 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 _0xbdfc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','status','end','error','name','send','index','UserProfileSection','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x44e82d,_0x624981){var _0x4fd11f=function(_0x4648ad){while(--_0x4648ad){_0x44e82d['push'](_0x44e82d['shift']());}};_0x4fd11f(++_0x624981);}(_0xbdfc,0xd8));var _0xcbdf=function(_0x3248fc,_0x27e69a){_0x3248fc=_0x3248fc-0x0;var _0x45ffcd=_0xbdfc[_0x3248fc];return _0x45ffcd;};'use strict';var emlformat=require(_0xcbdf('0x0'));var rimraf=require(_0xcbdf('0x1'));var zipdir=require(_0xcbdf('0x2'));var jsonpatch=require(_0xcbdf('0x3'));var rp=require(_0xcbdf('0x4'));var moment=require(_0xcbdf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbdf('0x6'));var util=require('util');var path=require(_0xcbdf('0x7'));var sox=require(_0xcbdf('0x8'));var csv=require(_0xcbdf('0x9'));var ejs=require(_0xcbdf('0xa'));var fs=require('fs');var fs_extra=require(_0xcbdf('0xb'));var _=require(_0xcbdf('0xc'));var squel=require(_0xcbdf('0xd'));var crypto=require(_0xcbdf('0xe'));var jsforce=require(_0xcbdf('0xf'));var deskjs=require(_0xcbdf('0x10'));var toCsv=require(_0xcbdf('0x9'));var querystring=require(_0xcbdf('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbdf('0x12'));var authService=require(_0xcbdf('0x13'));var qs=require(_0xcbdf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbdf('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcbdf('0x16'));var config=require(_0xcbdf('0x17'));var licenseUtil=require(_0xcbdf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x505b84,_0x5cd090){_0x5cd090=_0x5cd090||0xcc;return function(_0x4c09e0){if(_0x4c09e0){return _0x505b84[_0xcbdf('0x19')](_0x5cd090);}return _0x505b84['status'](_0x5cd090)['end']();};}function respondWithResult(_0x6339a0,_0x31a4a3){_0x31a4a3=_0x31a4a3||0xc8;return function(_0x4941f1){if(_0x4941f1){return _0x6339a0['status'](_0x31a4a3)['json'](_0x4941f1);}};}function respondWithFilteredResult(_0x3c24c2,_0x47e1a8){return function(_0x2e1ba1){if(_0x2e1ba1){var _0x359a75=typeof _0x47e1a8[_0xcbdf('0x1a')]===_0xcbdf('0x1b')&&typeof _0x47e1a8[_0xcbdf('0x1c')]===_0xcbdf('0x1b');var _0x3b67de=_0x2e1ba1[_0xcbdf('0x1d')];var _0x417d4d=_0x359a75?0x0:_0x47e1a8['offset'];var _0x35dd1b=_0x359a75?_0x2e1ba1['count']:_0x47e1a8[_0xcbdf('0x1a')]+_0x47e1a8['limit'];var _0x1ca8de;if(_0x35dd1b>=_0x3b67de){_0x35dd1b=_0x3b67de;_0x1ca8de=0xc8;}else{_0x1ca8de=0xce;}_0x3c24c2['status'](_0x1ca8de);return _0x3c24c2[_0xcbdf('0x1e')](_0xcbdf('0x1f'),_0x417d4d+'-'+_0x35dd1b+'/'+_0x3b67de)[_0xcbdf('0x20')](_0x2e1ba1);}return null;};}function patchUpdates(_0x3c1be6){return function(_0x17856d){try{jsonpatch[_0xcbdf('0x21')](_0x17856d,_0x3c1be6,!![]);}catch(_0x7ccf10){return BPromise['reject'](_0x7ccf10);}return _0x17856d[_0xcbdf('0x22')]();};}function saveUpdates(_0x3f9476,_0x55f259){return function(_0x292f9b){if(_0x292f9b){return _0x292f9b[_0xcbdf('0x23')](_0x3f9476)['then'](function(_0x55c49c){return _0x55c49c;});}return null;};}function removeEntity(_0x2f6116,_0x1be89b){return function(_0x5c87d5){if(_0x5c87d5){return _0x5c87d5[_0xcbdf('0x24')]()[_0xcbdf('0x25')](function(){_0x2f6116[_0xcbdf('0x26')](0xcc)[_0xcbdf('0x27')]();});}};}function handleEntityNotFound(_0x154783,_0x3ef76d){return function(_0x3cd485){if(!_0x3cd485){_0x154783['sendStatus'](0x194);}return _0x3cd485;};}function handleError(_0x4a9289,_0x37c37e){_0x37c37e=_0x37c37e||0x1f4;return function(_0x3e803c){logger[_0xcbdf('0x28')](_0x3e803c['stack']);if(_0x3e803c[_0xcbdf('0x29')]){delete _0x3e803c[_0xcbdf('0x29')];}_0x4a9289[_0xcbdf('0x26')](_0x37c37e)[_0xcbdf('0x2a')](_0x3e803c);};}exports[_0xcbdf('0x2b')]=function(_0x37288d,_0x433147){var _0x19ae29={},_0x3c4978={},_0x573569={'count':0x0,'rows':[]};var _0x5d9df9=_['map'](db[_0xcbdf('0x2c')][_0xcbdf('0x2d')],function(_0x14569a){return{'name':_0x14569a['fieldName'],'type':_0x14569a[_0xcbdf('0x2e')][_0xcbdf('0x2f')]};});_0x3c4978[_0xcbdf('0x30')]=_[_0xcbdf('0x31')](_0x5d9df9,_0xcbdf('0x29'));_0x3c4978['query']=_[_0xcbdf('0x32')](_0x37288d['query']);_0x3c4978[_0xcbdf('0x33')]=_[_0xcbdf('0x34')](_0x3c4978['model'],_0x3c4978[_0xcbdf('0x35')]);_0x19ae29[_0xcbdf('0x36')]=_['intersection'](_0x3c4978[_0xcbdf('0x30')],qs['fields'](_0x37288d['query'][_0xcbdf('0x37')]));_0x19ae29[_0xcbdf('0x36')]=_0x19ae29[_0xcbdf('0x36')]['length']?_0x19ae29['attributes']:_0x3c4978[_0xcbdf('0x30')];if(!_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x38')](_0xcbdf('0x39'))){_0x19ae29['limit']=qs[_0xcbdf('0x1c')](_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x1c')]);_0x19ae29[_0xcbdf('0x1a')]=qs[_0xcbdf('0x1a')](_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x1a')]);}_0x19ae29[_0xcbdf('0x3a')]=qs[_0xcbdf('0x3b')](_0x37288d['query'][_0xcbdf('0x3b')]);_0x19ae29[_0xcbdf('0x3c')]=qs['filters'](_[_0xcbdf('0x3d')](_0x37288d[_0xcbdf('0x35')],_0x3c4978[_0xcbdf('0x33')]),_0x5d9df9);if(_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x3e')]){_0x19ae29['where']=_[_0xcbdf('0x3f')](_0x19ae29['where'],{'$or':_['map'](_0x5d9df9,function(_0xce3536){if(_0xce3536['type']!==_0xcbdf('0x40')){var _0x3ae7e5={};_0x3ae7e5[_0xce3536[_0xcbdf('0x29')]]={'$like':'%'+_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x3e')]+'%'};return _0x3ae7e5;}})});}_0x19ae29=_[_0xcbdf('0x3f')]({},_0x19ae29,_0x37288d[_0xcbdf('0x41')]);var _0x27fef1={'where':_0x19ae29[_0xcbdf('0x3c')]};return db['UserProfileSection'][_0xcbdf('0x1d')](_0x27fef1)['then'](function(_0x277934){_0x573569[_0xcbdf('0x1d')]=_0x277934;if(_0x37288d[_0xcbdf('0x35')][_0xcbdf('0x42')]){_0x19ae29[_0xcbdf('0x43')]=[{'all':!![]}];}return db[_0xcbdf('0x2c')][_0xcbdf('0x44')](_0x19ae29);})[_0xcbdf('0x25')](function(_0x203152){_0x573569[_0xcbdf('0x45')]=_0x203152;return _0x573569;})[_0xcbdf('0x25')](respondWithFilteredResult(_0x433147,_0x19ae29))[_0xcbdf('0x46')](handleError(_0x433147,null));};exports[_0xcbdf('0x47')]=function(_0x174394,_0x2bd813){var _0x5a84c5={'raw':![],'where':{'id':_0x174394[_0xcbdf('0x48')]['id']}},_0x26323e={};_0x26323e[_0xcbdf('0x30')]=_[_0xcbdf('0x32')](db[_0xcbdf('0x2c')][_0xcbdf('0x2d')]);_0x26323e[_0xcbdf('0x35')]=_['keys'](_0x174394['query']);_0x26323e[_0xcbdf('0x33')]=_[_0xcbdf('0x34')](_0x26323e[_0xcbdf('0x30')],_0x26323e[_0xcbdf('0x35')]);_0x5a84c5[_0xcbdf('0x36')]=_[_0xcbdf('0x34')](_0x26323e[_0xcbdf('0x30')],qs[_0xcbdf('0x37')](_0x174394[_0xcbdf('0x35')][_0xcbdf('0x37')]));_0x5a84c5[_0xcbdf('0x36')]=_0x5a84c5[_0xcbdf('0x36')][_0xcbdf('0x49')]?_0x5a84c5['attributes']:_0x26323e[_0xcbdf('0x30')];if(_0x174394[_0xcbdf('0x35')][_0xcbdf('0x42')]){_0x5a84c5[_0xcbdf('0x43')]=[{'all':!![]}];}_0x5a84c5=_[_0xcbdf('0x3f')]({},_0x5a84c5,_0x174394[_0xcbdf('0x41')]);return db[_0xcbdf('0x2c')]['find'](_0x5a84c5)[_0xcbdf('0x25')](handleEntityNotFound(_0x2bd813,null))['then'](respondWithResult(_0x2bd813,null))[_0xcbdf('0x46')](handleError(_0x2bd813,null));};exports[_0xcbdf('0x4a')]=function(_0x9e799b,_0xf8739b){return db['UserProfileSection'][_0xcbdf('0x4a')](_0x9e799b[_0xcbdf('0x4b')],{})[_0xcbdf('0x25')](respondWithResult(_0xf8739b,0xc9))[_0xcbdf('0x46')](handleError(_0xf8739b,null));};exports[_0xcbdf('0x23')]=function(_0x17351a,_0x23384f){if(_0x17351a[_0xcbdf('0x4b')]['id']){delete _0x17351a['body']['id'];}return db[_0xcbdf('0x2c')][_0xcbdf('0x4c')]({'where':{'id':_0x17351a[_0xcbdf('0x48')]['id']}})[_0xcbdf('0x25')](handleEntityNotFound(_0x23384f,null))[_0xcbdf('0x25')](saveUpdates(_0x17351a[_0xcbdf('0x4b')],null))[_0xcbdf('0x25')](respondWithResult(_0x23384f,null))[_0xcbdf('0x46')](handleError(_0x23384f,null));};exports[_0xcbdf('0x24')]=function(_0x31a20a,_0x185555){return db[_0xcbdf('0x2c')][_0xcbdf('0x4c')]({'where':{'id':_0x31a20a['params']['id']}})[_0xcbdf('0x25')](handleEntityNotFound(_0x185555,null))[_0xcbdf('0x25')](removeEntity(_0x185555,null))['catch'](handleError(_0x185555,null));};exports['describe']=function(_0x45b619,_0x1aba09){return db[_0xcbdf('0x2c')][_0xcbdf('0x4d')]()['then'](respondWithResult(_0x1aba09,null))['catch'](handleError(_0x1aba09,null));}; \ No newline at end of file +var _0xf4d1=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0xf4d1,0xc5));var _0x1f4d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf4d1[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x1f4d('0x0'));var rimraf=require(_0x1f4d('0x1'));var zipdir=require(_0x1f4d('0x2'));var jsonpatch=require(_0x1f4d('0x3'));var rp=require(_0x1f4d('0x4'));var moment=require(_0x1f4d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1f4d('0x6'));var util=require(_0x1f4d('0x7'));var path=require(_0x1f4d('0x8'));var sox=require('sox');var csv=require(_0x1f4d('0x9'));var ejs=require(_0x1f4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1f4d('0xb'));var _=require('lodash');var squel=require(_0x1f4d('0xc'));var crypto=require(_0x1f4d('0xd'));var jsforce=require(_0x1f4d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1f4d('0x9'));var querystring=require(_0x1f4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x1f4d('0x10'));var authService=require(_0x1f4d('0x11'));var qs=require(_0x1f4d('0x12'));var as=require(_0x1f4d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f4d('0x14'))(_0x1f4d('0x15'));var utils=require(_0x1f4d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1f4d('0x17'))['db'];function respondWithStatusCode(_0x123ac8,_0x1c07c3){_0x1c07c3=_0x1c07c3||0xcc;return function(_0x4ec981){if(_0x4ec981){return _0x123ac8[_0x1f4d('0x18')](_0x1c07c3);}return _0x123ac8[_0x1f4d('0x19')](_0x1c07c3)[_0x1f4d('0x1a')]();};}function respondWithResult(_0x27be05,_0x21d62f){_0x21d62f=_0x21d62f||0xc8;return function(_0x16be90){if(_0x16be90){return _0x27be05[_0x1f4d('0x19')](_0x21d62f)[_0x1f4d('0x1b')](_0x16be90);}};}function respondWithFilteredResult(_0x3c21b6,_0x4359a3){return function(_0x26eddc){if(_0x26eddc){var _0x49b585=typeof _0x4359a3['offset']===_0x1f4d('0x1c')&&typeof _0x4359a3[_0x1f4d('0x1d')]===_0x1f4d('0x1c');var _0x2a2c88=_0x26eddc[_0x1f4d('0x1e')];var _0x18d1ca=_0x49b585?0x0:_0x4359a3[_0x1f4d('0x1f')];var _0x4a1350=_0x49b585?_0x26eddc[_0x1f4d('0x1e')]:_0x4359a3[_0x1f4d('0x1f')]+_0x4359a3['limit'];var _0x5980fe;if(_0x4a1350>=_0x2a2c88){_0x4a1350=_0x2a2c88;_0x5980fe=0xc8;}else{_0x5980fe=0xce;}_0x3c21b6[_0x1f4d('0x19')](_0x5980fe);return _0x3c21b6[_0x1f4d('0x20')](_0x1f4d('0x21'),_0x18d1ca+'-'+_0x4a1350+'/'+_0x2a2c88)[_0x1f4d('0x1b')](_0x26eddc);}return null;};}function patchUpdates(_0x1531c5){return function(_0x3bcc12){try{jsonpatch[_0x1f4d('0x22')](_0x3bcc12,_0x1531c5,!![]);}catch(_0x285e34){return BPromise[_0x1f4d('0x23')](_0x285e34);}return _0x3bcc12['save']();};}function saveUpdates(_0x253f7f,_0x2df70f){return function(_0x812f76){if(_0x812f76){return _0x812f76[_0x1f4d('0x24')](_0x253f7f)['then'](function(_0x1aa9ac){return _0x1aa9ac;});}return null;};}function removeEntity(_0x299a87,_0x53f944){return function(_0x57b625){if(_0x57b625){return _0x57b625['destroy']()[_0x1f4d('0x25')](function(){_0x299a87[_0x1f4d('0x19')](0xcc)[_0x1f4d('0x1a')]();});}};}function handleEntityNotFound(_0x24515b,_0x44bac7){return function(_0x2a692c){if(!_0x2a692c){_0x24515b[_0x1f4d('0x18')](0x194);}return _0x2a692c;};}function handleError(_0x433e4f,_0x5a09e3){_0x5a09e3=_0x5a09e3||0x1f4;return function(_0x16ee10){logger['error'](_0x16ee10['stack']);if(_0x16ee10['name']){delete _0x16ee10[_0x1f4d('0x26')];}_0x433e4f[_0x1f4d('0x19')](_0x5a09e3)[_0x1f4d('0x27')](_0x16ee10);};}exports[_0x1f4d('0x28')]=function(_0xe89277,_0x49d278){var _0x3b6d09={},_0x401218={},_0x4c9310={'count':0x0,'rows':[]};var _0x3b2d13=_[_0x1f4d('0x29')](db[_0x1f4d('0x2a')][_0x1f4d('0x2b')],function(_0x503a69){return{'name':_0x503a69[_0x1f4d('0x2c')],'type':_0x503a69[_0x1f4d('0x2d')]['key']};});_0x401218[_0x1f4d('0x2e')]=_['map'](_0x3b2d13,_0x1f4d('0x26'));_0x401218[_0x1f4d('0x2f')]=_[_0x1f4d('0x30')](_0xe89277[_0x1f4d('0x2f')]);_0x401218[_0x1f4d('0x31')]=_[_0x1f4d('0x32')](_0x401218[_0x1f4d('0x2e')],_0x401218[_0x1f4d('0x2f')]);_0x3b6d09[_0x1f4d('0x33')]=_['intersection'](_0x401218[_0x1f4d('0x2e')],qs[_0x1f4d('0x34')](_0xe89277[_0x1f4d('0x2f')][_0x1f4d('0x34')]));_0x3b6d09[_0x1f4d('0x33')]=_0x3b6d09[_0x1f4d('0x33')][_0x1f4d('0x35')]?_0x3b6d09[_0x1f4d('0x33')]:_0x401218[_0x1f4d('0x2e')];if(!_0xe89277[_0x1f4d('0x2f')][_0x1f4d('0x36')](_0x1f4d('0x37'))){_0x3b6d09[_0x1f4d('0x1d')]=qs[_0x1f4d('0x1d')](_0xe89277[_0x1f4d('0x2f')]['limit']);_0x3b6d09['offset']=qs[_0x1f4d('0x1f')](_0xe89277[_0x1f4d('0x2f')]['offset']);}_0x3b6d09[_0x1f4d('0x38')]=qs[_0x1f4d('0x39')](_0xe89277['query'][_0x1f4d('0x39')]);_0x3b6d09[_0x1f4d('0x3a')]=qs['filters'](_['pick'](_0xe89277[_0x1f4d('0x2f')],_0x401218[_0x1f4d('0x31')]),_0x3b2d13);if(_0xe89277[_0x1f4d('0x2f')][_0x1f4d('0x3b')]){_0x3b6d09[_0x1f4d('0x3a')]=_[_0x1f4d('0x3c')](_0x3b6d09[_0x1f4d('0x3a')],{'$or':_[_0x1f4d('0x29')](_0x3b2d13,function(_0x57ebf7){if(_0x57ebf7['type']!=='VIRTUAL'){var _0x3659a8={};_0x3659a8[_0x57ebf7['name']]={'$like':'%'+_0xe89277[_0x1f4d('0x2f')][_0x1f4d('0x3b')]+'%'};return _0x3659a8;}})});}_0x3b6d09=_[_0x1f4d('0x3c')]({},_0x3b6d09,_0xe89277[_0x1f4d('0x3d')]);var _0x307e70={'where':_0x3b6d09[_0x1f4d('0x3a')]};return db['UserProfileSection']['count'](_0x307e70)['then'](function(_0x55bb31){_0x4c9310['count']=_0x55bb31;if(_0xe89277[_0x1f4d('0x2f')]['includeAll']){_0x3b6d09[_0x1f4d('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1f4d('0x3f')](_0x3b6d09);})['then'](function(_0x52b827){_0x4c9310['rows']=_0x52b827;return _0x4c9310;})[_0x1f4d('0x25')](respondWithFilteredResult(_0x49d278,_0x3b6d09))[_0x1f4d('0x40')](handleError(_0x49d278,null));};exports[_0x1f4d('0x41')]=function(_0xbd444,_0x554fd7){var _0x35211f={'raw':![],'where':{'id':_0xbd444[_0x1f4d('0x42')]['id']}},_0x5ce7f3={};_0x5ce7f3[_0x1f4d('0x2e')]=_[_0x1f4d('0x30')](db[_0x1f4d('0x2a')][_0x1f4d('0x2b')]);_0x5ce7f3[_0x1f4d('0x2f')]=_[_0x1f4d('0x30')](_0xbd444['query']);_0x5ce7f3[_0x1f4d('0x31')]=_['intersection'](_0x5ce7f3[_0x1f4d('0x2e')],_0x5ce7f3[_0x1f4d('0x2f')]);_0x35211f[_0x1f4d('0x33')]=_[_0x1f4d('0x32')](_0x5ce7f3[_0x1f4d('0x2e')],qs[_0x1f4d('0x34')](_0xbd444[_0x1f4d('0x2f')][_0x1f4d('0x34')]));_0x35211f['attributes']=_0x35211f[_0x1f4d('0x33')][_0x1f4d('0x35')]?_0x35211f[_0x1f4d('0x33')]:_0x5ce7f3[_0x1f4d('0x2e')];if(_0xbd444[_0x1f4d('0x2f')][_0x1f4d('0x43')]){_0x35211f[_0x1f4d('0x3e')]=[{'all':!![]}];}_0x35211f=_[_0x1f4d('0x3c')]({},_0x35211f,_0xbd444[_0x1f4d('0x3d')]);return db[_0x1f4d('0x2a')][_0x1f4d('0x44')](_0x35211f)[_0x1f4d('0x25')](handleEntityNotFound(_0x554fd7,null))[_0x1f4d('0x25')](respondWithResult(_0x554fd7,null))[_0x1f4d('0x40')](handleError(_0x554fd7,null));};exports[_0x1f4d('0x45')]=function(_0x1b5ca1,_0x29123e){return db[_0x1f4d('0x2a')][_0x1f4d('0x45')](_0x1b5ca1[_0x1f4d('0x46')],{})['then'](respondWithResult(_0x29123e,0xc9))[_0x1f4d('0x40')](handleError(_0x29123e,null));};exports[_0x1f4d('0x24')]=function(_0x48d19d,_0x4df771){if(_0x48d19d[_0x1f4d('0x46')]['id']){delete _0x48d19d[_0x1f4d('0x46')]['id'];}return db[_0x1f4d('0x2a')]['find']({'where':{'id':_0x48d19d[_0x1f4d('0x42')]['id']}})[_0x1f4d('0x25')](handleEntityNotFound(_0x4df771,null))['then'](saveUpdates(_0x48d19d['body'],null))['then'](respondWithResult(_0x4df771,null))[_0x1f4d('0x40')](handleError(_0x4df771,null));};exports['destroy']=function(_0x3e3c94,_0x4cb082){return db['UserProfileSection'][_0x1f4d('0x44')]({'where':{'id':_0x3e3c94['params']['id']}})['then'](handleEntityNotFound(_0x4cb082,null))[_0x1f4d('0x25')](removeEntity(_0x4cb082,null))[_0x1f4d('0x40')](handleError(_0x4cb082,null));};exports[_0x1f4d('0x47')]=function(_0x27f092,_0x4989c7){return db[_0x1f4d('0x2a')]['describe']()[_0x1f4d('0x25')](respondWithResult(_0x4989c7,null))[_0x1f4d('0x40')](handleError(_0x4989c7,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 049bc8a..fe7e006 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 _0x9060=['../../config/environment','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3495cf,_0x45107d){var _0x3a9fb5=function(_0x1b56b2){while(--_0x1b56b2){_0x3495cf['push'](_0x3495cf['shift']());}};_0x3a9fb5(++_0x45107d);}(_0x9060,0x1f1));var _0x0906=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x9060[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0906('0x0'))(_0x0906('0x1'));var moment=require(_0x0906('0x2'));var BPromise=require(_0x0906('0x3'));var rp=require(_0x0906('0x4'));var fs=require('fs');var path=require(_0x0906('0x5'));var rimraf=require(_0x0906('0x6'));var config=require(_0x0906('0x7'));var attributes=require('./userProfileSection.attributes');module[_0x0906('0x8')]=function(_0x5f2e64,_0x26208e){return _0x5f2e64[_0x0906('0x9')](_0x0906('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x0906('0xb'),'fields':[_0x0906('0xc'),_0x0906('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60d7=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4d94fd,_0x24cc0e){var _0x447e0f=function(_0x5921e2){while(--_0x5921e2){_0x4d94fd['push'](_0x4d94fd['shift']());}};_0x447e0f(++_0x24cc0e);}(_0x60d7,0xe9));var _0x760d=function(_0x559a04,_0x259888){_0x559a04=_0x559a04-0x0;var _0xc59e25=_0x60d7[_0x559a04];return _0xc59e25;};'use strict';var _=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var logger=require('../../config/logger')(_0x760d('0x2'));var moment=require(_0x760d('0x3'));var BPromise=require(_0x760d('0x4'));var rp=require(_0x760d('0x5'));var fs=require('fs');var path=require(_0x760d('0x6'));var rimraf=require(_0x760d('0x7'));var config=require(_0x760d('0x8'));var attributes=require(_0x760d('0x9'));module[_0x760d('0xa')]=function(_0x13f14c,_0x1b6239){return _0x13f14c[_0x760d('0xb')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x760d('0xc'),'fields':[_0x760d('0xd'),_0x760d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 049753f..0c807aa 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 _0x544f=['info','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserProfileSection,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x5b564c,_0x6d2638){var _0x5d92d6=function(_0x55c6dc){while(--_0x55c6dc){_0x5b564c['push'](_0x5b564c['shift']());}};_0x5d92d6(++_0x6d2638);}(_0x544f,0xbc));var _0xf544=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x544f[_0x1fd675];return _0x16b554;};'use strict';var _=require(_0xf544('0x0'));var util=require(_0xf544('0x1'));var moment=require(_0xf544('0x2'));var BPromise=require('bluebird');var rs=require(_0xf544('0x3'));var fs=require('fs');var Redis=require(_0xf544('0x4'));var db=require(_0xf544('0x5'))['db'];var utils=require(_0xf544('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf544('0x7'));var jayson=require(_0xf544('0x8'));var client=jayson[_0xf544('0x9')][_0xf544('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ff7a,_0x3c1567,_0xe67ba0){return new BPromise(function(_0x53a698,_0x70c8b4){return client[_0xf544('0xb')](_0x57ff7a,_0xe67ba0)['then'](function(_0xecda5b){logger[_0xf544('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x3c1567,'request\x20sent');logger['debug'](_0xf544('0xd'),_0x3c1567,_0xf544('0xe'),JSON[_0xf544('0xf')](_0xecda5b));if(_0xecda5b[_0xf544('0x10')]){if(_0xecda5b['error']['code']===0x1f4){logger[_0xf544('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x3c1567,_0xecda5b[_0xf544('0x10')]['message']);return _0x70c8b4(_0xecda5b[_0xf544('0x10')][_0xf544('0x11')]);}logger[_0xf544('0x10')](_0xf544('0x12'),_0x3c1567,_0xecda5b[_0xf544('0x10')][_0xf544('0x11')]);return _0x53a698(_0xecda5b[_0xf544('0x10')][_0xf544('0x11')]);}else{logger[_0xf544('0xc')](_0xf544('0x12'),_0x3c1567,'request\x20sent');_0x53a698(_0xecda5b[_0xf544('0x13')][_0xf544('0x11')]);}})['catch'](function(_0x121275){logger[_0xf544('0x10')](_0xf544('0x12'),_0x3c1567,_0x121275);_0x70c8b4(_0x121275);});});} \ No newline at end of file +var _0xc99e=['message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x55bd03,_0x249e17){var _0x4b77ef=function(_0xaccea1){while(--_0xaccea1){_0x55bd03['push'](_0x55bd03['shift']());}};_0x4b77ef(++_0x249e17);}(_0xc99e,0x1d8));var _0xec99=function(_0x355af6,_0x4173ac){_0x355af6=_0x355af6-0x0;var _0x5ef45d=_0xc99e[_0x355af6];return _0x5ef45d;};'use strict';var _=require(_0xec99('0x0'));var util=require(_0xec99('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xec99('0x2'));var fs=require('fs');var Redis=require(_0xec99('0x3'));var db=require(_0xec99('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xec99('0x5'))('rpc');var config=require(_0xec99('0x6'));var jayson=require(_0xec99('0x7'));var client=jayson[_0xec99('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b715e,_0x40f7ac,_0x569d7a){return new BPromise(function(_0x2ece33,_0xbd70d3){return client['request'](_0x5b715e,_0x569d7a)['then'](function(_0x3fc23e){logger['info'](_0xec99('0x9'),_0x40f7ac,_0xec99('0xa'));logger[_0xec99('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x40f7ac,_0xec99('0xa'),JSON['stringify'](_0x3fc23e));if(_0x3fc23e[_0xec99('0xc')]){if(_0x3fc23e[_0xec99('0xc')][_0xec99('0xd')]===0x1f4){logger[_0xec99('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x40f7ac,_0x3fc23e[_0xec99('0xc')][_0xec99('0xe')]);return _0xbd70d3(_0x3fc23e[_0xec99('0xc')][_0xec99('0xe')]);}logger[_0xec99('0xc')](_0xec99('0x9'),_0x40f7ac,_0x3fc23e[_0xec99('0xc')][_0xec99('0xe')]);return _0x2ece33(_0x3fc23e[_0xec99('0xc')][_0xec99('0xe')]);}else{logger[_0xec99('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x40f7ac,_0xec99('0xa'));_0x2ece33(_0x3fc23e[_0xec99('0x10')][_0xec99('0xe')]);}})[_0xec99('0x11')](function(_0x32e18c){logger[_0xec99('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x40f7ac,_0x32e18c);_0xbd70d3(_0x32e18c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 364a838..2f34064 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x483f42,_0x3af164){var _0xe7deb0=function(_0x1ae433){while(--_0x1ae433){_0x483f42['push'](_0x483f42['shift']());}};_0xe7deb0(++_0x3af164);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3b0598,_0x15100f){var _0x5e2198=function(_0x19aeb7){while(--_0x19aeb7){_0x3b0598['push'](_0x3b0598['shift']());}};_0x5e2198(++_0x15100f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 33ef411..5bdce76 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 _0xd484=['sequelize','exports','INTEGER'];(function(_0x5bffec,_0x5a1a05){var _0x487791=function(_0x39367b){while(--_0x39367b){_0x5bffec['push'](_0x5bffec['shift']());}};_0x487791(++_0x5a1a05);}(_0xd484,0xff));var _0x4d48=function(_0x394d58,_0x20b844){_0x394d58=_0x394d58-0x0;var _0x469049=_0xd484[_0x394d58];return _0x469049;};'use strict';var Sequelize=require(_0x4d48('0x0'));module[_0x4d48('0x1')]={'penalty':{'type':Sequelize[_0x4d48('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4577=['INTEGER','sequelize'];(function(_0x413e60,_0x4c01d9){var _0x5f0f42=function(_0xe05c37){while(--_0xe05c37){_0x413e60['push'](_0x413e60['shift']());}};_0x5f0f42(++_0x4c01d9);}(_0x4577,0x117));var _0x7457=function(_0x38c7d8,_0x253557){_0x38c7d8=_0x38c7d8-0x0;var _0x266426=_0x4577[_0x38c7d8];return _0x266426;};'use strict';var Sequelize=require(_0x7457('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7457('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 6d78831..fb24cb2 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 _0x1883=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x38c0b2,_0x6a67a5){var _0x283c00=function(_0x259f03){while(--_0x259f03){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x283c00(++_0x6a67a5);}(_0x1883,0xab));var _0x3188=function(_0xb55cf2,_0x1ae4e1){_0xb55cf2=_0xb55cf2-0x0;var _0x3ccb24=_0x1883[_0xb55cf2];return _0x3ccb24;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['user_has_sms_queues','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x5ed102,_0x2426a6){var _0x38ac89=function(_0x10f723){while(--_0x10f723){_0x5ed102['push'](_0x5ed102['shift']());}};_0x38ac89(++_0x2426a6);}(_0x7ee1,0x8d));var _0x17ee=function(_0x41c3d9,_0x90fcc3){_0x41c3d9=_0x41c3d9-0x0;var _0x2a6439=_0x7ee1[_0x41c3d9];return _0x2a6439;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('UserSmsQueue',attributes,{'tableName':_0x17ee('0x9'),'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 a987b47..45a92cf 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 _0xb138=['message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xf4708c,_0x20fbd1){var _0x19f3e6=function(_0x4e6454){while(--_0x4e6454){_0xf4708c['push'](_0xf4708c['shift']());}};_0x19f3e6(++_0x20fbd1);}(_0xb138,0x67));var _0x8b13=function(_0x31c0b7,_0x3e2dbc){_0x31c0b7=_0x31c0b7-0x0;var _0x4c20fd=_0xb138[_0x31c0b7];return _0x4c20fd;};'use strict';var _=require(_0x8b13('0x0'));var util=require('util');var moment=require(_0x8b13('0x1'));var BPromise=require(_0x8b13('0x2'));var rs=require(_0x8b13('0x3'));var fs=require('fs');var Redis=require(_0x8b13('0x4'));var db=require(_0x8b13('0x5'))['db'];var utils=require(_0x8b13('0x6'));var logger=require('../../config/logger')(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var jayson=require(_0x8b13('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8f37de,_0x492e84,_0x4fec4d){return new BPromise(function(_0x5a31b9,_0x6894c){return client['request'](_0x8f37de,_0x4fec4d)[_0x8b13('0xa')](function(_0x336917){logger['info'](_0x8b13('0xb'),_0x492e84,_0x8b13('0xc'));logger[_0x8b13('0xd')](_0x8b13('0xe'),_0x492e84,_0x8b13('0xc'),JSON['stringify'](_0x336917));if(_0x336917[_0x8b13('0xf')]){if(_0x336917[_0x8b13('0xf')][_0x8b13('0x10')]===0x1f4){logger[_0x8b13('0xf')](_0x8b13('0xb'),_0x492e84,_0x336917[_0x8b13('0xf')][_0x8b13('0x11')]);return _0x6894c(_0x336917['error'][_0x8b13('0x11')]);}logger['error'](_0x8b13('0xb'),_0x492e84,_0x336917['error'][_0x8b13('0x11')]);return _0x5a31b9(_0x336917[_0x8b13('0xf')][_0x8b13('0x11')]);}else{logger[_0x8b13('0x12')](_0x8b13('0xb'),_0x492e84,_0x8b13('0xc'));_0x5a31b9(_0x336917['result'][_0x8b13('0x11')]);}})[_0x8b13('0x13')](function(_0x35e01a){logger[_0x8b13('0xf')](_0x8b13('0xb'),_0x492e84,_0x35e01a);_0x6894c(_0x35e01a);});});} \ No newline at end of file +var _0x64d9=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x64d9,0xa8));var _0x964d=function(_0x460b9e,_0x3e016d){_0x460b9e=_0x460b9e-0x0;var _0x373e93=_0x64d9[_0x460b9e];return _0x373e93;};'use strict';var _=require(_0x964d('0x0'));var util=require(_0x964d('0x1'));var moment=require(_0x964d('0x2'));var BPromise=require('bluebird');var rs=require(_0x964d('0x3'));var fs=require('fs');var Redis=require(_0x964d('0x4'));var db=require(_0x964d('0x5'))['db'];var utils=require(_0x964d('0x6'));var logger=require('../../config/logger')(_0x964d('0x7'));var config=require('../../config/environment');var jayson=require(_0x964d('0x8'));var client=jayson[_0x964d('0x9')][_0x964d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48b198,_0x5b8201,_0x5965c3){return new BPromise(function(_0x2e61ea,_0x59f5da){return client[_0x964d('0xb')](_0x48b198,_0x5965c3)[_0x964d('0xc')](function(_0x14b3f3){logger[_0x964d('0xd')](_0x964d('0xe'),_0x5b8201,'request\x20sent');logger[_0x964d('0xf')](_0x964d('0x10'),_0x5b8201,_0x964d('0x11'),JSON[_0x964d('0x12')](_0x14b3f3));if(_0x14b3f3[_0x964d('0x13')]){if(_0x14b3f3[_0x964d('0x13')][_0x964d('0x14')]===0x1f4){logger[_0x964d('0x13')](_0x964d('0xe'),_0x5b8201,_0x14b3f3[_0x964d('0x13')][_0x964d('0x15')]);return _0x59f5da(_0x14b3f3[_0x964d('0x13')]['message']);}logger[_0x964d('0x13')](_0x964d('0xe'),_0x5b8201,_0x14b3f3[_0x964d('0x13')][_0x964d('0x15')]);return _0x2e61ea(_0x14b3f3[_0x964d('0x13')][_0x964d('0x15')]);}else{logger[_0x964d('0xd')](_0x964d('0xe'),_0x5b8201,'request\x20sent');_0x2e61ea(_0x14b3f3[_0x964d('0x16')][_0x964d('0x15')]);}})[_0x964d('0x17')](function(_0x4ed82b){logger[_0x964d('0x13')](_0x964d('0xe'),_0x5b8201,_0x4ed82b);_0x59f5da(_0x4ed82b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2f8bded..6e54f52 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 _0xd355=['sequelize','exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd355,0x1b6));var _0x5d35=function(_0x4bf18e,_0x3c7075){_0x4bf18e=_0x4bf18e-0x0;var _0x2c20bf=_0xd355[_0x4bf18e];return _0x2c20bf;};'use strict';var Sequelize=require(_0x5d35('0x0'));module[_0x5d35('0x1')]={'UserId':{'type':Sequelize[_0x5d35('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5d35('0x2')]}}; \ No newline at end of file +var _0x940a=['sequelize','INTEGER'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x940a,0x1c6));var _0xa940=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x940a[_0x10df18];return _0x1f9a1d;};'use strict';var Sequelize=require(_0xa940('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xa940('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 7af9bc3..89c5074 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(_0x474d59,_0x5525d7){var _0x273068=function(_0x4317e5){while(--_0x4317e5){_0x474d59['push'](_0x474d59['shift']());}};_0x273068(++_0x5525d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x2315a3,_0x32abb7){var _0x2f0fe5=function(_0x303aed){while(--_0x303aed){_0x2315a3['push'](_0x2315a3['shift']());}};_0x2f0fe5(++_0x32abb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 ddd8f77..e220e5c 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1c73ee,_0x49a9c9){var _0x154f05=function(_0x3987f1){while(--_0x3987f1){_0x1c73ee['push'](_0x1c73ee['shift']());}};_0x154f05(++_0x49a9c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5b43ac,_0x9424bc){var _0x2f0a71=function(_0x777c0d){while(--_0x777c0d){_0x5b43ac['push'](_0x5b43ac['shift']());}};_0x2f0a71(++_0x9424bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f680f84..4ab57c9 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 _0x66e2=['exports','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x66e2,0x105));var _0x266e=function(_0x1d98a3,_0x28e1b8){_0x1d98a3=_0x1d98a3-0x0;var _0x4b8246=_0x66e2[_0x1d98a3];return _0x4b8246;};'use strict';var Sequelize=require(_0x266e('0x0'));module[_0x266e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcfad=['sequelize','INTEGER'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0xcfad,0x1d6));var _0xdcfa=function(_0x497e65,_0x30f499){_0x497e65=_0x497e65-0x0;var _0x48422f=_0xcfad[_0x497e65];return _0x48422f;};'use strict';var Sequelize=require(_0xdcfa('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdcfa('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index b36d7c5..a1bbce9 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 _0xc527=['define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','request-promise','path','./userVoiceQueue.attributes'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc527,0x110));var _0x7c52=function(_0x26960e,_0x4f7b4b){_0x26960e=_0x26960e-0x0;var _0x363213=_0xc527[_0x26960e];return _0x363213;};'use strict';var _=require(_0x7c52('0x0'));var util=require(_0x7c52('0x1'));var logger=require(_0x7c52('0x2'))(_0x7c52('0x3'));var moment=require(_0x7c52('0x4'));var BPromise=require('bluebird');var rp=require(_0x7c52('0x5'));var fs=require('fs');var path=require(_0x7c52('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c52('0x7'));module['exports']=function(_0x4564cf,_0xcf2b0){return _0x4564cf[_0x7c52('0x8')](_0x7c52('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2a8=['./userVoiceQueue.attributes','exports','define','user_has_voice_queues','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x8a0b0d,_0x5767c6){var _0x2043c9=function(_0x4d3f74){while(--_0x4d3f74){_0x8a0b0d['push'](_0x8a0b0d['shift']());}};_0x2043c9(++_0x5767c6);}(_0xd2a8,0x1ee));var _0x8d2a=function(_0x15a64c,_0x180366){_0x15a64c=_0x15a64c-0x0;var _0x1ee0ef=_0xd2a8[_0x15a64c];return _0x1ee0ef;};'use strict';var _=require('lodash');var util=require(_0x8d2a('0x0'));var logger=require(_0x8d2a('0x1'))(_0x8d2a('0x2'));var moment=require('moment');var BPromise=require(_0x8d2a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d2a('0x4'));var rimraf=require('rimraf');var config=require(_0x8d2a('0x5'));var attributes=require(_0x8d2a('0x6'));module[_0x8d2a('0x7')]=function(_0x292f62,_0x42a19f){return _0x292f62[_0x8d2a('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x8d2a('0x9'),'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 51dcae2..5f887b9 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 _0x6bf1=['stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','request','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1d4aa7,_0x5909b0){var _0x446c98=function(_0x52e61b){while(--_0x52e61b){_0x1d4aa7['push'](_0x1d4aa7['shift']());}};_0x446c98(++_0x5909b0);}(_0x6bf1,0xf7));var _0x16bf=function(_0x1b77b1,_0xca2b55){_0x1b77b1=_0x1b77b1-0x0;var _0x116bbb=_0x6bf1[_0x1b77b1];return _0x116bbb;};'use strict';var _=require(_0x16bf('0x0'));var util=require(_0x16bf('0x1'));var moment=require(_0x16bf('0x2'));var BPromise=require(_0x16bf('0x3'));var rs=require(_0x16bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x16bf('0x6'));var config=require(_0x16bf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x16bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2984e6,_0x2aefd6,_0x428dfd){return new BPromise(function(_0x1ff4f8,_0x435a35){return client[_0x16bf('0x9')](_0x2984e6,_0x428dfd)['then'](function(_0x672e8b){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x2aefd6,_0x16bf('0xa'));logger[_0x16bf('0xb')](_0x16bf('0xc'),_0x2aefd6,_0x16bf('0xa'),JSON[_0x16bf('0xd')](_0x672e8b));if(_0x672e8b[_0x16bf('0xe')]){if(_0x672e8b[_0x16bf('0xe')]['code']===0x1f4){logger[_0x16bf('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x2aefd6,_0x672e8b['error'][_0x16bf('0xf')]);return _0x435a35(_0x672e8b['error'][_0x16bf('0xf')]);}logger[_0x16bf('0xe')](_0x16bf('0x10'),_0x2aefd6,_0x672e8b['error'][_0x16bf('0xf')]);return _0x1ff4f8(_0x672e8b[_0x16bf('0xe')]['message']);}else{logger[_0x16bf('0x11')](_0x16bf('0x10'),_0x2aefd6,'request\x20sent');_0x1ff4f8(_0x672e8b[_0x16bf('0x12')][_0x16bf('0xf')]);}})[_0x16bf('0x13')](function(_0x5ed0f3){logger[_0x16bf('0xe')](_0x16bf('0x10'),_0x2aefd6,_0x5ed0f3);_0x435a35(_0x5ed0f3);});});} \ No newline at end of file +var _0x8f69=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x499ce5,_0xa244a9){var _0x2f59fa=function(_0x483bab){while(--_0x483bab){_0x499ce5['push'](_0x499ce5['shift']());}};_0x2f59fa(++_0xa244a9);}(_0x8f69,0x15c));var _0x98f6=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x8f69[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x98f6('0x0'));var util=require('util');var moment=require(_0x98f6('0x1'));var BPromise=require(_0x98f6('0x2'));var rs=require(_0x98f6('0x3'));var fs=require('fs');var Redis=require(_0x98f6('0x4'));var db=require(_0x98f6('0x5'))['db'];var utils=require(_0x98f6('0x6'));var logger=require('../../config/logger')(_0x98f6('0x7'));var config=require(_0x98f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x98f6('0x9')][_0x98f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29358d,_0x23d3b5,_0x34dd15){return new BPromise(function(_0x857d72,_0x435c61){return client[_0x98f6('0xb')](_0x29358d,_0x34dd15)[_0x98f6('0xc')](function(_0x51e6e0){logger[_0x98f6('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x23d3b5,'request\x20sent');logger['debug'](_0x98f6('0xe'),_0x23d3b5,'request\x20sent',JSON['stringify'](_0x51e6e0));if(_0x51e6e0['error']){if(_0x51e6e0[_0x98f6('0xf')][_0x98f6('0x10')]===0x1f4){logger[_0x98f6('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x23d3b5,_0x51e6e0[_0x98f6('0xf')][_0x98f6('0x11')]);return _0x435c61(_0x51e6e0['error'][_0x98f6('0x11')]);}logger['error'](_0x98f6('0x12'),_0x23d3b5,_0x51e6e0[_0x98f6('0xf')][_0x98f6('0x11')]);return _0x857d72(_0x51e6e0['error'][_0x98f6('0x11')]);}else{logger[_0x98f6('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x23d3b5,_0x98f6('0x13'));_0x857d72(_0x51e6e0['result'][_0x98f6('0x11')]);}})[_0x98f6('0x14')](function(_0x791048){logger[_0x98f6('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x23d3b5,_0x791048);_0x435c61(_0x791048);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index cf4351d..671ac15 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20fc36,_0x340d02){var _0x3a5552=function(_0x77a5da){while(--_0x77a5da){_0x20fc36['push'](_0x20fc36['shift']());}};_0x3a5552(++_0x340d02);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x488554,_0x47914c){var _0x471a8a=function(_0x597684){while(--_0x597684){_0x488554['push'](_0x488554['shift']());}};_0x471a8a(++_0x47914c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 12bfe0e..5ce81b7 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 _0xa8d6=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x4ee584,_0xeb3608){var _0x4d0d29=function(_0x2a8511){while(--_0x2a8511){_0x4ee584['push'](_0x4ee584['shift']());}};_0x4d0d29(++_0xeb3608);}(_0xa8d6,0x1aa));var _0x6a8d=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xa8d6[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module[_0x6a8d('0x0')]={'uniqueid':{'type':Sequelize[_0x6a8d('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6a8d('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x6a8d('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6a8d('0x3')],'allowNull':![],'unique':_0x6a8d('0x4'),'comment':_0x6a8d('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x6a8d('0x3')],'allowNull':![],'unique':_0x6a8d('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x6a8d('0x1')](0xb),'defaultValue':0x0,'comment':_0x6a8d('0x2')},'paused':{'type':Sequelize[_0x6a8d('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xc55e=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0xc55e,0x1d9));var _0xec55=function(_0x241c57,_0x3d2ca4){_0x241c57=_0x241c57-0x0;var _0x28d5cf=_0xc55e[_0x241c57];return _0x28d5cf;};'use strict';var Sequelize=require(_0xec55('0x0'));module[_0xec55('0x1')]={'uniqueid':{'type':Sequelize[_0xec55('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xec55('0x3')},'membername':{'type':Sequelize[_0xec55('0x4')],'allowNull':![],'comment':_0xec55('0x3')},'UserId':{'type':Sequelize[_0xec55('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xec55('0x4')],'allowNull':![],'unique':_0xec55('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xec55('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xec55('0x4')],'allowNull':![],'unique':_0xec55('0x5'),'comment':_0xec55('0x3')},'penalty':{'type':Sequelize[_0xec55('0x2')](0xb),'defaultValue':0x0,'comment':_0xec55('0x3')},'paused':{'type':Sequelize[_0xec55('0x2')](0xb),'defaultValue':0x0,'comment':_0xec55('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1078e52..cb2e615 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 _0xdcb8=['hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit'];(function(_0x5056b0,_0x3a2aa2){var _0x8ea1c0=function(_0x4f3b2e){while(--_0x4f3b2e){_0x5056b0['push'](_0x5056b0['shift']());}};_0x8ea1c0(++_0x3a2aa2);}(_0xdcb8,0xc0));var _0x8dcb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdcb8[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8dcb('0x0'))['db'][_0x8dcb('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8dcb('0x2')](0x0);var events={'afterCreate':_0x8dcb('0x3'),'afterUpdate':'update','afterDestroy':_0x8dcb('0x4')};function emitEvent(_0x3fad9d){return function(_0x4a0e0b,_0x46cce3,_0x324826){UserVoiceQueueRtEvents['emit'](_0x3fad9d+':'+_0x4a0e0b['id'],_0x4a0e0b);UserVoiceQueueRtEvents[_0x8dcb('0x5')](_0x3fad9d,_0x4a0e0b);_0x324826(null);};}for(var e in events){if(events[_0x8dcb('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x8dcb('0x7')](e,emitEvent(event));}}module[_0x8dcb('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xb43b=['setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0xb43b,0xa7));var _0xbb43=function(_0x2d0b1c,_0x2d540d){_0x2d0b1c=_0x2d0b1c-0x0;var _0x4fa512=_0xb43b[_0x2d0b1c];return _0x4fa512;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xbb43('0x1')](0x0);var events={'afterCreate':_0xbb43('0x2'),'afterUpdate':_0xbb43('0x3'),'afterDestroy':_0xbb43('0x4')};function emitEvent(_0x3d1b98){return function(_0x1af147,_0x5c67d2,_0x36145){UserVoiceQueueRtEvents[_0xbb43('0x5')](_0x3d1b98+':'+_0x1af147['id'],_0x1af147);UserVoiceQueueRtEvents[_0xbb43('0x5')](_0x3d1b98,_0x1af147);_0x36145(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xbb43('0x6')](e,emitEvent(event));}}module[_0xbb43('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 045bf34..8642d8c 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 _0xf4be=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash'];(function(_0x4d709d,_0x1714fd){var _0x377db9=function(_0x2add65){while(--_0x2add65){_0x4d709d['push'](_0x4d709d['shift']());}};_0x377db9(++_0x1714fd);}(_0xf4be,0xe6));var _0xef4b=function(_0xf3df7,_0x36c6cd){_0xf3df7=_0xf3df7-0x0;var _0x578988=_0xf4be[_0xf3df7];return _0x578988;};'use strict';var _=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var logger=require(_0xef4b('0x2'))('api');var moment=require(_0xef4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xef4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef4b('0x5'));var config=require(_0xef4b('0x6'));var attributes=require(_0xef4b('0x7'));module[_0xef4b('0x8')]=function(_0x653390,_0x2d3840){return _0x653390[_0xef4b('0x9')](_0xef4b('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4503=['bluebird','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4503,0x104));var _0x3450=function(_0x195497,_0x3dd4bf){_0x195497=_0x195497-0x0;var _0xcf9de6=_0x4503[_0x195497];return _0xcf9de6;};'use strict';var _=require(_0x3450('0x0'));var util=require(_0x3450('0x1'));var logger=require('../../config/logger')(_0x3450('0x2'));var moment=require(_0x3450('0x3'));var BPromise=require(_0x3450('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3450('0x5'));var config=require(_0x3450('0x6'));var attributes=require(_0x3450('0x7'));module[_0x3450('0x8')]=function(_0x2f49de,_0x5cbf5c){return _0x2f49de[_0x3450('0x9')](_0x3450('0xa'),attributes,{'tableName':_0x3450('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 961e214..31c777a 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 _0x4047=['message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','http','defaults','redis','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4047,0x65));var _0x7404=function(_0x34501d,_0x1ae281){_0x34501d=_0x34501d-0x0;var _0x3d87b5=_0x4047[_0x34501d];return _0x3d87b5;};'use strict';var _=require(_0x7404('0x0'));var util=require(_0x7404('0x1'));var moment=require(_0x7404('0x2'));var BPromise=require(_0x7404('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7404('0x4'));var db=require(_0x7404('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7404('0x6')]({'port':0x232a});config['redis']=_[_0x7404('0x7')](config[_0x7404('0x8')],{'host':_0x7404('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7404('0x8')]));require(_0x7404('0xa'))[_0x7404('0xb')](socket);function respondWithRpcPromise(_0x257bff,_0x245912,_0x54c378){return new BPromise(function(_0xc66b1b,_0x27afc1){return client['request'](_0x257bff,_0x54c378)[_0x7404('0xc')](function(_0x3eeccb){logger[_0x7404('0xd')](_0x7404('0xe'),_0x245912,_0x7404('0xf'));logger['debug'](_0x7404('0x10'),_0x245912,_0x7404('0xf'),JSON['stringify'](_0x3eeccb));if(_0x3eeccb['error']){if(_0x3eeccb[_0x7404('0x11')][_0x7404('0x12')]===0x1f4){logger[_0x7404('0x11')](_0x7404('0xe'),_0x245912,_0x3eeccb[_0x7404('0x11')]['message']);return _0x27afc1(_0x3eeccb[_0x7404('0x11')][_0x7404('0x13')]);}logger[_0x7404('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x245912,_0x3eeccb[_0x7404('0x11')][_0x7404('0x13')]);return _0xc66b1b(_0x3eeccb[_0x7404('0x11')][_0x7404('0x13')]);}else{logger[_0x7404('0xd')](_0x7404('0xe'),_0x245912,_0x7404('0xf'));_0xc66b1b(_0x3eeccb[_0x7404('0x14')][_0x7404('0x13')]);}})[_0x7404('0x15')](function(_0x35faea){logger[_0x7404('0x11')](_0x7404('0xe'),_0x245912,_0x35faea);_0x27afc1(_0x35faea);});});}exports[_0x7404('0x16')]=function(_0x1e8fdd){var _0x4361c0=this;return new Promise(function(_0x57c28c,_0x26597b){return db[_0x7404('0x17')]['findAll']({'raw':_0x1e8fdd[_0x7404('0x18')]?_0x1e8fdd['options'][_0x7404('0x19')]===undefined?!![]:![]:!![],'where':_0x1e8fdd[_0x7404('0x18')]?_0x1e8fdd[_0x7404('0x18')][_0x7404('0x1a')]||null:null,'attributes':[[db[_0x7404('0x1b')]['fn'](_0x7404('0x1c'),db[_0x7404('0x1b')]['fn']('IF',db[_0x7404('0x1b')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x7404('0x1d')]]})[_0x7404('0xc')](function(_0x5ada61){logger['info'](_0x7404('0x16'),_0x1e8fdd);logger['debug'](_0x7404('0x16'),_0x1e8fdd,JSON['stringify'](_0x5ada61));_0x57c28c(_0x5ada61);})[_0x7404('0x15')](function(_0x545f08){logger[_0x7404('0x11')](_0x7404('0x16'),_0x545f08[_0x7404('0x13')],_0x1e8fdd);_0x26597b(_0x4361c0[_0x7404('0x11')](0x1f4,_0x545f08[_0x7404('0x13')]));});});}; \ No newline at end of file +var _0x82cf=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','COUNT','literal','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x49eda7,_0x3a5a72){var _0x1a2d40=function(_0x2d8127){while(--_0x2d8127){_0x49eda7['push'](_0x49eda7['shift']());}};_0x1a2d40(++_0x3a5a72);}(_0x82cf,0x74));var _0xf82c=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x82cf[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xf82c('0x0'));var util=require(_0xf82c('0x1'));var moment=require('moment');var BPromise=require(_0xf82c('0x2'));var rs=require(_0xf82c('0x3'));var fs=require('fs');var Redis=require(_0xf82c('0x4'));var db=require(_0xf82c('0x5'))['db'];var utils=require(_0xf82c('0x6'));var logger=require('../../config/logger')(_0xf82c('0x7'));var config=require(_0xf82c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf82c('0x9')]=_[_0xf82c('0xa')](config[_0xf82c('0x9')],{'host':_0xf82c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf82c('0x9')]));require(_0xf82c('0xc'))[_0xf82c('0xd')](socket);function respondWithRpcPromise(_0x436c54,_0xb0751e,_0x3b050e){return new BPromise(function(_0x300006,_0x4ef255){return client['request'](_0x436c54,_0x3b050e)[_0xf82c('0xe')](function(_0xc8e962){logger['info'](_0xf82c('0xf'),_0xb0751e,_0xf82c('0x10'));logger[_0xf82c('0x11')](_0xf82c('0x12'),_0xb0751e,_0xf82c('0x10'),JSON[_0xf82c('0x13')](_0xc8e962));if(_0xc8e962[_0xf82c('0x14')]){if(_0xc8e962[_0xf82c('0x14')][_0xf82c('0x15')]===0x1f4){logger[_0xf82c('0x14')](_0xf82c('0xf'),_0xb0751e,_0xc8e962[_0xf82c('0x14')][_0xf82c('0x16')]);return _0x4ef255(_0xc8e962[_0xf82c('0x14')][_0xf82c('0x16')]);}logger[_0xf82c('0x14')](_0xf82c('0xf'),_0xb0751e,_0xc8e962[_0xf82c('0x14')][_0xf82c('0x16')]);return _0x300006(_0xc8e962[_0xf82c('0x14')]['message']);}else{logger[_0xf82c('0x17')](_0xf82c('0xf'),_0xb0751e,'request\x20sent');_0x300006(_0xc8e962[_0xf82c('0x18')][_0xf82c('0x16')]);}})[_0xf82c('0x19')](function(_0xca82e4){logger[_0xf82c('0x14')](_0xf82c('0xf'),_0xb0751e,_0xca82e4);_0x4ef255(_0xca82e4);});});}exports[_0xf82c('0x1a')]=function(_0x137007){var _0x22783d=this;return new Promise(function(_0x1864ea,_0x39c4cd){return db[_0xf82c('0x1b')]['findAll']({'raw':_0x137007[_0xf82c('0x1c')]?_0x137007['options']['raw']===undefined?!![]:![]:!![],'where':_0x137007['options']?_0x137007[_0xf82c('0x1c')][_0xf82c('0x1d')]||null:null,'attributes':[[db[_0xf82c('0x1e')]['fn'](_0xf82c('0x1f'),db[_0xf82c('0x1e')]['fn']('IF',db[_0xf82c('0x1e')][_0xf82c('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xf82c('0xe')](function(_0x2dd05a){logger['info']('GetVoiceQueueRtPauses',_0x137007);logger['debug'](_0xf82c('0x1a'),_0x137007,JSON[_0xf82c('0x13')](_0x2dd05a));_0x1864ea(_0x2dd05a);})[_0xf82c('0x19')](function(_0x2a5a4e){logger['error'](_0xf82c('0x1a'),_0x2a5a4e[_0xf82c('0x16')],_0x137007);_0x39c4cd(_0x22783d[_0xf82c('0x14')](0x1f4,_0x2a5a4e[_0xf82c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 233a70b..ff5b961 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 _0x938d=['./userVoiceQueueRt.events','save','update','removeListener','length'];(function(_0xd7664b,_0x251226){var _0x59583a=function(_0x4648e0){while(--_0x4648e0){_0xd7664b['push'](_0xd7664b['shift']());}};_0x59583a(++_0x251226);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd938('0x0'));var events=[_0xd938('0x1'),'remove',_0xd938('0x2')];function createListener(_0x29cf5f,_0x221132){return function(_0x5349c7){_0x221132['emit'](_0x29cf5f,_0x5349c7);};}function removeListener(_0xc9f24b,_0x429911){return function(){UserVoiceQueueRtEvents[_0xd938('0x3')](_0xc9f24b,_0x429911);};}exports['register']=function(_0x3a81d2){for(var _0xb5e113=0x0,_0x1ed46b=events[_0xd938('0x4')];_0xb5e113<_0x1ed46b;_0xb5e113++){var _0x678164=events[_0xb5e113];var _0x419e0b=createListener('userVoiceQueueRt:'+_0x678164,_0x3a81d2);UserVoiceQueueRtEvents['on'](_0x678164,_0x419e0b);}}; \ No newline at end of file +var _0xa786=['removeListener','register','length','userVoiceQueueRt:','remove','update','emit'];(function(_0x521e85,_0x48b8b0){var _0xb27342=function(_0xf2f4da){while(--_0xf2f4da){_0x521e85['push'](_0x521e85['shift']());}};_0xb27342(++_0x48b8b0);}(_0xa786,0x1d2));var _0x6a78=function(_0x5bdcaf,_0x10ff0e){_0x5bdcaf=_0x5bdcaf-0x0;var _0x2ae15b=_0xa786[_0x5bdcaf];return _0x2ae15b;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x6a78('0x0'),_0x6a78('0x1')];function createListener(_0x96d812,_0x2c7e2a){return function(_0x22723f){_0x2c7e2a[_0x6a78('0x2')](_0x96d812,_0x22723f);};}function removeListener(_0x34b520,_0x521b4a){return function(){UserVoiceQueueRtEvents[_0x6a78('0x3')](_0x34b520,_0x521b4a);};}exports[_0x6a78('0x4')]=function(_0xc0be8b){for(var _0x45470e=0x0,_0x28d286=events[_0x6a78('0x5')];_0x45470e<_0x28d286;_0x45470e++){var _0x2b8c4c=events[_0x45470e];var _0x2a6de6=createListener(_0x6a78('0x6')+_0x2b8c4c,_0xc0be8b);UserVoiceQueueRtEvents['on'](_0x2b8c4c,_0x2a6de6);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 672add2..68bc3c3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13f5c2,_0xbfb848){var _0x2cc472=function(_0x13bc04){while(--_0x13bc04){_0x13f5c2['push'](_0x13f5c2['shift']());}};_0x2cc472(++_0xbfb848);}(_0xe706,0xa3));var _0x6e70=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0xe706[_0x511b76];return _0x5424ff;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52fde9,_0x5f4440){var _0x1a8bc5=function(_0x5fb76){while(--_0x5fb76){_0x52fde9['push'](_0x52fde9['shift']());}};_0x1a8bc5(++_0x5f4440);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 233076c..731054a 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 _0x92d4=['exports','INTEGER','sequelize'];(function(_0x25b03c,_0x2720bd){var _0x4aef4b=function(_0x5c8033){while(--_0x5c8033){_0x25b03c['push'](_0x25b03c['shift']());}};_0x4aef4b(++_0x2720bd);}(_0x92d4,0x95));var _0x492d=function(_0x219cbf,_0x255068){_0x219cbf=_0x219cbf-0x0;var _0xb68777=_0x92d4[_0x219cbf];return _0xb68777;};'use strict';var Sequelize=require(_0x492d('0x0'));module[_0x492d('0x1')]={'penalty':{'type':Sequelize[_0x492d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5eb6=['INTEGER','sequelize','exports'];(function(_0x406af3,_0x4b4988){var _0x28c25a=function(_0x2cf4a1){while(--_0x2cf4a1){_0x406af3['push'](_0x406af3['shift']());}};_0x28c25a(++_0x4b4988);}(_0x5eb6,0x9a));var _0x65eb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5eb6[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x65eb('0x0'));module[_0x65eb('0x1')]={'penalty':{'type':Sequelize[_0x65eb('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 926daab..cbf2465 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 _0x0d6a=['bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment'];(function(_0x109bc8,_0x2c1b0e){var _0x4dfb47=function(_0x3900e4){while(--_0x3900e4){_0x109bc8['push'](_0x109bc8['shift']());}};_0x4dfb47(++_0x2c1b0e);}(_0x0d6a,0x1dd));var _0xa0d6=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x0d6a[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xa0d6('0x0'));var util=require(_0xa0d6('0x1'));var logger=require('../../config/logger')(_0xa0d6('0x2'));var moment=require(_0xa0d6('0x3'));var BPromise=require(_0xa0d6('0x4'));var rp=require(_0xa0d6('0x5'));var fs=require('fs');var path=require(_0xa0d6('0x6'));var rimraf=require(_0xa0d6('0x7'));var config=require('../../config/environment');var attributes=require(_0xa0d6('0x8'));module[_0xa0d6('0x9')]=function(_0x118ae2,_0x24c309){return _0x118ae2[_0xa0d6('0xa')](_0xa0d6('0xb'),attributes,{'tableName':_0xa0d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fda=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x39ebde,_0x3544c3){var _0x595669=function(_0x54ae36){while(--_0x54ae36){_0x39ebde['push'](_0x39ebde['shift']());}};_0x595669(++_0x3544c3);}(_0x1fda,0x1a9));var _0xa1fd=function(_0x1b57b2,_0x2a5d29){_0x1b57b2=_0x1b57b2-0x0;var _0x344553=_0x1fda[_0x1b57b2];return _0x344553;};'use strict';var _=require(_0xa1fd('0x0'));var util=require(_0xa1fd('0x1'));var logger=require(_0xa1fd('0x2'))(_0xa1fd('0x3'));var moment=require(_0xa1fd('0x4'));var BPromise=require(_0xa1fd('0x5'));var rp=require(_0xa1fd('0x6'));var fs=require('fs');var path=require(_0xa1fd('0x7'));var rimraf=require(_0xa1fd('0x8'));var config=require(_0xa1fd('0x9'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x4af882,_0x47665f){return _0x4af882[_0xa1fd('0xa')](_0xa1fd('0xb'),attributes,{'tableName':_0xa1fd('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 9e893b1..37bc689 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 _0x16bc=['code','message','result','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x16bc,0x1ac));var _0xc16b=function(_0x5b830b,_0x46f69f){_0x5b830b=_0x5b830b-0x0;var _0x3d5f67=_0x16bc[_0x5b830b];return _0x3d5f67;};'use strict';var _=require(_0xc16b('0x0'));var util=require('util');var moment=require(_0xc16b('0x1'));var BPromise=require(_0xc16b('0x2'));var rs=require(_0xc16b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc16b('0x4'))(_0xc16b('0x5'));var config=require('../../config/environment');var jayson=require(_0xc16b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c562c,_0x2f50f3,_0x5e6a06){return new BPromise(function(_0x543d6e,_0x110c71){return client[_0xc16b('0x7')](_0x1c562c,_0x5e6a06)[_0xc16b('0x8')](function(_0x22596d){logger[_0xc16b('0x9')](_0xc16b('0xa'),_0x2f50f3,_0xc16b('0xb'));logger['debug'](_0xc16b('0xc'),_0x2f50f3,_0xc16b('0xb'),JSON['stringify'](_0x22596d));if(_0x22596d['error']){if(_0x22596d[_0xc16b('0xd')][_0xc16b('0xe')]===0x1f4){logger[_0xc16b('0xd')](_0xc16b('0xa'),_0x2f50f3,_0x22596d[_0xc16b('0xd')][_0xc16b('0xf')]);return _0x110c71(_0x22596d[_0xc16b('0xd')]['message']);}logger[_0xc16b('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2f50f3,_0x22596d[_0xc16b('0xd')][_0xc16b('0xf')]);return _0x543d6e(_0x22596d[_0xc16b('0xd')][_0xc16b('0xf')]);}else{logger[_0xc16b('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2f50f3,_0xc16b('0xb'));_0x543d6e(_0x22596d[_0xc16b('0x10')]['message']);}})['catch'](function(_0x28a5f8){logger[_0xc16b('0xd')](_0xc16b('0xa'),_0x2f50f3,_0x28a5f8);_0x110c71(_0x28a5f8);});});} \ No newline at end of file +var _0xf9a1=['../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfc0fcf,_0x70887f){var _0x39d3c3=function(_0x172e6f){while(--_0x172e6f){_0xfc0fcf['push'](_0xfc0fcf['shift']());}};_0x39d3c3(++_0x70887f);}(_0xf9a1,0x195));var _0x1f9a=function(_0x51a0e8,_0x58bfc2){_0x51a0e8=_0x51a0e8-0x0;var _0x4c1f30=_0xf9a1[_0x51a0e8];return _0x4c1f30;};'use strict';var _=require(_0x1f9a('0x0'));var util=require(_0x1f9a('0x1'));var moment=require(_0x1f9a('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f9a('0x3'));var fs=require('fs');var Redis=require(_0x1f9a('0x4'));var db=require(_0x1f9a('0x5'))['db'];var utils=require(_0x1f9a('0x6'));var logger=require(_0x1f9a('0x7'))(_0x1f9a('0x8'));var config=require(_0x1f9a('0x9'));var jayson=require(_0x1f9a('0xa'));var client=jayson[_0x1f9a('0xb')][_0x1f9a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x469d66,_0x292c04,_0x160b4c){return new BPromise(function(_0x303809,_0x5e53ba){return client[_0x1f9a('0xd')](_0x469d66,_0x160b4c)['then'](function(_0x513258){logger[_0x1f9a('0xe')](_0x1f9a('0xf'),_0x292c04,_0x1f9a('0x10'));logger['debug'](_0x1f9a('0x11'),_0x292c04,_0x1f9a('0x10'),JSON[_0x1f9a('0x12')](_0x513258));if(_0x513258[_0x1f9a('0x13')]){if(_0x513258[_0x1f9a('0x13')][_0x1f9a('0x14')]===0x1f4){logger[_0x1f9a('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x292c04,_0x513258[_0x1f9a('0x13')][_0x1f9a('0x15')]);return _0x5e53ba(_0x513258['error'][_0x1f9a('0x15')]);}logger[_0x1f9a('0x13')](_0x1f9a('0xf'),_0x292c04,_0x513258[_0x1f9a('0x13')]['message']);return _0x303809(_0x513258[_0x1f9a('0x13')][_0x1f9a('0x15')]);}else{logger['info'](_0x1f9a('0xf'),_0x292c04,_0x1f9a('0x10'));_0x303809(_0x513258['result'][_0x1f9a('0x15')]);}})[_0x1f9a('0x16')](function(_0x434d5a){logger[_0x1f9a('0x13')](_0x1f9a('0xf'),_0x292c04,_0x434d5a);_0x5e53ba(_0x434d5a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 621c1ea..816336f 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 _0xb7a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','util','path'];(function(_0x55e645,_0x2e8017){var _0x34c1c3=function(_0x54a995){while(--_0x54a995){_0x55e645['push'](_0x55e645['shift']());}};_0x34c1c3(++_0x2e8017);}(_0xb7a8,0xec));var _0x8b7a=function(_0xc2b2d4,_0x465346){_0xc2b2d4=_0xc2b2d4-0x0;var _0x143fb8=_0xb7a8[_0xc2b2d4];return _0x143fb8;};'use strict';var multer=require('multer');var util=require(_0x8b7a('0x0'));var path=require(_0x8b7a('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b7a('0x2'));var router=express[_0x8b7a('0x3')]();var fs_extra=require(_0x8b7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var controller=require(_0x8b7a('0x7'));router[_0x8b7a('0x8')]('/',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xa')]);router[_0x8b7a('0x8')](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xc')]);router[_0x8b7a('0xd')]('/',auth[_0x8b7a('0x9')](),controller['create']);router[_0x8b7a('0xe')]('/:id',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xf')]);router['delete'](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x62c8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','path','Router','fs-extra'];(function(_0x447291,_0x571423){var _0x412a17=function(_0xcc7b61){while(--_0xcc7b61){_0x447291['push'](_0x447291['shift']());}};_0x412a17(++_0x571423);}(_0x62c8,0x1ad));var _0x862c=function(_0x348ee4,_0x47ab69){_0x348ee4=_0x348ee4-0x0;var _0x2a5264=_0x62c8[_0x348ee4];return _0x2a5264;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x862c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x862c('0x1')]();var fs_extra=require(_0x862c('0x2'));var auth=require(_0x862c('0x3'));var interaction=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var controller=require(_0x862c('0x6'));router['get']('/',auth[_0x862c('0x7')](),controller[_0x862c('0x8')]);router[_0x862c('0x9')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0xb')]);router[_0x862c('0xc')]('/',auth[_0x862c('0x7')](),controller[_0x862c('0xd')]);router[_0x862c('0xe')](_0x862c('0xa'),auth['isAuthenticated'](),controller[_0x862c('0xf')]);router[_0x862c('0x10')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0x11')]);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 f591b8e..7431c59 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 _0x1347=['exports','STRING'];(function(_0x781a1d,_0x168512){var _0x2e9fad=function(_0x56185c){while(--_0x56185c){_0x781a1d['push'](_0x781a1d['shift']());}};_0x2e9fad(++_0x168512);}(_0x1347,0xd0));var _0x7134=function(_0x36e7d3,_0xd816e4){_0x36e7d3=_0x36e7d3-0x0;var _0x1b9c66=_0x1347[_0x36e7d3];return _0x1b9c66;};'use strict';var Sequelize=require('sequelize');module[_0x7134('0x0')]={'name':{'type':Sequelize[_0x7134('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7134('0x1')]}}; \ No newline at end of file +var _0x0fcf=['name','STRING'];(function(_0x18270f,_0x475de9){var _0x4bc4a2=function(_0x559273){while(--_0x559273){_0x18270f['push'](_0x18270f['shift']());}};_0x4bc4a2(++_0x475de9);}(_0x0fcf,0xdb));var _0xf0fc=function(_0x1bee27,_0x9de998){_0x1bee27=_0x1bee27-0x0;var _0x1348eb=_0x0fcf[_0x1bee27];return _0x1348eb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf0fc('0x0')],'unique':_0xf0fc('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf0fc('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c0755ca..cf33810 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 _0x719f=['offset','limit','set','apply','reject','save','update','then','destroy','Variables','error','stack','index','map','Variable','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x719f,0x177));var _0xf719=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x719f[_0x3c51d4];return _0x53c45f;};'use strict';var emlformat=require(_0xf719('0x0'));var rimraf=require(_0xf719('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf719('0x2'));var rp=require('request-promise');var moment=require(_0xf719('0x3'));var BPromise=require(_0xf719('0x4'));var Mustache=require(_0xf719('0x5'));var util=require('util');var path=require(_0xf719('0x6'));var sox=require(_0xf719('0x7'));var csv=require('to-csv');var ejs=require(_0xf719('0x8'));var fs=require('fs');var fs_extra=require(_0xf719('0x9'));var _=require(_0xf719('0xa'));var squel=require('squel');var crypto=require(_0xf719('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf719('0xc'));var querystring=require(_0xf719('0xd'));var Papa=require(_0xf719('0xe'));var Redis=require(_0xf719('0xf'));var authService=require(_0xf719('0x10'));var qs=require(_0xf719('0x11'));var as=require(_0xf719('0x12'));var hardwareService=require(_0xf719('0x13'));var logger=require(_0xf719('0x14'))(_0xf719('0x15'));var utils=require('../../config/utils');var config=require(_0xf719('0x16'));var licenseUtil=require(_0xf719('0x17'));var db=require(_0xf719('0x18'))['db'];function respondWithStatusCode(_0x411822,_0x45537c){_0x45537c=_0x45537c||0xcc;return function(_0x3120a1){if(_0x3120a1){return _0x411822['sendStatus'](_0x45537c);}return _0x411822[_0xf719('0x19')](_0x45537c)[_0xf719('0x1a')]();};}function respondWithResult(_0x3b4955,_0x429c5c){_0x429c5c=_0x429c5c||0xc8;return function(_0x4a42d2){if(_0x4a42d2){return _0x3b4955[_0xf719('0x19')](_0x429c5c)[_0xf719('0x1b')](_0x4a42d2);}};}function respondWithFilteredResult(_0x42b66a,_0x422d43){return function(_0x24f034){if(_0x24f034){var _0x441f05=typeof _0x422d43['offset']===_0xf719('0x1c')&&typeof _0x422d43['limit']===_0xf719('0x1c');var _0x4f0e06=_0x24f034[_0xf719('0x1d')];var _0x1da9ca=_0x441f05?0x0:_0x422d43[_0xf719('0x1e')];var _0x18a373=_0x441f05?_0x24f034[_0xf719('0x1d')]:_0x422d43[_0xf719('0x1e')]+_0x422d43[_0xf719('0x1f')];var _0x874373;if(_0x18a373>=_0x4f0e06){_0x18a373=_0x4f0e06;_0x874373=0xc8;}else{_0x874373=0xce;}_0x42b66a['status'](_0x874373);return _0x42b66a[_0xf719('0x20')]('Content-Range',_0x1da9ca+'-'+_0x18a373+'/'+_0x4f0e06)[_0xf719('0x1b')](_0x24f034);}return null;};}function patchUpdates(_0x187363){return function(_0x22d24a){try{jsonpatch[_0xf719('0x21')](_0x22d24a,_0x187363,!![]);}catch(_0xde9257){return BPromise[_0xf719('0x22')](_0xde9257);}return _0x22d24a[_0xf719('0x23')]();};}function saveUpdates(_0x298be7,_0x16802d){return function(_0x5034a3){if(_0x5034a3){return _0x5034a3[_0xf719('0x24')](_0x298be7)[_0xf719('0x25')](function(_0x533eb3){return _0x533eb3;});}return null;};}function removeEntity(_0x503d32,_0x1e5186){return function(_0x37b613){if(_0x37b613){return _0x37b613[_0xf719('0x26')]()['then'](function(){var _0x16bfce=_0x37b613['get']({'plain':!![]});var _0x5a3142=_0xf719('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a3142,'resourceId':_0x16bfce['id']}})['then'](function(){return _0x37b613;});})['then'](function(){_0x503d32[_0xf719('0x19')](0xcc)[_0xf719('0x1a')]();});}};}function handleEntityNotFound(_0x19d7f2,_0x5c74b9){return function(_0x5bdba2){if(!_0x5bdba2){_0x19d7f2['sendStatus'](0x194);}return _0x5bdba2;};}function handleError(_0x383b73,_0x3b9d77){_0x3b9d77=_0x3b9d77||0x1f4;return function(_0x260aa5){logger[_0xf719('0x28')](_0x260aa5[_0xf719('0x29')]);if(_0x260aa5['name']){delete _0x260aa5['name'];}_0x383b73['status'](_0x3b9d77)['send'](_0x260aa5);};}exports[_0xf719('0x2a')]=function(_0x5ef490,_0x14e8d4){var _0x2d848e={},_0x1e347a={},_0x1af18c={'count':0x0,'rows':[]};var _0x40ae31=_[_0xf719('0x2b')](db[_0xf719('0x2c')][_0xf719('0x2d')],function(_0x394c72){return{'name':_0x394c72['fieldName'],'type':_0x394c72['type'][_0xf719('0x2e')]};});_0x1e347a[_0xf719('0x2f')]=_[_0xf719('0x2b')](_0x40ae31,'name');_0x1e347a['query']=_[_0xf719('0x30')](_0x5ef490[_0xf719('0x31')]);_0x1e347a[_0xf719('0x32')]=_['intersection'](_0x1e347a['model'],_0x1e347a[_0xf719('0x31')]);_0x2d848e[_0xf719('0x33')]=_[_0xf719('0x34')](_0x1e347a[_0xf719('0x2f')],qs[_0xf719('0x35')](_0x5ef490[_0xf719('0x31')][_0xf719('0x35')]));_0x2d848e[_0xf719('0x33')]=_0x2d848e[_0xf719('0x33')][_0xf719('0x36')]?_0x2d848e[_0xf719('0x33')]:_0x1e347a['model'];if(!_0x5ef490[_0xf719('0x31')][_0xf719('0x37')](_0xf719('0x38'))){_0x2d848e[_0xf719('0x1f')]=qs[_0xf719('0x1f')](_0x5ef490[_0xf719('0x31')]['limit']);_0x2d848e[_0xf719('0x1e')]=qs[_0xf719('0x1e')](_0x5ef490[_0xf719('0x31')][_0xf719('0x1e')]);}_0x2d848e[_0xf719('0x39')]=qs[_0xf719('0x3a')](_0x5ef490[_0xf719('0x31')][_0xf719('0x3a')]);_0x2d848e[_0xf719('0x3b')]=qs[_0xf719('0x32')](_['pick'](_0x5ef490[_0xf719('0x31')],_0x1e347a[_0xf719('0x32')]),_0x40ae31);if(_0x5ef490['query'][_0xf719('0x3c')]){_0x2d848e[_0xf719('0x3b')]=_[_0xf719('0x3d')](_0x2d848e[_0xf719('0x3b')],{'$or':_[_0xf719('0x2b')](_0x40ae31,function(_0x2d7dc5){if(_0x2d7dc5['type']!==_0xf719('0x3e')){var _0x17139b={};_0x17139b[_0x2d7dc5['name']]={'$like':'%'+_0x5ef490[_0xf719('0x31')]['filter']+'%'};return _0x17139b;}})});}_0x2d848e=_['merge']({},_0x2d848e,_0x5ef490[_0xf719('0x3f')]);var _0x22c65d={'where':_0x2d848e['where']};return db['Variable'][_0xf719('0x1d')](_0x22c65d)['then'](function(_0x3127da){_0x1af18c[_0xf719('0x1d')]=_0x3127da;if(_0x5ef490[_0xf719('0x31')][_0xf719('0x40')]){_0x2d848e['include']=[{'all':!![]}];}return db[_0xf719('0x2c')][_0xf719('0x41')](_0x2d848e);})[_0xf719('0x25')](function(_0x51fb04){_0x1af18c[_0xf719('0x42')]=_0x51fb04;return _0x1af18c;})[_0xf719('0x25')](respondWithFilteredResult(_0x14e8d4,_0x2d848e))[_0xf719('0x43')](handleError(_0x14e8d4,null));};exports[_0xf719('0x44')]=function(_0x273e34,_0x4325bb){var _0x53c2c0={'raw':!![],'where':{'id':_0x273e34[_0xf719('0x45')]['id']}},_0x483d97={};_0x483d97[_0xf719('0x2f')]=_[_0xf719('0x30')](db[_0xf719('0x2c')]['rawAttributes']);_0x483d97[_0xf719('0x31')]=_[_0xf719('0x30')](_0x273e34[_0xf719('0x31')]);_0x483d97['filters']=_[_0xf719('0x34')](_0x483d97[_0xf719('0x2f')],_0x483d97[_0xf719('0x31')]);_0x53c2c0[_0xf719('0x33')]=_[_0xf719('0x34')](_0x483d97[_0xf719('0x2f')],qs[_0xf719('0x35')](_0x273e34[_0xf719('0x31')][_0xf719('0x35')]));_0x53c2c0[_0xf719('0x33')]=_0x53c2c0['attributes'][_0xf719('0x36')]?_0x53c2c0['attributes']:_0x483d97[_0xf719('0x2f')];if(_0x273e34[_0xf719('0x31')]['includeAll']){_0x53c2c0[_0xf719('0x46')]=[{'all':!![]}];}_0x53c2c0=_[_0xf719('0x3d')]({},_0x53c2c0,_0x273e34['options']);return db[_0xf719('0x2c')][_0xf719('0x47')](_0x53c2c0)['then'](handleEntityNotFound(_0x4325bb,null))[_0xf719('0x25')](respondWithResult(_0x4325bb,null))[_0xf719('0x43')](handleError(_0x4325bb,null));};exports[_0xf719('0x48')]=function(_0x277c5c,_0xffcdc5){return db[_0xf719('0x2c')][_0xf719('0x48')](_0x277c5c['body'],{})[_0xf719('0x25')](function(_0x2bf6f9){var _0x55f0a5=_0x277c5c[_0xf719('0x49')][_0xf719('0x4a')]({'plain':!![]});if(!_0x55f0a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55f0a5['role']===_0xf719('0x49')){var _0x246074=_0x2bf6f9[_0xf719('0x4a')]({'plain':!![]});var _0x144580=_0xf719('0x27');return db[_0xf719('0x4b')][_0xf719('0x47')]({'where':{'name':_0x144580,'userProfileId':_0x55f0a5[_0xf719('0x4c')]},'raw':!![]})['then'](function(_0xe9639e){if(_0xe9639e&&_0xe9639e[_0xf719('0x4d')]===0x0){return db['UserProfileResource'][_0xf719('0x48')]({'name':_0x246074[_0xf719('0x4e')],'resourceId':_0x246074['id'],'type':_0xe9639e[_0xf719('0x4e')],'sectionId':_0xe9639e['id']},{})[_0xf719('0x25')](function(){return _0x2bf6f9;});}else{return _0x2bf6f9;}})['catch'](function(_0xf1aa88){logger['error'](_0xf719('0x4f'),_0xf1aa88);throw _0xf1aa88;});}return _0x2bf6f9;})[_0xf719('0x25')](respondWithResult(_0xffcdc5,0xc9))[_0xf719('0x43')](handleError(_0xffcdc5,null));};exports[_0xf719('0x24')]=function(_0x3acaee,_0x357219){if(_0x3acaee[_0xf719('0x50')]['id']){delete _0x3acaee[_0xf719('0x50')]['id'];}return db[_0xf719('0x2c')][_0xf719('0x47')]({'where':{'id':_0x3acaee[_0xf719('0x45')]['id']}})[_0xf719('0x25')](handleEntityNotFound(_0x357219,null))[_0xf719('0x25')](saveUpdates(_0x3acaee['body'],null))[_0xf719('0x25')](respondWithResult(_0x357219,null))[_0xf719('0x43')](handleError(_0x357219,null));};exports[_0xf719('0x26')]=function(_0x3de5bb,_0x39cb3a){return db[_0xf719('0x2c')][_0xf719('0x47')]({'where':{'id':_0x3de5bb[_0xf719('0x45')]['id']}})[_0xf719('0x25')](handleEntityNotFound(_0x39cb3a,null))['then'](removeEntity(_0x39cb3a,null))['catch'](handleError(_0x39cb3a,null));}; \ No newline at end of file +var _0xf966=['UserProfileSection','userProfileId','autoAssociation','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Variables','end','error','stack','send','index','map','Variable','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x178118,_0x293a41){var _0x5beaa2=function(_0x5c825b){while(--_0x5c825b){_0x178118['push'](_0x178118['shift']());}};_0x5beaa2(++_0x293a41);}(_0xf966,0x1bd));var _0x6f96=function(_0xed6d48,_0x4f16e4){_0xed6d48=_0xed6d48-0x0;var _0x49a35f=_0xf966[_0xed6d48];return _0x49a35f;};'use strict';var emlformat=require(_0x6f96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f96('0x1'));var jsonpatch=require(_0x6f96('0x2'));var rp=require(_0x6f96('0x3'));var moment=require(_0x6f96('0x4'));var BPromise=require(_0x6f96('0x5'));var Mustache=require(_0x6f96('0x6'));var util=require(_0x6f96('0x7'));var path=require('path');var sox=require(_0x6f96('0x8'));var csv=require(_0x6f96('0x9'));var ejs=require(_0x6f96('0xa'));var fs=require('fs');var fs_extra=require(_0x6f96('0xb'));var _=require(_0x6f96('0xc'));var squel=require(_0x6f96('0xd'));var crypto=require(_0x6f96('0xe'));var jsforce=require(_0x6f96('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6f96('0x10'));var Papa=require(_0x6f96('0x11'));var Redis=require(_0x6f96('0x12'));var authService=require(_0x6f96('0x13'));var qs=require(_0x6f96('0x14'));var as=require(_0x6f96('0x15'));var hardwareService=require(_0x6f96('0x16'));var logger=require(_0x6f96('0x17'))(_0x6f96('0x18'));var utils=require(_0x6f96('0x19'));var config=require(_0x6f96('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f96('0x1b'))['db'];function respondWithStatusCode(_0x421494,_0x57c646){_0x57c646=_0x57c646||0xcc;return function(_0x9219fa){if(_0x9219fa){return _0x421494[_0x6f96('0x1c')](_0x57c646);}return _0x421494[_0x6f96('0x1d')](_0x57c646)['end']();};}function respondWithResult(_0x206e5d,_0x470331){_0x470331=_0x470331||0xc8;return function(_0x105ade){if(_0x105ade){return _0x206e5d[_0x6f96('0x1d')](_0x470331)[_0x6f96('0x1e')](_0x105ade);}};}function respondWithFilteredResult(_0x4e859b,_0x9aef9b){return function(_0x4a3b0e){if(_0x4a3b0e){var _0x50d8ad=typeof _0x9aef9b[_0x6f96('0x1f')]==='undefined'&&typeof _0x9aef9b[_0x6f96('0x20')]==='undefined';var _0x2d38b7=_0x4a3b0e[_0x6f96('0x21')];var _0x1b6e48=_0x50d8ad?0x0:_0x9aef9b['offset'];var _0x5ad2c4=_0x50d8ad?_0x4a3b0e[_0x6f96('0x21')]:_0x9aef9b[_0x6f96('0x1f')]+_0x9aef9b['limit'];var _0x3dc3c3;if(_0x5ad2c4>=_0x2d38b7){_0x5ad2c4=_0x2d38b7;_0x3dc3c3=0xc8;}else{_0x3dc3c3=0xce;}_0x4e859b[_0x6f96('0x1d')](_0x3dc3c3);return _0x4e859b['set'](_0x6f96('0x22'),_0x1b6e48+'-'+_0x5ad2c4+'/'+_0x2d38b7)[_0x6f96('0x1e')](_0x4a3b0e);}return null;};}function patchUpdates(_0x4f0600){return function(_0x2531cd){try{jsonpatch[_0x6f96('0x23')](_0x2531cd,_0x4f0600,!![]);}catch(_0x5daffe){return BPromise[_0x6f96('0x24')](_0x5daffe);}return _0x2531cd[_0x6f96('0x25')]();};}function saveUpdates(_0x1f0fc8,_0x10b986){return function(_0x791fcc){if(_0x791fcc){return _0x791fcc[_0x6f96('0x26')](_0x1f0fc8)['then'](function(_0x395a2d){return _0x395a2d;});}return null;};}function removeEntity(_0x30810b,_0x49e01f){return function(_0x333bed){if(_0x333bed){return _0x333bed[_0x6f96('0x27')]()[_0x6f96('0x28')](function(){var _0x3d06d4=_0x333bed[_0x6f96('0x29')]({'plain':!![]});var _0x1a17ec=_0x6f96('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a17ec,'resourceId':_0x3d06d4['id']}})['then'](function(){return _0x333bed;});})[_0x6f96('0x28')](function(){_0x30810b['status'](0xcc)[_0x6f96('0x2b')]();});}};}function handleEntityNotFound(_0x1a2791,_0x307551){return function(_0x3394bb){if(!_0x3394bb){_0x1a2791[_0x6f96('0x1c')](0x194);}return _0x3394bb;};}function handleError(_0x17be04,_0x11df66){_0x11df66=_0x11df66||0x1f4;return function(_0x4385cb){logger[_0x6f96('0x2c')](_0x4385cb[_0x6f96('0x2d')]);if(_0x4385cb['name']){delete _0x4385cb['name'];}_0x17be04[_0x6f96('0x1d')](_0x11df66)[_0x6f96('0x2e')](_0x4385cb);};}exports[_0x6f96('0x2f')]=function(_0x503782,_0x1d53d5){var _0x311888={},_0x110df7={},_0xad62e={'count':0x0,'rows':[]};var _0xa3b45c=_[_0x6f96('0x30')](db[_0x6f96('0x31')][_0x6f96('0x32')],function(_0x28527c){return{'name':_0x28527c[_0x6f96('0x33')],'type':_0x28527c['type']['key']};});_0x110df7[_0x6f96('0x34')]=_['map'](_0xa3b45c,_0x6f96('0x35'));_0x110df7[_0x6f96('0x36')]=_[_0x6f96('0x37')](_0x503782[_0x6f96('0x36')]);_0x110df7['filters']=_[_0x6f96('0x38')](_0x110df7['model'],_0x110df7['query']);_0x311888[_0x6f96('0x39')]=_[_0x6f96('0x38')](_0x110df7[_0x6f96('0x34')],qs[_0x6f96('0x3a')](_0x503782[_0x6f96('0x36')]['fields']));_0x311888[_0x6f96('0x39')]=_0x311888[_0x6f96('0x39')][_0x6f96('0x3b')]?_0x311888[_0x6f96('0x39')]:_0x110df7['model'];if(!_0x503782['query'][_0x6f96('0x3c')](_0x6f96('0x3d'))){_0x311888[_0x6f96('0x20')]=qs[_0x6f96('0x20')](_0x503782['query'][_0x6f96('0x20')]);_0x311888[_0x6f96('0x1f')]=qs['offset'](_0x503782['query'][_0x6f96('0x1f')]);}_0x311888[_0x6f96('0x3e')]=qs[_0x6f96('0x3f')](_0x503782[_0x6f96('0x36')][_0x6f96('0x3f')]);_0x311888[_0x6f96('0x40')]=qs[_0x6f96('0x41')](_[_0x6f96('0x42')](_0x503782[_0x6f96('0x36')],_0x110df7[_0x6f96('0x41')]),_0xa3b45c);if(_0x503782[_0x6f96('0x36')][_0x6f96('0x43')]){_0x311888[_0x6f96('0x40')]=_[_0x6f96('0x44')](_0x311888[_0x6f96('0x40')],{'$or':_[_0x6f96('0x30')](_0xa3b45c,function(_0x528760){if(_0x528760[_0x6f96('0x45')]!==_0x6f96('0x46')){var _0x28abae={};_0x28abae[_0x528760['name']]={'$like':'%'+_0x503782[_0x6f96('0x36')][_0x6f96('0x43')]+'%'};return _0x28abae;}})});}_0x311888=_[_0x6f96('0x44')]({},_0x311888,_0x503782[_0x6f96('0x47')]);var _0x554ece={'where':_0x311888[_0x6f96('0x40')]};return db[_0x6f96('0x31')][_0x6f96('0x21')](_0x554ece)[_0x6f96('0x28')](function(_0x274970){_0xad62e['count']=_0x274970;if(_0x503782['query'][_0x6f96('0x48')]){_0x311888[_0x6f96('0x49')]=[{'all':!![]}];}return db[_0x6f96('0x31')][_0x6f96('0x4a')](_0x311888);})[_0x6f96('0x28')](function(_0x393244){_0xad62e[_0x6f96('0x4b')]=_0x393244;return _0xad62e;})[_0x6f96('0x28')](respondWithFilteredResult(_0x1d53d5,_0x311888))[_0x6f96('0x4c')](handleError(_0x1d53d5,null));};exports[_0x6f96('0x4d')]=function(_0x4e338d,_0x541496){var _0x4778fa={'raw':!![],'where':{'id':_0x4e338d[_0x6f96('0x4e')]['id']}},_0x3a5bbe={};_0x3a5bbe[_0x6f96('0x34')]=_[_0x6f96('0x37')](db[_0x6f96('0x31')][_0x6f96('0x32')]);_0x3a5bbe['query']=_[_0x6f96('0x37')](_0x4e338d['query']);_0x3a5bbe[_0x6f96('0x41')]=_[_0x6f96('0x38')](_0x3a5bbe['model'],_0x3a5bbe[_0x6f96('0x36')]);_0x4778fa[_0x6f96('0x39')]=_[_0x6f96('0x38')](_0x3a5bbe['model'],qs['fields'](_0x4e338d['query'][_0x6f96('0x3a')]));_0x4778fa[_0x6f96('0x39')]=_0x4778fa[_0x6f96('0x39')]['length']?_0x4778fa[_0x6f96('0x39')]:_0x3a5bbe[_0x6f96('0x34')];if(_0x4e338d['query'][_0x6f96('0x48')]){_0x4778fa[_0x6f96('0x49')]=[{'all':!![]}];}_0x4778fa=_['merge']({},_0x4778fa,_0x4e338d[_0x6f96('0x47')]);return db[_0x6f96('0x31')]['find'](_0x4778fa)[_0x6f96('0x28')](handleEntityNotFound(_0x541496,null))[_0x6f96('0x28')](respondWithResult(_0x541496,null))[_0x6f96('0x4c')](handleError(_0x541496,null));};exports[_0x6f96('0x4f')]=function(_0x73fd2f,_0x523531){return db[_0x6f96('0x31')][_0x6f96('0x4f')](_0x73fd2f['body'],{})[_0x6f96('0x28')](function(_0x564d9f){var _0x361de8=_0x73fd2f[_0x6f96('0x50')][_0x6f96('0x29')]({'plain':!![]});if(!_0x361de8)throw new Error(_0x6f96('0x51'));if(_0x361de8[_0x6f96('0x52')]===_0x6f96('0x50')){var _0x3034f6=_0x564d9f[_0x6f96('0x29')]({'plain':!![]});var _0x594e89=_0x6f96('0x2a');return db[_0x6f96('0x53')]['find']({'where':{'name':_0x594e89,'userProfileId':_0x361de8[_0x6f96('0x54')]},'raw':!![]})[_0x6f96('0x28')](function(_0x34b66c){if(_0x34b66c&&_0x34b66c[_0x6f96('0x55')]===0x0){return db['UserProfileResource'][_0x6f96('0x4f')]({'name':_0x3034f6['name'],'resourceId':_0x3034f6['id'],'type':_0x34b66c[_0x6f96('0x35')],'sectionId':_0x34b66c['id']},{})[_0x6f96('0x28')](function(){return _0x564d9f;});}else{return _0x564d9f;}})[_0x6f96('0x4c')](function(_0x1d14cf){logger[_0x6f96('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d14cf);throw _0x1d14cf;});}return _0x564d9f;})['then'](respondWithResult(_0x523531,0xc9))[_0x6f96('0x4c')](handleError(_0x523531,null));};exports[_0x6f96('0x26')]=function(_0x12a572,_0x169120){if(_0x12a572[_0x6f96('0x56')]['id']){delete _0x12a572[_0x6f96('0x56')]['id'];}return db['Variable'][_0x6f96('0x57')]({'where':{'id':_0x12a572[_0x6f96('0x4e')]['id']}})['then'](handleEntityNotFound(_0x169120,null))[_0x6f96('0x28')](saveUpdates(_0x12a572[_0x6f96('0x56')],null))['then'](respondWithResult(_0x169120,null))[_0x6f96('0x4c')](handleError(_0x169120,null));};exports[_0x6f96('0x27')]=function(_0x29a195,_0x3a2149){return db[_0x6f96('0x31')][_0x6f96('0x57')]({'where':{'id':_0x29a195[_0x6f96('0x4e')]['id']}})[_0x6f96('0x28')](handleEntityNotFound(_0x3a2149,null))['then'](removeEntity(_0x3a2149,null))[_0x6f96('0x4c')](handleError(_0x3a2149,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index dbc09f2..202f81d 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 _0x5bbf=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x1191ca,_0x5b8e66){var _0x71cc50=function(_0x29d88a){while(--_0x29d88a){_0x1191ca['push'](_0x1191ca['shift']());}};_0x71cc50(++_0x5b8e66);}(_0x5bbf,0x196));var _0xf5bb=function(_0x2a5057,_0x47a687){_0x2a5057=_0x2a5057-0x0;var _0x32cd96=_0x5bbf[_0x2a5057];return _0x32cd96;};'use strict';var _=require(_0xf5bb('0x0'));var util=require(_0xf5bb('0x1'));var logger=require(_0xf5bb('0x2'))(_0xf5bb('0x3'));var moment=require(_0xf5bb('0x4'));var BPromise=require(_0xf5bb('0x5'));var rp=require(_0xf5bb('0x6'));var fs=require('fs');var path=require(_0xf5bb('0x7'));var rimraf=require(_0xf5bb('0x8'));var config=require(_0xf5bb('0x9'));var attributes=require(_0xf5bb('0xa'));module[_0xf5bb('0xb')]=function(_0x41c8fa,_0x11ddcf){return _0x41c8fa[_0xf5bb('0xc')](_0xf5bb('0xd'),attributes,{'tableName':_0xf5bb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf04e=['Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0xf04e,0x16a));var _0xef04=function(_0x888093,_0x585cc1){_0x888093=_0x888093-0x0;var _0x44b54a=_0xf04e[_0x888093];return _0x44b54a;};'use strict';var _=require(_0xef04('0x0'));var util=require(_0xef04('0x1'));var logger=require(_0xef04('0x2'))(_0xef04('0x3'));var moment=require('moment');var BPromise=require(_0xef04('0x4'));var rp=require(_0xef04('0x5'));var fs=require('fs');var path=require(_0xef04('0x6'));var rimraf=require(_0xef04('0x7'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xef04('0x8')]=function(_0x27270a,_0x3f2d02){return _0x27270a[_0xef04('0x9')](_0xef04('0xa'),attributes,{'tableName':_0xef04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 395858b..c970ea6 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 _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x3460c9,_0x565510){var _0x1d8283=function(_0x8a51bd){while(--_0x8a51bd){_0x3460c9['push'](_0x3460c9['shift']());}};_0x1d8283(++_0x565510);}(_0x3e74,0x175));var _0x43e7=function(_0x94d2f6,_0x40476e){_0x94d2f6=_0x94d2f6-0x0;var _0x3d6564=_0x3e74[_0x94d2f6];return _0x3d6564;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x2ee1cc,_0x59ce25){var _0x4dae8f=function(_0x435860){while(--_0x435860){_0x2ee1cc['push'](_0x2ee1cc['shift']());}};_0x4dae8f(++_0x59ce25);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b3e4f21..b2840d8 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 _0x7a8c=['./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','migrations','exports','express'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x7a8c,0xfb));var _0xc7a8=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x7a8c[_0x24061a];return _0x82054e;};'use strict';var express=require(_0xc7a8('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xc7a8('0x1'));router['get']('/',controller[_0xc7a8('0x2')]);router[_0xc7a8('0x3')](_0xc7a8('0x4'),auth[_0xc7a8('0x5')](),auth[_0xc7a8('0x6')](),controller[_0xc7a8('0x7')]);router['get'](_0xc7a8('0x8'),auth['isAuthenticated'](),auth[_0xc7a8('0x6')](),controller[_0xc7a8('0x9')]);router[_0xc7a8('0x3')](_0xc7a8('0xa'),auth[_0xc7a8('0x5')](),auth[_0xc7a8('0x6')](),controller['pull']);router[_0xc7a8('0x3')](_0xc7a8('0xb'),auth['isAuthenticated'](),controller['restart']);router[_0xc7a8('0x3')]('/migrations',controller[_0xc7a8('0xc')]);module[_0xc7a8('0xd')]=router; \ No newline at end of file +var _0xb81d=['index','canUpdate','fetch','/reset','isAuthenticated','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x4ab9a7,_0x291df1){var _0xd08799=function(_0x32bd6a){while(--_0x32bd6a){_0x4ab9a7['push'](_0x4ab9a7['shift']());}};_0xd08799(++_0x291df1);}(_0xb81d,0x182));var _0xdb81=function(_0x45af53,_0x59f613){_0x45af53=_0x45af53-0x0;var _0x5cddfd=_0xb81d[_0x45af53];return _0x5cddfd;};'use strict';var express=require(_0xdb81('0x0'));var router=express[_0xdb81('0x1')]();var auth=require(_0xdb81('0x2'));var controller=require(_0xdb81('0x3'));router[_0xdb81('0x4')]('/',controller[_0xdb81('0x5')]);router[_0xdb81('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0xdb81('0x6')](),controller[_0xdb81('0x7')]);router[_0xdb81('0x4')](_0xdb81('0x8'),auth[_0xdb81('0x9')](),auth['canUpdate'](),controller['reset']);router[_0xdb81('0x4')](_0xdb81('0xa'),auth[_0xdb81('0x9')](),auth[_0xdb81('0x6')](),controller[_0xdb81('0xb')]);router[_0xdb81('0x4')](_0xdb81('0xc'),auth[_0xdb81('0x9')](),controller[_0xdb81('0xd')]);router[_0xdb81('0x4')](_0xdb81('0xe'),controller[_0xdb81('0xf')]);module[_0xdb81('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 15558ca..1aed051 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 _0xc6a2=['replace','.js','push','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','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','origin','status','info','git\x20fetch','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length'];(function(_0x541139,_0x13f534){var _0xf2c9a1=function(_0x1c0eb0){while(--_0x1c0eb0){_0x541139['push'](_0x541139['shift']());}};_0xf2c9a1(++_0x13f534);}(_0xc6a2,0x111));var _0x2c6a=function(_0x46839b,_0x53c2c4){_0x46839b=_0x46839b-0x0;var _0x40f623=_0xc6a2[_0x46839b];return _0x40f623;};'use strict';var Umzug=require('umzug');var path=require(_0x2c6a('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x2c6a('0x1'))(module,_0x2c6a('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x2c6a('0x3'))[_0x2c6a('0x4')];var db=require(_0x2c6a('0x5'))['db'];var config=require(_0x2c6a('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x2c6a('0x7'))(_0x2c6a('0x8'));var git=require(_0x2c6a('0x9'))(config[_0x2c6a('0xa')]);exports[_0x2c6a('0xb')]=function(_0x6a0728,_0x5450aa){var _0x418b14={'current':module[_0x2c6a('0xc')][_0x2c6a('0x2')],'phonebar':0x2};if(_0x6a0728[_0x2c6a('0xd')]&&_0x6a0728[_0x2c6a('0xd')][_0x2c6a('0xe')]){return git[_0x2c6a('0xf')]()[_0x2c6a('0x10')](function(_0x3bf4d3,_0x5e2ac1){_0x418b14[_0x2c6a('0xe')]=(_0x3bf4d3?module[_0x2c6a('0xc')][_0x2c6a('0x2')]:_0x5e2ac1['latest'])||_0x2c6a('0x11');return _0x5450aa['status'](0xc8)[_0x2c6a('0x12')](_0x418b14);});}else{return _0x5450aa['status'](0xc8)[_0x2c6a('0x12')](_0x418b14);}};exports[_0x2c6a('0xf')]=function(_0x5aad4c,_0x75d4e7){return git[_0x2c6a('0xf')]([_0x2c6a('0x13'),'master'],function(_0x2a842c){if(_0x2a842c){logger['error'](_0x2a842c);return _0x75d4e7[_0x2c6a('0x14')](0x1f4)[_0x2c6a('0x12')](_0x2a842c);}logger[_0x2c6a('0x15')](_0x2c6a('0x16'));return _0x75d4e7[_0x2c6a('0x14')](0xc8)[_0x2c6a('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x2c6a('0x17')]=function(_0x37a349,_0x41f078){return git['reset']([_0x2c6a('0x18'),_0x2c6a('0x19')],function(_0x37b156){if(_0x37b156){logger[_0x2c6a('0x1a')](_0x37b156);return _0x41f078[_0x2c6a('0x14')](0x1f4)[_0x2c6a('0x12')](_0x37b156);}logger[_0x2c6a('0x15')](_0x2c6a('0x1b'));return _0x41f078[_0x2c6a('0x14')](0xc8)[_0x2c6a('0x12')]({'output':_0x2c6a('0x1c')});});};exports[_0x2c6a('0x1d')]=function(_0x3663ee,_0xe6e56e){exec(_0x2c6a('0x1e'),function(_0x2eff97,_0x28e953,_0x3ec2cc){logger['info'](_0x28e953);logger[_0x2c6a('0x15')](_0x3ec2cc);if(_0x2eff97){logger['error'](_0x2eff97);return _0xe6e56e[_0x2c6a('0x14')](0x1f4)['json'](_0x2eff97);}return _0xe6e56e[_0x2c6a('0x14')](0xc8)[_0x2c6a('0x12')]({'output':_0x28e953});});};exports['restart']=function(_0x14da8f,_0x508922){return pm2['restart'](_0x2c6a('0x1f'))[_0x2c6a('0x20')](function(_0x967c95){logger[_0x2c6a('0x15')]('pm2\x20restart\x20motion\x20%s',_0x967c95);return _0x508922['status'](0xc8)['json']({'output':_0x2c6a('0x21')});})[_0x2c6a('0x22')](function(_0x57f41b){logger[_0x2c6a('0x1a')](_0x57f41b);return _0x508922[_0x2c6a('0x14')](0x1f4)[_0x2c6a('0x12')](_0x57f41b);});};exports[_0x2c6a('0x23')]=function(_0x3d4c7c,_0x172e98){var _0x20dddc=fs['readdirSync'](path[_0x2c6a('0x24')](config[_0x2c6a('0xa')],_0x2c6a('0x25'),_0x2c6a('0x23')));var _0x55e82a=[];for(var _0x5c3c6d=0x0;_0x5c3c6d<_0x20dddc[_0x2c6a('0x26')];_0x5c3c6d++){var _0x300c93=_0x20dddc[_0x5c3c6d][_0x2c6a('0x27')](_0x2c6a('0x28'),'');if(compareVersions(module[_0x2c6a('0xc')]['version'],_0x300c93)===-0x1){_0x55e82a[_0x2c6a('0x29')](_0x300c93);}}if(_0x55e82a[_0x2c6a('0x26')]){var _0x3b95bf=_0x55e82a['sort'](compareVersions);var _0x5b4640=new Umzug({'storage':_0x2c6a('0x2a'),'storageOptions':{'model':db[_0x2c6a('0x2b')],'modelName':_0x2c6a('0x2b'),'columnName':_0x2c6a('0x2')},'migrations':{'params':[db['sequelize'][_0x2c6a('0x2c')](),db[_0x2c6a('0x2a')][_0x2c6a('0x2d')],function(){throw new Error(_0x2c6a('0x2e'));}],'path':path[_0x2c6a('0x24')](config[_0x2c6a('0xa')],_0x2c6a('0x25'),_0x2c6a('0x23')),'pattern':/\.js$/}});_0x5b4640['up']({'migrations':_[_0x2c6a('0x2f')](_0x3b95bf,function(_0x1934f5){return _0x1934f5+'.js';})})[_0x2c6a('0x20')](function(){return _0x172e98['status'](0xc8)[_0x2c6a('0x12')]({'output':_0x2c6a('0x30')+module[_0x2c6a('0xc')][_0x2c6a('0x2')]+_0x2c6a('0x31')+_[_0x2c6a('0x32')](_0x3b95bf),'migrations':_[_0x2c6a('0x24')](_0x3b95bf)});})['catch'](function(_0x545108){if(_0x545108 instanceof db[_0x2c6a('0x2a')]['UniqueConstraintError']){return _0x172e98[_0x2c6a('0x14')](0xc8)[_0x2c6a('0x12')]({'output':_0x2c6a('0x33')});}else{return _0x172e98[_0x2c6a('0x14')](0x1f4)[_0x2c6a('0x12')](_0x545108);}});}else{return _0x172e98[_0x2c6a('0x14')](0xc8)['json']({'output':_0x2c6a('0x33')});}}; \ No newline at end of file +var _0x46fa=['motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','join','root','server','migrations','length','replace','.js','sort','sequelize','Migration','getQueryInterface','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','exports','version','query','latest','fetch','tags','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart'];(function(_0x347d05,_0x250cbc){var _0xbfb33e=function(_0x30f03d){while(--_0x30f03d){_0x347d05['push'](_0x347d05['shift']());}};_0xbfb33e(++_0x250cbc);}(_0x46fa,0x182));var _0xa46f=function(_0x4288f5,_0x3e9da9){_0x4288f5=_0x4288f5-0x0;var _0x2da1c0=_0x46fa[_0x4288f5];return _0x2da1c0;};'use strict';var Umzug=require(_0xa46f('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xa46f('0x1'));var pkginfo=require(_0xa46f('0x2'))(module,'version');var compareVersions=require(_0xa46f('0x3'));var exec=require(_0xa46f('0x4'))[_0xa46f('0x5')];var db=require(_0xa46f('0x6'))['db'];var config=require(_0xa46f('0x7'));var pm2=require(_0xa46f('0x8'));var logger=require('../../config/logger')(_0xa46f('0x9'));var git=require(_0xa46f('0xa'))(config['root']);exports['index']=function(_0x4e56a7,_0x5f056f){var _0x54f216={'current':module[_0xa46f('0xb')][_0xa46f('0xc')],'phonebar':0x2};if(_0x4e56a7[_0xa46f('0xd')]&&_0x4e56a7[_0xa46f('0xd')][_0xa46f('0xe')]){return git[_0xa46f('0xf')]()[_0xa46f('0x10')](function(_0x19d1b9,_0x38fc86){_0x54f216[_0xa46f('0xe')]=(_0x19d1b9?module['exports'][_0xa46f('0xc')]:_0x38fc86[_0xa46f('0xe')])||'2.0.0';return _0x5f056f['status'](0xc8)[_0xa46f('0x11')](_0x54f216);});}else{return _0x5f056f[_0xa46f('0x12')](0xc8)[_0xa46f('0x11')](_0x54f216);}};exports['fetch']=function(_0xbbf3b2,_0x20ebe6){return git[_0xa46f('0xf')]([_0xa46f('0x13'),_0xa46f('0x14')],function(_0x49dd01){if(_0x49dd01){logger[_0xa46f('0x15')](_0x49dd01);return _0x20ebe6[_0xa46f('0x12')](0x1f4)[_0xa46f('0x11')](_0x49dd01);}logger[_0xa46f('0x16')](_0xa46f('0x17'));return _0x20ebe6[_0xa46f('0x12')](0xc8)[_0xa46f('0x11')]({'output':_0xa46f('0x18')});});};exports[_0xa46f('0x19')]=function(_0x5b08ec,_0x23a473){return git['reset'](['--hard','FETCH_HEAD'],function(_0x395c8c){if(_0x395c8c){logger[_0xa46f('0x15')](_0x395c8c);return _0x23a473[_0xa46f('0x12')](0x1f4)[_0xa46f('0x11')](_0x395c8c);}logger['info'](_0xa46f('0x1a'));return _0x23a473[_0xa46f('0x12')](0xc8)[_0xa46f('0x11')]({'output':_0xa46f('0x1b')});});};exports['pull']=function(_0x50d207,_0x23a741){exec(_0xa46f('0x1c'),function(_0x53e7b0,_0x3f49b9,_0x24c052){logger[_0xa46f('0x16')](_0x3f49b9);logger[_0xa46f('0x16')](_0x24c052);if(_0x53e7b0){logger[_0xa46f('0x15')](_0x53e7b0);return _0x23a741[_0xa46f('0x12')](0x1f4)[_0xa46f('0x11')](_0x53e7b0);}return _0x23a741['status'](0xc8)[_0xa46f('0x11')]({'output':_0x3f49b9});});};exports[_0xa46f('0x1d')]=function(_0x4c3bf2,_0xb6cb01){return pm2[_0xa46f('0x1d')](_0xa46f('0x1e'))[_0xa46f('0x1f')](function(_0x4a8241){logger[_0xa46f('0x16')](_0xa46f('0x20'),_0x4a8241);return _0xb6cb01['status'](0xc8)['json']({'output':_0xa46f('0x21')});})['catch'](function(_0x3813e2){logger[_0xa46f('0x15')](_0x3813e2);return _0xb6cb01[_0xa46f('0x12')](0x1f4)[_0xa46f('0x11')](_0x3813e2);});};exports['migrations']=function(_0x1e0269,_0x1ff119){var _0x5ca202=fs['readdirSync'](path[_0xa46f('0x22')](config[_0xa46f('0x23')],_0xa46f('0x24'),_0xa46f('0x25')));var _0x26b052=[];for(var _0x42e307=0x0;_0x42e307<_0x5ca202[_0xa46f('0x26')];_0x42e307++){var _0x4826c7=_0x5ca202[_0x42e307][_0xa46f('0x27')](_0xa46f('0x28'),'');if(compareVersions(module[_0xa46f('0xb')][_0xa46f('0xc')],_0x4826c7)===-0x1){_0x26b052['push'](_0x4826c7);}}if(_0x26b052[_0xa46f('0x26')]){var _0x529255=_0x26b052[_0xa46f('0x29')](compareVersions);var _0xb1d521=new Umzug({'storage':_0xa46f('0x2a'),'storageOptions':{'model':db[_0xa46f('0x2b')],'modelName':_0xa46f('0x2b'),'columnName':_0xa46f('0xc')},'migrations':{'params':[db[_0xa46f('0x2a')][_0xa46f('0x2c')](),db[_0xa46f('0x2a')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xa46f('0x22')](config[_0xa46f('0x23')],_0xa46f('0x24'),_0xa46f('0x25')),'pattern':/\.js$/}});_0xb1d521['up']({'migrations':_[_0xa46f('0x2d')](_0x529255,function(_0x4db2cf){return _0x4db2cf+_0xa46f('0x28');})})[_0xa46f('0x1f')](function(){return _0x1ff119[_0xa46f('0x12')](0xc8)[_0xa46f('0x11')]({'output':_0xa46f('0x2e')+module[_0xa46f('0xb')][_0xa46f('0xc')]+_0xa46f('0x2f')+_[_0xa46f('0x30')](_0x529255),'migrations':_[_0xa46f('0x22')](_0x529255)});})[_0xa46f('0x31')](function(_0x44c6f1){if(_0x44c6f1 instanceof db[_0xa46f('0x2a')][_0xa46f('0x32')]){return _0x1ff119['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x1ff119[_0xa46f('0x12')](0x1f4)[_0xa46f('0x11')](_0x44c6f1);}});}else{return _0x1ff119[_0xa46f('0x12')](0xc8)[_0xa46f('0x11')]({'output':_0xa46f('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 6418db9..7927d13 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 _0x0a08=['connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x3f5bf5,_0x498786){var _0x59e229=function(_0x57aac2){while(--_0x57aac2){_0x3f5bf5['push'](_0x3f5bf5['shift']());}};_0x59e229(++_0x498786);}(_0x0a08,0x1df));var _0x80a0=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x0a08[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x80a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x80a0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x80a0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x80a0('0x3'));var controller=require('./voiceAgentReport.controller');router[_0x80a0('0x4')]('/',auth[_0x80a0('0x5')](),controller[_0x80a0('0x6')]);router[_0x80a0('0x4')]('/describe',auth[_0x80a0('0x5')](),controller['describe']);router[_0x80a0('0x4')]('/:id',auth[_0x80a0('0x5')](),controller[_0x80a0('0x7')]);router[_0x80a0('0x8')]('/',auth['isAuthenticated'](),controller[_0x80a0('0x9')]);router[_0x80a0('0xa')](_0x80a0('0xb'),auth[_0x80a0('0x5')](),controller[_0x80a0('0xc')]);router['delete'](_0x80a0('0xb'),auth[_0x80a0('0x5')](),controller[_0x80a0('0xd')]);module[_0x80a0('0xe')]=router; \ No newline at end of file +var _0xce68=['get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x4b836a,_0x12298e){var _0x24bfcd=function(_0x502d33){while(--_0x502d33){_0x4b836a['push'](_0x4b836a['shift']());}};_0x24bfcd(++_0x12298e);}(_0xce68,0x1ea));var _0x8ce6=function(_0x2725d5,_0x4ab4ff){_0x2725d5=_0x2725d5-0x0;var _0xac4edb=_0xce68[_0x2725d5];return _0xac4edb;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require(_0x8ce6('0x1'));var path=require(_0x8ce6('0x2'));var timeout=require(_0x8ce6('0x3'));var express=require(_0x8ce6('0x4'));var router=express['Router']();var fs_extra=require(_0x8ce6('0x5'));var auth=require(_0x8ce6('0x6'));var interaction=require(_0x8ce6('0x7'));var config=require(_0x8ce6('0x8'));var controller=require(_0x8ce6('0x9'));router[_0x8ce6('0xa')]('/',auth[_0x8ce6('0xb')](),controller[_0x8ce6('0xc')]);router[_0x8ce6('0xa')]('/describe',auth[_0x8ce6('0xb')](),controller['describe']);router[_0x8ce6('0xa')](_0x8ce6('0xd'),auth[_0x8ce6('0xb')](),controller['show']);router[_0x8ce6('0xe')]('/',auth['isAuthenticated'](),controller[_0x8ce6('0xf')]);router[_0x8ce6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8ce6('0x11')]);router[_0x8ce6('0x12')](_0x8ce6('0xd'),auth[_0x8ce6('0xb')](),controller['destroy']);module[_0x8ce6('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a340d23..9cf1b5f 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 _0xb4f4=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xb4f4,0xda));var _0x4b4f=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xb4f4[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require(_0x4b4f('0x0'));module[_0x4b4f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4b4f('0x2')]},'calleridnum':{'type':Sequelize[_0x4b4f('0x2')]},'calleridname':{'type':Sequelize[_0x4b4f('0x2')]},'queue':{'type':Sequelize[_0x4b4f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4b4f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4b4f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4b4f('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4b4f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4b4f('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4b4f('0x3')]},'holdtime':{'type':Sequelize[_0x4b4f('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4b4f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4b4f('0x4')]},'agentacw':{'type':Sequelize[_0x4b4f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4b4f('0x4')]},'reason':{'type':Sequelize[_0x4b4f('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4b4f('0x2')]},'channelstate':{'type':Sequelize[_0x4b4f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4b4f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4b4f('0x2')]},'language':{'type':Sequelize[_0x4b4f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4b4f('0x2')]},'exten':{'type':Sequelize[_0x4b4f('0x2')]},'priority':{'type':Sequelize[_0x4b4f('0x2')]},'destchannel':{'type':Sequelize[_0x4b4f('0x2')]},'destchannelstate':{'type':Sequelize[_0x4b4f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4b4f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4b4f('0x2')]},'destcalleridname':{'type':Sequelize[_0x4b4f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4b4f('0x2')]},'destaccountcode':{'type':Sequelize[_0x4b4f('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4b4f('0x2')]},'destpriority':{'type':Sequelize[_0x4b4f('0x2')]},'destuniqueid':{'type':Sequelize[_0x4b4f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x4b4f('0x2')]},'transfer':{'type':Sequelize[_0x4b4f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4b4f('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4b4f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4b4f('0x2')]},'agententerreason':{'type':Sequelize[_0x4b4f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa30a=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'type':{'type':Sequelize[_0xaa30('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa30('0x2')]},'calleridname':{'type':Sequelize[_0xaa30('0x2')]},'queue':{'type':Sequelize[_0xaa30('0x2')]},'interface':{'type':Sequelize[_0xaa30('0x2')]},'membername':{'type':Sequelize[_0xaa30('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaa30('0x3')]},'agentconnectAt':{'type':Sequelize[_0xaa30('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xaa30('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xaa30('0x4')]},'agentcomplete':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaa30('0x4')]},'agentacw':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaa30('0x4')]},'reason':{'type':Sequelize[_0xaa30('0x2')]},'lastevent':{'type':Sequelize[_0xaa30('0x2')]},'channel':{'type':Sequelize[_0xaa30('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaa30('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaa30('0x2')]},'accountcode':{'type':Sequelize[_0xaa30('0x2')]},'context':{'type':Sequelize[_0xaa30('0x2')]},'exten':{'type':Sequelize[_0xaa30('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xaa30('0x2')]},'destchannelstate':{'type':Sequelize[_0xaa30('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xaa30('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaa30('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa30('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa30('0x2')]},'destlanguage':{'type':Sequelize[_0xaa30('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa30('0x2')]},'destcontext':{'type':Sequelize[_0xaa30('0x2')]},'destexten':{'type':Sequelize[_0xaa30('0x2')]},'destpriority':{'type':Sequelize[_0xaa30('0x2')]},'destuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xaa30('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'agententerreason':{'type':Sequelize[_0xaa30('0x4')],'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 17c7b33..3194749 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +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(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 9fa517c..3c1a91a 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 _0x4074=['uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x4074,0xf0));var _0x4407=function(_0x557656,_0x475f35){_0x557656=_0x557656-0x0;var _0x5556db=_0x4074[_0x557656];return _0x5556db;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x4407('0xc'),_0x4407('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7118=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1b1ce5,_0x508743){var _0x432ff6=function(_0x28fd31){while(--_0x28fd31){_0x1b1ce5['push'](_0x1b1ce5['shift']());}};_0x432ff6(++_0x508743);}(_0x7118,0x159));var _0x8711=function(_0x3fdd56,_0x411f03){_0x3fdd56=_0x3fdd56-0x0;var _0xee31f5=_0x7118[_0x3fdd56];return _0xee31f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fs=require('fs');var path=require(_0x8711('0x4'));var rimraf=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var attributes=require(_0x8711('0x7'));module[_0x8711('0x8')]=function(_0x54885e,_0x385033){return _0x54885e[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8711('0xc'),_0x8711('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index d6f110d..d9573de 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 _0x51f4=['body','options','raw','debug','where','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','catch','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0xb8ee63,_0x30d6c2){var _0x42529c=function(_0x513f2a){while(--_0x513f2a){_0xb8ee63['push'](_0xb8ee63['shift']());}};_0x42529c(++_0x30d6c2);}(_0x51f4,0xd3));var _0x451f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51f4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x451f('0x0'));var util=require(_0x451f('0x1'));var moment=require(_0x451f('0x2'));var BPromise=require(_0x451f('0x3'));var rs=require(_0x451f('0x4'));var fs=require('fs');var Redis=require(_0x451f('0x5'));var db=require(_0x451f('0x6'))['db'];var utils=require(_0x451f('0x7'));var logger=require(_0x451f('0x8'))('rpc');var config=require(_0x451f('0x9'));var jayson=require(_0x451f('0xa'));var client=jayson[_0x451f('0xb')][_0x451f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d21ac,_0x1931b8,_0x579d0c){return new BPromise(function(_0x14fdcd,_0x8bee38){return client[_0x451f('0xd')](_0x1d21ac,_0x579d0c)[_0x451f('0xe')](function(_0x5ef23f){logger[_0x451f('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x1931b8,_0x451f('0x10'));logger['debug'](_0x451f('0x11'),_0x1931b8,_0x451f('0x10'),JSON[_0x451f('0x12')](_0x5ef23f));if(_0x5ef23f[_0x451f('0x13')]){if(_0x5ef23f[_0x451f('0x13')][_0x451f('0x14')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x1931b8,_0x5ef23f[_0x451f('0x13')]['message']);return _0x8bee38(_0x5ef23f[_0x451f('0x13')][_0x451f('0x15')]);}logger[_0x451f('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1931b8,_0x5ef23f[_0x451f('0x13')][_0x451f('0x15')]);return _0x14fdcd(_0x5ef23f['error']['message']);}else{logger[_0x451f('0xf')](_0x451f('0x16'),_0x1931b8,_0x451f('0x10'));_0x14fdcd(_0x5ef23f['result'][_0x451f('0x15')]);}})[_0x451f('0x17')](function(_0x1dc30f){logger[_0x451f('0x13')](_0x451f('0x16'),_0x1931b8,_0x1dc30f);_0x8bee38(_0x1dc30f);});});}exports[_0x451f('0x18')]=function(_0x237589){var _0x24d370=this;return new Promise(function(_0x2b1f05,_0x4887e3){return db[_0x451f('0x19')][_0x451f('0x1a')](_0x237589[_0x451f('0x1b')],{'raw':_0x237589['options']?_0x237589[_0x451f('0x1c')][_0x451f('0x1d')]===undefined?!![]:![]:!![]})[_0x451f('0xe')](function(_0x295e6a){logger[_0x451f('0xf')](_0x451f('0x18'),_0x237589);logger[_0x451f('0x1e')]('CreateVoiceAgentReport',_0x237589,JSON[_0x451f('0x12')](_0x295e6a));_0x2b1f05(_0x295e6a);})[_0x451f('0x17')](function(_0x53c90b){logger['error'](_0x451f('0x18'),_0x53c90b[_0x451f('0x15')],_0x237589);_0x4887e3(_0x24d370[_0x451f('0x13')](0x1f4,_0x53c90b['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x76762b){var _0x335df8=this;return new Promise(function(_0x84775f,_0x17e59f){return db[_0x451f('0x19')]['update'](_0x76762b[_0x451f('0x1b')],{'raw':_0x76762b[_0x451f('0x1c')]?_0x76762b[_0x451f('0x1c')][_0x451f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x76762b['options']?_0x76762b[_0x451f('0x1c')][_0x451f('0x1f')]||null:null,'attributes':_0x76762b[_0x451f('0x1c')]?_0x76762b['options']['attributes']||null:null,'limit':_0x76762b[_0x451f('0x1c')]?_0x76762b['options'][_0x451f('0x20')]||null:null})[_0x451f('0xe')](function(_0x353672){logger['info'](_0x451f('0x21'),_0x76762b);logger[_0x451f('0x1e')](_0x451f('0x21'),_0x76762b,JSON[_0x451f('0x12')](_0x353672));_0x84775f(_0x353672);})[_0x451f('0x17')](function(_0x49e958){logger['error'](_0x451f('0x21'),_0x49e958[_0x451f('0x15')],_0x76762b);_0x17e59f(_0x335df8[_0x451f('0x13')](0x1f4,_0x49e958['message']));});});}; \ No newline at end of file +var _0x5a44=['body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','limit','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport','create'];(function(_0x26c974,_0x50a4b9){var _0x1a6fd5=function(_0x40eb90){while(--_0x40eb90){_0x26c974['push'](_0x26c974['shift']());}};_0x1a6fd5(++_0x50a4b9);}(_0x5a44,0x1e8));var _0x45a4=function(_0x1491a8,_0xa3e0d2){_0x1491a8=_0x1491a8-0x0;var _0xab8ad1=_0x5a44[_0x1491a8];return _0xab8ad1;};'use strict';var _=require(_0x45a4('0x0'));var util=require(_0x45a4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x45a4('0x2'));var fs=require('fs');var Redis=require(_0x45a4('0x3'));var db=require(_0x45a4('0x4'))['db'];var utils=require(_0x45a4('0x5'));var logger=require('../../config/logger')(_0x45a4('0x6'));var config=require(_0x45a4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x45a4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1140bf,_0x3a7a5d,_0x4f2ecf){return new BPromise(function(_0x252b9b,_0x31297b){return client[_0x45a4('0x9')](_0x1140bf,_0x4f2ecf)[_0x45a4('0xa')](function(_0x7c766a){logger[_0x45a4('0xb')](_0x45a4('0xc'),_0x3a7a5d,_0x45a4('0xd'));logger[_0x45a4('0xe')](_0x45a4('0xf'),_0x3a7a5d,_0x45a4('0xd'),JSON[_0x45a4('0x10')](_0x7c766a));if(_0x7c766a[_0x45a4('0x11')]){if(_0x7c766a[_0x45a4('0x11')][_0x45a4('0x12')]===0x1f4){logger['error'](_0x45a4('0xc'),_0x3a7a5d,_0x7c766a[_0x45a4('0x11')][_0x45a4('0x13')]);return _0x31297b(_0x7c766a[_0x45a4('0x11')][_0x45a4('0x13')]);}logger[_0x45a4('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3a7a5d,_0x7c766a[_0x45a4('0x11')]['message']);return _0x252b9b(_0x7c766a[_0x45a4('0x11')][_0x45a4('0x13')]);}else{logger[_0x45a4('0xb')](_0x45a4('0xc'),_0x3a7a5d,_0x45a4('0xd'));_0x252b9b(_0x7c766a['result']['message']);}})['catch'](function(_0x156581){logger[_0x45a4('0x11')](_0x45a4('0xc'),_0x3a7a5d,_0x156581);_0x31297b(_0x156581);});});}exports['CreateVoiceAgentReport']=function(_0x2811f6){var _0x4f5c96=this;return new Promise(function(_0x2f6035,_0x84881a){return db[_0x45a4('0x14')][_0x45a4('0x15')](_0x2811f6[_0x45a4('0x16')],{'raw':_0x2811f6[_0x45a4('0x17')]?_0x2811f6['options'][_0x45a4('0x18')]===undefined?!![]:![]:!![]})[_0x45a4('0xa')](function(_0x3c702f){logger[_0x45a4('0xb')](_0x45a4('0x19'),_0x2811f6);logger['debug'](_0x45a4('0x19'),_0x2811f6,JSON[_0x45a4('0x10')](_0x3c702f));_0x2f6035(_0x3c702f);})['catch'](function(_0x26e4e1){logger[_0x45a4('0x11')](_0x45a4('0x19'),_0x26e4e1['message'],_0x2811f6);_0x84881a(_0x4f5c96[_0x45a4('0x11')](0x1f4,_0x26e4e1[_0x45a4('0x13')]));});});};exports[_0x45a4('0x1a')]=function(_0xc2c1c){var _0x3dd9b4=this;return new Promise(function(_0x5d7c67,_0x172b99){return db[_0x45a4('0x14')][_0x45a4('0x1b')](_0xc2c1c[_0x45a4('0x16')],{'raw':_0xc2c1c[_0x45a4('0x17')]?_0xc2c1c[_0x45a4('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc2c1c[_0x45a4('0x17')]?_0xc2c1c[_0x45a4('0x17')]['where']||null:null,'attributes':_0xc2c1c[_0x45a4('0x17')]?_0xc2c1c[_0x45a4('0x17')]['attributes']||null:null,'limit':_0xc2c1c[_0x45a4('0x17')]?_0xc2c1c[_0x45a4('0x17')][_0x45a4('0x1c')]||null:null})[_0x45a4('0xa')](function(_0x382f37){logger[_0x45a4('0xb')](_0x45a4('0x1a'),_0xc2c1c);logger[_0x45a4('0xe')]('UpdateVoiceAgentReport',_0xc2c1c,JSON[_0x45a4('0x10')](_0x382f37));_0x5d7c67(_0x382f37);})[_0x45a4('0x1d')](function(_0x49ed33){logger[_0x45a4('0x11')](_0x45a4('0x1a'),_0x49ed33[_0x45a4('0x13')],_0xc2c1c);_0x172b99(_0x3dd9b4[_0x45a4('0x11')](0x1f4,_0x49ed33[_0x45a4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d630723..9324ee4 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 _0x826a=['post','create','put','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x524dcc,_0x3f38f7){var _0x598c3e=function(_0x6b8318){while(--_0x6b8318){_0x524dcc['push'](_0x524dcc['shift']());}};_0x598c3e(++_0x3f38f7);}(_0x826a,0x1aa));var _0xa826=function(_0x2f57b9,_0x2eeb27){_0x2f57b9=_0x2f57b9-0x0;var _0x442bca=_0x826a[_0x2f57b9];return _0x442bca;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0xe')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router[_0xa826('0x10')]('/:id',auth[_0xa826('0x8')](),controller['update']);router[_0xa826('0x11')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x12')]);module[_0xa826('0x13')]=router; \ No newline at end of file +var _0x29d4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','exports','multer','path','connect-timeout'];(function(_0x345377,_0x5332cd){var _0x2f054a=function(_0x3284c8){while(--_0x3284c8){_0x345377['push'](_0x345377['shift']());}};_0x2f054a(++_0x5332cd);}(_0x29d4,0x1a1));var _0x429d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x29d4[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),auth['isAuthenticated'](),controller[_0x429d('0xd')]);router['get'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0xf')]);router['post']('/',auth[_0x429d('0xa')](),controller[_0x429d('0x10')]);router['put'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x11')]);router['delete'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x12')]);module[_0x429d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b0ed8e3..acca2e3 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 _0x7eee=['DATE','INTEGER','sequelize','exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT'];(function(_0x328385,_0x4a07b9){var _0x90747b=function(_0x399c35){while(--_0x399c35){_0x328385['push'](_0x328385['shift']());}};_0x90747b(++_0x4a07b9);}(_0x7eee,0x14c));var _0xe7ee=function(_0x3828f6,_0x3904ad){_0x3828f6=_0x3828f6-0x0;var _0x4877b0=_0x7eee[_0x3828f6];return _0x4877b0;};'use strict';var Sequelize=require(_0xe7ee('0x0'));module[_0xe7ee('0x1')]={'uniqueid':{'type':Sequelize[_0xe7ee('0x2')]},'type':{'type':Sequelize['ENUM'](_0xe7ee('0x3'),_0xe7ee('0x4'),_0xe7ee('0x5'),_0xe7ee('0x6'),_0xe7ee('0x7'),'dialer')},'tag':{'type':Sequelize[_0xe7ee('0x2')]},'accountcode':{'type':Sequelize[_0xe7ee('0x2')]},'source':{'type':Sequelize[_0xe7ee('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xe7ee('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xe7ee('0x2')]},'lastapplication':{'type':Sequelize[_0xe7ee('0x2')]},'lastdata':{'type':Sequelize[_0xe7ee('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xe7ee('0x9')]},'answertime':{'type':Sequelize[_0xe7ee('0x9')]},'endtime':{'type':Sequelize[_0xe7ee('0x9')]},'duration':{'type':Sequelize[_0xe7ee('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xe7ee('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xe7ee('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe7ee('0x2')]},'routeid':{'type':Sequelize[_0xe7ee('0xa')]},'sipcallid':{'type':Sequelize[_0xe7ee('0x2')]}}; \ No newline at end of file +var _0x6222=['exports','STRING','inbound','inbound-fax','TEXT','DATE','INTEGER'];(function(_0x385e92,_0xb98f63){var _0x13f730=function(_0x898ed0){while(--_0x898ed0){_0x385e92['push'](_0x385e92['shift']());}};_0x13f730(++_0xb98f63);}(_0x6222,0x9a));var _0x2622=function(_0x2f6973,_0x535c1f){_0x2f6973=_0x2f6973-0x0;var _0x2c0290=_0x6222[_0x2f6973];return _0x2c0290;};'use strict';var Sequelize=require('sequelize');module[_0x2622('0x0')]={'uniqueid':{'type':Sequelize[_0x2622('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2622('0x2'),'internal','outbound',_0x2622('0x3'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x2622('0x1')]},'accountcode':{'type':Sequelize[_0x2622('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x2622('0x1')]},'destinationcontext':{'type':Sequelize[_0x2622('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2622('0x1')]},'destinationchannel':{'type':Sequelize[_0x2622('0x1')]},'lastapplication':{'type':Sequelize[_0x2622('0x1')]},'lastdata':{'type':Sequelize[_0x2622('0x4')]},'starttime':{'type':Sequelize[_0x2622('0x5')]},'systemanswertime':{'type':Sequelize[_0x2622('0x5')]},'answertime':{'type':Sequelize[_0x2622('0x5')]},'endtime':{'type':Sequelize[_0x2622('0x5')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x2622('0x6')]},'mohtime':{'type':Sequelize[_0x2622('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2622('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2622('0x1')]},'userDisposition':{'type':Sequelize[_0x2622('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x2622('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x2622('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x2622('0x1')]},'routeid':{'type':Sequelize[_0x2622('0x6')]},'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 b9a9255..3b8f965 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x2128ab,_0x28b454){var _0xa271ab=function(_0x120f31){while(--_0x120f31){_0x2128ab['push'](_0x2128ab['shift']());}};_0xa271ab(++_0x28b454);}(_0xdb28,0x106));var _0x8db2=function(_0x38b686,_0x3a2bba){_0x38b686=_0x38b686-0x0;var _0x25a408=_0xdb28[_0x38b686];return _0x25a408;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x2ef3,0xba));var _0x32ef=function(_0x1b9e47,_0x1edc31){_0x1b9e47=_0x1b9e47-0x0;var _0xf228ee=_0x2ef3[_0x1b9e47];return _0xf228ee;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3d58e19..258080b 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 _0xec87=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','report_call'];(function(_0x1c4120,_0x313136){var _0x14c182=function(_0x3dcf34){while(--_0x3dcf34){_0x1c4120['push'](_0x1c4120['shift']());}};_0x14c182(++_0x313136);}(_0xec87,0xd9));var _0x7ec8=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xec87[_0x2f48cd];return _0x193ae2;};'use strict';var _=require(_0x7ec8('0x0'));var util=require(_0x7ec8('0x1'));var logger=require(_0x7ec8('0x2'))(_0x7ec8('0x3'));var moment=require(_0x7ec8('0x4'));var BPromise=require(_0x7ec8('0x5'));var rp=require(_0x7ec8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ec8('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x7ec8('0x8')]=function(_0x3fb762,_0x1bc494){return _0x3fb762[_0x7ec8('0x9')]('VoiceCallReport',attributes,{'tableName':_0x7ec8('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7ec8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe65c=['moment','request-promise','rimraf','../../config/environment','exports','define','VoiceCallReport','lodash','util','../../config/logger','api'];(function(_0x3b2ba0,_0x239053){var _0x282218=function(_0x45129f){while(--_0x45129f){_0x3b2ba0['push'](_0x3b2ba0['shift']());}};_0x282218(++_0x239053);}(_0xe65c,0x19e));var _0xce65=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0xe65c[_0xf738ad];return _0x598570;};'use strict';var _=require(_0xce65('0x0'));var util=require(_0xce65('0x1'));var logger=require(_0xce65('0x2'))(_0xce65('0x3'));var moment=require(_0xce65('0x4'));var BPromise=require('bluebird');var rp=require(_0xce65('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce65('0x6'));var config=require(_0xce65('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0xce65('0x8')]=function(_0x330dcc,_0xa52a98){return _0x330dcc[_0xce65('0x9')](_0xce65('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index e55eebf..9c0e085 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 _0xea17=['update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','raw','options','where','attributes','limit','include','map','model','catch','body','CreateVoiceCallReport','UpdateVoiceCallReport'];(function(_0x41c29f,_0x56a6d6){var _0xd5790e=function(_0x3784f3){while(--_0x3784f3){_0x41c29f['push'](_0x41c29f['shift']());}};_0xd5790e(++_0x56a6d6);}(_0xea17,0xbf));var _0x7ea1=function(_0x2b5813,_0x1169be){_0x2b5813=_0x2b5813-0x0;var _0x140a1b=_0xea17[_0x2b5813];return _0x140a1b;};'use strict';var _=require(_0x7ea1('0x0'));var util=require(_0x7ea1('0x1'));var moment=require(_0x7ea1('0x2'));var BPromise=require(_0x7ea1('0x3'));var rs=require(_0x7ea1('0x4'));var fs=require('fs');var Redis=require(_0x7ea1('0x5'));var db=require(_0x7ea1('0x6'))['db'];var utils=require(_0x7ea1('0x7'));var logger=require(_0x7ea1('0x8'))('rpc');var config=require(_0x7ea1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ea1('0xa')][_0x7ea1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f6a29,_0x476e6b,_0x2648f8){return new BPromise(function(_0x5e07dc,_0x184efd){return client['request'](_0x4f6a29,_0x2648f8)[_0x7ea1('0xc')](function(_0x1b34a4){logger[_0x7ea1('0xd')](_0x7ea1('0xe'),_0x476e6b,'request\x20sent');logger[_0x7ea1('0xf')](_0x7ea1('0x10'),_0x476e6b,_0x7ea1('0x11'),JSON[_0x7ea1('0x12')](_0x1b34a4));if(_0x1b34a4[_0x7ea1('0x13')]){if(_0x1b34a4[_0x7ea1('0x13')][_0x7ea1('0x14')]===0x1f4){logger[_0x7ea1('0x13')](_0x7ea1('0xe'),_0x476e6b,_0x1b34a4['error'][_0x7ea1('0x15')]);return _0x184efd(_0x1b34a4[_0x7ea1('0x13')][_0x7ea1('0x15')]);}logger[_0x7ea1('0x13')](_0x7ea1('0xe'),_0x476e6b,_0x1b34a4[_0x7ea1('0x13')][_0x7ea1('0x15')]);return _0x5e07dc(_0x1b34a4[_0x7ea1('0x13')][_0x7ea1('0x15')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x476e6b,_0x7ea1('0x11'));_0x5e07dc(_0x1b34a4[_0x7ea1('0x16')][_0x7ea1('0x15')]);}})['catch'](function(_0x18f16f){logger[_0x7ea1('0x13')](_0x7ea1('0xe'),_0x476e6b,_0x18f16f);_0x184efd(_0x18f16f);});});}exports[_0x7ea1('0x17')]=function(_0x6fcbd9){var _0x45a89c=this;return new Promise(function(_0x431708,_0x5ea7a1){return db[_0x7ea1('0x18')]['findAll']({'raw':_0x6fcbd9['options']?_0x6fcbd9['options'][_0x7ea1('0x19')]===undefined?!![]:![]:!![],'where':_0x6fcbd9['options']?_0x6fcbd9[_0x7ea1('0x1a')][_0x7ea1('0x1b')]||null:null,'attributes':_0x6fcbd9[_0x7ea1('0x1a')]?_0x6fcbd9['options'][_0x7ea1('0x1c')]||null:null,'limit':_0x6fcbd9[_0x7ea1('0x1a')]?_0x6fcbd9[_0x7ea1('0x1a')][_0x7ea1('0x1d')]||null:null,'include':_0x6fcbd9[_0x7ea1('0x1a')]?_0x6fcbd9['options'][_0x7ea1('0x1e')]?_[_0x7ea1('0x1f')](_0x6fcbd9[_0x7ea1('0x1a')][_0x7ea1('0x1e')],function(_0x3bc8fb){return{'model':db[_0x3bc8fb[_0x7ea1('0x20')]],'as':_0x3bc8fb['as'],'attributes':_0x3bc8fb['attributes'],'include':_0x3bc8fb['include']?_[_0x7ea1('0x1f')](_0x3bc8fb[_0x7ea1('0x1e')],function(_0x5b60ec){return{'model':db[_0x5b60ec[_0x7ea1('0x20')]],'as':_0x5b60ec['as'],'attributes':_0x5b60ec[_0x7ea1('0x1c')],'include':_0x5b60ec[_0x7ea1('0x1e')]?_[_0x7ea1('0x1f')](_0x5b60ec['include'],function(_0x2936ef){return{'model':db[_0x2936ef[_0x7ea1('0x20')]],'as':_0x2936ef['as'],'attributes':_0x2936ef[_0x7ea1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bced4){logger[_0x7ea1('0xd')](_0x7ea1('0x17'),_0x6fcbd9);logger[_0x7ea1('0xf')]('GetVoiceCallReport',_0x6fcbd9,JSON[_0x7ea1('0x12')](_0x3bced4));_0x431708(_0x3bced4);})[_0x7ea1('0x21')](function(_0x1e81de){logger[_0x7ea1('0x13')](_0x7ea1('0x17'),_0x1e81de['message'],_0x6fcbd9);_0x5ea7a1(_0x45a89c['error'](0x1f4,_0x1e81de[_0x7ea1('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x5491ea){var _0x2182b8=this;return new Promise(function(_0x5b363e,_0x2ce940){return db['VoiceCallReport']['create'](_0x5491ea[_0x7ea1('0x22')],{'raw':_0x5491ea[_0x7ea1('0x1a')]?_0x5491ea[_0x7ea1('0x1a')][_0x7ea1('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x438810){logger[_0x7ea1('0xd')](_0x7ea1('0x23'),_0x5491ea);logger['debug'](_0x7ea1('0x23'),_0x5491ea,JSON['stringify'](_0x438810));_0x5b363e(_0x438810);})[_0x7ea1('0x21')](function(_0xd5c1c2){logger['error'](_0x7ea1('0x23'),_0xd5c1c2[_0x7ea1('0x15')],_0x5491ea);_0x2ce940(_0x2182b8[_0x7ea1('0x13')](0x1f4,_0xd5c1c2[_0x7ea1('0x15')]));});});};exports[_0x7ea1('0x24')]=function(_0x14ef02){var _0xd343f2=this;return new Promise(function(_0x40c1ff,_0xd4aa9e){return db['VoiceCallReport'][_0x7ea1('0x25')](_0x14ef02[_0x7ea1('0x22')],{'raw':_0x14ef02['options']?_0x14ef02['options'][_0x7ea1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14ef02[_0x7ea1('0x1a')]?_0x14ef02['options'][_0x7ea1('0x1b')]||null:null,'attributes':_0x14ef02[_0x7ea1('0x1a')]?_0x14ef02[_0x7ea1('0x1a')][_0x7ea1('0x1c')]||null:null,'limit':_0x14ef02[_0x7ea1('0x1a')]?_0x14ef02[_0x7ea1('0x1a')]['limit']||null:null})[_0x7ea1('0xc')](function(_0x442951){logger[_0x7ea1('0xd')](_0x7ea1('0x24'),_0x14ef02);logger['debug'](_0x7ea1('0x24'),_0x14ef02,JSON['stringify'](_0x442951));_0x40c1ff(_0x442951);})[_0x7ea1('0x21')](function(_0x4623ec){logger[_0x7ea1('0x13')]('UpdateVoiceCallReport',_0x4623ec[_0x7ea1('0x15')],_0x14ef02);_0xd4aa9e(_0xd343f2['error'](0x1f4,_0x4623ec['message']));});});}; \ No newline at end of file +var _0x338a=['util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','include','map','model','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash'];(function(_0x2d93ec,_0x3f091f){var _0x49fbfd=function(_0x45ae76){while(--_0x45ae76){_0x2d93ec['push'](_0x2d93ec['shift']());}};_0x49fbfd(++_0x3f091f);}(_0x338a,0xf4));var _0xa338=function(_0x1b04dd,_0x394bec){_0x1b04dd=_0x1b04dd-0x0;var _0x191c99=_0x338a[_0x1b04dd];return _0x191c99;};'use strict';var _=require(_0xa338('0x0'));var util=require(_0xa338('0x1'));var moment=require('moment');var BPromise=require(_0xa338('0x2'));var rs=require(_0xa338('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa338('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa338('0x5'))(_0xa338('0x6'));var config=require('../../config/environment');var jayson=require(_0xa338('0x7'));var client=jayson[_0xa338('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d0bf1,_0x5f517b,_0xc2a2ee){return new BPromise(function(_0x463060,_0x3fbc36){return client[_0xa338('0x9')](_0x5d0bf1,_0xc2a2ee)[_0xa338('0xa')](function(_0x4a8d1b){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5f517b,_0xa338('0xb'));logger[_0xa338('0xc')](_0xa338('0xd'),_0x5f517b,_0xa338('0xb'),JSON[_0xa338('0xe')](_0x4a8d1b));if(_0x4a8d1b['error']){if(_0x4a8d1b[_0xa338('0xf')][_0xa338('0x10')]===0x1f4){logger[_0xa338('0xf')](_0xa338('0x11'),_0x5f517b,_0x4a8d1b[_0xa338('0xf')][_0xa338('0x12')]);return _0x3fbc36(_0x4a8d1b['error'][_0xa338('0x12')]);}logger[_0xa338('0xf')](_0xa338('0x11'),_0x5f517b,_0x4a8d1b[_0xa338('0xf')]['message']);return _0x463060(_0x4a8d1b[_0xa338('0xf')][_0xa338('0x12')]);}else{logger[_0xa338('0x13')](_0xa338('0x11'),_0x5f517b,_0xa338('0xb'));_0x463060(_0x4a8d1b[_0xa338('0x14')]['message']);}})[_0xa338('0x15')](function(_0x2a5f8a){logger['error'](_0xa338('0x11'),_0x5f517b,_0x2a5f8a);_0x3fbc36(_0x2a5f8a);});});}exports[_0xa338('0x16')]=function(_0x2baa7b){var _0xfc6896=this;return new Promise(function(_0x3574d2,_0x762a17){return db[_0xa338('0x17')]['findAll']({'raw':_0x2baa7b[_0xa338('0x18')]?_0x2baa7b[_0xa338('0x18')][_0xa338('0x19')]===undefined?!![]:![]:!![],'where':_0x2baa7b[_0xa338('0x18')]?_0x2baa7b[_0xa338('0x18')][_0xa338('0x1a')]||null:null,'attributes':_0x2baa7b[_0xa338('0x18')]?_0x2baa7b[_0xa338('0x18')][_0xa338('0x1b')]||null:null,'limit':_0x2baa7b[_0xa338('0x18')]?_0x2baa7b[_0xa338('0x18')]['limit']||null:null,'include':_0x2baa7b[_0xa338('0x18')]?_0x2baa7b[_0xa338('0x18')][_0xa338('0x1c')]?_[_0xa338('0x1d')](_0x2baa7b[_0xa338('0x18')][_0xa338('0x1c')],function(_0x45a7bf){return{'model':db[_0x45a7bf['model']],'as':_0x45a7bf['as'],'attributes':_0x45a7bf[_0xa338('0x1b')],'include':_0x45a7bf['include']?_[_0xa338('0x1d')](_0x45a7bf[_0xa338('0x1c')],function(_0x32d37f){return{'model':db[_0x32d37f[_0xa338('0x1e')]],'as':_0x32d37f['as'],'attributes':_0x32d37f[_0xa338('0x1b')],'include':_0x32d37f[_0xa338('0x1c')]?_[_0xa338('0x1d')](_0x32d37f['include'],function(_0x487e1a){return{'model':db[_0x487e1a[_0xa338('0x1e')]],'as':_0x487e1a['as'],'attributes':_0x487e1a[_0xa338('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0e8d){logger[_0xa338('0x13')](_0xa338('0x16'),_0x2baa7b);logger[_0xa338('0xc')](_0xa338('0x16'),_0x2baa7b,JSON['stringify'](_0x2a0e8d));_0x3574d2(_0x2a0e8d);})[_0xa338('0x15')](function(_0x93a191){logger[_0xa338('0xf')](_0xa338('0x16'),_0x93a191[_0xa338('0x12')],_0x2baa7b);_0x762a17(_0xfc6896[_0xa338('0xf')](0x1f4,_0x93a191[_0xa338('0x12')]));});});};exports[_0xa338('0x1f')]=function(_0x2eb2f2){var _0x44f7ea=this;return new Promise(function(_0x166df7,_0x2e755f){return db[_0xa338('0x17')]['create'](_0x2eb2f2['body'],{'raw':_0x2eb2f2[_0xa338('0x18')]?_0x2eb2f2[_0xa338('0x18')][_0xa338('0x19')]===undefined?!![]:![]:!![]})[_0xa338('0xa')](function(_0xf3c2f5){logger[_0xa338('0x13')]('CreateVoiceCallReport',_0x2eb2f2);logger[_0xa338('0xc')]('CreateVoiceCallReport',_0x2eb2f2,JSON['stringify'](_0xf3c2f5));_0x166df7(_0xf3c2f5);})[_0xa338('0x15')](function(_0xb326cc){logger[_0xa338('0xf')](_0xa338('0x1f'),_0xb326cc[_0xa338('0x12')],_0x2eb2f2);_0x2e755f(_0x44f7ea['error'](0x1f4,_0xb326cc['message']));});});};exports[_0xa338('0x20')]=function(_0x49794f){var _0x22b081=this;return new Promise(function(_0xdacddc,_0x4a78b4){return db['VoiceCallReport'][_0xa338('0x21')](_0x49794f['body'],{'raw':_0x49794f['options']?_0x49794f[_0xa338('0x18')][_0xa338('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49794f[_0xa338('0x18')]?_0x49794f['options'][_0xa338('0x1a')]||null:null,'attributes':_0x49794f['options']?_0x49794f[_0xa338('0x18')][_0xa338('0x1b')]||null:null,'limit':_0x49794f[_0xa338('0x18')]?_0x49794f[_0xa338('0x18')][_0xa338('0x22')]||null:null})['then'](function(_0x50c22d){logger[_0xa338('0x13')]('UpdateVoiceCallReport',_0x49794f);logger['debug']('UpdateVoiceCallReport',_0x49794f,JSON[_0xa338('0xe')](_0x50c22d));_0xdacddc(_0x50c22d);})[_0xa338('0x15')](function(_0x51b579){logger['error'](_0xa338('0x20'),_0x51b579[_0xa338('0x12')],_0x49794f);_0x4a78b4(_0x22b081[_0xa338('0xf')](0x1f4,_0x51b579[_0xa338('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f1be959..b145794 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 _0xa94b=['post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4944b6,_0x109073){var _0x2475ac=function(_0x43883d){while(--_0x43883d){_0x4944b6['push'](_0x4944b6['shift']());}};_0x2475ac(++_0x109073);}(_0xa94b,0xc2));var _0xba94=function(_0x50526c,_0x1c5b97){_0x50526c=_0x50526c-0x0;var _0x57ec3f=_0xa94b[_0x50526c];return _0x57ec3f;};'use strict';var multer=require(_0xba94('0x0'));var util=require(_0xba94('0x1'));var path=require(_0xba94('0x2'));var timeout=require(_0xba94('0x3'));var express=require(_0xba94('0x4'));var router=express[_0xba94('0x5')]();var fs_extra=require(_0xba94('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xba94('0x7'));var config=require(_0xba94('0x8'));var controller=require(_0xba94('0x9'));router[_0xba94('0xa')]('/',auth['isAuthenticated'](),controller[_0xba94('0xb')]);router[_0xba94('0xa')](_0xba94('0xc'),auth[_0xba94('0xd')](),controller[_0xba94('0xe')]);router[_0xba94('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xba94('0xc'),auth[_0xba94('0xd')](),controller[_0xba94('0x10')]);router[_0xba94('0x11')](_0xba94('0xc'),auth[_0xba94('0xd')](),controller[_0xba94('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5ea2=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','index','get','/:id','post','put','isAuthenticated','update','delete','destroy'];(function(_0x19c0ab,_0x4070c8){var _0x598fe5=function(_0x6432cd){while(--_0x6432cd){_0x19c0ab['push'](_0x19c0ab['shift']());}};_0x598fe5(++_0x4070c8);}(_0x5ea2,0x166));var _0x25ea=function(_0x4d7b76,_0x36fdbe){_0x4d7b76=_0x4d7b76-0x0;var _0x21ad3d=_0x5ea2[_0x4d7b76];return _0x21ad3d;};'use strict';var multer=require(_0x25ea('0x0'));var util=require(_0x25ea('0x1'));var path=require(_0x25ea('0x2'));var timeout=require(_0x25ea('0x3'));var express=require(_0x25ea('0x4'));var router=express[_0x25ea('0x5')]();var fs_extra=require(_0x25ea('0x6'));var auth=require(_0x25ea('0x7'));var interaction=require(_0x25ea('0x8'));var config=require(_0x25ea('0x9'));var controller=require(_0x25ea('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x25ea('0xb')]);router[_0x25ea('0xc')](_0x25ea('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x25ea('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x25ea('0xf')](_0x25ea('0xd'),auth[_0x25ea('0x10')](),controller[_0x25ea('0x11')]);router[_0x25ea('0x12')](_0x25ea('0xd'),auth[_0x25ea('0x10')](),controller[_0x25ea('0x13')]);module[_0x25ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 0b75378..fec1630 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 _0x27bd=['setDataValue','options','BOOLEAN','sequelize','exports','STRING'];(function(_0x3d8cbb,_0x240fb6){var _0x4d10de=function(_0x58bd12){while(--_0x58bd12){_0x3d8cbb['push'](_0x3d8cbb['shift']());}};_0x4d10de(++_0x240fb6);}(_0x27bd,0xed));var _0xd27b=function(_0x106961,_0x5de5ff){_0x106961=_0x106961-0x0;var _0x4e41b6=_0x27bd[_0x106961];return _0x4e41b6;};'use strict';var Sequelize=require(_0xd27b('0x0'));module[_0xd27b('0x1')]={'name':{'type':Sequelize[_0xd27b('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xd27b('0x2')],'set':function(_0x4e15a8){this[_0xd27b('0x3')](_0xd27b('0x4'),_0x4e15a8?_0x4e15a8['join'](''):[]);},'get':function(){return this['getDataValue'](_0xd27b('0x4'))?this['getDataValue'](_0xd27b('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xd27b('0x2')]},'record':{'type':Sequelize[_0xd27b('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd27b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf194=['sequelize','exports','STRING','options','join','getDataValue','split','BOOLEAN'];(function(_0x327cab,_0x2c14bd){var _0x59e760=function(_0xdace9e){while(--_0xdace9e){_0x327cab['push'](_0x327cab['shift']());}};_0x59e760(++_0x2c14bd);}(_0xf194,0x160));var _0x4f19=function(_0x11ec6a,_0x128f50){_0x11ec6a=_0x11ec6a-0x0;var _0x316f8e=_0xf194[_0x11ec6a];return _0x316f8e;};'use strict';var Sequelize=require(_0x4f19('0x0'));module[_0x4f19('0x1')]={'name':{'type':Sequelize[_0x4f19('0x2')]},'prefix':{'type':Sequelize[_0x4f19('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4f19('0x2')],'set':function(_0x1d7e3f){this['setDataValue'](_0x4f19('0x3'),_0x1d7e3f?_0x1d7e3f[_0x4f19('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x4f19('0x3'))?this[_0x4f19('0x5')](_0x4f19('0x3'))[_0x4f19('0x6')](''):[];}},'auth':{'type':Sequelize[_0x4f19('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x4f19('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4f19('0x2')]},'description':{'type':Sequelize[_0x4f19('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e1fa8c2..c8dbd11 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 _0x7846=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','stack','send','index','map','VoiceChanSpy','rawAttributes','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7846,0xf4));var _0x6784=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x7846[_0xea343d];return _0x2c6e9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6784('0x0'));var zipdir=require(_0x6784('0x1'));var jsonpatch=require(_0x6784('0x2'));var rp=require(_0x6784('0x3'));var moment=require(_0x6784('0x4'));var BPromise=require(_0x6784('0x5'));var Mustache=require('mustache');var util=require(_0x6784('0x6'));var path=require(_0x6784('0x7'));var sox=require(_0x6784('0x8'));var csv=require(_0x6784('0x9'));var ejs=require(_0x6784('0xa'));var fs=require('fs');var fs_extra=require(_0x6784('0xb'));var _=require(_0x6784('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6784('0xd'));var deskjs=require(_0x6784('0xe'));var toCsv=require(_0x6784('0x9'));var querystring=require(_0x6784('0xf'));var Papa=require(_0x6784('0x10'));var Redis=require(_0x6784('0x11'));var authService=require(_0x6784('0x12'));var qs=require(_0x6784('0x13'));var as=require(_0x6784('0x14'));var hardwareService=require(_0x6784('0x15'));var logger=require(_0x6784('0x16'))(_0x6784('0x17'));var utils=require(_0x6784('0x18'));var config=require(_0x6784('0x19'));var licenseUtil=require(_0x6784('0x1a'));var db=require(_0x6784('0x1b'))['db'];function respondWithStatusCode(_0x5a43c1,_0x221cb8){_0x221cb8=_0x221cb8||0xcc;return function(_0x42cd0f){if(_0x42cd0f){return _0x5a43c1[_0x6784('0x1c')](_0x221cb8);}return _0x5a43c1[_0x6784('0x1d')](_0x221cb8)['end']();};}function respondWithResult(_0x18b8a9,_0x681759){_0x681759=_0x681759||0xc8;return function(_0x62426d){if(_0x62426d){return _0x18b8a9[_0x6784('0x1d')](_0x681759)[_0x6784('0x1e')](_0x62426d);}};}function respondWithFilteredResult(_0x18929b,_0x474511){return function(_0x32eaf2){if(_0x32eaf2){var _0x1db6be=typeof _0x474511[_0x6784('0x1f')]===_0x6784('0x20')&&typeof _0x474511['limit']===_0x6784('0x20');var _0x575d8=_0x32eaf2[_0x6784('0x21')];var _0x2fd8a2=_0x1db6be?0x0:_0x474511['offset'];var _0x23f32e=_0x1db6be?_0x32eaf2[_0x6784('0x21')]:_0x474511[_0x6784('0x1f')]+_0x474511[_0x6784('0x22')];var _0x338067;if(_0x23f32e>=_0x575d8){_0x23f32e=_0x575d8;_0x338067=0xc8;}else{_0x338067=0xce;}_0x18929b['status'](_0x338067);return _0x18929b[_0x6784('0x23')](_0x6784('0x24'),_0x2fd8a2+'-'+_0x23f32e+'/'+_0x575d8)['json'](_0x32eaf2);}return null;};}function patchUpdates(_0x3f4178){return function(_0x2eeed8){try{jsonpatch[_0x6784('0x25')](_0x2eeed8,_0x3f4178,!![]);}catch(_0x461ced){return BPromise['reject'](_0x461ced);}return _0x2eeed8[_0x6784('0x26')]();};}function saveUpdates(_0x225a9e,_0x581690){return function(_0x37aea3){if(_0x37aea3){return _0x37aea3[_0x6784('0x27')](_0x225a9e)[_0x6784('0x28')](function(_0x305d64){return _0x305d64;});}return null;};}function removeEntity(_0x3cdfe2,_0x140a38){return function(_0x5452a8){if(_0x5452a8){return _0x5452a8[_0x6784('0x29')]()[_0x6784('0x28')](function(){var _0x37aa8f=_0x5452a8[_0x6784('0x2a')]({'plain':!![]});var _0x4ac355=_0x6784('0x2b');return db[_0x6784('0x2c')][_0x6784('0x29')]({'where':{'type':_0x4ac355,'resourceId':_0x37aa8f['id']}})['then'](function(){return _0x5452a8;});})[_0x6784('0x28')](function(){_0x3cdfe2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51cbe4,_0x2dc02c){return function(_0x17346b){if(!_0x17346b){_0x51cbe4[_0x6784('0x1c')](0x194);}return _0x17346b;};}function handleError(_0x202a0e,_0x151340){_0x151340=_0x151340||0x1f4;return function(_0x280b56){logger['error'](_0x280b56[_0x6784('0x2d')]);if(_0x280b56['name']){delete _0x280b56['name'];}_0x202a0e['status'](_0x151340)[_0x6784('0x2e')](_0x280b56);};}exports[_0x6784('0x2f')]=function(_0x461057,_0x2036d6){var _0x204fba={},_0x5e465c={},_0x2e0b03={'count':0x0,'rows':[]};var _0x32e3cc=_[_0x6784('0x30')](db[_0x6784('0x31')][_0x6784('0x32')],function(_0xd9de69){return{'name':_0xd9de69['fieldName'],'type':_0xd9de69[_0x6784('0x33')]['key']};});_0x5e465c['model']=_[_0x6784('0x30')](_0x32e3cc,_0x6784('0x34'));_0x5e465c[_0x6784('0x35')]=_[_0x6784('0x36')](_0x461057['query']);_0x5e465c[_0x6784('0x37')]=_[_0x6784('0x38')](_0x5e465c[_0x6784('0x39')],_0x5e465c[_0x6784('0x35')]);_0x204fba[_0x6784('0x3a')]=_[_0x6784('0x38')](_0x5e465c[_0x6784('0x39')],qs[_0x6784('0x3b')](_0x461057['query']['fields']));_0x204fba[_0x6784('0x3a')]=_0x204fba['attributes'][_0x6784('0x3c')]?_0x204fba['attributes']:_0x5e465c[_0x6784('0x39')];if(!_0x461057['query'][_0x6784('0x3d')]('nolimit')){_0x204fba[_0x6784('0x22')]=qs[_0x6784('0x22')](_0x461057['query']['limit']);_0x204fba[_0x6784('0x1f')]=qs[_0x6784('0x1f')](_0x461057[_0x6784('0x35')]['offset']);}_0x204fba['order']=qs['sort'](_0x461057[_0x6784('0x35')][_0x6784('0x3e')]);_0x204fba[_0x6784('0x3f')]=qs[_0x6784('0x37')](_[_0x6784('0x40')](_0x461057['query'],_0x5e465c[_0x6784('0x37')]),_0x32e3cc);if(_0x461057[_0x6784('0x35')][_0x6784('0x41')]){_0x204fba[_0x6784('0x3f')]=_[_0x6784('0x42')](_0x204fba[_0x6784('0x3f')],{'$or':_['map'](_0x32e3cc,function(_0x2b1090){if(_0x2b1090[_0x6784('0x33')]!==_0x6784('0x43')){var _0x5f65a9={};_0x5f65a9[_0x2b1090[_0x6784('0x34')]]={'$like':'%'+_0x461057[_0x6784('0x35')][_0x6784('0x41')]+'%'};return _0x5f65a9;}})});}_0x204fba=_[_0x6784('0x42')]({},_0x204fba,_0x461057[_0x6784('0x44')]);var _0x373921={'where':_0x204fba[_0x6784('0x3f')]};return db[_0x6784('0x31')]['count'](_0x373921)['then'](function(_0x11e22d){_0x2e0b03[_0x6784('0x21')]=_0x11e22d;if(_0x461057['query'][_0x6784('0x45')]){_0x204fba[_0x6784('0x46')]=[{'all':!![]}];}return db[_0x6784('0x31')][_0x6784('0x47')](_0x204fba);})[_0x6784('0x28')](function(_0x2ccb02){_0x2e0b03['rows']=_0x2ccb02;return _0x2e0b03;})['then'](respondWithFilteredResult(_0x2036d6,_0x204fba))[_0x6784('0x48')](handleError(_0x2036d6,null));};exports['show']=function(_0x14cbd8,_0x2497ce){var _0x28e519={'raw':![],'where':{'id':_0x14cbd8[_0x6784('0x49')]['id']}},_0x549dfb={};_0x549dfb[_0x6784('0x39')]=_[_0x6784('0x36')](db[_0x6784('0x31')]['rawAttributes']);_0x549dfb[_0x6784('0x35')]=_['keys'](_0x14cbd8['query']);_0x549dfb[_0x6784('0x37')]=_[_0x6784('0x38')](_0x549dfb['model'],_0x549dfb['query']);_0x28e519[_0x6784('0x3a')]=_[_0x6784('0x38')](_0x549dfb[_0x6784('0x39')],qs['fields'](_0x14cbd8[_0x6784('0x35')][_0x6784('0x3b')]));_0x28e519['attributes']=_0x28e519[_0x6784('0x3a')][_0x6784('0x3c')]?_0x28e519[_0x6784('0x3a')]:_0x549dfb['model'];if(_0x14cbd8[_0x6784('0x35')][_0x6784('0x45')]){_0x28e519[_0x6784('0x46')]=[{'all':!![]}];}_0x28e519=_[_0x6784('0x42')]({},_0x28e519,_0x14cbd8[_0x6784('0x44')]);return db[_0x6784('0x31')][_0x6784('0x4a')](_0x28e519)[_0x6784('0x28')](handleEntityNotFound(_0x2497ce,null))[_0x6784('0x28')](respondWithResult(_0x2497ce,null))[_0x6784('0x48')](handleError(_0x2497ce,null));};exports['create']=function(_0x4c332e,_0x3955c7){return db[_0x6784('0x31')][_0x6784('0x4b')](_0x4c332e['body'],{})[_0x6784('0x28')](function(_0x5dcadf){var _0x2deb8d=_0x4c332e[_0x6784('0x4c')]['get']({'plain':!![]});if(!_0x2deb8d)throw new Error(_0x6784('0x4d'));if(_0x2deb8d['role']==='user'){var _0x3f3715=_0x5dcadf[_0x6784('0x2a')]({'plain':!![]});var _0x2603f1=_0x6784('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x2603f1,'userProfileId':_0x2deb8d[_0x6784('0x4e')]},'raw':!![]})[_0x6784('0x28')](function(_0x5b4801){if(_0x5b4801&&_0x5b4801[_0x6784('0x4f')]===0x0){return db[_0x6784('0x2c')][_0x6784('0x4b')]({'name':_0x3f3715[_0x6784('0x34')],'resourceId':_0x3f3715['id'],'type':_0x5b4801[_0x6784('0x34')],'sectionId':_0x5b4801['id']},{})[_0x6784('0x28')](function(){return _0x5dcadf;});}else{return _0x5dcadf;}})[_0x6784('0x48')](function(_0x408763){logger[_0x6784('0x50')](_0x6784('0x51'),_0x408763);throw _0x408763;});}return _0x5dcadf;})[_0x6784('0x28')](respondWithResult(_0x3955c7,0xc9))['catch'](handleError(_0x3955c7,null));};exports[_0x6784('0x27')]=function(_0x2aaf8b,_0x37d00b){if(_0x2aaf8b[_0x6784('0x52')]['id']){delete _0x2aaf8b[_0x6784('0x52')]['id'];}return db[_0x6784('0x31')][_0x6784('0x4a')]({'where':{'id':_0x2aaf8b[_0x6784('0x49')]['id']}})['then'](handleEntityNotFound(_0x37d00b,null))[_0x6784('0x28')](saveUpdates(_0x2aaf8b[_0x6784('0x52')],null))[_0x6784('0x28')](respondWithResult(_0x37d00b,null))[_0x6784('0x48')](handleError(_0x37d00b,null));};exports[_0x6784('0x29')]=function(_0x176f33,_0xbed6df){return db[_0x6784('0x31')][_0x6784('0x4a')]({'where':{'id':_0x176f33[_0x6784('0x49')]['id']}})[_0x6784('0x28')](handleEntityNotFound(_0xbed6df,null))[_0x6784('0x28')](removeEntity(_0xbed6df,null))[_0x6784('0x48')](handleError(_0xbed6df,null));}; \ No newline at end of file +var _0xee5b=['params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','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','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','VoiceChanSpy','includeAll','include','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee5b,0x1f4));var _0xbee5=function(_0x122e56,_0x321375){_0x122e56=_0x122e56-0x0;var _0x36434f=_0xee5b[_0x122e56];return _0x36434f;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){var _0x5b43b3=_0x3cfa8d['get']({'plain':!![]});var _0x519473='ChanSpies';return db[_0xbee5('0x25')][_0xbee5('0x24')]({'where':{'type':_0x519473,'resourceId':_0x5b43b3['id']}})[_0xbee5('0x23')](function(){return _0x3cfa8d;});})[_0xbee5('0x23')](function(){_0xb665df[_0xbee5('0x17')](0xcc)[_0xbee5('0x18')]();});}};}function handleEntityNotFound(_0x3c8643,_0x4e9a79){return function(_0x36b50f){if(!_0x36b50f){_0x3c8643[_0xbee5('0x26')](0x194);}return _0x36b50f;};}function handleError(_0x179d14,_0x39da95){_0x39da95=_0x39da95||0x1f4;return function(_0x1a8bcc){logger['error'](_0x1a8bcc[_0xbee5('0x27')]);if(_0x1a8bcc[_0xbee5('0x28')]){delete _0x1a8bcc[_0xbee5('0x28')];}_0x179d14[_0xbee5('0x17')](_0x39da95)[_0xbee5('0x29')](_0x1a8bcc);};}exports[_0xbee5('0x2a')]=function(_0x34b7df,_0x36e8bb){var _0x2ccb91={},_0x59c2e4={},_0x22df5f={'count':0x0,'rows':[]};var _0x5b10a6=_[_0xbee5('0x2b')](db['VoiceChanSpy'][_0xbee5('0x2c')],function(_0x52dad9){return{'name':_0x52dad9[_0xbee5('0x2d')],'type':_0x52dad9['type'][_0xbee5('0x2e')]};});_0x59c2e4[_0xbee5('0x2f')]=_[_0xbee5('0x2b')](_0x5b10a6,_0xbee5('0x28'));_0x59c2e4['query']=_[_0xbee5('0x30')](_0x34b7df[_0xbee5('0x31')]);_0x59c2e4[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x59c2e4['model'],_0x59c2e4[_0xbee5('0x31')]);_0x2ccb91[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x59c2e4[_0xbee5('0x2f')],qs['fields'](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x35')]));_0x2ccb91[_0xbee5('0x34')]=_0x2ccb91[_0xbee5('0x34')]['length']?_0x2ccb91[_0xbee5('0x34')]:_0x59c2e4['model'];if(!_0x34b7df[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2ccb91['limit']=qs[_0xbee5('0x1a')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2ccb91[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x19')]);}_0x2ccb91[_0xbee5('0x36')]=qs['sort'](_0x34b7df[_0xbee5('0x31')]['sort']);_0x2ccb91[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_[_0xbee5('0x38')](_0x34b7df[_0xbee5('0x31')],_0x59c2e4['filters']),_0x5b10a6);if(_0x34b7df[_0xbee5('0x31')]['filter']){_0x2ccb91['where']=_[_0xbee5('0x39')](_0x2ccb91[_0xbee5('0x37')],{'$or':_[_0xbee5('0x2b')](_0x5b10a6,function(_0x1974f2){if(_0x1974f2['type']!==_0xbee5('0x3a')){var _0x2819e2={};_0x2819e2[_0x1974f2[_0xbee5('0x28')]]={'$like':'%'+_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x2819e2;}})});}_0x2ccb91=_[_0xbee5('0x39')]({},_0x2ccb91,_0x34b7df[_0xbee5('0x3c')]);var _0x297294={'where':_0x2ccb91[_0xbee5('0x37')]};return db[_0xbee5('0x3d')]['count'](_0x297294)[_0xbee5('0x23')](function(_0x371015){_0x22df5f['count']=_0x371015;if(_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x2ccb91[_0xbee5('0x3f')]=[{'all':!![]}];}return db[_0xbee5('0x3d')]['findAll'](_0x2ccb91);})['then'](function(_0x4b4641){_0x22df5f[_0xbee5('0x40')]=_0x4b4641;return _0x22df5f;})[_0xbee5('0x23')](respondWithFilteredResult(_0x36e8bb,_0x2ccb91))[_0xbee5('0x41')](handleError(_0x36e8bb,null));};exports[_0xbee5('0x42')]=function(_0x4012fd,_0x3f5441){var _0x41cea0={'raw':![],'where':{'id':_0x4012fd[_0xbee5('0x43')]['id']}},_0x2c4464={};_0x2c4464['model']=_['keys'](db[_0xbee5('0x3d')]['rawAttributes']);_0x2c4464[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x4012fd['query']);_0x2c4464[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2c4464['model'],_0x2c4464['query']);_0x41cea0[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x2c4464['model'],qs[_0xbee5('0x35')](_0x4012fd[_0xbee5('0x31')]['fields']));_0x41cea0[_0xbee5('0x34')]=_0x41cea0[_0xbee5('0x34')][_0xbee5('0x44')]?_0x41cea0[_0xbee5('0x34')]:_0x2c4464[_0xbee5('0x2f')];if(_0x4012fd[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x41cea0['include']=[{'all':!![]}];}_0x41cea0=_[_0xbee5('0x39')]({},_0x41cea0,_0x4012fd[_0xbee5('0x3c')]);return db[_0xbee5('0x3d')][_0xbee5('0x45')](_0x41cea0)['then'](handleEntityNotFound(_0x3f5441,null))[_0xbee5('0x23')](respondWithResult(_0x3f5441,null))[_0xbee5('0x41')](handleError(_0x3f5441,null));};exports[_0xbee5('0x46')]=function(_0x4aa21a,_0x44d4b1){return db[_0xbee5('0x3d')]['create'](_0x4aa21a['body'],{})['then'](function(_0x3a27bb){var _0x501167=_0x4aa21a[_0xbee5('0x47')][_0xbee5('0x48')]({'plain':!![]});if(!_0x501167)throw new Error(_0xbee5('0x49'));if(_0x501167[_0xbee5('0x4a')]===_0xbee5('0x47')){var _0x296fc8=_0x3a27bb['get']({'plain':!![]});var _0x24274d=_0xbee5('0x4b');return db[_0xbee5('0x4c')][_0xbee5('0x45')]({'where':{'name':_0x24274d,'userProfileId':_0x501167['userProfileId']},'raw':!![]})[_0xbee5('0x23')](function(_0x594dcf){if(_0x594dcf&&_0x594dcf[_0xbee5('0x4d')]===0x0){return db[_0xbee5('0x25')][_0xbee5('0x46')]({'name':_0x296fc8[_0xbee5('0x28')],'resourceId':_0x296fc8['id'],'type':_0x594dcf[_0xbee5('0x28')],'sectionId':_0x594dcf['id']},{})[_0xbee5('0x23')](function(){return _0x3a27bb;});}else{return _0x3a27bb;}})[_0xbee5('0x41')](function(_0x35f1d1){logger[_0xbee5('0x4e')](_0xbee5('0x4f'),_0x35f1d1);throw _0x35f1d1;});}return _0x3a27bb;})[_0xbee5('0x23')](respondWithResult(_0x44d4b1,0xc9))[_0xbee5('0x41')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x22')]=function(_0x359738,_0x37cf74){if(_0x359738['body']['id']){delete _0x359738[_0xbee5('0x50')]['id'];}return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x359738['params']['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x37cf74,null))[_0xbee5('0x23')](saveUpdates(_0x359738[_0xbee5('0x50')],null))['then'](respondWithResult(_0x37cf74,null))[_0xbee5('0x41')](handleError(_0x37cf74,null));};exports['destroy']=function(_0x131c45,_0x4ee645){return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x131c45[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee645,null))['then'](removeEntity(_0x4ee645,null))['catch'](handleError(_0x4ee645,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 49e8dff..699d923 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 _0x465c=['system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','./voiceChanSpy.attributes','context','from-sip','format','prefix'];(function(_0x3fa0fd,_0x23c7b3){var _0x1e93de=function(_0x54b300){while(--_0x54b300){_0x3fa0fd['push'](_0x3fa0fd['shift']());}};_0x1e93de(++_0x23c7b3);}(_0x465c,0xde));var _0xc465=function(_0x1355b9,_0x1e78cc){_0x1355b9=_0x1355b9-0x0;var _0x19d05a=_0x465c[_0x1355b9];return _0x19d05a;};'use strict';var _=require('lodash');var util=require(_0xc465('0x0'));var BPromise=require('bluebird');var attributes=require(_0xc465('0x1'));var getUserApplications=function(_0x398fe5,_0x1a03f7,_0x5de747){var _0x10e307=0x1;var _0x2adbdc=[];var _0x384c18={'context':_0x1a03f7[_0xc465('0x2')]||_0xc465('0x3'),'exten':util[_0xc465('0x4')]('%s%s',_0x398fe5[_0xc465('0x5')],_0x5de747),'type':_0xc465('0x6'),'isApp':![],'ChanSpyId':_0x398fe5['id'],'UserId':_0x1a03f7['id']};_0x2adbdc[_0xc465('0x7')](_[_0xc465('0x8')]({'app':_0xc465('0x9'),'appdata':util['format'](_0xc465('0xa'),'chanspy'),'priority':_0x10e307++},_0x384c18));if(_0x398fe5[_0xc465('0xb')]){_0x2adbdc['push'](_[_0xc465('0x8')]({'app':_0xc465('0xc'),'appdata':util[_0xc465('0x4')](_0xc465('0xd'),_0x398fe5[_0xc465('0xe')]),'priority':_0x10e307++},_0x384c18));}if(_0x398fe5[_0xc465('0xf')]){_0x2adbdc[_0xc465('0x7')](_[_0xc465('0x8')]({'app':_0xc465('0x10'),'appdata':_0x398fe5[_0xc465('0x11')],'priority':_0x10e307++},_0x384c18));}_0x2adbdc['push'](_[_0xc465('0x8')]({'app':_0xc465('0x12'),'appdata':util['format'](_0xc465('0x13'),_0x1a03f7[_0xc465('0x14')],_0x398fe5[_0xc465('0x15')]?_0x398fe5['options'][_0xc465('0x16')](''):''),'priority':_0x10e307++},_0x384c18));if(_0x398fe5[_0xc465('0xb')]){_0x2adbdc[_0xc465('0x7')](_[_0xc465('0x8')]({'app':_0xc465('0x17'),'priority':_0x10e307++},_0x384c18));}return _0x2adbdc;};var getChanSpyApplications=function(_0x12dfd4,_0x4a7d48){var _0x3109fe=[];for(var _0x79df78=0x0,_0x53f0e4=0x1;_0x79df78<_0x4a7d48[_0xc465('0x18')];_0x79df78++,_0x53f0e4=0x1){_0x3109fe=_0x3109fe[_0xc465('0x19')](getUserApplications(_0x12dfd4,_0x4a7d48[_0x79df78],_0x4a7d48[_0x79df78][_0xc465('0x1a')]));if(_0x4a7d48[_0x79df78][_0xc465('0x1a')]!=_0x4a7d48[_0x79df78][_0xc465('0x14')]){_0x3109fe=_0x3109fe[_0xc465('0x19')](getUserApplications(_0x12dfd4,_0x4a7d48[_0x79df78],_0x4a7d48[_0x79df78][_0xc465('0x14')]));}}return _0x3109fe;};var getChanSpyPromise=function(_0x637312,_0x387800){return new BPromise(function(_0x19955c,_0x4352d9){return _0x637312[_0xc465('0x1b')]['findAll']({'attributes':['id',_0xc465('0x14'),_0xc465('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x5b2522){if(_0x5b2522){return _0x19955c(getChanSpyApplications(_0x387800,_0x5b2522));}return _0x19955c([]);})[_0xc465('0x1c')](function(_0x4a36d5){_0x4352d9(_0x4a36d5);});});};module[_0xc465('0x1d')]=function(_0x51d5f1,_0x324fd4){var _0x12d366=_0x51d5f1[_0xc465('0x1e')];return _0x51d5f1[_0xc465('0x1f')](_0xc465('0x20'),attributes,{'tableName':_0xc465('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55f21f,_0x1b25a5,_0x4a8030){return getChanSpyPromise(_0x12d366,_0x55f21f)[_0xc465('0x22')](function(_0x991000){if(_0x991000&&_0x991000[_0xc465('0x18')]){return _0x12d366[_0xc465('0x23')][_0xc465('0x24')](_0x991000);}})['then'](function(){_0x4a8030();})[_0xc465('0x1c')](function(_0x733a12){_0x4a8030(_0x733a12);});},'afterUpdate':function(_0x14a5a4,_0x5e3c9f,_0x2af694){return _0x12d366[_0xc465('0x23')]['destroy']({'where':{'ChanSpyId':_0x14a5a4['id']}})[_0xc465('0x22')](function(){return getChanSpyPromise(_0x12d366,_0x14a5a4);})[_0xc465('0x22')](function(_0x329b10){if(_0x329b10&&_0x329b10[_0xc465('0x18')]){return _0x12d366[_0xc465('0x23')][_0xc465('0x24')](_0x329b10);}})[_0xc465('0x22')](function(){_0x2af694();})[_0xc465('0x1c')](function(_0x185f9d){_0x2af694(_0x185f9d);});},'afterDestroy':function(_0x164360,_0x149a57,_0x5b0600){return _0x12d366[_0xc465('0x23')][_0xc465('0x25')]({'where':{'ChanSpyId':_0x164360['id']}})['then'](function(){_0x5b0600();})[_0xc465('0x1c')](function(_0x127fa1){_0x5b0600(_0x127fa1);});}}});}; \ No newline at end of file +var _0xa709=['Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','User','findAll','internal','agent','then','exports','models','VoiceChanSpy','VoiceExtension','bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa709,0xd4));var _0x9a70=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xa709[_0x1dfa63];return _0x26f2a9;};'use strict';var _=require('lodash');var util=require(_0x9a70('0x0'));var BPromise=require(_0x9a70('0x1'));var attributes=require(_0x9a70('0x2'));var getUserApplications=function(_0x229a85,_0x4be36f,_0x2a8377){var _0xd45ec4=0x1;var _0x58dc64=[];var _0x29acbe={'context':_0x4be36f[_0x9a70('0x3')]||_0x9a70('0x4'),'exten':util[_0x9a70('0x5')]('%s%s',_0x229a85[_0x9a70('0x6')],_0x2a8377),'type':_0x9a70('0x7'),'isApp':![],'ChanSpyId':_0x229a85['id'],'UserId':_0x4be36f['id']};_0x58dc64[_0x9a70('0x8')](_[_0x9a70('0x9')]({'app':_0x9a70('0xa'),'appdata':util['format'](_0x9a70('0xb'),_0x9a70('0xc')),'priority':_0xd45ec4++},_0x29acbe));if(_0x229a85[_0x9a70('0xd')]){_0x58dc64[_0x9a70('0x8')](_[_0x9a70('0x9')]({'app':_0x9a70('0xe'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x229a85[_0x9a70('0xf')]),'priority':_0xd45ec4++},_0x29acbe));}if(_0x229a85[_0x9a70('0x10')]){_0x58dc64['push'](_[_0x9a70('0x9')]({'app':'Authenticate','appdata':_0x229a85[_0x9a70('0x11')],'priority':_0xd45ec4++},_0x29acbe));}_0x58dc64[_0x9a70('0x8')](_[_0x9a70('0x9')]({'app':'ChanSpy','appdata':util[_0x9a70('0x5')](_0x9a70('0x12'),_0x4be36f[_0x9a70('0x13')],_0x229a85[_0x9a70('0x14')]?_0x229a85[_0x9a70('0x14')][_0x9a70('0x15')](''):''),'priority':_0xd45ec4++},_0x29acbe));if(_0x229a85[_0x9a70('0xd')]){_0x58dc64[_0x9a70('0x8')](_[_0x9a70('0x9')]({'app':_0x9a70('0x16'),'priority':_0xd45ec4++},_0x29acbe));}return _0x58dc64;};var getChanSpyApplications=function(_0x3b06c5,_0x3e5055){var _0x3957fa=[];for(var _0x5cabd7=0x0,_0x38d5bd=0x1;_0x5cabd7<_0x3e5055[_0x9a70('0x17')];_0x5cabd7++,_0x38d5bd=0x1){_0x3957fa=_0x3957fa[_0x9a70('0x18')](getUserApplications(_0x3b06c5,_0x3e5055[_0x5cabd7],_0x3e5055[_0x5cabd7]['internal']));if(_0x3e5055[_0x5cabd7]['internal']!=_0x3e5055[_0x5cabd7][_0x9a70('0x13')]){_0x3957fa=_0x3957fa[_0x9a70('0x18')](getUserApplications(_0x3b06c5,_0x3e5055[_0x5cabd7],_0x3e5055[_0x5cabd7][_0x9a70('0x13')]));}}return _0x3957fa;};var getChanSpyPromise=function(_0x4d11b3,_0x55079d){return new BPromise(function(_0x112d01,_0x59b330){return _0x4d11b3[_0x9a70('0x19')][_0x9a70('0x1a')]({'attributes':['id',_0x9a70('0x13'),_0x9a70('0x1b')],'where':{'role':_0x9a70('0x1c'),'chanspy':!![]},'raw':!![]})[_0x9a70('0x1d')](function(_0x5a7723){if(_0x5a7723){return _0x112d01(getChanSpyApplications(_0x55079d,_0x5a7723));}return _0x112d01([]);})['catch'](function(_0x3945e1){_0x59b330(_0x3945e1);});});};module[_0x9a70('0x1e')]=function(_0x1c2094,_0x58d099){var _0x54e233=_0x1c2094[_0x9a70('0x1f')];return _0x1c2094['define'](_0x9a70('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ac7e7,_0x2cf5e4,_0x2334dc){return getChanSpyPromise(_0x54e233,_0x2ac7e7)['then'](function(_0x107eb3){if(_0x107eb3&&_0x107eb3[_0x9a70('0x17')]){return _0x54e233[_0x9a70('0x21')][_0x9a70('0x22')](_0x107eb3);}})[_0x9a70('0x1d')](function(){_0x2334dc();})[_0x9a70('0x23')](function(_0x39994b){_0x2334dc(_0x39994b);});},'afterUpdate':function(_0x45806a,_0x180348,_0x1e5086){return _0x54e233[_0x9a70('0x21')][_0x9a70('0x24')]({'where':{'ChanSpyId':_0x45806a['id']}})[_0x9a70('0x1d')](function(){return getChanSpyPromise(_0x54e233,_0x45806a);})[_0x9a70('0x1d')](function(_0x27f87b){if(_0x27f87b&&_0x27f87b[_0x9a70('0x17')]){return _0x54e233[_0x9a70('0x21')][_0x9a70('0x22')](_0x27f87b);}})[_0x9a70('0x1d')](function(){_0x1e5086();})['catch'](function(_0x2c95b0){_0x1e5086(_0x2c95b0);});},'afterDestroy':function(_0x509d0e,_0x3f07e0,_0x376998){return _0x54e233[_0x9a70('0x21')][_0x9a70('0x24')]({'where':{'ChanSpyId':_0x509d0e['id']}})[_0x9a70('0x1d')](function(){_0x376998();})['catch'](function(_0x5a982c){_0x376998(_0x5a982c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4f3ff45..f93b683 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 _0x6ae2=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x273c8d,_0x49fe05){_0x273c8d=_0x273c8d-0x0;var _0x4e287f=_0x6ae2[_0x273c8d];return _0x4e287f;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var moment=require(_0x26ae('0x2'));var BPromise=require(_0x26ae('0x3'));var rs=require(_0x26ae('0x4'));var fs=require('fs');var Redis=require(_0x26ae('0x5'));var db=require(_0x26ae('0x6'))['db'];var utils=require(_0x26ae('0x7'));var logger=require(_0x26ae('0x8'))('rpc');var config=require(_0x26ae('0x9'));var jayson=require(_0x26ae('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13cb27,_0xde4226,_0x473907){return new BPromise(function(_0x151de3,_0x3bc9de){return client[_0x26ae('0xb')](_0x13cb27,_0x473907)[_0x26ae('0xc')](function(_0x4b3eca){logger[_0x26ae('0xd')](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));logger[_0x26ae('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0xde4226,_0x26ae('0xf'),JSON['stringify'](_0x4b3eca));if(_0x4b3eca[_0x26ae('0x11')]){if(_0x4b3eca['error']['code']===0x1f4){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x3bc9de(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x151de3(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}else{logger['info'](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));_0x151de3(_0x4b3eca['result'][_0x26ae('0x12')]);}})[_0x26ae('0x13')](function(_0x4f71d8){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4f71d8);_0x3bc9de(_0x4f71d8);});});} \ No newline at end of file +var _0x96cc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x2df93d,_0x26ba91){var _0x11a251=function(_0x31c881){while(--_0x31c881){_0x2df93d['push'](_0x2df93d['shift']());}};_0x11a251(++_0x26ba91);}(_0x96cc,0x16c));var _0xc96c=function(_0x501c32,_0x2f24c9){_0x501c32=_0x501c32-0x0;var _0x9bd372=_0x96cc[_0x501c32];return _0x9bd372;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5e83203..2ebee55 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 _0x3f39=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','/:id','update'];(function(_0x254caa,_0x454b80){var _0x1f9aac=function(_0x1a8c87){while(--_0x1a8c87){_0x254caa['push'](_0x254caa['shift']());}};_0x1f9aac(++_0x454b80);}(_0x3f39,0x9a));var _0x93f3=function(_0x32bb70,_0x100b5b){_0x32bb70=_0x32bb70-0x0;var _0x351d7a=_0x3f39[_0x32bb70];return _0x351d7a;};'use strict';var multer=require(_0x93f3('0x0'));var util=require(_0x93f3('0x1'));var path=require(_0x93f3('0x2'));var timeout=require(_0x93f3('0x3'));var express=require(_0x93f3('0x4'));var router=express['Router']();var fs_extra=require(_0x93f3('0x5'));var auth=require(_0x93f3('0x6'));var interaction=require(_0x93f3('0x7'));var config=require(_0x93f3('0x8'));var controller=require(_0x93f3('0x9'));router[_0x93f3('0xa')]('/',auth[_0x93f3('0xb')](),controller[_0x93f3('0xc')]);router['get']('/:id',auth[_0x93f3('0xb')](),controller[_0x93f3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x93f3('0xe'),auth[_0x93f3('0xb')](),controller[_0x93f3('0xf')]);router['delete']('/:id',auth[_0x93f3('0xb')](),controller['destroy']);module[_0x93f3('0x10')]=router; \ No newline at end of file +var _0x9719=['exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x9719,0x144));var _0x9971=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9719[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9971('0x0'));var timeout=require(_0x9971('0x1'));var express=require(_0x9971('0x2'));var router=express[_0x9971('0x3')]();var fs_extra=require(_0x9971('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9971('0x5'));var controller=require('./voiceContext.controller');router[_0x9971('0x6')]('/',auth['isAuthenticated'](),controller[_0x9971('0x7')]);router['get'](_0x9971('0x8'),auth[_0x9971('0x9')](),controller['show']);router[_0x9971('0xa')]('/',auth['isAuthenticated'](),controller[_0x9971('0xb')]);router[_0x9971('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x9971('0xd')]);router[_0x9971('0xe')](_0x9971('0x8'),auth[_0x9971('0x9')](),controller[_0x9971('0xf')]);module[_0x9971('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 03b1cfd..3373ddc 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 _0xfb77=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0xfb77,0x16d));var _0x7fb7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfb77[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7fb7('0x0'));module[_0x7fb7('0x1')]={'name':{'type':Sequelize[_0x7fb7('0x2')],'unique':_0x7fb7('0x3')},'description':{'type':Sequelize[_0x7fb7('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7fb7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9784=['BOOLEAN','STRING'];(function(_0x26ed29,_0x2288f1){var _0x26182c=function(_0x23dc71){while(--_0x23dc71){_0x26ed29['push'](_0x26ed29['shift']());}};_0x26182c(++_0x2288f1);}(_0x9784,0xed));var _0x4978=function(_0x4a454c,_0x57eb8c){_0x4a454c=_0x4a454c-0x0;var _0x445b67=_0x9784[_0x4a454c];return _0x445b67;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4978('0x0')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4978('0x1')],'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 1bf836a..2224206 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 _0xa955=['zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','get','Contexts','UserProfileResource','end','sendStatus','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','rows','fields','includeAll','find','create','body','findAll','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','writeFileSync','readFileSync','chan_sip.so','eml-format','rimraf'];(function(_0x21bfce,_0x4c2c80){var _0x1cd9e0=function(_0x3fb74c){while(--_0x3fb74c){_0x21bfce['push'](_0x21bfce['shift']());}};_0x1cd9e0(++_0x4c2c80);}(_0xa955,0xc6));var _0x5a95=function(_0x50b231,_0x1857fa){_0x50b231=_0x50b231-0x0;var _0x10f50a=_0xa955[_0x50b231];return _0x10f50a;};'use strict';var emlformat=require(_0x5a95('0x0'));var rimraf=require(_0x5a95('0x1'));var zipdir=require(_0x5a95('0x2'));var jsonpatch=require(_0x5a95('0x3'));var rp=require(_0x5a95('0x4'));var moment=require(_0x5a95('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a95('0x6'));var path=require('path');var sox=require(_0x5a95('0x7'));var csv=require(_0x5a95('0x8'));var ejs=require(_0x5a95('0x9'));var fs=require('fs');var fs_extra=require(_0x5a95('0xa'));var _=require(_0x5a95('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a95('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a95('0xd'));var Papa=require(_0x5a95('0xe'));var Redis=require('ioredis');var authService=require(_0x5a95('0xf'));var qs=require(_0x5a95('0x10'));var as=require(_0x5a95('0x11'));var hardwareService=require(_0x5a95('0x12'));var logger=require(_0x5a95('0x13'))('api');var utils=require(_0x5a95('0x14'));var config=require(_0x5a95('0x15'));var licenseUtil=require(_0x5a95('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5a95('0x17'));var client=jayson[_0x5a95('0x18')][_0x5a95('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4edc72,_0x4aa3f0,_0x345a42,_0x397607){return new BPromise(function(_0x45cdc2,_0x3dff09){var _0x29e47f=_0x397607||client;return _0x29e47f[_0x5a95('0x1a')](_0x4edc72,_0x345a42)[_0x5a95('0x1b')](function(_0x413533){logger[_0x5a95('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x4aa3f0,'request\x20sent');logger['debug'](_0x5a95('0x1d'),_0x4aa3f0,_0x5a95('0x1e'),JSON[_0x5a95('0x1f')](_0x413533));if(_0x413533[_0x5a95('0x20')]){if(_0x413533[_0x5a95('0x20')]['code']===0x1f4){logger[_0x5a95('0x20')](_0x5a95('0x21'),_0x4aa3f0,_0x413533[_0x5a95('0x20')]['message']);return _0x3dff09(_0x413533[_0x5a95('0x20')][_0x5a95('0x22')]);}logger['error'](_0x5a95('0x21'),_0x4aa3f0,_0x413533[_0x5a95('0x20')]['message']);return _0x45cdc2(_0x413533['error'][_0x5a95('0x22')]);}else{logger[_0x5a95('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x4aa3f0,'request\x20sent');_0x45cdc2(_0x413533['result']['message']);}})[_0x5a95('0x23')](function(_0x11f14e){logger[_0x5a95('0x20')](_0x5a95('0x21'),_0x4aa3f0,_0x11f14e);_0x3dff09(_0x11f14e);});});}function respondWithStatusCode(_0x11490f,_0xa1223c){_0xa1223c=_0xa1223c||0xcc;return function(_0x453065){if(_0x453065){return _0x11490f['sendStatus'](_0xa1223c);}return _0x11490f[_0x5a95('0x24')](_0xa1223c)['end']();};}function respondWithResult(_0x2cdd6d,_0x395904){_0x395904=_0x395904||0xc8;return function(_0x3496d6){if(_0x3496d6){return _0x2cdd6d[_0x5a95('0x24')](_0x395904)[_0x5a95('0x25')](_0x3496d6);}};}function respondWithFilteredResult(_0x1aa638,_0x181a8f){return function(_0x498889){if(_0x498889){var _0x39e840=typeof _0x181a8f[_0x5a95('0x26')]===_0x5a95('0x27')&&typeof _0x181a8f['limit']===_0x5a95('0x27');var _0x3211b4=_0x498889[_0x5a95('0x28')];var _0x39b7b9=_0x39e840?0x0:_0x181a8f[_0x5a95('0x26')];var _0x2a6635=_0x39e840?_0x498889[_0x5a95('0x28')]:_0x181a8f['offset']+_0x181a8f[_0x5a95('0x29')];var _0x1aaa96;if(_0x2a6635>=_0x3211b4){_0x2a6635=_0x3211b4;_0x1aaa96=0xc8;}else{_0x1aaa96=0xce;}_0x1aa638[_0x5a95('0x24')](_0x1aaa96);return _0x1aa638[_0x5a95('0x2a')](_0x5a95('0x2b'),_0x39b7b9+'-'+_0x2a6635+'/'+_0x3211b4)['json'](_0x498889);}return null;};}function patchUpdates(_0x219567){return function(_0xff7208){try{jsonpatch['apply'](_0xff7208,_0x219567,!![]);}catch(_0xe4438c){return BPromise[_0x5a95('0x2c')](_0xe4438c);}return _0xff7208['save']();};}function saveUpdates(_0x5766c9,_0x42ae00){return function(_0x4b866e){if(_0x4b866e){return _0x4b866e[_0x5a95('0x2d')](_0x5766c9)[_0x5a95('0x1b')](function(_0x1ff1a4){return _0x1ff1a4;});}return null;};}function removeEntity(_0x434d6a,_0x21a0ac){return function(_0x8683de){if(_0x8683de){return _0x8683de[_0x5a95('0x2e')]()[_0x5a95('0x1b')](function(){var _0x4f6432=_0x8683de[_0x5a95('0x2f')]({'plain':!![]});var _0x261bca=_0x5a95('0x30');return db[_0x5a95('0x31')][_0x5a95('0x2e')]({'where':{'type':_0x261bca,'resourceId':_0x4f6432['id']}})[_0x5a95('0x1b')](function(){return _0x8683de;});})[_0x5a95('0x1b')](function(){_0x434d6a[_0x5a95('0x24')](0xcc)[_0x5a95('0x32')]();});}};}function handleEntityNotFound(_0x28ec74,_0x5bd18d){return function(_0xd0fc56){if(!_0xd0fc56){_0x28ec74[_0x5a95('0x33')](0x194);}return _0xd0fc56;};}function handleError(_0x29bbd6,_0x5cf964){_0x5cf964=_0x5cf964||0x1f4;return function(_0x39790a){logger[_0x5a95('0x20')](_0x39790a[_0x5a95('0x34')]);if(_0x39790a[_0x5a95('0x35')]){delete _0x39790a['name'];}_0x29bbd6[_0x5a95('0x24')](_0x5cf964)['send'](_0x39790a);};}exports[_0x5a95('0x36')]=function(_0x99c863,_0x542bb0){var _0x3c8f9f={},_0x210741={},_0x5f4eef={'count':0x0,'rows':[]};var _0x59a28e=_[_0x5a95('0x37')](db[_0x5a95('0x38')][_0x5a95('0x39')],function(_0x5616e7){return{'name':_0x5616e7[_0x5a95('0x3a')],'type':_0x5616e7[_0x5a95('0x3b')][_0x5a95('0x3c')]};});_0x210741[_0x5a95('0x3d')]=_[_0x5a95('0x37')](_0x59a28e,_0x5a95('0x35'));_0x210741[_0x5a95('0x3e')]=_[_0x5a95('0x3f')](_0x99c863[_0x5a95('0x3e')]);_0x210741[_0x5a95('0x40')]=_[_0x5a95('0x41')](_0x210741[_0x5a95('0x3d')],_0x210741['query']);_0x3c8f9f[_0x5a95('0x42')]=_['intersection'](_0x210741['model'],qs['fields'](_0x99c863[_0x5a95('0x3e')]['fields']));_0x3c8f9f[_0x5a95('0x42')]=_0x3c8f9f['attributes'][_0x5a95('0x43')]?_0x3c8f9f[_0x5a95('0x42')]:_0x210741[_0x5a95('0x3d')];if(!_0x99c863[_0x5a95('0x3e')][_0x5a95('0x44')](_0x5a95('0x45'))){_0x3c8f9f[_0x5a95('0x29')]=qs[_0x5a95('0x29')](_0x99c863[_0x5a95('0x3e')][_0x5a95('0x29')]);_0x3c8f9f['offset']=qs[_0x5a95('0x26')](_0x99c863[_0x5a95('0x3e')][_0x5a95('0x26')]);}_0x3c8f9f[_0x5a95('0x46')]=qs[_0x5a95('0x47')](_0x99c863[_0x5a95('0x3e')][_0x5a95('0x47')]);_0x3c8f9f[_0x5a95('0x48')]=qs[_0x5a95('0x40')](_['pick'](_0x99c863['query'],_0x210741[_0x5a95('0x40')]),_0x59a28e);if(_0x99c863[_0x5a95('0x3e')]['filter']){_0x3c8f9f[_0x5a95('0x48')]=_['merge'](_0x3c8f9f['where'],{'$or':_[_0x5a95('0x37')](_0x59a28e,function(_0x2b7fc2){if(_0x2b7fc2[_0x5a95('0x3b')]!=='VIRTUAL'){var _0x2757f3={};_0x2757f3[_0x2b7fc2[_0x5a95('0x35')]]={'$like':'%'+_0x99c863['query'][_0x5a95('0x49')]+'%'};return _0x2757f3;}})});}_0x3c8f9f=_[_0x5a95('0x4a')]({},_0x3c8f9f,_0x99c863[_0x5a95('0x4b')]);var _0x310431={'where':_0x3c8f9f[_0x5a95('0x48')]};return db['VoiceContext'][_0x5a95('0x28')](_0x310431)['then'](function(_0x151d2e){_0x5f4eef['count']=_0x151d2e;if(_0x99c863[_0x5a95('0x3e')]['includeAll']){_0x3c8f9f[_0x5a95('0x4c')]=[{'all':!![]}];}return db[_0x5a95('0x38')]['findAll'](_0x3c8f9f);})[_0x5a95('0x1b')](function(_0x440ac6){_0x5f4eef[_0x5a95('0x4d')]=_0x440ac6;return _0x5f4eef;})['then'](respondWithFilteredResult(_0x542bb0,_0x3c8f9f))[_0x5a95('0x23')](handleError(_0x542bb0,null));};exports['show']=function(_0x36aa46,_0x28743e){var _0x578295={'raw':![],'where':{'id':_0x36aa46['params']['id']}},_0x4cf1ab={};_0x4cf1ab[_0x5a95('0x3d')]=_[_0x5a95('0x3f')](db[_0x5a95('0x38')][_0x5a95('0x39')]);_0x4cf1ab[_0x5a95('0x3e')]=_[_0x5a95('0x3f')](_0x36aa46[_0x5a95('0x3e')]);_0x4cf1ab[_0x5a95('0x40')]=_[_0x5a95('0x41')](_0x4cf1ab[_0x5a95('0x3d')],_0x4cf1ab['query']);_0x578295['attributes']=_[_0x5a95('0x41')](_0x4cf1ab[_0x5a95('0x3d')],qs[_0x5a95('0x4e')](_0x36aa46[_0x5a95('0x3e')][_0x5a95('0x4e')]));_0x578295[_0x5a95('0x42')]=_0x578295[_0x5a95('0x42')][_0x5a95('0x43')]?_0x578295[_0x5a95('0x42')]:_0x4cf1ab[_0x5a95('0x3d')];if(_0x36aa46[_0x5a95('0x3e')][_0x5a95('0x4f')]){_0x578295[_0x5a95('0x4c')]=[{'all':!![]}];}_0x578295=_[_0x5a95('0x4a')]({},_0x578295,_0x36aa46[_0x5a95('0x4b')]);return db[_0x5a95('0x38')][_0x5a95('0x50')](_0x578295)['then'](handleEntityNotFound(_0x28743e,null))[_0x5a95('0x1b')](respondWithResult(_0x28743e,null))[_0x5a95('0x23')](handleError(_0x28743e,null));};exports[_0x5a95('0x51')]=function(_0x4a61c6,_0x925c12,_0xa5380a){var _0x30c72d;return db['VoiceContext'][_0x5a95('0x51')](_0x4a61c6[_0x5a95('0x52')],{'raw':!![]})[_0x5a95('0x1b')](function(_0x11f666){_0x30c72d=_0x11f666;return db[_0x5a95('0x38')][_0x5a95('0x53')]({'raw':!![]});})['then'](function(_0x3b99d3){var _0x451494=fs['readFileSync'](path[_0x5a95('0x54')](config[_0x5a95('0x55')],_0x5a95('0x56')),_0x5a95('0x57'));var _0xa8b821=ejs[_0x5a95('0x58')](_0x451494,{'contexts':_0x3b99d3||[]});fs['writeFileSync'](_0x5a95('0x59'),_0xa8b821);})[_0x5a95('0x1b')](function(){return respondWithRpcPromise(_0x5a95('0x5a'),_0x5a95('0x51'),{'module':'chan_sip.so'});})[_0x5a95('0x1b')](function(){var _0x4fa896=_0x4a61c6[_0x5a95('0x5b')][_0x5a95('0x2f')]({'plain':!![]});if(!_0x4fa896)throw new Error(_0x5a95('0x5c'));if(_0x4fa896['role']===_0x5a95('0x5b')){var _0x5d1d13=_0x30c72d[_0x5a95('0x2f')]({'plain':!![]});return db[_0x5a95('0x5d')][_0x5a95('0x50')]({'where':{'name':'Contexts','userProfileId':_0x4fa896[_0x5a95('0x5e')]},'raw':!![]})['then'](function(_0x4454e8){if(_0x4454e8&&_0x4454e8['autoAssociation']===0x0){return db[_0x5a95('0x31')][_0x5a95('0x51')]({'name':_0x5d1d13[_0x5a95('0x35')],'resourceId':_0x5d1d13['id'],'type':_0x4454e8[_0x5a95('0x35')],'sectionId':_0x4454e8['id']},{})[_0x5a95('0x1b')](function(){return _0x30c72d;});}else{return _0x30c72d;}})['catch'](function(_0x3a6715){logger[_0x5a95('0x20')](_0x5a95('0x5f'),_0x3a6715);throw _0x3a6715;});}return _0x30c72d;})[_0x5a95('0x1b')](respondWithResult(_0x925c12,0xc9))[_0x5a95('0x23')](handleError(_0x925c12,null));};exports[_0x5a95('0x2d')]=function(_0x49b51a,_0x1db1cd,_0x2e27f7){var _0x3ec9ba;return db['VoiceContext'][_0x5a95('0x50')]({'where':{'id':_0x49b51a[_0x5a95('0x60')]['id']}})[_0x5a95('0x1b')](handleEntityNotFound(_0x1db1cd,null))[_0x5a95('0x1b')](saveUpdates(_0x49b51a[_0x5a95('0x52')],null))[_0x5a95('0x1b')](function(_0x5a5884){if(_0x5a5884){_0x3ec9ba=_0x5a5884;return db[_0x5a95('0x38')][_0x5a95('0x53')]({'raw':!![]});}})[_0x5a95('0x1b')](function(_0x262185){var _0x19a13a=fs['readFileSync'](path[_0x5a95('0x54')](config[_0x5a95('0x55')],_0x5a95('0x56')),_0x5a95('0x57'));var _0x198908=ejs[_0x5a95('0x58')](_0x19a13a,{'contexts':_0x262185||[]});fs[_0x5a95('0x61')](_0x5a95('0x59'),_0x198908);})[_0x5a95('0x1b')](function(){return respondWithRpcPromise(_0x5a95('0x5a'),_0x5a95('0x2d'),{'module':'chan_sip.so'});})[_0x5a95('0x1b')](function(){return _0x3ec9ba;})[_0x5a95('0x1b')](respondWithResult(_0x1db1cd,null))[_0x5a95('0x23')](handleError(_0x1db1cd,null));};exports['destroy']=function(_0x4fe210,_0x5e04fc,_0x315878){var _0x383667;return db['VoiceContext'][_0x5a95('0x50')]({'where':{'id':_0x4fe210[_0x5a95('0x60')]['id']}})[_0x5a95('0x1b')](handleEntityNotFound(_0x5e04fc,null))['then'](removeEntity(_0x5e04fc,null))[_0x5a95('0x1b')](function(){return db['VoiceContext'][_0x5a95('0x53')]({'raw':!![]});})[_0x5a95('0x1b')](function(_0x2e9c23){var _0xf0c01b=fs[_0x5a95('0x62')](path[_0x5a95('0x54')](config['root'],_0x5a95('0x56')),_0x5a95('0x57'));var _0x20835e=ejs['render'](_0xf0c01b,{'contexts':_0x2e9c23});fs[_0x5a95('0x61')](_0x5a95('0x59'),_0x20835e);return respondWithRpcPromise('Reload',_0x5a95('0x2e'),{'module':_0x5a95('0x63')});})[_0x5a95('0x23')](handleError(_0x5e04fc,null));}; \ No newline at end of file +var _0x30bc=['status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','Reload','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0xb64e94,_0x5d1255){var _0x45e191=function(_0x4653a9){while(--_0x4653a9){_0xb64e94['push'](_0xb64e94['shift']());}};_0x45e191(++_0x5d1255);}(_0x30bc,0x185));var _0xc30b=function(_0x563af1,_0x37924c){_0x563af1=_0x563af1-0x0;var _0x58fccb=_0x30bc[_0x563af1];return _0x58fccb;};'use strict';var emlformat=require(_0xc30b('0x0'));var rimraf=require(_0xc30b('0x1'));var zipdir=require(_0xc30b('0x2'));var jsonpatch=require(_0xc30b('0x3'));var rp=require(_0xc30b('0x4'));var moment=require(_0xc30b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc30b('0x6'));var util=require(_0xc30b('0x7'));var path=require(_0xc30b('0x8'));var sox=require(_0xc30b('0x9'));var csv=require(_0xc30b('0xa'));var ejs=require(_0xc30b('0xb'));var fs=require('fs');var fs_extra=require(_0xc30b('0xc'));var _=require(_0xc30b('0xd'));var squel=require(_0xc30b('0xe'));var crypto=require('crypto');var jsforce=require(_0xc30b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc30b('0xa'));var querystring=require(_0xc30b('0x10'));var Papa=require(_0xc30b('0x11'));var Redis=require(_0xc30b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc30b('0x13'));var as=require(_0xc30b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc30b('0x15'))(_0xc30b('0x16'));var utils=require(_0xc30b('0x17'));var config=require(_0xc30b('0x18'));var licenseUtil=require(_0xc30b('0x19'));var db=require(_0xc30b('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc30b('0x1b')][_0xc30b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x479d93,_0x1ea655,_0x3f5c7f,_0x1c36e9){return new BPromise(function(_0x2eaed4,_0x356ec1){var _0x10cf62=_0x1c36e9||client;return _0x10cf62['request'](_0x479d93,_0x3f5c7f)[_0xc30b('0x1d')](function(_0x44788e){logger['info'](_0xc30b('0x1e'),_0x1ea655,_0xc30b('0x1f'));logger[_0xc30b('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1ea655,'request\x20sent',JSON[_0xc30b('0x21')](_0x44788e));if(_0x44788e[_0xc30b('0x22')]){if(_0x44788e['error'][_0xc30b('0x23')]===0x1f4){logger['error'](_0xc30b('0x1e'),_0x1ea655,_0x44788e['error']['message']);return _0x356ec1(_0x44788e[_0xc30b('0x22')]['message']);}logger[_0xc30b('0x22')](_0xc30b('0x1e'),_0x1ea655,_0x44788e[_0xc30b('0x22')][_0xc30b('0x24')]);return _0x2eaed4(_0x44788e[_0xc30b('0x22')][_0xc30b('0x24')]);}else{logger[_0xc30b('0x25')](_0xc30b('0x1e'),_0x1ea655,_0xc30b('0x1f'));_0x2eaed4(_0x44788e[_0xc30b('0x26')][_0xc30b('0x24')]);}})['catch'](function(_0x455072){logger[_0xc30b('0x22')](_0xc30b('0x1e'),_0x1ea655,_0x455072);_0x356ec1(_0x455072);});});}function respondWithStatusCode(_0x3af69c,_0x3a1238){_0x3a1238=_0x3a1238||0xcc;return function(_0x4f6da8){if(_0x4f6da8){return _0x3af69c['sendStatus'](_0x3a1238);}return _0x3af69c[_0xc30b('0x27')](_0x3a1238)[_0xc30b('0x28')]();};}function respondWithResult(_0xef0829,_0x1fb4df){_0x1fb4df=_0x1fb4df||0xc8;return function(_0x47b29d){if(_0x47b29d){return _0xef0829[_0xc30b('0x27')](_0x1fb4df)[_0xc30b('0x29')](_0x47b29d);}};}function respondWithFilteredResult(_0x12a67b,_0x36a9c0){return function(_0x3986a9){if(_0x3986a9){var _0xbcd220=typeof _0x36a9c0['offset']==='undefined'&&typeof _0x36a9c0[_0xc30b('0x2a')]===_0xc30b('0x2b');var _0x44ddf5=_0x3986a9[_0xc30b('0x2c')];var _0x10ab9c=_0xbcd220?0x0:_0x36a9c0[_0xc30b('0x2d')];var _0x291983=_0xbcd220?_0x3986a9[_0xc30b('0x2c')]:_0x36a9c0['offset']+_0x36a9c0[_0xc30b('0x2a')];var _0x4d1d8f;if(_0x291983>=_0x44ddf5){_0x291983=_0x44ddf5;_0x4d1d8f=0xc8;}else{_0x4d1d8f=0xce;}_0x12a67b['status'](_0x4d1d8f);return _0x12a67b[_0xc30b('0x2e')](_0xc30b('0x2f'),_0x10ab9c+'-'+_0x291983+'/'+_0x44ddf5)[_0xc30b('0x29')](_0x3986a9);}return null;};}function patchUpdates(_0x238932){return function(_0x4aa211){try{jsonpatch[_0xc30b('0x30')](_0x4aa211,_0x238932,!![]);}catch(_0x5d2e4f){return BPromise[_0xc30b('0x31')](_0x5d2e4f);}return _0x4aa211[_0xc30b('0x32')]();};}function saveUpdates(_0x5c233b,_0x9bebbf){return function(_0x59f54e){if(_0x59f54e){return _0x59f54e[_0xc30b('0x33')](_0x5c233b)[_0xc30b('0x1d')](function(_0x4ca2e9){return _0x4ca2e9;});}return null;};}function removeEntity(_0xcaba39,_0x572b4b){return function(_0x29f205){if(_0x29f205){return _0x29f205['destroy']()[_0xc30b('0x1d')](function(){var _0x73149=_0x29f205['get']({'plain':!![]});var _0x5bfb56=_0xc30b('0x34');return db[_0xc30b('0x35')]['destroy']({'where':{'type':_0x5bfb56,'resourceId':_0x73149['id']}})[_0xc30b('0x1d')](function(){return _0x29f205;});})['then'](function(){_0xcaba39[_0xc30b('0x27')](0xcc)[_0xc30b('0x28')]();});}};}function handleEntityNotFound(_0x3018f3,_0x46a81f){return function(_0x25332c){if(!_0x25332c){_0x3018f3['sendStatus'](0x194);}return _0x25332c;};}function handleError(_0x12a2b2,_0x37d3df){_0x37d3df=_0x37d3df||0x1f4;return function(_0x356f1b){logger[_0xc30b('0x22')](_0x356f1b[_0xc30b('0x36')]);if(_0x356f1b['name']){delete _0x356f1b[_0xc30b('0x37')];}_0x12a2b2[_0xc30b('0x27')](_0x37d3df)[_0xc30b('0x38')](_0x356f1b);};}exports['index']=function(_0x48a2ac,_0xefa2f6){var _0x141ec0={},_0x2ec296={},_0x51d0e1={'count':0x0,'rows':[]};var _0x23840d=_[_0xc30b('0x39')](db[_0xc30b('0x3a')][_0xc30b('0x3b')],function(_0x31e444){return{'name':_0x31e444['fieldName'],'type':_0x31e444[_0xc30b('0x3c')][_0xc30b('0x3d')]};});_0x2ec296[_0xc30b('0x3e')]=_[_0xc30b('0x39')](_0x23840d,_0xc30b('0x37'));_0x2ec296[_0xc30b('0x3f')]=_[_0xc30b('0x40')](_0x48a2ac[_0xc30b('0x3f')]);_0x2ec296[_0xc30b('0x41')]=_[_0xc30b('0x42')](_0x2ec296[_0xc30b('0x3e')],_0x2ec296[_0xc30b('0x3f')]);_0x141ec0[_0xc30b('0x43')]=_[_0xc30b('0x42')](_0x2ec296[_0xc30b('0x3e')],qs[_0xc30b('0x44')](_0x48a2ac[_0xc30b('0x3f')][_0xc30b('0x44')]));_0x141ec0[_0xc30b('0x43')]=_0x141ec0[_0xc30b('0x43')][_0xc30b('0x45')]?_0x141ec0[_0xc30b('0x43')]:_0x2ec296[_0xc30b('0x3e')];if(!_0x48a2ac[_0xc30b('0x3f')][_0xc30b('0x46')](_0xc30b('0x47'))){_0x141ec0[_0xc30b('0x2a')]=qs[_0xc30b('0x2a')](_0x48a2ac[_0xc30b('0x3f')][_0xc30b('0x2a')]);_0x141ec0[_0xc30b('0x2d')]=qs['offset'](_0x48a2ac['query'][_0xc30b('0x2d')]);}_0x141ec0[_0xc30b('0x48')]=qs[_0xc30b('0x49')](_0x48a2ac[_0xc30b('0x3f')]['sort']);_0x141ec0[_0xc30b('0x4a')]=qs['filters'](_[_0xc30b('0x4b')](_0x48a2ac[_0xc30b('0x3f')],_0x2ec296[_0xc30b('0x41')]),_0x23840d);if(_0x48a2ac[_0xc30b('0x3f')][_0xc30b('0x4c')]){_0x141ec0[_0xc30b('0x4a')]=_[_0xc30b('0x4d')](_0x141ec0[_0xc30b('0x4a')],{'$or':_[_0xc30b('0x39')](_0x23840d,function(_0x3f1b28){if(_0x3f1b28[_0xc30b('0x3c')]!==_0xc30b('0x4e')){var _0x22c3a5={};_0x22c3a5[_0x3f1b28['name']]={'$like':'%'+_0x48a2ac[_0xc30b('0x3f')]['filter']+'%'};return _0x22c3a5;}})});}_0x141ec0=_[_0xc30b('0x4d')]({},_0x141ec0,_0x48a2ac[_0xc30b('0x4f')]);var _0x5f5de5={'where':_0x141ec0[_0xc30b('0x4a')]};return db[_0xc30b('0x3a')][_0xc30b('0x2c')](_0x5f5de5)['then'](function(_0x437521){_0x51d0e1[_0xc30b('0x2c')]=_0x437521;if(_0x48a2ac[_0xc30b('0x3f')]['includeAll']){_0x141ec0[_0xc30b('0x50')]=[{'all':!![]}];}return db[_0xc30b('0x3a')][_0xc30b('0x51')](_0x141ec0);})[_0xc30b('0x1d')](function(_0x20aa0f){_0x51d0e1[_0xc30b('0x52')]=_0x20aa0f;return _0x51d0e1;})[_0xc30b('0x1d')](respondWithFilteredResult(_0xefa2f6,_0x141ec0))[_0xc30b('0x53')](handleError(_0xefa2f6,null));};exports[_0xc30b('0x54')]=function(_0x54a758,_0x277ab0){var _0x44b2a2={'raw':![],'where':{'id':_0x54a758['params']['id']}},_0x1d3810={};_0x1d3810['model']=_['keys'](db['VoiceContext'][_0xc30b('0x3b')]);_0x1d3810['query']=_[_0xc30b('0x40')](_0x54a758['query']);_0x1d3810[_0xc30b('0x41')]=_['intersection'](_0x1d3810[_0xc30b('0x3e')],_0x1d3810[_0xc30b('0x3f')]);_0x44b2a2[_0xc30b('0x43')]=_['intersection'](_0x1d3810[_0xc30b('0x3e')],qs[_0xc30b('0x44')](_0x54a758['query']['fields']));_0x44b2a2['attributes']=_0x44b2a2[_0xc30b('0x43')][_0xc30b('0x45')]?_0x44b2a2['attributes']:_0x1d3810[_0xc30b('0x3e')];if(_0x54a758[_0xc30b('0x3f')][_0xc30b('0x55')]){_0x44b2a2['include']=[{'all':!![]}];}_0x44b2a2=_[_0xc30b('0x4d')]({},_0x44b2a2,_0x54a758[_0xc30b('0x4f')]);return db[_0xc30b('0x3a')][_0xc30b('0x56')](_0x44b2a2)[_0xc30b('0x1d')](handleEntityNotFound(_0x277ab0,null))[_0xc30b('0x1d')](respondWithResult(_0x277ab0,null))[_0xc30b('0x53')](handleError(_0x277ab0,null));};exports[_0xc30b('0x57')]=function(_0x5ed268,_0x1a7429,_0xbce7f1){var _0x31fb7d;return db['VoiceContext'][_0xc30b('0x57')](_0x5ed268[_0xc30b('0x58')],{'raw':!![]})[_0xc30b('0x1d')](function(_0x133ae1){_0x31fb7d=_0x133ae1;return db[_0xc30b('0x3a')]['findAll']({'raw':!![]});})[_0xc30b('0x1d')](function(_0x439848){var _0xe4fca3=fs['readFileSync'](path['join'](config[_0xc30b('0x59')],_0xc30b('0x5a')),_0xc30b('0x5b'));var _0x26e068=ejs[_0xc30b('0x5c')](_0xe4fca3,{'contexts':_0x439848||[]});fs[_0xc30b('0x5d')](_0xc30b('0x5e'),_0x26e068);})[_0xc30b('0x1d')](function(){return respondWithRpcPromise('Reload',_0xc30b('0x57'),{'module':_0xc30b('0x5f')});})['then'](function(){var _0x38d9a5=_0x5ed268[_0xc30b('0x60')][_0xc30b('0x61')]({'plain':!![]});if(!_0x38d9a5)throw new Error(_0xc30b('0x62'));if(_0x38d9a5['role']===_0xc30b('0x60')){var _0xe2d50d=_0x31fb7d[_0xc30b('0x61')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc30b('0x34'),'userProfileId':_0x38d9a5[_0xc30b('0x63')]},'raw':!![]})[_0xc30b('0x1d')](function(_0x28ecda){if(_0x28ecda&&_0x28ecda[_0xc30b('0x64')]===0x0){return db[_0xc30b('0x35')][_0xc30b('0x57')]({'name':_0xe2d50d[_0xc30b('0x37')],'resourceId':_0xe2d50d['id'],'type':_0x28ecda[_0xc30b('0x37')],'sectionId':_0x28ecda['id']},{})['then'](function(){return _0x31fb7d;});}else{return _0x31fb7d;}})[_0xc30b('0x53')](function(_0x340871){logger[_0xc30b('0x22')](_0xc30b('0x65'),_0x340871);throw _0x340871;});}return _0x31fb7d;})[_0xc30b('0x1d')](respondWithResult(_0x1a7429,0xc9))[_0xc30b('0x53')](handleError(_0x1a7429,null));};exports['update']=function(_0x23be1a,_0x29275f,_0x1dfd04){var _0x143376;return db['VoiceContext'][_0xc30b('0x56')]({'where':{'id':_0x23be1a['params']['id']}})[_0xc30b('0x1d')](handleEntityNotFound(_0x29275f,null))['then'](saveUpdates(_0x23be1a['body'],null))[_0xc30b('0x1d')](function(_0x402127){if(_0x402127){_0x143376=_0x402127;return db['VoiceContext'][_0xc30b('0x51')]({'raw':!![]});}})[_0xc30b('0x1d')](function(_0x3dc2b5){var _0x28f05d=fs[_0xc30b('0x66')](path[_0xc30b('0x67')](config['root'],_0xc30b('0x5a')),'utf8');var _0x4e9117=ejs[_0xc30b('0x5c')](_0x28f05d,{'contexts':_0x3dc2b5||[]});fs[_0xc30b('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4e9117);})[_0xc30b('0x1d')](function(){return respondWithRpcPromise(_0xc30b('0x68'),_0xc30b('0x33'),{'module':_0xc30b('0x5f')});})[_0xc30b('0x1d')](function(){return _0x143376;})['then'](respondWithResult(_0x29275f,null))['catch'](handleError(_0x29275f,null));};exports[_0xc30b('0x69')]=function(_0x1e8e37,_0xfe2868,_0xdf7cc5){var _0xb77236;return db['VoiceContext']['find']({'where':{'id':_0x1e8e37[_0xc30b('0x6a')]['id']}})[_0xc30b('0x1d')](handleEntityNotFound(_0xfe2868,null))['then'](removeEntity(_0xfe2868,null))[_0xc30b('0x1d')](function(){return db[_0xc30b('0x3a')]['findAll']({'raw':!![]});})['then'](function(_0x323d36){var _0xac4395=fs[_0xc30b('0x66')](path[_0xc30b('0x67')](config[_0xc30b('0x59')],'server/files/templates/context.ejs'),_0xc30b('0x5b'));var _0x4d9456=ejs[_0xc30b('0x5c')](_0xac4395,{'contexts':_0x323d36});fs[_0xc30b('0x5d')](_0xc30b('0x5e'),_0x4d9456);return respondWithRpcPromise(_0xc30b('0x68'),'destroy',{'module':_0xc30b('0x5f')});})[_0xc30b('0x53')](handleError(_0xfe2868,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c1c4973..ee64c02 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 _0x717b=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','voice_contexts','lodash','../../config/logger','api','moment'];(function(_0x13708b,_0x2f71bc){var _0x1d7510=function(_0x36a2e9){while(--_0x36a2e9){_0x13708b['push'](_0x13708b['shift']());}};_0x1d7510(++_0x2f71bc);}(_0x717b,0x6a));var _0xb717=function(_0x5ab4e4,_0x34ace8){_0x5ab4e4=_0x5ab4e4-0x0;var _0x3848ec=_0x717b[_0x5ab4e4];return _0x3848ec;};'use strict';var _=require(_0xb717('0x0'));var util=require('util');var logger=require(_0xb717('0x1'))(_0xb717('0x2'));var moment=require(_0xb717('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb717('0x4'));var rimraf=require(_0xb717('0x5'));var config=require(_0xb717('0x6'));var attributes=require(_0xb717('0x7'));module[_0xb717('0x8')]=function(_0x50837c,_0x11fdf5){return _0x50837c['define']('VoiceContext',attributes,{'tableName':_0xb717('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cec=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x264c37,_0x2357f6){var _0x3b85c0=function(_0x53bd50){while(--_0x53bd50){_0x264c37['push'](_0x264c37['shift']());}};_0x3b85c0(++_0x2357f6);}(_0x7cec,0x102));var _0xc7ce=function(_0x20e2f5,_0x3bba70){_0x20e2f5=_0x20e2f5-0x0;var _0x348b98=_0x7cec[_0x20e2f5];return _0x348b98;};'use strict';var _=require(_0xc7ce('0x0'));var util=require(_0xc7ce('0x1'));var logger=require(_0xc7ce('0x2'))(_0xc7ce('0x3'));var moment=require('moment');var BPromise=require(_0xc7ce('0x4'));var rp=require(_0xc7ce('0x5'));var fs=require('fs');var path=require(_0xc7ce('0x6'));var rimraf=require(_0xc7ce('0x7'));var config=require(_0xc7ce('0x8'));var attributes=require(_0xc7ce('0x9'));module[_0xc7ce('0xa')]=function(_0x521b16,_0x531777){return _0x521b16[_0xc7ce('0xb')](_0xc7ce('0xc'),attributes,{'tableName':_0xc7ce('0xd'),'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 c146a8e..f196908 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 _0x5761=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2cf505,_0x1f36a4){var _0x20159b=function(_0x8a74c0){while(--_0x8a74c0){_0x2cf505['push'](_0x2cf505['shift']());}};_0x20159b(++_0x1f36a4);}(_0x5761,0x107));var _0x1576=function(_0x32d0b5,_0x3004e0){_0x32d0b5=_0x32d0b5-0x0;var _0x3f3d82=_0x5761[_0x32d0b5];return _0x3f3d82;};'use strict';var _=require(_0x1576('0x0'));var util=require(_0x1576('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1576('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1576('0x3'))['db'];var utils=require(_0x1576('0x4'));var logger=require(_0x1576('0x5'))(_0x1576('0x6'));var config=require(_0x1576('0x7'));var jayson=require(_0x1576('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30f503,_0x21d3bd,_0x229cee){return new BPromise(function(_0x1f814b,_0x5ab69b){return client[_0x1576('0x9')](_0x30f503,_0x229cee)[_0x1576('0xa')](function(_0x561917){logger[_0x1576('0xb')]('VoiceContext,\x20%s,\x20%s',_0x21d3bd,'request\x20sent');logger[_0x1576('0xc')](_0x1576('0xd'),_0x21d3bd,_0x1576('0xe'),JSON[_0x1576('0xf')](_0x561917));if(_0x561917[_0x1576('0x10')]){if(_0x561917['error'][_0x1576('0x11')]===0x1f4){logger['error'](_0x1576('0x12'),_0x21d3bd,_0x561917[_0x1576('0x10')][_0x1576('0x13')]);return _0x5ab69b(_0x561917[_0x1576('0x10')][_0x1576('0x13')]);}logger[_0x1576('0x10')](_0x1576('0x12'),_0x21d3bd,_0x561917[_0x1576('0x10')][_0x1576('0x13')]);return _0x1f814b(_0x561917['error'][_0x1576('0x13')]);}else{logger['info'](_0x1576('0x12'),_0x21d3bd,_0x1576('0xe'));_0x1f814b(_0x561917[_0x1576('0x14')][_0x1576('0x13')]);}})[_0x1576('0x15')](function(_0x288749){logger['error'](_0x1576('0x12'),_0x21d3bd,_0x288749);_0x5ab69b(_0x288749);});});} \ No newline at end of file +var _0x7269=['VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1ccc6e,_0x145452){var _0x19f0e7=function(_0x3610ff){while(--_0x3610ff){_0x1ccc6e['push'](_0x1ccc6e['shift']());}};_0x19f0e7(++_0x145452);}(_0x7269,0x76));var _0x9726=function(_0x195cff,_0x115f60){_0x195cff=_0x195cff-0x0;var _0x278419=_0x7269[_0x195cff];return _0x278419;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var moment=require(_0x9726('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9726('0x3'));var db=require(_0x9726('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9726('0x5'))(_0x9726('0x6'));var config=require(_0x9726('0x7'));var jayson=require(_0x9726('0x8'));var client=jayson[_0x9726('0x9')][_0x9726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1982d3,_0x381bb2,_0x1a5e03){return new BPromise(function(_0x494854,_0xcbdb72){return client['request'](_0x1982d3,_0x1a5e03)[_0x9726('0xb')](function(_0x3e72b0){logger[_0x9726('0xc')]('VoiceContext,\x20%s,\x20%s',_0x381bb2,_0x9726('0xd'));logger[_0x9726('0xe')](_0x9726('0xf'),_0x381bb2,'request\x20sent',JSON[_0x9726('0x10')](_0x3e72b0));if(_0x3e72b0[_0x9726('0x11')]){if(_0x3e72b0[_0x9726('0x11')][_0x9726('0x12')]===0x1f4){logger[_0x9726('0x11')]('VoiceContext,\x20%s,\x20%s',_0x381bb2,_0x3e72b0['error'][_0x9726('0x13')]);return _0xcbdb72(_0x3e72b0[_0x9726('0x11')]['message']);}logger[_0x9726('0x11')](_0x9726('0x14'),_0x381bb2,_0x3e72b0[_0x9726('0x11')][_0x9726('0x13')]);return _0x494854(_0x3e72b0['error'][_0x9726('0x13')]);}else{logger[_0x9726('0xc')](_0x9726('0x14'),_0x381bb2,_0x9726('0xd'));_0x494854(_0x3e72b0[_0x9726('0x15')][_0x9726('0x13')]);}})[_0x9726('0x16')](function(_0x235beb){logger['error'](_0x9726('0x14'),_0x381bb2,_0x235beb);_0xcbdb72(_0x235beb);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 74f311f..38223b6 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 _0x951c=['/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x41d205,_0x4f9229){var _0x3cd557=function(_0x3d3c6d){while(--_0x3d3c6d){_0x41d205['push'](_0x41d205['shift']());}};_0x3cd557(++_0x4f9229);}(_0x951c,0x71));var _0xc951=function(_0xd6a9c4,_0x2286ec){_0xd6a9c4=_0xd6a9c4-0x0;var _0x2f5110=_0x951c[_0xd6a9c4];return _0x2f5110;};'use strict';var multer=require('multer');var util=require(_0xc951('0x0'));var path=require('path');var timeout=require(_0xc951('0x1'));var express=require(_0xc951('0x2'));var router=express['Router']();var fs_extra=require(_0xc951('0x3'));var auth=require(_0xc951('0x4'));var interaction=require(_0xc951('0x5'));var config=require(_0xc951('0x6'));var controller=require(_0xc951('0x7'));router[_0xc951('0x8')]('/',auth[_0xc951('0x9')](),controller[_0xc951('0xa')]);router[_0xc951('0x8')](_0xc951('0xb'),auth[_0xc951('0x9')](),controller[_0xc951('0xc')]);router['get'](_0xc951('0xd'),auth['isAuthenticated'](),controller[_0xc951('0xe')]);router[_0xc951('0xf')]('/',auth['isAuthenticated'](),controller[_0xc951('0x10')]);router[_0xc951('0x11')](_0xc951('0xd'),auth['isAuthenticated'](),controller[_0xc951('0x12')]);router[_0xc951('0x13')](_0xc951('0xd'),auth[_0xc951('0x9')](),controller['destroy']);module[_0xc951('0x14')]=router; \ No newline at end of file +var _0x510c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','update','delete','multer'];(function(_0x337878,_0x3abab3){var _0x2b3d30=function(_0x16bf8c){while(--_0x16bf8c){_0x337878['push'](_0x337878['shift']());}};_0x2b3d30(++_0x3abab3);}(_0x510c,0x117));var _0xc510=function(_0x27fc55,_0x244585){_0x27fc55=_0x27fc55-0x0;var _0x3c26f4=_0x510c[_0x27fc55];return _0x3c26f4;};'use strict';var multer=require(_0xc510('0x0'));var util=require(_0xc510('0x1'));var path=require(_0xc510('0x2'));var timeout=require(_0xc510('0x3'));var express=require(_0xc510('0x4'));var router=express[_0xc510('0x5')]();var fs_extra=require(_0xc510('0x6'));var auth=require(_0xc510('0x7'));var interaction=require(_0xc510('0x8'));var config=require(_0xc510('0x9'));var controller=require(_0xc510('0xa'));router[_0xc510('0xb')]('/',auth[_0xc510('0xc')](),controller[_0xc510('0xd')]);router[_0xc510('0xb')](_0xc510('0xe'),auth[_0xc510('0xc')](),controller[_0xc510('0xf')]);router[_0xc510('0xb')](_0xc510('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xc510('0x11')]('/',auth[_0xc510('0xc')](),controller['create']);router['put'](_0xc510('0x10'),auth[_0xc510('0xc')](),controller[_0xc510('0x12')]);router[_0xc510('0x13')](_0xc510('0x10'),auth[_0xc510('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a3843be..59bea9f 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 _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0xe14d,0x1ee));var _0xde14=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xe14d[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0685e6c..8ca6cdf 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 _0xd41a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','Content-Range','reject','update','destroy','sendStatus','error','stack','name','send','VoiceDialReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','count','includeAll','include','then','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x7e8311,_0x4574f2){var _0x800cc1=function(_0x1582cc){while(--_0x1582cc){_0x7e8311['push'](_0x7e8311['shift']());}};_0x800cc1(++_0x4574f2);}(_0xd41a,0x102));var _0xad41=function(_0x21a8ba,_0x2b09e1){_0x21a8ba=_0x21a8ba-0x0;var _0x1da12a=_0xd41a[_0x21a8ba];return _0x1da12a;};'use strict';var emlformat=require(_0xad41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad41('0x1'));var jsonpatch=require(_0xad41('0x2'));var rp=require(_0xad41('0x3'));var moment=require(_0xad41('0x4'));var BPromise=require(_0xad41('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xad41('0x6'));var sox=require('sox');var csv=require(_0xad41('0x7'));var ejs=require(_0xad41('0x8'));var fs=require('fs');var fs_extra=require(_0xad41('0x9'));var _=require('lodash');var squel=require(_0xad41('0xa'));var crypto=require(_0xad41('0xb'));var jsforce=require(_0xad41('0xc'));var deskjs=require(_0xad41('0xd'));var toCsv=require(_0xad41('0x7'));var querystring=require(_0xad41('0xe'));var Papa=require('papaparse');var Redis=require(_0xad41('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xad41('0x10'));var as=require(_0xad41('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad41('0x12'))(_0xad41('0x13'));var utils=require(_0xad41('0x14'));var config=require(_0xad41('0x15'));var licenseUtil=require(_0xad41('0x16'));var db=require(_0xad41('0x17'))['db'];function respondWithStatusCode(_0x19f0a3,_0x4fd36a){_0x4fd36a=_0x4fd36a||0xcc;return function(_0x15e423){if(_0x15e423){return _0x19f0a3['sendStatus'](_0x4fd36a);}return _0x19f0a3[_0xad41('0x18')](_0x4fd36a)[_0xad41('0x19')]();};}function respondWithResult(_0x221568,_0x51d3a3){_0x51d3a3=_0x51d3a3||0xc8;return function(_0x382cf0){if(_0x382cf0){return _0x221568[_0xad41('0x18')](_0x51d3a3)[_0xad41('0x1a')](_0x382cf0);}};}function respondWithFilteredResult(_0xfb5d32,_0x285bba){return function(_0x223c4d){if(_0x223c4d){var _0x4a4b1f=typeof _0x285bba['offset']===_0xad41('0x1b')&&typeof _0x285bba['limit']==='undefined';var _0x36a798=_0x223c4d['count'];var _0x5e668f=_0x4a4b1f?0x0:_0x285bba[_0xad41('0x1c')];var _0x52087f=_0x4a4b1f?_0x223c4d['count']:_0x285bba[_0xad41('0x1c')]+_0x285bba[_0xad41('0x1d')];var _0x156a31;if(_0x52087f>=_0x36a798){_0x52087f=_0x36a798;_0x156a31=0xc8;}else{_0x156a31=0xce;}_0xfb5d32[_0xad41('0x18')](_0x156a31);return _0xfb5d32['set'](_0xad41('0x1e'),_0x5e668f+'-'+_0x52087f+'/'+_0x36a798)[_0xad41('0x1a')](_0x223c4d);}return null;};}function patchUpdates(_0x2d54ad){return function(_0x2ad25c){try{jsonpatch['apply'](_0x2ad25c,_0x2d54ad,!![]);}catch(_0x2c4e6f){return BPromise[_0xad41('0x1f')](_0x2c4e6f);}return _0x2ad25c['save']();};}function saveUpdates(_0x1f40de,_0x154932){return function(_0xa05af4){if(_0xa05af4){return _0xa05af4[_0xad41('0x20')](_0x1f40de)['then'](function(_0x4d31ff){return _0x4d31ff;});}return null;};}function removeEntity(_0x31fb89,_0xa0b204){return function(_0x4b9c08){if(_0x4b9c08){return _0x4b9c08[_0xad41('0x21')]()['then'](function(){_0x31fb89[_0xad41('0x18')](0xcc)[_0xad41('0x19')]();});}};}function handleEntityNotFound(_0x3b1f8d,_0x6f4d06){return function(_0x3b3870){if(!_0x3b3870){_0x3b1f8d[_0xad41('0x22')](0x194);}return _0x3b3870;};}function handleError(_0x425945,_0xbd9766){_0xbd9766=_0xbd9766||0x1f4;return function(_0x25c099){logger[_0xad41('0x23')](_0x25c099[_0xad41('0x24')]);if(_0x25c099[_0xad41('0x25')]){delete _0x25c099['name'];}_0x425945['status'](_0xbd9766)[_0xad41('0x26')](_0x25c099);};}exports['index']=function(_0x5c23a1,_0x1d0340){var _0x573b7b={},_0x37d208={},_0x556f78={'count':0x0,'rows':[]};var _0x23dfdb=_['map'](db[_0xad41('0x27')][_0xad41('0x28')],function(_0x4b0e99){return{'name':_0x4b0e99['fieldName'],'type':_0x4b0e99[_0xad41('0x29')][_0xad41('0x2a')]};});_0x37d208[_0xad41('0x2b')]=_[_0xad41('0x2c')](_0x23dfdb,_0xad41('0x25'));_0x37d208[_0xad41('0x2d')]=_[_0xad41('0x2e')](_0x5c23a1[_0xad41('0x2d')]);_0x37d208[_0xad41('0x2f')]=_[_0xad41('0x30')](_0x37d208[_0xad41('0x2b')],_0x37d208['query']);_0x573b7b[_0xad41('0x31')]=_['intersection'](_0x37d208[_0xad41('0x2b')],qs[_0xad41('0x32')](_0x5c23a1[_0xad41('0x2d')][_0xad41('0x32')]));_0x573b7b[_0xad41('0x31')]=_0x573b7b['attributes']['length']?_0x573b7b['attributes']:_0x37d208[_0xad41('0x2b')];if(!_0x5c23a1[_0xad41('0x2d')][_0xad41('0x33')]('nolimit')){_0x573b7b[_0xad41('0x1d')]=qs[_0xad41('0x1d')](_0x5c23a1['query']['limit']);_0x573b7b[_0xad41('0x1c')]=qs[_0xad41('0x1c')](_0x5c23a1['query'][_0xad41('0x1c')]);}_0x573b7b['order']=qs['sort'](_0x5c23a1[_0xad41('0x2d')][_0xad41('0x34')]);_0x573b7b[_0xad41('0x35')]=qs[_0xad41('0x2f')](_['pick'](_0x5c23a1['query'],_0x37d208[_0xad41('0x2f')]),_0x23dfdb);if(_0x5c23a1['query'][_0xad41('0x36')]){_0x573b7b['where']=_[_0xad41('0x37')](_0x573b7b['where'],{'$or':_[_0xad41('0x2c')](_0x23dfdb,function(_0x4fcf9f){if(_0x4fcf9f['type']!=='VIRTUAL'){var _0x3d78b0={};_0x3d78b0[_0x4fcf9f[_0xad41('0x25')]]={'$like':'%'+_0x5c23a1['query'][_0xad41('0x36')]+'%'};return _0x3d78b0;}})});}_0x573b7b=_[_0xad41('0x37')]({},_0x573b7b,_0x5c23a1[_0xad41('0x38')]);var _0x2bca74={'where':_0x573b7b[_0xad41('0x35')]};return db[_0xad41('0x27')][_0xad41('0x39')](_0x2bca74)['then'](function(_0x32cc36){_0x556f78['count']=_0x32cc36;if(_0x5c23a1[_0xad41('0x2d')][_0xad41('0x3a')]){_0x573b7b[_0xad41('0x3b')]=[{'all':!![]}];}return db[_0xad41('0x27')]['findAll'](_0x573b7b);})[_0xad41('0x3c')](function(_0x35bc10){_0x556f78['rows']=_0x35bc10;return _0x556f78;})[_0xad41('0x3c')](respondWithFilteredResult(_0x1d0340,_0x573b7b))[_0xad41('0x3d')](handleError(_0x1d0340,null));};exports[_0xad41('0x3e')]=function(_0x48f354,_0x52a14f){var _0x113ef1={'raw':!![],'where':{'id':_0x48f354[_0xad41('0x3f')]['id']}},_0x16f245={};_0x16f245['model']=_[_0xad41('0x2e')](db[_0xad41('0x27')][_0xad41('0x28')]);_0x16f245[_0xad41('0x2d')]=_[_0xad41('0x2e')](_0x48f354['query']);_0x16f245['filters']=_['intersection'](_0x16f245[_0xad41('0x2b')],_0x16f245['query']);_0x113ef1[_0xad41('0x31')]=_[_0xad41('0x30')](_0x16f245[_0xad41('0x2b')],qs['fields'](_0x48f354[_0xad41('0x2d')][_0xad41('0x32')]));_0x113ef1[_0xad41('0x31')]=_0x113ef1[_0xad41('0x31')][_0xad41('0x40')]?_0x113ef1[_0xad41('0x31')]:_0x16f245[_0xad41('0x2b')];if(_0x48f354[_0xad41('0x2d')][_0xad41('0x3a')]){_0x113ef1['include']=[{'all':!![]}];}_0x113ef1=_[_0xad41('0x37')]({},_0x113ef1,_0x48f354['options']);return db[_0xad41('0x27')][_0xad41('0x41')](_0x113ef1)[_0xad41('0x3c')](handleEntityNotFound(_0x52a14f,null))[_0xad41('0x3c')](respondWithResult(_0x52a14f,null))[_0xad41('0x3d')](handleError(_0x52a14f,null));};exports[_0xad41('0x42')]=function(_0x23f142,_0x1578d4){return db[_0xad41('0x27')][_0xad41('0x42')](_0x23f142[_0xad41('0x43')],{})[_0xad41('0x3c')](respondWithResult(_0x1578d4,0xc9))[_0xad41('0x3d')](handleError(_0x1578d4,null));};exports['update']=function(_0x522e97,_0x232ca2){if(_0x522e97['body']['id']){delete _0x522e97[_0xad41('0x43')]['id'];}return db['VoiceDialReport'][_0xad41('0x41')]({'where':{'id':_0x522e97[_0xad41('0x3f')]['id']}})[_0xad41('0x3c')](handleEntityNotFound(_0x232ca2,null))[_0xad41('0x3c')](saveUpdates(_0x522e97[_0xad41('0x43')],null))[_0xad41('0x3c')](respondWithResult(_0x232ca2,null))['catch'](handleError(_0x232ca2,null));};exports['destroy']=function(_0x52d39e,_0x2a48da){return db[_0xad41('0x27')]['find']({'where':{'id':_0x52d39e['params']['id']}})[_0xad41('0x3c')](handleEntityNotFound(_0x2a48da,null))[_0xad41('0x3c')](removeEntity(_0x2a48da,null))[_0xad41('0x3d')](handleError(_0x2a48da,null));};exports[_0xad41('0x44')]=function(_0x447c31,_0x4aac12){return db['VoiceDialReport'][_0xad41('0x44')]()['then'](respondWithResult(_0x4aac12,null))[_0xad41('0x3d')](handleError(_0x4aac12,null));}; \ No newline at end of file +var _0xf7ba=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf7ba,0x12a));var _0xaf7b=function(_0x1671c4,_0x31b1cc){_0x1671c4=_0x1671c4-0x0;var _0x1fddd8=_0xf7ba[_0x1671c4];return _0x1fddd8;};'use strict';var emlformat=require(_0xaf7b('0x0'));var rimraf=require(_0xaf7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf7b('0x2'));var rp=require(_0xaf7b('0x3'));var moment=require(_0xaf7b('0x4'));var BPromise=require(_0xaf7b('0x5'));var Mustache=require('mustache');var util=require(_0xaf7b('0x6'));var path=require(_0xaf7b('0x7'));var sox=require(_0xaf7b('0x8'));var csv=require('to-csv');var ejs=require(_0xaf7b('0x9'));var fs=require('fs');var fs_extra=require(_0xaf7b('0xa'));var _=require(_0xaf7b('0xb'));var squel=require(_0xaf7b('0xc'));var crypto=require('crypto');var jsforce=require(_0xaf7b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf7b('0xe'));var Papa=require(_0xaf7b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaf7b('0x10'));var as=require(_0xaf7b('0x11'));var hardwareService=require(_0xaf7b('0x12'));var logger=require('../../config/logger')(_0xaf7b('0x13'));var utils=require(_0xaf7b('0x14'));var config=require(_0xaf7b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf7b('0x16'))['db'];function respondWithStatusCode(_0x1b5d98,_0x3c9d39){_0x3c9d39=_0x3c9d39||0xcc;return function(_0x530a8d){if(_0x530a8d){return _0x1b5d98[_0xaf7b('0x17')](_0x3c9d39);}return _0x1b5d98['status'](_0x3c9d39)[_0xaf7b('0x18')]();};}function respondWithResult(_0x4665ee,_0x294717){_0x294717=_0x294717||0xc8;return function(_0x4f19d2){if(_0x4f19d2){return _0x4665ee[_0xaf7b('0x19')](_0x294717)[_0xaf7b('0x1a')](_0x4f19d2);}};}function respondWithFilteredResult(_0x2d4034,_0x4ae735){return function(_0x5d8186){if(_0x5d8186){var _0x12eeea=typeof _0x4ae735[_0xaf7b('0x1b')]===_0xaf7b('0x1c')&&typeof _0x4ae735[_0xaf7b('0x1d')]===_0xaf7b('0x1c');var _0xbb949=_0x5d8186[_0xaf7b('0x1e')];var _0x1c1be7=_0x12eeea?0x0:_0x4ae735['offset'];var _0x474549=_0x12eeea?_0x5d8186[_0xaf7b('0x1e')]:_0x4ae735[_0xaf7b('0x1b')]+_0x4ae735[_0xaf7b('0x1d')];var _0x1d3611;if(_0x474549>=_0xbb949){_0x474549=_0xbb949;_0x1d3611=0xc8;}else{_0x1d3611=0xce;}_0x2d4034[_0xaf7b('0x19')](_0x1d3611);return _0x2d4034[_0xaf7b('0x1f')](_0xaf7b('0x20'),_0x1c1be7+'-'+_0x474549+'/'+_0xbb949)[_0xaf7b('0x1a')](_0x5d8186);}return null;};}function patchUpdates(_0x2330ce){return function(_0x15e6a7){try{jsonpatch[_0xaf7b('0x21')](_0x15e6a7,_0x2330ce,!![]);}catch(_0x6b52df){return BPromise[_0xaf7b('0x22')](_0x6b52df);}return _0x15e6a7[_0xaf7b('0x23')]();};}function saveUpdates(_0xe20c18,_0x4cc005){return function(_0x58dbcc){if(_0x58dbcc){return _0x58dbcc[_0xaf7b('0x24')](_0xe20c18)[_0xaf7b('0x25')](function(_0x441ff3){return _0x441ff3;});}return null;};}function removeEntity(_0xfe74b,_0x42fc66){return function(_0x10f532){if(_0x10f532){return _0x10f532[_0xaf7b('0x26')]()[_0xaf7b('0x25')](function(){_0xfe74b[_0xaf7b('0x19')](0xcc)[_0xaf7b('0x18')]();});}};}function handleEntityNotFound(_0x1ed3ab,_0x37f971){return function(_0x2f5c80){if(!_0x2f5c80){_0x1ed3ab[_0xaf7b('0x17')](0x194);}return _0x2f5c80;};}function handleError(_0x18fe52,_0x5e99db){_0x5e99db=_0x5e99db||0x1f4;return function(_0x3c1350){logger[_0xaf7b('0x27')](_0x3c1350[_0xaf7b('0x28')]);if(_0x3c1350[_0xaf7b('0x29')]){delete _0x3c1350[_0xaf7b('0x29')];}_0x18fe52[_0xaf7b('0x19')](_0x5e99db)[_0xaf7b('0x2a')](_0x3c1350);};}exports[_0xaf7b('0x2b')]=function(_0x45969d,_0xf211b1){var _0x24094c={},_0x4c4cf1={},_0x2566c6={'count':0x0,'rows':[]};var _0x414004=_[_0xaf7b('0x2c')](db['VoiceDialReport'][_0xaf7b('0x2d')],function(_0x55c9f4){return{'name':_0x55c9f4[_0xaf7b('0x2e')],'type':_0x55c9f4[_0xaf7b('0x2f')][_0xaf7b('0x30')]};});_0x4c4cf1[_0xaf7b('0x31')]=_[_0xaf7b('0x2c')](_0x414004,'name');_0x4c4cf1[_0xaf7b('0x32')]=_[_0xaf7b('0x33')](_0x45969d[_0xaf7b('0x32')]);_0x4c4cf1[_0xaf7b('0x34')]=_[_0xaf7b('0x35')](_0x4c4cf1[_0xaf7b('0x31')],_0x4c4cf1[_0xaf7b('0x32')]);_0x24094c[_0xaf7b('0x36')]=_['intersection'](_0x4c4cf1[_0xaf7b('0x31')],qs[_0xaf7b('0x37')](_0x45969d['query'][_0xaf7b('0x37')]));_0x24094c[_0xaf7b('0x36')]=_0x24094c[_0xaf7b('0x36')][_0xaf7b('0x38')]?_0x24094c[_0xaf7b('0x36')]:_0x4c4cf1[_0xaf7b('0x31')];if(!_0x45969d[_0xaf7b('0x32')][_0xaf7b('0x39')](_0xaf7b('0x3a'))){_0x24094c[_0xaf7b('0x1d')]=qs[_0xaf7b('0x1d')](_0x45969d[_0xaf7b('0x32')]['limit']);_0x24094c[_0xaf7b('0x1b')]=qs['offset'](_0x45969d['query']['offset']);}_0x24094c[_0xaf7b('0x3b')]=qs[_0xaf7b('0x3c')](_0x45969d[_0xaf7b('0x32')][_0xaf7b('0x3c')]);_0x24094c[_0xaf7b('0x3d')]=qs[_0xaf7b('0x34')](_[_0xaf7b('0x3e')](_0x45969d['query'],_0x4c4cf1[_0xaf7b('0x34')]),_0x414004);if(_0x45969d[_0xaf7b('0x32')][_0xaf7b('0x3f')]){_0x24094c['where']=_[_0xaf7b('0x40')](_0x24094c[_0xaf7b('0x3d')],{'$or':_['map'](_0x414004,function(_0x393adc){if(_0x393adc[_0xaf7b('0x2f')]!=='VIRTUAL'){var _0x3cc900={};_0x3cc900[_0x393adc['name']]={'$like':'%'+_0x45969d[_0xaf7b('0x32')][_0xaf7b('0x3f')]+'%'};return _0x3cc900;}})});}_0x24094c=_[_0xaf7b('0x40')]({},_0x24094c,_0x45969d[_0xaf7b('0x41')]);var _0x3bb4cc={'where':_0x24094c[_0xaf7b('0x3d')]};return db[_0xaf7b('0x42')]['count'](_0x3bb4cc)[_0xaf7b('0x25')](function(_0x198dd3){_0x2566c6[_0xaf7b('0x1e')]=_0x198dd3;if(_0x45969d[_0xaf7b('0x32')][_0xaf7b('0x43')]){_0x24094c[_0xaf7b('0x44')]=[{'all':!![]}];}return db[_0xaf7b('0x42')][_0xaf7b('0x45')](_0x24094c);})[_0xaf7b('0x25')](function(_0x1c7293){_0x2566c6[_0xaf7b('0x46')]=_0x1c7293;return _0x2566c6;})[_0xaf7b('0x25')](respondWithFilteredResult(_0xf211b1,_0x24094c))[_0xaf7b('0x47')](handleError(_0xf211b1,null));};exports[_0xaf7b('0x48')]=function(_0x2e832e,_0x2485ac){var _0x19add6={'raw':!![],'where':{'id':_0x2e832e[_0xaf7b('0x49')]['id']}},_0x57c714={};_0x57c714[_0xaf7b('0x31')]=_[_0xaf7b('0x33')](db[_0xaf7b('0x42')][_0xaf7b('0x2d')]);_0x57c714[_0xaf7b('0x32')]=_['keys'](_0x2e832e['query']);_0x57c714['filters']=_[_0xaf7b('0x35')](_0x57c714['model'],_0x57c714['query']);_0x19add6[_0xaf7b('0x36')]=_[_0xaf7b('0x35')](_0x57c714[_0xaf7b('0x31')],qs[_0xaf7b('0x37')](_0x2e832e[_0xaf7b('0x32')][_0xaf7b('0x37')]));_0x19add6[_0xaf7b('0x36')]=_0x19add6['attributes']['length']?_0x19add6[_0xaf7b('0x36')]:_0x57c714[_0xaf7b('0x31')];if(_0x2e832e[_0xaf7b('0x32')][_0xaf7b('0x43')]){_0x19add6[_0xaf7b('0x44')]=[{'all':!![]}];}_0x19add6=_['merge']({},_0x19add6,_0x2e832e[_0xaf7b('0x41')]);return db[_0xaf7b('0x42')]['find'](_0x19add6)['then'](handleEntityNotFound(_0x2485ac,null))[_0xaf7b('0x25')](respondWithResult(_0x2485ac,null))['catch'](handleError(_0x2485ac,null));};exports[_0xaf7b('0x4a')]=function(_0x2c766b,_0x572d6f){return db[_0xaf7b('0x42')]['create'](_0x2c766b[_0xaf7b('0x4b')],{})[_0xaf7b('0x25')](respondWithResult(_0x572d6f,0xc9))['catch'](handleError(_0x572d6f,null));};exports['update']=function(_0x52a7c1,_0x1771f4){if(_0x52a7c1[_0xaf7b('0x4b')]['id']){delete _0x52a7c1[_0xaf7b('0x4b')]['id'];}return db[_0xaf7b('0x42')][_0xaf7b('0x4c')]({'where':{'id':_0x52a7c1[_0xaf7b('0x49')]['id']}})[_0xaf7b('0x25')](handleEntityNotFound(_0x1771f4,null))[_0xaf7b('0x25')](saveUpdates(_0x52a7c1[_0xaf7b('0x4b')],null))[_0xaf7b('0x25')](respondWithResult(_0x1771f4,null))[_0xaf7b('0x47')](handleError(_0x1771f4,null));};exports[_0xaf7b('0x26')]=function(_0x5f3e,_0x3115d6){return db[_0xaf7b('0x42')][_0xaf7b('0x4c')]({'where':{'id':_0x5f3e['params']['id']}})[_0xaf7b('0x25')](handleEntityNotFound(_0x3115d6,null))[_0xaf7b('0x25')](removeEntity(_0x3115d6,null))[_0xaf7b('0x47')](handleError(_0x3115d6,null));};exports[_0xaf7b('0x4d')]=function(_0x120020,_0x46a172){return db[_0xaf7b('0x42')][_0xaf7b('0x4d')]()[_0xaf7b('0x25')](respondWithResult(_0x46a172,null))[_0xaf7b('0x47')](handleError(_0x46a172,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index dd25f13..ae1e032 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 _0x0795=['bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4ab19f,_0x327fca){var _0x4bfcd3=function(_0x2bbe4e){while(--_0x2bbe4e){_0x4ab19f['push'](_0x4ab19f['shift']());}};_0x4bfcd3(++_0x327fca);}(_0x0795,0x14e));var _0x5079=function(_0x59ac66,_0x233ec3){_0x59ac66=_0x59ac66-0x0;var _0x38a3e2=_0x0795[_0x59ac66];return _0x38a3e2;};'use strict';var _=require(_0x5079('0x0'));var util=require(_0x5079('0x1'));var logger=require(_0x5079('0x2'))(_0x5079('0x3'));var moment=require('moment');var BPromise=require(_0x5079('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5079('0x5'));var rimraf=require(_0x5079('0x6'));var config=require(_0x5079('0x7'));var attributes=require(_0x5079('0x8'));module['exports']=function(_0x3a9728,_0x25ad9d){return _0x3a9728[_0x5079('0x9')](_0x5079('0xa'),attributes,{'tableName':_0x5079('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5079('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37cc=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash'];(function(_0x6eb7b,_0x3ba1c0){var _0x1d687d=function(_0x682669){while(--_0x682669){_0x6eb7b['push'](_0x6eb7b['shift']());}};_0x1d687d(++_0x3ba1c0);}(_0x37cc,0x185));var _0xc37c=function(_0x41a58f,_0x507593){_0x41a58f=_0x41a58f-0x0;var _0x138039=_0x37cc[_0x41a58f];return _0x138039;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var logger=require(_0xc37c('0x2'))(_0xc37c('0x3'));var moment=require(_0xc37c('0x4'));var BPromise=require(_0xc37c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var attributes=require(_0xc37c('0x8'));module[_0xc37c('0x9')]=function(_0x4c9dcd,_0x582100){return _0x4c9dcd[_0xc37c('0xa')](_0xc37c('0xb'),attributes,{'tableName':_0xc37c('0xc'),'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 a8dbc0a..b98b528 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 _0xb545=['jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x159ac6,_0x247777){var _0x45433e=function(_0x31caa9){while(--_0x31caa9){_0x159ac6['push'](_0x159ac6['shift']());}};_0x45433e(++_0x247777);}(_0xb545,0xe0));var _0x5b54=function(_0x335c56,_0x5af892){_0x335c56=_0x335c56-0x0;var _0x312817=_0xb545[_0x335c56];return _0x312817;};'use strict';var _=require(_0x5b54('0x0'));var util=require('util');var moment=require(_0x5b54('0x1'));var BPromise=require(_0x5b54('0x2'));var rs=require(_0x5b54('0x3'));var fs=require('fs');var Redis=require(_0x5b54('0x4'));var db=require(_0x5b54('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b54('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b54('0x7'));var client=jayson[_0x5b54('0x8')][_0x5b54('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ea638,_0x4bd482,_0x465d16){return new BPromise(function(_0x203e72,_0x16b0fe){return client[_0x5b54('0xa')](_0x1ea638,_0x465d16)[_0x5b54('0xb')](function(_0xae9954){logger[_0x5b54('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x4bd482,_0x5b54('0xd'));logger[_0x5b54('0xe')](_0x5b54('0xf'),_0x4bd482,'request\x20sent',JSON[_0x5b54('0x10')](_0xae9954));if(_0xae9954[_0x5b54('0x11')]){if(_0xae9954[_0x5b54('0x11')][_0x5b54('0x12')]===0x1f4){logger['error'](_0x5b54('0x13'),_0x4bd482,_0xae9954[_0x5b54('0x11')][_0x5b54('0x14')]);return _0x16b0fe(_0xae9954[_0x5b54('0x11')]['message']);}logger[_0x5b54('0x11')](_0x5b54('0x13'),_0x4bd482,_0xae9954[_0x5b54('0x11')][_0x5b54('0x14')]);return _0x203e72(_0xae9954['error'][_0x5b54('0x14')]);}else{logger['info'](_0x5b54('0x13'),_0x4bd482,_0x5b54('0xd'));_0x203e72(_0xae9954[_0x5b54('0x15')][_0x5b54('0x14')]);}})[_0x5b54('0x16')](function(_0x9def9e){logger[_0x5b54('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x4bd482,_0x9def9e);_0x16b0fe(_0x9def9e);});});}exports[_0x5b54('0x17')]=function(_0x37cbbd){var _0x239334=this;return new Promise(function(_0x4d4feb,_0x33c0b5){return db[_0x5b54('0x18')]['create'](_0x37cbbd[_0x5b54('0x19')],{'raw':_0x37cbbd[_0x5b54('0x1a')]?_0x37cbbd[_0x5b54('0x1a')][_0x5b54('0x1b')]===undefined?!![]:![]:!![]})[_0x5b54('0xb')](function(_0x306be7){logger['info'](_0x5b54('0x17'),_0x37cbbd);logger[_0x5b54('0xe')](_0x5b54('0x17'),_0x37cbbd,JSON['stringify'](_0x306be7));_0x4d4feb(_0x306be7);})[_0x5b54('0x16')](function(_0xa1323a){logger[_0x5b54('0x11')]('CreateVoiceDialReport',_0xa1323a[_0x5b54('0x14')],_0x37cbbd);_0x33c0b5(_0x239334[_0x5b54('0x11')](0x1f4,_0xa1323a[_0x5b54('0x14')]));});});};exports[_0x5b54('0x1c')]=function(_0x4d53c3){var _0x13c724=this;return new Promise(function(_0x2ad352,_0x5421b6){return db[_0x5b54('0x18')][_0x5b54('0x1d')](_0x4d53c3[_0x5b54('0x19')],{'raw':_0x4d53c3[_0x5b54('0x1a')]?_0x4d53c3[_0x5b54('0x1a')][_0x5b54('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d53c3[_0x5b54('0x1a')]?_0x4d53c3[_0x5b54('0x1a')][_0x5b54('0x1e')]||null:null,'attributes':_0x4d53c3[_0x5b54('0x1a')]?_0x4d53c3[_0x5b54('0x1a')][_0x5b54('0x1f')]||null:null,'limit':_0x4d53c3[_0x5b54('0x1a')]?_0x4d53c3[_0x5b54('0x1a')][_0x5b54('0x20')]||null:null})[_0x5b54('0xb')](function(_0x50e88a){logger[_0x5b54('0xc')](_0x5b54('0x1c'),_0x4d53c3);logger[_0x5b54('0xe')](_0x5b54('0x1c'),_0x4d53c3,JSON['stringify'](_0x50e88a));_0x2ad352(_0x50e88a);})['catch'](function(_0x4c42ca){logger[_0x5b54('0x11')](_0x5b54('0x1c'),_0x4c42ca['message'],_0x4d53c3);_0x5421b6(_0x13c724[_0x5b54('0x11')](0x1f4,_0x4c42ca[_0x5b54('0x14')]));});});}; \ No newline at end of file +var _0x72a9=['raw','UpdateVoiceDialReport','update','body','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options'];(function(_0x34a4fd,_0x5c07f2){var _0xf89bcb=function(_0x575bbe){while(--_0x575bbe){_0x34a4fd['push'](_0x34a4fd['shift']());}};_0xf89bcb(++_0x5c07f2);}(_0x72a9,0x10e));var _0x972a=function(_0x4cb6dc,_0x47dbc9){_0x4cb6dc=_0x4cb6dc-0x0;var _0x5204be=_0x72a9[_0x4cb6dc];return _0x5204be;};'use strict';var _=require(_0x972a('0x0'));var util=require(_0x972a('0x1'));var moment=require(_0x972a('0x2'));var BPromise=require('bluebird');var rs=require(_0x972a('0x3'));var fs=require('fs');var Redis=require(_0x972a('0x4'));var db=require(_0x972a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x972a('0x6'))(_0x972a('0x7'));var config=require(_0x972a('0x8'));var jayson=require(_0x972a('0x9'));var client=jayson[_0x972a('0xa')][_0x972a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x502392,_0x2bce2a,_0x3a26f7){return new BPromise(function(_0x5d34cb,_0x2e691a){return client['request'](_0x502392,_0x3a26f7)[_0x972a('0xc')](function(_0x17e1a3){logger[_0x972a('0xd')](_0x972a('0xe'),_0x2bce2a,_0x972a('0xf'));logger[_0x972a('0x10')](_0x972a('0x11'),_0x2bce2a,_0x972a('0xf'),JSON[_0x972a('0x12')](_0x17e1a3));if(_0x17e1a3[_0x972a('0x13')]){if(_0x17e1a3['error'][_0x972a('0x14')]===0x1f4){logger['error'](_0x972a('0xe'),_0x2bce2a,_0x17e1a3[_0x972a('0x13')][_0x972a('0x15')]);return _0x2e691a(_0x17e1a3[_0x972a('0x13')][_0x972a('0x15')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2bce2a,_0x17e1a3[_0x972a('0x13')][_0x972a('0x15')]);return _0x5d34cb(_0x17e1a3[_0x972a('0x13')][_0x972a('0x15')]);}else{logger[_0x972a('0xd')](_0x972a('0xe'),_0x2bce2a,'request\x20sent');_0x5d34cb(_0x17e1a3[_0x972a('0x16')][_0x972a('0x15')]);}})[_0x972a('0x17')](function(_0x582b0d){logger[_0x972a('0x13')](_0x972a('0xe'),_0x2bce2a,_0x582b0d);_0x2e691a(_0x582b0d);});});}exports[_0x972a('0x18')]=function(_0x6a5479){var _0x3856da=this;return new Promise(function(_0x47574,_0x32d47f){return db[_0x972a('0x19')]['create'](_0x6a5479['body'],{'raw':_0x6a5479['options']?_0x6a5479[_0x972a('0x1a')][_0x972a('0x1b')]===undefined?!![]:![]:!![]})[_0x972a('0xc')](function(_0x61088c){logger['info'](_0x972a('0x18'),_0x6a5479);logger[_0x972a('0x10')](_0x972a('0x18'),_0x6a5479,JSON[_0x972a('0x12')](_0x61088c));_0x47574(_0x61088c);})[_0x972a('0x17')](function(_0x257fe2){logger[_0x972a('0x13')]('CreateVoiceDialReport',_0x257fe2[_0x972a('0x15')],_0x6a5479);_0x32d47f(_0x3856da[_0x972a('0x13')](0x1f4,_0x257fe2['message']));});});};exports[_0x972a('0x1c')]=function(_0x5c201a){var _0x2bc719=this;return new Promise(function(_0xd485ee,_0x2d8227){return db['VoiceDialReport'][_0x972a('0x1d')](_0x5c201a[_0x972a('0x1e')],{'raw':_0x5c201a[_0x972a('0x1a')]?_0x5c201a[_0x972a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c201a['options']?_0x5c201a[_0x972a('0x1a')]['where']||null:null,'attributes':_0x5c201a[_0x972a('0x1a')]?_0x5c201a['options'][_0x972a('0x1f')]||null:null,'limit':_0x5c201a['options']?_0x5c201a[_0x972a('0x1a')][_0x972a('0x20')]||null:null})[_0x972a('0xc')](function(_0x21262a){logger['info'](_0x972a('0x1c'),_0x5c201a);logger[_0x972a('0x10')]('UpdateVoiceDialReport',_0x5c201a,JSON['stringify'](_0x21262a));_0xd485ee(_0x21262a);})[_0x972a('0x17')](function(_0x2a7d17){logger[_0x972a('0x13')](_0x972a('0x1c'),_0x2a7d17['message'],_0x5c201a);_0x2d8227(_0x2bc719[_0x972a('0x13')](0x1f4,_0x2a7d17['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index aadb73a..eb8e532 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 _0x92fb=['isAuthenticated','show','post','create','/:id/applications','addApplications','/:id','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index'];(function(_0x5deea5,_0x230d81){var _0x3d1998=function(_0x39341d){while(--_0x39341d){_0x5deea5['push'](_0x5deea5['shift']());}};_0x3d1998(++_0x230d81);}(_0x92fb,0x198));var _0xb92f=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0x92fb[_0x34f545];return _0x1ff6b8;};'use strict';var multer=require(_0xb92f('0x0'));var util=require(_0xb92f('0x1'));var path=require(_0xb92f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb92f('0x3'));var router=express[_0xb92f('0x4')]();var fs_extra=require(_0xb92f('0x5'));var auth=require(_0xb92f('0x6'));var interaction=require(_0xb92f('0x7'));var config=require(_0xb92f('0x8'));var controller=require(_0xb92f('0x9'));router[_0xb92f('0xa')]('/',auth['isAuthenticated'](),controller[_0xb92f('0xb')]);router[_0xb92f('0xa')]('/:id',auth[_0xb92f('0xc')](),controller[_0xb92f('0xd')]);router[_0xb92f('0xe')]('/',auth['isAuthenticated'](),controller[_0xb92f('0xf')]);router['post'](_0xb92f('0x10'),auth[_0xb92f('0xc')](),controller[_0xb92f('0x11')]);router['put'](_0xb92f('0x12'),auth[_0xb92f('0xc')](),controller['update']);router[_0xb92f('0x13')](_0xb92f('0x12'),auth[_0xb92f('0xc')](),controller['destroy']);module[_0xb92f('0x14')]=router; \ No newline at end of file +var _0x4bbc=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','create','/:id/applications','put'];(function(_0xc05c55,_0x4c61ea){var _0x4a22b8=function(_0x4761dd){while(--_0x4761dd){_0xc05c55['push'](_0xc05c55['shift']());}};_0x4a22b8(++_0x4c61ea);}(_0x4bbc,0x1a7));var _0xc4bb=function(_0x183fac,_0x5c4b00){_0x183fac=_0x183fac-0x0;var _0x5ee86a=_0x4bbc[_0x183fac];return _0x5ee86a;};'use strict';var multer=require(_0xc4bb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc4bb('0x1'));var express=require(_0xc4bb('0x2'));var router=express['Router']();var fs_extra=require(_0xc4bb('0x3'));var auth=require(_0xc4bb('0x4'));var interaction=require(_0xc4bb('0x5'));var config=require(_0xc4bb('0x6'));var controller=require(_0xc4bb('0x7'));router[_0xc4bb('0x8')]('/',auth['isAuthenticated'](),controller[_0xc4bb('0x9')]);router[_0xc4bb('0x8')](_0xc4bb('0xa'),auth[_0xc4bb('0xb')](),controller[_0xc4bb('0xc')]);router[_0xc4bb('0xd')]('/',auth[_0xc4bb('0xb')](),controller[_0xc4bb('0xe')]);router['post'](_0xc4bb('0xf'),auth[_0xc4bb('0xb')](),controller['addApplications']);router[_0xc4bb('0x10')]('/:id',auth[_0xc4bb('0xb')](),controller['update']);router[_0xc4bb('0x11')]('/:id',auth[_0xc4bb('0xb')](),controller[_0xc4bb('0x12')]);module[_0xc4bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b2d1f27..bfb85ca 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 _0xb444=['inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','outbound','internal'];(function(_0x337316,_0x111213){var _0x1ee294=function(_0xdff7ea){while(--_0xdff7ea){_0x337316['push'](_0x337316['shift']());}};_0x1ee294(++_0x111213);}(_0xb444,0x1a1));var _0x4b44=function(_0x59dfe1,_0x39fbc2){_0x59dfe1=_0x59dfe1-0x0;var _0x96ca3a=_0xb444[_0x59dfe1];return _0x96ca3a;};'use strict';var Sequelize=require(_0x4b44('0x0'));module[_0x4b44('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b44('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x4b44('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x4b44('0x2')},'tag':{'type':Sequelize[_0x4b44('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b44('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4b44('0x5')]('inbound',_0x4b44('0x6'),_0x4b44('0x7'),_0x4b44('0x8'),_0x4b44('0x9'),_0x4b44('0xa'),_0x4b44('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x4b44('0x3')]},'interval':{'type':Sequelize[_0x4b44('0x3')],'allowNull':![],'defaultValue':_0x4b44('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4b44('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x4b44('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4b44('0xe')]},'recordingFormat':{'type':Sequelize[_0x4b44('0x3')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4b44('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4b44('0xf')],'get':function(_0x4d2df9){return this['getDataValue'](_0x4b44('0x10'));}},'alias':{'type':Sequelize[_0x4b44('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xb86e=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','exports','compositeIndex','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x102bb7,_0x5bd5c4){var _0x4c3301=function(_0x4b5397){while(--_0x4b5397){_0x102bb7['push'](_0x102bb7['shift']());}};_0x4c3301(++_0x5bd5c4);}(_0xb86e,0xb8));var _0xeb86=function(_0x58b332,_0x54787d){_0x58b332=_0x58b332-0x0;var _0xb8e97e=_0xb86e[_0x58b332];return _0xb8e97e;};'use strict';var Sequelize=require('sequelize');module[_0xeb86('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeb86('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xeb86('0x2')],'allowNull':![],'unique':_0xeb86('0x1')},'priority':{'type':Sequelize[_0xeb86('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xeb86('0x1')},'tag':{'type':Sequelize[_0xeb86('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xeb86('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xeb86('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xeb86('0x3')](_0xeb86('0x4'),'outbound',_0xeb86('0x5'),_0xeb86('0x6'),_0xeb86('0x7'),_0xeb86('0x8'),_0xeb86('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xeb86('0x2')]},'interval':{'type':Sequelize[_0xeb86('0x2')],'allowNull':![],'defaultValue':_0xeb86('0xa')},'IntervalId':{'type':Sequelize[_0xeb86('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xeb86('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xeb86('0xb')]},'recordingFormat':{'type':Sequelize[_0xeb86('0x2')],'defaultValue':_0xeb86('0xd')},'answer':{'type':Sequelize[_0xeb86('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b4807){return this[_0xeb86('0xe')](_0xeb86('0xf'));}},'alias':{'type':Sequelize[_0xeb86('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ec51caa..a637ab4 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 _0x9331=['value','includes','type','name','UserProfileResource','sendStatus','error','send','index','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','keys','filters','length','find','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','cutdigits','mandatoryDisposition','alias','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','findAndCountAll','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x9331,0xf3));var _0x1933=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x9331[_0x44b7d6];return _0x5346f0;};'use strict';var _=require(_0x1933('0x0'));var Redis=require(_0x1933('0x1'));var qs=require(_0x1933('0x2'));var logger=require(_0x1933('0x3'))(_0x1933('0x4'));var config=require(_0x1933('0x5'));var db=require(_0x1933('0x6'))['db'];config[_0x1933('0x7')]=_['defaults'](config[_0x1933('0x7')],{'host':_0x1933('0x8'),'port':0x18eb});var socket=require(_0x1933('0x9'))(new Redis(config[_0x1933('0x7')]));require(_0x1933('0xa'))[_0x1933('0xb')](socket);function respondWithStatusCode(_0x5742a0,_0x562365){_0x562365=_0x562365||0xcc;return function(_0x458b65){if(_0x458b65){return _0x5742a0['sendStatus'](_0x562365);}return _0x5742a0[_0x1933('0xc')](_0x562365)[_0x1933('0xd')]();};}function respondWithResult(_0x635d4a,_0x1f4643){_0x1f4643=_0x1f4643||0xc8;return function(_0x254bb7){if(_0x254bb7){return _0x635d4a['status'](_0x1f4643)['json'](_0x254bb7);}};}function respondWithFilteredResult(_0x376ec9,_0x1184d2){return function(_0x17a757){if(_0x17a757){var _0x1de8f6=typeof _0x1184d2[_0x1933('0xe')]===_0x1933('0xf')&&typeof _0x1184d2[_0x1933('0x10')]===_0x1933('0xf');var _0x316f8a=_0x17a757[_0x1933('0x11')];var _0x553e24=_0x1de8f6?0x0:_0x1184d2['offset'];var _0x470b51=_0x1de8f6?_0x17a757[_0x1933('0x11')]:_0x1184d2[_0x1933('0xe')]+_0x1184d2['limit'];var _0x17234b;if(_0x470b51>=_0x316f8a){_0x470b51=_0x316f8a;_0x17234b=0xc8;}else{_0x17234b=0xce;}_0x376ec9['status'](_0x17234b);return _0x376ec9[_0x1933('0x12')](_0x1933('0x13'),_0x553e24+'-'+_0x470b51+'/'+_0x316f8a)[_0x1933('0x14')](_0x17a757);}return null;};}function removeEntity(_0x46558c){return function(_0x30ecc7){if(_0x30ecc7){return _0x30ecc7[_0x1933('0x15')]()[_0x1933('0x16')](function(){var _0x4a3eb0=_0x30ecc7[_0x1933('0x17')]({'plain':!![]});var _0x2abb6c=[{'name':_0x1933('0x18'),'value':_0x1933('0x19'),'ignore':![]},{'name':_0x1933('0x1a'),'value':_0x1933('0x1b'),'ignore':![]},{'name':_0x1933('0x1c'),'value':'internal','ignore':![]}];var _0x5d6463=_(_0x2abb6c)[_0x1933('0x1d')]('ignore')['map'](_0x1933('0x1e'))[_0x1933('0x1e')]();if(_[_0x1933('0x1f')](_0x5d6463,_0x4a3eb0['type'])){return;}var _0x177acf=_['find'](_0x2abb6c,['value',_0x4a3eb0[_0x1933('0x20')]])[_0x1933('0x21')];return db[_0x1933('0x22')]['destroy']({'where':{'type':_0x177acf,'resourceId':_0x4a3eb0['id']}})['then'](function(){return _0x30ecc7;});})[_0x1933('0x16')](function(){_0x46558c[_0x1933('0xc')](0xcc)[_0x1933('0xd')]();});}};}function handleEntityNotFound(_0x49d75c){return function(_0x25f7ec){if(!_0x25f7ec){_0x49d75c[_0x1933('0x23')](0x194);}return _0x25f7ec;};}function handleError(_0x5806da,_0x4abf5b){_0x4abf5b=_0x4abf5b||0x1f4;return function(_0x13d25c){logger[_0x1933('0x24')](_0x13d25c['stack']);if(_0x13d25c['name']){delete _0x13d25c[_0x1933('0x21')];}_0x5806da[_0x1933('0xc')](_0x4abf5b)[_0x1933('0x25')](_0x13d25c);};}exports[_0x1933('0x26')]=function(_0x386da5,_0x22de09){var _0x4d612e={},_0x5865fe={},_0x4a6f4d={'count':0x0,'rows':[]};var _0x5b224e=_[_0x1933('0x27')](db['VoiceExtension'][_0x1933('0x28')],function(_0x241704){return{'name':_0x241704[_0x1933('0x29')],'type':_0x241704[_0x1933('0x20')]['key']};});_0x5865fe[_0x1933('0x2a')]=_[_0x1933('0x27')](_0x5b224e,_0x1933('0x21'));_0x5865fe[_0x1933('0x2b')]=_['keys'](_0x386da5[_0x1933('0x2b')]);_0x5865fe['filters']=_[_0x1933('0x2c')](_0x5865fe[_0x1933('0x2a')],_0x5865fe[_0x1933('0x2b')]);_0x4d612e[_0x1933('0x2d')]=_['intersection'](_0x5865fe[_0x1933('0x2a')],qs[_0x1933('0x2e')](_0x386da5[_0x1933('0x2b')][_0x1933('0x2e')]));_0x4d612e[_0x1933('0x2d')]=_0x4d612e[_0x1933('0x2d')]['length']?_0x4d612e[_0x1933('0x2d')]:_0x5865fe[_0x1933('0x2a')];if(!_0x386da5['query'][_0x1933('0x2f')](_0x1933('0x30'))){_0x4d612e[_0x1933('0x10')]=qs[_0x1933('0x10')](_0x386da5[_0x1933('0x2b')]['limit']);_0x4d612e[_0x1933('0xe')]=qs[_0x1933('0xe')](_0x386da5[_0x1933('0x2b')][_0x1933('0xe')]);}_0x4d612e['order']=qs['sort'](_0x386da5[_0x1933('0x2b')][_0x1933('0x31')]);_0x4d612e[_0x1933('0x32')]=qs['filters'](_['pick'](_0x386da5['query'],_0x5865fe['filters']),_0x5b224e);if(_0x386da5[_0x1933('0x2b')][_0x1933('0x1d')]){_0x4d612e[_0x1933('0x32')]=_[_0x1933('0x33')](_0x4d612e['where'],{'$or':_[_0x1933('0x27')](_0x5b224e,function(_0x4a59cf){if(_0x4a59cf[_0x1933('0x20')]!==_0x1933('0x34')){var _0x427270={};_0x427270[_0x4a59cf['name']]={'$like':'%'+_0x386da5[_0x1933('0x2b')][_0x1933('0x1d')]+'%'};return _0x427270;}})});}_0x4d612e=_[_0x1933('0x33')]({},_0x4d612e,_0x386da5[_0x1933('0x35')]);var _0x20cda1={'where':_0x4d612e[_0x1933('0x32')]};return db[_0x1933('0x36')]['count'](_0x20cda1)[_0x1933('0x16')](function(_0x2792b8){_0x4a6f4d[_0x1933('0x11')]=_0x2792b8;if(_0x386da5['query'][_0x1933('0x37')]){_0x4d612e[_0x1933('0x38')]=[{'all':!![]}];}return db[_0x1933('0x36')][_0x1933('0x39')](_0x4d612e);})[_0x1933('0x16')](function(_0x5a27d6){_0x4a6f4d[_0x1933('0x3a')]=_0x5a27d6;return _0x4a6f4d;})[_0x1933('0x16')](respondWithFilteredResult(_0x22de09,_0x4d612e))[_0x1933('0x3b')](handleError(_0x22de09,null));};exports[_0x1933('0x3c')]=function(_0x49e33c,_0x4c1d6e){var _0xa860ef={'raw':![],'where':{'id':_0x49e33c[_0x1933('0x3d')]['id']}},_0x3b86bc={};_0x3b86bc[_0x1933('0x2a')]=_[_0x1933('0x3e')](db[_0x1933('0x36')]['rawAttributes']);_0x3b86bc[_0x1933('0x2b')]=_[_0x1933('0x3e')](_0x49e33c[_0x1933('0x2b')]);_0x3b86bc[_0x1933('0x3f')]=_[_0x1933('0x2c')](_0x3b86bc[_0x1933('0x2a')],_0x3b86bc[_0x1933('0x2b')]);_0xa860ef[_0x1933('0x2d')]=_['intersection'](_0x3b86bc[_0x1933('0x2a')],qs['fields'](_0x49e33c[_0x1933('0x2b')][_0x1933('0x2e')]));_0xa860ef['attributes']=_0xa860ef[_0x1933('0x2d')][_0x1933('0x40')]?_0xa860ef[_0x1933('0x2d')]:_0x3b86bc[_0x1933('0x2a')];if(_0x49e33c[_0x1933('0x2b')][_0x1933('0x37')]){_0xa860ef[_0x1933('0x38')]=[{'all':!![]}];}_0xa860ef=_['merge']({},_0xa860ef,_0x49e33c[_0x1933('0x35')]);return db[_0x1933('0x36')]['find'](_0xa860ef)[_0x1933('0x16')](handleEntityNotFound(_0x4c1d6e,null))[_0x1933('0x16')](respondWithResult(_0x4c1d6e,null))[_0x1933('0x3b')](handleError(_0x4c1d6e,null));};exports[_0x1933('0x15')]=function(_0x300dac,_0x2ff960){return db[_0x1933('0x36')][_0x1933('0x41')]({'where':{'id':_0x300dac[_0x1933('0x3d')]['id']}})[_0x1933('0x16')](handleEntityNotFound(_0x2ff960,null))['then'](removeEntity(_0x2ff960,null))[_0x1933('0x3b')](handleError(_0x2ff960,null));};exports[_0x1933('0x42')]=function(_0x5abac6,_0x35eb8d){if(_0x5abac6[_0x1933('0x43')][_0x1933('0x20')]===_0x1933('0x1b')&&!_[_0x1933('0x44')](_0x5abac6['body'][_0x1933('0x45')],'_')){_0x5abac6[_0x1933('0x43')][_0x1933('0x45')]='_'[_0x1933('0x46')](_0x5abac6['body'][_0x1933('0x45')]);}return db['VoiceExtension'][_0x1933('0x42')](_0x5abac6[_0x1933('0x43')],{'raw':![]})[_0x1933('0x16')](function(_0x5e58a7){var _0x595da2=_0x5abac6[_0x1933('0x47')][_0x1933('0x17')]({'plain':!![]});if(!_0x595da2)throw new Error(_0x1933('0x48'));if(_0x595da2[_0x1933('0x49')]===_0x1933('0x47')){var _0x3201af=_0x5e58a7[_0x1933('0x17')]({'plain':!![]});var _0x294761=[{'name':_0x1933('0x18'),'value':_0x1933('0x19')},{'name':_0x1933('0x1a'),'value':'outbound'},{'name':_0x1933('0x1c'),'value':'internal'}];var _0x17d031=_[_0x1933('0x41')](_0x294761,[_0x1933('0x1e'),_0x3201af[_0x1933('0x20')]])[_0x1933('0x21')];return db[_0x1933('0x4a')][_0x1933('0x41')]({'where':{'name':_0x17d031,'userProfileId':_0x595da2[_0x1933('0x4b')]},'raw':!![]})[_0x1933('0x16')](function(_0x566e2f){if(_0x566e2f&&_0x566e2f[_0x1933('0x4c')]===0x0){return db[_0x1933('0x22')][_0x1933('0x42')]({'name':_0x3201af[_0x1933('0x21')],'resourceId':_0x3201af['id'],'type':_0x566e2f[_0x1933('0x21')],'sectionId':_0x566e2f['id']},{})[_0x1933('0x16')](function(){return _0x5e58a7;});}else{return _0x5e58a7;}})[_0x1933('0x3b')](function(_0x4877bf){logger[_0x1933('0x24')](_0x1933('0x4d'),_0x4877bf);throw _0x4877bf;});}return _0x5e58a7;})['then'](respondWithResult(_0x35eb8d,0xc9))['catch'](handleError(_0x35eb8d,null));};exports[_0x1933('0x4e')]=function(_0x437337,_0x4503d8){if(_0x437337[_0x1933('0x43')]['id']){delete _0x437337[_0x1933('0x43')]['id'];}return db['VoiceExtension'][_0x1933('0x41')]({'where':{'id':_0x437337[_0x1933('0x3d')]['id']}})[_0x1933('0x16')](handleEntityNotFound(_0x4503d8,null))[_0x1933('0x16')](function(_0x301c74){if(_0x301c74){return db[_0x1933('0x36')]['update'](_[_0x1933('0x4f')](_0x437337[_0x1933('0x43')],[_0x1933('0x45'),_0x1933('0x50'),'description','recordingFormat',_0x1933('0x51'),_0x1933('0x52'),_0x1933('0x53')]),{'where':{'context':_0x301c74['context'],'exten':_0x301c74[_0x1933('0x45')]},'individualHooks':!![]})['then'](function(_0x491382){return _0x491382;});}return null;})[_0x1933('0x16')](respondWithStatusCode(_0x4503d8,null))['catch'](handleError(_0x4503d8,null));};exports['addApplications']=function(_0x593509,_0x5ebe9a){var _0x43cba8=_0x593509['params']['id'];var _0x563044=_0x593509['body'];var _0x4f27a0=0xc8;var _0x583eeb=null;return db[_0x1933('0x54')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x1933('0x55')][_0x1933('0x56')]},function(_0x563255){return db['VoiceExtension'][_0x1933('0x57')]({'where':{'id':_0x43cba8},'transaction':_0x563255})[_0x1933('0x16')](function(_0x3ac844){if(_0x3ac844){return db[_0x1933('0x36')][_0x1933('0x15')]({'where':{'VoiceExtensionId':_0x43cba8},'transaction':_0x563255})[_0x1933('0x16')](function(){var _0x499fb1=_[_0x1933('0x27')](_0x563044,function(_0x339899){_0x339899[_0x1933('0x58')]=_0x43cba8;_0x339899['isApp']=!![];return _0x339899;});return _0x3ac844['createRouting'](_0x499fb1);})[_0x1933('0x16')](function(_0x2e7a02){return db[_0x1933('0x36')]['bulkCreate'](_0x2e7a02,{'transaction':_0x563255});});}else{_0x4f27a0=0x194;_0x583eeb=[];}});})['then'](function(){if(_0x4f27a0!==0x194){return db[_0x1933('0x36')][_0x1933('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x43cba8},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x3e82bf){_0x583eeb=_0x3e82bf;});}})[_0x1933('0x3b')](function(_0x2dcd8f){_0x4f27a0=0x1f4;logger['error'](_0x2dcd8f[_0x1933('0x5a')]);if(_0x2dcd8f[_0x1933('0x21')]){delete _0x2dcd8f['name'];}_0x583eeb=_0x2dcd8f;})['finally'](function(){if(_0x583eeb===null){_0x5ebe9a[_0x1933('0x23')](_0x4f27a0);}else{if(_0x4f27a0===0x1f4){_0x5ebe9a[_0x1933('0xc')](_0x4f27a0)[_0x1933('0x25')](_0x583eeb);}else{_0x5ebe9a[_0x1933('0xc')](_0x4f27a0)[_0x1933('0x14')](_0x583eeb);}}});}; \ No newline at end of file +var _0xc3ab=['status','json','offset','limit','undefined','count','set','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','UserProfileResource','then','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','intersection','model','query','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','mandatoryDisposition','addApplications','transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x5de26c,_0x1a9fae){var _0x5f4736=function(_0x32711c){while(--_0x32711c){_0x5de26c['push'](_0x5de26c['shift']());}};_0x5f4736(++_0x1a9fae);}(_0xc3ab,0x1a8));var _0xbc3a=function(_0x54a1b7,_0x1b3fce){_0x54a1b7=_0x54a1b7-0x0;var _0xf72e18=_0xc3ab[_0x54a1b7];return _0xf72e18;};'use strict';var _=require(_0xbc3a('0x0'));var Redis=require('ioredis');var qs=require(_0xbc3a('0x1'));var logger=require(_0xbc3a('0x2'))(_0xbc3a('0x3'));var config=require('../../config/environment');var db=require(_0xbc3a('0x4'))['db'];config['redis']=_[_0xbc3a('0x5')](config[_0xbc3a('0x6')],{'host':_0xbc3a('0x7'),'port':0x18eb});var socket=require(_0xbc3a('0x8'))(new Redis(config[_0xbc3a('0x6')]));require(_0xbc3a('0x9'))[_0xbc3a('0xa')](socket);function respondWithStatusCode(_0x1d50cb,_0x29feca){_0x29feca=_0x29feca||0xcc;return function(_0x33dbee){if(_0x33dbee){return _0x1d50cb['sendStatus'](_0x29feca);}return _0x1d50cb[_0xbc3a('0xb')](_0x29feca)['end']();};}function respondWithResult(_0x3c1a6d,_0x1f4b93){_0x1f4b93=_0x1f4b93||0xc8;return function(_0x31c0ee){if(_0x31c0ee){return _0x3c1a6d[_0xbc3a('0xb')](_0x1f4b93)[_0xbc3a('0xc')](_0x31c0ee);}};}function respondWithFilteredResult(_0x55026e,_0x264169){return function(_0x2af023){if(_0x2af023){var _0x3ffa35=typeof _0x264169[_0xbc3a('0xd')]==='undefined'&&typeof _0x264169[_0xbc3a('0xe')]===_0xbc3a('0xf');var _0x394f9f=_0x2af023[_0xbc3a('0x10')];var _0x196066=_0x3ffa35?0x0:_0x264169[_0xbc3a('0xd')];var _0xc9356c=_0x3ffa35?_0x2af023[_0xbc3a('0x10')]:_0x264169[_0xbc3a('0xd')]+_0x264169['limit'];var _0x364ff8;if(_0xc9356c>=_0x394f9f){_0xc9356c=_0x394f9f;_0x364ff8=0xc8;}else{_0x364ff8=0xce;}_0x55026e[_0xbc3a('0xb')](_0x364ff8);return _0x55026e[_0xbc3a('0x11')]('Content-Range',_0x196066+'-'+_0xc9356c+'/'+_0x394f9f)[_0xbc3a('0xc')](_0x2af023);}return null;};}function removeEntity(_0x52ad4e){return function(_0x19f5b3){if(_0x19f5b3){return _0x19f5b3[_0xbc3a('0x12')]()['then'](function(){var _0x1c577a=_0x19f5b3[_0xbc3a('0x13')]({'plain':!![]});var _0x1bc80e=[{'name':_0xbc3a('0x14'),'value':_0xbc3a('0x15'),'ignore':![]},{'name':_0xbc3a('0x16'),'value':_0xbc3a('0x17'),'ignore':![]},{'name':_0xbc3a('0x18'),'value':_0xbc3a('0x19'),'ignore':![]}];var _0x444317=_(_0x1bc80e)['filter'](_0xbc3a('0x1a'))[_0xbc3a('0x1b')](_0xbc3a('0x1c'))[_0xbc3a('0x1c')]();if(_[_0xbc3a('0x1d')](_0x444317,_0x1c577a[_0xbc3a('0x1e')])){return;}var _0x2e6156=_[_0xbc3a('0x1f')](_0x1bc80e,[_0xbc3a('0x1c'),_0x1c577a[_0xbc3a('0x1e')]])['name'];return db[_0xbc3a('0x20')][_0xbc3a('0x12')]({'where':{'type':_0x2e6156,'resourceId':_0x1c577a['id']}})[_0xbc3a('0x21')](function(){return _0x19f5b3;});})['then'](function(){_0x52ad4e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x478cc1){return function(_0x216301){if(!_0x216301){_0x478cc1['sendStatus'](0x194);}return _0x216301;};}function handleError(_0x587e2b,_0x45dc1c){_0x45dc1c=_0x45dc1c||0x1f4;return function(_0x27e1ca){logger[_0xbc3a('0x22')](_0x27e1ca[_0xbc3a('0x23')]);if(_0x27e1ca[_0xbc3a('0x24')]){delete _0x27e1ca[_0xbc3a('0x24')];}_0x587e2b['status'](_0x45dc1c)[_0xbc3a('0x25')](_0x27e1ca);};}exports[_0xbc3a('0x26')]=function(_0x2971a0,_0x48c8d1){var _0x3c03d5={},_0x41ee88={},_0x339a99={'count':0x0,'rows':[]};var _0x5adb8d=_[_0xbc3a('0x1b')](db[_0xbc3a('0x27')][_0xbc3a('0x28')],function(_0x546150){return{'name':_0x546150[_0xbc3a('0x29')],'type':_0x546150[_0xbc3a('0x1e')][_0xbc3a('0x2a')]};});_0x41ee88['model']=_[_0xbc3a('0x1b')](_0x5adb8d,_0xbc3a('0x24'));_0x41ee88['query']=_['keys'](_0x2971a0['query']);_0x41ee88['filters']=_[_0xbc3a('0x2b')](_0x41ee88[_0xbc3a('0x2c')],_0x41ee88[_0xbc3a('0x2d')]);_0x3c03d5[_0xbc3a('0x2e')]=_['intersection'](_0x41ee88[_0xbc3a('0x2c')],qs[_0xbc3a('0x2f')](_0x2971a0[_0xbc3a('0x2d')][_0xbc3a('0x2f')]));_0x3c03d5['attributes']=_0x3c03d5[_0xbc3a('0x2e')]['length']?_0x3c03d5[_0xbc3a('0x2e')]:_0x41ee88[_0xbc3a('0x2c')];if(!_0x2971a0[_0xbc3a('0x2d')]['hasOwnProperty'](_0xbc3a('0x30'))){_0x3c03d5[_0xbc3a('0xe')]=qs[_0xbc3a('0xe')](_0x2971a0[_0xbc3a('0x2d')][_0xbc3a('0xe')]);_0x3c03d5[_0xbc3a('0xd')]=qs[_0xbc3a('0xd')](_0x2971a0[_0xbc3a('0x2d')][_0xbc3a('0xd')]);}_0x3c03d5[_0xbc3a('0x31')]=qs[_0xbc3a('0x32')](_0x2971a0['query'][_0xbc3a('0x32')]);_0x3c03d5[_0xbc3a('0x33')]=qs[_0xbc3a('0x34')](_[_0xbc3a('0x35')](_0x2971a0['query'],_0x41ee88['filters']),_0x5adb8d);if(_0x2971a0[_0xbc3a('0x2d')]['filter']){_0x3c03d5[_0xbc3a('0x33')]=_[_0xbc3a('0x36')](_0x3c03d5[_0xbc3a('0x33')],{'$or':_[_0xbc3a('0x1b')](_0x5adb8d,function(_0x52d325){if(_0x52d325[_0xbc3a('0x1e')]!==_0xbc3a('0x37')){var _0x93b11b={};_0x93b11b[_0x52d325[_0xbc3a('0x24')]]={'$like':'%'+_0x2971a0['query'][_0xbc3a('0x38')]+'%'};return _0x93b11b;}})});}_0x3c03d5=_['merge']({},_0x3c03d5,_0x2971a0[_0xbc3a('0x39')]);var _0x26b178={'where':_0x3c03d5['where']};return db['VoiceExtension'][_0xbc3a('0x10')](_0x26b178)[_0xbc3a('0x21')](function(_0x16150b){_0x339a99['count']=_0x16150b;if(_0x2971a0[_0xbc3a('0x2d')][_0xbc3a('0x3a')]){_0x3c03d5[_0xbc3a('0x3b')]=[{'all':!![]}];}return db[_0xbc3a('0x27')][_0xbc3a('0x3c')](_0x3c03d5);})[_0xbc3a('0x21')](function(_0x3a4959){_0x339a99['rows']=_0x3a4959;return _0x339a99;})[_0xbc3a('0x21')](respondWithFilteredResult(_0x48c8d1,_0x3c03d5))[_0xbc3a('0x3d')](handleError(_0x48c8d1,null));};exports[_0xbc3a('0x3e')]=function(_0x5d313a,_0x53a003){var _0x4a03e9={'raw':![],'where':{'id':_0x5d313a[_0xbc3a('0x3f')]['id']}},_0x11e5cf={};_0x11e5cf[_0xbc3a('0x2c')]=_['keys'](db['VoiceExtension'][_0xbc3a('0x28')]);_0x11e5cf[_0xbc3a('0x2d')]=_[_0xbc3a('0x40')](_0x5d313a['query']);_0x11e5cf[_0xbc3a('0x34')]=_[_0xbc3a('0x2b')](_0x11e5cf[_0xbc3a('0x2c')],_0x11e5cf[_0xbc3a('0x2d')]);_0x4a03e9[_0xbc3a('0x2e')]=_['intersection'](_0x11e5cf[_0xbc3a('0x2c')],qs[_0xbc3a('0x2f')](_0x5d313a[_0xbc3a('0x2d')][_0xbc3a('0x2f')]));_0x4a03e9['attributes']=_0x4a03e9[_0xbc3a('0x2e')]['length']?_0x4a03e9[_0xbc3a('0x2e')]:_0x11e5cf['model'];if(_0x5d313a[_0xbc3a('0x2d')][_0xbc3a('0x3a')]){_0x4a03e9[_0xbc3a('0x3b')]=[{'all':!![]}];}_0x4a03e9=_['merge']({},_0x4a03e9,_0x5d313a[_0xbc3a('0x39')]);return db[_0xbc3a('0x27')][_0xbc3a('0x1f')](_0x4a03e9)[_0xbc3a('0x21')](handleEntityNotFound(_0x53a003,null))[_0xbc3a('0x21')](respondWithResult(_0x53a003,null))['catch'](handleError(_0x53a003,null));};exports[_0xbc3a('0x12')]=function(_0x4f7626,_0x4d78d0){return db[_0xbc3a('0x27')]['find']({'where':{'id':_0x4f7626['params']['id']}})['then'](handleEntityNotFound(_0x4d78d0,null))[_0xbc3a('0x21')](removeEntity(_0x4d78d0,null))[_0xbc3a('0x3d')](handleError(_0x4d78d0,null));};exports['create']=function(_0x20631a,_0x5227f){if(_0x20631a[_0xbc3a('0x41')][_0xbc3a('0x1e')]===_0xbc3a('0x17')&&!_['startsWith'](_0x20631a[_0xbc3a('0x41')][_0xbc3a('0x42')],'_')){_0x20631a[_0xbc3a('0x41')][_0xbc3a('0x42')]='_'['concat'](_0x20631a[_0xbc3a('0x41')][_0xbc3a('0x42')]);}return db[_0xbc3a('0x27')]['create'](_0x20631a[_0xbc3a('0x41')],{'raw':![]})[_0xbc3a('0x21')](function(_0x46259f){var _0x6f49d=_0x20631a[_0xbc3a('0x43')][_0xbc3a('0x13')]({'plain':!![]});if(!_0x6f49d)throw new Error(_0xbc3a('0x44'));if(_0x6f49d[_0xbc3a('0x45')]===_0xbc3a('0x43')){var _0x466b73=_0x46259f[_0xbc3a('0x13')]({'plain':!![]});var _0x468fbf=[{'name':_0xbc3a('0x14'),'value':_0xbc3a('0x15')},{'name':'OutboundRoutes','value':_0xbc3a('0x17')},{'name':_0xbc3a('0x18'),'value':_0xbc3a('0x19')}];var _0x592d69=_[_0xbc3a('0x1f')](_0x468fbf,[_0xbc3a('0x1c'),_0x466b73[_0xbc3a('0x1e')]])[_0xbc3a('0x24')];return db[_0xbc3a('0x46')]['find']({'where':{'name':_0x592d69,'userProfileId':_0x6f49d['userProfileId']},'raw':!![]})[_0xbc3a('0x21')](function(_0x2c81b0){if(_0x2c81b0&&_0x2c81b0['autoAssociation']===0x0){return db['UserProfileResource'][_0xbc3a('0x47')]({'name':_0x466b73[_0xbc3a('0x24')],'resourceId':_0x466b73['id'],'type':_0x2c81b0[_0xbc3a('0x24')],'sectionId':_0x2c81b0['id']},{})[_0xbc3a('0x21')](function(){return _0x46259f;});}else{return _0x46259f;}})['catch'](function(_0x23bb53){logger['error'](_0xbc3a('0x48'),_0x23bb53);throw _0x23bb53;});}return _0x46259f;})[_0xbc3a('0x21')](respondWithResult(_0x5227f,0xc9))[_0xbc3a('0x3d')](handleError(_0x5227f,null));};exports['update']=function(_0x2562d1,_0x46a262){if(_0x2562d1['body']['id']){delete _0x2562d1[_0xbc3a('0x41')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x2562d1[_0xbc3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x46a262,null))[_0xbc3a('0x21')](function(_0xee1850){if(_0xee1850){return db[_0xbc3a('0x27')][_0xbc3a('0x49')](_['pick'](_0x2562d1[_0xbc3a('0x41')],['exten',_0xbc3a('0x4a'),'description','recordingFormat',_0xbc3a('0x4b'),_0xbc3a('0x4c'),'alias']),{'where':{'context':_0xee1850[_0xbc3a('0x4a')],'exten':_0xee1850[_0xbc3a('0x42')]},'individualHooks':!![]})[_0xbc3a('0x21')](function(_0x193ca8){return _0x193ca8;});}return null;})[_0xbc3a('0x21')](respondWithStatusCode(_0x46a262,null))['catch'](handleError(_0x46a262,null));};exports[_0xbc3a('0x4d')]=function(_0x19a328,_0x26270c){var _0x2c48d3=_0x19a328['params']['id'];var _0x4be99a=_0x19a328[_0xbc3a('0x41')];var _0x214371=0xc8;var _0x1e5406=null;return db['sequelize'][_0xbc3a('0x4e')]({'isolationLevel':db['sequelize']['Transaction'][_0xbc3a('0x4f')]['READ_COMMITTED']},function(_0xb43e2){return db[_0xbc3a('0x27')][_0xbc3a('0x50')]({'where':{'id':_0x2c48d3},'transaction':_0xb43e2})[_0xbc3a('0x21')](function(_0x40d37a){if(_0x40d37a){return db[_0xbc3a('0x27')][_0xbc3a('0x12')]({'where':{'VoiceExtensionId':_0x2c48d3},'transaction':_0xb43e2})[_0xbc3a('0x21')](function(){var _0x3f114e=_[_0xbc3a('0x1b')](_0x4be99a,function(_0x479e69){_0x479e69[_0xbc3a('0x51')]=_0x2c48d3;_0x479e69[_0xbc3a('0x52')]=!![];return _0x479e69;});return _0x40d37a[_0xbc3a('0x53')](_0x3f114e);})[_0xbc3a('0x21')](function(_0x311602){return db[_0xbc3a('0x27')][_0xbc3a('0x54')](_0x311602,{'transaction':_0xb43e2});});}else{_0x214371=0x194;_0x1e5406=[];}});})[_0xbc3a('0x21')](function(){if(_0x214371!==0x194){return db['VoiceExtension'][_0xbc3a('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2c48d3},'order':_0xbc3a('0x56')})[_0xbc3a('0x21')](function(_0x133411){_0x1e5406=_0x133411;});}})['catch'](function(_0x512260){_0x214371=0x1f4;logger[_0xbc3a('0x22')](_0x512260[_0xbc3a('0x23')]);if(_0x512260['name']){delete _0x512260[_0xbc3a('0x24')];}_0x1e5406=_0x512260;})['finally'](function(){if(_0x1e5406===null){_0x26270c['sendStatus'](_0x214371);}else{if(_0x214371===0x1f4){_0x26270c['status'](_0x214371)[_0xbc3a('0x25')](_0x1e5406);}else{_0x26270c[_0xbc3a('0xb')](_0x214371)[_0xbc3a('0xc')](_0x1e5406);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5d19efc..42c12de 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 _0xc9e3=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5ecee5,_0x2e3901){var _0x41eba7=function(_0x3dcfb6){while(--_0x3dcfb6){_0x5ecee5['push'](_0x5ecee5['shift']());}};_0x41eba7(++_0x2e3901);}(_0xc9e3,0xf7));var _0x3c9e=function(_0x22be56,_0x5aad36){_0x22be56=_0x22be56-0x0;var _0x3c7dc4=_0xc9e3[_0x22be56];return _0x3c7dc4;};'use strict';var EventEmitter=require(_0x3c9e('0x0'));var VoiceExtension=require(_0x3c9e('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3c9e('0x2')](0x0);var events={'afterCreate':_0x3c9e('0x3'),'afterUpdate':_0x3c9e('0x4'),'afterDestroy':_0x3c9e('0x5')};function emitEvent(_0x2975d8){return function(_0x32a52a,_0x1d36c6,_0x5afa08){VoiceExtensionEvents[_0x3c9e('0x6')](_0x2975d8+':'+_0x32a52a['id'],_0x32a52a);VoiceExtensionEvents[_0x3c9e('0x6')](_0x2975d8,_0x32a52a);_0x5afa08(null);};}for(var e in events){if(events[_0x3c9e('0x7')](e)){var event=events[e];VoiceExtension[_0x3c9e('0x8')](e,emitEvent(event));}}module[_0x3c9e('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x3c26=['../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3c26,0x171));var _0x63c2=function(_0x220d65,_0x25aa6b){_0x220d65=_0x220d65-0x0;var _0x808a10=_0x3c26[_0x220d65];return _0x808a10;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x63c2('0x0'))['db'][_0x63c2('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x63c2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x63c2('0x3'),'afterDestroy':_0x63c2('0x4')};function emitEvent(_0x4ee0d1){return function(_0x523064,_0xd5cb09,_0x44d778){VoiceExtensionEvents[_0x63c2('0x5')](_0x4ee0d1+':'+_0x523064['id'],_0x523064);VoiceExtensionEvents[_0x63c2('0x5')](_0x4ee0d1,_0x523064);_0x44d778(null);};}for(var e in events){if(events[_0x63c2('0x6')](e)){var event=events[e];VoiceExtension[_0x63c2('0x7')](e,emitEvent(event));}}module[_0x63c2('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index dff9ad2..c3bd46e 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 _0xb7b6=['interval','*,*,*,*','intervals','IntervalId','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','appdata','last','priority','catch','VoiceExtension','voice_extensions','then','Hangup','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','exten','NoOp','alias','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','length','name','param','prefix','phone','${EXTEN:','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll'];(function(_0x2bac76,_0x4ad42a){var _0x4e1ea4=function(_0x288cfe){while(--_0x288cfe){_0x2bac76['push'](_0x2bac76['shift']());}};_0x4e1ea4(++_0x4ad42a);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x3cad58,_0x17379b){_0x3cad58=_0x3cad58-0x0;var _0x4d546c=_0xb7b6[_0x3cad58];return _0x4d546c;};'use strict';var _=require(_0x6b7b('0x0'));var attributes=require(_0x6b7b('0x1'));module['exports']=function(_0x5736d0){var _0x41f2f7=_0x5736d0[_0x6b7b('0x2')];function _0x4de582(_0xe3c323){var _0x2f4878=0x2;var _0x50a8d6=[{'type':_0xe3c323['type'],'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0x4')+_0xe3c323[_0x6b7b('0x5')],'context':_0xe3c323[_0x6b7b('0x6')],'exten':_0xe3c323[_0x6b7b('0x7')],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']},{'type':_0xe3c323['type'],'app':_0xe3c323['alias']?_0x6b7b('0x3'):_0x6b7b('0x8'),'appdata':_0xe3c323[_0x6b7b('0x9')]?_0x6b7b('0xa')+_0xe3c323['alias']:'No\x20alias\x20set','context':_0xe3c323['context'],'exten':_0xe3c323[_0x6b7b('0x7')],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']}];if(_0xe3c323[_0x6b7b('0x5')]===_0x6b7b('0xb')){_0x50a8d6[_0x6b7b('0xc')]({'type':_0x6b7b('0xb'),'app':_0x6b7b('0x3'),'appdata':'CDR(routeid)='+_0xe3c323['id'],'context':_0xe3c323[_0x6b7b('0x6')],'exten':_0xe3c323[_0x6b7b('0x7')],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']});}_0x50a8d6['push']({'type':_0xe3c323[_0x6b7b('0x5')],'app':_0x6b7b('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xe3c323[_0x6b7b('0x6')],'exten':_0xe3c323['exten'],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']},{'type':_0xe3c323[_0x6b7b('0x5')],'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0xd'),'context':_0xe3c323['context'],'exten':_0xe3c323['exten'],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']},{'type':_0xe3c323[_0x6b7b('0x5')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0xe3c323[_0x6b7b('0x6')],'exten':_0xe3c323[_0x6b7b('0x7')],'priority':_0x2f4878++,'VoiceExtensionId':_0xe3c323['id']});return _0x50a8d6;}function _0x4ef35b(_0xd34663){var _0x6c05e7=0x2;var _0x2ce133=[{'type':_0x6b7b('0xe'),'app':'Set','appdata':_0x6b7b('0xf'),'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0xd34663[_0x6b7b('0x9')]?_0x6b7b('0x3'):_0x6b7b('0x8'),'appdata':_0xd34663[_0x6b7b('0x9')]?'CDR(routeAlias)='+_0xd34663['alias']:_0x6b7b('0x10'),'context':_0xd34663['context'],'exten':_0xd34663['exten'],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':'outbound','app':'Set','appdata':_0x6b7b('0x11')+(_0xd34663[_0x6b7b('0x12')]?'${EXTEN:'+_0xd34663[_0x6b7b('0x12')]+'}':_0x6b7b('0x13')),'context':_0xd34663['context'],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0x14')+_0xd34663['id'],'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x15'),'appdata':_0x6b7b('0x16')+(_0x6c05e7+0x2)+_0x6b7b('0x17')+(_0x6c05e7+0x1)+')','context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x3'),'appdata':_0xd34663[_0x6b7b('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0xd34663['cutdigits']+'}':_0x6b7b('0x18'),'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':'outbound','app':_0x6b7b('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xd34663['context'],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0x19'),'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':'Set','appdata':'outboundrouteid='+_0xd34663['id'],'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']}];if(_0xd34663[_0x6b7b('0x1a')](_0x6b7b('0x1b'))&&_0xd34663['recordingFormat']!=='none'){_0x2ce133[_0x6b7b('0xc')]({'type':_0x6b7b('0xe'),'app':'Set','appdata':_0x6b7b('0x1c'),'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663[_0x6b7b('0x7')],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']},{'type':_0x6b7b('0xe'),'app':_0x6b7b('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xd34663[_0x6b7b('0x1b')]||_0x6b7b('0x1d'),'context':_0xd34663[_0x6b7b('0x6')],'exten':_0xd34663['exten'],'priority':_0x6c05e7++,'VoiceExtensionId':_0xd34663['id']});}return _0x2ce133;}function _0x29e3e1(_0x1175dd,_0x5bb0f8){var _0x484798=[{'name':_0x6b7b('0x1e'),'param':0x0},{'name':_0x6b7b('0x1f'),'param':0x1},{'name':_0x6b7b('0x20'),'param':0x2},{'name':_0x6b7b('0x21'),'param':0x3}];var _0xee0ba0={};var _0x5c0452=_0x5bb0f8[_0x6b7b('0x22')](',');var _0xfbc125=[];for(var _0x11b31c=0x0;_0x11b31c<_0x484798[_0x6b7b('0x23')];_0x11b31c++){switch(_0x484798[_0x11b31c][_0x6b7b('0x24')]){case _0x6b7b('0x1e'):_0xee0ba0[_0x6b7b('0x1e')]=_0x5c0452[_0x484798[_0x11b31c][_0x6b7b('0x25')]][_0x6b7b('0x22')]('/')[0x1];_0xee0ba0['phone']=_0x5c0452[_0x484798[_0x11b31c][_0x6b7b('0x25')]][_0x6b7b('0x22')]('/')[0x2];_0xee0ba0[_0x6b7b('0x26')]=_0xee0ba0[_0x6b7b('0x27')]?_0xee0ba0[_0x6b7b('0x27')][_0x6b7b('0x22')]('$')[0x0]:undefined;_0xee0ba0[_0x6b7b('0x27')]=_0x1175dd['cutdigits']?(_0xee0ba0[_0x6b7b('0x26')]||'')+_0x6b7b('0x28')+_0x1175dd[_0x6b7b('0x12')]+'}':(_0xee0ba0[_0x6b7b('0x26')]||'')+_0x6b7b('0x13');_0xfbc125[_0x484798[_0x11b31c][_0x6b7b('0x25')]]=[_0x6b7b('0x29'),_0xee0ba0[_0x6b7b('0x1e')],_0xee0ba0[_0x6b7b('0x27')]][_0x6b7b('0x2a')]('/');break;case _0x6b7b('0x20'):_0xee0ba0['options']=_0x5c0452[_0x484798[_0x11b31c][_0x6b7b('0x25')]];if(_0x1175dd[_0x6b7b('0x1b')]!==_0x6b7b('0x2b')){if(_0xee0ba0['options'][_0x6b7b('0x2c')](_0x6b7b('0x2d'))<0x0){_0xee0ba0[_0x6b7b('0x20')]+='U(xcally-mixmonitor-context)';}}else{_0xee0ba0[_0x6b7b('0x20')]=_0xee0ba0[_0x6b7b('0x20')]['replace'](_0x6b7b('0x2d'),'');}_0xfbc125[_0x484798[_0x11b31c][_0x6b7b('0x25')]]=_0xee0ba0[_0x6b7b('0x20')];break;default:_0xfbc125[_0x484798[_0x11b31c][_0x6b7b('0x25')]]=_0x5c0452[_0x484798[_0x11b31c]['param']];}}return _0xfbc125['join'](',');}function _0xc41f9d(_0x14e554,_0x40ffa7,_0x5a1dff){return new Promise(function(_0x4da4ee,_0x42552b){var _0x3f5bb5=[];if(_[_0x6b7b('0x2e')](_0x40ffa7))return _0x4da4ee(_0x3f5bb5);_0x41f2f7[_0x6b7b('0x2f')][_0x6b7b('0x30')]({'attributes':['id',_0x6b7b('0x31'),'IntervalId'],'raw':!![]})['then'](function(_0x1c22b6){for(var _0x26a4d0=0x0,_0x374c2a=0x0;_0x26a4d0<_0x40ffa7[_0x6b7b('0x23')];_0x26a4d0++,_0x374c2a=0x0){var _0x24ba98=_0x40ffa7[_0x26a4d0];var _0x2b7ae5=[];var _0x430171=[];delete _0x24ba98['id'];if(_0x24ba98[_0x6b7b('0x31')]!==_0x6b7b('0x32')){_0x24ba98[_0x6b7b('0x33')]=[_0x24ba98[_0x6b7b('0x31')]];}else{_0x24ba98['intervals']=_0x24ba98[_0x6b7b('0x34')]?_[_0x6b7b('0x35')](_[_0x6b7b('0x36')](_0x1c22b6,{'IntervalId':_0x24ba98['IntervalId']}),'interval'):[];}_0x24ba98['context']=_0x14e554['context'];_0x24ba98['exten']=_0x14e554['exten'];if(_0x24ba98[_0x6b7b('0x5')])_0x24ba98[_0x6b7b('0x5')]=_0x24ba98['type']['toLowerCase']();if(_0x14e554['type']==='outbound'){if(_0x24ba98[_0x6b7b('0x1a')]('tag')&&_0x24ba98['tag']&&_0x24ba98[_0x6b7b('0x37')]!=='--'){_0x2b7ae5['push']({'type':_0x24ba98['type'][_0x6b7b('0x38')](),'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0x39')+_0x24ba98[_0x6b7b('0x37')],'context':_0x14e554[_0x6b7b('0x6')],'exten':_0x14e554[_0x6b7b('0x7')],'priority':_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')]+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});}_0x2b7ae5[_0x6b7b('0xc')]({'type':_0x24ba98['type'][_0x6b7b('0x38')](),'app':_0x6b7b('0x15'),'appdata':_0x6b7b('0x3a')+(_0x24ba98['callerID']?_0x6b7b('0x3b')+_0x24ba98['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x14e554[_0x6b7b('0x6')],'exten':_0x14e554[_0x6b7b('0x7')],'priority':_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')]+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});}else{if(_0x24ba98[_0x6b7b('0x1a')](_0x6b7b('0x3c'))){if([_0x6b7b('0x3d'),_0x6b7b('0x3e')][_0x6b7b('0x3f')](_0x24ba98[_0x6b7b('0x40')][_0x6b7b('0x38')]())&&_0x24ba98['appType']!==_0x6b7b('0x41')){if(_0x24ba98[_0x6b7b('0x3c')]){_0x2b7ae5[_0x6b7b('0xc')]({'type':_0x24ba98[_0x6b7b('0x5')]['toLowerCase'](),'app':_0x6b7b('0x15'),'appdata':_0x6b7b('0x42'),'context':_0x14e554[_0x6b7b('0x6')],'exten':_0x14e554[_0x6b7b('0x7')],'priority':_0x24ba98[_0x6b7b('0x33')]['length']+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});_0x2b7ae5[_0x6b7b('0xc')]({'type':_0x24ba98['type'][_0x6b7b('0x38')](),'app':_0x6b7b('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x14e554[_0x6b7b('0x6')],'exten':_0x14e554[_0x6b7b('0x7')],'priority':_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')]+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});}else{_0x2b7ae5['push']({'type':_0x24ba98[_0x6b7b('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':_0x6b7b('0x43'),'context':_0x14e554['context'],'exten':_0x14e554[_0x6b7b('0x7')],'priority':_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')]+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});_0x2b7ae5[_0x6b7b('0xc')]({'type':_0x24ba98[_0x6b7b('0x5')][_0x6b7b('0x38')](),'app':_0x6b7b('0x3'),'appdata':_0x6b7b('0x44'),'context':_0x14e554[_0x6b7b('0x6')],'exten':_0x14e554['exten'],'priority':_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')]+_0x5a1dff+_0x374c2a++,'VoiceExtensionId':_0x14e554['id']});}}}}for(var _0x391bd5=0x0;_0x391bd5<_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')];_0x391bd5++){var _0x3e2eda=_0x5a1dff+_0x24ba98[_0x6b7b('0x33')][_0x6b7b('0x23')];var _0x5c02ee=_0x391bd5===_0x24ba98['intervals'][_0x6b7b('0x23')]-0x1?_0x5a1dff+_0x2b7ae5['length']+_0x430171[_0x6b7b('0x23')]+0x2:_0x5a1dff+_0x391bd5+0x1;_0x2b7ae5['splice'](_0x391bd5,0x0,{'type':_0x14e554[_0x6b7b('0x5')],'app':_0x6b7b('0x45'),'appdata':_0x24ba98[_0x6b7b('0x33')][_0x391bd5]+'?'+_0x14e554[_0x6b7b('0x6')]+_0x6b7b('0x46')+_0x3e2eda+':'+_0x14e554[_0x6b7b('0x6')]+',${EXTEN},'+_0x5c02ee,'exten':_0x14e554[_0x6b7b('0x7')],'context':_0x14e554[_0x6b7b('0x6')],'priority':_0x5a1dff+_0x391bd5,'VoiceExtensionId':_0x14e554['id']});}if(_0x24ba98[_0x6b7b('0x47')]==='outboundDial')_0x24ba98[_0x6b7b('0x48')]=_0x29e3e1(_0x14e554,_0x24ba98[_0x6b7b('0x48')]);_0x24ba98['priority']=_0x2b7ae5[_0x6b7b('0x23')]?_[_0x6b7b('0x49')](_0x2b7ae5)['priority']+0x1:_0x5a1dff;_0x3f5bb5=_['concat'](_0x3f5bb5,_0x2b7ae5,[_0x24ba98],_0x430171);_0x5a1dff=_[_0x6b7b('0x49')](_0x3f5bb5)[_0x6b7b('0x4a')]+0x1;}return _0x4da4ee(_0x3f5bb5);})[_0x6b7b('0x4b')](function(_0x52ff8a){_0x42552b(_0x52ff8a);});});}return _0x5736d0['define'](_0x6b7b('0x4c'),attributes,{'tableName':_0x6b7b('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x260565){var _0x3b21c8=this['get']({'plain':!![]});var _0x28273b=_0x3b21c8[_0x6b7b('0x5')]==='outbound'?_0x4ef35b(_0x3b21c8):_0x4de582(_0x3b21c8);return _0xc41f9d(_0x3b21c8,_0x260565,_[_0x6b7b('0x49')](_0x28273b)[_0x6b7b('0x4a')]+0x1)[_0x6b7b('0x4e')](function(_0x56b93a){var _0x3832fc=_['concat'](_0x28273b,_0x56b93a);_0x3832fc[_0x6b7b('0xc')]({'type':_0x3b21c8[_0x6b7b('0x5')],'app':_0x6b7b('0x4f'),'exten':_0x3b21c8[_0x6b7b('0x7')],'context':_0x3b21c8[_0x6b7b('0x6')],'priority':_[_0x6b7b('0x49')](_0x3832fc)[_0x6b7b('0x4a')]+0x1,'VoiceExtensionId':_0x3b21c8['id']});return _0x3832fc;});}}});}; \ No newline at end of file +var _0x971d=['map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','playback','includes','app','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','phone','prefix','SIP','join','none','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','IntervalId','interval','intervals'];(function(_0x23e1fe,_0x42ee7d){var _0x496cb8=function(_0x2a37d7){while(--_0x2a37d7){_0x23e1fe['push'](_0x23e1fe['shift']());}};_0x496cb8(++_0x42ee7d);}(_0x971d,0xc5));var _0xd971=function(_0x1ef891,_0x36a321){_0x1ef891=_0x1ef891-0x0;var _0x5dc7c7=_0x971d[_0x1ef891];return _0x5dc7c7;};'use strict';var _=require(_0xd971('0x0'));var attributes=require(_0xd971('0x1'));module[_0xd971('0x2')]=function(_0x33d485){var _0x5e22cb=_0x33d485[_0xd971('0x3')];function _0x4a3823(_0x78272f){var _0x224a7a=0x2;var _0x271319=[{'type':_0x78272f[_0xd971('0x4')],'app':_0xd971('0x5'),'appdata':_0xd971('0x6')+_0x78272f[_0xd971('0x4')],'context':_0x78272f[_0xd971('0x7')],'exten':_0x78272f[_0xd971('0x8')],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']},{'type':_0x78272f[_0xd971('0x4')],'app':_0x78272f[_0xd971('0x9')]?'Set':_0xd971('0xa'),'appdata':_0x78272f[_0xd971('0x9')]?'CDR(routeAlias)='+_0x78272f[_0xd971('0x9')]:_0xd971('0xb'),'context':_0x78272f[_0xd971('0x7')],'exten':_0x78272f[_0xd971('0x8')],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']}];if(_0x78272f['type']==='inbound'){_0x271319[_0xd971('0xc')]({'type':_0xd971('0xd'),'app':_0xd971('0x5'),'appdata':_0xd971('0xe')+_0x78272f['id'],'context':_0x78272f['context'],'exten':_0x78272f[_0xd971('0x8')],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']});}_0x271319['push']({'type':_0x78272f[_0xd971('0x4')],'app':_0xd971('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x78272f[_0xd971('0x7')],'exten':_0x78272f['exten'],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']},{'type':_0x78272f[_0xd971('0x4')],'app':_0xd971('0x5'),'appdata':_0xd971('0xf'),'context':_0x78272f[_0xd971('0x7')],'exten':_0x78272f[_0xd971('0x8')],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']},{'type':_0x78272f[_0xd971('0x4')],'app':'Set','appdata':_0xd971('0x10'),'context':_0x78272f['context'],'exten':_0x78272f[_0xd971('0x8')],'priority':_0x224a7a++,'VoiceExtensionId':_0x78272f['id']});return _0x271319;}function _0x3ff93e(_0x1e2037){var _0x499a31=0x2;var _0x2d92ca=[{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':_0xd971('0x12'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037['exten'],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0x1e2037['alias']?'Set':_0xd971('0xa'),'appdata':_0x1e2037['alias']?_0xd971('0x13')+_0x1e2037['alias']:_0xd971('0xb'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':_0xd971('0x14')+(_0x1e2037[_0xd971('0x15')]?_0xd971('0x16')+_0x1e2037[_0xd971('0x15')]+'}':_0xd971('0x17')),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':_0xd971('0xe')+_0x1e2037['id'],'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':'ExecIf','appdata':_0xd971('0x18')+(_0x499a31+0x2)+_0xd971('0x19')+(_0x499a31+0x1)+')','context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':_0x1e2037[_0xd971('0x15')]?_0xd971('0x1a')+_0x1e2037[_0xd971('0x15')]+'}':_0xd971('0x1b'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1e2037['context'],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':'outbound','app':_0xd971('0x5'),'appdata':_0xd971('0x10'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':'outboundrouteid='+_0x1e2037['id'],'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']}];if(_0x1e2037[_0xd971('0x1c')](_0xd971('0x1d'))&&_0x1e2037[_0xd971('0x1d')]!=='none'){_0x2d92ca['push']({'type':_0xd971('0x11'),'app':'Set','appdata':_0xd971('0x1e'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037['exten'],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']},{'type':_0xd971('0x11'),'app':_0xd971('0x5'),'appdata':_0xd971('0x1f')+_0x1e2037[_0xd971('0x1d')]||_0xd971('0x20'),'context':_0x1e2037[_0xd971('0x7')],'exten':_0x1e2037[_0xd971('0x8')],'priority':_0x499a31++,'VoiceExtensionId':_0x1e2037['id']});}return _0x2d92ca;}function _0x55d2af(_0x382842,_0x22aa1d){var _0x5623b0=[{'name':_0xd971('0x21'),'param':0x0},{'name':_0xd971('0x22'),'param':0x1},{'name':_0xd971('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x262383={};var _0x3c2bf8=_0x22aa1d[_0xd971('0x24')](',');var _0x29ccbb=[];for(var _0x2355de=0x0;_0x2355de<_0x5623b0[_0xd971('0x25')];_0x2355de++){switch(_0x5623b0[_0x2355de][_0xd971('0x26')]){case _0xd971('0x21'):_0x262383['trunk']=_0x3c2bf8[_0x5623b0[_0x2355de][_0xd971('0x27')]][_0xd971('0x24')]('/')[0x1];_0x262383[_0xd971('0x28')]=_0x3c2bf8[_0x5623b0[_0x2355de][_0xd971('0x27')]]['split']('/')[0x2];_0x262383[_0xd971('0x29')]=_0x262383[_0xd971('0x28')]?_0x262383[_0xd971('0x28')][_0xd971('0x24')]('$')[0x0]:undefined;_0x262383[_0xd971('0x28')]=_0x382842[_0xd971('0x15')]?(_0x262383[_0xd971('0x29')]||'')+_0xd971('0x16')+_0x382842[_0xd971('0x15')]+'}':(_0x262383['prefix']||'')+_0xd971('0x17');_0x29ccbb[_0x5623b0[_0x2355de][_0xd971('0x27')]]=[_0xd971('0x2a'),_0x262383[_0xd971('0x21')],_0x262383[_0xd971('0x28')]][_0xd971('0x2b')]('/');break;case _0xd971('0x23'):_0x262383[_0xd971('0x23')]=_0x3c2bf8[_0x5623b0[_0x2355de][_0xd971('0x27')]];if(_0x382842[_0xd971('0x1d')]!==_0xd971('0x2c')){if(_0x262383[_0xd971('0x23')]['indexOf'](_0xd971('0x2d'))<0x0){_0x262383[_0xd971('0x23')]+=_0xd971('0x2d');}}else{_0x262383[_0xd971('0x23')]=_0x262383['options'][_0xd971('0x2e')](_0xd971('0x2d'),'');}_0x29ccbb[_0x5623b0[_0x2355de]['param']]=_0x262383[_0xd971('0x23')];break;default:_0x29ccbb[_0x5623b0[_0x2355de]['param']]=_0x3c2bf8[_0x5623b0[_0x2355de]['param']];}}return _0x29ccbb[_0xd971('0x2b')](',');}function _0x17d59e(_0x1150bc,_0x57cf41,_0x59414b){return new Promise(function(_0x548e14,_0x5f132b){var _0x3f9e9f=[];if(_[_0xd971('0x2f')](_0x57cf41))return _0x548e14(_0x3f9e9f);_0x5e22cb['Interval'][_0xd971('0x30')]({'attributes':['id','interval',_0xd971('0x31')],'raw':!![]})['then'](function(_0x3b8b25){for(var _0x505b47=0x0,_0x1a3cc4=0x0;_0x505b47<_0x57cf41[_0xd971('0x25')];_0x505b47++,_0x1a3cc4=0x0){var _0x454901=_0x57cf41[_0x505b47];var _0x833ffb=[];var _0x3c0b70=[];delete _0x454901['id'];if(_0x454901[_0xd971('0x32')]!=='*,*,*,*'){_0x454901[_0xd971('0x33')]=[_0x454901[_0xd971('0x32')]];}else{_0x454901[_0xd971('0x33')]=_0x454901[_0xd971('0x31')]?_[_0xd971('0x34')](_[_0xd971('0x35')](_0x3b8b25,{'IntervalId':_0x454901[_0xd971('0x31')]}),'interval'):[];}_0x454901[_0xd971('0x7')]=_0x1150bc[_0xd971('0x7')];_0x454901[_0xd971('0x8')]=_0x1150bc[_0xd971('0x8')];if(_0x454901[_0xd971('0x4')])_0x454901['type']=_0x454901[_0xd971('0x4')][_0xd971('0x36')]();if(_0x1150bc[_0xd971('0x4')]==='outbound'){if(_0x454901[_0xd971('0x1c')](_0xd971('0x37'))&&_0x454901[_0xd971('0x37')]&&_0x454901[_0xd971('0x37')]!=='--'){_0x833ffb[_0xd971('0xc')]({'type':_0x454901[_0xd971('0x4')]['toLowerCase'](),'app':_0xd971('0x5'),'appdata':_0xd971('0x38')+_0x454901[_0xd971('0x37')],'context':_0x1150bc['context'],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901[_0xd971('0x33')][_0xd971('0x25')]+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});}_0x833ffb[_0xd971('0xc')]({'type':_0x454901[_0xd971('0x4')]['toLowerCase'](),'app':_0xd971('0x39'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x454901['callerID']?_0xd971('0x3a')+_0x454901[_0xd971('0x3b')]+')':_0xd971('0x3c')),'context':_0x1150bc[_0xd971('0x7')],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901[_0xd971('0x33')]['length']+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});}else{if(_0x454901[_0xd971('0x1c')]('answer')){if(['queue',_0xd971('0x3d')][_0xd971('0x3e')](_0x454901[_0xd971('0x3f')]['toLowerCase']())&&_0x454901['appType']!=='custom'){if(_0x454901[_0xd971('0x40')]){_0x833ffb[_0xd971('0xc')]({'type':_0x454901['type'][_0xd971('0x36')](),'app':_0xd971('0x39'),'appdata':_0xd971('0x41'),'context':_0x1150bc[_0xd971('0x7')],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901[_0xd971('0x33')][_0xd971('0x25')]+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});_0x833ffb[_0xd971('0xc')]({'type':_0x454901[_0xd971('0x4')][_0xd971('0x36')](),'app':_0xd971('0x5'),'appdata':_0xd971('0x42'),'context':_0x1150bc[_0xd971('0x7')],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901['intervals']['length']+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});}else{_0x833ffb['push']({'type':_0x454901['type'][_0xd971('0x36')](),'app':'ExecIf','appdata':_0xd971('0x43'),'context':_0x1150bc[_0xd971('0x7')],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901[_0xd971('0x33')][_0xd971('0x25')]+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});_0x833ffb[_0xd971('0xc')]({'type':_0x454901['type'][_0xd971('0x36')](),'app':_0xd971('0x5'),'appdata':_0xd971('0x44'),'context':_0x1150bc['context'],'exten':_0x1150bc[_0xd971('0x8')],'priority':_0x454901['intervals'][_0xd971('0x25')]+_0x59414b+_0x1a3cc4++,'VoiceExtensionId':_0x1150bc['id']});}}}}for(var _0x21e039=0x0;_0x21e039<_0x454901[_0xd971('0x33')][_0xd971('0x25')];_0x21e039++){var _0x5c1a4e=_0x59414b+_0x454901[_0xd971('0x33')][_0xd971('0x25')];var _0x58432e=_0x21e039===_0x454901[_0xd971('0x33')]['length']-0x1?_0x59414b+_0x833ffb['length']+_0x3c0b70[_0xd971('0x25')]+0x2:_0x59414b+_0x21e039+0x1;_0x833ffb[_0xd971('0x45')](_0x21e039,0x0,{'type':_0x1150bc[_0xd971('0x4')],'app':_0xd971('0x46'),'appdata':_0x454901[_0xd971('0x33')][_0x21e039]+'?'+_0x1150bc[_0xd971('0x7')]+_0xd971('0x47')+_0x5c1a4e+':'+_0x1150bc['context']+_0xd971('0x47')+_0x58432e,'exten':_0x1150bc[_0xd971('0x8')],'context':_0x1150bc[_0xd971('0x7')],'priority':_0x59414b+_0x21e039,'VoiceExtensionId':_0x1150bc['id']});}if(_0x454901[_0xd971('0x48')]===_0xd971('0x49'))_0x454901[_0xd971('0x4a')]=_0x55d2af(_0x1150bc,_0x454901[_0xd971('0x4a')]);_0x454901[_0xd971('0x4b')]=_0x833ffb[_0xd971('0x25')]?_[_0xd971('0x4c')](_0x833ffb)[_0xd971('0x4b')]+0x1:_0x59414b;_0x3f9e9f=_[_0xd971('0x4d')](_0x3f9e9f,_0x833ffb,[_0x454901],_0x3c0b70);_0x59414b=_[_0xd971('0x4c')](_0x3f9e9f)[_0xd971('0x4b')]+0x1;}return _0x548e14(_0x3f9e9f);})[_0xd971('0x4e')](function(_0x1b5e4b){_0x5f132b(_0x1b5e4b);});});}return _0x33d485['define'](_0xd971('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x21ccc6){var _0x17740f=this[_0xd971('0x50')]({'plain':!![]});var _0x700f69=_0x17740f[_0xd971('0x4')]===_0xd971('0x11')?_0x3ff93e(_0x17740f):_0x4a3823(_0x17740f);return _0x17d59e(_0x17740f,_0x21ccc6,_[_0xd971('0x4c')](_0x700f69)['priority']+0x1)[_0xd971('0x51')](function(_0x2cef11){var _0x54bbd2=_[_0xd971('0x4d')](_0x700f69,_0x2cef11);_0x54bbd2[_0xd971('0xc')]({'type':_0x17740f['type'],'app':_0xd971('0x52'),'exten':_0x17740f[_0xd971('0x8')],'context':_0x17740f[_0xd971('0x7')],'priority':_[_0xd971('0x4c')](_0x54bbd2)[_0xd971('0x4b')]+0x1,'VoiceExtensionId':_0x17740f['id']});return _0x54bbd2;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d40f03c..83fca3d 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 _0xc0a4=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','include','map','model','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5425a9,_0x3d7066){var _0xd9deac=function(_0x5687fa){while(--_0x5687fa){_0x5425a9['push'](_0x5425a9['shift']());}};_0xd9deac(++_0x3d7066);}(_0xc0a4,0x147));var _0x4c0a=function(_0x1960a5,_0x182719){_0x1960a5=_0x1960a5-0x0;var _0x3ad4ba=_0xc0a4[_0x1960a5];return _0x3ad4ba;};'use strict';var _=require('lodash');var util=require(_0x4c0a('0x0'));var moment=require(_0x4c0a('0x1'));var BPromise=require(_0x4c0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c0a('0x3'));var db=require(_0x4c0a('0x4'))['db'];var utils=require(_0x4c0a('0x5'));var logger=require(_0x4c0a('0x6'))(_0x4c0a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c0a('0x8'));var client=jayson[_0x4c0a('0x9')][_0x4c0a('0xa')]({'port':0x232a});config[_0x4c0a('0xb')]=_[_0x4c0a('0xc')](config[_0x4c0a('0xb')],{'host':_0x4c0a('0xd'),'port':0x18eb});var socket=require(_0x4c0a('0xe'))(new Redis(config[_0x4c0a('0xb')]));require('./voiceExtension.socket')[_0x4c0a('0xf')](socket);function respondWithRpcPromise(_0x47689f,_0x175b4c,_0x3c930d){return new BPromise(function(_0xde3e16,_0x270082){return client[_0x4c0a('0x10')](_0x47689f,_0x3c930d)[_0x4c0a('0x11')](function(_0x1aaedb){logger[_0x4c0a('0x12')](_0x4c0a('0x13'),_0x175b4c,_0x4c0a('0x14'));logger['debug'](_0x4c0a('0x15'),_0x175b4c,_0x4c0a('0x14'),JSON[_0x4c0a('0x16')](_0x1aaedb));if(_0x1aaedb[_0x4c0a('0x17')]){if(_0x1aaedb['error'][_0x4c0a('0x18')]===0x1f4){logger[_0x4c0a('0x17')](_0x4c0a('0x13'),_0x175b4c,_0x1aaedb[_0x4c0a('0x17')][_0x4c0a('0x19')]);return _0x270082(_0x1aaedb[_0x4c0a('0x17')][_0x4c0a('0x19')]);}logger[_0x4c0a('0x17')](_0x4c0a('0x13'),_0x175b4c,_0x1aaedb[_0x4c0a('0x17')][_0x4c0a('0x19')]);return _0xde3e16(_0x1aaedb[_0x4c0a('0x17')][_0x4c0a('0x19')]);}else{logger[_0x4c0a('0x12')](_0x4c0a('0x13'),_0x175b4c,_0x4c0a('0x14'));_0xde3e16(_0x1aaedb['result'][_0x4c0a('0x19')]);}})['catch'](function(_0x26070f){logger[_0x4c0a('0x17')](_0x4c0a('0x13'),_0x175b4c,_0x26070f);_0x270082(_0x26070f);});});}exports[_0x4c0a('0x1a')]=function(_0x2d2d38){var _0x4b7309=this;return new Promise(function(_0x26cc4b,_0x5e7cf1){return db[_0x4c0a('0x1b')][_0x4c0a('0x1c')]({'raw':_0x2d2d38[_0x4c0a('0x1d')]?_0x2d2d38[_0x4c0a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2d2d38[_0x4c0a('0x1d')]?_0x2d2d38[_0x4c0a('0x1d')][_0x4c0a('0x1e')]||null:null,'attributes':_0x2d2d38[_0x4c0a('0x1d')]?_0x2d2d38[_0x4c0a('0x1d')][_0x4c0a('0x1f')]||null:null,'limit':_0x2d2d38[_0x4c0a('0x1d')]?_0x2d2d38['options']['limit']||null:null,'include':_0x2d2d38[_0x4c0a('0x1d')]?_0x2d2d38['options'][_0x4c0a('0x20')]?_[_0x4c0a('0x21')](_0x2d2d38[_0x4c0a('0x1d')][_0x4c0a('0x20')],function(_0x117ac7){return{'model':db[_0x117ac7['model']],'as':_0x117ac7['as'],'attributes':_0x117ac7[_0x4c0a('0x1f')],'include':_0x117ac7[_0x4c0a('0x20')]?_['map'](_0x117ac7['include'],function(_0x53298d){return{'model':db[_0x53298d[_0x4c0a('0x22')]],'as':_0x53298d['as'],'attributes':_0x53298d['attributes'],'include':_0x53298d['include']?_[_0x4c0a('0x21')](_0x53298d['include'],function(_0x23bee2){return{'model':db[_0x23bee2[_0x4c0a('0x22')]],'as':_0x23bee2['as'],'attributes':_0x23bee2[_0x4c0a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e71bb){logger[_0x4c0a('0x12')]('GetVoiceExtension',_0x2d2d38);logger[_0x4c0a('0x23')](_0x4c0a('0x1a'),_0x2d2d38,JSON[_0x4c0a('0x16')](_0x2e71bb));_0x26cc4b(_0x2e71bb);})[_0x4c0a('0x24')](function(_0x5cf3c7){logger[_0x4c0a('0x17')](_0x4c0a('0x1a'),_0x5cf3c7['message'],_0x2d2d38);_0x5e7cf1(_0x4b7309[_0x4c0a('0x17')](0x1f4,_0x5cf3c7[_0x4c0a('0x19')]));});});}; \ No newline at end of file +var _0x5f71=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceExtension','findAll','options','where','limit','map','attributes','include','GetVoiceExtension','lodash','moment','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5f71,0xc9));var _0x15f7=function(_0x38d0b7,_0x4320fa){_0x38d0b7=_0x38d0b7-0x0;var _0x394e61=_0x5f71[_0x38d0b7];return _0x394e61;};'use strict';var _=require(_0x15f7('0x0'));var util=require('util');var moment=require(_0x15f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x15f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15f7('0x3'))(_0x15f7('0x4'));var config=require('../../config/environment');var jayson=require(_0x15f7('0x5'));var client=jayson[_0x15f7('0x6')][_0x15f7('0x7')]({'port':0x232a});config[_0x15f7('0x8')]=_[_0x15f7('0x9')](config[_0x15f7('0x8')],{'host':_0x15f7('0xa'),'port':0x18eb});var socket=require(_0x15f7('0xb'))(new Redis(config[_0x15f7('0x8')]));require(_0x15f7('0xc'))[_0x15f7('0xd')](socket);function respondWithRpcPromise(_0x40dbfa,_0x4b53ab,_0x4f09e7){return new BPromise(function(_0x4fddfc,_0x121607){return client['request'](_0x40dbfa,_0x4f09e7)[_0x15f7('0xe')](function(_0x9cbf6){logger[_0x15f7('0xf')](_0x15f7('0x10'),_0x4b53ab,_0x15f7('0x11'));logger[_0x15f7('0x12')](_0x15f7('0x13'),_0x4b53ab,'request\x20sent',JSON[_0x15f7('0x14')](_0x9cbf6));if(_0x9cbf6[_0x15f7('0x15')]){if(_0x9cbf6[_0x15f7('0x15')]['code']===0x1f4){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6['error'][_0x15f7('0x16')]);return _0x121607(_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);}logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);return _0x4fddfc(_0x9cbf6['error'][_0x15f7('0x16')]);}else{logger[_0x15f7('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x4b53ab,_0x15f7('0x11'));_0x4fddfc(_0x9cbf6[_0x15f7('0x17')][_0x15f7('0x16')]);}})[_0x15f7('0x18')](function(_0x26627b){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x26627b);_0x121607(_0x26627b);});});}exports['GetVoiceExtension']=function(_0x299fcf){var _0xb6ea4f=this;return new Promise(function(_0x1362e1,_0x422c6e){return db[_0x15f7('0x19')][_0x15f7('0x1a')]({'raw':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options']['raw']===undefined?!![]:![]:!![],'where':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf[_0x15f7('0x1b')][_0x15f7('0x1c')]||null:null,'attributes':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf[_0x15f7('0x1b')]['attributes']||null:null,'limit':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options'][_0x15f7('0x1d')]||null:null,'include':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options']['include']?_[_0x15f7('0x1e')](_0x299fcf['options']['include'],function(_0x2928fa){return{'model':db[_0x2928fa['model']],'as':_0x2928fa['as'],'attributes':_0x2928fa[_0x15f7('0x1f')],'include':_0x2928fa[_0x15f7('0x20')]?_[_0x15f7('0x1e')](_0x2928fa[_0x15f7('0x20')],function(_0x2d4d2d){return{'model':db[_0x2d4d2d['model']],'as':_0x2d4d2d['as'],'attributes':_0x2d4d2d[_0x15f7('0x1f')],'include':_0x2d4d2d[_0x15f7('0x20')]?_[_0x15f7('0x1e')](_0x2d4d2d['include'],function(_0x4dd3d6){return{'model':db[_0x4dd3d6['model']],'as':_0x4dd3d6['as'],'attributes':_0x4dd3d6['attributes']};}):[]};}):[]};}):[]:[]})[_0x15f7('0xe')](function(_0x432384){logger[_0x15f7('0xf')](_0x15f7('0x21'),_0x299fcf);logger[_0x15f7('0x12')](_0x15f7('0x21'),_0x299fcf,JSON['stringify'](_0x432384));_0x1362e1(_0x432384);})['catch'](function(_0x31bf43){logger[_0x15f7('0x15')](_0x15f7('0x21'),_0x31bf43['message'],_0x299fcf);_0x422c6e(_0xb6ea4f[_0x15f7('0x15')](0x1f4,_0x31bf43['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 978a0f0..d41357a 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x1e33d1,_0x2129c6){var _0x4a58a6=function(_0x4254da){while(--_0x4254da){_0x1e33d1['push'](_0x1e33d1['shift']());}};_0x4a58a6(++_0x2129c6);}(_0xf494,0x1c6));var _0x4f49=function(_0x57d98e,_0x2cdedb){_0x57d98e=_0x57d98e-0x0;var _0x5e3656=_0xf494[_0x57d98e];return _0x5e3656;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0xaa1963,_0x5c4cc1){var _0x5a902e=function(_0x1084d4){while(--_0x1084d4){_0xaa1963['push'](_0xaa1963['shift']());}};_0x5a902e(++_0x5c4cc1);}(_0xf494,0x1c6));var _0x4f49=function(_0x2913c9,_0x40213d){_0x2913c9=_0x2913c9-0x0;var _0x39d430=_0xf494[_0x2913c9];return _0x39d430;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index bec401f..2d26e8a 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 _0x7096=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x42f6d1,_0x52c740){var _0x50ae08=function(_0x419bf5){while(--_0x419bf5){_0x42f6d1['push'](_0x42f6d1['shift']());}};_0x50ae08(++_0x52c740);}(_0x7096,0x10c));var _0x6709=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x7096[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id/messages',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0x11')]);router[_0x6709('0x12')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0x13')]);module[_0x6709('0x14')]=router; \ No newline at end of file +var _0x4888=['/:id/messages','post','create','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x4888,0x198));var _0x8488=function(_0x1bba6c,_0x1f94cf){_0x1bba6c=_0x1bba6c-0x0;var _0x415735=_0x4888[_0x1bba6c];return _0x415735;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['getMessages']);router[_0x8488('0xd')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router[_0x8488('0xf')]('/:id',auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x11')](_0x8488('0x12'),auth[_0x8488('0xa')](),controller['destroy']);module[_0x8488('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6b7eb09..f7322eb 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 _0xacd3=['exports','from-voicemail','contest_mailbox','STRING','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0xacd3,0xbf));var _0x3acd=function(_0x1b9908,_0x26e311){_0x1b9908=_0x1b9908-0x0;var _0x568715=_0xacd3[_0x1b9908];return _0x568715;};'use strict';var Sequelize=require(_0x3acd('0x0'));module[_0x3acd('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3acd('0x2'),'unique':_0x3acd('0x3')},'mailbox':{'type':Sequelize[_0x3acd('0x4')],'defaultValue':'','allowNull':![],'unique':_0x3acd('0x3')},'password':{'type':Sequelize[_0x3acd('0x4')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3acd('0x4')],'validate':{'isEmail':!![]},'set':function(_0x15bd4b){this['setDataValue']('email',typeof _0x15bd4b==='string'&&_0x15bd4b[_0x3acd('0x5')]()?_0x15bd4b[_0x3acd('0x5')]():null);}},'pager':{'type':Sequelize[_0x3acd('0x4')]},'tz':{'type':Sequelize[_0x3acd('0x4')],'defaultValue':_0x3acd('0x6')},'attach':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':_0x3acd('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':_0x3acd('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3acd('0x4')]},'callback':{'type':Sequelize[_0x3acd('0x4')]},'review':{'type':Sequelize['ENUM'](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3acd('0x7')](_0x3acd('0x8'),'no'),'defaultValue':_0x3acd('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3acd('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3acd('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3acd('0x8'),'no'),'defaultValue':_0x3acd('0x8'),'allowNull':![]},'stamp':{'type':_0x3acd('0x9')},'emailsubject':{'type':Sequelize[_0x3acd('0x4')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3acd('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3acd('0xb')],'get':function(){return this[_0x3acd('0xc')](_0x3acd('0xd'))+_0x3acd('0xe')+this['getDataValue'](_0x3acd('0xf'));}}}; \ No newline at end of file +var _0xd4fc=['email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0xd4fc,0xd8));var _0xcd4f=function(_0x174d2e,_0x18e463){_0x174d2e=_0x174d2e-0x0;var _0x3fc354=_0xd4fc[_0x174d2e];return _0x3fc354;};'use strict';var Sequelize=require(_0xcd4f('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xcd4f('0x1')]},'context':{'type':Sequelize[_0xcd4f('0x1')],'defaultValue':_0xcd4f('0x2'),'unique':_0xcd4f('0x3')},'mailbox':{'type':Sequelize[_0xcd4f('0x1')],'defaultValue':'','allowNull':![],'unique':_0xcd4f('0x3')},'password':{'type':Sequelize[_0xcd4f('0x1')]},'fullname':{'type':Sequelize[_0xcd4f('0x1')]},'email':{'type':Sequelize[_0xcd4f('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1ce6b6){this[_0xcd4f('0x4')](_0xcd4f('0x5'),typeof _0x1ce6b6===_0xcd4f('0x6')&&_0x1ce6b6[_0xcd4f('0x7')]()?_0x1ce6b6['trim']():null);}},'pager':{'type':Sequelize[_0xcd4f('0x1')]},'tz':{'type':Sequelize[_0xcd4f('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xcd4f('0x8')]('yes','no'),'defaultValue':_0xcd4f('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':_0xcd4f('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xcd4f('0x1')]},'callback':{'type':Sequelize[_0xcd4f('0x1')]},'review':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xcd4f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xcd4f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xcd4f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xcd4f('0x8')]('yes','no'),'defaultValue':_0xcd4f('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xcd4f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xcd4f('0x8')](_0xcd4f('0x9'),'no'),'defaultValue':_0xcd4f('0x9'),'allowNull':![]},'stamp':{'type':_0xcd4f('0xb')},'emailsubject':{'type':Sequelize[_0xcd4f('0x1')]},'emailbody':{'type':Sequelize[_0xcd4f('0x1')]},'maxsecs':{'type':Sequelize[_0xcd4f('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xcd4f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xcd4f('0xd')],'get':function(){return this[_0xcd4f('0xe')](_0xcd4f('0xf'))+_0xcd4f('0x10')+this[_0xcd4f('0xe')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 83b609d..e5534c4 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 _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x25b21d,_0x360901){var _0x15f1a=function(_0x1979da){while(--_0x1979da){_0x25b21d['push'](_0x25b21d['shift']());}};_0x15f1a(++_0x360901);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file +var _0xb58b=['destroy','then','get','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5c6bf6,_0x3869ed){_0x5c6bf6=_0x5c6bf6-0x0;var _0x42b3d8=_0xb58b[_0x5c6bf6];return _0x42b3d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){var _0x2d111c=_0x287822[_0xbb58('0x27')]({'plain':!![]});var _0x2d556a=_0xbb58('0x28');return db['UserProfileResource'][_0xbb58('0x25')]({'where':{'type':_0x2d556a,'resourceId':_0x2d111c['id']}})[_0xbb58('0x26')](function(){return _0x287822;});})[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x521d0c,_0x3608dc){return function(_0x2ce7c3){if(!_0x2ce7c3){_0x521d0c[_0xbb58('0x18')](0x194);}return _0x2ce7c3;};}function handleError(_0x2d5b39,_0xf6687e){_0xf6687e=_0xf6687e||0x1f4;return function(_0x28b3a3){logger[_0xbb58('0x29')](_0x28b3a3[_0xbb58('0x2a')]);if(_0x28b3a3[_0xbb58('0x2b')]){delete _0x28b3a3['name'];}_0x2d5b39[_0xbb58('0x19')](_0xf6687e)[_0xbb58('0x2c')](_0x28b3a3);};}exports[_0xbb58('0x2d')]=function(_0x3c9cee,_0x3304b9){var _0x9d379f={},_0x1ba526={},_0x643e0e={'count':0x0,'rows':[]};var _0x3f8db3=_['map'](db[_0xbb58('0x2e')][_0xbb58('0x2f')],function(_0x3edc34){return{'name':_0x3edc34[_0xbb58('0x30')],'type':_0x3edc34[_0xbb58('0x31')][_0xbb58('0x32')]};});_0x1ba526[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x3f8db3,_0xbb58('0x2b'));_0x1ba526[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3c9cee[_0xbb58('0x35')]);_0x1ba526[_0xbb58('0x37')]=_['intersection'](_0x1ba526['model'],_0x1ba526['query']);_0x9d379f[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x1ba526[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3a')]));_0x9d379f[_0xbb58('0x38')]=_0x9d379f[_0xbb58('0x38')]['length']?_0x9d379f[_0xbb58('0x38')]:_0x1ba526[_0xbb58('0x33')];if(!_0x3c9cee['query'][_0xbb58('0x3b')]('nolimit')){_0x9d379f[_0xbb58('0x1e')]=qs['limit'](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1e')]);_0x9d379f['offset']=qs[_0xbb58('0x1c')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1c')]);}_0x9d379f[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3d')]);_0x9d379f[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3c9cee[_0xbb58('0x35')],_0x1ba526[_0xbb58('0x37')]),_0x3f8db3);if(_0x3c9cee['query']['filter']){_0x9d379f[_0xbb58('0x3e')]=_['merge'](_0x9d379f[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x3f8db3,function(_0x2ab2d8){if(_0x2ab2d8['type']!=='VIRTUAL'){var _0xc29171={};_0xc29171[_0x2ab2d8[_0xbb58('0x2b')]]={'$like':'%'+_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x40')]+'%'};return _0xc29171;}})});}_0x9d379f=_[_0xbb58('0x41')]({},_0x9d379f,_0x3c9cee[_0xbb58('0x42')]);var _0x5797e7={'where':_0x9d379f[_0xbb58('0x3e')]};return db[_0xbb58('0x2e')][_0xbb58('0x1d')](_0x5797e7)[_0xbb58('0x26')](function(_0x1185b3){_0x643e0e[_0xbb58('0x1d')]=_0x1185b3;if(_0x3c9cee['query'][_0xbb58('0x43')]){_0x9d379f['include']=[{'all':!![]}];}return db[_0xbb58('0x2e')][_0xbb58('0x44')](_0x9d379f);})[_0xbb58('0x26')](function(_0x45817f){_0x643e0e['rows']=_0x45817f;return _0x643e0e;})[_0xbb58('0x26')](respondWithFilteredResult(_0x3304b9,_0x9d379f))[_0xbb58('0x45')](handleError(_0x3304b9,null));};exports[_0xbb58('0x46')]=function(_0x3a732c,_0x5b95f7){var _0x2ecc1b={'raw':!![],'where':{'id':_0x3a732c[_0xbb58('0x47')]['id']}},_0x5250e0={};_0x5250e0[_0xbb58('0x33')]=_[_0xbb58('0x36')](db[_0xbb58('0x2e')][_0xbb58('0x2f')]);_0x5250e0[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3a732c[_0xbb58('0x35')]);_0x5250e0[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x5250e0[_0xbb58('0x33')],_0x5250e0[_0xbb58('0x35')]);_0x2ecc1b[_0xbb58('0x38')]=_['intersection'](_0x5250e0[_0xbb58('0x33')],qs['fields'](_0x3a732c['query'][_0xbb58('0x3a')]));_0x2ecc1b[_0xbb58('0x38')]=_0x2ecc1b[_0xbb58('0x38')][_0xbb58('0x48')]?_0x2ecc1b[_0xbb58('0x38')]:_0x5250e0[_0xbb58('0x33')];if(_0x3a732c[_0xbb58('0x35')][_0xbb58('0x43')]){_0x2ecc1b[_0xbb58('0x49')]=[{'all':!![]}];}_0x2ecc1b=_[_0xbb58('0x41')]({},_0x2ecc1b,_0x3a732c[_0xbb58('0x42')]);return db['VoiceMail'][_0xbb58('0x4a')](_0x2ecc1b)[_0xbb58('0x26')](handleEntityNotFound(_0x5b95f7,null))['then'](respondWithResult(_0x5b95f7,null))[_0xbb58('0x45')](handleError(_0x5b95f7,null));};exports[_0xbb58('0x4b')]=function(_0xf94897,_0xdb0ff7){return db['VoiceMail'][_0xbb58('0x4b')](_0xf94897['body'],{})[_0xbb58('0x26')](function(_0x336598){var _0x471917=_0xf94897['user'][_0xbb58('0x27')]({'plain':!![]});if(!_0x471917)throw new Error(_0xbb58('0x4c'));if(_0x471917['role']===_0xbb58('0x4d')){var _0x4ca201=_0x336598[_0xbb58('0x27')]({'plain':!![]});var _0x2d81e0=_0xbb58('0x28');return db[_0xbb58('0x4e')][_0xbb58('0x4a')]({'where':{'name':_0x2d81e0,'userProfileId':_0x471917[_0xbb58('0x4f')]},'raw':!![]})[_0xbb58('0x26')](function(_0x4cb975){if(_0x4cb975&&_0x4cb975[_0xbb58('0x50')]===0x0){return db[_0xbb58('0x51')]['create']({'name':_0x4ca201[_0xbb58('0x2b')],'resourceId':_0x4ca201['id'],'type':_0x4cb975[_0xbb58('0x2b')],'sectionId':_0x4cb975['id']},{})['then'](function(){return _0x336598;});}else{return _0x336598;}})[_0xbb58('0x45')](function(_0x44636b){logger[_0xbb58('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44636b);throw _0x44636b;});}return _0x336598;})[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,0xc9))[_0xbb58('0x45')](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x24')]=function(_0x592879,_0x537ed5){if(_0x592879['body']['id']){delete _0x592879[_0xbb58('0x52')]['id'];}return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x592879['params']['id']}})['then'](handleEntityNotFound(_0x537ed5,null))[_0xbb58('0x26')](saveUpdates(_0x592879[_0xbb58('0x52')],null))[_0xbb58('0x26')](respondWithResult(_0x537ed5,null))[_0xbb58('0x45')](handleError(_0x537ed5,null));};exports[_0xbb58('0x25')]=function(_0x5290be,_0x362b91){return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x5290be['params']['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x362b91,null))[_0xbb58('0x26')](removeEntity(_0x362b91,null))[_0xbb58('0x45')](handleError(_0x362b91,null));};exports[_0xbb58('0x53')]=function(_0x3f5add,_0x5e7ae0,_0x1174b1){return db[_0xbb58('0x2e')][_0xbb58('0x54')]({'where':{'id':_0x3f5add[_0xbb58('0x47')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x5e7ae0,null))[_0xbb58('0x26')](function(_0x85278c){var _0x58ced2;var _0x55d5be={},_0x344b0d={};_0x344b0d['model']=_[_0xbb58('0x36')](db[_0xbb58('0x55')][_0xbb58('0x2f')]);_0x344b0d[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3f5add[_0xbb58('0x35')]);_0x344b0d[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x344b0d[_0xbb58('0x33')],_0x344b0d[_0xbb58('0x35')]);_0x55d5be[_0xbb58('0x38')]=_['intersection'](_0x344b0d[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3f5add[_0xbb58('0x35')]['fields']));_0x55d5be[_0xbb58('0x38')]=_0x55d5be['attributes'][_0xbb58('0x48')]?_0x55d5be[_0xbb58('0x38')]:_0x344b0d['model'];if(!_0x3f5add[_0xbb58('0x35')][_0xbb58('0x3b')](_0xbb58('0x56'))){_0x55d5be[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x3f5add['query']['limit']);_0x55d5be[_0xbb58('0x1c')]=qs[_0xbb58('0x1c')](_0x3f5add[_0xbb58('0x35')]['offset']);}_0x55d5be[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3f5add['query'][_0xbb58('0x3d')]);_0x55d5be[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3f5add[_0xbb58('0x35')],_0x344b0d[_0xbb58('0x37')]));if(_0x3f5add[_0xbb58('0x35')][_0xbb58('0x40')]){_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x55d5be[_0xbb58('0x38')],function(_0x2c9093){var _0x5e17fc={};_0x5e17fc[_0x2c9093]={'$like':'%'+_0x3f5add['query'][_0xbb58('0x40')]+'%'};return _0x5e17fc;})});}_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'mailboxuser':_0x85278c[_0xbb58('0x57')]});_0x55d5be=_[_0xbb58('0x41')]({},_0x55d5be,_0x3f5add[_0xbb58('0x42')]);return db[_0xbb58('0x55')][_0xbb58('0x58')](_0x55d5be)[_0xbb58('0x26')](respondWithFilteredResult(_0x5e7ae0,_0x55d5be));})[_0xbb58('0x45')](handleError(_0x5e7ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3230969..89877ee 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 _0x228d=['mailbox','context','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context'];(function(_0x1daeaa,_0x297e73){var _0x2a6032=function(_0x11897b){while(--_0x11897b){_0x1daeaa['push'](_0x1daeaa['shift']());}};_0x2a6032(++_0x297e73);}(_0x228d,0x1b4));var _0xd228=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x228d[_0x31b31b];return _0x2c8fc2;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var logger=require(_0xd228('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd228('0x3'));var rp=require(_0xd228('0x4'));var fs=require('fs');var path=require(_0xd228('0x5'));var rimraf=require(_0xd228('0x6'));var config=require('../../config/environment');var attributes=require(_0xd228('0x7'));module[_0xd228('0x8')]=function(_0xd2083f,_0x17513b){return _0xd2083f[_0xd228('0x9')]('VoiceMail',attributes,{'tableName':_0xd228('0xa'),'paranoid':![],'indexes':[{'name':_0xd228('0xb'),'fields':[_0xd228('0xc'),_0xd228('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x455c=['define','VoiceMail','voice_voicemail','mailbox_context','util','api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports'];(function(_0x1dd712,_0x33e5f8){var _0x5c1059=function(_0xa30dde){while(--_0xa30dde){_0x1dd712['push'](_0x1dd712['shift']());}};_0x5c1059(++_0x33e5f8);}(_0x455c,0x1f0));var _0xc455=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x455c[_0x38ced4];return _0x547c07;};'use strict';var _=require('lodash');var util=require(_0xc455('0x0'));var logger=require('../../config/logger')(_0xc455('0x1'));var moment=require('moment');var BPromise=require(_0xc455('0x2'));var rp=require(_0xc455('0x3'));var fs=require('fs');var path=require(_0xc455('0x4'));var rimraf=require(_0xc455('0x5'));var config=require('../../config/environment');var attributes=require(_0xc455('0x6'));module[_0xc455('0x7')]=function(_0x2ad71a,_0xbade5){return _0x2ad71a[_0xc455('0x8')](_0xc455('0x9'),attributes,{'tableName':_0xc455('0xa'),'paranoid':![],'indexes':[{'name':_0xc455('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 238f989..3556664 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 _0xbff9=['../../config/environment','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xbff9,0x1db));var _0x9bff=function(_0xfd1f03,_0x4f7fcf){_0xfd1f03=_0xfd1f03-0x0;var _0x1da258=_0xbff9[_0xfd1f03];return _0x1da258;};'use strict';var _=require('lodash');var util=require(_0x9bff('0x0'));var moment=require(_0x9bff('0x1'));var BPromise=require(_0x9bff('0x2'));var rs=require(_0x9bff('0x3'));var fs=require('fs');var Redis=require(_0x9bff('0x4'));var db=require(_0x9bff('0x5'))['db'];var utils=require(_0x9bff('0x6'));var logger=require(_0x9bff('0x7'))('rpc');var config=require(_0x9bff('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9bff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a90eb,_0x459062,_0x56784b){return new BPromise(function(_0x4b4dd5,_0x4efe87){return client[_0x9bff('0xa')](_0x2a90eb,_0x56784b)[_0x9bff('0xb')](function(_0x1c1097){logger['info'](_0x9bff('0xc'),_0x459062,_0x9bff('0xd'));logger[_0x9bff('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x459062,'request\x20sent',JSON[_0x9bff('0xf')](_0x1c1097));if(_0x1c1097['error']){if(_0x1c1097[_0x9bff('0x10')]['code']===0x1f4){logger[_0x9bff('0x10')]('VoiceMail,\x20%s,\x20%s',_0x459062,_0x1c1097[_0x9bff('0x10')][_0x9bff('0x11')]);return _0x4efe87(_0x1c1097[_0x9bff('0x10')][_0x9bff('0x11')]);}logger[_0x9bff('0x10')](_0x9bff('0xc'),_0x459062,_0x1c1097['error'][_0x9bff('0x11')]);return _0x4b4dd5(_0x1c1097[_0x9bff('0x10')][_0x9bff('0x11')]);}else{logger[_0x9bff('0x12')](_0x9bff('0xc'),_0x459062,_0x9bff('0xd'));_0x4b4dd5(_0x1c1097[_0x9bff('0x13')][_0x9bff('0x11')]);}})[_0x9bff('0x14')](function(_0x377919){logger[_0x9bff('0x10')](_0x9bff('0xc'),_0x459062,_0x377919);_0x4efe87(_0x377919);});});} \ No newline at end of file +var _0x53ec=['http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x53ec,0xaf));var _0xc53e=function(_0x1c3331,_0x49ecd7){_0x1c3331=_0x1c3331-0x0;var _0x4a2b9f=_0x53ec[_0x1c3331];return _0x4a2b9f;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc53e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x5'));var logger=require(_0xc53e('0x6'))('rpc');var config=require(_0xc53e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x8')][_0xc53e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df8f2,_0x5b2f38,_0x55ad03){return new BPromise(function(_0x22f8ab,_0x4ec49d){return client[_0xc53e('0xa')](_0x2df8f2,_0x55ad03)[_0xc53e('0xb')](function(_0x33f449){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x5b2f38,_0xc53e('0xe'));logger[_0xc53e('0xf')](_0xc53e('0x10'),_0x5b2f38,_0xc53e('0xe'),JSON[_0xc53e('0x11')](_0x33f449));if(_0x33f449['error']){if(_0x33f449[_0xc53e('0x12')][_0xc53e('0x13')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x5b2f38,_0x33f449[_0xc53e('0x12')]['message']);return _0x4ec49d(_0x33f449[_0xc53e('0x12')]['message']);}logger['error'](_0xc53e('0xd'),_0x5b2f38,_0x33f449[_0xc53e('0x12')]['message']);return _0x22f8ab(_0x33f449[_0xc53e('0x12')]['message']);}else{logger['info'](_0xc53e('0xd'),_0x5b2f38,_0xc53e('0xe'));_0x22f8ab(_0x33f449[_0xc53e('0x14')][_0xc53e('0x15')]);}})[_0xc53e('0x16')](function(_0x1dd78d){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x5b2f38,_0x1dd78d);_0x4ec49d(_0x1dd78d);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ca42574..fd4a214 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 _0x0924=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','delete','exports','multer','path','express','Router'];(function(_0x4d01cd,_0x5f50c3){var _0x488b5f=function(_0x38924a){while(--_0x38924a){_0x4d01cd['push'](_0x4d01cd['shift']());}};_0x488b5f(++_0x5f50c3);}(_0x0924,0x1c8));var _0x4092=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x0924[_0x5b077b];return _0x16faf7;};'use strict';var multer=require(_0x4092('0x0'));var util=require('util');var path=require(_0x4092('0x1'));var timeout=require('connect-timeout');var express=require(_0x4092('0x2'));var router=express[_0x4092('0x3')]();var fs_extra=require(_0x4092('0x4'));var auth=require(_0x4092('0x5'));var interaction=require(_0x4092('0x6'));var config=require('../../config/environment');var controller=require(_0x4092('0x7'));router[_0x4092('0x8')]('/',auth[_0x4092('0x9')](),controller[_0x4092('0xa')]);router[_0x4092('0x8')]('/:id',auth[_0x4092('0x9')](),controller[_0x4092('0xb')]);router[_0x4092('0x8')](_0x4092('0xc'),auth['isAuthenticated'](),controller[_0x4092('0xd')]);router[_0x4092('0xe')]('/',auth[_0x4092('0x9')](),controller['create']);router[_0x4092('0xf')](_0x4092('0x10'),auth[_0x4092('0x9')](),controller[_0x4092('0x11')]);router[_0x4092('0x12')]('/:id',auth[_0x4092('0x9')](),controller['destroy']);module[_0x4092('0x13')]=router; \ No newline at end of file +var _0x3873=['../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3184bf,_0x302c1d){var _0x2c5f00=function(_0x4fbe5c){while(--_0x4fbe5c){_0x3184bf['push'](_0x3184bf['shift']());}};_0x2c5f00(++_0x302c1d);}(_0x3873,0xf4));var _0x3387=function(_0x2e4574,_0x2e7660){_0x2e4574=_0x2e4574-0x0;var _0x15d5a5=_0x3873[_0x2e4574];return _0x15d5a5;};'use strict';var multer=require(_0x3387('0x0'));var util=require(_0x3387('0x1'));var path=require(_0x3387('0x2'));var timeout=require(_0x3387('0x3'));var express=require(_0x3387('0x4'));var router=express[_0x3387('0x5')]();var fs_extra=require(_0x3387('0x6'));var auth=require(_0x3387('0x7'));var interaction=require(_0x3387('0x8'));var config=require(_0x3387('0x9'));var controller=require(_0x3387('0xa'));router['get']('/',auth[_0x3387('0xb')](),controller[_0x3387('0xc')]);router[_0x3387('0xd')](_0x3387('0xe'),auth[_0x3387('0xb')](),controller[_0x3387('0xf')]);router[_0x3387('0xd')](_0x3387('0x10'),auth[_0x3387('0xb')](),controller['download']);router[_0x3387('0x11')]('/',auth[_0x3387('0xb')](),controller['create']);router['put']('/:id',auth[_0x3387('0xb')](),controller[_0x3387('0x12')]);router['delete'](_0x3387('0xe'),auth[_0x3387('0xb')](),controller[_0x3387('0x13')]);module[_0x3387('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 724f3a7..7af772b 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 _0xc31a=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xc31a,0x176));var _0xac31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc31a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xac31('0x0'));module[_0xac31('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f3dac){return this[_0xac31('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xac31('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xac31('0x5')](_0xac31('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xac31('0x4')],'defaultValue':''},'stamp':{'type':_0xac31('0x7'),'defaultValue':Sequelize[_0xac31('0x8')](_0xac31('0x9'))}}; \ No newline at end of file +var _0xd587=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd587,0x167));var _0x7d58=function(_0xa8315f,_0x574184){_0xa8315f=_0xa8315f-0x0;var _0x2a85f9=_0xd587[_0xa8315f];return _0x2a85f9;};'use strict';var Sequelize=require(_0x7d58('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x515aa5){return this[_0x7d58('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x7d58('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x7d58('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7d58('0x3')],'defaultValue':''},'stamp':{'type':_0x7d58('0x5'),'defaultValue':Sequelize[_0x7d58('0x6')](_0x7d58('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c7c5e8a..6f56bb3 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 _0x6fc7=['fieldName','type','model','differenceBy','query','keys','filters','intersection','fields','attributes','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','length','body','find','params','download','recording','Sequelize','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6fc7,0xb6));var _0x76fc=function(_0x54e819,_0x18d940){_0x54e819=_0x54e819-0x0;var _0x9571cb=_0x6fc7[_0x54e819];return _0x9571cb;};'use strict';var emlformat=require(_0x76fc('0x0'));var rimraf=require(_0x76fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76fc('0x2'));var rp=require(_0x76fc('0x3'));var moment=require(_0x76fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76fc('0x5'));var util=require(_0x76fc('0x6'));var path=require(_0x76fc('0x7'));var sox=require('sox');var csv=require(_0x76fc('0x8'));var ejs=require(_0x76fc('0x9'));var fs=require('fs');var fs_extra=require(_0x76fc('0xa'));var _=require(_0x76fc('0xb'));var squel=require('squel');var crypto=require(_0x76fc('0xc'));var jsforce=require(_0x76fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x76fc('0x8'));var querystring=require(_0x76fc('0xe'));var Papa=require(_0x76fc('0xf'));var Redis=require(_0x76fc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76fc('0x11'));var logger=require(_0x76fc('0x12'))(_0x76fc('0x13'));var utils=require(_0x76fc('0x14'));var config=require(_0x76fc('0x15'));var licenseUtil=require(_0x76fc('0x16'));var db=require(_0x76fc('0x17'))['db'];function respondWithStatusCode(_0x127197,_0xce67b7){_0xce67b7=_0xce67b7||0xcc;return function(_0x577d98){if(_0x577d98){return _0x127197[_0x76fc('0x18')](_0xce67b7);}return _0x127197['status'](_0xce67b7)[_0x76fc('0x19')]();};}function respondWithResult(_0x3748f5,_0x3ec79a){_0x3ec79a=_0x3ec79a||0xc8;return function(_0x1ec0b7){if(_0x1ec0b7){return _0x3748f5[_0x76fc('0x1a')](_0x3ec79a)[_0x76fc('0x1b')](_0x1ec0b7);}};}function respondWithFilteredResult(_0x5aa797,_0xb76ea8){return function(_0x721d5c){if(_0x721d5c){var _0x233e18=typeof _0xb76ea8[_0x76fc('0x1c')]===_0x76fc('0x1d')&&typeof _0xb76ea8[_0x76fc('0x1e')]==='undefined';var _0x5c4939=_0x721d5c[_0x76fc('0x1f')];var _0x135d16=_0x233e18?0x0:_0xb76ea8[_0x76fc('0x1c')];var _0x1314fe=_0x233e18?_0x721d5c[_0x76fc('0x1f')]:_0xb76ea8[_0x76fc('0x1c')]+_0xb76ea8[_0x76fc('0x1e')];var _0x59b2ee;if(_0x1314fe>=_0x5c4939){_0x1314fe=_0x5c4939;_0x59b2ee=0xc8;}else{_0x59b2ee=0xce;}_0x5aa797[_0x76fc('0x1a')](_0x59b2ee);return _0x5aa797[_0x76fc('0x20')](_0x76fc('0x21'),_0x135d16+'-'+_0x1314fe+'/'+_0x5c4939)[_0x76fc('0x1b')](_0x721d5c);}return null;};}function patchUpdates(_0x2617ca){return function(_0x4e69fe){try{jsonpatch['apply'](_0x4e69fe,_0x2617ca,!![]);}catch(_0x447c04){return BPromise[_0x76fc('0x22')](_0x447c04);}return _0x4e69fe[_0x76fc('0x23')]();};}function saveUpdates(_0x16ae16,_0x49f711){return function(_0x23edfc){if(_0x23edfc){return _0x23edfc[_0x76fc('0x24')](_0x16ae16)[_0x76fc('0x25')](function(_0x15fa0e){return _0x15fa0e;});}return null;};}function removeEntity(_0x6ea7fa,_0x3c7b50){return function(_0x1cf6e5){if(_0x1cf6e5){return _0x1cf6e5[_0x76fc('0x26')]()[_0x76fc('0x25')](function(){_0x6ea7fa['status'](0xcc)[_0x76fc('0x19')]();});}};}function handleEntityNotFound(_0x49b603,_0x341de7){return function(_0x535b8e){if(!_0x535b8e){_0x49b603['sendStatus'](0x194);}return _0x535b8e;};}function handleError(_0x479f30,_0x104158){_0x104158=_0x104158||0x1f4;return function(_0x9abdbd){logger[_0x76fc('0x27')](_0x9abdbd[_0x76fc('0x28')]);if(_0x9abdbd[_0x76fc('0x29')]){delete _0x9abdbd[_0x76fc('0x29')];}_0x479f30[_0x76fc('0x1a')](_0x104158)[_0x76fc('0x2a')](_0x9abdbd);};}exports['index']=function(_0x421791,_0x23b4e6){var _0x28bf23={},_0x4ea4bc={},_0x1adebd={'count':0x0,'rows':[]};var _0x275e7e=_[_0x76fc('0x2b')](db[_0x76fc('0x2c')][_0x76fc('0x2d')],function(_0x19b61f){return{'name':_0x19b61f[_0x76fc('0x2e')],'type':_0x19b61f[_0x76fc('0x2f')]['key']};});_0x4ea4bc[_0x76fc('0x30')]=_[_0x76fc('0x31')](_[_0x76fc('0x2b')](_0x275e7e,_0x76fc('0x29')),[_0x76fc('0x29')]);_0x4ea4bc[_0x76fc('0x32')]=_[_0x76fc('0x33')](_0x421791[_0x76fc('0x32')]);_0x4ea4bc[_0x76fc('0x34')]=_['intersection'](_0x4ea4bc['model'],_0x4ea4bc[_0x76fc('0x32')]);_0x28bf23['attributes']=_[_0x76fc('0x35')](_0x4ea4bc[_0x76fc('0x30')],qs[_0x76fc('0x36')](_0x421791[_0x76fc('0x32')]['fields']));_0x28bf23[_0x76fc('0x37')]=_0x28bf23[_0x76fc('0x37')]['length']?_0x28bf23['attributes']:_0x4ea4bc[_0x76fc('0x30')];if(!_0x421791[_0x76fc('0x32')]['hasOwnProperty']('nolimit')){_0x28bf23[_0x76fc('0x1e')]=qs[_0x76fc('0x1e')](_0x421791[_0x76fc('0x32')][_0x76fc('0x1e')]);_0x28bf23[_0x76fc('0x1c')]=qs[_0x76fc('0x1c')](_0x421791[_0x76fc('0x32')][_0x76fc('0x1c')]);}_0x28bf23[_0x76fc('0x38')]=qs[_0x76fc('0x39')](_0x421791[_0x76fc('0x32')][_0x76fc('0x39')]);_0x28bf23['where']=qs[_0x76fc('0x34')](_['pick'](_0x421791['query'],_0x4ea4bc[_0x76fc('0x34')]),_0x275e7e);if(_0x421791[_0x76fc('0x32')]['filter']){_0x28bf23[_0x76fc('0x3a')]=_[_0x76fc('0x3b')](_0x28bf23[_0x76fc('0x3a')],{'$or':_[_0x76fc('0x2b')](_0x275e7e,function(_0x18b95a){if(_0x18b95a[_0x76fc('0x2f')]!==_0x76fc('0x3c')){var _0x4142da={};_0x4142da[_0x18b95a[_0x76fc('0x29')]]={'$like':'%'+_0x421791[_0x76fc('0x32')][_0x76fc('0x3d')]+'%'};return _0x4142da;}})});}_0x28bf23=_['merge']({},_0x28bf23,_0x421791[_0x76fc('0x3e')]);var _0x475591={'where':_0x28bf23[_0x76fc('0x3a')]};return db[_0x76fc('0x2c')][_0x76fc('0x1f')](_0x475591)[_0x76fc('0x25')](function(_0x4c06bd){_0x1adebd['count']=_0x4c06bd;if(_0x421791['query'][_0x76fc('0x3f')]){_0x28bf23['include']=[{'all':!![]}];}return db[_0x76fc('0x2c')][_0x76fc('0x40')](_0x28bf23);})['then'](function(_0x284ee7){_0x1adebd[_0x76fc('0x41')]=_0x284ee7;return _0x1adebd;})[_0x76fc('0x25')](respondWithFilteredResult(_0x23b4e6,_0x28bf23))[_0x76fc('0x42')](handleError(_0x23b4e6,null));};exports['show']=function(_0x42b3c2,_0x1c613f){var _0x326739={'raw':!![],'where':{'id':_0x42b3c2['params']['id']}},_0x548bf7={};_0x548bf7['model']=_[_0x76fc('0x33')](db['VoiceMailMessage'][_0x76fc('0x2d')]);_0x548bf7['query']=_[_0x76fc('0x33')](_0x42b3c2[_0x76fc('0x32')]);_0x548bf7[_0x76fc('0x34')]=_[_0x76fc('0x35')](_0x548bf7[_0x76fc('0x30')],_0x548bf7[_0x76fc('0x32')]);_0x326739[_0x76fc('0x37')]=_[_0x76fc('0x35')](_0x548bf7['model'],qs[_0x76fc('0x36')](_0x42b3c2[_0x76fc('0x32')]['fields']));_0x326739[_0x76fc('0x37')]=_0x326739['attributes'][_0x76fc('0x43')]?_0x326739['attributes']:_0x548bf7[_0x76fc('0x30')];if(_0x42b3c2[_0x76fc('0x32')]['includeAll']){_0x326739['include']=[{'all':!![]}];}_0x326739=_[_0x76fc('0x3b')]({},_0x326739,_0x42b3c2[_0x76fc('0x3e')]);return db['VoiceMailMessage']['find'](_0x326739)[_0x76fc('0x25')](handleEntityNotFound(_0x1c613f,null))['then'](respondWithResult(_0x1c613f,null))[_0x76fc('0x42')](handleError(_0x1c613f,null));};exports['create']=function(_0x2b369f,_0x336e04){return db[_0x76fc('0x2c')]['create'](_0x2b369f[_0x76fc('0x44')],{})[_0x76fc('0x25')](respondWithResult(_0x336e04,0xc9))['catch'](handleError(_0x336e04,null));};exports[_0x76fc('0x24')]=function(_0x133608,_0x242082){if(_0x133608[_0x76fc('0x44')]['id']){delete _0x133608['body']['id'];}return db[_0x76fc('0x2c')]['find']({'where':{'id':_0x133608['params']['id']}})[_0x76fc('0x25')](handleEntityNotFound(_0x242082,null))[_0x76fc('0x25')](saveUpdates(_0x133608[_0x76fc('0x44')],null))['then'](respondWithResult(_0x242082,null))[_0x76fc('0x42')](handleError(_0x242082,null));};exports[_0x76fc('0x26')]=function(_0x5a23c1,_0x33d993){return db[_0x76fc('0x2c')][_0x76fc('0x45')]({'where':{'id':_0x5a23c1[_0x76fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x33d993,null))['then'](removeEntity(_0x33d993,null))[_0x76fc('0x42')](handleError(_0x33d993,null));};exports[_0x76fc('0x47')]=function(_0x145a7d,_0x227853,_0x336cf8){return db[_0x76fc('0x2c')][_0x76fc('0x45')]({'where':{'id':_0x145a7d[_0x76fc('0x46')]['id']},'attributes':['id',_0x76fc('0x48'),'msg_id']})[_0x76fc('0x25')](handleEntityNotFound(_0x227853,null))[_0x76fc('0x25')](function(_0x558a2c){if(_0x558a2c){if(!_0x558a2c[_0x76fc('0x48')]){throw new db[(_0x76fc('0x49'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x34fb5a={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x558a2c['msg_id']){_0x34fb5a[_0x76fc('0x4a')]=_0x76fc('0x4b')+_0x558a2c['msg_id']+'.wav\x22';}_0x227853[_0x76fc('0x20')](_0x34fb5a);return _0x227853[_0x76fc('0x2a')](new Buffer(_0x558a2c[_0x76fc('0x48')]));}})['catch'](handleError(_0x227853,null));}; \ No newline at end of file +var _0x4c92=['rows','catch','show','params','keys','length','options','find','create','body','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','set','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','name','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','VoiceMailMessage','includeAll','include','findAll'];(function(_0x3880b3,_0x4b148e){var _0x2a73c1=function(_0x369826){while(--_0x369826){_0x3880b3['push'](_0x3880b3['shift']());}};_0x2a73c1(++_0x4b148e);}(_0x4c92,0x109));var _0x24c9=function(_0x2c8683,_0x149885){_0x2c8683=_0x2c8683-0x0;var _0x776c75=_0x4c92[_0x2c8683];return _0x776c75;};'use strict';var emlformat=require(_0x24c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24c9('0x1'));var jsonpatch=require(_0x24c9('0x2'));var rp=require(_0x24c9('0x3'));var moment=require('moment');var BPromise=require(_0x24c9('0x4'));var Mustache=require(_0x24c9('0x5'));var util=require(_0x24c9('0x6'));var path=require('path');var sox=require(_0x24c9('0x7'));var csv=require(_0x24c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x24c9('0x9'));var crypto=require(_0x24c9('0xa'));var jsforce=require(_0x24c9('0xb'));var deskjs=require(_0x24c9('0xc'));var toCsv=require(_0x24c9('0x8'));var querystring=require(_0x24c9('0xd'));var Papa=require(_0x24c9('0xe'));var Redis=require(_0x24c9('0xf'));var authService=require(_0x24c9('0x10'));var qs=require(_0x24c9('0x11'));var as=require(_0x24c9('0x12'));var hardwareService=require(_0x24c9('0x13'));var logger=require('../../config/logger')(_0x24c9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x24c9('0x15'))['db'];function respondWithStatusCode(_0x1181a6,_0x12c9ba){_0x12c9ba=_0x12c9ba||0xcc;return function(_0x52404d){if(_0x52404d){return _0x1181a6[_0x24c9('0x16')](_0x12c9ba);}return _0x1181a6[_0x24c9('0x17')](_0x12c9ba)[_0x24c9('0x18')]();};}function respondWithResult(_0x193158,_0x187e4f){_0x187e4f=_0x187e4f||0xc8;return function(_0x2c928b){if(_0x2c928b){return _0x193158[_0x24c9('0x17')](_0x187e4f)[_0x24c9('0x19')](_0x2c928b);}};}function respondWithFilteredResult(_0x2da8e2,_0x2e8352){return function(_0x12c530){if(_0x12c530){var _0x2c2c23=typeof _0x2e8352[_0x24c9('0x1a')]===_0x24c9('0x1b')&&typeof _0x2e8352[_0x24c9('0x1c')]===_0x24c9('0x1b');var _0x5f4024=_0x12c530[_0x24c9('0x1d')];var _0xb87907=_0x2c2c23?0x0:_0x2e8352['offset'];var _0x2bf04b=_0x2c2c23?_0x12c530[_0x24c9('0x1d')]:_0x2e8352[_0x24c9('0x1a')]+_0x2e8352['limit'];var _0x5011e9;if(_0x2bf04b>=_0x5f4024){_0x2bf04b=_0x5f4024;_0x5011e9=0xc8;}else{_0x5011e9=0xce;}_0x2da8e2[_0x24c9('0x17')](_0x5011e9);return _0x2da8e2['set']('Content-Range',_0xb87907+'-'+_0x2bf04b+'/'+_0x5f4024)['json'](_0x12c530);}return null;};}function patchUpdates(_0xfaccba){return function(_0x269818){try{jsonpatch[_0x24c9('0x1e')](_0x269818,_0xfaccba,!![]);}catch(_0x54fc82){return BPromise[_0x24c9('0x1f')](_0x54fc82);}return _0x269818[_0x24c9('0x20')]();};}function saveUpdates(_0x3f915f,_0x22a919){return function(_0x415dd4){if(_0x415dd4){return _0x415dd4[_0x24c9('0x21')](_0x3f915f)[_0x24c9('0x22')](function(_0x523677){return _0x523677;});}return null;};}function removeEntity(_0x1d472c,_0x3971c5){return function(_0x59ee15){if(_0x59ee15){return _0x59ee15['destroy']()[_0x24c9('0x22')](function(){_0x1d472c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x432432,_0x149c73){return function(_0x38b966){if(!_0x38b966){_0x432432[_0x24c9('0x16')](0x194);}return _0x38b966;};}function handleError(_0x5e8dfb,_0x5e007b){_0x5e007b=_0x5e007b||0x1f4;return function(_0x3b007a){logger['error'](_0x3b007a['stack']);if(_0x3b007a[_0x24c9('0x23')]){delete _0x3b007a[_0x24c9('0x23')];}_0x5e8dfb[_0x24c9('0x17')](_0x5e007b)['send'](_0x3b007a);};}exports[_0x24c9('0x24')]=function(_0x277431,_0xcb1bb2){var _0x9c7b8d={},_0x5b82a5={},_0x55c11c={'count':0x0,'rows':[]};var _0x328b45=_['map'](db['VoiceMailMessage'][_0x24c9('0x25')],function(_0x24726d){return{'name':_0x24726d[_0x24c9('0x26')],'type':_0x24726d['type'][_0x24c9('0x27')]};});_0x5b82a5['model']=_['differenceBy'](_[_0x24c9('0x28')](_0x328b45,_0x24c9('0x23')),['name']);_0x5b82a5[_0x24c9('0x29')]=_['keys'](_0x277431['query']);_0x5b82a5[_0x24c9('0x2a')]=_[_0x24c9('0x2b')](_0x5b82a5[_0x24c9('0x2c')],_0x5b82a5[_0x24c9('0x29')]);_0x9c7b8d[_0x24c9('0x2d')]=_['intersection'](_0x5b82a5[_0x24c9('0x2c')],qs[_0x24c9('0x2e')](_0x277431[_0x24c9('0x29')][_0x24c9('0x2e')]));_0x9c7b8d[_0x24c9('0x2d')]=_0x9c7b8d[_0x24c9('0x2d')]['length']?_0x9c7b8d[_0x24c9('0x2d')]:_0x5b82a5[_0x24c9('0x2c')];if(!_0x277431[_0x24c9('0x29')]['hasOwnProperty'](_0x24c9('0x2f'))){_0x9c7b8d[_0x24c9('0x1c')]=qs[_0x24c9('0x1c')](_0x277431['query'][_0x24c9('0x1c')]);_0x9c7b8d[_0x24c9('0x1a')]=qs['offset'](_0x277431[_0x24c9('0x29')]['offset']);}_0x9c7b8d[_0x24c9('0x30')]=qs['sort'](_0x277431['query'][_0x24c9('0x31')]);_0x9c7b8d[_0x24c9('0x32')]=qs[_0x24c9('0x2a')](_['pick'](_0x277431[_0x24c9('0x29')],_0x5b82a5[_0x24c9('0x2a')]),_0x328b45);if(_0x277431[_0x24c9('0x29')][_0x24c9('0x33')]){_0x9c7b8d[_0x24c9('0x32')]=_[_0x24c9('0x34')](_0x9c7b8d[_0x24c9('0x32')],{'$or':_[_0x24c9('0x28')](_0x328b45,function(_0x1a1122){if(_0x1a1122[_0x24c9('0x35')]!==_0x24c9('0x36')){var _0x2af2e2={};_0x2af2e2[_0x1a1122[_0x24c9('0x23')]]={'$like':'%'+_0x277431['query'][_0x24c9('0x33')]+'%'};return _0x2af2e2;}})});}_0x9c7b8d=_[_0x24c9('0x34')]({},_0x9c7b8d,_0x277431['options']);var _0x111ec2={'where':_0x9c7b8d[_0x24c9('0x32')]};return db[_0x24c9('0x37')][_0x24c9('0x1d')](_0x111ec2)[_0x24c9('0x22')](function(_0x57acae){_0x55c11c['count']=_0x57acae;if(_0x277431['query'][_0x24c9('0x38')]){_0x9c7b8d[_0x24c9('0x39')]=[{'all':!![]}];}return db[_0x24c9('0x37')][_0x24c9('0x3a')](_0x9c7b8d);})[_0x24c9('0x22')](function(_0x258f6b){_0x55c11c[_0x24c9('0x3b')]=_0x258f6b;return _0x55c11c;})['then'](respondWithFilteredResult(_0xcb1bb2,_0x9c7b8d))[_0x24c9('0x3c')](handleError(_0xcb1bb2,null));};exports[_0x24c9('0x3d')]=function(_0x58465f,_0xdb0395){var _0x20e777={'raw':!![],'where':{'id':_0x58465f[_0x24c9('0x3e')]['id']}},_0x1bb1ac={};_0x1bb1ac[_0x24c9('0x2c')]=_[_0x24c9('0x3f')](db[_0x24c9('0x37')][_0x24c9('0x25')]);_0x1bb1ac[_0x24c9('0x29')]=_[_0x24c9('0x3f')](_0x58465f[_0x24c9('0x29')]);_0x1bb1ac[_0x24c9('0x2a')]=_[_0x24c9('0x2b')](_0x1bb1ac[_0x24c9('0x2c')],_0x1bb1ac['query']);_0x20e777[_0x24c9('0x2d')]=_[_0x24c9('0x2b')](_0x1bb1ac[_0x24c9('0x2c')],qs[_0x24c9('0x2e')](_0x58465f[_0x24c9('0x29')][_0x24c9('0x2e')]));_0x20e777[_0x24c9('0x2d')]=_0x20e777[_0x24c9('0x2d')][_0x24c9('0x40')]?_0x20e777[_0x24c9('0x2d')]:_0x1bb1ac[_0x24c9('0x2c')];if(_0x58465f[_0x24c9('0x29')][_0x24c9('0x38')]){_0x20e777[_0x24c9('0x39')]=[{'all':!![]}];}_0x20e777=_['merge']({},_0x20e777,_0x58465f[_0x24c9('0x41')]);return db[_0x24c9('0x37')][_0x24c9('0x42')](_0x20e777)[_0x24c9('0x22')](handleEntityNotFound(_0xdb0395,null))[_0x24c9('0x22')](respondWithResult(_0xdb0395,null))[_0x24c9('0x3c')](handleError(_0xdb0395,null));};exports[_0x24c9('0x43')]=function(_0x1b2c40,_0x2a9901){return db[_0x24c9('0x37')][_0x24c9('0x43')](_0x1b2c40['body'],{})['then'](respondWithResult(_0x2a9901,0xc9))[_0x24c9('0x3c')](handleError(_0x2a9901,null));};exports['update']=function(_0x18f3f6,_0x42fa6a){if(_0x18f3f6[_0x24c9('0x44')]['id']){delete _0x18f3f6['body']['id'];}return db[_0x24c9('0x37')][_0x24c9('0x42')]({'where':{'id':_0x18f3f6[_0x24c9('0x3e')]['id']}})[_0x24c9('0x22')](handleEntityNotFound(_0x42fa6a,null))[_0x24c9('0x22')](saveUpdates(_0x18f3f6['body'],null))[_0x24c9('0x22')](respondWithResult(_0x42fa6a,null))[_0x24c9('0x3c')](handleError(_0x42fa6a,null));};exports[_0x24c9('0x45')]=function(_0x4c4c60,_0x4f9dd1){return db['VoiceMailMessage']['find']({'where':{'id':_0x4c4c60[_0x24c9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4f9dd1,null))[_0x24c9('0x22')](removeEntity(_0x4f9dd1,null))[_0x24c9('0x3c')](handleError(_0x4f9dd1,null));};exports[_0x24c9('0x46')]=function(_0xe82449,_0x1edd85,_0x1a212f){return db[_0x24c9('0x37')]['find']({'where':{'id':_0xe82449[_0x24c9('0x3e')]['id']},'attributes':['id',_0x24c9('0x47'),_0x24c9('0x48')]})['then'](handleEntityNotFound(_0x1edd85,null))[_0x24c9('0x22')](function(_0x3e8be7){if(_0x3e8be7){if(!_0x3e8be7[_0x24c9('0x47')]){throw new db[(_0x24c9('0x49'))][(_0x24c9('0x4a'))](_0x24c9('0x4b'));}var _0x5e2354={'Content-Type':_0x24c9('0x4c'),'Content-Disposition':_0x24c9('0x4d')};if(_0x3e8be7['msg_id']){_0x5e2354[_0x24c9('0x4e')]='attachment;\x20filename=\x22'+_0x3e8be7[_0x24c9('0x48')]+'.wav\x22';}_0x1edd85[_0x24c9('0x4f')](_0x5e2354);return _0x1edd85[_0x24c9('0x50')](new Buffer(_0x3e8be7[_0x24c9('0x47')]));}})[_0x24c9('0x3c')](handleError(_0x1edd85,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a8d6b81..d322a2b 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 _0x37fa=['../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x37fa,0x186));var _0xa37f=function(_0x5c2748,_0x564960){_0x5c2748=_0x5c2748-0x0;var _0x59761d=_0x37fa[_0x5c2748];return _0x59761d;};'use strict';var _=require(_0xa37f('0x0'));var util=require('util');var logger=require(_0xa37f('0x1'))(_0xa37f('0x2'));var moment=require(_0xa37f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa37f('0x4'));var fs=require('fs');var path=require(_0xa37f('0x5'));var rimraf=require('rimraf');var config=require(_0xa37f('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0xa37f('0x7')]=function(_0x446df1,_0x404a6b){return _0x446df1[_0xa37f('0x8')](_0xa37f('0x9'),attributes,{'tableName':_0xa37f('0xa'),'paranoid':![],'indexes':[{'name':_0xa37f('0xb'),'fields':[_0xa37f('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x104e=['request-promise','path','rimraf','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','lodash','util','../../config/logger','moment','bluebird'];(function(_0x54cf69,_0x598f3f){var _0x130c7b=function(_0xf3c6dc){while(--_0xf3c6dc){_0x54cf69['push'](_0x54cf69['shift']());}};_0x130c7b(++_0x598f3f);}(_0x104e,0x97));var _0xe104=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x104e[_0x4715d2];return _0x141811;};'use strict';var _=require(_0xe104('0x0'));var util=require(_0xe104('0x1'));var logger=require(_0xe104('0x2'))('api');var moment=require(_0xe104('0x3'));var BPromise=require(_0xe104('0x4'));var rp=require(_0xe104('0x5'));var fs=require('fs');var path=require(_0xe104('0x6'));var rimraf=require(_0xe104('0x7'));var config=require('../../config/environment');var attributes=require(_0xe104('0x8'));module['exports']=function(_0xe9b924,_0x2bc7da){return _0xe9b924[_0xe104('0x9')](_0xe104('0xa'),attributes,{'tableName':_0xe104('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5bd9253..01837ea 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 _0x1641=['../../config/environment','jayson/promise','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x12a7a3,_0x3a2bbb){var _0x335ac1=function(_0x422377){while(--_0x422377){_0x12a7a3['push'](_0x12a7a3['shift']());}};_0x335ac1(++_0x3a2bbb);}(_0x1641,0xde));var _0x1164=function(_0x3ae41b,_0x3909a9){_0x3ae41b=_0x3ae41b-0x0;var _0x2eb1fd=_0x1641[_0x3ae41b];return _0x2eb1fd;};'use strict';var _=require(_0x1164('0x0'));var util=require('util');var moment=require(_0x1164('0x1'));var BPromise=require('bluebird');var rs=require(_0x1164('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1164('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1164('0x4'))(_0x1164('0x5'));var config=require(_0x1164('0x6'));var jayson=require(_0x1164('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x581696,_0x11e94c,_0x5526a8){return new BPromise(function(_0x5d0ed6,_0x2e0d4e){return client[_0x1164('0x8')](_0x581696,_0x5526a8)[_0x1164('0x9')](function(_0x58ab42){logger['info'](_0x1164('0xa'),_0x11e94c,_0x1164('0xb'));logger[_0x1164('0xc')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x11e94c,_0x1164('0xb'),JSON[_0x1164('0xd')](_0x58ab42));if(_0x58ab42[_0x1164('0xe')]){if(_0x58ab42[_0x1164('0xe')]['code']===0x1f4){logger['error'](_0x1164('0xa'),_0x11e94c,_0x58ab42[_0x1164('0xe')]['message']);return _0x2e0d4e(_0x58ab42['error']['message']);}logger['error'](_0x1164('0xa'),_0x11e94c,_0x58ab42[_0x1164('0xe')][_0x1164('0xf')]);return _0x5d0ed6(_0x58ab42[_0x1164('0xe')][_0x1164('0xf')]);}else{logger[_0x1164('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x11e94c,_0x1164('0xb'));_0x5d0ed6(_0x58ab42[_0x1164('0x11')][_0x1164('0xf')]);}})[_0x1164('0x12')](function(_0x5ce118){logger[_0x1164('0xe')](_0x1164('0xa'),_0x11e94c,_0x5ce118);_0x2e0d4e(_0x5ce118);});});} \ No newline at end of file +var _0x5b26=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5b26,0x1dd));var _0x65b2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5b26[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x65b2('0x0'));var moment=require('moment');var BPromise=require(_0x65b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65b2('0x2'));var db=require(_0x65b2('0x3'))['db'];var utils=require(_0x65b2('0x4'));var logger=require(_0x65b2('0x5'))(_0x65b2('0x6'));var config=require(_0x65b2('0x7'));var jayson=require(_0x65b2('0x8'));var client=jayson['client'][_0x65b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b56ed,_0x86e76a,_0x48c469){return new BPromise(function(_0xecd766,_0x3c4cf4){return client[_0x65b2('0xa')](_0x3b56ed,_0x48c469)[_0x65b2('0xb')](function(_0x15266c){logger[_0x65b2('0xc')](_0x65b2('0xd'),_0x86e76a,_0x65b2('0xe'));logger[_0x65b2('0xf')](_0x65b2('0x10'),_0x86e76a,_0x65b2('0xe'),JSON[_0x65b2('0x11')](_0x15266c));if(_0x15266c[_0x65b2('0x12')]){if(_0x15266c[_0x65b2('0x12')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x86e76a,_0x15266c['error']['message']);return _0x3c4cf4(_0x15266c[_0x65b2('0x12')]['message']);}logger[_0x65b2('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x86e76a,_0x15266c[_0x65b2('0x12')][_0x65b2('0x13')]);return _0xecd766(_0x15266c[_0x65b2('0x12')]['message']);}else{logger[_0x65b2('0xc')](_0x65b2('0xd'),_0x86e76a,'request\x20sent');_0xecd766(_0x15266c[_0x65b2('0x14')][_0x65b2('0x13')]);}})['catch'](function(_0x196376){logger[_0x65b2('0x12')](_0x65b2('0xd'),_0x86e76a,_0x196376);_0x3c4cf4(_0x196376);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 787e056..1c12db5 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 _0x744b=['show','/:id/sounds','post','create','put','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x1a1ec7,_0x2c9cc1){var _0x55650a=function(_0x469410){while(--_0x469410){_0x1a1ec7['push'](_0x1a1ec7['shift']());}};_0x55650a(++_0x2c9cc1);}(_0x744b,0x1ed));var _0xb744=function(_0x1c1c5e,_0x270b07){_0x1c1c5e=_0x1c1c5e-0x0;var _0x236279=_0x744b[_0x1c1c5e];return _0x236279;};'use strict';var multer=require(_0xb744('0x0'));var util=require(_0xb744('0x1'));var path=require(_0xb744('0x2'));var timeout=require('connect-timeout');var express=require(_0xb744('0x3'));var router=express[_0xb744('0x4')]();var fs_extra=require(_0xb744('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb744('0x6'));var config=require(_0xb744('0x7'));var controller=require(_0xb744('0x8'));router[_0xb744('0x9')]('/',auth[_0xb744('0xa')](),controller[_0xb744('0xb')]);router['get'](_0xb744('0xc'),auth[_0xb744('0xa')](),controller[_0xb744('0xd')]);router['get'](_0xb744('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0xb744('0xf')]('/',auth['isAuthenticated'](),controller[_0xb744('0x10')]);router[_0xb744('0xf')](_0xb744('0xe'),auth['isAuthenticated'](),controller['addSound']);router[_0xb744('0x11')](_0xb744('0xc'),auth[_0xb744('0xa')](),controller['update']);router[_0xb744('0x12')](_0xb744('0xc'),auth[_0xb744('0xa')](),controller[_0xb744('0x13')]);router['delete'](_0xb744('0x14'),auth[_0xb744('0xa')](),controller['removeSound']);module[_0xb744('0x15')]=router; \ No newline at end of file +var _0xd3c0=['./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x254f84,_0x52c57d){var _0x4e3ee4=function(_0x4d016f){while(--_0x4d016f){_0x254f84['push'](_0x254f84['shift']());}};_0x4e3ee4(++_0x52c57d);}(_0xd3c0,0x6c));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0d3c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0d3c('0x1'));var express=require('express');var router=express[_0x0d3c('0x2')]();var fs_extra=require(_0x0d3c('0x3'));var auth=require(_0x0d3c('0x4'));var interaction=require(_0x0d3c('0x5'));var config=require(_0x0d3c('0x6'));var controller=require(_0x0d3c('0x7'));router[_0x0d3c('0x8')]('/',auth[_0x0d3c('0x9')](),controller[_0x0d3c('0xa')]);router[_0x0d3c('0x8')](_0x0d3c('0xb'),auth[_0x0d3c('0x9')](),controller[_0x0d3c('0xc')]);router[_0x0d3c('0x8')](_0x0d3c('0xd'),auth[_0x0d3c('0x9')](),controller[_0x0d3c('0xe')]);router['post']('/',auth[_0x0d3c('0x9')](),controller['create']);router[_0x0d3c('0xf')](_0x0d3c('0xd'),auth[_0x0d3c('0x9')](),controller[_0x0d3c('0x10')]);router[_0x0d3c('0x11')](_0x0d3c('0xb'),auth['isAuthenticated'](),controller[_0x0d3c('0x12')]);router[_0x0d3c('0x13')](_0x0d3c('0xb'),auth[_0x0d3c('0x9')](),controller[_0x0d3c('0x14')]);router[_0x0d3c('0x13')](_0x0d3c('0x15'),auth[_0x0d3c('0x9')](),controller['removeSound']);module[_0x0d3c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index fa35096..7c9163c 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 _0xbc53=['custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM'];(function(_0x4fa5cc,_0x18f844){var _0x3005b9=function(_0x4d90cf){while(--_0x4d90cf){_0x4fa5cc['push'](_0x4fa5cc['shift']());}};_0x3005b9(++_0x18f844);}(_0xbc53,0x128));var _0x3bc5=function(_0x14b52f,_0x581404){_0x14b52f=_0x14b52f-0x0;var _0x4c74e2=_0xbc53[_0x14b52f];return _0x4c74e2;};'use strict';var Sequelize=require(_0x3bc5('0x0'));module['exports']={'name':{'type':Sequelize[_0x3bc5('0x1')],'allowNull':![],'unique':_0x3bc5('0x2')},'mode':{'type':Sequelize[_0x3bc5('0x3')](_0x3bc5('0x4'),_0x3bc5('0x5'),'mp3nb',_0x3bc5('0x6'),_0x3bc5('0x7'),_0x3bc5('0x8')),'allowNull':!![],'defaultValue':_0x3bc5('0x5')},'directory':{'type':Sequelize[_0x3bc5('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x3bc5('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x3bc5('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3bc5('0x9')},'format':{'type':Sequelize[_0x3bc5('0x1')],'allowNull':!![]},'stamp':{'type':_0x3bc5('0xa')},'defaultEntry':{'type':Sequelize[_0x3bc5('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb24=['ENUM','files','mp3nb','mp3','alpha','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeb24,0xd8));var _0x4eb2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xeb24[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x4eb2('0x0'));module[_0x4eb2('0x1')]={'name':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':![],'unique':_0x4eb2('0x3')},'mode':{'type':Sequelize[_0x4eb2('0x4')]('custom',_0x4eb2('0x5'),_0x4eb2('0x6'),'quietmp3nb','quietmp3',_0x4eb2('0x7')),'allowNull':!![],'defaultValue':_0x4eb2('0x5')},'directory':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4eb2('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x4eb2('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 2f679e3..f20e553 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 _0x34a8=['end','offset','undefined','limit','count','set','json','reject','update','destroy','get','UserProfileResource','then','error','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','name','filter','includeAll','include','findAll','rows','show','params','keys','length','merge','options','find','body','catch','create','sequelize','transaction','mode','directory','root','server/files/moh','mkdirSync','0777','user','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','removeSound','id2','getSounds','Sound','pick','hasOwnProperty','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x34a8,0x196));var _0x834a=function(_0x5d1b48,_0xc9edfa){_0x5d1b48=_0x5d1b48-0x0;var _0x1b26b4=_0x34a8[_0x5d1b48];return _0x1b26b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x834a('0x0'));var jsonpatch=require(_0x834a('0x1'));var rp=require('request-promise');var moment=require(_0x834a('0x2'));var BPromise=require(_0x834a('0x3'));var Mustache=require('mustache');var util=require(_0x834a('0x4'));var path=require(_0x834a('0x5'));var sox=require(_0x834a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834a('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x834a('0x8'));var jsforce=require(_0x834a('0x9'));var deskjs=require(_0x834a('0xa'));var toCsv=require(_0x834a('0xb'));var querystring=require(_0x834a('0xc'));var Papa=require(_0x834a('0xd'));var Redis=require(_0x834a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x834a('0xf'));var logger=require(_0x834a('0x10'))(_0x834a('0x11'));var utils=require(_0x834a('0x12'));var config=require(_0x834a('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24f566,_0x4a4cd8){_0x4a4cd8=_0x4a4cd8||0xcc;return function(_0x655804){if(_0x655804){return _0x24f566[_0x834a('0x14')](_0x4a4cd8);}return _0x24f566[_0x834a('0x15')](_0x4a4cd8)[_0x834a('0x16')]();};}function respondWithResult(_0x5621c4,_0x5f2409){_0x5f2409=_0x5f2409||0xc8;return function(_0x33b422){if(_0x33b422){return _0x5621c4[_0x834a('0x15')](_0x5f2409)['json'](_0x33b422);}};}function respondWithFilteredResult(_0x57413d,_0x377418){return function(_0x3b3cf4){if(_0x3b3cf4){var _0x1fe353=typeof _0x377418[_0x834a('0x17')]===_0x834a('0x18')&&typeof _0x377418[_0x834a('0x19')]===_0x834a('0x18');var _0xc0cca8=_0x3b3cf4[_0x834a('0x1a')];var _0xdda8e4=_0x1fe353?0x0:_0x377418[_0x834a('0x17')];var _0xab3fe9=_0x1fe353?_0x3b3cf4[_0x834a('0x1a')]:_0x377418[_0x834a('0x17')]+_0x377418['limit'];var _0x461ba5;if(_0xab3fe9>=_0xc0cca8){_0xab3fe9=_0xc0cca8;_0x461ba5=0xc8;}else{_0x461ba5=0xce;}_0x57413d[_0x834a('0x15')](_0x461ba5);return _0x57413d[_0x834a('0x1b')]('Content-Range',_0xdda8e4+'-'+_0xab3fe9+'/'+_0xc0cca8)[_0x834a('0x1c')](_0x3b3cf4);}return null;};}function patchUpdates(_0x51f845){return function(_0x18cff7){try{jsonpatch['apply'](_0x18cff7,_0x51f845,!![]);}catch(_0x3a4c3e){return BPromise[_0x834a('0x1d')](_0x3a4c3e);}return _0x18cff7['save']();};}function saveUpdates(_0x19d462,_0x701799){return function(_0xc83809){if(_0xc83809){return _0xc83809[_0x834a('0x1e')](_0x19d462)['then'](function(_0x5861a4){return _0x5861a4;});}return null;};}function removeEntity(_0x32c4a1,_0x25f9db){return function(_0x5d5ee7){if(_0x5d5ee7){return _0x5d5ee7[_0x834a('0x1f')]()['then'](function(){var _0x51a569=_0x5d5ee7[_0x834a('0x20')]({'plain':!![]});var _0x2e0df4='MusicOnHolds';return db[_0x834a('0x21')][_0x834a('0x1f')]({'where':{'type':_0x2e0df4,'resourceId':_0x51a569['id']}})[_0x834a('0x22')](function(){return _0x5d5ee7;});})['then'](function(){_0x32c4a1[_0x834a('0x15')](0xcc)[_0x834a('0x16')]();});}};}function handleEntityNotFound(_0x48f7a5,_0x1ece5b){return function(_0x23fcf1){if(!_0x23fcf1){_0x48f7a5[_0x834a('0x14')](0x194);}return _0x23fcf1;};}function handleError(_0xe9fc5,_0x1deeca){_0x1deeca=_0x1deeca||0x1f4;return function(_0x4c7076){logger[_0x834a('0x23')](_0x4c7076['stack']);if(_0x4c7076['name']){delete _0x4c7076['name'];}_0xe9fc5[_0x834a('0x15')](_0x1deeca)[_0x834a('0x24')](_0x4c7076);};}exports['index']=function(_0x57e141,_0x5d775f){var _0x379434={},_0x23a51f={},_0x574e5b={'count':0x0,'rows':[]};var _0x58996d=_[_0x834a('0x25')](db[_0x834a('0x26')][_0x834a('0x27')],function(_0x47e945){return{'name':_0x47e945[_0x834a('0x28')],'type':_0x47e945[_0x834a('0x29')][_0x834a('0x2a')]};});_0x23a51f[_0x834a('0x2b')]=_[_0x834a('0x25')](_0x58996d,'name');_0x23a51f[_0x834a('0x2c')]=_['keys'](_0x57e141[_0x834a('0x2c')]);_0x23a51f[_0x834a('0x2d')]=_[_0x834a('0x2e')](_0x23a51f[_0x834a('0x2b')],_0x23a51f['query']);_0x379434[_0x834a('0x2f')]=_[_0x834a('0x2e')](_0x23a51f[_0x834a('0x2b')],qs[_0x834a('0x30')](_0x57e141[_0x834a('0x2c')][_0x834a('0x30')]));_0x379434['attributes']=_0x379434[_0x834a('0x2f')]['length']?_0x379434[_0x834a('0x2f')]:_0x23a51f[_0x834a('0x2b')];if(!_0x57e141[_0x834a('0x2c')]['hasOwnProperty'](_0x834a('0x31'))){_0x379434[_0x834a('0x19')]=qs[_0x834a('0x19')](_0x57e141[_0x834a('0x2c')]['limit']);_0x379434[_0x834a('0x17')]=qs[_0x834a('0x17')](_0x57e141[_0x834a('0x2c')][_0x834a('0x17')]);}_0x379434[_0x834a('0x32')]=qs[_0x834a('0x33')](_0x57e141['query'][_0x834a('0x33')]);delete _0x57e141[_0x834a('0x2c')]['sort'];_0x379434['where']=qs[_0x834a('0x2d')](_['pick'](_0x57e141[_0x834a('0x2c')],_0x23a51f[_0x834a('0x2d')]),_0x58996d);if(_0x57e141[_0x834a('0x2c')]['filter']){_0x379434[_0x834a('0x34')]=_['merge'](_0x379434[_0x834a('0x34')],{'$or':_[_0x834a('0x25')](_0x58996d,function(_0x3e6d3a){if(_0x3e6d3a['type']!==_0x834a('0x35')){var _0x35c647={};_0x35c647[_0x3e6d3a[_0x834a('0x36')]]={'$like':'%'+_0x57e141[_0x834a('0x2c')][_0x834a('0x37')]+'%'};return _0x35c647;}})});}_0x379434=_['merge']({},_0x379434,_0x57e141['options']);var _0x515b0d={'where':_0x379434[_0x834a('0x34')]};return db['VoiceMusicOnHold']['count'](_0x515b0d)[_0x834a('0x22')](function(_0x4e143a){_0x574e5b[_0x834a('0x1a')]=_0x4e143a;if(_0x57e141[_0x834a('0x2c')][_0x834a('0x38')]){_0x379434[_0x834a('0x39')]=[{'all':!![]}];}return db[_0x834a('0x26')][_0x834a('0x3a')](_0x379434);})[_0x834a('0x22')](function(_0x4c3358){_0x574e5b[_0x834a('0x3b')]=_0x4c3358;return _0x574e5b;})[_0x834a('0x22')](respondWithFilteredResult(_0x5d775f,_0x379434))['catch'](handleError(_0x5d775f,null));};exports[_0x834a('0x3c')]=function(_0x3dc044,_0x358a8c){var _0x1a492e={'raw':![],'where':{'id':_0x3dc044[_0x834a('0x3d')]['id']}},_0x5eb8bb={};_0x5eb8bb[_0x834a('0x2b')]=_[_0x834a('0x3e')](db[_0x834a('0x26')][_0x834a('0x27')]);_0x5eb8bb['query']=_[_0x834a('0x3e')](_0x3dc044[_0x834a('0x2c')]);_0x5eb8bb[_0x834a('0x2d')]=_[_0x834a('0x2e')](_0x5eb8bb['model'],_0x5eb8bb['query']);_0x1a492e[_0x834a('0x2f')]=_[_0x834a('0x2e')](_0x5eb8bb['model'],qs[_0x834a('0x30')](_0x3dc044[_0x834a('0x2c')]['fields']));_0x1a492e[_0x834a('0x2f')]=_0x1a492e['attributes'][_0x834a('0x3f')]?_0x1a492e['attributes']:_0x5eb8bb['model'];if(_0x3dc044['query'][_0x834a('0x38')]){_0x1a492e[_0x834a('0x39')]=[{'all':!![]}];}_0x1a492e=_[_0x834a('0x40')]({},_0x1a492e,_0x3dc044[_0x834a('0x41')]);return db['VoiceMusicOnHold'][_0x834a('0x42')](_0x1a492e)[_0x834a('0x22')](handleEntityNotFound(_0x358a8c,null))['then'](respondWithResult(_0x358a8c,null))['catch'](handleError(_0x358a8c,null));};exports[_0x834a('0x1e')]=function(_0x432827,_0x39d33a){if(_0x432827[_0x834a('0x43')]['id']){delete _0x432827[_0x834a('0x43')]['id'];}return db[_0x834a('0x26')][_0x834a('0x42')]({'where':{'id':_0x432827[_0x834a('0x3d')]['id']}})[_0x834a('0x22')](handleEntityNotFound(_0x39d33a,null))[_0x834a('0x22')](saveUpdates(_0x432827[_0x834a('0x43')],null))[_0x834a('0x22')](respondWithResult(_0x39d33a,null))[_0x834a('0x44')](handleError(_0x39d33a,null));};exports[_0x834a('0x45')]=function(_0xdef835,_0x5e53be,_0x302c17){return db[_0x834a('0x46')][_0x834a('0x47')](function(_0x28c751){if(_0xdef835['body'][_0x834a('0x48')]==='files'){_0xdef835[_0x834a('0x43')][_0x834a('0x49')]=path['join'](config[_0x834a('0x4a')],_0x834a('0x4b'),_0xdef835[_0x834a('0x43')]['name']);}return db['VoiceMusicOnHold']['create'](_0xdef835[_0x834a('0x43')],{'transaction':_0x28c751})[_0x834a('0x22')](function(_0x392f24){if(_0xdef835[_0x834a('0x43')]['mode']==='files'){fs[_0x834a('0x4c')](_0x392f24[_0x834a('0x49')],parseInt(_0x834a('0x4d'),0x8));}var _0xdad55e=_0xdef835[_0x834a('0x4e')]['get']({'plain':!![]});if(!_0xdad55e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdad55e['role']===_0x834a('0x4e')){var _0x191ba9=_0x392f24[_0x834a('0x20')]({'plain':!![]});return db['UserProfileSection'][_0x834a('0x42')]({'where':{'name':_0x834a('0x4f'),'userProfileId':_0xdad55e[_0x834a('0x50')]},'raw':!![]})[_0x834a('0x22')](function(_0x474dbf){if(_0x474dbf&&_0x474dbf[_0x834a('0x51')]===0x0){return db['UserProfileResource'][_0x834a('0x45')]({'name':_0x191ba9[_0x834a('0x36')],'resourceId':_0x191ba9['id'],'type':_0x474dbf[_0x834a('0x36')],'sectionId':_0x474dbf['id']},{})['then'](function(){return _0x392f24;});}else{return _0x392f24;}})[_0x834a('0x44')](function(_0x5d2cdd){logger[_0x834a('0x23')](_0x834a('0x52'),_0x5d2cdd);});}return _0x392f24;});})[_0x834a('0x22')](respondWithResult(_0x5e53be,0xc9))[_0x834a('0x44')](handleError(_0x5e53be,null));};exports['destroy']=function(_0x473b0d,_0x28db12,_0x3f637b){var _0x55880c;return db[_0x834a('0x26')]['find']({'where':{'id':_0x473b0d[_0x834a('0x3d')]['id']}})['then'](function(_0x5ed5f8){if(_0x5ed5f8){return db[_0x834a('0x46')][_0x834a('0x47')](function(_0x26fc62){return _0x5ed5f8[_0x834a('0x1f')]({'transaction':_0x26fc62,'raw':!![]})['then'](function(_0x1337c3){if(_0x1337c3[_0x834a('0x49')]){fs[_0x834a('0x53')](_0x1337c3['directory'])[_0x834a('0x54')](function(_0x5af88e){fs[_0x834a('0x55')](path[_0x834a('0x56')](_0x1337c3[_0x834a('0x49')],_0x5af88e));});fs[_0x834a('0x57')](_0x1337c3[_0x834a('0x49')]);}return _0x1337c3;});})[_0x834a('0x44')](function(_0x356503){throw new db[(_0x834a('0x58'))][(_0x834a('0x59'))](_0x356503[_0x834a('0x5a')]);});}})['then'](handleEntityNotFound(_0x28db12,null))['then'](removeEntity(_0x28db12,null))[_0x834a('0x44')](handleError(_0x28db12,null));};exports[_0x834a('0x5b')]=function(_0x2f7aca,_0x46251d,_0x5205bd){return db['sequelize'][_0x834a('0x47')](function(_0x17cdb3){var _0x5637b8;return db['VoiceMusicOnHold'][_0x834a('0x42')]({'where':{'id':_0x2f7aca[_0x834a('0x3d')]['id']}})['then'](function(_0x41caf5){if(_0x41caf5){_0x5637b8=_0x41caf5;return _0x41caf5[_0x834a('0x5b')](_0x2f7aca[_0x834a('0x43')]['id'],{'transaction':_0x17cdb3});}})[_0x834a('0x22')](function(_0x350f82){if(_0x350f82){return db['Sound'][_0x834a('0x5c')]({'where':{'id':_0x2f7aca[_0x834a('0x43')]['id']},'attributes':['id',_0x834a('0x36'),_0x834a('0x5d'),'converted_format',_0x834a('0x5e')],'raw':!![]});}})[_0x834a('0x22')](function(_0x3f0298){if(_0x3f0298){var _0x518f38=path['join'](config['root'],_0x834a('0x5f'),util[_0x834a('0x60')](_0x834a('0x61'),path[_0x834a('0x62')](_0x3f0298['save_name'],path[_0x834a('0x63')](_0x3f0298[_0x834a('0x5d')])),_0x3f0298[_0x834a('0x64')]));var _0x883f8b=path['join'](config[_0x834a('0x4a')],'server/files/moh',_0x5637b8[_0x834a('0x36')],util[_0x834a('0x60')]('%s.%s',_0x3f0298['name'],_0x3f0298[_0x834a('0x64')]));fs['symlinkSync'](_0x518f38,_0x883f8b);return _0x3f0298;}})[_0x834a('0x44')](function(_0x471f80){throw new db[(_0x834a('0x58'))]['ValidationError'](_0x471f80['message']);});})['then'](handleEntityNotFound(_0x46251d,null))['then'](respondWithResult(_0x46251d,0xc9))[_0x834a('0x44')](handleError(_0x46251d,null));};exports[_0x834a('0x65')]=function(_0x3c9287,_0x2501e9,_0x46d2ba){return db[_0x834a('0x46')]['transaction'](function(_0x4fb620){var _0x1261d8;return db[_0x834a('0x26')][_0x834a('0x5c')]({'where':{'id':_0x3c9287[_0x834a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2501e9,null))[_0x834a('0x22')](function(_0x5cd59e){if(_0x5cd59e){_0x1261d8=_0x5cd59e;return _0x5cd59e[_0x834a('0x65')](_0x3c9287[_0x834a('0x3d')][_0x834a('0x66')]);}})[_0x834a('0x22')](function(_0x3570b3){if(_0x3570b3){return db['Sound'][_0x834a('0x5c')]({'where':{'id':_0x3c9287[_0x834a('0x3d')][_0x834a('0x66')]},'attributes':['id',_0x834a('0x36'),'save_name',_0x834a('0x64'),_0x834a('0x5e')],'raw':!![]});}})[_0x834a('0x22')](function(_0x27bbbe){if(_0x27bbbe){fs[_0x834a('0x55')](path['join'](_0x1261d8[_0x834a('0x49')],util[_0x834a('0x60')](_0x834a('0x61'),_0x27bbbe[_0x834a('0x36')],_0x27bbbe[_0x834a('0x64')])));return _0x27bbbe;}})[_0x834a('0x44')](function(_0x51d5cb){throw new db[(_0x834a('0x58'))][(_0x834a('0x59'))](_0x51d5cb['message']);});})[_0x834a('0x22')](handleEntityNotFound(_0x2501e9,null))[_0x834a('0x22')](respondWithStatusCode(_0x2501e9,0xcc))[_0x834a('0x44')](handleError(_0x2501e9,null));};exports[_0x834a('0x67')]=function(_0xa0d03,_0x3c7dd8,_0x393b13){var _0x33a1a9={};var _0xcd1eaa={};var _0x47d41e;var _0x2eb5a3;return db[_0x834a('0x26')][_0x834a('0x5c')]({'where':{'id':_0xa0d03[_0x834a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c7dd8,null))['then'](function(_0x2125b4){if(_0x2125b4){_0x47d41e=_0x2125b4;_0xcd1eaa[_0x834a('0x2b')]=_[_0x834a('0x3e')](db[_0x834a('0x68')][_0x834a('0x27')]);_0xcd1eaa['query']=_[_0x834a('0x3e')](_0xa0d03[_0x834a('0x2c')]);_0xcd1eaa['filters']=_[_0x834a('0x2e')](_0xcd1eaa[_0x834a('0x2b')],_0xcd1eaa['query']);_0x33a1a9[_0x834a('0x2f')]=_[_0x834a('0x2e')](_0xcd1eaa[_0x834a('0x2b')],qs[_0x834a('0x30')](_0xa0d03[_0x834a('0x2c')][_0x834a('0x30')]));_0x33a1a9['attributes']=_0x33a1a9[_0x834a('0x2f')][_0x834a('0x3f')]?_0x33a1a9['attributes']:_0xcd1eaa[_0x834a('0x2b')];_0x33a1a9[_0x834a('0x32')]=qs[_0x834a('0x33')](_0xa0d03['query'][_0x834a('0x33')]);_0x33a1a9[_0x834a('0x34')]=qs[_0x834a('0x2d')](_[_0x834a('0x69')](_0xa0d03['query'],_0xcd1eaa[_0x834a('0x2d')]));if(_0xa0d03['query'][_0x834a('0x37')]){_0x33a1a9[_0x834a('0x34')]=_[_0x834a('0x40')](_0x33a1a9[_0x834a('0x34')],{'$or':_[_0x834a('0x25')](_0x33a1a9[_0x834a('0x2f')],function(_0x2d0b41){var _0x43a3a7={};_0x43a3a7[_0x2d0b41]={'$like':'%'+_0xa0d03[_0x834a('0x2c')][_0x834a('0x37')]+'%'};return _0x43a3a7;})});}_0x33a1a9=_[_0x834a('0x40')]({},_0x33a1a9,_0xa0d03[_0x834a('0x41')]);return _0x47d41e['getSounds'](_0x33a1a9);}})[_0x834a('0x22')](function(_0x403eaa){if(_0x403eaa){_0x2eb5a3=_0x403eaa[_0x834a('0x3f')];if(!_0xa0d03[_0x834a('0x2c')][_0x834a('0x6a')](_0x834a('0x31'))){_0x33a1a9[_0x834a('0x19')]=qs[_0x834a('0x19')](_0xa0d03[_0x834a('0x2c')][_0x834a('0x19')]);_0x33a1a9[_0x834a('0x17')]=qs[_0x834a('0x17')](_0xa0d03[_0x834a('0x2c')][_0x834a('0x17')]);}return _0x47d41e[_0x834a('0x67')](_0x33a1a9);}})[_0x834a('0x22')](function(_0x2c5f28){if(_0x2c5f28){return _0x2c5f28?{'count':_0x2eb5a3,'rows':_0x2c5f28}:null;}})[_0x834a('0x22')](respondWithResult(_0x3c7dd8,null))[_0x834a('0x44')](handleError(_0x3c7dd8,null));}; \ No newline at end of file +var _0x2d94=['includeAll','include','findAll','catch','params','length','find','body','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','Sound','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d94,0x1ee));var _0x42d9=function(_0x4514c0,_0x5f1419){_0x4514c0=_0x4514c0-0x0;var _0x10daeb=_0x2d94[_0x4514c0];return _0x10daeb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42d9('0x0'));var zipdir=require(_0x42d9('0x1'));var jsonpatch=require(_0x42d9('0x2'));var rp=require(_0x42d9('0x3'));var moment=require(_0x42d9('0x4'));var BPromise=require(_0x42d9('0x5'));var Mustache=require(_0x42d9('0x6'));var util=require(_0x42d9('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x42d9('0x8'));var fs=require('fs');var fs_extra=require(_0x42d9('0x9'));var _=require(_0x42d9('0xa'));var squel=require(_0x42d9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x42d9('0xc'));var toCsv=require(_0x42d9('0xd'));var querystring=require('querystring');var Papa=require(_0x42d9('0xe'));var Redis=require('ioredis');var authService=require(_0x42d9('0xf'));var qs=require(_0x42d9('0x10'));var as=require(_0x42d9('0x11'));var hardwareService=require(_0x42d9('0x12'));var logger=require(_0x42d9('0x13'))(_0x42d9('0x14'));var utils=require(_0x42d9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x42d9('0x16'))['db'];function respondWithStatusCode(_0x5c9a7e,_0x5b1780){_0x5b1780=_0x5b1780||0xcc;return function(_0x53cb14){if(_0x53cb14){return _0x5c9a7e[_0x42d9('0x17')](_0x5b1780);}return _0x5c9a7e[_0x42d9('0x18')](_0x5b1780)[_0x42d9('0x19')]();};}function respondWithResult(_0x5da1bd,_0x437f60){_0x437f60=_0x437f60||0xc8;return function(_0x35a5d6){if(_0x35a5d6){return _0x5da1bd[_0x42d9('0x18')](_0x437f60)[_0x42d9('0x1a')](_0x35a5d6);}};}function respondWithFilteredResult(_0x939126,_0x5e940b){return function(_0x2d7bcc){if(_0x2d7bcc){var _0x375e20=typeof _0x5e940b[_0x42d9('0x1b')]==='undefined'&&typeof _0x5e940b[_0x42d9('0x1c')]===_0x42d9('0x1d');var _0x3eaf9d=_0x2d7bcc[_0x42d9('0x1e')];var _0x259f1b=_0x375e20?0x0:_0x5e940b[_0x42d9('0x1b')];var _0x284422=_0x375e20?_0x2d7bcc[_0x42d9('0x1e')]:_0x5e940b[_0x42d9('0x1b')]+_0x5e940b[_0x42d9('0x1c')];var _0x4755be;if(_0x284422>=_0x3eaf9d){_0x284422=_0x3eaf9d;_0x4755be=0xc8;}else{_0x4755be=0xce;}_0x939126[_0x42d9('0x18')](_0x4755be);return _0x939126[_0x42d9('0x1f')](_0x42d9('0x20'),_0x259f1b+'-'+_0x284422+'/'+_0x3eaf9d)[_0x42d9('0x1a')](_0x2d7bcc);}return null;};}function patchUpdates(_0x36b84e){return function(_0x2ea914){try{jsonpatch['apply'](_0x2ea914,_0x36b84e,!![]);}catch(_0x30ccab){return BPromise['reject'](_0x30ccab);}return _0x2ea914[_0x42d9('0x21')]();};}function saveUpdates(_0x9debd5,_0x277198){return function(_0x357e94){if(_0x357e94){return _0x357e94[_0x42d9('0x22')](_0x9debd5)[_0x42d9('0x23')](function(_0x43e344){return _0x43e344;});}return null;};}function removeEntity(_0x298248,_0x2b4c7f){return function(_0x543bfc){if(_0x543bfc){return _0x543bfc[_0x42d9('0x24')]()[_0x42d9('0x23')](function(){var _0x1bb028=_0x543bfc[_0x42d9('0x25')]({'plain':!![]});var _0x40c005=_0x42d9('0x26');return db[_0x42d9('0x27')][_0x42d9('0x24')]({'where':{'type':_0x40c005,'resourceId':_0x1bb028['id']}})[_0x42d9('0x23')](function(){return _0x543bfc;});})[_0x42d9('0x23')](function(){_0x298248[_0x42d9('0x18')](0xcc)[_0x42d9('0x19')]();});}};}function handleEntityNotFound(_0x3e1d99,_0xd2d1b){return function(_0x5c696d){if(!_0x5c696d){_0x3e1d99[_0x42d9('0x17')](0x194);}return _0x5c696d;};}function handleError(_0x3190f8,_0x494b8f){_0x494b8f=_0x494b8f||0x1f4;return function(_0x40d49c){logger[_0x42d9('0x28')](_0x40d49c['stack']);if(_0x40d49c[_0x42d9('0x29')]){delete _0x40d49c[_0x42d9('0x29')];}_0x3190f8['status'](_0x494b8f)['send'](_0x40d49c);};}exports[_0x42d9('0x2a')]=function(_0x4d0ce0,_0x3b31fb){var _0x20b799={},_0x4c9d41={},_0x3799c4={'count':0x0,'rows':[]};var _0x4987d9=_['map'](db[_0x42d9('0x2b')][_0x42d9('0x2c')],function(_0x5c0a6c){return{'name':_0x5c0a6c[_0x42d9('0x2d')],'type':_0x5c0a6c[_0x42d9('0x2e')][_0x42d9('0x2f')]};});_0x4c9d41[_0x42d9('0x30')]=_[_0x42d9('0x31')](_0x4987d9,'name');_0x4c9d41[_0x42d9('0x32')]=_[_0x42d9('0x33')](_0x4d0ce0[_0x42d9('0x32')]);_0x4c9d41[_0x42d9('0x34')]=_[_0x42d9('0x35')](_0x4c9d41[_0x42d9('0x30')],_0x4c9d41['query']);_0x20b799[_0x42d9('0x36')]=_[_0x42d9('0x35')](_0x4c9d41['model'],qs[_0x42d9('0x37')](_0x4d0ce0[_0x42d9('0x32')][_0x42d9('0x37')]));_0x20b799[_0x42d9('0x36')]=_0x20b799[_0x42d9('0x36')]['length']?_0x20b799[_0x42d9('0x36')]:_0x4c9d41[_0x42d9('0x30')];if(!_0x4d0ce0['query'][_0x42d9('0x38')](_0x42d9('0x39'))){_0x20b799[_0x42d9('0x1c')]=qs[_0x42d9('0x1c')](_0x4d0ce0[_0x42d9('0x32')][_0x42d9('0x1c')]);_0x20b799[_0x42d9('0x1b')]=qs[_0x42d9('0x1b')](_0x4d0ce0[_0x42d9('0x32')][_0x42d9('0x1b')]);}_0x20b799[_0x42d9('0x3a')]=qs[_0x42d9('0x3b')](_0x4d0ce0['query']['sort']);delete _0x4d0ce0['query'][_0x42d9('0x3b')];_0x20b799[_0x42d9('0x3c')]=qs[_0x42d9('0x34')](_[_0x42d9('0x3d')](_0x4d0ce0[_0x42d9('0x32')],_0x4c9d41[_0x42d9('0x34')]),_0x4987d9);if(_0x4d0ce0[_0x42d9('0x32')][_0x42d9('0x3e')]){_0x20b799['where']=_[_0x42d9('0x3f')](_0x20b799[_0x42d9('0x3c')],{'$or':_[_0x42d9('0x31')](_0x4987d9,function(_0x54011a){if(_0x54011a['type']!==_0x42d9('0x40')){var _0x13a631={};_0x13a631[_0x54011a['name']]={'$like':'%'+_0x4d0ce0[_0x42d9('0x32')]['filter']+'%'};return _0x13a631;}})});}_0x20b799=_[_0x42d9('0x3f')]({},_0x20b799,_0x4d0ce0[_0x42d9('0x41')]);var _0x1509de={'where':_0x20b799[_0x42d9('0x3c')]};return db[_0x42d9('0x2b')][_0x42d9('0x1e')](_0x1509de)['then'](function(_0x96f303){_0x3799c4['count']=_0x96f303;if(_0x4d0ce0[_0x42d9('0x32')][_0x42d9('0x42')]){_0x20b799[_0x42d9('0x43')]=[{'all':!![]}];}return db[_0x42d9('0x2b')][_0x42d9('0x44')](_0x20b799);})['then'](function(_0x566732){_0x3799c4['rows']=_0x566732;return _0x3799c4;})['then'](respondWithFilteredResult(_0x3b31fb,_0x20b799))[_0x42d9('0x45')](handleError(_0x3b31fb,null));};exports['show']=function(_0x2add5e,_0x2f9828){var _0x25bb81={'raw':![],'where':{'id':_0x2add5e[_0x42d9('0x46')]['id']}},_0x1d6e14={};_0x1d6e14[_0x42d9('0x30')]=_[_0x42d9('0x33')](db[_0x42d9('0x2b')][_0x42d9('0x2c')]);_0x1d6e14[_0x42d9('0x32')]=_['keys'](_0x2add5e[_0x42d9('0x32')]);_0x1d6e14['filters']=_[_0x42d9('0x35')](_0x1d6e14[_0x42d9('0x30')],_0x1d6e14[_0x42d9('0x32')]);_0x25bb81[_0x42d9('0x36')]=_[_0x42d9('0x35')](_0x1d6e14['model'],qs['fields'](_0x2add5e[_0x42d9('0x32')][_0x42d9('0x37')]));_0x25bb81[_0x42d9('0x36')]=_0x25bb81['attributes'][_0x42d9('0x47')]?_0x25bb81[_0x42d9('0x36')]:_0x1d6e14[_0x42d9('0x30')];if(_0x2add5e[_0x42d9('0x32')][_0x42d9('0x42')]){_0x25bb81['include']=[{'all':!![]}];}_0x25bb81=_[_0x42d9('0x3f')]({},_0x25bb81,_0x2add5e[_0x42d9('0x41')]);return db[_0x42d9('0x2b')][_0x42d9('0x48')](_0x25bb81)[_0x42d9('0x23')](handleEntityNotFound(_0x2f9828,null))[_0x42d9('0x23')](respondWithResult(_0x2f9828,null))[_0x42d9('0x45')](handleError(_0x2f9828,null));};exports[_0x42d9('0x22')]=function(_0x14f643,_0x279442){if(_0x14f643[_0x42d9('0x49')]['id']){delete _0x14f643[_0x42d9('0x49')]['id'];}return db[_0x42d9('0x2b')][_0x42d9('0x48')]({'where':{'id':_0x14f643['params']['id']}})[_0x42d9('0x23')](handleEntityNotFound(_0x279442,null))[_0x42d9('0x23')](saveUpdates(_0x14f643[_0x42d9('0x49')],null))[_0x42d9('0x23')](respondWithResult(_0x279442,null))[_0x42d9('0x45')](handleError(_0x279442,null));};exports[_0x42d9('0x4a')]=function(_0x5d53fa,_0x5f20c1,_0x450301){return db['sequelize'][_0x42d9('0x4b')](function(_0x5d635f){if(_0x5d53fa[_0x42d9('0x49')][_0x42d9('0x4c')]===_0x42d9('0x4d')){_0x5d53fa[_0x42d9('0x49')][_0x42d9('0x4e')]=path[_0x42d9('0x4f')](config[_0x42d9('0x50')],_0x42d9('0x51'),_0x5d53fa['body']['name']);}return db[_0x42d9('0x2b')][_0x42d9('0x4a')](_0x5d53fa[_0x42d9('0x49')],{'transaction':_0x5d635f})[_0x42d9('0x23')](function(_0x45e08b){if(_0x5d53fa[_0x42d9('0x49')][_0x42d9('0x4c')]===_0x42d9('0x4d')){fs[_0x42d9('0x52')](_0x45e08b['directory'],parseInt(_0x42d9('0x53'),0x8));}var _0x40d014=_0x5d53fa[_0x42d9('0x54')][_0x42d9('0x25')]({'plain':!![]});if(!_0x40d014)throw new Error(_0x42d9('0x55'));if(_0x40d014[_0x42d9('0x56')]===_0x42d9('0x54')){var _0x4af121=_0x45e08b[_0x42d9('0x25')]({'plain':!![]});return db[_0x42d9('0x57')]['find']({'where':{'name':_0x42d9('0x26'),'userProfileId':_0x40d014[_0x42d9('0x58')]},'raw':!![]})[_0x42d9('0x23')](function(_0x12184a){if(_0x12184a&&_0x12184a['autoAssociation']===0x0){return db[_0x42d9('0x27')][_0x42d9('0x4a')]({'name':_0x4af121[_0x42d9('0x29')],'resourceId':_0x4af121['id'],'type':_0x12184a['name'],'sectionId':_0x12184a['id']},{})['then'](function(){return _0x45e08b;});}else{return _0x45e08b;}})[_0x42d9('0x45')](function(_0xab9017){logger[_0x42d9('0x28')](_0x42d9('0x59'),_0xab9017);});}return _0x45e08b;});})[_0x42d9('0x23')](respondWithResult(_0x5f20c1,0xc9))['catch'](handleError(_0x5f20c1,null));};exports[_0x42d9('0x24')]=function(_0x4c4e18,_0x36c376,_0x3dcaf4){var _0x14df76;return db[_0x42d9('0x2b')][_0x42d9('0x48')]({'where':{'id':_0x4c4e18[_0x42d9('0x46')]['id']}})['then'](function(_0x1e99ac){if(_0x1e99ac){return db[_0x42d9('0x5a')][_0x42d9('0x4b')](function(_0x5986c1){return _0x1e99ac[_0x42d9('0x24')]({'transaction':_0x5986c1,'raw':!![]})['then'](function(_0x543832){if(_0x543832[_0x42d9('0x4e')]){fs['readdirSync'](_0x543832[_0x42d9('0x4e')])[_0x42d9('0x5b')](function(_0x19c04e){fs[_0x42d9('0x5c')](path['join'](_0x543832[_0x42d9('0x4e')],_0x19c04e));});fs[_0x42d9('0x5d')](_0x543832[_0x42d9('0x4e')]);}return _0x543832;});})[_0x42d9('0x45')](function(_0x400b4c){throw new db[(_0x42d9('0x5e'))][(_0x42d9('0x5f'))](_0x400b4c[_0x42d9('0x60')]);});}})[_0x42d9('0x23')](handleEntityNotFound(_0x36c376,null))[_0x42d9('0x23')](removeEntity(_0x36c376,null))[_0x42d9('0x45')](handleError(_0x36c376,null));};exports[_0x42d9('0x61')]=function(_0x578df8,_0x514867,_0x2fdf50){return db[_0x42d9('0x5a')][_0x42d9('0x4b')](function(_0x55192d){var _0x259960;return db['VoiceMusicOnHold'][_0x42d9('0x48')]({'where':{'id':_0x578df8[_0x42d9('0x46')]['id']}})[_0x42d9('0x23')](function(_0x3cf233){if(_0x3cf233){_0x259960=_0x3cf233;return _0x3cf233[_0x42d9('0x61')](_0x578df8['body']['id'],{'transaction':_0x55192d});}})[_0x42d9('0x23')](function(_0x16b692){if(_0x16b692){return db['Sound'][_0x42d9('0x62')]({'where':{'id':_0x578df8['body']['id']},'attributes':['id',_0x42d9('0x29'),_0x42d9('0x63'),_0x42d9('0x64'),_0x42d9('0x65')],'raw':!![]});}})[_0x42d9('0x23')](function(_0x4d8039){if(_0x4d8039){var _0x13a846=path[_0x42d9('0x4f')](config['root'],_0x42d9('0x66'),util[_0x42d9('0x67')](_0x42d9('0x68'),path[_0x42d9('0x69')](_0x4d8039[_0x42d9('0x63')],path[_0x42d9('0x6a')](_0x4d8039[_0x42d9('0x63')])),_0x4d8039['converted_format']));var _0xf2c610=path[_0x42d9('0x4f')](config[_0x42d9('0x50')],_0x42d9('0x51'),_0x259960['name'],util[_0x42d9('0x67')](_0x42d9('0x68'),_0x4d8039[_0x42d9('0x29')],_0x4d8039[_0x42d9('0x64')]));fs[_0x42d9('0x6b')](_0x13a846,_0xf2c610);return _0x4d8039;}})['catch'](function(_0x185122){throw new db[(_0x42d9('0x5e'))][(_0x42d9('0x5f'))](_0x185122[_0x42d9('0x60')]);});})[_0x42d9('0x23')](handleEntityNotFound(_0x514867,null))['then'](respondWithResult(_0x514867,0xc9))['catch'](handleError(_0x514867,null));};exports[_0x42d9('0x6c')]=function(_0x4a525c,_0x1dc109,_0xd8c681){return db[_0x42d9('0x5a')]['transaction'](function(_0x58d8e7){var _0x5767d5;return db[_0x42d9('0x2b')][_0x42d9('0x62')]({'where':{'id':_0x4a525c[_0x42d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dc109,null))[_0x42d9('0x23')](function(_0x7a6a3b){if(_0x7a6a3b){_0x5767d5=_0x7a6a3b;return _0x7a6a3b[_0x42d9('0x6c')](_0x4a525c[_0x42d9('0x46')][_0x42d9('0x6d')]);}})[_0x42d9('0x23')](function(_0x54fe54){if(_0x54fe54){return db['Sound'][_0x42d9('0x62')]({'where':{'id':_0x4a525c[_0x42d9('0x46')][_0x42d9('0x6d')]},'attributes':['id',_0x42d9('0x29'),_0x42d9('0x63'),_0x42d9('0x64'),'createdAt'],'raw':!![]});}})[_0x42d9('0x23')](function(_0x1f1abf){if(_0x1f1abf){fs[_0x42d9('0x5c')](path[_0x42d9('0x4f')](_0x5767d5[_0x42d9('0x4e')],util[_0x42d9('0x67')](_0x42d9('0x68'),_0x1f1abf[_0x42d9('0x29')],_0x1f1abf[_0x42d9('0x64')])));return _0x1f1abf;}})[_0x42d9('0x45')](function(_0x2337a2){throw new db[(_0x42d9('0x5e'))][(_0x42d9('0x5f'))](_0x2337a2[_0x42d9('0x60')]);});})['then'](handleEntityNotFound(_0x1dc109,null))[_0x42d9('0x23')](respondWithStatusCode(_0x1dc109,0xcc))['catch'](handleError(_0x1dc109,null));};exports[_0x42d9('0x6e')]=function(_0x28d53b,_0x2882ba,_0xc75c8f){var _0x5ee9be={};var _0x2d6d25={};var _0x273a21;var _0x173e9f;return db[_0x42d9('0x2b')]['findOne']({'where':{'id':_0x28d53b['params']['id']}})[_0x42d9('0x23')](handleEntityNotFound(_0x2882ba,null))[_0x42d9('0x23')](function(_0x534ae5){if(_0x534ae5){_0x273a21=_0x534ae5;_0x2d6d25[_0x42d9('0x30')]=_['keys'](db[_0x42d9('0x6f')][_0x42d9('0x2c')]);_0x2d6d25[_0x42d9('0x32')]=_[_0x42d9('0x33')](_0x28d53b[_0x42d9('0x32')]);_0x2d6d25['filters']=_[_0x42d9('0x35')](_0x2d6d25[_0x42d9('0x30')],_0x2d6d25[_0x42d9('0x32')]);_0x5ee9be['attributes']=_[_0x42d9('0x35')](_0x2d6d25[_0x42d9('0x30')],qs['fields'](_0x28d53b['query'][_0x42d9('0x37')]));_0x5ee9be[_0x42d9('0x36')]=_0x5ee9be[_0x42d9('0x36')][_0x42d9('0x47')]?_0x5ee9be[_0x42d9('0x36')]:_0x2d6d25['model'];_0x5ee9be['order']=qs['sort'](_0x28d53b[_0x42d9('0x32')][_0x42d9('0x3b')]);_0x5ee9be[_0x42d9('0x3c')]=qs[_0x42d9('0x34')](_[_0x42d9('0x3d')](_0x28d53b['query'],_0x2d6d25['filters']));if(_0x28d53b[_0x42d9('0x32')]['filter']){_0x5ee9be['where']=_[_0x42d9('0x3f')](_0x5ee9be['where'],{'$or':_[_0x42d9('0x31')](_0x5ee9be[_0x42d9('0x36')],function(_0x145a42){var _0x23711d={};_0x23711d[_0x145a42]={'$like':'%'+_0x28d53b[_0x42d9('0x32')][_0x42d9('0x3e')]+'%'};return _0x23711d;})});}_0x5ee9be=_[_0x42d9('0x3f')]({},_0x5ee9be,_0x28d53b[_0x42d9('0x41')]);return _0x273a21[_0x42d9('0x6e')](_0x5ee9be);}})[_0x42d9('0x23')](function(_0x432dac){if(_0x432dac){_0x173e9f=_0x432dac[_0x42d9('0x47')];if(!_0x28d53b[_0x42d9('0x32')][_0x42d9('0x38')](_0x42d9('0x39'))){_0x5ee9be[_0x42d9('0x1c')]=qs['limit'](_0x28d53b[_0x42d9('0x32')]['limit']);_0x5ee9be['offset']=qs['offset'](_0x28d53b[_0x42d9('0x32')]['offset']);}return _0x273a21[_0x42d9('0x6e')](_0x5ee9be);}})[_0x42d9('0x23')](function(_0x4a18f3){if(_0x4a18f3){return _0x4a18f3?{'count':_0x173e9f,'rows':_0x4a18f3}:null;}})['then'](respondWithResult(_0x2882ba,null))['catch'](handleError(_0x2882ba,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0e63a7f..bece3b1 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 _0xa293=['voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','VoiceMusicOnHold'];(function(_0x3adde2,_0x3062c3){var _0xd3726d=function(_0x42bbe6){while(--_0x42bbe6){_0x3adde2['push'](_0x3adde2['shift']());}};_0xd3726d(++_0x3062c3);}(_0xa293,0x6f));var _0x3a29=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa293[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x3a29('0x0'));var logger=require(_0x3a29('0x1'))(_0x3a29('0x2'));var moment=require(_0x3a29('0x3'));var BPromise=require(_0x3a29('0x4'));var rp=require(_0x3a29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x3a29('0x6')]=function(_0xea8baf,_0x19156c){return _0xea8baf[_0x3a29('0x7')](_0x3a29('0x8'),attributes,{'tableName':_0x3a29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ed7=['../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x6ed7,0x163));var _0x76ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ed7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ed('0x0'));var util=require(_0x76ed('0x1'));var logger=require(_0x76ed('0x2'))(_0x76ed('0x3'));var moment=require(_0x76ed('0x4'));var BPromise=require(_0x76ed('0x5'));var rp=require(_0x76ed('0x6'));var fs=require('fs');var path=require(_0x76ed('0x7'));var rimraf=require(_0x76ed('0x8'));var config=require(_0x76ed('0x9'));var attributes=require(_0x76ed('0xa'));module[_0x76ed('0xb')]=function(_0x55947d,_0x4ec97b){return _0x55947d['define'](_0x76ed('0xc'),attributes,{'tableName':_0x76ed('0xd'),'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 a06bbdc..2b51afa 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x29f2e5,_0x3a6ea3){var _0x58c797=function(_0x573094){while(--_0x573094){_0x29f2e5['push'](_0x29f2e5['shift']());}};_0x58c797(++_0x3a6ea3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xcb91[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _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(_0x48754e,_0x53227e){var _0x248110=function(_0x43059f){while(--_0x43059f){_0x48754e['push'](_0x48754e['shift']());}};_0x248110(++_0x53227e);}(_0x70e0,0x17b));var _0x070e=function(_0x8dbe8f,_0x4511e9){_0x8dbe8f=_0x8dbe8f-0x0;var _0x3490dc=_0x70e0[_0x8dbe8f];return _0x3490dc;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 0a05743..7a37fbe 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 _0xb673=['removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','/:id','update','destroy','delete'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xb673,0xa5));var _0x3b67=function(_0x302310,_0xb7691d){_0x302310=_0x302310-0x0;var _0x12ad6f=_0xb673[_0x302310];return _0x12ad6f;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b67('0x5'));var interaction=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var controller=require('./voicePrefix.controller');router[_0x3b67('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x8')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3b67('0xc')]);router['get'](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0xe')]);router[_0x3b67('0x8')](_0x3b67('0xf'),auth[_0x3b67('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3b67('0x10')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x11')]);router[_0x3b67('0x10')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x12')]);router[_0x3b67('0x13')](_0x3b67('0x14'),auth[_0x3b67('0xb')](),controller[_0x3b67('0x15')]);router['delete']('/:id',auth[_0x3b67('0xb')](),controller[_0x3b67('0x16')]);router[_0x3b67('0x17')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x18')]);router[_0x3b67('0x17')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x19')]);module[_0x3b67('0x1a')]=router; \ No newline at end of file +var _0x74eb=['index','isAuthenticated','/:id','show','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','addTeams','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x74eb,0x13b));var _0xb74e=function(_0x525d3c,_0x33a8b3){_0x525d3c=_0x525d3c-0x0;var _0x3de256=_0x74eb[_0x525d3c];return _0x3de256;};'use strict';var multer=require(_0xb74e('0x0'));var util=require(_0xb74e('0x1'));var path=require(_0xb74e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb74e('0x3'));var router=express[_0xb74e('0x4')]();var fs_extra=require(_0xb74e('0x5'));var auth=require(_0xb74e('0x6'));var interaction=require(_0xb74e('0x7'));var config=require(_0xb74e('0x8'));var controller=require('./voicePrefix.controller');router[_0xb74e('0x9')]('/',auth['isAuthenticated'](),controller[_0xb74e('0xa')]);router[_0xb74e('0x9')]('/describe',auth[_0xb74e('0xb')](),controller['describe']);router['get'](_0xb74e('0xc'),auth['isAuthenticated'](),controller[_0xb74e('0xd')]);router[_0xb74e('0x9')]('/:id/users',auth[_0xb74e('0xb')](),controller[_0xb74e('0xe')]);router[_0xb74e('0x9')](_0xb74e('0xf'),auth[_0xb74e('0xb')](),controller[_0xb74e('0x10')]);router[_0xb74e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb74e('0x11')](_0xb74e('0x12'),auth[_0xb74e('0xb')](),controller[_0xb74e('0x13')]);router[_0xb74e('0x11')](_0xb74e('0xf'),auth[_0xb74e('0xb')](),controller[_0xb74e('0x14')]);router['put'](_0xb74e('0xc'),auth[_0xb74e('0xb')](),controller[_0xb74e('0x15')]);router['delete']('/:id',auth[_0xb74e('0xb')](),controller['destroy']);router[_0xb74e('0x16')]('/:id/users',auth[_0xb74e('0xb')](),controller[_0xb74e('0x17')]);router[_0xb74e('0x16')](_0xb74e('0xf'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xb74e('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index ae4a377..284dd93 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 _0x5141=['INTEGER','exports','name','getDataValue','STRING'];(function(_0x7e4ed,_0x193845){var _0xbb9250=function(_0x13b90d){while(--_0x13b90d){_0x7e4ed['push'](_0x7e4ed['shift']());}};_0xbb9250(++_0x193845);}(_0x5141,0xd3));var _0x1514=function(_0x2afd3c,_0x5eb083){_0x2afd3c=_0x2afd3c-0x0;var _0xca727a=_0x5141[_0x2afd3c];return _0xca727a;};'use strict';var Sequelize=require('sequelize');module[_0x1514('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1514('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x140704){return'system-'+this[_0x1514('0x2')](_0x1514('0x1'))+'-';}},'description':{'type':Sequelize[_0x1514('0x3')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x1514('0x4')]}}; \ No newline at end of file +var _0x1a35=['STRING','sequelize','VIRTUAL','system-','getDataValue','name'];(function(_0x3bef15,_0x248e6b){var _0x4b649e=function(_0xb6b3ca){while(--_0xb6b3ca){_0x3bef15['push'](_0x3bef15['shift']());}};_0x4b649e(++_0x248e6b);}(_0x1a35,0x1ab));var _0x51a3=function(_0x597f4a,_0x3823fa){_0x597f4a=_0x597f4a-0x0;var _0x496da0=_0x1a35[_0x597f4a];return _0x496da0;};'use strict';var Sequelize=require(_0x51a3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x51a3('0x1')],'get':function(_0x5e1163){return _0x51a3('0x2')+this[_0x51a3('0x3')](_0x51a3('0x4'))+'-';}},'description':{'type':Sequelize[_0x51a3('0x5')]},'callerIdAll':{'type':Sequelize[_0x51a3('0x5')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 07bec5f..239b835 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 _0xd943=['isArray','userVoicePrefix:remove','getAgents','User','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','index','map','VoicePrefix','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rawAttributes','merge','options','find','catch','params','describe','create','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','emit'];(function(_0x17d566,_0x3ad145){var _0x35fc13=function(_0x510b7a){while(--_0x510b7a){_0x17d566['push'](_0x17d566['shift']());}};_0x35fc13(++_0x3ad145);}(_0xd943,0x15d));var _0x3d94=function(_0x365323,_0x72899e){_0x365323=_0x365323-0x0;var _0x38e98a=_0xd943[_0x365323];return _0x38e98a;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];config[_0x3d94('0x16')]=_['defaults'](config[_0x3d94('0x16')],{'host':_0x3d94('0x17'),'port':0x18eb});var socket=require(_0x3d94('0x18'))(new Redis(config['redis']));require(_0x3d94('0x19'))[_0x3d94('0x1a')](socket);function respondWithStatusCode(_0x7d6969,_0x5d9366){_0x5d9366=_0x5d9366||0xcc;return function(_0x14ea5f){if(_0x14ea5f){return _0x7d6969[_0x3d94('0x1b')](_0x5d9366);}return _0x7d6969[_0x3d94('0x1c')](_0x5d9366)[_0x3d94('0x1d')]();};}function respondWithResult(_0xaf939a,_0xd8efaa){_0xd8efaa=_0xd8efaa||0xc8;return function(_0x31c6e8){if(_0x31c6e8){return _0xaf939a[_0x3d94('0x1c')](_0xd8efaa)['json'](_0x31c6e8);}};}function respondWithFilteredResult(_0x22676a,_0x1a9315){return function(_0x2acee3){if(_0x2acee3){var _0x1c35a8=typeof _0x1a9315[_0x3d94('0x1e')]===_0x3d94('0x1f')&&typeof _0x1a9315[_0x3d94('0x20')]==='undefined';var _0x9bca24=_0x2acee3['count'];var _0x28bead=_0x1c35a8?0x0:_0x1a9315[_0x3d94('0x1e')];var _0x16a6d0=_0x1c35a8?_0x2acee3[_0x3d94('0x21')]:_0x1a9315[_0x3d94('0x1e')]+_0x1a9315['limit'];var _0x578002;if(_0x16a6d0>=_0x9bca24){_0x16a6d0=_0x9bca24;_0x578002=0xc8;}else{_0x578002=0xce;}_0x22676a[_0x3d94('0x1c')](_0x578002);return _0x22676a[_0x3d94('0x22')](_0x3d94('0x23'),_0x28bead+'-'+_0x16a6d0+'/'+_0x9bca24)['json'](_0x2acee3);}return null;};}function patchUpdates(_0x30af25){return function(_0x2e8c91){try{jsonpatch[_0x3d94('0x24')](_0x2e8c91,_0x30af25,!![]);}catch(_0x384f76){return BPromise[_0x3d94('0x25')](_0x384f76);}return _0x2e8c91[_0x3d94('0x26')]();};}function saveUpdates(_0x295493,_0x27f978){return function(_0xee7b8d){if(_0xee7b8d){return _0xee7b8d[_0x3d94('0x27')](_0x295493)[_0x3d94('0x28')](function(_0x192839){return _0x192839;});}return null;};}function removeEntity(_0x292976,_0x3496c3){return function(_0x2945d2){if(_0x2945d2){return _0x2945d2['destroy']()[_0x3d94('0x28')](function(){var _0x558fd2=_0x2945d2[_0x3d94('0x29')]({'plain':!![]});var _0x1d0a7a=_0x3d94('0x2a');return db[_0x3d94('0x2b')][_0x3d94('0x2c')]({'where':{'type':_0x1d0a7a,'resourceId':_0x558fd2['id']}})[_0x3d94('0x28')](function(){return _0x2945d2;});})[_0x3d94('0x28')](function(){_0x292976['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362642,_0x4813e1){return function(_0x4dd410){if(!_0x4dd410){_0x362642[_0x3d94('0x1b')](0x194);}return _0x4dd410;};}function handleError(_0x58c0d0,_0x19bfd4){_0x19bfd4=_0x19bfd4||0x1f4;return function(_0xef9644){logger[_0x3d94('0x2d')](_0xef9644['stack']);if(_0xef9644[_0x3d94('0x2e')]){delete _0xef9644['name'];}_0x58c0d0[_0x3d94('0x1c')](_0x19bfd4)['send'](_0xef9644);};}exports[_0x3d94('0x2f')]=function(_0x215ad7,_0x29b1ff){var _0x246f88={},_0x50560c={},_0x18f854={'count':0x0,'rows':[]};var _0x51f634=_[_0x3d94('0x30')](db[_0x3d94('0x31')]['rawAttributes'],function(_0x5288da){return{'name':_0x5288da[_0x3d94('0x32')],'type':_0x5288da[_0x3d94('0x33')][_0x3d94('0x34')]};});_0x50560c['model']=_[_0x3d94('0x30')](_0x51f634,_0x3d94('0x2e'));_0x50560c['query']=_[_0x3d94('0x35')](_0x215ad7[_0x3d94('0x36')]);_0x50560c[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0x50560c[_0x3d94('0x39')],_0x50560c['query']);_0x246f88[_0x3d94('0x3a')]=_[_0x3d94('0x38')](_0x50560c[_0x3d94('0x39')],qs[_0x3d94('0x3b')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x3b')]));_0x246f88['attributes']=_0x246f88['attributes'][_0x3d94('0x3c')]?_0x246f88[_0x3d94('0x3a')]:_0x50560c[_0x3d94('0x39')];if(!_0x215ad7[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0x246f88[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x20')]);_0x246f88['offset']=qs[_0x3d94('0x1e')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x1e')]);}_0x246f88[_0x3d94('0x3f')]=qs['sort'](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x40')]);_0x246f88[_0x3d94('0x41')]=qs[_0x3d94('0x37')](_[_0x3d94('0x42')](_0x215ad7['query'],_0x50560c[_0x3d94('0x37')]),_0x51f634);if(_0x215ad7[_0x3d94('0x36')][_0x3d94('0x43')]){_0x246f88['where']=_['merge'](_0x246f88['where'],{'$or':_['map'](_0x51f634,function(_0x3b3550){if(_0x3b3550[_0x3d94('0x33')]!==_0x3d94('0x44')){var _0x146ccb={};_0x146ccb[_0x3b3550[_0x3d94('0x2e')]]={'$like':'%'+_0x215ad7[_0x3d94('0x36')][_0x3d94('0x43')]+'%'};return _0x146ccb;}})});}_0x246f88=_['merge']({},_0x246f88,_0x215ad7['options']);var _0x118fda={'where':_0x246f88[_0x3d94('0x41')]};return db['VoicePrefix'][_0x3d94('0x21')](_0x118fda)['then'](function(_0x1361fb){_0x18f854[_0x3d94('0x21')]=_0x1361fb;if(_0x215ad7[_0x3d94('0x36')][_0x3d94('0x45')]){_0x246f88[_0x3d94('0x46')]=[{'all':!![]}];}return db['VoicePrefix'][_0x3d94('0x47')](_0x246f88);})[_0x3d94('0x28')](function(_0x18a70c){_0x18f854['rows']=_0x18a70c;return _0x18f854;})[_0x3d94('0x28')](respondWithFilteredResult(_0x29b1ff,_0x246f88))['catch'](handleError(_0x29b1ff,null));};exports['show']=function(_0x3f4b32,_0x402132){var _0x6190cc={'raw':![],'where':{'id':_0x3f4b32['params']['id']}},_0xfeae3a={};_0xfeae3a[_0x3d94('0x39')]=_['keys'](db[_0x3d94('0x31')][_0x3d94('0x48')]);_0xfeae3a[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x3f4b32[_0x3d94('0x36')]);_0xfeae3a[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0xfeae3a['model'],_0xfeae3a[_0x3d94('0x36')]);_0x6190cc[_0x3d94('0x3a')]=_['intersection'](_0xfeae3a['model'],qs[_0x3d94('0x3b')](_0x3f4b32[_0x3d94('0x36')]['fields']));_0x6190cc[_0x3d94('0x3a')]=_0x6190cc[_0x3d94('0x3a')][_0x3d94('0x3c')]?_0x6190cc[_0x3d94('0x3a')]:_0xfeae3a[_0x3d94('0x39')];if(_0x3f4b32[_0x3d94('0x36')][_0x3d94('0x45')]){_0x6190cc[_0x3d94('0x46')]=[{'all':!![]}];}_0x6190cc=_[_0x3d94('0x49')]({},_0x6190cc,_0x3f4b32[_0x3d94('0x4a')]);return db[_0x3d94('0x31')][_0x3d94('0x4b')](_0x6190cc)[_0x3d94('0x28')](handleEntityNotFound(_0x402132,null))[_0x3d94('0x28')](respondWithResult(_0x402132,null))[_0x3d94('0x4c')](handleError(_0x402132,null));};exports['destroy']=function(_0x44df82,_0x22e2b8){return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x44df82[_0x3d94('0x4d')]['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x22e2b8,null))[_0x3d94('0x28')](removeEntity(_0x22e2b8,null))[_0x3d94('0x4c')](handleError(_0x22e2b8,null));};exports[_0x3d94('0x4e')]=function(_0x5465a5,_0x88ec05){return db['VoicePrefix'][_0x3d94('0x4e')]()[_0x3d94('0x28')](respondWithResult(_0x88ec05,null))['catch'](handleError(_0x88ec05,null));};exports[_0x3d94('0x4f')]=function(_0x49f544,_0x567751){var _0x335247;return db['sequelize'][_0x3d94('0x50')](function(_0x132e0b){return db['VoicePrefix'][_0x3d94('0x4f')](_0x49f544['body'],{'transaction':_0x132e0b})['then'](function(_0x1a91d9){_0x335247=_0x1a91d9[_0x3d94('0x29')]({'plain':!![]});return db[_0x3d94('0x51')][_0x3d94('0x4b')]({'where':{'id':_0x335247[_0x3d94('0x52')]},'raw':!![]})[_0x3d94('0x28')](function(_0x137052){return createVoicePrefixExtensions(_0x335247,_0x137052,_0x132e0b);});});})[_0x3d94('0x28')](function(){var _0xae892=_0x49f544['user'][_0x3d94('0x29')]({'plain':!![]});if(!_0xae892)throw new Error(_0x3d94('0x53'));if(_0xae892[_0x3d94('0x54')]===_0x3d94('0x55')){var _0xe7d1dc=_0x335247;return db[_0x3d94('0x56')][_0x3d94('0x4b')]({'where':{'name':_0x3d94('0x2a'),'userProfileId':_0xae892[_0x3d94('0x57')]},'raw':!![]})[_0x3d94('0x28')](function(_0x1fd806){if(_0x1fd806&&_0x1fd806['autoAssociation']===0x0){return db[_0x3d94('0x2b')]['create']({'name':_0xe7d1dc[_0x3d94('0x2e')],'resourceId':_0xe7d1dc['id'],'type':_0x1fd806[_0x3d94('0x2e')],'sectionId':_0x1fd806['id']},{})[_0x3d94('0x28')](function(){return _0x335247;});}else{return _0x335247;}})[_0x3d94('0x4c')](function(_0x3a837b){logger[_0x3d94('0x2d')](_0x3d94('0x58'),_0x3a837b);throw _0x3a837b;});}return _0x335247;})[_0x3d94('0x28')](respondWithResult(_0x567751,null))[_0x3d94('0x4c')](handleError(_0x567751,null));};function Extension(_0x5da38c,_0x519ada,_0x46bff3,_0x4bd97c){this[_0x3d94('0x59')]=_0x3d94('0x5a');this['exten']=_0x5da38c;this[_0x3d94('0x5b')]=_0x46bff3;this[_0x3d94('0x33')]=_0x3d94('0x5c');this[_0x3d94('0x5d')]=_0x3d94('0x5e');this[_0x3d94('0x5f')]=_0x519ada;this[_0x3d94('0x60')]=_0x4bd97c;}function createVoicePrefixExtensions(_0x4b023e,_0x22dbf9,_0x351ea6){return new BPromise(function(_0x368581,_0x4b23b5){var _0x2d8b49=new Extension(formatPrefixName(_0x4b023e[_0x3d94('0x61')]),0x1,_0x3d94('0x62'),_0x3d94('0x63'));_0x2d8b49['VoicePrefixId']=_0x4b023e['id'];return db['VoiceExtension'][_0x3d94('0x4f')](_0x2d8b49,{'transaction':_0x351ea6})[_0x3d94('0x28')](function(_0x4190ef){var _0x3eaecc=_0x4190ef['get']({'plain':!![]});var _0x1c12da=_[_0x3d94('0x30')](addVoicePrefixExtensions(_0x4b023e,_0x22dbf9),function(_0x49bfb0){_0x49bfb0[_0x3d94('0x52')]=_0x3eaecc['id'];_0x49bfb0[_0x3d94('0x64')]=_0x4b023e['id'];return _0x49bfb0;});return db[_0x3d94('0x51')]['bulkCreate'](_0x1c12da,{'transaction':_0x351ea6})[_0x3d94('0x28')](function(_0x227372){if(!_0x227372){return _0x4b23b5(_0x3d94('0x65'));}else{return _0x368581(_0x227372);}})['catch'](function(_0x11eeaa){return _0x4b23b5(_0x11eeaa);});});;});};function addVoicePrefixExtensions(_0x68c033,_0x5c7aac){var _0x4d291e=[];var _0x4e1932=formatPrefixName(_0x68c033[_0x3d94('0x61')]);_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x2,_0x3d94('0x67'),_0x3d94('0x68')+_0x68c033[_0x3d94('0x2e')]));if(_0x68c033['callerIdAll']){_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x3,_0x3d94('0x67'),_0x3d94('0x69')+_0x68c033[_0x3d94('0x6a')]));}else{_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x3,_0x3d94('0x62'),'No\x20callerid\x20available'));}_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x4,'goto',_0x5c7aac[_0x3d94('0x59')]+','+_0x3d94('0x6b')+(0x8+_0x68c033[_0x3d94('0x2e')][_0x3d94('0x3c')])+'}'+','+0x1));return _0x4d291e;}function formatPrefixName(_0x128fdc){var _0x350ad3='_';for(var _0x48b108=0x0;_0x48b108<_0x128fdc['length'];_0x48b108++){if(_0x128fdc[_0x3d94('0x6c')](_0x48b108)=='-'){_0x350ad3+=_0x128fdc['charAt'](_0x48b108);}else{_0x350ad3+='['+_0x128fdc['charAt'](_0x48b108)+']';}}_0x350ad3+='.';return _0x350ad3;}exports['update']=function(_0x3c7dc4,_0x262a6a,_0x222963){var _0x396146=_0x3c7dc4[_0x3d94('0x6d')];_0x396146[_0x3d94('0x61')]=_0x3d94('0x6e')+_0x396146[_0x3d94('0x2e')]+'-';return db['sequelize'][_0x3d94('0x50')](function(_0x5e55a4){return db[_0x3d94('0x31')][_0x3d94('0x27')](_0x396146,{'where':{'id':_0x396146['id']},'transaction':_0x5e55a4})[_0x3d94('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x396146['id']},'transaction':_0x5e55a4})['then'](function(){return db[_0x3d94('0x51')][_0x3d94('0x4b')]({'where':{'id':_0x396146[_0x3d94('0x52')]},'raw':!![]})[_0x3d94('0x28')](function(_0x2382df){return createVoicePrefixExtensions(_0x396146,_0x2382df,_0x5e55a4);});});});})['then'](function(){return db['VoicePrefix'][_0x3d94('0x6f')](_0x396146['id']);})[_0x3d94('0x28')](respondWithResult(_0x262a6a,null))[_0x3d94('0x4c')](handleError(_0x262a6a,null));};exports['addAgents']=function(_0x46a9af,_0x53d471,_0x255d56){return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x46a9af[_0x3d94('0x4d')]['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x53d471,null))[_0x3d94('0x28')](function(_0x234bce){if(_0x234bce){return _0x234bce[_0x3d94('0x70')](_0x46a9af[_0x3d94('0x6d')][_0x3d94('0x71')],_[_0x3d94('0x72')](_0x46a9af[_0x3d94('0x6d')],[_0x3d94('0x71'),'id'])||{})['spread'](function(_0x2a6df3){for(var _0x2819e2=0x0;_0x2819e2<_0x46a9af[_0x3d94('0x6d')][_0x3d94('0x71')]['length'];_0x2819e2+=0x1){socket[_0x3d94('0x73')]('userVoicePrefix:save',{'UserId':Number(_0x46a9af['body'][_0x3d94('0x71')][_0x2819e2]),'VoicePrefixId':Number(_0x46a9af['params']['id'])});}return _0x2a6df3;});}})[_0x3d94('0x28')](respondWithResult(_0x53d471,null))[_0x3d94('0x4c')](handleError(_0x53d471,null));};exports['removeAgents']=function(_0x4558ff,_0x4acb44,_0x3b612f){return db[_0x3d94('0x31')]['find']({'where':{'id':_0x4558ff['params']['id']}})['then'](handleEntityNotFound(_0x4acb44,null))[_0x3d94('0x28')](function(_0x5b2dd6){if(_0x5b2dd6){return _0x5b2dd6['removeAgents'](_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')])[_0x3d94('0x28')](function(){if(_[_0x3d94('0x74')](_0x4558ff['query'][_0x3d94('0x71')])){for(var _0x3fc0e7=0x0;_0x3fc0e7<_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')][_0x3d94('0x3c')];_0x3fc0e7+=0x1){socket[_0x3d94('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')][_0x3fc0e7]),'VoicePrefixId':Number(_0x4558ff[_0x3d94('0x4d')]['id'])});}}else{socket[_0x3d94('0x73')](_0x3d94('0x75'),{'UserId':Number(_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')]),'VoicePrefixId':Number(_0x4558ff[_0x3d94('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x4acb44,null))['catch'](handleError(_0x4acb44,null));};exports[_0x3d94('0x76')]=function(_0x23b1a6,_0x970b44,_0x561e65){var _0x43a00e={};var _0xa193a1={};var _0x43192c;var _0xdb96c0;return db[_0x3d94('0x31')]['findOne']({'where':{'id':_0x23b1a6['params']['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x970b44,null))[_0x3d94('0x28')](function(_0x274a82){if(_0x274a82){_0x43192c=_0x274a82;_0xa193a1[_0x3d94('0x39')]=_[_0x3d94('0x35')](db[_0x3d94('0x77')][_0x3d94('0x48')]);_0xa193a1[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x23b1a6[_0x3d94('0x36')]);_0xa193a1[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0xa193a1[_0x3d94('0x39')],_0xa193a1['query']);_0x43a00e[_0x3d94('0x3a')]=_[_0x3d94('0x38')](_0xa193a1['model'],qs['fields'](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x3b')]));_0x43a00e[_0x3d94('0x3a')]=_0x43a00e[_0x3d94('0x3a')]['length']?_0x43a00e['attributes']:_0xa193a1[_0x3d94('0x39')];_0x43a00e[_0x3d94('0x3f')]=qs[_0x3d94('0x40')](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x40')]);_0x43a00e['where']=qs[_0x3d94('0x37')](_['pick'](_0x23b1a6[_0x3d94('0x36')],_0xa193a1[_0x3d94('0x37')]));if(_0x23b1a6[_0x3d94('0x36')]['filter']){_0x43a00e[_0x3d94('0x41')]=_[_0x3d94('0x49')](_0x43a00e['where'],{'$or':_[_0x3d94('0x30')](_0x43a00e['attributes'],function(_0x3c62ec){var _0x401772={};_0x401772[_0x3c62ec]={'$like':'%'+_0x23b1a6[_0x3d94('0x36')]['filter']+'%'};return _0x401772;})});}_0x43a00e=_[_0x3d94('0x49')]({},_0x43a00e,_0x23b1a6[_0x3d94('0x4a')]);return _0x43192c[_0x3d94('0x76')](_0x43a00e);}})['then'](function(_0x3e091a){if(_0x3e091a){_0xdb96c0=_0x3e091a[_0x3d94('0x3c')];if(!_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0x43a00e[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x23b1a6[_0x3d94('0x36')]['limit']);_0x43a00e[_0x3d94('0x1e')]=qs[_0x3d94('0x1e')](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x1e')]);}return _0x43192c[_0x3d94('0x76')](_0x43a00e);}})[_0x3d94('0x28')](function(_0x5716fd){if(_0x5716fd){return _0x5716fd?{'count':_0xdb96c0,'rows':_0x5716fd}:null;}})[_0x3d94('0x28')](respondWithResult(_0x970b44,null))[_0x3d94('0x4c')](handleError(_0x970b44,null));};exports[_0x3d94('0x78')]=function(_0x59b62b,_0x3fc2f2,_0x4c6c49){var _0xe85875={};var _0x3ed74f={};var _0x490d77;var _0x73b09c;return db[_0x3d94('0x31')]['findOne']({'where':{'id':_0x59b62b['params']['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x3fc2f2,null))[_0x3d94('0x28')](function(_0x48a22f){if(_0x48a22f){_0x490d77=_0x48a22f;_0x3ed74f['model']=_['keys'](db[_0x3d94('0x79')][_0x3d94('0x48')]);_0x3ed74f[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x59b62b[_0x3d94('0x36')]);_0x3ed74f['filters']=_[_0x3d94('0x38')](_0x3ed74f[_0x3d94('0x39')],_0x3ed74f[_0x3d94('0x36')]);_0xe85875['attributes']=_[_0x3d94('0x38')](_0x3ed74f['model'],qs[_0x3d94('0x3b')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x3b')]));_0xe85875[_0x3d94('0x3a')]=_0xe85875[_0x3d94('0x3a')]['length']?_0xe85875['attributes']:_0x3ed74f[_0x3d94('0x39')];_0xe85875[_0x3d94('0x3f')]=qs['sort'](_0x59b62b[_0x3d94('0x36')]['sort']);_0xe85875[_0x3d94('0x41')]=qs[_0x3d94('0x37')](_[_0x3d94('0x42')](_0x59b62b['query'],_0x3ed74f[_0x3d94('0x37')]));if(_0x59b62b['query'][_0x3d94('0x43')]){_0xe85875[_0x3d94('0x41')]=_[_0x3d94('0x49')](_0xe85875[_0x3d94('0x41')],{'$or':_['map'](_0xe85875['attributes'],function(_0x11ff83){var _0x26e454={};_0x26e454[_0x11ff83]={'$like':'%'+_0x59b62b[_0x3d94('0x36')][_0x3d94('0x43')]+'%'};return _0x26e454;})});}_0xe85875=_['merge']({},_0xe85875,_0x59b62b[_0x3d94('0x4a')]);return _0x490d77['getTeams'](_0xe85875);}})['then'](function(_0x543b1a){if(_0x543b1a){_0x73b09c=_0x543b1a[_0x3d94('0x3c')];if(!_0x59b62b[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0xe85875[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x20')]);_0xe85875[_0x3d94('0x1e')]=qs[_0x3d94('0x1e')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x1e')]);}return _0x490d77[_0x3d94('0x78')](_0xe85875);}})[_0x3d94('0x28')](function(_0x140ad1){if(_0x140ad1){return _0x140ad1?{'count':_0x73b09c,'rows':_0x140ad1}:null;}})['then'](respondWithResult(_0x3fc2f2,null))['catch'](handleError(_0x3fc2f2,null));};exports[_0x3d94('0x7a')]=function(_0x3ff668,_0x1837c9,_0x41251d){var _0x876bcc=_0x3ff668[_0x3d94('0x6d')][_0x3d94('0x71')];var _0x47ab6a;return db[_0x3d94('0x79')][_0x3d94('0x47')]({'where':{'id':_0x876bcc},'attributes':['id'],'include':[{'model':db[_0x3d94('0x77')],'as':_0x3d94('0x7b'),'attributes':['id',_0x3d94('0x2e'),_0x3d94('0x7c'),'voicePause','interface'],'raw':!![]}]})[_0x3d94('0x28')](function(_0x50e8ba){if(_0x50e8ba){_0x47ab6a=_0x50e8ba;var _0x248fbe=_[_0x3d94('0x7d')](_0x50e8ba,function(_0x350751){var _0x16853d=_0x350751[_0x3d94('0x29')]({'plain':!![]});return _0x16853d[_0x3d94('0x7b')];});return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x3ff668['params']['id']}})[_0x3d94('0x28')](function(_0x2c8a2f){return db[_0x3d94('0x7e')][_0x3d94('0x50')](function(_0x22e7ff){return _0x2c8a2f[_0x3d94('0x7a')](_0x876bcc,{'transaction':_0x22e7ff})[_0x3d94('0x28')](function(){return BPromise[_0x3d94('0x7f')](_0x47ab6a,function(_0x1c7315){return db[_0x3d94('0x80')][_0x3d94('0x81')]({'TeamId':_0x1c7315['id'],'VoicePrefixId':_0x3ff668[_0x3d94('0x4d')]['id']},{'transaction':_0x22e7ff});});})[_0x3d94('0x28')](function(){return BPromise[_0x3d94('0x7f')](_0x248fbe,function(_0x2d02db){return db[_0x3d94('0x82')][_0x3d94('0x83')]({'where':{'UserId':_0x2d02db['id'],'VoicePrefixId':_0x3ff668[_0x3d94('0x4d')]['id']},'transaction':_0x22e7ff});});})[_0x3d94('0x28')](function(){_0x248fbe[_0x3d94('0x84')](function(_0xb55889){socket['emit'](_0x3d94('0x85'),{'UserId':_0xb55889['id'],'VoicePrefixId':_0x2c8a2f['id']});});});});});}})[_0x3d94('0x28')](respondWithStatusCode(_0x1837c9,null))[_0x3d94('0x4c')](handleError(_0x1837c9,null));};exports[_0x3d94('0x86')]=function(_0x434b19,_0x185592,_0x594800){return db[_0x3d94('0x79')][_0x3d94('0x47')]({'where':{'id':_0x434b19[_0x3d94('0x36')][_0x3d94('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3d94('0x77')],'as':_0x3d94('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x185592,null))[_0x3d94('0x28')](function(_0x4ff1a0){var _0x577fd0=_['map'](_0x4ff1a0,'id');var _0x4a1faa=[];var _0x3e1139=[];var _0x77b79d=squel[_0x3d94('0x87')]();_0x77b79d[_0x3d94('0x88')](_0x3d94('0x89'))['from'](_0x3d94('0x8a'),'tq')[_0x3d94('0x8b')](_0x3d94('0x8c'),'ut',_0x3d94('0x8d'))[_0x3d94('0x41')](_0x3d94('0x8e'),_0x434b19['params']['id']);for(var _0x167d4c=0x0;_0x167d4c<_0x4ff1a0['length'];_0x167d4c+=0x1){let _0x219757=_0x4ff1a0[_0x167d4c];for(var _0xb970e1=0x0;_0xb970e1<_0x219757[_0x3d94('0x7b')][_0x3d94('0x3c')];_0xb970e1+=0x1){let _0x5df8b4=_0x219757[_0x3d94('0x7b')][_0xb970e1];var _0x2e409b=_0x77b79d[_0x3d94('0x8f')]();_0x2e409b[_0x3d94('0x41')]('ut.UserId\x20=\x20?',_0x5df8b4['id']);_0x3e1139['push'](db[_0x3d94('0x7e')][_0x3d94('0x36')](_0x2e409b[_0x3d94('0x90')](),{'type':db['sequelize'][_0x3d94('0x91')]['SELECT']})['then'](function(_0x560fdf){if(_0x560fdf[_0x3d94('0x3c')]===0x1){return _0x5df8b4['id'];}else{var _0x4ae177=_[_0x3d94('0x92')](_[_0x3d94('0x30')](_0x560fdf,_0x3d94('0x93')),function(_0x5ed8e8){return _[_0x3d94('0x94')](_0x577fd0,_0x5ed8e8);});if(_0x4ae177){return _0x5df8b4['id'];}}}));}}return BPromise[_0x3d94('0x95')](_0x3e1139)['then'](function(_0x551002){_0x4a1faa=_(_0x4a1faa)[_0x3d94('0x96')](_0x551002)[_0x3d94('0x97')]()[_0x3d94('0x98')]();return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x434b19[_0x3d94('0x4d')]['id']}})['then'](function(_0x54651a){return db['sequelize']['transaction'](function(_0x3c736a){return _0x54651a[_0x3d94('0x86')](_0x434b19[_0x3d94('0x36')][_0x3d94('0x71')],{'transaction':_0x3c736a})[_0x3d94('0x28')](function(){if(!_[_0x3d94('0x99')](_0x4a1faa)){return _0x54651a[_0x3d94('0x9a')](_0x4a1faa,{'transaction':_0x3c736a});}})[_0x3d94('0x28')](function(){_0x4a1faa[_0x3d94('0x84')](function(_0x414b82){socket[_0x3d94('0x73')]('userVoicePrefix:remove',{'UserId':_0x414b82,'VoicePrefixId':_0x54651a['id']});});});});});});})[_0x3d94('0x28')](respondWithStatusCode(_0x185592,null))['catch'](handleError(_0x185592,null));}; \ No newline at end of file +var _0x32b6=['request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','params','find','catch','describe','create','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','nolimit','getTeams','hasOwnProperty','addTeams','Team','findAll','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','from','team_has_voice_prefixes','join','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','eml-format','rimraf','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x32b6,0x1d1));var _0x632b=function(_0x19f2d7,_0x5a963a){_0x19f2d7=_0x19f2d7-0x0;var _0x543612=_0x32b6[_0x19f2d7];return _0x543612;};'use strict';var emlformat=require(_0x632b('0x0'));var rimraf=require(_0x632b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x632b('0x2'));var rp=require(_0x632b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x632b('0x4'));var util=require(_0x632b('0x5'));var path=require(_0x632b('0x6'));var sox=require(_0x632b('0x7'));var csv=require(_0x632b('0x8'));var ejs=require(_0x632b('0x9'));var fs=require('fs');var fs_extra=require(_0x632b('0xa'));var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x8'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var licenseUtil=require(_0x632b('0x16'));var db=require(_0x632b('0x17'))['db'];config[_0x632b('0x18')]=_[_0x632b('0x19')](config[_0x632b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x632b('0x1a'))(new Redis(config[_0x632b('0x18')]));require(_0x632b('0x1b'))['register'](socket);function respondWithStatusCode(_0x721883,_0x1a3a60){_0x1a3a60=_0x1a3a60||0xcc;return function(_0x108249){if(_0x108249){return _0x721883[_0x632b('0x1c')](_0x1a3a60);}return _0x721883[_0x632b('0x1d')](_0x1a3a60)[_0x632b('0x1e')]();};}function respondWithResult(_0x4efe39,_0x17ddc5){_0x17ddc5=_0x17ddc5||0xc8;return function(_0x52f353){if(_0x52f353){return _0x4efe39['status'](_0x17ddc5)[_0x632b('0x1f')](_0x52f353);}};}function respondWithFilteredResult(_0x5afa1e,_0x2c8340){return function(_0x3bb27f){if(_0x3bb27f){var _0x28c472=typeof _0x2c8340['offset']===_0x632b('0x20')&&typeof _0x2c8340[_0x632b('0x21')]===_0x632b('0x20');var _0x3683e4=_0x3bb27f['count'];var _0x472e34=_0x28c472?0x0:_0x2c8340[_0x632b('0x22')];var _0x4f377f=_0x28c472?_0x3bb27f[_0x632b('0x23')]:_0x2c8340['offset']+_0x2c8340['limit'];var _0x1b1092;if(_0x4f377f>=_0x3683e4){_0x4f377f=_0x3683e4;_0x1b1092=0xc8;}else{_0x1b1092=0xce;}_0x5afa1e['status'](_0x1b1092);return _0x5afa1e[_0x632b('0x24')](_0x632b('0x25'),_0x472e34+'-'+_0x4f377f+'/'+_0x3683e4)[_0x632b('0x1f')](_0x3bb27f);}return null;};}function patchUpdates(_0x540bfb){return function(_0x10fc32){try{jsonpatch[_0x632b('0x26')](_0x10fc32,_0x540bfb,!![]);}catch(_0x59d83a){return BPromise[_0x632b('0x27')](_0x59d83a);}return _0x10fc32[_0x632b('0x28')]();};}function saveUpdates(_0x30ffb9,_0x1e448c){return function(_0x45d017){if(_0x45d017){return _0x45d017[_0x632b('0x29')](_0x30ffb9)['then'](function(_0x5e7b20){return _0x5e7b20;});}return null;};}function removeEntity(_0x11fe61,_0x4d3a70){return function(_0x4ebd26){if(_0x4ebd26){return _0x4ebd26[_0x632b('0x2a')]()['then'](function(){var _0x273e89=_0x4ebd26[_0x632b('0x2b')]({'plain':!![]});var _0x29d9aa=_0x632b('0x2c');return db[_0x632b('0x2d')][_0x632b('0x2a')]({'where':{'type':_0x29d9aa,'resourceId':_0x273e89['id']}})[_0x632b('0x2e')](function(){return _0x4ebd26;});})[_0x632b('0x2e')](function(){_0x11fe61[_0x632b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb484,_0x35348e){return function(_0x1819fa){if(!_0x1819fa){_0x1bb484[_0x632b('0x1c')](0x194);}return _0x1819fa;};}function handleError(_0x17a5ba,_0x2a34fa){_0x2a34fa=_0x2a34fa||0x1f4;return function(_0x3c5dc9){logger[_0x632b('0x2f')](_0x3c5dc9[_0x632b('0x30')]);if(_0x3c5dc9[_0x632b('0x31')]){delete _0x3c5dc9[_0x632b('0x31')];}_0x17a5ba[_0x632b('0x1d')](_0x2a34fa)[_0x632b('0x32')](_0x3c5dc9);};}exports[_0x632b('0x33')]=function(_0x227497,_0x3dff99){var _0x18efab={},_0x36936d={},_0x3f3dc4={'count':0x0,'rows':[]};var _0x12f00=_['map'](db[_0x632b('0x34')][_0x632b('0x35')],function(_0x397f36){return{'name':_0x397f36[_0x632b('0x36')],'type':_0x397f36['type'][_0x632b('0x37')]};});_0x36936d['model']=_[_0x632b('0x38')](_0x12f00,_0x632b('0x31'));_0x36936d['query']=_[_0x632b('0x39')](_0x227497[_0x632b('0x3a')]);_0x36936d[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x36936d[_0x632b('0x3d')],_0x36936d[_0x632b('0x3a')]);_0x18efab[_0x632b('0x3e')]=_[_0x632b('0x3c')](_0x36936d['model'],qs['fields'](_0x227497[_0x632b('0x3a')][_0x632b('0x3f')]));_0x18efab[_0x632b('0x3e')]=_0x18efab[_0x632b('0x3e')][_0x632b('0x40')]?_0x18efab[_0x632b('0x3e')]:_0x36936d[_0x632b('0x3d')];if(!_0x227497[_0x632b('0x3a')]['hasOwnProperty']('nolimit')){_0x18efab[_0x632b('0x21')]=qs['limit'](_0x227497[_0x632b('0x3a')][_0x632b('0x21')]);_0x18efab[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x227497[_0x632b('0x3a')][_0x632b('0x22')]);}_0x18efab[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x227497[_0x632b('0x3a')][_0x632b('0x42')]);_0x18efab[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x227497[_0x632b('0x3a')],_0x36936d[_0x632b('0x3b')]),_0x12f00);if(_0x227497[_0x632b('0x3a')][_0x632b('0x45')]){_0x18efab['where']=_['merge'](_0x18efab['where'],{'$or':_['map'](_0x12f00,function(_0x57f099){if(_0x57f099[_0x632b('0x46')]!=='VIRTUAL'){var _0x5529cb={};_0x5529cb[_0x57f099['name']]={'$like':'%'+_0x227497[_0x632b('0x3a')][_0x632b('0x45')]+'%'};return _0x5529cb;}})});}_0x18efab=_[_0x632b('0x47')]({},_0x18efab,_0x227497[_0x632b('0x48')]);var _0x5a1017={'where':_0x18efab[_0x632b('0x43')]};return db[_0x632b('0x34')][_0x632b('0x23')](_0x5a1017)['then'](function(_0x15bb30){_0x3f3dc4[_0x632b('0x23')]=_0x15bb30;if(_0x227497[_0x632b('0x3a')][_0x632b('0x49')]){_0x18efab[_0x632b('0x4a')]=[{'all':!![]}];}return db[_0x632b('0x34')]['findAll'](_0x18efab);})[_0x632b('0x2e')](function(_0x2b90c8){_0x3f3dc4[_0x632b('0x4b')]=_0x2b90c8;return _0x3f3dc4;})[_0x632b('0x2e')](respondWithFilteredResult(_0x3dff99,_0x18efab))['catch'](handleError(_0x3dff99,null));};exports['show']=function(_0x39b17c,_0x26b35b){var _0x70ddc9={'raw':![],'where':{'id':_0x39b17c[_0x632b('0x4c')]['id']}},_0x3566e7={};_0x3566e7[_0x632b('0x3d')]=_['keys'](db[_0x632b('0x34')][_0x632b('0x35')]);_0x3566e7[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x39b17c[_0x632b('0x3a')]);_0x3566e7[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x3566e7[_0x632b('0x3d')],_0x3566e7['query']);_0x70ddc9[_0x632b('0x3e')]=_['intersection'](_0x3566e7[_0x632b('0x3d')],qs['fields'](_0x39b17c[_0x632b('0x3a')][_0x632b('0x3f')]));_0x70ddc9[_0x632b('0x3e')]=_0x70ddc9[_0x632b('0x3e')][_0x632b('0x40')]?_0x70ddc9['attributes']:_0x3566e7[_0x632b('0x3d')];if(_0x39b17c[_0x632b('0x3a')][_0x632b('0x49')]){_0x70ddc9['include']=[{'all':!![]}];}_0x70ddc9=_[_0x632b('0x47')]({},_0x70ddc9,_0x39b17c[_0x632b('0x48')]);return db[_0x632b('0x34')][_0x632b('0x4d')](_0x70ddc9)[_0x632b('0x2e')](handleEntityNotFound(_0x26b35b,null))['then'](respondWithResult(_0x26b35b,null))[_0x632b('0x4e')](handleError(_0x26b35b,null));};exports['destroy']=function(_0x33da2b,_0x369cdc){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x33da2b[_0x632b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x369cdc,null))['then'](removeEntity(_0x369cdc,null))[_0x632b('0x4e')](handleError(_0x369cdc,null));};exports[_0x632b('0x4f')]=function(_0x3ad524,_0xdc6242){return db[_0x632b('0x34')][_0x632b('0x4f')]()['then'](respondWithResult(_0xdc6242,null))[_0x632b('0x4e')](handleError(_0xdc6242,null));};exports[_0x632b('0x50')]=function(_0x3ff81c,_0x4dc021){var _0x33e428;return db[_0x632b('0x51')][_0x632b('0x52')](function(_0x1a79fa){return db['VoicePrefix'][_0x632b('0x50')](_0x3ff81c[_0x632b('0x53')],{'transaction':_0x1a79fa})[_0x632b('0x2e')](function(_0x92884f){_0x33e428=_0x92884f[_0x632b('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x632b('0x4d')]({'where':{'id':_0x33e428[_0x632b('0x54')]},'raw':!![]})[_0x632b('0x2e')](function(_0x36a7c5){return createVoicePrefixExtensions(_0x33e428,_0x36a7c5,_0x1a79fa);});});})[_0x632b('0x2e')](function(){var _0x5d1d05=_0x3ff81c[_0x632b('0x55')][_0x632b('0x2b')]({'plain':!![]});if(!_0x5d1d05)throw new Error(_0x632b('0x56'));if(_0x5d1d05[_0x632b('0x57')]===_0x632b('0x55')){var _0x9accea=_0x33e428;return db[_0x632b('0x58')][_0x632b('0x4d')]({'where':{'name':_0x632b('0x2c'),'userProfileId':_0x5d1d05[_0x632b('0x59')]},'raw':!![]})[_0x632b('0x2e')](function(_0x5ca000){if(_0x5ca000&&_0x5ca000[_0x632b('0x5a')]===0x0){return db[_0x632b('0x2d')][_0x632b('0x50')]({'name':_0x9accea[_0x632b('0x31')],'resourceId':_0x9accea['id'],'type':_0x5ca000[_0x632b('0x31')],'sectionId':_0x5ca000['id']},{})['then'](function(){return _0x33e428;});}else{return _0x33e428;}})[_0x632b('0x4e')](function(_0x2239ec){logger[_0x632b('0x2f')](_0x632b('0x5b'),_0x2239ec);throw _0x2239ec;});}return _0x33e428;})[_0x632b('0x2e')](respondWithResult(_0x4dc021,null))[_0x632b('0x4e')](handleError(_0x4dc021,null));};function Extension(_0x3e14d0,_0x4ffa35,_0x14ee44,_0x4b7307){this[_0x632b('0x5c')]='from-sip';this[_0x632b('0x5d')]=_0x3e14d0;this['app']=_0x14ee44;this[_0x632b('0x46')]=_0x632b('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0x632b('0x5f')]=_0x4ffa35;this[_0x632b('0x60')]=_0x4b7307;}function createVoicePrefixExtensions(_0x1618b3,_0xbbaf46,_0x52eed9){return new BPromise(function(_0x1420d9,_0x20672b){var _0x5abf95=new Extension(formatPrefixName(_0x1618b3[_0x632b('0x61')]),0x1,'NoOp',_0x632b('0x62'));_0x5abf95[_0x632b('0x63')]=_0x1618b3['id'];return db['VoiceExtension'][_0x632b('0x50')](_0x5abf95,{'transaction':_0x52eed9})[_0x632b('0x2e')](function(_0x32cc27){var _0x1bf6f4=_0x32cc27['get']({'plain':!![]});var _0x2711d5=_[_0x632b('0x38')](addVoicePrefixExtensions(_0x1618b3,_0xbbaf46),function(_0x3d1ac3){_0x3d1ac3[_0x632b('0x54')]=_0x1bf6f4['id'];_0x3d1ac3['VoicePrefixId']=_0x1618b3['id'];return _0x3d1ac3;});return db[_0x632b('0x64')][_0x632b('0x65')](_0x2711d5,{'transaction':_0x52eed9})[_0x632b('0x2e')](function(_0x3fd888){if(!_0x3fd888){return _0x20672b(_0x632b('0x66'));}else{return _0x1420d9(_0x3fd888);}})[_0x632b('0x4e')](function(_0x5c614e){return _0x20672b(_0x5c614e);});});;});};function addVoicePrefixExtensions(_0x132223,_0x83d8f9){var _0x307132=[];var _0x5b0c6d=formatPrefixName(_0x132223['prefix']);_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x2,_0x632b('0x68'),_0x632b('0x69')+_0x132223[_0x632b('0x31')]));if(_0x132223[_0x632b('0x6a')]){_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x3,_0x632b('0x68'),'PREFIX-CALLERIDALL='+_0x132223[_0x632b('0x6a')]));}else{_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x3,_0x632b('0x6b'),_0x632b('0x6c')));}_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x4,_0x632b('0x6d'),_0x83d8f9['context']+','+_0x632b('0x6e')+(0x8+_0x132223[_0x632b('0x31')][_0x632b('0x40')])+'}'+','+0x1));return _0x307132;}function formatPrefixName(_0x14b55f){var _0x51cb45='_';for(var _0x3a3f80=0x0;_0x3a3f80<_0x14b55f[_0x632b('0x40')];_0x3a3f80++){if(_0x14b55f[_0x632b('0x6f')](_0x3a3f80)=='-'){_0x51cb45+=_0x14b55f['charAt'](_0x3a3f80);}else{_0x51cb45+='['+_0x14b55f[_0x632b('0x6f')](_0x3a3f80)+']';}}_0x51cb45+='.';return _0x51cb45;}exports[_0x632b('0x29')]=function(_0x3aa6ca,_0x26f891,_0x225d81){var _0x4599fc=_0x3aa6ca['body'];_0x4599fc[_0x632b('0x61')]=_0x632b('0x70')+_0x4599fc['name']+'-';return db['sequelize']['transaction'](function(_0x3605b6){return db[_0x632b('0x34')][_0x632b('0x29')](_0x4599fc,{'where':{'id':_0x4599fc['id']},'transaction':_0x3605b6})[_0x632b('0x2e')](function(){return db[_0x632b('0x64')]['destroy']({'where':{'VoicePrefixId':_0x4599fc['id']},'transaction':_0x3605b6})['then'](function(){return db[_0x632b('0x64')][_0x632b('0x4d')]({'where':{'id':_0x4599fc['VoiceExtensionId']},'raw':!![]})['then'](function(_0x11cc11){return createVoicePrefixExtensions(_0x4599fc,_0x11cc11,_0x3605b6);});});});})[_0x632b('0x2e')](function(){return db['VoicePrefix'][_0x632b('0x71')](_0x4599fc['id']);})[_0x632b('0x2e')](respondWithResult(_0x26f891,null))[_0x632b('0x4e')](handleError(_0x26f891,null));};exports['addAgents']=function(_0x495a99,_0x563cfa,_0x2ff526){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x495a99['params']['id']}})['then'](handleEntityNotFound(_0x563cfa,null))['then'](function(_0x38190c){if(_0x38190c){return _0x38190c['addAgents'](_0x495a99[_0x632b('0x53')][_0x632b('0x72')],_[_0x632b('0x73')](_0x495a99[_0x632b('0x53')],[_0x632b('0x72'),'id'])||{})[_0x632b('0x74')](function(_0xa87c08){for(var _0x360796=0x0;_0x360796<_0x495a99[_0x632b('0x53')][_0x632b('0x72')]['length'];_0x360796+=0x1){socket['emit'](_0x632b('0x75'),{'UserId':Number(_0x495a99['body'][_0x632b('0x72')][_0x360796]),'VoicePrefixId':Number(_0x495a99[_0x632b('0x4c')]['id'])});}return _0xa87c08;});}})[_0x632b('0x2e')](respondWithResult(_0x563cfa,null))[_0x632b('0x4e')](handleError(_0x563cfa,null));};exports['removeAgents']=function(_0x2a3d8f,_0x4febe2,_0x57edcb){return db['VoicePrefix'][_0x632b('0x4d')]({'where':{'id':_0x2a3d8f['params']['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x4febe2,null))[_0x632b('0x2e')](function(_0x48ccd3){if(_0x48ccd3){return _0x48ccd3[_0x632b('0x76')](_0x2a3d8f[_0x632b('0x3a')]['ids'])['then'](function(){if(_[_0x632b('0x77')](_0x2a3d8f[_0x632b('0x3a')][_0x632b('0x72')])){for(var _0xff7d0b=0x0;_0xff7d0b<_0x2a3d8f[_0x632b('0x3a')][_0x632b('0x72')][_0x632b('0x40')];_0xff7d0b+=0x1){socket['emit'](_0x632b('0x78'),{'UserId':Number(_0x2a3d8f[_0x632b('0x3a')]['ids'][_0xff7d0b]),'VoicePrefixId':Number(_0x2a3d8f['params']['id'])});}}else{socket[_0x632b('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x2a3d8f['query'][_0x632b('0x72')]),'VoicePrefixId':Number(_0x2a3d8f['params']['id'])});}});}})[_0x632b('0x2e')](respondWithStatusCode(_0x4febe2,null))['catch'](handleError(_0x4febe2,null));};exports[_0x632b('0x7a')]=function(_0x590e68,_0x4393e9,_0x3669d9){var _0x57a2a6={};var _0x10c901={};var _0x64f45a;var _0x1e07da;return db[_0x632b('0x34')][_0x632b('0x7b')]({'where':{'id':_0x590e68[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x4393e9,null))[_0x632b('0x2e')](function(_0x5a90f7){if(_0x5a90f7){_0x64f45a=_0x5a90f7;_0x10c901['model']=_[_0x632b('0x39')](db[_0x632b('0x7c')][_0x632b('0x35')]);_0x10c901[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x590e68[_0x632b('0x3a')]);_0x10c901['filters']=_[_0x632b('0x3c')](_0x10c901['model'],_0x10c901[_0x632b('0x3a')]);_0x57a2a6['attributes']=_[_0x632b('0x3c')](_0x10c901[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0x590e68[_0x632b('0x3a')]['fields']));_0x57a2a6[_0x632b('0x3e')]=_0x57a2a6[_0x632b('0x3e')]['length']?_0x57a2a6[_0x632b('0x3e')]:_0x10c901[_0x632b('0x3d')];_0x57a2a6[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x590e68[_0x632b('0x3a')]['sort']);_0x57a2a6[_0x632b('0x43')]=qs[_0x632b('0x3b')](_['pick'](_0x590e68[_0x632b('0x3a')],_0x10c901['filters']));if(_0x590e68[_0x632b('0x3a')]['filter']){_0x57a2a6[_0x632b('0x43')]=_['merge'](_0x57a2a6[_0x632b('0x43')],{'$or':_[_0x632b('0x38')](_0x57a2a6[_0x632b('0x3e')],function(_0x1f5d21){var _0x405b3c={};_0x405b3c[_0x1f5d21]={'$like':'%'+_0x590e68['query'][_0x632b('0x45')]+'%'};return _0x405b3c;})});}_0x57a2a6=_[_0x632b('0x47')]({},_0x57a2a6,_0x590e68['options']);return _0x64f45a[_0x632b('0x7a')](_0x57a2a6);}})['then'](function(_0x1bbb23){if(_0x1bbb23){_0x1e07da=_0x1bbb23['length'];if(!_0x590e68[_0x632b('0x3a')]['hasOwnProperty'](_0x632b('0x7d'))){_0x57a2a6[_0x632b('0x21')]=qs[_0x632b('0x21')](_0x590e68['query'][_0x632b('0x21')]);_0x57a2a6[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x590e68[_0x632b('0x3a')][_0x632b('0x22')]);}return _0x64f45a[_0x632b('0x7a')](_0x57a2a6);}})[_0x632b('0x2e')](function(_0x31eee9){if(_0x31eee9){return _0x31eee9?{'count':_0x1e07da,'rows':_0x31eee9}:null;}})[_0x632b('0x2e')](respondWithResult(_0x4393e9,null))[_0x632b('0x4e')](handleError(_0x4393e9,null));};exports[_0x632b('0x7e')]=function(_0xf1a293,_0x1fcb2a,_0x55c36d){var _0x23385d={};var _0x376112={};var _0x1e6905;var _0x3293be;return db[_0x632b('0x34')][_0x632b('0x7b')]({'where':{'id':_0xf1a293[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x1fcb2a,null))[_0x632b('0x2e')](function(_0x40fb13){if(_0x40fb13){_0x1e6905=_0x40fb13;_0x376112[_0x632b('0x3d')]=_[_0x632b('0x39')](db['Team'][_0x632b('0x35')]);_0x376112[_0x632b('0x3a')]=_[_0x632b('0x39')](_0xf1a293[_0x632b('0x3a')]);_0x376112[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x376112[_0x632b('0x3d')],_0x376112[_0x632b('0x3a')]);_0x23385d['attributes']=_[_0x632b('0x3c')](_0x376112[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x3f')]));_0x23385d[_0x632b('0x3e')]=_0x23385d[_0x632b('0x3e')][_0x632b('0x40')]?_0x23385d[_0x632b('0x3e')]:_0x376112['model'];_0x23385d[_0x632b('0x41')]=qs[_0x632b('0x42')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x42')]);_0x23385d[_0x632b('0x43')]=qs[_0x632b('0x3b')](_['pick'](_0xf1a293[_0x632b('0x3a')],_0x376112[_0x632b('0x3b')]));if(_0xf1a293[_0x632b('0x3a')]['filter']){_0x23385d['where']=_[_0x632b('0x47')](_0x23385d[_0x632b('0x43')],{'$or':_[_0x632b('0x38')](_0x23385d[_0x632b('0x3e')],function(_0x16c798){var _0x384439={};_0x384439[_0x16c798]={'$like':'%'+_0xf1a293[_0x632b('0x3a')]['filter']+'%'};return _0x384439;})});}_0x23385d=_[_0x632b('0x47')]({},_0x23385d,_0xf1a293['options']);return _0x1e6905[_0x632b('0x7e')](_0x23385d);}})['then'](function(_0x4d3bb7){if(_0x4d3bb7){_0x3293be=_0x4d3bb7[_0x632b('0x40')];if(!_0xf1a293[_0x632b('0x3a')][_0x632b('0x7f')]('nolimit')){_0x23385d['limit']=qs[_0x632b('0x21')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x21')]);_0x23385d['offset']=qs['offset'](_0xf1a293[_0x632b('0x3a')][_0x632b('0x22')]);}return _0x1e6905[_0x632b('0x7e')](_0x23385d);}})[_0x632b('0x2e')](function(_0x66cbf3){if(_0x66cbf3){return _0x66cbf3?{'count':_0x3293be,'rows':_0x66cbf3}:null;}})[_0x632b('0x2e')](respondWithResult(_0x1fcb2a,null))['catch'](handleError(_0x1fcb2a,null));};exports[_0x632b('0x80')]=function(_0x352ba8,_0x3b7be7,_0x32facd){var _0x366643=_0x352ba8[_0x632b('0x53')]['ids'];var _0x5db842;return db[_0x632b('0x81')][_0x632b('0x82')]({'where':{'id':_0x366643},'attributes':['id'],'include':[{'model':db['User'],'as':_0x632b('0x83'),'attributes':['id',_0x632b('0x31'),_0x632b('0x84'),_0x632b('0x85'),_0x632b('0x86')],'raw':!![]}]})[_0x632b('0x2e')](function(_0x17bfa2){if(_0x17bfa2){_0x5db842=_0x17bfa2;var _0x28b626=_['flatMap'](_0x17bfa2,function(_0x4ce406){var _0x1b274d=_0x4ce406[_0x632b('0x2b')]({'plain':!![]});return _0x1b274d['Agents'];});return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x352ba8[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](function(_0x36564e){return db['sequelize']['transaction'](function(_0x824140){return _0x36564e[_0x632b('0x80')](_0x366643,{'transaction':_0x824140})[_0x632b('0x2e')](function(){return BPromise[_0x632b('0x87')](_0x5db842,function(_0x214851){return db[_0x632b('0x88')]['upsert']({'TeamId':_0x214851['id'],'VoicePrefixId':_0x352ba8[_0x632b('0x4c')]['id']},{'transaction':_0x824140});});})['then'](function(){return BPromise[_0x632b('0x87')](_0x28b626,function(_0x26e1a9){return db[_0x632b('0x89')][_0x632b('0x8a')]({'where':{'UserId':_0x26e1a9['id'],'VoicePrefixId':_0x352ba8[_0x632b('0x4c')]['id']},'transaction':_0x824140});});})[_0x632b('0x2e')](function(){_0x28b626[_0x632b('0x8b')](function(_0x19d11e){socket[_0x632b('0x79')](_0x632b('0x75'),{'UserId':_0x19d11e['id'],'VoicePrefixId':_0x36564e['id']});});});});});}})['then'](respondWithStatusCode(_0x3b7be7,null))[_0x632b('0x4e')](handleError(_0x3b7be7,null));};exports[_0x632b('0x8c')]=function(_0x36244e,_0x1cc52f,_0x5cd2b7){return db[_0x632b('0x81')][_0x632b('0x82')]({'where':{'id':_0x36244e['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x632b('0x83'),'attributes':['id'],'raw':!![]}]})[_0x632b('0x2e')](handleEntityNotFound(_0x1cc52f,null))[_0x632b('0x2e')](function(_0x2a45f3){var _0x56d205=_[_0x632b('0x38')](_0x2a45f3,'id');var _0x392b6b=[];var _0x1cfc20=[];var _0x5bd1bb=squel[_0x632b('0x8d')]();_0x5bd1bb['field']('tq.TeamId')[_0x632b('0x8e')](_0x632b('0x8f'),'tq')[_0x632b('0x90')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x632b('0x91'),_0x36244e[_0x632b('0x4c')]['id']);for(var _0x2d0712=0x0;_0x2d0712<_0x2a45f3['length'];_0x2d0712+=0x1){let _0x1f9cb4=_0x2a45f3[_0x2d0712];for(var _0x90b25c=0x0;_0x90b25c<_0x1f9cb4[_0x632b('0x83')][_0x632b('0x40')];_0x90b25c+=0x1){let _0x163ad2=_0x1f9cb4['Agents'][_0x90b25c];var _0x21af7a=_0x5bd1bb['clone']();_0x21af7a['where'](_0x632b('0x92'),_0x163ad2['id']);_0x1cfc20[_0x632b('0x67')](db['sequelize']['query'](_0x21af7a[_0x632b('0x93')](),{'type':db[_0x632b('0x51')][_0x632b('0x94')]['SELECT']})[_0x632b('0x2e')](function(_0x53c0c4){if(_0x53c0c4['length']===0x1){return _0x163ad2['id'];}else{var _0x112ecc=_[_0x632b('0x95')](_[_0x632b('0x38')](_0x53c0c4,_0x632b('0x96')),function(_0x4e5523){return _[_0x632b('0x97')](_0x56d205,_0x4e5523);});if(_0x112ecc){return _0x163ad2['id'];}}}));}}return BPromise[_0x632b('0x98')](_0x1cfc20)[_0x632b('0x2e')](function(_0x350a1b){_0x392b6b=_(_0x392b6b)[_0x632b('0x99')](_0x350a1b)[_0x632b('0x9a')]()['value']();return db[_0x632b('0x34')]['find']({'where':{'id':_0x36244e[_0x632b('0x4c')]['id']}})['then'](function(_0x460dce){return db[_0x632b('0x51')][_0x632b('0x52')](function(_0x2c88a){return _0x460dce[_0x632b('0x8c')](_0x36244e[_0x632b('0x3a')][_0x632b('0x72')],{'transaction':_0x2c88a})[_0x632b('0x2e')](function(){if(!_[_0x632b('0x9b')](_0x392b6b)){return _0x460dce[_0x632b('0x76')](_0x392b6b,{'transaction':_0x2c88a});}})[_0x632b('0x2e')](function(){_0x392b6b[_0x632b('0x8b')](function(_0x3784d2){socket[_0x632b('0x79')](_0x632b('0x78'),{'UserId':_0x3784d2,'VoicePrefixId':_0x460dce['id']});});});});});});})['then'](respondWithStatusCode(_0x1cc52f,null))[_0x632b('0x4e')](handleError(_0x1cc52f,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index bdfc6ff..d1072ef 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 _0x1b7b=['emit','events','VoicePrefix','save','update','remove'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1b7b,0x73));var _0xb1b7=function(_0x46bcdc,_0x40feea){_0x46bcdc=_0x46bcdc-0x0;var _0x1f4412=_0x1b7b[_0x46bcdc];return _0x1f4412;};'use strict';var EventEmitter=require(_0xb1b7('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xb1b7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1b7('0x2'),'afterUpdate':_0xb1b7('0x3'),'afterDestroy':_0xb1b7('0x4')};function emitEvent(_0x3b81db){return function(_0x23e82e,_0x2dea7f,_0x48fe49){VoicePrefixEvents['emit'](_0x3b81db+':'+_0x23e82e['id'],_0x23e82e);VoicePrefixEvents[_0xb1b7('0x5')](_0x3b81db,_0x23e82e);_0x48fe49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xe550=['hook','events','VoicePrefix','setMaxListeners','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe550,0xa2));var _0x0e55=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe550[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x0e55('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x0e55('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0e55('0x2')](0x0);var events={'afterCreate':_0x0e55('0x3'),'afterUpdate':_0x0e55('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43337b){return function(_0xa6e04a,_0x4f25cb,_0x116396){VoicePrefixEvents[_0x0e55('0x5')](_0x43337b+':'+_0xa6e04a['id'],_0xa6e04a);VoicePrefixEvents['emit'](_0x43337b,_0xa6e04a);_0x116396(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x0e55('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ffbba8e..3897545 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 _0x4ad5=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','request-promise'];(function(_0x45a87b,_0x563ce7){var _0x159917=function(_0x240a7d){while(--_0x240a7d){_0x45a87b['push'](_0x45a87b['shift']());}};_0x159917(++_0x563ce7);}(_0x4ad5,0x14f));var _0x54ad=function(_0x1c278e,_0x2c7af0){_0x1c278e=_0x1c278e-0x0;var _0x582a36=_0x4ad5[_0x1c278e];return _0x582a36;};'use strict';var _=require('lodash');var util=require(_0x54ad('0x0'));var logger=require(_0x54ad('0x1'))(_0x54ad('0x2'));var moment=require(_0x54ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x54ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x54ad('0x5'));var attributes=require('./voicePrefix.attributes');module[_0x54ad('0x6')]=function(_0x54b718,_0x42b9a0){return _0x54b718[_0x54ad('0x7')](_0x54ad('0x8'),attributes,{'tableName':_0x54ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0ed=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4510f2,_0x1cc8dc){var _0x3bc792=function(_0x21084f){while(--_0x21084f){_0x4510f2['push'](_0x4510f2['shift']());}};_0x3bc792(++_0x1cc8dc);}(_0xe0ed,0xe2));var _0xde0e=function(_0x1d9894,_0x350e81){_0x1d9894=_0x1d9894-0x0;var _0x3dbd26=_0xe0ed[_0x1d9894];return _0x3dbd26;};'use strict';var _=require(_0xde0e('0x0'));var util=require(_0xde0e('0x1'));var logger=require(_0xde0e('0x2'))(_0xde0e('0x3'));var moment=require(_0xde0e('0x4'));var BPromise=require(_0xde0e('0x5'));var rp=require(_0xde0e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde0e('0x7'));var config=require('../../config/environment');var attributes=require(_0xde0e('0x8'));module[_0xde0e('0x9')]=function(_0x37b7c1,_0x3f4c5d){return _0x37b7c1[_0xde0e('0xa')](_0xde0e('0xb'),attributes,{'tableName':_0xde0e('0xc'),'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 bc1f401..3e40504 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 _0x2542=['register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x326e74,_0x939b7e){var _0x251e95=function(_0x2ae75f){while(--_0x2ae75f){_0x326e74['push'](_0x326e74['shift']());}};_0x251e95(++_0x939b7e);}(_0x2542,0x169));var _0x2254=function(_0x5c93b9,_0x1d4d22){_0x5c93b9=_0x5c93b9-0x0;var _0x4d05c8=_0x2542[_0x5c93b9];return _0x4d05c8;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});config[_0x2254('0xb')]=_[_0x2254('0xc')](config[_0x2254('0xb')],{'host':_0x2254('0xd'),'port':0x18eb});var socket=require(_0x2254('0xe'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);function respondWithRpcPromise(_0x1ae415,_0x38fb2b,_0x5b1ab9){return new BPromise(function(_0x336e14,_0x2655ea){return client[_0x2254('0x11')](_0x1ae415,_0x5b1ab9)[_0x2254('0x12')](function(_0x575d58){logger['info'](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));logger[_0x2254('0x15')](_0x2254('0x16'),_0x38fb2b,_0x2254('0x14'),JSON[_0x2254('0x17')](_0x575d58));if(_0x575d58['error']){if(_0x575d58[_0x2254('0x18')][_0x2254('0x19')]===0x1f4){logger['error'](_0x2254('0x13'),_0x38fb2b,_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);return _0x2655ea(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}logger[_0x2254('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x38fb2b,_0x575d58[_0x2254('0x18')]['message']);return _0x336e14(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}else{logger[_0x2254('0x1b')](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));_0x336e14(_0x575d58[_0x2254('0x1c')]['message']);}})['catch'](function(_0x5ec98d){logger[_0x2254('0x18')](_0x2254('0x13'),_0x38fb2b,_0x5ec98d);_0x2655ea(_0x5ec98d);});});} \ No newline at end of file +var _0x714c=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','debug','request\x20sent','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x714c,0x18d));var _0xc714=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x714c[_0x5cbace];return _0x6de5b8;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var moment=require(_0xc714('0x1'));var BPromise=require(_0xc714('0x2'));var rs=require(_0xc714('0x3'));var fs=require('fs');var Redis=require(_0xc714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc714('0x5'));var logger=require(_0xc714('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc714('0x7'));var client=jayson[_0xc714('0x8')][_0xc714('0x9')]({'port':0x232a});config[_0xc714('0xa')]=_['defaults'](config['redis'],{'host':_0xc714('0xb'),'port':0x18eb});var socket=require(_0xc714('0xc'))(new Redis(config[_0xc714('0xa')]));require(_0xc714('0xd'))[_0xc714('0xe')](socket);function respondWithRpcPromise(_0x5b6aa5,_0x226622,_0x34a03f){return new BPromise(function(_0x3438b4,_0x263f56){return client[_0xc714('0xf')](_0x5b6aa5,_0x34a03f)['then'](function(_0xaa2acc){logger[_0xc714('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x226622,'request\x20sent');logger[_0xc714('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x226622,_0xc714('0x12'),JSON[_0xc714('0x13')](_0xaa2acc));if(_0xaa2acc[_0xc714('0x14')]){if(_0xaa2acc[_0xc714('0x14')]['code']===0x1f4){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);return _0x263f56(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc['error']['message']);return _0x3438b4(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}else{logger[_0xc714('0x10')](_0xc714('0x15'),_0x226622,_0xc714('0x12'));_0x3438b4(_0xaa2acc[_0xc714('0x17')][_0xc714('0x16')]);}})[_0xc714('0x18')](function(_0x50a84a){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0x50a84a);_0x263f56(_0x50a84a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ff8965b..d4e66b0 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 _0xd8b0=['save','emit','./voicePrefix.events'];(function(_0x267510,_0x2cbb58){var _0x230a2e=function(_0x455fbe){while(--_0x455fbe){_0x267510['push'](_0x267510['shift']());}};_0x230a2e(++_0x2cbb58);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var VoicePrefixEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){VoicePrefixEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('voicePrefix:'+_0x413284,_0x3f8b6f);VoicePrefixEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0x885e=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','update','emit'];(function(_0x464a5d,_0x1b64cb){var _0xd8e7c6=function(_0x32c8a8){while(--_0x32c8a8){_0x464a5d['push'](_0x464a5d['shift']());}};_0xd8e7c6(++_0x1b64cb);}(_0x885e,0xe4));var _0xe885=function(_0xe2d607,_0xae3084){_0xe2d607=_0xe2d607-0x0;var _0x35a1ab=_0x885e[_0xe2d607];return _0x35a1ab;};'use strict';var VoicePrefixEvents=require(_0xe885('0x0'));var events=[_0xe885('0x1'),'remove',_0xe885('0x2')];function createListener(_0x1cd11a,_0x162982){return function(_0xfea0bc){_0x162982[_0xe885('0x3')](_0x1cd11a,_0xfea0bc);};}function removeListener(_0x4fcd9b,_0x499ab6){return function(){VoicePrefixEvents[_0xe885('0x4')](_0x4fcd9b,_0x499ab6);};}exports[_0xe885('0x5')]=function(_0x33286a){for(var _0x1a5fd6=0x0,_0x55d2b2=events[_0xe885('0x6')];_0x1a5fd6<_0x55d2b2;_0x1a5fd6++){var _0x597bdc=events[_0x1a5fd6];var _0x2e8fe0=createListener(_0xe885('0x7')+_0x597bdc,_0x33286a);VoicePrefixEvents['on'](_0x597bdc,_0x2e8fe0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 682527f..2287d09 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3238bd,_0x4ea3ef){var _0xdc7a7e=function(_0x275fbc){while(--_0x275fbc){_0x3238bd['push'](_0x3238bd['shift']());}};_0xdc7a7e(++_0x4ea3ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xb10b[_0x3cec8c];return _0x38032e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3340c8,_0x3d67d7){var _0x30ca8a=function(_0x435fff){while(--_0x435fff){_0x3340c8['push'](_0x3340c8['shift']());}};_0x30ca8a(++_0x3d67d7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xb10b[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a3794ed..867d5c6 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 _0xb06c=['random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','fewestcalls'];(function(_0x24267e,_0x762f7d){var _0x5d03d1=function(_0x121b90){while(--_0x121b90){_0x24267e['push'](_0x24267e['shift']());}};_0x5d03d1(++_0x762f7d);}(_0xb06c,0x19f));var _0xcb06=function(_0x187e2a,_0x185bea){_0x187e2a=_0x187e2a-0x0;var _0x5914ca=_0xb06c[_0x187e2a];return _0x5914ca;};'use strict';var Sequelize=require(_0xcb06('0x0'));module[_0xcb06('0x1')]={'name':{'type':Sequelize[_0xcb06('0x2')],'allowNull':![],'unique':_0xcb06('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcb06('0x4')]('inbound',_0xcb06('0x5')),'allowNull':![],'defaultValue':_0xcb06('0x6')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xcb06('0x7')},'announce':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xcb06('0x4')]('rr',_0xcb06('0x8'),'leastrecent',_0xcb06('0x9'),_0xcb06('0xa'),'rrmemory',_0xcb06('0xb'),_0xcb06('0xc'),_0xcb06('0xd')),'allowNull':![],'defaultValue':_0xcb06('0x8'),'set':function(_0x529cd4){this[_0xcb06('0xe')](_0xcb06('0xf'),_0x529cd4?_0x529cd4:_0xcb06('0x10'));},'get':function(){var _0x2a97e3=this[_0xcb06('0x11')](_0xcb06('0x12'));var _0x2c895b=this[_0xcb06('0x11')](_0xcb06('0x13'));var _0x3562f7=this[_0xcb06('0x11')](_0xcb06('0xf'));if(_0x2a97e3===_0xcb06('0x5')){if(_0x2c895b==='preview'){return null;}if(_0x2c895b===_0xcb06('0x14')&&![_0xcb06('0x10'),_0xcb06('0x15')]['includes'](_0x3562f7)){this[_0xcb06('0xe')](_0xcb06('0xf'),_0xcb06('0x10'));}}return _0x3562f7;}},'servicelevel':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xcb06('0x2')]},'weight':{'type':Sequelize[_0xcb06('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xcb06('0x4')]('yes','no',_0xcb06('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xcb06('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xcb06('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xcb06('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xcb06('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xcb06('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xcb06('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xcb06('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xcb06('0x17')},'announce_holdtime':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no',_0xcb06('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xcb06('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xcb06('0x2')]},'queue_youarenext':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xcb06('0x2')]},'queue_quantity1':{'type':Sequelize[_0xcb06('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xcb06('0x2')]},'queue_less_than':{'type':Sequelize[_0xcb06('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x220249){this[_0xcb06('0xe')](_0xcb06('0x1a'),_0x220249?_0x220249[_0xcb06('0x1b')](','):[]);},'get':function(){return this[_0xcb06('0x11')](_0xcb06('0x1a'))?this[_0xcb06('0x11')](_0xcb06('0x1a'))[_0xcb06('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':_0xcb06('0x17'),'set':function(_0x36aa46){this['setDataValue']('joinempty',_0x36aa46?_0x36aa46[_0xcb06('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0xcb06('0x11')](_0xcb06('0x1d'))[_0xcb06('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':'no','set':function(_0x4062ba){this[_0xcb06('0xe')](_0xcb06('0x1e'),_0x4062ba?_0x4062ba[_0xcb06('0x1b')](','):undefined);},'get':function(){return this[_0xcb06('0x11')](_0xcb06('0x1e'))?this[_0xcb06('0x11')](_0xcb06('0x1e'))[_0xcb06('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xcb06('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xcb06('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xcb06('0x2')]},'description':{'type':Sequelize[_0xcb06('0x2')]},'acw':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':0x0,'set':function(_0x12b89d){this[_0xcb06('0xe')](_0xcb06('0x20'),_0x12b89d);if(_0x12b89d){if(this['getDataValue'](_0xcb06('0x21'))<0x2){this['setDataValue'](_0xcb06('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':0x0,'comment':_0xcb06('0x22')},'dialMethod':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x23'),'progressive',_0xcb06('0x24'),_0xcb06('0x25'),_0xcb06('0x14')),'defaultValue':_0xcb06('0x26'),'comment':_0xcb06('0x27')},'dialLimitChannel':{'type':Sequelize[_0xcb06('0x16')](0x4)[_0xcb06('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcb06('0x29')},'dialLimitQueue':{'type':Sequelize[_0xcb06('0x16')](0x4)[_0xcb06('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcb06('0x2a')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x2b'),_0xcb06('0x2c')),'defaultValue':_0xcb06('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xcb06('0x2d')](0x2)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xcb06('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xcb06('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcb06('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xcb06('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x30')},'dialQueueOptions':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':_0xcb06('0x31'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xcb06('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcb06('0x16')](0x5)[_0xcb06('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcb06('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xcb06('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcb06('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcb06('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcb06('0x37')},'dialTimezone':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':_0xcb06('0x38')},'dialPrefix':{'type':Sequelize[_0xcb06('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x39'),'never',_0xcb06('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcb06('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcb06('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcb06('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcb06('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcb06('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcb06('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcb06('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcb06('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcb06('0x16')](0x9)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcb06('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcb06('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcb06('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcb06('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xcb06('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xcb06('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':0x0,'comment':_0xcb06('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcb06('0x4')](_0xcb06('0x46'),_0xcb06('0x47')),'defaultValue':_0xcb06('0x46')},'dialQueueProject2':{'type':Sequelize[_0xcb06('0x2')],'comment':_0xcb06('0x48')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcb06('0x49')},'dialCutDigit':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcb06('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcb06('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcb06('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcb06('0x16')](0x5)[_0xcb06('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcb06('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x4f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcb06('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcb06('0x50')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xcb06('0x16')](0x3)[_0xcb06('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcb06('0x51')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcb06('0x16')](0x5)[_0xcb06('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xcb06('0x52')},'mandatoryDisposition':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28fc9f){if(!_0x28fc9f)this[_0xcb06('0xe')](_0xcb06('0x53'),null);this[_0xcb06('0xe')](_0xcb06('0x54'),_0x28fc9f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xcb06('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xcb06('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x50fc=['setDataValue','strategy','rrmemory','getDataValue','dialMethod','outbound','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','UNSIGNED','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','leastrecent','fewestcalls','linear','wrandom','rrordered','ringall'];(function(_0x2f9de8,_0x2b8fc9){var _0x26843a=function(_0x534c67){while(--_0x534c67){_0x2f9de8['push'](_0x2f9de8['shift']());}};_0x26843a(++_0x2b8fc9);}(_0x50fc,0x1b5));var _0xc50f=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x50fc[_0x4de1b1];return _0x639f27;};'use strict';var Sequelize=require(_0xc50f('0x0'));module[_0xc50f('0x1')]={'name':{'type':Sequelize[_0xc50f('0x2')],'allowNull':![],'unique':_0xc50f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x5'),'outbound'),'allowNull':![],'defaultValue':_0xc50f('0x5')},'musiconhold':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':_0xc50f('0x6')},'announce':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc50f('0x4')]('rr','ringall',_0xc50f('0x7'),_0xc50f('0x8'),'random','rrmemory',_0xc50f('0x9'),_0xc50f('0xa'),_0xc50f('0xb')),'allowNull':![],'defaultValue':_0xc50f('0xc'),'set':function(_0x32cc04){this[_0xc50f('0xd')](_0xc50f('0xe'),_0x32cc04?_0x32cc04:_0xc50f('0xf'));},'get':function(){var _0x1973a6=this[_0xc50f('0x10')]('type');var _0x7c79f2=this[_0xc50f('0x10')](_0xc50f('0x11'));var _0x1debc2=this['getDataValue'](_0xc50f('0xe'));if(_0x1973a6===_0xc50f('0x12')){if(_0x7c79f2===_0xc50f('0x13')){return null;}if(_0x7c79f2===_0xc50f('0x14')&&![_0xc50f('0xf'),_0xc50f('0x15')]['includes'](_0x1debc2)){this[_0xc50f('0xd')]('strategy','rrmemory');}}return _0x1debc2;}},'servicelevel':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc50f('0x16')](0xb)},'timeout':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc50f('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':_0xc50f('0x17')},'autopause':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no',_0xc50f('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc50f('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xc50f('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc50f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc50f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':_0xc50f('0x17')},'announce_holdtime':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no',_0xc50f('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xc50f('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc50f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc50f('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc50f('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xc50f('0x2')]},'queue_less_than':{'type':Sequelize[_0xc50f('0x2')]},'periodic_announce':{'type':Sequelize[_0xc50f('0x1a')],'set':function(_0x4e52f9){this[_0xc50f('0xd')](_0xc50f('0x1b'),_0x4e52f9?_0x4e52f9[_0xc50f('0x1c')](','):[]);},'get':function(){return this[_0xc50f('0x10')](_0xc50f('0x1b'))?this[_0xc50f('0x10')](_0xc50f('0x1b'))[_0xc50f('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':_0xc50f('0x17'),'set':function(_0xac6ac4){this[_0xc50f('0xd')](_0xc50f('0x1e'),_0xac6ac4?_0xac6ac4[_0xc50f('0x1c')](','):undefined);},'get':function(){return this[_0xc50f('0x10')]('joinempty')?this[_0xc50f('0x10')](_0xc50f('0x1e'))[_0xc50f('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':'no','set':function(_0x2cebe0){this[_0xc50f('0xd')]('leavewhenempty',_0x2cebe0?_0x2cebe0[_0xc50f('0x1c')](','):undefined);},'get':function(){return this[_0xc50f('0x10')]('leavewhenempty')?this[_0xc50f('0x10')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc50f('0x2')]},'description':{'type':Sequelize[_0xc50f('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5f1ba2){this[_0xc50f('0xd')](_0xc50f('0x1f'),_0x5f1ba2);if(_0x5f1ba2){if(this['getDataValue']('wrapuptime')<0x2){this[_0xc50f('0xd')](_0xc50f('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc50f('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc50f('0x21')],'defaultValue':0x0,'comment':_0xc50f('0x22')},'dialMethod':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x13'),_0xc50f('0x23'),'power','predictive','booked'),'defaultValue':_0xc50f('0x23'),'comment':_0xc50f('0x24')},'dialLimitChannel':{'type':Sequelize[_0xc50f('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc50f('0x25')},'dialPowerLevel':{'type':Sequelize[_0xc50f('0x26')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x27'),_0xc50f('0x28')),'defaultValue':'dropRate','comment':_0xc50f('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc50f('0x26')](0x2)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc50f('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc50f('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc50f('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc50f('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc50f('0x2a')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xc50f('0x2')],'comment':_0xc50f('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc50f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc50f('0x16')](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc50f('0x33')},'dialTimezone':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc50f('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x34'),_0xc50f('0x35'),'onlyIfOpen'),'defaultValue':_0xc50f('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc50f('0x16')](0x9)[_0xc50f('0x2a')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc50f('0x36')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc50f('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc50f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc50f('0x38')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc50f('0x2a')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc50f('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc50f('0x16')](0x9)[_0xc50f('0x2a')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc50f('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc50f('0x16')](0x9)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc50f('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc50f('0x16')](0x5)[_0xc50f('0x2a')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc50f('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc50f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xc50f('0x16')](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc50f('0x4')](_0xc50f('0x3d'),_0xc50f('0x3e')),'defaultValue':_0xc50f('0x3d')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xc50f('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc50f('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc50f('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc50f('0x3f')},'dialCutDigit':{'type':Sequelize[_0xc50f('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xc50f('0x16')](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x41')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc50f('0x16')](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x43')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc50f('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x44')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc50f('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc50f('0x45')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc50f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc50f('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xc50f('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xc50f('0x21')],'defaultValue':![],'comment':_0xc50f('0x48'),'set':function(_0x22c433){if(!_0x22c433)this[_0xc50f('0xd')](_0xc50f('0x49'),null);this[_0xc50f('0xd')](_0xc50f('0x4a'),_0x22c433);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc50f('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xc50f('0x16')](0x3)[_0xc50f('0x2a')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xc50f('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 8c541cd..d4fba3b 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 _0xd663=['pick','merge','options','includeAll','findAll','rows','catch','show','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','body','createdAt','updatedAt','params','destroy','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','interface','flatMap','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','every','TeamId','union','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','all','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','scheduledAt','ContactId','ListId','field','phone','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','CmList','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','end','error','stack','send','index','VoiceQueue','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x44f91e,_0x47e2eb){var _0x33a0bd=function(_0x6e7327){while(--_0x6e7327){_0x44f91e['push'](_0x44f91e['shift']());}};_0x33a0bd(++_0x47e2eb);}(_0xd663,0x1ed));var _0x3d66=function(_0x130471,_0x30c1a1){_0x130471=_0x130471-0x0;var _0x4c5a14=_0xd663[_0x130471];return _0x4c5a14;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d66('0x2'));var rp=require(_0x3d66('0x3'));var moment=require(_0x3d66('0x4'));var BPromise=require(_0x3d66('0x5'));var Mustache=require(_0x3d66('0x6'));var util=require('util');var path=require(_0x3d66('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(_0x3d66('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d66('0x9'));var deskjs=require(_0x3d66('0xa'));var toCsv=require(_0x3d66('0xb'));var querystring=require(_0x3d66('0xc'));var Papa=require(_0x3d66('0xd'));var Redis=require(_0x3d66('0xe'));var authService=require(_0x3d66('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x10'));var hardwareService=require(_0x3d66('0x11'));var logger=require(_0x3d66('0x12'))('api');var utils=require(_0x3d66('0x13'));var config=require(_0x3d66('0x14'));var licenseUtil=require(_0x3d66('0x15'));var db=require('../../mysqldb')['db'];config[_0x3d66('0x16')]=_[_0x3d66('0x17')](config[_0x3d66('0x16')],{'host':_0x3d66('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d66('0x16')]));require('./voiceQueue.socket')[_0x3d66('0x19')](socket);function respondWithStatusCode(_0x290f29,_0x271dd0){_0x271dd0=_0x271dd0||0xcc;return function(_0x3075e2){if(_0x3075e2){return _0x290f29[_0x3d66('0x1a')](_0x271dd0);}return _0x290f29[_0x3d66('0x1b')](_0x271dd0)['end']();};}function respondWithResult(_0x5eba7e,_0xe5bf8f){_0xe5bf8f=_0xe5bf8f||0xc8;return function(_0x4651b8){if(_0x4651b8){return _0x5eba7e['status'](_0xe5bf8f)[_0x3d66('0x1c')](_0x4651b8);}};}function respondWithFilteredResult(_0x24d137,_0x42cd68){return function(_0x1dfd81){if(_0x1dfd81){var _0xe13f0f=typeof _0x42cd68[_0x3d66('0x1d')]===_0x3d66('0x1e')&&typeof _0x42cd68[_0x3d66('0x1f')]===_0x3d66('0x1e');var _0x3902f1=_0x1dfd81[_0x3d66('0x20')];var _0x353c5f=_0xe13f0f?0x0:_0x42cd68[_0x3d66('0x1d')];var _0x42df07=_0xe13f0f?_0x1dfd81[_0x3d66('0x20')]:_0x42cd68['offset']+_0x42cd68[_0x3d66('0x1f')];var _0x5e1516;if(_0x42df07>=_0x3902f1){_0x42df07=_0x3902f1;_0x5e1516=0xc8;}else{_0x5e1516=0xce;}_0x24d137[_0x3d66('0x1b')](_0x5e1516);return _0x24d137[_0x3d66('0x21')](_0x3d66('0x22'),_0x353c5f+'-'+_0x42df07+'/'+_0x3902f1)[_0x3d66('0x1c')](_0x1dfd81);}return null;};}function patchUpdates(_0x11be7f){return function(_0x139cb5){try{jsonpatch[_0x3d66('0x23')](_0x139cb5,_0x11be7f,!![]);}catch(_0x1bfa81){return BPromise[_0x3d66('0x24')](_0x1bfa81);}return _0x139cb5['save']();};}function saveUpdates(_0x151364,_0x1a970c){return function(_0x2c1779){if(_0x2c1779){return _0x2c1779[_0x3d66('0x25')](_0x151364)['then'](function(_0x59fe0a){return _0x59fe0a;});}return null;};}function removeEntity(_0x45628b,_0x4302ad){return function(_0x29819d){if(_0x29819d){return _0x29819d['destroy']()[_0x3d66('0x26')](function(){var _0x3e6712=_0x29819d[_0x3d66('0x27')]({'plain':!![]});var _0x7350d8=[{'name':_0x3d66('0x28'),'value':_0x3d66('0x29'),'ignore':![]},{'name':_0x3d66('0x2a'),'value':_0x3d66('0x2b'),'ignore':![]}];var _0x325de1=_(_0x7350d8)[_0x3d66('0x2c')]('ignore')[_0x3d66('0x2d')](_0x3d66('0x2e'))[_0x3d66('0x2e')]();if(_[_0x3d66('0x2f')](_0x325de1,_0x3e6712[_0x3d66('0x30')])){return;}var _0x41bf36=_[_0x3d66('0x31')](_0x7350d8,[_0x3d66('0x2e'),_0x3e6712[_0x3d66('0x30')]])[_0x3d66('0x32')];return db[_0x3d66('0x33')]['destroy']({'where':{'type':_0x41bf36,'resourceId':_0x3e6712['id']}})['then'](function(){return _0x29819d;});})[_0x3d66('0x26')](function(){_0x45628b[_0x3d66('0x1b')](0xcc)[_0x3d66('0x34')]();});}};}function handleEntityNotFound(_0x26f667,_0x16ec87){return function(_0x32081c){if(!_0x32081c){_0x26f667[_0x3d66('0x1a')](0x194);}return _0x32081c;};}function handleError(_0x218ce8,_0x2af4b2){_0x2af4b2=_0x2af4b2||0x1f4;return function(_0x44de79){logger[_0x3d66('0x35')](_0x44de79[_0x3d66('0x36')]);if(_0x44de79[_0x3d66('0x32')]){delete _0x44de79[_0x3d66('0x32')];}_0x218ce8[_0x3d66('0x1b')](_0x2af4b2)[_0x3d66('0x37')](_0x44de79);};}exports[_0x3d66('0x38')]=function(_0x2e7263,_0x21692b){var _0x1b679f={},_0x44874c={},_0x13bd16={'count':0x0,'rows':[]};var _0x443d0c=_['map'](db[_0x3d66('0x39')][_0x3d66('0x3a')],function(_0xf1bcb4){return{'name':_0xf1bcb4['fieldName'],'type':_0xf1bcb4[_0x3d66('0x30')]['key']};});_0x44874c[_0x3d66('0x3b')]=_[_0x3d66('0x2d')](_0x443d0c,'name');_0x44874c[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x2e7263['query']);_0x44874c[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x44874c['model'],_0x44874c[_0x3d66('0x3c')]);_0x1b679f[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x44874c[_0x3d66('0x3b')],qs['fields'](_0x2e7263[_0x3d66('0x3c')]['fields']));_0x1b679f[_0x3d66('0x40')]=_0x1b679f['attributes'][_0x3d66('0x41')]?_0x1b679f[_0x3d66('0x40')]:_0x44874c[_0x3d66('0x3b')];if(!_0x2e7263['query'][_0x3d66('0x42')](_0x3d66('0x43'))){_0x1b679f[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x2e7263[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x1b679f[_0x3d66('0x1d')]=qs[_0x3d66('0x1d')](_0x2e7263[_0x3d66('0x3c')][_0x3d66('0x1d')]);}_0x1b679f[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x2e7263[_0x3d66('0x3c')]['sort']);_0x1b679f[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x2e7263['query'],_0x44874c['filters']),_0x443d0c);if(_0x2e7263[_0x3d66('0x3c')][_0x3d66('0x2c')]){_0x1b679f[_0x3d66('0x46')]=_[_0x3d66('0x48')](_0x1b679f[_0x3d66('0x46')],{'$or':_[_0x3d66('0x2d')](_0x443d0c,function(_0x389691){if(_0x389691[_0x3d66('0x30')]!=='VIRTUAL'){var _0x185459={};_0x185459[_0x389691[_0x3d66('0x32')]]={'$like':'%'+_0x2e7263[_0x3d66('0x3c')]['filter']+'%'};return _0x185459;}})});}_0x1b679f=_['merge']({},_0x1b679f,_0x2e7263[_0x3d66('0x49')]);var _0x39a460={'where':_0x1b679f[_0x3d66('0x46')]};return db[_0x3d66('0x39')][_0x3d66('0x20')](_0x39a460)[_0x3d66('0x26')](function(_0x45ef7c){_0x13bd16[_0x3d66('0x20')]=_0x45ef7c;if(_0x2e7263['query'][_0x3d66('0x4a')]){_0x1b679f['include']=[{'all':!![]}];}return db[_0x3d66('0x39')][_0x3d66('0x4b')](_0x1b679f);})[_0x3d66('0x26')](function(_0x5a4203){_0x13bd16[_0x3d66('0x4c')]=_0x5a4203;return _0x13bd16;})[_0x3d66('0x26')](respondWithFilteredResult(_0x21692b,_0x1b679f))[_0x3d66('0x4d')](handleError(_0x21692b,null));};exports[_0x3d66('0x4e')]=function(_0x4c8c2d,_0x5cb410){var _0x1c6575={'raw':![],'where':{'id':_0x4c8c2d['params']['id']}},_0x52e237={};_0x52e237[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db[_0x3d66('0x39')][_0x3d66('0x3a')]);_0x52e237[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x4c8c2d[_0x3d66('0x3c')]);_0x52e237['filters']=_[_0x3d66('0x3f')](_0x52e237[_0x3d66('0x3b')],_0x52e237[_0x3d66('0x3c')]);_0x1c6575[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x52e237['model'],qs[_0x3d66('0x4f')](_0x4c8c2d[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0x1c6575[_0x3d66('0x40')]=_0x1c6575[_0x3d66('0x40')][_0x3d66('0x41')]?_0x1c6575[_0x3d66('0x40')]:_0x52e237['model'];if(_0x4c8c2d['query']['includeAll']){_0x1c6575[_0x3d66('0x50')]=[{'all':!![]}];}_0x1c6575=_[_0x3d66('0x48')]({},_0x1c6575,_0x4c8c2d['options']);return db[_0x3d66('0x39')][_0x3d66('0x31')](_0x1c6575)[_0x3d66('0x26')](handleEntityNotFound(_0x5cb410,null))[_0x3d66('0x26')](respondWithResult(_0x5cb410,null))[_0x3d66('0x4d')](handleError(_0x5cb410,null));};exports[_0x3d66('0x51')]=function(_0x17bc27,_0x39e123){return db[_0x3d66('0x39')]['create'](_0x17bc27['body'],{})[_0x3d66('0x26')](function(_0x4ea803){var _0x4ce562=_0x17bc27[_0x3d66('0x52')][_0x3d66('0x27')]({'plain':!![]});if(!_0x4ce562)throw new Error(_0x3d66('0x53'));if(_0x4ce562[_0x3d66('0x54')]===_0x3d66('0x52')){var _0x4863d5=_0x4ea803[_0x3d66('0x27')]({'plain':!![]});var _0x33b4f1=[{'name':_0x3d66('0x28'),'value':_0x3d66('0x29')},{'name':'QueueCampaigns','value':_0x3d66('0x2b')}];var _0x320886=_[_0x3d66('0x31')](_0x33b4f1,['value',_0x4863d5['type']])['name'];return db[_0x3d66('0x55')][_0x3d66('0x31')]({'where':{'name':_0x320886,'userProfileId':_0x4ce562[_0x3d66('0x56')]},'raw':!![]})[_0x3d66('0x26')](function(_0x4b451d){if(_0x4b451d&&_0x4b451d[_0x3d66('0x57')]===0x0){return db[_0x3d66('0x33')]['create']({'name':_0x4863d5[_0x3d66('0x32')],'resourceId':_0x4863d5['id'],'type':_0x4b451d[_0x3d66('0x32')],'sectionId':_0x4b451d['id']},{})[_0x3d66('0x26')](function(){return _0x4ea803;});}else{return _0x4ea803;}})[_0x3d66('0x4d')](function(_0x1cb738){logger[_0x3d66('0x35')](_0x3d66('0x58'),_0x1cb738);throw _0x1cb738;});}return _0x4ea803;})['then'](respondWithResult(_0x39e123,0xc9))['catch'](handleError(_0x39e123,null));};exports['clone']=function(_0x232dbf,_0x10177d){var _0x2206c9={'where':{'id':_0x232dbf['params']['id']}},_0x32c159={};_0x32c159[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db[_0x3d66('0x39')][_0x3d66('0x3a')]);_0x2206c9[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x32c159[_0x3d66('0x3b')],qs[_0x3d66('0x4f')](_0x232dbf['query'][_0x3d66('0x4f')]));_0x2206c9['attributes']=_0x2206c9['attributes'][_0x3d66('0x41')]?_0x2206c9[_0x3d66('0x40')]:_0x32c159[_0x3d66('0x3b')];if(_0x232dbf[_0x3d66('0x3c')][_0x3d66('0x4a')]){_0x2206c9[_0x3d66('0x50')]=[{'all':!![]}];}_0x2206c9=_[_0x3d66('0x48')]({},_0x2206c9,_0x232dbf[_0x3d66('0x49')]);return db[_0x3d66('0x39')][_0x3d66('0x31')](_0x2206c9)[_0x3d66('0x26')](handleEntityNotFound(_0x10177d,null))[_0x3d66('0x26')](function(_0x4cea34){if(_0x4cea34){var _0x18fd84=_0x4cea34['get']({'plain':!![]});_0x18fd84=qs[_0x3d66('0x59')](_0x18fd84,['id','createdAt','updatedAt']);_0x232dbf[_0x3d66('0x5a')]=_[_0x3d66('0x59')](_0x232dbf[_0x3d66('0x5a')],['id',_0x3d66('0x5b'),_0x3d66('0x5c')]);return db[_0x3d66('0x39')][_0x3d66('0x51')](_[_0x3d66('0x48')](_0x18fd84,_0x232dbf['body']),{'include':_0x232dbf[_0x3d66('0x3c')][_0x3d66('0x4a')]?[{'all':!![]}]:undefined})[_0x3d66('0x26')](function(_0x51e50a){var _0x1cf222=_0x232dbf[_0x3d66('0x52')][_0x3d66('0x27')]({'plain':!![]});if(!_0x1cf222)throw new Error(_0x3d66('0x53'));if(_0x1cf222[_0x3d66('0x54')]===_0x3d66('0x52')){var _0x34db08=_0x51e50a[_0x3d66('0x27')]({'plain':!![]});var _0x1ec163=[{'name':_0x3d66('0x28'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x3d66('0x2b')}];var _0x271963=_['find'](_0x1ec163,[_0x3d66('0x2e'),_0x34db08[_0x3d66('0x30')]])[_0x3d66('0x32')];return db[_0x3d66('0x55')][_0x3d66('0x31')]({'where':{'name':_0x271963,'userProfileId':_0x1cf222[_0x3d66('0x56')]},'raw':!![]})[_0x3d66('0x26')](function(_0x5d11cd){if(_0x5d11cd&&_0x5d11cd[_0x3d66('0x57')]===0x0){return db[_0x3d66('0x33')]['create']({'name':_0x34db08[_0x3d66('0x32')],'resourceId':_0x34db08['id'],'type':_0x5d11cd[_0x3d66('0x32')],'sectionId':_0x5d11cd['id']},{})[_0x3d66('0x26')](function(){return _0x51e50a;});}else{return _0x51e50a;}})['catch'](function(_0x39c155){logger['error'](_0x3d66('0x58'),_0x39c155);throw _0x39c155;});}return _0x51e50a;});}})[_0x3d66('0x26')](respondWithResult(_0x10177d,0xc9))[_0x3d66('0x4d')](handleError(_0x10177d,null));};exports[_0x3d66('0x25')]=function(_0x2c49b2,_0x997db7){if(_0x2c49b2['body']['id']){delete _0x2c49b2['body']['id'];}return db[_0x3d66('0x39')]['find']({'where':{'id':_0x2c49b2[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x997db7,null))[_0x3d66('0x26')](saveUpdates(_0x2c49b2['body'],null))[_0x3d66('0x26')](respondWithResult(_0x997db7,null))[_0x3d66('0x4d')](handleError(_0x997db7,null));};exports[_0x3d66('0x5e')]=function(_0x4fbfab,_0x26e494){return db[_0x3d66('0x39')]['find']({'where':{'id':_0x4fbfab[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x26e494,null))[_0x3d66('0x26')](removeEntity(_0x26e494,null))[_0x3d66('0x4d')](handleError(_0x26e494,null));};exports[_0x3d66('0x5f')]=function(_0x5e26fe,_0xa6a2fa,_0x316eaa){var _0x205ef4={'raw':![],'where':{}};var _0x15d110={};var _0x19aba3={'count':0x0,'rows':[]};return db[_0x3d66('0x39')][_0x3d66('0x60')]({'where':{'id':_0x5e26fe[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0xa6a2fa,null))[_0x3d66('0x26')](function(_0x36982a){if(_0x36982a){_0x15d110[_0x3d66('0x3b')]=_['keys'](db[_0x3d66('0x61')]['rawAttributes']);_0x15d110[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x5e26fe[_0x3d66('0x3c')]);_0x15d110['filters']=_[_0x3d66('0x3f')](_0x15d110['model'],_0x15d110[_0x3d66('0x3c')]);_0x205ef4[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x15d110[_0x3d66('0x3b')],qs[_0x3d66('0x4f')](_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0x205ef4[_0x3d66('0x40')]=_0x205ef4[_0x3d66('0x40')]['length']?_0x205ef4[_0x3d66('0x40')]:_0x15d110[_0x3d66('0x3b')];if(!_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x42')](_0x3d66('0x43'))){_0x205ef4[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x205ef4['offset']=qs[_0x3d66('0x1d')](_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x1d')]);}_0x205ef4[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x45')]);_0x205ef4[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x5e26fe[_0x3d66('0x3c')],_0x15d110['filters']));_0x205ef4[_0x3d66('0x46')][_0x3d66('0x62')]=_0x36982a['id'];if(_0x5e26fe['query'][_0x3d66('0x2c')]){_0x205ef4[_0x3d66('0x46')]=_['merge'](_0x205ef4['where'],{'$or':_[_0x3d66('0x2d')](_0x205ef4[_0x3d66('0x40')],function(_0x206073){var _0x4992d5={};_0x4992d5[_0x206073]={'$like':'%'+_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x2c')]+'%'};return _0x4992d5;})});}_0x205ef4=_[_0x3d66('0x48')]({},_0x205ef4,_0x5e26fe[_0x3d66('0x49')]);return db['CmHopper'][_0x3d66('0x20')]({'where':_0x205ef4[_0x3d66('0x46')]})[_0x3d66('0x26')](function(_0x5dee77){_0x19aba3[_0x3d66('0x20')]=_0x5dee77;if(_0x5e26fe[_0x3d66('0x3c')][_0x3d66('0x4a')]){_0x205ef4['include']=[{'all':!![]}];}return db[_0x3d66('0x61')]['findAll'](_0x205ef4);})[_0x3d66('0x26')](function(_0x396a59){_0x19aba3[_0x3d66('0x4c')]=_0x396a59;return _0x19aba3;});}})['then'](respondWithFilteredResult(_0xa6a2fa,_0x205ef4))[_0x3d66('0x4d')](handleError(_0xa6a2fa,null));};exports[_0x3d66('0x63')]=function(_0x573134,_0x1dc7b5,_0x4ed024){var _0x25b997={'raw':!![],'where':{}};var _0x150f3c={};var _0x214191={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3d66('0x60')]({'where':{'id':_0x573134[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x1dc7b5,null))[_0x3d66('0x26')](function(_0x458d71){if(_0x458d71){_0x150f3c['model']=_[_0x3d66('0x3d')](db[_0x3d66('0x64')][_0x3d66('0x3a')]);_0x150f3c['query']=_[_0x3d66('0x3d')](_0x573134[_0x3d66('0x3c')]);_0x150f3c[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x150f3c[_0x3d66('0x3b')],_0x150f3c['query']);_0x25b997['attributes']=_[_0x3d66('0x3f')](_0x150f3c[_0x3d66('0x3b')],qs['fields'](_0x573134[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0x25b997[_0x3d66('0x40')]=_0x25b997['attributes'][_0x3d66('0x41')]?_0x25b997[_0x3d66('0x40')]:_0x150f3c['model'];if(!_0x573134['query'][_0x3d66('0x42')]('nolimit')){_0x25b997[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x573134[_0x3d66('0x3c')]['limit']);_0x25b997['offset']=qs[_0x3d66('0x1d')](_0x573134[_0x3d66('0x3c')][_0x3d66('0x1d')]);}_0x25b997[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x573134['query']['sort']);_0x25b997[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x573134[_0x3d66('0x3c')],_0x150f3c[_0x3d66('0x3e')]));_0x25b997[_0x3d66('0x46')]['VoiceQueueId']=_0x458d71['id'];if(_0x573134['query'][_0x3d66('0x2c')]){_0x25b997[_0x3d66('0x46')]=_['merge'](_0x25b997[_0x3d66('0x46')],{'$or':_[_0x3d66('0x2d')](_0x25b997['attributes'],function(_0x5a7a81){var _0x5f19d5={};_0x5f19d5[_0x5a7a81]={'$like':'%'+_0x573134['query']['filter']+'%'};return _0x5f19d5;})});}_0x25b997=_['merge']({},_0x25b997,_0x573134[_0x3d66('0x49')]);return db[_0x3d66('0x64')][_0x3d66('0x20')]({'where':_0x25b997[_0x3d66('0x46')]})[_0x3d66('0x26')](function(_0x116867){_0x214191[_0x3d66('0x20')]=_0x116867;if(_0x573134['query'][_0x3d66('0x4a')]){_0x25b997[_0x3d66('0x50')]=[{'all':!![]}];}return db[_0x3d66('0x64')][_0x3d66('0x4b')](_0x25b997);})[_0x3d66('0x26')](function(_0x5e0db2){_0x214191['rows']=_0x5e0db2;return _0x214191;});}})[_0x3d66('0x26')](respondWithFilteredResult(_0x1dc7b5,_0x25b997))[_0x3d66('0x4d')](handleError(_0x1dc7b5,null));};exports[_0x3d66('0x65')]=function(_0x4340c1,_0x461cd4,_0x431c60){var _0x36cc3a={'raw':!![],'where':{}};var _0x16a3cf={};var _0x1b2a0e={'count':0x0,'rows':[]};return db[_0x3d66('0x39')][_0x3d66('0x60')]({'where':{'id':_0x4340c1[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x461cd4,null))['then'](function(_0x302d14){if(_0x302d14){_0x16a3cf[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db['CmHopperFinal'][_0x3d66('0x3a')]);_0x16a3cf[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x4340c1['query']);_0x16a3cf['filters']=_['intersection'](_0x16a3cf[_0x3d66('0x3b')],_0x16a3cf['query']);_0x36cc3a[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x16a3cf[_0x3d66('0x3b')],qs[_0x3d66('0x4f')](_0x4340c1['query'][_0x3d66('0x4f')]));_0x36cc3a[_0x3d66('0x40')]=_0x36cc3a['attributes'][_0x3d66('0x41')]?_0x36cc3a['attributes']:_0x16a3cf[_0x3d66('0x3b')];if(!_0x4340c1[_0x3d66('0x3c')]['hasOwnProperty']('nolimit')){_0x36cc3a[_0x3d66('0x1f')]=qs['limit'](_0x4340c1[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x36cc3a[_0x3d66('0x1d')]=qs['offset'](_0x4340c1[_0x3d66('0x3c')][_0x3d66('0x1d')]);}_0x36cc3a[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x4340c1[_0x3d66('0x3c')]['sort']);_0x36cc3a[_0x3d66('0x46')]=qs['filters'](_[_0x3d66('0x47')](_0x4340c1[_0x3d66('0x3c')],_0x16a3cf['filters']));_0x36cc3a[_0x3d66('0x46')][_0x3d66('0x62')]=_0x302d14['id'];if(_0x4340c1[_0x3d66('0x3c')]['filter']){_0x36cc3a[_0x3d66('0x46')]=_[_0x3d66('0x48')](_0x36cc3a[_0x3d66('0x46')],{'$or':_[_0x3d66('0x2d')](_0x36cc3a[_0x3d66('0x40')],function(_0x5c9302){var _0x54808d={};_0x54808d[_0x5c9302]={'$like':'%'+_0x4340c1[_0x3d66('0x3c')]['filter']+'%'};return _0x54808d;})});}_0x36cc3a=_[_0x3d66('0x48')]({},_0x36cc3a,_0x4340c1[_0x3d66('0x49')]);return db[_0x3d66('0x66')]['count']({'where':_0x36cc3a[_0x3d66('0x46')]})[_0x3d66('0x26')](function(_0x191263){_0x1b2a0e['count']=_0x191263;if(_0x4340c1[_0x3d66('0x3c')]['includeAll']){_0x36cc3a[_0x3d66('0x50')]=[{'all':!![]}];}return db[_0x3d66('0x66')][_0x3d66('0x4b')](_0x36cc3a);})[_0x3d66('0x26')](function(_0x4791e2){_0x1b2a0e[_0x3d66('0x4c')]=_0x4791e2;return _0x1b2a0e;});}})['then'](respondWithFilteredResult(_0x461cd4,_0x36cc3a))['catch'](handleError(_0x461cd4,null));};exports[_0x3d66('0x67')]=function(_0x1e349d,_0x3ee655,_0x482e9d){var _0x11c05b={'raw':!![],'where':{}};var _0x5e4272={};var _0x5ef999={'count':0x0,'rows':[]};return db[_0x3d66('0x39')]['findOne']({'where':{'id':_0x1e349d[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x3ee655,null))[_0x3d66('0x26')](function(_0x50cffa){if(_0x50cffa){_0x5e4272[_0x3d66('0x3b')]=_['keys'](db['CmHopperBlack'][_0x3d66('0x3a')]);_0x5e4272['query']=_[_0x3d66('0x3d')](_0x1e349d[_0x3d66('0x3c')]);_0x5e4272[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x5e4272[_0x3d66('0x3b')],_0x5e4272[_0x3d66('0x3c')]);_0x11c05b[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x5e4272[_0x3d66('0x3b')],qs[_0x3d66('0x4f')](_0x1e349d['query'][_0x3d66('0x4f')]));_0x11c05b[_0x3d66('0x40')]=_0x11c05b[_0x3d66('0x40')][_0x3d66('0x41')]?_0x11c05b[_0x3d66('0x40')]:_0x5e4272[_0x3d66('0x3b')];if(!_0x1e349d['query'][_0x3d66('0x42')](_0x3d66('0x43'))){_0x11c05b[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x1e349d[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x11c05b[_0x3d66('0x1d')]=qs['offset'](_0x1e349d[_0x3d66('0x3c')]['offset']);}_0x11c05b['order']=qs[_0x3d66('0x45')](_0x1e349d[_0x3d66('0x3c')]['sort']);_0x11c05b['where']=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x1e349d[_0x3d66('0x3c')],_0x5e4272['filters']));_0x11c05b[_0x3d66('0x46')][_0x3d66('0x62')]=_0x50cffa['id'];if(_0x1e349d['query']['filter']){_0x11c05b[_0x3d66('0x46')]=_['merge'](_0x11c05b[_0x3d66('0x46')],{'$or':_[_0x3d66('0x2d')](_0x11c05b[_0x3d66('0x40')],function(_0x335f32){var _0x22c6c9={};_0x22c6c9[_0x335f32]={'$like':'%'+_0x1e349d[_0x3d66('0x3c')]['filter']+'%'};return _0x22c6c9;})});}_0x11c05b=_['merge']({},_0x11c05b,_0x1e349d[_0x3d66('0x49')]);return db[_0x3d66('0x68')][_0x3d66('0x20')]({'where':_0x11c05b[_0x3d66('0x46')]})[_0x3d66('0x26')](function(_0x2da93e){_0x5ef999[_0x3d66('0x20')]=_0x2da93e;if(_0x1e349d['query']['includeAll']){_0x11c05b[_0x3d66('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3d66('0x4b')](_0x11c05b);})[_0x3d66('0x26')](function(_0x475982){_0x5ef999[_0x3d66('0x4c')]=_0x475982;return _0x5ef999;});}})[_0x3d66('0x26')](respondWithFilteredResult(_0x3ee655,_0x11c05b))[_0x3d66('0x4d')](handleError(_0x3ee655,null));};exports[_0x3d66('0x69')]=function(_0x3fb3ba,_0x46a956,_0x102f98){var _0x63e5b1={};var _0x20bed1={};var _0x288d4d;var _0x2f3a12;return db[_0x3d66('0x39')][_0x3d66('0x60')]({'where':{'id':_0x3fb3ba[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x46a956,null))[_0x3d66('0x26')](function(_0x110f2e){if(_0x110f2e){_0x288d4d=_0x110f2e;_0x20bed1[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db['Team'][_0x3d66('0x3a')]);_0x20bed1['query']=_['keys'](_0x3fb3ba[_0x3d66('0x3c')]);_0x20bed1[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x20bed1['model'],_0x20bed1[_0x3d66('0x3c')]);_0x63e5b1[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x20bed1['model'],qs[_0x3d66('0x4f')](_0x3fb3ba['query']['fields']));_0x63e5b1[_0x3d66('0x40')]=_0x63e5b1[_0x3d66('0x40')][_0x3d66('0x41')]?_0x63e5b1[_0x3d66('0x40')]:_0x20bed1[_0x3d66('0x3b')];_0x63e5b1['order']=qs[_0x3d66('0x45')](_0x3fb3ba[_0x3d66('0x3c')]['sort']);_0x63e5b1[_0x3d66('0x46')]=qs['filters'](_[_0x3d66('0x47')](_0x3fb3ba['query'],_0x20bed1[_0x3d66('0x3e')]));if(_0x3fb3ba['query'][_0x3d66('0x2c')]){_0x63e5b1['where']=_['merge'](_0x63e5b1[_0x3d66('0x46')],{'$or':_['map'](_0x63e5b1[_0x3d66('0x40')],function(_0x42d1a5){var _0x5dbad4={};_0x5dbad4[_0x42d1a5]={'$like':'%'+_0x3fb3ba[_0x3d66('0x3c')][_0x3d66('0x2c')]+'%'};return _0x5dbad4;})});}_0x63e5b1=_[_0x3d66('0x48')]({},_0x63e5b1,_0x3fb3ba[_0x3d66('0x49')]);return _0x288d4d[_0x3d66('0x69')](_0x63e5b1);}})[_0x3d66('0x26')](function(_0x1c04f3){if(_0x1c04f3){_0x2f3a12=_0x1c04f3[_0x3d66('0x41')];if(!_0x3fb3ba[_0x3d66('0x3c')][_0x3d66('0x42')]('nolimit')){_0x63e5b1[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x3fb3ba[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x63e5b1[_0x3d66('0x1d')]=qs[_0x3d66('0x1d')](_0x3fb3ba[_0x3d66('0x3c')][_0x3d66('0x1d')]);}return _0x288d4d[_0x3d66('0x69')](_0x63e5b1);}})[_0x3d66('0x26')](function(_0x35ebe5){if(_0x35ebe5){return _0x35ebe5?{'count':_0x2f3a12,'rows':_0x35ebe5}:null;}})[_0x3d66('0x26')](respondWithResult(_0x46a956,null))[_0x3d66('0x4d')](handleError(_0x46a956,null));};exports['addTeams']=function(_0x4decb0,_0x35fae3,_0x4dbb99){var _0x55d4be=_0x4decb0[_0x3d66('0x5a')][_0x3d66('0x6a')];var _0xb09af6=_[_0x3d66('0x2d')](_0x55d4be,'id');return db[_0x3d66('0x6b')][_0x3d66('0x4b')]({'where':{'id':_0xb09af6},'attributes':['id'],'include':[{'model':db[_0x3d66('0x6c')],'as':_0x3d66('0x6d'),'attributes':['id','name',_0x3d66('0x6e'),'voicePause',_0x3d66('0x6f')],'raw':!![]}]})[_0x3d66('0x26')](function(_0xc1d558){if(_0xc1d558){var _0x4b7124=_[_0x3d66('0x70')](_0xc1d558,function(_0x153eb8){var _0x5b7aea=_0x153eb8[_0x3d66('0x27')]({'plain':!![]});_0x5b7aea[_0x3d66('0x6d')]['forEach'](function(_0x4b8ffe){_0x4b8ffe[_0x3d66('0x71')]=_[_0x3d66('0x31')](_0x55d4be,{'id':_0x5b7aea['id']})[_0x3d66('0x71')];});return _0x5b7aea['Agents'];});return db['VoiceQueue'][_0x3d66('0x31')]({'where':{'id':_0x4decb0['params']['id']}})['then'](function(_0x3a9929){return db['sequelize'][_0x3d66('0x72')](function(_0x565e25){return _0x3a9929['addTeams'](_0xb09af6,{'transaction':_0x565e25})[_0x3d66('0x26')](function(){return BPromise[_0x3d66('0x73')](_0x55d4be,function(_0x435d63){return db[_0x3d66('0x74')][_0x3d66('0x75')]({'TeamId':_0x435d63['id'],'VoiceQueueId':_0x4decb0[_0x3d66('0x5d')]['id'],'penalty':_0x435d63[_0x3d66('0x71')]},{'transaction':_0x565e25});});})[_0x3d66('0x26')](function(){return BPromise[_0x3d66('0x73')](_0x4b7124,function(_0x2c4466){return db[_0x3d66('0x76')][_0x3d66('0x77')]({'where':{'UserId':_0x2c4466['id'],'VoiceQueueId':_0x4decb0[_0x3d66('0x5d')]['id']},'defaults':{'penalty':_0x2c4466[_0x3d66('0x71')]},'transaction':_0x565e25});});})['then'](function(){return BPromise['each'](_[_0x3d66('0x2c')](_0x4b7124,{'online':!![]}),function(_0x340901){return db[_0x3d66('0x78')][_0x3d66('0x75')]({'membername':_0x340901[_0x3d66('0x32')],'UserId':_0x340901['id'],'queue_name':_0x3a9929['name'],'VoiceQueueId':_0x3a9929['id'],'interface':_[_0x3d66('0x79')](_0x340901[_0x3d66('0x6f')])?util[_0x3d66('0x7a')](_0x3d66('0x7b'),_0x340901[_0x3d66('0x32')]):_0x340901[_0x3d66('0x6f')],'paused':_0x340901[_0x3d66('0x7c')]||![],'penalty':_0x340901[_0x3d66('0x71')]},{'transaction':_0x565e25});});})[_0x3d66('0x26')](function(){_0x4b7124[_0x3d66('0x7d')](function(_0x58da3f){socket[_0x3d66('0x7e')]('userVoiceQueue:save',{'UserId':_0x58da3f['id'],'VoiceQueueId':_0x3a9929['id']});});});});});}})[_0x3d66('0x26')](respondWithStatusCode(_0x35fae3,null))[_0x3d66('0x4d')](handleError(_0x35fae3,null));};exports[_0x3d66('0x7f')]=function(_0x3dc8b4,_0x21b545,_0x43ff52){return db[_0x3d66('0x6b')][_0x3d66('0x4b')]({'where':{'id':_0x3dc8b4[_0x3d66('0x3c')][_0x3d66('0x80')]},'attributes':['id'],'include':[{'model':db[_0x3d66('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21b545,null))[_0x3d66('0x26')](function(_0x48ddff){var _0x18291f=_[_0x3d66('0x2d')](_0x48ddff,'id');var _0x352506=[];var _0x132fd6=[];var _0x1f3194=squel[_0x3d66('0x81')]();_0x1f3194['field'](_0x3d66('0x82'))[_0x3d66('0x83')](_0x3d66('0x84'),'tq')[_0x3d66('0x85')](_0x3d66('0x86'),'ut',_0x3d66('0x87'))['where']('VoiceQueueId\x20=\x20?',_0x3dc8b4[_0x3d66('0x5d')]['id']);for(var _0x473de9=0x0;_0x473de9<_0x48ddff[_0x3d66('0x41')];_0x473de9+=0x1){let _0x267d74=_0x48ddff[_0x473de9];for(var _0x5c1355=0x0;_0x5c1355<_0x267d74[_0x3d66('0x6d')][_0x3d66('0x41')];_0x5c1355+=0x1){let _0x239f60=_0x267d74[_0x3d66('0x6d')][_0x5c1355];var _0x4797d5=_0x1f3194[_0x3d66('0x88')]();_0x4797d5['where'](_0x3d66('0x89'),_0x239f60['id']);_0x132fd6[_0x3d66('0x8a')](db[_0x3d66('0x8b')][_0x3d66('0x3c')](_0x4797d5['toString'](),{'type':db[_0x3d66('0x8b')]['QueryTypes']['SELECT']})[_0x3d66('0x26')](function(_0x78e756){if(_0x78e756[_0x3d66('0x41')]===0x1){return _0x239f60['id'];}else{var _0x6e246a=_[_0x3d66('0x8c')](_[_0x3d66('0x2d')](_0x78e756,_0x3d66('0x8d')),function(_0xe219b){return _[_0x3d66('0x2f')](_0x18291f,_0xe219b);});if(_0x6e246a){return _0x239f60['id'];}}}));}}return BPromise['all'](_0x132fd6)[_0x3d66('0x26')](function(_0x49a95b){_0x352506=_(_0x352506)[_0x3d66('0x8e')](_0x49a95b)['compact']()['value']();return db[_0x3d66('0x39')][_0x3d66('0x31')]({'where':{'id':_0x3dc8b4['params']['id']}})[_0x3d66('0x26')](function(_0x5dcf5e){return db['sequelize'][_0x3d66('0x72')](function(_0x445509){return _0x5dcf5e[_0x3d66('0x7f')](_0x3dc8b4[_0x3d66('0x3c')]['ids'],{'transaction':_0x445509})[_0x3d66('0x26')](function(){if(!_['isEmpty'](_0x352506)){return _0x5dcf5e[_0x3d66('0x8f')](_0x352506,{'transaction':_0x445509})['then'](function(){return db['UserVoiceQueueRt'][_0x3d66('0x5e')]({'where':{'VoiceQueueId':_0x3dc8b4[_0x3d66('0x5d')]['id'],'UserId':_0x352506},'transaction':_0x445509});});}})[_0x3d66('0x26')](function(){_0x352506[_0x3d66('0x7d')](function(_0x818cd){socket['emit'](_0x3d66('0x90'),{'UserId':_0x818cd,'VoiceQueueId':_0x5dcf5e['id']});});});});});});})[_0x3d66('0x26')](respondWithStatusCode(_0x21b545,null))[_0x3d66('0x4d')](handleError(_0x21b545,null));};exports[_0x3d66('0x91')]=function(_0x5be776,_0x24f841,_0x662d05){var _0x458148,_0x96ec99;return db[_0x3d66('0x39')][_0x3d66('0x31')]({'where':{'id':_0x5be776[_0x3d66('0x5d')]['id']}})['then'](handleEntityNotFound(_0x24f841,null))[_0x3d66('0x26')](function(_0xf72a6a){if(_0xf72a6a){_0x96ec99=_0xf72a6a;return _0xf72a6a[_0x3d66('0x91')](_0x5be776['body'][_0x3d66('0x80')],_[_0x3d66('0x59')](_0x5be776[_0x3d66('0x5a')],[_0x3d66('0x80'),'id'])||{})[_0x3d66('0x92')](function(_0x33795c){for(var _0x2a0c5c=0x0;_0x2a0c5c<_0x5be776['body'][_0x3d66('0x80')][_0x3d66('0x41')];_0x2a0c5c+=0x1){socket['emit'](_0x3d66('0x93'),{'UserId':Number(_0x5be776[_0x3d66('0x5a')][_0x3d66('0x80')][_0x2a0c5c]),'VoiceQueueId':Number(_0x5be776['params']['id'])});}return _0x33795c;});}})[_0x3d66('0x26')](function(_0x3d79f4){_0x458148=_0x3d79f4||[];if(_0x96ec99){return db[_0x3d66('0x6c')][_0x3d66('0x4b')]({'where':{'id':_0x5be776['body'][_0x3d66('0x80')]},'attributes':['id',_0x3d66('0x32'),_0x3d66('0x6e'),'voicePause',_0x3d66('0x6f')],'raw':!![]});}})[_0x3d66('0x26')](function(_0x27119a){if(!_['isEmpty'](_0x27119a)){var _0x4588cb=[];for(var _0x11bae4=0x0;_0x11bae4<_0x27119a[_0x3d66('0x41')];_0x11bae4++){if(_0x27119a[_0x11bae4]['online']){_0x4588cb[_0x3d66('0x8a')](db[_0x3d66('0x78')][_0x3d66('0x75')]({'membername':_0x27119a[_0x11bae4][_0x3d66('0x32')],'UserId':_0x27119a[_0x11bae4]['id'],'queue_name':_0x96ec99[_0x3d66('0x32')],'VoiceQueueId':_0x96ec99['id'],'interface':_[_0x3d66('0x79')](_0x27119a[_0x11bae4][_0x3d66('0x6f')])?util['format']('SIP/%s',_0x27119a[_0x11bae4][_0x3d66('0x32')]):_0x27119a[_0x11bae4][_0x3d66('0x6f')],'paused':_0x27119a[_0x11bae4][_0x3d66('0x7c')]||![],'penalty':_0x5be776['body']['penalty']||0x0}));}}return BPromise[_0x3d66('0x94')](_0x4588cb);}})[_0x3d66('0x26')](function(){return _0x458148;})[_0x3d66('0x26')](respondWithResult(_0x24f841,null))[_0x3d66('0x4d')](handleError(_0x24f841,null));};exports['removeAgents']=function(_0x1f797e,_0xf06f4d,_0x23e5b3){return db[_0x3d66('0x39')][_0x3d66('0x31')]({'where':{'id':_0x1f797e['params']['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0xf06f4d,null))[_0x3d66('0x26')](function(_0x2d94a5){if(_0x2d94a5){return _0x2d94a5[_0x3d66('0x8f')](_0x1f797e[_0x3d66('0x3c')][_0x3d66('0x80')])['then'](function(){if(_[_0x3d66('0x95')](_0x1f797e[_0x3d66('0x3c')]['ids'])){for(var _0x4db8e1=0x0;_0x4db8e1<_0x1f797e[_0x3d66('0x3c')][_0x3d66('0x80')][_0x3d66('0x41')];_0x4db8e1+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x1f797e[_0x3d66('0x3c')][_0x3d66('0x80')][_0x4db8e1]),'VoiceQueueId':Number(_0x1f797e['params']['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x1f797e['query']['ids']),'VoiceQueueId':Number(_0x1f797e[_0x3d66('0x5d')]['id'])});}});}})[_0x3d66('0x26')](function(_0x5b3de9){return db[_0x3d66('0x78')][_0x3d66('0x5e')]({'where':{'VoiceQueueId':_0x1f797e[_0x3d66('0x5d')]['id'],'UserId':_0x1f797e[_0x3d66('0x3c')][_0x3d66('0x80')]}})[_0x3d66('0x26')](function(){return _0x5b3de9;});})['then'](respondWithStatusCode(_0xf06f4d,null))['catch'](handleError(_0xf06f4d,null));};exports[_0x3d66('0x96')]=function(_0x5d0236,_0x3fa2b7,_0x4cecaf){var _0x4a677a={};var _0x54aad8={};var _0x28f3e2;var _0x96aa8d;return db[_0x3d66('0x39')][_0x3d66('0x60')]({'where':{'id':_0x5d0236[_0x3d66('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3fa2b7,null))[_0x3d66('0x26')](function(_0x2644e0){if(_0x2644e0){_0x28f3e2=_0x2644e0;_0x54aad8['model']=_[_0x3d66('0x3d')](db[_0x3d66('0x6c')][_0x3d66('0x3a')]);_0x54aad8[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x5d0236[_0x3d66('0x3c')]);_0x54aad8[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x54aad8[_0x3d66('0x3b')],_0x54aad8[_0x3d66('0x3c')]);_0x4a677a[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x54aad8['model'],qs['fields'](_0x5d0236[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0x4a677a[_0x3d66('0x40')]=_0x4a677a[_0x3d66('0x40')][_0x3d66('0x41')]?_0x4a677a['attributes']:_0x54aad8[_0x3d66('0x3b')];_0x4a677a[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x5d0236['query'][_0x3d66('0x45')]);_0x4a677a['where']=qs['filters'](_[_0x3d66('0x47')](_0x5d0236[_0x3d66('0x3c')],_0x54aad8[_0x3d66('0x3e')]));if(_0x5d0236[_0x3d66('0x3c')][_0x3d66('0x2c')]){_0x4a677a[_0x3d66('0x46')]=_[_0x3d66('0x48')](_0x4a677a['where'],{'$or':_[_0x3d66('0x2d')](_0x4a677a['attributes'],function(_0x4f1d76){var _0x4f6344={};_0x4f6344[_0x4f1d76]={'$like':'%'+_0x5d0236['query'][_0x3d66('0x2c')]+'%'};return _0x4f6344;})});}_0x4a677a=_['merge']({},_0x4a677a,_0x5d0236[_0x3d66('0x49')]);return _0x28f3e2[_0x3d66('0x96')](_0x4a677a);}})['then'](function(_0x2242ae){if(_0x2242ae){_0x96aa8d=_0x2242ae[_0x3d66('0x41')];if(!_0x5d0236[_0x3d66('0x3c')][_0x3d66('0x42')]('nolimit')){_0x4a677a[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x5d0236['query'][_0x3d66('0x1f')]);_0x4a677a[_0x3d66('0x1d')]=qs[_0x3d66('0x1d')](_0x5d0236[_0x3d66('0x3c')]['offset']);}return _0x28f3e2[_0x3d66('0x96')](_0x4a677a);}})[_0x3d66('0x26')](function(_0x52b06a){if(_0x52b06a){return _0x52b06a?{'count':_0x96aa8d,'rows':_0x52b06a}:null;}})[_0x3d66('0x26')](respondWithResult(_0x3fa2b7,null))[_0x3d66('0x4d')](handleError(_0x3fa2b7,null));};exports[_0x3d66('0x97')]=function(_0x405f2a,_0x220458,_0x50f8e0){var _0x4bf402={};var _0x5c1600={};var _0x13059e;var _0x1412e0;return db['VoiceQueue'][_0x3d66('0x60')]({'where':{'id':_0x405f2a[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x220458,null))[_0x3d66('0x26')](function(_0x93b251){if(_0x93b251){_0x13059e=_0x93b251;_0x5c1600['model']=_[_0x3d66('0x3d')](db[_0x3d66('0x78')][_0x3d66('0x3a')]);_0x5c1600['query']=_[_0x3d66('0x3d')](_0x405f2a[_0x3d66('0x3c')]);_0x5c1600[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x5c1600[_0x3d66('0x3b')],_0x5c1600[_0x3d66('0x3c')]);_0x4bf402['attributes']=_[_0x3d66('0x3f')](_0x5c1600['model'],qs[_0x3d66('0x4f')](_0x405f2a[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0x4bf402[_0x3d66('0x40')]=_0x4bf402[_0x3d66('0x40')][_0x3d66('0x41')]?_0x4bf402[_0x3d66('0x40')]:_0x5c1600[_0x3d66('0x3b')];_0x4bf402['order']=qs['sort'](_0x405f2a['query'][_0x3d66('0x45')]);_0x4bf402[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x405f2a[_0x3d66('0x3c')],_0x5c1600[_0x3d66('0x3e')]));if(_0x405f2a[_0x3d66('0x3c')]['filter']){_0x4bf402[_0x3d66('0x46')]=_['merge'](_0x4bf402[_0x3d66('0x46')],{'$or':_['map'](_0x4bf402[_0x3d66('0x40')],function(_0x2d1ad4){var _0x4fcb2a={};_0x4fcb2a[_0x2d1ad4]={'$like':'%'+_0x405f2a[_0x3d66('0x3c')]['filter']+'%'};return _0x4fcb2a;})});}_0x4bf402=_[_0x3d66('0x48')]({},_0x4bf402,_0x405f2a[_0x3d66('0x49')]);return _0x13059e[_0x3d66('0x97')](_0x4bf402);}})['then'](function(_0x360266){if(_0x360266){_0x1412e0=_0x360266[_0x3d66('0x41')];if(!_0x405f2a['query']['hasOwnProperty'](_0x3d66('0x43'))){_0x4bf402[_0x3d66('0x1f')]=qs['limit'](_0x405f2a[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x4bf402['offset']=qs['offset'](_0x405f2a[_0x3d66('0x3c')]['offset']);}return _0x13059e['getMembers'](_0x4bf402);}})['then'](function(_0x3c1a0a){return _0x3c1a0a?{'count':_0x1412e0,'rows':_0x3c1a0a}:null;})[_0x3d66('0x26')](respondWithResult(_0x220458,null))[_0x3d66('0x4d')](handleError(_0x220458,null));};exports[_0x3d66('0x98')]=function(_0x50243b,_0x12119c,_0xcf5b73){var _0xae8a14={};var _0x116f0b={};var _0xaa1817;var _0x1a58bd;return db[_0x3d66('0x39')][_0x3d66('0x60')]({'where':{'id':_0x50243b[_0x3d66('0x5d')]['id']}})['then'](handleEntityNotFound(_0x12119c,null))[_0x3d66('0x26')](function(_0x395e3f){if(_0x395e3f){_0xaa1817=_0x395e3f;_0x116f0b[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db['CmList'][_0x3d66('0x3a')]);_0x116f0b[_0x3d66('0x3c')]=_[_0x3d66('0x3d')](_0x50243b[_0x3d66('0x3c')]);_0x116f0b[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x116f0b[_0x3d66('0x3b')],_0x116f0b[_0x3d66('0x3c')]);_0xae8a14[_0x3d66('0x40')]=_[_0x3d66('0x3f')](_0x116f0b[_0x3d66('0x3b')],qs['fields'](_0x50243b[_0x3d66('0x3c')][_0x3d66('0x4f')]));_0xae8a14[_0x3d66('0x40')]=_0xae8a14[_0x3d66('0x40')][_0x3d66('0x41')]?_0xae8a14[_0x3d66('0x40')]:_0x116f0b[_0x3d66('0x3b')];_0xae8a14[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x50243b['query'][_0x3d66('0x45')]);_0xae8a14[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_[_0x3d66('0x47')](_0x50243b[_0x3d66('0x3c')],_0x116f0b['filters']));if(_0x50243b[_0x3d66('0x3c')]['filter']){_0xae8a14[_0x3d66('0x46')]=_[_0x3d66('0x48')](_0xae8a14['where'],{'$or':_[_0x3d66('0x2d')](_0xae8a14['attributes'],function(_0x4ec5a8){var _0x4cc785={};_0x4cc785[_0x4ec5a8]={'$like':'%'+_0x50243b['query'][_0x3d66('0x2c')]+'%'};return _0x4cc785;})});}_0xae8a14=_[_0x3d66('0x48')]({},_0xae8a14,_0x50243b[_0x3d66('0x49')]);return _0xaa1817['getLists'](_0xae8a14);}})[_0x3d66('0x26')](function(_0xfa9d30){if(_0xfa9d30){_0x1a58bd=_0xfa9d30[_0x3d66('0x41')];if(!_0x50243b[_0x3d66('0x3c')][_0x3d66('0x42')](_0x3d66('0x43'))){_0xae8a14[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x50243b[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0xae8a14[_0x3d66('0x1d')]=qs['offset'](_0x50243b[_0x3d66('0x3c')][_0x3d66('0x1d')]);}return _0xaa1817['getLists'](_0xae8a14);}})[_0x3d66('0x26')](function(_0x1b024b){if(_0x1b024b){return _0x1b024b?{'count':_0x1a58bd,'rows':_0x1b024b}:null;}})[_0x3d66('0x26')](respondWithResult(_0x12119c,null))[_0x3d66('0x4d')](handleError(_0x12119c,null));};exports[_0x3d66('0x99')]=function(_0x2aa8e7,_0x428bdc,_0x7fbd19){var _0x19b97d=moment()[_0x3d66('0x7a')](_0x3d66('0x9a'));var _0x18caf8,_0x5b7782;return db[_0x3d66('0x39')][_0x3d66('0x31')]({'where':{'id':_0x2aa8e7[_0x3d66('0x5d')]['id']}})['then'](handleEntityNotFound(_0x428bdc,null))[_0x3d66('0x26')](function(_0x3daff3){if(_0x3daff3){_0x5b7782=_0x3daff3;return _0x3daff3['addLists'](_0x2aa8e7['body']['ids'],_[_0x3d66('0x59')](_0x2aa8e7[_0x3d66('0x5a')],[_0x3d66('0x80'),'id'])||{});}return null;})[_0x3d66('0x92')](function(_0x26b86c){var _0x11bd08;_0x18caf8=_0x26b86c||[];var _0x198239=[];if(_0x26b86c){for(var _0x3d7037=0x0;_0x3d7037<_0x26b86c[_0x3d66('0x41')];_0x3d7037+=0x1){var _0x29a524=_0x26b86c[_0x3d7037][_0x3d66('0x27')]({'plain':!![]});_0x5b7782[_0x3d66('0x9b')]=_0x2aa8e7[_0x3d66('0x5a')]['dialCheckDuplicateType']?_0x2aa8e7[_0x3d66('0x5a')]['dialCheckDuplicateType']:_0x5b7782['dialCheckDuplicateType'];switch(_0x5b7782[_0x3d66('0x9b')]){case _0x3d66('0x9c'):_0x11bd08=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x3d66('0x9d'),_0x3d66('0x9e'),_0x3d66('0x9f'),_0x3d66('0x62'),_0x3d66('0x5b'),_0x3d66('0x5c')],squel['select']()[_0x3d66('0xa0')](_0x3d66('0xa1'),_0x3d66('0xa1'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27',_0x3d66('0x9d'))[_0x3d66('0xa0')]('id','ContactId')[_0x3d66('0xa0')](_0x29a524[_0x3d66('0xa2')][_0x3d66('0xa3')](),_0x3d66('0x9f'))[_0x3d66('0xa0')](_0x2aa8e7[_0x3d66('0x5d')]['id']['toString'](),_0x3d66('0x62'))['field']('\x27'+_0x19b97d+'\x27',_0x3d66('0x5b'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27',_0x3d66('0x5c'))[_0x3d66('0x83')](_0x3d66('0xa4'))[_0x3d66('0x46')]('deletedAt\x20IS\x20NULL')[_0x3d66('0x46')](_0x3d66('0xa5'),_0x29a524['CmListId'][_0x3d66('0xa3')]())[_0x3d66('0x46')](_0x3d66('0xa6'))[_0x3d66('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d66('0x81')]()['field'](_0x3d66('0xa7'))[_0x3d66('0x83')]('cm_hopper_final')[_0x3d66('0x46')](_0x3d66('0xa8'),_0x2aa8e7[_0x3d66('0x5d')]['id']['toString']()))[_0x3d66('0x46')](_0x3d66('0xa9'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x3d66('0x83')](_0x3d66('0xaa'))[_0x3d66('0x46')](_0x3d66('0xa8'),_0x2aa8e7['params']['id']['toString']())))['toString']();break;case _0x3d66('0xab'):_0x11bd08=squel[_0x3d66('0xac')]()[_0x3d66('0xad')](_0x3d66('0xaa'))[_0x3d66('0xae')](['phone',_0x3d66('0x9d'),'ContactId',_0x3d66('0x9f'),_0x3d66('0x62'),'createdAt',_0x3d66('0x5c')],squel[_0x3d66('0x81')]()[_0x3d66('0xa0')]('phone','phone')[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27','scheduledAt')[_0x3d66('0xa0')]('id',_0x3d66('0x9e'))['field'](_0x29a524['CmListId'][_0x3d66('0xa3')](),_0x3d66('0x9f'))['field'](_0x2aa8e7[_0x3d66('0x5d')]['id'][_0x3d66('0xa3')](),_0x3d66('0x62'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27',_0x3d66('0x5b'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27',_0x3d66('0x5c'))[_0x3d66('0x83')]('cm_contacts')[_0x3d66('0x46')](_0x3d66('0xaf'))['where']('ListId\x20=\x20?',_0x29a524[_0x3d66('0xa2')][_0x3d66('0xa3')]())['where'](_0x3d66('0xa6'))[_0x3d66('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3d66('0xa0')](_0x3d66('0xb0'))[_0x3d66('0x83')](_0x3d66('0xaa'))['where'](_0x3d66('0xa8'),_0x2aa8e7[_0x3d66('0x5d')]['id'][_0x3d66('0xa3')]())))[_0x3d66('0xa3')]();break;default:_0x11bd08=squel[_0x3d66('0xac')]()['into'](_0x3d66('0xaa'))[_0x3d66('0xae')]([_0x3d66('0xa1'),_0x3d66('0x9d'),_0x3d66('0x9e'),'ListId','VoiceQueueId',_0x3d66('0x5b'),_0x3d66('0x5c')],squel[_0x3d66('0x81')]()[_0x3d66('0xa0')](_0x3d66('0xa1'),'phone')['field']('\x27'+_0x19b97d+'\x27',_0x3d66('0x9d'))[_0x3d66('0xa0')]('id',_0x3d66('0x9e'))[_0x3d66('0xa0')](_0x29a524[_0x3d66('0xa2')][_0x3d66('0xa3')](),_0x3d66('0x9f'))[_0x3d66('0xa0')](_0x2aa8e7[_0x3d66('0x5d')]['id'][_0x3d66('0xa3')](),_0x3d66('0x62'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27','createdAt')['field']('\x27'+_0x19b97d+'\x27',_0x3d66('0x5c'))['from'](_0x3d66('0xa4'))[_0x3d66('0x46')](_0x3d66('0xaf'))[_0x3d66('0x46')](_0x3d66('0xa5'),_0x29a524[_0x3d66('0xa2')][_0x3d66('0xa3')]())[_0x3d66('0x46')](_0x3d66('0xa6')))[_0x3d66('0xa3')]();}_0x198239[_0x3d66('0x8a')](db[_0x3d66('0x8b')][_0x3d66('0x3c')](_0x11bd08));}return BPromise['all'](_0x198239);}})[_0x3d66('0x26')](function(){var _0x4e84b6=[];var _0x24cb6b=squel['insert']()[_0x3d66('0xad')](_0x3d66('0xb1'))[_0x3d66('0xae')]([_0x3d66('0xb2'),'phone',_0x3d66('0xb3'),'createdAt',_0x3d66('0x5c')],squel[_0x3d66('0x81')]()[_0x3d66('0xa0')]('h.id')[_0x3d66('0xa0')](_0x3d66('0xb4'))[_0x3d66('0xa0')]('ci.OrderBy+1')['field']('\x27'+_0x19b97d+'\x27',_0x3d66('0x5b'))[_0x3d66('0xa0')]('\x27'+_0x19b97d+'\x27',_0x3d66('0x5c'))[_0x3d66('0x83')]('cm_contact_has_items','ci')[_0x3d66('0x85')](_0x3d66('0xaa'),'h','h.ContactId=ci.CmContactId')['where'](_0x3d66('0xb5'),_0x19b97d)[_0x3d66('0x46')](_0x3d66('0xb6'),'PHONE'))['toString']();_0x4e84b6[_0x3d66('0x8a')](db[_0x3d66('0x8b')][_0x3d66('0x3c')](_0x24cb6b));return BPromise[_0x3d66('0x94')](_0x4e84b6);})[_0x3d66('0x26')](function(){return _0x18caf8;})[_0x3d66('0x26')](respondWithResult(_0x428bdc,null))[_0x3d66('0x4d')](handleError(_0x428bdc,null));};exports[_0x3d66('0xb7')]=function(_0x450b4b,_0x1f6163,_0x395421){return db[_0x3d66('0x39')][_0x3d66('0x31')]({'where':{'id':_0x450b4b['params']['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x1f6163,null))[_0x3d66('0x26')](function(_0x4b46e8){if(_0x4b46e8){return _0x4b46e8[_0x3d66('0xb7')](_0x450b4b[_0x3d66('0x3c')][_0x3d66('0x80')]);}})[_0x3d66('0x26')](function(_0x4e7b8e){if(_0x4e7b8e){return db[_0x3d66('0x61')]['destroy']({'where':{'ListId':_0x450b4b[_0x3d66('0x3c')]['ids'],'VoiceQueueId':_0x450b4b[_0x3d66('0x5d')]['id']}})['then'](function(){return _0x4e7b8e;});}})['then'](respondWithStatusCode(_0x1f6163,null))[_0x3d66('0x4d')](handleError(_0x1f6163,null));};exports[_0x3d66('0xb8')]=function(_0x14276f,_0x3c1166,_0x526d51){var _0x38f346={};var _0x3d7dcd={};var _0x44cf70;var _0x3d57a6;return db['VoiceQueue'][_0x3d66('0x60')]({'where':{'id':_0x14276f[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x3c1166,null))[_0x3d66('0x26')](function(_0x266457){if(_0x266457){_0x44cf70=_0x266457;_0x3d7dcd[_0x3d66('0x3b')]=_[_0x3d66('0x3d')](db[_0x3d66('0xb9')][_0x3d66('0x3a')]);_0x3d7dcd[_0x3d66('0x3c')]=_['keys'](_0x14276f['query']);_0x3d7dcd[_0x3d66('0x3e')]=_[_0x3d66('0x3f')](_0x3d7dcd[_0x3d66('0x3b')],_0x3d7dcd[_0x3d66('0x3c')]);_0x38f346[_0x3d66('0x40')]=_['intersection'](_0x3d7dcd['model'],qs[_0x3d66('0x4f')](_0x14276f[_0x3d66('0x3c')]['fields']));_0x38f346[_0x3d66('0x40')]=_0x38f346[_0x3d66('0x40')][_0x3d66('0x41')]?_0x38f346[_0x3d66('0x40')]:_0x3d7dcd['model'];_0x38f346[_0x3d66('0x44')]=qs[_0x3d66('0x45')](_0x14276f[_0x3d66('0x3c')][_0x3d66('0x45')]);_0x38f346[_0x3d66('0x46')]=qs[_0x3d66('0x3e')](_['pick'](_0x14276f['query'],_0x3d7dcd['filters']));if(_0x14276f[_0x3d66('0x3c')]['filter']){_0x38f346[_0x3d66('0x46')]=_['merge'](_0x38f346['where'],{'$or':_[_0x3d66('0x2d')](_0x38f346[_0x3d66('0x40')],function(_0x5b5d91){var _0x4afa6e={};_0x4afa6e[_0x5b5d91]={'$like':'%'+_0x14276f[_0x3d66('0x3c')]['filter']+'%'};return _0x4afa6e;})});}_0x38f346=_[_0x3d66('0x48')]({},_0x38f346,_0x14276f[_0x3d66('0x49')]);return _0x44cf70[_0x3d66('0xb8')](_0x38f346);}})['then'](function(_0x20ae7c){if(_0x20ae7c){_0x3d57a6=_0x20ae7c[_0x3d66('0x41')];if(!_0x14276f['query']['hasOwnProperty'](_0x3d66('0x43'))){_0x38f346[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x14276f[_0x3d66('0x3c')][_0x3d66('0x1f')]);_0x38f346[_0x3d66('0x1d')]=qs['offset'](_0x14276f['query']['offset']);}return _0x44cf70['getBlackLists'](_0x38f346);}})['then'](function(_0x4b1862){if(_0x4b1862){return _0x4b1862?{'count':_0x3d57a6,'rows':_0x4b1862}:null;}})[_0x3d66('0x26')](respondWithResult(_0x3c1166,null))[_0x3d66('0x4d')](handleError(_0x3c1166,null));};exports['addBlackLists']=function(_0x1ed4d0,_0x1c778c,_0x19ec3a){var _0x525cda,_0x102c54;return db[_0x3d66('0x39')]['find']({'where':{'id':_0x1ed4d0['params']['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x1c778c,null))['then'](function(_0x439421){if(_0x439421){_0x102c54=_0x439421;return _0x439421['addBlackLists'](_0x1ed4d0[_0x3d66('0x5a')][_0x3d66('0x80')],_[_0x3d66('0x59')](_0x1ed4d0[_0x3d66('0x5a')],[_0x3d66('0x80'),'id'])||{});}return null;})[_0x3d66('0x92')](function(_0x523321){var _0x11c078;_0x525cda=_0x523321||[];var _0x5309bd=[];if(_0x523321){for(var _0x1df470=0x0;_0x1df470<_0x523321['length'];_0x1df470+=0x1){var _0x4af147=_0x523321[_0x1df470][_0x3d66('0x27')]({'plain':!![]});_0x11c078=squel[_0x3d66('0xac')]()['into'](_0x3d66('0xba'))[_0x3d66('0xae')]([_0x3d66('0xa1'),_0x3d66('0x9e'),_0x3d66('0x9f'),_0x3d66('0x62'),_0x3d66('0x5b'),_0x3d66('0x5c')],squel[_0x3d66('0x81')]()['field']('phone',_0x3d66('0xa1'))[_0x3d66('0xa0')]('id',_0x3d66('0x9e'))[_0x3d66('0xa0')](_0x4af147[_0x3d66('0xa2')][_0x3d66('0xa3')](),_0x3d66('0x9f'))[_0x3d66('0xa0')](_0x1ed4d0['params']['id'][_0x3d66('0xa3')](),'VoiceQueueId')[_0x3d66('0xa0')]('NOW()',_0x3d66('0x5b'))[_0x3d66('0xa0')]('NOW()',_0x3d66('0x5c'))['from']('cm_contacts')[_0x3d66('0x46')](_0x3d66('0xaf'))[_0x3d66('0x46')](_0x3d66('0xa5'),_0x4af147[_0x3d66('0xa2')][_0x3d66('0xa3')]())[_0x3d66('0x46')](_0x3d66('0xa6')))[_0x3d66('0xa3')]();_0x5309bd[_0x3d66('0x8a')](db[_0x3d66('0x8b')][_0x3d66('0x3c')](_0x11c078));}return BPromise[_0x3d66('0x94')](_0x5309bd);}})['then'](function(){return _0x525cda;})[_0x3d66('0x26')](respondWithResult(_0x1c778c,null))[_0x3d66('0x4d')](handleError(_0x1c778c,null));};exports[_0x3d66('0xbb')]=function(_0x494e0d,_0x23a836,_0x23d849){return db[_0x3d66('0x39')]['find']({'where':{'id':_0x494e0d[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](handleEntityNotFound(_0x23a836,null))[_0x3d66('0x26')](function(_0x3fde6f){if(_0x3fde6f){return _0x3fde6f['removeBlackLists'](_0x494e0d[_0x3d66('0x3c')]['ids']);}})['then'](function(_0x5e8ee6){if(_0x5e8ee6){return db[_0x3d66('0x68')][_0x3d66('0x5e')]({'where':{'ListId':_0x494e0d['query'][_0x3d66('0x80')],'VoiceQueueId':_0x494e0d[_0x3d66('0x5d')]['id']}})[_0x3d66('0x26')](function(){return _0x5e8ee6;});}})[_0x3d66('0x26')](respondWithStatusCode(_0x23a836,null))[_0x3d66('0x4d')](handleError(_0x23a836,null));}; \ No newline at end of file +var _0x5419=['api','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','VoiceQueues','inbound','outbound','filter','ignore','value','type','name','UserProfileResource','error','stack','send','index','map','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','QueueCampaigns','getHoppers','findOne','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','forEach','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','penalty','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','online','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','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','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x5419,0x175));var _0x9541=function(_0x57f74a,_0x3f8b13){_0x57f74a=_0x57f74a-0x0;var _0x15b677=_0x5419[_0x57f74a];return _0x15b677;};'use strict';var emlformat=require(_0x9541('0x0'));var rimraf=require(_0x9541('0x1'));var zipdir=require(_0x9541('0x2'));var jsonpatch=require(_0x9541('0x3'));var rp=require(_0x9541('0x4'));var moment=require(_0x9541('0x5'));var BPromise=require(_0x9541('0x6'));var Mustache=require(_0x9541('0x7'));var util=require(_0x9541('0x8'));var path=require(_0x9541('0x9'));var sox=require('sox');var csv=require(_0x9541('0xa'));var ejs=require(_0x9541('0xb'));var fs=require('fs');var fs_extra=require(_0x9541('0xc'));var _=require(_0x9541('0xd'));var squel=require(_0x9541('0xe'));var crypto=require(_0x9541('0xf'));var jsforce=require(_0x9541('0x10'));var deskjs=require(_0x9541('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9541('0x12'));var Papa=require('papaparse');var Redis=require(_0x9541('0x13'));var authService=require(_0x9541('0x14'));var qs=require(_0x9541('0x15'));var as=require(_0x9541('0x16'));var hardwareService=require(_0x9541('0x17'));var logger=require(_0x9541('0x18'))(_0x9541('0x19'));var utils=require('../../config/utils');var config=require(_0x9541('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9541('0x1b')]=_['defaults'](config[_0x9541('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9541('0x1c'))(new Redis(config[_0x9541('0x1b')]));require(_0x9541('0x1d'))[_0x9541('0x1e')](socket);function respondWithStatusCode(_0x28316e,_0x4114bf){_0x4114bf=_0x4114bf||0xcc;return function(_0x551b66){if(_0x551b66){return _0x28316e[_0x9541('0x1f')](_0x4114bf);}return _0x28316e['status'](_0x4114bf)[_0x9541('0x20')]();};}function respondWithResult(_0x569b6d,_0x421985){_0x421985=_0x421985||0xc8;return function(_0x5ad2f5){if(_0x5ad2f5){return _0x569b6d[_0x9541('0x21')](_0x421985)[_0x9541('0x22')](_0x5ad2f5);}};}function respondWithFilteredResult(_0xcc7699,_0x3eda42){return function(_0xf5a87e){if(_0xf5a87e){var _0x43238e=typeof _0x3eda42['offset']==='undefined'&&typeof _0x3eda42[_0x9541('0x23')]===_0x9541('0x24');var _0x594ba4=_0xf5a87e['count'];var _0x2aafdb=_0x43238e?0x0:_0x3eda42[_0x9541('0x25')];var _0x2417e4=_0x43238e?_0xf5a87e[_0x9541('0x26')]:_0x3eda42[_0x9541('0x25')]+_0x3eda42[_0x9541('0x23')];var _0xf225bb;if(_0x2417e4>=_0x594ba4){_0x2417e4=_0x594ba4;_0xf225bb=0xc8;}else{_0xf225bb=0xce;}_0xcc7699[_0x9541('0x21')](_0xf225bb);return _0xcc7699[_0x9541('0x27')](_0x9541('0x28'),_0x2aafdb+'-'+_0x2417e4+'/'+_0x594ba4)[_0x9541('0x22')](_0xf5a87e);}return null;};}function patchUpdates(_0x54a827){return function(_0x30b08b){try{jsonpatch[_0x9541('0x29')](_0x30b08b,_0x54a827,!![]);}catch(_0x41abc5){return BPromise[_0x9541('0x2a')](_0x41abc5);}return _0x30b08b[_0x9541('0x2b')]();};}function saveUpdates(_0x2f6b0a,_0x1b5adb){return function(_0x451013){if(_0x451013){return _0x451013[_0x9541('0x2c')](_0x2f6b0a)['then'](function(_0x35ec2c){return _0x35ec2c;});}return null;};}function removeEntity(_0x48987e,_0xbaf6cb){return function(_0x10fafe){if(_0x10fafe){return _0x10fafe[_0x9541('0x2d')]()[_0x9541('0x2e')](function(){var _0x4b6faf=_0x10fafe[_0x9541('0x2f')]({'plain':!![]});var _0x46ea7e=[{'name':_0x9541('0x30'),'value':_0x9541('0x31'),'ignore':![]},{'name':'QueueCampaigns','value':_0x9541('0x32'),'ignore':![]}];var _0x56645d=_(_0x46ea7e)[_0x9541('0x33')](_0x9541('0x34'))['map'](_0x9541('0x35'))[_0x9541('0x35')]();if(_['includes'](_0x56645d,_0x4b6faf[_0x9541('0x36')])){return;}var _0xda879d=_['find'](_0x46ea7e,[_0x9541('0x35'),_0x4b6faf['type']])[_0x9541('0x37')];return db[_0x9541('0x38')][_0x9541('0x2d')]({'where':{'type':_0xda879d,'resourceId':_0x4b6faf['id']}})[_0x9541('0x2e')](function(){return _0x10fafe;});})[_0x9541('0x2e')](function(){_0x48987e[_0x9541('0x21')](0xcc)[_0x9541('0x20')]();});}};}function handleEntityNotFound(_0x575c1c,_0xfb7156){return function(_0x451816){if(!_0x451816){_0x575c1c[_0x9541('0x1f')](0x194);}return _0x451816;};}function handleError(_0x299f03,_0x47443c){_0x47443c=_0x47443c||0x1f4;return function(_0x19c3e3){logger[_0x9541('0x39')](_0x19c3e3[_0x9541('0x3a')]);if(_0x19c3e3[_0x9541('0x37')]){delete _0x19c3e3[_0x9541('0x37')];}_0x299f03[_0x9541('0x21')](_0x47443c)[_0x9541('0x3b')](_0x19c3e3);};}exports[_0x9541('0x3c')]=function(_0x1275da,_0x63a068){var _0x1957f6={},_0x2d4611={},_0xe9b68f={'count':0x0,'rows':[]};var _0x43d4ea=_[_0x9541('0x3d')](db['VoiceQueue'][_0x9541('0x3e')],function(_0x4bf7ad){return{'name':_0x4bf7ad['fieldName'],'type':_0x4bf7ad['type']['key']};});_0x2d4611[_0x9541('0x3f')]=_[_0x9541('0x3d')](_0x43d4ea,_0x9541('0x37'));_0x2d4611['query']=_[_0x9541('0x40')](_0x1275da[_0x9541('0x41')]);_0x2d4611['filters']=_[_0x9541('0x42')](_0x2d4611[_0x9541('0x3f')],_0x2d4611[_0x9541('0x41')]);_0x1957f6[_0x9541('0x43')]=_[_0x9541('0x42')](_0x2d4611[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x1275da[_0x9541('0x41')][_0x9541('0x44')]));_0x1957f6[_0x9541('0x43')]=_0x1957f6['attributes']['length']?_0x1957f6[_0x9541('0x43')]:_0x2d4611[_0x9541('0x3f')];if(!_0x1275da[_0x9541('0x41')][_0x9541('0x45')](_0x9541('0x46'))){_0x1957f6[_0x9541('0x23')]=qs[_0x9541('0x23')](_0x1275da[_0x9541('0x41')][_0x9541('0x23')]);_0x1957f6['offset']=qs[_0x9541('0x25')](_0x1275da['query'][_0x9541('0x25')]);}_0x1957f6[_0x9541('0x47')]=qs[_0x9541('0x48')](_0x1275da[_0x9541('0x41')]['sort']);_0x1957f6[_0x9541('0x49')]=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x1275da[_0x9541('0x41')],_0x2d4611[_0x9541('0x4a')]),_0x43d4ea);if(_0x1275da[_0x9541('0x41')][_0x9541('0x33')]){_0x1957f6[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x1957f6['where'],{'$or':_['map'](_0x43d4ea,function(_0x41b5d6){if(_0x41b5d6[_0x9541('0x36')]!==_0x9541('0x4d')){var _0x5e9c1a={};_0x5e9c1a[_0x41b5d6[_0x9541('0x37')]]={'$like':'%'+_0x1275da['query'][_0x9541('0x33')]+'%'};return _0x5e9c1a;}})});}_0x1957f6=_['merge']({},_0x1957f6,_0x1275da[_0x9541('0x4e')]);var _0x309f5c={'where':_0x1957f6[_0x9541('0x49')]};return db[_0x9541('0x4f')]['count'](_0x309f5c)[_0x9541('0x2e')](function(_0x2bbd04){_0xe9b68f[_0x9541('0x26')]=_0x2bbd04;if(_0x1275da['query'][_0x9541('0x50')]){_0x1957f6[_0x9541('0x51')]=[{'all':!![]}];}return db[_0x9541('0x4f')][_0x9541('0x52')](_0x1957f6);})['then'](function(_0x531890){_0xe9b68f['rows']=_0x531890;return _0xe9b68f;})['then'](respondWithFilteredResult(_0x63a068,_0x1957f6))[_0x9541('0x53')](handleError(_0x63a068,null));};exports[_0x9541('0x54')]=function(_0x3681b9,_0x38d9fa){var _0x283a35={'raw':![],'where':{'id':_0x3681b9[_0x9541('0x55')]['id']}},_0x593b9f={};_0x593b9f[_0x9541('0x3f')]=_[_0x9541('0x40')](db['VoiceQueue']['rawAttributes']);_0x593b9f[_0x9541('0x41')]=_[_0x9541('0x40')](_0x3681b9[_0x9541('0x41')]);_0x593b9f['filters']=_['intersection'](_0x593b9f[_0x9541('0x3f')],_0x593b9f[_0x9541('0x41')]);_0x283a35[_0x9541('0x43')]=_[_0x9541('0x42')](_0x593b9f[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x3681b9[_0x9541('0x41')]['fields']));_0x283a35[_0x9541('0x43')]=_0x283a35[_0x9541('0x43')]['length']?_0x283a35['attributes']:_0x593b9f[_0x9541('0x3f')];if(_0x3681b9[_0x9541('0x41')][_0x9541('0x50')]){_0x283a35[_0x9541('0x51')]=[{'all':!![]}];}_0x283a35=_[_0x9541('0x4c')]({},_0x283a35,_0x3681b9[_0x9541('0x4e')]);return db[_0x9541('0x4f')]['find'](_0x283a35)['then'](handleEntityNotFound(_0x38d9fa,null))[_0x9541('0x2e')](respondWithResult(_0x38d9fa,null))['catch'](handleError(_0x38d9fa,null));};exports[_0x9541('0x56')]=function(_0x24a316,_0x10c23d){return db['VoiceQueue'][_0x9541('0x56')](_0x24a316[_0x9541('0x57')],{})[_0x9541('0x2e')](function(_0x6c85e4){var _0x3c7385=_0x24a316[_0x9541('0x58')][_0x9541('0x2f')]({'plain':!![]});if(!_0x3c7385)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c7385[_0x9541('0x59')]==='user'){var _0x278d80=_0x6c85e4[_0x9541('0x2f')]({'plain':!![]});var _0x578f66=[{'name':_0x9541('0x30'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x9541('0x32')}];var _0x3d9f7c=_['find'](_0x578f66,[_0x9541('0x35'),_0x278d80[_0x9541('0x36')]])[_0x9541('0x37')];return db[_0x9541('0x5a')][_0x9541('0x5b')]({'where':{'name':_0x3d9f7c,'userProfileId':_0x3c7385[_0x9541('0x5c')]},'raw':!![]})[_0x9541('0x2e')](function(_0x13e98c){if(_0x13e98c&&_0x13e98c[_0x9541('0x5d')]===0x0){return db['UserProfileResource'][_0x9541('0x56')]({'name':_0x278d80[_0x9541('0x37')],'resourceId':_0x278d80['id'],'type':_0x13e98c[_0x9541('0x37')],'sectionId':_0x13e98c['id']},{})[_0x9541('0x2e')](function(){return _0x6c85e4;});}else{return _0x6c85e4;}})[_0x9541('0x53')](function(_0x24e77a){logger[_0x9541('0x39')](_0x9541('0x5e'),_0x24e77a);throw _0x24e77a;});}return _0x6c85e4;})['then'](respondWithResult(_0x10c23d,0xc9))[_0x9541('0x53')](handleError(_0x10c23d,null));};exports['clone']=function(_0x4aa097,_0x1ad597){var _0x1ce01b={'where':{'id':_0x4aa097['params']['id']}},_0x4c280c={};_0x4c280c['model']=_['keys'](db[_0x9541('0x4f')]['rawAttributes']);_0x1ce01b[_0x9541('0x43')]=_[_0x9541('0x42')](_0x4c280c[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x4aa097[_0x9541('0x41')][_0x9541('0x44')]));_0x1ce01b[_0x9541('0x43')]=_0x1ce01b[_0x9541('0x43')][_0x9541('0x5f')]?_0x1ce01b[_0x9541('0x43')]:_0x4c280c[_0x9541('0x3f')];if(_0x4aa097['query'][_0x9541('0x50')]){_0x1ce01b['include']=[{'all':!![]}];}_0x1ce01b=_['merge']({},_0x1ce01b,_0x4aa097[_0x9541('0x4e')]);return db[_0x9541('0x4f')][_0x9541('0x5b')](_0x1ce01b)[_0x9541('0x2e')](handleEntityNotFound(_0x1ad597,null))[_0x9541('0x2e')](function(_0x207321){if(_0x207321){var _0x2d6848=_0x207321[_0x9541('0x2f')]({'plain':!![]});_0x2d6848=qs[_0x9541('0x60')](_0x2d6848,['id',_0x9541('0x61'),_0x9541('0x62')]);_0x4aa097[_0x9541('0x57')]=_[_0x9541('0x60')](_0x4aa097[_0x9541('0x57')],['id',_0x9541('0x61'),_0x9541('0x62')]);return db[_0x9541('0x4f')][_0x9541('0x56')](_[_0x9541('0x4c')](_0x2d6848,_0x4aa097[_0x9541('0x57')]),{'include':_0x4aa097[_0x9541('0x41')][_0x9541('0x50')]?[{'all':!![]}]:undefined})['then'](function(_0x386fb0){var _0x396869=_0x4aa097['user']['get']({'plain':!![]});if(!_0x396869)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x396869[_0x9541('0x59')]===_0x9541('0x58')){var _0x22b7b8=_0x386fb0[_0x9541('0x2f')]({'plain':!![]});var _0x4aac14=[{'name':_0x9541('0x30'),'value':_0x9541('0x31')},{'name':_0x9541('0x63'),'value':_0x9541('0x32')}];var _0x3cdcc4=_[_0x9541('0x5b')](_0x4aac14,['value',_0x22b7b8[_0x9541('0x36')]])[_0x9541('0x37')];return db['UserProfileSection']['find']({'where':{'name':_0x3cdcc4,'userProfileId':_0x396869['userProfileId']},'raw':!![]})['then'](function(_0x47d5cb){if(_0x47d5cb&&_0x47d5cb['autoAssociation']===0x0){return db[_0x9541('0x38')][_0x9541('0x56')]({'name':_0x22b7b8[_0x9541('0x37')],'resourceId':_0x22b7b8['id'],'type':_0x47d5cb['name'],'sectionId':_0x47d5cb['id']},{})[_0x9541('0x2e')](function(){return _0x386fb0;});}else{return _0x386fb0;}})[_0x9541('0x53')](function(_0x16c8d8){logger[_0x9541('0x39')](_0x9541('0x5e'),_0x16c8d8);throw _0x16c8d8;});}return _0x386fb0;});}})[_0x9541('0x2e')](respondWithResult(_0x1ad597,0xc9))[_0x9541('0x53')](handleError(_0x1ad597,null));};exports[_0x9541('0x2c')]=function(_0x2348bf,_0x25c486){if(_0x2348bf[_0x9541('0x57')]['id']){delete _0x2348bf[_0x9541('0x57')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x2348bf[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0x25c486,null))[_0x9541('0x2e')](saveUpdates(_0x2348bf[_0x9541('0x57')],null))['then'](respondWithResult(_0x25c486,null))[_0x9541('0x53')](handleError(_0x25c486,null));};exports[_0x9541('0x2d')]=function(_0x557cf5,_0x1585ea){return db['VoiceQueue'][_0x9541('0x5b')]({'where':{'id':_0x557cf5['params']['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x1585ea,null))[_0x9541('0x2e')](removeEntity(_0x1585ea,null))[_0x9541('0x53')](handleError(_0x1585ea,null));};exports[_0x9541('0x64')]=function(_0x4868f6,_0x1ef053,_0x51b190){var _0x3d0e8c={'raw':![],'where':{}};var _0x489962={};var _0x130c19={'count':0x0,'rows':[]};return db[_0x9541('0x4f')][_0x9541('0x65')]({'where':{'id':_0x4868f6[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x1ef053,null))[_0x9541('0x2e')](function(_0x265a75){if(_0x265a75){_0x489962[_0x9541('0x3f')]=_[_0x9541('0x40')](db['CmHopper'][_0x9541('0x3e')]);_0x489962[_0x9541('0x41')]=_[_0x9541('0x40')](_0x4868f6[_0x9541('0x41')]);_0x489962['filters']=_[_0x9541('0x42')](_0x489962['model'],_0x489962[_0x9541('0x41')]);_0x3d0e8c[_0x9541('0x43')]=_[_0x9541('0x42')](_0x489962[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x4868f6['query'][_0x9541('0x44')]));_0x3d0e8c[_0x9541('0x43')]=_0x3d0e8c[_0x9541('0x43')][_0x9541('0x5f')]?_0x3d0e8c[_0x9541('0x43')]:_0x489962[_0x9541('0x3f')];if(!_0x4868f6[_0x9541('0x41')][_0x9541('0x45')](_0x9541('0x46'))){_0x3d0e8c['limit']=qs[_0x9541('0x23')](_0x4868f6['query'][_0x9541('0x23')]);_0x3d0e8c[_0x9541('0x25')]=qs[_0x9541('0x25')](_0x4868f6['query'][_0x9541('0x25')]);}_0x3d0e8c['order']=qs['sort'](_0x4868f6['query'][_0x9541('0x48')]);_0x3d0e8c[_0x9541('0x49')]=qs['filters'](_[_0x9541('0x4b')](_0x4868f6[_0x9541('0x41')],_0x489962['filters']));_0x3d0e8c[_0x9541('0x49')][_0x9541('0x66')]=_0x265a75['id'];if(_0x4868f6['query']['filter']){_0x3d0e8c[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x3d0e8c[_0x9541('0x49')],{'$or':_['map'](_0x3d0e8c[_0x9541('0x43')],function(_0x17567a){var _0x46bd09={};_0x46bd09[_0x17567a]={'$like':'%'+_0x4868f6[_0x9541('0x41')][_0x9541('0x33')]+'%'};return _0x46bd09;})});}_0x3d0e8c=_[_0x9541('0x4c')]({},_0x3d0e8c,_0x4868f6[_0x9541('0x4e')]);return db[_0x9541('0x67')]['count']({'where':_0x3d0e8c['where']})[_0x9541('0x2e')](function(_0x1af68e){_0x130c19[_0x9541('0x26')]=_0x1af68e;if(_0x4868f6[_0x9541('0x41')][_0x9541('0x50')]){_0x3d0e8c[_0x9541('0x51')]=[{'all':!![]}];}return db[_0x9541('0x67')]['findAll'](_0x3d0e8c);})['then'](function(_0x2fa48a){_0x130c19[_0x9541('0x68')]=_0x2fa48a;return _0x130c19;});}})[_0x9541('0x2e')](respondWithFilteredResult(_0x1ef053,_0x3d0e8c))['catch'](handleError(_0x1ef053,null));};exports[_0x9541('0x69')]=function(_0x5d8d48,_0x43a18e,_0x137745){var _0x15d1db={'raw':!![],'where':{}};var _0x586a00={};var _0x422c29={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9541('0x65')]({'where':{'id':_0x5d8d48[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a18e,null))[_0x9541('0x2e')](function(_0x448941){if(_0x448941){_0x586a00[_0x9541('0x3f')]=_[_0x9541('0x40')](db[_0x9541('0x6a')][_0x9541('0x3e')]);_0x586a00['query']=_[_0x9541('0x40')](_0x5d8d48[_0x9541('0x41')]);_0x586a00[_0x9541('0x4a')]=_['intersection'](_0x586a00[_0x9541('0x3f')],_0x586a00['query']);_0x15d1db[_0x9541('0x43')]=_[_0x9541('0x42')](_0x586a00[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x5d8d48[_0x9541('0x41')]['fields']));_0x15d1db[_0x9541('0x43')]=_0x15d1db[_0x9541('0x43')][_0x9541('0x5f')]?_0x15d1db[_0x9541('0x43')]:_0x586a00['model'];if(!_0x5d8d48['query'][_0x9541('0x45')](_0x9541('0x46'))){_0x15d1db['limit']=qs[_0x9541('0x23')](_0x5d8d48['query']['limit']);_0x15d1db['offset']=qs[_0x9541('0x25')](_0x5d8d48[_0x9541('0x41')][_0x9541('0x25')]);}_0x15d1db[_0x9541('0x47')]=qs['sort'](_0x5d8d48[_0x9541('0x41')][_0x9541('0x48')]);_0x15d1db[_0x9541('0x49')]=qs['filters'](_[_0x9541('0x4b')](_0x5d8d48[_0x9541('0x41')],_0x586a00['filters']));_0x15d1db[_0x9541('0x49')][_0x9541('0x66')]=_0x448941['id'];if(_0x5d8d48['query'][_0x9541('0x33')]){_0x15d1db[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x15d1db[_0x9541('0x49')],{'$or':_['map'](_0x15d1db[_0x9541('0x43')],function(_0x1c634a){var _0x44dda1={};_0x44dda1[_0x1c634a]={'$like':'%'+_0x5d8d48[_0x9541('0x41')]['filter']+'%'};return _0x44dda1;})});}_0x15d1db=_['merge']({},_0x15d1db,_0x5d8d48[_0x9541('0x4e')]);return db['CmHopperHistory']['count']({'where':_0x15d1db[_0x9541('0x49')]})[_0x9541('0x2e')](function(_0x5a74be){_0x422c29['count']=_0x5a74be;if(_0x5d8d48[_0x9541('0x41')][_0x9541('0x50')]){_0x15d1db[_0x9541('0x51')]=[{'all':!![]}];}return db[_0x9541('0x6a')]['findAll'](_0x15d1db);})['then'](function(_0x43f62b){_0x422c29[_0x9541('0x68')]=_0x43f62b;return _0x422c29;});}})['then'](respondWithFilteredResult(_0x43a18e,_0x15d1db))[_0x9541('0x53')](handleError(_0x43a18e,null));};exports['getHopperFinals']=function(_0xc759e5,_0xf03be4,_0x137bec){var _0x4153e3={'raw':!![],'where':{}};var _0x4bc0f6={};var _0x29f08e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xc759e5[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0xf03be4,null))[_0x9541('0x2e')](function(_0x1b4737){if(_0x1b4737){_0x4bc0f6[_0x9541('0x3f')]=_[_0x9541('0x40')](db['CmHopperFinal'][_0x9541('0x3e')]);_0x4bc0f6[_0x9541('0x41')]=_[_0x9541('0x40')](_0xc759e5[_0x9541('0x41')]);_0x4bc0f6['filters']=_[_0x9541('0x42')](_0x4bc0f6[_0x9541('0x3f')],_0x4bc0f6['query']);_0x4153e3[_0x9541('0x43')]=_[_0x9541('0x42')](_0x4bc0f6[_0x9541('0x3f')],qs['fields'](_0xc759e5['query'][_0x9541('0x44')]));_0x4153e3[_0x9541('0x43')]=_0x4153e3[_0x9541('0x43')][_0x9541('0x5f')]?_0x4153e3[_0x9541('0x43')]:_0x4bc0f6['model'];if(!_0xc759e5[_0x9541('0x41')][_0x9541('0x45')](_0x9541('0x46'))){_0x4153e3['limit']=qs[_0x9541('0x23')](_0xc759e5[_0x9541('0x41')][_0x9541('0x23')]);_0x4153e3[_0x9541('0x25')]=qs[_0x9541('0x25')](_0xc759e5['query'][_0x9541('0x25')]);}_0x4153e3[_0x9541('0x47')]=qs['sort'](_0xc759e5[_0x9541('0x41')][_0x9541('0x48')]);_0x4153e3[_0x9541('0x49')]=qs[_0x9541('0x4a')](_['pick'](_0xc759e5['query'],_0x4bc0f6['filters']));_0x4153e3[_0x9541('0x49')][_0x9541('0x66')]=_0x1b4737['id'];if(_0xc759e5[_0x9541('0x41')]['filter']){_0x4153e3[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x4153e3[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x4153e3['attributes'],function(_0x16e5d6){var _0x24810e={};_0x24810e[_0x16e5d6]={'$like':'%'+_0xc759e5['query']['filter']+'%'};return _0x24810e;})});}_0x4153e3=_[_0x9541('0x4c')]({},_0x4153e3,_0xc759e5[_0x9541('0x4e')]);return db['CmHopperFinal']['count']({'where':_0x4153e3[_0x9541('0x49')]})['then'](function(_0xe0d0b1){_0x29f08e[_0x9541('0x26')]=_0xe0d0b1;if(_0xc759e5[_0x9541('0x41')][_0x9541('0x50')]){_0x4153e3['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x9541('0x52')](_0x4153e3);})['then'](function(_0x267753){_0x29f08e['rows']=_0x267753;return _0x29f08e;});}})[_0x9541('0x2e')](respondWithFilteredResult(_0xf03be4,_0x4153e3))[_0x9541('0x53')](handleError(_0xf03be4,null));};exports['getHopperBlacks']=function(_0x47833c,_0x3ada67,_0x55be8b){var _0x1e3f3f={'raw':!![],'where':{}};var _0x1b677c={};var _0x49d945={'count':0x0,'rows':[]};return db[_0x9541('0x4f')][_0x9541('0x65')]({'where':{'id':_0x47833c[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x3ada67,null))['then'](function(_0x53e51f){if(_0x53e51f){_0x1b677c[_0x9541('0x3f')]=_[_0x9541('0x40')](db[_0x9541('0x6b')]['rawAttributes']);_0x1b677c[_0x9541('0x41')]=_['keys'](_0x47833c[_0x9541('0x41')]);_0x1b677c[_0x9541('0x4a')]=_[_0x9541('0x42')](_0x1b677c[_0x9541('0x3f')],_0x1b677c['query']);_0x1e3f3f['attributes']=_[_0x9541('0x42')](_0x1b677c[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x47833c[_0x9541('0x41')][_0x9541('0x44')]));_0x1e3f3f[_0x9541('0x43')]=_0x1e3f3f['attributes'][_0x9541('0x5f')]?_0x1e3f3f['attributes']:_0x1b677c[_0x9541('0x3f')];if(!_0x47833c['query'][_0x9541('0x45')](_0x9541('0x46'))){_0x1e3f3f[_0x9541('0x23')]=qs[_0x9541('0x23')](_0x47833c[_0x9541('0x41')][_0x9541('0x23')]);_0x1e3f3f[_0x9541('0x25')]=qs[_0x9541('0x25')](_0x47833c[_0x9541('0x41')][_0x9541('0x25')]);}_0x1e3f3f['order']=qs[_0x9541('0x48')](_0x47833c[_0x9541('0x41')][_0x9541('0x48')]);_0x1e3f3f[_0x9541('0x49')]=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x47833c[_0x9541('0x41')],_0x1b677c[_0x9541('0x4a')]));_0x1e3f3f[_0x9541('0x49')][_0x9541('0x66')]=_0x53e51f['id'];if(_0x47833c[_0x9541('0x41')][_0x9541('0x33')]){_0x1e3f3f[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x1e3f3f[_0x9541('0x49')],{'$or':_['map'](_0x1e3f3f[_0x9541('0x43')],function(_0x4a5ee9){var _0x1d627d={};_0x1d627d[_0x4a5ee9]={'$like':'%'+_0x47833c['query'][_0x9541('0x33')]+'%'};return _0x1d627d;})});}_0x1e3f3f=_[_0x9541('0x4c')]({},_0x1e3f3f,_0x47833c['options']);return db[_0x9541('0x6b')][_0x9541('0x26')]({'where':_0x1e3f3f['where']})[_0x9541('0x2e')](function(_0x4dcf5c){_0x49d945[_0x9541('0x26')]=_0x4dcf5c;if(_0x47833c[_0x9541('0x41')][_0x9541('0x50')]){_0x1e3f3f[_0x9541('0x51')]=[{'all':!![]}];}return db[_0x9541('0x6b')][_0x9541('0x52')](_0x1e3f3f);})[_0x9541('0x2e')](function(_0x5366f8){_0x49d945[_0x9541('0x68')]=_0x5366f8;return _0x49d945;});}})[_0x9541('0x2e')](respondWithFilteredResult(_0x3ada67,_0x1e3f3f))[_0x9541('0x53')](handleError(_0x3ada67,null));};exports[_0x9541('0x6c')]=function(_0x416aba,_0x126f0c,_0x2b5278){var _0x1a0d7c={};var _0x1bc9bb={};var _0x46ccb8;var _0x5ce36f;return db[_0x9541('0x4f')][_0x9541('0x65')]({'where':{'id':_0x416aba[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x126f0c,null))[_0x9541('0x2e')](function(_0x5e915){if(_0x5e915){_0x46ccb8=_0x5e915;_0x1bc9bb[_0x9541('0x3f')]=_[_0x9541('0x40')](db[_0x9541('0x6d')][_0x9541('0x3e')]);_0x1bc9bb[_0x9541('0x41')]=_[_0x9541('0x40')](_0x416aba['query']);_0x1bc9bb['filters']=_[_0x9541('0x42')](_0x1bc9bb[_0x9541('0x3f')],_0x1bc9bb['query']);_0x1a0d7c['attributes']=_[_0x9541('0x42')](_0x1bc9bb[_0x9541('0x3f')],qs['fields'](_0x416aba['query'][_0x9541('0x44')]));_0x1a0d7c[_0x9541('0x43')]=_0x1a0d7c[_0x9541('0x43')][_0x9541('0x5f')]?_0x1a0d7c[_0x9541('0x43')]:_0x1bc9bb[_0x9541('0x3f')];_0x1a0d7c[_0x9541('0x47')]=qs[_0x9541('0x48')](_0x416aba[_0x9541('0x41')][_0x9541('0x48')]);_0x1a0d7c[_0x9541('0x49')]=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x416aba[_0x9541('0x41')],_0x1bc9bb[_0x9541('0x4a')]));if(_0x416aba[_0x9541('0x41')][_0x9541('0x33')]){_0x1a0d7c['where']=_[_0x9541('0x4c')](_0x1a0d7c[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x1a0d7c[_0x9541('0x43')],function(_0x12db86){var _0x405e1d={};_0x405e1d[_0x12db86]={'$like':'%'+_0x416aba[_0x9541('0x41')]['filter']+'%'};return _0x405e1d;})});}_0x1a0d7c=_[_0x9541('0x4c')]({},_0x1a0d7c,_0x416aba[_0x9541('0x4e')]);return _0x46ccb8[_0x9541('0x6c')](_0x1a0d7c);}})[_0x9541('0x2e')](function(_0xca4964){if(_0xca4964){_0x5ce36f=_0xca4964[_0x9541('0x5f')];if(!_0x416aba[_0x9541('0x41')][_0x9541('0x45')](_0x9541('0x46'))){_0x1a0d7c['limit']=qs[_0x9541('0x23')](_0x416aba[_0x9541('0x41')][_0x9541('0x23')]);_0x1a0d7c['offset']=qs[_0x9541('0x25')](_0x416aba['query'][_0x9541('0x25')]);}return _0x46ccb8['getTeams'](_0x1a0d7c);}})[_0x9541('0x2e')](function(_0x70baa9){if(_0x70baa9){return _0x70baa9?{'count':_0x5ce36f,'rows':_0x70baa9}:null;}})['then'](respondWithResult(_0x126f0c,null))[_0x9541('0x53')](handleError(_0x126f0c,null));};exports[_0x9541('0x6e')]=function(_0x3ac566,_0x46b842,_0xe8b755){var _0x1bc42b=_0x3ac566[_0x9541('0x57')][_0x9541('0x6f')];var _0x5ef2e3=_['map'](_0x1bc42b,'id');return db['Team'][_0x9541('0x52')]({'where':{'id':_0x5ef2e3},'attributes':['id'],'include':[{'model':db[_0x9541('0x70')],'as':_0x9541('0x71'),'attributes':['id',_0x9541('0x37'),'online',_0x9541('0x72'),_0x9541('0x73')],'raw':!![]}]})[_0x9541('0x2e')](function(_0x252ff3){if(_0x252ff3){var _0x5a4865=_['flatMap'](_0x252ff3,function(_0x43e1a3){var _0x2fcdfa=_0x43e1a3[_0x9541('0x2f')]({'plain':!![]});_0x2fcdfa['Agents'][_0x9541('0x74')](function(_0x2c360b){_0x2c360b['penalty']=_[_0x9541('0x5b')](_0x1bc42b,{'id':_0x2fcdfa['id']})['penalty'];});return _0x2fcdfa['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x3ac566['params']['id']}})[_0x9541('0x2e')](function(_0x21f5ee){return db[_0x9541('0x75')][_0x9541('0x76')](function(_0xd0bc68){return _0x21f5ee[_0x9541('0x6e')](_0x5ef2e3,{'transaction':_0xd0bc68})[_0x9541('0x2e')](function(){return BPromise[_0x9541('0x77')](_0x1bc42b,function(_0x6c7e32){return db[_0x9541('0x78')][_0x9541('0x79')]({'TeamId':_0x6c7e32['id'],'VoiceQueueId':_0x3ac566[_0x9541('0x55')]['id'],'penalty':_0x6c7e32['penalty']},{'transaction':_0xd0bc68});});})[_0x9541('0x2e')](function(){return BPromise[_0x9541('0x77')](_0x5a4865,function(_0x3e5204){return db[_0x9541('0x7a')][_0x9541('0x7b')]({'where':{'UserId':_0x3e5204['id'],'VoiceQueueId':_0x3ac566[_0x9541('0x55')]['id']},'defaults':{'penalty':_0x3e5204[_0x9541('0x7c')]},'transaction':_0xd0bc68});});})[_0x9541('0x2e')](function(){return BPromise[_0x9541('0x77')](_[_0x9541('0x33')](_0x5a4865,{'online':!![]}),function(_0xde3f4b){return db[_0x9541('0x7d')][_0x9541('0x79')]({'membername':_0xde3f4b[_0x9541('0x37')],'UserId':_0xde3f4b['id'],'queue_name':_0x21f5ee[_0x9541('0x37')],'VoiceQueueId':_0x21f5ee['id'],'interface':_[_0x9541('0x7e')](_0xde3f4b[_0x9541('0x73')])?util[_0x9541('0x7f')](_0x9541('0x80'),_0xde3f4b['name']):_0xde3f4b[_0x9541('0x73')],'paused':_0xde3f4b['voicePause']||![],'penalty':_0xde3f4b[_0x9541('0x7c')]},{'transaction':_0xd0bc68});});})[_0x9541('0x2e')](function(){_0x5a4865[_0x9541('0x74')](function(_0x4dcac5){socket[_0x9541('0x81')](_0x9541('0x82'),{'UserId':_0x4dcac5['id'],'VoiceQueueId':_0x21f5ee['id']});});});});});}})[_0x9541('0x2e')](respondWithStatusCode(_0x46b842,null))[_0x9541('0x53')](handleError(_0x46b842,null));};exports[_0x9541('0x83')]=function(_0x18f7b3,_0x5be1c9,_0x4c6b39){return db['Team'][_0x9541('0x52')]({'where':{'id':_0x18f7b3[_0x9541('0x41')][_0x9541('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9541('0x71'),'attributes':['id'],'raw':!![]}]})[_0x9541('0x2e')](handleEntityNotFound(_0x5be1c9,null))[_0x9541('0x2e')](function(_0x507675){var _0xc29fbd=_[_0x9541('0x3d')](_0x507675,'id');var _0x250ccd=[];var _0x21fa3d=[];var _0x2e79e8=squel[_0x9541('0x85')]();_0x2e79e8[_0x9541('0x86')](_0x9541('0x87'))[_0x9541('0x88')](_0x9541('0x89'),'tq')['join'](_0x9541('0x8a'),'ut',_0x9541('0x8b'))[_0x9541('0x49')]('VoiceQueueId\x20=\x20?',_0x18f7b3[_0x9541('0x55')]['id']);for(var _0x18d1e4=0x0;_0x18d1e4<_0x507675[_0x9541('0x5f')];_0x18d1e4+=0x1){let _0xdfc3e1=_0x507675[_0x18d1e4];for(var _0x59c506=0x0;_0x59c506<_0xdfc3e1[_0x9541('0x71')][_0x9541('0x5f')];_0x59c506+=0x1){let _0x3dbba8=_0xdfc3e1[_0x9541('0x71')][_0x59c506];var _0x54285e=_0x2e79e8[_0x9541('0x8c')]();_0x54285e['where']('ut.UserId\x20=\x20?',_0x3dbba8['id']);_0x21fa3d[_0x9541('0x8d')](db[_0x9541('0x75')][_0x9541('0x41')](_0x54285e[_0x9541('0x8e')](),{'type':db['sequelize'][_0x9541('0x8f')]['SELECT']})['then'](function(_0x22171f){if(_0x22171f[_0x9541('0x5f')]===0x1){return _0x3dbba8['id'];}else{var _0x5ee725=_[_0x9541('0x90')](_[_0x9541('0x3d')](_0x22171f,_0x9541('0x91')),function(_0x54eec9){return _[_0x9541('0x92')](_0xc29fbd,_0x54eec9);});if(_0x5ee725){return _0x3dbba8['id'];}}}));}}return BPromise[_0x9541('0x93')](_0x21fa3d)['then'](function(_0x32e4f6){_0x250ccd=_(_0x250ccd)['union'](_0x32e4f6)[_0x9541('0x94')]()['value']();return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x18f7b3[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](function(_0x428d39){return db[_0x9541('0x75')][_0x9541('0x76')](function(_0x206ee7){return _0x428d39['removeTeams'](_0x18f7b3['query']['ids'],{'transaction':_0x206ee7})['then'](function(){if(!_[_0x9541('0x95')](_0x250ccd)){return _0x428d39[_0x9541('0x96')](_0x250ccd,{'transaction':_0x206ee7})[_0x9541('0x2e')](function(){return db[_0x9541('0x7d')][_0x9541('0x2d')]({'where':{'VoiceQueueId':_0x18f7b3[_0x9541('0x55')]['id'],'UserId':_0x250ccd},'transaction':_0x206ee7});});}})['then'](function(){_0x250ccd['forEach'](function(_0x5ce6a0){socket[_0x9541('0x81')]('userVoiceQueue:remove',{'UserId':_0x5ce6a0,'VoiceQueueId':_0x428d39['id']});});});});});});})['then'](respondWithStatusCode(_0x5be1c9,null))['catch'](handleError(_0x5be1c9,null));};exports[_0x9541('0x97')]=function(_0x129c30,_0x49554a,_0x5bf677){var _0x9743b7,_0xb11f72;return db[_0x9541('0x4f')]['find']({'where':{'id':_0x129c30[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x49554a,null))[_0x9541('0x2e')](function(_0x31afe7){if(_0x31afe7){_0xb11f72=_0x31afe7;return _0x31afe7[_0x9541('0x97')](_0x129c30[_0x9541('0x57')][_0x9541('0x84')],_['omit'](_0x129c30[_0x9541('0x57')],[_0x9541('0x84'),'id'])||{})['spread'](function(_0x404dbc){for(var _0x5f5b8a=0x0;_0x5f5b8a<_0x129c30[_0x9541('0x57')][_0x9541('0x84')][_0x9541('0x5f')];_0x5f5b8a+=0x1){socket['emit'](_0x9541('0x82'),{'UserId':Number(_0x129c30[_0x9541('0x57')][_0x9541('0x84')][_0x5f5b8a]),'VoiceQueueId':Number(_0x129c30[_0x9541('0x55')]['id'])});}return _0x404dbc;});}})[_0x9541('0x2e')](function(_0x1c7c37){_0x9743b7=_0x1c7c37||[];if(_0xb11f72){return db[_0x9541('0x70')][_0x9541('0x52')]({'where':{'id':_0x129c30[_0x9541('0x57')][_0x9541('0x84')]},'attributes':['id',_0x9541('0x37'),_0x9541('0x98'),_0x9541('0x72'),'interface'],'raw':!![]});}})['then'](function(_0x402baf){if(!_[_0x9541('0x95')](_0x402baf)){var _0x5b7a53=[];for(var _0xc6b003=0x0;_0xc6b003<_0x402baf[_0x9541('0x5f')];_0xc6b003++){if(_0x402baf[_0xc6b003][_0x9541('0x98')]){_0x5b7a53[_0x9541('0x8d')](db[_0x9541('0x7d')][_0x9541('0x79')]({'membername':_0x402baf[_0xc6b003][_0x9541('0x37')],'UserId':_0x402baf[_0xc6b003]['id'],'queue_name':_0xb11f72[_0x9541('0x37')],'VoiceQueueId':_0xb11f72['id'],'interface':_[_0x9541('0x7e')](_0x402baf[_0xc6b003][_0x9541('0x73')])?util[_0x9541('0x7f')]('SIP/%s',_0x402baf[_0xc6b003][_0x9541('0x37')]):_0x402baf[_0xc6b003][_0x9541('0x73')],'paused':_0x402baf[_0xc6b003]['voicePause']||![],'penalty':_0x129c30[_0x9541('0x57')][_0x9541('0x7c')]||0x0}));}}return BPromise[_0x9541('0x93')](_0x5b7a53);}})[_0x9541('0x2e')](function(){return _0x9743b7;})[_0x9541('0x2e')](respondWithResult(_0x49554a,null))[_0x9541('0x53')](handleError(_0x49554a,null));};exports[_0x9541('0x96')]=function(_0x52b978,_0x26cc9a,_0x566d90){return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x52b978[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x26cc9a,null))[_0x9541('0x2e')](function(_0x3f0c1a){if(_0x3f0c1a){return _0x3f0c1a['removeAgents'](_0x52b978[_0x9541('0x41')][_0x9541('0x84')])[_0x9541('0x2e')](function(){if(_[_0x9541('0x99')](_0x52b978[_0x9541('0x41')][_0x9541('0x84')])){for(var _0x5c3385=0x0;_0x5c3385<_0x52b978[_0x9541('0x41')]['ids'][_0x9541('0x5f')];_0x5c3385+=0x1){socket[_0x9541('0x81')](_0x9541('0x9a'),{'UserId':Number(_0x52b978['query'][_0x9541('0x84')][_0x5c3385]),'VoiceQueueId':Number(_0x52b978[_0x9541('0x55')]['id'])});}}else{socket[_0x9541('0x81')](_0x9541('0x9a'),{'UserId':Number(_0x52b978[_0x9541('0x41')][_0x9541('0x84')]),'VoiceQueueId':Number(_0x52b978[_0x9541('0x55')]['id'])});}});}})[_0x9541('0x2e')](function(_0x4b626f){return db[_0x9541('0x7d')][_0x9541('0x2d')]({'where':{'VoiceQueueId':_0x52b978[_0x9541('0x55')]['id'],'UserId':_0x52b978[_0x9541('0x41')]['ids']}})[_0x9541('0x2e')](function(){return _0x4b626f;});})[_0x9541('0x2e')](respondWithStatusCode(_0x26cc9a,null))[_0x9541('0x53')](handleError(_0x26cc9a,null));};exports[_0x9541('0x9b')]=function(_0x3370b0,_0x3a4104,_0xda03b4){var _0x475e7a={};var _0x15dac0={};var _0x6f05de;var _0x36a9e7;return db['VoiceQueue']['findOne']({'where':{'id':_0x3370b0['params']['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x3a4104,null))[_0x9541('0x2e')](function(_0x328803){if(_0x328803){_0x6f05de=_0x328803;_0x15dac0[_0x9541('0x3f')]=_['keys'](db[_0x9541('0x70')][_0x9541('0x3e')]);_0x15dac0[_0x9541('0x41')]=_[_0x9541('0x40')](_0x3370b0[_0x9541('0x41')]);_0x15dac0[_0x9541('0x4a')]=_[_0x9541('0x42')](_0x15dac0[_0x9541('0x3f')],_0x15dac0[_0x9541('0x41')]);_0x475e7a['attributes']=_[_0x9541('0x42')](_0x15dac0[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x3370b0['query'][_0x9541('0x44')]));_0x475e7a[_0x9541('0x43')]=_0x475e7a[_0x9541('0x43')][_0x9541('0x5f')]?_0x475e7a[_0x9541('0x43')]:_0x15dac0[_0x9541('0x3f')];_0x475e7a[_0x9541('0x47')]=qs[_0x9541('0x48')](_0x3370b0[_0x9541('0x41')][_0x9541('0x48')]);_0x475e7a['where']=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x3370b0[_0x9541('0x41')],_0x15dac0['filters']));if(_0x3370b0[_0x9541('0x41')]['filter']){_0x475e7a[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x475e7a[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x475e7a['attributes'],function(_0x8a34b1){var _0x26b43e={};_0x26b43e[_0x8a34b1]={'$like':'%'+_0x3370b0[_0x9541('0x41')][_0x9541('0x33')]+'%'};return _0x26b43e;})});}_0x475e7a=_[_0x9541('0x4c')]({},_0x475e7a,_0x3370b0['options']);return _0x6f05de[_0x9541('0x9b')](_0x475e7a);}})[_0x9541('0x2e')](function(_0x29b134){if(_0x29b134){_0x36a9e7=_0x29b134[_0x9541('0x5f')];if(!_0x3370b0[_0x9541('0x41')][_0x9541('0x45')]('nolimit')){_0x475e7a[_0x9541('0x23')]=qs['limit'](_0x3370b0[_0x9541('0x41')][_0x9541('0x23')]);_0x475e7a[_0x9541('0x25')]=qs['offset'](_0x3370b0[_0x9541('0x41')]['offset']);}return _0x6f05de[_0x9541('0x9b')](_0x475e7a);}})['then'](function(_0x2934eb){if(_0x2934eb){return _0x2934eb?{'count':_0x36a9e7,'rows':_0x2934eb}:null;}})['then'](respondWithResult(_0x3a4104,null))['catch'](handleError(_0x3a4104,null));};exports[_0x9541('0x9c')]=function(_0x489f14,_0x57879f,_0x4c40dd){var _0x48f0e5={};var _0x9b688c={};var _0x6997d6;var _0xf18aee;return db['VoiceQueue'][_0x9541('0x65')]({'where':{'id':_0x489f14[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x57879f,null))['then'](function(_0x3b420c){if(_0x3b420c){_0x6997d6=_0x3b420c;_0x9b688c[_0x9541('0x3f')]=_['keys'](db['UserVoiceQueueRt'][_0x9541('0x3e')]);_0x9b688c[_0x9541('0x41')]=_[_0x9541('0x40')](_0x489f14[_0x9541('0x41')]);_0x9b688c[_0x9541('0x4a')]=_[_0x9541('0x42')](_0x9b688c[_0x9541('0x3f')],_0x9b688c['query']);_0x48f0e5[_0x9541('0x43')]=_[_0x9541('0x42')](_0x9b688c['model'],qs[_0x9541('0x44')](_0x489f14['query'][_0x9541('0x44')]));_0x48f0e5[_0x9541('0x43')]=_0x48f0e5[_0x9541('0x43')][_0x9541('0x5f')]?_0x48f0e5[_0x9541('0x43')]:_0x9b688c[_0x9541('0x3f')];_0x48f0e5[_0x9541('0x47')]=qs[_0x9541('0x48')](_0x489f14[_0x9541('0x41')][_0x9541('0x48')]);_0x48f0e5[_0x9541('0x49')]=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x489f14[_0x9541('0x41')],_0x9b688c[_0x9541('0x4a')]));if(_0x489f14['query'][_0x9541('0x33')]){_0x48f0e5[_0x9541('0x49')]=_[_0x9541('0x4c')](_0x48f0e5[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x48f0e5[_0x9541('0x43')],function(_0x4095c9){var _0x470eb3={};_0x470eb3[_0x4095c9]={'$like':'%'+_0x489f14['query'][_0x9541('0x33')]+'%'};return _0x470eb3;})});}_0x48f0e5=_[_0x9541('0x4c')]({},_0x48f0e5,_0x489f14[_0x9541('0x4e')]);return _0x6997d6[_0x9541('0x9c')](_0x48f0e5);}})[_0x9541('0x2e')](function(_0x3cc5c7){if(_0x3cc5c7){_0xf18aee=_0x3cc5c7[_0x9541('0x5f')];if(!_0x489f14[_0x9541('0x41')]['hasOwnProperty']('nolimit')){_0x48f0e5[_0x9541('0x23')]=qs[_0x9541('0x23')](_0x489f14[_0x9541('0x41')]['limit']);_0x48f0e5[_0x9541('0x25')]=qs[_0x9541('0x25')](_0x489f14['query'][_0x9541('0x25')]);}return _0x6997d6[_0x9541('0x9c')](_0x48f0e5);}})[_0x9541('0x2e')](function(_0x495135){return _0x495135?{'count':_0xf18aee,'rows':_0x495135}:null;})[_0x9541('0x2e')](respondWithResult(_0x57879f,null))['catch'](handleError(_0x57879f,null));};exports[_0x9541('0x9d')]=function(_0x30ce51,_0x8f6a57,_0x211fff){var _0x532df5={};var _0xc25c83={};var _0x4d1ef8;var _0x4669f5;return db[_0x9541('0x4f')][_0x9541('0x65')]({'where':{'id':_0x30ce51[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x8f6a57,null))[_0x9541('0x2e')](function(_0x270109){if(_0x270109){_0x4d1ef8=_0x270109;_0xc25c83['model']=_[_0x9541('0x40')](db['CmList'][_0x9541('0x3e')]);_0xc25c83[_0x9541('0x41')]=_[_0x9541('0x40')](_0x30ce51[_0x9541('0x41')]);_0xc25c83['filters']=_['intersection'](_0xc25c83[_0x9541('0x3f')],_0xc25c83[_0x9541('0x41')]);_0x532df5[_0x9541('0x43')]=_['intersection'](_0xc25c83[_0x9541('0x3f')],qs['fields'](_0x30ce51['query']['fields']));_0x532df5['attributes']=_0x532df5[_0x9541('0x43')][_0x9541('0x5f')]?_0x532df5['attributes']:_0xc25c83[_0x9541('0x3f')];_0x532df5['order']=qs['sort'](_0x30ce51[_0x9541('0x41')]['sort']);_0x532df5['where']=qs['filters'](_[_0x9541('0x4b')](_0x30ce51['query'],_0xc25c83[_0x9541('0x4a')]));if(_0x30ce51[_0x9541('0x41')][_0x9541('0x33')]){_0x532df5['where']=_['merge'](_0x532df5[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x532df5[_0x9541('0x43')],function(_0x5d161b){var _0x2dec8f={};_0x2dec8f[_0x5d161b]={'$like':'%'+_0x30ce51[_0x9541('0x41')][_0x9541('0x33')]+'%'};return _0x2dec8f;})});}_0x532df5=_[_0x9541('0x4c')]({},_0x532df5,_0x30ce51[_0x9541('0x4e')]);return _0x4d1ef8['getLists'](_0x532df5);}})['then'](function(_0xa0c39b){if(_0xa0c39b){_0x4669f5=_0xa0c39b[_0x9541('0x5f')];if(!_0x30ce51[_0x9541('0x41')]['hasOwnProperty'](_0x9541('0x46'))){_0x532df5['limit']=qs[_0x9541('0x23')](_0x30ce51[_0x9541('0x41')][_0x9541('0x23')]);_0x532df5[_0x9541('0x25')]=qs[_0x9541('0x25')](_0x30ce51['query'][_0x9541('0x25')]);}return _0x4d1ef8[_0x9541('0x9d')](_0x532df5);}})[_0x9541('0x2e')](function(_0x2c8686){if(_0x2c8686){return _0x2c8686?{'count':_0x4669f5,'rows':_0x2c8686}:null;}})[_0x9541('0x2e')](respondWithResult(_0x8f6a57,null))[_0x9541('0x53')](handleError(_0x8f6a57,null));};exports[_0x9541('0x9e')]=function(_0x3b9ac7,_0x276c5d,_0x48525b){var _0x9db09e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2d870a,_0xb2bd77;return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x3b9ac7[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0x276c5d,null))[_0x9541('0x2e')](function(_0x49932e){if(_0x49932e){_0xb2bd77=_0x49932e;return _0x49932e[_0x9541('0x9e')](_0x3b9ac7[_0x9541('0x57')][_0x9541('0x84')],_['omit'](_0x3b9ac7[_0x9541('0x57')],[_0x9541('0x84'),'id'])||{});}return null;})[_0x9541('0x9f')](function(_0x2cbcbc){var _0x3c16e0;_0x2d870a=_0x2cbcbc||[];var _0x2307b2=[];if(_0x2cbcbc){for(var _0x2365b2=0x0;_0x2365b2<_0x2cbcbc['length'];_0x2365b2+=0x1){var _0x160abe=_0x2cbcbc[_0x2365b2][_0x9541('0x2f')]({'plain':!![]});_0xb2bd77['dialCheckDuplicateType']=_0x3b9ac7[_0x9541('0x57')][_0x9541('0xa0')]?_0x3b9ac7['body']['dialCheckDuplicateType']:_0xb2bd77['dialCheckDuplicateType'];switch(_0xb2bd77[_0x9541('0xa0')]){case _0x9541('0xa1'):_0x3c16e0=squel['insert']()[_0x9541('0xa2')](_0x9541('0xa3'))['fromQuery'](['phone',_0x9541('0xa4'),_0x9541('0xa5'),_0x9541('0xa6'),'VoiceQueueId',_0x9541('0x61'),_0x9541('0x62')],squel['select']()[_0x9541('0x86')]('phone',_0x9541('0xa7'))['field']('\x27'+_0x9db09e+'\x27',_0x9541('0xa4'))[_0x9541('0x86')]('id',_0x9541('0xa5'))[_0x9541('0x86')](_0x160abe[_0x9541('0xa8')][_0x9541('0x8e')](),'ListId')[_0x9541('0x86')](_0x3b9ac7[_0x9541('0x55')]['id'][_0x9541('0x8e')](),_0x9541('0x66'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27','createdAt')[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0x62'))[_0x9541('0x88')](_0x9541('0xa9'))[_0x9541('0x49')](_0x9541('0xaa'))[_0x9541('0x49')](_0x9541('0xab'),_0x160abe['CmListId'][_0x9541('0x8e')]())[_0x9541('0x49')](_0x9541('0xac'))[_0x9541('0x49')](_0x9541('0xad'),squel[_0x9541('0x85')]()[_0x9541('0x86')](_0x9541('0xae'))[_0x9541('0x88')](_0x9541('0xaf'))[_0x9541('0x49')](_0x9541('0xb0'),_0x3b9ac7['params']['id']['toString']()))[_0x9541('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9541('0x85')]()[_0x9541('0x86')](_0x9541('0xb1'))[_0x9541('0x88')]('cm_hopper')[_0x9541('0x49')](_0x9541('0xb0'),_0x3b9ac7[_0x9541('0x55')]['id'][_0x9541('0x8e')]())))[_0x9541('0x8e')]();break;case _0x9541('0xb2'):_0x3c16e0=squel[_0x9541('0xb3')]()[_0x9541('0xa2')](_0x9541('0xa3'))[_0x9541('0xb4')]([_0x9541('0xa7'),_0x9541('0xa4'),_0x9541('0xa5'),'ListId',_0x9541('0x66'),_0x9541('0x61'),_0x9541('0x62')],squel[_0x9541('0x85')]()[_0x9541('0x86')]('phone','phone')[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0xa4'))['field']('id','ContactId')[_0x9541('0x86')](_0x160abe[_0x9541('0xa8')]['toString'](),'ListId')['field'](_0x3b9ac7[_0x9541('0x55')]['id']['toString'](),_0x9541('0x66'))['field']('\x27'+_0x9db09e+'\x27',_0x9541('0x61'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0x62'))[_0x9541('0x88')](_0x9541('0xa9'))[_0x9541('0x49')]('deletedAt\x20IS\x20NULL')[_0x9541('0x49')](_0x9541('0xab'),_0x160abe['CmListId']['toString']())[_0x9541('0x49')](_0x9541('0xac'))[_0x9541('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9541('0x85')]()[_0x9541('0x86')](_0x9541('0xb1'))[_0x9541('0x88')](_0x9541('0xa3'))[_0x9541('0x49')](_0x9541('0xb0'),_0x3b9ac7[_0x9541('0x55')]['id'][_0x9541('0x8e')]())))[_0x9541('0x8e')]();break;default:_0x3c16e0=squel[_0x9541('0xb3')]()[_0x9541('0xa2')](_0x9541('0xa3'))['fromQuery']([_0x9541('0xa7'),_0x9541('0xa4'),_0x9541('0xa5'),_0x9541('0xa6'),_0x9541('0x66'),_0x9541('0x61'),_0x9541('0x62')],squel[_0x9541('0x85')]()['field'](_0x9541('0xa7'),_0x9541('0xa7'))['field']('\x27'+_0x9db09e+'\x27',_0x9541('0xa4'))[_0x9541('0x86')]('id',_0x9541('0xa5'))[_0x9541('0x86')](_0x160abe[_0x9541('0xa8')][_0x9541('0x8e')](),_0x9541('0xa6'))['field'](_0x3b9ac7[_0x9541('0x55')]['id']['toString'](),_0x9541('0x66'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0x61'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0x62'))['from'](_0x9541('0xa9'))['where']('deletedAt\x20IS\x20NULL')[_0x9541('0x49')](_0x9541('0xab'),_0x160abe[_0x9541('0xa8')][_0x9541('0x8e')]())[_0x9541('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x2307b2['push'](db['sequelize'][_0x9541('0x41')](_0x3c16e0));}return BPromise[_0x9541('0x93')](_0x2307b2);}})[_0x9541('0x2e')](function(){var _0xa44561=[];var _0x1e9616=squel['insert']()[_0x9541('0xa2')](_0x9541('0xb5'))['fromQuery']([_0x9541('0xb6'),'phone',_0x9541('0xb7'),'createdAt','updatedAt'],squel['select']()[_0x9541('0x86')](_0x9541('0xb8'))[_0x9541('0x86')](_0x9541('0xb9'))[_0x9541('0x86')](_0x9541('0xba'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27',_0x9541('0x61'))[_0x9541('0x86')]('\x27'+_0x9db09e+'\x27','updatedAt')[_0x9541('0x88')]('cm_contact_has_items','ci')[_0x9541('0xbb')](_0x9541('0xa3'),'h',_0x9541('0xbc'))[_0x9541('0x49')](_0x9541('0xbd'),_0x9db09e)[_0x9541('0x49')](_0x9541('0xbe'),_0x9541('0xbf')))[_0x9541('0x8e')]();_0xa44561[_0x9541('0x8d')](db[_0x9541('0x75')][_0x9541('0x41')](_0x1e9616));return BPromise[_0x9541('0x93')](_0xa44561);})[_0x9541('0x2e')](function(){return _0x2d870a;})[_0x9541('0x2e')](respondWithResult(_0x276c5d,null))[_0x9541('0x53')](handleError(_0x276c5d,null));};exports['removeLists']=function(_0x2e29d4,_0x443262,_0x34bbac){return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x2e29d4[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x443262,null))[_0x9541('0x2e')](function(_0x19f82b){if(_0x19f82b){return _0x19f82b[_0x9541('0xc0')](_0x2e29d4['query'][_0x9541('0x84')]);}})[_0x9541('0x2e')](function(_0x3c0917){if(_0x3c0917){return db[_0x9541('0x67')][_0x9541('0x2d')]({'where':{'ListId':_0x2e29d4[_0x9541('0x41')][_0x9541('0x84')],'VoiceQueueId':_0x2e29d4[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](function(){return _0x3c0917;});}})[_0x9541('0x2e')](respondWithStatusCode(_0x443262,null))['catch'](handleError(_0x443262,null));};exports['getBlackLists']=function(_0x5ed08c,_0x993f72,_0x211f45){var _0x4c55ff={};var _0x48fb26={};var _0x1069b2;var _0x206e7b;return db['VoiceQueue']['findOne']({'where':{'id':_0x5ed08c[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](handleEntityNotFound(_0x993f72,null))[_0x9541('0x2e')](function(_0x23b974){if(_0x23b974){_0x1069b2=_0x23b974;_0x48fb26[_0x9541('0x3f')]=_[_0x9541('0x40')](db[_0x9541('0xc1')][_0x9541('0x3e')]);_0x48fb26['query']=_[_0x9541('0x40')](_0x5ed08c['query']);_0x48fb26[_0x9541('0x4a')]=_['intersection'](_0x48fb26[_0x9541('0x3f')],_0x48fb26['query']);_0x4c55ff['attributes']=_[_0x9541('0x42')](_0x48fb26[_0x9541('0x3f')],qs[_0x9541('0x44')](_0x5ed08c['query']['fields']));_0x4c55ff[_0x9541('0x43')]=_0x4c55ff[_0x9541('0x43')]['length']?_0x4c55ff['attributes']:_0x48fb26[_0x9541('0x3f')];_0x4c55ff[_0x9541('0x47')]=qs['sort'](_0x5ed08c[_0x9541('0x41')][_0x9541('0x48')]);_0x4c55ff[_0x9541('0x49')]=qs[_0x9541('0x4a')](_[_0x9541('0x4b')](_0x5ed08c[_0x9541('0x41')],_0x48fb26[_0x9541('0x4a')]));if(_0x5ed08c['query'][_0x9541('0x33')]){_0x4c55ff[_0x9541('0x49')]=_['merge'](_0x4c55ff[_0x9541('0x49')],{'$or':_[_0x9541('0x3d')](_0x4c55ff[_0x9541('0x43')],function(_0x30586f){var _0x52435f={};_0x52435f[_0x30586f]={'$like':'%'+_0x5ed08c[_0x9541('0x41')][_0x9541('0x33')]+'%'};return _0x52435f;})});}_0x4c55ff=_[_0x9541('0x4c')]({},_0x4c55ff,_0x5ed08c[_0x9541('0x4e')]);return _0x1069b2[_0x9541('0xc2')](_0x4c55ff);}})['then'](function(_0x560650){if(_0x560650){_0x206e7b=_0x560650[_0x9541('0x5f')];if(!_0x5ed08c[_0x9541('0x41')][_0x9541('0x45')](_0x9541('0x46'))){_0x4c55ff['limit']=qs[_0x9541('0x23')](_0x5ed08c['query'][_0x9541('0x23')]);_0x4c55ff['offset']=qs[_0x9541('0x25')](_0x5ed08c[_0x9541('0x41')]['offset']);}return _0x1069b2['getBlackLists'](_0x4c55ff);}})[_0x9541('0x2e')](function(_0x21584a){if(_0x21584a){return _0x21584a?{'count':_0x206e7b,'rows':_0x21584a}:null;}})[_0x9541('0x2e')](respondWithResult(_0x993f72,null))[_0x9541('0x53')](handleError(_0x993f72,null));};exports[_0x9541('0xc3')]=function(_0x25da7f,_0x143796,_0x85ab6f){var _0xc48bda,_0x17db8b;return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x25da7f[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0x143796,null))[_0x9541('0x2e')](function(_0x3b233c){if(_0x3b233c){_0x17db8b=_0x3b233c;return _0x3b233c[_0x9541('0xc3')](_0x25da7f[_0x9541('0x57')][_0x9541('0x84')],_[_0x9541('0x60')](_0x25da7f[_0x9541('0x57')],[_0x9541('0x84'),'id'])||{});}return null;})[_0x9541('0x9f')](function(_0x32fd2e){var _0x4e6cf7;_0xc48bda=_0x32fd2e||[];var _0x37bed3=[];if(_0x32fd2e){for(var _0x938110=0x0;_0x938110<_0x32fd2e['length'];_0x938110+=0x1){var _0x4b3761=_0x32fd2e[_0x938110]['get']({'plain':!![]});_0x4e6cf7=squel[_0x9541('0xb3')]()[_0x9541('0xa2')](_0x9541('0xc4'))['fromQuery']([_0x9541('0xa7'),'ContactId',_0x9541('0xa6'),_0x9541('0x66'),'createdAt',_0x9541('0x62')],squel[_0x9541('0x85')]()[_0x9541('0x86')](_0x9541('0xa7'),'phone')[_0x9541('0x86')]('id','ContactId')[_0x9541('0x86')](_0x4b3761[_0x9541('0xa8')][_0x9541('0x8e')](),_0x9541('0xa6'))[_0x9541('0x86')](_0x25da7f[_0x9541('0x55')]['id'][_0x9541('0x8e')](),_0x9541('0x66'))[_0x9541('0x86')](_0x9541('0xc5'),_0x9541('0x61'))[_0x9541('0x86')](_0x9541('0xc5'),_0x9541('0x62'))[_0x9541('0x88')](_0x9541('0xa9'))['where'](_0x9541('0xaa'))[_0x9541('0x49')](_0x9541('0xab'),_0x4b3761[_0x9541('0xa8')][_0x9541('0x8e')]())[_0x9541('0x49')](_0x9541('0xac')))[_0x9541('0x8e')]();_0x37bed3[_0x9541('0x8d')](db[_0x9541('0x75')][_0x9541('0x41')](_0x4e6cf7));}return BPromise[_0x9541('0x93')](_0x37bed3);}})[_0x9541('0x2e')](function(){return _0xc48bda;})[_0x9541('0x2e')](respondWithResult(_0x143796,null))[_0x9541('0x53')](handleError(_0x143796,null));};exports[_0x9541('0xc6')]=function(_0x3321a2,_0x1a5dee,_0x284341){return db[_0x9541('0x4f')][_0x9541('0x5b')]({'where':{'id':_0x3321a2[_0x9541('0x55')]['id']}})['then'](handleEntityNotFound(_0x1a5dee,null))[_0x9541('0x2e')](function(_0x4d525b){if(_0x4d525b){return _0x4d525b['removeBlackLists'](_0x3321a2[_0x9541('0x41')][_0x9541('0x84')]);}})[_0x9541('0x2e')](function(_0x58c0ae){if(_0x58c0ae){return db['CmHopperBlack'][_0x9541('0x2d')]({'where':{'ListId':_0x3321a2[_0x9541('0x41')]['ids'],'VoiceQueueId':_0x3321a2[_0x9541('0x55')]['id']}})[_0x9541('0x2e')](function(){return _0x58c0ae;});}})[_0x9541('0x2e')](respondWithStatusCode(_0x1a5dee,null))[_0x9541('0x53')](handleError(_0x1a5dee,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 66e0a94..2382b5b 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 _0xf3fc=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x44690f,_0x9cf1b5){var _0xe164b2=function(_0x240eae){while(--_0x240eae){_0x44690f['push'](_0x44690f['shift']());}};_0xe164b2(++_0x9cf1b5);}(_0xf3fc,0x186));var _0xcf3f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf3fc[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xcf3f('0x0'));var VoiceQueue=require(_0xcf3f('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcf3f('0x2')](0x0);var events={'afterCreate':_0xcf3f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1bf04d){return function(_0x5b8d0f,_0x3e79d3,_0x1bf193){VoiceQueueEvents[_0xcf3f('0x4')](_0x1bf04d+':'+_0x5b8d0f['id'],_0x5b8d0f);VoiceQueueEvents[_0xcf3f('0x4')](_0x1bf04d,_0x5b8d0f);_0x1bf193(null);};}for(var e in events){if(events[_0xcf3f('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xdb00=['hook','events','save','update','remove','emit','hasOwnProperty'];(function(_0x57944f,_0x4f975f){var _0x44d4d7=function(_0x3bd083){while(--_0x3bd083){_0x57944f['push'](_0x57944f['shift']());}};_0x44d4d7(++_0x4f975f);}(_0xdb00,0x151));var _0x0db0=function(_0xecc93b,_0xc0dab9){_0xecc93b=_0xecc93b-0x0;var _0x5b1795=_0xdb00[_0xecc93b];return _0x5b1795;};'use strict';var EventEmitter=require(_0x0db0('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0db0('0x1'),'afterUpdate':_0x0db0('0x2'),'afterDestroy':_0x0db0('0x3')};function emitEvent(_0x24f347){return function(_0xb2cdd0,_0xcc51c1,_0x2887f8){VoiceQueueEvents[_0x0db0('0x4')](_0x24f347+':'+_0xb2cdd0['id'],_0xb2cdd0);VoiceQueueEvents[_0x0db0('0x4')](_0x24f347,_0xb2cdd0);_0x2887f8(null);};}for(var e in events){if(events[_0x0db0('0x5')](e)){var event=events[e];VoiceQueue[_0x0db0('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5d1c222..036dc11 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x40ef2d,_0x34283a){var _0xa1b63f=function(_0x56cafa){while(--_0x56cafa){_0x40ef2d['push'](_0x40ef2d['shift']());}};_0xa1b63f(++_0x34283a);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x3e74,0x175));var _0x43e7=function(_0x505902,_0x107378){_0x505902=_0x505902-0x0;var _0x2fe882=_0x3e74[_0x505902];return _0x2fe882;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 766abf3..d4d437d 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 _0xe3fc=['defaults','redis','localhost','socket.io-emitter','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','include','model','map','ShowVoiceQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x3b0b34,_0xe6a14f){var _0x5f5496=function(_0x24fda6){while(--_0x24fda6){_0x3b0b34['push'](_0x3b0b34['shift']());}};_0x5f5496(++_0xe6a14f);}(_0xe3fc,0xe5));var _0xce3f=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0xe3fc[_0x58de4a];return _0x178820;};'use strict';var _=require(_0xce3f('0x0'));var util=require(_0xce3f('0x1'));var moment=require(_0xce3f('0x2'));var BPromise=require(_0xce3f('0x3'));var rs=require(_0xce3f('0x4'));var fs=require('fs');var Redis=require(_0xce3f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce3f('0x6'));var logger=require(_0xce3f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce3f('0x8'));var client=jayson[_0xce3f('0x9')][_0xce3f('0xa')]({'port':0x232a});config['redis']=_[_0xce3f('0xb')](config[_0xce3f('0xc')],{'host':_0xce3f('0xd'),'port':0x18eb});var socket=require(_0xce3f('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xce3f('0xf')](socket);function respondWithRpcPromise(_0x3626d7,_0x2ef5e3,_0x412ce8){return new BPromise(function(_0x4a61e4,_0x3108e2){return client[_0xce3f('0x10')](_0x3626d7,_0x412ce8)[_0xce3f('0x11')](function(_0x2a1ae7){logger['info'](_0xce3f('0x12'),_0x2ef5e3,_0xce3f('0x13'));logger[_0xce3f('0x14')](_0xce3f('0x15'),_0x2ef5e3,'request\x20sent',JSON[_0xce3f('0x16')](_0x2a1ae7));if(_0x2a1ae7['error']){if(_0x2a1ae7['error'][_0xce3f('0x17')]===0x1f4){logger[_0xce3f('0x18')](_0xce3f('0x12'),_0x2ef5e3,_0x2a1ae7[_0xce3f('0x18')][_0xce3f('0x19')]);return _0x3108e2(_0x2a1ae7[_0xce3f('0x18')][_0xce3f('0x19')]);}logger[_0xce3f('0x18')](_0xce3f('0x12'),_0x2ef5e3,_0x2a1ae7[_0xce3f('0x18')][_0xce3f('0x19')]);return _0x4a61e4(_0x2a1ae7['error'][_0xce3f('0x19')]);}else{logger[_0xce3f('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x2ef5e3,'request\x20sent');_0x4a61e4(_0x2a1ae7[_0xce3f('0x1b')][_0xce3f('0x19')]);}})[_0xce3f('0x1c')](function(_0x32e98f){logger[_0xce3f('0x18')](_0xce3f('0x12'),_0x2ef5e3,_0x32e98f);_0x3108e2(_0x32e98f);});});}exports[_0xce3f('0x1d')]=function(_0x5eedbd){var _0x56e937=this;return new Promise(function(_0x27f537,_0x2e2fb6){return db[_0xce3f('0x1e')][_0xce3f('0x1f')]({'raw':_0x5eedbd[_0xce3f('0x20')]?_0x5eedbd['options']['raw']===undefined?!![]:![]:!![],'where':_0x5eedbd[_0xce3f('0x20')]?_0x5eedbd[_0xce3f('0x20')][_0xce3f('0x21')]||null:null,'attributes':_0x5eedbd[_0xce3f('0x20')]?_0x5eedbd['options'][_0xce3f('0x22')]||null:null,'limit':_0x5eedbd[_0xce3f('0x20')]?_0x5eedbd[_0xce3f('0x20')]['limit']||null:null,'include':_0x5eedbd[_0xce3f('0x20')]?_0x5eedbd['options'][_0xce3f('0x23')]?_['map'](_0x5eedbd[_0xce3f('0x20')][_0xce3f('0x23')],function(_0x57a0ae){return{'model':db[_0x57a0ae[_0xce3f('0x24')]],'as':_0x57a0ae['as'],'attributes':_0x57a0ae['attributes'],'include':_0x57a0ae[_0xce3f('0x23')]?_[_0xce3f('0x25')](_0x57a0ae[_0xce3f('0x23')],function(_0xb6c857){return{'model':db[_0xb6c857[_0xce3f('0x24')]],'as':_0xb6c857['as'],'attributes':_0xb6c857[_0xce3f('0x22')],'include':_0xb6c857[_0xce3f('0x23')]?_[_0xce3f('0x25')](_0xb6c857[_0xce3f('0x23')],function(_0x1d74b7){return{'model':db[_0x1d74b7[_0xce3f('0x24')]],'as':_0x1d74b7['as'],'attributes':_0x1d74b7[_0xce3f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xce3f('0x11')](function(_0x4d45bc){logger[_0xce3f('0x1a')](_0xce3f('0x1d'),_0x5eedbd);logger['debug'](_0xce3f('0x1d'),_0x5eedbd,JSON[_0xce3f('0x16')](_0x4d45bc));_0x27f537(_0x4d45bc);})[_0xce3f('0x1c')](function(_0x42ade5){logger['error'](_0xce3f('0x1d'),_0x42ade5[_0xce3f('0x19')],_0x5eedbd);_0x2e2fb6(_0x56e937[_0xce3f('0x18')](0x1f4,_0x42ade5['message']));});});};exports[_0xce3f('0x26')]=function(_0x103f36){var _0x2c9296=this;return new Promise(function(_0x3991b4,_0x537d54){return db[_0xce3f('0x1e')]['find']({'raw':_0x103f36[_0xce3f('0x20')]?_0x103f36[_0xce3f('0x20')][_0xce3f('0x27')]===undefined?!![]:![]:!![],'where':_0x103f36['options']?_0x103f36[_0xce3f('0x20')][_0xce3f('0x21')]||null:null,'attributes':_0x103f36[_0xce3f('0x20')]?_0x103f36['options'][_0xce3f('0x22')]||null:null,'include':_0x103f36[_0xce3f('0x20')]?_0x103f36[_0xce3f('0x20')]['include']?_[_0xce3f('0x25')](_0x103f36[_0xce3f('0x20')]['include'],function(_0x25be32){return{'model':db[_0x25be32[_0xce3f('0x24')]],'as':_0x25be32['as'],'attributes':_0x25be32[_0xce3f('0x22')],'include':_0x25be32[_0xce3f('0x23')]?_['map'](_0x25be32[_0xce3f('0x23')],function(_0x20f925){return{'model':db[_0x20f925['model']],'as':_0x20f925['as'],'attributes':_0x20f925[_0xce3f('0x22')],'include':_0x20f925['include']?_[_0xce3f('0x25')](_0x20f925[_0xce3f('0x23')],function(_0x2014cf){return{'model':db[_0x2014cf[_0xce3f('0x24')]],'as':_0x2014cf['as'],'attributes':_0x2014cf[_0xce3f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xce3f('0x11')](function(_0x23dfc5){logger[_0xce3f('0x1a')](_0xce3f('0x26'),_0x103f36);logger['debug'](_0xce3f('0x26'),_0x103f36,JSON[_0xce3f('0x16')](_0x23dfc5));_0x3991b4(_0x23dfc5);})[_0xce3f('0x1c')](function(_0xc4b38d){logger[_0xce3f('0x18')](_0xce3f('0x26'),_0xc4b38d[_0xce3f('0x19')],_0x103f36);_0x537d54(_0x2c9296[_0xce3f('0x18')](0x1f4,_0xc4b38d[_0xce3f('0x19')]));});});}; \ No newline at end of file +var _0x590f=['error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbd43f2,_0x104733){var _0x12b6a4=function(_0x3e31e5){while(--_0x3e31e5){_0xbd43f2['push'](_0xbd43f2['shift']());}};_0x12b6a4(++_0x104733);}(_0x590f,0x11b));var _0xf590=function(_0x234f91,_0x3e8f17){_0x234f91=_0x234f91-0x0;var _0x191255=_0x590f[_0x234f91];return _0x191255;};'use strict';var _=require(_0xf590('0x0'));var util=require('util');var moment=require(_0xf590('0x1'));var BPromise=require(_0xf590('0x2'));var rs=require(_0xf590('0x3'));var fs=require('fs');var Redis=require(_0xf590('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf590('0x5'));var logger=require('../../config/logger')(_0xf590('0x6'));var config=require(_0xf590('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf590('0x8')]['http']({'port':0x232a});config[_0xf590('0x9')]=_[_0xf590('0xa')](config[_0xf590('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf590('0xb'))(new Redis(config[_0xf590('0x9')]));require(_0xf590('0xc'))[_0xf590('0xd')](socket);function respondWithRpcPromise(_0x1a48c6,_0x20ff4f,_0x24d26f){return new BPromise(function(_0x4c346c,_0x5e2c60){return client[_0xf590('0xe')](_0x1a48c6,_0x24d26f)[_0xf590('0xf')](function(_0x550178){logger[_0xf590('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x20ff4f,_0xf590('0x11'));logger[_0xf590('0x12')](_0xf590('0x13'),_0x20ff4f,_0xf590('0x11'),JSON[_0xf590('0x14')](_0x550178));if(_0x550178['error']){if(_0x550178[_0xf590('0x15')]['code']===0x1f4){logger[_0xf590('0x15')](_0xf590('0x16'),_0x20ff4f,_0x550178[_0xf590('0x15')][_0xf590('0x17')]);return _0x5e2c60(_0x550178['error'][_0xf590('0x17')]);}logger[_0xf590('0x15')](_0xf590('0x16'),_0x20ff4f,_0x550178[_0xf590('0x15')][_0xf590('0x17')]);return _0x4c346c(_0x550178['error'][_0xf590('0x17')]);}else{logger[_0xf590('0x10')](_0xf590('0x16'),_0x20ff4f,_0xf590('0x11'));_0x4c346c(_0x550178[_0xf590('0x18')][_0xf590('0x17')]);}})[_0xf590('0x19')](function(_0x5673fc){logger[_0xf590('0x15')](_0xf590('0x16'),_0x20ff4f,_0x5673fc);_0x5e2c60(_0x5673fc);});});}exports[_0xf590('0x1a')]=function(_0x3f06d4){var _0xc1055f=this;return new Promise(function(_0x35d33d,_0x5f1b9d){return db[_0xf590('0x1b')]['findAll']({'raw':_0x3f06d4[_0xf590('0x1c')]?_0x3f06d4[_0xf590('0x1c')][_0xf590('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f06d4['options']?_0x3f06d4[_0xf590('0x1c')][_0xf590('0x1e')]||null:null,'attributes':_0x3f06d4[_0xf590('0x1c')]?_0x3f06d4[_0xf590('0x1c')][_0xf590('0x1f')]||null:null,'limit':_0x3f06d4[_0xf590('0x1c')]?_0x3f06d4[_0xf590('0x1c')][_0xf590('0x20')]||null:null,'include':_0x3f06d4[_0xf590('0x1c')]?_0x3f06d4[_0xf590('0x1c')][_0xf590('0x21')]?_[_0xf590('0x22')](_0x3f06d4['options'][_0xf590('0x21')],function(_0x15242d){return{'model':db[_0x15242d['model']],'as':_0x15242d['as'],'attributes':_0x15242d[_0xf590('0x1f')],'include':_0x15242d['include']?_['map'](_0x15242d[_0xf590('0x21')],function(_0x13fb5c){return{'model':db[_0x13fb5c[_0xf590('0x23')]],'as':_0x13fb5c['as'],'attributes':_0x13fb5c['attributes'],'include':_0x13fb5c[_0xf590('0x21')]?_[_0xf590('0x22')](_0x13fb5c[_0xf590('0x21')],function(_0x125ac4){return{'model':db[_0x125ac4[_0xf590('0x23')]],'as':_0x125ac4['as'],'attributes':_0x125ac4[_0xf590('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf590('0xf')](function(_0x4ff095){logger[_0xf590('0x10')]('GetVoiceQueue',_0x3f06d4);logger[_0xf590('0x12')](_0xf590('0x1a'),_0x3f06d4,JSON[_0xf590('0x14')](_0x4ff095));_0x35d33d(_0x4ff095);})['catch'](function(_0x186b1d){logger['error'](_0xf590('0x1a'),_0x186b1d[_0xf590('0x17')],_0x3f06d4);_0x5f1b9d(_0xc1055f[_0xf590('0x15')](0x1f4,_0x186b1d[_0xf590('0x17')]));});});};exports[_0xf590('0x24')]=function(_0x66f04f){var _0x1c0f3b=this;return new Promise(function(_0x38dca6,_0x4befe0){return db[_0xf590('0x1b')][_0xf590('0x25')]({'raw':_0x66f04f[_0xf590('0x1c')]?_0x66f04f[_0xf590('0x1c')][_0xf590('0x1d')]===undefined?!![]:![]:!![],'where':_0x66f04f['options']?_0x66f04f[_0xf590('0x1c')][_0xf590('0x1e')]||null:null,'attributes':_0x66f04f[_0xf590('0x1c')]?_0x66f04f[_0xf590('0x1c')][_0xf590('0x1f')]||null:null,'include':_0x66f04f[_0xf590('0x1c')]?_0x66f04f[_0xf590('0x1c')][_0xf590('0x21')]?_[_0xf590('0x22')](_0x66f04f['options'][_0xf590('0x21')],function(_0x553361){return{'model':db[_0x553361[_0xf590('0x23')]],'as':_0x553361['as'],'attributes':_0x553361[_0xf590('0x1f')],'include':_0x553361[_0xf590('0x21')]?_[_0xf590('0x22')](_0x553361[_0xf590('0x21')],function(_0x3297c2){return{'model':db[_0x3297c2[_0xf590('0x23')]],'as':_0x3297c2['as'],'attributes':_0x3297c2[_0xf590('0x1f')],'include':_0x3297c2['include']?_['map'](_0x3297c2[_0xf590('0x21')],function(_0x15a2a5){return{'model':db[_0x15a2a5[_0xf590('0x23')]],'as':_0x15a2a5['as'],'attributes':_0x15a2a5[_0xf590('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf590('0xf')](function(_0x51182e){logger['info'](_0xf590('0x24'),_0x66f04f);logger[_0xf590('0x12')](_0xf590('0x24'),_0x66f04f,JSON[_0xf590('0x14')](_0x51182e));_0x38dca6(_0x51182e);})[_0xf590('0x19')](function(_0x37d926){logger[_0xf590('0x15')](_0xf590('0x24'),_0x37d926[_0xf590('0x17')],_0x66f04f);_0x4befe0(_0x1c0f3b[_0xf590('0x15')](0x1f4,_0x37d926[_0xf590('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 44a807f..9ffa189 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 _0x3f04=['voiceQueue:','./voiceQueue.events','save','update','emit','register','length'];(function(_0x396e83,_0x2d51e2){var _0x4a42cc=function(_0x415496){while(--_0x415496){_0x396e83['push'](_0x396e83['shift']());}};_0x4a42cc(++_0x2d51e2);}(_0x3f04,0xd3));var _0x43f0=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x3f04[_0x23c73d];return _0x36ba47;};'use strict';var VoiceQueueEvents=require(_0x43f0('0x0'));var events=[_0x43f0('0x1'),'remove',_0x43f0('0x2')];function createListener(_0x8a1539,_0x5bac22){return function(_0x2128c9){_0x5bac22[_0x43f0('0x3')](_0x8a1539,_0x2128c9);};}function removeListener(_0xabc6ae,_0x5adfb){return function(){VoiceQueueEvents['removeListener'](_0xabc6ae,_0x5adfb);};}exports[_0x43f0('0x4')]=function(_0x792f4d){for(var _0x3c6098=0x0,_0x42abac=events[_0x43f0('0x5')];_0x3c6098<_0x42abac;_0x3c6098++){var _0x102562=events[_0x3c6098];var _0x2fd1b9=createListener(_0x43f0('0x6')+_0x102562,_0x792f4d);VoiceQueueEvents['on'](_0x102562,_0x2fd1b9);}}; \ No newline at end of file +var _0x0ed7=['update','emit','removeListener','length','voiceQueue:','save','remove'];(function(_0x395aa1,_0x9e643d){var _0x57ef82=function(_0x4160a0){while(--_0x4160a0){_0x395aa1['push'](_0x395aa1['shift']());}};_0x57ef82(++_0x9e643d);}(_0x0ed7,0x8a));var _0x70ed=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x0ed7[_0x55291a];return _0x3c870c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x70ed('0x0'),_0x70ed('0x1'),_0x70ed('0x2')];function createListener(_0x274868,_0x42bc9c){return function(_0x453f7b){_0x42bc9c[_0x70ed('0x3')](_0x274868,_0x453f7b);};}function removeListener(_0x267f2e,_0x1fc110){return function(){VoiceQueueEvents[_0x70ed('0x4')](_0x267f2e,_0x1fc110);};}exports['register']=function(_0x22152e){for(var _0x19b5b3=0x0,_0x4f9878=events[_0x70ed('0x5')];_0x19b5b3<_0x4f9878;_0x19b5b3++){var _0x3680b5=events[_0x19b5b3];var _0x68d325=createListener(_0x70ed('0x6')+_0x3680b5,_0x22152e);VoiceQueueEvents['on'](_0x3680b5,_0x68d325);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index cbdc68c..c746682 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 _0x278f=['multer','path','express','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','put','update','destroy','exports'];(function(_0x3e2186,_0x460c6e){var _0x2ad965=function(_0x3c9267){while(--_0x3c9267){_0x3e2186['push'](_0x3e2186['shift']());}};_0x2ad965(++_0x460c6e);}(_0x278f,0x165));var _0xf278=function(_0x2974e4,_0x2029b0){_0x2974e4=_0x2974e4-0x0;var _0x241980=_0x278f[_0x2974e4];return _0x241980;};'use strict';var multer=require(_0xf278('0x0'));var util=require('util');var path=require(_0xf278('0x1'));var timeout=require('connect-timeout');var express=require(_0xf278('0x2'));var router=express[_0xf278('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf278('0x4'));var controller=require(_0xf278('0x5'));router[_0xf278('0x6')]('/',auth[_0xf278('0x7')](),controller[_0xf278('0x8')]);router['get'](_0xf278('0x9'),auth['isAuthenticated'](),controller[_0xf278('0xa')]);router[_0xf278('0x6')](_0xf278('0xb'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xf278('0x6')](_0xf278('0xc'),auth[_0xf278('0x7')](),controller['show']);router['post']('/',auth[_0xf278('0x7')](),controller['create']);router[_0xf278('0xd')]('/:id',auth[_0xf278('0x7')](),controller[_0xf278('0xe')]);router['delete'](_0xf278('0xc'),auth[_0xf278('0x7')](),controller[_0xf278('0xf')]);module[_0xf278('0x10')]=router; \ No newline at end of file +var _0x3bc7=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getVoiceQueuesReport','/:id','post','create','update','delete','exports','multer'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0x3bc7,0x1c1));var _0x73bc=function(_0x360d26,_0x700e92){_0x360d26=_0x360d26-0x0;var _0x180eef=_0x3bc7[_0x360d26];return _0x180eef;};'use strict';var multer=require(_0x73bc('0x0'));var util=require(_0x73bc('0x1'));var path=require(_0x73bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x73bc('0x3'));var router=express['Router']();var fs_extra=require(_0x73bc('0x4'));var auth=require(_0x73bc('0x5'));var interaction=require(_0x73bc('0x6'));var config=require(_0x73bc('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x73bc('0x8')]('/',auth[_0x73bc('0x9')](),controller[_0x73bc('0xa')]);router[_0x73bc('0x8')]('/describe',auth[_0x73bc('0x9')](),controller['describe']);router['get']('/index',auth[_0x73bc('0x9')](),controller[_0x73bc('0xb')]);router[_0x73bc('0x8')](_0x73bc('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x73bc('0xd')]('/',auth[_0x73bc('0x9')](),controller[_0x73bc('0xe')]);router['put'](_0x73bc('0xc'),auth[_0x73bc('0x9')](),controller[_0x73bc('0xf')]);router[_0x73bc('0x10')](_0x73bc('0xc'),auth[_0x73bc('0x9')](),controller['destroy']);module[_0x73bc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 31cb816..143bfd3 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 _0x8549=['STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x896f8d,_0x7b080a){var _0x426f83=function(_0x2ca831){while(--_0x2ca831){_0x896f8d['push'](_0x896f8d['shift']());}};_0x426f83(++_0x7b080a);}(_0x8549,0x1ad));var _0x9854=function(_0x2dd07a,_0x354b1b){_0x2dd07a=_0x2dd07a-0x0;var _0x4671a8=_0x8549[_0x2dd07a];return _0x4671a8;};'use strict';var Sequelize=require(_0x9854('0x0'));var moment=require(_0x9854('0x1'));module[_0x9854('0x2')]={'type':{'type':Sequelize[_0x9854('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9854('0x3')]},'calleridname':{'type':Sequelize[_0x9854('0x3')]},'queue':{'type':Sequelize[_0x9854('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9854('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9854('0x4')],'set':function(_0x1966bc){var _0x3d0f5d=moment(_0x1966bc);var _0x3a14de=moment(this['getDataValue'](_0x9854('0x5')))[_0x9854('0x6')](_0x9854('0x7'));var _0x15ef1e=_0x3d0f5d['diff'](_0x3a14de,_0x9854('0x8'));this[_0x9854('0x9')](_0x9854('0xa'),_0x1966bc);this[_0x9854('0x9')](_0x9854('0xb'),_0x15ef1e||null);}},'position':{'type':Sequelize[_0x9854('0xc')]},'count':{'type':Sequelize[_0x9854('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x9854('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x9854('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9854('0x4')]},'queuecallerexit':{'type':Sequelize[_0x9854('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x9854('0x3')],'comment':_0x9854('0xe')},'originalposition':{'type':Sequelize[_0x9854('0xc')]},'channel':{'type':Sequelize[_0x9854('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9854('0x3')]},'accountcode':{'type':Sequelize[_0x9854('0x3')]},'context':{'type':Sequelize[_0x9854('0x3')]},'exten':{'type':Sequelize[_0x9854('0x3')]},'priority':{'type':Sequelize[_0x9854('0x3')]},'holdtime':{'type':Sequelize[_0x9854('0xc')]},'mohtime':{'type':Sequelize[_0x9854('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9854('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9854('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9854('0x3')],'comment':_0x9854('0xf')},'transferexten':{'type':Sequelize[_0x9854('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9854('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9854('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9854('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x9854('0x3')]}}; \ No newline at end of file +var _0xf72a=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x23d0a1,_0x5011a){var _0x1ef866=function(_0x5103d4){while(--_0x5103d4){_0x23d0a1['push'](_0x23d0a1['shift']());}};_0x1ef866(++_0x5011a);}(_0xf72a,0x1f3));var _0xaf72=function(_0xbc7159,_0x5e1abb){_0xbc7159=_0xbc7159-0x0;var _0x5cc0ba=_0xf72a[_0xbc7159];return _0x5cc0ba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaf72('0x0'));module[_0xaf72('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaf72('0x2')]},'calleridnum':{'type':Sequelize[_0xaf72('0x2')]},'calleridname':{'type':Sequelize[_0xaf72('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xaf72('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xaf72('0x3')],'set':function(_0x9d8d94){var _0x225d5a=moment(_0x9d8d94);var _0xd2096c=moment(this[_0xaf72('0x4')]('queuecallerjoinAt'))[_0xaf72('0x5')](_0xaf72('0x6'));var _0x847df0=_0x225d5a[_0xaf72('0x7')](_0xd2096c,_0xaf72('0x8'));this[_0xaf72('0x9')]('queuecallerleaveAt',_0x9d8d94);this[_0xaf72('0x9')](_0xaf72('0xa'),_0x847df0||null);}},'position':{'type':Sequelize[_0xaf72('0xb')]},'count':{'type':Sequelize[_0xaf72('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xaf72('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xaf72('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaf72('0x3')]},'queuecallerexit':{'type':Sequelize[_0xaf72('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xaf72('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xaf72('0xb')]},'channel':{'type':Sequelize[_0xaf72('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf72('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf72('0x2')]},'accountcode':{'type':Sequelize[_0xaf72('0x2')]},'context':{'type':Sequelize[_0xaf72('0x2')]},'exten':{'type':Sequelize[_0xaf72('0x2')]},'priority':{'type':Sequelize[_0xaf72('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xaf72('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xaf72('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaf72('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf72('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xaf72('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaf72('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaf72('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xaf72('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index ea87b91..af447a9 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 _0x9451=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','getVoiceQueuesReport','nolimit','order','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x315c40,_0x490fa1){var _0x5ede3d=function(_0x52729){while(--_0x52729){_0x315c40['push'](_0x315c40['shift']());}};_0x5ede3d(++_0x490fa1);}(_0x9451,0x19c));var _0x1945=function(_0x214110,_0x1017a1){_0x214110=_0x214110-0x0;var _0x3648a8=_0x9451[_0x214110];return _0x3648a8;};'use strict';var emlformat=require(_0x1945('0x0'));var rimraf=require(_0x1945('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1945('0x2'));var rp=require(_0x1945('0x3'));var moment=require(_0x1945('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1945('0x5'));var util=require(_0x1945('0x6'));var path=require(_0x1945('0x7'));var sox=require('sox');var csv=require(_0x1945('0x8'));var ejs=require(_0x1945('0x9'));var fs=require('fs');var fs_extra=require(_0x1945('0xa'));var _=require(_0x1945('0xb'));var squel=require('squel');var crypto=require(_0x1945('0xc'));var jsforce=require(_0x1945('0xd'));var deskjs=require(_0x1945('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1945('0xf'));var Papa=require(_0x1945('0x10'));var Redis=require(_0x1945('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1945('0x12'));var as=require(_0x1945('0x13'));var hardwareService=require(_0x1945('0x14'));var logger=require(_0x1945('0x15'))('api');var utils=require(_0x1945('0x16'));var config=require(_0x1945('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1945('0x18'))['db'];config[_0x1945('0x19')]=_[_0x1945('0x1a')](config[_0x1945('0x19')],{'host':_0x1945('0x1b'),'port':0x18eb});var socket=require(_0x1945('0x1c'))(new Redis(config[_0x1945('0x19')]));require(_0x1945('0x1d'))['register'](socket);function respondWithStatusCode(_0x4ef0cf,_0x33b36f){_0x33b36f=_0x33b36f||0xcc;return function(_0x5e9014){if(_0x5e9014){return _0x4ef0cf[_0x1945('0x1e')](_0x33b36f);}return _0x4ef0cf['status'](_0x33b36f)['end']();};}function respondWithResult(_0x5f0570,_0x30b6c1){_0x30b6c1=_0x30b6c1||0xc8;return function(_0x56570d){if(_0x56570d){return _0x5f0570['status'](_0x30b6c1)['json'](_0x56570d);}};}function respondWithFilteredResult(_0x41329f,_0x5d93a0){return function(_0x565fb2){if(_0x565fb2){var _0x210595=typeof _0x5d93a0[_0x1945('0x1f')]===_0x1945('0x20')&&typeof _0x5d93a0['limit']===_0x1945('0x20');var _0x3e7127=_0x565fb2[_0x1945('0x21')];var _0x4a3e84=_0x210595?0x0:_0x5d93a0['offset'];var _0x15524e=_0x210595?_0x565fb2['count']:_0x5d93a0['offset']+_0x5d93a0[_0x1945('0x22')];var _0x497df1;if(_0x15524e>=_0x3e7127){_0x15524e=_0x3e7127;_0x497df1=0xc8;}else{_0x497df1=0xce;}_0x41329f[_0x1945('0x23')](_0x497df1);return _0x41329f['set'](_0x1945('0x24'),_0x4a3e84+'-'+_0x15524e+'/'+_0x3e7127)['json'](_0x565fb2);}return null;};}function patchUpdates(_0x11aea5){return function(_0x58ec7b){try{jsonpatch[_0x1945('0x25')](_0x58ec7b,_0x11aea5,!![]);}catch(_0x141995){return BPromise[_0x1945('0x26')](_0x141995);}return _0x58ec7b[_0x1945('0x27')]();};}function saveUpdates(_0x3b003e,_0x57e549){return function(_0x4b819d){if(_0x4b819d){return _0x4b819d[_0x1945('0x28')](_0x3b003e)[_0x1945('0x29')](function(_0x9d0d98){return _0x9d0d98;});}return null;};}function removeEntity(_0x2d509b,_0x10c32e){return function(_0x4e4a7f){if(_0x4e4a7f){return _0x4e4a7f[_0x1945('0x2a')]()[_0x1945('0x29')](function(){_0x2d509b[_0x1945('0x23')](0xcc)[_0x1945('0x2b')]();});}};}function handleEntityNotFound(_0x114adc,_0xa90ac8){return function(_0x34d587){if(!_0x34d587){_0x114adc[_0x1945('0x1e')](0x194);}return _0x34d587;};}function handleError(_0x5b9a37,_0x58681a){_0x58681a=_0x58681a||0x1f4;return function(_0x25644a){logger[_0x1945('0x2c')](_0x25644a[_0x1945('0x2d')]);if(_0x25644a[_0x1945('0x2e')]){delete _0x25644a[_0x1945('0x2e')];}_0x5b9a37['status'](_0x58681a)['send'](_0x25644a);};}exports[_0x1945('0x2f')]=function(_0x3d0f5f,_0x38c284){var _0x489453={},_0x29885e={},_0x3a2b6e={'count':0x0,'rows':[]};var _0x2e9a06=_[_0x1945('0x30')](db[_0x1945('0x31')][_0x1945('0x32')],function(_0x2e2256){return{'name':_0x2e2256[_0x1945('0x33')],'type':_0x2e2256[_0x1945('0x34')][_0x1945('0x35')]};});_0x29885e['model']=_['map'](_0x2e9a06,_0x1945('0x2e'));_0x29885e[_0x1945('0x36')]=_['keys'](_0x3d0f5f['query']);_0x29885e[_0x1945('0x37')]=_[_0x1945('0x38')](_0x29885e[_0x1945('0x39')],_0x29885e[_0x1945('0x36')]);_0x489453[_0x1945('0x3a')]=_['intersection'](_0x29885e[_0x1945('0x39')],qs[_0x1945('0x3b')](_0x3d0f5f[_0x1945('0x36')][_0x1945('0x3b')]));_0x489453[_0x1945('0x3a')]=_0x489453[_0x1945('0x3a')][_0x1945('0x3c')]?_0x489453[_0x1945('0x3a')]:_0x29885e['model'];if(!_0x3d0f5f[_0x1945('0x36')][_0x1945('0x3d')]('nolimit')){_0x489453[_0x1945('0x22')]=qs['limit'](_0x3d0f5f[_0x1945('0x36')][_0x1945('0x22')]);_0x489453[_0x1945('0x1f')]=qs[_0x1945('0x1f')](_0x3d0f5f['query'][_0x1945('0x1f')]);}_0x489453['order']=qs[_0x1945('0x3e')](_0x3d0f5f[_0x1945('0x36')][_0x1945('0x3e')]);_0x489453[_0x1945('0x3f')]=qs[_0x1945('0x37')](_[_0x1945('0x40')](_0x3d0f5f[_0x1945('0x36')],_0x29885e[_0x1945('0x37')]),_0x2e9a06);if(_0x3d0f5f[_0x1945('0x36')][_0x1945('0x41')]){_0x489453[_0x1945('0x3f')]=_[_0x1945('0x42')](_0x489453[_0x1945('0x3f')],{'$or':_[_0x1945('0x30')](_0x2e9a06,function(_0x482e05){if(_0x482e05[_0x1945('0x34')]!==_0x1945('0x43')){var _0x1b43b4={};_0x1b43b4[_0x482e05[_0x1945('0x2e')]]={'$like':'%'+_0x3d0f5f[_0x1945('0x36')][_0x1945('0x41')]+'%'};return _0x1b43b4;}})});}_0x489453=_['merge']({},_0x489453,_0x3d0f5f[_0x1945('0x44')]);var _0x104fe5={'where':_0x489453[_0x1945('0x3f')]};return db[_0x1945('0x31')]['count'](_0x104fe5)[_0x1945('0x29')](function(_0x2a78d2){_0x3a2b6e[_0x1945('0x21')]=_0x2a78d2;if(_0x3d0f5f[_0x1945('0x36')][_0x1945('0x45')]){_0x489453[_0x1945('0x46')]=[{'all':!![]}];}return db[_0x1945('0x31')][_0x1945('0x47')](_0x489453);})[_0x1945('0x29')](function(_0xd5aae4){_0x3a2b6e[_0x1945('0x48')]=_0xd5aae4;return _0x3a2b6e;})[_0x1945('0x29')](respondWithFilteredResult(_0x38c284,_0x489453))[_0x1945('0x49')](handleError(_0x38c284,null));};exports[_0x1945('0x4a')]=function(_0xb15195,_0x4356f3){var _0x41da2b={'raw':![],'where':{'id':_0xb15195['params']['id']}},_0x484a34={};_0x484a34[_0x1945('0x39')]=_[_0x1945('0x4b')](db[_0x1945('0x31')][_0x1945('0x32')]);_0x484a34[_0x1945('0x36')]=_[_0x1945('0x4b')](_0xb15195[_0x1945('0x36')]);_0x484a34[_0x1945('0x37')]=_[_0x1945('0x38')](_0x484a34[_0x1945('0x39')],_0x484a34[_0x1945('0x36')]);_0x41da2b[_0x1945('0x3a')]=_[_0x1945('0x38')](_0x484a34[_0x1945('0x39')],qs[_0x1945('0x3b')](_0xb15195[_0x1945('0x36')][_0x1945('0x3b')]));_0x41da2b[_0x1945('0x3a')]=_0x41da2b['attributes']['length']?_0x41da2b['attributes']:_0x484a34[_0x1945('0x39')];if(_0xb15195['query']['includeAll']){_0x41da2b[_0x1945('0x46')]=[{'all':!![]}];}_0x41da2b=_[_0x1945('0x42')]({},_0x41da2b,_0xb15195['options']);return db['VoiceQueueReport'][_0x1945('0x4c')](_0x41da2b)[_0x1945('0x29')](handleEntityNotFound(_0x4356f3,null))['then'](respondWithResult(_0x4356f3,null))[_0x1945('0x49')](handleError(_0x4356f3,null));};exports[_0x1945('0x4d')]=function(_0x3045e5,_0x197932){return db[_0x1945('0x31')][_0x1945('0x4d')](_0x3045e5['body'],{})[_0x1945('0x29')](respondWithResult(_0x197932,0xc9))['catch'](handleError(_0x197932,null));};exports[_0x1945('0x28')]=function(_0x5044a1,_0x51542e){if(_0x5044a1[_0x1945('0x4e')]['id']){delete _0x5044a1[_0x1945('0x4e')]['id'];}return db[_0x1945('0x31')][_0x1945('0x4c')]({'where':{'id':_0x5044a1[_0x1945('0x4f')]['id']}})[_0x1945('0x29')](handleEntityNotFound(_0x51542e,null))[_0x1945('0x29')](saveUpdates(_0x5044a1[_0x1945('0x4e')],null))['then'](respondWithResult(_0x51542e,null))['catch'](handleError(_0x51542e,null));};exports['destroy']=function(_0x2c3314,_0x1d89dd){return db['VoiceQueueReport']['find']({'where':{'id':_0x2c3314[_0x1945('0x4f')]['id']}})[_0x1945('0x29')](handleEntityNotFound(_0x1d89dd,null))[_0x1945('0x29')](removeEntity(_0x1d89dd,null))[_0x1945('0x49')](handleError(_0x1d89dd,null));};exports['describe']=function(_0x2d63c1,_0x1b3d18){return db['VoiceQueueReport'][_0x1945('0x50')]()[_0x1945('0x29')](respondWithResult(_0x1b3d18,null))[_0x1945('0x49')](handleError(_0x1b3d18,null));};exports[_0x1945('0x51')]=function(_0x5298ab,_0x3c6756){var _0x5d1f87={},_0x31e4e4={},_0x2f5024={'count':0x0,'rows':[]};_0x31e4e4[_0x1945('0x39')]=_['keys'](db[_0x1945('0x31')][_0x1945('0x32')]);_0x31e4e4[_0x1945('0x36')]=_[_0x1945('0x4b')](_0x5298ab[_0x1945('0x36')]);_0x31e4e4['filters']=_[_0x1945('0x38')](_0x31e4e4[_0x1945('0x39')],_0x31e4e4[_0x1945('0x36')]);_0x5d1f87[_0x1945('0x3a')]=_['intersection'](_0x31e4e4[_0x1945('0x39')],qs[_0x1945('0x3b')](_0x5298ab[_0x1945('0x36')][_0x1945('0x3b')]));_0x5d1f87[_0x1945('0x3a')]=_0x5d1f87[_0x1945('0x3a')][_0x1945('0x3c')]?_0x5d1f87[_0x1945('0x3a')]:_0x31e4e4[_0x1945('0x39')];if(!_0x5298ab[_0x1945('0x36')]['hasOwnProperty'](_0x1945('0x52'))){_0x5d1f87[_0x1945('0x22')]=qs[_0x1945('0x22')](_0x5298ab[_0x1945('0x36')][_0x1945('0x22')]);_0x5d1f87[_0x1945('0x1f')]=qs['offset'](_0x5298ab[_0x1945('0x36')][_0x1945('0x1f')]);}_0x5d1f87[_0x1945('0x53')]=qs[_0x1945('0x3e')](_0x5298ab[_0x1945('0x36')][_0x1945('0x3e')]);_0x5d1f87[_0x1945('0x3f')]=qs[_0x1945('0x37')](_[_0x1945('0x40')](_0x5298ab[_0x1945('0x36')],_0x31e4e4[_0x1945('0x37')]));if(_0x5298ab[_0x1945('0x36')][_0x1945('0x41')]){_0x5d1f87['where']=_[_0x1945('0x42')](_0x5d1f87[_0x1945('0x3f')],{'$or':_[_0x1945('0x30')](_0x5d1f87[_0x1945('0x3a')],function(_0x2e789d){var _0x37e2e8={};_0x37e2e8[_0x2e789d]={'$like':'%'+_0x5298ab[_0x1945('0x36')][_0x1945('0x41')]+'%'};return _0x37e2e8;})});}_0x5d1f87=_['merge']({},_0x5d1f87,_0x5298ab[_0x1945('0x44')]);var _0x42acb={'where':_0x5d1f87[_0x1945('0x3f')]};return db[_0x1945('0x31')]['count'](_0x42acb)[_0x1945('0x29')](function(_0x3fe1e1){_0x2f5024[_0x1945('0x21')]=_0x3fe1e1;if(_0x5298ab[_0x1945('0x36')][_0x1945('0x45')]){_0x5d1f87[_0x1945('0x46')]=[{'all':!![]}];}return db[_0x1945('0x31')]['findAll'](_0x5d1f87);})[_0x1945('0x29')](function(_0x104bbe){_0x2f5024['rows']=_0x104bbe;return _0x2f5024;})[_0x1945('0x29')](respondWithFilteredResult(_0x3c6756,_0x5d1f87,_0x1945('0x51')))[_0x1945('0x49')](handleError(_0x3c6756,null,_0x1945('0x51')));}; \ No newline at end of file +var _0x212d=['where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','intersection','include','options','find','create','body','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','status','error','stack','name','index','map','VoiceQueueReport','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x3490f4,_0x29b7ce){var _0x24dfc5=function(_0x3a7b89){while(--_0x3a7b89){_0x3490f4['push'](_0x3490f4['shift']());}};_0x24dfc5(++_0x29b7ce);}(_0x212d,0xc1));var _0xd212=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x212d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd212('0x0'));var rimraf=require(_0xd212('0x1'));var zipdir=require(_0xd212('0x2'));var jsonpatch=require(_0xd212('0x3'));var rp=require(_0xd212('0x4'));var moment=require(_0xd212('0x5'));var BPromise=require(_0xd212('0x6'));var Mustache=require(_0xd212('0x7'));var util=require(_0xd212('0x8'));var path=require(_0xd212('0x9'));var sox=require('sox');var csv=require(_0xd212('0xa'));var ejs=require(_0xd212('0xb'));var fs=require('fs');var fs_extra=require(_0xd212('0xc'));var _=require(_0xd212('0xd'));var squel=require(_0xd212('0xe'));var crypto=require(_0xd212('0xf'));var jsforce=require(_0xd212('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd212('0xa'));var querystring=require(_0xd212('0x11'));var Papa=require('papaparse');var Redis=require(_0xd212('0x12'));var authService=require(_0xd212('0x13'));var qs=require(_0xd212('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd212('0x15'));var logger=require(_0xd212('0x16'))(_0xd212('0x17'));var utils=require(_0xd212('0x18'));var config=require(_0xd212('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd212('0x1a'))['db'];config[_0xd212('0x1b')]=_[_0xd212('0x1c')](config[_0xd212('0x1b')],{'host':_0xd212('0x1d'),'port':0x18eb});var socket=require(_0xd212('0x1e'))(new Redis(config[_0xd212('0x1b')]));require(_0xd212('0x1f'))[_0xd212('0x20')](socket);function respondWithStatusCode(_0x26881c,_0x2ceed5){_0x2ceed5=_0x2ceed5||0xcc;return function(_0x41f5e8){if(_0x41f5e8){return _0x26881c[_0xd212('0x21')](_0x2ceed5);}return _0x26881c['status'](_0x2ceed5)[_0xd212('0x22')]();};}function respondWithResult(_0x249009,_0x2f9b37){_0x2f9b37=_0x2f9b37||0xc8;return function(_0x19bf1e){if(_0x19bf1e){return _0x249009['status'](_0x2f9b37)['json'](_0x19bf1e);}};}function respondWithFilteredResult(_0x58d1cc,_0x3b41f0){return function(_0x2049e9){if(_0x2049e9){var _0x436b2a=typeof _0x3b41f0[_0xd212('0x23')]===_0xd212('0x24')&&typeof _0x3b41f0[_0xd212('0x25')]===_0xd212('0x24');var _0x240346=_0x2049e9[_0xd212('0x26')];var _0x11142=_0x436b2a?0x0:_0x3b41f0[_0xd212('0x23')];var _0x4a7d41=_0x436b2a?_0x2049e9[_0xd212('0x26')]:_0x3b41f0[_0xd212('0x23')]+_0x3b41f0[_0xd212('0x25')];var _0x1e078f;if(_0x4a7d41>=_0x240346){_0x4a7d41=_0x240346;_0x1e078f=0xc8;}else{_0x1e078f=0xce;}_0x58d1cc['status'](_0x1e078f);return _0x58d1cc['set'](_0xd212('0x27'),_0x11142+'-'+_0x4a7d41+'/'+_0x240346)[_0xd212('0x28')](_0x2049e9);}return null;};}function patchUpdates(_0x33cf69){return function(_0x3e2204){try{jsonpatch[_0xd212('0x29')](_0x3e2204,_0x33cf69,!![]);}catch(_0x521be3){return BPromise[_0xd212('0x2a')](_0x521be3);}return _0x3e2204['save']();};}function saveUpdates(_0x4eaca8,_0xd8eb92){return function(_0x4caf2b){if(_0x4caf2b){return _0x4caf2b[_0xd212('0x2b')](_0x4eaca8)[_0xd212('0x2c')](function(_0x1d21de){return _0x1d21de;});}return null;};}function removeEntity(_0x2c6435,_0x23e8b8){return function(_0xd859af){if(_0xd859af){return _0xd859af[_0xd212('0x2d')]()[_0xd212('0x2c')](function(){_0x2c6435[_0xd212('0x2e')](0xcc)[_0xd212('0x22')]();});}};}function handleEntityNotFound(_0x15d6b6,_0x2655b2){return function(_0x5abd14){if(!_0x5abd14){_0x15d6b6[_0xd212('0x21')](0x194);}return _0x5abd14;};}function handleError(_0x34e751,_0x2c03c1){_0x2c03c1=_0x2c03c1||0x1f4;return function(_0x4d17a7){logger[_0xd212('0x2f')](_0x4d17a7[_0xd212('0x30')]);if(_0x4d17a7['name']){delete _0x4d17a7[_0xd212('0x31')];}_0x34e751['status'](_0x2c03c1)['send'](_0x4d17a7);};}exports[_0xd212('0x32')]=function(_0x2b3ce5,_0x55832b){var _0x41c5a8={},_0x448a63={},_0x1f0b83={'count':0x0,'rows':[]};var _0x40ede2=_[_0xd212('0x33')](db[_0xd212('0x34')]['rawAttributes'],function(_0x4d9762){return{'name':_0x4d9762[_0xd212('0x35')],'type':_0x4d9762[_0xd212('0x36')][_0xd212('0x37')]};});_0x448a63[_0xd212('0x38')]=_['map'](_0x40ede2,_0xd212('0x31'));_0x448a63['query']=_['keys'](_0x2b3ce5['query']);_0x448a63[_0xd212('0x39')]=_['intersection'](_0x448a63['model'],_0x448a63[_0xd212('0x3a')]);_0x41c5a8[_0xd212('0x3b')]=_['intersection'](_0x448a63[_0xd212('0x38')],qs[_0xd212('0x3c')](_0x2b3ce5[_0xd212('0x3a')]['fields']));_0x41c5a8[_0xd212('0x3b')]=_0x41c5a8['attributes'][_0xd212('0x3d')]?_0x41c5a8['attributes']:_0x448a63[_0xd212('0x38')];if(!_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x3e')]('nolimit')){_0x41c5a8[_0xd212('0x25')]=qs[_0xd212('0x25')](_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x25')]);_0x41c5a8['offset']=qs[_0xd212('0x23')](_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x23')]);}_0x41c5a8[_0xd212('0x3f')]=qs[_0xd212('0x40')](_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x40')]);_0x41c5a8[_0xd212('0x41')]=qs[_0xd212('0x39')](_[_0xd212('0x42')](_0x2b3ce5['query'],_0x448a63[_0xd212('0x39')]),_0x40ede2);if(_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x43')]){_0x41c5a8[_0xd212('0x41')]=_[_0xd212('0x44')](_0x41c5a8['where'],{'$or':_[_0xd212('0x33')](_0x40ede2,function(_0x259f59){if(_0x259f59[_0xd212('0x36')]!=='VIRTUAL'){var _0x1c6c6d={};_0x1c6c6d[_0x259f59['name']]={'$like':'%'+_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x43')]+'%'};return _0x1c6c6d;}})});}_0x41c5a8=_[_0xd212('0x44')]({},_0x41c5a8,_0x2b3ce5['options']);var _0x54277f={'where':_0x41c5a8['where']};return db[_0xd212('0x34')][_0xd212('0x26')](_0x54277f)[_0xd212('0x2c')](function(_0xf94f9f){_0x1f0b83[_0xd212('0x26')]=_0xf94f9f;if(_0x2b3ce5[_0xd212('0x3a')][_0xd212('0x45')]){_0x41c5a8['include']=[{'all':!![]}];}return db[_0xd212('0x34')][_0xd212('0x46')](_0x41c5a8);})[_0xd212('0x2c')](function(_0x109cc4){_0x1f0b83[_0xd212('0x47')]=_0x109cc4;return _0x1f0b83;})[_0xd212('0x2c')](respondWithFilteredResult(_0x55832b,_0x41c5a8))[_0xd212('0x48')](handleError(_0x55832b,null));};exports[_0xd212('0x49')]=function(_0x4a22d6,_0x4123a3){var _0x14c562={'raw':![],'where':{'id':_0x4a22d6[_0xd212('0x4a')]['id']}},_0x52bb68={};_0x52bb68[_0xd212('0x38')]=_[_0xd212('0x4b')](db[_0xd212('0x34')][_0xd212('0x4c')]);_0x52bb68['query']=_[_0xd212('0x4b')](_0x4a22d6[_0xd212('0x3a')]);_0x52bb68[_0xd212('0x39')]=_[_0xd212('0x4d')](_0x52bb68[_0xd212('0x38')],_0x52bb68[_0xd212('0x3a')]);_0x14c562[_0xd212('0x3b')]=_['intersection'](_0x52bb68[_0xd212('0x38')],qs['fields'](_0x4a22d6[_0xd212('0x3a')][_0xd212('0x3c')]));_0x14c562[_0xd212('0x3b')]=_0x14c562['attributes']['length']?_0x14c562[_0xd212('0x3b')]:_0x52bb68[_0xd212('0x38')];if(_0x4a22d6[_0xd212('0x3a')][_0xd212('0x45')]){_0x14c562[_0xd212('0x4e')]=[{'all':!![]}];}_0x14c562=_[_0xd212('0x44')]({},_0x14c562,_0x4a22d6[_0xd212('0x4f')]);return db[_0xd212('0x34')][_0xd212('0x50')](_0x14c562)[_0xd212('0x2c')](handleEntityNotFound(_0x4123a3,null))[_0xd212('0x2c')](respondWithResult(_0x4123a3,null))[_0xd212('0x48')](handleError(_0x4123a3,null));};exports[_0xd212('0x51')]=function(_0x55cc62,_0x40b033){return db[_0xd212('0x34')][_0xd212('0x51')](_0x55cc62['body'],{})[_0xd212('0x2c')](respondWithResult(_0x40b033,0xc9))[_0xd212('0x48')](handleError(_0x40b033,null));};exports[_0xd212('0x2b')]=function(_0x3a2f88,_0x5de026){if(_0x3a2f88[_0xd212('0x52')]['id']){delete _0x3a2f88['body']['id'];}return db[_0xd212('0x34')][_0xd212('0x50')]({'where':{'id':_0x3a2f88[_0xd212('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5de026,null))[_0xd212('0x2c')](saveUpdates(_0x3a2f88[_0xd212('0x52')],null))[_0xd212('0x2c')](respondWithResult(_0x5de026,null))[_0xd212('0x48')](handleError(_0x5de026,null));};exports[_0xd212('0x2d')]=function(_0x597517,_0x5968f8){return db['VoiceQueueReport'][_0xd212('0x50')]({'where':{'id':_0x597517[_0xd212('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5968f8,null))['then'](removeEntity(_0x5968f8,null))['catch'](handleError(_0x5968f8,null));};exports[_0xd212('0x53')]=function(_0x5e6bec,_0x20f5c8){return db[_0xd212('0x34')]['describe']()[_0xd212('0x2c')](respondWithResult(_0x20f5c8,null))[_0xd212('0x48')](handleError(_0x20f5c8,null));};exports[_0xd212('0x54')]=function(_0x22a3fb,_0x681f28){var _0x124671={},_0x3d674a={},_0x3291da={'count':0x0,'rows':[]};_0x3d674a[_0xd212('0x38')]=_['keys'](db[_0xd212('0x34')][_0xd212('0x4c')]);_0x3d674a['query']=_[_0xd212('0x4b')](_0x22a3fb[_0xd212('0x3a')]);_0x3d674a[_0xd212('0x39')]=_[_0xd212('0x4d')](_0x3d674a[_0xd212('0x38')],_0x3d674a[_0xd212('0x3a')]);_0x124671['attributes']=_['intersection'](_0x3d674a[_0xd212('0x38')],qs[_0xd212('0x3c')](_0x22a3fb[_0xd212('0x3a')][_0xd212('0x3c')]));_0x124671[_0xd212('0x3b')]=_0x124671[_0xd212('0x3b')][_0xd212('0x3d')]?_0x124671[_0xd212('0x3b')]:_0x3d674a[_0xd212('0x38')];if(!_0x22a3fb[_0xd212('0x3a')]['hasOwnProperty'](_0xd212('0x55'))){_0x124671[_0xd212('0x25')]=qs[_0xd212('0x25')](_0x22a3fb['query'][_0xd212('0x25')]);_0x124671[_0xd212('0x23')]=qs[_0xd212('0x23')](_0x22a3fb['query'][_0xd212('0x23')]);}_0x124671[_0xd212('0x3f')]=qs[_0xd212('0x40')](_0x22a3fb[_0xd212('0x3a')][_0xd212('0x40')]);_0x124671[_0xd212('0x41')]=qs[_0xd212('0x39')](_['pick'](_0x22a3fb[_0xd212('0x3a')],_0x3d674a[_0xd212('0x39')]));if(_0x22a3fb[_0xd212('0x3a')][_0xd212('0x43')]){_0x124671[_0xd212('0x41')]=_[_0xd212('0x44')](_0x124671['where'],{'$or':_[_0xd212('0x33')](_0x124671[_0xd212('0x3b')],function(_0x1bf68a){var _0x4fed1f={};_0x4fed1f[_0x1bf68a]={'$like':'%'+_0x22a3fb[_0xd212('0x3a')][_0xd212('0x43')]+'%'};return _0x4fed1f;})});}_0x124671=_[_0xd212('0x44')]({},_0x124671,_0x22a3fb[_0xd212('0x4f')]);var _0x1c36c0={'where':_0x124671[_0xd212('0x41')]};return db[_0xd212('0x34')][_0xd212('0x26')](_0x1c36c0)['then'](function(_0x396d3a){_0x3291da[_0xd212('0x26')]=_0x396d3a;if(_0x22a3fb[_0xd212('0x3a')][_0xd212('0x45')]){_0x124671[_0xd212('0x4e')]=[{'all':!![]}];}return db[_0xd212('0x34')][_0xd212('0x46')](_0x124671);})['then'](function(_0x1c880a){_0x3291da[_0xd212('0x47')]=_0x1c880a;return _0x3291da;})['then'](respondWithFilteredResult(_0x681f28,_0x124671,_0xd212('0x54')))[_0xd212('0x48')](handleError(_0x681f28,null,_0xd212('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9fc4b60..ea6aa74 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 _0x9adb=['exports','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x128a79,_0x19f331){var _0x2ff426=function(_0x57ffc1){while(--_0x57ffc1){_0x128a79['push'](_0x128a79['shift']());}};_0x2ff426(++_0x19f331);}(_0x9adb,0x79));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb9ad('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb9ad('0x1'),'afterDestroy':_0xb9ad('0x2')};function emitEvent(_0x3e8569){return function(_0x23905e,_0x5eda44,_0x4211fd){VoiceQueueReportEvents['emit'](_0x3e8569+':'+_0x23905e['id'],_0x23905e);VoiceQueueReportEvents[_0xb9ad('0x3')](_0x3e8569,_0x23905e);_0x4211fd(null);};}for(var e in events){if(events[_0xb9ad('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xb9ad('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x32fe=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','emit'];(function(_0x41b904,_0x2e93cc){var _0x5add06=function(_0x599118){while(--_0x599118){_0x41b904['push'](_0x41b904['shift']());}};_0x5add06(++_0x2e93cc);}(_0x32fe,0x78));var _0xe32f=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x32fe[_0x39e164];return _0x13fa6b;};'use strict';var EventEmitter=require(_0xe32f('0x0'));var VoiceQueueReport=require(_0xe32f('0x1'))['db'][_0xe32f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe32f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe32f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29985c){return function(_0x59cc10,_0xc97ecc,_0x1ba1a2){VoiceQueueReportEvents['emit'](_0x29985c+':'+_0x59cc10['id'],_0x59cc10);VoiceQueueReportEvents[_0xe32f('0x5')](_0x29985c,_0x59cc10);_0x1ba1a2(null);};}for(var e in events){if(events[_0xe32f('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe32f('0x7')](e,emitEvent(event));}}module[_0xe32f('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 375ad53..9c7c9bc 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 _0x7692=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_queue','calleridnum','lodash'];(function(_0x4ad781,_0x2fea04){var _0x387080=function(_0x44adb2){while(--_0x44adb2){_0x4ad781['push'](_0x4ad781['shift']());}};_0x387080(++_0x2fea04);}(_0x7692,0x16b));var _0x2769=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x7692[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x2769('0x0'));var util=require(_0x2769('0x1'));var logger=require(_0x2769('0x2'))(_0x2769('0x3'));var moment=require(_0x2769('0x4'));var BPromise=require(_0x2769('0x5'));var rp=require(_0x2769('0x6'));var fs=require('fs');var path=require(_0x2769('0x7'));var rimraf=require(_0x2769('0x8'));var config=require(_0x2769('0x9'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x1e095e,_0x51aa23){return _0x1e095e[_0x2769('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x2769('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x2769('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0fb6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger'];(function(_0x410e36,_0x40f74f){var _0x127f2a=function(_0x3f6257){while(--_0x3f6257){_0x410e36['push'](_0x410e36['shift']());}};_0x127f2a(++_0x40f74f);}(_0x0fb6,0x12e));var _0x60fb=function(_0x4968a7,_0x1cc0ab){_0x4968a7=_0x4968a7-0x0;var _0x405d52=_0x0fb6[_0x4968a7];return _0x405d52;};'use strict';var _=require(_0x60fb('0x0'));var util=require('util');var logger=require(_0x60fb('0x1'))(_0x60fb('0x2'));var moment=require(_0x60fb('0x3'));var BPromise=require(_0x60fb('0x4'));var rp=require(_0x60fb('0x5'));var fs=require('fs');var path=require(_0x60fb('0x6'));var rimraf=require(_0x60fb('0x7'));var config=require(_0x60fb('0x8'));var attributes=require(_0x60fb('0x9'));module[_0x60fb('0xa')]=function(_0x590d67,_0x4c3da5){return _0x590d67[_0x60fb('0xb')](_0x60fb('0xc'),attributes,{'tableName':_0x60fb('0xd'),'paranoid':![],'indexes':[{'fields':[_0x60fb('0xe')]},{'fields':[_0x60fb('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 821b54d..dab11e0 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 _0x40e8=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','attributes','model','then','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash'];(function(_0x34217a,_0x1f545a){var _0x23c2be=function(_0x122660){while(--_0x122660){_0x34217a['push'](_0x34217a['shift']());}};_0x23c2be(++_0x1f545a);}(_0x40e8,0x101));var _0x840e=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x40e8[_0x384231];return _0x2480bf;};'use strict';var _=require(_0x840e('0x0'));var util=require(_0x840e('0x1'));var moment=require(_0x840e('0x2'));var BPromise=require(_0x840e('0x3'));var rs=require(_0x840e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x840e('0x5'));var logger=require(_0x840e('0x6'))(_0x840e('0x7'));var config=require(_0x840e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x840e('0x9')]['http']({'port':0x232a});config[_0x840e('0xa')]=_[_0x840e('0xb')](config['redis'],{'host':_0x840e('0xc'),'port':0x18eb});var socket=require(_0x840e('0xd'))(new Redis(config[_0x840e('0xa')]));require(_0x840e('0xe'))[_0x840e('0xf')](socket);function respondWithRpcPromise(_0x2d4286,_0x4460c1,_0x117e40){return new BPromise(function(_0x1d3967,_0x2a0880){return client['request'](_0x2d4286,_0x117e40)['then'](function(_0x191cb9){logger[_0x840e('0x10')](_0x840e('0x11'),_0x4460c1,_0x840e('0x12'));logger[_0x840e('0x13')](_0x840e('0x14'),_0x4460c1,_0x840e('0x12'),JSON[_0x840e('0x15')](_0x191cb9));if(_0x191cb9['error']){if(_0x191cb9[_0x840e('0x16')][_0x840e('0x17')]===0x1f4){logger[_0x840e('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x4460c1,_0x191cb9[_0x840e('0x16')]['message']);return _0x2a0880(_0x191cb9[_0x840e('0x16')][_0x840e('0x18')]);}logger[_0x840e('0x16')](_0x840e('0x11'),_0x4460c1,_0x191cb9['error'][_0x840e('0x18')]);return _0x1d3967(_0x191cb9[_0x840e('0x16')]['message']);}else{logger[_0x840e('0x10')](_0x840e('0x11'),_0x4460c1,_0x840e('0x12'));_0x1d3967(_0x191cb9[_0x840e('0x19')][_0x840e('0x18')]);}})[_0x840e('0x1a')](function(_0x158f8e){logger[_0x840e('0x16')](_0x840e('0x11'),_0x4460c1,_0x158f8e);_0x2a0880(_0x158f8e);});});}exports[_0x840e('0x1b')]=function(_0x132701){var _0x216a37=this;return new Promise(function(_0xc3aace,_0x35f843){return db[_0x840e('0x1c')][_0x840e('0x1d')]({'raw':_0x132701[_0x840e('0x1e')]?_0x132701['options'][_0x840e('0x1f')]===undefined?!![]:![]:!![],'where':_0x132701['options']?_0x132701[_0x840e('0x1e')][_0x840e('0x20')]||null:null,'attributes':_0x132701[_0x840e('0x1e')]?_0x132701[_0x840e('0x1e')]['attributes']||null:null,'limit':_0x132701[_0x840e('0x1e')]?_0x132701[_0x840e('0x1e')][_0x840e('0x21')]||null:null,'include':_0x132701[_0x840e('0x1e')]?_0x132701[_0x840e('0x1e')][_0x840e('0x22')]?_[_0x840e('0x23')](_0x132701[_0x840e('0x1e')][_0x840e('0x22')],function(_0x51428b){return{'model':db[_0x51428b['model']],'as':_0x51428b['as'],'attributes':_0x51428b[_0x840e('0x24')],'include':_0x51428b['include']?_[_0x840e('0x23')](_0x51428b[_0x840e('0x22')],function(_0x27ee20){return{'model':db[_0x27ee20[_0x840e('0x25')]],'as':_0x27ee20['as'],'attributes':_0x27ee20[_0x840e('0x24')],'include':_0x27ee20[_0x840e('0x22')]?_[_0x840e('0x23')](_0x27ee20[_0x840e('0x22')],function(_0x164866){return{'model':db[_0x164866[_0x840e('0x25')]],'as':_0x164866['as'],'attributes':_0x164866[_0x840e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x840e('0x26')](function(_0x296b59){logger[_0x840e('0x10')](_0x840e('0x1b'),_0x132701);logger['debug'](_0x840e('0x1b'),_0x132701,JSON[_0x840e('0x15')](_0x296b59));_0xc3aace(_0x296b59);})['catch'](function(_0x230c92){logger[_0x840e('0x16')](_0x840e('0x1b'),_0x230c92['message'],_0x132701);_0x35f843(_0x216a37[_0x840e('0x16')](0x1f4,_0x230c92[_0x840e('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x2a9847){var _0x10355b=this;return new Promise(function(_0x4a9c5d,_0x16d34e){return db[_0x840e('0x1c')]['create'](_0x2a9847[_0x840e('0x27')],{'raw':_0x2a9847[_0x840e('0x1e')]?_0x2a9847[_0x840e('0x1e')][_0x840e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5c4b62){logger[_0x840e('0x10')](_0x840e('0x28'),_0x2a9847);logger['debug'](_0x840e('0x28'),_0x2a9847,JSON[_0x840e('0x15')](_0x5c4b62));_0x4a9c5d(_0x5c4b62);})[_0x840e('0x1a')](function(_0x340fd9){logger[_0x840e('0x16')](_0x840e('0x28'),_0x340fd9[_0x840e('0x18')],_0x2a9847);_0x16d34e(_0x10355b['error'](0x1f4,_0x340fd9['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x58136a){var _0x5d5213=this;return new Promise(function(_0x58166c,_0x599b08){return db[_0x840e('0x1c')][_0x840e('0x29')](_0x58136a[_0x840e('0x27')],{'raw':_0x58136a[_0x840e('0x1e')]?_0x58136a[_0x840e('0x1e')][_0x840e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58136a['options']?_0x58136a[_0x840e('0x1e')]['where']||null:null,'attributes':_0x58136a[_0x840e('0x1e')]?_0x58136a[_0x840e('0x1e')][_0x840e('0x24')]||null:null,'limit':_0x58136a[_0x840e('0x1e')]?_0x58136a[_0x840e('0x1e')]['limit']||null:null})[_0x840e('0x26')](function(_0x1bd94d){logger[_0x840e('0x10')](_0x840e('0x2a'),_0x58136a);logger[_0x840e('0x13')](_0x840e('0x2a'),_0x58136a,JSON[_0x840e('0x15')](_0x1bd94d));_0x58166c(_0x1bd94d);})['catch'](function(_0xae6d7b){logger['error'](_0x840e('0x2a'),_0xae6d7b[_0x840e('0x18')],_0x58136a);_0x599b08(_0x5d5213[_0x840e('0x16')](0x1f4,_0xae6d7b['message']));});});}; \ No newline at end of file +var _0xff25=['info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','attributes','limit','include','model','map','then','debug','stringify','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request'];(function(_0x84a8ae,_0x17c724){var _0x13f8ee=function(_0x3f7581){while(--_0x3f7581){_0x84a8ae['push'](_0x84a8ae['shift']());}};_0x13f8ee(++_0x17c724);}(_0xff25,0xc8));var _0x5ff2=function(_0x212f99,_0x23f9f9){_0x212f99=_0x212f99-0x0;var _0x13a95c=_0xff25[_0x212f99];return _0x13a95c;};'use strict';var _=require(_0x5ff2('0x0'));var util=require('util');var moment=require(_0x5ff2('0x1'));var BPromise=require(_0x5ff2('0x2'));var rs=require(_0x5ff2('0x3'));var fs=require('fs');var Redis=require(_0x5ff2('0x4'));var db=require(_0x5ff2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ff2('0x6'))('rpc');var config=require(_0x5ff2('0x7'));var jayson=require(_0x5ff2('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5ff2('0x9')]=_[_0x5ff2('0xa')](config[_0x5ff2('0x9')],{'host':_0x5ff2('0xb'),'port':0x18eb});var socket=require(_0x5ff2('0xc'))(new Redis(config[_0x5ff2('0x9')]));require(_0x5ff2('0xd'))['register'](socket);function respondWithRpcPromise(_0x3e556c,_0x2f4aa2,_0x4b0323){return new BPromise(function(_0x24c871,_0xf5d7cd){return client[_0x5ff2('0xe')](_0x3e556c,_0x4b0323)['then'](function(_0x14ea58){logger[_0x5ff2('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x2f4aa2,_0x5ff2('0x10'));logger['debug'](_0x5ff2('0x11'),_0x2f4aa2,_0x5ff2('0x10'),JSON['stringify'](_0x14ea58));if(_0x14ea58['error']){if(_0x14ea58[_0x5ff2('0x12')][_0x5ff2('0x13')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2f4aa2,_0x14ea58[_0x5ff2('0x12')][_0x5ff2('0x14')]);return _0xf5d7cd(_0x14ea58[_0x5ff2('0x12')][_0x5ff2('0x14')]);}logger[_0x5ff2('0x12')](_0x5ff2('0x15'),_0x2f4aa2,_0x14ea58[_0x5ff2('0x12')][_0x5ff2('0x14')]);return _0x24c871(_0x14ea58[_0x5ff2('0x12')][_0x5ff2('0x14')]);}else{logger[_0x5ff2('0xf')](_0x5ff2('0x15'),_0x2f4aa2,_0x5ff2('0x10'));_0x24c871(_0x14ea58[_0x5ff2('0x16')][_0x5ff2('0x14')]);}})[_0x5ff2('0x17')](function(_0x426bb8){logger['error'](_0x5ff2('0x15'),_0x2f4aa2,_0x426bb8);_0xf5d7cd(_0x426bb8);});});}exports[_0x5ff2('0x18')]=function(_0x330bbd){var _0x2c4a1e=this;return new Promise(function(_0x327c1e,_0x55fa43){return db[_0x5ff2('0x19')][_0x5ff2('0x1a')]({'raw':_0x330bbd['options']?_0x330bbd['options'][_0x5ff2('0x1b')]===undefined?!![]:![]:!![],'where':_0x330bbd['options']?_0x330bbd['options']['where']||null:null,'attributes':_0x330bbd['options']?_0x330bbd[_0x5ff2('0x1c')][_0x5ff2('0x1d')]||null:null,'limit':_0x330bbd[_0x5ff2('0x1c')]?_0x330bbd[_0x5ff2('0x1c')][_0x5ff2('0x1e')]||null:null,'include':_0x330bbd[_0x5ff2('0x1c')]?_0x330bbd[_0x5ff2('0x1c')][_0x5ff2('0x1f')]?_['map'](_0x330bbd[_0x5ff2('0x1c')][_0x5ff2('0x1f')],function(_0x2aefd0){return{'model':db[_0x2aefd0[_0x5ff2('0x20')]],'as':_0x2aefd0['as'],'attributes':_0x2aefd0[_0x5ff2('0x1d')],'include':_0x2aefd0[_0x5ff2('0x1f')]?_[_0x5ff2('0x21')](_0x2aefd0[_0x5ff2('0x1f')],function(_0x322eb6){return{'model':db[_0x322eb6['model']],'as':_0x322eb6['as'],'attributes':_0x322eb6[_0x5ff2('0x1d')],'include':_0x322eb6['include']?_[_0x5ff2('0x21')](_0x322eb6[_0x5ff2('0x1f')],function(_0x43a249){return{'model':db[_0x43a249[_0x5ff2('0x20')]],'as':_0x43a249['as'],'attributes':_0x43a249[_0x5ff2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5ff2('0x22')](function(_0x5324db){logger[_0x5ff2('0xf')](_0x5ff2('0x18'),_0x330bbd);logger[_0x5ff2('0x23')](_0x5ff2('0x18'),_0x330bbd,JSON[_0x5ff2('0x24')](_0x5324db));_0x327c1e(_0x5324db);})['catch'](function(_0x465e7c){logger[_0x5ff2('0x12')](_0x5ff2('0x18'),_0x465e7c['message'],_0x330bbd);_0x55fa43(_0x2c4a1e[_0x5ff2('0x12')](0x1f4,_0x465e7c[_0x5ff2('0x14')]));});});};exports[_0x5ff2('0x25')]=function(_0x1589f5){var _0x27d644=this;return new Promise(function(_0x500e3a,_0x3434ec){return db[_0x5ff2('0x19')][_0x5ff2('0x26')](_0x1589f5['body'],{'raw':_0x1589f5[_0x5ff2('0x1c')]?_0x1589f5[_0x5ff2('0x1c')][_0x5ff2('0x1b')]===undefined?!![]:![]:!![]})[_0x5ff2('0x22')](function(_0x294968){logger[_0x5ff2('0xf')](_0x5ff2('0x25'),_0x1589f5);logger[_0x5ff2('0x23')]('CreateVoiceQueueReport',_0x1589f5,JSON['stringify'](_0x294968));_0x500e3a(_0x294968);})[_0x5ff2('0x17')](function(_0x22b09d){logger['error'](_0x5ff2('0x25'),_0x22b09d['message'],_0x1589f5);_0x3434ec(_0x27d644[_0x5ff2('0x12')](0x1f4,_0x22b09d[_0x5ff2('0x14')]));});});};exports[_0x5ff2('0x27')]=function(_0x389c60){var _0x3679dd=this;return new Promise(function(_0x161c9b,_0x174bc1){return db[_0x5ff2('0x19')][_0x5ff2('0x28')](_0x389c60[_0x5ff2('0x29')],{'raw':_0x389c60[_0x5ff2('0x1c')]?_0x389c60['options'][_0x5ff2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x389c60[_0x5ff2('0x1c')]?_0x389c60[_0x5ff2('0x1c')][_0x5ff2('0x2a')]||null:null,'attributes':_0x389c60[_0x5ff2('0x1c')]?_0x389c60[_0x5ff2('0x1c')][_0x5ff2('0x1d')]||null:null,'limit':_0x389c60['options']?_0x389c60['options'][_0x5ff2('0x1e')]||null:null})['then'](function(_0x10d5ac){logger[_0x5ff2('0xf')]('UpdateVoiceQueueReport',_0x389c60);logger[_0x5ff2('0x23')](_0x5ff2('0x27'),_0x389c60,JSON[_0x5ff2('0x24')](_0x10d5ac));_0x161c9b(_0x10d5ac);})['catch'](function(_0x2187ef){logger[_0x5ff2('0x12')]('UpdateVoiceQueueReport',_0x2187ef['message'],_0x389c60);_0x174bc1(_0x3679dd[_0x5ff2('0x12')](0x1f4,_0x2187ef[_0x5ff2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d72bf7d..e86aa95 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 _0xece0=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x39658b,_0xf72a7f){var _0xa37442=function(_0x2edfaf){while(--_0x2edfaf){_0x39658b['push'](_0x39658b['shift']());}};_0xa37442(++_0xf72a7f);}(_0xece0,0xa5));var _0x0ece=function(_0x6d21a1,_0x5edd09){_0x6d21a1=_0x6d21a1-0x0;var _0x1551f2=_0xece0[_0x6d21a1];return _0x1551f2;};'use strict';var VoiceQueueReportEvents=require(_0x0ece('0x0'));var events=[_0x0ece('0x1'),'remove',_0x0ece('0x2')];function createListener(_0x42a41c,_0x5304fa){return function(_0x116fb3){_0x5304fa[_0x0ece('0x3')](_0x42a41c,_0x116fb3);};}function removeListener(_0xc9c26b,_0x5f1c86){return function(){VoiceQueueReportEvents['removeListener'](_0xc9c26b,_0x5f1c86);};}exports[_0x0ece('0x4')]=function(_0x3a107d){for(var _0xb736f9=0x0,_0x22ffca=events[_0x0ece('0x5')];_0xb736f9<_0x22ffca;_0xb736f9++){var _0x1de5cd=events[_0xb736f9];var _0x41dae7=createListener(_0x0ece('0x6')+_0x1de5cd,_0x3a107d);VoiceQueueReportEvents['on'](_0x1de5cd,_0x41dae7);}}; \ No newline at end of file +var _0x2fda=['./voiceQueueReport.events','update','emit','register','length','voiceQueueReport:'];(function(_0x1c79c5,_0x3cc84c){var _0x558010=function(_0x488739){while(--_0x488739){_0x1c79c5['push'](_0x1c79c5['shift']());}};_0x558010(++_0x3cc84c);}(_0x2fda,0x186));var _0xa2fd=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x2fda[_0x55f8b4];return _0x2475f9;};'use strict';var VoiceQueueReportEvents=require(_0xa2fd('0x0'));var events=['save','remove',_0xa2fd('0x1')];function createListener(_0x3042fc,_0x25ffbf){return function(_0x329784){_0x25ffbf[_0xa2fd('0x2')](_0x3042fc,_0x329784);};}function removeListener(_0x5a36d9,_0x497c5f){return function(){VoiceQueueReportEvents['removeListener'](_0x5a36d9,_0x497c5f);};}exports[_0xa2fd('0x3')]=function(_0x1bab5a){for(var _0x4c6b0b=0x0,_0x11994b=events[_0xa2fd('0x4')];_0x4c6b0b<_0x11994b;_0x4c6b0b++){var _0x290063=events[_0x4c6b0b];var _0x4abb3a=createListener(_0xa2fd('0x5')+_0x290063,_0x1bab5a);VoiceQueueReportEvents['on'](_0x290063,_0x4abb3a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 1e5ea6a..182b5cf 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 _0x8fc2=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x20ee74,_0x1e50e3){var _0x260f57=function(_0x577c9c){while(--_0x577c9c){_0x20ee74['push'](_0x20ee74['shift']());}};_0x260f57(++_0x1e50e3);}(_0x8fc2,0x14d));var _0x28fc=function(_0x257d5a,_0x1ae1ad){_0x257d5a=_0x257d5a-0x0;var _0x311937=_0x8fc2[_0x257d5a];return _0x311937;};'use strict';var multer=require(_0x28fc('0x0'));var util=require(_0x28fc('0x1'));var path=require(_0x28fc('0x2'));var timeout=require(_0x28fc('0x3'));var express=require('express');var router=express[_0x28fc('0x4')]();var fs_extra=require(_0x28fc('0x5'));var auth=require(_0x28fc('0x6'));var interaction=require(_0x28fc('0x7'));var config=require(_0x28fc('0x8'));var controller=require(_0x28fc('0x9'));router[_0x28fc('0xa')]('/',auth[_0x28fc('0xb')](),controller[_0x28fc('0xc')]);router[_0x28fc('0xa')](_0x28fc('0xd'),auth[_0x28fc('0xb')](),controller[_0x28fc('0xe')]);router[_0x28fc('0xf')]('/',auth[_0x28fc('0xb')](),controller[_0x28fc('0x10')]);router['put'](_0x28fc('0xd'),auth[_0x28fc('0xb')](),controller['update']);router[_0x28fc('0x11')](_0x28fc('0xd'),auth[_0x28fc('0xb')](),controller[_0x28fc('0x12')]);module[_0x28fc('0x13')]=router; \ No newline at end of file +var _0xacc8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xacc8,0xc5));var _0x8acc=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0xacc8[_0x367a3d];return _0x460539;};'use strict';var multer=require(_0x8acc('0x0'));var util=require('util');var path=require(_0x8acc('0x1'));var timeout=require(_0x8acc('0x2'));var express=require(_0x8acc('0x3'));var router=express[_0x8acc('0x4')]();var fs_extra=require(_0x8acc('0x5'));var auth=require(_0x8acc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8acc('0x7'));var controller=require(_0x8acc('0x8'));router[_0x8acc('0x9')]('/',auth['isAuthenticated'](),controller[_0x8acc('0xa')]);router['get']('/:id',auth[_0x8acc('0xb')](),controller['show']);router[_0x8acc('0xc')]('/',auth['isAuthenticated'](),controller[_0x8acc('0xd')]);router[_0x8acc('0xe')]('/:id',auth[_0x8acc('0xb')](),controller[_0x8acc('0xf')]);router[_0x8acc('0x10')](_0x8acc('0x11'),auth[_0x8acc('0xb')](),controller[_0x8acc('0x12')]);module[_0x8acc('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 341873e..717341f 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 _0xf2d2=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x88e70,_0x3fc401){var _0x2a3cae=function(_0x43e7c0){while(--_0x43e7c0){_0x88e70['push'](_0x88e70['shift']());}};_0x2a3cae(++_0x3fc401);}(_0xf2d2,0x1d1));var _0x2f2d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf2d2[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x2f2d('0x0'));var moment=require(_0x2f2d('0x1'));module[_0x2f2d('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2f2d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2f2d('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x2f2d('0x5')](_0x2f2d('0x6'))}}; \ No newline at end of file +var _0x7c3d=['sequelize','moment','exports','STRING','literal'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7c3d,0x73));var _0xd7c3=function(_0x1b9629,_0x5554b4){_0x1b9629=_0x1b9629-0x0;var _0x4ade3a=_0x7c3d[_0x1b9629];return _0x4ade3a;};'use strict';var Sequelize=require(_0xd7c3('0x0'));var moment=require(_0xd7c3('0x1'));module[_0xd7c3('0x2')]={'time':{'type':Sequelize[_0xd7c3('0x3')]},'callid':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd7c3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xd7c3('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a30c3ba..4a984a9 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 _0xc5ff=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','crypto'];(function(_0x5a4a3a,_0x5547ec){var _0x110e09=function(_0x356a47){while(--_0x356a47){_0x5a4a3a['push'](_0x5a4a3a['shift']());}};_0x110e09(++_0x5547ec);}(_0xc5ff,0x129));var _0xfc5f=function(_0x4b37a7,_0x3f3dc5){_0x4b37a7=_0x4b37a7-0x0;var _0x551954=_0xc5ff[_0x4b37a7];return _0x551954;};'use strict';var emlformat=require(_0xfc5f('0x0'));var rimraf=require(_0xfc5f('0x1'));var zipdir=require(_0xfc5f('0x2'));var jsonpatch=require(_0xfc5f('0x3'));var rp=require(_0xfc5f('0x4'));var moment=require('moment');var BPromise=require(_0xfc5f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc5f('0x6'));var sox=require(_0xfc5f('0x7'));var csv=require(_0xfc5f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc5f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc5f('0xa'));var jsforce=require(_0xfc5f('0xb'));var deskjs=require(_0xfc5f('0xc'));var toCsv=require(_0xfc5f('0x8'));var querystring=require(_0xfc5f('0xd'));var Papa=require('papaparse');var Redis=require(_0xfc5f('0xe'));var authService=require(_0xfc5f('0xf'));var qs=require(_0xfc5f('0x10'));var as=require(_0xfc5f('0x11'));var hardwareService=require(_0xfc5f('0x12'));var logger=require(_0xfc5f('0x13'))('api');var utils=require(_0xfc5f('0x14'));var config=require(_0xfc5f('0x15'));var licenseUtil=require(_0xfc5f('0x16'));var db=require(_0xfc5f('0x17'))['db'];function respondWithStatusCode(_0x33e74a,_0x566752){_0x566752=_0x566752||0xcc;return function(_0x19309b){if(_0x19309b){return _0x33e74a[_0xfc5f('0x18')](_0x566752);}return _0x33e74a[_0xfc5f('0x19')](_0x566752)[_0xfc5f('0x1a')]();};}function respondWithResult(_0xd02bf8,_0x370c5e){_0x370c5e=_0x370c5e||0xc8;return function(_0x3dc1ab){if(_0x3dc1ab){return _0xd02bf8['status'](_0x370c5e)[_0xfc5f('0x1b')](_0x3dc1ab);}};}function respondWithFilteredResult(_0x170ac9,_0x1bc3e2){return function(_0x3eaa2c){if(_0x3eaa2c){var _0x9703b2=typeof _0x1bc3e2[_0xfc5f('0x1c')]===_0xfc5f('0x1d')&&typeof _0x1bc3e2['limit']===_0xfc5f('0x1d');var _0x3168e3=_0x3eaa2c[_0xfc5f('0x1e')];var _0x600e6f=_0x9703b2?0x0:_0x1bc3e2[_0xfc5f('0x1c')];var _0x3c6046=_0x9703b2?_0x3eaa2c[_0xfc5f('0x1e')]:_0x1bc3e2[_0xfc5f('0x1c')]+_0x1bc3e2[_0xfc5f('0x1f')];var _0xd11938;if(_0x3c6046>=_0x3168e3){_0x3c6046=_0x3168e3;_0xd11938=0xc8;}else{_0xd11938=0xce;}_0x170ac9['status'](_0xd11938);return _0x170ac9[_0xfc5f('0x20')](_0xfc5f('0x21'),_0x600e6f+'-'+_0x3c6046+'/'+_0x3168e3)[_0xfc5f('0x1b')](_0x3eaa2c);}return null;};}function patchUpdates(_0x12f030){return function(_0x28232c){try{jsonpatch[_0xfc5f('0x22')](_0x28232c,_0x12f030,!![]);}catch(_0x2540cb){return BPromise[_0xfc5f('0x23')](_0x2540cb);}return _0x28232c[_0xfc5f('0x24')]();};}function saveUpdates(_0xc40b68,_0x32b50b){return function(_0x4af734){if(_0x4af734){return _0x4af734['update'](_0xc40b68)[_0xfc5f('0x25')](function(_0x58eefe){return _0x58eefe;});}return null;};}function removeEntity(_0x3c7464,_0x38c1b4){return function(_0x2f0ed2){if(_0x2f0ed2){return _0x2f0ed2[_0xfc5f('0x26')]()['then'](function(){_0x3c7464[_0xfc5f('0x19')](0xcc)[_0xfc5f('0x1a')]();});}};}function handleEntityNotFound(_0x5ce746,_0x3e32c4){return function(_0x2b6787){if(!_0x2b6787){_0x5ce746[_0xfc5f('0x18')](0x194);}return _0x2b6787;};}function handleError(_0x36a7fc,_0x223601){_0x223601=_0x223601||0x1f4;return function(_0x380f94){logger[_0xfc5f('0x27')](_0x380f94[_0xfc5f('0x28')]);if(_0x380f94['name']){delete _0x380f94[_0xfc5f('0x29')];}_0x36a7fc[_0xfc5f('0x19')](_0x223601)[_0xfc5f('0x2a')](_0x380f94);};}exports[_0xfc5f('0x2b')]=function(_0xb41095,_0x59e541){var _0x2e4455={},_0x1bf5bc={},_0x1d2fc4={'count':0x0,'rows':[]};var _0x26d795=_['map'](db[_0xfc5f('0x2c')][_0xfc5f('0x2d')],function(_0x2f65c9){return{'name':_0x2f65c9['fieldName'],'type':_0x2f65c9[_0xfc5f('0x2e')][_0xfc5f('0x2f')]};});_0x1bf5bc[_0xfc5f('0x30')]=_[_0xfc5f('0x31')](_0x26d795,_0xfc5f('0x29'));_0x1bf5bc[_0xfc5f('0x32')]=_[_0xfc5f('0x33')](_0xb41095[_0xfc5f('0x32')]);_0x1bf5bc[_0xfc5f('0x34')]=_[_0xfc5f('0x35')](_0x1bf5bc['model'],_0x1bf5bc[_0xfc5f('0x32')]);_0x2e4455['attributes']=_[_0xfc5f('0x35')](_0x1bf5bc[_0xfc5f('0x30')],qs[_0xfc5f('0x36')](_0xb41095['query'][_0xfc5f('0x36')]));_0x2e4455[_0xfc5f('0x37')]=_0x2e4455[_0xfc5f('0x37')][_0xfc5f('0x38')]?_0x2e4455[_0xfc5f('0x37')]:_0x1bf5bc[_0xfc5f('0x30')];if(!_0xb41095['query'][_0xfc5f('0x39')]('nolimit')){_0x2e4455[_0xfc5f('0x1f')]=qs[_0xfc5f('0x1f')](_0xb41095[_0xfc5f('0x32')][_0xfc5f('0x1f')]);_0x2e4455['offset']=qs[_0xfc5f('0x1c')](_0xb41095[_0xfc5f('0x32')][_0xfc5f('0x1c')]);}_0x2e4455[_0xfc5f('0x3a')]=qs[_0xfc5f('0x3b')](_0xb41095['query'][_0xfc5f('0x3b')]);_0x2e4455[_0xfc5f('0x3c')]=qs[_0xfc5f('0x34')](_[_0xfc5f('0x3d')](_0xb41095[_0xfc5f('0x32')],_0x1bf5bc[_0xfc5f('0x34')]),_0x26d795);if(_0xb41095[_0xfc5f('0x32')][_0xfc5f('0x3e')]){_0x2e4455['where']=_['merge'](_0x2e4455[_0xfc5f('0x3c')],{'$or':_[_0xfc5f('0x31')](_0x26d795,function(_0x130228){if(_0x130228[_0xfc5f('0x2e')]!==_0xfc5f('0x3f')){var _0x2f1972={};_0x2f1972[_0x130228[_0xfc5f('0x29')]]={'$like':'%'+_0xb41095[_0xfc5f('0x32')][_0xfc5f('0x3e')]+'%'};return _0x2f1972;}})});}_0x2e4455=_[_0xfc5f('0x40')]({},_0x2e4455,_0xb41095[_0xfc5f('0x41')]);var _0x45d5cb={'where':_0x2e4455[_0xfc5f('0x3c')]};return db[_0xfc5f('0x2c')]['count'](_0x45d5cb)[_0xfc5f('0x25')](function(_0x16efa3){_0x1d2fc4[_0xfc5f('0x1e')]=_0x16efa3;if(_0xb41095[_0xfc5f('0x32')][_0xfc5f('0x42')]){_0x2e4455[_0xfc5f('0x43')]=[{'all':!![]}];}return db[_0xfc5f('0x2c')][_0xfc5f('0x44')](_0x2e4455);})[_0xfc5f('0x25')](function(_0x507f5d){_0x1d2fc4[_0xfc5f('0x45')]=_0x507f5d;return _0x1d2fc4;})['then'](respondWithFilteredResult(_0x59e541,_0x2e4455))[_0xfc5f('0x46')](handleError(_0x59e541,null));};exports[_0xfc5f('0x47')]=function(_0x2ef5fc,_0x5f3f2d){var _0x2d3de4={'raw':!![],'where':{'id':_0x2ef5fc['params']['id']}},_0x159966={};_0x159966['model']=_[_0xfc5f('0x33')](db['VoiceQueuesLog'][_0xfc5f('0x2d')]);_0x159966[_0xfc5f('0x32')]=_['keys'](_0x2ef5fc[_0xfc5f('0x32')]);_0x159966[_0xfc5f('0x34')]=_[_0xfc5f('0x35')](_0x159966[_0xfc5f('0x30')],_0x159966[_0xfc5f('0x32')]);_0x2d3de4[_0xfc5f('0x37')]=_[_0xfc5f('0x35')](_0x159966[_0xfc5f('0x30')],qs[_0xfc5f('0x36')](_0x2ef5fc['query'][_0xfc5f('0x36')]));_0x2d3de4[_0xfc5f('0x37')]=_0x2d3de4[_0xfc5f('0x37')][_0xfc5f('0x38')]?_0x2d3de4['attributes']:_0x159966['model'];if(_0x2ef5fc[_0xfc5f('0x32')][_0xfc5f('0x42')]){_0x2d3de4[_0xfc5f('0x43')]=[{'all':!![]}];}_0x2d3de4=_[_0xfc5f('0x40')]({},_0x2d3de4,_0x2ef5fc[_0xfc5f('0x41')]);return db[_0xfc5f('0x2c')]['find'](_0x2d3de4)['then'](handleEntityNotFound(_0x5f3f2d,null))[_0xfc5f('0x25')](respondWithResult(_0x5f3f2d,null))['catch'](handleError(_0x5f3f2d,null));};exports[_0xfc5f('0x48')]=function(_0x159de6,_0x39390d){return db[_0xfc5f('0x2c')][_0xfc5f('0x48')](_0x159de6['body'],{})['then'](respondWithResult(_0x39390d,0xc9))[_0xfc5f('0x46')](handleError(_0x39390d,null));};exports[_0xfc5f('0x49')]=function(_0x580c91,_0x50527b){if(_0x580c91['body']['id']){delete _0x580c91[_0xfc5f('0x4a')]['id'];}return db[_0xfc5f('0x2c')][_0xfc5f('0x4b')]({'where':{'id':_0x580c91[_0xfc5f('0x4c')]['id']}})[_0xfc5f('0x25')](handleEntityNotFound(_0x50527b,null))[_0xfc5f('0x25')](saveUpdates(_0x580c91[_0xfc5f('0x4a')],null))[_0xfc5f('0x25')](respondWithResult(_0x50527b,null))[_0xfc5f('0x46')](handleError(_0x50527b,null));};exports[_0xfc5f('0x26')]=function(_0x1de238,_0x579c44){return db[_0xfc5f('0x2c')][_0xfc5f('0x4b')]({'where':{'id':_0x1de238[_0xfc5f('0x4c')]['id']}})[_0xfc5f('0x25')](handleEntityNotFound(_0x579c44,null))['then'](removeEntity(_0x579c44,null))[_0xfc5f('0x46')](handleError(_0x579c44,null));}; \ No newline at end of file +var _0x10a4=['filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceQueuesLog','then','include','findAll','show','params','create','catch','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','sendStatus','name','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x3169e0,_0x1c21d0){var _0x5a1959=function(_0x1feeb6){while(--_0x1feeb6){_0x3169e0['push'](_0x3169e0['shift']());}};_0x5a1959(++_0x1c21d0);}(_0x10a4,0xe7));var _0x410a=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x10a4[_0x2f57b2];return _0x5ace77;};'use strict';var emlformat=require(_0x410a('0x0'));var rimraf=require(_0x410a('0x1'));var zipdir=require(_0x410a('0x2'));var jsonpatch=require(_0x410a('0x3'));var rp=require(_0x410a('0x4'));var moment=require('moment');var BPromise=require(_0x410a('0x5'));var Mustache=require(_0x410a('0x6'));var util=require(_0x410a('0x7'));var path=require(_0x410a('0x8'));var sox=require('sox');var csv=require(_0x410a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x410a('0xa'));var _=require(_0x410a('0xb'));var squel=require('squel');var crypto=require(_0x410a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x410a('0xd'));var Papa=require('papaparse');var Redis=require(_0x410a('0xe'));var authService=require(_0x410a('0xf'));var qs=require(_0x410a('0x10'));var as=require(_0x410a('0x11'));var hardwareService=require(_0x410a('0x12'));var logger=require('../../config/logger')(_0x410a('0x13'));var utils=require(_0x410a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x410a('0x15'));var db=require(_0x410a('0x16'))['db'];function respondWithStatusCode(_0x14bfed,_0xba5770){_0xba5770=_0xba5770||0xcc;return function(_0x24aa10){if(_0x24aa10){return _0x14bfed['sendStatus'](_0xba5770);}return _0x14bfed[_0x410a('0x17')](_0xba5770)[_0x410a('0x18')]();};}function respondWithResult(_0xcbb6aa,_0x4552d4){_0x4552d4=_0x4552d4||0xc8;return function(_0x30e845){if(_0x30e845){return _0xcbb6aa[_0x410a('0x17')](_0x4552d4)[_0x410a('0x19')](_0x30e845);}};}function respondWithFilteredResult(_0x461177,_0x2b0827){return function(_0x16b985){if(_0x16b985){var _0x5dec7c=typeof _0x2b0827[_0x410a('0x1a')]===_0x410a('0x1b')&&typeof _0x2b0827['limit']===_0x410a('0x1b');var _0x369b15=_0x16b985[_0x410a('0x1c')];var _0x17cc70=_0x5dec7c?0x0:_0x2b0827[_0x410a('0x1a')];var _0x2b1784=_0x5dec7c?_0x16b985[_0x410a('0x1c')]:_0x2b0827['offset']+_0x2b0827[_0x410a('0x1d')];var _0x265e29;if(_0x2b1784>=_0x369b15){_0x2b1784=_0x369b15;_0x265e29=0xc8;}else{_0x265e29=0xce;}_0x461177[_0x410a('0x17')](_0x265e29);return _0x461177[_0x410a('0x1e')](_0x410a('0x1f'),_0x17cc70+'-'+_0x2b1784+'/'+_0x369b15)['json'](_0x16b985);}return null;};}function patchUpdates(_0x49239a){return function(_0x14b015){try{jsonpatch[_0x410a('0x20')](_0x14b015,_0x49239a,!![]);}catch(_0x44a4bb){return BPromise[_0x410a('0x21')](_0x44a4bb);}return _0x14b015[_0x410a('0x22')]();};}function saveUpdates(_0x4abd3d,_0x437578){return function(_0x4679ae){if(_0x4679ae){return _0x4679ae['update'](_0x4abd3d)['then'](function(_0x1f669e){return _0x1f669e;});}return null;};}function removeEntity(_0x387a41,_0xf0d694){return function(_0x2fcb95){if(_0x2fcb95){return _0x2fcb95['destroy']()['then'](function(){_0x387a41[_0x410a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1300,_0x454740){return function(_0x309367){if(!_0x309367){_0x4c1300[_0x410a('0x23')](0x194);}return _0x309367;};}function handleError(_0x2e9773,_0x5f15d6){_0x5f15d6=_0x5f15d6||0x1f4;return function(_0x59b8ab){logger['error'](_0x59b8ab['stack']);if(_0x59b8ab[_0x410a('0x24')]){delete _0x59b8ab[_0x410a('0x24')];}_0x2e9773[_0x410a('0x17')](_0x5f15d6)['send'](_0x59b8ab);};}exports['index']=function(_0x6d4392,_0x2dca6b){var _0x1cb16b={},_0x277523={},_0x4e8fa4={'count':0x0,'rows':[]};var _0xec5ff2=_[_0x410a('0x25')](db['VoiceQueuesLog'][_0x410a('0x26')],function(_0xae660){return{'name':_0xae660[_0x410a('0x27')],'type':_0xae660[_0x410a('0x28')][_0x410a('0x29')]};});_0x277523[_0x410a('0x2a')]=_['map'](_0xec5ff2,_0x410a('0x24'));_0x277523[_0x410a('0x2b')]=_[_0x410a('0x2c')](_0x6d4392['query']);_0x277523[_0x410a('0x2d')]=_[_0x410a('0x2e')](_0x277523[_0x410a('0x2a')],_0x277523['query']);_0x1cb16b[_0x410a('0x2f')]=_['intersection'](_0x277523['model'],qs[_0x410a('0x30')](_0x6d4392['query'][_0x410a('0x30')]));_0x1cb16b[_0x410a('0x2f')]=_0x1cb16b[_0x410a('0x2f')][_0x410a('0x31')]?_0x1cb16b[_0x410a('0x2f')]:_0x277523[_0x410a('0x2a')];if(!_0x6d4392['query']['hasOwnProperty']('nolimit')){_0x1cb16b[_0x410a('0x1d')]=qs[_0x410a('0x1d')](_0x6d4392[_0x410a('0x2b')][_0x410a('0x1d')]);_0x1cb16b[_0x410a('0x1a')]=qs[_0x410a('0x1a')](_0x6d4392[_0x410a('0x2b')][_0x410a('0x1a')]);}_0x1cb16b[_0x410a('0x32')]=qs[_0x410a('0x33')](_0x6d4392[_0x410a('0x2b')][_0x410a('0x33')]);_0x1cb16b[_0x410a('0x34')]=qs[_0x410a('0x2d')](_[_0x410a('0x35')](_0x6d4392['query'],_0x277523[_0x410a('0x2d')]),_0xec5ff2);if(_0x6d4392[_0x410a('0x2b')]['filter']){_0x1cb16b['where']=_[_0x410a('0x36')](_0x1cb16b[_0x410a('0x34')],{'$or':_['map'](_0xec5ff2,function(_0x4ad7b5){if(_0x4ad7b5[_0x410a('0x28')]!==_0x410a('0x37')){var _0x50d1f3={};_0x50d1f3[_0x4ad7b5[_0x410a('0x24')]]={'$like':'%'+_0x6d4392[_0x410a('0x2b')][_0x410a('0x38')]+'%'};return _0x50d1f3;}})});}_0x1cb16b=_['merge']({},_0x1cb16b,_0x6d4392[_0x410a('0x39')]);var _0x264f0b={'where':_0x1cb16b['where']};return db[_0x410a('0x3a')][_0x410a('0x1c')](_0x264f0b)[_0x410a('0x3b')](function(_0x4abf6e){_0x4e8fa4['count']=_0x4abf6e;if(_0x6d4392[_0x410a('0x2b')]['includeAll']){_0x1cb16b[_0x410a('0x3c')]=[{'all':!![]}];}return db[_0x410a('0x3a')][_0x410a('0x3d')](_0x1cb16b);})[_0x410a('0x3b')](function(_0x2109c3){_0x4e8fa4['rows']=_0x2109c3;return _0x4e8fa4;})[_0x410a('0x3b')](respondWithFilteredResult(_0x2dca6b,_0x1cb16b))['catch'](handleError(_0x2dca6b,null));};exports[_0x410a('0x3e')]=function(_0x2c2921,_0x2a43e7){var _0x5541f0={'raw':!![],'where':{'id':_0x2c2921[_0x410a('0x3f')]['id']}},_0x45c359={};_0x45c359['model']=_[_0x410a('0x2c')](db['VoiceQueuesLog'][_0x410a('0x26')]);_0x45c359[_0x410a('0x2b')]=_['keys'](_0x2c2921['query']);_0x45c359['filters']=_[_0x410a('0x2e')](_0x45c359[_0x410a('0x2a')],_0x45c359['query']);_0x5541f0[_0x410a('0x2f')]=_[_0x410a('0x2e')](_0x45c359[_0x410a('0x2a')],qs[_0x410a('0x30')](_0x2c2921[_0x410a('0x2b')][_0x410a('0x30')]));_0x5541f0['attributes']=_0x5541f0[_0x410a('0x2f')][_0x410a('0x31')]?_0x5541f0['attributes']:_0x45c359[_0x410a('0x2a')];if(_0x2c2921[_0x410a('0x2b')]['includeAll']){_0x5541f0['include']=[{'all':!![]}];}_0x5541f0=_[_0x410a('0x36')]({},_0x5541f0,_0x2c2921[_0x410a('0x39')]);return db[_0x410a('0x3a')]['find'](_0x5541f0)['then'](handleEntityNotFound(_0x2a43e7,null))['then'](respondWithResult(_0x2a43e7,null))['catch'](handleError(_0x2a43e7,null));};exports[_0x410a('0x40')]=function(_0x3bf691,_0xe742ab){return db[_0x410a('0x3a')]['create'](_0x3bf691['body'],{})[_0x410a('0x3b')](respondWithResult(_0xe742ab,0xc9))[_0x410a('0x41')](handleError(_0xe742ab,null));};exports[_0x410a('0x42')]=function(_0x20e0b0,_0x4831ed){if(_0x20e0b0[_0x410a('0x43')]['id']){delete _0x20e0b0[_0x410a('0x43')]['id'];}return db[_0x410a('0x3a')]['find']({'where':{'id':_0x20e0b0[_0x410a('0x3f')]['id']}})[_0x410a('0x3b')](handleEntityNotFound(_0x4831ed,null))[_0x410a('0x3b')](saveUpdates(_0x20e0b0[_0x410a('0x43')],null))[_0x410a('0x3b')](respondWithResult(_0x4831ed,null))[_0x410a('0x41')](handleError(_0x4831ed,null));};exports['destroy']=function(_0x324058,_0x472d6e){return db[_0x410a('0x3a')][_0x410a('0x44')]({'where':{'id':_0x324058[_0x410a('0x3f')]['id']}})[_0x410a('0x3b')](handleEntityNotFound(_0x472d6e,null))[_0x410a('0x3b')](removeEntity(_0x472d6e,null))['catch'](handleError(_0x472d6e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 916b6be..8221134 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 _0x014b=['event','dtm','../../config/logger','api','moment','bluebird','path','./voiceQueuesLog.attributes','define','voice_queues_log'];(function(_0xb1a3f3,_0x15e89a){var _0x24fb0f=function(_0x4b9651){while(--_0x4b9651){_0xb1a3f3['push'](_0xb1a3f3['shift']());}};_0x24fb0f(++_0x15e89a);}(_0x014b,0x7a));var _0xb014=function(_0x167d55,_0x49e07a){_0x167d55=_0x167d55-0x0;var _0x2ead73=_0x014b[_0x167d55];return _0x2ead73;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb014('0x0'))(_0xb014('0x1'));var moment=require(_0xb014('0x2'));var BPromise=require(_0xb014('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb014('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb014('0x5'));module['exports']=function(_0x20dee0,_0x2c631d){return _0x20dee0[_0xb014('0x6')]('VoiceQueuesLog',attributes,{'tableName':_0xb014('0x7'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xb014('0x8'),_0xb014('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1f71=['exports','define','VoiceQueuesLog','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0x1f71,0xaa));var _0x11f7=function(_0x3db99d,_0x57332f){_0x3db99d=_0x3db99d-0x0;var _0x1151e4=_0x1f71[_0x3db99d];return _0x1151e4;};'use strict';var _=require('lodash');var util=require(_0x11f7('0x0'));var logger=require(_0x11f7('0x1'))(_0x11f7('0x2'));var moment=require(_0x11f7('0x3'));var BPromise=require(_0x11f7('0x4'));var rp=require(_0x11f7('0x5'));var fs=require('fs');var path=require(_0x11f7('0x6'));var rimraf=require(_0x11f7('0x7'));var config=require(_0x11f7('0x8'));var attributes=require(_0x11f7('0x9'));module[_0x11f7('0xa')]=function(_0x5110aa,_0x48f717){return _0x5110aa[_0x11f7('0xb')](_0x11f7('0xc'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x11f7('0xd'),'fields':['event',_0x11f7('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 1a3bfd2..bb67c9d 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 _0x4b49=['client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x389711,_0x4b4fda){var _0x299571=function(_0x18bbf5){while(--_0x18bbf5){_0x389711['push'](_0x389711['shift']());}};_0x299571(++_0x4b4fda);}(_0x4b49,0xf3));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x94b4('0x0'));var util=require(_0x94b4('0x1'));var moment=require(_0x94b4('0x2'));var BPromise=require(_0x94b4('0x3'));var rs=require(_0x94b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b4('0x5'))['db'];var utils=require(_0x94b4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x94b4('0x7'));var jayson=require(_0x94b4('0x8'));var client=jayson[_0x94b4('0x9')][_0x94b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x132285,_0x2d190c,_0x4bc6b6){return new BPromise(function(_0x3e8197,_0x1b273c){return client[_0x94b4('0xb')](_0x132285,_0x4bc6b6)[_0x94b4('0xc')](function(_0x5c50ed){logger[_0x94b4('0xd')](_0x94b4('0xe'),_0x2d190c,_0x94b4('0xf'));logger['debug'](_0x94b4('0x10'),_0x2d190c,_0x94b4('0xf'),JSON['stringify'](_0x5c50ed));if(_0x5c50ed['error']){if(_0x5c50ed['error'][_0x94b4('0x11')]===0x1f4){logger[_0x94b4('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d190c,_0x5c50ed[_0x94b4('0x12')][_0x94b4('0x13')]);return _0x1b273c(_0x5c50ed['error']['message']);}logger[_0x94b4('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d190c,_0x5c50ed[_0x94b4('0x12')]['message']);return _0x3e8197(_0x5c50ed[_0x94b4('0x12')][_0x94b4('0x13')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x2d190c,'request\x20sent');_0x3e8197(_0x5c50ed[_0x94b4('0x14')][_0x94b4('0x13')]);}})['catch'](function(_0xa86640){logger[_0x94b4('0x12')](_0x94b4('0xe'),_0x2d190c,_0xa86640);_0x1b273c(_0xa86640);});});} \ No newline at end of file +var _0x0922=['jayson/promise','client','http','request','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0x3ec5c4,_0x310d2d){var _0xb4c6b2=function(_0xbca717){while(--_0xbca717){_0x3ec5c4['push'](_0x3ec5c4['shift']());}};_0xb4c6b2(++_0x310d2d);}(_0x0922,0x77));var _0x2092=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x0922[_0x9d639c];return _0x1671de;};'use strict';var _=require(_0x2092('0x0'));var util=require(_0x2092('0x1'));var moment=require(_0x2092('0x2'));var BPromise=require(_0x2092('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2092('0x4'));var db=require(_0x2092('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2092('0x6'));var jayson=require(_0x2092('0x7'));var client=jayson[_0x2092('0x8')][_0x2092('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c0f2b,_0x342602,_0x5472a0){return new BPromise(function(_0x3f0460,_0x36f231){return client[_0x2092('0xa')](_0x4c0f2b,_0x5472a0)['then'](function(_0x3931e3){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x342602,_0x2092('0xb'));logger[_0x2092('0xc')](_0x2092('0xd'),_0x342602,'request\x20sent',JSON['stringify'](_0x3931e3));if(_0x3931e3[_0x2092('0xe')]){if(_0x3931e3[_0x2092('0xe')][_0x2092('0xf')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x342602,_0x3931e3[_0x2092('0xe')][_0x2092('0x10')]);return _0x36f231(_0x3931e3[_0x2092('0xe')][_0x2092('0x10')]);}logger['error'](_0x2092('0x11'),_0x342602,_0x3931e3[_0x2092('0xe')][_0x2092('0x10')]);return _0x3f0460(_0x3931e3[_0x2092('0xe')][_0x2092('0x10')]);}else{logger[_0x2092('0x12')](_0x2092('0x11'),_0x342602,_0x2092('0xb'));_0x3f0460(_0x3931e3[_0x2092('0x13')]['message']);}})[_0x2092('0x14')](function(_0x5d9938){logger[_0x2092('0xe')](_0x2092('0x11'),_0x342602,_0x5d9938);_0x36f231(_0x5d9938);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 48ce212..5cbc819 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 _0xac59=['destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','update','delete'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xac59,0x160));var _0x9ac5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xac59[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x9ac5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ac5('0x1'));var router=express[_0x9ac5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9ac5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9ac5('0x4'));var controller=require(_0x9ac5('0x5'));router[_0x9ac5('0x6')]('/',auth[_0x9ac5('0x7')](),controller[_0x9ac5('0x8')]);router['get'](_0x9ac5('0x9'),auth[_0x9ac5('0x7')](),controller[_0x9ac5('0xa')]);router['get'](_0x9ac5('0xb'),auth[_0x9ac5('0x7')](),controller[_0x9ac5('0xc')]);router[_0x9ac5('0x6')](_0x9ac5('0xd'),auth[_0x9ac5('0x7')](),controller[_0x9ac5('0xe')]);router[_0x9ac5('0x6')](_0x9ac5('0xf'),controller[_0x9ac5('0x10')]);router['get'](_0x9ac5('0x11'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x9ac5('0x12')]('/',auth[_0x9ac5('0x7')](),controller[_0x9ac5('0x13')]);router[_0x9ac5('0x12')](_0x9ac5('0x11'),auth[_0x9ac5('0x7')](),controller[_0x9ac5('0x14')]);router['put'](_0x9ac5('0xb'),auth[_0x9ac5('0x7')](),controller[_0x9ac5('0x15')]);router[_0x9ac5('0x16')](_0x9ac5('0xb'),auth['isAuthenticated'](),controller[_0x9ac5('0x17')]);module[_0x9ac5('0x18')]=router; \ No newline at end of file +var _0x26e9=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','downloads','post','create','/:id/transcribe','put','update','delete','destroy','exports','multer','util'];(function(_0x266e3f,_0x4f62a3){var _0x2cfe54=function(_0xff61c){while(--_0xff61c){_0x266e3f['push'](_0x266e3f['shift']());}};_0x2cfe54(++_0x4f62a3);}(_0x26e9,0x1ae));var _0x926e=function(_0x270061,_0x4e41e1){_0x270061=_0x270061-0x0;var _0x329604=_0x26e9[_0x270061];return _0x329604;};'use strict';var multer=require(_0x926e('0x0'));var util=require(_0x926e('0x1'));var path=require(_0x926e('0x2'));var timeout=require('connect-timeout');var express=require(_0x926e('0x3'));var router=express[_0x926e('0x4')]();var fs_extra=require(_0x926e('0x5'));var auth=require(_0x926e('0x6'));var interaction=require(_0x926e('0x7'));var config=require('../../config/environment');var controller=require(_0x926e('0x8'));router[_0x926e('0x9')]('/',auth[_0x926e('0xa')](),controller[_0x926e('0xb')]);router['get'](_0x926e('0xc'),auth[_0x926e('0xa')](),controller[_0x926e('0xd')]);router[_0x926e('0x9')](_0x926e('0xe'),auth[_0x926e('0xa')](),controller[_0x926e('0xf')]);router[_0x926e('0x9')]('/:id/download',auth[_0x926e('0xa')](),controller[_0x926e('0x10')]);router[_0x926e('0x9')](_0x926e('0x11'),controller[_0x926e('0x12')]);router[_0x926e('0x9')]('/:id/transcribe',auth[_0x926e('0xa')](),controller['downloadTranscribe']);router[_0x926e('0x13')]('/',auth[_0x926e('0xa')](),controller[_0x926e('0x14')]);router[_0x926e('0x13')](_0x926e('0x15'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0x926e('0x16')](_0x926e('0xe'),auth[_0x926e('0xa')](),controller[_0x926e('0x17')]);router[_0x926e('0x18')](_0x926e('0xe'),auth[_0x926e('0xa')](),controller[_0x926e('0x19')]);module[_0x926e('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 a31da3b..d7420d3 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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 bb04385..8e2d9f4 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 _0x76fd=['col','token','$and','push','secrets','Sequelize','ValidationError','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','format','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5'];(function(_0x4b82aa,_0x2a4201){var _0x2008e4=function(_0xf33e5c){while(--_0xf33e5c){_0x4b82aa['push'](_0x4b82aa['shift']());}};_0x2008e4(++_0x2a4201);}(_0x76fd,0x166));var _0xd76f=function(_0x162246,_0x4e5038){_0x162246=_0x162246-0x0;var _0x32ac95=_0x76fd[_0x162246];return _0x32ac95;};'use strict';var emlformat=require(_0xd76f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd76f('0x1'));var jsonpatch=require(_0xd76f('0x2'));var rp=require('request-promise');var moment=require(_0xd76f('0x3'));var BPromise=require(_0xd76f('0x4'));var Mustache=require('mustache');var util=require(_0xd76f('0x5'));var path=require('path');var sox=require(_0xd76f('0x6'));var csv=require('to-csv');var ejs=require(_0xd76f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd76f('0x8'));var squel=require('squel');var crypto=require(_0xd76f('0x9'));var jsforce=require(_0xd76f('0xa'));var deskjs=require(_0xd76f('0xb'));var toCsv=require(_0xd76f('0xc'));var querystring=require('querystring');var Papa=require(_0xd76f('0xd'));var AWS=require(_0xd76f('0xe'));var uuidv4=require(_0xd76f('0xf'));var Redis=require(_0xd76f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd76f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd76f('0x12'));var logger=require(_0xd76f('0x13'))(_0xd76f('0x14'));var utils=require(_0xd76f('0x15'));var config=require(_0xd76f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd76f('0x17'))['db'];function respondWithStatusCode(_0x17f146,_0xa5faed){_0xa5faed=_0xa5faed||0xcc;return function(_0x5bce45){if(_0x5bce45){return _0x17f146[_0xd76f('0x18')](_0xa5faed);}return _0x17f146[_0xd76f('0x19')](_0xa5faed)[_0xd76f('0x1a')]();};}function respondWithResult(_0x513c6e,_0x2a3323){_0x2a3323=_0x2a3323||0xc8;return function(_0x493c84){if(_0x493c84){return _0x513c6e[_0xd76f('0x19')](_0x2a3323)[_0xd76f('0x1b')](_0x493c84);}};}function respondWithFilteredResult(_0x380420,_0x132751){return function(_0x5a7453){if(_0x5a7453){var _0xfcda90=typeof _0x132751[_0xd76f('0x1c')]===_0xd76f('0x1d')&&typeof _0x132751[_0xd76f('0x1e')]===_0xd76f('0x1d');var _0x43b60c=_0x5a7453[_0xd76f('0x1f')];var _0x1e09ae=_0xfcda90?0x0:_0x132751[_0xd76f('0x1c')];var _0x1e15ef=_0xfcda90?_0x5a7453[_0xd76f('0x1f')]:_0x132751[_0xd76f('0x1c')]+_0x132751[_0xd76f('0x1e')];var _0x29c363;if(_0x1e15ef>=_0x43b60c){_0x1e15ef=_0x43b60c;_0x29c363=0xc8;}else{_0x29c363=0xce;}_0x380420[_0xd76f('0x19')](_0x29c363);return _0x380420[_0xd76f('0x20')]('Content-Range',_0x1e09ae+'-'+_0x1e15ef+'/'+_0x43b60c)[_0xd76f('0x1b')](_0x5a7453);}return null;};}function patchUpdates(_0x4fbb9c){return function(_0x2fdcb3){try{jsonpatch[_0xd76f('0x21')](_0x2fdcb3,_0x4fbb9c,!![]);}catch(_0x4ce1da){return BPromise[_0xd76f('0x22')](_0x4ce1da);}return _0x2fdcb3[_0xd76f('0x23')]();};}function saveUpdates(_0x288c01,_0x5e92dc){return function(_0x508e3){if(_0x508e3){return _0x508e3[_0xd76f('0x24')](_0x288c01)[_0xd76f('0x25')](function(_0x1faad8){return _0x1faad8;});}return null;};}function removeEntity(_0x273a63,_0x1e971f){return function(_0x1d1a1c){if(_0x1d1a1c){return _0x1d1a1c[_0xd76f('0x26')]()[_0xd76f('0x25')](function(){_0x273a63[_0xd76f('0x19')](0xcc)[_0xd76f('0x1a')]();});}};}function handleEntityNotFound(_0x4fe7a5,_0x48a4e){return function(_0x4a8962){if(!_0x4a8962){_0x4fe7a5[_0xd76f('0x18')](0x194);}return _0x4a8962;};}function handleError(_0x3bd40f,_0x589267){_0x589267=_0x589267||0x1f4;return function(_0x79f991){logger[_0xd76f('0x27')](_0x79f991[_0xd76f('0x28')]);if(_0x79f991[_0xd76f('0x29')]){delete _0x79f991[_0xd76f('0x29')];}_0x3bd40f[_0xd76f('0x19')](_0x589267)[_0xd76f('0x2a')](_0x79f991);};}exports[_0xd76f('0x2b')]=function(_0x39afa5,_0x26cf1d){var _0x5a4f1c={},_0x1a7759={},_0x3bc1bc={'count':0x0,'rows':[]};var _0x650985=_[_0xd76f('0x2c')](db[_0xd76f('0x2d')][_0xd76f('0x2e')],function(_0x380432){return{'name':_0x380432['fieldName'],'type':_0x380432[_0xd76f('0x2f')][_0xd76f('0x30')]};});_0x1a7759['model']=_[_0xd76f('0x31')](_[_0xd76f('0x2c')](_0x650985,_0xd76f('0x29')),[_0xd76f('0x32')]);_0x1a7759['query']=_[_0xd76f('0x33')](_0x39afa5[_0xd76f('0x34')]);_0x1a7759[_0xd76f('0x35')]=_[_0xd76f('0x36')](_0x1a7759[_0xd76f('0x37')],_0x1a7759[_0xd76f('0x34')]);_0x5a4f1c[_0xd76f('0x38')]=_[_0xd76f('0x36')](_0x1a7759[_0xd76f('0x37')],qs['fields'](_0x39afa5['query'][_0xd76f('0x39')]));_0x5a4f1c[_0xd76f('0x38')]=_0x5a4f1c[_0xd76f('0x38')][_0xd76f('0x3a')]?_0x5a4f1c[_0xd76f('0x38')]:_0x1a7759[_0xd76f('0x37')];if(!_0x39afa5[_0xd76f('0x34')][_0xd76f('0x3b')](_0xd76f('0x3c'))){_0x5a4f1c[_0xd76f('0x1e')]=qs[_0xd76f('0x1e')](_0x39afa5[_0xd76f('0x34')][_0xd76f('0x1e')]);_0x5a4f1c[_0xd76f('0x1c')]=qs['offset'](_0x39afa5[_0xd76f('0x34')][_0xd76f('0x1c')]);}_0x5a4f1c[_0xd76f('0x3d')]=qs[_0xd76f('0x3e')](_0x39afa5[_0xd76f('0x34')]['sort']);_0x5a4f1c[_0xd76f('0x3f')]=qs[_0xd76f('0x35')](_[_0xd76f('0x40')](_0x39afa5[_0xd76f('0x34')],_0x1a7759[_0xd76f('0x35')]),_0x650985);if(_0x39afa5['query']['filter']){_0x5a4f1c['where']=_[_0xd76f('0x41')](_0x5a4f1c['where'],{'$or':_[_0xd76f('0x2c')](_0x650985,function(_0x5e2918){if(_0x5e2918[_0xd76f('0x2f')]!=='VIRTUAL'){var _0x9249d0={};_0x9249d0[_0x5e2918[_0xd76f('0x29')]]={'$like':'%'+_0x39afa5['query']['filter']+'%'};return _0x9249d0;}})});}_0x5a4f1c=_['merge']({},_0x5a4f1c,_0x39afa5[_0xd76f('0x42')]);var _0x22f55f={'where':_0x5a4f1c[_0xd76f('0x3f')]};return db[_0xd76f('0x2d')][_0xd76f('0x1f')](_0x22f55f)[_0xd76f('0x25')](function(_0x1e16a7){_0x3bc1bc[_0xd76f('0x1f')]=_0x1e16a7;if(_0x39afa5[_0xd76f('0x34')][_0xd76f('0x43')]){_0x5a4f1c[_0xd76f('0x44')]=[{'all':!![]}];}return db[_0xd76f('0x2d')][_0xd76f('0x45')](_0x5a4f1c);})[_0xd76f('0x25')](function(_0x1bbf3d){_0x3bc1bc['rows']=_0x1bbf3d;return _0x3bc1bc;})[_0xd76f('0x25')](respondWithFilteredResult(_0x26cf1d,_0x5a4f1c))['catch'](handleError(_0x26cf1d,null));};exports['show']=function(_0x5d9e12,_0x167182){var _0x3c0c5f={'raw':![],'where':{'id':_0x5d9e12[_0xd76f('0x46')]['id']}},_0x5aa379={};_0x5aa379[_0xd76f('0x37')]=_[_0xd76f('0x33')](db['VoiceRecording'][_0xd76f('0x2e')]);_0x5aa379[_0xd76f('0x34')]=_[_0xd76f('0x33')](_0x5d9e12[_0xd76f('0x34')]);_0x5aa379['filters']=_[_0xd76f('0x36')](_0x5aa379[_0xd76f('0x37')],_0x5aa379[_0xd76f('0x34')]);_0x3c0c5f['attributes']=_[_0xd76f('0x36')](_0x5aa379['model'],qs[_0xd76f('0x39')](_0x5d9e12[_0xd76f('0x34')][_0xd76f('0x39')]));_0x3c0c5f[_0xd76f('0x38')]=_0x3c0c5f[_0xd76f('0x38')][_0xd76f('0x3a')]?_0x3c0c5f[_0xd76f('0x38')]:_0x5aa379['model'];if(_0x5d9e12['query'][_0xd76f('0x43')]){_0x3c0c5f[_0xd76f('0x44')]=[{'all':!![]}];}_0x3c0c5f=_['merge']({},_0x3c0c5f,_0x5d9e12[_0xd76f('0x42')]);return db[_0xd76f('0x2d')][_0xd76f('0x47')](_0x3c0c5f)[_0xd76f('0x25')](handleEntityNotFound(_0x167182,null))[_0xd76f('0x25')](respondWithResult(_0x167182,null))[_0xd76f('0x48')](handleError(_0x167182,null));};exports[_0xd76f('0x49')]=function(_0x2e0c23,_0x301616){return db[_0xd76f('0x2d')][_0xd76f('0x49')](_0x2e0c23[_0xd76f('0x4a')],{})[_0xd76f('0x25')](respondWithResult(_0x301616,0xc9))['catch'](handleError(_0x301616,null));};exports[_0xd76f('0x24')]=function(_0x29c924,_0x3ab411){if(_0x29c924[_0xd76f('0x4a')]['id']){delete _0x29c924['body']['id'];}return db['VoiceRecording'][_0xd76f('0x47')]({'where':{'id':_0x29c924[_0xd76f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ab411,null))[_0xd76f('0x25')](saveUpdates(_0x29c924[_0xd76f('0x4a')],null))['then'](respondWithResult(_0x3ab411,null))[_0xd76f('0x48')](handleError(_0x3ab411,null));};exports[_0xd76f('0x4b')]=function(_0x43bf2a,_0x4ef7d0){return db[_0xd76f('0x2d')][_0xd76f('0x4b')]()[_0xd76f('0x25')](respondWithResult(_0x4ef7d0,null))[_0xd76f('0x48')](handleError(_0x4ef7d0,null));};exports[_0xd76f('0x4c')]=function(_0xb11753,_0x55b454,_0x495932){var _0x1f2866=require(_0xd76f('0x4d'));var _0x238c41=![];var _0x360af4={};if(_0xb11753['query']['type']&&_0xb11753[_0xd76f('0x34')][_0xd76f('0x2f')]===_0xd76f('0x4e')){_0x360af4[_0xd76f('0x4e')]=_0xb11753[_0xd76f('0x46')]['id'];}else{_0x360af4['id']=_0xb11753[_0xd76f('0x46')]['id'];}return db['VoiceRecording'][_0xd76f('0x47')]({'where':_0x360af4,'attributes':['id',_0xd76f('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x55b454,null))[_0xd76f('0x25')](function(_0x2f0b04){if(_0x2f0b04){var _0x1dae18=_0x2f0b04[_0xd76f('0x4f')];var _0x56f1ff=util[_0xd76f('0x32')](_0xd76f('0x50'),_0x1dae18);if(fs[_0xd76f('0x51')](_0x56f1ff)){_0x238c41=!![];return _0x1f2866[_0xd76f('0x52')](_0x56f1ff,_0x1dae18,config['secrets'][_0xd76f('0x53')])[_0xd76f('0x25')](function(){return _0x2f0b04;});}return _0x2f0b04;}})[_0xd76f('0x25')](function(_0xf0f3af){if(_0xf0f3af){var _0x4872b1=_0xf0f3af['value'];if(!fs[_0xd76f('0x51')](_0x4872b1)){throw new db['Sequelize']['ValidationError'](_0xd76f('0x54'));}if(_0xf0f3af[_0xd76f('0x55')]){return _0x55b454['download'](_0x4872b1,_0xf0f3af['filename']+path[_0xd76f('0x56')](_0x4872b1),function(){if(_0x238c41){fs['unlink'](_0x4872b1);}});}else{return _0x55b454[_0xd76f('0x4c')](_0x4872b1,function(_0x3f0999){if(_0x238c41){fs[_0xd76f('0x57')](_0x4872b1);}});}}})[_0xd76f('0x48')](function(_0x24c0e3){if(_0x24c0e3['message']==='VoiceRecording\x20not\x20found'){_0x55b454[_0xd76f('0x19')](0x194)[_0xd76f('0x2a')](_0xd76f('0x58'));}else{return handleError(_0x55b454,null);}});};exports[_0xd76f('0x59')]=function(_0x479142,_0x1f1cb0,_0x5ed695){var _0x5c9962=require('../../components/encryptor');var _0x2061df=![];var _0x42835f={'$and':[db[_0xd76f('0x5a')][_0xd76f('0x3f')](db[_0xd76f('0x5a')]['fn'](_0xd76f('0x5b'),db[_0xd76f('0x5a')][_0xd76f('0x5c')](_0xd76f('0x4e'))),_0x479142['query'][_0xd76f('0x5d')])]};if(_0x479142['query']['type']&&_0x479142[_0xd76f('0x34')][_0xd76f('0x2f')]===_0xd76f('0x4e')){_0x42835f[_0xd76f('0x5e')][_0xd76f('0x5f')]({'uniqueid':_0x479142['params']['id']});}else{_0x42835f[_0xd76f('0x5e')][_0xd76f('0x5f')]({'id':_0x479142['params']['id']});}return db['VoiceRecording'][_0xd76f('0x47')]({'where':_0x42835f,'attributes':['id',_0xd76f('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x1f1cb0,null))[_0xd76f('0x25')](function(_0x1156c7){if(_0x1156c7){var _0x46b719=util[_0xd76f('0x32')](_0xd76f('0x50'),_0x1156c7[_0xd76f('0x4f')]);if(fs[_0xd76f('0x51')](_0x46b719)){_0x2061df=!![];return _0x5c9962[_0xd76f('0x52')](_0x46b719,_0x1156c7['value'],config[_0xd76f('0x60')][_0xd76f('0x53')])[_0xd76f('0x25')](function(){return _0x1156c7;});}return _0x1156c7;}})[_0xd76f('0x25')](function(_0x423edb){if(_0x423edb){if(!fs['existsSync'](_0x423edb['value'])){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))](_0xd76f('0x54'));}if(_0x423edb[_0xd76f('0x55')]){return _0x1f1cb0['download'](_0x423edb[_0xd76f('0x4f')],_0x423edb[_0xd76f('0x55')]+path[_0xd76f('0x56')](_0x423edb[_0xd76f('0x4f')]),function(){if(_0x2061df){fs[_0xd76f('0x57')](_0x423edb[_0xd76f('0x4f')]);}});}else{return _0x1f1cb0[_0xd76f('0x4c')](_0x423edb['value'],function(_0x33d3cf){if(_0x2061df){fs['unlink'](_0x423edb['value']);}});}}})[_0xd76f('0x48')](handleError(_0x1f1cb0,null));};exports['destroy']=function(_0x1347e1,_0x126296){return db['VoiceRecording'][_0xd76f('0x47')]({'where':{'id':_0x1347e1[_0xd76f('0x46')]['id']}})['then'](function(_0x244ec9){if(_[_0xd76f('0x63')](_0x244ec9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x244ec9;})[_0xd76f('0x25')](function(_0x4b5aca){var _0x1d3cda=_0x4b5aca[_0xd76f('0x4f')];logger[_0xd76f('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x1d3cda);if(!_[_0xd76f('0x63')](_0x4b5aca[_0xd76f('0x4f')])&&fs['existsSync'](_0x1d3cda)){logger[_0xd76f('0x64')](_0xd76f('0x65')+_0x1d3cda+_0xd76f('0x66'));fs[_0xd76f('0x67')](_0x1d3cda);}_0x1d3cda=_0x1d3cda+_0xd76f('0x68');if(!_[_0xd76f('0x63')](_0x4b5aca[_0xd76f('0x4f')])&&fs[_0xd76f('0x51')](_0x1d3cda)){logger[_0xd76f('0x64')](_0xd76f('0x65')+_0x1d3cda+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd76f('0x67')](_0x1d3cda);}return _0x4b5aca;})[_0xd76f('0x25')](function(_0x5eb3d4){if(!_0x5eb3d4)throw new InternalError();return _0x5eb3d4[_0xd76f('0x26')]();})[_0xd76f('0x25')](function(){_0x126296[_0xd76f('0x19')](0xcc)[_0xd76f('0x1a')]();})['catch'](handleError(_0x126296,null));};function getBucketslist(_0xa8358,_0x2d0ddb,_0x24d093){return new Promise(function(_0x39f172,_0xfce24e){var _0x1e77c9=new AWS['S3']({'accessKeyId':_0x2d0ddb,'secretAccessKey':_0xa8358,'region':_0x24d093});_0x1e77c9[_0xd76f('0x69')]({},function(_0x49a8ca,_0x2480ed){if(_0x49a8ca){return _0xfce24e(_0x49a8ca);}else{return _0x39f172(_0x2480ed);}});});}function createBucket(_0x1ccf67,_0x31b595,_0x531517,_0x788ee9){return new Promise(function(_0x22f3e2,_0x4aa5ab){var _0x2862a5=new AWS['S3']({'accessKeyId':_0x31b595,'secretAccessKey':_0x1ccf67,'region':_0x531517});_0x2862a5['createBucket']({'Bucket':_0x788ee9},function(_0xd979ec,_0x166914){if(_0xd979ec){return _0x4aa5ab(_0xd979ec);}else{return _0x22f3e2(_0x166914);}});});}function uploadFile(_0x3b0366,_0x4146ec,_0x6ed8e,_0x21aa95,_0x1fa10b,_0x468aa5){return new Promise(function(_0xefaaac,_0x4b8791){var _0x44a0bd=new AWS['S3']({'accessKeyId':_0x4146ec,'secretAccessKey':_0x3b0366,'region':_0x6ed8e});_0x44a0bd[_0xd76f('0x6a')]({'Bucket':_0x21aa95,'Key':_0x1fa10b,'Body':_0x468aa5},function(_0x2d57b3,_0x2199da){if(_0x2d57b3){return _0x4b8791(_0x2d57b3);}else{return _0xefaaac(_0x2199da);}});});}function startTranscribe(_0xaa6336,_0x48b4b9,_0x1fa291,_0xc91ee0,_0x4ebdd6,_0x2020ee){return new Promise(function(_0x28e148,_0x48f8f4){var _0x25c4c1=new AWS[(_0xd76f('0x6b'))]({'accessKeyId':_0x48b4b9,'secretAccessKey':_0xaa6336,'region':_0x1fa291});_0x25c4c1[_0xd76f('0x6c')]({'TranscriptionJobName':_0xc91ee0,'LanguageCode':_0x4ebdd6,'Media':{'MediaFileUri':_0x2020ee}},function(_0x5a153c,_0x23813c){if(_0x5a153c){return _0x48f8f4(_0x5a153c);}else{return _0x28e148(_0x23813c);}});});}function transcribe(_0x659e26,_0x1d4056,_0x13d75f,_0x3a61a3,_0x3cfc72,_0x462cc5,_0x565dbf){return new Promise(function(_0x45f8a1,_0x37b2c3){var _0x313d00={};logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x6d'),_0x659e26,_0x3cfc72));return uploadFile(_0x1d4056,_0x13d75f,_0x3a61a3,_0x3cfc72,path[_0xd76f('0x6e')](_0x462cc5),fs['readFileSync'](_0x462cc5))[_0xd76f('0x25')](function(_0x42d2b5){logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x6f'),_0x659e26,_0x3cfc72,_0x42d2b5[_0xd76f('0x70')]));_0x313d00[_0xd76f('0x71')]=_0x42d2b5[_0xd76f('0x72')];_0x313d00[_0xd76f('0x73')]=_0x42d2b5[_0xd76f('0x70')];logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x74'),_0x659e26));return startTranscribe(_0x1d4056,_0x13d75f,_0x3a61a3,uuidv4(),_0x565dbf,_0x42d2b5['Location']);})[_0xd76f('0x25')](function(_0x550954){logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x75'),_0x659e26,_0x550954[_0xd76f('0x76')][_0xd76f('0x77')]));_0x313d00['transcribeName']=_0x550954[_0xd76f('0x76')][_0xd76f('0x77')];_0x313d00['transcribeStatus']=_0x550954[_0xd76f('0x76')][_0xd76f('0x78')];return _0x45f8a1(_0x313d00);})[_0xd76f('0x48')](function(_0x513be7){return _0x37b2c3(_0x513be7);});});}exports[_0xd76f('0x79')]=function(_0x60deb7,_0xc3b8c8,_0x486fc3){var _0x1d664e;var _0x1379bf;var _0x3ff8a7;var _0x42ccb5=require(_0xd76f('0x4d'));return db[_0xd76f('0x2d')][_0xd76f('0x7a')]({'where':{'id':_0x60deb7['params']['id']}})['then'](function(_0x2bc8de){if(_0x2bc8de){var _0x2c9e61=util['format'](_0xd76f('0x50'),_0x2bc8de[_0xd76f('0x4f')]);if(fs['existsSync'](_0x2c9e61)){cypher=!![];return _0x42ccb5['decryptFile'](_0x2c9e61,_0x2bc8de[_0xd76f('0x4f')],config[_0xd76f('0x60')]['recording'])[_0xd76f('0x25')](function(){return _0x2bc8de;});}return _0x2bc8de;}})[_0xd76f('0x25')](function(_0x572521){if(!_0x572521){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))](_0xd76f('0x7b'));}_0x1379bf=_0x572521;return db[_0xd76f('0x7c')][_0xd76f('0x7a')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xc3b8c8,null))[_0xd76f('0x25')](function(_0x2f43ea){if(_0x2f43ea){_0x1d664e=_0x2f43ea;if(!_0x1d664e['transcribe']||!_0x1d664e[_0xd76f('0x7d')]||!_0x1d664e[_0xd76f('0x7e')]||!_0x1d664e[_0xd76f('0x7f')]||!_0x1d664e[_0xd76f('0x71')]){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))](_0xd76f('0x80'));}if(_0x60deb7[_0xd76f('0x4a')][_0xd76f('0x81')]&&(!_0x1d664e['sentiment']||!_0x1d664e['sentimentAccountId']||!_0x1d664e[_0xd76f('0x82')]||!_0x1d664e['language']||!_0x1d664e[_0xd76f('0x71')])){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))](_0xd76f('0x83'));}return db['CloudProvider'][_0xd76f('0x7a')]({'where':{'id':_0x1d664e[_0xd76f('0x7d')]}});}})[_0xd76f('0x25')](function(_0x182910){if(!_0x182910){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x182910[_0xd76f('0x84')]||!_0x182910[_0xd76f('0x85')]){throw new db[(_0xd76f('0x61'))][(_0xd76f('0x62'))](_0xd76f('0x86'));}_0x3ff8a7=_0x182910;return getBucketslist(_0x3ff8a7[_0xd76f('0x84')],_0x3ff8a7[_0xd76f('0x85')],_0x1d664e['transcribeRegion']);})['then'](function(_0x4424cd){if(_0x4424cd&&_0x4424cd[_0xd76f('0x87')]){var _0x3cca6c=_[_0xd76f('0x47')](_0x4424cd[_0xd76f('0x87')],function(_0x31c068){return _0x31c068[_0xd76f('0x88')]===_0x1d664e[_0xd76f('0x71')];});if(!_0x3cca6c){logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x89'),_0x60deb7[_0xd76f('0x46')]['id'],_0x1d664e[_0xd76f('0x71')]));return createBucket(_0x3ff8a7[_0xd76f('0x84')],_0x3ff8a7[_0xd76f('0x85')],_0x1d664e[_0xd76f('0x7e')],_0x1d664e[_0xd76f('0x71')]);}logger[_0xd76f('0x64')](util[_0xd76f('0x32')](_0xd76f('0x8a'),_0x60deb7[_0xd76f('0x46')]['id'],_0x1d664e[_0xd76f('0x71')]));return;}})[_0xd76f('0x25')](function(_0x815616){if(_0x1379bf[_0xd76f('0x8b')]===_0xd76f('0x8c')){return transcribe(_0x60deb7[_0xd76f('0x46')]['id'],_0x3ff8a7[_0xd76f('0x84')],_0x3ff8a7[_0xd76f('0x85')],_0x1d664e[_0xd76f('0x7e')],_0x1d664e[_0xd76f('0x71')],_0x1379bf['value'],_0x1d664e['language']);}else{logger[_0xd76f('0x64')](util['format'](_0xd76f('0x8d'),_0x60deb7['params']['id']));return{'transcribeStatus':_0xd76f('0x8e')};}})[_0xd76f('0x25')](function(_0x2ac80f){if(_0x2ac80f){_0x2ac80f[_0xd76f('0x8f')]=_0x60deb7['body']['runSentiment'];return _0x1379bf['updateAttributes'](_0x2ac80f);}})['then'](respondWithResult(_0xc3b8c8,null))[_0xd76f('0x48')](handleError(_0xc3b8c8,null));};function writeFile(_0x282919,_0x3f3196){return new Promise(function(_0xba204b,_0x5ed45a){fs[_0xd76f('0x90')](_0x3f3196,_0x282919,function(_0x22e90d,_0x1d6376){if(_0x22e90d){return _0x5ed45a(_0x22e90d);}else{return _0xba204b(_0x1d6376);}});});}exports[_0xd76f('0x91')]=function(_0x16de2e,_0x11fb7c,_0x347109){return db[_0xd76f('0x2d')][_0xd76f('0x7a')]({'where':{'id':_0x16de2e[_0xd76f('0x46')]['id']}})['then'](handleEntityNotFound(_0x11fb7c))[_0xd76f('0x25')](function(_0x2d84c4){if(_0x2d84c4&&_0x2d84c4[_0xd76f('0x92')]){var _0x21d4bc=_0x2d84c4[_0xd76f('0x92')];var _0x3abdf5=config['root']+_0xd76f('0x93')+_0x2d84c4['id']+_0xd76f('0x94');if(fs[_0xd76f('0x51')](_0x3abdf5)){return _0x3abdf5;}return writeFile(_0x21d4bc,_0x3abdf5)['then'](function(){return _0x3abdf5;});}else{throw new db[(_0xd76f('0x61'))]['ValidationError'](_0xd76f('0x95'));}})[_0xd76f('0x25')](function(_0x151236){return _0x11fb7c[_0xd76f('0x4c')](_0x151236);})[_0xd76f('0x48')](handleError(_0x11fb7c));}; \ No newline at end of file +var _0xe791=['model','differenceBy','format','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','downloads','../../components/encryptor','sequelize','token','$and','push','decryptFile','unlink','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','isNil','info','unlinkSync','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','end','sendStatus','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key'];(function(_0x51cb3a,_0xb28635){var _0x51d40b=function(_0x20a81a){while(--_0x20a81a){_0x51cb3a['push'](_0x51cb3a['shift']());}};_0x51d40b(++_0xb28635);}(_0xe791,0xf5));var _0x1e79=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe791[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e79('0x0'));var zipdir=require(_0x1e79('0x1'));var jsonpatch=require(_0x1e79('0x2'));var rp=require('request-promise');var moment=require(_0x1e79('0x3'));var BPromise=require(_0x1e79('0x4'));var Mustache=require(_0x1e79('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1e79('0x6'));var csv=require(_0x1e79('0x7'));var ejs=require(_0x1e79('0x8'));var fs=require('fs');var fs_extra=require(_0x1e79('0x9'));var _=require('lodash');var squel=require(_0x1e79('0xa'));var crypto=require('crypto');var jsforce=require(_0x1e79('0xb'));var deskjs=require(_0x1e79('0xc'));var toCsv=require(_0x1e79('0x7'));var querystring=require(_0x1e79('0xd'));var Papa=require(_0x1e79('0xe'));var AWS=require(_0x1e79('0xf'));var uuidv4=require(_0x1e79('0x10'));var Redis=require(_0x1e79('0x11'));var authService=require(_0x1e79('0x12'));var qs=require(_0x1e79('0x13'));var as=require(_0x1e79('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e79('0x15'))(_0x1e79('0x16'));var utils=require(_0x1e79('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x366ec3,_0x1c46da){_0x1c46da=_0x1c46da||0xcc;return function(_0x280ff2){if(_0x280ff2){return _0x366ec3['sendStatus'](_0x1c46da);}return _0x366ec3[_0x1e79('0x18')](_0x1c46da)['end']();};}function respondWithResult(_0x263c92,_0x34f22e){_0x34f22e=_0x34f22e||0xc8;return function(_0x5aff7b){if(_0x5aff7b){return _0x263c92[_0x1e79('0x18')](_0x34f22e)[_0x1e79('0x19')](_0x5aff7b);}};}function respondWithFilteredResult(_0x4a9577,_0x333527){return function(_0x1653c5){if(_0x1653c5){var _0x1ccf5a=typeof _0x333527[_0x1e79('0x1a')]==='undefined'&&typeof _0x333527[_0x1e79('0x1b')]===_0x1e79('0x1c');var _0x4771c4=_0x1653c5[_0x1e79('0x1d')];var _0x473662=_0x1ccf5a?0x0:_0x333527[_0x1e79('0x1a')];var _0x3ea698=_0x1ccf5a?_0x1653c5[_0x1e79('0x1d')]:_0x333527[_0x1e79('0x1a')]+_0x333527[_0x1e79('0x1b')];var _0x1083f2;if(_0x3ea698>=_0x4771c4){_0x3ea698=_0x4771c4;_0x1083f2=0xc8;}else{_0x1083f2=0xce;}_0x4a9577[_0x1e79('0x18')](_0x1083f2);return _0x4a9577['set'](_0x1e79('0x1e'),_0x473662+'-'+_0x3ea698+'/'+_0x4771c4)[_0x1e79('0x19')](_0x1653c5);}return null;};}function patchUpdates(_0x4723d6){return function(_0x41d62c){try{jsonpatch[_0x1e79('0x1f')](_0x41d62c,_0x4723d6,!![]);}catch(_0x212247){return BPromise['reject'](_0x212247);}return _0x41d62c['save']();};}function saveUpdates(_0x5af2a3,_0x3c2373){return function(_0x913a0b){if(_0x913a0b){return _0x913a0b['update'](_0x5af2a3)[_0x1e79('0x20')](function(_0x5b3594){return _0x5b3594;});}return null;};}function removeEntity(_0x40b158,_0x44ccf9){return function(_0x358b89){if(_0x358b89){return _0x358b89[_0x1e79('0x21')]()[_0x1e79('0x20')](function(){_0x40b158['status'](0xcc)[_0x1e79('0x22')]();});}};}function handleEntityNotFound(_0x12bc14,_0x43bf92){return function(_0x3c62e7){if(!_0x3c62e7){_0x12bc14[_0x1e79('0x23')](0x194);}return _0x3c62e7;};}function handleError(_0x28449a,_0x2b17bc){_0x2b17bc=_0x2b17bc||0x1f4;return function(_0x3b4b67){logger['error'](_0x3b4b67[_0x1e79('0x24')]);if(_0x3b4b67[_0x1e79('0x25')]){delete _0x3b4b67[_0x1e79('0x25')];}_0x28449a[_0x1e79('0x18')](_0x2b17bc)[_0x1e79('0x26')](_0x3b4b67);};}exports[_0x1e79('0x27')]=function(_0x40c7b5,_0x173c73){var _0x3a2582={},_0x29fe6e={},_0x40c5ee={'count':0x0,'rows':[]};var _0x376a67=_[_0x1e79('0x28')](db[_0x1e79('0x29')][_0x1e79('0x2a')],function(_0x233eba){return{'name':_0x233eba[_0x1e79('0x2b')],'type':_0x233eba['type'][_0x1e79('0x2c')]};});_0x29fe6e[_0x1e79('0x2d')]=_[_0x1e79('0x2e')](_[_0x1e79('0x28')](_0x376a67,_0x1e79('0x25')),[_0x1e79('0x2f')]);_0x29fe6e[_0x1e79('0x30')]=_[_0x1e79('0x31')](_0x40c7b5[_0x1e79('0x30')]);_0x29fe6e['filters']=_['intersection'](_0x29fe6e['model'],_0x29fe6e[_0x1e79('0x30')]);_0x3a2582[_0x1e79('0x32')]=_[_0x1e79('0x33')](_0x29fe6e[_0x1e79('0x2d')],qs[_0x1e79('0x34')](_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x34')]));_0x3a2582[_0x1e79('0x32')]=_0x3a2582['attributes'][_0x1e79('0x35')]?_0x3a2582[_0x1e79('0x32')]:_0x29fe6e[_0x1e79('0x2d')];if(!_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x36')](_0x1e79('0x37'))){_0x3a2582['limit']=qs[_0x1e79('0x1b')](_0x40c7b5['query']['limit']);_0x3a2582[_0x1e79('0x1a')]=qs[_0x1e79('0x1a')](_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x1a')]);}_0x3a2582[_0x1e79('0x38')]=qs[_0x1e79('0x39')](_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x39')]);_0x3a2582[_0x1e79('0x3a')]=qs[_0x1e79('0x3b')](_[_0x1e79('0x3c')](_0x40c7b5['query'],_0x29fe6e['filters']),_0x376a67);if(_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x3d')]){_0x3a2582['where']=_[_0x1e79('0x3e')](_0x3a2582[_0x1e79('0x3a')],{'$or':_[_0x1e79('0x28')](_0x376a67,function(_0x41c288){if(_0x41c288[_0x1e79('0x3f')]!=='VIRTUAL'){var _0xe88b11={};_0xe88b11[_0x41c288[_0x1e79('0x25')]]={'$like':'%'+_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x3d')]+'%'};return _0xe88b11;}})});}_0x3a2582=_['merge']({},_0x3a2582,_0x40c7b5[_0x1e79('0x40')]);var _0x190368={'where':_0x3a2582[_0x1e79('0x3a')]};return db[_0x1e79('0x29')]['count'](_0x190368)[_0x1e79('0x20')](function(_0x1c9370){_0x40c5ee[_0x1e79('0x1d')]=_0x1c9370;if(_0x40c7b5[_0x1e79('0x30')][_0x1e79('0x41')]){_0x3a2582[_0x1e79('0x42')]=[{'all':!![]}];}return db[_0x1e79('0x29')]['findAll'](_0x3a2582);})[_0x1e79('0x20')](function(_0x31b491){_0x40c5ee[_0x1e79('0x43')]=_0x31b491;return _0x40c5ee;})['then'](respondWithFilteredResult(_0x173c73,_0x3a2582))[_0x1e79('0x44')](handleError(_0x173c73,null));};exports[_0x1e79('0x45')]=function(_0x39daa5,_0x313f2d){var _0x1e3a43={'raw':![],'where':{'id':_0x39daa5[_0x1e79('0x46')]['id']}},_0x287ff1={};_0x287ff1[_0x1e79('0x2d')]=_[_0x1e79('0x31')](db[_0x1e79('0x29')][_0x1e79('0x2a')]);_0x287ff1[_0x1e79('0x30')]=_[_0x1e79('0x31')](_0x39daa5['query']);_0x287ff1['filters']=_[_0x1e79('0x33')](_0x287ff1[_0x1e79('0x2d')],_0x287ff1['query']);_0x1e3a43[_0x1e79('0x32')]=_['intersection'](_0x287ff1[_0x1e79('0x2d')],qs[_0x1e79('0x34')](_0x39daa5['query']['fields']));_0x1e3a43[_0x1e79('0x32')]=_0x1e3a43[_0x1e79('0x32')][_0x1e79('0x35')]?_0x1e3a43[_0x1e79('0x32')]:_0x287ff1[_0x1e79('0x2d')];if(_0x39daa5[_0x1e79('0x30')][_0x1e79('0x41')]){_0x1e3a43[_0x1e79('0x42')]=[{'all':!![]}];}_0x1e3a43=_[_0x1e79('0x3e')]({},_0x1e3a43,_0x39daa5[_0x1e79('0x40')]);return db['VoiceRecording'][_0x1e79('0x47')](_0x1e3a43)[_0x1e79('0x20')](handleEntityNotFound(_0x313f2d,null))[_0x1e79('0x20')](respondWithResult(_0x313f2d,null))[_0x1e79('0x44')](handleError(_0x313f2d,null));};exports['create']=function(_0x3b3950,_0x4c0571){return db[_0x1e79('0x29')][_0x1e79('0x48')](_0x3b3950[_0x1e79('0x49')],{})[_0x1e79('0x20')](respondWithResult(_0x4c0571,0xc9))[_0x1e79('0x44')](handleError(_0x4c0571,null));};exports['update']=function(_0x10ca71,_0xdfa967){if(_0x10ca71[_0x1e79('0x49')]['id']){delete _0x10ca71['body']['id'];}return db[_0x1e79('0x29')]['find']({'where':{'id':_0x10ca71[_0x1e79('0x46')]['id']}})[_0x1e79('0x20')](handleEntityNotFound(_0xdfa967,null))[_0x1e79('0x20')](saveUpdates(_0x10ca71[_0x1e79('0x49')],null))[_0x1e79('0x20')](respondWithResult(_0xdfa967,null))[_0x1e79('0x44')](handleError(_0xdfa967,null));};exports[_0x1e79('0x4a')]=function(_0x42838a,_0xa818){return db[_0x1e79('0x29')]['describe']()[_0x1e79('0x20')](respondWithResult(_0xa818,null))['catch'](handleError(_0xa818,null));};exports[_0x1e79('0x4b')]=function(_0x351d7b,_0x96548a,_0x4fcde4){var _0xaafaed=require('../../components/encryptor');var _0x3761a2=![];var _0x244893={};if(_0x351d7b[_0x1e79('0x30')][_0x1e79('0x3f')]&&_0x351d7b[_0x1e79('0x30')]['type']==='uniqueid'){_0x244893[_0x1e79('0x4c')]=_0x351d7b[_0x1e79('0x46')]['id'];}else{_0x244893['id']=_0x351d7b[_0x1e79('0x46')]['id'];}return db[_0x1e79('0x29')][_0x1e79('0x47')]({'where':_0x244893,'attributes':['id',_0x1e79('0x4d')],'raw':!![]})[_0x1e79('0x20')](handleEntityNotFound(_0x96548a,null))['then'](function(_0x5f2b18){if(_0x5f2b18){var _0x546663=_0x5f2b18[_0x1e79('0x4d')];var _0x2735ec=util['format'](_0x1e79('0x4e'),_0x546663);if(fs[_0x1e79('0x4f')](_0x2735ec)){_0x3761a2=!![];return _0xaafaed['decryptFile'](_0x2735ec,_0x546663,config[_0x1e79('0x50')][_0x1e79('0x51')])['then'](function(){return _0x5f2b18;});}return _0x5f2b18;}})[_0x1e79('0x20')](function(_0xc2f464){if(_0xc2f464){var _0x594a6a=_0xc2f464['value'];if(!fs[_0x1e79('0x4f')](_0x594a6a)){throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))](_0x1e79('0x54'));}if(_0xc2f464[_0x1e79('0x55')]){return _0x96548a['download'](_0x594a6a,_0xc2f464['filename']+path[_0x1e79('0x56')](_0x594a6a),function(){if(_0x3761a2){fs['unlink'](_0x594a6a);}});}else{return _0x96548a[_0x1e79('0x4b')](_0x594a6a,function(_0x2b5ea9){if(_0x3761a2){fs['unlink'](_0x594a6a);}});}}})[_0x1e79('0x44')](function(_0x485e37){if(_0x485e37['message']===_0x1e79('0x54')){_0x96548a[_0x1e79('0x18')](0x194)[_0x1e79('0x26')]('Not\x20found');}else{return handleError(_0x96548a,null);}});};exports[_0x1e79('0x57')]=function(_0x1b5e72,_0x57b38c,_0x3ca286){var _0x76ec1a=require(_0x1e79('0x58'));var _0x599c9a=![];var _0x3b41fa={'$and':[db[_0x1e79('0x59')][_0x1e79('0x3a')](db[_0x1e79('0x59')]['fn']('MD5',db[_0x1e79('0x59')]['col'](_0x1e79('0x4c'))),_0x1b5e72[_0x1e79('0x30')][_0x1e79('0x5a')])]};if(_0x1b5e72[_0x1e79('0x30')][_0x1e79('0x3f')]&&_0x1b5e72[_0x1e79('0x30')][_0x1e79('0x3f')]==='uniqueid'){_0x3b41fa[_0x1e79('0x5b')][_0x1e79('0x5c')]({'uniqueid':_0x1b5e72[_0x1e79('0x46')]['id']});}else{_0x3b41fa['$and']['push']({'id':_0x1b5e72['params']['id']});}return db[_0x1e79('0x29')]['find']({'where':_0x3b41fa,'attributes':['id',_0x1e79('0x4d')],'raw':!![]})[_0x1e79('0x20')](handleEntityNotFound(_0x57b38c,null))[_0x1e79('0x20')](function(_0x2762a4){if(_0x2762a4){var _0x58f13b=util[_0x1e79('0x2f')](_0x1e79('0x4e'),_0x2762a4[_0x1e79('0x4d')]);if(fs[_0x1e79('0x4f')](_0x58f13b)){_0x599c9a=!![];return _0x76ec1a[_0x1e79('0x5d')](_0x58f13b,_0x2762a4[_0x1e79('0x4d')],config['secrets'][_0x1e79('0x51')])[_0x1e79('0x20')](function(){return _0x2762a4;});}return _0x2762a4;}})[_0x1e79('0x20')](function(_0x396924){if(_0x396924){if(!fs[_0x1e79('0x4f')](_0x396924[_0x1e79('0x4d')])){throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))](_0x1e79('0x54'));}if(_0x396924[_0x1e79('0x55')]){return _0x57b38c[_0x1e79('0x4b')](_0x396924[_0x1e79('0x4d')],_0x396924[_0x1e79('0x55')]+path[_0x1e79('0x56')](_0x396924['value']),function(){if(_0x599c9a){fs[_0x1e79('0x5e')](_0x396924[_0x1e79('0x4d')]);}});}else{return _0x57b38c[_0x1e79('0x4b')](_0x396924[_0x1e79('0x4d')],function(_0x4092fa){if(_0x599c9a){fs['unlink'](_0x396924[_0x1e79('0x4d')]);}});}}})[_0x1e79('0x44')](handleError(_0x57b38c,null));};exports['destroy']=function(_0x5e7af4,_0x2cf33d){return db[_0x1e79('0x29')][_0x1e79('0x47')]({'where':{'id':_0x5e7af4[_0x1e79('0x46')]['id']}})[_0x1e79('0x20')](function(_0x1af186){if(_['isNil'](_0x1af186)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1af186;})[_0x1e79('0x20')](function(_0x3236ea){var _0x41d26f=_0x3236ea['value'];logger['info'](_0x1e79('0x5f'),_0x41d26f);if(!_['isNil'](_0x3236ea[_0x1e79('0x4d')])&&fs[_0x1e79('0x4f')](_0x41d26f)){logger['info'](_0x1e79('0x60')+_0x41d26f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x41d26f);}_0x41d26f=_0x41d26f+_0x1e79('0x61');if(!_[_0x1e79('0x62')](_0x3236ea[_0x1e79('0x4d')])&&fs[_0x1e79('0x4f')](_0x41d26f)){logger[_0x1e79('0x63')](_0x1e79('0x60')+_0x41d26f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1e79('0x64')](_0x41d26f);}return _0x3236ea;})[_0x1e79('0x20')](function(_0x1b96d8){if(!_0x1b96d8)throw new InternalError();return _0x1b96d8[_0x1e79('0x21')]();})[_0x1e79('0x20')](function(){_0x2cf33d[_0x1e79('0x18')](0xcc)[_0x1e79('0x22')]();})[_0x1e79('0x44')](handleError(_0x2cf33d,null));};function getBucketslist(_0x1a1596,_0x14e2ec,_0x4f8802){return new Promise(function(_0x3c9fb,_0x3aae8d){var _0x24853a=new AWS['S3']({'accessKeyId':_0x14e2ec,'secretAccessKey':_0x1a1596,'region':_0x4f8802});_0x24853a[_0x1e79('0x65')]({},function(_0x3dbe5a,_0x552f89){if(_0x3dbe5a){return _0x3aae8d(_0x3dbe5a);}else{return _0x3c9fb(_0x552f89);}});});}function createBucket(_0x2ee200,_0x55ef87,_0x1ce751,_0x18520f){return new Promise(function(_0x1a6c22,_0x4638db){var _0x124dd4=new AWS['S3']({'accessKeyId':_0x55ef87,'secretAccessKey':_0x2ee200,'region':_0x1ce751});_0x124dd4[_0x1e79('0x66')]({'Bucket':_0x18520f},function(_0x5eb908,_0x1541dd){if(_0x5eb908){return _0x4638db(_0x5eb908);}else{return _0x1a6c22(_0x1541dd);}});});}function uploadFile(_0x4b2a8e,_0x5edd8f,_0x5de85f,_0x3ef814,_0x17bac2,_0x1a3950){return new Promise(function(_0x4380c4,_0xbddb04){var _0x5052f1=new AWS['S3']({'accessKeyId':_0x5edd8f,'secretAccessKey':_0x4b2a8e,'region':_0x5de85f});_0x5052f1['upload']({'Bucket':_0x3ef814,'Key':_0x17bac2,'Body':_0x1a3950},function(_0x229163,_0x421305){if(_0x229163){return _0xbddb04(_0x229163);}else{return _0x4380c4(_0x421305);}});});}function startTranscribe(_0x5cce64,_0x464326,_0x179b87,_0xc4e4b4,_0x345042,_0x472343){return new Promise(function(_0x62b9a5,_0x4b21a0){var _0x14fd70=new AWS[(_0x1e79('0x67'))]({'accessKeyId':_0x464326,'secretAccessKey':_0x5cce64,'region':_0x179b87});_0x14fd70[_0x1e79('0x68')]({'TranscriptionJobName':_0xc4e4b4,'LanguageCode':_0x345042,'Media':{'MediaFileUri':_0x472343}},function(_0x1eaa71,_0x17b27b){if(_0x1eaa71){return _0x4b21a0(_0x1eaa71);}else{return _0x62b9a5(_0x17b27b);}});});}function transcribe(_0x565a9a,_0xb1c9bc,_0x29996a,_0x4b6510,_0x42b55d,_0x11298b,_0x35191f){return new Promise(function(_0x15a140,_0x477195){var _0x523a8c={};logger['info'](util[_0x1e79('0x2f')](_0x1e79('0x69'),_0x565a9a,_0x42b55d));return uploadFile(_0xb1c9bc,_0x29996a,_0x4b6510,_0x42b55d,path[_0x1e79('0x6a')](_0x11298b),fs['readFileSync'](_0x11298b))[_0x1e79('0x20')](function(_0x12756c){logger[_0x1e79('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x565a9a,_0x42b55d,_0x12756c[_0x1e79('0x6b')]));_0x523a8c[_0x1e79('0x6c')]=_0x12756c[_0x1e79('0x6d')];_0x523a8c[_0x1e79('0x6e')]=_0x12756c[_0x1e79('0x6b')];logger[_0x1e79('0x63')](util['format'](_0x1e79('0x6f'),_0x565a9a));return startTranscribe(_0xb1c9bc,_0x29996a,_0x4b6510,uuidv4(),_0x35191f,_0x12756c[_0x1e79('0x6b')]);})[_0x1e79('0x20')](function(_0x58f85f){logger[_0x1e79('0x63')](util[_0x1e79('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x565a9a,_0x58f85f[_0x1e79('0x70')][_0x1e79('0x71')]));_0x523a8c[_0x1e79('0x72')]=_0x58f85f[_0x1e79('0x70')][_0x1e79('0x71')];_0x523a8c[_0x1e79('0x73')]=_0x58f85f[_0x1e79('0x70')][_0x1e79('0x74')];return _0x15a140(_0x523a8c);})[_0x1e79('0x44')](function(_0x3b8dd3){return _0x477195(_0x3b8dd3);});});}exports['runTranscribe']=function(_0x1fae06,_0x345139,_0x1982fd){var _0x52e12b;var _0x5f3729;var _0xbc2a78;var _0x191723=require(_0x1e79('0x58'));return db[_0x1e79('0x29')][_0x1e79('0x75')]({'where':{'id':_0x1fae06[_0x1e79('0x46')]['id']}})['then'](function(_0x515ecd){if(_0x515ecd){var _0x59cec3=util[_0x1e79('0x2f')](_0x1e79('0x4e'),_0x515ecd[_0x1e79('0x4d')]);if(fs[_0x1e79('0x4f')](_0x59cec3)){cypher=!![];return _0x191723[_0x1e79('0x5d')](_0x59cec3,_0x515ecd[_0x1e79('0x4d')],config[_0x1e79('0x50')][_0x1e79('0x51')])['then'](function(){return _0x515ecd;});}return _0x515ecd;}})['then'](function(_0x5bb2e2){if(!_0x5bb2e2){throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x5f3729=_0x5bb2e2;return db[_0x1e79('0x76')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x345139,null))['then'](function(_0x2b39f3){if(_0x2b39f3){_0x52e12b=_0x2b39f3;if(!_0x52e12b[_0x1e79('0x77')]||!_0x52e12b[_0x1e79('0x78')]||!_0x52e12b['transcribeRegion']||!_0x52e12b[_0x1e79('0x79')]||!_0x52e12b[_0x1e79('0x6c')]){throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))](_0x1e79('0x7a'));}if(_0x1fae06['body']['runSentiment']&&(!_0x52e12b[_0x1e79('0x7b')]||!_0x52e12b['sentimentAccountId']||!_0x52e12b[_0x1e79('0x7c')]||!_0x52e12b[_0x1e79('0x79')]||!_0x52e12b[_0x1e79('0x6c')])){throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))](_0x1e79('0x7d'));}return db[_0x1e79('0x7e')][_0x1e79('0x75')]({'where':{'id':_0x52e12b[_0x1e79('0x78')]}});}})[_0x1e79('0x20')](function(_0x27016d){if(!_0x27016d){throw new db[(_0x1e79('0x52'))]['ValidationError'](_0x1e79('0x7f'));}if(!_0x27016d['data1']||!_0x27016d[_0x1e79('0x80')]){throw new db['Sequelize'][(_0x1e79('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0xbc2a78=_0x27016d;return getBucketslist(_0xbc2a78[_0x1e79('0x81')],_0xbc2a78[_0x1e79('0x80')],_0x52e12b[_0x1e79('0x82')]);})[_0x1e79('0x20')](function(_0xa2d626){if(_0xa2d626&&_0xa2d626[_0x1e79('0x83')]){var _0x1f9c83=_[_0x1e79('0x47')](_0xa2d626[_0x1e79('0x83')],function(_0x46cf23){return _0x46cf23[_0x1e79('0x84')]===_0x52e12b[_0x1e79('0x6c')];});if(!_0x1f9c83){logger[_0x1e79('0x63')](util[_0x1e79('0x2f')](_0x1e79('0x85'),_0x1fae06[_0x1e79('0x46')]['id'],_0x52e12b['bucket']));return createBucket(_0xbc2a78[_0x1e79('0x81')],_0xbc2a78[_0x1e79('0x80')],_0x52e12b[_0x1e79('0x82')],_0x52e12b[_0x1e79('0x6c')]);}logger[_0x1e79('0x63')](util[_0x1e79('0x2f')](_0x1e79('0x86'),_0x1fae06[_0x1e79('0x46')]['id'],_0x52e12b[_0x1e79('0x6c')]));return;}})['then'](function(_0x37d9d2){if(_0x5f3729[_0x1e79('0x73')]===_0x1e79('0x87')){return transcribe(_0x1fae06[_0x1e79('0x46')]['id'],_0xbc2a78['data1'],_0xbc2a78['data2'],_0x52e12b[_0x1e79('0x82')],_0x52e12b[_0x1e79('0x6c')],_0x5f3729[_0x1e79('0x4d')],_0x52e12b[_0x1e79('0x79')]);}else{logger[_0x1e79('0x63')](util[_0x1e79('0x2f')](_0x1e79('0x88'),_0x1fae06[_0x1e79('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x1e79('0x20')](function(_0x2ce4c1){if(_0x2ce4c1){_0x2ce4c1[_0x1e79('0x89')]=_0x1fae06[_0x1e79('0x49')][_0x1e79('0x8a')];return _0x5f3729[_0x1e79('0x8b')](_0x2ce4c1);}})[_0x1e79('0x20')](respondWithResult(_0x345139,null))[_0x1e79('0x44')](handleError(_0x345139,null));};function writeFile(_0x51f43f,_0x779faf){return new Promise(function(_0x509801,_0xb43186){fs['writeFile'](_0x779faf,_0x51f43f,function(_0x186739,_0x319c1b){if(_0x186739){return _0xb43186(_0x186739);}else{return _0x509801(_0x319c1b);}});});}exports[_0x1e79('0x8c')]=function(_0x43ef49,_0x521090,_0xfe5272){return db[_0x1e79('0x29')][_0x1e79('0x75')]({'where':{'id':_0x43ef49[_0x1e79('0x46')]['id']}})[_0x1e79('0x20')](handleEntityNotFound(_0x521090))[_0x1e79('0x20')](function(_0x487b4c){if(_0x487b4c&&_0x487b4c[_0x1e79('0x8d')]){var _0x547370=_0x487b4c['fileText'];var _0x315169=config[_0x1e79('0x8e')]+_0x1e79('0x8f')+_0x487b4c['id']+_0x1e79('0x90');if(fs[_0x1e79('0x4f')](_0x315169)){return _0x315169;}return writeFile(_0x547370,_0x315169)['then'](function(){return _0x315169;});}else{throw new db[(_0x1e79('0x52'))][(_0x1e79('0x53'))]('Transcript\x20not\x20available');}})[_0x1e79('0x20')](function(_0x5f4e42){return _0x521090['download'](_0x5f4e42);})[_0x1e79('0x44')](handleError(_0x521090));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c5feee1..9981361 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 _0xb458=['transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x6e45b1,_0x3825cd){var _0x1a5edd=function(_0x52186d){while(--_0x52186d){_0x6e45b1['push'](_0x6e45b1['shift']());}};_0x1a5edd(++_0x3825cd);}(_0xb458,0x103));var _0x8b45=function(_0x2aca66,_0x2cf8d6){_0x2aca66=_0x2aca66-0x0;var _0x569919=_0xb458[_0x2aca66];return _0x569919;};'use strict';var attributes=require(_0x8b45('0x0'));module[_0x8b45('0x1')]=function(_0x4544e3,_0x494751){return _0x4544e3['define'](_0x8b45('0x2'),attributes,{'tableName':_0x8b45('0x3'),'paranoid':![],'indexes':[{'name':_0x8b45('0x4'),'fields':[_0x8b45('0x4')]},{'name':'transcribeStatus','fields':[_0x8b45('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcab6=['uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings'];(function(_0x590ef3,_0x364cd0){var _0x313665=function(_0x4dd1de){while(--_0x4dd1de){_0x590ef3['push'](_0x590ef3['shift']());}};_0x313665(++_0x364cd0);}(_0xcab6,0xd4));var _0x6cab=function(_0x13ca6a,_0x2fa96a){_0x13ca6a=_0x13ca6a-0x0;var _0x2faabd=_0xcab6[_0x13ca6a];return _0x2faabd;};'use strict';var attributes=require(_0x6cab('0x0'));module['exports']=function(_0x45b94e,_0xcc7aeb){return _0x45b94e[_0x6cab('0x1')](_0x6cab('0x2'),attributes,{'tableName':_0x6cab('0x3'),'paranoid':![],'indexes':[{'name':_0x6cab('0x4'),'fields':['uniqueid']},{'name':_0x6cab('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 696de3a..415d93b 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 _0xda2d=['update','body','options','raw','where','attributes','limit','catch','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','value','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateVoiceRecording','VoiceRecording'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xda2d,0x102));var _0xdda2=function(_0x47119d,_0x56d6ea){_0x47119d=_0x47119d-0x0;var _0x36b9c0=_0xda2d[_0x47119d];return _0x36b9c0;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')](_0x1a3b35[_0xdda2('0x17')],{'raw':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35['options'][_0xdda2('0x1a')]||null:null,'attributes':_0x1a3b35['options']?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x1b')]||null:null,'limit':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35['options'][_0xdda2('0x1c')]||null:null})['then'](function(_0x425489){logger[_0xdda2('0x12')]('UpdateVoiceRecording',_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON[_0xdda2('0xf')](_0x425489));_0x2b6ee8(_0x425489);})[_0xdda2('0x1d')](function(_0x45ee9d){logger['error'](_0xdda2('0x14'),_0x45ee9d[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x45ee9d[_0xdda2('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x4e97dc){var _0x28da54=this;return new Promise(function(_0x4567e7,_0x2e8591){var _0x5e9e74=require(_0xdda2('0x1e'));var _0x5d26ae;return db[_0xdda2('0x1f')][_0xdda2('0x20')]({'attributes':['id',_0xdda2('0x21')],'where':{'id':0x1},'raw':!![]})[_0xdda2('0xa')](function(_0x4bb8a4){_0x5d26ae=_0x4bb8a4;return db[_0xdda2('0x15')][_0xdda2('0x22')](_0x4e97dc['body']);})[_0xdda2('0xa')](function(_0x2cfaca){if(_0x5d26ae[_0xdda2('0x21')]&&fs[_0xdda2('0x23')](_0x2cfaca['value'])){var _0x129eba=util[_0xdda2('0x24')]('%s.cypher',_0x2cfaca[_0xdda2('0x25')]);return _0x5e9e74['encryptFile'](_0x2cfaca[_0xdda2('0x25')],_0x129eba,config['secrets']['recording'])['then'](function(){fs[_0xdda2('0x26')](_0x2cfaca['value']);logger[_0xdda2('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2cfaca;});}return _0x2cfaca;})['then'](function(_0x52a509){logger[_0xdda2('0x12')](_0xdda2('0x27'),_0x4e97dc);logger[_0xdda2('0xd')](_0xdda2('0x27'),_0x4e97dc,JSON[_0xdda2('0xf')](_0x52a509));_0x4567e7(_0x52a509);})[_0xdda2('0x1d')](function(_0x2bcfba){logger[_0xdda2('0x10')](_0xdda2('0x27'),_0x2bcfba[_0xdda2('0x11')],_0x4e97dc);_0x2e8591(_0x28da54['error'](0x1f4,_0x2bcfba[_0xdda2('0x11')]));});});}; \ No newline at end of file +var _0xfcbb=['VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','unlink','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x367bad,_0x1eea19){var _0x3a99d3=function(_0x403c33){while(--_0x403c33){_0x367bad['push'](_0x367bad['shift']());}};_0x3a99d3(++_0x1eea19);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x57a60f,_0x2c3c15){_0x57a60f=_0x57a60f-0x0;var _0x2cddf0=_0xfcbb[_0x57a60f];return _0x2cddf0;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['where']||null:null,'attributes':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1a')]||null:null,'limit':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1b')]||null:null})['then'](function(_0x365d6c){logger[_0xbfcb('0xb')](_0xbfcb('0x16'),_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x365d6c));_0x3404aa(_0x365d6c);})[_0xbfcb('0x15')](function(_0x14e43c){logger[_0xbfcb('0x10')](_0xbfcb('0x16'),_0x14e43c[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x14e43c[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1c')]=function(_0x3e954d){var _0x2a1272=this;return new Promise(function(_0x5cd703,_0x3465f5){var _0x2881f8=require('../../components/encryptor');var _0x64a69;return db[_0xbfcb('0x1d')][_0xbfcb('0x1e')]({'attributes':['id',_0xbfcb('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xbfcb('0xa')](function(_0x3542e9){_0x64a69=_0x3542e9;return db[_0xbfcb('0x17')][_0xbfcb('0x20')](_0x3e954d[_0xbfcb('0x21')]);})[_0xbfcb('0xa')](function(_0x59719b){if(_0x64a69[_0xbfcb('0x1f')]&&fs[_0xbfcb('0x22')](_0x59719b[_0xbfcb('0x23')])){var _0x43de3c=util[_0xbfcb('0x24')](_0xbfcb('0x25'),_0x59719b[_0xbfcb('0x23')]);return _0x2881f8[_0xbfcb('0x26')](_0x59719b[_0xbfcb('0x23')],_0x43de3c,config['secrets'][_0xbfcb('0x27')])[_0xbfcb('0xa')](function(){fs[_0xbfcb('0x28')](_0x59719b[_0xbfcb('0x23')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x59719b;});}return _0x59719b;})[_0xbfcb('0xa')](function(_0x35925b){logger[_0xbfcb('0xb')](_0xbfcb('0x1c'),_0x3e954d);logger[_0xbfcb('0xd')](_0xbfcb('0x1c'),_0x3e954d,JSON[_0xbfcb('0xf')](_0x35925b));_0x5cd703(_0x35925b);})['catch'](function(_0x504d81){logger['error'](_0xbfcb('0x1c'),_0x504d81['message'],_0x3e954d);_0x3465f5(_0x2a1272[_0xbfcb('0x10')](0x1f4,_0x504d81[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 591df1e..c8c07a3 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 _0x42e0=['post','isAuthenticated','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe','/:id','show'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x42e0,0x85));var _0x042e=function(_0x2763ca,_0x5cf4dd){_0x2763ca=_0x2763ca-0x0;var _0x315dd5=_0x42e0[_0x2763ca];return _0x315dd5;};'use strict';var multer=require(_0x042e('0x0'));var util=require(_0x042e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x042e('0x2'));var router=express[_0x042e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x042e('0x4'));var config=require(_0x042e('0x5'));var controller=require(_0x042e('0x6'));router[_0x042e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x042e('0x7')](_0x042e('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x042e('0x7')](_0x042e('0x9'),auth['isAuthenticated'](),controller[_0x042e('0xa')]);router[_0x042e('0xb')]('/',auth[_0x042e('0xc')](),controller['create']);router[_0x042e('0xd')]('/:id',auth[_0x042e('0xc')](),controller[_0x042e('0xe')]);router[_0x042e('0xf')](_0x042e('0x9'),auth['isAuthenticated'](),controller[_0x042e('0x10')]);module[_0x042e('0x11')]=router; \ No newline at end of file +var _0x5595=['../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','post','create','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x952637,_0x435725){var _0x25c8b3=function(_0x10aebb){while(--_0x10aebb){_0x952637['push'](_0x952637['shift']());}};_0x25c8b3(++_0x435725);}(_0x5595,0xfb));var _0x5559=function(_0x5ed835,_0x316f89){_0x5ed835=_0x5ed835-0x0;var _0x2b567b=_0x5595[_0x5ed835];return _0x2b567b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5559('0x0'));var express=require(_0x5559('0x1'));var router=express[_0x5559('0x2')]();var fs_extra=require(_0x5559('0x3'));var auth=require(_0x5559('0x4'));var interaction=require(_0x5559('0x5'));var config=require('../../config/environment');var controller=require(_0x5559('0x6'));router[_0x5559('0x7')]('/',auth['isAuthenticated'](),controller[_0x5559('0x8')]);router[_0x5559('0x7')](_0x5559('0x9'),auth[_0x5559('0xa')](),controller[_0x5559('0xb')]);router[_0x5559('0x7')]('/:id',auth[_0x5559('0xa')](),controller['show']);router[_0x5559('0xc')]('/',auth[_0x5559('0xa')](),controller[_0x5559('0xd')]);router['put']('/:id',auth[_0x5559('0xa')](),controller['update']);router[_0x5559('0xe')]('/:id',auth[_0x5559('0xa')](),controller[_0x5559('0xf')]);module[_0x5559('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 6f646fd..5eb8611 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 _0x1db5=['ENUM','blind','STRING','Yes','sequelize','exports'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x1db5,0x1c0));var _0x51db=function(_0xc93659,_0x4e1f9b){_0xc93659=_0xc93659-0x0;var _0x49d8de=_0x1db5[_0xc93659];return _0x49d8de;};'use strict';var Sequelize=require(_0x51db('0x0'));var moment=require('moment');module[_0x51db('0x1')]={'type':{'type':Sequelize[_0x51db('0x2')](_0x51db('0x3'),'attended')},'result':{'type':Sequelize[_0x51db('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x51db('0x4')]},'transferercalleridname':{'type':Sequelize[_0x51db('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x51db('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x51db('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x51db('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x51db('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x51db('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x51db('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x51db('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x51db('0x4')]},'transfereecontext':{'type':Sequelize[_0x51db('0x4')]},'transfereeexten':{'type':Sequelize[_0x51db('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x51db('0x4')]},'isexternal':{'type':Sequelize[_0x51db('0x2')](_0x51db('0x5'),'No')},'context':{'type':Sequelize[_0x51db('0x4')]},'extension':{'type':Sequelize[_0x51db('0x4')]}}; \ No newline at end of file +var _0x8888=['STRING','sequelize','exports','attended'];(function(_0x1d418e,_0x418ae6){var _0x13014b=function(_0x3e8461){while(--_0x3e8461){_0x1d418e['push'](_0x1d418e['shift']());}};_0x13014b(++_0x418ae6);}(_0x8888,0x14d));var _0x8888=function(_0x26a6e3,_0x4f23ff){_0x26a6e3=_0x26a6e3-0x0;var _0x2ca6a1=_0x8888[_0x26a6e3];return _0x2ca6a1;};'use strict';var Sequelize=require(_0x8888('0x0'));var moment=require('moment');module[_0x8888('0x1')]={'type':{'type':Sequelize['ENUM']('blind',_0x8888('0x2'))},'result':{'type':Sequelize[_0x8888('0x3')]},'transfererchannel':{'type':Sequelize[_0x8888('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x8888('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x8888('0x3')]},'transferercontext':{'type':Sequelize[_0x8888('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8888('0x3')]},'transfereechannel':{'type':Sequelize[_0x8888('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x8888('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8888('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x8888('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x8888('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x8888('0x3')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8888('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 56f806b..958471d 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 _0xcb47=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','send','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xcb47,0x161));var _0x7cb4=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xcb47[_0xf51c06];return _0x1d5420;};'use strict';var emlformat=require(_0x7cb4('0x0'));var rimraf=require(_0x7cb4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cb4('0x2'));var rp=require(_0x7cb4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7cb4('0x4'));var util=require(_0x7cb4('0x5'));var path=require('path');var sox=require(_0x7cb4('0x6'));var csv=require(_0x7cb4('0x7'));var ejs=require(_0x7cb4('0x8'));var fs=require('fs');var fs_extra=require(_0x7cb4('0x9'));var _=require(_0x7cb4('0xa'));var squel=require(_0x7cb4('0xb'));var crypto=require(_0x7cb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7cb4('0xd'));var toCsv=require(_0x7cb4('0x7'));var querystring=require(_0x7cb4('0xe'));var Papa=require(_0x7cb4('0xf'));var Redis=require('ioredis');var authService=require(_0x7cb4('0x10'));var qs=require(_0x7cb4('0x11'));var as=require(_0x7cb4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cb4('0x13'))('api');var utils=require(_0x7cb4('0x14'));var config=require(_0x7cb4('0x15'));var licenseUtil=require(_0x7cb4('0x16'));var db=require(_0x7cb4('0x17'))['db'];function respondWithStatusCode(_0x4cf02d,_0x47711c){_0x47711c=_0x47711c||0xcc;return function(_0x49d038){if(_0x49d038){return _0x4cf02d['sendStatus'](_0x47711c);}return _0x4cf02d[_0x7cb4('0x18')](_0x47711c)[_0x7cb4('0x19')]();};}function respondWithResult(_0x2fe73f,_0x2a045b){_0x2a045b=_0x2a045b||0xc8;return function(_0x19e955){if(_0x19e955){return _0x2fe73f[_0x7cb4('0x18')](_0x2a045b)[_0x7cb4('0x1a')](_0x19e955);}};}function respondWithFilteredResult(_0x59839f,_0x387471){return function(_0xbd1bd8){if(_0xbd1bd8){var _0x4a6a4f=typeof _0x387471[_0x7cb4('0x1b')]===_0x7cb4('0x1c')&&typeof _0x387471[_0x7cb4('0x1d')]===_0x7cb4('0x1c');var _0x24f712=_0xbd1bd8['count'];var _0x492636=_0x4a6a4f?0x0:_0x387471['offset'];var _0x3ebfb4=_0x4a6a4f?_0xbd1bd8[_0x7cb4('0x1e')]:_0x387471[_0x7cb4('0x1b')]+_0x387471[_0x7cb4('0x1d')];var _0x54ec3b;if(_0x3ebfb4>=_0x24f712){_0x3ebfb4=_0x24f712;_0x54ec3b=0xc8;}else{_0x54ec3b=0xce;}_0x59839f[_0x7cb4('0x18')](_0x54ec3b);return _0x59839f[_0x7cb4('0x1f')]('Content-Range',_0x492636+'-'+_0x3ebfb4+'/'+_0x24f712)[_0x7cb4('0x1a')](_0xbd1bd8);}return null;};}function patchUpdates(_0xe81ded){return function(_0x4668b4){try{jsonpatch[_0x7cb4('0x20')](_0x4668b4,_0xe81ded,!![]);}catch(_0x211869){return BPromise[_0x7cb4('0x21')](_0x211869);}return _0x4668b4[_0x7cb4('0x22')]();};}function saveUpdates(_0x5c9fd1,_0xe6956e){return function(_0x3190d7){if(_0x3190d7){return _0x3190d7[_0x7cb4('0x23')](_0x5c9fd1)['then'](function(_0x527f8d){return _0x527f8d;});}return null;};}function removeEntity(_0x30456c,_0x2dc9a3){return function(_0x50852b){if(_0x50852b){return _0x50852b[_0x7cb4('0x24')]()[_0x7cb4('0x25')](function(){_0x30456c['status'](0xcc)[_0x7cb4('0x19')]();});}};}function handleEntityNotFound(_0x3b7b01,_0xf09e00){return function(_0x2ac286){if(!_0x2ac286){_0x3b7b01[_0x7cb4('0x26')](0x194);}return _0x2ac286;};}function handleError(_0x7d137e,_0x55f47){_0x55f47=_0x55f47||0x1f4;return function(_0x47af25){logger[_0x7cb4('0x27')](_0x47af25['stack']);if(_0x47af25['name']){delete _0x47af25[_0x7cb4('0x28')];}_0x7d137e[_0x7cb4('0x18')](_0x55f47)[_0x7cb4('0x29')](_0x47af25);};}exports['index']=function(_0x20bac3,_0x1a8bab){var _0x346be0={},_0x5701e4={},_0x2e95d4={'count':0x0,'rows':[]};var _0x297eaa=_['map'](db[_0x7cb4('0x2a')][_0x7cb4('0x2b')],function(_0x4f7e69){return{'name':_0x4f7e69[_0x7cb4('0x2c')],'type':_0x4f7e69[_0x7cb4('0x2d')][_0x7cb4('0x2e')]};});_0x5701e4['model']=_[_0x7cb4('0x2f')](_0x297eaa,_0x7cb4('0x28'));_0x5701e4[_0x7cb4('0x30')]=_['keys'](_0x20bac3[_0x7cb4('0x30')]);_0x5701e4[_0x7cb4('0x31')]=_[_0x7cb4('0x32')](_0x5701e4[_0x7cb4('0x33')],_0x5701e4[_0x7cb4('0x30')]);_0x346be0[_0x7cb4('0x34')]=_['intersection'](_0x5701e4[_0x7cb4('0x33')],qs[_0x7cb4('0x35')](_0x20bac3['query'][_0x7cb4('0x35')]));_0x346be0[_0x7cb4('0x34')]=_0x346be0[_0x7cb4('0x34')]['length']?_0x346be0[_0x7cb4('0x34')]:_0x5701e4[_0x7cb4('0x33')];if(!_0x20bac3[_0x7cb4('0x30')][_0x7cb4('0x36')]('nolimit')){_0x346be0['limit']=qs[_0x7cb4('0x1d')](_0x20bac3['query']['limit']);_0x346be0[_0x7cb4('0x1b')]=qs[_0x7cb4('0x1b')](_0x20bac3[_0x7cb4('0x30')]['offset']);}_0x346be0['order']=qs[_0x7cb4('0x37')](_0x20bac3[_0x7cb4('0x30')][_0x7cb4('0x37')]);_0x346be0['where']=qs[_0x7cb4('0x31')](_[_0x7cb4('0x38')](_0x20bac3['query'],_0x5701e4['filters']),_0x297eaa);if(_0x20bac3[_0x7cb4('0x30')][_0x7cb4('0x39')]){_0x346be0['where']=_[_0x7cb4('0x3a')](_0x346be0[_0x7cb4('0x3b')],{'$or':_[_0x7cb4('0x2f')](_0x297eaa,function(_0x15008b){if(_0x15008b[_0x7cb4('0x2d')]!==_0x7cb4('0x3c')){var _0x1ced74={};_0x1ced74[_0x15008b[_0x7cb4('0x28')]]={'$like':'%'+_0x20bac3[_0x7cb4('0x30')][_0x7cb4('0x39')]+'%'};return _0x1ced74;}})});}_0x346be0=_[_0x7cb4('0x3a')]({},_0x346be0,_0x20bac3[_0x7cb4('0x3d')]);var _0x421d55={'where':_0x346be0[_0x7cb4('0x3b')]};return db[_0x7cb4('0x2a')][_0x7cb4('0x1e')](_0x421d55)[_0x7cb4('0x25')](function(_0x90bede){_0x2e95d4[_0x7cb4('0x1e')]=_0x90bede;if(_0x20bac3[_0x7cb4('0x30')][_0x7cb4('0x3e')]){_0x346be0[_0x7cb4('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x7cb4('0x40')](_0x346be0);})['then'](function(_0x481143){_0x2e95d4['rows']=_0x481143;return _0x2e95d4;})['then'](respondWithFilteredResult(_0x1a8bab,_0x346be0))[_0x7cb4('0x41')](handleError(_0x1a8bab,null));};exports[_0x7cb4('0x42')]=function(_0x21ec4e,_0x27d5d0){var _0x4e847f={'raw':!![],'where':{'id':_0x21ec4e[_0x7cb4('0x43')]['id']}},_0x157259={};_0x157259[_0x7cb4('0x33')]=_[_0x7cb4('0x44')](db[_0x7cb4('0x2a')][_0x7cb4('0x2b')]);_0x157259['query']=_[_0x7cb4('0x44')](_0x21ec4e[_0x7cb4('0x30')]);_0x157259['filters']=_[_0x7cb4('0x32')](_0x157259[_0x7cb4('0x33')],_0x157259[_0x7cb4('0x30')]);_0x4e847f[_0x7cb4('0x34')]=_[_0x7cb4('0x32')](_0x157259[_0x7cb4('0x33')],qs[_0x7cb4('0x35')](_0x21ec4e[_0x7cb4('0x30')][_0x7cb4('0x35')]));_0x4e847f['attributes']=_0x4e847f[_0x7cb4('0x34')][_0x7cb4('0x45')]?_0x4e847f[_0x7cb4('0x34')]:_0x157259[_0x7cb4('0x33')];if(_0x21ec4e[_0x7cb4('0x30')][_0x7cb4('0x3e')]){_0x4e847f['include']=[{'all':!![]}];}_0x4e847f=_[_0x7cb4('0x3a')]({},_0x4e847f,_0x21ec4e[_0x7cb4('0x3d')]);return db[_0x7cb4('0x2a')][_0x7cb4('0x46')](_0x4e847f)[_0x7cb4('0x25')](handleEntityNotFound(_0x27d5d0,null))['then'](respondWithResult(_0x27d5d0,null))[_0x7cb4('0x41')](handleError(_0x27d5d0,null));};exports[_0x7cb4('0x47')]=function(_0x3c1c3b,_0x3ba616){return db[_0x7cb4('0x2a')][_0x7cb4('0x47')](_0x3c1c3b[_0x7cb4('0x48')],{})['then'](respondWithResult(_0x3ba616,0xc9))[_0x7cb4('0x41')](handleError(_0x3ba616,null));};exports[_0x7cb4('0x23')]=function(_0xb0af8f,_0x3ded57){if(_0xb0af8f['body']['id']){delete _0xb0af8f[_0x7cb4('0x48')]['id'];}return db[_0x7cb4('0x2a')][_0x7cb4('0x46')]({'where':{'id':_0xb0af8f[_0x7cb4('0x43')]['id']}})[_0x7cb4('0x25')](handleEntityNotFound(_0x3ded57,null))['then'](saveUpdates(_0xb0af8f['body'],null))['then'](respondWithResult(_0x3ded57,null))[_0x7cb4('0x41')](handleError(_0x3ded57,null));};exports['destroy']=function(_0x522933,_0x1cc662){return db['VoiceTransferReport']['find']({'where':{'id':_0x522933['params']['id']}})['then'](handleEntityNotFound(_0x1cc662,null))[_0x7cb4('0x25')](removeEntity(_0x1cc662,null))['catch'](handleError(_0x1cc662,null));};exports['describe']=function(_0x24f755,_0x2edb7c){return db[_0x7cb4('0x2a')][_0x7cb4('0x49')]()['then'](respondWithResult(_0x2edb7c,null))[_0x7cb4('0x41')](handleError(_0x2edb7c,null));}; \ No newline at end of file +var _0x7c37=['limit','Content-Range','apply','reject','update','then','error','stack','name','send','map','VoiceTransferReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','describe','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x7c37,0x10a));var _0x77c3=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x7c37[_0x4e7d25];return _0x526fe6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x77c3('0x0'));var jsonpatch=require(_0x77c3('0x1'));var rp=require(_0x77c3('0x2'));var moment=require(_0x77c3('0x3'));var BPromise=require(_0x77c3('0x4'));var Mustache=require(_0x77c3('0x5'));var util=require(_0x77c3('0x6'));var path=require(_0x77c3('0x7'));var sox=require(_0x77c3('0x8'));var csv=require(_0x77c3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77c3('0xa'));var _=require(_0x77c3('0xb'));var squel=require(_0x77c3('0xc'));var crypto=require(_0x77c3('0xd'));var jsforce=require(_0x77c3('0xe'));var deskjs=require(_0x77c3('0xf'));var toCsv=require(_0x77c3('0x9'));var querystring=require(_0x77c3('0x10'));var Papa=require(_0x77c3('0x11'));var Redis=require(_0x77c3('0x12'));var authService=require(_0x77c3('0x13'));var qs=require(_0x77c3('0x14'));var as=require(_0x77c3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77c3('0x16'))(_0x77c3('0x17'));var utils=require(_0x77c3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x77c3('0x19'));var db=require(_0x77c3('0x1a'))['db'];function respondWithStatusCode(_0x4e7822,_0x236c9a){_0x236c9a=_0x236c9a||0xcc;return function(_0x56d951){if(_0x56d951){return _0x4e7822[_0x77c3('0x1b')](_0x236c9a);}return _0x4e7822[_0x77c3('0x1c')](_0x236c9a)[_0x77c3('0x1d')]();};}function respondWithResult(_0x21d538,_0x33a96e){_0x33a96e=_0x33a96e||0xc8;return function(_0x551b91){if(_0x551b91){return _0x21d538[_0x77c3('0x1c')](_0x33a96e)[_0x77c3('0x1e')](_0x551b91);}};}function respondWithFilteredResult(_0x3b9838,_0x2c1b48){return function(_0x2b73c7){if(_0x2b73c7){var _0x386c49=typeof _0x2c1b48['offset']===_0x77c3('0x1f')&&typeof _0x2c1b48['limit']===_0x77c3('0x1f');var _0x37dcdc=_0x2b73c7[_0x77c3('0x20')];var _0x5257e9=_0x386c49?0x0:_0x2c1b48['offset'];var _0x7355d0=_0x386c49?_0x2b73c7[_0x77c3('0x20')]:_0x2c1b48[_0x77c3('0x21')]+_0x2c1b48[_0x77c3('0x22')];var _0x17bbba;if(_0x7355d0>=_0x37dcdc){_0x7355d0=_0x37dcdc;_0x17bbba=0xc8;}else{_0x17bbba=0xce;}_0x3b9838['status'](_0x17bbba);return _0x3b9838['set'](_0x77c3('0x23'),_0x5257e9+'-'+_0x7355d0+'/'+_0x37dcdc)[_0x77c3('0x1e')](_0x2b73c7);}return null;};}function patchUpdates(_0x1a6038){return function(_0x5d6508){try{jsonpatch[_0x77c3('0x24')](_0x5d6508,_0x1a6038,!![]);}catch(_0x11f5d4){return BPromise[_0x77c3('0x25')](_0x11f5d4);}return _0x5d6508['save']();};}function saveUpdates(_0x57703d,_0xe9c6ce){return function(_0x52afcb){if(_0x52afcb){return _0x52afcb[_0x77c3('0x26')](_0x57703d)[_0x77c3('0x27')](function(_0x68bf6f){return _0x68bf6f;});}return null;};}function removeEntity(_0x2dedc9,_0xf615fa){return function(_0x5128ac){if(_0x5128ac){return _0x5128ac['destroy']()[_0x77c3('0x27')](function(){_0x2dedc9['status'](0xcc)[_0x77c3('0x1d')]();});}};}function handleEntityNotFound(_0x3675ad,_0x56b8d6){return function(_0x275f9e){if(!_0x275f9e){_0x3675ad[_0x77c3('0x1b')](0x194);}return _0x275f9e;};}function handleError(_0x18179d,_0x570a49){_0x570a49=_0x570a49||0x1f4;return function(_0x86a53e){logger[_0x77c3('0x28')](_0x86a53e[_0x77c3('0x29')]);if(_0x86a53e[_0x77c3('0x2a')]){delete _0x86a53e[_0x77c3('0x2a')];}_0x18179d[_0x77c3('0x1c')](_0x570a49)[_0x77c3('0x2b')](_0x86a53e);};}exports['index']=function(_0x5392a6,_0x252493){var _0x4f37e8={},_0x559fbf={},_0x57e3d8={'count':0x0,'rows':[]};var _0x1e4d8d=_[_0x77c3('0x2c')](db[_0x77c3('0x2d')][_0x77c3('0x2e')],function(_0x674ad5){return{'name':_0x674ad5['fieldName'],'type':_0x674ad5['type']['key']};});_0x559fbf['model']=_[_0x77c3('0x2c')](_0x1e4d8d,_0x77c3('0x2a'));_0x559fbf[_0x77c3('0x2f')]=_[_0x77c3('0x30')](_0x5392a6[_0x77c3('0x2f')]);_0x559fbf[_0x77c3('0x31')]=_[_0x77c3('0x32')](_0x559fbf[_0x77c3('0x33')],_0x559fbf[_0x77c3('0x2f')]);_0x4f37e8[_0x77c3('0x34')]=_[_0x77c3('0x32')](_0x559fbf['model'],qs[_0x77c3('0x35')](_0x5392a6[_0x77c3('0x2f')][_0x77c3('0x35')]));_0x4f37e8[_0x77c3('0x34')]=_0x4f37e8[_0x77c3('0x34')][_0x77c3('0x36')]?_0x4f37e8[_0x77c3('0x34')]:_0x559fbf[_0x77c3('0x33')];if(!_0x5392a6[_0x77c3('0x2f')][_0x77c3('0x37')]('nolimit')){_0x4f37e8['limit']=qs[_0x77c3('0x22')](_0x5392a6[_0x77c3('0x2f')][_0x77c3('0x22')]);_0x4f37e8[_0x77c3('0x21')]=qs[_0x77c3('0x21')](_0x5392a6['query'][_0x77c3('0x21')]);}_0x4f37e8[_0x77c3('0x38')]=qs['sort'](_0x5392a6[_0x77c3('0x2f')][_0x77c3('0x39')]);_0x4f37e8[_0x77c3('0x3a')]=qs[_0x77c3('0x31')](_['pick'](_0x5392a6[_0x77c3('0x2f')],_0x559fbf['filters']),_0x1e4d8d);if(_0x5392a6['query'][_0x77c3('0x3b')]){_0x4f37e8[_0x77c3('0x3a')]=_['merge'](_0x4f37e8[_0x77c3('0x3a')],{'$or':_[_0x77c3('0x2c')](_0x1e4d8d,function(_0xd832bb){if(_0xd832bb[_0x77c3('0x3c')]!==_0x77c3('0x3d')){var _0x33ff7c={};_0x33ff7c[_0xd832bb[_0x77c3('0x2a')]]={'$like':'%'+_0x5392a6[_0x77c3('0x2f')][_0x77c3('0x3b')]+'%'};return _0x33ff7c;}})});}_0x4f37e8=_[_0x77c3('0x3e')]({},_0x4f37e8,_0x5392a6[_0x77c3('0x3f')]);var _0x4fdf3f={'where':_0x4f37e8[_0x77c3('0x3a')]};return db[_0x77c3('0x2d')][_0x77c3('0x20')](_0x4fdf3f)[_0x77c3('0x27')](function(_0xf58cc5){_0x57e3d8['count']=_0xf58cc5;if(_0x5392a6[_0x77c3('0x2f')]['includeAll']){_0x4f37e8[_0x77c3('0x40')]=[{'all':!![]}];}return db[_0x77c3('0x2d')][_0x77c3('0x41')](_0x4f37e8);})[_0x77c3('0x27')](function(_0x365ce2){_0x57e3d8[_0x77c3('0x42')]=_0x365ce2;return _0x57e3d8;})[_0x77c3('0x27')](respondWithFilteredResult(_0x252493,_0x4f37e8))['catch'](handleError(_0x252493,null));};exports[_0x77c3('0x43')]=function(_0x171c48,_0x426b5c){var _0x52cf75={'raw':!![],'where':{'id':_0x171c48[_0x77c3('0x44')]['id']}},_0x293fb5={};_0x293fb5[_0x77c3('0x33')]=_[_0x77c3('0x30')](db[_0x77c3('0x2d')][_0x77c3('0x2e')]);_0x293fb5['query']=_[_0x77c3('0x30')](_0x171c48[_0x77c3('0x2f')]);_0x293fb5[_0x77c3('0x31')]=_[_0x77c3('0x32')](_0x293fb5['model'],_0x293fb5['query']);_0x52cf75['attributes']=_[_0x77c3('0x32')](_0x293fb5['model'],qs[_0x77c3('0x35')](_0x171c48[_0x77c3('0x2f')][_0x77c3('0x35')]));_0x52cf75[_0x77c3('0x34')]=_0x52cf75[_0x77c3('0x34')][_0x77c3('0x36')]?_0x52cf75[_0x77c3('0x34')]:_0x293fb5[_0x77c3('0x33')];if(_0x171c48['query'][_0x77c3('0x45')]){_0x52cf75['include']=[{'all':!![]}];}_0x52cf75=_['merge']({},_0x52cf75,_0x171c48[_0x77c3('0x3f')]);return db[_0x77c3('0x2d')][_0x77c3('0x46')](_0x52cf75)[_0x77c3('0x27')](handleEntityNotFound(_0x426b5c,null))[_0x77c3('0x27')](respondWithResult(_0x426b5c,null))[_0x77c3('0x47')](handleError(_0x426b5c,null));};exports[_0x77c3('0x48')]=function(_0x3165c3,_0x26a283){return db[_0x77c3('0x2d')][_0x77c3('0x48')](_0x3165c3[_0x77c3('0x49')],{})['then'](respondWithResult(_0x26a283,0xc9))[_0x77c3('0x47')](handleError(_0x26a283,null));};exports['update']=function(_0x2e5ce5,_0x3be64f){if(_0x2e5ce5[_0x77c3('0x49')]['id']){delete _0x2e5ce5['body']['id'];}return db[_0x77c3('0x2d')][_0x77c3('0x46')]({'where':{'id':_0x2e5ce5[_0x77c3('0x44')]['id']}})[_0x77c3('0x27')](handleEntityNotFound(_0x3be64f,null))[_0x77c3('0x27')](saveUpdates(_0x2e5ce5[_0x77c3('0x49')],null))['then'](respondWithResult(_0x3be64f,null))['catch'](handleError(_0x3be64f,null));};exports['destroy']=function(_0x4113e9,_0x56e23e){return db['VoiceTransferReport'][_0x77c3('0x46')]({'where':{'id':_0x4113e9[_0x77c3('0x44')]['id']}})[_0x77c3('0x27')](handleEntityNotFound(_0x56e23e,null))['then'](removeEntity(_0x56e23e,null))[_0x77c3('0x47')](handleError(_0x56e23e,null));};exports['describe']=function(_0x252fea,_0x501cc0){return db[_0x77c3('0x2d')][_0x77c3('0x4a')]()[_0x77c3('0x27')](respondWithResult(_0x501cc0,null))[_0x77c3('0x47')](handleError(_0x501cc0,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 503d41b..d9e18d8 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 _0xe914=['./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0xe914,0x7d));var _0x4e91=function(_0x198d0,_0x30c0d7){_0x198d0=_0x198d0-0x0;var _0x51038c=_0xe914[_0x198d0];return _0x51038c;};'use strict';var _=require(_0x4e91('0x0'));var util=require(_0x4e91('0x1'));var logger=require(_0x4e91('0x2'))('api');var moment=require(_0x4e91('0x3'));var BPromise=require(_0x4e91('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e91('0x5'));var rimraf=require(_0x4e91('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e91('0x7'));module[_0x4e91('0x8')]=function(_0xbf3068,_0x564864){return _0xbf3068['define'](_0x4e91('0x9'),attributes,{'tableName':_0x4e91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4b9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x2af76d,_0x5031cf){var _0xa6005e=function(_0x4da736){while(--_0x4da736){_0x2af76d['push'](_0x2af76d['shift']());}};_0xa6005e(++_0x5031cf);}(_0xe4b9,0xf0));var _0x9e4b=function(_0x2fce53,_0x10ef75){_0x2fce53=_0x2fce53-0x0;var _0x449d75=_0xe4b9[_0x2fce53];return _0x449d75;};'use strict';var _=require('lodash');var util=require(_0x9e4b('0x0'));var logger=require(_0x9e4b('0x1'))(_0x9e4b('0x2'));var moment=require(_0x9e4b('0x3'));var BPromise=require(_0x9e4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4b('0x5'));var rimraf=require(_0x9e4b('0x6'));var config=require(_0x9e4b('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x9e4b('0x8')]=function(_0x3015ad,_0x31404c){return _0x3015ad[_0x9e4b('0x9')](_0x9e4b('0xa'),attributes,{'tableName':_0x9e4b('0xb'),'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 40c3ef1..5f417b9 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 _0x7afe=['raw','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options'];(function(_0x4d5c85,_0x153f30){var _0x330b70=function(_0x5e523d){while(--_0x5e523d){_0x4d5c85['push'](_0x4d5c85['shift']());}};_0x330b70(++_0x153f30);}(_0x7afe,0x10f));var _0xe7af=function(_0x13dc4b,_0x4635e8){_0x13dc4b=_0x13dc4b-0x0;var _0x25626d=_0x7afe[_0x13dc4b];return _0x25626d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe7af('0x0'));var rs=require(_0xe7af('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7af('0x2'))['db'];var utils=require(_0xe7af('0x3'));var logger=require(_0xe7af('0x4'))('rpc');var config=require(_0xe7af('0x5'));var jayson=require(_0xe7af('0x6'));var client=jayson[_0xe7af('0x7')][_0xe7af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x270aea,_0x141e23,_0x599226){return new BPromise(function(_0x35cfad,_0x373c91){return client[_0xe7af('0x9')](_0x270aea,_0x599226)[_0xe7af('0xa')](function(_0x12da08){logger[_0xe7af('0xb')](_0xe7af('0xc'),_0x141e23,'request\x20sent');logger[_0xe7af('0xd')](_0xe7af('0xe'),_0x141e23,_0xe7af('0xf'),JSON[_0xe7af('0x10')](_0x12da08));if(_0x12da08['error']){if(_0x12da08[_0xe7af('0x11')][_0xe7af('0x12')]===0x1f4){logger[_0xe7af('0x11')](_0xe7af('0xc'),_0x141e23,_0x12da08[_0xe7af('0x11')]['message']);return _0x373c91(_0x12da08['error'][_0xe7af('0x13')]);}logger[_0xe7af('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x141e23,_0x12da08['error'][_0xe7af('0x13')]);return _0x35cfad(_0x12da08[_0xe7af('0x11')][_0xe7af('0x13')]);}else{logger['info'](_0xe7af('0xc'),_0x141e23,'request\x20sent');_0x35cfad(_0x12da08[_0xe7af('0x14')][_0xe7af('0x13')]);}})[_0xe7af('0x15')](function(_0x58f3c3){logger['error'](_0xe7af('0xc'),_0x141e23,_0x58f3c3);_0x373c91(_0x58f3c3);});});}exports[_0xe7af('0x16')]=function(_0x28335f){var _0x48aecb=this;return new Promise(function(_0x27a86d,_0x20a74c){return db[_0xe7af('0x17')][_0xe7af('0x18')](_0x28335f['body'],{'raw':_0x28335f[_0xe7af('0x19')]?_0x28335f['options'][_0xe7af('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1d8d07){logger[_0xe7af('0xb')](_0xe7af('0x16'),_0x28335f);logger[_0xe7af('0xd')](_0xe7af('0x16'),_0x28335f,JSON['stringify'](_0x1d8d07));_0x27a86d(_0x1d8d07);})['catch'](function(_0x317ef4){logger[_0xe7af('0x11')]('CreateVoiceTransferReport',_0x317ef4[_0xe7af('0x13')],_0x28335f);_0x20a74c(_0x48aecb[_0xe7af('0x11')](0x1f4,_0x317ef4[_0xe7af('0x13')]));});});}; \ No newline at end of file +var _0x74d1=['body','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','catch','VoiceTransferReport','create'];(function(_0x1f2218,_0xa2204){var _0x27c45b=function(_0x3240db){while(--_0x3240db){_0x1f2218['push'](_0x1f2218['shift']());}};_0x27c45b(++_0xa2204);}(_0x74d1,0x100));var _0x174d=function(_0x51306b,_0x4910b1){_0x51306b=_0x51306b-0x0;var _0x32b6eb=_0x74d1[_0x51306b];return _0x32b6eb;};'use strict';var _=require(_0x174d('0x0'));var util=require(_0x174d('0x1'));var moment=require(_0x174d('0x2'));var BPromise=require('bluebird');var rs=require(_0x174d('0x3'));var fs=require('fs');var Redis=require(_0x174d('0x4'));var db=require(_0x174d('0x5'))['db'];var utils=require(_0x174d('0x6'));var logger=require(_0x174d('0x7'))(_0x174d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x174d('0x9')][_0x174d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c4174,_0x2e85db,_0x4253a6){return new BPromise(function(_0x3a63ac,_0x167143){return client[_0x174d('0xb')](_0x8c4174,_0x4253a6)[_0x174d('0xc')](function(_0x3d6de4){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2e85db,_0x174d('0xd'));logger[_0x174d('0xe')](_0x174d('0xf'),_0x2e85db,'request\x20sent',JSON[_0x174d('0x10')](_0x3d6de4));if(_0x3d6de4[_0x174d('0x11')]){if(_0x3d6de4[_0x174d('0x11')][_0x174d('0x12')]===0x1f4){logger[_0x174d('0x11')](_0x174d('0x13'),_0x2e85db,_0x3d6de4['error']['message']);return _0x167143(_0x3d6de4['error'][_0x174d('0x14')]);}logger[_0x174d('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e85db,_0x3d6de4[_0x174d('0x11')]['message']);return _0x3a63ac(_0x3d6de4[_0x174d('0x11')][_0x174d('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2e85db,_0x174d('0xd'));_0x3a63ac(_0x3d6de4['result'][_0x174d('0x14')]);}})[_0x174d('0x15')](function(_0x4dae6d){logger[_0x174d('0x11')](_0x174d('0x13'),_0x2e85db,_0x4dae6d);_0x167143(_0x4dae6d);});});}exports['CreateVoiceTransferReport']=function(_0x4ba9b4){var _0x1d4d5c=this;return new Promise(function(_0x1398e6,_0x477be1){return db[_0x174d('0x16')][_0x174d('0x17')](_0x4ba9b4[_0x174d('0x18')],{'raw':_0x4ba9b4['options']?_0x4ba9b4[_0x174d('0x19')][_0x174d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c4a3b){logger['info']('CreateVoiceTransferReport',_0x4ba9b4);logger[_0x174d('0xe')](_0x174d('0x1b'),_0x4ba9b4,JSON[_0x174d('0x10')](_0x3c4a3b));_0x1398e6(_0x3c4a3b);})[_0x174d('0x15')](function(_0x3d543e){logger['error'](_0x174d('0x1b'),_0x3d543e['message'],_0x4ba9b4);_0x477be1(_0x1d4d5c[_0x174d('0x11')](0x1f4,_0x3d543e[_0x174d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d225932..8b97a8d 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(_0x25b72e,_0x4477f1){var _0x437744=function(_0x49d727){while(--_0x49d727){_0x25b72e['push'](_0x25b72e['shift']());}};_0x437744(++_0x4477f1);}(_0xdace,0xc5));var _0xedac=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xdace[_0x867b0a];return _0x137438;};'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 _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index b6fbf46..d0d927c 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 _0xda65=['number','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','error','stack','name','send','status','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','util','bluebird','jayson/promise','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda65,0x1d0));var _0x5da6=function(_0x4c4342,_0x5cad48){_0x4c4342=_0x4c4342-0x0;var _0x144627=_0xda65[_0x4c4342];return _0x144627;};'use strict';var path=require(_0x5da6('0x0'));var fs=require('fs');var _=require(_0x5da6('0x1'));var db=require(_0x5da6('0x2'))['db'];var config=require('../../config/environment');var util=require(_0x5da6('0x3'));var BPromise=require(_0x5da6('0x4'));var jayson=require(_0x5da6('0x5'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require(_0x5da6('0x6'))(_0x5da6('0x7'));var Redis=require(_0x5da6('0x8'));config[_0x5da6('0x9')]=_[_0x5da6('0xa')](config['redis'],{'host':_0x5da6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x5da6('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5da6('0xd')]},'callNumber':{'type':_0x5da6('0xe'),'required':[!![],_0x5da6('0xf')]},'callerId':{'type':_0x5da6('0xe')},'callbackUrl':{'type':_0x5da6('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],_0x5da6('0xd')]},'sessionId':{'type':_0x5da6('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5da6('0xd')]},'sessionId':{'type':_0x5da6('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],_0x5da6('0xd')]},'sessionId':{'type':_0x5da6('0xe'),'required':[!![],_0x5da6('0x11')]},'transferNumber':{'type':_0x5da6('0xe'),'required':[!![],_0x5da6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5da6('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],_0x5da6('0xd')]},'sessionId':{'type':_0x5da6('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],_0x5da6('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5da6('0x10'),'required':[!![],_0x5da6('0xd')]}});function emit(_0x4f594e,_0x272b50,_0x478ce5){logger['info'](_0x4f594e,_0x272b50,JSON[_0x5da6('0x13')](_0x478ce5));io['to'](_0x4f594e)[_0x5da6('0x14')](_0x272b50,_0x478ce5);}function handleError(_0x41534d){return function(_0x4c3b2d){console[_0x5da6('0x15')]('handleError:',_0x4c3b2d,_0x4c3b2d instanceof RangeError);logger[_0x5da6('0x16')](_0x4c3b2d[_0x5da6('0x17')]);if(_0x4c3b2d instanceof RangeError){if(_0x4c3b2d[_0x5da6('0x18')]){delete _0x4c3b2d[_0x5da6('0x18')];}_0x41534d['status'](0x194)[_0x5da6('0x19')](_0x4c3b2d);}else{if(_0x4c3b2d[_0x5da6('0x18')]){delete _0x4c3b2d[_0x5da6('0x18')];}_0x41534d[_0x5da6('0x1a')](0x1f4)[_0x5da6('0x19')](_0x4c3b2d);}};}function checkError(){return function(_0x4107e4){if(!_0x4107e4){throw new RangeError(_0x5da6('0x1b'));}return _0x4107e4;};}function respondWithRpcPromise(_0xabbd18,_0x4eca61){return new BPromise(function(_0x317cdb,_0x5ad81b){var _0x92171e=amiClient;return _0x92171e[_0x5da6('0x1c')](_0xabbd18,_0x4eca61)[_0x5da6('0x1d')](function(_0xdbaece){if(_0xdbaece[_0x5da6('0x16')]){if(_0xdbaece[_0x5da6('0x16')][_0x5da6('0x1e')]===0x1f4){return _0x5ad81b(_0xdbaece[_0x5da6('0x16')]['message']);}return _0x317cdb(_0xdbaece['error'][_0x5da6('0x1f')]);}else{_0x317cdb(_0xdbaece[_0x5da6('0x20')]);}})['catch'](function(_0x559855){_0x5ad81b(_0x559855);});});}function getAgent(_0x2db51e){return db[_0x5da6('0x21')][_0x5da6('0x22')]({'where':{'id':_0x2db51e,'role':_0x5da6('0x23')}})[_0x5da6('0x1d')](checkError());}function getAgentCheckSession(_0x495138,_0x471873){return new BPromise(function(_0x1bc214,_0x42aa03){var _0x573b0c=respondWithRpcPromise(_0x5da6('0x24'));var _0x2b3be1=getAgent(_0x495138);Promise['all']([_0x573b0c,_0x2b3be1])[_0x5da6('0x1d')](function(_0x34545f){var _0x440895=_0x34545f[0x0];var _0x10432a=_0x34545f[0x1];var _0x2be5ac=_[_0x5da6('0x25')](_0x440895[_0x5da6('0x26')],function(_0x25e8ae){return _0x25e8ae[_0x5da6('0x27')]==_0x10432a['id']&&_0x25e8ae[_0x5da6('0x28')]==_0x471873;});if(_0x2be5ac[_0x5da6('0x29')]==0x1){_0x1bc214(_0x10432a);}else{_0x42aa03(new RangeError(_0x5da6('0x2a')+_0x471873+_0x5da6('0x2b')));}});});}exports[_0x5da6('0x2c')]=function(_0x5d6b39,_0x42af0d){logger[_0x5da6('0x2d')](_0x5da6('0x2e'),_0x5d6b39['body']);var _0x1a1fb6=originateValidation[_0x5da6('0xc')](_0x5d6b39[_0x5da6('0x2f')]);if(_0x1a1fb6[_0x5da6('0x29')]>0x0){return _0x42af0d[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x1a1fb6);}var _0x2d7bd2=_0x5d6b39[_0x5da6('0x2f')][_0x5da6('0x31')];var _0x4f8544=_0x5d6b39['body'][_0x5da6('0x32')];var _0x5bbe10=_0x5d6b39['body'][_0x5da6('0x33')];var _0x150b1d=_0x5d6b39['body']['callbackUrl'];return getAgent(_0x2d7bd2)[_0x5da6('0x1d')](function(_0x57e8c2){logger['info'](_0x5da6('0x34'),_0x57e8c2[_0x5da6('0x18')]);emit(util['format'](_0x5da6('0x35'),_0x57e8c2[_0x5da6('0x18')]),_0x5da6('0x36'),{'callNumber':_0x4f8544,'callerId':_0x5bbe10,'callbackUrl':_0x150b1d});return _0x42af0d[_0x5da6('0x1a')](0xc8)['json']({'error':![],'message':_0x5da6('0x37')});})[_0x5da6('0x38')](handleError(_0x42af0d));};exports[_0x5da6('0x39')]=function(_0x4aab18,_0x44c3a2){logger[_0x5da6('0x2d')](_0x5da6('0x3a'),_0x4aab18[_0x5da6('0x2f')]);var _0x17dd2f=hangupValidation[_0x5da6('0xc')](_0x4aab18['body']);if(_0x17dd2f[_0x5da6('0x29')]>0x0){return _0x44c3a2[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x17dd2f);}var _0x4bc07d=_0x4aab18['body']['userId'];var _0x36e215=_0x4aab18['body'][_0x5da6('0x28')];return getAgent(_0x4bc07d)['then'](function(_0x2afd1e){logger['info'](_0x5da6('0x34'),_0x2afd1e[_0x5da6('0x18')]);emit(util['format'](_0x5da6('0x35'),_0x2afd1e[_0x5da6('0x18')]),_0x5da6('0x3b'),{'sessionId':_0x36e215});return _0x44c3a2[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'error':![],'message':_0x5da6('0x3c')});})[_0x5da6('0x38')](handleError(_0x44c3a2));};exports[_0x5da6('0x3d')]=function(_0x1b1a5d,_0x3071ed){logger[_0x5da6('0x2d')](_0x5da6('0x3e'),_0x1b1a5d[_0x5da6('0x2f')]);var _0x2ba795=answerValidation[_0x5da6('0xc')](_0x1b1a5d[_0x5da6('0x2f')]);if(_0x2ba795[_0x5da6('0x29')]>0x0){return _0x3071ed['status'](0x190)[_0x5da6('0x30')](_0x2ba795);}var _0x313a24=_0x1b1a5d[_0x5da6('0x2f')][_0x5da6('0x31')];var _0x5e01d2=_0x1b1a5d[_0x5da6('0x2f')][_0x5da6('0x28')];return getAgent(_0x313a24)[_0x5da6('0x1d')](function(_0x297007){logger['info'](_0x5da6('0x34'),_0x297007[_0x5da6('0x18')]);emit(util[_0x5da6('0x3f')](_0x5da6('0x35'),_0x297007[_0x5da6('0x18')]),_0x5da6('0x40'),{'sessionId':_0x5e01d2});return _0x3071ed[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'error':![],'message':_0x5da6('0x41')});})['catch'](handleError(_0x3071ed));};exports[_0x5da6('0x42')]=function(_0x351848,_0x4583f4){logger['info']('hold\x20fired:',_0x351848[_0x5da6('0x2f')]);var _0x369ad5=holdValidation[_0x5da6('0xc')](_0x351848[_0x5da6('0x2f')]);if(_0x369ad5[_0x5da6('0x29')]>0x0){return _0x4583f4['status'](0x190)['json'](_0x369ad5);}var _0x4dd635=_0x351848[_0x5da6('0x2f')][_0x5da6('0x31')];var _0x3ce7b5=_0x351848[_0x5da6('0x2f')][_0x5da6('0x28')];return getAgent(_0x4dd635)[_0x5da6('0x1d')](function(_0x4a8da1){logger[_0x5da6('0x2d')](_0x5da6('0x34'),_0x4a8da1[_0x5da6('0x18')]);emit(util['format']('user:%s',_0x4a8da1[_0x5da6('0x18')]),_0x5da6('0x43'),{'sessionId':_0x3ce7b5});return _0x4583f4['status'](0xc8)[_0x5da6('0x30')]({'error':![],'message':_0x5da6('0x44')});})[_0x5da6('0x38')](handleError(_0x4583f4));};exports['unhold']=function(_0x2c90e2,_0x57de51){logger[_0x5da6('0x2d')](_0x5da6('0x45'),_0x2c90e2[_0x5da6('0x2f')]);var _0x33bea1=unholdValidation[_0x5da6('0xc')](_0x2c90e2[_0x5da6('0x2f')]);if(_0x33bea1[_0x5da6('0x29')]>0x0){return _0x57de51[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x33bea1);}var _0x2e5ab7=_0x2c90e2[_0x5da6('0x2f')][_0x5da6('0x31')];var _0x50744d=_0x2c90e2[_0x5da6('0x2f')][_0x5da6('0x28')];return getAgent(_0x2e5ab7)['then'](function(_0xee8548){logger[_0x5da6('0x2d')](_0x5da6('0x34'),_0xee8548[_0x5da6('0x18')]);emit(util['format']('user:%s',_0xee8548['name']),_0x5da6('0x46'),{'sessionId':_0x50744d});return _0x57de51[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x5da6('0x38')](handleError(_0x57de51));};exports[_0x5da6('0x47')]=function(_0x3a07d7,_0x2d3e76){logger[_0x5da6('0x2d')](_0x5da6('0x48'),_0x2d3e76['body']);var _0x23fe40=callsValidation[_0x5da6('0xc')](_0x3a07d7[_0x5da6('0x2f')]);if(_0x23fe40[_0x5da6('0x29')]>0x0){return _0x2d3e76[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x23fe40);}var _0x25145a=_0x3a07d7[_0x5da6('0x2f')][_0x5da6('0x31')];var _0x4cf66d=respondWithRpcPromise('VoiceChannels');var _0x1a6014=getAgent(_0x25145a);return Promise[_0x5da6('0x49')]([_0x4cf66d,_0x1a6014])['then'](function(_0x298970){var _0x2eca9f=_0x298970[0x0];var _0x16840a=_0x298970[0x1];var _0x33b059=_[_0x5da6('0x25')](_0x2eca9f['rows'],function(_0x5d2189){return _0x5d2189[_0x5da6('0x27')]==_0x16840a['id'];});return _0x2d3e76[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'count':_0x33b059[_0x5da6('0x29')],'rows':_0x33b059});})[_0x5da6('0x38')](handleError(_0x2d3e76));};exports[_0x5da6('0x4a')]=function(_0x298dc4,_0x1bbe3a){logger[_0x5da6('0x2d')](_0x5da6('0x4b'),_0x298dc4[_0x5da6('0x2f')]);var _0x5ed4a7=conferenceValidation['validate'](_0x298dc4[_0x5da6('0x2f')]);if(_0x5ed4a7[_0x5da6('0x29')]>0x0){return _0x1bbe3a[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x5ed4a7);}var _0x1f8360=_0x298dc4[_0x5da6('0x2f')][_0x5da6('0x31')];return getAgent(_0x1f8360)[_0x5da6('0x1d')](function(_0x5a1891){logger['info'](_0x5da6('0x34'),_0x5a1891[_0x5da6('0x18')]);emit(util['format'](_0x5da6('0x35'),_0x5a1891[_0x5da6('0x18')]),_0x5da6('0x4c'));return _0x1bbe3a[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x1bbe3a));};exports['transfer']=function(_0x77db56,_0x4d3dc4){logger['info'](_0x5da6('0x4d'),_0x77db56[_0x5da6('0x2f')]);var _0x42e7b7=transferValidation[_0x5da6('0xc')](_0x77db56[_0x5da6('0x2f')]);if(_0x42e7b7[_0x5da6('0x29')]>0x0){return _0x4d3dc4[_0x5da6('0x1a')](0x190)[_0x5da6('0x30')](_0x42e7b7);}var _0x4fbe0a=_0x77db56[_0x5da6('0x2f')]['userId'];var _0x6103b9=_0x77db56[_0x5da6('0x2f')][_0x5da6('0x28')];var _0x34c096=_0x77db56['body'][_0x5da6('0x4e')];return getAgent(_0x4fbe0a)[_0x5da6('0x1d')](function(_0x47aaaf){logger['info']('entityFound:',_0x47aaaf['name']);emit(util[_0x5da6('0x3f')]('user:%s',_0x47aaaf['name']),'webbar:transfer',{'sessionId':_0x6103b9,'transferNumber':_0x34c096});return _0x4d3dc4[_0x5da6('0x1a')](0xc8)[_0x5da6('0x30')]({'error':![],'message':_0x5da6('0x4f')});})[_0x5da6('0x38')](handleError(_0x4d3dc4));}; \ No newline at end of file +var _0x6f7a=['findOne','agent','then','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','code','catch','User'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x92eaf8,_0x38ec84){_0x92eaf8=_0x92eaf8-0x0;var _0x11ffdf=_0x6f7a[_0x92eaf8];return _0x11ffdf;};'use strict';var path=require(_0xa6f7('0x0'));var fs=require('fs');var _=require(_0xa6f7('0x1'));var db=require(_0xa6f7('0x2'))['db'];var config=require(_0xa6f7('0x3'));var util=require('util');var BPromise=require(_0xa6f7('0x4'));var jayson=require(_0xa6f7('0x5'));var amiClient=jayson[_0xa6f7('0x6')][_0xa6f7('0x7')]({'port':0x232a});var logger=require(_0xa6f7('0x8'))(_0xa6f7('0x9'));var Redis=require(_0xa6f7('0xa'));config[_0xa6f7('0xb')]=_[_0xa6f7('0xc')](config[_0xa6f7('0xb')],{'host':_0xa6f7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xa6f7('0xe'));var originateValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'callNumber':{'type':_0xa6f7('0x11'),'required':[!![],_0xa6f7('0x12')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xa6f7('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]}});function emit(_0x6efd38,_0x47e664,_0xdb37e2){logger[_0xa6f7('0x13')](_0x6efd38,_0x47e664,JSON[_0xa6f7('0x14')](_0xdb37e2));io['to'](_0x6efd38)[_0xa6f7('0x15')](_0x47e664,_0xdb37e2);}function handleError(_0x5681d5){return function(_0x4a8827){console[_0xa6f7('0x16')]('handleError:',_0x4a8827,_0x4a8827 instanceof RangeError);logger[_0xa6f7('0x17')](_0x4a8827[_0xa6f7('0x18')]);if(_0x4a8827 instanceof RangeError){if(_0x4a8827['name']){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x194)[_0xa6f7('0x1b')](_0x4a8827);}else{if(_0x4a8827[_0xa6f7('0x19')]){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x1f4)['send'](_0x4a8827);}};}function checkError(){return function(_0x3c0c55){if(!_0x3c0c55){throw new RangeError(_0xa6f7('0x1c'));}return _0x3c0c55;};}function respondWithRpcPromise(_0x58b6a1,_0x5d1159){return new BPromise(function(_0x5ddc8d,_0x1de6c9){var _0x119950=amiClient;return _0x119950['request'](_0x58b6a1,_0x5d1159)['then'](function(_0x50e2be){if(_0x50e2be[_0xa6f7('0x17')]){if(_0x50e2be[_0xa6f7('0x17')][_0xa6f7('0x1d')]===0x1f4){return _0x1de6c9(_0x50e2be['error']['message']);}return _0x5ddc8d(_0x50e2be[_0xa6f7('0x17')]['message']);}else{_0x5ddc8d(_0x50e2be['result']);}})[_0xa6f7('0x1e')](function(_0x5efdce){_0x1de6c9(_0x5efdce);});});}function getAgent(_0x35847e){return db[_0xa6f7('0x1f')][_0xa6f7('0x20')]({'where':{'id':_0x35847e,'role':_0xa6f7('0x21')}})[_0xa6f7('0x22')](checkError());}function getAgentCheckSession(_0x4b8d2b,_0x51db47){return new BPromise(function(_0x1c419b,_0x2ad0d9){var _0x55d45a=respondWithRpcPromise(_0xa6f7('0x23'));var _0x27babb=getAgent(_0x4b8d2b);Promise[_0xa6f7('0x24')]([_0x55d45a,_0x27babb])[_0xa6f7('0x22')](function(_0x224f5a){var _0x10bf77=_0x224f5a[0x0];var _0x353de8=_0x224f5a[0x1];var _0x54f72c=_[_0xa6f7('0x25')](_0x10bf77[_0xa6f7('0x26')],function(_0x40b0f8){return _0x40b0f8[_0xa6f7('0x27')]==_0x353de8['id']&&_0x40b0f8['sessionId']==_0x51db47;});if(_0x54f72c[_0xa6f7('0x28')]==0x1){_0x1c419b(_0x353de8);}else{_0x2ad0d9(new RangeError(_0xa6f7('0x29')+_0x51db47+'\x20not\x20found!'));}});});}exports[_0xa6f7('0x2a')]=function(_0x34d571,_0x4d79d8){logger['info'](_0xa6f7('0x2b'),_0x34d571[_0xa6f7('0x2c')]);var _0x2b33d=originateValidation[_0xa6f7('0xe')](_0x34d571[_0xa6f7('0x2c')]);if(_0x2b33d['length']>0x0){return _0x4d79d8['status'](0x190)[_0xa6f7('0x2d')](_0x2b33d);}var _0x4c2acd=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0xfa0fb6=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2f')];var _0xbdfc5a=_0x34d571['body'][_0xa6f7('0x30')];var _0xb1a7f8=_0x34d571[_0xa6f7('0x2c')]['callbackUrl'];return getAgent(_0x4c2acd)[_0xa6f7('0x22')](function(_0x5ab03d){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5ab03d[_0xa6f7('0x19')]);emit(util['format'](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x19')]),_0xa6f7('0x33'),{'callNumber':_0xfa0fb6,'callerId':_0xbdfc5a,'callbackUrl':_0xb1a7f8});return _0x4d79d8[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x34')});})['catch'](handleError(_0x4d79d8));};exports[_0xa6f7('0x35')]=function(_0xd930e8,_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x36'),_0xd930e8[_0xa6f7('0x2c')]);var _0x45acdd=hangupValidation[_0xa6f7('0xe')](_0xd930e8['body']);if(_0x45acdd[_0xa6f7('0x28')]>0x0){return _0xc25a1b[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x45acdd);}var _0x518088=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x589d94=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x518088)[_0xa6f7('0x22')](function(_0x14d532){logger[_0xa6f7('0x13')]('entityFound:',_0x14d532[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x14d532[_0xa6f7('0x19')]),_0xa6f7('0x39'),{'sessionId':_0x589d94});return _0xc25a1b[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3a')});})['catch'](handleError(_0xc25a1b));};exports['answer']=function(_0x12f7b5,_0x3e1535){logger[_0xa6f7('0x13')](_0xa6f7('0x3b'),_0x12f7b5[_0xa6f7('0x2c')]);var _0x387714=answerValidation[_0xa6f7('0xe')](_0x12f7b5[_0xa6f7('0x2c')]);if(_0x387714[_0xa6f7('0x28')]>0x0){return _0x3e1535[_0xa6f7('0x1a')](0x190)['json'](_0x387714);}var _0x41917c=_0x12f7b5[_0xa6f7('0x2c')]['userId'];var _0x22d500=_0x12f7b5[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x41917c)[_0xa6f7('0x22')](function(_0x51de13){logger[_0xa6f7('0x13')]('entityFound:',_0x51de13['name']);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x51de13[_0xa6f7('0x19')]),_0xa6f7('0x3c'),{'sessionId':_0x22d500});return _0x3e1535[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3d')});})['catch'](handleError(_0x3e1535));};exports[_0xa6f7('0x3e')]=function(_0x40dbe6,_0x55cb70){logger[_0xa6f7('0x13')](_0xa6f7('0x3f'),_0x40dbe6[_0xa6f7('0x2c')]);var _0x5cc89c=holdValidation[_0xa6f7('0xe')](_0x40dbe6['body']);if(_0x5cc89c[_0xa6f7('0x28')]>0x0){return _0x55cb70[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x5cc89c);}var _0x5f3c84=_0x40dbe6['body'][_0xa6f7('0x2e')];var _0x5928e4=_0x40dbe6[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x5f3c84)['then'](function(_0x1e7089){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x1e7089[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x1e7089['name']),_0xa6f7('0x40'),{'sessionId':_0x5928e4});return _0x55cb70[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x41')});})['catch'](handleError(_0x55cb70));};exports[_0xa6f7('0x42')]=function(_0x59091a,_0x488efc){logger[_0xa6f7('0x13')](_0xa6f7('0x43'),_0x59091a[_0xa6f7('0x2c')]);var _0x2b3de2=unholdValidation[_0xa6f7('0xe')](_0x59091a['body']);if(_0x2b3de2[_0xa6f7('0x28')]>0x0){return _0x488efc[_0xa6f7('0x1a')](0x190)['json'](_0x2b3de2);}var _0x4b83f6=_0x59091a['body'][_0xa6f7('0x2e')];var _0x1c2099=_0x59091a[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x4b83f6)[_0xa6f7('0x22')](function(_0x5dab05){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5dab05[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x5dab05['name']),'webbar:unhold',{'sessionId':_0x1c2099});return _0x488efc[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x44')});})[_0xa6f7('0x1e')](handleError(_0x488efc));};exports['calls']=function(_0x9d901e,_0x2105dd){logger[_0xa6f7('0x13')](_0xa6f7('0x45'),_0x2105dd[_0xa6f7('0x2c')]);var _0x39538e=callsValidation['validate'](_0x9d901e[_0xa6f7('0x2c')]);if(_0x39538e[_0xa6f7('0x28')]>0x0){return _0x2105dd[_0xa6f7('0x1a')](0x190)['json'](_0x39538e);}var _0xb049d7=_0x9d901e[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x4496f1=respondWithRpcPromise('VoiceChannels');var _0x4ec005=getAgent(_0xb049d7);return Promise[_0xa6f7('0x24')]([_0x4496f1,_0x4ec005])[_0xa6f7('0x22')](function(_0x1103c6){var _0x52e647=_0x1103c6[0x0];var _0x301327=_0x1103c6[0x1];var _0x269249=_[_0xa6f7('0x25')](_0x52e647['rows'],function(_0x169bbe){return _0x169bbe[_0xa6f7('0x27')]==_0x301327['id'];});return _0x2105dd[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'count':_0x269249[_0xa6f7('0x28')],'rows':_0x269249});})[_0xa6f7('0x1e')](handleError(_0x2105dd));};exports[_0xa6f7('0x46')]=function(_0x3bc870,_0x444177){logger[_0xa6f7('0x13')](_0xa6f7('0x47'),_0x3bc870['body']);var _0x224e33=conferenceValidation['validate'](_0x3bc870[_0xa6f7('0x2c')]);if(_0x224e33['length']>0x0){return _0x444177[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x224e33);}var _0x5a158f=_0x3bc870[_0xa6f7('0x2c')][_0xa6f7('0x2e')];return getAgent(_0x5a158f)[_0xa6f7('0x22')](function(_0x501503){logger[_0xa6f7('0x13')]('entityFound:',_0x501503[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')]('user:%s',_0x501503[_0xa6f7('0x19')]),'webbar:conference');return _0x444177[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x48')});})[_0xa6f7('0x1e')](handleError(_0x444177));};exports[_0xa6f7('0x49')]=function(_0xca47c2,_0x315939){logger[_0xa6f7('0x13')](_0xa6f7('0x4a'),_0xca47c2[_0xa6f7('0x2c')]);var _0x153635=transferValidation[_0xa6f7('0xe')](_0xca47c2[_0xa6f7('0x2c')]);if(_0x153635[_0xa6f7('0x28')]>0x0){return _0x315939['status'](0x190)[_0xa6f7('0x2d')](_0x153635);}var _0x3c0c6e=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x154c78=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x37')];var _0x3a5700=_0xca47c2['body'][_0xa6f7('0x4b')];return getAgent(_0x3c0c6e)[_0xa6f7('0x22')](function(_0x9c102f){logger['info'](_0xa6f7('0x31'),_0x9c102f[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x9c102f[_0xa6f7('0x19')]),_0xa6f7('0x4c'),{'sessionId':_0x154c78,'transferNumber':_0x3a5700});return _0x315939[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x315939));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6bb4531..99b0149 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 _0x2ef3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','/:id/notify','/:id/send','send','put','update','delete','removeAnswers'];(function(_0x34f3f7,_0x3ad6b6){var _0x3a01e3=function(_0x21292f){while(--_0x21292f){_0x34f3f7['push'](_0x34f3f7['shift']());}};_0x3a01e3(++_0x3ad6b6);}(_0x2ef3,0xba));var _0x32ef=function(_0x3877cb,_0x18fb89){_0x3877cb=_0x3877cb-0x0;var _0x101696=_0x2ef3[_0x3877cb];return _0x101696;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['get'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['getApplications']);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x15')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x15')](_0x32ef('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32ef('0x15')](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['addApplications']);router[_0x32ef('0x15')](_0x32ef('0x18'),controller['notify']);router[_0x32ef('0x15')](_0x32ef('0x19'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1a')]);router[_0x32ef('0x1b')](_0x32ef('0xd'),auth['isAuthenticated'](),controller[_0x32ef('0x1c')]);router['delete'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['destroy']);router[_0x32ef('0x1d')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller['removeDispositions']);router['delete'](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1e')]);router['delete']('/:id/users',auth[_0x32ef('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf61e=['getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','send','put','/:id','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions'];(function(_0x3f2f83,_0x417389){var _0x2a2fba=function(_0x373acd){while(--_0x373acd){_0x3f2f83['push'](_0x3f2f83['shift']());}};_0x2a2fba(++_0x417389);}(_0xf61e,0x191));var _0xef61=function(_0x5ecc41,_0x2d809b){_0x5ecc41=_0x5ecc41-0x0;var _0x2e7b5=_0xf61e[_0x5ecc41];return _0x2e7b5;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0xb')]('/:id/applications',auth[_0xef61('0xd')](),controller['getApplications']);router[_0xef61('0x16')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x17')]);router[_0xef61('0x16')]('/:id/dispositions',auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x16')](_0xef61('0x12'),auth['isAuthenticated'](),controller[_0xef61('0x19')]);router[_0xef61('0x16')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x1a')]);router[_0xef61('0x16')](_0xef61('0x1b'),auth[_0xef61('0xd')](),controller[_0xef61('0x1c')]);router[_0xef61('0x16')]('/:id/notify',controller[_0xef61('0x1d')]);router[_0xef61('0x16')]('/:id/send',auth[_0xef61('0xd')](),controller[_0xef61('0x1e')]);router[_0xef61('0x1f')](_0xef61('0x20'),auth[_0xef61('0xd')](),controller[_0xef61('0x21')]);router[_0xef61('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0x23')]);router['delete'](_0xef61('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xef61('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef61('0x24')]);router[_0xef61('0x22')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller['removeAgents']);module[_0xef61('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 9e57635..0598425 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 _0xc528=['ENUM','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc528,0x18c));var _0x8c52=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc528[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8c52('0x0'));var rs=require(_0x8c52('0x1'));module[_0x8c52('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x8c52('0x3')]},'type':{'type':Sequelize[_0x8c52('0x4')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x8c52('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8c52('0x5')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8c52('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8c52('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8c52('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8c52('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8c52('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8c52('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8c52('0x5')],'defaultValue':![],'comment':_0x8c52('0x7'),'set':function(_0x58df2d){if(!_0x58df2d){this[_0x8c52('0x8')](_0x8c52('0x9'),null);}this[_0x8c52('0x8')]('mandatoryDisposition',_0x58df2d);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb04e=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','exports','STRING','name','sinch','TEXT'];(function(_0x8cb193,_0x4a568a){var _0x33e743=function(_0x2f9963){while(--_0x2f9963){_0x8cb193['push'](_0x8cb193['shift']());}};_0x33e743(++_0x4a568a);}(_0xb04e,0x163));var _0xeb04=function(_0x2e34f8,_0x53a191){_0x2e34f8=_0x2e34f8-0x0;var _0x2b147a=_0xb04e[_0x2e34f8];return _0x2b147a;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xeb04('0x0')]={'name':{'type':Sequelize[_0xeb04('0x1')],'unique':_0xeb04('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xeb04('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xeb04('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xeb04('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xeb04('0x1')]},'type':{'type':Sequelize['ENUM']('twilio',_0xeb04('0x3'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xeb04('0x1')]},'authToken':{'type':Sequelize[_0xeb04('0x1')]},'notificationTemplate':{'type':Sequelize[_0xeb04('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xeb04('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeb04('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xeb04('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeb04('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeb04('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeb04('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeb04('0x6')],'comment':_0xeb04('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5b8aa5){if(!_0x5b8aa5){this['setDataValue'](_0xeb04('0x8'),null);}this[_0xeb04('0x9')]('mandatoryDisposition',_0x5b8aa5);}},'description':{'type':Sequelize[_0xeb04('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ea402db..8ab1d03 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 _0x3144=['Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','WhatsappAccount','findAll','rows','params','include','options','find','create','body','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','WhatsappAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','stack','finally','WhatsappApplication','getApplications','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','From','replace','whatsapp:','Body','sinch','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','omit','WhatsappInteraction','interaction','autoclose','push','close','created','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','dataValues','Messages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index'];(function(_0x392171,_0x3d1a13){var _0x38f4cd=function(_0x2a2d6a){while(--_0x2a2d6a){_0x392171['push'](_0x392171['shift']());}};_0x38f4cd(++_0x3d1a13);}(_0x3144,0x82));var _0x4314=function(_0x479f2d,_0x4ce038){_0x479f2d=_0x479f2d-0x0;var _0x5c41a8=_0x3144[_0x479f2d];return _0x5c41a8;};'use strict';var emlformat=require(_0x4314('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4314('0x1'));var jsonpatch=require(_0x4314('0x2'));var rp=require(_0x4314('0x3'));var moment=require(_0x4314('0x4'));var BPromise=require(_0x4314('0x5'));var Mustache=require(_0x4314('0x6'));var util=require(_0x4314('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4314('0x8'));var ejs=require(_0x4314('0x9'));var fs=require('fs');var fs_extra=require(_0x4314('0xa'));var _=require(_0x4314('0xb'));var squel=require(_0x4314('0xc'));var crypto=require(_0x4314('0xd'));var jsforce=require(_0x4314('0xe'));var deskjs=require(_0x4314('0xf'));var toCsv=require(_0x4314('0x8'));var querystring=require(_0x4314('0x10'));var Papa=require(_0x4314('0x11'));var Redis=require(_0x4314('0x12'));var authService=require(_0x4314('0x13'));var qs=require(_0x4314('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4314('0x15'))('api');var utils=require(_0x4314('0x16'));var config=require(_0x4314('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4314('0x18'))['db'];config[_0x4314('0x19')]=_[_0x4314('0x1a')](config['redis'],{'host':_0x4314('0x1b'),'port':0x18eb});var socket=require(_0x4314('0x1c'))(new Redis(config['redis']));require(_0x4314('0x1d'))[_0x4314('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4314('0x1f')][_0x4314('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2a84f8,_0x2d1105,_0x7ab1b9,_0x11da06){return new BPromise(function(_0x543c5d,_0x4cbffd){var _0x57c116=_0x11da06||client;return _0x57c116[_0x4314('0x21')](_0x2a84f8,_0x7ab1b9)[_0x4314('0x22')](function(_0x2b2338){logger['info'](_0x4314('0x23'),_0x2d1105,'request\x20sent');logger[_0x4314('0x24')](_0x4314('0x25'),_0x2d1105,_0x4314('0x26'),JSON[_0x4314('0x27')](_0x2b2338));if(_0x2b2338[_0x4314('0x28')]){if(_0x2b2338[_0x4314('0x28')][_0x4314('0x29')]===0x1f4){logger['error'](_0x4314('0x23'),_0x2d1105,_0x2b2338[_0x4314('0x28')][_0x4314('0x2a')]);return _0x4cbffd(_0x2b2338[_0x4314('0x28')][_0x4314('0x2a')]);}logger[_0x4314('0x28')](_0x4314('0x23'),_0x2d1105,_0x2b2338['error'][_0x4314('0x2a')]);return _0x543c5d(_0x2b2338['error'][_0x4314('0x2a')]);}else{logger[_0x4314('0x2b')](_0x4314('0x23'),_0x2d1105,_0x4314('0x26'));_0x543c5d(_0x2b2338['result'][_0x4314('0x2a')]);}})[_0x4314('0x2c')](function(_0x40e5cf){logger[_0x4314('0x28')](_0x4314('0x23'),_0x2d1105,_0x40e5cf);_0x4cbffd(_0x40e5cf);});});}function respondWithStatusCode(_0x1eb491,_0xe0f212){_0xe0f212=_0xe0f212||0xcc;return function(_0x51bac9){if(_0x51bac9){return _0x1eb491[_0x4314('0x2d')](_0xe0f212);}return _0x1eb491[_0x4314('0x2e')](_0xe0f212)[_0x4314('0x2f')]();};}function respondWithResult(_0x23cf0c,_0x3c0a29){_0x3c0a29=_0x3c0a29||0xc8;return function(_0x6c1ae2){if(_0x6c1ae2){return _0x23cf0c[_0x4314('0x2e')](_0x3c0a29)[_0x4314('0x30')](_0x6c1ae2);}};}function respondWithFilteredResult(_0x101906,_0x1e9bd){return function(_0x124e72){if(_0x124e72){var _0x2c00b2=typeof _0x1e9bd[_0x4314('0x31')]==='undefined'&&typeof _0x1e9bd[_0x4314('0x32')]==='undefined';var _0x2dd721=_0x124e72[_0x4314('0x33')];var _0x4ac5c3=_0x2c00b2?0x0:_0x1e9bd[_0x4314('0x31')];var _0x979c24=_0x2c00b2?_0x124e72[_0x4314('0x33')]:_0x1e9bd[_0x4314('0x31')]+_0x1e9bd[_0x4314('0x32')];var _0x3f565a;if(_0x979c24>=_0x2dd721){_0x979c24=_0x2dd721;_0x3f565a=0xc8;}else{_0x3f565a=0xce;}_0x101906[_0x4314('0x2e')](_0x3f565a);return _0x101906[_0x4314('0x34')](_0x4314('0x35'),_0x4ac5c3+'-'+_0x979c24+'/'+_0x2dd721)[_0x4314('0x30')](_0x124e72);}return null;};}function patchUpdates(_0x5a8012){return function(_0xf05d66){try{jsonpatch[_0x4314('0x36')](_0xf05d66,_0x5a8012,!![]);}catch(_0x3b3ea0){return BPromise[_0x4314('0x37')](_0x3b3ea0);}return _0xf05d66[_0x4314('0x38')]();};}function saveUpdates(_0x218e0d,_0x3fa150){return function(_0x5a14b9){if(_0x5a14b9){return _0x5a14b9[_0x4314('0x39')](_0x218e0d)[_0x4314('0x22')](function(_0x9b6c32){return _0x9b6c32;});}return null;};}function removeEntity(_0x38a1db,_0x42a09a){return function(_0x177fc5){if(_0x177fc5){return _0x177fc5[_0x4314('0x3a')]()[_0x4314('0x22')](function(){var _0x2dff2f=_0x177fc5[_0x4314('0x3b')]({'plain':!![]});var _0x53fe65=_0x4314('0x3c');return db[_0x4314('0x3d')]['destroy']({'where':{'type':_0x53fe65,'resourceId':_0x2dff2f['id']}})['then'](function(){return _0x177fc5;});})[_0x4314('0x22')](function(){_0x38a1db[_0x4314('0x2e')](0xcc)[_0x4314('0x2f')]();});}};}function handleEntityNotFound(_0x5f4e05,_0xe2072c){return function(_0x48186c){if(!_0x48186c){_0x5f4e05[_0x4314('0x2d')](0x194);}return _0x48186c;};}function handleError(_0x57c77b,_0x4078d8){_0x4078d8=_0x4078d8||0x1f4;return function(_0x2287aa){logger[_0x4314('0x28')](_0x2287aa['stack']);if(_0x2287aa['name']){delete _0x2287aa[_0x4314('0x3e')];}_0x57c77b['status'](_0x4078d8)[_0x4314('0x3f')](_0x2287aa);};}exports[_0x4314('0x40')]=function(_0x49ec07,_0x5d77cb){var _0x8f7374={'include':[{'model':db[_0x4314('0x41')],'as':_0x4314('0x42')}]},_0x4cf92f={},_0x1f82c4={'count':0x0,'rows':[]};var _0x2833fc=_[_0x4314('0x43')](db['WhatsappAccount'][_0x4314('0x44')],function(_0x44134e){return{'name':_0x44134e[_0x4314('0x45')],'type':_0x44134e[_0x4314('0x46')][_0x4314('0x47')]};});_0x4cf92f[_0x4314('0x48')]=_[_0x4314('0x43')](_0x2833fc,_0x4314('0x3e'));_0x4cf92f[_0x4314('0x49')]=_[_0x4314('0x4a')](_0x49ec07['query']);_0x4cf92f[_0x4314('0x4b')]=_[_0x4314('0x4c')](_0x4cf92f[_0x4314('0x48')],_0x4cf92f[_0x4314('0x49')]);_0x8f7374[_0x4314('0x4d')]=_[_0x4314('0x4c')](_0x4cf92f[_0x4314('0x48')],qs[_0x4314('0x4e')](_0x49ec07[_0x4314('0x49')][_0x4314('0x4e')]));_0x8f7374[_0x4314('0x4d')]=_0x8f7374[_0x4314('0x4d')][_0x4314('0x4f')]?_0x8f7374[_0x4314('0x4d')]:_0x4cf92f[_0x4314('0x48')];if(!_0x49ec07['query'][_0x4314('0x50')](_0x4314('0x51'))){_0x8f7374[_0x4314('0x32')]=qs[_0x4314('0x32')](_0x49ec07[_0x4314('0x49')]['limit']);_0x8f7374[_0x4314('0x31')]=qs[_0x4314('0x31')](_0x49ec07[_0x4314('0x49')][_0x4314('0x31')]);}_0x8f7374[_0x4314('0x52')]=qs[_0x4314('0x53')](_0x49ec07[_0x4314('0x49')][_0x4314('0x53')]);_0x8f7374[_0x4314('0x54')]=qs['filters'](_[_0x4314('0x55')](_0x49ec07[_0x4314('0x49')],_0x4cf92f[_0x4314('0x4b')]),_0x2833fc);if(_0x49ec07[_0x4314('0x49')][_0x4314('0x56')]){_0x8f7374[_0x4314('0x54')]=_[_0x4314('0x57')](_0x8f7374[_0x4314('0x54')],{'$or':_[_0x4314('0x43')](_0x2833fc,function(_0x5574ac){if(_0x5574ac[_0x4314('0x46')]!==_0x4314('0x58')){var _0x124531={};_0x124531[_0x5574ac[_0x4314('0x3e')]]={'$like':'%'+_0x49ec07['query'][_0x4314('0x56')]+'%'};return _0x124531;}})});}_0x8f7374=_[_0x4314('0x57')]({},_0x8f7374,_0x49ec07['options']);var _0x24e389={'where':_0x8f7374['where']};return db['WhatsappAccount'][_0x4314('0x33')](_0x24e389)['then'](function(_0x7fdfa4){_0x1f82c4[_0x4314('0x33')]=_0x7fdfa4;if(_0x49ec07['query'][_0x4314('0x59')]){_0x8f7374['include']=[{'all':!![]}];}return db[_0x4314('0x5a')][_0x4314('0x5b')](_0x8f7374);})[_0x4314('0x22')](function(_0x114a4a){_0x1f82c4[_0x4314('0x5c')]=_0x114a4a;return _0x1f82c4;})[_0x4314('0x22')](respondWithFilteredResult(_0x5d77cb,_0x8f7374))['catch'](handleError(_0x5d77cb,null));};exports['show']=function(_0x3ea64b,_0x4fd67d){var _0x5d33e2={'raw':![],'where':{'id':_0x3ea64b[_0x4314('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x4314('0x42')}]},_0x3b857c={};_0x3b857c[_0x4314('0x48')]=_['keys'](db[_0x4314('0x5a')][_0x4314('0x44')]);_0x3b857c[_0x4314('0x49')]=_['keys'](_0x3ea64b[_0x4314('0x49')]);_0x3b857c[_0x4314('0x4b')]=_[_0x4314('0x4c')](_0x3b857c[_0x4314('0x48')],_0x3b857c[_0x4314('0x49')]);_0x5d33e2['attributes']=_[_0x4314('0x4c')](_0x3b857c[_0x4314('0x48')],qs[_0x4314('0x4e')](_0x3ea64b[_0x4314('0x49')]['fields']));_0x5d33e2[_0x4314('0x4d')]=_0x5d33e2[_0x4314('0x4d')][_0x4314('0x4f')]?_0x5d33e2[_0x4314('0x4d')]:_0x3b857c[_0x4314('0x48')];if(_0x3ea64b[_0x4314('0x49')][_0x4314('0x59')]){_0x5d33e2[_0x4314('0x5e')]=[{'all':!![]}];}_0x5d33e2=_['merge']({},_0x5d33e2,_0x3ea64b[_0x4314('0x5f')]);return db[_0x4314('0x5a')][_0x4314('0x60')](_0x5d33e2)[_0x4314('0x22')](handleEntityNotFound(_0x4fd67d,null))[_0x4314('0x22')](respondWithResult(_0x4fd67d,null))[_0x4314('0x2c')](handleError(_0x4fd67d,null));};exports[_0x4314('0x61')]=function(_0x33d006,_0x1ecd11){return db['WhatsappAccount'][_0x4314('0x61')](_0x33d006[_0x4314('0x62')],{})[_0x4314('0x22')](function(_0x2a9b64){var _0x8d34bf=_0x33d006['user']['get']({'plain':!![]});if(!_0x8d34bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8d34bf[_0x4314('0x63')]===_0x4314('0x64')){var _0x13c7ea=_0x2a9b64['get']({'plain':!![]});var _0x5b0135=_0x4314('0x3c');return db['UserProfileSection'][_0x4314('0x60')]({'where':{'name':_0x5b0135,'userProfileId':_0x8d34bf['userProfileId']},'raw':!![]})['then'](function(_0x4075b1){if(_0x4075b1&&_0x4075b1[_0x4314('0x65')]===0x0){return db[_0x4314('0x3d')][_0x4314('0x61')]({'name':_0x13c7ea['name'],'resourceId':_0x13c7ea['id'],'type':_0x4075b1[_0x4314('0x3e')],'sectionId':_0x4075b1['id']},{})['then'](function(){return _0x2a9b64;});}else{return _0x2a9b64;}})[_0x4314('0x2c')](function(_0x4cdb11){logger[_0x4314('0x28')](_0x4314('0x66'),_0x4cdb11);throw _0x4cdb11;});}return _0x2a9b64;})['then'](respondWithResult(_0x1ecd11,0xc9))[_0x4314('0x2c')](handleError(_0x1ecd11,null));};exports[_0x4314('0x39')]=function(_0x13195f,_0xf2322e){if(_0x13195f['body']['id']){delete _0x13195f[_0x4314('0x62')]['id'];}return db[_0x4314('0x5a')][_0x4314('0x60')]({'where':{'id':_0x13195f[_0x4314('0x5d')]['id']},'include':[{'model':db[_0x4314('0x41')],'as':_0x4314('0x42')}]})[_0x4314('0x22')](handleEntityNotFound(_0xf2322e,null))[_0x4314('0x22')](saveUpdates(_0x13195f[_0x4314('0x62')],null))['then'](respondWithResult(_0xf2322e,null))[_0x4314('0x2c')](handleError(_0xf2322e,null));};exports[_0x4314('0x3a')]=function(_0x3f2567,_0xac92b5){return db['WhatsappAccount'][_0x4314('0x60')]({'where':{'id':_0x3f2567['params']['id']}})[_0x4314('0x22')](handleEntityNotFound(_0xac92b5,null))[_0x4314('0x22')](removeEntity(_0xac92b5,null))[_0x4314('0x2c')](handleError(_0xac92b5,null));};exports['describe']=function(_0x54ea77,_0xeb810b){return db[_0x4314('0x5a')]['describe']()['then'](respondWithResult(_0xeb810b,null))[_0x4314('0x2c')](handleError(_0xeb810b,null));};exports['addDisposition']=function(_0x1aaefe,_0x1aac9c,_0x14a804){if(_0x1aaefe[_0x4314('0x62')]['id']){delete _0x1aaefe[_0x4314('0x62')]['id'];}return db['WhatsappAccount'][_0x4314('0x60')]({'where':{'id':_0x1aaefe[_0x4314('0x5d')]['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x1aac9c,null))['then'](function(_0x32b13c){if(_0x32b13c){_0x1aaefe['body'][_0x4314('0x67')]=_0x32b13c['id'];return db[_0x4314('0x68')][_0x4314('0x61')](_0x1aaefe[_0x4314('0x62')]);}})['then'](respondWithResult(_0x1aac9c,null))[_0x4314('0x2c')](handleError(_0x1aac9c,null));};exports['getDispositions']=function(_0x1ecf89,_0x2bb7d3,_0x23749f){var _0x1aecb1={'raw':![],'where':{}};var _0x36cfdb={};var _0x3a97fc={'count':0x0,'rows':[]};return db[_0x4314('0x5a')][_0x4314('0x69')]({'where':{'id':_0x1ecf89[_0x4314('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2bb7d3,null))[_0x4314('0x22')](function(_0x4ee5a9){if(_0x4ee5a9){_0x36cfdb[_0x4314('0x48')]=_[_0x4314('0x4a')](db[_0x4314('0x68')][_0x4314('0x44')]);_0x36cfdb[_0x4314('0x49')]=_['keys'](_0x1ecf89['query']);_0x36cfdb[_0x4314('0x4b')]=_[_0x4314('0x4c')](_0x36cfdb[_0x4314('0x48')],_0x36cfdb['query']);_0x1aecb1[_0x4314('0x4d')]=_[_0x4314('0x4c')](_0x36cfdb[_0x4314('0x48')],qs[_0x4314('0x4e')](_0x1ecf89['query'][_0x4314('0x4e')]));_0x1aecb1[_0x4314('0x4d')]=_0x1aecb1[_0x4314('0x4d')][_0x4314('0x4f')]?_0x1aecb1['attributes']:_0x36cfdb['model'];if(!_0x1ecf89['query'][_0x4314('0x50')](_0x4314('0x51'))){_0x1aecb1[_0x4314('0x32')]=qs[_0x4314('0x32')](_0x1ecf89[_0x4314('0x49')][_0x4314('0x32')]);_0x1aecb1[_0x4314('0x31')]=qs[_0x4314('0x31')](_0x1ecf89['query']['offset']);}_0x1aecb1[_0x4314('0x52')]=qs['sort'](_0x1ecf89[_0x4314('0x49')][_0x4314('0x53')]);_0x1aecb1[_0x4314('0x54')]=qs['filters'](_[_0x4314('0x55')](_0x1ecf89[_0x4314('0x49')],_0x36cfdb[_0x4314('0x4b')]));_0x1aecb1['where'][_0x4314('0x67')]=_0x4ee5a9['id'];if(_0x1ecf89[_0x4314('0x49')][_0x4314('0x56')]){_0x1aecb1[_0x4314('0x54')]=_[_0x4314('0x57')](_0x1aecb1[_0x4314('0x54')],{'$or':_[_0x4314('0x43')](_0x1aecb1['attributes'],function(_0x68567c){var _0x53eadc={};_0x53eadc[_0x68567c]={'$like':'%'+_0x1ecf89[_0x4314('0x49')][_0x4314('0x56')]+'%'};return _0x53eadc;})});}_0x1aecb1=_[_0x4314('0x57')]({},_0x1aecb1,_0x1ecf89['options']);return db[_0x4314('0x68')]['count']({'where':_0x1aecb1[_0x4314('0x54')]})[_0x4314('0x22')](function(_0x10314f){_0x3a97fc[_0x4314('0x33')]=_0x10314f;if(_0x1ecf89[_0x4314('0x49')][_0x4314('0x59')]){_0x1aecb1[_0x4314('0x5e')]=[{'all':!![]}];}return db['Disposition'][_0x4314('0x5b')](_0x1aecb1);})[_0x4314('0x22')](function(_0x54d34c){_0x3a97fc[_0x4314('0x5c')]=_0x54d34c;return _0x3a97fc;});}})['then'](respondWithFilteredResult(_0x2bb7d3,_0x1aecb1))[_0x4314('0x2c')](handleError(_0x2bb7d3,null));};exports[_0x4314('0x6a')]=function(_0x2dd71c,_0x234ac9,_0x229511){return db[_0x4314('0x5a')][_0x4314('0x60')]({'where':{'id':_0x2dd71c[_0x4314('0x5d')]['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x234ac9,null))[_0x4314('0x22')](function(_0x51a0b8){if(_0x51a0b8){return _0x51a0b8[_0x4314('0x6a')](_0x2dd71c['query'][_0x4314('0x6b')]);}})['then'](respondWithStatusCode(_0x234ac9,null))[_0x4314('0x2c')](handleError(_0x234ac9,null));};exports[_0x4314('0x6c')]=function(_0x2c26f7,_0x5d75e6,_0x3bc718){if(_0x2c26f7[_0x4314('0x62')]['id']){delete _0x2c26f7[_0x4314('0x62')]['id'];}return db[_0x4314('0x5a')][_0x4314('0x60')]({'where':{'id':_0x2c26f7['params']['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x5d75e6,null))[_0x4314('0x22')](function(_0xb8bf40){if(_0xb8bf40){_0x2c26f7[_0x4314('0x62')][_0x4314('0x67')]=_0xb8bf40['id'];return db[_0x4314('0x6d')]['create'](_0x2c26f7['body']);}})[_0x4314('0x22')](respondWithResult(_0x5d75e6,null))[_0x4314('0x2c')](handleError(_0x5d75e6,null));};exports['getAnswers']=function(_0x1c9c81,_0x160cda,_0x2d9eeb){var _0x48edef={'raw':![],'where':{}};var _0x1004eb={};var _0x211628={'count':0x0,'rows':[]};return db[_0x4314('0x5a')]['findOne']({'where':{'id':_0x1c9c81['params']['id']}})['then'](handleEntityNotFound(_0x160cda,null))[_0x4314('0x22')](function(_0x4e79c7){if(_0x4e79c7){_0x1004eb[_0x4314('0x48')]=_[_0x4314('0x4a')](db[_0x4314('0x6d')][_0x4314('0x44')]);_0x1004eb[_0x4314('0x49')]=_['keys'](_0x1c9c81[_0x4314('0x49')]);_0x1004eb[_0x4314('0x4b')]=_[_0x4314('0x4c')](_0x1004eb[_0x4314('0x48')],_0x1004eb['query']);_0x48edef['attributes']=_['intersection'](_0x1004eb[_0x4314('0x48')],qs['fields'](_0x1c9c81[_0x4314('0x49')][_0x4314('0x4e')]));_0x48edef[_0x4314('0x4d')]=_0x48edef[_0x4314('0x4d')][_0x4314('0x4f')]?_0x48edef[_0x4314('0x4d')]:_0x1004eb[_0x4314('0x48')];if(!_0x1c9c81['query'][_0x4314('0x50')]('nolimit')){_0x48edef[_0x4314('0x32')]=qs[_0x4314('0x32')](_0x1c9c81[_0x4314('0x49')][_0x4314('0x32')]);_0x48edef['offset']=qs[_0x4314('0x31')](_0x1c9c81[_0x4314('0x49')][_0x4314('0x31')]);}_0x48edef[_0x4314('0x52')]=qs[_0x4314('0x53')](_0x1c9c81[_0x4314('0x49')][_0x4314('0x53')]);_0x48edef[_0x4314('0x54')]=qs['filters'](_[_0x4314('0x55')](_0x1c9c81['query'],_0x1004eb[_0x4314('0x4b')]));_0x48edef['where'][_0x4314('0x67')]=_0x4e79c7['id'];if(_0x1c9c81[_0x4314('0x49')]['filter']){_0x48edef[_0x4314('0x54')]=_[_0x4314('0x57')](_0x48edef[_0x4314('0x54')],{'$or':_[_0x4314('0x43')](_0x48edef[_0x4314('0x4d')],function(_0x19b823){var _0x402845={};_0x402845[_0x19b823]={'$like':'%'+_0x1c9c81[_0x4314('0x49')][_0x4314('0x56')]+'%'};return _0x402845;})});}_0x48edef=_['merge']({},_0x48edef,_0x1c9c81[_0x4314('0x5f')]);return db[_0x4314('0x6d')][_0x4314('0x33')]({'where':_0x48edef[_0x4314('0x54')]})['then'](function(_0x1fd261){_0x211628[_0x4314('0x33')]=_0x1fd261;if(_0x1c9c81[_0x4314('0x49')][_0x4314('0x59')]){_0x48edef[_0x4314('0x5e')]=[{'all':!![]}];}return db[_0x4314('0x6d')][_0x4314('0x5b')](_0x48edef);})[_0x4314('0x22')](function(_0x190941){_0x211628['rows']=_0x190941;return _0x211628;});}})[_0x4314('0x22')](respondWithFilteredResult(_0x160cda,_0x48edef))['catch'](handleError(_0x160cda,null));};exports[_0x4314('0x6e')]=function(_0x29c02c,_0x480334,_0x1b7192){return db['WhatsappAccount'][_0x4314('0x60')]({'where':{'id':_0x29c02c[_0x4314('0x5d')]['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x480334,null))[_0x4314('0x22')](function(_0x32ecdd){if(_0x32ecdd){return _0x32ecdd[_0x4314('0x6e')](_0x29c02c[_0x4314('0x49')]['ids']);}})[_0x4314('0x22')](respondWithStatusCode(_0x480334,null))[_0x4314('0x2c')](handleError(_0x480334,null));};exports[_0x4314('0x6f')]=function(_0x5e74ea,_0x5ab44a,_0x180884){return db[_0x4314('0x5a')][_0x4314('0x60')]({'where':{'id':_0x5e74ea['params']['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x5ab44a,null))[_0x4314('0x22')](function(_0x4f45e1){if(_0x4f45e1){return _0x4f45e1['addAgents'](_0x5e74ea[_0x4314('0x62')][_0x4314('0x6b')],_['omit'](_0x5e74ea[_0x4314('0x62')],[_0x4314('0x6b'),'id'])||{})[_0x4314('0x70')](function(_0x305341){for(var _0x5aefba=0x0;_0x5aefba<_0x5e74ea[_0x4314('0x62')][_0x4314('0x6b')][_0x4314('0x4f')];_0x5aefba+=0x1){socket[_0x4314('0x71')](_0x4314('0x72'),{'UserId':Number(_0x5e74ea[_0x4314('0x62')][_0x4314('0x6b')][_0x5aefba]),'WhatsappAccountId':Number(_0x5e74ea[_0x4314('0x5d')]['id'])});}return _0x305341;});}})[_0x4314('0x22')](respondWithResult(_0x5ab44a,null))[_0x4314('0x2c')](handleError(_0x5ab44a,null));};exports[_0x4314('0x73')]=function(_0x503f76,_0x222997,_0x113498){return db['WhatsappAccount'][_0x4314('0x60')]({'where':{'id':_0x503f76[_0x4314('0x5d')]['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x222997,null))[_0x4314('0x22')](function(_0x520a2b){if(_0x520a2b){return _0x520a2b['removeAgents'](_0x503f76['query'][_0x4314('0x6b')])['then'](function(){if(_['isArray'](_0x503f76[_0x4314('0x49')][_0x4314('0x6b')])){for(var _0x57d8a3=0x0;_0x57d8a3<_0x503f76[_0x4314('0x49')][_0x4314('0x6b')][_0x4314('0x4f')];_0x57d8a3+=0x1){socket[_0x4314('0x71')](_0x4314('0x74'),{'UserId':Number(_0x503f76[_0x4314('0x49')]['ids'][_0x57d8a3]),'WhatsappAccountId':Number(_0x503f76[_0x4314('0x5d')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x503f76['query']['ids']),'WhatsappAccountId':Number(_0x503f76[_0x4314('0x5d')]['id'])});}});}})[_0x4314('0x22')](respondWithStatusCode(_0x222997,null))[_0x4314('0x2c')](handleError(_0x222997,null));};exports[_0x4314('0x75')]=function(_0x2b42b1,_0x1612b6,_0x29eb17){var _0x4e0dfc={};var _0x515744={};var _0x1d8758;var _0x9dd4e4;return db[_0x4314('0x5a')]['findOne']({'where':{'id':_0x2b42b1[_0x4314('0x5d')]['id']}})[_0x4314('0x22')](handleEntityNotFound(_0x1612b6,null))['then'](function(_0x1629ab){if(_0x1629ab){_0x1d8758=_0x1629ab;_0x515744[_0x4314('0x48')]=_[_0x4314('0x4a')](db['User'][_0x4314('0x44')]);_0x515744[_0x4314('0x49')]=_['keys'](_0x2b42b1[_0x4314('0x49')]);_0x515744['filters']=_[_0x4314('0x4c')](_0x515744[_0x4314('0x48')],_0x515744[_0x4314('0x49')]);_0x4e0dfc['attributes']=_[_0x4314('0x4c')](_0x515744[_0x4314('0x48')],qs[_0x4314('0x4e')](_0x2b42b1['query'][_0x4314('0x4e')]));_0x4e0dfc['attributes']=_0x4e0dfc[_0x4314('0x4d')][_0x4314('0x4f')]?_0x4e0dfc[_0x4314('0x4d')]:_0x515744[_0x4314('0x48')];_0x4e0dfc['order']=qs['sort'](_0x2b42b1[_0x4314('0x49')][_0x4314('0x53')]);_0x4e0dfc[_0x4314('0x54')]=qs[_0x4314('0x4b')](_[_0x4314('0x55')](_0x2b42b1[_0x4314('0x49')],_0x515744[_0x4314('0x4b')]));if(_0x2b42b1['query']['filter']){_0x4e0dfc[_0x4314('0x54')]=_[_0x4314('0x57')](_0x4e0dfc[_0x4314('0x54')],{'$or':_[_0x4314('0x43')](_0x4e0dfc['attributes'],function(_0x30f5db){var _0x35fb45={};_0x35fb45[_0x30f5db]={'$like':'%'+_0x2b42b1[_0x4314('0x49')][_0x4314('0x56')]+'%'};return _0x35fb45;})});}_0x4e0dfc=_[_0x4314('0x57')]({},_0x4e0dfc,_0x2b42b1[_0x4314('0x5f')]);return _0x1d8758[_0x4314('0x75')](_0x4e0dfc);}})[_0x4314('0x22')](function(_0x47e1cc){if(_0x47e1cc){_0x9dd4e4=_0x47e1cc[_0x4314('0x4f')];if(!_0x2b42b1[_0x4314('0x49')]['hasOwnProperty']('nolimit')){_0x4e0dfc['limit']=qs[_0x4314('0x32')](_0x2b42b1[_0x4314('0x49')][_0x4314('0x32')]);_0x4e0dfc[_0x4314('0x31')]=qs[_0x4314('0x31')](_0x2b42b1[_0x4314('0x49')][_0x4314('0x31')]);}return _0x1d8758[_0x4314('0x75')](_0x4e0dfc);}})['then'](function(_0x55bd44){if(_0x55bd44){return _0x55bd44?{'count':_0x9dd4e4,'rows':_0x55bd44}:null;}})[_0x4314('0x22')](respondWithResult(_0x1612b6,null))['catch'](handleError(_0x1612b6,null));};exports[_0x4314('0x76')]=function(_0x41fd37,_0x42aa7b){var _0x2c2dde=_0x41fd37[_0x4314('0x5d')]['id'];var _0x528912=_0x41fd37[_0x4314('0x62')];var _0x37bb7c=0xc8;var _0x3725ae=null;return db[_0x4314('0x77')][_0x4314('0x78')]({'isolationLevel':db[_0x4314('0x77')][_0x4314('0x79')]['ISOLATION_LEVELS'][_0x4314('0x7a')]},function(_0x2094f7){return db[_0x4314('0x5a')]['findOne']({'where':{'id':_0x2c2dde},'transaction':_0x2094f7})['then'](function(_0x2aff66){if(_0x2aff66){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x2c2dde},'transaction':_0x2094f7})[_0x4314('0x22')](function(){var _0x114729=_[_0x4314('0x43')](_0x528912,function(_0x2bb501){_0x2bb501[_0x4314('0x67')]=_0x2c2dde;return _0x2bb501;});return db['WhatsappApplication'][_0x4314('0x7b')](_0x114729,{'transaction':_0x2094f7});});}else{_0x37bb7c=0x194;_0x3725ae=[];}});})['then'](function(){if(_0x37bb7c!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x2c2dde},'order':_0x4314('0x7c')})[_0x4314('0x22')](function(_0x419ce4){_0x3725ae=_0x419ce4;});}})[_0x4314('0x2c')](function(_0x120309){_0x37bb7c=0x1f4;logger[_0x4314('0x28')](_0x120309[_0x4314('0x7d')]);if(_0x120309[_0x4314('0x3e')]){delete _0x120309['name'];}_0x3725ae=_0x120309;})[_0x4314('0x7e')](function(){if(_0x3725ae===null){_0x42aa7b[_0x4314('0x2d')](_0x37bb7c);}else{if(_0x37bb7c===0x1f4){_0x42aa7b['status'](_0x37bb7c)[_0x4314('0x3f')](_0x3725ae);}else{_0x42aa7b['status'](_0x37bb7c)[_0x4314('0x30')](_0x3725ae);}}});};exports['getApplications']=function(_0x38505a,_0x4c663e,_0xf0cc88){var _0x3f9132={};var _0x92af99={};var _0x3b6ccb;var _0x19cdbe;return db['WhatsappAccount'][_0x4314('0x69')]({'where':{'id':_0x38505a[_0x4314('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4c663e,null))[_0x4314('0x22')](function(_0x14f012){if(_0x14f012){_0x3b6ccb=_0x14f012;_0x92af99['model']=_[_0x4314('0x4a')](db[_0x4314('0x7f')]['rawAttributes']);_0x92af99['query']=_['keys'](_0x38505a['query']);_0x92af99[_0x4314('0x4b')]=_[_0x4314('0x4c')](_0x92af99[_0x4314('0x48')],_0x92af99['query']);_0x3f9132['attributes']=_[_0x4314('0x4c')](_0x92af99[_0x4314('0x48')],qs[_0x4314('0x4e')](_0x38505a[_0x4314('0x49')]['fields']));_0x3f9132[_0x4314('0x4d')]=_0x3f9132[_0x4314('0x4d')][_0x4314('0x4f')]?_0x3f9132[_0x4314('0x4d')]:_0x92af99[_0x4314('0x48')];_0x3f9132[_0x4314('0x52')]=qs[_0x4314('0x53')](_0x38505a[_0x4314('0x49')][_0x4314('0x53')]);_0x3f9132[_0x4314('0x54')]=qs[_0x4314('0x4b')](_[_0x4314('0x55')](_0x38505a[_0x4314('0x49')],_0x92af99[_0x4314('0x4b')]));if(_0x38505a[_0x4314('0x49')]['filter']){_0x3f9132[_0x4314('0x54')]=_[_0x4314('0x57')](_0x3f9132[_0x4314('0x54')],{'$or':_[_0x4314('0x43')](_0x3f9132['attributes'],function(_0x175e5b){var _0x4efeb7={};_0x4efeb7[_0x175e5b]={'$like':'%'+_0x38505a['query'][_0x4314('0x56')]+'%'};return _0x4efeb7;})});}_0x3f9132=_['merge']({},_0x3f9132,_0x38505a[_0x4314('0x5f')]);return _0x3b6ccb[_0x4314('0x80')](_0x3f9132);}})[_0x4314('0x22')](function(_0x55075f){if(_0x55075f){_0x19cdbe=_0x55075f[_0x4314('0x4f')];if(!_0x38505a[_0x4314('0x49')][_0x4314('0x50')](_0x4314('0x51'))){_0x3f9132[_0x4314('0x32')]=qs[_0x4314('0x32')](_0x38505a[_0x4314('0x49')][_0x4314('0x32')]);_0x3f9132[_0x4314('0x31')]=qs['offset'](_0x38505a[_0x4314('0x49')][_0x4314('0x31')]);}return _0x3b6ccb[_0x4314('0x80')](_0x3f9132);}})[_0x4314('0x22')](function(_0xa908b2){if(_0xa908b2){return _0xa908b2?{'count':_0x19cdbe,'rows':_0xa908b2}:null;}})[_0x4314('0x22')](respondWithResult(_0x4c663e,null))[_0x4314('0x2c')](handleError(_0x4c663e,null));};exports['notify']=function(_0x467660,_0x3da102,_0x1595cc){var _0x5eef72={'channel':'whatsapp'};var _0x50d922=[];var _0xe23500=[];var _0x39c5a3={};return db[_0x4314('0x5a')][_0x4314('0x60')]({'where':{'id':_0x467660[_0x4314('0x5d')]['id']},'include':[{'model':db[_0x4314('0x7f')],'as':_0x4314('0x81')}]})[_0x4314('0x22')](handleEntityNotFound(_0x3da102,null))[_0x4314('0x22')](function(_0x234de9){_0x5eef72['account']=_0x234de9;if(_0x5eef72['account']&&_0x5eef72[_0x4314('0x82')]['type']==='sinch'&&_0x467660[_0x4314('0x62')][_0x4314('0x83')]){if(_0x467660[_0x4314('0x62')][_0x4314('0x83')][_0x4314('0x4f')]===0x0)return;if(_0x467660['body'][_0x4314('0x83')][0x0][_0x4314('0x84')]!==_0x4314('0x85'))return;return db[_0x4314('0x86')]['update']({'read':!![],'readAt':_0x467660[_0x4314('0x62')][_0x4314('0x83')][0x0][_0x4314('0x87')]},{'where':{'messageId':_0x467660[_0x4314('0x62')]['statuses'][0x0][_0x4314('0x88')]},'individualHooks':!![]})['then'](function(_0x40a2a6){return _0x3da102[_0x4314('0x2e')](0xc8)[_0x4314('0x30')](_0x40a2a6);});}_0x5eef72[_0x4314('0x89')]=_[_0x4314('0x8a')](_0x234de9['Applications'],['priority'],[_0x4314('0x8b')]);if(_0x5eef72[_0x4314('0x82')]['Applications']){delete _0x5eef72[_0x4314('0x82')][_0x4314('0x81')];}return db[_0x4314('0x8c')][_0x4314('0x8d')]()[_0x4314('0x22')](function(_0x10cdc8){if(!_0x10cdc8){throw new db[(_0x4314('0x8e'))]['ValidationError'](_0x4314('0x8f'));}_0x50d922=_[_0x4314('0x90')](_[_0x4314('0x4a')](_0x10cdc8),[_0x4314('0x91'),_0x4314('0x92')]);_0xe23500=_[_0x4314('0x90')](_[_0x4314('0x4a')](_0x10cdc8),[_0x4314('0x91'),_0x4314('0x92'),_0x4314('0x93'),'ListId']);_0x5eef72[_0x4314('0x62')]={'mapKey':'mobile'};if(_0x5eef72[_0x4314('0x82')]&&_0x5eef72[_0x4314('0x82')][_0x4314('0x46')]===_0x4314('0x94')){_0x5eef72[_0x4314('0x62')][_0x4314('0x95')]=_0x467660[_0x4314('0x62')][_0x4314('0x96')][_0x4314('0x97')](_0x4314('0x98'),'');_0x5eef72['body'][_0x4314('0x62')]=_0x467660[_0x4314('0x62')][_0x4314('0x99')];_0x5eef72['body']['messageId']=_0x467660[_0x4314('0x62')]['MessageSid'];}if(_0x5eef72['account']&&_0x5eef72[_0x4314('0x82')][_0x4314('0x46')]===_0x4314('0x9a')){_0x5eef72['body'][_0x4314('0x95')]=_0x467660[_0x4314('0x62')][_0x4314('0x9b')][0x0][_0x4314('0x95')];_0x5eef72[_0x4314('0x62')][_0x4314('0x62')]=_0x467660[_0x4314('0x62')][_0x4314('0x9b')][0x0][_0x4314('0x2a')]['body'];_0x5eef72['body'][_0x4314('0x9c')]=_0x467660['body'][_0x4314('0x9b')][0x0][_0x4314('0x88')];}if(_0x5eef72['body']['id']){delete _0x5eef72[_0x4314('0x62')]['id'];}if(_[_0x4314('0x9d')](_0x5eef72[_0x4314('0x62')][_0x4314('0x95')])){throw new db[(_0x4314('0x8e'))]['ValidationError'](_0x4314('0x9e'));}if(_[_0x4314('0x9d')](_0x5eef72[_0x4314('0x62')][_0x4314('0x62')])||_0x5eef72['body'][_0x4314('0x62')]===''){throw new db[(_0x4314('0x8e'))]['ValidationError'](_0x4314('0x9f'));}if(_[_0x4314('0x9d')](_0x5eef72[_0x4314('0x62')]['mapKey'])){throw new db['Sequelize'][(_0x4314('0xa0'))](_0x4314('0xa1')+_0xe23500);}if(!_['includes'](_0xe23500,_0x5eef72[_0x4314('0x62')][_0x4314('0xa2')])){throw new db[(_0x4314('0x8e'))][(_0x4314('0xa0'))](_0x4314('0xa3')+_0xe23500);}_0x39c5a3[_0x5eef72['body'][_0x4314('0xa2')]]=_0x5eef72[_0x4314('0x62')][_0x4314('0x95')];return db[_0x4314('0xa4')][_0x4314('0x60')]({'where':{'id':_0x5eef72[_0x4314('0x82')][_0x4314('0xa5')]},'include':[{'model':db[_0x4314('0x8c')],'as':_0x4314('0xa6'),'where':_0x39c5a3,'limit':0x1,'order':[['updatedAt',_0x4314('0xa7')]]}]});})[_0x4314('0x22')](handleEntityNotFound(_0x3da102,null))[_0x4314('0x22')](function(_0x2feba5){if(_0x2feba5){_0x5eef72['list']=_[_0x4314('0xa8')](_0x2feba5,[_0x4314('0xa6')]);if(_0x2feba5[_0x4314('0xa6')][_0x4314('0x4f')]){return _0x2feba5[_0x4314('0xa6')][0x0];}var _0x35a5f1=_['defaults'](_0x5eef72['body'],{'firstName':_0x5eef72[_0x4314('0x62')]['from'],'ListId':_0x2feba5['id']});_0x35a5f1[_0x5eef72[_0x4314('0x62')][_0x4314('0xa2')]]=_0x5eef72[_0x4314('0x62')][_0x4314('0x95')];return db[_0x4314('0x8c')][_0x4314('0x61')](_0x35a5f1,{'fields':_0x50d922,'raw':!![]});}})['then'](handleEntityNotFound(_0x3da102,null))[_0x4314('0x22')](function(_0x368f71){if(_0x368f71){_0x5eef72['contact']=_0x368f71;var _0x540cf2={'ContactId':_0x368f71['id'],'phone':_0x5eef72[_0x4314('0x62')]['from'],'WhatsappAccountId':_0x467660[_0x4314('0x5d')]['id']};var _0x8d1595={'ContactId':_0x368f71['id'],'WhatsappAccountId':_0x467660['params']['id'],'closed':![]};return db[_0x4314('0xa9')][_0x4314('0x60')]({'where':_0x8d1595})[_0x4314('0x22')](function(_0x13857c){if(_0x13857c){return[_0x13857c,![]];}return db[_0x4314('0xa9')][_0x4314('0x61')](_0x540cf2)['then'](function(_0x18a1e3){return[_0x18a1e3,!![]];});});}})[_0x4314('0x70')](function(_0x39f6ec,_0x395913){_0x5eef72[_0x4314('0xaa')]=_0x39f6ec[_0x4314('0x3b')]({'plain':!![]});_0x5eef72['interaction']['created']=![];if(_0x395913){if(_0x5eef72[_0x4314('0x82')][_0x4314('0xab')]){_0x5eef72['applications'][_0x4314('0xac')]({'id':0x0,'priority':_0x5eef72[_0x4314('0x89')]['length']+0x1,'app':_0x4314('0xad'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x5eef72[_0x4314('0xaa')][_0x4314('0xae')]=!![];}return db[_0x4314('0x86')][_0x4314('0x61')]({'phone':_0x5eef72[_0x4314('0x62')]['from'],'messageId':_0x5eef72[_0x4314('0x62')]['messageId'],'body':_0x5eef72['body'][_0x4314('0x62')],'WhatsappAccountId':_0x467660[_0x4314('0x5d')]['id'],'WhatsappInteractionId':_0x39f6ec['id'],'direction':'in','ContactId':_0x39f6ec[_0x4314('0xaf')],'AttachmentId':_0x5eef72[_0x4314('0x62')][_0x4314('0xb0')]});})[_0x4314('0x22')](function(_0xce858b){_0x5eef72[_0x4314('0x2a')]=_0xce858b;if(_0x5eef72[_0x4314('0xaa')][_0x4314('0xb1')]){return db[_0x4314('0xb2')][_0x4314('0x60')]({'attributes':['id',_0x4314('0x3e')],'where':{'id':_0x5eef72[_0x4314('0xaa')][_0x4314('0xb1')]}})['then'](function(_0x894e31){if(_0x894e31){_0x5eef72[_0x4314('0x89')][_0x4314('0xb3')]({'id':0x0,'priority':0x0,'app':_0x4314('0xb4'),'appdata':_0x894e31[_0x4314('0x3e')]+','+(_0x5eef72['account'][_0x4314('0xb5')]||0xa),'interval':_0x4314('0xb6')});}return respondWithRpcPromise(_0x4314('0xb7'),_0x4314('0xb8'),_0x5eef72);});}return respondWithRpcPromise('Start',_0x4314('0xb8'),_0x5eef72);})[_0x4314('0x22')](function(_0x2b1884){if(_0x2b1884){var _0x424535=0xc8;var _0x530a70=_0x4314('0xb9');logger['info'](_0x4314('0x25'),_0x530a70,_0x424535,_0x4314('0xba'));logger[_0x4314('0x24')](_0x4314('0xbb'),_0x530a70,_0x424535,_0x4314('0xba'),JSON[_0x4314('0x27')](_0x2b1884));if(_0x5eef72['account'][_0x4314('0x46')]===_0x4314('0x94')){return _0x3da102[_0x4314('0x2e')](_0x424535)[_0x4314('0x34')](_0x4314('0xbc'),_0x4314('0xbd'))[_0x4314('0x3f')](_0x4314('0xbe'));}else{return _0x3da102[_0x4314('0x2e')](_0x424535)[_0x4314('0x30')](_0x2b1884);}}});})['catch'](handleError(_0x3da102,null));};exports['send']=function(_0x22de06,_0x307da4,_0x18a591){var _0x2eab86,_0x5cd0ac,_0x362eb8;if(_['isNil'](_0x22de06[_0x4314('0x62')][_0x4314('0x62')])||_0x22de06['body'][_0x4314('0x62')]===''){throw new db['Sequelize']['ValidationError'](_0x4314('0x9f'));}if(_['isNil'](_0x22de06[_0x4314('0x62')]['to'])){throw new db[(_0x4314('0x8e'))][(_0x4314('0xa0'))](_0x4314('0xbf'));}_0x2eab86=_0x22de06[_0x4314('0x62')]['to'];return db['WhatsappAccount'][_0x4314('0x60')]({'where':{'id':_0x22de06[_0x4314('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4314('0x8c')],'as':_0x4314('0xa6'),'where':{'mobile':_0x2eab86},'limit':0x1,'order':[['updatedAt',_0x4314('0xa7')]]}]}]})[_0x4314('0x22')](handleEntityNotFound(_0x307da4,null))[_0x4314('0x22')](function(_0x258c07){if(_0x258c07&&_0x258c07[_0x4314('0xc0')]){_0x5cd0ac=_0x258c07[_0x4314('0x3b')]({'plain':!![]});if(_0x5cd0ac[_0x4314('0xc0')]&&_0x5cd0ac[_0x4314('0xc0')][_0x4314('0xa6')]['length']){return _0x5cd0ac[_0x4314('0xc0')][_0x4314('0xa6')][0x0];}return db['CmContact'][_0x4314('0x61')](_[_0x4314('0x1a')](_0x22de06[_0x4314('0x62')],{'firstName':_0x2eab86,'mobile':_0x2eab86,'phone':_0x2eab86,'ListId':_0x5cd0ac[_0x4314('0xa5')]}));}})[_0x4314('0x22')](handleEntityNotFound(_0x307da4,null))['then'](function(_0x3669bf){if(_0x3669bf){_0x362eb8=_0x3669bf;return db[_0x4314('0xa9')][_0x4314('0x60')]({'where':{'ContactId':_0x362eb8['id'],'closed':![],'WhatsappAccountId':_0x5cd0ac['id']}})[_0x4314('0x22')](function(_0x32c0e1){if(_0x32c0e1){return[_0x32c0e1,![]];}return db[_0x4314('0xa9')][_0x4314('0x61')]({'UserId':_0x22de06['user']['id'],'ContactId':_0x362eb8['id'],'WhatsappAccountId':_0x5cd0ac['id'],'phone':_0x2eab86,'firstMsgDirection':'out','Messages':[_[_0x4314('0x57')](_0x22de06[_0x4314('0x62')],{'read':![],'body':_0x22de06[_0x4314('0x62')][_0x4314('0x62')],'phone':_0x2eab86,'WhatsappAccountId':_0x5cd0ac['id'],'UserId':_0x22de06['user']['id'],'ContactId':_0x362eb8['id']})]},{'include':[{'model':db[_0x4314('0x86')],'as':'Messages'}]})['then'](function(_0x31ff77){return[_0x31ff77,!![]];});});}})[_0x4314('0x70')](function(_0xa17276,_0x3c65bd){if(_0x3c65bd){return _0xa17276;}return db[_0x4314('0x86')][_0x4314('0x61')](_[_0x4314('0x57')](_0x22de06[_0x4314('0x62')],{'read':![],'body':_0x22de06[_0x4314('0x62')]['body'],'phone':_0x2eab86,'WhatsappAccountId':_0x5cd0ac['id'],'WhatsappInteractionId':_0xa17276['id'],'UserId':_0x22de06[_0x4314('0x64')]['id'],'ContactId':_0x362eb8['id']}))[_0x4314('0x22')](function(_0x2f130e){_0xa17276[_0x4314('0xc1')][_0x4314('0xc2')]=[];_0xa17276['dataValues']['Messages'][_0x4314('0xac')](_0x2f130e['dataValues']);return _0xa17276;});})[_0x4314('0x22')](respondWithResult(_0x307da4,null))[_0x4314('0x2c')](handleError(_0x307da4,null));}; \ No newline at end of file +var _0x0270=['type','VIRTUAL','filter','options','includeAll','rows','show','create','body','user','role','WhatsappAccounts','UserProfileSection','find','autoAssociation','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','include','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','priority','finally','getApplications','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','whatsapp:','Body','messageId','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','omit','Contacts','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x3328b4,_0x403a24){var _0x530143=function(_0x53db2a){while(--_0x53db2a){_0x3328b4['push'](_0x3328b4['shift']());}};_0x530143(++_0x403a24);}(_0x0270,0x1e7));var _0x0027=function(_0x29b265,_0x5aa8b8){_0x29b265=_0x29b265-0x0;var _0xe58ea7=_0x0270[_0x29b265];return _0xe58ea7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0027('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0027('0x1'));var rp=require(_0x0027('0x2'));var moment=require(_0x0027('0x3'));var BPromise=require(_0x0027('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0027('0x5'));var sox=require(_0x0027('0x6'));var csv=require('to-csv');var ejs=require(_0x0027('0x7'));var fs=require('fs');var fs_extra=require(_0x0027('0x8'));var _=require(_0x0027('0x9'));var squel=require('squel');var crypto=require(_0x0027('0xa'));var jsforce=require(_0x0027('0xb'));var deskjs=require(_0x0027('0xc'));var toCsv=require(_0x0027('0xd'));var querystring=require(_0x0027('0xe'));var Papa=require(_0x0027('0xf'));var Redis=require(_0x0027('0x10'));var authService=require(_0x0027('0x11'));var qs=require(_0x0027('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0027('0x13'));var logger=require(_0x0027('0x14'))(_0x0027('0x15'));var utils=require(_0x0027('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0027('0x17'));var db=require(_0x0027('0x18'))['db'];config[_0x0027('0x19')]=_[_0x0027('0x1a')](config[_0x0027('0x19')],{'host':_0x0027('0x1b'),'port':0x18eb});var socket=require(_0x0027('0x1c'))(new Redis(config[_0x0027('0x19')]));require(_0x0027('0x1d'))[_0x0027('0x1e')](socket);var jayson=require(_0x0027('0x1f'));var client=jayson['client'][_0x0027('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5589db,_0x5f432e,_0x45070e,_0x32982f){return new BPromise(function(_0x2d7b7e,_0x572ded){var _0x208d55=_0x32982f||client;return _0x208d55['request'](_0x5589db,_0x45070e)[_0x0027('0x21')](function(_0x59b189){logger[_0x0027('0x22')](_0x0027('0x23'),_0x5f432e,'request\x20sent');logger['debug'](_0x0027('0x24'),_0x5f432e,'request\x20sent',JSON[_0x0027('0x25')](_0x59b189));if(_0x59b189[_0x0027('0x26')]){if(_0x59b189[_0x0027('0x26')][_0x0027('0x27')]===0x1f4){logger[_0x0027('0x26')](_0x0027('0x23'),_0x5f432e,_0x59b189[_0x0027('0x26')][_0x0027('0x28')]);return _0x572ded(_0x59b189['error']['message']);}logger[_0x0027('0x26')](_0x0027('0x23'),_0x5f432e,_0x59b189['error']['message']);return _0x2d7b7e(_0x59b189['error']['message']);}else{logger[_0x0027('0x22')](_0x0027('0x23'),_0x5f432e,'request\x20sent');_0x2d7b7e(_0x59b189[_0x0027('0x29')][_0x0027('0x28')]);}})[_0x0027('0x2a')](function(_0x4b701f){logger['error'](_0x0027('0x23'),_0x5f432e,_0x4b701f);_0x572ded(_0x4b701f);});});}function respondWithStatusCode(_0x43ad1c,_0x479e02){_0x479e02=_0x479e02||0xcc;return function(_0x449559){if(_0x449559){return _0x43ad1c[_0x0027('0x2b')](_0x479e02);}return _0x43ad1c[_0x0027('0x2c')](_0x479e02)[_0x0027('0x2d')]();};}function respondWithResult(_0x28adbe,_0x1778fc){_0x1778fc=_0x1778fc||0xc8;return function(_0x457130){if(_0x457130){return _0x28adbe[_0x0027('0x2c')](_0x1778fc)[_0x0027('0x2e')](_0x457130);}};}function respondWithFilteredResult(_0x37457a,_0x4699f9){return function(_0x26f346){if(_0x26f346){var _0x4e93b1=typeof _0x4699f9[_0x0027('0x2f')]===_0x0027('0x30')&&typeof _0x4699f9[_0x0027('0x31')]==='undefined';var _0x55ee8d=_0x26f346[_0x0027('0x32')];var _0x177ec4=_0x4e93b1?0x0:_0x4699f9[_0x0027('0x2f')];var _0x51a849=_0x4e93b1?_0x26f346[_0x0027('0x32')]:_0x4699f9[_0x0027('0x2f')]+_0x4699f9['limit'];var _0x14daed;if(_0x51a849>=_0x55ee8d){_0x51a849=_0x55ee8d;_0x14daed=0xc8;}else{_0x14daed=0xce;}_0x37457a[_0x0027('0x2c')](_0x14daed);return _0x37457a[_0x0027('0x33')](_0x0027('0x34'),_0x177ec4+'-'+_0x51a849+'/'+_0x55ee8d)['json'](_0x26f346);}return null;};}function patchUpdates(_0x3e7b7c){return function(_0x24c5de){try{jsonpatch['apply'](_0x24c5de,_0x3e7b7c,!![]);}catch(_0x5ec78){return BPromise['reject'](_0x5ec78);}return _0x24c5de[_0x0027('0x35')]();};}function saveUpdates(_0x558419,_0x4fe3e8){return function(_0x165741){if(_0x165741){return _0x165741[_0x0027('0x36')](_0x558419)[_0x0027('0x21')](function(_0x4e631d){return _0x4e631d;});}return null;};}function removeEntity(_0x5c89c4,_0xb351eb){return function(_0x529c8b){if(_0x529c8b){return _0x529c8b[_0x0027('0x37')]()[_0x0027('0x21')](function(){var _0x393b65=_0x529c8b[_0x0027('0x38')]({'plain':!![]});var _0x218cf7='WhatsappAccounts';return db[_0x0027('0x39')][_0x0027('0x37')]({'where':{'type':_0x218cf7,'resourceId':_0x393b65['id']}})['then'](function(){return _0x529c8b;});})[_0x0027('0x21')](function(){_0x5c89c4[_0x0027('0x2c')](0xcc)[_0x0027('0x2d')]();});}};}function handleEntityNotFound(_0x1646b4,_0x594af0){return function(_0x36082a){if(!_0x36082a){_0x1646b4[_0x0027('0x2b')](0x194);}return _0x36082a;};}function handleError(_0x39c583,_0x5d8ff1){_0x5d8ff1=_0x5d8ff1||0x1f4;return function(_0x474a97){logger['error'](_0x474a97[_0x0027('0x3a')]);if(_0x474a97[_0x0027('0x3b')]){delete _0x474a97[_0x0027('0x3b')];}_0x39c583['status'](_0x5d8ff1)[_0x0027('0x3c')](_0x474a97);};}exports[_0x0027('0x3d')]=function(_0x1d51b7,_0x1c7c2d){var _0x26a29c={'include':[{'model':db[_0x0027('0x3e')],'as':_0x0027('0x3f')}]},_0x53fc75={},_0x5c4a55={'count':0x0,'rows':[]};var _0x5d0f09=_[_0x0027('0x40')](db[_0x0027('0x41')][_0x0027('0x42')],function(_0x1b0d5e){return{'name':_0x1b0d5e['fieldName'],'type':_0x1b0d5e['type'][_0x0027('0x43')]};});_0x53fc75[_0x0027('0x44')]=_['map'](_0x5d0f09,'name');_0x53fc75[_0x0027('0x45')]=_[_0x0027('0x46')](_0x1d51b7['query']);_0x53fc75[_0x0027('0x47')]=_['intersection'](_0x53fc75['model'],_0x53fc75['query']);_0x26a29c['attributes']=_[_0x0027('0x48')](_0x53fc75['model'],qs[_0x0027('0x49')](_0x1d51b7['query'][_0x0027('0x49')]));_0x26a29c[_0x0027('0x4a')]=_0x26a29c['attributes'][_0x0027('0x4b')]?_0x26a29c[_0x0027('0x4a')]:_0x53fc75[_0x0027('0x44')];if(!_0x1d51b7[_0x0027('0x45')][_0x0027('0x4c')](_0x0027('0x4d'))){_0x26a29c[_0x0027('0x31')]=qs[_0x0027('0x31')](_0x1d51b7['query'][_0x0027('0x31')]);_0x26a29c[_0x0027('0x2f')]=qs[_0x0027('0x2f')](_0x1d51b7[_0x0027('0x45')]['offset']);}_0x26a29c[_0x0027('0x4e')]=qs[_0x0027('0x4f')](_0x1d51b7[_0x0027('0x45')][_0x0027('0x4f')]);_0x26a29c[_0x0027('0x50')]=qs['filters'](_[_0x0027('0x51')](_0x1d51b7['query'],_0x53fc75['filters']),_0x5d0f09);if(_0x1d51b7[_0x0027('0x45')]['filter']){_0x26a29c[_0x0027('0x50')]=_[_0x0027('0x52')](_0x26a29c[_0x0027('0x50')],{'$or':_[_0x0027('0x40')](_0x5d0f09,function(_0x187258){if(_0x187258[_0x0027('0x53')]!==_0x0027('0x54')){var _0xefbec4={};_0xefbec4[_0x187258[_0x0027('0x3b')]]={'$like':'%'+_0x1d51b7[_0x0027('0x45')][_0x0027('0x55')]+'%'};return _0xefbec4;}})});}_0x26a29c=_[_0x0027('0x52')]({},_0x26a29c,_0x1d51b7[_0x0027('0x56')]);var _0x27ecfd={'where':_0x26a29c['where']};return db[_0x0027('0x41')]['count'](_0x27ecfd)[_0x0027('0x21')](function(_0x2917b2){_0x5c4a55['count']=_0x2917b2;if(_0x1d51b7['query'][_0x0027('0x57')]){_0x26a29c['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x26a29c);})[_0x0027('0x21')](function(_0x5d1a29){_0x5c4a55[_0x0027('0x58')]=_0x5d1a29;return _0x5c4a55;})[_0x0027('0x21')](respondWithFilteredResult(_0x1c7c2d,_0x26a29c))[_0x0027('0x2a')](handleError(_0x1c7c2d,null));};exports[_0x0027('0x59')]=function(_0x268db5,_0x38da08){var _0x3f710e={'raw':![],'where':{'id':_0x268db5['params']['id']},'include':[{'model':db[_0x0027('0x3e')],'as':_0x0027('0x3f')}]},_0x49ca0b={};_0x49ca0b[_0x0027('0x44')]=_[_0x0027('0x46')](db['WhatsappAccount'][_0x0027('0x42')]);_0x49ca0b[_0x0027('0x45')]=_['keys'](_0x268db5[_0x0027('0x45')]);_0x49ca0b[_0x0027('0x47')]=_[_0x0027('0x48')](_0x49ca0b[_0x0027('0x44')],_0x49ca0b[_0x0027('0x45')]);_0x3f710e['attributes']=_[_0x0027('0x48')](_0x49ca0b[_0x0027('0x44')],qs['fields'](_0x268db5['query'][_0x0027('0x49')]));_0x3f710e['attributes']=_0x3f710e['attributes'][_0x0027('0x4b')]?_0x3f710e['attributes']:_0x49ca0b[_0x0027('0x44')];if(_0x268db5['query'][_0x0027('0x57')]){_0x3f710e['include']=[{'all':!![]}];}_0x3f710e=_['merge']({},_0x3f710e,_0x268db5['options']);return db[_0x0027('0x41')]['find'](_0x3f710e)[_0x0027('0x21')](handleEntityNotFound(_0x38da08,null))['then'](respondWithResult(_0x38da08,null))[_0x0027('0x2a')](handleError(_0x38da08,null));};exports['create']=function(_0x3cc762,_0x155975){return db[_0x0027('0x41')][_0x0027('0x5a')](_0x3cc762[_0x0027('0x5b')],{})[_0x0027('0x21')](function(_0x4a7f39){var _0x4e7ba5=_0x3cc762[_0x0027('0x5c')][_0x0027('0x38')]({'plain':!![]});if(!_0x4e7ba5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e7ba5[_0x0027('0x5d')]===_0x0027('0x5c')){var _0x5d2ff5=_0x4a7f39[_0x0027('0x38')]({'plain':!![]});var _0x3e820c=_0x0027('0x5e');return db[_0x0027('0x5f')][_0x0027('0x60')]({'where':{'name':_0x3e820c,'userProfileId':_0x4e7ba5['userProfileId']},'raw':!![]})[_0x0027('0x21')](function(_0xd9b4f8){if(_0xd9b4f8&&_0xd9b4f8[_0x0027('0x61')]===0x0){return db[_0x0027('0x39')]['create']({'name':_0x5d2ff5['name'],'resourceId':_0x5d2ff5['id'],'type':_0xd9b4f8['name'],'sectionId':_0xd9b4f8['id']},{})[_0x0027('0x21')](function(){return _0x4a7f39;});}else{return _0x4a7f39;}})[_0x0027('0x2a')](function(_0x1956da){logger[_0x0027('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1956da);throw _0x1956da;});}return _0x4a7f39;})[_0x0027('0x21')](respondWithResult(_0x155975,0xc9))['catch'](handleError(_0x155975,null));};exports[_0x0027('0x36')]=function(_0x425b6f,_0x4470e8){if(_0x425b6f[_0x0027('0x5b')]['id']){delete _0x425b6f['body']['id'];}return db['WhatsappAccount'][_0x0027('0x60')]({'where':{'id':_0x425b6f[_0x0027('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0x0027('0x3f')}]})[_0x0027('0x21')](handleEntityNotFound(_0x4470e8,null))['then'](saveUpdates(_0x425b6f['body'],null))['then'](respondWithResult(_0x4470e8,null))['catch'](handleError(_0x4470e8,null));};exports['destroy']=function(_0x2f1029,_0x270563){return db[_0x0027('0x41')][_0x0027('0x60')]({'where':{'id':_0x2f1029[_0x0027('0x62')]['id']}})['then'](handleEntityNotFound(_0x270563,null))[_0x0027('0x21')](removeEntity(_0x270563,null))[_0x0027('0x2a')](handleError(_0x270563,null));};exports[_0x0027('0x63')]=function(_0x451829,_0x5e2a29){return db[_0x0027('0x41')][_0x0027('0x63')]()['then'](respondWithResult(_0x5e2a29,null))[_0x0027('0x2a')](handleError(_0x5e2a29,null));};exports[_0x0027('0x64')]=function(_0x4801d6,_0x1f1781,_0x4a87f8){if(_0x4801d6[_0x0027('0x5b')]['id']){delete _0x4801d6[_0x0027('0x5b')]['id'];}return db[_0x0027('0x41')]['find']({'where':{'id':_0x4801d6[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x1f1781,null))[_0x0027('0x21')](function(_0x494d84){if(_0x494d84){_0x4801d6[_0x0027('0x5b')][_0x0027('0x65')]=_0x494d84['id'];return db[_0x0027('0x66')]['create'](_0x4801d6['body']);}})[_0x0027('0x21')](respondWithResult(_0x1f1781,null))['catch'](handleError(_0x1f1781,null));};exports[_0x0027('0x67')]=function(_0x3325e1,_0x56ebad,_0x40c4b6){var _0x5bca8f={'raw':![],'where':{}};var _0x33f4dc={};var _0x5098de={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0027('0x68')]({'where':{'id':_0x3325e1[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x56ebad,null))['then'](function(_0x5106fb){if(_0x5106fb){_0x33f4dc[_0x0027('0x44')]=_['keys'](db[_0x0027('0x66')][_0x0027('0x42')]);_0x33f4dc[_0x0027('0x45')]=_[_0x0027('0x46')](_0x3325e1['query']);_0x33f4dc[_0x0027('0x47')]=_[_0x0027('0x48')](_0x33f4dc[_0x0027('0x44')],_0x33f4dc['query']);_0x5bca8f[_0x0027('0x4a')]=_[_0x0027('0x48')](_0x33f4dc[_0x0027('0x44')],qs[_0x0027('0x49')](_0x3325e1[_0x0027('0x45')][_0x0027('0x49')]));_0x5bca8f[_0x0027('0x4a')]=_0x5bca8f['attributes'][_0x0027('0x4b')]?_0x5bca8f[_0x0027('0x4a')]:_0x33f4dc[_0x0027('0x44')];if(!_0x3325e1[_0x0027('0x45')]['hasOwnProperty'](_0x0027('0x4d'))){_0x5bca8f[_0x0027('0x31')]=qs[_0x0027('0x31')](_0x3325e1[_0x0027('0x45')][_0x0027('0x31')]);_0x5bca8f[_0x0027('0x2f')]=qs[_0x0027('0x2f')](_0x3325e1[_0x0027('0x45')][_0x0027('0x2f')]);}_0x5bca8f['order']=qs[_0x0027('0x4f')](_0x3325e1[_0x0027('0x45')][_0x0027('0x4f')]);_0x5bca8f[_0x0027('0x50')]=qs['filters'](_[_0x0027('0x51')](_0x3325e1[_0x0027('0x45')],_0x33f4dc['filters']));_0x5bca8f[_0x0027('0x50')][_0x0027('0x65')]=_0x5106fb['id'];if(_0x3325e1[_0x0027('0x45')][_0x0027('0x55')]){_0x5bca8f['where']=_[_0x0027('0x52')](_0x5bca8f['where'],{'$or':_['map'](_0x5bca8f['attributes'],function(_0x25cf19){var _0x3b1fb2={};_0x3b1fb2[_0x25cf19]={'$like':'%'+_0x3325e1['query'][_0x0027('0x55')]+'%'};return _0x3b1fb2;})});}_0x5bca8f=_[_0x0027('0x52')]({},_0x5bca8f,_0x3325e1['options']);return db[_0x0027('0x66')][_0x0027('0x32')]({'where':_0x5bca8f['where']})['then'](function(_0x505244){_0x5098de[_0x0027('0x32')]=_0x505244;if(_0x3325e1['query'][_0x0027('0x57')]){_0x5bca8f[_0x0027('0x69')]=[{'all':!![]}];}return db[_0x0027('0x66')][_0x0027('0x6a')](_0x5bca8f);})[_0x0027('0x21')](function(_0x40ea4a){_0x5098de[_0x0027('0x58')]=_0x40ea4a;return _0x5098de;});}})['then'](respondWithFilteredResult(_0x56ebad,_0x5bca8f))[_0x0027('0x2a')](handleError(_0x56ebad,null));};exports['removeDispositions']=function(_0x3841ab,_0x22c2f3,_0x32f388){return db[_0x0027('0x41')]['find']({'where':{'id':_0x3841ab[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x22c2f3,null))[_0x0027('0x21')](function(_0x57e92f){if(_0x57e92f){return _0x57e92f[_0x0027('0x6b')](_0x3841ab['query'][_0x0027('0x6c')]);}})[_0x0027('0x21')](respondWithStatusCode(_0x22c2f3,null))[_0x0027('0x2a')](handleError(_0x22c2f3,null));};exports[_0x0027('0x6d')]=function(_0x2b04c5,_0x341768,_0x56dd20){if(_0x2b04c5[_0x0027('0x5b')]['id']){delete _0x2b04c5[_0x0027('0x5b')]['id'];}return db['WhatsappAccount'][_0x0027('0x60')]({'where':{'id':_0x2b04c5[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x341768,null))['then'](function(_0x3615c9){if(_0x3615c9){_0x2b04c5[_0x0027('0x5b')]['WhatsappAccountId']=_0x3615c9['id'];return db['CannedAnswer'][_0x0027('0x5a')](_0x2b04c5[_0x0027('0x5b')]);}})[_0x0027('0x21')](respondWithResult(_0x341768,null))[_0x0027('0x2a')](handleError(_0x341768,null));};exports[_0x0027('0x6e')]=function(_0x165ce7,_0x2b88bd,_0x5b522d){var _0x3358bc={'raw':![],'where':{}};var _0x344aca={};var _0x48ac4b={'count':0x0,'rows':[]};return db[_0x0027('0x41')][_0x0027('0x68')]({'where':{'id':_0x165ce7[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x2b88bd,null))[_0x0027('0x21')](function(_0x3b015e){if(_0x3b015e){_0x344aca[_0x0027('0x44')]=_['keys'](db[_0x0027('0x6f')][_0x0027('0x42')]);_0x344aca[_0x0027('0x45')]=_[_0x0027('0x46')](_0x165ce7[_0x0027('0x45')]);_0x344aca[_0x0027('0x47')]=_[_0x0027('0x48')](_0x344aca['model'],_0x344aca[_0x0027('0x45')]);_0x3358bc['attributes']=_[_0x0027('0x48')](_0x344aca['model'],qs['fields'](_0x165ce7[_0x0027('0x45')][_0x0027('0x49')]));_0x3358bc['attributes']=_0x3358bc[_0x0027('0x4a')][_0x0027('0x4b')]?_0x3358bc[_0x0027('0x4a')]:_0x344aca[_0x0027('0x44')];if(!_0x165ce7[_0x0027('0x45')][_0x0027('0x4c')](_0x0027('0x4d'))){_0x3358bc['limit']=qs['limit'](_0x165ce7[_0x0027('0x45')][_0x0027('0x31')]);_0x3358bc['offset']=qs[_0x0027('0x2f')](_0x165ce7[_0x0027('0x45')][_0x0027('0x2f')]);}_0x3358bc['order']=qs[_0x0027('0x4f')](_0x165ce7[_0x0027('0x45')][_0x0027('0x4f')]);_0x3358bc[_0x0027('0x50')]=qs[_0x0027('0x47')](_[_0x0027('0x51')](_0x165ce7['query'],_0x344aca[_0x0027('0x47')]));_0x3358bc['where'][_0x0027('0x65')]=_0x3b015e['id'];if(_0x165ce7[_0x0027('0x45')][_0x0027('0x55')]){_0x3358bc['where']=_[_0x0027('0x52')](_0x3358bc[_0x0027('0x50')],{'$or':_['map'](_0x3358bc['attributes'],function(_0xa2191a){var _0x82ad4a={};_0x82ad4a[_0xa2191a]={'$like':'%'+_0x165ce7[_0x0027('0x45')]['filter']+'%'};return _0x82ad4a;})});}_0x3358bc=_[_0x0027('0x52')]({},_0x3358bc,_0x165ce7[_0x0027('0x56')]);return db[_0x0027('0x6f')][_0x0027('0x32')]({'where':_0x3358bc['where']})[_0x0027('0x21')](function(_0x36e0c2){_0x48ac4b[_0x0027('0x32')]=_0x36e0c2;if(_0x165ce7[_0x0027('0x45')][_0x0027('0x57')]){_0x3358bc[_0x0027('0x69')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3358bc);})[_0x0027('0x21')](function(_0x1b30e1){_0x48ac4b['rows']=_0x1b30e1;return _0x48ac4b;});}})[_0x0027('0x21')](respondWithFilteredResult(_0x2b88bd,_0x3358bc))[_0x0027('0x2a')](handleError(_0x2b88bd,null));};exports[_0x0027('0x70')]=function(_0x1bfe77,_0x5d6414,_0x223c9b){return db['WhatsappAccount']['find']({'where':{'id':_0x1bfe77[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x5d6414,null))[_0x0027('0x21')](function(_0xe2cdd6){if(_0xe2cdd6){return _0xe2cdd6[_0x0027('0x70')](_0x1bfe77[_0x0027('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x5d6414,null))[_0x0027('0x2a')](handleError(_0x5d6414,null));};exports[_0x0027('0x71')]=function(_0x40a391,_0x35ba99,_0xa7af22){return db['WhatsappAccount']['find']({'where':{'id':_0x40a391[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x35ba99,null))['then'](function(_0x42db0b){if(_0x42db0b){return _0x42db0b['addAgents'](_0x40a391[_0x0027('0x5b')]['ids'],_['omit'](_0x40a391[_0x0027('0x5b')],[_0x0027('0x6c'),'id'])||{})[_0x0027('0x72')](function(_0x4606a0){for(var _0x38fe99=0x0;_0x38fe99<_0x40a391['body'][_0x0027('0x6c')]['length'];_0x38fe99+=0x1){socket[_0x0027('0x73')](_0x0027('0x74'),{'UserId':Number(_0x40a391['body'][_0x0027('0x6c')][_0x38fe99]),'WhatsappAccountId':Number(_0x40a391[_0x0027('0x62')]['id'])});}return _0x4606a0;});}})['then'](respondWithResult(_0x35ba99,null))[_0x0027('0x2a')](handleError(_0x35ba99,null));};exports[_0x0027('0x75')]=function(_0x107c30,_0x93001e,_0x1d7261){return db[_0x0027('0x41')][_0x0027('0x60')]({'where':{'id':_0x107c30['params']['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x93001e,null))[_0x0027('0x21')](function(_0x62b2e9){if(_0x62b2e9){return _0x62b2e9['removeAgents'](_0x107c30[_0x0027('0x45')][_0x0027('0x6c')])['then'](function(){if(_[_0x0027('0x76')](_0x107c30['query'][_0x0027('0x6c')])){for(var _0x4e8dad=0x0;_0x4e8dad<_0x107c30[_0x0027('0x45')][_0x0027('0x6c')][_0x0027('0x4b')];_0x4e8dad+=0x1){socket[_0x0027('0x73')](_0x0027('0x77'),{'UserId':Number(_0x107c30['query'][_0x0027('0x6c')][_0x4e8dad]),'WhatsappAccountId':Number(_0x107c30[_0x0027('0x62')]['id'])});}}else{socket[_0x0027('0x73')](_0x0027('0x77'),{'UserId':Number(_0x107c30['query']['ids']),'WhatsappAccountId':Number(_0x107c30['params']['id'])});}});}})[_0x0027('0x21')](respondWithStatusCode(_0x93001e,null))[_0x0027('0x2a')](handleError(_0x93001e,null));};exports['getAgents']=function(_0x2d27cd,_0x2ce16c,_0x594452){var _0x3a3229={};var _0x38db5f={};var _0x10ba7f;var _0xca5dbd;return db[_0x0027('0x41')][_0x0027('0x68')]({'where':{'id':_0x2d27cd[_0x0027('0x62')]['id']}})[_0x0027('0x21')](handleEntityNotFound(_0x2ce16c,null))[_0x0027('0x21')](function(_0x4e0ec4){if(_0x4e0ec4){_0x10ba7f=_0x4e0ec4;_0x38db5f[_0x0027('0x44')]=_['keys'](db['User'][_0x0027('0x42')]);_0x38db5f[_0x0027('0x45')]=_[_0x0027('0x46')](_0x2d27cd[_0x0027('0x45')]);_0x38db5f[_0x0027('0x47')]=_['intersection'](_0x38db5f[_0x0027('0x44')],_0x38db5f[_0x0027('0x45')]);_0x3a3229[_0x0027('0x4a')]=_[_0x0027('0x48')](_0x38db5f[_0x0027('0x44')],qs['fields'](_0x2d27cd[_0x0027('0x45')][_0x0027('0x49')]));_0x3a3229[_0x0027('0x4a')]=_0x3a3229[_0x0027('0x4a')][_0x0027('0x4b')]?_0x3a3229[_0x0027('0x4a')]:_0x38db5f[_0x0027('0x44')];_0x3a3229[_0x0027('0x4e')]=qs['sort'](_0x2d27cd['query'][_0x0027('0x4f')]);_0x3a3229[_0x0027('0x50')]=qs[_0x0027('0x47')](_['pick'](_0x2d27cd[_0x0027('0x45')],_0x38db5f[_0x0027('0x47')]));if(_0x2d27cd['query'][_0x0027('0x55')]){_0x3a3229[_0x0027('0x50')]=_[_0x0027('0x52')](_0x3a3229[_0x0027('0x50')],{'$or':_[_0x0027('0x40')](_0x3a3229['attributes'],function(_0x781d8f){var _0x28b2fb={};_0x28b2fb[_0x781d8f]={'$like':'%'+_0x2d27cd[_0x0027('0x45')][_0x0027('0x55')]+'%'};return _0x28b2fb;})});}_0x3a3229=_[_0x0027('0x52')]({},_0x3a3229,_0x2d27cd['options']);return _0x10ba7f[_0x0027('0x78')](_0x3a3229);}})[_0x0027('0x21')](function(_0x5024ff){if(_0x5024ff){_0xca5dbd=_0x5024ff[_0x0027('0x4b')];if(!_0x2d27cd['query'][_0x0027('0x4c')](_0x0027('0x4d'))){_0x3a3229['limit']=qs[_0x0027('0x31')](_0x2d27cd['query'][_0x0027('0x31')]);_0x3a3229['offset']=qs['offset'](_0x2d27cd[_0x0027('0x45')][_0x0027('0x2f')]);}return _0x10ba7f[_0x0027('0x78')](_0x3a3229);}})[_0x0027('0x21')](function(_0x2cd603){if(_0x2cd603){return _0x2cd603?{'count':_0xca5dbd,'rows':_0x2cd603}:null;}})['then'](respondWithResult(_0x2ce16c,null))[_0x0027('0x2a')](handleError(_0x2ce16c,null));};exports[_0x0027('0x79')]=function(_0x5dfe45,_0x55660a){var _0x5e1aed=_0x5dfe45[_0x0027('0x62')]['id'];var _0x243174=_0x5dfe45['body'];var _0x2fc781=0xc8;var _0x28f80f=null;return db[_0x0027('0x7a')][_0x0027('0x7b')]({'isolationLevel':db[_0x0027('0x7a')][_0x0027('0x7c')][_0x0027('0x7d')]['READ_COMMITTED']},function(_0x36ed01){return db[_0x0027('0x41')][_0x0027('0x68')]({'where':{'id':_0x5e1aed},'transaction':_0x36ed01})[_0x0027('0x21')](function(_0x154199){if(_0x154199){return db[_0x0027('0x7e')][_0x0027('0x37')]({'where':{'WhatsappAccountId':_0x5e1aed},'transaction':_0x36ed01})['then'](function(){var _0x35cf09=_[_0x0027('0x40')](_0x243174,function(_0x146ac4){_0x146ac4[_0x0027('0x65')]=_0x5e1aed;return _0x146ac4;});return db['WhatsappApplication']['bulkCreate'](_0x35cf09,{'transaction':_0x36ed01});});}else{_0x2fc781=0x194;_0x28f80f=[];}});})[_0x0027('0x21')](function(){if(_0x2fc781!==0x194){return db[_0x0027('0x7e')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x5e1aed},'order':_0x0027('0x7f')})[_0x0027('0x21')](function(_0x5d7552){_0x28f80f=_0x5d7552;});}})[_0x0027('0x2a')](function(_0x15fc15){_0x2fc781=0x1f4;logger[_0x0027('0x26')](_0x15fc15['stack']);if(_0x15fc15[_0x0027('0x3b')]){delete _0x15fc15[_0x0027('0x3b')];}_0x28f80f=_0x15fc15;})[_0x0027('0x80')](function(){if(_0x28f80f===null){_0x55660a[_0x0027('0x2b')](_0x2fc781);}else{if(_0x2fc781===0x1f4){_0x55660a[_0x0027('0x2c')](_0x2fc781)[_0x0027('0x3c')](_0x28f80f);}else{_0x55660a[_0x0027('0x2c')](_0x2fc781)[_0x0027('0x2e')](_0x28f80f);}}});};exports[_0x0027('0x81')]=function(_0x50ceed,_0x425a7f,_0x4483cb){var _0x1fbc02={};var _0x1c2532={};var _0x56401d;var _0x293a80;return db[_0x0027('0x41')][_0x0027('0x68')]({'where':{'id':_0x50ceed[_0x0027('0x62')]['id']}})['then'](handleEntityNotFound(_0x425a7f,null))['then'](function(_0xc6ba73){if(_0xc6ba73){_0x56401d=_0xc6ba73;_0x1c2532[_0x0027('0x44')]=_[_0x0027('0x46')](db[_0x0027('0x7e')]['rawAttributes']);_0x1c2532[_0x0027('0x45')]=_[_0x0027('0x46')](_0x50ceed[_0x0027('0x45')]);_0x1c2532[_0x0027('0x47')]=_[_0x0027('0x48')](_0x1c2532[_0x0027('0x44')],_0x1c2532['query']);_0x1fbc02[_0x0027('0x4a')]=_[_0x0027('0x48')](_0x1c2532[_0x0027('0x44')],qs[_0x0027('0x49')](_0x50ceed[_0x0027('0x45')][_0x0027('0x49')]));_0x1fbc02[_0x0027('0x4a')]=_0x1fbc02[_0x0027('0x4a')][_0x0027('0x4b')]?_0x1fbc02[_0x0027('0x4a')]:_0x1c2532[_0x0027('0x44')];_0x1fbc02[_0x0027('0x4e')]=qs[_0x0027('0x4f')](_0x50ceed[_0x0027('0x45')][_0x0027('0x4f')]);_0x1fbc02['where']=qs[_0x0027('0x47')](_[_0x0027('0x51')](_0x50ceed[_0x0027('0x45')],_0x1c2532[_0x0027('0x47')]));if(_0x50ceed[_0x0027('0x45')][_0x0027('0x55')]){_0x1fbc02[_0x0027('0x50')]=_[_0x0027('0x52')](_0x1fbc02[_0x0027('0x50')],{'$or':_[_0x0027('0x40')](_0x1fbc02['attributes'],function(_0x3b9575){var _0x45a387={};_0x45a387[_0x3b9575]={'$like':'%'+_0x50ceed[_0x0027('0x45')][_0x0027('0x55')]+'%'};return _0x45a387;})});}_0x1fbc02=_[_0x0027('0x52')]({},_0x1fbc02,_0x50ceed['options']);return _0x56401d[_0x0027('0x81')](_0x1fbc02);}})[_0x0027('0x21')](function(_0x3d0d3d){if(_0x3d0d3d){_0x293a80=_0x3d0d3d[_0x0027('0x4b')];if(!_0x50ceed[_0x0027('0x45')]['hasOwnProperty']('nolimit')){_0x1fbc02[_0x0027('0x31')]=qs[_0x0027('0x31')](_0x50ceed[_0x0027('0x45')]['limit']);_0x1fbc02['offset']=qs[_0x0027('0x2f')](_0x50ceed['query']['offset']);}return _0x56401d[_0x0027('0x81')](_0x1fbc02);}})[_0x0027('0x21')](function(_0x762253){if(_0x762253){return _0x762253?{'count':_0x293a80,'rows':_0x762253}:null;}})['then'](respondWithResult(_0x425a7f,null))[_0x0027('0x2a')](handleError(_0x425a7f,null));};exports['notify']=function(_0x267686,_0x204c8a,_0x25b950){var _0x343e1e={'channel':_0x0027('0x82')};var _0x251e8d=[];var _0x4eb7b8=[];var _0x336814={};return db['WhatsappAccount'][_0x0027('0x60')]({'where':{'id':_0x267686[_0x0027('0x62')]['id']},'include':[{'model':db[_0x0027('0x7e')],'as':'Applications'}]})[_0x0027('0x21')](handleEntityNotFound(_0x204c8a,null))[_0x0027('0x21')](function(_0x1832cb){_0x343e1e['account']=_0x1832cb;if(_0x343e1e[_0x0027('0x83')]&&_0x343e1e['account'][_0x0027('0x53')]===_0x0027('0x84')&&_0x267686[_0x0027('0x5b')][_0x0027('0x85')]){if(_0x267686[_0x0027('0x5b')][_0x0027('0x85')][_0x0027('0x4b')]===0x0)return;if(_0x267686[_0x0027('0x5b')][_0x0027('0x85')][0x0][_0x0027('0x86')]!==_0x0027('0x87'))return;return db[_0x0027('0x88')]['update']({'read':!![],'readAt':_0x267686[_0x0027('0x5b')]['statuses'][0x0][_0x0027('0x89')]},{'where':{'messageId':_0x267686['body'][_0x0027('0x85')][0x0][_0x0027('0x8a')]},'individualHooks':!![]})['then'](function(_0x3cdf9){return _0x204c8a[_0x0027('0x2c')](0xc8)[_0x0027('0x2e')](_0x3cdf9);});}_0x343e1e[_0x0027('0x8b')]=_[_0x0027('0x8c')](_0x1832cb[_0x0027('0x8d')],[_0x0027('0x7f')],[_0x0027('0x8e')]);if(_0x343e1e[_0x0027('0x83')][_0x0027('0x8d')]){delete _0x343e1e['account'][_0x0027('0x8d')];}return db[_0x0027('0x8f')]['describe']()[_0x0027('0x21')](function(_0x32afac){if(!_0x32afac){throw new db[(_0x0027('0x90'))]['ValidationError'](_0x0027('0x91'));}_0x251e8d=_['difference'](_['keys'](_0x32afac),[_0x0027('0x92'),_0x0027('0x93')]);_0x4eb7b8=_[_0x0027('0x94')](_[_0x0027('0x46')](_0x32afac),[_0x0027('0x92'),_0x0027('0x93'),_0x0027('0x95'),_0x0027('0x96')]);_0x343e1e[_0x0027('0x5b')]={'mapKey':'mobile'};if(_0x343e1e['account']&&_0x343e1e[_0x0027('0x83')]['type']==='twilio'){_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')]=_0x267686[_0x0027('0x5b')]['From']['replace'](_0x0027('0x98'),'');_0x343e1e[_0x0027('0x5b')][_0x0027('0x5b')]=_0x267686[_0x0027('0x5b')][_0x0027('0x99')];_0x343e1e['body'][_0x0027('0x9a')]=_0x267686[_0x0027('0x5b')]['MessageSid'];}if(_0x343e1e[_0x0027('0x83')]&&_0x343e1e['account'][_0x0027('0x53')]===_0x0027('0x84')){_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')]=_0x267686['body'][_0x0027('0x9b')][0x0][_0x0027('0x97')];_0x343e1e[_0x0027('0x5b')][_0x0027('0x5b')]=_0x267686['body'][_0x0027('0x9b')][0x0]['message'][_0x0027('0x5b')];_0x343e1e[_0x0027('0x5b')]['messageId']=_0x267686[_0x0027('0x5b')]['notifications'][0x0][_0x0027('0x8a')];}if(_0x343e1e['body']['id']){delete _0x343e1e[_0x0027('0x5b')]['id'];}if(_[_0x0027('0x9c')](_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')])){throw new db[(_0x0027('0x90'))][(_0x0027('0x9d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x343e1e[_0x0027('0x5b')]['body'])||_0x343e1e[_0x0027('0x5b')][_0x0027('0x5b')]===''){throw new db[(_0x0027('0x90'))]['ValidationError'](_0x0027('0x9e'));}if(_['isNil'](_0x343e1e[_0x0027('0x5b')][_0x0027('0x9f')])){throw new db['Sequelize']['ValidationError'](_0x0027('0xa0')+_0x4eb7b8);}if(!_[_0x0027('0xa1')](_0x4eb7b8,_0x343e1e[_0x0027('0x5b')][_0x0027('0x9f')])){throw new db[(_0x0027('0x90'))][(_0x0027('0x9d'))](_0x0027('0xa2')+_0x4eb7b8);}_0x336814[_0x343e1e[_0x0027('0x5b')][_0x0027('0x9f')]]=_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')];return db['CmList'][_0x0027('0x60')]({'where':{'id':_0x343e1e[_0x0027('0x83')]['ListId']},'include':[{'model':db[_0x0027('0x8f')],'as':'Contacts','where':_0x336814,'limit':0x1,'order':[[_0x0027('0x93'),_0x0027('0xa3')]]}]});})['then'](handleEntityNotFound(_0x204c8a,null))[_0x0027('0x21')](function(_0x390798){if(_0x390798){_0x343e1e[_0x0027('0xa4')]=_[_0x0027('0xa5')](_0x390798,[_0x0027('0xa6')]);if(_0x390798[_0x0027('0xa6')][_0x0027('0x4b')]){return _0x390798['Contacts'][0x0];}var _0x2017fc=_[_0x0027('0x1a')](_0x343e1e[_0x0027('0x5b')],{'firstName':_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')],'ListId':_0x390798['id']});_0x2017fc[_0x343e1e[_0x0027('0x5b')]['mapKey']]=_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')];return db[_0x0027('0x8f')]['create'](_0x2017fc,{'fields':_0x251e8d,'raw':!![]});}})['then'](handleEntityNotFound(_0x204c8a,null))[_0x0027('0x21')](function(_0x369fbe){if(_0x369fbe){_0x343e1e['contact']=_0x369fbe;var _0xa9b955={'ContactId':_0x369fbe['id'],'phone':_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')],'WhatsappAccountId':_0x267686[_0x0027('0x62')]['id']};var _0x180b33={'ContactId':_0x369fbe['id'],'WhatsappAccountId':_0x267686['params']['id'],'closed':![]};return db[_0x0027('0xa7')][_0x0027('0x60')]({'where':_0x180b33})[_0x0027('0x21')](function(_0x47cc65){if(_0x47cc65){return[_0x47cc65,![]];}return db[_0x0027('0xa7')]['create'](_0xa9b955)[_0x0027('0x21')](function(_0x92389){return[_0x92389,!![]];});});}})[_0x0027('0x72')](function(_0x216ffd,_0x3cdd52){_0x343e1e[_0x0027('0xa8')]=_0x216ffd[_0x0027('0x38')]({'plain':!![]});_0x343e1e['interaction'][_0x0027('0xa9')]=![];if(_0x3cdd52){if(_0x343e1e[_0x0027('0x83')][_0x0027('0xaa')]){_0x343e1e['applications'][_0x0027('0xab')]({'id':0x0,'priority':_0x343e1e[_0x0027('0x8b')][_0x0027('0x4b')]+0x1,'app':'close','appdata':_0x0027('0xac'),'interval':_0x0027('0xad')});}_0x343e1e[_0x0027('0xa8')][_0x0027('0xa9')]=!![];}return db[_0x0027('0x88')]['create']({'phone':_0x343e1e[_0x0027('0x5b')][_0x0027('0x97')],'messageId':_0x343e1e[_0x0027('0x5b')][_0x0027('0x9a')],'body':_0x343e1e['body'][_0x0027('0x5b')],'WhatsappAccountId':_0x267686[_0x0027('0x62')]['id'],'WhatsappInteractionId':_0x216ffd['id'],'direction':'in','ContactId':_0x216ffd[_0x0027('0xae')],'AttachmentId':_0x343e1e[_0x0027('0x5b')]['AttachmentId']});})['then'](function(_0xd4be35){_0x343e1e['message']=_0xd4be35;if(_0x343e1e[_0x0027('0xa8')][_0x0027('0xaf')]){return db['User'][_0x0027('0x60')]({'attributes':['id','name'],'where':{'id':_0x343e1e['interaction']['UserId']}})[_0x0027('0x21')](function(_0x19e571){if(_0x19e571){_0x343e1e[_0x0027('0x8b')][_0x0027('0xb0')]({'id':0x0,'priority':0x0,'app':_0x0027('0xb1'),'appdata':_0x19e571[_0x0027('0x3b')]+','+(_0x343e1e[_0x0027('0x83')][_0x0027('0xb2')]||0xa),'interval':_0x0027('0xad')});}return respondWithRpcPromise(_0x0027('0xb3'),'startRouting',_0x343e1e);});}return respondWithRpcPromise('Start',_0x0027('0xb4'),_0x343e1e);})['then'](function(_0x1b54ec){if(_0x1b54ec){var _0xe8b66a=0xc8;var _0x51e84b=_0x0027('0xb5');logger[_0x0027('0x22')](_0x0027('0x24'),_0x51e84b,_0xe8b66a,'entity\x20found');logger['debug'](_0x0027('0xb6'),_0x51e84b,_0xe8b66a,_0x0027('0xb7'),JSON['stringify'](_0x1b54ec));if(_0x343e1e[_0x0027('0x83')]['type']==='twilio'){return _0x204c8a['status'](_0xe8b66a)[_0x0027('0x33')]('Content-Type','text/xml')[_0x0027('0x3c')]('\x0a');}else{return _0x204c8a[_0x0027('0x2c')](_0xe8b66a)['json'](_0x1b54ec);}}});})[_0x0027('0x2a')](handleError(_0x204c8a,null));};exports[_0x0027('0x3c')]=function(_0x52ddf1,_0x303f46,_0x52b398){var _0xd01ba,_0x1dfc02,_0x4a8f40;if(_['isNil'](_0x52ddf1[_0x0027('0x5b')][_0x0027('0x5b')])||_0x52ddf1[_0x0027('0x5b')][_0x0027('0x5b')]===''){throw new db['Sequelize'][(_0x0027('0x9d'))](_0x0027('0x9e'));}if(_[_0x0027('0x9c')](_0x52ddf1['body']['to'])){throw new db[(_0x0027('0x90'))][(_0x0027('0x9d'))](_0x0027('0xb8'));}_0xd01ba=_0x52ddf1['body']['to'];return db[_0x0027('0x41')][_0x0027('0x60')]({'where':{'id':_0x52ddf1[_0x0027('0x62')]['id']},'include':[{'model':db[_0x0027('0xb9')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0027('0xa6'),'where':{'mobile':_0xd01ba},'limit':0x1,'order':[[_0x0027('0x93'),_0x0027('0xa3')]]}]}]})[_0x0027('0x21')](handleEntityNotFound(_0x303f46,null))['then'](function(_0x156e37){if(_0x156e37&&_0x156e37[_0x0027('0xba')]){_0x1dfc02=_0x156e37[_0x0027('0x38')]({'plain':!![]});if(_0x1dfc02[_0x0027('0xba')]&&_0x1dfc02[_0x0027('0xba')][_0x0027('0xa6')][_0x0027('0x4b')]){return _0x1dfc02[_0x0027('0xba')][_0x0027('0xa6')][0x0];}return db[_0x0027('0x8f')]['create'](_['defaults'](_0x52ddf1[_0x0027('0x5b')],{'firstName':_0xd01ba,'mobile':_0xd01ba,'phone':_0xd01ba,'ListId':_0x1dfc02['ListId']}));}})[_0x0027('0x21')](handleEntityNotFound(_0x303f46,null))['then'](function(_0x14caeb){if(_0x14caeb){_0x4a8f40=_0x14caeb;return db[_0x0027('0xa7')]['find']({'where':{'ContactId':_0x4a8f40['id'],'closed':![],'WhatsappAccountId':_0x1dfc02['id']}})[_0x0027('0x21')](function(_0x36ac32){if(_0x36ac32){return[_0x36ac32,![]];}return db[_0x0027('0xa7')][_0x0027('0x5a')]({'UserId':_0x52ddf1['user']['id'],'ContactId':_0x4a8f40['id'],'WhatsappAccountId':_0x1dfc02['id'],'phone':_0xd01ba,'firstMsgDirection':_0x0027('0xbb'),'Messages':[_['merge'](_0x52ddf1[_0x0027('0x5b')],{'read':![],'body':_0x52ddf1[_0x0027('0x5b')][_0x0027('0x5b')],'phone':_0xd01ba,'WhatsappAccountId':_0x1dfc02['id'],'UserId':_0x52ddf1['user']['id'],'ContactId':_0x4a8f40['id']})]},{'include':[{'model':db[_0x0027('0x88')],'as':_0x0027('0xbc')}]})[_0x0027('0x21')](function(_0x3fc6d6){return[_0x3fc6d6,!![]];});});}})[_0x0027('0x72')](function(_0x354b6a,_0x31341e){if(_0x31341e){return _0x354b6a;}return db[_0x0027('0x88')][_0x0027('0x5a')](_[_0x0027('0x52')](_0x52ddf1[_0x0027('0x5b')],{'read':![],'body':_0x52ddf1[_0x0027('0x5b')]['body'],'phone':_0xd01ba,'WhatsappAccountId':_0x1dfc02['id'],'WhatsappInteractionId':_0x354b6a['id'],'UserId':_0x52ddf1[_0x0027('0x5c')]['id'],'ContactId':_0x4a8f40['id']}))['then'](function(_0x50ca56){_0x354b6a['dataValues']['Messages']=[];_0x354b6a['dataValues']['Messages'][_0x0027('0xab')](_0x50ca56[_0x0027('0xbd')]);return _0x354b6a;});})[_0x0027('0x21')](respondWithResult(_0x303f46,null))[_0x0027('0x2a')](handleError(_0x303f46,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6332b38..8380d6a 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 _0xac45=['../../mysqldb','WhatsappAccount','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x52b9fd,_0x11075b){var _0x20288e=function(_0x80f57f){while(--_0x80f57f){_0x52b9fd['push'](_0x52b9fd['shift']());}};_0x20288e(++_0x11075b);}(_0xac45,0x7d));var _0x5ac4=function(_0x302c4c,_0x579078){_0x302c4c=_0x302c4c-0x0;var _0x1ccc89=_0xac45[_0x302c4c];return _0x1ccc89;};'use strict';var EventEmitter=require(_0x5ac4('0x0'));var WhatsappAccount=require(_0x5ac4('0x1'))['db'][_0x5ac4('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ac4('0x3'),'afterDestroy':_0x5ac4('0x4')};function emitEvent(_0x18e972){return function(_0x19476b,_0x3f832d,_0x50359f){WhatsappAccountEvents[_0x5ac4('0x5')](_0x18e972+':'+_0x19476b['id'],_0x19476b);WhatsappAccountEvents[_0x5ac4('0x5')](_0x18e972,_0x19476b);_0x50359f(null);};}for(var e in events){if(events[_0x5ac4('0x6')](e)){var event=events[e];WhatsappAccount[_0x5ac4('0x7')](e,emitEvent(event));}}module[_0x5ac4('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x939e=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','update'];(function(_0x45582e,_0x29951a){var _0x58bfca=function(_0x1fa0dd){while(--_0x1fa0dd){_0x45582e['push'](_0x45582e['shift']());}};_0x58bfca(++_0x29951a);}(_0x939e,0x17d));var _0xe939=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x939e[_0x2e689d];return _0x540160;};'use strict';var EventEmitter=require(_0xe939('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xe939('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe939('0x2'),'afterDestroy':_0xe939('0x3')};function emitEvent(_0x57cc3a){return function(_0xcebbec,_0x176957,_0x341e3b){WhatsappAccountEvents[_0xe939('0x4')](_0x57cc3a+':'+_0xcebbec['id'],_0xcebbec);WhatsappAccountEvents[_0xe939('0x4')](_0x57cc3a,_0xcebbec);_0x341e3b(null);};}for(var e in events){if(events[_0xe939('0x5')](e)){var event=events[e];WhatsappAccount[_0xe939('0x6')](e,emitEvent(event));}}module[_0xe939('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index c4147d8..981d76b 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 _0x18d5=['moment','bluebird','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x18d5,0x111));var _0x518d=function(_0x30e3b1,_0x1b4297){_0x30e3b1=_0x30e3b1-0x0;var _0x441efa=_0x18d5[_0x30e3b1];return _0x441efa;};'use strict';var _=require(_0x518d('0x0'));var util=require(_0x518d('0x1'));var logger=require(_0x518d('0x2'))('api');var moment=require(_0x518d('0x3'));var BPromise=require(_0x518d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x518d('0x5'));var rimraf=require('rimraf');var config=require(_0x518d('0x6'));var attributes=require(_0x518d('0x7'));module[_0x518d('0x8')]=function(_0x15aac4,_0x541e44){return _0x15aac4[_0x518d('0x9')](_0x518d('0xa'),attributes,{'tableName':_0x518d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd88=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x20fb3c,_0x2b68f0){var _0x3b5f0e=function(_0x1447bd){while(--_0x1447bd){_0x20fb3c['push'](_0x20fb3c['shift']());}};_0x3b5f0e(++_0x2b68f0);}(_0xbd88,0x142));var _0x8bd8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbd88[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x8bd8('0x0'));var util=require(_0x8bd8('0x1'));var logger=require(_0x8bd8('0x2'))(_0x8bd8('0x3'));var moment=require(_0x8bd8('0x4'));var BPromise=require(_0x8bd8('0x5'));var rp=require(_0x8bd8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bd8('0x7'));var config=require(_0x8bd8('0x8'));var attributes=require(_0x8bd8('0x9'));module[_0x8bd8('0xa')]=function(_0x3de2e0,_0x2f0c1f){return _0x3de2e0[_0x8bd8('0xb')](_0x8bd8('0xc'),attributes,{'tableName':_0x8bd8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index f64b349..54aa477 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 _0xd3fd=['request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','include','map','attributes','model','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'];(function(_0x559862,_0x2d66f2){var _0x247c50=function(_0x37e21b){while(--_0x37e21b){_0x559862['push'](_0x559862['shift']());}};_0x247c50(++_0x2d66f2);}(_0xd3fd,0xd7));var _0xdd3f=function(_0x1590f0,_0x202635){_0x1590f0=_0x1590f0-0x0;var _0x5a11a3=_0xd3fd[_0x1590f0];return _0x5a11a3;};'use strict';var _=require(_0xdd3f('0x0'));var util=require(_0xdd3f('0x1'));var moment=require(_0xdd3f('0x2'));var BPromise=require(_0xdd3f('0x3'));var rs=require(_0xdd3f('0x4'));var fs=require('fs');var Redis=require(_0xdd3f('0x5'));var db=require(_0xdd3f('0x6'))['db'];var utils=require(_0xdd3f('0x7'));var logger=require(_0xdd3f('0x8'))(_0xdd3f('0x9'));var config=require(_0xdd3f('0xa'));var jayson=require(_0xdd3f('0xb'));var client=jayson[_0xdd3f('0xc')][_0xdd3f('0xd')]({'port':0x232a});config[_0xdd3f('0xe')]=_[_0xdd3f('0xf')](config[_0xdd3f('0xe')],{'host':_0xdd3f('0x10'),'port':0x18eb});var socket=require(_0xdd3f('0x11'))(new Redis(config[_0xdd3f('0xe')]));require('./whatsappAccount.socket')[_0xdd3f('0x12')](socket);function respondWithRpcPromise(_0x4005a1,_0x26f631,_0x320aad){return new BPromise(function(_0x47c74c,_0xe40ef2){return client[_0xdd3f('0x13')](_0x4005a1,_0x320aad)[_0xdd3f('0x14')](function(_0x2e5b1c){logger[_0xdd3f('0x15')](_0xdd3f('0x16'),_0x26f631,_0xdd3f('0x17'));logger[_0xdd3f('0x18')](_0xdd3f('0x19'),_0x26f631,_0xdd3f('0x17'),JSON[_0xdd3f('0x1a')](_0x2e5b1c));if(_0x2e5b1c[_0xdd3f('0x1b')]){if(_0x2e5b1c[_0xdd3f('0x1b')]['code']===0x1f4){logger['error'](_0xdd3f('0x16'),_0x26f631,_0x2e5b1c[_0xdd3f('0x1b')][_0xdd3f('0x1c')]);return _0xe40ef2(_0x2e5b1c['error'][_0xdd3f('0x1c')]);}logger[_0xdd3f('0x1b')](_0xdd3f('0x16'),_0x26f631,_0x2e5b1c[_0xdd3f('0x1b')]['message']);return _0x47c74c(_0x2e5b1c[_0xdd3f('0x1b')][_0xdd3f('0x1c')]);}else{logger[_0xdd3f('0x15')](_0xdd3f('0x16'),_0x26f631,'request\x20sent');_0x47c74c(_0x2e5b1c[_0xdd3f('0x1d')][_0xdd3f('0x1c')]);}})[_0xdd3f('0x1e')](function(_0x51de5b){logger[_0xdd3f('0x1b')](_0xdd3f('0x16'),_0x26f631,_0x51de5b);_0xe40ef2(_0x51de5b);});});}exports[_0xdd3f('0x1f')]=function(_0x4aeca8){var _0x385d3c=this;return new Promise(function(_0x47e674,_0x3fa4f4){return db[_0xdd3f('0x20')][_0xdd3f('0x21')]({'raw':_0x4aeca8[_0xdd3f('0x22')]?_0x4aeca8[_0xdd3f('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x4aeca8[_0xdd3f('0x22')]?_0x4aeca8['options']['where']||null:null,'attributes':_0x4aeca8[_0xdd3f('0x22')]?_0x4aeca8['options']['attributes']||null:null,'include':_0x4aeca8[_0xdd3f('0x22')]?_0x4aeca8[_0xdd3f('0x22')][_0xdd3f('0x23')]?_[_0xdd3f('0x24')](_0x4aeca8[_0xdd3f('0x22')][_0xdd3f('0x23')],function(_0x1684c2){return{'model':db[_0x1684c2['model']],'as':_0x1684c2['as'],'attributes':_0x1684c2[_0xdd3f('0x25')],'include':_0x1684c2[_0xdd3f('0x23')]?_[_0xdd3f('0x24')](_0x1684c2['include'],function(_0x44e7ef){return{'model':db[_0x44e7ef[_0xdd3f('0x26')]],'as':_0x44e7ef['as'],'attributes':_0x44e7ef[_0xdd3f('0x25')],'include':_0x44e7ef['include']?_[_0xdd3f('0x24')](_0x44e7ef[_0xdd3f('0x23')],function(_0x36abfa){return{'model':db[_0x36abfa[_0xdd3f('0x26')]],'as':_0x36abfa['as'],'attributes':_0x36abfa['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd3f('0x14')](function(_0x51fa38){logger[_0xdd3f('0x15')](_0xdd3f('0x1f'),_0x4aeca8);logger[_0xdd3f('0x18')](_0xdd3f('0x1f'),_0x4aeca8,JSON[_0xdd3f('0x1a')](_0x51fa38));_0x47e674(_0x51fa38);})[_0xdd3f('0x1e')](function(_0x3fc3dd){logger[_0xdd3f('0x1b')]('ShowWhatsappAccount',_0x3fc3dd[_0xdd3f('0x1c')],_0x4aeca8);_0x3fa4f4(_0x385d3c[_0xdd3f('0x1b')](0x1f4,_0x3fc3dd[_0xdd3f('0x1c')]));});});}; \ No newline at end of file +var _0x6528=['map','model','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6528,0x160));var _0x8652=function(_0x482396,_0x2c242b){_0x482396=_0x482396-0x0;var _0x50bc94=_0x6528[_0x482396];return _0x50bc94;};'use strict';var _=require(_0x8652('0x0'));var util=require(_0x8652('0x1'));var moment=require(_0x8652('0x2'));var BPromise=require('bluebird');var rs=require(_0x8652('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8652('0x4'));var logger=require(_0x8652('0x5'))(_0x8652('0x6'));var config=require('../../config/environment');var jayson=require(_0x8652('0x7'));var client=jayson[_0x8652('0x8')][_0x8652('0x9')]({'port':0x232a});config[_0x8652('0xa')]=_['defaults'](config[_0x8652('0xa')],{'host':_0x8652('0xb'),'port':0x18eb});var socket=require(_0x8652('0xc'))(new Redis(config[_0x8652('0xa')]));require(_0x8652('0xd'))['register'](socket);function respondWithRpcPromise(_0x18dd67,_0x374753,_0x15e2ae){return new BPromise(function(_0x1836f1,_0x26fc2d){return client[_0x8652('0xe')](_0x18dd67,_0x15e2ae)[_0x8652('0xf')](function(_0x2afa1b){logger[_0x8652('0x10')](_0x8652('0x11'),_0x374753,_0x8652('0x12'));logger['debug'](_0x8652('0x13'),_0x374753,_0x8652('0x12'),JSON[_0x8652('0x14')](_0x2afa1b));if(_0x2afa1b[_0x8652('0x15')]){if(_0x2afa1b['error'][_0x8652('0x16')]===0x1f4){logger[_0x8652('0x15')](_0x8652('0x11'),_0x374753,_0x2afa1b['error'][_0x8652('0x17')]);return _0x26fc2d(_0x2afa1b[_0x8652('0x15')][_0x8652('0x17')]);}logger[_0x8652('0x15')](_0x8652('0x11'),_0x374753,_0x2afa1b[_0x8652('0x15')][_0x8652('0x17')]);return _0x1836f1(_0x2afa1b[_0x8652('0x15')][_0x8652('0x17')]);}else{logger[_0x8652('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x374753,_0x8652('0x12'));_0x1836f1(_0x2afa1b[_0x8652('0x18')][_0x8652('0x17')]);}})[_0x8652('0x19')](function(_0x2e177b){logger[_0x8652('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x374753,_0x2e177b);_0x26fc2d(_0x2e177b);});});}exports[_0x8652('0x1a')]=function(_0x557e45){var _0x2bdfa6=this;return new Promise(function(_0x3e62a9,_0x287f1a){return db[_0x8652('0x1b')][_0x8652('0x1c')]({'raw':_0x557e45[_0x8652('0x1d')]?_0x557e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x557e45[_0x8652('0x1d')]?_0x557e45[_0x8652('0x1d')][_0x8652('0x1e')]||null:null,'attributes':_0x557e45[_0x8652('0x1d')]?_0x557e45[_0x8652('0x1d')][_0x8652('0x1f')]||null:null,'include':_0x557e45[_0x8652('0x1d')]?_0x557e45[_0x8652('0x1d')][_0x8652('0x20')]?_[_0x8652('0x21')](_0x557e45[_0x8652('0x1d')][_0x8652('0x20')],function(_0x551b0f){return{'model':db[_0x551b0f['model']],'as':_0x551b0f['as'],'attributes':_0x551b0f[_0x8652('0x1f')],'include':_0x551b0f['include']?_[_0x8652('0x21')](_0x551b0f[_0x8652('0x20')],function(_0x5b9f1d){return{'model':db[_0x5b9f1d['model']],'as':_0x5b9f1d['as'],'attributes':_0x5b9f1d['attributes'],'include':_0x5b9f1d[_0x8652('0x20')]?_['map'](_0x5b9f1d[_0x8652('0x20')],function(_0x2ac48d){return{'model':db[_0x2ac48d[_0x8652('0x22')]],'as':_0x2ac48d['as'],'attributes':_0x2ac48d[_0x8652('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c122d){logger['info'](_0x8652('0x1a'),_0x557e45);logger['debug'](_0x8652('0x1a'),_0x557e45,JSON[_0x8652('0x14')](_0x5c122d));_0x3e62a9(_0x5c122d);})[_0x8652('0x19')](function(_0x407113){logger['error'](_0x8652('0x1a'),_0x407113[_0x8652('0x17')],_0x557e45);_0x287f1a(_0x2bdfa6['error'](0x1f4,_0x407113[_0x8652('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 52701b0..2cfc6e4 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 _0x6a51=['length','whatsappAccount:','./whatsappAccount.events','remove','update','emit','removeListener','register'];(function(_0x4fee31,_0x6905e3){var _0x27d650=function(_0x583e4e){while(--_0x583e4e){_0x4fee31['push'](_0x4fee31['shift']());}};_0x27d650(++_0x6905e3);}(_0x6a51,0x102));var _0x16a5=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0x6a51[_0x74745d];return _0x174ab3;};'use strict';var WhatsappAccountEvents=require(_0x16a5('0x0'));var events=['save',_0x16a5('0x1'),_0x16a5('0x2')];function createListener(_0xcaf5eb,_0x7331fe){return function(_0x47ddc7){_0x7331fe[_0x16a5('0x3')](_0xcaf5eb,_0x47ddc7);};}function removeListener(_0xc7e01,_0x173a4d){return function(){WhatsappAccountEvents[_0x16a5('0x4')](_0xc7e01,_0x173a4d);};}exports[_0x16a5('0x5')]=function(_0x18dd84){for(var _0x5a24a0=0x0,_0x230143=events[_0x16a5('0x6')];_0x5a24a0<_0x230143;_0x5a24a0++){var _0x50a1ec=events[_0x5a24a0];var _0xc1b67=createListener(_0x16a5('0x7')+_0x50a1ec,_0x18dd84);WhatsappAccountEvents['on'](_0x50a1ec,_0xc1b67);}}; \ No newline at end of file +var _0xbba7=['register','length','whatsappAccount:','./whatsappAccount.events','update','emit'];(function(_0x5362c6,_0x51167b){var _0x50e498=function(_0x40832f){while(--_0x40832f){_0x5362c6['push'](_0x5362c6['shift']());}};_0x50e498(++_0x51167b);}(_0xbba7,0x1a7));var _0x7bba=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0xbba7[_0x11e001];return _0x417419;};'use strict';var WhatsappAccountEvents=require(_0x7bba('0x0'));var events=['save','remove',_0x7bba('0x1')];function createListener(_0x2d8583,_0xee9288){return function(_0x39ae4d){_0xee9288[_0x7bba('0x2')](_0x2d8583,_0x39ae4d);};}function removeListener(_0x6d3e67,_0x274369){return function(){WhatsappAccountEvents['removeListener'](_0x6d3e67,_0x274369);};}exports[_0x7bba('0x3')]=function(_0x282b06){for(var _0x3154b0=0x0,_0x2ac7c4=events[_0x7bba('0x4')];_0x3154b0<_0x2ac7c4;_0x3154b0++){var _0x3d23a7=events[_0x3154b0];var _0x582e0a=createListener(_0x7bba('0x5')+_0x3d23a7,_0x282b06);WhatsappAccountEvents['on'](_0x3d23a7,_0x582e0a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 0abeb6c..4351d1d 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 _0x458d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put','update','destroy','exports'];(function(_0x329808,_0x343255){var _0x1bbad0=function(_0x458c5b){while(--_0x458c5b){_0x329808['push'](_0x329808['shift']());}};_0x1bbad0(++_0x343255);}(_0x458d,0xee));var _0xd458=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x458d[_0x2ec461];return _0x28603d;};'use strict';var multer=require('multer');var util=require(_0xd458('0x0'));var path=require(_0xd458('0x1'));var timeout=require(_0xd458('0x2'));var express=require(_0xd458('0x3'));var router=express['Router']();var fs_extra=require(_0xd458('0x4'));var auth=require(_0xd458('0x5'));var interaction=require(_0xd458('0x6'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xd458('0x7')](),controller[_0xd458('0x8')]);router[_0xd458('0x9')](_0xd458('0xa'),auth[_0xd458('0x7')](),controller[_0xd458('0xb')]);router['post']('/',auth[_0xd458('0x7')](),controller[_0xd458('0xc')]);router[_0xd458('0xd')]('/:id',auth[_0xd458('0x7')](),controller[_0xd458('0xe')]);router['delete'](_0xd458('0xa'),auth[_0xd458('0x7')](),controller[_0xd458('0xf')]);module[_0xd458('0x10')]=router; \ No newline at end of file +var _0xd80d=['./whatsappApplication.controller','isAuthenticated','index','/:id','show','put','update','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd80d,0x159));var _0xdd80=function(_0x28b4dd,_0x57de01){_0x28b4dd=_0x28b4dd-0x0;var _0x1f8883=_0xd80d[_0x28b4dd];return _0x1f8883;};'use strict';var multer=require(_0xdd80('0x0'));var util=require(_0xdd80('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd80('0x2')]();var fs_extra=require(_0xdd80('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdd80('0x4'));var config=require(_0xdd80('0x5'));var controller=require(_0xdd80('0x6'));router['get']('/',auth[_0xdd80('0x7')](),controller[_0xdd80('0x8')]);router['get'](_0xdd80('0x9'),auth['isAuthenticated'](),controller[_0xdd80('0xa')]);router['post']('/',auth[_0xdd80('0x7')](),controller['create']);router[_0xdd80('0xb')](_0xdd80('0x9'),auth[_0xdd80('0x7')](),controller[_0xdd80('0xc')]);router['delete'](_0xdd80('0x9'),auth[_0xdd80('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d9da240..b162b16 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 _0x4d7e=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x54f546,_0x13c072){var _0x2b6234=function(_0x6556de){while(--_0x6556de){_0x54f546['push'](_0x54f546['shift']());}};_0x2b6234(++_0x13c072);}(_0x4d7e,0x14e));var _0xe4d7=function(_0x2b70f8,_0x361789){_0x2b70f8=_0x2b70f8-0x0;var _0x2f741e=_0x4d7e[_0x2b70f8];return _0x2f741e;};'use strict';var Sequelize=require(_0xe4d7('0x0'));module[_0xe4d7('0x1')]={'priority':{'type':Sequelize[_0xe4d7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe4d7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe4d7('0x4')]()},'description':{'type':Sequelize[_0xe4d7('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe4d7('0x5')}}; \ No newline at end of file +var _0x5520=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x2aeadf,_0x5ee7d7){var _0x395577=function(_0x5b4377){while(--_0x5b4377){_0x2aeadf['push'](_0x2aeadf['shift']());}};_0x395577(++_0x5ee7d7);}(_0x5520,0xe9));var _0x0552=function(_0x335f64,_0x2d304b){_0x335f64=_0x335f64-0x0;var _0x3df65b=_0x5520[_0x335f64];return _0x3df65b;};'use strict';var Sequelize=require(_0x0552('0x0'));module[_0x0552('0x1')]={'priority':{'type':Sequelize[_0x0552('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0552('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0552('0x4')]()},'description':{'type':Sequelize[_0x0552('0x3')]},'interval':{'type':Sequelize[_0x0552('0x3')],'defaultValue':_0x0552('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index abb2449..ea578b9 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 _0xafcd=['then','destroy','end','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','include','WhatsappApplication','findAll','rows','show','params','fields','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject'];(function(_0x567f7c,_0x2d1fb8){var _0x55d3e6=function(_0x5d7bfc){while(--_0x5d7bfc){_0x567f7c['push'](_0x567f7c['shift']());}};_0x55d3e6(++_0x2d1fb8);}(_0xafcd,0x157));var _0xdafc=function(_0x770c67,_0x1ea22b){_0x770c67=_0x770c67-0x0;var _0x2bdbbe=_0xafcd[_0x770c67];return _0x2bdbbe;};'use strict';var emlformat=require(_0xdafc('0x0'));var rimraf=require(_0xdafc('0x1'));var zipdir=require(_0xdafc('0x2'));var jsonpatch=require(_0xdafc('0x3'));var rp=require(_0xdafc('0x4'));var moment=require(_0xdafc('0x5'));var BPromise=require(_0xdafc('0x6'));var Mustache=require('mustache');var util=require(_0xdafc('0x7'));var path=require(_0xdafc('0x8'));var sox=require(_0xdafc('0x9'));var csv=require('to-csv');var ejs=require(_0xdafc('0xa'));var fs=require('fs');var fs_extra=require(_0xdafc('0xb'));var _=require(_0xdafc('0xc'));var squel=require('squel');var crypto=require(_0xdafc('0xd'));var jsforce=require(_0xdafc('0xe'));var deskjs=require(_0xdafc('0xf'));var toCsv=require(_0xdafc('0x10'));var querystring=require(_0xdafc('0x11'));var Papa=require(_0xdafc('0x12'));var Redis=require(_0xdafc('0x13'));var authService=require(_0xdafc('0x14'));var qs=require(_0xdafc('0x15'));var as=require(_0xdafc('0x16'));var hardwareService=require(_0xdafc('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xdafc('0x18'));var config=require(_0xdafc('0x19'));var licenseUtil=require(_0xdafc('0x1a'));var db=require(_0xdafc('0x1b'))['db'];function respondWithStatusCode(_0x125f12,_0x57e418){_0x57e418=_0x57e418||0xcc;return function(_0x4b7efe){if(_0x4b7efe){return _0x125f12['sendStatus'](_0x57e418);}return _0x125f12[_0xdafc('0x1c')](_0x57e418)['end']();};}function respondWithResult(_0x17503a,_0x4fa5b3){_0x4fa5b3=_0x4fa5b3||0xc8;return function(_0x35eaac){if(_0x35eaac){return _0x17503a[_0xdafc('0x1c')](_0x4fa5b3)[_0xdafc('0x1d')](_0x35eaac);}};}function respondWithFilteredResult(_0x144e56,_0x4b7158){return function(_0x540bf9){if(_0x540bf9){var _0x16ea99=typeof _0x4b7158[_0xdafc('0x1e')]===_0xdafc('0x1f')&&typeof _0x4b7158['limit']==='undefined';var _0x2cc922=_0x540bf9[_0xdafc('0x20')];var _0xdab843=_0x16ea99?0x0:_0x4b7158[_0xdafc('0x1e')];var _0x17136e=_0x16ea99?_0x540bf9[_0xdafc('0x20')]:_0x4b7158[_0xdafc('0x1e')]+_0x4b7158[_0xdafc('0x21')];var _0x58ca4d;if(_0x17136e>=_0x2cc922){_0x17136e=_0x2cc922;_0x58ca4d=0xc8;}else{_0x58ca4d=0xce;}_0x144e56[_0xdafc('0x1c')](_0x58ca4d);return _0x144e56[_0xdafc('0x22')]('Content-Range',_0xdab843+'-'+_0x17136e+'/'+_0x2cc922)[_0xdafc('0x1d')](_0x540bf9);}return null;};}function patchUpdates(_0xb825df){return function(_0x27d784){try{jsonpatch[_0xdafc('0x23')](_0x27d784,_0xb825df,!![]);}catch(_0x44f8f8){return BPromise[_0xdafc('0x24')](_0x44f8f8);}return _0x27d784['save']();};}function saveUpdates(_0x50a8d8,_0x59af2e){return function(_0x467f8b){if(_0x467f8b){return _0x467f8b['update'](_0x50a8d8)[_0xdafc('0x25')](function(_0x2bf00a){return _0x2bf00a;});}return null;};}function removeEntity(_0x6c6e4c,_0x17c2f6){return function(_0x5be20a){if(_0x5be20a){return _0x5be20a[_0xdafc('0x26')]()[_0xdafc('0x25')](function(){_0x6c6e4c['status'](0xcc)[_0xdafc('0x27')]();});}};}function handleEntityNotFound(_0x320aec,_0x3131e4){return function(_0x3d3f06){if(!_0x3d3f06){_0x320aec[_0xdafc('0x28')](0x194);}return _0x3d3f06;};}function handleError(_0x181418,_0x3399ec){_0x3399ec=_0x3399ec||0x1f4;return function(_0x4a98c5){logger[_0xdafc('0x29')](_0x4a98c5[_0xdafc('0x2a')]);if(_0x4a98c5['name']){delete _0x4a98c5[_0xdafc('0x2b')];}_0x181418['status'](_0x3399ec)['send'](_0x4a98c5);};}exports[_0xdafc('0x2c')]=function(_0x56a820,_0x2fbc2b){var _0xf9803e={},_0x5d62e1={},_0x2752bd={'count':0x0,'rows':[]};var _0x56e096=_['map'](db['WhatsappApplication'][_0xdafc('0x2d')],function(_0x10533c){return{'name':_0x10533c[_0xdafc('0x2e')],'type':_0x10533c[_0xdafc('0x2f')][_0xdafc('0x30')]};});_0x5d62e1[_0xdafc('0x31')]=_[_0xdafc('0x32')](_0x56e096,'name');_0x5d62e1[_0xdafc('0x33')]=_[_0xdafc('0x34')](_0x56a820['query']);_0x5d62e1['filters']=_[_0xdafc('0x35')](_0x5d62e1[_0xdafc('0x31')],_0x5d62e1['query']);_0xf9803e['attributes']=_[_0xdafc('0x35')](_0x5d62e1[_0xdafc('0x31')],qs['fields'](_0x56a820['query']['fields']));_0xf9803e['attributes']=_0xf9803e[_0xdafc('0x36')]['length']?_0xf9803e[_0xdafc('0x36')]:_0x5d62e1[_0xdafc('0x31')];if(!_0x56a820[_0xdafc('0x33')][_0xdafc('0x37')]('nolimit')){_0xf9803e[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x56a820[_0xdafc('0x33')][_0xdafc('0x21')]);_0xf9803e[_0xdafc('0x1e')]=qs[_0xdafc('0x1e')](_0x56a820['query'][_0xdafc('0x1e')]);}_0xf9803e[_0xdafc('0x38')]=qs[_0xdafc('0x39')](_0x56a820['query'][_0xdafc('0x39')]);_0xf9803e['where']=qs[_0xdafc('0x3a')](_['pick'](_0x56a820[_0xdafc('0x33')],_0x5d62e1[_0xdafc('0x3a')]),_0x56e096);if(_0x56a820[_0xdafc('0x33')][_0xdafc('0x3b')]){_0xf9803e[_0xdafc('0x3c')]=_[_0xdafc('0x3d')](_0xf9803e[_0xdafc('0x3c')],{'$or':_['map'](_0x56e096,function(_0x45b084){if(_0x45b084['type']!==_0xdafc('0x3e')){var _0x17c9d4={};_0x17c9d4[_0x45b084[_0xdafc('0x2b')]]={'$like':'%'+_0x56a820['query']['filter']+'%'};return _0x17c9d4;}})});}_0xf9803e=_[_0xdafc('0x3d')]({},_0xf9803e,_0x56a820[_0xdafc('0x3f')]);var _0x4e95e1={'where':_0xf9803e[_0xdafc('0x3c')]};return db['WhatsappApplication'][_0xdafc('0x20')](_0x4e95e1)[_0xdafc('0x25')](function(_0x2a1b85){_0x2752bd['count']=_0x2a1b85;if(_0x56a820['query']['includeAll']){_0xf9803e[_0xdafc('0x40')]=[{'all':!![]}];}return db[_0xdafc('0x41')][_0xdafc('0x42')](_0xf9803e);})[_0xdafc('0x25')](function(_0x48236b){_0x2752bd[_0xdafc('0x43')]=_0x48236b;return _0x2752bd;})[_0xdafc('0x25')](respondWithFilteredResult(_0x2fbc2b,_0xf9803e))['catch'](handleError(_0x2fbc2b,null));};exports[_0xdafc('0x44')]=function(_0x5784c4,_0x52834d){var _0x1ae324={'raw':!![],'where':{'id':_0x5784c4[_0xdafc('0x45')]['id']}},_0x3d0f00={};_0x3d0f00['model']=_[_0xdafc('0x34')](db[_0xdafc('0x41')]['rawAttributes']);_0x3d0f00[_0xdafc('0x33')]=_[_0xdafc('0x34')](_0x5784c4[_0xdafc('0x33')]);_0x3d0f00[_0xdafc('0x3a')]=_[_0xdafc('0x35')](_0x3d0f00[_0xdafc('0x31')],_0x3d0f00[_0xdafc('0x33')]);_0x1ae324[_0xdafc('0x36')]=_[_0xdafc('0x35')](_0x3d0f00[_0xdafc('0x31')],qs['fields'](_0x5784c4[_0xdafc('0x33')][_0xdafc('0x46')]));_0x1ae324[_0xdafc('0x36')]=_0x1ae324[_0xdafc('0x36')][_0xdafc('0x47')]?_0x1ae324['attributes']:_0x3d0f00[_0xdafc('0x31')];if(_0x5784c4[_0xdafc('0x33')]['includeAll']){_0x1ae324[_0xdafc('0x40')]=[{'all':!![]}];}_0x1ae324=_['merge']({},_0x1ae324,_0x5784c4[_0xdafc('0x3f')]);return db['WhatsappApplication'][_0xdafc('0x48')](_0x1ae324)[_0xdafc('0x25')](handleEntityNotFound(_0x52834d,null))[_0xdafc('0x25')](respondWithResult(_0x52834d,null))[_0xdafc('0x49')](handleError(_0x52834d,null));};exports['create']=function(_0x3a2360,_0x339008){return db[_0xdafc('0x41')][_0xdafc('0x4a')](_0x3a2360['body'],{})[_0xdafc('0x25')](respondWithResult(_0x339008,0xc9))[_0xdafc('0x49')](handleError(_0x339008,null));};exports['update']=function(_0x5a1484,_0x1b6485){if(_0x5a1484[_0xdafc('0x4b')]['id']){delete _0x5a1484[_0xdafc('0x4b')]['id'];}return db[_0xdafc('0x41')]['find']({'where':{'id':_0x5a1484[_0xdafc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b6485,null))[_0xdafc('0x25')](saveUpdates(_0x5a1484['body'],null))[_0xdafc('0x25')](respondWithResult(_0x1b6485,null))['catch'](handleError(_0x1b6485,null));};exports[_0xdafc('0x26')]=function(_0x4df787,_0x54ae3e){return db[_0xdafc('0x41')][_0xdafc('0x48')]({'where':{'id':_0x4df787[_0xdafc('0x45')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x54ae3e,null))[_0xdafc('0x25')](removeEntity(_0x54ae3e,null))[_0xdafc('0x49')](handleError(_0x54ae3e,null));}; \ No newline at end of file +var _0x8ed7=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','WhatsappApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','update','body','rimraf','zip-dir','fast-json-patch'];(function(_0x2fe85a,_0x28c346){var _0x468e0f=function(_0x515887){while(--_0x515887){_0x2fe85a['push'](_0x2fe85a['shift']());}};_0x468e0f(++_0x28c346);}(_0x8ed7,0x8b));var _0x78ed=function(_0x367927,_0x450a5d){_0x367927=_0x367927-0x0;var _0x142e2f=_0x8ed7[_0x367927];return _0x142e2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78ed('0x0'));var zipdir=require(_0x78ed('0x1'));var jsonpatch=require(_0x78ed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78ed('0x3'));var Mustache=require(_0x78ed('0x4'));var util=require(_0x78ed('0x5'));var path=require(_0x78ed('0x6'));var sox=require(_0x78ed('0x7'));var csv=require(_0x78ed('0x8'));var ejs=require(_0x78ed('0x9'));var fs=require('fs');var fs_extra=require(_0x78ed('0xa'));var _=require(_0x78ed('0xb'));var squel=require('squel');var crypto=require(_0x78ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x78ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ed('0xf'));var qs=require(_0x78ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ed('0x11'));var logger=require(_0x78ed('0x12'))('api');var utils=require(_0x78ed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78ed('0x14'));var db=require(_0x78ed('0x15'))['db'];function respondWithStatusCode(_0x3ec02d,_0x2cb17b){_0x2cb17b=_0x2cb17b||0xcc;return function(_0x1a5254){if(_0x1a5254){return _0x3ec02d[_0x78ed('0x16')](_0x2cb17b);}return _0x3ec02d['status'](_0x2cb17b)[_0x78ed('0x17')]();};}function respondWithResult(_0x4b97ba,_0x538306){_0x538306=_0x538306||0xc8;return function(_0x510322){if(_0x510322){return _0x4b97ba['status'](_0x538306)['json'](_0x510322);}};}function respondWithFilteredResult(_0x2e88ad,_0x272171){return function(_0x2e9007){if(_0x2e9007){var _0x195b7e=typeof _0x272171[_0x78ed('0x18')]===_0x78ed('0x19')&&typeof _0x272171[_0x78ed('0x1a')]===_0x78ed('0x19');var _0x17d0d6=_0x2e9007[_0x78ed('0x1b')];var _0x2dd98c=_0x195b7e?0x0:_0x272171['offset'];var _0x2f442b=_0x195b7e?_0x2e9007[_0x78ed('0x1b')]:_0x272171['offset']+_0x272171['limit'];var _0x2868d1;if(_0x2f442b>=_0x17d0d6){_0x2f442b=_0x17d0d6;_0x2868d1=0xc8;}else{_0x2868d1=0xce;}_0x2e88ad[_0x78ed('0x1c')](_0x2868d1);return _0x2e88ad[_0x78ed('0x1d')](_0x78ed('0x1e'),_0x2dd98c+'-'+_0x2f442b+'/'+_0x17d0d6)[_0x78ed('0x1f')](_0x2e9007);}return null;};}function patchUpdates(_0x3bd736){return function(_0x3479ec){try{jsonpatch[_0x78ed('0x20')](_0x3479ec,_0x3bd736,!![]);}catch(_0x376076){return BPromise[_0x78ed('0x21')](_0x376076);}return _0x3479ec[_0x78ed('0x22')]();};}function saveUpdates(_0x4f1edb,_0x5ee188){return function(_0x425310){if(_0x425310){return _0x425310['update'](_0x4f1edb)[_0x78ed('0x23')](function(_0x55f0e8){return _0x55f0e8;});}return null;};}function removeEntity(_0x4675d3,_0x590d90){return function(_0x2af200){if(_0x2af200){return _0x2af200[_0x78ed('0x24')]()[_0x78ed('0x23')](function(){_0x4675d3['status'](0xcc)[_0x78ed('0x17')]();});}};}function handleEntityNotFound(_0x5a8b87,_0x137c7c){return function(_0x2a4573){if(!_0x2a4573){_0x5a8b87[_0x78ed('0x16')](0x194);}return _0x2a4573;};}function handleError(_0x59349a,_0x5abe1b){_0x5abe1b=_0x5abe1b||0x1f4;return function(_0x464050){logger['error'](_0x464050[_0x78ed('0x25')]);if(_0x464050['name']){delete _0x464050[_0x78ed('0x26')];}_0x59349a[_0x78ed('0x1c')](_0x5abe1b)[_0x78ed('0x27')](_0x464050);};}exports[_0x78ed('0x28')]=function(_0xafc1cf,_0x624bb1){var _0x3cd100={},_0x312801={},_0x10ea7d={'count':0x0,'rows':[]};var _0x4f6cdd=_[_0x78ed('0x29')](db[_0x78ed('0x2a')][_0x78ed('0x2b')],function(_0x1afab4){return{'name':_0x1afab4['fieldName'],'type':_0x1afab4['type']['key']};});_0x312801['model']=_[_0x78ed('0x29')](_0x4f6cdd,_0x78ed('0x26'));_0x312801[_0x78ed('0x2c')]=_[_0x78ed('0x2d')](_0xafc1cf[_0x78ed('0x2c')]);_0x312801[_0x78ed('0x2e')]=_[_0x78ed('0x2f')](_0x312801['model'],_0x312801[_0x78ed('0x2c')]);_0x3cd100['attributes']=_[_0x78ed('0x2f')](_0x312801[_0x78ed('0x30')],qs['fields'](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x31')]));_0x3cd100[_0x78ed('0x32')]=_0x3cd100[_0x78ed('0x32')][_0x78ed('0x33')]?_0x3cd100[_0x78ed('0x32')]:_0x312801[_0x78ed('0x30')];if(!_0xafc1cf[_0x78ed('0x2c')]['hasOwnProperty'](_0x78ed('0x34'))){_0x3cd100['limit']=qs[_0x78ed('0x1a')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x1a')]);_0x3cd100[_0x78ed('0x18')]=qs[_0x78ed('0x18')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x18')]);}_0x3cd100['order']=qs[_0x78ed('0x35')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x35')]);_0x3cd100[_0x78ed('0x36')]=qs[_0x78ed('0x2e')](_[_0x78ed('0x37')](_0xafc1cf[_0x78ed('0x2c')],_0x312801[_0x78ed('0x2e')]),_0x4f6cdd);if(_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x38')]){_0x3cd100[_0x78ed('0x36')]=_['merge'](_0x3cd100['where'],{'$or':_[_0x78ed('0x29')](_0x4f6cdd,function(_0x4a7506){if(_0x4a7506[_0x78ed('0x39')]!==_0x78ed('0x3a')){var _0x4edc9c={};_0x4edc9c[_0x4a7506[_0x78ed('0x26')]]={'$like':'%'+_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x38')]+'%'};return _0x4edc9c;}})});}_0x3cd100=_[_0x78ed('0x3b')]({},_0x3cd100,_0xafc1cf[_0x78ed('0x3c')]);var _0x37c26d={'where':_0x3cd100['where']};return db[_0x78ed('0x2a')][_0x78ed('0x1b')](_0x37c26d)[_0x78ed('0x23')](function(_0x2323de){_0x10ea7d['count']=_0x2323de;if(_0xafc1cf['query'][_0x78ed('0x3d')]){_0x3cd100[_0x78ed('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x78ed('0x3f')](_0x3cd100);})[_0x78ed('0x23')](function(_0x48629a){_0x10ea7d['rows']=_0x48629a;return _0x10ea7d;})[_0x78ed('0x23')](respondWithFilteredResult(_0x624bb1,_0x3cd100))[_0x78ed('0x40')](handleError(_0x624bb1,null));};exports[_0x78ed('0x41')]=function(_0x37e5de,_0x58177d){var _0x5c42fe={'raw':!![],'where':{'id':_0x37e5de[_0x78ed('0x42')]['id']}},_0x4ebdd6={};_0x4ebdd6['model']=_[_0x78ed('0x2d')](db['WhatsappApplication'][_0x78ed('0x2b')]);_0x4ebdd6[_0x78ed('0x2c')]=_[_0x78ed('0x2d')](_0x37e5de[_0x78ed('0x2c')]);_0x4ebdd6[_0x78ed('0x2e')]=_['intersection'](_0x4ebdd6[_0x78ed('0x30')],_0x4ebdd6[_0x78ed('0x2c')]);_0x5c42fe[_0x78ed('0x32')]=_[_0x78ed('0x2f')](_0x4ebdd6[_0x78ed('0x30')],qs['fields'](_0x37e5de['query'][_0x78ed('0x31')]));_0x5c42fe[_0x78ed('0x32')]=_0x5c42fe[_0x78ed('0x32')][_0x78ed('0x33')]?_0x5c42fe['attributes']:_0x4ebdd6[_0x78ed('0x30')];if(_0x37e5de[_0x78ed('0x2c')][_0x78ed('0x3d')]){_0x5c42fe[_0x78ed('0x3e')]=[{'all':!![]}];}_0x5c42fe=_[_0x78ed('0x3b')]({},_0x5c42fe,_0x37e5de[_0x78ed('0x3c')]);return db['WhatsappApplication'][_0x78ed('0x43')](_0x5c42fe)['then'](handleEntityNotFound(_0x58177d,null))[_0x78ed('0x23')](respondWithResult(_0x58177d,null))['catch'](handleError(_0x58177d,null));};exports[_0x78ed('0x44')]=function(_0x2a164e,_0x1020d9){return db[_0x78ed('0x2a')][_0x78ed('0x44')](_0x2a164e['body'],{})['then'](respondWithResult(_0x1020d9,0xc9))[_0x78ed('0x40')](handleError(_0x1020d9,null));};exports[_0x78ed('0x45')]=function(_0x39da99,_0x4c68f1){if(_0x39da99[_0x78ed('0x46')]['id']){delete _0x39da99[_0x78ed('0x46')]['id'];}return db[_0x78ed('0x2a')]['find']({'where':{'id':_0x39da99['params']['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x4c68f1,null))['then'](saveUpdates(_0x39da99[_0x78ed('0x46')],null))[_0x78ed('0x23')](respondWithResult(_0x4c68f1,null))['catch'](handleError(_0x4c68f1,null));};exports['destroy']=function(_0xd8fb3d,_0x192061){return db[_0x78ed('0x2a')][_0x78ed('0x43')]({'where':{'id':_0xd8fb3d[_0x78ed('0x42')]['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x192061,null))[_0x78ed('0x23')](removeEntity(_0x192061,null))[_0x78ed('0x40')](handleError(_0x192061,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7fce5e6..44ed923 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 _0x7119=['api','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x23a60e,_0x4d12bc){var _0x671997=function(_0x3996c5){while(--_0x3996c5){_0x23a60e['push'](_0x23a60e['shift']());}};_0x671997(++_0x4d12bc);}(_0x7119,0x1c7));var _0x9711=function(_0x2b012b,_0x463e28){_0x2b012b=_0x2b012b-0x0;var _0x32c4cf=_0x7119[_0x2b012b];return _0x32c4cf;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var logger=require('../../config/logger')(_0x9711('0x1'));var moment=require('moment');var BPromise=require(_0x9711('0x2'));var rp=require(_0x9711('0x3'));var fs=require('fs');var path=require(_0x9711('0x4'));var rimraf=require(_0x9711('0x5'));var config=require('../../config/environment');var attributes=require(_0x9711('0x6'));module[_0x9711('0x7')]=function(_0x2ffe6c,_0x101827){return _0x2ffe6c[_0x9711('0x8')]('WhatsappApplication',attributes,{'tableName':_0x9711('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9711('0xa'),'collate':_0x9711('0xb')});}; \ No newline at end of file +var _0x44ae=['WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x1bc370,_0x95b8e1){var _0x2368d0=function(_0x30d664){while(--_0x30d664){_0x1bc370['push'](_0x1bc370['shift']());}};_0x2368d0(++_0x95b8e1);}(_0x44ae,0x17d));var _0xe44a=function(_0x584e52,_0x5443dc){_0x584e52=_0x584e52-0x0;var _0x5cf710=_0x44ae[_0x584e52];return _0x5cf710;};'use strict';var _=require(_0xe44a('0x0'));var util=require(_0xe44a('0x1'));var logger=require(_0xe44a('0x2'))(_0xe44a('0x3'));var moment=require('moment');var BPromise=require(_0xe44a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe44a('0x5'));var rimraf=require(_0xe44a('0x6'));var config=require(_0xe44a('0x7'));var attributes=require(_0xe44a('0x8'));module[_0xe44a('0x9')]=function(_0x3f9763,_0x5c1c49){return _0x3f9763[_0xe44a('0xa')](_0xe44a('0xb'),attributes,{'tableName':_0xe44a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe44a('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2d544c0..2b27c70 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7a8f2e,_0x5e78b7){var _0x407f36=function(_0x13fb08){while(--_0x13fb08){_0x7a8f2e['push'](_0x7a8f2e['shift']());}};_0x407f36(++_0x5e78b7);}(_0xac9d,0x14d));var _0xdac9=function(_0x581e1d,_0x1ed7d4){_0x581e1d=_0x581e1d-0x0;var _0x39965b=_0xac9d[_0x581e1d];return _0x39965b;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x33f557,_0x12b78d){var _0x3514a6=function(_0x3925e7){while(--_0x3925e7){_0x33f557['push'](_0x33f557['shift']());}};_0x3514a6(++_0x12b78d);}(_0x207c,0x1e8));var _0xc207=function(_0x40dcd1,_0x5cd1da){_0x40dcd1=_0x40dcd1-0x0;var _0x5c056b=_0x207c[_0x40dcd1];return _0x5c056b;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a9b9a40..80ec165 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 _0xfd2e=['get','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','isAuthenticated'];(function(_0x1ce198,_0x491829){var _0x4d66df=function(_0x59ae17){while(--_0x59ae17){_0x1ce198['push'](_0x1ce198['shift']());}};_0x4d66df(++_0x491829);}(_0xfd2e,0x6e));var _0xefd2=function(_0x594efa,_0x36318c){_0x594efa=_0x594efa-0x0;var _0x107191=_0xfd2e[_0x594efa];return _0x107191;};'use strict';var multer=require(_0xefd2('0x0'));var util=require('util');var path=require(_0xefd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xefd2('0x2'));var router=express['Router']();var fs_extra=require(_0xefd2('0x3'));var auth=require(_0xefd2('0x4'));var interaction=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var controller=require(_0xefd2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xefd2('0x8')]);router['get']('/describe',auth[_0xefd2('0x9')](),controller['describe']);router[_0xefd2('0xa')](_0xefd2('0xb'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xc')]);router[_0xefd2('0xa')](_0xefd2('0xd'),auth[_0xefd2('0x9')](),controller['getMessages']);router[_0xefd2('0xa')](_0xefd2('0xe'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xf')]);router[_0xefd2('0x10')]('/',auth[_0xefd2('0x9')](),controller[_0xefd2('0x11')]);router[_0xefd2('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0xefd2('0x12')]);router['post']('/:id/tags',auth[_0xefd2('0x9')](),interaction[_0xefd2('0x13')](_0xefd2('0x14'),_0xefd2('0x15')),controller[_0xefd2('0x16')]);router['put'](_0xefd2('0xb'),auth[_0xefd2('0x9')](),interaction[_0xefd2('0x13')](_0xefd2('0x14'),_0xefd2('0x17')),controller[_0xefd2('0x18')]);router['delete']('/:id',auth[_0xefd2('0x9')](),interaction[_0xefd2('0x13')](_0xefd2('0x14'),_0xefd2('0x19')),controller[_0xefd2('0x1a')]);router['delete'](_0xefd2('0x1b'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x1c')]);module[_0xefd2('0x1d')]=router; \ No newline at end of file +var _0xc359=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express'];(function(_0x25663b,_0x2386ae){var _0x425c4f=function(_0x7430b8){while(--_0x7430b8){_0x25663b['push'](_0x25663b['shift']());}};_0x425c4f(++_0x2386ae);}(_0xc359,0x1d9));var _0x9c35=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xc359[_0x590851];return _0x3b0115;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x9c35('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9c35('0x7')](),controller[_0x9c35('0x8')]);router[_0x9c35('0x6')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xa')]);router['get'](_0x9c35('0xb'),auth[_0x9c35('0x7')](),controller['getMessages']);router['get']('/:id/download',auth[_0x9c35('0x7')](),controller['download']);router[_0x9c35('0xc')]('/',auth[_0x9c35('0x7')](),controller[_0x9c35('0xd')]);router['post'](_0x9c35('0xb'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xe')]);router[_0x9c35('0xc')](_0x9c35('0xf'),auth['isAuthenticated'](),interaction[_0x9c35('0x10')](_0x9c35('0x11'),_0x9c35('0x12')),controller[_0x9c35('0x13')]);router[_0x9c35('0x14')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),interaction[_0x9c35('0x10')](_0x9c35('0x11'),_0x9c35('0x15')),controller[_0x9c35('0x16')]);router[_0x9c35('0x17')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),interaction[_0x9c35('0x10')]('whatsapp',_0x9c35('0x18')),controller[_0x9c35('0x19')]);router[_0x9c35('0x17')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x1a')]);module[_0x9c35('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5111eb3..0b6b2f7 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 _0xea31=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x4c5fdf,_0x4c7b76){var _0x37535e=function(_0x153f33){while(--_0x153f33){_0x4c5fdf['push'](_0x4c5fdf['shift']());}};_0x37535e(++_0x4c7b76);}(_0xea31,0x6b));var _0x1ea3=function(_0x1dea85,_0x55adb2){_0x1dea85=_0x1dea85-0x0;var _0x347632=_0xea31[_0x1dea85];return _0x347632;};'use strict';var Sequelize=require(_0x1ea3('0x0'));var moment=require('moment');module[_0x1ea3('0x1')]={'closed':{'type':Sequelize[_0x1ea3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1ea3('0x3')]},'disposition':{'type':Sequelize[_0x1ea3('0x4')]},'secondDisposition':{'type':Sequelize[_0x1ea3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1ea3('0x4')]},'note':{'type':Sequelize[_0x1ea3('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1ea3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1ea3('0x5')]('in',_0x1ea3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1ea3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1ea3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1ea3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x20d6=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x64c9bd,_0x71b468){var _0x2aa707=function(_0x5b15b9){while(--_0x5b15b9){_0x64c9bd['push'](_0x64c9bd['shift']());}};_0x2aa707(++_0x71b468);}(_0x20d6,0x9d));var _0x620d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x20d6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x620d('0x0'));var moment=require(_0x620d('0x1'));module[_0x620d('0x2')]={'closed':{'type':Sequelize[_0x620d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x620d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x620d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x620d('0x5')]},'note':{'type':Sequelize[_0x620d('0x5')]},'phone':{'type':Sequelize[_0x620d('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x620d('0x6')]('in',_0x620d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x620d('0x6')]('in',_0x620d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x620d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index bc856f9..8075a8c 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 _0xca79=['index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','params','keys','filters','intersection','model','attributes','fields','length','merge','options','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','omit','spread','Tag','emit','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','secret','read','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','disposition','Messages','basename','existsSync','createReadStream','pipe','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','stack','name','send'];(function(_0xaf1b2a,_0x5a2d8b){var _0x2adba0=function(_0x1674a8){while(--_0x1674a8){_0xaf1b2a['push'](_0xaf1b2a['shift']());}};_0x2adba0(++_0x5a2d8b);}(_0xca79,0xe4));var _0x9ca7=function(_0x33204a,_0x19de7){_0x33204a=_0x33204a-0x0;var _0x202cf6=_0xca79[_0x33204a];return _0x202cf6;};'use strict';var rimraf=require(_0x9ca7('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9ca7('0x1'));var BPromise=require('bluebird');var util=require(_0x9ca7('0x2'));var path=require('path');var ejs=require(_0x9ca7('0x3'));var fs=require('fs');var _=require(_0x9ca7('0x4'));var Redis=require(_0x9ca7('0x5'));var interaction=require(_0x9ca7('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x9ca7('0x7'))(_0x9ca7('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9ca7('0x9')]=_[_0x9ca7('0xa')](config['redis'],{'host':_0x9ca7('0xb'),'port':0x18eb});var socket=require(_0x9ca7('0xc'))(new Redis(config['redis']));require(_0x9ca7('0xd'))[_0x9ca7('0xe')](socket);function respondWithStatusCode(_0x727d80,_0x410c7b){_0x410c7b=_0x410c7b||0xcc;return function(_0x2235ef){if(_0x2235ef){return _0x727d80[_0x9ca7('0xf')](_0x410c7b);}return _0x727d80[_0x9ca7('0x10')](_0x410c7b)[_0x9ca7('0x11')]();};}function respondWithResult(_0x89a81d,_0x9afdbc){_0x9afdbc=_0x9afdbc||0xc8;return function(_0x5980a0){if(_0x5980a0){return _0x89a81d[_0x9ca7('0x10')](_0x9afdbc)[_0x9ca7('0x12')](_0x5980a0);}};}function respondWithFilteredResult(_0x3e5833,_0x4b45fb){return function(_0xe4ceb3){if(_0xe4ceb3){var _0x3c7b2e=typeof _0x4b45fb[_0x9ca7('0x13')]==='undefined'&&typeof _0x4b45fb[_0x9ca7('0x14')]===_0x9ca7('0x15');var _0x420a2d=_0xe4ceb3[_0x9ca7('0x16')];var _0x1ba420=_0x3c7b2e?0x0:_0x4b45fb[_0x9ca7('0x13')];var _0x432738=_0x3c7b2e?_0xe4ceb3[_0x9ca7('0x16')]:_0x4b45fb['offset']+_0x4b45fb[_0x9ca7('0x14')];var _0x3c2ab6;if(_0x432738>=_0x420a2d){_0x432738=_0x420a2d;_0x3c2ab6=0xc8;}else{_0x3c2ab6=0xce;}_0x3e5833[_0x9ca7('0x10')](_0x3c2ab6);return _0x3e5833[_0x9ca7('0x17')](_0x9ca7('0x18'),_0x1ba420+'-'+_0x432738+'/'+_0x420a2d)['json'](_0xe4ceb3);}return null;};}function saveUpdates(_0x47f6e4){return function(_0x222137){if(_0x222137){return _0x222137[_0x9ca7('0x19')](_0x47f6e4)[_0x9ca7('0x1a')](function(_0x522e17){return _0x522e17;});}return null;};}function removeEntity(_0x2c9919){return function(_0xee2a05){if(_0xee2a05){return _0xee2a05['destroy']()['then'](function(){_0x2c9919[_0x9ca7('0x10')](0xcc)[_0x9ca7('0x11')]();});}};}function handleEntityNotFound(_0x1b88a3){return function(_0x3cfa51){if(!_0x3cfa51){_0x1b88a3[_0x9ca7('0xf')](0x194);}return _0x3cfa51;};}function handleError(_0x396e6a,_0x56be01){_0x56be01=_0x56be01||0x1f4;return function(_0x1af254){logger['error'](_0x1af254[_0x9ca7('0x1b')]);if(_0x1af254[_0x9ca7('0x1c')]){delete _0x1af254[_0x9ca7('0x1c')];}_0x396e6a['status'](_0x56be01)[_0x9ca7('0x1d')](_0x1af254);};}exports[_0x9ca7('0x1e')]=function(_0x45394b,_0x391d6b){var _0xeaf484={};var _0xe9e8d6=_[_0x9ca7('0x1f')](db[_0x9ca7('0x20')][_0x9ca7('0x21')],function(_0x3b7135){return{'name':_0x3b7135[_0x9ca7('0x22')],'type':_0x3b7135[_0x9ca7('0x23')][_0x9ca7('0x24')]};});_0xeaf484=qs[_0x9ca7('0x25')](_0xe9e8d6,_0x45394b);return interaction[_0x9ca7('0x26')](_0x9ca7('0x27'),_0x45394b[_0x9ca7('0x28')],_0x45394b[_0x9ca7('0x29')],_0xeaf484,_0xe9e8d6)['then'](respondWithFilteredResult(_0x391d6b,_0xeaf484))[_0x9ca7('0x2a')](handleError(_0x391d6b,null));};exports['show']=function(_0x2b18f9,_0xd65d65){var _0x3b2bcb={'raw':![],'where':{'id':_0x2b18f9[_0x9ca7('0x2b')]['id']}},_0x2f3355={};_0x2f3355['model']=_[_0x9ca7('0x2c')](db[_0x9ca7('0x20')][_0x9ca7('0x21')]);_0x2f3355[_0x9ca7('0x28')]=_[_0x9ca7('0x2c')](_0x2b18f9[_0x9ca7('0x28')]);_0x2f3355[_0x9ca7('0x2d')]=_[_0x9ca7('0x2e')](_0x2f3355[_0x9ca7('0x2f')],_0x2f3355['query']);_0x3b2bcb[_0x9ca7('0x30')]=_['intersection'](_0x2f3355['model'],qs[_0x9ca7('0x31')](_0x2b18f9[_0x9ca7('0x28')][_0x9ca7('0x31')]));_0x3b2bcb['attributes']=_0x3b2bcb['attributes'][_0x9ca7('0x32')]?_0x3b2bcb[_0x9ca7('0x30')]:_0x2f3355['model'];if(_0x2b18f9[_0x9ca7('0x28')]['includeAll']){_0x3b2bcb['include']=[{'all':!![]}];}_0x3b2bcb=_[_0x9ca7('0x33')]({},_0x3b2bcb,_0x2b18f9[_0x9ca7('0x34')]);return db[_0x9ca7('0x20')][_0x9ca7('0x35')](_0x3b2bcb)[_0x9ca7('0x1a')](handleEntityNotFound(_0xd65d65,null))[_0x9ca7('0x1a')](respondWithResult(_0xd65d65,null))[_0x9ca7('0x2a')](handleError(_0xd65d65,null));};exports[_0x9ca7('0x36')]=function(_0x171d11,_0x1ac18d){return db[_0x9ca7('0x20')][_0x9ca7('0x36')](_0x171d11[_0x9ca7('0x37')],{})[_0x9ca7('0x1a')](respondWithResult(_0x1ac18d,0xc9))[_0x9ca7('0x2a')](handleError(_0x1ac18d,null));};exports[_0x9ca7('0x19')]=function(_0x3a323c,_0x43eaa4){if(_0x3a323c['body']['id']){delete _0x3a323c[_0x9ca7('0x37')]['id'];}return db[_0x9ca7('0x20')][_0x9ca7('0x35')]({'where':{'id':_0x3a323c[_0x9ca7('0x2b')]['id']}})[_0x9ca7('0x1a')](handleEntityNotFound(_0x43eaa4,null))['then'](saveUpdates(_0x3a323c[_0x9ca7('0x37')],null))[_0x9ca7('0x1a')](respondWithResult(_0x43eaa4,null))[_0x9ca7('0x2a')](handleError(_0x43eaa4,null));};exports[_0x9ca7('0x38')]=function(_0x16a4e2,_0x207d43){return db[_0x9ca7('0x20')]['find']({'where':{'id':_0x16a4e2[_0x9ca7('0x2b')]['id']}})[_0x9ca7('0x1a')](handleEntityNotFound(_0x207d43,null))['then'](removeEntity(_0x207d43,null))['catch'](handleError(_0x207d43,null));};exports[_0x9ca7('0x39')]=function(_0x5628aa,_0x3e7814){return db[_0x9ca7('0x20')][_0x9ca7('0x39')]()[_0x9ca7('0x1a')](respondWithResult(_0x3e7814,null))[_0x9ca7('0x2a')](handleError(_0x3e7814,null));};exports[_0x9ca7('0x3a')]=function(_0x3a2823,_0x882d66){return db[_0x9ca7('0x3b')][_0x9ca7('0x35')]({'where':{'id':_0x3a2823[_0x9ca7('0x2b')]['id']}})[_0x9ca7('0x1a')](handleEntityNotFound(_0x882d66,null))[_0x9ca7('0x1a')](function(_0x1d4ed3){if(_0x1d4ed3){return _0x1d4ed3[_0x9ca7('0x3a')](_0x3a2823['body'][_0x9ca7('0x3c')],_['omit'](_0x3a2823[_0x9ca7('0x37')],[_0x9ca7('0x3c'),'id'])||{});}})[_0x9ca7('0x1a')](respondWithResult(_0x882d66,null))[_0x9ca7('0x2a')](handleError(_0x882d66,null));};exports[_0x9ca7('0x3d')]=function(_0x107aef,_0x4bb01c){var _0x46821a={'raw':![],'where':{}};var _0xee4648={};var _0x38972a={'count':0x0,'rows':[]};return db[_0x9ca7('0x20')][_0x9ca7('0x3e')]({'where':{'id':_0x107aef[_0x9ca7('0x2b')]['id']}})[_0x9ca7('0x1a')](handleEntityNotFound(_0x4bb01c,null))[_0x9ca7('0x1a')](function(_0x368f25){if(_0x368f25){_0xee4648[_0x9ca7('0x2f')]=_[_0x9ca7('0x2c')](db[_0x9ca7('0x3b')][_0x9ca7('0x21')]);_0xee4648[_0x9ca7('0x28')]=_[_0x9ca7('0x2c')](_0x107aef[_0x9ca7('0x28')]);_0xee4648[_0x9ca7('0x2d')]=_['intersection'](_0xee4648['model'],_0xee4648[_0x9ca7('0x28')]);_0x46821a['attributes']=_[_0x9ca7('0x2e')](_0xee4648[_0x9ca7('0x2f')],qs[_0x9ca7('0x31')](_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x31')]));_0x46821a[_0x9ca7('0x30')]=_0x46821a['attributes'][_0x9ca7('0x32')]?_0x46821a['attributes']:_0xee4648[_0x9ca7('0x2f')];if(!_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x3f')](_0x9ca7('0x40'))){_0x46821a[_0x9ca7('0x14')]=qs[_0x9ca7('0x14')](_0x107aef[_0x9ca7('0x28')]['limit']);_0x46821a[_0x9ca7('0x13')]=qs['offset'](_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x13')]);}_0x46821a[_0x9ca7('0x41')]=qs[_0x9ca7('0x42')](_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x42')]);_0x46821a[_0x9ca7('0x43')]=qs[_0x9ca7('0x2d')](_[_0x9ca7('0x44')](_0x107aef['query'],_0xee4648[_0x9ca7('0x2d')]));_0x46821a[_0x9ca7('0x43')][_0x9ca7('0x45')]=_0x368f25['id'];if(_0x107aef['query']['filter']){_0x46821a['where']=_[_0x9ca7('0x33')](_0x46821a[_0x9ca7('0x43')],{'$or':_[_0x9ca7('0x1f')](_0x46821a[_0x9ca7('0x30')],function(_0x53e81b){var _0x3fdc96={};_0x3fdc96[_0x53e81b]={'$like':'%'+_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x46')]+'%'};return _0x3fdc96;})});}if(_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x47')]){var _0xba12aa=_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x47')][_0x9ca7('0x48')](',');var _0xc58cb8={};_0xc58cb8[_0xba12aa[0x0]]={'$gte':moment(_0xba12aa[0x1])[_0x9ca7('0x49')](_0x9ca7('0x4a'))};_0x46821a['where']=_['merge'](_0x46821a[_0x9ca7('0x43')],_0xc58cb8);}_0x46821a=_['merge']({},_0x46821a,_0x107aef[_0x9ca7('0x34')]);return db[_0x9ca7('0x3b')][_0x9ca7('0x16')]({'where':_0x46821a[_0x9ca7('0x43')]})[_0x9ca7('0x1a')](function(_0x496d81){_0x38972a['count']=_0x496d81;if(_0x107aef[_0x9ca7('0x28')][_0x9ca7('0x4b')]){_0x46821a[_0x9ca7('0x4c')]=[{'all':!![]}];}return db[_0x9ca7('0x3b')][_0x9ca7('0x26')](_0x46821a);})[_0x9ca7('0x1a')](function(_0x26ec86){_0x38972a[_0x9ca7('0x4d')]=_0x26ec86;return _0x38972a;});}})[_0x9ca7('0x1a')](respondWithFilteredResult(_0x4bb01c,_0x46821a))[_0x9ca7('0x2a')](handleError(_0x4bb01c,null));};exports[_0x9ca7('0x4e')]=function(_0x35df13,_0x307df8){return db[_0x9ca7('0x20')]['find']({'where':{'id':_0x35df13[_0x9ca7('0x2b')]['id']}})['then'](handleEntityNotFound(_0x307df8,null))[_0x9ca7('0x1a')](function(_0x4a14c3){if(_0x4a14c3){return _0x4a14c3[_0x9ca7('0x4f')](_0x35df13[_0x9ca7('0x37')][_0x9ca7('0x3c')],_[_0x9ca7('0x50')](_0x35df13[_0x9ca7('0x37')],[_0x9ca7('0x3c'),'id'])||{})[_0x9ca7('0x51')](function(){return db[_0x9ca7('0x52')][_0x9ca7('0x26')]({'attributes':['id',_0x9ca7('0x1c'),'color'],'where':{'id':_0x35df13[_0x9ca7('0x37')]['ids']}});})[_0x9ca7('0x1a')](function(_0x5978b3){socket[_0x9ca7('0x53')]('whatsappInteractionTags:save',{'id':Number(_0x35df13['params']['id']),'tags':_0x5978b3||[]});return{'id':Number(_0x35df13[_0x9ca7('0x2b')]['id']),'tags':_0x5978b3||[]};});}})[_0x9ca7('0x1a')](respondWithResult(_0x307df8,null))[_0x9ca7('0x2a')](handleError(_0x307df8,null));};exports[_0x9ca7('0x54')]=function(_0x2ef879,_0x5d0f58){return db['WhatsappInteraction']['find']({'where':{'id':_0x2ef879[_0x9ca7('0x2b')]['id']}})[_0x9ca7('0x1a')](handleEntityNotFound(_0x5d0f58,null))['then'](function(_0x548236){if(_0x548236){return _0x548236[_0x9ca7('0x54')](_0x2ef879['query'][_0x9ca7('0x3c')]);}})[_0x9ca7('0x1a')](respondWithStatusCode(_0x5d0f58,null))[_0x9ca7('0x2a')](handleError(_0x5d0f58,null));};exports[_0x9ca7('0x55')]=function(_0x44d338,_0x6ab13c){var _0x30a2c9=moment()['unix']()[_0x9ca7('0x56')]();var _0x4d2aac=path[_0x9ca7('0x57')](config[_0x9ca7('0x58')],_0x9ca7('0x59'),_0x9ca7('0x5a'),_0x9ca7('0x5b'));var _0x1a3bfc=path['join'](config[_0x9ca7('0x58')],_0x9ca7('0x59'),_0x9ca7('0x5a'),_0x9ca7('0x5c'));var _0x494af5=path[_0x9ca7('0x57')](_0x4d2aac,_0x30a2c9);var _0x2c9ffd=util[_0x9ca7('0x49')](_0x9ca7('0x5d'),_0x44d338[_0x9ca7('0x2b')]['id'],_0x30a2c9);var _0x524198=path['join'](_0x4d2aac,_0x2c9ffd);var _0x3ff4db=[];_0x3ff4db[_0x9ca7('0x5e')]({'model':db[_0x9ca7('0x5f')],'as':_0x9ca7('0x5f'),'attributes':['id',_0x9ca7('0x60')],'raw':!![]});_0x3ff4db[_0x9ca7('0x5e')]({'model':db[_0x9ca7('0x61')],'as':_0x9ca7('0x62'),'attributes':['id',_0x9ca7('0x63'),_0x9ca7('0x64')],'raw':!![]});if(_0x44d338[_0x9ca7('0x28')][_0x9ca7('0x5c')]){_0x3ff4db[_0x9ca7('0x5e')]({'model':db['Attachment'],'as':_0x9ca7('0x65'),'raw':!![]});}var _0x540ac9=[{'model':db[_0x9ca7('0x3b')],'as':'Messages','attributes':['id',_0x9ca7('0x37'),_0x9ca7('0x66'),'direction',_0x9ca7('0x67'),_0x9ca7('0x68')],'include':_0x3ff4db}];_0x540ac9[_0x9ca7('0x5e')]({'model':db[_0x9ca7('0x69')],'as':_0x9ca7('0x6a'),'attributes':['id',_0x9ca7('0x1c')]});_0x540ac9[_0x9ca7('0x5e')]({'model':db[_0x9ca7('0x5f')],'as':'Owner','attributes':['id','fullname']});return db[_0x9ca7('0x20')]['find']({'where':{'id':_0x44d338['params']['id']},'include':_0x540ac9})[_0x9ca7('0x1a')](handleEntityNotFound(_0x6ab13c,null))[_0x9ca7('0x1a')](function(_0x18d60d){if(_0x18d60d){var _0x5d46f2=_0x18d60d[_0x9ca7('0x6b')]({'plain':!![]});fs[_0x9ca7('0x6c')](_0x494af5);var _0x1d6a98={'channel':_0x9ca7('0x6d'),'account':_0x5d46f2['Account']['name'],'agent':_0x5d46f2[_0x9ca7('0x6e')]?_0x5d46f2['Owner'][_0x9ca7('0x60')]:_0x9ca7('0x6f'),'createdAt':moment(_0x5d46f2[_0x9ca7('0x66')])[_0x9ca7('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9ca7('0x56')](),'closedAt':_0x5d46f2['closed']?moment(_0x5d46f2['closedAt'])[_0x9ca7('0x49')](_0x9ca7('0x4a'))[_0x9ca7('0x56')]():'','disposition':_0x5d46f2[_0x9ca7('0x70')],'messages':_(_0x5d46f2[_0x9ca7('0x71')])[_0x9ca7('0x46')]({'secret':![]})['map'](function(_0x3f9ef2){if(_0x3f9ef2[_0x9ca7('0x65')]){var _0x487800=path[_0x9ca7('0x57')](_0x1a3bfc,_0x3f9ef2[_0x9ca7('0x65')][_0x9ca7('0x72')]);if(fs[_0x9ca7('0x73')](_0x487800)){fs[_0x9ca7('0x74')](_0x487800)[_0x9ca7('0x75')](fs['createWriteStream'](path['join'](_0x494af5,_0x3f9ef2[_0x9ca7('0x65')][_0x9ca7('0x72')])));}}return{'date':moment(_0x3f9ef2['createdAt'])[_0x9ca7('0x49')](_0x9ca7('0x4a'))[_0x9ca7('0x56')](),'sender':_0x3f9ef2['direction']===_0x9ca7('0x76')?_0x3f9ef2[_0x9ca7('0x5f')]?_0x3f9ef2[_0x9ca7('0x5f')][_0x9ca7('0x60')]:'System':_0x3f9ef2[_0x9ca7('0x62')][_0x9ca7('0x63')]+(_0x3f9ef2[_0x9ca7('0x62')][_0x9ca7('0x64')]?'\x20'+_0x3f9ef2['Contact']['lastName']:''),'body':_0x3f9ef2[_0x9ca7('0x65')]?_0x3f9ef2['Attachment'][_0x9ca7('0x72')]:_0x3f9ef2[_0x9ca7('0x37')],'direction':_0x3f9ef2['direction']===_0x9ca7('0x76')?'A':'C','secret':_0x3f9ef2[_0x9ca7('0x67')],'read':_0x3f9ef2[_0x9ca7('0x68')],'attachment':_0x3f9ef2[_0x9ca7('0x65')]};})[_0x9ca7('0x77')]()};return ejs[_0x9ca7('0x78')](path[_0x9ca7('0x57')](config[_0x9ca7('0x58')],_0x9ca7('0x59'),_0x9ca7('0x79'),_0x9ca7('0x7a')),{'interaction':_0x1d6a98})['then'](function(_0x2962d1){var _0x177daa=path[_0x9ca7('0x57')](_0x494af5,_0x9ca7('0x7b')+_0x5d46f2['id']+'-'+_0x30a2c9+_0x9ca7('0x7c'));var _0x146798={'path':_0x177daa,'channel':'Whatsapp','interactionId':_0x5d46f2['id']};return pdf[_0x9ca7('0x7d')](_0x2962d1,_0x146798);})[_0x9ca7('0x1a')](function(){return new BPromise(function(_0x51e894,_0x345a90){zipdir(_0x494af5,{'saveTo':_0x524198},function(_0x1ba1fa,_0x1a9a09){if(_0x1ba1fa)return _0x345a90(_0x1ba1fa);return _0x51e894(_0x1a9a09);});})['then'](function(){return new BPromise(function(_0x31a1b1,_0x47754a){rimraf(_0x494af5,function(_0x1dcff3){if(_0x1dcff3)_0x47754a(_0x1dcff3);return _0x31a1b1();});});})[_0x9ca7('0x1a')](function(){return _0x6ab13c[_0x9ca7('0x55')](_0x524198,_0x2c9ffd,function(_0x5aafb0){if(_0x5aafb0){console[_0x9ca7('0x7e')](_0x9ca7('0x7f'),_0x5aafb0);}else{fs[_0x9ca7('0x80')](_0x524198);}});});});}else{return _0x6ab13c[_0x9ca7('0xf')](0xc8);}})[_0x9ca7('0x2a')](handleError(_0x6ab13c,null));}; \ No newline at end of file +var _0xf1c3=['path','ejs','ioredis','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','error','stack','name','send','index','map','WhatsappInteraction','fieldName','type','key','getOptions','findAll','whatsapp','catch','show','keys','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','create','body','params','find','addMessage','omit','ids','getMessages','findOne','WhatsappMessage','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','emit','whatsappInteractionTags:save','download','toString','join','root','server','files','format','User','fullname','push','CmContact','Contact','attachments','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','get','Whatsapp','Owner','N.A.','closedAt','disposition','basename','existsSync','createReadStream','System','firstName','lastName','value','views','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','bluebird','util'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xf1c3,0x1d8));var _0x3f1c=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0xf1c3[_0x121886];return _0x20ca01;};'use strict';var rimraf=require(_0x3f1c('0x0'));var zipdir=require('zip-dir');var moment=require(_0x3f1c('0x1'));var BPromise=require(_0x3f1c('0x2'));var util=require(_0x3f1c('0x3'));var path=require(_0x3f1c('0x4'));var ejs=require(_0x3f1c('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x3f1c('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x3f1c('0x7'));var logger=require(_0x3f1c('0x8'))('api');var config=require(_0x3f1c('0x9'));var db=require('../../mysqldb')['db'];config[_0x3f1c('0xa')]=_[_0x3f1c('0xb')](config[_0x3f1c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f1c('0xc'))(new Redis(config[_0x3f1c('0xa')]));require('./whatsappInteraction.socket')[_0x3f1c('0xd')](socket);function respondWithStatusCode(_0x1d37f6,_0x5018dd){_0x5018dd=_0x5018dd||0xcc;return function(_0x259487){if(_0x259487){return _0x1d37f6[_0x3f1c('0xe')](_0x5018dd);}return _0x1d37f6[_0x3f1c('0xf')](_0x5018dd)['end']();};}function respondWithResult(_0x107fea,_0x9160b3){_0x9160b3=_0x9160b3||0xc8;return function(_0x51bec8){if(_0x51bec8){return _0x107fea['status'](_0x9160b3)[_0x3f1c('0x10')](_0x51bec8);}};}function respondWithFilteredResult(_0x371a8c,_0xc4f632){return function(_0x2619db){if(_0x2619db){var _0x5468ce=typeof _0xc4f632[_0x3f1c('0x11')]===_0x3f1c('0x12')&&typeof _0xc4f632[_0x3f1c('0x13')]===_0x3f1c('0x12');var _0x370902=_0x2619db[_0x3f1c('0x14')];var _0x540645=_0x5468ce?0x0:_0xc4f632[_0x3f1c('0x11')];var _0x1cc175=_0x5468ce?_0x2619db['count']:_0xc4f632['offset']+_0xc4f632['limit'];var _0x3c1406;if(_0x1cc175>=_0x370902){_0x1cc175=_0x370902;_0x3c1406=0xc8;}else{_0x3c1406=0xce;}_0x371a8c[_0x3f1c('0xf')](_0x3c1406);return _0x371a8c[_0x3f1c('0x15')](_0x3f1c('0x16'),_0x540645+'-'+_0x1cc175+'/'+_0x370902)[_0x3f1c('0x10')](_0x2619db);}return null;};}function saveUpdates(_0x5a814d){return function(_0x4f2e19){if(_0x4f2e19){return _0x4f2e19[_0x3f1c('0x17')](_0x5a814d)[_0x3f1c('0x18')](function(_0x28ca68){return _0x28ca68;});}return null;};}function removeEntity(_0x12ebfb){return function(_0xcbb6d3){if(_0xcbb6d3){return _0xcbb6d3['destroy']()[_0x3f1c('0x18')](function(){_0x12ebfb[_0x3f1c('0xf')](0xcc)[_0x3f1c('0x19')]();});}};}function handleEntityNotFound(_0x4386c2){return function(_0x5d1b7f){if(!_0x5d1b7f){_0x4386c2[_0x3f1c('0xe')](0x194);}return _0x5d1b7f;};}function handleError(_0x220eca,_0x1ed5ba){_0x1ed5ba=_0x1ed5ba||0x1f4;return function(_0x22a52d){logger[_0x3f1c('0x1a')](_0x22a52d[_0x3f1c('0x1b')]);if(_0x22a52d[_0x3f1c('0x1c')]){delete _0x22a52d[_0x3f1c('0x1c')];}_0x220eca[_0x3f1c('0xf')](_0x1ed5ba)[_0x3f1c('0x1d')](_0x22a52d);};}exports[_0x3f1c('0x1e')]=function(_0x3715c2,_0x28dec4){var _0x4290fa={};var _0x24e91c=_[_0x3f1c('0x1f')](db[_0x3f1c('0x20')]['rawAttributes'],function(_0x1c7efb){return{'name':_0x1c7efb[_0x3f1c('0x21')],'type':_0x1c7efb[_0x3f1c('0x22')][_0x3f1c('0x23')]};});_0x4290fa=qs[_0x3f1c('0x24')](_0x24e91c,_0x3715c2);return interaction[_0x3f1c('0x25')](_0x3f1c('0x26'),_0x3715c2['query'],_0x3715c2['user'],_0x4290fa,_0x24e91c)['then'](respondWithFilteredResult(_0x28dec4,_0x4290fa))[_0x3f1c('0x27')](handleError(_0x28dec4,null));};exports[_0x3f1c('0x28')]=function(_0x2d5f8e,_0x410181){var _0x4e05ad={'raw':![],'where':{'id':_0x2d5f8e['params']['id']}},_0x2fc1ff={};_0x2fc1ff['model']=_[_0x3f1c('0x29')](db[_0x3f1c('0x20')][_0x3f1c('0x2a')]);_0x2fc1ff[_0x3f1c('0x2b')]=_[_0x3f1c('0x29')](_0x2d5f8e['query']);_0x2fc1ff[_0x3f1c('0x2c')]=_['intersection'](_0x2fc1ff[_0x3f1c('0x2d')],_0x2fc1ff[_0x3f1c('0x2b')]);_0x4e05ad[_0x3f1c('0x2e')]=_[_0x3f1c('0x2f')](_0x2fc1ff['model'],qs[_0x3f1c('0x30')](_0x2d5f8e[_0x3f1c('0x2b')]['fields']));_0x4e05ad[_0x3f1c('0x2e')]=_0x4e05ad[_0x3f1c('0x2e')][_0x3f1c('0x31')]?_0x4e05ad[_0x3f1c('0x2e')]:_0x2fc1ff['model'];if(_0x2d5f8e['query'][_0x3f1c('0x32')]){_0x4e05ad[_0x3f1c('0x33')]=[{'all':!![]}];}_0x4e05ad=_[_0x3f1c('0x34')]({},_0x4e05ad,_0x2d5f8e[_0x3f1c('0x35')]);return db['WhatsappInteraction']['find'](_0x4e05ad)[_0x3f1c('0x18')](handleEntityNotFound(_0x410181,null))[_0x3f1c('0x18')](respondWithResult(_0x410181,null))[_0x3f1c('0x27')](handleError(_0x410181,null));};exports[_0x3f1c('0x36')]=function(_0x402149,_0x198779){return db[_0x3f1c('0x20')][_0x3f1c('0x36')](_0x402149[_0x3f1c('0x37')],{})[_0x3f1c('0x18')](respondWithResult(_0x198779,0xc9))[_0x3f1c('0x27')](handleError(_0x198779,null));};exports[_0x3f1c('0x17')]=function(_0x6ca9fb,_0xbdc457){if(_0x6ca9fb[_0x3f1c('0x37')]['id']){delete _0x6ca9fb[_0x3f1c('0x37')]['id'];}return db[_0x3f1c('0x20')]['find']({'where':{'id':_0x6ca9fb[_0x3f1c('0x38')]['id']}})[_0x3f1c('0x18')](handleEntityNotFound(_0xbdc457,null))['then'](saveUpdates(_0x6ca9fb['body'],null))[_0x3f1c('0x18')](respondWithResult(_0xbdc457,null))[_0x3f1c('0x27')](handleError(_0xbdc457,null));};exports['destroy']=function(_0x46ac0a,_0x5d60d3){return db[_0x3f1c('0x20')][_0x3f1c('0x39')]({'where':{'id':_0x46ac0a[_0x3f1c('0x38')]['id']}})[_0x3f1c('0x18')](handleEntityNotFound(_0x5d60d3,null))[_0x3f1c('0x18')](removeEntity(_0x5d60d3,null))[_0x3f1c('0x27')](handleError(_0x5d60d3,null));};exports['describe']=function(_0xf96e3c,_0x1be1d7){return db[_0x3f1c('0x20')]['describe']()['then'](respondWithResult(_0x1be1d7,null))['catch'](handleError(_0x1be1d7,null));};exports[_0x3f1c('0x3a')]=function(_0x2befed,_0x3da0dd){return db['WhatsappMessage'][_0x3f1c('0x39')]({'where':{'id':_0x2befed[_0x3f1c('0x38')]['id']}})[_0x3f1c('0x18')](handleEntityNotFound(_0x3da0dd,null))[_0x3f1c('0x18')](function(_0x14df48){if(_0x14df48){return _0x14df48[_0x3f1c('0x3a')](_0x2befed[_0x3f1c('0x37')]['ids'],_[_0x3f1c('0x3b')](_0x2befed[_0x3f1c('0x37')],[_0x3f1c('0x3c'),'id'])||{});}})[_0x3f1c('0x18')](respondWithResult(_0x3da0dd,null))[_0x3f1c('0x27')](handleError(_0x3da0dd,null));};exports[_0x3f1c('0x3d')]=function(_0x56b5cc,_0x208c89){var _0x161f95={'raw':![],'where':{}};var _0x328c52={};var _0x36258b={'count':0x0,'rows':[]};return db[_0x3f1c('0x20')][_0x3f1c('0x3e')]({'where':{'id':_0x56b5cc[_0x3f1c('0x38')]['id']}})[_0x3f1c('0x18')](handleEntityNotFound(_0x208c89,null))[_0x3f1c('0x18')](function(_0x1b8c6b){if(_0x1b8c6b){_0x328c52['model']=_[_0x3f1c('0x29')](db[_0x3f1c('0x3f')][_0x3f1c('0x2a')]);_0x328c52[_0x3f1c('0x2b')]=_[_0x3f1c('0x29')](_0x56b5cc[_0x3f1c('0x2b')]);_0x328c52[_0x3f1c('0x2c')]=_[_0x3f1c('0x2f')](_0x328c52[_0x3f1c('0x2d')],_0x328c52[_0x3f1c('0x2b')]);_0x161f95[_0x3f1c('0x2e')]=_['intersection'](_0x328c52[_0x3f1c('0x2d')],qs[_0x3f1c('0x30')](_0x56b5cc[_0x3f1c('0x2b')]['fields']));_0x161f95[_0x3f1c('0x2e')]=_0x161f95['attributes'][_0x3f1c('0x31')]?_0x161f95['attributes']:_0x328c52[_0x3f1c('0x2d')];if(!_0x56b5cc[_0x3f1c('0x2b')]['hasOwnProperty'](_0x3f1c('0x40'))){_0x161f95[_0x3f1c('0x13')]=qs[_0x3f1c('0x13')](_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x13')]);_0x161f95[_0x3f1c('0x11')]=qs[_0x3f1c('0x11')](_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x11')]);}_0x161f95[_0x3f1c('0x41')]=qs['sort'](_0x56b5cc['query'][_0x3f1c('0x42')]);_0x161f95[_0x3f1c('0x43')]=qs[_0x3f1c('0x2c')](_[_0x3f1c('0x44')](_0x56b5cc[_0x3f1c('0x2b')],_0x328c52[_0x3f1c('0x2c')]));_0x161f95['where'][_0x3f1c('0x45')]=_0x1b8c6b['id'];if(_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x46')]){_0x161f95['where']=_[_0x3f1c('0x34')](_0x161f95[_0x3f1c('0x43')],{'$or':_[_0x3f1c('0x1f')](_0x161f95[_0x3f1c('0x2e')],function(_0x1f0677){var _0x3a1f0c={};_0x3a1f0c[_0x1f0677]={'$like':'%'+_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x46')]+'%'};return _0x3a1f0c;})});}if(_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x47')]){var _0x1f33b5=_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x47')]['split'](',');var _0x596bc3={};_0x596bc3[_0x1f33b5[0x0]]={'$gte':moment(_0x1f33b5[0x1])['format'](_0x3f1c('0x48'))};_0x161f95[_0x3f1c('0x43')]=_[_0x3f1c('0x34')](_0x161f95['where'],_0x596bc3);}_0x161f95=_[_0x3f1c('0x34')]({},_0x161f95,_0x56b5cc['options']);return db[_0x3f1c('0x3f')][_0x3f1c('0x14')]({'where':_0x161f95[_0x3f1c('0x43')]})[_0x3f1c('0x18')](function(_0x504ebd){_0x36258b[_0x3f1c('0x14')]=_0x504ebd;if(_0x56b5cc[_0x3f1c('0x2b')][_0x3f1c('0x32')]){_0x161f95[_0x3f1c('0x33')]=[{'all':!![]}];}return db[_0x3f1c('0x3f')]['findAll'](_0x161f95);})[_0x3f1c('0x18')](function(_0x474726){_0x36258b[_0x3f1c('0x49')]=_0x474726;return _0x36258b;});}})[_0x3f1c('0x18')](respondWithFilteredResult(_0x208c89,_0x161f95))['catch'](handleError(_0x208c89,null));};exports[_0x3f1c('0x4a')]=function(_0x11ad18,_0x51e340){return db['WhatsappInteraction'][_0x3f1c('0x39')]({'where':{'id':_0x11ad18['params']['id']}})['then'](handleEntityNotFound(_0x51e340,null))[_0x3f1c('0x18')](function(_0x5936d4){if(_0x5936d4){return _0x5936d4[_0x3f1c('0x4b')](_0x11ad18['body'][_0x3f1c('0x3c')],_['omit'](_0x11ad18[_0x3f1c('0x37')],[_0x3f1c('0x3c'),'id'])||{})['spread'](function(){return db[_0x3f1c('0x4c')]['findAll']({'attributes':['id',_0x3f1c('0x1c'),'color'],'where':{'id':_0x11ad18[_0x3f1c('0x37')][_0x3f1c('0x3c')]}});})['then'](function(_0x49a7eb){socket[_0x3f1c('0x4d')](_0x3f1c('0x4e'),{'id':Number(_0x11ad18[_0x3f1c('0x38')]['id']),'tags':_0x49a7eb||[]});return{'id':Number(_0x11ad18[_0x3f1c('0x38')]['id']),'tags':_0x49a7eb||[]};});}})[_0x3f1c('0x18')](respondWithResult(_0x51e340,null))['catch'](handleError(_0x51e340,null));};exports['removeTags']=function(_0x2aa2da,_0x5d84c3){return db[_0x3f1c('0x20')][_0x3f1c('0x39')]({'where':{'id':_0x2aa2da[_0x3f1c('0x38')]['id']}})[_0x3f1c('0x18')](handleEntityNotFound(_0x5d84c3,null))['then'](function(_0x2a1e50){if(_0x2a1e50){return _0x2a1e50['removeTags'](_0x2aa2da[_0x3f1c('0x2b')][_0x3f1c('0x3c')]);}})['then'](respondWithStatusCode(_0x5d84c3,null))[_0x3f1c('0x27')](handleError(_0x5d84c3,null));};exports[_0x3f1c('0x4f')]=function(_0x5f5045,_0x11e0bd){var _0x551d2e=moment()['unix']()[_0x3f1c('0x50')]();var _0x553b07=path[_0x3f1c('0x51')](config[_0x3f1c('0x52')],_0x3f1c('0x53'),_0x3f1c('0x54'),'tmp');var _0x322ed0=path['join'](config[_0x3f1c('0x52')],'server',_0x3f1c('0x54'),'attachments');var _0x46c38a=path['join'](_0x553b07,_0x551d2e);var _0x4b0c25=util[_0x3f1c('0x55')]('transcript-%d-%s.zip',_0x5f5045[_0x3f1c('0x38')]['id'],_0x551d2e);var _0x1a495e=path['join'](_0x553b07,_0x4b0c25);var _0x115830=[];_0x115830['push']({'model':db[_0x3f1c('0x56')],'as':_0x3f1c('0x56'),'attributes':['id',_0x3f1c('0x57')],'raw':!![]});_0x115830[_0x3f1c('0x58')]({'model':db[_0x3f1c('0x59')],'as':_0x3f1c('0x5a'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5f5045[_0x3f1c('0x2b')][_0x3f1c('0x5b')]){_0x115830[_0x3f1c('0x58')]({'model':db[_0x3f1c('0x5c')],'as':_0x3f1c('0x5c'),'raw':!![]});}var _0x3d07e7=[{'model':db[_0x3f1c('0x3f')],'as':_0x3f1c('0x5d'),'attributes':['id',_0x3f1c('0x37'),_0x3f1c('0x5e'),_0x3f1c('0x5f'),_0x3f1c('0x60'),_0x3f1c('0x61')],'include':_0x115830}];_0x3d07e7[_0x3f1c('0x58')]({'model':db[_0x3f1c('0x62')],'as':_0x3f1c('0x63'),'attributes':['id',_0x3f1c('0x1c')]});_0x3d07e7[_0x3f1c('0x58')]({'model':db[_0x3f1c('0x56')],'as':'Owner','attributes':['id',_0x3f1c('0x57')]});return db[_0x3f1c('0x20')]['find']({'where':{'id':_0x5f5045[_0x3f1c('0x38')]['id']},'include':_0x3d07e7})[_0x3f1c('0x18')](handleEntityNotFound(_0x11e0bd,null))[_0x3f1c('0x18')](function(_0x39135b){if(_0x39135b){var _0x3cfa47=_0x39135b[_0x3f1c('0x64')]({'plain':!![]});fs['mkdirSync'](_0x46c38a);var _0x3174d6={'channel':_0x3f1c('0x65'),'account':_0x3cfa47['Account'][_0x3f1c('0x1c')],'agent':_0x3cfa47[_0x3f1c('0x66')]?_0x3cfa47[_0x3f1c('0x66')][_0x3f1c('0x57')]:_0x3f1c('0x67'),'createdAt':moment(_0x3cfa47[_0x3f1c('0x5e')])[_0x3f1c('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3f1c('0x50')](),'closedAt':_0x3cfa47['closed']?moment(_0x3cfa47[_0x3f1c('0x68')])[_0x3f1c('0x55')](_0x3f1c('0x48'))['toString']():'','disposition':_0x3cfa47[_0x3f1c('0x69')],'messages':_(_0x3cfa47['Messages'])[_0x3f1c('0x46')]({'secret':![]})[_0x3f1c('0x1f')](function(_0x468f08){if(_0x468f08[_0x3f1c('0x5c')]){var _0x122f12=path['join'](_0x322ed0,_0x468f08['Attachment'][_0x3f1c('0x6a')]);if(fs[_0x3f1c('0x6b')](_0x122f12)){fs[_0x3f1c('0x6c')](_0x122f12)['pipe'](fs['createWriteStream'](path[_0x3f1c('0x51')](_0x46c38a,_0x468f08[_0x3f1c('0x5c')]['basename'])));}}return{'date':moment(_0x468f08['createdAt'])[_0x3f1c('0x55')](_0x3f1c('0x48'))[_0x3f1c('0x50')](),'sender':_0x468f08[_0x3f1c('0x5f')]==='out'?_0x468f08[_0x3f1c('0x56')]?_0x468f08[_0x3f1c('0x56')]['fullname']:_0x3f1c('0x6d'):_0x468f08[_0x3f1c('0x5a')][_0x3f1c('0x6e')]+(_0x468f08['Contact'][_0x3f1c('0x6f')]?'\x20'+_0x468f08[_0x3f1c('0x5a')][_0x3f1c('0x6f')]:''),'body':_0x468f08[_0x3f1c('0x5c')]?_0x468f08[_0x3f1c('0x5c')][_0x3f1c('0x6a')]:_0x468f08[_0x3f1c('0x37')],'direction':_0x468f08['direction']==='out'?'A':'C','secret':_0x468f08[_0x3f1c('0x60')],'read':_0x468f08[_0x3f1c('0x61')],'attachment':_0x468f08[_0x3f1c('0x5c')]};})[_0x3f1c('0x70')]()};return ejs['renderFile'](path[_0x3f1c('0x51')](config[_0x3f1c('0x52')],'server',_0x3f1c('0x71'),'downloadInteraction.ejs'),{'interaction':_0x3174d6})['then'](function(_0x28fa8d){var _0x2b2e2c=path['join'](_0x46c38a,'transcript-'+_0x3cfa47['id']+'-'+_0x551d2e+_0x3f1c('0x72'));var _0x1d28b0={'path':_0x2b2e2c,'channel':_0x3f1c('0x65'),'interactionId':_0x3cfa47['id']};return pdf[_0x3f1c('0x73')](_0x28fa8d,_0x1d28b0);})[_0x3f1c('0x18')](function(){return new BPromise(function(_0x3c39ee,_0x3fce14){zipdir(_0x46c38a,{'saveTo':_0x1a495e},function(_0x2908e8,_0x1bcea0){if(_0x2908e8)return _0x3fce14(_0x2908e8);return _0x3c39ee(_0x1bcea0);});})[_0x3f1c('0x18')](function(){return new BPromise(function(_0x534379,_0x539484){rimraf(_0x46c38a,function(_0x2f962c){if(_0x2f962c)_0x539484(_0x2f962c);return _0x534379();});});})[_0x3f1c('0x18')](function(){return _0x11e0bd['download'](_0x1a495e,_0x4b0c25,function(_0x255654){if(_0x255654){console[_0x3f1c('0x74')](_0x3f1c('0x75'),_0x255654);}else{fs[_0x3f1c('0x76')](_0x1a495e);}});});});}else{return _0x11e0bd['sendStatus'](0xc8);}})['catch'](handleError(_0x11e0bd,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index bf66144..5dca6d0 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 _0xd403=['then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','update','remove','getUsers'];(function(_0x2e4792,_0x48e882){var _0x13b82c=function(_0x475c87){while(--_0x475c87){_0x2e4792['push'](_0x2e4792['shift']());}};_0x13b82c(++_0x48e882);}(_0xd403,0x1d5));var _0x3d40=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xd403[_0x39096d];return _0x13da4f;};'use strict';var EventEmitter=require(_0x3d40('0x0'));var WhatsappInteraction=require(_0x3d40('0x1'))['db'][_0x3d40('0x2')];var WhatsappMessage=require(_0x3d40('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3d40('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d40('0x4'),'afterDestroy':_0x3d40('0x5')};function emitEvent(_0x1d860a){return function(_0x26e89d,_0x28b158,_0xcb5864){_0x26e89d[_0x3d40('0x6')]({'attributes':['id'],'raw':!![]})[_0x3d40('0x7')](function(_0x14dc5b){_0x26e89d[_0x3d40('0x8')](_0x3d40('0x9'),_0x14dc5b[_0x3d40('0xa')](function(_0x46a442){return{'id':_0x46a442['id']};}));return WhatsappMessage[_0x3d40('0xb')]({'where':{'WhatsappInteractionId':_0x26e89d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d40('0x7')](function(_0x35ffce){_0x26e89d['setDataValue'](_0x3d40('0xc'),_0x35ffce['length']);WhatsappInteractionEvents[_0x3d40('0xd')](_0x1d860a+':'+_0x26e89d['id'],_0x26e89d);WhatsappInteractionEvents[_0x3d40('0xd')](_0x1d860a,_0x26e89d);_0xcb5864(null);})[_0x3d40('0xe')](_0xcb5864(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x3d40('0xf')](e,emitEvent(event));}}module[_0x3d40('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x0434=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x2cb472,_0x483e33){var _0x1abf19=function(_0xa791cb){while(--_0xa791cb){_0x2cb472['push'](_0x2cb472['shift']());}};_0x1abf19(++_0x483e33);}(_0x0434,0x1ad));var _0x4043=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x0434[_0x23b655];return _0x364b32;};'use strict';var EventEmitter=require(_0x4043('0x0'));var WhatsappInteraction=require(_0x4043('0x1'))['db'][_0x4043('0x2')];var WhatsappMessage=require(_0x4043('0x1'))['db'][_0x4043('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4043('0x4'),'afterDestroy':_0x4043('0x5')};function emitEvent(_0x3e475f){return function(_0x2e1aec,_0x424a16,_0x1dba57){_0x2e1aec['getUsers']({'attributes':['id'],'raw':!![]})[_0x4043('0x6')](function(_0x1ed6c4){_0x2e1aec['setDataValue']('Users',_0x1ed6c4[_0x4043('0x7')](function(_0x2b959b){return{'id':_0x2b959b['id']};}));return WhatsappMessage[_0x4043('0x8')]({'where':{'WhatsappInteractionId':_0x2e1aec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4043('0x6')](function(_0x30f083){_0x2e1aec[_0x4043('0x9')](_0x4043('0xa'),_0x30f083[_0x4043('0xb')]);WhatsappInteractionEvents['emit'](_0x3e475f+':'+_0x2e1aec['id'],_0x2e1aec);WhatsappInteractionEvents[_0x4043('0xc')](_0x3e475f,_0x2e1aec);_0x1dba57(null);})[_0x4043('0xd')](_0x1dba57(null));};}for(var e in events){if(events[_0x4043('0xe')](e)){var event=events[e];WhatsappInteraction[_0x4043('0xf')](e,emitEvent(event));}}module[_0x4043('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index ad56fc4..c19ea47 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 _0xc1f4=['define','changed','closed','closedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x9adcd6,_0x36278b){var _0xdf8ff2=function(_0x4f7087){while(--_0x4f7087){_0x9adcd6['push'](_0x9adcd6['shift']());}};_0xdf8ff2(++_0x36278b);}(_0xc1f4,0xc7));var _0x4c1f=function(_0x387583,_0x127b08){_0x387583=_0x387583-0x0;var _0x45d2f9=_0xc1f4[_0x387583];return _0x45d2f9;};'use strict';var _=require(_0x4c1f('0x0'));var util=require(_0x4c1f('0x1'));var logger=require('../../config/logger')(_0x4c1f('0x2'));var moment=require(_0x4c1f('0x3'));var BPromise=require(_0x4c1f('0x4'));var rp=require(_0x4c1f('0x5'));var fs=require('fs');var path=require(_0x4c1f('0x6'));var rimraf=require(_0x4c1f('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x4c1f('0x8')]=function(_0x5199a6,_0x44ed92){return _0x5199a6[_0x4c1f('0x9')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31107d,_0x3835b9,_0x234e55){if(_0x31107d[_0x4c1f('0xa')](_0x4c1f('0xb'))){_0x31107d[_0x4c1f('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x234e55(null,_0x31107d);}}});}; \ No newline at end of file +var _0x09d1=['WhatsappInteraction','whatsapp_interactions','closed','format','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0xfb9d2d,_0x4067c9){var _0xd2eac7=function(_0x4b597f){while(--_0x4b597f){_0xfb9d2d['push'](_0xfb9d2d['shift']());}};_0xd2eac7(++_0x4067c9);}(_0x09d1,0xac));var _0x109d=function(_0x58b8d6,_0x2611e6){_0x58b8d6=_0x58b8d6-0x0;var _0x21d2b5=_0x09d1[_0x58b8d6];return _0x21d2b5;};'use strict';var _=require('lodash');var util=require(_0x109d('0x0'));var logger=require('../../config/logger')(_0x109d('0x1'));var moment=require(_0x109d('0x2'));var BPromise=require(_0x109d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x109d('0x4'));var rimraf=require(_0x109d('0x5'));var config=require(_0x109d('0x6'));var attributes=require(_0x109d('0x7'));module[_0x109d('0x8')]=function(_0x3fa215,_0x12a700){return _0x3fa215[_0x109d('0x9')](_0x109d('0xa'),attributes,{'tableName':_0x109d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58132d,_0x5181dc,_0x3c894e){if(_0x58132d['changed'](_0x109d('0xc'))){_0x58132d['closedAt']=moment()[_0x109d('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c894e(null,_0x58132d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a56a231..3bcfd4f 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 _0xa4ea=['./whatsappInteraction.socket','register','request','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','WhatsappInteraction,\x20%s,\x20%s','message','info','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','then','stringify','find','addTags','ids','spread','catch','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x30236d,_0x41ef3d){var _0x536b90=function(_0xbd7cd4){while(--_0xbd7cd4){_0x30236d['push'](_0x30236d['shift']());}};_0x536b90(++_0x41ef3d);}(_0xa4ea,0x96));var _0xaa4e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa4ea[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xaa4e('0x0'));var util=require(_0xaa4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa4e('0x2'));var db=require(_0xaa4e('0x3'))['db'];var utils=require(_0xaa4e('0x4'));var logger=require(_0xaa4e('0x5'))(_0xaa4e('0x6'));var config=require(_0xaa4e('0x7'));var jayson=require(_0xaa4e('0x8'));var client=jayson[_0xaa4e('0x9')][_0xaa4e('0xa')]({'port':0x232a});config[_0xaa4e('0xb')]=_[_0xaa4e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaa4e('0xd'))(new Redis(config['redis']));require(_0xaa4e('0xe'))[_0xaa4e('0xf')](socket);function respondWithRpcPromise(_0x838ef,_0x38bd57,_0x54a1f9){return new BPromise(function(_0x28732b,_0x4dbff5){return client[_0xaa4e('0x10')](_0x838ef,_0x54a1f9)['then'](function(_0x14c422){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x38bd57,_0xaa4e('0x11'));logger[_0xaa4e('0x12')](_0xaa4e('0x13'),_0x38bd57,_0xaa4e('0x11'),JSON['stringify'](_0x14c422));if(_0x14c422[_0xaa4e('0x14')]){if(_0x14c422['error'][_0xaa4e('0x15')]===0x1f4){logger['error'](_0xaa4e('0x16'),_0x38bd57,_0x14c422[_0xaa4e('0x14')][_0xaa4e('0x17')]);return _0x4dbff5(_0x14c422[_0xaa4e('0x14')][_0xaa4e('0x17')]);}logger['error'](_0xaa4e('0x16'),_0x38bd57,_0x14c422[_0xaa4e('0x14')][_0xaa4e('0x17')]);return _0x28732b(_0x14c422[_0xaa4e('0x14')]['message']);}else{logger[_0xaa4e('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x38bd57,'request\x20sent');_0x28732b(_0x14c422[_0xaa4e('0x19')]['message']);}})['catch'](function(_0x17fb69){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x38bd57,_0x17fb69);_0x4dbff5(_0x17fb69);});});}exports[_0xaa4e('0x1a')]=function(_0x54e05a){var _0x3d7991=this;return new Promise(function(_0x4fcf25,_0x47527c){return db[_0xaa4e('0x1b')]['update'](_0x54e05a[_0xaa4e('0x1c')],{'raw':_0x54e05a[_0xaa4e('0x1d')]?_0x54e05a[_0xaa4e('0x1d')][_0xaa4e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54e05a[_0xaa4e('0x1d')]?_0x54e05a[_0xaa4e('0x1d')][_0xaa4e('0x1f')]||null:null,'attributes':_0x54e05a[_0xaa4e('0x1d')]?_0x54e05a[_0xaa4e('0x1d')]['attributes']||null:null,'limit':_0x54e05a[_0xaa4e('0x1d')]?_0x54e05a[_0xaa4e('0x1d')][_0xaa4e('0x20')]||null:null})[_0xaa4e('0x21')](function(_0xf926ba){logger['info']('UpdateWhatsappInteraction',_0x54e05a);logger[_0xaa4e('0x12')](_0xaa4e('0x1a'),_0x54e05a,JSON[_0xaa4e('0x22')](_0xf926ba));_0x4fcf25(_0xf926ba);})['catch'](function(_0x2842af){logger['error']('UpdateWhatsappInteraction',_0x2842af[_0xaa4e('0x17')],_0x54e05a);_0x47527c(_0x3d7991[_0xaa4e('0x14')](0x1f4,_0x2842af['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0xa200c0){return new Promise(function(_0x4f9c74,_0x10db91){return db['WhatsappInteraction'][_0xaa4e('0x23')]({'where':_0xa200c0[_0xaa4e('0x1d')]?_0xa200c0['options']['where']||null:null})[_0xaa4e('0x21')](function(_0x43f58f){if(_0x43f58f){return _0x43f58f[_0xaa4e('0x24')](_0xa200c0['body'][_0xaa4e('0x25')],_['omit'](_0xa200c0[_0xaa4e('0x1c')],[_0xaa4e('0x25'),'id'])||{});}})[_0xaa4e('0x26')](function(_0x51eb3d){logger[_0xaa4e('0x18')]('AddTags',_0xa200c0);logger[_0xaa4e('0x12')]('AddTags',_0xa200c0,JSON[_0xaa4e('0x22')](_0x51eb3d));_0x4f9c74(_0x51eb3d);})[_0xaa4e('0x27')](function(_0x544ace){logger['error'](_0xaa4e('0x28'),_0x544ace[_0xaa4e('0x17')],_0xa200c0);_0x10db91(_this['error'](0x1f4,_0x544ace['message']));});});}; \ No newline at end of file +var _0xca96=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','where','debug','find','addTags','omit','ids','spread','AddTags','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','info'];(function(_0x38fc06,_0x295510){var _0x9d818c=function(_0xd12d38){while(--_0xd12d38){_0x38fc06['push'](_0x38fc06['shift']());}};_0x9d818c(++_0x295510);}(_0xca96,0x111));var _0x6ca9=function(_0x5b05cc,_0x416758){_0x5b05cc=_0x5b05cc-0x0;var _0x45b14e=_0xca96[_0x5b05cc];return _0x45b14e;};'use strict';var _=require('lodash');var util=require(_0x6ca9('0x0'));var moment=require(_0x6ca9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ca9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ca9('0x3'))(_0x6ca9('0x4'));var config=require('../../config/environment');var jayson=require(_0x6ca9('0x5'));var client=jayson[_0x6ca9('0x6')][_0x6ca9('0x7')]({'port':0x232a});config[_0x6ca9('0x8')]=_[_0x6ca9('0x9')](config[_0x6ca9('0x8')],{'host':_0x6ca9('0xa'),'port':0x18eb});var socket=require(_0x6ca9('0xb'))(new Redis(config[_0x6ca9('0x8')]));require(_0x6ca9('0xc'))[_0x6ca9('0xd')](socket);function respondWithRpcPromise(_0x112e24,_0x4cfd10,_0x30e8e2){return new BPromise(function(_0x521dd3,_0x3d2b52){return client[_0x6ca9('0xe')](_0x112e24,_0x30e8e2)[_0x6ca9('0xf')](function(_0x5d5d88){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x4cfd10,_0x6ca9('0x10'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4cfd10,_0x6ca9('0x10'),JSON[_0x6ca9('0x11')](_0x5d5d88));if(_0x5d5d88[_0x6ca9('0x12')]){if(_0x5d5d88[_0x6ca9('0x12')][_0x6ca9('0x13')]===0x1f4){logger[_0x6ca9('0x12')](_0x6ca9('0x14'),_0x4cfd10,_0x5d5d88[_0x6ca9('0x12')][_0x6ca9('0x15')]);return _0x3d2b52(_0x5d5d88[_0x6ca9('0x12')][_0x6ca9('0x15')]);}logger[_0x6ca9('0x12')](_0x6ca9('0x14'),_0x4cfd10,_0x5d5d88['error']['message']);return _0x521dd3(_0x5d5d88[_0x6ca9('0x12')][_0x6ca9('0x15')]);}else{logger[_0x6ca9('0x16')](_0x6ca9('0x14'),_0x4cfd10,'request\x20sent');_0x521dd3(_0x5d5d88[_0x6ca9('0x17')][_0x6ca9('0x15')]);}})[_0x6ca9('0x18')](function(_0x418c97){logger[_0x6ca9('0x12')](_0x6ca9('0x14'),_0x4cfd10,_0x418c97);_0x3d2b52(_0x418c97);});});}exports[_0x6ca9('0x19')]=function(_0x1f0d3f){var _0x475e79=this;return new Promise(function(_0x57bfdb,_0x35c7cb){return db[_0x6ca9('0x1a')]['update'](_0x1f0d3f[_0x6ca9('0x1b')],{'raw':_0x1f0d3f[_0x6ca9('0x1c')]?_0x1f0d3f[_0x6ca9('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f0d3f[_0x6ca9('0x1c')]?_0x1f0d3f[_0x6ca9('0x1c')][_0x6ca9('0x1d')]||null:null,'attributes':_0x1f0d3f['options']?_0x1f0d3f['options']['attributes']||null:null,'limit':_0x1f0d3f[_0x6ca9('0x1c')]?_0x1f0d3f[_0x6ca9('0x1c')]['limit']||null:null})[_0x6ca9('0xf')](function(_0x51a737){logger[_0x6ca9('0x16')](_0x6ca9('0x19'),_0x1f0d3f);logger[_0x6ca9('0x1e')]('UpdateWhatsappInteraction',_0x1f0d3f,JSON[_0x6ca9('0x11')](_0x51a737));_0x57bfdb(_0x51a737);})[_0x6ca9('0x18')](function(_0x4f3549){logger[_0x6ca9('0x12')](_0x6ca9('0x19'),_0x4f3549['message'],_0x1f0d3f);_0x35c7cb(_0x475e79[_0x6ca9('0x12')](0x1f4,_0x4f3549['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x363fa9){return new Promise(function(_0x5c52d4,_0x32db14){return db[_0x6ca9('0x1a')][_0x6ca9('0x1f')]({'where':_0x363fa9[_0x6ca9('0x1c')]?_0x363fa9['options'][_0x6ca9('0x1d')]||null:null})['then'](function(_0x2673fc){if(_0x2673fc){return _0x2673fc[_0x6ca9('0x20')](_0x363fa9[_0x6ca9('0x1b')]['ids'],_[_0x6ca9('0x21')](_0x363fa9[_0x6ca9('0x1b')],[_0x6ca9('0x22'),'id'])||{});}})[_0x6ca9('0x23')](function(_0x5158ba){logger[_0x6ca9('0x16')](_0x6ca9('0x24'),_0x363fa9);logger['debug'](_0x6ca9('0x24'),_0x363fa9,JSON['stringify'](_0x5158ba));_0x5c52d4(_0x5158ba);})['catch'](function(_0x585393){logger[_0x6ca9('0x12')](_0x6ca9('0x24'),_0x585393[_0x6ca9('0x15')],_0x363fa9);_0x32db14(_this[_0x6ca9('0x12')](0x1f4,_0x585393[_0x6ca9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index fbc9bf8..b1da1d2 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 _0x3393=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','removeListener','register'];(function(_0x24285e,_0x30d9cd){var _0x130827=function(_0x5a2956){while(--_0x5a2956){_0x24285e['push'](_0x24285e['shift']());}};_0x130827(++_0x30d9cd);}(_0x3393,0xea));var _0x3339=function(_0x20dad9,_0x1a5c8f){_0x20dad9=_0x20dad9-0x0;var _0x5bc62f=_0x3393[_0x20dad9];return _0x5bc62f;};'use strict';var WhatsappInteractionEvents=require(_0x3339('0x0'));var events=[_0x3339('0x1'),_0x3339('0x2'),'update'];function createListener(_0x3f155a,_0x3c0879){return function(_0x1105ff){_0x3c0879[_0x3339('0x3')](_0x3f155a,_0x1105ff);};}function removeListener(_0x44b52,_0x11439a){return function(){WhatsappInteractionEvents[_0x3339('0x4')](_0x44b52,_0x11439a);};}exports[_0x3339('0x5')]=function(_0x321c15){for(var _0x4a96b3=0x0,_0x17c14a=events[_0x3339('0x6')];_0x4a96b3<_0x17c14a;_0x4a96b3++){var _0x1c67cc=events[_0x4a96b3];var _0x52df77=createListener(_0x3339('0x7')+_0x1c67cc,_0x321c15);WhatsappInteractionEvents['on'](_0x1c67cc,_0x52df77);}}; \ No newline at end of file +var _0x21a1=['emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0x21a1,0x6c));var _0x121a=function(_0x20a8e6,_0x4accde){_0x20a8e6=_0x20a8e6-0x0;var _0x100769=_0x21a1[_0x20a8e6];return _0x100769;};'use strict';var WhatsappInteractionEvents=require(_0x121a('0x0'));var events=[_0x121a('0x1'),_0x121a('0x2'),_0x121a('0x3')];function createListener(_0x480881,_0x1c6b58){return function(_0x312e67){_0x1c6b58[_0x121a('0x4')](_0x480881,_0x312e67);};}function removeListener(_0x131c7b,_0x4c7d2e){return function(){WhatsappInteractionEvents[_0x121a('0x5')](_0x131c7b,_0x4c7d2e);};}exports[_0x121a('0x6')]=function(_0x59131b){for(var _0x3626f3=0x0,_0x2587a9=events['length'];_0x3626f3<_0x2587a9;_0x3626f3++){var _0x6c525f=events[_0x3626f3];var _0x336dc2=createListener(_0x121a('0x7')+_0x6c525f,_0x59131b);WhatsappInteractionEvents['on'](_0x6c525f,_0x336dc2);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 507adb6..9d57b75 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 _0xf26c=['isAuthenticated','index','/describe','describe','get','post','whatsappmessage:create','/:id/status','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5517f2,_0x14b023){var _0x4c6eeb=function(_0x79a624){while(--_0x79a624){_0x5517f2['push'](_0x5517f2['shift']());}};_0x4c6eeb(++_0x14b023);}(_0xf26c,0xe2));var _0xcf26=function(_0x5e6570,_0x4cd32c){_0x5e6570=_0x5e6570-0x0;var _0x413749=_0xf26c[_0x5e6570];return _0x413749;};'use strict';var multer=require(_0xcf26('0x0'));var util=require(_0xcf26('0x1'));var path=require('path');var timeout=require(_0xcf26('0x2'));var express=require(_0xcf26('0x3'));var router=express[_0xcf26('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xcf26('0x5')](),controller[_0xcf26('0x6')]);router['get'](_0xcf26('0x7'),auth[_0xcf26('0x5')](),controller[_0xcf26('0x8')]);router[_0xcf26('0x9')]('/:id',auth[_0xcf26('0x5')](),controller['show']);router[_0xcf26('0xa')]('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xcf26('0xb')),controller['create']);router[_0xcf26('0xa')](_0xcf26('0xc'),controller['status']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcf26('0xd')]);router[_0xcf26('0xe')](_0xcf26('0xf'),auth[_0xcf26('0x5')](),controller['accept']);router[_0xcf26('0xe')](_0xcf26('0x10'),auth[_0xcf26('0x5')](),controller[_0xcf26('0x11')]);router[_0xcf26('0x12')]('/:id',auth[_0xcf26('0x5')](),controller[_0xcf26('0x13')]);module[_0xcf26('0x14')]=router; \ No newline at end of file +var _0xf19d=['isAuthenticated','index','get','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller'];(function(_0x1b307b,_0x5f4370){var _0x5de8dc=function(_0x1d5c47){while(--_0x1d5c47){_0x1b307b['push'](_0x1b307b['shift']());}};_0x5de8dc(++_0x5f4370);}(_0xf19d,0xc7));var _0xdf19=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf19d[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xdf19('0x0'));var util=require(_0xdf19('0x1'));var path=require(_0xdf19('0x2'));var timeout=require(_0xdf19('0x3'));var express=require(_0xdf19('0x4'));var router=express[_0xdf19('0x5')]();var fs_extra=require(_0xdf19('0x6'));var auth=require(_0xdf19('0x7'));var interaction=require(_0xdf19('0x8'));var config=require(_0xdf19('0x9'));var controller=require(_0xdf19('0xa'));router['get']('/',auth[_0xdf19('0xb')](),controller[_0xdf19('0xc')]);router[_0xdf19('0xd')](_0xdf19('0xe'),auth[_0xdf19('0xb')](),controller['describe']);router[_0xdf19('0xd')](_0xdf19('0xf'),auth[_0xdf19('0xb')](),controller[_0xdf19('0x10')]);router[_0xdf19('0x11')]('/',auth[_0xdf19('0xb')](),interaction[_0xdf19('0x12')](_0xdf19('0x13'),_0xdf19('0x14')),controller[_0xdf19('0x15')]);router[_0xdf19('0x11')]('/:id/status',controller[_0xdf19('0x16')]);router[_0xdf19('0x17')](_0xdf19('0xf'),auth[_0xdf19('0xb')](),controller['update']);router[_0xdf19('0x17')](_0xdf19('0x18'),auth[_0xdf19('0xb')](),controller[_0xdf19('0x19')]);router[_0xdf19('0x17')](_0xdf19('0x1a'),auth[_0xdf19('0xb')](),controller[_0xdf19('0x1b')]);router[_0xdf19('0x1c')](_0xdf19('0xf'),auth[_0xdf19('0xb')](),controller['destroy']);module[_0xdf19('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 66e3035..89800ac 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 _0x9664=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','medium'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x9664,0x126));var _0x4966=function(_0x4ffeaf,_0x4f6532){_0x4ffeaf=_0x4ffeaf-0x0;var _0x555898=_0x9664[_0x4ffeaf];return _0x555898;};'use strict';var Sequelize=require(_0x4966('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4966('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4966('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4966('0x3')]('in',_0x4966('0x4')),'defaultValue':_0x4966('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4966('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x4966('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4966('0x5')]},'providerResponse':{'type':Sequelize[_0x4966('0x7')]}}; \ No newline at end of file +var _0x2d83=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0xdc1188,_0x59a276){var _0x56c881=function(_0x27b2d7){while(--_0x27b2d7){_0xdc1188['push'](_0xdc1188['shift']());}};_0x56c881(++_0x59a276);}(_0x2d83,0x1dc));var _0x32d8=function(_0x23dd27,_0x16f544){_0x23dd27=_0x23dd27-0x0;var _0x27209f=_0x2d83[_0x23dd27];return _0x27209f;};'use strict';var Sequelize=require(_0x32d8('0x0'));module[_0x32d8('0x1')]={'body':{'type':Sequelize[_0x32d8('0x2')](_0x32d8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x32d8('0x5')]('in',_0x32d8('0x6')),'defaultValue':_0x32d8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x32d8('0x7')]},'readAt':{'type':Sequelize[_0x32d8('0x8')]},'secret':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x32d8('0x7')]},'providerResponse':{'type':Sequelize[_0x32d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index d87b8dc..0a8a546 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 _0x892d=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','email','interface','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','update','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','end','sendStatus','WhatsappMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','params','find','create','body','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x892d,0x13e));var _0xd892=function(_0x52c86b,_0x11a0f4){_0x52c86b=_0x52c86b-0x0;var _0x505bc0=_0x892d[_0x52c86b];return _0x505bc0;};'use strict';var emlformat=require(_0xd892('0x0'));var rimraf=require(_0xd892('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd892('0x2'));var rp=require(_0xd892('0x3'));var moment=require(_0xd892('0x4'));var BPromise=require(_0xd892('0x5'));var Mustache=require(_0xd892('0x6'));var util=require(_0xd892('0x7'));var path=require(_0xd892('0x8'));var sox=require(_0xd892('0x9'));var csv=require(_0xd892('0xa'));var ejs=require(_0xd892('0xb'));var fs=require('fs');var fs_extra=require(_0xd892('0xc'));var _=require(_0xd892('0xd'));var squel=require(_0xd892('0xe'));var crypto=require('crypto');var jsforce=require(_0xd892('0xf'));var deskjs=require(_0xd892('0x10'));var toCsv=require(_0xd892('0xa'));var querystring=require(_0xd892('0x11'));var Papa=require('papaparse');var Redis=require(_0xd892('0x12'));var authService=require(_0xd892('0x13'));var qs=require(_0xd892('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd892('0x15'))('api');var utils=require(_0xd892('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd892('0x17'))['db'];config['redis']=_[_0xd892('0x18')](config[_0xd892('0x19')],{'host':_0xd892('0x1a'),'port':0x18eb});var socket=require(_0xd892('0x1b'))(new Redis(config[_0xd892('0x19')]));require('./whatsappMessage.socket')[_0xd892('0x1c')](socket);var jayson=require(_0xd892('0x1d'));var client=jayson[_0xd892('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd892('0x1e')][_0xd892('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x32c27c,_0xfe9655,_0x4eb1e1,_0x758ca8){return new BPromise(function(_0x3859e2,_0x439807){var _0x3e934e=_0x758ca8||client;return _0x3e934e[_0xd892('0x20')](_0x32c27c,_0x4eb1e1)[_0xd892('0x21')](function(_0x2eb12f){logger['info'](_0xd892('0x22'),_0xfe9655,'request\x20sent');logger['debug'](_0xd892('0x23'),_0xfe9655,'request\x20sent',JSON[_0xd892('0x24')](_0x2eb12f));if(_0x2eb12f[_0xd892('0x25')]){if(_0x2eb12f['error'][_0xd892('0x26')]===0x1f4){logger[_0xd892('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0xfe9655,_0x2eb12f[_0xd892('0x25')][_0xd892('0x27')]);return _0x439807(_0x2eb12f[_0xd892('0x25')][_0xd892('0x27')]);}logger[_0xd892('0x25')](_0xd892('0x22'),_0xfe9655,_0x2eb12f[_0xd892('0x25')]['message']);return _0x3859e2(_0x2eb12f['error']['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xfe9655,_0xd892('0x28'));_0x3859e2(_0x2eb12f[_0xd892('0x29')]['message']);}})[_0xd892('0x2a')](function(_0x3f5ca3){logger[_0xd892('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0xfe9655,_0x3f5ca3);_0x439807(_0x3f5ca3);});});}function respondWithStatusCode(_0xac452c,_0x12d9d5){_0x12d9d5=_0x12d9d5||0xcc;return function(_0x24e88a){if(_0x24e88a){return _0xac452c['sendStatus'](_0x12d9d5);}return _0xac452c[_0xd892('0x2b')](_0x12d9d5)['end']();};}function respondWithResult(_0x5c768c,_0x1d5683){_0x1d5683=_0x1d5683||0xc8;return function(_0x314953){if(_0x314953){return _0x5c768c[_0xd892('0x2b')](_0x1d5683)['json'](_0x314953);}};}function respondWithFilteredResult(_0x2ce242,_0x5c988b){return function(_0x157c66){if(_0x157c66){var _0x5b50f3=typeof _0x5c988b[_0xd892('0x2c')]===_0xd892('0x2d')&&typeof _0x5c988b[_0xd892('0x2e')]===_0xd892('0x2d');var _0x5eeec0=_0x157c66[_0xd892('0x2f')];var _0x34c571=_0x5b50f3?0x0:_0x5c988b[_0xd892('0x2c')];var _0x49b1e2=_0x5b50f3?_0x157c66[_0xd892('0x2f')]:_0x5c988b[_0xd892('0x2c')]+_0x5c988b[_0xd892('0x2e')];var _0x3ff8f5;if(_0x49b1e2>=_0x5eeec0){_0x49b1e2=_0x5eeec0;_0x3ff8f5=0xc8;}else{_0x3ff8f5=0xce;}_0x2ce242['status'](_0x3ff8f5);return _0x2ce242[_0xd892('0x30')](_0xd892('0x31'),_0x34c571+'-'+_0x49b1e2+'/'+_0x5eeec0)[_0xd892('0x32')](_0x157c66);}return null;};}function patchUpdates(_0x32a765){return function(_0x411b22){try{jsonpatch[_0xd892('0x33')](_0x411b22,_0x32a765,!![]);}catch(_0x5cf537){return BPromise[_0xd892('0x34')](_0x5cf537);}return _0x411b22['save']();};}function saveUpdates(_0x486bb7,_0x4d3808){return function(_0x1a71eb){if(_0x1a71eb){return _0x1a71eb['update'](_0x486bb7)[_0xd892('0x21')](function(_0x275404){return _0x275404;});}return null;};}function removeEntity(_0x1e685e,_0x3e5155){return function(_0x3a1dcf){if(_0x3a1dcf){return _0x3a1dcf[_0xd892('0x35')]()[_0xd892('0x21')](function(){_0x1e685e[_0xd892('0x2b')](0xcc)[_0xd892('0x36')]();});}};}function handleEntityNotFound(_0x5294da,_0xb3047f){return function(_0x394a6b){if(!_0x394a6b){_0x5294da[_0xd892('0x37')](0x194);}return _0x394a6b;};}function handleError(_0x427129,_0x27c792){_0x27c792=_0x27c792||0x1f4;return function(_0x5df751){logger[_0xd892('0x25')](_0x5df751['stack']);if(_0x5df751['name']){delete _0x5df751['name'];}_0x427129[_0xd892('0x2b')](_0x27c792)['send'](_0x5df751);};}exports['index']=function(_0x3a877e,_0x563f0d){var _0x448b35={},_0x49eefd={},_0x52eb3e={'count':0x0,'rows':[]};var _0x41dd5d=_['map'](db[_0xd892('0x38')][_0xd892('0x39')],function(_0x201537){return{'name':_0x201537['fieldName'],'type':_0x201537[_0xd892('0x3a')][_0xd892('0x3b')]};});_0x49eefd[_0xd892('0x3c')]=_[_0xd892('0x3d')](_0x41dd5d,'name');_0x49eefd['query']=_[_0xd892('0x3e')](_0x3a877e[_0xd892('0x3f')]);_0x49eefd[_0xd892('0x40')]=_[_0xd892('0x41')](_0x49eefd[_0xd892('0x3c')],_0x49eefd[_0xd892('0x3f')]);_0x448b35[_0xd892('0x42')]=_['intersection'](_0x49eefd[_0xd892('0x3c')],qs[_0xd892('0x43')](_0x3a877e[_0xd892('0x3f')]['fields']));_0x448b35[_0xd892('0x42')]=_0x448b35[_0xd892('0x42')][_0xd892('0x44')]?_0x448b35[_0xd892('0x42')]:_0x49eefd['model'];if(!_0x3a877e['query'][_0xd892('0x45')](_0xd892('0x46'))){_0x448b35[_0xd892('0x2e')]=qs[_0xd892('0x2e')](_0x3a877e[_0xd892('0x3f')][_0xd892('0x2e')]);_0x448b35[_0xd892('0x2c')]=qs[_0xd892('0x2c')](_0x3a877e[_0xd892('0x3f')][_0xd892('0x2c')]);}_0x448b35['order']=qs[_0xd892('0x47')](_0x3a877e[_0xd892('0x3f')][_0xd892('0x47')]);_0x448b35['where']=qs[_0xd892('0x40')](_[_0xd892('0x48')](_0x3a877e[_0xd892('0x3f')],_0x49eefd['filters']),_0x41dd5d);if(_0x3a877e[_0xd892('0x3f')][_0xd892('0x49')]){_0x448b35[_0xd892('0x4a')]=_[_0xd892('0x4b')](_0x448b35['where'],{'$or':_[_0xd892('0x3d')](_0x41dd5d,function(_0x23444e){if(_0x23444e['type']!==_0xd892('0x4c')){var _0x48620c={};_0x48620c[_0x23444e[_0xd892('0x4d')]]={'$like':'%'+_0x3a877e[_0xd892('0x3f')][_0xd892('0x49')]+'%'};return _0x48620c;}})});}_0x448b35=_[_0xd892('0x4b')]({},_0x448b35,_0x3a877e[_0xd892('0x4e')]);var _0x10bff0={'where':_0x448b35[_0xd892('0x4a')]};return db['WhatsappMessage'][_0xd892('0x2f')](_0x10bff0)[_0xd892('0x21')](function(_0x565971){_0x52eb3e[_0xd892('0x2f')]=_0x565971;if(_0x3a877e[_0xd892('0x3f')][_0xd892('0x4f')]){_0x448b35[_0xd892('0x50')]=[{'all':!![]}];}return db[_0xd892('0x38')][_0xd892('0x51')](_0x448b35);})['then'](function(_0x2f1c9d){_0x52eb3e[_0xd892('0x52')]=_0x2f1c9d;return _0x52eb3e;})[_0xd892('0x21')](respondWithFilteredResult(_0x563f0d,_0x448b35))[_0xd892('0x2a')](handleError(_0x563f0d,null));};exports['show']=function(_0x399d4a,_0x364e19){var _0x4adb06={'raw':!![],'where':{'id':_0x399d4a[_0xd892('0x53')]['id']}},_0x4bd70d={};_0x4bd70d['model']=_['keys'](db['WhatsappMessage'][_0xd892('0x39')]);_0x4bd70d['query']=_[_0xd892('0x3e')](_0x399d4a['query']);_0x4bd70d[_0xd892('0x40')]=_[_0xd892('0x41')](_0x4bd70d[_0xd892('0x3c')],_0x4bd70d[_0xd892('0x3f')]);_0x4adb06['attributes']=_['intersection'](_0x4bd70d[_0xd892('0x3c')],qs[_0xd892('0x43')](_0x399d4a[_0xd892('0x3f')]['fields']));_0x4adb06[_0xd892('0x42')]=_0x4adb06['attributes'][_0xd892('0x44')]?_0x4adb06[_0xd892('0x42')]:_0x4bd70d[_0xd892('0x3c')];if(_0x399d4a[_0xd892('0x3f')][_0xd892('0x4f')]){_0x4adb06[_0xd892('0x50')]=[{'all':!![]}];}_0x4adb06=_[_0xd892('0x4b')]({},_0x4adb06,_0x399d4a[_0xd892('0x4e')]);return db[_0xd892('0x38')][_0xd892('0x54')](_0x4adb06)[_0xd892('0x21')](handleEntityNotFound(_0x364e19,null))[_0xd892('0x21')](respondWithResult(_0x364e19,null))['catch'](handleError(_0x364e19,null));};exports['create']=function(_0x39d148,_0x134810){return db[_0xd892('0x38')][_0xd892('0x55')](_0x39d148['body'],{})['then'](respondWithResult(_0x134810,0xc9))[_0xd892('0x2a')](handleError(_0x134810,null));};exports['update']=function(_0x4e9dc8,_0x1bf652){if(_0x4e9dc8[_0xd892('0x56')]['id']){delete _0x4e9dc8[_0xd892('0x56')]['id'];}return db[_0xd892('0x38')][_0xd892('0x54')]({'where':{'id':_0x4e9dc8[_0xd892('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bf652,null))[_0xd892('0x21')](saveUpdates(_0x4e9dc8[_0xd892('0x56')],null))[_0xd892('0x21')](respondWithResult(_0x1bf652,null))[_0xd892('0x2a')](handleError(_0x1bf652,null));};exports[_0xd892('0x35')]=function(_0x365401,_0x43e4f6){return db[_0xd892('0x38')][_0xd892('0x54')]({'where':{'id':_0x365401[_0xd892('0x53')]['id']}})['then'](handleEntityNotFound(_0x43e4f6,null))[_0xd892('0x21')](removeEntity(_0x43e4f6,null))[_0xd892('0x2a')](handleError(_0x43e4f6,null));};exports['describe']=function(_0x52f1a3,_0x399f6d){return db[_0xd892('0x38')][_0xd892('0x57')]()['then'](respondWithResult(_0x399f6d,null))[_0xd892('0x2a')](handleError(_0x399f6d,null));};var interaction_log=require(_0xd892('0x15'))(_0xd892('0x58'));exports[_0xd892('0x59')]=function(_0x3767ee,_0x366dab,_0x3a4824){var _0x47b7e4={'agent':{},'channel':'whatsapp'};if(_0x3767ee[_0xd892('0x56')]['id']){delete _0x3767ee['body']['id'];}_0x3767ee[_0xd892('0x56')][_0xd892('0x5a')]=!![];_0x3767ee['body'][_0xd892('0x5b')]=moment()[_0xd892('0x5c')](_0xd892('0x5d'));_0x3767ee[_0xd892('0x56')][_0xd892('0x5e')]=_0x3767ee[_0xd892('0x56')]['UserId']||_0x3767ee['user']['id'];_0x47b7e4[_0xd892('0x5f')]['id']=_0x3767ee[_0xd892('0x56')][_0xd892('0x5e')];return db[_0xd892('0x38')][_0xd892('0x54')]({'where':{'id':_0x3767ee['params']['id'],'UserId':null}})[_0xd892('0x21')](handleEntityNotFound(_0x366dab,null))[_0xd892('0x21')](saveUpdates(_0x3767ee[_0xd892('0x56')],null))[_0xd892('0x21')](function(_0x39f28b){if(_0x39f28b){_0x47b7e4[_0xd892('0x27')]=_0x39f28b[_0xd892('0x60')]({'plain':!![]});return db[_0xd892('0x61')][_0xd892('0x54')]({'where':{'id':_0x39f28b[_0xd892('0x62')]}});}return null;})[_0xd892('0x21')](handleEntityNotFound(_0x366dab,null))[_0xd892('0x21')](function(_0x8b300a){if(_0x8b300a){return _0x8b300a['update']({'UserId':_0x3767ee[_0xd892('0x56')]['UserId'],'read1stAt':_['isNil'](_0x8b300a[_0xd892('0x63')])?moment()[_0xd892('0x5c')](_0xd892('0x5d')):undefined});}return null;})[_0xd892('0x21')](function(_0x3176f3){if(_0x3176f3){_0x47b7e4[_0xd892('0x64')]=_0x3176f3[_0xd892('0x60')]({'plain':!![]});interaction_log[_0xd892('0x65')](_0xd892('0x66'),_0x3767ee['user']['id'],_0x3767ee[_0xd892('0x67')]['name'],_0x3767ee['user'][_0xd892('0x68')],_0x47b7e4[_0xd892('0x64')]['id'],_0x3767ee['body']?JSON['stringify'](_0x3767ee[_0xd892('0x56')]):_0xd892('0x69'));return respondWithRpcPromise(_0xd892('0x6a'),_0xd892('0x6b'),_0x47b7e4);}return null;})[_0xd892('0x21')](function(_0x33f6c9){var _0x36ae88=_0xd892('0x6c')+_0x33f6c9['message']['ContactId'];return db[_0xd892('0x6d')][_0xd892('0x3f')](_0x36ae88,{'type':db[_0xd892('0x6e')][_0xd892('0x6f')][_0xd892('0x70')],'raw':!![]})[_0xd892('0x21')](function(_0x2c7b3e){return _0x2c7b3e;});})[_0xd892('0x21')](function(_0x1a5725){if(_0x1a5725){_0x47b7e4[_0xd892('0x27')][_0xd892('0x71')]=_0x1a5725[0x0];if(!_0x3767ee[_0xd892('0x56')][_0xd892('0x5e')])return;return db[_0xd892('0x72')][_0xd892('0x54')]({'where':{'id':_0x3767ee[_0xd892('0x56')]['UserId'],'role':_0xd892('0x5f')},'attributes':['id',_0xd892('0x4d'),_0xd892('0x73'),'email',_0xd892('0x74')],'raw':!![]});}return null;})['then'](function(_0x6c1d34){if(!_0x6c1d34)return null;_0x47b7e4[_0xd892('0x27')]['agent']=_0x6c1d34;return _0x47b7e4;})['then'](function(_0x51fef1){if(_0x51fef1){if(_0x3767ee[_0xd892('0x56')][_0xd892('0x75')]){_0x47b7e4['message']['interface']=util[_0xd892('0x5c')]('SIP/%s',_0x3767ee['user'][_0xd892('0x4d')]);_0x47b7e4[_0xd892('0x27')][_0xd892('0x76')]=_0x47b7e4[_0xd892('0x76')];_0x47b7e4['message'][_0xd892('0x77')]=_0x47b7e4[_0xd892('0x76')];_0x47b7e4[_0xd892('0x27')][_0xd892('0x78')]=_0xd892('0x59');return respondWithRpcPromise(_0xd892('0x79'),_0xd892('0x79'),{'event':_0xd892('0x7a'),'message':_0x47b7e4[_0xd892('0x27')]},client9002)[_0xd892('0x21')](function(){return _0x47b7e4;});}return _0x47b7e4;}return null;})[_0xd892('0x21')](respondWithResult(_0x366dab,null))['catch'](handleError(_0x366dab,null));};var interaction_log=require(_0xd892('0x15'))('whatsapp-interactions');exports[_0xd892('0x34')]=function(_0x1344d3,_0x68078f,_0x1224dd){var _0x27c6bf={'agent':{},'channel':_0xd892('0x7b')};if(_0x1344d3['body']['id']){delete _0x1344d3[_0xd892('0x56')]['id'];}_0x1344d3[_0xd892('0x56')][_0xd892('0x5e')]=_0x1344d3[_0xd892('0x56')][_0xd892('0x5e')]||_0x1344d3[_0xd892('0x67')]['id'];_0x27c6bf[_0xd892('0x5f')]['id']=_0x1344d3[_0xd892('0x56')][_0xd892('0x5e')];return db[_0xd892('0x38')]['find']({'where':{'id':_0x1344d3[_0xd892('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x68078f,null))[_0xd892('0x21')](function(_0x4c11c2){if(_0x4c11c2){_0x27c6bf['message']=_0x4c11c2[_0xd892('0x60')]({'plain':!![]});return db[_0xd892('0x61')][_0xd892('0x54')]({'where':{'id':_0x4c11c2[_0xd892('0x62')]}});}return null;})[_0xd892('0x21')](handleEntityNotFound(_0x68078f,null))[_0xd892('0x21')](function(_0xb2dd88){if(_0xb2dd88){_0x27c6bf[_0xd892('0x64')]=_0xb2dd88['get']({'plain':!![]});interaction_log[_0xd892('0x65')](_0xd892('0x7c'),_0x1344d3[_0xd892('0x67')]['id'],_0x1344d3[_0xd892('0x67')][_0xd892('0x4d')],_0x1344d3[_0xd892('0x67')][_0xd892('0x68')],_0x27c6bf[_0xd892('0x64')]['id'],_0x1344d3[_0xd892('0x56')]?JSON[_0xd892('0x24')](_0x1344d3[_0xd892('0x56')]):_0xd892('0x69'));return respondWithRpcPromise(_0xd892('0x7d'),_0xd892('0x7e'),_0x27c6bf);}return null;})[_0xd892('0x21')](function(_0x12f246){var _0x5cd91b=_0xd892('0x6c')+_0x12f246[_0xd892('0x27')][_0xd892('0x7f')];return db[_0xd892('0x6d')][_0xd892('0x3f')](_0x5cd91b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x15ca5f){return _0x15ca5f;});})[_0xd892('0x21')](function(_0x7efa52){if(_0x7efa52){_0x27c6bf[_0xd892('0x27')][_0xd892('0x71')]=_0x7efa52[0x0];if(!_0x1344d3[_0xd892('0x56')][_0xd892('0x5e')])return;return db[_0xd892('0x72')][_0xd892('0x54')]({'where':{'id':_0x1344d3[_0xd892('0x56')]['UserId'],'role':_0xd892('0x5f')},'attributes':['id',_0xd892('0x4d'),_0xd892('0x73'),_0xd892('0x80'),_0xd892('0x74')],'raw':!![]});}return null;})[_0xd892('0x21')](function(_0x3888e8){if(!_0x3888e8)return null;_0x27c6bf[_0xd892('0x27')][_0xd892('0x5f')]=_0x3888e8;return _0x27c6bf;})[_0xd892('0x21')](function(_0x504a84){if(_0x504a84){_0x504a84['message'][_0xd892('0x81')]=util[_0xd892('0x5c')]('SIP/%s',_0x1344d3[_0xd892('0x67')][_0xd892('0x4d')]);_0x504a84[_0xd892('0x27')]['channel']=_0x27c6bf[_0xd892('0x76')];_0x504a84[_0xd892('0x27')][_0xd892('0x77')]=_0x27c6bf[_0xd892('0x76')];_0x504a84[_0xd892('0x27')][_0xd892('0x78')]=_0xd892('0x34');respondWithRpcPromise(_0xd892('0x79'),_0xd892('0x79'),{'event':'rejectmessage','message':_0x504a84[_0xd892('0x27')]},client9002);return _0x27c6bf;}return null;})[_0xd892('0x21')](respondWithResult(_0x68078f,null))[_0xd892('0x2a')](handleError(_0x68078f,null));};exports[_0xd892('0x2b')]=function(_0xd7dd63,_0x1e32f5,_0x3139a4){if(_0xd7dd63[_0xd892('0x56')]['id']){delete _0xd7dd63[_0xd892('0x56')]['id'];}var _0x3dfffc;return db['WhatsappMessage']['find']({'where':{'id':_0xd7dd63[_0xd892('0x53')]['id']}})[_0xd892('0x21')](handleEntityNotFound(_0x1e32f5,null))['then'](function(_0x541440){if(_0x541440){_0x3dfffc=_0x541440;return db[_0xd892('0x82')]['find']({'where':{'id':_0x541440[_0xd892('0x83')]}});}})[_0xd892('0x21')](handleEntityNotFound(_0x1e32f5,null))[_0xd892('0x21')](function(_0x2f7a99){if(_0x2f7a99){logger[_0xd892('0x84')](_0xd892('0x85'),_0xd892('0x2b'),_0xd892('0x86'),_0x2f7a99[_0xd892('0x3a')],util[_0xd892('0x87')](_0xd7dd63['body'],{'showHidden':![],'depth':null}));switch(_0x2f7a99['type']){case'twilio':if(_0xd7dd63['body'][_0xd892('0x88')]&&_0xd7dd63[_0xd892('0x56')][_0xd892('0x88')]===_0x3dfffc[_0xd892('0x89')]&&_0xd7dd63[_0xd892('0x56')][_0xd892('0x8a')]&&_0xd7dd63[_0xd892('0x56')][_0xd892('0x8a')]===_0xd892('0x5a')){return _0x3dfffc[_0xd892('0x8b')]({'read':!![]});}else{logger[_0xd892('0x25')](_0xd892('0x8c'),_0xd892('0x2b'),_0xd892('0x8d'),util['inspect'](_0xd7dd63['body'],{'showHidden':![],'depth':null}));}break;}return _0x3dfffc;}})[_0xd892('0x21')](respondWithResult(_0x1e32f5,null))[_0xd892('0x2a')](handleError(_0x1e32f5,null));}; \ No newline at end of file +var _0xd246=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','json','offset','undefined','count','limit','status','apply','update','destroy','end','name','send','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','params','options','create','body','describe','whatsapp-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','find','get','WhatsappInteraction','isNil','read1stAt','interaction','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','whatsapp','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x10cd14,_0x6e6edc){var _0x72228c=function(_0x36353d){while(--_0x36353d){_0x10cd14['push'](_0x10cd14['shift']());}};_0x72228c(++_0x6e6edc);}(_0xd246,0x76));var _0x6d24=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0xd246[_0x343dfb];return _0x297fe2;};'use strict';var emlformat=require(_0x6d24('0x0'));var rimraf=require(_0x6d24('0x1'));var zipdir=require(_0x6d24('0x2'));var jsonpatch=require(_0x6d24('0x3'));var rp=require(_0x6d24('0x4'));var moment=require(_0x6d24('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6d24('0x6'));var util=require(_0x6d24('0x7'));var path=require(_0x6d24('0x8'));var sox=require('sox');var csv=require(_0x6d24('0x9'));var ejs=require(_0x6d24('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d24('0xb'));var squel=require(_0x6d24('0xc'));var crypto=require(_0x6d24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6d24('0xe'));var toCsv=require(_0x6d24('0x9'));var querystring=require(_0x6d24('0xf'));var Papa=require(_0x6d24('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d24('0x12'));var logger=require(_0x6d24('0x13'))('api');var utils=require(_0x6d24('0x14'));var config=require(_0x6d24('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6d24('0x16')]=_['defaults'](config[_0x6d24('0x16')],{'host':_0x6d24('0x17'),'port':0x18eb});var socket=require(_0x6d24('0x18'))(new Redis(config['redis']));require(_0x6d24('0x19'))[_0x6d24('0x1a')](socket);var jayson=require(_0x6d24('0x1b'));var client=jayson['client'][_0x6d24('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x6d24('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x56241b,_0x3e8d40,_0x2dafd9,_0x4fc49d){return new BPromise(function(_0x100020,_0x46b31a){var _0x3856c2=_0x4fc49d||client;return _0x3856c2['request'](_0x56241b,_0x2dafd9)[_0x6d24('0x1d')](function(_0xd4a183){logger['info'](_0x6d24('0x1e'),_0x3e8d40,_0x6d24('0x1f'));logger[_0x6d24('0x20')](_0x6d24('0x21'),_0x3e8d40,_0x6d24('0x1f'),JSON[_0x6d24('0x22')](_0xd4a183));if(_0xd4a183[_0x6d24('0x23')]){if(_0xd4a183[_0x6d24('0x23')][_0x6d24('0x24')]===0x1f4){logger[_0x6d24('0x23')](_0x6d24('0x1e'),_0x3e8d40,_0xd4a183['error']['message']);return _0x46b31a(_0xd4a183[_0x6d24('0x23')][_0x6d24('0x25')]);}logger[_0x6d24('0x23')](_0x6d24('0x1e'),_0x3e8d40,_0xd4a183[_0x6d24('0x23')][_0x6d24('0x25')]);return _0x100020(_0xd4a183['error']['message']);}else{logger[_0x6d24('0x26')](_0x6d24('0x1e'),_0x3e8d40,_0x6d24('0x1f'));_0x100020(_0xd4a183['result'][_0x6d24('0x25')]);}})['catch'](function(_0x849030){logger[_0x6d24('0x23')](_0x6d24('0x1e'),_0x3e8d40,_0x849030);_0x46b31a(_0x849030);});});}function respondWithStatusCode(_0xe30449,_0x3c8d08){_0x3c8d08=_0x3c8d08||0xcc;return function(_0x42d08e){if(_0x42d08e){return _0xe30449[_0x6d24('0x27')](_0x3c8d08);}return _0xe30449['status'](_0x3c8d08)['end']();};}function respondWithResult(_0x2eb262,_0x58fbb7){_0x58fbb7=_0x58fbb7||0xc8;return function(_0x140918){if(_0x140918){return _0x2eb262['status'](_0x58fbb7)[_0x6d24('0x28')](_0x140918);}};}function respondWithFilteredResult(_0xc32e3f,_0x2aa1d1){return function(_0xd07e8b){if(_0xd07e8b){var _0xcc9959=typeof _0x2aa1d1[_0x6d24('0x29')]===_0x6d24('0x2a')&&typeof _0x2aa1d1['limit']===_0x6d24('0x2a');var _0x1559c9=_0xd07e8b[_0x6d24('0x2b')];var _0x4422ee=_0xcc9959?0x0:_0x2aa1d1[_0x6d24('0x29')];var _0xf4d9e0=_0xcc9959?_0xd07e8b[_0x6d24('0x2b')]:_0x2aa1d1['offset']+_0x2aa1d1[_0x6d24('0x2c')];var _0x11f593;if(_0xf4d9e0>=_0x1559c9){_0xf4d9e0=_0x1559c9;_0x11f593=0xc8;}else{_0x11f593=0xce;}_0xc32e3f[_0x6d24('0x2d')](_0x11f593);return _0xc32e3f['set']('Content-Range',_0x4422ee+'-'+_0xf4d9e0+'/'+_0x1559c9)[_0x6d24('0x28')](_0xd07e8b);}return null;};}function patchUpdates(_0x11d219){return function(_0x40d8ff){try{jsonpatch[_0x6d24('0x2e')](_0x40d8ff,_0x11d219,!![]);}catch(_0x22b53c){return BPromise['reject'](_0x22b53c);}return _0x40d8ff['save']();};}function saveUpdates(_0x5e0a7c,_0x33ab82){return function(_0x3796d0){if(_0x3796d0){return _0x3796d0[_0x6d24('0x2f')](_0x5e0a7c)[_0x6d24('0x1d')](function(_0x1c17e4){return _0x1c17e4;});}return null;};}function removeEntity(_0x3adffa,_0x31ae0f){return function(_0x3c4501){if(_0x3c4501){return _0x3c4501[_0x6d24('0x30')]()[_0x6d24('0x1d')](function(){_0x3adffa[_0x6d24('0x2d')](0xcc)[_0x6d24('0x31')]();});}};}function handleEntityNotFound(_0x1d7207,_0x1f9baf){return function(_0x22e554){if(!_0x22e554){_0x1d7207[_0x6d24('0x27')](0x194);}return _0x22e554;};}function handleError(_0x1cc37f,_0x39a147){_0x39a147=_0x39a147||0x1f4;return function(_0x1a4fb8){logger[_0x6d24('0x23')](_0x1a4fb8['stack']);if(_0x1a4fb8[_0x6d24('0x32')]){delete _0x1a4fb8[_0x6d24('0x32')];}_0x1cc37f[_0x6d24('0x2d')](_0x39a147)[_0x6d24('0x33')](_0x1a4fb8);};}exports['index']=function(_0x34d2f5,_0x473ed1){var _0x3b82a3={},_0x4ab0a1={},_0x59e7c7={'count':0x0,'rows':[]};var _0x28da45=_[_0x6d24('0x34')](db[_0x6d24('0x35')][_0x6d24('0x36')],function(_0x3de7e9){return{'name':_0x3de7e9[_0x6d24('0x37')],'type':_0x3de7e9['type'][_0x6d24('0x38')]};});_0x4ab0a1[_0x6d24('0x39')]=_[_0x6d24('0x34')](_0x28da45,_0x6d24('0x32'));_0x4ab0a1[_0x6d24('0x3a')]=_[_0x6d24('0x3b')](_0x34d2f5[_0x6d24('0x3a')]);_0x4ab0a1[_0x6d24('0x3c')]=_[_0x6d24('0x3d')](_0x4ab0a1[_0x6d24('0x39')],_0x4ab0a1[_0x6d24('0x3a')]);_0x3b82a3[_0x6d24('0x3e')]=_[_0x6d24('0x3d')](_0x4ab0a1[_0x6d24('0x39')],qs[_0x6d24('0x3f')](_0x34d2f5[_0x6d24('0x3a')][_0x6d24('0x3f')]));_0x3b82a3[_0x6d24('0x3e')]=_0x3b82a3[_0x6d24('0x3e')][_0x6d24('0x40')]?_0x3b82a3[_0x6d24('0x3e')]:_0x4ab0a1[_0x6d24('0x39')];if(!_0x34d2f5[_0x6d24('0x3a')]['hasOwnProperty'](_0x6d24('0x41'))){_0x3b82a3['limit']=qs[_0x6d24('0x2c')](_0x34d2f5[_0x6d24('0x3a')]['limit']);_0x3b82a3[_0x6d24('0x29')]=qs[_0x6d24('0x29')](_0x34d2f5[_0x6d24('0x3a')]['offset']);}_0x3b82a3[_0x6d24('0x42')]=qs[_0x6d24('0x43')](_0x34d2f5[_0x6d24('0x3a')]['sort']);_0x3b82a3[_0x6d24('0x44')]=qs[_0x6d24('0x3c')](_[_0x6d24('0x45')](_0x34d2f5[_0x6d24('0x3a')],_0x4ab0a1['filters']),_0x28da45);if(_0x34d2f5[_0x6d24('0x3a')][_0x6d24('0x46')]){_0x3b82a3[_0x6d24('0x44')]=_[_0x6d24('0x47')](_0x3b82a3[_0x6d24('0x44')],{'$or':_[_0x6d24('0x34')](_0x28da45,function(_0x3e7590){if(_0x3e7590[_0x6d24('0x48')]!=='VIRTUAL'){var _0x23ce0a={};_0x23ce0a[_0x3e7590[_0x6d24('0x32')]]={'$like':'%'+_0x34d2f5[_0x6d24('0x3a')]['filter']+'%'};return _0x23ce0a;}})});}_0x3b82a3=_['merge']({},_0x3b82a3,_0x34d2f5['options']);var _0x2efdec={'where':_0x3b82a3['where']};return db[_0x6d24('0x35')]['count'](_0x2efdec)[_0x6d24('0x1d')](function(_0x32438f){_0x59e7c7[_0x6d24('0x2b')]=_0x32438f;if(_0x34d2f5[_0x6d24('0x3a')][_0x6d24('0x49')]){_0x3b82a3[_0x6d24('0x4a')]=[{'all':!![]}];}return db[_0x6d24('0x35')][_0x6d24('0x4b')](_0x3b82a3);})[_0x6d24('0x1d')](function(_0x65a19c){_0x59e7c7['rows']=_0x65a19c;return _0x59e7c7;})[_0x6d24('0x1d')](respondWithFilteredResult(_0x473ed1,_0x3b82a3))[_0x6d24('0x4c')](handleError(_0x473ed1,null));};exports['show']=function(_0x283679,_0x3817d7){var _0x4cab22={'raw':!![],'where':{'id':_0x283679[_0x6d24('0x4d')]['id']}},_0x6ad73f={};_0x6ad73f[_0x6d24('0x39')]=_[_0x6d24('0x3b')](db[_0x6d24('0x35')][_0x6d24('0x36')]);_0x6ad73f[_0x6d24('0x3a')]=_[_0x6d24('0x3b')](_0x283679[_0x6d24('0x3a')]);_0x6ad73f[_0x6d24('0x3c')]=_['intersection'](_0x6ad73f[_0x6d24('0x39')],_0x6ad73f[_0x6d24('0x3a')]);_0x4cab22['attributes']=_[_0x6d24('0x3d')](_0x6ad73f[_0x6d24('0x39')],qs[_0x6d24('0x3f')](_0x283679['query'][_0x6d24('0x3f')]));_0x4cab22[_0x6d24('0x3e')]=_0x4cab22['attributes']['length']?_0x4cab22[_0x6d24('0x3e')]:_0x6ad73f[_0x6d24('0x39')];if(_0x283679['query'][_0x6d24('0x49')]){_0x4cab22['include']=[{'all':!![]}];}_0x4cab22=_['merge']({},_0x4cab22,_0x283679[_0x6d24('0x4e')]);return db['WhatsappMessage']['find'](_0x4cab22)['then'](handleEntityNotFound(_0x3817d7,null))['then'](respondWithResult(_0x3817d7,null))['catch'](handleError(_0x3817d7,null));};exports[_0x6d24('0x4f')]=function(_0x20c330,_0x2ea75e){return db[_0x6d24('0x35')]['create'](_0x20c330[_0x6d24('0x50')],{})[_0x6d24('0x1d')](respondWithResult(_0x2ea75e,0xc9))['catch'](handleError(_0x2ea75e,null));};exports[_0x6d24('0x2f')]=function(_0x3e00fc,_0x24bc89){if(_0x3e00fc[_0x6d24('0x50')]['id']){delete _0x3e00fc[_0x6d24('0x50')]['id'];}return db[_0x6d24('0x35')]['find']({'where':{'id':_0x3e00fc['params']['id']}})['then'](handleEntityNotFound(_0x24bc89,null))[_0x6d24('0x1d')](saveUpdates(_0x3e00fc[_0x6d24('0x50')],null))['then'](respondWithResult(_0x24bc89,null))[_0x6d24('0x4c')](handleError(_0x24bc89,null));};exports[_0x6d24('0x30')]=function(_0x30b8db,_0x52bef9){return db[_0x6d24('0x35')]['find']({'where':{'id':_0x30b8db[_0x6d24('0x4d')]['id']}})[_0x6d24('0x1d')](handleEntityNotFound(_0x52bef9,null))[_0x6d24('0x1d')](removeEntity(_0x52bef9,null))[_0x6d24('0x4c')](handleError(_0x52bef9,null));};exports[_0x6d24('0x51')]=function(_0x3ac234,_0x283083){return db[_0x6d24('0x35')][_0x6d24('0x51')]()[_0x6d24('0x1d')](respondWithResult(_0x283083,null))[_0x6d24('0x4c')](handleError(_0x283083,null));};var interaction_log=require(_0x6d24('0x13'))(_0x6d24('0x52'));exports['accept']=function(_0x2194cd,_0x3d28b9,_0x1afd64){var _0xd8c45f={'agent':{},'channel':'whatsapp'};if(_0x2194cd[_0x6d24('0x50')]['id']){delete _0x2194cd[_0x6d24('0x50')]['id'];}_0x2194cd[_0x6d24('0x50')]['read']=!![];_0x2194cd[_0x6d24('0x50')][_0x6d24('0x53')]=moment()[_0x6d24('0x54')](_0x6d24('0x55'));_0x2194cd['body'][_0x6d24('0x56')]=_0x2194cd['body'][_0x6d24('0x56')]||_0x2194cd['user']['id'];_0xd8c45f[_0x6d24('0x57')]['id']=_0x2194cd[_0x6d24('0x50')][_0x6d24('0x56')];return db[_0x6d24('0x35')][_0x6d24('0x58')]({'where':{'id':_0x2194cd[_0x6d24('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d28b9,null))[_0x6d24('0x1d')](saveUpdates(_0x2194cd[_0x6d24('0x50')],null))[_0x6d24('0x1d')](function(_0x4928d7){if(_0x4928d7){_0xd8c45f[_0x6d24('0x25')]=_0x4928d7[_0x6d24('0x59')]({'plain':!![]});return db[_0x6d24('0x5a')][_0x6d24('0x58')]({'where':{'id':_0x4928d7['WhatsappInteractionId']}});}return null;})[_0x6d24('0x1d')](handleEntityNotFound(_0x3d28b9,null))[_0x6d24('0x1d')](function(_0x591c47){if(_0x591c47){return _0x591c47['update']({'UserId':_0x2194cd[_0x6d24('0x50')][_0x6d24('0x56')],'read1stAt':_[_0x6d24('0x5b')](_0x591c47[_0x6d24('0x5c')])?moment()[_0x6d24('0x54')](_0x6d24('0x55')):undefined});}return null;})[_0x6d24('0x1d')](function(_0x5af4eb){if(_0x5af4eb){_0xd8c45f[_0x6d24('0x5d')]=_0x5af4eb['get']({'plain':!![]});interaction_log[_0x6d24('0x26')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2194cd['user']['id'],_0x2194cd[_0x6d24('0x5e')][_0x6d24('0x32')],_0x2194cd[_0x6d24('0x5e')][_0x6d24('0x5f')],_0xd8c45f[_0x6d24('0x5d')]['id'],_0x2194cd[_0x6d24('0x50')]?JSON[_0x6d24('0x22')](_0x2194cd[_0x6d24('0x50')]):_0x6d24('0x60'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xd8c45f);}return null;})['then'](function(_0x5ce51c){var _0x7086d4=_0x6d24('0x61')+_0x5ce51c[_0x6d24('0x25')][_0x6d24('0x62')];return db[_0x6d24('0x63')][_0x6d24('0x3a')](_0x7086d4,{'type':db[_0x6d24('0x64')][_0x6d24('0x65')][_0x6d24('0x66')],'raw':!![]})[_0x6d24('0x1d')](function(_0x47c2a6){return _0x47c2a6;});})[_0x6d24('0x1d')](function(_0x4a841d){if(_0x4a841d){_0xd8c45f['message'][_0x6d24('0x67')]=_0x4a841d[0x0];if(!_0x2194cd[_0x6d24('0x50')]['UserId'])return;return db[_0x6d24('0x68')][_0x6d24('0x58')]({'where':{'id':_0x2194cd[_0x6d24('0x50')][_0x6d24('0x56')],'role':_0x6d24('0x57')},'attributes':['id',_0x6d24('0x32'),_0x6d24('0x69'),_0x6d24('0x6a'),_0x6d24('0x6b')],'raw':!![]});}return null;})[_0x6d24('0x1d')](function(_0x44e336){if(!_0x44e336)return null;_0xd8c45f[_0x6d24('0x25')][_0x6d24('0x57')]=_0x44e336;return _0xd8c45f;})['then'](function(_0x18f123){if(_0x18f123){if(_0x2194cd[_0x6d24('0x50')][_0x6d24('0x6c')]){_0xd8c45f[_0x6d24('0x25')][_0x6d24('0x6d')]=util[_0x6d24('0x54')](_0x6d24('0x6e'),_0x2194cd[_0x6d24('0x5e')][_0x6d24('0x32')]);_0xd8c45f[_0x6d24('0x25')][_0x6d24('0x6f')]=_0xd8c45f[_0x6d24('0x6f')];_0xd8c45f[_0x6d24('0x25')][_0x6d24('0x70')]=_0xd8c45f[_0x6d24('0x6f')];_0xd8c45f[_0x6d24('0x25')][_0x6d24('0x71')]=_0x6d24('0x72');return respondWithRpcPromise(_0x6d24('0x73'),'EventManager',{'event':_0x6d24('0x74'),'message':_0xd8c45f['message']},client9002)[_0x6d24('0x1d')](function(){return _0xd8c45f;});}return _0xd8c45f;}return null;})[_0x6d24('0x1d')](respondWithResult(_0x3d28b9,null))[_0x6d24('0x4c')](handleError(_0x3d28b9,null));};var interaction_log=require(_0x6d24('0x13'))('whatsapp-interactions');exports[_0x6d24('0x75')]=function(_0xf0371a,_0x1d0bba,_0x2a9666){var _0x3c4bfb={'agent':{},'channel':_0x6d24('0x76')};if(_0xf0371a[_0x6d24('0x50')]['id']){delete _0xf0371a['body']['id'];}_0xf0371a[_0x6d24('0x50')][_0x6d24('0x56')]=_0xf0371a['body'][_0x6d24('0x56')]||_0xf0371a[_0x6d24('0x5e')]['id'];_0x3c4bfb[_0x6d24('0x57')]['id']=_0xf0371a[_0x6d24('0x50')][_0x6d24('0x56')];return db[_0x6d24('0x35')]['find']({'where':{'id':_0xf0371a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d0bba,null))[_0x6d24('0x1d')](function(_0x13f4d2){if(_0x13f4d2){_0x3c4bfb['message']=_0x13f4d2[_0x6d24('0x59')]({'plain':!![]});return db['WhatsappInteraction'][_0x6d24('0x58')]({'where':{'id':_0x13f4d2[_0x6d24('0x77')]}});}return null;})[_0x6d24('0x1d')](handleEntityNotFound(_0x1d0bba,null))[_0x6d24('0x1d')](function(_0x20ab59){if(_0x20ab59){_0x3c4bfb[_0x6d24('0x5d')]=_0x20ab59[_0x6d24('0x59')]({'plain':!![]});interaction_log['info'](_0x6d24('0x78'),_0xf0371a[_0x6d24('0x5e')]['id'],_0xf0371a['user'][_0x6d24('0x32')],_0xf0371a[_0x6d24('0x5e')][_0x6d24('0x5f')],_0x3c4bfb[_0x6d24('0x5d')]['id'],_0xf0371a[_0x6d24('0x50')]?JSON['stringify'](_0xf0371a['body']):'null');return respondWithRpcPromise(_0x6d24('0x79'),_0x6d24('0x7a'),_0x3c4bfb);}return null;})[_0x6d24('0x1d')](function(_0x321a1d){var _0x28a27b=_0x6d24('0x61')+_0x321a1d[_0x6d24('0x25')][_0x6d24('0x62')];return db['sequelize'][_0x6d24('0x3a')](_0x28a27b,{'type':db[_0x6d24('0x64')]['QueryTypes'][_0x6d24('0x66')],'raw':!![]})[_0x6d24('0x1d')](function(_0x22d40f){return _0x22d40f;});})['then'](function(_0x1de2d5){if(_0x1de2d5){_0x3c4bfb[_0x6d24('0x25')][_0x6d24('0x67')]=_0x1de2d5[0x0];if(!_0xf0371a[_0x6d24('0x50')][_0x6d24('0x56')])return;return db[_0x6d24('0x68')][_0x6d24('0x58')]({'where':{'id':_0xf0371a[_0x6d24('0x50')][_0x6d24('0x56')],'role':_0x6d24('0x57')},'attributes':['id',_0x6d24('0x32'),_0x6d24('0x69'),_0x6d24('0x6a'),_0x6d24('0x6b')],'raw':!![]});}return null;})[_0x6d24('0x1d')](function(_0x3673d6){if(!_0x3673d6)return null;_0x3c4bfb['message']['agent']=_0x3673d6;return _0x3c4bfb;})[_0x6d24('0x1d')](function(_0x549f93){if(_0x549f93){_0x549f93[_0x6d24('0x25')][_0x6d24('0x6d')]=util['format'](_0x6d24('0x6e'),_0xf0371a[_0x6d24('0x5e')]['name']);_0x549f93['message'][_0x6d24('0x6f')]=_0x3c4bfb[_0x6d24('0x6f')];_0x549f93['message'][_0x6d24('0x70')]=_0x3c4bfb[_0x6d24('0x6f')];_0x549f93[_0x6d24('0x25')]['event']='reject';respondWithRpcPromise('EventManager',_0x6d24('0x73'),{'event':'rejectmessage','message':_0x549f93[_0x6d24('0x25')]},client9002);return _0x3c4bfb;}return null;})[_0x6d24('0x1d')](respondWithResult(_0x1d0bba,null))['catch'](handleError(_0x1d0bba,null));};exports['status']=function(_0x40a7d9,_0x1ffcfd,_0x12b68d){if(_0x40a7d9[_0x6d24('0x50')]['id']){delete _0x40a7d9['body']['id'];}var _0x12817a;return db[_0x6d24('0x35')]['find']({'where':{'id':_0x40a7d9[_0x6d24('0x4d')]['id']}})[_0x6d24('0x1d')](handleEntityNotFound(_0x1ffcfd,null))[_0x6d24('0x1d')](function(_0x19d76f){if(_0x19d76f){_0x12817a=_0x19d76f;return db[_0x6d24('0x7b')][_0x6d24('0x58')]({'where':{'id':_0x19d76f[_0x6d24('0x7c')]}});}})['then'](handleEntityNotFound(_0x1ffcfd,null))[_0x6d24('0x1d')](function(_0x4c2b38){if(_0x4c2b38){logger[_0x6d24('0x20')](_0x6d24('0x7d'),_0x6d24('0x2d'),'received\x20delivery\x20report\x20from',_0x4c2b38['type'],util[_0x6d24('0x7e')](_0x40a7d9['body'],{'showHidden':![],'depth':null}));switch(_0x4c2b38[_0x6d24('0x48')]){case _0x6d24('0x7f'):if(_0x40a7d9[_0x6d24('0x50')][_0x6d24('0x80')]&&_0x40a7d9[_0x6d24('0x50')][_0x6d24('0x80')]===_0x12817a[_0x6d24('0x81')]&&_0x40a7d9[_0x6d24('0x50')][_0x6d24('0x82')]&&_0x40a7d9[_0x6d24('0x50')][_0x6d24('0x82')]===_0x6d24('0x83')){return _0x12817a[_0x6d24('0x2f')]({'read':!![]});}else{logger[_0x6d24('0x23')](_0x6d24('0x84'),_0x6d24('0x2d'),_0x6d24('0x7f'),util['inspect'](_0x40a7d9[_0x6d24('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x12817a;}})[_0x6d24('0x1d')](respondWithResult(_0x1ffcfd,null))[_0x6d24('0x4c')](handleError(_0x1ffcfd,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index b92a5fc..9cb90cf 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 _0xde2c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0xde2c,0x7f));var _0xcde2=function(_0x3987a1,_0x447793){_0x3987a1=_0x3987a1-0x0;var _0xe2596e=_0xde2c[_0x3987a1];return _0xe2596e;};'use strict';var EventEmitter=require(_0xcde2('0x0'));var WhatsappMessage=require(_0xcde2('0x1'))['db'][_0xcde2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcde2('0x3')](0x0);var events={'afterCreate':_0xcde2('0x4'),'afterUpdate':_0xcde2('0x5'),'afterDestroy':_0xcde2('0x6')};function emitEvent(_0x3a309f){return function(_0x55c175,_0x4353c8,_0x196898){WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f+':'+_0x55c175['id'],_0x55c175);WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f,_0x55c175);_0x196898(null);};}for(var e in events){if(events[_0xcde2('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xcde2('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x3070=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x5e3663,_0x52a47b){var _0x4d2fb3=function(_0x3b59e6){while(--_0x3b59e6){_0x5e3663['push'](_0x5e3663['shift']());}};_0x4d2fb3(++_0x52a47b);}(_0x3070,0x75));var _0x0307=function(_0x32be0c,_0x351f62){_0x32be0c=_0x32be0c-0x0;var _0x31f690=_0x3070[_0x32be0c];return _0x31f690;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0307('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0307('0x1')](0x0);var events={'afterCreate':_0x0307('0x2'),'afterUpdate':_0x0307('0x3'),'afterDestroy':_0x0307('0x4')};function emitEvent(_0x3dd3a5){return function(_0xb7229f,_0x5b39b8,_0x5e4edd){WhatsappMessageEvents[_0x0307('0x5')](_0x3dd3a5+':'+_0xb7229f['id'],_0xb7229f);WhatsappMessageEvents[_0x0307('0x5')](_0x3dd3a5,_0xb7229f);_0x5e4edd(null);};}for(var e in events){if(events[_0x0307('0x6')](e)){var event=events[e];WhatsappMessage[_0x0307('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1a11f23..ae79ec1 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 _0x8ce1=['exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','body','whatsapp:','/api/whatsapp/messages/','token','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','/messages/','text','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ce1,0x183));var _0x18ce=function(_0x3046df,_0x11f2a9){_0x3046df=_0x3046df-0x0;var _0x2d9b9a=_0x8ce1[_0x3046df];return _0x2d9b9a;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require(_0x18ce('0x4'));var BPromise=require(_0x18ce('0x5'));var rp=require(_0x18ce('0x6'));var fetch=require(_0x18ce('0x7'));var fs=require('fs');var path=require(_0x18ce('0x8'));var rimraf=require(_0x18ce('0x9'));var config=require(_0x18ce('0xa'));var attributes=require(_0x18ce('0xb'));module[_0x18ce('0xc')]=function(_0x36f8db,_0x682d4b){return _0x36f8db[_0x18ce('0xd')]('WhatsappMessage',attributes,{'tableName':_0x18ce('0xe'),'paranoid':![],'indexes':[{'name':_0x18ce('0xf'),'fields':[_0x18ce('0xf')]},{'name':_0x18ce('0x10'),'fields':['body'],'type':_0x18ce('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbb6146,_0x3caefd,_0x1c6cdc){var _0x53959e=_0x36f8db['models'];var _0x37a8b0=_0xbb6146[_0x18ce('0x12')]({'plain':!![]});if(_0x37a8b0[_0x18ce('0x13')][_0x18ce('0x14')]()==='in'||_0x37a8b0[_0x18ce('0x13')]['toLowerCase']()===_0x18ce('0x15')&&!_0x37a8b0[_0x18ce('0x16')]&&!_[_0x18ce('0x17')](_0x37a8b0[_0x18ce('0x18')])){_0x53959e[_0x18ce('0x19')]['findOne']({'where':{'id':_0x37a8b0[_0x18ce('0x1a')]}})[_0x18ce('0x1b')](function(_0x3ac890){if(_0x3ac890){_0x3ac890[_0x18ce('0x1c')]({'lastMsgAt':_0x37a8b0[_0x18ce('0x1d')],'lastMsgDirection':_0x37a8b0[_0x18ce('0x13')][_0x18ce('0x14')]()});}})['catch'](function(_0x959ce){console[_0x18ce('0x1e')](_0x959ce);});}if(_0x37a8b0[_0x18ce('0x13')]===_0x18ce('0x15')&&!_0x37a8b0[_0x18ce('0x16')]){var _0x287880;_0x53959e['WhatsappAccount'][_0x18ce('0x1f')]({'where':{'id':_0x37a8b0[_0x18ce('0x20')]},'raw':!![]})[_0x18ce('0x1b')](function(_0x56644c){_0x287880=_0x56644c;if(_0x287880&&_0x287880[_0x18ce('0x21')]){switch(_0x287880[_0x18ce('0x21')]){case _0x18ce('0x22'):var _0x57a706=require(_0x18ce('0x22'));if(_0x287880[_0x18ce('0x23')]&&_0x287880['authToken']&&_0x287880[_0x18ce('0x24')]){var _0x1099c9=new _0x57a706(_0x287880[_0x18ce('0x23')],_0x287880[_0x18ce('0x25')]);_0x1099c9[_0x18ce('0x26')][_0x18ce('0x27')]({'body':_0x37a8b0[_0x18ce('0x28')],'to':_0x18ce('0x29')+_0x37a8b0[_0x18ce('0x24')],'from':'whatsapp:'+_0x287880['phone'],'statusCallback':_0x287880['remote']+_0x18ce('0x2a')+_0x37a8b0['id']+'/status?token='+_0x287880[_0x18ce('0x2b')]})[_0x18ce('0x1b')](function(_0x3fe231){if(_0x3fe231['sid']){return _0xbb6146['update']({'messageId':_0x3fe231['sid']});}})[_0x18ce('0x2c')](function(_0x12b1ed){logger[_0x18ce('0x1e')](_0x18ce('0x2d'),_0x18ce('0x2e'),_0x18ce('0x22'),util['inspect'](_0x12b1ed,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x18ce('0x2e'),_0x18ce('0x22'),_0x18ce('0x2f'));}break;case'sinch':var _0x1a87f6=_0x287880[_0x18ce('0x23')];var _0x1988e4=_0x287880['authToken'];var _0x56d296=_0x287880['baseUrl']+_0x18ce('0x30')+_0x1a87f6+_0x18ce('0x31');var _0x5c2d96={'to':[_0x37a8b0['phone']],'message':{'type':_0x18ce('0x32'),'text':_0x37a8b0[_0x18ce('0x28')]}};var _0x91c42f={'method':'POST','uri':_0x56d296,'headers':{'Authorization':'Bearer\x20'+_0x1988e4,'Content-Type':_0x18ce('0x33')},'body':_0x5c2d96,'json':!![]};rp(_0x91c42f)[_0x18ce('0x1b')](function(_0x14b2a8){if(_0x14b2a8[_0x18ce('0x34')][0x0][_0x18ce('0x35')]){return _0xbb6146[_0x18ce('0x1c')]({'messageId':_0x14b2a8[_0x18ce('0x34')][0x0][_0x18ce('0x35')]});}})['catch'](function(_0x51e7e3){logger[_0x18ce('0x36')](_0x18ce('0x37'),_0x51e7e3);});break;}}})['finally'](function(){_0x1c6cdc();});}else{_0x1c6cdc();}}},'charset':_0x18ce('0x38'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8055=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','secret','isNil','findOne','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x8055,0x1c2));var _0x5805=function(_0x96d0d0,_0xfc9233){_0x96d0d0=_0x96d0d0-0x0;var _0x2b6758=_0x8055[_0x96d0d0];return _0x2b6758;};'use strict';var _=require('lodash');var util=require(_0x5805('0x0'));var logger=require('../../config/logger')(_0x5805('0x1'));var moment=require(_0x5805('0x2'));var BPromise=require(_0x5805('0x3'));var rp=require(_0x5805('0x4'));var fetch=require(_0x5805('0x5'));var fs=require('fs');var path=require(_0x5805('0x6'));var rimraf=require(_0x5805('0x7'));var config=require(_0x5805('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x5805('0x9')]=function(_0x1ca7ac,_0x164332){return _0x1ca7ac['define'](_0x5805('0xa'),attributes,{'tableName':_0x5805('0xb'),'paranoid':![],'indexes':[{'name':_0x5805('0xc'),'fields':[_0x5805('0xc')]},{'name':_0x5805('0xd'),'fields':[_0x5805('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa1d838,_0x23d126,_0x202808){var _0x120ab7=_0x1ca7ac[_0x5805('0xf')];var _0x58e8a3=_0xa1d838['get']({'plain':!![]});if(_0x58e8a3[_0x5805('0x10')][_0x5805('0x11')]()==='in'||_0x58e8a3[_0x5805('0x10')][_0x5805('0x11')]()===_0x5805('0x12')&&!_0x58e8a3[_0x5805('0x13')]&&!_[_0x5805('0x14')](_0x58e8a3['UserId'])){_0x120ab7['WhatsappInteraction'][_0x5805('0x15')]({'where':{'id':_0x58e8a3[_0x5805('0x16')]}})[_0x5805('0x17')](function(_0x405879){if(_0x405879){_0x405879['update']({'lastMsgAt':_0x58e8a3[_0x5805('0x18')],'lastMsgDirection':_0x58e8a3[_0x5805('0x10')][_0x5805('0x11')]()});}})[_0x5805('0x19')](function(_0x43eb38){console[_0x5805('0x1a')](_0x43eb38);});}if(_0x58e8a3[_0x5805('0x10')]==='out'&&!_0x58e8a3[_0x5805('0x13')]){var _0x37b5a6;_0x120ab7[_0x5805('0x1b')][_0x5805('0x1c')]({'where':{'id':_0x58e8a3[_0x5805('0x1d')]},'raw':!![]})[_0x5805('0x17')](function(_0x1f4203){_0x37b5a6=_0x1f4203;if(_0x37b5a6&&_0x37b5a6[_0x5805('0x1e')]){switch(_0x37b5a6[_0x5805('0x1e')]){case _0x5805('0x1f'):var _0x37d7bc=require(_0x5805('0x1f'));if(_0x37b5a6[_0x5805('0x20')]&&_0x37b5a6[_0x5805('0x21')]&&_0x37b5a6[_0x5805('0x22')]){var _0x5b3fb8=new _0x37d7bc(_0x37b5a6[_0x5805('0x20')],_0x37b5a6[_0x5805('0x21')]);_0x5b3fb8[_0x5805('0x23')][_0x5805('0x24')]({'body':_0x58e8a3[_0x5805('0xe')],'to':_0x5805('0x25')+_0x58e8a3[_0x5805('0x22')],'from':_0x5805('0x25')+_0x37b5a6[_0x5805('0x22')],'statusCallback':_0x37b5a6[_0x5805('0x26')]+'/api/whatsapp/messages/'+_0x58e8a3['id']+_0x5805('0x27')+_0x37b5a6[_0x5805('0x28')]})['then'](function(_0x185fba){if(_0x185fba[_0x5805('0x29')]){return _0xa1d838[_0x5805('0x2a')]({'messageId':_0x185fba[_0x5805('0x29')]});}})['catch'](function(_0x23a418){logger[_0x5805('0x1a')](_0x5805('0x2b'),'afterCreate',_0x5805('0x1f'),util['inspect'](_0x23a418,{'showHidden':![],'depth':null}));});}else{logger[_0x5805('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5805('0x2c'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4ce82d=_0x37b5a6[_0x5805('0x20')];var _0x178ffd=_0x37b5a6[_0x5805('0x21')];var _0x4323a8=_0x37b5a6[_0x5805('0x2d')]+_0x5805('0x2e')+_0x4ce82d+'/messages/';var _0x34e214={'to':[_0x58e8a3['phone']],'message':{'type':_0x5805('0x2f'),'text':_0x58e8a3['body']}};var _0xdc1952={'method':_0x5805('0x30'),'uri':_0x4323a8,'headers':{'Authorization':_0x5805('0x31')+_0x178ffd,'Content-Type':'application/json'},'body':_0x34e214,'json':!![]};rp(_0xdc1952)[_0x5805('0x17')](function(_0x384d49){if(_0x384d49[_0x5805('0x32')][0x0][_0x5805('0x33')]){return _0xa1d838['update']({'messageId':_0x384d49[_0x5805('0x32')][0x0]['message_id']});}})[_0x5805('0x19')](function(_0x105f0d){logger['err'](_0x5805('0x34'),_0x105f0d);});break;}}})[_0x5805('0x35')](function(){_0x202808();});}else{_0x202808();}}},'charset':_0x5805('0x36'),'collate':_0x5805('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ae5a542..9ebc480 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 _0x7bbd=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateWhatsappMessage','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info'];(function(_0x1c9863,_0xe952b2){var _0x104660=function(_0x102bc6){while(--_0x102bc6){_0x1c9863['push'](_0x1c9863['shift']());}};_0x104660(++_0xe952b2);}(_0x7bbd,0x158));var _0xd7bb=function(_0x5ecd5b,_0x183d3e){_0x5ecd5b=_0x5ecd5b-0x0;var _0x136986=_0x7bbd[_0x5ecd5b];return _0x136986;};'use strict';var _=require('lodash');var util=require(_0xd7bb('0x0'));var moment=require(_0xd7bb('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7bb('0x2'));var fs=require('fs');var Redis=require(_0xd7bb('0x3'));var db=require(_0xd7bb('0x4'))['db'];var utils=require(_0xd7bb('0x5'));var logger=require(_0xd7bb('0x6'))(_0xd7bb('0x7'));var config=require(_0xd7bb('0x8'));var jayson=require(_0xd7bb('0x9'));var client=jayson[_0xd7bb('0xa')]['http']({'port':0x232a});config[_0xd7bb('0xb')]=_[_0xd7bb('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd7bb('0xd'))(new Redis(config['redis']));require(_0xd7bb('0xe'))[_0xd7bb('0xf')](socket);function respondWithRpcPromise(_0x2fdb0c,_0x4a8365,_0x34f27b){return new BPromise(function(_0x482242,_0x1e1d82){return client[_0xd7bb('0x10')](_0x2fdb0c,_0x34f27b)[_0xd7bb('0x11')](function(_0x4d548f){logger[_0xd7bb('0x12')](_0xd7bb('0x13'),_0x4a8365,_0xd7bb('0x14'));logger[_0xd7bb('0x15')](_0xd7bb('0x16'),_0x4a8365,'request\x20sent',JSON[_0xd7bb('0x17')](_0x4d548f));if(_0x4d548f['error']){if(_0x4d548f[_0xd7bb('0x18')][_0xd7bb('0x19')]===0x1f4){logger[_0xd7bb('0x18')](_0xd7bb('0x13'),_0x4a8365,_0x4d548f[_0xd7bb('0x18')][_0xd7bb('0x1a')]);return _0x1e1d82(_0x4d548f[_0xd7bb('0x18')][_0xd7bb('0x1a')]);}logger[_0xd7bb('0x18')](_0xd7bb('0x13'),_0x4a8365,_0x4d548f[_0xd7bb('0x18')][_0xd7bb('0x1a')]);return _0x482242(_0x4d548f[_0xd7bb('0x18')][_0xd7bb('0x1a')]);}else{logger['info'](_0xd7bb('0x13'),_0x4a8365,_0xd7bb('0x14'));_0x482242(_0x4d548f['result']['message']);}})[_0xd7bb('0x1b')](function(_0x28a58f){logger[_0xd7bb('0x18')](_0xd7bb('0x13'),_0x4a8365,_0x28a58f);_0x1e1d82(_0x28a58f);});});}exports['CreateWhatsappMessage']=function(_0x579178){var _0x12abcd=this;return new Promise(function(_0xc805d8,_0x12a046){return db['WhatsappMessage'][_0xd7bb('0x1c')](_0x579178[_0xd7bb('0x1d')],{'raw':_0x579178[_0xd7bb('0x1e')]?_0x579178['options'][_0xd7bb('0x1f')]===undefined?!![]:![]:!![]})[_0xd7bb('0x11')](function(_0x14b38c){logger[_0xd7bb('0x12')](_0xd7bb('0x20'),_0x579178);logger[_0xd7bb('0x15')](_0xd7bb('0x20'),_0x579178,JSON[_0xd7bb('0x17')](_0x14b38c));_0xc805d8(_0x14b38c);})[_0xd7bb('0x1b')](function(_0x419c2a){logger[_0xd7bb('0x18')](_0xd7bb('0x20'),_0x419c2a['message'],_0x579178);_0x12a046(_0x12abcd[_0xd7bb('0x18')](0x1f4,_0x419c2a[_0xd7bb('0x1a')]));});});}; \ No newline at end of file +var _0x5108=['error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0x5108,0x18a));var _0x8510=function(_0x29d5f1,_0x3c4e15){_0x29d5f1=_0x29d5f1-0x0;var _0x48a2ea=_0x5108[_0x29d5f1];return _0x48a2ea;};'use strict';var _=require(_0x8510('0x0'));var util=require('util');var moment=require(_0x8510('0x1'));var BPromise=require(_0x8510('0x2'));var rs=require(_0x8510('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8510('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8510('0x5'))(_0x8510('0x6'));var config=require(_0x8510('0x7'));var jayson=require(_0x8510('0x8'));var client=jayson['client'][_0x8510('0x9')]({'port':0x232a});config[_0x8510('0xa')]=_[_0x8510('0xb')](config[_0x8510('0xa')],{'host':_0x8510('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8510('0xa')]));require(_0x8510('0xd'))[_0x8510('0xe')](socket);function respondWithRpcPromise(_0xccec06,_0x28b6a1,_0x15d984){return new BPromise(function(_0x23fb3e,_0x3cc792){return client[_0x8510('0xf')](_0xccec06,_0x15d984)['then'](function(_0x204706){logger[_0x8510('0x10')](_0x8510('0x11'),_0x28b6a1,'request\x20sent');logger[_0x8510('0x12')](_0x8510('0x13'),_0x28b6a1,_0x8510('0x14'),JSON[_0x8510('0x15')](_0x204706));if(_0x204706['error']){if(_0x204706[_0x8510('0x16')]['code']===0x1f4){logger[_0x8510('0x16')](_0x8510('0x11'),_0x28b6a1,_0x204706[_0x8510('0x16')][_0x8510('0x17')]);return _0x3cc792(_0x204706[_0x8510('0x16')][_0x8510('0x17')]);}logger[_0x8510('0x16')](_0x8510('0x11'),_0x28b6a1,_0x204706[_0x8510('0x16')][_0x8510('0x17')]);return _0x23fb3e(_0x204706[_0x8510('0x16')][_0x8510('0x17')]);}else{logger[_0x8510('0x10')](_0x8510('0x11'),_0x28b6a1,_0x8510('0x14'));_0x23fb3e(_0x204706[_0x8510('0x18')][_0x8510('0x17')]);}})[_0x8510('0x19')](function(_0x3e6f2e){logger[_0x8510('0x16')](_0x8510('0x11'),_0x28b6a1,_0x3e6f2e);_0x3cc792(_0x3e6f2e);});});}exports[_0x8510('0x1a')]=function(_0x1d5a13){var _0x25b85d=this;return new Promise(function(_0x2a2b1a,_0x272b02){return db[_0x8510('0x1b')][_0x8510('0x1c')](_0x1d5a13[_0x8510('0x1d')],{'raw':_0x1d5a13[_0x8510('0x1e')]?_0x1d5a13[_0x8510('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x8510('0x1f')](function(_0x408819){logger[_0x8510('0x10')](_0x8510('0x1a'),_0x1d5a13);logger['debug']('CreateWhatsappMessage',_0x1d5a13,JSON['stringify'](_0x408819));_0x2a2b1a(_0x408819);})[_0x8510('0x19')](function(_0x32a62f){logger[_0x8510('0x16')](_0x8510('0x1a'),_0x32a62f[_0x8510('0x17')],_0x1d5a13);_0x272b02(_0x25b85d[_0x8510('0x16')](0x1f4,_0x32a62f[_0x8510('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 9fc2cc7..18fa8a2 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 _0x6e9d=['update','emit','register','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x39ecc4,_0x5b79c9){var _0x1f8975=function(_0x33a618){while(--_0x33a618){_0x39ecc4['push'](_0x39ecc4['shift']());}};_0x1f8975(++_0x5b79c9);}(_0x6e9d,0x11d));var _0xd6e9=function(_0x534f30,_0x594a10){_0x534f30=_0x534f30-0x0;var _0x3bfcc5=_0x6e9d[_0x534f30];return _0x3bfcc5;};'use strict';var WhatsappMessageEvents=require(_0xd6e9('0x0'));var events=[_0xd6e9('0x1'),_0xd6e9('0x2'),_0xd6e9('0x3')];function createListener(_0x1d5de1,_0x1659c7){return function(_0x3949ee){_0x1659c7[_0xd6e9('0x4')](_0x1d5de1,_0x3949ee);};}function removeListener(_0x5db11c,_0x523ce4){return function(){WhatsappMessageEvents['removeListener'](_0x5db11c,_0x523ce4);};}exports[_0xd6e9('0x5')]=function(_0x3445e8){for(var _0x294c2e=0x0,_0x4e9aca=events[_0xd6e9('0x6')];_0x294c2e<_0x4e9aca;_0x294c2e++){var _0x18a85d=events[_0x294c2e];var _0x80099a=createListener(_0xd6e9('0x7')+_0x18a85d,_0x3445e8);WhatsappMessageEvents['on'](_0x18a85d,_0x80099a);}}; \ No newline at end of file +var _0xc367=['update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x58fb40,_0x1d1eb5){var _0x57b67f=function(_0x555b04){while(--_0x555b04){_0x58fb40['push'](_0x58fb40['shift']());}};_0x57b67f(++_0x1d1eb5);}(_0xc367,0x166));var _0x7c36=function(_0x64c96e,_0x24a5c6){_0x64c96e=_0x64c96e-0x0;var _0x1a6a60=_0xc367[_0x64c96e];return _0x1a6a60;};'use strict';var WhatsappMessageEvents=require(_0x7c36('0x0'));var events=['save',_0x7c36('0x1'),_0x7c36('0x2')];function createListener(_0x2f0e38,_0x20f882){return function(_0x3e6511){_0x20f882[_0x7c36('0x3')](_0x2f0e38,_0x3e6511);};}function removeListener(_0x113723,_0x598eb1){return function(){WhatsappMessageEvents[_0x7c36('0x4')](_0x113723,_0x598eb1);};}exports[_0x7c36('0x5')]=function(_0x3ce7d7){for(var _0x3ff2fd=0x0,_0x1241fc=events[_0x7c36('0x6')];_0x3ff2fd<_0x1241fc;_0x3ff2fd++){var _0x7da136=events[_0x3ff2fd];var _0x1dcf7b=createListener(_0x7c36('0x7')+_0x7da136,_0x3ce7d7);WhatsappMessageEvents['on'](_0x7da136,_0x1dcf7b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8d6167c..730023f 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 _0x09d3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout'];(function(_0x2b12b0,_0x4480ce){var _0x221d21=function(_0xbdc428){while(--_0xbdc428){_0x2b12b0['push'](_0x2b12b0['shift']());}};_0x221d21(++_0x4480ce);}(_0x09d3,0x158));var _0x309d=function(_0x4bde34,_0xaa7b76){_0x4bde34=_0x4bde34-0x0;var _0x57ef23=_0x09d3[_0x4bde34];return _0x57ef23;};'use strict';var multer=require(_0x309d('0x0'));var util=require(_0x309d('0x1'));var path=require(_0x309d('0x2'));var timeout=require(_0x309d('0x3'));var express=require(_0x309d('0x4'));var router=express[_0x309d('0x5')]();var fs_extra=require(_0x309d('0x6'));var auth=require(_0x309d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x309d('0x8'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x309d('0x9')](),controller[_0x309d('0xa')]);router[_0x309d('0xb')](_0x309d('0xc'),auth[_0x309d('0x9')](),controller['describe']);router['get']('/:id',auth[_0x309d('0x9')](),controller[_0x309d('0xd')]);router[_0x309d('0xb')](_0x309d('0xe'),auth[_0x309d('0x9')](),controller['getMembers']);router[_0x309d('0xb')](_0x309d('0xf'),auth[_0x309d('0x9')](),controller[_0x309d('0x10')]);router['get'](_0x309d('0x11'),auth[_0x309d('0x9')](),controller[_0x309d('0x12')]);router['post']('/',auth[_0x309d('0x9')](),controller[_0x309d('0x13')]);router[_0x309d('0x14')](_0x309d('0xf'),auth[_0x309d('0x9')](),controller[_0x309d('0x15')]);router[_0x309d('0x14')]('/:id/users',auth[_0x309d('0x9')](),controller[_0x309d('0x16')]);router[_0x309d('0x17')]('/:id',auth[_0x309d('0x9')](),controller[_0x309d('0x18')]);router[_0x309d('0x19')]('/:id',auth[_0x309d('0x9')](),controller[_0x309d('0x1a')]);router[_0x309d('0x19')](_0x309d('0xf'),auth['isAuthenticated'](),controller[_0x309d('0x1b')]);router[_0x309d('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x309d('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xc4fc=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy'];(function(_0x38122a,_0x3e0a8d){var _0x345158=function(_0x4bf954){while(--_0x4bf954){_0x38122a['push'](_0x38122a['shift']());}};_0x345158(++_0x3e0a8d);}(_0xc4fc,0x1b5));var _0xcc4f=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc4fc[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xcc4f('0x0'));var util=require(_0xcc4f('0x1'));var path=require(_0xcc4f('0x2'));var timeout=require(_0xcc4f('0x3'));var express=require(_0xcc4f('0x4'));var router=express[_0xcc4f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc4f('0x6'));var interaction=require(_0xcc4f('0x7'));var config=require('../../config/environment');var controller=require(_0xcc4f('0x8'));router[_0xcc4f('0x9')]('/',auth[_0xcc4f('0xa')](),controller[_0xcc4f('0xb')]);router[_0xcc4f('0x9')](_0xcc4f('0xc'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0xd')]);router[_0xcc4f('0x9')](_0xcc4f('0xe'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0xf')]);router['get'](_0xcc4f('0x10'),auth[_0xcc4f('0xa')](),controller['getMembers']);router[_0xcc4f('0x9')](_0xcc4f('0x11'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x12')]);router[_0xcc4f('0x9')](_0xcc4f('0x13'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x14')]);router['post']('/',auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x15')]);router[_0xcc4f('0x16')](_0xcc4f('0x11'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x17')]);router[_0xcc4f('0x16')](_0xcc4f('0x13'),auth[_0xcc4f('0xa')](),controller['addAgents']);router[_0xcc4f('0x18')](_0xcc4f('0xe'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x19')]);router[_0xcc4f('0x1a')](_0xcc4f('0xe'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x1b')]);router[_0xcc4f('0x1a')](_0xcc4f('0x11'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x1c')]);router[_0xcc4f('0x1a')](_0xcc4f('0x13'),auth[_0xcc4f('0xa')](),controller[_0xcc4f('0x1d')]);module[_0xcc4f('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 91dc4c6..c860ec7 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 _0x63eb=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5001e4,_0x74ce79){var _0x36da93=function(_0x28fcfb){while(--_0x28fcfb){_0x5001e4['push'](_0x5001e4['shift']());}};_0x36da93(++_0x74ce79);}(_0x63eb,0x90));var _0xb63e=function(_0x2d8938,_0x6b08e0){_0x2d8938=_0x2d8938-0x0;var _0x1234ce=_0x63eb[_0x2d8938];return _0x1234ce;};'use strict';var Sequelize=require(_0xb63e('0x0'));module[_0xb63e('0x1')]={'name':{'type':Sequelize[_0xb63e('0x2')],'unique':_0xb63e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb63e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb63e('0x5')](_0xb63e('0x6'),_0xb63e('0x7'),_0xb63e('0x8'))},'description':{'type':Sequelize[_0xb63e('0x2')]}}; \ No newline at end of file +var _0xc368=['ENUM','rrmemory','beepall','STRING','exports','name','INTEGER'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xc368,0x7b));var _0x8c36=function(_0x566591,_0x3fadbb){_0x566591=_0x566591-0x0;var _0x55ed13=_0xc368[_0x566591];return _0x55ed13;};'use strict';var Sequelize=require('sequelize');module[_0x8c36('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8c36('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8c36('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8c36('0x3')](_0x8c36('0x4'),_0x8c36('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x8c36('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 86cf63b..4236607 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 _0x0dba=['removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','findAll','rows','catch','show','includeAll','include','find','create','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserWhatsappQueue','order','sort','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','userWhatsappQueue:save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0dba,0x1b5));var _0xa0db=function(_0x4029aa,_0x3a79c7){_0x4029aa=_0x4029aa-0x0;var _0x5ed6a0=_0x0dba[_0x4029aa];return _0x5ed6a0;};'use strict';var emlformat=require(_0xa0db('0x0'));var rimraf=require(_0xa0db('0x1'));var zipdir=require(_0xa0db('0x2'));var jsonpatch=require(_0xa0db('0x3'));var rp=require('request-promise');var moment=require(_0xa0db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa0db('0x5'));var util=require(_0xa0db('0x6'));var path=require(_0xa0db('0x7'));var sox=require('sox');var csv=require(_0xa0db('0x8'));var ejs=require(_0xa0db('0x9'));var fs=require('fs');var fs_extra=require(_0xa0db('0xa'));var _=require(_0xa0db('0xb'));var squel=require('squel');var crypto=require(_0xa0db('0xc'));var jsforce=require(_0xa0db('0xd'));var deskjs=require(_0xa0db('0xe'));var toCsv=require(_0xa0db('0x8'));var querystring=require(_0xa0db('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa0db('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa0db('0x11'));var hardwareService=require(_0xa0db('0x12'));var logger=require(_0xa0db('0x13'))(_0xa0db('0x14'));var utils=require('../../config/utils');var config=require(_0xa0db('0x15'));var licenseUtil=require(_0xa0db('0x16'));var db=require(_0xa0db('0x17'))['db'];config[_0xa0db('0x18')]=_[_0xa0db('0x19')](config[_0xa0db('0x18')],{'host':_0xa0db('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0db('0x18')]));require(_0xa0db('0x1b'))[_0xa0db('0x1c')](socket);function respondWithStatusCode(_0x456176,_0x3922fd){_0x3922fd=_0x3922fd||0xcc;return function(_0x3faee0){if(_0x3faee0){return _0x456176[_0xa0db('0x1d')](_0x3922fd);}return _0x456176['status'](_0x3922fd)[_0xa0db('0x1e')]();};}function respondWithResult(_0x3913c4,_0x382ef2){_0x382ef2=_0x382ef2||0xc8;return function(_0x3f8326){if(_0x3f8326){return _0x3913c4[_0xa0db('0x1f')](_0x382ef2)['json'](_0x3f8326);}};}function respondWithFilteredResult(_0x4fce4a,_0x566eb9){return function(_0x4c5f4e){if(_0x4c5f4e){var _0x2d6fe7=typeof _0x566eb9[_0xa0db('0x20')]===_0xa0db('0x21')&&typeof _0x566eb9['limit']===_0xa0db('0x21');var _0x5b4513=_0x4c5f4e[_0xa0db('0x22')];var _0x1646ff=_0x2d6fe7?0x0:_0x566eb9[_0xa0db('0x20')];var _0x288057=_0x2d6fe7?_0x4c5f4e[_0xa0db('0x22')]:_0x566eb9[_0xa0db('0x20')]+_0x566eb9[_0xa0db('0x23')];var _0x3051e9;if(_0x288057>=_0x5b4513){_0x288057=_0x5b4513;_0x3051e9=0xc8;}else{_0x3051e9=0xce;}_0x4fce4a[_0xa0db('0x1f')](_0x3051e9);return _0x4fce4a[_0xa0db('0x24')](_0xa0db('0x25'),_0x1646ff+'-'+_0x288057+'/'+_0x5b4513)[_0xa0db('0x26')](_0x4c5f4e);}return null;};}function patchUpdates(_0xb22458){return function(_0x49c2c8){try{jsonpatch['apply'](_0x49c2c8,_0xb22458,!![]);}catch(_0x1ad3d7){return BPromise[_0xa0db('0x27')](_0x1ad3d7);}return _0x49c2c8['save']();};}function saveUpdates(_0x58f944,_0x432050){return function(_0x59c5cd){if(_0x59c5cd){return _0x59c5cd[_0xa0db('0x28')](_0x58f944)[_0xa0db('0x29')](function(_0x480250){return _0x480250;});}return null;};}function removeEntity(_0x4e33d2,_0x2edfe0){return function(_0x45b6d6){if(_0x45b6d6){return _0x45b6d6['destroy']()[_0xa0db('0x29')](function(){var _0x288987=_0x45b6d6[_0xa0db('0x2a')]({'plain':!![]});var _0x1343a4=_0xa0db('0x2b');return db[_0xa0db('0x2c')][_0xa0db('0x2d')]({'where':{'type':_0x1343a4,'resourceId':_0x288987['id']}})[_0xa0db('0x29')](function(){return _0x45b6d6;});})[_0xa0db('0x29')](function(){_0x4e33d2['status'](0xcc)[_0xa0db('0x1e')]();});}};}function handleEntityNotFound(_0x57195a,_0x366f71){return function(_0x182469){if(!_0x182469){_0x57195a[_0xa0db('0x1d')](0x194);}return _0x182469;};}function handleError(_0x350a05,_0xb34425){_0xb34425=_0xb34425||0x1f4;return function(_0x4979bf){logger[_0xa0db('0x2e')](_0x4979bf['stack']);if(_0x4979bf['name']){delete _0x4979bf[_0xa0db('0x2f')];}_0x350a05['status'](_0xb34425)[_0xa0db('0x30')](_0x4979bf);};}exports[_0xa0db('0x31')]=function(_0x3ffe3d,_0xf8c94d){var _0x541fa3={},_0x1cdf4f={},_0x2f238f={'count':0x0,'rows':[]};var _0x50e4bd=_[_0xa0db('0x32')](db[_0xa0db('0x33')][_0xa0db('0x34')],function(_0x23ceae){return{'name':_0x23ceae[_0xa0db('0x35')],'type':_0x23ceae[_0xa0db('0x36')]['key']};});_0x1cdf4f[_0xa0db('0x37')]=_['map'](_0x50e4bd,_0xa0db('0x2f'));_0x1cdf4f[_0xa0db('0x38')]=_[_0xa0db('0x39')](_0x3ffe3d['query']);_0x1cdf4f[_0xa0db('0x3a')]=_['intersection'](_0x1cdf4f['model'],_0x1cdf4f[_0xa0db('0x38')]);_0x541fa3[_0xa0db('0x3b')]=_[_0xa0db('0x3c')](_0x1cdf4f['model'],qs[_0xa0db('0x3d')](_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x3d')]));_0x541fa3[_0xa0db('0x3b')]=_0x541fa3[_0xa0db('0x3b')][_0xa0db('0x3e')]?_0x541fa3[_0xa0db('0x3b')]:_0x1cdf4f[_0xa0db('0x37')];if(!_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x3f')](_0xa0db('0x40'))){_0x541fa3['limit']=qs[_0xa0db('0x23')](_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x23')]);_0x541fa3[_0xa0db('0x20')]=qs[_0xa0db('0x20')](_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x20')]);}_0x541fa3['order']=qs['sort'](_0x3ffe3d[_0xa0db('0x38')]['sort']);_0x541fa3[_0xa0db('0x41')]=qs[_0xa0db('0x3a')](_[_0xa0db('0x42')](_0x3ffe3d[_0xa0db('0x38')],_0x1cdf4f['filters']),_0x50e4bd);if(_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x43')]){_0x541fa3[_0xa0db('0x41')]=_[_0xa0db('0x44')](_0x541fa3[_0xa0db('0x41')],{'$or':_[_0xa0db('0x32')](_0x50e4bd,function(_0x3b8bb0){if(_0x3b8bb0[_0xa0db('0x36')]!=='VIRTUAL'){var _0x56b55f={};_0x56b55f[_0x3b8bb0[_0xa0db('0x2f')]]={'$like':'%'+_0x3ffe3d[_0xa0db('0x38')][_0xa0db('0x43')]+'%'};return _0x56b55f;}})});}_0x541fa3=_['merge']({},_0x541fa3,_0x3ffe3d[_0xa0db('0x45')]);var _0x1101ef={'where':_0x541fa3[_0xa0db('0x41')]};return db[_0xa0db('0x33')][_0xa0db('0x22')](_0x1101ef)[_0xa0db('0x29')](function(_0x530164){_0x2f238f[_0xa0db('0x22')]=_0x530164;if(_0x3ffe3d[_0xa0db('0x38')]['includeAll']){_0x541fa3['include']=[{'all':!![]}];}return db[_0xa0db('0x33')][_0xa0db('0x46')](_0x541fa3);})[_0xa0db('0x29')](function(_0x3d66f9){_0x2f238f[_0xa0db('0x47')]=_0x3d66f9;return _0x2f238f;})['then'](respondWithFilteredResult(_0xf8c94d,_0x541fa3))[_0xa0db('0x48')](handleError(_0xf8c94d,null));};exports[_0xa0db('0x49')]=function(_0x32d1d8,_0x438e4c){var _0x41d93f={'raw':!![],'where':{'id':_0x32d1d8['params']['id']}},_0x775f71={};_0x775f71[_0xa0db('0x37')]=_[_0xa0db('0x39')](db[_0xa0db('0x33')]['rawAttributes']);_0x775f71[_0xa0db('0x38')]=_[_0xa0db('0x39')](_0x32d1d8[_0xa0db('0x38')]);_0x775f71[_0xa0db('0x3a')]=_[_0xa0db('0x3c')](_0x775f71[_0xa0db('0x37')],_0x775f71[_0xa0db('0x38')]);_0x41d93f[_0xa0db('0x3b')]=_[_0xa0db('0x3c')](_0x775f71[_0xa0db('0x37')],qs[_0xa0db('0x3d')](_0x32d1d8[_0xa0db('0x38')][_0xa0db('0x3d')]));_0x41d93f[_0xa0db('0x3b')]=_0x41d93f['attributes'][_0xa0db('0x3e')]?_0x41d93f[_0xa0db('0x3b')]:_0x775f71[_0xa0db('0x37')];if(_0x32d1d8['query'][_0xa0db('0x4a')]){_0x41d93f[_0xa0db('0x4b')]=[{'all':!![]}];}_0x41d93f=_[_0xa0db('0x44')]({},_0x41d93f,_0x32d1d8[_0xa0db('0x45')]);return db['WhatsappQueue'][_0xa0db('0x4c')](_0x41d93f)['then'](handleEntityNotFound(_0x438e4c,null))[_0xa0db('0x29')](respondWithResult(_0x438e4c,null))[_0xa0db('0x48')](handleError(_0x438e4c,null));};exports[_0xa0db('0x4d')]=function(_0x50255a,_0x148288){return db['WhatsappQueue'][_0xa0db('0x4d')](_0x50255a['body'],{})[_0xa0db('0x29')](function(_0x20e157){var _0x4c1b5f=_0x50255a['user'][_0xa0db('0x2a')]({'plain':!![]});if(!_0x4c1b5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1b5f['role']==='user'){var _0x142f0c=_0x20e157[_0xa0db('0x2a')]({'plain':!![]});var _0x267506=_0xa0db('0x2b');return db['UserProfileSection'][_0xa0db('0x4c')]({'where':{'name':_0x267506,'userProfileId':_0x4c1b5f[_0xa0db('0x4e')]},'raw':!![]})['then'](function(_0x27f7b8){if(_0x27f7b8&&_0x27f7b8[_0xa0db('0x4f')]===0x0){return db[_0xa0db('0x2c')]['create']({'name':_0x142f0c['name'],'resourceId':_0x142f0c['id'],'type':_0x27f7b8[_0xa0db('0x2f')],'sectionId':_0x27f7b8['id']},{})[_0xa0db('0x29')](function(){return _0x20e157;});}else{return _0x20e157;}})['catch'](function(_0x26c228){logger['error'](_0xa0db('0x50'),_0x26c228);throw _0x26c228;});}return _0x20e157;})['then'](respondWithResult(_0x148288,0xc9))[_0xa0db('0x48')](handleError(_0x148288,null));};exports['update']=function(_0x301c5c,_0x5eec8a){if(_0x301c5c[_0xa0db('0x51')]['id']){delete _0x301c5c[_0xa0db('0x51')]['id'];}return db[_0xa0db('0x33')][_0xa0db('0x4c')]({'where':{'id':_0x301c5c[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x5eec8a,null))[_0xa0db('0x29')](saveUpdates(_0x301c5c['body'],null))[_0xa0db('0x29')](respondWithResult(_0x5eec8a,null))[_0xa0db('0x48')](handleError(_0x5eec8a,null));};exports[_0xa0db('0x2d')]=function(_0x205e2a,_0x4651c0){return db[_0xa0db('0x33')]['find']({'where':{'id':_0x205e2a[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x4651c0,null))[_0xa0db('0x29')](removeEntity(_0x4651c0,null))[_0xa0db('0x48')](handleError(_0x4651c0,null));};exports[_0xa0db('0x53')]=function(_0x2561f2,_0x1418d8){return db[_0xa0db('0x33')]['describe']()[_0xa0db('0x29')](respondWithResult(_0x1418d8,null))[_0xa0db('0x48')](handleError(_0x1418d8,null));};exports[_0xa0db('0x54')]=function(_0x37033d,_0x5bc28f,_0x18e900){var _0x34966b={'raw':!![],'where':{}},_0x381cec={},_0x9b9ef2;return db[_0xa0db('0x33')][_0xa0db('0x55')]({'where':{'id':_0x37033d[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x5bc28f,null))[_0xa0db('0x29')](function(_0x15d5b9){if(_0x15d5b9){_0x9b9ef2=_0x15d5b9[_0xa0db('0x2a')]({'plain':!![]});_0x381cec['model']=_[_0xa0db('0x39')](db[_0xa0db('0x56')][_0xa0db('0x34')]);_0x381cec['query']=_[_0xa0db('0x39')](_0x37033d['query']);_0x381cec[_0xa0db('0x3a')]=_[_0xa0db('0x3c')](_0x381cec['model'],_0x381cec[_0xa0db('0x38')]);_0x34966b[_0xa0db('0x3b')]=_[_0xa0db('0x3c')](_0x381cec[_0xa0db('0x37')],qs['fields'](_0x37033d[_0xa0db('0x38')][_0xa0db('0x3d')]));_0x34966b[_0xa0db('0x3b')]=_0x34966b[_0xa0db('0x3b')][_0xa0db('0x3e')]?_0x34966b[_0xa0db('0x3b')]:_0x381cec[_0xa0db('0x37')];if(!_0x37033d[_0xa0db('0x38')][_0xa0db('0x3f')]('nolimit')){_0x34966b['limit']=qs[_0xa0db('0x23')](_0x37033d[_0xa0db('0x38')][_0xa0db('0x23')]);_0x34966b[_0xa0db('0x20')]=qs[_0xa0db('0x20')](_0x37033d['query'][_0xa0db('0x20')]);}_0x34966b[_0xa0db('0x57')]=qs[_0xa0db('0x58')](_0x37033d[_0xa0db('0x38')]['sort']);_0x34966b[_0xa0db('0x41')]=qs[_0xa0db('0x3a')](_[_0xa0db('0x42')](_0x37033d[_0xa0db('0x38')],_0x381cec['filters']));_0x34966b[_0xa0db('0x41')][_0xa0db('0x59')]=_0x15d5b9['id'];if(_0x37033d['query'][_0xa0db('0x43')]){_0x34966b[_0xa0db('0x41')]=_[_0xa0db('0x44')](_0x34966b[_0xa0db('0x41')],{'$or':_[_0xa0db('0x32')](_0x34966b[_0xa0db('0x3b')],function(_0x1962d6){var _0x19b6fc={};_0x19b6fc[_0x1962d6]={'$like':'%'+_0x37033d[_0xa0db('0x38')][_0xa0db('0x43')]+'%'};return _0x19b6fc;})});}_0x34966b=_[_0xa0db('0x44')]({},_0x34966b,_0x37033d['options']);return db[_0xa0db('0x56')][_0xa0db('0x46')](_0x34966b);}})[_0xa0db('0x29')](function(_0x363c0e){if(_0x363c0e){return db[_0xa0db('0x5a')][_0xa0db('0x5b')]({'where':{'id':_[_0xa0db('0x32')](_0x363c0e,_0xa0db('0x5c')),'role':_0xa0db('0x5d')},'attributes':['id',_0xa0db('0x2f'),_0xa0db('0x5e'),'updatedAt','createdAt']});}})[_0xa0db('0x29')](function(_0x5901bb){if(_0x5901bb){return{'count':_0x5901bb[_0xa0db('0x22')],'rows':_['map'](_0x5901bb[_0xa0db('0x47')],function(_0x26c510){return{'membername':_0x26c510['name'],'UserId':_0x26c510['id'],'queue_name':_0x9b9ef2['name'],'WhatsappQueueId':_0x9b9ef2['id'],'interface':util['format'](_0xa0db('0x5f'),_0xa0db('0x60'),_0x26c510['name']),'penalty':0x0,'paused':_0x26c510['whatsappPause'],'createdAt':_0x26c510[_0xa0db('0x61')],'updatedAt':_0x26c510['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5bc28f,_0x34966b))['catch'](handleError(_0x5bc28f,null));};exports[_0xa0db('0x62')]=function(_0x4ca1bd,_0x4ce003,_0x1d504b){var _0x35c894={};var _0x33d558={};var _0x10eb3a;var _0x2f695a;return db[_0xa0db('0x33')][_0xa0db('0x55')]({'where':{'id':_0x4ca1bd['params']['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x4ce003,null))[_0xa0db('0x29')](function(_0x2db3c9){if(_0x2db3c9){_0x10eb3a=_0x2db3c9;_0x33d558[_0xa0db('0x37')]=_[_0xa0db('0x39')](db[_0xa0db('0x63')][_0xa0db('0x34')]);_0x33d558[_0xa0db('0x38')]=_['keys'](_0x4ca1bd[_0xa0db('0x38')]);_0x33d558[_0xa0db('0x3a')]=_[_0xa0db('0x3c')](_0x33d558[_0xa0db('0x37')],_0x33d558[_0xa0db('0x38')]);_0x35c894[_0xa0db('0x3b')]=_['intersection'](_0x33d558['model'],qs[_0xa0db('0x3d')](_0x4ca1bd[_0xa0db('0x38')]['fields']));_0x35c894[_0xa0db('0x3b')]=_0x35c894['attributes'][_0xa0db('0x3e')]?_0x35c894[_0xa0db('0x3b')]:_0x33d558[_0xa0db('0x37')];_0x35c894[_0xa0db('0x57')]=qs['sort'](_0x4ca1bd[_0xa0db('0x38')]['sort']);_0x35c894[_0xa0db('0x41')]=qs[_0xa0db('0x3a')](_[_0xa0db('0x42')](_0x4ca1bd[_0xa0db('0x38')],_0x33d558[_0xa0db('0x3a')]));if(_0x4ca1bd['query'][_0xa0db('0x43')]){_0x35c894[_0xa0db('0x41')]=_[_0xa0db('0x44')](_0x35c894['where'],{'$or':_['map'](_0x35c894[_0xa0db('0x3b')],function(_0x1cbfdf){var _0x25f31f={};_0x25f31f[_0x1cbfdf]={'$like':'%'+_0x4ca1bd[_0xa0db('0x38')]['filter']+'%'};return _0x25f31f;})});}_0x35c894=_[_0xa0db('0x44')]({},_0x35c894,_0x4ca1bd[_0xa0db('0x45')]);return _0x10eb3a['getTeams'](_0x35c894);}})[_0xa0db('0x29')](function(_0x3a2b13){if(_0x3a2b13){_0x2f695a=_0x3a2b13[_0xa0db('0x3e')];if(!_0x4ca1bd['query'][_0xa0db('0x3f')](_0xa0db('0x40'))){_0x35c894[_0xa0db('0x23')]=qs['limit'](_0x4ca1bd['query'][_0xa0db('0x23')]);_0x35c894[_0xa0db('0x20')]=qs[_0xa0db('0x20')](_0x4ca1bd[_0xa0db('0x38')][_0xa0db('0x20')]);}return _0x10eb3a[_0xa0db('0x62')](_0x35c894);}})[_0xa0db('0x29')](function(_0x1337e6){if(_0x1337e6){return _0x1337e6?{'count':_0x2f695a,'rows':_0x1337e6}:null;}})[_0xa0db('0x29')](respondWithResult(_0x4ce003,null))[_0xa0db('0x48')](handleError(_0x4ce003,null));};exports['addTeams']=function(_0x5e8514,_0x548f58,_0x452a92){var _0x49beb5=_0x5e8514[_0xa0db('0x51')][_0xa0db('0x64')];return db[_0xa0db('0x63')]['findAll']({'where':{'id':_0x49beb5},'attributes':['id'],'include':[{'model':db[_0xa0db('0x5a')],'as':_0xa0db('0x65'),'attributes':['id',_0xa0db('0x2f'),_0xa0db('0x66'),_0xa0db('0x67'),_0xa0db('0x68')],'raw':!![]}]})['then'](function(_0x93b769){if(_0x93b769){var _0x4fad00=_['flatMap'](_0x93b769,function(_0x27bf4e){var _0x1cd485=_0x27bf4e[_0xa0db('0x2a')]({'plain':!![]});return _0x1cd485['Agents'];});return db[_0xa0db('0x33')][_0xa0db('0x4c')]({'where':{'id':_0x5e8514['params']['id']}})[_0xa0db('0x29')](function(_0x41a99d){return db[_0xa0db('0x69')][_0xa0db('0x6a')](function(_0x26b586){return _0x41a99d[_0xa0db('0x6b')](_0x49beb5,{'transaction':_0x26b586})['then'](function(){return BPromise[_0xa0db('0x6c')](_0x4fad00,function(_0x718b6c){return db[_0xa0db('0x56')][_0xa0db('0x6d')]({'where':{'UserId':_0x718b6c['id'],'WhatsappQueueId':_0x5e8514[_0xa0db('0x52')]['id']},'transaction':_0x26b586});});})[_0xa0db('0x29')](function(){_0x4fad00['forEach'](function(_0x348f1d){socket['emit'](_0xa0db('0x6e'),{'UserId':_0x348f1d['id'],'WhatsappQueueId':_0x41a99d['id']});});});});});}})[_0xa0db('0x29')](respondWithStatusCode(_0x548f58,null))[_0xa0db('0x48')](handleError(_0x548f58,null));};exports[_0xa0db('0x6f')]=function(_0x3ab3ce,_0x545f7f,_0x5c4acc){return db['Team'][_0xa0db('0x46')]({'where':{'id':_0x3ab3ce[_0xa0db('0x38')][_0xa0db('0x64')]},'attributes':['id'],'include':[{'model':db[_0xa0db('0x5a')],'as':_0xa0db('0x65'),'attributes':['id'],'raw':!![]}]})[_0xa0db('0x29')](handleEntityNotFound(_0x545f7f,null))[_0xa0db('0x29')](function(_0x3a453){var _0x38a011=_[_0xa0db('0x32')](_0x3a453,'id');var _0x5a272d=[];var _0x8434b1=[];var _0x37ceeb=squel[_0xa0db('0x70')]();_0x37ceeb[_0xa0db('0x71')](_0xa0db('0x72'))[_0xa0db('0x73')](_0xa0db('0x74'),'tq')[_0xa0db('0x75')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa0db('0x41')]('WhatsappQueueId\x20=\x20?',_0x3ab3ce[_0xa0db('0x52')]['id']);for(var _0xd63a2d=0x0;_0xd63a2d<_0x3a453[_0xa0db('0x3e')];_0xd63a2d+=0x1){let _0x49e2d0=_0x3a453[_0xd63a2d];for(var _0x36ae1e=0x0;_0x36ae1e<_0x49e2d0[_0xa0db('0x65')][_0xa0db('0x3e')];_0x36ae1e+=0x1){let _0x1450db=_0x49e2d0[_0xa0db('0x65')][_0x36ae1e];var _0x179d8e=_0x37ceeb[_0xa0db('0x76')]();_0x179d8e[_0xa0db('0x41')](_0xa0db('0x77'),_0x1450db['id']);_0x8434b1[_0xa0db('0x78')](db[_0xa0db('0x69')][_0xa0db('0x38')](_0x179d8e[_0xa0db('0x79')](),{'type':db[_0xa0db('0x69')][_0xa0db('0x7a')]['SELECT']})[_0xa0db('0x29')](function(_0x266879){if(_0x266879[_0xa0db('0x3e')]===0x1){return _0x1450db['id'];}else{var _0x42c295=_[_0xa0db('0x7b')](_[_0xa0db('0x32')](_0x266879,_0xa0db('0x7c')),function(_0x1a86cd){return _[_0xa0db('0x7d')](_0x38a011,_0x1a86cd);});if(_0x42c295){return _0x1450db['id'];}}}));}}return BPromise[_0xa0db('0x7e')](_0x8434b1)[_0xa0db('0x29')](function(_0xe23383){_0x5a272d=_(_0x5a272d)['union'](_0xe23383)[_0xa0db('0x7f')]()[_0xa0db('0x80')]();return db[_0xa0db('0x33')]['find']({'where':{'id':_0x3ab3ce[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](function(_0x4cbbed){return db[_0xa0db('0x69')][_0xa0db('0x6a')](function(_0x18ed12){return _0x4cbbed[_0xa0db('0x6f')](_0x3ab3ce['query']['ids'],{'transaction':_0x18ed12})[_0xa0db('0x29')](function(){if(!_['isEmpty'](_0x5a272d)){return _0x4cbbed[_0xa0db('0x81')](_0x5a272d,{'transaction':_0x18ed12});}})[_0xa0db('0x29')](function(){_0x5a272d['forEach'](function(_0x30fa59){socket[_0xa0db('0x82')](_0xa0db('0x83'),{'UserId':_0x30fa59,'WhatsappQueueId':_0x4cbbed['id']});});});});});});})['then'](respondWithStatusCode(_0x545f7f,null))['catch'](handleError(_0x545f7f,null));};exports[_0xa0db('0x84')]=function(_0x2d65b6,_0x151853,_0x116894){return db[_0xa0db('0x33')][_0xa0db('0x4c')]({'where':{'id':_0x2d65b6[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x151853,null))['then'](function(_0x586e1b){if(_0x586e1b){return _0x586e1b[_0xa0db('0x84')](_0x2d65b6[_0xa0db('0x51')][_0xa0db('0x64')],_[_0xa0db('0x85')](_0x2d65b6['body'],['ids','id'])||{})[_0xa0db('0x86')](function(_0x10e60a){for(var _0x21621f=0x0;_0x21621f<_0x2d65b6[_0xa0db('0x51')][_0xa0db('0x64')]['length'];_0x21621f+=0x1){socket['emit'](_0xa0db('0x6e'),{'UserId':Number(_0x2d65b6['body'][_0xa0db('0x64')][_0x21621f]),'WhatsappQueueId':Number(_0x2d65b6['params']['id'])});}return _0x10e60a;});}})['then'](respondWithResult(_0x151853,null))[_0xa0db('0x48')](handleError(_0x151853,null));};exports[_0xa0db('0x81')]=function(_0x1a7986,_0x34fca1,_0x2dc1ef){return db['WhatsappQueue'][_0xa0db('0x4c')]({'where':{'id':_0x1a7986[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x34fca1,null))[_0xa0db('0x29')](function(_0x2f6d12){if(_0x2f6d12){return _0x2f6d12[_0xa0db('0x81')](_0x1a7986[_0xa0db('0x38')]['ids'])['then'](function(){if(_[_0xa0db('0x87')](_0x1a7986[_0xa0db('0x38')][_0xa0db('0x64')])){for(var _0x25fae2=0x0;_0x25fae2<_0x1a7986[_0xa0db('0x38')][_0xa0db('0x64')]['length'];_0x25fae2+=0x1){socket['emit'](_0xa0db('0x83'),{'UserId':Number(_0x1a7986['query'][_0xa0db('0x64')][_0x25fae2]),'WhatsappQueueId':Number(_0x1a7986['params']['id'])});}}else{socket['emit'](_0xa0db('0x83'),{'UserId':Number(_0x1a7986['query'][_0xa0db('0x64')]),'WhatsappQueueId':Number(_0x1a7986[_0xa0db('0x52')]['id'])});}});}})[_0xa0db('0x29')](respondWithStatusCode(_0x34fca1,null))[_0xa0db('0x48')](handleError(_0x34fca1,null));};exports[_0xa0db('0x88')]=function(_0x17d629,_0x16d239,_0x25f933){var _0x4245ed={};var _0x5bc65f={};var _0x3ed610;var _0x135498;return db[_0xa0db('0x33')][_0xa0db('0x55')]({'where':{'id':_0x17d629[_0xa0db('0x52')]['id']}})[_0xa0db('0x29')](handleEntityNotFound(_0x16d239,null))[_0xa0db('0x29')](function(_0x2796ff){if(_0x2796ff){_0x3ed610=_0x2796ff;_0x5bc65f['model']=_['keys'](db[_0xa0db('0x5a')]['rawAttributes']);_0x5bc65f[_0xa0db('0x38')]=_[_0xa0db('0x39')](_0x17d629[_0xa0db('0x38')]);_0x5bc65f[_0xa0db('0x3a')]=_['intersection'](_0x5bc65f[_0xa0db('0x37')],_0x5bc65f[_0xa0db('0x38')]);_0x4245ed[_0xa0db('0x3b')]=_[_0xa0db('0x3c')](_0x5bc65f['model'],qs[_0xa0db('0x3d')](_0x17d629[_0xa0db('0x38')][_0xa0db('0x3d')]));_0x4245ed['attributes']=_0x4245ed['attributes']['length']?_0x4245ed[_0xa0db('0x3b')]:_0x5bc65f[_0xa0db('0x37')];_0x4245ed[_0xa0db('0x57')]=qs['sort'](_0x17d629[_0xa0db('0x38')][_0xa0db('0x58')]);_0x4245ed[_0xa0db('0x41')]=qs[_0xa0db('0x3a')](_[_0xa0db('0x42')](_0x17d629[_0xa0db('0x38')],_0x5bc65f[_0xa0db('0x3a')]));if(_0x17d629['query']['filter']){_0x4245ed[_0xa0db('0x41')]=_[_0xa0db('0x44')](_0x4245ed[_0xa0db('0x41')],{'$or':_['map'](_0x4245ed[_0xa0db('0x3b')],function(_0x22b5d8){var _0x4a38e1={};_0x4a38e1[_0x22b5d8]={'$like':'%'+_0x17d629[_0xa0db('0x38')][_0xa0db('0x43')]+'%'};return _0x4a38e1;})});}_0x4245ed=_['merge']({},_0x4245ed,_0x17d629[_0xa0db('0x45')]);return _0x3ed610[_0xa0db('0x88')](_0x4245ed);}})['then'](function(_0x1cb41e){if(_0x1cb41e){_0x135498=_0x1cb41e[_0xa0db('0x3e')];if(!_0x17d629[_0xa0db('0x38')][_0xa0db('0x3f')](_0xa0db('0x40'))){_0x4245ed['limit']=qs['limit'](_0x17d629[_0xa0db('0x38')][_0xa0db('0x23')]);_0x4245ed[_0xa0db('0x20')]=qs[_0xa0db('0x20')](_0x17d629[_0xa0db('0x38')][_0xa0db('0x20')]);}return _0x3ed610[_0xa0db('0x88')](_0x4245ed);}})[_0xa0db('0x29')](function(_0x13ad84){if(_0x13ad84){return _0x13ad84?{'count':_0x135498,'rows':_0x13ad84}:null;}})[_0xa0db('0x29')](respondWithResult(_0x16d239,null))[_0xa0db('0x48')](handleError(_0x16d239,null));}; \ No newline at end of file +var _0x3bfd=['show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','body','describe','getMembers','findOne','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','agent','updatedAt','createdAt','format','SIP','whatsappPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','compact','value','transaction','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','WhatsappQueue','includeAll','include','findAll','rows','catch'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x3bfd,0x1f1));var _0xd3bf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3bfd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd3bf('0x0'));var rimraf=require(_0xd3bf('0x1'));var zipdir=require(_0xd3bf('0x2'));var jsonpatch=require(_0xd3bf('0x3'));var rp=require('request-promise');var moment=require(_0xd3bf('0x4'));var BPromise=require(_0xd3bf('0x5'));var Mustache=require(_0xd3bf('0x6'));var util=require(_0xd3bf('0x7'));var path=require('path');var sox=require(_0xd3bf('0x8'));var csv=require(_0xd3bf('0x9'));var ejs=require(_0xd3bf('0xa'));var fs=require('fs');var fs_extra=require(_0xd3bf('0xb'));var _=require(_0xd3bf('0xc'));var squel=require(_0xd3bf('0xd'));var crypto=require(_0xd3bf('0xe'));var jsforce=require(_0xd3bf('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd3bf('0x9'));var querystring=require(_0xd3bf('0x10'));var Papa=require('papaparse');var Redis=require(_0xd3bf('0x11'));var authService=require(_0xd3bf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd3bf('0x13'));var hardwareService=require(_0xd3bf('0x14'));var logger=require(_0xd3bf('0x15'))(_0xd3bf('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd3bf('0x17'));var db=require(_0xd3bf('0x18'))['db'];config['redis']=_[_0xd3bf('0x19')](config[_0xd3bf('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd3bf('0x1b'))(new Redis(config['redis']));require(_0xd3bf('0x1c'))['register'](socket);function respondWithStatusCode(_0x6f992b,_0xc7972d){_0xc7972d=_0xc7972d||0xcc;return function(_0xdc5a68){if(_0xdc5a68){return _0x6f992b['sendStatus'](_0xc7972d);}return _0x6f992b[_0xd3bf('0x1d')](_0xc7972d)[_0xd3bf('0x1e')]();};}function respondWithResult(_0x4f9523,_0x3b0719){_0x3b0719=_0x3b0719||0xc8;return function(_0x3ef268){if(_0x3ef268){return _0x4f9523[_0xd3bf('0x1d')](_0x3b0719)[_0xd3bf('0x1f')](_0x3ef268);}};}function respondWithFilteredResult(_0x37eca2,_0x4ef76e){return function(_0x223819){if(_0x223819){var _0x1cf865=typeof _0x4ef76e['offset']===_0xd3bf('0x20')&&typeof _0x4ef76e[_0xd3bf('0x21')]===_0xd3bf('0x20');var _0x2f2d27=_0x223819[_0xd3bf('0x22')];var _0x90317=_0x1cf865?0x0:_0x4ef76e[_0xd3bf('0x23')];var _0x555c74=_0x1cf865?_0x223819[_0xd3bf('0x22')]:_0x4ef76e['offset']+_0x4ef76e['limit'];var _0x25ebaa;if(_0x555c74>=_0x2f2d27){_0x555c74=_0x2f2d27;_0x25ebaa=0xc8;}else{_0x25ebaa=0xce;}_0x37eca2['status'](_0x25ebaa);return _0x37eca2[_0xd3bf('0x24')](_0xd3bf('0x25'),_0x90317+'-'+_0x555c74+'/'+_0x2f2d27)[_0xd3bf('0x1f')](_0x223819);}return null;};}function patchUpdates(_0x176475){return function(_0x7649e5){try{jsonpatch[_0xd3bf('0x26')](_0x7649e5,_0x176475,!![]);}catch(_0x2bfcf0){return BPromise[_0xd3bf('0x27')](_0x2bfcf0);}return _0x7649e5[_0xd3bf('0x28')]();};}function saveUpdates(_0x396076,_0x3dc805){return function(_0x3caf7b){if(_0x3caf7b){return _0x3caf7b[_0xd3bf('0x29')](_0x396076)[_0xd3bf('0x2a')](function(_0x1bab00){return _0x1bab00;});}return null;};}function removeEntity(_0x1b033e,_0x417cfe){return function(_0xf80602){if(_0xf80602){return _0xf80602['destroy']()[_0xd3bf('0x2a')](function(){var _0x24f475=_0xf80602[_0xd3bf('0x2b')]({'plain':!![]});var _0x4151b6=_0xd3bf('0x2c');return db['UserProfileResource'][_0xd3bf('0x2d')]({'where':{'type':_0x4151b6,'resourceId':_0x24f475['id']}})[_0xd3bf('0x2a')](function(){return _0xf80602;});})[_0xd3bf('0x2a')](function(){_0x1b033e[_0xd3bf('0x1d')](0xcc)[_0xd3bf('0x1e')]();});}};}function handleEntityNotFound(_0x4a1dc5,_0x4a5b44){return function(_0x55c1d9){if(!_0x55c1d9){_0x4a1dc5[_0xd3bf('0x2e')](0x194);}return _0x55c1d9;};}function handleError(_0x19b425,_0x3113d4){_0x3113d4=_0x3113d4||0x1f4;return function(_0x4f9c71){logger[_0xd3bf('0x2f')](_0x4f9c71[_0xd3bf('0x30')]);if(_0x4f9c71[_0xd3bf('0x31')]){delete _0x4f9c71[_0xd3bf('0x31')];}_0x19b425['status'](_0x3113d4)[_0xd3bf('0x32')](_0x4f9c71);};}exports['index']=function(_0x397233,_0x1a44fc){var _0xdd8a35={},_0x42d6da={},_0x1c64df={'count':0x0,'rows':[]};var _0x431aa5=_[_0xd3bf('0x33')](db['WhatsappQueue'][_0xd3bf('0x34')],function(_0x145f5d){return{'name':_0x145f5d[_0xd3bf('0x35')],'type':_0x145f5d[_0xd3bf('0x36')][_0xd3bf('0x37')]};});_0x42d6da[_0xd3bf('0x38')]=_[_0xd3bf('0x33')](_0x431aa5,'name');_0x42d6da[_0xd3bf('0x39')]=_[_0xd3bf('0x3a')](_0x397233[_0xd3bf('0x39')]);_0x42d6da[_0xd3bf('0x3b')]=_['intersection'](_0x42d6da[_0xd3bf('0x38')],_0x42d6da[_0xd3bf('0x39')]);_0xdd8a35['attributes']=_[_0xd3bf('0x3c')](_0x42d6da[_0xd3bf('0x38')],qs[_0xd3bf('0x3d')](_0x397233[_0xd3bf('0x39')][_0xd3bf('0x3d')]));_0xdd8a35[_0xd3bf('0x3e')]=_0xdd8a35['attributes'][_0xd3bf('0x3f')]?_0xdd8a35[_0xd3bf('0x3e')]:_0x42d6da['model'];if(!_0x397233['query'][_0xd3bf('0x40')](_0xd3bf('0x41'))){_0xdd8a35[_0xd3bf('0x21')]=qs[_0xd3bf('0x21')](_0x397233[_0xd3bf('0x39')][_0xd3bf('0x21')]);_0xdd8a35['offset']=qs[_0xd3bf('0x23')](_0x397233[_0xd3bf('0x39')][_0xd3bf('0x23')]);}_0xdd8a35[_0xd3bf('0x42')]=qs[_0xd3bf('0x43')](_0x397233[_0xd3bf('0x39')][_0xd3bf('0x43')]);_0xdd8a35[_0xd3bf('0x44')]=qs[_0xd3bf('0x3b')](_[_0xd3bf('0x45')](_0x397233[_0xd3bf('0x39')],_0x42d6da[_0xd3bf('0x3b')]),_0x431aa5);if(_0x397233['query']['filter']){_0xdd8a35['where']=_['merge'](_0xdd8a35[_0xd3bf('0x44')],{'$or':_['map'](_0x431aa5,function(_0x491f91){if(_0x491f91[_0xd3bf('0x36')]!==_0xd3bf('0x46')){var _0x3207c7={};_0x3207c7[_0x491f91['name']]={'$like':'%'+_0x397233[_0xd3bf('0x39')]['filter']+'%'};return _0x3207c7;}})});}_0xdd8a35=_[_0xd3bf('0x47')]({},_0xdd8a35,_0x397233[_0xd3bf('0x48')]);var _0x23d1f4={'where':_0xdd8a35[_0xd3bf('0x44')]};return db[_0xd3bf('0x49')]['count'](_0x23d1f4)[_0xd3bf('0x2a')](function(_0x5378d8){_0x1c64df['count']=_0x5378d8;if(_0x397233[_0xd3bf('0x39')][_0xd3bf('0x4a')]){_0xdd8a35[_0xd3bf('0x4b')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xd3bf('0x4c')](_0xdd8a35);})[_0xd3bf('0x2a')](function(_0x718de9){_0x1c64df[_0xd3bf('0x4d')]=_0x718de9;return _0x1c64df;})['then'](respondWithFilteredResult(_0x1a44fc,_0xdd8a35))[_0xd3bf('0x4e')](handleError(_0x1a44fc,null));};exports[_0xd3bf('0x4f')]=function(_0x32b71e,_0x14c65f){var _0x49cc38={'raw':!![],'where':{'id':_0x32b71e[_0xd3bf('0x50')]['id']}},_0x4d4da0={};_0x4d4da0[_0xd3bf('0x38')]=_[_0xd3bf('0x3a')](db[_0xd3bf('0x49')]['rawAttributes']);_0x4d4da0[_0xd3bf('0x39')]=_[_0xd3bf('0x3a')](_0x32b71e[_0xd3bf('0x39')]);_0x4d4da0[_0xd3bf('0x3b')]=_[_0xd3bf('0x3c')](_0x4d4da0['model'],_0x4d4da0[_0xd3bf('0x39')]);_0x49cc38[_0xd3bf('0x3e')]=_['intersection'](_0x4d4da0[_0xd3bf('0x38')],qs[_0xd3bf('0x3d')](_0x32b71e[_0xd3bf('0x39')][_0xd3bf('0x3d')]));_0x49cc38[_0xd3bf('0x3e')]=_0x49cc38[_0xd3bf('0x3e')]['length']?_0x49cc38['attributes']:_0x4d4da0[_0xd3bf('0x38')];if(_0x32b71e[_0xd3bf('0x39')][_0xd3bf('0x4a')]){_0x49cc38[_0xd3bf('0x4b')]=[{'all':!![]}];}_0x49cc38=_[_0xd3bf('0x47')]({},_0x49cc38,_0x32b71e[_0xd3bf('0x48')]);return db[_0xd3bf('0x49')]['find'](_0x49cc38)['then'](handleEntityNotFound(_0x14c65f,null))[_0xd3bf('0x2a')](respondWithResult(_0x14c65f,null))[_0xd3bf('0x4e')](handleError(_0x14c65f,null));};exports[_0xd3bf('0x51')]=function(_0x166ede,_0x45caa6){return db[_0xd3bf('0x49')][_0xd3bf('0x51')](_0x166ede['body'],{})[_0xd3bf('0x2a')](function(_0x2925d3){var _0x2e5522=_0x166ede[_0xd3bf('0x52')][_0xd3bf('0x2b')]({'plain':!![]});if(!_0x2e5522)throw new Error(_0xd3bf('0x53'));if(_0x2e5522['role']===_0xd3bf('0x52')){var _0x2818b3=_0x2925d3[_0xd3bf('0x2b')]({'plain':!![]});var _0x5a6e54='WhatsappQueues';return db[_0xd3bf('0x54')][_0xd3bf('0x55')]({'where':{'name':_0x5a6e54,'userProfileId':_0x2e5522[_0xd3bf('0x56')]},'raw':!![]})[_0xd3bf('0x2a')](function(_0x40af2c){if(_0x40af2c&&_0x40af2c['autoAssociation']===0x0){return db[_0xd3bf('0x57')]['create']({'name':_0x2818b3['name'],'resourceId':_0x2818b3['id'],'type':_0x40af2c[_0xd3bf('0x31')],'sectionId':_0x40af2c['id']},{})[_0xd3bf('0x2a')](function(){return _0x2925d3;});}else{return _0x2925d3;}})[_0xd3bf('0x4e')](function(_0x301bc2){logger[_0xd3bf('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x301bc2);throw _0x301bc2;});}return _0x2925d3;})[_0xd3bf('0x2a')](respondWithResult(_0x45caa6,0xc9))[_0xd3bf('0x4e')](handleError(_0x45caa6,null));};exports['update']=function(_0x4636b6,_0x3e006a){if(_0x4636b6[_0xd3bf('0x58')]['id']){delete _0x4636b6[_0xd3bf('0x58')]['id'];}return db[_0xd3bf('0x49')]['find']({'where':{'id':_0x4636b6['params']['id']}})[_0xd3bf('0x2a')](handleEntityNotFound(_0x3e006a,null))[_0xd3bf('0x2a')](saveUpdates(_0x4636b6[_0xd3bf('0x58')],null))[_0xd3bf('0x2a')](respondWithResult(_0x3e006a,null))[_0xd3bf('0x4e')](handleError(_0x3e006a,null));};exports['destroy']=function(_0x38f272,_0x15ad31){return db[_0xd3bf('0x49')][_0xd3bf('0x55')]({'where':{'id':_0x38f272[_0xd3bf('0x50')]['id']}})[_0xd3bf('0x2a')](handleEntityNotFound(_0x15ad31,null))['then'](removeEntity(_0x15ad31,null))[_0xd3bf('0x4e')](handleError(_0x15ad31,null));};exports['describe']=function(_0x581ae8,_0x357430){return db[_0xd3bf('0x49')][_0xd3bf('0x59')]()['then'](respondWithResult(_0x357430,null))[_0xd3bf('0x4e')](handleError(_0x357430,null));};exports[_0xd3bf('0x5a')]=function(_0x66e4c1,_0xceb3be,_0x4b8422){var _0x4d38f5={'raw':!![],'where':{}},_0x1889b5={},_0x5bffa2;return db['WhatsappQueue'][_0xd3bf('0x5b')]({'where':{'id':_0x66e4c1[_0xd3bf('0x50')]['id']}})[_0xd3bf('0x2a')](handleEntityNotFound(_0xceb3be,null))[_0xd3bf('0x2a')](function(_0x119659){if(_0x119659){_0x5bffa2=_0x119659[_0xd3bf('0x2b')]({'plain':!![]});_0x1889b5[_0xd3bf('0x38')]=_[_0xd3bf('0x3a')](db['UserWhatsappQueue'][_0xd3bf('0x34')]);_0x1889b5['query']=_[_0xd3bf('0x3a')](_0x66e4c1[_0xd3bf('0x39')]);_0x1889b5['filters']=_['intersection'](_0x1889b5['model'],_0x1889b5[_0xd3bf('0x39')]);_0x4d38f5[_0xd3bf('0x3e')]=_[_0xd3bf('0x3c')](_0x1889b5[_0xd3bf('0x38')],qs[_0xd3bf('0x3d')](_0x66e4c1[_0xd3bf('0x39')][_0xd3bf('0x3d')]));_0x4d38f5[_0xd3bf('0x3e')]=_0x4d38f5[_0xd3bf('0x3e')]['length']?_0x4d38f5[_0xd3bf('0x3e')]:_0x1889b5[_0xd3bf('0x38')];if(!_0x66e4c1[_0xd3bf('0x39')][_0xd3bf('0x40')]('nolimit')){_0x4d38f5[_0xd3bf('0x21')]=qs[_0xd3bf('0x21')](_0x66e4c1[_0xd3bf('0x39')]['limit']);_0x4d38f5['offset']=qs[_0xd3bf('0x23')](_0x66e4c1[_0xd3bf('0x39')][_0xd3bf('0x23')]);}_0x4d38f5[_0xd3bf('0x42')]=qs[_0xd3bf('0x43')](_0x66e4c1[_0xd3bf('0x39')][_0xd3bf('0x43')]);_0x4d38f5['where']=qs[_0xd3bf('0x3b')](_['pick'](_0x66e4c1['query'],_0x1889b5[_0xd3bf('0x3b')]));_0x4d38f5[_0xd3bf('0x44')][_0xd3bf('0x5c')]=_0x119659['id'];if(_0x66e4c1[_0xd3bf('0x39')]['filter']){_0x4d38f5[_0xd3bf('0x44')]=_['merge'](_0x4d38f5[_0xd3bf('0x44')],{'$or':_[_0xd3bf('0x33')](_0x4d38f5[_0xd3bf('0x3e')],function(_0x2eb01e){var _0x575f10={};_0x575f10[_0x2eb01e]={'$like':'%'+_0x66e4c1['query'][_0xd3bf('0x5d')]+'%'};return _0x575f10;})});}_0x4d38f5=_[_0xd3bf('0x47')]({},_0x4d38f5,_0x66e4c1[_0xd3bf('0x48')]);return db[_0xd3bf('0x5e')]['findAll'](_0x4d38f5);}})[_0xd3bf('0x2a')](function(_0x3fd5b7){if(_0x3fd5b7){return db[_0xd3bf('0x5f')][_0xd3bf('0x60')]({'where':{'id':_[_0xd3bf('0x33')](_0x3fd5b7,'UserId'),'role':_0xd3bf('0x61')},'attributes':['id',_0xd3bf('0x31'),'whatsappPause',_0xd3bf('0x62'),_0xd3bf('0x63')]});}})[_0xd3bf('0x2a')](function(_0x14787d){if(_0x14787d){return{'count':_0x14787d[_0xd3bf('0x22')],'rows':_[_0xd3bf('0x33')](_0x14787d['rows'],function(_0x4b8a72){return{'membername':_0x4b8a72[_0xd3bf('0x31')],'UserId':_0x4b8a72['id'],'queue_name':_0x5bffa2[_0xd3bf('0x31')],'WhatsappQueueId':_0x5bffa2['id'],'interface':util[_0xd3bf('0x64')]('%s/%s',_0xd3bf('0x65'),_0x4b8a72[_0xd3bf('0x31')]),'penalty':0x0,'paused':_0x4b8a72[_0xd3bf('0x66')],'createdAt':_0x4b8a72[_0xd3bf('0x63')],'updatedAt':_0x4b8a72[_0xd3bf('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd3bf('0x2a')](respondWithFilteredResult(_0xceb3be,_0x4d38f5))[_0xd3bf('0x4e')](handleError(_0xceb3be,null));};exports[_0xd3bf('0x67')]=function(_0x56cb84,_0x2c6824,_0x29231b){var _0x5953df={};var _0x54e8af={};var _0x3fff0f;var _0x2b8b9a;return db[_0xd3bf('0x49')]['findOne']({'where':{'id':_0x56cb84[_0xd3bf('0x50')]['id']}})[_0xd3bf('0x2a')](handleEntityNotFound(_0x2c6824,null))[_0xd3bf('0x2a')](function(_0x286b90){if(_0x286b90){_0x3fff0f=_0x286b90;_0x54e8af[_0xd3bf('0x38')]=_['keys'](db[_0xd3bf('0x68')][_0xd3bf('0x34')]);_0x54e8af[_0xd3bf('0x39')]=_[_0xd3bf('0x3a')](_0x56cb84[_0xd3bf('0x39')]);_0x54e8af[_0xd3bf('0x3b')]=_[_0xd3bf('0x3c')](_0x54e8af['model'],_0x54e8af[_0xd3bf('0x39')]);_0x5953df[_0xd3bf('0x3e')]=_[_0xd3bf('0x3c')](_0x54e8af[_0xd3bf('0x38')],qs['fields'](_0x56cb84[_0xd3bf('0x39')][_0xd3bf('0x3d')]));_0x5953df['attributes']=_0x5953df[_0xd3bf('0x3e')][_0xd3bf('0x3f')]?_0x5953df[_0xd3bf('0x3e')]:_0x54e8af['model'];_0x5953df[_0xd3bf('0x42')]=qs[_0xd3bf('0x43')](_0x56cb84[_0xd3bf('0x39')][_0xd3bf('0x43')]);_0x5953df[_0xd3bf('0x44')]=qs['filters'](_[_0xd3bf('0x45')](_0x56cb84[_0xd3bf('0x39')],_0x54e8af['filters']));if(_0x56cb84['query'][_0xd3bf('0x5d')]){_0x5953df['where']=_[_0xd3bf('0x47')](_0x5953df[_0xd3bf('0x44')],{'$or':_['map'](_0x5953df[_0xd3bf('0x3e')],function(_0x2d412b){var _0x4f095f={};_0x4f095f[_0x2d412b]={'$like':'%'+_0x56cb84['query'][_0xd3bf('0x5d')]+'%'};return _0x4f095f;})});}_0x5953df=_[_0xd3bf('0x47')]({},_0x5953df,_0x56cb84[_0xd3bf('0x48')]);return _0x3fff0f[_0xd3bf('0x67')](_0x5953df);}})[_0xd3bf('0x2a')](function(_0x9f049f){if(_0x9f049f){_0x2b8b9a=_0x9f049f[_0xd3bf('0x3f')];if(!_0x56cb84[_0xd3bf('0x39')]['hasOwnProperty'](_0xd3bf('0x41'))){_0x5953df[_0xd3bf('0x21')]=qs[_0xd3bf('0x21')](_0x56cb84[_0xd3bf('0x39')][_0xd3bf('0x21')]);_0x5953df['offset']=qs['offset'](_0x56cb84['query'][_0xd3bf('0x23')]);}return _0x3fff0f[_0xd3bf('0x67')](_0x5953df);}})['then'](function(_0x3ee871){if(_0x3ee871){return _0x3ee871?{'count':_0x2b8b9a,'rows':_0x3ee871}:null;}})[_0xd3bf('0x2a')](respondWithResult(_0x2c6824,null))['catch'](handleError(_0x2c6824,null));};exports[_0xd3bf('0x69')]=function(_0x16e476,_0x3ecc38,_0x2f1be1){var _0x48b7fa=_0x16e476[_0xd3bf('0x58')][_0xd3bf('0x6a')];return db[_0xd3bf('0x68')][_0xd3bf('0x4c')]({'where':{'id':_0x48b7fa},'attributes':['id'],'include':[{'model':db[_0xd3bf('0x5f')],'as':_0xd3bf('0x6b'),'attributes':['id',_0xd3bf('0x31'),_0xd3bf('0x6c'),_0xd3bf('0x6d'),_0xd3bf('0x6e')],'raw':!![]}]})[_0xd3bf('0x2a')](function(_0x2c3e38){if(_0x2c3e38){var _0x440808=_['flatMap'](_0x2c3e38,function(_0x304e98){var _0x5ee665=_0x304e98[_0xd3bf('0x2b')]({'plain':!![]});return _0x5ee665[_0xd3bf('0x6b')];});return db[_0xd3bf('0x49')][_0xd3bf('0x55')]({'where':{'id':_0x16e476['params']['id']}})[_0xd3bf('0x2a')](function(_0x25b8e5){return db[_0xd3bf('0x6f')]['transaction'](function(_0x22b600){return _0x25b8e5[_0xd3bf('0x69')](_0x48b7fa,{'transaction':_0x22b600})[_0xd3bf('0x2a')](function(){return BPromise[_0xd3bf('0x70')](_0x440808,function(_0x186bc0){return db[_0xd3bf('0x5e')][_0xd3bf('0x71')]({'where':{'UserId':_0x186bc0['id'],'WhatsappQueueId':_0x16e476[_0xd3bf('0x50')]['id']},'transaction':_0x22b600});});})['then'](function(){_0x440808['forEach'](function(_0x229395){socket[_0xd3bf('0x72')](_0xd3bf('0x73'),{'UserId':_0x229395['id'],'WhatsappQueueId':_0x25b8e5['id']});});});});});}})[_0xd3bf('0x2a')](respondWithStatusCode(_0x3ecc38,null))[_0xd3bf('0x4e')](handleError(_0x3ecc38,null));};exports[_0xd3bf('0x74')]=function(_0x98c241,_0x4ef75b,_0x31096b){return db[_0xd3bf('0x68')][_0xd3bf('0x4c')]({'where':{'id':_0x98c241[_0xd3bf('0x39')][_0xd3bf('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xd3bf('0x5f')],'as':_0xd3bf('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xd3bf('0x2a')](handleEntityNotFound(_0x4ef75b,null))[_0xd3bf('0x2a')](function(_0x30b094){var _0x535680=_[_0xd3bf('0x33')](_0x30b094,'id');var _0x208def=[];var _0x34dc37=[];var _0x541a7c=squel[_0xd3bf('0x75')]();_0x541a7c[_0xd3bf('0x76')](_0xd3bf('0x77'))[_0xd3bf('0x78')](_0xd3bf('0x79'),'tq')[_0xd3bf('0x7a')](_0xd3bf('0x7b'),'ut',_0xd3bf('0x7c'))[_0xd3bf('0x44')]('WhatsappQueueId\x20=\x20?',_0x98c241[_0xd3bf('0x50')]['id']);for(var _0x59eb74=0x0;_0x59eb74<_0x30b094['length'];_0x59eb74+=0x1){let _0x5235e7=_0x30b094[_0x59eb74];for(var _0x174b37=0x0;_0x174b37<_0x5235e7[_0xd3bf('0x6b')][_0xd3bf('0x3f')];_0x174b37+=0x1){let _0x4c518c=_0x5235e7[_0xd3bf('0x6b')][_0x174b37];var _0x169f5e=_0x541a7c[_0xd3bf('0x7d')]();_0x169f5e['where'](_0xd3bf('0x7e'),_0x4c518c['id']);_0x34dc37[_0xd3bf('0x7f')](db['sequelize'][_0xd3bf('0x39')](_0x169f5e[_0xd3bf('0x80')](),{'type':db['sequelize']['QueryTypes'][_0xd3bf('0x81')]})[_0xd3bf('0x2a')](function(_0x5af995){if(_0x5af995['length']===0x1){return _0x4c518c['id'];}else{var _0x3984b7=_[_0xd3bf('0x82')](_[_0xd3bf('0x33')](_0x5af995,_0xd3bf('0x83')),function(_0x41592a){return _['includes'](_0x535680,_0x41592a);});if(_0x3984b7){return _0x4c518c['id'];}}}));}}return BPromise['all'](_0x34dc37)[_0xd3bf('0x2a')](function(_0x3ca661){_0x208def=_(_0x208def)['union'](_0x3ca661)[_0xd3bf('0x84')]()[_0xd3bf('0x85')]();return db[_0xd3bf('0x49')][_0xd3bf('0x55')]({'where':{'id':_0x98c241[_0xd3bf('0x50')]['id']}})['then'](function(_0x1cc309){return db[_0xd3bf('0x6f')][_0xd3bf('0x86')](function(_0x172ee9){return _0x1cc309[_0xd3bf('0x74')](_0x98c241[_0xd3bf('0x39')][_0xd3bf('0x6a')],{'transaction':_0x172ee9})[_0xd3bf('0x2a')](function(){if(!_[_0xd3bf('0x87')](_0x208def)){return _0x1cc309[_0xd3bf('0x88')](_0x208def,{'transaction':_0x172ee9});}})[_0xd3bf('0x2a')](function(){_0x208def[_0xd3bf('0x89')](function(_0x4c144f){socket[_0xd3bf('0x72')](_0xd3bf('0x8a'),{'UserId':_0x4c144f,'WhatsappQueueId':_0x1cc309['id']});});});});});});})['then'](respondWithStatusCode(_0x4ef75b,null))[_0xd3bf('0x4e')](handleError(_0x4ef75b,null));};exports[_0xd3bf('0x8b')]=function(_0x15f4e9,_0x2b60db,_0x31c7d8){return db[_0xd3bf('0x49')]['find']({'where':{'id':_0x15f4e9['params']['id']}})['then'](handleEntityNotFound(_0x2b60db,null))[_0xd3bf('0x2a')](function(_0x339972){if(_0x339972){return _0x339972[_0xd3bf('0x8b')](_0x15f4e9[_0xd3bf('0x58')]['ids'],_[_0xd3bf('0x8c')](_0x15f4e9[_0xd3bf('0x58')],[_0xd3bf('0x6a'),'id'])||{})[_0xd3bf('0x8d')](function(_0x374e36){for(var _0x538c16=0x0;_0x538c16<_0x15f4e9['body'][_0xd3bf('0x6a')][_0xd3bf('0x3f')];_0x538c16+=0x1){socket['emit'](_0xd3bf('0x73'),{'UserId':Number(_0x15f4e9[_0xd3bf('0x58')]['ids'][_0x538c16]),'WhatsappQueueId':Number(_0x15f4e9['params']['id'])});}return _0x374e36;});}})[_0xd3bf('0x2a')](respondWithResult(_0x2b60db,null))['catch'](handleError(_0x2b60db,null));};exports[_0xd3bf('0x88')]=function(_0x41f767,_0x20968c,_0x1411c3){return db['WhatsappQueue'][_0xd3bf('0x55')]({'where':{'id':_0x41f767[_0xd3bf('0x50')]['id']}})['then'](handleEntityNotFound(_0x20968c,null))[_0xd3bf('0x2a')](function(_0x4f6204){if(_0x4f6204){return _0x4f6204['removeAgents'](_0x41f767[_0xd3bf('0x39')][_0xd3bf('0x6a')])[_0xd3bf('0x2a')](function(){if(_[_0xd3bf('0x8e')](_0x41f767[_0xd3bf('0x39')]['ids'])){for(var _0x18822b=0x0;_0x18822b<_0x41f767[_0xd3bf('0x39')][_0xd3bf('0x6a')]['length'];_0x18822b+=0x1){socket['emit'](_0xd3bf('0x8a'),{'UserId':Number(_0x41f767['query'][_0xd3bf('0x6a')][_0x18822b]),'WhatsappQueueId':Number(_0x41f767[_0xd3bf('0x50')]['id'])});}}else{socket['emit'](_0xd3bf('0x8a'),{'UserId':Number(_0x41f767[_0xd3bf('0x39')][_0xd3bf('0x6a')]),'WhatsappQueueId':Number(_0x41f767[_0xd3bf('0x50')]['id'])});}});}})[_0xd3bf('0x2a')](respondWithStatusCode(_0x20968c,null))[_0xd3bf('0x4e')](handleError(_0x20968c,null));};exports[_0xd3bf('0x8f')]=function(_0x627c07,_0x4916da,_0x1b5c63){var _0x351b57={};var _0x3314bb={};var _0x4286a3;var _0x204455;return db[_0xd3bf('0x49')][_0xd3bf('0x5b')]({'where':{'id':_0x627c07['params']['id']}})['then'](handleEntityNotFound(_0x4916da,null))[_0xd3bf('0x2a')](function(_0x5a19a6){if(_0x5a19a6){_0x4286a3=_0x5a19a6;_0x3314bb[_0xd3bf('0x38')]=_[_0xd3bf('0x3a')](db['User'][_0xd3bf('0x34')]);_0x3314bb['query']=_[_0xd3bf('0x3a')](_0x627c07[_0xd3bf('0x39')]);_0x3314bb['filters']=_[_0xd3bf('0x3c')](_0x3314bb[_0xd3bf('0x38')],_0x3314bb[_0xd3bf('0x39')]);_0x351b57[_0xd3bf('0x3e')]=_['intersection'](_0x3314bb[_0xd3bf('0x38')],qs['fields'](_0x627c07[_0xd3bf('0x39')][_0xd3bf('0x3d')]));_0x351b57['attributes']=_0x351b57['attributes']['length']?_0x351b57['attributes']:_0x3314bb[_0xd3bf('0x38')];_0x351b57[_0xd3bf('0x42')]=qs[_0xd3bf('0x43')](_0x627c07[_0xd3bf('0x39')]['sort']);_0x351b57[_0xd3bf('0x44')]=qs['filters'](_[_0xd3bf('0x45')](_0x627c07[_0xd3bf('0x39')],_0x3314bb['filters']));if(_0x627c07[_0xd3bf('0x39')]['filter']){_0x351b57[_0xd3bf('0x44')]=_[_0xd3bf('0x47')](_0x351b57[_0xd3bf('0x44')],{'$or':_[_0xd3bf('0x33')](_0x351b57['attributes'],function(_0x5b5774){var _0x4d6734={};_0x4d6734[_0x5b5774]={'$like':'%'+_0x627c07[_0xd3bf('0x39')]['filter']+'%'};return _0x4d6734;})});}_0x351b57=_[_0xd3bf('0x47')]({},_0x351b57,_0x627c07[_0xd3bf('0x48')]);return _0x4286a3[_0xd3bf('0x8f')](_0x351b57);}})['then'](function(_0x3727b2){if(_0x3727b2){_0x204455=_0x3727b2[_0xd3bf('0x3f')];if(!_0x627c07[_0xd3bf('0x39')][_0xd3bf('0x40')](_0xd3bf('0x41'))){_0x351b57[_0xd3bf('0x21')]=qs[_0xd3bf('0x21')](_0x627c07[_0xd3bf('0x39')][_0xd3bf('0x21')]);_0x351b57[_0xd3bf('0x23')]=qs[_0xd3bf('0x23')](_0x627c07[_0xd3bf('0x39')][_0xd3bf('0x23')]);}return _0x4286a3['getAgents'](_0x351b57);}})['then'](function(_0x3512bb){if(_0x3512bb){return _0x3512bb?{'count':_0x204455,'rows':_0x3512bb}:null;}})[_0xd3bf('0x2a')](respondWithResult(_0x4916da,null))['catch'](handleError(_0x4916da,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 15a8eff..ae7c94d 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 _0xf6a5=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x8a1a42,_0x2b8a01){var _0x4dace4=function(_0x2ce9e5){while(--_0x2ce9e5){_0x8a1a42['push'](_0x8a1a42['shift']());}};_0x4dace4(++_0x2b8a01);}(_0xf6a5,0x1c2));var _0x5f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5f6a('0x0'));var WhatsappQueue=require(_0x5f6a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5f6a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5f6a('0x3'),'afterDestroy':_0x5f6a('0x4')};function emitEvent(_0x55f0ae){return function(_0x3d1a16,_0x3aa9f2,_0x2296c6){WhatsappQueueEvents[_0x5f6a('0x5')](_0x55f0ae+':'+_0x3d1a16['id'],_0x3d1a16);WhatsappQueueEvents[_0x5f6a('0x5')](_0x55f0ae,_0x3d1a16);_0x2296c6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x5f6a('0x6')](e,emitEvent(event));}}module[_0x5f6a('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xb0b5=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb0b5,0x177));var _0x5b0b=function(_0x346f5a,_0x33de62){_0x346f5a=_0x346f5a-0x0;var _0x2c1254=_0xb0b5[_0x346f5a];return _0x2c1254;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x5b0b('0x0'))['db'][_0x5b0b('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5b0b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b0b('0x3'),'afterDestroy':_0x5b0b('0x4')};function emitEvent(_0x57d597){return function(_0xcf6e28,_0x54cd80,_0x1c2cb7){WhatsappQueueEvents[_0x5b0b('0x5')](_0x57d597+':'+_0xcf6e28['id'],_0xcf6e28);WhatsappQueueEvents['emit'](_0x57d597,_0xcf6e28);_0x1c2cb7(null);};}for(var e in events){if(events[_0x5b0b('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x5b0b('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 2a8ac8a..43c03b4 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 _0xbfc3=['define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x52298b,_0x595ae7){var _0x2e4c4a=function(_0x9c1742){while(--_0x9c1742){_0x52298b['push'](_0x52298b['shift']());}};_0x2e4c4a(++_0x595ae7);}(_0xbfc3,0xe0));var _0x3bfc=function(_0x2d0032,_0x2c7e21){_0x2d0032=_0x2d0032-0x0;var _0x5eb642=_0xbfc3[_0x2d0032];return _0x5eb642;};'use strict';var _=require(_0x3bfc('0x0'));var util=require(_0x3bfc('0x1'));var logger=require(_0x3bfc('0x2'))(_0x3bfc('0x3'));var moment=require(_0x3bfc('0x4'));var BPromise=require(_0x3bfc('0x5'));var rp=require(_0x3bfc('0x6'));var fs=require('fs');var path=require(_0x3bfc('0x7'));var rimraf=require(_0x3bfc('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0x3bfc('0x9')]=function(_0x3da3e2,_0x886eeb){return _0x3da3e2[_0x3bfc('0xa')](_0x3bfc('0xb'),attributes,{'tableName':_0x3bfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa347=['bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','lodash','util','api','moment'];(function(_0x1582b6,_0x223ad6){var _0x3ddb37=function(_0x4ac245){while(--_0x4ac245){_0x1582b6['push'](_0x1582b6['shift']());}};_0x3ddb37(++_0x223ad6);}(_0xa347,0xc2));var _0x7a34=function(_0x59e7e0,_0x3ec148){_0x59e7e0=_0x59e7e0-0x0;var _0x26b058=_0xa347[_0x59e7e0];return _0x26b058;};'use strict';var _=require(_0x7a34('0x0'));var util=require(_0x7a34('0x1'));var logger=require('../../config/logger')(_0x7a34('0x2'));var moment=require(_0x7a34('0x3'));var BPromise=require(_0x7a34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a34('0x5'));var rimraf=require(_0x7a34('0x6'));var config=require(_0x7a34('0x7'));var attributes=require(_0x7a34('0x8'));module[_0x7a34('0x9')]=function(_0x9e2849,_0x381cf4){return _0x9e2849['define'](_0x7a34('0xa'),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 0dcc3bd..0e08249 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 _0x4f27=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','attributes','limit','include','map','model','then','GetWhatsappQueue','debug','ShowWhatsappQueue','WhatsappQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request'];(function(_0x2427b5,_0x22544e){var _0x498a4d=function(_0x56a8a2){while(--_0x56a8a2){_0x2427b5['push'](_0x2427b5['shift']());}};_0x498a4d(++_0x22544e);}(_0x4f27,0x1c7));var _0x74f2=function(_0x356fa3,_0x1e6c2b){_0x356fa3=_0x356fa3-0x0;var _0x257ae7=_0x4f27[_0x356fa3];return _0x257ae7;};'use strict';var _=require(_0x74f2('0x0'));var util=require(_0x74f2('0x1'));var moment=require(_0x74f2('0x2'));var BPromise=require(_0x74f2('0x3'));var rs=require(_0x74f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74f2('0x5'))['db'];var utils=require(_0x74f2('0x6'));var logger=require(_0x74f2('0x7'))(_0x74f2('0x8'));var config=require(_0x74f2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x74f2('0xa')][_0x74f2('0xb')]({'port':0x232a});config[_0x74f2('0xc')]=_[_0x74f2('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x74f2('0xe'))(new Redis(config['redis']));require(_0x74f2('0xf'))[_0x74f2('0x10')](socket);function respondWithRpcPromise(_0x929887,_0x461119,_0x405460){return new BPromise(function(_0x5c217d,_0x39906f){return client[_0x74f2('0x11')](_0x929887,_0x405460)['then'](function(_0x320b7f){logger[_0x74f2('0x12')](_0x74f2('0x13'),_0x461119,_0x74f2('0x14'));logger['debug'](_0x74f2('0x15'),_0x461119,'request\x20sent',JSON[_0x74f2('0x16')](_0x320b7f));if(_0x320b7f[_0x74f2('0x17')]){if(_0x320b7f[_0x74f2('0x17')][_0x74f2('0x18')]===0x1f4){logger[_0x74f2('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x461119,_0x320b7f['error'][_0x74f2('0x19')]);return _0x39906f(_0x320b7f[_0x74f2('0x17')][_0x74f2('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x461119,_0x320b7f[_0x74f2('0x17')][_0x74f2('0x19')]);return _0x5c217d(_0x320b7f[_0x74f2('0x17')][_0x74f2('0x19')]);}else{logger[_0x74f2('0x12')](_0x74f2('0x13'),_0x461119,_0x74f2('0x14'));_0x5c217d(_0x320b7f[_0x74f2('0x1a')][_0x74f2('0x19')]);}})[_0x74f2('0x1b')](function(_0x12304d){logger[_0x74f2('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x461119,_0x12304d);_0x39906f(_0x12304d);});});}exports['GetWhatsappQueue']=function(_0x70739f){var _0x5caf96=this;return new Promise(function(_0x316693,_0x54b647){return db['WhatsappQueue'][_0x74f2('0x1c')]({'raw':_0x70739f['options']?_0x70739f['options']['raw']===undefined?!![]:![]:!![],'where':_0x70739f[_0x74f2('0x1d')]?_0x70739f[_0x74f2('0x1d')]['where']||null:null,'attributes':_0x70739f[_0x74f2('0x1d')]?_0x70739f[_0x74f2('0x1d')][_0x74f2('0x1e')]||null:null,'limit':_0x70739f[_0x74f2('0x1d')]?_0x70739f['options'][_0x74f2('0x1f')]||null:null,'include':_0x70739f[_0x74f2('0x1d')]?_0x70739f[_0x74f2('0x1d')][_0x74f2('0x20')]?_[_0x74f2('0x21')](_0x70739f[_0x74f2('0x1d')][_0x74f2('0x20')],function(_0x56b8d7){return{'model':db[_0x56b8d7[_0x74f2('0x22')]],'as':_0x56b8d7['as'],'attributes':_0x56b8d7[_0x74f2('0x1e')],'include':_0x56b8d7[_0x74f2('0x20')]?_['map'](_0x56b8d7['include'],function(_0x188e16){return{'model':db[_0x188e16[_0x74f2('0x22')]],'as':_0x188e16['as'],'attributes':_0x188e16[_0x74f2('0x1e')],'include':_0x188e16[_0x74f2('0x20')]?_[_0x74f2('0x21')](_0x188e16[_0x74f2('0x20')],function(_0xd54fcd){return{'model':db[_0xd54fcd[_0x74f2('0x22')]],'as':_0xd54fcd['as'],'attributes':_0xd54fcd['attributes']};}):[]};}):[]};}):[]:[]})[_0x74f2('0x23')](function(_0x240dd8){logger[_0x74f2('0x12')](_0x74f2('0x24'),_0x70739f);logger[_0x74f2('0x25')](_0x74f2('0x24'),_0x70739f,JSON[_0x74f2('0x16')](_0x240dd8));_0x316693(_0x240dd8);})['catch'](function(_0xafd6fa){logger[_0x74f2('0x17')](_0x74f2('0x24'),_0xafd6fa[_0x74f2('0x19')],_0x70739f);_0x54b647(_0x5caf96['error'](0x1f4,_0xafd6fa[_0x74f2('0x19')]));});});};exports[_0x74f2('0x26')]=function(_0xb6315b){var _0x245d8a=this;return new Promise(function(_0x45f5fe,_0x2c29db){return db[_0x74f2('0x27')][_0x74f2('0x28')]({'raw':_0xb6315b[_0x74f2('0x1d')]?_0xb6315b['options'][_0x74f2('0x29')]===undefined?!![]:![]:!![],'where':_0xb6315b[_0x74f2('0x1d')]?_0xb6315b[_0x74f2('0x1d')][_0x74f2('0x2a')]||null:null,'attributes':_0xb6315b[_0x74f2('0x1d')]?_0xb6315b['options'][_0x74f2('0x1e')]||null:null,'include':_0xb6315b['options']?_0xb6315b[_0x74f2('0x1d')][_0x74f2('0x20')]?_['map'](_0xb6315b[_0x74f2('0x1d')][_0x74f2('0x20')],function(_0x4fc76c){return{'model':db[_0x4fc76c[_0x74f2('0x22')]],'as':_0x4fc76c['as'],'attributes':_0x4fc76c[_0x74f2('0x1e')],'include':_0x4fc76c['include']?_[_0x74f2('0x21')](_0x4fc76c[_0x74f2('0x20')],function(_0x5a3cbf){return{'model':db[_0x5a3cbf[_0x74f2('0x22')]],'as':_0x5a3cbf['as'],'attributes':_0x5a3cbf[_0x74f2('0x1e')],'include':_0x5a3cbf[_0x74f2('0x20')]?_[_0x74f2('0x21')](_0x5a3cbf[_0x74f2('0x20')],function(_0x19be95){return{'model':db[_0x19be95[_0x74f2('0x22')]],'as':_0x19be95['as'],'attributes':_0x19be95[_0x74f2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59a913){logger['info'](_0x74f2('0x26'),_0xb6315b);logger[_0x74f2('0x25')]('ShowWhatsappQueue',_0xb6315b,JSON['stringify'](_0x59a913));_0x45f5fe(_0x59a913);})['catch'](function(_0x33d161){logger[_0x74f2('0x17')](_0x74f2('0x26'),_0x33d161[_0x74f2('0x19')],_0xb6315b);_0x2c29db(_0x245d8a[_0x74f2('0x17')](0x1f4,_0x33d161[_0x74f2('0x19')]));});});}; \ No newline at end of file +var _0xa864=['catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','stringify','ShowWhatsappQueue','WhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x1a2929,_0x7fa0fd){var _0x1be4d0=function(_0x1153c4){while(--_0x1153c4){_0x1a2929['push'](_0x1a2929['shift']());}};_0x1be4d0(++_0x7fa0fd);}(_0xa864,0x118));var _0x4a86=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xa864[_0x1db831];return _0x39ba56;};'use strict';var _=require(_0x4a86('0x0'));var util=require('util');var moment=require(_0x4a86('0x1'));var BPromise=require(_0x4a86('0x2'));var rs=require(_0x4a86('0x3'));var fs=require('fs');var Redis=require(_0x4a86('0x4'));var db=require(_0x4a86('0x5'))['db'];var utils=require(_0x4a86('0x6'));var logger=require(_0x4a86('0x7'))(_0x4a86('0x8'));var config=require(_0x4a86('0x9'));var jayson=require(_0x4a86('0xa'));var client=jayson[_0x4a86('0xb')][_0x4a86('0xc')]({'port':0x232a});config[_0x4a86('0xd')]=_[_0x4a86('0xe')](config[_0x4a86('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a86('0xf'))(new Redis(config[_0x4a86('0xd')]));require(_0x4a86('0x10'))[_0x4a86('0x11')](socket);function respondWithRpcPromise(_0x4f56dc,_0x130e57,_0x133a82){return new BPromise(function(_0x11f097,_0x27cf4f){return client[_0x4a86('0x12')](_0x4f56dc,_0x133a82)[_0x4a86('0x13')](function(_0x4805ce){logger['info'](_0x4a86('0x14'),_0x130e57,_0x4a86('0x15'));logger[_0x4a86('0x16')](_0x4a86('0x17'),_0x130e57,_0x4a86('0x15'),JSON['stringify'](_0x4805ce));if(_0x4805ce[_0x4a86('0x18')]){if(_0x4805ce['error'][_0x4a86('0x19')]===0x1f4){logger[_0x4a86('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x130e57,_0x4805ce[_0x4a86('0x18')][_0x4a86('0x1a')]);return _0x27cf4f(_0x4805ce[_0x4a86('0x18')][_0x4a86('0x1a')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x130e57,_0x4805ce['error'][_0x4a86('0x1a')]);return _0x11f097(_0x4805ce[_0x4a86('0x18')][_0x4a86('0x1a')]);}else{logger['info'](_0x4a86('0x14'),_0x130e57,'request\x20sent');_0x11f097(_0x4805ce[_0x4a86('0x1b')][_0x4a86('0x1a')]);}})[_0x4a86('0x1c')](function(_0x3bb725){logger[_0x4a86('0x18')](_0x4a86('0x14'),_0x130e57,_0x3bb725);_0x27cf4f(_0x3bb725);});});}exports[_0x4a86('0x1d')]=function(_0x28594e){var _0x11ff50=this;return new Promise(function(_0x55ed40,_0x57cadd){return db['WhatsappQueue'][_0x4a86('0x1e')]({'raw':_0x28594e['options']?_0x28594e[_0x4a86('0x1f')][_0x4a86('0x20')]===undefined?!![]:![]:!![],'where':_0x28594e[_0x4a86('0x1f')]?_0x28594e[_0x4a86('0x1f')][_0x4a86('0x21')]||null:null,'attributes':_0x28594e[_0x4a86('0x1f')]?_0x28594e[_0x4a86('0x1f')][_0x4a86('0x22')]||null:null,'limit':_0x28594e[_0x4a86('0x1f')]?_0x28594e[_0x4a86('0x1f')][_0x4a86('0x23')]||null:null,'include':_0x28594e[_0x4a86('0x1f')]?_0x28594e[_0x4a86('0x1f')][_0x4a86('0x24')]?_['map'](_0x28594e[_0x4a86('0x1f')][_0x4a86('0x24')],function(_0x3ad134){return{'model':db[_0x3ad134[_0x4a86('0x25')]],'as':_0x3ad134['as'],'attributes':_0x3ad134[_0x4a86('0x22')],'include':_0x3ad134[_0x4a86('0x24')]?_['map'](_0x3ad134[_0x4a86('0x24')],function(_0x2a45aa){return{'model':db[_0x2a45aa['model']],'as':_0x2a45aa['as'],'attributes':_0x2a45aa[_0x4a86('0x22')],'include':_0x2a45aa[_0x4a86('0x24')]?_[_0x4a86('0x26')](_0x2a45aa[_0x4a86('0x24')],function(_0x14dfe9){return{'model':db[_0x14dfe9[_0x4a86('0x25')]],'as':_0x14dfe9['as'],'attributes':_0x14dfe9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a86('0x13')](function(_0x5877e7){logger[_0x4a86('0x27')](_0x4a86('0x1d'),_0x28594e);logger['debug'](_0x4a86('0x1d'),_0x28594e,JSON[_0x4a86('0x28')](_0x5877e7));_0x55ed40(_0x5877e7);})[_0x4a86('0x1c')](function(_0x199efe){logger[_0x4a86('0x18')](_0x4a86('0x1d'),_0x199efe[_0x4a86('0x1a')],_0x28594e);_0x57cadd(_0x11ff50[_0x4a86('0x18')](0x1f4,_0x199efe['message']));});});};exports[_0x4a86('0x29')]=function(_0x13ac85){var _0x460d2c=this;return new Promise(function(_0x2ba919,_0x41fc7a){return db[_0x4a86('0x2a')][_0x4a86('0x2b')]({'raw':_0x13ac85[_0x4a86('0x1f')]?_0x13ac85['options'][_0x4a86('0x20')]===undefined?!![]:![]:!![],'where':_0x13ac85[_0x4a86('0x1f')]?_0x13ac85[_0x4a86('0x1f')][_0x4a86('0x21')]||null:null,'attributes':_0x13ac85['options']?_0x13ac85[_0x4a86('0x1f')][_0x4a86('0x22')]||null:null,'include':_0x13ac85['options']?_0x13ac85[_0x4a86('0x1f')][_0x4a86('0x24')]?_[_0x4a86('0x26')](_0x13ac85[_0x4a86('0x1f')][_0x4a86('0x24')],function(_0x2498e0){return{'model':db[_0x2498e0[_0x4a86('0x25')]],'as':_0x2498e0['as'],'attributes':_0x2498e0[_0x4a86('0x22')],'include':_0x2498e0[_0x4a86('0x24')]?_[_0x4a86('0x26')](_0x2498e0[_0x4a86('0x24')],function(_0x5550ec){return{'model':db[_0x5550ec[_0x4a86('0x25')]],'as':_0x5550ec['as'],'attributes':_0x5550ec['attributes'],'include':_0x5550ec[_0x4a86('0x24')]?_[_0x4a86('0x26')](_0x5550ec[_0x4a86('0x24')],function(_0x3f7f33){return{'model':db[_0x3f7f33[_0x4a86('0x25')]],'as':_0x3f7f33['as'],'attributes':_0x3f7f33[_0x4a86('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4a86('0x13')](function(_0x5af858){logger[_0x4a86('0x27')](_0x4a86('0x29'),_0x13ac85);logger[_0x4a86('0x16')]('ShowWhatsappQueue',_0x13ac85,JSON[_0x4a86('0x28')](_0x5af858));_0x2ba919(_0x5af858);})[_0x4a86('0x1c')](function(_0x516e35){logger['error'](_0x4a86('0x29'),_0x516e35[_0x4a86('0x1a')],_0x13ac85);_0x41fc7a(_0x460d2c[_0x4a86('0x18')](0x1f4,_0x516e35[_0x4a86('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index b25dc28..aeb4849 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 _0x95f4=['save','remove','update','emit','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x95f4,0x195));var _0x495f=function(_0x500459,_0x43c66e){_0x500459=_0x500459-0x0;var _0x1c68f7=_0x95f4[_0x500459];return _0x1c68f7;};'use strict';var WhatsappQueueEvents=require(_0x495f('0x0'));var events=[_0x495f('0x1'),_0x495f('0x2'),_0x495f('0x3')];function createListener(_0x921992,_0x15c97c){return function(_0x518b5d){_0x15c97c[_0x495f('0x4')](_0x921992,_0x518b5d);};}function removeListener(_0x38fd04,_0x159357){return function(){WhatsappQueueEvents['removeListener'](_0x38fd04,_0x159357);};}exports[_0x495f('0x5')]=function(_0x259dff){for(var _0x3ce24c=0x0,_0xe74e46=events['length'];_0x3ce24c<_0xe74e46;_0x3ce24c++){var _0x237897=events[_0x3ce24c];var _0x3f2ae4=createListener(_0x495f('0x6')+_0x237897,_0x259dff);WhatsappQueueEvents['on'](_0x237897,_0x3f2ae4);}}; \ No newline at end of file +var _0xb344=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x150c8d,_0x4efab9){var _0x9e7d3e=function(_0x44f529){while(--_0x44f529){_0x150c8d['push'](_0x150c8d['shift']());}};_0x9e7d3e(++_0x4efab9);}(_0xb344,0x196));var _0x4b34=function(_0x2b395a,_0x35db69){_0x2b395a=_0x2b395a-0x0;var _0x1beba0=_0xb344[_0x2b395a];return _0x1beba0;};'use strict';var WhatsappQueueEvents=require(_0x4b34('0x0'));var events=[_0x4b34('0x1'),'remove',_0x4b34('0x2')];function createListener(_0x717393,_0xdc18a9){return function(_0x491bbb){_0xdc18a9[_0x4b34('0x3')](_0x717393,_0x491bbb);};}function removeListener(_0x28a535,_0x2ab371){return function(){WhatsappQueueEvents[_0x4b34('0x4')](_0x28a535,_0x2ab371);};}exports[_0x4b34('0x5')]=function(_0x5507d7){for(var _0x55aa09=0x0,_0x59919c=events[_0x4b34('0x6')];_0x55aa09<_0x59919c;_0x55aa09++){var _0x267d11=events[_0x55aa09];var _0xd1ebb4=createListener(_0x4b34('0x7')+_0x267d11,_0x5507d7);WhatsappQueueEvents['on'](_0x267d11,_0xd1ebb4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 64adf4d..0f85dfc 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 _0xeb97=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post'];(function(_0x427bc1,_0x46698c){var _0x293edc=function(_0x86f7f7){while(--_0x86f7f7){_0x427bc1['push'](_0x427bc1['shift']());}};_0x293edc(++_0x46698c);}(_0xeb97,0x97));var _0x7eb9=function(_0x284e59,_0x2ea31c){_0x284e59=_0x284e59-0x0;var _0x246373=_0xeb97[_0x284e59];return _0x246373;};'use strict';var multer=require(_0x7eb9('0x0'));var util=require(_0x7eb9('0x1'));var path=require(_0x7eb9('0x2'));var timeout=require(_0x7eb9('0x3'));var express=require(_0x7eb9('0x4'));var router=express[_0x7eb9('0x5')]();var fs_extra=require(_0x7eb9('0x6'));var auth=require(_0x7eb9('0x7'));var interaction=require(_0x7eb9('0x8'));var config=require(_0x7eb9('0x9'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x7eb9('0xa')](),controller[_0x7eb9('0xb')]);router[_0x7eb9('0xc')]('/describe',auth[_0x7eb9('0xa')](),controller[_0x7eb9('0xd')]);router[_0x7eb9('0xc')](_0x7eb9('0xe'),auth['isAuthenticated'](),controller[_0x7eb9('0xf')]);router[_0x7eb9('0x10')]('/',auth[_0x7eb9('0xa')](),controller[_0x7eb9('0x11')]);router['put']('/:id',auth[_0x7eb9('0xa')](),controller['update']);router[_0x7eb9('0x12')](_0x7eb9('0xe'),auth[_0x7eb9('0xa')](),controller[_0x7eb9('0x13')]);module[_0x7eb9('0x14')]=router; \ No newline at end of file +var _0x0c14=['./whatsappQueueReport.controller','index','get','isAuthenticated','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x50f18b,_0x1d9950){var _0xc8895b=function(_0x4b823c){while(--_0x4b823c){_0x50f18b['push'](_0x50f18b['shift']());}};_0xc8895b(++_0x1d9950);}(_0x0c14,0x183));var _0x40c1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0c14[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x40c1('0x0'));var util=require(_0x40c1('0x1'));var path=require(_0x40c1('0x2'));var timeout=require(_0x40c1('0x3'));var express=require(_0x40c1('0x4'));var router=express[_0x40c1('0x5')]();var fs_extra=require(_0x40c1('0x6'));var auth=require(_0x40c1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x40c1('0x8'));var controller=require(_0x40c1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x40c1('0xa')]);router[_0x40c1('0xb')]('/describe',auth[_0x40c1('0xc')](),controller['describe']);router[_0x40c1('0xb')](_0x40c1('0xd'),auth['isAuthenticated'](),controller[_0x40c1('0xe')]);router[_0x40c1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x40c1('0x10')](_0x40c1('0xd'),auth[_0x40c1('0xc')](),controller['update']);router[_0x40c1('0x11')](_0x40c1('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 1c49c6a..fa4628b 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(_0x14b626,_0x185147){var _0x192659=function(_0x422a40){while(--_0x422a40){_0x14b626['push'](_0x14b626['shift']());}};_0x192659(++_0x185147);}(_0x7a54,0x106));var _0x47a5=function(_0x2db451,_0x5027a2){_0x2db451=_0x2db451-0x0;var _0x34a422=_0x7a54[_0x2db451];return _0x34a422;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x193e06,_0x2a0dbc){var _0x1d86ad=function(_0x5616bf){while(--_0x5616bf){_0x193e06['push'](_0x193e06['shift']());}};_0x1d86ad(++_0x2a0dbc);}(_0x7a54,0x106));var _0x47a5=function(_0xaf99ec,_0x3d777e){_0xaf99ec=_0xaf99ec-0x0;var _0x5b0436=_0x7a54[_0xaf99ec];return _0x5b0436;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 52e7a8e..848e964 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 _0xe605=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3a0d9b,_0x5322e2){var _0x103528=function(_0x16a21e){while(--_0x16a21e){_0x3a0d9b['push'](_0x3a0d9b['shift']());}};_0x103528(++_0x5322e2);}(_0xe605,0x92));var _0x5e60=function(_0x3f3793,_0x3116d7){_0x3f3793=_0x3f3793-0x0;var _0x5200c6=_0xe605[_0x3f3793];return _0x5200c6;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2a499e[_0x5e60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x19')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x1a')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=_[_0x5e60('0x2c')](db[_0x5e60('0x2d')][_0x5e60('0x2e')],function(_0x558197){return{'name':_0x558197[_0x5e60('0x2f')],'type':_0x558197[_0x5e60('0x30')]['key']};});_0x52f668[_0x5e60('0x31')]=_['map'](_0x235cc7,'name');_0x52f668[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0xac9c7a[_0x5e60('0x32')]);_0x52f668[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],_0x52f668[_0x5e60('0x32')]);_0x5431a8[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],qs['fields'](_0xac9c7a[_0x5e60('0x32')]['fields']));_0x5431a8['attributes']=_0x5431a8[_0x5e60('0x36')][_0x5e60('0x37')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x31')];if(!_0xac9c7a['query'][_0x5e60('0x38')](_0x5e60('0x39'))){_0x5431a8[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x1e')]);_0x5431a8[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0xac9c7a['query'][_0x5e60('0x1d')]);}_0x5431a8[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3b')]);_0x5431a8[_0x5e60('0x3c')]=qs[_0x5e60('0x34')](_['pick'](_0xac9c7a[_0x5e60('0x32')],_0x52f668[_0x5e60('0x34')]),_0x235cc7);if(_0xac9c7a['query']['filter']){_0x5431a8[_0x5e60('0x3c')]=_[_0x5e60('0x3d')](_0x5431a8[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2c')](_0x235cc7,function(_0x31b900){if(_0x31b900['type']!==_0x5e60('0x3e')){var _0x413bf0={};_0x413bf0[_0x31b900[_0x5e60('0x2a')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3f')]+'%'};return _0x413bf0;}})});}_0x5431a8=_[_0x5e60('0x3d')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x40')]);var _0x54022a={'where':_0x5431a8[_0x5e60('0x3c')]};return db[_0x5e60('0x2d')]['count'](_0x54022a)['then'](function(_0x47a6df){_0xf25956[_0x5e60('0x20')]=_0x47a6df;if(_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x41')]){_0x5431a8[_0x5e60('0x42')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x26')](function(_0x4b6192){_0xf25956['rows']=_0x4b6192;return _0xf25956;})[_0x5e60('0x26')](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x44')](handleError(_0x52c97c,null));};exports[_0x5e60('0x45')]=function(_0x38ff1d,_0x39ab09){var _0x3899ae={'raw':!![],'where':{'id':_0x38ff1d[_0x5e60('0x46')]['id']}},_0x2522d2={};_0x2522d2[_0x5e60('0x31')]=_['keys'](db[_0x5e60('0x2d')][_0x5e60('0x2e')]);_0x2522d2['query']=_[_0x5e60('0x33')](_0x38ff1d[_0x5e60('0x32')]);_0x2522d2[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],_0x2522d2['query']);_0x3899ae[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],qs[_0x5e60('0x47')](_0x38ff1d['query']['fields']));_0x3899ae['attributes']=_0x3899ae[_0x5e60('0x36')][_0x5e60('0x37')]?_0x3899ae[_0x5e60('0x36')]:_0x2522d2[_0x5e60('0x31')];if(_0x38ff1d[_0x5e60('0x32')][_0x5e60('0x41')]){_0x3899ae['include']=[{'all':!![]}];}_0x3899ae=_[_0x5e60('0x3d')]({},_0x3899ae,_0x38ff1d[_0x5e60('0x40')]);return db[_0x5e60('0x2d')][_0x5e60('0x48')](_0x3899ae)[_0x5e60('0x26')](handleEntityNotFound(_0x39ab09,null))[_0x5e60('0x26')](respondWithResult(_0x39ab09,null))[_0x5e60('0x44')](handleError(_0x39ab09,null));};exports['create']=function(_0x24c757,_0x3ed45d){return db[_0x5e60('0x2d')][_0x5e60('0x49')](_0x24c757[_0x5e60('0x4a')],{})[_0x5e60('0x26')](respondWithResult(_0x3ed45d,0xc9))[_0x5e60('0x44')](handleError(_0x3ed45d,null));};exports[_0x5e60('0x25')]=function(_0x1518bd,_0x350d6d){if(_0x1518bd[_0x5e60('0x4a')]['id']){delete _0x1518bd[_0x5e60('0x4a')]['id'];}return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x1518bd[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x350d6d,null))[_0x5e60('0x26')](saveUpdates(_0x1518bd[_0x5e60('0x4a')],null))['then'](respondWithResult(_0x350d6d,null))['catch'](handleError(_0x350d6d,null));};exports[_0x5e60('0x27')]=function(_0x4d3588,_0x3525d){return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x4d3588[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x3525d,null))[_0x5e60('0x26')](removeEntity(_0x3525d,null))['catch'](handleError(_0x3525d,null));};exports['describe']=function(_0xd7d32c,_0x1e4e41){return db[_0x5e60('0x2d')]['describe']()['then'](respondWithResult(_0x1e4e41,null))[_0x5e60('0x44')](handleError(_0x1e4e41,null));}; \ No newline at end of file +var _0x4e81=['limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x4e81[_0x1c2f29];return _0x258465;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};exports[_0x14e8('0x4e')]=function(_0x4cc86a,_0x519c9c){return db[_0x14e8('0x2b')][_0x14e8('0x4e')]()[_0x14e8('0x24')](respondWithResult(_0x519c9c,null))[_0x14e8('0x49')](handleError(_0x519c9c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d19b41e..25c1fdb 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 _0x1eec=['path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x191387,_0x45c2cd){var _0x5831e9=function(_0x1d59b5){while(--_0x1d59b5){_0x191387['push'](_0x191387['shift']());}};_0x5831e9(++_0x45c2cd);}(_0x1eec,0x1c4));var _0xc1ee=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1eec[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1ee('0x0'))(_0xc1ee('0x1'));var moment=require(_0xc1ee('0x2'));var BPromise=require(_0xc1ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1ee('0x4'));var rimraf=require('rimraf');var config=require(_0xc1ee('0x5'));var attributes=require(_0xc1ee('0x6'));module[_0xc1ee('0x7')]=function(_0x6bace9,_0x1e2a0b){return _0x6bace9[_0xc1ee('0x8')](_0xc1ee('0x9'),attributes,{'tableName':_0xc1ee('0xa'),'paranoid':![],'indexes':[{'name':_0xc1ee('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9550=['api','moment','bluebird','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x150dc2,_0x3e7980){var _0x30e51a=function(_0x5580f0){while(--_0x5580f0){_0x150dc2['push'](_0x150dc2['shift']());}};_0x30e51a(++_0x3e7980);}(_0x9550,0x11b));var _0x0955=function(_0x31e1d6,_0x2462d8){_0x31e1d6=_0x31e1d6-0x0;var _0xa91ba6=_0x9550[_0x31e1d6];return _0xa91ba6;};'use strict';var _=require(_0x0955('0x0'));var util=require(_0x0955('0x1'));var logger=require(_0x0955('0x2'))(_0x0955('0x3'));var moment=require(_0x0955('0x4'));var BPromise=require(_0x0955('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0955('0x6'));var config=require(_0x0955('0x7'));var attributes=require(_0x0955('0x8'));module[_0x0955('0x9')]=function(_0x5a5d14,_0x1519ce){return _0x5a5d14['define'](_0x0955('0xa'),attributes,{'tableName':_0x0955('0xb'),'paranoid':![],'indexes':[{'name':_0x0955('0xc'),'fields':[_0x0955('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index cb1b55b..90149ef 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 _0xdd4c=['then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request'];(function(_0x1df397,_0xffbb13){var _0x39ba23=function(_0x1a8eb3){while(--_0x1a8eb3){_0x1df397['push'](_0x1df397['shift']());}};_0x39ba23(++_0xffbb13);}(_0xdd4c,0x140));var _0xcdd4=function(_0x4a9e29,_0xc3523c){_0x4a9e29=_0x4a9e29-0x0;var _0x433f61=_0xdd4c[_0x4a9e29];return _0x433f61;};'use strict';var _=require(_0xcdd4('0x0'));var util=require('util');var moment=require(_0xcdd4('0x1'));var BPromise=require(_0xcdd4('0x2'));var rs=require(_0xcdd4('0x3'));var fs=require('fs');var Redis=require(_0xcdd4('0x4'));var db=require(_0xcdd4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdd4('0x6'))(_0xcdd4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcdd4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f17a1,_0x264513,_0x51f536){return new BPromise(function(_0x30b358,_0xe98096){return client[_0xcdd4('0x9')](_0x5f17a1,_0x51f536)[_0xcdd4('0xa')](function(_0x519ca6){logger[_0xcdd4('0xb')](_0xcdd4('0xc'),_0x264513,_0xcdd4('0xd'));logger[_0xcdd4('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x264513,'request\x20sent',JSON[_0xcdd4('0xf')](_0x519ca6));if(_0x519ca6['error']){if(_0x519ca6[_0xcdd4('0x10')]['code']===0x1f4){logger['error'](_0xcdd4('0xc'),_0x264513,_0x519ca6[_0xcdd4('0x10')]['message']);return _0xe98096(_0x519ca6[_0xcdd4('0x10')][_0xcdd4('0x11')]);}logger[_0xcdd4('0x10')](_0xcdd4('0xc'),_0x264513,_0x519ca6['error'][_0xcdd4('0x11')]);return _0x30b358(_0x519ca6[_0xcdd4('0x10')][_0xcdd4('0x11')]);}else{logger[_0xcdd4('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x264513,_0xcdd4('0xd'));_0x30b358(_0x519ca6[_0xcdd4('0x12')][_0xcdd4('0x11')]);}})[_0xcdd4('0x13')](function(_0x528c7a){logger[_0xcdd4('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x264513,_0x528c7a);_0xe98096(_0x528c7a);});});}exports['CreateWhatsappQueueReport']=function(_0x3b1e83){var _0x7f6984=this;return new Promise(function(_0x5b64b5,_0xd817ca){return db[_0xcdd4('0x14')][_0xcdd4('0x15')](_0x3b1e83[_0xcdd4('0x16')],{'raw':_0x3b1e83[_0xcdd4('0x17')]?_0x3b1e83['options']['raw']===undefined?!![]:![]:!![]})[_0xcdd4('0xa')](function(_0x106477){logger[_0xcdd4('0xb')]('CreateWhatsappQueueReport',_0x3b1e83);logger[_0xcdd4('0xe')]('CreateWhatsappQueueReport',_0x3b1e83,JSON[_0xcdd4('0xf')](_0x106477));_0x5b64b5(_0x106477);})[_0xcdd4('0x13')](function(_0x47d949){logger['error']('CreateWhatsappQueueReport',_0x47d949[_0xcdd4('0x11')],_0x3b1e83);_0xd817ca(_0x7f6984['error'](0x1f4,_0x47d949[_0xcdd4('0x11')]));});});};exports[_0xcdd4('0x18')]=function(_0x58fe52){var _0x2cba38=this;return new Promise(function(_0x123e18,_0x148478){return db[_0xcdd4('0x14')][_0xcdd4('0x19')](_0x58fe52[_0xcdd4('0x16')],{'raw':_0x58fe52[_0xcdd4('0x17')]?_0x58fe52[_0xcdd4('0x17')][_0xcdd4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58fe52[_0xcdd4('0x17')]?_0x58fe52[_0xcdd4('0x17')][_0xcdd4('0x1b')]||null:null,'attributes':_0x58fe52[_0xcdd4('0x17')]?_0x58fe52[_0xcdd4('0x17')][_0xcdd4('0x1c')]||null:null,'limit':_0x58fe52['options']?_0x58fe52[_0xcdd4('0x17')][_0xcdd4('0x1d')]||null:null})[_0xcdd4('0xa')](function(_0x222c0b){logger['info']('UpdateWhatsappQueueReport',_0x58fe52);logger[_0xcdd4('0xe')](_0xcdd4('0x18'),_0x58fe52,JSON['stringify'](_0x222c0b));_0x123e18(_0x222c0b);})[_0xcdd4('0x13')](function(_0x8a76c6){logger['error'](_0xcdd4('0x18'),_0x8a76c6[_0xcdd4('0x11')],_0x58fe52);_0x148478(_0x2cba38[_0xcdd4('0x10')](0x1f4,_0x8a76c6[_0xcdd4('0x11')]));});});}; \ No newline at end of file +var _0xf8c4=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','then','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','options','raw','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x411665,_0x1ae5e8){var _0x361e61=function(_0x1dcb11){while(--_0x1dcb11){_0x411665['push'](_0x411665['shift']());}};_0x361e61(++_0x1ae5e8);}(_0xf8c4,0x1b8));var _0x4f8c=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xf8c4[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x4f8c('0x0'));var util=require('util');var moment=require(_0x4f8c('0x1'));var BPromise=require(_0x4f8c('0x2'));var rs=require(_0x4f8c('0x3'));var fs=require('fs');var Redis=require(_0x4f8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f8c('0x5'));var logger=require('../../config/logger')(_0x4f8c('0x6'));var config=require(_0x4f8c('0x7'));var jayson=require(_0x4f8c('0x8'));var client=jayson[_0x4f8c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb8caa,_0x56ef25,_0x196945){return new BPromise(function(_0x2eba4c,_0x3c6371){return client['request'](_0xb8caa,_0x196945)['then'](function(_0x5961b3){logger[_0x4f8c('0xa')](_0x4f8c('0xb'),_0x56ef25,_0x4f8c('0xc'));logger[_0x4f8c('0xd')](_0x4f8c('0xe'),_0x56ef25,_0x4f8c('0xc'),JSON[_0x4f8c('0xf')](_0x5961b3));if(_0x5961b3['error']){if(_0x5961b3[_0x4f8c('0x10')][_0x4f8c('0x11')]===0x1f4){logger[_0x4f8c('0x10')](_0x4f8c('0xb'),_0x56ef25,_0x5961b3[_0x4f8c('0x10')]['message']);return _0x3c6371(_0x5961b3[_0x4f8c('0x10')][_0x4f8c('0x12')]);}logger['error'](_0x4f8c('0xb'),_0x56ef25,_0x5961b3[_0x4f8c('0x10')][_0x4f8c('0x12')]);return _0x2eba4c(_0x5961b3['error']['message']);}else{logger[_0x4f8c('0xa')](_0x4f8c('0xb'),_0x56ef25,'request\x20sent');_0x2eba4c(_0x5961b3[_0x4f8c('0x13')][_0x4f8c('0x12')]);}})[_0x4f8c('0x14')](function(_0xa53b53){logger[_0x4f8c('0x10')](_0x4f8c('0xb'),_0x56ef25,_0xa53b53);_0x3c6371(_0xa53b53);});});}exports['CreateWhatsappQueueReport']=function(_0x2cc57e){var _0x3b8b07=this;return new Promise(function(_0x2ef2e9,_0x3fd9d6){return db['WhatsappQueueReport']['create'](_0x2cc57e[_0x4f8c('0x15')],{'raw':_0x2cc57e['options']?_0x2cc57e['options']['raw']===undefined?!![]:![]:!![]})[_0x4f8c('0x16')](function(_0x28199d){logger[_0x4f8c('0xa')](_0x4f8c('0x17'),_0x2cc57e);logger['debug'](_0x4f8c('0x17'),_0x2cc57e,JSON[_0x4f8c('0xf')](_0x28199d));_0x2ef2e9(_0x28199d);})['catch'](function(_0x58adc5){logger[_0x4f8c('0x10')](_0x4f8c('0x17'),_0x58adc5[_0x4f8c('0x12')],_0x2cc57e);_0x3fd9d6(_0x3b8b07[_0x4f8c('0x10')](0x1f4,_0x58adc5['message']));});});};exports[_0x4f8c('0x18')]=function(_0x40015a){var _0x2aa72d=this;return new Promise(function(_0x306b71,_0x594a3e){return db[_0x4f8c('0x19')]['update'](_0x40015a['body'],{'raw':_0x40015a[_0x4f8c('0x1a')]?_0x40015a[_0x4f8c('0x1a')][_0x4f8c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40015a[_0x4f8c('0x1a')]?_0x40015a['options']['where']||null:null,'attributes':_0x40015a['options']?_0x40015a[_0x4f8c('0x1a')][_0x4f8c('0x1c')]||null:null,'limit':_0x40015a[_0x4f8c('0x1a')]?_0x40015a[_0x4f8c('0x1a')][_0x4f8c('0x1d')]||null:null})[_0x4f8c('0x16')](function(_0x70719a){logger[_0x4f8c('0xa')](_0x4f8c('0x18'),_0x40015a);logger[_0x4f8c('0xd')](_0x4f8c('0x18'),_0x40015a,JSON[_0x4f8c('0xf')](_0x70719a));_0x306b71(_0x70719a);})[_0x4f8c('0x14')](function(_0xf94924){logger[_0x4f8c('0x10')](_0x4f8c('0x18'),_0xf94924[_0x4f8c('0x12')],_0x40015a);_0x594a3e(_0x2aa72d[_0x4f8c('0x10')](0x1f4,_0xf94924[_0x4f8c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index aefa7b0..9e957e6 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 _0xe242=['create','put','/:id','update','delete','destroy','multer','path','express','Router','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x340af8,_0x7526df){var _0x487667=function(_0x6e99ea){while(--_0x6e99ea){_0x340af8['push'](_0x340af8['shift']());}};_0x487667(++_0x7526df);}(_0xe242,0xb1));var _0x2e24=function(_0x59c558,_0x2cb324){_0x59c558=_0x59c558-0x0;var _0x568e3b=_0xe242[_0x59c558];return _0x568e3b;};'use strict';var multer=require(_0x2e24('0x0'));var util=require('util');var path=require(_0x2e24('0x1'));var timeout=require('connect-timeout');var express=require(_0x2e24('0x2'));var router=express[_0x2e24('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2e24('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2e24('0x5'));router[_0x2e24('0x6')]('/',auth[_0x2e24('0x7')](),controller[_0x2e24('0x8')]);router[_0x2e24('0x6')](_0x2e24('0x9'),auth['isAuthenticated'](),controller[_0x2e24('0xa')]);router['get']('/:id',auth[_0x2e24('0x7')](),controller[_0x2e24('0xb')]);router[_0x2e24('0xc')]('/',auth[_0x2e24('0x7')](),controller[_0x2e24('0xd')]);router[_0x2e24('0xe')](_0x2e24('0xf'),auth[_0x2e24('0x7')](),controller[_0x2e24('0x10')]);router[_0x2e24('0x11')](_0x2e24('0xf'),auth[_0x2e24('0x7')](),controller[_0x2e24('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd5c3=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','create','update','delete','/:id','destroy'];(function(_0x38f955,_0x4e65e6){var _0xd8b97=function(_0x4d61ff){while(--_0x4d61ff){_0x38f955['push'](_0x38f955['shift']());}};_0xd8b97(++_0x4e65e6);}(_0xd5c3,0x79));var _0x3d5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3d5c('0x0'));var util=require(_0x3d5c('0x1'));var path=require(_0x3d5c('0x2'));var timeout=require(_0x3d5c('0x3'));var express=require(_0x3d5c('0x4'));var router=express[_0x3d5c('0x5')]();var fs_extra=require(_0x3d5c('0x6'));var auth=require(_0x3d5c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3d5c('0x8'));router[_0x3d5c('0x9')]('/',auth[_0x3d5c('0xa')](),controller[_0x3d5c('0xb')]);router[_0x3d5c('0x9')](_0x3d5c('0xc'),auth[_0x3d5c('0xa')](),controller[_0x3d5c('0xd')]);router[_0x3d5c('0x9')]('/:id',auth[_0x3d5c('0xa')](),controller['show']);router['post']('/',auth[_0x3d5c('0xa')](),controller[_0x3d5c('0xe')]);router['put']('/:id',auth[_0x3d5c('0xa')](),controller[_0x3d5c('0xf')]);router[_0x3d5c('0x10')](_0x3d5c('0x11'),auth[_0x3d5c('0xa')](),controller[_0x3d5c('0x12')]);module[_0x3d5c('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 f7e8150..0dff605 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 _0x87d9=['STRING','ENUM','account','agent','queue','sequelize'];(function(_0x117822,_0x250560){var _0x31f9fb=function(_0x2a8399){while(--_0x2a8399){_0x117822['push'](_0x117822['shift']());}};_0x31f9fb(++_0x250560);}(_0x87d9,0x143));var _0x987d=function(_0x4338d1,_0x25f589){_0x4338d1=_0x4338d1-0x0;var _0x2b495e=_0x87d9[_0x4338d1];return _0x2b495e;};'use strict';var Sequelize=require(_0x987d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x987d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x987d('0x2')](_0x987d('0x3'),_0x987d('0x4'),_0x987d('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xe458=['queue','DATE','sequelize','exports','ENUM','account','agent'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0xe458,0x160));var _0x8e45=function(_0x149075,_0x38a419){_0x149075=_0x149075-0x0;var _0x2d7768=_0xe458[_0x149075];return _0x2d7768;};'use strict';var Sequelize=require(_0x8e45('0x0'));module[_0x8e45('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8e45('0x2')](_0x8e45('0x3'),_0x8e45('0x4'),_0x8e45('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x8e45('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 1493b56..aedac1d 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 _0xa264=['WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','show','params','includeAll','options','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xa264,0x148));var _0x4a26=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xa264[_0x497b1e];return _0x3f72e1;};'use strict';var emlformat=require(_0x4a26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a26('0x1'));var jsonpatch=require(_0x4a26('0x2'));var rp=require(_0x4a26('0x3'));var moment=require(_0x4a26('0x4'));var BPromise=require(_0x4a26('0x5'));var Mustache=require(_0x4a26('0x6'));var util=require('util');var path=require(_0x4a26('0x7'));var sox=require(_0x4a26('0x8'));var csv=require(_0x4a26('0x9'));var ejs=require(_0x4a26('0xa'));var fs=require('fs');var fs_extra=require(_0x4a26('0xb'));var _=require(_0x4a26('0xc'));var squel=require(_0x4a26('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a26('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4a26('0x9'));var querystring=require(_0x4a26('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4a26('0x10'));var qs=require(_0x4a26('0x11'));var as=require(_0x4a26('0x12'));var hardwareService=require(_0x4a26('0x13'));var logger=require('../../config/logger')(_0x4a26('0x14'));var utils=require('../../config/utils');var config=require(_0x4a26('0x15'));var licenseUtil=require(_0x4a26('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x168bee,_0x168bf7){_0x168bf7=_0x168bf7||0xcc;return function(_0x150eab){if(_0x150eab){return _0x168bee[_0x4a26('0x17')](_0x168bf7);}return _0x168bee['status'](_0x168bf7)[_0x4a26('0x18')]();};}function respondWithResult(_0x7226dd,_0x5cdb6a){_0x5cdb6a=_0x5cdb6a||0xc8;return function(_0x3b0e93){if(_0x3b0e93){return _0x7226dd[_0x4a26('0x19')](_0x5cdb6a)[_0x4a26('0x1a')](_0x3b0e93);}};}function respondWithFilteredResult(_0x438eb0,_0x4dde6e){return function(_0x4d6955){if(_0x4d6955){var _0x16a69a=typeof _0x4dde6e[_0x4a26('0x1b')]===_0x4a26('0x1c')&&typeof _0x4dde6e['limit']===_0x4a26('0x1c');var _0x4fe987=_0x4d6955[_0x4a26('0x1d')];var _0x5c8b0f=_0x16a69a?0x0:_0x4dde6e[_0x4a26('0x1b')];var _0x4b9ff1=_0x16a69a?_0x4d6955[_0x4a26('0x1d')]:_0x4dde6e[_0x4a26('0x1b')]+_0x4dde6e[_0x4a26('0x1e')];var _0x2de7d9;if(_0x4b9ff1>=_0x4fe987){_0x4b9ff1=_0x4fe987;_0x2de7d9=0xc8;}else{_0x2de7d9=0xce;}_0x438eb0['status'](_0x2de7d9);return _0x438eb0['set']('Content-Range',_0x5c8b0f+'-'+_0x4b9ff1+'/'+_0x4fe987)[_0x4a26('0x1a')](_0x4d6955);}return null;};}function patchUpdates(_0x22b2c8){return function(_0x1cbaf7){try{jsonpatch[_0x4a26('0x1f')](_0x1cbaf7,_0x22b2c8,!![]);}catch(_0x13c6ed){return BPromise[_0x4a26('0x20')](_0x13c6ed);}return _0x1cbaf7[_0x4a26('0x21')]();};}function saveUpdates(_0x2fbc22,_0x5b79a1){return function(_0x244228){if(_0x244228){return _0x244228[_0x4a26('0x22')](_0x2fbc22)[_0x4a26('0x23')](function(_0x5ba514){return _0x5ba514;});}return null;};}function removeEntity(_0x3d54a2,_0xa0c5fc){return function(_0x553c20){if(_0x553c20){return _0x553c20[_0x4a26('0x24')]()[_0x4a26('0x23')](function(){_0x3d54a2[_0x4a26('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a021,_0xf650d5){return function(_0x4b25a1){if(!_0x4b25a1){_0x59a021[_0x4a26('0x17')](0x194);}return _0x4b25a1;};}function handleError(_0x130b65,_0x3820f9){_0x3820f9=_0x3820f9||0x1f4;return function(_0x2e68ec){logger[_0x4a26('0x25')](_0x2e68ec[_0x4a26('0x26')]);if(_0x2e68ec[_0x4a26('0x27')]){delete _0x2e68ec['name'];}_0x130b65['status'](_0x3820f9)[_0x4a26('0x28')](_0x2e68ec);};}exports['index']=function(_0x4804e6,_0x470389){var _0x21d1af={},_0x45f9d4={},_0x207941={'count':0x0,'rows':[]};var _0x2f6eb6=_[_0x4a26('0x29')](db[_0x4a26('0x2a')][_0x4a26('0x2b')],function(_0x4e011f){return{'name':_0x4e011f[_0x4a26('0x2c')],'type':_0x4e011f[_0x4a26('0x2d')][_0x4a26('0x2e')]};});_0x45f9d4[_0x4a26('0x2f')]=_['map'](_0x2f6eb6,_0x4a26('0x27'));_0x45f9d4['query']=_[_0x4a26('0x30')](_0x4804e6['query']);_0x45f9d4[_0x4a26('0x31')]=_[_0x4a26('0x32')](_0x45f9d4[_0x4a26('0x2f')],_0x45f9d4['query']);_0x21d1af[_0x4a26('0x33')]=_[_0x4a26('0x32')](_0x45f9d4[_0x4a26('0x2f')],qs['fields'](_0x4804e6[_0x4a26('0x34')][_0x4a26('0x35')]));_0x21d1af[_0x4a26('0x33')]=_0x21d1af['attributes'][_0x4a26('0x36')]?_0x21d1af[_0x4a26('0x33')]:_0x45f9d4[_0x4a26('0x2f')];if(!_0x4804e6[_0x4a26('0x34')][_0x4a26('0x37')]('nolimit')){_0x21d1af[_0x4a26('0x1e')]=qs['limit'](_0x4804e6[_0x4a26('0x34')][_0x4a26('0x1e')]);_0x21d1af[_0x4a26('0x1b')]=qs['offset'](_0x4804e6[_0x4a26('0x34')][_0x4a26('0x1b')]);}_0x21d1af[_0x4a26('0x38')]=qs['sort'](_0x4804e6[_0x4a26('0x34')][_0x4a26('0x39')]);_0x21d1af[_0x4a26('0x3a')]=qs['filters'](_[_0x4a26('0x3b')](_0x4804e6[_0x4a26('0x34')],_0x45f9d4[_0x4a26('0x31')]),_0x2f6eb6);if(_0x4804e6['query'][_0x4a26('0x3c')]){_0x21d1af['where']=_['merge'](_0x21d1af[_0x4a26('0x3a')],{'$or':_['map'](_0x2f6eb6,function(_0x35afdf){if(_0x35afdf[_0x4a26('0x2d')]!==_0x4a26('0x3d')){var _0x123a95={};_0x123a95[_0x35afdf[_0x4a26('0x27')]]={'$like':'%'+_0x4804e6[_0x4a26('0x34')][_0x4a26('0x3c')]+'%'};return _0x123a95;}})});}_0x21d1af=_[_0x4a26('0x3e')]({},_0x21d1af,_0x4804e6['options']);var _0x2de0b1={'where':_0x21d1af[_0x4a26('0x3a')]};return db['WhatsappTransferReport'][_0x4a26('0x1d')](_0x2de0b1)[_0x4a26('0x23')](function(_0x3cccc9){_0x207941[_0x4a26('0x1d')]=_0x3cccc9;if(_0x4804e6['query']['includeAll']){_0x21d1af[_0x4a26('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x4a26('0x40')](_0x21d1af);})[_0x4a26('0x23')](function(_0x23ba33){_0x207941['rows']=_0x23ba33;return _0x207941;})['then'](respondWithFilteredResult(_0x470389,_0x21d1af))['catch'](handleError(_0x470389,null));};exports[_0x4a26('0x41')]=function(_0x3c15e9,_0x44f44f){var _0x4210cc={'raw':!![],'where':{'id':_0x3c15e9[_0x4a26('0x42')]['id']}},_0x5d2b8e={};_0x5d2b8e[_0x4a26('0x2f')]=_['keys'](db[_0x4a26('0x2a')][_0x4a26('0x2b')]);_0x5d2b8e['query']=_['keys'](_0x3c15e9[_0x4a26('0x34')]);_0x5d2b8e[_0x4a26('0x31')]=_[_0x4a26('0x32')](_0x5d2b8e['model'],_0x5d2b8e[_0x4a26('0x34')]);_0x4210cc[_0x4a26('0x33')]=_[_0x4a26('0x32')](_0x5d2b8e[_0x4a26('0x2f')],qs[_0x4a26('0x35')](_0x3c15e9[_0x4a26('0x34')][_0x4a26('0x35')]));_0x4210cc[_0x4a26('0x33')]=_0x4210cc[_0x4a26('0x33')][_0x4a26('0x36')]?_0x4210cc[_0x4a26('0x33')]:_0x5d2b8e[_0x4a26('0x2f')];if(_0x3c15e9[_0x4a26('0x34')][_0x4a26('0x43')]){_0x4210cc[_0x4a26('0x3f')]=[{'all':!![]}];}_0x4210cc=_[_0x4a26('0x3e')]({},_0x4210cc,_0x3c15e9[_0x4a26('0x44')]);return db[_0x4a26('0x2a')][_0x4a26('0x45')](_0x4210cc)[_0x4a26('0x23')](handleEntityNotFound(_0x44f44f,null))['then'](respondWithResult(_0x44f44f,null))['catch'](handleError(_0x44f44f,null));};exports[_0x4a26('0x46')]=function(_0x17d5ab,_0x25ff05){return db['WhatsappTransferReport'][_0x4a26('0x46')](_0x17d5ab[_0x4a26('0x47')],{})[_0x4a26('0x23')](respondWithResult(_0x25ff05,0xc9))[_0x4a26('0x48')](handleError(_0x25ff05,null));};exports[_0x4a26('0x22')]=function(_0x54c1c0,_0x370cdd){if(_0x54c1c0[_0x4a26('0x47')]['id']){delete _0x54c1c0[_0x4a26('0x47')]['id'];}return db[_0x4a26('0x2a')][_0x4a26('0x45')]({'where':{'id':_0x54c1c0['params']['id']}})[_0x4a26('0x23')](handleEntityNotFound(_0x370cdd,null))[_0x4a26('0x23')](saveUpdates(_0x54c1c0[_0x4a26('0x47')],null))[_0x4a26('0x23')](respondWithResult(_0x370cdd,null))[_0x4a26('0x48')](handleError(_0x370cdd,null));};exports[_0x4a26('0x24')]=function(_0x4408ec,_0x2353c0){return db[_0x4a26('0x2a')][_0x4a26('0x45')]({'where':{'id':_0x4408ec[_0x4a26('0x42')]['id']}})[_0x4a26('0x23')](handleEntityNotFound(_0x2353c0,null))[_0x4a26('0x23')](removeEntity(_0x2353c0,null))['catch'](handleError(_0x2353c0,null));};exports[_0x4a26('0x49')]=function(_0x373070,_0xbd61f8){return db['WhatsappTransferReport'][_0x4a26('0x49')]()['then'](respondWithResult(_0xbd61f8,null))['catch'](handleError(_0xbd61f8,null));}; \ No newline at end of file +var _0x041e=['then','destroy','error','name','send','index','map','WhatsappTransferReport','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','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/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','save','update'];(function(_0x312fd5,_0x5730aa){var _0x1ef873=function(_0x4f0d2b){while(--_0x4f0d2b){_0x312fd5['push'](_0x312fd5['shift']());}};_0x1ef873(++_0x5730aa);}(_0x041e,0x73));var _0xe041=function(_0x3fd03a,_0x66d28b){_0x3fd03a=_0x3fd03a-0x0;var _0x5a7fe0=_0x041e[_0x3fd03a];return _0x5a7fe0;};'use strict';var emlformat=require(_0xe041('0x0'));var rimraf=require(_0xe041('0x1'));var zipdir=require(_0xe041('0x2'));var jsonpatch=require(_0xe041('0x3'));var rp=require(_0xe041('0x4'));var moment=require(_0xe041('0x5'));var BPromise=require(_0xe041('0x6'));var Mustache=require(_0xe041('0x7'));var util=require(_0xe041('0x8'));var path=require(_0xe041('0x9'));var sox=require('sox');var csv=require(_0xe041('0xa'));var ejs=require(_0xe041('0xb'));var fs=require('fs');var fs_extra=require(_0xe041('0xc'));var _=require('lodash');var squel=require(_0xe041('0xd'));var crypto=require(_0xe041('0xe'));var jsforce=require(_0xe041('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe041('0xa'));var querystring=require(_0xe041('0x10'));var Papa=require(_0xe041('0x11'));var Redis=require(_0xe041('0x12'));var authService=require(_0xe041('0x13'));var qs=require(_0xe041('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe041('0x15'));var logger=require(_0xe041('0x16'))('api');var utils=require(_0xe041('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe041('0x18'));var db=require(_0xe041('0x19'))['db'];function respondWithStatusCode(_0x2c14b1,_0x463a16){_0x463a16=_0x463a16||0xcc;return function(_0x1ee609){if(_0x1ee609){return _0x2c14b1[_0xe041('0x1a')](_0x463a16);}return _0x2c14b1[_0xe041('0x1b')](_0x463a16)[_0xe041('0x1c')]();};}function respondWithResult(_0x481421,_0x55d555){_0x55d555=_0x55d555||0xc8;return function(_0x467192){if(_0x467192){return _0x481421[_0xe041('0x1b')](_0x55d555)['json'](_0x467192);}};}function respondWithFilteredResult(_0x5bfa82,_0x436b0e){return function(_0x425573){if(_0x425573){var _0xda6769=typeof _0x436b0e[_0xe041('0x1d')]===_0xe041('0x1e')&&typeof _0x436b0e[_0xe041('0x1f')]===_0xe041('0x1e');var _0x1a6d4e=_0x425573['count'];var _0x5aed99=_0xda6769?0x0:_0x436b0e[_0xe041('0x1d')];var _0x1d1cd1=_0xda6769?_0x425573['count']:_0x436b0e[_0xe041('0x1d')]+_0x436b0e[_0xe041('0x1f')];var _0x597383;if(_0x1d1cd1>=_0x1a6d4e){_0x1d1cd1=_0x1a6d4e;_0x597383=0xc8;}else{_0x597383=0xce;}_0x5bfa82['status'](_0x597383);return _0x5bfa82['set'](_0xe041('0x20'),_0x5aed99+'-'+_0x1d1cd1+'/'+_0x1a6d4e)[_0xe041('0x21')](_0x425573);}return null;};}function patchUpdates(_0x291129){return function(_0x509f42){try{jsonpatch[_0xe041('0x22')](_0x509f42,_0x291129,!![]);}catch(_0x4550a0){return BPromise['reject'](_0x4550a0);}return _0x509f42[_0xe041('0x23')]();};}function saveUpdates(_0xa54e04,_0x7a47d4){return function(_0x3709c9){if(_0x3709c9){return _0x3709c9[_0xe041('0x24')](_0xa54e04)[_0xe041('0x25')](function(_0x34040c){return _0x34040c;});}return null;};}function removeEntity(_0x2ada93,_0x349f11){return function(_0x2fc032){if(_0x2fc032){return _0x2fc032[_0xe041('0x26')]()[_0xe041('0x25')](function(){_0x2ada93[_0xe041('0x1b')](0xcc)[_0xe041('0x1c')]();});}};}function handleEntityNotFound(_0x3b5888,_0x4550b3){return function(_0x56cc58){if(!_0x56cc58){_0x3b5888[_0xe041('0x1a')](0x194);}return _0x56cc58;};}function handleError(_0x4a14a0,_0x41d004){_0x41d004=_0x41d004||0x1f4;return function(_0x194de4){logger[_0xe041('0x27')](_0x194de4['stack']);if(_0x194de4[_0xe041('0x28')]){delete _0x194de4['name'];}_0x4a14a0[_0xe041('0x1b')](_0x41d004)[_0xe041('0x29')](_0x194de4);};}exports[_0xe041('0x2a')]=function(_0x59a277,_0x432480){var _0x21829e={},_0x5dae8b={},_0x1cb13e={'count':0x0,'rows':[]};var _0x39c343=_[_0xe041('0x2b')](db[_0xe041('0x2c')][_0xe041('0x2d')],function(_0x4d4eba){return{'name':_0x4d4eba['fieldName'],'type':_0x4d4eba[_0xe041('0x2e')]['key']};});_0x5dae8b[_0xe041('0x2f')]=_['map'](_0x39c343,'name');_0x5dae8b[_0xe041('0x30')]=_['keys'](_0x59a277[_0xe041('0x30')]);_0x5dae8b[_0xe041('0x31')]=_[_0xe041('0x32')](_0x5dae8b[_0xe041('0x2f')],_0x5dae8b[_0xe041('0x30')]);_0x21829e['attributes']=_[_0xe041('0x32')](_0x5dae8b[_0xe041('0x2f')],qs[_0xe041('0x33')](_0x59a277[_0xe041('0x30')][_0xe041('0x33')]));_0x21829e[_0xe041('0x34')]=_0x21829e[_0xe041('0x34')][_0xe041('0x35')]?_0x21829e['attributes']:_0x5dae8b[_0xe041('0x2f')];if(!_0x59a277['query'][_0xe041('0x36')](_0xe041('0x37'))){_0x21829e['limit']=qs[_0xe041('0x1f')](_0x59a277[_0xe041('0x30')][_0xe041('0x1f')]);_0x21829e['offset']=qs[_0xe041('0x1d')](_0x59a277[_0xe041('0x30')][_0xe041('0x1d')]);}_0x21829e[_0xe041('0x38')]=qs[_0xe041('0x39')](_0x59a277[_0xe041('0x30')][_0xe041('0x39')]);_0x21829e[_0xe041('0x3a')]=qs[_0xe041('0x31')](_[_0xe041('0x3b')](_0x59a277[_0xe041('0x30')],_0x5dae8b[_0xe041('0x31')]),_0x39c343);if(_0x59a277['query'][_0xe041('0x3c')]){_0x21829e[_0xe041('0x3a')]=_[_0xe041('0x3d')](_0x21829e[_0xe041('0x3a')],{'$or':_['map'](_0x39c343,function(_0x32bf85){if(_0x32bf85[_0xe041('0x2e')]!=='VIRTUAL'){var _0x3ca0a4={};_0x3ca0a4[_0x32bf85[_0xe041('0x28')]]={'$like':'%'+_0x59a277['query'][_0xe041('0x3c')]+'%'};return _0x3ca0a4;}})});}_0x21829e=_[_0xe041('0x3d')]({},_0x21829e,_0x59a277[_0xe041('0x3e')]);var _0x5ab932={'where':_0x21829e[_0xe041('0x3a')]};return db[_0xe041('0x2c')][_0xe041('0x3f')](_0x5ab932)[_0xe041('0x25')](function(_0x1f2384){_0x1cb13e['count']=_0x1f2384;if(_0x59a277[_0xe041('0x30')][_0xe041('0x40')]){_0x21829e[_0xe041('0x41')]=[{'all':!![]}];}return db[_0xe041('0x2c')][_0xe041('0x42')](_0x21829e);})[_0xe041('0x25')](function(_0x2f6264){_0x1cb13e[_0xe041('0x43')]=_0x2f6264;return _0x1cb13e;})['then'](respondWithFilteredResult(_0x432480,_0x21829e))[_0xe041('0x44')](handleError(_0x432480,null));};exports[_0xe041('0x45')]=function(_0x5b2513,_0x54d44d){var _0x1c1e1b={'raw':!![],'where':{'id':_0x5b2513[_0xe041('0x46')]['id']}},_0x5b5c68={};_0x5b5c68[_0xe041('0x2f')]=_[_0xe041('0x47')](db[_0xe041('0x2c')]['rawAttributes']);_0x5b5c68['query']=_[_0xe041('0x47')](_0x5b2513['query']);_0x5b5c68[_0xe041('0x31')]=_[_0xe041('0x32')](_0x5b5c68[_0xe041('0x2f')],_0x5b5c68[_0xe041('0x30')]);_0x1c1e1b[_0xe041('0x34')]=_['intersection'](_0x5b5c68['model'],qs[_0xe041('0x33')](_0x5b2513[_0xe041('0x30')][_0xe041('0x33')]));_0x1c1e1b[_0xe041('0x34')]=_0x1c1e1b[_0xe041('0x34')][_0xe041('0x35')]?_0x1c1e1b[_0xe041('0x34')]:_0x5b5c68[_0xe041('0x2f')];if(_0x5b2513['query'][_0xe041('0x40')]){_0x1c1e1b[_0xe041('0x41')]=[{'all':!![]}];}_0x1c1e1b=_[_0xe041('0x3d')]({},_0x1c1e1b,_0x5b2513[_0xe041('0x3e')]);return db[_0xe041('0x2c')][_0xe041('0x48')](_0x1c1e1b)[_0xe041('0x25')](handleEntityNotFound(_0x54d44d,null))[_0xe041('0x25')](respondWithResult(_0x54d44d,null))[_0xe041('0x44')](handleError(_0x54d44d,null));};exports[_0xe041('0x49')]=function(_0x6a25d3,_0x4e14f8){return db[_0xe041('0x2c')]['create'](_0x6a25d3[_0xe041('0x4a')],{})[_0xe041('0x25')](respondWithResult(_0x4e14f8,0xc9))[_0xe041('0x44')](handleError(_0x4e14f8,null));};exports[_0xe041('0x24')]=function(_0x20af34,_0x1c0773){if(_0x20af34[_0xe041('0x4a')]['id']){delete _0x20af34['body']['id'];}return db[_0xe041('0x2c')][_0xe041('0x48')]({'where':{'id':_0x20af34[_0xe041('0x46')]['id']}})[_0xe041('0x25')](handleEntityNotFound(_0x1c0773,null))[_0xe041('0x25')](saveUpdates(_0x20af34[_0xe041('0x4a')],null))[_0xe041('0x25')](respondWithResult(_0x1c0773,null))[_0xe041('0x44')](handleError(_0x1c0773,null));};exports[_0xe041('0x26')]=function(_0x2de46e,_0xed98da){return db[_0xe041('0x2c')][_0xe041('0x48')]({'where':{'id':_0x2de46e[_0xe041('0x46')]['id']}})[_0xe041('0x25')](handleEntityNotFound(_0xed98da,null))['then'](removeEntity(_0xed98da,null))[_0xe041('0x44')](handleError(_0xed98da,null));};exports[_0xe041('0x4b')]=function(_0x5d8900,_0x4aa84d){return db['WhatsappTransferReport'][_0xe041('0x4b')]()['then'](respondWithResult(_0x4aa84d,null))[_0xe041('0x44')](handleError(_0x4aa84d,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a4bda30..8b905dc 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 _0x0c98=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x0c98,0xaf));var _0x80c9=function(_0x2daa0f,_0x311ed9){_0x2daa0f=_0x2daa0f-0x0;var _0x130dee=_0x0c98[_0x2daa0f];return _0x130dee;};'use strict';var _=require('lodash');var util=require(_0x80c9('0x0'));var logger=require(_0x80c9('0x1'))(_0x80c9('0x2'));var moment=require('moment');var BPromise=require(_0x80c9('0x3'));var rp=require(_0x80c9('0x4'));var fs=require('fs');var path=require(_0x80c9('0x5'));var rimraf=require('rimraf');var config=require(_0x80c9('0x6'));var attributes=require(_0x80c9('0x7'));module[_0x80c9('0x8')]=function(_0x6e78aa,_0x4e30fa){return _0x6e78aa[_0x80c9('0x9')](_0x80c9('0xa'),attributes,{'tableName':_0x80c9('0xb'),'paranoid':![],'indexes':[{'name':_0x80c9('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc70a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2966f6,_0x9550cd){var _0x36c4b3=function(_0x20bab4){while(--_0x20bab4){_0x2966f6['push'](_0x2966f6['shift']());}};_0x36c4b3(++_0x9550cd);}(_0xc70a,0x1cb));var _0xac70=function(_0x211695,_0x53d57c){_0x211695=_0x211695-0x0;var _0x4c1a75=_0xc70a[_0x211695];return _0x4c1a75;};'use strict';var _=require(_0xac70('0x0'));var util=require(_0xac70('0x1'));var logger=require(_0xac70('0x2'))(_0xac70('0x3'));var moment=require(_0xac70('0x4'));var BPromise=require(_0xac70('0x5'));var rp=require(_0xac70('0x6'));var fs=require('fs');var path=require(_0xac70('0x7'));var rimraf=require(_0xac70('0x8'));var config=require(_0xac70('0x9'));var attributes=require('./whatsappTransferReport.attributes');module[_0xac70('0xa')]=function(_0x590368,_0x16aa7c){return _0x590368['define'](_0xac70('0xb'),attributes,{'tableName':_0xac70('0xc'),'paranoid':![],'indexes':[{'name':_0xac70('0xd'),'fields':[_0xac70('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 4db386f..b6e33ea 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 _0x784c=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4a413e,_0x14a0a1){var _0x17ceaa=function(_0x516138){while(--_0x516138){_0x4a413e['push'](_0x4a413e['shift']());}};_0x17ceaa(++_0x14a0a1);}(_0x784c,0x182));var _0xc784=function(_0x362590,_0x459cae){_0x362590=_0x362590-0x0;var _0x336637=_0x784c[_0x362590];return _0x336637;};'use strict';var _=require(_0xc784('0x0'));var util=require(_0xc784('0x1'));var moment=require(_0xc784('0x2'));var BPromise=require(_0xc784('0x3'));var rs=require(_0xc784('0x4'));var fs=require('fs');var Redis=require(_0xc784('0x5'));var db=require(_0xc784('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc784('0x7'))(_0xc784('0x8'));var config=require(_0xc784('0x9'));var jayson=require(_0xc784('0xa'));var client=jayson['client'][_0xc784('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58f781,_0x24a757,_0x4eba95){return new BPromise(function(_0x2cddfd,_0x3fccdb){return client[_0xc784('0xc')](_0x58f781,_0x4eba95)[_0xc784('0xd')](function(_0x5ce914){logger[_0xc784('0xe')](_0xc784('0xf'),_0x24a757,_0xc784('0x10'));logger[_0xc784('0x11')](_0xc784('0x12'),_0x24a757,_0xc784('0x10'),JSON[_0xc784('0x13')](_0x5ce914));if(_0x5ce914[_0xc784('0x14')]){if(_0x5ce914[_0xc784('0x14')][_0xc784('0x15')]===0x1f4){logger[_0xc784('0x14')](_0xc784('0xf'),_0x24a757,_0x5ce914['error'][_0xc784('0x16')]);return _0x3fccdb(_0x5ce914['error'][_0xc784('0x16')]);}logger[_0xc784('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x24a757,_0x5ce914['error'][_0xc784('0x16')]);return _0x2cddfd(_0x5ce914[_0xc784('0x14')][_0xc784('0x16')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x24a757,'request\x20sent');_0x2cddfd(_0x5ce914[_0xc784('0x17')]['message']);}})['catch'](function(_0x5e38b9){logger[_0xc784('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x24a757,_0x5e38b9);_0x3fccdb(_0x5e38b9);});});} \ No newline at end of file +var _0xa406=['stringify','error','code','message','result','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xd5709b,_0x101823){var _0x3dc484=function(_0x28a409){while(--_0x28a409){_0xd5709b['push'](_0xd5709b['shift']());}};_0x3dc484(++_0x101823);}(_0xa406,0xfc));var _0x6a40=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa406[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a40('0x0'));var db=require(_0x6a40('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a40('0x2'))(_0x6a40('0x3'));var config=require(_0x6a40('0x4'));var jayson=require(_0x6a40('0x5'));var client=jayson[_0x6a40('0x6')][_0x6a40('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bd5e9,_0x1693c7,_0x3c9074){return new BPromise(function(_0x58cf53,_0x14d73b){return client[_0x6a40('0x8')](_0x1bd5e9,_0x3c9074)[_0x6a40('0x9')](function(_0x53cfd5){logger[_0x6a40('0xa')](_0x6a40('0xb'),_0x1693c7,_0x6a40('0xc'));logger['debug'](_0x6a40('0xd'),_0x1693c7,_0x6a40('0xc'),JSON[_0x6a40('0xe')](_0x53cfd5));if(_0x53cfd5['error']){if(_0x53cfd5[_0x6a40('0xf')][_0x6a40('0x10')]===0x1f4){logger[_0x6a40('0xf')](_0x6a40('0xb'),_0x1693c7,_0x53cfd5[_0x6a40('0xf')][_0x6a40('0x11')]);return _0x14d73b(_0x53cfd5[_0x6a40('0xf')][_0x6a40('0x11')]);}logger[_0x6a40('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1693c7,_0x53cfd5[_0x6a40('0xf')]['message']);return _0x58cf53(_0x53cfd5[_0x6a40('0xf')][_0x6a40('0x11')]);}else{logger['info'](_0x6a40('0xb'),_0x1693c7,_0x6a40('0xc'));_0x58cf53(_0x53cfd5[_0x6a40('0x12')][_0x6a40('0x11')]);}})['catch'](function(_0x2484ec){logger[_0x6a40('0xf')](_0x6a40('0xb'),_0x1693c7,_0x2484ec);_0x14d73b(_0x2484ec);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 718edf7..91099e3 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9f=['None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/environment','app','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','seedDB','default','info','start','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status'];(function(_0x48f862,_0x1442bc){var _0x598cde=function(_0x3bfa6e){while(--_0x3bfa6e){_0x48f862['push'](_0x48f862['shift']());}};_0x598cde(++_0x1442bc);}(_0x0a9f,0x64));var _0xf0a9=function(_0x22bff1,_0x1d964a){_0x22bff1=_0x22bff1-0x0;var _0x279396=_0x0a9f[_0x22bff1];return _0x279396;};'use strict';var _=require('lodash');var db=require(_0xf0a9('0x0'))['db'];var seedDb=require(_0xf0a9('0x1'));var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0xf0a9('0x2'));var logger=require('./config/logger')(_0xf0a9('0x3'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xf0a9('0x4'));var transcribe=require(_0xf0a9('0x5'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xf0a9('0x6')]['sync']()[_0xf0a9('0x7')](function(){if(config[_0xf0a9('0x8')]){return seedDb['default']();}})[_0xf0a9('0x7')](function(){return checkLicense[_0xf0a9('0x9')]();})[_0xf0a9('0x7')](function(){return rpc['listen']();})[_0xf0a9('0x7')](function(_0x4be957){logger[_0xf0a9('0xa')](_0x4be957);return chat[_0xf0a9('0xb')]();})[_0xf0a9('0x7')](function(){return whatsapp[_0xf0a9('0xb')]();})['then'](function(){return schedule[_0xf0a9('0xb')]();})[_0xf0a9('0x7')](function(){return transcribe[_0xf0a9('0xb')]();})[_0xf0a9('0x7')](function(){return provider['start']();})['then'](function(_0x1f0d77){logger[_0xf0a9('0xa')](_0x1f0d77);return pm2[_0xf0a9('0xb')](pm2Config);})[_0xf0a9('0x7')](function(_0x437a3b){var _0x156075=_0x437a3b[_0xf0a9('0xc')](function(_0x48cffd){return typeof _0x48cffd[_0xf0a9('0xd')]===_0xf0a9('0xe')&&_0x48cffd[_0xf0a9('0xd')]>=0x0;});if(_0x156075['length']>0x0){throw new Error(_0x156075[_0xf0a9('0xf')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xf0a9('0x10')](_0x156075,function(_0x43b7f3){return'\x22'+_0x43b7f3[_0xf0a9('0x11')][_0xf0a9('0x12')]+'\x22';}));}logger[_0xf0a9('0xa')](_0xf0a9('0x13'),_[_0xf0a9('0x10')](_[_0xf0a9('0xc')](_0x437a3b,{'status':_0xf0a9('0x14')}),'name')[_0xf0a9('0x15')]());logger[_0xf0a9('0xa')](_0xf0a9('0x16'),_['map'](_[_0xf0a9('0xc')](_0x437a3b,function(_0x5c26c1){return _0x5c26c1[_0xf0a9('0x17')]!==_0xf0a9('0x14');}),'name')[_0xf0a9('0x15')]()||_0xf0a9('0x18'));console[_0xf0a9('0x19')]('App\x20Ready!');})[_0xf0a9('0x1a')](function(_0x5fc85){console[_0xf0a9('0x19')](_0xf0a9('0x1b'),_0x5fc85);logger[_0xf0a9('0x1c')](_0xf0a9('0x1d'),_0x5fc85);process[_0xf0a9('0x1e')](0x1);});}main(); \ No newline at end of file +var _0x3dd6=['online','join','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','length','map','pm2_env','name','Online\x20apps:'];(function(_0x4b9617,_0x1bdf76){var _0x5f04ab=function(_0x5c0dee){while(--_0x5c0dee){_0x4b9617['push'](_0x4b9617['shift']());}};_0x5f04ab(++_0x1bdf76);}(_0x3dd6,0xcf));var _0x63dd=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x3dd6[_0x53abe5];return _0xc1c37e;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x63dd('0x0'));var rpc=require(_0x63dd('0x1'));var config=require(_0x63dd('0x2'));var logger=require(_0x63dd('0x3'))(_0x63dd('0x4'));var pm2=require(_0x63dd('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x63dd('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x63dd('0x7'));var transcribe=require(_0x63dd('0x8'));var provider=require(_0x63dd('0x9'));function main(){return db[_0x63dd('0xa')][_0x63dd('0xb')]()['then'](function(){if(config[_0x63dd('0xc')]){return seedDb[_0x63dd('0xd')]();}})[_0x63dd('0xe')](function(){return checkLicense[_0x63dd('0xd')]();})['then'](function(){return rpc['listen']();})[_0x63dd('0xe')](function(_0x1508c4){logger[_0x63dd('0xf')](_0x1508c4);return chat[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(){return whatsapp['start']();})[_0x63dd('0xe')](function(){return schedule[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(){return transcribe[_0x63dd('0x10')]();})['then'](function(){return provider[_0x63dd('0x10')]();})[_0x63dd('0xe')](function(_0x3ed4ea){logger[_0x63dd('0xf')](_0x3ed4ea);return pm2[_0x63dd('0x10')](pm2Config);})[_0x63dd('0xe')](function(_0x56c030){var _0x5b2f9f=_0x56c030[_0x63dd('0x11')](function(_0xa6ffcf){return typeof _0xa6ffcf[_0x63dd('0x12')]==='number'&&_0xa6ffcf[_0x63dd('0x12')]>=0x0;});if(_0x5b2f9f[_0x63dd('0x13')]>0x0){throw new Error(_0x5b2f9f[_0x63dd('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x63dd('0x14')](_0x5b2f9f,function(_0x368f85){return'\x22'+_0x368f85[_0x63dd('0x15')][_0x63dd('0x16')]+'\x22';}));}logger[_0x63dd('0xf')](_0x63dd('0x17'),_[_0x63dd('0x14')](_[_0x63dd('0x11')](_0x56c030,{'status':_0x63dd('0x18')}),_0x63dd('0x16'))[_0x63dd('0x19')]());logger[_0x63dd('0xf')]('Offline\x20apps:',_[_0x63dd('0x14')](_['filter'](_0x56c030,function(_0x466dac){return _0x466dac[_0x63dd('0x1a')]!==_0x63dd('0x18');}),'name')[_0x63dd('0x19')]()||_0x63dd('0x1b'));console[_0x63dd('0x1c')](_0x63dd('0x1d'));})[_0x63dd('0x1e')](function(_0x147928){console[_0x63dd('0x1c')](_0x63dd('0x1f'),_0x147928);logger[_0x63dd('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x147928);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 24c1f36..509d703 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 _0x0598=['toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','split','length','splice','encryptString','join','sign','secret','secrets','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','jsonwebtoken','express-jwt','bluebird','util','session','role','fullname','name','userpic','permissions','md5secret','voicePause','chatPause','smsPause','openchannelPause','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','status','unmanaged','Unmanaged.','headers','authorization','Basic','User','find','then','authenticate','pass','json','Wrong\x20credentials.','catch','startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','isWebrtcLicence','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','apikey','Sequelize','validatePasswordHistory'];(function(_0xbf8f73,_0x2ca243){var _0x53d9a9=function(_0x7c851d){while(--_0x7c851d){_0xbf8f73['push'](_0xbf8f73['shift']());}};_0x53d9a9(++_0x2ca243);}(_0x0598,0x92));var _0x8059=function(_0xe1bf0a,_0x528c6c){_0xe1bf0a=_0xe1bf0a-0x0;var _0xc6e4e=_0x0598[_0xe1bf0a];return _0xc6e4e;};'use strict';var db=require(_0x8059('0x0'))['db'];var config=require(_0x8059('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x8059('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x8059('0x3'));var expressJwt=require(_0x8059('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0x8059('0x5'));var util=require(_0x8059('0x6'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0x8059('0x7')]});var userAttributes=['id',_0x8059('0x8'),_0x8059('0x9'),_0x8059('0xa'),'internal','email',_0x8059('0xb'),_0x8059('0xc'),_0x8059('0xd'),_0x8059('0xe'),_0x8059('0xf'),'mailPause','faxPause',_0x8059('0x10'),_0x8059('0x11'),'pauseType','showWebBar','lastLoginAt',_0x8059('0x12'),_0x8059('0x13'),_0x8059('0x14'),_0x8059('0x15'),_0x8059('0x16'),'phoneBarAutoAnswer',_0x8059('0x17'),'phoneBarDnd',_0x8059('0x18'),'phoneBarEnableDtmfTone',_0x8059('0x19'),_0x8059('0x1a'),_0x8059('0x1b'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk',_0x8059('0x1c'),_0x8059('0x1d'),_0x8059('0x1e'),_0x8059('0x1f'),_0x8059('0x20'),'downloadVoiceRecordings',_0x8059('0x21'),_0x8059('0x22'),_0x8059('0x23'),_0x8059('0x24'),'chatAutoanswer',_0x8059('0x25'),'emailAutoanswer',_0x8059('0x26'),'smsAutoanswer',_0x8059('0x27'),'openchannelAutoanswer',_0x8059('0x28'),_0x8059('0x29'),_0x8059('0x2a'),'whatsappAutoanswer','whatsappAutoanswerDelay',_0x8059('0x2b')];exports[_0x8059('0x2c')]=function(){return this[_0x8059('0x2d')](!![])[_0x8059('0x2e')](function(_0x4c6234,_0x3bc226,_0x21ac82){if(_0x4c6234[_0x8059('0x2f')]){_0x21ac82();}else{return db['ChatInteraction'][_0x8059('0x30')]({'where':{'id':_0x4c6234[_0x8059('0x31')]['id']},'attributes':['id',_0x8059('0x32'),_0x8059('0x33')],'raw':!![]})['then'](function(_0x140f64){if(_0x140f64&&_0x140f64[_0x8059('0x32')]){return _0x3bc226[_0x8059('0x34')](_0x140f64[_0x8059('0x33')]===_0x8059('0x35')?0x195:0x193)['json']({'message':_0x140f64[_0x8059('0x33')]===_0x8059('0x35')?_0x8059('0x36'):'Forbidden.'});}else{_0x21ac82();}})['catch'](function(_0x5d5b45){_0x21ac82(_0x5d5b45);});}});};exports[_0x8059('0x2d')]=function isAuthenticated(_0xbebe0e){return compose()[_0x8059('0x2e')](function(_0x1009af,_0x59abe9,_0x1eb71b){var _0x50b737;if(_0x1009af[_0x8059('0x37')][_0x8059('0x38')]){if(_['startsWith'](_0x1009af[_0x8059('0x37')][_0x8059('0x38')],_0x8059('0x39'))){var _0x260ba8=basicAuth(_0x1009af);db[_0x8059('0x3a')][_0x8059('0x3b')]({'where':{'name':_0x260ba8[_0x8059('0xa')]}})[_0x8059('0x3c')](function(_0x505756){if(!_0x505756||!_0x505756[_0x8059('0x3d')](_0x260ba8[_0x8059('0x3e')])){return _0x59abe9[_0x8059('0x34')](0x191)[_0x8059('0x3f')]({'message':_0x8059('0x40')});}_0x1009af['user']={'id':_0x505756['id']};_0x1eb71b();})[_0x8059('0x41')](function(_0x22c492){_0x1eb71b(_0x22c492);});}else if(_[_0x8059('0x42')](_0x1009af[_0x8059('0x37')][_0x8059('0x38')],_0x8059('0x43'))){validateJwt(_0x1009af,_0x59abe9,_0x1eb71b);}else{if(_0xbebe0e){_0x1eb71b();}else{return _0x59abe9[_0x8059('0x34')](0x193)[_0x8059('0x3f')]({'message':_0x8059('0x44')});}}}else if(_0x1009af[_0x8059('0x45')]['apikey']){try{var _0x45c175={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x8059('0x46')]()};verifyJwt(_0x1009af['query']['apikey'],_0x45c175)[_0x8059('0x3c')](function(_0x5bd1a6){return db[_0x8059('0x3a')]['find']({'where':{'id':_0x5bd1a6[_0x8059('0x47')]}})['then'](function(_0x3d09fb){_0x50b737=_0x3d09fb;return db[_0x8059('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0x8059('0x49'),_0x8059('0x4a')],'raw':!![]});})[_0x8059('0x3c')](function(_0x483058){if(!_0x50b737||!_[_0x8059('0x4b')](_0x50b737['apiKeyNonce'],_0x5bd1a6[_0x8059('0x4c')])){return _0x59abe9['status'](0x191)[_0x8059('0x3f')]({'message':_0x8059('0x4d')});}if(_0x50b737[_0x8059('0x4e')]){return _0x59abe9[_0x8059('0x34')](0x191)['json']({'message':_0x8059('0x4f')});}if(_0x50b737['blocked']){if(_0x483058['blockDuration']>0x0){if(moment(_0x50b737[_0x8059('0x50')])[_0x8059('0x51')](_0x483058[_0x8059('0x4a')],_0x8059('0x52'))>moment()){return _0x59abe9[_0x8059('0x34')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x59abe9['status'](0x191)['json']({'message':_0x8059('0x4f')});}}_0x1009af[_0x8059('0x2f')]={'id':_0x50b737['id']};_0x1eb71b();});})[_0x8059('0x41')](function(){return _0x59abe9['status'](0x191)[_0x8059('0x3f')]({'message':_0x8059('0x4f')});});}catch(_0x52919a){_0x1eb71b(_0x52919a);}}else if(_0xbebe0e){_0x1eb71b();}else{return _0x59abe9[_0x8059('0x34')](0x193)[_0x8059('0x3f')]({'message':_0x8059('0x44')});}})['use'](function(_0x2c48cf,_0x38c320,_0x57eb56){if(_0x2c48cf[_0x8059('0x2f')]){db[_0x8059('0x3a')][_0x8059('0x3b')]({'where':{'id':_0x2c48cf[_0x8059('0x2f')]['id']},'attributes':userAttributes})[_0x8059('0x3c')](function(_0x25cee6){if(!_0x25cee6){return _0x38c320[_0x8059('0x34')](0x194)[_0x8059('0x3f')]({'message':_0x8059('0x53')});}_0x2c48cf[_0x8059('0x2f')]=_0x25cee6;_0x57eb56();})[_0x8059('0x41')](function(_0x245cf5){_0x57eb56(_0x245cf5);});}else if(_0xbebe0e){_0x57eb56();}else{return _0x38c320[_0x8059('0x34')](0x194)[_0x8059('0x3f')]({'message':_0x8059('0x54')});}});};exports[_0x8059('0x55')]=function canUpdate(){return compose()[_0x8059('0x2e')](function(_0x25f542,_0x1b613f,_0x1a139e){return licenseUtil[_0x8059('0x56')]()[_0x8059('0x3c')](function(_0xdda30){if(_0xdda30['update']){_0x1a139e();}else{return _0x1b613f[_0x8059('0x34')](0x193)['json']({'message':'Forbidden'});}})[_0x8059('0x41')](function(_0x539c9f){_0x1a139e(_0x539c9f);});});};exports[_0x8059('0x57')]=function isWebrtcLicence(){return compose()['use'](function(_0xf4bc19,_0x37619a,_0x37cfc9){return licenseUtil[_0x8059('0x56')]()[_0x8059('0x3c')](function(_0x28aa1b){if(_0x28aa1b['webrtc']){_0x37cfc9();}else{return _0x37619a[_0x8059('0x34')](0x193)['json']({'message':_0x8059('0x58')});}})[_0x8059('0x41')](function(_0x3b954e){_0x37cfc9(_0x3b954e);});});};exports['isMiddleware']=function(_0xf220b3,_0x120665,_0x46bec8){_0xf220b3[_0x8059('0x59')]=!![];return _0x46bec8();};exports['signToken']=function signToken(_0x3ccfb1){return signJwt(_0x3ccfb1);};exports[_0x8059('0x5a')]=function(_0x109748,_0x48e3bb){if(!_0x109748[_0x8059('0x2f')]){return _0x48e3bb['status'](0x194)['json']({'message':_0x8059('0x5b')});}var _0x4b0cc1={'payload':{'id':_0x109748[_0x8059('0x2f')]['id'],'role':_0x109748['user'][_0x8059('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4b0cc1)[_0x8059('0x3c')](function(_0x5ea40c){_0x48e3bb[_0x8059('0x5c')]('motion.token',_0x5ea40c);_0x48e3bb[_0x8059('0x5d')](_0x8059('0x5e'));})[_0x8059('0x41')](function(_0x5d5f16){return _0x48e3bb[_0x8059('0x34')](0x1f4)['send'](_0x5d5f16);});};exports[_0x8059('0x5f')]=function(_0x1b6fef){if(_[_0x8059('0x60')](_0x1b6fef[_0x8059('0x61')])||_['isNil'](_0x1b6fef[_0x8059('0x62')])){return null;}else{return createJwt(_0x1b6fef);}};exports[_0x8059('0x63')]=function(_0x58c5b2){_0x58c5b2[_0x8059('0x61')]=generateNonce();_0x58c5b2['apiKeyIat']=generateIssuedAt();return createJwt(_0x58c5b2);};exports[_0x8059('0x64')]=function(_0x547ffb,_0x5146ca){var _0x15bd13=_0x547ffb[_0x8059('0x45')][_0x8059('0x65')];if(_0x15bd13){var _0x3afe66={'nonce':_0x5146ca[_0x8059('0x61')],'iat':_0x5146ca[_0x8059('0x62')],'audience':hardwareConf[_0x8059('0x46')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x15bd13,_0x3afe66)['then'](function(){return generateApiKey(_0x5146ca);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x37c254){var _0x21d53c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21d53c['test'](_0x37c254))throw new db[(_0x8059('0x66'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x8059('0x67')]=function(_0x55cb8d,_0x11b69a,_0x27dfa5){var _0x2476e3=encryptor['decryptString'](_0x11b69a)['split'](',');for(var _0x886c5c=0x0;_0x886c5c<_0x27dfa5;_0x886c5c++){if(!_0x2476e3[_0x886c5c])break;if(_0x55cb8d[_0x8059('0x68')]()===_0x2476e3[_0x886c5c][_0x8059('0x68')]()){var _0x5056e6=util['format'](_0x8059('0x69'),_0x27dfa5);if(_0x27dfa5===0x1){_0x5056e6='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x8059('0x6a'))](_0x5056e6);}}return;};exports['updatePasswordsHistory']=function(_0x391687,_0x1c4015){var _0x4c5387=_0x1c4015?encryptor['decryptString'](_0x1c4015)[_0x8059('0x6b')](','):[];if(_0x4c5387[_0x8059('0x6c')]===0x5){_0x4c5387[_0x8059('0x6d')](-0x1,0x1);}_0x4c5387['unshift'](_0x391687);return encryptor[_0x8059('0x6e')](_0x4c5387[_0x8059('0x6f')](','));};function signJwt(_0xc6b6d8){var _0x18bce2=BPromise['promisify'](jwt[_0x8059('0x70')],{'context':jwt});var _0x537c32=_0xc6b6d8[_0x8059('0x71')]||config[_0x8059('0x72')]['session'];return new BPromise(function(_0x3a3254,_0x592e0b){_0x18bce2(_0xc6b6d8[_0x8059('0x73')],_0x537c32,_0xc6b6d8[_0x8059('0x74')])[_0x8059('0x3c')](function(_0x1263a1){_0x3a3254(_0x1263a1);})[_0x8059('0x41')](function(_0x19ccd7){_0x592e0b(_0x19ccd7);});});}function verifyJwt(_0x28b466,_0x410bf4,_0x352e51){var _0x471cb3=BPromise[_0x8059('0x75')](jwt[_0x8059('0x76')],{'context':jwt});var _0x325f9c=_0x352e51||config['secrets'][_0x8059('0x7')];return new BPromise(function(_0x2dc612,_0x391924){_0x471cb3(_0x28b466,_0x325f9c,_0x410bf4)[_0x8059('0x3c')](function(_0x2cf1fd){_0x2dc612(_0x2cf1fd);})['catch'](function(_0xfbb97b){_0x391924(_0xfbb97b);});});}function generateNonce(){return crypto[_0x8059('0x77')](0x10)[_0x8059('0x78')](_0x8059('0x79'));}function generateIssuedAt(){return Math[_0x8059('0x7a')](Date[_0x8059('0x7b')]()/0x3e8)[_0x8059('0x78')]();}function createJwt(_0x2804ba){var _0x19a3b7={'payload':{'iat':_0x2804ba['apiKeyIat'],'nonce':_0x2804ba[_0x8059('0x61')]},'options':{'algorithm':_0x8059('0x7c'),'subject':_0x2804ba['id'][_0x8059('0x78')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x19a3b7)[_0x8059('0x3c')](function(_0x514dce){return{'iat':_0x2804ba[_0x8059('0x62')],'nonce':_0x2804ba[_0x8059('0x61')],'token':_0x514dce};});} \ No newline at end of file +var _0xed3c=['join','promisify','sign','secret','secrets','session','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','moment','fullname','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','disposition','then','closed','unmanaged','json','catch','isAuthenticated','headers','authorization','startsWith','User','find','name','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','minutes','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','generateApiKey','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString'];(function(_0x572926,_0x513114){var _0x1ddbc0=function(_0x227178){while(--_0x227178){_0x572926['push'](_0x572926['shift']());}};_0x1ddbc0(++_0x513114);}(_0xed3c,0x1a6));var _0xced3=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0xed3c[_0x10a1ac];return _0x45b99e;};'use strict';var db=require(_0xced3('0x0'))['db'];var config=require(_0xced3('0x1'));var hardwareConf=require(_0xced3('0x2'));var licenseUtil=require(_0xced3('0x3'));var encryptor=require('../encryptor');var _=require(_0xced3('0x4'));var jwt=require(_0xced3('0x5'));var expressJwt=require(_0xced3('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xced3('0x7'));var BPromise=require(_0xced3('0x8'));var util=require(_0xced3('0x9'));var moment=require(_0xced3('0xa'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id','role',_0xced3('0xb'),'name','internal','email',_0xced3('0xc'),_0xced3('0xd'),_0xced3('0xe'),_0xced3('0xf'),_0xced3('0x10'),'mailPause',_0xced3('0x11'),_0xced3('0x12'),_0xced3('0x13'),'pauseType',_0xced3('0x14'),_0xced3('0x15'),_0xced3('0x16'),_0xced3('0x17'),_0xced3('0x18'),_0xced3('0x19'),_0xced3('0x1a'),'phoneBarAutoAnswer',_0xced3('0x1b'),'phoneBarDnd',_0xced3('0x1c'),_0xced3('0x1d'),_0xced3('0x1e'),_0xced3('0x1f'),'phoneBarPrefixRequired',_0xced3('0x20'),_0xced3('0x21'),'hotdesk',_0xced3('0x22'),_0xced3('0x23'),_0xced3('0x24'),_0xced3('0x25'),'wssPort',_0xced3('0x26'),'downloadOmnichannelInteractions',_0xced3('0x27'),_0xced3('0x28'),_0xced3('0x29'),_0xced3('0x2a'),_0xced3('0x2b'),_0xced3('0x2c'),_0xced3('0x2d'),_0xced3('0x2e'),_0xced3('0x2f'),_0xced3('0x30'),_0xced3('0x31'),'faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xced3('0x32'),_0xced3('0x33')];exports[_0xced3('0x34')]=function(){return this['isAuthenticated'](!![])[_0xced3('0x35')](function(_0x30d984,_0x526854,_0x559fa2){if(_0x30d984[_0xced3('0x36')]){_0x559fa2();}else{return db[_0xced3('0x37')][_0xced3('0x38')]({'where':{'id':_0x30d984[_0xced3('0x39')]['id']},'attributes':['id','closed',_0xced3('0x3a')],'raw':!![]})[_0xced3('0x3b')](function(_0x4fc285){if(_0x4fc285&&_0x4fc285[_0xced3('0x3c')]){return _0x526854['status'](_0x4fc285[_0xced3('0x3a')]===_0xced3('0x3d')?0x195:0x193)[_0xced3('0x3e')]({'message':_0x4fc285[_0xced3('0x3a')]===_0xced3('0x3d')?'Unmanaged.':'Forbidden.'});}else{_0x559fa2();}})[_0xced3('0x3f')](function(_0x5bb425){_0x559fa2(_0x5bb425);});}});};exports[_0xced3('0x40')]=function isAuthenticated(_0x1e6923){return compose()['use'](function(_0x3db664,_0x4024fa,_0x196956){var _0x1032d6;if(_0x3db664[_0xced3('0x41')][_0xced3('0x42')]){if(_[_0xced3('0x43')](_0x3db664[_0xced3('0x41')][_0xced3('0x42')],'Basic')){var _0xa78899=basicAuth(_0x3db664);db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'name':_0xa78899[_0xced3('0x46')]}})[_0xced3('0x3b')](function(_0x21e4a2){if(!_0x21e4a2||!_0x21e4a2[_0xced3('0x47')](_0xa78899[_0xced3('0x48')])){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x4a')});}_0x3db664[_0xced3('0x36')]={'id':_0x21e4a2['id']};_0x196956();})[_0xced3('0x3f')](function(_0x407a24){_0x196956(_0x407a24);});}else if(_[_0xced3('0x43')](_0x3db664[_0xced3('0x41')][_0xced3('0x42')],_0xced3('0x4b'))){validateJwt(_0x3db664,_0x4024fa,_0x196956);}else{if(_0x1e6923){_0x196956();}else{return _0x4024fa[_0xced3('0x49')](0x193)[_0xced3('0x3e')]({'message':_0xced3('0x4c')});}}}else if(_0x3db664['query'][_0xced3('0x4d')]){try{var _0x55e3ac={'audience':hardwareConf[_0xced3('0x4e')](),'issuer':hardwareConf[_0xced3('0x4e')]()};verifyJwt(_0x3db664[_0xced3('0x4f')][_0xced3('0x4d')],_0x55e3ac)[_0xced3('0x3b')](function(_0xefac3d){return db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'id':_0xefac3d[_0xced3('0x50')]}})[_0xced3('0x3b')](function(_0x5c290d){_0x1032d6=_0x5c290d;return db[_0xced3('0x51')][_0xced3('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xced3('0x52')],'raw':!![]});})[_0xced3('0x3b')](function(_0x1b5956){if(!_0x1032d6||!_['isEqual'](_0x1032d6['apiKeyNonce'],_0xefac3d[_0xced3('0x53')])){return _0x4024fa['status'](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x54')});}if(_0x1032d6['disabled']){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});}if(_0x1032d6['blocked']){if(_0x1b5956[_0xced3('0x52')]>0x0){if(moment(_0x1032d6['blockedAt'])['add'](_0x1b5956[_0xced3('0x52')],_0xced3('0x56'))>moment()){return _0x4024fa[_0xced3('0x49')](0x191)['json']({'message':_0xced3('0x55')});}}else{return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});}}_0x3db664[_0xced3('0x36')]={'id':_0x1032d6['id']};_0x196956();});})[_0xced3('0x3f')](function(){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});});}catch(_0x3eca11){_0x196956(_0x3eca11);}}else if(_0x1e6923){_0x196956();}else{return _0x4024fa[_0xced3('0x49')](0x193)[_0xced3('0x3e')]({'message':_0xced3('0x4c')});}})[_0xced3('0x35')](function(_0x1ced3a,_0x489546,_0x4279a3){if(_0x1ced3a[_0xced3('0x36')]){db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'id':_0x1ced3a[_0xced3('0x36')]['id']},'attributes':userAttributes})[_0xced3('0x3b')](function(_0x145157){if(!_0x145157){return _0x489546[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'User\x20not\x20found.'});}_0x1ced3a[_0xced3('0x36')]=_0x145157;_0x4279a3();})['catch'](function(_0x5f4599){_0x4279a3(_0x5f4599);});}else if(_0x1e6923){_0x4279a3();}else{return _0x489546[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xced3('0x57')]=function canUpdate(){return compose()[_0xced3('0x35')](function(_0x3569f3,_0x26b8ac,_0x5373ab){return licenseUtil[_0xced3('0x58')]()[_0xced3('0x3b')](function(_0xbf8cbc){if(_0xbf8cbc[_0xced3('0x59')]){_0x5373ab();}else{return _0x26b8ac[_0xced3('0x49')](0x193)['json']({'message':_0xced3('0x5a')});}})[_0xced3('0x3f')](function(_0x1dced4){_0x5373ab(_0x1dced4);});});};exports[_0xced3('0x5b')]=function isWebrtcLicence(){return compose()[_0xced3('0x35')](function(_0x740743,_0x3fa9fd,_0x532db9){return licenseUtil[_0xced3('0x58')]()[_0xced3('0x3b')](function(_0x4804e3){if(_0x4804e3['webrtc']){_0x532db9();}else{return _0x3fa9fd[_0xced3('0x49')](0x193)['json']({'message':_0xced3('0x5a')});}})[_0xced3('0x3f')](function(_0x33441c){_0x532db9(_0x33441c);});});};exports[_0xced3('0x5c')]=function(_0x2c70e3,_0x1b3396,_0x3700ed){_0x2c70e3[_0xced3('0x5c')]=!![];return _0x3700ed();};exports[_0xced3('0x5d')]=function signToken(_0x5b3529){return signJwt(_0x5b3529);};exports[_0xced3('0x5e')]=function(_0x8df206,_0x2aa876){if(!_0x8df206[_0xced3('0x36')]){return _0x2aa876[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x420b90={'payload':{'id':_0x8df206[_0xced3('0x36')]['id'],'role':_0x8df206[_0xced3('0x36')][_0xced3('0x5f')]},'options':{'expiresIn':0x15180}};return signJwt(_0x420b90)[_0xced3('0x3b')](function(_0x14dbfe){_0x2aa876[_0xced3('0x60')](_0xced3('0x61'),_0x14dbfe);_0x2aa876[_0xced3('0x62')](_0xced3('0x63'));})[_0xced3('0x3f')](function(_0x3e2a19){return _0x2aa876['status'](0x1f4)[_0xced3('0x64')](_0x3e2a19);});};exports['retrieveApiKey']=function(_0x466ffb){if(_[_0xced3('0x65')](_0x466ffb[_0xced3('0x66')])||_['isNil'](_0x466ffb['apiKeyIat'])){return null;}else{return createJwt(_0x466ffb);}};exports[_0xced3('0x67')]=function(_0x219a11){_0x219a11['apiKeyNonce']=generateNonce();_0x219a11[_0xced3('0x68')]=generateIssuedAt();return createJwt(_0x219a11);};exports['regenerateApiKey']=function(_0x3dba69,_0x3f9582){var _0x4f1860=_0x3dba69[_0xced3('0x4f')][_0xced3('0x4d')];if(_0x4f1860){var _0xf4d7bf={'nonce':_0x3f9582['apiKeyNonce'],'iat':_0x3f9582[_0xced3('0x68')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xced3('0x4e')]()};return verifyJwt(_0x4f1860,_0xf4d7bf)[_0xced3('0x3b')](function(){return generateApiKey(_0x3f9582);});}else{throw{'message':_0xced3('0x69')};}};exports[_0xced3('0x6a')]=function(_0x1c17a8){var _0xd3c7b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xd3c7b9[_0xced3('0x6b')](_0x1c17a8))throw new db[(_0xced3('0x6c'))][(_0xced3('0x6d'))](_0xced3('0x6e'));return;};exports[_0xced3('0x6f')]=function(_0x4b14dd,_0x3859e8,_0x3de35d){var _0x40a2a2=encryptor[_0xced3('0x70')](_0x3859e8)[_0xced3('0x71')](',');for(var _0xbad036=0x0;_0xbad036<_0x3de35d;_0xbad036++){if(!_0x40a2a2[_0xbad036])break;if(_0x4b14dd['toLowerCase']()===_0x40a2a2[_0xbad036][_0xced3('0x72')]()){var _0x171081=util[_0xced3('0x73')](_0xced3('0x74'),_0x3de35d);if(_0x3de35d===0x1){_0x171081=_0xced3('0x75');}throw new db[(_0xced3('0x6c'))]['ValidationError'](_0x171081);}}return;};exports[_0xced3('0x76')]=function(_0x53844d,_0xc0cd87){var _0x5d9813=_0xc0cd87?encryptor[_0xced3('0x70')](_0xc0cd87)[_0xced3('0x71')](','):[];if(_0x5d9813['length']===0x5){_0x5d9813[_0xced3('0x77')](-0x1,0x1);}_0x5d9813[_0xced3('0x78')](_0x53844d);return encryptor[_0xced3('0x79')](_0x5d9813[_0xced3('0x7a')](','));};function signJwt(_0x1ec94b){var _0x21eeec=BPromise[_0xced3('0x7b')](jwt[_0xced3('0x7c')],{'context':jwt});var _0x18fe01=_0x1ec94b[_0xced3('0x7d')]||config[_0xced3('0x7e')][_0xced3('0x7f')];return new BPromise(function(_0x38033f,_0x4dea99){_0x21eeec(_0x1ec94b[_0xced3('0x80')],_0x18fe01,_0x1ec94b[_0xced3('0x81')])[_0xced3('0x3b')](function(_0x353a8e){_0x38033f(_0x353a8e);})['catch'](function(_0x463ca4){_0x4dea99(_0x463ca4);});});}function verifyJwt(_0x979b24,_0x404241,_0x373f31){var _0x2a62f5=BPromise[_0xced3('0x7b')](jwt[_0xced3('0x82')],{'context':jwt});var _0x4df923=_0x373f31||config[_0xced3('0x7e')][_0xced3('0x7f')];return new BPromise(function(_0x5db4eb,_0x1630d7){_0x2a62f5(_0x979b24,_0x4df923,_0x404241)[_0xced3('0x3b')](function(_0x3a9dac){_0x5db4eb(_0x3a9dac);})[_0xced3('0x3f')](function(_0x58d7fc){_0x1630d7(_0x58d7fc);});});}function generateNonce(){return crypto[_0xced3('0x83')](0x10)[_0xced3('0x84')](_0xced3('0x85'));}function generateIssuedAt(){return Math[_0xced3('0x86')](Date[_0xced3('0x87')]()/0x3e8)[_0xced3('0x84')]();}function createJwt(_0x236445){var _0x3ad0e7={'payload':{'iat':_0x236445[_0xced3('0x68')],'nonce':_0x236445[_0xced3('0x66')]},'options':{'algorithm':'HS512','subject':_0x236445['id'][_0xced3('0x84')](),'issuer':hardwareConf[_0xced3('0x4e')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3ad0e7)['then'](function(_0xbec2b7){return{'iat':_0x236445['apiKeyIat'],'nonce':_0x236445[_0xced3('0x66')],'token':_0xbec2b7};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 78aea72..3e9acf9 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 _0x5481=['count','User','buildContactsQuery','rows','describe','CmContact','keys','startsWith','map','CmCustomField','findOne','slice','all','length','cf_','fieldType','type','catch','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','countFilteredContacts'];(function(_0x3d8d0e,_0x293e57){var _0x2f0bfd=function(_0x5ab970){while(--_0x5ab970){_0x3d8d0e['push'](_0x3d8d0e['shift']());}};_0x2f0bfd(++_0x293e57);}(_0x5481,0x1f3));var _0x1548=function(_0x474628,_0x34a081){_0x474628=_0x474628-0x0;var _0x1e7717=_0x5481[_0x474628];return _0x1e7717;};'use strict';var _=require(_0x1548('0x0'));var sqlUtils=require(_0x1548('0x1'));var db=require(_0x1548('0x2'))['db'];exports[_0x1548('0x3')]=function(_0x1fbe2a,_0x3078bf,_0x5a6278,_0x525e22){var _0x3a2848={'count':0x0,'rows':[]};var _0x47bd44=sqlUtils[_0x1548('0x4')](_0x3078bf,_0x1fbe2a);if(_0x47bd44){return Promise[_0x1548('0x5')](_0x3a2848);}var _0x564206=sqlUtils['getContactsSubquery']();var _0x525bf2={};var _0x440d5f=![];var _0x2e74b6=![];return Promise['resolve']()[_0x1548('0x6')](function(){if(_0x1fbe2a[_0x1548('0x7')]){return sqlUtils[_0x1548('0x8')](_0x1fbe2a['search'],_0x525e22);}else{return sqlUtils[_0x1548('0x9')](_0x1fbe2a,_0x525e22);}})['then'](function(_0x3c0b9c){_0x564206[_0x1548('0xa')](_0x3c0b9c[_0x1548('0xb')]);_0x564206['where'](_0x3c0b9c[_0x1548('0xc')]);_0x564206['where'](_0x3c0b9c[_0x1548('0xd')]);_0x564206[_0x1548('0xa')](_0x3c0b9c[_0x1548('0xe')][_0x1548('0xf')]);_0x525bf2=_0x3c0b9c[_0x1548('0x10')];_0x2e74b6=_0x3c0b9c[_0x1548('0xe')][_0x1548('0x11')];return sqlUtils['checkListsRestrictions'](_0x3078bf,_0x1fbe2a,_0x2e74b6);})[_0x1548('0x6')](function(_0x64de76){_0x564206['where'](_0x64de76);var _0x149bfc=_0x1fbe2a[_0x1548('0x7')]?_0x525bf2['ids']:_0x1fbe2a['tag'];_0x440d5f=_0x149bfc?!![]:![];return sqlUtils[_0x1548('0x12')](_0x564206,_0x149bfc);})[_0x1548('0x6')](function(_0x28ae39){_0x3a2848[_0x1548('0x13')]=_0x28ae39;if(_0x3a2848[_0x1548('0x13')]===0x0){return;}if(_0x1fbe2a[_0x1548('0x14')]){_0x2e74b6=!![];}return sqlUtils[_0x1548('0x15')](_0x564206,_0x1fbe2a[_0x1548('0xc')],_0x5a6278,_0x440d5f,_0x525bf2[_0x1548('0xf')],_0x2e74b6);})['then'](function(_0x541d5d){if(!_0x541d5d){return[];}return sqlUtils['getFilteredContacts'](_0x541d5d,_0x1fbe2a,_0x5a6278);})[_0x1548('0x6')](function(_0x524b50){_0x3a2848[_0x1548('0x16')]=_0x524b50;return _0x3a2848;})['catch'](function(_0x3a253c){throw _0x3a253c;});};exports[_0x1548('0x17')]=function(){var _0x1725a9={};var _0x52e47e=[];return db[_0x1548('0x18')][_0x1548('0x17')]()[_0x1548('0x6')](function(_0x288eab){_0x1725a9=_0x288eab;var _0x1b4f1b=Object[_0x1548('0x19')](_0x1725a9)[_0x1548('0xd')](function(_0x40631f){return _[_0x1548('0x1a')](_0x40631f,'cf_')?_0x40631f:undefined;});var _0x2a817a=_0x1b4f1b[_0x1548('0x1b')](function(_0x24824b){return db[_0x1548('0x1c')][_0x1548('0x1d')]({'where':{'id':_0x24824b[_0x1548('0x1e')](0x3)},'raw':!![]});});return Promise[_0x1548('0x1f')](_0x2a817a);})['then'](function(_0x4390eb){for(var _0x323d8d=0x0;_0x323d8d<_0x4390eb[_0x1548('0x20')];_0x323d8d++){if(_0x4390eb[_0x323d8d]){var _0x21fc8e=_0x1548('0x21')+_0x4390eb[_0x323d8d]['id'];_0x1725a9[_0x21fc8e][_0x1548('0x22')]=_0x4390eb[_0x323d8d][_0x1548('0x23')];}}_0x52e47e=_[_0x1548('0x1b')](Object[_0x1548('0x19')](_0x1725a9),function(_0x3375e7){return{'name':_0x3375e7,'type':_0x1725a9[_0x3375e7][_0x1548('0x23')]};});return _0x52e47e;})[_0x1548('0x24')](function(_0x544864){throw _0x544864;});}; \ No newline at end of file +var _0xc4f0=['findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','tag','count','User','getFilteredContacts','rows','catch','describe','keys','cf_','CmCustomField','findOne','slice','all','length','fieldType','type','map','../../mysqldb'];(function(_0x57f2ea,_0x513dad){var _0x325f7c=function(_0x41ad0f){while(--_0x41ad0f){_0x57f2ea['push'](_0x57f2ea['shift']());}};_0x325f7c(++_0x513dad);}(_0xc4f0,0x1e9));var _0x0c4f=function(_0x4803c4,_0x419b99){_0x4803c4=_0x4803c4-0x0;var _0x499d8d=_0xc4f0[_0x4803c4];return _0x499d8d;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0x0c4f('0x0'))['db'];exports[_0x0c4f('0x1')]=function(_0x488db0,_0x1b07b1,_0x21b9f1,_0x2283ed){var _0x3e5879={'count':0x0,'rows':[]};var _0x2c06ac=sqlUtils['skipContactsQuery'](_0x1b07b1,_0x488db0);if(_0x2c06ac){return Promise[_0x0c4f('0x2')](_0x3e5879);}var _0x1ba0c5=sqlUtils[_0x0c4f('0x3')]();var _0x323bb1={};var _0x4453ef=![];var _0x5caa6c=![];return Promise[_0x0c4f('0x2')]()[_0x0c4f('0x4')](function(){if(_0x488db0[_0x0c4f('0x5')]){return sqlUtils[_0x0c4f('0x6')](_0x488db0[_0x0c4f('0x5')],_0x2283ed);}else{return sqlUtils[_0x0c4f('0x7')](_0x488db0,_0x2283ed);}})['then'](function(_0x3aab58){_0x1ba0c5[_0x0c4f('0x8')](_0x3aab58[_0x0c4f('0x9')]);_0x1ba0c5[_0x0c4f('0x8')](_0x3aab58[_0x0c4f('0xa')]);_0x1ba0c5[_0x0c4f('0x8')](_0x3aab58[_0x0c4f('0xb')]);_0x1ba0c5[_0x0c4f('0x8')](_0x3aab58[_0x0c4f('0xc')][_0x0c4f('0xd')]);_0x323bb1=_0x3aab58[_0x0c4f('0xe')];_0x5caa6c=_0x3aab58[_0x0c4f('0xc')][_0x0c4f('0xf')];return sqlUtils[_0x0c4f('0x10')](_0x1b07b1,_0x488db0,_0x5caa6c);})[_0x0c4f('0x4')](function(_0x499b9e){_0x1ba0c5['where'](_0x499b9e);var _0x2a73cb=_0x488db0[_0x0c4f('0x5')]?_0x323bb1[_0x0c4f('0x11')]:_0x488db0[_0x0c4f('0x12')];_0x4453ef=_0x2a73cb?!![]:![];return sqlUtils['countFilteredContacts'](_0x1ba0c5,_0x2a73cb);})[_0x0c4f('0x4')](function(_0x22a90b){_0x3e5879['count']=_0x22a90b;if(_0x3e5879[_0x0c4f('0x13')]===0x0){return;}if(_0x488db0[_0x0c4f('0x14')]){_0x5caa6c=!![];}return sqlUtils['buildContactsQuery'](_0x1ba0c5,_0x488db0['fields'],_0x21b9f1,_0x4453ef,_0x323bb1[_0x0c4f('0xd')],_0x5caa6c);})[_0x0c4f('0x4')](function(_0x475d73){if(!_0x475d73){return[];}return sqlUtils[_0x0c4f('0x15')](_0x475d73,_0x488db0,_0x21b9f1);})[_0x0c4f('0x4')](function(_0x366d8f){_0x3e5879[_0x0c4f('0x16')]=_0x366d8f;return _0x3e5879;})[_0x0c4f('0x17')](function(_0x490b78){throw _0x490b78;});};exports[_0x0c4f('0x18')]=function(){var _0x24874f={};var _0x56da5c=[];return db['CmContact'][_0x0c4f('0x18')]()[_0x0c4f('0x4')](function(_0x4c3609){_0x24874f=_0x4c3609;var _0x288c45=Object[_0x0c4f('0x19')](_0x24874f)['filter'](function(_0x188b1a){return _['startsWith'](_0x188b1a,_0x0c4f('0x1a'))?_0x188b1a:undefined;});var _0x2016c0=_0x288c45['map'](function(_0x1f48ad){return db[_0x0c4f('0x1b')][_0x0c4f('0x1c')]({'where':{'id':_0x1f48ad[_0x0c4f('0x1d')](0x3)},'raw':!![]});});return Promise[_0x0c4f('0x1e')](_0x2016c0);})[_0x0c4f('0x4')](function(_0x43c475){for(var _0x26e2d6=0x0;_0x26e2d6<_0x43c475[_0x0c4f('0x1f')];_0x26e2d6++){if(_0x43c475[_0x26e2d6]){var _0x5110f2=_0x0c4f('0x1a')+_0x43c475[_0x26e2d6]['id'];_0x24874f[_0x5110f2][_0x0c4f('0x20')]=_0x43c475[_0x26e2d6][_0x0c4f('0x21')];}}_0x56da5c=_[_0x0c4f('0x22')](Object['keys'](_0x24874f),function(_0x4c1f10){return{'name':_0x4c1f10,'type':_0x24874f[_0x4c1f10]['type']};});return _0x56da5c;})[_0x0c4f('0x17')](function(_0x2fd922){throw _0x2fd922;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 9c50b58..f7f0dd9 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 _0xefa8=['find','dateOfBirth','fieldType','datetime','castTo','DATE','type','default','start','value','end','map','tags','clause','and','user','skip','keys','some','Contact','User','c.ListId\x20IN\x20?','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','tag','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','name','Sequelize','QueryTypes','sequelize','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xefa8,0x109));var _0x8efa=function(_0x5d3c08,_0x1912ec){_0x5d3c08=_0x5d3c08-0x0;var _0x1cefb7=_0xefa8[_0x5d3c08];return _0x1cefb7;};'use strict';var _=require('lodash');var squel=require(_0x8efa('0x0'));var as=require(_0x8efa('0x1'));var qs=require(_0x8efa('0x2'));var utils=require(_0x8efa('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x347f00,_0x4a7460){var _0x3cbd9e=![];if(_0x347f00[_0x8efa('0x4')]===_0x8efa('0x5')&&!_0x4a7460[_0x8efa('0x6')]&&!_0x4a7460[_0x8efa('0x7')]&&_0x4a7460[_0x8efa('0x8')]!==_0x8efa('0x9')){_0x3cbd9e=!![];}return _0x3cbd9e;}function getContactsSubquery(){return squel[_0x8efa('0xa')]()[_0x8efa('0xb')](_0x8efa('0xc'),'c')[_0x8efa('0xd')](_0x8efa('0xe'));}function applyJoinClauses(_0x480bfb,_0x2cb4bd){var _0x1c27b6=_0x2cb4bd?'c':_0x8efa('0xf');_0x480bfb[_0x8efa('0x10')](_0x8efa('0x11'),'uc','uc.CmContactId\x20=\x20'+_0x1c27b6+_0x8efa('0x12'))['left_join'](_0x8efa('0x13'),'ct',_0x8efa('0x14')+_0x1c27b6+_0x8efa('0x12'))[_0x8efa('0x10')](_0x8efa('0x15'),'t',_0x8efa('0x16'));return _0x480bfb;}function addFieldsToQuery(_0x2c3574,_0x56b746,_0x415824,_0x183396,_0x56e058){var _0x2e32c1=_0x56e058?'c':_0x8efa('0xf');if(!_0x56b746){_0x56b746=['id','firstName',_0x8efa('0x17'),_0x8efa('0x18'),_0x8efa('0x19'),_0x8efa('0x1a'),'email','ListId',_0x8efa('0x1b'),_0x8efa('0x1c'),_0x8efa('0x1d'),_0x8efa('0x1e'),_0x8efa('0x1f')];}else if(!_0x56b746[_0x8efa('0x20')]('id')){_0x56b746[_0x8efa('0x21')]('id');}var _0x4c75de=_0x415824&&_0x56e058||!_0x415824&&!_0x56e058;if(_0x183396){_0x4c75de=_0x183396&&_0x56e058||!_0x183396&&!_0x56e058;}_0x56b746[_0x8efa('0x22')](function(_0x540aac){if(_0x540aac===_0x8efa('0x1f')){if(_0x4c75de){_0x2c3574[_0x8efa('0x23')](_0x8efa('0x24'),_0x540aac);}else if(_0x415824||_0x183396){_0x2c3574[_0x8efa('0x23')](_0x2e32c1+'.'+_0x540aac);}}else{_0x2c3574[_0x8efa('0x23')](_0x2e32c1+'.'+_0x540aac);}});return _0x2c3574;}function getSqlClauses(){var _0x164baf={'default':squel['expr'](),'fields':squel[_0x8efa('0x25')](),'filter':squel[_0x8efa('0x25')](),'tags':{'clause':squel[_0x8efa('0x25')](),'ids':null},'user':{'clause':squel[_0x8efa('0x25')](),'skip':![]}};return _0x164baf;}function parseTagParameter(_0x498892){var _0x35ec68=squel[_0x8efa('0x25')]();if(_0x498892){var _0x2815b8=utils[_0x8efa('0x26')](_0x498892);_0x2815b8[_0x8efa('0x22')](function(_0x31d1df){_0x35ec68['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x31d1df+',%');});}return _0x35ec68;}function parseSearchFilter(_0x5575f8){var _0x22c919=squel[_0x8efa('0x25')]();if(_0x5575f8){var _0x5d7632=_0x5575f8[_0x8efa('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x5d7632[_0x8efa('0x28')]('\x20')[_0x8efa('0x29')]>0x1){_0x22c919['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5d7632,!![]),null);}else{if(qs[_0x8efa('0x2a')](_0x5d7632)){_0x22c919['or'](_0x8efa('0x2b'),_0x5d7632+'%');_0x22c919['or'](_0x8efa('0x2c'),_0x5d7632+'%');_0x22c919['or'](_0x8efa('0x2d'),_0x5d7632+'%');_0x22c919['or']('c.fax\x20LIKE\x20?',_0x5d7632+'%');}else if(qs[_0x8efa('0x2e')](_0x5d7632)){_0x22c919['or']('c.email\x20LIKE\x20?',_0x5d7632+'%');}else{_0x22c919['or'](_0x8efa('0x2f'),'%'+_0x5d7632+'%');_0x22c919['or'](_0x8efa('0x30'),'%'+_0x5d7632+'%');_0x22c919['or'](_0x8efa('0x31'),'%'+_0x5d7632+'%');}}}return _0x22c919;}function parseAdvancedSearchFilter(_0x484c23,_0x1918b4){var _0x2bdc9c=getSqlClauses();var _0x24bae3=as[_0x8efa('0x32')](_0x484c23);var _0x16fde7=_0x24bae3[_0x8efa('0x33')];for(var _0xa2596b=0x0;_0xa2596b<_0x24bae3[_0x8efa('0x34')]['length'];_0xa2596b++){var _0x521b51=_0x24bae3['conditions'][_0xa2596b];var _0x364008='c';var _0x2dea14=_[_0x8efa('0x35')](_0x1918b4,['name',_0x521b51[_0x8efa('0x23')]]);if(_0x2dea14){if(_0x521b51[_0x8efa('0x23')]===_0x8efa('0x36')||_0x2dea14[_0x8efa('0x37')]===_0x8efa('0x38')){_0x521b51[_0x8efa('0x39')]=_0x8efa('0x3a');}var _0x3a4224=as['buildExpression'](_0x364008,_0x2dea14[_0x8efa('0x3b')],_0x521b51);_0x2bdc9c[_0x8efa('0x3c')][_0x16fde7](_0x3a4224['text'],_0x3a4224['value'][_0x8efa('0x3d')],_0x3a4224[_0x8efa('0x3e')][_0x8efa('0x3f')]);}else{if(_0x521b51[_0x8efa('0x23')]==='Tag'){var _0xef98f5=_0x521b51['value'][_0x8efa('0x28')](',')[_0x8efa('0x40')](function(_0x4d026b){return Number(_0x4d026b);});var _0x25a977=parseTagParameter(_0xef98f5);_0x2bdc9c[_0x8efa('0x41')][_0x8efa('0x42')][_0x8efa('0x43')](_0x25a977);_0x2bdc9c['tags']['ids']=_0xef98f5;}else if(_0x521b51['field']==='User'){_0x2bdc9c[_0x8efa('0x44')][_0x8efa('0x42')][_0x8efa('0x43')]('uc.UserId\x20=\x20?',_0x521b51[_0x8efa('0x3e')]);_0x2bdc9c[_0x8efa('0x44')][_0x8efa('0x45')]=!![];}}}return _0x2bdc9c;}function parseModelFields(_0x5c7f19,_0x6953d6){var _0x208704=squel['expr']();var _0x45ebec=_(_0x5c7f19)[_0x8efa('0x46')]()['map'](function(_0x27b373){return _[_0x8efa('0x47')](_0x6953d6,['name',_0x27b373])?_0x27b373:undefined;})['compact']()[_0x8efa('0x3e')]();if(_0x5c7f19[_0x8efa('0x48')]){_0x45ebec[_0x8efa('0x21')](_0x8efa('0x48'));}if(_0x5c7f19[_0x8efa('0x49')]){_0x45ebec[_0x8efa('0x21')]('User');}if(_0x45ebec['length']>0x0){_0x45ebec[_0x8efa('0x22')](function(_0x58fc67){if(_0x58fc67===_0x8efa('0x7')){_0x208704[_0x8efa('0x43')](_0x8efa('0x4a'),[]['concat'](_0x5c7f19[_0x58fc67]));}else if(_0x58fc67===_0x8efa('0x48')){var _0x32875d='%'+_0x5c7f19[_0x58fc67]+'%';_0x208704['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x32875d);}else if(_0x58fc67==='User'){_0x208704['and'](_0x8efa('0x4b'),_0x5c7f19[_0x58fc67]);}else{_0x208704['and']('c.'+_0x58fc67+_0x8efa('0x4c'),_0x5c7f19[_0x58fc67]);}});}return _0x208704;}function parseQueryParameters(_0x2970c2,_0x3dd45d){var _0x942996=getSqlClauses();return Promise[_0x8efa('0x4d')]()[_0x8efa('0x4e')](function(){return parseModelFields(_0x2970c2,_0x3dd45d);})[_0x8efa('0x4e')](function(_0x437f3b){_0x942996[_0x8efa('0x4f')][_0x8efa('0x43')](_0x437f3b);return parseTagParameter(_0x2970c2[_0x8efa('0x50')]);})[_0x8efa('0x4e')](function(_0x480c13){_0x942996[_0x8efa('0x41')][_0x8efa('0x42')][_0x8efa('0x43')](_0x480c13);return parseSearchFilter(_0x2970c2['filter']);})['then'](function(_0x20d65f){_0x942996['filter']=_0x20d65f;return _0x942996;});}function checkListsRestrictions(_0x25e5e9,_0x4683cc,_0x5aa855){var _0x505811=squel['expr']();return Promise[_0x8efa('0x4d')]()['then'](function(){if(_0x4683cc[_0x8efa('0x6')]&&_0x25e5e9[_0x8efa('0x4')]===_0x8efa('0x5')&&!_0x5aa855){return _0x25e5e9['getLists']({'attributes':['id'],'raw':!![]});}})[_0x8efa('0x4e')](function(_0x22f384){if(_0x22f384){if(_0x22f384[_0x8efa('0x29')]===0x0){_0x505811[_0x8efa('0x43')](_0x8efa('0x51'));}else{_0x505811[_0x8efa('0x43')](_0x8efa('0x4a'),_[_0x8efa('0x40')](_0x22f384,'id'));}}})[_0x8efa('0x4e')](function(){return _0x505811;});}function buildContactsQuery(_0x460470,_0x3ffbcc,_0x1b1b55,_0x476f85,_0x204d0a,_0x493f47){if(_0x3ffbcc){_0x3ffbcc=_0x1b1b55[_0x8efa('0x52')];}_0x460470=addFieldsToQuery(_0x460470,_0x3ffbcc,_0x476f85,_0x493f47,!![]);var _0x34ccc0=squel[_0x8efa('0xa')]();_0x34ccc0=addFieldsToQuery(_0x34ccc0,_0x3ffbcc,_0x476f85,_0x493f47,![]);if(_0x476f85||_0x493f47){_0x460470=applyJoinClauses(_0x460470,!![]);_0x460470[_0x8efa('0x53')](_0x8efa('0x54'));if(_0x1b1b55[_0x8efa('0x55')]){_0x34ccc0['limit'](_0x1b1b55[_0x8efa('0x55')]);}if(_0x1b1b55['offset']){_0x34ccc0[_0x8efa('0x56')](_0x1b1b55[_0x8efa('0x56')]);}}else{_0x34ccc0=applyJoinClauses(_0x34ccc0,![]);_0x34ccc0[_0x8efa('0x53')](_0x8efa('0x57'));if(_0x1b1b55[_0x8efa('0x55')]){_0x460470[_0x8efa('0x55')](_0x1b1b55[_0x8efa('0x55')]);}if(_0x1b1b55['offset']){_0x460470[_0x8efa('0x56')](_0x1b1b55['offset']);}}_0x34ccc0[_0x8efa('0x58')](_0x204d0a);if(_0x1b1b55[_0x8efa('0x59')]){_0x1b1b55[_0x8efa('0x59')][_0x8efa('0x22')](function(_0x5f0136){_0x460470[_0x8efa('0x59')]('c.'+_0x5f0136[0x0],_0x5f0136[0x1]===_0x8efa('0x5a')?![]:!![]);_0x34ccc0[_0x8efa('0x59')](_0x8efa('0x5b')+_0x5f0136[0x0],_0x5f0136[0x1]==='DESC'?![]:!![]);});}_0x34ccc0[_0x8efa('0xb')](_0x460470,_0x8efa('0xf'));return _0x34ccc0;}function getFilteredContacts(_0x394332){var _0x5c42ff=[];return db[_0x8efa('0x5c')][_0x8efa('0x5d')]({'attributes':['id',_0x8efa('0x5e'),'color'],'raw':!![]})[_0x8efa('0x4e')](function(_0x5320bc){_0x5c42ff=_['keyBy'](_0x5320bc,'id');var _0x2e992f={'type':db[_0x8efa('0x5f')][_0x8efa('0x60')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8efa('0x61')][_0x8efa('0x62')](_0x394332[_0x8efa('0x63')](),_0x2e992f);})['then'](function(_0x51b6a2){_0x51b6a2[_0x8efa('0x22')](function(_0x41af51){if(_0x41af51[_0x8efa('0x1f')]){_0x41af51['Tags']=[];_0x41af51['TagIds'][_0x8efa('0x28')](',')[_0x8efa('0x22')](function(_0x59194a){_0x41af51[_0x8efa('0x64')]['push'](_0x5c42ff[_0x59194a]);});}delete _0x41af51['TagIds'];});return _0x51b6a2;});}function countFilteredContacts(_0x17c48c,_0x56fe9f){var _0x413786=_0x17c48c['clone']();_0x413786['field'](_0x8efa('0x65'));_0x413786=applyJoinClauses(_0x413786,!![]);_0x17c48c[_0x8efa('0x53')]('c.id');var _0x2cb78c=utils['getSelectedTags'](_0x56fe9f);if(!_[_0x8efa('0x66')](_0x2cb78c)){_0x413786[_0x8efa('0xd')](_0x8efa('0x67'),_0x2cb78c);}var _0x4cae9c={'type':db[_0x8efa('0x5f')]['QueryTypes'][_0x8efa('0x68')],'raw':!![]};return db['sequelize'][_0x8efa('0x62')](_0x413786['toString'](),_0x4cae9c)['then'](function(_0x3fcbf5){return _0x3fcbf5[0x0][_0x8efa('0x65')];});}module[_0x8efa('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x55d3=['\x20=\x20?','resolve','then','fields','tag','filter','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','Tags','clone','COUNT(*)','toString','exports','lodash','squel','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','from','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','lastName','mobile','fax','email','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','datetime','castTo','DATE','buildExpression','type','default','text','value','end','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','concat'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x55d3,0x1aa));var _0x355d=function(_0x248fc3,_0x49ff02){_0x248fc3=_0x248fc3-0x0;var _0x4e4ead=_0x55d3[_0x248fc3];return _0x4e4ead;};'use strict';var _=require(_0x355d('0x0'));var squel=require(_0x355d('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x355d('0x2'));var utils=require(_0x355d('0x3'));var db=require(_0x355d('0x4'))['db'];function skipContactsQuery(_0x3a08d6,_0x4ce1e7){var _0x161754=![];if(_0x3a08d6[_0x355d('0x5')]===_0x355d('0x6')&&!_0x4ce1e7[_0x355d('0x7')]&&!_0x4ce1e7[_0x355d('0x8')]&&_0x4ce1e7[_0x355d('0x9')]!=='true'){_0x161754=!![];}return _0x161754;}function getContactsSubquery(){return squel['select']()[_0x355d('0xa')]('cm_contacts','c')[_0x355d('0xb')](_0x355d('0xc'));}function applyJoinClauses(_0x47458f,_0x444ac1){var _0x1b82c6=_0x444ac1?'c':_0x355d('0xd');_0x47458f[_0x355d('0xe')]('cm_user_has_contacts','uc',_0x355d('0xf')+_0x1b82c6+'.id')[_0x355d('0xe')](_0x355d('0x10'),'ct',_0x355d('0x11')+_0x1b82c6+'.id')['left_join']('tools_tags','t',_0x355d('0x12'));return _0x47458f;}function addFieldsToQuery(_0x2332b0,_0x40f5d6,_0x8ca907,_0x567296,_0x189c51){var _0x6efae1=_0x189c51?'c':_0x355d('0xd');if(!_0x40f5d6){_0x40f5d6=['id','firstName',_0x355d('0x13'),'phone',_0x355d('0x14'),_0x355d('0x15'),_0x355d('0x16'),'ListId','CompanyId','createdAt','updatedAt','deletedAt','TagIds'];}else if(!_0x40f5d6['includes']('id')){_0x40f5d6[_0x355d('0x17')]('id');}var _0x734592=_0x8ca907&&_0x189c51||!_0x8ca907&&!_0x189c51;if(_0x567296){_0x734592=_0x567296&&_0x189c51||!_0x567296&&!_0x189c51;}_0x40f5d6[_0x355d('0x18')](function(_0x19f912){if(_0x19f912===_0x355d('0x19')){if(_0x734592){_0x2332b0[_0x355d('0x1a')](_0x355d('0x1b'),_0x19f912);}else if(_0x8ca907||_0x567296){_0x2332b0[_0x355d('0x1a')](_0x6efae1+'.'+_0x19f912);}}else{_0x2332b0[_0x355d('0x1a')](_0x6efae1+'.'+_0x19f912);}});return _0x2332b0;}function getSqlClauses(){var _0x43906d={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x355d('0x1c')](),'ids':null},'user':{'clause':squel[_0x355d('0x1c')](),'skip':![]}};return _0x43906d;}function parseTagParameter(_0x8a9236){var _0x38ebe6=squel[_0x355d('0x1c')]();if(_0x8a9236){var _0x4b14c7=utils[_0x355d('0x1d')](_0x8a9236);_0x4b14c7['forEach'](function(_0xb4ecb6){_0x38ebe6['or'](_0x355d('0x1e'),'%,'+_0xb4ecb6+',%');});}return _0x38ebe6;}function parseSearchFilter(_0xfeb61b){var _0x4d7c2c=squel['expr']();if(_0xfeb61b){var _0x31dd24=_0xfeb61b[_0x355d('0x1f')]('\x5c','\x5c\x5c')[_0x355d('0x1f')](/'/g,'\x27\x27');if(_0x31dd24[_0x355d('0x20')]('\x20')[_0x355d('0x21')]>0x1){_0x4d7c2c['or'](_0x355d('0x22'),qs['getFullTextValue'](_0x31dd24,!![]),null);}else{if(qs[_0x355d('0x23')](_0x31dd24)){_0x4d7c2c['or']('c.id\x20LIKE\x20?',_0x31dd24+'%');_0x4d7c2c['or'](_0x355d('0x24'),_0x31dd24+'%');_0x4d7c2c['or']('c.mobile\x20LIKE\x20?',_0x31dd24+'%');_0x4d7c2c['or']('c.fax\x20LIKE\x20?',_0x31dd24+'%');}else if(qs[_0x355d('0x25')](_0x31dd24)){_0x4d7c2c['or'](_0x355d('0x26'),_0x31dd24+'%');}else{_0x4d7c2c['or'](_0x355d('0x27'),'%'+_0x31dd24+'%');_0x4d7c2c['or'](_0x355d('0x28'),'%'+_0x31dd24+'%');_0x4d7c2c['or'](_0x355d('0x26'),'%'+_0x31dd24+'%');}}}return _0x4d7c2c;}function parseAdvancedSearchFilter(_0x15c278,_0x4964d2){var _0x1fba12=getSqlClauses();var _0x213e29=as['parseSearch'](_0x15c278);var _0xf07bb7=_0x213e29[_0x355d('0x29')];for(var _0x58e8ea=0x0;_0x58e8ea<_0x213e29[_0x355d('0x2a')][_0x355d('0x21')];_0x58e8ea++){var _0x17d652=_0x213e29[_0x355d('0x2a')][_0x58e8ea];var _0x3bfe7f='c';var _0x5a0570=_[_0x355d('0x2b')](_0x4964d2,[_0x355d('0x2c'),_0x17d652[_0x355d('0x1a')]]);if(_0x5a0570){if(_0x17d652[_0x355d('0x1a')]==='dateOfBirth'||_0x5a0570['fieldType']===_0x355d('0x2d')){_0x17d652[_0x355d('0x2e')]=_0x355d('0x2f');}var _0x34c645=as[_0x355d('0x30')](_0x3bfe7f,_0x5a0570[_0x355d('0x31')],_0x17d652);_0x1fba12[_0x355d('0x32')][_0xf07bb7](_0x34c645[_0x355d('0x33')],_0x34c645[_0x355d('0x34')]['start'],_0x34c645[_0x355d('0x34')][_0x355d('0x35')]);}else{if(_0x17d652[_0x355d('0x1a')]===_0x355d('0x36')){var _0x2f6b4e=_0x17d652[_0x355d('0x34')][_0x355d('0x20')](',')[_0x355d('0x37')](function(_0x1decff){return Number(_0x1decff);});var _0x52204d=parseTagParameter(_0x2f6b4e);_0x1fba12[_0x355d('0x38')][_0x355d('0x39')][_0x355d('0x3a')](_0x52204d);_0x1fba12[_0x355d('0x38')][_0x355d('0x3b')]=_0x2f6b4e;}else if(_0x17d652[_0x355d('0x1a')]===_0x355d('0x3c')){_0x1fba12[_0x355d('0x3d')][_0x355d('0x39')][_0x355d('0x3a')](_0x355d('0x3e'),_0x17d652[_0x355d('0x34')]);_0x1fba12[_0x355d('0x3d')][_0x355d('0x3f')]=!![];}}}return _0x1fba12;}function parseModelFields(_0x5e5d3e,_0x5e7742){var _0x1af972=squel[_0x355d('0x1c')]();var _0x10d3f5=_(_0x5e5d3e)[_0x355d('0x40')]()[_0x355d('0x37')](function(_0x26020b){return _[_0x355d('0x41')](_0x5e7742,[_0x355d('0x2c'),_0x26020b])?_0x26020b:undefined;})['compact']()['value']();if(_0x5e5d3e[_0x355d('0x42')]){_0x10d3f5[_0x355d('0x17')]('Contact');}if(_0x5e5d3e['User']){_0x10d3f5[_0x355d('0x17')](_0x355d('0x3c'));}if(_0x10d3f5[_0x355d('0x21')]>0x0){_0x10d3f5[_0x355d('0x18')](function(_0x380cf8){if(_0x380cf8===_0x355d('0x8')){_0x1af972[_0x355d('0x3a')](_0x355d('0x43'),[][_0x355d('0x44')](_0x5e5d3e[_0x380cf8]));}else if(_0x380cf8===_0x355d('0x42')){var _0x248f34='%'+_0x5e5d3e[_0x380cf8]+'%';_0x1af972[_0x355d('0x3a')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x248f34);}else if(_0x380cf8===_0x355d('0x3c')){_0x1af972[_0x355d('0x3a')]('uc.UserId\x20=\x20?',_0x5e5d3e[_0x380cf8]);}else{_0x1af972['and']('c.'+_0x380cf8+_0x355d('0x45'),_0x5e5d3e[_0x380cf8]);}});}return _0x1af972;}function parseQueryParameters(_0x406d66,_0x3aa945){var _0x4b0c57=getSqlClauses();return Promise[_0x355d('0x46')]()[_0x355d('0x47')](function(){return parseModelFields(_0x406d66,_0x3aa945);})[_0x355d('0x47')](function(_0x5c3923){_0x4b0c57[_0x355d('0x48')]['and'](_0x5c3923);return parseTagParameter(_0x406d66[_0x355d('0x49')]);})[_0x355d('0x47')](function(_0x2a4836){_0x4b0c57[_0x355d('0x38')][_0x355d('0x39')][_0x355d('0x3a')](_0x2a4836);return parseSearchFilter(_0x406d66[_0x355d('0x4a')]);})[_0x355d('0x47')](function(_0x3810a3){_0x4b0c57[_0x355d('0x4a')]=_0x3810a3;return _0x4b0c57;});}function checkListsRestrictions(_0x5f14f2,_0x4c4042,_0x1e8534){var _0x5582e8=squel[_0x355d('0x1c')]();return Promise[_0x355d('0x46')]()[_0x355d('0x47')](function(){if(_0x4c4042[_0x355d('0x7')]&&_0x5f14f2[_0x355d('0x5')]==='agent'&&!_0x1e8534){return _0x5f14f2['getLists']({'attributes':['id'],'raw':!![]});}})[_0x355d('0x47')](function(_0x2dfef9){if(_0x2dfef9){if(_0x2dfef9[_0x355d('0x21')]===0x0){_0x5582e8[_0x355d('0x3a')](_0x355d('0x4b'));}else{_0x5582e8[_0x355d('0x3a')]('c.ListId\x20IN\x20?',_['map'](_0x2dfef9,'id'));}}})[_0x355d('0x47')](function(){return _0x5582e8;});}function buildContactsQuery(_0x8cf8e4,_0x44431b,_0x172e40,_0x274af5,_0x31a248,_0x346942){if(_0x44431b){_0x44431b=_0x172e40[_0x355d('0x4c')];}_0x8cf8e4=addFieldsToQuery(_0x8cf8e4,_0x44431b,_0x274af5,_0x346942,!![]);var _0x56d92e=squel['select']();_0x56d92e=addFieldsToQuery(_0x56d92e,_0x44431b,_0x274af5,_0x346942,![]);if(_0x274af5||_0x346942){_0x8cf8e4=applyJoinClauses(_0x8cf8e4,!![]);_0x8cf8e4[_0x355d('0x4d')](_0x355d('0x4e'));if(_0x172e40[_0x355d('0x4f')]){_0x56d92e[_0x355d('0x4f')](_0x172e40[_0x355d('0x4f')]);}if(_0x172e40[_0x355d('0x50')]){_0x56d92e[_0x355d('0x50')](_0x172e40[_0x355d('0x50')]);}}else{_0x56d92e=applyJoinClauses(_0x56d92e,![]);_0x56d92e[_0x355d('0x4d')]('subqry.id');if(_0x172e40[_0x355d('0x4f')]){_0x8cf8e4['limit'](_0x172e40[_0x355d('0x4f')]);}if(_0x172e40['offset']){_0x8cf8e4[_0x355d('0x50')](_0x172e40['offset']);}}_0x56d92e[_0x355d('0x51')](_0x31a248);if(_0x172e40['order']){_0x172e40[_0x355d('0x52')][_0x355d('0x18')](function(_0xc511aa){_0x8cf8e4[_0x355d('0x52')]('c.'+_0xc511aa[0x0],_0xc511aa[0x1]===_0x355d('0x53')?![]:!![]);_0x56d92e[_0x355d('0x52')](_0x355d('0x54')+_0xc511aa[0x0],_0xc511aa[0x1]==='DESC'?![]:!![]);});}_0x56d92e[_0x355d('0xa')](_0x8cf8e4,_0x355d('0xd'));return _0x56d92e;}function getFilteredContacts(_0x4769f7){var _0x40c0d9=[];return db['Tag'][_0x355d('0x55')]({'attributes':['id',_0x355d('0x2c'),_0x355d('0x56')],'raw':!![]})[_0x355d('0x47')](function(_0x18172e){_0x40c0d9=_[_0x355d('0x57')](_0x18172e,'id');var _0x41d0e0={'type':db[_0x355d('0x58')][_0x355d('0x59')][_0x355d('0x5a')],'model':db[_0x355d('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x355d('0x5c')][_0x355d('0x5d')](_0x4769f7['toString'](),_0x41d0e0);})['then'](function(_0xb3a43d){_0xb3a43d[_0x355d('0x18')](function(_0x5613f2){if(_0x5613f2['TagIds']){_0x5613f2[_0x355d('0x5e')]=[];_0x5613f2[_0x355d('0x19')][_0x355d('0x20')](',')['forEach'](function(_0xcbba43){_0x5613f2[_0x355d('0x5e')][_0x355d('0x17')](_0x40c0d9[_0xcbba43]);});}delete _0x5613f2[_0x355d('0x19')];});return _0xb3a43d;});}function countFilteredContacts(_0x3a9263,_0x1e736f){var _0x266de2=_0x3a9263[_0x355d('0x5f')]();_0x266de2[_0x355d('0x1a')](_0x355d('0x60'));_0x266de2=applyJoinClauses(_0x266de2,!![]);_0x3a9263[_0x355d('0x4d')](_0x355d('0x4e'));var _0x33e6e7=utils['getSelectedTags'](_0x1e736f);if(!_['isEmpty'](_0x33e6e7)){_0x266de2[_0x355d('0xb')]('t.id\x20IN\x20?',_0x33e6e7);}var _0xd0f854={'type':db[_0x355d('0x58')][_0x355d('0x59')]['SELECT'],'raw':!![]};return db[_0x355d('0x5c')][_0x355d('0x5d')](_0x266de2[_0x355d('0x61')](),_0xd0f854)['then'](function(_0x1c2e7a){return _0x1c2e7a[0x0]['COUNT(*)'];});}module[_0x355d('0x62')]={'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 f66240a..10ebf93 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 _0x009b=['unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final','write','close'];(function(_0x2a8e66,_0x10592f){var _0x5bda1b=function(_0x568ff6){while(--_0x568ff6){_0x2a8e66['push'](_0x2a8e66['shift']());}};_0x5bda1b(++_0x10592f);}(_0x009b,0xad));var _0xb009=function(_0x25106c,_0x3106c0){_0x25106c=_0x25106c-0x0;var _0x1b3542=_0x009b[_0x25106c];return _0x1b3542;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xb009('0x0'));var _=require(_0xb009('0x1'));var config=require('../../config/environment');var logger=require(_0xb009('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb009('0x3')][_0xb009('0x4')],'algorithm':_0xb009('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xb009('0x6')]&&config[_0xb009('0x6')][_0xb009('0x7')]){var isSupported=isAlgorithmSupported(config[_0xb009('0x6')]['algorithm']);if(isSupported){fileOptions[_0xb009('0x7')]=config[_0xb009('0x6')][_0xb009('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb009('0x8')](',\x20');logger['error'](config[_0xb009('0x6')][_0xb009('0x7')],_0xb009('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x4141d1){return AES_SUPPORTED_RX[_0xb009('0xa')](_0x4141d1);}function getSupportedCiphers(){return crypto[_0xb009('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x1f64b1){return getSupportedCiphers()[_0xb009('0xc')](_0x1f64b1)>-0x1;}function combineOptions(_0x461027){var _0x507ae5={};for(var _0x48917a in fileOptions){if(fileOptions[_0xb009('0xd')](_0x48917a)){_0x507ae5[_0x48917a]=fileOptions[_0x48917a];}}if(_0x461027){for(var _0x4e9f6a in _0x461027){if(_0x461027['hasOwnProperty'](_0x4e9f6a)){_0x507ae5[_0x4e9f6a]=_0x461027[_0x4e9f6a];}}}return _0x507ae5;}exports[_0xb009('0xe')]=function(_0x34401d,_0x384de8,_0x4e2ef5,_0x3d8089){return new BPromise(function(_0x539754,_0x45ac0c){_0x3d8089=combineOptions(_0x3d8089);var _0x4bb0b7=new Buffer(_0x4e2ef5);var _0x26ecc0=fs[_0xb009('0xf')](_0x34401d);var _0x2b534e=fs[_0xb009('0x10')](_0x384de8);var _0x270548=crypto[_0xb009('0x11')](_0x3d8089['algorithm'],_0x4bb0b7);_0x26ecc0['on'](_0xb009('0x12'),function(_0x57b95f){var _0x459df8=new Buffer(_0x270548[_0xb009('0x13')](_0x57b95f),_0xb009('0x14'));_0x2b534e['write'](_0x459df8);});_0x26ecc0['on'](_0xb009('0x15'),function(){try{var _0x38cbf0=new Buffer(_0x270548[_0xb009('0x16')](_0xb009('0x14')),_0xb009('0x14'));_0x2b534e[_0xb009('0x17')](_0x38cbf0);_0x2b534e[_0xb009('0x15')]();_0x2b534e['on'](_0xb009('0x18'),function(){return _0x539754(_0x384de8);});}catch(_0x320e58){fs[_0xb009('0x19')](_0x384de8);return _0x45ac0c(_0x320e58);}});});};exports[_0xb009('0x1a')]=function(_0x438def,_0x1d7267,_0x3c3312,_0x1e9a79){return new BPromise(function(_0x182f59,_0x4166b5){_0x1e9a79=combineOptions(_0x1e9a79);var _0x4b0346=new Buffer(_0x3c3312);var _0x19ed2a=fs[_0xb009('0xf')](_0x438def);var _0x3b0f66=fs['createWriteStream'](_0x1d7267);var _0x5e893d=crypto[_0xb009('0x1b')](_0x1e9a79[_0xb009('0x7')],_0x4b0346);_0x19ed2a['on'](_0xb009('0x12'),function(_0xc0deae){var _0xb8ae03=new Buffer(_0x5e893d[_0xb009('0x13')](_0xc0deae),_0xb009('0x14'));_0x3b0f66[_0xb009('0x17')](_0xb8ae03);});_0x19ed2a['on'](_0xb009('0x15'),function(){try{var _0x38c168=new Buffer(_0x5e893d['final'](_0xb009('0x14')),'binary');_0x3b0f66[_0xb009('0x17')](_0x38c168);_0x3b0f66['end']();_0x3b0f66['on']('close',function(){return _0x182f59(_0x1d7267);});}catch(_0x192324){fs[_0xb009('0x19')](_0x1d7267);return _0x4166b5(_0x192324);}});});};exports[_0xb009('0x1c')]=function(_0x1ba134,_0x4fff6d,_0x4296c8){var _0x296994=_0x4296c8||stringOptions['algorithm'];var _0x1e6ed0=_0x4fff6d||stringOptions[_0xb009('0x1d')];var _0x5d6845=crypto[_0xb009('0x11')](_0x296994,_0x1e6ed0);var _0xaf6907=_0x5d6845[_0xb009('0x13')](_0x1ba134,_0xb009('0x1e'),_0xb009('0x1f'));_0xaf6907+=_0x5d6845[_0xb009('0x16')](_0xb009('0x1f'));return _0xaf6907;};exports[_0xb009('0x20')]=function(_0x467615,_0x5e96d6,_0x1ab994){var _0x214dcf=_0x1ab994||stringOptions[_0xb009('0x7')];var _0x4791d3=_0x5e96d6||stringOptions[_0xb009('0x1d')];var _0x5eed3f=crypto[_0xb009('0x1b')](_0x214dcf,_0x4791d3);var _0x596898=_0x5eed3f[_0xb009('0x13')](_0x467615,_0xb009('0x1f'),_0xb009('0x1e'));_0x596898+=_0x5eed3f[_0xb009('0x16')]('utf8');return _0x596898;}; \ No newline at end of file +var _0x6cdc=['base64','decryptString','crypto','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','unlink','decryptFile','createDecipher','close','encryptString','utf8'];(function(_0x291167,_0x482eff){var _0x102c7b=function(_0x5c2d5e){while(--_0x5c2d5e){_0x291167['push'](_0x291167['shift']());}};_0x102c7b(++_0x482eff);}(_0x6cdc,0x1c2));var _0xc6cd=function(_0x11bb60,_0x3dc734){_0x11bb60=_0x11bb60-0x0;var _0x37357e=_0x6cdc[_0x11bb60];return _0x37357e;};'use strict';var crypto=require(_0xc6cd('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xc6cd('0x1'));var logger=require(_0xc6cd('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc6cd('0x3')][_0xc6cd('0x4')],'algorithm':_0xc6cd('0x5')};const fileOptions={'algorithm':_0xc6cd('0x6')};if(config[_0xc6cd('0x7')]&&config[_0xc6cd('0x7')][_0xc6cd('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xc6cd('0x8')]);if(isSupported){fileOptions[_0xc6cd('0x8')]=config[_0xc6cd('0x7')][_0xc6cd('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xc6cd('0x7')][_0xc6cd('0x8')],_0xc6cd('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x16d966){return AES_SUPPORTED_RX['test'](_0x16d966);}function getSupportedCiphers(){return crypto[_0xc6cd('0xa')]()[_0xc6cd('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x56281d){return getSupportedCiphers()[_0xc6cd('0xc')](_0x56281d)>-0x1;}function combineOptions(_0x24c59b){var _0x41ef6c={};for(var _0x9a8808 in fileOptions){if(fileOptions[_0xc6cd('0xd')](_0x9a8808)){_0x41ef6c[_0x9a8808]=fileOptions[_0x9a8808];}}if(_0x24c59b){for(var _0x51c03f in _0x24c59b){if(_0x24c59b[_0xc6cd('0xd')](_0x51c03f)){_0x41ef6c[_0x51c03f]=_0x24c59b[_0x51c03f];}}}return _0x41ef6c;}exports[_0xc6cd('0xe')]=function(_0x230ce5,_0x252d9a,_0x7a8584,_0x52a6b0){return new BPromise(function(_0xb282ad,_0x2e16dd){_0x52a6b0=combineOptions(_0x52a6b0);var _0x36dd95=new Buffer(_0x7a8584);var _0x47661c=fs[_0xc6cd('0xf')](_0x230ce5);var _0x8c70d3=fs[_0xc6cd('0x10')](_0x252d9a);var _0x4b8625=crypto[_0xc6cd('0x11')](_0x52a6b0[_0xc6cd('0x8')],_0x36dd95);_0x47661c['on'](_0xc6cd('0x12'),function(_0x11d6c4){var _0xadcd4b=new Buffer(_0x4b8625[_0xc6cd('0x13')](_0x11d6c4),_0xc6cd('0x14'));_0x8c70d3[_0xc6cd('0x15')](_0xadcd4b);});_0x47661c['on'](_0xc6cd('0x16'),function(){try{var _0x375540=new Buffer(_0x4b8625[_0xc6cd('0x17')](_0xc6cd('0x14')),_0xc6cd('0x14'));_0x8c70d3[_0xc6cd('0x15')](_0x375540);_0x8c70d3['end']();_0x8c70d3['on']('close',function(){return _0xb282ad(_0x252d9a);});}catch(_0x38ff11){fs[_0xc6cd('0x18')](_0x252d9a);return _0x2e16dd(_0x38ff11);}});});};exports[_0xc6cd('0x19')]=function(_0x3347f5,_0x182bc1,_0x3d72e0,_0x16730b){return new BPromise(function(_0x5e4a90,_0x299c56){_0x16730b=combineOptions(_0x16730b);var _0x4f504e=new Buffer(_0x3d72e0);var _0x77a5f=fs[_0xc6cd('0xf')](_0x3347f5);var _0x52dce1=fs['createWriteStream'](_0x182bc1);var _0x1f95b8=crypto[_0xc6cd('0x1a')](_0x16730b[_0xc6cd('0x8')],_0x4f504e);_0x77a5f['on']('data',function(_0x52a560){var _0x501995=new Buffer(_0x1f95b8[_0xc6cd('0x13')](_0x52a560),_0xc6cd('0x14'));_0x52dce1['write'](_0x501995);});_0x77a5f['on'](_0xc6cd('0x16'),function(){try{var _0x33db9e=new Buffer(_0x1f95b8[_0xc6cd('0x17')](_0xc6cd('0x14')),_0xc6cd('0x14'));_0x52dce1[_0xc6cd('0x15')](_0x33db9e);_0x52dce1['end']();_0x52dce1['on'](_0xc6cd('0x1b'),function(){return _0x5e4a90(_0x182bc1);});}catch(_0x58c51e){fs[_0xc6cd('0x18')](_0x182bc1);return _0x299c56(_0x58c51e);}});});};exports[_0xc6cd('0x1c')]=function(_0x4526e4,_0x2b30db,_0x32b41f){var _0x30917b=_0x32b41f||stringOptions[_0xc6cd('0x8')];var _0x39dda6=_0x2b30db||stringOptions['secret'];var _0x4e7e24=crypto['createCipher'](_0x30917b,_0x39dda6);var _0x1a7515=_0x4e7e24[_0xc6cd('0x13')](_0x4526e4,_0xc6cd('0x1d'),_0xc6cd('0x1e'));_0x1a7515+=_0x4e7e24[_0xc6cd('0x17')](_0xc6cd('0x1e'));return _0x1a7515;};exports[_0xc6cd('0x1f')]=function(_0x349dd2,_0x47f8ce,_0x3e5dd8){var _0x36751a=_0x3e5dd8||stringOptions[_0xc6cd('0x8')];var _0x425ba9=_0x47f8ce||stringOptions['secret'];var _0x47fb37=crypto[_0xc6cd('0x1a')](_0x36751a,_0x425ba9);var _0x1dd73f=_0x47fb37[_0xc6cd('0x13')](_0x349dd2,_0xc6cd('0x1e'),_0xc6cd('0x1d'));_0x1dd73f+=_0x47fb37[_0xc6cd('0x17')](_0xc6cd('0x1d'));return _0x1dd73f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e7dac26..d414487 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 _0x9a2a=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a2a,0x16a));var _0xa9a2=function(_0x140931,_0x2ffeba){_0x140931=_0x140931-0x0;var _0x4718ab=_0x9a2a[_0x140931];return _0x4718ab;};'use strict';var util=require(_0xa9a2('0x0'));var path=require(_0xa9a2('0x1'));var _=require('lodash');var csv=require(_0xa9a2('0x2'));var fs=require('fs');var BPromise=require(_0xa9a2('0x3'));var zipdir=require(_0xa9a2('0x4'));var rimraf=require(_0xa9a2('0x5'));var db=require(_0xa9a2('0x6'))['db'];var dbH=require(_0xa9a2('0x6'))[_0xa9a2('0x7')];var logger=require(_0xa9a2('0x8'))(_0xa9a2('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa9a2('0xa')][0x3];var PATH=process[_0xa9a2('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x394978,_0x451405){var _0x59368f={'status':_0x394978};var _0x3dc4e9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x451405){_0x59368f[_0xa9a2('0xb')]=_0x451405;}return db['AnalyticExtractedReport'][_0xa9a2('0xc')](_0x59368f,_0x3dc4e9);}function main(){var _0x5b06b1=0x1388;var _0x3274a0;logger[_0xa9a2('0xd')](util[_0xa9a2('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xa9a2('0xf')][_0xa9a2('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa9a2('0x11'),_0xa9a2('0x12')]})[_0xa9a2('0x13')](function(_0x5fda59){if(_0x5fda59){_0x3274a0=_0x5fda59;_0x5b06b1=_0x3274a0[_0xa9a2('0x12')]||0x1388;}})[_0xa9a2('0x13')](function(){return dbH[_0xa9a2('0x14')][_0xa9a2('0x15')](util[_0xa9a2('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa9a2('0x14')][_0xa9a2('0x16')][_0xa9a2('0x17')]});})['then'](function(_0x2f3944){if(!_0x2f3944[0x0]['num']){return analyticExtractedReport(_0xa9a2('0x18'));}var _0xcaa92f=[];var _0x5b5af4=0x0;if(_0x3274a0[_0xa9a2('0x11')]){if(_0x2f3944&&_0x2f3944[_0xa9a2('0x19')]){var _0x4d008f=_[_0xa9a2('0x1a')](_0x2f3944[0x0][_0xa9a2('0x1b')]/_0x5b06b1);var _0x4e989d=Number[_0xa9a2('0x1c')](_0x2f3944[0x0][_0xa9a2('0x1b')]/_0x5b06b1)?_0x2f3944[0x0][_0xa9a2('0x1b')]%_0x5b06b1:0x0;_0x4d008f[_0xa9a2('0x1d')](function(_0x3ce584){if(_0x3ce584>0x0){_0x5b5af4+=_0x5b06b1;}_0xcaa92f[_0xa9a2('0x1e')](dbH[_0xa9a2('0x14')][_0xa9a2('0x15')](util[_0xa9a2('0xe')](_0xa9a2('0x1f'),QUERY,_0x5b06b1,_0x5b5af4),{'type':dbH['sequelize'][_0xa9a2('0x16')][_0xa9a2('0x17')]}));});if(_0x4e989d>0x0){_0x5b5af4+=_0x5b06b1;_0xcaa92f[_0xa9a2('0x1e')](dbH[_0xa9a2('0x14')][_0xa9a2('0x15')](util['format'](_0xa9a2('0x1f'),QUERY,_0x4e989d,_0x5b5af4),{'type':dbH[_0xa9a2('0x14')]['QueryTypes'][_0xa9a2('0x17')]}));}}}else{_0xcaa92f[_0xa9a2('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xa9a2('0x16')]['SELECT']}));}var _0x33ee64=path['dirname'](PATH);var _0x3efbce=path['basename'](PATH,'.csv');var _0x182e78=_0x3274a0[_0xa9a2('0x11')]&&_0xcaa92f[_0xa9a2('0x19')]>0x1;var _0x372dea=[];if(!fs['existsSync'](path[_0xa9a2('0x20')](_0x33ee64,_0x3efbce))&&_0x182e78){fs[_0xa9a2('0x21')](path[_0xa9a2('0x20')](_0x33ee64,_0x3efbce));}return BPromise[_0xa9a2('0x22')](_0xcaa92f,function(_0x395eab){_0x372dea['push'](_0x395eab);})['then'](function(){for(var _0x10a5ff=0x0;_0x10a5ff<_0x372dea[_0xa9a2('0x19')];_0x10a5ff+=0x1){var _0x21ee2a;var _0x59c0a8=_0x372dea[_0x10a5ff];if(_0x182e78){_0x21ee2a=path['join'](_0x33ee64,_0x3efbce,util[_0xa9a2('0xe')](_0xa9a2('0x23'),_0x3efbce,_0x10a5ff,_0xa9a2('0x24')));}else{_0x21ee2a=path['join'](_0x33ee64,util['format'](_0xa9a2('0x25'),_0x3efbce,'csv'));}fs[_0xa9a2('0x26')](_0x21ee2a,csv(_0x59c0a8));}})[_0xa9a2('0x13')](function(){if(_0x182e78){return new Promise(function(_0x8aa65e){zipdir(path['join'](_0x33ee64,_0x3efbce),{'saveTo':path[_0xa9a2('0x20')](_0x33ee64,util['format'](_0xa9a2('0x25'),_0x3efbce,_0xa9a2('0x27')))},function(_0x4c5e23,_0x27033d){rimraf(path['join'](_0x33ee64,_0x3efbce),function(){});_0x8aa65e('zip\x20finished');});});}})[_0xa9a2('0x13')](function(){logger[_0xa9a2('0xd')](util['format'](_0xa9a2('0x28'),EXTRACTED_REPORT_ID,_0xa9a2('0x29')));return analyticExtractedReport(_0xa9a2('0x2a'),_0x182e78?util['format'](_0xa9a2('0x25'),_0x3efbce,_0x182e78?_0xa9a2('0x27'):_0xa9a2('0x24')):null);});})[_0xa9a2('0x2b')](function(_0x28eac5){logger[_0xa9a2('0xd')](util[_0xa9a2('0xe')](_0xa9a2('0x2c'),EXTRACTED_REPORT_ID,_0xa9a2('0x29')),util[_0xa9a2('0x2d')](_0x28eac5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa9a2('0x2e'));})[_0xa9a2('0x2f')](function(){process[_0xa9a2('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x38ee=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV'];(function(_0x59888e,_0x2eb24a){var _0xe76e9f=function(_0x27df6f){while(--_0x27df6f){_0x59888e['push'](_0x59888e['shift']());}};_0xe76e9f(++_0x2eb24a);}(_0x38ee,0x113));var _0xe38e=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x38ee[_0x1ab0e6];return _0x248815;};'use strict';var util=require(_0xe38e('0x0'));var path=require(_0xe38e('0x1'));var _=require(_0xe38e('0x2'));var csv=require(_0xe38e('0x3'));var fs=require('fs');var BPromise=require(_0xe38e('0x4'));var zipdir=require(_0xe38e('0x5'));var rimraf=require('rimraf');var db=require(_0xe38e('0x6'))['db'];var dbH=require(_0xe38e('0x6'))[_0xe38e('0x7')];var logger=require(_0xe38e('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xe38e('0x9')][0x3];var PATH=process[_0xe38e('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x441d24,_0x207849){var _0x31e4f7={'status':_0x441d24};var _0x1829ca={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x207849){_0x31e4f7[_0xe38e('0xa')]=_0x207849;}return db[_0xe38e('0xb')][_0xe38e('0xc')](_0x31e4f7,_0x1829ca);}function main(){var _0x463f7c=0x1388;var _0x34f163;logger[_0xe38e('0xd')](util[_0xe38e('0xe')](_0xe38e('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xe38e('0x10')][_0xe38e('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe38e('0x12')]})[_0xe38e('0x13')](function(_0x395c3f){if(_0x395c3f){_0x34f163=_0x395c3f;_0x463f7c=_0x34f163[_0xe38e('0x12')]||0x1388;}})[_0xe38e('0x13')](function(){return dbH[_0xe38e('0x14')][_0xe38e('0x15')](util[_0xe38e('0xe')](_0xe38e('0x16'),QUERY),{'type':dbH[_0xe38e('0x14')][_0xe38e('0x17')][_0xe38e('0x18')]});})['then'](function(_0x2a321c){if(!_0x2a321c[0x0][_0xe38e('0x19')]){return analyticExtractedReport(_0xe38e('0x1a'));}var _0x263073=[];var _0x22e6ff=0x0;if(_0x34f163[_0xe38e('0x1b')]){if(_0x2a321c&&_0x2a321c[_0xe38e('0x1c')]){var _0x189654=_[_0xe38e('0x1d')](_0x2a321c[0x0][_0xe38e('0x19')]/_0x463f7c);var _0x356bcd=Number[_0xe38e('0x1e')](_0x2a321c[0x0][_0xe38e('0x19')]/_0x463f7c)?_0x2a321c[0x0][_0xe38e('0x19')]%_0x463f7c:0x0;_0x189654[_0xe38e('0x1f')](function(_0x3b99da){if(_0x3b99da>0x0){_0x22e6ff+=_0x463f7c;}_0x263073['push'](dbH[_0xe38e('0x14')][_0xe38e('0x15')](util[_0xe38e('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x463f7c,_0x22e6ff),{'type':dbH['sequelize'][_0xe38e('0x17')][_0xe38e('0x18')]}));});if(_0x356bcd>0x0){_0x22e6ff+=_0x463f7c;_0x263073[_0xe38e('0x20')](dbH[_0xe38e('0x14')][_0xe38e('0x15')](util[_0xe38e('0xe')](_0xe38e('0x21'),QUERY,_0x356bcd,_0x22e6ff),{'type':dbH[_0xe38e('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x263073[_0xe38e('0x20')](dbH[_0xe38e('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0xe38e('0x17')][_0xe38e('0x18')]}));}var _0x5b1519=path[_0xe38e('0x22')](PATH);var _0x8767f9=path[_0xe38e('0x23')](PATH,_0xe38e('0x24'));var _0x3262eb=_0x34f163[_0xe38e('0x1b')]&&_0x263073[_0xe38e('0x1c')]>0x1;var _0x5d8f24=[];if(!fs[_0xe38e('0x25')](path[_0xe38e('0x26')](_0x5b1519,_0x8767f9))&&_0x3262eb){fs[_0xe38e('0x27')](path[_0xe38e('0x26')](_0x5b1519,_0x8767f9));}return BPromise[_0xe38e('0x28')](_0x263073,function(_0x155cc4){_0x5d8f24[_0xe38e('0x20')](_0x155cc4);})[_0xe38e('0x13')](function(){for(var _0x299e38=0x0;_0x299e38<_0x5d8f24['length'];_0x299e38+=0x1){var _0x1f3834;var _0x25791c=_0x5d8f24[_0x299e38];if(_0x3262eb){_0x1f3834=path['join'](_0x5b1519,_0x8767f9,util[_0xe38e('0xe')](_0xe38e('0x29'),_0x8767f9,_0x299e38,'csv'));}else{_0x1f3834=path['join'](_0x5b1519,util[_0xe38e('0xe')]('%s.%s',_0x8767f9,_0xe38e('0x2a')));}fs[_0xe38e('0x2b')](_0x1f3834,csv(_0x25791c));}})[_0xe38e('0x13')](function(){if(_0x3262eb){return new Promise(function(_0x39627b){zipdir(path[_0xe38e('0x26')](_0x5b1519,_0x8767f9),{'saveTo':path['join'](_0x5b1519,util[_0xe38e('0xe')](_0xe38e('0x2c'),_0x8767f9,_0xe38e('0x2d')))},function(_0x2a3482,_0x27904b){rimraf(path['join'](_0x5b1519,_0x8767f9),function(){});_0x39627b(_0xe38e('0x2e'));});});}})['then'](function(){logger['info'](util[_0xe38e('0xe')](_0xe38e('0x2f'),EXTRACTED_REPORT_ID,_0xe38e('0x30')));return analyticExtractedReport(_0xe38e('0x31'),_0x3262eb?util[_0xe38e('0xe')](_0xe38e('0x2c'),_0x8767f9,_0x3262eb?'zip':_0xe38e('0x2a')):null);});})[_0xe38e('0x32')](function(_0x335b95){logger[_0xe38e('0xd')](util[_0xe38e('0xe')](_0xe38e('0x33'),EXTRACTED_REPORT_ID,_0xe38e('0x30')),util[_0xe38e('0x34')](_0x335b95,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe38e('0x35'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ae10eea..1f3f806 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 _0xd9cc=['createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','tableHeader','map','toString','value','fill','length','auto','body','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','before','margin','landscape','\x20/\x20','num','Setting','split','splitSizePdf','then','range','isInteger','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','all','%s.%s','zip','zip\x20finished','info','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','pipe'];(function(_0x1bd695,_0x526b27){var _0x5b5c8e=function(_0x106b86){while(--_0x106b86){_0x1bd695['push'](_0x1bd695['shift']());}};_0x5b5c8e(++_0x526b27);}(_0xd9cc,0xaf));var _0xcd9c=function(_0xb75f50,_0xb73a6b){_0xb75f50=_0xb75f50-0x0;var _0x31acf8=_0xd9cc[_0xb75f50];return _0x31acf8;};'use strict';var _=require(_0xcd9c('0x0'));var fs=require('fs');var util=require(_0xcd9c('0x1'));var path=require(_0xcd9c('0x2'));var moment=require(_0xcd9c('0x3'));var htmlToPdfmake=require(_0xcd9c('0x4'));var PdfPrinter=require(_0xcd9c('0x5'));var zipdir=require(_0xcd9c('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0xcd9c('0x7'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0xcd9c('0x8'));var db=require(_0xcd9c('0x9'))['db'];var dbH=require(_0xcd9c('0x9'))[_0xcd9c('0xa')];var logger=require(_0xcd9c('0xb'))(_0xcd9c('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xcd9c('0xd')][0x2]);var QUERY=process[_0xcd9c('0xd')][0x3];var PATH=process[_0xcd9c('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xcd9c('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b73e4,_0x32c46a){var _0x36cf31={'status':_0x5b73e4};var _0x1a121e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32c46a){_0x36cf31['savename']=_0x32c46a;}return db['AnalyticExtractedReport'][_0xcd9c('0xf')](_0x36cf31,_0x1a121e);}function getHeaders(_0x83991d){return _['map'](_0x83991d,function(_0x4cb2f5){return{'text':_0x4cb2f5,'style':_0xcd9c('0x10')};});}function getRows(_0x4d5cc8,_0x10e1d0){return _[_0xcd9c('0x11')](_0x10e1d0,function(_0x3b96e2){return _(_0x3b96e2)['pick'](_0x4d5cc8)[_0xcd9c('0x11')](function(_0xcb65dd){return _0xcb65dd?_[_0xcd9c('0x12')](_0xcb65dd):'';})[_0xcd9c('0x13')]();});}function createTable(_0x1f474e,_0x31dbf1){var _0x36c51b={'widths':_[_0xcd9c('0x14')](Array(_0x1f474e[_0xcd9c('0x15')]),0x91),'heights':function(_0x220fef){return _0x220fef===0x0?_0xcd9c('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2e63c0=getHeaders(_0x1f474e);_0x36c51b[_0xcd9c('0x17')]['push'](_0x2e63c0);var _0x3c2a67=getRows(_0x1f474e,_0x31dbf1);_0x36c51b[_0xcd9c('0x17')]=_0x36c51b[_0xcd9c('0x17')]['concat'](_0x3c2a67);return _0x36c51b;}function createTables(_0x5e4d57){var _0x1f4862=[];var _0x10cec7=_[_0xcd9c('0x18')](Object[_0xcd9c('0x19')](_0x5e4d57[0x0]),0x5);_0x10cec7[_0xcd9c('0x1a')](function(_0x98980d){_0x1f4862[_0xcd9c('0x1b')](createTable(_0x98980d,_0x5e4d57));});return _0x1f4862;}function getPDFDocDefinition(_0x11dc2b){var _0x519e16=util[_0xcd9c('0x1c')](_0xcd9c('0x1d'),NAME,EXTRACTED_REPORT[_0xcd9c('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xcd9c('0x1f')])[_0xcd9c('0x1c')](FORMAT));var _0x557d7d=[];for(var _0x1f0fec=0x0;_0x1f0fec<_0x11dc2b[_0xcd9c('0x15')];_0x1f0fec++){var _0x469793=[];if(_0x1f0fec===0x0){_0x469793[_0xcd9c('0x1b')]({'text':_0x519e16,'style':_0xcd9c('0x20')});}var _0x4ea312={'table':_0x11dc2b[_0x1f0fec]};if(_0x1f0fec>0x0){_0x4ea312['pageBreak']=_0xcd9c('0x21');_0x4ea312[_0xcd9c('0x22')]=[0x0,0x46,0x0,0x0];}_0x469793[_0xcd9c('0x1b')](_0x4ea312);_0x557d7d['push'](_0x469793);}return{'pageSize':'A4','pageOrientation':_0xcd9c('0x23'),'content':_0x557d7d,'footer':function(_0x256f48,_0x2a4f64){return{'text':_0x256f48[_0xcd9c('0x12')]()+_0xcd9c('0x24')+_0x2a4f64,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2569e2){var _0x41877f=0x1388;var _0x4df635;if(!_0x2569e2[0x0][_0xcd9c('0x25')]){return analyticExtractedReport('Empty');}return db[_0xcd9c('0x26')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcd9c('0x27'),_0xcd9c('0x28')]})[_0xcd9c('0x29')](function(_0x1935aa){if(_0x1935aa){_0x4df635=_0x1935aa;_0x41877f=_0x4df635['splitSizePdf']||0x3e8;}})['then'](function(){var _0x1795fe=[];var _0x48cbd1=0x0;if(_0x4df635[_0xcd9c('0x27')]){if(_0x2569e2&&_0x2569e2['length']){var _0x55936b=_[_0xcd9c('0x2a')](_0x2569e2[0x0][_0xcd9c('0x25')]/_0x41877f);var _0x3ff71b=Number[_0xcd9c('0x2b')](_0x2569e2[0x0][_0xcd9c('0x25')]/_0x41877f)?_0x2569e2[0x0][_0xcd9c('0x25')]%_0x41877f:0x0;_0x55936b[_0xcd9c('0x1a')](function(_0x3713e8){if(_0x3713e8>0x0){_0x48cbd1+=_0x41877f;}_0x1795fe['push'](dbH[_0xcd9c('0x2c')][_0xcd9c('0x2d')](util[_0xcd9c('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x41877f,_0x48cbd1),{'type':dbH[_0xcd9c('0x2c')][_0xcd9c('0x2e')][_0xcd9c('0x2f')]}));});if(_0x3ff71b>0x0){_0x48cbd1+=_0x41877f;_0x1795fe[_0xcd9c('0x1b')](dbH['sequelize']['query'](util['format'](_0xcd9c('0x30'),QUERY,_0x3ff71b,_0x48cbd1),{'type':dbH[_0xcd9c('0x2c')][_0xcd9c('0x2e')][_0xcd9c('0x2f')]}));}}}else{_0x1795fe[_0xcd9c('0x1b')](dbH[_0xcd9c('0x2c')][_0xcd9c('0x2d')](QUERY,{'type':dbH[_0xcd9c('0x2c')]['QueryTypes'][_0xcd9c('0x2f')]}));}var _0x23cd72=path[_0xcd9c('0x31')](PATH);var _0x3fcfef=path[_0xcd9c('0x32')](PATH,_0xcd9c('0x33'));var _0x5940b0=_0x4df635['split']&&_0x1795fe[_0xcd9c('0x15')]>0x1;var _0x5801bf=[];if(!fs['existsSync'](path[_0xcd9c('0x34')](_0x23cd72,_0x3fcfef))&&_0x5940b0){fs[_0xcd9c('0x35')](path[_0xcd9c('0x34')](_0x23cd72,_0x3fcfef));}return BPromise['each'](_0x1795fe,function(_0x94372e){_0x5801bf[_0xcd9c('0x1b')](_0x94372e);})[_0xcd9c('0x29')](function(){var _0x3d2bdc=[];for(var _0xf80879=0x0;_0xf80879<_0x5801bf[_0xcd9c('0x15')];_0xf80879+=0x1){var _0xce3f7c=_0x5801bf[_0xf80879];var _0x1e620b=createTables(_[_0xcd9c('0x36')](_0xce3f7c));var _0x22bc6d;var _0x241a3b=getPDFDocDefinition(_0x1e620b);var _0x45ff8d=getPDFPrinter();var _0x2426e9=_0x45ff8d[_0xcd9c('0x37')](_0x241a3b);if(_0x5940b0){_0x22bc6d=path[_0xcd9c('0x34')](_0x23cd72,_0x3fcfef,util[_0xcd9c('0x1c')](_0xcd9c('0x38'),_0x3fcfef,_0xf80879,'pdf'));}else{_0x22bc6d=path[_0xcd9c('0x34')](_0x23cd72,util[_0xcd9c('0x1c')]('%s.%s',_0x3fcfef,'pdf'));}_0x3d2bdc[_0xcd9c('0x1b')](writePDFDocument(_0x2426e9,_0x22bc6d));}return Promise[_0xcd9c('0x39')](_0x3d2bdc);})[_0xcd9c('0x29')](function(){if(_0x5940b0){return new Promise(function(_0x14cdef){zipdir(path['join'](_0x23cd72,_0x3fcfef),{'saveTo':path['join'](_0x23cd72,util[_0xcd9c('0x1c')](_0xcd9c('0x3a'),_0x3fcfef,_0xcd9c('0x3b')))},function(){rimraf(path[_0xcd9c('0x34')](_0x23cd72,_0x3fcfef),function(){});_0x14cdef(_0xcd9c('0x3c'));});});}})['then'](function(){if(!_0x5940b0)return;rimraf(path[_0xcd9c('0x34')](_0x23cd72,_0x3fcfef),function(){});})[_0xcd9c('0x29')](function(){logger[_0xcd9c('0x3d')](util[_0xcd9c('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcd9c('0x3e')));return analyticExtractedReport(_0xcd9c('0x3f'),_0x5940b0?util[_0xcd9c('0x1c')]('%s.%s',_0x3fcfef,_0x5940b0?_0xcd9c('0x3b'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcd9c('0x3d')](util[_0xcd9c('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xcd9c('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcd9c('0x29')](function(_0x26f947){EXTRACTED_REPORT=_0x26f947;return dbH['sequelize'][_0xcd9c('0x2d')](util[_0xcd9c('0x1c')](_0xcd9c('0x41'),QUERY),{'type':dbH['sequelize'][_0xcd9c('0x2e')]['SELECT']});})['then'](extractReport)['catch'](function(_0x415299){logger[_0xcd9c('0x3d')](util['format'](_0xcd9c('0x42'),EXTRACTED_REPORT_ID,_0xcd9c('0x3e')),util[_0xcd9c('0x43')](_0x415299,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd9c('0x44'));})['finally'](function(){process[_0xcd9c('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x12e008=new PdfPrinter({'Arial':{'normal':__dirname+_0xcd9c('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xcd9c('0x47'),'bolditalics':__dirname+_0xcd9c('0x48')}});return _0x12e008;}function getPDFDocDefinitionFromHTML(_0x5b2768,_0x2af875){var _0x36b1f0=util[_0xcd9c('0x1c')](_0xcd9c('0x49'),_0x2af875[_0xcd9c('0x4a')],_0x2af875[_0xcd9c('0x4b')]);var _0xd61e07=moment()['format'](_0xcd9c('0x4c'))['toString']();var _0x23ca20=htmlToPdfmake(_0x5b2768,{'window':window,'tableAutoSize':!![]});return{'content':[_0x23ca20],'defaultStyle':{'font':_0xcd9c('0x4d')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcd9c('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcd9c('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcd9c('0x4e')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xcd9c('0x20')}];},'footer':function(_0x4a7d67,_0x185b10){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x36b1f0,_0x4a7d67,_0x185b10,_0xd61e07),'style':'footer'}];}};}function writePDFDocument(_0x4d67e2,_0x5bc23f){return new Promise(function(_0x204aaf,_0x4d4fff){var _0x5eb783=_0x4d67e2[_0xcd9c('0x4f')](fs[_0xcd9c('0x50')](_0x5bc23f));_0x5eb783['on'](_0xcd9c('0x51'),function(){_0x204aaf(_0xcd9c('0x51'));});_0x5eb783['on'](_0xcd9c('0x52'),function(_0x114159){_0x4d4fff(_0x114159);});_0x4d67e2[_0xcd9c('0x53')]();});}exports[_0xcd9c('0x54')]=function(_0x21e125,_0xfd6a86){var _0x1bbf43=getPDFPrinter();var _0xd38bd=getPDFDocDefinitionFromHTML(_0x21e125,_0xfd6a86);var _0x17f19a=_0x1bbf43[_0xcd9c('0x37')](_0xd38bd);return writePDFDocument(_0x17f19a,_0xfd6a86['path'])['catch'](function(_0x47b861){throw _0x47b861;});}; \ No newline at end of file +var _0x3c9c=['createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','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','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','/fonts/arial-regular.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','finish','error','end','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','body','concat','chunk','keys','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','Empty','Setting','split','splitSizePdf','then','range','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','existsSync','join','flatten'];(function(_0x1ba123,_0xfd52d0){var _0x576bd4=function(_0x4bcc2c){while(--_0x4bcc2c){_0x1ba123['push'](_0x1ba123['shift']());}};_0x576bd4(++_0xfd52d0);}(_0x3c9c,0x17d));var _0xc3c9=function(_0x4d829d,_0x583866){_0x4d829d=_0x4d829d-0x0;var _0x292c64=_0x3c9c[_0x4d829d];return _0x292c64;};'use strict';var _=require(_0xc3c9('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xc3c9('0x1'));var moment=require(_0xc3c9('0x2'));var htmlToPdfmake=require(_0xc3c9('0x3'));var PdfPrinter=require(_0xc3c9('0x4'));var zipdir=require(_0xc3c9('0x5'));var rimraf=require(_0xc3c9('0x6'));var JSDOM=require(_0xc3c9('0x7'))[_0xc3c9('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0xc3c9('0x9'));var db=require(_0xc3c9('0xa'))['db'];var dbH=require('../../mysqldb')[_0xc3c9('0xb')];var logger=require(_0xc3c9('0xc'))(_0xc3c9('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xc3c9('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc3c9('0xe')][0x4];var NAME=process[_0xc3c9('0xe')][0x5];var FORMAT=_0xc3c9('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x21916e,_0x226525){var _0x5a5ffa={'status':_0x21916e};var _0x35e5b6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x226525){_0x5a5ffa[_0xc3c9('0x10')]=_0x226525;}return db['AnalyticExtractedReport'][_0xc3c9('0x11')](_0x5a5ffa,_0x35e5b6);}function getHeaders(_0x497259){return _[_0xc3c9('0x12')](_0x497259,function(_0x46ec0d){return{'text':_0x46ec0d,'style':_0xc3c9('0x13')};});}function getRows(_0x37cea5,_0x102f5a){return _[_0xc3c9('0x12')](_0x102f5a,function(_0x52f629){return _(_0x52f629)[_0xc3c9('0x14')](_0x37cea5)['map'](function(_0x525dcc){return _0x525dcc?_[_0xc3c9('0x15')](_0x525dcc):'';})[_0xc3c9('0x16')]();});}function createTable(_0x2bd39c,_0xabeae7){var _0x1a3ce8={'widths':_[_0xc3c9('0x17')](Array(_0x2bd39c[_0xc3c9('0x18')]),0x91),'heights':function(_0x3d11a1){return _0x3d11a1===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x412020=getHeaders(_0x2bd39c);_0x1a3ce8[_0xc3c9('0x19')]['push'](_0x412020);var _0x34359f=getRows(_0x2bd39c,_0xabeae7);_0x1a3ce8[_0xc3c9('0x19')]=_0x1a3ce8[_0xc3c9('0x19')][_0xc3c9('0x1a')](_0x34359f);return _0x1a3ce8;}function createTables(_0x13cb82){var _0x5988dd=[];var _0x283859=_[_0xc3c9('0x1b')](Object[_0xc3c9('0x1c')](_0x13cb82[0x0]),0x5);_0x283859['forEach'](function(_0x38dc5c){_0x5988dd[_0xc3c9('0x1d')](createTable(_0x38dc5c,_0x13cb82));});return _0x5988dd;}function getPDFDocDefinition(_0x4e0bf2){var _0x33a088=util[_0xc3c9('0x1e')](_0xc3c9('0x1f'),NAME,EXTRACTED_REPORT[_0xc3c9('0x20')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xc3c9('0x1e')](FORMAT));var _0x29d026=[];for(var _0x42e1fe=0x0;_0x42e1fe<_0x4e0bf2[_0xc3c9('0x18')];_0x42e1fe++){var _0x2b46dd=[];if(_0x42e1fe===0x0){_0x2b46dd[_0xc3c9('0x1d')]({'text':_0x33a088,'style':_0xc3c9('0x21')});}var _0x556d1f={'table':_0x4e0bf2[_0x42e1fe]};if(_0x42e1fe>0x0){_0x556d1f[_0xc3c9('0x22')]=_0xc3c9('0x23');_0x556d1f[_0xc3c9('0x24')]=[0x0,0x46,0x0,0x0];}_0x2b46dd[_0xc3c9('0x1d')](_0x556d1f);_0x29d026[_0xc3c9('0x1d')](_0x2b46dd);}return{'pageSize':'A4','pageOrientation':_0xc3c9('0x25'),'content':_0x29d026,'footer':function(_0x451707,_0x1fd1a){return{'text':_0x451707[_0xc3c9('0x15')]()+_0xc3c9('0x26')+_0x1fd1a,'style':'footer'};},'defaultStyle':{'font':_0xc3c9('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc3c9('0x28')},'footer':{'alignment':_0xc3c9('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5e2196){var _0x2924d6=0x1388;var _0x153a53;if(!_0x5e2196[0x0]['num']){return analyticExtractedReport(_0xc3c9('0x2a'));}return db[_0xc3c9('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc3c9('0x2c'),_0xc3c9('0x2d')]})[_0xc3c9('0x2e')](function(_0x190482){if(_0x190482){_0x153a53=_0x190482;_0x2924d6=_0x153a53['splitSizePdf']||0x3e8;}})[_0xc3c9('0x2e')](function(){var _0x34ddff=[];var _0x4e9575=0x0;if(_0x153a53[_0xc3c9('0x2c')]){if(_0x5e2196&&_0x5e2196['length']){var _0x529c6e=_[_0xc3c9('0x2f')](_0x5e2196[0x0][_0xc3c9('0x30')]/_0x2924d6);var _0xef90a5=Number[_0xc3c9('0x31')](_0x5e2196[0x0][_0xc3c9('0x30')]/_0x2924d6)?_0x5e2196[0x0][_0xc3c9('0x30')]%_0x2924d6:0x0;_0x529c6e[_0xc3c9('0x32')](function(_0x435455){if(_0x435455>0x0){_0x4e9575+=_0x2924d6;}_0x34ddff[_0xc3c9('0x1d')](dbH['sequelize'][_0xc3c9('0x33')](util[_0xc3c9('0x1e')](_0xc3c9('0x34'),QUERY,_0x2924d6,_0x4e9575),{'type':dbH['sequelize'][_0xc3c9('0x35')][_0xc3c9('0x36')]}));});if(_0xef90a5>0x0){_0x4e9575+=_0x2924d6;_0x34ddff[_0xc3c9('0x1d')](dbH['sequelize'][_0xc3c9('0x33')](util['format'](_0xc3c9('0x34'),QUERY,_0xef90a5,_0x4e9575),{'type':dbH[_0xc3c9('0x37')][_0xc3c9('0x35')][_0xc3c9('0x36')]}));}}}else{_0x34ddff[_0xc3c9('0x1d')](dbH[_0xc3c9('0x37')][_0xc3c9('0x33')](QUERY,{'type':dbH[_0xc3c9('0x37')][_0xc3c9('0x35')][_0xc3c9('0x36')]}));}var _0x94d1c6=path['dirname'](PATH);var _0x397267=path['basename'](PATH,'.pdf');var _0x242a06=_0x153a53[_0xc3c9('0x2c')]&&_0x34ddff[_0xc3c9('0x18')]>0x1;var _0x4293e5=[];if(!fs[_0xc3c9('0x38')](path[_0xc3c9('0x39')](_0x94d1c6,_0x397267))&&_0x242a06){fs['mkdirSync'](path['join'](_0x94d1c6,_0x397267));}return BPromise['each'](_0x34ddff,function(_0x3a7e61){_0x4293e5[_0xc3c9('0x1d')](_0x3a7e61);})[_0xc3c9('0x2e')](function(){var _0x3bed4b=[];for(var _0xa11709=0x0;_0xa11709<_0x4293e5[_0xc3c9('0x18')];_0xa11709+=0x1){var _0x4d162c=_0x4293e5[_0xa11709];var _0x376215=createTables(_[_0xc3c9('0x3a')](_0x4d162c));var _0x3f2f50;var _0x250359=getPDFDocDefinition(_0x376215);var _0x8f5ef2=getPDFPrinter();var _0x594bad=_0x8f5ef2[_0xc3c9('0x3b')](_0x250359);if(_0x242a06){_0x3f2f50=path[_0xc3c9('0x39')](_0x94d1c6,_0x397267,util[_0xc3c9('0x1e')](_0xc3c9('0x3c'),_0x397267,_0xa11709,_0xc3c9('0x3d')));}else{_0x3f2f50=path[_0xc3c9('0x39')](_0x94d1c6,util['format'](_0xc3c9('0x3e'),_0x397267,_0xc3c9('0x3d')));}_0x3bed4b[_0xc3c9('0x1d')](writePDFDocument(_0x594bad,_0x3f2f50));}return Promise[_0xc3c9('0x3f')](_0x3bed4b);})['then'](function(){if(_0x242a06){return new Promise(function(_0x1a0f6e){zipdir(path[_0xc3c9('0x39')](_0x94d1c6,_0x397267),{'saveTo':path[_0xc3c9('0x39')](_0x94d1c6,util[_0xc3c9('0x1e')](_0xc3c9('0x3e'),_0x397267,_0xc3c9('0x40')))},function(){rimraf(path['join'](_0x94d1c6,_0x397267),function(){});_0x1a0f6e('zip\x20finished');});});}})[_0xc3c9('0x2e')](function(){if(!_0x242a06)return;rimraf(path[_0xc3c9('0x39')](_0x94d1c6,_0x397267),function(){});})[_0xc3c9('0x2e')](function(){logger[_0xc3c9('0x41')](util['format'](_0xc3c9('0x42'),EXTRACTED_REPORT_ID,_0xc3c9('0x43')));return analyticExtractedReport(_0xc3c9('0x44'),_0x242a06?util[_0xc3c9('0x1e')](_0xc3c9('0x3e'),_0x397267,_0x242a06?_0xc3c9('0x40'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xc3c9('0x1e')](_0xc3c9('0x45'),EXTRACTED_REPORT_ID,_0xc3c9('0x43')));return db[_0xc3c9('0x46')][_0xc3c9('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc3c9('0x2e')](function(_0x14a858){EXTRACTED_REPORT=_0x14a858;return dbH['sequelize'][_0xc3c9('0x33')](util[_0xc3c9('0x1e')](_0xc3c9('0x48'),QUERY),{'type':dbH[_0xc3c9('0x37')]['QueryTypes'][_0xc3c9('0x36')]});})[_0xc3c9('0x2e')](extractReport)[_0xc3c9('0x49')](function(_0x48c61c){logger[_0xc3c9('0x41')](util[_0xc3c9('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc3c9('0x43')),util['inspect'](_0x48c61c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc3c9('0x4a'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x39f15d=new PdfPrinter({'Arial':{'normal':__dirname+_0xc3c9('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x39f15d;}function getPDFDocDefinitionFromHTML(_0x5885db,_0x27fd53){var _0x65a546=util[_0xc3c9('0x1e')](_0xc3c9('0x4c'),_0x27fd53[_0xc3c9('0x4d')],_0x27fd53[_0xc3c9('0x4e')]);var _0x533bd7=moment()['format'](_0xc3c9('0x4f'))[_0xc3c9('0x15')]();var _0x31fc29=htmlToPdfmake(_0x5885db,{'window':window,'tableAutoSize':!![]});return{'content':[_0x31fc29],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc3c9('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc3c9('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xc3c9('0x51'),'style':_0xc3c9('0x21')}];},'footer':function(_0x26c839,_0x57390e){return[{'text':util[_0xc3c9('0x1e')](_0xc3c9('0x52'),_0x65a546,_0x26c839,_0x57390e,_0x533bd7),'style':_0xc3c9('0x53')}];}};}function writePDFDocument(_0x56ff92,_0x1f8ba4){return new Promise(function(_0x2a75d5,_0x5befad){var _0x56534b=_0x56ff92[_0xc3c9('0x54')](fs['createWriteStream'](_0x1f8ba4));_0x56534b['on'](_0xc3c9('0x55'),function(){_0x2a75d5(_0xc3c9('0x55'));});_0x56534b['on'](_0xc3c9('0x56'),function(_0x21faa9){_0x5befad(_0x21faa9);});_0x56ff92[_0xc3c9('0x57')]();});}exports['createPdfFromHTML']=function(_0x25803f,_0x443383){var _0x548bf7=getPDFPrinter();var _0x530f38=getPDFDocDefinitionFromHTML(_0x25803f,_0x443383);var _0x1b4cb8=_0x548bf7[_0xc3c9('0x3b')](_0x530f38);return writePDFDocument(_0x1b4cb8,_0x443383[_0xc3c9('0x1')])['catch'](function(_0x3d75c9){throw _0x3d75c9;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 47ec4bf..93d414b 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 _0x2761=['range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','existsSync','join','mkdirSync','each','%s.%s','xlsx','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length'];(function(_0x16abc7,_0x335ed3){var _0x217493=function(_0x1248cf){while(--_0x1248cf){_0x16abc7['push'](_0x16abc7['shift']());}};_0x217493(++_0x335ed3);}(_0x2761,0x1c1));var _0x1276=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2761[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x1276('0x0'));var path=require('path');var _=require(_0x1276('0x1'));var fs=require('fs');var json2xls=require(_0x1276('0x2'));var BPromise=require(_0x1276('0x3'));var zipdir=require(_0x1276('0x4'));var rimraf=require(_0x1276('0x5'));var db=require(_0x1276('0x6'))['db'];var dbH=require(_0x1276('0x6'))[_0x1276('0x7')];var logger=require('../../config/logger')(_0x1276('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1276('0x9')][0x3];var PATH=process[_0x1276('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x335d29,_0x1242b0){var _0x12b6c3={'status':_0x335d29};var _0x1a30cb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1242b0){_0x12b6c3[_0x1276('0xa')]=_0x1242b0;}return db[_0x1276('0xb')]['update'](_0x12b6c3,_0x1a30cb);}function main(){var _0x454d17=0x1388;var _0x236a2d;logger[_0x1276('0xc')](util[_0x1276('0xd')](_0x1276('0xe'),EXTRACTED_REPORT_ID,_0x1276('0xf')));return db[_0x1276('0x10')][_0x1276('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1276('0x12')]})['then'](function(_0xd792a5){if(_0xd792a5){_0x236a2d=_0xd792a5;_0x454d17=_0x236a2d[_0x1276('0x12')]||0x1388;}})[_0x1276('0x13')](function(){return dbH[_0x1276('0x14')]['query'](util['format'](_0x1276('0x15'),QUERY),{'type':dbH[_0x1276('0x14')][_0x1276('0x16')][_0x1276('0x17')]});})['then'](function(_0x2f3db0){if(!_0x2f3db0[0x0][_0x1276('0x18')]){return analyticExtractedReport(_0x1276('0x19'));}var _0x1bc720=[];var _0x5f1775=0x0;if(_0x236a2d[_0x1276('0x1a')]){if(_0x2f3db0&&_0x2f3db0[_0x1276('0x1b')]){var _0x4be32f=_[_0x1276('0x1c')](_0x2f3db0[0x0][_0x1276('0x18')]/_0x454d17);var _0x6d2374=Number[_0x1276('0x1d')](_0x2f3db0[0x0][_0x1276('0x18')]/_0x454d17)?_0x2f3db0[0x0][_0x1276('0x18')]%_0x454d17:0x0;_0x4be32f[_0x1276('0x1e')](function(_0x5d4a1b){if(_0x5d4a1b>0x0){_0x5f1775+=_0x454d17;}_0x1bc720[_0x1276('0x1f')](dbH[_0x1276('0x14')]['query'](util['format'](_0x1276('0x20'),QUERY,_0x454d17,_0x5f1775),{'type':dbH[_0x1276('0x14')][_0x1276('0x16')][_0x1276('0x17')]}));});if(_0x6d2374>0x0){_0x5f1775+=_0x454d17;_0x1bc720[_0x1276('0x1f')](dbH[_0x1276('0x14')][_0x1276('0x21')](util[_0x1276('0xd')](_0x1276('0x20'),QUERY,_0x6d2374,_0x5f1775),{'type':dbH[_0x1276('0x14')]['QueryTypes'][_0x1276('0x17')]}));}}}else{_0x1bc720[_0x1276('0x1f')](dbH[_0x1276('0x14')][_0x1276('0x21')](QUERY,{'type':dbH[_0x1276('0x14')][_0x1276('0x16')][_0x1276('0x17')]}));}var _0xf8b2ba=path[_0x1276('0x22')](PATH);var _0x5bde32=path[_0x1276('0x23')](PATH,'.xlsx');var _0x35de7c=_0x236a2d['split']&&_0x1bc720[_0x1276('0x1b')]>0x1;var _0x434aee=[];if(!fs[_0x1276('0x24')](path[_0x1276('0x25')](_0xf8b2ba,_0x5bde32))&&_0x35de7c){fs[_0x1276('0x26')](path['join'](_0xf8b2ba,_0x5bde32));}return BPromise[_0x1276('0x27')](_0x1bc720,function(_0x23b244){_0x434aee['push'](_0x23b244);})[_0x1276('0x13')](function(){for(var _0x454e19=0x0;_0x454e19<_0x434aee['length'];_0x454e19+=0x1){var _0x27f948;var _0x419e51=_0x434aee[_0x454e19];if(_0x35de7c){_0x27f948=path['join'](_0xf8b2ba,_0x5bde32,util[_0x1276('0xd')]('%s%d.%s',_0x5bde32,_0x454e19,'xlsx'));}else{_0x27f948=path['join'](_0xf8b2ba,util['format'](_0x1276('0x28'),_0x5bde32,_0x1276('0x29')));}fs[_0x1276('0x2a')](_0x27f948,json2xls(_0x419e51),'binary');}})['then'](function(){if(_0x35de7c){return new Promise(function(_0x274125){zipdir(path[_0x1276('0x25')](_0xf8b2ba,_0x5bde32),{'saveTo':path[_0x1276('0x25')](_0xf8b2ba,util['format'](_0x1276('0x28'),_0x5bde32,_0x1276('0x2b')))},function(_0x53ab4a,_0x5b57b6){rimraf(path[_0x1276('0x25')](_0xf8b2ba,_0x5bde32),function(){});_0x274125(_0x1276('0x2c'));});});}})['then'](function(){logger[_0x1276('0xc')](util[_0x1276('0xd')](_0x1276('0x2d'),EXTRACTED_REPORT_ID,_0x1276('0xf')));return analyticExtractedReport(_0x1276('0x2e'),_0x35de7c?util[_0x1276('0xd')](_0x1276('0x28'),_0x5bde32,_0x35de7c?_0x1276('0x2b'):_0x1276('0x29')):null);});})[_0x1276('0x2f')](function(_0x19dea8){logger['info'](util[_0x1276('0xd')](_0x1276('0x30'),EXTRACTED_REPORT_ID,_0x1276('0xf')),util[_0x1276('0x31')](_0x19dea8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1276('0x32'));})[_0x1276('0x33')](function(){process[_0x1276('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6123=['finally','exit','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Failed'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0x6123,0x1e2));var _0x3612=function(_0x16637f,_0x49c8ec){_0x16637f=_0x16637f-0x0;var _0xb9441c=_0x6123[_0x16637f];return _0xb9441c;};'use strict';var util=require('util');var path=require(_0x3612('0x0'));var _=require(_0x3612('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x3612('0x2'));var zipdir=require(_0x3612('0x3'));var rimraf=require('rimraf');var db=require(_0x3612('0x4'))['db'];var dbH=require(_0x3612('0x4'))[_0x3612('0x5')];var logger=require(_0x3612('0x6'))(_0x3612('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x3612('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3612('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b6890,_0x5c768b){var _0x9ea90c={'status':_0x5b6890};var _0x25955b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c768b){_0x9ea90c['savename']=_0x5c768b;}return db[_0x3612('0x9')][_0x3612('0xa')](_0x9ea90c,_0x25955b);}function main(){var _0x1f58f3=0x1388;var _0xc739fd;logger[_0x3612('0xb')](util[_0x3612('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3612('0xd')));return db['Setting'][_0x3612('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3612('0xf'),_0x3612('0x10')]})[_0x3612('0x11')](function(_0xc40f7d){if(_0xc40f7d){_0xc739fd=_0xc40f7d;_0x1f58f3=_0xc739fd[_0x3612('0x10')]||0x1388;}})[_0x3612('0x11')](function(){return dbH['sequelize']['query'](util[_0x3612('0xc')](_0x3612('0x12'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x3612('0x13')]});})[_0x3612('0x11')](function(_0x576fa8){if(!_0x576fa8[0x0][_0x3612('0x14')]){return analyticExtractedReport(_0x3612('0x15'));}var _0x3b68d7=[];var _0x425eda=0x0;if(_0xc739fd['split']){if(_0x576fa8&&_0x576fa8[_0x3612('0x16')]){var _0x53688e=_[_0x3612('0x17')](_0x576fa8[0x0]['num']/_0x1f58f3);var _0x371a6f=Number[_0x3612('0x18')](_0x576fa8[0x0][_0x3612('0x14')]/_0x1f58f3)?_0x576fa8[0x0]['num']%_0x1f58f3:0x0;_0x53688e[_0x3612('0x19')](function(_0x1ababd){if(_0x1ababd>0x0){_0x425eda+=_0x1f58f3;}_0x3b68d7[_0x3612('0x1a')](dbH[_0x3612('0x1b')][_0x3612('0x1c')](util[_0x3612('0xc')](_0x3612('0x1d'),QUERY,_0x1f58f3,_0x425eda),{'type':dbH['sequelize']['QueryTypes'][_0x3612('0x13')]}));});if(_0x371a6f>0x0){_0x425eda+=_0x1f58f3;_0x3b68d7[_0x3612('0x1a')](dbH['sequelize'][_0x3612('0x1c')](util[_0x3612('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x371a6f,_0x425eda),{'type':dbH[_0x3612('0x1b')][_0x3612('0x1e')][_0x3612('0x13')]}));}}}else{_0x3b68d7['push'](dbH[_0x3612('0x1b')][_0x3612('0x1c')](QUERY,{'type':dbH['sequelize'][_0x3612('0x1e')]['SELECT']}));}var _0x35a16b=path['dirname'](PATH);var _0x582ff4=path[_0x3612('0x1f')](PATH,'.xlsx');var _0x95186b=_0xc739fd['split']&&_0x3b68d7[_0x3612('0x16')]>0x1;var _0x391293=[];if(!fs[_0x3612('0x20')](path[_0x3612('0x21')](_0x35a16b,_0x582ff4))&&_0x95186b){fs[_0x3612('0x22')](path['join'](_0x35a16b,_0x582ff4));}return BPromise[_0x3612('0x23')](_0x3b68d7,function(_0x4d5527){_0x391293['push'](_0x4d5527);})[_0x3612('0x11')](function(){for(var _0x53500a=0x0;_0x53500a<_0x391293[_0x3612('0x16')];_0x53500a+=0x1){var _0x283444;var _0x38b412=_0x391293[_0x53500a];if(_0x95186b){_0x283444=path['join'](_0x35a16b,_0x582ff4,util['format'](_0x3612('0x24'),_0x582ff4,_0x53500a,_0x3612('0x25')));}else{_0x283444=path[_0x3612('0x21')](_0x35a16b,util['format'](_0x3612('0x26'),_0x582ff4,'xlsx'));}fs[_0x3612('0x27')](_0x283444,json2xls(_0x38b412),_0x3612('0x28'));}})['then'](function(){if(_0x95186b){return new Promise(function(_0x5401fb){zipdir(path[_0x3612('0x21')](_0x35a16b,_0x582ff4),{'saveTo':path['join'](_0x35a16b,util[_0x3612('0xc')](_0x3612('0x26'),_0x582ff4,_0x3612('0x29')))},function(_0x2fc6e0,_0x215c7e){rimraf(path[_0x3612('0x21')](_0x35a16b,_0x582ff4),function(){});_0x5401fb(_0x3612('0x2a'));});});}})[_0x3612('0x11')](function(){logger[_0x3612('0xb')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3612('0xd')));return analyticExtractedReport(_0x3612('0x2b'),_0x95186b?util['format']('%s.%s',_0x582ff4,_0x95186b?'zip':_0x3612('0x25')):null);});})[_0x3612('0x2c')](function(_0x184fa2){logger[_0x3612('0xb')](util[_0x3612('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3612('0xd')),util['inspect'](_0x184fa2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3612('0x2d'));})[_0x3612('0x2e')](function(){process[_0x3612('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index aafc28c..3581a85 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 _0x75b7=['app','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','rewrite','util','models','Interval','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','push','type','Set','context','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf'];(function(_0x17cac8,_0x1a4c3a){var _0x3d0086=function(_0x523a44){while(--_0x523a44){_0x17cac8['push'](_0x17cac8['shift']());}};_0x3d0086(++_0x1a4c3a);}(_0x75b7,0x11f));var _0x775b=function(_0x1d36fb,_0xdde23e){_0x1d36fb=_0x1d36fb-0x0;var _0x20e579=_0x75b7[_0x1d36fb];return _0x20e579;};'use strict';var _=require('lodash');var util=require(_0x775b('0x0'));function rewrite(_0x21e6cc,_0x19d34a){var _0x4aeefe=this;return _0x21e6cc[_0x775b('0x1')][_0x775b('0x2')]['findAll']({'raw':!![]})[_0x775b('0x3')](function(_0x13286e){_0x4aeefe[_0x775b('0x4')]=_0x13286e;return _0x21e6cc[_0x775b('0x1')][_0x775b('0x5')]['findAll']({'where':{'IntervalId':_0x19d34a[_0x775b('0x6')]},'raw':!![]});})[_0x775b('0x3')](function(_0x3ff750){return _0x21e6cc['models'][_0x775b('0x5')]['findAll']({'where':{'exten':{'$in':_[_0x775b('0x7')](_['map'](_0x3ff750,_0x775b('0x8')))}},'order':[{'raw':_0x775b('0x9')}],'raw':!![]});})[_0x775b('0x3')](function(_0x5bc8ec){var _0x118e1e=_[_0x775b('0xa')](_0x5bc8ec,{'priority':'1'});var _0x246ea8=_[_0x775b('0xa')](_0x5bc8ec,{'isApp':0x1});var _0x10e86a=_[_0x775b('0xb')](_0x246ea8,'exten');var _0x7c3651=[_0x775b('0xc'),_0x775b('0xd')];var _0x2265c6=[];var _0x1c806e=[];for(var _0x253dd3 in _0x10e86a){if(_0x10e86a['hasOwnProperty'](_0x253dd3)){_0x4aeefe[_0x775b('0xe')]=0x2;_0x4aeefe[_0x775b('0xf')]=[];_0x4aeefe[_0x775b('0x10')]=_[_0x775b('0x11')](_0x118e1e,{'exten':_0x10e86a[_0x253dd3][0x0]['exten']});_0x4aeefe['extensions'][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':util['format']('CDR(type)=%s',_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')]),'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});if(_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')]===_0x775b('0x17')){_0x4aeefe['extensions'][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x18')+_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId'],'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0]['exten'],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});}else if(_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')]==='outbound'){if(_0x4aeefe['extension']){_0x4aeefe['extensions'][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x19')+(_0x4aeefe['extension'][_0x775b('0x1a')]?'${EXTEN:'+_0x4aeefe['extension'][_0x775b('0x1a')]+'}':'${EXTEN}'),'context':_0x10e86a[_0x253dd3][0x0]['context'],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId']});}_0x4aeefe[_0x775b('0xf')]['push']({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x18')+_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')],'context':_0x10e86a[_0x253dd3][0x0]['context'],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});var _0xaa337c=_0x4aeefe[_0x775b('0xe')]++;_0x4aeefe[_0x775b('0xf')][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':'ExecIf','appdata':_0x775b('0x1b')+(_0xaa337c+0x2)+_0x775b('0x1c')+(_0xaa337c+0x1)+')','context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0xaa337c,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});if(_0x4aeefe['extension']){_0x4aeefe[_0x775b('0xf')]['push']({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':'Set','appdata':_0x4aeefe[_0x775b('0x10')][_0x775b('0x1a')]?_0x775b('0x1d')+_0x4aeefe[_0x775b('0x10')][_0x775b('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x10e86a[_0x253dd3][0x0]['context'],'exten':_0x10e86a[_0x253dd3][0x0]['exten'],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});}_0x4aeefe['extensions'][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x1e')+_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')],'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0]['exten'],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId']});if(_0x4aeefe[_0x775b('0x10')]&&_0x4aeefe[_0x775b('0x10')][_0x775b('0x1f')](_0x775b('0x20'))&&_0x4aeefe['extension'][_0x775b('0x20')]!==_0x775b('0x21')){_0x4aeefe[_0x775b('0xf')][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId']});_0x4aeefe['extensions']['push']({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x22')+_0x4aeefe[_0x775b('0x10')][_0x775b('0x20')]||_0x775b('0x23'),'context':_0x10e86a[_0x253dd3][0x0]['context'],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});}}_0x4aeefe['extensions'][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x24'),'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'priority':_0x4aeefe[_0x775b('0xe')]++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});_0x4aeefe[_0x775b('0xf')][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0]['type'],'app':'Set','appdata':_0x775b('0x25'),'context':_0x10e86a[_0x253dd3][0x0]['context'],'exten':_0x10e86a[_0x253dd3][0x0]['exten'],'priority':_0x4aeefe['priority']++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId']});_0x4aeefe['extensions']['push']({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x26'),'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'exten':_0x10e86a[_0x253dd3][0x0]['exten'],'priority':_0x4aeefe['priority']++,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});for(var _0x1c0009=0x0,_0x10794f=0x0;_0x1c0009<_0x10e86a[_0x253dd3]['length'];_0x1c0009+=0x1,_0x10794f=0x0){var _0x2ddc2b=_0x10e86a[_0x253dd3][_0x1c0009];if(_0x2ddc2b[_0x775b('0x13')]){_0x2ddc2b[_0x775b('0x13')]=_0x2ddc2b['type'][_0x775b('0x27')]();}var _0x53d2e3=[];var _0x4c4afc=[];delete _0x2ddc2b['id'];delete _0x2ddc2b[_0x775b('0x28')];delete _0x2ddc2b[_0x775b('0x29')];var _0x20af47=_0x2ddc2b[_0x775b('0x2a')]!==_0x775b('0x2b')?[_0x2ddc2b[_0x775b('0x2a')]]:_0x2ddc2b[_0x775b('0x6')]?_['map'](_[_0x775b('0xa')](_0x4aeefe[_0x775b('0x4')],{'IntervalId':_0x2ddc2b[_0x775b('0x6')]}),_0x775b('0x2a')):[];if(_0x2ddc2b[_0x775b('0x1f')](_0x775b('0x2c'))){if(_0x2ddc2b[_0x775b('0x2c')]&&_0x2ddc2b[_0x775b('0x2c')]!=='--'){_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':_0x775b('0x2d')+_0x2ddc2b[_0x775b('0x2c')],'context':_0x2ddc2b[_0x775b('0x15')],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47[_0x775b('0x2e')]+_0x4aeefe['priority']+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});}}if(_0x2ddc2b['type']===_0x775b('0x2f')&&_0x2ddc2b[_0x775b('0x1f')](_0x775b('0x30'))){if(_0x2ddc2b[_0x775b('0x30')]){_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x31'),'appdata':_0x775b('0x32')+_0x2ddc2b['callerID']+')','context':_0x2ddc2b['context'],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47['length']+_0x4aeefe['priority']+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});}else{_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b['type'],'app':_0x775b('0x31'),'appdata':_0x775b('0x33'),'context':_0x2ddc2b[_0x775b('0x15')],'exten':_0x2ddc2b['exten'],'priority':_0x20af47['length']+_0x4aeefe['priority']+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});}}if(_0x2ddc2b[_0x775b('0x1f')]('answer')){if(_0x7c3651[_0x775b('0x34')](_0x2ddc2b[_0x775b('0x35')][_0x775b('0x27')]())>=0x0&&_0x2ddc2b['appType']!=='custom'){if(_0x2ddc2b[_0x775b('0x36')]){_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':'ExecIf','appdata':_0x775b('0x37'),'context':_0x2ddc2b['context'],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47['length']+_0x4aeefe[_0x775b('0xe')]+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2ddc2b['context'],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47[_0x775b('0x2e')]+_0x4aeefe['priority']+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});}else{_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x31'),'appdata':_0x775b('0x38'),'context':_0x2ddc2b[_0x775b('0x15')],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47[_0x775b('0x2e')]+_0x4aeefe[_0x775b('0xe')]+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});_0x53d2e3[_0x775b('0x12')]({'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2ddc2b['context'],'exten':_0x2ddc2b[_0x775b('0x8')],'priority':_0x20af47['length']+_0x4aeefe[_0x775b('0xe')]+_0x10794f++,'VoiceExtensionId':_0x2ddc2b[_0x775b('0x16')]});}}}for(var _0x1f9222=0x0;_0x1f9222<_0x20af47['length'];_0x1f9222+=0x1){var _0x40e4fc=_0x4aeefe[_0x775b('0xe')]+_0x20af47['length'];var _0x1a2e74=_0x1f9222===_0x20af47['length']-0x1?_0x4aeefe[_0x775b('0xe')]+_0x53d2e3[_0x775b('0x2e')]+_0x4c4afc[_0x775b('0x2e')]+0x2:_0x4aeefe[_0x775b('0xe')]+_0x1f9222+0x1;_0x53d2e3[_0x775b('0x39')](_0x1f9222,0x0,{'type':_0x2ddc2b[_0x775b('0x13')],'app':_0x775b('0x3a'),'appdata':_0x20af47[_0x1f9222]+'?'+_0x2ddc2b[_0x775b('0x15')]+_0x775b('0x3b')+_0x40e4fc+':'+_0x2ddc2b[_0x775b('0x15')]+_0x775b('0x3b')+_0x1a2e74,'exten':_0x2ddc2b[_0x775b('0x8')],'context':_0x2ddc2b[_0x775b('0x15')],'priority':_0x4aeefe[_0x775b('0xe')]+_0x1f9222,'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]});}_0x2ddc2b['priority']=_0x53d2e3[_0x775b('0x2e')]?_['last'](_0x53d2e3)[_0x775b('0xe')]+0x1:_0x4aeefe[_0x775b('0xe')];_0x4aeefe[_0x775b('0xe')]=(_0x4c4afc[_0x775b('0x2e')]?_['last'](_0x4c4afc)[_0x775b('0xe')]:_0x2ddc2b[_0x775b('0xe')])+0x1;_0x4aeefe[_0x775b('0xf')]=_[_0x775b('0x3c')](_0x4aeefe['extensions'],_0x53d2e3,[_0x2ddc2b],_0x4c4afc);}_0x4aeefe[_0x775b('0xf')][_0x775b('0x12')]({'type':_0x10e86a[_0x253dd3][0x0][_0x775b('0x13')],'app':_0x775b('0x3d'),'exten':_0x10e86a[_0x253dd3][0x0][_0x775b('0x8')],'context':_0x10e86a[_0x253dd3][0x0][_0x775b('0x15')],'priority':_0x4aeefe[_0x775b('0xe')],'VoiceExtensionId':_0x10e86a[_0x253dd3][0x0]['VoiceExtensionId']});_0x2265c6['push'](_0x10e86a[_0x253dd3][0x0][_0x775b('0x16')]);_0x1c806e=_[_0x775b('0x3c')](_0x1c806e,_0x4aeefe['extensions']);}}return _0x21e6cc['transaction'](function(_0x1e9142){return _0x21e6cc[_0x775b('0x1')][_0x775b('0x5')][_0x775b('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x2265c6}},'transaction':_0x1e9142})['then'](function(_0x3091e1){return _0x21e6cc['models']['VoiceExtension'][_0x775b('0x3f')](_[_0x775b('0x40')](_0x1c806e,_0x775b('0xe')),{'transaction':_0x1e9142});});});})[_0x775b('0x41')](function(_0x163b61){console[_0x775b('0x42')](_0x163b61);});}exports[_0x775b('0x43')]=rewrite; \ No newline at end of file +var _0x0596=['models','findAll','then','VoiceExtension','uniq','exten','filter','groupBy','queue','hasOwnProperty','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','util'];(function(_0x527660,_0x52afee){var _0x317a43=function(_0x272627){while(--_0x272627){_0x527660['push'](_0x527660['shift']());}};_0x317a43(++_0x52afee);}(_0x0596,0x167));var _0x6059=function(_0x28d572,_0x1eb718){_0x28d572=_0x28d572-0x0;var _0x18ac52=_0x0596[_0x28d572];return _0x18ac52;};'use strict';var _=require('lodash');var util=require(_0x6059('0x0'));function rewrite(_0x1ab22c,_0x4e5247){var _0xcbd765=this;return _0x1ab22c[_0x6059('0x1')]['Interval'][_0x6059('0x2')]({'raw':!![]})[_0x6059('0x3')](function(_0x18ece2){_0xcbd765['intervals']=_0x18ece2;return _0x1ab22c['models'][_0x6059('0x4')]['findAll']({'where':{'IntervalId':_0x4e5247['IntervalId']},'raw':!![]});})[_0x6059('0x3')](function(_0x44b4b6){return _0x1ab22c[_0x6059('0x1')][_0x6059('0x4')]['findAll']({'where':{'exten':{'$in':_[_0x6059('0x5')](_['map'](_0x44b4b6,_0x6059('0x6')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x2e0fb7){var _0x14cd84=_[_0x6059('0x7')](_0x2e0fb7,{'priority':'1'});var _0x53cac1=_[_0x6059('0x7')](_0x2e0fb7,{'isApp':0x1});var _0x3fbbab=_[_0x6059('0x8')](_0x53cac1,_0x6059('0x6'));var _0x932b93=[_0x6059('0x9'),'playback'];var _0x36befd=[];var _0x51916a=[];for(var _0x359ad8 in _0x3fbbab){if(_0x3fbbab[_0x6059('0xa')](_0x359ad8)){_0xcbd765['priority']=0x2;_0xcbd765['extensions']=[];_0xcbd765[_0x6059('0xb')]=_[_0x6059('0xc')](_0x14cd84,{'exten':_0x3fbbab[_0x359ad8][0x0]['exten']});_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':util[_0x6059('0x11')](_0x6059('0x12'),_0x3fbbab[_0x359ad8][0x0]['type']),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});if(_0x3fbbab[_0x359ad8][0x0]['type']===_0x6059('0x16')){_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x17')+_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')],'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765['priority']++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0]['VoiceExtensionId']});}else if(_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')]===_0x6059('0x18')){if(_0xcbd765[_0x6059('0xb')]){_0xcbd765[_0x6059('0xd')]['push']({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x19')+(_0xcbd765[_0x6059('0xb')]['cutdigits']?'${EXTEN:'+_0xcbd765[_0x6059('0xb')][_0x6059('0x1a')]+'}':_0x6059('0x1b')),'context':_0x3fbbab[_0x359ad8][0x0]['context'],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765['priority']++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});}_0xcbd765[_0x6059('0xd')]['push']({'type':_0x3fbbab[_0x359ad8][0x0]['type'],'app':_0x6059('0x10'),'appdata':_0x6059('0x17')+_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')],'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0]['exten'],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});var _0x1a0aa8=_0xcbd765['priority']++;_0xcbd765['extensions'][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x1c'),'appdata':_0x6059('0x1d')+(_0x1a0aa8+0x2)+_0x6059('0x1e')+(_0x1a0aa8+0x1)+')','context':_0x3fbbab[_0x359ad8][0x0]['context'],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0x1a0aa8,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});if(_0xcbd765[_0x6059('0xb')]){_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0xcbd765[_0x6059('0xb')][_0x6059('0x1a')]?_0x6059('0x1f')+_0xcbd765[_0x6059('0xb')][_0x6059('0x1a')]+'}':_0x6059('0x20'),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});}_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x21')+_0x3fbbab[_0x359ad8][0x0]['VoiceExtensionId'],'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0]['exten'],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});if(_0xcbd765[_0x6059('0xb')]&&_0xcbd765[_0x6059('0xb')][_0x6059('0xa')](_0x6059('0x22'))&&_0xcbd765[_0x6059('0xb')][_0x6059('0x22')]!==_0x6059('0x23')){_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xcbd765[_0x6059('0xb')][_0x6059('0x22')]||_0x6059('0x24'),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});}}_0xcbd765[_0x6059('0xd')]['push']({'type':_0x3fbbab[_0x359ad8][0x0]['type'],'app':_0x6059('0x10'),'appdata':_0x6059('0x25'),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0]['VoiceExtensionId']});_0xcbd765['extensions'][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x26'),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'priority':_0xcbd765[_0x6059('0x14')]++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0]['VoiceExtensionId']});_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0][_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x27'),'context':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x13')],'exten':_0x3fbbab[_0x359ad8][0x0]['exten'],'priority':_0xcbd765['priority']++,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});for(var _0x535516=0x0,_0x1687d4=0x0;_0x535516<_0x3fbbab[_0x359ad8][_0x6059('0x28')];_0x535516+=0x1,_0x1687d4=0x0){var _0x5ce23d=_0x3fbbab[_0x359ad8][_0x535516];if(_0x5ce23d[_0x6059('0xf')]){_0x5ce23d['type']=_0x5ce23d[_0x6059('0xf')][_0x6059('0x29')]();}var _0x3422b3=[];var _0xf07b21=[];delete _0x5ce23d['id'];delete _0x5ce23d[_0x6059('0x2a')];delete _0x5ce23d[_0x6059('0x2b')];var _0x537f5d=_0x5ce23d[_0x6059('0x2c')]!==_0x6059('0x2d')?[_0x5ce23d[_0x6059('0x2c')]]:_0x5ce23d[_0x6059('0x2e')]?_[_0x6059('0x2f')](_[_0x6059('0x7')](_0xcbd765[_0x6059('0x30')],{'IntervalId':_0x5ce23d[_0x6059('0x2e')]}),_0x6059('0x2c')):[];if(_0x5ce23d[_0x6059('0xa')](_0x6059('0x31'))){if(_0x5ce23d[_0x6059('0x31')]&&_0x5ce23d[_0x6059('0x31')]!=='--'){_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x32')+_0x5ce23d[_0x6059('0x31')],'context':_0x5ce23d['context'],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d[_0x6059('0x28')]+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});}}if(_0x5ce23d[_0x6059('0xf')]===_0x6059('0x18')&&_0x5ce23d[_0x6059('0xa')](_0x6059('0x33'))){if(_0x5ce23d[_0x6059('0x33')]){_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x1c'),'appdata':_0x6059('0x34')+_0x5ce23d[_0x6059('0x33')]+')','context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d[_0x6059('0x28')]+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});}else{_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x1c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d[_0x6059('0x28')]+_0xcbd765['priority']+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});}}if(_0x5ce23d['hasOwnProperty']('answer')){if(_0x932b93[_0x6059('0x35')](_0x5ce23d[_0x6059('0x36')]['toLowerCase']())>=0x0&&_0x5ce23d['appType']!==_0x6059('0x37')){if(_0x5ce23d[_0x6059('0x38')]){_0x3422b3['push']({'type':_0x5ce23d['type'],'app':_0x6059('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d['length']+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x39'),'context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d['exten'],'priority':_0x537f5d['length']+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});}else{_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x1c'),'appdata':_0x6059('0x3a'),'context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d[_0x6059('0x28')]+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d['VoiceExtensionId']});_0x3422b3[_0x6059('0xe')]({'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x10'),'appdata':_0x6059('0x3b'),'context':_0x5ce23d[_0x6059('0x13')],'exten':_0x5ce23d[_0x6059('0x6')],'priority':_0x537f5d[_0x6059('0x28')]+_0xcbd765[_0x6059('0x14')]+_0x1687d4++,'VoiceExtensionId':_0x5ce23d[_0x6059('0x15')]});}}}for(var _0x4d9c94=0x0;_0x4d9c94<_0x537f5d[_0x6059('0x28')];_0x4d9c94+=0x1){var _0x283e96=_0xcbd765[_0x6059('0x14')]+_0x537f5d['length'];var _0x39da0d=_0x4d9c94===_0x537f5d['length']-0x1?_0xcbd765['priority']+_0x3422b3[_0x6059('0x28')]+_0xf07b21[_0x6059('0x28')]+0x2:_0xcbd765[_0x6059('0x14')]+_0x4d9c94+0x1;_0x3422b3[_0x6059('0x3c')](_0x4d9c94,0x0,{'type':_0x5ce23d[_0x6059('0xf')],'app':_0x6059('0x3d'),'appdata':_0x537f5d[_0x4d9c94]+'?'+_0x5ce23d['context']+_0x6059('0x3e')+_0x283e96+':'+_0x5ce23d[_0x6059('0x13')]+_0x6059('0x3e')+_0x39da0d,'exten':_0x5ce23d[_0x6059('0x6')],'context':_0x5ce23d['context'],'priority':_0xcbd765[_0x6059('0x14')]+_0x4d9c94,'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});}_0x5ce23d[_0x6059('0x14')]=_0x3422b3['length']?_[_0x6059('0x3f')](_0x3422b3)[_0x6059('0x14')]+0x1:_0xcbd765['priority'];_0xcbd765['priority']=(_0xf07b21['length']?_[_0x6059('0x3f')](_0xf07b21)['priority']:_0x5ce23d['priority'])+0x1;_0xcbd765[_0x6059('0xd')]=_[_0x6059('0x40')](_0xcbd765[_0x6059('0xd')],_0x3422b3,[_0x5ce23d],_0xf07b21);}_0xcbd765[_0x6059('0xd')][_0x6059('0xe')]({'type':_0x3fbbab[_0x359ad8][0x0]['type'],'app':_0x6059('0x41'),'exten':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x6')],'context':_0x3fbbab[_0x359ad8][0x0]['context'],'priority':_0xcbd765['priority'],'VoiceExtensionId':_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]});_0x36befd[_0x6059('0xe')](_0x3fbbab[_0x359ad8][0x0][_0x6059('0x15')]);_0x51916a=_['concat'](_0x51916a,_0xcbd765[_0x6059('0xd')]);}}return _0x1ab22c[_0x6059('0x42')](function(_0x511773){return _0x1ab22c[_0x6059('0x1')][_0x6059('0x4')][_0x6059('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x36befd}},'transaction':_0x511773})['then'](function(_0x19d8e2){return _0x1ab22c[_0x6059('0x1')][_0x6059('0x4')][_0x6059('0x44')](_[_0x6059('0x45')](_0x51916a,_0x6059('0x14')),{'transaction':_0x511773});});});})['catch'](function(_0x563c74){console[_0x6059('0x46')](_0x563c74);});}exports[_0x6059('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 87304bb..5c22659 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 _0x156c=['CmContact','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','catch','all','VoiceQueue','CmList','BlackLists','Campaign','CampaignId','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','exit','SIGINT','info','split','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','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','ListId','length','find'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x156c,0xae));var _0xc156=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x156c[_0x44946b];return _0x249bc4;};'use strict';var BPromise=require(_0xc156('0x0'));var util=require(_0xc156('0x1'));var _=require(_0xc156('0x2'));var fs=require('fs');var squel=require(_0xc156('0x3'));var Papa=require(_0xc156('0x4'));var Redis=require(_0xc156('0x5'));var db=require(_0xc156('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('api');config[_0xc156('0x7')]=_[_0xc156('0x8')](config[_0xc156('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc156('0x9'))(new Redis(config[_0xc156('0x7')]));require(_0xc156('0xa'))[_0xc156('0xb')](socket);try{if(!process[_0xc156('0xc')][0x2]||process['argv'][0x2]==='undefined'||process[_0xc156('0xc')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xc156('0xc')][0x2];if(!process[_0xc156('0xc')][0x3]||process['argv'][0x3]==='undefined'||process[_0xc156('0xc')][0x3]===_0xc156('0xd')||!process[_0xc156('0xc')][0x4]||process[_0xc156('0xc')][0x4]===_0xc156('0xe')||process[_0xc156('0xc')][0x4]===_0xc156('0xd')){throw new Error(_0xc156('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process[_0xc156('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xc156('0xc')][0x5]===_0xc156('0xe')||process['argv'][0x5]==='null'){throw new Error(_0xc156('0x10'));}var LISTID=process[_0xc156('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xc156('0xc')][0x6]!=='undefined'&&process[_0xc156('0xc')][0x6]!==_0xc156('0xd')?process[_0xc156('0xc')][0x6]:null;var DUPLICATES=process[_0xc156('0xc')][0x7]&&process['argv'][0x7]!==_0xc156('0xe')&&process['argv'][0x7]!==_0xc156('0xd')?process[_0xc156('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0xc156('0xc')][0x8]===_0xc156('0xe')||process['argv'][0x8]===_0xc156('0xd')){throw new Error(_0xc156('0x11'));}var SOCKET_TIMESTAMP=process[_0xc156('0xc')][0x8];}catch(_0x1a424f){logger[_0xc156('0x12')](_0x1a424f);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(_0x2b7205,_0x1b8b75,_0x140103,_0x1343f8){var _0x15dd51={'message':_0x1b8b75};_0x15dd51[_0x2b7205]=!![];if(_0x140103){_0x15dd51[_0xc156('0x13')]=_0x140103;}if(_0x1343f8){_0x15dd51[_0xc156('0x14')]=_0x1343f8;}return _0x15dd51;}function isEmail(_0x24ed67){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))*$/[_0xc156('0x15')](_0x24ed67);}function checkRow(_0x14d115,_0x5a57a9,_0x4f3b58){return new BPromise(function(_0x4df147,_0x131927){if(_[_0xc156('0x16')](_0x14d115)){return _0x131927(handleCheckRowError(_0xc156('0x12'),_0xc156('0x17'),null,_0x4f3b58));}if(_0x14d115['errors']&&_0x14d115[_0xc156('0x18')]['length']){var _0x3f7afc=_[_0xc156('0x19')](_0x14d115[_0xc156('0x18')],_0xc156('0x1a'))[_0xc156('0x1b')](';');return _0x131927(handleCheckRowError('error',_0x3f7afc,null,_0x4f3b58));}var _0x434b75={};for(var _0x3219a7 in FIELDS){if(FIELDS[_0xc156('0x1c')](_0x3219a7)&&FIELDS[_0x3219a7]){_0x434b75[_0x3219a7]=_0x14d115[_0xc156('0x1d')][0x0][FIELDS[_0x3219a7]]||_0x14d115[_0xc156('0x1d')][0x0]['\ufeff'+FIELDS[_0x3219a7]];}}if(!_0x434b75[_0xc156('0x1e')]){return _0x131927(handleCheckRowError('error',_0xc156('0x1f'),null,_0x4f3b58));}if(!_0x434b75[_0xc156('0x20')]){return _0x131927(handleCheckRowError(_0xc156('0x12'),_0xc156('0x21'),null,_0x4f3b58));}if(_0x434b75[_0xc156('0x22')]){var _0x4a52be=moment(_0x434b75['birthDate'],_0xc156('0x23'));if(!_0x4a52be[_0xc156('0x24')]()){return _0x131927(handleCheckRowError('error',_0xc156('0x25'),null,_0x4f3b58));}}if(_0x434b75[_0xc156('0x26')]){if(!isEmail(_0x434b75['email'])){return _0x131927(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x4f3b58));}}_0x434b75[_0xc156('0x27')]=LISTID;_0x434b75['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc156('0x28')]&&_0x5a57a9){var _0x1a19e5={};for(var _0x257ef4=0x0,_0x3a094e=DUPLICATES[_0xc156('0x28')];_0x257ef4<_0x3a094e;_0x257ef4+=0x1){_0x1a19e5[DUPLICATES[_0x257ef4]]=_0x434b75[DUPLICATES[_0x257ef4]];}var _0xeab26a=_[_0xc156('0x29')](_0x5a57a9,_0x1a19e5);if(_0xeab26a){return _0x131927(handleCheckRowError('duplicate','Duplicate\x20Contact',_0xeab26a,_0x4f3b58));}}return db[_0xc156('0x2a')]['create'](_0x434b75,{'raw':!![],'hooks':![],'fields':_[_0xc156('0x2b')](_0x434b75)})[_0xc156('0x2c')](function(_0x3dca05){if(DUPLICATES&&DUPLICATES[_0xc156('0x28')]&&_0x5a57a9){_0x5a57a9[_0xc156('0x2d')](_[_0xc156('0x2e')](_0x434b75,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3dca05['id'];return _0x4df147();})['catch'](function(_0x32d0f3){return _0x131927(handleCheckRowError(_0xc156('0x12'),_0xc156('0x2f')+(_0x32d0f3[_0xc156('0x1a')]||JSON[_0xc156('0x30')](_0x32d0f3)),null,_0x4f3b58));});});}function checkHopper(){function _0x313cac(){return function(_0x5c67a3){logger[_0xc156('0x12')](_0xc156('0x31'),'checkHopper',util[_0xc156('0x32')](_0x5c67a3,{'showHidden':![],'depth':null}));};}var _0x504e2f=function(_0x5860f5,_0x5f5cef){var _0xdfddce=squel[_0xc156('0x33')]()[_0xc156('0x34')]('cm_hopper')[_0xc156('0x35')]([_0xc156('0x20'),_0xc156('0x36'),'ContactId',_0xc156('0x27'),_0x5f5cef,_0xc156('0x37'),_0xc156('0x38')],squel[_0xc156('0x39')]()[_0xc156('0x3a')](_0xc156('0x20'),_0xc156('0x20'))[_0xc156('0x3a')](_0xc156('0x3b'),_0xc156('0x36'))[_0xc156('0x3a')]('id',_0xc156('0x3c'))[_0xc156('0x3a')](LISTID[_0xc156('0x3d')](),_0xc156('0x27'))[_0xc156('0x3a')](_0x5860f5['id'][_0xc156('0x3d')](),_0x5f5cef)['field'](_0xc156('0x3b'),_0xc156('0x37'))[_0xc156('0x3a')]('NOW()',_0xc156('0x38'))['from']('cm_contacts')['where'](_0xc156('0x3e'))[_0xc156('0x3f')](_0xc156('0x40'),LISTID[_0xc156('0x3d')]())['where'](_0xc156('0x41'))['where'](_0xc156('0x42'),squel[_0xc156('0x39')]()[_0xc156('0x3a')](_0xc156('0x20'))[_0xc156('0x43')](_0xc156('0x44'))[_0xc156('0x3f')](_0x5f5cef+_0xc156('0x45'),_0x5860f5['id']['toString']())))[_0xc156('0x3d')]();return _0xdfddce;};var _0x1fd01d=function(_0x2c6106,_0x4484ab){var _0x4a3ecc=squel[_0xc156('0x33')]()[_0xc156('0x34')](_0xc156('0x44'))[_0xc156('0x35')](['phone',_0xc156('0x36'),_0xc156('0x3c'),_0xc156('0x27'),_0x4484ab,_0xc156('0x37'),_0xc156('0x38')],squel[_0xc156('0x39')]()[_0xc156('0x3a')](_0xc156('0x20'),_0xc156('0x20'))['field'](_0xc156('0x3b'),_0xc156('0x36'))[_0xc156('0x3a')]('id',_0xc156('0x3c'))[_0xc156('0x3a')](LISTID[_0xc156('0x3d')](),_0xc156('0x27'))['field'](_0x2c6106['id'][_0xc156('0x3d')](),_0x4484ab)['field']('NOW()',_0xc156('0x37'))['field'](_0xc156('0x3b'),_0xc156('0x38'))[_0xc156('0x43')](_0xc156('0x46'))['where']('deletedAt\x20IS\x20NULL')[_0xc156('0x3f')](_0xc156('0x40'),LISTID['toString']())[_0xc156('0x3f')](_0xc156('0x47'),squel[_0xc156('0x48')](hopperContacts))[_0xc156('0x3f')](_0xc156('0x41'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xc156('0x39')]()[_0xc156('0x3a')](_0xc156('0x49'))[_0xc156('0x43')](_0xc156('0x4a'))[_0xc156('0x3f')](_0x4484ab+_0xc156('0x45'),_0x2c6106['id'][_0xc156('0x3d')]()))[_0xc156('0x3f')](_0xc156('0x42'),squel[_0xc156('0x39')]()[_0xc156('0x3a')]('phone')['from']('cm_hopper')[_0xc156('0x3f')](_0x4484ab+'\x20=\x20?',_0x2c6106['id'][_0xc156('0x3d')]())))[_0xc156('0x3d')]();return _0x4a3ecc;};function _0x17fc00(_0x53ef44,_0x4d97b7){var _0x5ca0bb=squel[_0xc156('0x33')]()[_0xc156('0x34')](_0xc156('0x44'))[_0xc156('0x35')]([_0xc156('0x20'),_0xc156('0x36'),_0xc156('0x3c'),_0xc156('0x27'),_0x4d97b7,_0xc156('0x37'),_0xc156('0x38')],squel['select']()[_0xc156('0x3a')](_0xc156('0x20'),'phone')[_0xc156('0x3a')]('NOW()',_0xc156('0x36'))[_0xc156('0x3a')]('id',_0xc156('0x3c'))['field'](LISTID[_0xc156('0x3d')](),_0xc156('0x27'))[_0xc156('0x3a')](_0x53ef44['id']['toString'](),_0x4d97b7)[_0xc156('0x3a')](_0xc156('0x3b'),_0xc156('0x37'))[_0xc156('0x3a')]('NOW()',_0xc156('0x38'))[_0xc156('0x43')](_0xc156('0x46'))[_0xc156('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc156('0x3f')](_0xc156('0x40'),LISTID['toString']())['where'](_0xc156('0x47'),squel[_0xc156('0x48')](hopperContacts))[_0xc156('0x3f')](_0xc156('0x41')))['toString']();return _0x5ca0bb;}function _0x5ea7ce(_0x93b703,_0x12d626){var _0x1a0a67=squel[_0xc156('0x33')]()[_0xc156('0x34')](_0xc156('0x4b'))[_0xc156('0x35')]([_0xc156('0x20'),'ContactId','ListId',_0x12d626,_0xc156('0x37'),'updatedAt'],squel['select']()[_0xc156('0x3a')](_0xc156('0x20'),_0xc156('0x20'))[_0xc156('0x3a')]('id',_0xc156('0x3c'))[_0xc156('0x3a')](LISTID[_0xc156('0x3d')](),'ListId')[_0xc156('0x3a')](_0x93b703['id'][_0xc156('0x3d')](),_0x12d626)['field'](_0xc156('0x3b'),_0xc156('0x37'))[_0xc156('0x3a')](_0xc156('0x3b'),_0xc156('0x38'))[_0xc156('0x43')](_0xc156('0x46'))[_0xc156('0x3f')](_0xc156('0x3e'))[_0xc156('0x3f')](_0xc156('0x40'),LISTID[_0xc156('0x3d')]())['where'](_0xc156('0x47'),squel[_0xc156('0x48')](hopperContacts))['where'](_0xc156('0x41')))['toString']();return _0x1a0a67;}return db['VoiceQueue'][_0xc156('0x4c')]({'where':{'type':_0xc156('0x4d')},'attributes':['id',_0xc156('0x4e')],'include':[{'model':db['CmList'],'as':_0xc156('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0xf5a7f4){var _0xe18ee5=[];if(_0xf5a7f4){var _0xce6a04;for(var _0x163c7a=0x0,_0x421e85;_0x163c7a<_0xf5a7f4[_0xc156('0x28')];_0x163c7a+=0x1){_0x421e85=_0xf5a7f4[_0x163c7a][_0xc156('0x50')]({'plain':!![]});switch(_0x421e85[_0xc156('0x4e')]){case _0xc156('0x51'):_0xe18ee5['push'](db[_0xc156('0x52')][_0xc156('0x53')](_0x1fd01d(_0x421e85,'VoiceQueueId'))[_0xc156('0x2c')](function(){})['catch'](_0x313cac()));break;case _0xc156('0x54'):_0xe18ee5[_0xc156('0x2d')](db[_0xc156('0x52')][_0xc156('0x53')](_0x504e2f(_0x421e85,_0xc156('0x55')))[_0xc156('0x2c')](function(){})['catch'](_0x313cac()));break;default:_0xe18ee5['push'](db[_0xc156('0x52')][_0xc156('0x53')](_0x17fc00(_0x421e85,'VoiceQueueId'))[_0xc156('0x2c')](function(){})[_0xc156('0x56')](_0x313cac()));}}}return _0xe18ee5;})[_0xc156('0x57')]()[_0xc156('0x2c')](function(){return db[_0xc156('0x58')][_0xc156('0x4c')]({'where':{'type':_0xc156('0x4d')},'attributes':['id'],'include':[{'model':db[_0xc156('0x59')],'as':_0xc156('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x4a65dc){var _0x475e87=[];if(_0x4a65dc){var _0x31c7e0;for(var _0x58224f=0x0,_0x1f6340;_0x58224f<_0x4a65dc[_0xc156('0x28')];_0x58224f+=0x1){_0x1f6340=_0x4a65dc[_0x58224f][_0xc156('0x50')]({'plain':!![]});_0x475e87[_0xc156('0x2d')](db[_0xc156('0x52')][_0xc156('0x53')](_0x5ea7ce(_0x1f6340,_0xc156('0x55')))['then'](function(){})['catch'](_0x313cac()));}}return _0x475e87;})[_0xc156('0x57')]();})[_0xc156('0x2c')](function(){return db[_0xc156('0x5b')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xc156('0x4f'),'where':{'id':LISTID}}]})[_0xc156('0x2c')](function(_0x136b1d){var _0x2f070b=[];if(_0x136b1d){for(var _0x5c58f0=0x0,_0x146043;_0x5c58f0<_0x136b1d['length'];_0x5c58f0+=0x1){_0x146043=_0x136b1d[_0x5c58f0][_0xc156('0x50')]({'plain':!![]});switch(_0x146043[_0xc156('0x4e')]){case _0xc156('0x51'):_0x2f070b[_0xc156('0x2d')](db[_0xc156('0x52')][_0xc156('0x53')](_0x1fd01d(_0x146043,_0xc156('0x5c')))['then'](function(){})['catch'](_0x313cac()));break;case _0xc156('0x54'):_0x2f070b[_0xc156('0x2d')](db[_0xc156('0x52')][_0xc156('0x53')](_0x504e2f(_0x146043,_0xc156('0x5c')))[_0xc156('0x2c')](function(){})[_0xc156('0x56')](_0x313cac()));break;default:_0x2f070b[_0xc156('0x2d')](db[_0xc156('0x52')][_0xc156('0x53')](_0x17fc00(_0x146043,_0xc156('0x5c')))[_0xc156('0x2c')](function(){})[_0xc156('0x56')](_0x313cac()));}}}return _0x2f070b;})[_0xc156('0x57')]();})[_0xc156('0x2c')](function(){return db[_0xc156('0x5b')][_0xc156('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xc156('0x59')],'as':_0xc156('0x5a'),'where':{'id':LISTID}}]})[_0xc156('0x2c')](function(_0x231855){var _0x3e215f=[];if(_0x231855){for(var _0x582b78=0x0,_0x1e4dda;_0x582b78<_0x231855[_0xc156('0x28')];_0x582b78+=0x1){_0x1e4dda=_0x231855[_0x582b78][_0xc156('0x50')]({'plain':!![]});_0x3e215f[_0xc156('0x2d')](db[_0xc156('0x52')]['query'](_0x5ea7ce(_0x1e4dda,_0xc156('0x5c')))[_0xc156('0x2c')](function(){})[_0xc156('0x56')](_0x313cac()));}}return _0x3e215f;})[_0xc156('0x57')]();})[_0xc156('0x56')](function(_0x23ada7){logger[_0xc156('0x12')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x23ada7[_0xc156('0x1a')]);});}var processPromises=function(_0x43c0d8){return BPromise['all'](promises)['then'](function(_0x3fd822){})['catch'](function(_0x3357c2){logger[_0xc156('0x12')](_0xc156('0x5d'),JSON['stringify'](_0x3357c2));})[_0xc156('0x5e')](function(){socket['emit'](_0xc156('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x43c0d8){return _0x43c0d8[_0xc156('0x60')]();}});};var endCsv=function(){return BPromise[_0xc156('0x61')]()[_0xc156('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xc156('0x2c')](function(){socket['emit'](_0xc156('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x334a28){logger[_0xc156('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xc156('0x30')](_0x334a28));}finally{process[_0xc156('0x62')](0x0);}});};process['on'](_0xc156('0x63'),function(){logger[_0xc156('0x64')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xc156('0x61')]()[_0xc156('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc156('0x65')](',');return db[_0xc156('0x2a')][_0xc156('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc156('0x2c')](function(_0x3bd879){var _0x40c649=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc156('0x66')](_0x40c649,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f8c4b,_0x57d0b2){total+=0x1;var _0x5339fc=total;promises[_0xc156('0x2d')](checkRow(_0x2f8c4b,_0x3bd879,_0x5339fc)[_0xc156('0x2c')](function(){success+=0x1;})['catch'](function(_0x563ce0){if(_0x563ce0['error']){errors+=0x1;delete _0x563ce0['error'];}else if(_0x563ce0[_0xc156('0x67')]){duplicates+=0x1;delete _0x563ce0['duplicate'];}rows['push'](_0x563ce0);}));if(total%0xc8===0x0){_0x57d0b2[_0xc156('0x68')]();return processPromises(_0x57d0b2);}},'complete':function(){return processPromises()[_0xc156('0x2c')](function(){logger['info'](_0xc156('0x69'));endCsv();});},'error':function(_0x4e1a11,_0x4bde06){logger[_0xc156('0x64')](_0xc156('0x6a'),JSON['stringify'](_0x4e1a11));endCsv();}});})[_0xc156('0x56')](function(_0x3e7e12){logger[_0xc156('0x12')](_0xc156('0x6b'),JSON['stringify'](_0x3e7e12));});}main(); \ No newline at end of file +var _0x3c9b=['firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','duplicate','Duplicate\x20Contact','CmContact','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','into','cm_hopper','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','phone','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','then','always','VoiceQueueId','onlyIfOpen','sequelize','query','all','VoiceQueue','outbound','get','Campaign','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data'];(function(_0x381e27,_0x5627ba){var _0x49e063=function(_0x17ecef){while(--_0x17ecef){_0x381e27['push'](_0x381e27['shift']());}};_0x49e063(++_0x5627ba);}(_0x3c9b,0xb9));var _0xb3c9=function(_0x345461,_0x5d75a7){_0x345461=_0x345461-0x0;var _0x295e7a=_0x3c9b[_0x345461];return _0x295e7a;};'use strict';var BPromise=require('bluebird');var util=require(_0xb3c9('0x0'));var _=require(_0xb3c9('0x1'));var fs=require('fs');var squel=require(_0xb3c9('0x2'));var Papa=require(_0xb3c9('0x3'));var Redis=require(_0xb3c9('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xb3c9('0x5'));var logger=require(_0xb3c9('0x6'))(_0xb3c9('0x7'));config[_0xb3c9('0x8')]=_[_0xb3c9('0x9')](config['redis'],{'host':_0xb3c9('0xa'),'port':0x18eb});var socket=require(_0xb3c9('0xb'))(new Redis(config[_0xb3c9('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xb3c9('0xc')][0x2]||process[_0xb3c9('0xc')][0x2]===_0xb3c9('0xd')||process['argv'][0x2]==='null'){throw new Error(_0xb3c9('0xe'));}var FILEPATH=process[_0xb3c9('0xc')][0x2];if(!process['argv'][0x3]||process[_0xb3c9('0xc')][0x3]===_0xb3c9('0xd')||process['argv'][0x3]==='null'||!process[_0xb3c9('0xc')][0x4]||process['argv'][0x4]===_0xb3c9('0xd')||process[_0xb3c9('0xc')][0x4]===_0xb3c9('0xf')){throw new Error(_0xb3c9('0x10'));}var FIELDS=_[_0xb3c9('0x11')](process[_0xb3c9('0xc')][0x3][_0xb3c9('0x12')](','),process['argv'][0x4][_0xb3c9('0x12')](','));if(!process[_0xb3c9('0xc')][0x5]||process['argv'][0x5]==='undefined'||process[_0xb3c9('0xc')][0x5]===_0xb3c9('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb3c9('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb3c9('0xc')][0x6]!=='undefined'&&process[_0xb3c9('0xc')][0x6]!==_0xb3c9('0xf')?process[_0xb3c9('0xc')][0x6]:null;var DUPLICATES=process[_0xb3c9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process['argv'][0x7]!==_0xb3c9('0xf')?process[_0xb3c9('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0xb3c9('0xc')][0x8]===_0xb3c9('0xd')||process['argv'][0x8]===_0xb3c9('0xf')){throw new Error(_0xb3c9('0x13'));}var SOCKET_TIMESTAMP=process[_0xb3c9('0xc')][0x8];}catch(_0x5212c4){logger['error'](_0x5212c4);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(_0x53b9b9,_0x517aca,_0x238a63,_0x3a47ee){var _0x327e6c={'message':_0x517aca};_0x327e6c[_0x53b9b9]=!![];if(_0x238a63){_0x327e6c['contact']=_0x238a63;}if(_0x3a47ee){_0x327e6c['index']=_0x3a47ee;}return _0x327e6c;}function isEmail(_0x3b4128){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))*$/[_0xb3c9('0x14')](_0x3b4128);}function checkRow(_0x31f07a,_0x121595,_0x65c211){return new BPromise(function(_0x9e65e2,_0x2e78d2){if(_[_0xb3c9('0x15')](_0x31f07a)){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),_0xb3c9('0x17'),null,_0x65c211));}if(_0x31f07a[_0xb3c9('0x18')]&&_0x31f07a['errors'][_0xb3c9('0x19')]){var _0x26acf5=_[_0xb3c9('0x1a')](_0x31f07a['errors'],_0xb3c9('0x1b'))[_0xb3c9('0x1c')](';');return _0x2e78d2(handleCheckRowError('error',_0x26acf5,null,_0x65c211));}var _0x2a08c5={};for(var _0x25dbd6 in FIELDS){if(FIELDS[_0xb3c9('0x1d')](_0x25dbd6)&&FIELDS[_0x25dbd6]){_0x2a08c5[_0x25dbd6]=_0x31f07a[_0xb3c9('0x1e')][0x0][FIELDS[_0x25dbd6]]||_0x31f07a['data'][0x0]['\ufeff'+FIELDS[_0x25dbd6]];}}if(!_0x2a08c5[_0xb3c9('0x1f')]){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),_0xb3c9('0x20'),null,_0x65c211));}if(!_0x2a08c5['phone']){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),_0xb3c9('0x21'),null,_0x65c211));}if(_0x2a08c5[_0xb3c9('0x22')]){var _0x59a5f7=moment(_0x2a08c5['birthDate'],_0xb3c9('0x23'));if(!_0x59a5f7[_0xb3c9('0x24')]()){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),_0xb3c9('0x25'),null,_0x65c211));}}if(_0x2a08c5['email']){if(!isEmail(_0x2a08c5[_0xb3c9('0x26')])){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x65c211));}}_0x2a08c5['ListId']=LISTID;_0x2a08c5['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x121595){var _0x5b2bb9={};for(var _0xdb75ca=0x0,_0x701a5d=DUPLICATES[_0xb3c9('0x19')];_0xdb75ca<_0x701a5d;_0xdb75ca+=0x1){_0x5b2bb9[DUPLICATES[_0xdb75ca]]=_0x2a08c5[DUPLICATES[_0xdb75ca]];}var _0x24acf4=_['find'](_0x121595,_0x5b2bb9);if(_0x24acf4){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x27'),_0xb3c9('0x28'),_0x24acf4,_0x65c211));}}return db[_0xb3c9('0x29')]['create'](_0x2a08c5,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2a08c5)})['then'](function(_0x3d217d){if(DUPLICATES&&DUPLICATES[_0xb3c9('0x19')]&&_0x121595){_0x121595[_0xb3c9('0x2a')](_[_0xb3c9('0x2b')](_0x2a08c5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d217d['id'];return _0x9e65e2();})[_0xb3c9('0x2c')](function(_0x5258b4){return _0x2e78d2(handleCheckRowError(_0xb3c9('0x16'),_0xb3c9('0x2d')+(_0x5258b4[_0xb3c9('0x1b')]||JSON[_0xb3c9('0x2e')](_0x5258b4)),null,_0x65c211));});});}function checkHopper(){function _0x2698ba(){return function(_0x17ab26){logger[_0xb3c9('0x16')]('cmContact','checkHopper',util[_0xb3c9('0x2f')](_0x17ab26,{'showHidden':![],'depth':null}));};}var _0x598977=function(_0x5f44e4,_0x51e21b){var _0x217bea=squel[_0xb3c9('0x30')]()[_0xb3c9('0x31')](_0xb3c9('0x32'))['fromQuery'](['phone',_0xb3c9('0x33'),_0xb3c9('0x34'),_0xb3c9('0x35'),_0x51e21b,_0xb3c9('0x36'),_0xb3c9('0x37')],squel[_0xb3c9('0x38')]()['field'](_0xb3c9('0x39'),_0xb3c9('0x39'))[_0xb3c9('0x3a')](_0xb3c9('0x3b'),_0xb3c9('0x33'))[_0xb3c9('0x3a')]('id',_0xb3c9('0x34'))[_0xb3c9('0x3a')](LISTID[_0xb3c9('0x3c')](),'ListId')['field'](_0x5f44e4['id']['toString'](),_0x51e21b)[_0xb3c9('0x3a')](_0xb3c9('0x3b'),_0xb3c9('0x36'))[_0xb3c9('0x3a')](_0xb3c9('0x3b'),_0xb3c9('0x37'))[_0xb3c9('0x3d')](_0xb3c9('0x3e'))['where']('deletedAt\x20IS\x20NULL')[_0xb3c9('0x3f')](_0xb3c9('0x40'),LISTID['toString']())[_0xb3c9('0x3f')](_0xb3c9('0x41'))['where'](_0xb3c9('0x42'),squel[_0xb3c9('0x38')]()[_0xb3c9('0x3a')](_0xb3c9('0x39'))[_0xb3c9('0x3d')](_0xb3c9('0x32'))['where'](_0x51e21b+_0xb3c9('0x43'),_0x5f44e4['id'][_0xb3c9('0x3c')]())))[_0xb3c9('0x3c')]();return _0x217bea;};var _0x30ff5f=function(_0xb7ba5a,_0x3298a8){var _0x213fe2=squel[_0xb3c9('0x30')]()[_0xb3c9('0x31')](_0xb3c9('0x32'))[_0xb3c9('0x44')](['phone',_0xb3c9('0x33'),'ContactId',_0xb3c9('0x35'),_0x3298a8,_0xb3c9('0x36'),'updatedAt'],squel[_0xb3c9('0x38')]()[_0xb3c9('0x3a')](_0xb3c9('0x39'),_0xb3c9('0x39'))[_0xb3c9('0x3a')](_0xb3c9('0x3b'),_0xb3c9('0x33'))[_0xb3c9('0x3a')]('id',_0xb3c9('0x34'))[_0xb3c9('0x3a')](LISTID[_0xb3c9('0x3c')](),_0xb3c9('0x35'))[_0xb3c9('0x3a')](_0xb7ba5a['id'][_0xb3c9('0x3c')](),_0x3298a8)[_0xb3c9('0x3a')]('NOW()',_0xb3c9('0x36'))[_0xb3c9('0x3a')]('NOW()',_0xb3c9('0x37'))['from']('cm_contacts')[_0xb3c9('0x3f')](_0xb3c9('0x45'))['where'](_0xb3c9('0x40'),LISTID[_0xb3c9('0x3c')]())['where'](_0xb3c9('0x46'),squel[_0xb3c9('0x47')](hopperContacts))[_0xb3c9('0x3f')](_0xb3c9('0x41'))[_0xb3c9('0x3f')](_0xb3c9('0x42'),squel[_0xb3c9('0x38')]()[_0xb3c9('0x3a')](_0xb3c9('0x48'))['from']('cm_hopper_final')[_0xb3c9('0x3f')](_0x3298a8+_0xb3c9('0x43'),_0xb7ba5a['id']['toString']()))[_0xb3c9('0x3f')](_0xb3c9('0x42'),squel['select']()[_0xb3c9('0x3a')](_0xb3c9('0x39'))[_0xb3c9('0x3d')](_0xb3c9('0x32'))[_0xb3c9('0x3f')](_0x3298a8+_0xb3c9('0x43'),_0xb7ba5a['id'][_0xb3c9('0x3c')]())))[_0xb3c9('0x3c')]();return _0x213fe2;};function _0x560069(_0xce687b,_0x307276){var _0x41fe1b=squel['insert']()[_0xb3c9('0x31')](_0xb3c9('0x32'))['fromQuery']([_0xb3c9('0x39'),_0xb3c9('0x33'),_0xb3c9('0x34'),_0xb3c9('0x35'),_0x307276,_0xb3c9('0x36'),_0xb3c9('0x37')],squel[_0xb3c9('0x38')]()[_0xb3c9('0x3a')](_0xb3c9('0x39'),'phone')[_0xb3c9('0x3a')](_0xb3c9('0x3b'),'scheduledAt')[_0xb3c9('0x3a')]('id',_0xb3c9('0x34'))[_0xb3c9('0x3a')](LISTID[_0xb3c9('0x3c')](),'ListId')[_0xb3c9('0x3a')](_0xce687b['id']['toString'](),_0x307276)[_0xb3c9('0x3a')](_0xb3c9('0x3b'),_0xb3c9('0x36'))['field'](_0xb3c9('0x3b'),'updatedAt')[_0xb3c9('0x3d')](_0xb3c9('0x3e'))['where'](_0xb3c9('0x45'))[_0xb3c9('0x3f')]('ListId\x20=\x20?',LISTID[_0xb3c9('0x3c')]())[_0xb3c9('0x3f')](_0xb3c9('0x46'),squel['str'](hopperContacts))[_0xb3c9('0x3f')](_0xb3c9('0x41')))[_0xb3c9('0x3c')]();return _0x41fe1b;}function _0x18cd19(_0x586712,_0x36916b){var _0x237ab3=squel[_0xb3c9('0x30')]()['into'](_0xb3c9('0x49'))[_0xb3c9('0x44')](['phone',_0xb3c9('0x34'),_0xb3c9('0x35'),_0x36916b,'createdAt',_0xb3c9('0x37')],squel['select']()[_0xb3c9('0x3a')](_0xb3c9('0x39'),_0xb3c9('0x39'))['field']('id','ContactId')[_0xb3c9('0x3a')](LISTID[_0xb3c9('0x3c')](),'ListId')['field'](_0x586712['id']['toString'](),_0x36916b)[_0xb3c9('0x3a')]('NOW()',_0xb3c9('0x36'))[_0xb3c9('0x3a')](_0xb3c9('0x3b'),'updatedAt')[_0xb3c9('0x3d')]('cm_contacts')['where'](_0xb3c9('0x45'))[_0xb3c9('0x3f')](_0xb3c9('0x40'),LISTID[_0xb3c9('0x3c')]())[_0xb3c9('0x3f')](_0xb3c9('0x46'),squel[_0xb3c9('0x47')](hopperContacts))[_0xb3c9('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xb3c9('0x3c')]();return _0x237ab3;}return db['VoiceQueue'][_0xb3c9('0x4a')]({'where':{'type':'outbound'},'attributes':['id',_0xb3c9('0x4b')],'include':[{'model':db[_0xb3c9('0x4c')],'as':_0xb3c9('0x4d'),'where':{'id':LISTID}}]})[_0xb3c9('0x4e')](function(_0x2759ed){var _0x2c56ac=[];if(_0x2759ed){var _0x355597;for(var _0x2c4027=0x0,_0x4397ba;_0x2c4027<_0x2759ed['length'];_0x2c4027+=0x1){_0x4397ba=_0x2759ed[_0x2c4027]['get']({'plain':!![]});switch(_0x4397ba['dialCheckDuplicateType']){case _0xb3c9('0x4f'):_0x2c56ac[_0xb3c9('0x2a')](db['sequelize']['query'](_0x30ff5f(_0x4397ba,_0xb3c9('0x50')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));break;case _0xb3c9('0x51'):_0x2c56ac[_0xb3c9('0x2a')](db[_0xb3c9('0x52')][_0xb3c9('0x53')](_0x598977(_0x4397ba,_0xb3c9('0x50')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));break;default:_0x2c56ac['push'](db[_0xb3c9('0x52')][_0xb3c9('0x53')](_0x560069(_0x4397ba,'VoiceQueueId'))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));}}}return _0x2c56ac;})[_0xb3c9('0x54')]()['then'](function(){return db[_0xb3c9('0x55')][_0xb3c9('0x4a')]({'where':{'type':_0xb3c9('0x56')},'attributes':['id'],'include':[{'model':db[_0xb3c9('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb3c9('0x4e')](function(_0x15b40a){var _0x3c6e24=[];if(_0x15b40a){var _0x17ac76;for(var _0x204d81=0x0,_0x4702db;_0x204d81<_0x15b40a[_0xb3c9('0x19')];_0x204d81+=0x1){_0x4702db=_0x15b40a[_0x204d81][_0xb3c9('0x57')]({'plain':!![]});_0x3c6e24[_0xb3c9('0x2a')](db['sequelize']['query'](_0x18cd19(_0x4702db,_0xb3c9('0x50')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));}}return _0x3c6e24;})[_0xb3c9('0x54')]();})['then'](function(){return db[_0xb3c9('0x58')][_0xb3c9('0x4a')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xb3c9('0x4e')](function(_0x14ba3b){var _0x809b0f=[];if(_0x14ba3b){for(var _0x4d3b04=0x0,_0x138e81;_0x4d3b04<_0x14ba3b[_0xb3c9('0x19')];_0x4d3b04+=0x1){_0x138e81=_0x14ba3b[_0x4d3b04][_0xb3c9('0x57')]({'plain':!![]});switch(_0x138e81[_0xb3c9('0x4b')]){case'always':_0x809b0f['push'](db[_0xb3c9('0x52')]['query'](_0x30ff5f(_0x138e81,_0xb3c9('0x59')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));break;case _0xb3c9('0x51'):_0x809b0f[_0xb3c9('0x2a')](db[_0xb3c9('0x52')][_0xb3c9('0x53')](_0x598977(_0x138e81,_0xb3c9('0x59')))['then'](function(){})[_0xb3c9('0x2c')](_0x2698ba()));break;default:_0x809b0f['push'](db[_0xb3c9('0x52')][_0xb3c9('0x53')](_0x560069(_0x138e81,_0xb3c9('0x59')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));}}}return _0x809b0f;})[_0xb3c9('0x54')]();})[_0xb3c9('0x4e')](function(){return db[_0xb3c9('0x58')][_0xb3c9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0xb3c9('0x4c')],'as':_0xb3c9('0x5a'),'where':{'id':LISTID}}]})[_0xb3c9('0x4e')](function(_0x560017){var _0x46da5f=[];if(_0x560017){for(var _0x193b8d=0x0,_0x5636cf;_0x193b8d<_0x560017['length'];_0x193b8d+=0x1){_0x5636cf=_0x560017[_0x193b8d][_0xb3c9('0x57')]({'plain':!![]});_0x46da5f[_0xb3c9('0x2a')](db[_0xb3c9('0x52')][_0xb3c9('0x53')](_0x18cd19(_0x5636cf,_0xb3c9('0x59')))[_0xb3c9('0x4e')](function(){})[_0xb3c9('0x2c')](_0x2698ba()));}}return _0x46da5f;})[_0xb3c9('0x54')]();})[_0xb3c9('0x2c')](function(_0x4a2fff){logger[_0xb3c9('0x16')]('cmContact,\x20%s,\x20%s',_0xb3c9('0x5b'),_0x4a2fff[_0xb3c9('0x1b')]);});}var processPromises=function(_0x2fa5ef){return BPromise[_0xb3c9('0x54')](promises)[_0xb3c9('0x4e')](function(_0x4ba9f4){})[_0xb3c9('0x2c')](function(_0x535334){logger[_0xb3c9('0x16')](_0xb3c9('0x5c'),JSON[_0xb3c9('0x2e')](_0x535334));})['finally'](function(){socket['emit'](_0xb3c9('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2fa5ef){return _0x2fa5ef[_0xb3c9('0x5e')]();}});};var endCsv=function(){return BPromise[_0xb3c9('0x5f')]()[_0xb3c9('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0xb3c9('0x4e')](function(){socket[_0xb3c9('0x60')](_0xb3c9('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb3c9('0x61')](FILEPATH);}catch(_0x521263){logger[_0xb3c9('0x16')](_0xb3c9('0x62'),JSON[_0xb3c9('0x2e')](_0x521263));}finally{process[_0xb3c9('0x63')](0x0);}});};process['on'](_0xb3c9('0x64'),function(){logger[_0xb3c9('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb3c9('0x5f')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb3c9('0x12')](',');return db[_0xb3c9('0x29')][_0xb3c9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1e2707){var _0x113cde=fs[_0xb3c9('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb3c9('0x67')](_0x113cde,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a31f9,_0x59e372){total+=0x1;var _0x36540d=total;promises[_0xb3c9('0x2a')](checkRow(_0x3a31f9,_0x1e2707,_0x36540d)[_0xb3c9('0x4e')](function(){success+=0x1;})[_0xb3c9('0x2c')](function(_0x52d472){if(_0x52d472[_0xb3c9('0x16')]){errors+=0x1;delete _0x52d472[_0xb3c9('0x16')];}else if(_0x52d472[_0xb3c9('0x27')]){duplicates+=0x1;delete _0x52d472['duplicate'];}rows['push'](_0x52d472);}));if(total%0xc8===0x0){_0x59e372[_0xb3c9('0x68')]();return processPromises(_0x59e372);}},'complete':function(){return processPromises()[_0xb3c9('0x4e')](function(){logger[_0xb3c9('0x65')](_0xb3c9('0x69'));endCsv();});},'error':function(_0x16263f,_0x9136be){logger['info'](_0xb3c9('0x6a'),JSON[_0xb3c9('0x2e')](_0x16263f));endCsv();}});})[_0xb3c9('0x2c')](function(_0xf7ee67){logger['error'](_0xb3c9('0x6b'),JSON[_0xb3c9('0x2e')](_0xf7ee67));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 71f20a4..58cb1bc 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 _0xf278=['../../../config/environment','../../../config/logger','redis','defaults','format','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','findAll','length','push','then','AdditionalPhones','split','isNil','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.updatedAt','cm_hopper_black','ContactId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.createdAt\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','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',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','errors','code','message','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','error','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','header','ContactItemType','name','_description','parse','createReadStream','rows','find','hasOwnProperty','data','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0xf278,0x161));var _0x8f27=function(_0x3566d0,_0x34a49f){_0x3566d0=_0x3566d0-0x0;var _0x3fd4da=_0xf278[_0x3566d0];return _0x3fd4da;};'use strict';var fs=require('fs');var path=require(_0x8f27('0x0'));var _=require(_0x8f27('0x1'));var Papa=require(_0x8f27('0x2'));var util=require(_0x8f27('0x3'));var BPromise=require(_0x8f27('0x4'));var moment=require(_0x8f27('0x5'));var squel=require(_0x8f27('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x8f27('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x8f27('0x8'))('import');config[_0x8f27('0x9')]=_[_0x8f27('0xa')](config[_0x8f27('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 orderBy=0x0;var stopped=![];var NOW=moment()[_0x8f27('0xb')]('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()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1d4ed0){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'](_0x1d4ed0);}function selectNotIn(_0x17881a,_0x238f1e,_0x1b6a0b,_0x69a095,_0xbc58a){return squel[_0x8f27('0xc')]()[_0x8f27('0xd')]('phone')[_0x8f27('0xe')](_0x69a095)['join'](_0x238f1e,null,_0x238f1e+_0x8f27('0xf')+_0x69a095+'.'+_0x1b6a0b)[_0x8f27('0x10')](_0x69a095+'.'+_0x1b6a0b+_0x8f27('0x11')+_0x17881a+'.'+_0x1b6a0b)[_0x8f27('0x10')](_0x238f1e+_0x8f27('0x12')+_0xbc58a[_0x8f27('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x227634,_0x1f87d9){promisesAdditionalPhones=[];return db['CmContact'][_0x8f27('0x14')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x1f9236){if(_0x1f9236!==null){var _0x4dc65d=[];for(var _0x12a5b3=0x0;_0x12a5b3<_0x1f9236[_0x8f27('0x15')];_0x12a5b3++){var _0x4df598=_0x1f9236[_0x12a5b3];_0x4dc65d[_0x8f27('0x16')](insertAdditionalPhones(_0x4df598));}}Promise['all'](_0x4dc65d)[_0x8f27('0x17')](function(){_0x227634({'val':0x1});});});});}function insertAdditionalPhones(_0xc25e5d){return new Promise(function(_0x1aaf8e,_0x582dae){var _0x2a4141=_0xc25e5d[_0x8f27('0x18')];var _0x35f7d5=_0x2a4141[_0x8f27('0x19')](';');var _0x3927a7=[];orderBy=0x0;for(var _0x2d5b3c=0x0;_0x2d5b3c<_0x35f7d5['length'];_0x2d5b3c++){_0x3927a7[_0x8f27('0x16')](splitAdditionalPhone(_0xc25e5d['id'],_0x35f7d5[_0x2d5b3c]));}Promise['all'](_0x3927a7)[_0x8f27('0x17')](function(){_0x1aaf8e({'val':_0x35f7d5[_0x8f27('0x15')]});});});}function splitAdditionalPhone(_0x1162e6,_0x55bec1){return new Promise(function(_0x48d880,_0x4e5bf2){var _0x5cbafe=_0x55bec1[_0x8f27('0x19')](':');var _0x1e3021=_0x5cbafe[0x0];var _0x2c6b06=_0x5cbafe[0x1];if(!_[_0x8f27('0x1a')](_0x2c6b06)){var _0x2fe80b=_0x2c6b06['split']('|');var _0x6b14f9=[];for(var _0x48cfc1=0x0;_0x48cfc1<_0x2fe80b['length'];_0x48cfc1++){if(_0x2fe80b[_0x48cfc1]!==''){var _0x4945a2=_['filter'](promisesAdditionalPhones,{'contactId':_0x1162e6,'phone':_0x2fe80b[_0x48cfc1]});if(_0x4945a2['length']==0x0){orderBy++;promisesAdditionalPhones[_0x8f27('0x16')]({'contactId':_0x1162e6,'contactTypeId':_0x1e3021,'phone':_0x2fe80b[_0x48cfc1],'orderBy':orderBy});}}}_0x48d880({'ok':0x1});}else _0x48d880({'res':0x0});});}function createAdditionalPhone(_0x2b763d,_0x4b3c99,_0x554247,_0x5da931){var _0x15f8d='';var _0x48c3c4='';var _0x2e6405=_0x554247[_0x8f27('0x19')]('§');_0x15f8d=_0x2e6405[0x0];if(_0x2e6405[_0x8f27('0x15')]==0x2)_0x48c3c4=_0x2e6405[0x1];return new Promise(function(_0x137db4,_0x50ff87){return db[_0x8f27('0x1b')][_0x8f27('0x1c')]({'where':{'CmContactId':_0x2b763d,'item':_0x15f8d}})['then'](function(_0x15eb38){if(_0x15eb38){return db[_0x8f27('0x1b')][_0x8f27('0x1d')]({'ItemTypeId':_0x4b3c99,'description':_0x48c3c4,'OrderBy':_0x5da931},{'where':{'CmContactId':_0x2b763d,'item':_0x15f8d}})[_0x8f27('0x17')](function(_0x5039c4){_0x137db4({'res':_0x8f27('0x1e')});});}else{return db[_0x8f27('0x1b')][_0x8f27('0x1f')]({'CmContactId':_0x2b763d,'item':_0x15f8d,'description':_0x48c3c4,'ItemTypeId':_0x4b3c99,'OrderBy':_0x5da931,'ItemClass':_0x8f27('0x20')})['then'](function(_0x3b46b9){_0x137db4({'res':_0x8f27('0x21')});});}});});}function insertCmHopper(_0x45d8fa,_0x27d046,_0x271220,_0x583c79,_0x17b614){var _0x50fba8=[_0x8f27('0x22'),_0x8f27('0x23'),'cm_contacts.id',_0x8f27('0x24'),_0x27d046+'.'+_0x583c79,_0x8f27('0x25'),'cm_contacts.updatedAt','cm_contacts.priority',_0x8f27('0x26'),'\x22'+_0x17b614+'\x22'];return squel[_0x8f27('0x27')]()[_0x8f27('0x28')](_0x8f27('0x29'))[_0x8f27('0x2a')]([_0x8f27('0x2b'),_0x8f27('0x2c'),'ContactId',_0x8f27('0x2d'),_0x583c79,_0x8f27('0x2e'),_0x8f27('0x2f'),_0x8f27('0x30'),_0x8f27('0x31'),_0x8f27('0x32')],squel[_0x8f27('0xc')]()[_0x8f27('0x33')](_0x50fba8)[_0x8f27('0xe')](_0x27d046)[_0x8f27('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x27d046+_0x8f27('0x34'))[_0x8f27('0x13')](_0x271220,null,_0x271220+_0x8f27('0xf')+_0x27d046+'.'+_0x583c79)[_0x8f27('0x10')](_0x27d046+'.CmListId\x20=\x20?',_0x45d8fa)[_0x8f27('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8f27('0x10')](_0x8f27('0x35'),selectNotIn(_0x27d046,_0x271220,_0x583c79,_0x8f27('0x29'),[_0x8f27('0x36'),_0x8f27('0x37')]))[_0x8f27('0x10')](_0x8f27('0x35'),selectNotIn(_0x27d046,_0x271220,_0x583c79,_0x8f27('0x29'),['\x22always\x22'])))[_0x8f27('0x38')]();}function insertCmHopperBlack(_0x3b1020,_0x33cd99,_0x519e68,_0x2641bc){var _0xe3ed23=['cm_contacts.phone',_0x8f27('0x39'),_0x8f27('0x24'),_0x33cd99+'.'+_0x2641bc,_0x8f27('0x25'),_0x8f27('0x3a')];return squel[_0x8f27('0x27')]()['into'](_0x8f27('0x3b'))[_0x8f27('0x2a')]([_0x8f27('0x2b'),_0x8f27('0x3c'),_0x8f27('0x2d'),_0x2641bc,_0x8f27('0x2e'),'updatedAt'],squel[_0x8f27('0xc')]()[_0x8f27('0x33')](_0xe3ed23)[_0x8f27('0xe')](_0x33cd99)[_0x8f27('0x13')](_0x8f27('0x3d'),null,_0x8f27('0x3e')+_0x33cd99+_0x8f27('0x34'))[_0x8f27('0x13')](_0x519e68,null,_0x519e68+'.id\x20=\x20'+_0x33cd99+'.'+_0x2641bc)[_0x8f27('0x10')](_0x33cd99+_0x8f27('0x3f'),_0x3b1020)[_0x8f27('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8f27('0x10')](_0x8f27('0x35'),squel[_0x8f27('0xc')]()[_0x8f27('0xd')](_0x8f27('0x2b'))[_0x8f27('0xe')](_0x8f27('0x3b'))['where'](_0x8f27('0x40'),_0x3b1020)[_0x8f27('0x10')](_0x2641bc+_0x8f27('0x11')+_0x33cd99+'.'+_0x2641bc)))[_0x8f27('0x38')]();}function insertTzCmHopper(_0x5ec3ea,_0x2fedce,_0x64ba48,_0x28d52f,_0x102f18,_0x2ada77){var _0x4681a9=[_0x8f27('0x22'),_0x8f27('0x41')+_0x2ada77+_0x8f27('0x42'),_0x8f27('0x39'),_0x8f27('0x24'),_0x2fedce+'.'+_0x28d52f,'cm_contacts.createdAt',_0x8f27('0x3a'),_0x8f27('0x43'),_0x8f27('0x26'),'\x22'+_0x102f18+'\x22'];var _0x52df3e=squel['insert']()[_0x8f27('0x28')](_0x8f27('0x29'))[_0x8f27('0x2a')]([_0x8f27('0x2b'),_0x8f27('0x2c'),_0x8f27('0x3c'),_0x8f27('0x2d'),_0x28d52f,'createdAt',_0x8f27('0x2f'),_0x8f27('0x30'),_0x8f27('0x31'),_0x8f27('0x32')],squel[_0x8f27('0xc')]()['fields'](_0x4681a9)[_0x8f27('0xe')](_0x2fedce)['join']('cm_contacts',null,_0x8f27('0x3e')+_0x2fedce+_0x8f27('0x34'))[_0x8f27('0x13')](_0x64ba48,null,_0x64ba48+'.id\x20=\x20'+_0x2fedce+'.'+_0x28d52f)[_0x8f27('0x13')](_0x2ada77,null,_0x2ada77+'.id\x20=\x20'+_0x2fedce+'.'+_0x28d52f)[_0x8f27('0x10')](_0x2fedce+_0x8f27('0x3f'),_0x5ec3ea)[_0x8f27('0x10')](_0x8f27('0x44'),NOW)[_0x8f27('0x10')](_0x8f27('0x35'),selectNotIn(_0x2fedce,_0x64ba48,_0x28d52f,_0x8f27('0x29'),[_0x8f27('0x36'),_0x8f27('0x37')]))[_0x8f27('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2fedce,_0x64ba48,_0x28d52f,_0x8f27('0x29'),[_0x8f27('0x36')])))[_0x8f27('0x38')]();return _0x52df3e;}function insertTzCmHopperBlack(_0x17f22c,_0x14300c,_0x29345e,_0x3301e7){var _0x30b4df=[_0x8f27('0x22'),_0x8f27('0x39'),_0x8f27('0x24'),_0x14300c+'.'+_0x3301e7,_0x8f27('0x25'),_0x8f27('0x3a')];return squel[_0x8f27('0x27')]()[_0x8f27('0x28')](_0x8f27('0x3b'))[_0x8f27('0x2a')](['phone',_0x8f27('0x3c'),_0x8f27('0x2d'),_0x3301e7,_0x8f27('0x2e'),'updatedAt'],squel['select']()[_0x8f27('0x33')](_0x30b4df)['from'](_0x14300c)[_0x8f27('0x13')](_0x8f27('0x3d'),null,_0x8f27('0x3e')+_0x14300c+_0x8f27('0x34'))['join'](_0x29345e,null,_0x29345e+_0x8f27('0xf')+_0x14300c+'.'+_0x3301e7)[_0x8f27('0x10')](_0x14300c+_0x8f27('0x3f'),_0x17f22c)[_0x8f27('0x10')](_0x8f27('0x44'),NOW)[_0x8f27('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x8f27('0xc')]()[_0x8f27('0xd')]('phone')[_0x8f27('0xe')](_0x8f27('0x3b'))[_0x8f27('0x10')](_0x8f27('0x40'),_0x17f22c)[_0x8f27('0x10')](_0x3301e7+_0x8f27('0x11')+_0x14300c+'.'+_0x3301e7)))[_0x8f27('0x38')]();}function insertCmHopperAdditionalPhones(_0x46afe1){var _0x1f7c38=[_0x8f27('0x45'),_0x8f27('0x46'),'cm_contact_has_items.OrderBy',_0x8f27('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x8f27('0x27')]()[_0x8f27('0x28')](_0x8f27('0x48'))[_0x8f27('0x2a')]([_0x8f27('0x49'),_0x8f27('0x2b'),'OrderBy','createdAt',_0x8f27('0x2f')],squel[_0x8f27('0xc')]()[_0x8f27('0x33')](_0x1f7c38)['from']('cm_hopper')[_0x8f27('0x13')]('cm_contacts',null,_0x8f27('0x4a'))[_0x8f27('0x13')](_0x8f27('0x4b'),null,_0x8f27('0x4c'))[_0x8f27('0x10')](_0x8f27('0x4d'),_0x46afe1)[_0x8f27('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x7c5d15,_0x40fa74,_0x123f55,_0x46791d){var _0x4ef795=_['concat'](_['keys'](_0x46791d),['ListId',_0x8f27('0x4e'),_0x8f27('0x2e'),'updatedAt','scheduledAt']);return squel[_0x8f27('0x27')]()[_0x8f27('0x28')]('cm_contacts')[_0x8f27('0x2a')](_0x4ef795,squel[_0x8f27('0xc')]()[_0x8f27('0x33')](_0x4ef795)[_0x8f27('0xe')](_0x40fa74)[_0x8f27('0x10')]('('+_0x123f55[_0x8f27('0x13')](',')+_0x8f27('0x4f'),squel[_0x8f27('0xc')]()[_0x8f27('0x33')](_0x123f55)[_0x8f27('0xe')]('cm_contacts')['where'](_0x8f27('0x40'),_0x7c5d15)[_0x8f27('0x10')](_0x8f27('0x50')))['where'](_0x8f27('0x51'),squel[_0x8f27('0xc')]()['field']('MIN(id)',_0x8f27('0x52'))[_0x8f27('0xe')](_0x40fa74)[_0x8f27('0x53')](_0x123f55['join'](','))))['toString']();}function handleStop(){logger[_0x8f27('0x54')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xeaac14){logger['error'](_0xeaac14['message']);process['exit'](0x1);}function handleError(_0xc7fb8d,_0x3bdc45){stats[_0x8f27('0x55')][_0x8f27('0x16')]({'name':_0x3bdc45[_0x8f27('0x56')],'message':_0x3bdc45[_0x8f27('0x57')],'row':_0xc7fb8d});}function handleQuery(_0x362daa){logger['info'](_0x362daa);return db[_0x8f27('0x58')][_0x8f27('0x59')](_0x362daa)[_0x8f27('0x5a')](function(_0x9572b5){results[_0x8f27('0x16')](_0x9572b5);})[_0x8f27('0x5b')](function(_0x5de20e){logger['error'](_0x5de20e[_0x8f27('0x57')]);});}function updateTzCampaigns(_0x22d665){return new Promise(function(_0x447ab9,_0x554226){var _0x4e3145=squel['select']()['fields']([_0x8f27('0x5c'),_0x8f27('0x5d')])[_0x8f27('0xe')](_0x8f27('0x5e'))[_0x8f27('0x13')](_0x8f27('0x5f'),null,_0x8f27('0x60'))['where'](_0x8f27('0x61')+_0x22d665);db['sequelize'][_0x8f27('0x59')](_0x4e3145[_0x8f27('0x38')]())[_0x8f27('0x5a')](function(_0x2a39cb){var _0x473654=[];for(var _0x1f3496=0x0;_0x1f3496<_0x2a39cb[_0x8f27('0x15')];_0x1f3496++){_0x473654[_0x8f27('0x16')](getTimezoneData(_0x2a39cb[_0x1f3496],tmp_campaigns));}BPromise[_0x8f27('0x62')](_0x473654)[_0x8f27('0x17')](function(){_0x447ab9({'val':0x1});});})[_0x8f27('0x5b')](function(_0x3b57cf){logger[_0x8f27('0x63')](_0x3b57cf[_0x8f27('0x57')]);_0x447ab9({'val':0x0});});});}function updateTzVoiceQueues(_0x3efee2){return new Promise(function(_0x53abc1,_0x12b5d4){var _0x3bdaa4=squel[_0x8f27('0xc')]()[_0x8f27('0x33')]([_0x8f27('0x64'),_0x8f27('0x65')])[_0x8f27('0xe')](_0x8f27('0x66'))[_0x8f27('0x13')]('voice_queues_has_cm_lists',null,_0x8f27('0x67'))[_0x8f27('0x10')](_0x8f27('0x68')+_0x3efee2);db['sequelize'][_0x8f27('0x59')](_0x3bdaa4[_0x8f27('0x38')]())['spread'](function(_0x5e5a5b){var _0x2537a5=[];for(var _0x47fff7=0x0;_0x47fff7<_0x5e5a5b[_0x8f27('0x15')];_0x47fff7++){_0x2537a5[_0x8f27('0x16')](getTimezoneData(_0x5e5a5b[_0x47fff7],tmp_voice_queues));}BPromise[_0x8f27('0x62')](_0x2537a5)[_0x8f27('0x17')](function(){_0x53abc1({'val':0x1});});})[_0x8f27('0x5b')](function(_0x364588){logger[_0x8f27('0x63')](_0x364588[_0x8f27('0x57')]);_0x53abc1({'val':0x0});});});}function getTimezoneData(_0x5460ee,_0x2c0a82){return new Promise(function(_0x5e5d6e,_0x4a557b){var _0x4c7207=shared[_0x8f27('0x69')];var _0x1ba72a=_0x4c7207[_0x5460ee[_0x8f27('0x6a')]];if(_[_0x8f27('0x1a')](_0x1ba72a)){_0x5e5d6e({'ret':0x1});}else{var _0x13b855=_0x1ba72a[_0x8f27('0x6b')];var _0x2f81c8=squel[_0x8f27('0x27')]()['into'](_0x2c0a82)[_0x8f27('0x6c')]('id',_0x5460ee['id'])[_0x8f27('0x6c')]('offset',_0x13b855)[_0x8f27('0x6c')](_0x8f27('0x6a'),_0x5460ee[_0x8f27('0x6a')])[_0x8f27('0x38')]();return db[_0x8f27('0x58')][_0x8f27('0x59')](_0x2f81c8)['spread'](function(_0x4f937c){_0x5e5d6e({'ret':0x1});})['catch'](function(_0x10429a){logger[_0x8f27('0x63')](_0x10429a[_0x8f27('0x57')]);_0x4a557b({'ret':0x1});});}});}function handleTZQuery(_0x57ca76){logger['info'](_0x57ca76);return db[_0x8f27('0x58')][_0x8f27('0x59')](_0x57ca76)[_0x8f27('0x5a')](function(_0x46d38f){})[_0x8f27('0x5b')](function(_0x29c6d5){logger[_0x8f27('0x63')](_0x29c6d5[_0x8f27('0x57')]);});}function main(_0x221c68,_0x395772,_0x109b8a,_0x217ea5){logger[_0x8f27('0x54')]('main',_0x221c68,JSON['stringify'](_0x395772));process[_0x8f27('0x6d')](_0x8f27('0x6e'));var _0x427513=_0x395772['binding'];var _0x2752b4=_[_0x8f27('0x6f')](_0x427513);var _0x41cb11=_0x395772[_0x8f27('0x70')];var _0x5d4149=path[_0x8f27('0x13')](config[_0x8f27('0x71')],_0x8f27('0x72'),_0x41cb11+_0x8f27('0x73'));hasTZ=_['keys'](_0x427513)['includes'](_0x8f27('0x6a'));var _0x30eb37=_['keys'](_0x427513)['join']();logger[_0x8f27('0x54')](_0x8f27('0x74'),_0x30eb37);db[_0x8f27('0x75')][_0x8f27('0x14')]({'raw':!![],'attributes':['id',_0x8f27('0x76')]})['then'](function(_0x48776c){for(var _0x508d10=0x0;_0x508d10<_0x48776c['length'];_0x508d10++){if(_0x48776c[_0x508d10][_0x8f27('0x76')]in _0x427513){contactItemTypes[_0x8f27('0x16')](_0x48776c[_0x508d10]);delete _0x2752b4[_0x48776c[_0x508d10]['name']];hasAdditionalPhones=!![];}for(var _0x238a82 in _0x427513){if(_0x48776c[_0x508d10][_0x8f27('0x76')]+_0x8f27('0x77')===_0x238a82){phoneDescriptions[_0x8f27('0x16')]({'itemTypeId':_0x48776c[_0x508d10]['id'],'description':_0x238a82});delete _0x2752b4[_0x238a82];}}}if(hasAdditionalPhones)_0x2752b4[_0x8f27('0x18')]='';var _0x26a924=_['keys'](_0x2752b4)['join']();logger['info']('header',_0x26a924);fs['writeFileSync'](_0x5d4149,_0x26a924+'\x0a');Papa[_0x8f27('0x78')](fs[_0x8f27('0x79')](_0x221c68),{'header':!![],'skipEmptyLines':!![],'step':function(_0x581471,_0x4a910f){try{for(var _0xf5a2d9=0x0,_0x28da53=[];_0xf5a2d9<_0x581471['data']['length'];_0xf5a2d9++){stats[_0x8f27('0x7a')]+=0x1;if(_0x581471[_0x8f27('0x55')][_0xf5a2d9]){handleError(_0x581471['data'][_0xf5a2d9],_0x581471[_0x8f27('0x55')][_0xf5a2d9]);}else{var _0x516b79=[];var _0x1970b1=[];var _0x2602ea={};for(var _0x93c693 in _0x427513){let _0x3793ce=contactItemTypes[_0x8f27('0x7b')](_0x2e4177=>_0x2e4177[_0x8f27('0x76')]===_0x93c693);let _0x7655a2=contactItemTypes[_0x8f27('0x7b')](_0xa13aef=>_0xa13aef[_0x8f27('0x76')]+'_description'===_0x93c693);if(_[_0x8f27('0x1a')](_0x3793ce)&&_['isNil'](_0x7655a2)){if(_0x427513[_0x8f27('0x7c')](_0x93c693)){if(_0x581471[_0x8f27('0x7d')][_0xf5a2d9][_0x427513[_0x93c693]]){var _0x4c3e6b=_[_0x8f27('0x7e')](_0x581471['data'][_0xf5a2d9][_0x427513[_0x93c693]][_0x8f27('0x7f')](/"/g,'\x27'));switch(_0x93c693){case _0x8f27('0x2c'):var _0x4afe77=moment(_0x4c3e6b,_0x8f27('0x80'),!![]);if(_0x4afe77[_0x8f27('0x81')]()){_0x28da53['push']('\x22'+_0x4c3e6b+'\x22');}else{_0x516b79['push'](_0x8f27('0x82'));}break;case _0x8f27('0x30'):var _0x33e016=parseInt(_0x4c3e6b);_0x4c3e6b=_[_0x8f27('0x83')](_0x33e016)||_0x33e016<0x0||_0x33e016>0x4?_0x217ea5?0x3:0x2:_0x33e016;_0x28da53[_0x8f27('0x16')]('\x22'+_0x4c3e6b+'\x22');break;case _0x8f27('0x31'):var _0x48eb54=parseInt(_0x4c3e6b);if(_['isNumber'](_0x48eb54)&&_[_0x8f27('0x84')](_0x109b8a,_0x48eb54)){_0x28da53[_0x8f27('0x16')]('\x22'+_0x48eb54+'\x22');}else{_0x516b79['push'](_0x8f27('0x85'));}break;case'email':if(isEmail(_0x4c3e6b)){_0x28da53[_0x8f27('0x16')]('\x22'+_0x4c3e6b+'\x22');}else{_0x516b79[_0x8f27('0x16')](_0x8f27('0x86'));}break;case _0x8f27('0x87'):var _0x5f59eb=moment(_0x4c3e6b,_0x8f27('0x88'),!![]);if(_0x5f59eb[_0x8f27('0x81')]()){_0x28da53['push']('\x22'+_0x4c3e6b+'\x22');}else{_0x516b79[_0x8f27('0x16')](_0x8f27('0x89'));}break;case _0x8f27('0x6a'):var _0x16fd35=shared[_0x8f27('0x69')];var _0x4e87a1=_0x16fd35[_0x4c3e6b];if(!_[_0x8f27('0x1a')](_0x4e87a1)){var _0x1af719=_0x4e87a1['utcOffset'];_0x28da53[_0x8f27('0x16')]('\x22'+_0x4c3e6b+'\x22');_0x28da53[_0x8f27('0x16')]('\x22'+_0x1af719+'\x22');}break;default:_0x28da53[_0x8f27('0x16')]('\x22'+_0x4c3e6b+'\x22');}}else{switch(_0x93c693){case _0x8f27('0x8a'):case _0x8f27('0x2b'):_0x516b79[_0x8f27('0x16')](_0x93c693+'\x20not\x20specified');break;default:_0x28da53[_0x8f27('0x16')]('\x22\x22');}}}}else{var _0x4a94e6='';if(!_[_0x8f27('0x1a')](_0x3793ce)){if(!_0x2602ea[_0x8f27('0x7c')](_0x3793ce['id'])){if(!_[_0x8f27('0x1a')](_0x581471['data'][_0xf5a2d9][_0x427513[_0x93c693]])){var _0x4c3e6b=_['trim'](_0x581471['data'][_0xf5a2d9][_0x427513[_0x93c693]]['replace'](/"/g,'\x27'));var _0xf46f18=phoneDescriptions[_0x8f27('0x7b')](_0x14f66a=>_0x14f66a[_0x8f27('0x8b')]===_0x3793ce['id']);if(!_['isNil'](_0xf46f18)){var _0x2f6daa=_['trim'](_0x581471['data'][_0xf5a2d9][_0x427513[_0xf46f18[_0x8f27('0x8c')]]][_0x8f27('0x7f')](/"/g,'\x27'));if(!_[_0x8f27('0x1a')](_0x2f6daa))_0x4c3e6b=_0x4c3e6b+'§'+_0x2f6daa;}if(_0x4a94e6=='')_0x4a94e6=_0x4c3e6b;else _0x4a94e6+='|'+_0x4c3e6b;}_0x1970b1['push'](_0x3793ce['id']+':'+_0x4a94e6);_0x2602ea[_0x3793ce['id']]=0x1;}}}}if(hasAdditionalPhones){_0x28da53[_0x8f27('0x16')]('\x22'+_0x1970b1[_0x8f27('0x13')](';')+'\x22');}if(_0x516b79[_0x8f27('0x15')]){handleError(_0x581471[_0x8f27('0x7d')][_0xf5a2d9],{'code':'SystemRow','message':_0x516b79['join']()});}else{fs[_0x8f27('0x8d')](_0x5d4149,_0x28da53['join']()+'\x0a');}_0x28da53=[];}if(!(stats[_0x8f27('0x7a')]%0xc8)){socket[_0x8f27('0x8e')](_0x8f27('0x8f')+_0x41cb11,stats);stats[_0x8f27('0x55')]=[];}}if(stopped){logger['info'](_0x8f27('0x90'));_0x4a910f[_0x8f27('0x91')]();}}catch(_0x520195){handleError(_0x581471['data'][_0xf5a2d9],{'code':_0x8f27('0x92'),'message':_0x520195[_0x8f27('0x57')]});logger[_0x8f27('0x63')](_0x8f27('0x93'),_0x520195[_0x8f27('0x57')]);}},'complete':function(){try{var _0x4f1c0f=[];var _0x748679=[];var _0x7c9e3=_0x8f27('0x3d');if(_0x395772[_0x8f27('0x94')]&&_0x395772[_0x8f27('0x94')]['length']){_0x7c9e3=_0x8f27('0x95')+_0x41cb11;_0x4f1c0f[_0x8f27('0x16')](_0x8f27('0x96')+_0x7c9e3+_0x8f27('0x97'));}tmp_campaigns=_0x8f27('0x98')+_0x41cb11;tmp_voice_queues=_0x8f27('0x99')+_0x41cb11;_0x748679['push'](_0x8f27('0x96')+tmp_campaigns+_0x8f27('0x9a'));_0x748679[_0x8f27('0x16')](_0x8f27('0x96')+tmp_voice_queues+_0x8f27('0x9a'));BPromise[_0x8f27('0x9b')](_0x748679,handleTZQuery)[_0x8f27('0x17')](function(_0x5c7f42){updateTzCampaigns(_0x395772[_0x8f27('0x2d')])[_0x8f27('0x17')](function(_0x1db5f5){updateTzVoiceQueues(_0x395772[_0x8f27('0x2d')])[_0x8f27('0x17')](function(_0x59ec5b){if(hasTZ)_0x26a924=_0x26a924[_0x8f27('0x7f')](_0x8f27('0x6a'),_0x8f27('0x9c'));var _0x4f3182=util[_0x8f27('0xb')](_0x8f27('0x9d'),_0x5d4149,_0x7c9e3,_0x26a924,_0x395772[_0x8f27('0x2d')],_0x395772[_0x8f27('0x4e')]||null,NOW,NOW);if(_[_0x8f27('0x1a')](_0x427513[_0x8f27('0x2c')])){_0x4f3182+=_0x8f27('0x9e');}_0x4f1c0f[_0x8f27('0x16')](_0x4f3182);if(_0x395772[_0x8f27('0x94')]&&_0x395772[_0x8f27('0x94')][_0x8f27('0x15')]){_0x4f1c0f['push'](insertCmContact(_0x395772[_0x8f27('0x2d')],_0x7c9e3,_0x395772['duplicates'],_0x427513));_0x4f1c0f['push'](_0x8f27('0x9f')+_0x7c9e3+';');}BPromise[_0x8f27('0x9b')](_0x4f1c0f,handleQuery)[_0x8f27('0x17')](function(_0x30361c){BPromise[_0x8f27('0x62')]([handleAdditionalPhones()])[_0x8f27('0x17')](function(){_0x4f1c0f=[];for(var _0x8420a2=0x0;_0x8420a2\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x405a,0x164));var _0xa405=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0x405a[_0x312962];return _0x3e85d0;};'use strict';var fs=require('fs');var path=require(_0xa405('0x0'));var _=require('lodash');var Papa=require(_0xa405('0x1'));var util=require(_0xa405('0x2'));var BPromise=require(_0xa405('0x3'));var moment=require(_0xa405('0x4'));var squel=require('squel');var Redis=require(_0xa405('0x5'));var db=require(_0xa405('0x6'))['db'];var config=require(_0xa405('0x7'));var shared=require(_0xa405('0x8'));var logger=require('../../../config/logger')(_0xa405('0x9'));config['redis']=_[_0xa405('0xa')](config[_0xa405('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa405('0xc'))(new Redis(config[_0xa405('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xa405('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa405('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x72c56f){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'](_0x72c56f);}function selectNotIn(_0x323395,_0x451bdc,_0x26cfca,_0x4c5f67,_0x12f729){return squel['select']()['field'](_0xa405('0xf'))[_0xa405('0x10')](_0x4c5f67)[_0xa405('0x11')](_0x451bdc,null,_0x451bdc+_0xa405('0x12')+_0x4c5f67+'.'+_0x26cfca)[_0xa405('0x13')](_0x4c5f67+'.'+_0x26cfca+_0xa405('0x14')+_0x323395+'.'+_0x26cfca)['where'](_0x451bdc+'.dialCheckDuplicateType\x20IN\x20('+_0x12f729[_0xa405('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x30ad59,_0x3d9feb){promisesAdditionalPhones=[];return db['CmContact'][_0xa405('0x15')]({'raw':!![],'attributes':['id',_0xa405('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa405('0x17')](function(_0x4028cd){if(_0x4028cd!==null){var _0x5439b2=[];for(var _0x493bf8=0x0;_0x493bf8<_0x4028cd[_0xa405('0x18')];_0x493bf8++){var _0x47947e=_0x4028cd[_0x493bf8];_0x5439b2[_0xa405('0x19')](insertAdditionalPhones(_0x47947e));}}Promise[_0xa405('0x1a')](_0x5439b2)[_0xa405('0x17')](function(){_0x30ad59({'val':0x1});});});});}function insertAdditionalPhones(_0x42149e){return new Promise(function(_0x383adc,_0x22258d){var _0x96e5c8=_0x42149e[_0xa405('0x16')];var _0x139707=_0x96e5c8[_0xa405('0x1b')](';');var _0x16e638=[];orderBy=0x0;for(var _0x4b1372=0x0;_0x4b1372<_0x139707[_0xa405('0x18')];_0x4b1372++){_0x16e638['push'](splitAdditionalPhone(_0x42149e['id'],_0x139707[_0x4b1372]));}Promise[_0xa405('0x1a')](_0x16e638)[_0xa405('0x17')](function(){_0x383adc({'val':_0x139707[_0xa405('0x18')]});});});}function splitAdditionalPhone(_0x5d82d5,_0x44d1ff){return new Promise(function(_0x5aca37,_0x40cd2a){var _0x27e972=_0x44d1ff[_0xa405('0x1b')](':');var _0x2105d8=_0x27e972[0x0];var _0x548f87=_0x27e972[0x1];if(!_[_0xa405('0x1c')](_0x548f87)){var _0x140df7=_0x548f87[_0xa405('0x1b')]('|');var _0x3ccd62=[];for(var _0x1f2605=0x0;_0x1f2605<_0x140df7[_0xa405('0x18')];_0x1f2605++){if(_0x140df7[_0x1f2605]!==''){var _0x1ad072=_[_0xa405('0x1d')](promisesAdditionalPhones,{'contactId':_0x5d82d5,'phone':_0x140df7[_0x1f2605]});if(_0x1ad072[_0xa405('0x18')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x5d82d5,'contactTypeId':_0x2105d8,'phone':_0x140df7[_0x1f2605],'orderBy':orderBy});}}}_0x5aca37({'ok':0x1});}else _0x5aca37({'res':0x0});});}function createAdditionalPhone(_0x2747ad,_0x1f2397,_0x620156,_0x5f27cc){var _0x5c08a0='';var _0x5e99f4='';var _0x53828a=_0x620156[_0xa405('0x1b')]('§');_0x5c08a0=_0x53828a[0x0];if(_0x53828a['length']==0x2)_0x5e99f4=_0x53828a[0x1];return new Promise(function(_0x540acb,_0x2a5a2f){return db['CmContactHasItem'][_0xa405('0x1e')]({'where':{'CmContactId':_0x2747ad,'item':_0x5c08a0}})[_0xa405('0x17')](function(_0x4c7ae7){if(_0x4c7ae7){return db['CmContactHasItem'][_0xa405('0x1f')]({'ItemTypeId':_0x1f2397,'description':_0x5e99f4,'OrderBy':_0x5f27cc},{'where':{'CmContactId':_0x2747ad,'item':_0x5c08a0}})[_0xa405('0x17')](function(_0x2882d2){_0x540acb({'res':_0xa405('0x20')});});}else{return db[_0xa405('0x21')][_0xa405('0x22')]({'CmContactId':_0x2747ad,'item':_0x5c08a0,'description':_0x5e99f4,'ItemTypeId':_0x1f2397,'OrderBy':_0x5f27cc,'ItemClass':_0xa405('0x23')})[_0xa405('0x17')](function(_0x43892c){_0x540acb({'res':_0xa405('0x24')});});}});});}function insertCmHopper(_0x503ad9,_0x1cc701,_0x202d92,_0x4f0e32,_0xc3dceb){var _0x559e9d=[_0xa405('0x25'),_0xa405('0x26'),_0xa405('0x27'),_0xa405('0x28'),_0x1cc701+'.'+_0x4f0e32,_0xa405('0x29'),_0xa405('0x2a'),_0xa405('0x2b'),_0xa405('0x2c'),'\x22'+_0xc3dceb+'\x22'];return squel[_0xa405('0x2d')]()['into'](_0xa405('0x2e'))['fromQuery']([_0xa405('0xf'),_0xa405('0x2f'),_0xa405('0x30'),_0xa405('0x31'),_0x4f0e32,_0xa405('0x32'),_0xa405('0x33'),_0xa405('0x34'),_0xa405('0x35'),_0xa405('0x36')],squel[_0xa405('0x37')]()[_0xa405('0x38')](_0x559e9d)['from'](_0x1cc701)[_0xa405('0x11')]('cm_contacts',null,_0xa405('0x39')+_0x1cc701+'.CmListId')[_0xa405('0x11')](_0x202d92,null,_0x202d92+'.id\x20=\x20'+_0x1cc701+'.'+_0x4f0e32)['where'](_0x1cc701+_0xa405('0x3a'),_0x503ad9)[_0xa405('0x13')](_0xa405('0x3b'),NOW)[_0xa405('0x13')](_0xa405('0x3c'),selectNotIn(_0x1cc701,_0x202d92,_0x4f0e32,_0xa405('0x2e'),[_0xa405('0x3d'),_0xa405('0x3e')]))[_0xa405('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cc701,_0x202d92,_0x4f0e32,_0xa405('0x2e'),[_0xa405('0x3d')])))['toString']();}function insertCmHopperBlack(_0x2e5aa9,_0x3fbb04,_0xb472d,_0x1ff37e){var _0x5236a7=[_0xa405('0x25'),_0xa405('0x27'),'cm_contacts.ListId',_0x3fbb04+'.'+_0x1ff37e,_0xa405('0x29'),_0xa405('0x2a')];return squel[_0xa405('0x2d')]()['into'](_0xa405('0x3f'))[_0xa405('0x40')]([_0xa405('0xf'),_0xa405('0x30'),_0xa405('0x31'),_0x1ff37e,_0xa405('0x32'),_0xa405('0x33')],squel[_0xa405('0x37')]()[_0xa405('0x38')](_0x5236a7)[_0xa405('0x10')](_0x3fbb04)[_0xa405('0x11')]('cm_contacts',null,_0xa405('0x39')+_0x3fbb04+_0xa405('0x41'))['join'](_0xb472d,null,_0xb472d+_0xa405('0x12')+_0x3fbb04+'.'+_0x1ff37e)[_0xa405('0x13')](_0x3fbb04+_0xa405('0x3a'),_0x2e5aa9)['where'](_0xa405('0x3b'),NOW)[_0xa405('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xa405('0x37')]()[_0xa405('0x42')](_0xa405('0xf'))['from'](_0xa405('0x3f'))['where'](_0xa405('0x43'),_0x2e5aa9)[_0xa405('0x13')](_0x1ff37e+'\x20=\x20'+_0x3fbb04+'.'+_0x1ff37e)))[_0xa405('0x44')]();}function insertTzCmHopper(_0x562966,_0x568d71,_0x5a73f1,_0x27a31d,_0xf7691f,_0x27e43f){var _0x33fdd0=[_0xa405('0x25'),_0xa405('0x45')+_0x27e43f+_0xa405('0x46'),_0xa405('0x27'),_0xa405('0x28'),_0x568d71+'.'+_0x27a31d,_0xa405('0x29'),'cm_contacts.updatedAt',_0xa405('0x2b'),'cm_contacts.UserId','\x22'+_0xf7691f+'\x22'];var _0x57ef9b=squel[_0xa405('0x2d')]()['into'](_0xa405('0x2e'))[_0xa405('0x40')]([_0xa405('0xf'),'scheduledat',_0xa405('0x30'),_0xa405('0x31'),_0x27a31d,_0xa405('0x32'),'updatedAt',_0xa405('0x34'),_0xa405('0x35'),_0xa405('0x36')],squel[_0xa405('0x37')]()['fields'](_0x33fdd0)[_0xa405('0x10')](_0x568d71)[_0xa405('0x11')]('cm_contacts',null,_0xa405('0x39')+_0x568d71+'.CmListId')[_0xa405('0x11')](_0x5a73f1,null,_0x5a73f1+_0xa405('0x12')+_0x568d71+'.'+_0x27a31d)[_0xa405('0x11')](_0x27e43f,null,_0x27e43f+_0xa405('0x12')+_0x568d71+'.'+_0x27a31d)[_0xa405('0x13')](_0x568d71+_0xa405('0x3a'),_0x562966)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xa405('0x3c'),selectNotIn(_0x568d71,_0x5a73f1,_0x27a31d,_0xa405('0x2e'),[_0xa405('0x3d'),'\x22onlyIfOpen\x22']))[_0xa405('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x568d71,_0x5a73f1,_0x27a31d,_0xa405('0x2e'),[_0xa405('0x3d')])))['toString']();return _0x57ef9b;}function insertTzCmHopperBlack(_0x27396f,_0x2ae8b9,_0x318884,_0xbba5a9){var _0x3496d1=[_0xa405('0x25'),_0xa405('0x27'),_0xa405('0x28'),_0x2ae8b9+'.'+_0xbba5a9,_0xa405('0x29'),_0xa405('0x2a')];return squel[_0xa405('0x2d')]()[_0xa405('0x47')]('cm_hopper_black')[_0xa405('0x40')]([_0xa405('0xf'),_0xa405('0x30'),'ListId',_0xbba5a9,_0xa405('0x32'),'updatedAt'],squel[_0xa405('0x37')]()[_0xa405('0x38')](_0x3496d1)[_0xa405('0x10')](_0x2ae8b9)[_0xa405('0x11')](_0xa405('0x48'),null,'cm_contacts.ListId\x20=\x20'+_0x2ae8b9+_0xa405('0x41'))['join'](_0x318884,null,_0x318884+_0xa405('0x12')+_0x2ae8b9+'.'+_0xbba5a9)[_0xa405('0x13')](_0x2ae8b9+_0xa405('0x3a'),_0x27396f)[_0xa405('0x13')](_0xa405('0x3b'),NOW)[_0xa405('0x13')](_0xa405('0x3c'),squel[_0xa405('0x37')]()[_0xa405('0x42')](_0xa405('0xf'))[_0xa405('0x10')]('cm_hopper_black')[_0xa405('0x13')](_0xa405('0x43'),_0x27396f)[_0xa405('0x13')](_0xbba5a9+'\x20=\x20'+_0x2ae8b9+'.'+_0xbba5a9)))[_0xa405('0x44')]();}function insertCmHopperAdditionalPhones(_0x12efc2){var _0x1d6dd8=[_0xa405('0x49'),_0xa405('0x4a'),_0xa405('0x4b'),_0xa405('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0xa405('0x2d')]()[_0xa405('0x47')](_0xa405('0x4d'))[_0xa405('0x40')]([_0xa405('0x4e'),_0xa405('0xf'),'OrderBy',_0xa405('0x32'),_0xa405('0x33')],squel[_0xa405('0x37')]()[_0xa405('0x38')](_0x1d6dd8)[_0xa405('0x10')](_0xa405('0x2e'))[_0xa405('0x11')](_0xa405('0x48'),null,_0xa405('0x4f'))['join'](_0xa405('0x50'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xa405('0x51'),_0x12efc2)[_0xa405('0x13')](_0xa405('0x3b'),NOW))[_0xa405('0x44')]();}function insertCmContact(_0x270f04,_0x38ecf1,_0x6e34aa,_0xe0066b){var _0x256112=_[_0xa405('0x52')](_['keys'](_0xe0066b),['ListId',_0xa405('0x53'),_0xa405('0x32'),'updatedAt','scheduledAt']);return squel[_0xa405('0x2d')]()[_0xa405('0x47')](_0xa405('0x48'))['fromQuery'](_0x256112,squel[_0xa405('0x37')]()['fields'](_0x256112)[_0xa405('0x10')](_0x38ecf1)[_0xa405('0x13')]('('+_0x6e34aa[_0xa405('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0xa405('0x37')]()[_0xa405('0x38')](_0x6e34aa)['from']('cm_contacts')['where'](_0xa405('0x43'),_0x270f04)['where'](_0xa405('0x54')))[_0xa405('0x13')]('id\x20IN\x20?',squel[_0xa405('0x37')]()[_0xa405('0x42')](_0xa405('0x55'),'min_id')[_0xa405('0x10')](_0x38ecf1)['group'](_0x6e34aa[_0xa405('0x11')](','))))[_0xa405('0x44')]();}function handleStop(){logger[_0xa405('0x56')](_0xa405('0x57'));stopped=!![];}function handleUncaughtException(_0x5dd20a){logger['error'](_0x5dd20a[_0xa405('0x58')]);process[_0xa405('0x59')](0x1);}function handleError(_0x2b50bb,_0x56e0d4){stats[_0xa405('0x5a')]['push']({'name':_0x56e0d4['code'],'message':_0x56e0d4[_0xa405('0x58')],'row':_0x2b50bb});}function handleQuery(_0x9be36d){logger[_0xa405('0x56')](_0x9be36d);return db[_0xa405('0x5b')][_0xa405('0x5c')](_0x9be36d)[_0xa405('0x5d')](function(_0x5ea897){results[_0xa405('0x19')](_0x5ea897);})['catch'](function(_0x558f6c){logger[_0xa405('0x5e')](_0x558f6c[_0xa405('0x58')]);});}function updateTzCampaigns(_0x377946){return new Promise(function(_0xaf95d5,_0x11d420){var _0x139c81=squel[_0xa405('0x37')]()[_0xa405('0x38')]([_0xa405('0x5f'),_0xa405('0x60')])[_0xa405('0x10')](_0xa405('0x61'))[_0xa405('0x11')](_0xa405('0x62'),null,_0xa405('0x63'))[_0xa405('0x13')](_0xa405('0x64')+_0x377946);db[_0xa405('0x5b')][_0xa405('0x5c')](_0x139c81[_0xa405('0x44')]())[_0xa405('0x5d')](function(_0x17e6f1){var _0x4046fe=[];for(var _0x2726c1=0x0;_0x2726c1<_0x17e6f1[_0xa405('0x18')];_0x2726c1++){_0x4046fe[_0xa405('0x19')](getTimezoneData(_0x17e6f1[_0x2726c1],tmp_campaigns));}BPromise[_0xa405('0x1a')](_0x4046fe)['then'](function(){_0xaf95d5({'val':0x1});});})[_0xa405('0x65')](function(_0x353b79){logger[_0xa405('0x5e')](_0x353b79[_0xa405('0x58')]);_0xaf95d5({'val':0x0});});});}function updateTzVoiceQueues(_0x2616f4){return new Promise(function(_0x2113ff,_0x521c0e){var _0x85f8d3=squel[_0xa405('0x37')]()[_0xa405('0x38')]([_0xa405('0x66'),_0xa405('0x67')])[_0xa405('0x10')](_0xa405('0x68'))['join'](_0xa405('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xa405('0x13')](_0xa405('0x6a')+_0x2616f4);db[_0xa405('0x5b')][_0xa405('0x5c')](_0x85f8d3['toString']())['spread'](function(_0x29666c){var _0x5d69c2=[];for(var _0x559d14=0x0;_0x559d14<_0x29666c['length'];_0x559d14++){_0x5d69c2[_0xa405('0x19')](getTimezoneData(_0x29666c[_0x559d14],tmp_voice_queues));}BPromise[_0xa405('0x1a')](_0x5d69c2)[_0xa405('0x17')](function(){_0x2113ff({'val':0x1});});})[_0xa405('0x65')](function(_0x28647c){logger[_0xa405('0x5e')](_0x28647c[_0xa405('0x58')]);_0x2113ff({'val':0x0});});});}function getTimezoneData(_0x640d02,_0x27134c){return new Promise(function(_0x5745d5,_0x4a11b9){var _0xa537e1=shared[_0xa405('0x6b')];var _0x4e4948=_0xa537e1[_0x640d02[_0xa405('0x6c')]];if(_[_0xa405('0x1c')](_0x4e4948)){_0x5745d5({'ret':0x1});}else{var _0x35fa28=_0x4e4948[_0xa405('0x6d')];var _0x41e58e=squel[_0xa405('0x2d')]()[_0xa405('0x47')](_0x27134c)['set']('id',_0x640d02['id'])[_0xa405('0x6e')](_0xa405('0x6f'),_0x35fa28)[_0xa405('0x6e')](_0xa405('0x6c'),_0x640d02[_0xa405('0x6c')])[_0xa405('0x44')]();return db['sequelize'][_0xa405('0x5c')](_0x41e58e)[_0xa405('0x5d')](function(_0x39e4b5){_0x5745d5({'ret':0x1});})['catch'](function(_0x32c8b9){logger[_0xa405('0x5e')](_0x32c8b9['message']);_0x4a11b9({'ret':0x1});});}});}function handleTZQuery(_0x25a6f8){logger[_0xa405('0x56')](_0x25a6f8);return db['sequelize'][_0xa405('0x5c')](_0x25a6f8)[_0xa405('0x5d')](function(_0x5d8956){})[_0xa405('0x65')](function(_0x525812){logger[_0xa405('0x5e')](_0x525812[_0xa405('0x58')]);});}function main(_0xfdfbf7,_0x250c1a,_0x500c0a,_0x3cec15){logger[_0xa405('0x56')](_0xa405('0x70'),_0xfdfbf7,JSON['stringify'](_0x250c1a));process[_0xa405('0x71')]('start');var _0x13bb62=_0x250c1a[_0xa405('0x72')];var _0x4acae3=_[_0xa405('0x73')](_0x13bb62);var _0x488f5e=_0x250c1a[_0xa405('0x74')];var _0x48384a=path[_0xa405('0x11')](config[_0xa405('0x75')],'server/files/tmp',_0x488f5e+_0xa405('0x76'));hasTZ=_[_0xa405('0x77')](_0x13bb62)[_0xa405('0x78')]('dialTimezone');var _0x4a0554=_['keys'](_0x13bb62)[_0xa405('0x11')]();logger[_0xa405('0x56')]('header',_0x4a0554);db['ContactItemType'][_0xa405('0x15')]({'raw':!![],'attributes':['id',_0xa405('0x79')]})[_0xa405('0x17')](function(_0x16156d){for(var _0x562f2a=0x0;_0x562f2a<_0x16156d[_0xa405('0x18')];_0x562f2a++){if(_0x16156d[_0x562f2a][_0xa405('0x79')]in _0x13bb62){contactItemTypes[_0xa405('0x19')](_0x16156d[_0x562f2a]);delete _0x4acae3[_0x16156d[_0x562f2a][_0xa405('0x79')]];hasAdditionalPhones=!![];}for(var _0x30087a in _0x13bb62){if(_0x16156d[_0x562f2a][_0xa405('0x79')]+'_description'===_0x30087a){phoneDescriptions[_0xa405('0x19')]({'itemTypeId':_0x16156d[_0x562f2a]['id'],'description':_0x30087a});delete _0x4acae3[_0x30087a];}}}if(hasAdditionalPhones)_0x4acae3['AdditionalPhones']='';var _0x37334e=_[_0xa405('0x77')](_0x4acae3)['join']();logger[_0xa405('0x56')](_0xa405('0x7a'),_0x37334e);fs['writeFileSync'](_0x48384a,_0x37334e+'\x0a');Papa[_0xa405('0x7b')](fs[_0xa405('0x7c')](_0xfdfbf7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x34e090,_0x3d7c36){try{for(var _0x6b2da6=0x0,_0x2aa5e7=[];_0x6b2da6<_0x34e090['data'][_0xa405('0x18')];_0x6b2da6++){stats[_0xa405('0x7d')]+=0x1;if(_0x34e090['errors'][_0x6b2da6]){handleError(_0x34e090[_0xa405('0x7e')][_0x6b2da6],_0x34e090[_0xa405('0x5a')][_0x6b2da6]);}else{var _0x58e7f9=[];var _0x34705f=[];var _0x4bf449={};for(var _0x1c46d2 in _0x13bb62){let _0x168d48=contactItemTypes[_0xa405('0x7f')](_0xb69e30=>_0xb69e30['name']===_0x1c46d2);let _0x45e67a=contactItemTypes[_0xa405('0x7f')](_0x45bfb2=>_0x45bfb2[_0xa405('0x79')]+_0xa405('0x80')===_0x1c46d2);if(_[_0xa405('0x1c')](_0x168d48)&&_[_0xa405('0x1c')](_0x45e67a)){if(_0x13bb62[_0xa405('0x81')](_0x1c46d2)){if(_0x34e090[_0xa405('0x7e')][_0x6b2da6][_0x13bb62[_0x1c46d2]]){var _0x1bb096=_[_0xa405('0x82')](_0x34e090[_0xa405('0x7e')][_0x6b2da6][_0x13bb62[_0x1c46d2]]['replace'](/"/g,'\x27'));switch(_0x1c46d2){case _0xa405('0x2f'):var _0x35972c=moment(_0x1bb096,_0xa405('0xd'),!![]);if(_0x35972c['isValid']()){_0x2aa5e7['push']('\x22'+_0x1bb096+'\x22');}else{_0x58e7f9['push'](_0xa405('0x83'));}break;case _0xa405('0x34'):var _0x52249e=parseInt(_0x1bb096);_0x1bb096=_['isNaN'](_0x52249e)||_0x52249e<0x0||_0x52249e>0x4?_0x3cec15?0x3:0x2:_0x52249e;_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x1bb096+'\x22');break;case'UserId':var _0x7f2327=parseInt(_0x1bb096);if(_[_0xa405('0x84')](_0x7f2327)&&_[_0xa405('0x78')](_0x500c0a,_0x7f2327)){_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x7f2327+'\x22');}else{_0x58e7f9[_0xa405('0x19')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x1bb096)){_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x1bb096+'\x22');}else{_0x58e7f9['push'](_0xa405('0x85'));}break;case _0xa405('0x86'):var _0x2b1ec5=moment(_0x1bb096,_0xa405('0x87'),!![]);if(_0x2b1ec5[_0xa405('0x88')]()){_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x1bb096+'\x22');}else{_0x58e7f9['push'](_0xa405('0x89'));}break;case _0xa405('0x6c'):var _0x4440a1=shared[_0xa405('0x6b')];var _0x5baa24=_0x4440a1[_0x1bb096];if(!_[_0xa405('0x1c')](_0x5baa24)){var _0x4fe833=_0x5baa24[_0xa405('0x6d')];_0x2aa5e7['push']('\x22'+_0x1bb096+'\x22');_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x4fe833+'\x22');}break;default:_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x1bb096+'\x22');}}else{switch(_0x1c46d2){case'firstName':case'phone':_0x58e7f9[_0xa405('0x19')](_0x1c46d2+'\x20not\x20specified');break;default:_0x2aa5e7[_0xa405('0x19')]('\x22\x22');}}}}else{var _0x3338ab='';if(!_[_0xa405('0x1c')](_0x168d48)){if(!_0x4bf449[_0xa405('0x81')](_0x168d48['id'])){if(!_[_0xa405('0x1c')](_0x34e090['data'][_0x6b2da6][_0x13bb62[_0x1c46d2]])){var _0x1bb096=_['trim'](_0x34e090[_0xa405('0x7e')][_0x6b2da6][_0x13bb62[_0x1c46d2]][_0xa405('0x8a')](/"/g,'\x27'));var _0x31eabb=phoneDescriptions[_0xa405('0x7f')](_0x59e2ca=>_0x59e2ca[_0xa405('0x8b')]===_0x168d48['id']);if(!_['isNil'](_0x31eabb)){var _0x155bbd=_[_0xa405('0x82')](_0x34e090[_0xa405('0x7e')][_0x6b2da6][_0x13bb62[_0x31eabb['description']]][_0xa405('0x8a')](/"/g,'\x27'));if(!_[_0xa405('0x1c')](_0x155bbd))_0x1bb096=_0x1bb096+'§'+_0x155bbd;}if(_0x3338ab=='')_0x3338ab=_0x1bb096;else _0x3338ab+='|'+_0x1bb096;}_0x34705f[_0xa405('0x19')](_0x168d48['id']+':'+_0x3338ab);_0x4bf449[_0x168d48['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2aa5e7[_0xa405('0x19')]('\x22'+_0x34705f[_0xa405('0x11')](';')+'\x22');}if(_0x58e7f9['length']){handleError(_0x34e090[_0xa405('0x7e')][_0x6b2da6],{'code':'SystemRow','message':_0x58e7f9[_0xa405('0x11')]()});}else{fs[_0xa405('0x8c')](_0x48384a,_0x2aa5e7[_0xa405('0x11')]()+'\x0a');}_0x2aa5e7=[];}if(!(stats[_0xa405('0x7d')]%0xc8)){socket[_0xa405('0x8d')]('contact:import:'+_0x488f5e,stats);stats[_0xa405('0x5a')]=[];}}if(stopped){logger[_0xa405('0x56')]('Abort\x20parser');_0x3d7c36['abort']();}}catch(_0xb0715b){handleError(_0x34e090[_0xa405('0x7e')][_0x6b2da6],{'code':'SystemError','message':_0xb0715b[_0xa405('0x58')]});logger[_0xa405('0x5e')](_0xa405('0x8e'),_0xb0715b[_0xa405('0x58')]);}},'complete':function(){try{var _0x39f2a2=[];var _0x41dcaa=[];var _0x11d27c=_0xa405('0x48');if(_0x250c1a[_0xa405('0x8f')]&&_0x250c1a[_0xa405('0x8f')]['length']){_0x11d27c=_0xa405('0x90')+_0x488f5e;_0x39f2a2['push'](_0xa405('0x91')+_0x11d27c+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xa405('0x92')+_0x488f5e;tmp_voice_queues=_0xa405('0x93')+_0x488f5e;_0x41dcaa[_0xa405('0x19')](_0xa405('0x91')+tmp_campaigns+_0xa405('0x94'));_0x41dcaa[_0xa405('0x19')](_0xa405('0x91')+tmp_voice_queues+_0xa405('0x94'));BPromise[_0xa405('0x95')](_0x41dcaa,handleTZQuery)['then'](function(_0x435845){updateTzCampaigns(_0x250c1a[_0xa405('0x31')])[_0xa405('0x17')](function(_0xf2d636){updateTzVoiceQueues(_0x250c1a[_0xa405('0x31')])['then'](function(_0x103de9){if(hasTZ)_0x37334e=_0x37334e[_0xa405('0x8a')]('dialTimezone','dialTimezone,utcOffset');var _0x2ac54a=util[_0xa405('0xe')](_0xa405('0x96'),_0x48384a,_0x11d27c,_0x37334e,_0x250c1a[_0xa405('0x31')],_0x250c1a['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x13bb62[_0xa405('0x2f')])){_0x2ac54a+=_0xa405('0x97');}_0x39f2a2['push'](_0x2ac54a);if(_0x250c1a['duplicates']&&_0x250c1a[_0xa405('0x8f')][_0xa405('0x18')]){_0x39f2a2[_0xa405('0x19')](insertCmContact(_0x250c1a['ListId'],_0x11d27c,_0x250c1a['duplicates'],_0x13bb62));_0x39f2a2[_0xa405('0x19')]('DROP\x20TABLE\x20'+_0x11d27c+';');}BPromise[_0xa405('0x95')](_0x39f2a2,handleQuery)['then'](function(_0x4ed7cc){BPromise[_0xa405('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x39f2a2=[];for(var _0x17a65d=0x0;_0x17a65d_0x1d3ab6[_0xd173('0x6a')]===_0x155e72);let _0x1810dd=contactItemTypes[_0xd173('0x6f')](_0x11fb8a=>_0x11fb8a[_0xd173('0x6a')]+_0xd173('0x70')===_0x155e72);if(_[_0xd173('0x18')](_0x317ae4)&&_[_0xd173('0x18')](_0x1810dd)){if(_0x4b0255['hasOwnProperty'](_0x155e72)){if(_0x393cb8[_0xd173('0x6d')][_0x21902b][_0x4b0255[_0x155e72]]){var _0x486647=_[_0xd173('0x71')](_0x393cb8[_0xd173('0x6d')][_0x21902b][_0x4b0255[_0x155e72]]['replace'](/"/g,'\x27'));switch(_0x155e72){case _0xd173('0x32'):var _0x445dd7=moment(_0x486647,_0xd173('0x72'),!![]);if(_0x445dd7['isValid']()){_0xf70f06['push']('\x22'+_0x486647+'\x22');}else{_0x3a0126['push'](_0xd173('0x73'));}break;case _0xd173('0x74'):var _0xb6e22e=parseInt(_0x486647);_0x486647=_[_0xd173('0x75')](_0xb6e22e)||_0xb6e22e<0x0||_0xb6e22e>0x4?_0x1fdc25?0x3:0x2:_0xb6e22e;_0xf70f06[_0xd173('0x1a')]('\x22'+_0x486647+'\x22');break;case'UserId':var _0x161545=parseInt(_0x486647);if(_[_0xd173('0x76')](_0x161545)&&_[_0xd173('0x77')](_0x49cfb4,_0x161545)){_0xf70f06[_0xd173('0x1a')]('\x22'+_0x161545+'\x22');}else{_0x3a0126[_0xd173('0x1a')](_0xd173('0x78'));}break;case _0xd173('0x79'):if(isEmail(_0x486647)){_0xf70f06[_0xd173('0x1a')]('\x22'+_0x486647+'\x22');}else{_0x3a0126[_0xd173('0x1a')](_0xd173('0x7a'));}break;case _0xd173('0x7b'):var _0x43a2a4=moment(_0x486647,'YYYY-MM-DD',!![]);if(_0x43a2a4[_0xd173('0x7c')]()){_0xf70f06[_0xd173('0x1a')]('\x22'+_0x486647+'\x22');}else{_0x3a0126[_0xd173('0x1a')](_0xd173('0x7d'));}break;default:_0xf70f06['push']('\x22'+_0x486647+'\x22');}}else{switch(_0x155e72){case _0xd173('0x7e'):case _0xd173('0xf'):_0x3a0126[_0xd173('0x1a')](_0x155e72+_0xd173('0x7f'));break;default:_0xf70f06[_0xd173('0x1a')]('\x22\x22');}}}}else{var _0x49674c='';if(!_[_0xd173('0x18')](_0x317ae4)){if(!_0x4647cf[_0xd173('0x80')](_0x317ae4['id'])){for(var _0x31d2e4=0x0;_0x31d2e4<_0x4b0255[_0x155e72]['length'];_0x31d2e4++){var _0x486647=_[_0xd173('0x71')](_0x393cb8[_0xd173('0x6d')][_0x21902b][_0x4b0255[_0x155e72][_0x31d2e4]][_0xd173('0x81')](/"/g,'\x27'));var _0x50b9c5=phoneDescriptions[_0xd173('0x6f')](_0x4196d2=>_0x4196d2[_0xd173('0x82')]===_0x317ae4['id']);if(!_[_0xd173('0x18')](_0x50b9c5)){var _0x33d9c6=_['trim'](_0x393cb8[_0xd173('0x6d')][_0x21902b][_0x4b0255[_0x50b9c5[_0xd173('0x83')]][0x0]][_0xd173('0x81')](/"/g,'\x27'));if(!_[_0xd173('0x18')](_0x33d9c6))_0x486647=_0x486647+'§'+_0x33d9c6;}if(_0x49674c=='')_0x49674c=_0x486647;else _0x49674c+='|'+_0x486647;}_0x2b4981[_0xd173('0x1a')](_0x317ae4['id']+':'+_0x49674c);_0x4647cf[_0x317ae4['id']]=0x1;}}}}if(hasAdditionalPhones){_0xf70f06[_0xd173('0x1a')]('\x22'+_0x2b4981['join'](';')+'\x22');}if(_0x3a0126[_0xd173('0x1f')]){handleError(_0x393cb8[_0xd173('0x6d')][_0x21902b],{'code':_0xd173('0x84'),'message':_0x3a0126[_0xd173('0x11')]()});}else{fs[_0xd173('0x85')](_0x2f2a07,_0xf70f06[_0xd173('0x11')]()+'\x0a');}_0xf70f06=[];}if(!(stats['rows']%0xc8)){socket[_0xd173('0x86')]('contact:import:'+_0x35fea4,stats);stats[_0xd173('0x5d')]=[];}}if(stopped){logger[_0xd173('0x5a')](_0xd173('0x87'));_0x502d0b['abort']();}}catch(_0x4aa969){handleError(_0x393cb8[_0xd173('0x6d')][_0x21902b],{'code':'SystemError','message':_0x4aa969['message']});logger['error'](_0xd173('0x88'),_0x4aa969[_0xd173('0x1d')]);}},'complete':function(){try{var _0x3239b3=[];var _0x1fe2c3=tempTableName;_0x3239b3[_0xd173('0x1a')]('CREATE\x20TABLE\x20'+_0x1fe2c3+_0xd173('0x89'));logger['info'](_0xd173('0x8a'),contactItemTypes[_0xd173('0x1f')]);var _0x386dc9=util[_0xd173('0xa')](_0xd173('0x8b'),_0x2f2a07,_0x1fe2c3,_0x377a91,_0x34723e[_0xd173('0x43')],_0x34723e[_0xd173('0x53')]||null,NOW,NOW);if(_['isNil'](_0x4b0255[_0xd173('0x32')])){_0x386dc9+=_0xd173('0x8c');}_0x3239b3[_0xd173('0x1a')](_0x386dc9);BPromise[_0xd173('0x8d')](_0x3239b3,handleQuery)['then'](function(_0x4e7b5a){BPromise[_0xd173('0x1b')]([handleAdditionalPhones()])[_0xd173('0x20')](function(){_0x3239b3=[];for(var _0x5873c8=0x0;_0x5873c8\x20\x20');}var _0x2dc7fe=path['join'](config['root'],_0xd173('0x66'),process['argv'][0x2]);if(!fs[_0xd173('0x97')](_0x2dc7fe)){throw new Error(_0xd173('0x98'));}var _0x19fd7d={};try{_0x19fd7d=JSON['parse'](process[_0xd173('0x96')][0x3]);if(!_0x19fd7d[_0xd173('0x63')]){throw new Error(_0xd173('0x99'));}var _0x141b67=0x0;if(_0x19fd7d[_0xd173('0x63')][_0xd173('0x35')]){_0x141b67=0x1;}if(!_0x19fd7d[_0xd173('0x43')]){throw new Error(_0xd173('0x9a'));}}catch(_0x6c5ab7){throw new Error(_0xd173('0x9b'));}var _0x3e08fa=[];try{_0x3e08fa=_[_0xd173('0x9c')](JSON['parse'](process[_0xd173('0x96')][0x4]),'id');}catch(_0x5eb10a){logger[_0xd173('0x5a')](_0xd173('0x9d'));}main(_0x2dc7fe,_0x19fd7d,_0x3e08fa,_0x141b67);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x1956=['ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','catch','error','message','split','length','then','filter','CmContactHasItem','findOne','update','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','errors','code','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','findAll','name','_description','keys','writeFileSync','parse','createReadStream','data','rows','find','trim','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x1956,0x15c));var _0x6195=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x1956[_0x310504];return _0x5b36d0;};'use strict';var fs=require('fs');var path=require(_0x6195('0x0'));var _=require(_0x6195('0x1'));var Papa=require(_0x6195('0x2'));var util=require(_0x6195('0x3'));var BPromise=require(_0x6195('0x4'));var moment=require(_0x6195('0x5'));var squel=require(_0x6195('0x6'));var Redis=require('ioredis');var db=require(_0x6195('0x7'))['db'];var config=require(_0x6195('0x8'));var logger=require(_0x6195('0x9'))(_0x6195('0xa'));config[_0x6195('0xb')]=_[_0x6195('0xc')](config[_0x6195('0xb')],{'host':_0x6195('0xd'),'port':0x18eb});var socket=require(_0x6195('0xe'))(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()[_0x6195('0xf')](_0x6195('0x10'));var tempTableName=_0x6195('0x11')+moment()[_0x6195('0xf')](_0x6195('0x12'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4b5834){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))*$/[_0x6195('0x13')](_0x4b5834);}function selectNotIn(_0x1870d9,_0x5ce5c1,_0x4b0cbd,_0x4df791,_0x66e0b4){return squel[_0x6195('0x14')]()[_0x6195('0x15')](_0x6195('0x16'))[_0x6195('0x17')](_0x4df791)[_0x6195('0x18')](_0x5ce5c1,null,_0x5ce5c1+'.id\x20=\x20'+_0x4df791+'.'+_0x4b0cbd)[_0x6195('0x19')](_0x4df791+'.'+_0x4b0cbd+_0x6195('0x1a')+_0x1870d9+'.'+_0x4b0cbd)['where'](_0x5ce5c1+_0x6195('0x1b')+_0x66e0b4[_0x6195('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5320f7,_0x25a4c9){promisesAdditionalPhones=[];promisesContact=[];return db[_0x6195('0x1c')][_0x6195('0x1d')](_0x6195('0x1e')+tempTableName)[_0x6195('0x1f')](function(_0x1a555f){if(_0x1a555f!==null){var _0x3b481a=[];for(var _0x232399=0x0;_0x232399<_0x1a555f['length'];_0x232399++){var _0x5c0176=_0x1a555f[_0x232399];if(!_[_0x6195('0x20')](_0x5c0176[_0x6195('0x16')])){if(!_[_0x6195('0x20')](_0x5c0176[_0x6195('0x21')]))_0x3b481a[_0x6195('0x22')](insertAdditionalPhones(_0x5c0176));promisesContact['push']({'contact':_0x5c0176});}}}Promise[_0x6195('0x23')](_0x3b481a)['then'](function(){_0x5320f7({'val':0x1});});})[_0x6195('0x24')](function(_0x1f17f2){logger[_0x6195('0x25')](_0x1f17f2[_0x6195('0x26')]);});});}function insertAdditionalPhones(_0x44a502){return new Promise(function(_0x4e9673,_0x4cadf3){var _0x582deb=_0x44a502['AdditionalPhones'];if(_[_0x6195('0x20')](_0x582deb))_0x4cadf3({'val':0x0});else{var _0x395588=_0x582deb[_0x6195('0x27')](';');var _0x4f2d43=[];orderBy=0x0;for(var _0x5bed95=0x0;_0x5bed95<_0x395588[_0x6195('0x28')];_0x5bed95++){_0x4f2d43['push'](splitAdditionalPhone(_0x44a502['id'],_0x395588[_0x5bed95]));}Promise[_0x6195('0x23')](_0x4f2d43)[_0x6195('0x29')](function(){_0x4e9673({'val':_0x395588[_0x6195('0x28')]});});}});}function splitAdditionalPhone(_0x5dbe2c,_0x8f9c09){return new Promise(function(_0x19c505,_0xd03b87){var _0x571abb=_0x8f9c09['split'](':');var _0x5d3859=_0x571abb[0x0];var _0x449360=_0x571abb[0x1];if(_0x449360!==''){var _0x467935=_0x449360[_0x6195('0x27')]('|');var _0x2aa569=[];for(var _0x283829=0x0;_0x283829<_0x467935[_0x6195('0x28')];_0x283829++){if(_0x467935[_0x283829]!==''){var _0x251e21=_[_0x6195('0x2a')](promisesAdditionalPhones,{'contactId':_0x5dbe2c,'phone':_0x467935[_0x283829]});if(_0x251e21[_0x6195('0x28')]==0x0){orderBy++;promisesAdditionalPhones[_0x6195('0x22')]({'contactId':_0x5dbe2c,'contactTypeId':_0x5d3859,'phone':_0x467935[_0x283829],'orderBy':orderBy});}}}_0x19c505({'ok':0x1});}else _0x19c505({'res':0x0});});}function createAdditionalPhone(_0x566e1e,_0x20c3e2,_0x5af2af,_0x126409){var _0x47563b='';var _0x418144='';var _0x3688d6=_0x5af2af[_0x6195('0x27')]('§');_0x47563b=_0x3688d6[0x0];if(_0x3688d6[_0x6195('0x28')]==0x2)_0x418144=_0x3688d6[0x1];return new Promise(function(_0x1bca0a,_0x208c93){return db[_0x6195('0x2b')][_0x6195('0x2c')]({'where':{'CmContactId':_0x566e1e,'item':_0x47563b}})[_0x6195('0x29')](function(_0x52d3ff){if(_0x52d3ff){return db[_0x6195('0x2b')][_0x6195('0x2d')]({'ItemTypeId':_0x20c3e2,'description':_0x418144,'OrderBy':_0x126409},{'where':{'CmContactId':_0x566e1e,'item':_0x47563b}})[_0x6195('0x29')](function(_0x169c0c){_0x1bca0a({'res':'updated'});});}else{return db[_0x6195('0x2b')]['create']({'CmContactId':_0x566e1e,'item':_0x47563b,'ItemTypeId':_0x20c3e2,'description':_0x418144,'OrderBy':_0x126409,'ItemClass':_0x6195('0x2e')})[_0x6195('0x29')](function(_0x53f49b){_0x1bca0a({'res':_0x6195('0x2f')});});}});});}function updateContact(_0xbe61d3){return new Promise(function(_0x4c7f03,_0x12df71){var _0x7adb4e=_0xbe61d3['id'];delete _0xbe61d3['id'];return db[_0x6195('0x30')][_0x6195('0x2d')](_0xbe61d3,{'where':{'id':_0x7adb4e}})[_0x6195('0x29')](function(_0x370675){updatedRows+=0x1;return db[_0x6195('0x31')][_0x6195('0x2d')]({'phone':_0xbe61d3[_0x6195('0x16')]},{'where':{'ContactId':_0x7adb4e}})['then'](function(_0x8e6083){_0x4c7f03({'ret':'OK'});});});});}function insertCmHopper(_0x32f222,_0x275405,_0x4e7467,_0x35bc21,_0x3c0525){var _0x191aec=[_0x6195('0x32'),'cm_contacts.scheduledat',_0x6195('0x33'),_0x6195('0x34'),_0x275405+'.'+_0x35bc21,_0x6195('0x35'),_0x6195('0x36'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x3c0525+'\x22'];return squel[_0x6195('0x37')]()[_0x6195('0x38')]('cm_hopper')[_0x6195('0x39')]([_0x6195('0x16'),'scheduledat',_0x6195('0x3a'),_0x6195('0x3b'),_0x35bc21,_0x6195('0x3c'),_0x6195('0x3d'),_0x6195('0x3e'),_0x6195('0x3f'),_0x6195('0x40')],squel[_0x6195('0x14')]()['fields'](_0x191aec)[_0x6195('0x17')](_0x275405)[_0x6195('0x18')](_0x6195('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x275405+_0x6195('0x42'))[_0x6195('0x18')](_0x4e7467,null,_0x4e7467+_0x6195('0x43')+_0x275405+'.'+_0x35bc21)[_0x6195('0x19')](_0x275405+_0x6195('0x44'),_0x32f222)['where'](_0x6195('0x45'),NOW)[_0x6195('0x19')](_0x6195('0x46'),selectNotIn(_0x275405,_0x4e7467,_0x35bc21,_0x6195('0x47'),[_0x6195('0x48'),_0x6195('0x49')]))[_0x6195('0x19')](_0x6195('0x46'),selectNotIn(_0x275405,_0x4e7467,_0x35bc21,_0x6195('0x47'),[_0x6195('0x48')])))[_0x6195('0x4a')]();}function insertCmHopperBlack(_0x51b4f3,_0x2dc47b,_0x2f7895,_0x45a188){var _0x9743fd=[_0x6195('0x32'),'cm_contacts.id',_0x6195('0x34'),_0x2dc47b+'.'+_0x45a188,_0x6195('0x35'),_0x6195('0x36')];return squel[_0x6195('0x37')]()[_0x6195('0x38')](_0x6195('0x4b'))[_0x6195('0x39')]([_0x6195('0x16'),'ContactId',_0x6195('0x3b'),_0x45a188,_0x6195('0x3c'),_0x6195('0x3d')],squel[_0x6195('0x14')]()[_0x6195('0x4c')](_0x9743fd)[_0x6195('0x17')](_0x2dc47b)['join'](_0x6195('0x41'),null,_0x6195('0x4d')+_0x2dc47b+_0x6195('0x42'))[_0x6195('0x18')](_0x2f7895,null,_0x2f7895+_0x6195('0x43')+_0x2dc47b+'.'+_0x45a188)[_0x6195('0x19')](_0x2dc47b+_0x6195('0x44'),_0x51b4f3)['where'](_0x6195('0x45'),NOW)[_0x6195('0x19')](_0x6195('0x46'),squel[_0x6195('0x14')]()['field']('phone')[_0x6195('0x17')]('cm_hopper_black')[_0x6195('0x19')](_0x6195('0x4e'),_0x51b4f3)[_0x6195('0x19')](_0x45a188+_0x6195('0x4f'),_0x2dc47b+'.'+_0x45a188)))['toString']();}function insertCmHopperAdditionalPhones(_0x27c74b){var _0x1b1a29=[_0x6195('0x50'),_0x6195('0x51'),'cm_contact_has_items.OrderBy',_0x6195('0x52'),_0x6195('0x53')];return squel['insert']()['into'](_0x6195('0x54'))['fromQuery']([_0x6195('0x55'),_0x6195('0x16'),'OrderBy','createdAt','updatedAt'],squel[_0x6195('0x14')]()[_0x6195('0x4c')](_0x1b1a29)[_0x6195('0x17')]('cm_hopper')[_0x6195('0x18')](_0x6195('0x41'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x6195('0x18')](_0x6195('0x56'),null,_0x6195('0x57'))[_0x6195('0x19')](_0x6195('0x58'),_0x27c74b)[_0x6195('0x19')](_0x6195('0x45'),NOW))[_0x6195('0x4a')]();}function insertCmContact(_0x5842c0,_0x15cbd8,_0x3344c0,_0x5623cd){var _0x11272f=_[_0x6195('0x59')](_['keys'](_0x5623cd),[_0x6195('0x3b'),_0x6195('0x5a'),'createdAt',_0x6195('0x3d')]);return squel[_0x6195('0x37')]()['into'](_0x6195('0x41'))[_0x6195('0x39')](_0x11272f,squel[_0x6195('0x14')]()[_0x6195('0x4c')](_0x11272f)[_0x6195('0x17')](_0x15cbd8)[_0x6195('0x19')]('('+_0x3344c0[_0x6195('0x18')](',')+_0x6195('0x5b'),squel[_0x6195('0x14')]()[_0x6195('0x4c')](_0x3344c0)['from']('cm_contacts')[_0x6195('0x19')](_0x6195('0x4e'),_0x5842c0))[_0x6195('0x19')](_0x6195('0x5c'),squel[_0x6195('0x14')]()[_0x6195('0x15')]('MIN(id)',_0x6195('0x5d'))[_0x6195('0x17')](_0x15cbd8)[_0x6195('0x5e')](_0x3344c0[_0x6195('0x18')](','))))['toString']();}function handleStop(){logger[_0x6195('0x5f')](_0x6195('0x60'));stopped=!![];}function handleUncaughtException(_0x365de1){logger[_0x6195('0x25')](_0x365de1[_0x6195('0x26')]);process['exit'](0x1);}function handleError(_0x5cc7fa,_0x40b606){stats[_0x6195('0x61')][_0x6195('0x22')]({'name':_0x40b606[_0x6195('0x62')],'message':_0x40b606[_0x6195('0x26')],'row':_0x5cc7fa});}function handleQuery(_0x1c61b9){logger[_0x6195('0x5f')](_0x1c61b9);return db[_0x6195('0x1c')][_0x6195('0x1d')](_0x1c61b9)[_0x6195('0x1f')](function(_0x440696){results['push'](_0x440696);})[_0x6195('0x24')](function(_0x24dc44){logger[_0x6195('0x25')](_0x24dc44[_0x6195('0x26')]);});}function main(_0x1ef3e4,_0x45a6c1,_0x17aece,_0x3437f6){logger[_0x6195('0x5f')](_0x6195('0x63'),_0x1ef3e4,JSON[_0x6195('0x64')](_0x45a6c1));process[_0x6195('0x65')](_0x6195('0x66'));var _0x265db2=_0x45a6c1[_0x6195('0x67')];var _0x5677fd=_[_0x6195('0x68')](_0x265db2);var _0x130076=_0x45a6c1[_0x6195('0x69')];var _0xdbb393=path[_0x6195('0x18')](config[_0x6195('0x6a')],_0x6195('0x6b'),_0x130076+'.csv');logger[_0x6195('0x5f')](_0x6195('0x6c'),_0x45a6c1);db[_0x6195('0x6d')][_0x6195('0x6e')]({'raw':!![],'attributes':['id',_0x6195('0x6f')]})[_0x6195('0x29')](function(_0x18d97f){for(var _0x38f75e=0x0;_0x38f75e<_0x18d97f['length'];_0x38f75e++){if(_0x18d97f[_0x38f75e]['name']in _0x265db2){contactItemTypes[_0x6195('0x22')](_0x18d97f[_0x38f75e]);delete _0x5677fd[_0x18d97f[_0x38f75e][_0x6195('0x6f')]];hasAdditionalPhones=!![];}for(var _0x46ad8f in _0x265db2){if(_0x18d97f[_0x38f75e][_0x6195('0x6f')]+_0x6195('0x70')===_0x46ad8f){phoneDescriptions[_0x6195('0x22')]({'itemTypeId':_0x18d97f[_0x38f75e]['id'],'description':_0x46ad8f});delete _0x5677fd[_0x46ad8f];}}}if(hasAdditionalPhones)_0x5677fd['AdditionalPhones']='';var _0x11754d=_[_0x6195('0x71')](_0x5677fd)[_0x6195('0x18')]();logger['info']('header',_0x11754d);fs[_0x6195('0x72')](_0xdbb393,_0x11754d+'\x0a');Papa[_0x6195('0x73')](fs[_0x6195('0x74')](_0x1ef3e4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ecfba,_0x1bc14a){try{for(var _0x2d7dfa=0x0,_0x2e2f06=[];_0x2d7dfa<_0x3ecfba[_0x6195('0x75')][_0x6195('0x28')];_0x2d7dfa++){stats[_0x6195('0x76')]+=0x1;if(_0x3ecfba['errors'][_0x2d7dfa]){handleError(_0x3ecfba[_0x6195('0x75')][_0x2d7dfa],_0x3ecfba[_0x6195('0x61')][_0x2d7dfa]);}else{var _0x31cb77=[];var _0x4cd3a7=[];var _0x1e7a78={};for(var _0x4c6e92 in _0x265db2){let _0x5ae1fa=contactItemTypes[_0x6195('0x77')](_0x33a36c=>_0x33a36c[_0x6195('0x6f')]===_0x4c6e92);let _0x2154d4=contactItemTypes[_0x6195('0x77')](_0xe55333=>_0xe55333[_0x6195('0x6f')]+'_description'===_0x4c6e92);if(_[_0x6195('0x20')](_0x5ae1fa)&&_[_0x6195('0x20')](_0x2154d4)){if(_0x265db2['hasOwnProperty'](_0x4c6e92)){if(_0x3ecfba[_0x6195('0x75')][_0x2d7dfa][_0x265db2[_0x4c6e92]]){var _0x1bccef=_[_0x6195('0x78')](_0x3ecfba[_0x6195('0x75')][_0x2d7dfa][_0x265db2[_0x4c6e92]]['replace'](/"/g,'\x27'));switch(_0x4c6e92){case _0x6195('0x79'):var _0x2e1b0a=moment(_0x1bccef,_0x6195('0x10'),!![]);if(_0x2e1b0a['isValid']()){_0x2e2f06[_0x6195('0x22')]('\x22'+_0x1bccef+'\x22');}else{_0x31cb77[_0x6195('0x22')](_0x6195('0x7a'));}break;case _0x6195('0x3e'):var _0xdac436=parseInt(_0x1bccef);_0x1bccef=_[_0x6195('0x7b')](_0xdac436)||_0xdac436<0x0||_0xdac436>0x4?_0x3437f6?0x3:0x2:_0xdac436;_0x2e2f06[_0x6195('0x22')]('\x22'+_0x1bccef+'\x22');break;case'UserId':var _0x2d68e2=parseInt(_0x1bccef);if(_[_0x6195('0x7c')](_0x2d68e2)&&_[_0x6195('0x7d')](_0x17aece,_0x2d68e2)){_0x2e2f06['push']('\x22'+_0x2d68e2+'\x22');}else{_0x31cb77[_0x6195('0x22')](_0x6195('0x7e'));}break;case'email':if(isEmail(_0x1bccef)){_0x2e2f06['push']('\x22'+_0x1bccef+'\x22');}else{_0x31cb77[_0x6195('0x22')](_0x6195('0x7f'));}break;case _0x6195('0x80'):var _0x559599=moment(_0x1bccef,_0x6195('0x81'),!![]);if(_0x559599[_0x6195('0x82')]()){_0x2e2f06['push']('\x22'+_0x1bccef+'\x22');}else{_0x31cb77['push'](_0x6195('0x83'));}break;default:_0x2e2f06['push']('\x22'+_0x1bccef+'\x22');}}else{switch(_0x4c6e92){case _0x6195('0x84'):case _0x6195('0x16'):_0x31cb77[_0x6195('0x22')](_0x4c6e92+_0x6195('0x85'));break;default:_0x2e2f06[_0x6195('0x22')]('\x22\x22');}}}}else{var _0x42774f='';if(!_[_0x6195('0x20')](_0x5ae1fa)){if(!_0x1e7a78[_0x6195('0x86')](_0x5ae1fa['id'])){for(var _0x1959ee=0x0;_0x1959ee<_0x265db2[_0x4c6e92][_0x6195('0x28')];_0x1959ee++){var _0x1bccef=_[_0x6195('0x78')](_0x3ecfba[_0x6195('0x75')][_0x2d7dfa][_0x265db2[_0x4c6e92][_0x1959ee]][_0x6195('0x87')](/"/g,'\x27'));var _0x3dd403=phoneDescriptions['find'](_0x4134ed=>_0x4134ed[_0x6195('0x88')]===_0x5ae1fa['id']);if(!_[_0x6195('0x20')](_0x3dd403)){var _0x195ba1=_[_0x6195('0x78')](_0x3ecfba[_0x6195('0x75')][_0x2d7dfa][_0x265db2[_0x3dd403[_0x6195('0x89')]][0x0]][_0x6195('0x87')](/"/g,'\x27'));if(!_['isNil'](_0x195ba1))_0x1bccef=_0x1bccef+'§'+_0x195ba1;}if(_0x42774f=='')_0x42774f=_0x1bccef;else _0x42774f+='|'+_0x1bccef;}_0x4cd3a7[_0x6195('0x22')](_0x5ae1fa['id']+':'+_0x42774f);_0x1e7a78[_0x5ae1fa['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2e2f06[_0x6195('0x22')]('\x22'+_0x4cd3a7['join'](';')+'\x22');}if(_0x31cb77[_0x6195('0x28')]){handleError(_0x3ecfba[_0x6195('0x75')][_0x2d7dfa],{'code':_0x6195('0x8a'),'message':_0x31cb77[_0x6195('0x18')]()});}else{fs[_0x6195('0x8b')](_0xdbb393,_0x2e2f06[_0x6195('0x18')]()+'\x0a');}_0x2e2f06=[];}if(!(stats['rows']%0xc8)){socket[_0x6195('0x8c')](_0x6195('0x8d')+_0x130076,stats);stats[_0x6195('0x61')]=[];}}if(stopped){logger[_0x6195('0x5f')](_0x6195('0x8e'));_0x1bc14a[_0x6195('0x8f')]();}}catch(_0x3be6f0){handleError(_0x3ecfba[_0x6195('0x75')][_0x2d7dfa],{'code':'SystemError','message':_0x3be6f0['message']});logger[_0x6195('0x25')](_0x6195('0x90'),_0x3be6f0['message']);}},'complete':function(){try{var _0x1d1a81=[];var _0x5f5329=tempTableName;_0x1d1a81[_0x6195('0x22')](_0x6195('0x91')+_0x5f5329+_0x6195('0x92'));logger[_0x6195('0x5f')](_0x6195('0x93'),contactItemTypes['length']);var _0x297380=util[_0x6195('0xf')](_0x6195('0x94'),_0xdbb393,_0x5f5329,_0x11754d,_0x45a6c1[_0x6195('0x3b')],_0x45a6c1['CompanyId']||null,NOW,NOW);if(_[_0x6195('0x20')](_0x265db2[_0x6195('0x79')])){_0x297380+=_0x6195('0x95');}_0x1d1a81[_0x6195('0x22')](_0x297380);BPromise[_0x6195('0x96')](_0x1d1a81,handleQuery)[_0x6195('0x29')](function(_0x285124){BPromise['all']([handleAdditionalPhones()])[_0x6195('0x29')](function(){_0x1d1a81=[];for(var _0x31bc12=0x0;_0x31bc12\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','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','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./utils','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd170,0x12d));var _0x0d17=function(_0xaf8f29,_0x5754cf){_0xaf8f29=_0xaf8f29-0x0;var _0x391fed=_0xd170[_0xaf8f29];return _0x391fed;};'use strict';var _=require(_0x0d17('0x0'));var squel=require(_0x0d17('0x1'));var as=require(_0x0d17('0x2'));var qs=require(_0x0d17('0x3'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require(_0x0d17('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x4ff91a,_0xa13d2,_0x214a71){var _0x8b6e0c=![];var _0x1f3b12=utils[_0x0d17('0x5')](_0x4ff91a);if(_0xa13d2[_0x0d17('0x6')]==='agent'&&!_0x214a71[_0x0d17('0x7')]&&!_0x214a71[_0x1f3b12]){_0x8b6e0c=!![];}return _0x8b6e0c;}function getTagsQuery(){return squel[_0x0d17('0x8')]()['field']('id')[_0x0d17('0x9')](_0x0d17('0xa'))[_0x0d17('0x9')](_0x0d17('0xb'))[_0x0d17('0xc')](_0x0d17('0xd'));}function getUsersQuery(_0x3c19a5,_0x3227fb){var _0x565d96=utils[_0x0d17('0xe')](_0x3c19a5);var _0x41d876=_0x0d17('0xf')+_0x3c19a5+_0x0d17('0x10');var _0x351758=squel[_0x0d17('0x8')]()['field']('u.id')['field'](_0x0d17('0x11'))['field']('ui.'+_0x565d96)[_0x0d17('0xc')](_0x41d876,'ui')[_0x0d17('0x12')](_0x0d17('0x13'),'u',_0x0d17('0x14'));if(_0x3227fb[_0x0d17('0x15')]>0x0){_0x351758[_0x0d17('0x16')](_0x0d17('0x17')+_0x565d96+_0x0d17('0x18'),_[_0x0d17('0x19')](_0x3227fb,'id'));}return _0x351758;}function getInteractionsQuery(_0x591380){var _0x523664=utils[_0x0d17('0x1a')](_0x591380);var _0x3ef5fc=utils['getAccountFK'](_0x591380);var _0x227461=utils[_0x0d17('0xe')](_0x591380);return squel[_0x0d17('0x8')]()[_0x0d17('0xc')](_0x523664[_0x0d17('0x1b')],'i')[_0x0d17('0x12')]('cm_contacts','c',_0x0d17('0x1c'))[_0x0d17('0x12')]('users','o',_0x0d17('0x1d'))[_0x0d17('0x12')](_0x523664[_0x0d17('0x1e')],'a',_0x0d17('0x1f')+_0x3ef5fc)[_0x0d17('0x12')](_0x523664[_0x0d17('0x20')],'me',_0x0d17('0x21')+_0x227461+_0x0d17('0x22'))[_0x0d17('0x12')](_0x523664[_0x0d17('0x23')],'it',_0x0d17('0x24')+_0x227461+_0x0d17('0x22'))[_0x0d17('0x12')](_0x0d17('0xd'),'t',_0x0d17('0x25'));}function getSqlClauses(){var _0xdf9650={'body':squel[_0x0d17('0x26')](),'contact':squel[_0x0d17('0x26')](),'default':squel[_0x0d17('0x26')](),'fields':squel['expr'](),'filter':squel[_0x0d17('0x26')](),'read':squel[_0x0d17('0x26')](),'tags':{'clause':squel[_0x0d17('0x26')](),'ids':null},'user':squel[_0x0d17('0x26')]()};return _0xdf9650;}function parseTagParameter(_0x420944){var _0x32996f=squel[_0x0d17('0x26')]();if(_0x420944){var _0x582ac2=utils['getSelectedTags'](_0x420944);_0x582ac2[_0x0d17('0x27')](function(_0x2e4810){_0x32996f['or'](_0x0d17('0x28'),'%,'+_0x2e4810+',%');});}return _0x32996f;}function parseReadParameter(_0x297c5c){var _0x3b2ca1='';if(_0x297c5c){_0x3b2ca1=_0x0d17('0x29');if(_0x297c5c==='1'){_0x3b2ca1=_0x3b2ca1[_0x0d17('0x2a')](_0x0d17('0x2b'),'=');}else{_0x3b2ca1=_0x3b2ca1[_0x0d17('0x2a')](_0x0d17('0x2b'),'>');}}return _0x3b2ca1;}function parseSearchFilter(_0x455397,_0x1f702c){var _0x539ad6=squel['expr']();if(_0x1f702c){var _0x1a1578=_0x1f702c['replace']('\x5c','\x5c\x5c')[_0x0d17('0x2a')](/'/g,'\x27\x27');if(qs[_0x0d17('0x2c')](_0x1a1578)){_0x539ad6['or']('i.id\x20LIKE\x20?',_0x1a1578+'%');if(['sms','whatsapp'][_0x0d17('0x2d')](_0x455397)){_0x539ad6['or'](_0x0d17('0x2e'),_0x1a1578+'%');}else if(_0x455397===_0x0d17('0x2f')){_0x539ad6['or'](_0x0d17('0x30'),_0x1a1578+'%');}else if(_0x455397===_0x0d17('0x31')){_0x539ad6['or'](_0x0d17('0x32'),_0x1a1578+'%');}}else if(_0x455397===_0x0d17('0x33')&&qs['isEmail'](_0x1a1578)){_0x539ad6['or'](_0x0d17('0x34'),_0x1a1578+'%');}else{if(_0x455397===_0x0d17('0x33')){_0x539ad6['or'](_0x0d17('0x35'),qs[_0x0d17('0x36')](_0x1a1578,!![]))['or'](_0x0d17('0x37'),qs['getFullTextValue'](_0x1a1578));}else if(_0x455397!==_0x0d17('0x2f')){_0x539ad6['or'](_0x0d17('0x38'),qs[_0x0d17('0x36')](_0x1a1578));}_0x539ad6['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0d17('0x36')](_0x1a1578,!![]),null);}}return _0x539ad6;}function parseAdvancedSearchFilter(_0x58fcbe,_0x471761){var _0x32485d=getSqlClauses();var _0x326cc5=as[_0x0d17('0x39')](_0x58fcbe);var _0x2ac11a=_0x326cc5['sqlOperator'];for(var _0x15d576=0x0;_0x15d576<_0x326cc5[_0x0d17('0x3a')][_0x0d17('0x15')];_0x15d576++){var _0x1bb395=_0x326cc5[_0x0d17('0x3a')][_0x15d576];var _0x208211='i';var _0x3254c2=_[_0x0d17('0x3b')](_0x471761,[_0x0d17('0xa'),_0x1bb395[_0x0d17('0x9')]]);if(_0x3254c2){var _0x441491=as['buildExpression'](_0x208211,_0x3254c2[_0x0d17('0x3c')],_0x1bb395);_0x32485d[_0x0d17('0x3d')][_0x2ac11a](_0x441491[_0x0d17('0x3e')],_0x441491[_0x0d17('0x3f')][_0x0d17('0x40')],_0x441491[_0x0d17('0x3f')][_0x0d17('0x41')]);}else{switch(_0x1bb395[_0x0d17('0x9')]){case'unreadMessages':var _0x280601=parseReadParameter(_0x1bb395['value']);_0x32485d['read'][_0x0d17('0x42')](_0x280601);break;case'Contact':if(_0x1bb395['operator']===_0x0d17('0x43')){if(_0x1bb395[_0x0d17('0x3f')][_0x0d17('0x44')]('\x20')['length']>0x1){_0x32485d[_0x0d17('0x45')][_0x2ac11a](_0x0d17('0x46'),qs['getFullTextValue'](_0x1bb395['value'],!![]),null);}else{var _0x54a3a8='%'+_0x1bb395[_0x0d17('0x3f')]+'%';_0x32485d['contact'][_0x2ac11a](_0x0d17('0x47'),_0x54a3a8,_0x54a3a8,_0x54a3a8);}}else{_0x3254c2=_[_0x0d17('0x3b')](_0x471761,[_0x0d17('0xa'),_0x0d17('0x48')]);_0x1bb395['field']='ContactId';_0x441491=as[_0x0d17('0x49')](_0x208211,_0x3254c2['type'],_0x1bb395);_0x32485d[_0x0d17('0x45')][_0x2ac11a](_0x441491[_0x0d17('0x3e')],_0x441491[_0x0d17('0x3f')][_0x0d17('0x40')],_0x441491['value']['end']);}break;case _0x0d17('0x4a'):var _0x2248e7=_0x1bb395[_0x0d17('0x3f')][_0x0d17('0x44')](',')['map'](function(_0x107eb8){return Number(_0x107eb8);});var _0x45145a=parseTagParameter(_0x2248e7);_0x32485d[_0x0d17('0x4b')][_0x0d17('0x4c')][_0x0d17('0x42')](_0x45145a);_0x32485d['tags'][_0x0d17('0x4d')]=_0x2248e7;break;case _0x0d17('0x4e'):if(_0x1bb395[_0x0d17('0x4f')]===_0x0d17('0x43')){_0x32485d[_0x0d17('0x50')][_0x2ac11a](_0x0d17('0x51'),'%'+_0x1bb395[_0x0d17('0x3f')]+'%',null);}else{_0x3254c2=_[_0x0d17('0x3b')](_0x471761,[_0x0d17('0xa'),_0x0d17('0x52')]);_0x1bb395['field']=_0x0d17('0x52');_0x441491=as['buildExpression'](_0x208211,_0x3254c2[_0x0d17('0x3c')],_0x1bb395);_0x32485d['user'][_0x2ac11a](_0x441491[_0x0d17('0x3e')],_0x441491['value'][_0x0d17('0x40')],_0x441491[_0x0d17('0x3f')]['end']);}break;case _0x0d17('0x53'):case'plainBody':_0x441491=as[_0x0d17('0x49')]('me',null,_0x1bb395);_0x32485d['body'][_0x2ac11a](_0x441491['text'],_0x441491['value'][_0x0d17('0x40')],_0x441491[_0x0d17('0x3f')][_0x0d17('0x41')]);break;}}}return _0x32485d;}function parseModelFields(_0x157767,_0x52129f,_0x2ffb14){var _0x63e75d=utils[_0x0d17('0x5')](_0x157767);var _0xd3ad2b=squel[_0x0d17('0x26')]();var _0x1e597a=_(_0x52129f)[_0x0d17('0x54')]()[_0x0d17('0x19')](function(_0xec0531){return _[_0x0d17('0x55')](_0x2ffb14,['name',_0xec0531])?_0xec0531:undefined;})[_0x0d17('0x56')]()[_0x0d17('0x3f')]();if(_0x1e597a[_0x0d17('0x15')]>0x0){_0x1e597a[_0x0d17('0x27')](function(_0x5050a3){if(_0x5050a3===_0x63e75d){_0xd3ad2b['and']('i.'+_0x63e75d+_0x0d17('0x18'),[][_0x0d17('0x57')](_0x52129f[_0x5050a3]));}else if(_0x5050a3===_0x0d17('0x58')){var _0x2eb8b0=JSON[_0x0d17('0x59')](_0x52129f[_0x5050a3])['$gte'];var _0x141586=JSON[_0x0d17('0x59')](_0x52129f[_0x5050a3])[_0x0d17('0x5a')];_0xd3ad2b[_0x0d17('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2eb8b0,_0x141586);}else{if(_0x52129f[_0x5050a3]===_0x0d17('0x5b')){_0xd3ad2b[_0x0d17('0x42')]('i.'+_0x5050a3+_0x0d17('0x5c'));}else{_0xd3ad2b[_0x0d17('0x42')]('i.'+_0x5050a3+'\x20=\x20?',_0x52129f[_0x5050a3]);}}});}return _0xd3ad2b;}function parseQueryParameters(_0x17515e,_0x24838f,_0x4466b3){var _0x1064bf=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x17515e,_0x24838f,_0x4466b3);})[_0x0d17('0x5d')](function(_0x3e9dfc){_0x1064bf['fields'][_0x0d17('0x42')](_0x3e9dfc);return parseReadParameter(_0x24838f[_0x0d17('0x5e')]);})[_0x0d17('0x5d')](function(_0xd1baad){_0x1064bf[_0x0d17('0x5e')][_0x0d17('0x42')](_0xd1baad);return parseTagParameter(_0x24838f[_0x0d17('0x5f')]);})['then'](function(_0x30f4e2){_0x1064bf['tags'][_0x0d17('0x4c')][_0x0d17('0x42')](_0x30f4e2);return parseSearchFilter(_0x17515e,_0x24838f[_0x0d17('0x60')]);})[_0x0d17('0x5d')](function(_0x2c0c5a){_0x1064bf[_0x0d17('0x60')]=_0x2c0c5a;return _0x1064bf;});}function checkAccountsRestrictions(_0x51b361,_0x295ea1,_0x3b2fc7){var _0x2c06c6=utils[_0x0d17('0x5')](_0x51b361);var _0x212652=_0x0d17('0x61')+_[_0x0d17('0x62')](_0x51b361)+(_0x51b361==='chat'?_0x0d17('0x63'):_0x0d17('0x64'));var _0x285829=squel['expr']();return Promise[_0x0d17('0x65')]()[_0x0d17('0x5d')](function(){if(_0x3b2fc7['search']&&_0x295ea1[_0x0d17('0x6')]===_0x0d17('0x66')){return _0x295ea1[_0x212652]({'attributes':['id'],'raw':!![]});}})[_0x0d17('0x5d')](function(_0x31b83e){if(_0x31b83e){if(_0x31b83e[_0x0d17('0x15')]===0x0){_0x285829['and']('i.'+_0x2c06c6+'\x20IS\x20NULL');}else{_0x285829[_0x0d17('0x42')]('i.'+_0x2c06c6+_0x0d17('0x18'),_[_0x0d17('0x19')](_0x31b83e,'id'));}}else if(!_0x3b2fc7[_0x2c06c6]){_0x285829['and']('i.'+_0x2c06c6+_0x0d17('0x67'));}})['then'](function(){return _0x285829;});}function getClosedOrderClause(_0x46f75f,_0x14a6e9){var _0x3b7dbb='';var _0x29a7c6=[_0x0d17('0x68'),_0x0d17('0x69'),'i.disposition'];if(_0x46f75f===_0x0d17('0x33')){_0x29a7c6[_0x0d17('0x6a')](_0x0d17('0x6b'));}if(_0x14a6e9[_0x0d17('0x6c')]==='0'&&_0x46f75f==='mail'){_0x3b7dbb=_0x0d17('0x6b');}else{if(_0x14a6e9[_0x0d17('0x6c')]==='1'){_0x29a7c6[_0x0d17('0x6d')]();}_0x3b7dbb='CONCAT_WS(\x27\x27,\x20'+_0x29a7c6[_0x0d17('0x6e')](',\x20')+')';}return _0x3b7dbb;}function getFilteredInteractions(_0x1c4cb1,_0x290355,_0x21c8c6,_0x52ae31){var _0x3806d6=utils[_0x0d17('0xe')](_0x1c4cb1);var _0x3e59ee=_['capitalize'](_0x1c4cb1)+'Interaction';var _0x70fd51=[];var _0x43a500=getTagsQuery();var _0x43b5e1={'type':db[_0x0d17('0x6f')][_0x0d17('0x70')][_0x0d17('0x71')],'raw':!![]};var _0x770dbe=[];var _0x5dad97=[];return db[_0x0d17('0x72')]['query'](_0x43a500[_0x0d17('0x73')](),_0x43b5e1)[_0x0d17('0x5d')](function(_0xf0cae0){_0x70fd51=_[_0x0d17('0x74')](_0xf0cae0,'id');_0x43b5e1=_['merge'](_0x43b5e1,{'model':db[_0x3e59ee],'mapToModel':!![],'nest':!![]});if(_0x21c8c6[_0x0d17('0x75')]){_0x52ae31[_0x0d17('0x76')][_0x0d17('0x27')](function(_0x119b7e){_0x290355[_0x0d17('0x9')]('i.'+_0x119b7e);});}else{_0x290355[_0x0d17('0x9')](_0x0d17('0x77'),_0x0d17('0x78'));_0x290355[_0x0d17('0x9')]('a.key',_0x0d17('0x79'));_0x290355[_0x0d17('0x9')](_0x0d17('0x7a'),_0x0d17('0x7b'));if(_0x1c4cb1===_0x0d17('0x33')){_0x290355['field']('a.email',_0x0d17('0x7c'));_0x290355[_0x0d17('0x9')]('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');_0x290355['field'](_0x0d17('0x7d'));_0x290355[_0x0d17('0x9')](_0x0d17('0x7e'));_0x290355[_0x0d17('0x9')]('i.updatedAt');_0x290355[_0x0d17('0x9')](_0x0d17('0x7f'));_0x290355[_0x0d17('0x9')](_0x0d17('0x80'));_0x290355[_0x0d17('0x9')](_0x0d17('0x81'));_0x290355[_0x0d17('0x9')](_0x0d17('0x82'));_0x290355[_0x0d17('0x9')](_0x0d17('0x83'));_0x290355[_0x0d17('0x9')](_0x0d17('0x84'));_0x290355[_0x0d17('0x9')](_0x0d17('0x85'));_0x290355['field'](_0x0d17('0x69'));_0x290355['field'](_0x0d17('0x68'));_0x290355[_0x0d17('0x9')](_0x0d17('0x6b'));_0x290355['field']('i.to');_0x290355[_0x0d17('0x9')](_0x0d17('0x86'));_0x290355[_0x0d17('0x9')](_0x0d17('0x87'));_0x290355[_0x0d17('0x9')](_0x0d17('0x88'));}else if(_0x1c4cb1===_0x0d17('0x31')){_0x290355['field'](_0x0d17('0x89'),_0x0d17('0x8a'));}else{_0x290355[_0x0d17('0x9')](_0x0d17('0x8b'),_0x0d17('0x8a'));}if(_0x1c4cb1!==_0x0d17('0x33')){_0x290355[_0x0d17('0x9')](_0x0d17('0x8c'));}_0x290355[_0x0d17('0x9')](_0x0d17('0x8d'),_0x0d17('0x8e'));_0x290355[_0x0d17('0x9')](_0x0d17('0x8f'),_0x0d17('0x90'));_0x290355[_0x0d17('0x9')](_0x0d17('0x91'),_0x0d17('0x92'));_0x290355['field']('c.phone',_0x0d17('0x93'));_0x290355['field'](_0x0d17('0x94'),'Contact.mobile');_0x290355[_0x0d17('0x9')](_0x0d17('0x95'),'Contact.fax');_0x290355['field'](_0x0d17('0x96'),_0x0d17('0x97'));_0x290355[_0x0d17('0x9')](_0x0d17('0x98'),_0x0d17('0x99'));_0x290355[_0x0d17('0x9')](_0x0d17('0x9a'),_0x0d17('0x9b'));}if(_0x52ae31[_0x0d17('0x9c')]){_0x290355[_0x0d17('0x9c')](_0x52ae31[_0x0d17('0x9c')]);}if(_0x52ae31[_0x0d17('0x9d')]){_0x290355[_0x0d17('0x9d')](_0x52ae31[_0x0d17('0x9d')]);}return db['sequelize'][_0x0d17('0x9e')](_0x290355[_0x0d17('0x73')](),_0x43b5e1);})['then'](function(_0x340974){_0x770dbe=_0x340974;var _0x3ed7b8=getUsersQuery(_0x1c4cb1,_0x770dbe);return db[_0x0d17('0x72')]['query'](_0x3ed7b8[_0x0d17('0x73')](),_0x43b5e1);})['then'](function(_0x2faf0d){_0x5dad97=_[_0x0d17('0x9f')](_0x2faf0d,_0x3806d6);if(_0x1c4cb1==='mail'){return db[_0x0d17('0xa0')][_0x0d17('0xa1')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x0d17('0x5d')](function(_0x1bbf1d){var _0x537203=_0x1bbf1d?_0x1bbf1d[_0x0d17('0xa2')]:undefined;var _0xc9d86=_0x770dbe['map'](function(_0xeb7905){return updateInteraction(_0xeb7905,_0x70fd51,_0x5dad97,_0x537203);});return Promise[_0x0d17('0xa3')](_0xc9d86);});}function countFilteredInteractions(_0xd9659e,_0x4cbb09){var _0x5f41d3=_0xd9659e[_0x0d17('0xa4')]();_0x5f41d3['field'](_0x0d17('0xa5'));_0x5f41d3['field'](_0x0d17('0x77'),_0x0d17('0x78'));var _0x3d8c76=utils[_0x0d17('0xa6')](_0x4cbb09);if(!_[_0x0d17('0xa7')](_0x3d8c76)){_0x5f41d3['where']('t.id\x20IN\x20?',_0x3d8c76);}var _0xb50783={'type':db[_0x0d17('0x6f')][_0x0d17('0x70')]['SELECT'],'raw':!![]};return db['sequelize']['query'](_0x5f41d3['toString'](),_0xb50783);}module[_0x0d17('0xa8')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x8932=['UserId','body','plainBody','text','getAccountFK','keys','some','compact','concat','createdAt','parse','$lte','null','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','i.thirdDisposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','query','keyBy','attributes','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','limit','offset','sequelize','toString','groupBy','findOne','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','../parsers/advancedSearch','./update-interaction','./utils','../../mysqldb','role','agent','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','select','interactions','cm_contacts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','expr','getSelectedTags','forEach','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','length','buildExpression','type','default','value','start','end','unreadMessages','read','and','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','tags','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x5db96a,_0x60039){var _0x13fdb0=function(_0x1efab0){while(--_0x1efab0){_0x5db96a['push'](_0x5db96a['shift']());}};_0x13fdb0(++_0x60039);}(_0x8932,0x1a4));var _0x2893=function(_0x4b1a32,_0x2c3e0b){_0x4b1a32=_0x4b1a32-0x0;var _0x1ee2d9=_0x8932[_0x4b1a32];return _0x1ee2d9;};'use strict';var _=require(_0x2893('0x0'));var squel=require('squel');var as=require(_0x2893('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x2893('0x2'))['updateInteraction'];var utils=require(_0x2893('0x3'));var db=require(_0x2893('0x4'))['db'];function skipInteractionsQuery(_0xd56c48,_0x247309,_0xddcc8a){var _0x3a7b9b=![];var _0x3839bd=utils['getAccountFK'](_0xd56c48);if(_0x247309[_0x2893('0x5')]===_0x2893('0x6')&&!_0xddcc8a[_0x2893('0x7')]&&!_0xddcc8a[_0x3839bd]){_0x3a7b9b=!![];}return _0x3a7b9b;}function getTagsQuery(){return squel['select']()[_0x2893('0x8')]('id')['field'](_0x2893('0x9'))[_0x2893('0x8')](_0x2893('0xa'))[_0x2893('0xb')](_0x2893('0xc'));}function getUsersQuery(_0x6f94b9,_0x343f22){var _0x32a4db=utils[_0x2893('0xd')](_0x6f94b9);var _0x5d3ace=_0x2893('0xe')+_0x6f94b9+_0x2893('0xf');var _0x1e67ae=squel['select']()[_0x2893('0x8')](_0x2893('0x10'))['field'](_0x2893('0x11'))['field'](_0x2893('0x12')+_0x32a4db)[_0x2893('0xb')](_0x5d3ace,'ui')[_0x2893('0x13')](_0x2893('0x14'),'u',_0x2893('0x15'));if(_0x343f22['length']>0x0){_0x1e67ae[_0x2893('0x16')](_0x2893('0x12')+_0x32a4db+_0x2893('0x17'),_[_0x2893('0x18')](_0x343f22,'id'));}return _0x1e67ae;}function getInteractionsQuery(_0xc97603){var _0x220b86=utils[_0x2893('0x19')](_0xc97603);var _0x439f29=utils['getAccountFK'](_0xc97603);var _0x463545=utils['getInteractionFK'](_0xc97603);return squel[_0x2893('0x1a')]()[_0x2893('0xb')](_0x220b86[_0x2893('0x1b')],'i')[_0x2893('0x13')](_0x2893('0x1c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2893('0x13')]('users','o','o.id\x20=\x20i.UserId')[_0x2893('0x13')](_0x220b86['accounts'],'a',_0x2893('0x1d')+_0x439f29)['left_join'](_0x220b86[_0x2893('0x1e')],'me',_0x2893('0x1f')+_0x463545+_0x2893('0x20'))[_0x2893('0x13')](_0x220b86[_0x2893('0x21')],'it','it.'+_0x463545+_0x2893('0x20'))[_0x2893('0x13')](_0x2893('0xc'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x217065={'body':squel[_0x2893('0x22')](),'contact':squel[_0x2893('0x22')](),'default':squel[_0x2893('0x22')](),'fields':squel[_0x2893('0x22')](),'filter':squel[_0x2893('0x22')](),'read':squel[_0x2893('0x22')](),'tags':{'clause':squel[_0x2893('0x22')](),'ids':null},'user':squel[_0x2893('0x22')]()};return _0x217065;}function parseTagParameter(_0x268ec1){var _0x2f7e8f=squel['expr']();if(_0x268ec1){var _0x4d1224=utils[_0x2893('0x23')](_0x268ec1);_0x4d1224[_0x2893('0x24')](function(_0x287df2){_0x2f7e8f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x287df2+',%');});}return _0x2f7e8f;}function parseReadParameter(_0x2a837c){var _0x561604='';if(_0x2a837c){_0x561604='unreadMessages\x20{OPERATOR}\x200';if(_0x2a837c==='1'){_0x561604=_0x561604[_0x2893('0x25')](_0x2893('0x26'),'=');}else{_0x561604=_0x561604[_0x2893('0x25')]('{OPERATOR}','>');}}return _0x561604;}function parseSearchFilter(_0x5c191c,_0x50963e){var _0x62d5bd=squel['expr']();if(_0x50963e){var _0x1bd79f=_0x50963e['replace']('\x5c','\x5c\x5c')[_0x2893('0x25')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1bd79f)){_0x62d5bd['or'](_0x2893('0x27'),_0x1bd79f+'%');if([_0x2893('0x28'),_0x2893('0x29')]['includes'](_0x5c191c)){_0x62d5bd['or'](_0x2893('0x2a'),_0x1bd79f+'%');}else if(_0x5c191c===_0x2893('0x2b')){_0x62d5bd['or'](_0x2893('0x2c'),_0x1bd79f+'%');}else if(_0x5c191c==='openchannel'){_0x62d5bd['or'](_0x2893('0x2d'),_0x1bd79f+'%');}}else if(_0x5c191c===_0x2893('0x2e')&&qs[_0x2893('0x2f')](_0x1bd79f)){_0x62d5bd['or'](_0x2893('0x30'),_0x1bd79f+'%');}else{if(_0x5c191c===_0x2893('0x2e')){_0x62d5bd['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2893('0x31')](_0x1bd79f,!![]))['or'](_0x2893('0x32'),qs['getFullTextValue'](_0x1bd79f));}else if(_0x5c191c!==_0x2893('0x2b')){_0x62d5bd['or'](_0x2893('0x33'),qs['getFullTextValue'](_0x1bd79f));}_0x62d5bd['or'](_0x2893('0x34'),qs['getFullTextValue'](_0x1bd79f,!![]),null);}}return _0x62d5bd;}function parseAdvancedSearchFilter(_0x51bfe5,_0x46bf80){var _0x128a98=getSqlClauses();var _0x4bb469=as['parseSearch'](_0x51bfe5);var _0x521c1a=_0x4bb469[_0x2893('0x35')];for(var _0x5a1689=0x0;_0x5a1689<_0x4bb469[_0x2893('0x36')][_0x2893('0x37')];_0x5a1689++){var _0x145c59=_0x4bb469[_0x2893('0x36')][_0x5a1689];var _0x540253='i';var _0x304d25=_['find'](_0x46bf80,['name',_0x145c59[_0x2893('0x8')]]);if(_0x304d25){var _0x31a252=as[_0x2893('0x38')](_0x540253,_0x304d25[_0x2893('0x39')],_0x145c59);_0x128a98[_0x2893('0x3a')][_0x521c1a](_0x31a252['text'],_0x31a252[_0x2893('0x3b')][_0x2893('0x3c')],_0x31a252['value'][_0x2893('0x3d')]);}else{switch(_0x145c59[_0x2893('0x8')]){case _0x2893('0x3e'):var _0x2411df=parseReadParameter(_0x145c59[_0x2893('0x3b')]);_0x128a98[_0x2893('0x3f')][_0x2893('0x40')](_0x2411df);break;case'Contact':if(_0x145c59[_0x2893('0x41')]===_0x2893('0x42')){if(_0x145c59[_0x2893('0x3b')][_0x2893('0x43')]('\x20')[_0x2893('0x37')]>0x1){_0x128a98['contact'][_0x521c1a](_0x2893('0x34'),qs[_0x2893('0x31')](_0x145c59['value'],!![]),null);}else{var _0x937e89='%'+_0x145c59[_0x2893('0x3b')]+'%';_0x128a98[_0x2893('0x44')][_0x521c1a](_0x2893('0x45'),_0x937e89,_0x937e89,_0x937e89);}}else{_0x304d25=_[_0x2893('0x46')](_0x46bf80,['name',_0x2893('0x47')]);_0x145c59[_0x2893('0x8')]='ContactId';_0x31a252=as[_0x2893('0x38')](_0x540253,_0x304d25[_0x2893('0x39')],_0x145c59);_0x128a98[_0x2893('0x44')][_0x521c1a](_0x31a252['text'],_0x31a252[_0x2893('0x3b')][_0x2893('0x3c')],_0x31a252[_0x2893('0x3b')][_0x2893('0x3d')]);}break;case _0x2893('0x48'):var _0x5518d3=_0x145c59['value'][_0x2893('0x43')](',')[_0x2893('0x18')](function(_0x2d00d9){return Number(_0x2d00d9);});var _0x9fab81=parseTagParameter(_0x5518d3);_0x128a98['tags']['clause'][_0x2893('0x40')](_0x9fab81);_0x128a98[_0x2893('0x49')][_0x2893('0x4a')]=_0x5518d3;break;case _0x2893('0x4b'):if(_0x145c59['operator']==='$substring'){_0x128a98[_0x2893('0x4c')][_0x521c1a](_0x2893('0x4d'),'%'+_0x145c59[_0x2893('0x3b')]+'%',null);}else{_0x304d25=_[_0x2893('0x46')](_0x46bf80,[_0x2893('0x9'),_0x2893('0x4e')]);_0x145c59[_0x2893('0x8')]='UserId';_0x31a252=as[_0x2893('0x38')](_0x540253,_0x304d25[_0x2893('0x39')],_0x145c59);_0x128a98[_0x2893('0x4c')][_0x521c1a](_0x31a252['text'],_0x31a252[_0x2893('0x3b')][_0x2893('0x3c')],_0x31a252[_0x2893('0x3b')][_0x2893('0x3d')]);}break;case _0x2893('0x4f'):case _0x2893('0x50'):_0x31a252=as[_0x2893('0x38')]('me',null,_0x145c59);_0x128a98[_0x2893('0x4f')][_0x521c1a](_0x31a252[_0x2893('0x51')],_0x31a252[_0x2893('0x3b')][_0x2893('0x3c')],_0x31a252[_0x2893('0x3b')]['end']);break;}}}return _0x128a98;}function parseModelFields(_0x57183a,_0x156333,_0x5e3378){var _0x32cb2a=utils[_0x2893('0x52')](_0x57183a);var _0x50f784=squel['expr']();var _0x24332b=_(_0x156333)[_0x2893('0x53')]()[_0x2893('0x18')](function(_0x95096e){return _[_0x2893('0x54')](_0x5e3378,[_0x2893('0x9'),_0x95096e])?_0x95096e:undefined;})[_0x2893('0x55')]()[_0x2893('0x3b')]();if(_0x24332b['length']>0x0){_0x24332b[_0x2893('0x24')](function(_0x287263){if(_0x287263===_0x32cb2a){_0x50f784[_0x2893('0x40')]('i.'+_0x32cb2a+_0x2893('0x17'),[][_0x2893('0x56')](_0x156333[_0x287263]));}else if(_0x287263===_0x2893('0x57')){var _0x504002=JSON[_0x2893('0x58')](_0x156333[_0x287263])['$gte'];var _0x4f164c=JSON['parse'](_0x156333[_0x287263])[_0x2893('0x59')];_0x50f784[_0x2893('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x504002,_0x4f164c);}else{if(_0x156333[_0x287263]===_0x2893('0x5a')){_0x50f784[_0x2893('0x40')]('i.'+_0x287263+'\x20IS\x20NULL');}else{_0x50f784[_0x2893('0x40')]('i.'+_0x287263+_0x2893('0x5b'),_0x156333[_0x287263]);}}});}return _0x50f784;}function parseQueryParameters(_0x1710b3,_0x5d0e71,_0x2e542c){var _0x600265=getSqlClauses();return Promise[_0x2893('0x5c')]()[_0x2893('0x5d')](function(){return parseModelFields(_0x1710b3,_0x5d0e71,_0x2e542c);})[_0x2893('0x5d')](function(_0x46e0e9){_0x600265[_0x2893('0x5e')][_0x2893('0x40')](_0x46e0e9);return parseReadParameter(_0x5d0e71[_0x2893('0x3f')]);})[_0x2893('0x5d')](function(_0x1f3b45){_0x600265[_0x2893('0x3f')]['and'](_0x1f3b45);return parseTagParameter(_0x5d0e71[_0x2893('0x5f')]);})[_0x2893('0x5d')](function(_0x172152){_0x600265[_0x2893('0x49')]['clause']['and'](_0x172152);return parseSearchFilter(_0x1710b3,_0x5d0e71['filter']);})['then'](function(_0x2e4981){_0x600265[_0x2893('0x60')]=_0x2e4981;return _0x600265;});}function checkAccountsRestrictions(_0x3aa194,_0x1624a7,_0x8e7d84){var _0x3441f7=utils[_0x2893('0x52')](_0x3aa194);var _0x243e26=_0x2893('0x61')+_[_0x2893('0x62')](_0x3aa194)+(_0x3aa194===_0x2893('0x63')?_0x2893('0x64'):_0x2893('0x65'));var _0x26f72b=squel[_0x2893('0x22')]();return Promise[_0x2893('0x5c')]()[_0x2893('0x5d')](function(){if(_0x8e7d84['search']&&_0x1624a7['role']===_0x2893('0x6')){return _0x1624a7[_0x243e26]({'attributes':['id'],'raw':!![]});}})[_0x2893('0x5d')](function(_0x493139){if(_0x493139){if(_0x493139[_0x2893('0x37')]===0x0){_0x26f72b[_0x2893('0x40')]('i.'+_0x3441f7+_0x2893('0x66'));}else{_0x26f72b['and']('i.'+_0x3441f7+_0x2893('0x17'),_[_0x2893('0x18')](_0x493139,'id'));}}else if(!_0x8e7d84[_0x3441f7]){_0x26f72b['and']('i.'+_0x3441f7+'\x20IS\x20NOT\x20NULL');}})[_0x2893('0x5d')](function(){return _0x26f72b;});}function getClosedOrderClause(_0x3c805b,_0x79fea1){var _0x3c14ff='';var _0x2a3b66=[_0x2893('0x67'),'i.secondDisposition','i.disposition'];if(_0x3c805b==='mail'){_0x2a3b66['unshift'](_0x2893('0x68'));}if(_0x79fea1[_0x2893('0x69')]==='0'&&_0x3c805b===_0x2893('0x2e')){_0x3c14ff=_0x2893('0x68');}else{if(_0x79fea1[_0x2893('0x69')]==='1'){_0x2a3b66[_0x2893('0x6a')]();}_0x3c14ff=_0x2893('0x6b')+_0x2a3b66[_0x2893('0x6c')](',\x20')+')';}return _0x3c14ff;}function getFilteredInteractions(_0x33d042,_0x1a98e3,_0x6e9c92,_0x4d6a50){var _0x27b755=utils['getInteractionFK'](_0x33d042);var _0x380400=_[_0x2893('0x62')](_0x33d042)+_0x2893('0x6d');var _0x5e2b6a=[];var _0x5dbe40=getTagsQuery();var _0x299a0e={'type':db[_0x2893('0x6e')][_0x2893('0x6f')]['SELECT'],'raw':!![]};var _0x5eb336=[];var _0x3894ac=[];return db['sequelize'][_0x2893('0x70')](_0x5dbe40['toString'](),_0x299a0e)[_0x2893('0x5d')](function(_0x554be7){_0x5e2b6a=_[_0x2893('0x71')](_0x554be7,'id');_0x299a0e=_['merge'](_0x299a0e,{'model':db[_0x380400],'mapToModel':!![],'nest':!![]});if(_0x6e9c92[_0x2893('0x5e')]){_0x4d6a50[_0x2893('0x72')][_0x2893('0x24')](function(_0x355c1d){_0x1a98e3['field']('i.'+_0x355c1d);});}else{_0x1a98e3['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1a98e3[_0x2893('0x8')](_0x2893('0x73'),_0x2893('0x74'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x75'),_0x2893('0x76'));if(_0x33d042==='mail'){_0x1a98e3[_0x2893('0x8')](_0x2893('0x77'),_0x2893('0x78'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x79'),_0x2893('0x7a'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x7b'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x7c'));_0x1a98e3['field'](_0x2893('0x7d'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x7e'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x7f'));_0x1a98e3['field'](_0x2893('0x80'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x81'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x82'));_0x1a98e3['field'](_0x2893('0x83'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x84'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x85'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x67'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x68'));_0x1a98e3['field'](_0x2893('0x86'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x87'));_0x1a98e3[_0x2893('0x8')]('i.MailAccountId');_0x1a98e3[_0x2893('0x8')]('i.UserId');}else if(_0x33d042===_0x2893('0x88')){_0x1a98e3[_0x2893('0x8')](_0x2893('0x89'),_0x2893('0x7a'));}else{_0x1a98e3[_0x2893('0x8')](_0x2893('0x8a'),_0x2893('0x7a'));}if(_0x33d042!==_0x2893('0x2e')){_0x1a98e3[_0x2893('0x8')](_0x2893('0x8b'));}_0x1a98e3[_0x2893('0x8')](_0x2893('0x8c'),'Contact.firstName');_0x1a98e3[_0x2893('0x8')](_0x2893('0x8d'),_0x2893('0x8e'));_0x1a98e3['field'](_0x2893('0x8f'),_0x2893('0x90'));_0x1a98e3[_0x2893('0x8')]('c.phone',_0x2893('0x91'));_0x1a98e3['field'](_0x2893('0x92'),_0x2893('0x93'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x94'),_0x2893('0x95'));_0x1a98e3[_0x2893('0x8')](_0x2893('0x96'),_0x2893('0x97'));_0x1a98e3['field']('o.internal','Owner.internal');_0x1a98e3[_0x2893('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4d6a50[_0x2893('0x98')]){_0x1a98e3[_0x2893('0x98')](_0x4d6a50[_0x2893('0x98')]);}if(_0x4d6a50['offset']){_0x1a98e3[_0x2893('0x99')](_0x4d6a50['offset']);}return db[_0x2893('0x9a')][_0x2893('0x70')](_0x1a98e3[_0x2893('0x9b')](),_0x299a0e);})[_0x2893('0x5d')](function(_0x54cc9d){_0x5eb336=_0x54cc9d;var _0x2fa8f4=getUsersQuery(_0x33d042,_0x5eb336);return db[_0x2893('0x9a')][_0x2893('0x70')](_0x2fa8f4[_0x2893('0x9b')](),_0x299a0e);})['then'](function(_0x132cdd){_0x3894ac=_[_0x2893('0x9c')](_0x132cdd,_0x27b755);if(_0x33d042==='mail'){return db['Setting'][_0x2893('0x9d')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x2893('0x5d')](function(_0xe8e63a){var _0x208e42=_0xe8e63a?_0xe8e63a[_0x2893('0x9e')]:undefined;var _0x4b5f52=_0x5eb336[_0x2893('0x18')](function(_0x4756b3){return updateInteraction(_0x4756b3,_0x5e2b6a,_0x3894ac,_0x208e42);});return Promise[_0x2893('0x9f')](_0x4b5f52);});}function countFilteredInteractions(_0x53d929,_0x261918){var _0x36d087=_0x53d929[_0x2893('0xa0')]();_0x36d087['field']('COUNT(*)');_0x36d087['field'](_0x2893('0xa1'),_0x2893('0x3e'));var _0x306b13=utils[_0x2893('0x23')](_0x261918);if(!_[_0x2893('0xa2')](_0x306b13)){_0x36d087[_0x2893('0x16')](_0x2893('0xa3'),_0x306b13);}var _0x155553={'type':db['Sequelize']['QueryTypes'][_0x2893('0xa4')],'raw':!![]};return db[_0x2893('0x9a')][_0x2893('0x70')](_0x36d087[_0x2893('0x9b')](),_0x155553);}module[_0x2893('0xa5')]={'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 971715d..2e4e4b1 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 _0x3354=['unmanaged','abandoned','total','answered','UserId','MailMessage','findOne','-id','then','plainBody','lastMsgText','trimStart','catch','updateInteraction','Tags','lodash','../../mysqldb','fullname','split','forEach','push','waiting','talking'];(function(_0x4e82bb,_0x4c39d5){var _0x1b5ac5=function(_0x578c77){while(--_0x578c77){_0x4e82bb['push'](_0x4e82bb['shift']());}};_0x1b5ac5(++_0x4c39d5);}(_0x3354,0xf5));var _0x4335=function(_0x347b9f,_0x107a47){_0x347b9f=_0x347b9f-0x0;var _0x43ef26=_0x3354[_0x347b9f];return _0x43ef26;};'use strict';var _=require(_0x4335('0x0'));var db=require(_0x4335('0x1'))['db'];function getInteractionUsers(_0x56668c,_0x18db16){return new Promise(function(_0x4a83ce,_0xf3a5f4){try{var _0x1969e8=[];if(_0x18db16[_0x56668c]){_0x1969e8=_0x18db16[_0x56668c]['map'](function(_0x4f4ecf){return{'id':_0x4f4ecf['id'],'fullname':_0x4f4ecf[_0x4335('0x2')]};});}return _0x4a83ce(_0x1969e8);}catch(_0x31bbd6){_0xf3a5f4(_0x31bbd6);}});}function getInteractionTags(_0x5b3c51,_0x1a5510){var _0x427a01=[];if(_0x5b3c51){_0x5b3c51[_0x4335('0x3')](',')[_0x4335('0x4')](function(_0x6ee991){_0x427a01[_0x4335('0x5')](_0x1a5510[_0x6ee991]);});}return _0x427a01;}function updateWaitingCounter(_0xb5b1e9){if(_0xb5b1e9['waiting']){_0xb5b1e9[_0x4335('0x6')]-=0x1;}}function updateInteractionCounters(_0x661c1a){_0x661c1a['waiting']=0x0;_0x661c1a[_0x4335('0x7')]=0x0;_0x661c1a['answered']=0x0;_0x661c1a[_0x4335('0x8')]=0x0;_0x661c1a[_0x4335('0x9')]=0x0;_0x661c1a[_0x4335('0xa')]=0x0;if(_0x661c1a['closed']){if(_0x661c1a['disposition']===_0x4335('0x9')){_0x661c1a[_0x4335('0x9')]+=0x1;updateWaitingCounter(_0x661c1a);}if(_0x661c1a['UserId']){_0x661c1a[_0x4335('0xb')]+=0x1;if(_0x661c1a[_0x4335('0x7')]){_0x661c1a[_0x4335('0x7')]-=0x1;}}else{if(_0x661c1a['disposition']){_0x661c1a[_0x4335('0x8')]+=0x1;updateWaitingCounter(_0x661c1a);}}}else{if(!_0x661c1a[_0x4335('0xc')]){_0x661c1a[_0x4335('0x6')]+=0x1;}if(_0x661c1a[_0x4335('0xc')]){_0x661c1a[_0x4335('0x7')]+=0x1;updateWaitingCounter(_0x661c1a);}}_0x661c1a[_0x4335('0xa')]+=0x1;return _0x661c1a;}function getLastMessageText(_0xdf9863){return db[_0x4335('0xd')][_0x4335('0xe')]({'where':{'$and':[{'MailInteractionId':_0xdf9863['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x4335('0xf'),'raw':!![]})[_0x4335('0x10')](function(_0x5672cf){if(_0x5672cf&&_0x5672cf[_0x4335('0x11')]){_0xdf9863[_0x4335('0x12')]=_[_0x4335('0x13')](_0x5672cf['plainBody']);}return _0xdf9863;})[_0x4335('0x14')](function(_0x2302b4){throw _0x2302b4;});}exports[_0x4335('0x15')]=function(_0x149ee6,_0x5c1661,_0x5ba985,_0x1b637c){return new Promise(function(_0x42a27b,_0x49662c){return getInteractionUsers(_0x149ee6['id'],_0x5ba985)[_0x4335('0x10')](function(_0x2342c3){_0x149ee6['Users']=_0x2342c3;return getInteractionTags(_0x149ee6['TagIds'],_0x5c1661);})[_0x4335('0x10')](function(_0x29a264){_0x149ee6[_0x4335('0x16')]=_0x29a264;delete _0x149ee6['TagIds'];return updateInteractionCounters(_0x149ee6);})[_0x4335('0x10')](function(_0x2113f9){if(_0x1b637c){return getLastMessageText(_0x2113f9);}else{return _0x2113f9;}})[_0x4335('0x10')](function(_0x4538b6){_0x42a27b(_0x4538b6);})[_0x4335('0x14')](function(_0x399d51){_0x49662c(_0x399d51);});});}; \ No newline at end of file +var _0x9c52=['closed','UserId','disposition','MailMessage','out','then','plainBody','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','lodash','../../mysqldb','fullname','push','waiting','talking','answered','unmanaged','abandoned'];(function(_0x36d4a4,_0x38472c){var _0x4a99e5=function(_0x379dc6){while(--_0x379dc6){_0x36d4a4['push'](_0x36d4a4['shift']());}};_0x4a99e5(++_0x38472c);}(_0x9c52,0x12b));var _0x29c5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c52[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x29c5('0x0'));var db=require(_0x29c5('0x1'))['db'];function getInteractionUsers(_0xb28e9c,_0x4c4178){return new Promise(function(_0x288c19,_0x121689){try{var _0x3eea77=[];if(_0x4c4178[_0xb28e9c]){_0x3eea77=_0x4c4178[_0xb28e9c]['map'](function(_0x1cf41a){return{'id':_0x1cf41a['id'],'fullname':_0x1cf41a[_0x29c5('0x2')]};});}return _0x288c19(_0x3eea77);}catch(_0x25df5a){_0x121689(_0x25df5a);}});}function getInteractionTags(_0x38b4ba,_0x3da1a6){var _0x3f6c91=[];if(_0x38b4ba){_0x38b4ba['split'](',')['forEach'](function(_0x33bc80){_0x3f6c91[_0x29c5('0x3')](_0x3da1a6[_0x33bc80]);});}return _0x3f6c91;}function updateWaitingCounter(_0x1ecee6){if(_0x1ecee6[_0x29c5('0x4')]){_0x1ecee6[_0x29c5('0x4')]-=0x1;}}function updateInteractionCounters(_0x444b42){_0x444b42[_0x29c5('0x4')]=0x0;_0x444b42[_0x29c5('0x5')]=0x0;_0x444b42[_0x29c5('0x6')]=0x0;_0x444b42[_0x29c5('0x7')]=0x0;_0x444b42[_0x29c5('0x8')]=0x0;_0x444b42['total']=0x0;if(_0x444b42[_0x29c5('0x9')]){if(_0x444b42['disposition']==='abandoned'){_0x444b42[_0x29c5('0x8')]+=0x1;updateWaitingCounter(_0x444b42);}if(_0x444b42[_0x29c5('0xa')]){_0x444b42['answered']+=0x1;if(_0x444b42['talking']){_0x444b42['talking']-=0x1;}}else{if(_0x444b42[_0x29c5('0xb')]){_0x444b42[_0x29c5('0x7')]+=0x1;updateWaitingCounter(_0x444b42);}}}else{if(!_0x444b42[_0x29c5('0xa')]){_0x444b42[_0x29c5('0x4')]+=0x1;}if(_0x444b42[_0x29c5('0xa')]){_0x444b42[_0x29c5('0x5')]+=0x1;updateWaitingCounter(_0x444b42);}}_0x444b42['total']+=0x1;return _0x444b42;}function getLastMessageText(_0x26851b){return db[_0x29c5('0xc')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x26851b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x29c5('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x29c5('0xe')](function(_0x19d41c){if(_0x19d41c&&_0x19d41c[_0x29c5('0xf')]){_0x26851b[_0x29c5('0x10')]=_[_0x29c5('0x11')](_0x19d41c[_0x29c5('0xf')]);}return _0x26851b;})[_0x29c5('0x12')](function(_0x10719f){throw _0x10719f;});}exports[_0x29c5('0x13')]=function(_0x479161,_0x153a80,_0x25235a,_0x8eae67){return new Promise(function(_0x49f903,_0xa2a97e){return getInteractionUsers(_0x479161['id'],_0x25235a)[_0x29c5('0xe')](function(_0x237325){_0x479161[_0x29c5('0x14')]=_0x237325;return getInteractionTags(_0x479161[_0x29c5('0x15')],_0x153a80);})['then'](function(_0x3460ec){_0x479161['Tags']=_0x3460ec;delete _0x479161[_0x29c5('0x15')];return updateInteractionCounters(_0x479161);})[_0x29c5('0xe')](function(_0x371f77){if(_0x8eae67){return getLastMessageText(_0x371f77);}else{return _0x371f77;}})[_0x29c5('0xe')](function(_0x55ccaf){_0x49f903(_0x55ccaf);})['catch'](function(_0x5bb6a8){_0xa2a97e(_0x5bb6a8);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1379a09..331fa5b 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 _0xbeb7=['then','update','info','catch','error','exports','mail-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction'];(function(_0x10dc5d,_0x4b62cc){var _0x2c1e6f=function(_0x5f7307){while(--_0x5f7307){_0x10dc5d['push'](_0x10dc5d['shift']());}};_0x2c1e6f(++_0x4b62cc);}(_0xbeb7,0xba));var _0x7beb=function(_0x30dc0d,_0x40f17a){_0x30dc0d=_0x30dc0d-0x0;var _0x95b467=_0xbeb7[_0x30dc0d];return _0x95b467;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require('../../config/logger')(_0x7beb('0x0')),'fax':require(_0x7beb('0x1'))(_0x7beb('0x2')),'sms':require(_0x7beb('0x1'))(_0x7beb('0x3')),'chat':require('../../config/logger')(_0x7beb('0x4')),'whatsapp':require(_0x7beb('0x1'))(_0x7beb('0x5'))};function getAccountFK(_0xa0d038){return _[_0x7beb('0x6')](_0xa0d038)+(_0xa0d038===_0x7beb('0x7')?'Website':'Account')+'Id';}function getInteractionFK(_0x24cc45){return _[_0x7beb('0x6')](_0x24cc45)+_0x7beb('0x8');}function getInteractionId(_0x52bf3e,_0x7ebe2f,_0x1ec9c9){if(_0x52bf3e&&_0x52bf3e[_[_0x7beb('0x9')](_0x1ec9c9)+_0x7beb('0x8')]){return _0x52bf3e[_['upperFirst'](_0x1ec9c9)+_0x7beb('0x8')];}else if(_0x52bf3e&&_0x52bf3e['id']){return _0x52bf3e['id'];}else if(_0x7ebe2f&&_0x7ebe2f['id']){return _0x7ebe2f['id'];}else{return _0x7beb('0xa');}}function getInteractionsTables(_0x2742a7){return{'accounts':_0x2742a7+'_'+(_0x2742a7===_0x7beb('0x7')?_0x7beb('0xb'):_0x7beb('0xc')),'interactions':_0x2742a7+_0x7beb('0xd'),'interactionsTags':_0x2742a7+_0x7beb('0xe'),'messages':_0x2742a7+_0x7beb('0xf'),'userInteractions':_0x7beb('0x10')+_0x2742a7+_0x7beb('0xd')};}function getSelectedTags(_0x2b350c){var _0x3b7356=[];if(_0x2b350c){_0x3b7356=Array[_0x7beb('0x11')](_0x2b350c)?_0x2b350c:[_0x2b350c];}return _0x3b7356;}function log(_0x329cb2,_0xa18678,_0x84fc5a,_0x306913,_0x14f642,_0x4322c7){loggers[_0x14f642[_0x7beb('0x12')]()][_0x329cb2](_0x7beb('0x13'),_0x4322c7[_0x7beb('0x14')](),_0xa18678?_0xa18678['id']:null,_0xa18678?_0xa18678[_0x7beb('0x15')]:null,_0xa18678?_0xa18678[_0x7beb('0x16')]:null,getInteractionId(_0x84fc5a,_0x306913,_0x14f642),_0x84fc5a?JSON['stringify'](_0x84fc5a):'null');}function updateUser(_0x549c01,_0x357cbb,_0x1d1343,_0x1f0f86,_0x41b414){db[_[_0x7beb('0x9')](_0x1f0f86)+_0x7beb('0x17')]['findOne']({'where':{'id':getInteractionId(_0x357cbb,_0x1d1343,_0x1f0f86)}})[_0x7beb('0x18')](function(_0x267714){if(_0x267714){return _0x267714[_0x7beb('0x19')]({'UserId':_0x549c01?_0x549c01['id']:null});}})[_0x7beb('0x18')](function(_0x11282f){if(_0x11282f){log(_0x7beb('0x1a'),_0x549c01,_0x357cbb,_0x1d1343,_0x1f0f86,_0x41b414);}})[_0x7beb('0x1b')](function(){log(_0x7beb('0x1c'),_0x549c01,_0x357cbb,_0x1d1343,_0x1f0f86,_0x41b414);});}module[_0x7beb('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x5ed3=['null','Interaction','then','update','info','error','exports','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify'];(function(_0x243177,_0x2f429e){var _0x579844=function(_0x5e234c){while(--_0x5e234c){_0x243177['push'](_0x243177['shift']());}};_0x579844(++_0x2f429e);}(_0x5ed3,0xd9));var _0x35ed=function(_0x4ba197,_0x486ddc){_0x4ba197=_0x4ba197-0x0;var _0x397202=_0x5ed3[_0x4ba197];return _0x397202;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x35ed('0x0'))('mail-interactions'),'fax':require('../../config/logger')(_0x35ed('0x1')),'sms':require(_0x35ed('0x0'))(_0x35ed('0x2')),'chat':require(_0x35ed('0x0'))(_0x35ed('0x3')),'whatsapp':require('../../config/logger')(_0x35ed('0x4'))};function getAccountFK(_0x167c7f){return _[_0x35ed('0x5')](_0x167c7f)+(_0x167c7f===_0x35ed('0x6')?_0x35ed('0x7'):_0x35ed('0x8'))+'Id';}function getInteractionFK(_0x4fb59d){return _['capitalize'](_0x4fb59d)+_0x35ed('0x9');}function getInteractionId(_0x334981,_0x378402,_0x4f0833){if(_0x334981&&_0x334981[_['upperFirst'](_0x4f0833)+_0x35ed('0x9')]){return _0x334981[_[_0x35ed('0xa')](_0x4f0833)+'InteractionId'];}else if(_0x334981&&_0x334981['id']){return _0x334981['id'];}else if(_0x378402&&_0x378402['id']){return _0x378402['id'];}else{return _0x35ed('0xb');}}function getInteractionsTables(_0x162d57){return{'accounts':_0x162d57+'_'+(_0x162d57===_0x35ed('0x6')?_0x35ed('0xc'):_0x35ed('0xd')),'interactions':_0x162d57+_0x35ed('0xe'),'interactionsTags':_0x162d57+_0x35ed('0xf'),'messages':_0x162d57+'_messages','userInteractions':_0x35ed('0x10')+_0x162d57+_0x35ed('0xe')};}function getSelectedTags(_0x386d19){var _0x4d6ef8=[];if(_0x386d19){_0x4d6ef8=Array[_0x35ed('0x11')](_0x386d19)?_0x386d19:[_0x386d19];}return _0x4d6ef8;}function log(_0x480d8f,_0x25c2a1,_0x1ffff2,_0x5b25be,_0x3cd07c,_0xc6275c){loggers[_0x3cd07c[_0x35ed('0x12')]()][_0x480d8f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc6275c[_0x35ed('0x13')](),_0x25c2a1?_0x25c2a1['id']:null,_0x25c2a1?_0x25c2a1[_0x35ed('0x14')]:null,_0x25c2a1?_0x25c2a1[_0x35ed('0x15')]:null,getInteractionId(_0x1ffff2,_0x5b25be,_0x3cd07c),_0x1ffff2?JSON[_0x35ed('0x16')](_0x1ffff2):_0x35ed('0x17'));}function updateUser(_0x114d55,_0x15d6c2,_0x26d4a4,_0x7a7b7b,_0x497427){db[_['upperFirst'](_0x7a7b7b)+_0x35ed('0x18')]['findOne']({'where':{'id':getInteractionId(_0x15d6c2,_0x26d4a4,_0x7a7b7b)}})[_0x35ed('0x19')](function(_0x584912){if(_0x584912){return _0x584912[_0x35ed('0x1a')]({'UserId':_0x114d55?_0x114d55['id']:null});}})[_0x35ed('0x19')](function(_0x1fa3c6){if(_0x1fa3c6){log(_0x35ed('0x1b'),_0x114d55,_0x15d6c2,_0x26d4a4,_0x7a7b7b,_0x497427);}})['catch'](function(){log(_0x35ed('0x1c'),_0x114d55,_0x15d6c2,_0x26d4a4,_0x7a7b7b,_0x497427);});}module[_0x35ed('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 57dd5c5..eebb052 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 _0x36ee=['split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','hasOwnProperty','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','crypto','composable-middleware','../../mysqldb','../../config/environment','license'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0x172));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var crypto=require(_0xe36e('0x0'));var util=require('util');var compose=require(_0xe36e('0x1'));var db=require(_0xe36e('0x2'))['db'];var config=require(_0xe36e('0x3'));function getValueFromLicense(_0x1ea68b,_0x51092c){if(_0x1ea68b&&_0x51092c){if(_0x51092c['data1']&&_0x51092c['license']){var _0x4f5ae2=_0x51092c['data1'];var _0x1a7916=_0x51092c[_0xe36e('0x4')];var _0x508c26=_0x4f5ae2[_0xe36e('0x5')]('-')[0x4];var _0x7f78d6=_0x4f5ae2[_0xe36e('0x5')]('-')[0x0];var _0x29e634=crypto[_0xe36e('0x6')](_0xe36e('0x7'),util[_0xe36e('0x8')]('%s:%s:%s',_0x508c26,_0x4f5ae2,_0x7f78d6));var _0x389ae1=_0x29e634[_0xe36e('0x9')](_0x1a7916,_0xe36e('0xa'),_0xe36e('0xb'));_0x389ae1+=_0x29e634[_0xe36e('0xc')]('utf8');var _0x4d0c73=JSON['parse'](_0x389ae1);return _0x4d0c73[_0xe36e('0xd')](_0x1ea68b)?_0x4d0c73[_0x1ea68b]:null;}}return null;}function isLimit(_0x25b316,_0x231c2a,_0x2f3733,_0x26a77c){var _0x2718db=_0x231c2a;return compose()[_0xe36e('0xe')](function(_0x342b64,_0x6ffdc2,_0x29e1c8){return db[_0xe36e('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe36e('0x10')](function(_0x4582f8){var _0x5c6527=getValueFromLicense(_0x25b316,_0x4582f8);return _0x5c6527?_0x5c6527:_0x2718db;})['then'](function(_0x3f2784){_0x2718db=_0x3f2784;return _0x2f3733[_0xe36e('0x11')](_0x26a77c);})[_0xe36e('0x10')](function(_0x3d6d73){if(_0x3d6d73>=_0x2718db){return _0x6ffdc2[_0xe36e('0x12')](0x193)[_0xe36e('0x13')]({'message':util['format'](_0xe36e('0x14'),_0x25b316)});}_0x29e1c8();})[_0xe36e('0x15')](function(_0x5d813d){_0x29e1c8(_0x5d813d);});});}function isUserLimit(){return isLimit(_0xe36e('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xe36e('0x17')},{'role':_0xe36e('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xe069=['parse','hasOwnProperty','License','findOne','then','count','status','json','catch','users','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0x5c1a19,_0x3f93d7){var _0x3aea0e=function(_0x43d348){while(--_0x43d348){_0x5c1a19['push'](_0x5c1a19['shift']());}};_0x3aea0e(++_0x3f93d7);}(_0xe069,0xa8));var _0x9e06=function(_0x12ceb6,_0x1f293d){_0x12ceb6=_0x12ceb6-0x0;var _0x31e5d0=_0xe069[_0x12ceb6];return _0x31e5d0;};'use strict';var crypto=require('crypto');var util=require(_0x9e06('0x0'));var compose=require(_0x9e06('0x1'));var db=require(_0x9e06('0x2'))['db'];var config=require(_0x9e06('0x3'));function getValueFromLicense(_0x4f8e78,_0x5ece97){if(_0x4f8e78&&_0x5ece97){if(_0x5ece97[_0x9e06('0x4')]&&_0x5ece97[_0x9e06('0x5')]){var _0x368e2f=_0x5ece97[_0x9e06('0x4')];var _0x1df51b=_0x5ece97['license'];var _0x59fd3c=_0x368e2f[_0x9e06('0x6')]('-')[0x4];var _0x440932=_0x368e2f[_0x9e06('0x6')]('-')[0x0];var _0x445803=crypto[_0x9e06('0x7')](_0x9e06('0x8'),util[_0x9e06('0x9')](_0x9e06('0xa'),_0x59fd3c,_0x368e2f,_0x440932));var _0x3391da=_0x445803[_0x9e06('0xb')](_0x1df51b,_0x9e06('0xc'),'utf8');_0x3391da+=_0x445803['final'](_0x9e06('0xd'));var _0xd8da2=JSON[_0x9e06('0xe')](_0x3391da);return _0xd8da2[_0x9e06('0xf')](_0x4f8e78)?_0xd8da2[_0x4f8e78]:null;}}return null;}function isLimit(_0x5c8426,_0x132479,_0xb9f1f5,_0x2930a6){var _0x333c0f=_0x132479;return compose()['use'](function(_0x25cfd9,_0x423ddb,_0x4e58b2){return db[_0x9e06('0x10')][_0x9e06('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x55b609){var _0x460490=getValueFromLicense(_0x5c8426,_0x55b609);return _0x460490?_0x460490:_0x333c0f;})[_0x9e06('0x12')](function(_0x561bab){_0x333c0f=_0x561bab;return _0xb9f1f5[_0x9e06('0x13')](_0x2930a6);})['then'](function(_0x14ea08){if(_0x14ea08>=_0x333c0f){return _0x423ddb[_0x9e06('0x14')](0x193)[_0x9e06('0x15')]({'message':util[_0x9e06('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5c8426)});}_0x4e58b2();})[_0x9e06('0x16')](function(_0x5ac667){_0x4e58b2(_0x5ac667);});});}function isUserLimit(){return isLimit(_0x9e06('0x17'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x9e06('0x18')}]}});}exports[_0x9e06('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index e8d9746..5ff410c 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 _0x013d=['=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','shift','match','filter','indexOf','map','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','$ne','$notIn','$in','NOT\x20IN\x20?'];(function(_0x56bd13,_0x5cff5a){var _0x1eccea=function(_0x2aa821){while(--_0x2aa821){_0x56bd13['push'](_0x56bd13['shift']());}};_0x1eccea(++_0x5cff5a);}(_0x013d,0x1ee));var _0xd013=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0x013d[_0x5df25b];return _0x19f252;};'use strict';var _=require(_0xd013('0x0'));var moment=require(_0xd013('0x1'));exports[_0xd013('0x2')]=function(_0x5cb258){var _0x4a4d16={'conditions':[]};_0x4a4d16[_0xd013('0x3')]=_[_0xd013('0x4')](_0x5cb258,_0xd013('0x5'))?'or':_0xd013('0x6');var _0x19d119=_0x5cb258[_0xd013('0x7')]('[$and]','')[_0xd013('0x7')](_0xd013('0x5'),'')[_0xd013('0x8')]('||');for(var _0x494f0a=0x0;_0x494f0a<_0x19d119[_0xd013('0x9')];_0x494f0a++){var _0x3de520=_0x19d119[_0x494f0a][_0xd013('0x8')](':=');var _0x572f8f=_0x3de520[0x0];var _0x6ad0bc=_0x3de520['slice'](0x1);_0x6ad0bc['forEach'](function(_0x1d1df8){var _0x331444=_0x1d1df8[_0xd013('0x8')]('[')[_0xd013('0xa')]();var _0xb6cf57=_0x1d1df8[_0xd013('0xb')](/\[(.*?)\]/g);_0xb6cf57['forEach'](function(_0x2e5aec){var _0x1e4742=_0x2e5aec[_0xd013('0x8')]('[')[_0xd013('0xc')](function(_0x59b87f){return _0x59b87f[_0xd013('0xd')](']')>-0x1;})[_0xd013('0xe')](function(_0x3a59e0){return _0x3a59e0['split'](']')[0x0];})[0x0];_0x4a4d16['conditions']['push']({'field':_0x572f8f,'operator':_0x331444,'value':_0x1e4742});});});}return _0x4a4d16;};exports[_0xd013('0xf')]=function(_0x4edbb0,_0x4f26aa,_0x50c744){var _0xeae8f9={};if(_0x4f26aa===_0xd013('0x10')){if(_0x50c744['operator']==='$eq'){_0x50c744[_0xd013('0x11')]=_0xd013('0x12');_0x50c744[_0xd013('0x13')]+=','+_0x50c744[_0xd013('0x13')];}else if(_[_0xd013('0x14')]([_0xd013('0x15'),_0xd013('0x16')],_0x50c744[_0xd013('0x11')])){_0x50c744[_0xd013('0x13')]=moment(_0x50c744['value'])[_0xd013('0x17')](0x1,'days')[_0xd013('0x18')](_0xd013('0x19'));}}if(_0x50c744['castTo']){_0x4f26aa=_0x50c744['castTo'];_0xeae8f9[_0xd013('0x1a')]=_0xd013('0x1b')+_0x4edbb0+'.'+_0x50c744[_0xd013('0x1c')]+_0xd013('0x1d')+_0x50c744['castTo']+')\x20'+parseOperator(_0x50c744[_0xd013('0x11')]);}else{_0xeae8f9[_0xd013('0x1a')]=_0x4edbb0+'.'+_0x50c744[_0xd013('0x1c')]+'\x20'+parseOperator(_0x50c744[_0xd013('0x11')]);}if(_[_0xd013('0x14')]([_0xd013('0x1e'),_0xd013('0x1f')],_0x50c744['operator']))_0xeae8f9[_0xd013('0x1a')]='('+_0xeae8f9[_0xd013('0x1a')]+'\x20OR\x20'+_0x4edbb0+'.'+_0x50c744[_0xd013('0x1c')]+'\x20IS\x20NULL)';_0xeae8f9[_0xd013('0x13')]=parseValue(_0x4f26aa,_0x50c744[_0xd013('0x11')],_0x50c744['value']);return _0xeae8f9;};function parseOperator(_0x14da4d){var _0x5ac041;switch(_0x14da4d){case _0xd013('0x20'):_0x5ac041='IN\x20?';break;case _0xd013('0x1f'):_0x5ac041=_0xd013('0x21');break;case'$eq':_0x5ac041=_0xd013('0x22');break;case _0xd013('0x1e'):_0x5ac041=_0xd013('0x23');break;case _0xd013('0x24'):case _0xd013('0x25'):case _0xd013('0x26'):_0x5ac041=_0xd013('0x27');break;case _0xd013('0x28'):_0x5ac041='<\x20?';break;case _0xd013('0x15'):_0x5ac041=_0xd013('0x29');break;case _0xd013('0x16'):_0x5ac041=_0xd013('0x2a');break;case'$gte':_0x5ac041=_0xd013('0x2b');break;case _0xd013('0x12'):_0x5ac041=_0xd013('0x2c');break;}return _0x5ac041;}function parseValue(_0x72addb,_0x227b6e,_0x5962cf){var _0x1d7189={'start':undefined,'end':undefined};switch(_0x227b6e){case _0xd013('0x20'):case'$notIn':_0x1d7189[_0xd013('0x2d')]=_0x5962cf[_0xd013('0x8')](',');break;case'$substring':_0x1d7189[_0xd013('0x2d')]='%'+_0x5962cf+'%';break;case'$startsWith':_0x1d7189['start']=_0x5962cf+'%';break;case _0xd013('0x26'):_0x1d7189[_0xd013('0x2d')]='%'+_0x5962cf;break;case _0xd013('0x12'):var _0x1b8807=_0x5962cf[_0xd013('0x8')](',');var _0x5962cf=_0x1b8807['shift']();var _0x2d24e0=_0x1b8807[_0xd013('0x2e')]();if(_0x72addb==='DATE'){_0x5962cf=moment(_0x5962cf)[_0xd013('0x2f')](0x0,!![])[_0xd013('0x18')]();_0x2d24e0=moment(_0x2d24e0)['utcOffset'](0x0,!![])[_0xd013('0x17')](0x17,'hours')[_0xd013('0x17')](0x3b,'minutes')[_0xd013('0x17')](0x3b,'seconds')['format']();}_0x1d7189={'start':_0x5962cf,'end':_0x2d24e0};break;default:_0x1d7189[_0xd013('0x2d')]=_0x5962cf;break;}return _0x1d7189;} \ No newline at end of file +var _0x1700=['split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$lte','add','days','text','CAST(','castTo','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$eq','<>\x20?','$endsWith','LIKE\x20?','$lt','$gt','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','pop','utcOffset','format','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]'];(function(_0x18a6a2,_0x1bf4a0){var _0x1cee6f=function(_0x520c3e){while(--_0x520c3e){_0x18a6a2['push'](_0x18a6a2['shift']());}};_0x1cee6f(++_0x1bf4a0);}(_0x1700,0x1de));var _0x0170=function(_0x16a95d,_0xdf3e5c){_0x16a95d=_0x16a95d-0x0;var _0x1fbddd=_0x1700[_0x16a95d];return _0x1fbddd;};'use strict';var _=require(_0x0170('0x0'));var moment=require(_0x0170('0x1'));exports['parseSearch']=function(_0x3ed521){var _0xd498b0={'conditions':[]};_0xd498b0[_0x0170('0x2')]=_[_0x0170('0x3')](_0x3ed521,_0x0170('0x4'))?'or':_0x0170('0x5');var _0x31be23=_0x3ed521[_0x0170('0x6')](_0x0170('0x7'),'')[_0x0170('0x6')]('[$or]','')[_0x0170('0x8')]('||');for(var _0x20fdaa=0x0;_0x20fdaa<_0x31be23[_0x0170('0x9')];_0x20fdaa++){var _0x21eb97=_0x31be23[_0x20fdaa]['split'](':=');var _0xac72f2=_0x21eb97[0x0];var _0x4c91bb=_0x21eb97[_0x0170('0xa')](0x1);_0x4c91bb[_0x0170('0xb')](function(_0x3c43c8){var _0x334fd4=_0x3c43c8[_0x0170('0x8')]('[')[_0x0170('0xc')]();var _0x403773=_0x3c43c8[_0x0170('0xd')](/\[(.*?)\]/g);_0x403773[_0x0170('0xb')](function(_0x2d3fe4){var _0x532b15=_0x2d3fe4[_0x0170('0x8')]('[')['filter'](function(_0x3bef7a){return _0x3bef7a[_0x0170('0xe')](']')>-0x1;})[_0x0170('0xf')](function(_0x32fbc8){return _0x32fbc8[_0x0170('0x8')](']')[0x0];})[0x0];_0xd498b0[_0x0170('0x10')][_0x0170('0x11')]({'field':_0xac72f2,'operator':_0x334fd4,'value':_0x532b15});});});}return _0xd498b0;};exports[_0x0170('0x12')]=function(_0x3d6026,_0x496ab1,_0x1f6951){var _0xc758fe={};if(_0x496ab1===_0x0170('0x13')){if(_0x1f6951[_0x0170('0x14')]==='$eq'){_0x1f6951[_0x0170('0x14')]=_0x0170('0x15');_0x1f6951[_0x0170('0x16')]+=','+_0x1f6951[_0x0170('0x16')];}else if(_[_0x0170('0x17')](['$gt',_0x0170('0x18')],_0x1f6951['operator'])){_0x1f6951['value']=moment(_0x1f6951[_0x0170('0x16')])[_0x0170('0x19')](0x1,_0x0170('0x1a'))['format']('YYYY-MM-DD');}}if(_0x1f6951['castTo']){_0x496ab1=_0x1f6951['castTo'];_0xc758fe[_0x0170('0x1b')]=_0x0170('0x1c')+_0x3d6026+'.'+_0x1f6951['field']+'\x20AS\x20'+_0x1f6951[_0x0170('0x1d')]+')\x20'+parseOperator(_0x1f6951[_0x0170('0x14')]);}else{_0xc758fe[_0x0170('0x1b')]=_0x3d6026+'.'+_0x1f6951[_0x0170('0x1e')]+'\x20'+parseOperator(_0x1f6951[_0x0170('0x14')]);}if(_[_0x0170('0x17')]([_0x0170('0x1f'),_0x0170('0x20')],_0x1f6951[_0x0170('0x14')]))_0xc758fe[_0x0170('0x1b')]='('+_0xc758fe[_0x0170('0x1b')]+_0x0170('0x21')+_0x3d6026+'.'+_0x1f6951[_0x0170('0x1e')]+'\x20IS\x20NULL)';_0xc758fe[_0x0170('0x16')]=parseValue(_0x496ab1,_0x1f6951[_0x0170('0x14')],_0x1f6951['value']);return _0xc758fe;};function parseOperator(_0x40f58b){var _0x2cd043;switch(_0x40f58b){case _0x0170('0x22'):_0x2cd043=_0x0170('0x23');break;case _0x0170('0x20'):_0x2cd043=_0x0170('0x24');break;case _0x0170('0x25'):_0x2cd043='=\x20?';break;case _0x0170('0x1f'):_0x2cd043=_0x0170('0x26');break;case'$substring':case'$startsWith':case _0x0170('0x27'):_0x2cd043=_0x0170('0x28');break;case _0x0170('0x29'):_0x2cd043='<\x20?';break;case _0x0170('0x2a'):_0x2cd043='>\x20?';break;case'$lte':_0x2cd043='<=\x20?';break;case _0x0170('0x2b'):_0x2cd043=_0x0170('0x2c');break;case'$between':_0x2cd043=_0x0170('0x2d');break;}return _0x2cd043;}function parseValue(_0x2422bd,_0x2b2126,_0x40fbba){var _0x3c64c9={'start':undefined,'end':undefined};switch(_0x2b2126){case _0x0170('0x22'):case _0x0170('0x20'):_0x3c64c9[_0x0170('0x2e')]=_0x40fbba[_0x0170('0x8')](',');break;case _0x0170('0x2f'):_0x3c64c9[_0x0170('0x2e')]='%'+_0x40fbba+'%';break;case _0x0170('0x30'):_0x3c64c9['start']=_0x40fbba+'%';break;case'$endsWith':_0x3c64c9[_0x0170('0x2e')]='%'+_0x40fbba;break;case _0x0170('0x15'):var _0x33f90b=_0x40fbba['split'](',');var _0x40fbba=_0x33f90b[_0x0170('0xc')]();var _0x7bbc13=_0x33f90b[_0x0170('0x31')]();if(_0x2422bd==='DATE'){_0x40fbba=moment(_0x40fbba)[_0x0170('0x32')](0x0,!![])[_0x0170('0x33')]();_0x7bbc13=moment(_0x7bbc13)[_0x0170('0x32')](0x0,!![])[_0x0170('0x19')](0x17,'hours')[_0x0170('0x19')](0x3b,_0x0170('0x34'))[_0x0170('0x19')](0x3b,_0x0170('0x35'))[_0x0170('0x33')]();}_0x3c64c9={'start':_0x40fbba,'end':_0x7bbc13};break;default:_0x3c64c9['start']=_0x40fbba;break;}return _0x3c64c9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a91422d..c394dad 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 _0xe0ff=['DESC','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','{EXPR}','forEach','replace','push','getOptions','query','$id','model','intersection','attributes','nolimit','order','where','filter','object','includes','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','type','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr'];(function(_0x585398,_0x703333){var _0x28c56c=function(_0x41c8d3){while(--_0x41c8d3){_0x585398['push'](_0x585398['shift']());}};_0x28c56c(++_0x703333);}(_0xe0ff,0x1d9));var _0xfe0f=function(_0x420532,_0x23eb4f){_0x420532=_0x420532-0x0;var _0x1f36ea=_0xe0ff[_0x420532];return _0x1f36ea;};'use strict';var _=require(_0xfe0f('0x0'));var sequelize=require(_0xfe0f('0x1'));var moment=require(_0xfe0f('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x242137){var _0x20e907=['ne'];try{var _0x5e2b9f=JSON[_0xfe0f('0x3')](_0x242137);var _0x353b55=Object[_0xfe0f('0x4')](_0x5e2b9f)[0x0];return _0x20e907['includes'](_0x353b55);}catch(_0x4a45d1){return![];}}function getOperatorValue(_0x1fca50){var _0xe46459=JSON[_0xfe0f('0x3')](_0x1fca50);var _0x2671fa=Object['keys'](_0xe46459)[0x0];var _0x45cdb6=_0xe46459[_0x2671fa];return{['$'+_0x2671fa]:_0x45cdb6};}exports[_0xfe0f('0x5')]=function(_0x172159){var _0x36c577=null;if(_0x172159){_0x36c577=_0x172159[_0xfe0f('0x6')](',');}return _0x36c577;};exports[_0xfe0f('0x7')]=function(_0x3af585,_0x342aa2){var _0xe6c2fa={};if(!_[_0xfe0f('0x8')](_0x3af585)){_[_0xfe0f('0x9')](_0x3af585,function(_0x5dfcba,_0x322873){try{if(_0x342aa2){var _0x331221=_[_0xfe0f('0xa')](_0x342aa2,{'name':_0x322873})||{};if(hasSequelizeOperator(_0x5dfcba)){_0xe6c2fa[_0x322873]=getOperatorValue(_0x5dfcba);}else if(_0x331221[_0xfe0f('0xb')]==='DATE'&&_['isPlainObject'](_0x5dfcba)){var _0x31dc7f=JSON[_0xfe0f('0x3')](_0x5dfcba);var _0x1ea990={'$gte':moment(moment(_0x31dc7f[_0xfe0f('0xc')])[_0xfe0f('0xd')](_0xfe0f('0xe')))[_0xfe0f('0xf')]()[_0xfe0f('0xd')](),'$lte':moment(moment(_0x31dc7f[_0xfe0f('0x10')])[_0xfe0f('0xd')](_0xfe0f('0xe')))[_0xfe0f('0xf')]()[_0xfe0f('0x11')](0x1,'s')[_0xfe0f('0xd')]()};_0xe6c2fa[_0x322873]=_0x1ea990;}else if(_0x331221[_0xfe0f('0x12')]===_0xfe0f('0x13')){_0xe6c2fa[_0x322873]=_0x5dfcba;}else{_0xe6c2fa[_0x322873]=_[_0xfe0f('0x14')](_0x5dfcba)?_0x5dfcba:JSON['parse'](_0x5dfcba);}}else{_0xe6c2fa[_0x322873]=_[_0xfe0f('0x14')](_0x5dfcba)?_0x5dfcba:JSON['parse'](_0x5dfcba);}}catch(_0x850416){_0xe6c2fa[_0x322873]=_0x5dfcba[_0xfe0f('0x6')](',');}});}return _0xe6c2fa;};exports[_0xfe0f('0x15')]=function(_0x335e90){_0x335e90=parseInt(_0x335e90,0xa);if(!_0x335e90||_0x335e90<0x0){_0x335e90=LIMIT_VALUE;}return _0x335e90;};exports[_0xfe0f('0x16')]=function(_0x2655f3){_0x2655f3=parseInt(_0x2655f3,0xa);if(!_0x2655f3||_0x2655f3<0x0){_0x2655f3=0x0;}return _0x2655f3;};exports[_0xfe0f('0x17')]=function(_0x443c49){var _0x443777,_0x51d27d=null;if(_0x443c49){_0x443777=_0x443c49[_0xfe0f('0x6')](',');_0x51d27d=_[_0xfe0f('0x18')](_0x443777,function(_0x5215ab){if(_0x5215ab[_0xfe0f('0x19')]('-')===0x0){return[_0x5215ab===_0xfe0f('0x1a')?sequelize[_0xfe0f('0x1b')](sequelize[_0xfe0f('0x1c')]('priority'),_0xfe0f('0x1d')):_0x5215ab[_0xfe0f('0x1e')](0x1),_0xfe0f('0x1f')];}else{return[_0x5215ab===_0xfe0f('0x1a')?sequelize[_0xfe0f('0x1b')](sequelize[_0xfe0f('0x1c')](_0xfe0f('0x1a')),_0xfe0f('0x1d')):_0x5215ab,_0xfe0f('0x20')];}});}return _0x51d27d;};exports[_0xfe0f('0x21')]=function(_0x417cfc,_0x1af833){if(_['isEmpty'](_0x417cfc)){return _0x417cfc;}if(_[_0xfe0f('0x14')](_0x417cfc)){for(var _0x10069e=0x0;_0x10069e<_0x417cfc[_0xfe0f('0x22')];_0x10069e+=0x1){_0x417cfc[_0x10069e]=this[_0xfe0f('0x21')](_0x417cfc[_0x10069e],_0x1af833);}return _0x417cfc;}if(!_['isObject'](_0x417cfc)){return _0x417cfc;}if(_[_0xfe0f('0x23')](_0x1af833)){_0x1af833=[_0x1af833];}if(!_[_0xfe0f('0x14')](_0x1af833)){return _0x417cfc;}for(var _0x45a8ab=0x0;_0x45a8ab<_0x1af833[_0xfe0f('0x22')];_0x45a8ab+=0x1){_[_0xfe0f('0x24')](_0x417cfc,_0x1af833[_0x45a8ab]);}for(var _0x34acfa in _0x417cfc){if(_0x417cfc[_0xfe0f('0x25')](_0x34acfa)){_0x417cfc[_0x34acfa]=this[_0xfe0f('0x21')](_0x417cfc[_0x34acfa],_0x1af833);}}return _0x417cfc;};exports[_0xfe0f('0x26')]=function(_0xb68f6){return _0xb68f6[_0xfe0f('0x27')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xfe0f('0x28')]=function(_0xd0466e){return _0xd0466e[_0xfe0f('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0xfe0f('0x29')]=function(_0x413714,_0x135f48){var _0x2b9863=[];var _0x1baac7=/[ `!@#$%^&*()_\-?~]/;var _0x2de931=_0x135f48?'\x22{EXPR}\x22':_0xfe0f('0x2a');_0x413714[_0xfe0f('0x6')](/[ ,]+/)[_0xfe0f('0x2b')](function(_0x2f6c5d){_0x2f6c5d=_0x2f6c5d[_0xfe0f('0x2c')](/([^:]")"+/g,'$1');_0x2f6c5d='+'+_0x2f6c5d+'*';var _0xd45f57=_0x2f6c5d['match'](_0x1baac7);if(_0xd45f57){_0x2f6c5d='\x22'+_0x2f6c5d+'\x22';}_0x2b9863[_0xfe0f('0x2d')](_0x2f6c5d);});_0x2de931=_0x2de931['replace']('{EXPR}',_0x2b9863['join']('\x20'));return _0x2de931;};exports[_0xfe0f('0x2e')]=function(_0x56d126,_0x2b8b9c,_0x23c218){var _0xf657a={},_0x2ef906={};if(_0x2b8b9c[_0xfe0f('0x2f')]['$id']){_0x2b8b9c[_0xfe0f('0x2f')]['id']=_0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x30')];delete _0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x30')];}_0xf657a[_0xfe0f('0x31')]=_[_0xfe0f('0x18')](_0x56d126,_0xfe0f('0x12'));_0xf657a[_0xfe0f('0x2f')]=_[_0xfe0f('0x4')](_0x2b8b9c[_0xfe0f('0x2f')]);_0xf657a[_0xfe0f('0x7')]=_[_0xfe0f('0x32')](_0xf657a['model'],_0xf657a[_0xfe0f('0x2f')]);_0x2ef906[_0xfe0f('0x33')]=_[_0xfe0f('0x32')](_0xf657a[_0xfe0f('0x31')],this['fields'](_0x2b8b9c['query'][_0xfe0f('0x5')]));_0x2ef906['attributes']=_0x2ef906[_0xfe0f('0x33')][_0xfe0f('0x22')]?_0x2ef906['attributes']:_0xf657a[_0xfe0f('0x31')];if(!_0x2b8b9c[_0xfe0f('0x2f')]['hasOwnProperty'](_0xfe0f('0x34'))){_0x2ef906[_0xfe0f('0x15')]=this['limit'](_0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x15')]);_0x2ef906[_0xfe0f('0x16')]=this[_0xfe0f('0x16')](_0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x16')]);}_0x2ef906[_0xfe0f('0x35')]=this[_0xfe0f('0x17')](_0x2b8b9c['query'][_0xfe0f('0x17')]);_0x2ef906[_0xfe0f('0x36')]=this[_0xfe0f('0x7')](_['pick'](_0x2b8b9c['query'],_0xf657a[_0xfe0f('0x7')]),_0x56d126);if(_0x2b8b9c[_0xfe0f('0x2f')]['filter']){var _0x27cd36=_0x56d126;var _0x126170=_0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x37')];if(typeof _0x126170===_0xfe0f('0x38')){_0x27cd36=_['filter'](_0x56d126,function(_0x3d9736){return _[_0xfe0f('0x39')](_0x126170['columns'],_0x3d9736['name']);});_0x126170=_0x126170[_0xfe0f('0x3a')];}_0x2ef906['where']=_[_0xfe0f('0x3b')](_0x2ef906[_0xfe0f('0x36')],{'$or':_[_0xfe0f('0x18')](_0x27cd36,function(_0x50ffff){if(_0x50ffff[_0xfe0f('0xb')]!==_0xfe0f('0x3c')){if(_0x23c218){return sequelize['where'](sequelize['fn']('lower',sequelize[_0xfe0f('0x1c')](_0x50ffff[_0xfe0f('0x12')])),{'$like':sequelize['fn'](_0xfe0f('0x3d'),'%'+_0x2b8b9c['query'][_0xfe0f('0x37')]+'%')});}else{var _0x1fb82a={};_0x1fb82a[_0x50ffff[_0xfe0f('0x12')]]={'$like':'%'+_0x2b8b9c[_0xfe0f('0x2f')][_0xfe0f('0x37')]+'%'};return _0x1fb82a;}}})});}_0x2ef906=_[_0xfe0f('0x3b')]({},_0x2ef906,_0x2b8b9c[_0xfe0f('0x3e')]);return _0x2ef906;}; \ No newline at end of file +var _0x774e=['utc','$lte','subtract','uniqueid','isArray','split','offset','sort','map','indexOf','cast','priority','unsigned','substr','DESC','col','ASC','omit','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','\x22{EXPR}\x22','{EXPR}','forEach','push','getOptions','$id','query','model','name','intersection','attributes','fields','length','limit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD'];(function(_0xc0a6d,_0x4e626e){var _0xdb4f25=function(_0x127988){while(--_0x127988){_0xc0a6d['push'](_0xc0a6d['shift']());}};_0xdb4f25(++_0x4e626e);}(_0x774e,0x130));var _0xe774=function(_0x38b254,_0x6d7ed6){_0x38b254=_0x38b254-0x0;var _0x547c7c=_0x774e[_0x38b254];return _0x547c7c;};'use strict';var _=require(_0xe774('0x0'));var sequelize=require(_0xe774('0x1'));var moment=require(_0xe774('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x45ea88){var _0xcc2593=['ne'];try{var _0x5a8387=JSON[_0xe774('0x3')](_0x45ea88);var _0xe3eb30=Object[_0xe774('0x4')](_0x5a8387)[0x0];return _0xcc2593[_0xe774('0x5')](_0xe3eb30);}catch(_0x59e80b){return![];}}function getOperatorValue(_0x59ff0b){var _0x35ffe4=JSON[_0xe774('0x3')](_0x59ff0b);var _0x2fe0bc=Object[_0xe774('0x4')](_0x35ffe4)[0x0];var _0x52fcb9=_0x35ffe4[_0x2fe0bc];return{['$'+_0x2fe0bc]:_0x52fcb9};}exports['fields']=function(_0x2ab4c9){var _0x5a5d03=null;if(_0x2ab4c9){_0x5a5d03=_0x2ab4c9['split'](',');}return _0x5a5d03;};exports[_0xe774('0x6')]=function(_0x1f6c49,_0x834578){var _0x507eb5={};if(!_[_0xe774('0x7')](_0x1f6c49)){_[_0xe774('0x8')](_0x1f6c49,function(_0x2989c7,_0x53d1bd){try{if(_0x834578){var _0x13e208=_[_0xe774('0x9')](_0x834578,{'name':_0x53d1bd})||{};if(hasSequelizeOperator(_0x2989c7)){_0x507eb5[_0x53d1bd]=getOperatorValue(_0x2989c7);}else if(_0x13e208[_0xe774('0xa')]===_0xe774('0xb')&&_[_0xe774('0xc')](_0x2989c7)){var _0x48e4a2=JSON[_0xe774('0x3')](_0x2989c7);var _0x7ad6f5={'$gte':moment(moment(_0x48e4a2[_0xe774('0xd')])[_0xe774('0xe')](_0xe774('0xf')))[_0xe774('0x10')]()[_0xe774('0xe')](),'$lte':moment(moment(_0x48e4a2[_0xe774('0x11')])[_0xe774('0xe')]('YYYY-MM-DD'))[_0xe774('0x10')]()[_0xe774('0x12')](0x1,'s')[_0xe774('0xe')]()};_0x507eb5[_0x53d1bd]=_0x7ad6f5;}else if(_0x13e208['name']===_0xe774('0x13')){_0x507eb5[_0x53d1bd]=_0x2989c7;}else{_0x507eb5[_0x53d1bd]=_[_0xe774('0x14')](_0x2989c7)?_0x2989c7:JSON['parse'](_0x2989c7);}}else{_0x507eb5[_0x53d1bd]=_[_0xe774('0x14')](_0x2989c7)?_0x2989c7:JSON[_0xe774('0x3')](_0x2989c7);}}catch(_0xf72201){_0x507eb5[_0x53d1bd]=_0x2989c7[_0xe774('0x15')](',');}});}return _0x507eb5;};exports['limit']=function(_0x55337b){_0x55337b=parseInt(_0x55337b,0xa);if(!_0x55337b||_0x55337b<0x0){_0x55337b=LIMIT_VALUE;}return _0x55337b;};exports[_0xe774('0x16')]=function(_0x366768){_0x366768=parseInt(_0x366768,0xa);if(!_0x366768||_0x366768<0x0){_0x366768=0x0;}return _0x366768;};exports[_0xe774('0x17')]=function(_0x22008b){var _0x566a00,_0x505dc9=null;if(_0x22008b){_0x566a00=_0x22008b[_0xe774('0x15')](',');_0x505dc9=_[_0xe774('0x18')](_0x566a00,function(_0x3dee87){if(_0x3dee87[_0xe774('0x19')]('-')===0x0){return[_0x3dee87==='priority'?sequelize[_0xe774('0x1a')](sequelize['col'](_0xe774('0x1b')),_0xe774('0x1c')):_0x3dee87[_0xe774('0x1d')](0x1),_0xe774('0x1e')];}else{return[_0x3dee87===_0xe774('0x1b')?sequelize[_0xe774('0x1a')](sequelize[_0xe774('0x1f')](_0xe774('0x1b')),_0xe774('0x1c')):_0x3dee87,_0xe774('0x20')];}});}return _0x505dc9;};exports[_0xe774('0x21')]=function(_0x52c43f,_0x1f5b81){if(_['isEmpty'](_0x52c43f)){return _0x52c43f;}if(_['isArray'](_0x52c43f)){for(var _0x8561bf=0x0;_0x8561bf<_0x52c43f['length'];_0x8561bf+=0x1){_0x52c43f[_0x8561bf]=this['omit'](_0x52c43f[_0x8561bf],_0x1f5b81);}return _0x52c43f;}if(!_[_0xe774('0x22')](_0x52c43f)){return _0x52c43f;}if(_['isString'](_0x1f5b81)){_0x1f5b81=[_0x1f5b81];}if(!_[_0xe774('0x14')](_0x1f5b81)){return _0x52c43f;}for(var _0x418c4d=0x0;_0x418c4d<_0x1f5b81['length'];_0x418c4d+=0x1){_[_0xe774('0x23')](_0x52c43f,_0x1f5b81[_0x418c4d]);}for(var _0x4ce11d in _0x52c43f){if(_0x52c43f[_0xe774('0x24')](_0x4ce11d)){_0x52c43f[_0x4ce11d]=this[_0xe774('0x21')](_0x52c43f[_0x4ce11d],_0x1f5b81);}}return _0x52c43f;};exports[_0xe774('0x25')]=function(_0x35de3a){return _0x35de3a[_0xe774('0x26')](RegExp(_0xe774('0x27')))?!![]:![];};exports['isEmail']=function(_0x3365c4){return _0x3365c4[_0xe774('0x26')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x543ffc,_0x481ab3){var _0x2cd8a1=[];var _0x5f0ae5=/[ `!@#$%^&*()_\-?~]/;var _0x1fb455=_0x481ab3?_0xe774('0x28'):_0xe774('0x29');_0x543ffc[_0xe774('0x15')](/[ ,]+/)[_0xe774('0x2a')](function(_0x5a9858){_0x5a9858=_0x5a9858['replace'](/([^:]")"+/g,'$1');_0x5a9858='+'+_0x5a9858+'*';var _0x3b55bf=_0x5a9858[_0xe774('0x26')](_0x5f0ae5);if(_0x3b55bf){_0x5a9858='\x22'+_0x5a9858+'\x22';}_0x2cd8a1[_0xe774('0x2b')](_0x5a9858);});_0x1fb455=_0x1fb455['replace'](_0xe774('0x29'),_0x2cd8a1['join']('\x20'));return _0x1fb455;};exports[_0xe774('0x2c')]=function(_0x3a3665,_0x5ebfe8,_0x12c532){var _0x135d55={},_0x487080={};if(_0x5ebfe8['query'][_0xe774('0x2d')]){_0x5ebfe8[_0xe774('0x2e')]['id']=_0x5ebfe8['query'][_0xe774('0x2d')];delete _0x5ebfe8[_0xe774('0x2e')][_0xe774('0x2d')];}_0x135d55[_0xe774('0x2f')]=_[_0xe774('0x18')](_0x3a3665,_0xe774('0x30'));_0x135d55['query']=_[_0xe774('0x4')](_0x5ebfe8[_0xe774('0x2e')]);_0x135d55[_0xe774('0x6')]=_[_0xe774('0x31')](_0x135d55[_0xe774('0x2f')],_0x135d55[_0xe774('0x2e')]);_0x487080[_0xe774('0x32')]=_['intersection'](_0x135d55['model'],this[_0xe774('0x33')](_0x5ebfe8['query'][_0xe774('0x33')]));_0x487080['attributes']=_0x487080['attributes'][_0xe774('0x34')]?_0x487080[_0xe774('0x32')]:_0x135d55[_0xe774('0x2f')];if(!_0x5ebfe8[_0xe774('0x2e')][_0xe774('0x24')]('nolimit')){_0x487080[_0xe774('0x35')]=this['limit'](_0x5ebfe8[_0xe774('0x2e')]['limit']);_0x487080[_0xe774('0x16')]=this[_0xe774('0x16')](_0x5ebfe8[_0xe774('0x2e')]['offset']);}_0x487080[_0xe774('0x36')]=this[_0xe774('0x17')](_0x5ebfe8[_0xe774('0x2e')][_0xe774('0x17')]);_0x487080[_0xe774('0x37')]=this[_0xe774('0x6')](_[_0xe774('0x38')](_0x5ebfe8[_0xe774('0x2e')],_0x135d55[_0xe774('0x6')]),_0x3a3665);if(_0x5ebfe8[_0xe774('0x2e')][_0xe774('0x39')]){var _0x1c913c=_0x3a3665;var _0x6cb799=_0x5ebfe8[_0xe774('0x2e')][_0xe774('0x39')];if(typeof _0x6cb799===_0xe774('0x3a')){_0x1c913c=_[_0xe774('0x39')](_0x3a3665,function(_0x35b246){return _[_0xe774('0x5')](_0x6cb799[_0xe774('0x3b')],_0x35b246[_0xe774('0x30')]);});_0x6cb799=_0x6cb799[_0xe774('0x3c')];}_0x487080[_0xe774('0x37')]=_[_0xe774('0x3d')](_0x487080[_0xe774('0x37')],{'$or':_[_0xe774('0x18')](_0x1c913c,function(_0x2af30b){if(_0x2af30b[_0xe774('0xa')]!==_0xe774('0x3e')){if(_0x12c532){return sequelize[_0xe774('0x37')](sequelize['fn'](_0xe774('0x3f'),sequelize[_0xe774('0x1f')](_0x2af30b[_0xe774('0x30')])),{'$like':sequelize['fn'](_0xe774('0x3f'),'%'+_0x5ebfe8[_0xe774('0x2e')]['filter']+'%')});}else{var _0x5f542d={};_0x5f542d[_0x2af30b[_0xe774('0x30')]]={'$like':'%'+_0x5ebfe8[_0xe774('0x2e')][_0xe774('0x39')]+'%'};return _0x5f542d;}}})});}_0x487080=_[_0xe774('0x3d')]({},_0x487080,_0x5ebfe8['options']);return _0x487080;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index cfc4955..66b1119 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 _0x3506=['faxPause','openchannelCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','value','lodash','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','ringing','voiceStatus','pause','faxStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','findOne','getAgents','map','uniq','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','find','merge','getSortedAgentsIdsByStatus','split','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','substring','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','internal'];(function(_0x16c126,_0x3c873d){var _0x2deea9=function(_0x5c4388){while(--_0x5c4388){_0x16c126['push'](_0x16c126['shift']());}};_0x2deea9(++_0x3c873d);}(_0x3506,0xba));var _0x6350=function(_0x413099,_0x5783b5){_0x413099=_0x413099-0x0;var _0x547fce=_0x3506[_0x413099];return _0x547fce;};'use strict';var _=require(_0x6350('0x0'));var jayson=require(_0x6350('0x1'));var db=require(_0x6350('0x2'))['db'];var amiClient=jayson[_0x6350('0x3')][_0x6350('0x4')]({'port':0x232a});var routingClient=jayson[_0x6350('0x3')][_0x6350('0x4')]({'port':0x232c});function isAgentPaused(_0x4ced32,_0x30a59f){var _0x256709=[_0x4ced32[_0x6350('0x5')],_0x4ced32['faxPause'],_0x4ced32[_0x6350('0x6')],_0x4ced32[_0x6350('0x7')],_0x4ced32[_0x6350('0x8')],_0x4ced32[_0x6350('0x9')],_0x4ced32[_0x6350('0xa')]];if(!_0x30a59f)return _[_0x6350('0xb')](_0x256709);var _0x2c5000=_[_0x6350('0xc')](_0x256709);return _0x2c5000['length']>0x0&&_0x2c5000[_0x6350('0xd')]<_0x256709['length']?!![]:![];}function isIdle(_0x562936){return _0x562936===_0x6350('0xe')||_0x562936===_0x6350('0xf')||_0x562936==='unavailable'||_0x562936===_0x6350('0x10')||_['isNil'](_0x562936);}function isAgentIdle(_0x4d6712){if(_0x4d6712[_0x6350('0x11')]!=='idle'&&_0x4d6712['voicePause']){_0x4d6712['voiceStatus']=_0x6350('0x12');return![];}return _[_0x6350('0xb')]([_0x4d6712['chatStatus'],_0x4d6712[_0x6350('0x13')],_0x4d6712['mailStatus'],_0x4d6712['openchannelStatus'],_0x4d6712[_0x6350('0x14')],_0x4d6712[_0x6350('0x11')],_0x4d6712[_0x6350('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x6350('0x16')](_0x6350('0x17'),{})[_0x6350('0x18')](function(_0x163675){if(_0x163675[_0x6350('0x19')]){throw new Error(_0x6350('0x1a'));}var _0x32e3ea=_0x163675[_0x6350('0x1b')];return routingClient[_0x6350('0x16')](_0x6350('0x17'),{})['then'](function(_0x2d839c){if(_0x2d839c[_0x6350('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1cda79=_0x2d839c[_0x6350('0x1b')];return _['merge']({},_0x32e3ea,_0x1cda79);});})[_0x6350('0x1c')](function(_0x111d2b){throw _0x111d2b;});}exports[_0x6350('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x2ac85d){var _0x206605=_0x6350('0xf');if(isAgentPaused(_0x2ac85d))_0x206605=_0x6350('0x12');else if(isAgentPaused(_0x2ac85d,!![]))_0x206605='*pause';else if(isAgentIdle(_0x2ac85d))_0x206605=_0x6350('0xe');else _0x206605=_0x6350('0x1e');return _0x206605;}exports[_0x6350('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0xa063d0,_0x35d5db){var _0x26d014=_[_0x6350('0x20')](_0xa063d0)?_0xa063d0:[_0xa063d0];var _0x3a530c=_[_0x6350('0x21')](_0x35d5db)+'Queue';var _0x5bfc65=_['map'](_0x26d014,function(_0x100a09){return db[_0x3a530c][_0x6350('0x22')]({'where':{'id':_0x100a09}})[_0x6350('0x18')](function(_0x3687a9){if(!_0x3687a9)return[];return _0x3687a9[_0x6350('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x5bfc65)[_0x6350('0x18')](function(_0xbb03e){var _0x4151f1=_(_0xbb03e)['flatten']()[_0x6350('0x24')]('id')[_0x6350('0x25')]()['value']();return _0x4151f1;});}exports[_0x6350('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x6b1539,_0x44f8e1,_0x2f6669){try{if(_0x44f8e1['length']>0x0){_0x6b1539=_0x6b1539[_0x6350('0xc')](function(_0xec5732){return _0x44f8e1[_0x6350('0x27')](_0xec5732['id']);});}var _0x50c62b=_0x6b1539[_0x6350('0xc')](function(_0x45ad02){var _0x357700=_0x6350('0x1e');if(isAgentIdle(_0x45ad02)){_0x357700=_0x6350('0xe');}return _0x357700===_0x2f6669;});return _[_0x6350('0x24')](_0x50c62b,'id');}catch(_0x269a94){throw _0x269a94;}}exports[_0x6350('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xc93732,_0x2307bf,_0x165d81){return Promise['resolve']()[_0x6350('0x18')](function(){if(_0x2307bf[_0x6350('0xd')]>0x0){_0xc93732=_0xc93732[_0x6350('0xc')](function(_0x17afe1){return _0x2307bf['includes'](_0x17afe1['id']);});}return _0xc93732;})[_0x6350('0x18')](function(){return db[_0x6350('0x29')][_0x6350('0x2a')]({'attributes':['id',_0x6350('0x2b'),_0x6350('0x2c'),'chatPause','faxPause',_0x6350('0x6'),_0x6350('0x7'),'smsPause',_0x6350('0x9'),_0x6350('0xa'),'pauseType'],'where':{'id':{'$in':_[_0x6350('0x24')](_0xc93732,'id')}},'raw':!![]});})[_0x6350('0x18')](function(_0x7a5a01){return _0x7a5a01[_0x6350('0x24')](function(_0xb4820c){var _0x518930=_[_0x6350('0x2d')](_0xc93732,['id',_0xb4820c['id']]);var _0x5b4501=filterAgentAttributes(_0x518930);_[_0x6350('0x2e')](_0xb4820c,_0x5b4501);_0xb4820c['globalStatus']=getAgentStatus(_0xb4820c);return _0xb4820c;});})[_0x6350('0x18')](function(_0x5380cf){var _0x225d55=sortAgentsByStatus(_0x5380cf,_0x165d81);return _[_0x6350('0x24')](_0x225d55,'id');})[_0x6350('0x1c')](function(_0x4b231f){throw _0x4b231f;});}exports[_0x6350('0x2f')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2535db){var _0x502ed8={'fields':[],'order':null};var _0x57e0ef=_0x2535db[_0x6350('0x30')](',');_0x502ed8['fields']=_[_0x6350('0xc')](_0x57e0ef,function(_0x3da08b){if(!_0x3da08b[_0x6350('0x27')](_0x6350('0x31'))){return!![];}_0x502ed8[_0x6350('0x32')]=_[_0x6350('0x33')](_0x3da08b,'-')?'DESC':_0x6350('0x34');return![];});return _0x502ed8;}exports[_0x6350('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x262e31){if(_0x262e31['includes'](_0x6350('0x2c'))&&!_0x262e31[_0x6350('0x27')]('internal')){var _0x287dd8=_0x262e31[_0x6350('0x36')](0x0,_0x262e31['indexOf'](_0x6350('0x2c')));_0x262e31+=','+_0x287dd8+'internal';}return _0x262e31;}exports[_0x6350('0x37')]=validateSortParameter;function sortAgentsByStatus(_0x2677b3,_0x2b39f0){var _0x421489=_0x2677b3[_0x6350('0x38')](function(_0x1f7334,_0x4e4078){if(_0x1f7334[_0x6350('0x31')]===_0x4e4078['globalStatus']){if(_0x1f7334[_0x6350('0x31')]===_0x6350('0x12')){if(_0x2b39f0===_0x6350('0x39')){return(_0x1f7334[_0x6350('0x3a')]||'')<(_0x4e4078['pauseType']||'')||_0x1f7334[_0x6350('0x2c')]['toLowerCase']()>_0x4e4078['fullname'][_0x6350('0x3b')]()?0x1:-0x1;}else{return(_0x1f7334[_0x6350('0x3a')]||'')<(_0x4e4078[_0x6350('0x3a')]||'')||_0x1f7334[_0x6350('0x2c')]['toLowerCase']()>_0x4e4078[_0x6350('0x2c')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x2b39f0==='DESC'){return _0x1f7334['fullname'][_0x6350('0x3b')]()<_0x4e4078[_0x6350('0x2c')][_0x6350('0x3b')]()?0x1:-0x1;}else{return _0x1f7334[_0x6350('0x2c')][_0x6350('0x3b')]()<_0x4e4078[_0x6350('0x2c')][_0x6350('0x3b')]()?-0x1:0x1;}}}else{if(_0x2b39f0===_0x6350('0x39')){return _0x1f7334[_0x6350('0x31')]<_0x4e4078[_0x6350('0x31')]?0x1:-0x1;}else{return _0x1f7334['globalStatus']<_0x4e4078[_0x6350('0x31')]?-0x1:0x1;}}});return _0x421489;}exports[_0x6350('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x81ba54){var _0x2f1109=[_0x6350('0x3d'),_0x6350('0x3e'),_0x6350('0x3f'),'lastPauseAt',_0x6350('0x3a'),_0x6350('0x40'),_0x6350('0x41'),'address',_0x6350('0x5'),_0x6350('0x7'),'mailPause',_0x6350('0x8'),_0x6350('0xa'),_0x6350('0x42'),_0x6350('0x9'),'chatCapacity',_0x6350('0x43'),'mailCapacity','smsCapacity',_0x6350('0x44'),'faxCapacity',_0x6350('0x45'),_0x6350('0x46'),'mailCurrentCapacity',_0x6350('0x47'),_0x6350('0x48'),_0x6350('0x49'),_0x6350('0x4a'),_0x6350('0x4b'),'mailStatus',_0x6350('0x14'),_0x6350('0x15'),'faxStatus',_0x6350('0x11'),'chatStatusTime',_0x6350('0x4c'),'mailStatusTime',_0x6350('0x4d'),_0x6350('0x4e'),_0x6350('0x4f'),'voiceStatusTime',_0x6350('0x50'),'destconnectedlinenum','screenrecording',_0x6350('0x51'),_0x6350('0x52'),'routealias'];var _0x50ad92=[_0x6350('0x5'),_0x6350('0x7'),_0x6350('0x6'),_0x6350('0x8'),_0x6350('0xa'),_0x6350('0x42'),'voicePause',_0x6350('0x3e')];var _0x4d1b8c=_(_0x81ba54)['omit'](_0x50ad92)['pick'](_0x2f1109)[_0x6350('0x53')]();return _0x4d1b8c;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0xc275=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','every','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','unknown','getAgentStatus','isArray','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','busy','getAgentIdsByStatus','resolve','User','findAll','fullname','openchannelPause','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime'];(function(_0x374627,_0x118f6c){var _0x29c435=function(_0x37ef85){while(--_0x37ef85){_0x374627['push'](_0x374627['shift']());}};_0x29c435(++_0x118f6c);}(_0xc275,0x6f));var _0x5c27=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xc275[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x5c27('0x0'));var jayson=require(_0x5c27('0x1'));var db=require(_0x5c27('0x2'))['db'];var amiClient=jayson[_0x5c27('0x3')][_0x5c27('0x4')]({'port':0x232a});var routingClient=jayson[_0x5c27('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x4dee55,_0x8840e3){var _0x2a6a48=[_0x4dee55[_0x5c27('0x5')],_0x4dee55['faxPause'],_0x4dee55[_0x5c27('0x6')],_0x4dee55['openchannelPause'],_0x4dee55[_0x5c27('0x7')],_0x4dee55[_0x5c27('0x8')],_0x4dee55[_0x5c27('0x9')]];if(!_0x8840e3)return _['every'](_0x2a6a48);var _0x431e16=_[_0x5c27('0xa')](_0x2a6a48);return _0x431e16[_0x5c27('0xb')]>0x0&&_0x431e16['length']<_0x2a6a48['length']?!![]:![];}function isIdle(_0x37d11b){return _0x37d11b===_0x5c27('0xc')||_0x37d11b==='unknown'||_0x37d11b===_0x5c27('0xd')||_0x37d11b===_0x5c27('0xe')||_[_0x5c27('0xf')](_0x37d11b);}function isAgentIdle(_0xde4c82){if(_0xde4c82[_0x5c27('0x10')]!=='idle'&&_0xde4c82[_0x5c27('0x8')]){_0xde4c82[_0x5c27('0x10')]=_0x5c27('0x11');return![];}return _[_0x5c27('0x12')]([_0xde4c82[_0x5c27('0x13')],_0xde4c82[_0x5c27('0x14')],_0xde4c82['mailStatus'],_0xde4c82[_0x5c27('0x15')],_0xde4c82[_0x5c27('0x16')],_0xde4c82[_0x5c27('0x10')],_0xde4c82[_0x5c27('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x5c27('0x18')]('Agents',{})[_0x5c27('0x19')](function(_0x25ebe9){if(_0x25ebe9['error']){throw new Error(_0x5c27('0x1a'));}var _0x3e39f4=_0x25ebe9[_0x5c27('0x1b')];return routingClient['request'](_0x5c27('0x1c'),{})[_0x5c27('0x19')](function(_0x1fa526){if(_0x1fa526[_0x5c27('0x1d')]){throw new Error(_0x5c27('0x1e'));}var _0x159d54=_0x1fa526[_0x5c27('0x1b')];return _[_0x5c27('0x1f')]({},_0x3e39f4,_0x159d54);});})[_0x5c27('0x20')](function(_0x5c0c97){throw _0x5c0c97;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x55bbe8){var _0x50866e=_0x5c27('0x21');if(isAgentPaused(_0x55bbe8))_0x50866e=_0x5c27('0x11');else if(isAgentPaused(_0x55bbe8,!![]))_0x50866e='*pause';else if(isAgentIdle(_0x55bbe8))_0x50866e=_0x5c27('0xc');else _0x50866e='busy';return _0x50866e;}exports[_0x5c27('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x4a131a,_0x1b2551){var _0x35bb3c=_[_0x5c27('0x23')](_0x4a131a)?_0x4a131a:[_0x4a131a];var _0x5c1b08=_['startCase'](_0x1b2551)+'Queue';var _0x2a5979=_[_0x5c27('0x24')](_0x35bb3c,function(_0x4b6df2){return db[_0x5c1b08][_0x5c27('0x25')]({'where':{'id':_0x4b6df2}})[_0x5c27('0x19')](function(_0x58522c){if(!_0x58522c)return[];return _0x58522c[_0x5c27('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x5c27('0x27')](_0x2a5979)[_0x5c27('0x19')](function(_0x5da9ce){var _0x48a1a0=_(_0x5da9ce)[_0x5c27('0x28')]()[_0x5c27('0x24')]('id')[_0x5c27('0x29')]()[_0x5c27('0x2a')]();return _0x48a1a0;});}exports[_0x5c27('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x73683f,_0x22558f,_0x30ea71){try{if(_0x22558f['length']>0x0){_0x73683f=_0x73683f['filter'](function(_0x5aef24){return _0x22558f[_0x5c27('0x2c')](_0x5aef24['id']);});}var _0x3d6e05=_0x73683f[_0x5c27('0xa')](function(_0x548673){var _0x2869fc=_0x5c27('0x2d');if(isAgentIdle(_0x548673)){_0x2869fc=_0x5c27('0xc');}return _0x2869fc===_0x30ea71;});return _[_0x5c27('0x24')](_0x3d6e05,'id');}catch(_0x3915af){throw _0x3915af;}}exports[_0x5c27('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x59e540,_0x202cbe,_0x486dfa){return Promise[_0x5c27('0x2f')]()['then'](function(){if(_0x202cbe[_0x5c27('0xb')]>0x0){_0x59e540=_0x59e540['filter'](function(_0xdaea){return _0x202cbe[_0x5c27('0x2c')](_0xdaea['id']);});}return _0x59e540;})[_0x5c27('0x19')](function(){return db[_0x5c27('0x30')][_0x5c27('0x31')]({'attributes':['id','name',_0x5c27('0x32'),_0x5c27('0x5'),'faxPause',_0x5c27('0x6'),_0x5c27('0x33'),_0x5c27('0x7'),_0x5c27('0x8'),_0x5c27('0x9'),'pauseType'],'where':{'id':{'$in':_[_0x5c27('0x24')](_0x59e540,'id')}},'raw':!![]});})['then'](function(_0x53ac0b){return _0x53ac0b[_0x5c27('0x24')](function(_0x79846b){var _0x3086f7=_[_0x5c27('0x34')](_0x59e540,['id',_0x79846b['id']]);var _0x1cf24d=filterAgentAttributes(_0x3086f7);_['merge'](_0x79846b,_0x1cf24d);_0x79846b['globalStatus']=getAgentStatus(_0x79846b);return _0x79846b;});})[_0x5c27('0x19')](function(_0x360751){var _0x2c1b87=sortAgentsByStatus(_0x360751,_0x486dfa);return _[_0x5c27('0x24')](_0x2c1b87,'id');})[_0x5c27('0x20')](function(_0x42b64f){throw _0x42b64f;});}exports[_0x5c27('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x50b6b8){var _0x153397={'fields':[],'order':null};var _0x3a97aa=_0x50b6b8[_0x5c27('0x36')](',');_0x153397[_0x5c27('0x37')]=_[_0x5c27('0xa')](_0x3a97aa,function(_0x2d6f02){if(!_0x2d6f02['includes'](_0x5c27('0x38'))){return!![];}_0x153397[_0x5c27('0x39')]=_[_0x5c27('0x3a')](_0x2d6f02,'-')?'DESC':_0x5c27('0x3b');return![];});return _0x153397;}exports[_0x5c27('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x5766b3){if(_0x5766b3[_0x5c27('0x2c')](_0x5c27('0x32'))&&!_0x5766b3[_0x5c27('0x2c')](_0x5c27('0x3d'))){var _0x7c17a1=_0x5766b3[_0x5c27('0x3e')](0x0,_0x5766b3[_0x5c27('0x3f')](_0x5c27('0x32')));_0x5766b3+=','+_0x7c17a1+'internal';}return _0x5766b3;}exports[_0x5c27('0x40')]=validateSortParameter;function sortAgentsByStatus(_0x45e8b7,_0x312375){var _0x215f19=_0x45e8b7[_0x5c27('0x41')](function(_0x47d24c,_0x318cac){if(_0x47d24c[_0x5c27('0x38')]===_0x318cac[_0x5c27('0x38')]){if(_0x47d24c[_0x5c27('0x38')]===_0x5c27('0x11')){if(_0x312375===_0x5c27('0x42')){return(_0x47d24c[_0x5c27('0x43')]||'')<(_0x318cac['pauseType']||'')||_0x47d24c[_0x5c27('0x32')]['toLowerCase']()>_0x318cac[_0x5c27('0x32')][_0x5c27('0x44')]()?0x1:-0x1;}else{return(_0x47d24c[_0x5c27('0x43')]||'')<(_0x318cac['pauseType']||'')||_0x47d24c[_0x5c27('0x32')][_0x5c27('0x44')]()>_0x318cac['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x312375===_0x5c27('0x42')){return _0x47d24c[_0x5c27('0x32')]['toLowerCase']()<_0x318cac[_0x5c27('0x32')][_0x5c27('0x44')]()?0x1:-0x1;}else{return _0x47d24c[_0x5c27('0x32')][_0x5c27('0x44')]()<_0x318cac[_0x5c27('0x32')][_0x5c27('0x44')]()?-0x1:0x1;}}}else{if(_0x312375===_0x5c27('0x42')){return _0x47d24c[_0x5c27('0x38')]<_0x318cac[_0x5c27('0x38')]?0x1:-0x1;}else{return _0x47d24c[_0x5c27('0x38')]<_0x318cac[_0x5c27('0x38')]?-0x1:0x1;}}});return _0x215f19;}exports[_0x5c27('0x45')]=sortAgentsByStatus;function filterAgentAttributes(_0x59013f){var _0x13e516=['userpic',_0x5c27('0x46'),_0x5c27('0x47'),'lastPauseAt',_0x5c27('0x43'),_0x5c27('0x48'),_0x5c27('0x3d'),_0x5c27('0x49'),_0x5c27('0x5'),'openchannelPause',_0x5c27('0x6'),_0x5c27('0x7'),_0x5c27('0x9'),_0x5c27('0x4a'),_0x5c27('0x8'),_0x5c27('0x4b'),_0x5c27('0x4c'),_0x5c27('0x4d'),_0x5c27('0x4e'),_0x5c27('0x4f'),'faxCapacity',_0x5c27('0x50'),_0x5c27('0x51'),_0x5c27('0x52'),_0x5c27('0x53'),_0x5c27('0x54'),_0x5c27('0x55'),_0x5c27('0x13'),_0x5c27('0x15'),'mailStatus','smsStatus',_0x5c27('0x17'),'faxStatus',_0x5c27('0x10'),_0x5c27('0x56'),_0x5c27('0x57'),_0x5c27('0x58'),_0x5c27('0x59'),_0x5c27('0x5a'),_0x5c27('0x5b'),_0x5c27('0x5c'),'queue',_0x5c27('0x5d'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x5c27('0x5e'),_0x5c27('0x5f')];var _0x225afb=[_0x5c27('0x5'),_0x5c27('0x33'),'mailPause',_0x5c27('0x7'),_0x5c27('0x9'),'faxPause',_0x5c27('0x8'),_0x5c27('0x46')];var _0xda8e1e=_(_0x59013f)[_0x5c27('0x60')](_0x225afb)[_0x5c27('0x61')](_0x13e516)['value']();return _0xda8e1e;}exports[_0x5c27('0x62')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 4e3a0e3..493565e 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8af=['dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','voice','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','paused','waiting','talking','outbound','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','busy','invalid','notInUse','onHold','ringing','ringInUse','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold'];(function(_0x380866,_0x26b04d){var _0x103d1f=function(_0x307449){while(--_0x307449){_0x380866['push'](_0x380866['shift']());}};_0x103d1f(++_0x26b04d);}(_0xb8af,0xdc));var _0xfb8a=function(_0x521b91,_0x512693){_0x521b91=_0x521b91-0x0;var _0x1a32af=_0xb8af[_0x521b91];return _0x1a32af;};'use strict';var _=require(_0xfb8a('0x0'));var jayson=require(_0xfb8a('0x1'));var util=require('util');var amiClient=jayson[_0xfb8a('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xfb8a('0x2')][_0xfb8a('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xfb8a('0x4'),_0xfb8a('0x5'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xfb8a('0x6'),'inUse',_0xfb8a('0x7'),'loggedInDb',_0xfb8a('0x8'),_0xfb8a('0x9'),_0xfb8a('0xa'),_0xfb8a('0xb'),'talking','unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xfb8a('0xc'),_0xfb8a('0xd'),_0xfb8a('0xe'),_0xfb8a('0xf'),_0xfb8a('0x10'),_0xfb8a('0x11'),_0xfb8a('0x12'),_0xfb8a('0x13'),_0xfb8a('0x14'),_0xfb8a('0x15'),'erlangCallToSecond','erlangAbandonmentRate',_0xfb8a('0x16'),_0xfb8a('0x17'),_0xfb8a('0x18'),_0xfb8a('0x19'),_0xfb8a('0x1a'),_0xfb8a('0x1b'),_0xfb8a('0x1c'),_0xfb8a('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0xfb8a('0x1e'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x271a91,_0x5b20ce){var _0x1aaf7e=_0x5b20ce===_0xfb8a('0x1f')?amiClient:routingClient;return _0x1aaf7e['request'](_['startCase'](_0x5b20ce)+_0xfb8a('0x20'),_0x271a91)[_0xfb8a('0x21')](function(_0x18d140){if(_0x18d140[_0xfb8a('0x22')])throw new Error(util[_0xfb8a('0x23')](_0xfb8a('0x24'),_0x5b20ce));return _0x18d140[_0xfb8a('0x25')];})[_0xfb8a('0x26')](function(_0x359e17){throw _0x359e17;});}exports[_0xfb8a('0x27')]=getRealtimeQueues;function initializeQueues(_0x1ddec5,_0x4f8689,_0xca587d,_0x1491ab){var _0x3691eb=DEFAULT_QUEUE_ATTRIBUTES;if(_0xca587d===_0xfb8a('0x1f')){if(_0x1491ab===_0xfb8a('0x28')){_0x3691eb=_0x3691eb[_0xfb8a('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1491ab==='outbound'){_0x3691eb=_0x3691eb[_0xfb8a('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1ddec5['map'](function(_0x577e99){var _0x13062b=_0x577e99['get']({'plain':!![]});_0x13062b[_0xfb8a('0x2a')]=0x0;_0x13062b['loggedInDb']=0x0;_0x13062b[_0xfb8a('0x5')]=0x0;_0x13062b['available']=0x0;_0x13062b[_0xfb8a('0x2b')]=0x0;if(_0xca587d===_0xfb8a('0x1f')){_0x13062b[_0xfb8a('0x2c')]=0x0;_0x13062b[_0xfb8a('0x6')]=0x0;if(_0x1491ab===_0xfb8a('0x2d')){_0x13062b[_0xfb8a('0xc')]=0x0;_0x13062b[_0xfb8a('0xd')]=0x0;}}var _0x2fe557=_['find'](_0x4f8689,['id',_0x13062b['id']]);if(_0x2fe557){_[_0xfb8a('0x2e')](_0x13062b,_[_0xfb8a('0x2f')](_0x2fe557,_0x3691eb));}return _0x13062b;});}exports[_0xfb8a('0x30')]=initializeQueues; \ No newline at end of file +var _0xbf23=['predictiveIntervalAvgTalktime','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','voice','inbound','concat','map','get','find','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','paused','waiting','busy','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf23,0x131));var _0x3bf2=function(_0x4be3f3,_0x20efd7){_0x4be3f3=_0x4be3f3-0x0;var _0x5278b3=_0xbf23[_0x4be3f3];return _0x5278b3;};'use strict';var _=require(_0x3bf2('0x0'));var jayson=require(_0x3bf2('0x1'));var util=require('util');var amiClient=jayson[_0x3bf2('0x2')][_0x3bf2('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x3bf2('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x3bf2('0x4'),_0x3bf2('0x5'),_0x3bf2('0x6'),_0x3bf2('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x3bf2('0x8'),'inUse',_0x3bf2('0x9'),_0x3bf2('0xa'),_0x3bf2('0xb'),_0x3bf2('0xc'),'ringing',_0x3bf2('0xd'),_0x3bf2('0xe'),'unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x3bf2('0xf'),_0x3bf2('0x10'),'message',_0x3bf2('0x11'),_0x3bf2('0x12'),_0x3bf2('0x13'),_0x3bf2('0x14'),_0x3bf2('0x15'),_0x3bf2('0x16'),'erlangCalls','erlangCallToSecond',_0x3bf2('0x17'),'erlangBusyFactor',_0x3bf2('0x18'),_0x3bf2('0x19'),_0x3bf2('0x1a'),_0x3bf2('0x1b'),'predictiveIntervalTotalCalls',_0x3bf2('0x1c'),_0x3bf2('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0x3bf2('0x1e'),_0x3bf2('0x1f')];function getRealtimeQueues(_0x270509,_0x58a4b6){var _0x31fbac=_0x58a4b6==='voice'?amiClient:routingClient;return _0x31fbac[_0x3bf2('0x20')](_[_0x3bf2('0x21')](_0x58a4b6)+_0x3bf2('0x22'),_0x270509)['then'](function(_0x3df871){if(_0x3df871[_0x3bf2('0x23')])throw new Error(util[_0x3bf2('0x24')](_0x3bf2('0x25'),_0x58a4b6));return _0x3df871[_0x3bf2('0x26')];})['catch'](function(_0x3fc7d1){throw _0x3fc7d1;});}exports[_0x3bf2('0x27')]=getRealtimeQueues;function initializeQueues(_0x1a546a,_0x560849,_0x10f771,_0x3dec52){var _0x3aa235=DEFAULT_QUEUE_ATTRIBUTES;if(_0x10f771===_0x3bf2('0x28')){if(_0x3dec52===_0x3bf2('0x29')){_0x3aa235=_0x3aa235[_0x3bf2('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3dec52==='outbound'){_0x3aa235=_0x3aa235[_0x3bf2('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1a546a[_0x3bf2('0x2b')](function(_0x4e5c52){var _0x487c0f=_0x4e5c52[_0x3bf2('0x2c')]({'plain':!![]});_0x487c0f['paused']=0x0;_0x487c0f[_0x3bf2('0xa')]=0x0;_0x487c0f['loggedIn']=0x0;_0x487c0f[_0x3bf2('0x4')]=0x0;_0x487c0f['waiting']=0x0;if(_0x10f771===_0x3bf2('0x28')){_0x487c0f[_0x3bf2('0xe')]=0x0;_0x487c0f['busy']=0x0;if(_0x3dec52==='outbound'){_0x487c0f[_0x3bf2('0xf')]=0x0;_0x487c0f[_0x3bf2('0x10')]=0x0;}}var _0x34e048=_[_0x3bf2('0x2d')](_0x560849,['id',_0x487c0f['id']]);if(_0x34e048){_['merge'](_0x487c0f,_[_0x3bf2('0x2e')](_0x34e048,_0x3aa235));}return _0x487c0f;});}exports[_0x3bf2('0x2f')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index bc03ee8..5f19f84 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(_0x1b2704,_0x345e20){var _0x4e3e41=function(_0x480222){while(--_0x480222){_0x1b2704['push'](_0x1b2704['shift']());}};_0x4e3e41(++_0x345e20);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x55fcfe,_0x55fc30){var _0x170825=function(_0x11d637){while(--_0x11d637){_0x55fcfe['push'](_0x55fcfe['shift']());}};_0x170825(++_0x55fc30);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 589145f..baa070c 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 _0x9eb1=['createHash','update','digest','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','head','mac','address','127.0.0.1','getFirstInterface','cpus','map'];(function(_0x1c375f,_0x5ae110){var _0x208a69=function(_0x26f662){while(--_0x26f662){_0x1c375f['push'](_0x1c375f['shift']());}};_0x208a69(++_0x5ae110);}(_0x9eb1,0x175));var _0x19eb=function(_0x25207d,_0x5cce53){_0x25207d=_0x25207d-0x0;var _0x547923=_0x9eb1[_0x25207d];return _0x547923;};'use strict';var _=require(_0x19eb('0x0'));var os=require('os');var crypto=require(_0x19eb('0x1'));var machine=require(_0x19eb('0x2'));var exec=require(_0x19eb('0x3'))[_0x19eb('0x4')];var config=require('../environment');function getInterfaces(){var _0x9bcea6=[];var _0x503448=os[_0x19eb('0x5')]();var _0x1e2130=_[_0x19eb('0x6')](_[_0x19eb('0x7')](_0x503448));for(var _0x5cb7ea=0x0;_0x5cb7ea<_0x1e2130['length'];_0x5cb7ea++){var _0x541dc5=_0x503448[_0x1e2130[_0x5cb7ea]][_0x19eb('0x8')](function(_0x12ff31){return _0x12ff31[_0x19eb('0x9')]==='IPv4'&&_0x12ff31['internal']===![];});_0x9bcea6=_0x9bcea6['concat'](_0x541dc5);}return _0x9bcea6;}function getFirstInterface(){var _0x3db04a=_[_0x19eb('0xa')](getInterfaces());return{'macAddress':_0x3db04a&&_0x3db04a[_0x19eb('0xb')]?_0x3db04a['mac']:'00:00:00:00:00:00','ipAddress':_0x3db04a&&_0x3db04a[_0x19eb('0xc')]?_0x3db04a[_0x19eb('0xc')]:_0x19eb('0xd')};}exports[_0x19eb('0xe')]=getFirstInterface;function getCPUhash(){var _0x34b135=_[_0x19eb('0x6')](os[_0x19eb('0xf')]()[_0x19eb('0x10')](function(_0x214c12){return _0x214c12['model'];}))['join'](':');return crypto[_0x19eb('0x11')]('md5')[_0x19eb('0x12')](_0x34b135)[_0x19eb('0x13')](_0x19eb('0x14'));}exports[_0x19eb('0x15')]=function(){var _0x1f8a83=os['platform']();var _0x89a56d=/[0-9a-f-]{36}/;if(config[_0x19eb('0x16')]&&_0x89a56d[_0x19eb('0x17')](config[_0x19eb('0x16')])){return config[_0x19eb('0x16')];}else if(_0x1f8a83==='win32'){return exec(_0x19eb('0x18'),{'encoding':_0x19eb('0x19')})[_0x19eb('0x1a')]('\x0d\x0a','');}else{var _0x539a9a=getFirstInterface();var _0x1e0c1e=getCPUhash();var _0x1d4606=_0x1e0c1e+'|'+os['hostname']()+'|'+_0x539a9a['macAddress']+'|'+_0x539a9a[_0x19eb('0x1b')];var _0x25b3a5=crypto[_0x19eb('0x11')](_0x19eb('0x1c'))[_0x19eb('0x12')](_0x1d4606)[_0x19eb('0x13')](_0x19eb('0x14'));return _0x25b3a5[_0x19eb('0x1d')](0x0,0x8)+'-'+_0x25b3a5[_0x19eb('0x1d')](0x8,0xc)+'-'+_0x25b3a5[_0x19eb('0x1d')](0xc,0x10)+'-'+_0x25b3a5[_0x19eb('0x1d')](0x10,0x14)+'-'+_0x25b3a5[_0x19eb('0x1d')](0x14);}}; \ No newline at end of file +var _0x715f=['00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','createHash','md5','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','head','mac'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x715f,0x85));var _0xf715=function(_0x2887b2,_0x588e01){_0x2887b2=_0x2887b2-0x0;var _0x18340e=_0x715f[_0x2887b2];return _0x18340e;};'use strict';var _=require(_0xf715('0x0'));var os=require('os');var crypto=require(_0xf715('0x1'));var machine=require(_0xf715('0x2'));var exec=require(_0xf715('0x3'))[_0xf715('0x4')];var config=require(_0xf715('0x5'));function getInterfaces(){var _0x20a745=[];var _0x4e5db7=os[_0xf715('0x6')]();var _0x2c58e1=_[_0xf715('0x7')](_[_0xf715('0x8')](_0x4e5db7));for(var _0x5c25b1=0x0;_0x5c25b1<_0x2c58e1[_0xf715('0x9')];_0x5c25b1++){var _0x76e84=_0x4e5db7[_0x2c58e1[_0x5c25b1]][_0xf715('0xa')](function(_0x1f9559){return _0x1f9559[_0xf715('0xb')]===_0xf715('0xc')&&_0x1f9559['internal']===![];});_0x20a745=_0x20a745['concat'](_0x76e84);}return _0x20a745;}function getFirstInterface(){var _0x2f141f=_[_0xf715('0xd')](getInterfaces());return{'macAddress':_0x2f141f&&_0x2f141f[_0xf715('0xe')]?_0x2f141f[_0xf715('0xe')]:_0xf715('0xf'),'ipAddress':_0x2f141f&&_0x2f141f[_0xf715('0x10')]?_0x2f141f[_0xf715('0x10')]:_0xf715('0x11')};}exports[_0xf715('0x12')]=getFirstInterface;function getCPUhash(){var _0x2d2263=_[_0xf715('0x7')](os[_0xf715('0x13')]()['map'](function(_0x431fd9){return _0x431fd9[_0xf715('0x14')];}))['join'](':');return crypto[_0xf715('0x15')](_0xf715('0x16'))['update'](_0x2d2263)[_0xf715('0x17')](_0xf715('0x18'));}exports[_0xf715('0x19')]=function(){var _0x38f37e=os['platform']();var _0x2170cb=/[0-9a-f-]{36}/;if(config[_0xf715('0x1a')]&&_0x2170cb[_0xf715('0x1b')](config[_0xf715('0x1a')])){return config['licenseToken'];}else if(_0x38f37e===_0xf715('0x1c')){return exec(_0xf715('0x1d'),{'encoding':_0xf715('0x1e')})[_0xf715('0x1f')]('\x0d\x0a','');}else{var _0x446181=getFirstInterface();var _0x14f176=getCPUhash();var _0x34f2e2=_0x14f176+'|'+os[_0xf715('0x20')]()+'|'+_0x446181[_0xf715('0x21')]+'|'+_0x446181[_0xf715('0x22')];var _0x525912=crypto[_0xf715('0x15')](_0xf715('0x16'))[_0xf715('0x23')](_0x34f2e2)[_0xf715('0x17')](_0xf715('0x18'));return _0x525912[_0xf715('0x24')](0x0,0x8)+'-'+_0x525912[_0xf715('0x24')](0x8,0xc)+'-'+_0x525912[_0xf715('0x24')](0xc,0x10)+'-'+_0x525912[_0xf715('0x24')](0x10,0x14)+'-'+_0x525912['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 13697f1..6a446fe 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 _0x0615=['DEMO\x20START\x20AT\x20%s','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x0615,0x1f3));var _0x5061=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0615[_0x126558];return _0x1f6d14;};'use strict';var util=require(_0x5061('0x0'));var moment=require(_0x5061('0x1'));var rp=require(_0x5061('0x2'));var BPromise=require(_0x5061('0x3'));var pkginfo=require(_0x5061('0x4'))(module,'version');var db=require(_0x5061('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x5061('0x6'));var logger=require(_0x5061('0x7'))(_0x5061('0x8'));var HOST=_0x5061('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5c6af1){return new BPromise(function(_0x4990ba,_0x2c6a23){var _0x3b0592=util[_0x5061('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x5c6af1,module[_0x5061('0xb')][_0x5061('0xc')]);if(oldToken){_0x3b0592=util[_0x5061('0xa')](_0x5061('0xd'),HOST,_0x5c6af1,module['exports'][_0x5061('0xc')],oldToken);}var _0x12966f={'uri':_0x3b0592,'method':_0x5061('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x12966f)['then'](function(_0xb557bf){_0x4990ba(_0xb557bf);})[_0x5061('0xf')](function(_0x42031c){_0x2c6a23(_0x42031c);});});}function manageLicense(_0x20cf10,_0x7b4d26){var _0x85b208=_0x7b4d26[_0x5061('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x85b208[_0x5061('0x11')]!==_0x20cf10&&!_0x85b208[_0x5061('0x12')]){oldToken=_0x85b208[_0x5061('0x11')];}httpRequest(_0x20cf10)[_0x5061('0x13')](function(_0x3dd126){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3dd126[_0x5061('0x14')]){isOldTokenSent=![];if(!_0x85b208[_0x5061('0x8')]&&_0x85b208[_0x5061('0x8')]!=_0x3dd126[_0x5061('0x8')]||_0x85b208[_0x5061('0x8')]&&_0x85b208['data2']){logger['info'](_0x5061('0x15'));}if(_0x85b208[_0x5061('0x8')]&&!_0x85b208[_0x5061('0x12')]&&_0x85b208[_0x5061('0x8')]!=_0x3dd126['license']){logger[_0x5061('0x16')](_0x5061('0x17'));}if(_0x85b208[_0x5061('0x8')]&&!_0x85b208[_0x5061('0x12')]&&_0x85b208['license']==_0x3dd126['license']){return _0x7b4d26;}return _0x7b4d26[_0x5061('0x18')]({'data1':_0x20cf10,'data2':null,'license':_0x3dd126['license']});}else{if(_0x3dd126[_0x5061('0x8')]||_0x85b208[_0x5061('0x8')]){if(!_0x85b208['data2']){if(_0x85b208[_0x5061('0x11')]==_0x20cf10){GRAY_PERIOD_REASON=_0x5061('0x19');logger[_0x5061('0x16')](_0x5061('0x1a'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x5061('0x16')](_0x5061('0x1b'),_0x85b208[_0x5061('0x11')],_0x20cf10);}logger[_0x5061('0x16')](_0x5061('0x1c'),GRAY_PERIOD_REASON[_0x5061('0x1d')](),moment()[_0x5061('0xa')](_0x5061('0x1e')));return _0x7b4d26[_0x5061('0x18')]({'data2':encryptor[_0x5061('0x1f')](moment()['format'](_0x5061('0x1e')))});}else{if(moment()['diff'](encryptor[_0x5061('0x20')](_0x85b208[_0x5061('0x12')]),_0x5061('0x21'))>DAYS){logger[_0x5061('0x16')](_0x5061('0x22'),moment()[_0x5061('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x7b4d26[_0x5061('0x18')]({'data1':_0x20cf10,'data2':null,'license':null});}}}else{if(_0x85b208[_0x5061('0x11')]!=_0x20cf10){logger['info'](_0x5061('0x1b'),_0x85b208[_0x5061('0x11')],_0x20cf10);return _0x7b4d26[_0x5061('0x18')]({'data1':_0x20cf10,'data2':null,'license':null});}}}return _0x7b4d26;})['then'](function(_0x515a8b){_0x7b4d26=_0x515a8b;})[_0x5061('0xf')](function(_0x5d1e1d){logger['error'](_0x5d1e1d[_0x5061('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x5061('0x24')](),_0x7b4d26);},TIME);});}function defaultLicense(){var _0x13146d=hardware[_0x5061('0x24')]();if(_0x13146d){return db['License'][_0x5061('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x13146d}})[_0x5061('0x26')](function(_0x24fbeb,_0x10d85e){logger[_0x5061('0x16')](_0x5061('0x27'),_0x13146d);manageLicense(_0x13146d,_0x24fbeb);})['catch'](function(_0x83178d){logger[_0x5061('0x28')](_0x83178d[_0x5061('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x3859=['get','data1','then','info','data2','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET'];(function(_0x542c47,_0x2db9f3){var _0x2ed53b=function(_0x1dbd21){while(--_0x1dbd21){_0x542c47['push'](_0x542c47['shift']());}};_0x2ed53b(++_0x2db9f3);}(_0x3859,0x19e));var _0x9385=function(_0x7d0191,_0x16a6cd){_0x7d0191=_0x7d0191-0x0;var _0x2e852a=_0x3859[_0x7d0191];return _0x2e852a;};'use strict';var util=require(_0x9385('0x0'));var moment=require(_0x9385('0x1'));var rp=require('request-promise');var BPromise=require(_0x9385('0x2'));var pkginfo=require(_0x9385('0x3'))(module,_0x9385('0x4'));var db=require(_0x9385('0x5'))['db'];var encryptor=require(_0x9385('0x6'));var hardware=require(_0x9385('0x7'));var logger=require(_0x9385('0x8'))(_0x9385('0x9'));var HOST=_0x9385('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cf181){return new BPromise(function(_0x41775b,_0x51116d){var _0x1eb1d2=util[_0x9385('0xb')](_0x9385('0xc'),HOST,_0x1cf181,module[_0x9385('0xd')]['version']);if(oldToken){_0x1eb1d2=util[_0x9385('0xb')](_0x9385('0xe'),HOST,_0x1cf181,module[_0x9385('0xd')]['version'],oldToken);}var _0x1387c7={'uri':_0x1eb1d2,'method':_0x9385('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x1387c7)['then'](function(_0x5d5542){_0x41775b(_0x5d5542);})['catch'](function(_0x20a2b2){_0x51116d(_0x20a2b2);});});}function manageLicense(_0xbcc275,_0x4c30e7){var _0x54f972=_0x4c30e7[_0x9385('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x54f972['data1']!==_0xbcc275&&!_0x54f972['data2']){oldToken=_0x54f972[_0x9385('0x11')];}httpRequest(_0xbcc275)[_0x9385('0x12')](function(_0x2cc8f2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2cc8f2['active']){isOldTokenSent=![];if(!_0x54f972['license']&&_0x54f972[_0x9385('0x9')]!=_0x2cc8f2[_0x9385('0x9')]||_0x54f972['license']&&_0x54f972['data2']){logger[_0x9385('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x54f972[_0x9385('0x9')]&&!_0x54f972[_0x9385('0x14')]&&_0x54f972['license']!=_0x2cc8f2[_0x9385('0x9')]){logger[_0x9385('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x54f972['license']&&!_0x54f972['data2']&&_0x54f972[_0x9385('0x9')]==_0x2cc8f2['license']){return _0x4c30e7;}return _0x4c30e7[_0x9385('0x15')]({'data1':_0xbcc275,'data2':null,'license':_0x2cc8f2[_0x9385('0x9')]});}else{if(_0x2cc8f2[_0x9385('0x9')]||_0x54f972[_0x9385('0x9')]){if(!_0x54f972['data2']){if(_0x54f972[_0x9385('0x11')]==_0xbcc275){GRAY_PERIOD_REASON=_0x9385('0x16');logger[_0x9385('0x13')](_0x9385('0x17'));}else{GRAY_PERIOD_REASON=_0x9385('0x18');logger[_0x9385('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x54f972[_0x9385('0x11')],_0xbcc275);}logger['info'](_0x9385('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x9385('0x1a')));return _0x4c30e7[_0x9385('0x15')]({'data2':encryptor[_0x9385('0x1b')](moment()[_0x9385('0xb')](_0x9385('0x1a')))});}else{if(moment()[_0x9385('0x1c')](encryptor[_0x9385('0x1d')](_0x54f972[_0x9385('0x14')]),_0x9385('0x1e'))>DAYS){logger[_0x9385('0x13')](_0x9385('0x1f'),moment()[_0x9385('0xb')](_0x9385('0x1a')));isOldTokenSent=![];return _0x4c30e7[_0x9385('0x15')]({'data1':_0xbcc275,'data2':null,'license':null});}}}else{if(_0x54f972[_0x9385('0x11')]!=_0xbcc275){logger[_0x9385('0x13')](_0x9385('0x20'),_0x54f972[_0x9385('0x11')],_0xbcc275);return _0x4c30e7[_0x9385('0x15')]({'data1':_0xbcc275,'data2':null,'license':null});}}}return _0x4c30e7;})[_0x9385('0x12')](function(_0x57b8a8){_0x4c30e7=_0x57b8a8;})[_0x9385('0x21')](function(_0x2843db){logger[_0x9385('0x22')](_0x2843db['message']);})[_0x9385('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4c30e7);},TIME);});}function defaultLicense(){var _0x2890b6=hardware[_0x9385('0x24')]();if(_0x2890b6){return db[_0x9385('0x25')][_0x9385('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x2890b6}})[_0x9385('0x27')](function(_0x1d9012,_0x105b40){logger['info'](_0x9385('0x28'),_0x2890b6);manageLicense(_0x2890b6,_0x1d9012);})[_0x9385('0x21')](function(_0x569054){logger[_0x9385('0x22')](_0x569054[_0x9385('0x29')]);});}}exports[_0x9385('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d328c85..93f89fc 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 _0xea2e=['users','forEach','catch','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','machineUuid','gray','add','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','count','admin','user','telephone'];(function(_0x354b90,_0x22a39e){var _0x4be4b4=function(_0x103b3c){while(--_0x103b3c){_0x354b90['push'](_0x354b90['shift']());}};_0x4be4b4(++_0x22a39e);}(_0xea2e,0x189));var _0xeea2=function(_0x43c7a0,_0x302a63){_0x43c7a0=_0x43c7a0-0x0;var _0x56ac52=_0xea2e[_0x43c7a0];return _0x56ac52;};'use strict';var util=require(_0xeea2('0x0'));var _=require(_0xeea2('0x1'));var moment=require('moment');var BPromise=require(_0xeea2('0x2'));var hardware=require('./hardware');var encryptor=require(_0xeea2('0x3'));var db=require(_0xeea2('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeea2('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xeea2('0x6'),'machineUuid':hardware[_0xeea2('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeea2('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xeea2('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x342531){return new BPromise(function(_0x3e4ca4,_0x33d63f){return db[_0xeea2('0x9')][_0xeea2('0xa')](_[_0xeea2('0xb')](_0x342531,{'raw':!![],'where':{'id':0x1}}))[_0xeea2('0xc')](function(_0x56c914){return checkLicense(_0x56c914,null);})[_0xeea2('0xc')](function(_0x12ec26){_0x3e4ca4(_0x12ec26);return;})['catch'](function(_0x5567ba){_0x33d63f(_0x5567ba);});});}function checkLicense(_0x3c24ce,_0x15d2d8){if(!_0x3c24ce){demoLicense[_0xeea2('0xd')]=_0x3c24ce[_0xeea2('0xe')];return demoLicense;}try{var _0x2946a0=_0x15d2d8||_0x3c24ce['license'];if(_[_0xeea2('0xf')](_0x2946a0)){throw new Error(_0xeea2('0x10'));}var _0x576e75=_0x3c24ce[_0xeea2('0xe')];var _0x3a5425=_0x3c24ce[_0xeea2('0x11')];var _0x149788=_0x576e75[_0xeea2('0x12')]('-')[0x4];var _0x580181=_0x576e75['split']('-')[0x0];var _0x5d3fcc=encryptor[_0xeea2('0x13')](_0x2946a0,util[_0xeea2('0x14')]('%s:%s:%s',_0x149788,_0x576e75,_0x580181));var _0x3d1418=JSON['parse'](_0x5d3fcc);_0x3d1418['demo']=![];_0x3d1418[_0xeea2('0xd')]=_0x576e75;_0x3d1418[_0xeea2('0x15')]=hardware[_0xeea2('0x7')]();if(_0x3a5425){var _0x4cf181=encryptor[_0xeea2('0x13')](_0x3a5425);_0x3d1418[_0xeea2('0x16')]=_0x4cf181;_0x3d1418['deadline']=moment(_0x4cf181)[_0xeea2('0x17')](0x7,_0xeea2('0x18'))[_0xeea2('0x14')]();_0x3d1418[_0xeea2('0x19')]=_0x3d1418[_0xeea2('0xd')]!=_0x3d1418[_0xeea2('0x15')]?_0xeea2('0x1a'):_0xeea2('0x1b');}return _0x3d1418;}catch(_0x14e97d){breakingLicense[_0xeea2('0xd')]=_0x3c24ce['data1'];breakingLicense[_0xeea2('0x1c')]=_0x14e97d[_0xeea2('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x104f81,_0x4d9d00){getLicense()[_0xeea2('0xc')](function(_0x2ac8b0){return db[_0xeea2('0x1d')][_0xeea2('0x1e')]({'attributes':[_0xeea2('0x1f'),[db[_0xeea2('0x20')]['fn']('COUNT',db['sequelize']['col'](_0xeea2('0x1f'))),_0xeea2('0x21')]],'group':_0xeea2('0x1f'),'where':{'role':{'$or':[_0xeea2('0x22'),_0xeea2('0x23'),_0xeea2('0x24')]}},'raw':!![]})[_0xeea2('0xc')](function(_0x55ec1b){var _0x1ae06e={'user':_0x2ac8b0[_0xeea2('0x25')]||0x0,'telephone':_0x2ac8b0['telephones']||0x0};_0x55ec1b[_0xeea2('0x26')](function(_0x4aa3c6){var _0x1d87c2=_0x4aa3c6[_0xeea2('0x1f')]===_0xeea2('0x22')?_0xeea2('0x23'):_0x4aa3c6[_0xeea2('0x1f')];_0x1ae06e[_0x1d87c2]-=_0x4aa3c6[_0xeea2('0x21')];if(_0x1ae06e[_0x1d87c2]<0x0)_0x1ae06e[_0x1d87c2]=0x0;});_0x104f81(_0x1ae06e);return;});})[_0xeea2('0x27')](function(_0x6d0754){_0x4d9d00(_0x6d0754);});});}function checkUserLimits(_0x5ab930){return new BPromise(function(_0x2fc89d,_0x16c3cf){getLimits()[_0xeea2('0xc')](function(_0x5e60c7){var _0x1a1298=_['pick'](_[_0xeea2('0x28')](_0x5ab930,'role'),['admin','user',_0xeea2('0x24')]);var _0x14aab5=(_0x1a1298[_0xeea2('0x22')]||0x0)+(_0x1a1298[_0xeea2('0x23')]||0x0);var _0x2efb12=_0x1a1298[_0xeea2('0x24')]||0x0;if(_0x14aab5>_0x5e60c7[_0xeea2('0x23')])return _0x16c3cf(_0xeea2('0x29'));if(_0x2efb12>_0x5e60c7[_0xeea2('0x24')])return _0x16c3cf(_0xeea2('0x2a'));return _0x2fc89d();})[_0xeea2('0x27')](function(_0x424736){_0x16c3cf(_0x424736);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5a07=['data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','User','findAll','role','COUNT','sequelize','count','telephones','user','countBy','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','uuid'];(function(_0xf6676d,_0x4fc3fe){var _0x59974b=function(_0x55ae4e){while(--_0x55ae4e){_0xf6676d['push'](_0xf6676d['shift']());}};_0x59974b(++_0x4fc3fe);}(_0x5a07,0xf0));var _0x75a0=function(_0x131316,_0x256d3a){_0x131316=_0x131316-0x0;var _0x2c570c=_0x5a07[_0x131316];return _0x2c570c;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require(_0x75a0('0x0'));var hardware=require('./hardware');var encryptor=require(_0x75a0('0x1'));var db=require(_0x75a0('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x75a0('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x75a0('0x4'),'machineUuid':hardware[_0x75a0('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x75a0('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x75a0('0x6'),'machineUuid':hardware[_0x75a0('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x215298){return new BPromise(function(_0x5b8458,_0x3b4f89){return db['License'][_0x75a0('0x7')](_[_0x75a0('0x8')](_0x215298,{'raw':!![],'where':{'id':0x1}}))[_0x75a0('0x9')](function(_0x58e700){return checkLicense(_0x58e700,null);})[_0x75a0('0x9')](function(_0x3de7dd){_0x5b8458(_0x3de7dd);return;})[_0x75a0('0xa')](function(_0x2cff02){_0x3b4f89(_0x2cff02);});});}function checkLicense(_0x395908,_0x197243){if(!_0x395908){demoLicense[_0x75a0('0xb')]=_0x395908[_0x75a0('0xc')];return demoLicense;}try{var _0x535365=_0x197243||_0x395908[_0x75a0('0xd')];if(_[_0x75a0('0xe')](_0x535365)){throw new Error(_0x75a0('0xf'));}var _0x1335e4=_0x395908[_0x75a0('0xc')];var _0x3003e6=_0x395908[_0x75a0('0x10')];var _0x5f25b6=_0x1335e4['split']('-')[0x4];var _0xd7e9b7=_0x1335e4['split']('-')[0x0];var _0x317165=encryptor['decryptString'](_0x535365,util[_0x75a0('0x11')](_0x75a0('0x12'),_0x5f25b6,_0x1335e4,_0xd7e9b7));var _0x3e5ca0=JSON[_0x75a0('0x13')](_0x317165);_0x3e5ca0[_0x75a0('0x14')]=![];_0x3e5ca0[_0x75a0('0xb')]=_0x1335e4;_0x3e5ca0[_0x75a0('0x15')]=hardware[_0x75a0('0x5')]();if(_0x3003e6){var _0x2a1fcd=encryptor['decryptString'](_0x3003e6);_0x3e5ca0[_0x75a0('0x16')]=_0x2a1fcd;_0x3e5ca0[_0x75a0('0x17')]=moment(_0x2a1fcd)[_0x75a0('0x18')](0x7,_0x75a0('0x19'))[_0x75a0('0x11')]();_0x3e5ca0[_0x75a0('0x1a')]=_0x3e5ca0[_0x75a0('0xb')]!=_0x3e5ca0[_0x75a0('0x15')]?_0x75a0('0x1b'):_0x75a0('0x1c');}return _0x3e5ca0;}catch(_0x409b67){breakingLicense[_0x75a0('0xb')]=_0x395908[_0x75a0('0xc')];breakingLicense['message']=_0x409b67['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5449c9,_0x4ff0f3){getLicense()['then'](function(_0xdad734){return db[_0x75a0('0x1d')][_0x75a0('0x1e')]({'attributes':[_0x75a0('0x1f'),[db['sequelize']['fn'](_0x75a0('0x20'),db[_0x75a0('0x21')]['col'](_0x75a0('0x1f'))),_0x75a0('0x22')]],'group':_0x75a0('0x1f'),'where':{'role':{'$or':['admin','user','telephone']}},'raw':!![]})['then'](function(_0x38b239){var _0x5c906b={'user':_0xdad734['users']||0x0,'telephone':_0xdad734[_0x75a0('0x23')]||0x0};_0x38b239['forEach'](function(_0x488bcb){var _0x24e2ef=_0x488bcb['role']==='admin'?_0x75a0('0x24'):_0x488bcb[_0x75a0('0x1f')];_0x5c906b[_0x24e2ef]-=_0x488bcb[_0x75a0('0x22')];if(_0x5c906b[_0x24e2ef]<0x0)_0x5c906b[_0x24e2ef]=0x0;});_0x5449c9(_0x5c906b);return;});})[_0x75a0('0xa')](function(_0x27cb7c){_0x4ff0f3(_0x27cb7c);});});}function checkUserLimits(_0x1e084a){return new BPromise(function(_0x3f7ff4,_0x57d75c){getLimits()[_0x75a0('0x9')](function(_0x59949a){var _0x580537=_['pick'](_[_0x75a0('0x25')](_0x1e084a,_0x75a0('0x1f')),[_0x75a0('0x26'),_0x75a0('0x24'),_0x75a0('0x27')]);var _0x5b3f35=(_0x580537['admin']||0x0)+(_0x580537['user']||0x0);var _0xac354=_0x580537['telephone']||0x0;if(_0x5b3f35>_0x59949a[_0x75a0('0x24')])return _0x57d75c(_0x75a0('0x28'));if(_0xac354>_0x59949a[_0x75a0('0x27')])return _0x57d75c(_0x75a0('0x29'));return _0x3f7ff4();})['catch'](function(_0xc381c7){_0x57d75c(_0xc381c7);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 2fe99d9..fdf9a3b 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 _0xef0f=['exports','myappanuglar-secret','app-id','secret'];(function(_0x371517,_0x56ad3b){var _0x8e1a71=function(_0x3bfe6d){while(--_0x3bfe6d){_0x371517['push'](_0x371517['shift']());}};_0x8e1a71(++_0x56ad3b);}(_0xef0f,0x168));var _0xfef0=function(_0x5f14c0,_0x19cd70){_0x5f14c0=_0x5f14c0-0x0;var _0x47640f=_0xef0f[_0x5f14c0];return _0x47640f;};'use strict';module[_0xfef0('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xfef0('0x1'),'GOOGLE_ID':_0xfef0('0x2'),'GOOGLE_SECRET':_0xfef0('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xdb28=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x954620,_0x54fd40){var _0x390926=function(_0x2f5635){while(--_0x2f5635){_0x954620['push'](_0x954620['shift']());}};_0x390926(++_0x54fd40);}(_0xdb28,0x106));var _0x8db2=function(_0x15ed5e,_0x3c6dfa){_0x15ed5e=_0x15ed5e-0x0;var _0x184805=_0xdb28[_0x15ed5e];return _0x184805;};'use strict';module[_0x8db2('0x0')]={'DOMAIN':_0x8db2('0x1'),'SESSION_SECRET':_0x8db2('0x2'),'GOOGLE_ID':_0x8db2('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 3b5429d..2f72fc2 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72a7=['exports','../utils/loggers','fileLogger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x72a7,0x88));var _0x772a=function(_0x35fd92,_0x51db87){_0x35fd92=_0x35fd92-0x0;var _0x5d7ef4=_0x72a7[_0x35fd92];return _0x5d7ef4;};'use strict';var fileLogger=require(_0x772a('0x0'))[_0x772a('0x1')];module[_0x772a('0x2')]=fileLogger; \ No newline at end of file +var _0x2a6d=['exports','fileLogger'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x2a6d,0x1d1));var _0xd2a6=function(_0x136889,_0x196f54){_0x136889=_0x136889-0x0;var _0x4e6f8f=_0x2a6d[_0x136889];return _0x4e6f8f;};'use strict';var fileLogger=require('../utils/loggers')[_0xd2a6('0x0')];module[_0xd2a6('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 3603054..3a85d7a 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 _0x457c=['../../services/xdr/index.js','exports','path','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr'];(function(_0x495cd4,_0xd98f23){var _0x41bc01=function(_0x2d1732){while(--_0x2d1732){_0x495cd4['push'](_0x495cd4['shift']());}};_0x41bc01(++_0xd98f23);}(_0x457c,0x1bc));var _0xc457=function(_0x52cf82,_0x3d253b){_0x52cf82=_0x52cf82-0x0;var _0x8f5226=_0x457c[_0x52cf82];return _0x8f5226;};'use strict';var path=require(_0xc457('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0xc457('0x1')](path[_0xc457('0x2')](cfg[_0xc457('0x3')],_0xc457('0x4')))};var pm2config={'apps':[{'name':_0xc457('0x5'),'script':path['join'](__dirname,_0xc457('0x6')),'env':env},{'name':_0xc457('0x7'),'script':path[_0xc457('0x2')](__dirname,_0xc457('0x8')),'env':env},{'name':_0xc457('0x9'),'script':path[_0xc457('0x2')](__dirname,_0xc457('0xa')),'env':env},{'name':_0xc457('0xb'),'script':path[_0xc457('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xc457('0xc'),'script':path[_0xc457('0x2')](__dirname,_0xc457('0xd')),'env':env},{'name':_0xc457('0xe'),'script':path['join'](__dirname,_0xc457('0xf')),'env':env}]};module[_0xc457('0x10')]=pm2config; \ No newline at end of file +var _0xc0f5=['xdr','path','../../config/environment','resolve','join','legacy-libs','ami','../../services/ami/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc0f5,0x12d));var _0x5c0f=function(_0x11163d,_0x24489b){_0x11163d=_0x11163d-0x0;var _0x5aec20=_0xc0f5[_0x11163d];return _0x5aec20;};'use strict';var path=require(_0x5c0f('0x0'));var cfg=require(_0x5c0f('0x1'));var env={'NODE_PATH':path[_0x5c0f('0x2')](path[_0x5c0f('0x3')](cfg['root'],_0x5c0f('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x5c0f('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x5c0f('0x5'),'script':path[_0x5c0f('0x3')](__dirname,_0x5c0f('0x6')),'env':env},{'name':'agi','script':path[_0x5c0f('0x3')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x5c0f('0x7'),'script':path[_0x5c0f('0x3')](__dirname,_0x5c0f('0x8')),'env':env},{'name':_0x5c0f('0x9'),'script':path[_0x5c0f('0x3')](__dirname,_0x5c0f('0xa')),'env':env},{'name':_0x5c0f('0xb'),'script':path[_0x5c0f('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b9544d6..35af7c7 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 _0xe2af=['disconnect','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','stop','restart'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xe2af,0x171));var _0xfe2a=function(_0x53099a,_0x12bf78){_0x53099a=_0x53099a-0x0;var _0x57de6d=_0xe2af[_0x53099a];return _0x57de6d;};'use strict';var pm2=require(_0xfe2a('0x0'));var BPromise=require(_0xfe2a('0x1'));var config=require(_0xfe2a('0x2'));function connect(){return new BPromise(function(_0x4f9bbc,_0x3fb5b1){return pm2[_0xfe2a('0x3')](function(_0x42aca5){if(_0x42aca5){return _0x3fb5b1(_0x42aca5);}return _0x4f9bbc(_0xfe2a('0x4'));});});};exports[_0xfe2a('0x5')]=function(_0x506283){return connect()[_0xfe2a('0x6')](function(){return new BPromise(function(_0x17808a,_0xd5724b){return pm2[_0xfe2a('0x5')](_0x506283,function(_0x5743b3,_0x17bd96){if(_0x5743b3){return _0xd5724b(_0x5743b3);}pm2['disconnect']();return _0x17808a(_0x17bd96);});});});};exports['stop']=function(_0x25ff06){return connect()['then'](function(){return new BPromise(function(_0x1bc1e1,_0x540d5e){return pm2[_0xfe2a('0x7')](_0x25ff06,function(_0x36f4a4,_0xeb3b50){if(_0x36f4a4){return _0x540d5e(_0x36f4a4);}pm2['disconnect']();return _0x1bc1e1(_0xeb3b50);});});});};exports[_0xfe2a('0x8')]=function(_0x9fa604){return connect()['then'](function(){return new BPromise(function(_0x53862e,_0x12edaf){return pm2['restart'](_0x9fa604,function(_0x12ff30,_0x5864e8){if(_0x12ff30){return _0x12edaf(_0x12ff30);}pm2[_0xfe2a('0x9')]();return _0x53862e(_0x5864e8);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x575285,_0x280f71){return pm2['list'](function(_0x4e2df5,_0x5ed8a5){if(_0x4e2df5){return _0x280f71(_0x4e2df5);}pm2['disconnect']();return _0x575285(_0x5ed8a5);});});});};exports[_0xfe2a('0xa')]=function(_0x1d06b6){return connect()[_0xfe2a('0x6')](function(){return new BPromise(function(_0x32bff3,_0x48f35f){return pm2[_0xfe2a('0xa')](_0x1d06b6,function(_0x100770,_0x683dab){if(_0x100770){return _0x48f35f(_0x100770);}pm2[_0xfe2a('0x9')]();return _0x32bff3(_0x683dab);});});});};exports['delete']=function(_0x4310ba){return connect()[_0xfe2a('0x6')](function(){return new BPromise(function(_0x58f394,_0x4a955e){return pm2[_0xfe2a('0xb')](_0x4310ba,function(_0x206466,_0x2ecfb2){if(_0x206466){return _0x4a955e(_0x206466);}pm2[_0xfe2a('0x9')]();return _0x58f394(_0x2ecfb2);});});});};exports[_0xfe2a('0xc')]=function(){return connect()[_0xfe2a('0x6')](function(){return new BPromise(function(_0x32c42f,_0x5a2fe1){return pm2[_0xfe2a('0xc')](function(_0x9d1811){if(_0x9d1811){return _0x5a2fe1(_0x9d1811);}return _0x32c42f(_0xfe2a('0xd'));});});});}; \ No newline at end of file +var _0xe521=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x44be14,_0x2b0d44){var _0x5d53b8=function(_0xc405f7){while(--_0xc405f7){_0x44be14['push'](_0x44be14['shift']());}};_0x5d53b8(++_0x2b0d44);}(_0xe521,0x174));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0x1e52('0x0'));var BPromise=require(_0x1e52('0x1'));var config=require(_0x1e52('0x2'));function connect(){return new BPromise(function(_0x21ad52,_0xecfe3b){return pm2[_0x1e52('0x3')](function(_0x3c9cc1){if(_0x3c9cc1){return _0xecfe3b(_0x3c9cc1);}return _0x21ad52(_0x1e52('0x4'));});});};exports[_0x1e52('0x5')]=function(_0x26e4b3){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x4eb59e,_0x1e97ad){return pm2['start'](_0x26e4b3,function(_0xa69753,_0x59066b){if(_0xa69753){return _0x1e97ad(_0xa69753);}pm2[_0x1e52('0x7')]();return _0x4eb59e(_0x59066b);});});});};exports['stop']=function(_0x16318b){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x3fe0f1,_0x19df65){return pm2[_0x1e52('0x8')](_0x16318b,function(_0x3130c1,_0x212d05){if(_0x3130c1){return _0x19df65(_0x3130c1);}pm2[_0x1e52('0x7')]();return _0x3fe0f1(_0x212d05);});});});};exports['restart']=function(_0x2cc4d8){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x4b702b,_0x351152){return pm2[_0x1e52('0x9')](_0x2cc4d8,function(_0x5765d6,_0x329080){if(_0x5765d6){return _0x351152(_0x5765d6);}pm2[_0x1e52('0x7')]();return _0x4b702b(_0x329080);});});});};exports[_0x1e52('0xa')]=function(){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x24e999,_0xa682bf){return pm2[_0x1e52('0xa')](function(_0x4bd2d9,_0x36ce6b){if(_0x4bd2d9){return _0xa682bf(_0x4bd2d9);}pm2[_0x1e52('0x7')]();return _0x24e999(_0x36ce6b);});});});};exports[_0x1e52('0xb')]=function(_0x3e4b14){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0xee6f86,_0x2f0fba){return pm2[_0x1e52('0xb')](_0x3e4b14,function(_0x14141c,_0x4fcda4){if(_0x14141c){return _0x2f0fba(_0x14141c);}pm2[_0x1e52('0x7')]();return _0xee6f86(_0x4fcda4);});});});};exports[_0x1e52('0xc')]=function(_0x58ef4a){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x29c574,_0x5812ab){return pm2[_0x1e52('0xc')](_0x58ef4a,function(_0x640f8c,_0x3bbe1a){if(_0x640f8c){return _0x5812ab(_0x640f8c);}pm2['disconnect']();return _0x29c574(_0x3bbe1a);});});});};exports[_0x1e52('0xd')]=function(){return connect()[_0x1e52('0x6')](function(){return new BPromise(function(_0x38ff7b,_0x1b27b0){return pm2['dump'](function(_0x282b5a){if(_0x282b5a){return _0x1b27b0(_0x282b5a);}return _0x38ff7b(_0x1e52('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b3c11d6..d599b95 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 _0x2b0e=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','../../mysqldb','schedule','redis','localhost','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x2b0e,0x133));var _0xe2b0=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2b0e[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe2b0('0x0'));var moment=require(_0xe2b0('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xe2b0('0x2'));var db=require(_0xe2b0('0x3'))['db'];var logger=require('../logger')(_0xe2b0('0x4'));config[_0xe2b0('0x5')]=_['defaults'](config[_0xe2b0('0x5')],{'host':_0xe2b0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe2b0('0x5')]));function closeInteractions(){var _0x29a481=0x0;var _0x233056=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xe2b0('0x7')],'where':{'id':0x1}})[_0xe2b0('0x8')](function(_0x4489da){_0x29a481=_0x4489da['chatTimeout'];if(_0x29a481){return db[_0xe2b0('0x9')][_0xe2b0('0xa')]({'raw':!![],'attributes':['id',_0xe2b0('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4489da[_0xe2b0('0x7')],_0xe2b0('0xc'))}}});}else{return[];}})['then'](function(_0x2f6612){if(_0x2f6612&&_0x2f6612[_0xe2b0('0xd')]){_0x233056=_['map'](_0x2f6612||[],'id');logger[_0xe2b0('0xe')](_0xe2b0('0xf'),_0x233056[_0xe2b0('0x10')]());return db[_0xe2b0('0x9')][_0xe2b0('0x11')]({'closeReason':_0xe2b0('0x12'),'disposition':_0xe2b0('0x13'),'closed':!![],'closedAt':moment()[_0xe2b0('0x14')](_0xe2b0('0x15'))},{'where':{'id':_0x233056}});}})[_0xe2b0('0x8')](function(){if(_0x233056&&_0x233056[_0xe2b0('0xd')]){logger[_0xe2b0('0xe')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x233056['join']());for(var _0x2aeec8=0x0;_0x2aeec8<_0x233056[_0xe2b0('0xd')];_0x2aeec8++){io['emit']('chatInteraction:update',{'id':_0x233056[_0x2aeec8],'closed':!![]});}}})[_0xe2b0('0x16')](function(_0x1c55f0){logger[_0xe2b0('0x17')](_0xe2b0('0x18'),_0x1c55f0?util[_0xe2b0('0x19')](_0x1c55f0,{'showHidden':![],'depth':null}):'');});}exports[_0xe2b0('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcb5d=['system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0xbaf0e0,_0x14d9fc){var _0x12ee7f=function(_0x1fbaee){while(--_0x1fbaee){_0xbaf0e0['push'](_0xbaf0e0['shift']());}};_0x12ee7f(++_0x14d9fc);}(_0xcb5d,0x82));var _0xdcb5=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xcb5d[_0x68ee8b];return _0x5148f7;};'use strict';var _=require('lodash');var moment=require(_0xdcb5('0x0'));var Redis=require('ioredis');var util=require('util');var config=require(_0xdcb5('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xdcb5('0x2'))(_0xdcb5('0x3'));config[_0xdcb5('0x4')]=_['defaults'](config[_0xdcb5('0x4')],{'host':_0xdcb5('0x5'),'port':0x18eb});var io=require(_0xdcb5('0x6'))(new Redis(config[_0xdcb5('0x4')]));function closeInteractions(){var _0x25ac60=0x0;var _0x7bfe73=[];return db['Setting'][_0xdcb5('0x7')]({'raw':!![],'attributes':['id',_0xdcb5('0x8')],'where':{'id':0x1}})[_0xdcb5('0x9')](function(_0x4186be){_0x25ac60=_0x4186be[_0xdcb5('0x8')];if(_0x25ac60){return db[_0xdcb5('0xa')][_0xdcb5('0xb')]({'raw':!![],'attributes':['id',_0xdcb5('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xdcb5('0xd')](_0x4186be['chatTimeout'],'minutes')}}});}else{return[];}})[_0xdcb5('0x9')](function(_0x59db03){if(_0x59db03&&_0x59db03[_0xdcb5('0xe')]){_0x7bfe73=_[_0xdcb5('0xf')](_0x59db03||[],'id');logger[_0xdcb5('0x10')](_0xdcb5('0x11'),_0x7bfe73[_0xdcb5('0x12')]());return db['ChatInteraction'][_0xdcb5('0x13')]({'closeReason':_0xdcb5('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xdcb5('0x15')](_0xdcb5('0x16'))},{'where':{'id':_0x7bfe73}});}})[_0xdcb5('0x9')](function(){if(_0x7bfe73&&_0x7bfe73['length']){logger[_0xdcb5('0x10')](_0xdcb5('0x17'),_0x7bfe73['join']());for(var _0x4d2003=0x0;_0x4d2003<_0x7bfe73[_0xdcb5('0xe')];_0x4d2003++){io['emit'](_0xdcb5('0x18'),{'id':_0x7bfe73[_0x4d2003],'closed':!![]});}}})[_0xdcb5('0x19')](function(_0xee192e){logger[_0xdcb5('0x1a')](_0xdcb5('0x1b'),_0xee192e?util[_0xdcb5('0x1c')](_0xee192e,{'showHidden':![],'depth':null}):'');});}exports[_0xdcb5('0x1d')]=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 404bfdd..b820abe 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 _0x5109=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x33cfae,_0x30e086){var _0x29ead2=function(_0x4b769){while(--_0x4b769){_0x33cfae['push'](_0x33cfae['shift']());}};_0x29ead2(++_0x30e086);}(_0x5109,0x103));var _0x9510=function(_0x5685fe,_0x124bc8){_0x5685fe=_0x5685fe-0x0;var _0x266e06=_0x5109[_0x5685fe];return _0x266e06;};'use strict';function start(){var _0x37ca9b=require(_0x9510('0x0'));return _0x37ca9b[_0x9510('0x1')]();}module[_0x9510('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x13e5=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5294c1,_0x8dfcd7){var _0x419b17=function(_0x11b5d4){while(--_0x11b5d4){_0x5294c1['push'](_0x5294c1['shift']());}};_0x419b17(++_0x8dfcd7);}(_0x13e5,0x173));var _0x513e=function(_0x3439fd,_0x202462){_0x3439fd=_0x3439fd-0x0;var _0x9d6e86=_0x13e5[_0x3439fd];return _0x9d6e86;};'use strict';function start(){var _0x538997=require(_0x513e('0x0'));return _0x538997[_0x513e('0x1')]();}module[_0x513e('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 a7588ce..058da71 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 _0xed5c=['start','add\x20cron','stop','stop\x20cron','length','run','util','path','lodash','moment','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','name','MailAccount','Smtp','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','%s.%s','basename','extname','zip','join','existsSync','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','error','error\x20mail','stringify','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','catch','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0xed5c,0x19b));var _0xced5=function(_0x3f4f26,_0x3ef935){_0x3f4f26=_0x3f4f26-0x0;var _0x4f9ef9=_0xed5c[_0x3f4f26];return _0x4f9ef9;};'use strict';var fs=require('fs');var util=require(_0xced5('0x0'));var path=require(_0xced5('0x1'));var _=require(_0xced5('0x2'));var moment=require(_0xced5('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xced5('0x4'));var logger=require(_0xced5('0x5'))('schedule');var db=require(_0xced5('0x6'))['db'];var analyticCustomReportController=require(_0xced5('0x7'));var analyticDefaultReportController=require(_0xced5('0x8'));var client=jayson['client'][_0xced5('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x181400,_0x303bd9){return function(){logger[_0xced5('0xa')](_0xced5('0xb'),_0x181400[_0xced5('0xc')]);var _0x4abbbc=!![];var _0x2a3c83=_0x181400['MailAccount'][_0xced5('0xd')]();var _0x290a6b={'account':_0x2a3c83,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x181400['MailAccount'][_0xced5('0xe')],_0x181400[_0xced5('0xf')][_0xced5('0xc')]||_0x181400[_0xced5('0xf')][_0xced5('0x10')]['user']),'to':_0x181400['email'],'cc':_0x181400['cc'],'bcc':_0x181400['bcc'],'subject':util[_0xced5('0x11')](_0xced5('0x12'),_0x303bd9['name'],_0x181400[_0xced5('0x13')],_0x181400['subtractUnit'])}};var _0x8d5bfd=path['join'](__dirname,'../../files/reports');var _0x3000b5=_0x303bd9[_0xced5('0x14')];var _0x96cd02=util[_0xced5('0x11')](_0xced5('0x15'),path[_0xced5('0x16')](_0x303bd9[_0xced5('0x14')],path[_0xced5('0x17')](_0x303bd9[_0xced5('0x14')])),_0xced5('0x18'));var _0x5668e9=path['join'](_0x8d5bfd,_0x3000b5);var _0x3b79e7=path[_0xced5('0x19')](_0x8d5bfd,_0x96cd02);if(fs[_0xced5('0x1a')](_0x5668e9)){_0x303bd9['status']=_0xced5('0x1b');_0x290a6b[_0xced5('0x1c')]['attachments']=[{'filename':_0x3000b5,'path':_0x5668e9}];_0x290a6b[_0xced5('0x1c')]['text']=util[_0xced5('0x11')](_0xced5('0x1d'),JSON['stringify'](_0x303bd9,null,0x2));}else if(fs[_0xced5('0x1a')](_0x3b79e7)){_0x303bd9[_0xced5('0x1e')]='Sent';_0x290a6b['message'][_0xced5('0x1f')]=[{'filename':_0x96cd02,'path':_0x3b79e7}];}else{_0x290a6b[_0xced5('0x1c')][_0xced5('0x20')]=_0xced5('0x21');if(!_0x181400[_0xced5('0x22')]){_0x4abbbc=![];logger[_0xced5('0xa')](_0xced5('0x23'));}}if(_0x4abbbc){return client['request']('SendMail',_0x290a6b)['then'](function(_0x12aa27){if(_0x12aa27[_0xced5('0x24')]){return logger[_0xced5('0x24')](_0xced5('0x25'),JSON[_0xced5('0x26')](_0x12aa27));}return logger[_0xced5('0xa')]('email\x20sent');})['catch'](function(_0x164f61){return logger['error'](_0xced5('0x25'),JSON[_0xced5('0x26')](_0x164f61));});}};}function handleError(){return function(_0x1b36e0){return logger[_0xced5('0x24')](JSON[_0xced5('0x26')](_0x1b36e0));};}function handleResult(_0x4fb2b3){return function(_0x56fda7){logger['info'](_0xced5('0x27'),JSON[_0xced5('0x26')](_0x56fda7));if(_0x4fb2b3['MailAccount']&&_0x4fb2b3[_0xced5('0xf')][_0xced5('0x10')]&&!_['isNil'](_0x4fb2b3[_0xced5('0xc')])){setTimeout(handleSendEmail(_0x4fb2b3,_0x56fda7),0x3c*0x3e8);}};}function handleJob(_0x33ad93){return function(){try{if(_[_0xced5('0x28')](_0x33ad93[_0xced5('0x13')])){return logger[_0xced5('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xced5('0x28')](_0x33ad93['subtractUnit'])){return logger[_0xced5('0xa')](_0xced5('0x29'));}var _0x54c7cd={'startDate':moment()['subtract'](_0x33ad93[_0xced5('0x13')],_0x33ad93[_0xced5('0x2a')])[_0xced5('0x11')](_0xced5('0x2b')),'endDate':moment()[_0xced5('0x11')](_0xced5('0x2b')),'type':_0xced5('0x2c'),'output':_0x33ad93[_0xced5('0x2d')],'name':_0x33ad93['name']};if(!_[_0xced5('0x28')](_0x33ad93[_0xced5('0x2e')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x33ad93[_0xced5('0x2e')]);return analyticDefaultReportController[_0xced5('0x2f')]({'id':_0x33ad93['DefaultReportId']},_0x54c7cd)[_0xced5('0x30')](handleResult(_0x33ad93))[_0xced5('0x31')](handleError());}if(!_[_0xced5('0x28')](_0x33ad93['CustomReportId'])){logger['info'](_0xced5('0x32'),_0x33ad93['CustomReportId']);return analyticCustomReportController[_0xced5('0x2f')]({'id':_0x33ad93['CustomReportId']},_0x54c7cd)[_0xced5('0x30')](handleResult(_0x33ad93))[_0xced5('0x31')](handleError());}}catch(_0x5eed49){logger['error'](JSON[_0xced5('0x26')](_0x5eed49));}return logger[_0xced5('0xa')](_0xced5('0x33'));};}function getJobs(_0x2aefec){var _0x2ef39f={};if(_0x2aefec){_0x2ef39f['id']=_0x2aefec;}return db[_0xced5('0x34')]['findAll']({'where':_0x2ef39f,'include':[{'model':db[_0xced5('0xf')],'attributes':['id',_0xced5('0xe'),_0xced5('0xc')],'include':[{'model':db['MailServerOut'],'as':_0xced5('0x10'),'include':[{'model':db[_0xced5('0x35')],'as':_0xced5('0x35')}]}]}]})[_0xced5('0x30')](function(_0x297ec0){var _0x39e63f=_[_0xced5('0x36')](manager[_0xced5('0x37')]);var _0xaba922=_[_0xced5('0x38')](_0x297ec0,function(_0x5c10e1){return _0x5c10e1['id'][_0xced5('0x39')]();});var _0x51022d=_[_0xced5('0x3a')](_0x297ec0,function(_0x3483c4){return _0x3483c4['id'][_0xced5('0x39')]();});var _0x4b76ab=_0x2aefec?_0xaba922:_[_0xced5('0x3b')](_0xaba922,_0x39e63f);var _0x21ceb4=_[_0xced5('0x3c')](_0xaba922,_0x39e63f);var _0x4577f1=_[_0xced5('0x3b')](_0x39e63f,_0xaba922);var _0x4345d9;var _0x38fa47;for(_0x4345d9=0x0;_0x4345d9<_0x4577f1['length']&&!_0x2aefec;_0x4345d9+=0x1){_0x38fa47=_0x4577f1[_0x4345d9][_0xced5('0x39')]();if(manager[_0xced5('0x3d')](_0x38fa47)){manager['stop'](_0x38fa47);manager[_0xced5('0x3e')](_0x38fa47);logger['info'](_0xced5('0x3f'),_0x38fa47);}}logger['info'](_0xced5('0x40'),JSON[_0xced5('0x26')](_0x4b76ab));for(_0x4345d9=0x0;_0x4345d9<_0x4b76ab['length'];_0x4345d9+=0x1){_0x38fa47=_0x4b76ab[_0x4345d9][_0xced5('0x39')]();logger['info'](_0xced5('0x41'),_0x38fa47);if(_0x2aefec){logger[_0xced5('0xa')](_0xced5('0x42'),_0x2aefec);logger[_0xced5('0xa')](JSON[_0xced5('0x26')](_0x51022d[_0x38fa47]));BPromise[_0xced5('0x43')]()[_0xced5('0x30')](handleJob(_0x51022d[_0x38fa47]));logger[_0xced5('0xa')](_0xced5('0x44'),_0x51022d[_0x38fa47]['name'],_0x51022d[_0x38fa47]['cron']);}else if(_0x51022d[_0x38fa47][_0xced5('0x45')]&&_0x51022d[_0x38fa47][_0xced5('0x46')]&&moment()[_0xced5('0x47')](_0x51022d[_0x38fa47][_0xced5('0x48')],_0x51022d[_0x38fa47][_0xced5('0x49')])){manager[_0xced5('0x4a')](_0x38fa47,_0x51022d[_0x38fa47]['cron'],handleJob(_0x51022d[_0x38fa47]));manager[_0xced5('0x4b')](_0x38fa47);logger[_0xced5('0xa')](_0xced5('0x4c'),_0x51022d[_0x38fa47][_0xced5('0xe')],_0x51022d[_0x38fa47][_0xced5('0x45')]);}else if(manager[_0xced5('0x3d')](_0x38fa47)){manager[_0xced5('0x4d')](_0x38fa47);manager[_0xced5('0x3e')](_0x38fa47);logger[_0xced5('0xa')](_0xced5('0x4e'),_0x51022d[_0x38fa47]['name'],_0x51022d[_0x38fa47]['cron']);}}for(_0x4345d9=0x0,_0x38fa47;_0x4345d9<_0x21ceb4[_0xced5('0x4f')]&&!_0x2aefec;_0x4345d9+=0x1){_0x38fa47=_0x21ceb4[_0x4345d9][_0xced5('0x39')]();if(manager['exists'](_0x38fa47)){if(_0x51022d[_0x38fa47][_0xced5('0x45')]&&_0x51022d[_0x38fa47][_0xced5('0x46')]&&moment()[_0xced5('0x47')](_0x51022d[_0x38fa47][_0xced5('0x48')],_0x51022d[_0x38fa47][_0xced5('0x49')])){manager['update'](_0x38fa47,_0x51022d[_0x38fa47][_0xced5('0x45')],handleJob(_0x51022d[_0x38fa47]));logger[_0xced5('0xa')]('update\x20cron',_0x51022d[_0x38fa47][_0xced5('0xe')],_0x51022d[_0x38fa47][_0xced5('0x45')]);}else{manager[_0xced5('0x4d')](_0x38fa47);manager[_0xced5('0x3e')](_0x38fa47);logger[_0xced5('0xa')](_0xced5('0x4e'),_0x51022d[_0x38fa47]['name'],_0x51022d[_0x38fa47][_0xced5('0x45')]);}}}})[_0xced5('0x31')](function(_0x4c24d4){logger[_0xced5('0x24')](JSON['stringify'](_0x4c24d4));});}exports[_0xced5('0x50')]=function(_0x4d423a){return getJobs(_0x4d423a);};exports[_0xced5('0x4b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8e29=['../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','email','MailAccount','name','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','format','basename','extname','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error\x20mail','email\x20sent','catch','error','data','Smtp','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','isNil','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','update\x20cron','run','util','path','lodash','jayson/promise','bluebird','schedule'];(function(_0x261520,_0x14f629){var _0x2aa400=function(_0x262d3c){while(--_0x262d3c){_0x261520['push'](_0x261520['shift']());}};_0x2aa400(++_0x14f629);}(_0x8e29,0x94));var _0x98e2=function(_0x12f4e5,_0x159c80){_0x12f4e5=_0x12f4e5-0x0;var _0x10f23d=_0x8e29[_0x12f4e5];return _0x10f23d;};'use strict';var fs=require('fs');var util=require(_0x98e2('0x0'));var path=require(_0x98e2('0x1'));var _=require(_0x98e2('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x98e2('0x3'));var BPromise=require(_0x98e2('0x4'));var logger=require('../logger')(_0x98e2('0x5'));var db=require(_0x98e2('0x6'))['db'];var analyticCustomReportController=require(_0x98e2('0x7'));var analyticDefaultReportController=require(_0x98e2('0x8'));var client=jayson['client'][_0x98e2('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2184df,_0x347300){return function(){logger[_0x98e2('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2184df[_0x98e2('0xb')]);var _0x7c27ce=!![];var _0x166b39=_0x2184df[_0x98e2('0xc')]['getSmtpOptions']();var _0x2e288c={'account':_0x166b39,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2184df[_0x98e2('0xc')][_0x98e2('0xd')],_0x2184df[_0x98e2('0xc')][_0x98e2('0xb')]||_0x2184df[_0x98e2('0xc')]['Smtp'][_0x98e2('0xe')]),'to':_0x2184df['email'],'cc':_0x2184df['cc'],'bcc':_0x2184df[_0x98e2('0xf')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x347300['name'],_0x2184df[_0x98e2('0x10')],_0x2184df[_0x98e2('0x11')])}};var _0x5b6d61=path[_0x98e2('0x12')](__dirname,_0x98e2('0x13'));var _0x19b7fe=_0x347300[_0x98e2('0x14')];var _0x4fe4e6=util[_0x98e2('0x15')]('%s.%s',path[_0x98e2('0x16')](_0x347300[_0x98e2('0x14')],path[_0x98e2('0x17')](_0x347300[_0x98e2('0x14')])),'zip');var _0x260b94=path[_0x98e2('0x12')](_0x5b6d61,_0x19b7fe);var _0x32ddd7=path['join'](_0x5b6d61,_0x4fe4e6);if(fs[_0x98e2('0x18')](_0x260b94)){_0x347300[_0x98e2('0x19')]=_0x98e2('0x1a');_0x2e288c[_0x98e2('0x1b')][_0x98e2('0x1c')]=[{'filename':_0x19b7fe,'path':_0x260b94}];_0x2e288c[_0x98e2('0x1b')][_0x98e2('0x1d')]=util[_0x98e2('0x15')](_0x98e2('0x1e'),JSON[_0x98e2('0x1f')](_0x347300,null,0x2));}else if(fs[_0x98e2('0x18')](_0x32ddd7)){_0x347300[_0x98e2('0x19')]='Sent';_0x2e288c[_0x98e2('0x1b')][_0x98e2('0x1c')]=[{'filename':_0x4fe4e6,'path':_0x32ddd7}];}else{_0x2e288c[_0x98e2('0x1b')]['text']=_0x98e2('0x20');if(!_0x2184df['sendIfEmpty']){_0x7c27ce=![];logger[_0x98e2('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x7c27ce){return client[_0x98e2('0x21')]('SendMail',_0x2e288c)[_0x98e2('0x22')](function(_0x146c97){if(_0x146c97['error']){return logger['error'](_0x98e2('0x23'),JSON[_0x98e2('0x1f')](_0x146c97));}return logger[_0x98e2('0xa')](_0x98e2('0x24'));})[_0x98e2('0x25')](function(_0x474d79){return logger[_0x98e2('0x26')](_0x98e2('0x23'),JSON[_0x98e2('0x1f')](_0x474d79));});}};}function handleError(){return function(_0x253f2c){return logger[_0x98e2('0x26')](JSON[_0x98e2('0x1f')](_0x253f2c));};}function handleResult(_0x4eb744){return function(_0x1f8f7a){logger[_0x98e2('0xa')](_0x98e2('0x27'),JSON[_0x98e2('0x1f')](_0x1f8f7a));if(_0x4eb744[_0x98e2('0xc')]&&_0x4eb744[_0x98e2('0xc')][_0x98e2('0x28')]&&!_['isNil'](_0x4eb744[_0x98e2('0xb')])){setTimeout(handleSendEmail(_0x4eb744,_0x1f8f7a),0x3c*0x3e8);}};}function handleJob(_0x554e90){return function(){try{if(_['isNil'](_0x554e90[_0x98e2('0x10')])){return logger[_0x98e2('0xa')](_0x98e2('0x29'));}if(_['isNil'](_0x554e90[_0x98e2('0x11')])){return logger[_0x98e2('0xa')](_0x98e2('0x2a'));}var _0x115868={'startDate':moment()['subtract'](_0x554e90[_0x98e2('0x10')],_0x554e90[_0x98e2('0x11')])[_0x98e2('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x98e2('0x2b')),'type':_0x98e2('0x2c'),'output':_0x554e90[_0x98e2('0x2d')],'name':_0x554e90[_0x98e2('0xd')]};if(!_[_0x98e2('0x2e')](_0x554e90[_0x98e2('0x2f')])){logger[_0x98e2('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x554e90[_0x98e2('0x2f')]);return analyticDefaultReportController[_0x98e2('0x30')]({'id':_0x554e90[_0x98e2('0x2f')]},_0x115868)[_0x98e2('0x22')](handleResult(_0x554e90))[_0x98e2('0x25')](handleError());}if(!_[_0x98e2('0x2e')](_0x554e90['CustomReportId'])){logger['info'](_0x98e2('0x31'),_0x554e90[_0x98e2('0x32')]);return analyticCustomReportController[_0x98e2('0x30')]({'id':_0x554e90[_0x98e2('0x32')]},_0x115868)[_0x98e2('0x22')](handleResult(_0x554e90))[_0x98e2('0x25')](handleError());}}catch(_0x44e5cd){logger['error'](JSON[_0x98e2('0x1f')](_0x44e5cd));}return logger[_0x98e2('0xa')](_0x98e2('0x33'));};}function getJobs(_0x432913){var _0x19ff40={};if(_0x432913){_0x19ff40['id']=_0x432913;}return db[_0x98e2('0x34')][_0x98e2('0x35')]({'where':_0x19ff40,'include':[{'model':db[_0x98e2('0xc')],'attributes':['id',_0x98e2('0xd'),_0x98e2('0xb')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})['then'](function(_0x37358e){var _0x537e3a=_[_0x98e2('0x36')](manager['jobs']);var _0x18bae4=_[_0x98e2('0x37')](_0x37358e,function(_0x215392){return _0x215392['id'][_0x98e2('0x38')]();});var _0x565994=_[_0x98e2('0x39')](_0x37358e,function(_0x2aebe1){return _0x2aebe1['id'][_0x98e2('0x38')]();});var _0x4d9cd0=_0x432913?_0x18bae4:_[_0x98e2('0x3a')](_0x18bae4,_0x537e3a);var _0x47f3e5=_[_0x98e2('0x3b')](_0x18bae4,_0x537e3a);var _0x240a00=_[_0x98e2('0x3a')](_0x537e3a,_0x18bae4);var _0x258863;var _0x3c967e;for(_0x258863=0x0;_0x258863<_0x240a00[_0x98e2('0x3c')]&&!_0x432913;_0x258863+=0x1){_0x3c967e=_0x240a00[_0x258863][_0x98e2('0x38')]();if(manager[_0x98e2('0x3d')](_0x3c967e)){manager[_0x98e2('0x3e')](_0x3c967e);manager['deleteJob'](_0x3c967e);logger['info'](_0x98e2('0x3f'),_0x3c967e);}}logger[_0x98e2('0xa')](_0x98e2('0x40'),JSON[_0x98e2('0x1f')](_0x4d9cd0));for(_0x258863=0x0;_0x258863<_0x4d9cd0[_0x98e2('0x3c')];_0x258863+=0x1){_0x3c967e=_0x4d9cd0[_0x258863][_0x98e2('0x38')]();logger['info']('index',_0x3c967e);if(_0x432913){logger[_0x98e2('0xa')](_0x98e2('0x41'),_0x432913);logger['info'](JSON['stringify'](_0x565994[_0x3c967e]));BPromise[_0x98e2('0x42')]()[_0x98e2('0x22')](handleJob(_0x565994[_0x3c967e]));logger[_0x98e2('0xa')]('run\x20job',_0x565994[_0x3c967e]['name'],_0x565994[_0x3c967e][_0x98e2('0x43')]);}else if(_0x565994[_0x3c967e][_0x98e2('0x43')]&&_0x565994[_0x3c967e][_0x98e2('0x44')]&&moment()[_0x98e2('0x45')](_0x565994[_0x3c967e][_0x98e2('0x46')],_0x565994[_0x3c967e][_0x98e2('0x47')])){manager[_0x98e2('0x48')](_0x3c967e,_0x565994[_0x3c967e]['cron'],handleJob(_0x565994[_0x3c967e]));manager[_0x98e2('0x49')](_0x3c967e);logger['info']('add\x20cron',_0x565994[_0x3c967e][_0x98e2('0xd')],_0x565994[_0x3c967e][_0x98e2('0x43')]);}else if(manager[_0x98e2('0x3d')](_0x3c967e)){manager[_0x98e2('0x3e')](_0x3c967e);manager['deleteJob'](_0x3c967e);logger[_0x98e2('0xa')](_0x98e2('0x4a'),_0x565994[_0x3c967e]['name'],_0x565994[_0x3c967e]['cron']);}}for(_0x258863=0x0,_0x3c967e;_0x258863<_0x47f3e5['length']&&!_0x432913;_0x258863+=0x1){_0x3c967e=_0x47f3e5[_0x258863][_0x98e2('0x38')]();if(manager[_0x98e2('0x3d')](_0x3c967e)){if(_0x565994[_0x3c967e][_0x98e2('0x43')]&&_0x565994[_0x3c967e]['active']&&moment()['isBetween'](_0x565994[_0x3c967e][_0x98e2('0x46')],_0x565994[_0x3c967e][_0x98e2('0x47')])){manager['update'](_0x3c967e,_0x565994[_0x3c967e][_0x98e2('0x43')],handleJob(_0x565994[_0x3c967e]));logger[_0x98e2('0xa')](_0x98e2('0x4b'),_0x565994[_0x3c967e][_0x98e2('0xd')],_0x565994[_0x3c967e][_0x98e2('0x43')]);}else{manager[_0x98e2('0x3e')](_0x3c967e);manager['deleteJob'](_0x3c967e);logger[_0x98e2('0xa')](_0x98e2('0x4a'),_0x565994[_0x3c967e][_0x98e2('0xd')],_0x565994[_0x3c967e][_0x98e2('0x43')]);}}}})[_0x98e2('0x25')](function(_0x34b0a8){logger[_0x98e2('0x26')](JSON['stringify'](_0x34b0a8));});}exports[_0x98e2('0x4c')]=function(_0x52a03c){return getJobs(_0x52a03c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 211d45a..9cd38c3 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 _0x4f9b=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore','Mixed','Neutral','resolve','sentiment','Negative','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','push','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','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','TranscriptionJob','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x4f9b[_0x45fc6a];return _0x14bcfd;};var _=require(_0xb4f9('0x0'));var AWS=require(_0xb4f9('0x1'));var rp=require(_0xb4f9('0x2'));var util=require(_0xb4f9('0x3'));var BPromise=require(_0xb4f9('0x4'));var db=require(_0xb4f9('0x5'))['db'];var logger=require(_0xb4f9('0x6'))(_0xb4f9('0x7'));function getTranscriptionJob(_0x5276a3,_0x59803f,_0x572714,_0x25947a){return new Promise(function(_0x38c813,_0x2fa71b){var _0x4e8f3c=new AWS[(_0xb4f9('0x8'))]({'accessKeyId':_0x59803f,'secretAccessKey':_0x5276a3,'region':_0x572714});_0x4e8f3c[_0xb4f9('0x9')]({'TranscriptionJobName':_0x25947a},function(_0x5f21cf,_0x5ecbc5){if(_0x5f21cf){return _0x2fa71b(_0x5f21cf);}else{return _0x38c813(_0x5ecbc5);}});});}function sentiment(_0x439f66,_0x3240ea,_0x4a9df3,_0x146ecf,_0x544209){return new Promise(function(_0x2ee1b5,_0x398e64){var _0xa19014=new AWS[(_0xb4f9('0xa'))]({'accessKeyId':_0x3240ea,'secretAccessKey':_0x439f66,'region':_0x4a9df3});_0xa19014[_0xb4f9('0xb')]({'Text':_0x146ecf,'LanguageCode':_0x544209[_0xb4f9('0xc')](0x0,0x2)},function(_0x191882,_0x4a056c){if(_0x191882){return _0x398e64(_0x191882);}else{return _0x2ee1b5(_0x4a056c);}});});}function checkTranscribeJob(_0x1bb8b0,_0x4475e4,_0x239d84){var _0x4927d9;return new BPromise(function(_0x5819d5,_0x1aaff5){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0xf'),_0x1bb8b0['id'],_0x1bb8b0[_0xb4f9('0x10')]));return getTranscriptionJob(_0x239d84[_0xb4f9('0x11')],_0x239d84[_0xb4f9('0x12')],_0x4475e4[_0xb4f9('0x13')],_0x1bb8b0[_0xb4f9('0x10')])[_0xb4f9('0x14')](function(_0xc6e4da){logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x15'),_0x1bb8b0['id'],_0x1bb8b0[_0xb4f9('0x10')],_0xc6e4da[_0xb4f9('0x16')][_0xb4f9('0x17')]));if(!_0x1bb8b0['fileText']){switch(_0xc6e4da['TranscriptionJob']['TranscriptionJobStatus']){case'COMPLETED':var _0x468203={'transcribeStatus':_0xc6e4da['TranscriptionJob'][_0xb4f9('0x17')],'fileUri':_0xc6e4da[_0xb4f9('0x16')]['Transcript'][_0xb4f9('0x18')]};logger['info'](util[_0xb4f9('0xe')](_0xb4f9('0x19'),_0x1bb8b0['id']));return rp({'uri':_0xc6e4da[_0xb4f9('0x16')][_0xb4f9('0x1a')][_0xb4f9('0x18')],'json':!![]})[_0xb4f9('0x14')](function(_0x4a0a9b){logger['info'](util['format'](_0xb4f9('0x1b'),_0x1bb8b0['id']));if(_0x4a0a9b&&_0x4a0a9b['results']&&_0x4a0a9b[_0xb4f9('0x1c')][_0xb4f9('0x1d')]&&_0x4a0a9b[_0xb4f9('0x1c')][_0xb4f9('0x1d')][_0xb4f9('0x1e')]){_0x468203[_0xb4f9('0x1f')]='';for(var _0x4d3b93=0x0;_0x4d3b93<_0x4a0a9b[_0xb4f9('0x1c')]['transcripts'][_0xb4f9('0x1e')];_0x4d3b93++){_0x468203[_0xb4f9('0x1f')]+=_0x4a0a9b['results']['transcripts'][_0x4d3b93][_0xb4f9('0x20')]+'';}}return _0x1bb8b0['update'](_0x468203);})[_0xb4f9('0x14')](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));if(!_0x1bb8b0[_0xb4f9('0x22')]){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x25'));}if(!_0x4475e4['sentiment']||!_0x4475e4['sentimentAccountId']||!_0x4475e4['sentimentRegion']||!_0x4475e4[_0xb4f9('0x26')]||!_0x4475e4[_0xb4f9('0x27')]){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x28'));}if(!_0x468203[_0xb4f9('0x1f')]){throw new Error(_0xb4f9('0x29'));}if(_0x4475e4[_0xb4f9('0x2a')]===_0x239d84['id']){return _0x239d84;}else{return db[_0xb4f9('0x2b')][_0xb4f9('0x2c')]({'where':{'id':_settings[_0xb4f9('0x2a')]}});}})[_0xb4f9('0x14')](function(_0x4b2a58){if(!_0x4b2a58){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x2d'));}if(!_0x4b2a58['data1']||!_0x4b2a58['data2']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x4927d9=_0x4b2a58;logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x2f'),_0x1bb8b0['id']));return sentiment(_0x4927d9[_0xb4f9('0x11')],_0x4927d9[_0xb4f9('0x12')],_0x4475e4[_0xb4f9('0x30')],_0x468203[_0xb4f9('0x1f')],_0x4475e4[_0xb4f9('0x26')]);})[_0xb4f9('0x14')](function(_0x453a7e){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x31'),_0x1bb8b0['id']));return _0x1bb8b0[_0xb4f9('0x32')]({'sentiment':_0x453a7e[_0xb4f9('0x33')],'sPositive':_0x453a7e['SentimentScore'][_0xb4f9('0x34')],'sNegative':_0x453a7e[_0xb4f9('0x35')]['Negative'],'sMixed':_0x453a7e[_0xb4f9('0x35')][_0xb4f9('0x36')],'sNeutral':_0x453a7e[_0xb4f9('0x35')][_0xb4f9('0x37')]});})['then'](function(){logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});case'FAILED':return _0x1bb8b0[_0xb4f9('0x32')]({'transcribeStatus':'FAILED','failureReason':_0xc6e4da[_0xb4f9('0x16')]['FailureReason']})[_0xb4f9('0x14')](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});default:logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1bb8b0['id']));break;}}else{return BPromise[_0xb4f9('0x38')]()[_0xb4f9('0x14')](function(){if(!_0x1bb8b0['tempSentiment']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x25'));}if(!_0x4475e4[_0xb4f9('0x39')]||!_0x4475e4[_0xb4f9('0x2a')]||!_0x4475e4[_0xb4f9('0x30')]||!_0x4475e4[_0xb4f9('0x26')]||!_0x4475e4[_0xb4f9('0x27')]){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x28'));}if(!_0x1bb8b0[_0xb4f9('0x1f')]){throw new Error(_0xb4f9('0x29'));}if(_0x4475e4[_0xb4f9('0x2a')]===_0x239d84['id']){return _0x239d84;}else{return db[_0xb4f9('0x2b')][_0xb4f9('0x2c')]({'where':{'id':_settings[_0xb4f9('0x2a')]}});}})[_0xb4f9('0x14')](function(_0x21b733){if(!_0x21b733){throw new db['Sequelize'][(_0xb4f9('0x24'))](_0xb4f9('0x2d'));}if(!_0x21b733[_0xb4f9('0x11')]||!_0x21b733['data2']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x4927d9=_0x21b733;logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x2f'),_0x1bb8b0['id']));return sentiment(_0x4927d9['data1'],_0x4927d9[_0xb4f9('0x12')],_0x4475e4['sentimentRegion'],_0x1bb8b0['fileText'],_0x4475e4[_0xb4f9('0x26')]);})[_0xb4f9('0x14')](function(_0x28cba4){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x31'),_0x1bb8b0['id']));return _0x1bb8b0[_0xb4f9('0x32')]({'sentiment':_0x28cba4['Sentiment'],'sPositive':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x34')],'sNegative':_0x28cba4['SentimentScore'][_0xb4f9('0x3a')],'sMixed':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x36')],'sNeutral':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x37')],'transcribeStatus':_0xb4f9('0x3b')});})['then'](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});}})['catch'](function(_0x42e65f){if(_0x42e65f){if(!_0x42e65f[_0xb4f9('0x3c')]||_0x42e65f['name']!==_0xb4f9('0x3d')){logger[_0xb4f9('0x3e')](util[_0xb4f9('0xe')](_0xb4f9('0x3f'),_0x1bb8b0['id']),util[_0xb4f9('0x40')](_0x42e65f,{'showHidden':![],'depth':null}));}}_0x5819d5();});});}function checkTranscribe(){var _0x526d4f;var _0x70b72f;var _0x3612b6;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0xb4f9('0x41')}})[_0xb4f9('0x14')](function(_0x3c7811){if(!_0x3c7811||!_0x3c7811['length']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x42'));}_0x526d4f=_0x3c7811;return db['Setting'][_0xb4f9('0x2c')]({'where':{'id':0x1}});})[_0xb4f9('0x14')](function(_0x13054d){if(!_0x13054d){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x43'));}_0x70b72f=_0x13054d;if(!_0x70b72f[_0xb4f9('0x7')]||!_0x70b72f[_0xb4f9('0x44')]||!_0x70b72f['transcribeRegion']||!_0x70b72f[_0xb4f9('0x26')]||!_0x70b72f[_0xb4f9('0x27')]){throw new db['Sequelize'][(_0xb4f9('0x24'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xb4f9('0x2c')]({'where':{'id':_0x70b72f['transcribeAccountId']}});})[_0xb4f9('0x14')](function(_0x5bbbe7){if(!_0x5bbbe7){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2d'));}if(!_0x5bbbe7['data1']||!_0x5bbbe7[_0xb4f9('0x12')]){throw new db['Sequelize'][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x3612b6=_0x5bbbe7;var _0x9a402f=[];_0x526d4f['forEach'](function(_0x3bfcc8){_0x9a402f[_0xb4f9('0x45')](checkTranscribeJob(_0x3bfcc8,_0x70b72f,_0x3612b6));});return BPromise['all'](_0x9a402f);})['catch'](function(_0x4b0f68){if(_0x4b0f68){if(!_0x4b0f68['name']||_0x4b0f68[_0xb4f9('0x3c')]!=='SequelizeValidationError'){logger[_0xb4f9('0x3e')](util[_0xb4f9('0x40')](_0x4b0f68,{'showHidden':![],'depth':null}));}}});}exports[_0xb4f9('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xe7b9=['forEach','all','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','results','transcripts','length','fileText','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','data1','Cloud\x20Provider\x20not\x20configured','data2','Sentiment','SentimentScore','Negative','Neutral','update','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','findOne','transcribe','transcribeAccountId','Transcribe\x20not\x20configured'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe7b9,0x170));var _0x9e7b=function(_0x7aecb0,_0x2b5d3d){_0x7aecb0=_0x7aecb0-0x0;var _0x55bbbe=_0xe7b9[_0x7aecb0];return _0x55bbbe;};var _=require(_0x9e7b('0x0'));var AWS=require(_0x9e7b('0x1'));var rp=require(_0x9e7b('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x9e7b('0x3'))['db'];var logger=require(_0x9e7b('0x4'))('transcribe');function getTranscriptionJob(_0x48b654,_0xc8f709,_0x53cec5,_0xe1692e){return new Promise(function(_0x543b7e,_0x4dda21){var _0x1e2f86=new AWS[(_0x9e7b('0x5'))]({'accessKeyId':_0xc8f709,'secretAccessKey':_0x48b654,'region':_0x53cec5});_0x1e2f86[_0x9e7b('0x6')]({'TranscriptionJobName':_0xe1692e},function(_0x5ed982,_0x46e445){if(_0x5ed982){return _0x4dda21(_0x5ed982);}else{return _0x543b7e(_0x46e445);}});});}function sentiment(_0x3166ec,_0x35640b,_0x128bac,_0xc8bbba,_0x5cfbb5){return new Promise(function(_0x47b442,_0x5a36ca){var _0xe74d52=new AWS[(_0x9e7b('0x7'))]({'accessKeyId':_0x35640b,'secretAccessKey':_0x3166ec,'region':_0x128bac});_0xe74d52[_0x9e7b('0x8')]({'Text':_0xc8bbba,'LanguageCode':_0x5cfbb5[_0x9e7b('0x9')](0x0,0x2)},function(_0x187278,_0x1a8b4b){if(_0x187278){return _0x5a36ca(_0x187278);}else{return _0x47b442(_0x1a8b4b);}});});}function checkTranscribeJob(_0x5bd9ad,_0x1ab7d0,_0x41cd2c){var _0x2aca68;return new BPromise(function(_0x327875,_0x4af825){logger[_0x9e7b('0xa')](util['format'](_0x9e7b('0xb'),_0x5bd9ad['id'],_0x5bd9ad[_0x9e7b('0xc')]));return getTranscriptionJob(_0x41cd2c['data1'],_0x41cd2c['data2'],_0x1ab7d0[_0x9e7b('0xd')],_0x5bd9ad[_0x9e7b('0xc')])[_0x9e7b('0xe')](function(_0x59b4b3){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x10'),_0x5bd9ad['id'],_0x5bd9ad[_0x9e7b('0xc')],_0x59b4b3[_0x9e7b('0x11')][_0x9e7b('0x12')]));if(!_0x5bd9ad['fileText']){switch(_0x59b4b3[_0x9e7b('0x11')][_0x9e7b('0x12')]){case _0x9e7b('0x13'):var _0x451dff={'transcribeStatus':_0x59b4b3[_0x9e7b('0x11')][_0x9e7b('0x12')],'fileUri':_0x59b4b3['TranscriptionJob']['Transcript'][_0x9e7b('0x14')]};logger[_0x9e7b('0xa')](util['format'](_0x9e7b('0x15'),_0x5bd9ad['id']));return rp({'uri':_0x59b4b3[_0x9e7b('0x11')][_0x9e7b('0x16')][_0x9e7b('0x14')],'json':!![]})[_0x9e7b('0xe')](function(_0x622932){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x5bd9ad['id']));if(_0x622932&&_0x622932[_0x9e7b('0x17')]&&_0x622932[_0x9e7b('0x17')][_0x9e7b('0x18')]&&_0x622932[_0x9e7b('0x17')][_0x9e7b('0x18')][_0x9e7b('0x19')]){_0x451dff[_0x9e7b('0x1a')]='';for(var _0x49a4c5=0x0;_0x49a4c5<_0x622932['results'][_0x9e7b('0x18')][_0x9e7b('0x19')];_0x49a4c5++){_0x451dff[_0x9e7b('0x1a')]+=_0x622932['results'][_0x9e7b('0x18')][_0x49a4c5]['transcript']+'';}}return _0x5bd9ad['update'](_0x451dff);})[_0x9e7b('0xe')](function(){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x1b'),_0x5bd9ad['id']));if(!_0x5bd9ad[_0x9e7b('0x1c')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x1f'));}if(!_0x1ab7d0[_0x9e7b('0x20')]||!_0x1ab7d0['sentimentAccountId']||!_0x1ab7d0[_0x9e7b('0x21')]||!_0x1ab7d0[_0x9e7b('0x22')]||!_0x1ab7d0[_0x9e7b('0x23')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x24'));}if(!_0x451dff['fileText']){throw new Error(_0x9e7b('0x25'));}if(_0x1ab7d0['sentimentAccountId']===_0x41cd2c['id']){return _0x41cd2c;}else{return db[_0x9e7b('0x26')]['findOne']({'where':{'id':_settings[_0x9e7b('0x27')]}});}})[_0x9e7b('0xe')](function(_0x5b5510){if(!_0x5b5510){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5b5510[_0x9e7b('0x28')]||!_0x5b5510['data2']){throw new db['Sequelize'][(_0x9e7b('0x1e'))](_0x9e7b('0x29'));}_0x2aca68=_0x5b5510;logger['info'](util[_0x9e7b('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5bd9ad['id']));return sentiment(_0x2aca68['data1'],_0x2aca68[_0x9e7b('0x2a')],_0x1ab7d0['sentimentRegion'],_0x451dff[_0x9e7b('0x1a')],_0x1ab7d0[_0x9e7b('0x22')]);})[_0x9e7b('0xe')](function(_0x1fbe38){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5bd9ad['id']));return _0x5bd9ad['update']({'sentiment':_0x1fbe38[_0x9e7b('0x2b')],'sPositive':_0x1fbe38[_0x9e7b('0x2c')]['Positive'],'sNegative':_0x1fbe38[_0x9e7b('0x2c')][_0x9e7b('0x2d')],'sMixed':_0x1fbe38[_0x9e7b('0x2c')]['Mixed'],'sNeutral':_0x1fbe38[_0x9e7b('0x2c')][_0x9e7b('0x2e')]});})[_0x9e7b('0xe')](function(){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x1b'),_0x5bd9ad['id']));_0x327875();});case'FAILED':return _0x5bd9ad[_0x9e7b('0x2f')]({'transcribeStatus':_0x9e7b('0x30'),'failureReason':_0x59b4b3[_0x9e7b('0x11')]['FailureReason']})[_0x9e7b('0xe')](function(){logger['info'](util['format'](_0x9e7b('0x1b'),_0x5bd9ad['id']));_0x327875();});default:logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x31'),_0x5bd9ad['id']));break;}}else{return BPromise[_0x9e7b('0x32')]()[_0x9e7b('0xe')](function(){if(!_0x5bd9ad[_0x9e7b('0x1c')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1ab7d0['sentiment']||!_0x1ab7d0[_0x9e7b('0x27')]||!_0x1ab7d0[_0x9e7b('0x21')]||!_0x1ab7d0[_0x9e7b('0x22')]||!_0x1ab7d0[_0x9e7b('0x23')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x24'));}if(!_0x5bd9ad[_0x9e7b('0x1a')]){throw new Error(_0x9e7b('0x25'));}if(_0x1ab7d0[_0x9e7b('0x27')]===_0x41cd2c['id']){return _0x41cd2c;}else{return db[_0x9e7b('0x26')]['findOne']({'where':{'id':_settings[_0x9e7b('0x27')]}});}})[_0x9e7b('0xe')](function(_0x23bb24){if(!_0x23bb24){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x33'));}if(!_0x23bb24[_0x9e7b('0x28')]||!_0x23bb24[_0x9e7b('0x2a')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x29'));}_0x2aca68=_0x23bb24;logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x34'),_0x5bd9ad['id']));return sentiment(_0x2aca68[_0x9e7b('0x28')],_0x2aca68['data2'],_0x1ab7d0[_0x9e7b('0x21')],_0x5bd9ad[_0x9e7b('0x1a')],_0x1ab7d0[_0x9e7b('0x22')]);})[_0x9e7b('0xe')](function(_0x398f94){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')](_0x9e7b('0x35'),_0x5bd9ad['id']));return _0x5bd9ad[_0x9e7b('0x2f')]({'sentiment':_0x398f94[_0x9e7b('0x2b')],'sPositive':_0x398f94[_0x9e7b('0x2c')][_0x9e7b('0x36')],'sNegative':_0x398f94[_0x9e7b('0x2c')][_0x9e7b('0x2d')],'sMixed':_0x398f94['SentimentScore'][_0x9e7b('0x37')],'sNeutral':_0x398f94[_0x9e7b('0x2c')][_0x9e7b('0x2e')],'transcribeStatus':_0x9e7b('0x13')});})[_0x9e7b('0xe')](function(){logger[_0x9e7b('0xa')](util[_0x9e7b('0xf')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5bd9ad['id']));_0x327875();});}})[_0x9e7b('0x38')](function(_0x116b62){if(_0x116b62){if(!_0x116b62['name']||_0x116b62[_0x9e7b('0x39')]!==_0x9e7b('0x3a')){logger[_0x9e7b('0x3b')](util[_0x9e7b('0xf')](_0x9e7b('0x3c'),_0x5bd9ad['id']),util[_0x9e7b('0x3d')](_0x116b62,{'showHidden':![],'depth':null}));}}_0x327875();});});}function checkTranscribe(){var _0x155158;var _0x3e3425;var _0x1f8a3f;return db[_0x9e7b('0x3e')][_0x9e7b('0x3f')]({'where':{'transcribeStatus':_0x9e7b('0x40')}})[_0x9e7b('0xe')](function(_0x40a996){if(!_0x40a996||!_0x40a996[_0x9e7b('0x19')]){throw new db[(_0x9e7b('0x1d'))]['ValidationError'](_0x9e7b('0x41'));}_0x155158=_0x40a996;return db['Setting'][_0x9e7b('0x42')]({'where':{'id':0x1}});})['then'](function(_0x36c875){if(!_0x36c875){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))]('Settings\x20not\x20available');}_0x3e3425=_0x36c875;if(!_0x3e3425[_0x9e7b('0x43')]||!_0x3e3425[_0x9e7b('0x44')]||!_0x3e3425['transcribeRegion']||!_0x3e3425[_0x9e7b('0x22')]||!_0x3e3425[_0x9e7b('0x23')]){throw new db[(_0x9e7b('0x1d'))]['ValidationError'](_0x9e7b('0x45'));}return db[_0x9e7b('0x26')][_0x9e7b('0x42')]({'where':{'id':_0x3e3425['transcribeAccountId']}});})['then'](function(_0x1ebb33){if(!_0x1ebb33){throw new db['Sequelize']['ValidationError'](_0x9e7b('0x33'));}if(!_0x1ebb33[_0x9e7b('0x28')]||!_0x1ebb33[_0x9e7b('0x2a')]){throw new db[(_0x9e7b('0x1d'))][(_0x9e7b('0x1e'))](_0x9e7b('0x29'));}_0x1f8a3f=_0x1ebb33;var _0x43b9d2=[];_0x155158[_0x9e7b('0x46')](function(_0x4448f4){_0x43b9d2['push'](checkTranscribeJob(_0x4448f4,_0x3e3425,_0x1f8a3f));});return BPromise[_0x9e7b('0x47')](_0x43b9d2);})[_0x9e7b('0x38')](function(_0x3ebc45){if(_0x3ebc45){if(!_0x3ebc45[_0x9e7b('0x39')]||_0x3ebc45['name']!=='SequelizeValidationError'){logger[_0x9e7b('0x3b')](util[_0x9e7b('0x3d')](_0x3ebc45,{'showHidden':![],'depth':null}));}}});}exports[_0x9e7b('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 2bd26ca..82ae463 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 _0x3ab9=['emit','whatsappInteraction:update','error','inspect','start','lodash','ioredis','util','../../config/environment','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x232fc3,_0x4278e6){var _0x436171=function(_0x2a7bb4){while(--_0x2a7bb4){_0x232fc3['push'](_0x232fc3['shift']());}};_0x436171(++_0x4278e6);}(_0x3ab9,0x6d));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x93ab('0x0'));var moment=require('moment');var Redis=require(_0x93ab('0x1'));var util=require(_0x93ab('0x2'));var config=require(_0x93ab('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0x93ab('0x4')]=_[_0x93ab('0x5')](config[_0x93ab('0x4')],{'host':_0x93ab('0x6'),'port':0x18eb});var io=require(_0x93ab('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x115511=[];return db[_0x93ab('0x8')][_0x93ab('0x9')]({'raw':!![],'attributes':['id',_0x93ab('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x93ab('0xb')](0x18,_0x93ab('0xc'))}}})[_0x93ab('0xd')](function(_0x1a9180){if(_0x1a9180&&_0x1a9180[_0x93ab('0xe')]){_0x115511=_['map'](_0x1a9180||[],'id');logger[_0x93ab('0xf')](_0x93ab('0x10'),_0x115511['join']());return db['WhatsappInteraction'][_0x93ab('0x11')]({'closeReason':_0x93ab('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x93ab('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x115511}});}})[_0x93ab('0xd')](function(){if(_0x115511&&_0x115511[_0x93ab('0xe')]){logger[_0x93ab('0xf')](_0x93ab('0x14'),_0x115511['join']());for(var _0x3e45a9=0x0;_0x3e45a9<_0x115511[_0x93ab('0xe')];_0x3e45a9++){io[_0x93ab('0x15')](_0x93ab('0x16'),{'id':_0x115511[_0x3e45a9],'closed':!![]});}}})['catch'](function(_0x3e7723){logger[_0x93ab('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3e7723?util[_0x93ab('0x18')](_0x3e7723,{'showHidden':![],'depth':null}):'');});}exports[_0x93ab('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0962=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0962,0x1b5));var _0x2096=function(_0x55ffa5,_0x332fee){_0x55ffa5=_0x55ffa5-0x0;var _0x9acde5=_0x0962[_0x55ffa5];return _0x9acde5;};'use strict';var _=require(_0x2096('0x0'));var moment=require(_0x2096('0x1'));var Redis=require(_0x2096('0x2'));var util=require(_0x2096('0x3'));var config=require(_0x2096('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x2096('0x5'))(_0x2096('0x6'));config[_0x2096('0x7')]=_['defaults'](config['redis'],{'host':_0x2096('0x8'),'port':0x18eb});var io=require(_0x2096('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x244f81=[];return db[_0x2096('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x2096('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2096('0xc')](0x18,_0x2096('0xd'))}}})[_0x2096('0xe')](function(_0x70d54e){if(_0x70d54e&&_0x70d54e[_0x2096('0xf')]){_0x244f81=_[_0x2096('0x10')](_0x70d54e||[],'id');logger[_0x2096('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x244f81[_0x2096('0x12')]());return db['WhatsappInteraction'][_0x2096('0x13')]({'closeReason':'system','disposition':_0x2096('0x14'),'closed':!![],'closedAt':moment()[_0x2096('0x15')](_0x2096('0x16'))},{'where':{'id':_0x244f81}});}})[_0x2096('0xe')](function(){if(_0x244f81&&_0x244f81['length']){logger[_0x2096('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x244f81[_0x2096('0x12')]());for(var _0x55ef49=0x0;_0x55ef49<_0x244f81[_0x2096('0xf')];_0x55ef49++){io[_0x2096('0x17')](_0x2096('0x18'),{'id':_0x244f81[_0x55ef49],'closed':!![]});}}})['catch'](function(_0x219f19){logger[_0x2096('0x19')](_0x2096('0x1a'),_0x219f19?util[_0x2096('0x1b')](_0x219f19,{'showHidden':![],'depth':null}):'');});}exports[_0x2096('0x1c')]=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 49ed629..e00d949 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x933b=['destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact'];(function(_0x2ec410,_0x76d876){var _0x4646a8=function(_0xc147a9){while(--_0xc147a9){_0x2ec410['push'](_0x2ec410['shift']());}};_0x4646a8(++_0x76d876);}(_0x933b,0x89));var _0xb933=function(_0x31c862,_0x2b3903){_0x31c862=_0x31c862-0x0;var _0x118c32=_0x933b[_0x31c862];return _0x118c32;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb933('0x0')]({'id':i,'firstName':_0xb933('0x1')+i,'lastName':_0xb933('0x2')+i,'phone':0xf879fb460+i,'email':_0xb933('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xb933('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb933('0x4')](),'updatedAt':Date[_0xb933('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb933('0x0')]({'id':i,'firstName':_0xb933('0x1')+i,'lastName':_0xb933('0x2')+i,'phone':0xf879fb460+i,'email':_0xb933('0x3')+i+_0xb933('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb933('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xb933('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb933('0x4')](),'updatedAt':Date[_0xb933('0x4')]()});}db[_0xb933('0x6')][_0xb933('0x7')]({'where':{}})[_0xb933('0x8')](function(){return db['CmContact'][_0xb933('0x9')](contacts);})['then'](function(){console[_0xb933('0xa')](_0xb933('0xb'),_0xb933('0xc'));return db['CmHopper'][_0xb933('0x7')]({'where':{}});})[_0xb933('0x8')](function(){return db[_0xb933('0xd')]['bulkCreate'](hopper);})[_0xb933('0x8')](function(){console[_0xb933('0xa')](_0xb933('0xb'),_0xb933('0xe'));return db[_0xb933('0x6')]['bulkCreate'](contacts2);})['then'](function(){console['log'](_0xb933('0xb'),_0xb933('0xf'));return db[_0xb933('0xd')]['bulkCreate'](hopper2);})[_0xb933('0x8')](function(){console[_0xb933('0xa')](_0xb933('0xb'),_0xb933('0x10'));})[_0xb933('0x11')](function(_0x2e163d){console[_0xb933('0xa')](_0x2e163d);}); \ No newline at end of file +var _0x1280=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','CmContact','destroy','then'];(function(_0x1673bc,_0x533131){var _0x57d6fc=function(_0x361b85){while(--_0x361b85){_0x1673bc['push'](_0x1673bc['shift']());}};_0x57d6fc(++_0x533131);}(_0x1280,0x167));var _0x0128=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x1280[_0x1ca9eb];return _0x2e284e;};'use strict';var util=require('util');var db=require(_0x0128('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0128('0x1')]({'id':i,'firstName':_0x0128('0x2')+i,'lastName':_0x0128('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0128('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0128('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0128('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0128('0x5')](),'updatedAt':Date[_0x0128('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0128('0x1')]({'id':i,'firstName':_0x0128('0x2')+i,'lastName':_0x0128('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0128('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x0128('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0128('0x5')](),'updatedAt':Date[_0x0128('0x5')]()});}db[_0x0128('0x6')][_0x0128('0x7')]({'where':{}})[_0x0128('0x8')](function(){return db['CmContact'][_0x0128('0x9')](contacts);})['then'](function(){console[_0x0128('0xa')](_0x0128('0xb'),_0x0128('0xc'));return db[_0x0128('0xd')][_0x0128('0x7')]({'where':{}});})[_0x0128('0x8')](function(){return db[_0x0128('0xd')][_0x0128('0x9')](hopper);})[_0x0128('0x8')](function(){console['log'](_0x0128('0xb'),'hopper1');return db[_0x0128('0x6')]['bulkCreate'](contacts2);})[_0x0128('0x8')](function(){console[_0x0128('0xa')](_0x0128('0xb'),'contacts2');return db[_0x0128('0xd')]['bulkCreate'](hopper2);})['then'](function(){console[_0x0128('0xa')]('finished\x20populating',_0x0128('0xe'));})[_0x0128('0xf')](function(_0x470715){console[_0x0128('0xa')](_0x470715);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b29d614..7514fb2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfff=['/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','add\x20user','catch','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x355a06,_0x14de2d){var _0x20d249=function(_0x45c486){while(--_0x45c486){_0x355a06['push'](_0x355a06['shift']());}};_0x20d249(++_0x14de2d);}(_0xdfff,0xb2));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xfdff('0x0')]({'name':util[_0xfdff('0x1')](_0xfdff('0x2'),'agent',i),'fullname':util['format'](_0xfdff('0x2'),_0xfdff('0x3'),i),'email':util[_0xfdff('0x1')](_0xfdff('0x4'),_0xfdff('0x3'),i),'role':_0xfdff('0x3'),'password':'password','internal':0xfa0+i,'type':_0xfdff('0x5'),'transport':[_0xfdff('0x6'),'ws',_0xfdff('0x7')],'disallow':[_0xfdff('0x8')],'allow':[_0xfdff('0x9')],'defaultuser':util[_0xfdff('0x1')]('%s%s',_0xfdff('0x3'),i),'encryption':_0xfdff('0xa'),'avpf':_0xfdff('0xa'),'force_avp':_0xfdff('0xa'),'icesupport':_0xfdff('0xa'),'dtlsenable':_0xfdff('0xa'),'dtlsverify':'no','dtlscertfile':_0xfdff('0xb'),'dtlsprivatekey':_0xfdff('0xc'),'dtlssetup':'actpass','callerid':util[_0xfdff('0x1')]('\x22%s\x22\x20<%s>',util[_0xfdff('0x1')](_0xfdff('0x2'),_0xfdff('0x3'),i),0xfa0+i)});}db[_0xfdff('0xd')][_0xfdff('0xe')](users)[_0xfdff('0xf')](function(){console[_0xfdff('0x10')](_0xfdff('0x11'));})[_0xfdff('0x12')](function(_0x10b188){console[_0xfdff('0x10')](_0x10b188);}); \ No newline at end of file +var _0xc974=['wss','all','yes','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','push','format','agent','%s%s','%s%s@xcally.com','udp'];(function(_0x3d30ed,_0x1a6ea3){var _0x531392=function(_0x5925da){while(--_0x5925da){_0x3d30ed['push'](_0x3d30ed['shift']());}};_0x531392(++_0x1a6ea3);}(_0xc974,0x15e));var _0x4c97=function(_0x5e9b52,_0x5765c8){_0x5e9b52=_0x5e9b52-0x0;var _0x5a1b22=_0xc974[_0x5e9b52];return _0x5a1b22;};'use strict';var util=require(_0x4c97('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4c97('0x1')]({'name':util[_0x4c97('0x2')]('%s%s',_0x4c97('0x3'),i),'fullname':util[_0x4c97('0x2')](_0x4c97('0x4'),'agent',i),'email':util['format'](_0x4c97('0x5'),_0x4c97('0x3'),i),'role':_0x4c97('0x3'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x4c97('0x6'),'ws',_0x4c97('0x7')],'disallow':[_0x4c97('0x8')],'allow':['ulaw'],'defaultuser':util[_0x4c97('0x2')](_0x4c97('0x4'),_0x4c97('0x3'),i),'encryption':_0x4c97('0x9'),'avpf':_0x4c97('0x9'),'force_avp':'yes','icesupport':_0x4c97('0x9'),'dtlsenable':_0x4c97('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x4c97('0xa'),'callerid':util[_0x4c97('0x2')](_0x4c97('0xb'),util['format'](_0x4c97('0x4'),_0x4c97('0x3'),i),0xfa0+i)});}db[_0x4c97('0xc')]['bulkCreate'](users)[_0x4c97('0xd')](function(){console[_0x4c97('0xe')](_0x4c97('0xf'));})[_0x4c97('0x10')](function(_0x87191d){console[_0x4c97('0xe')](_0x87191d);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0c43f72..4903959 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19fb=['all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','user:%s','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','%s:queue:%s','Agents','length','format','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Campaign','ChatQueue','Trunk','getFaxQueues','getMailQueues','getOpenchannelQueues'];(function(_0xc33f02,_0x4578cf){var _0x5a9e76=function(_0x1ba821){while(--_0x1ba821){_0xc33f02['push'](_0xc33f02['shift']());}};_0x5a9e76(++_0x4578cf);}(_0x19fb,0xdd));var _0xb19f=function(_0x509f08,_0x555538){_0x509f08=_0x509f08-0x0;var _0x10974c=_0x19fb[_0x509f08];return _0x10974c;};'use strict';var _=require(_0xb19f('0x0'));var util=require(_0xb19f('0x1'));var BPromise=require(_0xb19f('0x2'));var db=require(_0xb19f('0x3'))['db'];var config=require(_0xb19f('0x4'));var queryQueues={'attributes':['id',_0xb19f('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0xb19f('0x5'),_0xb19f('0x6')],'raw':!![],'where':{'role':_0xb19f('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb19f('0x5')],'where':{'role':_0xb19f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb19f('0x5')],'where':{'role':_0xb19f('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb19f('0x5'),_0xb19f('0x9')],'where':{'type':_0xb19f('0xa')}};function getAssociatedResources(_0x22741a,_0x45df88,_0x111431){return db['UserProfileSection'][_0xb19f('0xb')]({'where':{'name':_0x22741a,'userProfileId':_0x45df88},'raw':!![]})[_0xb19f('0xc')](function(_0x3bb927){if(_0x3bb927){if(_0x3bb927[_0xb19f('0xd')]){switch(_0x22741a){case _0xb19f('0xe'):case _0xb19f('0xf'):case _0xb19f('0x10'):case _0xb19f('0x11'):case _0xb19f('0x12'):case _0xb19f('0x13'):case _0xb19f('0x14'):return db[_0x111431][_0xb19f('0x15')](queryQueues);case _0xb19f('0x16'):return db[_0x111431][_0xb19f('0x15')](queryTelephones);case _0xb19f('0x17'):return db[_0x111431]['findAll'](queryTrunks);case _0xb19f('0x18'):return db[_0x111431][_0xb19f('0x15')](queryCampaigns);}}else{return db[_0xb19f('0x19')]['findAll']({'attributes':[_0xb19f('0x1a')],'where':{'sectionId':_0x3bb927['id']},'raw':!![]})[_0xb19f('0xc')](function(_0x46b688){if(_0x46b688){var _0x5640ea={'where':{'id':_[_0xb19f('0x1b')](_0x46b688,_0xb19f('0x1a'))},'raw':!![]};switch(_0x111431){case _0xb19f('0x1c'):_0x5640ea['where'][_0xb19f('0x6')]='telephone';break;case'Campaign':_0x5640ea['where'][_0xb19f('0x9')]=_0xb19f('0xa');break;}return db[_0x111431][_0xb19f('0x15')](_0x5640ea);}else{return[];}});}}else{return[];}})[_0xb19f('0xc')](function(_0x47e548){return _0x47e548;});}function joinOrLeaveQueues(_0x2aedec,_0x1b31a2,_0x505929,_0x1875e8){_0x2aedec[_0x1b31a2](util['format'](_0xb19f('0x1d'),_0x505929,_0x1875e8[_0xb19f('0x5')]));if(_0x1875e8[_0xb19f('0x1e')]){for(var _0xb449b4=0x0;_0xb449b4<_0x1875e8[_0xb19f('0x1e')][_0xb19f('0x1f')];_0xb449b4+=0x1){_0x2aedec[_0x1b31a2](util[_0xb19f('0x20')]('user:%s',_0x1875e8[_0xb19f('0x1e')][_0xb449b4][_0xb19f('0x5')]));}}}function joinOrLeave(_0x27b8dd,_0x34c638,_0x47e313){var _0x25fbdc;if(_0x27b8dd[_0xb19f('0x21')][_0xb19f('0x22')]['id']){db[_0xb19f('0x1c')][_0xb19f('0x23')]({'attributes':['id',_0xb19f('0x5'),_0xb19f('0x6'),_0xb19f('0x24')],'where':{'id':_0x27b8dd[_0xb19f('0x21')][_0xb19f('0x22')]['id']},'include':[{'model':db[_0xb19f('0x25')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb19f('0x26')],'as':_0xb19f('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xb19f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xb19f('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xb19f('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xb19f('0x2b')],'as':_0xb19f('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xb19f('0xc')](function(_0x5e479a){if(_0x5e479a){_0x25fbdc=_0x5e479a;_0x27b8dd[_0x34c638](util['format']('user:%s',_0x5e479a[_0xb19f('0x5')]));var _0x4c2213=[];switch(_0x5e479a['role']){case'admin':_0x27b8dd[_0x34c638](_0xb19f('0x2d'));_0x27b8dd[_0x34c638](_0xb19f('0x2e'));if(queryQueues[_0xb19f('0x2f')](_0xb19f('0x30'))){delete queryQueues[_0xb19f('0x30')];}_0x4c2213[_0xb19f('0x31')](db['VoiceQueue'][_0xb19f('0x15')](queryQueues));_0x4c2213[_0xb19f('0x31')](db['ChatQueue'][_0xb19f('0x15')](queryQueues));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x32')][_0xb19f('0x15')](queryQueues));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x33')]['findAll'](queryQueues));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x34')][_0xb19f('0x15')](queryQueues));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x35')][_0xb19f('0x15')](queryQueues));_0x4c2213['push'](db[_0xb19f('0x36')][_0xb19f('0x15')](queryQueues));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x1c')][_0xb19f('0x15')](queryTelephones));_0x4c2213[_0xb19f('0x31')](db['Trunk'][_0xb19f('0x15')](queryTrunks));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x37')][_0xb19f('0x15')](queryCampaigns));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x1c')][_0xb19f('0x15')](queryAgents));break;case'user':_0x27b8dd[_0x34c638](_0xb19f('0x2d'));_0x27b8dd[_0x34c638]('voice:outbound');_0x4c2213[_0xb19f('0x31')](getAssociatedResources(_0xb19f('0xe'),_0x5e479a[_0xb19f('0x24')],'VoiceQueue'));_0x4c2213[_0xb19f('0x31')](getAssociatedResources('ChatQueues',_0x5e479a[_0xb19f('0x24')],_0xb19f('0x38')));_0x4c2213['push'](getAssociatedResources(_0xb19f('0x10'),_0x5e479a[_0xb19f('0x24')],_0xb19f('0x32')));_0x4c2213[_0xb19f('0x31')](getAssociatedResources('SmsQueues',_0x5e479a[_0xb19f('0x24')],_0xb19f('0x33')));_0x4c2213[_0xb19f('0x31')](getAssociatedResources(_0xb19f('0x12'),_0x5e479a[_0xb19f('0x24')],_0xb19f('0x34')));_0x4c2213['push'](getAssociatedResources(_0xb19f('0x13'),_0x5e479a['userProfileId'],_0xb19f('0x35')));_0x4c2213['push'](getAssociatedResources(_0xb19f('0x14'),_0x5e479a[_0xb19f('0x24')],'WhatsappQueue'));_0x4c2213[_0xb19f('0x31')](getAssociatedResources(_0xb19f('0x16'),_0x5e479a[_0xb19f('0x24')],_0xb19f('0x1c')));_0x4c2213['push'](getAssociatedResources(_0xb19f('0x17'),_0x5e479a[_0xb19f('0x24')],_0xb19f('0x39')));_0x4c2213['push'](getAssociatedResources(_0xb19f('0x18'),_0x5e479a['userProfileId'],_0xb19f('0x37')));_0x4c2213[_0xb19f('0x31')](db[_0xb19f('0x1c')][_0xb19f('0x15')](queryAgents));break;case _0xb19f('0x7'):_0x27b8dd[_0x34c638](_0xb19f('0x2d'));_0x27b8dd[_0x34c638](_0xb19f('0x2e'));_0x4c2213[_0xb19f('0x31')](_0x5e479a['getVoiceQueues']({'attributes':['id',_0xb19f('0x5')]}));_0x4c2213[_0xb19f('0x31')](_0x5e479a['getChatQueues']({'attributes':['id',_0xb19f('0x5')]}));_0x4c2213[_0xb19f('0x31')](_0x5e479a[_0xb19f('0x3a')]({'attributes':['id','name']}));_0x4c2213[_0xb19f('0x31')](_0x5e479a['getSmsQueues']({'attributes':['id',_0xb19f('0x5')]}));_0x4c2213['push'](_0x5e479a[_0xb19f('0x3b')]({'attributes':['id','name']}));_0x4c2213[_0xb19f('0x31')](_0x5e479a[_0xb19f('0x3c')]({'attributes':['id',_0xb19f('0x5')]}));_0x4c2213['push'](_0x5e479a['getWhatsappQueues']({'attributes':['id',_0xb19f('0x5')]}));break;}return BPromise[_0xb19f('0x3d')](_0x4c2213);}})[_0xb19f('0xc')](function(_0x4f0f6f){if(_0x4f0f6f&&_0x4f0f6f['length']){for(var _0x5454c0=0x0;_0x5454c0<_0x4f0f6f[_0xb19f('0x1f')];_0x5454c0+=0x1){for(var _0x3e2a85=0x0;_0x3e2a85<_0x4f0f6f[_0x5454c0]['length'];_0x3e2a85+=0x1){switch(_0x5454c0){case 0x0:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x3e'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x1:joinOrLeaveQueues(_0x27b8dd,_0x34c638,'chat',_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x2:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x3f'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x3:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x40'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x4:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x41'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x5:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x42'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x6:joinOrLeaveQueues(_0x27b8dd,_0x34c638,_0xb19f('0x43'),_0x4f0f6f[_0x5454c0][_0x3e2a85]);break;case 0x7:if(_0x25fbdc[_0xb19f('0x6')]!==_0xb19f('0x7'))_0x27b8dd[_0x34c638](util[_0xb19f('0x20')](_0xb19f('0x44'),_0x4f0f6f[_0x5454c0][_0x3e2a85][_0xb19f('0x5')]));break;case 0x8:if(_0x25fbdc[_0xb19f('0x6')]!=='agent')_0x27b8dd[_0x34c638](util['format'](_0xb19f('0x45'),_0x4f0f6f[_0x5454c0][_0x3e2a85][_0xb19f('0x5')]));break;case 0x9:if(_0x25fbdc[_0xb19f('0x6')]!==_0xb19f('0x7'))_0x27b8dd[_0x34c638](util[_0xb19f('0x20')]('campaign:%s:%s',_0x4f0f6f[_0x5454c0][_0x3e2a85]['type'],_0x4f0f6f[_0x5454c0][_0x3e2a85][_0xb19f('0x5')]));break;case 0xa:_0x27b8dd[_0x34c638](util['format'](_0xb19f('0x46'),_0x4f0f6f[_0x5454c0][_0x3e2a85][_0xb19f('0x5')]));break;}}}}})[_0xb19f('0xc')](function(){if(_0x34c638==='leave'){var _0x14bea8=_[_0xb19f('0x1b')](_0x25fbdc[_0xb19f('0x47')],'id');return _0x25fbdc[_0xb19f('0x48')](_0x14bea8)[_0xb19f('0xc')](function(){for(var _0x275245=0x0;_0x275245<_0x14bea8[_0xb19f('0x1f')];_0x275245+=0x1){_0x47e313[_0xb19f('0x49')](_0xb19f('0x4a'),{'ChatInteractionId':Number(_0x14bea8[_0x275245]),'UserId':Number(_0x25fbdc['id'])});}});}})[_0xb19f('0xc')](function(){if(_0x34c638===_0xb19f('0x4b')){var _0x28c4fc=_['map'](_0x25fbdc['MailInteractions'],'id');return _0x25fbdc[_0xb19f('0x4c')](_0x28c4fc)[_0xb19f('0xc')](function(){for(var _0x562926=0x0;_0x562926<_0x28c4fc[_0xb19f('0x1f')];_0x562926+=0x1){_0x47e313[_0xb19f('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x28c4fc[_0x562926]),'UserId':Number(_0x25fbdc['id'])});}});}})[_0xb19f('0xc')](function(){if(_0x34c638===_0xb19f('0x4b')){var _0x38ac08=_[_0xb19f('0x1b')](_0x25fbdc['FaxInteractions'],'id');return _0x25fbdc[_0xb19f('0x4d')](_0x38ac08)[_0xb19f('0xc')](function(){for(var _0x177e23=0x0;_0x177e23<_0x38ac08['length'];_0x177e23+=0x1){_0x47e313['emit'](_0xb19f('0x4e'),{'FaxInteractionId':Number(_0x38ac08[_0x177e23]),'UserId':Number(_0x25fbdc['id'])});}});}})[_0xb19f('0xc')](function(){if(_0x34c638===_0xb19f('0x4b')){var _0x3af220=_[_0xb19f('0x1b')](_0x25fbdc['SmsInteractions'],'id');return _0x25fbdc[_0xb19f('0x4f')](_0x3af220)[_0xb19f('0xc')](function(){for(var _0x3b05a6=0x0;_0x3b05a6<_0x3af220['length'];_0x3b05a6+=0x1){_0x47e313[_0xb19f('0x49')](_0xb19f('0x50'),{'SmsInteractionId':Number(_0x3af220[_0x3b05a6]),'UserId':Number(_0x25fbdc['id'])});}});}})['then'](function(){if(_0x34c638===_0xb19f('0x4b')){var _0x4aca93=_[_0xb19f('0x1b')](_0x25fbdc[_0xb19f('0x2a')],'id');return _0x25fbdc['removeOpenchannelInteractions'](_0x4aca93)[_0xb19f('0xc')](function(){for(var _0x934d30=0x0;_0x934d30<_0x4aca93['length'];_0x934d30+=0x1){_0x47e313[_0xb19f('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4aca93[_0x934d30]),'UserId':Number(_0x25fbdc['id'])});}});}})[_0xb19f('0xc')](function(){if(_0x34c638==='leave'){var _0x45905c=_['map'](_0x25fbdc[_0xb19f('0x2c')],'id');return _0x25fbdc['removeWhatsappInteractions'](_0x45905c)['then'](function(){for(var _0x156d14=0x0;_0x156d14<_0x45905c[_0xb19f('0x1f')];_0x156d14+=0x1){_0x47e313[_0xb19f('0x49')](_0xb19f('0x51'),{'WhatsappInteractionId':Number(_0x45905c[_0x156d14]),'UserId':Number(_0x25fbdc['id'])});}});}})[_0xb19f('0x52')](function(_0x14965c){_0x27b8dd['log'](_0x14965c);});}}function onDisconnect(_0x3bd1fa,_0x2cf7e6){joinOrLeave(_0x3bd1fa,_0xb19f('0x4b'),_0x2cf7e6);}function onConnect(_0x2e3ad3){joinOrLeave(_0x2e3ad3,_0xb19f('0x53'));}exports[_0xb19f('0x54')]=function(_0x3f5409){_0x3f5409['on'](_0xb19f('0x55'),function(_0x2bae30){_0x2bae30[_0xb19f('0x56')](0x0);_0x2bae30[_0xb19f('0x57')]=_0x2bae30[_0xb19f('0x58')][_0xb19f('0x55')]['remoteAddress']+':'+_0x2bae30['request']['connection']['remotePort'];_0x2bae30['connectedAt']=new Date();_0x2bae30[_0xb19f('0x59')]=function(_0x4bce88){console['log'](_0xb19f('0x5a')+_0x2bae30[_0xb19f('0x5b')]['name']+'['+_0x2bae30[_0xb19f('0x57')]+']',_0x4bce88);};_0x2bae30['on'](_0xb19f('0x5c'),function(){onDisconnect(_0x2bae30,_0x3f5409);_0x2bae30[_0xb19f('0x59')]('DISCONNECTED');});onConnect(_0x2bae30);_0x2bae30[_0xb19f('0x59')](_0xb19f('0x5d'));});}; \ No newline at end of file +var _0xed1c=['OpenchannelQueue','Trunk','user','voice:outbound','WhatsappQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','all','chat','sms','mail','openchannel','whatsapp','telephone:%s','leave','map','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','Agents','User','name','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','role','Campaign','format','%s:queue:%s','length','handshake','query','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xed1c,0xe4));var _0xced1=function(_0x2666e5,_0x28f58c){_0x2666e5=_0x2666e5-0x0;var _0x29ed8f=_0xed1c[_0x2666e5];return _0x29ed8f;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xced1('0x2'),'model':db[_0xced1('0x3')],'attributes':['id',_0xced1('0x4'),'role'],'raw':!![],'where':{'role':_0xced1('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xced1('0x4')],'where':{'role':_0xced1('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xced1('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xced1('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xced1('0x4'),_0xced1('0x7')],'where':{'type':_0xced1('0x8')}};function getAssociatedResources(_0x354203,_0x3221b6,_0x325dd2){return db[_0xced1('0x9')]['findOne']({'where':{'name':_0x354203,'userProfileId':_0x3221b6},'raw':!![]})[_0xced1('0xa')](function(_0x59c820){if(_0x59c820){if(_0x59c820[_0xced1('0xb')]){switch(_0x354203){case _0xced1('0xc'):case _0xced1('0xd'):case _0xced1('0xe'):case _0xced1('0xf'):case _0xced1('0x10'):case _0xced1('0x11'):case'WhatsappQueues':return db[_0x325dd2][_0xced1('0x12')](queryQueues);case _0xced1('0x13'):return db[_0x325dd2][_0xced1('0x12')](queryTelephones);case _0xced1('0x14'):return db[_0x325dd2]['findAll'](queryTrunks);case _0xced1('0x15'):return db[_0x325dd2][_0xced1('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0xced1('0x12')]({'attributes':[_0xced1('0x16')],'where':{'sectionId':_0x59c820['id']},'raw':!![]})[_0xced1('0xa')](function(_0x32100b){if(_0x32100b){var _0x47baec={'where':{'id':_['map'](_0x32100b,_0xced1('0x16'))},'raw':!![]};switch(_0x325dd2){case _0xced1('0x3'):_0x47baec[_0xced1('0x17')][_0xced1('0x18')]=_0xced1('0x6');break;case _0xced1('0x19'):_0x47baec['where']['type']=_0xced1('0x8');break;}return db[_0x325dd2][_0xced1('0x12')](_0x47baec);}else{return[];}});}}else{return[];}})[_0xced1('0xa')](function(_0x5257e7){return _0x5257e7;});}function joinOrLeaveQueues(_0x1eac14,_0x25f0df,_0x3e51e4,_0x4eed16){_0x1eac14[_0x25f0df](util[_0xced1('0x1a')](_0xced1('0x1b'),_0x3e51e4,_0x4eed16[_0xced1('0x4')]));if(_0x4eed16['Agents']){for(var _0x138c8b=0x0;_0x138c8b<_0x4eed16[_0xced1('0x2')][_0xced1('0x1c')];_0x138c8b+=0x1){_0x1eac14[_0x25f0df](util['format']('user:%s',_0x4eed16[_0xced1('0x2')][_0x138c8b][_0xced1('0x4')]));}}}function joinOrLeave(_0x2a6248,_0x20dcb4,_0x210d7e){var _0x49c8b9;if(_0x2a6248[_0xced1('0x1d')][_0xced1('0x1e')]['id']){db['User']['find']({'attributes':['id',_0xced1('0x4'),_0xced1('0x18'),_0xced1('0x1f')],'where':{'id':_0x2a6248[_0xced1('0x1d')][_0xced1('0x1e')]['id']},'include':[{'model':db[_0xced1('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x21')],'as':_0xced1('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x23')],'as':_0xced1('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x25')],'as':_0xced1('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xced1('0xa')](function(_0x2c2269){if(_0x2c2269){_0x49c8b9=_0x2c2269;_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')](_0xced1('0x29'),_0x2c2269['name']));var _0x59361e=[];switch(_0x2c2269[_0xced1('0x18')]){case _0xced1('0x2a'):_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0xced1('0x2c')];}_0x59361e[_0xced1('0x2d')](db[_0xced1('0x2e')][_0xced1('0x12')](queryQueues));_0x59361e['push'](db[_0xced1('0x2f')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x30')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x31')]['findAll'](queryQueues));_0x59361e['push'](db[_0xced1('0x32')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x33')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db['WhatsappQueue']['findAll'](queryQueues));_0x59361e['push'](db['User'][_0xced1('0x12')](queryTelephones));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x34')][_0xced1('0x12')](queryTrunks));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x19')][_0xced1('0x12')](queryCampaigns));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x3')][_0xced1('0x12')](queryAgents));break;case _0xced1('0x35'):_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4](_0xced1('0x36'));_0x59361e['push'](getAssociatedResources(_0xced1('0xc'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x2e')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xd'),_0x2c2269[_0xced1('0x1f')],'ChatQueue'));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xe'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x30')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xf'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x31')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0x10'),_0x2c2269[_0xced1('0x1f')],'MailQueue'));_0x59361e['push'](getAssociatedResources(_0xced1('0x11'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x33')));_0x59361e['push'](getAssociatedResources(_0xced1('0x37'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x38')));_0x59361e['push'](getAssociatedResources(_0xced1('0x13'),_0x2c2269[_0xced1('0x1f')],'User'));_0x59361e[_0xced1('0x2d')](getAssociatedResources('Trunks',_0x2c2269[_0xced1('0x1f')],_0xced1('0x34')));_0x59361e['push'](getAssociatedResources(_0xced1('0x15'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x19')));_0x59361e['push'](db[_0xced1('0x3')][_0xced1('0x12')](queryAgents));break;case'agent':_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4]('voice:outbound');_0x59361e['push'](_0x2c2269[_0xced1('0x39')]({'attributes':['id','name']}));_0x59361e[_0xced1('0x2d')](_0x2c2269[_0xced1('0x3a')]({'attributes':['id',_0xced1('0x4')]}));_0x59361e['push'](_0x2c2269[_0xced1('0x3b')]({'attributes':['id','name']}));_0x59361e[_0xced1('0x2d')](_0x2c2269[_0xced1('0x3c')]({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getMailQueues']({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getOpenchannelQueues']({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getWhatsappQueues']({'attributes':['id',_0xced1('0x4')]}));break;}return BPromise[_0xced1('0x3d')](_0x59361e);}})[_0xced1('0xa')](function(_0x59f1ba){if(_0x59f1ba&&_0x59f1ba[_0xced1('0x1c')]){for(var _0xcfbed8=0x0;_0xcfbed8<_0x59f1ba[_0xced1('0x1c')];_0xcfbed8+=0x1){for(var _0x3333e6=0x0;_0x3333e6<_0x59f1ba[_0xcfbed8][_0xced1('0x1c')];_0x3333e6+=0x1){switch(_0xcfbed8){case 0x0:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,'voice',_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x1:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x3e'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x2:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,'fax',_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x3:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x3f'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x4:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x40'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x5:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x41'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x6:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x42'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x7:if(_0x49c8b9[_0xced1('0x18')]!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util['format'](_0xced1('0x43'),_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0x8:if(_0x49c8b9['role']!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util['format']('trunk:%s',_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0x9:if(_0x49c8b9[_0xced1('0x18')]!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')]('campaign:%s:%s',_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x7')],_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0xa:_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')]('user:%s',_0x59f1ba[_0xcfbed8][_0x3333e6]['name']));break;}}}}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0xad1d9f=_[_0xced1('0x45')](_0x49c8b9['ChatInteractions'],'id');return _0x49c8b9['removeChatInteractions'](_0xad1d9f)['then'](function(){for(var _0x7df9c5=0x0;_0x7df9c5<_0xad1d9f[_0xced1('0x1c')];_0x7df9c5+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x47'),{'ChatInteractionId':Number(_0xad1d9f[_0x7df9c5]),'UserId':Number(_0x49c8b9['id'])});}});}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x211fd0=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x22')],'id');return _0x49c8b9['removeMailInteractions'](_0x211fd0)[_0xced1('0xa')](function(){for(var _0x3f44e6=0x0;_0x3f44e6<_0x211fd0[_0xced1('0x1c')];_0x3f44e6+=0x1){_0x210d7e['emit'](_0xced1('0x48'),{'MailInteractionId':Number(_0x211fd0[_0x3f44e6]),'UserId':Number(_0x49c8b9['id'])});}});}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x2acfd3=_['map'](_0x49c8b9[_0xced1('0x24')],'id');return _0x49c8b9['removeFaxInteractions'](_0x2acfd3)['then'](function(){for(var _0x1a2b65=0x0;_0x1a2b65<_0x2acfd3[_0xced1('0x1c')];_0x1a2b65+=0x1){_0x210d7e['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2acfd3[_0x1a2b65]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x5dfcf4=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x26')],'id');return _0x49c8b9[_0xced1('0x49')](_0x5dfcf4)[_0xced1('0xa')](function(){for(var _0x39fa12=0x0;_0x39fa12<_0x5dfcf4[_0xced1('0x1c')];_0x39fa12+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x4a'),{'SmsInteractionId':Number(_0x5dfcf4[_0x39fa12]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4==='leave'){var _0x4832d2=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x4b')],'id');return _0x49c8b9[_0xced1('0x4c')](_0x4832d2)['then'](function(){for(var _0x455134=0x0;_0x455134<_0x4832d2[_0xced1('0x1c')];_0x455134+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x4d'),{'OpenchannelInteractionId':Number(_0x4832d2[_0x455134]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x2abd02=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x4e')],'id');return _0x49c8b9[_0xced1('0x4f')](_0x2abd02)[_0xced1('0xa')](function(){for(var _0x44cfbe=0x0;_0x44cfbe<_0x2abd02[_0xced1('0x1c')];_0x44cfbe+=0x1){_0x210d7e['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2abd02[_0x44cfbe]),'UserId':Number(_0x49c8b9['id'])});}});}})['catch'](function(_0x440b22){_0x2a6248['log'](_0x440b22);});}}function onDisconnect(_0x398264,_0x5d28cc){joinOrLeave(_0x398264,'leave',_0x5d28cc);}function onConnect(_0x37bec5){joinOrLeave(_0x37bec5,_0xced1('0x50'));}exports[_0xced1('0x51')]=function(_0x2bdcea){_0x2bdcea['on'](_0xced1('0x52'),function(_0x466da1){_0x466da1[_0xced1('0x53')](0x0);_0x466da1[_0xced1('0x54')]=_0x466da1[_0xced1('0x55')][_0xced1('0x52')][_0xced1('0x56')]+':'+_0x466da1['request'][_0xced1('0x52')][_0xced1('0x57')];_0x466da1['connectedAt']=new Date();_0x466da1[_0xced1('0x58')]=function(_0x26f154){console['log'](_0xced1('0x59')+_0x466da1[_0xced1('0x5a')][_0xced1('0x4')]+'['+_0x466da1[_0xced1('0x54')]+']',_0x26f154);};_0x466da1['on'](_0xced1('0x5b'),function(){onDisconnect(_0x466da1,_0x2bdcea);_0x466da1['log']('DISCONNECTED');});onConnect(_0x466da1);_0x466da1['log'](_0xced1('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 392259a..94b2bc8 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 _0xf974=['default','length','hasOwnProperty','model','callback','util','../../mysqldb','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','error','code','catch','motionChannel','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','name','agent','channel','outgoingmessage','get','event','offlineMessage','opened','SIP/%s','AfterCreate','changed','closed','substatus','User','fullname','internal'];(function(_0x21f1ad,_0x3f0426){var _0x4e6a49=function(_0x4420ed){while(--_0x4420ed){_0x21f1ad['push'](_0x21f1ad['shift']());}};_0x4e6a49(++_0x3f0426);}(_0xf974,0x97));var _0x4f97=function(_0x4ad5d9,_0x18b357){_0x4ad5d9=_0x4ad5d9-0x0;var _0x1730c7=_0xf974[_0x4ad5d9];return _0x1730c7;};'use strict';var util=require(_0x4f97('0x0'));var db=require(_0x4f97('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x4f97('0x2'))(_0x4f97('0x3'));var client=jayson[_0x4f97('0x4')][_0x4f97('0x5')]({'port':0x232a});var triggers=[{'channel':_0x4f97('0x6'),'model':_0x4f97('0x7'),'event':_0x4f97('0x8'),'condition':_0x4f97('0x9'),'callback':afterCreate},{'channel':_0x4f97('0x6'),'model':'ChatInteraction','event':_0x4f97('0xa'),'condition':_0x4f97('0xb'),'callback':afterUpdate},{'channel':_0x4f97('0x6'),'model':_0x4f97('0xc'),'event':_0x4f97('0x8'),'condition':_0x4f97('0xd'),'callback':afterCreateMessage},{'channel':_0x4f97('0x6'),'model':_0x4f97('0xe'),'event':_0x4f97('0x8'),'condition':_0x4f97('0xd'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x4f97('0xf'),'event':_0x4f97('0x8'),'condition':_0x4f97('0x9'),'callback':afterCreate},{'channel':_0x4f97('0x10'),'model':_0x4f97('0xf'),'event':'afterUpdate','condition':_0x4f97('0xb'),'callback':afterUpdate},{'channel':_0x4f97('0x10'),'model':_0x4f97('0x11'),'event':_0x4f97('0x8'),'condition':_0x4f97('0xd'),'callback':afterCreateMessage},{'channel':_0x4f97('0x12'),'model':_0x4f97('0x13'),'event':_0x4f97('0x8'),'condition':_0x4f97('0x9'),'callback':afterCreate},{'channel':_0x4f97('0x12'),'model':_0x4f97('0x13'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0x4f97('0x14'),'event':_0x4f97('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4f97('0x15'),'model':_0x4f97('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x4f97('0x15'),'model':_0x4f97('0x16'),'event':_0x4f97('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4f97('0x15'),'model':_0x4f97('0x17'),'event':_0x4f97('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x4f97('0x18'),'event':_0x4f97('0x8'),'condition':_0x4f97('0x9'),'callback':afterCreate},{'channel':_0x4f97('0x19'),'model':_0x4f97('0x18'),'event':'afterUpdate','condition':_0x4f97('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x4f97('0x1a'),'event':_0x4f97('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4f97('0x1b'),'model':_0x4f97('0x1c'),'event':_0x4f97('0x8'),'condition':_0x4f97('0x9'),'callback':afterCreate},{'channel':_0x4f97('0x1b'),'model':_0x4f97('0x1c'),'event':_0x4f97('0xa'),'condition':_0x4f97('0xb'),'callback':afterUpdate},{'channel':_0x4f97('0x1b'),'model':_0x4f97('0x1d'),'event':_0x4f97('0x8'),'condition':_0x4f97('0xd'),'callback':afterCreateMessage}];function request(_0x2bc464){return client[_0x4f97('0x1e')]('EventManager',_0x2bc464)[_0x4f97('0x1f')](function(_0x566c64){logger[_0x4f97('0x20')](_0x4f97('0x21'),_0x4f97('0x22'),_0x566c64);if(_0x566c64['error']){if(_0x566c64[_0x4f97('0x23')][_0x4f97('0x24')]===0x1f4){logger[_0x4f97('0x23')](_0x4f97('0x21'),_0x4f97('0x22'),_0x566c64[_0x4f97('0x23')]);}}})[_0x4f97('0x25')](function(_0x3c38f6){logger[_0x4f97('0x23')](_0x4f97('0x21'),'EventManager',_0x3c38f6);});}function afterCreateMessage(_0x4b913c){return function(_0x186aaa){_0x186aaa=_0x186aaa['get']({'plain':!![]});_0x186aaa['channel']=_0x4b913c;_0x186aaa[_0x4f97('0x26')]=_0x4b913c;_0x186aaa['event']=_0x186aaa['direction'];Promise[_0x4f97('0x27')]()[_0x4f97('0x1f')](function(){if(typeof _0x186aaa[_0x4f97('0x28')]===_0x4f97('0x29'))return null;var _0x438ef8=_0x4f97('0x2a')+_0x186aaa[_0x4f97('0x28')];return db[_0x4f97('0x2b')][_0x4f97('0x2c')](_0x438ef8,{'type':db[_0x4f97('0x2d')][_0x4f97('0x2e')][_0x4f97('0x2f')],'raw':!![]});})['then'](function(_0x1eda6a){if(_0x1eda6a){_0x186aaa[_0x4f97('0x30')]=_0x1eda6a[0x0];}if(typeof _0x186aaa['UserId']===_0x4f97('0x29'))return;return getAgent(_0x186aaa[_0x4f97('0x31')]);})[_0x4f97('0x1f')](function(_0x2b4aee){if(_0x2b4aee){_0x186aaa[_0x4f97('0x32')]=util[_0x4f97('0x33')]('SIP/%s',_0x2b4aee[_0x4f97('0x34')]);_0x186aaa[_0x4f97('0x35')]=_0x2b4aee;_0x186aaa[_0x4f97('0x36')]=_0x4b913c;return request({'event':'incomingmessage','message':_0x186aaa});}else{return request({'event':_0x4f97('0x37'),'message':_0x186aaa});}})[_0x4f97('0x25')](function(_0x4c093a){logger[_0x4f97('0x23')](_0x4f97('0x21'),'AfterCreateMessage',_0x4c093a);});};}function afterCreateOfflineMessage(_0x40b06d){return function(_0x556591){_0x556591=_0x556591[_0x4f97('0x38')]({'plain':!![]});_0x556591[_0x4f97('0x36')]=_0x40b06d;_0x556591[_0x4f97('0x26')]=_0x40b06d;_0x556591[_0x4f97('0x39')]=_0x4f97('0x3a');return request({'event':_0x556591[_0x4f97('0x39')],'message':_0x556591});};}function afterCreate(_0x17221c,_0xbec63d){return function(_0x242b24){_0x242b24=_0x242b24[_0x4f97('0x38')]({'plain':!![]});_0x242b24[_0x4f97('0x36')]=_0x17221c;_0x242b24[_0x4f97('0x26')]=_0x17221c;_0x242b24[_0x4f97('0x39')]=_0x4f97('0x3b');Promise[_0x4f97('0x27')]()[_0x4f97('0x1f')](function(){var _0x4b603a=_0x4f97('0x2a')+_0x242b24['ContactId'];return db['sequelize'][_0x4f97('0x2c')](_0x4b603a,{'type':db[_0x4f97('0x2d')][_0x4f97('0x2e')][_0x4f97('0x2f')],'raw':!![]});})[_0x4f97('0x1f')](function(_0x37b617){if(_0x37b617){_0x242b24['contact']=_0x37b617[0x0];}if(typeof _0x242b24[_0x4f97('0x31')]===_0x4f97('0x29'))return;return getAgent(_0x242b24[_0x4f97('0x31')]);})[_0x4f97('0x1f')](function(_0x27153a){if(_0x27153a){_0x242b24[_0x4f97('0x32')]=util[_0x4f97('0x33')](_0x4f97('0x3c'),_0x27153a[_0x4f97('0x34')]);_0x242b24[_0x4f97('0x35')]=_0x27153a;}return request({'event':_0xbec63d,'message':_0x242b24});})[_0x4f97('0x25')](function(_0x59a3ce){logger[_0x4f97('0x23')](_0x4f97('0x21'),_0x4f97('0x3d'),_0x59a3ce);});};}function afterUpdate(_0x2aa908){return function(_0x116a49){var _0xf79df0=_0x116a49[_0x4f97('0x3e')](_0x4f97('0x3f'))&&_0x116a49[_0x4f97('0x3f')];var _0x460941=_0x116a49[_0x4f97('0x3e')](_0x4f97('0x40'));if(_0xf79df0||_0x460941){var _0x54df24=_0xf79df0?'closedinteraction':_0x4f97('0x40');var _0x4969e7=_0x116a49[_0x4f97('0x38')]({'plain':!![]});_0x4969e7[_0x4f97('0x36')]=_0x2aa908;_0x4969e7['motionChannel']=_0x2aa908;_0x4969e7[_0x4f97('0x39')]=_0xf79df0?_0x4f97('0x3f'):_0x4f97('0x40');var _0x50aad3=_0x4f97('0x2a')+_0x4969e7[_0x4f97('0x28')];return db[_0x4f97('0x2b')][_0x4f97('0x2c')](_0x50aad3,{'type':db[_0x4f97('0x2d')][_0x4f97('0x2e')][_0x4f97('0x2f')],'raw':!![]})[_0x4f97('0x1f')](function(_0x52886e){if(_0x52886e){_0x4969e7[_0x4f97('0x30')]=_0x52886e[0x0];}if(typeof _0x4969e7[_0x4f97('0x31')]===_0x4f97('0x29'))return;return getAgent(_0x4969e7['UserId']);})[_0x4f97('0x1f')](function(_0x4d5644){if(_0x4d5644){_0x4969e7[_0x4f97('0x32')]=util[_0x4f97('0x33')](_0x4f97('0x3c'),_0x4d5644[_0x4f97('0x34')]);_0x4969e7[_0x4f97('0x35')]=_0x4d5644;}return request({'event':_0x54df24,'message':_0x4969e7});})[_0x4f97('0x25')](function(_0x2f670b){logger[_0x4f97('0x23')](_0x4f97('0x21'),'AfterUpdate',_0x2f670b);});}};}function getAgent(_0x370ec0){return db[_0x4f97('0x41')]['find']({'where':{'id':_0x370ec0},'attributes':['id',_0x4f97('0x34'),_0x4f97('0x42'),'email',_0x4f97('0x43')],'raw':!![]})[_0x4f97('0x1f')](function(_0x2f90ef){return _0x2f90ef;});}exports[_0x4f97('0x44')]=function(){for(var _0x183f49=0x0;_0x183f49=_0x2c2207['agents']){throw Error(_0x7803('0x12'));}_0x29cfe7(_0x4d494c);})[_0x7803('0x13')](function(_0x47d6a7){_0x2f4916(_0x47d6a7);});});}; \ No newline at end of file +var _0x1a77=['getChannels','isValidChannel','toLowerCase','includes','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents','catch','../mysqldb','./license/util','voice','mail','chat','fax','whatsapp','openchannel'];(function(_0x3f5855,_0x585203){var _0x270df8=function(_0x496695){while(--_0x496695){_0x3f5855['push'](_0x3f5855['shift']());}};_0x270df8(++_0x585203);}(_0x1a77,0x187));var _0x71a7=function(_0x1a5ba0,_0x20cdd8){_0x1a5ba0=_0x1a5ba0-0x0;var _0x58a3c1=_0x1a77[_0x1a5ba0];return _0x58a3c1;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x71a7('0x0'))['db'];var util=require(_0x71a7('0x1'));var channels=[_0x71a7('0x2'),_0x71a7('0x3'),_0x71a7('0x4'),_0x71a7('0x5'),'sms',_0x71a7('0x6'),_0x71a7('0x7')];exports[_0x71a7('0x8')]=function(){return channels;};exports[_0x71a7('0x9')]=function(_0x117753){_0x117753=_0x117753[_0x71a7('0xa')]();return _[_0x71a7('0xb')](channels,_0x117753);};exports['clearBlockUser']=function(_0x4f1edb,_0x4febf8,_0x8ca589,_0x2d3e65){var _0x373886={'loginAttempts':_0x4febf8,'blocked':_0x8ca589};if(!_['isUndefined'](_0x2d3e65)){_0x373886[_0x71a7('0xc')]=_0x2d3e65;}return _0x4f1edb[_0x71a7('0xd')](_0x373886);};exports[_0x71a7('0xe')]=function(_0x4ef75e){return new BPromise(function(_0x12af02,_0x22c19a){var _0x443727=0x0;if(_0x4ef75e['role']!==_0x71a7('0xf')){_0x12af02(_0x4ef75e);}db[_0x71a7('0x10')][_0x71a7('0x11')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4ef75e['id']}}})[_0x71a7('0x12')](function(_0x319494){_0x443727=_0x319494;return util[_0x71a7('0xe')]();})[_0x71a7('0x12')](function(_0xa969ae){if(_0xa969ae&&_0xa969ae[_0x71a7('0x13')]&&_0x443727>=_0xa969ae[_0x71a7('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x12af02(_0x4ef75e);})[_0x71a7('0x14')](function(_0x2cdb21){_0x22c19a(_0x2cdb21);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 5a6af71..249289b 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb0bca1,_0x284c75){_0xb0bca1=_0xb0bca1-0x0;var _0x1a2343=_0x9bde[_0xb0bca1];return _0x1a2343;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xaa88=['Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits','Entity\x20not\x20found'];(function(_0x2688d0,_0x51446f){var _0x38a49d=function(_0x7b462e){while(--_0x7b462e){_0x2688d0['push'](_0x2688d0['shift']());}};_0x38a49d(++_0x51446f);}(_0xaa88,0x137));var _0x8aa8=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0xaa88[_0x31b31b];return _0x2c8fc2;};'use strict';var util=require(_0x8aa8('0x0'));var logger=require(_0x8aa8('0x1'))(_0x8aa8('0x2'));var APIError=function(_0x51c79b,_0x4aee38){this[_0x8aa8('0x3')]=_0x51c79b||_0x8aa8('0x4');this[_0x8aa8('0x5')]=_0x4aee38||_0x8aa8('0x6');util[_0x8aa8('0x7')](APIError,Error);};var APIBadRequestError=function(_0x350e8b){this['message']=_0x350e8b||'Bad\x20Request';this[_0x8aa8('0x5')]='Bad\x20Request';util[_0x8aa8('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1ed84d){this[_0x8aa8('0x3')]=_0x1ed84d||_0x8aa8('0x8');this['name']=_0x8aa8('0x9');util[_0x8aa8('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x224f25){switch(_0x224f25){case'Bad\x20Request':return 0x190;case _0x8aa8('0xa'),_0x8aa8('0xb'):return 0x193;case _0x8aa8('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x33cc5c){return function(_0x583688){logger[_0x8aa8('0xc')](_0x583688[_0x8aa8('0xd')]);var _0x50787d=getStatusCode(_0x583688[_0x8aa8('0x5')]);if(_0x583688[_0x8aa8('0x5')])delete _0x583688[_0x8aa8('0x5')];return _0x33cc5c['status'](_0x50787d)[_0x8aa8('0xe')](_0x583688);};}module[_0x8aa8('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fb1b151..31e2bea 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac0b=['send','exports','status','render','json'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xac0b,0x164));var _0xbac0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xac0b[_0x122ef9];return _0x42fba0;};'use strict';module[_0xbac0('0x0')][0x194]=function pageNotFound(_0x22858b,_0x1e1206){var _0x4f66d2='404';var _0x16617f=0x194;var _0x5dfa9b={'status':_0x16617f};_0x1e1206[_0xbac0('0x1')](_0x5dfa9b[_0xbac0('0x1')]);_0x1e1206[_0xbac0('0x2')](_0x4f66d2,{},function(_0x514b99,_0x514d38){if(_0x514b99){return _0x1e1206['status'](_0x5dfa9b[_0xbac0('0x1')])[_0xbac0('0x3')](_0x5dfa9b);}_0x1e1206[_0xbac0('0x4')](_0x514d38);});}; \ No newline at end of file +var _0x66e5=['json','exports','status','render'];(function(_0x401fd6,_0x2051db){var _0x3260e6=function(_0x50ba7d){while(--_0x50ba7d){_0x401fd6['push'](_0x401fd6['shift']());}};_0x3260e6(++_0x2051db);}(_0x66e5,0x1a1));var _0x566e=function(_0x4f3da4,_0x121375){_0x4f3da4=_0x4f3da4-0x0;var _0x1df1a1=_0x66e5[_0x4f3da4];return _0x1df1a1;};'use strict';module[_0x566e('0x0')][0x194]=function pageNotFound(_0x5b934e,_0x5e02a4){var _0x10680e='404';var _0x473887=0x194;var _0x1bb931={'status':_0x473887};_0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')]);_0x5e02a4[_0x566e('0x2')](_0x10680e,{},function(_0x54866a,_0x36fb76){if(_0x54866a){return _0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')])[_0x566e('0x3')](_0x1bb931);}_0x5e02a4['send'](_0x36fb76);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index edc93d9..ff294e2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3da9698..adebc52 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f78=['./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','/apidoc','join','/www','static','root','/demo','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','path','setupLoggers','./api/client-side-logs','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups'];(function(_0x51c4f3,_0x1ce048){var _0x2d46be=function(_0x2f2163){while(--_0x2f2163){_0x51c4f3['push'](_0x51c4f3['shift']());}};_0x2d46be(++_0x1ce048);}(_0x1f78,0x1ca));var _0x81f7=function(_0x227495,_0x5cbc90){_0x227495=_0x227495-0x0;var _0x4365e3=_0x1f78[_0x227495];return _0x4365e3;};'use strict';var path=require(_0x81f7('0x0'));var express=require('express');var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x81f7('0x1')];var clientSideLogs=require(_0x81f7('0x2'));exports['default']=function(_0x49816b){return setupLoggers(_0x49816b)[_0x81f7('0x3')](function(){_0x49816b['use'](_0x81f7('0x4'),require(_0x81f7('0x5')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x7'),require(_0x81f7('0x8')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x9'),require(_0x81f7('0xa')));_0x49816b[_0x81f7('0x6')]('/api/voice/extensions',require(_0x81f7('0xb')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xc'),require('./api/voiceMusicOnHold'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd'),require('./api/voiceQueue'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xe'),require(_0x81f7('0xf')));_0x49816b['use'](_0x81f7('0x10'),require(_0x81f7('0x11')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x12'),require(_0x81f7('0x13')));_0x49816b[_0x81f7('0x6')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x14'),require(_0x81f7('0x15')));_0x49816b['use'](_0x81f7('0x16'),require('./api/voiceDialReport'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x17'),require(_0x81f7('0x18')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x19'),require(_0x81f7('0x1a')));_0x49816b['use'](_0x81f7('0x1b'),require(_0x81f7('0x1c')));_0x49816b[_0x81f7('0x6')]('/api/trunks',require(_0x81f7('0x1d')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x1e'),require(_0x81f7('0x1f')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x20'),require('./api/mailServerOut'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x21'),require('./api/mailAccount'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x22'),require(_0x81f7('0x23')));_0x49816b[_0x81f7('0x6')]('/api/mail/substatuses',require(_0x81f7('0x24')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x25'),require(_0x81f7('0x26')));_0x49816b['use'](_0x81f7('0x27'),require('./api/mailMessage'));_0x49816b['use'](_0x81f7('0x28'),require(_0x81f7('0x29')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x2a'),require(_0x81f7('0x2b')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x2c'),require(_0x81f7('0x2d')));_0x49816b['use']('/api/dashboards/items',require(_0x81f7('0x2e')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x2f'),require(_0x81f7('0x30')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x31'),require(_0x81f7('0x32')));_0x49816b['use'](_0x81f7('0x33'),require(_0x81f7('0x34')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x35'),require(_0x81f7('0x36')));_0x49816b['use']('/api/fax/queues',require('./api/faxQueue'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x37'),require(_0x81f7('0x38')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x39'),require(_0x81f7('0x3a')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x3b'),require('./api/smsApplication'));_0x49816b['use'](_0x81f7('0x3c'),require(_0x81f7('0x3d')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x3e'),require(_0x81f7('0x3f')));_0x49816b['use'](_0x81f7('0x40'),require(_0x81f7('0x41')));_0x49816b[_0x81f7('0x6')]('/api/openchannel/accounts',require(_0x81f7('0x42')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x43'),require('./api/openchannelApplication'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x44'),require(_0x81f7('0x45')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x46'),require(_0x81f7('0x47')));_0x49816b['use'](_0x81f7('0x48'),require(_0x81f7('0x49')));_0x49816b[_0x81f7('0x6')]('/api/chat/websites',require(_0x81f7('0x4a')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x4b'),require(_0x81f7('0x4c')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x4d'),require(_0x81f7('0x4e')));_0x49816b['use'](_0x81f7('0x4f'),require('./api/chatInteraction'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x50'),require(_0x81f7('0x51')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x52'),require(_0x81f7('0x53')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x54'),require('./api/chatQueue'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x55'),require(_0x81f7('0x56')));_0x49816b[_0x81f7('0x6')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x57'),require(_0x81f7('0x58')));_0x49816b['use'](_0x81f7('0x59'),require('./api/cmContact'));_0x49816b[_0x81f7('0x6')]('/api/cm/hopper',require('./api/cmHopper'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x5a'),require(_0x81f7('0x5b')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x5c'),require('./api/cmHopperFinal'));_0x49816b['use'](_0x81f7('0x5d'),require(_0x81f7('0x5e')));_0x49816b['use'](_0x81f7('0x5f'),require(_0x81f7('0x60')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x61'),require(_0x81f7('0x62')));_0x49816b['use'](_0x81f7('0x63'),require(_0x81f7('0x64')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x65'),require('./api/cannedAnswer'));_0x49816b['use'](_0x81f7('0x66'),require(_0x81f7('0x67')));_0x49816b['use'](_0x81f7('0x68'),require(_0x81f7('0x69')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x6a'),require(_0x81f7('0x6b')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x6c'),require('./api/pause'));_0x49816b['use'](_0x81f7('0x6d'),require(_0x81f7('0x6e')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x6f'),require(_0x81f7('0x70')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x71'),require(_0x81f7('0x72')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x73'),require(_0x81f7('0x74')));_0x49816b['use'](_0x81f7('0x75'),require(_0x81f7('0x76')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x77'),require('./api/contactItemType'));_0x49816b[_0x81f7('0x6')]('/api/cm_contact_has_items',require(_0x81f7('0x78')));_0x49816b['use']('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x79'),require(_0x81f7('0x7a')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x7b'),require('./api/trigger'));_0x49816b['use'](_0x81f7('0x7c'),require(_0x81f7('0x7d')));_0x49816b[_0x81f7('0x6')]('/api/integrations',require(_0x81f7('0x7e')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x7f'),require('./api/integrationReport'));_0x49816b['use']('/api/analytics/custom_reports',require(_0x81f7('0x80')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x81'),require(_0x81f7('0x82')));_0x49816b[_0x81f7('0x6')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x49816b[_0x81f7('0x6')](_0x81f7('0x83'),require(_0x81f7('0x84')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x85'),require(_0x81f7('0x86')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x87'),require(_0x81f7('0x88')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x89'),require(_0x81f7('0x8a')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x8b'),require(_0x81f7('0x8c')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x8d'),require(_0x81f7('0x8e')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x8f'),require(_0x81f7('0x90')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x91'),require(_0x81f7('0x92')));_0x49816b['use'](_0x81f7('0x93'),require(_0x81f7('0x94')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x95'),require(_0x81f7('0x96')));_0x49816b[_0x81f7('0x6')]('/api/integrations/desk/configurations',require(_0x81f7('0x97')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x98'),require(_0x81f7('0x99')));_0x49816b[_0x81f7('0x6')]('/api/integrations/zoho/accounts',require(_0x81f7('0x9a')));_0x49816b['use'](_0x81f7('0x9b'),require(_0x81f7('0x9c')));_0x49816b['use'](_0x81f7('0x9d'),require(_0x81f7('0x9e')));_0x49816b['use'](_0x81f7('0x9f'),require(_0x81f7('0xa0')));_0x49816b[_0x81f7('0x6')]('/api/integrations/zendesk/configurations',require(_0x81f7('0xa1')));_0x49816b['use']('/api/integrations/zendesk/fields',require(_0x81f7('0xa2')));_0x49816b[_0x81f7('0x6')]('/api/integrations/freshdesk/accounts',require(_0x81f7('0xa3')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xa4'),require('./api/intFreshdeskConfiguration'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xa5'),require(_0x81f7('0xa6')));_0x49816b[_0x81f7('0x6')]('/api/integrations/vtiger/accounts',require(_0x81f7('0xa7')));_0x49816b['use'](_0x81f7('0xa8'),require('./api/intVtigerConfiguration'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xa9'),require('./api/intVtigerField'));_0x49816b[_0x81f7('0x6')]('/api/integrations/servicenow/accounts',require(_0x81f7('0xaa')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xab'),require(_0x81f7('0xac')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xad'),require(_0x81f7('0xae')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xaf'),require('./api/intDynamics365Account'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xb0'),require(_0x81f7('0xb1')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xb2'),require(_0x81f7('0xb3')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xb4'),require(_0x81f7('0xb5')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xb6'),require(_0x81f7('0xb7')));_0x49816b['use'](_0x81f7('0xb8'),require(_0x81f7('0xb9')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xba'),require(_0x81f7('0xbb')));_0x49816b['use']('/api/chat/reports/queue',require(_0x81f7('0xbc')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xbd'),require(_0x81f7('0xbe')));_0x49816b['use'](_0x81f7('0xbf'),require(_0x81f7('0xc0')));_0x49816b[_0x81f7('0x6')]('/api/jscripty/questions/reports',require(_0x81f7('0xc1')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xc2'),require('./api/jscriptySessionReport'));_0x49816b[_0x81f7('0x6')]('/api/sms/reports/queue',require(_0x81f7('0xc3')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xc4'),require(_0x81f7('0xc5')));_0x49816b['use'](_0x81f7('0xc6'),require(_0x81f7('0xc7')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xc8'),require('./api/jscriptyProject'));_0x49816b['use']('/api/settings',require('./api/setting'));_0x49816b[_0x81f7('0x6')]('/api/square/odbc',require(_0x81f7('0xc9')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xca'),require('./api/squareProject'));_0x49816b[_0x81f7('0x6')]('/api/square/recordings',require(_0x81f7('0xcb')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xcc'),require(_0x81f7('0xcd')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xce'),require(_0x81f7('0xcf')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd0'),require(_0x81f7('0xd1')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd2'),require(_0x81f7('0xd3')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd4'),require('./api/migration'));_0x49816b['use'](_0x81f7('0xd5'),require('./api/attachment'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd6'),require(_0x81f7('0xd7')));_0x49816b['use']('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x49816b[_0x81f7('0x6')](_0x81f7('0xd8'),require(_0x81f7('0xd9')));_0x49816b['use']('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x49816b['use']('/api/openchannel/reports/transfer',require(_0x81f7('0xda')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xdb'),require(_0x81f7('0xdc')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xdd'),require('./api/cmList'));_0x49816b['use']('/api/voice/prefixes',require(_0x81f7('0xde')));_0x49816b['use'](_0x81f7('0xdf'),require(_0x81f7('0xe0')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xe1'),require(_0x81f7('0xe2')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xe3'),require(_0x81f7('0xe4')));_0x49816b[_0x81f7('0x6')]('/api/userNotifications',require(_0x81f7('0xe5')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xe6'),require(_0x81f7('0xe7')));_0x49816b['use'](_0x81f7('0xe8'),require(_0x81f7('0xe9')));_0x49816b[_0x81f7('0x6')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x49816b['use']('/api/whatsapp/messages',require(_0x81f7('0xea')));_0x49816b['use'](_0x81f7('0xeb'),require(_0x81f7('0xec')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xed'),require(_0x81f7('0xee')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xef'),require(_0x81f7('0xf0')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xf1'),require(_0x81f7('0xf2')));_0x49816b['use'](_0x81f7('0xf3'),require(_0x81f7('0xf4')));_0x49816b[_0x81f7('0x6')]('/api/user-settings',require(_0x81f7('0xf5')));_0x49816b['use'](_0x81f7('0xf6'),require(_0x81f7('0xf7')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xf8'),require(_0x81f7('0xf9')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xfa'),require(_0x81f7('0xfb')));_0x49816b[_0x81f7('0x6')]('/api/jira',require(_0x81f7('0xfc')));_0x49816b['use']('/api/rpc',require(_0x81f7('0xfd')));_0x49816b[_0x81f7('0x6')](_0x81f7('0xfe'),require('./api/version'));_0x49816b['use'](_0x81f7('0xff'),require(_0x81f7('0x100')));_0x49816b[_0x81f7('0x6')]('/api/pm2',require('./api/pm2'));_0x49816b['use'](_0x81f7('0x101'),require(_0x81f7('0x102')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x103'),clientSideLogs);_0x49816b[_0x81f7('0x6')](_0x81f7('0x104'),express['static'](path[_0x81f7('0x105')](config['root'],_0x81f7('0x104'))));_0x49816b[_0x81f7('0x6')](_0x81f7('0x106'),express[_0x81f7('0x107')](path[_0x81f7('0x105')](config[_0x81f7('0x108')],'/www')));_0x49816b[_0x81f7('0x6')](_0x81f7('0x109'),express[_0x81f7('0x107')](path[_0x81f7('0x105')](config[_0x81f7('0x108')],_0x81f7('0x109'))));_0x49816b[_0x81f7('0x6')]('/snippet',express[_0x81f7('0x107')](path['join'](config[_0x81f7('0x108')],'snippet','3.1.0')));_0x49816b[_0x81f7('0x6')]('/plugins',express['static'](path[_0x81f7('0x105')](config['root'],_0x81f7('0x10a'))));_0x49816b[_0x81f7('0x10b')](_0x81f7('0x10c'))['get'](errors[0x194]);_0x49816b['route']('/*')[_0x81f7('0x10d')](function(_0x16d180,_0x13f3e3){_0x13f3e3['sendFile'](path[_0x81f7('0x10e')](_0x49816b[_0x81f7('0x10d')]('appPath')+_0x81f7('0x10f')));});return _0x49816b;});}; \ No newline at end of file +var _0x17cb=['/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./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/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/square/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./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/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','/server/files/plugins','route','get','resolve','appPath','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./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/chatProactiveAction','/api/cm/companies','./api/cmCompany'];(function(_0x13e45b,_0x5dff4e){var _0xc86a8d=function(_0x642ae2){while(--_0x642ae2){_0x13e45b['push'](_0x13e45b['shift']());}};_0xc86a8d(++_0x5dff4e);}(_0x17cb,0xb5));var _0xb17c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17cb[_0x321bb2];return _0x9c12ed;};'use strict';var path=require('path');var express=require('express');var errors=require(_0xb17c('0x0'));var config=require(_0xb17c('0x1'));var setupLoggers=require(_0xb17c('0x2'))[_0xb17c('0x3')];var clientSideLogs=require(_0xb17c('0x4'));exports[_0xb17c('0x5')]=function(_0xaddbe0){return setupLoggers(_0xaddbe0)[_0xb17c('0x6')](function(){_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8'),require('./api/user'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x9'),require('./api/voiceChanSpy'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xa'),require('./api/voiceContext'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xb'),require(_0xb17c('0xc')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd'),require(_0xb17c('0xe')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf'),require(_0xb17c('0x10')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x11'),require(_0xb17c('0x12')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x13'),require('./api/screenRecording'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x14'),require(_0xb17c('0x15')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x16'),require(_0xb17c('0x17')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x18'),require('./api/voiceCallReport'));_0xaddbe0[_0xb17c('0x7')]('/api/voice/dials/reports',require(_0xb17c('0x19')));_0xaddbe0[_0xb17c('0x7')]('/api/voice/agents/reports',require(_0xb17c('0x1a')));_0xaddbe0[_0xb17c('0x7')]('/api/voice/queues/reports',require(_0xb17c('0x1b')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x1c'),require(_0xb17c('0x1d')));_0xaddbe0['use']('/api/trunks',require(_0xb17c('0x1e')));_0xaddbe0['use'](_0xb17c('0x1f'),require(_0xb17c('0x20')));_0xaddbe0['use'](_0xb17c('0x21'),require(_0xb17c('0x22')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x23'),require(_0xb17c('0x24')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x25'),require(_0xb17c('0x26')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x27'),require(_0xb17c('0x28')));_0xaddbe0['use'](_0xb17c('0x29'),require(_0xb17c('0x2a')));_0xaddbe0[_0xb17c('0x7')]('/api/mail/messages',require(_0xb17c('0x2b')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x2c'),require(_0xb17c('0x2d')));_0xaddbe0['use']('/api/mail/reports/queue',require(_0xb17c('0x2e')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x2f'),require(_0xb17c('0x30')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x31'),require(_0xb17c('0x32')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x33'),require(_0xb17c('0x34')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x35'),require(_0xb17c('0x36')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x37'),require(_0xb17c('0x38')));_0xaddbe0[_0xb17c('0x7')]('/api/fax/messages',require(_0xb17c('0x39')));_0xaddbe0[_0xb17c('0x7')]('/api/fax/queues',require(_0xb17c('0x3a')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x3b'),require('./api/faxQueueReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x3c'),require(_0xb17c('0x3d')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x3e'),require(_0xb17c('0x3f')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x40'),require(_0xb17c('0x41')));_0xaddbe0['use'](_0xb17c('0x42'),require(_0xb17c('0x43')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x44'),require(_0xb17c('0x45')));_0xaddbe0[_0xb17c('0x7')]('/api/openchannel/accounts',require(_0xb17c('0x46')));_0xaddbe0['use']('/api/openchannel/applications',require(_0xb17c('0x47')));_0xaddbe0[_0xb17c('0x7')]('/api/openchannel/interactions',require(_0xb17c('0x48')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x49'),require(_0xb17c('0x4a')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x4b'),require(_0xb17c('0x4c')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x4d'),require(_0xb17c('0x4e')));_0xaddbe0['use'](_0xb17c('0x4f'),require(_0xb17c('0x50')));_0xaddbe0[_0xb17c('0x7')]('/api/chat/applications',require(_0xb17c('0x51')));_0xaddbe0[_0xb17c('0x7')]('/api/chat/interactions',require(_0xb17c('0x52')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x53'),require(_0xb17c('0x54')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x55'),require(_0xb17c('0x56')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x57'),require(_0xb17c('0x58')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x59'),require(_0xb17c('0x5a')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x5b'),require(_0xb17c('0x5c')));_0xaddbe0['use'](_0xb17c('0x5d'),require(_0xb17c('0x5e')));_0xaddbe0['use'](_0xb17c('0x5f'),require('./api/cmContact'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x60'),require(_0xb17c('0x61')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x62'),require(_0xb17c('0x63')));_0xaddbe0[_0xb17c('0x7')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0xaddbe0[_0xb17c('0x7')]('/api/cm/hopper_history',require(_0xb17c('0x64')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x65'),require(_0xb17c('0x66')));_0xaddbe0['use'](_0xb17c('0x67'),require(_0xb17c('0x68')));_0xaddbe0['use'](_0xb17c('0x69'),require(_0xb17c('0x6a')));_0xaddbe0[_0xb17c('0x7')]('/api/canned_answers',require(_0xb17c('0x6b')));_0xaddbe0['use'](_0xb17c('0x6c'),require(_0xb17c('0x6d')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x6e'),require(_0xb17c('0x6f')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x70'),require(_0xb17c('0x71')));_0xaddbe0[_0xb17c('0x7')]('/api/pauses',require('./api/pause'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x72'),require(_0xb17c('0x73')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x74'),require(_0xb17c('0x75')));_0xaddbe0[_0xb17c('0x7')]('/api/schedules',require('./api/schedule'));_0xaddbe0[_0xb17c('0x7')]('/api/sounds',require(_0xb17c('0x76')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x77'),require(_0xb17c('0x78')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x79'),require('./api/contactItemType'));_0xaddbe0[_0xb17c('0x7')]('/api/cm_contact_has_items',require(_0xb17c('0x7a')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x7b'),require('./api/cmHopperAdditionalPhone'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x7c'),require('./api/template'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x7d'),require('./api/trigger'));_0xaddbe0[_0xb17c('0x7')]('/api/variables',require(_0xb17c('0x7e')));_0xaddbe0['use']('/api/integrations',require(_0xb17c('0x7f')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x80'),require(_0xb17c('0x81')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x82'),require(_0xb17c('0x83')));_0xaddbe0['use'](_0xb17c('0x84'),require(_0xb17c('0x85')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x86'),require(_0xb17c('0x87')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x88'),require(_0xb17c('0x89')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8a'),require('./api/analyticFieldReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8b'),require('./api/analyticTreeReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8c'),require('./api/intSalesforceAccount'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8d'),require(_0xb17c('0x8e')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x8f'),require('./api/intSalesforceField'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x90'),require('./api/intSugarcrmAccount'));_0xaddbe0[_0xb17c('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xb17c('0x91')));_0xaddbe0[_0xb17c('0x7')]('/api/integrations/sugarcrm/fields',require(_0xb17c('0x92')));_0xaddbe0['use'](_0xb17c('0x93'),require(_0xb17c('0x94')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x95'),require(_0xb17c('0x96')));_0xaddbe0['use']('/api/integrations/desk/fields',require(_0xb17c('0x97')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x98'),require(_0xb17c('0x99')));_0xaddbe0['use'](_0xb17c('0x9a'),require(_0xb17c('0x9b')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x9c'),require(_0xb17c('0x9d')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x9e'),require('./api/intZendeskAccount'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x9f'),require(_0xb17c('0xa0')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xa1'),require(_0xb17c('0xa2')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xa3'),require(_0xb17c('0xa4')));_0xaddbe0['use'](_0xb17c('0xa5'),require(_0xb17c('0xa6')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xa7'),require(_0xb17c('0xa8')));_0xaddbe0['use'](_0xb17c('0xa9'),require(_0xb17c('0xaa')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xab'),require(_0xb17c('0xac')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xad'),require(_0xb17c('0xae')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xaf'),require('./api/intServicenowAccount'));_0xaddbe0['use'](_0xb17c('0xb0'),require('./api/intServicenowConfiguration'));_0xaddbe0['use'](_0xb17c('0xb1'),require('./api/intServicenowField'));_0xaddbe0['use'](_0xb17c('0xb2'),require(_0xb17c('0xb3')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xb4'),require(_0xb17c('0xb5')));_0xaddbe0['use']('/api/integrations/dynamics365/fields',require(_0xb17c('0xb6')));_0xaddbe0[_0xb17c('0x7')]('/api/integrations/freshsales/accounts',require(_0xb17c('0xb7')));_0xaddbe0['use'](_0xb17c('0xb8'),require(_0xb17c('0xb9')));_0xaddbe0[_0xb17c('0x7')]('/api/integrations/freshsales/fields',require(_0xb17c('0xba')));_0xaddbe0['use']('/api/networks',require(_0xb17c('0xbb')));_0xaddbe0['use'](_0xb17c('0xbc'),require(_0xb17c('0xbd')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xbe'),require('./api/chatInternalMessage'));_0xaddbe0['use'](_0xb17c('0xbf'),require('./api/jscriptyAnswerReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc0'),require(_0xb17c('0xc1')));_0xaddbe0[_0xb17c('0x7')]('/api/jscripty/sessions/reports',require(_0xb17c('0xc2')));_0xaddbe0[_0xb17c('0x7')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc3'),require('./api/squareReport'));_0xaddbe0[_0xb17c('0x7')]('/api/square/details/reports',require('./api/squareReportDetail'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc4'),require(_0xb17c('0xc5')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc6'),require('./api/setting'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc7'),require(_0xb17c('0xc8')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xc9'),require('./api/squareProject'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xca'),require('./api/squareRecording'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xcb'),require(_0xb17c('0xcc')));_0xaddbe0[_0xb17c('0x7')]('/api/teams',require(_0xb17c('0xcd')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xce'),require(_0xb17c('0xcf')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd0'),require('./api/campaign'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd1'),require(_0xb17c('0xd2')));_0xaddbe0['use'](_0xb17c('0xd3'),require('./api/attachment'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd4'),require(_0xb17c('0xd5')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd6'),require(_0xb17c('0xd7')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xd8'),require(_0xb17c('0xd9')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xda'),require('./api/faxTransferReport'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xdb'),require(_0xb17c('0xdc')));_0xaddbe0['use'](_0xb17c('0xdd'),require(_0xb17c('0xde')));_0xaddbe0[_0xb17c('0x7')]('/api/cm/lists',require(_0xb17c('0xdf')));_0xaddbe0[_0xb17c('0x7')]('/api/voice/prefixes',require(_0xb17c('0xe0')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xe1'),require(_0xb17c('0xe2')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xe3'),require(_0xb17c('0xe4')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xe5'),require(_0xb17c('0xe6')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xe7'),require(_0xb17c('0xe8')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xe9'),require('./api/whatsappAccount'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xea'),require(_0xb17c('0xeb')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xec'),require(_0xb17c('0xed')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xee'),require(_0xb17c('0xef')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf0'),require(_0xb17c('0xf1')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf2'),require(_0xb17c('0xf3')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf4'),require('./api/whatsappQueue'));_0xaddbe0[_0xb17c('0x7')]('/api/cloudProviders',require(_0xb17c('0xf5')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf6'),require(_0xb17c('0xf7')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf8'),require('./api/user-setting'));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xf9'),require(_0xb17c('0xfa')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xfb'),require(_0xb17c('0xfc')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xfd'),require(_0xb17c('0xfe')));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0xff'),require(_0xb17c('0x100')));_0xaddbe0[_0xb17c('0x7')]('/api/rpc',require(_0xb17c('0x101')));_0xaddbe0['use'](_0xb17c('0x102'),require('./api/version'));_0xaddbe0['use'](_0xb17c('0x103'),require(_0xb17c('0x104')));_0xaddbe0['use'](_0xb17c('0x105'),require(_0xb17c('0x106')));_0xaddbe0[_0xb17c('0x7')]('/api/webbar',require(_0xb17c('0x107')));_0xaddbe0['use']('/api/logs',clientSideLogs);_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x108'),express[_0xb17c('0x109')](path[_0xb17c('0x10a')](config[_0xb17c('0x10b')],'/apidoc')));_0xaddbe0['use'](_0xb17c('0x10c'),express[_0xb17c('0x109')](path[_0xb17c('0x10a')](config[_0xb17c('0x10b')],_0xb17c('0x10c'))));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x10d'),express['static'](path[_0xb17c('0x10a')](config['root'],_0xb17c('0x10d'))));_0xaddbe0[_0xb17c('0x7')](_0xb17c('0x10e'),express[_0xb17c('0x109')](path[_0xb17c('0x10a')](config[_0xb17c('0x10b')],'snippet','3.1.0')));_0xaddbe0[_0xb17c('0x7')]('/plugins',express[_0xb17c('0x109')](path[_0xb17c('0x10a')](config[_0xb17c('0x10b')],_0xb17c('0x10f'))));_0xaddbe0[_0xb17c('0x110')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb17c('0x111')](errors[0x194]);_0xaddbe0[_0xb17c('0x110')]('/*')['get'](function(_0xef200f,_0x274661){_0x274661['sendFile'](path[_0xb17c('0x112')](_0xaddbe0[_0xb17c('0x111')](_0xb17c('0x113'))+'/index.html'));});return _0xaddbe0;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 64f597e..dbf1414 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9983=['../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc'];(function(_0x582c17,_0x4d665f){var _0x1b9842=function(_0x3c1abb){while(--_0x3c1abb){_0x582c17['push'](_0x582c17['shift']());}};_0x1b9842(++_0x4d665f);}(_0x9983,0x159));var _0x3998=function(_0x5d8907,_0xc64513){_0x5d8907=_0x5d8907-0x0;var _0x4a2de0=_0x9983[_0x5d8907];return _0x4a2de0;};'use strict';var jayson=require(_0x3998('0x0'));var _=require('lodash');var config=require(_0x3998('0x1'));exports[_0x3998('0x2')]=function(){return new Promise(function(_0x14d402,_0x5c1340){var _0x3e86e5={};_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x3')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x5')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/voiceQueue/voiceQueue.rpc'));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/voiceRecording/voiceRecording.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x6')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x7')));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/memberReport/memberReport.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x8')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x9')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0xa')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0xb')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/mailAccount/mailAccount.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/mailQueue/mailQueue.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/mailInteraction/mailInteraction.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0xc')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0xd')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/faxAccount/faxAccount.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0xe')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0xf')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x10')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x11')));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x12')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/smsInteraction/smsInteraction.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/smsMessage/smsMessage.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x13')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x14')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x15')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x16')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x17')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x18')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x19')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x1a')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x1b')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/cmContact/cmContact.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x1c')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x1d')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x1e')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x1f')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x20')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x21')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x22')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x23')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x24')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x25')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/variable/variable.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x26')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x27')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x28')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x29')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2a')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2b')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2c')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2d')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2e')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/setting/setting.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x2f')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require('../api/squareProject/squareProject.rpc'));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/squareRecording/squareRecording.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x30')));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/campaign/campaign.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x31')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x32')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x33')));_0x3e86e5=_['merge'](_0x3e86e5,require(_0x3998('0x34')));_0x3e86e5=_['merge'](_0x3e86e5,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x35')));_0x3e86e5=_[_0x3998('0x4')](_0x3e86e5,require(_0x3998('0x36')));var _0x11364b=jayson[_0x3998('0x37')](_0x3e86e5)['http']();var _0x31796c=config[_0x3998('0x38')][_0x3998('0x39')]||config[_0x3998('0x39')]+0x1;var _0x5a61d3=config['rpc']['ip']||_0x3998('0x3a');_0x11364b['on'](_0x3998('0x3b'),function(_0x292fa0){return _0x5c1340(_0x292fa0);});_0x11364b['listen'](_0x31796c,_0x5a61d3,function(){console[_0x3998('0x3c')](_0x3998('0x3d'),_0x5a61d3,_0x31796c);require('../config/triggers')[_0x3998('0x3e')]();return _0x14d402(_0x3998('0x3f')+_0x5a61d3+':'+_0x31796c);});});}; \ No newline at end of file +var _0xb83d=['../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc'];(function(_0x361d16,_0x40b1f1){var _0x4c99c1=function(_0x4d30fd){while(--_0x4d30fd){_0x361d16['push'](_0x361d16['shift']());}};_0x4c99c1(++_0x40b1f1);}(_0xb83d,0x1d0));var _0xdb83=function(_0xcb097d,_0x2acfb7){_0xcb097d=_0xcb097d-0x0;var _0x132e06=_0xb83d[_0xcb097d];return _0x132e06;};'use strict';var jayson=require(_0xdb83('0x0'));var _=require('lodash');var config=require(_0xdb83('0x1'));exports[_0xdb83('0x2')]=function(){return new Promise(function(_0x58c0d7,_0x294f8c){var _0x114e46={};_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/user/user.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x4')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x5')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x6')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x7')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x8')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x9')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0xa')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/memberReport/memberReport.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0xb')));_0x114e46=_['merge'](_0x114e46,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0xc')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0xd')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0xe')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0xf')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x10')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/mailMessage/mailMessage.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x11')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x12')));_0x114e46=_['merge'](_0x114e46,require('../api/faxAccount/faxAccount.rpc'));_0x114e46=_['merge'](_0x114e46,require('../api/faxApplication/faxApplication.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/faxInteraction/faxInteraction.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x13')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x14')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x15')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/smsInteraction/smsInteraction.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x16')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x17')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x18')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x19')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x1a')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x1b')));_0x114e46=_['merge'](_0x114e46,require('../api/chatInteraction/chatInteraction.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x1c')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x1d')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/cmContact/cmContact.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x1e')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x1f')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x20')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x21')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x22')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x23')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x24')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x25')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x26')));_0x114e46=_['merge'](_0x114e46,require('../api/trigger/trigger.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x27')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x28')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x29')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x2a')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x2b')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x2c')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x2d')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x2e')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x2f')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x30')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x31')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x32')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x33')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x34')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x35')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/squareRecording/squareRecording.rpc'));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x36')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require('../api/campaign/campaign.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x37')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x38')));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x39')));_0x114e46=_['merge'](_0x114e46,require(_0xdb83('0x3a')));_0x114e46=_['merge'](_0x114e46,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x114e46=_[_0xdb83('0x3')](_0x114e46,require(_0xdb83('0x3b')));_0x114e46=_['merge'](_0x114e46,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x54bb49=jayson[_0xdb83('0x3c')](_0x114e46)['http']();var _0x9cb79b=config[_0xdb83('0x3d')][_0xdb83('0x3e')]||config['port']+0x1;var _0x2f8b67=config[_0xdb83('0x3d')]['ip']||_0xdb83('0x3f');_0x54bb49['on']('error',function(_0x46c84c){return _0x294f8c(_0x46c84c);});_0x54bb49[_0xdb83('0x2')](_0x9cb79b,_0x2f8b67,function(){console[_0xdb83('0x40')](_0xdb83('0x41'),_0x2f8b67,_0x9cb79b);require(_0xdb83('0x42'))[_0xdb83('0x43')]();return _0x58c0d7(_0xdb83('0x44')+_0x2f8b67+':'+_0x9cb79b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index d59b23c..f552562 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 _0x20ef=['match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','result=','indexOf','startsWith','split','length'];(function(_0x559135,_0x46eeb3){var _0x5112e7=function(_0x2afa3f){while(--_0x2afa3f){_0x559135['push'](_0x559135['shift']());}};_0x5112e7(++_0x46eeb3);}(_0x20ef,0x189));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf20e('0x0'));var _=require(_0xf20e('0x1'));var EventEmitter=require(_0xf20e('0x2'))[_0xf20e('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xf20e('0x4'));function AGIChannel(_0x5bcdec){var _0x51d661=this,_0x79b357=new AGIReply(),_0x2bd163=![],_0x4efcd7={};EventEmitter[_0xf20e('0x5')](_0x51d661);_0x5bcdec['setEncoding']('utf8');_0x5bcdec['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x79b357['setEncoding']('utf8');_0x79b357['on'](_0xf20e('0x6'),function(_0xa34689){for(var _0x4d35c9 in _0xa34689){_0x51d661[_0x4d35c9]=_0xa34689[_0x4d35c9];}_0x51d661[_0xf20e('0x7')](_0xf20e('0x8'));});_0x79b357['on'](_0xf20e('0x9'),function(_0x389e18){if(_0x389e18['toLowerCase']()==_0xf20e('0xa')){_0x51d661[_0xf20e('0x7')](_0xf20e('0xa'));return;}if(_0x389e18[_0xf20e('0xb')](0x0,0xb)==_0xf20e('0xc')){_0x2bd163=!![];}if(_0x2bd163){_0x4efcd7['rx']+=_0x389e18+'\x0a';if(_0x389e18[_0xf20e('0xd')](_0xf20e('0xe'))!=-0x1){_0x2bd163=![];}}else{_0x4efcd7['rx']=_0x389e18;}if(_0x2bd163){return;}if(typeof _0x4efcd7['cb']=='function'){var _0x26421e=_0x4efcd7['rx'][_0xf20e('0xb')](0x0,0x3),_0x54b8ce=null,_0x1b8930=null;_0x26421e=parseInt(_0x26421e);if(isNaN(_0x26421e)){_0x4efcd7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x26421e!=0xc8){_0x4efcd7['cb'](null,{'code':_0x26421e,'result':-0x1,'extra':'KO'});return;}_0x54b8ce=_0x4efcd7['rx'][_0xf20e('0xb')](0x4)[_0xf20e('0xf')](_0xf20e('0x10'),'');if(_0x54b8ce[_0xf20e('0x11')]('\x20')!=-0x1){_0x54b8ce=_0x54b8ce['substr'](0x0,_0x54b8ce['indexOf']('\x20'));}if(_[_0xf20e('0x12')](_0x54b8ce,'-1')){_0x54b8ce=parseInt(_0x54b8ce);}_0x1b8930=_0x4efcd7['rx'][_0xf20e('0x13')]('\x20');if(_0x1b8930[_0xf20e('0x14')]==0x3){_0x1b8930=_0x1b8930[0x2]['substring'](0x1,_0x1b8930[0x2]['length']-0x1);}else if(_0x1b8930[_0xf20e('0x14')]>0x3){var _0x40b695=/\((.+)\)/;var _0x33370c=_0x4efcd7['rx'][_0xf20e('0x15')](_0x40b695);if(_0x33370c){_0x1b8930=_0x33370c[0x1];}else{_0x1b8930=null;}}else{_0x1b8930=null;}_0x4efcd7['cb'](null,{'code':_0x26421e,'result':_0x54b8ce,'extra':_0x1b8930});}});_0x5bcdec['on'](_0xf20e('0x16'),function(_0x343368){_0x51d661['emit'](_0xf20e('0x16'),new AGIError(_0xf20e('0x17'),_0x343368[_0xf20e('0x18')]));});_0x5bcdec['on'](_0xf20e('0x19'),function(){_0x51d661[_0xf20e('0x7')](_0xf20e('0x19'),new AGIError(_0xf20e('0x1a')));});_0x5bcdec['on']('timeout',function(){_0x51d661[_0xf20e('0x7')]('timeout',new AGIError(_0xf20e('0x1b')));_0x5bcdec[_0xf20e('0x1c')]();});_0x5bcdec[_0xf20e('0x1d')](_0x79b357);this[_0xf20e('0x1e')]=function(_0x50b63b,_0x193df4){var _0x50b63b=_0x50b63b||'',_0x193df4=typeof _0x193df4==_0xf20e('0x1f')?_0x193df4:new Function();_0x4efcd7={'tx':_0x50b63b,'rx':'','cb':_0x193df4};_0x5bcdec['write'](_0x50b63b+'\x0a');},this[_0xf20e('0x19')]=function(){_0x5bcdec[_0xf20e('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xf20e('0x20')][_0xf20e('0x21')]=function(_0xe1ff4b){return this['command'][_0xf20e('0x22')](this,_0xe1ff4b);};AGIChannel['prototype'][_0xf20e('0x23')]=function(){return this[_0xf20e('0x21')](_0xf20e('0x24'));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x25')]=function(_0x48376a,_0x3c1e7f,_0x5169a2){_0x48376a=_0x48376a===undefined?_0xf20e('0x26'):_0x48376a;_0x3c1e7f=_0x3c1e7f===undefined?'5':_0x3c1e7f;_0x5169a2=_0x5169a2===undefined?'1':_0x5169a2;return this[_0xf20e('0x21')](util[_0xf20e('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x48376a,_0x3c1e7f*0x3e8,_0x5169a2));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x28')]=function(_0x54ae8f){_0x54ae8f=_0x54ae8f||_0xf20e('0x29');return this[_0xf20e('0x21')](util['format']('VERBOSE\x20\x22%s\x22',_0x54ae8f));};AGIChannel['prototype']['exec']=function(_0xf1d140,_0x229123){if(_[_0xf20e('0x2a')](_0x229123)){return this[_0xf20e('0x21')](util['format'](_0xf20e('0x2b'),_0xf1d140,_0x229123[_0xf20e('0x2c')](',')));}return this[_0xf20e('0x21')](util['format'](_0xf20e('0x2b'),_0xf1d140,_0x229123));};AGIChannel[_0xf20e('0x20')]['setContext']=function(_0x403357){return this[_0xf20e('0x21')](util['format']('SET\x20CONTEXT\x20%s',_0x403357));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x2d')]=function(_0x597d06){return this[_0xf20e('0x21')](util[_0xf20e('0x27')](_0xf20e('0x2e'),_0x597d06));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x2f')]=function(_0x19caa2){return this[_0xf20e('0x21')](util[_0xf20e('0x27')]('SET\x20PRIORITY\x20%s',_0x19caa2));};AGIChannel[_0xf20e('0x20')][_0xf20e('0xa')]=function(){return this[_0xf20e('0x21')](_0xf20e('0x30'));};AGIChannel['prototype'][_0xf20e('0x31')]=function(_0x4474bc,_0x1c61ba){var _0x16f7a3=_['isBoolean'](_0x1c61ba)||_['isNumber'](_0x1c61ba)?_0x1c61ba[_0xf20e('0x32')]():_0x1c61ba;return this[_0xf20e('0x21')](util[_0xf20e('0x27')](_0xf20e('0x33'),_0x4474bc,_0x16f7a3?_0x16f7a3['toString']()[_0xf20e('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x54187f,_0x179c11){return this[_0xf20e('0x21')](util[_0xf20e('0x27')](_0xf20e('0x34'),_0x54187f,_0x179c11));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x35')]=function(_0x167979,_0x112101){return this[_0xf20e('0x21')](util['format'](_0xf20e('0x36'),_0x167979,_0x112101));};AGIChannel[_0xf20e('0x20')]['sayPhonetic']=function(_0x58bb71,_0xe13af7){return this[_0xf20e('0x21')](util[_0xf20e('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x58bb71,_0xe13af7));};AGIChannel[_0xf20e('0x20')]['continueAt']=function(_0x5224a4,_0x4f1bb3,_0x3fae4d){_0x4f1bb3=_0x4f1bb3||this[_0xf20e('0x37')];_0x3fae4d=_0x3fae4d||0x1;this[_0xf20e('0x38')](_0x5224a4);this[_0xf20e('0x2d')](_0x4f1bb3);this[_0xf20e('0x2f')](_0x3fae4d);return this[_0xf20e('0x28')](util[_0xf20e('0x27')](_0xf20e('0x39'),_0x5224a4,_0x4f1bb3,_0x3fae4d));};AGIChannel['prototype'][_0xf20e('0x3a')]=function(_0x49bc50){return this[_0xf20e('0x21')](util[_0xf20e('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x49bc50));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x3b')]=function(_0x278796,_0x5214bd,_0x5317b9,_0x5443ba,_0x4422f6,_0x24e9f8){_0x5214bd=_0x5214bd||'wav';_0x5317b9=_0x5317b9||'';_0x5443ba=_0x5443ba===undefined?-0x1:_0x5443ba==='-1'?-0x1:_0x5443ba*0x3e8;_0x4422f6=_0x4422f6===undefined?'':'s='+_0x4422f6;_0x24e9f8=_0x24e9f8?'BEEP':'';return this['sendRequest'](util['format'](_0xf20e('0x3c'),_0x278796,_0x5214bd,_0x5317b9,_0x5443ba,_0x24e9f8,_0x4422f6));};AGIChannel[_0xf20e('0x20')][_0xf20e('0x3d')]=function(_0x3550b4,_0x22f6e8){_0x22f6e8=_0x22f6e8||'';return this[_0xf20e('0x21')](util[_0xf20e('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3550b4,_0x22f6e8));};AGIChannel[_0xf20e('0x20')]['agi']=function(_0x26c139){return this[_0xf20e('0x3e')](_0xf20e('0x3f'),_0x26c139);};AGIChannel[_0xf20e('0x20')][_0xf20e('0x40')]=function(_0x4e0039){return this['exec'](_0xf20e('0x41'),_0x4e0039);};AGIChannel[_0xf20e('0x20')][_0xf20e('0x16')]=function(_0x4b22b9,_0x1942ef){this[_0xf20e('0x28')](util[_0xf20e('0x27')](_0xf20e('0x42'),_0x4b22b9['id'],_0x4b22b9[_0xf20e('0x43')],_0x1942ef));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf20e('0x44')]=AGIChannel; \ No newline at end of file +var _0x1a0c=['command','function','write','inherits','sendRequest','sync','prototype','answer','ANSWER','beep','format','NO\x20MESSAGE','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','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','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','AGI','exec','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','call','utf8','setEncoding','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','startsWith','length','match','code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe'];(function(_0x16f4b5,_0x41b541){var _0x1d06a6=function(_0x238fa4){while(--_0x238fa4){_0x16f4b5['push'](_0x16f4b5['shift']());}};_0x1d06a6(++_0x41b541);}(_0x1a0c,0xc0));var _0xc1a0=function(_0x4949ba,_0x5a9616){_0x4949ba=_0x4949ba-0x0;var _0x543b99=_0x1a0c[_0x4949ba];return _0x543b99;};'use strict';var util=require(_0xc1a0('0x0'));var _=require(_0xc1a0('0x1'));var EventEmitter=require('events')[_0xc1a0('0x2')];var AGIReply=require(_0xc1a0('0x3'));var AGIError=require('./error');function AGIChannel(_0xfbce5d){var _0x529e9b=this,_0x115eca=new AGIReply(),_0x3dbf2d=![],_0x541d27={};EventEmitter[_0xc1a0('0x4')](_0x529e9b);_0xfbce5d['setEncoding'](_0xc1a0('0x5'));_0xfbce5d['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x115eca[_0xc1a0('0x6')]('utf8');_0x115eca['on'](_0xc1a0('0x7'),function(_0x1dbc7b){for(var _0x1d8cb9 in _0x1dbc7b){_0x529e9b[_0x1d8cb9]=_0x1dbc7b[_0x1d8cb9];}_0x529e9b[_0xc1a0('0x8')]('ready');});_0x115eca['on'](_0xc1a0('0x9'),function(_0x5aafb5){if(_0x5aafb5[_0xc1a0('0xa')]()==_0xc1a0('0xb')){_0x529e9b[_0xc1a0('0x8')](_0xc1a0('0xb'));return;}if(_0x5aafb5[_0xc1a0('0xc')](0x0,0xb)==_0xc1a0('0xd')){_0x3dbf2d=!![];}if(_0x3dbf2d){_0x541d27['rx']+=_0x5aafb5+'\x0a';if(_0x5aafb5[_0xc1a0('0xe')](_0xc1a0('0xf'))!=-0x1){_0x3dbf2d=![];}}else{_0x541d27['rx']=_0x5aafb5;}if(_0x3dbf2d){return;}if(typeof _0x541d27['cb']=='function'){var _0x3d2f43=_0x541d27['rx'][_0xc1a0('0xc')](0x0,0x3),_0x55a240=null,_0x10ccfb=null;_0x3d2f43=parseInt(_0x3d2f43);if(isNaN(_0x3d2f43)){_0x541d27['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc1a0('0x10')});return;}if(_0x3d2f43!=0xc8){_0x541d27['cb'](null,{'code':_0x3d2f43,'result':-0x1,'extra':'KO'});return;}_0x55a240=_0x541d27['rx'][_0xc1a0('0xc')](0x4)['replace'](_0xc1a0('0x11'),'');if(_0x55a240[_0xc1a0('0x12')]('\x20')!=-0x1){_0x55a240=_0x55a240['substr'](0x0,_0x55a240[_0xc1a0('0x12')]('\x20'));}if(_[_0xc1a0('0x13')](_0x55a240,'-1')){_0x55a240=parseInt(_0x55a240);}_0x10ccfb=_0x541d27['rx']['split']('\x20');if(_0x10ccfb[_0xc1a0('0x14')]==0x3){_0x10ccfb=_0x10ccfb[0x2][_0xc1a0('0xc')](0x1,_0x10ccfb[0x2][_0xc1a0('0x14')]-0x1);}else if(_0x10ccfb[_0xc1a0('0x14')]>0x3){var _0x8e4f5f=/\((.+)\)/;var _0x29aeae=_0x541d27['rx'][_0xc1a0('0x15')](_0x8e4f5f);if(_0x29aeae){_0x10ccfb=_0x29aeae[0x1];}else{_0x10ccfb=null;}}else{_0x10ccfb=null;}_0x541d27['cb'](null,{'code':_0x3d2f43,'result':_0x55a240,'extra':_0x10ccfb});}});_0xfbce5d['on']('error',function(_0x111c84){_0x529e9b['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x111c84[_0xc1a0('0x16')]));});_0xfbce5d['on'](_0xc1a0('0x17'),function(){_0x529e9b[_0xc1a0('0x8')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0xfbce5d['on']('timeout',function(){_0x529e9b[_0xc1a0('0x8')](_0xc1a0('0x18'),new AGIError(_0xc1a0('0x19')));_0xfbce5d['destroy']();});_0xfbce5d[_0xc1a0('0x1a')](_0x115eca);this[_0xc1a0('0x1b')]=function(_0x1f962b,_0x57971d){var _0x1f962b=_0x1f962b||'',_0x57971d=typeof _0x57971d==_0xc1a0('0x1c')?_0x57971d:new Function();_0x541d27={'tx':_0x1f962b,'rx':'','cb':_0x57971d};_0xfbce5d[_0xc1a0('0x1d')](_0x1f962b+'\x0a');},this[_0xc1a0('0x17')]=function(){_0xfbce5d['destroy']();};}util[_0xc1a0('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xc1a0('0x1f')]=function(_0xe2a0bd){return this[_0xc1a0('0x1b')][_0xc1a0('0x20')](this,_0xe2a0bd);};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x22')]=function(){return this[_0xc1a0('0x1f')](_0xc1a0('0x23'));};AGIChannel[_0xc1a0('0x21')]['getData']=function(_0x50a9e5,_0x286d20,_0xfe9dc8){_0x50a9e5=_0x50a9e5===undefined?_0xc1a0('0x24'):_0x50a9e5;_0x286d20=_0x286d20===undefined?'5':_0x286d20;_0xfe9dc8=_0xfe9dc8===undefined?'1':_0xfe9dc8;return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x50a9e5,_0x286d20*0x3e8,_0xfe9dc8));};AGIChannel[_0xc1a0('0x21')]['noop']=function(_0x2e15e0){_0x2e15e0=_0x2e15e0||_0xc1a0('0x26');return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')]('VERBOSE\x20\x22%s\x22',_0x2e15e0));};AGIChannel[_0xc1a0('0x21')]['exec']=function(_0x43b59e,_0x5a91ce){if(_['isArray'](_0x5a91ce)){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')]('EXEC\x20%s\x20%s',_0x43b59e,_0x5a91ce[_0xc1a0('0x27')](',')));}return this['sendRequest'](util[_0xc1a0('0x25')](_0xc1a0('0x28'),_0x43b59e,_0x5a91ce));};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x29')]=function(_0x34c9b7){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')](_0xc1a0('0x2a'),_0x34c9b7));};AGIChannel['prototype'][_0xc1a0('0x2b')]=function(_0x4ef994){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')](_0xc1a0('0x2c'),_0x4ef994));};AGIChannel['prototype'][_0xc1a0('0x2d')]=function(_0x2a8d5c){return this['sendRequest'](util[_0xc1a0('0x25')](_0xc1a0('0x2e'),_0x2a8d5c));};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0xb')]=function(){return this[_0xc1a0('0x1f')](_0xc1a0('0x2f'));};AGIChannel[_0xc1a0('0x21')]['setVariable']=function(_0x289e94,_0x4740c2){var _0xd00a1=_[_0xc1a0('0x30')](_0x4740c2)||_[_0xc1a0('0x31')](_0x4740c2)?_0x4740c2[_0xc1a0('0x32')]():_0x4740c2;return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x289e94,_0xd00a1?_0xd00a1[_0xc1a0('0x32')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xc1a0('0x33')]=function(_0x493fa7,_0xcc2cd3){return this['sendRequest'](util[_0xc1a0('0x25')](_0xc1a0('0x34'),_0x493fa7,_0xcc2cd3));};AGIChannel['prototype'][_0xc1a0('0x35')]=function(_0x4d91cd,_0x1101a1){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')](_0xc1a0('0x36'),_0x4d91cd,_0x1101a1));};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x37')]=function(_0x3d390a,_0x196dfc){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')](_0xc1a0('0x38'),_0x3d390a,_0x196dfc));};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x39')]=function(_0x5d955f,_0x386eb4,_0x3be56d){_0x386eb4=_0x386eb4||this[_0xc1a0('0x3a')];_0x3be56d=_0x3be56d||0x1;this['setContext'](_0x5d955f);this[_0xc1a0('0x2b')](_0x386eb4);this[_0xc1a0('0x2d')](_0x3be56d);return this[_0xc1a0('0x3b')](util['format'](_0xc1a0('0x3c'),_0x5d955f,_0x386eb4,_0x3be56d));};AGIChannel['prototype'][_0xc1a0('0x3d')]=function(_0x501ac5){return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')](_0xc1a0('0x3e'),_0x501ac5));};AGIChannel[_0xc1a0('0x21')]['recordFile']=function(_0x42517a,_0x436815,_0x238196,_0x1c8360,_0x583a46,_0x149329){_0x436815=_0x436815||_0xc1a0('0x3f');_0x238196=_0x238196||'';_0x1c8360=_0x1c8360===undefined?-0x1:_0x1c8360==='-1'?-0x1:_0x1c8360*0x3e8;_0x583a46=_0x583a46===undefined?'':'s='+_0x583a46;_0x149329=_0x149329?_0xc1a0('0x40'):'';return this[_0xc1a0('0x1f')](util[_0xc1a0('0x25')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x42517a,_0x436815,_0x238196,_0x1c8360,_0x149329,_0x583a46));};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x41')]=function(_0x247b58,_0x31b37a){_0x31b37a=_0x31b37a||'';return this['sendRequest'](util[_0xc1a0('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x247b58,_0x31b37a));};AGIChannel[_0xc1a0('0x21')]['agi']=function(_0x2ffadb){return this['exec'](_0xc1a0('0x42'),_0x2ffadb);};AGIChannel[_0xc1a0('0x21')]['wait']=function(_0xc0843e){return this[_0xc1a0('0x43')](_0xc1a0('0x44'),_0xc0843e);};AGIChannel[_0xc1a0('0x21')][_0xc1a0('0x45')]=function(_0x4a3c31,_0x4d9924){this[_0xc1a0('0x3b')](util['format'](_0xc1a0('0x46'),_0x4a3c31['id'],_0x4a3c31[_0xc1a0('0x47')],_0x4d9924));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xc1a0('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 94b9158..4a29204 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 _0xbbce=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x5c5822,_0x3a85ae){var _0x1e24b8=function(_0x5a3789){while(--_0x5a3789){_0x5c5822['push'](_0x5c5822['shift']());}};_0x1e24b8(++_0x3a85ae);}(_0xbbce,0x11d));var _0xebbc=function(_0x10c1ea,_0x2dfdc7){_0x10c1ea=_0x10c1ea-0x0;var _0x267e53=_0xbbce[_0x10c1ea];return _0x267e53;};'use strict';var util=require(_0xebbc('0x0'));var error={'E_AGI_UNDEFINED':_0xebbc('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xebbc('0x2'),'E_AGI_SERVER_CLOSE':_0xebbc('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xebbc('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xebbc('0x5'),'E_AGI_SOCKET_ERROR':_0xebbc('0x6'),'E_AGI_SOCKET_CLOSE':_0xebbc('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xebbc('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x415383){var _0x415383=_0x415383||null,_0x4a5f9e=_0x4a5f9e||[],_0xf6e88d=0x1,_0x498458='';if(!error[_0x415383]){_0x415383=_0xebbc('0x9');}_0x4a5f9e[_0xebbc('0xa')](error[_0x415383]);while(arguments[_0xf6e88d]){_0x4a5f9e[_0xebbc('0xa')](arguments[_0xf6e88d]);_0xf6e88d++;}_0x498458=util[_0xebbc('0xb')][_0xebbc('0xc')](util,_0x4a5f9e);this[_0xebbc('0xd')]=_0x498458;this[_0xebbc('0xe')]=_0x415383;}module[_0xebbc('0xf')]=AGIError; \ No newline at end of file +var _0xbaca=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbaca,0xc8));var _0xabac=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xbaca[_0x725a4c];return _0x37b2cc;};'use strict';var util=require(_0xabac('0x0'));var error={'E_AGI_UNDEFINED':_0xabac('0x1'),'E_AGI_ARGUMENT_PORT':_0xabac('0x2'),'E_AGI_SERVER_ERROR':_0xabac('0x3'),'E_AGI_SERVER_CLOSE':_0xabac('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xabac('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xabac('0x6'),'E_AGI_SOCKET_ERROR':_0xabac('0x7'),'E_AGI_SOCKET_CLOSE':_0xabac('0x8'),'E_AGI_SOCKET_TIMEOUT':_0xabac('0x9'),'E_AGI_COMMAND_EMPTY':_0xabac('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xabac('0xb'),'E_AGI_IVR_ENTRY':_0xabac('0xc')};function AGIError(_0x4234ba){var _0x4234ba=_0x4234ba||null,_0x40dd5f=_0x40dd5f||[],_0x86eabb=0x1,_0x43ab22='';if(!error[_0x4234ba]){_0x4234ba='E_AGI_UNDEFINED';}_0x40dd5f[_0xabac('0xd')](error[_0x4234ba]);while(arguments[_0x86eabb]){_0x40dd5f[_0xabac('0xd')](arguments[_0x86eabb]);_0x86eabb++;}_0x43ab22=util[_0xabac('0xe')]['apply'](util,_0x40dd5f);this[_0xabac('0xf')]=_0x43ab22;this[_0xabac('0x10')]=_0x4234ba;}module[_0xabac('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index fd1c57f..f7cbae8 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 _0x7105=['ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','parse','lodash','events','EventEmitter'];(function(_0xd25bec,_0x18851f){var _0x507a85=function(_0xf03140){while(--_0xf03140){_0xd25bec['push'](_0xd25bec['shift']());}};_0x507a85(++_0x18851f);}(_0x7105,0x107));var _0x5710=function(_0xa9ead9,_0x5bd507){_0xa9ead9=_0xa9ead9-0x0;var _0x1ac22b=_0x7105[_0xa9ead9];return _0x1ac22b;};'use strict';var _=require(_0x5710('0x0'));var EventEmitter=require(_0x5710('0x1'))[_0x5710('0x2')];var Redis=require(_0x5710('0x3'));var AGIError=require(_0x5710('0x4'));var config=require(_0x5710('0x5'));config[_0x5710('0x6')]=_[_0x5710('0x7')](config['redis'],{'host':_0x5710('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5710('0x6')]);sub[_0x5710('0x9')](_0x5710('0xa'),function(_0x263e30){if(_0x263e30)return eventEmitter[_0x5710('0xb')](_0x5710('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x263e30));});sub['on']('message',function(_0x3b4311,_0x2a9535){if(_0x3b4311!==_0x5710('0xa'))return;try{var _0x109fac=JSON[_0x5710('0xd')](_0x2a9535);eventEmitter[_0x5710('0xb')]('projectUpdate',_0x109fac);}catch(_0x1e156a){eventEmitter[_0x5710('0xb')](_0x5710('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x1e156a));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x9739=['localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','ioredis','./error','../../config/environment','redis','defaults'];(function(_0x76457,_0x25993d){var _0x25ec0d=function(_0x106b58){while(--_0x106b58){_0x76457['push'](_0x76457['shift']());}};_0x25ec0d(++_0x25993d);}(_0x9739,0x70));var _0x9973=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x9739[_0x447ef1];return _0x3d72ec;};'use strict';var _=require(_0x9973('0x0'));var EventEmitter=require(_0x9973('0x1'))['EventEmitter'];var Redis=require(_0x9973('0x2'));var AGIError=require(_0x9973('0x3'));var config=require(_0x9973('0x4'));config[_0x9973('0x5')]=_[_0x9973('0x6')](config['redis'],{'host':_0x9973('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x9973('0x5')]);sub[_0x9973('0x8')](_0x9973('0x9'),function(_0x2d4b37){if(_0x2d4b37)return eventEmitter[_0x9973('0xa')](_0x9973('0xb'),new AGIError(_0x9973('0xc'),_0x2d4b37));});sub['on'](_0x9973('0xd'),function(_0x2d8165,_0x59a4e6){if(_0x2d8165!==_0x9973('0x9'))return;try{var _0x190c40=JSON[_0x9973('0xe')](_0x59a4e6);eventEmitter[_0x9973('0xa')](_0x9973('0xf'),_0x190c40);}catch(_0x26d62c){eventEmitter['emit']('error',new AGIError(_0x9973('0xc'),_0x26d62c));}});module[_0x9973('0x10')]={'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 35cc873..626bb99 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 _0xc584=['numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','info','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','getdigits','vertices','edges','prototype','addVertex','addEdge','push'];(function(_0x6aacfe,_0x312ba9){var _0x33c476=function(_0x316e44){while(--_0x316e44){_0x6aacfe['push'](_0x6aacfe['shift']());}};_0x33c476(++_0x312ba9);}(_0xc584,0x1e7));var _0x4c58=function(_0x3ccac1,_0x5cc7ea){_0x3ccac1=_0x3ccac1-0x0;var _0x10b20b=_0xc584[_0x3ccac1];return _0x10b20b;};'use strict';var _=require(_0x4c58('0x0'));var logger=require('../../../config/logger')(_0x4c58('0x1'));var verticesWithRetry=['menu',_0x4c58('0x2'),'getsecretdigits'];var Graph=function(){this[_0x4c58('0x3')]={};this[_0x4c58('0x4')]={};this['numberOfEdges']=0x0;};Graph[_0x4c58('0x5')][_0x4c58('0x6')]=function(_0x3d4e6b){this[_0x4c58('0x3')][_0x3d4e6b['id']]=_0x3d4e6b;this[_0x4c58('0x4')][_0x3d4e6b['id']]=[];};Graph[_0x4c58('0x5')][_0x4c58('0x7')]=function(_0x3bef56,_0x34a0b2,_0x58b2a5){this['edges'][_0x3bef56][_0x4c58('0x8')]({'target':_0x34a0b2,'condition':_0x58b2a5});this[_0x4c58('0x9')]+=0x1;};Graph['prototype'][_0x4c58('0xa')]=function(){return _['size'](this[_0x4c58('0x3')]);};Graph[_0x4c58('0x5')][_0x4c58('0xb')]=function(){return this['numberOfEdges'];};Graph[_0x4c58('0x5')][_0x4c58('0xc')]=function(_0x288abb){return this['vertices'][_0x288abb];};Graph[_0x4c58('0x5')][_0x4c58('0xd')]=function(_0x5a07d5,_0x981c48){if(!this['vertices'][_0x5a07d5]){return logger['info'](_0x4c58('0xe'));}var _0x27d4cd=_0x981c48(this['vertices'][_0x5a07d5]);if(!_0x27d4cd){return logger['info'](_0x4c58('0xf'));}if(this['edges'][_0x5a07d5]['length']===0x0){return logger[_0x4c58('0x10')](_0x4c58('0x11'));}for(var _0x370f38=0x0,_0x312e44=[],_0x44a884=![];_0x370f38\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','indexOf','variables','stringify','close','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','./server','listening','connection','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','projectUpdate','nextTick','error','findIndex','deleted','push','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x1b647e,_0x553ddf){var _0x349623=function(_0x5a384f){while(--_0x5a384f){_0x1b647e['push'](_0x1b647e['shift']());}};_0x349623(++_0x553ddf);}(_0x8080,0x91));var _0x0808=function(_0x16cf86,_0x209a9a){_0x16cf86=_0x16cf86-0x0;var _0xb7b8cd=_0x8080[_0x16cf86];return _0xb7b8cd;};'use strict';var _=require(_0x0808('0x0'));var syncho=require(_0x0808('0x1'));var util=require(_0x0808('0x2'));var config=require('../../config/environment');var logger=require(_0x0808('0x3'))(_0x0808('0x4'));var utilLicense=require(_0x0808('0x5'));var rpc=require(_0x0808('0x6'));var Project=require(_0x0808('0x7'));var AGIEmitter=require(_0x0808('0x8'))[_0x0808('0x9')];var projects=[];config[_0x0808('0x4')]=_[_0x0808('0xa')](config[_0x0808('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x0808('0xb'),projectUpdateHandler);function connectionHandler(_0x257b3c){process[_0x0808('0xc')](function(){syncho(function(){try{setChannelVariables(_0x257b3c);agiHandler(_0x257b3c);}catch(_0x3c7f6d){logger[_0x0808('0xd')](_0x3c7f6d['stack']);}});});}function projectUpdateHandler(_0x1e8ade){try{var _0x10a249=_[_0x0808('0xe')](projects,['id',_0x1e8ade['id']]);if(_0x10a249>-0x1){if(_0x1e8ade[_0x0808('0xf')]===!![]){projects['splice'](_0x10a249,0x1);}else{projects[_0x10a249]=_0x1e8ade;}}else{projects[_0x0808('0x10')](_0x1e8ade);}}catch(_0xc6535f){logger[_0x0808('0xd')](_0xc6535f[_0x0808('0x11')]);}}function listeningHandler(){console[_0x0808('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0808('0x4')][_0x0808('0x13')]);logger[_0x0808('0x14')](util['format'](_0x0808('0x15'),config[_0x0808('0x4')]['ip'],config['agi'][_0x0808('0x13')]));}function errorHandler(_0x2a65bf){if(_0x2a65bf&&_0x2a65bf[_0x0808('0x16')]&&_0x2a65bf['message']){logger[_0x0808('0xd')](util[_0x0808('0x17')](_0x0808('0x18'),_0x2a65bf[_0x0808('0x16')],_0x2a65bf[_0x0808('0x19')]));}else{logger[_0x0808('0xd')](util['format'](_0x0808('0x1a'),_0x2a65bf['stack']));}}function closeHandler(){logger[_0x0808('0x14')](util['format'](_0x0808('0x1b'),this[_0x0808('0x1c')],this[_0x0808('0x1d')],this[_0x0808('0x1e')],this['dnid'],this[_0x0808('0x1f')]));try{createSquareReport(this);}catch(_0x26c6c6){logger[_0x0808('0xd')](_0x26c6c6[_0x0808('0x11')]);}}function timeoutHandler(){logger[_0x0808('0x14')](util[_0x0808('0x17')](_0x0808('0x20'),this[_0x0808('0x1c')],this[_0x0808('0x1d')],this[_0x0808('0x1e')],this[_0x0808('0x21')],this[_0x0808('0x1f')]));}function hangupHandler(){logger['info'](util[_0x0808('0x17')](_0x0808('0x22'),this[_0x0808('0x1c')],this[_0x0808('0x1d')],this[_0x0808('0x1e')],this['dnid'],this[_0x0808('0x1f')]));this[_0x0808('0x23')]=!![];}function createSquareReport(_0x1048e8,_0x5cc974){rpc['createSquareReport'](_0x1048e8)[_0x0808('0x24')](function(_0x49e482){if(_0x5cc974){_0x5cc974(null,_0x49e482);}})[_0x0808('0x25')](function(_0x30a540){if(_0x5cc974){_0x5cc974(null,_0x30a540);}});}function setChannelVariables(_0x36fb20){for(var _0x3a6703 in _0x36fb20){if(_0x36fb20['hasOwnProperty'](_0x3a6703)){if(_0x3a6703[_0x0808('0x26')]('agi_')===0x0){_0x36fb20[_0x3a6703['substring'](0x4)]=_0x36fb20[_0x3a6703];delete _0x36fb20[_0x3a6703];}}}}function agiHandler(_0x15cf5b){logger['debug'](_0x0808('0x27'),JSON[_0x0808('0x28')](_0x15cf5b,null,0x2));logger[_0x0808('0x14')](util[_0x0808('0x17')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x15cf5b[_0x0808('0x1c')],_0x15cf5b[_0x0808('0x1d')],_0x15cf5b[_0x0808('0x1e')],_0x15cf5b[_0x0808('0x21')],_0x15cf5b['uniqueid']));_0x15cf5b['on'](_0x0808('0xd'),errorHandler);_0x15cf5b['on'](_0x0808('0x29'),closeHandler);_0x15cf5b['on'](_0x0808('0x2a'),timeoutHandler);_0x15cf5b[_0x0808('0x23')]=![];_0x15cf5b['on'](_0x0808('0x2b'),hangupHandler);var _0x2c08ca=_[_0x0808('0x2c')](projects,[_0x0808('0x16'),_0x15cf5b[_0x0808('0x1c')]]);if(!_0x2c08ca)return Project[_0x0808('0x2d')](_0x15cf5b);if(!_0x2c08ca['production'])return Project[_0x0808('0x2e')](_0x15cf5b);return Project[_0x0808('0x2f')](_0x2c08ca,_0x15cf5b);}function main(){var _0x94b3e7;return utilLicense[_0x0808('0x30')]()[_0x0808('0x24')](function(_0xa5b5b5){if(!_0xa5b5b5)return;if(_0xa5b5b5[_0x0808('0x31')]){if(_0xa5b5b5['callysquare']&&_0xa5b5b5[_0x0808('0x32')]>0x0){logger[_0x0808('0x14')](util[_0x0808('0x17')](_0x0808('0x33'),_0xa5b5b5['callysquare']));_0x94b3e7=_0xa5b5b5['callysquare'];}else{logger['info'](_0x0808('0x34'));}}else{logger[_0x0808('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x94b3e7=-0x1;}})['then'](function(){return Project[_0x0808('0x35')]();})['then'](function(_0x270bfb){projects=_0x270bfb;return;})[_0x0808('0x25')](function(_0x2ec862){logger[_0x0808('0xd')](_0x0808('0x36'),_0x2ec862[_0x0808('0x11')]);})['finally'](function(){var _0x480cf7=require(_0x0808('0x37'))(config[_0x0808('0x4')][_0x0808('0x13')],config[_0x0808('0x4')]['ip'],_0x94b3e7);_0x480cf7['on'](_0x0808('0xd'),errorHandler);_0x480cf7['on'](_0x0808('0x38'),listeningHandler);_0x480cf7['on'](_0x0808('0x39'),connectionHandler);_0x480cf7['on'](_0x0808('0x29'),closeHandler);});}main(); \ No newline at end of file +var _0x6893=['handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./project','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','findIndex','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','close','timeout','hangup','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6893,0x103));var _0x3689=function(_0x6b4e41,_0x3ed208){_0x6b4e41=_0x6b4e41-0x0;var _0x346877=_0x6893[_0x6b4e41];return _0x346877;};'use strict';var _=require('lodash');var syncho=require(_0x3689('0x0'));var util=require(_0x3689('0x1'));var config=require(_0x3689('0x2'));var logger=require('../../config/logger')(_0x3689('0x3'));var utilLicense=require(_0x3689('0x4'));var rpc=require(_0x3689('0x5'));var Project=require(_0x3689('0x6'));var AGIEmitter=require('./events')[_0x3689('0x7')];var projects=[];config[_0x3689('0x3')]=_[_0x3689('0x8')](config[_0x3689('0x3')],{'ip':_0x3689('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x5aa346){process[_0x3689('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5aa346);agiHandler(_0x5aa346);}catch(_0x159736){logger[_0x3689('0xb')](_0x159736[_0x3689('0xc')]);}});});}function projectUpdateHandler(_0x2aac25){try{var _0x2436d3=_[_0x3689('0xd')](projects,['id',_0x2aac25['id']]);if(_0x2436d3>-0x1){if(_0x2aac25['deleted']===!![]){projects[_0x3689('0xe')](_0x2436d3,0x1);}else{projects[_0x2436d3]=_0x2aac25;}}else{projects[_0x3689('0xf')](_0x2aac25);}}catch(_0x4601ab){logger['error'](_0x4601ab[_0x3689('0xc')]);}}function listeningHandler(){console[_0x3689('0x10')](_0x3689('0x11'),config[_0x3689('0x3')][_0x3689('0x12')]);logger[_0x3689('0x13')](util[_0x3689('0x14')](_0x3689('0x15'),config[_0x3689('0x3')]['ip'],config[_0x3689('0x3')][_0x3689('0x12')]));}function errorHandler(_0x45c392){if(_0x45c392&&_0x45c392[_0x3689('0x16')]&&_0x45c392[_0x3689('0x17')]){logger[_0x3689('0xb')](util[_0x3689('0x14')](_0x3689('0x18'),_0x45c392[_0x3689('0x16')],_0x45c392['message']));}else{logger['error'](util[_0x3689('0x14')](_0x3689('0x19'),_0x45c392[_0x3689('0xc')]));}}function closeHandler(){logger[_0x3689('0x13')](util[_0x3689('0x14')](_0x3689('0x1a'),this[_0x3689('0x1b')],this[_0x3689('0x1c')],this['callerid'],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x3126e6){logger[_0x3689('0xb')](_0x3126e6['stack']);}}function timeoutHandler(){logger[_0x3689('0x13')](util[_0x3689('0x14')](_0x3689('0x1d'),this['arg_1'],this[_0x3689('0x1c')],this['callerid'],this['dnid'],this[_0x3689('0x1e')]));}function hangupHandler(){logger[_0x3689('0x13')](util['format'](_0x3689('0x1f'),this[_0x3689('0x1b')],this[_0x3689('0x1c')],this['callerid'],this['dnid'],this[_0x3689('0x1e')]));this[_0x3689('0x20')]=!![];}function createSquareReport(_0x51fb5d,_0x417767){rpc['createSquareReport'](_0x51fb5d)[_0x3689('0x21')](function(_0x435acb){if(_0x417767){_0x417767(null,_0x435acb);}})[_0x3689('0x22')](function(_0x31827d){if(_0x417767){_0x417767(null,_0x31827d);}});}function setChannelVariables(_0x3b967b){for(var _0x1d2d5c in _0x3b967b){if(_0x3b967b['hasOwnProperty'](_0x1d2d5c)){if(_0x1d2d5c['indexOf'](_0x3689('0x23'))===0x0){_0x3b967b[_0x1d2d5c['substring'](0x4)]=_0x3b967b[_0x1d2d5c];delete _0x3b967b[_0x1d2d5c];}}}}function agiHandler(_0x9e6f35){logger[_0x3689('0x24')](_0x3689('0x25'),JSON[_0x3689('0x26')](_0x9e6f35,null,0x2));logger[_0x3689('0x13')](util[_0x3689('0x14')](_0x3689('0x27'),_0x9e6f35[_0x3689('0x1b')],_0x9e6f35[_0x3689('0x1c')],_0x9e6f35[_0x3689('0x28')],_0x9e6f35[_0x3689('0x29')],_0x9e6f35[_0x3689('0x1e')]));_0x9e6f35['on'](_0x3689('0xb'),errorHandler);_0x9e6f35['on'](_0x3689('0x2a'),closeHandler);_0x9e6f35['on'](_0x3689('0x2b'),timeoutHandler);_0x9e6f35['evtHangup']=![];_0x9e6f35['on'](_0x3689('0x2c'),hangupHandler);var _0x5b3c9e=_[_0x3689('0x2d')](projects,[_0x3689('0x16'),_0x9e6f35[_0x3689('0x1b')]]);if(!_0x5b3c9e)return Project[_0x3689('0x2e')](_0x9e6f35);if(!_0x5b3c9e[_0x3689('0x2f')])return Project[_0x3689('0x30')](_0x9e6f35);return Project[_0x3689('0x31')](_0x5b3c9e,_0x9e6f35);}function main(){var _0x5ca6a3;return utilLicense[_0x3689('0x32')]()[_0x3689('0x21')](function(_0x5742fa){if(!_0x5742fa)return;if(_0x5742fa[_0x3689('0x33')]){if(_0x5742fa[_0x3689('0x34')]&&_0x5742fa[_0x3689('0x34')]>0x0){logger[_0x3689('0x13')](util[_0x3689('0x14')](_0x3689('0x35'),_0x5742fa[_0x3689('0x34')]));_0x5ca6a3=_0x5742fa['callysquare'];}else{logger[_0x3689('0x13')](_0x3689('0x36'));}}else{logger[_0x3689('0x13')](_0x3689('0x37'));_0x5ca6a3=-0x1;}})['then'](function(){return Project[_0x3689('0x38')]();})['then'](function(_0x5d4e44){projects=_0x5d4e44;return;})[_0x3689('0x22')](function(_0x111840){logger['error'](_0x3689('0x39'),_0x111840[_0x3689('0xc')]);})[_0x3689('0x3a')](function(){var _0x1d2806=require('./server')(config[_0x3689('0x3')][_0x3689('0x12')],config[_0x3689('0x3')]['ip'],_0x5ca6a3);_0x1d2806['on'](_0x3689('0xb'),errorHandler);_0x1d2806['on'](_0x3689('0x3b'),listeningHandler);_0x1d2806['on'](_0x3689('0x3c'),connectionHandler);_0x1d2806['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 0af8bad..b976d30 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 _0x3d63=['request','error','message','result','catch','sendMailMessage','SendMail','bluebird','http'];(function(_0x3ff9b9,_0x568a35){var _0x19bfe9=function(_0x4f5c35){while(--_0x4f5c35){_0x3ff9b9['push'](_0x3ff9b9['shift']());}};_0x19bfe9(++_0x568a35);}(_0x3d63,0xfa));var _0x33d6=function(_0x1bfe10,_0x3b5802){_0x1bfe10=_0x1bfe10-0x0;var _0x108135=_0x3d63[_0x1bfe10];return _0x108135;};'use strict';var BPromise=require(_0x33d6('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x33d6('0x1')]({'port':0x232b});function request(_0x3ef20d,_0x3c04ff){return new BPromise(function(_0x10bd32,_0x2f9c09){return client[_0x33d6('0x2')](_0x3ef20d,_0x3c04ff)['then'](function(_0x277bf6){if(_0x277bf6['error']){return _0x2f9c09(_0x277bf6[_0x33d6('0x3')][_0x33d6('0x4')]);}else{return _0x10bd32(_0x277bf6[_0x33d6('0x5')]);}})[_0x33d6('0x6')](function(_0x3d38cf){return _0x2f9c09(_0x3d38cf);});});}exports[_0x33d6('0x7')]=function(_0x380615,_0x48ede5){return request(_0x33d6('0x8'),{'account':_0x380615,'message':_0x48ede5});}; \ No newline at end of file +var _0x1a79=['error','result','catch','SendMail','bluebird','http','request','then'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x1a79,0x18c));var _0x91a7=function(_0x4ffafb,_0x20171a){_0x4ffafb=_0x4ffafb-0x0;var _0x4ab472=_0x1a79[_0x4ffafb];return _0x4ab472;};'use strict';var BPromise=require(_0x91a7('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91a7('0x1')]({'port':0x232b});function request(_0x2241dd,_0x4c46a0){return new BPromise(function(_0x3ccc45,_0x101e54){return client[_0x91a7('0x2')](_0x2241dd,_0x4c46a0)[_0x91a7('0x3')](function(_0x479189){if(_0x479189['error']){return _0x101e54(_0x479189[_0x91a7('0x4')]['message']);}else{return _0x3ccc45(_0x479189[_0x91a7('0x5')]);}})[_0x91a7('0x6')](function(_0x4341c3){return _0x101e54(_0x4341c3);});});}exports['sendMailMessage']=function(_0x14af70,_0x5257d0){return request(_0x91a7('0x7'),{'account':_0x14af70,'message':_0x5257d0});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index b46d0da..2156811 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 _0x6690=['start','debug','joinAt','format','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','stringify','code','evtHangup','isUndefined','result','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','source','target','addEdge','value','toJson','root','inspect','production'];(function(_0x44abbb,_0x1b3df0){var _0xaee2b3=function(_0x401cd3){while(--_0x401cd3){_0x44abbb['push'](_0x44abbb['shift']());}};_0xaee2b3(++_0x1b3df0);}(_0x6690,0xe2));var _0x0669=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6690[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0669('0x0'));var moment=require(_0x0669('0x1'));var parser=require(_0x0669('0x2'));var util=require('util');var logger=require('../../config/logger')(_0x0669('0x3'));var rpc=require(_0x0669('0x4'));var mailRpc=require(_0x0669('0x5'));var Graph=require('./graph');var Vertices=require(_0x0669('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0669('0x7')]()[_0x0669('0x8')](function(_0x45fa0d){logger['error'](_0x0669('0x9'),_0x45fa0d[_0x0669('0xa')]);return[];});}function addVertex(_0x498bca,_0x4ce97c,_0x764b96){_0x4ce97c['agicommand']=_0x764b96;if(_0x4ce97c[_0x0669('0xb')]('retry')){_0x4ce97c[_0x0669('0xc')]=parseInt(_0x4ce97c[_0x0669('0xd')],0xa);}_0x498bca[_0x0669('0xe')](_[_0x0669('0xf')](_0x4ce97c,'mxCell'));}function initGraph(_0x97ed0d,_0x556344){var _0x1dac86=new Graph();for(var _0x57550b in _0x97ed0d){if(_0x97ed0d['hasOwnProperty'](_0x57550b)){if(_[_0x0669('0x10')](_0x97ed0d[_0x57550b])){for(var _0x3829e9=0x0;_0x3829e9<_0x97ed0d[_0x57550b][_0x0669('0x11')];_0x3829e9+=0x1){addVertex(_0x1dac86,_0x97ed0d[_0x57550b][_0x3829e9],_0x57550b);}}else{addVertex(_0x1dac86,_0x97ed0d[_0x57550b],_0x57550b);}}}for(var _0x1ebdd7=0x0;_0x1ebdd7<_0x556344[_0x0669('0x11')];_0x1ebdd7+=0x1){if(_0x556344[_0x1ebdd7][_0x0669('0x12')]&&_0x556344[_0x1ebdd7][_0x0669('0x13')]){_0x1dac86[_0x0669('0x14')](_0x556344[_0x1ebdd7]['source'],_0x556344[_0x1ebdd7][_0x0669('0x13')],_0x556344[_0x1ebdd7][_0x0669('0x15')]);}}return _0x1dac86;}function getRoot(_0x2e40a1){return parser[_0x0669('0x16')](_0x2e40a1,{'object':!![]})['mxGraphModel'][_0x0669('0x17')];}function inspect(_0x1cd5f4){return util[_0x0669('0x18')](_0x1cd5f4,{'showHidden':![],'depth':null});}function initialize(_0x39a528,_0x4dce67){var _0x543f1e=getRoot(_0x39a528[_0x0669('0x19')]);if(!_0x543f1e||!_0x543f1e[_0x0669('0x1a')])return;var _0x1e663a,_0x3dd8cd,_0x4b5381;logger[_0x0669('0x1b')](_0x0669('0x17'),JSON['stringify'](_0x543f1e,null,0x2));_0x4dce67[_0x0669('0x1c')]=moment()[_0x0669('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e663a=initGraph(_[_0x0669('0xf')](_0x543f1e,_0x0669('0x1e')),_0x543f1e[_0x0669('0x1e')]);_0x3dd8cd=new Vertices(_0x4dce67,rpc,mailRpc);logger[_0x0669('0x1f')](util[_0x0669('0x1d')](_0x0669('0x20'),_0x4dce67[_0x0669('0x21')],_0x4dce67[_0x0669('0x22')],_0x4dce67[_0x0669('0x23')],_0x4dce67[_0x0669('0x24')],_0x4dce67[_0x0669('0x25')]));_0x1e663a[_0x0669('0x26')](_0x543f1e['start']['id'],function(_0x9d068e){try{_0x9d068e=_0x3dd8cd[_0x0669('0x27')](_0x9d068e);logger[_0x0669('0x1b')](_0x0669('0x28'),JSON['stringify'](_0x9d068e,null,0x2));if(_0x9d068e[_0x0669('0x29')]==='gotoc'){logger[_0x0669('0x1f')](_0x0669('0x2a'));_0x4dce67[_0x0669('0x2b')]=_0x9d068e['context']||_0x4dce67[_0x0669('0x2b')];_0x4dce67[_0x0669('0x2c')]=_0x9d068e[_0x0669('0x2c')];_0x4dce67[_0x0669('0x2d')]=_0x9d068e[_0x0669('0x2d')]?_0x9d068e[_0x0669('0x2d')]-0x1:0x1;return null;}else if(_0x9d068e&&_0x3dd8cd[_0x9d068e[_0x0669('0x29')]]){_0x4b5381=_0x3dd8cd[_0x9d068e['agicommand']](_0x9d068e);logger[_0x0669('0x1f')](_0x0669('0x2e'),JSON[_0x0669('0x2f')](_0x4b5381,null,0x2));if(_0x4b5381&&_0x4b5381[_0x0669('0x30')]===AGI_CODE_SUCCESS&&_0x4b5381['result']!==AGI_RESULT_ERROR&&!_0x4dce67[_0x0669('0x31')]){logger[_0x0669('0x1b')](_0x0669('0x2e'),inspect(_0x4b5381));return _[_0x0669('0x32')](_0x4b5381[_0x0669('0x33')])?null:_0x4b5381['result'][_0x0669('0x34')]();}else{logger['error'](_0x0669('0x2e'),inspect(_0x4b5381));return null;}}else{logger[_0x0669('0x35')](_0x0669('0x36'));return null;}}catch(_0x4c8449){logger['error'](_0x4c8449['stack']);return null;}});if(_0x543f1e[_0x0669('0x37')]){logger[_0x0669('0x1f')](util['format'](_0x0669('0x38'),_0x4dce67[_0x0669('0x21')],_0x4dce67[_0x0669('0x22')],_0x4dce67[_0x0669('0x23')],_0x4dce67[_0x0669('0x24')],_0x4dce67[_0x0669('0x25')]));_0x1e663a['traverseBFS'](_0x543f1e['finally']['id'],function(_0x3fff1e){try{_0x3fff1e=_0x3dd8cd[_0x0669('0x27')](_0x3fff1e);logger[_0x0669('0x1b')](_0x0669('0x28'),JSON[_0x0669('0x2f')](_0x3fff1e,null,0x2));if(_0x3fff1e&&_0x3dd8cd[_0x3fff1e['agicommand']]){_0x4b5381=_0x3dd8cd[_0x3fff1e[_0x0669('0x29')]](_0x3fff1e);if(_0x4b5381){logger['debug']('response',inspect(_0x4b5381));return _[_0x0669('0x32')](_0x4b5381['result'])?null:_0x4b5381['result']['toString']();}else{logger[_0x0669('0x35')](_0x0669('0x2e'),inspect(_0x4b5381));return null;}}else{logger[_0x0669('0x35')]('agicommand\x20not\x20found');return null;}}catch(_0x5e51fa){logger[_0x0669('0x35')](_0x5e51fa[_0x0669('0xa')]);return null;}});}logger['info'](util[_0x0669('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dce67[_0x0669('0x21')],_0x4dce67[_0x0669('0x22')],_0x4dce67[_0x0669('0x23')],_0x4dce67[_0x0669('0x24')],_0x4dce67[_0x0669('0x25')]));logger[_0x0669('0x1f')](util[_0x0669('0x1d')](_0x0669('0x39'),_0x4dce67[_0x0669('0x2b')],_0x4dce67[_0x0669('0x2c')],parseInt(_0x4dce67[_0x0669('0x2d')],0xa)+0x1));_0x4dce67[_0x0669('0x3a')](_0x4dce67[_0x0669('0x2b')],_0x4dce67[_0x0669('0x2c')],parseInt(_0x4dce67[_0x0669('0x2d')],0xa)+0x1);_0x4dce67['close']();}function handleNotFound(_0x3fde2f){logger[_0x0669('0x35')](util[_0x0669('0x1d')](_0x0669('0x3b'),_0x3fde2f[_0x0669('0x21')]));_0x3fde2f[_0x0669('0x3a')](_0x3fde2f[_0x0669('0x2b')],_0x3fde2f[_0x0669('0x2c')],parseInt(_0x3fde2f[_0x0669('0x2d')],0xa)+0x1);_0x3fde2f[_0x0669('0x3c')]();}function handleUnpublished(_0x1e803d){logger['error'](util[_0x0669('0x1d')](_0x0669('0x3d'),_0x1e803d[_0x0669('0x21')]));_0x1e803d['continueAt'](_0x1e803d[_0x0669('0x2b')],_0x1e803d[_0x0669('0x2c')],parseInt(_0x1e803d[_0x0669('0x2d')],0xa)+0x1);_0x1e803d[_0x0669('0x3c')]();}module[_0x0669('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xe670=['getSquareProjects','error','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','../../config/logger','./graph','./vertices'];(function(_0x527930,_0x34c538){var _0x4e643c=function(_0x2b81c3){while(--_0x2b81c3){_0x527930['push'](_0x527930['shift']());}};_0x4e643c(++_0x34c538);}(_0xe670,0x15c));var _0x0e67=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0xe670[_0x57b432];return _0x2edf2a;};'use strict';var _=require('lodash');var moment=require(_0x0e67('0x0'));var parser=require(_0x0e67('0x1'));var util=require(_0x0e67('0x2'));var logger=require(_0x0e67('0x3'))('agi');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x0e67('0x4'));var Vertices=require(_0x0e67('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0e67('0x6')]()['catch'](function(_0x26ad50){logger[_0x0e67('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x26ad50['stack']);return[];});}function addVertex(_0xfcb110,_0x4af28b,_0x5f488e){_0x4af28b[_0x0e67('0x8')]=_0x5f488e;if(_0x4af28b['hasOwnProperty'](_0x0e67('0x9'))){_0x4af28b[_0x0e67('0xa')]=parseInt(_0x4af28b[_0x0e67('0x9')],0xa);}_0xfcb110[_0x0e67('0xb')](_[_0x0e67('0xc')](_0x4af28b,_0x0e67('0xd')));}function initGraph(_0x562438,_0x4fdcec){var _0x4a8dd1=new Graph();for(var _0x5a79c9 in _0x562438){if(_0x562438[_0x0e67('0xe')](_0x5a79c9)){if(_['isArray'](_0x562438[_0x5a79c9])){for(var _0x21831f=0x0;_0x21831f<_0x562438[_0x5a79c9][_0x0e67('0xf')];_0x21831f+=0x1){addVertex(_0x4a8dd1,_0x562438[_0x5a79c9][_0x21831f],_0x5a79c9);}}else{addVertex(_0x4a8dd1,_0x562438[_0x5a79c9],_0x5a79c9);}}}for(var _0x55bcd4=0x0;_0x55bcd4<_0x4fdcec[_0x0e67('0xf')];_0x55bcd4+=0x1){if(_0x4fdcec[_0x55bcd4][_0x0e67('0x10')]&&_0x4fdcec[_0x55bcd4][_0x0e67('0x11')]){_0x4a8dd1[_0x0e67('0x12')](_0x4fdcec[_0x55bcd4][_0x0e67('0x10')],_0x4fdcec[_0x55bcd4][_0x0e67('0x11')],_0x4fdcec[_0x55bcd4][_0x0e67('0x13')]);}}return _0x4a8dd1;}function getRoot(_0x2ccf26){return parser[_0x0e67('0x14')](_0x2ccf26,{'object':!![]})[_0x0e67('0x15')][_0x0e67('0x16')];}function inspect(_0x46db79){return util[_0x0e67('0x17')](_0x46db79,{'showHidden':![],'depth':null});}function initialize(_0x1123df,_0x83645f){var _0x14be61=getRoot(_0x1123df['production']);if(!_0x14be61||!_0x14be61[_0x0e67('0x18')])return;var _0x5d56f7,_0xe3bdd,_0x4e2856;logger[_0x0e67('0x19')]('root',JSON[_0x0e67('0x1a')](_0x14be61,null,0x2));_0x83645f[_0x0e67('0x1b')]=moment()[_0x0e67('0x1c')](_0x0e67('0x1d'));_0x5d56f7=initGraph(_['omit'](_0x14be61,'mxCell'),_0x14be61[_0x0e67('0xd')]);_0xe3bdd=new Vertices(_0x83645f,rpc,mailRpc);logger[_0x0e67('0x1e')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x83645f['arg_1'],_0x83645f[_0x0e67('0x1f')],_0x83645f[_0x0e67('0x20')],_0x83645f[_0x0e67('0x21')],_0x83645f[_0x0e67('0x22')]));_0x5d56f7[_0x0e67('0x23')](_0x14be61[_0x0e67('0x18')]['id'],function(_0x59d82c){try{_0x59d82c=_0xe3bdd[_0x0e67('0x24')](_0x59d82c);logger[_0x0e67('0x19')](_0x0e67('0x25'),JSON[_0x0e67('0x1a')](_0x59d82c,null,0x2));if(_0x59d82c[_0x0e67('0x8')]===_0x0e67('0x26')){logger[_0x0e67('0x1e')](_0x0e67('0x27'));_0x83645f[_0x0e67('0x28')]=_0x59d82c['context']||_0x83645f[_0x0e67('0x28')];_0x83645f[_0x0e67('0x29')]=_0x59d82c[_0x0e67('0x29')];_0x83645f['priority']=_0x59d82c[_0x0e67('0x2a')]?_0x59d82c['priority']-0x1:0x1;return null;}else if(_0x59d82c&&_0xe3bdd[_0x59d82c[_0x0e67('0x8')]]){_0x4e2856=_0xe3bdd[_0x59d82c[_0x0e67('0x8')]](_0x59d82c);logger[_0x0e67('0x1e')](_0x0e67('0x2b'),JSON[_0x0e67('0x1a')](_0x4e2856,null,0x2));if(_0x4e2856&&_0x4e2856['code']===AGI_CODE_SUCCESS&&_0x4e2856[_0x0e67('0x2c')]!==AGI_RESULT_ERROR&&!_0x83645f[_0x0e67('0x2d')]){logger[_0x0e67('0x19')](_0x0e67('0x2b'),inspect(_0x4e2856));return _[_0x0e67('0x2e')](_0x4e2856['result'])?null:_0x4e2856[_0x0e67('0x2c')]['toString']();}else{logger[_0x0e67('0x7')]('response',inspect(_0x4e2856));return null;}}else{logger[_0x0e67('0x7')](_0x0e67('0x2f'));return null;}}catch(_0x47570f){logger[_0x0e67('0x7')](_0x47570f[_0x0e67('0x30')]);return null;}});if(_0x14be61[_0x0e67('0x31')]){logger[_0x0e67('0x1e')](util[_0x0e67('0x1c')](_0x0e67('0x32'),_0x83645f[_0x0e67('0x33')],_0x83645f['calleridname'],_0x83645f[_0x0e67('0x20')],_0x83645f[_0x0e67('0x21')],_0x83645f[_0x0e67('0x22')]));_0x5d56f7['traverseBFS'](_0x14be61[_0x0e67('0x31')]['id'],function(_0x493280){try{_0x493280=_0xe3bdd[_0x0e67('0x24')](_0x493280);logger['debug'](_0x0e67('0x25'),JSON['stringify'](_0x493280,null,0x2));if(_0x493280&&_0xe3bdd[_0x493280[_0x0e67('0x8')]]){_0x4e2856=_0xe3bdd[_0x493280[_0x0e67('0x8')]](_0x493280);if(_0x4e2856){logger[_0x0e67('0x19')](_0x0e67('0x2b'),inspect(_0x4e2856));return _[_0x0e67('0x2e')](_0x4e2856[_0x0e67('0x2c')])?null:_0x4e2856[_0x0e67('0x2c')][_0x0e67('0x34')]();}else{logger[_0x0e67('0x7')](_0x0e67('0x2b'),inspect(_0x4e2856));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x19cc99){logger['error'](_0x19cc99['stack']);return null;}});}logger['info'](util[_0x0e67('0x1c')](_0x0e67('0x35'),_0x83645f[_0x0e67('0x33')],_0x83645f['calleridname'],_0x83645f[_0x0e67('0x20')],_0x83645f[_0x0e67('0x21')],_0x83645f[_0x0e67('0x22')]));logger['info'](util[_0x0e67('0x1c')](_0x0e67('0x36'),_0x83645f[_0x0e67('0x28')],_0x83645f[_0x0e67('0x29')],parseInt(_0x83645f[_0x0e67('0x2a')],0xa)+0x1));_0x83645f[_0x0e67('0x37')](_0x83645f['context'],_0x83645f['extension'],parseInt(_0x83645f['priority'],0xa)+0x1);_0x83645f['close']();}function handleNotFound(_0x46edc2){logger[_0x0e67('0x7')](util[_0x0e67('0x1c')](_0x0e67('0x38'),_0x46edc2[_0x0e67('0x33')]));_0x46edc2[_0x0e67('0x37')](_0x46edc2[_0x0e67('0x28')],_0x46edc2[_0x0e67('0x29')],parseInt(_0x46edc2[_0x0e67('0x2a')],0xa)+0x1);_0x46edc2['close']();}function handleUnpublished(_0x41fe6a){logger[_0x0e67('0x7')](util['format'](_0x0e67('0x39'),_0x41fe6a[_0x0e67('0x33')]));_0x41fe6a[_0x0e67('0x37')](_0x41fe6a[_0x0e67('0x28')],_0x41fe6a[_0x0e67('0x29')],parseInt(_0x41fe6a[_0x0e67('0x2a')],0xa)+0x1);_0x41fe6a['close']();}module[_0x0e67('0x3a')]={'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 9b7f5c4..ccfbf4d 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 _0x9d53=['exports','util','Transform','call','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','substring','split','trim','length','emit','indexOf','line'];(function(_0x4167d9,_0x444ce5){var _0x191a00=function(_0x307c0){while(--_0x307c0){_0x4167d9['push'](_0x4167d9['shift']());}};_0x191a00(++_0x444ce5);}(_0x9d53,0xf1));var _0x39d5=function(_0x4a3997,_0x36f511){_0x4a3997=_0x4a3997-0x0;var _0x5a5951=_0x9d53[_0x4a3997];return _0x5a5951;};'use strict';var util=require(_0x39d5('0x0'));var Transform=require('stream')[_0x39d5('0x1')];function AGIReply(_0x5b5c44){Transform[_0x39d5('0x2')](this,_0x5b5c44);this['_localBuffer']='';this[_0x39d5('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x39d5('0x4')][_0x39d5('0x5')]=function(_0xf1d6ca,_0x17a6de,_0x28c41e){var _0x2d833c='\x0a',_0xa5604a=['\x0a\x0a',_0x39d5('0x6')],_0x2d840b=-0x1,_0x301fd2=-0x1,_0x49755f='',_0xdf5ba1=0x0,_0xdbdcb4='',_0x2593e6='';this[_0x39d5('0x7')]+=_0xf1d6ca['toString']();_0xdbdcb4=this['_localBuffer'];if(!this['_inBody']){_0xdf5ba1=0x0;while(_0xa5604a[_0xdf5ba1]){while((_0x301fd2=_0xdbdcb4['indexOf'](_0xa5604a[_0xdf5ba1]))!=-0x1){_0x49755f=_0xa5604a[_0xdf5ba1];_0x2593e6=_0xdbdcb4['substring'](0x0,_0x301fd2);_0xdbdcb4=_0xdbdcb4[_0x39d5('0x8')](_0x301fd2+_0x49755f['length']);var _0x35de5e=_0x2593e6[_0x39d5('0x9')](_0x2d833c),_0xf53f1e=0x0,_0x189ef6={},_0x2ec583='',_0x49f39a='',_0x56afa1=-0x1;while(_0x35de5e[_0xf53f1e]){_0x56afa1=_0x35de5e[_0xf53f1e]['indexOf'](':');if(_0x56afa1!=-0x1){_0x2ec583=_0x35de5e[_0xf53f1e]['slice'](0x0,_0x56afa1)[_0x39d5('0xa')]();_0x49f39a=_0x35de5e[_0xf53f1e]['slice'](_0x56afa1+0x1)[_0x39d5('0xa')]();if(_0x2ec583[_0x39d5('0xb')]>0x0){_0x189ef6[_0x2ec583]=_0x49f39a;}}else{}_0xf53f1e++;}this[_0x39d5('0xc')]('headers',_0x189ef6);this['_inBody']=!![];}_0xdf5ba1++;}this[_0x39d5('0x7')]=_0xdbdcb4;}else{while((_0x2d840b=_0xdbdcb4[_0x39d5('0xd')](_0x2d833c))!=-0x1){_0x2593e6=_0xdbdcb4[_0x39d5('0x8')](0x0,_0x2d840b);this['emit'](_0x39d5('0xe'),_0x2593e6);_0xdbdcb4=_0xdbdcb4['substring'](_0x2d840b+_0x2d833c['length']);}this[_0x39d5('0x7')]=_0xdbdcb4;}_0x28c41e();};module[_0x39d5('0xf')]=AGIReply; \ No newline at end of file +var _0xe0c0=['trim','emit','headers','line','exports','util','Transform','call','_localBuffer','inherits','prototype','_transform','_inBody','indexOf','substring','length','split','slice'];(function(_0x15dc5f,_0x165eaa){var _0x15531f=function(_0x9364f9){while(--_0x9364f9){_0x15dc5f['push'](_0x15dc5f['shift']());}};_0x15531f(++_0x165eaa);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x379e37,_0x2830b9){_0x379e37=_0x379e37-0x0;var _0x33e469=_0xe0c0[_0x379e37];return _0x33e469;};'use strict';var util=require(_0x0e0c('0x0'));var Transform=require('stream')[_0x0e0c('0x1')];function AGIReply(_0x22f967){Transform[_0x0e0c('0x2')](this,_0x22f967);this[_0x0e0c('0x3')]='';this['_inBody']=![];}util[_0x0e0c('0x4')](AGIReply,Transform);AGIReply[_0x0e0c('0x5')][_0x0e0c('0x6')]=function(_0x54c73b,_0x4271d1,_0x2856d7){var _0x4a094c='\x0a',_0x14e5de=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0xd67cf8=-0x1,_0xf7de29=-0x1,_0x13e45d='',_0xe3ccce=0x0,_0x512f83='',_0x4bc377='';this[_0x0e0c('0x3')]+=_0x54c73b['toString']();_0x512f83=this[_0x0e0c('0x3')];if(!this[_0x0e0c('0x7')]){_0xe3ccce=0x0;while(_0x14e5de[_0xe3ccce]){while((_0xf7de29=_0x512f83[_0x0e0c('0x8')](_0x14e5de[_0xe3ccce]))!=-0x1){_0x13e45d=_0x14e5de[_0xe3ccce];_0x4bc377=_0x512f83[_0x0e0c('0x9')](0x0,_0xf7de29);_0x512f83=_0x512f83[_0x0e0c('0x9')](_0xf7de29+_0x13e45d[_0x0e0c('0xa')]);var _0x45b7fb=_0x4bc377[_0x0e0c('0xb')](_0x4a094c),_0x348502=0x0,_0x5b514a={},_0x246fd6='',_0x5c31c7='',_0x5794fa=-0x1;while(_0x45b7fb[_0x348502]){_0x5794fa=_0x45b7fb[_0x348502][_0x0e0c('0x8')](':');if(_0x5794fa!=-0x1){_0x246fd6=_0x45b7fb[_0x348502][_0x0e0c('0xc')](0x0,_0x5794fa)[_0x0e0c('0xd')]();_0x5c31c7=_0x45b7fb[_0x348502][_0x0e0c('0xc')](_0x5794fa+0x1)[_0x0e0c('0xd')]();if(_0x246fd6['length']>0x0){_0x5b514a[_0x246fd6]=_0x5c31c7;}}else{}_0x348502++;}this[_0x0e0c('0xe')](_0x0e0c('0xf'),_0x5b514a);this[_0x0e0c('0x7')]=!![];}_0xe3ccce++;}this['_localBuffer']=_0x512f83;}else{while((_0xd67cf8=_0x512f83[_0x0e0c('0x8')](_0x4a094c))!=-0x1){_0x4bc377=_0x512f83[_0x0e0c('0x9')](0x0,_0xd67cf8);this[_0x0e0c('0xe')](_0x0e0c('0x10'),_0x4bc377);_0x512f83=_0x512f83[_0x0e0c('0x9')](_0xd67cf8+_0x4a094c[_0x0e0c('0xa')]);}this[_0x0e0c('0x3')]=_0x512f83;}_0x2856d7();};module[_0x0e0c('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index bb82bfd..8e4e41f 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 _0xe062=['format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','moment','client','http','request','error','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2'];(function(_0x4c3957,_0x2cb8ac){var _0xb7c8fb=function(_0x5621fc){while(--_0x5621fc){_0x4c3957['push'](_0x4c3957['shift']());}};_0xb7c8fb(++_0x2cb8ac);}(_0xe062,0xd5));var _0x2e06=function(_0x2228ff,_0x336811){_0x2228ff=_0x2228ff-0x0;var _0x24f1cf=_0xe062[_0x2228ff];return _0x24f1cf;};'use strict';var _=require(_0x2e06('0x0'));var moment=require(_0x2e06('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x2e06('0x2')][_0x2e06('0x3')]({'port':0x2329});function request(_0x1a53ed,_0x4c0121){return new Promise(function(_0x4d80de,_0x1a9d7d){return client[_0x2e06('0x4')](_0x1a53ed,_0x4c0121)['then'](function(_0x504777){if(_0x504777[_0x2e06('0x5')]){return _0x1a9d7d(_0x504777[_0x2e06('0x5')]['message']);}else{return _0x4d80de(_0x504777['result']);}})[_0x2e06('0x6')](function(_0x31645b){return _0x1a9d7d(_0x31645b);});});}exports[_0x2e06('0x7')]=function(){return request(_0x2e06('0x8'),{'options':{'raw':![],'attributes':['id',_0x2e06('0x9'),_0x2e06('0xa')]}});};exports['getSquareProject']=function(_0x54d845){return request(_0x2e06('0xb'),{'options':{'raw':![],'where':{'name':_0x54d845},'attributes':[_0x2e06('0xa')]}});};exports[_0x2e06('0xc')]=function(_0x5b3e52){return request(_0x2e06('0xd'),{'options':{'raw':![],'where':{'id':_0x5b3e52},'include':[{'model':_0x2e06('0xe'),'as':_0x2e06('0xf'),'include':[{'model':_0x2e06('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0x2e06('0x9'),_0x2e06('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0xd781db){return request(_0x2e06('0xb'),{'options':{'where':{'id':_0xd781db},'attributes':['name']}});};exports[_0x2e06('0x12')]=function(_0x2a3a2a){return request(_0x2e06('0x13'),{'options':{'where':{'id':_0x2a3a2a},'attributes':[_0x2e06('0x9')]}});};exports[_0x2e06('0x14')]=function(_0x15b8f5){return request('ShowVariable',{'options':{'where':{'id':_0x15b8f5},'attributes':[_0x2e06('0x9')]}});};exports[_0x2e06('0x15')]=function(_0x210e11){return request(_0x2e06('0x16'),{'options':{'where':{'id':_0x210e11},'attributes':[_0x2e06('0x17')]}});};exports[_0x2e06('0x18')]=function(_0x23da6b){return request(_0x2e06('0x19'),{'options':{'where':{'id':_0x23da6b},'attributes':[_0x2e06('0x9')]}});};exports['getContactByPhone']=function(_0x209942){return request(_0x2e06('0x1a'),{'options':{'where':{'phone':_0x209942['phone']},'attributes':['id']}});};exports[_0x2e06('0x1b')]=function(_0x173e14){return request(_0x2e06('0x1c'),{'options':{'where':{'id':_0x173e14},'attributes':[_0x2e06('0x9')]}});};exports[_0x2e06('0x1d')]=function(_0x2b931f){return request(_0x2e06('0x1e'),{'options':{'where':{'id':_0x2b931f},'attributes':[_0x2e06('0x1f')]}});};exports[_0x2e06('0x20')]=function(_0x223d24){return request(_0x2e06('0x21'),{'options':{'raw':![],'where':{'id':_0x223d24},'include':[{'model':_0x2e06('0x22'),'as':_0x2e06('0x23')}]}});};exports[_0x2e06('0x24')]=function(_0x27d028){return request(_0x2e06('0x25'),{'options':{'where':{'id':_0x27d028},'attributes':['id',_0x2e06('0x9')]}});};exports[_0x2e06('0x26')]=function(_0x4963eb){return request(_0x2e06('0x27'),{'body':_0x4963eb});};exports[_0x2e06('0x28')]=function(_0x74e8e6){return request(_0x2e06('0x29'),{'body':_0x74e8e6});};exports[_0x2e06('0x2a')]=function(_0x10deac){return request(_0x2e06('0x2b'),{'body':_[_0x2e06('0x2c')](_0x10deac,{'project_name':_0x10deac[_0x2e06('0x2d')],'prev_project_name':_0x10deac['arg_2']||'','is_subproject':_0x10deac[_0x2e06('0x2e')]?!![]:![],'leaveAt':moment()[_0x2e06('0x2f')](_0x2e06('0x30'))})});};exports[_0x2e06('0x31')]=function(_0xd54278){return request('CreateSquareRecording',{'body':_0xd54278});};exports[_0x2e06('0x32')]=function(_0x519214){return request(_0x2e06('0x33'),{'body':_0x519214});};exports[_0x2e06('0x34')]=function(_0x577278){return request(_0x2e06('0x35'),{'options':{'raw':![],'where':{'phone':_0x577278[_0x2e06('0x36')],'ListId':_0x577278[_0x2e06('0x37')]}}})['then'](function(_0x5a48f6){if(_0x5a48f6){return _0x5a48f6;}return request(_0x2e06('0x38'),{'body':_0x577278});});};exports[_0x2e06('0x39')]=function(_0x11d757){return request(_0x2e06('0x3a'),{'options':{'where':{'id':_0x11d757},'attributes':[_0x2e06('0x9')]}});};exports[_0x2e06('0x3b')]=function(_0x25b1f2,_0xdcf571){return request(_0x2e06('0x3c'),{'body':{'interface':_0xdcf571},'options':{'where':_0x25b1f2}});};exports['agentPause']=function(_0x5c931a,_0x4dfc10,_0x4a265b){return request(_0x2e06('0x3d'),{'body':{'type':_0x4dfc10,'uniqueid':_0x4a265b},'options':{'where':_0x5c931a}});};exports[_0x2e06('0x3e')]=function(_0x5bbce4){return request(_0x2e06('0x3f'),{'body':{},'options':{'where':_0x5bbce4}});};exports[_0x2e06('0x40')]=function(_0x2c3777){return request('LogoutUser',{'body':{},'options':{'where':_0x2c3777}});}; \ No newline at end of file +var _0x581a=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x3bba3e,_0x1ca95f){var _0xb7279a=function(_0x3c7f2a){while(--_0x3c7f2a){_0x3bba3e['push'](_0x3bba3e['shift']());}};_0xb7279a(++_0x1ca95f);}(_0x581a,0x127));var _0xa581=function(_0x4e3a1e,_0x33f92d){_0x4e3a1e=_0x4e3a1e-0x0;var _0x4fbe3f=_0x581a[_0x4e3a1e];return _0x4fbe3f;};'use strict';var _=require(_0xa581('0x0'));var moment=require(_0xa581('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xa581('0x2')][_0xa581('0x3')]({'port':0x2329});function request(_0xbe2ff0,_0x22d913){return new Promise(function(_0x3f5c21,_0x4e64cc){return client['request'](_0xbe2ff0,_0x22d913)[_0xa581('0x4')](function(_0x510f40){if(_0x510f40[_0xa581('0x5')]){return _0x4e64cc(_0x510f40[_0xa581('0x5')][_0xa581('0x6')]);}else{return _0x3f5c21(_0x510f40[_0xa581('0x7')]);}})[_0xa581('0x8')](function(_0x1875a5){return _0x4e64cc(_0x1875a5);});});}exports[_0xa581('0x9')]=function(){return request(_0xa581('0xa'),{'options':{'raw':![],'attributes':['id',_0xa581('0xb'),_0xa581('0xc')]}});};exports[_0xa581('0xd')]=function(_0x59edee){return request(_0xa581('0xe'),{'options':{'raw':![],'where':{'name':_0x59edee},'attributes':[_0xa581('0xc')]}});};exports[_0xa581('0xf')]=function(_0x5034a2){return request(_0xa581('0x10'),{'options':{'raw':![],'where':{'id':_0x5034a2},'include':[{'model':_0xa581('0x11'),'as':_0xa581('0x12'),'include':[{'model':'CloudProvider','as':_0xa581('0x13')}]}],'attributes':['id',_0xa581('0xb'),_0xa581('0x14')],'smtp':!![]}});};exports[_0xa581('0x15')]=function(_0x202296){return request('ShowSquareProject',{'options':{'where':{'id':_0x202296},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x16')]=function(_0x23b205){return request(_0xa581('0x17'),{'options':{'where':{'id':_0x23b205},'attributes':['name']}});};exports['getVariableById']=function(_0x57d86e){return request(_0xa581('0x18'),{'options':{'where':{'id':_0x57d86e},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x19')]=function(_0xf6f762){return request('ShowSquareOdbc',{'options':{'where':{'id':_0xf6f762},'attributes':[_0xa581('0x1a')]}});};exports[_0xa581('0x1b')]=function(_0x1bebe0){return request(_0xa581('0x1c'),{'options':{'where':{'id':_0x1bebe0},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x1d')]=function(_0x547074){return request('GetContactByPhone',{'options':{'where':{'phone':_0x547074[_0xa581('0x1e')]},'attributes':['id']}});};exports[_0xa581('0x1f')]=function(_0x2a789a){return request('ShowTrunk',{'options':{'where':{'id':_0x2a789a},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x20')]=function(_0x13c4bc){return request(_0xa581('0x21'),{'options':{'where':{'id':_0x13c4bc},'attributes':[_0xa581('0x22')]}});};exports[_0xa581('0x23')]=function(_0x256e26){return request(_0xa581('0x24'),{'options':{'raw':![],'where':{'id':_0x256e26},'include':[{'model':_0xa581('0x25'),'as':_0xa581('0x26')}]}});};exports[_0xa581('0x27')]=function(_0x4706d0){return request(_0xa581('0x28'),{'options':{'where':{'id':_0x4706d0},'attributes':['id','name']}});};exports[_0xa581('0x29')]=function(_0x44fa06){return request(_0xa581('0x2a'),{'body':_0x44fa06});};exports[_0xa581('0x2b')]=function(_0x460d1e){return request(_0xa581('0x2c'),{'body':_0x460d1e});};exports[_0xa581('0x2d')]=function(_0x2207b7){return request(_0xa581('0x2e'),{'body':_[_0xa581('0x2f')](_0x2207b7,{'project_name':_0x2207b7[_0xa581('0x30')],'prev_project_name':_0x2207b7[_0xa581('0x31')]||'','is_subproject':_0x2207b7[_0xa581('0x31')]?!![]:![],'leaveAt':moment()[_0xa581('0x32')](_0xa581('0x33'))})});};exports[_0xa581('0x34')]=function(_0x49fd7b){return request(_0xa581('0x35'),{'body':_0x49fd7b});};exports[_0xa581('0x36')]=function(_0x32388a){return request('CreateSquareMessage',{'body':_0x32388a});};exports[_0xa581('0x37')]=function(_0x1d585b){return request(_0xa581('0x38'),{'options':{'raw':![],'where':{'phone':_0x1d585b[_0xa581('0x1e')],'ListId':_0x1d585b[_0xa581('0x39')]}}})['then'](function(_0x46243b){if(_0x46243b){return _0x46243b;}return request('CreateCmContact',{'body':_0x1d585b});});};exports[_0xa581('0x3a')]=function(_0x54f8db){return request(_0xa581('0x3b'),{'options':{'where':{'id':_0x54f8db},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x3c')]=function(_0x329b2e,_0x597b98){return request(_0xa581('0x3d'),{'body':{'interface':_0x597b98},'options':{'where':_0x329b2e}});};exports[_0xa581('0x3e')]=function(_0x2f06c4,_0x5e047a,_0x3b9653){return request(_0xa581('0x3f'),{'body':{'type':_0x5e047a,'uniqueid':_0x3b9653},'options':{'where':_0x2f06c4}});};exports[_0xa581('0x40')]=function(_0x19ea24){return request(_0xa581('0x41'),{'body':{},'options':{'where':_0x19ea24}});};exports['agentLogout']=function(_0x24ec46){return request(_0xa581('0x42'),{'body':{},'options':{'where':_0x24ec46}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index e03271a..a63dbc2 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 _0xf981=['./lex','exports','./polly'];(function(_0x4f98b7,_0x36a22c){var _0x5e201e=function(_0x216c4b){while(--_0x216c4b){_0x4f98b7['push'](_0x4f98b7['shift']());}};_0x5e201e(++_0x36a22c);}(_0xf981,0xe6));var _0x1f98=function(_0x2fa75a,_0x55c126){_0x2fa75a=_0x2fa75a-0x0;var _0x3c5820=_0xf981[_0x2fa75a];return _0x3c5820;};var polly=require(_0x1f98('0x0'));var lex=require(_0x1f98('0x1'));module[_0x1f98('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x432b=['exports','./polly'];(function(_0x421e74,_0x38f8b4){var _0x1f4f38=function(_0xafecf9){while(--_0xafecf9){_0x421e74['push'](_0x421e74['shift']());}};_0x1f4f38(++_0x38f8b4);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};var polly=require(_0xb432('0x0'));var lex=require('./lex');module[_0xb432('0x1')]={'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 1273693..a97c499 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x526a27,_0x8ee13a){var _0x29db51=function(_0x1fd303){while(--_0x1fd303){_0x526a27['push'](_0x526a27['shift']());}};_0x29db51(++_0x8ee13a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ 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 17d12d4..090b385 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(_0xead1c7,_0x49d6f7){var _0x551f3e=function(_0x214d2c){while(--_0x214d2c){_0xead1c7['push'](_0xead1c7['shift']());}};_0x551f3e(++_0x49d6f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x2e1d21,_0x492e1a){var _0x22efe8=function(_0x521461){while(--_0x521461){_0x2e1d21['push'](_0x2e1d21['shift']());}};_0x22efe8(++_0x492e1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 8a8c1a6..9330a5c 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 _0xc5d4=['./lib/api','exports'];(function(_0x2084a8,_0x48125d){var _0x292f41=function(_0x4e8cca){while(--_0x4e8cca){_0x2084a8['push'](_0x2084a8['shift']());}};_0x292f41(++_0x48125d);}(_0xc5d4,0x10e));var _0x4c5d=function(_0x202569,_0x582199){_0x202569=_0x202569-0x0;var _0xb8cfd2=_0xc5d4[_0x202569];return _0xb8cfd2;};'use strict';var polly=require(_0x4c5d('0x0'));module[_0x4c5d('0x1')]=function(_0x5db8cd,_0x4af900,_0x2a1d2d,_0x994af9,_0xf72975,_0xc385bf,_0xb193de){return polly(_0x5db8cd,_0x4af900,_0x2a1d2d,_0x994af9,_0xf72975,_0xc385bf,_0xb193de);}; \ No newline at end of file +var _0x990d=['exports','./lib/api'];(function(_0x1524e5,_0x3fbc03){var _0xfdf9bd=function(_0x3ce238){while(--_0x3ce238){_0x1524e5['push'](_0x1524e5['shift']());}};_0xfdf9bd(++_0x3fbc03);}(_0x990d,0x1d7));var _0xd990=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0x990d[_0x30bdff];return _0x1e7ca9;};'use strict';var polly=require(_0xd990('0x0'));module[_0xd990('0x1')]=function(_0x198d44,_0x4d8a01,_0x14f3ad,_0x20e4ab,_0x12f889,_0x567c0b,_0x429e55){return polly(_0x198d44,_0x4d8a01,_0x14f3ad,_0x20e4ab,_0x12f889,_0x567c0b,_0x429e55);}; \ 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 60f1f17..41f6c7d 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 _0xad0e=['randomstring','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','path','bluebird'];(function(_0x5efb4d,_0x17b335){var _0xafb394=function(_0x3f146f){while(--_0x3f146f){_0x5efb4d['push'](_0x5efb4d['shift']());}};_0xafb394(++_0x17b335);}(_0xad0e,0x73));var _0xead0=function(_0x2bfd67,_0x393812){_0x2bfd67=_0x2bfd67-0x0;var _0x46bf94=_0xad0e[_0x2bfd67];return _0x46bf94;};'use strict';var fs=require('fs');var path=require(_0xead0('0x0'));var BPromise=require(_0xead0('0x1'));var rs=require(_0xead0('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x33a18f,_0x9474b5,_0x4d97e4){return new BPromise(function(_0x458603,_0x187f90){_0x33a18f[_0xead0('0x3')](_0x9474b5,function(_0x17d1c3,_0x1174e6){if(_0x17d1c3){_0x187f90(_0x17d1c3);}else if(_0x1174e6){if(_0x1174e6['AudioStream']instanceof Buffer){fs[_0xead0('0x4')](_0x4d97e4,_0x1174e6['AudioStream'],function(_0x3764a9){if(_0x3764a9){_0x187f90(_0x3764a9);}else{_0x458603();}});}else{_0x187f90(new Error(_0xead0('0x5')));}}else{_0x187f90(new Error(_0xead0('0x6')));}});});}module['exports']=function(_0x44d16c,_0x4a7a4b,_0x5ecd85,_0xe2062d,_0x3b810f,_0x37ca6d,_0x385ef3){var _0x1f5e34=new AWS[(_0xead0('0x7'))]({'accessKeyId':_0x44d16c,'secretAccessKey':_0x4a7a4b,'region':_0x5ecd85});var _0x3234bb={'Text':_0x3b810f,'TextType':_0x37ca6d||'text','OutputFormat':_0xead0('0x8'),'VoiceId':_0xe2062d};return pollyResult(_0x1f5e34,_0x3234bb,_0x385ef3);}; \ No newline at end of file +var _0x09df=['path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3'];(function(_0x4a3acd,_0x4bf641){var _0x3efdaa=function(_0x32842d){while(--_0x32842d){_0x4a3acd['push'](_0x4a3acd['shift']());}};_0x3efdaa(++_0x4bf641);}(_0x09df,0x1d4));var _0xf09d=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x09df[_0x479509];return _0x382da8;};'use strict';var fs=require('fs');var path=require(_0xf09d('0x0'));var BPromise=require(_0xf09d('0x1'));var rs=require('randomstring');var AWS=require(_0xf09d('0x2'));function pollyResult(_0x1b7df7,_0x4a1bdb,_0x1b4259){return new BPromise(function(_0x29fc75,_0x5c4c28){_0x1b7df7[_0xf09d('0x3')](_0x4a1bdb,function(_0x5b5d0c,_0x34bb74){if(_0x5b5d0c){_0x5c4c28(_0x5b5d0c);}else if(_0x34bb74){if(_0x34bb74[_0xf09d('0x4')]instanceof Buffer){fs['writeFile'](_0x1b4259,_0x34bb74['AudioStream'],function(_0x8ddd43){if(_0x8ddd43){_0x5c4c28(_0x8ddd43);}else{_0x29fc75();}});}else{_0x5c4c28(new Error(_0xf09d('0x5')));}}else{_0x5c4c28(new Error(_0xf09d('0x6')));}});});}module['exports']=function(_0x2d008b,_0x5ae0d1,_0x549a13,_0x7f48,_0x57aef2,_0x4c3acb,_0x4069bd){var _0x54ef48=new AWS['Polly']({'accessKeyId':_0x2d008b,'secretAccessKey':_0x5ae0d1,'region':_0x549a13});var _0x226cdd={'Text':_0x57aef2,'TextType':_0x4c3acb||_0xf09d('0x7'),'OutputFormat':_0xf09d('0x8'),'VoiceId':_0x7f48};return pollyResult(_0x54ef48,_0x226cdd,_0x4069bd);}; \ 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 69f029a..6280b21 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 _0xc9d3=['./lib/api'];(function(_0x444f2a,_0x568f72){var _0x14376f=function(_0x38f892){while(--_0x38f892){_0x444f2a['push'](_0x444f2a['shift']());}};_0x14376f(++_0x568f72);}(_0xc9d3,0x1c8));var _0x3c9d=function(_0x4251f9,_0x26a7ce){_0x4251f9=_0x4251f9-0x0;var _0x2ea432=_0xc9d3[_0x4251f9];return _0x2ea432;};'use strict';var asr=require(_0x3c9d('0x0'));module['exports']=function(_0x3373a6,_0x4051cc,_0x2207a9,_0x4dedf0){return asr(_0x3373a6,_0x4051cc,_0x2207a9);}; \ No newline at end of file +var _0xbb28=['./lib/api','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xbb28,0x70));var _0x8bb2=function(_0x2475f4,_0x357db6){_0x2475f4=_0x2475f4-0x0;var _0x574e75=_0xbb28[_0x2475f4];return _0x574e75;};'use strict';var asr=require(_0x8bb2('0x0'));module[_0x8bb2('0x1')]=function(_0x112987,_0x2c0a44,_0x3184ee,_0x521fe9){return asr(_0x112987,_0x2c0a44,_0x3184ee);}; \ 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 79db45f..d104158 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 _0x9aea=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9aea,0xdd));var _0xa9ae=function(_0x4dafca,_0x593cdf){_0x4dafca=_0x4dafca-0x0;var _0x25f093=_0x9aea[_0x4dafca];return _0x25f093;};'use strict';var url=require(_0xa9ae('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa9ae('0x1');module['exports']=function(_0x2b5e0c,_0x13679e,_0x563a24){return new BPromise(function(_0x414638,_0x115593){var _0x41fb71;if(typeof _0x2b5e0c!==_0xa9ae('0x2')||_0x2b5e0c[_0xa9ae('0x3')]===0x0){return _0x115593('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x13679e!==_0xa9ae('0x2')||_0x13679e[_0xa9ae('0x3')]===0x0){return _0x115593(_0xa9ae('0x4'));}if(typeof _0x563a24!=='undefined'&&(typeof _0x563a24!==_0xa9ae('0x2')||_0x563a24[_0xa9ae('0x3')]===0x0)){return _0x115593(_0xa9ae('0x5'));}try{_0x41fb71=fs[_0xa9ae('0x6')](_0x2b5e0c)[_0xa9ae('0x7')](_0xa9ae('0x8'));}catch(_0x1816c2){return _0x115593(_0x1816c2);}return _0x414638({'method':_0xa9ae('0x9'),'uri':host+_0xa9ae('0xa')+_0x13679e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa9ae('0xb'),'languageCode':_0x563a24},'audio':{'content':_0x41fb71}},'json':!![]});});}; \ No newline at end of file +var _0x2121=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','8000','url','bluebird','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x2121,0x1b4));var _0x1212=function(_0x32f790,_0x1eb6fd){_0x32f790=_0x32f790-0x0;var _0x21e667=_0x2121[_0x32f790];return _0x21e667;};'use strict';var url=require(_0x1212('0x0'));var BPromise=require(_0x1212('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x1e00c4,_0x3081d8,_0x3929a1){return new BPromise(function(_0x2447e3,_0x44337c){var _0x553ed1;if(typeof _0x1e00c4!==_0x1212('0x2')||_0x1e00c4['length']===0x0){return _0x44337c(_0x1212('0x3'));}if(typeof _0x3081d8!==_0x1212('0x2')||_0x3081d8[_0x1212('0x4')]===0x0){return _0x44337c(_0x1212('0x5'));}if(typeof _0x3929a1!==_0x1212('0x6')&&(typeof _0x3929a1!==_0x1212('0x2')||_0x3929a1['length']===0x0)){return _0x44337c(_0x1212('0x7'));}try{_0x553ed1=fs[_0x1212('0x8')](_0x1e00c4)[_0x1212('0x9')](_0x1212('0xa'));}catch(_0x15011d){return _0x44337c(_0x15011d);}return _0x2447e3({'method':_0x1212('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x3081d8,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x1212('0xc'),'languageCode':_0x3929a1},'audio':{'content':_0x553ed1}},'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 6a57c0c..e3331e8 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 _0x5b5e=['exports'];(function(_0x5400ae,_0x1b8785){var _0x15bdac=function(_0x24a4a0){while(--_0x24a4a0){_0x5400ae['push'](_0x5400ae['shift']());}};_0x15bdac(++_0x1b8785);}(_0x5b5e,0xa6));var _0xe5b5=function(_0x4e66f1,_0x281808){_0x4e66f1=_0x4e66f1-0x0;var _0x312451=_0x5b5e[_0x4e66f1];return _0x312451;};var asr=require('./asr');module[_0xe5b5('0x0')]={'asr':asr}; \ No newline at end of file +var _0xa1b0=['exports'];(function(_0x3b8342,_0x5781a5){var _0x1ed49c=function(_0x56120c){while(--_0x56120c){_0x3b8342['push'](_0x3b8342['shift']());}};_0x1ed49c(++_0x5781a5);}(_0xa1b0,0x140));var _0x0a1b=function(_0x43e226,_0x1e045b){_0x43e226=_0x43e226-0x0;var _0x42e235=_0xa1b0[_0x43e226];return _0x42e235;};var asr=require('./asr');module[_0x0a1b('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 9bc3e04..2e3eaa0 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 _0xd5fe=['toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','audioContent','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','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','model=%s','freeform=3','parse','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','bluebird','dialogflow','http','md5','path','request-promise','randomstring','sox','google-tts-api','./aws','./google','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','createWriteStream','finish','info','close','unlink','error','pipe','end','host','get','statusMessage','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync'];(function(_0x1956f2,_0x52ce03){var _0x1e79cc=function(_0x2ad5ec){while(--_0x2ad5ec){_0x1956f2['push'](_0x1956f2['shift']());}};_0x1e79cc(++_0x52ce03);}(_0xd5fe,0xdb));var _0xed5f=function(_0x490e0a,_0x1eca50){_0x490e0a=_0x490e0a-0x0;var _0x212ff2=_0xd5fe[_0x490e0a];return _0x212ff2;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xed5f('0x0'));var dialogflow=require(_0xed5f('0x1'));var fs=require('fs');var http=require(_0xed5f('0x2'));var https=require('https');var md5=require(_0xed5f('0x3'));var path=require(_0xed5f('0x4'));var querystring=require('querystring');var rp=require(_0xed5f('0x5'));var rs=require(_0xed5f('0x6'));var sox=require(_0xed5f('0x7'));var tts=require(_0xed5f('0x8'));var urlParse=require('url')['parse'];var util=require('util');var aws=require(_0xed5f('0x9'));var google=require(_0xed5f('0xa'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xed5f('0xb'));var ISPEECH_API=_0xed5f('0xc');function downloadFile(_0x515b79,_0x2c5b2c){return new BPromise(function(_0x3aa2a4,_0x39c5be){var _0x2c833c=urlParse(_0x515b79);var _0x3da6ee=_0x2c833c[_0xed5f('0xd')]===_0xed5f('0xe')?https:http;var _0x564745={'host':_0x2c833c['host'],'path':_0x2c833c[_0xed5f('0x4')],'headers':{'user-agent':_0xed5f('0xf')}};_0x3da6ee['get'](_0x564745,function(_0x12dcb9){if(_0x12dcb9[_0xed5f('0x10')]!==0xc8){logger['error']('request\x20to\x20'+_0x515b79+_0xed5f('0x11')+_0x12dcb9['statusCode']+'\x20('+_0x12dcb9['statusMessage']+')');_0x39c5be(new Error(_0xed5f('0x12')+_0x515b79+'\x20failed,\x20status\x20code\x20=\x20'+_0x12dcb9['statusCode']+'\x20('+_0x12dcb9['statusMessage']+')'));return;}var _0x1f75c7=fs[_0xed5f('0x13')](_0x2c5b2c);_0x1f75c7['on'](_0xed5f('0x14'),function(){logger[_0xed5f('0x15')]('finish\x20download\x20file');_0x1f75c7[_0xed5f('0x16')](_0x3aa2a4);});_0x1f75c7['on']('error',function(_0x8f11f1){fs[_0xed5f('0x17')](_0x2c5b2c);logger[_0xed5f('0x18')]('download\x20error',_0x8f11f1);_0x39c5be(_0x8f11f1);});_0x12dcb9[_0xed5f('0x19')](_0x1f75c7);})['on'](_0xed5f('0x18'),function(_0x2f8ff0){logger[_0xed5f('0x18')](_0x2f8ff0);_0x39c5be(_0x2f8ff0);})[_0xed5f('0x1a')]();});}function uploadFile(_0x211272){return new BPromise(function(_0x29facb,_0x21dd16){var _0x2c7faf=urlParse(_0x211272);var _0x3b28d3=_0x2c7faf[_0xed5f('0xd')]===_0xed5f('0xe')?https:http;var _0x36315f={'host':_0x2c7faf[_0xed5f('0x1b')],'path':_0x2c7faf['path'],'headers':{'user-agent':_0xed5f('0xf')}};_0x3b28d3[_0xed5f('0x1c')](_0x36315f,function(_0x5be35f){if(_0x5be35f[_0xed5f('0x10')]!==0xc8){_0x21dd16(new Error(_0xed5f('0x12')+_0x211272+_0xed5f('0x11')+_0x5be35f[_0xed5f('0x10')]+'\x20('+_0x5be35f[_0xed5f('0x1d')]+')'));return;}var _0x37977f='';_0x5be35f['on'](_0xed5f('0x1e'),function(_0x51b280){_0x37977f+=_0x51b280;});_0x5be35f['on'](_0xed5f('0x1a'),function(){_0x29facb(_0x37977f);});})['on'](_0xed5f('0x18'),function(_0x58de1a){_0x21dd16(_0x58de1a);})[_0xed5f('0x1a')]();});}function convertFile(_0x471d4e,_0x56594f){return new BPromise(function(_0x22172b,_0x4a45d9){var _0x3e0fb2=sox['transcode'](_0x471d4e,_0x56594f,{'sampleRate':0x1f40,'format':_0xed5f('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e0fb2['on'](_0xed5f('0x18'),function(_0x4dc7df){logger[_0xed5f('0x18')](_0xed5f('0x20'),_0x4dc7df);_0x4a45d9(_0x4dc7df);});_0x3e0fb2['on'](_0xed5f('0x1a'),function(){logger[_0xed5f('0x15')](_0xed5f('0x21'));_0x22172b();});_0x3e0fb2[_0xed5f('0x22')]();});}function base64Decode(_0x10d117,_0x316fcf){var _0x887ce8=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs[_0xed5f('0x25')](0x4)+_0xed5f('0x26'));fs['writeFileSync'](_0x887ce8,_0x10d117,_0xed5f('0x27'));return convertFile(_0x887ce8,_0x316fcf)[_0xed5f('0x28')](function(){try{fs['unlink'](_0x887ce8);fs[_0xed5f('0x29')](_0x316fcf,_0xed5f('0x2a'));}catch(_0x1b72a1){logger[_0xed5f('0x18')](_0x1b72a1);}return _0x316fcf[_0xed5f('0x2b')]('.')[0x0];});}function base64Encode(_0x4d0306){var _0x264cb3=fs[_0xed5f('0x2c')](_0x4d0306);return new Buffer(_0x264cb3)[_0xed5f('0x2d')](_0xed5f('0x27'));}exports[_0xed5f('0x2e')]=function(_0x19a029,_0x142ef4,_0x52aaa9,_0xb51e35,_0x8eeb12,_0x50753c){var _0x35ab17,_0x4ff2f8;var _0x29361d=_0xed5f('0x2f');var _0x3ca8fa=_0xed5f('0x30')+_0x19a029;var _0x548bb5={};if(_0x142ef4===_0xed5f('0x31')){_0x548bb5[_0xed5f('0x32')]={'ssml':_0x52aaa9};}else{_0x548bb5['input']={'text':_0x52aaa9};};_0x548bb5[_0xed5f('0x33')]={'languageCode':_0xb51e35,'ssmlGender':_0x8eeb12};_0x548bb5[_0xed5f('0x34')]={'audioEncoding':_0xed5f('0x35'),'sampleRateHertz':0x1f40};var _0x41c96d={'url':_0x29361d+'text:synthesize'+_0x3ca8fa,'method':_0xed5f('0x36'),'json':!![],'body':_0x548bb5};return rp(_0x41c96d)[_0xed5f('0x28')](function(_0x1bd9c7){return new BPromise(function(_0x4c2fda,_0x3f4ea8){_0x35ab17=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs[_0xed5f('0x25')](0x4)+_0xed5f('0x37'));var _0x2c63df=Buffer['from'](_0x1bd9c7[_0xed5f('0x38')],_0xed5f('0x27'));return fs[_0xed5f('0x39')](_0x35ab17,_0x2c63df,function(_0x51c16c){_0x3f4ea8(_0x51c16c);},function(_0x1f7e87){fs['chmodSync'](_0x35ab17,_0xed5f('0x2a'));_0x4c2fda(_0x1f7e87);});});})[_0xed5f('0x28')](function(_0x4dbdf2){_0x4ff2f8=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs['generate'](0x4)+_0xed5f('0x26'));return convertFile(_0x35ab17,_0x4ff2f8);})[_0xed5f('0x28')](function(){try{fs[_0xed5f('0x17')](_0x35ab17);fs[_0xed5f('0x29')](_0x4ff2f8,'777');}catch(_0x15750c){logger[_0xed5f('0x18')](_0x15750c);}logger['info']('googleCloudTTS\x20path',_0x4ff2f8[_0xed5f('0x2b')]('.')[0x0]);return _0x4ff2f8[_0xed5f('0x2b')]('.')[0x0];});};exports[_0xed5f('0x3a')]=function(_0x5a2cc6,_0x53856e){var _0x3a1f1b=_0xed5f('0x3b');var _0x1736a5,_0x140552;var _0x430741;var _0x22bfbf={'encoding':_0xed5f('0x3c'),'method':'POST','timeout':0x2710,'url':_0x3a1f1b,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0xed5f('0x3d')]([[[_0xed5f('0x3e'),JSON[_0xed5f('0x3d')]([_0x5a2cc6,_0x53856e||'en',![],_0xed5f('0x3f')]),null,_0xed5f('0x40')]]]))};return rp(_0x22bfbf)[_0xed5f('0x28')](function(_0x487f08){try{_0x430741=eval(_0x487f08[_0xed5f('0x41')](0x5))[0x0][0x2];}catch(_0x45ca0d){throw new Error(_0xed5f('0x42')+_0x487f08[_0xed5f('0x1e')]);}if(!_0x430741){if(_0x5a2cc6[_0xed5f('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x53856e+_0xed5f('0x44'));}}try{_0x430741=eval(_0x430741)[0x0];}catch(_0x497606){throw new Error(_0xed5f('0x42')+res[_0xed5f('0x1e')]);}const _0x1e5986=_0x430741;_0x1736a5=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs['generate'](0x4)+_0xed5f('0x37'));fs[_0xed5f('0x45')](_0x1736a5,_0x430741,{'encoding':_0xed5f('0x27')});_0x140552=path[_0xed5f('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0xed5f('0x26'));return convertFile(_0x1736a5,_0x140552);})[_0xed5f('0x28')](function(){try{fs[_0xed5f('0x17')](_0x1736a5);fs['chmodSync'](_0x140552,_0xed5f('0x2a'));}catch(_0x2bb36c){logger[_0xed5f('0x18')](_0x2bb36c);}logger[_0xed5f('0x15')](_0xed5f('0x46'),_0x140552['split']('.')[0x0]);return _0x140552['split']('.')[0x0];});};exports[_0xed5f('0x47')]=function(_0xf4ed1a,_0x3c8acc,_0x4e060b){return google[_0xed5f('0x48')](_0xf4ed1a,_0x3c8acc,_0x4e060b)[_0xed5f('0x28')](function(_0x162208){logger[_0xed5f('0x15')](_0x162208['uri']);return rp(_0x162208);})[_0xed5f('0x28')](function(_0x4e8751){var _0x93bd5f='';var _0x311315=0x0;try{fs['unlink'](_0xf4ed1a);}catch(_0x484ac8){logger[_0xed5f('0x18')](_0x484ac8);}if(_0x4e8751&&_0x4e8751[_0xed5f('0x49')]){_0x93bd5f=_0x4e8751[_0xed5f('0x49')][_0xed5f('0x4a')](function(_0x30a5b8){return _0x30a5b8&&_0x30a5b8[_0xed5f('0x4b')][0x0]&&_0x30a5b8[_0xed5f('0x4b')][0x0][_0xed5f('0x4c')]?_0x30a5b8['alternatives'][0x0][_0xed5f('0x4c')]:'';})['join']('\x0a');_0x311315=_0x4e8751[_0xed5f('0x49')][_0xed5f('0x4a')](function(_0x4e4ccd){return _0x4e4ccd&&_0x4e4ccd[_0xed5f('0x4b')][0x0]&&_0x4e4ccd[_0xed5f('0x4b')][0x0][_0xed5f('0x4d')]?_0x4e4ccd[_0xed5f('0x4b')][0x0][_0xed5f('0x4d')]:0x0;})[_0xed5f('0x4e')]('\x0a');}logger['info'](_0xed5f('0x4f'),_0x93bd5f);logger[_0xed5f('0x15')]('googleASR\x20confidence',_0x311315);return{'transcript':_0x93bd5f,'confidence':_0x311315};})[_0xed5f('0x50')](function(_0xa7f27){logger[_0xed5f('0x18')](_0xed5f('0x51'),_0xa7f27[_0xed5f('0x10')],_0xa7f27[_0xed5f('0x52')],_0xa7f27['message']);});};exports[_0xed5f('0x53')]=function(_0x11ac05,_0x3292fe,_0x277a91,_0x3ea78c){var _0x6ac2a1=apiai(_0x3292fe,{'language':_0x3ea78c||'en'});return _0x6ac2a1[_0xed5f('0x54')](_0x277a91,{'sessionId':md5(_0x11ac05)})[_0xed5f('0x28')](function(_0x500e02){logger['info'](JSON[_0xed5f('0x3d')](_0x500e02));return{'source':_0x500e02[_0xed5f('0x55')][_0xed5f('0x56')],'resolvedQuery':_0x500e02[_0xed5f('0x55')][_0xed5f('0x57')],'action':_0x500e02[_0xed5f('0x55')]['action'],'actionIncomplete':_0x500e02['result']['actionIncomplete'],'speech':_0x500e02[_0xed5f('0x55')][_0xed5f('0x58')]['speech'],'score':_0x500e02[_0xed5f('0x55')][_0xed5f('0x59')],'statusCode':_0x500e02[_0xed5f('0x5a')][_0xed5f('0x5b')],'endConversation':_0x500e02[_0xed5f('0x55')][_0xed5f('0x5c')][_0xed5f('0x5d')]||![],'isFallbackIntent':_0x500e02['result']['metadata'][_0xed5f('0x5e')]};});};exports['googleDialogflowV2']=function(_0x576438,_0x3c77f3,_0x556b84,_0x10048a,_0x45896f,_0x39c5ba){var _0x1e6508=_0x10048a[_0xed5f('0x5f')](/\\n/g,'\x0a');var _0x9d5f0f={'credentials':{'private_key':_0x1e6508,'client_email':_0x556b84}};var _0x49abbb=new dialogflow[(_0xed5f('0x60'))](_0x9d5f0f);var _0x151f61=_0x49abbb[_0xed5f('0x61')](_0x3c77f3,md5(_0x576438));var _0x183464={'session':_0x151f61,'queryInput':{'text':{'text':_0x45896f,'languageCode':_0x39c5ba}}};return _0x49abbb[_0xed5f('0x62')](_0x183464)[_0xed5f('0x28')](function(_0x4d2902){if(_0x4d2902&&_0x4d2902[_0xed5f('0x43')]){logger[_0xed5f('0x15')](_0xed5f('0x63'),JSON['stringify'](_0x4d2902));var _0x32776d=_0x4d2902[0x0];if(_0x32776d){var _0x2cb4ef={'action':_0x32776d[_0xed5f('0x64')]['action'],'allRequiredParamsPresent':_0x32776d[_0xed5f('0x64')][_0xed5f('0x65')],'endConversation':_0x32776d[_0xed5f('0x64')][_0xed5f('0x66')]&&_0x32776d['queryResult'][_0xed5f('0x66')][_0xed5f('0x67')]?_0x32776d[_0xed5f('0x64')][_0xed5f('0x66')]['fields']['end_conversation'][_0xed5f('0x68')]:![],'fulfillmentText':_0x32776d['queryResult'][_0xed5f('0x69')],'intentName':_0x32776d[_0xed5f('0x64')][_0xed5f('0x6a')][_0xed5f('0x52')],'intentDisplayName':_0x32776d[_0xed5f('0x64')][_0xed5f('0x6a')][_0xed5f('0x6b')],'isFallbackIntent':_0x32776d[_0xed5f('0x64')][_0xed5f('0x6a')][_0xed5f('0x6c')],'languageCode':_0x32776d['queryResult'][_0xed5f('0x6d')],'queryText':_0x32776d[_0xed5f('0x64')][_0xed5f('0x6e')],'responseId':_0x32776d[_0xed5f('0x6f')],'score':_0x32776d[_0xed5f('0x64')]['intentDetectionConfidence'],'speech':_0x32776d[_0xed5f('0x64')]['fulfillmentText'],'providerResponse':JSON[_0xed5f('0x3d')](_0x4d2902)};return _0x2cb4ef;}}});};exports[_0xed5f('0x70')]=function(_0x1e5a82,_0x105cfe,_0x3a9e7f,_0x3bc380){return tilde['asr'](_0x1e5a82,_0x105cfe,_0x3a9e7f,_0x3bc380)[_0xed5f('0x28')](function(_0x32ef4b){try{fs['unlink'](_0x1e5a82);}catch(_0x230187){logger[_0xed5f('0x18')](_0x230187);}logger[_0xed5f('0x15')](_0xed5f('0x71'),_0x32ef4b[_0xed5f('0x4c')]);logger[_0xed5f('0x15')]('Tilde\x20ASR\x20confidence',_0x32ef4b[_0xed5f('0x4d')]);return _0x32ef4b;});};exports[_0xed5f('0x72')]=function(_0x2d94a6,_0x2fa8ff,_0x51c4e4,_0x19aaae,_0x394e94,_0x301854){var _0x302fc7=path['resolve'](__dirname,_0xed5f('0x24'),rs[_0xed5f('0x25')](0x4)+_0xed5f('0x37'));var _0x792f79;return aws[_0xed5f('0x73')](_0x2d94a6,_0x2fa8ff,_0x51c4e4,_0x19aaae,_0x394e94,_0x301854,_0x302fc7)['then'](function(){_0x792f79=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs[_0xed5f('0x25')](0x4)+_0xed5f('0x26'));return convertFile(_0x302fc7,_0x792f79);})['then'](function(){try{fs[_0xed5f('0x17')](_0x302fc7);fs[_0xed5f('0x29')](_0x792f79,_0xed5f('0x2a'));}catch(_0x3bc776){logger[_0xed5f('0x18')](_0x3bc776);}return _0x792f79[_0xed5f('0x2b')]('.')[0x0];});};exports[_0xed5f('0x74')]=function(_0x403619,_0x4ccf94,_0x196407,_0x96d03d,_0x21e7b4,_0x5cd5f4){return aws['lex'](_0x403619,_0x4ccf94,_0x196407,_0x96d03d,_0x21e7b4,_0x5cd5f4)[_0xed5f('0x28')](function(_0x38de5b){logger[_0xed5f('0x15')](JSON[_0xed5f('0x3d')](_0x38de5b));return _0x38de5b;});};exports[_0xed5f('0x75')]=function(_0x38e238,_0x3bae75,_0x59972e,_0x3d835c){var _0x2b516c=util['format'](_0xed5f('0x76'),ISPEECH_API,_0x38e238,encodeURIComponent(_0x3bae75),_0x59972e,_0x3d835c);var _0x1a1c81=path['resolve'](__dirname,'tmp',rs[_0xed5f('0x25')](0x4)+_0xed5f('0x37'));var _0x9d8416;return downloadFile(_0x2b516c,_0x1a1c81)[_0xed5f('0x28')](function(){_0x9d8416=path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs['generate'](0x4)+'.wav');return convertFile(_0x1a1c81,_0x9d8416);})[_0xed5f('0x28')](function(){try{fs[_0xed5f('0x17')](_0x1a1c81);fs[_0xed5f('0x29')](_0x9d8416,_0xed5f('0x2a'));}catch(_0x39e286){logger[_0xed5f('0x18')](_0x39e286);}return _0x9d8416[_0xed5f('0x2b')]('.')[0x0];});};exports[_0xed5f('0x77')]=function(_0x2369f1,_0x530217,_0x5d6ea6,_0x414b61){var _0x43c386=util[_0xed5f('0x78')](_0xed5f('0x79'),ISPEECH_API,_0x530217,_0x5d6ea6,base64Encode(_0x2369f1),_0x414b61?util[_0xed5f('0x78')](_0xed5f('0x7a'),encodeURIComponent(_0x414b61)):_0xed5f('0x7b'));return uploadFile(_0x43c386)[_0xed5f('0x28')](function(_0x15eba2){return querystring[_0xed5f('0x7c')](_0x15eba2);});};exports['sestekNDA']=function(_0x4068f0,_0x1cbe63){return sestek[_0xed5f('0x7d')](_0x4068f0,_0x1cbe63)[_0xed5f('0x28')](function(_0x3e77e9){logger[_0xed5f('0x15')](JSON[_0xed5f('0x3d')](_0x3e77e9));var _0x54d249={'speech':_0x3e77e9[_0xed5f('0x7e')],'action':_0x3e77e9['channelData']?_0x3e77e9[_0xed5f('0x7f')][_0xed5f('0x80')]:undefined,'actiondata':_0x3e77e9[_0xed5f('0x7f')]?_0x3e77e9['channelData'][_0xed5f('0x81')]:undefined};if(_0x3e77e9[_0xed5f('0x7f')]&&_0x3e77e9['channelData'][_0xed5f('0x82')]){return base64Decode(_0x3e77e9[_0xed5f('0x7f')][_0xed5f('0x82')]['Data'],path[_0xed5f('0x23')](__dirname,_0xed5f('0x24'),rs[_0xed5f('0x25')](0x4)+_0xed5f('0x26')))[_0xed5f('0x28')](function(_0x3cf87a){_0x54d249['audiofile']=_0x3cf87a;return _0x54d249;});}return _0x54d249;});};exports[_0xed5f('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xdcb5=['chmodSync','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','resolve','tmp','.mp3','from','audioContent','.wav','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','path','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','finish','finish\x20download\x20file','unlink','pipe','end','https:','WHAT_EVER','data','wav','info','finish\x20to\x20convert','generate','writeFileSync','base64','then'];(function(_0xcc577d,_0x34c2b0){var _0x56366c=function(_0x1ec692){while(--_0x1ec692){_0xcc577d['push'](_0xcc577d['shift']());}};_0x56366c(++_0x34c2b0);}(_0xdcb5,0x1ea));var _0x5dcb=function(_0x1e48d0,_0x20f45a){_0x1e48d0=_0x1e48d0-0x0;var _0x35f8fa=_0xdcb5[_0x1e48d0];return _0x35f8fa;};'use strict';var apiai=require(_0x5dcb('0x0'));var BPromise=require(_0x5dcb('0x1'));var dialogflow=require(_0x5dcb('0x2'));var fs=require('fs');var http=require(_0x5dcb('0x3'));var https=require(_0x5dcb('0x4'));var md5=require(_0x5dcb('0x5'));var path=require('path');var querystring=require(_0x5dcb('0x6'));var rp=require(_0x5dcb('0x7'));var rs=require(_0x5dcb('0x8'));var sox=require(_0x5dcb('0x9'));var tts=require(_0x5dcb('0xa'));var urlParse=require(_0x5dcb('0xb'))[_0x5dcb('0xc')];var util=require(_0x5dcb('0xd'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x5dcb('0xe'));var tilde=require(_0x5dcb('0xf'));var logger=require('../../../config/logger')(_0x5dcb('0x10'));var ISPEECH_API=_0x5dcb('0x11');function downloadFile(_0xd70a2d,_0x271fd5){return new BPromise(function(_0x34f42d,_0x556a4f){var _0x580817=urlParse(_0xd70a2d);var _0xc6fd2=_0x580817[_0x5dcb('0x12')]==='https:'?https:http;var _0x5373f8={'host':_0x580817[_0x5dcb('0x13')],'path':_0x580817[_0x5dcb('0x14')],'headers':{'user-agent':'WHAT_EVER'}};_0xc6fd2[_0x5dcb('0x15')](_0x5373f8,function(_0x535ba1){if(_0x535ba1['statusCode']!==0xc8){logger[_0x5dcb('0x16')](_0x5dcb('0x17')+_0xd70a2d+_0x5dcb('0x18')+_0x535ba1['statusCode']+'\x20('+_0x535ba1[_0x5dcb('0x19')]+')');_0x556a4f(new Error(_0x5dcb('0x17')+_0xd70a2d+_0x5dcb('0x18')+_0x535ba1[_0x5dcb('0x1a')]+'\x20('+_0x535ba1['statusMessage']+')'));return;}var _0x140d98=fs['createWriteStream'](_0x271fd5);_0x140d98['on'](_0x5dcb('0x1b'),function(){logger['info'](_0x5dcb('0x1c'));_0x140d98['close'](_0x34f42d);});_0x140d98['on']('error',function(_0x38d1d6){fs[_0x5dcb('0x1d')](_0x271fd5);logger[_0x5dcb('0x16')]('download\x20error',_0x38d1d6);_0x556a4f(_0x38d1d6);});_0x535ba1[_0x5dcb('0x1e')](_0x140d98);})['on']('error',function(_0x2dc735){logger[_0x5dcb('0x16')](_0x2dc735);_0x556a4f(_0x2dc735);})[_0x5dcb('0x1f')]();});}function uploadFile(_0x1a0c8d){return new BPromise(function(_0x2e00a5,_0x1f65fd){var _0x36753d=urlParse(_0x1a0c8d);var _0x167e77=_0x36753d[_0x5dcb('0x12')]===_0x5dcb('0x20')?https:http;var _0x499ee6={'host':_0x36753d[_0x5dcb('0x13')],'path':_0x36753d['path'],'headers':{'user-agent':_0x5dcb('0x21')}};_0x167e77['get'](_0x499ee6,function(_0x29f5cc){if(_0x29f5cc[_0x5dcb('0x1a')]!==0xc8){_0x1f65fd(new Error('request\x20to\x20'+_0x1a0c8d+_0x5dcb('0x18')+_0x29f5cc['statusCode']+'\x20('+_0x29f5cc[_0x5dcb('0x19')]+')'));return;}var _0x183b5d='';_0x29f5cc['on'](_0x5dcb('0x22'),function(_0xf4422a){_0x183b5d+=_0xf4422a;});_0x29f5cc['on'](_0x5dcb('0x1f'),function(){_0x2e00a5(_0x183b5d);});})['on']('error',function(_0x77c7e5){_0x1f65fd(_0x77c7e5);})['end']();});}function convertFile(_0x340c5b,_0x3c84bc){return new BPromise(function(_0x456a6b,_0x15459d){var _0x3c18e9=sox['transcode'](_0x340c5b,_0x3c84bc,{'sampleRate':0x1f40,'format':_0x5dcb('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c18e9['on'](_0x5dcb('0x16'),function(_0x116de3){logger[_0x5dcb('0x16')]('error\x20convert',_0x116de3);_0x15459d(_0x116de3);});_0x3c18e9['on']('end',function(){logger[_0x5dcb('0x24')](_0x5dcb('0x25'));_0x456a6b();});_0x3c18e9['start']();});}function base64Decode(_0x4fcc9c,_0x11e118){var _0x1c696e=path['resolve'](__dirname,'tmp',rs[_0x5dcb('0x26')](0x4)+'.wav');fs[_0x5dcb('0x27')](_0x1c696e,_0x4fcc9c,_0x5dcb('0x28'));return convertFile(_0x1c696e,_0x11e118)[_0x5dcb('0x29')](function(){try{fs[_0x5dcb('0x1d')](_0x1c696e);fs[_0x5dcb('0x2a')](_0x11e118,_0x5dcb('0x2b'));}catch(_0x3ab4a5){logger[_0x5dcb('0x16')](_0x3ab4a5);}return _0x11e118['split']('.')[0x0];});}function base64Encode(_0x1ac03c){var _0x3d560d=fs[_0x5dcb('0x2c')](_0x1ac03c);return new Buffer(_0x3d560d)[_0x5dcb('0x2d')]('base64');}exports['googleCloudTTS']=function(_0x399bee,_0x467274,_0x30573c,_0x4fa0ce,_0x3c1764,_0x1a5d7c){var _0x40e9d9,_0x1adc83;var _0x1f6805=_0x5dcb('0x2e');var _0x1223c0=_0x5dcb('0x2f')+_0x399bee;var _0x24763c={};if(_0x467274===_0x5dcb('0x30')){_0x24763c[_0x5dcb('0x31')]={'ssml':_0x30573c};}else{_0x24763c[_0x5dcb('0x31')]={'text':_0x30573c};};_0x24763c[_0x5dcb('0x32')]={'languageCode':_0x4fa0ce,'ssmlGender':_0x3c1764};_0x24763c[_0x5dcb('0x33')]={'audioEncoding':_0x5dcb('0x34'),'sampleRateHertz':0x1f40};var _0x4fd7e4={'url':_0x1f6805+_0x5dcb('0x35')+_0x1223c0,'method':'POST','json':!![],'body':_0x24763c};return rp(_0x4fd7e4)[_0x5dcb('0x29')](function(_0xd4fc3d){return new BPromise(function(_0x32448c,_0x303906){_0x40e9d9=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x38'));var _0x512ecf=Buffer[_0x5dcb('0x39')](_0xd4fc3d[_0x5dcb('0x3a')],_0x5dcb('0x28'));return fs['writeFile'](_0x40e9d9,_0x512ecf,function(_0x2250fe){_0x303906(_0x2250fe);},function(_0x56c708){fs[_0x5dcb('0x2a')](_0x40e9d9,_0x5dcb('0x2b'));_0x32448c(_0x56c708);});});})[_0x5dcb('0x29')](function(_0x284fce){_0x1adc83=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x3b'));return convertFile(_0x40e9d9,_0x1adc83);})[_0x5dcb('0x29')](function(){try{fs[_0x5dcb('0x1d')](_0x40e9d9);fs[_0x5dcb('0x2a')](_0x1adc83,_0x5dcb('0x2b'));}catch(_0x49892e){logger['error'](_0x49892e);}logger['info'](_0x5dcb('0x3c'),_0x1adc83['split']('.')[0x0]);return _0x1adc83[_0x5dcb('0x3d')]('.')[0x0];});};exports['googleTTS']=function(_0x2850eb,_0x3079cc){var _0x2516b1=_0x5dcb('0x3e');var _0x1e6637,_0x2fd8ca;var _0x803765;var _0x3ac793={'encoding':_0x5dcb('0x3f'),'method':'POST','timeout':0x2710,'url':_0x2516b1,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x5dcb('0x40')]([[['jQ1olc',JSON[_0x5dcb('0x40')]([_0x2850eb,_0x3079cc||'en',![],_0x5dcb('0x41')]),null,_0x5dcb('0x42')]]]))};return rp(_0x3ac793)[_0x5dcb('0x29')](function(_0x2cd3e0){try{_0x803765=eval(_0x2cd3e0[_0x5dcb('0x43')](0x5))[0x0][0x2];}catch(_0x3f0329){throw new Error(_0x5dcb('0x44')+_0x2cd3e0[_0x5dcb('0x22')]);}if(!_0x803765){if(_0x2850eb[_0x5dcb('0x45')]>0xc8){throw new Error(_0x5dcb('0x46'));}else{throw new Error(_0x5dcb('0x47')+_0x3079cc+'\x22\x20might\x20not\x20exist');}}try{_0x803765=eval(_0x803765)[0x0];}catch(_0x404957){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x5dcb('0x22')]);}const _0x457acd=_0x803765;_0x1e6637=path['resolve'](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x38'));fs[_0x5dcb('0x27')](_0x1e6637,_0x803765,{'encoding':'base64'});_0x2fd8ca=path[_0x5dcb('0x36')](__dirname,'tmp',rs[_0x5dcb('0x26')](0x4)+'.wav');return convertFile(_0x1e6637,_0x2fd8ca);})['then'](function(){try{fs['unlink'](_0x1e6637);fs[_0x5dcb('0x2a')](_0x2fd8ca,_0x5dcb('0x2b'));}catch(_0x271b98){logger[_0x5dcb('0x16')](_0x271b98);}logger[_0x5dcb('0x24')](_0x5dcb('0x48'),_0x2fd8ca[_0x5dcb('0x3d')]('.')[0x0]);return _0x2fd8ca['split']('.')[0x0];});};exports[_0x5dcb('0x49')]=function(_0x3adbea,_0x3e5ca0,_0x5abec9){return google[_0x5dcb('0x4a')](_0x3adbea,_0x3e5ca0,_0x5abec9)[_0x5dcb('0x29')](function(_0x3993e9){logger[_0x5dcb('0x24')](_0x3993e9[_0x5dcb('0x4b')]);return rp(_0x3993e9);})['then'](function(_0x12590e){var _0x364d80='';var _0x5ee021=0x0;try{fs[_0x5dcb('0x1d')](_0x3adbea);}catch(_0x5c4ae7){logger['error'](_0x5c4ae7);}if(_0x12590e&&_0x12590e[_0x5dcb('0x4c')]){_0x364d80=_0x12590e['results'][_0x5dcb('0x4d')](function(_0x56c719){return _0x56c719&&_0x56c719[_0x5dcb('0x4e')][0x0]&&_0x56c719[_0x5dcb('0x4e')][0x0][_0x5dcb('0x4f')]?_0x56c719['alternatives'][0x0][_0x5dcb('0x4f')]:'';})[_0x5dcb('0x50')]('\x0a');_0x5ee021=_0x12590e[_0x5dcb('0x4c')][_0x5dcb('0x4d')](function(_0x282284){return _0x282284&&_0x282284['alternatives'][0x0]&&_0x282284[_0x5dcb('0x4e')][0x0][_0x5dcb('0x51')]?_0x282284['alternatives'][0x0][_0x5dcb('0x51')]:0x0;})['join']('\x0a');}logger[_0x5dcb('0x24')](_0x5dcb('0x52'),_0x364d80);logger['info']('googleASR\x20confidence',_0x5ee021);return{'transcript':_0x364d80,'confidence':_0x5ee021};})['catch'](function(_0x50cc77){logger[_0x5dcb('0x16')](_0x5dcb('0x53'),_0x50cc77['statusCode'],_0x50cc77[_0x5dcb('0x54')],_0x50cc77[_0x5dcb('0x55')]);});};exports[_0x5dcb('0x56')]=function(_0x55eb30,_0x3f42f5,_0x1c4dc2,_0x21ac1f){var _0x346461=apiai(_0x3f42f5,{'language':_0x21ac1f||'en'});return _0x346461[_0x5dcb('0x57')](_0x1c4dc2,{'sessionId':md5(_0x55eb30)})[_0x5dcb('0x29')](function(_0x30ffe8){logger['info'](JSON['stringify'](_0x30ffe8));return{'source':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x59')],'resolvedQuery':_0x30ffe8['result']['resolvedQuery'],'action':_0x30ffe8['result'][_0x5dcb('0x5a')],'actionIncomplete':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x5b')],'speech':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x5c')][_0x5dcb('0x5d')],'score':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x5e')],'statusCode':_0x30ffe8['status'][_0x5dcb('0x5f')],'endConversation':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x60')][_0x5dcb('0x61')]||![],'isFallbackIntent':_0x30ffe8[_0x5dcb('0x58')][_0x5dcb('0x60')][_0x5dcb('0x62')]};});};exports[_0x5dcb('0x63')]=function(_0xe5f9aa,_0x1c1317,_0x2046eb,_0x928f58,_0x335f55,_0xd3205f){var _0x4074b3=_0x928f58[_0x5dcb('0x64')](/\\n/g,'\x0a');var _0x33570a={'credentials':{'private_key':_0x4074b3,'client_email':_0x2046eb}};var _0x38450e=new dialogflow[(_0x5dcb('0x65'))](_0x33570a);var _0xdb8978=_0x38450e[_0x5dcb('0x66')](_0x1c1317,md5(_0xe5f9aa));var _0xe4daca={'session':_0xdb8978,'queryInput':{'text':{'text':_0x335f55,'languageCode':_0xd3205f}}};return _0x38450e['detectIntent'](_0xe4daca)[_0x5dcb('0x29')](function(_0x5e1fe0){if(_0x5e1fe0&&_0x5e1fe0['length']){logger[_0x5dcb('0x24')](_0x5dcb('0x67'),JSON[_0x5dcb('0x40')](_0x5e1fe0));var _0x45156c=_0x5e1fe0[0x0];if(_0x45156c){var _0x363590={'action':_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x5a')],'allRequiredParamsPresent':_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x69')],'endConversation':_0x45156c['queryResult'][_0x5dcb('0x6a')]&&_0x45156c[_0x5dcb('0x68')]['diagnosticInfo'][_0x5dcb('0x6b')]?_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x6a')][_0x5dcb('0x6b')][_0x5dcb('0x6c')]['boolValue']:![],'fulfillmentText':_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x6d')],'intentName':_0x45156c['queryResult'][_0x5dcb('0x6e')][_0x5dcb('0x54')],'intentDisplayName':_0x45156c[_0x5dcb('0x68')]['intent'][_0x5dcb('0x6f')],'isFallbackIntent':_0x45156c[_0x5dcb('0x68')]['intent']['isFallback'],'languageCode':_0x45156c[_0x5dcb('0x68')]['languageCode'],'queryText':_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x70')],'responseId':_0x45156c[_0x5dcb('0x71')],'score':_0x45156c[_0x5dcb('0x68')]['intentDetectionConfidence'],'speech':_0x45156c[_0x5dcb('0x68')][_0x5dcb('0x6d')],'providerResponse':JSON[_0x5dcb('0x40')](_0x5e1fe0)};return _0x363590;}}});};exports[_0x5dcb('0x72')]=function(_0x141b4a,_0x4a93da,_0x2b11db,_0x1c87c5){return tilde['asr'](_0x141b4a,_0x4a93da,_0x2b11db,_0x1c87c5)[_0x5dcb('0x29')](function(_0xc25b47){try{fs[_0x5dcb('0x1d')](_0x141b4a);}catch(_0x27b9c0){logger[_0x5dcb('0x16')](_0x27b9c0);}logger[_0x5dcb('0x24')](_0x5dcb('0x73'),_0xc25b47['transcript']);logger[_0x5dcb('0x24')](_0x5dcb('0x74'),_0xc25b47['confidence']);return _0xc25b47;});};exports[_0x5dcb('0x75')]=function(_0x593d6a,_0xba126a,_0x6cc83a,_0x523241,_0x438921,_0x3a1d19){var _0x2c3a89=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs['generate'](0x4)+_0x5dcb('0x38'));var _0x42c330;return aws[_0x5dcb('0x76')](_0x593d6a,_0xba126a,_0x6cc83a,_0x523241,_0x438921,_0x3a1d19,_0x2c3a89)[_0x5dcb('0x29')](function(){_0x42c330=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x3b'));return convertFile(_0x2c3a89,_0x42c330);})['then'](function(){try{fs[_0x5dcb('0x1d')](_0x2c3a89);fs['chmodSync'](_0x42c330,_0x5dcb('0x2b'));}catch(_0x513c25){logger['error'](_0x513c25);}return _0x42c330[_0x5dcb('0x3d')]('.')[0x0];});};exports[_0x5dcb('0x77')]=function(_0x3b2059,_0x510b80,_0x225867,_0xfe2c92,_0x3f7251,_0x363737){return aws[_0x5dcb('0x78')](_0x3b2059,_0x510b80,_0x225867,_0xfe2c92,_0x3f7251,_0x363737)[_0x5dcb('0x29')](function(_0x14342a){logger[_0x5dcb('0x24')](JSON['stringify'](_0x14342a));return _0x14342a;});};exports['ispeechTTS']=function(_0x548bea,_0x2effdc,_0x41597c,_0x11dca3){var _0x3909ac=util[_0x5dcb('0x79')](_0x5dcb('0x7a'),ISPEECH_API,_0x548bea,encodeURIComponent(_0x2effdc),_0x41597c,_0x11dca3);var _0xe90d3b=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x38'));var _0x3dab4c;return downloadFile(_0x3909ac,_0xe90d3b)['then'](function(){_0x3dab4c=path[_0x5dcb('0x36')](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+_0x5dcb('0x3b'));return convertFile(_0xe90d3b,_0x3dab4c);})['then'](function(){try{fs[_0x5dcb('0x1d')](_0xe90d3b);fs[_0x5dcb('0x2a')](_0x3dab4c,_0x5dcb('0x2b'));}catch(_0x838f1d){logger[_0x5dcb('0x16')](_0x838f1d);}return _0x3dab4c['split']('.')[0x0];});};exports[_0x5dcb('0x7b')]=function(_0x37d442,_0x4b0087,_0x3141f1,_0x2e132c){var _0x33ae42=util[_0x5dcb('0x79')](_0x5dcb('0x7c'),ISPEECH_API,_0x4b0087,_0x3141f1,base64Encode(_0x37d442),_0x2e132c?util['format'](_0x5dcb('0x7d'),encodeURIComponent(_0x2e132c)):_0x5dcb('0x7e'));return uploadFile(_0x33ae42)[_0x5dcb('0x29')](function(_0x33706d){return querystring['parse'](_0x33706d);});};exports[_0x5dcb('0x7f')]=function(_0x2ca853,_0x5e72bd){return sestek[_0x5dcb('0x80')](_0x2ca853,_0x5e72bd)[_0x5dcb('0x29')](function(_0x5594b8){logger['info'](JSON['stringify'](_0x5594b8));var _0x42fd6f={'speech':_0x5594b8['text'],'action':_0x5594b8[_0x5dcb('0x81')]?_0x5594b8[_0x5dcb('0x81')][_0x5dcb('0x82')]:undefined,'actiondata':_0x5594b8[_0x5dcb('0x81')]?_0x5594b8[_0x5dcb('0x81')]['CustomActionData']:undefined};if(_0x5594b8[_0x5dcb('0x81')]&&_0x5594b8[_0x5dcb('0x81')]['AudioFromTts']){return base64Decode(_0x5594b8[_0x5dcb('0x81')]['AudioFromTts'][_0x5dcb('0x83')],path['resolve'](__dirname,_0x5dcb('0x37'),rs[_0x5dcb('0x26')](0x4)+'.wav'))[_0x5dcb('0x29')](function(_0x23c9e4){_0x42fd6f[_0x5dcb('0x84')]=_0x23c9e4;return _0x42fd6f;});}return _0x42fd6f;});};exports['dirName']=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 6aeca3a..df474ea 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 _0xf6ae=['exports','./nda'];(function(_0x5d9b95,_0x93d114){var _0x4ef16d=function(_0x4b530c){while(--_0x4b530c){_0x5d9b95['push'](_0x5d9b95['shift']());}};_0x4ef16d(++_0x93d114);}(_0xf6ae,0x18d));var _0xef6a=function(_0x41e77e,_0x46e45e){_0x41e77e=_0x41e77e-0x0;var _0x5669ba=_0xf6ae[_0x41e77e];return _0x5669ba;};var nda=require(_0xef6a('0x0'));module[_0xef6a('0x1')]={'nda':nda}; \ No newline at end of file +var _0x0c24=['./nda'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x0c24,0x1a2));var _0x40c2=function(_0x4cee82,_0x208e67){_0x4cee82=_0x4cee82-0x0;var _0x200c1d=_0x0c24[_0x4cee82];return _0x200c1d;};var nda=require(_0x40c2('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 3d4afa8..76f1aef 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 _0xb945=['Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','audio/wav','custom_action','custom_action_data','CustomActionData','stringify','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension'];(function(_0x33cd49,_0x42577b){var _0x54f87d=function(_0xb166e5){while(--_0xb166e5){_0x33cd49['push'](_0x33cd49['shift']());}};_0x54f87d(++_0x42577b);}(_0xb945,0x97));var _0x5b94=function(_0x43d025,_0x14c205){_0x43d025=_0x43d025-0x0;var _0x165dd7=_0xb945[_0x43d025];return _0x165dd7;};'use strict';var rp=require(_0x5b94('0x0'));var url=require('url');var logger=require(_0x5b94('0x1'))('agi');module[_0x5b94('0x2')]=function(_0x4cc83f,_0x488e8d){var _0x43c9d3={'method':_0x5b94('0x3'),'uri':url[_0x5b94('0x4')](_0x488e8d[_0x5b94('0x5')],_0x5b94('0x6')),'form':{'grant_type':'password','username':_0x488e8d['username'],'password':_0x488e8d[_0x5b94('0x7')]},'json':!![]};return rp(_0x43c9d3)[_0x5b94('0x8')](function(_0x42bd69){var _0x186d22={'method':'POST','uri':url[_0x5b94('0x4')](_0x488e8d['ndassistant_url'],_0x5b94('0x9')),'body':{'type':_0x488e8d[_0x5b94('0xa')]||_0x5b94('0xb'),'channelId':_0x5b94('0xc'),'conversation':{'id':_0x4cc83f[_0x5b94('0xd')]},'from':{'id':_0x4cc83f[_0x5b94('0xe')],'name':_0x4cc83f[_0x5b94('0xf')]},'recipient':{'id':_0x4cc83f['dnid'],'name':_0x4cc83f[_0x5b94('0x10')]},'text':_0x488e8d['text'],'channelData':{}},'headers':{'Authorization':_0x5b94('0x11')+_0x42bd69[_0x5b94('0x12')]},'json':!![]};if(_0x488e8d[_0x5b94('0x13')]){_0x186d22[_0x5b94('0x14')][_0x5b94('0x15')]['ProjectName']=_0x488e8d[_0x5b94('0x13')];}if(_0x488e8d[_0x5b94('0x16')]=='1'){_0x186d22[_0x5b94('0x14')][_0x5b94('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5b94('0x17')};}if(_0x488e8d['custom_action']){_0x186d22[_0x5b94('0x14')][_0x5b94('0x15')]['CustomAction']=_0x488e8d[_0x5b94('0x18')];if(_0x488e8d[_0x5b94('0x19')]){_0x186d22[_0x5b94('0x14')]['channelData'][_0x5b94('0x1a')]=_0x488e8d[_0x5b94('0x19')];}}logger['info'](JSON[_0x5b94('0x1b')](_0x186d22));return rp(_0x186d22);});}; \ No newline at end of file +var _0x630e=['Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','text'];(function(_0x364a36,_0x1e2677){var _0x5cd6fa=function(_0x58d692){while(--_0x58d692){_0x364a36['push'](_0x364a36['shift']());}};_0x5cd6fa(++_0x1e2677);}(_0x630e,0x1af));var _0xe630=function(_0x1f48b0,_0x1ed1f2){_0x1f48b0=_0x1f48b0-0x0;var _0x4bf08a=_0x630e[_0x1f48b0];return _0x4bf08a;};'use strict';var rp=require(_0xe630('0x0'));var url=require('url');var logger=require(_0xe630('0x1'))('agi');module['exports']=function(_0x36902e,_0x143cb6){var _0x12449c={'method':'POST','uri':url[_0xe630('0x2')](_0x143cb6[_0xe630('0x3')],_0xe630('0x4')),'form':{'grant_type':_0xe630('0x5'),'username':_0x143cb6[_0xe630('0x6')],'password':_0x143cb6['password']},'json':!![]};return rp(_0x12449c)[_0xe630('0x7')](function(_0x34bad4){var _0x5a73ad={'method':_0xe630('0x8'),'uri':url['resolve'](_0x143cb6[_0xe630('0x9')],_0xe630('0xa')),'body':{'type':_0x143cb6[_0xe630('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x36902e[_0xe630('0xc')]},'from':{'id':_0x36902e[_0xe630('0xd')],'name':_0x36902e[_0xe630('0xe')]},'recipient':{'id':_0x36902e[_0xe630('0xf')],'name':_0x36902e['extension']},'text':_0x143cb6[_0xe630('0x10')],'channelData':{}},'headers':{'Authorization':_0xe630('0x11')+_0x34bad4[_0xe630('0x12')]},'json':!![]};if(_0x143cb6[_0xe630('0x13')]){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x16')]=_0x143cb6[_0xe630('0x13')];}if(_0x143cb6[_0xe630('0x17')]=='1'){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe630('0x19')};}if(_0x143cb6['custom_action']){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x1a')]=_0x143cb6[_0xe630('0x1b')];if(_0x143cb6[_0xe630('0x1c')]){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x1d')]=_0x143cb6[_0xe630('0x1c')];}}logger[_0xe630('0x1e')](JSON[_0xe630('0x1f')](_0x5a73ad));return rp(_0x5a73ad);});}; \ 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 ee2ccbe..fa129c8 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 _0x7e69=['exports','./lib/api'];(function(_0x257896,_0x8de612){var _0x1ff242=function(_0x8ea06a){while(--_0x8ea06a){_0x257896['push'](_0x257896['shift']());}};_0x1ff242(++_0x8de612);}(_0x7e69,0xff));var _0x97e6=function(_0x58a4ac,_0x26f3e7){_0x58a4ac=_0x58a4ac-0x0;var _0x435e2d=_0x7e69[_0x58a4ac];return _0x435e2d;};'use strict';var asr=require(_0x97e6('0x0'));module[_0x97e6('0x1')]=function(_0x40f27e,_0x505cf5,_0xc67069,_0x391248){return asr(_0x40f27e,_0x505cf5,_0xc67069,_0x391248);}; \ No newline at end of file +var _0xd476=['exports','./lib/api'];(function(_0x35c9dd,_0x3ecd16){var _0x2d3259=function(_0x5e6a85){while(--_0x5e6a85){_0x35c9dd['push'](_0x35c9dd['shift']());}};_0x2d3259(++_0x3ecd16);}(_0xd476,0x181));var _0x6d47=function(_0x191f98,_0x17361b){_0x191f98=_0x191f98-0x0;var _0x980d3c=_0xd476[_0x191f98];return _0x980d3c;};'use strict';var asr=require(_0x6d47('0x0'));module[_0x6d47('0x1')]=function(_0x3f15c6,_0x4ef336,_0x52a999,_0x362c8a){return asr(_0x3f15c6,_0x4ef336,_0x52a999,_0x362c8a);}; \ 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 f71ab73..5641b02 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 _0xa290=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa290,0x76));var _0x0a29=function(_0x1cbada,_0x4c145c){_0x1cbada=_0x1cbada-0x0;var _0x55cfbd=_0xa290[_0x1cbada];return _0x55cfbd;};'use strict';var BPromise=require(_0x0a29('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x0a29('0x1'))(_0x0a29('0x2'));module[_0x0a29('0x3')]=function(_0x4e2b53,_0x46bc52,_0x392f5e,_0x4046ac){return new BPromise(function(_0x2e7feb,_0xcbc783){logger[_0x0a29('0x4')](_0x0a29('0x5'),_0x4046ac||_0x0a29('0x6'));var _0x3c8f3d=new WebSocket(_0x4046ac||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x159c71='';var _0x1b6db7='0';var _0x58f4a4='1';var _0x3a9ec8=_0x0a29('0x7');function _0x3eda24(_0x2e9209){var _0x321c0b=crypto[_0x0a29('0x8')](_0x0a29('0x9'));_0x321c0b['update'](_0x2e9209);return _0x321c0b['digest'](_0x0a29('0xa'));}function _0x930298(){try{logger['info'](_0x0a29('0xb'));var _0x32635d=moment()[_0x0a29('0xc')]();var _0xd91ed8=_0x3eda24(_0x32635d+_0x46bc52+_0x392f5e);_0x3c8f3d[_0x0a29('0xd')](JSON[_0x0a29('0xe')]({'appID':_0x46bc52,'timestamp':_0x32635d,'appKey':_0xd91ed8}));var _0x38022b=fs['createReadStream'](_0x4e2b53);_0x38022b['on'](_0x0a29('0xf'),function(_0x17f005){_0x3c8f3d[_0x0a29('0xd')](_0x17f005);});_0x38022b['on'](_0x0a29('0x10'),function(){_0x3c8f3d[_0x0a29('0xd')](_0x0a29('0x11'));});}catch(_0x105247){logger[_0x0a29('0x12')](_0x0a29('0x13'),JSON['stringify'](_0x105247));_0x3c8f3d['terminate']();}}function _0x187df7(_0x424ab5){try{if(_0x424ab5){var _0xf5403a=JSON[_0x0a29('0x14')](_0x424ab5);switch(_0xf5403a[_0x0a29('0x15')]){case 0x0:if(_0xf5403a['result']){if(_0xf5403a['result'][_0x0a29('0x16')]){logger[_0x0a29('0x4')](_0x0a29('0x17'),JSON[_0x0a29('0xe')](_0xf5403a[_0x0a29('0x18')][_0x0a29('0x19')]));_0x159c71=_0xf5403a['result'][_0x0a29('0x19')][0x0][_0x0a29('0x1a')];_0x1b6db7=_0xf5403a[_0x0a29('0x18')][_0x0a29('0x19')][0x0][_0x0a29('0x1b')];_0x58f4a4='0';_0x3a9ec8=_0x0a29('0x1c');_0x3c8f3d['terminate']();}}break;case 0x1:logger[_0x0a29('0x4')](_0x0a29('0x7'));_0x58f4a4='1';_0x3a9ec8=_0x0a29('0x7');break;case 0x2:logger[_0x0a29('0x4')](_0x0a29('0x1d'));_0x58f4a4='2';_0x3a9ec8=_0x0a29('0x1d');break;case 0x9:logger[_0x0a29('0x4')](_0x0a29('0x1e'));_0x58f4a4='9';_0x3a9ec8=_0x0a29('0x1e');break;case 0xa:logger['info'](_0x0a29('0x1f'));_0x58f4a4='10';_0x3a9ec8='Authentication\x20failed.';break;case 0xb:logger[_0x0a29('0x4')](_0x0a29('0x20'));_0x58f4a4='11';_0x3a9ec8=_0x0a29('0x20');}}}catch(_0x126b80){logger[_0x0a29('0x12')](_0x0a29('0x21'),JSON['stringify'](_0x126b80));_0x3c8f3d['terminate']();}}function _0x5d143e(){logger[_0x0a29('0x4')](_0x0a29('0x22'));_0x2e7feb({'transcript':_0x159c71,'confidence':_0x1b6db7,'status':_0x58f4a4,'status_message':_0x3a9ec8});}function _0x29ac19(_0x3d3b01){logger['error'](_0x0a29('0x23'));if(!_['isNil'](_0x3d3b01)){logger[_0x0a29('0x12')](_[_0x0a29('0x24')](_0x3d3b01)?JSON[_0x0a29('0xe')](_0x3d3b01):_0x3d3b01);}}_0x3c8f3d['on']('open',_0x930298);_0x3c8f3d['on'](_0x0a29('0x25'),_0x187df7);_0x3c8f3d['on']('close',_0x5d143e);_0x3c8f3d['on'](_0x0a29('0x12'),_0x29ac19);});}; \ No newline at end of file +var _0xaedc=['crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','lodash','moment'];(function(_0x3c498f,_0x1a9eef){var _0x2104b8=function(_0x2d8b1a){while(--_0x2d8b1a){_0x3c498f['push'](_0x3c498f['shift']());}};_0x2104b8(++_0x1a9eef);}(_0xaedc,0x166));var _0xcaed=function(_0x38b84f,_0x26fd1a){_0x38b84f=_0x38b84f-0x0;var _0x2bc63b=_0xaedc[_0x38b84f];return _0x2bc63b;};'use strict';var BPromise=require('bluebird');var _=require(_0xcaed('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcaed('0x1'));var crypto=require(_0xcaed('0x2'));var logger=require('../../../../../../config/logger')(_0xcaed('0x3'));module[_0xcaed('0x4')]=function(_0x2dcda7,_0x1ee94b,_0x281fd9,_0x415f94){return new BPromise(function(_0x38835d,_0x373443){logger[_0xcaed('0x5')](_0xcaed('0x6'),_0x415f94||_0xcaed('0x7'));var _0x3d5d8b=new WebSocket(_0x415f94||_0xcaed('0x7'),{'perMessageDeflate':![]});var _0x18d0da='';var _0x1ef420='0';var _0x293074='1';var _0x2d1718=_0xcaed('0x8');function _0x4e6118(_0x281da0){var _0x58ae3c=crypto[_0xcaed('0x9')](_0xcaed('0xa'));_0x58ae3c[_0xcaed('0xb')](_0x281da0);return _0x58ae3c[_0xcaed('0xc')](_0xcaed('0xd'));}function _0x5aa5cb(){try{logger[_0xcaed('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x48a2cc=moment()[_0xcaed('0xe')]();var _0x2bcde5=_0x4e6118(_0x48a2cc+_0x1ee94b+_0x281fd9);_0x3d5d8b[_0xcaed('0xf')](JSON[_0xcaed('0x10')]({'appID':_0x1ee94b,'timestamp':_0x48a2cc,'appKey':_0x2bcde5}));var _0x5a1a7d=fs[_0xcaed('0x11')](_0x2dcda7);_0x5a1a7d['on'](_0xcaed('0x12'),function(_0x557615){_0x3d5d8b[_0xcaed('0xf')](_0x557615);});_0x5a1a7d['on'](_0xcaed('0x13'),function(){_0x3d5d8b[_0xcaed('0xf')](_0xcaed('0x14'));});}catch(_0x4a9579){logger[_0xcaed('0x15')](_0xcaed('0x16'),JSON[_0xcaed('0x10')](_0x4a9579));_0x3d5d8b[_0xcaed('0x17')]();}}function _0x12c1d1(_0x7cd156){try{if(_0x7cd156){var _0x58bf12=JSON['parse'](_0x7cd156);switch(_0x58bf12[_0xcaed('0x18')]){case 0x0:if(_0x58bf12[_0xcaed('0x19')]){if(_0x58bf12[_0xcaed('0x19')][_0xcaed('0x1a')]){logger[_0xcaed('0x5')](_0xcaed('0x1b'),JSON[_0xcaed('0x10')](_0x58bf12[_0xcaed('0x19')]['hypotheses']));_0x18d0da=_0x58bf12[_0xcaed('0x19')]['hypotheses'][0x0]['transcript'];_0x1ef420=_0x58bf12[_0xcaed('0x19')]['hypotheses'][0x0]['likelihood'];_0x293074='0';_0x2d1718=_0xcaed('0x1c');_0x3d5d8b[_0xcaed('0x17')]();}}break;case 0x1:logger[_0xcaed('0x5')](_0xcaed('0x8'));_0x293074='1';_0x2d1718=_0xcaed('0x8');break;case 0x2:logger[_0xcaed('0x5')](_0xcaed('0x1d'));_0x293074='2';_0x2d1718=_0xcaed('0x1d');break;case 0x9:logger['info'](_0xcaed('0x1e'));_0x293074='9';_0x2d1718='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xcaed('0x1f'));_0x293074='10';_0x2d1718=_0xcaed('0x1f');break;case 0xb:logger[_0xcaed('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x293074='11';_0x2d1718=_0xcaed('0x20');}}}catch(_0x51cd2f){logger[_0xcaed('0x15')](_0xcaed('0x21'),JSON['stringify'](_0x51cd2f));_0x3d5d8b[_0xcaed('0x17')]();}}function _0x1e789d(){logger[_0xcaed('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x38835d({'transcript':_0x18d0da,'confidence':_0x1ef420,'status':_0x293074,'status_message':_0x2d1718});}function _0x35ea60(_0x6b69b8){logger[_0xcaed('0x15')](_0xcaed('0x22'));if(!_['isNil'](_0x6b69b8)){logger[_0xcaed('0x15')](_[_0xcaed('0x23')](_0x6b69b8)?JSON[_0xcaed('0x10')](_0x6b69b8):_0x6b69b8);}}_0x3d5d8b['on']('open',_0x5aa5cb);_0x3d5d8b['on']('message',_0x12c1d1);_0x3d5d8b['on'](_0xcaed('0x13'),_0x1e789d);_0x3d5d8b['on'](_0xcaed('0x15'),_0x35ea60);});}; \ 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 6d65adc..15fde50 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 _0xbf9e=['exports','./asr'];(function(_0x28958d,_0xfa5f9f){var _0x439c72=function(_0x280df5){while(--_0x280df5){_0x28958d['push'](_0x28958d['shift']());}};_0x439c72(++_0xfa5f9f);}(_0xbf9e,0x17d));var _0xebf9=function(_0x48e6d6,_0x146763){_0x48e6d6=_0x48e6d6-0x0;var _0x239c71=_0xbf9e[_0x48e6d6];return _0x239c71;};var asr=require(_0xebf9('0x0'));module[_0xebf9('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe714=['exports','./asr'];(function(_0x4710d1,_0x4eb4b6){var _0x18b60f=function(_0x18965d){while(--_0x18965d){_0x4710d1['push'](_0x4710d1['shift']());}};_0x18b60f(++_0x4eb4b6);}(_0xe714,0xd5));var _0x4e71=function(_0x11a8fd,_0x1ee4c7){_0x11a8fd=_0x11a8fd-0x0;var _0x12c1c9=_0xe714[_0x11a8fd];return _0x12c1c9;};var asr=require(_0x4e71('0x0'));module[_0x4e71('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e971169..026c66f 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x31efe7,_0x52fe9e){var _0x24b6ee=function(_0x65ae94){while(--_0x65ae94){_0x31efe7['push'](_0x31efe7['shift']());}};_0x24b6ee(++_0x52fe9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 9145380..e2b9cf9 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 _0x5825=['ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','failure','math','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','then','getVoiceQueueById','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','method','timeout','number','PUT','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','format','%s.%s','setVariable','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','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','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','getSound','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','Trying\x20aws\x20Polly\x20%s','streamFile','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','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'];(function(_0x4f050f,_0x426650){var _0xaa8acc=function(_0x57f327){while(--_0x57f327){_0x4f050f['push'](_0x4f050f['shift']());}};_0xaa8acc(++_0x426650);}(_0x5825,0x78));var _0x5582=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5825[_0x4565bf];return _0x5610ba;};'use strict';var fs=require('fs');var util=require(_0x5582('0x0'));var _=require(_0x5582('0x1'));var sh=require(_0x5582('0x2'));var odbc=require(_0x5582('0x3'))();var rs=require('randomstring');var moment=require(_0x5582('0x4'));var Mustache=require('mustache');var rp=require(_0x5582('0x5'));var logger=require(_0x5582('0x6'))(_0x5582('0x7'));var config=require(_0x5582('0x8'));var shared=require(_0x5582('0x9'));var scripts=require(_0x5582('0xa'));var FILES_PATH=_0x5582('0xb');var recursiveMapAttributes=['rawHeaders',_0x5582('0xc')];var verticesWithRetry=[_0x5582('0xd'),_0x5582('0xe'),_0x5582('0xf')];var AGIVertices=function(_0x5e8681,_0x2904ad,_0x3aa455){this[_0x5582('0x10')]=_0x5e8681;this['rpc']=_0x2904ad;this[_0x5582('0x11')]=_0x3aa455;};AGIVertices[_0x5582('0x12')][_0x5582('0x13')]=function(_0x5537eb,_0x34845d){this[_0x5582('0x14')]['getVariableById'](_0x5537eb)[_0x5582('0x15')](function(_0xac1c6b){_0x34845d(null,_0xac1c6b?_0xac1c6b['name']:![]);})['catch'](function(_0x132be7){_0x34845d(_0x132be7);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x1d5108,_0x2dcae9){this['rpc'][_0x5582('0x16')](_0x1d5108)[_0x5582('0x15')](function(_0x589608){_0x2dcae9(null,_0x589608?_0x589608[_0x5582('0x17')]:![]);})[_0x5582('0x18')](function(_0x4835de){_0x2dcae9(_0x4835de);});};AGIVertices['prototype'][_0x5582('0x19')]=function(_0x5bb7a4,_0x378fa8){this[_0x5582('0x14')][_0x5582('0x1a')](_0x5bb7a4)[_0x5582('0x15')](function(_0x1b021a){_0x378fa8(null,_0x1b021a?_0x1b021a[_0x5582('0x17')]:![]);})[_0x5582('0x18')](function(_0x154fda){_0x378fa8(_0x154fda);});};AGIVertices['prototype'][_0x5582('0x1b')]=function(_0x4305eb,_0x3047cc){this[_0x5582('0x14')]['getSquareOdbcById'](_0x4305eb)[_0x5582('0x15')](function(_0x408f4c){_0x3047cc(null,_0x408f4c?_0x408f4c[_0x5582('0x1c')]:![]);})[_0x5582('0x18')](function(_0x328d89){_0x3047cc(_0x328d89);});};AGIVertices[_0x5582('0x12')][_0x5582('0x1d')]=function(_0x3efcfb,_0x239553){this['rpc'][_0x5582('0x1e')](_0x3efcfb)['then'](function(_0x1c4bc7){_0x239553(null,_0x1c4bc7?_0x1c4bc7['name']:![]);})[_0x5582('0x18')](function(_0x4b775f){_0x239553(_0x4b775f);});};AGIVertices['prototype'][_0x5582('0x1f')]=function(_0xbd8cb4,_0x345c1f){this[_0x5582('0x14')][_0x5582('0x20')](_0xbd8cb4)[_0x5582('0x15')](function(_0x56252e){_0x345c1f(null,_0x56252e?_0x56252e[_0x5582('0x17')]:![]);})['catch'](function(_0x1d8476){_0x345c1f(_0x1d8476);});};AGIVertices[_0x5582('0x12')]['getSound']=function(_0x259f5f,_0x5de26b){var _0xe67b02=this;this[_0x5582('0x14')][_0x5582('0x21')](_0x259f5f)[_0x5582('0x15')](function(_0x3e8325){_0x5de26b(null,_0x3e8325?_0xe67b02[_0x5582('0x22')](_0x3e8325[_0x5582('0x23')]):![]);})[_0x5582('0x18')](function(_0x31807b){_0x5de26b(_0x31807b);});};AGIVertices['prototype'][_0x5582('0x24')]=function(_0x27b16d,_0x357654){this[_0x5582('0x14')][_0x5582('0x25')](_0x27b16d)[_0x5582('0x15')](function(_0x1689f2){_0x357654(null,_0x1689f2?_0x1689f2:![]);})[_0x5582('0x18')](function(_0x493b6e){_0x357654(_0x493b6e);});};AGIVertices[_0x5582('0x12')][_0x5582('0x26')]=function(_0x1241ba,_0x317a3e,_0x5b91ea){this[_0x5582('0x11')][_0x5582('0x26')](_0x1241ba,_0x317a3e)['then'](function(){_0x5b91ea(null);})[_0x5582('0x18')](function(_0x54609a){_0x5b91ea(_0x54609a);});};AGIVertices[_0x5582('0x12')][_0x5582('0x27')]=function(_0x4add04,_0x2b7507){this[_0x5582('0x14')][_0x5582('0x28')](_0x4add04)[_0x5582('0x15')](function(_0x1e2b52){if(_0x1e2b52){if(_0x1e2b52[_0x5582('0x29')]){_0x2b7507(null,[_0x1e2b52[_0x5582('0x2a')]]);}else{_0x2b7507(null,_['map'](_0x1e2b52['Intervals'],_0x5582('0x2a')));}}else{_0x2b7507(null,![]);}})[_0x5582('0x18')](function(_0x73adc9){_0x2b7507(_0x73adc9);});};AGIVertices['prototype']['getSoundPath']=function(_0x55a7c2){return util['format'](_0x5582('0x2b'),FILES_PATH,_0x55a7c2);};AGIVertices[_0x5582('0x12')][_0x5582('0x2c')]=function(_0x1b7d45,_0x287f58,_0x42d89c){odbc['open'](_0x1b7d45,function(_0x51d8d2){if(_0x51d8d2){logger[_0x5582('0x2d')](_0x5582('0x2e'),_0x51d8d2);_0x42d89c(_0x51d8d2);}else{logger[_0x5582('0x2f')](_0x5582('0x30'));odbc[_0x5582('0x31')](_0x287f58,function(_0x7b7359,_0x28d7d6){if(_0x7b7359){logger[_0x5582('0x2f')](_0x5582('0x32'),_0x287f58);_0x42d89c(_0x7b7359);}else{logger[_0x5582('0x2f')](_0x5582('0x33'),_0x287f58);odbc[_0x5582('0x34')](function(_0x54522e){if(_0x54522e){logger[_0x5582('0x2d')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x54522e);}_0x42d89c(null,_0x28d7d6);});}});}});};AGIVertices['prototype'][_0x5582('0x35')]=function(_0x5f07ba,_0x187ba8){this[_0x5582('0x14')][_0x5582('0x36')](_0x5f07ba)[_0x5582('0x15')](function(_0x142e5f){_0x187ba8(null,_0x142e5f?_0x142e5f:![]);})['catch'](function(_0xfd82ff){_0x187ba8(_0xfd82ff);});};AGIVertices[_0x5582('0x12')]['createSmsMessage']=function(_0x1bd7d9,_0x28fc22){this[_0x5582('0x14')]['createSmsMessage'](_0x1bd7d9)[_0x5582('0x15')](function(_0x2f394f){_0x28fc22(null,_0x2f394f);})[_0x5582('0x18')](function(_0x114fca){_0x28fc22(_0x114fca);});};AGIVertices[_0x5582('0x12')][_0x5582('0x37')]=function(_0x33e2e3,_0x3c5ba5,_0x475889){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel'][_0x5582('0x38')],'node':_0x33e2e3['label'],'application':_0x33e2e3['agicommand'],'data':_0x3c5ba5||null,'project_name':this['channel'][_0x5582('0x39')],'callerid':this[_0x5582('0x10')][_0x5582('0x3a')]})[_0x5582('0x15')](function(_0x40a12b){if(_0x475889){_0x475889(null,_0x40a12b);}})['catch'](function(_0x3d184c){if(_0x475889){_0x475889(_0x3d184c);}});};AGIVertices[_0x5582('0x12')][_0x5582('0x3b')]=function(_0x2b86b1,_0x1807c8,_0x451fa1,_0x59a729){this[_0x5582('0x14')][_0x5582('0x3b')]({'uniqueid':this[_0x5582('0x10')][_0x5582('0x38')],'callerid':this[_0x5582('0x10')][_0x5582('0x3a')],'calleridname':this[_0x5582('0x10')][_0x5582('0x3c')],'context':this[_0x5582('0x10')][_0x5582('0x3d')],'extension':this[_0x5582('0x10')][_0x5582('0x3e')],'priority':this['channel'][_0x5582('0x3f')],'accountcode':this[_0x5582('0x10')][_0x5582('0x40')],'dnid':this[_0x5582('0x10')][_0x5582('0x41')],'projectName':this[_0x5582('0x10')][_0x5582('0x39')],'saveName':_0x1807c8,'filename':_0x2b86b1['file']||_0x1807c8,'savePath':_0x451fa1})['then'](function(_0x2946e2){_0x59a729(null,_0x2946e2);})['catch'](function(_0x33cc94){_0x59a729(_0x33cc94);});};AGIVertices[_0x5582('0x12')][_0x5582('0x42')]=function(_0x4a8f31,_0x2899bd,_0x4b9ffe,_0x33b0d6,_0x5ea23f){this[_0x5582('0x14')][_0x5582('0x42')]({'uniqueid':this[_0x5582('0x10')]['uniqueid'],'body':_0x4a8f31,'direction':_0x2899bd,'providerName':_0x4b9ffe,'providerResponse':_0x33b0d6})[_0x5582('0x15')](function(_0xfb7060){if(_0x5ea23f){_0x5ea23f(null,_0xfb7060);}})['catch'](function(_0x38661a){if(_0x5ea23f){_0x5ea23f(_0x38661a);}});};AGIVertices[_0x5582('0x12')][_0x5582('0x43')]=function(_0x2a9fa9,_0x5ebca4){this[_0x5582('0x14')][_0x5582('0x43')]({'firstName':_[_0x5582('0x44')](_0x2a9fa9[_0x5582('0x17')])||_[_0x5582('0x45')](_0x2a9fa9['name'])?'callback_'+Math['random']():_0x2a9fa9[_0x5582('0x17')],'lastName':_['isEmpty'](_0x2a9fa9[_0x5582('0x46')])||_['isNil'](_0x2a9fa9[_0x5582('0x46')])?null:_0x2a9fa9[_0x5582('0x46')],'phone':_0x2a9fa9[_0x5582('0x47')],'ListId':_0x2a9fa9[_0x5582('0x48')],'scheduledat':_0x2a9fa9[_0x5582('0x49')],'callbackUniqueid':this[_0x5582('0x10')][_0x5582('0x38')],'tags':_0x5582('0x4a'),'description':_0x5582('0x4b')+_0x2a9fa9[_0x5582('0x49')][_0x5582('0x4c')](),'priority':_0x2a9fa9['callback_priority']})[_0x5582('0x15')](function(_0x5ca0e9){_0x5ebca4(null,_0x5ca0e9);})[_0x5582('0x18')](function(_0x3c8064){_0x5ebca4(_0x3c8064);});};AGIVertices[_0x5582('0x12')][_0x5582('0x4d')]=function(_0x9805dd,_0x162880){this[_0x5582('0x14')][_0x5582('0x4e')](_0x9805dd)[_0x5582('0x15')](function(_0x1b73c5){_0x162880(null,_0x1b73c5?_0x1b73c5[_0x5582('0x17')]:![]);})['catch'](function(_0x3cbc55){_0x162880(_0x3cbc55);});};AGIVertices['prototype']['agentPause']=function(_0x1eec90,_0x1a4081,_0x11f464){var _0x34834a={'role':'agent'};_0x34834a[_0x1eec90]=this[_0x5582('0x10')][_0x5582('0x3a')];this[_0x5582('0x14')][_0x5582('0x4f')](_0x34834a,_0x1a4081,this[_0x5582('0x10')][_0x5582('0x38')])[_0x5582('0x15')](function(_0x423692){_0x11f464(null,_[_0x5582('0x45')](_0x423692)?![]:!![]);})[_0x5582('0x18')](function(_0xf21b7){logger[_0x5582('0x2d')](_0xf21b7);_0x11f464(null,![]);});};AGIVertices[_0x5582('0x12')][_0x5582('0x50')]=function(_0x51a504,_0x4c7583){var _0x2e314e={'role':_0x5582('0x51')};_0x2e314e[_0x51a504]=this[_0x5582('0x10')]['callerid'];this[_0x5582('0x14')]['agentUnpause'](_0x2e314e)[_0x5582('0x15')](function(_0x568df6){_0x4c7583(null,_['isNil'](_0x568df6)?![]:!![]);})['catch'](function(_0x5b5893){logger['error'](_0x5b5893);_0x4c7583(null,![]);});};AGIVertices['prototype'][_0x5582('0x52')]=function(_0x3ab96c,_0x41469e){var _0xaee9={'role':_0x5582('0x51')};_0xaee9[_0x3ab96c]=this[_0x5582('0x10')][_0x5582('0x3a')];this[_0x5582('0x14')][_0x5582('0x52')](_0xaee9)[_0x5582('0x15')](function(_0xeb3a70){_0x41469e(null,_[_0x5582('0x45')](_0xeb3a70)?![]:!![]);})[_0x5582('0x18')](function(_0x353591){logger['error'](_0x353591);_0x41469e(null,![]);});};AGIVertices[_0x5582('0x12')][_0x5582('0x53')]=function(_0x3f83ed,_0x546258){var _0x41408f={'role':'agent'};_0x41408f[_0x3f83ed]=this[_0x5582('0x10')][_0x5582('0x3a')];var _0x41452e=_0x3f83ed!='internal'?util['format'](_0x5582('0x54'),'LOCAL',this['channel'][_0x5582('0x3a')]):undefined;this[_0x5582('0x14')][_0x5582('0x53')](_0x41408f,_0x41452e)[_0x5582('0x15')](function(_0x4bb2e8){_0x546258(null,_['isNil'](_0x4bb2e8)?![]:!![]);})[_0x5582('0x18')](function(_0x5195db){logger['error'](_0x5195db);_0x546258(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4370bd,_0x132b71){sh[_0x5582('0x55')](_['trim'](_0x4370bd),function(_0x2c0c97,_0xe3d23c){var _0x2c782c=_0xe3d23c[_0x5582('0x56')](/(\r\n|\n|\r)/gm,'');_0x132b71(null,_0x2c782c);});};AGIVertices[_0x5582('0x12')][_0x5582('0x57')]=function(_0x56cb7a,_0x3a1042){scripts[_0x5582('0x57')](_0x56cb7a[_0x5582('0x58')],_0x56cb7a[_0x5582('0x59')]||_0x5582('0x5a'),_0x56cb7a[_0x5582('0x5a')],_0x56cb7a['languageCode']||_0x5582('0x5b'),_0x56cb7a[_0x5582('0x5c')]||_0x5582('0x5d'),_0x56cb7a[_0x5582('0x5e')]||_0x5582('0x5f'))[_0x5582('0x15')](function(_0x5b607c){_0x3a1042(null,_0x5b607c);})['catch'](function(_0x243990){_0x3a1042(_0x243990);});};AGIVertices[_0x5582('0x12')][_0x5582('0x60')]=function(_0x557c9f,_0x3a601b){scripts[_0x5582('0x60')](_0x557c9f[_0x5582('0x5a')],_0x557c9f['google_tts_language']||'en',0x1)[_0x5582('0x15')](function(_0x4f9a75){_0x3a601b(null,_0x4f9a75);})['catch'](function(_0x75b05b){_0x3a601b(_0x75b05b);});};AGIVertices['prototype']['restAPI']=function(_0x2d5f6b,_0x5e9261){var _0xee4b4={'uri':_0x2d5f6b['url'],'method':_0x2d5f6b[_0x5582('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2d5f6b[_0x5582('0x62')])===_0x5582('0x63')&&parseInt(_0x2d5f6b['timeout'])>=0x1?parseInt(_0x2d5f6b[_0x5582('0x62')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x5582('0x64')],_0xee4b4[_0x5582('0x61')]['toUpperCase']())){try{_0xee4b4[_0x5582('0x65')]=_0x2d5f6b[_0x5582('0xc')]?JSON['parse'](_0x2d5f6b[_0x5582('0xc')]):{};}catch(_0x32d71c){logger[_0x5582('0x2d')](_0x5582('0x66'),_0x32d71c);}}try{_0xee4b4[_0x5582('0x67')]=_0x2d5f6b[_0x5582('0x68')]?JSON['parse'](_0x2d5f6b['rawHeaders']):{};}catch(_0x410dd2){logger[_0x5582('0x2d')](_0x5582('0x69'),_0x410dd2);}if(_0x2d5f6b[_0x5582('0x6a')]){try{var _0x20e4f7=require(_0x2d5f6b['computedVariables'])[_0x5582('0x6b')](this,_0xee4b4);_0xee4b4[_0x5582('0x6c')]=Mustache[_0x5582('0x6d')](_0x2d5f6b[_0x5582('0x6e')],_0x20e4f7,{},['$$','$$']);if(_0xee4b4[_0x5582('0x67')]){_0xee4b4['headers']=JSON[_0x5582('0x6f')](Mustache['render'](JSON[_0x5582('0x70')](_0xee4b4['headers']),_0x20e4f7,{},['$$','$$']));}if(_0xee4b4[_0x5582('0x65')]){_0xee4b4[_0x5582('0x65')]=JSON['parse'](Mustache[_0x5582('0x6d')](JSON[_0x5582('0x70')](_0xee4b4[_0x5582('0x65')]),_0x20e4f7,{},['$$','$$']));}}catch(_0x379431){logger['error'](_0x5582('0x71'),_0x379431);}}rp(_0xee4b4)[_0x5582('0x15')](function(_0x1b8d08){var _0x5b8985={'statusCode':_0x1b8d08[_0x5582('0x72')]||0xc8,'statusMessage':_0x1b8d08[_0x5582('0x73')]||'OK','headers':_0x1b8d08[_0x5582('0x67')]||{},'body':_0x1b8d08[_0x5582('0x65')]||{}};_0x5e9261(null,_0x5b8985);})[_0x5582('0x18')](function(_0x4cc85f){var _0x28ad38={'statusCode':_0x4cc85f[_0x5582('0x72')]||0x1f4,'statusMessage':_0x4cc85f['message']||_0x5582('0x74'),'headers':_0x4cc85f['options']['headers']||{},'body':_0x4cc85f[_0x5582('0x75')][_0x5582('0x65')]||{}};_0x5e9261(null,_0x28ad38);});};AGIVertices['prototype']['googleDialogflow']=function(_0x2c68a0,_0x1744cc){scripts[_0x5582('0x76')](this[_0x5582('0x10')][_0x5582('0x38')],_0x2c68a0['key'],_0x2c68a0['text'],_0x2c68a0[_0x5582('0x77')]||'en')['then'](function(_0x1fbc0b){_0x1744cc(null,_0x1fbc0b);})['catch'](function(_0x3de478){_0x1744cc(_0x3de478);});};AGIVertices['prototype'][_0x5582('0x78')]=function(_0x3e267f,_0x1f81f9){scripts[_0x5582('0x78')](this[_0x5582('0x10')][_0x5582('0x38')],_0x3e267f[_0x5582('0x79')],_0x3e267f[_0x5582('0x7a')],_0x3e267f[_0x5582('0x7b')],_0x3e267f[_0x5582('0x5a')],_0x3e267f[_0x5582('0x7c')]||'en')['then'](function(_0x4a71fd){_0x1f81f9(null,_0x4a71fd);})[_0x5582('0x18')](function(_0x45a416){_0x1f81f9(_0x45a416);});};AGIVertices[_0x5582('0x12')][_0x5582('0x7d')]=function(_0xf88439,_0x37c87a){scripts[_0x5582('0x7d')](this['channel'],_0xf88439)[_0x5582('0x15')](function(_0x13ceef){_0x37c87a(null,_0x13ceef);})[_0x5582('0x18')](function(_0x8c2275){_0x37c87a(_0x8c2275);});};AGIVertices[_0x5582('0x12')]['ispeechTTS']=function(_0x29f122,_0x4d2dbb){scripts[_0x5582('0x7e')](_0x29f122[_0x5582('0x7f')],_0x29f122[_0x5582('0x5a')],_0x29f122[_0x5582('0x80')]||_0x5582('0x5b'),_0x29f122[_0x5582('0x81')])[_0x5582('0x15')](function(_0x27f224){_0x4d2dbb(null,_0x27f224);})['catch'](function(_0x6f7040){_0x4d2dbb(_0x6f7040);});};AGIVertices['prototype'][_0x5582('0x82')]=function(_0x3a7f15,_0xcea181,_0x3a4f7c){scripts[_0x5582('0x82')](_0xcea181,_0x3a7f15[_0x5582('0x7f')],_0x3a7f15['ispeech_asr_language']||_0x5582('0x5b'),this[_0x5582('0x83')](_0x3a7f15[_0x5582('0x84')])?_0x3a7f15[_0x5582('0x84')]:undefined)[_0x5582('0x15')](function(_0x37f887){_0x3a4f7c(null,_0x37f887);})[_0x5582('0x18')](function(_0x199d34){_0x3a4f7c(_0x199d34);});};AGIVertices[_0x5582('0x12')][_0x5582('0x85')]=function(_0x6ac579,_0x41ee71){scripts[_0x5582('0x85')](_0x6ac579[_0x5582('0x86')],_0x6ac579[_0x5582('0x87')],_0x6ac579[_0x5582('0x88')],_0x6ac579['aws_polly_voice']||_0x5582('0x89'),_0x6ac579[_0x5582('0x5a')],_0x6ac579[_0x5582('0x8a')]||_0x5582('0x5a'))['then'](function(_0xea3da0){_0x41ee71(null,_0xea3da0);})[_0x5582('0x18')](function(_0x13d9b3){_0x41ee71(_0x13d9b3);});};AGIVertices[_0x5582('0x12')][_0x5582('0x8b')]=function(_0x4591ff,_0x27cd65){scripts[_0x5582('0x8b')](this['channel']['uniqueid'],_0x4591ff[_0x5582('0x86')],_0x4591ff[_0x5582('0x87')],_0x4591ff[_0x5582('0x8c')],_0x4591ff['text'],_0x4591ff[_0x5582('0x8d')])['then'](function(_0x3c4535){_0x27cd65(null,_0x3c4535);})[_0x5582('0x18')](function(_0x29b0ab){_0x27cd65(_0x29b0ab);});};AGIVertices[_0x5582('0x12')][_0x5582('0x8e')]=function(_0x1b94a6,_0x176c95,_0x68adfe){scripts[_0x5582('0x8e')](_0x176c95,_0x1b94a6['key'],_0x1b94a6[_0x5582('0x8f')]||_0x5582('0x5b'))[_0x5582('0x15')](function(_0x56a8f2){_0x68adfe(null,_0x56a8f2);})['catch'](function(_0x2429f7){_0x68adfe(_0x2429f7);});};AGIVertices[_0x5582('0x12')][_0x5582('0x90')]=function(_0x216eec,_0x4cda46,_0xbfecc2){scripts['tildeASR'](_0x4cda46,_0x216eec[_0x5582('0x91')],_0x216eec[_0x5582('0x92')],_0x216eec[_0x5582('0x6c')])['then'](function(_0x23003f){_0xbfecc2(null,_0x23003f);})['catch'](function(_0x3f3d95){_0xbfecc2(_0x3f3d95);});};AGIVertices[_0x5582('0x12')][_0x5582('0x93')]=function(_0x4cbaff){var _0x344642=_[_0x5582('0x94')](verticesWithRetry,_0x4cbaff['agicommand'])?_0x4cbaff:_['clone'](_0x4cbaff);for(var _0x39b083 in _0x344642){if(_0x344642[_0x5582('0x95')](_0x39b083)){if(_0x344642[_0x39b083]&&_[_0x5582('0x96')](_0x344642[_0x39b083])){if(_['includes'](recursiveMapAttributes,_0x39b083)){_0x344642[_0x39b083]=this[_0x5582('0x97')](_0x344642[_0x39b083]);}else{_0x344642[_0x39b083]=this['replaceAllVariables'](_0x344642[_0x39b083]);}}}}return _0x344642;};AGIVertices[_0x5582('0x12')]['recursiveNodeIndex']=function(_0x18a7b8){for(var _0x30c084 in _0x18a7b8){if(_0x18a7b8[_0x5582('0x95')](_0x30c084)){if(_[_0x5582('0x98')](_0x18a7b8[_0x30c084])){this[_0x5582('0x99')](_0x18a7b8[_0x30c084]);}else if(_[_0x5582('0x9a')](_0x18a7b8[_0x30c084])){for(var _0x3cfcd5=0x0;_0x3cfcd5<_0x18a7b8[_0x30c084][_0x5582('0x9b')];_0x3cfcd5++){this['recursiveNodeIndex'](_0x18a7b8[_0x30c084][_0x3cfcd5]);}}else if(_[_0x5582('0x96')](_0x18a7b8[_0x30c084])){_0x18a7b8[_0x30c084]=this['replaceAllVariables'](_0x18a7b8[_0x30c084]);}}}};AGIVertices['prototype'][_0x5582('0x9c')]=function(_0x4e7148,_0x570ed7){for(var _0xe032fe in _0x4e7148){if(_0x4e7148[_0x5582('0x95')](_0xe032fe)){if(_[_0x5582('0x98')](_0x4e7148[_0xe032fe])){if(!_['isEmpty'](_0x4e7148[_0xe032fe])){this[_0x5582('0x9c')](_0x4e7148[_0xe032fe],util[_0x5582('0x9d')]('%s.%s',_0x570ed7,_0xe032fe));}}else if(_[_0x5582('0x9a')](_0x4e7148[_0xe032fe])){for(var _0x4b540e=0x0;_0x4b540e<_0x4e7148[_0xe032fe][_0x5582('0x9b')];_0x4b540e++){this[_0x5582('0x9c')](_0x4e7148[_0xe032fe][_0x4b540e],util[_0x5582('0x9d')](_0x5582('0x9e'),_0x570ed7,_0xe032fe+'['+_0x4b540e+']'));}}else{if(!_[_0x5582('0x45')](_0x4e7148[_0xe032fe])){this[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')]('%s.%s',_0x570ed7,_0xe032fe),_0x4e7148[_0xe032fe]);}}}}};AGIVertices[_0x5582('0x12')][_0x5582('0x97')]=function(_0x448708){try{var _0x1dfe68=JSON[_0x5582('0x6f')](_0x448708);this[_0x5582('0x99')](_0x1dfe68);return JSON[_0x5582('0x70')](_0x1dfe68);}catch(_0x174494){return this[_0x5582('0xa0')](_0x448708);}};AGIVertices[_0x5582('0x12')][_0x5582('0xa0')]=function(_0xeceada){var _0x59cc99=_0xeceada[_0x5582('0xa1')]('{');for(var _0x534433=0x1;_0x534433<_0x59cc99['length'];_0x534433+=0x1){var _0x275747=_0x59cc99[_0x534433]['split']('}');if(_0x275747[_0x5582('0x9b')]>0x1){_0xeceada=_0xeceada[_0x5582('0xa2')]('{'+_0x275747[0x0]+'}',this['channel'][_0x5582('0x13')](_0x275747[0x0])[_0x5582('0xa3')]||_0x275747[0x0]);}}if(_0x59cc99[_0x5582('0x9b')]===0x1){return _0xeceada['toString']();}return this[_0x5582('0xa0')](_0xeceada);};AGIVertices[_0x5582('0x12')][_0x5582('0xa4')]=function(_0x527683,_0x587eae){var _0x35b74d=this['channel'][_0x5582('0x13')](_0x527683);if(_0x35b74d[_0x5582('0xa5')]===-0x1){return _0x35b74d;}logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x587eae,_0x35b74d[_0x5582('0xa3')]));return this[_0x5582('0x10')][_0x5582('0x9f')](_0x587eae,_0x35b74d['extra']);};AGIVertices[_0x5582('0x12')][_0x5582('0x83')]=function(_0x5881ea){return _0x5881ea&&_0x5881ea!=='0'&&_0x5881ea!=='-1'&&_0x5881ea!=='';};AGIVertices['prototype'][_0x5582('0xa6')]=function(_0x4f6b94){this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x4f6b94,'-');_0x4f6b94['retry']=_0x4f6b94[_0x5582('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x5582('0xa7')]=function(_0x351a00){logger['info'](util[_0x5582('0x9d')](_0x5582('0xa8'),_0x351a00[_0x5582('0xa9')]));if(!this['isConfigured'](_0x351a00[_0x5582('0x5a')])){return this['channel'][_0x5582('0xaa')](_0x5582('0xab'));}var _0x2f6857='\x22'+_0x351a00['text']+'\x22';if(this[_0x5582('0x83')](_0x351a00[_0x5582('0x75')])){_0x2f6857+=','+_0x351a00['options'];}var _0x3892cf=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0xac'),_0x2f6857);if(_0x3892cf['result']===-0x1){return _0x3892cf;}return this[_0x5582('0x10')][_0x5582('0xaa')](util['format'](_0x5582('0xad'),_0x2f6857));};AGIVertices[_0x5582('0x12')][_0x5582('0xae')]=function(_0x4e3652){logger[_0x5582('0x2f')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x4e3652[_0x5582('0xa9')]));if(!this['isConfigured'](_0x4e3652[_0x5582('0xaf')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20grammar\x20configured');}var _0x3ccbab=_0x4e3652[_0x5582('0xaf')];if(this[_0x5582('0x83')](_0x4e3652[_0x5582('0x75')])){_0x3ccbab+=','+_0x4e3652['options'];}var _0x5a40db=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0xb0'),_0x3ccbab);if(_0x5a40db[_0x5582('0xa5')]===-0x1){return _0x5a40db;}var _0x3af676=this[_0x5582('0xa4')](_0x5582('0xb1'),'MRCP_RECOG_CONFIDENCE');if(_0x3af676['result']===-0x1){return _0x3af676;}var _0x1bbf6d=this['getAndSetVariable']('RECOG_INPUT()',_0x5582('0xb2'));if(_0x1bbf6d[_0x5582('0xa5')]===-0x1){return _0x1bbf6d;}var _0x2ffaea=this[_0x5582('0xa4')](_0x5582('0xb3'),_0x5582('0xb4'));if(_0x2ffaea[_0x5582('0xa5')]===-0x1){return _0x2ffaea;}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xb5'),_0x3ccbab));};AGIVertices[_0x5582('0x12')][_0x5582('0x7')]=function(_0x34ee62){logger['info'](util['format'](_0x5582('0xb6'),_0x34ee62[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0x7')]([_0x34ee62[_0x5582('0xb7')],_0x34ee62[_0x5582('0xb8')]]);};AGIVertices[_0x5582('0x12')][_0x5582('0xb9')]=function(_0xbe9e53){logger[_0x5582('0x2f')](util['format'](_0x5582('0xba'),_0xbe9e53['label']));if(this['isConfigured'](_0xbe9e53['timeout'])){logger[_0x5582('0x2f')](util['format'](_0x5582('0xbb'),_0xbe9e53[_0x5582('0x62')]));var _0x1837f6=this[_0x5582('0x10')]['wait'](_0xbe9e53[_0x5582('0x62')]);if(_0x1837f6[_0x5582('0xa5')]===-0x1){return _0x1837f6;}}return this[_0x5582('0x10')][_0x5582('0xb9')]();};AGIVertices[_0x5582('0x12')][_0x5582('0x4a')]=function(_0x40b881){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0xbc'),_0x40b881[_0x5582('0xa9')]));if(!this['isConfigured'](_0x40b881[_0x5582('0x48')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x40b881,'no\x20list\x20selected');}_0x40b881[_0x5582('0x49')]=moment();if(this[_0x5582('0x83')](_0x40b881[_0x5582('0xbd')])){_0x40b881[_0x5582('0x49')]=moment()[_0x5582('0xbe')](_0x40b881['delay'],_0x5582('0xbf'));}if(!this['isConfigured'](_0x40b881[_0x5582('0xc0')])){_0x40b881[_0x5582('0xc0')]=0x2;}this[_0x5582('0x43')][_0x5582('0x6b')](this,_0x40b881);return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xc1'),_0x40b881[_0x5582('0x47')],_0x40b881[_0x5582('0x48')],_0x40b881['scheduledAt']));};AGIVertices[_0x5582('0x12')][_0x5582('0xc2')]=function(_0x1d0895){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0xc3'),_0x1d0895['label']));var _0x48fdaa=this[_0x5582('0x10')][_0x5582('0x55')](_0x1d0895[_0x5582('0xc4')],_0x1d0895[_0x5582('0x75')]);if(_0x48fdaa['result']===-0x1){return _0x48fdaa;}return this[_0x5582('0x10')][_0x5582('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x1d0895['application'],_0x1d0895['options']));};AGIVertices[_0x5582('0x12')][_0x5582('0xc5')]=function(_0x2e49c6){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0xc6'),_0x2e49c6[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x2e49c6[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xab'));}var _0x79b65b='\x22'+_0x2e49c6[_0x5582('0x5a')]+'\x22';if(this[_0x5582('0x83')](_0x2e49c6[_0x5582('0x75')])){_0x79b65b+=','+_0x2e49c6[_0x5582('0x75')];}var _0x57cdb6=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0xac'),_0x79b65b);if(_0x57cdb6[_0x5582('0xa5')]===-0x1){return _0x57cdb6;}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x79b65b));};AGIVertices[_0x5582('0x12')]['sestektts']=function(_0x2bcd1e){logger['info'](util['format'](_0x5582('0xc7'),_0x2bcd1e[_0x5582('0xa9')]));if(!this['isConfigured'](_0x2bcd1e['text'])){return this['channel'][_0x5582('0xaa')](_0x5582('0xab'));}var _0x59d529='\x22'+_0x2bcd1e[_0x5582('0x5a')]+'\x22';if(this['isConfigured'](_0x2bcd1e[_0x5582('0x75')])){_0x59d529+=','+_0x2bcd1e[_0x5582('0x75')];}var _0x33bf67=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0xac'),_0x59d529);if(_0x33bf67[_0x5582('0xa5')]===-0x1){return _0x33bf67;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xad'),_0x59d529));};AGIVertices[_0x5582('0x12')][_0x5582('0xc8')]=function(_0x3f0c16){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0xc9'),_0x3f0c16[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x3f0c16[_0x5582('0xaf')])){return this['channel'][_0x5582('0xaa')](_0x5582('0xca'));}var _0x40134d=_0x3f0c16[_0x5582('0xaf')];if(this[_0x5582('0x83')](_0x3f0c16[_0x5582('0x75')])){_0x40134d+=','+_0x3f0c16[_0x5582('0x75')];}var _0x38eec0=this['channel'][_0x5582('0x55')](_0x5582('0xb0'),_0x40134d);if(_0x38eec0[_0x5582('0xa5')]===-0x1){return _0x38eec0;}var _0x4e2c85=this[_0x5582('0xa4')](_0x5582('0xb1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4e2c85['result']===-0x1){return _0x4e2c85;}var _0x46fd73=this[_0x5582('0xa4')]('RECOG_INPUT()',_0x5582('0xcb'));if(_0x46fd73[_0x5582('0xa5')]===-0x1){return _0x46fd73;}var _0x44ec45=this[_0x5582('0xa4')](_0x5582('0xb3'),_0x5582('0xcc'));if(_0x44ec45[_0x5582('0xa5')]===-0x1){return _0x44ec45;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xb5'),_0x40134d));};AGIVertices[_0x5582('0x12')][_0x5582('0xcd')]=function(_0x2eb7fd){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0xce'),_0x2eb7fd[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x2eb7fd['grammar'])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xca'));}var _0x55f01a=_0x2eb7fd[_0x5582('0xaf')];if(this[_0x5582('0x83')](_0x2eb7fd[_0x5582('0x75')])){_0x55f01a+=','+_0x2eb7fd[_0x5582('0x75')];}var _0x1bf583=this['channel'][_0x5582('0x55')]('MRCPRecog',_0x55f01a);if(_0x1bf583['result']===-0x1){return _0x1bf583;}var _0x4599d4=this[_0x5582('0xa4')](_0x5582('0xb1'),_0x5582('0xcf'));if(_0x4599d4[_0x5582('0xa5')]===-0x1){return _0x4599d4;}var _0x31a2a3=this[_0x5582('0xa4')](_0x5582('0xd0'),_0x5582('0xd1'));if(_0x31a2a3['result']===-0x1){return _0x31a2a3;}var _0x118687=this[_0x5582('0xa4')](_0x5582('0xb3'),'SESTEK_ASR_INSTANCE');if(_0x118687[_0x5582('0xa5')]===-0x1){return _0x118687;}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xb5'),_0x55f01a));};AGIVertices[_0x5582('0x12')][_0x5582('0xd2')]=function(_0x5cc8d9){logger['info'](util[_0x5582('0x9d')](_0x5582('0xd3'),_0x5cc8d9[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x5cc8d9[_0x5582('0xd4')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5cc8d9,_0x5582('0xd5'));}var _0x27c00e=this['getSquareOdbc']['sync'](this,_0x5cc8d9[_0x5582('0xd4')]);if(!_0x27c00e){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5cc8d9,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5cc8d9[_0x5582('0x31')])){return this['channel'][_0x5582('0x2d')](_0x5cc8d9,_0x5582('0xd6'));}var _0x4c1512=_0x5cc8d9[_0x5582('0x31')][_0x5582('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x5582('0xaa')](util['format'](_0x5582('0xd7'),_0x4c1512));var _0x50b5d5=this[_0x5582('0x2c')][_0x5582('0x6b')](this,_0x27c00e,_0x4c1512);this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x5cc8d9,_0x4c1512);if(!this[_0x5582('0x83')](_0x5cc8d9['variable_id'])){return this['channel'][_0x5582('0xaa')](_0x5582('0xd8'));}var _0x33fac8=this[_0x5582('0x13')][_0x5582('0x6b')](this,_0x5cc8d9[_0x5582('0xd9')]);if(!_0x33fac8){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5cc8d9,_0x5582('0xda'));}var _0x34e513=this;_0x50b5d5[_0x5582('0xdb')](function(_0x32d56d,_0x45fb59){Object[_0x5582('0xdc')](_0x32d56d)[_0x5582('0xdb')](function(_0x43a0c8){_0x34e513[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0xdd'),_0x33fac8,_0x45fb59,_0x43a0c8),_0x32d56d[_0x43a0c8]);});});this[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0xde'),_0x33fac8),_0x50b5d5['length']);return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xdf'),_0x33fac8));};AGIVertices[_0x5582('0x12')][_0x5582('0xe0')]=function(_0x18ec74){logger['debug'](util[_0x5582('0x9d')](_0x5582('0xe1'),_0x18ec74[_0x5582('0xa9')]));if(!this['isConfigured'](_0x18ec74[_0x5582('0xe2')])){return this[_0x5582('0x10')]['error'](_0x18ec74,_0x5582('0xe3'));}var _0x58d497=this[_0x5582('0x1d')]['sync'](this,_0x18ec74['sip_id']);if(!_0x58d497){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x18ec74,'no\x20user\x20found');}var _0x42e8cc=this[_0x5582('0x10')]['exec'](_0x5582('0xe4'),[util[_0x5582('0x9d')]('SIP/%s',_0x58d497),_0x18ec74[_0x5582('0x62')],_0x18ec74[_0x5582('0xe5')],_0x18ec74['url']]);if(_0x42e8cc['result']===-0x1){return _0x42e8cc;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xe6'),'DIAL'));};AGIVertices[_0x5582('0x12')][_0x5582('0xe7')]=function(_0x44070d){logger['info'](util[_0x5582('0x9d')](_0x5582('0xe8'),_0x44070d[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x44070d[_0x5582('0x7f')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20key\x20configured');}if(!this[_0x5582('0x83')](_0x44070d[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xab'));}this['channel'][_0x5582('0xe9')]=!![];this[_0x5582('0x37')](_0x44070d);this['createSquareMessage'](_0x44070d[_0x5582('0x5a')],'in','','');this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xea'),_0x44070d[_0x5582('0x5a')]));var _0x4c217d=this['googleDialogflow'][_0x5582('0x6b')](this,_0x44070d);if(_0x4c217d){for(var _0x370c2d in _0x4c217d){if(_0x4c217d['hasOwnProperty'](_0x370c2d)){this[_0x5582('0x10')][_0x5582('0x9f')](util['format'](_0x5582('0xeb'),_0x370c2d[_0x5582('0xec')]()),_0x4c217d[_0x370c2d]);}}this['createSquareMessage'](_0x4c217d[_0x5582('0xed')],_0x5582('0xee'),'dialogflow','');return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')]('Dialogflow\x20Result\x20%s',_0x4c217d[_0x5582('0xed')]));}return this[_0x5582('0x10')][_0x5582('0x2d')](_0x44070d,_0x5582('0xef'));};AGIVertices[_0x5582('0x12')]['dialogflowV2']=function(_0x1855e0){logger[_0x5582('0x2f')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1855e0[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x1855e0[_0x5582('0x79')])){return this['channel']['noop'](_0x5582('0xf0'));}if(!this[_0x5582('0x83')](_0x1855e0[_0x5582('0x7a')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xf1'));}if(!this[_0x5582('0x83')](_0x1855e0[_0x5582('0x7b')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xf2'));}if(!this[_0x5582('0x83')](_0x1855e0['dialogflowV2_language'])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xf3'));}if(!this[_0x5582('0x83')](_0x1855e0[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20text\x20configured');}this[_0x5582('0x10')]['bot']=!![];this[_0x5582('0x37')](_0x1855e0);this[_0x5582('0x42')](_0x1855e0[_0x5582('0x5a')],'in','','');this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xf4'),_0x1855e0[_0x5582('0x5a')]));var _0x246d67=this[_0x5582('0x78')]['sync'](this,_0x1855e0);if(_0x246d67){for(var _0x3609be in _0x246d67){if(_0x246d67[_0x5582('0x95')](_0x3609be)){if(_0x3609be!=='providerResponse'){this[_0x5582('0x10')][_0x5582('0x9f')](util['format'](_0x5582('0xeb'),_0x3609be[_0x5582('0xec')]()),_0x246d67[_0x3609be]);}}}this[_0x5582('0x42')](_0x246d67[_0x5582('0xed')],'out',_0x5582('0xf5'),_0x246d67[_0x5582('0xf6')]);return this['channel'][_0x5582('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x246d67['speech']));}return this['channel'][_0x5582('0x2d')](_0x1855e0,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x5582('0x12')][_0x5582('0xf7')]=function(_0x7c74c0){logger[_0x5582('0x2f')](util['format'](_0x5582('0xf8'),_0x7c74c0['label']));if(!this['isConfigured'](_0x7c74c0[_0x5582('0xf9')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xfa'));}if(!this[_0x5582('0x83')](_0x7c74c0['username'])){return this['channel'][_0x5582('0xaa')]('no\x20username\x20configured');}if(!this[_0x5582('0x83')](_0x7c74c0[_0x5582('0xfb')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xfc'));}if(!this['isConfigured'](_0x7c74c0[_0x5582('0xfd')])){return this['channel']['noop'](_0x5582('0xab'));}this[_0x5582('0x10')][_0x5582('0xe9')]=!![];this[_0x5582('0x37')](_0x7c74c0);this[_0x5582('0x42')](_0x7c74c0['text'],'in','','');this[_0x5582('0x10')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x7c74c0[_0x5582('0x5a')]));var _0x138307=this[_0x5582('0x7d')]['sync'](this,_0x7c74c0);if(_0x138307){for(var _0x4fe80d in _0x138307){if(_0x138307[_0x5582('0x95')](_0x4fe80d)){this['channel']['setVariable'](util[_0x5582('0x9d')](_0x5582('0xfe'),_0x4fe80d[_0x5582('0xec')]()),_0x138307[_0x4fe80d]);}}this[_0x5582('0x42')](_0x138307[_0x5582('0xed')],'out',_0x5582('0xf7'),'');if(_0x138307[_0x5582('0xff')]){this[_0x5582('0x10')]['noop'](util[_0x5582('0x9d')](_0x5582('0x100'),_0x138307['audiofile']));var _0x3d72ba=this[_0x5582('0x10')]['streamFile'](_0x138307[_0x5582('0xff')]);try{fs[_0x5582('0x101')](_0x138307[_0x5582('0xff')]+_0x5582('0x102'));}catch(_0x7ca979){logger[_0x5582('0x2d')](_0x7ca979);}return _0x3d72ba;}else{return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x103'),_0x138307[_0x5582('0xed')]));}}return this[_0x5582('0x10')]['error'](_0x7c74c0,_0x5582('0x104'));};AGIVertices[_0x5582('0x12')][_0x5582('0x105')]=function(_0x5b263b){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5b263b['label']));return this[_0x5582('0x10')]['noop'](_0x5582('0x105'));};AGIVertices[_0x5582('0x12')][_0x5582('0x106')]=function(_0x5a49c8){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x107'),_0x5a49c8[_0x5582('0xa9')]));var _0x5c8b5b='';if(_0x5a49c8['trunk_id']){if(!this[_0x5582('0x83')](_0x5a49c8[_0x5582('0x108')])){return this['channel'][_0x5582('0x2d')](_0x5a49c8,_0x5582('0x109'));}else{var _0x3ce0b3=parseInt(_0x5a49c8['trunk_id'],0xa);if(isNaN(_0x3ce0b3)){_0x5c8b5b=_0x5a49c8['trunk_id'];}else{_0x5c8b5b=this[_0x5582('0x1f')][_0x5582('0x6b')](this,_0x5a49c8['trunk_id']);if(!_0x5c8b5b){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5a49c8,_0x5582('0x10a'));}}}}else if(_0x5a49c8['trunk_name']){_0x5c8b5b=_0x5a49c8[_0x5582('0x10b')];}else{return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5a49c8,_0x5582('0x109'));}var _0x5f3c17=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0xe4'),[util[_0x5582('0x9d')](_0x5582('0x10c'),_0x5c8b5b,_0x5a49c8[_0x5582('0x47')]),_0x5a49c8[_0x5582('0x62')],_0x5a49c8['opts'],_0x5a49c8[_0x5582('0x6e')]]);if(_0x5f3c17[_0x5582('0xa5')]===-0x1){return _0x5f3c17;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('Executed\x20command\x20%s',_0x5582('0xe4')));};AGIVertices['prototype'][_0x5582('0x10d')]=function(_0x522abf){logger['info'](util[_0x5582('0x9d')](_0x5582('0x10e'),_0x522abf[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0xaa')]('finally');};AGIVertices[_0x5582('0x12')][_0x5582('0xe')]=function(_0x1ff130){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x10f'),_0x1ff130[_0x5582('0xa9')]));if(_0x1ff130[_0x5582('0x110')]===0x0){return this[_0x5582('0xa6')](_0x1ff130);}_0x1ff130[_0x5582('0x110')]-=0x1;if(!this[_0x5582('0x83')](_0x1ff130[_0x5582('0x111')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x1ff130,'no\x20file\x20audio\x20selected');}var _0x35c297=this[_0x5582('0x112')][_0x5582('0x6b')](this,_0x1ff130[_0x5582('0x111')]);if(!_0x35c297){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x1ff130,_0x5582('0x113'));}if(!this['isConfigured'](_0x1ff130[_0x5582('0xd9')])){return this[_0x5582('0x10')]['error'](_0x5582('0xd8'));}var _0x9b6624=this[_0x5582('0x10')][_0x5582('0x114')](_0x35c297,_0x1ff130[_0x5582('0x115')],_0x1ff130['maxdigit']);var _0x510d4d=_0x9b6624[_0x5582('0xa5')]?_0x9b6624[_0x5582('0xa5')][_0x5582('0x4c')]():'';logger[_0x5582('0x2f')](_0x5582('0x116'),JSON['stringify'](_0x9b6624));if(_0x9b6624[_0x5582('0xa5')]===-0x1){this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x1ff130,_0x510d4d);return _0x9b6624;}else if(_0x9b6624[_0x5582('0xa3')]===_0x5582('0x62')){_0x9b6624[_0x5582('0xa5')]=_0x510d4d[_0x5582('0x9b')]>=parseInt(_0x1ff130[_0x5582('0x117')])?'x':'i';}else{_0x9b6624[_0x5582('0xa5')]=_0x510d4d['length']>=parseInt(_0x1ff130[_0x5582('0x117')])&&_0x510d4d[_0x5582('0x9b')]<=parseInt(_0x1ff130[_0x5582('0x118')])?'x':'i';}var _0x1e93a9=this[_0x5582('0x13')]['sync'](this,_0x1ff130[_0x5582('0xd9')]);if(!_0x1e93a9){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x1ff130,_0x5582('0xda'));}this['channel']['setVariable'](_0x1e93a9,_0x510d4d);if(this[_0x5582('0x83')](_0x1ff130['hiddendigitsnum'])){var _0x25b1ab=parseInt(_0x1ff130[_0x5582('0x119')],0xa);var _0xc3acd7=rs['generate']({'charset':'*','length':_0x25b1ab});var _0x1143b1=_0x510d4d[_0x5582('0x9b')];if(_0x1143b1>0x0){if(_0x1143b1>_0x25b1ab){this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x1ff130,_0x1ff130[_0x5582('0x11a')]==='first'?_0xc3acd7+_0x510d4d[_0x5582('0x11b')](_0x25b1ab):_0x510d4d[_0x5582('0x11b')](0x0,_0x1143b1-_0x25b1ab)+_0xc3acd7);}else{this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x1ff130,rs[_0x5582('0x11c')]({'charset':'*','length':_0x1143b1}));}}else{this['createSquareDetailsReport']['sync'](this,_0x1ff130,'');}}else{this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x1ff130,_0x510d4d);}return _0x9b6624;};AGIVertices[_0x5582('0x12')][_0x5582('0xf')]=function(_0x37e35b){logger['info'](util[_0x5582('0x9d')](_0x5582('0x11d'),_0x37e35b[_0x5582('0xa9')]));return this[_0x5582('0xe')](_0x37e35b);};AGIVertices[_0x5582('0x12')]['goal']=function(_0x15ac21){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x11e'),_0x15ac21[_0x5582('0xa9')]));this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x15ac21,_0x15ac21[_0x5582('0x11f')]);return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('GOAL\x20%s',_0x15ac21['goalname']));};AGIVertices[_0x5582('0x12')]['awspolly']=function(_0x16b767){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x16b767['label']));if(!this['isConfigured'](_0x16b767[_0x5582('0x86')])||!this[_0x5582('0x83')](_0x16b767[_0x5582('0x87')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x16b767[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20text\x20configured');}this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x120'),_0x16b767[_0x5582('0x5a')]));var _0x1d73ba=this[_0x5582('0x85')][_0x5582('0x6b')](this,_0x16b767);if(_0x1d73ba){this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')]('aws\x20Polly\x20%s\x20file\x20created',_0x1d73ba));var _0x50e3f0=this[_0x5582('0x10')][_0x5582('0x121')](_0x1d73ba);try{fs[_0x5582('0x101')](_0x1d73ba+_0x5582('0x102'));}catch(_0x56480d){logger[_0x5582('0x2d')](_0x56480d);}return _0x50e3f0;}return this['channel'][_0x5582('0x2d')](_0x16b767,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x5582('0x12')][_0x5582('0x122')]=function(_0x2ce462){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x123'),_0x2ce462[_0x5582('0xa9')]));if(!this['isConfigured'](_0x2ce462[_0x5582('0x86')])||!this[_0x5582('0x83')](_0x2ce462[_0x5582('0x87')])){return this[_0x5582('0x10')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x5582('0x83')](_0x2ce462[_0x5582('0x8d')])){return this[_0x5582('0x10')][_0x5582('0xaa')]('no\x20bot\x20name\x20configured');}if(!this[_0x5582('0x83')](_0x2ce462[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xab'));}this[_0x5582('0x10')][_0x5582('0xe9')]=!![];this[_0x5582('0x37')](_0x2ce462);this[_0x5582('0x42')](_0x2ce462[_0x5582('0x5a')],'in','','');this[_0x5582('0x10')][_0x5582('0xaa')](util['format'](_0x5582('0x124'),_0x2ce462[_0x5582('0x5a')]));var _0x4820b1=this[_0x5582('0x8b')][_0x5582('0x6b')](this,_0x2ce462);if(_0x4820b1){for(var _0x48cfea in _0x4820b1){if(_0x4820b1[_0x5582('0x95')](_0x48cfea)&&_[_0x5582('0x96')](_0x4820b1[_0x48cfea])){this['channel'][_0x5582('0x9f')](util[_0x5582('0x9d')]('AWS_LEX_%s',_0x48cfea[_0x5582('0xec')]()),_0x4820b1[_0x48cfea]);}}if(_[_0x5582('0x45')](_0x4820b1[_0x5582('0x125')])){return this['channel']['noop'](_0x5582('0x126'));}else{this[_0x5582('0x42')](_0x4820b1[_0x5582('0x125')],_0x5582('0xee'),_0x5582('0x127'),'');return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('Amazon\x20Lex\x20Result\x20%s',_0x4820b1['message']));}}return this[_0x5582('0x10')][_0x5582('0x2d')](_0x2ce462,_0x5582('0x128'));};AGIVertices[_0x5582('0x12')][_0x5582('0x129')]=function(_0x11c18c){logger[_0x5582('0x2f')](util['format'](_0x5582('0x12a'),_0x11c18c[_0x5582('0xa9')],_0x11c18c[_0x5582('0x62')]));if(!this[_0x5582('0x83')](_0x11c18c[_0x5582('0x7f')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0x12b'));}var _0x41fcf2=_0x5582('0x12c');var _0x1dbfaf=util['format'](_0x5582('0x12d'),FILES_PATH,rs[_0x5582('0x11c')](0x4));var _0x50450a=util[_0x5582('0x9d')](_0x5582('0x9e'),_0x1dbfaf,_0x41fcf2);var _0x5f3126=!![];if(_0x11c18c[_0x5582('0x12e')]===_0x5582('0x12f')){_0x5f3126=![];}var _0x5d666b=this[_0x5582('0x10')][_0x5582('0x130')](_0x1dbfaf,_0x41fcf2,_0x11c18c[_0x5582('0x131')],_0x11c18c['timeout'],undefined,_0x5f3126);if(_0x5d666b[_0x5582('0xa5')]!==-0x1){this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x132'),_0x50450a));var _0x531c51=this[_0x5582('0x8e')]['sync'](this,_0x11c18c,_0x50450a);if(_0x531c51){for(var _0x57e383 in _0x531c51){if(_0x531c51['hasOwnProperty'](_0x57e383)){this[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0x133'),_0x57e383['toUpperCase']()),_0x531c51[_0x57e383]);}}return this[_0x5582('0x10')]['noop'](util[_0x5582('0x9d')](_0x5582('0x134'),JSON[_0x5582('0x70')](_0x531c51)));}}return _0x5d666b;};AGIVertices[_0x5582('0x12')][_0x5582('0x135')]=function(_0x169d67){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x136'),_0x169d67[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x169d67[_0x5582('0x91')])){return this['channel']['noop'](_0x5582('0x137'));}if(!this[_0x5582('0x83')](_0x169d67[_0x5582('0x92')])){return this['channel'][_0x5582('0xaa')](_0x5582('0x138'));}var _0x37dec4=_0x5582('0x12c');var _0x2c5a09=util[_0x5582('0x9d')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x1da1eb=util[_0x5582('0x9d')]('%s.%s',_0x2c5a09,_0x37dec4);var _0x16f521=!![];if(_0x169d67[_0x5582('0x12e')]===_0x5582('0x12f')){_0x16f521=![];}var _0x4ed146=this[_0x5582('0x10')][_0x5582('0x130')](_0x2c5a09,_0x37dec4,_0x169d67[_0x5582('0x131')],_0x169d67[_0x5582('0x62')],undefined,_0x16f521);if(_0x4ed146[_0x5582('0xa5')]!==-0x1){this[_0x5582('0x10')][_0x5582('0xaa')](util['format'](_0x5582('0x139'),_0x1da1eb));var _0x3b6013=this['tildeASR']['sync'](this,_0x169d67,_0x1da1eb);if(_0x3b6013){for(var _0x28dc9b in _0x3b6013){if(_0x3b6013[_0x5582('0x95')](_0x28dc9b)){this['channel'][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0x13a'),_0x28dc9b['toUpperCase']()),_0x3b6013[_0x28dc9b]);}}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x13b'),JSON[_0x5582('0x70')](_0x3b6013)));}}return _0x4ed146;};AGIVertices[_0x5582('0x12')][_0x5582('0x13c')]=function(_0x2fecd8){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x13d'),_0x2fecd8['label']));return this[_0x5582('0x10')]['continueAt'](_0x2fecd8['context'],_0x2fecd8['extension'],_0x2fecd8[_0x5582('0x3f')]);};AGIVertices[_0x5582('0x12')]['gotoif']=function(_0x994ea){logger['info'](util['format'](_0x5582('0x13e'),_0x994ea[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x994ea['condition'])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x994ea,'no\x20condition\x20configured');}try{var _0x595083=eval(_0x994ea[_0x5582('0x13f')])?_0x5582('0x140'):_0x5582('0x141');this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x142'),_0x994ea[_0x5582('0x13f')],_0x595083));return{'code':0xc8,'result':_0x595083};}catch(_0x39c7be){return{'code':0xc8,'result':_0x5582('0x141')};}};AGIVertices[_0x5582('0x12')]['gotoiftime']=function(_0x22a6b3){logger['info'](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x22a6b3['label']));if(!this[_0x5582('0x83')](_0x22a6b3[_0x5582('0x143')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x22a6b3,_0x5582('0x144'));}var _0x173559=this['getIntervals']['sync'](this,_0x22a6b3[_0x5582('0x143')]);if(!_0x173559){return this['channel'][_0x5582('0x2d')](_0x22a6b3,_0x5582('0x145'));}for(var _0x3d38dc=0x0;_0x3d38dc<_0x173559[_0x5582('0x9b')];_0x3d38dc+=0x1){var _0x47c4b8=this['channel'][_0x5582('0x13')](util[_0x5582('0x9d')](_0x5582('0x146'),_0x173559[_0x3d38dc]));if(_0x47c4b8[_0x5582('0xa5')]===-0x1){return _0x47c4b8;}logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x147'),_0x173559[_0x3d38dc],_0x47c4b8[_0x5582('0xa3')]));if(_0x47c4b8[_0x5582('0xa3')]==='true'){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x147'),_0x173559[_0x3d38dc],_0x5582('0x140')));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x147'),_0x173559[_0x3d38dc],_0x5582('0x140')));return{'code':0xc8,'result':_0x5582('0x140')};}else{logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x147'),_0x173559[_0x3d38dc],_0x5582('0x141')));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('IFTIME\x20%s\x20%s',_0x173559[_0x3d38dc],'false'));}}return{'code':0xc8,'result':_0x5582('0x141')};};AGIVertices[_0x5582('0x12')][_0x5582('0x148')]=function(_0x469eb9){logger[_0x5582('0x2f')](util['format'](_0x5582('0x149'),_0x469eb9[_0x5582('0xa9')]));return this[_0x5582('0x10')]['hangup']();};AGIVertices[_0x5582('0x12')][_0x5582('0x14a')]=function(_0x1d361d){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x14b'),_0x1d361d[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x1d361d[_0x5582('0x7f')])){return this[_0x5582('0x10')]['noop']('no\x20key\x20configured');}var _0x36b6f3=_0x5582('0x12c');var _0xe416da=util[_0x5582('0x9d')](_0x5582('0x12d'),FILES_PATH,rs[_0x5582('0x11c')](0x4));var _0x44d556=util['format'](_0x5582('0x9e'),_0xe416da,_0x36b6f3);var _0x2aabe4=!![];if(_0x1d361d[_0x5582('0x12e')]===_0x5582('0x12f')){_0x2aabe4=![];}var _0xfa00f6=this['channel'][_0x5582('0x130')](_0xe416da,_0x36b6f3,_0x1d361d['intKey'],_0x1d361d[_0x5582('0x62')],undefined,_0x2aabe4);if(_0xfa00f6[_0x5582('0xa5')]!==-0x1){this[_0x5582('0x10')]['noop'](util[_0x5582('0x9d')](_0x5582('0x14c'),_0x44d556));var _0x519ab7=this[_0x5582('0x82')][_0x5582('0x6b')](this,_0x1d361d,_0x44d556);if(_0x519ab7){for(var _0x4cec6e in _0x519ab7){if(_0x519ab7['hasOwnProperty'](_0x4cec6e)){this[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0x14d'),_0x4cec6e[_0x5582('0xec')]()),_0x519ab7[_0x4cec6e]);}}return this[_0x5582('0x10')]['noop'](util['format'](_0x5582('0x14e'),JSON[_0x5582('0x70')](_0x519ab7)));}}return _0xfa00f6;};AGIVertices['prototype'][_0x5582('0x14f')]=function(_0x344015){logger['info'](util[_0x5582('0x9d')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x344015['label']));if(!this[_0x5582('0x83')](_0x344015[_0x5582('0x7f')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0x12b'));}if(!this[_0x5582('0x83')](_0x344015['text'])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xab'));}this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('Trying\x20ispeech\x20TTS\x20%s',_0x344015[_0x5582('0x5a')]));var _0x1867a2=this[_0x5582('0x7e')][_0x5582('0x6b')](this,_0x344015);if(_0x1867a2){this['channel']['noop'](util['format'](_0x5582('0x14c'),_0x1867a2));var _0x1e25c2=this[_0x5582('0x10')][_0x5582('0x121')](_0x1867a2,_0x344015[_0x5582('0x131')]);try{fs[_0x5582('0x101')](_0x1867a2+_0x5582('0x102'));}catch(_0x2062c5){logger[_0x5582('0x2d')](_0x2062c5);}return _0x1e25c2;}return this[_0x5582('0x10')][_0x5582('0x2d')](_0x344015,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5582('0x12')][_0x5582('0x150')]=function(_0x33245b){logger[_0x5582('0x2f')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x33245b[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x33245b[_0x5582('0x151')])){return this[_0x5582('0x10')]['error'](_0x33245b,_0x5582('0x152'));}logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x153'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x33245b['findBy']));var _0x3f7937=this['agentLogin'][_0x5582('0x6b')](this,_0x33245b['findBy']);if(_0x3f7937){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5582('0x3a')],_0x33245b[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5582('0x10')]['callerid'],_0x33245b['findBy']));return{'code':0xc8,'result':_0x5582('0x154')};}else{logger['info'](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x33245b[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x33245b[_0x5582('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5582('0x12')]['logout']=function(_0x4a0fc1){logger[_0x5582('0x2f')](util['format'](_0x5582('0x156'),_0x4a0fc1[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x4a0fc1[_0x5582('0x151')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x4a0fc1,'no\x20find\x20by\x20configured');}logger['info'](util[_0x5582('0x9d')](_0x5582('0x153'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x4a0fc1['findBy']));var _0x465583=this[_0x5582('0x52')]['sync'](this,_0x4a0fc1[_0x5582('0x151')]);if(_0x465583){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5582('0x10')][_0x5582('0x3a')],_0x4a0fc1[_0x5582('0x151')]));this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x157'),this[_0x5582('0x10')]['callerid'],_0x4a0fc1[_0x5582('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5582('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5582('0x10')][_0x5582('0x3a')],_0x4a0fc1[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x4a0fc1['findBy']));return{'code':0xc8,'result':_0x5582('0x158')};}};AGIVertices[_0x5582('0x12')][_0x5582('0x159')]=function(_0x34678d){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x34678d[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x34678d['operation'])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x34678d,_0x5582('0x15a'));}this[_0x5582('0x10')]['noop'](util[_0x5582('0x9d')](_0x5582('0x15b'),_0x34678d[_0x5582('0x15c')]));var _0xb71fbf=eval(_0x34678d['operation']);if(!this['isConfigured'](_0x34678d['variable_id'])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xd8'));}var _0xc6f61e=this[_0x5582('0x13')][_0x5582('0x6b')](this,_0x34678d[_0x5582('0xd9')]);if(!_0xc6f61e){return this['channel'][_0x5582('0x2d')](_0x34678d,'no\x20variable\x20found');}if(_[_0x5582('0x9a')](_0xb71fbf)){var _0x59f8e3=this;_0xb71fbf[_0x5582('0xdb')](function(_0x326e91,_0x4d94ac){_0x59f8e3[_0x5582('0x10')][_0x5582('0x9f')](util[_0x5582('0x9d')]('%s[%s]',_0xc6f61e,_0x4d94ac),_0x326e91);});return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x15d'),_0xc6f61e));}else{return this[_0x5582('0x10')][_0x5582('0x9f')](_0xc6f61e,_0xb71fbf);}};AGIVertices['prototype'][_0x5582('0xd')]=function(_0x149240){logger[_0x5582('0x2f')](util['format'](_0x5582('0x15e'),_0x149240['label']));if(_0x149240[_0x5582('0x110')]===0x0){return this['maxRetry'](_0x149240);}_0x149240[_0x5582('0x110')]-=0x1;if(!this[_0x5582('0x83')](_0x149240[_0x5582('0x111')])){return this['channel'][_0x5582('0x2d')](_0x149240,'no\x20file\x20audio\x20selected');}var _0x3c3285=this[_0x5582('0x112')][_0x5582('0x6b')](this,_0x149240[_0x5582('0x111')]);if(!_0x3c3285){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x149240,'no\x20file\x20audio\x20found');}var _0x1b6bb9=this[_0x5582('0x10')]['getData'](_0x3c3285,_0x149240[_0x5582('0x115')],_0x149240[_0x5582('0x15f')]);var _0x1f3e17=_0x1b6bb9['result'];if(_0x1b6bb9[_0x5582('0xa5')]===-0x1){this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x149240,'-1');return _0x1b6bb9;}else if(_0x1b6bb9[_0x5582('0xa3')]===_0x5582('0x62')){_0x1b6bb9[_0x5582('0xa5')]=_0x1b6bb9['result']['length']>0x0?_0x1b6bb9[_0x5582('0xa5')]:'t';}else if(_[_0x5582('0x44')](_0x1b6bb9['result'])){_0x1b6bb9[_0x5582('0xa5')]='#';_0x1f3e17='#';}if(!this['isConfigured'](_0x149240[_0x5582('0xd9')])){this['channel'][_0x5582('0xaa')](_0x5582('0xd8'));}else{var _0x128c55=this[_0x5582('0x13')]['sync'](this,_0x149240[_0x5582('0xd9')]);if(!_0x128c55){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x149240,_0x5582('0xda'));}this[_0x5582('0x10')]['setVariable'](_0x128c55,_0x1f3e17);}this[_0x5582('0x37')]['sync'](this,_0x149240,_0x1f3e17);return _0x1b6bb9;};AGIVertices[_0x5582('0x12')][_0x5582('0xaa')]=function(_0x2d1bf3){logger['info'](util[_0x5582('0x9d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2d1bf3['label']));return this[_0x5582('0x10')][_0x5582('0xaa')](_0x2d1bf3[_0x5582('0x160')]||_0x2d1bf3[_0x5582('0xa9')]);};AGIVertices[_0x5582('0x12')]['pause']=function(_0x59737c){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x161'),_0x59737c[_0x5582('0xa9')]));if(!this['isConfigured'](_0x59737c[_0x5582('0x151')])){return this[_0x5582('0x10')]['error'](_0x59737c,'no\x20find\x20by\x20configured');}logger[_0x5582('0x2f')](util['format'](_0x5582('0x153'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x59737c[_0x5582('0x151')]));var _0xefb67f=this[_0x5582('0x4d')][_0x5582('0x6b')](this,_0x59737c[_0x5582('0x162')]);var _0x1f73db=this['agentPause'][_0x5582('0x6b')](this,_0x59737c[_0x5582('0x151')],_0xefb67f);if(_0x1f73db){logger[_0x5582('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5582('0x3a')],_0x59737c[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x157'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x59737c[_0x5582('0x151')]));return{'code':0xc8,'result':_0x5582('0x154')};}else{logger['info'](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x59737c[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5582('0x10')][_0x5582('0x3a')],_0x59737c[_0x5582('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5582('0x12')]['playback']=function(_0x5c9a63){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5c9a63[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x5c9a63['file_id'])){return this[_0x5582('0x10')]['error'](_0x5c9a63,_0x5582('0x163'));}var _0x31a381=this[_0x5582('0x112')][_0x5582('0x6b')](this,_0x5c9a63[_0x5582('0x111')]);if(!_0x31a381){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x5c9a63,_0x5582('0x113'));}var _0x46d3fb=this['channel'][_0x5582('0x55')](_0x5582('0x164'),[_0x31a381,_0x5c9a63[_0x5582('0xe5')]]);if(_0x46d3fb[_0x5582('0xa5')]===-0x1){return _0x46d3fb;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x31a381));};AGIVertices[_0x5582('0x12')][_0x5582('0x165')]=function(_0x43ba09){logger[_0x5582('0x2f')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x43ba09[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x43ba09[_0x5582('0x166')])){return this['channel'][_0x5582('0x2d')](_0x43ba09,_0x5582('0x167'));}var _0x1983a0='';var _0x17aa25=parseInt(_0x43ba09[_0x5582('0x166')],0xa);if(isNaN(_0x17aa25)){_0x1983a0=_0x43ba09['queue_id'];}else{_0x1983a0=this['getVoiceQueue'][_0x5582('0x6b')](this,_0x43ba09['queue_id']);if(!_0x1983a0){return this['channel'][_0x5582('0x2d')](_0x43ba09,'no\x20queue\x20found');}}var _0x15aea6='';if(this[_0x5582('0x83')](_0x43ba09['file_id'])){var _0x31abc6=this[_0x5582('0x112')][_0x5582('0x6b')](this,_0x43ba09[_0x5582('0x111')]);if(_0x31abc6){_0x15aea6=_0x31abc6;}}this[_0x5582('0x37')]['sync'](this,_0x43ba09,_0x1983a0);if(_0x43ba09[_0x5582('0xe5')][_0x5582('0x168')]('x')<0x0){_0x43ba09[_0x5582('0xe5')]+='x';}if(_0x43ba09[_0x5582('0xe5')][_0x5582('0x168')]('X')<0x0){_0x43ba09[_0x5582('0xe5')]+='X';}this[_0x5582('0x10')]['setVariable'](_0x5582('0x169'),_0x1983a0?_0x1983a0[_0x5582('0x16a')]():'');var _0x510c8c=this[_0x5582('0x10')][_0x5582('0x55')](_0x5582('0x16b'),[_0x1983a0,_0x43ba09[_0x5582('0xe5')],_0x43ba09[_0x5582('0x6e')],_0x15aea6,_0x43ba09[_0x5582('0x62')],_0x43ba09[_0x5582('0x7')],_0x43ba09[_0x5582('0x16c')],_0x43ba09[_0x5582('0x16d')],'',_0x43ba09[_0x5582('0x16e')]]);if(_0x510c8c[_0x5582('0xa5')]===-0x1){return _0x510c8c;}return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x16f'),_0x5582('0x16b'),_0x1983a0));};AGIVertices['prototype'][_0x5582('0x170')]=function(_0x530a61){logger['info'](util['format'](_0x5582('0x171'),_0x530a61['label']));var _0x5f5046=_0x530a61[_0x5582('0x172')]||_0x5582('0x12c');var _0x16cb2e=util[_0x5582('0x9d')](_0x5582('0x173'),this[_0x5582('0x10')][_0x5582('0x38')],rs[_0x5582('0x11c')](0x5));var _0x41082a=util[_0x5582('0x9d')]('%s/recordings/%s.%s',FILES_PATH,_0x16cb2e,_0x5f5046);var _0x31f375=util[_0x5582('0x9d')](_0x5582('0x12d'),FILES_PATH,_0x16cb2e);this[_0x5582('0x3b')][_0x5582('0x6b')](this,_0x530a61,_0x16cb2e,_0x41082a);this[_0x5582('0x10')][_0x5582('0x9f')](_0x5582('0x174'),_0x16cb2e);logger['info'](_0x5582('0x175'),_0x31f375,_0x5f5046,_0x530a61[_0x5582('0x176')],_0x530a61[_0x5582('0x62')]);return this[_0x5582('0x10')][_0x5582('0x130')](_0x31f375,_0x5f5046,_0x530a61[_0x5582('0x176')],_0x530a61[_0x5582('0x62')],undefined,!![]);};AGIVertices[_0x5582('0x12')][_0x5582('0x177')]=function(_0x1d01ca){logger[_0x5582('0x2f')](util['format'](_0x5582('0x178'),_0x1d01ca[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x1d01ca[_0x5582('0x6e')])){return this['channel'][_0x5582('0xaa')](_0x5582('0x179'));}var _0x44c9ca=this[_0x5582('0x17a')][_0x5582('0x6b')](this,_0x1d01ca);logger['info'](util[_0x5582('0x9d')]('Response:',util[_0x5582('0x17b')](_0x44c9ca,{'showHidden':![],'depth':null})));if(!this[_0x5582('0x83')](_0x1d01ca['variable_id'])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0x17c'));}var _0x401886=this['getVariable'][_0x5582('0x6b')](this,_0x1d01ca[_0x5582('0xd9')]);if(!_0x401886){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x1d01ca,'no\x20variable\x20found');}this['channel'][_0x5582('0x9f')](util[_0x5582('0x9d')](_0x5582('0x17d'),_0x401886),_0x44c9ca[_0x5582('0x72')]?_0x44c9ca[_0x5582('0x72')]:_0x5582('0x17e'));this[_0x5582('0x10')]['setVariable'](util[_0x5582('0x9d')](_0x5582('0x17f'),_0x401886),_0x44c9ca[_0x5582('0x73')]?_0x44c9ca[_0x5582('0x73')]:'OK');if(_0x44c9ca[_0x5582('0x65')]){try{this[_0x5582('0x9c')](_0x44c9ca[_0x5582('0x65')],_0x401886);}catch(_0x5c8d8f){logger[_0x5582('0x2d')](util[_0x5582('0x9d')](_0x5582('0x180'),_0x401886));}}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0xdf'),_0x401886));};AGIVertices[_0x5582('0x12')]['saydigits']=function(_0x3ff8c3){logger[_0x5582('0x2f')](util['format'](_0x5582('0x181'),_0x3ff8c3[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0x182')](_0x3ff8c3['digits'][_0x5582('0x56')](/\s+/g,''),_0x3ff8c3[_0x5582('0x176')]);};AGIVertices[_0x5582('0x12')][_0x5582('0x183')]=function(_0x63b228){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x184'),_0x63b228[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0x185')](_0x63b228[_0x5582('0x63')][_0x5582('0x56')](/\s+/g,''),_0x63b228[_0x5582('0x176')]);};AGIVertices[_0x5582('0x12')][_0x5582('0x186')]=function(_0x9cf4d5){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x9cf4d5[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0x187')](_0x9cf4d5[_0x5582('0x5a')],_0x9cf4d5[_0x5582('0x176')]);};AGIVertices[_0x5582('0x12')]['sendMail']=function(_0x2f544c){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x188'),_0x2f544c[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x2f544c[_0x5582('0x189')])){return this['channel']['noop']('no\x20mail\x20account\x20configured');}var _0x29a245=this[_0x5582('0x24')]['sync'](this,_0x2f544c['account_id']);if(!_0x29a245||!_0x29a245[_0x5582('0x18a')]){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x2f544c,'no\x20mail\x20account\x20found');}var _0x12fe58={'from':util[_0x5582('0x9d')](_0x5582('0x18b'),_0x29a245[_0x5582('0x17')],_0x29a245[_0x5582('0x18c')]||_0x29a245[_0x5582('0x18a')][_0x5582('0x18d')]),'to':_0x2f544c['to']||'','cc':_0x2f544c['cc']||'','bcc':_0x2f544c[_0x5582('0x18e')]||'','subject':_0x2f544c['subject'],'html':_0x2f544c[_0x5582('0x5a')],'text':_0x2f544c[_0x5582('0x5a')]};if(this['isConfigured'](_0x2f544c[_0x5582('0x18f')])){}logger[_0x5582('0x190')](_0x5582('0x191'),JSON[_0x5582('0x70')](_0x12fe58));this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x2f544c,_0x2f544c[_0x5582('0x189')]);this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x192'),_0x29a245['name']));this['sendMailMessage'][_0x5582('0x6b')](this,_0x29a245[_0x5582('0x193')],_0x12fe58);return this['channel'][_0x5582('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5582('0x12')][_0x5582('0x194')]=function(_0x459f2c){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x195'),_0x459f2c[_0x5582('0xa9')]));return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0x196'));};AGIVertices[_0x5582('0x12')]['sendSMS']=function(_0x56ad9e){logger['info'](util['format'](_0x5582('0x197'),_0x56ad9e[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x56ad9e['sms_account_id'])){return this['channel'][_0x5582('0xaa')](_0x5582('0x198'));}var _0x514ee4=this['getSmsAccount']['sync'](this,_0x56ad9e['sms_account_id']);if(!_0x514ee4){return this['channel'][_0x5582('0x2d')](_0x56ad9e,_0x5582('0x199'));}var _0x551757={'body':_0x56ad9e['sms_text'],'phone':_0x56ad9e['to']||'','SmsAccountId':_0x514ee4['id']};logger[_0x5582('0x190')](_0x5582('0x19a'),JSON[_0x5582('0x70')](_0x551757));this[_0x5582('0x37')]['sync'](this,_0x56ad9e,_0x56ad9e[_0x5582('0x19b')]);this[_0x5582('0x10')]['noop'](util[_0x5582('0x9d')](_0x5582('0x19c'),_0x514ee4['name']));this[_0x5582('0x19d')][_0x5582('0x6b')](this,_0x551757);return this[_0x5582('0x10')][_0x5582('0xaa')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5582('0x12')]['set']=function(_0x4992ca){logger[_0x5582('0x2f')](util['format'](_0x5582('0x19e'),_0x4992ca[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x4992ca[_0x5582('0xd9')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x4992ca,_0x5582('0x19f'));}var _0x1c3110=this[_0x5582('0x13')][_0x5582('0x6b')](this,_0x4992ca[_0x5582('0xd9')]);if(!_0x1c3110){return this[_0x5582('0x10')]['error'](_0x4992ca,_0x5582('0xda'));}return this['channel'][_0x5582('0x9f')](_0x1c3110,_0x4992ca[_0x5582('0x1a0')]);};AGIVertices[_0x5582('0x12')][_0x5582('0x1a1')]=function(_0x126be5){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x1a2'),_0x126be5[_0x5582('0xa9')]));this['channel'][_0x5582('0xaa')](_0x5582('0x1a3'));if(_0x126be5[_0x5582('0xb9')]===_0x5582('0x1a4')){this[_0x5582('0x10')]['noop'](_0x5582('0x1a5'));return this[_0x5582('0x10')][_0x5582('0xb9')]();}return this['channel'][_0x5582('0xaa')](_0x5582('0x1a6'));};AGIVertices['prototype'][_0x5582('0x1a7')]=function(_0x330ea6){logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x330ea6[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x330ea6[_0x5582('0x1a8')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x330ea6,_0x5582('0x1a9'));}var _0x1b8bf0=this[_0x5582('0x19')][_0x5582('0x6b')](this,_0x330ea6[_0x5582('0x1a8')]);if(!this['isConfigured'](_0x1b8bf0)){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x330ea6,util[_0x5582('0x9d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x330ea6[_0x5582('0x1a8')]));}if(_0x1b8bf0===this[_0x5582('0x10')]['arg_1']){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x330ea6,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x330ea6,_0x1b8bf0);var _0x5d7edf=this[_0x5582('0x10')][_0x5582('0x55')]('AGI',util[_0x5582('0x9d')](_0x5582('0x1aa'),config[_0x5582('0x7')][_0x5582('0x1ab')]||_0x5582('0x1ac'),_0x1b8bf0,this[_0x5582('0x10')]['arg_1']));if(_0x5d7edf[_0x5582('0xa5')]===-0x1){return _0x5d7edf;}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x16f'),'AGI',_0x1b8bf0));};AGIVertices[_0x5582('0x12')][_0x5582('0x1ad')]=function(_0x1d6d22){logger['info'](util['format'](_0x5582('0x1ae'),_0x1d6d22[_0x5582('0xa9')]));var _0x19fe66=this[_0x5582('0x1af')][_0x5582('0x6b')](this,_0x1d6d22[_0x5582('0xb7')]);this[_0x5582('0x37')][_0x5582('0x6b')](this,_0x1d6d22,_0x1d6d22[_0x5582('0xb7')]);if(this['isConfigured'](_0x1d6d22[_0x5582('0xd9')])){var _0x35fdc7=this[_0x5582('0x13')]['sync'](this,_0x1d6d22[_0x5582('0xd9')]);if(_0x35fdc7){this['channel'][_0x5582('0x9f')](_0x35fdc7,_0x19fe66);return this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x1b0'),_0x1d6d22['command'],_0x35fdc7));}}return this['channel']['noop'](util['format'](_0x5582('0x1b1'),_0x1d6d22[_0x5582('0xb7')]));};AGIVertices[_0x5582('0x12')][_0x5582('0x1b2')]=function(_0x2931c4){logger['info'](util[_0x5582('0x9d')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2931c4[_0x5582('0xa9')]));_0x2931c4[_0x5582('0x5a')]=_0x2931c4[_0x5582('0x5a')][_0x5582('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5582('0x83')](_0x2931c4[_0x5582('0x58')])){return this['channel'][_0x5582('0xaa')](_0x5582('0x1b3'));}if(!this[_0x5582('0x83')](_0x2931c4[_0x5582('0x5a')])){return this[_0x5582('0x10')]['noop'](_0x5582('0xab'));}this[_0x5582('0x10')]['noop'](util['format'](_0x5582('0x1b4'),_0x2931c4[_0x5582('0x5a')]));var _0x5307ca=this[_0x5582('0x57')][_0x5582('0x6b')](this,_0x2931c4);if(_0x5307ca){this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x1b5'),_0x5307ca));var _0x162491=this[_0x5582('0x10')][_0x5582('0x121')](_0x5307ca);try{fs[_0x5582('0x101')](_0x5307ca+'.wav');}catch(_0x553724){logger[_0x5582('0x2d')](_0x553724);}return _0x162491;}return this[_0x5582('0x10')]['error'](_0x2931c4,_0x5582('0x1b6'));};AGIVertices[_0x5582('0x12')][_0x5582('0x1b7')]=function(_0x16bcf9){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x1b8'),_0x16bcf9[_0x5582('0xa9')]));_0x16bcf9[_0x5582('0x5a')]=_0x16bcf9[_0x5582('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5582('0x83')](_0x16bcf9[_0x5582('0x5a')])){return this[_0x5582('0x10')][_0x5582('0xaa')](_0x5582('0xab'));}this[_0x5582('0x10')][_0x5582('0xaa')](util['format'](_0x5582('0x1b9'),_0x16bcf9[_0x5582('0x5a')]));var _0x15a693=this[_0x5582('0x60')][_0x5582('0x6b')](this,_0x16bcf9);if(_0x15a693){this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x1ba'),_0x15a693));var _0x21b015=this[_0x5582('0x10')]['streamFile'](_0x15a693);try{fs[_0x5582('0x101')](_0x15a693+'.wav');}catch(_0x39aab7){logger[_0x5582('0x2d')](_0x39aab7);}return _0x21b015;}return this['channel'][_0x5582('0x2d')](_0x16bcf9,_0x5582('0x1bb'));};AGIVertices[_0x5582('0x12')][_0x5582('0x1bc')]=function(_0x43e6a4){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x1bd'),_0x43e6a4['label']));if(!this['isConfigured'](_0x43e6a4[_0x5582('0x151')])){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x43e6a4,_0x5582('0x152'));}logger[_0x5582('0x2f')](util[_0x5582('0x9d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5582('0x10')][_0x5582('0x3a')],_0x43e6a4[_0x5582('0x151')]));var _0xd7dc23=this[_0x5582('0x50')][_0x5582('0x6b')](this,_0x43e6a4['findBy']);if(_0xd7dc23){logger[_0x5582('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5582('0x10')][_0x5582('0x3a')],_0x43e6a4[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5582('0x3a')],_0x43e6a4[_0x5582('0x151')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x43e6a4[_0x5582('0x151')]));this[_0x5582('0x10')][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x155'),this[_0x5582('0x10')][_0x5582('0x3a')],_0x43e6a4[_0x5582('0x151')]));return{'code':0xc8,'result':_0x5582('0x158')};}};AGIVertices[_0x5582('0x12')]['voicemail']=function(_0x18a3d6){logger[_0x5582('0x2f')](util[_0x5582('0x9d')](_0x5582('0x1be'),_0x18a3d6['label']));var _0x51afb4=this['channel'][_0x5582('0x55')]('VOICEMAIL',[_0x18a3d6[_0x5582('0x1bf')],_0x18a3d6[_0x5582('0x75')]]);if(_0x51afb4[_0x5582('0xa5')]===-0x1){return _0x51afb4;}return this['channel'][_0x5582('0xaa')](util[_0x5582('0x9d')](_0x5582('0x16f'),_0x5582('0x1c0'),_0x18a3d6[_0x5582('0x1bf')]));};AGIVertices[_0x5582('0x12')][_0x5582('0x1c1')]=function(_0x683ce3){logger['info'](util['format'](_0x5582('0x1c2'),_0x683ce3[_0x5582('0xa9')]));if(!this[_0x5582('0x83')](_0x683ce3[_0x5582('0xd9')])){return this['channel'][_0x5582('0x2d')](_0x683ce3,_0x5582('0x19f'));}var _0x5bbd32=this[_0x5582('0x13')][_0x5582('0x6b')](this,_0x683ce3['variable_id']);if(!_0x5bbd32){return this[_0x5582('0x10')][_0x5582('0x2d')](_0x683ce3,_0x5582('0xda'));}var _0xe90426=this['channel']['getVariable'](_0x5bbd32);return{'code':0xc8,'result':_0xe90426[_0x5582('0xa3')]?_0xe90426[_0x5582('0xa3')]:'-'};};String[_0x5582('0x12')][_0x5582('0xa2')]=function(_0x2d884e,_0x1e5a0e){return this[_0x5582('0xa1')](_0x2d884e)['join'](_0x1e5a0e);};module[_0x5582('0x1c3')]=AGIVertices; \ No newline at end of file +var _0x5a1c=['getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','save_name','getMailAccount','sendMailMessage','IntervalId','map','Intervals','interval','getSoundPath','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agentUnpause','agentLogout','agent','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','key','appid','appsecret','clear','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','getVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','%s/recordings/%s','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','tildeASR','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','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','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','util','lodash','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','then','name','catch','getSquareProject'];(function(_0x356f83,_0x4b6fa7){var _0x35d5c9=function(_0xd110c0){while(--_0xd110c0){_0x356f83['push'](_0x356f83['shift']());}};_0x35d5c9(++_0x4b6fa7);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x2bc780,_0x32a247){_0x2bc780=_0x2bc780-0x0;var _0x42f7b5=_0x5a1c[_0x2bc780];return _0x42f7b5;};'use strict';var fs=require('fs');var util=require(_0xc5a1('0x0'));var _=require(_0xc5a1('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0xc5a1('0x2'));var moment=require('moment');var Mustache=require(_0xc5a1('0x3'));var rp=require(_0xc5a1('0x4'));var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var shared=require(_0xc5a1('0x7'));var scripts=require(_0xc5a1('0x8'));var FILES_PATH=_0xc5a1('0x9');var recursiveMapAttributes=['rawHeaders',_0xc5a1('0xa')];var verticesWithRetry=[_0xc5a1('0xb'),_0xc5a1('0xc'),_0xc5a1('0xd')];var AGIVertices=function(_0x42b181,_0x54a2de,_0x28234b){this[_0xc5a1('0xe')]=_0x42b181;this[_0xc5a1('0xf')]=_0x54a2de;this[_0xc5a1('0x10')]=_0x28234b;};AGIVertices[_0xc5a1('0x11')]['getVariable']=function(_0x15fc14,_0x460c4e){this['rpc']['getVariableById'](_0x15fc14)[_0xc5a1('0x12')](function(_0x514744){_0x460c4e(null,_0x514744?_0x514744[_0xc5a1('0x13')]:![]);})[_0xc5a1('0x14')](function(_0x37b863){_0x460c4e(_0x37b863);});};AGIVertices[_0xc5a1('0x11')]['getVoiceQueue']=function(_0x380147,_0x4b8056){this[_0xc5a1('0xf')]['getVoiceQueueById'](_0x380147)[_0xc5a1('0x12')](function(_0xf0a6a9){_0x4b8056(null,_0xf0a6a9?_0xf0a6a9[_0xc5a1('0x13')]:![]);})[_0xc5a1('0x14')](function(_0x3e99b5){_0x4b8056(_0x3e99b5);});};AGIVertices['prototype'][_0xc5a1('0x15')]=function(_0x2d1d2f,_0x1a8e41){this[_0xc5a1('0xf')][_0xc5a1('0x16')](_0x2d1d2f)[_0xc5a1('0x12')](function(_0x174693){_0x1a8e41(null,_0x174693?_0x174693['name']:![]);})[_0xc5a1('0x14')](function(_0x2742f0){_0x1a8e41(_0x2742f0);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x17')]=function(_0x5f1409,_0x40815e){this[_0xc5a1('0xf')][_0xc5a1('0x18')](_0x5f1409)[_0xc5a1('0x12')](function(_0x13d8e6){_0x40815e(null,_0x13d8e6?_0x13d8e6[_0xc5a1('0x19')]:![]);})[_0xc5a1('0x14')](function(_0x1bde6c){_0x40815e(_0x1bde6c);});};AGIVertices['prototype'][_0xc5a1('0x1a')]=function(_0x578788,_0x4137e6){this[_0xc5a1('0xf')]['getUserById'](_0x578788)[_0xc5a1('0x12')](function(_0x2085fa){_0x4137e6(null,_0x2085fa?_0x2085fa['name']:![]);})['catch'](function(_0xc726f7){_0x4137e6(_0xc726f7);});};AGIVertices[_0xc5a1('0x11')]['getTrunk']=function(_0x9168e2,_0x4b9c67){this[_0xc5a1('0xf')][_0xc5a1('0x1b')](_0x9168e2)[_0xc5a1('0x12')](function(_0xfad798){_0x4b9c67(null,_0xfad798?_0xfad798[_0xc5a1('0x13')]:![]);})[_0xc5a1('0x14')](function(_0x29e7cf){_0x4b9c67(_0x29e7cf);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1c')]=function(_0x3eec16,_0x411aac){var _0x48ac66=this;this[_0xc5a1('0xf')][_0xc5a1('0x1d')](_0x3eec16)['then'](function(_0x3671cd){_0x411aac(null,_0x3671cd?_0x48ac66['getSoundPath'](_0x3671cd[_0xc5a1('0x1e')]):![]);})['catch'](function(_0x40ae05){_0x411aac(_0x40ae05);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1f')]=function(_0x3151d9,_0x1bf164){this[_0xc5a1('0xf')]['getMailAccountById'](_0x3151d9)[_0xc5a1('0x12')](function(_0x542508){_0x1bf164(null,_0x542508?_0x542508:![]);})['catch'](function(_0x4768ed){_0x1bf164(_0x4768ed);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x20')]=function(_0x153ab1,_0x517200,_0x371b25){this['mailRpc'][_0xc5a1('0x20')](_0x153ab1,_0x517200)['then'](function(){_0x371b25(null);})[_0xc5a1('0x14')](function(_0x2178ff){_0x371b25(_0x2178ff);});};AGIVertices[_0xc5a1('0x11')]['getIntervals']=function(_0xd5c649,_0x430654){this[_0xc5a1('0xf')]['getIntervalById'](_0xd5c649)[_0xc5a1('0x12')](function(_0x5c2a2c){if(_0x5c2a2c){if(_0x5c2a2c[_0xc5a1('0x21')]){_0x430654(null,[_0x5c2a2c['interval']]);}else{_0x430654(null,_[_0xc5a1('0x22')](_0x5c2a2c[_0xc5a1('0x23')],_0xc5a1('0x24')));}}else{_0x430654(null,![]);}})[_0xc5a1('0x14')](function(_0x441a52){_0x430654(_0x441a52);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x25')]=function(_0x14327e){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x14327e);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x26')]=function(_0x3def61,_0x299caf,_0x4fd625){odbc[_0xc5a1('0x27')](_0x3def61,function(_0x284cab){if(_0x284cab){logger[_0xc5a1('0x28')](_0xc5a1('0x29'),_0x284cab);_0x4fd625(_0x284cab);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xc5a1('0x2a')](_0x299caf,function(_0x564171,_0x567c95){if(_0x564171){logger[_0xc5a1('0x2b')](_0xc5a1('0x2c'),_0x299caf);_0x4fd625(_0x564171);}else{logger[_0xc5a1('0x2b')](_0xc5a1('0x2d'),_0x299caf);odbc[_0xc5a1('0x2e')](function(_0x3dc458){if(_0x3dc458){logger['error'](_0xc5a1('0x2f'),_0x3dc458);}_0x4fd625(null,_0x567c95);});}});}});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x30')]=function(_0x3d18c3,_0x5d7b57){this['rpc'][_0xc5a1('0x31')](_0x3d18c3)[_0xc5a1('0x12')](function(_0x14a91f){_0x5d7b57(null,_0x14a91f?_0x14a91f:![]);})[_0xc5a1('0x14')](function(_0x4ff059){_0x5d7b57(_0x4ff059);});};AGIVertices['prototype'][_0xc5a1('0x32')]=function(_0x591e25,_0x15005a){this[_0xc5a1('0xf')][_0xc5a1('0x32')](_0x591e25)['then'](function(_0x5cd707){_0x15005a(null,_0x5cd707);})[_0xc5a1('0x14')](function(_0x1fb5ca){_0x15005a(_0x1fb5ca);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x33')]=function(_0x4309f4,_0x40b37a,_0x1aca42){this[_0xc5a1('0xf')][_0xc5a1('0x33')]({'uniqueid':this[_0xc5a1('0xe')][_0xc5a1('0x34')],'node':_0x4309f4[_0xc5a1('0x35')],'application':_0x4309f4['agicommand'],'data':_0x40b37a||null,'project_name':this['channel'][_0xc5a1('0x36')],'callerid':this[_0xc5a1('0xe')]['callerid']})[_0xc5a1('0x12')](function(_0x5e6df6){if(_0x1aca42){_0x1aca42(null,_0x5e6df6);}})['catch'](function(_0x145fe3){if(_0x1aca42){_0x1aca42(_0x145fe3);}});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x37')]=function(_0x3074b5,_0x3db41d,_0x5f3cea,_0x1e9216){this[_0xc5a1('0xf')][_0xc5a1('0x37')]({'uniqueid':this[_0xc5a1('0xe')][_0xc5a1('0x34')],'callerid':this[_0xc5a1('0xe')][_0xc5a1('0x38')],'calleridname':this['channel'][_0xc5a1('0x39')],'context':this['channel'][_0xc5a1('0x3a')],'extension':this[_0xc5a1('0xe')][_0xc5a1('0x3b')],'priority':this[_0xc5a1('0xe')][_0xc5a1('0x3c')],'accountcode':this[_0xc5a1('0xe')][_0xc5a1('0x3d')],'dnid':this[_0xc5a1('0xe')][_0xc5a1('0x3e')],'projectName':this[_0xc5a1('0xe')][_0xc5a1('0x36')],'saveName':_0x3db41d,'filename':_0x3074b5['file']||_0x3db41d,'savePath':_0x5f3cea})['then'](function(_0x456b78){_0x1e9216(null,_0x456b78);})['catch'](function(_0x566305){_0x1e9216(_0x566305);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x3f')]=function(_0x34488a,_0x3eaff7,_0x31538d,_0x305b11,_0x36e82b){this[_0xc5a1('0xf')][_0xc5a1('0x3f')]({'uniqueid':this['channel'][_0xc5a1('0x34')],'body':_0x34488a,'direction':_0x3eaff7,'providerName':_0x31538d,'providerResponse':_0x305b11})['then'](function(_0x2a6b47){if(_0x36e82b){_0x36e82b(null,_0x2a6b47);}})['catch'](function(_0x5018fc){if(_0x36e82b){_0x36e82b(_0x5018fc);}});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x40')]=function(_0x3cc7f9,_0x1f96ee){this['rpc']['createCmContact']({'firstName':_[_0xc5a1('0x41')](_0x3cc7f9['name'])||_[_0xc5a1('0x42')](_0x3cc7f9['name'])?'callback_'+Math[_0xc5a1('0x43')]():_0x3cc7f9[_0xc5a1('0x13')],'lastName':_['isEmpty'](_0x3cc7f9[_0xc5a1('0x44')])||_[_0xc5a1('0x42')](_0x3cc7f9['lastName'])?null:_0x3cc7f9[_0xc5a1('0x44')],'phone':_0x3cc7f9[_0xc5a1('0x45')],'ListId':_0x3cc7f9[_0xc5a1('0x46')],'scheduledat':_0x3cc7f9[_0xc5a1('0x47')],'callbackUniqueid':this[_0xc5a1('0xe')][_0xc5a1('0x34')],'tags':_0xc5a1('0x48'),'description':_0xc5a1('0x49')+_0x3cc7f9[_0xc5a1('0x47')][_0xc5a1('0x4a')](),'priority':_0x3cc7f9[_0xc5a1('0x4b')]})[_0xc5a1('0x12')](function(_0x21a3cf){_0x1f96ee(null,_0x21a3cf);})[_0xc5a1('0x14')](function(_0x1791c0){_0x1f96ee(_0x1791c0);});};AGIVertices[_0xc5a1('0x11')]['getPause']=function(_0x29e3f7,_0x4260e7){this['rpc']['getPauseById'](_0x29e3f7)[_0xc5a1('0x12')](function(_0x10748f){_0x4260e7(null,_0x10748f?_0x10748f[_0xc5a1('0x13')]:![]);})['catch'](function(_0x35e64e){_0x4260e7(_0x35e64e);});};AGIVertices[_0xc5a1('0x11')]['agentPause']=function(_0x495a04,_0x5cadc4,_0x52028b){var _0x3f90fb={'role':'agent'};_0x3f90fb[_0x495a04]=this[_0xc5a1('0xe')][_0xc5a1('0x38')];this[_0xc5a1('0xf')][_0xc5a1('0x4c')](_0x3f90fb,_0x5cadc4,this['channel'][_0xc5a1('0x34')])[_0xc5a1('0x12')](function(_0x27b1a1){_0x52028b(null,_[_0xc5a1('0x42')](_0x27b1a1)?![]:!![]);})[_0xc5a1('0x14')](function(_0x4bc556){logger[_0xc5a1('0x28')](_0x4bc556);_0x52028b(null,![]);});};AGIVertices['prototype'][_0xc5a1('0x4d')]=function(_0x591a58,_0x159582){var _0x1c302e={'role':'agent'};_0x1c302e[_0x591a58]=this[_0xc5a1('0xe')][_0xc5a1('0x38')];this[_0xc5a1('0xf')]['agentUnpause'](_0x1c302e)[_0xc5a1('0x12')](function(_0x5c3edc){_0x159582(null,_[_0xc5a1('0x42')](_0x5c3edc)?![]:!![]);})[_0xc5a1('0x14')](function(_0x4dbe94){logger['error'](_0x4dbe94);_0x159582(null,![]);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x4e')]=function(_0xde32da,_0x314a7c){var _0x48ba43={'role':_0xc5a1('0x4f')};_0x48ba43[_0xde32da]=this['channel'][_0xc5a1('0x38')];this[_0xc5a1('0xf')][_0xc5a1('0x4e')](_0x48ba43)[_0xc5a1('0x12')](function(_0x1071f9){_0x314a7c(null,_[_0xc5a1('0x42')](_0x1071f9)?![]:!![]);})[_0xc5a1('0x14')](function(_0x45c6a0){logger[_0xc5a1('0x28')](_0x45c6a0);_0x314a7c(null,![]);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x50')]=function(_0x3f4139,_0x1d793a){var _0x157be5={'role':'agent'};_0x157be5[_0x3f4139]=this['channel'][_0xc5a1('0x38')];var _0x4fa711=_0x3f4139!=_0xc5a1('0x51')?util[_0xc5a1('0x52')](_0xc5a1('0x53'),_0xc5a1('0x54'),this[_0xc5a1('0xe')][_0xc5a1('0x38')]):undefined;this[_0xc5a1('0xf')]['agentLogin'](_0x157be5,_0x4fa711)['then'](function(_0x45b74e){_0x1d793a(null,_['isNil'](_0x45b74e)?![]:!![]);})['catch'](function(_0x14459a){logger[_0xc5a1('0x28')](_0x14459a);_0x1d793a(null,![]);});};AGIVertices[_0xc5a1('0x11')]['shellCommand']=function(_0x46d1f5,_0x3cea21){sh[_0xc5a1('0x55')](_[_0xc5a1('0x56')](_0x46d1f5),function(_0x37cac3,_0x4f063d){var _0x5bc04a=_0x4f063d[_0xc5a1('0x57')](/(\r\n|\n|\r)/gm,'');_0x3cea21(null,_0x5bc04a);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x58')]=function(_0x39d2b6,_0x1a1874){scripts[_0xc5a1('0x58')](_0x39d2b6[_0xc5a1('0x59')],_0x39d2b6[_0xc5a1('0x5a')]||_0xc5a1('0x5b'),_0x39d2b6['text'],_0x39d2b6[_0xc5a1('0x5c')]||_0xc5a1('0x5d'),_0x39d2b6['ssmlGender']||_0xc5a1('0x5e'),_0x39d2b6['audioEncoding']||_0xc5a1('0x5f'))['then'](function(_0x175f97){_0x1a1874(null,_0x175f97);})[_0xc5a1('0x14')](function(_0x404637){_0x1a1874(_0x404637);});};AGIVertices['prototype'][_0xc5a1('0x60')]=function(_0x5ad811,_0x2ac795){scripts['googleTTS'](_0x5ad811[_0xc5a1('0x5b')],_0x5ad811[_0xc5a1('0x61')]||'en',0x1)['then'](function(_0xaa32ed){_0x2ac795(null,_0xaa32ed);})[_0xc5a1('0x14')](function(_0x3c6c51){_0x2ac795(_0x3c6c51);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x62')]=function(_0x292d8c,_0x3cd47a){var _0x5c664e={'uri':_0x292d8c['url'],'method':_0x292d8c[_0xc5a1('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x292d8c[_0xc5a1('0x64')])===_0xc5a1('0x65')&&parseInt(_0x292d8c[_0xc5a1('0x64')])>=0x1?parseInt(_0x292d8c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xc5a1('0x66')]([_0xc5a1('0x67'),_0xc5a1('0x68')],_0x5c664e[_0xc5a1('0x63')][_0xc5a1('0x69')]())){try{_0x5c664e[_0xc5a1('0x6a')]=_0x292d8c[_0xc5a1('0xa')]?JSON[_0xc5a1('0x6b')](_0x292d8c[_0xc5a1('0xa')]):{};}catch(_0x308ac0){logger[_0xc5a1('0x28')](_0xc5a1('0x6c'),_0x308ac0);}}try{_0x5c664e['headers']=_0x292d8c[_0xc5a1('0x6d')]?JSON[_0xc5a1('0x6b')](_0x292d8c[_0xc5a1('0x6d')]):{};}catch(_0x4eba66){logger['error'](_0xc5a1('0x6e'),_0x4eba66);}if(_0x292d8c['computedVariables']){try{var _0x116462=require(_0x292d8c['computedVariables'])[_0xc5a1('0x6f')](this,_0x5c664e);_0x5c664e[_0xc5a1('0x70')]=Mustache[_0xc5a1('0x71')](_0x292d8c[_0xc5a1('0x72')],_0x116462,{},['$$','$$']);if(_0x5c664e[_0xc5a1('0x73')]){_0x5c664e['headers']=JSON['parse'](Mustache[_0xc5a1('0x71')](JSON['stringify'](_0x5c664e[_0xc5a1('0x73')]),_0x116462,{},['$$','$$']));}if(_0x5c664e[_0xc5a1('0x6a')]){_0x5c664e[_0xc5a1('0x6a')]=JSON[_0xc5a1('0x6b')](Mustache[_0xc5a1('0x71')](JSON[_0xc5a1('0x74')](_0x5c664e[_0xc5a1('0x6a')]),_0x116462,{},['$$','$$']));}}catch(_0x5c7bcf){logger[_0xc5a1('0x28')](_0xc5a1('0x75'),_0x5c7bcf);}}rp(_0x5c664e)[_0xc5a1('0x12')](function(_0x33c9bd){var _0x3ebf51={'statusCode':_0x33c9bd[_0xc5a1('0x76')]||0xc8,'statusMessage':_0x33c9bd[_0xc5a1('0x77')]||'OK','headers':_0x33c9bd[_0xc5a1('0x73')]||{},'body':_0x33c9bd[_0xc5a1('0x6a')]||{}};_0x3cd47a(null,_0x3ebf51);})[_0xc5a1('0x14')](function(_0x569ad4){var _0x43cb42={'statusCode':_0x569ad4[_0xc5a1('0x76')]||0x1f4,'statusMessage':_0x569ad4[_0xc5a1('0x78')]||_0xc5a1('0x79'),'headers':_0x569ad4[_0xc5a1('0x7a')][_0xc5a1('0x73')]||{},'body':_0x569ad4['options'][_0xc5a1('0x6a')]||{}};_0x3cd47a(null,_0x43cb42);});};AGIVertices[_0xc5a1('0x11')]['googleDialogflow']=function(_0x367043,_0x25967c){scripts['googleDialogflow'](this['channel'][_0xc5a1('0x34')],_0x367043['key'],_0x367043[_0xc5a1('0x5b')],_0x367043[_0xc5a1('0x7b')]||'en')[_0xc5a1('0x12')](function(_0x2d0af9){_0x25967c(null,_0x2d0af9);})[_0xc5a1('0x14')](function(_0x453c80){_0x25967c(_0x453c80);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x7c')]=function(_0x4fa5d2,_0x2bcb32){scripts[_0xc5a1('0x7c')](this[_0xc5a1('0xe')][_0xc5a1('0x34')],_0x4fa5d2[_0xc5a1('0x7d')],_0x4fa5d2[_0xc5a1('0x7e')],_0x4fa5d2[_0xc5a1('0x7f')],_0x4fa5d2[_0xc5a1('0x5b')],_0x4fa5d2['dialogflowV2_language']||'en')[_0xc5a1('0x12')](function(_0x48991c){_0x2bcb32(null,_0x48991c);})[_0xc5a1('0x14')](function(_0x318b5f){_0x2bcb32(_0x318b5f);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x80')]=function(_0xb3d6b9,_0x47c6d9){scripts[_0xc5a1('0x80')](this[_0xc5a1('0xe')],_0xb3d6b9)['then'](function(_0x4f72e2){_0x47c6d9(null,_0x4f72e2);})['catch'](function(_0x27f206){_0x47c6d9(_0x27f206);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x81')]=function(_0x41f41e,_0x1b2ec1){scripts[_0xc5a1('0x81')](_0x41f41e['key'],_0x41f41e[_0xc5a1('0x5b')],_0x41f41e['ispeech_tts_language']||_0xc5a1('0x5d'),_0x41f41e['speed'])['then'](function(_0x4c1d8f){_0x1b2ec1(null,_0x4c1d8f);})[_0xc5a1('0x14')](function(_0x2ca134){_0x1b2ec1(_0x2ca134);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x82')]=function(_0x4cf97f,_0x5ac3f3,_0x683136){scripts[_0xc5a1('0x82')](_0x5ac3f3,_0x4cf97f['key'],_0x4cf97f[_0xc5a1('0x83')]||_0xc5a1('0x5d'),this[_0xc5a1('0x84')](_0x4cf97f[_0xc5a1('0x85')])?_0x4cf97f['model']:undefined)['then'](function(_0x431aa9){_0x683136(null,_0x431aa9);})[_0xc5a1('0x14')](function(_0x3197b2){_0x683136(_0x3197b2);});};AGIVertices[_0xc5a1('0x11')]['awsPolly']=function(_0x39714d,_0x3b735a){scripts[_0xc5a1('0x86')](_0x39714d[_0xc5a1('0x87')],_0x39714d[_0xc5a1('0x88')],_0x39714d[_0xc5a1('0x89')],_0x39714d[_0xc5a1('0x8a')]||'Amy',_0x39714d[_0xc5a1('0x5b')],_0x39714d[_0xc5a1('0x8b')]||_0xc5a1('0x5b'))[_0xc5a1('0x12')](function(_0x104742){_0x3b735a(null,_0x104742);})[_0xc5a1('0x14')](function(_0x2c6608){_0x3b735a(_0x2c6608);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x8c')]=function(_0x3e6dd1,_0x3c343b){scripts[_0xc5a1('0x8c')](this['channel']['uniqueid'],_0x3e6dd1[_0xc5a1('0x87')],_0x3e6dd1[_0xc5a1('0x88')],_0x3e6dd1[_0xc5a1('0x8d')],_0x3e6dd1[_0xc5a1('0x5b')],_0x3e6dd1[_0xc5a1('0x8e')])[_0xc5a1('0x12')](function(_0x44a907){_0x3c343b(null,_0x44a907);})[_0xc5a1('0x14')](function(_0x3f0fc3){_0x3c343b(_0x3f0fc3);});};AGIVertices[_0xc5a1('0x11')]['googleASR']=function(_0x350d69,_0x443464,_0x265c55){scripts[_0xc5a1('0x8f')](_0x443464,_0x350d69[_0xc5a1('0x90')],_0x350d69['google_asr_language']||_0xc5a1('0x5d'))[_0xc5a1('0x12')](function(_0x2f6a4b){_0x265c55(null,_0x2f6a4b);})[_0xc5a1('0x14')](function(_0x77a7bf){_0x265c55(_0x77a7bf);});};AGIVertices['prototype']['tildeASR']=function(_0x211077,_0x1675ef,_0x39e960){scripts['tildeASR'](_0x1675ef,_0x211077[_0xc5a1('0x91')],_0x211077[_0xc5a1('0x92')],_0x211077['uri'])[_0xc5a1('0x12')](function(_0x4eb451){_0x39e960(null,_0x4eb451);})[_0xc5a1('0x14')](function(_0x34b614){_0x39e960(_0x34b614);});};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x93')]=function(_0x4b871d){var _0x2a6f24=_[_0xc5a1('0x66')](verticesWithRetry,_0x4b871d['agicommand'])?_0x4b871d:_['clone'](_0x4b871d);for(var _0x338357 in _0x2a6f24){if(_0x2a6f24['hasOwnProperty'](_0x338357)){if(_0x2a6f24[_0x338357]&&_[_0xc5a1('0x94')](_0x2a6f24[_0x338357])){if(_[_0xc5a1('0x66')](recursiveMapAttributes,_0x338357)){_0x2a6f24[_0x338357]=this[_0xc5a1('0x95')](_0x2a6f24[_0x338357]);}else{_0x2a6f24[_0x338357]=this[_0xc5a1('0x96')](_0x2a6f24[_0x338357]);}}}}return _0x2a6f24;};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x97')]=function(_0x273dbc){for(var _0x445979 in _0x273dbc){if(_0x273dbc[_0xc5a1('0x98')](_0x445979)){if(_[_0xc5a1('0x99')](_0x273dbc[_0x445979])){this[_0xc5a1('0x97')](_0x273dbc[_0x445979]);}else if(_['isArray'](_0x273dbc[_0x445979])){for(var _0xca67b8=0x0;_0xca67b8<_0x273dbc[_0x445979][_0xc5a1('0x9a')];_0xca67b8++){this[_0xc5a1('0x97')](_0x273dbc[_0x445979][_0xca67b8]);}}else if(_['isString'](_0x273dbc[_0x445979])){_0x273dbc[_0x445979]=this[_0xc5a1('0x96')](_0x273dbc[_0x445979]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x38f2b6,_0x2fd4a9){for(var _0x1a9fe9 in _0x38f2b6){if(_0x38f2b6[_0xc5a1('0x98')](_0x1a9fe9)){if(_[_0xc5a1('0x99')](_0x38f2b6[_0x1a9fe9])){if(!_[_0xc5a1('0x41')](_0x38f2b6[_0x1a9fe9])){this[_0xc5a1('0x9b')](_0x38f2b6[_0x1a9fe9],util[_0xc5a1('0x52')]('%s.%s',_0x2fd4a9,_0x1a9fe9));}}else if(_['isArray'](_0x38f2b6[_0x1a9fe9])){for(var _0x4a58a4=0x0;_0x4a58a4<_0x38f2b6[_0x1a9fe9][_0xc5a1('0x9a')];_0x4a58a4++){this[_0xc5a1('0x9b')](_0x38f2b6[_0x1a9fe9][_0x4a58a4],util[_0xc5a1('0x52')](_0xc5a1('0x9c'),_0x2fd4a9,_0x1a9fe9+'['+_0x4a58a4+']'));}}else{if(!_[_0xc5a1('0x42')](_0x38f2b6[_0x1a9fe9])){this['channel'][_0xc5a1('0x9d')](util[_0xc5a1('0x52')]('%s.%s',_0x2fd4a9,_0x1a9fe9),_0x38f2b6[_0x1a9fe9]);}}}}};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x95')]=function(_0x3bc023){try{var _0x3b7a35=JSON['parse'](_0x3bc023);this[_0xc5a1('0x97')](_0x3b7a35);return JSON[_0xc5a1('0x74')](_0x3b7a35);}catch(_0x2d5bbf){return this[_0xc5a1('0x96')](_0x3bc023);}};AGIVertices[_0xc5a1('0x11')]['replaceAllVariables']=function(_0x404b9f){var _0xc12ef3=_0x404b9f[_0xc5a1('0x9e')]('{');for(var _0x2c8cb2=0x1;_0x2c8cb2<_0xc12ef3[_0xc5a1('0x9a')];_0x2c8cb2+=0x1){var _0x6b7163=_0xc12ef3[_0x2c8cb2][_0xc5a1('0x9e')]('}');if(_0x6b7163[_0xc5a1('0x9a')]>0x1){_0x404b9f=_0x404b9f['replaceAll']('{'+_0x6b7163[0x0]+'}',this[_0xc5a1('0xe')]['getVariable'](_0x6b7163[0x0])[_0xc5a1('0x9f')]||_0x6b7163[0x0]);}}if(_0xc12ef3[_0xc5a1('0x9a')]===0x1){return _0x404b9f['toString']();}return this['replaceAllVariables'](_0x404b9f);};AGIVertices['prototype'][_0xc5a1('0xa0')]=function(_0x1be363,_0x5d9d3c){var _0x356713=this[_0xc5a1('0xe')][_0xc5a1('0xa1')](_0x1be363);if(_0x356713['result']===-0x1){return _0x356713;}logger[_0xc5a1('0x2b')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5d9d3c,_0x356713[_0xc5a1('0x9f')]));return this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0x5d9d3c,_0x356713[_0xc5a1('0x9f')]);};AGIVertices['prototype'][_0xc5a1('0x84')]=function(_0x542d43){return _0x542d43&&_0x542d43!=='0'&&_0x542d43!=='-1'&&_0x542d43!=='';};AGIVertices['prototype'][_0xc5a1('0xa2')]=function(_0x20a463){this[_0xc5a1('0x33')]['sync'](this,_0x20a463,'-');_0x20a463[_0xc5a1('0xa3')]=_0x20a463[_0xc5a1('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xa4')]=function(_0x215140){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0xa5'),_0x215140['label']));if(!this[_0xc5a1('0x84')](_0x215140[_0xc5a1('0x5b')])){return this['channel']['noop'](_0xc5a1('0xa6'));}var _0x3d4971='\x22'+_0x215140[_0xc5a1('0x5b')]+'\x22';if(this[_0xc5a1('0x84')](_0x215140[_0xc5a1('0x7a')])){_0x3d4971+=','+_0x215140[_0xc5a1('0x7a')];}var _0x142551=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0xa7'),_0x3d4971);if(_0x142551[_0xc5a1('0xa8')]===-0x1){return _0x142551;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xaa'),_0x3d4971));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xab')]=function(_0x3ea1b7){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xac'),_0x3ea1b7[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x3ea1b7['grammar'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xad'));}var _0x4ad135=_0x3ea1b7[_0xc5a1('0xae')];if(this[_0xc5a1('0x84')](_0x3ea1b7[_0xc5a1('0x7a')])){_0x4ad135+=','+_0x3ea1b7[_0xc5a1('0x7a')];}var _0x38bcf2=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0xaf'),_0x4ad135);if(_0x38bcf2[_0xc5a1('0xa8')]===-0x1){return _0x38bcf2;}var _0x3ee0c4=this[_0xc5a1('0xa0')](_0xc5a1('0xb0'),_0xc5a1('0xb1'));if(_0x3ee0c4[_0xc5a1('0xa8')]===-0x1){return _0x3ee0c4;}var _0x4c3ffb=this['getAndSetVariable'](_0xc5a1('0xb2'),_0xc5a1('0xb3'));if(_0x4c3ffb[_0xc5a1('0xa8')]===-0x1){return _0x4c3ffb;}var _0x4d7027=this[_0xc5a1('0xa0')](_0xc5a1('0xb4'),_0xc5a1('0xb5'));if(_0x4d7027[_0xc5a1('0xa8')]===-0x1){return _0x4d7027;}return this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xb6'),_0x4ad135));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x6')]=function(_0x396752){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xb7'),_0x396752[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0x6')]([_0x396752[_0xc5a1('0xb8')],_0x396752[_0xc5a1('0xb9')]]);};AGIVertices[_0xc5a1('0x11')]['answer']=function(_0x55453c){logger['info'](util[_0xc5a1('0x52')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x55453c['label']));if(this[_0xc5a1('0x84')](_0x55453c['timeout'])){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xba'),_0x55453c[_0xc5a1('0x64')]));var _0x27afe3=this['channel'][_0xc5a1('0xbb')](_0x55453c['timeout']);if(_0x27afe3[_0xc5a1('0xa8')]===-0x1){return _0x27afe3;}}return this[_0xc5a1('0xe')][_0xc5a1('0xbc')]();};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x48')]=function(_0x40be73){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xbd'),_0x40be73[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x40be73[_0xc5a1('0x46')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x40be73,_0xc5a1('0xbe'));}_0x40be73[_0xc5a1('0x47')]=moment();if(this[_0xc5a1('0x84')](_0x40be73[_0xc5a1('0xbf')])){_0x40be73[_0xc5a1('0x47')]=moment()[_0xc5a1('0xc0')](_0x40be73[_0xc5a1('0xbf')],_0xc5a1('0xc1'));}if(!this[_0xc5a1('0x84')](_0x40be73['callback_priority'])){_0x40be73[_0xc5a1('0x4b')]=0x2;}this[_0xc5a1('0x40')][_0xc5a1('0x6f')](this,_0x40be73);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x40be73['phone'],_0x40be73[_0xc5a1('0x46')],_0x40be73[_0xc5a1('0x47')]));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xc2')]=function(_0x4de812){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0xc3'),_0x4de812[_0xc5a1('0x35')]));var _0x391b2d=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0x4de812[_0xc5a1('0xc4')],_0x4de812[_0xc5a1('0x7a')]);if(_0x391b2d[_0xc5a1('0xa8')]===-0x1){return _0x391b2d;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xc5'),_0x4de812[_0xc5a1('0xc4')],_0x4de812[_0xc5a1('0x7a')]));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xc6')]=function(_0x3fa6e2){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xc7'),_0x3fa6e2[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x3fa6e2[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}var _0x18e2a4='\x22'+_0x3fa6e2['text']+'\x22';if(this[_0xc5a1('0x84')](_0x3fa6e2[_0xc5a1('0x7a')])){_0x18e2a4+=','+_0x3fa6e2['options'];}var _0x43fb97=this['channel'][_0xc5a1('0x55')](_0xc5a1('0xa7'),_0x18e2a4);if(_0x43fb97[_0xc5a1('0xa8')]===-0x1){return _0x43fb97;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0xaa'),_0x18e2a4));};AGIVertices[_0xc5a1('0x11')]['sestektts']=function(_0x280442){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0xc8'),_0x280442['label']));if(!this['isConfigured'](_0x280442[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0xa6'));}var _0xfce71a='\x22'+_0x280442[_0xc5a1('0x5b')]+'\x22';if(this[_0xc5a1('0x84')](_0x280442[_0xc5a1('0x7a')])){_0xfce71a+=','+_0x280442[_0xc5a1('0x7a')];}var _0x36eded=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0xa7'),_0xfce71a);if(_0x36eded[_0xc5a1('0xa8')]===-0x1){return _0x36eded;}return this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xaa'),_0xfce71a));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xc9')]=function(_0x5259b5){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xca'),_0x5259b5[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x5259b5[_0xc5a1('0xae')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('no\x20grammar\x20configured');}var _0x43e722=_0x5259b5[_0xc5a1('0xae')];if(this[_0xc5a1('0x84')](_0x5259b5[_0xc5a1('0x7a')])){_0x43e722+=','+_0x5259b5[_0xc5a1('0x7a')];}var _0x22368f=this['channel']['exec']('MRCPRecog',_0x43e722);if(_0x22368f['result']===-0x1){return _0x22368f;}var _0x35551d=this[_0xc5a1('0xa0')](_0xc5a1('0xb0'),'LUMENVOX_ASR_CONFIDENCE');if(_0x35551d['result']===-0x1){return _0x35551d;}var _0x29658d=this[_0xc5a1('0xa0')](_0xc5a1('0xb2'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x29658d[_0xc5a1('0xa8')]===-0x1){return _0x29658d;}var _0x169d9e=this[_0xc5a1('0xa0')](_0xc5a1('0xb4'),'LUMENVOX_ASR_INSTANCE');if(_0x169d9e[_0xc5a1('0xa8')]===-0x1){return _0x169d9e;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0xb6'),_0x43e722));};AGIVertices['prototype'][_0xc5a1('0xcb')]=function(_0x14c99c){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0xcc'),_0x14c99c[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x14c99c[_0xc5a1('0xae')])){return this['channel'][_0xc5a1('0xa9')](_0xc5a1('0xad'));}var _0x116d9c=_0x14c99c[_0xc5a1('0xae')];if(this[_0xc5a1('0x84')](_0x14c99c[_0xc5a1('0x7a')])){_0x116d9c+=','+_0x14c99c[_0xc5a1('0x7a')];}var _0x4ce078=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0xaf'),_0x116d9c);if(_0x4ce078[_0xc5a1('0xa8')]===-0x1){return _0x4ce078;}var _0x1cfaf0=this[_0xc5a1('0xa0')]('RECOG_CONFIDENCE()',_0xc5a1('0xcd'));if(_0x1cfaf0['result']===-0x1){return _0x1cfaf0;}var _0x51d4e5=this[_0xc5a1('0xa0')](_0xc5a1('0xb2'),_0xc5a1('0xce'));if(_0x51d4e5[_0xc5a1('0xa8')]===-0x1){return _0x51d4e5;}var _0x128a41=this[_0xc5a1('0xa0')]('RECOG_INSTANCE()',_0xc5a1('0xcf'));if(_0x128a41[_0xc5a1('0xa8')]===-0x1){return _0x128a41;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('Executed\x20command\x20MRCPRecog\x20%s',_0x116d9c));};AGIVertices[_0xc5a1('0x11')]['database']=function(_0x4f819d){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4f819d['label']));if(!this[_0xc5a1('0x84')](_0x4f819d[_0xc5a1('0xd0')])){return this['channel'][_0xc5a1('0x28')](_0x4f819d,_0xc5a1('0xd1'));}var _0x13affc=this[_0xc5a1('0x17')][_0xc5a1('0x6f')](this,_0x4f819d[_0xc5a1('0xd0')]);if(!_0x13affc){return this[_0xc5a1('0xe')]['error'](_0x4f819d,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x4f819d[_0xc5a1('0x2a')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x4f819d,_0xc5a1('0xd2'));}var _0x5077fc=_0x4f819d['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xd3'),_0x5077fc));var _0x4084d6=this[_0xc5a1('0x26')][_0xc5a1('0x6f')](this,_0x13affc,_0x5077fc);this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x4f819d,_0x5077fc);if(!this[_0xc5a1('0x84')](_0x4f819d[_0xc5a1('0xd4')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xd5'));}var _0x33e9da=this[_0xc5a1('0xa1')][_0xc5a1('0x6f')](this,_0x4f819d[_0xc5a1('0xd4')]);if(!_0x33e9da){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x4f819d,'no\x20variable\x20found');}var _0x40bd15=this;_0x4084d6[_0xc5a1('0xd6')](function(_0x4a50dc,_0x6cbd87){Object[_0xc5a1('0xd7')](_0x4a50dc)[_0xc5a1('0xd6')](function(_0x54be1e){_0x40bd15['channel'][_0xc5a1('0x9d')](util[_0xc5a1('0x52')]('%s[%s][%s]',_0x33e9da,_0x6cbd87,_0x54be1e),_0x4a50dc[_0x54be1e]);});});this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util[_0xc5a1('0x52')](_0xc5a1('0xd8'),_0x33e9da),_0x4084d6[_0xc5a1('0x9a')]);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0xd9'),_0x33e9da));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xda')]=function(_0x285a69){logger[_0xc5a1('0xdb')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x285a69['label']));if(!this[_0xc5a1('0x84')](_0x285a69[_0xc5a1('0xdc')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x285a69,_0xc5a1('0xdd'));}var _0x53c43e=this['getUser'][_0xc5a1('0x6f')](this,_0x285a69[_0xc5a1('0xdc')]);if(!_0x53c43e){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x285a69,_0xc5a1('0xde'));}var _0x18325e=this['channel'][_0xc5a1('0x55')]('DIAL',[util[_0xc5a1('0x52')](_0xc5a1('0xdf'),_0x53c43e),_0x285a69[_0xc5a1('0x64')],_0x285a69['opts'],_0x285a69[_0xc5a1('0x72')]]);if(_0x18325e[_0xc5a1('0xa8')]===-0x1){return _0x18325e;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xe0'),'DIAL'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xe1')]=function(_0x1f5ed1){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0xe2'),_0x1f5ed1[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x1f5ed1['key'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xe3'));}if(!this[_0xc5a1('0x84')](_0x1f5ed1[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')]['bot']=!![];this[_0xc5a1('0x33')](_0x1f5ed1);this[_0xc5a1('0x3f')](_0x1f5ed1[_0xc5a1('0x5b')],'in','','');this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('Trying\x20Dialogflow:\x20%s',_0x1f5ed1['text']));var _0x2af5fd=this['googleDialogflow']['sync'](this,_0x1f5ed1);if(_0x2af5fd){for(var _0x46dbbc in _0x2af5fd){if(_0x2af5fd['hasOwnProperty'](_0x46dbbc)){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util[_0xc5a1('0x52')]('DIALOGFLOW_%s',_0x46dbbc[_0xc5a1('0x69')]()),_0x2af5fd[_0x46dbbc]);}}this[_0xc5a1('0x3f')](_0x2af5fd[_0xc5a1('0xe4')],_0xc5a1('0xe5'),_0xc5a1('0xe1'),'');return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xe6'),_0x2af5fd['speech']));}return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x1f5ed1,_0xc5a1('0xe7'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xe8')]=function(_0xb146ab){logger['info'](util['format'](_0xc5a1('0xe9'),_0xb146ab[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0xb146ab[_0xc5a1('0x7d')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xea'));}if(!this[_0xc5a1('0x84')](_0xb146ab['client_email'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0xb146ab['private_key'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xeb'));}if(!this['isConfigured'](_0xb146ab[_0xc5a1('0xec')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xed'));}if(!this[_0xc5a1('0x84')](_0xb146ab[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this['channel'][_0xc5a1('0xee')]=!![];this[_0xc5a1('0x33')](_0xb146ab);this[_0xc5a1('0x3f')](_0xb146ab['text'],'in','','');this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xef'),_0xb146ab[_0xc5a1('0x5b')]));var _0x59a9c5=this[_0xc5a1('0x7c')][_0xc5a1('0x6f')](this,_0xb146ab);if(_0x59a9c5){for(var _0x25d975 in _0x59a9c5){if(_0x59a9c5[_0xc5a1('0x98')](_0x25d975)){if(_0x25d975!=='providerResponse'){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util[_0xc5a1('0x52')](_0xc5a1('0xf0'),_0x25d975['toUpperCase']()),_0x59a9c5[_0x25d975]);}}}this['createSquareMessage'](_0x59a9c5[_0xc5a1('0xe4')],_0xc5a1('0xe5'),'dialogflowV2',_0x59a9c5[_0xc5a1('0xf1')]);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xf2'),_0x59a9c5['speech']));}return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0xb146ab,_0xc5a1('0xf3'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xf4')]=function(_0x2d2401){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0xf5'),_0x2d2401[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x2d2401[_0xc5a1('0xf6')])){return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0xf7'));}if(!this[_0xc5a1('0x84')](_0x2d2401[_0xc5a1('0xf8')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('no\x20username\x20configured');}if(!this[_0xc5a1('0x84')](_0x2d2401[_0xc5a1('0xf9')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xfa'));}if(!this['isConfigured'](_0x2d2401[_0xc5a1('0xfb')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')]['bot']=!![];this[_0xc5a1('0x33')](_0x2d2401);this[_0xc5a1('0x3f')](_0x2d2401[_0xc5a1('0x5b')],'in','','');this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('Trying\x20SestekNDA:\x20%s',_0x2d2401[_0xc5a1('0x5b')]));var _0x56069e=this['sestekNDA']['sync'](this,_0x2d2401);if(_0x56069e){for(var _0x3661f2 in _0x56069e){if(_0x56069e[_0xc5a1('0x98')](_0x3661f2)){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util['format'](_0xc5a1('0xfc'),_0x3661f2['toUpperCase']()),_0x56069e[_0x3661f2]);}}this[_0xc5a1('0x3f')](_0x56069e[_0xc5a1('0xe4')],_0xc5a1('0xe5'),_0xc5a1('0xf4'),'');if(_0x56069e[_0xc5a1('0xfd')]){this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xfe'),_0x56069e[_0xc5a1('0xfd')]));var _0x29816a=this[_0xc5a1('0xe')]['streamFile'](_0x56069e[_0xc5a1('0xfd')]);try{fs[_0xc5a1('0xff')](_0x56069e['audiofile']+_0xc5a1('0x100'));}catch(_0x1a1e29){logger[_0xc5a1('0x28')](_0x1a1e29);}return _0x29816a;}else{return this[_0xc5a1('0xe')]['noop'](util[_0xc5a1('0x52')](_0xc5a1('0x101'),_0x56069e['speech']));}}return this['channel'][_0xc5a1('0x28')](_0x2d2401,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x102')]=function(_0x527270){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x103'),_0x527270['label']));return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x102'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x104')]=function(_0x178f49){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x105'),_0x178f49[_0xc5a1('0x35')]));var _0x4154d8='';if(_0x178f49[_0xc5a1('0x106')]){if(!this[_0xc5a1('0x84')](_0x178f49[_0xc5a1('0x106')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x178f49,_0xc5a1('0x107'));}else{var _0x19932c=parseInt(_0x178f49[_0xc5a1('0x106')],0xa);if(isNaN(_0x19932c)){_0x4154d8=_0x178f49['trunk_id'];}else{_0x4154d8=this[_0xc5a1('0x108')][_0xc5a1('0x6f')](this,_0x178f49[_0xc5a1('0x106')]);if(!_0x4154d8){return this['channel'][_0xc5a1('0x28')](_0x178f49,_0xc5a1('0x109'));}}}}else if(_0x178f49[_0xc5a1('0x10a')]){_0x4154d8=_0x178f49[_0xc5a1('0x10a')];}else{return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x178f49,'no\x20trunk\x20selected');}var _0x36ee5e=this['channel']['exec'](_0xc5a1('0x10b'),[util['format'](_0xc5a1('0x10c'),_0x4154d8,_0x178f49[_0xc5a1('0x45')]),_0x178f49['timeout'],_0x178f49[_0xc5a1('0x10d')],_0x178f49[_0xc5a1('0x72')]]);if(_0x36ee5e[_0xc5a1('0xa8')]===-0x1){return _0x36ee5e;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xe0'),_0xc5a1('0x10b')));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x10e')]=function(_0x1db141){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x10f'),_0x1db141[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0x10e'));};AGIVertices['prototype']['getdigits']=function(_0x54446e){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x54446e[_0xc5a1('0x35')]));if(_0x54446e[_0xc5a1('0xa3')]===0x0){return this[_0xc5a1('0xa2')](_0x54446e);}_0x54446e[_0xc5a1('0xa3')]-=0x1;if(!this[_0xc5a1('0x84')](_0x54446e[_0xc5a1('0x110')])){return this[_0xc5a1('0xe')]['error'](_0x54446e,'no\x20file\x20audio\x20selected');}var _0x7c2653=this['getSound'][_0xc5a1('0x6f')](this,_0x54446e[_0xc5a1('0x110')]);if(!_0x7c2653){return this[_0xc5a1('0xe')]['error'](_0x54446e,_0xc5a1('0x111'));}if(!this[_0xc5a1('0x84')](_0x54446e['variable_id'])){return this['channel'][_0xc5a1('0x28')](_0xc5a1('0xd5'));}var _0x135156=this['channel']['getData'](_0x7c2653,_0x54446e['response'],_0x54446e[_0xc5a1('0x112')]);var _0x36adbd=_0x135156['result']?_0x135156[_0xc5a1('0xa8')][_0xc5a1('0x4a')]():'';logger['info'](_0xc5a1('0x113'),JSON['stringify'](_0x135156));if(_0x135156[_0xc5a1('0xa8')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x54446e,_0x36adbd);return _0x135156;}else if(_0x135156[_0xc5a1('0x9f')]===_0xc5a1('0x64')){_0x135156['result']=_0x36adbd[_0xc5a1('0x9a')]>=parseInt(_0x54446e[_0xc5a1('0x114')])?'x':'i';}else{_0x135156[_0xc5a1('0xa8')]=_0x36adbd[_0xc5a1('0x9a')]>=parseInt(_0x54446e['mindigit'])&&_0x36adbd[_0xc5a1('0x9a')]<=parseInt(_0x54446e[_0xc5a1('0x112')])?'x':'i';}var _0x3a6d8f=this['getVariable'][_0xc5a1('0x6f')](this,_0x54446e[_0xc5a1('0xd4')]);if(!_0x3a6d8f){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x54446e,_0xc5a1('0x115'));}this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0x3a6d8f,_0x36adbd);if(this['isConfigured'](_0x54446e['hiddendigitsnum'])){var _0x3ed6e0=parseInt(_0x54446e[_0xc5a1('0x116')],0xa);var _0x4de5e5=rs['generate']({'charset':'*','length':_0x3ed6e0});var _0x1144bd=_0x36adbd[_0xc5a1('0x9a')];if(_0x1144bd>0x0){if(_0x1144bd>_0x3ed6e0){this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x54446e,_0x54446e[_0xc5a1('0x117')]==='first'?_0x4de5e5+_0x36adbd['substr'](_0x3ed6e0):_0x36adbd['substr'](0x0,_0x1144bd-_0x3ed6e0)+_0x4de5e5);}else{this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x54446e,rs[_0xc5a1('0x118')]({'charset':'*','length':_0x1144bd}));}}else{this[_0xc5a1('0x33')]['sync'](this,_0x54446e,'');}}else{this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x54446e,_0x36adbd);}return _0x135156;};AGIVertices['prototype'][_0xc5a1('0xd')]=function(_0x2426f7){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x119'),_0x2426f7[_0xc5a1('0x35')]));return this[_0xc5a1('0xc')](_0x2426f7);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x11a')]=function(_0x515fd5){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x11b'),_0x515fd5['label']));this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x515fd5,_0x515fd5[_0xc5a1('0x11c')]);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('GOAL\x20%s',_0x515fd5[_0xc5a1('0x11c')]));};AGIVertices['prototype'][_0xc5a1('0x11d')]=function(_0x11340d){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x11340d[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x11340d['aws_access_key_id'])||!this[_0xc5a1('0x84')](_0x11340d[_0xc5a1('0x88')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x11e'));}if(!this[_0xc5a1('0x84')](_0x11340d[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x11f'),_0x11340d['text']));var _0x569e95=this[_0xc5a1('0x86')][_0xc5a1('0x6f')](this,_0x11340d);if(_0x569e95){this['channel'][_0xc5a1('0xa9')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x569e95));var _0xb67cfa=this[_0xc5a1('0xe')]['streamFile'](_0x569e95);try{fs[_0xc5a1('0xff')](_0x569e95+_0xc5a1('0x100'));}catch(_0x1bc604){logger[_0xc5a1('0x28')](_0x1bc604);}return _0xb67cfa;}return this[_0xc5a1('0xe')]['error'](_0x11340d,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x120')]=function(_0xbe8c07){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x121'),_0xbe8c07[_0xc5a1('0x35')]));if(!this['isConfigured'](_0xbe8c07['aws_access_key_id'])||!this['isConfigured'](_0xbe8c07[_0xc5a1('0x88')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0xbe8c07[_0xc5a1('0x8e')])){return this['channel'][_0xc5a1('0xa9')](_0xc5a1('0x122'));}if(!this[_0xc5a1('0x84')](_0xbe8c07[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')][_0xc5a1('0xee')]=!![];this['createSquareDetailsReport'](_0xbe8c07);this[_0xc5a1('0x3f')](_0xbe8c07[_0xc5a1('0x5b')],'in','','');this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x123'),_0xbe8c07['text']));var _0x11787b=this['awsLex']['sync'](this,_0xbe8c07);if(_0x11787b){for(var _0x281f53 in _0x11787b){if(_0x11787b['hasOwnProperty'](_0x281f53)&&_[_0xc5a1('0x94')](_0x11787b[_0x281f53])){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util['format'](_0xc5a1('0x124'),_0x281f53[_0xc5a1('0x69')]()),_0x11787b[_0x281f53]);}}if(_[_0xc5a1('0x42')](_0x11787b[_0xc5a1('0x78')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x125'));}else{this[_0xc5a1('0x3f')](_0x11787b[_0xc5a1('0x78')],_0xc5a1('0xe5'),_0xc5a1('0x126'),'');return this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x127'),_0x11787b[_0xc5a1('0x78')]));}}return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0xbe8c07,_0xc5a1('0x128'));};AGIVertices['prototype'][_0xc5a1('0x129')]=function(_0x2a92a7){logger['info'](util[_0xc5a1('0x52')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x2a92a7[_0xc5a1('0x35')],_0x2a92a7[_0xc5a1('0x64')]));if(!this[_0xc5a1('0x84')](_0x2a92a7[_0xc5a1('0x90')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('no\x20key\x20configured');}var _0x2ffbf8='wav';var _0x923587=util[_0xc5a1('0x52')](_0xc5a1('0x12a'),FILES_PATH,rs[_0xc5a1('0x118')](0x4));var _0x75aa9a=util[_0xc5a1('0x52')](_0xc5a1('0x9c'),_0x923587,_0x2ffbf8);var _0x2d9b6d=!![];if(_0x2a92a7['beep']===_0xc5a1('0x12b')){_0x2d9b6d=![];}var _0x425d26=this[_0xc5a1('0xe')][_0xc5a1('0x12c')](_0x923587,_0x2ffbf8,_0x2a92a7[_0xc5a1('0x12d')],_0x2a92a7[_0xc5a1('0x64')],undefined,_0x2d9b6d);if(_0x425d26[_0xc5a1('0xa8')]!==-0x1){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('google\x20%s\x20file\x20created',_0x75aa9a));var _0x369f2d=this['googleASR'][_0xc5a1('0x6f')](this,_0x2a92a7,_0x75aa9a);if(_0x369f2d){for(var _0x1b4a9f in _0x369f2d){if(_0x369f2d[_0xc5a1('0x98')](_0x1b4a9f)){this[_0xc5a1('0xe')]['setVariable'](util[_0xc5a1('0x52')](_0xc5a1('0x12e'),_0x1b4a9f[_0xc5a1('0x69')]()),_0x369f2d[_0x1b4a9f]);}}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('GoogleASR\x20Result\x20%s',JSON[_0xc5a1('0x74')](_0x369f2d)));}}return _0x425d26;};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x12f')]=function(_0x3c755f){logger['info'](util['format'](_0xc5a1('0x130'),_0x3c755f[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x3c755f[_0xc5a1('0x91')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x131'));}if(!this[_0xc5a1('0x84')](_0x3c755f[_0xc5a1('0x92')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x132'));}var _0x4b7f5b='wav';var _0x49320d=util[_0xc5a1('0x52')](_0xc5a1('0x12a'),FILES_PATH,rs[_0xc5a1('0x118')](0x4));var _0x292de3=util[_0xc5a1('0x52')]('%s.%s',_0x49320d,_0x4b7f5b);var _0xfa051a=!![];if(_0x3c755f[_0xc5a1('0x133')]==='NOBEEP'){_0xfa051a=![];}var _0x13739f=this[_0xc5a1('0xe')][_0xc5a1('0x12c')](_0x49320d,_0x4b7f5b,_0x3c755f[_0xc5a1('0x12d')],_0x3c755f[_0xc5a1('0x64')],undefined,_0xfa051a);if(_0x13739f[_0xc5a1('0xa8')]!==-0x1){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x134'),_0x292de3));var _0x14d701=this[_0xc5a1('0x135')]['sync'](this,_0x3c755f,_0x292de3);if(_0x14d701){for(var _0x449ab1 in _0x14d701){if(_0x14d701['hasOwnProperty'](_0x449ab1)){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util[_0xc5a1('0x52')]('TILDE_ASR_%s',_0x449ab1[_0xc5a1('0x69')]()),_0x14d701[_0x449ab1]);}}return this[_0xc5a1('0xe')]['noop'](util[_0xc5a1('0x52')]('TildeASR\x20Result\x20%s',JSON[_0xc5a1('0x74')](_0x14d701)));}}return _0x13739f;};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x136')]=function(_0x2dce18){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0x137'),_0x2dce18[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0x138')](_0x2dce18[_0xc5a1('0x3a')],_0x2dce18[_0xc5a1('0x3b')],_0x2dce18[_0xc5a1('0x3c')]);};AGIVertices['prototype'][_0xc5a1('0x139')]=function(_0x34f3bf){logger[_0xc5a1('0x2b')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x34f3bf[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x34f3bf['condition'])){return this[_0xc5a1('0xe')]['error'](_0x34f3bf,_0xc5a1('0x13a'));}try{var _0x4c4667=eval(_0x34f3bf[_0xc5a1('0x13b')])?_0xc5a1('0x13c'):_0xc5a1('0x13d');this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x13e'),_0x34f3bf[_0xc5a1('0x13b')],_0x4c4667));return{'code':0xc8,'result':_0x4c4667};}catch(_0x44d814){return{'code':0xc8,'result':_0xc5a1('0x13d')};}};AGIVertices[_0xc5a1('0x11')]['gotoiftime']=function(_0x5145d9){logger[_0xc5a1('0x2b')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5145d9[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x5145d9[_0xc5a1('0x13f')])){return this['channel']['error'](_0x5145d9,_0xc5a1('0x140'));}var _0x958772=this[_0xc5a1('0x141')][_0xc5a1('0x6f')](this,_0x5145d9[_0xc5a1('0x13f')]);if(!_0x958772){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x5145d9,_0xc5a1('0x142'));}for(var _0x32a552=0x0;_0x32a552<_0x958772[_0xc5a1('0x9a')];_0x32a552+=0x1){var _0x3af701=this[_0xc5a1('0xe')][_0xc5a1('0xa1')](util[_0xc5a1('0x52')](_0xc5a1('0x143'),_0x958772[_0x32a552]));if(_0x3af701['result']===-0x1){return _0x3af701;}logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x144'),_0x958772[_0x32a552],_0x3af701[_0xc5a1('0x9f')]));if(_0x3af701[_0xc5a1('0x9f')]==='true'){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('IFTIME\x20%s\x20%s',_0x958772[_0x32a552],_0xc5a1('0x13c')));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('IFTIME\x20%s\x20%s',_0x958772[_0x32a552],_0xc5a1('0x13c')));return{'code':0xc8,'result':'true'};}else{logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('IFTIME\x20%s\x20%s',_0x958772[_0x32a552],_0xc5a1('0x13d')));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0x144'),_0x958772[_0x32a552],_0xc5a1('0x13d')));}}return{'code':0xc8,'result':_0xc5a1('0x13d')};};AGIVertices[_0xc5a1('0x11')]['hangup']=function(_0x104db5){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x145'),_0x104db5['label']));return this['channel']['hangup']();};AGIVertices['prototype'][_0xc5a1('0x146')]=function(_0x551457){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x147'),_0x551457['label']));if(!this[_0xc5a1('0x84')](_0x551457['key'])){return this['channel']['noop']('no\x20key\x20configured');}var _0x2fa15b=_0xc5a1('0x148');var _0x5b25d1=util['format'](_0xc5a1('0x12a'),FILES_PATH,rs[_0xc5a1('0x118')](0x4));var _0x5f30e7=util['format'](_0xc5a1('0x9c'),_0x5b25d1,_0x2fa15b);var _0x103ee3=!![];if(_0x551457[_0xc5a1('0x133')]===_0xc5a1('0x12b')){_0x103ee3=![];}var _0x5107c4=this[_0xc5a1('0xe')]['recordFile'](_0x5b25d1,_0x2fa15b,_0x551457[_0xc5a1('0x12d')],_0x551457[_0xc5a1('0x64')],undefined,_0x103ee3);if(_0x5107c4[_0xc5a1('0xa8')]!==-0x1){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x149'),_0x5f30e7));var _0x568296=this[_0xc5a1('0x82')]['sync'](this,_0x551457,_0x5f30e7);if(_0x568296){for(var _0xc8344e in _0x568296){if(_0x568296[_0xc5a1('0x98')](_0xc8344e)){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](util[_0xc5a1('0x52')](_0xc5a1('0x14a'),_0xc8344e['toUpperCase']()),_0x568296[_0xc8344e]);}}return this[_0xc5a1('0xe')]['noop'](util[_0xc5a1('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0xc5a1('0x74')](_0x568296)));}}return _0x5107c4;};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x14b')]=function(_0x1f8755){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x14c'),_0x1f8755['label']));if(!this[_0xc5a1('0x84')](_0x1f8755['key'])){return this['channel'][_0xc5a1('0xa9')]('no\x20key\x20configured');}if(!this[_0xc5a1('0x84')](_0x1f8755[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')]['noop'](util[_0xc5a1('0x52')](_0xc5a1('0x14d'),_0x1f8755[_0xc5a1('0x5b')]));var _0x570d87=this[_0xc5a1('0x81')][_0xc5a1('0x6f')](this,_0x1f8755);if(_0x570d87){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('ispeech\x20%s\x20file\x20created',_0x570d87));var _0x29431a=this[_0xc5a1('0xe')][_0xc5a1('0x14e')](_0x570d87,_0x1f8755[_0xc5a1('0x12d')]);try{fs[_0xc5a1('0xff')](_0x570d87+_0xc5a1('0x100'));}catch(_0x5a76fb){logger['error'](_0x5a76fb);}return _0x29431a;}return this[_0xc5a1('0xe')]['error'](_0x1f8755,_0xc5a1('0x14f'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x150')]=function(_0x59b0e6){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x151'),_0x59b0e6[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x59b0e6[_0xc5a1('0x152')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x59b0e6,'no\x20find\x20by\x20configured');}logger[_0xc5a1('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x59b0e6['findBy']));var _0xe1c51f=this['agentLogin']['sync'](this,_0x59b0e6[_0xc5a1('0x152')]);if(_0xe1c51f){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc5a1('0xe')]['callerid'],_0x59b0e6[_0xc5a1('0x152')]));this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x59b0e6['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x59b0e6[_0xc5a1('0x152')]));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x153'),this['channel']['callerid'],_0x59b0e6[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x154')};}};AGIVertices[_0xc5a1('0x11')]['logout']=function(_0x300b84){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0x155'),_0x300b84[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x300b84[_0xc5a1('0x152')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x300b84,'no\x20find\x20by\x20configured');}logger[_0xc5a1('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc5a1('0xe')]['callerid'],_0x300b84[_0xc5a1('0x152')]));var _0x460b5c=this[_0xc5a1('0x4e')]['sync'](this,_0x300b84['findBy']);if(_0x460b5c){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x156'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x300b84[_0xc5a1('0x152')]));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x156'),this['channel'][_0xc5a1('0x38')],_0x300b84[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x157')};}else{logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x153'),this['channel'][_0xc5a1('0x38')],_0x300b84[_0xc5a1('0x152')]));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x300b84[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x154')};}};AGIVertices[_0xc5a1('0x11')]['math']=function(_0x4ed5e7){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x158'),_0x4ed5e7['label']));if(!this[_0xc5a1('0x84')](_0x4ed5e7[_0xc5a1('0x159')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x4ed5e7,_0xc5a1('0x15a'));}this['channel'][_0xc5a1('0xa9')](util['format'](_0xc5a1('0x15b'),_0x4ed5e7['operation']));var _0x4f4ac4=eval(_0x4ed5e7[_0xc5a1('0x159')]);if(!this['isConfigured'](_0x4ed5e7[_0xc5a1('0xd4')])){return this['channel']['noop'](_0xc5a1('0xd5'));}var _0x4c6b36=this[_0xc5a1('0xa1')][_0xc5a1('0x6f')](this,_0x4ed5e7[_0xc5a1('0xd4')]);if(!_0x4c6b36){return this[_0xc5a1('0xe')]['error'](_0x4ed5e7,_0xc5a1('0x115'));}if(_['isArray'](_0x4f4ac4)){var _0x24c88b=this;_0x4f4ac4[_0xc5a1('0xd6')](function(_0x7429f1,_0x537f45){_0x24c88b['channel'][_0xc5a1('0x9d')](util[_0xc5a1('0x52')](_0xc5a1('0x15c'),_0x4c6b36,_0x537f45),_0x7429f1);});return this['channel'][_0xc5a1('0xa9')](util['format'](_0xc5a1('0x15d'),_0x4c6b36));}else{return this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0x4c6b36,_0x4f4ac4);}};AGIVertices['prototype'][_0xc5a1('0xb')]=function(_0x302619){logger['info'](util[_0xc5a1('0x52')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x302619[_0xc5a1('0x35')]));if(_0x302619[_0xc5a1('0xa3')]===0x0){return this[_0xc5a1('0xa2')](_0x302619);}_0x302619['retry']-=0x1;if(!this['isConfigured'](_0x302619[_0xc5a1('0x110')])){return this[_0xc5a1('0xe')]['error'](_0x302619,_0xc5a1('0x15e'));}var _0x1c840b=this[_0xc5a1('0x1c')][_0xc5a1('0x6f')](this,_0x302619[_0xc5a1('0x110')]);if(!_0x1c840b){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x302619,_0xc5a1('0x111'));}var _0x1c8b99=this['channel'][_0xc5a1('0x15f')](_0x1c840b,_0x302619[_0xc5a1('0x160')],_0x302619[_0xc5a1('0x161')]);var _0x59398c=_0x1c8b99[_0xc5a1('0xa8')];if(_0x1c8b99['result']===-0x1){this['createSquareDetailsReport'][_0xc5a1('0x6f')](this,_0x302619,'-1');return _0x1c8b99;}else if(_0x1c8b99[_0xc5a1('0x9f')]===_0xc5a1('0x64')){_0x1c8b99[_0xc5a1('0xa8')]=_0x1c8b99[_0xc5a1('0xa8')][_0xc5a1('0x9a')]>0x0?_0x1c8b99[_0xc5a1('0xa8')]:'t';}else if(_[_0xc5a1('0x41')](_0x1c8b99[_0xc5a1('0xa8')])){_0x1c8b99['result']='#';_0x59398c='#';}if(!this[_0xc5a1('0x84')](_0x302619[_0xc5a1('0xd4')])){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xd5'));}else{var _0x1c2dd2=this['getVariable'][_0xc5a1('0x6f')](this,_0x302619[_0xc5a1('0xd4')]);if(!_0x1c2dd2){return this[_0xc5a1('0xe')]['error'](_0x302619,_0xc5a1('0x115'));}this['channel'][_0xc5a1('0x9d')](_0x1c2dd2,_0x59398c);}this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x302619,_0x59398c);return _0x1c8b99;};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0xa9')]=function(_0x47875a){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x162'),_0x47875a[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0x47875a[_0xc5a1('0x163')]||_0x47875a['label']);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x164')]=function(_0x5b313c){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x165'),_0x5b313c[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x5b313c[_0xc5a1('0x152')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x5b313c,'no\x20find\x20by\x20configured');}logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x166'),this[_0xc5a1('0xe')]['callerid'],_0x5b313c[_0xc5a1('0x152')]));var _0x296efe=this[_0xc5a1('0x167')][_0xc5a1('0x6f')](this,_0x5b313c['pause_id']);var _0x4ab71c=this['agentPause'][_0xc5a1('0x6f')](this,_0x5b313c[_0xc5a1('0x152')],_0x296efe);if(_0x4ab71c){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x156'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x5b313c['findBy']));this['channel']['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x5b313c['findBy']));return{'code':0xc8,'result':_0xc5a1('0x157')};}else{logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x5b313c[_0xc5a1('0x152')]));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x5b313c[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x154')};}};AGIVertices['prototype'][_0xc5a1('0x168')]=function(_0x1bf384){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x169'),_0x1bf384['label']));if(!this[_0xc5a1('0x84')](_0x1bf384[_0xc5a1('0x110')])){return this['channel']['error'](_0x1bf384,_0xc5a1('0x15e'));}var _0x38f152=this[_0xc5a1('0x1c')][_0xc5a1('0x6f')](this,_0x1bf384[_0xc5a1('0x110')]);if(!_0x38f152){return this[_0xc5a1('0xe')]['error'](_0x1bf384,'no\x20file\x20audio\x20found');}var _0x411bc9=this[_0xc5a1('0xe')][_0xc5a1('0x55')]('PLAYBACK',[_0x38f152,_0x1bf384[_0xc5a1('0x10d')]]);if(_0x411bc9['result']===-0x1){return _0x411bc9;}return this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x38f152));};AGIVertices[_0xc5a1('0x11')]['queue']=function(_0x1c5bfa){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x1c5bfa[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x1c5bfa[_0xc5a1('0x16a')])){return this[_0xc5a1('0xe')]['error'](_0x1c5bfa,'no\x20queue\x20selected');}var _0x2b12bf='';var _0x445e0f=parseInt(_0x1c5bfa[_0xc5a1('0x16a')],0xa);if(isNaN(_0x445e0f)){_0x2b12bf=_0x1c5bfa['queue_id'];}else{_0x2b12bf=this[_0xc5a1('0x16b')][_0xc5a1('0x6f')](this,_0x1c5bfa[_0xc5a1('0x16a')]);if(!_0x2b12bf){return this['channel']['error'](_0x1c5bfa,'no\x20queue\x20found');}}var _0x97d987='';if(this[_0xc5a1('0x84')](_0x1c5bfa[_0xc5a1('0x110')])){var _0x5fc773=this[_0xc5a1('0x1c')][_0xc5a1('0x6f')](this,_0x1c5bfa['file_id']);if(_0x5fc773){_0x97d987=_0x5fc773;}}this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x1c5bfa,_0x2b12bf);if(_0x1c5bfa['opts']['indexOf']('x')<0x0){_0x1c5bfa['opts']+='x';}if(_0x1c5bfa[_0xc5a1('0x10d')][_0xc5a1('0x16c')]('X')<0x0){_0x1c5bfa[_0xc5a1('0x10d')]+='X';}this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0xc5a1('0x16d'),_0x2b12bf?_0x2b12bf[_0xc5a1('0x16e')]():'');var _0x53359b=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0x16f'),[_0x2b12bf,_0x1c5bfa['opts'],_0x1c5bfa[_0xc5a1('0x72')],_0x97d987,_0x1c5bfa[_0xc5a1('0x64')],_0x1c5bfa['agi'],_0x1c5bfa['macro'],_0x1c5bfa[_0xc5a1('0x170')],'',_0x1c5bfa[_0xc5a1('0x171')]]);if(_0x53359b[_0xc5a1('0xa8')]===-0x1){return _0x53359b;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xc5'),'QUEUE',_0x2b12bf));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x172')]=function(_0x14c275){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x14c275[_0xc5a1('0x35')]));var _0x36d307=_0x14c275[_0xc5a1('0x173')]||_0xc5a1('0x148');var _0x286516=util[_0xc5a1('0x52')](_0xc5a1('0x174'),this[_0xc5a1('0xe')][_0xc5a1('0x34')],rs[_0xc5a1('0x118')](0x5));var _0x591d3e=util[_0xc5a1('0x52')]('%s/recordings/%s.%s',FILES_PATH,_0x286516,_0x36d307);var _0x2c5377=util['format'](_0xc5a1('0x12a'),FILES_PATH,_0x286516);this[_0xc5a1('0x37')]['sync'](this,_0x14c275,_0x286516,_0x591d3e);this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0xc5a1('0x175'),_0x286516);logger[_0xc5a1('0x2b')](_0xc5a1('0x176'),_0x2c5377,_0x36d307,_0x14c275[_0xc5a1('0x177')],_0x14c275[_0xc5a1('0x64')]);return this[_0xc5a1('0xe')][_0xc5a1('0x12c')](_0x2c5377,_0x36d307,_0x14c275['escape_digits'],_0x14c275['timeout'],undefined,!![]);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x178')]=function(_0x52fbaf){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x179'),_0x52fbaf[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x52fbaf[_0xc5a1('0x72')])){return this[_0xc5a1('0xe')]['noop'](_0xc5a1('0x17a'));}var _0x14e211=this['restAPI'][_0xc5a1('0x6f')](this,_0x52fbaf);logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x17b'),util[_0xc5a1('0x17c')](_0x14e211,{'showHidden':![],'depth':null})));if(!this[_0xc5a1('0x84')](_0x52fbaf[_0xc5a1('0xd4')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x17d'));}var _0x4e34ec=this['getVariable'][_0xc5a1('0x6f')](this,_0x52fbaf[_0xc5a1('0xd4')]);if(!_0x4e34ec){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x52fbaf,'no\x20variable\x20found');}this[_0xc5a1('0xe')]['setVariable'](util[_0xc5a1('0x52')](_0xc5a1('0x17e'),_0x4e34ec),_0x14e211[_0xc5a1('0x76')]?_0x14e211[_0xc5a1('0x76')]:'200');this[_0xc5a1('0xe')]['setVariable'](util[_0xc5a1('0x52')](_0xc5a1('0x17f'),_0x4e34ec),_0x14e211[_0xc5a1('0x77')]?_0x14e211[_0xc5a1('0x77')]:'OK');if(_0x14e211['body']){try{this['saveRestApiResult'](_0x14e211[_0xc5a1('0x6a')],_0x4e34ec);}catch(_0x18b9e3){logger['error'](util[_0xc5a1('0x52')](_0xc5a1('0x180'),_0x4e34ec));}}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0xd9'),_0x4e34ec));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x181')]=function(_0x1fe256){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1fe256[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0x182')](_0x1fe256[_0xc5a1('0x183')][_0xc5a1('0x57')](/\s+/g,''),_0x1fe256[_0xc5a1('0x177')]);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x184')]=function(_0x13efc5){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0x185'),_0x13efc5[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0x186')](_0x13efc5['number'][_0xc5a1('0x57')](/\s+/g,''),_0x13efc5[_0xc5a1('0x177')]);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x187')]=function(_0x1ee79a){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x188'),_0x1ee79a[_0xc5a1('0x35')]));return this[_0xc5a1('0xe')][_0xc5a1('0x189')](_0x1ee79a[_0xc5a1('0x5b')],_0x1ee79a[_0xc5a1('0x177')]);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x18a')]=function(_0x2ada32){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2ada32[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x2ada32['account_id'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x18b'));}var _0x36ce8d=this['getMailAccount'][_0xc5a1('0x6f')](this,_0x2ada32[_0xc5a1('0x18c')]);if(!_0x36ce8d||!_0x36ce8d[_0xc5a1('0x18d')]){return this['channel'][_0xc5a1('0x28')](_0x2ada32,_0xc5a1('0x18e'));}var _0x357a76={'from':util[_0xc5a1('0x52')](_0xc5a1('0x18f'),_0x36ce8d['name'],_0x36ce8d['email']||_0x36ce8d[_0xc5a1('0x18d')][_0xc5a1('0x190')]),'to':_0x2ada32['to']||'','cc':_0x2ada32['cc']||'','bcc':_0x2ada32[_0xc5a1('0x191')]||'','subject':_0x2ada32[_0xc5a1('0x192')],'html':_0x2ada32['text'],'text':_0x2ada32[_0xc5a1('0x5b')]};if(this['isConfigured'](_0x2ada32[_0xc5a1('0x193')])){}logger[_0xc5a1('0xdb')]('sendMail\x20message',JSON['stringify'](_0x357a76));this['createSquareDetailsReport'][_0xc5a1('0x6f')](this,_0x2ada32,_0x2ada32[_0xc5a1('0x18c')]);this[_0xc5a1('0xe')]['noop'](util[_0xc5a1('0x52')](_0xc5a1('0x194'),_0x36ce8d[_0xc5a1('0x13')]));this[_0xc5a1('0x20')][_0xc5a1('0x6f')](this,_0x36ce8d[_0xc5a1('0x195')],_0x357a76);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x196'));};AGIVertices['prototype']['sendFax']=function(_0x43c119){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x197'),_0x43c119['label']));return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x198'));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x199')]=function(_0x27f701){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x19a'),_0x27f701[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x27f701['sms_account_id'])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x19b'));}var _0x355970=this[_0xc5a1('0x30')][_0xc5a1('0x6f')](this,_0x27f701[_0xc5a1('0x19c')]);if(!_0x355970){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x27f701,_0xc5a1('0x19d'));}var _0x36f22b={'body':_0x27f701[_0xc5a1('0x19e')],'phone':_0x27f701['to']||'','SmsAccountId':_0x355970['id']};logger[_0xc5a1('0xdb')](_0xc5a1('0x19f'),JSON[_0xc5a1('0x74')](_0x36f22b));this[_0xc5a1('0x33')][_0xc5a1('0x6f')](this,_0x27f701,_0x27f701[_0xc5a1('0x19c')]);this['channel'][_0xc5a1('0xa9')](util['format'](_0xc5a1('0x1a0'),_0x355970[_0xc5a1('0x13')]));this[_0xc5a1('0x32')]['sync'](this,_0x36f22b);return this[_0xc5a1('0xe')][_0xc5a1('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1a1')]=function(_0xe186e4){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0x1a2'),_0xe186e4[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0xe186e4[_0xc5a1('0xd4')])){return this[_0xc5a1('0xe')]['error'](_0xe186e4,_0xc5a1('0x1a3'));}var _0x55bf49=this[_0xc5a1('0xa1')][_0xc5a1('0x6f')](this,_0xe186e4[_0xc5a1('0xd4')]);if(!_0x55bf49){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0xe186e4,_0xc5a1('0x115'));}return this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0x55bf49,_0xe186e4[_0xc5a1('0x1a4')]);};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1a5')]=function(_0x5e34f7){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x1a6'),_0x5e34f7[_0xc5a1('0x35')]));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x1a7'));if(_0x5e34f7['answer']===_0xc5a1('0x1a8')){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x1a9'));return this[_0xc5a1('0xe')][_0xc5a1('0xbc')]();}return this['channel'][_0xc5a1('0xa9')](_0xc5a1('0x1aa'));};AGIVertices[_0xc5a1('0x11')]['subproject']=function(_0x2a8e8e){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x1ab'),_0x2a8e8e[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x2a8e8e[_0xc5a1('0x1ac')])){return this[_0xc5a1('0xe')]['error'](_0x2a8e8e,_0xc5a1('0x1ad'));}var _0x46dff4=this['getSquareProject'][_0xc5a1('0x6f')](this,_0x2a8e8e[_0xc5a1('0x1ac')]);if(!this['isConfigured'](_0x46dff4)){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x2a8e8e,util[_0xc5a1('0x52')](_0xc5a1('0x1ae'),_0x2a8e8e[_0xc5a1('0x1ac')]));}if(_0x46dff4===this[_0xc5a1('0xe')]['arg_1']){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x2a8e8e,_0xc5a1('0x1af'));}this['createSquareDetailsReport'][_0xc5a1('0x6f')](this,_0x2a8e8e,_0x46dff4);var _0x36d771=this[_0xc5a1('0xe')]['exec'](_0xc5a1('0x1b0'),util[_0xc5a1('0x52')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xc5a1('0x6')][_0xc5a1('0x1b1')]||_0xc5a1('0x1b2'),_0x46dff4,this[_0xc5a1('0xe')][_0xc5a1('0x36')]));if(_0x36d771[_0xc5a1('0xa8')]===-0x1){return _0x36d771;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util['format'](_0xc5a1('0xc5'),'AGI',_0x46dff4));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1b3')]=function(_0x1253c3){logger['info'](util[_0xc5a1('0x52')](_0xc5a1('0x1b4'),_0x1253c3[_0xc5a1('0x35')]));var _0x45c002=this[_0xc5a1('0x1b5')][_0xc5a1('0x6f')](this,_0x1253c3[_0xc5a1('0xb8')]);this['createSquareDetailsReport'][_0xc5a1('0x6f')](this,_0x1253c3,_0x1253c3[_0xc5a1('0xb8')]);if(this[_0xc5a1('0x84')](_0x1253c3[_0xc5a1('0xd4')])){var _0x5b64dc=this[_0xc5a1('0xa1')][_0xc5a1('0x6f')](this,_0x1253c3['variable_id']);if(_0x5b64dc){this[_0xc5a1('0xe')][_0xc5a1('0x9d')](_0x5b64dc,_0x45c002);return this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x1b6'),_0x1253c3[_0xc5a1('0xb8')],_0x5b64dc));}}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x1b7'),_0x1253c3['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x45d4e6){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x1b8'),_0x45d4e6['label']));_0x45d4e6[_0xc5a1('0x5b')]=_0x45d4e6[_0xc5a1('0x5b')][_0xc5a1('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x45d4e6[_0xc5a1('0x59')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0x1b9'));}if(!this[_0xc5a1('0x84')](_0x45d4e6[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x45d4e6['text']));var _0x605f9a=this[_0xc5a1('0x58')]['sync'](this,_0x45d4e6);if(_0x605f9a){this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x1ba'),_0x605f9a));var _0x300b5b=this[_0xc5a1('0xe')][_0xc5a1('0x14e')](_0x605f9a);try{fs[_0xc5a1('0xff')](_0x605f9a+'.wav');}catch(_0x1239fb){logger[_0xc5a1('0x28')](_0x1239fb);}return _0x300b5b;}return this[_0xc5a1('0xe')]['error'](_0x45d4e6,_0xc5a1('0x1bb'));};AGIVertices['prototype'][_0xc5a1('0x1bc')]=function(_0x352b7d){logger['info'](util['format'](_0xc5a1('0x1bd'),_0x352b7d[_0xc5a1('0x35')]));_0x352b7d['text']=_0x352b7d[_0xc5a1('0x5b')][_0xc5a1('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc5a1('0x84')](_0x352b7d[_0xc5a1('0x5b')])){return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](_0xc5a1('0xa6'));}this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x1be'),_0x352b7d[_0xc5a1('0x5b')]));var _0x1f8520=this[_0xc5a1('0x60')][_0xc5a1('0x6f')](this,_0x352b7d);if(_0x1f8520){this['channel'][_0xc5a1('0xa9')](util['format'](_0xc5a1('0x1bf'),_0x1f8520));var _0x3db7e3=this[_0xc5a1('0xe')][_0xc5a1('0x14e')](_0x1f8520);try{fs[_0xc5a1('0xff')](_0x1f8520+_0xc5a1('0x100'));}catch(_0x1fdc4f){logger[_0xc5a1('0x28')](_0x1fdc4f);}return _0x3db7e3;}return this[_0xc5a1('0xe')]['error'](_0x352b7d,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1c0')]=function(_0x40684c){logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x1c1'),_0x40684c[_0xc5a1('0x35')]));if(!this[_0xc5a1('0x84')](_0x40684c[_0xc5a1('0x152')])){return this['channel']['error'](_0x40684c,_0xc5a1('0x1c2'));}logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x166'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x40684c['findBy']));var _0x421a6f=this['agentUnpause'][_0xc5a1('0x6f')](this,_0x40684c[_0xc5a1('0x152')]);if(_0x421a6f){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x156'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x40684c['findBy']));this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x156'),this['channel'][_0xc5a1('0x38')],_0x40684c[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x157')};}else{logger[_0xc5a1('0x2b')](util['format'](_0xc5a1('0x153'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x40684c[_0xc5a1('0x152')]));this['channel'][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0x153'),this[_0xc5a1('0xe')][_0xc5a1('0x38')],_0x40684c[_0xc5a1('0x152')]));return{'code':0xc8,'result':_0xc5a1('0x154')};}};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1c3')]=function(_0x52a588){logger[_0xc5a1('0x2b')](util[_0xc5a1('0x52')](_0xc5a1('0x1c4'),_0x52a588[_0xc5a1('0x35')]));var _0x35c778=this[_0xc5a1('0xe')][_0xc5a1('0x55')](_0xc5a1('0x1c5'),[_0x52a588[_0xc5a1('0x1c6')],_0x52a588[_0xc5a1('0x7a')]]);if(_0x35c778[_0xc5a1('0xa8')]===-0x1){return _0x35c778;}return this[_0xc5a1('0xe')][_0xc5a1('0xa9')](util[_0xc5a1('0x52')](_0xc5a1('0xc5'),'VOICEMAIL',_0x52a588[_0xc5a1('0x1c6')]));};AGIVertices[_0xc5a1('0x11')][_0xc5a1('0x1c7')]=function(_0x4b5409){logger['info'](util[_0xc5a1('0x52')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4b5409[_0xc5a1('0x35')]));if(!this['isConfigured'](_0x4b5409[_0xc5a1('0xd4')])){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x4b5409,_0xc5a1('0x1a3'));}var _0x17a984=this[_0xc5a1('0xa1')][_0xc5a1('0x6f')](this,_0x4b5409[_0xc5a1('0xd4')]);if(!_0x17a984){return this[_0xc5a1('0xe')][_0xc5a1('0x28')](_0x4b5409,_0xc5a1('0x115'));}var _0x34b6ea=this[_0xc5a1('0xe')][_0xc5a1('0xa1')](_0x17a984);return{'code':0xc8,'result':_0x34b6ea[_0xc5a1('0x9f')]?_0x34b6ea[_0xc5a1('0x9f')]:'-'};};String['prototype'][_0xc5a1('0x1c8')]=function(_0xa78376,_0x358f75){return this['split'](_0xa78376)[_0xc5a1('0x1c9')](_0x358f75);};module[_0xc5a1('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 069f047..118d74f 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 _0x3860=['queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','acw','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface'];(function(_0x5b1c58,_0x29581b){var _0x2e25d3=function(_0x5f56b6){while(--_0x5f56b6){_0x5b1c58['push'](_0x5b1c58['shift']());}};_0x2e25d3(++_0x29581b);}(_0x3860,0x90));var _0x0386=function(_0x5ae7f6,_0x1f422b){_0x5ae7f6=_0x5ae7f6-0x0;var _0x16ae63=_0x3860[_0x5ae7f6];return _0x16ae63;};'use strict';var _=require(_0x0386('0x0'));var moment=require(_0x0386('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x0386('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5f2870){this[_0x0386('0x3')]=_0x5f2870[_0x0386('0x3')];this['agents']=_0x5f2870[_0x0386('0x4')];this[_0x0386('0x5')]=_0x5f2870['timers'];this['channels']={};ami['on'](_0x0386('0x6'),this['syncAgentConnect'][_0x0386('0x7')](this));ami['on'](_0x0386('0x8'),this[_0x0386('0x9')]['bind'](this));ami['on'](_0x0386('0xa'),this[_0x0386('0xb')][_0x0386('0x7')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0386('0x7')](this));ami['on'](_0x0386('0xc'),this['syncAttendedTransfer'][_0x0386('0x7')](this));ami['on'](_0x0386('0xd'),this[_0x0386('0xe')][_0x0386('0x7')](this));ami['on'](_0x0386('0xf'),this[_0x0386('0x10')][_0x0386('0x7')](this));}function getDiff(_0x11c08a){var _0x2d6004=moment()[_0x0386('0x11')](0x0);var _0x1f324c=moment(_0x11c08a)['milliseconds'](0x0);return _0x2d6004[_0x0386('0x12')](_0x1f324c,_0x0386('0x13'));}Acw[_0x0386('0x14')][_0x0386('0x15')]=function(_0x14cafd){try{var _0x3d1548=this;var _0x3f1d98=this[_0x0386('0x16')][_0x14cafd][_0x0386('0x17')];var _0x15dc28=this['channels'][_0x14cafd][_0x0386('0x18')];var _0x254135=this[_0x0386('0x3')][_0x15dc28];var _0x5b3428=![];var _0x7025d5=_0x0386('0x19');if(_0x254135[_0x0386('0x1a')]){if(_0x254135[_0x0386('0x1b')][_0x0386('0x1c')]){_0x5b3428=!![];_0x7025d5=_0x254135['mandatoryDispositionPause']['name'];}}return ami[_0x0386('0x1d')]({'action':'QueuePause','interface':_0x3f1d98,'paused':!![],'reason':_0x7025d5})[_0x0386('0x1e')](function(){if(_0x3d1548[_0x0386('0x4')][_0x3f1d98]){return RpcUser[_0x0386('0x1f')](_0x3d1548[_0x0386('0x4')][_0x3f1d98]['id'])[_0x0386('0x1e')](function(_0x598b10){if(_0x598b10&&!_0x598b10['voicePause']){logger[_0x0386('0x20')](_0x0386('0x21'),_0x14cafd,_0x3f1d98,_0x15dc28);var _0x59dbf8=_0x3d1548[_0x0386('0x16')][_0x14cafd][_0x0386('0x22')]&&_0x3d1548[_0x0386('0x16')][_0x14cafd]['destlinkedid']?_0x3d1548[_0x0386('0x16')][_0x14cafd][_0x0386('0x23')]:_0x14cafd;return RpcUser[_0x0386('0x24')](_0x3d1548['agents'][_0x3f1d98],_0x7025d5,_0x59dbf8)[_0x0386('0x1e')](function(){if(!_0x5b3428){_0x3d1548[_0x0386('0x5')][_0x3f1d98]={};logger[_0x0386('0x20')](_0x0386('0x25'),_0x14cafd,_0x3d1548[_0x0386('0x3')][_0x15dc28][_0x0386('0x26')],_0x3f1d98,_0x15dc28);_0x3d1548['timers'][_0x3f1d98]['timer']=setTimeout(_0x3d1548[_0x0386('0x27')][_0x0386('0x7')](_0x3d1548,_0x3f1d98),_0x3d1548[_0x0386('0x3')][_0x15dc28]['acwTimeout']*0x3e8);_0x3d1548[_0x0386('0x5')][_0x3f1d98]['lastPauseAt']=moment()[_0x0386('0x28')](_0x0386('0x29'));_0x3d1548['timers'][_0x3f1d98][_0x0386('0x2a')]=_0x14cafd;_0x3d1548['timers'][_0x3f1d98][_0x0386('0x18')]=_0x15dc28;_0x3d1548['timers'][_0x3f1d98][_0x0386('0x2b')]=function(){var _0x4207fd=getDiff(_0x3d1548[_0x0386('0x5')][_0x3f1d98][_0x0386('0x2c')]);clearTimeout(_0x3d1548[_0x0386('0x5')][_0x3f1d98][_0x0386('0x2d')]);_0x3d1548['timers'][_0x3f1d98][_0x0386('0x2d')]=![];RpcVoiceAgentReport[_0x0386('0x2e')]({'acwtime':_0x4207fd},_0x3d1548['timers'][_0x3f1d98][_0x0386('0x2a')],_0x3f1d98)[_0x0386('0x1e')](function(_0x309a50){logger['info'](_0x0386('0x2f'),_0x14cafd,_0x4207fd,_0x309a50);})[_0x0386('0x30')](function(_0x5e1c90){logger[_0x0386('0x31')](_0x0386('0x32'),_0x14cafd,_0x5e1c90);});delete _0x3d1548[_0x0386('0x5')][_0x3f1d98];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x14cafd,_0x3f1d98,_0x15dc28);}});}})[_0x0386('0x30')](function(){logger[_0x0386('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x14cafd,_0x3d1548[_0x0386('0x3')][_0x15dc28][_0x0386('0x26')],_0x3f1d98,_0x15dc28);})['finally'](function(){delete _0x3d1548['channels'][_0x14cafd];});}catch(_0x191001){logger[_0x0386('0x31')]('[ACW][START]\x20%s',_0x191001['message']);}};Acw[_0x0386('0x14')][_0x0386('0x27')]=function(_0x21a8a6){try{var _0x1b52f6=this;if(_0x1b52f6[_0x0386('0x5')][_0x21a8a6]){_0x1b52f6[_0x0386('0x5')][_0x21a8a6][_0x0386('0x2d')]=![];var _0x17f42c=_0x1b52f6[_0x0386('0x5')][_0x21a8a6]['uniqueid'];var _0x3afe20=_0x1b52f6[_0x0386('0x5')][_0x21a8a6][_0x0386('0x18')];var _0x572031=_0x1b52f6['voiceQueues'][_0x3afe20][_0x0386('0x26')];logger[_0x0386('0x20')](_0x0386('0x33'),_0x17f42c,_0x21a8a6);RpcUser[_0x0386('0x34')](this[_0x0386('0x4')][_0x21a8a6]);RpcVoiceAgentReport[_0x0386('0x2e')]({'acwtime':_0x572031,'agentacw':!![]},_0x17f42c,_0x21a8a6)[_0x0386('0x1e')](function(_0x3d5a4a){logger[_0x0386('0x20')](_0x0386('0x2f'),_0x17f42c,_0x572031,_0x3d5a4a);})[_0x0386('0x30')](function(_0x257925){logger[_0x0386('0x31')](_0x0386('0x32'),_0x17f42c,_0x257925);});}else{logger[_0x0386('0x31')](_0x0386('0x35'),_0x21a8a6);if(_0x1b52f6['timers']){logger[_0x0386('0x20')](_0x0386('0x36'),JSON[_0x0386('0x37')](_0x1b52f6[_0x0386('0x5')]));}}}catch(_0x2389ce){logger[_0x0386('0x31')](_0x0386('0x38'),_0x2389ce[_0x0386('0x39')]);}};Acw[_0x0386('0x14')][_0x0386('0x3a')]=function(_0xcb5e29){try{if(this[_0x0386('0x3')][_0xcb5e29['queue']]&&(this[_0x0386('0x3')][_0xcb5e29[_0x0386('0x18')]][_0x0386('0x2')]||this[_0x0386('0x3')][_0xcb5e29[_0x0386('0x18')]][_0x0386('0x1a')])){if(this['agents'][_0xcb5e29[_0x0386('0x17')]]){this[_0x0386('0x16')][_0xcb5e29[_0x0386('0x2a')]]={'queue':_0xcb5e29[_0x0386('0x18')],'interface':_0xcb5e29[_0x0386('0x17')],'destlinkedid':_0xcb5e29[_0x0386('0x23')]};}}}catch(_0xc35922){logger[_0x0386('0x31')](_0x0386('0x3b'),_0xc35922[_0x0386('0x39')]);}};Acw[_0x0386('0x14')][_0x0386('0x10')]=function(_0x4c8d4a){try{if(this[_0x0386('0x3')][_0x4c8d4a[_0x0386('0x18')]]&&(this[_0x0386('0x3')][_0x4c8d4a['queue']][_0x0386('0x2')]||this[_0x0386('0x3')][_0x4c8d4a[_0x0386('0x18')]][_0x0386('0x1a')])){if(this[_0x0386('0x4')][_0x4c8d4a['interface']]){this[_0x0386('0x16')][_0x4c8d4a['uniqueid']]={'queue':_0x4c8d4a[_0x0386('0x18')],'interface':_0x4c8d4a[_0x0386('0x17')]};}}}catch(_0xaa9e5b){logger[_0x0386('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0xaa9e5b[_0x0386('0x39')]);}};Acw[_0x0386('0x14')][_0x0386('0x9')]=function(_0x101663){try{if(this['channels'][_0x101663[_0x0386('0x2a')]]&&_[_0x0386('0x3c')](this[_0x0386('0x16')][_0x101663[_0x0386('0x2a')]]['attended'])){logger[_0x0386('0x20')](_0x0386('0x3d'),_0x101663['uniqueid']);this[_0x0386('0x15')](_0x101663[_0x0386('0x2a')]);}else if(this[_0x0386('0x16')][_0x101663['linkedid']]&&_['isUndefined'](this[_0x0386('0x16')][_0x101663[_0x0386('0x3e')]]['attended'])){logger[_0x0386('0x20')](_0x0386('0x3f'),_0x101663[_0x0386('0x3e')]);this[_0x0386('0x15')](_0x101663[_0x0386('0x3e')]);}}catch(_0x3dfdb7){logger[_0x0386('0x31')](_0x0386('0x40'),_0x3dfdb7['message']);}};Acw[_0x0386('0x14')]['syncHangup']=function(_0x49bb5d){try{if(this[_0x0386('0x16')][_0x49bb5d['uniqueid']]&&this[_0x0386('0x16')][_0x49bb5d[_0x0386('0x2a')]][_0x0386('0x22')]){logger[_0x0386('0x20')](_0x0386('0x41'),_0x49bb5d[_0x0386('0x2a')]);this[_0x0386('0x15')](_0x49bb5d[_0x0386('0x2a')]);}else if(this['channels'][_0x49bb5d['linkedid']]&&this[_0x0386('0x16')][_0x49bb5d[_0x0386('0x3e')]][_0x0386('0x22')]){logger[_0x0386('0x20')](_0x0386('0x42'),_0x49bb5d[_0x0386('0x3e')]);this[_0x0386('0x15')](_0x49bb5d['linkedid']);}}catch(_0x20bb20){logger[_0x0386('0x31')](_0x0386('0x43'),_0x20bb20[_0x0386('0x39')]);}};Acw[_0x0386('0x14')][_0x0386('0x44')]=function(_0x273966){try{if(!_[_0x0386('0x45')](this[_0x0386('0x16')][_0x273966[_0x0386('0x46')]])){this[_0x0386('0x15')](_0x273966[_0x0386('0x46')]);if(this[_0x0386('0x16')][_0x273966['secondtransfereruniqueid']]){this[_0x0386('0x16')][_0x273966[_0x0386('0x47')]][_0x0386('0x22')]=!![];this[_0x0386('0x16')][_0x273966['transfertargetuniqueid']]=this['channels'][_0x273966[_0x0386('0x47')]];delete this[_0x0386('0x16')][_0x273966[_0x0386('0x47')]];}}else if(!_[_0x0386('0x45')](this['channels'][_0x273966[_0x0386('0x48')]])){this[_0x0386('0x15')](_0x273966[_0x0386('0x48')]);if(this['channels'][_0x273966['origtransfereruniqueid']]){this[_0x0386('0x16')][_0x273966[_0x0386('0x49')]]['attended']=!![];this[_0x0386('0x16')][_0x273966[_0x0386('0x46')]]=this[_0x0386('0x16')][_0x273966[_0x0386('0x49')]];delete this[_0x0386('0x16')][_0x273966[_0x0386('0x49')]];}}}catch(_0x39bad1){logger[_0x0386('0x31')](_0x0386('0x4a'),_0x39bad1[_0x0386('0x39')]);}};Acw[_0x0386('0x14')]['syncBlindTransfer']=function(_0x208679){try{if(this[_0x0386('0x16')][_0x208679[_0x0386('0x4b')]]){logger[_0x0386('0x20')](_0x0386('0x4c'),JSON[_0x0386('0x37')](_0x208679['transfereruniqueid']));this[_0x0386('0x15')](_0x208679['transfereruniqueid']);}else if(this['channels'][_0x208679[_0x0386('0x4d')]]){logger[_0x0386('0x20')](_0x0386('0x4e'),JSON['stringify'](_0x208679['transfererlinkedid']));this[_0x0386('0x15')](_0x208679[_0x0386('0x4d')]);}}catch(_0x3cb5bc){logger[_0x0386('0x31')](_0x0386('0x4f'),_0x3cb5bc[_0x0386('0x39')]);}};Acw[_0x0386('0x14')][_0x0386('0x50')]=function(_0x5b073d){try{if(this['voiceQueues'][_0x5b073d[_0x0386('0x18')]]&&this['voiceQueues'][_0x5b073d['queue']][_0x0386('0x51')]==='all'){if(this[_0x0386('0x4')][_0x5b073d[_0x0386('0x17')]]){logger[_0x0386('0x20')](_0x0386('0x52'),_0x5b073d[_0x0386('0x2a')],_0x5b073d[_0x0386('0x17')],_0x5b073d['queue']);return RpcUser['savePause'](this[_0x0386('0x4')][_0x5b073d['interface']],'Auto-Pause',_0x5b073d[_0x0386('0x2a')]);}}}catch(_0x20c446){logger[_0x0386('0x31')](_0x0386('0x53'),_0x20c446[_0x0386('0x39')]);}};module['exports']=Acw; \ No newline at end of file +var _0x5e11=['syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','isUndefined','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','custom:agentConnectPreview'];(function(_0x29d52c,_0x49669a){var _0x33c6c5=function(_0x2c47f7){while(--_0x2c47f7){_0x29d52c['push'](_0x29d52c['shift']());}};_0x33c6c5(++_0x49669a);}(_0x5e11,0x96));var _0x15e1=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x5e11[_0x30033a];return _0x5e3518;};'use strict';var _=require(_0x15e1('0x0'));var moment=require(_0x15e1('0x1'));var ami=require(_0x15e1('0x2'));var logger=require(_0x15e1('0x3'))(_0x15e1('0x4'));var RpcUser=require(_0x15e1('0x5'));var RpcVoiceAgentReport=require(_0x15e1('0x6'));function Acw(_0x28d5ae){this['voiceQueues']=_0x28d5ae[_0x15e1('0x7')];this[_0x15e1('0x8')]=_0x28d5ae['agents'];this['timers']=_0x28d5ae[_0x15e1('0x9')];this[_0x15e1('0xa')]={};ami['on'](_0x15e1('0xb'),this[_0x15e1('0xc')][_0x15e1('0xd')](this));ami['on'](_0x15e1('0xe'),this[_0x15e1('0xf')][_0x15e1('0xd')](this));ami['on'](_0x15e1('0x10'),this[_0x15e1('0x11')]['bind'](this));ami['on'](_0x15e1('0x12'),this[_0x15e1('0x13')][_0x15e1('0xd')](this));ami['on'](_0x15e1('0x14'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x15e1('0xd')](this));ami['on'](_0x15e1('0x15'),this[_0x15e1('0x16')][_0x15e1('0xd')](this));}function getDiff(_0x5e636a){var _0x315c08=moment()[_0x15e1('0x17')](0x0);var _0x422e55=moment(_0x5e636a)[_0x15e1('0x17')](0x0);return _0x315c08[_0x15e1('0x18')](_0x422e55,_0x15e1('0x19'));}Acw[_0x15e1('0x1a')][_0x15e1('0x1b')]=function(_0x3e2c9d){try{var _0x5a662f=this;var _0x4bd192=this['channels'][_0x3e2c9d][_0x15e1('0x1c')];var _0xffffae=this['channels'][_0x3e2c9d][_0x15e1('0x1d')];var _0x23ca92=this['voiceQueues'][_0xffffae];var _0x2057c8=![];var _0x4833e4='ACW';if(_0x23ca92[_0x15e1('0x1e')]){if(_0x23ca92[_0x15e1('0x1f')][_0x15e1('0x20')]){_0x2057c8=!![];_0x4833e4=_0x23ca92['mandatoryDispositionPause'][_0x15e1('0x20')];}}return ami[_0x15e1('0x21')]({'action':_0x15e1('0x22'),'interface':_0x4bd192,'paused':!![],'reason':_0x4833e4})[_0x15e1('0x23')](function(){if(_0x5a662f[_0x15e1('0x8')][_0x4bd192]){return RpcUser[_0x15e1('0x24')](_0x5a662f[_0x15e1('0x8')][_0x4bd192]['id'])[_0x15e1('0x23')](function(_0x1ea392){if(_0x1ea392&&!_0x1ea392[_0x15e1('0x25')]){logger[_0x15e1('0x26')](_0x15e1('0x27'),_0x3e2c9d,_0x4bd192,_0xffffae);var _0x1f947f=_0x5a662f[_0x15e1('0xa')][_0x3e2c9d][_0x15e1('0x28')]&&_0x5a662f[_0x15e1('0xa')][_0x3e2c9d]['destlinkedid']?_0x5a662f[_0x15e1('0xa')][_0x3e2c9d][_0x15e1('0x29')]:_0x3e2c9d;return RpcUser[_0x15e1('0x2a')](_0x5a662f[_0x15e1('0x8')][_0x4bd192],_0x4833e4,_0x1f947f)[_0x15e1('0x23')](function(){if(!_0x2057c8){_0x5a662f['timers'][_0x4bd192]={};logger[_0x15e1('0x26')](_0x15e1('0x2b'),_0x3e2c9d,_0x5a662f[_0x15e1('0x7')][_0xffffae][_0x15e1('0x2c')],_0x4bd192,_0xffffae);_0x5a662f['timers'][_0x4bd192][_0x15e1('0x2d')]=setTimeout(_0x5a662f[_0x15e1('0x2e')][_0x15e1('0xd')](_0x5a662f,_0x4bd192),_0x5a662f[_0x15e1('0x7')][_0xffffae][_0x15e1('0x2c')]*0x3e8);_0x5a662f['timers'][_0x4bd192]['lastPauseAt']=moment()['format'](_0x15e1('0x2f'));_0x5a662f['timers'][_0x4bd192][_0x15e1('0x30')]=_0x3e2c9d;_0x5a662f[_0x15e1('0x9')][_0x4bd192]['queue']=_0xffffae;_0x5a662f['timers'][_0x4bd192][_0x15e1('0x31')]=function(){var _0xf2b9d4=getDiff(_0x5a662f[_0x15e1('0x9')][_0x4bd192][_0x15e1('0x32')]);clearTimeout(_0x5a662f[_0x15e1('0x9')][_0x4bd192]['timer']);_0x5a662f[_0x15e1('0x9')][_0x4bd192][_0x15e1('0x2d')]=![];RpcVoiceAgentReport[_0x15e1('0x33')]({'acwtime':_0xf2b9d4},_0x5a662f[_0x15e1('0x9')][_0x4bd192]['uniqueid'],_0x4bd192)[_0x15e1('0x23')](function(_0x1f9f1a){logger[_0x15e1('0x26')](_0x15e1('0x34'),_0x3e2c9d,_0xf2b9d4,_0x1f9f1a);})[_0x15e1('0x35')](function(_0x3d5318){logger['error'](_0x15e1('0x36'),_0x3e2c9d,_0x3d5318);});delete _0x5a662f['timers'][_0x4bd192];};}});}else{logger[_0x15e1('0x26')](_0x15e1('0x37'),_0x3e2c9d,_0x4bd192,_0xffffae);}});}})[_0x15e1('0x35')](function(){logger[_0x15e1('0x38')](_0x15e1('0x2b'),_0x3e2c9d,_0x5a662f[_0x15e1('0x7')][_0xffffae][_0x15e1('0x2c')],_0x4bd192,_0xffffae);})[_0x15e1('0x39')](function(){delete _0x5a662f[_0x15e1('0xa')][_0x3e2c9d];});}catch(_0x3a508b){logger['error'](_0x15e1('0x3a'),_0x3a508b[_0x15e1('0x3b')]);}};Acw[_0x15e1('0x1a')][_0x15e1('0x2e')]=function(_0x11915d){try{var _0x4e8237=this;if(_0x4e8237[_0x15e1('0x9')][_0x11915d]){_0x4e8237[_0x15e1('0x9')][_0x11915d][_0x15e1('0x2d')]=![];var _0x32f2c0=_0x4e8237[_0x15e1('0x9')][_0x11915d][_0x15e1('0x30')];var _0x5338dc=_0x4e8237[_0x15e1('0x9')][_0x11915d][_0x15e1('0x1d')];var _0x351516=_0x4e8237[_0x15e1('0x7')][_0x5338dc][_0x15e1('0x2c')];logger[_0x15e1('0x26')](_0x15e1('0x3c'),_0x32f2c0,_0x11915d);RpcUser[_0x15e1('0x3d')](this[_0x15e1('0x8')][_0x11915d]);RpcVoiceAgentReport[_0x15e1('0x33')]({'acwtime':_0x351516,'agentacw':!![]},_0x32f2c0,_0x11915d)[_0x15e1('0x23')](function(_0x380ce9){logger[_0x15e1('0x26')](_0x15e1('0x34'),_0x32f2c0,_0x351516,_0x380ce9);})[_0x15e1('0x35')](function(_0x2c009b){logger[_0x15e1('0x38')](_0x15e1('0x36'),_0x32f2c0,_0x2c009b);});}else{logger['error'](_0x15e1('0x3e'),_0x11915d);if(_0x4e8237[_0x15e1('0x9')]){logger[_0x15e1('0x26')](_0x15e1('0x3f'),JSON[_0x15e1('0x40')](_0x4e8237['timers']));}}}catch(_0x398c8e){logger[_0x15e1('0x38')]('[ACW][STOP]\x20%s',_0x398c8e[_0x15e1('0x3b')]);}};Acw['prototype']['syncAgentConnect']=function(_0x3e0adf){try{if(this[_0x15e1('0x7')][_0x3e0adf[_0x15e1('0x1d')]]&&(this[_0x15e1('0x7')][_0x3e0adf[_0x15e1('0x1d')]]['acw']||this['voiceQueues'][_0x3e0adf[_0x15e1('0x1d')]][_0x15e1('0x1e')])){if(this[_0x15e1('0x8')][_0x3e0adf[_0x15e1('0x1c')]]){this[_0x15e1('0xa')][_0x3e0adf[_0x15e1('0x30')]]={'queue':_0x3e0adf[_0x15e1('0x1d')],'interface':_0x3e0adf[_0x15e1('0x1c')],'destlinkedid':_0x3e0adf['destlinkedid']};}}}catch(_0x3b7143){logger[_0x15e1('0x38')](_0x15e1('0x41'),_0x3b7143['message']);}};Acw[_0x15e1('0x1a')][_0x15e1('0x16')]=function(_0x3a88ce){try{if(this[_0x15e1('0x7')][_0x3a88ce['queue']]&&(this[_0x15e1('0x7')][_0x3a88ce['queue']][_0x15e1('0x4')]||this['voiceQueues'][_0x3a88ce[_0x15e1('0x1d')]][_0x15e1('0x1e')])){if(this[_0x15e1('0x8')][_0x3a88ce['interface']]){this['channels'][_0x3a88ce[_0x15e1('0x30')]]={'queue':_0x3a88ce[_0x15e1('0x1d')],'interface':_0x3a88ce[_0x15e1('0x1c')]};}}}catch(_0x58f2e5){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x58f2e5[_0x15e1('0x3b')]);}};Acw['prototype'][_0x15e1('0xf')]=function(_0x45e5b1){try{if(this['channels'][_0x45e5b1['uniqueid']]&&_[_0x15e1('0x42')](this[_0x15e1('0xa')][_0x45e5b1['uniqueid']]['attended'])){logger[_0x15e1('0x26')]('[%s][HANGUP:UNIQUEID]',_0x45e5b1['uniqueid']);this[_0x15e1('0x1b')](_0x45e5b1[_0x15e1('0x30')]);}else if(this[_0x15e1('0xa')][_0x45e5b1['linkedid']]&&_[_0x15e1('0x42')](this[_0x15e1('0xa')][_0x45e5b1['linkedid']][_0x15e1('0x28')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x45e5b1[_0x15e1('0x43')]);this[_0x15e1('0x1b')](_0x45e5b1[_0x15e1('0x43')]);}}catch(_0x4ad2c0){logger[_0x15e1('0x38')]('[ACW][syncHangupRequest]\x20%s',_0x4ad2c0[_0x15e1('0x3b')]);}};Acw[_0x15e1('0x1a')][_0x15e1('0x11')]=function(_0x506c63){try{if(this[_0x15e1('0xa')][_0x506c63[_0x15e1('0x30')]]&&this[_0x15e1('0xa')][_0x506c63[_0x15e1('0x30')]][_0x15e1('0x28')]){logger[_0x15e1('0x26')](_0x15e1('0x44'),_0x506c63[_0x15e1('0x30')]);this[_0x15e1('0x1b')](_0x506c63[_0x15e1('0x30')]);}else if(this['channels'][_0x506c63[_0x15e1('0x43')]]&&this[_0x15e1('0xa')][_0x506c63['linkedid']][_0x15e1('0x28')]){logger[_0x15e1('0x26')](_0x15e1('0x45'),_0x506c63[_0x15e1('0x43')]);this['startAcw'](_0x506c63[_0x15e1('0x43')]);}}catch(_0x33ff57){logger['error'](_0x15e1('0x46'),_0x33ff57[_0x15e1('0x3b')]);}};Acw[_0x15e1('0x1a')][_0x15e1('0x47')]=function(_0x26ba6b){try{if(!_[_0x15e1('0x48')](this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x49')]])){this[_0x15e1('0x1b')](_0x26ba6b[_0x15e1('0x49')]);if(this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4a')]]){this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4a')]]['attended']=!![];this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4b')]]=this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4a')]];delete this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4a')]];}}else if(!_[_0x15e1('0x48')](this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4b')]])){this[_0x15e1('0x1b')](_0x26ba6b['transfertargetuniqueid']);if(this['channels'][_0x26ba6b[_0x15e1('0x4c')]]){this[_0x15e1('0xa')][_0x26ba6b['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x26ba6b['transfereeuniqueid']]=this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4c')]];delete this[_0x15e1('0xa')][_0x26ba6b[_0x15e1('0x4c')]];}}}catch(_0x525f44){logger[_0x15e1('0x38')](_0x15e1('0x4d'),_0x525f44['message']);}};Acw[_0x15e1('0x1a')]['syncBlindTransfer']=function(_0x598913){try{if(this['channels'][_0x598913['transfereruniqueid']]){logger[_0x15e1('0x26')](_0x15e1('0x4e'),JSON[_0x15e1('0x40')](_0x598913['transfereruniqueid']));this['startAcw'](_0x598913[_0x15e1('0x4f')]);}else if(this[_0x15e1('0xa')][_0x598913[_0x15e1('0x50')]]){logger[_0x15e1('0x26')](_0x15e1('0x51'),JSON[_0x15e1('0x40')](_0x598913['transfererlinkedid']));this[_0x15e1('0x1b')](_0x598913[_0x15e1('0x50')]);}}catch(_0x664105){logger[_0x15e1('0x38')](_0x15e1('0x52'),_0x664105['message']);}};Acw[_0x15e1('0x1a')]['syncAgentRingNoAnswer']=function(_0x22c59a){try{if(this[_0x15e1('0x7')][_0x22c59a[_0x15e1('0x1d')]]&&this[_0x15e1('0x7')][_0x22c59a[_0x15e1('0x1d')]][_0x15e1('0x53')]==='all'){if(this[_0x15e1('0x8')][_0x22c59a[_0x15e1('0x1c')]]){logger[_0x15e1('0x26')](_0x15e1('0x54'),_0x22c59a['uniqueid'],_0x22c59a[_0x15e1('0x1c')],_0x22c59a[_0x15e1('0x1d')]);return RpcUser['savePause'](this['agents'][_0x22c59a[_0x15e1('0x1c')]],_0x15e1('0x55'),_0x22c59a[_0x15e1('0x30')]);}}}catch(_0x1776a1){logger[_0x15e1('0x38')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1776a1['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c0e8fd9..5fa12ce 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 _0xb5eb=['../../config/logger','../../config/environment','asterisk','username','password','keepConnected','promisify','action','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','error','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb5eb,0x1d2));var _0xbb5e=function(_0x55cf86,_0x56ad8d){_0x55cf86=_0x55cf86-0x0;var _0x3d82de=_0xb5eb[_0x55cf86];return _0x3d82de;};'use strict';var Manager=require(_0xbb5e('0x0'));var BPromise=require('bluebird');var util=require(_0xbb5e('0x1'));var logger=require(_0xbb5e('0x2'))('ami');var config=require(_0xbb5e('0x3'));var ami=new Manager(config[_0xbb5e('0x4')]['port'],config[_0xbb5e('0x4')]['ip'],config[_0xbb5e('0x4')][_0xbb5e('0x5')],config[_0xbb5e('0x4')][_0xbb5e('0x6')],!![]);ami[_0xbb5e('0x7')]();ami['Action']=BPromise[_0xbb5e('0x8')](ami[_0xbb5e('0x9')]);function error(_0x3a10ed){logger['error'](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xbb5e('0x4')]['username'],config[_0xbb5e('0x4')]['ip'],config[_0xbb5e('0x4')][_0xbb5e('0xa')],util[_0xbb5e('0xb')](_0x3a10ed,![],null)));}function close(){logger['error'](util['format'](_0xbb5e('0xc'),config[_0xbb5e('0x4')][_0xbb5e('0x5')],config[_0xbb5e('0x4')]['ip'],config[_0xbb5e('0x4')][_0xbb5e('0xa')]));}ami[_0xbb5e('0xd')]=function(){return function(){return ami[_0xbb5e('0xe')]({'action':_0xbb5e('0xf')});};};ami[_0xbb5e('0x10')]=function(){return function(){return ami[_0xbb5e('0xe')]({'action':'devicestatelist'});};};ami[_0xbb5e('0x11')]=function(){return function(){return ami[_0xbb5e('0xe')]({'action':_0xbb5e('0x12')});};};ami[_0xbb5e('0x13')]=function(){return function(){return ami['Action']({'action':_0xbb5e('0x14')});};};ami[_0xbb5e('0x15')]=function(){return function(){return ami[_0xbb5e('0xe')]({'action':_0xbb5e('0x16')});};};function connect(){logger['info'](util[_0xbb5e('0x17')](_0xbb5e('0x18'),config[_0xbb5e('0x4')]['username'],config[_0xbb5e('0x4')]['ip'],config[_0xbb5e('0x4')][_0xbb5e('0xa')]));ami[_0xbb5e('0x19')](_0xbb5e('0x1a'),error);ami[_0xbb5e('0x19')](_0xbb5e('0x1b'),close);}ami['on'](_0xbb5e('0x1c'),connect);ami['on'](_0xbb5e('0x1d'),function(_0x42edd4){logger[_0xbb5e('0x1e')](util[_0xbb5e('0x17')](_0xbb5e('0x1f'),config[_0xbb5e('0x4')]['username'],config[_0xbb5e('0x4')]['ip'],config['asterisk'][_0xbb5e('0xa')],util[_0xbb5e('0xb')](_0x42edd4,![],null)));});ami['on'](_0xbb5e('0x20'),function(){logger[_0xbb5e('0x1e')](util[_0xbb5e('0x17')](_0xbb5e('0x21'),config['asterisk'][_0xbb5e('0x5')],config[_0xbb5e('0x4')]['ip'],config[_0xbb5e('0x4')][_0xbb5e('0xa')]));return Promise[_0xbb5e('0x22')]()[_0xbb5e('0x23')](ami['actionSipShowRegistry']())['then'](ami[_0xbb5e('0x10')]())[_0xbb5e('0x23')](ami[_0xbb5e('0x11')]())['then'](ami[_0xbb5e('0x13')]())[_0xbb5e('0x23')](ami[_0xbb5e('0x15')]())[_0xbb5e('0x24')](function(_0x3e1d1f){logger[_0xbb5e('0x1a')](_0xbb5e('0x25'),util['inspect'](_0x3e1d1f,{'showHidden':![],'depth':null}));});});ami[_0xbb5e('0x19')]('error',error);ami['once']('close',close);module[_0xbb5e('0x26')]=ami; \ No newline at end of file +var _0x917f=['port','username','password','keepConnected','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','[ami.js][fullybooted]','exports','asterisk-manager','util','ami','asterisk'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x917f,0x188));var _0xf917=function(_0x36f8b1,_0xfd77da){_0x36f8b1=_0x36f8b1-0x0;var _0x329930=_0x917f[_0x36f8b1];return _0x329930;};'use strict';var Manager=require(_0xf917('0x0'));var BPromise=require('bluebird');var util=require(_0xf917('0x1'));var logger=require('../../config/logger')(_0xf917('0x2'));var config=require('../../config/environment');var ami=new Manager(config[_0xf917('0x3')][_0xf917('0x4')],config[_0xf917('0x3')]['ip'],config[_0xf917('0x3')][_0xf917('0x5')],config['asterisk'][_0xf917('0x6')],!![]);ami[_0xf917('0x7')]();ami[_0xf917('0x8')]=BPromise['promisify'](ami['action']);function error(_0x4f0fe3){logger[_0xf917('0x9')](util[_0xf917('0xa')](_0xf917('0xb'),config[_0xf917('0x3')]['username'],config[_0xf917('0x3')]['ip'],config[_0xf917('0x3')]['port'],util['inspect'](_0x4f0fe3,![],null)));}function close(){logger[_0xf917('0x9')](util[_0xf917('0xa')](_0xf917('0xc'),config[_0xf917('0x3')]['username'],config[_0xf917('0x3')]['ip'],config[_0xf917('0x3')][_0xf917('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xf917('0x8')]({'action':_0xf917('0xd')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xf917('0xe')});};};ami[_0xf917('0xf')]=function(){return function(){return ami['Action']({'action':_0xf917('0x10')});};};ami[_0xf917('0x11')]=function(){return function(){return ami[_0xf917('0x8')]({'action':_0xf917('0x12')});};};ami[_0xf917('0x13')]=function(){return function(){return ami[_0xf917('0x8')]({'action':_0xf917('0x14')});};};function connect(){logger[_0xf917('0x15')](util[_0xf917('0xa')](_0xf917('0x16'),config[_0xf917('0x3')][_0xf917('0x5')],config[_0xf917('0x3')]['ip'],config[_0xf917('0x3')]['port']));ami[_0xf917('0x17')](_0xf917('0x9'),error);ami['once'](_0xf917('0x18'),close);}ami['on'](_0xf917('0x19'),connect);ami['on'](_0xf917('0x1a'),function(_0x426096){logger[_0xf917('0x15')](util[_0xf917('0xa')](_0xf917('0x1b'),config[_0xf917('0x3')][_0xf917('0x5')],config['asterisk']['ip'],config[_0xf917('0x3')]['port'],util[_0xf917('0x1c')](_0x426096,![],null)));});ami['on'](_0xf917('0x1d'),function(){logger[_0xf917('0x15')](util[_0xf917('0xa')](_0xf917('0x1e'),config[_0xf917('0x3')][_0xf917('0x5')],config['asterisk']['ip'],config[_0xf917('0x3')][_0xf917('0x4')]));return Promise[_0xf917('0x1f')]()[_0xf917('0x20')](ami['actionSipShowRegistry']())[_0xf917('0x20')](ami[_0xf917('0x21')]())['then'](ami[_0xf917('0xf')]())[_0xf917('0x20')](ami[_0xf917('0x11')]())[_0xf917('0x20')](ami['actionCoreShowChannels']())['catch'](function(_0x363a86){logger['error'](_0xf917('0x22'),util[_0xf917('0x1c')](_0x363a86,{'showHidden':![],'depth':null}));});});ami['once'](_0xf917('0x9'),error);ami[_0xf917('0x17')](_0xf917('0x18'),close);module[_0xf917('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 374150e..38845ab 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 _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x5e1fe7,_0x4d9f8e){var _0x54a65d=function(_0x1bbf3c){while(--_0x1bbf3c){_0x5e1fe7['push'](_0x5e1fe7['shift']());}};_0x54a65d(++_0x4d9f8e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x70e0,0x17b));var _0x070e=function(_0x281d73,_0x1098cc){_0x281d73=_0x281d73-0x0;var _0x5bd8a1=_0x70e0[_0x281d73];return _0x5bd8a1;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e782d64..c250561 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 _0x48d9=['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','erlangAbandonmentRate','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','command','then','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Timezone:\x20','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','outboundDropCallsDayTimeout','statedesc','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','channel','strategy','roundrobin','actionid','isNil','paused','stateinterface','locked','rrmemory','pick','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','preview','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','emit','custom:amd','amd','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','AMD','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','saveInDb','countnoanswerretry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','throttle','dialPreviewRecallmeReminder','filter','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','launchHandleIvr','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','isOutboundQueue','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','assign','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','callAdditionalPhoneAfterMin','[syncAgentComplete][createHistory][3]','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','predictiveIntervalErlangCallsDroppedCalls','started\x20in\x20predictive\x20at','avgHandleTime','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','talking','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','loggedIn','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','unlockContact','outboundReCallsDay','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','Contact','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','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','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncAgentComplete','syncQueueSummaryComplete','hangup','newexten','varset','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','isUndefined','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls'];(function(_0x5ee300,_0x59f054){var _0x15717b=function(_0x476c78){while(--_0x476c78){_0x5ee300['push'](_0x5ee300['shift']());}};_0x15717b(++_0x59f054);}(_0x48d9,0x1c4));var _0x948d=function(_0x380643,_0x767659){_0x380643=_0x380643-0x0;var _0x255697=_0x48d9[_0x380643];return _0x255697;};'use strict';var util=require(_0x948d('0x0'));var _=require('lodash');var uuid=require(_0x948d('0x1'));var moment=require(_0x948d('0x2'));var rr=require('rr');var Redis=require(_0x948d('0x3'));var utils=require(_0x948d('0x4'));var hopperUtils=require(_0x948d('0x5'));var ut=require('../preview/util/util');var config=require(_0x948d('0x6'));var logger=require(_0x948d('0x7'))(_0x948d('0x8'));var loggerBooked=require(_0x948d('0x7'))(_0x948d('0x9'));var loggerPredictive=require(_0x948d('0x7'))(_0x948d('0xa'));var loggerPredictiveCalls=require(_0x948d('0x7'))(_0x948d('0xb'));var loggerSyncQueueSummary=require(_0x948d('0x7'))(_0x948d('0xc'));var ami=require(_0x948d('0xd'));config[_0x948d('0xe')]=_[_0x948d('0xf')](config[_0x948d('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x948d('0x10'))(new Redis(config[_0x948d('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require('../rpc/interval');var Action=require(_0x948d('0x11'));var History=require('./models/history');var Final=require(_0x948d('0x12'));var AgentComplete=require(_0x948d('0x13'));var QueueCallerAbandon=require(_0x948d('0x14'));var Hangup=require('./models/hangup');var ipAgi=process['env'][_0x948d('0x15')]||_0x948d('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x948d('0x17')][_0x948d('0x18')]=function(_0x175cd9){this['tail']=this[_0x948d('0x19')]?this[_0x948d('0x19')]['finally'](_0x175cd9):_0x175cd9();};function Dialer(_0x4406aa,_0x51f3f9){this[_0x948d('0x1a')]=new Sequence();this['preview']=_0x51f3f9;this[_0x948d('0x1b')]=_0x4406aa[_0x948d('0x1b')];this[_0x948d('0x1c')]=_0x4406aa[_0x948d('0x1c')];this[_0x948d('0x1d')]=_0x4406aa[_0x948d('0x1d')];this[_0x948d('0x1e')]=_0x4406aa['trunks'];this[_0x948d('0x1f')]=config[_0x948d('0x1f')]||0x2;this[_0x948d('0x20')]={};this[_0x948d('0x21')]={};this[_0x948d('0x22')]={};this['uniqueId']={};this[_0x948d('0x23')]={};this[_0x948d('0x24')]={};this[_0x948d('0x25')]={};this[_0x948d('0x26')]={};this[_0x948d('0x27')]={};this[_0x948d('0x28')]={};this[_0x948d('0x29')]={};ami['on'](_0x948d('0x2a'),this[_0x948d('0x2b')]['bind'](this));ami['on'](_0x948d('0x2c'),this['syncQueueCallerAbandon'][_0x948d('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on']('agentcomplete',this[_0x948d('0x2e')][_0x948d('0x2d')](this));ami['on']('custom:queuesummary',this[_0x948d('0xc')][_0x948d('0x2d')](this));ami['on']('custom:queuesummarycomplete',this[_0x948d('0x2f')][_0x948d('0x2d')](this));ami['on'](_0x948d('0x30'),this['syncHangup']['bind'](this));ami['on'](_0x948d('0x31'),this['syncNewExten'][_0x948d('0x2d')](this));ami['on'](_0x948d('0x32'),this['syncVarSet'][_0x948d('0x2d')](this));ami['on'](_0x948d('0x33'),this[_0x948d('0x34')][_0x948d('0x2d')](this));ami['on'](_0x948d('0x35'),this['syncQueueStatusComplete'][_0x948d('0x2d')](this));this[_0x948d('0x36')]();this['loopClearZombieChannels']();RpcSetting[_0x948d('0x37')]()['then'](function(_0x45b29c){previewRecallmeReminderInterval=_0x45b29c['previewRecallmeReminderInterval'];});}function isNotNull(_0x9bb8d3){return _0x9bb8d3!==null&&!_[_0x948d('0x38')](_0x9bb8d3);}function msgResponse(_0x3b20b8,_0x527626,_0x34b83d){return{'action':_0x3b20b8,'response':_0x527626,'message':_0x34b83d,'stack':_0x34b83d};}function emit(_0x5d6f50,_0x4647b0,_0x48810f){io['to'](_0x5d6f50)['emit'](_0x4647b0,_0x48810f);}function emitOutboundVoiceQueueSummary(_0x1f4524){if(_0x1f4524[_0x948d('0x39')]==='outbound'){logger['debug'](_0x948d('0x3a'),util[_0x948d('0x3b')](_0x1f4524,{'showHidden':![],'depth':null}));emit(util[_0x948d('0x3c')]('voice:queue:%s',_0x1f4524[_0x948d('0x3d')]),_0x948d('0x3e'),_0x1f4524);}}function checkGetDataPredictive(_0x320fc2){if(isNotNull(_0x320fc2)&&!_[_0x948d('0x3f')](_0x320fc2)){loggerPredictive['info'](_0x948d('0x40'));loggerPredictive[_0x948d('0x41')](_0x948d('0x42'),_0x320fc2[_0x948d('0x43')]);loggerPredictive[_0x948d('0x41')](_0x948d('0x44'),_0x320fc2[_0x948d('0x45')]);loggerPredictive[_0x948d('0x41')](_0x948d('0x46'),_0x320fc2[_0x948d('0x47')]);loggerPredictive['info'](_0x948d('0x48'),_0x320fc2[_0x948d('0x49')]);loggerPredictive[_0x948d('0x41')](_0x948d('0x4a'),_0x320fc2[_0x948d('0x4b')]);loggerPredictive['info'](_0x948d('0x4c'),_0x320fc2[_0x948d('0x4d')]);loggerPredictive[_0x948d('0x41')](_0x948d('0x4e'));if(_0x320fc2[_0x948d('0x43')]>0x0){if(!_[_0x948d('0x38')](_0x320fc2[_0x948d('0x4d')])&&_0x320fc2[_0x948d('0x4d')]>0x0){return!![];}loggerPredictive['info'](_0x948d('0x4f'));if(!_['isUndefined'](_0x320fc2['predictiveIntervalAvgHoldtime'])&&_0x320fc2[_0x948d('0x4b')]>0x0){return!![];}loggerPredictive['info'](_0x948d('0x50'));}else{loggerPredictive[_0x948d('0x41')](_0x948d('0x51'));}}else{loggerPredictive[_0x948d('0x41')](_0x948d('0x52'));}return![];}function mergeDataErlangB(_0x180086){return function(_0x47e545){loggerPredictive[_0x948d('0x41')](_0x948d('0x53'));loggerPredictive[_0x948d('0x41')](_0x948d('0x54'),_0x47e545[_0x948d('0x55')]);loggerPredictive[_0x948d('0x41')](_0x948d('0x56'),_0x47e545['erlangCallToSecond']);loggerPredictive['info'](_0x948d('0x57'),_0x47e545['erlangAbandonmentRate']);loggerPredictive[_0x948d('0x41')](_0x948d('0x58'),_0x47e545['erlangBusyFactor']);loggerPredictive[_0x948d('0x41')](_0x948d('0x57'),_0x47e545[_0x948d('0x59')]);loggerPredictive['info']('---------------------------');_[_0x948d('0x5a')](_0x180086,_0x47e545);};}function ifInterval(_0x1fb125,_0xcae44c){if(_[_0x948d('0x38')](_0xcae44c)){return![];}return utils[_0x948d('0x5b')](undefined,_0xcae44c)<_0x1fb125*0x3c;}function clearPredictiveAttributes(_0x39d0c5){if(_0x39d0c5[_0x948d('0x25')]){_0x39d0c5[_0x948d('0x25')]=undefined;loggerPredictive[_0x948d('0x5c')](_0x39d0c5['name'],_0x948d('0x5d'));}if(_0x39d0c5[_0x948d('0x24')]){_0x39d0c5[_0x948d('0x24')]=undefined;loggerPredictive[_0x948d('0x5c')](_0x39d0c5[_0x948d('0x3d')],_0x948d('0x5e'));}if(_0x39d0c5['handlePredictive']){clearInterval(_0x39d0c5[_0x948d('0x5f')]);_0x39d0c5[_0x948d('0x5f')]=undefined;loggerPredictive['debug'](_0x39d0c5[_0x948d('0x3d')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x36b578,_0xeed20d){return function(_0x2b0ec9){loggerPredictive[_0x948d('0x60')](_0xeed20d[_0x948d('0x3d')],_0x36b578);loggerPredictive['error'](_0x2b0ec9[_0x948d('0x61')]);clearPredictiveAttributes(_0xeed20d);};}function loggerCatch(_0x38b95b){return function(_0x5c795b){logger[_0x948d('0x60')](_0x38b95b,util[_0x948d('0x3b')](_0x5c795b,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1f07ad,_0x1a0cc3,_0x3ac800){return function(_0x57cc53){utils[_0x948d('0x62')](_0x1a0cc3,_0x3ac800,0x0);logger['error'](_0x1f07ad,util['inspect'](_0x57cc53,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2ee664){return function(_0x431f59){if(isNotNull(_0x431f59)&&isNotNull(_0x431f59[0x0])){if(_0x431f59[0x0]['contactsRescheduled']>0x0){_0x2ee664['message']=utils[_0x948d('0x63')][_0x948d('0x64')];logger[_0x948d('0x41')](_0x948d('0x65')+_0x2ee664[_0x948d('0x3d')],_0x431f59[0x0]['contactsRescheduled'],_0x948d('0x66'));}else{_0x2ee664[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x68')];logger['info'](_0x948d('0x69')+_0x2ee664[_0x948d('0x3d')]);}}};}function createObjHistory(_0x2116cd,_0x1449bb,_0x58c4a9,_0x369476,_0x2bb007){_0x2116cd[_0x948d('0x67')]=_0x58c4a9;var _0x41aa40=new Action(_0x2116cd,_0x1449bb);var _0x252b75=new History(_0x41aa40);_0x252b75[_0x948d('0x6a')]=_0x369476;_0x252b75['statedesc']=_0x2bb007;_0x252b75[_0x948d('0x6b')]=_0x41aa40[_0x948d('0x6c')];return _0x252b75;}function unlockQueueStatus(_0x277bfe,_0x581067){setTimeout(function(){if(_[_0x948d('0x38')](_0x277bfe['queueStatusComplete'])){loggerBooked[_0x948d('0x60')](_0x948d('0x6d'),_0x581067);}_0x277bfe[_0x948d('0x6e')]=!![];loggerBooked['info'](_0x948d('0x6f'),_0x581067,JSON[_0x948d('0x70')](_['pick'](_0x277bfe,[_0x948d('0x3d'),_0x948d('0x6e')])));},0x1f3);}function checkInterval(_0x4b8e7b){return function(){if(!isNotNull(_0x4b8e7b[_0x948d('0x71')])){_0x4b8e7b[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x72')];throw _0x4b8e7b[_0x948d('0x3d')]+_0x948d('0x73');}if(!isNotNull(_0x4b8e7b['Interval'][_0x948d('0x74')])){_0x4b8e7b[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x72')];throw _0x4b8e7b[_0x948d('0x3d')]+_0x948d('0x73');}if(!isNotNull(_[_0x948d('0x3f')](_0x4b8e7b[_0x948d('0x71')][_0x948d('0x74')]))){_0x4b8e7b[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x72')];throw _0x4b8e7b[_0x948d('0x3d')]+_0x948d('0x73');}};}function checkIsIVRCampaignActive(_0x4b8425){return function(){if(!utils[_0x948d('0x75')](_0x4b8425)){_0x4b8425[_0x948d('0x67')]=utils['CAMPAIGN_STATUS'][_0x948d('0x76')];throw _0x4b8425[_0x948d('0x3d')]+_0x948d('0x77');}};}function emitCampaignSummary(_0x5f4fb1){if(utils[_0x948d('0x78')](_0x5f4fb1)){emit(util['format'](_0x948d('0x79'),_0x5f4fb1[_0x948d('0x3d')]),_0x948d('0x7a'),_0x5f4fb1);}}function loggerCatchQueueSummary(_0x3bbd6a,_0x2d1e99){return function(_0x2d03fb){clearPredictiveAttributes(_0x2d1e99);emitCampaignSummary(_0x2d1e99);loggerSyncQueueSummary[_0x948d('0x5c')](_0x3bbd6a,util[_0x948d('0x3b')](_0x2d03fb,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5f3144){if(_0x5f3144[_0x948d('0x7b')]){if(_0x5f3144[_0x948d('0x7c')]===0x0){_0x5f3144[_0x948d('0x7b')]=![];_0x5f3144[_0x948d('0x67')]=utils[_0x948d('0x63')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0x948d('0x7d'),_0x5f3144['name'],_0x948d('0x7e'));}else{_0x5f3144['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x948d('0x5c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5f3144[_0x948d('0x3d')],_0x948d('0x7f'));}emitCampaignSummary(_0x5f3144);}}function myreject(_0x25d42c){return function(_0x14d03d){return _0x25d42c(msgResponse(_0x948d('0x80'),'Error',JSON[_0x948d('0x70')](_0x14d03d)));};}Dialer[_0x948d('0x17')][_0x948d('0x81')]=function(_0xc5f157){return!_[_0x948d('0x38')](_0xc5f157)&&_0xc5f157&&!_[_0x948d('0x38')](_0xc5f157['name'])&&!_[_0x948d('0x38')](_0xc5f157[_0x948d('0x82')])&&_0xc5f157[_0x948d('0x82')]&&(this[_0x948d('0x1e')][util[_0x948d('0x3c')](_0x948d('0x83'),_0xc5f157['name'])][_0x948d('0x84')]==='reachable'||this[_0x948d('0x1e')][util['format'](_0x948d('0x83'),_0xc5f157[_0x948d('0x3d')])]['status']===_0x948d('0x85'));};Dialer[_0x948d('0x17')][_0x948d('0x86')]=function(_0x475347){var _0x1084b4=this;return function(){if(!_0x1084b4[_0x948d('0x81')](_0x475347[_0x948d('0x87')])){if(!_0x1084b4['isTrunkReachable'](_0x475347['TrunkBackup'])){_0x475347['message']=utils[_0x948d('0x63')]['TRUNK_NOT_REACHABLE'];throw _0x475347[_0x948d('0x3d')]+_0x948d('0x88');}}};};Dialer[_0x948d('0x17')]['checkIfTime']=function(_0x33b240,_0x4ae071,_0x3f4310,_0x3ce789){var _0x37a191=this;return function(){var _0x129997=!![];return _0x37a191['ifTimeIvr'](_0x33b240,_0x4ae071,_0x3f4310,_0x3ce789,_0x129997);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x4602ff,_0x563464,_0x2bc4e3,_0xad4cd2){var _0x181bea=this;return function(){var _0x3d4965=![];return _0x181bea[_0x948d('0x89')](_0x4602ff['Intervals'],_0x563464,_0x2bc4e3,_0xad4cd2,_0x3d4965);};};Dialer[_0x948d('0x17')]['ifTimeIvr']=function(_0x17dd36,_0x2ff322,_0x5a47ae,_0x140c98,_0x23d90c){var _0x18877c=[];return new Promise(function(_0x547b65,_0x543d73){if(!isNotNull(_0x17dd36)){_0x140c98[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x72')];return _0x543d73(msgResponse(_0x948d('0x8a'),_0x948d('0x8b'),_0x5a47ae+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x17dd36)){_0x140c98[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x8c')];return _0x543d73(msgResponse(_0x948d('0x8a'),_0x948d('0x8b'),_0x5a47ae+_0x948d('0x8d')));}if(_0x2ff322&&_[_0x948d('0x38')](config['timezones'][_0x2ff322])){_0x140c98[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x8e')];return _0x543d73(msgResponse(_0x948d('0x8a'),_0x948d('0x8b'),_0x5a47ae+_0x948d('0x8f')+_0x2ff322));}if(_[_0x948d('0x90')](_0x17dd36)){for(var _0x162df9=0x0;_0x162df9<_0x17dd36[_0x948d('0x91')];_0x162df9+=0x1){_0x18877c[_0x948d('0x92')](ami[_0x948d('0x93')]({'action':'command','command':util['format'](_0x948d('0x94'),_0x17dd36[_0x162df9][_0x948d('0x95')],!_[_0x948d('0x38')](config[_0x948d('0x96')][_0x2ff322])?_0x2ff322:'')})['then'](function(_0x326fe5){return _0x326fe5[_0x948d('0x97')][_0x948d('0x98')](_0x948d('0x99'))>=0x0;})[_0x948d('0x9a')](myreject(_0x543d73)));}}else{_0x18877c[_0x948d('0x92')](ami[_0x948d('0x93')]({'action':_0x948d('0x9b'),'command':util['format'](_0x948d('0x94'),_0x17dd36,!_[_0x948d('0x38')](config[_0x948d('0x96')][_0x2ff322])?_0x2ff322:'')})[_0x948d('0x9c')](function(_0xdbe682){return _0xdbe682[_0x948d('0x97')][_0x948d('0x98')](_0x948d('0x99'))>=0x0;})[_0x948d('0x9a')](myreject(_0x543d73)));}Promise[_0x948d('0x9d')](_0x18877c)[_0x948d('0x9c')](function(_0x4ab5a3){var _0x54cc31=_[_0x948d('0x9e')](_0x4ab5a3);if(_0x54cc31){return _0x547b65(_0x54cc31);}else{_0x140c98[_0x948d('0x67')]=_0x23d90c?utils['CAMPAIGN_STATUS'][_0x948d('0x9f')]:utils[_0x948d('0x63')][_0x948d('0xa0')];return _0x543d73(msgResponse(_0x948d('0xa1'),'Failure','Global:\x20'+_0x23d90c+'\x20'+_0x5a47ae+_0x948d('0xa2')+util[_0x948d('0x3b')](_0x17dd36,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2ff322));}})[_0x948d('0x9a')](function(_0x5ed8b9){return _0x543d73(msgResponse('ifTime',_0x948d('0x8b'),JSON['stringify'](_0x5ed8b9)));});});};Dialer[_0x948d('0x17')][_0x948d('0x36')]=function(){var _0x5e61e6=this;return cmHopper[_0x948d('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0x948d('0x9c')](function(){setInterval(function(){_0x5e61e6[_0x948d('0xa4')]();},0x3e8);});};Dialer['prototype'][_0x948d('0xa4')]=function(){var _0x201fd7=this;var _0xfb5878;for(var _0x1ffca9 in this[_0x948d('0x1c')]){if(typeof this[_0x948d('0x1c')][_0x1ffca9]!==_0x948d('0xa5')){_0xfb5878=this[_0x948d('0x1c')][_0x1ffca9];if(utils[_0x948d('0x78')](_0xfb5878)&&utils[_0x948d('0x75')](_0xfb5878)){_0xfb5878['sendMessageOneNotActive']=!![];Promise[_0x948d('0xa6')]()[_0x948d('0x9c')](checkIsIVRCampaignActive(_0xfb5878))[_0x948d('0x9c')](checkInterval(_0xfb5878))[_0x948d('0x9c')](_0x201fd7[_0x948d('0x86')](_0xfb5878))['then'](_0x201fd7[_0x948d('0xa7')](_0xfb5878[_0x948d('0xa8')],_0xfb5878[_0x948d('0xa9')],_0xfb5878[_0x948d('0x3d')],_0xfb5878))[_0x948d('0x9c')](_0x201fd7[_0x948d('0xaa')](_0xfb5878['Interval'],_0xfb5878['dialTimezone'],_0xfb5878[_0x948d('0x3d')],_0xfb5878))[_0x948d('0x9c')](_0x201fd7['launchHandleIvr'](_0xfb5878))[_0x948d('0x9a')](loggerCatchQueueSummary('[syncCampaigns]',_0xfb5878));}else{notSendMessagesCampaign(_0xfb5878);}}}};Dialer[_0x948d('0x17')][_0x948d('0xab')]=function(_0x146a50){if(_0x146a50[_0x948d('0xac')]!==_0x948d('0xa')){clearPredictiveAttributes(_0x146a50);}switch(_0x146a50[_0x948d('0xac')]){case _0x948d('0xad'):this[_0x948d('0xae')](_0x146a50,0x1);break;case _0x948d('0xaf'):this[_0x948d('0xae')](_0x146a50,_0x146a50[_0x948d('0xb0')]);break;case'predictive':this[_0x948d('0xa')](_0x146a50);break;case _0x948d('0x9'):this[_0x948d('0xae')](_0x146a50,0x1);break;default:logger[_0x948d('0x60')]('Queue',_0x146a50[_0x948d('0x3d')],_0x948d('0xb1'));}};Dialer['prototype'][_0x948d('0x8a')]=function(_0x5c35e3,_0x345566){var _0x47ddc1=_0x5c35e3['dialTimezone'];var _0x818cf2=_0x345566?_0x5c35e3[_0x948d('0xa8')]:_0x5c35e3['Interval'][_0x948d('0x74')];logger[_0x948d('0xb2')](_0x948d('0xb3'),_0x818cf2,_0x47ddc1,_0x5c35e3['name'],util['format'](_0x948d('0xb4'),_0x5c35e3[_0x948d('0x3d')],_0x5c35e3['id']));var _0x2d6817=null;return Interval['intervalIftime'](_0x818cf2,_0x47ddc1)[_0x948d('0x9c')](function(_0x96083f){if(_0x96083f===!![]){return _0x96083f;}else{_0x5c35e3[_0x948d('0x67')]=_0x345566?utils[_0x948d('0x63')][_0x948d('0x9f')]:utils[_0x948d('0x63')][_0x948d('0xa0')];_0x2d6817=msgResponse(_0x948d('0xa1'),_0x948d('0x8b'),'Global:\x20'+_0x345566+'\x20'+_0x5c35e3[_0x948d('0x3d')]+_0x948d('0xa2')+util['inspect'](_0x818cf2,{'showHidden':![],'depth':null})+_0x948d('0xb5')+_0x47ddc1);}if(_0x2d6817!==null){logger[_0x948d('0xb2')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x2d6817);_0x2d6817['isGlobal']=_0x345566;throw _0x2d6817;}})[_0x948d('0x9a')](function(_0x3db6d7){logger[_0x948d('0x60')](_0x948d('0xb6'),_0x3db6d7);throw msgResponse(_0x948d('0x80'),_0x948d('0xb7'),util[_0x948d('0x3b')](_0x3db6d7,{'showHidden':![],'depth':null}));});};Dialer[_0x948d('0x17')][_0x948d('0x2b')]=function(_0x593d51){if(this[_0x948d('0x1b')][_0x593d51[_0x948d('0xb8')]]){if(this[_0x948d('0xb9')][_0x593d51[_0x948d('0xba')]]&&this[_0x948d('0xb9')][_0x593d51[_0x948d('0xba')]][_0x948d('0x39')]!==_0x948d('0xbb')){this[_0x948d('0xbc')](this['voiceQueues'][_0x593d51['queue']]);this[_0x948d('0xb9')][_0x593d51[_0x948d('0xba')]]['answertime']=moment()[_0x948d('0x3c')](_0x948d('0xbd'));}}};Dialer[_0x948d('0x17')][_0x948d('0x2e')]=function(_0x397b97){var _0x10aa85=this[_0x948d('0xb9')][_0x397b97[_0x948d('0xba')]];if(this[_0x948d('0x1b')][_0x397b97['queue']]){if(_0x10aa85&&_0x10aa85['type']!==_0x948d('0xbb')){delete this[_0x948d('0xb9')][_0x397b97[_0x948d('0xba')]];this[_0x948d('0x1b')][_0x397b97[_0x948d('0xb8')]][_0x948d('0xbe')]+=0x1;var _0x533884=new AgentComplete(_0x10aa85,_0x397b97);if(_0x397b97[_0x948d('0xbf')]===_0x948d('0xc0')){_0x533884[_0x948d('0xc1')]=this[_0x948d('0x1b')][_0x397b97[_0x948d('0xb8')]][_0x948d('0xc2')]&&this[_0x948d('0x1b')][_0x397b97['queue']][_0x948d('0xc3')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x948d('0xc4')](_0x533884)[_0x948d('0x9a')](loggerCatch(_0x948d('0xc5')));hopperUtils[_0x948d('0xc6')](_0x533884)[_0x948d('0x9a')](loggerCatch(_0x948d('0xc7')));}}};Dialer['prototype'][_0x948d('0xc8')]=function(_0x19049a){var _0x24a8fb=this[_0x948d('0xb9')][_0x19049a[_0x948d('0xba')]];var _0x116d6d=this;var _0x38f99d=![];var _0x3bdb22;var _0x4e018d;if(this[_0x948d('0x1b')][_0x19049a['queue']]){if(_0x24a8fb&&_0x24a8fb[_0x948d('0x39')]!==_0x948d('0xbb')){delete this['uniqueId'][_0x19049a[_0x948d('0xba')]];this['updateOriginated'](this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]]);_0x24a8fb[_0x948d('0xc9')]=moment()['format'](_0x948d('0xbd'));var _0x2b242f=new QueueCallerAbandon(_0x24a8fb,_0x19049a);if(utils[_0x948d('0x5b')](_0x24a8fb[_0x948d('0xc9')],_0x24a8fb[_0x948d('0xca')])>=_0x24a8fb['dialQueueTimeout']){this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0x47')]+=0x1;this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xcb')]+=0x1;this['voiceQueues'][_0x19049a[_0x948d('0xb8')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2b242f[_0x948d('0x6a')]=0xa;_0x2b242f[_0x948d('0xcc')]='Drop';_0x2b242f['dropreason']=_0x948d('0xcd');_0x2b242f['agiafterat']=this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xc2')]?moment()[_0x948d('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2b242f[_0x948d('0xce')]+=0x1;_0x2b242f[_0x948d('0xcf')]+=0x1;_0x3bdb22=this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xd0')];_0x4e018d=this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x948d('0xd1')](_0x2b242f,_0x2b242f[_0x948d('0x6a')],_0x24a8fb[_0x948d('0xd2')])[_0x948d('0x9c')](function(_0x3d87ef){_0x38f99d=_0x3d87ef[_0x948d('0xd3')]==0x1;if(_0x2b242f[_0x948d('0xce')]>=_0x116d6d[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xd4')]){_0x116d6d[_0x948d('0xd5')](_0x2b242f,_0x3d87ef[_0x948d('0xd3')]);}else{hopperUtils[_0x948d('0xd6')]({'active':![],'countdropretry':_0x2b242f[_0x948d('0xce')],'scheduledat':moment()['add'](_0x116d6d[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xd0')],_0x948d('0xd7'))[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x24a8fb[_0x948d('0xd8')],'ListId':_0x24a8fb[_0x948d('0xd9')],'VoiceQueueId':_0x24a8fb[_0x948d('0xda')]||undefined,'CampaignId':_0x24a8fb[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch(_0x948d('0xdc')));var _0x4bd324=new History(_0x2b242f);_0x4bd324['state']=0xa;_0x4bd324[_0x948d('0xcc')]=_0x948d('0xdd');_0x4bd324[_0x948d('0x6c')]=moment()['format'](_0x948d('0xbd'));_0x4bd324[_0x948d('0x6b')]=_0x4bd324[_0x948d('0x6c')];_0x4bd324['calleridname']=_0x2b242f[_0x948d('0xde')];_0x4bd324['calleridnum']=_0x2b242f[_0x948d('0xdf')];hopperUtils[_0x948d('0xc4')](_0x4bd324)[_0x948d('0x9a')](loggerCatch(_0x948d('0xe0')));}})[_0x948d('0x9c')](function(){if(_0x38f99d)hopperUtils[_0x948d('0xe1')](_0x2b242f,_0x3bdb22,_0x4e018d)[_0x948d('0x9c')](function(){return 0x1;});});}else{this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0x49')]+=0x1;this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2b242f[_0x948d('0x6a')]=0xb;_0x2b242f[_0x948d('0xcc')]=_0x948d('0xe2');_0x2b242f['dropreason']=_0x948d('0xe3');_0x2b242f[_0x948d('0xe4')]+=0x1;_0x2b242f[_0x948d('0xcf')]+=0x1;_0x3bdb22=this[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xe5')];_0x4e018d=this['voiceQueues'][_0x19049a['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x948d('0xd1')](_0x2b242f,_0x2b242f[_0x948d('0x6a')],_0x24a8fb[_0x948d('0xd2')])[_0x948d('0x9c')](function(_0x18b69f){if(_0x2b242f[_0x948d('0xe4')]>=_0x116d6d[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xe6')]){_0x116d6d[_0x948d('0xd5')](_0x2b242f,_0x18b69f[_0x948d('0xd3')]);}else{hopperUtils[_0x948d('0xd6')]({'active':![],'countabandonedretry':_0x2b242f['countabandonedretry'],'scheduledat':moment()['add'](_0x116d6d[_0x948d('0x1b')][_0x19049a[_0x948d('0xb8')]][_0x948d('0xe5')],_0x948d('0xd7'))['format'](_0x948d('0xbd')),'ContactId':_0x24a8fb[_0x948d('0xd8')],'ListId':_0x24a8fb['ListId'],'VoiceQueueId':_0x24a8fb['VoiceQueueId']||undefined,'CampaignId':_0x24a8fb[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch(_0x948d('0xe7')));var _0x51a4f6=new History(_0x2b242f);_0x51a4f6['state']=0xb;_0x51a4f6[_0x948d('0xcc')]='Abandoned';_0x51a4f6[_0x948d('0x6c')]=moment()[_0x948d('0x3c')](_0x948d('0xbd'));_0x51a4f6[_0x948d('0x6b')]=_0x51a4f6[_0x948d('0x6c')];_0x51a4f6[_0x948d('0xde')]=_0x2b242f[_0x948d('0xde')];_0x51a4f6[_0x948d('0xdf')]=_0x2b242f[_0x948d('0xdf')];hopperUtils[_0x948d('0xc4')](_0x51a4f6)[_0x948d('0x9a')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x948d('0x9c')](function(){if(_0x38f99d)hopperUtils['swapAdditionalPhones'](_0x2b242f,_0x3bdb22,_0x4e018d)[_0x948d('0x9c')](function(){return 0x1;});});}}}};Dialer[_0x948d('0x17')]['syncNewExten']=function(_0x2b43ff){if(this[_0x948d('0x21')][_0x2b43ff[_0x948d('0xba')]]){this['actions'][_0x2b43ff[_0x948d('0xba')]][_0x948d('0xe8')]=_0x2b43ff['channel'];}if(this[_0x948d('0xb9')][_0x2b43ff[_0x948d('0xba')]]){this['uniqueId'][_0x2b43ff[_0x948d('0xba')]][_0x948d('0xe8')]=_0x2b43ff[_0x948d('0xe8')];}};Dialer[_0x948d('0x17')][_0x948d('0x34')]=function(_0x4297c6){if(!this[_0x948d('0x21')][_0x4297c6['actionid']]){return;}var _0x162b5d=this['voiceQueues'][this[_0x948d('0x21')][_0x4297c6['actionid']][_0x948d('0xb8')]][_0x948d('0xe9')]||'rrmemory';if(_0x162b5d===_0x948d('0xea')){if(this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]]&&_[_0x948d('0xec')](this[_0x948d('0x21')][_0x4297c6['actionid']]['locked'])&&_0x4297c6[_0x948d('0x84')]==='1'&&_0x4297c6[_0x948d('0xed')]==='0'){if(this[_0x948d('0x1d')][_0x4297c6[_0x948d('0xee')]]){if(!this[_0x948d('0x1d')][_0x4297c6[_0x948d('0xee')]][_0x948d('0xef')]){this['agents'][_0x4297c6[_0x948d('0xee')]][_0x948d('0xef')]=!![];this['actions'][_0x4297c6['actionid']][_0x948d('0xef')]=!![];this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]][_0x948d('0xee')]=_0x4297c6[_0x948d('0xee')];}}}}else if(_0x162b5d===_0x948d('0xf0')){if(this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]]){if(this[_0x948d('0x1d')][_0x4297c6['stateinterface']]){this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]][_0x948d('0xee')]=_0x4297c6[_0x948d('0xee')];if(_[_0x948d('0xec')](this[_0x948d('0x27')][this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]][_0x948d('0xb8')]])){this[_0x948d('0x27')][this['actions'][_0x4297c6['actionid']]['queue']]=[];}this[_0x948d('0x27')][this[_0x948d('0x21')][_0x4297c6['actionid']][_0x948d('0xb8')]]['push'](_['merge'](_[_0x948d('0xf1')](this[_0x948d('0x21')][_0x4297c6[_0x948d('0xeb')]],['idHopper','stateinterface']),{'status':_0x4297c6[_0x948d('0x84')],'paused':_0x4297c6['paused']}));}}}};Dialer[_0x948d('0x17')]['syncQueueStatusComplete']=function(_0x3b4970){if(!this['actions'][_0x3b4970[_0x948d('0xeb')]]){return;}var _0x160dc2=this;var _0x1eb9ba=this['voiceQueues'][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xb8')]];var _0x12ae62=_0x1eb9ba[_0x948d('0xe9')]||'rrmemory';if(_0x12ae62===_0x948d('0xea')){if(this[_0x948d('0x21')][_0x3b4970['actionid']]&&this['actions'][_0x3b4970['actionid']][_0x948d('0xee')]){this['preview'][_0x948d('0xf2')](this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['idHopper'],this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['stateinterface'])[_0x948d('0x9a')](function(_0x16ef03){logger[_0x948d('0x60')](_0x948d('0xf3'),util[_0x948d('0x3b')](_0x16ef03,{'showHidden':![],'depth':null}));})[_0x948d('0xf4')](function(){_0x160dc2[_0x948d('0xbc')](_0x160dc2[_0x948d('0x1b')][_0x160dc2[_0x948d('0x21')][_0x3b4970['actionid']][_0x948d('0xb8')]]);_0x160dc2[_0x948d('0x1d')][_0x160dc2[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['stateinterface']][_0x948d('0xef')]=![];delete _0x160dc2[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]];unlockQueueStatus(_0x1eb9ba);});}else{this[_0x948d('0xbc')](this[_0x948d('0x1b')][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xb8')]]);hopperUtils[_0x948d('0xd6')]({'active':![],'ContactId':this['actions'][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xd8')],'ListId':this['actions'][_0x3b4970['actionid']][_0x948d('0xd9')],'VoiceQueueId':this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch(_0x948d('0xf5')));delete this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]];unlockQueueStatus(_0x1eb9ba);}}else if(_0x12ae62===_0x948d('0xf0')){var _0x29fc6f;if(this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]&&!_[_0x948d('0x3f')](this[_0x948d('0x27')][this[_0x948d('0x21')][_0x3b4970['actionid']][_0x948d('0xb8')]])){if(this[_0x948d('0x28')][_0x160dc2[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xb8')]]){this[_0x948d('0x28')][_0x160dc2['actions'][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xb8')]]=this[_0x948d('0x28')][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['queue']]?this[_0x948d('0x28')][this[_0x948d('0x21')][_0x3b4970['actionid']][_0x948d('0xb8')]]:this[_0x948d('0x27')][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]][_0x948d('0xb8')]]?this[_0x948d('0x27')][this['actions'][_0x3b4970[_0x948d('0xeb')]]['queue']]['_rr']||0x0:0x0;}this[_0x948d('0x27')][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['queue']][_0x948d('0xf6')]=this[_0x948d('0x28')][this[_0x948d('0x21')][_0x3b4970[_0x948d('0xeb')]]['queue']];for(var _0x350771=0x0;_0x350771=_0x45e0b1[_0x948d('0x11e')]){_0x253565[_0x948d('0x11f')](_0x428e9e,_0x4833b9,_0x57803e,_0x948d('0x120'));}else{if(_0x428e9e[_0x948d('0x117')]>=_0x45e0b1[_0x948d('0x121')]){_0x253565[_0x948d('0x122')](_0x428e9e,_0x4833b9,_0x57803e,_0x948d('0x123'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x428e9e[_0x948d('0x117')],'scheduledat':moment()['add'](_0x45e0b1[_0x948d('0x124')],'minutes')['format'](_0x948d('0xbd')),'ContactId':_0x428e9e[_0x948d('0xd8')],'ListId':_0x428e9e[_0x948d('0xd9')],'VoiceQueueId':_0x428e9e[_0x948d('0xda')]||undefined,'CampaignId':_0x428e9e[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x4833b9({'reschedule':0x1});}}});}if(_0x2328b1[_0x948d('0x39')]===_0x948d('0xbb')&&this[_0x948d('0x1c')][_0x2328b1['queue']][_0x948d('0x10b')]&&_0x3e03fd[_0x948d('0x113')]===_0x948d('0x10c')){delete this[_0x948d('0xb9')][_0x3e03fd[_0x948d('0xba')]];this[_0x948d('0xbc')](this['campaigns'][_0x2328b1[_0x948d('0xb8')]]);_0x29aaf3=new Hangup(_0x2328b1,_0x3e03fd);_0x29aaf3[_0x948d('0x6a')]=0x12;_0x29aaf3[_0x948d('0xcc')]=_0x948d('0x10d');_0x29aaf3[_0x948d('0x10e')]=_0x948d('0x116');ami[_0x948d('0x10f')](_0x948d('0x110'),ut[_0x948d('0x118')](_0x29aaf3,_0x948d('0x111')));this[_0x948d('0x125')](_0x29aaf3,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x2328b1['type']==='ivr'&&this['campaigns'][_0x2328b1[_0x948d('0xb8')]][_0x948d('0x10b')]&&_0x3e03fd['value']===_0x948d('0x114')){return new Promise(function(_0x2cf9f0,_0xfb7e0f){delete _0x253565['uniqueId'][_0x3e03fd[_0x948d('0xba')]];_0x253565[_0x948d('0xbc')](_0x253565[_0x948d('0x1c')][_0x2328b1[_0x948d('0xb8')]]);_0x253565['campaigns'][_0x2328b1[_0x948d('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x253565[_0x948d('0x1c')][_0x2328b1[_0x948d('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x261bd2=_0x253565[_0x948d('0x1c')][_0x2328b1[_0x948d('0xb8')]];var _0x11f406=new Hangup(_0x2328b1,_0x3e03fd);_0x11f406[_0x948d('0x6a')]=0x13;_0x11f406[_0x948d('0xcc')]='Machine';_0x11f406['membername']=_0x948d('0x116');_0x11f406[_0x948d('0x117')]+=0x1;_0x11f406['countglobal']+=0x1;_0x11f406[_0x948d('0x111')]=!![];ami[_0x948d('0x10f')]('custom:amd',ut[_0x948d('0x118')](_0x11f406,_0x948d('0x111')));hopperUtils['createHistory'](_0x11f406)[_0x948d('0x9a')](loggerCatch(_0x948d('0x119')));if(_0x11f406[_0x948d('0x11a')]+_0x11f406[_0x948d('0x11b')]+_0x11f406[_0x948d('0x126')]+_0x11f406[_0x948d('0x11c')]+_0x11f406['countdropretry']+_0x11f406[_0x948d('0xe4')]+_0x11f406[_0x948d('0x117')]+_0x11f406['countagentrejectretry']>=_0x261bd2[_0x948d('0x11e')]){_0x253565[_0x948d('0x11f')](_0x11f406,_0x2cf9f0,_0xfb7e0f,_0x948d('0x120'));}else{if(_0x11f406[_0x948d('0x117')]>=_0x261bd2['dialMachineMaxRetry']){_0x253565[_0x948d('0x122')](_0x11f406,_0x2cf9f0,_0xfb7e0f,'reason\x2019\x20machine....');}else{hopperUtils[_0x948d('0xd6')]({'active':![],'countmachineretry':_0x11f406[_0x948d('0x117')],'scheduledat':moment()[_0x948d('0x127')](_0x261bd2[_0x948d('0x124')],'minutes')[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x11f406[_0x948d('0xd8')],'ListId':_0x11f406[_0x948d('0xd9')],'VoiceQueueId':_0x11f406[_0x948d('0xda')]||undefined,'CampaignId':_0x11f406[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x2cf9f0({'reschedule':0x1});}}});}}};Dialer[_0x948d('0x17')]['syncHangup']=function(_0x47a4ee){var _0x317874=this[_0x948d('0xb9')][_0x47a4ee['uniqueid']];var _0x62addb;if(_0x317874&&_0x317874[_0x948d('0x39')]===_0x948d('0xbb')){delete this[_0x948d('0xb9')][_0x47a4ee[_0x948d('0xba')]];this['updateOriginated'](this['campaigns'][_0x317874[_0x948d('0xb8')]]);this[_0x948d('0x1c')][_0x317874[_0x948d('0xb8')]][_0x948d('0x128')]+=0x1;_0x62addb=new Hangup(_0x317874,_0x47a4ee);hopperUtils[_0x948d('0xc4')](_0x62addb)[_0x948d('0x9a')](loggerCatch(_0x948d('0x129')));hopperUtils[_0x948d('0xc6')](_0x62addb)['catch'](loggerCatch(_0x948d('0x12a')));}if(_0x317874&&_0x317874[_0x948d('0x39')]!==_0x948d('0xbb')&&isNotNull(this[_0x948d('0x1b')][_0x317874[_0x948d('0xb8')]][_0x948d('0x12b')])){delete this['uniqueId'][_0x47a4ee[_0x948d('0xba')]];this[_0x948d('0xbc')](this[_0x948d('0x1b')][_0x317874['queue']]);this[_0x948d('0x1b')][_0x317874[_0x948d('0xb8')]][_0x948d('0xbe')]+=0x1;this['voiceQueues'][_0x317874['queue']][_0x948d('0x115')]+=0x1;_0x62addb=new Hangup(_0x317874,_0x47a4ee);_0x62addb[_0x948d('0x6a')]=0x10;_0x62addb['statedesc']='AnswerAGI';_0x62addb[_0x948d('0x10e')]=_0x948d('0x12c');hopperUtils[_0x948d('0xc4')](_0x62addb)[_0x948d('0x9a')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x948d('0xc6')](_0x62addb)[_0x948d('0x9a')](loggerCatch(_0x948d('0x12a')));}if(_0x317874&&_0x317874['type']!==_0x948d('0xbb')&&!isNotNull(this[_0x948d('0x1b')][_0x317874[_0x948d('0xb8')]][_0x948d('0x12b')])){delete this['uniqueId'][_0x47a4ee[_0x948d('0xba')]];this[_0x948d('0xbc')](this[_0x948d('0x1b')][_0x317874[_0x948d('0xb8')]]);this[_0x948d('0x1b')][_0x317874['queue']][_0x948d('0x12d')]+=0x1;_0x62addb=new Hangup(_0x317874,_0x47a4ee);_0x62addb[_0x948d('0x6a')]=0xc;_0x62addb[_0x948d('0xcc')]=_0x47a4ee[_0x948d('0x12e')];_0x62addb[_0x948d('0x10e')]=_0x948d('0x12f');hopperUtils[_0x948d('0xc4')](_0x62addb)[_0x948d('0x9a')](loggerCatch(_0x948d('0x129')));hopperUtils[_0x948d('0xc6')](_0x62addb)[_0x948d('0x9a')](loggerCatch(_0x948d('0x12a')));}};Dialer[_0x948d('0x17')][_0x948d('0xc')]=function(_0x50d3af){var _0x4ac4f5=this;if(!_0x4ac4f5[_0x948d('0x29')][_0x50d3af[_0x948d('0x3d')]]){_0x4ac4f5[_0x948d('0x29')][_0x50d3af[_0x948d('0x3d')]]={'running':![]};}else if(_0x4ac4f5['queuesSummary'][_0x50d3af[_0x948d('0x3d')]][_0x948d('0x130')]===!![]){return;}else if(_0x4ac4f5[_0x948d('0x29')][_0x50d3af[_0x948d('0x3d')]][_0x948d('0x130')]===![]){_0x4ac4f5[_0x948d('0x29')][_0x50d3af['name']]['running']=!![];}var _0x3133e8=_0x4ac4f5[_0x948d('0x1b')][_0x50d3af['name']];var _0x271ed8=_0x3133e8[_0x948d('0x67')]!==utils[_0x948d('0x63')][_0x948d('0x76')];var _0x234c96=utils[_0x948d('0x131')](_0x3133e8);_0x3133e8['statusMessage']=utils[_0x948d('0x132')](_0x3133e8,_0x4ac4f5[_0x948d('0x1e')]);Promise['resolve']()[_0x948d('0x9c')](function(){if(_0x3133e8['statusMessage']===utils[_0x948d('0x63')][_0x948d('0x76')]){if(_0x271ed8){clearPredictiveAttributes(_0x3133e8);_0x50d3af['startPredictive']=undefined;_0x50d3af[_0x948d('0x25')]=undefined;}if(_0x3133e8[_0x948d('0x133')]===utils[_0x948d('0x63')]['INACTIVE']){_0x50d3af[_0x948d('0x134')]=0x0;_0x50d3af[_0x948d('0xed')]=0x0;_0x50d3af[_0x948d('0x135')]=0x0;_0x50d3af['talking']=0x0;_0x50d3af[_0x948d('0x136')]=0x0;}}else if(_0x3133e8[_0x948d('0x133')]===utils['CAMPAIGN_STATUS'][_0x948d('0x137')]&&!_0x234c96){return _0x4ac4f5[_0x948d('0x8a')](_0x3133e8,!![])[_0x948d('0x9c')](function(){return _0x4ac4f5[_0x948d('0x8a')](_0x3133e8,![]);})['then'](function(){return _0x4ac4f5['checkDialMethod'](_0x3133e8);})[_0x948d('0x9a')](function(_0x303bbb){loggerSyncQueueSummary[_0x948d('0x5c')](_0x948d('0x138'),util['inspect'](_0x303bbb,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3133e8);});}else{clearPredictiveAttributes(_0x3133e8);}})[_0x948d('0x9c')](function(){var _0x4c0323=_0x50d3af[_0x948d('0x139')](_0x3133e8);if(_0x4c0323||_0x3133e8[_0x948d('0x13a')]){_0x3133e8[_0x948d('0x13a')]=![];_0x50d3af[_0x948d('0x13b')](_0x3133e8);Object['assign'](_0x3133e8,_0x50d3af);emitOutboundVoiceQueueSummary(_0x50d3af);}_0x4ac4f5[_0x948d('0x29')][_0x3133e8[_0x948d('0x3d')]][_0x948d('0x130')]=![];})[_0x948d('0x9a')](function(_0x5cecc9){logger[_0x948d('0x60')](_0x948d('0x138'),util[_0x948d('0x3b')](_0x5cecc9,{'showHidden':![],'depth':null}));_0x4ac4f5[_0x948d('0x29')][_0x3133e8[_0x948d('0x3d')]][_0x948d('0x130')]=![];});};Dialer[_0x948d('0x17')][_0x948d('0x2f')]=_[_0x948d('0x13c')](function(){var _0x2d85d0=_['filter'](this['voiceQueues'],function(_0x20781b){return _0x20781b[_0x948d('0x13d')];});var _0x4434c0=_[_0x948d('0x13e')](this['agents'],function(_0x404ec3){return _0x404ec3['online']&&_0x404ec3[_0x948d('0x84')]==='reachable';});if(_0x2d85d0[_0x948d('0x91')]>0x0&&_0x4434c0['length']>0x0){return Promise['resolve']()[_0x948d('0x9c')](cmHopper[_0x948d('0x13f')](_[_0x948d('0x140')](_0x2d85d0,'id'),previewRecallmeReminderInterval,_[_0x948d('0x140')](_0x4434c0,'id')))[_0x948d('0x9c')](function(_0x4e6bd7){for(var _0x35671b=0x0;_0x35671b<_0x4e6bd7['length'];_0x35671b++){var _0x466aab=_0x4e6bd7[_0x35671b][_0x948d('0x141')][_0x948d('0x3d')];if(_0x466aab)io['to'](util[_0x948d('0x3c')](_0x948d('0x142'),_0x466aab))[_0x948d('0x10f')](_0x948d('0x143'),{'hopper':_0x4e6bd7[_0x35671b]});}})[_0x948d('0x9a')](function(_0x5c652f){logger['error']('checkPreviewRecallReminder',_0x5c652f);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x948d('0x144')]=function(){var _0x4d751e=this;setInterval(function(){_0x4d751e['clearZombieChannels'](_0x4d751e[_0x948d('0xb9')],_0x948d('0x145'));_0x4d751e[_0x948d('0x146')](_0x4d751e[_0x948d('0x21')],_0x948d('0x147'));},0x32c8);};Dialer[_0x948d('0x17')]['clearZombieChannels']=function(_0x1537ff,_0x1a4b29){var _0x13304d=this;for(var _0x4a38ce in _0x1537ff){if(typeof _0x1537ff[_0x4a38ce]!==_0x948d('0xa5')){this['sequence'][_0x948d('0x18')](function(){if(!_[_0x948d('0xec')](_0x1537ff[_0x4a38ce])){return ami[_0x948d('0x93')]({'action':_0x948d('0x84'),'channel':_0x1537ff[_0x4a38ce][_0x948d('0xe8')]})[_0x948d('0x9a')](function(_0x4960cc){if(_0x4960cc[_0x948d('0x67')]===_0x948d('0x148')){setTimeout(function(){if(_0x1537ff[_0x4a38ce]&&_0x1537ff[_0x4a38ce][_0x948d('0x39')]!==_0x948d('0xbb')){_0x13304d['updateOriginated'](_0x13304d[_0x948d('0x1b')][_0x1537ff[_0x4a38ce][_0x948d('0xb8')]]);logger[_0x948d('0x60')](_0x948d('0x149'),_0x1a4b29,_0x4a38ce,_0x1537ff[_0x4a38ce][_0x948d('0xb8')]);delete _0x1537ff[_0x4a38ce];}if(_0x1537ff[_0x4a38ce]&&_0x1537ff[_0x4a38ce][_0x948d('0x39')]===_0x948d('0xbb')){_0x13304d[_0x948d('0xbc')](_0x13304d[_0x948d('0x1c')][_0x1537ff[_0x4a38ce]['queue']]);logger[_0x948d('0x60')](_0x948d('0x14a'),_0x1a4b29,_0x4a38ce,_0x1537ff[_0x4a38ce]['queue']);delete _0x1537ff[_0x4a38ce];}},0x2328);}});}});}}};Dialer['prototype'][_0x948d('0x14b')]=function(_0xf46d02){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0xf46d02))['catch'](loggerCatch(_0x948d('0x14c')));};Dialer[_0x948d('0x17')][_0x948d('0xbc')]=function(_0x398281){if(!_[_0x948d('0x38')](_0x398281)&&_0x398281!==null){if(typeof _0x398281[_0x948d('0x7c')]!==_0x948d('0xa5')){if(_0x398281[_0x948d('0x7c')]>0x0){_0x398281['originated']-=0x1;}else{logger['error'](_0x948d('0x14d'));}}}else{logger[_0x948d('0x60')](_0x948d('0x14e'));}};Dialer[_0x948d('0x17')][_0x948d('0x14f')]=function(_0x2ad13e,_0x52f91d){var _0x5c2dc3=this;return function(_0x2c0fd5){_0x5c2dc3[_0x948d('0xbc')](_0x52f91d);logger[_0x948d('0x60')](_0x2ad13e,util[_0x948d('0x3b')](_0x2c0fd5,{'showHidden':![],'depth':null}));};};Dialer[_0x948d('0x17')]['emptyContact']=function(_0x512419,_0xc2bb0e,_0x1033a2){var _0x447119={'state':0x19,'statedesc':_0x948d('0x150')};this['updateOriginated'](_0xc2bb0e);this[_0x948d('0x125')](_[_0x948d('0x5a')](_0x447119,_['pick'](_0x1033a2,['ContactId',_0x948d('0xd9'),_0x948d('0x151'),'VoiceQueueId',_0x948d('0xdb')])),_0x948d('0x152'),_0x948d('0x153'));logger[_0x948d('0x60')](_0x512419);};Dialer[_0x948d('0x17')][_0x948d('0x125')]=function(_0x8c2061,_0xc69247,_0x38214a){hopperUtils[_0x948d('0xc4')](_0x8c2061)[_0x948d('0x9a')](loggerCatch(_0xc69247));hopperUtils[_0x948d('0xc6')](_0x8c2061)[_0x948d('0x9a')](loggerCatch(_0x38214a));};Dialer['prototype'][_0x948d('0xd5')]=function(_0x2250dc,_0x1c6397){hopperUtils['createHistory'](_0x2250dc)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x1c6397==0x0){hopperUtils[_0x948d('0xc6')](_0x2250dc)[_0x948d('0x9a')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0x948d('0x154')]=function(_0x3b6e81){return Promise[_0x948d('0xa6')]()[_0x948d('0x9c')](cmHopper[_0x948d('0x13f')](_0x3b6e81['id'],previewRecallmeReminderInterval))['then'](function(_0x2d6e46){for(var _0x4fcc20=0x0;_0x4fcc20<_0x2d6e46[_0x948d('0x91')];_0x4fcc20++){var _0x3fefdc=_0x2d6e46[_0x4fcc20][_0x948d('0x141')]['name'];if(_0x3fefdc)io['to'](util[_0x948d('0x3c')](_0x948d('0x142'),_0x3fefdc))[_0x948d('0x10f')](_0x948d('0x143'),{'hopper':_0x2d6e46[_0x4fcc20]});}})[_0x948d('0x9a')](function(){});};Dialer[_0x948d('0x17')][_0x948d('0x155')]=function(_0x3718e8){var _0x2d03cd=this;return function(){_0x2d03cd[_0x948d('0x156')](_0x3718e8);};};Dialer['prototype']['actionOriginate']=function(_0x2ac851,_0x1fd5df){var _0x3cdc56=this;var _0x44304e=uuid['v4']();this[_0x948d('0x21')][_0x44304e]=new Action(_0x2ac851,_0x1fd5df,_0x44304e);return new Promise(function(_0x39e748,_0xb5ea69){if(_[_0x948d('0x38')](_0x2ac851)&&typeof _0x2ac851!==_0x948d('0x157')){return _0xb5ea69(msgResponse(_0x948d('0x158'),_0x948d('0x8b'),_0x948d('0x159')));}if(_['isUndefined'](_0x1fd5df[_0x948d('0x15a')])||_0x1fd5df[_0x948d('0x15a')]===null){return _0xb5ea69(msgResponse(_0x948d('0x158'),_0x948d('0x8b'),_0x948d('0x15b')));}var _0x25cb86={'XMD-CALLERID':_0x3cdc56['actions'][_0x44304e][_0x948d('0x15c')](),'XMD-AGI':_0x2ac851[_0x948d('0x12b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2ac851[_0x948d('0x12b')]):_0x948d('0x15d'),'XMD-AGIAFTER':_0x2ac851[_0x948d('0xc2')]?util[_0x948d('0x3c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2ac851['dialQueueProject2']):_0x948d('0x15d'),'XMD-QUEUE':utils[_0x948d('0x15e')](_0x2ac851)?util[_0x948d('0x3c')]('\x22%s,%s%s,,,%s\x22',_0x2ac851[_0x948d('0x3d')],_0x2ac851[_0x948d('0x15f')]||'',_0x2ac851[_0x948d('0xc3')]?'c':'',_0x2ac851['dialQueueTimeout']||0x3):_0x948d('0x15d'),'XMD-CONTACTID':_0x1fd5df['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3cdc56[_0x948d('0x21')][_0x44304e][_0x948d('0x15c')](),'XMD-AMD':_0x2ac851[_0x948d('0x10b')]?_0x948d('0x137'):'NONE','XMD-DESTINATION':_0x948d('0x10a')};if(_0x2ac851[_0x948d('0x10b')]){_0x25cb86['XMD-AMDINITIALSILENCE']=_0x2ac851[_0x948d('0x160')]||0x9c4;_0x25cb86[_0x948d('0x161')]=_0x2ac851[_0x948d('0x162')]||0x5dc;_0x25cb86[_0x948d('0x163')]=_0x2ac851['dialAMDAfterGreetingSilence']||0x320;_0x25cb86[_0x948d('0x164')]=_0x2ac851[_0x948d('0x165')]||0x1388;_0x25cb86[_0x948d('0x166')]=_0x2ac851[_0x948d('0x167')]||0x64;_0x25cb86[_0x948d('0x168')]=_0x2ac851['dialAMDBetweenWordsSilence']||0x32;_0x25cb86[_0x948d('0x169')]=_0x2ac851[_0x948d('0x16a')]||0x3;_0x25cb86['XMD-AMDSILENCETHRESHOLD']=_0x2ac851[_0x948d('0x16b')]||0x100;_0x25cb86[_0x948d('0x16c')]=_0x2ac851[_0x948d('0x16d')]||0x1388;}if(utils['isOutboundQueue'](_0x2ac851)){_0x25cb86[_0x948d('0x16e')]=_0x1fd5df[_0x948d('0xda')];}else{_0x25cb86[_0x948d('0x16f')]=_0x1fd5df[_0x948d('0xdb')];}var _0x1a1a0d=utils[_0x948d('0x170')](_0x1fd5df['Contact']);Object[_0x948d('0x171')](_0x25cb86,_0x1a1a0d);var _0x5844f4=_0x3cdc56[_0x948d('0x81')](_0x2ac851[_0x948d('0x87')])?utils[_0x948d('0x172')](_0x2ac851[_0x948d('0x87')][_0x948d('0x173')],_0x2ac851['dialOriginateCallerIdName'],_0x2ac851[_0x948d('0x174')]>0x0?utils[_0x948d('0x175')](_0x2ac851[_0x948d('0x176')],_0x2ac851[_0x948d('0x174')]):_0x2ac851['dialOriginateCallerIdNumber']):utils[_0x948d('0x172')](_[_0x948d('0xec')](_0x2ac851[_0x948d('0x177')])?_0x2ac851[_0x948d('0x87')]['callerid']:_0x2ac851[_0x948d('0x177')][_0x948d('0x173')],_0x2ac851[_0x948d('0x178')],_0x2ac851['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x948d('0x175')](_0x2ac851['dialOriginateCallerIdNumber'],_0x2ac851[_0x948d('0x174')]):_0x2ac851['dialOriginateCallerIdNumber']);if(_0x5844f4){_0x25cb86[_0x948d('0x179')]=_0x3cdc56[_0x948d('0x21')][_0x44304e]['originatecalleridname']=utils[_0x948d('0x17a')](_0x5844f4);_0x25cb86[_0x948d('0x17b')]=_0x1fd5df['phone'];}_0x2ac851[_0x948d('0x17c')]=_0x25cb86;return ami[_0x948d('0x93')]({'actionid':_0x44304e,'action':'originate','channel':_0x3cdc56[_0x948d('0x81')](_0x2ac851[_0x948d('0x87')])?util['format'](_0x948d('0x17d'),_0x2ac851['Trunk']['name'],isNotNull(_0x2ac851[_0x948d('0x17e')])?_0x2ac851[_0x948d('0x17e')][_0x948d('0x17f')]()||'':'',_0x2ac851[_0x948d('0x180')]>0x0?_0x1fd5df[_0x948d('0x15a')][_0x948d('0x181')](_0x2ac851[_0x948d('0x180')]):_0x1fd5df[_0x948d('0x15a')]):util[_0x948d('0x3c')](_0x948d('0x17d'),_[_0x948d('0xec')](_0x2ac851[_0x948d('0x177')])?_0x2ac851[_0x948d('0x87')][_0x948d('0x3d')]:_0x2ac851[_0x948d('0x177')][_0x948d('0x3d')],isNotNull(_0x2ac851['dialPrefix'])?_0x2ac851[_0x948d('0x17e')][_0x948d('0x17f')]()||'':'',_0x2ac851[_0x948d('0x180')]>0x0?_0x1fd5df[_0x948d('0x15a')][_0x948d('0x181')](_0x2ac851[_0x948d('0x180')]):_0x1fd5df[_0x948d('0x15a')]),'callerid':_0x5844f4,'Exten':_0x948d('0x10a'),'Context':'from-sip','Priority':'1','variable':_0x25cb86,'timeout':(_0x2ac851[_0x948d('0x182')]||0x1e)*0x3e8,'async':!![],'channelid':_0x44304e})[_0x948d('0x9c')](function(_0x28dfbb){return _0x39e748(_0x28dfbb);})[_0x948d('0x9a')](function(_0x16a637){_0x2ac851[_0x948d('0x183')]+=0x1;var _0x89795=new History(_0x3cdc56[_0x948d('0x21')][_0x44304e]);logger[_0x948d('0x60')](util['format']('[originateError]:\x20%s',JSON[_0x948d('0x70')](_0x16a637)));_0x89795[_0x948d('0x6a')]=0xe;_0x89795[_0x948d('0xcc')]=_0x948d('0x184');_0x89795[_0x948d('0x6c')]=moment()[_0x948d('0x3c')](_0x948d('0xbd'));_0x89795[_0x948d('0x6b')]=_0x89795[_0x948d('0x6c')];hopperUtils[_0x948d('0xc4')](_0x89795)[_0x948d('0x9a')](loggerCatch(_0x948d('0x185')));_0x3cdc56[_0x948d('0xc6')](_0x89795)[_0x948d('0x9a')](loggerCatch(_0x948d('0x185')))[_0x948d('0xf4')](function(){delete _0x3cdc56[_0x948d('0x21')][_0x44304e];return _0xb5ea69(msgResponse(_0x948d('0x158'),_0x948d('0xb7'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x948d('0x186')]=function(_0x352584,_0x3476e3,_0x2418fd){var _0x256d78=new History(_0x3476e3);if(_0x256d78[_0x948d('0x11a')]+_0x256d78['countcongestionretry']+_0x256d78[_0x948d('0x126')]+_0x256d78[_0x948d('0x11c')]+_0x256d78['countdropretry']+_0x256d78[_0x948d('0xe4')]+_0x256d78['countmachineretry']+_0x256d78[_0x948d('0x11d')]>=_0x2418fd[_0x948d('0x11e')]-0x1){return!![];}switch(_0x352584){case 0x3:if(_0x256d78[_0x948d('0x126')]>=_0x2418fd[_0x948d('0x187')]-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countnoanswerretry':_0x256d78[_0x948d('0x126')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x188')],_0x948d('0xd7'))[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x256d78[_0x948d('0xd8')],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78['CampaignId']||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x256d78[_0x948d('0x11a')]>=_0x2418fd[_0x948d('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x256d78['countbusyretry']+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x18a')],_0x948d('0xd7'))[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x256d78['ContactId'],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch(_0x948d('0x18b')));break;case 0x8:if(_0x256d78[_0x948d('0x11b')]>=_0x2418fd['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countcongestionretry':_0x256d78[_0x948d('0x11b')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x18c')],'minutes')['format'](_0x948d('0xbd')),'ContactId':_0x256d78[_0x948d('0xd8')],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch(_0x948d('0x18d')));break;case 0x0:if(_0x256d78[_0x948d('0x11c')]>=_0x2418fd[_0x948d('0x18e')]-0x1){return!![];}else{hopperUtils[_0x948d('0xd6')]({'active':![],'countnosuchnumberretry':_0x256d78[_0x948d('0x11c')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x18f')],_0x948d('0xd7'))[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x256d78[_0x948d('0xd8')],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x256d78['countdropretry']>=_0x2418fd['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countdropretry':_0x256d78[_0x948d('0xce')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0xd0')],'minutes')['format'](_0x948d('0xbd')),'ContactId':_0x256d78['ContactId'],'ListId':_0x256d78['ListId'],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78['CampaignId']||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x256d78[_0x948d('0xe4')]>=_0x2418fd['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countabandonedretry':_0x256d78[_0x948d('0xe4')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0xe5')],_0x948d('0xd7'))[_0x948d('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x256d78['ContactId'],'ListId':_0x256d78['ListId'],'VoiceQueueId':_0x256d78['VoiceQueueId']||undefined,'CampaignId':_0x256d78[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x256d78['countmachineretry']>=_0x2418fd[_0x948d('0x121')]-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countmachineretry':_0x256d78[_0x948d('0x117')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x124')],_0x948d('0xd7'))[_0x948d('0x3c')](_0x948d('0xbd')),'ContactId':_0x256d78['ContactId'],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78[_0x948d('0xda')]||undefined,'CampaignId':_0x256d78[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x256d78[_0x948d('0x11d')]>=_0x2418fd[_0x948d('0x190')]-0x1){return!![];}hopperUtils[_0x948d('0xd6')]({'active':![],'countagentrejectretry':_0x256d78[_0x948d('0x11d')]+=0x1,'scheduledat':moment()[_0x948d('0x127')](_0x2418fd[_0x948d('0x191')],_0x948d('0xd7'))['format'](_0x948d('0xbd')),'ContactId':_0x256d78['ContactId'],'ListId':_0x256d78[_0x948d('0xd9')],'VoiceQueueId':_0x256d78['VoiceQueueId']||undefined,'CampaignId':_0x256d78['CampaignId']||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x948d('0x17')]['callProgressDetecting']=function(_0x4c7482,_0x8d0141,_0x22e46c){var _0x1e4e76=this;var _0x1c7998=new History(_0x4c7482);var _0x353519=![];var _0x3e54f0;var _0x110d79;return new Promise(function(_0x5f03bb,_0x27ecd2){if(_[_0x948d('0x38')](_0x8d0141)&&typeof _0x8d0141!==_0x948d('0x157')){return _0x27ecd2(msgResponse(_0x948d('0x192'),_0x948d('0x8b'),_0x948d('0x193')));}if(_[_0x948d('0x38')](_0x22e46c)&&typeof _0x22e46c!==_0x948d('0x157')){return _0x27ecd2(msgResponse(_0x948d('0x192'),_0x948d('0x8b'),_0x948d('0x194')));}hopperUtils['verifyAdditionalPhones'](_0x1c7998,_0x22e46c[_0x948d('0xbf')],_0x8d0141)['then'](function(_0x5d25e5){if(_0x5d25e5['additional']==0x1)_0x353519=!![];switch(_0x22e46c[_0x948d('0xbf')]){case'0':_0x8d0141[_0x948d('0x195')]+=0x1;_0x1c7998[_0x948d('0x6a')]=0x0;_0x1c7998['statedesc']=_0x948d('0x196');_0x1c7998[_0x948d('0x11c')]+=0x1;_0x1c7998[_0x948d('0xcf')]+=0x1;ami['emit'](_0x948d('0x197'),ut[_0x948d('0x118')](_0x4c7482,_0x948d('0x198')));_0x3e54f0=_0x8d0141['dialNoSuchNumberRetryFrequency'];_0x110d79=_0x8d0141['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x1c7998)[_0x948d('0x9a')](loggerCatch(_0x948d('0x119')));if(_0x1e4e76[_0x948d('0x186')](0x0,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998['countnosuchnumberretry']>=_0x8d0141[_0x948d('0x18e')]){_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x199'));}else{_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x199'));}}break;case'3':_0x8d0141['outboundNoAnswerCallsDay']+=0x1;_0x1c7998['state']=0x3;_0x1c7998[_0x948d('0xcc')]=_0x948d('0x19a');_0x1c7998['countnoanswerretry']+=0x1;_0x1c7998[_0x948d('0xcf')]+=0x1;var _0x487500=ut['buildNoAnswerEventPayload'](_0x4c7482,_0x8d0141);ami[_0x948d('0x10f')](_0x948d('0x19b'),_0x487500);_0x3e54f0=_0x8d0141['dialNoAnswerRetryFrequency'];_0x110d79=_0x8d0141[_0x948d('0x19c')];hopperUtils[_0x948d('0xc4')](_0x1c7998)[_0x948d('0x9a')](loggerCatch(_0x948d('0x19d')));if(_0x1e4e76[_0x948d('0x186')](0x3,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998[_0x948d('0x126')]>=_0x8d0141['dialNoAnswerMaxRetry']){_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x8d0141['outboundBusyCallsDay']+=0x1;_0x1c7998[_0x948d('0x6a')]=0x5;_0x1c7998[_0x948d('0xcc')]=_0x948d('0x19e');_0x1c7998['countbusyretry']+=0x1;_0x1c7998[_0x948d('0xcf')]+=0x1;ami[_0x948d('0x10f')]('custom:agentbusy',ut[_0x948d('0x118')](_0x4c7482,_0x948d('0x19f')));_0x3e54f0=_0x8d0141[_0x948d('0x18a')];_0x110d79=_0x8d0141[_0x948d('0x19c')];hopperUtils['createHistory'](_0x1c7998)['catch'](loggerCatch(_0x948d('0x1a0')));if(_0x1e4e76[_0x948d('0x186')](0x5,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998['countbusyretry']>=_0x8d0141[_0x948d('0x189')]){_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,'reason\x205\x20busy');}else{_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1a1'));}}break;case'8':_0x8d0141[_0x948d('0x1a2')]+=0x1;_0x1c7998['state']=0x8;_0x1c7998[_0x948d('0xcc')]='Congestion';_0x1c7998[_0x948d('0x11b')]+=0x1;_0x1c7998['countglobal']+=0x1;_0x3e54f0=_0x8d0141[_0x948d('0x18c')];_0x110d79=_0x8d0141[_0x948d('0x19c')];ami[_0x948d('0x10f')]('custom:agentcongestion',ut[_0x948d('0x118')](_0x4c7482,_0x948d('0x1a3')));hopperUtils[_0x948d('0xc4')](_0x1c7998)[_0x948d('0x9a')](loggerCatch(_0x948d('0x1a4')));if(_0x1e4e76[_0x948d('0x186')](0x8,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998[_0x948d('0x11b')]>=_0x8d0141[_0x948d('0x1a5')]){_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1a6'));}else{_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1a6'));}}break;case'11':_0x8d0141[_0x948d('0x1a7')]+=0x1;_0x1c7998[_0x948d('0x6a')]=0xb;_0x1c7998[_0x948d('0xcc')]='Abandoned';_0x1c7998['countabandonedretry']+=0x1;_0x1c7998[_0x948d('0xcf')]+=0x1;_0x3e54f0=_0x8d0141[_0x948d('0xe5')];_0x110d79=_0x8d0141['callAdditionalPhoneAfterMin'];hopperUtils[_0x948d('0xc4')](_0x1c7998)['catch'](loggerCatch(_0x948d('0x1a8')));if(_0x1e4e76[_0x948d('0x186')](0xb,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998['countabandonedretry']>=_0x8d0141['dialAbandonedMaxRetry']){_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1a9'));}else{_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,'reason\x2011\x20abandoned');}}break;case'20':_0x8d0141[_0x948d('0x1aa')]+=0x1;_0x1c7998[_0x948d('0x6a')]=0x14;_0x1c7998[_0x948d('0xcc')]=_0x948d('0x1ab');_0x1c7998['countagentrejectretry']+=0x1;_0x1c7998['countglobal']+=0x1;_0x3e54f0=_0x8d0141[_0x948d('0x191')];_0x110d79=_0x8d0141['callAdditionalPhoneAfterMin'];ami[_0x948d('0x10f')](_0x948d('0x1ac'),ut[_0x948d('0x118')](_0x4c7482,_0x948d('0x1ad')));hopperUtils['createHistory'](_0x1c7998)[_0x948d('0x9a')](loggerCatch(_0x948d('0x1ae')));if(_0x1e4e76['checkRetriveMax'](0x14,_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998['countagentrejectretry']>=_0x8d0141[_0x948d('0x190')]){_0x1e4e76['createStateFinal'](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1af'));}else{_0x1e4e76['stateGlobal'](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x948d('0x1af'));}}break;default:_0x8d0141[_0x948d('0x12d')]+=0x1;_0x1c7998['state']=0xc;_0x1c7998['statedesc']=_0x22e46c['reason'];_0x3e54f0=_0x8d0141['dialAgentRejectRetryFrequency'];_0x110d79=_0x8d0141[_0x948d('0x19c')];hopperUtils[_0x948d('0xc4')](_0x1c7998)[_0x948d('0x9a')](loggerCatch(_0x948d('0x1b0')));if(_0x1e4e76[_0x948d('0x186')](_0x22e46c[_0x948d('0xbf')],_0x4c7482,_0x8d0141)&&!_0x353519){if(_0x1c7998['countbusyretry']+_0x1c7998[_0x948d('0x11b')]+_0x1c7998[_0x948d('0x126')]+_0x1c7998[_0x948d('0x11c')]+_0x1c7998[_0x948d('0xce')]+_0x1c7998[_0x948d('0xe4')]+_0x1c7998[_0x948d('0x117')]+_0x1c7998['countagentrejectretry']>=_0x8d0141[_0x948d('0x11e')]){_0x1e4e76[_0x948d('0x11f')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x22e46c[_0x948d('0xbf')]);}else{_0x1e4e76[_0x948d('0x122')](_0x1c7998,_0x5f03bb,_0x27ecd2,_0x22e46c[_0x948d('0xbf')]);}}}})['then'](function(){if(_0x353519){hopperUtils[_0x948d('0xe1')](_0x1c7998,_0x3e54f0,_0x110d79)[_0x948d('0x9c')](function(){return _0x5f03bb(0x1);});}});});};Dialer[_0x948d('0x17')]['stateGlobal']=function(_0x4f453f,_0x408c4b,_0x20c0ff,_0x1027b5){var _0x544f03=new Final(_0x4f453f);_0x544f03[_0x948d('0x6a')]=0xf;_0x544f03[_0x948d('0xcc')]=_0x948d('0x1b1');this['createStateFinal'](_0x544f03,_0x408c4b,_0x20c0ff,_0x1027b5);};Dialer['prototype']['createStateFinal']=function(_0x58ba55,_0x4f4638,_0xd61524,_0x549282){hopperUtils[_0x948d('0xc6')](_0x58ba55)[_0x948d('0x9c')](function(){return _0x4f4638(msgResponse('[callProgressDetecting]','Success',_0x549282));})[_0x948d('0x9a')](function(){return _0xd61524(msgResponse('[moveContactManagedDialer][0]',_0x948d('0x8b'),_0x948d('0x1b2')));});};Dialer[_0x948d('0x17')][_0x948d('0xa')]=function(_0x4936f9){var _0x4dafdb=_0x4936f9[_0x948d('0x1b3')]/0x64;var _0x22fae7=_0x4936f9[_0x948d('0xcb')]/(_0x4936f9[_0x948d('0xcb')]+_0x4936f9[_0x948d('0xbe')]);var _0xa01a51=Math[_0x948d('0x1b4')](_0x4936f9[_0x948d('0x1b5')]*(_0x4936f9[_0x948d('0x1b6')]/0x64));var _0x2593b3=Math[_0x948d('0x1b4')](_0x4936f9[_0x948d('0x1b5')]*(_0x4936f9[_0x948d('0x1b7')]/0x64));var _0x1715c7=_0x4936f9[_0x948d('0x134')]+_0x4936f9['talking'];var _0xc94409=Math[_0x948d('0x1b8')](_0x4936f9[_0x948d('0x55')]*_0x4936f9[_0x948d('0x59')]*_0x4936f9[_0x948d('0x1b9')]*_0x4936f9[_0x948d('0x1ba')]);if(_[_0x948d('0x38')](_0x4936f9[_0x948d('0x25')])){if(!_[_0x948d('0x38')](_0x4936f9[_0x948d('0x24')])){_0x4936f9[_0x948d('0x24')]=undefined;loggerPredictive[_0x948d('0x60')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x948d('0x38')](_0x4936f9[_0x948d('0x5f')])){loggerPredictive[_0x948d('0x60')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4936f9[_0x948d('0x5f')]);_0x4936f9[_0x948d('0x5f')]=undefined;}_0x4936f9['startProgressive']=moment()[_0x948d('0x3c')](_0x948d('0xbd'));loggerPredictive[_0x948d('0x41')](_0x4936f9[_0x948d('0x3d')],'collection\x20data\x20in\x20progressive\x20at',_0x4936f9[_0x948d('0x25')]);this[_0x948d('0xae')](_0x4936f9,0x1);}else if(ifInterval(_0x4936f9['dialPredictiveInterval'],_0x4936f9['startProgressive'])){this['handlePower'](_0x4936f9,0x1);loggerPredictiveCalls['info'](_0x948d('0x1bb'),_0x4936f9[_0x948d('0x25')],_0x4936f9[_0x948d('0x3d')]);_0x4936f9[_0x948d('0x55')]=0x0;_0x4936f9['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4dafdb<_0x22fae7&&_0x4936f9[_0x948d('0x1bc')]===_0x948d('0x1bd')){clearPredictiveAttributes(_0x4936f9);loggerPredictive[_0x948d('0x41')](_0x948d('0x1be'),_0x948d('0x1bf'),_0x22fae7,_0x948d('0x25'),_0x4936f9['name']);}else if(_0xc94409<_0x4936f9['predictiveIntervalErlangCallsDroppedCalls']&&_0x4936f9[_0x948d('0x1bc')]===_0x948d('0x1bd')){clearPredictiveAttributes(_0x4936f9);loggerPredictive[_0x948d('0x41')](_0x948d('0x1c0'),_0x948d('0x1c1'),_0xc94409,_0x948d('0x1c2'),_0x4936f9[_0x948d('0x1c3')],_0x948d('0x25'),_0x4936f9[_0x948d('0x3d')]);}else if(!ifInterval(_0x4936f9['dialPredictiveInterval'],_0x4936f9['startProgressive'])&&_[_0x948d('0x38')](_0x4936f9[_0x948d('0x24')])&&!_[_0x948d('0x38')](_0x4936f9[_0x948d('0x25')])){_0x4936f9[_0x948d('0x24')]=moment()[_0x948d('0x3c')](_0x948d('0xbd'));loggerPredictive['info'](_0x4936f9[_0x948d('0x3d')],_0x948d('0x1c4'),_0x4936f9['startPredictive']);hopperUtils[_0x948d('0x1c5')](_0x4936f9[_0x948d('0x1c6')])[_0x948d('0x9c')](this[_0x948d('0x1c7')](_0x4936f9))[_0x948d('0x9c')](mergeDataErlangB(_0x4936f9))[_0x948d('0x9c')](this['startMethodPredictive'](_0x4936f9))[_0x948d('0x9a')](loggerCatchPredictive(_0x948d('0x1c8'),_0x4936f9));}else if(!ifInterval(_0x4936f9['dialPredictiveInterval'],_0x4936f9['startPredictive'])){_0x4936f9['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4936f9[_0x948d('0x24')]=moment()[_0x948d('0x3c')](_0x948d('0xbd'));loggerPredictive[_0x948d('0x41')](_0x4936f9['name'],_0x948d('0x1c9'),_0x4936f9[_0x948d('0x24')]);clearInterval(_0x4936f9[_0x948d('0x5f')]);_0x4936f9[_0x948d('0x5f')]=undefined;hopperUtils[_0x948d('0x1c5')](_0x4936f9[_0x948d('0x1c6')])[_0x948d('0x9c')](this[_0x948d('0x1c7')](_0x4936f9))[_0x948d('0x9c')](mergeDataErlangB(_0x4936f9))[_0x948d('0x9c')](this[_0x948d('0x1ca')](_0x4936f9))[_0x948d('0x9a')](loggerCatchPredictive(_0x948d('0x1cb'),_0x4936f9));}else if(_0x4936f9['predictiveIntervalAvailable']&&_0x1715c7<_0x4936f9['predictiveIntervalAvailable']-_0x2593b3){clearPredictiveAttributes(_0x4936f9);loggerPredictive[_0x948d('0x41')](_0x4936f9[_0x948d('0x3d')],_0x948d('0x1cc'),_0x1715c7,_0x948d('0x1cd'),_0x4936f9[_0x948d('0x1b5')],'-',_0x2593b3,'=',_0x4936f9['predictiveIntervalAvailable']-_0x2593b3,')');}else if(_0x4936f9[_0x948d('0x1b5')]&&_0x1715c7>_0x4936f9[_0x948d('0x1b5')]+_0xa01a51){clearPredictiveAttributes(_0x4936f9);loggerPredictive[_0x948d('0x41')](_0x4936f9[_0x948d('0x3d')],_0x948d('0x1cc'),_0x1715c7,_0x948d('0x1ce'),_0x4936f9[_0x948d('0x1b5')],'+',_0xa01a51,'=',_0x4936f9[_0x948d('0x1b5')]+_0xa01a51,')');}};Dialer[_0x948d('0x17')][_0x948d('0x1c7')]=function(_0x195702){var _0x5a66a8=this;return function(_0x5eda6b){return new Promise(function(_0x580292,_0x249603){_[_0x948d('0x5a')](_0x195702,_0x5eda6b[0x0]);if(checkGetDataPredictive(_0x5eda6b[0x0])){var _0x3099b9=_0x195702[_0x948d('0x1b5')]=_0x195702[_0x948d('0x1cf')]+_0x195702[_0x948d('0x134')];var _0x124c00=_0x195702[_0x948d('0x1c6')]*0x3c;var _0x40895d=_0x5eda6b[0x0][_0x948d('0x4d')]+_0x5eda6b[0x0]['predictiveIntervalAvgHoldtime'];var _0x28984c=(_0x5eda6b[0x0][_0x948d('0x45')]+_0x5eda6b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5eda6b[0x0][_0x948d('0x49')])/_0x5eda6b[0x0][_0x948d('0x43')];_0x195702[_0x948d('0x1b9')]=_0x28984c>0x0?_0x28984c:0x1;switch(_0x195702[_0x948d('0x1bc')]){case _0x948d('0x1bd'):var _0x588599=_0x195702[_0x948d('0x1b3')]/0x64;return _0x5a66a8[_0x948d('0x1d0')](_0x3099b9,_0x124c00,_0x40895d,_0x28984c,_0x588599)[_0x948d('0x9c')](function(_0x4fc01f){return _0x580292(_0x4fc01f);});case _0x948d('0x1d1'):var _0x2473ef=_0x195702['dialPredictiveOptimizationPercentage']/0x64;return _0x5a66a8[_0x948d('0x1d2')](_0x3099b9,_0x124c00,_0x40895d,_0x28984c,_0x2473ef)[_0x948d('0x9c')](function(_0x3bb185){return _0x580292(_0x3bb185);});default:return _0x249603(msgResponse(_0x948d('0x1d3'),_0x948d('0x8b'),_0x948d('0x1d4')));}}else{return _0x249603(msgResponse(_0x948d('0x1d3'),_0x948d('0x8b'),_0x948d('0x1d5')));}});};};Dialer[_0x948d('0x17')]['getDataPredictiveOld']=function(_0x485ded){var _0x3e9bd1=this;return function(_0x2c1b5c){return new Promise(function(_0x2cca91,_0xebf6c3){_['merge'](_0x485ded,_0x2c1b5c[0x0]);if(checkGetDataPredictive(_0x2c1b5c[0x0])){loggerPredictive[_0x948d('0x41')](JSON['stringify'](_0x2c1b5c[0x0]));if(_0x485ded[_0x948d('0x1bc')]==='dropRate'){return _0x3e9bd1[_0x948d('0x14b')](_0x485ded['id'])['then'](function(_0x59c870){var _0x42a987=_0x485ded['loggedIn']-_0x59c870[0x0][_0x948d('0x1d6')];var _0x13b9f5=_0x485ded[_0x948d('0x1c6')]*0x3c;var _0x917c0c=_0x2c1b5c[0x0][_0x948d('0x4d')]+_0x2c1b5c[0x0][_0x948d('0x4b')];var _0x1f43c1=(_0x2c1b5c[0x0]['predictiveIntervalAnsweredCalls']+_0x2c1b5c[0x0][_0x948d('0x47')]+_0x2c1b5c[0x0][_0x948d('0x49')])/_0x2c1b5c[0x0][_0x948d('0x43')];var _0x49644c=_0x485ded['dialPredictiveOptimizationPercentage']/0x64;_0x485ded[_0x948d('0x1d7')]=_0x59c870[0x0]['outboundQueuePauses']||0x0;_0x485ded[_0x948d('0x1b9')]=_0x1f43c1>0x0?_0x1f43c1:0x1;return _0x3e9bd1[_0x948d('0x1d0')](_0x42a987,_0x13b9f5,_0x917c0c,_0x1f43c1,_0x49644c);})[_0x948d('0x9c')](function(_0x4b51d2){return _0x2cca91(_0x4b51d2);})['catch'](function(_0x485693){return _0xebf6c3(msgResponse(_0x948d('0x1d8'),_0x948d('0x8b'),JSON[_0x948d('0x70')](_0x485693)));});}if(_0x485ded[_0x948d('0x1bc')]==='agentBusyFactor'){return _0x3e9bd1[_0x948d('0x14b')](_0x485ded['id'])[_0x948d('0x9c')](function(_0x1db2f8){var _0x1789bc=_0x485ded[_0x948d('0x1d9')]-_0x1db2f8[0x0][_0x948d('0x1d6')];var _0x499ee1=_0x485ded[_0x948d('0x1c6')]*0x3c;var _0x477de0=_0x2c1b5c[0x0][_0x948d('0x4d')]+_0x2c1b5c[0x0][_0x948d('0x4b')];var _0x35f91d=(_0x2c1b5c[0x0][_0x948d('0x45')]+_0x2c1b5c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2c1b5c[0x0][_0x948d('0x49')])/_0x2c1b5c[0x0][_0x948d('0x43')];var _0x27ce7c=_0x485ded[_0x948d('0x1b3')]/0x64;_0x485ded[_0x948d('0x1d7')]=_0x1db2f8[0x0][_0x948d('0x1d6')]||0x0;_0x485ded['predictiveIntervalHitRate']=_0x35f91d>0x0?_0x35f91d:0x1;return _0x3e9bd1[_0x948d('0x1d2')](_0x1789bc,_0x499ee1,_0x477de0,_0x35f91d,_0x27ce7c);})[_0x948d('0x9c')](function(_0x297fc8){return _0x2cca91(_0x297fc8);})[_0x948d('0x9a')](function(_0x35309b){return _0xebf6c3(msgResponse(_0x948d('0x1d8'),_0x948d('0x8b'),JSON['stringify'](_0x35309b)));});}}else{return _0xebf6c3(msgResponse(_0x948d('0x1d3'),_0x948d('0x8b'),_0x948d('0x1d5')));}});};};Dialer[_0x948d('0x17')]['startMethodPredictive']=function(_0x681701){var _0x252c3c=this;return function(){var _0x3b50a5=0x0;var _0x503ea2=Math[_0x948d('0x1b8')](_0x681701[_0x948d('0x1da')]*0x3e8);if(_0x503ea2>0x0){_0x503ea2=_0x503ea2<0x64?0x64:_0x503ea2;loggerPredictive[_0x948d('0x41')](_0x681701[_0x948d('0x3d')],'one\x20call\x20every:',_0x503ea2,_0x948d('0x1db'));_0x681701['handlePredictive']=setInterval(function(){_0x252c3c[_0x948d('0x5f')](_0x681701);loggerPredictiveCalls['info'](_0x948d('0x1dc'),_0x3b50a5+=0x1);},_0x503ea2);}else{loggerPredictive[_0x948d('0x41')](_0x681701['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x948d('0x1dd')]=function(_0x325cab,_0xef3680){var _0x9e9225=this;return function(_0xe4aaa){if(_[_0x948d('0x3f')](_0xe4aaa)){if(_[_0x948d('0xec')](_0xef3680[_0x948d('0x151')])||!_0xef3680['recallme']){if(_0x325cab['dialMethod']===_0x948d('0x9')){_0x325cab['queueStatusComplete']=_[_0x948d('0x38')](_0x325cab[_0x948d('0x6e')])?!![]:_0x325cab[_0x948d('0x6e')];var _0x3968b9=uuid['v4']();_0x9e9225[_0x948d('0x21')][_0x3968b9]=new Action(_0x325cab,_0xef3680,_0x3968b9);loggerBooked[_0x948d('0x41')](_0x948d('0x1de'),_0x3968b9,_0x948d('0x1df'),JSON[_0x948d('0x70')](_0x325cab[_0x948d('0x6e')]),_0x948d('0x1e0'),_0x325cab[_0x948d('0x3d')]);if(_0x325cab[_0x948d('0x6e')]){_0x325cab['queueStatusComplete']=![];_0x9e9225['queueBooked'][_0x9e9225[_0x948d('0x21')][_0x3968b9]['queue']]=[];ami['Action']({'actionid':_0x3968b9,'action':_0x948d('0x1e1'),'queue':_0x325cab['name']})[_0x948d('0x9a')](function(){_0x9e9225['updateOriginated'](_0x325cab);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x9e9225['actions'][_0x3968b9][_0x948d('0xd8')],'ListId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xd9')],'VoiceQueueId':_0x9e9225['actions'][_0x3968b9][_0x948d('0xda')]||undefined,'CampaignId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xdb')]||undefined})['catch'](loggerCatch(_0x948d('0x1e2')));delete _0x9e9225[_0x948d('0x21')][_0x3968b9];});}else{loggerBooked['info'](_0x948d('0x1e3'),JSON['stringify'](_0x325cab['queueStatusComplete']),_0x948d('0x1e0'),_0x325cab[_0x948d('0x3d')]);_0x9e9225[_0x948d('0xbc')](_0x325cab);hopperUtils[_0x948d('0xd6')]({'active':![],'ContactId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xd8')],'ListId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xd9')],'VoiceQueueId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xda')]||undefined,'CampaignId':_0x9e9225[_0x948d('0x21')][_0x3968b9][_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x9e9225['actions'][_0x3968b9];}}else{return _0x9e9225['actionOriginate'](_0x325cab,_0xef3680);}}else{if(utils[_0x948d('0x5b')](undefined,_0xef3680[_0x948d('0x1e4')])<_0x325cab['dialRecallMeTimeout']*0x3c){if(_0xef3680[_0x948d('0x141')]&&!_0xef3680[_0x948d('0x141')]['voicePause']){_0x9e9225[_0x948d('0xfc')][_0x948d('0xf2')](_0xef3680['id'])[_0x948d('0xf4')](function(){_0x9e9225[_0x948d('0xbc')](_0x325cab);});}else{hopperUtils[_0x948d('0x1e5')]({'active':![]},_0xef3680['id'],0x1)['finally'](function(){_0x9e9225[_0x948d('0xbc')](_0x325cab);});}}else{_0x325cab[_0x948d('0x1e6')]+=0x1;_0x9e9225['updateOriginated'](_0x325cab);if(_0x325cab[_0x948d('0x1e7')]){hopperUtils[_0x948d('0xd6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xef3680['ContactId'],'ListId':_0xef3680[_0x948d('0xd9')],'VoiceQueueId':_0xef3680['VoiceQueueId']||undefined,'CampaignId':_0xef3680[_0x948d('0xdb')]||undefined})[_0x948d('0x9a')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x948d('0xc4')](createObjHistory(_0x325cab,_0xef3680,utils[_0x948d('0x63')]['QUEUE_RECALL'],0x17,_0x948d('0x1e8')))['catch'](loggerCatch(_0x948d('0x1e9')));}else{_0x9e9225['saveInDb'](createObjHistory(_0x325cab,_0xef3680,utils[_0x948d('0x63')][_0x948d('0x1ea')],0x16,_0x948d('0x1eb')),_0x948d('0x1ec'),_0x948d('0x1ed'));}}}}else{_0x325cab['outboundBlacklistCallsDay']+=0x1;_0x9e9225[_0x948d('0x125')](createObjHistory(_0x325cab,_0xef3680,utils['CAMPAIGN_STATUS'][_0x948d('0x1ee')],0xd,_0x948d('0x1ef')),_0x948d('0x1f0'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0x948d('0x156')]=function(_0x5d4752){var _0x41cdef=this;var _0x4fb5c2=_0x5d4752[_0x948d('0x1f1')]-_0x5d4752[_0x948d('0x7c')]-_0x5d4752['temp'];emitCampaignSummary(_0x5d4752);if(_0x4fb5c2>0x0){if(_0x4fb5c2>this['maxNumberOriginate']){_0x4fb5c2=this[_0x948d('0x1f')];}_0x5d4752[_0x948d('0x1f2')]+=_0x4fb5c2;hopperUtils[_0x948d('0x1f3')](_0x5d4752,_0x4fb5c2)[_0x948d('0x9c')](function(_0x2843ad){_0x5d4752[_0x948d('0x1f2')]-=_0x4fb5c2;_0x5d4752[_0x948d('0x1f2')]=_0x5d4752[_0x948d('0x1f2')]>0x0?_0x5d4752[_0x948d('0x1f2')]:0x0;if(!utils[_0x948d('0x1f4')](_0x2843ad)){_0x5d4752[_0x948d('0x67')]=utils[_0x948d('0x63')][_0x948d('0x68')];logger['info'](_0x948d('0x1f5')+_0x5d4752['name']);}else{_0x5d4752['originated']+=_0x2843ad[_0x948d('0x91')];_0x5d4752[_0x948d('0x67')]=utils[_0x948d('0x63')]['RUNNING'];for(var _0x5e5293=0x0;_0x5e5293<_0x2843ad[_0x948d('0x91')];_0x5e5293+=0x1){_0x5d4752[_0x948d('0x1f6')]+=0x1;if(_['isNil'](_0x2843ad[_0x5e5293])||_[_0x948d('0xec')](_0x2843ad[_0x5e5293][_0x948d('0x1f7')])||_[_0x948d('0xec')](_0x2843ad[_0x5e5293][_0x948d('0x15a')])){_0x41cdef[_0x948d('0x1f8')](_0x948d('0x1f9'),_0x5d4752,_0x2843ad[_0x5e5293]);}else{hopperUtils[_0x948d('0x1fa')](_[_0x948d('0xf1')](_0x2843ad[_0x5e5293],[_0x948d('0xdb'),_0x948d('0x15a')]))[_0x948d('0x9c')](_0x41cdef[_0x948d('0x1dd')](_0x5d4752,_0x2843ad[_0x5e5293]))[_0x948d('0x9a')](_0x41cdef[_0x948d('0x14f')](_0x948d('0x1fb'),_0x5d4752));}}}})[_0x948d('0x9a')](loggerGetContactDialer(_0x948d('0x1fc'),_0x5d4752,_0x4fb5c2));}};Dialer['prototype'][_0x948d('0xae')]=function(_0x31a1e8,_0x3ef119){var _0x4f0314=this;var _0x451f80=[];if(_0x3ef119<0x1||_0x31a1e8[_0x948d('0xac')]===_0x948d('0x9')){_0x3ef119=0x1;}var _0x1c62dc=Math['floor'](_0x31a1e8[_0x948d('0x134')]*_0x3ef119)-_0x31a1e8[_0x948d('0x7c')]-_0x31a1e8[_0x948d('0x1f2')];if(_0x31a1e8[_0x948d('0x1fd')]>0x0){var _0x88dccd=_0x31a1e8[_0x948d('0x1fd')]-_0x31a1e8[_0x948d('0x7c')]-_0x31a1e8[_0x948d('0x1cf')]-_0x31a1e8[_0x948d('0x1f2')]-_0x31a1e8[_0x948d('0x136')];if(_0x1c62dc>_0x88dccd){_0x1c62dc=_0x88dccd;}}if(_0x1c62dc>0x0){if(_0x31a1e8[_0x948d('0xac')]==='booked'){_0x1c62dc=0x1;}if(_0x1c62dc>this[_0x948d('0x1f')]){_0x1c62dc=this[_0x948d('0x1f')];}_0x31a1e8[_0x948d('0x1f2')]+=_0x1c62dc;for(var _0x3e9074 in this[_0x948d('0x1d')]){if(typeof this[_0x948d('0x1d')][_0x3e9074]!=='undefined'){if(this[_0x948d('0x1d')][_0x3e9074][_0x948d('0x6a')]===_0x948d('0x1fe')&&this[_0x948d('0x1d')][_0x3e9074][_0x948d('0x84')]===_0x948d('0x1ff')){_0x451f80['push'](this[_0x948d('0x1d')][_0x3e9074]['id']);}}}hopperUtils['getContactDialer'](_0x31a1e8,_0x451f80,_0x1c62dc)[_0x948d('0x9c')](function(_0x4a5375){_0x31a1e8[_0x948d('0x1f2')]-=_0x1c62dc;_0x31a1e8['temp']=_0x31a1e8[_0x948d('0x1f2')]>0x0?_0x31a1e8[_0x948d('0x1f2')]:0x0;if(!utils['checkContactEmpty'](_0x4a5375)){hopperUtils[_0x948d('0x200')](_0x31a1e8)[_0x948d('0x9c')](sendMessageReschedule(_0x31a1e8))[_0x948d('0x9a')](loggerCatch(_0x948d('0x201')));}else{_0x31a1e8[_0x948d('0x7c')]+=_0x4a5375[_0x948d('0x91')];_0x31a1e8[_0x948d('0x67')]=_0x31a1e8[_0x948d('0xac')]===_0x948d('0x9')?utils[_0x948d('0x63')]['ACTIVE']:utils[_0x948d('0x63')][_0x948d('0x202')];for(var _0x48efb=0x0;_0x48efb<_0x4a5375['length'];_0x48efb+=0x1){if(_['isNil'](_0x4a5375[_0x48efb])||_[_0x948d('0xec')](_0x4a5375[_0x48efb][_0x948d('0x1f7')])||_[_0x948d('0xec')](_0x4a5375[_0x48efb]['phone'])){_0x4f0314[_0x948d('0x1f8')]('[actionOriginate]\x20',_0x31a1e8,_0x4a5375[_0x48efb]);}else{hopperUtils[_0x948d('0x203')](_[_0x948d('0xf1')](_0x4a5375[_0x48efb],[_0x948d('0xda'),_0x948d('0x15a')]))['then'](_0x4f0314[_0x948d('0x1dd')](_0x31a1e8,_0x4a5375[_0x48efb]))['catch'](_0x4f0314['loggerHandler'](_0x948d('0x1f9'),_0x31a1e8));}}}})[_0x948d('0x9a')](loggerGetContactDialer('[getContactDialer2]',_0x31a1e8,_0x1c62dc));}};Dialer[_0x948d('0x17')][_0x948d('0x5f')]=function(_0x2f58a9){if(_0x2f58a9[_0x948d('0x1fd')]>0x0){var _0x2350a8=_0x2f58a9['dialLimitQueue']-_0x2f58a9[_0x948d('0x7c')]-_0x2f58a9[_0x948d('0x1cf')];if(_0x2350a8>0x0){this[_0x948d('0x204')](_0x2f58a9);}else{loggerPredictiveCalls[_0x948d('0x41')](_0x948d('0x205'));}}else{this[_0x948d('0x204')](_0x2f58a9);}};Dialer[_0x948d('0x17')]['tryOriginatePredictive']=function(_0x5387d2){var _0x11191e=this;var _0x589ab1=[];_0x5387d2[_0x948d('0x7c')]+=0x1;for(var _0x2cbcd3 in this['agents']){if(typeof this[_0x948d('0x1d')][_0x2cbcd3]!==_0x948d('0xa5')){if(this[_0x948d('0x1d')][_0x2cbcd3]['state']==='not_inuse'&&this['agents'][_0x2cbcd3]['status']===_0x948d('0x1ff')){_0x589ab1[_0x948d('0x92')](this['agents'][_0x2cbcd3]['id']);}}}return this[_0x948d('0x206')](_0x5387d2['id'],_0x589ab1,0x1,_0x5387d2[_0x948d('0x207')],_0x5387d2)[_0x948d('0x9c')](function(_0x557068){if(!utils[_0x948d('0x1f4')](_0x557068)){utils[_0x948d('0x62')](_0x5387d2,0x1,0x0);return hopperUtils[_0x948d('0x200')](_0x5387d2)[_0x948d('0x9c')](sendMessageReschedule(_0x5387d2))[_0x948d('0x9a')](loggerCatch(_0x948d('0x201')));}else{_0x5387d2[_0x948d('0x67')]=utils['CAMPAIGN_STATUS'][_0x948d('0x202')];if(_[_0x948d('0xec')](_0x557068[0x0])||_[_0x948d('0xec')](_0x557068[0x0][_0x948d('0x1f7')])||_[_0x948d('0xec')](_0x557068[0x0]['phone'])){_0x11191e[_0x948d('0x1f8')](_0x948d('0x1f9'),_0x5387d2,_0x557068[0x0]);}else{return hopperUtils[_0x948d('0x203')](_['pick'](_0x557068[0x0],[_0x948d('0xda'),_0x948d('0x15a')]))[_0x948d('0x9c')](_0x11191e[_0x948d('0x1dd')](_0x5387d2,_0x557068[0x0]))[_0x948d('0x9a')](_0x11191e['loggerHandler']('[actionOriginatePredictive]\x20',_0x5387d2));}}})[_0x948d('0x9a')](loggerGetContactDialer(_0x948d('0x208'),_0x5387d2,0x1));};Dialer[_0x948d('0x17')][_0x948d('0x1d0')]=function(_0x162393,_0x5d148f,_0x3e15a4,_0x351224,_0x4e9356,_0x3682e3){loggerPredictive[_0x948d('0x41')](_0x948d('0x209'));loggerPredictive[_0x948d('0x41')](_0x948d('0x20a'),_0x162393);loggerPredictive[_0x948d('0x41')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d148f);loggerPredictive[_0x948d('0x41')]('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',_0x3e15a4);loggerPredictive[_0x948d('0x41')]('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',_0x351224);loggerPredictive['info'](_0x948d('0x20b'),_0x4e9356);loggerPredictive[_0x948d('0x41')](_0x948d('0x4e'));return new Promise(function(_0x2cdc13,_0x693035){if(_0x162393<=0x0||isNaN(_0x162393)){return _0x693035(msgResponse(_0x948d('0x20c'),_0x948d('0xb7'),_0x948d('0x20d')+_0x162393));}if(_0x3e15a4<=0x0||isNaN(_0x3e15a4)){return _0x693035(msgResponse(_0x948d('0x20c'),'Error',_0x948d('0x20e')+_0x3e15a4));}if(_0x351224<=0x0||isNaN(_0x351224)){return _0x693035(msgResponse('[abandonmentRate]',_0x948d('0xb7'),_0x948d('0x20f')+_0x351224));}if(_0x5d148f<=0x0||isNaN(_0x5d148f)){return _0x693035(msgResponse(_0x948d('0x20c'),_0x948d('0xb7'),_0x948d('0x210')+_0x5d148f));}if(_0x4e9356<=0x0||isNaN(_0x4e9356)){return _0x693035(msgResponse(_0x948d('0x20c'),_0x948d('0xb7'),_0x948d('0x211')+_0x4e9356));}_0x3682e3=_0x3682e3||0x0;var _0x1ead7c=0x1/_0x3e15a4;var _0x265bbb=0x0;var _0xae428c=0x0;var _0x320304=0x0;var _0x5622cb=0x0;for(var _0x4399f2=0x0;_0x320304<_0x4e9356;_0x4399f2+=0x1){_0xae428c=_0x4399f2/_0x5d148f;_0x265bbb=(_0x351224*_0xae428c+_0x3682e3)/_0x1ead7c;_0x320304=utils[_0x948d('0x212')](_0x265bbb,_0x162393);_0x5622cb=_0x265bbb/_0x162393*(0x1-utils['erlangb'](_0x265bbb,_0x162393));}return _0x2cdc13({'erlangCalls':_0x4399f2,'erlangCallToSecond':_0x5d148f/_0x4399f2,'erlangAbandonmentRate':_0x320304,'erlangBusyFactor':_0x5622cb});});};Dialer['prototype'][_0x948d('0x1d2')]=function(_0x583f65,_0x2cdb08,_0x58db22,_0x212634,_0x4e8c8a,_0x28a9f8){loggerPredictive[_0x948d('0x41')](_0x948d('0x213'));loggerPredictive[_0x948d('0x41')]('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',_0x583f65);loggerPredictive[_0x948d('0x41')](_0x948d('0x214'),_0x2cdb08);loggerPredictive[_0x948d('0x41')](_0x948d('0x215'),_0x58db22);loggerPredictive[_0x948d('0x41')](_0x948d('0x216'),_0x212634);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e8c8a);loggerPredictive[_0x948d('0x41')](_0x948d('0x4e'));return new Promise(function(_0x157902,_0x3ba3d0){if(_0x583f65<=0x0||isNaN(_0x583f65)){return _0x3ba3d0(msgResponse(_0x948d('0x217'),_0x948d('0xb7'),_0x948d('0x20d')+_0x583f65));}if(_0x58db22<=0x0||isNaN(_0x58db22)){return _0x3ba3d0(msgResponse('[busyFactor]',_0x948d('0xb7'),_0x948d('0x20e')+_0x58db22));}if(_0x212634<=0x0||isNaN(_0x212634)){return _0x3ba3d0(msgResponse(_0x948d('0x217'),_0x948d('0xb7'),_0x948d('0x20f')+_0x212634));}if(_0x2cdb08<=0x0||isNaN(_0x2cdb08)){return _0x3ba3d0(msgResponse('[busyFactor]',_0x948d('0xb7'),_0x948d('0x210')+_0x2cdb08));}if(_0x4e8c8a<=0x0||isNaN(_0x4e8c8a)){return _0x3ba3d0(msgResponse(_0x948d('0x217'),_0x948d('0xb7'),_0x948d('0x218')+_0x4e8c8a));}_0x28a9f8=_0x28a9f8||0x0;var _0xeb749d=0x1/_0x58db22;var _0xf5a456=0x0;var _0x4a316a=0x0;var _0xbd6aa5=0x0;var _0x479b7d=0x0;for(var _0x1566c2=0x0;_0x479b7d<_0x4e8c8a;_0x1566c2+=0x1){_0x4a316a=_0x1566c2/_0x2cdb08;_0xf5a456=(_0x212634*_0x4a316a+_0x28a9f8)/_0xeb749d;_0xbd6aa5=utils[_0x948d('0x212')](_0xf5a456,_0x583f65);_0x479b7d=_0xf5a456/_0x583f65*(0x1-utils['erlangb'](_0xf5a456,_0x583f65));}return _0x157902({'erlangCalls':_0x1566c2,'erlangCallToSecond':_0x2cdb08/_0x1566c2,'erlangAbandonmentRate':_0xbd6aa5,'erlangBusyFactor':_0x479b7d});});};module[_0x948d('0x219')]=Dialer; \ No newline at end of file +var _0xadaa=['voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','VoiceQueueId','[rescheduleContact][Abandoned]','endtime','syncNewExten','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','agents','stateinterface','queueBooked','idHopper','strategy','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','value','HangupInAMD','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','Unknow','queuesSummary','running','isPreviewCampaign','resolve','statusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','launchHandleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','custom:agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','swapAdditionalPhones','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[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','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','dialPredictiveOptimizationPercentage','predictiveIntervalPauses','[CatchErlangB]','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','countReScheduled','RUNNING','[actionOriginate]\x20','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','defaults','socket.io-emitter','redis','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','tail','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','stringify','prototype','isTrunkReachable','active','SIP/%s','status','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','push','then','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','dialTimezone','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueId','uniqueid','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','countdropretry','countglobal','verifyAdditionalPhones'];(function(_0x5b221c,_0x343dde){var _0x189120=function(_0x115556){while(--_0x115556){_0x5b221c['push'](_0x5b221c['shift']());}};_0x189120(++_0x343dde);}(_0xadaa,0x14a));var _0xaada=function(_0x5bb0b3,_0x25f641){_0x5bb0b3=_0x5bb0b3-0x0;var _0x2df54b=_0xadaa[_0x5bb0b3];return _0x2df54b;};'use strict';var util=require(_0xaada('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0xaada('0x1'));var rr=require('rr');var Redis=require(_0xaada('0x2'));var utils=require(_0xaada('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0xaada('0x4'));var config=require(_0xaada('0x5'));var logger=require(_0xaada('0x6'))('dialer');var loggerBooked=require(_0xaada('0x6'))(_0xaada('0x7'));var loggerPredictive=require('../../../config/logger')(_0xaada('0x8'));var loggerPredictiveCalls=require(_0xaada('0x6'))(_0xaada('0x9'));var loggerSyncQueueSummary=require(_0xaada('0x6'))('syncQueueSummary');var ami=require(_0xaada('0xa'));config['redis']=_[_0xaada('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xaada('0xc'))(new Redis(config[_0xaada('0xd')]));var cmHopper=require(_0xaada('0xe'));var voiceQueueRt=require(_0xaada('0xf'));var RpcSetting=require(_0xaada('0x10'));var Interval=require(_0xaada('0x11'));var Action=require(_0xaada('0x12'));var History=require(_0xaada('0x13'));var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xaada('0x14'));var Hangup=require(_0xaada('0x15'));var ipAgi=process[_0xaada('0x16')][_0xaada('0x17')]||_0xaada('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4a912d){this[_0xaada('0x19')]=this[_0xaada('0x19')]?this['tail']['finally'](_0x4a912d):_0x4a912d();};function Dialer(_0x44e12d,_0x5998e2){this[_0xaada('0x1a')]=new Sequence();this[_0xaada('0x1b')]=_0x5998e2;this[_0xaada('0x1c')]=_0x44e12d['voiceQueues'];this[_0xaada('0x1d')]=_0x44e12d[_0xaada('0x1d')];this['agents']=_0x44e12d['agents'];this[_0xaada('0x1e')]=_0x44e12d[_0xaada('0x1e')];this[_0xaada('0x1f')]=config[_0xaada('0x1f')]||0x2;this[_0xaada('0x20')]={};this[_0xaada('0x21')]={};this[_0xaada('0x22')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0xaada('0x23')]={};this[_0xaada('0x24')]={};this['queueBooked']={};this[_0xaada('0x25')]={};this['queuesSummary']={};ami['on'](_0xaada('0x26'),this[_0xaada('0x27')][_0xaada('0x28')](this));ami['on'](_0xaada('0x29'),this[_0xaada('0x2a')]['bind'](this));ami['on'](_0xaada('0x2b'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xaada('0x2c'),this['syncAgentComplete']['bind'](this));ami['on'](_0xaada('0x2d'),this[_0xaada('0x2e')][_0xaada('0x28')](this));ami['on'](_0xaada('0x2f'),this[_0xaada('0x30')][_0xaada('0x28')](this));ami['on']('hangup',this[_0xaada('0x31')][_0xaada('0x28')](this));ami['on'](_0xaada('0x32'),this['syncNewExten']['bind'](this));ami['on'](_0xaada('0x33'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0xaada('0x34')][_0xaada('0x28')](this));ami['on'](_0xaada('0x35'),this[_0xaada('0x36')]['bind'](this));this[_0xaada('0x37')]();this['loopClearZombieChannels']();RpcSetting[_0xaada('0x38')]()['then'](function(_0x1a3182){previewRecallmeReminderInterval=_0x1a3182['previewRecallmeReminderInterval'];});}function isNotNull(_0x20d96a){return _0x20d96a!==null&&!_[_0xaada('0x39')](_0x20d96a);}function msgResponse(_0x541e91,_0x4370b7,_0x15bc31){return{'action':_0x541e91,'response':_0x4370b7,'message':_0x15bc31,'stack':_0x15bc31};}function emit(_0x392f5d,_0x1c262f,_0x53238b){io['to'](_0x392f5d)[_0xaada('0x3a')](_0x1c262f,_0x53238b);}function emitOutboundVoiceQueueSummary(_0x4b91d5){if(_0x4b91d5[_0xaada('0x3b')]==='outbound'){logger[_0xaada('0x3c')](_0xaada('0x3d'),util['inspect'](_0x4b91d5,{'showHidden':![],'depth':null}));emit(util[_0xaada('0x3e')](_0xaada('0x3f'),_0x4b91d5[_0xaada('0x40')]),_0xaada('0x41'),_0x4b91d5);}}function checkGetDataPredictive(_0x978491){if(isNotNull(_0x978491)&&!_[_0xaada('0x42')](_0x978491)){loggerPredictive[_0xaada('0x43')](_0xaada('0x44'));loggerPredictive[_0xaada('0x43')](_0xaada('0x45'),_0x978491[_0xaada('0x46')]);loggerPredictive['info'](_0xaada('0x47'),_0x978491[_0xaada('0x48')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x49'),_0x978491['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xaada('0x4a'),_0x978491[_0xaada('0x4b')]);loggerPredictive[_0xaada('0x43')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x978491[_0xaada('0x4c')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x4d'),_0x978491[_0xaada('0x4e')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x4f'));if(_0x978491[_0xaada('0x46')]>0x0){if(!_['isUndefined'](_0x978491[_0xaada('0x4e')])&&_0x978491[_0xaada('0x4e')]>0x0){return!![];}loggerPredictive['info'](_0xaada('0x50'));if(!_[_0xaada('0x39')](_0x978491[_0xaada('0x4c')])&&_0x978491[_0xaada('0x4c')]>0x0){return!![];}loggerPredictive[_0xaada('0x43')](_0xaada('0x51'));}else{loggerPredictive[_0xaada('0x43')](_0xaada('0x52'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xf9b066){return function(_0x54a2ed){loggerPredictive[_0xaada('0x43')](_0xaada('0x53'));loggerPredictive[_0xaada('0x43')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54a2ed[_0xaada('0x54')]);loggerPredictive[_0xaada('0x43')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54a2ed[_0xaada('0x55')]);loggerPredictive[_0xaada('0x43')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54a2ed[_0xaada('0x56')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x57'),_0x54a2ed[_0xaada('0x58')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x59'),_0x54a2ed[_0xaada('0x56')]);loggerPredictive[_0xaada('0x43')](_0xaada('0x4f'));_[_0xaada('0x5a')](_0xf9b066,_0x54a2ed);};}function ifInterval(_0x23ed86,_0xae8c67){if(_['isUndefined'](_0xae8c67)){return![];}return utils[_0xaada('0x5b')](undefined,_0xae8c67)<_0x23ed86*0x3c;}function clearPredictiveAttributes(_0x4e30dd){if(_0x4e30dd['startProgressive']){_0x4e30dd[_0xaada('0x23')]=undefined;loggerPredictive[_0xaada('0x3c')](_0x4e30dd['name'],_0xaada('0x5c'));}if(_0x4e30dd['startPredictive']){_0x4e30dd[_0xaada('0x5d')]=undefined;loggerPredictive[_0xaada('0x3c')](_0x4e30dd[_0xaada('0x40')],_0xaada('0x5e'));}if(_0x4e30dd[_0xaada('0x5f')]){clearInterval(_0x4e30dd[_0xaada('0x5f')]);_0x4e30dd[_0xaada('0x5f')]=undefined;loggerPredictive[_0xaada('0x3c')](_0x4e30dd['name'],_0xaada('0x60'));}}function loggerCatchPredictive(_0x10ca8b,_0x5b0e1c){return function(_0x541ee2){loggerPredictive[_0xaada('0x61')](_0x5b0e1c[_0xaada('0x40')],_0x10ca8b);loggerPredictive[_0xaada('0x61')](_0x541ee2[_0xaada('0x62')]);clearPredictiveAttributes(_0x5b0e1c);};}function loggerCatch(_0x2d69d8){return function(_0x4ff3e2){logger[_0xaada('0x61')](_0x2d69d8,util[_0xaada('0x63')](_0x4ff3e2,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4bb155,_0x4d63e2,_0x49c8cc){return function(_0x52b7fd){utils[_0xaada('0x64')](_0x4d63e2,_0x49c8cc,0x0);logger[_0xaada('0x61')](_0x4bb155,util['inspect'](_0x52b7fd,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3e2f39){return function(_0x131176){if(isNotNull(_0x131176)&&isNotNull(_0x131176[0x0])){if(_0x131176[0x0][_0xaada('0x65')]>0x0){_0x3e2f39[_0xaada('0x66')]=utils['CAMPAIGN_STATUS'][_0xaada('0x67')];logger[_0xaada('0x43')](_0xaada('0x68')+_0x3e2f39[_0xaada('0x40')],_0x131176[0x0][_0xaada('0x65')],_0xaada('0x69'));}else{_0x3e2f39[_0xaada('0x66')]=utils[_0xaada('0x6a')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0xaada('0x6b')+_0x3e2f39['name']);}}};}function createObjHistory(_0x46e116,_0x3d1ce6,_0x56bee6,_0x346c53,_0x22c72c){_0x46e116[_0xaada('0x66')]=_0x56bee6;var _0x3aa511=new Action(_0x46e116,_0x3d1ce6);var _0x1efd9a=new History(_0x3aa511);_0x1efd9a[_0xaada('0x6c')]=_0x346c53;_0x1efd9a[_0xaada('0x6d')]=_0x22c72c;_0x1efd9a['endtime']=_0x3aa511[_0xaada('0x6e')];return _0x1efd9a;}function unlockQueueStatus(_0x31777f,_0x529f79){setTimeout(function(){if(_[_0xaada('0x39')](_0x31777f[_0xaada('0x6f')])){loggerBooked[_0xaada('0x61')]('[unlockQueueStatus][undefined]',_0x529f79);}_0x31777f[_0xaada('0x6f')]=!![];loggerBooked[_0xaada('0x43')]('[booked][unlockQueueStatus]',_0x529f79,JSON['stringify'](_[_0xaada('0x70')](_0x31777f,[_0xaada('0x40'),_0xaada('0x6f')])));},0x1f3);}function checkInterval(_0x10d32e){return function(){if(!isNotNull(_0x10d32e[_0xaada('0x71')])){_0x10d32e[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x72')];throw _0x10d32e[_0xaada('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x10d32e[_0xaada('0x71')][_0xaada('0x73')])){_0x10d32e[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x72')];throw _0x10d32e[_0xaada('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xaada('0x42')](_0x10d32e[_0xaada('0x71')][_0xaada('0x73')]))){_0x10d32e[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x72')];throw _0x10d32e[_0xaada('0x40')]+_0xaada('0x74');}};}function checkIsIVRCampaignActive(_0x4c9bda){return function(){if(!utils[_0xaada('0x75')](_0x4c9bda)){_0x4c9bda[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x76')];throw _0x4c9bda[_0xaada('0x40')]+_0xaada('0x77');}};}function emitCampaignSummary(_0x16a478){if(utils[_0xaada('0x78')](_0x16a478)){emit(util[_0xaada('0x3e')]('campaign:ivr:%s',_0x16a478[_0xaada('0x40')]),_0xaada('0x79'),_0x16a478);}}function loggerCatchQueueSummary(_0x1cbcb9,_0xdd8ec6){return function(_0x2f27e9){clearPredictiveAttributes(_0xdd8ec6);emitCampaignSummary(_0xdd8ec6);loggerSyncQueueSummary[_0xaada('0x3c')](_0x1cbcb9,util[_0xaada('0x63')](_0x2f27e9,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3a53d0){if(_0x3a53d0[_0xaada('0x7a')]){if(_0x3a53d0['originated']===0x0){_0x3a53d0[_0xaada('0x7a')]=![];_0x3a53d0[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x76')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3a53d0['name'],_0xaada('0x7b'));}else{_0x3a53d0[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x7c')];loggerSyncQueueSummary['debug'](_0xaada('0x7d'),_0x3a53d0['name'],_0xaada('0x7e'));}emitCampaignSummary(_0x3a53d0);}}function myreject(_0x83dadc){return function(_0x1d0022){return _0x83dadc(msgResponse('[ifTime][Action]',_0xaada('0x7f'),JSON[_0xaada('0x80')](_0x1d0022)));};}Dialer[_0xaada('0x81')][_0xaada('0x82')]=function(_0x553da2){return!_[_0xaada('0x39')](_0x553da2)&&_0x553da2&&!_['isUndefined'](_0x553da2['name'])&&!_[_0xaada('0x39')](_0x553da2[_0xaada('0x83')])&&_0x553da2['active']&&(this[_0xaada('0x1e')][util[_0xaada('0x3e')](_0xaada('0x84'),_0x553da2['name'])][_0xaada('0x85')]==='reachable'||this[_0xaada('0x1e')][util[_0xaada('0x3e')](_0xaada('0x84'),_0x553da2[_0xaada('0x40')])]['status']===_0xaada('0x86'));};Dialer['prototype']['checkIsTrunkReachable']=function(_0x594066){var _0x4e8131=this;return function(){if(!_0x4e8131[_0xaada('0x82')](_0x594066[_0xaada('0x87')])){if(!_0x4e8131[_0xaada('0x82')](_0x594066[_0xaada('0x88')])){_0x594066[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x89')];throw _0x594066[_0xaada('0x40')]+_0xaada('0x8a');}}};};Dialer[_0xaada('0x81')][_0xaada('0x8b')]=function(_0x55ff94,_0x278937,_0x59c40f,_0x6b77c9){var _0x7bfd8e=this;return function(){var _0x1786de=!![];return _0x7bfd8e[_0xaada('0x8c')](_0x55ff94,_0x278937,_0x59c40f,_0x6b77c9,_0x1786de);};};Dialer[_0xaada('0x81')][_0xaada('0x8d')]=function(_0x4f2d37,_0x452f90,_0x19b078,_0x52d696){var _0x166036=this;return function(){var _0x5991b9=![];return _0x166036[_0xaada('0x8c')](_0x4f2d37['Intervals'],_0x452f90,_0x19b078,_0x52d696,_0x5991b9);};};Dialer[_0xaada('0x81')]['ifTimeIvr']=function(_0x28642d,_0x23ce32,_0x4bee7c,_0xaa9984,_0x174b7a){var _0x1d7130=[];return new Promise(function(_0x4535e9,_0x52c13f){if(!isNotNull(_0x28642d)){_0xaa9984[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x72')];return _0x52c13f(msgResponse('ifTime',_0xaada('0x8e'),_0x4bee7c+_0xaada('0x8f')));}if(_[_0xaada('0x42')](_0x28642d)){_0xaa9984[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x90')];return _0x52c13f(msgResponse(_0xaada('0x91'),'Failure',_0x4bee7c+_0xaada('0x92')));}if(_0x23ce32&&_[_0xaada('0x39')](config[_0xaada('0x93')][_0x23ce32])){_0xaa9984[_0xaada('0x66')]=utils['CAMPAIGN_STATUS'][_0xaada('0x94')];return _0x52c13f(msgResponse(_0xaada('0x91'),_0xaada('0x8e'),_0x4bee7c+_0xaada('0x95')+_0x23ce32));}if(_[_0xaada('0x96')](_0x28642d)){for(var _0x36f1fa=0x0;_0x36f1fa<_0x28642d[_0xaada('0x97')];_0x36f1fa+=0x1){_0x1d7130['push'](ami[_0xaada('0x98')]({'action':_0xaada('0x99'),'command':util['format'](_0xaada('0x9a'),_0x28642d[_0x36f1fa][_0xaada('0x9b')],!_[_0xaada('0x39')](config['timezones'][_0x23ce32])?_0x23ce32:'')})['then'](function(_0x4ec6f6){return _0x4ec6f6[_0xaada('0x9c')][_0xaada('0x9d')](_0xaada('0x9e'))>=0x0;})[_0xaada('0x9f')](myreject(_0x52c13f)));}}else{_0x1d7130[_0xaada('0xa0')](ami[_0xaada('0x98')]({'action':_0xaada('0x99'),'command':util[_0xaada('0x3e')]('iftime\x20%s,%s',_0x28642d,!_['isUndefined'](config[_0xaada('0x93')][_0x23ce32])?_0x23ce32:'')})[_0xaada('0xa1')](function(_0x198e9e){return _0x198e9e[_0xaada('0x9c')]['indexOf']('true')>=0x0;})[_0xaada('0x9f')](myreject(_0x52c13f)));}Promise['all'](_0x1d7130)[_0xaada('0xa1')](function(_0x5e3329){var _0x42de42=_['some'](_0x5e3329);if(_0x42de42){return _0x4535e9(_0x42de42);}else{_0xaa9984[_0xaada('0x66')]=_0x174b7a?utils[_0xaada('0x6a')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0xaada('0xa2')];return _0x52c13f(msgResponse('[ifTime][promiseAll]',_0xaada('0x8e'),_0xaada('0xa3')+_0x174b7a+'\x20'+_0x4bee7c+_0xaada('0xa4')+util[_0xaada('0x63')](_0x28642d,{'showHidden':![],'depth':null})+_0xaada('0xa5')+_0x23ce32));}})[_0xaada('0x9f')](function(_0x3da74f){return _0x52c13f(msgResponse(_0xaada('0x91'),'Failure',JSON['stringify'](_0x3da74f)));});});};Dialer[_0xaada('0x81')][_0xaada('0x37')]=function(){var _0x40ca64=this;return cmHopper[_0xaada('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0xaada('0xa1')](function(){setInterval(function(){_0x40ca64[_0xaada('0xa7')]();},0x3e8);});};Dialer[_0xaada('0x81')]['syncCampaigns']=function(){var _0x17a05f=this;var _0x17fbe2;for(var _0x5944c1 in this[_0xaada('0x1d')]){if(typeof this[_0xaada('0x1d')][_0x5944c1]!=='undefined'){_0x17fbe2=this[_0xaada('0x1d')][_0x5944c1];if(utils[_0xaada('0x78')](_0x17fbe2)&&utils[_0xaada('0x75')](_0x17fbe2)){_0x17fbe2[_0xaada('0x7a')]=!![];Promise['resolve']()[_0xaada('0xa1')](checkIsIVRCampaignActive(_0x17fbe2))['then'](checkInterval(_0x17fbe2))[_0xaada('0xa1')](_0x17a05f[_0xaada('0xa8')](_0x17fbe2))['then'](_0x17a05f['checkIfTime'](_0x17fbe2['dialGlobalInterval'],_0x17fbe2[_0xaada('0xa9')],_0x17fbe2[_0xaada('0x40')],_0x17fbe2))[_0xaada('0xa1')](_0x17a05f['checkIfTimeIntervals'](_0x17fbe2['Interval'],_0x17fbe2[_0xaada('0xa9')],_0x17fbe2[_0xaada('0x40')],_0x17fbe2))[_0xaada('0xa1')](_0x17a05f['launchHandleIvr'](_0x17fbe2))[_0xaada('0x9f')](loggerCatchQueueSummary('[syncCampaigns]',_0x17fbe2));}else{notSendMessagesCampaign(_0x17fbe2);}}}};Dialer[_0xaada('0x81')][_0xaada('0xaa')]=function(_0x11ab25){if(_0x11ab25[_0xaada('0xab')]!=='predictive'){clearPredictiveAttributes(_0x11ab25);}switch(_0x11ab25['dialMethod']){case _0xaada('0xac'):this[_0xaada('0xad')](_0x11ab25,0x1);break;case _0xaada('0xae'):this[_0xaada('0xad')](_0x11ab25,_0x11ab25[_0xaada('0xaf')]);break;case _0xaada('0x8'):this['predictive'](_0x11ab25);break;case _0xaada('0x7'):this['handlePower'](_0x11ab25,0x1);break;default:logger[_0xaada('0x61')](_0xaada('0xb0'),_0x11ab25[_0xaada('0x40')],_0xaada('0xb1'));}};Dialer[_0xaada('0x81')][_0xaada('0x91')]=function(_0x19d941,_0xae47c9){var _0x464e6d=_0x19d941[_0xaada('0xa9')];var _0x349630=_0xae47c9?_0x19d941['dialGlobalInterval']:_0x19d941[_0xaada('0x71')][_0xaada('0x73')];logger[_0xaada('0xb2')](_0xaada('0xb3'),_0x349630,_0x464e6d,_0x19d941[_0xaada('0x40')],util[_0xaada('0x3e')](_0xaada('0xb4'),_0x19d941[_0xaada('0x40')],_0x19d941['id']));var _0x246316=null;return Interval['intervalIftime'](_0x349630,_0x464e6d)[_0xaada('0xa1')](function(_0x4545ba){if(_0x4545ba===!![]){return _0x4545ba;}else{_0x19d941[_0xaada('0x66')]=_0xae47c9?utils[_0xaada('0x6a')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xaada('0x6a')]['OVERTIME_INTERVAL'];_0x246316=msgResponse(_0xaada('0xb5'),_0xaada('0x8e'),_0xaada('0xa3')+_0xae47c9+'\x20'+_0x19d941[_0xaada('0x40')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xaada('0x63')](_0x349630,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x464e6d);}if(_0x246316!==null){logger['silly'](_0xaada('0xb6'),_0x246316);_0x246316['isGlobal']=_0xae47c9;throw _0x246316;}})['catch'](function(_0x7a4c1a){logger[_0xaada('0x61')](_0xaada('0xb7'),_0x7a4c1a);throw msgResponse('[ifTime][Action]',_0xaada('0x7f'),util[_0xaada('0x63')](_0x7a4c1a,{'showHidden':![],'depth':null}));});};Dialer[_0xaada('0x81')][_0xaada('0x27')]=function(_0x4ca21e){if(this[_0xaada('0x1c')][_0x4ca21e[_0xaada('0xb8')]]){if(this[_0xaada('0xb9')][_0x4ca21e[_0xaada('0xba')]]&&this['uniqueId'][_0x4ca21e[_0xaada('0xba')]][_0xaada('0x3b')]!=='ivr'){this[_0xaada('0xbb')](this[_0xaada('0x1c')][_0x4ca21e['queue']]);this[_0xaada('0xb9')][_0x4ca21e[_0xaada('0xba')]]['answertime']=moment()[_0xaada('0x3e')](_0xaada('0xbc'));}}};Dialer['prototype'][_0xaada('0xbd')]=function(_0x5ba536){var _0x14bbe5=this[_0xaada('0xb9')][_0x5ba536[_0xaada('0xba')]];if(this['voiceQueues'][_0x5ba536[_0xaada('0xb8')]]){if(_0x14bbe5&&_0x14bbe5[_0xaada('0x3b')]!==_0xaada('0xbe')){delete this[_0xaada('0xb9')][_0x5ba536[_0xaada('0xba')]];this['voiceQueues'][_0x5ba536['queue']][_0xaada('0xbf')]+=0x1;var _0x5f50fc=new AgentComplete(_0x14bbe5,_0x5ba536);if(_0x5ba536[_0xaada('0xc0')]===_0xaada('0xc1')){_0x5f50fc[_0xaada('0xc2')]=this[_0xaada('0x1c')][_0x5ba536['queue']][_0xaada('0xc3')]&&this['voiceQueues'][_0x5ba536[_0xaada('0xb8')]]['dialAgiAfterHangupAgent']?moment()['format'](_0xaada('0xbc')):undefined;}hopperUtils[_0xaada('0xc4')](_0x5f50fc)[_0xaada('0x9f')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xaada('0xc5')](_0x5f50fc)['catch'](loggerCatch(_0xaada('0xc6')));}}};Dialer[_0xaada('0x81')][_0xaada('0x2a')]=function(_0x409dd8){var _0x35b40e=this[_0xaada('0xb9')][_0x409dd8[_0xaada('0xba')]];var _0x5bf82e=this;var _0x254c9e=![];var _0x9e5a6d;var _0x1b82b3;if(this['voiceQueues'][_0x409dd8[_0xaada('0xb8')]]){if(_0x35b40e&&_0x35b40e['type']!=='ivr'){delete this[_0xaada('0xb9')][_0x409dd8[_0xaada('0xba')]];this[_0xaada('0xbb')](this[_0xaada('0x1c')][_0x409dd8['queue']]);_0x35b40e[_0xaada('0xc7')]=moment()['format'](_0xaada('0xbc'));var _0x4c7d26=new QueueCallerAbandon(_0x35b40e,_0x409dd8);if(utils['getSeconds'](_0x35b40e['droptime'],_0x35b40e[_0xaada('0xc8')])>=_0x35b40e[_0xaada('0xc9')]){this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xca')]+=0x1;_0x4c7d26[_0xaada('0x6c')]=0xa;_0x4c7d26['statedesc']='Drop';_0x4c7d26[_0xaada('0xcb')]='TIMEOUT';_0x4c7d26[_0xaada('0xc2')]=this['voiceQueues'][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xc3')]?moment()[_0xaada('0x3e')](_0xaada('0xbc')):undefined;_0x4c7d26[_0xaada('0xcc')]+=0x1;_0x4c7d26[_0xaada('0xcd')]+=0x1;_0x9e5a6d=this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]]['dialDropRetryFrequency'];_0x1b82b3=this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xaada('0xce')](_0x4c7d26,_0x4c7d26[_0xaada('0x6c')],_0x35b40e[_0xaada('0xcf')])[_0xaada('0xa1')](function(_0x4d5fb4){_0x254c9e=_0x4d5fb4[_0xaada('0xd0')]==0x1;if(_0x4c7d26[_0xaada('0xcc')]>=_0x5bf82e['voiceQueues'][_0x409dd8[_0xaada('0xb8')]]['dialDropMaxRetry']){_0x5bf82e[_0xaada('0xd1')](_0x4c7d26,_0x4d5fb4['additional']);}else{hopperUtils[_0xaada('0xd2')]({'active':![],'countdropretry':_0x4c7d26[_0xaada('0xcc')],'scheduledat':moment()[_0xaada('0xd3')](_0x5bf82e[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xd4')],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x35b40e[_0xaada('0xd6')],'ListId':_0x35b40e[_0xaada('0xd7')],'VoiceQueueId':_0x35b40e['VoiceQueueId']||undefined,'CampaignId':_0x35b40e[_0xaada('0xd8')]||undefined})['catch'](loggerCatch(_0xaada('0xd9')));var _0x3d81f2=new History(_0x4c7d26);_0x3d81f2[_0xaada('0x6c')]=0xa;_0x3d81f2[_0xaada('0x6d')]='Drop';_0x3d81f2[_0xaada('0x6e')]=moment()[_0xaada('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d81f2['endtime']=_0x3d81f2[_0xaada('0x6e')];_0x3d81f2[_0xaada('0xda')]=_0x4c7d26[_0xaada('0xda')];_0x3d81f2[_0xaada('0xdb')]=_0x4c7d26[_0xaada('0xdb')];hopperUtils[_0xaada('0xc4')](_0x3d81f2)[_0xaada('0x9f')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xaada('0xa1')](function(){if(_0x254c9e)hopperUtils['swapAdditionalPhones'](_0x4c7d26,_0x9e5a6d,_0x1b82b3)[_0xaada('0xa1')](function(){return 0x1;});});}else{this['voiceQueues'][_0x409dd8[_0xaada('0xb8')]][_0xaada('0x4b')]+=0x1;this[_0xaada('0x1c')][_0x409dd8['queue']][_0xaada('0xdc')]+=0x1;_0x4c7d26[_0xaada('0x6c')]=0xb;_0x4c7d26[_0xaada('0x6d')]=_0xaada('0xdd');_0x4c7d26[_0xaada('0xcb')]='CALLEREXIT';_0x4c7d26[_0xaada('0xde')]+=0x1;_0x4c7d26[_0xaada('0xcd')]+=0x1;_0x9e5a6d=this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xdf')];_0x1b82b3=this[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xe0')];hopperUtils[_0xaada('0xce')](_0x4c7d26,_0x4c7d26[_0xaada('0x6c')],_0x35b40e['voiceQueue'])['then'](function(_0x48280c){if(_0x4c7d26['countabandonedretry']>=_0x5bf82e[_0xaada('0x1c')][_0x409dd8[_0xaada('0xb8')]][_0xaada('0xe1')]){_0x5bf82e[_0xaada('0xd1')](_0x4c7d26,_0x48280c['additional']);}else{hopperUtils[_0xaada('0xd2')]({'active':![],'countabandonedretry':_0x4c7d26[_0xaada('0xde')],'scheduledat':moment()[_0xaada('0xd3')](_0x5bf82e[_0xaada('0x1c')][_0x409dd8['queue']][_0xaada('0xdf')],'minutes')[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x35b40e[_0xaada('0xd6')],'ListId':_0x35b40e[_0xaada('0xd7')],'VoiceQueueId':_0x35b40e[_0xaada('0xe2')]||undefined,'CampaignId':_0x35b40e[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0xe3')));var _0x8e2997=new History(_0x4c7d26);_0x8e2997['state']=0xb;_0x8e2997[_0xaada('0x6d')]='Abandoned';_0x8e2997[_0xaada('0x6e')]=moment()[_0xaada('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');_0x8e2997[_0xaada('0xe4')]=_0x8e2997[_0xaada('0x6e')];_0x8e2997[_0xaada('0xda')]=_0x4c7d26[_0xaada('0xda')];_0x8e2997[_0xaada('0xdb')]=_0x4c7d26[_0xaada('0xdb')];hopperUtils['createHistory'](_0x8e2997)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xaada('0xa1')](function(){if(_0x254c9e)hopperUtils['swapAdditionalPhones'](_0x4c7d26,_0x9e5a6d,_0x1b82b3)['then'](function(){return 0x1;});});}}}};Dialer[_0xaada('0x81')][_0xaada('0xe5')]=function(_0x203bba){if(this['actions'][_0x203bba[_0xaada('0xba')]]){this[_0xaada('0x21')][_0x203bba[_0xaada('0xba')]][_0xaada('0xe6')]=_0x203bba[_0xaada('0xe6')];}if(this[_0xaada('0xb9')][_0x203bba['uniqueid']]){this[_0xaada('0xb9')][_0x203bba[_0xaada('0xba')]][_0xaada('0xe6')]=_0x203bba[_0xaada('0xe6')];}};Dialer[_0xaada('0x81')][_0xaada('0x34')]=function(_0x3f9802){if(!this['actions'][_0x3f9802[_0xaada('0xe7')]]){return;}var _0x93751c=this[_0xaada('0x1c')][this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]][_0xaada('0xb8')]]['strategy']||_0xaada('0xe8');if(_0x93751c===_0xaada('0xe9')){if(this['actions'][_0x3f9802[_0xaada('0xe7')]]&&_[_0xaada('0xea')](this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]][_0xaada('0xeb')])&&_0x3f9802[_0xaada('0x85')]==='1'&&_0x3f9802[_0xaada('0xec')]==='0'){if(this[_0xaada('0xed')][_0x3f9802[_0xaada('0xee')]]){if(!this[_0xaada('0xed')][_0x3f9802[_0xaada('0xee')]][_0xaada('0xeb')]){this[_0xaada('0xed')][_0x3f9802[_0xaada('0xee')]][_0xaada('0xeb')]=!![];this[_0xaada('0x21')][_0x3f9802['actionid']]['locked']=!![];this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]][_0xaada('0xee')]=_0x3f9802['stateinterface'];}}}}else if(_0x93751c===_0xaada('0xe8')){if(this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]]){if(this[_0xaada('0xed')][_0x3f9802[_0xaada('0xee')]]){this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]]['stateinterface']=_0x3f9802[_0xaada('0xee')];if(_[_0xaada('0xea')](this['queueBooked'][this[_0xaada('0x21')][_0x3f9802['actionid']][_0xaada('0xb8')]])){this[_0xaada('0xef')][this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]][_0xaada('0xb8')]]=[];}this[_0xaada('0xef')][this[_0xaada('0x21')][_0x3f9802[_0xaada('0xe7')]][_0xaada('0xb8')]][_0xaada('0xa0')](_[_0xaada('0x5a')](_['pick'](this[_0xaada('0x21')][_0x3f9802['actionid']],[_0xaada('0xf0'),_0xaada('0xee')]),{'status':_0x3f9802['status'],'paused':_0x3f9802[_0xaada('0xec')]}));}}}};Dialer['prototype'][_0xaada('0x36')]=function(_0x25a50e){if(!this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]]){return;}var _0x38672a=this;var _0x118548=this[_0xaada('0x1c')][this['actions'][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]];var _0x53fea8=_0x118548[_0xaada('0xf1')]||_0xaada('0xe8');if(_0x53fea8===_0xaada('0xe9')){if(this[_0xaada('0x21')][_0x25a50e['actionid']]&&this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]]['stateinterface']){this[_0xaada('0x1b')]['run'](this[_0xaada('0x21')][_0x25a50e['actionid']]['idHopper'],this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xee')])['catch'](function(_0x3d675b){logger[_0xaada('0x61')](_0xaada('0xf2'),util['inspect'](_0x3d675b,{'showHidden':![],'depth':null}));})[_0xaada('0xf3')](function(){_0x38672a[_0xaada('0xbb')](_0x38672a[_0xaada('0x1c')][_0x38672a[_0xaada('0x21')][_0x25a50e['actionid']][_0xaada('0xb8')]]);_0x38672a[_0xaada('0xed')][_0x38672a[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xee')]][_0xaada('0xeb')]=![];delete _0x38672a[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]];unlockQueueStatus(_0x118548);});}else{this[_0xaada('0xbb')](this['voiceQueues'][this['actions'][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]]);hopperUtils[_0xaada('0xd2')]({'active':![],'ContactId':this[_0xaada('0x21')][_0x25a50e['actionid']]['ContactId'],'ListId':this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xd7')],'VoiceQueueId':this['actions'][_0x25a50e[_0xaada('0xe7')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0xf4')));delete this['actions'][_0x25a50e['actionid']];unlockQueueStatus(_0x118548);}}else if(_0x53fea8===_0xaada('0xe8')){var _0x3e6e67;if(this['actions'][_0x25a50e[_0xaada('0xe7')]]&&!_[_0xaada('0x42')](this[_0xaada('0xef')][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]])){if(this[_0xaada('0x25')][_0x38672a[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]]){this['queueBookedRR'][_0x38672a[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]]=this[_0xaada('0x25')][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]]?this[_0xaada('0x25')][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]]:this['queueBooked'][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]]['queue']]?this[_0xaada('0xef')][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]][_0xaada('0xb8')]][_0xaada('0xf5')]||0x0:0x0;}this[_0xaada('0xef')][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]]['queue']]['_rr']=this['queueBookedRR'][this[_0xaada('0x21')][_0x25a50e[_0xaada('0xe7')]]['queue']];for(var _0x21e4db=0x0;_0x21e4db=_0x2c4b57[_0xaada('0x119')]){_0x591352[_0xaada('0x11a')](_0x2930a6,_0x466f0f,_0x511b95,_0xaada('0x11b'));}else{if(_0x2930a6[_0xaada('0x117')]>=_0x2c4b57[_0xaada('0x11c')]){_0x591352[_0xaada('0x11d')](_0x2930a6,_0x466f0f,_0x511b95,_0xaada('0x11e'));}else{hopperUtils[_0xaada('0xd2')]({'active':![],'countmachineretry':_0x2930a6[_0xaada('0x117')],'scheduledat':moment()[_0xaada('0xd3')](_0x2c4b57[_0xaada('0x11f')],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x2930a6[_0xaada('0xd6')],'ListId':_0x2930a6[_0xaada('0xd7')],'VoiceQueueId':_0x2930a6['VoiceQueueId']||undefined,'CampaignId':_0x2930a6['CampaignId']||undefined})['catch'](loggerCatch(_0xaada('0x120')));_0x466f0f({'reschedule':0x1});}}});}if(_0x3a87f4[_0xaada('0x3b')]==='ivr'&&this[_0xaada('0x1d')][_0x3a87f4[_0xaada('0xb8')]][_0xaada('0x108')]&&_0x5142ef[_0xaada('0x121')]===_0xaada('0x109')){delete this[_0xaada('0xb9')][_0x5142ef[_0xaada('0xba')]];this[_0xaada('0xbb')](this[_0xaada('0x1d')][_0x3a87f4[_0xaada('0xb8')]]);_0x317954=new Hangup(_0x3a87f4,_0x5142ef);_0x317954['state']=0x12;_0x317954['statedesc']=_0xaada('0x122');_0x317954[_0xaada('0x123')]=_0xaada('0x10b');ami[_0xaada('0x3a')](_0xaada('0x10c'),ut[_0xaada('0x10d')](_0x317954,'amd'));this['saveInDb'](_0x317954,_0xaada('0x124'),_0xaada('0x125'));}if(_0x3a87f4[_0xaada('0x3b')]===_0xaada('0xbe')&&this[_0xaada('0x1d')][_0x3a87f4['queue']][_0xaada('0x108')]&&_0x5142ef[_0xaada('0x121')]==='MACHINE'){return new Promise(function(_0x4b5fa1,_0x104c6a){delete _0x591352[_0xaada('0xb9')][_0x5142ef['uniqueid']];_0x591352[_0xaada('0xbb')](_0x591352[_0xaada('0x1d')][_0x3a87f4['queue']]);_0x591352[_0xaada('0x1d')][_0x3a87f4[_0xaada('0xb8')]][_0xaada('0xbf')]+=0x1;_0x591352['campaigns'][_0x3a87f4['queue']][_0xaada('0x10a')]+=0x1;var _0x19ca58=_0x591352[_0xaada('0x1d')][_0x3a87f4['queue']];var _0x4c5d2e=new Hangup(_0x3a87f4,_0x5142ef);_0x4c5d2e[_0xaada('0x6c')]=0x13;_0x4c5d2e[_0xaada('0x6d')]=_0xaada('0x111');_0x4c5d2e[_0xaada('0x123')]=_0xaada('0x10b');_0x4c5d2e[_0xaada('0x117')]+=0x1;_0x4c5d2e[_0xaada('0xcd')]+=0x1;_0x4c5d2e[_0xaada('0x10e')]=!![];ami[_0xaada('0x3a')](_0xaada('0x10c'),ut[_0xaada('0x10d')](_0x4c5d2e,'amd'));hopperUtils[_0xaada('0xc4')](_0x4c5d2e)['catch'](loggerCatch(_0xaada('0x112')));if(_0x4c5d2e[_0xaada('0x113')]+_0x4c5d2e['countcongestionretry']+_0x4c5d2e[_0xaada('0x115')]+_0x4c5d2e[_0xaada('0x116')]+_0x4c5d2e['countdropretry']+_0x4c5d2e['countabandonedretry']+_0x4c5d2e[_0xaada('0x117')]+_0x4c5d2e['countagentrejectretry']>=_0x19ca58[_0xaada('0x119')]){_0x591352[_0xaada('0x11a')](_0x4c5d2e,_0x4b5fa1,_0x104c6a,_0xaada('0x11b'));}else{if(_0x4c5d2e['countmachineretry']>=_0x19ca58[_0xaada('0x11c')]){_0x591352[_0xaada('0x11d')](_0x4c5d2e,_0x4b5fa1,_0x104c6a,'reason\x2019\x20machine....');}else{hopperUtils[_0xaada('0xd2')]({'active':![],'countmachineretry':_0x4c5d2e[_0xaada('0x117')],'scheduledat':moment()['add'](_0x19ca58[_0xaada('0x11f')],'minutes')['format'](_0xaada('0xbc')),'ContactId':_0x4c5d2e[_0xaada('0xd6')],'ListId':_0x4c5d2e[_0xaada('0xd7')],'VoiceQueueId':_0x4c5d2e['VoiceQueueId']||undefined,'CampaignId':_0x4c5d2e[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0x120')));_0x4b5fa1({'reschedule':0x1});}}});}}};Dialer[_0xaada('0x81')][_0xaada('0x31')]=function(_0x52ffed){var _0x2e6926=this['uniqueId'][_0x52ffed[_0xaada('0xba')]];var _0x359293;if(_0x2e6926&&_0x2e6926[_0xaada('0x3b')]==='ivr'){delete this[_0xaada('0xb9')][_0x52ffed[_0xaada('0xba')]];this[_0xaada('0xbb')](this[_0xaada('0x1d')][_0x2e6926[_0xaada('0xb8')]]);this['campaigns'][_0x2e6926['queue']]['ivrAnswerCallsDay']+=0x1;_0x359293=new Hangup(_0x2e6926,_0x52ffed);hopperUtils['createHistory'](_0x359293)[_0xaada('0x9f')](loggerCatch(_0xaada('0x126')));hopperUtils['moveContactManagedDialer'](_0x359293)[_0xaada('0x9f')](loggerCatch(_0xaada('0x127')));}if(_0x2e6926&&_0x2e6926[_0xaada('0x3b')]!=='ivr'&&isNotNull(this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]][_0xaada('0x128')])){delete this[_0xaada('0xb9')][_0x52ffed[_0xaada('0xba')]];this[_0xaada('0xbb')](this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]]);this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]][_0xaada('0xbf')]+=0x1;this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]][_0xaada('0x10a')]+=0x1;_0x359293=new Hangup(_0x2e6926,_0x52ffed);_0x359293[_0xaada('0x6c')]=0x10;_0x359293['statedesc']=_0xaada('0x129');_0x359293[_0xaada('0x123')]=_0xaada('0x12a');hopperUtils[_0xaada('0xc4')](_0x359293)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xaada('0xc5')](_0x359293)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x2e6926&&_0x2e6926['type']!==_0xaada('0xbe')&&!isNotNull(this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]]['dialQueueProject'])){delete this[_0xaada('0xb9')][_0x52ffed['uniqueid']];this[_0xaada('0xbb')](this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]]);this[_0xaada('0x1c')][_0x2e6926[_0xaada('0xb8')]][_0xaada('0x12b')]+=0x1;_0x359293=new Hangup(_0x2e6926,_0x52ffed);_0x359293[_0xaada('0x6c')]=0xc;_0x359293[_0xaada('0x6d')]=_0x52ffed['cause-txt'];_0x359293[_0xaada('0x123')]=_0xaada('0x12c');hopperUtils[_0xaada('0xc4')](_0x359293)[_0xaada('0x9f')](loggerCatch(_0xaada('0x126')));hopperUtils[_0xaada('0xc5')](_0x359293)[_0xaada('0x9f')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xaada('0x81')][_0xaada('0x2e')]=function(_0x4285ec){var _0x1a1609=this;if(!_0x1a1609[_0xaada('0x12d')][_0x4285ec[_0xaada('0x40')]]){_0x1a1609['queuesSummary'][_0x4285ec[_0xaada('0x40')]]={'running':![]};}else if(_0x1a1609['queuesSummary'][_0x4285ec[_0xaada('0x40')]]['running']===!![]){return;}else if(_0x1a1609[_0xaada('0x12d')][_0x4285ec[_0xaada('0x40')]][_0xaada('0x12e')]===![]){_0x1a1609[_0xaada('0x12d')][_0x4285ec[_0xaada('0x40')]][_0xaada('0x12e')]=!![];}var _0xa0c8f9=_0x1a1609[_0xaada('0x1c')][_0x4285ec['name']];var _0x3f956e=_0xa0c8f9[_0xaada('0x66')]!==utils[_0xaada('0x6a')][_0xaada('0x76')];var _0x16462f=utils[_0xaada('0x12f')](_0xa0c8f9);_0xa0c8f9['statusMessage']=utils['getQueueCampaignStatusMessage'](_0xa0c8f9,_0x1a1609[_0xaada('0x1e')]);Promise[_0xaada('0x130')]()[_0xaada('0xa1')](function(){if(_0xa0c8f9[_0xaada('0x131')]===utils['CAMPAIGN_STATUS'][_0xaada('0x76')]){if(_0x3f956e){clearPredictiveAttributes(_0xa0c8f9);_0x4285ec[_0xaada('0x5d')]=undefined;_0x4285ec[_0xaada('0x23')]=undefined;}if(_0xa0c8f9[_0xaada('0x131')]===utils['CAMPAIGN_STATUS'][_0xaada('0x76')]){_0x4285ec[_0xaada('0x132')]=0x0;_0x4285ec[_0xaada('0xec')]=0x0;_0x4285ec['inUse']=0x0;_0x4285ec[_0xaada('0x133')]=0x0;_0x4285ec[_0xaada('0x134')]=0x0;}}else if(_0xa0c8f9[_0xaada('0x131')]===utils['CAMPAIGN_STATUS'][_0xaada('0x135')]&&!_0x16462f){return _0x1a1609['ifTime'](_0xa0c8f9,!![])[_0xaada('0xa1')](function(){return _0x1a1609[_0xaada('0x91')](_0xa0c8f9,![]);})['then'](function(){return _0x1a1609[_0xaada('0xaa')](_0xa0c8f9);})['catch'](function(_0x46942c){loggerSyncQueueSummary[_0xaada('0x3c')](_0xaada('0x136'),util[_0xaada('0x63')](_0x46942c,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xa0c8f9);});}else{clearPredictiveAttributes(_0xa0c8f9);}})['then'](function(){var _0x53716c=_0x4285ec['compareToOutboundQueue'](_0xa0c8f9);if(_0x53716c||_0xa0c8f9[_0xaada('0x137')]){_0xa0c8f9[_0xaada('0x137')]=![];_0x4285ec[_0xaada('0x138')](_0xa0c8f9);Object['assign'](_0xa0c8f9,_0x4285ec);emitOutboundVoiceQueueSummary(_0x4285ec);}_0x1a1609[_0xaada('0x12d')][_0xa0c8f9[_0xaada('0x40')]][_0xaada('0x12e')]=![];})[_0xaada('0x9f')](function(_0x2be7a2){logger['error'](_0xaada('0x136'),util[_0xaada('0x63')](_0x2be7a2,{'showHidden':![],'depth':null}));_0x1a1609['queuesSummary'][_0xa0c8f9[_0xaada('0x40')]][_0xaada('0x12e')]=![];});};Dialer[_0xaada('0x81')][_0xaada('0x30')]=_['throttle'](function(){var _0xc19bef=_[_0xaada('0x139')](this[_0xaada('0x1c')],function(_0x56591b){return _0x56591b[_0xaada('0x13a')];});var _0x26fedb=_[_0xaada('0x139')](this[_0xaada('0xed')],function(_0x936797){return _0x936797[_0xaada('0x13b')]&&_0x936797[_0xaada('0x85')]===_0xaada('0x13c');});if(_0xc19bef[_0xaada('0x97')]>0x0&&_0x26fedb[_0xaada('0x97')]>0x0){return Promise[_0xaada('0x130')]()[_0xaada('0xa1')](cmHopper[_0xaada('0x13d')](_[_0xaada('0x13e')](_0xc19bef,'id'),previewRecallmeReminderInterval,_[_0xaada('0x13e')](_0x26fedb,'id')))['then'](function(_0x561225){for(var _0x2d6edd=0x0;_0x2d6edd<_0x561225[_0xaada('0x97')];_0x2d6edd++){var _0x20e186=_0x561225[_0x2d6edd][_0xaada('0x13f')][_0xaada('0x40')];if(_0x20e186)io['to'](util['format']('user:%s',_0x20e186))[_0xaada('0x3a')](_0xaada('0x140'),{'hopper':_0x561225[_0x2d6edd]});}})[_0xaada('0x9f')](function(_0x52e74d){logger[_0xaada('0x61')](_0xaada('0x141'),_0x52e74d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xaada('0x81')][_0xaada('0x142')]=function(){var _0xa37a51=this;setInterval(function(){_0xa37a51['clearZombieChannels'](_0xa37a51[_0xaada('0xb9')],_0xaada('0x143'));_0xa37a51[_0xaada('0x144')](_0xa37a51[_0xaada('0x21')],_0xaada('0x145'));},0x32c8);};Dialer[_0xaada('0x81')]['clearZombieChannels']=function(_0x592e2a,_0x239425){var _0x119bc6=this;for(var _0x54d799 in _0x592e2a){if(typeof _0x592e2a[_0x54d799]!=='undefined'){this[_0xaada('0x1a')][_0xaada('0x146')](function(){if(!_[_0xaada('0xea')](_0x592e2a[_0x54d799])){return ami[_0xaada('0x98')]({'action':_0xaada('0x85'),'channel':_0x592e2a[_0x54d799][_0xaada('0xe6')]})[_0xaada('0x9f')](function(_0x32f028){if(_0x32f028[_0xaada('0x66')]===_0xaada('0x147')){setTimeout(function(){if(_0x592e2a[_0x54d799]&&_0x592e2a[_0x54d799][_0xaada('0x3b')]!==_0xaada('0xbe')){_0x119bc6['updateOriginated'](_0x119bc6[_0xaada('0x1c')][_0x592e2a[_0x54d799]['queue']]);logger[_0xaada('0x61')]('[Dialer][checkChannel]',_0x239425,_0x54d799,_0x592e2a[_0x54d799][_0xaada('0xb8')]);delete _0x592e2a[_0x54d799];}if(_0x592e2a[_0x54d799]&&_0x592e2a[_0x54d799][_0xaada('0x3b')]===_0xaada('0xbe')){_0x119bc6[_0xaada('0xbb')](_0x119bc6[_0xaada('0x1d')][_0x592e2a[_0x54d799][_0xaada('0xb8')]]);logger[_0xaada('0x61')]('[Dialer][checkChannel][ivr]',_0x239425,_0x54d799,_0x592e2a[_0x54d799][_0xaada('0xb8')]);delete _0x592e2a[_0x54d799];}},0x2328);}});}});}}};Dialer['prototype'][_0xaada('0x148')]=function(_0x358d37){return Promise[_0xaada('0x130')]()[_0xaada('0xa1')](voiceQueueRt[_0xaada('0x148')](_0x358d37))['catch'](loggerCatch(_0xaada('0x149')));};Dialer[_0xaada('0x81')]['updateOriginated']=function(_0x19b373){if(!_[_0xaada('0x39')](_0x19b373)&&_0x19b373!==null){if(typeof _0x19b373[_0xaada('0x14a')]!==_0xaada('0x14b')){if(_0x19b373[_0xaada('0x14a')]>0x0){_0x19b373[_0xaada('0x14a')]-=0x1;}else{logger[_0xaada('0x61')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xaada('0x81')][_0xaada('0x14c')]=function(_0x3e77fa,_0x416271){var _0x288bb2=this;return function(_0x3efb88){_0x288bb2[_0xaada('0xbb')](_0x416271);logger[_0xaada('0x61')](_0x3e77fa,util[_0xaada('0x63')](_0x3efb88,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xaada('0x14d')]=function(_0x5e24e8,_0x225c8d,_0x4c21cd){var _0x3f2240={'state':0x19,'statedesc':_0xaada('0x14e')};this[_0xaada('0xbb')](_0x225c8d);this[_0xaada('0x10f')](_[_0xaada('0x5a')](_0x3f2240,_[_0xaada('0x70')](_0x4c21cd,[_0xaada('0xd6'),_0xaada('0xd7'),_0xaada('0x14f'),_0xaada('0xe2'),_0xaada('0xd8')])),'[emptyContact][createHistory]',_0xaada('0x150'));logger[_0xaada('0x61')](_0x5e24e8);};Dialer[_0xaada('0x81')][_0xaada('0x10f')]=function(_0x1f8f1b,_0x22095d,_0x19b220){hopperUtils['createHistory'](_0x1f8f1b)[_0xaada('0x9f')](loggerCatch(_0x22095d));hopperUtils['moveContactManagedDialer'](_0x1f8f1b)[_0xaada('0x9f')](loggerCatch(_0x19b220));};Dialer['prototype'][_0xaada('0xd1')]=function(_0x1dfdcf,_0x491d6e){hopperUtils['createHistory'](_0x1dfdcf)[_0xaada('0x9f')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x491d6e==0x0){hopperUtils[_0xaada('0xc5')](_0x1dfdcf)[_0xaada('0x9f')](loggerCatch(_0xaada('0x151')));}};Dialer[_0xaada('0x81')][_0xaada('0x141')]=function(_0x498903){return Promise[_0xaada('0x130')]()[_0xaada('0xa1')](cmHopper['handlePreviewRecallNotifications'](_0x498903['id'],previewRecallmeReminderInterval))[_0xaada('0xa1')](function(_0x4a6585){for(var _0x143a40=0x0;_0x143a40<_0x4a6585['length'];_0x143a40++){var _0x48a2c8=_0x4a6585[_0x143a40][_0xaada('0x13f')][_0xaada('0x40')];if(_0x48a2c8)io['to'](util['format'](_0xaada('0x152'),_0x48a2c8))[_0xaada('0x3a')](_0xaada('0x140'),{'hopper':_0x4a6585[_0x143a40]});}})[_0xaada('0x9f')](function(){});};Dialer['prototype'][_0xaada('0x153')]=function(_0xb668f6){var _0x1bb2dc=this;return function(){_0x1bb2dc['handleIvr'](_0xb668f6);};};Dialer['prototype'][_0xaada('0x154')]=function(_0x92f804,_0x3d5bad){var _0x525275=this;var _0xa4c5a0=uuid['v4']();this[_0xaada('0x21')][_0xa4c5a0]=new Action(_0x92f804,_0x3d5bad,_0xa4c5a0);return new Promise(function(_0x4f3b1f,_0x50a96d){if(_[_0xaada('0x39')](_0x92f804)&&typeof _0x92f804!==_0xaada('0x155')){return _0x50a96d(msgResponse(_0xaada('0x156'),'Failure',_0xaada('0x157')));}if(_[_0xaada('0x39')](_0x3d5bad['phone'])||_0x3d5bad[_0xaada('0x158')]===null){return _0x50a96d(msgResponse(_0xaada('0x156'),_0xaada('0x8e'),_0xaada('0x159')));}var _0x38cd85={'XMD-CALLERID':_0x525275[_0xaada('0x21')][_0xa4c5a0][_0xaada('0x15a')](),'XMD-AGI':_0x92f804['dialQueueProject']?util[_0xaada('0x3e')](_0xaada('0x15b'),ipAgi,_0x92f804[_0xaada('0x128')]):_0xaada('0x15c'),'XMD-AGIAFTER':_0x92f804['dialQueueProject2']?util[_0xaada('0x3e')](_0xaada('0x15b'),ipAgi,_0x92f804[_0xaada('0xc3')]):'NONE','XMD-QUEUE':utils[_0xaada('0x15d')](_0x92f804)?util[_0xaada('0x3e')]('\x22%s,%s%s,,,%s\x22',_0x92f804[_0xaada('0x40')],_0x92f804[_0xaada('0x15e')]||'',_0x92f804['dialAgiAfterHangupAgent']?'c':'',_0x92f804[_0xaada('0xc9')]||0x3):_0xaada('0x15c'),'XMD-CONTACTID':_0x3d5bad[_0xaada('0xd6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x525275[_0xaada('0x21')][_0xa4c5a0]['getCaller'](),'XMD-AMD':_0x92f804[_0xaada('0x108')]?_0xaada('0x135'):_0xaada('0x15c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x92f804[_0xaada('0x108')]){_0x38cd85[_0xaada('0x15f')]=_0x92f804[_0xaada('0x160')]||0x9c4;_0x38cd85['XMD-AMDGREETING']=_0x92f804[_0xaada('0x161')]||0x5dc;_0x38cd85[_0xaada('0x162')]=_0x92f804[_0xaada('0x163')]||0x320;_0x38cd85[_0xaada('0x164')]=_0x92f804['dialAMDTotalAnalysisTime']||0x1388;_0x38cd85['XMD-AMDMINWORDLENGTH']=_0x92f804[_0xaada('0x165')]||0x64;_0x38cd85[_0xaada('0x166')]=_0x92f804[_0xaada('0x167')]||0x32;_0x38cd85[_0xaada('0x168')]=_0x92f804['dialAMDMaximumNumberOfWords']||0x3;_0x38cd85[_0xaada('0x169')]=_0x92f804[_0xaada('0x16a')]||0x100;_0x38cd85[_0xaada('0x16b')]=_0x92f804[_0xaada('0x16c')]||0x1388;}if(utils[_0xaada('0x15d')](_0x92f804)){_0x38cd85[_0xaada('0x16d')]=_0x3d5bad[_0xaada('0xe2')];}else{_0x38cd85[_0xaada('0x16e')]=_0x3d5bad[_0xaada('0xd8')];}var _0x39e7ea=utils[_0xaada('0x16f')](_0x3d5bad[_0xaada('0x170')]);Object['assign'](_0x38cd85,_0x39e7ea);var _0x5e2c4c=_0x525275[_0xaada('0x82')](_0x92f804['Trunk'])?utils[_0xaada('0x171')](_0x92f804[_0xaada('0x87')][_0xaada('0x172')],_0x92f804[_0xaada('0x173')],_0x92f804[_0xaada('0x174')]>0x0?utils['getCallerIdRandom'](_0x92f804[_0xaada('0x175')],_0x92f804[_0xaada('0x174')]):_0x92f804[_0xaada('0x175')]):utils['getCallerId'](_[_0xaada('0xea')](_0x92f804[_0xaada('0x88')])?_0x92f804['Trunk'][_0xaada('0x172')]:_0x92f804[_0xaada('0x88')]['callerid'],_0x92f804[_0xaada('0x173')],_0x92f804[_0xaada('0x174')]>0x0?utils[_0xaada('0x176')](_0x92f804[_0xaada('0x175')],_0x92f804[_0xaada('0x174')]):_0x92f804[_0xaada('0x175')]);if(_0x5e2c4c){_0x38cd85[_0xaada('0x177')]=_0x525275[_0xaada('0x21')][_0xa4c5a0][_0xaada('0x178')]=utils['extractCalleridName'](_0x5e2c4c);_0x38cd85[_0xaada('0x179')]=_0x3d5bad[_0xaada('0x158')];}_0x92f804[_0xaada('0x17a')]=_0x38cd85;return ami[_0xaada('0x98')]({'actionid':_0xa4c5a0,'action':'originate','channel':_0x525275[_0xaada('0x82')](_0x92f804[_0xaada('0x87')])?util[_0xaada('0x3e')](_0xaada('0x17b'),_0x92f804[_0xaada('0x87')]['name'],isNotNull(_0x92f804[_0xaada('0x17c')])?_0x92f804[_0xaada('0x17c')]['trim']()||'':'',_0x92f804[_0xaada('0x17d')]>0x0?_0x3d5bad['phone'][_0xaada('0x17e')](_0x92f804[_0xaada('0x17d')]):_0x3d5bad[_0xaada('0x158')]):util[_0xaada('0x3e')](_0xaada('0x17b'),_[_0xaada('0xea')](_0x92f804[_0xaada('0x88')])?_0x92f804[_0xaada('0x87')][_0xaada('0x40')]:_0x92f804['TrunkBackup'][_0xaada('0x40')],isNotNull(_0x92f804[_0xaada('0x17c')])?_0x92f804[_0xaada('0x17c')]['trim']()||'':'',_0x92f804[_0xaada('0x17d')]>0x0?_0x3d5bad['phone'][_0xaada('0x17e')](_0x92f804[_0xaada('0x17d')]):_0x3d5bad[_0xaada('0x158')]),'callerid':_0x5e2c4c,'Exten':_0xaada('0x107'),'Context':_0xaada('0x17f'),'Priority':'1','variable':_0x38cd85,'timeout':(_0x92f804[_0xaada('0x180')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa4c5a0})[_0xaada('0xa1')](function(_0x90f49){return _0x4f3b1f(_0x90f49);})['catch'](function(_0x402060){_0x92f804[_0xaada('0x181')]+=0x1;var _0x55889f=new History(_0x525275[_0xaada('0x21')][_0xa4c5a0]);logger[_0xaada('0x61')](util[_0xaada('0x3e')](_0xaada('0x182'),JSON[_0xaada('0x80')](_0x402060)));_0x55889f[_0xaada('0x6c')]=0xe;_0x55889f[_0xaada('0x6d')]=_0xaada('0x183');_0x55889f['starttime']=moment()[_0xaada('0x3e')](_0xaada('0xbc'));_0x55889f[_0xaada('0xe4')]=_0x55889f[_0xaada('0x6e')];hopperUtils[_0xaada('0xc4')](_0x55889f)[_0xaada('0x9f')](loggerCatch(_0xaada('0x184')));_0x525275[_0xaada('0xc5')](_0x55889f)[_0xaada('0x9f')](loggerCatch(_0xaada('0x184')))[_0xaada('0xf3')](function(){delete _0x525275[_0xaada('0x21')][_0xa4c5a0];return _0x50a96d(msgResponse(_0xaada('0x156'),_0xaada('0x7f'),_0xaada('0x185')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x5cca35,_0x43893f,_0x5b4f20){var _0x12c11b=new History(_0x43893f);if(_0x12c11b['countbusyretry']+_0x12c11b[_0xaada('0x114')]+_0x12c11b[_0xaada('0x115')]+_0x12c11b[_0xaada('0x116')]+_0x12c11b[_0xaada('0xcc')]+_0x12c11b[_0xaada('0xde')]+_0x12c11b[_0xaada('0x117')]+_0x12c11b['countagentrejectretry']>=_0x5b4f20[_0xaada('0x119')]-0x1){return!![];}switch(_0x5cca35){case 0x3:if(_0x12c11b[_0xaada('0x115')]>=_0x5b4f20['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xaada('0xd2')]({'active':![],'countnoanswerretry':_0x12c11b[_0xaada('0x115')]+=0x1,'scheduledat':moment()['add'](_0x5b4f20['dialNoAnswerRetryFrequency'],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b[_0xaada('0xe2')]||undefined,'CampaignId':_0x12c11b[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0x186')));break;case 0x5:if(_0x12c11b[_0xaada('0x113')]>=_0x5b4f20['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xaada('0xd2')]({'active':![],'countbusyretry':_0x12c11b[_0xaada('0x113')]+=0x1,'scheduledat':moment()[_0xaada('0xd3')](_0x5b4f20[_0xaada('0x187')],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b['ListId'],'VoiceQueueId':_0x12c11b[_0xaada('0xe2')]||undefined,'CampaignId':_0x12c11b[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x12c11b[_0xaada('0x114')]>=_0x5b4f20[_0xaada('0x188')]-0x1){return!![];}hopperUtils[_0xaada('0xd2')]({'active':![],'countcongestionretry':_0x12c11b['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5b4f20[_0xaada('0x189')],_0xaada('0xd5'))['format'](_0xaada('0xbc')),'ContactId':_0x12c11b['ContactId'],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b[_0xaada('0xe2')]||undefined,'CampaignId':_0x12c11b['CampaignId']||undefined})['catch'](loggerCatch(_0xaada('0x18a')));break;case 0x0:if(_0x12c11b[_0xaada('0x116')]>=_0x5b4f20[_0xaada('0x18b')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x12c11b[_0xaada('0x116')]+=0x1,'scheduledat':moment()[_0xaada('0xd3')](_0x5b4f20[_0xaada('0x18c')],'minutes')['format'](_0xaada('0xbc')),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b[_0xaada('0xe2')]||undefined,'CampaignId':_0x12c11b[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0x18d')));}break;case 0xa:if(_0x12c11b['countdropretry']>=_0x5b4f20[_0xaada('0x18e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x12c11b[_0xaada('0xcc')]+=0x1,'scheduledat':moment()['add'](_0x5b4f20['dialDropRetryFrequency'],_0xaada('0xd5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b['VoiceQueueId']||undefined,'CampaignId':_0x12c11b[_0xaada('0xd8')]||undefined})['catch'](loggerCatch(_0xaada('0xd9')));break;case 0xb:if(_0x12c11b[_0xaada('0xde')]>=_0x5b4f20[_0xaada('0xe1')]-0x1){return!![];}hopperUtils[_0xaada('0xd2')]({'active':![],'countabandonedretry':_0x12c11b[_0xaada('0xde')]+=0x1,'scheduledat':moment()[_0xaada('0xd3')](_0x5b4f20[_0xaada('0xdf')],_0xaada('0xd5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b['ListId'],'VoiceQueueId':_0x12c11b['VoiceQueueId']||undefined,'CampaignId':_0x12c11b['CampaignId']||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0xe3')));break;case 0x13:if(_0x12c11b[_0xaada('0x117')]>=_0x5b4f20[_0xaada('0x11c')]-0x1){return!![];}hopperUtils[_0xaada('0xd2')]({'active':![],'countmachineretry':_0x12c11b[_0xaada('0x117')]+=0x1,'scheduledat':moment()[_0xaada('0xd3')](_0x5b4f20[_0xaada('0x11f')],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b[_0xaada('0xe2')]||undefined,'CampaignId':_0x12c11b[_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0x120')));break;case 0x14:if(_0x12c11b[_0xaada('0x118')]>=_0x5b4f20['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x12c11b[_0xaada('0x118')]+=0x1,'scheduledat':moment()[_0xaada('0xd3')](_0x5b4f20[_0xaada('0x18f')],_0xaada('0xd5'))[_0xaada('0x3e')](_0xaada('0xbc')),'ContactId':_0x12c11b[_0xaada('0xd6')],'ListId':_0x12c11b[_0xaada('0xd7')],'VoiceQueueId':_0x12c11b['VoiceQueueId']||undefined,'CampaignId':_0x12c11b['CampaignId']||undefined})[_0xaada('0x9f')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xaada('0x81')][_0xaada('0x102')]=function(_0x4e0c30,_0x1f03f7,_0x3eb0ce){var _0x4c0b09=this;var _0x12ad80=new History(_0x4e0c30);var _0x2b9b41=![];var _0x32f1e4;var _0x54ea2f;return new Promise(function(_0x30a2bc,_0x20d299){if(_['isUndefined'](_0x1f03f7)&&typeof _0x1f03f7!=='object'){return _0x20d299(msgResponse(_0xaada('0x190'),_0xaada('0x8e'),_0xaada('0x191')));}if(_[_0xaada('0x39')](_0x3eb0ce)&&typeof _0x3eb0ce!==_0xaada('0x155')){return _0x20d299(msgResponse('[callProgressDetecting]','Failure',_0xaada('0x192')));}hopperUtils[_0xaada('0xce')](_0x12ad80,_0x3eb0ce[_0xaada('0xc0')],_0x1f03f7)[_0xaada('0xa1')](function(_0x2354c8){if(_0x2354c8['additional']==0x1)_0x2b9b41=!![];switch(_0x3eb0ce[_0xaada('0xc0')]){case'0':_0x1f03f7[_0xaada('0x193')]+=0x1;_0x12ad80['state']=0x0;_0x12ad80['statedesc']=_0xaada('0x194');_0x12ad80[_0xaada('0x116')]+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;ami['emit'](_0xaada('0x195'),ut[_0xaada('0x10d')](_0x4e0c30,_0xaada('0x196')));_0x32f1e4=_0x1f03f7[_0xaada('0x18c')];_0x54ea2f=_0x1f03f7[_0xaada('0xe0')];hopperUtils[_0xaada('0xc4')](_0x12ad80)[_0xaada('0x9f')](loggerCatch(_0xaada('0x112')));if(_0x4c0b09[_0xaada('0x197')](0x0,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80[_0xaada('0x116')]>=_0x1f03f7[_0xaada('0x18b')]){_0x4c0b09['createStateFinal'](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x198'));}else{_0x4c0b09['stateGlobal'](_0x12ad80,_0x30a2bc,_0x20d299,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1f03f7[_0xaada('0x199')]+=0x1;_0x12ad80[_0xaada('0x6c')]=0x3;_0x12ad80['statedesc']=_0xaada('0x19a');_0x12ad80[_0xaada('0x115')]+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;var _0x5a1407=ut[_0xaada('0x19b')](_0x4e0c30,_0x1f03f7);ami[_0xaada('0x3a')](_0xaada('0x19c'),_0x5a1407);_0x32f1e4=_0x1f03f7[_0xaada('0x19d')];_0x54ea2f=_0x1f03f7[_0xaada('0xe0')];hopperUtils[_0xaada('0xc4')](_0x12ad80)['catch'](loggerCatch(_0xaada('0x19e')));if(_0x4c0b09[_0xaada('0x197')](0x3,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80[_0xaada('0x115')]>=_0x1f03f7['dialNoAnswerMaxRetry']){_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x19f'));}else{_0x4c0b09[_0xaada('0x11a')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x19f'));}}break;case'5':_0x1f03f7[_0xaada('0x1a0')]+=0x1;_0x12ad80[_0xaada('0x6c')]=0x5;_0x12ad80[_0xaada('0x6d')]='Busy';_0x12ad80[_0xaada('0x113')]+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;ami[_0xaada('0x3a')]('custom:agentbusy',ut['buildObj'](_0x4e0c30,_0xaada('0x1a1')));_0x32f1e4=_0x1f03f7['dialBusyRetryFrequency'];_0x54ea2f=_0x1f03f7[_0xaada('0xe0')];hopperUtils[_0xaada('0xc4')](_0x12ad80)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4c0b09[_0xaada('0x197')](0x5,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80['countbusyretry']>=_0x1f03f7[_0xaada('0x1a2')]){_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1a3'));}else{_0x4c0b09[_0xaada('0x11a')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1a3'));}}break;case'8':_0x1f03f7[_0xaada('0x1a4')]+=0x1;_0x12ad80[_0xaada('0x6c')]=0x8;_0x12ad80[_0xaada('0x6d')]=_0xaada('0x1a5');_0x12ad80[_0xaada('0x114')]+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;_0x32f1e4=_0x1f03f7[_0xaada('0x189')];_0x54ea2f=_0x1f03f7[_0xaada('0xe0')];ami[_0xaada('0x3a')](_0xaada('0x1a6'),ut[_0xaada('0x10d')](_0x4e0c30,_0xaada('0x1a7')));hopperUtils['createHistory'](_0x12ad80)[_0xaada('0x9f')](loggerCatch(_0xaada('0x1a8')));if(_0x4c0b09[_0xaada('0x197')](0x8,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80[_0xaada('0x114')]>=_0x1f03f7[_0xaada('0x188')]){_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,'reason\x208\x20congestion');}else{_0x4c0b09[_0xaada('0x11a')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1a9'));}}break;case'11':_0x1f03f7[_0xaada('0x1aa')]+=0x1;_0x12ad80[_0xaada('0x6c')]=0xb;_0x12ad80[_0xaada('0x6d')]=_0xaada('0xdd');_0x12ad80[_0xaada('0xde')]+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;_0x32f1e4=_0x1f03f7[_0xaada('0xdf')];_0x54ea2f=_0x1f03f7['callAdditionalPhoneAfterMin'];hopperUtils[_0xaada('0xc4')](_0x12ad80)[_0xaada('0x9f')](loggerCatch(_0xaada('0x1ab')));if(_0x4c0b09[_0xaada('0x197')](0xb,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80[_0xaada('0xde')]>=_0x1f03f7['dialAbandonedMaxRetry']){_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1ac'));}else{_0x4c0b09[_0xaada('0x11a')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1ac'));}}break;case'20':_0x1f03f7['outboundRejectCallsDay']+=0x1;_0x12ad80[_0xaada('0x6c')]=0x14;_0x12ad80['statedesc']='AgentReject';_0x12ad80['countagentrejectretry']+=0x1;_0x12ad80[_0xaada('0xcd')]+=0x1;_0x32f1e4=_0x1f03f7[_0xaada('0x18f')];_0x54ea2f=_0x1f03f7['callAdditionalPhoneAfterMin'];ami[_0xaada('0x3a')](_0xaada('0x1ad'),ut[_0xaada('0x10d')](_0x4e0c30,'agentreject'));hopperUtils[_0xaada('0xc4')](_0x12ad80)[_0xaada('0x9f')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4c0b09[_0xaada('0x197')](0x14,_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80[_0xaada('0x118')]>=_0x1f03f7[_0xaada('0x1ae')]){_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1af'));}else{_0x4c0b09[_0xaada('0x11a')](_0x12ad80,_0x30a2bc,_0x20d299,_0xaada('0x1af'));}}break;default:_0x1f03f7[_0xaada('0x12b')]+=0x1;_0x12ad80['state']=0xc;_0x12ad80[_0xaada('0x6d')]=_0x3eb0ce[_0xaada('0xc0')];_0x32f1e4=_0x1f03f7[_0xaada('0x18f')];_0x54ea2f=_0x1f03f7[_0xaada('0xe0')];hopperUtils[_0xaada('0xc4')](_0x12ad80)['catch'](loggerCatch(_0xaada('0x1b0')));if(_0x4c0b09[_0xaada('0x197')](_0x3eb0ce['reason'],_0x4e0c30,_0x1f03f7)&&!_0x2b9b41){if(_0x12ad80['countbusyretry']+_0x12ad80[_0xaada('0x114')]+_0x12ad80['countnoanswerretry']+_0x12ad80[_0xaada('0x116')]+_0x12ad80[_0xaada('0xcc')]+_0x12ad80[_0xaada('0xde')]+_0x12ad80[_0xaada('0x117')]+_0x12ad80[_0xaada('0x118')]>=_0x1f03f7['dialGlobalMaxRetry']){_0x4c0b09['stateGlobal'](_0x12ad80,_0x30a2bc,_0x20d299,_0x3eb0ce[_0xaada('0xc0')]);}else{_0x4c0b09[_0xaada('0x11d')](_0x12ad80,_0x30a2bc,_0x20d299,_0x3eb0ce[_0xaada('0xc0')]);}}}})[_0xaada('0xa1')](function(){if(_0x2b9b41){hopperUtils[_0xaada('0x1b1')](_0x12ad80,_0x32f1e4,_0x54ea2f)['then'](function(){return _0x30a2bc(0x1);});}});});};Dialer[_0xaada('0x81')][_0xaada('0x11a')]=function(_0x30158a,_0x1a334f,_0x54583a,_0x387d8f){var _0x46cddb=new Final(_0x30158a);_0x46cddb[_0xaada('0x6c')]=0xf;_0x46cddb[_0xaada('0x6d')]=_0xaada('0x1b2');this[_0xaada('0x11d')](_0x46cddb,_0x1a334f,_0x54583a,_0x387d8f);};Dialer[_0xaada('0x81')][_0xaada('0x11d')]=function(_0x27f526,_0x55cfbe,_0x255309,_0x101ea9){hopperUtils[_0xaada('0xc5')](_0x27f526)[_0xaada('0xa1')](function(){return _0x55cfbe(msgResponse(_0xaada('0x190'),'Success',_0x101ea9));})['catch'](function(){return _0x255309(msgResponse(_0xaada('0x1b3'),_0xaada('0x8e'),_0xaada('0x1b4')));});};Dialer[_0xaada('0x81')][_0xaada('0x8')]=function(_0x3e9d20){var _0xf8bf24=_0x3e9d20['dialPredictiveOptimizationPercentage']/0x64;var _0x4d60f6=_0x3e9d20[_0xaada('0x1b5')]/(_0x3e9d20[_0xaada('0x1b5')]+_0x3e9d20[_0xaada('0xbf')]);var _0x58a82e=Math[_0xaada('0x1b6')](_0x3e9d20[_0xaada('0x1b7')]*(_0x3e9d20[_0xaada('0x1b8')]/0x64));var _0x43cb2c=Math[_0xaada('0x1b6')](_0x3e9d20[_0xaada('0x1b7')]*(_0x3e9d20[_0xaada('0x1b9')]/0x64));var _0x1c015c=_0x3e9d20[_0xaada('0x132')]+_0x3e9d20['talking'];var _0x363ff4=Math[_0xaada('0x1ba')](_0x3e9d20[_0xaada('0x54')]*_0x3e9d20['erlangAbandonmentRate']*_0x3e9d20['predictiveIntervalHitRate']*_0x3e9d20[_0xaada('0x1bb')]);if(_['isUndefined'](_0x3e9d20[_0xaada('0x23')])){if(!_[_0xaada('0x39')](_0x3e9d20[_0xaada('0x5d')])){_0x3e9d20[_0xaada('0x5d')]=undefined;loggerPredictive[_0xaada('0x61')](_0xaada('0x1bc'),_0xaada('0x1bd'));}if(!_[_0xaada('0x39')](_0x3e9d20[_0xaada('0x5f')])){loggerPredictive[_0xaada('0x61')](_0xaada('0x1bc'),_0xaada('0x1be'));clearInterval(_0x3e9d20[_0xaada('0x5f')]);_0x3e9d20[_0xaada('0x5f')]=undefined;}_0x3e9d20['startProgressive']=moment()[_0xaada('0x3e')](_0xaada('0xbc'));loggerPredictive[_0xaada('0x43')](_0x3e9d20['name'],'collection\x20data\x20in\x20progressive\x20at',_0x3e9d20[_0xaada('0x23')]);this[_0xaada('0xad')](_0x3e9d20,0x1);}else if(ifInterval(_0x3e9d20[_0xaada('0x1bf')],_0x3e9d20[_0xaada('0x23')])){this[_0xaada('0xad')](_0x3e9d20,0x1);loggerPredictiveCalls['info'](_0xaada('0x1c0'),_0x3e9d20[_0xaada('0x23')],_0x3e9d20[_0xaada('0x40')]);_0x3e9d20[_0xaada('0x54')]=0x0;_0x3e9d20['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xf8bf24<_0x4d60f6&&_0x3e9d20[_0xaada('0x1c1')]===_0xaada('0x1c2')){clearPredictiveAttributes(_0x3e9d20);loggerPredictive[_0xaada('0x43')](_0xaada('0x1c3'),_0xaada('0x1c4'),_0x4d60f6,_0xaada('0x23'),_0x3e9d20[_0xaada('0x40')]);}else if(_0x363ff4<_0x3e9d20[_0xaada('0xca')]&&_0x3e9d20[_0xaada('0x1c1')]===_0xaada('0x1c2')){clearPredictiveAttributes(_0x3e9d20);loggerPredictive['info'](_0xaada('0x1c5'),_0xaada('0x1c6'),_0x363ff4,_0xaada('0x1c7'),_0x3e9d20['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3e9d20[_0xaada('0x40')]);}else if(!ifInterval(_0x3e9d20[_0xaada('0x1bf')],_0x3e9d20[_0xaada('0x23')])&&_[_0xaada('0x39')](_0x3e9d20[_0xaada('0x5d')])&&!_[_0xaada('0x39')](_0x3e9d20[_0xaada('0x23')])){_0x3e9d20[_0xaada('0x5d')]=moment()['format'](_0xaada('0xbc'));loggerPredictive[_0xaada('0x43')](_0x3e9d20['name'],'started\x20in\x20predictive\x20at',_0x3e9d20['startPredictive']);hopperUtils[_0xaada('0x1c8')](_0x3e9d20[_0xaada('0x1bf')])[_0xaada('0xa1')](this[_0xaada('0x1c9')](_0x3e9d20))[_0xaada('0xa1')](mergeDataErlangB(_0x3e9d20))[_0xaada('0xa1')](this['startMethodPredictive'](_0x3e9d20))[_0xaada('0x9f')](loggerCatchPredictive(_0xaada('0x1ca'),_0x3e9d20));}else if(!ifInterval(_0x3e9d20[_0xaada('0x1bf')],_0x3e9d20['startPredictive'])){_0x3e9d20['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3e9d20[_0xaada('0x5d')]=moment()[_0xaada('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xaada('0x43')](_0x3e9d20[_0xaada('0x40')],_0xaada('0x1cb'),_0x3e9d20[_0xaada('0x5d')]);clearInterval(_0x3e9d20[_0xaada('0x5f')]);_0x3e9d20[_0xaada('0x5f')]=undefined;hopperUtils['avgHandleTime'](_0x3e9d20[_0xaada('0x1bf')])[_0xaada('0xa1')](this[_0xaada('0x1c9')](_0x3e9d20))[_0xaada('0xa1')](mergeDataErlangB(_0x3e9d20))['then'](this[_0xaada('0x1cc')](_0x3e9d20))[_0xaada('0x9f')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3e9d20));}else if(_0x3e9d20[_0xaada('0x1b7')]&&_0x1c015c<_0x3e9d20[_0xaada('0x1b7')]-_0x43cb2c){clearPredictiveAttributes(_0x3e9d20);loggerPredictive[_0xaada('0x43')](_0x3e9d20['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1c015c,_0xaada('0x1cd'),_0x3e9d20[_0xaada('0x1b7')],'-',_0x43cb2c,'=',_0x3e9d20['predictiveIntervalAvailable']-_0x43cb2c,')');}else if(_0x3e9d20[_0xaada('0x1b7')]&&_0x1c015c>_0x3e9d20[_0xaada('0x1b7')]+_0x58a82e){clearPredictiveAttributes(_0x3e9d20);loggerPredictive['info'](_0x3e9d20['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1c015c,_0xaada('0x1ce'),_0x3e9d20[_0xaada('0x1b7')],'+',_0x58a82e,'=',_0x3e9d20[_0xaada('0x1b7')]+_0x58a82e,')');}};Dialer[_0xaada('0x81')][_0xaada('0x1c9')]=function(_0x19e969){var _0x293c99=this;return function(_0x55b878){return new Promise(function(_0x2c2461,_0x568746){_[_0xaada('0x5a')](_0x19e969,_0x55b878[0x0]);if(checkGetDataPredictive(_0x55b878[0x0])){var _0x47dca6=_0x19e969[_0xaada('0x1b7')]=_0x19e969[_0xaada('0x133')]+_0x19e969[_0xaada('0x132')];var _0x122fd9=_0x19e969[_0xaada('0x1bf')]*0x3c;var _0x19aeb4=_0x55b878[0x0]['predictiveIntervalAvgTalktime']+_0x55b878[0x0]['predictiveIntervalAvgHoldtime'];var _0x115076=(_0x55b878[0x0]['predictiveIntervalAnsweredCalls']+_0x55b878[0x0][_0xaada('0x1cf')]+_0x55b878[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x55b878[0x0]['predictiveIntervalTotalCalls'];_0x19e969[_0xaada('0x1d0')]=_0x115076>0x0?_0x115076:0x1;switch(_0x19e969['dialPredictiveOptimization']){case'dropRate':var _0x334143=_0x19e969['dialPredictiveOptimizationPercentage']/0x64;return _0x293c99[_0xaada('0x1d1')](_0x47dca6,_0x122fd9,_0x19aeb4,_0x115076,_0x334143)[_0xaada('0xa1')](function(_0x27c978){return _0x2c2461(_0x27c978);});case _0xaada('0x1d2'):var _0x1e2730=_0x19e969['dialPredictiveOptimizationPercentage']/0x64;return _0x293c99[_0xaada('0x1d3')](_0x47dca6,_0x122fd9,_0x19aeb4,_0x115076,_0x1e2730)[_0xaada('0xa1')](function(_0x4fb2bc){return _0x2c2461(_0x4fb2bc);});default:return _0x568746(msgResponse(_0xaada('0x1d4'),_0xaada('0x8e'),_0xaada('0x1d5')));}}else{return _0x568746(msgResponse(_0xaada('0x1d4'),_0xaada('0x8e'),_0xaada('0x1d6')));}});};};Dialer[_0xaada('0x81')][_0xaada('0x1d7')]=function(_0x4af0bd){var _0x195c37=this;return function(_0x137a2b){return new Promise(function(_0xaddbb6,_0x3c8261){_[_0xaada('0x5a')](_0x4af0bd,_0x137a2b[0x0]);if(checkGetDataPredictive(_0x137a2b[0x0])){loggerPredictive[_0xaada('0x43')](JSON[_0xaada('0x80')](_0x137a2b[0x0]));if(_0x4af0bd['dialPredictiveOptimization']==='dropRate'){return _0x195c37[_0xaada('0x148')](_0x4af0bd['id'])['then'](function(_0x5ae534){var _0x48f042=_0x4af0bd[_0xaada('0x1d8')]-_0x5ae534[0x0][_0xaada('0x1d9')];var _0xec65b7=_0x4af0bd['dialPredictiveInterval']*0x3c;var _0xa9f5dc=_0x137a2b[0x0][_0xaada('0x4e')]+_0x137a2b[0x0][_0xaada('0x4c')];var _0x446ef9=(_0x137a2b[0x0][_0xaada('0x48')]+_0x137a2b[0x0][_0xaada('0x1cf')]+_0x137a2b[0x0][_0xaada('0x4b')])/_0x137a2b[0x0][_0xaada('0x46')];var _0x4d4460=_0x4af0bd[_0xaada('0x1da')]/0x64;_0x4af0bd[_0xaada('0x1db')]=_0x5ae534[0x0]['outboundQueuePauses']||0x0;_0x4af0bd[_0xaada('0x1d0')]=_0x446ef9>0x0?_0x446ef9:0x1;return _0x195c37[_0xaada('0x1d1')](_0x48f042,_0xec65b7,_0xa9f5dc,_0x446ef9,_0x4d4460);})[_0xaada('0xa1')](function(_0x52ec3c){return _0xaddbb6(_0x52ec3c);})['catch'](function(_0x379687){return _0x3c8261(msgResponse(_0xaada('0x1dc'),_0xaada('0x8e'),JSON[_0xaada('0x80')](_0x379687)));});}if(_0x4af0bd[_0xaada('0x1c1')]===_0xaada('0x1d2')){return _0x195c37[_0xaada('0x148')](_0x4af0bd['id'])[_0xaada('0xa1')](function(_0x507697){var _0xcab04f=_0x4af0bd['loggedIn']-_0x507697[0x0]['outboundQueuePauses'];var _0x40a848=_0x4af0bd[_0xaada('0x1bf')]*0x3c;var _0x49c56c=_0x137a2b[0x0][_0xaada('0x4e')]+_0x137a2b[0x0][_0xaada('0x4c')];var _0xa7f8b0=(_0x137a2b[0x0][_0xaada('0x48')]+_0x137a2b[0x0][_0xaada('0x1cf')]+_0x137a2b[0x0][_0xaada('0x4b')])/_0x137a2b[0x0][_0xaada('0x46')];var _0x3f3f47=_0x4af0bd[_0xaada('0x1da')]/0x64;_0x4af0bd[_0xaada('0x1db')]=_0x507697[0x0]['outboundQueuePauses']||0x0;_0x4af0bd[_0xaada('0x1d0')]=_0xa7f8b0>0x0?_0xa7f8b0:0x1;return _0x195c37[_0xaada('0x1d3')](_0xcab04f,_0x40a848,_0x49c56c,_0xa7f8b0,_0x3f3f47);})[_0xaada('0xa1')](function(_0x4b1ab5){return _0xaddbb6(_0x4b1ab5);})[_0xaada('0x9f')](function(_0x542cfe){return _0x3c8261(msgResponse(_0xaada('0x1dc'),_0xaada('0x8e'),JSON[_0xaada('0x80')](_0x542cfe)));});}}else{return _0x3c8261(msgResponse(_0xaada('0x1d4'),_0xaada('0x8e'),'check\x20failure'));}});};};Dialer[_0xaada('0x81')][_0xaada('0x1cc')]=function(_0x341054){var _0x4d0ff8=this;return function(){var _0x201172=0x0;var _0x3253b8=Math[_0xaada('0x1ba')](_0x341054[_0xaada('0x55')]*0x3e8);if(_0x3253b8>0x0){_0x3253b8=_0x3253b8<0x64?0x64:_0x3253b8;loggerPredictive['info'](_0x341054[_0xaada('0x40')],'one\x20call\x20every:',_0x3253b8,_0xaada('0x1dd'));_0x341054['handlePredictive']=setInterval(function(){_0x4d0ff8['handlePredictive'](_0x341054);loggerPredictiveCalls[_0xaada('0x43')](_0xaada('0x1de'),_0x201172+=0x1);},_0x3253b8);}else{loggerPredictive[_0xaada('0x43')](_0x341054[_0xaada('0x40')],_0xaada('0x1df'));}};};Dialer[_0xaada('0x81')][_0xaada('0x1e0')]=function(_0x4900d8,_0x1ae697){var _0x92a2f6=this;return function(_0x432f9e){if(_[_0xaada('0x42')](_0x432f9e)){if(_[_0xaada('0xea')](_0x1ae697[_0xaada('0x14f')])||!_0x1ae697['recallme']){if(_0x4900d8[_0xaada('0xab')]===_0xaada('0x7')){_0x4900d8[_0xaada('0x6f')]=_[_0xaada('0x39')](_0x4900d8['queueStatusComplete'])?!![]:_0x4900d8['queueStatusComplete'];var _0x420869=uuid['v4']();_0x92a2f6[_0xaada('0x21')][_0x420869]=new Action(_0x4900d8,_0x1ae697,_0x420869);loggerBooked[_0xaada('0x43')](_0xaada('0x1e1'),_0x420869,_0xaada('0x1e2'),JSON[_0xaada('0x80')](_0x4900d8[_0xaada('0x6f')]),_0xaada('0x1e3'),_0x4900d8[_0xaada('0x40')]);if(_0x4900d8[_0xaada('0x6f')]){_0x4900d8['queueStatusComplete']=![];_0x92a2f6[_0xaada('0xef')][_0x92a2f6['actions'][_0x420869][_0xaada('0xb8')]]=[];ami[_0xaada('0x98')]({'actionid':_0x420869,'action':'queuestatus','queue':_0x4900d8['name']})['catch'](function(){_0x92a2f6[_0xaada('0xbb')](_0x4900d8);hopperUtils[_0xaada('0xd2')]({'active':![],'ContactId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xd6')],'ListId':_0x92a2f6['actions'][_0x420869][_0xaada('0xd7')],'VoiceQueueId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xe2')]||undefined,'CampaignId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xd8')]||undefined})['catch'](loggerCatch(_0xaada('0x1e4')));delete _0x92a2f6[_0xaada('0x21')][_0x420869];});}else{loggerBooked[_0xaada('0x43')]('[booked][checkContactBlack][else]',JSON[_0xaada('0x80')](_0x4900d8[_0xaada('0x6f')]),_0xaada('0x1e3'),_0x4900d8[_0xaada('0x40')]);_0x92a2f6[_0xaada('0xbb')](_0x4900d8);hopperUtils[_0xaada('0xd2')]({'active':![],'ContactId':_0x92a2f6[_0xaada('0x21')][_0x420869]['ContactId'],'ListId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xd7')],'VoiceQueueId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xe2')]||undefined,'CampaignId':_0x92a2f6[_0xaada('0x21')][_0x420869][_0xaada('0xd8')]||undefined})[_0xaada('0x9f')](loggerCatch(_0xaada('0x1e4')));delete _0x92a2f6[_0xaada('0x21')][_0x420869];}}else{return _0x92a2f6['actionOriginate'](_0x4900d8,_0x1ae697);}}else{if(utils[_0xaada('0x5b')](undefined,_0x1ae697['scheduledat'])<_0x4900d8['dialRecallMeTimeout']*0x3c){if(_0x1ae697[_0xaada('0x13f')]&&!_0x1ae697[_0xaada('0x13f')][_0xaada('0x1e5')]){_0x92a2f6['preview']['run'](_0x1ae697['id'])[_0xaada('0xf3')](function(){_0x92a2f6['updateOriginated'](_0x4900d8);});}else{hopperUtils[_0xaada('0x1e6')]({'active':![]},_0x1ae697['id'],0x1)[_0xaada('0xf3')](function(){_0x92a2f6[_0xaada('0xbb')](_0x4900d8);});}}else{_0x4900d8[_0xaada('0x1e7')]+=0x1;_0x92a2f6[_0xaada('0xbb')](_0x4900d8);if(_0x4900d8[_0xaada('0x1e8')]){hopperUtils[_0xaada('0xd2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1ae697[_0xaada('0xd6')],'ListId':_0x1ae697[_0xaada('0xd7')],'VoiceQueueId':_0x1ae697[_0xaada('0xe2')]||undefined,'CampaignId':_0x1ae697[_0xaada('0xd8')]||undefined})['catch'](loggerCatch(_0xaada('0x1e9')));hopperUtils['createHistory'](createObjHistory(_0x4900d8,_0x1ae697,utils['CAMPAIGN_STATUS'][_0xaada('0x1ea')],0x17,_0xaada('0x1eb')))['catch'](loggerCatch(_0xaada('0x1ec')));}else{_0x92a2f6[_0xaada('0x10f')](createObjHistory(_0x4900d8,_0x1ae697,utils[_0xaada('0x6a')][_0xaada('0x1ed')],0x16,_0xaada('0x1ee')),_0xaada('0x1ef'),'[Originate][HistoryRecallClose]');}}}}else{_0x4900d8[_0xaada('0x1f0')]+=0x1;_0x92a2f6['saveInDb'](createObjHistory(_0x4900d8,_0x1ae697,utils[_0xaada('0x6a')][_0xaada('0x1f1')],0xd,'Blacklist'),_0xaada('0x1f2'),_0xaada('0x1f3'));throw _0xaada('0x1f4');}};};Dialer['prototype'][_0xaada('0x1f5')]=function(_0x1e5cd4){var _0x163289=this;var _0x258148=_0x1e5cd4[_0xaada('0x1f6')]-_0x1e5cd4[_0xaada('0x14a')]-_0x1e5cd4[_0xaada('0x1f7')];emitCampaignSummary(_0x1e5cd4);if(_0x258148>0x0){if(_0x258148>this[_0xaada('0x1f')]){_0x258148=this[_0xaada('0x1f')];}_0x1e5cd4[_0xaada('0x1f7')]+=_0x258148;hopperUtils[_0xaada('0x1f8')](_0x1e5cd4,_0x258148)[_0xaada('0xa1')](function(_0x4c1ccb){_0x1e5cd4['temp']-=_0x258148;_0x1e5cd4[_0xaada('0x1f7')]=_0x1e5cd4[_0xaada('0x1f7')]>0x0?_0x1e5cd4[_0xaada('0x1f7')]:0x0;if(!utils[_0xaada('0x1f9')](_0x4c1ccb)){_0x1e5cd4[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x1fa')];logger[_0xaada('0x43')](_0xaada('0x1fb')+_0x1e5cd4[_0xaada('0x40')]);}else{_0x1e5cd4[_0xaada('0x14a')]+=_0x4c1ccb['length'];_0x1e5cd4[_0xaada('0x66')]=utils[_0xaada('0x6a')]['RUNNING'];for(var _0x22ef97=0x0;_0x22ef97<_0x4c1ccb['length'];_0x22ef97+=0x1){_0x1e5cd4['ivrTotalCallsDays']+=0x1;if(_[_0xaada('0xea')](_0x4c1ccb[_0x22ef97])||_['isNil'](_0x4c1ccb[_0x22ef97][_0xaada('0x170')])||_[_0xaada('0xea')](_0x4c1ccb[_0x22ef97][_0xaada('0x158')])){_0x163289[_0xaada('0x14d')]('[actionOriginate]\x20',_0x1e5cd4,_0x4c1ccb[_0x22ef97]);}else{hopperUtils[_0xaada('0x1fc')](_[_0xaada('0x70')](_0x4c1ccb[_0x22ef97],['CampaignId',_0xaada('0x158')]))[_0xaada('0xa1')](_0x163289[_0xaada('0x1e0')](_0x1e5cd4,_0x4c1ccb[_0x22ef97]))[_0xaada('0x9f')](_0x163289[_0xaada('0x14c')]('[actionOriginateIvr]\x20',_0x1e5cd4));}}}})[_0xaada('0x9f')](loggerGetContactDialer(_0xaada('0x1fd'),_0x1e5cd4,_0x258148));}};Dialer[_0xaada('0x81')][_0xaada('0xad')]=function(_0x3b0153,_0x2f8994){var _0x2a23d9=this;var _0x438d84=[];if(_0x2f8994<0x1||_0x3b0153['dialMethod']===_0xaada('0x7')){_0x2f8994=0x1;}var _0x2e635e=Math[_0xaada('0x1ba')](_0x3b0153[_0xaada('0x132')]*_0x2f8994)-_0x3b0153[_0xaada('0x14a')]-_0x3b0153['temp'];if(_0x3b0153[_0xaada('0x1fe')]>0x0){var _0x546ffb=_0x3b0153[_0xaada('0x1fe')]-_0x3b0153[_0xaada('0x14a')]-_0x3b0153[_0xaada('0x133')]-_0x3b0153['temp']-_0x3b0153[_0xaada('0x134')];if(_0x2e635e>_0x546ffb){_0x2e635e=_0x546ffb;}}if(_0x2e635e>0x0){if(_0x3b0153[_0xaada('0xab')]===_0xaada('0x7')){_0x2e635e=0x1;}if(_0x2e635e>this[_0xaada('0x1f')]){_0x2e635e=this[_0xaada('0x1f')];}_0x3b0153[_0xaada('0x1f7')]+=_0x2e635e;for(var _0x4cb2f2 in this['agents']){if(typeof this[_0xaada('0xed')][_0x4cb2f2]!==_0xaada('0x14b')){if(this[_0xaada('0xed')][_0x4cb2f2][_0xaada('0x6c')]===_0xaada('0x1ff')&&this[_0xaada('0xed')][_0x4cb2f2][_0xaada('0x85')]===_0xaada('0x13c')){_0x438d84[_0xaada('0xa0')](this['agents'][_0x4cb2f2]['id']);}}}hopperUtils['getContactDialer'](_0x3b0153,_0x438d84,_0x2e635e)[_0xaada('0xa1')](function(_0x1b7285){_0x3b0153[_0xaada('0x1f7')]-=_0x2e635e;_0x3b0153[_0xaada('0x1f7')]=_0x3b0153[_0xaada('0x1f7')]>0x0?_0x3b0153['temp']:0x0;if(!utils['checkContactEmpty'](_0x1b7285)){hopperUtils['countReScheduled'](_0x3b0153)[_0xaada('0xa1')](sendMessageReschedule(_0x3b0153))[_0xaada('0x9f')](loggerCatch(_0xaada('0x200')));}else{_0x3b0153['originated']+=_0x1b7285[_0xaada('0x97')];_0x3b0153[_0xaada('0x66')]=_0x3b0153[_0xaada('0xab')]===_0xaada('0x7')?utils[_0xaada('0x6a')][_0xaada('0x135')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x58f2ab=0x0;_0x58f2ab<_0x1b7285[_0xaada('0x97')];_0x58f2ab+=0x1){if(_[_0xaada('0xea')](_0x1b7285[_0x58f2ab])||_[_0xaada('0xea')](_0x1b7285[_0x58f2ab][_0xaada('0x170')])||_[_0xaada('0xea')](_0x1b7285[_0x58f2ab]['phone'])){_0x2a23d9[_0xaada('0x14d')]('[actionOriginate]\x20',_0x3b0153,_0x1b7285[_0x58f2ab]);}else{hopperUtils['checkIsBlackList'](_[_0xaada('0x70')](_0x1b7285[_0x58f2ab],[_0xaada('0xe2'),_0xaada('0x158')]))[_0xaada('0xa1')](_0x2a23d9[_0xaada('0x1e0')](_0x3b0153,_0x1b7285[_0x58f2ab]))[_0xaada('0x9f')](_0x2a23d9['loggerHandler']('[actionOriginate]\x20',_0x3b0153));}}}})[_0xaada('0x9f')](loggerGetContactDialer('[getContactDialer2]',_0x3b0153,_0x2e635e));}};Dialer[_0xaada('0x81')][_0xaada('0x5f')]=function(_0xafe8ff){if(_0xafe8ff[_0xaada('0x1fe')]>0x0){var _0x3c1592=_0xafe8ff['dialLimitQueue']-_0xafe8ff[_0xaada('0x14a')]-_0xafe8ff[_0xaada('0x133')];if(_0x3c1592>0x0){this[_0xaada('0x201')](_0xafe8ff);}else{loggerPredictiveCalls[_0xaada('0x43')](_0xaada('0x202'));}}else{this[_0xaada('0x201')](_0xafe8ff);}};Dialer['prototype'][_0xaada('0x201')]=function(_0xcb1604){var _0x4507ee=this;var _0x30c0c5=[];_0xcb1604['originated']+=0x1;for(var _0x55df91 in this['agents']){if(typeof this['agents'][_0x55df91]!==_0xaada('0x14b')){if(this[_0xaada('0xed')][_0x55df91][_0xaada('0x6c')]===_0xaada('0x1ff')&&this[_0xaada('0xed')][_0x55df91][_0xaada('0x85')]===_0xaada('0x13c')){_0x30c0c5[_0xaada('0xa0')](this[_0xaada('0xed')][_0x55df91]['id']);}}}return this[_0xaada('0x203')](_0xcb1604['id'],_0x30c0c5,0x1,_0xcb1604['dialOrderByScheduledAt'],_0xcb1604)['then'](function(_0x4e0a4a){if(!utils[_0xaada('0x1f9')](_0x4e0a4a)){utils['checkContactLowerLimitOriginate'](_0xcb1604,0x1,0x0);return hopperUtils[_0xaada('0x204')](_0xcb1604)[_0xaada('0xa1')](sendMessageReschedule(_0xcb1604))[_0xaada('0x9f')](loggerCatch(_0xaada('0x200')));}else{_0xcb1604[_0xaada('0x66')]=utils[_0xaada('0x6a')][_0xaada('0x205')];if(_[_0xaada('0xea')](_0x4e0a4a[0x0])||_[_0xaada('0xea')](_0x4e0a4a[0x0][_0xaada('0x170')])||_['isNil'](_0x4e0a4a[0x0][_0xaada('0x158')])){_0x4507ee[_0xaada('0x14d')](_0xaada('0x206'),_0xcb1604,_0x4e0a4a[0x0]);}else{return hopperUtils[_0xaada('0x207')](_['pick'](_0x4e0a4a[0x0],['VoiceQueueId','phone']))[_0xaada('0xa1')](_0x4507ee['checkContactBlack'](_0xcb1604,_0x4e0a4a[0x0]))[_0xaada('0x9f')](_0x4507ee[_0xaada('0x14c')](_0xaada('0x208'),_0xcb1604));}}})['catch'](loggerGetContactDialer(_0xaada('0x209'),_0xcb1604,0x1));};Dialer[_0xaada('0x81')][_0xaada('0x1d1')]=function(_0x5f1504,_0x3bddcd,_0x1983dc,_0x4d13fe,_0x3d3fd6,_0x49011b){loggerPredictive['info'](_0xaada('0x20a'));loggerPredictive[_0xaada('0x43')](_0xaada('0x20b'),_0x5f1504);loggerPredictive['info'](_0xaada('0x20c'),_0x3bddcd);loggerPredictive[_0xaada('0x43')](_0xaada('0x20d'),_0x1983dc);loggerPredictive[_0xaada('0x43')](_0xaada('0x20e'),_0x4d13fe);loggerPredictive['info'](_0xaada('0x20f'),_0x3d3fd6);loggerPredictive[_0xaada('0x43')](_0xaada('0x4f'));return new Promise(function(_0xee45e,_0x3f86b4){if(_0x5f1504<=0x0||isNaN(_0x5f1504)){return _0x3f86b4(msgResponse(_0xaada('0x210'),_0xaada('0x7f'),_0xaada('0x211')+_0x5f1504));}if(_0x1983dc<=0x0||isNaN(_0x1983dc)){return _0x3f86b4(msgResponse('[abandonmentRate]','Error',_0xaada('0x212')+_0x1983dc));}if(_0x4d13fe<=0x0||isNaN(_0x4d13fe)){return _0x3f86b4(msgResponse('[abandonmentRate]',_0xaada('0x7f'),_0xaada('0x213')+_0x4d13fe));}if(_0x3bddcd<=0x0||isNaN(_0x3bddcd)){return _0x3f86b4(msgResponse(_0xaada('0x210'),'Error',_0xaada('0x214')+_0x3bddcd));}if(_0x3d3fd6<=0x0||isNaN(_0x3d3fd6)){return _0x3f86b4(msgResponse(_0xaada('0x210'),_0xaada('0x7f'),'Amax\x20=\x20'+_0x3d3fd6));}_0x49011b=_0x49011b||0x0;var _0xf0f67b=0x1/_0x1983dc;var _0x5e3c33=0x0;var _0x4c4abb=0x0;var _0x19ab74=0x0;var _0x5d132d=0x0;for(var _0x1a6ad3=0x0;_0x19ab74<_0x3d3fd6;_0x1a6ad3+=0x1){_0x4c4abb=_0x1a6ad3/_0x3bddcd;_0x5e3c33=(_0x4d13fe*_0x4c4abb+_0x49011b)/_0xf0f67b;_0x19ab74=utils['erlangb'](_0x5e3c33,_0x5f1504);_0x5d132d=_0x5e3c33/_0x5f1504*(0x1-utils['erlangb'](_0x5e3c33,_0x5f1504));}return _0xee45e({'erlangCalls':_0x1a6ad3,'erlangCallToSecond':_0x3bddcd/_0x1a6ad3,'erlangAbandonmentRate':_0x19ab74,'erlangBusyFactor':_0x5d132d});});};Dialer[_0xaada('0x81')][_0xaada('0x1d3')]=function(_0x4bcc4b,_0x512264,_0x3d4253,_0x188cb3,_0x1e524d,_0x34baa1){loggerPredictive['info'](_0xaada('0x215'));loggerPredictive['info'](_0xaada('0x20b'),_0x4bcc4b);loggerPredictive[_0xaada('0x43')](_0xaada('0x20c'),_0x512264);loggerPredictive[_0xaada('0x43')](_0xaada('0x20d'),_0x3d4253);loggerPredictive[_0xaada('0x43')](_0xaada('0x20e'),_0x188cb3);loggerPredictive[_0xaada('0x43')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e524d);loggerPredictive[_0xaada('0x43')]('---------------------------');return new Promise(function(_0x3717fd,_0x4cc77b){if(_0x4bcc4b<=0x0||isNaN(_0x4bcc4b)){return _0x4cc77b(msgResponse(_0xaada('0x216'),'Error',_0xaada('0x211')+_0x4bcc4b));}if(_0x3d4253<=0x0||isNaN(_0x3d4253)){return _0x4cc77b(msgResponse('[busyFactor]',_0xaada('0x7f'),'Ts\x20=\x20'+_0x3d4253));}if(_0x188cb3<=0x0||isNaN(_0x188cb3)){return _0x4cc77b(msgResponse(_0xaada('0x216'),_0xaada('0x7f'),'p\x20=\x20'+_0x188cb3));}if(_0x512264<=0x0||isNaN(_0x512264)){return _0x4cc77b(msgResponse('[busyFactor]','Error',_0xaada('0x214')+_0x512264));}if(_0x1e524d<=0x0||isNaN(_0x1e524d)){return _0x4cc77b(msgResponse(_0xaada('0x216'),_0xaada('0x7f'),_0xaada('0x217')+_0x1e524d));}_0x34baa1=_0x34baa1||0x0;var _0x4cbc0e=0x1/_0x3d4253;var _0x1f014e=0x0;var _0x1b6416=0x0;var _0x29ff8a=0x0;var _0x16ebfe=0x0;for(var _0x2955f9=0x0;_0x16ebfe<_0x1e524d;_0x2955f9+=0x1){_0x1b6416=_0x2955f9/_0x512264;_0x1f014e=(_0x188cb3*_0x1b6416+_0x34baa1)/_0x4cbc0e;_0x29ff8a=utils['erlangb'](_0x1f014e,_0x4bcc4b);_0x16ebfe=_0x1f014e/_0x4bcc4b*(0x1-utils['erlangb'](_0x1f014e,_0x4bcc4b));}return _0x3717fd({'erlangCalls':_0x2955f9,'erlangCallToSecond':_0x512264/_0x2955f9,'erlangAbandonmentRate':_0x29ff8a,'erlangBusyFactor':_0x16ebfe});});};module[_0xaada('0x218')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index c5ae9a6..40950db 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2650=['phone','firstName','lastName','number','queue','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller','substring','dialCutDigit','prototype','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact'];(function(_0x1865d4,_0x569a81){var _0x1f0e1c=function(_0x57887d){while(--_0x57887d){_0x1865d4['push'](_0x1865d4['shift']());}};_0x1f0e1c(++_0x569a81);}(_0x2650,0x158));var _0x0265=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2650[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x0265('0x0'));var _=require('lodash');var moment=require(_0x0265('0x1'));function checkNameSurname(_0x35c84d,_0x23091a,_0x1d6e8f){var _0x4a3003='';if(!_[_0x0265('0x2')](_0x23091a)&&_0x0265('0x3')===typeof _0x23091a){_0x4a3003+=_0x23091a;}if(!_[_0x0265('0x2')](_0x1d6e8f)&&'string'===typeof _0x1d6e8f){_0x4a3003+='\x20'+_0x1d6e8f;}if(_0x4a3003!==''){return _0x4a3003;}return _0x35c84d;}function Action(_0x4781b6,_0x148160,_0x5b538b){this[_0x0265('0x4')]=_0x4781b6;this[_0x0265('0x5')]=_0x5b538b||undefined;this[_0x0265('0x6')]=checkNameSurname(_0x148160[_0x0265('0x7')][_0x0265('0x8')],_0x148160[_0x0265('0x7')][_0x0265('0x9')],_0x148160[_0x0265('0x7')][_0x0265('0xa')]);this[_0x0265('0xb')]=_0x148160[_0x0265('0x8')];this[_0x0265('0xc')]=_0x4781b6[_0x0265('0x6')];this['active']=_0x148160['active']||![];this['type']=_0x4781b6['type'];this[_0x0265('0xd')]=_0x4781b6[_0x0265('0xd')]||0x3;this[_0x0265('0xe')]=_0x148160['scheduledat'];this[_0x0265('0xf')]=_0x148160['countbusyretry'];this[_0x0265('0x10')]=_0x148160[_0x0265('0x10')];this[_0x0265('0x11')]=_0x148160[_0x0265('0x11')];this[_0x0265('0x12')]=_0x148160['countnosuchnumberretry'];this[_0x0265('0x13')]=_0x148160['countdropretry'];this[_0x0265('0x14')]=_0x148160[_0x0265('0x14')];this[_0x0265('0x15')]=_0x148160[_0x0265('0x15')];this[_0x0265('0x16')]=_0x148160[_0x0265('0x16')];this[_0x0265('0x17')]=_0x148160[_0x0265('0x17')];this['ListId']=_0x148160[_0x0265('0x18')];this[_0x0265('0x19')]=_0x148160[_0x0265('0x19')];this['VoiceQueueId']=_0x148160[_0x0265('0x1a')];this[_0x0265('0x1b')]=_0x148160['CampaignId'];this[_0x0265('0x1c')]=_0x148160['id'];this[_0x0265('0x1d')]=_0x148160[_0x0265('0x7')][_0x0265('0x9')]||'';this[_0x0265('0x1e')]=moment()[_0x0265('0x1f')](_0x0265('0x20'));this[_0x0265('0x21')]=_0x148160[_0x0265('0x21')];this[_0x0265('0x22')]=_0x148160[_0x0265('0x22')];this[_0x0265('0x23')]=_0x148160[_0x0265('0x23')];this['recallme']=_0x148160['recallme'];this[_0x0265('0x24')]='';this[_0x0265('0x25')]='';}Action['prototype'][_0x0265('0x26')]=function(){return util[_0x0265('0x1f')]('\x22%s\x22\x20<%s>',this[_0x0265('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x0265('0xb')][_0x0265('0x27')](this[_0x0265('0x4')][_0x0265('0x28')]):this[_0x0265('0xb')]);};Action[_0x0265('0x29')][_0x0265('0x2a')]=function(){return this[_0x0265('0xc')];};module[_0x0265('0x2b')]=Action; \ No newline at end of file +var _0xbb19=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','voiceQueue','dialCutDigit','substring','prototype','getQueue','exports','lodash','moment','isNil','string','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName'];(function(_0x3ab164,_0x2fa5e9){var _0x39565e=function(_0x40dfe8){while(--_0x40dfe8){_0x3ab164['push'](_0x3ab164['shift']());}};_0x39565e(++_0x2fa5e9);}(_0xbb19,0x1db));var _0x9bb1=function(_0x4ce0c8,_0x3a4182){_0x4ce0c8=_0x4ce0c8-0x0;var _0x153cce=_0xbb19[_0x4ce0c8];return _0x153cce;};'use strict';var util=require('util');var _=require(_0x9bb1('0x0'));var moment=require(_0x9bb1('0x1'));function checkNameSurname(_0x2d7b34,_0xb7771e,_0x251191){var _0x4b1f4e='';if(!_[_0x9bb1('0x2')](_0xb7771e)&&_0x9bb1('0x3')===typeof _0xb7771e){_0x4b1f4e+=_0xb7771e;}if(!_[_0x9bb1('0x2')](_0x251191)&&_0x9bb1('0x3')===typeof _0x251191){_0x4b1f4e+='\x20'+_0x251191;}if(_0x4b1f4e!==''){return _0x4b1f4e;}return _0x2d7b34;}function Action(_0x490e3e,_0x3859e1,_0x27ee9e){this['voiceQueue']=_0x490e3e;this[_0x9bb1('0x4')]=_0x27ee9e||undefined;this[_0x9bb1('0x5')]=checkNameSurname(_0x3859e1['Contact'][_0x9bb1('0x6')],_0x3859e1[_0x9bb1('0x7')]['firstName'],_0x3859e1[_0x9bb1('0x7')][_0x9bb1('0x8')]);this[_0x9bb1('0x9')]=_0x3859e1['phone'];this[_0x9bb1('0xa')]=_0x490e3e['name'];this[_0x9bb1('0xb')]=_0x3859e1[_0x9bb1('0xb')]||![];this[_0x9bb1('0xc')]=_0x490e3e[_0x9bb1('0xc')];this['dialQueueTimeout']=_0x490e3e[_0x9bb1('0xd')]||0x3;this[_0x9bb1('0xe')]=_0x3859e1[_0x9bb1('0xe')];this[_0x9bb1('0xf')]=_0x3859e1[_0x9bb1('0xf')];this[_0x9bb1('0x10')]=_0x3859e1[_0x9bb1('0x10')];this[_0x9bb1('0x11')]=_0x3859e1['countnoanswerretry'];this['countnosuchnumberretry']=_0x3859e1[_0x9bb1('0x12')];this[_0x9bb1('0x13')]=_0x3859e1[_0x9bb1('0x13')];this[_0x9bb1('0x14')]=_0x3859e1[_0x9bb1('0x14')];this[_0x9bb1('0x15')]=_0x3859e1[_0x9bb1('0x15')];this[_0x9bb1('0x16')]=_0x3859e1['countagentrejectretry'];this['ContactId']=_0x3859e1[_0x9bb1('0x17')];this[_0x9bb1('0x18')]=_0x3859e1['ListId'];this['UserId']=_0x3859e1[_0x9bb1('0x19')];this[_0x9bb1('0x1a')]=_0x3859e1[_0x9bb1('0x1a')];this[_0x9bb1('0x1b')]=_0x3859e1['CampaignId'];this[_0x9bb1('0x1c')]=_0x3859e1['id'];this[_0x9bb1('0x1d')]=_0x3859e1[_0x9bb1('0x7')][_0x9bb1('0x1e')]||'';this[_0x9bb1('0x1f')]=moment()[_0x9bb1('0x20')](_0x9bb1('0x21'));this[_0x9bb1('0x22')]=_0x3859e1[_0x9bb1('0x22')];this[_0x9bb1('0x23')]=_0x3859e1[_0x9bb1('0x23')];this[_0x9bb1('0x24')]=_0x3859e1[_0x9bb1('0x24')];this[_0x9bb1('0x25')]=_0x3859e1['recallme'];this[_0x9bb1('0x26')]='';this[_0x9bb1('0x27')]='';}Action['prototype']['getCaller']=function(){return util[_0x9bb1('0x20')]('\x22%s\x22\x20<%s>',this[_0x9bb1('0x5')],this[_0x9bb1('0x28')][_0x9bb1('0x29')]>0x0?this[_0x9bb1('0x9')][_0x9bb1('0x2a')](this[_0x9bb1('0x28')][_0x9bb1('0x29')]):this[_0x9bb1('0x9')]);};Action[_0x9bb1('0x2b')][_0x9bb1('0x2c')]=function(){return this[_0x9bb1('0xa')];};module[_0x9bb1('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 8bf6996..fbaba9e 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c5a=['countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','moment','../utils','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry'];(function(_0x62acd5,_0x4ddb49){var _0x227ab4=function(_0x24fb97){while(--_0x24fb97){_0x62acd5['push'](_0x62acd5['shift']());}};_0x227ab4(++_0x4ddb49);}(_0x5c5a,0xc3));var _0xa5c5=function(_0x1440e3,_0x13b435){_0x1440e3=_0x1440e3-0x0;var _0x7931b6=_0x5c5a[_0x1440e3];return _0x7931b6;};'use strict';var moment=require(_0xa5c5('0x0'));var utils=require(_0xa5c5('0x1'));function AgentComplete(_0x3661ff,_0x1fb422){this['state']=0x4;this['statedesc']=_0xa5c5('0x2');this[_0xa5c5('0x3')]=_0x3661ff['scheduledat'];this[_0xa5c5('0x4')]=_0x3661ff[_0xa5c5('0x4')];this[_0xa5c5('0x5')]=_0x3661ff[_0xa5c5('0x4')]===_0xa5c5('0x6')?_0xa5c5('0x7'):_0x3661ff[_0xa5c5('0x4')];this[_0xa5c5('0x8')]=_0x3661ff['countbusyretry'];this['countcongestionretry']=_0x3661ff[_0xa5c5('0x9')];this[_0xa5c5('0xa')]=_0x3661ff['countnoanswerretry'];this[_0xa5c5('0xb')]=_0x3661ff[_0xa5c5('0x8')]+_0x3661ff[_0xa5c5('0x9')]+_0x3661ff[_0xa5c5('0xa')]+_0x3661ff[_0xa5c5('0xc')]+_0x3661ff[_0xa5c5('0xd')]+_0x3661ff['countabandonedretry']+_0x3661ff[_0xa5c5('0xe')]+_0x3661ff[_0xa5c5('0xf')];this[_0xa5c5('0xc')]=_0x3661ff[_0xa5c5('0xc')];this['countdropretry']=_0x3661ff[_0xa5c5('0xd')];this[_0xa5c5('0x10')]=_0x3661ff[_0xa5c5('0x10')];this['countmachineretry']=_0x3661ff['countmachineretry'];this[_0xa5c5('0xf')]=_0x3661ff[_0xa5c5('0xf')];this[_0xa5c5('0x11')]=_0x1fb422[_0xa5c5('0x11')];this[_0xa5c5('0x12')]=_0x3661ff[_0xa5c5('0x13')];this['calleridnum']=_0x3661ff[_0xa5c5('0x14')];this[_0xa5c5('0x15')]=_0x3661ff[_0xa5c5('0x15')];this['responsetime']=_0x3661ff[_0xa5c5('0x16')];this[_0xa5c5('0x17')]=_0x3661ff[_0xa5c5('0x17')];this[_0xa5c5('0x18')]=moment()[_0xa5c5('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa5c5('0x1a')]=utils[_0xa5c5('0x1b')](_0x3661ff['responsetime'],_0x3661ff[_0xa5c5('0x15')]);this[_0xa5c5('0x1c')]=utils[_0xa5c5('0x1b')](_0x3661ff[_0xa5c5('0x17')],_0x3661ff[_0xa5c5('0x16')]);this['talktime']=utils['getSeconds'](this[_0xa5c5('0x18')],_0x3661ff[_0xa5c5('0x17')]);this[_0xa5c5('0x7')]=_0x1fb422[_0xa5c5('0x7')];this[_0xa5c5('0x1d')]=_0x1fb422[_0xa5c5('0x1d')];this['reason']=_0x1fb422[_0xa5c5('0x1e')];this[_0xa5c5('0x1f')]=_0x3661ff['callback'];this[_0xa5c5('0x20')]=_0x3661ff[_0xa5c5('0x20')];this[_0xa5c5('0x21')]=_0x3661ff[_0xa5c5('0x21')];this['recallme']=_0x3661ff[_0xa5c5('0x22')];this[_0xa5c5('0x23')]=_0x3661ff[_0xa5c5('0x23')];this[_0xa5c5('0x24')]=_0x3661ff[_0xa5c5('0x24')];this['UserId']=_0x3661ff[_0xa5c5('0x25')];this[_0xa5c5('0x26')]=_0x3661ff[_0xa5c5('0x26')];this['CampaignId']=_0x3661ff[_0xa5c5('0x27')];this['originatecalleridnum']=_0x3661ff['originatecalleridnum']||'';this[_0xa5c5('0x28')]=_0x3661ff[_0xa5c5('0x28')]||'';this[_0xa5c5('0x29')]=_0x3661ff[_0xa5c5('0x29')];}module['exports']=AgentComplete; \ No newline at end of file +var _0x9842=['Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','moment','../utils','state'];(function(_0x2c234a,_0x4fc673){var _0x28bf8d=function(_0x5b377f){while(--_0x5b377f){_0x2c234a['push'](_0x2c234a['shift']());}};_0x28bf8d(++_0x4fc673);}(_0x9842,0x14d));var _0x2984=function(_0x128755,_0xc5b8d3){_0x128755=_0x128755-0x0;var _0x435d11=_0x9842[_0x128755];return _0x435d11;};'use strict';var moment=require(_0x2984('0x0'));var utils=require(_0x2984('0x1'));function AgentComplete(_0x21bdaa,_0x38feae){this[_0x2984('0x2')]=0x4;this['statedesc']=_0x2984('0x3');this[_0x2984('0x4')]=_0x21bdaa[_0x2984('0x4')];this[_0x2984('0x5')]=_0x21bdaa[_0x2984('0x5')];this[_0x2984('0x6')]=_0x21bdaa[_0x2984('0x5')]==='outbound'?_0x2984('0x7'):_0x21bdaa[_0x2984('0x5')];this[_0x2984('0x8')]=_0x21bdaa[_0x2984('0x8')];this[_0x2984('0x9')]=_0x21bdaa['countcongestionretry'];this[_0x2984('0xa')]=_0x21bdaa[_0x2984('0xa')];this[_0x2984('0xb')]=_0x21bdaa['countbusyretry']+_0x21bdaa[_0x2984('0x9')]+_0x21bdaa['countnoanswerretry']+_0x21bdaa['countnosuchnumberretry']+_0x21bdaa['countdropretry']+_0x21bdaa['countabandonedretry']+_0x21bdaa[_0x2984('0xc')]+_0x21bdaa[_0x2984('0xd')];this['countnosuchnumberretry']=_0x21bdaa[_0x2984('0xe')];this[_0x2984('0xf')]=_0x21bdaa[_0x2984('0xf')];this[_0x2984('0x10')]=_0x21bdaa['countabandonedretry'];this[_0x2984('0xc')]=_0x21bdaa[_0x2984('0xc')];this['countagentrejectretry']=_0x21bdaa[_0x2984('0xd')];this[_0x2984('0x11')]=_0x38feae[_0x2984('0x11')];this[_0x2984('0x12')]=_0x21bdaa[_0x2984('0x13')];this[_0x2984('0x14')]=_0x21bdaa[_0x2984('0x15')];this[_0x2984('0x16')]=_0x21bdaa[_0x2984('0x16')];this[_0x2984('0x17')]=_0x21bdaa[_0x2984('0x17')];this['answertime']=_0x21bdaa[_0x2984('0x18')];this[_0x2984('0x19')]=moment()['format'](_0x2984('0x1a'));this[_0x2984('0x1b')]=utils[_0x2984('0x1c')](_0x21bdaa[_0x2984('0x17')],_0x21bdaa['starttime']);this[_0x2984('0x1d')]=utils[_0x2984('0x1c')](_0x21bdaa[_0x2984('0x18')],_0x21bdaa[_0x2984('0x17')]);this[_0x2984('0x1e')]=utils[_0x2984('0x1c')](this[_0x2984('0x19')],_0x21bdaa[_0x2984('0x18')]);this[_0x2984('0x7')]=_0x38feae[_0x2984('0x7')];this['membername']=_0x38feae['membername'];this['reason']=_0x38feae[_0x2984('0x1f')];this[_0x2984('0x20')]=_0x21bdaa['callback'];this[_0x2984('0x21')]=_0x21bdaa[_0x2984('0x21')];this['callbackat']=_0x21bdaa[_0x2984('0x22')];this['recallme']=_0x21bdaa['recallme'];this[_0x2984('0x23')]=_0x21bdaa['ContactId'];this['ListId']=_0x21bdaa[_0x2984('0x24')];this[_0x2984('0x25')]=_0x21bdaa[_0x2984('0x25')];this['VoiceQueueId']=_0x21bdaa[_0x2984('0x26')];this[_0x2984('0x27')]=_0x21bdaa['CampaignId'];this['originatecalleridnum']=_0x21bdaa['originatecalleridnum']||'';this[_0x2984('0x28')]=_0x21bdaa['originatecalleridname']||'';this['agiafterat']=_0x21bdaa[_0x2984('0x29')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 447799c..a8e2b87 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfec1=['ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x158212,_0x4d11de){var _0x47db15=function(_0x205750){while(--_0x205750){_0x158212['push'](_0x158212['shift']());}};_0x47db15(++_0x4d11de);}(_0xfec1,0xe8));var _0x1fec=function(_0x463b6f,_0x3c8a37){_0x463b6f=_0x463b6f-0x0;var _0x1b0162=_0xfec1[_0x463b6f];return _0x1b0162;};'use strict';function Final(_0x3b51a8){this[_0x1fec('0x0')]=_0x3b51a8['uniqueid'];this[_0x1fec('0x1')]=_0x3b51a8[_0x1fec('0x1')];this[_0x1fec('0x2')]=_0x3b51a8[_0x1fec('0x2')];this[_0x1fec('0x3')]=_0x3b51a8[_0x1fec('0x2')]===_0x1fec('0x4')?'queue':_0x3b51a8[_0x1fec('0x2')];this['countbusyretry']=_0x3b51a8[_0x1fec('0x5')];this[_0x1fec('0x6')]=_0x3b51a8['countcongestionretry'];this[_0x1fec('0x7')]=_0x3b51a8[_0x1fec('0x7')];this[_0x1fec('0x8')]=_0x3b51a8[_0x1fec('0x5')]+_0x3b51a8[_0x1fec('0x6')]+_0x3b51a8[_0x1fec('0x7')]+_0x3b51a8[_0x1fec('0x9')]+_0x3b51a8['countdropretry']+_0x3b51a8[_0x1fec('0xa')]+_0x3b51a8[_0x1fec('0xb')]+_0x3b51a8[_0x1fec('0xc')];this['countnosuchnumberretry']=_0x3b51a8[_0x1fec('0x9')];this[_0x1fec('0xd')]=_0x3b51a8[_0x1fec('0xd')];this[_0x1fec('0xa')]=_0x3b51a8[_0x1fec('0xa')];this[_0x1fec('0xb')]=_0x3b51a8['countmachineretry'];this[_0x1fec('0xc')]=_0x3b51a8[_0x1fec('0xc')];this['queue']=_0x3b51a8[_0x1fec('0xe')];this[_0x1fec('0xf')]=_0x3b51a8[_0x1fec('0xf')];this[_0x1fec('0x10')]=_0x3b51a8[_0x1fec('0x10')];this[_0x1fec('0x11')]=_0x3b51a8[_0x1fec('0x11')];this[_0x1fec('0x12')]=_0x3b51a8[_0x1fec('0x12')];this[_0x1fec('0x13')]=_0x3b51a8[_0x1fec('0x12')];this[_0x1fec('0x14')]=_0x3b51a8['ringtime']||0x0;this['holdtime']=_0x3b51a8[_0x1fec('0x15')]||0x0;this[_0x1fec('0x16')]=_0x3b51a8[_0x1fec('0x16')]||0x0;this[_0x1fec('0x17')]=_0x3b51a8[_0x1fec('0x17')];this['callbackuniqueid']=_0x3b51a8[_0x1fec('0x18')];this['callbackat']=_0x3b51a8['callbackat'];this[_0x1fec('0x19')]=_0x3b51a8[_0x1fec('0x19')];this[_0x1fec('0x1a')]=_0x3b51a8[_0x1fec('0x1a')];this[_0x1fec('0x1b')]=_0x3b51a8[_0x1fec('0x1b')];this[_0x1fec('0x1c')]=_0x3b51a8[_0x1fec('0x1c')];this[_0x1fec('0x1d')]=_0x3b51a8[_0x1fec('0x1d')];this[_0x1fec('0x1e')]=_0x3b51a8['CampaignId'];this[_0x1fec('0x1f')]=_0x3b51a8[_0x1fec('0x1f')]||'';this[_0x1fec('0x20')]=_0x3b51a8[_0x1fec('0x20')]||'';this[_0x1fec('0x21')]=_0x3b51a8[_0x1fec('0x21')];this[_0x1fec('0x22')]=_0x3b51a8[_0x1fec('0x22')];}module[_0x1fec('0x23')]=Final; \ No newline at end of file +var _0xd73f=['countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x4c5fe6,_0x4af7aa){var _0x5cfd2f=function(_0x1cc3f9){while(--_0x1cc3f9){_0x4c5fe6['push'](_0x4c5fe6['shift']());}};_0x5cfd2f(++_0x4af7aa);}(_0xd73f,0x16b));var _0xfd73=function(_0x34f86d,_0x469a3b){_0x34f86d=_0x34f86d-0x0;var _0x1c457a=_0xd73f[_0x34f86d];return _0x1c457a;};'use strict';function Final(_0x257942){this[_0xfd73('0x0')]=_0x257942[_0xfd73('0x0')];this['scheduledat']=_0x257942[_0xfd73('0x1')];this[_0xfd73('0x2')]=_0x257942['type'];this[_0xfd73('0x3')]=_0x257942[_0xfd73('0x2')]===_0xfd73('0x4')?_0xfd73('0x5'):_0x257942[_0xfd73('0x2')];this[_0xfd73('0x6')]=_0x257942[_0xfd73('0x6')];this[_0xfd73('0x7')]=_0x257942[_0xfd73('0x7')];this[_0xfd73('0x8')]=_0x257942[_0xfd73('0x8')];this[_0xfd73('0x9')]=_0x257942[_0xfd73('0x6')]+_0x257942[_0xfd73('0x7')]+_0x257942['countnoanswerretry']+_0x257942[_0xfd73('0xa')]+_0x257942['countdropretry']+_0x257942[_0xfd73('0xb')]+_0x257942['countmachineretry']+_0x257942[_0xfd73('0xc')];this[_0xfd73('0xa')]=_0x257942[_0xfd73('0xa')];this[_0xfd73('0xd')]=_0x257942[_0xfd73('0xd')];this['countabandonedretry']=_0x257942[_0xfd73('0xb')];this['countmachineretry']=_0x257942[_0xfd73('0xe')];this[_0xfd73('0xc')]=_0x257942[_0xfd73('0xc')];this[_0xfd73('0x5')]=_0x257942[_0xfd73('0x5')];this[_0xfd73('0xf')]=_0x257942[_0xfd73('0xf')];this[_0xfd73('0x10')]=_0x257942[_0xfd73('0x10')];this[_0xfd73('0x11')]=_0x257942[_0xfd73('0x11')];this[_0xfd73('0x12')]=_0x257942[_0xfd73('0x12')];this['endtime']=_0x257942[_0xfd73('0x12')];this['ringtime']=_0x257942[_0xfd73('0x13')]||0x0;this['holdtime']=_0x257942[_0xfd73('0x14')]||0x0;this[_0xfd73('0x15')]=_0x257942[_0xfd73('0x15')]||0x0;this[_0xfd73('0x16')]=_0x257942[_0xfd73('0x16')];this['callbackuniqueid']=_0x257942['callbackuniqueid'];this[_0xfd73('0x17')]=_0x257942[_0xfd73('0x17')];this[_0xfd73('0x18')]=_0x257942[_0xfd73('0x18')];this[_0xfd73('0x19')]=_0x257942['ContactId'];this[_0xfd73('0x1a')]=_0x257942[_0xfd73('0x1a')];this[_0xfd73('0x1b')]=_0x257942[_0xfd73('0x1b')];this['VoiceQueueId']=_0x257942[_0xfd73('0x1c')];this[_0xfd73('0x1d')]=_0x257942[_0xfd73('0x1d')];this[_0xfd73('0x1e')]=_0x257942['originatecalleridnum']||'';this['originatecalleridname']=_0x257942[_0xfd73('0x1f')]||'';this[_0xfd73('0x20')]=_0x257942[_0xfd73('0x20')];this[_0xfd73('0x21')]=_0x257942[_0xfd73('0x21')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index c082172..b51d93c 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8fd=['calleridname','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','../utils','state','statedesc','Answer','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','uniqueid'];(function(_0xc665f8,_0x45bdb4){var _0xb7cfd3=function(_0x4a464c){while(--_0x4a464c){_0xc665f8['push'](_0xc665f8['shift']());}};_0xb7cfd3(++_0x45bdb4);}(_0xb8fd,0xf3));var _0xdb8f=function(_0x3436a6,_0x179839){_0x3436a6=_0x3436a6-0x0;var _0x1098b7=_0xb8fd[_0x3436a6];return _0x1098b7;};'use strict';var moment=require('moment');var utils=require(_0xdb8f('0x0'));function Hangup(_0x5c0133,_0x20fedb){this[_0xdb8f('0x1')]=0x4;this[_0xdb8f('0x2')]=_0xdb8f('0x3');this['scheduledat']=_0x5c0133['scheduledat'];this[_0xdb8f('0x4')]=_0x5c0133[_0xdb8f('0x4')];this[_0xdb8f('0x5')]=_0x5c0133[_0xdb8f('0x4')]===_0xdb8f('0x6')?'queue':_0x5c0133[_0xdb8f('0x4')];this[_0xdb8f('0x7')]=_0x5c0133[_0xdb8f('0x7')]||![];this[_0xdb8f('0x8')]=_0x5c0133[_0xdb8f('0x8')];this[_0xdb8f('0x9')]=_0x5c0133[_0xdb8f('0x9')];this[_0xdb8f('0xa')]=_0x5c0133[_0xdb8f('0xa')];this['countglobal']=_0x5c0133[_0xdb8f('0x8')]+_0x5c0133[_0xdb8f('0x9')]+_0x5c0133[_0xdb8f('0xa')]+_0x5c0133['countnosuchnumberretry']+_0x5c0133[_0xdb8f('0xb')]+_0x5c0133[_0xdb8f('0xc')]+_0x5c0133['countmachineretry']+_0x5c0133[_0xdb8f('0xd')];this[_0xdb8f('0xe')]=_0x5c0133[_0xdb8f('0xe')];this[_0xdb8f('0xb')]=_0x5c0133['countdropretry'];this[_0xdb8f('0xc')]=_0x5c0133[_0xdb8f('0xc')];this['countmachineretry']=_0x5c0133['countmachineretry'];this[_0xdb8f('0xd')]=_0x5c0133['countagentrejectretry'];this[_0xdb8f('0xf')]=_0x20fedb[_0xdb8f('0xf')];this[_0xdb8f('0x10')]=_0x5c0133['name'];this['calleridnum']=_0x5c0133[_0xdb8f('0x11')];this[_0xdb8f('0x12')]=_0x5c0133['starttime'];this[_0xdb8f('0x13')]=_0x5c0133['responsetime'];this['endtime']=moment()[_0xdb8f('0x14')](_0xdb8f('0x15'));this[_0xdb8f('0x16')]=utils[_0xdb8f('0x17')](_0x5c0133['responsetime'],_0x5c0133[_0xdb8f('0x12')]);this[_0xdb8f('0x18')]=0x0;this[_0xdb8f('0x19')]=utils[_0xdb8f('0x17')](this[_0xdb8f('0x1a')],_0x5c0133[_0xdb8f('0x13')]);this['queue']=_0x5c0133['queue'];this['membername']='IVR';this[_0xdb8f('0x1b')]=_0x20fedb['cause-txt'];this[_0xdb8f('0x1c')]=_0x5c0133[_0xdb8f('0x1c')];this[_0xdb8f('0x1d')]=_0x5c0133[_0xdb8f('0x1d')];this[_0xdb8f('0x1e')]=_0x5c0133[_0xdb8f('0x1e')];this[_0xdb8f('0x1f')]=_0x5c0133[_0xdb8f('0x1f')];this[_0xdb8f('0x20')]=_0x5c0133[_0xdb8f('0x20')];this[_0xdb8f('0x21')]=_0x5c0133[_0xdb8f('0x21')];this['UserId']=_0x5c0133['UserId'];this[_0xdb8f('0x22')]=_0x5c0133[_0xdb8f('0x22')];this['CampaignId']=_0x5c0133[_0xdb8f('0x23')];}module[_0xdb8f('0x24')]=Hangup; \ No newline at end of file +var _0x2570=['holdtime','talktime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds'];(function(_0x4f93ce,_0x51c256){var _0x52382a=function(_0x3cda04){while(--_0x3cda04){_0x4f93ce['push'](_0x4f93ce['shift']());}};_0x52382a(++_0x51c256);}(_0x2570,0x1d7));var _0x0257=function(_0x510c1b,_0x178e2d){_0x510c1b=_0x510c1b-0x0;var _0x183aa9=_0x2570[_0x510c1b];return _0x183aa9;};'use strict';var moment=require(_0x0257('0x0'));var utils=require('../utils');function Hangup(_0x28f808,_0x1d51d6){this['state']=0x4;this['statedesc']='Answer';this[_0x0257('0x1')]=_0x28f808[_0x0257('0x1')];this[_0x0257('0x2')]=_0x28f808[_0x0257('0x2')];this[_0x0257('0x3')]=_0x28f808[_0x0257('0x2')]===_0x0257('0x4')?'queue':_0x28f808[_0x0257('0x2')];this[_0x0257('0x5')]=_0x28f808['amd']||![];this[_0x0257('0x6')]=_0x28f808[_0x0257('0x6')];this[_0x0257('0x7')]=_0x28f808['countcongestionretry'];this['countnoanswerretry']=_0x28f808[_0x0257('0x8')];this['countglobal']=_0x28f808['countbusyretry']+_0x28f808[_0x0257('0x7')]+_0x28f808['countnoanswerretry']+_0x28f808[_0x0257('0x9')]+_0x28f808[_0x0257('0xa')]+_0x28f808[_0x0257('0xb')]+_0x28f808[_0x0257('0xc')]+_0x28f808[_0x0257('0xd')];this[_0x0257('0x9')]=_0x28f808['countnosuchnumberretry'];this[_0x0257('0xa')]=_0x28f808[_0x0257('0xa')];this['countabandonedretry']=_0x28f808['countabandonedretry'];this['countmachineretry']=_0x28f808['countmachineretry'];this[_0x0257('0xd')]=_0x28f808[_0x0257('0xd')];this[_0x0257('0xe')]=_0x1d51d6[_0x0257('0xe')];this['calleridname']=_0x28f808['name'];this[_0x0257('0xf')]=_0x28f808[_0x0257('0x10')];this['starttime']=_0x28f808[_0x0257('0x11')];this['responsetime']=_0x28f808[_0x0257('0x12')];this[_0x0257('0x13')]=moment()['format'](_0x0257('0x14'));this[_0x0257('0x15')]=utils[_0x0257('0x16')](_0x28f808[_0x0257('0x12')],_0x28f808[_0x0257('0x11')]);this[_0x0257('0x17')]=0x0;this[_0x0257('0x18')]=utils[_0x0257('0x16')](this[_0x0257('0x13')],_0x28f808['responsetime']);this[_0x0257('0x19')]=_0x28f808['queue'];this[_0x0257('0x1a')]='IVR';this[_0x0257('0x1b')]=_0x1d51d6[_0x0257('0x1c')];this[_0x0257('0x1d')]=_0x28f808[_0x0257('0x1d')];this['callbackuniqueid']=_0x28f808[_0x0257('0x1e')];this['callbackat']=_0x28f808[_0x0257('0x1f')];this[_0x0257('0x20')]=_0x28f808[_0x0257('0x20')];this[_0x0257('0x21')]=_0x28f808[_0x0257('0x21')];this[_0x0257('0x22')]=_0x28f808[_0x0257('0x22')];this['UserId']=_0x28f808[_0x0257('0x23')];this[_0x0257('0x24')]=_0x28f808[_0x0257('0x24')];this[_0x0257('0x25')]=_0x28f808['CampaignId'];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 8592507..2760f4c 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc024=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','calleridname','name','calleridnum','starttime','responsetime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x448e37,_0x4d1a1d){var _0x248bce=function(_0xbe5d8f){while(--_0xbe5d8f){_0x448e37['push'](_0x448e37['shift']());}};_0x248bce(++_0x4d1a1d);}(_0xc024,0x14e));var _0x4c02=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc024[_0x56482c];return _0x5aae7a;};'use strict';var utils=require(_0x4c02('0x0'));function History(_0x25a2ba){this[_0x4c02('0x1')]=_0x25a2ba[_0x4c02('0x1')];this[_0x4c02('0x2')]=_0x25a2ba['scheduledat']||undefined;this['type']=_0x25a2ba[_0x4c02('0x3')];this[_0x4c02('0x4')]=_0x25a2ba[_0x4c02('0x3')]==='outbound'?'queue':_0x25a2ba['type'];this[_0x4c02('0x5')]=_0x25a2ba[_0x4c02('0x5')];this[_0x4c02('0x6')]=_0x25a2ba[_0x4c02('0x6')];this[_0x4c02('0x7')]=_0x25a2ba[_0x4c02('0x7')];this[_0x4c02('0x8')]=_0x25a2ba[_0x4c02('0x5')]+_0x25a2ba['countcongestionretry']+_0x25a2ba[_0x4c02('0x7')]+_0x25a2ba[_0x4c02('0x9')]+_0x25a2ba['countdropretry']+_0x25a2ba['countabandonedretry']+_0x25a2ba[_0x4c02('0xa')]+_0x25a2ba[_0x4c02('0xb')];this['countnosuchnumberretry']=_0x25a2ba['countnosuchnumberretry'];this[_0x4c02('0xc')]=_0x25a2ba['countdropretry'];this[_0x4c02('0xd')]=_0x25a2ba[_0x4c02('0xd')];this[_0x4c02('0xa')]=_0x25a2ba[_0x4c02('0xa')];this[_0x4c02('0xb')]=_0x25a2ba[_0x4c02('0xb')];this[_0x4c02('0xe')]=_0x25a2ba['queue'];this[_0x4c02('0xf')]=_0x25a2ba[_0x4c02('0x10')];this[_0x4c02('0x11')]=_0x25a2ba['number'];this[_0x4c02('0x12')]=_0x25a2ba[_0x4c02('0x12')];this['responsetime']=_0x25a2ba[_0x4c02('0x13')];this['endtime']=_0x25a2ba[_0x4c02('0x13')];this['ringtime']=utils[_0x4c02('0x14')](_0x25a2ba['responsetime'],_0x25a2ba[_0x4c02('0x12')]);this[_0x4c02('0x15')]=0x0;this[_0x4c02('0x16')]=0x0;this[_0x4c02('0x17')]=_0x25a2ba[_0x4c02('0x17')];this['callbackuniqueid']=_0x25a2ba[_0x4c02('0x18')];this[_0x4c02('0x19')]=_0x25a2ba['callbackat'];this['recallme']=_0x25a2ba['recallme'];this[_0x4c02('0x1a')]=_0x25a2ba[_0x4c02('0x1a')];this[_0x4c02('0x1b')]=_0x25a2ba[_0x4c02('0x1b')];this[_0x4c02('0x1c')]=_0x25a2ba[_0x4c02('0x1c')];this[_0x4c02('0x1d')]=_0x25a2ba[_0x4c02('0x1d')];this[_0x4c02('0x1e')]=_0x25a2ba['CampaignId'];this[_0x4c02('0x1f')]=_0x25a2ba[_0x4c02('0x1f')]||'';this[_0x4c02('0x20')]=_0x25a2ba[_0x4c02('0x20')]||'';this['state']=_0x25a2ba[_0x4c02('0x21')];this[_0x4c02('0x22')]=_0x25a2ba[_0x4c02('0x22')];}module[_0x4c02('0x23')]=History; \ No newline at end of file +var _0xa5af=['countagentrejectretry','countnosuchnumberretry','name','calleridnum','number','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry'];(function(_0x57dc01,_0xce93c9){var _0x14916e=function(_0x298417){while(--_0x298417){_0x57dc01['push'](_0x57dc01['shift']());}};_0x14916e(++_0xce93c9);}(_0xa5af,0xd1));var _0xfa5a=function(_0x531a76,_0x472ed5){_0x531a76=_0x531a76-0x0;var _0x2607e7=_0xa5af[_0x531a76];return _0x2607e7;};'use strict';var utils=require(_0xfa5a('0x0'));function History(_0xf184e8){this[_0xfa5a('0x1')]=_0xf184e8[_0xfa5a('0x1')];this[_0xfa5a('0x2')]=_0xf184e8[_0xfa5a('0x2')]||undefined;this[_0xfa5a('0x3')]=_0xf184e8[_0xfa5a('0x3')];this[_0xfa5a('0x4')]=_0xf184e8[_0xfa5a('0x3')]==='outbound'?_0xfa5a('0x5'):_0xf184e8[_0xfa5a('0x3')];this['countbusyretry']=_0xf184e8[_0xfa5a('0x6')];this['countcongestionretry']=_0xf184e8[_0xfa5a('0x7')];this[_0xfa5a('0x8')]=_0xf184e8[_0xfa5a('0x8')];this[_0xfa5a('0x9')]=_0xf184e8[_0xfa5a('0x6')]+_0xf184e8[_0xfa5a('0x7')]+_0xf184e8[_0xfa5a('0x8')]+_0xf184e8['countnosuchnumberretry']+_0xf184e8[_0xfa5a('0xa')]+_0xf184e8[_0xfa5a('0xb')]+_0xf184e8[_0xfa5a('0xc')]+_0xf184e8[_0xfa5a('0xd')];this[_0xfa5a('0xe')]=_0xf184e8['countnosuchnumberretry'];this['countdropretry']=_0xf184e8[_0xfa5a('0xa')];this['countabandonedretry']=_0xf184e8[_0xfa5a('0xb')];this['countmachineretry']=_0xf184e8[_0xfa5a('0xc')];this['countagentrejectretry']=_0xf184e8['countagentrejectretry'];this[_0xfa5a('0x5')]=_0xf184e8[_0xfa5a('0x5')];this['calleridname']=_0xf184e8[_0xfa5a('0xf')];this[_0xfa5a('0x10')]=_0xf184e8[_0xfa5a('0x11')];this[_0xfa5a('0x12')]=_0xf184e8[_0xfa5a('0x12')];this[_0xfa5a('0x13')]=_0xf184e8['responsetime'];this['endtime']=_0xf184e8[_0xfa5a('0x13')];this[_0xfa5a('0x14')]=utils[_0xfa5a('0x15')](_0xf184e8[_0xfa5a('0x13')],_0xf184e8[_0xfa5a('0x12')]);this[_0xfa5a('0x16')]=0x0;this[_0xfa5a('0x17')]=0x0;this[_0xfa5a('0x18')]=_0xf184e8[_0xfa5a('0x18')];this['callbackuniqueid']=_0xf184e8[_0xfa5a('0x19')];this[_0xfa5a('0x1a')]=_0xf184e8[_0xfa5a('0x1a')];this[_0xfa5a('0x1b')]=_0xf184e8['recallme'];this[_0xfa5a('0x1c')]=_0xf184e8[_0xfa5a('0x1c')];this[_0xfa5a('0x1d')]=_0xf184e8[_0xfa5a('0x1d')];this[_0xfa5a('0x1e')]=_0xf184e8[_0xfa5a('0x1e')];this[_0xfa5a('0x1f')]=_0xf184e8[_0xfa5a('0x1f')];this['CampaignId']=_0xf184e8['CampaignId'];this['originatecalleridnum']=_0xf184e8[_0xfa5a('0x20')]||'';this[_0xfa5a('0x21')]=_0xf184e8[_0xfa5a('0x21')]||'';this[_0xfa5a('0x22')]=_0xf184e8[_0xfa5a('0x22')];this[_0xfa5a('0x23')]=_0xf184e8[_0xfa5a('0x23')];}module[_0xfa5a('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index edc3dc6..afdbdce 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8e5=['name','calleridnum','responsetime','dropreason','droptime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname'];(function(_0x5cf454,_0x51fcc7){var _0x1dfcd9=function(_0x64abe7){while(--_0x64abe7){_0x5cf454['push'](_0x5cf454['shift']());}};_0x1dfcd9(++_0x51fcc7);}(_0xe8e5,0x138));var _0x5e8e=function(_0x374425,_0x201ba3){_0x374425=_0x374425-0x0;var _0x13df0b=_0xe8e5[_0x374425];return _0x13df0b;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x3cc134,_0x183cd8){this[_0x5e8e('0x0')]=_0x3cc134['scheduledat'];this[_0x5e8e('0x1')]=_0x3cc134['type'];this[_0x5e8e('0x2')]=_0x3cc134['type']===_0x5e8e('0x3')?_0x5e8e('0x4'):_0x3cc134[_0x5e8e('0x1')];this[_0x5e8e('0x5')]=_0x3cc134['countbusyretry'];this[_0x5e8e('0x6')]=_0x3cc134[_0x5e8e('0x6')];this[_0x5e8e('0x7')]=_0x3cc134[_0x5e8e('0x7')];this[_0x5e8e('0x8')]=_0x3cc134[_0x5e8e('0x5')]+_0x3cc134[_0x5e8e('0x6')]+_0x3cc134[_0x5e8e('0x7')]+_0x3cc134[_0x5e8e('0x9')]+_0x3cc134[_0x5e8e('0xa')]+_0x3cc134['countabandonedretry']+_0x3cc134[_0x5e8e('0xb')]+_0x3cc134[_0x5e8e('0xc')];this[_0x5e8e('0x9')]=_0x3cc134[_0x5e8e('0x9')];this['countdropretry']=_0x3cc134[_0x5e8e('0xa')];this[_0x5e8e('0xd')]=_0x3cc134['countabandonedretry'];this[_0x5e8e('0xb')]=_0x3cc134['countmachineretry'];this[_0x5e8e('0xc')]=_0x3cc134[_0x5e8e('0xc')];this['uniqueid']=_0x183cd8[_0x5e8e('0xe')];this[_0x5e8e('0xf')]=_0x3cc134[_0x5e8e('0x10')];this[_0x5e8e('0x11')]=_0x3cc134['number'];this['starttime']=_0x3cc134['starttime'];this[_0x5e8e('0x12')]=_0x3cc134['responsetime'];this['droptime']=_0x3cc134['droptime'];this[_0x5e8e('0x13')]=_0x3cc134[_0x5e8e('0x13')];this['endtime']=this[_0x5e8e('0x14')];this[_0x5e8e('0x15')]=utils[_0x5e8e('0x16')](_0x3cc134['responsetime'],_0x3cc134['starttime']);this[_0x5e8e('0x17')]=utils['getSeconds'](this[_0x5e8e('0x14')],_0x3cc134[_0x5e8e('0x12')]);this[_0x5e8e('0x18')]=0x0;this[_0x5e8e('0x4')]=_0x183cd8[_0x5e8e('0x4')];this[_0x5e8e('0x19')]=_0x183cd8[_0x5e8e('0x1a')];this[_0x5e8e('0x1b')]=_0x183cd8['reason'];this[_0x5e8e('0x1c')]=_0x3cc134[_0x5e8e('0x1c')];this[_0x5e8e('0x1d')]=_0x3cc134['callbackuniqueid'];this[_0x5e8e('0x1e')]=_0x3cc134[_0x5e8e('0x1e')];this[_0x5e8e('0x1f')]=_0x3cc134[_0x5e8e('0x1f')];this[_0x5e8e('0x20')]=_0x3cc134['ContactId'];this[_0x5e8e('0x21')]=_0x3cc134[_0x5e8e('0x21')];this[_0x5e8e('0x22')]=_0x3cc134[_0x5e8e('0x22')];this[_0x5e8e('0x23')]=_0x3cc134[_0x5e8e('0x23')];this[_0x5e8e('0x24')]=_0x3cc134[_0x5e8e('0x24')];this[_0x5e8e('0x25')]=_0x3cc134[_0x5e8e('0x25')]||'';this['originatecalleridname']=_0x3cc134['originatecalleridname']||'';this['agiafterat']=_0x3cc134[_0x5e8e('0x26')];this[_0x5e8e('0x27')]=_0x3cc134['state'];this[_0x5e8e('0x28')]=_0x3cc134[_0x5e8e('0x28')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x814b=['getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason'];(function(_0x56b5d1,_0x59be02){var _0x5bfe4a=function(_0x9ed053){while(--_0x9ed053){_0x56b5d1['push'](_0x56b5d1['shift']());}};_0x5bfe4a(++_0x59be02);}(_0x814b,0xbf));var _0xb814=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x814b[_0xb875ee];return _0x4c7f3a;};'use strict';var utils=require(_0xb814('0x0'));function QueueCallerAbandon(_0xd27250,_0x291696){this[_0xb814('0x1')]=_0xd27250[_0xb814('0x1')];this[_0xb814('0x2')]=_0xd27250[_0xb814('0x2')];this[_0xb814('0x3')]=_0xd27250[_0xb814('0x2')]===_0xb814('0x4')?_0xb814('0x5'):_0xd27250[_0xb814('0x2')];this[_0xb814('0x6')]=_0xd27250['countbusyretry'];this[_0xb814('0x7')]=_0xd27250[_0xb814('0x7')];this[_0xb814('0x8')]=_0xd27250[_0xb814('0x8')];this[_0xb814('0x9')]=_0xd27250['countbusyretry']+_0xd27250[_0xb814('0x7')]+_0xd27250[_0xb814('0x8')]+_0xd27250['countnosuchnumberretry']+_0xd27250[_0xb814('0xa')]+_0xd27250[_0xb814('0xb')]+_0xd27250[_0xb814('0xc')]+_0xd27250['countagentrejectretry'];this[_0xb814('0xd')]=_0xd27250['countnosuchnumberretry'];this[_0xb814('0xa')]=_0xd27250[_0xb814('0xa')];this[_0xb814('0xb')]=_0xd27250[_0xb814('0xb')];this[_0xb814('0xc')]=_0xd27250[_0xb814('0xc')];this[_0xb814('0xe')]=_0xd27250[_0xb814('0xe')];this[_0xb814('0xf')]=_0x291696[_0xb814('0xf')];this[_0xb814('0x10')]=_0xd27250[_0xb814('0x11')];this[_0xb814('0x12')]=_0xd27250[_0xb814('0x13')];this[_0xb814('0x14')]=_0xd27250[_0xb814('0x14')];this['responsetime']=_0xd27250[_0xb814('0x15')];this[_0xb814('0x16')]=_0xd27250[_0xb814('0x16')];this['dropreason']=_0xd27250[_0xb814('0x17')];this['endtime']=this['droptime'];this['ringtime']=utils[_0xb814('0x18')](_0xd27250[_0xb814('0x15')],_0xd27250[_0xb814('0x14')]);this[_0xb814('0x19')]=utils[_0xb814('0x18')](this[_0xb814('0x16')],_0xd27250[_0xb814('0x15')]);this[_0xb814('0x1a')]=0x0;this[_0xb814('0x5')]=_0x291696[_0xb814('0x5')];this[_0xb814('0x1b')]=_0x291696[_0xb814('0x1c')];this[_0xb814('0x1d')]=_0x291696[_0xb814('0x1d')];this[_0xb814('0x1e')]=_0xd27250[_0xb814('0x1e')];this[_0xb814('0x1f')]=_0xd27250[_0xb814('0x1f')];this[_0xb814('0x20')]=_0xd27250[_0xb814('0x20')];this['recallme']=_0xd27250['recallme'];this[_0xb814('0x21')]=_0xd27250['ContactId'];this[_0xb814('0x22')]=_0xd27250['ListId'];this[_0xb814('0x23')]=_0xd27250[_0xb814('0x23')];this['VoiceQueueId']=_0xd27250[_0xb814('0x24')];this[_0xb814('0x25')]=_0xd27250['CampaignId'];this['originatecalleridnum']=_0xd27250[_0xb814('0x26')]||'';this[_0xb814('0x27')]=_0xd27250['originatecalleridname']||'';this['agiafterat']=_0xd27250['agiafterat'];this[_0xb814('0x28')]=_0xd27250['state'];this[_0xb814('0x29')]=_0xd27250[_0xb814('0x29')];}module[_0xb814('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 60d9dce..2d8e96d 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x5d545d,_0x20db00){var _0x2612f8=function(_0x19373b){while(--_0x19373b){_0x5d545d['push'](_0x5d545d['shift']());}};_0x2612f8(++_0x20db00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x1bf451,_0x40d6fa){var _0x3aae43=function(_0x4e061e){while(--_0x4e061e){_0x1bf451['push'](_0x1bf451['shift']());}};_0x3aae43(++_0x40d6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index b52b6e3..137374d 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e21=['dialTimezone','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','getCallerId','\x5cw{0,','pow','random','toString','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','updatedAt','undefined','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged'];(function(_0x3f50ea,_0x32940c){var _0x59f2f1=function(_0xfb9fa9){while(--_0xfb9fa9){_0x3f50ea['push'](_0x3f50ea['shift']());}};_0x59f2f1(++_0x32940c);}(_0x8e21,0x1e7));var _0x18e2=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x8e21[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0x18e2('0x0'));var moment=require(_0x18e2('0x1'));var util=require(_0x18e2('0x2'));var logger=require(_0x18e2('0x3'))(_0x18e2('0x4'));var timezones=require(_0x18e2('0x5'))[_0x18e2('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x18e2('0x7'),'BLACKLIST':_0x18e2('0x8'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x18e2('0x9'),'DISACTIVED':_0x18e2('0xa'),'EMPTY_INTERVAL':_0x18e2('0xb'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x18e2('0xc'),'NULL_INTERVAL':_0x18e2('0xd'),'OVERTIME_INTERVAL':_0x18e2('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x18e2('0xf'),'RECALL_TIMEOUT':_0x18e2('0x10'),'RUNNING':_0x18e2('0x11'),'UNKNOWN_TIMEZONE':_0x18e2('0x12'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x18e2('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x39858c){return _0x39858c['dialMethod']===_0x18e2('0x14');}exports[_0x18e2('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x211be9){return _0x211be9[_0x18e2('0x16')]===_0x18e2('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x424aa2){return _0x424aa2[_0x18e2('0x16')]===_0x18e2('0x18');}exports[_0x18e2('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x243e16){return _0x243e16['dialActive'];}exports[_0x18e2('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3088e9){return _0x3088e9[_0x18e2('0x1b')];}exports[_0x18e2('0x1c')]=isIVRCampaignActive;function getSeconds(_0x3ad3f6,_0x54b601){var _0x4398bc=moment(_0x3ad3f6)[_0x18e2('0x1d')](0x0);var _0x39f80b=moment(_0x54b601)[_0x18e2('0x1d')](0x0);return _0x4398bc[_0x18e2('0x1e')](_0x39f80b,'seconds');}exports[_0x18e2('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x590f6f,_0x3a04ff){var _0x2599e9=![];var _0xe7d27e=_0x590f6f['dialMethod']!==_0x3a04ff[_0x18e2('0x20')]||_0x590f6f[_0x18e2('0x21')]!==_0x3a04ff['dialActive']||_0x590f6f[_0x18e2('0x22')]!==_0x3a04ff[_0x18e2('0x22')];var _0x4eb4cc=_0x590f6f[_0x18e2('0x23')]!==_0x3a04ff[_0x18e2('0x23')]||_0x590f6f['loggedIn']!==_0x3a04ff[_0x18e2('0x24')]||_0x590f6f[_0x18e2('0x25')]!==_0x3a04ff[_0x18e2('0x25')]||_0x590f6f[_0x18e2('0x26')]!==_0x3a04ff[_0x18e2('0x26')]||_0x590f6f[_0x18e2('0x27')]!==_0x3a04ff[_0x18e2('0x27')]||_0x590f6f[_0x18e2('0x28')]!==_0x3a04ff[_0x18e2('0x28')]||_0x590f6f[_0x18e2('0x29')]!==_0x3a04ff[_0x18e2('0x29')]||_0x590f6f['inUse']!==_0x3a04ff[_0x18e2('0x2a')]||_0x590f6f[_0x18e2('0x2b')]!==_0x3a04ff[_0x18e2('0x2b')];if(_0x590f6f[_0x18e2('0x2c')]&&_0x3a04ff[_0x18e2('0x2c')]){_0x2599e9=_0x590f6f[_0x18e2('0x2c')][_0x18e2('0x2d')]!==_0x3a04ff['Trunk']['name']||_0x590f6f[_0x18e2('0x2c')]['active']!==_0x3a04ff[_0x18e2('0x2c')][_0x18e2('0x1b')];}return _0xe7d27e||_0x4eb4cc||_0x2599e9;}exports[_0x18e2('0x2e')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1db4c0){var _0x50c2ae=null;var _0x24f529=_0x1db4c0[_0x18e2('0x2f')];if(_['isNil'](_0x1db4c0[_0x18e2('0x30')])||_['isNil'](_0x1db4c0['Interval'])||_['isNil'](_0x1db4c0[_0x18e2('0x31')][_0x18e2('0x32')])){_0x50c2ae=CAMPAIGN_STATUS[_0x18e2('0x33')];}else if(_[_0x18e2('0x34')](_0x1db4c0[_0x18e2('0x30')])||_[_0x18e2('0x34')](_0x1db4c0[_0x18e2('0x31')][_0x18e2('0x32')])){_0x50c2ae=CAMPAIGN_STATUS[_0x18e2('0x35')];}else if(_0x24f529&&!timezones[_0x24f529]){_0x50c2ae=CAMPAIGN_STATUS[_0x18e2('0x36')];}return _0x50c2ae;}function checkAnyValidTrunk(_0x29bf29,_0x39a500){var _0x4856d2=null;var _0x317e83=_0x18e2('0x37');var _0x176a92=[_0x18e2('0x38'),_0x18e2('0x39')];var _0x3e2b04=!![];if(_0x29bf29['Trunk']&&_0x29bf29['Trunk'][_0x18e2('0x1b')]){_0x317e83+=_0x29bf29[_0x18e2('0x2c')]['name'];_0x4856d2=_0x39a500[_0x317e83];_0x3e2b04=_0x176a92[_0x18e2('0x3a')](_0x4856d2[_0x18e2('0x3b')]);}else if(_0x29bf29[_0x18e2('0x3c')]&&_0x29bf29[_0x18e2('0x3c')]['active']){_0x317e83+=_0x29bf29['TrunkBackup'][_0x18e2('0x2d')];_0x4856d2=_0x39a500[_0x317e83];_0x3e2b04=_0x176a92['includes'](_0x4856d2[_0x18e2('0x3b')]);}return _0x3e2b04;}function getQueueCampaignStatusMessage(_0xc3ae44,_0x561cf7){var _0x2c2e46=CAMPAIGN_STATUS[_0x18e2('0x7')];var _0x5266df=isPreviewCampaign(_0xc3ae44);if(!isQueueCampaignActive(_0xc3ae44)){if(_0x5266df){_0x2c2e46=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0xc3ae44[_0x18e2('0x2b')]===0x0&&_0xc3ae44[_0x18e2('0x27')]===0x0&&_0xc3ae44['waiting']===0x0&&(_0xc3ae44[_0x18e2('0x28')]||0x0)===0x0){_0x2c2e46=CAMPAIGN_STATUS[_0x18e2('0x3d')];}else{_0x2c2e46=CAMPAIGN_STATUS[_0x18e2('0x3e')];}}}else if(_0xc3ae44[_0x18e2('0x24')]===0x0){_0x2c2e46=CAMPAIGN_STATUS[_0x18e2('0x3f')];}else if(!checkAnyValidTrunk(_0xc3ae44,_0x561cf7)){_0x2c2e46=CAMPAIGN_STATUS[_0x18e2('0x40')];}else if(!isPreviewCampaign(_0xc3ae44)){var _0x179982=checkAnyValidQueueCampaignInterval(_0xc3ae44);if(_0x179982){_0x2c2e46=_0x179982;}}return _0x2c2e46;}exports[_0x18e2('0x41')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4016e2){var _0x4cf64a=CAMPAIGN_STATUS[_0x18e2('0x3e')];if(_0x4016e2[_0x18e2('0x2b')]===0x0&&_0x4016e2[_0x18e2('0x27')]===0x0&&_0x4016e2[_0x18e2('0x29')]===0x0&&(_0x4016e2[_0x18e2('0x28')]||0x0)===0x0){_0x4cf64a=CAMPAIGN_STATUS[_0x18e2('0x3d')];}return _0x4cf64a;}exports[_0x18e2('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1fedc7){var _0x15a6b1=_0x1fedc7['match'](/"(.*?)"/);return _0x15a6b1?_0x15a6b1[0x1]:_0x1fedc7;}exports[_0x18e2('0x43')]=extractCalleridName;function getCallerId(_0x5f0246,_0x25e7f9,_0xe01a2b){if(!_['isUndefined'](_0xe01a2b)&&typeof _0xe01a2b==='string'&&!_[_0x18e2('0x34')](_0xe01a2b)){if(!_[_0x18e2('0x44')](_0x25e7f9)&&typeof _0x25e7f9===_0x18e2('0x45')&&!_[_0x18e2('0x34')](_0x25e7f9)){return util['format'](_0x18e2('0x46'),_0x25e7f9,_0xe01a2b);}return util[_0x18e2('0x47')]('\x22%s\x22\x20<%s>',_0xe01a2b,_0xe01a2b);}if(!_[_0x18e2('0x44')](_0x5f0246)&&typeof _0x5f0246===_0x18e2('0x45')&&!_[_0x18e2('0x34')](_0x5f0246)){return _0x5f0246;}return'\x22\x22\x20<>';}exports[_0x18e2('0x48')]=getCallerId;function getCallerIdRandom(_0x388570,_0x3d6a87){var _0x13d6cf;var _0x4e3133;var _0x39ac12;if(_0x3d6a87<=0x0){_0x3d6a87=0x1;}_0x13d6cf=new RegExp(_0x18e2('0x49')+_0x3d6a87+'}$');_0x4e3133=Math[_0x18e2('0x4a')](0xa,_0x3d6a87-0x1);_0x39ac12=Math[_0x18e2('0x4a')](0xa,_0x3d6a87)-0x1;return util[_0x18e2('0x47')]('%s',_['replace'](_0x388570,_0x13d6cf,_[_0x18e2('0x4b')](_0x4e3133,_0x39ac12)[_0x18e2('0x4c')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x2bab3d){if(_0x2bab3d[_0x18e2('0x2b')]&&_0x2bab3d['originated']>0x0){_0x2bab3d[_0x18e2('0x2b')]-=0x1;}else{logger['error'](_0x18e2('0x4d'));}}exports[_0x18e2('0x4e')]=decrementOriginate;function checkContactEmpty(_0x2fcce6){return _0x2fcce6&&_0x2fcce6[_0x18e2('0x4f')]>0x0;}exports[_0x18e2('0x50')]=checkContactEmpty;function erlangb(_0x1c4779,_0x95b34f){if(_0x95b34f===0x0){return 0x0;}var _0x3f6d6d=0x1;for(var _0x133754=0x1;_0x133754<=_0x95b34f;_0x133754+=0x1){_0x3f6d6d=0x1+_0x3f6d6d*_0x133754/_0x1c4779;}return 0x1/_0x3f6d6d;}exports[_0x18e2('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x298d28,_0x56eda3,_0x121b5d){if(_0x56eda3>_0x121b5d){for(var _0x205802=0x0;_0x205802<_0x56eda3-_0x121b5d;_0x205802+=0x1){decrementOriginate(_0x298d28);}}}exports[_0x18e2('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x281512){var _0x24414a={};var _0x5059c6=['id',_0x18e2('0x53'),_0x18e2('0x54'),'tags',_0x18e2('0x55')];if(_0x281512){for(var _0x341898 in _0x281512){if(typeof _0x281512[_0x341898]!==_0x18e2('0x56')){if(!_['isNil'](_0x281512[_0x341898])&&!_0x5059c6['includes'](_0x341898)){_0x24414a[util[_0x18e2('0x47')]('%s%s','XMD-',_0x341898[_0x18e2('0x57')]())]=_0x281512[_0x341898];}}}}return _0x24414a;}exports[_0x18e2('0x58')]=setXMDContactVariables; \ No newline at end of file +var _0xbb77=['format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','outbound','isOutboundQueue','dialActive','active','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string'];(function(_0x350a19,_0x5a1e13){var _0x40f1f5=function(_0x223ca5){while(--_0x223ca5){_0x350a19['push'](_0x350a19['shift']());}};_0x40f1f5(++_0x5a1e13);}(_0xbb77,0x179));var _0x7bb7=function(_0x5b5bdd,_0x2e215c){_0x5b5bdd=_0x5b5bdd-0x0;var _0x39c9e2=_0xbb77[_0x5b5bdd];return _0x39c9e2;};'use strict';var _=require(_0x7bb7('0x0'));var moment=require(_0x7bb7('0x1'));var util=require(_0x7bb7('0x2'));var logger=require(_0x7bb7('0x3'))(_0x7bb7('0x4'));var timezones=require(_0x7bb7('0x5'))[_0x7bb7('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x7bb7('0x7'),'BLACKLIST':_0x7bb7('0x8'),'CONTACTS_RESCHEDULED':_0x7bb7('0x9'),'DEACTIVATED':_0x7bb7('0xa'),'DISACTIVED':_0x7bb7('0xb'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x7bb7('0xc'),'NO_AGENTS_LOGGED':_0x7bb7('0xd'),'NO_AVAILABLE_CONTACTS':_0x7bb7('0xe'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x7bb7('0xf'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x7bb7('0x10'),'RECALL_TIMEOUT':_0x7bb7('0x11'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x7bb7('0x12'),'UNREACHABLE_TRUNK':_0x7bb7('0x13')};exports[_0x7bb7('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2d38fc){return _0x2d38fc[_0x7bb7('0x15')]===_0x7bb7('0x16');}exports[_0x7bb7('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x455bab){return _0x455bab['type']===_0x7bb7('0x18');}exports[_0x7bb7('0x19')]=isIVRCampaign;function isOutboundQueue(_0x4cc4ca){return _0x4cc4ca[_0x7bb7('0x1a')]===_0x7bb7('0x1b');}exports[_0x7bb7('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x1ec459){return _0x1ec459[_0x7bb7('0x1d')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x59ed6d){return _0x59ed6d[_0x7bb7('0x1e')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x47d385,_0x3ea6db){var _0x371c7d=moment(_0x47d385)[_0x7bb7('0x1f')](0x0);var _0x24fc02=moment(_0x3ea6db)[_0x7bb7('0x1f')](0x0);return _0x371c7d['diff'](_0x24fc02,_0x7bb7('0x20'));}exports[_0x7bb7('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x5c7cd8,_0x55da49){var _0x5a6a96=![];var _0x32ddc1=_0x5c7cd8[_0x7bb7('0x15')]!==_0x55da49[_0x7bb7('0x15')]||_0x5c7cd8[_0x7bb7('0x1d')]!==_0x55da49['dialActive']||_0x5c7cd8[_0x7bb7('0x22')]!==_0x55da49[_0x7bb7('0x22')];var _0xa82a46=_0x5c7cd8[_0x7bb7('0x23')]!==_0x55da49[_0x7bb7('0x23')]||_0x5c7cd8[_0x7bb7('0x24')]!==_0x55da49[_0x7bb7('0x24')]||_0x5c7cd8['loggedInDb']!==_0x55da49[_0x7bb7('0x25')]||_0x5c7cd8['paused']!==_0x55da49[_0x7bb7('0x26')]||_0x5c7cd8['talking']!==_0x55da49[_0x7bb7('0x27')]||_0x5c7cd8['pTalking']!==_0x55da49[_0x7bb7('0x28')]||_0x5c7cd8[_0x7bb7('0x29')]!==_0x55da49[_0x7bb7('0x29')]||_0x5c7cd8[_0x7bb7('0x2a')]!==_0x55da49[_0x7bb7('0x2a')]||_0x5c7cd8[_0x7bb7('0x2b')]!==_0x55da49[_0x7bb7('0x2b')];if(_0x5c7cd8['Trunk']&&_0x55da49[_0x7bb7('0x2c')]){_0x5a6a96=_0x5c7cd8[_0x7bb7('0x2c')][_0x7bb7('0x2d')]!==_0x55da49[_0x7bb7('0x2c')][_0x7bb7('0x2d')]||_0x5c7cd8['Trunk'][_0x7bb7('0x1e')]!==_0x55da49['Trunk']['active'];}return _0x32ddc1||_0xa82a46||_0x5a6a96;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x7ec4ab){var _0x2c345f=null;var _0x4311aa=_0x7ec4ab[_0x7bb7('0x2e')];if(_[_0x7bb7('0x2f')](_0x7ec4ab[_0x7bb7('0x30')])||_[_0x7bb7('0x2f')](_0x7ec4ab[_0x7bb7('0x31')])||_[_0x7bb7('0x2f')](_0x7ec4ab['Interval']['Intervals'])){_0x2c345f=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x7bb7('0x32')](_0x7ec4ab[_0x7bb7('0x30')])||_[_0x7bb7('0x32')](_0x7ec4ab['Interval'][_0x7bb7('0x33')])){_0x2c345f=CAMPAIGN_STATUS[_0x7bb7('0x34')];}else if(_0x4311aa&&!timezones[_0x4311aa]){_0x2c345f=CAMPAIGN_STATUS[_0x7bb7('0x35')];}return _0x2c345f;}function checkAnyValidTrunk(_0x2b0ed2,_0x1bc1c8){var _0x337529=null;var _0x5f35e6='SIP/';var _0x3bddeb=[_0x7bb7('0x36'),_0x7bb7('0x37')];var _0xeaa704=!![];if(_0x2b0ed2[_0x7bb7('0x2c')]&&_0x2b0ed2['Trunk'][_0x7bb7('0x1e')]){_0x5f35e6+=_0x2b0ed2['Trunk'][_0x7bb7('0x2d')];_0x337529=_0x1bc1c8[_0x5f35e6];_0xeaa704=_0x3bddeb[_0x7bb7('0x38')](_0x337529[_0x7bb7('0x39')]);}else if(_0x2b0ed2[_0x7bb7('0x3a')]&&_0x2b0ed2[_0x7bb7('0x3a')][_0x7bb7('0x1e')]){_0x5f35e6+=_0x2b0ed2['TrunkBackup'][_0x7bb7('0x2d')];_0x337529=_0x1bc1c8[_0x5f35e6];_0xeaa704=_0x3bddeb[_0x7bb7('0x38')](_0x337529['status']);}return _0xeaa704;}function getQueueCampaignStatusMessage(_0x2cfb49,_0x576936){var _0x24bcc0=CAMPAIGN_STATUS[_0x7bb7('0x7')];var _0x120253=isPreviewCampaign(_0x2cfb49);if(!isQueueCampaignActive(_0x2cfb49)){if(_0x120253){_0x24bcc0=CAMPAIGN_STATUS[_0x7bb7('0x3b')];}else{if(_0x2cfb49[_0x7bb7('0x2b')]===0x0&&_0x2cfb49[_0x7bb7('0x27')]===0x0&&_0x2cfb49[_0x7bb7('0x29')]===0x0&&(_0x2cfb49[_0x7bb7('0x28')]||0x0)===0x0){_0x24bcc0=CAMPAIGN_STATUS[_0x7bb7('0x3b')];}else{_0x24bcc0=CAMPAIGN_STATUS[_0x7bb7('0x3c')];}}}else if(_0x2cfb49[_0x7bb7('0x24')]===0x0){_0x24bcc0=CAMPAIGN_STATUS[_0x7bb7('0x3d')];}else if(!checkAnyValidTrunk(_0x2cfb49,_0x576936)){_0x24bcc0=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x2cfb49)){var _0x5e71d4=checkAnyValidQueueCampaignInterval(_0x2cfb49);if(_0x5e71d4){_0x24bcc0=_0x5e71d4;}}return _0x24bcc0;}exports[_0x7bb7('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x304fc4){var _0x5af03d=CAMPAIGN_STATUS[_0x7bb7('0x3c')];if(_0x304fc4[_0x7bb7('0x2b')]===0x0&&_0x304fc4['talking']===0x0&&_0x304fc4[_0x7bb7('0x29')]===0x0&&(_0x304fc4[_0x7bb7('0x28')]||0x0)===0x0){_0x5af03d=CAMPAIGN_STATUS[_0x7bb7('0x3b')];}return _0x5af03d;}exports[_0x7bb7('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x32e238){var _0x42979e=_0x32e238[_0x7bb7('0x40')](/"(.*?)"/);return _0x42979e?_0x42979e[0x1]:_0x32e238;}exports[_0x7bb7('0x41')]=extractCalleridName;function getCallerId(_0x479c1,_0x3aa7c2,_0x3c1675){if(!_[_0x7bb7('0x42')](_0x3c1675)&&typeof _0x3c1675===_0x7bb7('0x43')&&!_['isEmpty'](_0x3c1675)){if(!_[_0x7bb7('0x42')](_0x3aa7c2)&&typeof _0x3aa7c2===_0x7bb7('0x43')&&!_[_0x7bb7('0x32')](_0x3aa7c2)){return util[_0x7bb7('0x44')](_0x7bb7('0x45'),_0x3aa7c2,_0x3c1675);}return util[_0x7bb7('0x44')](_0x7bb7('0x45'),_0x3c1675,_0x3c1675);}if(!_[_0x7bb7('0x42')](_0x479c1)&&typeof _0x479c1===_0x7bb7('0x43')&&!_[_0x7bb7('0x32')](_0x479c1)){return _0x479c1;}return _0x7bb7('0x46');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0xf96edf,_0x4da610){var _0x4d6896;var _0x42b543;var _0x19f901;if(_0x4da610<=0x0){_0x4da610=0x1;}_0x4d6896=new RegExp(_0x7bb7('0x47')+_0x4da610+'}$');_0x42b543=Math[_0x7bb7('0x48')](0xa,_0x4da610-0x1);_0x19f901=Math[_0x7bb7('0x48')](0xa,_0x4da610)-0x1;return util[_0x7bb7('0x44')]('%s',_[_0x7bb7('0x49')](_0xf96edf,_0x4d6896,_[_0x7bb7('0x4a')](_0x42b543,_0x19f901)[_0x7bb7('0x4b')]()));}exports[_0x7bb7('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x512e78){if(_0x512e78[_0x7bb7('0x2b')]&&_0x512e78['originated']>0x0){_0x512e78[_0x7bb7('0x2b')]-=0x1;}else{logger[_0x7bb7('0x4d')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x7bb7('0x4e')]=decrementOriginate;function checkContactEmpty(_0x5aa6cd){return _0x5aa6cd&&_0x5aa6cd[_0x7bb7('0x4f')]>0x0;}exports[_0x7bb7('0x50')]=checkContactEmpty;function erlangb(_0x5ece53,_0x3b20f2){if(_0x3b20f2===0x0){return 0x0;}var _0x39ddd7=0x1;for(var _0x5847dd=0x1;_0x5847dd<=_0x3b20f2;_0x5847dd+=0x1){_0x39ddd7=0x1+_0x39ddd7*_0x5847dd/_0x5ece53;}return 0x1/_0x39ddd7;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x2503e7,_0x5bdfc0,_0x5d0c79){if(_0x5bdfc0>_0x5d0c79){for(var _0x5b6033=0x0;_0x5b6033<_0x5bdfc0-_0x5d0c79;_0x5b6033+=0x1){decrementOriginate(_0x2503e7);}}}exports[_0x7bb7('0x51')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x51090b){var _0x3b6678={};var _0xb9f96a=['id',_0x7bb7('0x52'),'description',_0x7bb7('0x53'),_0x7bb7('0x54')];if(_0x51090b){for(var _0x3234f3 in _0x51090b){if(typeof _0x51090b[_0x3234f3]!=='undefined'){if(!_[_0x7bb7('0x2f')](_0x51090b[_0x3234f3])&&!_0xb9f96a['includes'](_0x3234f3)){_0x3b6678[util['format'](_0x7bb7('0x55'),_0x7bb7('0x56'),_0x3234f3[_0x7bb7('0x57')]())]=_0x51090b[_0x3234f3];}}}}return _0x3b6678;}exports[_0x7bb7('0x58')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index a871750..3040f66 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(_0x1971ed,_0x57f96e){var _0x97b547=function(_0x271cdf){while(--_0x271cdf){_0x1971ed['push'](_0x1971ed['shift']());}};_0x97b547(++_0x57f96e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x3485cb,_0x3f0ea7){var _0x52d7bd=function(_0x1dc4a0){while(--_0x1dc4a0){_0x3485cb['push'](_0x3485cb['shift']());}};_0x52d7bd(++_0x3f0ea7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 2c21330..e4bb448 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 _0xb31f=['finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','lodash','bluebird','path','tiff2pdf','./util/gs','../../../config/logger','fax','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','receivefax','hangup','syncHangup','syncOriginateResponse','prototype','context','hasOwnProperty','localstationid','uniqueid','channel','name','actions','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','resolution','transferrate','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','parse','.pdf','then','catch','error','\x20notify\x20','stringify','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0xb31f,0x108));var _0xfb31=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xb31f[_0x3e112d];return _0x531c31;};'use strict';var util=require('util');var _=require(_0xfb31('0x0'));var BPromise=require(_0xfb31('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0xfb31('0x2'));var tiff2pdf=require(_0xfb31('0x3'));var gs=require(_0xfb31('0x4'));var logger=require(_0xfb31('0x5'))(_0xfb31('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0xfb31('0x7'));var Action=require(_0xfb31('0x8'));var faxAccount=require(_0xfb31('0x9'));var attachment=require(_0xfb31('0xa'));var faxMessage=require(_0xfb31('0xb'));function Fax(_0x5d105b){this[_0xfb31('0xc')]={};this[_0xfb31('0xd')]=_0x5d105b[_0xfb31('0xd')];this[_0xfb31('0xe')]=_0x5d105b[_0xfb31('0xe')];this['actions']={};ami['on'](_0xfb31('0xf'),this[_0xfb31('0x10')][_0xfb31('0x11')](this));ami['on']('varset',this[_0xfb31('0x12')][_0xfb31('0x11')](this));ami['on'](_0xfb31('0x13'),this[_0xfb31('0x14')][_0xfb31('0x11')](this));ami['on']('newexten',this[_0xfb31('0x15')]['bind'](this));ami['on'](_0xfb31('0x16'),this['syncFaxStatus'][_0xfb31('0x11')](this));ami['on'](_0xfb31('0x17'),this['syncReceiveFax'][_0xfb31('0x11')](this));ami['on'](_0xfb31('0x18'),this[_0xfb31('0x19')][_0xfb31('0x11')](this));ami['on']('originateresponse',this[_0xfb31('0x1a')][_0xfb31('0x11')](this));}Fax[_0xfb31('0x1b')][_0xfb31('0x10')]=function(_0x448697){if(_0x448697[_0xfb31('0x1c')]==='from-voip-provider'){for(var _0x4f55b2 in this[_0xfb31('0xd')]){if(this[_0xfb31('0xd')][_0xfb31('0x1d')](_0x4f55b2)){if(_0x448697['exten']===this['faxAccounts'][_0x4f55b2][_0xfb31('0x1e')]){this[_0xfb31('0xc')][_0x448697[_0xfb31('0x1f')]]={};this[_0xfb31('0xc')][_0x448697[_0xfb31('0x1f')]][_0xfb31('0x20')]=_0x448697[_0xfb31('0x20')];this['channels'][_0x448697[_0xfb31('0x1f')]]['id']=this['faxAccounts'][_0x4f55b2]['id'];this[_0xfb31('0xc')][_0x448697[_0xfb31('0x1f')]][_0xfb31('0x21')]=this[_0xfb31('0xd')][_0x4f55b2][_0xfb31('0x21')];logger['info'](_0x448697[_0xfb31('0x1f')],'\x20syncNewchannel\x20');}}}}if(this[_0xfb31('0x22')][_0x448697['uniqueid']]){this[_0xfb31('0xc')][_0x448697[_0xfb31('0x1f')]]={};this['channels'][_0x448697[_0xfb31('0x1f')]][_0xfb31('0x20')]=_0x448697['channel'];logger[_0xfb31('0x23')](_0x448697['uniqueid'],_0xfb31('0x24'));}};Fax[_0xfb31('0x1b')][_0xfb31('0x12')]=function(_0x366904){if(this[_0xfb31('0xc')][_0x366904[_0xfb31('0x1f')]]){for(var _0x40cbd4 in _0x366904[_0xfb31('0x25')]){if(_0x366904['variable'][_0xfb31('0x1d')](_0x40cbd4)){this['channels'][_0x366904['uniqueid']][_0x40cbd4]=_0x366904['value'];}}}};Fax[_0xfb31('0x1b')][_0xfb31('0x14')]=function(_0x76b2b7){if(this['channels'][_0x76b2b7[_0xfb31('0x1f')]]){this[_0xfb31('0xc')][_0x76b2b7[_0xfb31('0x1f')]][_0xfb31('0x26')]=_0x76b2b7[_0xfb31('0x26')];this['channels'][_0x76b2b7[_0xfb31('0x1f')]]['channelstatedesc']=_0x76b2b7[_0xfb31('0x27')];}};Fax['prototype'][_0xfb31('0x15')]=function(_0x3c2ba6){if(this['channels'][_0x3c2ba6[_0xfb31('0x1f')]]){for(var _0x5bf29e in _0x3c2ba6[_0xfb31('0x25')]){if(_0x3c2ba6[_0xfb31('0x25')][_0xfb31('0x1d')](_0x5bf29e)){this[_0xfb31('0xc')][_0x3c2ba6[_0xfb31('0x1f')]][_0x5bf29e]=_0x3c2ba6[_0xfb31('0x28')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x729af){if(this[_0xfb31('0xc')][_0x729af[_0xfb31('0x1f')]]){this[_0xfb31('0xc')][_0x729af[_0xfb31('0x1f')]][_0xfb31('0x29')]=_0x729af[_0xfb31('0x29')];this[_0xfb31('0xc')][_0x729af[_0xfb31('0x1f')]][_0xfb31('0x2a')]=_0x729af[_0xfb31('0x2a')];this[_0xfb31('0xc')][_0x729af['uniqueid']]['localstationid']=_0x729af[_0xfb31('0x1e')];this[_0xfb31('0xc')][_0x729af[_0xfb31('0x1f')]][_0xfb31('0x2b')]=_0x729af[_0xfb31('0x2b')];logger[_0xfb31('0x23')](_0x729af['uniqueid'],_0xfb31('0x2c'));}};Fax['prototype'][_0xfb31('0x2d')]=function(_0x3aea15){var _0x353f32=this;if(this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]]){var _0x5d5f8f=this['channels'][_0x3aea15[_0xfb31('0x1f')]]['id'];this['channels'][_0x3aea15[_0xfb31('0x1f')]]['remotestationid']=_0x3aea15[_0xfb31('0x2e')];this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]]['pagestransferred']=_0x3aea15['pagestransferred'];this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]][_0xfb31('0x1e')]=_0x3aea15[_0xfb31('0x1e')];this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]][_0xfb31('0x2f')]=_0x3aea15[_0xfb31('0x2f')];this['channels'][_0x3aea15[_0xfb31('0x1f')]][_0xfb31('0x30')]=_0x3aea15['transferrate'];this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]]['filename']=_0x3aea15[_0xfb31('0x2b')];this['channels'][_0x3aea15['uniqueid']][_0xfb31('0x31')]=_0x3aea15[_0xfb31('0x31')];if(this[_0xfb31('0xc')][_0x3aea15[_0xfb31('0x1f')]][_0xfb31('0x32')]>0x0){tiff2pdf(_0x3aea15[_0xfb31('0x2b')],'/var/opt/motion2/server/files/attachments/',function(_0x3da7a3){logger[_0xfb31('0x23')](_0x3aea15['uniqueid'],_0xfb31('0x33'),_0x3da7a3[_0xfb31('0x34')]);attachment['create']({'name':path[_0xfb31('0x35')](_0x3aea15[_0xfb31('0x2b')])[_0xfb31('0x21')],'basename':path['parse'](_0x3aea15[_0xfb31('0x2b')])[_0xfb31('0x21')]+_0xfb31('0x36'),'type':'application/pdf'})[_0xfb31('0x37')](function(_0x516786){faxAccount['notify'](_0x5d5f8f,{'from':_0x3aea15['calleridnum'],'mapKey':_0xfb31('0x6'),'body':path[_0xfb31('0x35')](_0x3aea15[_0xfb31('0x2b')])[_0xfb31('0x21')]+_0xfb31('0x36'),'AttachmentId':_0x516786['id']})[_0xfb31('0x38')](function(_0x278f97){logger[_0xfb31('0x39')](_0x3aea15['uniqueid'],_0xfb31('0x3a'),JSON[_0xfb31('0x3b')](_0x278f97));});})[_0xfb31('0x38')](function(_0x398178){logger[_0xfb31('0x39')](_0x3aea15[_0xfb31('0x1f')],'\x20receiveFax\x20',JSON[_0xfb31('0x3b')](_0x398178));});});}logger[_0xfb31('0x23')](_0x3aea15[_0xfb31('0x1f')],'\x20receiveFax\x20');}};Fax[_0xfb31('0x1b')]['syncOriginateResponse']=function(_0x69e62e){if(this[_0xfb31('0x22')][_0x69e62e[_0xfb31('0x1f')]]){_[_0xfb31('0x3c')](this[_0xfb31('0xc')][_0x69e62e['uniqueid']],_[_0xfb31('0x3d')](_0x69e62e,[_0xfb31('0x3e'),'reason']));}};function updateStatus(_0x4ef492){if(_0x4ef492[_0xfb31('0x3f')]){faxMessage[_0xfb31('0x40')](_0x4ef492[_0xfb31('0x3f')],{'failMessage':_0xfb31('0x41')})[_0xfb31('0x37')](function(_0x42fab0){ut[_0xfb31('0x42')](_0xfb31('0x43'),_0x42fab0);})[_0xfb31('0x38')](function(_0x213ff2){ut['logger'](_0xfb31('0x44'),_0x213ff2);});}else{ut[_0xfb31('0x42')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xfb31('0x1b')][_0xfb31('0x45')]=function(_0x51b630,_0x1afcbe,_0x43562d){var _0x30c517=this;var _0x22e6c7={};if(_0x1afcbe){_0x22e6c7={'read':_0x1afcbe};}else{_0x22e6c7={'failMessage':_0x43562d};}if(this['actions'][_0x51b630][_0xfb31('0x3f')]){faxMessage[_0xfb31('0x40')](this['actions'][_0x51b630]['AttachmentId'],_0x22e6c7)['then'](function(_0x55d830){ut['logger'](_0xfb31('0x46'),_0x55d830);})[_0xfb31('0x38')](function(_0x57081a){ut[_0xfb31('0x42')](_0xfb31('0x47'),_0x57081a);})[_0xfb31('0x48')](function(){delete _0x30c517['channels'][_0x51b630];delete _0x30c517[_0xfb31('0x22')][_0x51b630];});}else{ut[_0xfb31('0x42')]('[Fax][Message][NoUpdate2]');delete this[_0xfb31('0xc')][_0x51b630];delete this[_0xfb31('0x22')][_0x51b630];}};Fax[_0xfb31('0x1b')]['syncHangup']=function(_0x567d99){var _0x1270fe=this;if(this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]]){if(this[_0xfb31('0x22')][_0x567d99[_0xfb31('0x1f')]]){this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]]['id']=this['actions'][_0x567d99[_0xfb31('0x1f')]]['id'];this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]]['name']=this[_0xfb31('0x22')][_0x567d99['uniqueid']]['name'];}logger[_0xfb31('0x23')](_0x567d99[_0xfb31('0x1f')],this[_0xfb31('0x22')][_0x567d99[_0xfb31('0x1f')]]?_0xfb31('0x49'):_0xfb31('0x4a'),JSON['stringify'](this['channels'][_0x567d99[_0xfb31('0x1f')]]));if(this[_0xfb31('0x22')][_0x567d99[_0xfb31('0x1f')]]){if(this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]][_0xfb31('0x4b')]>0x0&&this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]][_0xfb31('0x16')]===_0xfb31('0x4c')){this[_0xfb31('0x45')](_0x567d99[_0xfb31('0x1f')],!![]);}else{this['updateStatus'](_0x567d99[_0xfb31('0x1f')],![],this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]][_0xfb31('0x4d')]?_0xfb31('0x4e')+this[_0xfb31('0xc')][_0x567d99[_0xfb31('0x1f')]][_0xfb31('0x4d')]:_0xfb31('0x4f'));}}}};Fax[_0xfb31('0x1b')][_0xfb31('0x50')]=function(_0x3462c4){var _0x4fff5e=this;return new BPromise(function(_0x1db036,_0x25bbd7){_0x4fff5e[_0xfb31('0x51')](_0x3462c4,_0x4fff5e['faxAccounts'][_0x3462c4[_0xfb31('0x52')]])['then'](function(_0x44d85f){ut[_0xfb31('0x42')]('[Fax][execOriginate][success]',_0x44d85f);_0x1db036(ut[_0xfb31('0x34')](_0xfb31('0x53')));})[_0xfb31('0x38')](function(_0x5b9e0b){ut[_0xfb31('0x42')]('[Fax][execOriginate][failure]',_0x5b9e0b);updateStatus(_0x3462c4);_0x25bbd7(ut[_0xfb31('0x34')]('Fax\x20failed'));});});};Fax['prototype'][_0xfb31('0x54')]=function(_0x3886a3){var _0x792725=this;return new BPromise(function(_0x54cb3b,_0x5e5d7a){var _0x40cbed=_0x792725[_0xfb31('0x55')](_0x792725['faxAccounts'][_0x3886a3['FaxAccountId']][_0xfb31('0x56')],_0x3886a3);if(_0x40cbed[_0xfb31('0x57')]){_0x54cb3b(ut[_0xfb31('0x34')](_0xfb31('0x58')));}else{_0x5e5d7a(ut[_0xfb31('0x34')](_0x40cbed['message']));}});};function originate(_0x274f09,_0x22ddcd,_0x16ecdc){return new BPromise(function(_0xde006,_0xf2eb2f){if(_0x16ecdc){var _0x2be6d6=util[_0xfb31('0x59')](_0xfb31('0x5a'),path['parse'](_0x274f09[_0xfb31('0x2')])[_0xfb31('0x21')],_0x274f09['path']);gs[_0xfb31('0x5b')](_0x2be6d6)[_0xfb31('0x37')](function(){_0x274f09['path']=util[_0xfb31('0x59')](_0xfb31('0x5c'),path[_0xfb31('0x35')](_0x274f09['path'])[_0xfb31('0x5d')],path['parse'](_0x274f09['path'])[_0xfb31('0x21')]);_0x22ddcd[_0xfb31('0x5e')]=_0x274f09[_0xfb31('0x2')];ut['logger'](_0xfb31('0x5f'),'');ami['Action'](ut[_0xfb31('0x60')](_0x274f09,_0x22ddcd))['then'](function(_0x135a0f){_0xde006(_0x135a0f);})[_0xfb31('0x38')](function(_0x1f1414){_0xf2eb2f(_0x1f1414);});})[_0xfb31('0x38')](function(_0x416c37){_0xf2eb2f(_0x416c37);});}else{ami[_0xfb31('0x61')](ut['variablesAction'](_0x274f09,_0x22ddcd))[_0xfb31('0x37')](function(_0x2e1e9b){_0xde006(_0x2e1e9b);})[_0xfb31('0x38')](function(_0x226b0f){_0xf2eb2f(_0x226b0f);});}});}Fax[_0xfb31('0x1b')]['execOriginate']=function(_0x43b8ec,_0x2124f7){var _0x2b004e=this;return new BPromise(function(_0x5f0111,_0x30d500){var _0x1405d5=uuid['v4']();var _0x256032=ut[_0xfb31('0x62')](_0x43b8ec,_0x2124f7);_0x2b004e[_0xfb31('0x22')][_0x1405d5]=new Action(_0x1405d5,_0x2124f7,_0x43b8ec);var _0x3bf167=_0x2b004e[_0xfb31('0x22')][_0x1405d5];if(path[_0xfb31('0x35')](_0x43b8ec[_0xfb31('0x2')])[_0xfb31('0x63')]===_0xfb31('0x36')){originate(_0x3bf167,_0x256032,!![])[_0xfb31('0x37')](function(_0x353709){_0x5f0111(_0x353709);})['catch'](function(_0x49ed24){_0x30d500(_0x49ed24);});}else{originate(_0x3bf167,_0x256032,![])[_0xfb31('0x37')](function(_0x58cd17){_0x5f0111(_0x58cd17);})[_0xfb31('0x38')](function(_0x235731){_0x30d500(_0x235731);});}});};Fax[_0xfb31('0x1b')][_0xfb31('0x64')]=function(_0x38bfdb){return!_['isNil'](_0x38bfdb)&&!_[_0xfb31('0x65')](_0x38bfdb[_0xfb31('0x21')])&&!_[_0xfb31('0x65')](_0x38bfdb[_0xfb31('0x66')])&&_0x38bfdb[_0xfb31('0x66')]&&!_[_0xfb31('0x65')](this[_0xfb31('0xe')][util['format'](_0xfb31('0x67'),_0x38bfdb['name'])])&&!_[_0xfb31('0x65')](this[_0xfb31('0xe')][util[_0xfb31('0x59')](_0xfb31('0x67'),_0x38bfdb[_0xfb31('0x21')])]['status'])&&(this[_0xfb31('0xe')][util[_0xfb31('0x59')](_0xfb31('0x67'),_0x38bfdb[_0xfb31('0x21')])][_0xfb31('0x2a')]==='reachable'||this[_0xfb31('0xe')][util[_0xfb31('0x59')](_0xfb31('0x67'),_0x38bfdb[_0xfb31('0x21')])][_0xfb31('0x2a')]===_0xfb31('0x68'));};Fax[_0xfb31('0x1b')][_0xfb31('0x55')]=function(_0x54359f,_0x5de1d1){if(!this[_0xfb31('0x64')](_0x54359f)){ut[_0xfb31('0x42')](_0xfb31('0x69'),_[_0xfb31('0x65')](_0x54359f)?'':_0x54359f[_0xfb31('0x21')]+_0xfb31('0x6a'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xfb31('0x65')](_0x5de1d1['fax'])){ut['logger'](_0xfb31('0x6b'),JSON[_0xfb31('0x3b')](_0x5de1d1));return{'isValid':![],'message':_0xfb31('0x6c')};}if(_[_0xfb31('0x65')](_0x5de1d1[_0xfb31('0x2')])){ut[_0xfb31('0x42')](_0xfb31('0x6d'),JSON[_0xfb31('0x3b')](_0x5de1d1));return{'isValid':![],'message':_0xfb31('0x6e')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xfb31('0x6f')]=Fax; \ No newline at end of file +var _0x9215=['create','parse','.pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','receivefax','hangup','syncHangup','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message'];(function(_0x4345c1,_0x1a273f){var _0x5f56f5=function(_0x2c32de){while(--_0x2c32de){_0x4345c1['push'](_0x4345c1['shift']());}};_0x5f56f5(++_0x1a273f);}(_0x9215,0x11f));var _0x5921=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x9215[_0x4709c0];return _0x13348b;};'use strict';var util=require('util');var _=require(_0x5921('0x0'));var BPromise=require(_0x5921('0x1'));var uuid=require(_0x5921('0x2'));var moment=require('moment');var path=require(_0x5921('0x3'));var tiff2pdf=require(_0x5921('0x4'));var gs=require(_0x5921('0x5'));var logger=require(_0x5921('0x6'))(_0x5921('0x7'));var ami=require(_0x5921('0x8'));var rpcDb=require(_0x5921('0x9'));var Channel=require('./channel');var ut=require(_0x5921('0xa'));var Action=require(_0x5921('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5921('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2c8323){this[_0x5921('0xd')]={};this['faxAccounts']=_0x2c8323[_0x5921('0xe')];this[_0x5921('0xf')]=_0x2c8323[_0x5921('0xf')];this[_0x5921('0x10')]={};ami['on']('newchannel',this[_0x5921('0x11')][_0x5921('0x12')](this));ami['on']('varset',this[_0x5921('0x13')][_0x5921('0x12')](this));ami['on']('newstate',this[_0x5921('0x14')][_0x5921('0x12')](this));ami['on'](_0x5921('0x15'),this[_0x5921('0x16')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0x5921('0x17'),this['syncReceiveFax']['bind'](this));ami['on'](_0x5921('0x18'),this[_0x5921('0x19')][_0x5921('0x12')](this));ami['on']('originateresponse',this[_0x5921('0x1a')][_0x5921('0x12')](this));}Fax[_0x5921('0x1b')][_0x5921('0x11')]=function(_0x473f6d){if(_0x473f6d['context']===_0x5921('0x1c')){for(var _0x3afbdc in this['faxAccounts']){if(this[_0x5921('0xe')][_0x5921('0x1d')](_0x3afbdc)){if(_0x473f6d['exten']===this[_0x5921('0xe')][_0x3afbdc][_0x5921('0x1e')]){this['channels'][_0x473f6d[_0x5921('0x1f')]]={};this[_0x5921('0xd')][_0x473f6d['uniqueid']][_0x5921('0x20')]=_0x473f6d[_0x5921('0x20')];this[_0x5921('0xd')][_0x473f6d[_0x5921('0x1f')]]['id']=this[_0x5921('0xe')][_0x3afbdc]['id'];this[_0x5921('0xd')][_0x473f6d[_0x5921('0x1f')]][_0x5921('0x21')]=this['faxAccounts'][_0x3afbdc]['name'];logger[_0x5921('0x22')](_0x473f6d[_0x5921('0x1f')],_0x5921('0x23'));}}}}if(this[_0x5921('0x10')][_0x473f6d[_0x5921('0x1f')]]){this[_0x5921('0xd')][_0x473f6d[_0x5921('0x1f')]]={};this['channels'][_0x473f6d[_0x5921('0x1f')]][_0x5921('0x20')]=_0x473f6d[_0x5921('0x20')];logger[_0x5921('0x22')](_0x473f6d[_0x5921('0x1f')],_0x5921('0x23'));}};Fax[_0x5921('0x1b')][_0x5921('0x13')]=function(_0x470ef1){if(this['channels'][_0x470ef1['uniqueid']]){for(var _0xcf7b84 in _0x470ef1[_0x5921('0x24')]){if(_0x470ef1[_0x5921('0x24')][_0x5921('0x1d')](_0xcf7b84)){this[_0x5921('0xd')][_0x470ef1[_0x5921('0x1f')]][_0xcf7b84]=_0x470ef1['value'];}}}};Fax[_0x5921('0x1b')][_0x5921('0x14')]=function(_0x231d97){if(this[_0x5921('0xd')][_0x231d97['uniqueid']]){this[_0x5921('0xd')][_0x231d97[_0x5921('0x1f')]][_0x5921('0x25')]=_0x231d97['channelstate'];this[_0x5921('0xd')][_0x231d97[_0x5921('0x1f')]][_0x5921('0x26')]=_0x231d97['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0x52463d){if(this[_0x5921('0xd')][_0x52463d[_0x5921('0x1f')]]){for(var _0x82218f in _0x52463d[_0x5921('0x24')]){if(_0x52463d['variable'][_0x5921('0x1d')](_0x82218f)){this['channels'][_0x52463d[_0x5921('0x1f')]][_0x82218f]=_0x52463d[_0x5921('0x27')];}}}};Fax[_0x5921('0x1b')]['syncFaxStatus']=function(_0x56f1b6){if(this[_0x5921('0xd')][_0x56f1b6[_0x5921('0x1f')]]){this[_0x5921('0xd')][_0x56f1b6[_0x5921('0x1f')]][_0x5921('0x28')]=_0x56f1b6[_0x5921('0x28')];this[_0x5921('0xd')][_0x56f1b6[_0x5921('0x1f')]][_0x5921('0x29')]=_0x56f1b6[_0x5921('0x29')];this[_0x5921('0xd')][_0x56f1b6['uniqueid']][_0x5921('0x1e')]=_0x56f1b6[_0x5921('0x1e')];this[_0x5921('0xd')][_0x56f1b6['uniqueid']][_0x5921('0x2a')]=_0x56f1b6['filename'];logger[_0x5921('0x22')](_0x56f1b6['uniqueid'],_0x5921('0x2b'));}};Fax['prototype'][_0x5921('0x2c')]=function(_0x54dc51){var _0x5e9709=this;if(this[_0x5921('0xd')][_0x54dc51['uniqueid']]){var _0x4b59db=this['channels'][_0x54dc51[_0x5921('0x1f')]]['id'];this[_0x5921('0xd')][_0x54dc51['uniqueid']][_0x5921('0x2d')]=_0x54dc51['remotestationid'];this[_0x5921('0xd')][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x2e')]=_0x54dc51[_0x5921('0x2e')];this['channels'][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x1e')]=_0x54dc51[_0x5921('0x1e')];this[_0x5921('0xd')][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x2f')]=_0x54dc51['resolution'];this['channels'][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x30')]=_0x54dc51[_0x5921('0x30')];this['channels'][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x2a')]=_0x54dc51[_0x5921('0x2a')];this[_0x5921('0xd')][_0x54dc51[_0x5921('0x1f')]]['calleridnum']=_0x54dc51[_0x5921('0x31')];if(this[_0x5921('0xd')][_0x54dc51[_0x5921('0x1f')]][_0x5921('0x2e')]>0x0){tiff2pdf(_0x54dc51[_0x5921('0x2a')],'/var/opt/motion2/server/files/attachments/',function(_0x583153){logger['info'](_0x54dc51[_0x5921('0x1f')],_0x5921('0x32'),_0x583153[_0x5921('0x33')]);attachment[_0x5921('0x34')]({'name':path[_0x5921('0x35')](_0x54dc51['filename'])[_0x5921('0x21')],'basename':path[_0x5921('0x35')](_0x54dc51[_0x5921('0x2a')])['name']+_0x5921('0x36'),'type':'application/pdf'})[_0x5921('0x37')](function(_0x5ada43){faxAccount['notify'](_0x4b59db,{'from':_0x54dc51[_0x5921('0x31')],'mapKey':'fax','body':path[_0x5921('0x35')](_0x54dc51[_0x5921('0x2a')])[_0x5921('0x21')]+_0x5921('0x36'),'AttachmentId':_0x5ada43['id']})[_0x5921('0x38')](function(_0x36dce0){logger[_0x5921('0x39')](_0x54dc51[_0x5921('0x1f')],_0x5921('0x3a'),JSON[_0x5921('0x3b')](_0x36dce0));});})[_0x5921('0x38')](function(_0xcb62ef){logger['error'](_0x54dc51['uniqueid'],_0x5921('0x3c'),JSON[_0x5921('0x3b')](_0xcb62ef));});});}logger[_0x5921('0x22')](_0x54dc51[_0x5921('0x1f')],_0x5921('0x3c'));}};Fax[_0x5921('0x1b')][_0x5921('0x1a')]=function(_0x3a7f5f){if(this['actions'][_0x3a7f5f[_0x5921('0x1f')]]){_[_0x5921('0x3d')](this[_0x5921('0xd')][_0x3a7f5f[_0x5921('0x1f')]],_['pick'](_0x3a7f5f,[_0x5921('0x3e'),_0x5921('0x3f')]));}};function updateStatus(_0x274f8f){if(_0x274f8f[_0x5921('0x40')]){faxMessage[_0x5921('0x41')](_0x274f8f[_0x5921('0x40')],{'failMessage':_0x5921('0x42')})['then'](function(_0x27d3ed){ut[_0x5921('0x43')](_0x5921('0x44'),_0x27d3ed);})['catch'](function(_0x556f36){ut[_0x5921('0x43')](_0x5921('0x45'),_0x556f36);});}else{ut[_0x5921('0x43')](_0x5921('0x46'));}}Fax['prototype'][_0x5921('0x47')]=function(_0x424d49,_0x1020dd,_0x1c9ed2){var _0x14a79c=this;var _0x40f5d6={};if(_0x1020dd){_0x40f5d6={'read':_0x1020dd};}else{_0x40f5d6={'failMessage':_0x1c9ed2};}if(this[_0x5921('0x10')][_0x424d49][_0x5921('0x40')]){faxMessage[_0x5921('0x41')](this[_0x5921('0x10')][_0x424d49]['AttachmentId'],_0x40f5d6)[_0x5921('0x37')](function(_0x442d90){ut[_0x5921('0x43')](_0x5921('0x48'),_0x442d90);})[_0x5921('0x38')](function(_0x3b88c0){ut[_0x5921('0x43')](_0x5921('0x49'),_0x3b88c0);})['finally'](function(){delete _0x14a79c['channels'][_0x424d49];delete _0x14a79c[_0x5921('0x10')][_0x424d49];});}else{ut[_0x5921('0x43')](_0x5921('0x4a'));delete this[_0x5921('0xd')][_0x424d49];delete this['actions'][_0x424d49];}};Fax[_0x5921('0x1b')][_0x5921('0x19')]=function(_0x3382ca){var _0x5d99c3=this;if(this['channels'][_0x3382ca[_0x5921('0x1f')]]){if(this[_0x5921('0x10')][_0x3382ca[_0x5921('0x1f')]]){this[_0x5921('0xd')][_0x3382ca[_0x5921('0x1f')]]['id']=this[_0x5921('0x10')][_0x3382ca[_0x5921('0x1f')]]['id'];this[_0x5921('0xd')][_0x3382ca[_0x5921('0x1f')]][_0x5921('0x21')]=this[_0x5921('0x10')][_0x3382ca[_0x5921('0x1f')]]['name'];}logger[_0x5921('0x22')](_0x3382ca[_0x5921('0x1f')],this[_0x5921('0x10')][_0x3382ca[_0x5921('0x1f')]]?_0x5921('0x4b'):_0x5921('0x4c'),JSON[_0x5921('0x3b')](this[_0x5921('0xd')][_0x3382ca['uniqueid']]));if(this['actions'][_0x3382ca[_0x5921('0x1f')]]){if(this[_0x5921('0xd')][_0x3382ca[_0x5921('0x1f')]][_0x5921('0x4d')]>0x0&&this[_0x5921('0xd')][_0x3382ca[_0x5921('0x1f')]]['faxstatus']==='SUCCESS'){this[_0x5921('0x47')](_0x3382ca[_0x5921('0x1f')],!![]);}else{this[_0x5921('0x47')](_0x3382ca['uniqueid'],![],this[_0x5921('0xd')][_0x3382ca[_0x5921('0x1f')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this['channels'][_0x3382ca['uniqueid']][_0x5921('0x4e')]:_0x5921('0x4f'));}}}};Fax[_0x5921('0x1b')][_0x5921('0x50')]=function(_0x57b35c){var _0x144ffb=this;return new BPromise(function(_0x4b9e8d,_0xef946a){_0x144ffb[_0x5921('0x51')](_0x57b35c,_0x144ffb[_0x5921('0xe')][_0x57b35c['FaxAccountId']])['then'](function(_0x4822eb){ut[_0x5921('0x43')](_0x5921('0x52'),_0x4822eb);_0x4b9e8d(ut[_0x5921('0x33')](_0x5921('0x53')));})[_0x5921('0x38')](function(_0x45f7bb){ut[_0x5921('0x43')](_0x5921('0x54'),_0x45f7bb);updateStatus(_0x57b35c);_0xef946a(ut['message'](_0x5921('0x55')));});});};Fax[_0x5921('0x1b')][_0x5921('0x56')]=function(_0x1c1df8){var _0x20d05e=this;return new BPromise(function(_0x51daf9,_0x2087bf){var _0x432f30=_0x20d05e[_0x5921('0x57')](_0x20d05e[_0x5921('0xe')][_0x1c1df8[_0x5921('0x58')]]['Trunk'],_0x1c1df8);if(_0x432f30[_0x5921('0x59')]){_0x51daf9(ut[_0x5921('0x33')]('Trunk\x20Reachable'));}else{_0x2087bf(ut['message'](_0x432f30[_0x5921('0x33')]));}});};function originate(_0x863b49,_0x516ef6,_0x5ad625){return new BPromise(function(_0x4b0e61,_0x4d0370){if(_0x5ad625){var _0x6f461e=util[_0x5921('0x5a')](_0x5921('0x5b'),path[_0x5921('0x35')](_0x863b49['path'])[_0x5921('0x21')],_0x863b49['path']);gs[_0x5921('0x5c')](_0x6f461e)[_0x5921('0x37')](function(){_0x863b49[_0x5921('0x3')]=util[_0x5921('0x5a')](_0x5921('0x5d'),path[_0x5921('0x35')](_0x863b49[_0x5921('0x3')])[_0x5921('0x5e')],path['parse'](_0x863b49[_0x5921('0x3')])['name']);_0x516ef6[_0x5921('0x5f')]=_0x863b49[_0x5921('0x3')];ut[_0x5921('0x43')](_0x5921('0x60'),'');ami['Action'](ut[_0x5921('0x61')](_0x863b49,_0x516ef6))[_0x5921('0x37')](function(_0x1e518d){_0x4b0e61(_0x1e518d);})[_0x5921('0x38')](function(_0x392f87){_0x4d0370(_0x392f87);});})[_0x5921('0x38')](function(_0x825d43){_0x4d0370(_0x825d43);});}else{ami[_0x5921('0x62')](ut[_0x5921('0x61')](_0x863b49,_0x516ef6))[_0x5921('0x37')](function(_0x467e22){_0x4b0e61(_0x467e22);})[_0x5921('0x38')](function(_0xf3529c){_0x4d0370(_0xf3529c);});}});}Fax[_0x5921('0x1b')][_0x5921('0x51')]=function(_0x308bf5,_0x3e1aac){var _0x34d0f1=this;return new BPromise(function(_0x456901,_0x23b561){var _0x18116d=uuid['v4']();var _0x262cd0=ut[_0x5921('0x63')](_0x308bf5,_0x3e1aac);_0x34d0f1[_0x5921('0x10')][_0x18116d]=new Action(_0x18116d,_0x3e1aac,_0x308bf5);var _0x4745e8=_0x34d0f1['actions'][_0x18116d];if(path[_0x5921('0x35')](_0x308bf5[_0x5921('0x3')])['ext']==='.pdf'){originate(_0x4745e8,_0x262cd0,!![])['then'](function(_0x5ba466){_0x456901(_0x5ba466);})[_0x5921('0x38')](function(_0x1103d8){_0x23b561(_0x1103d8);});}else{originate(_0x4745e8,_0x262cd0,![])[_0x5921('0x37')](function(_0x40cdd3){_0x456901(_0x40cdd3);})[_0x5921('0x38')](function(_0x5494e5){_0x23b561(_0x5494e5);});}});};Fax[_0x5921('0x1b')][_0x5921('0x64')]=function(_0xbe5a55){return!_['isNil'](_0xbe5a55)&&!_[_0x5921('0x65')](_0xbe5a55[_0x5921('0x21')])&&!_[_0x5921('0x65')](_0xbe5a55['active'])&&_0xbe5a55[_0x5921('0x66')]&&!_[_0x5921('0x65')](this['trunks'][util[_0x5921('0x5a')](_0x5921('0x67'),_0xbe5a55[_0x5921('0x21')])])&&!_[_0x5921('0x65')](this[_0x5921('0xf')][util['format'](_0x5921('0x67'),_0xbe5a55[_0x5921('0x21')])]['status'])&&(this['trunks'][util[_0x5921('0x5a')]('SIP/%s',_0xbe5a55[_0x5921('0x21')])]['status']===_0x5921('0x68')||this[_0x5921('0xf')][util[_0x5921('0x5a')](_0x5921('0x67'),_0xbe5a55[_0x5921('0x21')])][_0x5921('0x29')]===_0x5921('0x69'));};Fax['prototype']['checkTrunk']=function(_0x2e69c5,_0x4f34fc){if(!this['isTrunkReachable'](_0x2e69c5)){ut[_0x5921('0x43')](_0x5921('0x6a'),_[_0x5921('0x65')](_0x2e69c5)?'':_0x2e69c5[_0x5921('0x21')]+_0x5921('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x5921('0x65')](_0x4f34fc[_0x5921('0x7')])){ut['logger'](_0x5921('0x6c'),JSON[_0x5921('0x3b')](_0x4f34fc));return{'isValid':![],'message':_0x5921('0x6d')};}if(_[_0x5921('0x65')](_0x4f34fc[_0x5921('0x3')])){ut[_0x5921('0x43')](_0x5921('0x6e'),JSON['stringify'](_0x4f34fc));return{'isValid':![],'message':_0x5921('0x6f')};}return{'isValid':!![],'message':_0x5921('0x70')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 8cedcb8..90b5cf5 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 _0xe1c4=['inspect','notify','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1c4,0xb5));var _0x4e1c=function(_0x5d9c31,_0x46a08d){_0x5d9c31=_0x5d9c31-0x0;var _0x579098=_0xe1c4[_0x5d9c31];return _0x579098;};'use strict';var util=require(_0x4e1c('0x0'));var BPromise=require(_0x4e1c('0x1'));var logger=require(_0x4e1c('0x2'))(_0x4e1c('0x3'));var _=require('lodash');var faxAccount=require(_0x4e1c('0x4'));function loggerCatch(_0xa175eb){return function(_0x3ccfeb){logger[_0x4e1c('0x5')](_0xa175eb,util[_0x4e1c('0x6')](_0x3ccfeb,{'showHidden':![],'depth':null}));};}exports[_0x4e1c('0x7')]=function(_0x4f6acd,_0x484bb1){return BPromise['resolve']()[_0x4e1c('0x8')](faxAccount['notify'](_0x4f6acd,_0x484bb1))[_0x4e1c('0x9')](loggerCatch(_0x4e1c('0xa')));}; \ No newline at end of file +var _0x7da5=['[Notify]\x20','util','../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x51a549,_0x1dd44b){var _0x349bf9=function(_0x57e7f0){while(--_0x57e7f0){_0x51a549['push'](_0x51a549['shift']());}};_0x349bf9(++_0x1dd44b);}(_0x7da5,0x182));var _0x57da=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7da5[_0x3ff085];return _0x2b68c3;};'use strict';var util=require(_0x57da('0x0'));var BPromise=require('bluebird');var logger=require(_0x57da('0x1'))(_0x57da('0x2'));var _=require('lodash');var faxAccount=require(_0x57da('0x3'));function loggerCatch(_0x5dae4f){return function(_0x4cc68b){logger[_0x57da('0x4')](_0x5dae4f,util[_0x57da('0x5')](_0x4cc68b,{'showHidden':![],'depth':null}));};}exports[_0x57da('0x6')]=function(_0x669b8b,_0x3a05bf){return BPromise[_0x57da('0x7')]()[_0x57da('0x8')](faxAccount['notify'](_0x669b8b,_0x3a05bf))[_0x57da('0x9')](loggerCatch(_0x57da('0xa')));}; \ 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 543b720..f6aa07a 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 _0xd020=['../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs','util'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xd020,0x87));var _0x0d02=function(_0x31d707,_0x733c2b){_0x31d707=_0x31d707-0x0;var _0x3ff20d=_0xd020[_0x31d707];return _0x3ff20d;};'use strict';var util=require(_0x0d02('0x0'));var logger=require(_0x0d02('0x1'))(_0x0d02('0x2'));var BPromise=require(_0x0d02('0x3'));var exec=require(_0x0d02('0x4'))[_0x0d02('0x5')];exports['execute']=function(_0x1f7c2e){return new BPromise(function(_0xd0e81b,_0x342bd2){exec(_0x1f7c2e,function(_0x163006,_0x50a319,_0x2d3679){logger[_0x0d02('0x6')](_0x0d02('0x7'),_0x50a319);if(_0x163006){logger[_0x0d02('0x6')](_0x0d02('0x7'),'\x20Error\x20:',util['inspect'](_0x163006,{'showHidden':![],'depth':null}),_0x50a319,_0x2d3679);_0x342bd2(_0x163006);}_0xd0e81b(_0x50a319);});});}; \ No newline at end of file +var _0xc083=['execute','info','Exec\x20gs','\x20Error\x20:','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xc083,0x1ab));var _0x3c08=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc083[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var logger=require(_0x3c08('0x0'))(_0x3c08('0x1'));var BPromise=require(_0x3c08('0x2'));var exec=require(_0x3c08('0x3'))[_0x3c08('0x4')];exports[_0x3c08('0x5')]=function(_0x198401){return new BPromise(function(_0x3dded4,_0x177881){exec(_0x198401,function(_0x1fff44,_0x20bf53,_0x1aebbd){logger[_0x3c08('0x6')](_0x3c08('0x7'),_0x20bf53);if(_0x1fff44){logger[_0x3c08('0x6')](_0x3c08('0x7'),_0x3c08('0x8'),util['inspect'](_0x1fff44,{'showHidden':![],'depth':null}),_0x20bf53,_0x1aebbd);_0x177881(_0x1fff44);}_0x3dded4(_0x20bf53);});});}; \ 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 6743e4b..6fe4637 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 _0x06e0=['util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','headerinfo'];(function(_0x3ee771,_0x2b8251){var _0x1e99fa=function(_0x25dcd4){while(--_0x25dcd4){_0x3ee771['push'](_0x3ee771['shift']());}};_0x1e99fa(++_0x2b8251);}(_0x06e0,0x16c));var _0x006e=function(_0x3733eb,_0x2d9450){_0x3733eb=_0x3733eb-0x0;var _0x4c80e3=_0x06e0[_0x3733eb];return _0x4c80e3;};'use strict';var util=require(_0x006e('0x0'));var _=require(_0x006e('0x1'));var moment=require(_0x006e('0x2'));var logger=require(_0x006e('0x3'))(_0x006e('0x4'));exports[_0x006e('0x5')]=function(_0x33518e){return{'message':_0x33518e};};exports[_0x006e('0x6')]=function(_0x2b52bb,_0x5e93b5){logger[_0x006e('0x7')](_0x2b52bb,util[_0x006e('0x8')](_0x5e93b5,{'showHidden':![],'depth':null}));};exports[_0x006e('0x9')]=function(_0x223bd4,_0x4e8a92){var _0x495a3f={'XMF-ECM':_0x4e8a92[_0x006e('0xa')],'XMF-HEADERINFO':_0x4e8a92['headerinfo'],'XMF-MINRATE':_0x4e8a92[_0x006e('0xb')],'XMF-MAXRATE':_0x4e8a92[_0x006e('0xc')],'XMF-MODEM':util[_0x006e('0xd')](_0x006e('0xe'),_0x4e8a92[_0x006e('0xf')]),'XMF-GATEWAY':_0x4e8a92[_0x006e('0x10')],'XMF-FAXDETECT':_0x4e8a92['faxdetect'],'XMF-T38TIMEOUT':_0x4e8a92['t38timeout'],'XMF-LOCALSTATIONID':_0x4e8a92[_0x006e('0x11')],'XMF-PATH':_0x223bd4[_0x006e('0x12')]};return _0x495a3f;};exports[_0x006e('0x13')]=function(_0x20b5ba,_0x26937a){return{'actionid':_0x20b5ba[_0x006e('0x14')],'action':_0x006e('0x15'),'channel':_0x20b5ba[_0x006e('0x16')],'Exten':_0x006e('0x17'),'Context':_0x006e('0x18'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x20b5ba['headerinfo']?_0x20b5ba[_0x006e('0x19')]:'',_0x20b5ba[_0x006e('0x11')]),'variable':_0x26937a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x20b5ba[_0x006e('0x14')]};}; \ No newline at end of file +var _0x7d3c=['faxdetect','t38timeout','variablesAction','uniqueid','originate','channel','format','\x22%s\x22\x20<%s>','localstationid','util','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7d3c,0x9c));var _0xc7d3=function(_0x98e540,_0x4c0ee1){_0x98e540=_0x98e540-0x0;var _0x392fb8=_0x7d3c[_0x98e540];return _0x392fb8;};'use strict';var util=require(_0xc7d3('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0xc7d3('0x1'));exports[_0xc7d3('0x2')]=function(_0x522ccb){return{'message':_0x522ccb};};exports['logger']=function(_0x2eecb0,_0x5093b1){logger[_0xc7d3('0x3')](_0x2eecb0,util[_0xc7d3('0x4')](_0x5093b1,{'showHidden':![],'depth':null}));};exports[_0xc7d3('0x5')]=function(_0x1dbd32,_0x50674c){var _0x3b97c1={'XMF-ECM':_0x50674c[_0xc7d3('0x6')],'XMF-HEADERINFO':_0x50674c[_0xc7d3('0x7')],'XMF-MINRATE':_0x50674c[_0xc7d3('0x8')],'XMF-MAXRATE':_0x50674c['maxrate'],'XMF-MODEM':util['format'](_0xc7d3('0x9'),_0x50674c[_0xc7d3('0xa')]),'XMF-GATEWAY':_0x50674c[_0xc7d3('0xb')],'XMF-FAXDETECT':_0x50674c[_0xc7d3('0xc')],'XMF-T38TIMEOUT':_0x50674c[_0xc7d3('0xd')],'XMF-LOCALSTATIONID':_0x50674c['localstationid'],'XMF-PATH':_0x1dbd32['path']};return _0x3b97c1;};exports[_0xc7d3('0xe')]=function(_0x2d60c4,_0x3c2a10){return{'actionid':_0x2d60c4[_0xc7d3('0xf')],'action':_0xc7d3('0x10'),'channel':_0x2d60c4[_0xc7d3('0x11')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xc7d3('0x12')](_0xc7d3('0x13'),_0x2d60c4[_0xc7d3('0x7')]?_0x2d60c4[_0xc7d3('0x7')]:'',_0x2d60c4[_0xc7d3('0x14')]),'variable':_0x3c2a10,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2d60c4[_0xc7d3('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 7791984..7df4e65 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 _0xa0a6=['getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initZohoAccounts'];(function(_0x59ea98,_0x1c6943){var _0x31866b=function(_0x1f590e){while(--_0x1f590e){_0x59ea98['push'](_0x59ea98['shift']());}};_0x31866b(++_0x1c6943);}(_0xa0a6,0x12d));var _0x6a0a=function(_0x47eeba,_0x3c007a){_0x47eeba=_0x47eeba-0x0;var _0x55b858=_0xa0a6[_0x47eeba];return _0x55b858;};'use strict';var util=require('util');var moment=require(_0x6a0a('0x0'));var server=require('./server');var Realtime=require(_0x6a0a('0x1'));var Report=require(_0x6a0a('0x2'));var Acw=require(_0x6a0a('0x3'));var Trigger=require(_0x6a0a('0x4'));var Dialer=require(_0x6a0a('0x5'));var Preview=require('./preview');var Fax=require(_0x6a0a('0x6'));var user=require(_0x6a0a('0x7'));var voiceQueue=require(_0x6a0a('0x8'));var voiceQueueReport=require(_0x6a0a('0x9'));var voiceCallReport=require(_0x6a0a('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x6a0a('0xb'));var template=require(_0x6a0a('0xc'));var cmHopperHistory=require(_0x6a0a('0xd'));var campaign=require(_0x6a0a('0xe'));var voiceExtension=require(_0x6a0a('0xf'));var faxAccount=require(_0x6a0a('0x10'));var zendesk=require(_0x6a0a('0x11'));var salesforce=require(_0x6a0a('0x12'));var sugarcrm=require(_0x6a0a('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x6a0a('0x14'));var zoho=require(_0x6a0a('0x15'));var vtiger=require(_0x6a0a('0x16'));var freshsales=require(_0x6a0a('0x17'));var servicenow=require(_0x6a0a('0x18'));var dynamics365=require(_0x6a0a('0x19'));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(_0x6a0a('0x1a'))(_0x6a0a('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6a0a('0x1c')](_0x6a0a('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6a0a('0x1c')](_0x6a0a('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6a0a('0x1e')]()[_0x6a0a('0x1f')](user['getAgents']())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x20')]())[_0x6a0a('0x1f')](user['getTelephones']())[_0x6a0a('0x1f')](realtime['initTelephones']())[_0x6a0a('0x1f')](trunk[_0x6a0a('0x21')]())[_0x6a0a('0x1f')](realtime['initTrunks']())['then'](voiceQueue[_0x6a0a('0x22')]())[_0x6a0a('0x1f')](realtime['initVoiceQueues']())['then'](trigger[_0x6a0a('0x23')]())['then'](realtime[_0x6a0a('0x24')]())[_0x6a0a('0x1f')](template[_0x6a0a('0x25')]())[_0x6a0a('0x1f')](realtime['initTemplates']())[_0x6a0a('0x1f')](zendesk['getZendeskAccounts']())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x26')]())[_0x6a0a('0x1f')](salesforce[_0x6a0a('0x27')]())['then'](realtime['initSalesforceAccounts']())[_0x6a0a('0x1f')](sugarcrm[_0x6a0a('0x28')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x29')]())[_0x6a0a('0x1f')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x6a0a('0x2a')]())[_0x6a0a('0x1f')](desk['getDeskAccounts']())[_0x6a0a('0x1f')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())['then'](realtime[_0x6a0a('0x2b')]())[_0x6a0a('0x1f')](vtiger[_0x6a0a('0x2c')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x2d')]())[_0x6a0a('0x1f')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x6a0a('0x2e')]())['then'](servicenow[_0x6a0a('0x2f')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x30')]())[_0x6a0a('0x1f')](dynamics365[_0x6a0a('0x31')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x32')]())[_0x6a0a('0x1f')](campaign[_0x6a0a('0x33')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x34')]())[_0x6a0a('0x1f')](voiceExtension[_0x6a0a('0x35')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x36')]())['then'](faxAccount['getFaxAccounts']())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x37')]())[_0x6a0a('0x1f')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x6a0a('0x1f')](voiceQueueReport[_0x6a0a('0x38')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x39')]())[_0x6a0a('0x1f')](cmHopperHistory[_0x6a0a('0x3a')]())[_0x6a0a('0x1f')](realtime['initVoiceQueueHopperHistory']())[_0x6a0a('0x1f')](cmHopperHistory[_0x6a0a('0x3b')]())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x3c')]())[_0x6a0a('0x1f')](voiceCallReport['getVoiceCallReports']())[_0x6a0a('0x1f')](realtime[_0x6a0a('0x3d')]())[_0x6a0a('0x3e')](function(_0x513692){logger[_0x6a0a('0x3f')](_0x6a0a('0x40'),util[_0x6a0a('0x41')](_0x513692,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6a0a('0x42')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x6a0a('0x1f')](function(){return initParams();})[_0x6a0a('0x1f')](function(){report[_0x6a0a('0x43')]();setInterval(initRealtime,0x1388);})[_0x6a0a('0x3e')](function(_0x4ebe35){logger[_0x6a0a('0x3f')](_0x6a0a('0x44'),util[_0x6a0a('0x41')](_0x4ebe35,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x0b13=['initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x0b13,0x150));var _0x30b1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0b13[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x30b1('0x0'));var moment=require(_0x30b1('0x1'));var server=require(_0x30b1('0x2'));var Realtime=require(_0x30b1('0x3'));var Report=require(_0x30b1('0x4'));var Acw=require(_0x30b1('0x5'));var Trigger=require(_0x30b1('0x6'));var Dialer=require(_0x30b1('0x7'));var Preview=require(_0x30b1('0x8'));var Fax=require(_0x30b1('0x9'));var user=require(_0x30b1('0xa'));var voiceQueue=require(_0x30b1('0xb'));var voiceQueueReport=require(_0x30b1('0xc'));var voiceCallReport=require(_0x30b1('0xd'));var trunk=require(_0x30b1('0xe'));var trigger=require(_0x30b1('0xf'));var template=require(_0x30b1('0x10'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x30b1('0x11'));var voiceExtension=require(_0x30b1('0x12'));var faxAccount=require(_0x30b1('0x13'));var zendesk=require(_0x30b1('0x14'));var salesforce=require(_0x30b1('0x15'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x30b1('0x16'));var desk=require(_0x30b1('0x17'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x30b1('0x18'));var servicenow=require(_0x30b1('0x19'));var dynamics365=require(_0x30b1('0x1a'));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(_0x30b1('0x1b'))(_0x30b1('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x30b1('0x1d')](_0x30b1('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x30b1('0x1d')](_0x30b1('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x30b1('0x1f')]()[_0x30b1('0x20')](user[_0x30b1('0x21')]())[_0x30b1('0x20')](realtime['initAgents']())[_0x30b1('0x20')](user['getTelephones']())[_0x30b1('0x20')](realtime[_0x30b1('0x22')]())[_0x30b1('0x20')](trunk[_0x30b1('0x23')]())[_0x30b1('0x20')](realtime[_0x30b1('0x24')]())[_0x30b1('0x20')](voiceQueue[_0x30b1('0x25')]())[_0x30b1('0x20')](realtime[_0x30b1('0x26')]())[_0x30b1('0x20')](trigger[_0x30b1('0x27')]())[_0x30b1('0x20')](realtime[_0x30b1('0x28')]())[_0x30b1('0x20')](template['getTemplates']())[_0x30b1('0x20')](realtime[_0x30b1('0x29')]())['then'](zendesk[_0x30b1('0x2a')]())['then'](realtime[_0x30b1('0x2b')]())[_0x30b1('0x20')](salesforce[_0x30b1('0x2c')]())[_0x30b1('0x20')](realtime['initSalesforceAccounts']())[_0x30b1('0x20')](sugarcrm[_0x30b1('0x2d')]())[_0x30b1('0x20')](realtime['initSugarcrmAccounts']())[_0x30b1('0x20')](freshdesk[_0x30b1('0x2e')]())[_0x30b1('0x20')](realtime[_0x30b1('0x2f')]())[_0x30b1('0x20')](desk[_0x30b1('0x30')]())[_0x30b1('0x20')](realtime[_0x30b1('0x31')]())[_0x30b1('0x20')](zoho[_0x30b1('0x32')]())[_0x30b1('0x20')](realtime[_0x30b1('0x33')]())[_0x30b1('0x20')](vtiger['getVtigerAccounts']())[_0x30b1('0x20')](realtime[_0x30b1('0x34')]())[_0x30b1('0x20')](freshsales[_0x30b1('0x35')]())[_0x30b1('0x20')](realtime[_0x30b1('0x36')]())[_0x30b1('0x20')](servicenow['getServicenowAccounts']())[_0x30b1('0x20')](realtime[_0x30b1('0x37')]())['then'](dynamics365[_0x30b1('0x38')]())['then'](realtime[_0x30b1('0x39')]())[_0x30b1('0x20')](campaign[_0x30b1('0x3a')]())[_0x30b1('0x20')](realtime['initCampaigns']())['then'](voiceExtension['getVoiceExtensions']())[_0x30b1('0x20')](realtime[_0x30b1('0x3b')]())[_0x30b1('0x20')](faxAccount[_0x30b1('0x3c')]())[_0x30b1('0x20')](realtime[_0x30b1('0x3d')]())[_0x30b1('0x20')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x30b1('0x20')](voiceQueueReport[_0x30b1('0x3e')]())[_0x30b1('0x20')](realtime[_0x30b1('0x3f')]())[_0x30b1('0x20')](cmHopperHistory[_0x30b1('0x40')]())['then'](realtime[_0x30b1('0x41')]())[_0x30b1('0x20')](cmHopperHistory[_0x30b1('0x42')]())[_0x30b1('0x20')](realtime[_0x30b1('0x43')]())[_0x30b1('0x20')](voiceCallReport['getVoiceCallReports']())[_0x30b1('0x20')](realtime[_0x30b1('0x44')]())['catch'](function(_0x4f946b){logger[_0x30b1('0x45')](_0x30b1('0x46'),util[_0x30b1('0x47')](_0x4f946b,{'showHidden':![],'depth':null}));});}function main(){return server[_0x30b1('0x48')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x30b1('0x20')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x59d590){logger[_0x30b1('0x45')](_0x30b1('0x49'),util[_0x30b1('0x47')](_0x59d590,{'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 e5458b4..7ee8a37 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 _0x36ca=['updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','onhold','stringify','user:%s','user:save','emit','exports','util','moment','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','email','accountcode','fullname','stateTime','status','unknown','address','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local'];(function(_0x307bd4,_0x324e6f){var _0x9210a6=function(_0x291e6c){while(--_0x291e6c){_0x307bd4['push'](_0x307bd4['shift']());}};_0x9210a6(++_0x324e6f);}(_0x36ca,0x137));var _0xa36c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x36ca[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xa36c('0x0'));var moment=require(_0xa36c('0x1'));var md5=require(_0xa36c('0x2'));var Redis=require(_0xa36c('0x3'));var config=require(_0xa36c('0x4'));config['redis']=_['defaults'](config[_0xa36c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa36c('0x6'))(new Redis(config[_0xa36c('0x5')]));function Agent(_0x5210e4){this['id']=_0x5210e4['id']||0x0;this['name']=_0x5210e4[_0xa36c('0x7')]||'';this[_0xa36c('0x8')]=_0x5210e4['email']||'';this['accountcode']=_0x5210e4[_0xa36c('0x9')]||'';this[_0xa36c('0xa')]=_0x5210e4['fullname']||'';this['state']='unknown';this[_0xa36c('0xb')]=0x0;this[_0xa36c('0xc')]=_0xa36c('0xd');this[_0xa36c('0xe')]='';this['phone']='';this['mobile']='';this[_0xa36c('0xf')]='';this[_0xa36c('0x10')]=_0x5210e4['online']||![];this[_0xa36c('0x11')]=_0xa36c('0xd');this[_0xa36c('0x12')]=0x0;this[_0xa36c('0x13')]='';this[_0xa36c('0x14')]='';this['onhold']=![];this[_0xa36c('0x15')]=![];this[_0xa36c('0x2')]='';}Agent['prototype'][_0xa36c('0x16')]=function(_0x42e452){var _0x28e4d4;if(_0x42e452&&_0x42e452[_0xa36c('0x17')]){_0x28e4d4=_0x42e452[_0xa36c('0x17')][_0xa36c('0x18')]();switch(_0x28e4d4){case _0xa36c('0x19'):_0x28e4d4=_0xa36c('0x1a');break;case _0xa36c('0x1b'):_0x28e4d4=_0xa36c('0x1c');break;}}if(_0x28e4d4&&this['voiceStatus']!==_0x28e4d4||_0x42e452[_0xa36c('0x1d')]){this[_0xa36c('0x12')]=_['toNumber'](moment()[_0xa36c('0x1e')]('x'));}if(_0x28e4d4){this['voiceStatus']=_0x28e4d4;}var _0x181700={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xa36c('0x9')],'fullname':this[_0xa36c('0xa')],'state':this[_0xa36c('0x17')],'stateTime':this['stateTime'],'status':this[_0xa36c('0xc')],'address':this[_0xa36c('0xe')],'online':this['online'],'voiceStatus':this[_0xa36c('0x11')],'voiceStatusTime':this[_0xa36c('0x12')],'voiceStatusCallerIdNumber':this[_0xa36c('0x13')],'voiceStatusQueue':this[_0xa36c('0x14')],'interface':this[_0xa36c('0xf')],'onhold':this[_0xa36c('0x1f')]};var _0x154a1a=md5(JSON[_0xa36c('0x20')](_0x181700));if(this[_0xa36c('0x2')]!==_0x154a1a){this[_0xa36c('0x2')]=_0x154a1a;io['to'](util[_0xa36c('0x1e')](_0xa36c('0x21'),_0x181700['name']))['emit'](_0xa36c('0x22'),_0x181700);io[_0xa36c('0x23')]('user:presence',_0x181700);}};module[_0xa36c('0x24')]=Agent; \ No newline at end of file +var _0x1433=['unknown','stateTime','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','toNumber','voiceStatus','name','format','user:%s','emit','lodash','util','moment','md5','../../../config/environment','redis','localhost','socket.io-emitter','email','accountcode','fullname','state'];(function(_0xc4c719,_0x4fae92){var _0x334409=function(_0x3a4282){while(--_0x3a4282){_0xc4c719['push'](_0xc4c719['shift']());}};_0x334409(++_0x4fae92);}(_0x1433,0x152));var _0x3143=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1433[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3143('0x0'));var util=require(_0x3143('0x1'));var moment=require(_0x3143('0x2'));var md5=require(_0x3143('0x3'));var Redis=require('ioredis');var config=require(_0x3143('0x4'));config[_0x3143('0x5')]=_['defaults'](config[_0x3143('0x5')],{'host':_0x3143('0x6'),'port':0x18eb});var io=require(_0x3143('0x7'))(new Redis(config[_0x3143('0x5')]));function Agent(_0x303195){this['id']=_0x303195['id']||0x0;this['name']=_0x303195['name']||'';this[_0x3143('0x8')]=_0x303195[_0x3143('0x8')]||'';this[_0x3143('0x9')]=_0x303195[_0x3143('0x9')]||'';this[_0x3143('0xa')]=_0x303195['fullname']||'';this[_0x3143('0xb')]=_0x3143('0xc');this[_0x3143('0xd')]=0x0;this['status']=_0x3143('0xc');this['address']='';this[_0x3143('0xe')]='';this[_0x3143('0xf')]='';this[_0x3143('0x10')]='';this[_0x3143('0x11')]=_0x303195['online']||![];this['voiceStatus']='unknown';this[_0x3143('0x12')]=0x0;this[_0x3143('0x13')]='';this[_0x3143('0x14')]='';this[_0x3143('0x15')]=![];this[_0x3143('0x16')]=![];this[_0x3143('0x3')]='';}Agent[_0x3143('0x17')][_0x3143('0x18')]=function(_0x5348da){var _0x196191;if(_0x5348da&&_0x5348da['state']){_0x196191=_0x5348da['state'][_0x3143('0x19')]();switch(_0x196191){case'not_inuse':_0x196191=_0x3143('0x1a');break;case _0x3143('0x1b'):_0x196191=_0x3143('0x1c');break;}}if(_0x196191&&this['voiceStatus']!==_0x196191||_0x5348da['statePause']){this[_0x3143('0x12')]=_[_0x3143('0x1d')](moment()['format']('x'));}if(_0x196191){this[_0x3143('0x1e')]=_0x196191;}var _0x3fbe5e={'id':this['id'],'name':this[_0x3143('0x1f')],'email':this['email'],'accountcode':this[_0x3143('0x9')],'fullname':this[_0x3143('0xa')],'state':this[_0x3143('0xb')],'stateTime':this[_0x3143('0xd')],'status':this['status'],'address':this['address'],'online':this[_0x3143('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3143('0x12')],'voiceStatusCallerIdNumber':this[_0x3143('0x13')],'voiceStatusQueue':this[_0x3143('0x14')],'interface':this[_0x3143('0x10')],'onhold':this[_0x3143('0x15')]};var _0x2335b0=md5(JSON['stringify'](_0x3fbe5e));if(this[_0x3143('0x3')]!==_0x2335b0){this[_0x3143('0x3')]=_0x2335b0;io['to'](util[_0x3143('0x20')](_0x3143('0x21'),_0x3fbe5e[_0x3143('0x1f')]))[_0x3143('0x22')]('user:save',_0x3fbe5e);io['emit']('user:presence',_0x3fbe5e);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 5628874..111ae9b 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 _0xa26a=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa26a,0xa0));var _0xaa26=function(_0x3df5c9,_0x2ef63c){_0x3df5c9=_0x3df5c9-0x0;var _0x311c0a=_0xa26a[_0x3df5c9];return _0x311c0a;};'use strict';function Campaign(_0x33615e){this['id']=_0x33615e['id']||0x0;this[_0xaa26('0x0')]=_0x33615e[_0xaa26('0x0')]||'';this[_0xaa26('0x1')]=_0x33615e['type']||_0xaa26('0x2');this[_0xaa26('0x3')]=0x0;this[_0xaa26('0x4')]=0x0;this[_0xaa26('0x5')]=0x0;this[_0xaa26('0x6')]=0x0;this[_0xaa26('0x7')]='';this[_0xaa26('0x8')]=!![];this['active']=_0x33615e[_0xaa26('0x9')];this[_0xaa26('0xa')]=_0x33615e[_0xaa26('0xa')];this[_0xaa26('0xb')]=_0x33615e[_0xaa26('0xb')]||null;this[_0xaa26('0xc')]=_0x33615e[_0xaa26('0xc')]?_0x33615e[_0xaa26('0xc')]:null;this[_0xaa26('0xd')]=_0x33615e[_0xaa26('0xd')];this[_0xaa26('0xe')]=_0x33615e[_0xaa26('0xe')];this[_0xaa26('0xf')]=_0x33615e['dialOriginateTimeout']||0x1e;this[_0xaa26('0x10')]=_0x33615e[_0xaa26('0x10')];this[_0xaa26('0x11')]=_0x33615e[_0xaa26('0x11')];this['dialBusyMaxRetry']=_0x33615e['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x33615e[_0xaa26('0x12')];this[_0xaa26('0x13')]=_0x33615e[_0xaa26('0x13')];this['dialNoAnswerRetryFrequency']=_0x33615e[_0xaa26('0x14')];this[_0xaa26('0x15')]=_0x33615e[_0xaa26('0x15')];this[_0xaa26('0x16')]=_0x33615e['dialNoSuchNumberMaxRetry']||0x3;this[_0xaa26('0x17')]=_0x33615e[_0xaa26('0x17')]||0x96;this[_0xaa26('0x18')]=_0x33615e['dialDropMaxRetry']||0x3;this[_0xaa26('0x19')]=_0x33615e[_0xaa26('0x19')]||0x96;this[_0xaa26('0x1a')]=_0x33615e['dialAbandonedMaxRetry']||0x3;this[_0xaa26('0x1b')]=_0x33615e['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x33615e[_0xaa26('0x1c')]||0x3;this[_0xaa26('0x1d')]=_0x33615e[_0xaa26('0x1d')]||0x96;this[_0xaa26('0x1e')]=_0x33615e[_0xaa26('0x1e')]||0x3;this[_0xaa26('0x1f')]=_0x33615e[_0xaa26('0x1f')]||0x96;this[_0xaa26('0x20')]=_0x33615e[_0xaa26('0x20')]||'DESC';this[_0xaa26('0x21')]=_0x33615e[_0xaa26('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x33615e[_0xaa26('0x22')]||undefined;this[_0xaa26('0x23')]=_0x33615e[_0xaa26('0x23')]||undefined;this[_0xaa26('0x24')]=_0x33615e[_0xaa26('0x24')]?_0x33615e[_0xaa26('0x24')]:undefined;this[_0xaa26('0x25')]=_0x33615e[_0xaa26('0x25')]?_0x33615e[_0xaa26('0x25')]:undefined;this[_0xaa26('0x26')]=_0x33615e[_0xaa26('0x26')]?_0x33615e['Interval']:undefined;this[_0xaa26('0x27')]=_0x33615e['SquareProject']?_0x33615e[_0xaa26('0x27')]:undefined;this['dialQueueProject']=_0x33615e[_0xaa26('0x27')]?_0x33615e['SquareProject']['name']:undefined;this[_0xaa26('0x28')]=_0x33615e[_0xaa26('0x28')]||![];this['dialAMDInitialSilence']=_0x33615e[_0xaa26('0x29')];this[_0xaa26('0x2a')]=_0x33615e[_0xaa26('0x2a')];this[_0xaa26('0x2b')]=_0x33615e[_0xaa26('0x2b')];this[_0xaa26('0x2c')]=_0x33615e[_0xaa26('0x2c')];this[_0xaa26('0x2d')]=_0x33615e[_0xaa26('0x2d')];this['dialAMDBetweenWordsSilence']=_0x33615e[_0xaa26('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x33615e['dialAMDMaximumNumberOfWords'];this[_0xaa26('0x2f')]=_0x33615e[_0xaa26('0x2f')];this['dialAMDMaximumWordLength']=_0x33615e[_0xaa26('0x30')];}module[_0xaa26('0x31')]=Campaign; \ No newline at end of file +var _0x9e06=['campaign','ivrAnswerCallsDay','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type'];(function(_0x43d6e4,_0x3e4fe1){var _0x4ec1b2=function(_0x35f4b6){while(--_0x35f4b6){_0x43d6e4['push'](_0x43d6e4['shift']());}};_0x4ec1b2(++_0x3e4fe1);}(_0x9e06,0xba));var _0x69e0=function(_0x3e1480,_0x2cc4ee){_0x3e1480=_0x3e1480-0x0;var _0x145412=_0x9e06[_0x3e1480];return _0x145412;};'use strict';function Campaign(_0x5e0260){this['id']=_0x5e0260['id']||0x0;this[_0x69e0('0x0')]=_0x5e0260[_0x69e0('0x0')]||'';this[_0x69e0('0x1')]=_0x5e0260['type']||_0x69e0('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x69e0('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x69e0('0x4')]=!![];this['active']=_0x5e0260['active'];this[_0x69e0('0x5')]=_0x5e0260[_0x69e0('0x5')];this[_0x69e0('0x6')]=_0x5e0260[_0x69e0('0x6')]||null;this[_0x69e0('0x7')]=_0x5e0260['dialGlobalInterval']?_0x5e0260[_0x69e0('0x7')]:null;this[_0x69e0('0x8')]=_0x5e0260[_0x69e0('0x8')];this[_0x69e0('0x9')]=_0x5e0260[_0x69e0('0x9')];this[_0x69e0('0xa')]=_0x5e0260['dialOriginateTimeout']||0x1e;this[_0x69e0('0xb')]=_0x5e0260[_0x69e0('0xb')];this[_0x69e0('0xc')]=_0x5e0260[_0x69e0('0xc')];this['dialBusyMaxRetry']=_0x5e0260[_0x69e0('0xd')];this[_0x69e0('0xe')]=_0x5e0260[_0x69e0('0xe')];this['dialNoAnswerMaxRetry']=_0x5e0260[_0x69e0('0xf')];this[_0x69e0('0x10')]=_0x5e0260[_0x69e0('0x10')];this['dialGlobalMaxRetry']=_0x5e0260[_0x69e0('0x11')];this[_0x69e0('0x12')]=_0x5e0260[_0x69e0('0x12')]||0x3;this[_0x69e0('0x13')]=_0x5e0260[_0x69e0('0x13')]||0x96;this[_0x69e0('0x14')]=_0x5e0260[_0x69e0('0x14')]||0x3;this['dialDropRetryFrequency']=_0x5e0260[_0x69e0('0x15')]||0x96;this[_0x69e0('0x16')]=_0x5e0260['dialAbandonedMaxRetry']||0x3;this[_0x69e0('0x17')]=_0x5e0260['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x5e0260[_0x69e0('0x18')]||0x3;this[_0x69e0('0x19')]=_0x5e0260[_0x69e0('0x19')]||0x96;this[_0x69e0('0x1a')]=_0x5e0260['dialAgentRejectMaxRetry']||0x3;this[_0x69e0('0x1b')]=_0x5e0260[_0x69e0('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x5e0260[_0x69e0('0x1c')]||_0x69e0('0x1d');this[_0x69e0('0x1e')]=_0x5e0260[_0x69e0('0x1e')]||undefined;this[_0x69e0('0x1f')]=_0x5e0260['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x69e0('0x20')]=_0x5e0260[_0x69e0('0x20')]||undefined;this[_0x69e0('0x21')]=_0x5e0260[_0x69e0('0x21')]?_0x5e0260[_0x69e0('0x21')]:undefined;this[_0x69e0('0x22')]=_0x5e0260[_0x69e0('0x22')]?_0x5e0260['Trunk']:undefined;this['Interval']=_0x5e0260[_0x69e0('0x23')]?_0x5e0260['Interval']:undefined;this[_0x69e0('0x24')]=_0x5e0260['SquareProject']?_0x5e0260[_0x69e0('0x24')]:undefined;this[_0x69e0('0x25')]=_0x5e0260[_0x69e0('0x24')]?_0x5e0260[_0x69e0('0x24')][_0x69e0('0x0')]:undefined;this['dialAMDActive']=_0x5e0260[_0x69e0('0x26')]||![];this[_0x69e0('0x27')]=_0x5e0260[_0x69e0('0x27')];this['dialAMDGreeting']=_0x5e0260[_0x69e0('0x28')];this['dialAMDAfterGreetingSilence']=_0x5e0260['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5e0260[_0x69e0('0x29')];this[_0x69e0('0x2a')]=_0x5e0260[_0x69e0('0x2a')];this[_0x69e0('0x2b')]=_0x5e0260[_0x69e0('0x2b')];this[_0x69e0('0x2c')]=_0x5e0260[_0x69e0('0x2c')];this['dialAMDSilenceThreshold']=_0x5e0260[_0x69e0('0x2d')];this[_0x69e0('0x2e')]=_0x5e0260[_0x69e0('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 d6a62f6..8eb74ab 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 _0xa693=['exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','type','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType'];(function(_0x4fde37,_0x2c0165){var _0x18351d=function(_0x25313a){while(--_0x25313a){_0x4fde37['push'](_0x4fde37['shift']());}};_0x18351d(++_0x2c0165);}(_0xa693,0xf1));var _0x3a69=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xa693[_0x10c51f];return _0x56a0cd;};'use strict';function Channel(){this[_0x3a69('0x0')]=null;this[_0x3a69('0x1')]='';this[_0x3a69('0x2')]='';this[_0x3a69('0x3')]=0x0;this[_0x3a69('0x4')]='';this[_0x3a69('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0x3a69('0x6')]=0x0;this[_0x3a69('0x7')]=0x0;this[_0x3a69('0x8')]=0x0;this[_0x3a69('0x9')]=![];this[_0x3a69('0xa')]=null;this[_0x3a69('0xb')]=null;this[_0x3a69('0xc')]=![];this['abandoned']=![];this[_0x3a69('0xd')]='';this[_0x3a69('0xe')]='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x3a69('0xf')]=null;this['tag']=null;this[_0x3a69('0x10')]=null;this[_0x3a69('0x11')]=![];this[_0x3a69('0x12')]=null;this[_0x3a69('0x13')]=null;this[_0x3a69('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x3a69('0x15')]=undefined;this[_0x3a69('0x16')]=undefined;this['mohtime']=0x0;}module[_0x3a69('0x17')]=Channel; \ No newline at end of file +var _0x8d5e=['monitorFilename','queue','transfercalleridnum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','context','uniqueid','linkedid','exten','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','type','tag'];(function(_0x38bb8f,_0x221f21){var _0x1ded6c=function(_0x2b211b){while(--_0x2b211b){_0x38bb8f['push'](_0x38bb8f['shift']());}};_0x1ded6c(++_0x221f21);}(_0x8d5e,0xf6));var _0xe8d5=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8d5e[_0x40ac5e];return _0x2839d6;};'use strict';function Channel(){this[_0xe8d5('0x0')]=null;this[_0xe8d5('0x1')]='';this[_0xe8d5('0x2')]='';this[_0xe8d5('0x3')]=0x0;this[_0xe8d5('0x4')]='';this[_0xe8d5('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0xe8d5('0x6')]='';this[_0xe8d5('0x7')]=0x0;this[_0xe8d5('0x8')]=0x0;this[_0xe8d5('0x9')]=0x0;this['answered']=![];this['answertime']=null;this[_0xe8d5('0xa')]=null;this[_0xe8d5('0xb')]=![];this['abandoned']=![];this[_0xe8d5('0xc')]='';this[_0xe8d5('0xd')]='';this[_0xe8d5('0xe')]=0x0;this[_0xe8d5('0xf')]=0x0;this['holdtime']=0x0;this[_0xe8d5('0x10')]=null;this[_0xe8d5('0x11')]=null;this['disposition']=null;this['monitor']=![];this[_0xe8d5('0x12')]=null;this[_0xe8d5('0x13')]=null;this['monitors']=[];this[_0xe8d5('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xe8d5('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index b9cd564..505f8e3 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 _0xd9ac=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xd9ac,0x156));var _0xcd9a=function(_0x33631a,_0x12b3af){_0x33631a=_0x33631a-0x0;var _0x426eaf=_0xd9ac[_0x33631a];return _0x426eaf;};'use strict';function DeskAccount(_0x152d52){this['id']=_0x152d52['id']||0x0;this[_0xcd9a('0x0')]=_0x152d52[_0xcd9a('0x0')]||'';this[_0xcd9a('0x1')]=_0x152d52['username']||'';this[_0xcd9a('0x2')]=_0x152d52[_0xcd9a('0x2')]||'';this[_0xcd9a('0x3')]=_0x152d52[_0xcd9a('0x3')]||'';this[_0xcd9a('0x4')]=_0x152d52[_0xcd9a('0x4')]||'';this[_0xcd9a('0x5')]=_0x152d52[_0xcd9a('0x5')]||'';this[_0xcd9a('0x6')]=_0x152d52[_0xcd9a('0x6')]||'';this['token']=_0x152d52[_0xcd9a('0x7')]||'';this['tokenSecret']=_0x152d52[_0xcd9a('0x8')]||'';this[_0xcd9a('0x9')]=_0x152d52[_0xcd9a('0x9')]||'';this[_0xcd9a('0xa')]=_0x152d52[_0xcd9a('0xa')]||'';this['Configurations']=_0x152d52[_0xcd9a('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xa422=['authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x422562,_0x5df39d){var _0x23081b=function(_0x388e18){while(--_0x388e18){_0x422562['push'](_0x422562['shift']());}};_0x23081b(++_0x5df39d);}(_0xa422,0xce));var _0x2a42=function(_0x1a3bec,_0x55c176){_0x1a3bec=_0x1a3bec-0x0;var _0x2bf55d=_0xa422[_0x1a3bec];return _0x2bf55d;};'use strict';function DeskAccount(_0x384579){this['id']=_0x384579['id']||0x0;this[_0x2a42('0x0')]=_0x384579[_0x2a42('0x0')]||'';this[_0x2a42('0x1')]=_0x384579[_0x2a42('0x1')]||'';this['remoteUri']=_0x384579[_0x2a42('0x2')]||'';this['authType']=_0x384579[_0x2a42('0x3')]||'';this['password']=_0x384579[_0x2a42('0x4')]||'';this['consumerKey']=_0x384579['consumerKey']||'';this['consumerSecret']=_0x384579[_0x2a42('0x5')]||'';this[_0x2a42('0x6')]=_0x384579[_0x2a42('0x6')]||'';this['tokenSecret']=_0x384579[_0x2a42('0x7')]||'';this[_0x2a42('0x8')]=_0x384579[_0x2a42('0x8')]||'';this[_0x2a42('0x9')]=_0x384579[_0x2a42('0x9')]||'';this[_0x2a42('0xa')]=_0x384579['Configurations']||{};}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 7783fb8..dafe95a 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 _0x5f2b=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x4f0ac9,_0xf8844e){var _0x1d1f24=function(_0x4f1387){while(--_0x4f1387){_0x4f0ac9['push'](_0x4f0ac9['shift']());}};_0x1d1f24(++_0xf8844e);}(_0x5f2b,0x193));var _0xb5f2=function(_0x1341fd,_0x39765a){_0x1341fd=_0x1341fd-0x0;var _0x16e45c=_0x5f2b[_0x1341fd];return _0x16e45c;};'use strict';function Dynamics365Account(_0x34cf46){this['id']=_0x34cf46['id']||0x0;this[_0xb5f2('0x0')]=_0x34cf46['name']||'';this[_0xb5f2('0x1')]=_0x34cf46[_0xb5f2('0x1')]||'';this[_0xb5f2('0x2')]=_0x34cf46['password']||'';this[_0xb5f2('0x3')]=_0x34cf46[_0xb5f2('0x3')]||'';this[_0xb5f2('0x4')]=_0x34cf46[_0xb5f2('0x4')]||'';this[_0xb5f2('0x5')]=_0x34cf46[_0xb5f2('0x5')]||'';this[_0xb5f2('0x6')]=_0x34cf46[_0xb5f2('0x6')]||{};this[_0xb5f2('0x7')]=_0x34cf46[_0xb5f2('0x7')]||'';this['modernAuthentication']=_0x34cf46[_0xb5f2('0x8')]||![];this['Configurations']=_0x34cf46[_0xb5f2('0x9')]||{};this[_0xb5f2('0xa')]=_0x34cf46[_0xb5f2('0xa')]||{};}module[_0xb5f2('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x297a=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','exports','name','username'];(function(_0x25f938,_0x3a2507){var _0xc56da=function(_0x5bae79){while(--_0x5bae79){_0x25f938['push'](_0x25f938['shift']());}};_0xc56da(++_0x3a2507);}(_0x297a,0xfb));var _0xa297=function(_0x3a9876,_0x1ad0d2){_0x3a9876=_0x3a9876-0x0;var _0x544b5a=_0x297a[_0x3a9876];return _0x544b5a;};'use strict';function Dynamics365Account(_0x12af37){this['id']=_0x12af37['id']||0x0;this[_0xa297('0x0')]=_0x12af37[_0xa297('0x0')]||'';this[_0xa297('0x1')]=_0x12af37['username']||'';this[_0xa297('0x2')]=_0x12af37[_0xa297('0x2')]||'';this[_0xa297('0x3')]=_0x12af37[_0xa297('0x3')]||'';this['tenantId']=_0x12af37[_0xa297('0x4')]||'';this[_0xa297('0x5')]=_0x12af37[_0xa297('0x5')]||'';this[_0xa297('0x6')]=_0x12af37[_0xa297('0x6')]||{};this[_0xa297('0x7')]=_0x12af37[_0xa297('0x7')]||'';this[_0xa297('0x8')]=_0x12af37['modernAuthentication']||![];this[_0xa297('0x9')]=_0x12af37[_0xa297('0x9')]||{};this['CloudProvider']=_0x12af37['CloudProvider']||{};}module[_0xa297('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 61d0fc0..0429ba0 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 _0xe551=['exports','name','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x30574d,_0x378080){var _0x56442f=function(_0x6e47cc){while(--_0x6e47cc){_0x30574d['push'](_0x30574d['shift']());}};_0x56442f(++_0x378080);}(_0xe551,0x1ee));var _0x1e55=function(_0x2bc6d5,_0x3fcd91){_0x2bc6d5=_0x2bc6d5-0x0;var _0x588b4e=_0xe551[_0x2bc6d5];return _0x588b4e;};'use strict';function FaxAccount(_0x383964){this['id']=_0x383964['id']||0x0;this['name']=_0x383964[_0x1e55('0x0')]||'';this[_0x1e55('0x1')]=_0x383964[_0x1e55('0x1')];this[_0x1e55('0x2')]=_0x383964[_0x1e55('0x2')];this['headerinfo']=_0x383964['headerinfo'];this['localstationid']=_0x383964[_0x1e55('0x3')];this[_0x1e55('0x4')]=_0x383964['minrate']||0x960;this[_0x1e55('0x5')]=_0x383964[_0x1e55('0x5')]||0x3840;this[_0x1e55('0x6')]=_0x383964[_0x1e55('0x6')]||_0x1e55('0x7');this['gateway']=_0x383964[_0x1e55('0x8')]||'no';this[_0x1e55('0x9')]=_0x383964[_0x1e55('0x9')]||'no';this['t38timeout']=_0x383964[_0x1e55('0xa')]||0x1388;this[_0x1e55('0xb')]=_0x383964[_0x1e55('0xb')]||_0x1e55('0xc');this[_0x1e55('0xd')]=_0x383964[_0x1e55('0xd')]?_0x383964[_0x1e55('0xd')]:undefined;this[_0x1e55('0xe')]=_0x383964['ListId'];this[_0x1e55('0xf')]=_0x383964[_0x1e55('0xf')];}module[_0x1e55('0x10')]=FaxAccount; \ No newline at end of file +var _0x467b=['t38timeout','tech','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x467b,0x65));var _0xb467=function(_0x22ad8d,_0x4a1eb2){_0x22ad8d=_0x22ad8d-0x0;var _0x2d865f=_0x467b[_0x22ad8d];return _0x2d865f;};'use strict';function FaxAccount(_0x11c06f){this['id']=_0x11c06f['id']||0x0;this[_0xb467('0x0')]=_0x11c06f[_0xb467('0x0')]||'';this[_0xb467('0x1')]=_0x11c06f[_0xb467('0x1')];this[_0xb467('0x2')]=_0x11c06f[_0xb467('0x2')];this[_0xb467('0x3')]=_0x11c06f['headerinfo'];this['localstationid']=_0x11c06f[_0xb467('0x4')];this[_0xb467('0x5')]=_0x11c06f[_0xb467('0x5')]||0x960;this[_0xb467('0x6')]=_0x11c06f['maxrate']||0x3840;this[_0xb467('0x7')]=_0x11c06f[_0xb467('0x7')]||_0xb467('0x8');this[_0xb467('0x9')]=_0x11c06f['gateway']||'no';this[_0xb467('0xa')]=_0x11c06f['faxdetect']||'no';this[_0xb467('0xb')]=_0x11c06f[_0xb467('0xb')]||0x1388;this[_0xb467('0xc')]=_0x11c06f['tech']||'SIP';this[_0xb467('0xd')]=_0x11c06f[_0xb467('0xd')]?_0x11c06f[_0xb467('0xd')]:undefined;this['ListId']=_0x11c06f['ListId'];this[_0xb467('0xe')]=_0x11c06f[_0xb467('0xe')];}module[_0xb467('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d72ee22..806eda3 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 _0x55c4=['serverUrl','Configurations','name','apiKey','remoteUri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x55c4,0x18d));var _0x455c=function(_0x5a9531,_0x42704b){_0x5a9531=_0x5a9531-0x0;var _0xe1037b=_0x55c4[_0x5a9531];return _0xe1037b;};'use strict';function FreshdeskAccount(_0x11f901){this['id']=_0x11f901['id']||0x0;this[_0x455c('0x0')]=_0x11f901[_0x455c('0x0')]||'';this['username']=_0x11f901['username']||'';this[_0x455c('0x1')]=_0x11f901['token']||'';this[_0x455c('0x2')]=_0x11f901['remoteUri']||'';this[_0x455c('0x3')]=_0x11f901['serverUrl']||'';this[_0x455c('0x4')]=_0x11f901['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x6b83=['serverUrl','Configurations','name','apiKey','remoteUri'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x6b83,0x10b));var _0x36b8=function(_0x444975,_0x44aaf0){_0x444975=_0x444975-0x0;var _0x45cc12=_0x6b83[_0x444975];return _0x45cc12;};'use strict';function FreshdeskAccount(_0x4eb682){this['id']=_0x4eb682['id']||0x0;this[_0x36b8('0x0')]=_0x4eb682[_0x36b8('0x0')]||'';this['username']=_0x4eb682['username']||'';this[_0x36b8('0x1')]=_0x4eb682['token']||'';this['remoteUri']=_0x4eb682[_0x36b8('0x2')]||'';this[_0x36b8('0x3')]=_0x4eb682[_0x36b8('0x3')]||'';this[_0x36b8('0x4')]=_0x4eb682[_0x36b8('0x4')]||{};}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 c4dbfa6..48d45b3 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 _0x3981=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x18d28d,_0x49d25c){var _0x8a5251=function(_0x53b7f2){while(--_0x53b7f2){_0x18d28d['push'](_0x18d28d['shift']());}};_0x8a5251(++_0x49d25c);}(_0x3981,0x144));var _0x1398=function(_0xd649d7,_0x22880a){_0xd649d7=_0xd649d7-0x0;var _0x506d08=_0x3981[_0xd649d7];return _0x506d08;};'use strict';function FreshsalesAccount(_0x3f99a5){this['id']=_0x3f99a5['id']||0x0;this['name']=_0x3f99a5[_0x1398('0x0')]||'';this[_0x1398('0x1')]=_0x3f99a5[_0x1398('0x1')]||'';this[_0x1398('0x2')]=_0x3f99a5[_0x1398('0x3')]||'';this[_0x1398('0x4')]=_0x3f99a5[_0x1398('0x4')]||'';this[_0x1398('0x5')]=_0x3f99a5[_0x1398('0x5')]||'';this[_0x1398('0x6')]=_0x3f99a5[_0x1398('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xc906=['remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x19c9e8,_0x186e72){var _0x4cf0fb=function(_0x56eb8b){while(--_0x56eb8b){_0x19c9e8['push'](_0x19c9e8['shift']());}};_0x4cf0fb(++_0x186e72);}(_0xc906,0x1ad));var _0x6c90=function(_0x1d7da2,_0x2135b3){_0x1d7da2=_0x1d7da2-0x0;var _0x270e24=_0xc906[_0x1d7da2];return _0x270e24;};'use strict';function FreshsalesAccount(_0x1b05cc){this['id']=_0x1b05cc['id']||0x0;this[_0x6c90('0x0')]=_0x1b05cc['name']||'';this[_0x6c90('0x1')]=_0x1b05cc[_0x6c90('0x1')]||'';this[_0x6c90('0x2')]=_0x1b05cc['token']||'';this[_0x6c90('0x3')]=_0x1b05cc[_0x6c90('0x3')]||'';this[_0x6c90('0x4')]=_0x1b05cc[_0x6c90('0x4')]||'';this[_0x6c90('0x5')]=_0x1b05cc[_0x6c90('0x5')]||{};}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 dd4c4b7..5d6a3cf 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 _0x543a=['originalposition','channel','connectedlinenum','context','exten','priority','holdtime','assigned','motionChannel','routealias','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x183e93,_0x4e4d67){var _0xea0bf3=function(_0x1c8900){while(--_0x1c8900){_0x183e93['push'](_0x183e93['shift']());}};_0xea0bf3(++_0x4e4d67);}(_0x543a,0x74));var _0xa543=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x543a[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this['type']=_0xa543('0x0');this[_0xa543('0x1')]='';this[_0xa543('0x2')]='';this[_0xa543('0x3')]='';this[_0xa543('0x4')]='';this[_0xa543('0x5')]=null;this[_0xa543('0x6')]=null;this['position']=0x1;this[_0xa543('0x7')]=0x1;this[_0xa543('0x8')]=![];this[_0xa543('0x9')]=null;this[_0xa543('0xa')]=![];this[_0xa543('0xb')]=null;this[_0xa543('0xc')]=![];this[_0xa543('0xd')]=null;this[_0xa543('0xe')]=0x1;this[_0xa543('0xf')]='';this[_0xa543('0x10')]='';this['connectedlinename']='';this['accountcode']='';this[_0xa543('0x11')]='';this[_0xa543('0x12')]='';this[_0xa543('0x13')]='';this[_0xa543('0x14')]=0x0;this[_0xa543('0x15')]=![];this['lastAssignedTo']='';this[_0xa543('0x16')]='voice';this[_0xa543('0x17')]=null;this[_0xa543('0x18')]=0x0;this['variables']={};}module[_0xa543('0x19')]=QueueReport; \ No newline at end of file +var _0xddca=['queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','variables','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x59b54e,_0x1bdf5d){var _0x1ff25f=function(_0x3a1db9){while(--_0x3a1db9){_0x59b54e['push'](_0x59b54e['shift']());}};_0x1ff25f(++_0x1bdf5d);}(_0xddca,0x98));var _0xaddc=function(_0x4d2c7e,_0x5df3bc){_0x4d2c7e=_0x4d2c7e-0x0;var _0x1f837f=_0xddca[_0x4d2c7e];return _0x1f837f;};'use strict';function QueueReport(){this[_0xaddc('0x0')]=_0xaddc('0x1');this['uniqueid']='';this[_0xaddc('0x2')]='';this[_0xaddc('0x3')]='';this[_0xaddc('0x4')]='';this[_0xaddc('0x5')]=null;this[_0xaddc('0x6')]=null;this[_0xaddc('0x7')]=0x1;this[_0xaddc('0x8')]=0x1;this[_0xaddc('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xaddc('0xa')]=![];this[_0xaddc('0xb')]=null;this['queuecallerexit']=![];this[_0xaddc('0xc')]=null;this['originalposition']=0x1;this[_0xaddc('0xd')]='';this[_0xaddc('0xe')]='';this[_0xaddc('0xf')]='';this[_0xaddc('0x10')]='';this[_0xaddc('0x11')]='';this[_0xaddc('0x12')]='';this[_0xaddc('0x13')]='';this[_0xaddc('0x14')]=0x0;this[_0xaddc('0x15')]=![];this[_0xaddc('0x16')]='';this[_0xaddc('0x17')]=_0xaddc('0x18');this[_0xaddc('0x19')]=null;this['mohtime']=0x0;this[_0xaddc('0x1a')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 500937c..8b8dd58 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 _0x2a19=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x12a156,_0x3ce065){var _0x53e7d4=function(_0x3beb34){while(--_0x3beb34){_0x12a156['push'](_0x12a156['shift']());}};_0x53e7d4(++_0x3ce065);}(_0x2a19,0x199));var _0x92a1=function(_0x164262,_0x2c2d53){_0x164262=_0x164262-0x0;var _0x1fd378=_0x2a19[_0x164262];return _0x1fd378;};'use strict';function SalesforceAccount(_0x548afb){this['id']=_0x548afb['id']||0x0;this[_0x92a1('0x0')]=_0x548afb['name']||'';this['username']=_0x548afb[_0x92a1('0x1')]||'';this[_0x92a1('0x2')]=_0x548afb[_0x92a1('0x2')]||'';this[_0x92a1('0x3')]=_0x548afb[_0x92a1('0x3')]||'';this[_0x92a1('0x4')]=_0x548afb['clientId']||'';this[_0x92a1('0x5')]=_0x548afb[_0x92a1('0x5')]||'';this[_0x92a1('0x6')]=_0x548afb[_0x92a1('0x6')]||'';this[_0x92a1('0x7')]=_0x548afb[_0x92a1('0x7')]||_0x92a1('0x8');this[_0x92a1('0x9')]=_0x548afb[_0x92a1('0x9')]||'';this[_0x92a1('0xa')]=_0x548afb[_0x92a1('0xa')]||{};}module[_0x92a1('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xaf62=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0xbbd04,_0x4e535f){var _0x4ef8b6=function(_0x4a78ab){while(--_0x4a78ab){_0xbbd04['push'](_0xbbd04['shift']());}};_0x4ef8b6(++_0x4e535f);}(_0xaf62,0x174));var _0x2af6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xaf62[_0xbca1b1];return _0x4e1686;};'use strict';function SalesforceAccount(_0x51dadc){this['id']=_0x51dadc['id']||0x0;this[_0x2af6('0x0')]=_0x51dadc[_0x2af6('0x0')]||'';this[_0x2af6('0x1')]=_0x51dadc['username']||'';this[_0x2af6('0x2')]=_0x51dadc[_0x2af6('0x2')]||'';this[_0x2af6('0x3')]=_0x51dadc[_0x2af6('0x3')]||'';this[_0x2af6('0x4')]=_0x51dadc['clientId']||'';this[_0x2af6('0x5')]=_0x51dadc[_0x2af6('0x5')]||'';this[_0x2af6('0x6')]=_0x51dadc[_0x2af6('0x6')]||'';this['type']=_0x51dadc[_0x2af6('0x7')]||_0x2af6('0x8');this[_0x2af6('0x9')]=_0x51dadc[_0x2af6('0x9')]||'';this[_0x2af6('0xa')]=_0x51dadc[_0x2af6('0xa')]||{};}module[_0x2af6('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 33cc127..ae3cd45 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 _0xbf11=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0xbf11,0x17f));var _0x1bf1=function(_0x1786e0,_0x19dc8c){_0x1786e0=_0x1786e0-0x0;var _0x4a6229=_0xbf11[_0x1786e0];return _0x4a6229;};'use strict';function ServicenowAccount(_0x343490){this['id']=_0x343490['id']||0x0;this[_0x1bf1('0x0')]=_0x343490[_0x1bf1('0x0')]||'';this[_0x1bf1('0x1')]=_0x343490[_0x1bf1('0x1')]||'';this[_0x1bf1('0x2')]=_0x343490[_0x1bf1('0x2')]||'';this[_0x1bf1('0x3')]=_0x343490[_0x1bf1('0x3')]||'';this[_0x1bf1('0x4')]=_0x343490[_0x1bf1('0x4')]||'';this[_0x1bf1('0x5')]=_0x343490[_0x1bf1('0x5')]||{};}module[_0x1bf1('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x2555=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x2379d9,_0x146e8e){var _0x4413f8=function(_0x4ceee7){while(--_0x4ceee7){_0x2379d9['push'](_0x2379d9['shift']());}};_0x4413f8(++_0x146e8e);}(_0x2555,0x8c));var _0x5255=function(_0x24a20c,_0x45e577){_0x24a20c=_0x24a20c-0x0;var _0x3c6807=_0x2555[_0x24a20c];return _0x3c6807;};'use strict';function ServicenowAccount(_0x387121){this['id']=_0x387121['id']||0x0;this[_0x5255('0x0')]=_0x387121[_0x5255('0x0')]||'';this[_0x5255('0x1')]=_0x387121[_0x5255('0x1')]||'';this[_0x5255('0x2')]=_0x387121[_0x5255('0x2')]||'';this[_0x5255('0x3')]=_0x387121[_0x5255('0x3')]||'';this[_0x5255('0x4')]=_0x387121['serverUrl']||'';this[_0x5255('0x5')]=_0x387121['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index b4ff23d..25b2371 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 _0x8548=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x8548,0x1e5));var _0x8854=function(_0x4ba2ac,_0x540310){_0x4ba2ac=_0x4ba2ac-0x0;var _0x295e96=_0x8548[_0x4ba2ac];return _0x295e96;};'use strict';function SugarcrmAccount(_0x13ff97){this['id']=_0x13ff97['id']||0x0;this[_0x8854('0x0')]=_0x13ff97[_0x8854('0x0')]||'';this[_0x8854('0x1')]=_0x13ff97[_0x8854('0x1')]||'';this['password']=_0x13ff97[_0x8854('0x2')]||'';this[_0x8854('0x3')]=_0x13ff97[_0x8854('0x3')]||'';this[_0x8854('0x4')]=_0x13ff97['serverUrl']||'';this['Configurations']=_0x13ff97[_0x8854('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x5319=['name','username','password','Configurations','exports'];(function(_0x52a292,_0x382c0c){var _0x422ea4=function(_0x303df4){while(--_0x303df4){_0x52a292['push'](_0x52a292['shift']());}};_0x422ea4(++_0x382c0c);}(_0x5319,0x1d1));var _0x9531=function(_0x537501,_0x1509e4){_0x537501=_0x537501-0x0;var _0x54bfc2=_0x5319[_0x537501];return _0x54bfc2;};'use strict';function SugarcrmAccount(_0x2012a0){this['id']=_0x2012a0['id']||0x0;this['name']=_0x2012a0[_0x9531('0x0')]||'';this['username']=_0x2012a0[_0x9531('0x1')]||'';this[_0x9531('0x2')]=_0x2012a0['password']||'';this['remoteUri']=_0x2012a0['remoteUri']||'';this['serverUrl']=_0x2012a0['serverUrl']||'';this[_0x9531('0x3')]=_0x2012a0[_0x9531('0x3')]||{};}module[_0x9531('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 277af29..ac6b2cd 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 _0x8c50=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8c50,0xcd));var _0x08c5=function(_0x5d4093,_0x1d530a){_0x5d4093=_0x5d4093-0x0;var _0x4d3dc0=_0x8c50[_0x5d4093];return _0x4d3dc0;};'use strict';function Telephone(_0x2436a9){this['id']=_0x2436a9['id']||0x0;this[_0x08c5('0x0')]=_0x2436a9[_0x08c5('0x0')]||'';this['accountcode']=_0x2436a9[_0x08c5('0x1')]||'';this[_0x08c5('0x2')]=_0x08c5('0x3');this[_0x08c5('0x4')]=0x0;this[_0x08c5('0x5')]='unknown';this[_0x08c5('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xf3d9=['name','accountcode','unknown','stateTime','status','address'];(function(_0x375933,_0x1bc01f){var _0x149ed1=function(_0x3bd409){while(--_0x3bd409){_0x375933['push'](_0x375933['shift']());}};_0x149ed1(++_0x1bc01f);}(_0xf3d9,0x162));var _0x9f3d=function(_0x485ca5,_0x401da6){_0x485ca5=_0x485ca5-0x0;var _0x272214=_0xf3d9[_0x485ca5];return _0x272214;};'use strict';function Telephone(_0x51f382){this['id']=_0x51f382['id']||0x0;this['name']=_0x51f382[_0x9f3d('0x0')]||'';this[_0x9f3d('0x1')]=_0x51f382[_0x9f3d('0x1')]||'';this['state']=_0x9f3d('0x2');this[_0x9f3d('0x3')]=0x0;this[_0x9f3d('0x4')]=_0x9f3d('0x2');this[_0x9f3d('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index c48ad22..a3da4fc 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(_0x41fe81,_0x56ddcc){var _0x200fa1=function(_0x31637c){while(--_0x31637c){_0x41fe81['push'](_0x41fe81['shift']());}};_0x200fa1(++_0x56ddcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x4531eb,_0x3de363){var _0x15546a=function(_0x27e4ce){while(--_0x27e4ce){_0x4531eb['push'](_0x4531eb['shift']());}};_0x15546a(++_0x3de363);}(_0xb10b,0x12a));var _0xbb10=function(_0x1800cb,_0xba50f9){_0x1800cb=_0x1800cb-0x0;var _0x3b5e95=_0xb10b[_0x1800cb];return _0x3b5e95;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 70d7cb3..b945e02 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x5eb8,0xb0));var _0x85eb=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0x5eb8[_0x408de5];return _0x2015a1;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 9813eaa..19ff17d 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 _0x500f=['state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','address','exports','active','name'];(function(_0x10ceb1,_0x54ad75){var _0x2204ed=function(_0x3effb4){while(--_0x3effb4){_0x10ceb1['push'](_0x10ceb1['shift']());}};_0x2204ed(++_0x54ad75);}(_0x500f,0x14e));var _0xf500=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x500f[_0x14a862];return _0x245eb5;};'use strict';function Trunk(_0x473c45){this['id']=_0x473c45['id']||0x0;this[_0xf500('0x0')]=_0x473c45[_0xf500('0x0')]||![];this[_0xf500('0x1')]=_0x473c45[_0xf500('0x1')]||'';this[_0xf500('0x2')]=_0xf500('0x3');this[_0xf500('0x4')]=0x0;this[_0xf500('0x5')]=_0xf500('0x3');this[_0xf500('0x6')]=_0x473c45['registry']&&_0x473c45[_0xf500('0x6')][_0xf500('0x7')](':')?_0x473c45[_0xf500('0x6')][_0xf500('0x8')](':')[0x0]:'';this[_0xf500('0x9')]='';this[_0xf500('0xa')]='';this[_0xf500('0xb')]='';this[_0xf500('0xc')]='';this[_0xf500('0xd')]='';this['stateRegistry']=_0xf500('0x3');this['registrationtime']='';this[_0xf500('0xe')]='';this['defaultuser']=_0x473c45['defaultuser']||'';}module[_0xf500('0xf')]=Trunk; \ No newline at end of file +var _0x599f=['domainport','stateRegistry','registrationtime','address','exports','active','name','state','status','unknown','registry','indexOf','split','host','domain'];(function(_0x25bde3,_0x24b067){var _0x4d8386=function(_0x3b3318){while(--_0x3b3318){_0x25bde3['push'](_0x25bde3['shift']());}};_0x4d8386(++_0x24b067);}(_0x599f,0xb9));var _0xf599=function(_0x5db5f1,_0x3aa07d){_0x5db5f1=_0x5db5f1-0x0;var _0x434fe2=_0x599f[_0x5db5f1];return _0x434fe2;};'use strict';function Trunk(_0x4bee6a){this['id']=_0x4bee6a['id']||0x0;this[_0xf599('0x0')]=_0x4bee6a[_0xf599('0x0')]||![];this['name']=_0x4bee6a[_0xf599('0x1')]||'';this[_0xf599('0x2')]='unknown';this['stateTime']=0x0;this[_0xf599('0x3')]=_0xf599('0x4');this[_0xf599('0x5')]=_0x4bee6a[_0xf599('0x5')]&&_0x4bee6a[_0xf599('0x5')][_0xf599('0x6')](':')?_0x4bee6a[_0xf599('0x5')][_0xf599('0x7')](':')[0x0]:'';this[_0xf599('0x8')]='';this['port']='';this[_0xf599('0x9')]='';this[_0xf599('0xa')]='';this['refresh']='';this[_0xf599('0xb')]='unknown';this[_0xf599('0xc')]='';this[_0xf599('0xd')]='';this['defaultuser']=_0x4bee6a['defaultuser']||'';}module[_0xf599('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 39f4e85..21fe45e 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 _0xd278=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x40f00f,_0x343156){var _0x42c16d=function(_0x135324){while(--_0x135324){_0x40f00f['push'](_0x40f00f['shift']());}};_0x42c16d(++_0x343156);}(_0xd278,0x67));var _0x8d27=function(_0x5975c6,_0x12b05a){_0x5975c6=_0x5975c6-0x0;var _0x4f9523=_0xd278[_0x5975c6];return _0x4f9523;};'use strict';function voiceExtension(_0x528b22){this['id']=_0x528b22['id']||0x0;this[_0x8d27('0x0')]=_0x528b22[_0x8d27('0x0')]||'';this[_0x8d27('0x1')]=_0x528b22[_0x8d27('0x1')]||'none';this[_0x8d27('0x2')]=_0x528b22[_0x8d27('0x2')]||![];}module[_0x8d27('0x3')]=voiceExtension; \ No newline at end of file +var _0xfbb5=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x191260,_0x23547d){var _0x4eed07=function(_0x24966c){while(--_0x24966c){_0x191260['push'](_0x191260['shift']());}};_0x4eed07(++_0x23547d);}(_0xfbb5,0x186));var _0x5fbb=function(_0x3586ef,_0x50ad8a){_0x3586ef=_0x3586ef-0x0;var _0x36632e=_0xfbb5[_0x3586ef];return _0x36632e;};'use strict';function voiceExtension(_0x338c7a){this['id']=_0x338c7a['id']||0x0;this[_0x5fbb('0x0')]=_0x338c7a[_0x5fbb('0x0')]||'';this[_0x5fbb('0x1')]=_0x338c7a[_0x5fbb('0x1')]||'none';this[_0x5fbb('0x2')]=_0x338c7a[_0x5fbb('0x2')]||![];}module[_0x5fbb('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 6fa95d9..fdd7cf4 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 _0x6106=['dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','leastrecent','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','abandoned','available','inUse','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6106,0x1ba));var _0x6610=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x6106[_0x45d3f0];return _0x314b79;};'use strict';var monitorFormat={'wav':_0x6610('0x0'),'wav49':_0x6610('0x1'),'gsm':_0x6610('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x6610('0x3'),'linear':'linear','random':'random','ringall':'ringall','rr':_0x6610('0x4'),'rrmemory':'rrmemory','rrordered':_0x6610('0x5'),'wrandom':_0x6610('0x6')};function VoiceQueue(_0x1798b5){this['id']=_0x1798b5['id']||0x0;this[_0x6610('0x7')]=_0x1798b5[_0x6610('0x7')]||'';this[_0x6610('0x8')]=_0x1798b5[_0x6610('0x8')]||'';this[_0x6610('0x9')]=_0x1798b5['type']||_0x6610('0xa');this[_0x6610('0xb')]=0x0;this[_0x6610('0xc')]=0x0;this[_0x6610('0xd')]=0x0;this['sumDuration']=0x0;this[_0x6610('0xe')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x6610('0xf')]=0x0;this[_0x6610('0x10')]=0x0;this['busy']=0x0;this[_0x6610('0x11')]=0x0;this['invalid']=0x0;this[_0x6610('0x12')]=0x0;this[_0x6610('0x13')]=0x0;this[_0x6610('0x14')]=0x0;this[_0x6610('0x15')]=0x0;this[_0x6610('0x16')]=0x0;this[_0x6610('0x17')]=0x0;this[_0x6610('0x18')]=0x0;this[_0x6610('0x19')]=0x0;this[_0x6610('0x1a')]=0x0;this[_0x6610('0x1b')]=_0x1798b5[_0x6610('0x1b')]||![];this['acwTimeout']=_0x1798b5[_0x6610('0x1c')]||0xa;this[_0x6610('0x1d')]=_0x1798b5[_0x6610('0x1d')]||'no';this[_0x6610('0x1e')]=!![];this['message']='';this['statusMessage']='';this['originated']=0x0;this[_0x6610('0x1f')]=0x0;this[_0x6610('0x20')]=_0x1798b5[_0x6610('0x20')]||null;this[_0x6610('0x21')]=_0x1798b5[_0x6610('0x21')]?_0x1798b5[_0x6610('0x21')]:null;this[_0x6610('0x22')]=_0x1798b5[_0x6610('0x22')];this[_0x6610('0x23')]=_0x1798b5[_0x6610('0x23')]||_0x6610('0x24');this['dialLimitChannel']=_0x1798b5[_0x6610('0x25')]||0x0;this[_0x6610('0x26')]=_0x1798b5['dialLimitQueue']||0x0;this[_0x6610('0x27')]=_0x1798b5[_0x6610('0x27')]||0x1;this['dialPredictiveOptimization']=_0x1798b5[_0x6610('0x28')]||_0x6610('0x29');this[_0x6610('0x2a')]=_0x1798b5[_0x6610('0x2a')]||0.03;this[_0x6610('0x2b')]=_0x1798b5[_0x6610('0x2b')]||0x258;this[_0x6610('0x2c')]=_0x1798b5[_0x6610('0x2c')]||'anonymous';this[_0x6610('0x2d')]=_0x1798b5[_0x6610('0x2d')]||_0x6610('0x2e');this['dialOriginateTimeout']=_0x1798b5['dialOriginateTimeout']||0x1e;this[_0x6610('0x2f')]=_0x1798b5[_0x6610('0x2f')]||'tTxX';this[_0x6610('0x30')]=_0x1798b5[_0x6610('0x30')]||0x3;this['dialQueueProject']=_0x1798b5[_0x6610('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x1798b5['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x1798b5[_0x6610('0x32')]||0x96;this['dialBusyMaxRetry']=_0x1798b5[_0x6610('0x33')]||0x3;this[_0x6610('0x34')]=_0x1798b5['dialBusyRetryFrequency']||0x96;this[_0x6610('0x35')]=_0x1798b5['dialNoAnswerMaxRetry']||0x3;this[_0x6610('0x36')]=_0x1798b5[_0x6610('0x36')]||0x96;this[_0x6610('0x37')]=_0x1798b5[_0x6610('0x37')]||0x3;this[_0x6610('0x38')]=_0x1798b5[_0x6610('0x38')]||0x96;this[_0x6610('0x39')]=_0x1798b5['dialDropMaxRetry']||0x3;this[_0x6610('0x3a')]=_0x1798b5[_0x6610('0x3a')]||0x96;this['dialAbandonedMaxRetry']=_0x1798b5[_0x6610('0x3b')]||0x3;this[_0x6610('0x3c')]=_0x1798b5['dialAbandonedRetryFrequency']||0x96;this[_0x6610('0x3d')]=_0x1798b5['dialMachineMaxRetry']||0x3;this[_0x6610('0x3e')]=_0x1798b5['dialMachineRetryFrequency']||0x96;this[_0x6610('0x3f')]=_0x1798b5[_0x6610('0x3f')]||0x3;this[_0x6610('0x40')]=_0x1798b5[_0x6610('0x40')]||0x96;this['callAdditionalPhoneAfterMin']=_0x1798b5[_0x6610('0x41')]||0x3;this[_0x6610('0x42')]=_0x1798b5[_0x6610('0x42')]||0x4;this[_0x6610('0x43')]=_0x1798b5[_0x6610('0x43')]?_0x1798b5[_0x6610('0x43')]:undefined;this[_0x6610('0x44')]=_0x1798b5[_0x6610('0x44')]?_0x1798b5[_0x6610('0x44')]:undefined;this[_0x6610('0x45')]=_0x1798b5[_0x6610('0x45')]||undefined;this[_0x6610('0x46')]=_0x1798b5[_0x6610('0x46')]?_0x1798b5[_0x6610('0x46')]:undefined;this[_0x6610('0x47')]=_0x1798b5[_0x6610('0x47')]||'DESC';this[_0x6610('0x48')]=_0x1798b5[_0x6610('0x48')]||undefined;this[_0x6610('0x49')]=_0x1798b5['dialCutDigit']||undefined;this[_0x6610('0x4a')]=strategy[_0x1798b5['strategy']];this[_0x6610('0x4b')]=!![];this[_0x6610('0x4c')]=_0x1798b5[_0x6610('0x4c')]||![];this[_0x6610('0x4d')]=_0x1798b5[_0x6610('0x4d')];this[_0x6610('0x4e')]=_0x1798b5[_0x6610('0x4e')];this[_0x6610('0x4f')]=_0x1798b5[_0x6610('0x4f')];this[_0x6610('0x50')]=_0x1798b5[_0x6610('0x50')];this[_0x6610('0x51')]=_0x1798b5[_0x6610('0x51')];this['dialAMDBetweenWordsSilence']=_0x1798b5['dialAMDBetweenWordsSilence'];this[_0x6610('0x52')]=_0x1798b5['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1798b5[_0x6610('0x53')];this[_0x6610('0x54')]=_0x1798b5[_0x6610('0x54')];this[_0x6610('0x55')]=0x0;this['pTalking']=0x0;this[_0x6610('0x56')]=_0x1798b5[_0x6610('0x56')];this[_0x6610('0x57')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x6610('0x58')]=0x0;this[_0x6610('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x6610('0x5a')]=0x0;this[_0x6610('0x5b')]=0x0;this[_0x6610('0x5c')]=0x0;this[_0x6610('0x5d')]=0x0;this[_0x6610('0x5e')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x6610('0x5f')]=0x0;this[_0x6610('0x60')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x6610('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x6610('0x62')]=0x0;this[_0x6610('0x63')]=0x0;this[_0x6610('0x64')]=0x0;this[_0x6610('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x6610('0x66')]=0x0;this[_0x6610('0x67')]=0x0;this[_0x6610('0x68')]=0x0;this[_0x6610('0x69')]=_0x1798b5['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x6610('0x6a')]=_0x1798b5[_0x6610('0x6b')]||0xa;this[_0x6610('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x6610('0x6d')]=0x1;this[_0x6610('0x6e')]=0x0;this[_0x6610('0x6f')]=0x0;this[_0x6610('0x70')]=0x0;this[_0x6610('0x71')]=0x0;this[_0x6610('0x72')]=_0x1798b5[_0x6610('0x72')]||0x1e;this[_0x6610('0x73')]=_0x1798b5[_0x6610('0x73')]||![];this[_0x6610('0x74')]=!!_0x1798b5[_0x6610('0x74')]||![];this[_0x6610('0x75')]=!!_0x1798b5[_0x6610('0x75')]||![];this[_0x6610('0x76')]=_0x1798b5['dialQueueProject2']||undefined;this[_0x6610('0x77')]=_0x1798b5[_0x6610('0x77')]||![];this[_0x6610('0x78')]=_0x1798b5['dialAgiAfterHangupAgent']||![];this[_0x6610('0x8')]=monitorFormat[_0x1798b5[_0x6610('0x8')]]?monitorFormat[_0x1798b5[_0x6610('0x8')]]:undefined;this['mandatoryDisposition']=_0x1798b5[_0x6610('0x79')]||![];this[_0x6610('0x7a')]=_0x1798b5[_0x6610('0x7a')]?_0x1798b5['mandatoryDispositionPause']:undefined;this[_0x6610('0x7b')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x99c8=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','notInUse','onHold','paused','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x273d3d,_0x64e7cd){var _0x1bd201=function(_0x267ecb){while(--_0x267ecb){_0x273d3d['push'](_0x273d3d['shift']());}};_0x1bd201(++_0x64e7cd);}(_0x99c8,0x1a5));var _0x899c=function(_0x385253,_0x84b69d){_0x385253=_0x385253-0x0;var _0x4738cb=_0x99c8[_0x385253];return _0x4738cb;};'use strict';var monitorFormat={'wav':_0x899c('0x0'),'wav49':_0x899c('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':'fewestcalls','leastrecent':'leastrecent','linear':_0x899c('0x2'),'random':_0x899c('0x3'),'ringall':_0x899c('0x4'),'rr':_0x899c('0x5'),'rrmemory':_0x899c('0x6'),'rrordered':_0x899c('0x7'),'wrandom':_0x899c('0x8')};function VoiceQueue(_0x18e8e7){this['id']=_0x18e8e7['id']||0x0;this[_0x899c('0x9')]=_0x18e8e7[_0x899c('0x9')]||'';this[_0x899c('0xa')]=_0x18e8e7[_0x899c('0xa')]||'';this[_0x899c('0xb')]=_0x18e8e7[_0x899c('0xb')]||_0x899c('0xc');this[_0x899c('0xd')]=0x0;this[_0x899c('0xe')]=0x0;this[_0x899c('0xf')]=0x0;this['sumDuration']=0x0;this[_0x899c('0x10')]=0x0;this[_0x899c('0x11')]=0x0;this[_0x899c('0x12')]=0x0;this[_0x899c('0x13')]=0x0;this[_0x899c('0x14')]=0x0;this[_0x899c('0x15')]=0x0;this['inUse']=0x0;this[_0x899c('0x16')]=0x0;this[_0x899c('0x17')]=0x0;this[_0x899c('0x18')]=0x0;this[_0x899c('0x19')]=0x0;this[_0x899c('0x1a')]=0x0;this['ringing']=0x0;this[_0x899c('0x1b')]=0x0;this[_0x899c('0x1c')]=0x0;this['unavailable']=0x0;this[_0x899c('0x1d')]=0x0;this[_0x899c('0x1e')]=_0x18e8e7['acw']||![];this[_0x899c('0x1f')]=_0x18e8e7['acwTimeout']||0xa;this[_0x899c('0x20')]=_0x18e8e7[_0x899c('0x20')]||'no';this[_0x899c('0x21')]=!![];this[_0x899c('0x22')]='';this[_0x899c('0x23')]='';this[_0x899c('0x24')]=0x0;this[_0x899c('0x25')]=0x0;this['dialTimezone']=_0x18e8e7[_0x899c('0x26')]||null;this['dialGlobalInterval']=_0x18e8e7[_0x899c('0x27')]?_0x18e8e7['dialGlobalInterval']:null;this[_0x899c('0x28')]=_0x18e8e7[_0x899c('0x28')];this[_0x899c('0x29')]=_0x18e8e7[_0x899c('0x29')]||'progressive';this[_0x899c('0x2a')]=_0x18e8e7['dialLimitChannel']||0x0;this[_0x899c('0x2b')]=_0x18e8e7[_0x899c('0x2b')]||0x0;this[_0x899c('0x2c')]=_0x18e8e7[_0x899c('0x2c')]||0x1;this['dialPredictiveOptimization']=_0x18e8e7[_0x899c('0x2d')]||_0x899c('0x2e');this[_0x899c('0x2f')]=_0x18e8e7[_0x899c('0x2f')]||0.03;this[_0x899c('0x30')]=_0x18e8e7[_0x899c('0x30')]||0x258;this[_0x899c('0x31')]=_0x18e8e7[_0x899c('0x31')]||_0x899c('0x32');this['dialOriginateCallerIdNumber']=_0x18e8e7['dialOriginateCallerIdNumber']||_0x899c('0x32');this[_0x899c('0x33')]=_0x18e8e7['dialOriginateTimeout']||0x1e;this[_0x899c('0x34')]=_0x18e8e7[_0x899c('0x34')]||'tTxX';this[_0x899c('0x35')]=_0x18e8e7['dialQueueTimeout']||0x3;this[_0x899c('0x36')]=_0x18e8e7[_0x899c('0x36')]||undefined;this[_0x899c('0x37')]=_0x18e8e7[_0x899c('0x37')]||0x3;this['dialCongestionRetryFrequency']=_0x18e8e7['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x18e8e7[_0x899c('0x38')]||0x3;this['dialBusyRetryFrequency']=_0x18e8e7[_0x899c('0x39')]||0x96;this['dialNoAnswerMaxRetry']=_0x18e8e7['dialNoAnswerMaxRetry']||0x3;this[_0x899c('0x3a')]=_0x18e8e7[_0x899c('0x3a')]||0x96;this[_0x899c('0x3b')]=_0x18e8e7[_0x899c('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x18e8e7['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x18e8e7['dialDropMaxRetry']||0x3;this[_0x899c('0x3c')]=_0x18e8e7['dialDropRetryFrequency']||0x96;this[_0x899c('0x3d')]=_0x18e8e7['dialAbandonedMaxRetry']||0x3;this[_0x899c('0x3e')]=_0x18e8e7[_0x899c('0x3e')]||0x96;this[_0x899c('0x3f')]=_0x18e8e7[_0x899c('0x3f')]||0x3;this[_0x899c('0x40')]=_0x18e8e7[_0x899c('0x40')]||0x96;this[_0x899c('0x41')]=_0x18e8e7[_0x899c('0x41')]||0x3;this[_0x899c('0x42')]=_0x18e8e7[_0x899c('0x42')]||0x96;this[_0x899c('0x43')]=_0x18e8e7['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x18e8e7[_0x899c('0x44')]||0x4;this[_0x899c('0x45')]=_0x18e8e7[_0x899c('0x45')]?_0x18e8e7[_0x899c('0x45')]:undefined;this[_0x899c('0x46')]=_0x18e8e7[_0x899c('0x46')]?_0x18e8e7[_0x899c('0x46')]:undefined;this[_0x899c('0x47')]=_0x18e8e7[_0x899c('0x47')]||undefined;this[_0x899c('0x48')]=_0x18e8e7[_0x899c('0x48')]?_0x18e8e7[_0x899c('0x48')]:undefined;this['dialOrderByScheduledAt']=_0x18e8e7[_0x899c('0x49')]||'DESC';this[_0x899c('0x4a')]=_0x18e8e7['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x899c('0x4b')]=_0x18e8e7[_0x899c('0x4b')]||undefined;this[_0x899c('0x4c')]=strategy[_0x18e8e7[_0x899c('0x4c')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x18e8e7['dialAMDActive']||![];this[_0x899c('0x4d')]=_0x18e8e7[_0x899c('0x4d')];this[_0x899c('0x4e')]=_0x18e8e7[_0x899c('0x4e')];this[_0x899c('0x4f')]=_0x18e8e7[_0x899c('0x4f')];this[_0x899c('0x50')]=_0x18e8e7[_0x899c('0x50')];this['dialAMDMinWordLength']=_0x18e8e7['dialAMDMinWordLength'];this[_0x899c('0x51')]=_0x18e8e7[_0x899c('0x51')];this[_0x899c('0x52')]=_0x18e8e7[_0x899c('0x52')];this[_0x899c('0x53')]=_0x18e8e7[_0x899c('0x53')];this['dialAMDMaximumWordLength']=_0x18e8e7[_0x899c('0x54')];this['outboundRejectCallsDay']=0x0;this[_0x899c('0x55')]=0x0;this[_0x899c('0x56')]=_0x18e8e7[_0x899c('0x56')];this[_0x899c('0x57')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x899c('0x58')]=0x0;this[_0x899c('0x59')]=0x0;this[_0x899c('0x5a')]=0x0;this[_0x899c('0x5b')]=0x0;this[_0x899c('0x5c')]=0x0;this[_0x899c('0x5d')]=0x0;this[_0x899c('0x5e')]=0x0;this[_0x899c('0x5f')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x899c('0x60')]=0x0;this[_0x899c('0x61')]=0x0;this[_0x899c('0x62')]=undefined;this[_0x899c('0x63')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x899c('0x64')]=0x0;this[_0x899c('0x65')]=0x0;this[_0x899c('0x66')]=0x0;this[_0x899c('0x67')]=0x0;this[_0x899c('0x68')]=0x0;this[_0x899c('0x69')]=0x0;this[_0x899c('0x6a')]=0x0;this[_0x899c('0x6b')]=0x0;this[_0x899c('0x6c')]=_0x18e8e7[_0x899c('0x6d')]||0x14;this[_0x899c('0x6e')]=_0x18e8e7[_0x899c('0x6d')]||0xa;this[_0x899c('0x6f')]=0x0;this[_0x899c('0x70')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x899c('0x71')]=0x0;this[_0x899c('0x72')]=0x0;this[_0x899c('0x73')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x18e8e7[_0x899c('0x74')]||0x1e;this['dialRecallInQueue']=_0x18e8e7['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x18e8e7[_0x899c('0x75')]||![];this[_0x899c('0x76')]=!!_0x18e8e7[_0x899c('0x76')]||![];this[_0x899c('0x77')]=_0x18e8e7[_0x899c('0x77')]||undefined;this[_0x899c('0x78')]=_0x18e8e7['dialAgiAfterHangupClient']||![];this[_0x899c('0x79')]=_0x18e8e7[_0x899c('0x79')]||![];this['monitor_format']=monitorFormat[_0x18e8e7['monitor_format']]?monitorFormat[_0x18e8e7['monitor_format']]:undefined;this['mandatoryDisposition']=_0x18e8e7[_0x899c('0x7a')]||![];this['mandatoryDispositionPause']=_0x18e8e7[_0x899c('0x7b')]?_0x18e8e7[_0x899c('0x7b')]:undefined;this[_0x899c('0x7c')]=![];}module[_0x899c('0x7d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index bd52d34..1ec60d0 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f75=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','loggedin','callers','SIP/','online','status','booked','keys','length','dialer','exten','xcally-motion-preview','prototype','compareToInboundQueue','compareToOutboundQueue','dialActive','updateReportFromOutboundQueue','available','loggedIn','loggedInDb','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','paused','sumBillable','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','total','type','unavailable','unknown','outbound','pTalking','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit'];(function(_0x3fd7d0,_0x3562b6){var _0x534247=function(_0x35219f){while(--_0x35219f){_0x3fd7d0['push'](_0x3fd7d0['shift']());}};_0x534247(++_0x3562b6);}(_0x1f75,0x12c));var _0x51f7=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x1f75[_0x24061a];return _0x82054e;};'use strict';var INBOUND_COUNTERS=[_0x51f7('0x0'),_0x51f7('0x1'),_0x51f7('0x2'),'paused',_0x51f7('0x3'),_0x51f7('0x4'),_0x51f7('0x5')];var OUTBOUND_COUNTERS=[_0x51f7('0x0'),_0x51f7('0x6'),_0x51f7('0x7'),_0x51f7('0x1'),_0x51f7('0x2'),_0x51f7('0x8'),_0x51f7('0x9'),_0x51f7('0xa'),_0x51f7('0xb'),'outboundBusyCallsDay',_0x51f7('0xc'),_0x51f7('0xd'),_0x51f7('0xe'),'outboundReCallsDay','outboundRejectCallsDay',_0x51f7('0xf'),_0x51f7('0x10'),'pTalking',_0x51f7('0x4'),_0x51f7('0x11'),'sumDuration','total',_0x51f7('0x5')];function VoiceQueueSummary(_0x1123aa){this['id']=_0x1123aa['id'];this[_0x51f7('0x12')]=_0x1123aa['name'];this[_0x51f7('0x13')]=_0x1123aa[_0x51f7('0x13')];this['abandoned']=_0x1123aa[_0x51f7('0x14')]||0x0;this[_0x51f7('0x6')]=_0x1123aa[_0x51f7('0x6')]||0x0;this['available']=_0x1123aa['available']||0x0;this[_0x51f7('0x15')]=_0x1123aa['busy']||0x0;this['inUse']=_0x1123aa['inUse']||0x0;this[_0x51f7('0x16')]=_0x1123aa[_0x51f7('0x16')]||0x0;this[_0x51f7('0x1')]=_0x1123aa[_0x51f7('0x1')]||0x0;this['loggedInDb']=_0x1123aa[_0x51f7('0x2')]||0x0;this[_0x51f7('0x17')]=_0x1123aa[_0x51f7('0x17')]||0x0;this[_0x51f7('0x18')]=_0x1123aa[_0x51f7('0x18')]||0x0;this[_0x51f7('0x10')]=_0x1123aa[_0x51f7('0x10')]||0x0;this[_0x51f7('0x3')]=_0x1123aa[_0x51f7('0x3')]||0x0;this[_0x51f7('0x19')]=_0x1123aa[_0x51f7('0x19')];this['sumBillable']=_0x1123aa['sumBillable'];this[_0x51f7('0x1a')]=_0x1123aa[_0x51f7('0x1a')];this['sumHoldTime']=_0x1123aa[_0x51f7('0x1b')]||0x0;this[_0x51f7('0x4')]=_0x1123aa[_0x51f7('0x4')]||0x0;this['total']=_0x1123aa[_0x51f7('0x1c')]||0x0;this[_0x51f7('0x1d')]=_0x1123aa[_0x51f7('0x1d')];this['unavailable']=_0x1123aa[_0x51f7('0x1e')]||0x0;this[_0x51f7('0x1f')]=_0x1123aa[_0x51f7('0x1f')]||0x0;this['unmanaged']=_0x1123aa['unmanaged']||0x0;this[_0x51f7('0x5')]=_0x1123aa[_0x51f7('0x5')]||0x0;if(_0x1123aa['type']===_0x51f7('0x20')){this[_0x51f7('0x21')]=_0x1123aa['pTalking']||0x0;this['dialActive']=_0x1123aa['dialActive'];this[_0x51f7('0x22')]=_0x1123aa[_0x51f7('0x22')];this['dialOriginateCallerIdName']=_0x1123aa[_0x51f7('0x23')];this[_0x51f7('0x24')]=_0x1123aa[_0x51f7('0x24')];this[_0x51f7('0x25')]=_0x1123aa[_0x51f7('0x25')];this[_0x51f7('0x26')]=_0x1123aa[_0x51f7('0x26')];this[_0x51f7('0x27')]=_0x1123aa[_0x51f7('0x27')];this[_0x51f7('0x28')]=_0x1123aa[_0x51f7('0x28')];this[_0x51f7('0xa')]=_0x1123aa[_0x51f7('0xa')];this[_0x51f7('0xb')]=_0x1123aa[_0x51f7('0xb')];this[_0x51f7('0x29')]=_0x1123aa[_0x51f7('0x29')];this['outboundCongestionCallsDay']=_0x1123aa[_0x51f7('0xc')];this['outboundDropCallsDayACS']=_0x1123aa[_0x51f7('0x2a')];this[_0x51f7('0x2b')]=_0x1123aa['outboundDropCallsDayCallersExit'];this[_0x51f7('0x2c')]=_0x1123aa['outboundDropCallsDayTimeout'];this['outboundNoAnswerCallsDay']=_0x1123aa[_0x51f7('0xd')];this[_0x51f7('0xe')]=_0x1123aa[_0x51f7('0xe')];this[_0x51f7('0x2d')]=_0x1123aa[_0x51f7('0x2d')];this[_0x51f7('0x2e')]=_0x1123aa[_0x51f7('0x2e')];this['outboundRejectCallsDay']=_0x1123aa[_0x51f7('0x2f')];this['outboundUnknownCallsDay']=_0x1123aa['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x1123aa[_0x51f7('0x30')];this[_0x51f7('0x31')]=_0x1123aa[_0x51f7('0x31')];this[_0x51f7('0x32')]=_0x1123aa[_0x51f7('0x32')];this[_0x51f7('0x33')]=_0x1123aa[_0x51f7('0x33')];this[_0x51f7('0x34')]=_0x1123aa[_0x51f7('0x34')];this['predictiveIntervalErlangCalls']=_0x1123aa[_0x51f7('0x35')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1123aa[_0x51f7('0x36')];this[_0x51f7('0x37')]=_0x1123aa[_0x51f7('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x1123aa[_0x51f7('0x38')];this[_0x51f7('0x39')]=_0x1123aa[_0x51f7('0x39')];this[_0x51f7('0x3a')]=_0x1123aa[_0x51f7('0x3a')];this[_0x51f7('0x3b')]=_0x1123aa['predictiveIntervalTotalCalls'];this['originated']=_0x1123aa[_0x51f7('0x8')];this['erlangCalls']=_0x1123aa[_0x51f7('0x3c')];this[_0x51f7('0x3d')]=_0x1123aa[_0x51f7('0x3d')];this[_0x51f7('0x3e')]=_0x1123aa[_0x51f7('0x3e')];this[_0x51f7('0x3f')]=_0x1123aa[_0x51f7('0x3f')];this['startPredictive']=_0x1123aa[_0x51f7('0x40')];this[_0x51f7('0x41')]=_0x1123aa[_0x51f7('0x41')];this['message']=_0x1123aa[_0x51f7('0x42')];this[_0x51f7('0x43')]=_0x1123aa[_0x51f7('0x43')];}if(_0x1123aa[_0x51f7('0x44')]){this[_0x51f7('0x44')]={'id':_0x1123aa[_0x51f7('0x44')]['id'],'name':_0x1123aa[_0x51f7('0x44')][_0x51f7('0x12')],'active':_0x1123aa[_0x51f7('0x44')][_0x51f7('0x45')],'callerid':_0x1123aa[_0x51f7('0x44')][_0x51f7('0x46')]};}}VoiceQueueSummary['prototype'][_0x51f7('0x47')]=function(_0x38fdc1,_0x568241,_0x38ab23,_0xca9b00){this[_0x51f7('0x2')]=0x0;this['talking']=0x0;this[_0x51f7('0x10')]=0x0;this[_0x51f7('0x1f')]=0x0;this['notInUse']=0x0;this[_0x51f7('0x7')]=0x0;this[_0x51f7('0x15')]=0x0;this[_0x51f7('0x16')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0x51f7('0x19')]=0x0;this[_0x51f7('0x17')]=0x0;if(_0x38ab23){if(_0x38ab23[_0x51f7('0x0')]){this[_0x51f7('0x0')]=Number(_0x38ab23[_0x51f7('0x0')]);}if(_0x38ab23[_0x51f7('0x48')]){this[_0x51f7('0x1')]=Number(_0x38ab23[_0x51f7('0x48')]);}if(_0x38ab23[_0x51f7('0x49')]){this[_0x51f7('0x5')]=Number(_0x38ab23[_0x51f7('0x49')]);}}for(var _0x4dee60=0x0;_0x4dee60<_0x38fdc1['length'];_0x4dee60++){var _0x5957c1=_0x568241[_0x51f7('0x4a')+_0x38fdc1[_0x4dee60][_0x51f7('0x12')]];if(_0x5957c1&&_0x5957c1[_0x51f7('0x4b')]){this[_0x51f7('0x2')]+=0x1;}if(_0x38fdc1[_0x4dee60]['incall']==='1'){this['talking']+=0x1;}if(_0x38fdc1[_0x4dee60]['paused']==='1'&&!['2','7','8']['includes'](_0x38fdc1[_0x4dee60]['status'])){this[_0x51f7('0x10')]+=0x1;}switch(_0x38fdc1[_0x4dee60][_0x51f7('0x4c')]){case'0':this[_0x51f7('0x1f')]+=0x1;break;case'1':this[_0x51f7('0x18')]+=0x1;break;case'2':this[_0x51f7('0x7')]+=0x1;break;case'3':this[_0x51f7('0x15')]+=0x1;break;case'4':this[_0x51f7('0x16')]+=0x1;break;case'5':this[_0x51f7('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x51f7('0x19')]+=0x1;break;case'8':this[_0x51f7('0x17')]+=0x1;break;}}if(this[_0x51f7('0x22')]===_0x51f7('0x4d')){var _0x4d0f67=Object[_0x51f7('0x4e')](_0xca9b00);for(var _0x51ee6a=0x0;_0x51ee6a<_0x4d0f67[_0x51f7('0x4f')];_0x51ee6a++){var _0x1fe066=_0x4d0f67[_0x51ee6a];var _0x320824=_0xca9b00[_0x1fe066];if(_0x320824['queue']===this[_0x51f7('0x12')]&&_0x320824[_0x51f7('0x1d')]===_0x51f7('0x50')&&_0x320824[_0x51f7('0x51')]===_0x51f7('0x52')){this[_0x51f7('0x4')]+=0x1;}}if(this['talking']>this[_0x51f7('0x7')]){this[_0x51f7('0x4')]=this[_0x51f7('0x7')];}this[_0x51f7('0x21')]=0x0;}return this;};VoiceQueueSummary[_0x51f7('0x53')][_0x51f7('0x54')]=function(_0x2eb8b9){var _0x555a11=![];if(_0x2eb8b9){_0x555a11=INBOUND_COUNTERS['some'](function(_0x4540fd){return this[_0x4540fd]!==_0x2eb8b9[_0x4540fd];},this);}return _0x555a11;};VoiceQueueSummary[_0x51f7('0x53')][_0x51f7('0x55')]=function(_0x40297e){var _0x2057ee=![];var _0x5430f0=![];var _0x4f4059=![];if(_0x40297e){_0x2057ee=this[_0x51f7('0x22')]!==_0x40297e['dialMethod']||this[_0x51f7('0x56')]!==_0x40297e[_0x51f7('0x56')]||this[_0x51f7('0x42')]!==_0x40297e[_0x51f7('0x42')]||this[_0x51f7('0x43')]!==_0x40297e[_0x51f7('0x43')];_0x5430f0=OUTBOUND_COUNTERS['some'](function(_0x1e83e7){return this[_0x1e83e7]!==_0x40297e[_0x1e83e7];},this);if(this[_0x51f7('0x44')]&&_0x40297e[_0x51f7('0x44')]){_0x4f4059=this[_0x51f7('0x44')][_0x51f7('0x12')]!==_0x40297e['Trunk'][_0x51f7('0x12')]||this[_0x51f7('0x44')][_0x51f7('0x45')]!==_0x40297e['Trunk'][_0x51f7('0x45')];}}return _0x2057ee||_0x5430f0||_0x4f4059;};VoiceQueueSummary[_0x51f7('0x53')][_0x51f7('0x57')]=function(_0x178646){this[_0x51f7('0x6')]=_0x178646[_0x51f7('0x6')];this['message']=_0x178646['message'];this[_0x51f7('0x43')]=_0x178646[_0x51f7('0x43')];this[_0x51f7('0x8')]=_0x178646[_0x51f7('0x8')];this[_0x51f7('0x9')]=_0x178646['outboundAbandonedCallsDay'];this[_0x51f7('0xa')]=_0x178646[_0x51f7('0xa')];this[_0x51f7('0xb')]=_0x178646[_0x51f7('0xb')];this[_0x51f7('0x29')]=_0x178646['outboundBusyCallsDay'];this[_0x51f7('0xc')]=_0x178646[_0x51f7('0xc')];this[_0x51f7('0xd')]=_0x178646[_0x51f7('0xd')];this['outboundNoSuchCallsDay']=_0x178646[_0x51f7('0xe')];this[_0x51f7('0x2e')]=_0x178646[_0x51f7('0x2e')];this[_0x51f7('0x2f')]=_0x178646[_0x51f7('0x2f')];this[_0x51f7('0xf')]=_0x178646['outboundUnknownCallsDay'];this[_0x51f7('0x11')]=_0x178646[_0x51f7('0x11')];this['sumDuration']=_0x178646['sumDuration'];this['total']=_0x178646[_0x51f7('0x1c')];if(this['dialMethod']==='preview'){this[_0x51f7('0x21')]=_0x178646['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x6bac=['outboundReCallsDay','sumBillable','sumDuration','total','waiting','strategy','abandoned','answered','busy','invalid','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','active','callerid','prototype','createReport','notInUse','onHold','loggedin','callers','length','SIP/','online','includes','status','booked','keys','queue','dialer','exten','compareToInboundQueue','updateReportFromOutboundQueue','preview','available','loggedInDb','paused','ringing','talking','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x5a2201,_0x494e47){var _0x15b753=function(_0x2ab144){while(--_0x2ab144){_0x5a2201['push'](_0x5a2201['shift']());}};_0x15b753(++_0x494e47);}(_0x6bac,0xa5));var _0xc6ba=function(_0x517b64,_0x585ed3){_0x517b64=_0x517b64-0x0;var _0x241d90=_0x6bac[_0x517b64];return _0x241d90;};'use strict';var INBOUND_COUNTERS=[_0xc6ba('0x0'),'loggedIn',_0xc6ba('0x1'),_0xc6ba('0x2'),_0xc6ba('0x3'),_0xc6ba('0x4'),'waiting'];var OUTBOUND_COUNTERS=['available','answered',_0xc6ba('0x5'),_0xc6ba('0x6'),'loggedInDb',_0xc6ba('0x7'),_0xc6ba('0x8'),_0xc6ba('0x9'),_0xc6ba('0xa'),_0xc6ba('0xb'),_0xc6ba('0xc'),'outboundNoAnswerCallsDay','outboundNoSuchCallsDay',_0xc6ba('0xd'),'outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','talking',_0xc6ba('0xe'),_0xc6ba('0xf'),_0xc6ba('0x10'),_0xc6ba('0x11')];function VoiceQueueSummary(_0x2e01ee){this['id']=_0x2e01ee['id'];this['name']=_0x2e01ee['name'];this[_0xc6ba('0x12')]=_0x2e01ee[_0xc6ba('0x12')];this[_0xc6ba('0x13')]=_0x2e01ee[_0xc6ba('0x13')]||0x0;this[_0xc6ba('0x14')]=_0x2e01ee['answered']||0x0;this['available']=_0x2e01ee['available']||0x0;this[_0xc6ba('0x15')]=_0x2e01ee[_0xc6ba('0x15')]||0x0;this[_0xc6ba('0x5')]=_0x2e01ee[_0xc6ba('0x5')]||0x0;this[_0xc6ba('0x16')]=_0x2e01ee[_0xc6ba('0x16')]||0x0;this[_0xc6ba('0x6')]=_0x2e01ee[_0xc6ba('0x6')]||0x0;this['loggedInDb']=_0x2e01ee['loggedInDb']||0x0;this['onHold']=_0x2e01ee['onHold']||0x0;this['notInUse']=_0x2e01ee['notInUse']||0x0;this[_0xc6ba('0x2')]=_0x2e01ee[_0xc6ba('0x2')]||0x0;this['ringing']=_0x2e01ee['ringing']||0x0;this[_0xc6ba('0x17')]=_0x2e01ee['ringInUse'];this[_0xc6ba('0xe')]=_0x2e01ee[_0xc6ba('0xe')];this['sumDuration']=_0x2e01ee[_0xc6ba('0xf')];this[_0xc6ba('0x18')]=_0x2e01ee['sumHoldTime']||0x0;this[_0xc6ba('0x4')]=_0x2e01ee[_0xc6ba('0x4')]||0x0;this[_0xc6ba('0x10')]=_0x2e01ee[_0xc6ba('0x10')]||0x0;this[_0xc6ba('0x19')]=_0x2e01ee[_0xc6ba('0x19')];this[_0xc6ba('0x1a')]=_0x2e01ee[_0xc6ba('0x1a')]||0x0;this[_0xc6ba('0x1b')]=_0x2e01ee[_0xc6ba('0x1b')]||0x0;this[_0xc6ba('0x1c')]=_0x2e01ee[_0xc6ba('0x1c')]||0x0;this[_0xc6ba('0x11')]=_0x2e01ee[_0xc6ba('0x11')]||0x0;if(_0x2e01ee[_0xc6ba('0x19')]==='outbound'){this[_0xc6ba('0x1d')]=_0x2e01ee[_0xc6ba('0x1d')]||0x0;this[_0xc6ba('0x1e')]=_0x2e01ee[_0xc6ba('0x1e')];this[_0xc6ba('0x1f')]=_0x2e01ee[_0xc6ba('0x1f')];this['dialOriginateCallerIdName']=_0x2e01ee[_0xc6ba('0x20')];this[_0xc6ba('0x21')]=_0x2e01ee['dialOriginateCallerIdNumber'];this[_0xc6ba('0x22')]=_0x2e01ee[_0xc6ba('0x22')];this['dialPrefix']=_0x2e01ee[_0xc6ba('0x23')];this['temp']=_0x2e01ee[_0xc6ba('0x24')];this[_0xc6ba('0x25')]=_0x2e01ee[_0xc6ba('0x25')];this[_0xc6ba('0x9')]=_0x2e01ee['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x2e01ee[_0xc6ba('0xa')];this['outboundBusyCallsDay']=_0x2e01ee[_0xc6ba('0xb')];this['outboundCongestionCallsDay']=_0x2e01ee[_0xc6ba('0xc')];this[_0xc6ba('0x26')]=_0x2e01ee['outboundDropCallsDayACS'];this[_0xc6ba('0x27')]=_0x2e01ee[_0xc6ba('0x27')];this[_0xc6ba('0x28')]=_0x2e01ee[_0xc6ba('0x28')];this[_0xc6ba('0x29')]=_0x2e01ee[_0xc6ba('0x29')];this['outboundNoSuchCallsDay']=_0x2e01ee[_0xc6ba('0x2a')];this[_0xc6ba('0x2b')]=_0x2e01ee['outboundOriginateFailureCallsDay'];this[_0xc6ba('0xd')]=_0x2e01ee[_0xc6ba('0xd')];this['outboundRejectCallsDay']=_0x2e01ee[_0xc6ba('0x2c')];this[_0xc6ba('0x2d')]=_0x2e01ee['outboundUnknownCallsDay'];this[_0xc6ba('0x2e')]=_0x2e01ee[_0xc6ba('0x2e')];this[_0xc6ba('0x2f')]=_0x2e01ee[_0xc6ba('0x2f')];this[_0xc6ba('0x30')]=_0x2e01ee[_0xc6ba('0x30')];this['predictiveIntervalDroppedCallsCallersExit']=_0x2e01ee[_0xc6ba('0x31')];this[_0xc6ba('0x32')]=_0x2e01ee[_0xc6ba('0x32')];this[_0xc6ba('0x33')]=_0x2e01ee[_0xc6ba('0x33')];this[_0xc6ba('0x34')]=_0x2e01ee[_0xc6ba('0x34')];this[_0xc6ba('0x35')]=_0x2e01ee[_0xc6ba('0x35')];this[_0xc6ba('0x36')]=_0x2e01ee[_0xc6ba('0x36')];this[_0xc6ba('0x37')]=_0x2e01ee[_0xc6ba('0x37')];this[_0xc6ba('0x38')]=_0x2e01ee['predictiveIntervalAvailable'];this[_0xc6ba('0x39')]=_0x2e01ee[_0xc6ba('0x39')];this[_0xc6ba('0x7')]=_0x2e01ee['originated'];this[_0xc6ba('0x3a')]=_0x2e01ee['erlangCalls'];this[_0xc6ba('0x3b')]=_0x2e01ee['erlangCallToSecond'];this[_0xc6ba('0x3c')]=_0x2e01ee['erlangAbandonmentRate'];this[_0xc6ba('0x3d')]=_0x2e01ee['erlangBusyFactor'];this['startPredictive']=_0x2e01ee[_0xc6ba('0x3e')];this[_0xc6ba('0x3f')]=_0x2e01ee[_0xc6ba('0x3f')];this[_0xc6ba('0x40')]=_0x2e01ee['message'];this[_0xc6ba('0x41')]=_0x2e01ee[_0xc6ba('0x41')];}if(_0x2e01ee[_0xc6ba('0x42')]){this[_0xc6ba('0x42')]={'id':_0x2e01ee[_0xc6ba('0x42')]['id'],'name':_0x2e01ee[_0xc6ba('0x42')][_0xc6ba('0x43')],'active':_0x2e01ee['Trunk'][_0xc6ba('0x44')],'callerid':_0x2e01ee[_0xc6ba('0x42')][_0xc6ba('0x45')]};}}VoiceQueueSummary[_0xc6ba('0x46')][_0xc6ba('0x47')]=function(_0x4985f8,_0x5af16c,_0xc58daf,_0x174062){this['loggedInDb']=0x0;this[_0xc6ba('0x4')]=0x0;this[_0xc6ba('0x2')]=0x0;this[_0xc6ba('0x1b')]=0x0;this[_0xc6ba('0x48')]=0x0;this[_0xc6ba('0x5')]=0x0;this[_0xc6ba('0x15')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0xc6ba('0x3')]=0x0;this[_0xc6ba('0x17')]=0x0;this[_0xc6ba('0x49')]=0x0;if(_0xc58daf){if(_0xc58daf['available']){this['available']=Number(_0xc58daf[_0xc6ba('0x0')]);}if(_0xc58daf[_0xc6ba('0x4a')]){this[_0xc6ba('0x6')]=Number(_0xc58daf[_0xc6ba('0x4a')]);}if(_0xc58daf[_0xc6ba('0x4b')]){this['waiting']=Number(_0xc58daf[_0xc6ba('0x4b')]);}}for(var _0x1466f7=0x0;_0x1466f7<_0x4985f8[_0xc6ba('0x4c')];_0x1466f7++){var _0x47119a=_0x5af16c[_0xc6ba('0x4d')+_0x4985f8[_0x1466f7][_0xc6ba('0x43')]];if(_0x47119a&&_0x47119a[_0xc6ba('0x4e')]){this[_0xc6ba('0x1')]+=0x1;}if(_0x4985f8[_0x1466f7]['incall']==='1'){this[_0xc6ba('0x4')]+=0x1;}if(_0x4985f8[_0x1466f7][_0xc6ba('0x2')]==='1'&&!['2','7','8'][_0xc6ba('0x4f')](_0x4985f8[_0x1466f7]['status'])){this[_0xc6ba('0x2')]+=0x1;}switch(_0x4985f8[_0x1466f7][_0xc6ba('0x50')]){case'0':this[_0xc6ba('0x1b')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xc6ba('0x15')]+=0x1;break;case'4':this[_0xc6ba('0x16')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xc6ba('0x3')]+=0x1;break;case'7':this[_0xc6ba('0x17')]+=0x1;break;case'8':this[_0xc6ba('0x49')]+=0x1;break;}}if(this[_0xc6ba('0x1f')]===_0xc6ba('0x51')){var _0x2c50ff=Object[_0xc6ba('0x52')](_0x174062);for(var _0x283dac=0x0;_0x283dac<_0x2c50ff['length'];_0x283dac++){var _0x467f93=_0x2c50ff[_0x283dac];var _0x526945=_0x174062[_0x467f93];if(_0x526945[_0xc6ba('0x53')]===this[_0xc6ba('0x43')]&&_0x526945[_0xc6ba('0x19')]===_0xc6ba('0x54')&&_0x526945[_0xc6ba('0x55')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this['talking']>this['inUse']){this[_0xc6ba('0x4')]=this['inUse'];}this[_0xc6ba('0x1d')]=0x0;}return this;};VoiceQueueSummary[_0xc6ba('0x46')][_0xc6ba('0x56')]=function(_0x27267a){var _0x59580e=![];if(_0x27267a){_0x59580e=INBOUND_COUNTERS['some'](function(_0x121fa6){return this[_0x121fa6]!==_0x27267a[_0x121fa6];},this);}return _0x59580e;};VoiceQueueSummary[_0xc6ba('0x46')]['compareToOutboundQueue']=function(_0x23513d){var _0x32d5b6=![];var _0x40b74d=![];var _0x4796c2=![];if(_0x23513d){_0x32d5b6=this[_0xc6ba('0x1f')]!==_0x23513d['dialMethod']||this[_0xc6ba('0x1e')]!==_0x23513d[_0xc6ba('0x1e')]||this[_0xc6ba('0x40')]!==_0x23513d[_0xc6ba('0x40')]||this['statusMessage']!==_0x23513d[_0xc6ba('0x41')];_0x40b74d=OUTBOUND_COUNTERS['some'](function(_0x2f993d){return this[_0x2f993d]!==_0x23513d[_0x2f993d];},this);if(this['Trunk']&&_0x23513d[_0xc6ba('0x42')]){_0x4796c2=this[_0xc6ba('0x42')]['name']!==_0x23513d[_0xc6ba('0x42')][_0xc6ba('0x43')]||this[_0xc6ba('0x42')][_0xc6ba('0x44')]!==_0x23513d[_0xc6ba('0x42')][_0xc6ba('0x44')];}}return _0x32d5b6||_0x40b74d||_0x4796c2;};VoiceQueueSummary[_0xc6ba('0x46')][_0xc6ba('0x57')]=function(_0x48efde){this[_0xc6ba('0x14')]=_0x48efde[_0xc6ba('0x14')];this[_0xc6ba('0x40')]=_0x48efde[_0xc6ba('0x40')];this[_0xc6ba('0x41')]=_0x48efde['statusMessage'];this[_0xc6ba('0x7')]=_0x48efde[_0xc6ba('0x7')];this[_0xc6ba('0x8')]=_0x48efde[_0xc6ba('0x8')];this[_0xc6ba('0x9')]=_0x48efde[_0xc6ba('0x9')];this[_0xc6ba('0xa')]=_0x48efde[_0xc6ba('0xa')];this[_0xc6ba('0xb')]=_0x48efde[_0xc6ba('0xb')];this['outboundCongestionCallsDay']=_0x48efde['outboundCongestionCallsDay'];this[_0xc6ba('0x29')]=_0x48efde['outboundNoAnswerCallsDay'];this[_0xc6ba('0x2a')]=_0x48efde[_0xc6ba('0x2a')];this[_0xc6ba('0xd')]=_0x48efde[_0xc6ba('0xd')];this[_0xc6ba('0x2c')]=_0x48efde[_0xc6ba('0x2c')];this['outboundUnknownCallsDay']=_0x48efde[_0xc6ba('0x2d')];this[_0xc6ba('0xe')]=_0x48efde[_0xc6ba('0xe')];this[_0xc6ba('0xf')]=_0x48efde[_0xc6ba('0xf')];this[_0xc6ba('0x10')]=_0x48efde[_0xc6ba('0x10')];if(this['dialMethod']===_0xc6ba('0x58')){this[_0xc6ba('0x1d')]=_0x48efde[_0xc6ba('0x1d')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7c4d458..8d73b49 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 _0x6226=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x1cb1d5,_0xc2475c){var _0x38d8ba=function(_0x14ff27){while(--_0x14ff27){_0x1cb1d5['push'](_0x1cb1d5['shift']());}};_0x38d8ba(++_0xc2475c);}(_0x6226,0xb6));var _0x6622=function(_0x20add8,_0x29e5f6){_0x20add8=_0x20add8-0x0;var _0x22655e=_0x6226[_0x20add8];return _0x22655e;};'use strict';function VtigerAccount(_0x3a5623){this['id']=_0x3a5623['id']||0x0;this[_0x6622('0x0')]=_0x3a5623[_0x6622('0x0')]||'';this['username']=_0x3a5623[_0x6622('0x1')]||'';this[_0x6622('0x2')]=_0x3a5623[_0x6622('0x2')]||'';this['remoteUri']=_0x3a5623[_0x6622('0x3')]||'';this['serverUrl']=_0x3a5623[_0x6622('0x4')]||'';this[_0x6622('0x5')]=_0x3a5623['Configurations']||{};}module[_0x6622('0x6')]=VtigerAccount; \ No newline at end of file +var _0xb6b7=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xb6b7,0xe4));var _0x7b6b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb6b7[_0x167cc1];return _0x10bc4b;};'use strict';function VtigerAccount(_0x16b7f1){this['id']=_0x16b7f1['id']||0x0;this[_0x7b6b('0x0')]=_0x16b7f1[_0x7b6b('0x0')]||'';this[_0x7b6b('0x1')]=_0x16b7f1['username']||'';this['accessKey']=_0x16b7f1[_0x7b6b('0x2')]||'';this[_0x7b6b('0x3')]=_0x16b7f1[_0x7b6b('0x3')]||'';this[_0x7b6b('0x4')]=_0x16b7f1['serverUrl']||'';this[_0x7b6b('0x5')]=_0x16b7f1[_0x7b6b('0x5')]||{};}module[_0x7b6b('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index a860971..107c991 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 _0xb29a=['remoteUri','authType','type','serverUrl','Configurations','exports','name','password','token'];(function(_0x22a56e,_0x30e33b){var _0x15b947=function(_0x5c6f49){while(--_0x5c6f49){_0x22a56e['push'](_0x22a56e['shift']());}};_0x15b947(++_0x30e33b);}(_0xb29a,0x1d1));var _0xab29=function(_0x598199,_0x4b7599){_0x598199=_0x598199-0x0;var _0x178ea5=_0xb29a[_0x598199];return _0x178ea5;};'use strict';function ZendeskAccount(_0xe9d52e){this['id']=_0xe9d52e['id']||0x0;this[_0xab29('0x0')]=_0xe9d52e[_0xab29('0x0')]||'';this['username']=_0xe9d52e['username']||'';this[_0xab29('0x1')]=_0xe9d52e[_0xab29('0x1')]||'';this[_0xab29('0x2')]=_0xe9d52e['token']||'';this[_0xab29('0x3')]=_0xe9d52e[_0xab29('0x3')]||'';this[_0xab29('0x4')]=_0xe9d52e[_0xab29('0x4')]||'';this[_0xab29('0x5')]=_0xe9d52e['type']||'integrationTab';this['serverUrl']=_0xe9d52e[_0xab29('0x6')]||'';this[_0xab29('0x7')]=_0xe9d52e[_0xab29('0x7')]||{};}module[_0xab29('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x00bd=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3b4970,_0x5d8af2){var _0x64aba7=function(_0x4893d6){while(--_0x4893d6){_0x3b4970['push'](_0x3b4970['shift']());}};_0x64aba7(++_0x5d8af2);}(_0x00bd,0x1ef));var _0xd00b=function(_0x3de5b4,_0x41089){_0x3de5b4=_0x3de5b4-0x0;var _0x103eb1=_0x00bd[_0x3de5b4];return _0x103eb1;};'use strict';function ZendeskAccount(_0x8528e8){this['id']=_0x8528e8['id']||0x0;this[_0xd00b('0x0')]=_0x8528e8[_0xd00b('0x0')]||'';this[_0xd00b('0x1')]=_0x8528e8[_0xd00b('0x1')]||'';this['password']=_0x8528e8[_0xd00b('0x2')]||'';this[_0xd00b('0x3')]=_0x8528e8['token']||'';this[_0xd00b('0x4')]=_0x8528e8[_0xd00b('0x4')]||'';this[_0xd00b('0x5')]=_0x8528e8[_0xd00b('0x5')]||'';this['type']=_0x8528e8[_0xd00b('0x6')]||_0xd00b('0x7');this['serverUrl']=_0x8528e8[_0xd00b('0x8')]||'';this[_0xd00b('0x9')]=_0x8528e8[_0xd00b('0x9')]||{};}module[_0xd00b('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 7172736..0fbfe6c 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 _0x290e=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x52a659,_0x5e3c37){var _0xd10977=function(_0x5a2a8e){while(--_0x5a2a8e){_0x52a659['push'](_0x52a659['shift']());}};_0xd10977(++_0x5e3c37);}(_0x290e,0xb4));var _0xe290=function(_0x23d254,_0x1660a9){_0x23d254=_0x23d254-0x0;var _0x51f450=_0x290e[_0x23d254];return _0x51f450;};'use strict';function ZohoAccount(_0x96f26){this['id']=_0x96f26['id']||0x0;this[_0xe290('0x0')]=_0x96f26[_0xe290('0x0')]||'';this[_0xe290('0x1')]=_0x96f26[_0xe290('0x1')]||'';this[_0xe290('0x2')]=_0x96f26[_0xe290('0x2')]||'';this[_0xe290('0x3')]=_0x96f26[_0xe290('0x3')]||'';this[_0xe290('0x4')]=_0x96f26[_0xe290('0x4')]||'';this['clientSecret']=_0x96f26[_0xe290('0x5')]||'';this[_0xe290('0x6')]=_0x96f26[_0xe290('0x6')]||'';this['code']=_0x96f26[_0xe290('0x7')]||'';this[_0xe290('0x8')]=_0x96f26[_0xe290('0x8')]||'';this['Configurations']=_0x96f26[_0xe290('0x9')]||{};}module[_0xe290('0xa')]=ZohoAccount; \ No newline at end of file +var _0xa329=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xa329,0x9a));var _0x9a32=function(_0x50bfa1,_0x5bcfc4){_0x50bfa1=_0x50bfa1-0x0;var _0xc91a29=_0xa329[_0x50bfa1];return _0xc91a29;};'use strict';function ZohoAccount(_0x44d0f9){this['id']=_0x44d0f9['id']||0x0;this['name']=_0x44d0f9[_0x9a32('0x0')]||'';this[_0x9a32('0x1')]=_0x44d0f9['description']||'';this[_0x9a32('0x2')]=_0x44d0f9['host']||'';this[_0x9a32('0x3')]=_0x44d0f9[_0x9a32('0x3')]||'';this[_0x9a32('0x4')]=_0x44d0f9[_0x9a32('0x4')]||'';this[_0x9a32('0x5')]=_0x44d0f9['clientSecret']||'';this['serverUrl']=_0x44d0f9[_0x9a32('0x6')]||'';this[_0x9a32('0x7')]=_0x44d0f9[_0x9a32('0x7')]||'';this[_0x9a32('0x8')]=_0x44d0f9[_0x9a32('0x8')]||'';this[_0x9a32('0x9')]=_0x44d0f9[_0x9a32('0x9')]||{};}module[_0x9a32('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 388c6ff..62cbb3f 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 _0x0598=['Contact','phone','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','SIP/%s','calleridname'];(function(_0x31b5e0,_0x4fe2cb){var _0x19b926=function(_0x5bcfd3){while(--_0x5bcfd3){_0x31b5e0['push'](_0x31b5e0['shift']());}};_0x19b926(++_0x4fe2cb);}(_0x0598,0x92));var _0x8059=function(_0x175e8d,_0x4cfc12){_0x175e8d=_0x175e8d-0x0;var _0x6efc24=_0x0598[_0x175e8d];return _0x6efc24;};'use strict';var util=require(_0x8059('0x0'));var _=require(_0x8059('0x1'));var moment=require('moment');function checkNameSurname(_0x3386f0,_0x52c9bf,_0x4dad54){var _0x14109c='';if(!_[_0x8059('0x2')](_0x52c9bf)&&'string'===typeof _0x52c9bf){_0x14109c+=_0x52c9bf;}if(!_['isNil'](_0x4dad54)&&'string'===typeof _0x4dad54){_0x14109c+='\x20'+_0x4dad54;}if(_0x14109c!==''){return _0x14109c;}return _0x3386f0;}function Action(_0x467206,_0xa7d7c1,_0x512c0f,_0x5996d7,_0x248273){this[_0x8059('0x3')]=_0x512c0f||undefined;this[_0x8059('0x4')]=_0x467206['id'];this[_0x8059('0x5')]=_0xa7d7c1['name'];this['type']=_0xa7d7c1[_0x8059('0x6')];this[_0x8059('0x7')]=_0x8059('0x5');this[_0x8059('0x8')]=![];this[_0x8059('0x9')]=_['isNil'](_0x467206['Agent'])?undefined:_0x467206[_0x8059('0xa')][_0x8059('0xb')];this['channelAgent']=this['membername']?util['format'](_0x8059('0xc'),this[_0x8059('0x9')]):_0x5996d7||undefined;this[_0x8059('0xd')]=checkNameSurname(_0x467206[_0x8059('0xe')][_0x8059('0xf')],_0x467206['Contact'][_0x8059('0x10')],_0x467206['Contact'][_0x8059('0x11')]);this['active']=_0x467206[_0x8059('0x12')]||![];this[_0x8059('0x13')]=_0x467206[_0x8059('0xf')];this['scheduledat']=_0x467206['scheduledat'];this['countbusyretry']=_0x467206[_0x8059('0x14')]||0x0;this[_0x8059('0x15')]=_0x467206[_0x8059('0x15')]||0x0;this[_0x8059('0x16')]=_0x467206[_0x8059('0x16')]||0x0;this['countglobal']=(_0x467206[_0x8059('0x14')]||0x0)+(_0x467206[_0x8059('0x15')]||0x0)+(_0x467206[_0x8059('0x16')]||0x0)+(_0x467206[_0x8059('0x17')]||0x0)+(_0x467206['countdropretry']||0x0)+(_0x467206[_0x8059('0x18')]||0x0)+(_0x467206['countmachineretry']||0x0)+(_0x467206[_0x8059('0x19')]||0x0);this['countnosuchnumberretry']=_0x467206[_0x8059('0x17')]||0x0;this['countdropretry']=_0x467206[_0x8059('0x1a')]||0x0;this[_0x8059('0x18')]=_0x467206[_0x8059('0x18')]||0x0;this['countmachineretry']=_0x467206['countmachineretry']||0x0;this[_0x8059('0x19')]=_0x467206[_0x8059('0x19')]||0x0;this[_0x8059('0x1b')]=_0x467206[_0x8059('0x1b')];this['callbackuniqueid']=_0x467206[_0x8059('0x1c')];this[_0x8059('0x1d')]=_0x467206[_0x8059('0x1d')];this['recallme']=_0x467206[_0x8059('0x1e')];this[_0x8059('0x1f')]=_0x467206[_0x8059('0x1f')];this[_0x8059('0x20')]=_0x467206['ListId'];this[_0x8059('0x21')]=_[_0x8059('0x2')](_0x467206[_0x8059('0xa')])?_0x467206[_0x8059('0x21')]:_0x467206[_0x8059('0xa')]['id'];this['VoiceQueueId']=_0x467206[_0x8059('0x22')];this[_0x8059('0x23')]='';this[_0x8059('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x8059('0x25'),this[_0x8059('0xd')],this[_0x8059('0x26')]);};module[_0x8059('0x27')]=Action; \ No newline at end of file +var _0xed3c=['firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','type','campaigntype','queue','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','Contact','phone'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0xed3c,0x1a6));var _0xced3=function(_0x2cfbcf,_0x2cf96f){_0x2cfbcf=_0x2cfbcf-0x0;var _0x41fc13=_0xed3c[_0x2cfbcf];return _0x41fc13;};'use strict';var util=require(_0xced3('0x0'));var _=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));function checkNameSurname(_0x3fb5e1,_0x558ee8,_0xfdc1ed){var _0x144d14='';if(!_[_0xced3('0x3')](_0x558ee8)&&'string'===typeof _0x558ee8){_0x144d14+=_0x558ee8;}if(!_['isNil'](_0xfdc1ed)&&_0xced3('0x4')===typeof _0xfdc1ed){_0x144d14+='\x20'+_0xfdc1ed;}if(_0x144d14!==''){return _0x144d14;}return _0x3fb5e1;}function Action(_0x1ada18,_0x2f92f8,_0x1cd694,_0x4795cd,_0x510164){this['uniqueid']=_0x1cd694||undefined;this[_0xced3('0x5')]=_0x1ada18['id'];this['queue']=_0x2f92f8['name'];this['type']=_0x2f92f8[_0xced3('0x6')];this[_0xced3('0x7')]=_0xced3('0x8');this[_0xced3('0x9')]=![];this[_0xced3('0xa')]=_['isNil'](_0x1ada18[_0xced3('0xb')])?undefined:_0x1ada18[_0xced3('0xb')][_0xced3('0xc')];this['channelAgent']=this[_0xced3('0xa')]?util[_0xced3('0xd')](_0xced3('0xe'),this[_0xced3('0xa')]):_0x4795cd||undefined;this[_0xced3('0xf')]=checkNameSurname(_0x1ada18[_0xced3('0x10')][_0xced3('0x11')],_0x1ada18['Contact'][_0xced3('0x12')],_0x1ada18['Contact'][_0xced3('0x13')]);this[_0xced3('0x14')]=_0x1ada18[_0xced3('0x14')]||![];this[_0xced3('0x15')]=_0x1ada18['phone'];this[_0xced3('0x16')]=_0x1ada18[_0xced3('0x16')];this['countbusyretry']=_0x1ada18[_0xced3('0x17')]||0x0;this[_0xced3('0x18')]=_0x1ada18[_0xced3('0x18')]||0x0;this[_0xced3('0x19')]=_0x1ada18['countnoanswerretry']||0x0;this[_0xced3('0x1a')]=(_0x1ada18['countbusyretry']||0x0)+(_0x1ada18[_0xced3('0x18')]||0x0)+(_0x1ada18[_0xced3('0x19')]||0x0)+(_0x1ada18[_0xced3('0x1b')]||0x0)+(_0x1ada18[_0xced3('0x1c')]||0x0)+(_0x1ada18[_0xced3('0x1d')]||0x0)+(_0x1ada18[_0xced3('0x1e')]||0x0)+(_0x1ada18[_0xced3('0x1f')]||0x0);this[_0xced3('0x1b')]=_0x1ada18[_0xced3('0x1b')]||0x0;this[_0xced3('0x1c')]=_0x1ada18[_0xced3('0x1c')]||0x0;this['countabandonedretry']=_0x1ada18['countabandonedretry']||0x0;this['countmachineretry']=_0x1ada18[_0xced3('0x1e')]||0x0;this[_0xced3('0x1f')]=_0x1ada18[_0xced3('0x1f')]||0x0;this['callback']=_0x1ada18[_0xced3('0x20')];this[_0xced3('0x21')]=_0x1ada18['callbackuniqueid'];this['callbackat']=_0x1ada18[_0xced3('0x22')];this[_0xced3('0x23')]=_0x1ada18[_0xced3('0x23')];this[_0xced3('0x24')]=_0x1ada18['ContactId'];this[_0xced3('0x25')]=_0x1ada18[_0xced3('0x25')];this['UserId']=_[_0xced3('0x3')](_0x1ada18['Agent'])?_0x1ada18[_0xced3('0x26')]:_0x1ada18[_0xced3('0xb')]['id'];this[_0xced3('0x27')]=_0x1ada18[_0xced3('0x27')];this[_0xced3('0x28')]='';this['originatecalleridname']='';}Action['prototype'][_0xced3('0x29')]=function(){return util['format'](_0xced3('0x2a'),this[_0xced3('0xf')],this['number']);};module[_0xced3('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ad29f35..32f1318 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 _0x8e9d=['syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','ANSWER','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','acw','complete','total','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','totalGlobal','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','activeContact','swapAdditionalPhones','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','variables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','destlinkedid','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','moment','ioredis','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend'];(function(_0x3319c3,_0x46b4b7){var _0x32c397=function(_0x4a52d6){while(--_0x4a52d6){_0x3319c3['push'](_0x3319c3['shift']());}};_0x32c397(++_0x46b4b7);}(_0x8e9d,0x123));var _0xd8e9=function(_0xbbbab5,_0x1f07d0){_0xbbbab5=_0xbbbab5-0x0;var _0x50afc4=_0x8e9d[_0xbbbab5];return _0x50afc4;};'use strict';var util=require(_0xd8e9('0x0'));var _=require('lodash');var uuid=require(_0xd8e9('0x1'));var moment=require(_0xd8e9('0x2'));var Redis=require(_0xd8e9('0x3'));var config=require('../../../config/environment');var logger=require(_0xd8e9('0x4'))(_0xd8e9('0x5'));var loggerAction=require(_0xd8e9('0x4'))(_0xd8e9('0x6'));var ami=require(_0xd8e9('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xd8e9('0x8'));var Action=require(_0xd8e9('0x9'));var ut=require(_0xd8e9('0xa'));var utils=require('../dialer/utils');config[_0xd8e9('0xb')]=_[_0xd8e9('0xc')](config[_0xd8e9('0xb')],{'host':_0xd8e9('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd8e9('0xb')]));var Sequence=function(){};Sequence[_0xd8e9('0xe')][_0xd8e9('0xf')]=function(_0x72e68c){this[_0xd8e9('0x10')]=this[_0xd8e9('0x10')]?this['tail']['finally'](_0x72e68c):_0x72e68c();};function Preview(_0x1dca82){this[_0xd8e9('0x11')]=new Sequence();this[_0xd8e9('0x12')]=_0x1dca82[_0xd8e9('0x13')];this[_0xd8e9('0x14')]=_0x1dca82[_0xd8e9('0x14')];this[_0xd8e9('0x15')]={};this['agents']=_0x1dca82[_0xd8e9('0x16')];this[_0xd8e9('0x17')]=0x0;ami['on'](_0xd8e9('0x18'),this[_0xd8e9('0x19')][_0xd8e9('0x1a')](this));ami['on'](_0xd8e9('0x1b'),this[_0xd8e9('0x1c')][_0xd8e9('0x1a')](this));ami['on']('hanguprequest',this[_0xd8e9('0x1d')][_0xd8e9('0x1a')](this));ami['on'](_0xd8e9('0x1e'),this[_0xd8e9('0x1f')][_0xd8e9('0x1a')](this));ami['on']('newexten',this[_0xd8e9('0x20')][_0xd8e9('0x1a')](this));ami['on'](_0xd8e9('0x21'),this[_0xd8e9('0x22')]['bind'](this));ami['on'](_0xd8e9('0x23'),this[_0xd8e9('0x24')]['bind'](this));ami['on'](_0xd8e9('0x25'),this[_0xd8e9('0x26')][_0xd8e9('0x1a')](this));this[_0xd8e9('0x27')](this['campaignsPreview']);}function emit(_0x1517a8,_0x2cb112,_0x524e0d){io['to'](_0x1517a8)[_0xd8e9('0x28')](_0x2cb112,_0x524e0d);}function emitVoiceQueueChannelRemove(_0x53caff){logger[_0xd8e9('0x29')](_0xd8e9('0x2a'),JSON[_0xd8e9('0x2b')](_0x53caff));emit(util['format'](_0xd8e9('0x2c'),_0x53caff[_0xd8e9('0x2d')]),_0xd8e9('0x2e'),_0x53caff);io[_0xd8e9('0x28')](_0xd8e9('0x2f'),_0x53caff);}function notSendMessagesQueue(_0x579b99){if(_0x579b99[_0xd8e9('0x30')]){if(_0x579b99[_0xd8e9('0x31')]===0x0&&_0x579b99['pTalking']===0x0){_0x579b99[_0xd8e9('0x30')]=![];_0x579b99[_0xd8e9('0x32')]=0x0;_0x579b99[_0xd8e9('0x33')]=0x0;_0x579b99[_0xd8e9('0x34')]=utils[_0xd8e9('0x35')][_0xd8e9('0x36')];ut[_0xd8e9('0x37')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x579b99[_0xd8e9('0x2d')]+_0xd8e9('0x38'));}else{_0x579b99[_0xd8e9('0x34')]=utils[_0xd8e9('0x35')][_0xd8e9('0x39')];ut[_0xd8e9('0x37')](_0xd8e9('0x3a'),_0x579b99[_0xd8e9('0x2d')]+_0xd8e9('0x3b'));}}}Preview[_0xd8e9('0xe')]['loopCampaigns']=function(){var _0x44b653=this;setInterval(function(){_0x44b653[_0xd8e9('0x3c')]();},0x7cf);};Preview['prototype'][_0xd8e9('0x3c')]=function(){var _0x18c4bc=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0xcddc8 in _0x18c4bc){if(_0x18c4bc[_0xd8e9('0x3d')](_0xcddc8)&&(_0x18c4bc[_0xcddc8][_0xd8e9('0x3e')]===_0xd8e9('0x5')||_0x18c4bc[_0xcddc8][_0xd8e9('0x3e')]===_0xd8e9('0x3f'))&&_0x18c4bc[_0xcddc8]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xd8e9('0x17')]=0x0;this[_0xd8e9('0x40')]();}}if(_0x18c4bc[_0xd8e9('0x3d')](_0xcddc8)&&_0x18c4bc[_0xcddc8][_0xd8e9('0x3e')]==='preview'&&_0x18c4bc[_0xcddc8][_0xd8e9('0x41')]===_0xd8e9('0x42')){if(_0x18c4bc[_0xcddc8][_0xd8e9('0x43')]){this[_0xd8e9('0x44')](_0x18c4bc[_0xcddc8]);if(_0x18c4bc[_0xcddc8]['dialPreviewAutoRecallMe'])this[_0xd8e9('0x45')](_0x18c4bc[_0xcddc8]);}else{notSendMessagesQueue(_0x18c4bc[_0xcddc8]);}}}};Preview[_0xd8e9('0xe')][_0xd8e9('0x46')]=function(_0x4c98bd){var _0x3d6613=this;this['sequence'][_0xd8e9('0xf')](function(){if(!_[_0xd8e9('0x47')](_0x3d6613[_0xd8e9('0x15')][_0x4c98bd])){loggerAction[_0xd8e9('0x29')](_0xd8e9('0x48'),_0x4c98bd,'Queue',_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x49')],'originated:\x20',JSON['stringify'](_0x3d6613['campaignsPreview'][_0x3d6613[_0xd8e9('0x15')][_0x4c98bd]['queue']][_0xd8e9('0x31')]),_0xd8e9('0x4a'),JSON[_0xd8e9('0x2b')](_0x3d6613[_0xd8e9('0x12')][_0x3d6613['actions'][_0x4c98bd][_0xd8e9('0x49')]][_0xd8e9('0x4b')]),JSON['stringify'](_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x4c')]),JSON[_0xd8e9('0x2b')](_['pick'](_0x3d6613['actions'][_0x4c98bd],[_0xd8e9('0x4d'),_0xd8e9('0x4e'),_0xd8e9('0x4f'),_0xd8e9('0x50')])));return ami[_0xd8e9('0x51')]({'action':_0xd8e9('0x52'),'channel':_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x53')]})[_0xd8e9('0x54')](function(_0x5cc109){if(_0x5cc109['message']===_0xd8e9('0x55')){setTimeout(function(){if(_0x3d6613[_0xd8e9('0x15')][_0x4c98bd]){ut[_0xd8e9('0x56')](_0x3d6613['campaignsPreview'][_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x49')]],_0xd8e9('0x57'));if(_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x4c')]===!![]){ut[_0xd8e9('0x58')](_0x3d6613['campaignsPreview'][_0x3d6613['actions'][_0x4c98bd]['queue']],_0xd8e9('0x57'));ut[_0xd8e9('0x59')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4c98bd,_0x3d6613[_0xd8e9('0x15')][_0x4c98bd][_0xd8e9('0x49')]);}ut['loggerError'](_0xd8e9('0x5a')+_0x4c98bd,_0x3d6613['actions'][_0x4c98bd][_0xd8e9('0x49')]);delete _0x3d6613['actions'][_0x4c98bd];}},0x2328);}});}});};Preview[_0xd8e9('0xe')]['clearZombieChannels']=function(){var _0x5e7f7d=this;loggerAction['info'](_0xd8e9('0x5b'),_[_0xd8e9('0x5c')](this[_0xd8e9('0x15')]));for(var _0x1f2d7e in this[_0xd8e9('0x15')]){if(_0x5e7f7d['actions'][_0xd8e9('0x3d')](_0x1f2d7e)){_0x5e7f7d[_0xd8e9('0x46')](_0x1f2d7e);}}};Preview[_0xd8e9('0xe')][_0xd8e9('0x45')]=function(_0x594fa6){var _0xa26782=this;rpcDb[_0xd8e9('0x5d')](_0x594fa6['id'],ut[_0xd8e9('0x5e')](this[_0xd8e9('0x16')]))[_0xd8e9('0x5f')](function(_0x5bfec3){if(!_[_0xd8e9('0x47')](_0x5bfec3)){for(var _0x316112=0x0;_0x316112<_0x5bfec3[_0xd8e9('0x60')];_0x316112+=0x1){if(ut[_0xd8e9('0x61')](_0x5bfec3[_0x316112]['scheduledat'])<_0x594fa6[_0xd8e9('0x62')]*0x3c){if(_0x5bfec3[_0x316112][_0xd8e9('0x63')]&&!_0x5bfec3[_0x316112]['Agent'][_0xd8e9('0x64')]){_0xa26782[_0xd8e9('0x65')](_0x5bfec3[_0x316112]['id'])[_0xd8e9('0x5f')](ut[_0xd8e9('0x66')]('[RecallMe]'))[_0xd8e9('0x54')](ut[_0xd8e9('0x66')](_0xd8e9('0x67')));}else{rpcDb[_0xd8e9('0x68')](_0x5bfec3[_0x316112]['id']);}}else{var _0x56e699=new Action(_0x5bfec3[_0x316112],_0x594fa6);_0x56e699[_0xd8e9('0x69')]=moment()[_0xd8e9('0x6a')](_0xd8e9('0x6b'));_0x594fa6[_0xd8e9('0x6c')]+=0x1;ut['logCustomer'](_0x56e699,0x17,_0xd8e9('0x6d'));if(_0x594fa6[_0xd8e9('0x6e')]){rpcDb[_0xd8e9('0x6f')](ut[_0xd8e9('0x70')](_0x5bfec3[_0x316112]));rpcDb['createCustomerHistory'](_0x56e699,_0xd8e9('0x71'));}else{ut[_0xd8e9('0x72')](_0x56e699,0x16,_0xd8e9('0x73'));rpcDb[_0xd8e9('0x74')](_0x56e699,'[HistoryRecallClose]');rpcDb[_0xd8e9('0x75')](_0x56e699,_0xd8e9('0x76'));}}}}})[_0xd8e9('0x54')](ut[_0xd8e9('0x66')](_0xd8e9('0x77')));};Preview[_0xd8e9('0xe')]['setMessage']=function(_0x79f49c){_0x79f49c[_0xd8e9('0x30')]=!![];if(ut[_0xd8e9('0x78')](_0x79f49c[_0xd8e9('0x79')])){_0x79f49c[_0xd8e9('0x34')]=utils[_0xd8e9('0x35')][_0xd8e9('0x7a')];}else if(!ut[_0xd8e9('0x7b')](_0x79f49c[_0xd8e9('0x43')])){_0x79f49c['message']=utils[_0xd8e9('0x35')][_0xd8e9('0x36')];}else if(!this[_0xd8e9('0x7c')](_0x79f49c[_0xd8e9('0x7d')])){if(!this[_0xd8e9('0x7c')](_0x79f49c[_0xd8e9('0x7e')])){_0x79f49c['message']=utils[_0xd8e9('0x35')][_0xd8e9('0x7f')];}else{_0x79f49c['message']=utils['CAMPAIGN_STATUS'][_0xd8e9('0x80')];}}else{_0x79f49c[_0xd8e9('0x34')]=utils['CAMPAIGN_STATUS'][_0xd8e9('0x80')];}};Preview[_0xd8e9('0xe')][_0xd8e9('0x81')]=function(_0x5e13d9,_0x1f45ac,_0x20c36f){var _0xea56e6=this;var _0x3c319e=this['actions'][_0x1f45ac];var _0x351a71=this['campaignsPreview'][_0x3c319e[_0xd8e9('0x49')]];var _0x1821cf;var _0x2c318f=![];var _0x5b9126=0x2;var _0x51a9db=0x3;if(_0x351a71){switch(_0x20c36f){case'1':_0x351a71['outboundNoSuchCallsDay']+=0x1;_0x3c319e[_0xd8e9('0x82')]+=0x1;_0x3c319e['countglobal']=ut['totalGlobal'](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x0,_0xd8e9('0x83'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x3c319e,'nosuchnumber'));rpcDb[_0xd8e9('0x74')](_0x3c319e,_0xd8e9('0x84'));_0xea56e6['verifyAdditionalPhones'](_0x3c319e,'0',_0x351a71)[_0xd8e9('0x5f')](function(_0x451d3c){_0x2c318f=_0x451d3c[_0xd8e9('0x85')]==0x1;_0x5b9126=_0x351a71['dialNoSuchNumberRetryFrequency'];_0x51a9db=_0x351a71[_0xd8e9('0x86')];if(!_0x2c318f){if(ut['totalGlobal'](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut['cloneAction'](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb[_0xd8e9('0x75')](_0x1821cf,_0xd8e9('0x89'));}else{if(_0x3c319e[_0xd8e9('0x82')]>=_0x351a71[_0xd8e9('0x8a')]){rpcDb['createCustomerFinal'](_0x3c319e,_0xd8e9('0x89'));}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,_0xd8e9('0x82'),_0x351a71['dialNoSuchNumberRetryFrequency']),_0x3c319e['unlockAgent'],_0x3c319e['activeContact']);}}delete this['actions'][_0x5e13d9[_0xd8e9('0x8d')]];}else{_0x3c319e['countnosuchnumberretry']++;logger[_0xd8e9('0x29')](_0xd8e9('0x8e'),_0x3c319e[_0xd8e9('0x82')]);logger[_0xd8e9('0x29')]('id',_0x3c319e['idContact']);_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countnosuchnumberretry':_0x3c319e['countnosuchnumberretry']}})[_0xd8e9('0x5f')](function(){_0xea56e6['swapAdditionalPhones'](_0x3c319e,_0x5b9126,_0x51a9db)[_0xd8e9('0x5f')](function(){});});}});break;case _0xd8e9('0x91'):var _0x251c16=moment()['format'](_0xd8e9('0x6b'));_0x3c319e['responsetime']=_0x251c16;_0x3c319e['answertime']=_0x251c16;_0x3c319e[_0xd8e9('0x4c')]=!![];_0x351a71[_0xd8e9('0x4b')]+=0x1;logger[_0xd8e9('0x29')](_0xd8e9('0x92'),_0x3c319e['uniqueid'],_0xd8e9('0x93'),_0x351a71[_0xd8e9('0x2d')],_0xd8e9('0x4a'),_0x351a71[_0xd8e9('0x4b')]);ami[_0xd8e9('0x28')](_0xd8e9('0x94'),ut[_0xd8e9('0x95')](_0x3c319e,'connect',this[_0xd8e9('0x12')][_0x3c319e['queue']]));if(_0x351a71[_0xd8e9('0x96')]){ami[_0xd8e9('0x28')]('custom:agentConnectPreview',ut['buildAcw'](_0x3c319e));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xd8e9('0x95')](_0x3c319e,_0xd8e9('0x97'),this['campaignsPreview'][_0x3c319e['queue']]));emitVoiceQueueChannelRemove(ut[_0xd8e9('0x95')](_0x3c319e,_0xd8e9('0x97')));_0x351a71['outboundAnswerCallsDay']+=0x1;_0x351a71[_0xd8e9('0x98')]+=0x1;_0x351a71['answered']+=0x1;ut[_0xd8e9('0x58')](_0x351a71,'[16]');_0x3c319e[_0xd8e9('0x99')]=ut['totalGlobal'](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x4,_0xd8e9('0x9a'));rpcDb[_0xd8e9('0x74')](_0x3c319e,_0xd8e9('0x9b'));rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0x9c'));rpcDb['crateCustomerReportQueue'](_0x3c319e);_0x351a71[_0xd8e9('0x9d')]+=_0x3c319e[_0xd8e9('0x9e')];_0x351a71['sumBillable']+=_0x3c319e['talktime'];logger[_0xd8e9('0x29')](_0xd8e9('0x9f'),_0x3c319e[_0xd8e9('0xa0')],_0xd8e9('0x93'),_0x351a71[_0xd8e9('0x2d')],'pTalking:\x20',_0x351a71[_0xd8e9('0x4b')]);delete this['actions'][_0x5e13d9['linkedid']];break;case _0xd8e9('0xa1'):_0x351a71[_0xd8e9('0xa2')]+=0x1;_0x3c319e[_0xd8e9('0xa3')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut['totalGlobal'](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x5,_0xd8e9('0xa4'));_0x5b9126=_0x351a71[_0xd8e9('0xa5')];_0x51a9db=_0x351a71[_0xd8e9('0x86')];ami[_0xd8e9('0x28')](_0xd8e9('0xa6'),ut['buildObj'](_0x3c319e,_0xd8e9('0xa7')));rpcDb[_0xd8e9('0x74')](_0x3c319e,_0xd8e9('0xa8'));_0xea56e6[_0xd8e9('0xa9')](_0x3c319e,'5',_0x351a71)['then'](function(_0x2957fb){_0x2c318f=_0x2957fb[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut['cloneAction'](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb[_0xd8e9('0x75')](_0x1821cf,_0xd8e9('0xab'));}else{if(_0x3c319e[_0xd8e9('0xa3')]>=_0x351a71[_0xd8e9('0xac')]){rpcDb[_0xd8e9('0x75')](_0x3c319e,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,'countbusyretry',_0x351a71['dialBusyRetryFrequency']),_0x3c319e[_0xd8e9('0xad')],_0x3c319e['activeContact']);}}}else{_0x3c319e[_0xd8e9('0xa3')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countbusyretry':_0x3c319e[_0xd8e9('0xa3')]}})[_0xd8e9('0x5f')](function(){_0xea56e6['swapAdditionalPhones'](_0x3c319e,_0x5b9126,_0x51a9db)['then'](function(){});});}});break;case _0xd8e9('0xae'):_0x351a71['outboundNoAnswerCallsDay']+=0x1;_0x3c319e[_0xd8e9('0xaf')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x3,'NoAnswer');_0x5b9126=_0x351a71[_0xd8e9('0xb0')];_0x51a9db=_0x351a71[_0xd8e9('0x86')];var _0x4d5c56=ut[_0xd8e9('0xb1')](_0x3c319e,_0x351a71);ami['emit']('custom:agentnoanswer',_0x4d5c56);rpcDb[_0xd8e9('0x74')](_0x3c319e,_0xd8e9('0xb2'));_0xea56e6['verifyAdditionalPhones'](_0x3c319e,'3',_0x351a71)['then'](function(_0x30e265){_0x2c318f=_0x30e265[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb[_0xd8e9('0x75')](_0x1821cf,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3c319e['countnoanswerretry']>=_0x351a71['dialNoAnswerMaxRetry']){rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xb2'));}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,'countnoanswerretry',_0x351a71['dialNoAnswerRetryFrequency']),_0x3c319e[_0xd8e9('0xad')],_0x3c319e[_0xd8e9('0xb4')]);}}}else{_0x3c319e[_0xd8e9('0xaf')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e['idContact'],'field':{'countnoanswerretry':_0x3c319e['countnoanswerretry']}})['then'](function(){_0xea56e6[_0xd8e9('0xb5')](_0x3c319e,_0x5b9126,_0x51a9db)['then'](function(){});});}});break;case _0xd8e9('0xb6'):_0x351a71[_0xd8e9('0xb7')]+=0x1;_0x3c319e[_0xd8e9('0xb8')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut['logCustomer'](_0x3c319e,0x8,_0xd8e9('0xb9'));_0x5b9126=_0x351a71[_0xd8e9('0xba')];_0x51a9db=_0x351a71[_0xd8e9('0x86')];ami[_0xd8e9('0x28')](_0xd8e9('0xbb'),ut['buildObj'](_0x3c319e,_0xd8e9('0xbc')));rpcDb[_0xd8e9('0x74')](_0x3c319e,_0xd8e9('0xbd'));_0xea56e6[_0xd8e9('0xa9')](_0x3c319e,'8',_0x351a71)[_0xd8e9('0x5f')](function(_0x28c8de){_0x2c318f=_0x28c8de[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb[_0xd8e9('0x75')](_0x1821cf,_0xd8e9('0xbe'));}else{if(_0x3c319e[_0xd8e9('0xb8')]>=_0x351a71[_0xd8e9('0xbf')]){rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xbd'));}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,_0xd8e9('0xb8'),_0x351a71[_0xd8e9('0xa5')]),_0x3c319e[_0xd8e9('0xad')],_0x3c319e[_0xd8e9('0xb4')]);}}}else{_0x3c319e['countcongestionretry']++;_0xea56e6['incrementPreviewCounters']({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countcongestionretry':_0x3c319e['countcongestionretry']}})[_0xd8e9('0x5f')](function(){_0xea56e6['swapAdditionalPhones'](_0x3c319e,_0x5b9126,_0x51a9db)['then'](function(){});});}});break;case _0xd8e9('0xc0'):_0x351a71[_0xd8e9('0xc1')]+=0x1;_0x3c319e[_0xd8e9('0xc2')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut['logCustomer'](_0x3c319e,0x14,_0xd8e9('0xc3'));_0x5b9126=_0x351a71[_0xd8e9('0xc4')];_0x51a9db=_0x351a71['callAdditionalPhoneAfterMin'];ami[_0xd8e9('0x28')]('custom:agentreject',ut[_0xd8e9('0x95')](_0x3c319e,_0xd8e9('0xc5')));rpcDb[_0xd8e9('0x74')](_0x3c319e,'[syncHangupRequest][logAgentReject]');_0xea56e6['verifyAdditionalPhones'](_0x3c319e,'20',_0x351a71)[_0xd8e9('0x5f')](function(_0x580fed){_0x2c318f=_0x580fed[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0x14,_0xd8e9('0xc3'));rpcDb[_0xd8e9('0x75')](_0x1821cf,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3c319e[_0xd8e9('0xc2')]>=_0x351a71[_0xd8e9('0xc6')]){rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xc7'));}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,_0xd8e9('0xc2'),_0x351a71[_0xd8e9('0xc4')]),_0x3c319e['unlockAgent'],_0x3c319e[_0xd8e9('0xb4')]);}}}else{_0x3c319e[_0xd8e9('0xaf')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countnoanswerretry':_0x3c319e[_0xd8e9('0xaf')]}})[_0xd8e9('0x5f')](function(){_0xea56e6[_0xd8e9('0xb5')](_0x3c319e,_0x5b9126,_0x51a9db)[_0xd8e9('0x5f')](function(){});});}});break;case'ABANDONED':_0x351a71[_0xd8e9('0xc8')]+=0x1;_0x3c319e['countabandonedretry']+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0xb,_0xd8e9('0xc9'));rpcDb['createCustomerHistory'](_0x3c319e,_0xd8e9('0xca'));_0xea56e6['verifyAdditionalPhones'](_0x3c319e,'11',_0x351a71)[_0xd8e9('0x5f')](function(_0x4dbb5a){_0x2c318f=_0x4dbb5a[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0xf,'Global');rpcDb[_0xd8e9('0x75')](_0x1821cf,_0xd8e9('0xca'));}else{if(_0x3c319e[_0xd8e9('0xcb')]>=_0x351a71[_0xd8e9('0xcc')]){rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xca'));}else{rpcDb[_0xd8e9('0x8b')](ut[_0xd8e9('0x8c')](_0x3c319e,_0xd8e9('0xcd'),_0x351a71[_0xd8e9('0xce')]),_0x3c319e[_0xd8e9('0xad')],_0x3c319e[_0xd8e9('0xb4')]);}}}else{_0x3c319e[_0xd8e9('0xaf')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countnoanswerretry':_0x3c319e[_0xd8e9('0xaf')]}})[_0xd8e9('0x5f')](function(){_0xea56e6['swapAdditionalPhones'](_0x3c319e,_0x5b9126,_0x51a9db)[_0xd8e9('0x5f')](function(){});});}});break;case'18':_0x351a71[_0xd8e9('0xcf')]+=0x1;_0x3c319e[_0xd8e9('0xd0')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x12,_0x5e13d9[_0xd8e9('0xd1')]||_0x5e13d9[_0xd8e9('0xd2')]);ami[_0xd8e9('0x28')]('custom:amd',ut['buildObj'](_0x3c319e,'amd'));rpcDb[_0xd8e9('0x74')](_0x3c319e,'[callProgressDetectingCustomer][hangupInAMD]');_0xea56e6['verifyAdditionalPhones'](_0x3c319e,'18',_0x351a71)['then'](function(_0x42f5b8){_0x2c318f=_0x42f5b8['additional']==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71['dialGlobalMaxRetry']){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0x12,_0xd8e9('0x88'));rpcDb['createCustomerFinal'](_0x1821cf,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xd3'));}}else{_0x3c319e[_0xd8e9('0xaf')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countnoanswerretry':_0x3c319e[_0xd8e9('0xaf')]}})[_0xd8e9('0x5f')](function(){_0xea56e6[_0xd8e9('0xb5')](_0x3c319e,_0x5b9126,_0x51a9db)['then'](function(){});});}});delete this['actions'][_0x5e13d9[_0xd8e9('0x8d')]];break;case'19':_0x351a71[_0xd8e9('0xcf')]+=0x1;_0x3c319e['countglobal']=ut['totalGlobal'](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0x13,_0x5e13d9[_0xd8e9('0xd1')]||_0x5e13d9['dialstatus']);ami[_0xd8e9('0x28')](_0xd8e9('0xd4'),ut[_0xd8e9('0x95')](_0x3c319e,_0xd8e9('0xd5')));rpcDb['createCustomerHistory'](_0x3c319e,_0xd8e9('0xd6'));_0xea56e6[_0xd8e9('0xa9')](_0x3c319e,'18',_0x351a71)[_0xd8e9('0x5f')](function(_0x186969){_0x2c318f=_0x186969[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71['dialGlobalMaxRetry']){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb[_0xd8e9('0x75')](_0x1821cf,_0xd8e9('0xd6'));}else{rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xd6'));}}else{_0x3c319e[_0xd8e9('0xaf')]++;_0xea56e6[_0xd8e9('0x8f')]({'id':_0x3c319e[_0xd8e9('0x90')],'field':{'countnoanswerretry':_0x3c319e[_0xd8e9('0xaf')]}})[_0xd8e9('0x5f')](function(){_0xea56e6[_0xd8e9('0xb5')](_0x3c319e,_0x5b9126,_0x51a9db)[_0xd8e9('0x5f')](function(){});});}});delete this[_0xd8e9('0x15')][_0x5e13d9[_0xd8e9('0x8d')]];break;default:if(_0x3c319e[_0xd8e9('0x4c')]){ut[_0xd8e9('0x58')](_0x351a71,_0xd8e9('0xd7'));ut['loggerError'](_0xd8e9('0xd8')+_0x351a71[_0xd8e9('0x2d')],_0x5e13d9);}_0x351a71[_0xd8e9('0xcf')]+=0x1;_0x3c319e[_0xd8e9('0x99')]=ut[_0xd8e9('0xaa')](_0x3c319e);ut[_0xd8e9('0x72')](_0x3c319e,0xc,_0x5e13d9[_0xd8e9('0xd1')]||_0x5e13d9[_0xd8e9('0xd2')]);_0x5b9126=_0x351a71['dialAgentRejectRetryFrequency'];_0x51a9db=_0x351a71[_0xd8e9('0x86')];rpcDb[_0xd8e9('0x74')](_0x3c319e,'[callProgressDetectingCustomer][logUnknown]');_0xea56e6[_0xd8e9('0xa9')](_0x3c319e,'20',_0x351a71)[_0xd8e9('0x5f')](function(_0x186c20){_0x2c318f=_0x186c20[_0xd8e9('0x85')]==0x1;if(!_0x2c318f){if(ut[_0xd8e9('0xaa')](_0x3c319e)>=_0x351a71[_0xd8e9('0x87')]){_0x1821cf=ut[_0xd8e9('0xb3')](_0x3c319e,0xf,_0xd8e9('0x88'));rpcDb['createCustomerFinal'](_0x1821cf,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd8e9('0x75')](_0x3c319e,_0xd8e9('0xd9'));}delete this[_0xd8e9('0x15')][_0x5e13d9[_0xd8e9('0x8d')]];}else{_0xea56e6[_0xd8e9('0xb5')](_0x3c319e,_0x5b9126,_0x51a9db)[_0xd8e9('0x5f')](function(){});}});}if(!(_0x3c319e[_0xd8e9('0x4c')]&&_0x20c36f==='16')){ut[_0xd8e9('0x56')](_0x351a71,_0xd8e9('0xda'));logger[_0xd8e9('0x29')](_0xd8e9('0xdb'),_0x3c319e[_0xd8e9('0xa0')],_0xd8e9('0x93'),_0x351a71[_0xd8e9('0x2d')],_0xd8e9('0xdc'),_0x351a71[_0xd8e9('0x31')]);}if(_0x20c36f!==_0xd8e9('0x91')){delete this[_0xd8e9('0x15')][_0x5e13d9['linkedid']];delete this[_0xd8e9('0x15')][_0x5e13d9['destlinkedid']];}_0x351a71[_0xd8e9('0xdd')]=!![];}};Preview[_0xd8e9('0xe')]['callProgressDetectingAgent']=function(_0x1eb6ca,_0xe61f24,_0x5cf5ac){if(_[_0xd8e9('0xde')](_0xe61f24)&&_0xd8e9('0xdf')!==typeof _0xe61f24){return;}if(_[_0xd8e9('0xde')](_0x5cf5ac)&&_0xd8e9('0xdf')!==typeof _0x5cf5ac){return;}switch(_0x5cf5ac[_0xd8e9('0xe0')]){case'0':ut[_0xd8e9('0xe1')](_0x1eb6ca,0x0,_0xd8e9('0x83'));rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe3'));break;case'3':ut[_0xd8e9('0xe1')](_0x1eb6ca,0x3,'NoAnswer');rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe4'));break;case'5':ut[_0xd8e9('0xe1')](_0x1eb6ca,0x5,'Busy');rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe5'));break;case'8':ut[_0xd8e9('0xe1')](_0x1eb6ca,0x8,_0xd8e9('0xb9'));rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe6'));break;case'22':ut[_0xd8e9('0xe1')](_0x1eb6ca,0x16,_0xd8e9('0xe7'));rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe8'));break;default:ut['logAgent'](_0x1eb6ca,0xc,_0x5cf5ac[_0xd8e9('0xe0')]);rpcDb[_0xd8e9('0xe2')](_0x1eb6ca,_0xd8e9('0xe6'));}ut[_0xd8e9('0x56')](_0xe61f24,'[callProgressDetectingAgent]');logger[_0xd8e9('0x29')](_0xd8e9('0xe9'),_0x1eb6ca[_0xd8e9('0xa0')],_0xd8e9('0x93'),_0xe61f24[_0xd8e9('0x2d')],'originated:\x20',_0xe61f24[_0xd8e9('0x31')]);delete this[_0xd8e9('0x15')][_0x1eb6ca[_0xd8e9('0xa0')]];};Preview[_0xd8e9('0xe')]['verifyAdditionalPhones']=function(_0x48f637,_0x4760b4,_0xe5f7e6){return cmHopperAdditionalPhone[_0xd8e9('0xa9')](_0x48f637,_0x4760b4,_0xe5f7e6)[_0xd8e9('0x54')](logger[_0xd8e9('0x29')](_0xd8e9('0xea')));};Preview[_0xd8e9('0xe')][_0xd8e9('0xb5')]=function(_0x5e155c,_0x248d7e,_0x3b2569){return cmHopperAdditionalPhone[_0xd8e9('0xb5')](_0x5e155c,_0x248d7e,_0x3b2569)[_0xd8e9('0x54')](logger[_0xd8e9('0x29')](_0xd8e9('0xeb')));};Preview['prototype'][_0xd8e9('0x8f')]=function(_0x52dfee){return Promise['resolve']()[_0xd8e9('0x5f')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x52dfee))[_0xd8e9('0x54')](logger[_0xd8e9('0x29')](_0xd8e9('0xec')));};Preview['prototype']['checkInBlack']=function(_0x5c2fa6,_0x537557,_0x589683,_0x33cdbe,_0x1c577e){var _0x55140f=this;return new Promise(function(_0x4bd068,_0x4ca50d){if(_[_0xd8e9('0x47')](_0x537557)||_['isNil'](_0x537557[_0xd8e9('0xed')])||_[_0xd8e9('0x47')](_0x537557['phone'])||_['isNil'](_0x537557['VoiceQueueId'])){_0x4ca50d(ut[_0xd8e9('0x34')]('Contact\x20is\x20undefined',_0x33cdbe,_0x1c577e));return;}var _0x4c4421=uuid['v4']();var _0xa61c5f=_0x55140f['campaignsPreview'][_0x537557[_0xd8e9('0xee')][_0xd8e9('0x2d')]];var _0x239bbf=_0x589683?_0x55140f[_0xd8e9('0x16')][_0x589683]['id']:undefined;_0x55140f[_0xd8e9('0x15')][_0x4c4421]=new Action(_0x537557,_0xa61c5f,_0x4c4421,_0x589683,_0x239bbf);var _0x2e4d5a=_0x55140f[_0xd8e9('0x15')][_0x4c4421];_0x2e4d5a['unlockAgent']=_0x33cdbe;_0x2e4d5a['activeContact']=_0x1c577e;_0x2e4d5a[_0xd8e9('0xef')]=_0x589683;if(_[_0xd8e9('0xf0')](_0x5c2fa6)){_0x55140f[_0xd8e9('0xf1')](_0x2e4d5a,_0xa61c5f,_0x537557,_0x589683)[_0xd8e9('0x5f')](function(_0x357224){logger[_0xd8e9('0x29')](_0xd8e9('0xf2'),_0xd8e9('0xf3')+_0x2e4d5a[_0xd8e9('0x49')]+_0xd8e9('0xf4')+_0x2e4d5a['idContact'],JSON[_0xd8e9('0x2b')](_0x357224));ami[_0xd8e9('0x28')](_0xd8e9('0xf5'),ut[_0xd8e9('0x95')](_0x2e4d5a,_0xd8e9('0xf6'),_0x55140f['campaignsPreview'][_0x2e4d5a[_0xd8e9('0x49')]]));_0x4bd068(ut[_0xd8e9('0x34')](_0xd8e9('0xf7')));})[_0xd8e9('0x54')](function(_0x3d47c8){ut[_0xd8e9('0x37')](_0xd8e9('0xf8'),_0x3d47c8);_0x4ca50d(ut[_0xd8e9('0x34')](_0xd8e9('0xf9'),_0x33cdbe,_0x1c577e));});}else{_0xa61c5f[_0xd8e9('0xfa')]+=0x1;ut[_0xd8e9('0xfb')](_0x2e4d5a);rpcDb['createHistory'](_0x2e4d5a,_0xd8e9('0xfc'));delete _0x55140f[_0xd8e9('0x15')][_0x4c4421];_0x4ca50d(ut[_0xd8e9('0x34')](_0xd8e9('0xfd'),_0x33cdbe,_0x1c577e));}});};Preview[_0xd8e9('0xe')]['isTrunkReachable']=function(_0x2ab08f){return!_[_0xd8e9('0x47')](_0x2ab08f)&&!_['isNil'](_0x2ab08f[_0xd8e9('0x2d')])&&!_[_0xd8e9('0x47')](_0x2ab08f['active'])&&_0x2ab08f[_0xd8e9('0xfe')]&&!_[_0xd8e9('0x47')](this['trunks'][util['format'](_0xd8e9('0xff'),_0x2ab08f[_0xd8e9('0x2d')])])&&!_[_0xd8e9('0x47')](this[_0xd8e9('0x14')][util['format'](_0xd8e9('0xff'),_0x2ab08f[_0xd8e9('0x2d')])]['status'])&&(this[_0xd8e9('0x14')][util[_0xd8e9('0x6a')](_0xd8e9('0xff'),_0x2ab08f[_0xd8e9('0x2d')])][_0xd8e9('0x52')]==='reachable'||this['trunks'][util['format'](_0xd8e9('0xff'),_0x2ab08f[_0xd8e9('0x2d')])]['status']===_0xd8e9('0x100'));};Preview[_0xd8e9('0xe')]['run']=function(_0x2ba692,_0x16c1eb){return this[_0xd8e9('0x101')](_0x2ba692,_0x16c1eb)[_0xd8e9('0x5f')](function(_0x1d9a29){return _[_0xd8e9('0x102')](_0x1d9a29,[_0xd8e9('0x34')]);})[_0xd8e9('0x54')](function(_0x448891){if(_0x448891[_0xd8e9('0x103')]){rpcDb[_0xd8e9('0x104')](_0x2ba692);}if(_0x448891[_0xd8e9('0xfe')]){rpcDb['disableContact'](_0x2ba692);}throw _['pick'](_0x448891,[_0xd8e9('0x34')]);});};Preview[_0xd8e9('0xe')][_0xd8e9('0x101')]=function(_0x254169,_0x3d5479){var _0x487f8f=this;var _0x1b0ae7,_0xca46fe;return rpcDb[_0xd8e9('0x105')](_0x254169)[_0xd8e9('0x5f')](function(_0x2b6d48){if(!_[_0xd8e9('0x47')](_0x2b6d48[0x0])){_0xca46fe=_0x2b6d48[0x0][_0xd8e9('0x106')]?![]:!![];_0x1b0ae7=_0x2b6d48[0x0][_0xd8e9('0x106')]?!![]:![];_0x1b0ae7=_0x3d5479?!![]:_0x1b0ae7;}var _0x5b87e2=_0x487f8f[_0xd8e9('0x107')](_0x2b6d48);if(_0x5b87e2[_0xd8e9('0x108')]){rpcDb['checkIsBlackList'](_[_0xd8e9('0x102')](_0x2b6d48[0x0],[_0xd8e9('0x4f'),_0xd8e9('0x109')]))[_0xd8e9('0x5f')](function(_0x1fb72f){_0x487f8f[_0xd8e9('0x10a')](_0x1fb72f,_0x2b6d48[0x0],_0x3d5479,_0xca46fe,_0x1b0ae7)[_0xd8e9('0x5f')](function(_0x42aa22){return _0x42aa22;})[_0xd8e9('0x54')](function(_0x281996){throw _0x281996;});})['catch'](function(_0x294b39){ut[_0xd8e9('0x37')](_0xd8e9('0x10b'),_0x294b39);throw ut[_0xd8e9('0x34')](_0xd8e9('0x10c'),_0xca46fe,_0x1b0ae7);});}else{throw ut[_0xd8e9('0x34')](_0x5b87e2[_0xd8e9('0x34')],_0xca46fe,_0x1b0ae7);}})[_0xd8e9('0x54')](function(_0x1ec683){ut[_0xd8e9('0x37')](_0xd8e9('0x10d'),_0x1ec683);throw ut[_0xd8e9('0x34')](_0xd8e9('0x10c'),![],!![]);});};Preview['prototype']['validateContact']=function(_0x4041c3){if(_[_0xd8e9('0x47')](_0x4041c3)||_[_0xd8e9('0xf0')](_0x4041c3)||!_[_0xd8e9('0x47')](_0x4041c3[0x0][_0xd8e9('0x63')])&&_[_0xd8e9('0x47')](_0x4041c3[0x0][_0xd8e9('0x63')][_0xd8e9('0x2d')])){ut[_0xd8e9('0x37')]('[Preview][validateContact][Empty\x20Contact]',_0x4041c3);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x55546e=this[_0xd8e9('0x12')][_0x4041c3[0x0][_0xd8e9('0xee')][_0xd8e9('0x2d')]];_0x55546e[_0xd8e9('0x34')]=utils[_0xd8e9('0x35')][_0xd8e9('0x80')];if(_[_0xd8e9('0x47')](_0x55546e)){ut[_0xd8e9('0x37')](_0xd8e9('0x10e'),_0x55546e);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xd8e9('0x7c')](_0x55546e[_0xd8e9('0x7d')])){ut[_0xd8e9('0x37')](_0xd8e9('0x10f'),_0xd8e9('0x110')+_0x55546e[_0xd8e9('0x2d')]+_0xd8e9('0x111'));if(!this[_0xd8e9('0x7c')](_0x55546e['TrunkBackup'])){ut['logger'](_0xd8e9('0x10f'),_0x55546e['name']+_0xd8e9('0x112'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x55546e[_0xd8e9('0x43')])){ut[_0xd8e9('0x37')](_0xd8e9('0x113'),_0x55546e[_0xd8e9('0x2d')]+_0xd8e9('0x114'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x55546e['name']+_0xd8e9('0x114')};}return{'isValid':!![],'message':_0xd8e9('0x115')};};Preview[_0xd8e9('0xe')][_0xd8e9('0xf1')]=function(_0x59cc89,_0x5461b3,_0x159479,_0x39b6da){var _0x2fa3e7=this;return new Promise(function(_0x2f0dc9,_0x3adb59){var _0x483400=_0x59cc89[_0xd8e9('0xa0')];var _0x4dfbbd=_0x2fa3e7[_0xd8e9('0x7c')](_0x5461b3[_0xd8e9('0x7d')])?util[_0xd8e9('0x6a')](_0xd8e9('0x116'),_0x5461b3['Trunk'][_0xd8e9('0x2d')],_[_0xd8e9('0x47')](_0x5461b3[_0xd8e9('0x117')])?'':_0x5461b3[_0xd8e9('0x117')][_0xd8e9('0x118')]()||'',_0x5461b3[_0xd8e9('0x119')]>0x0?_0x159479[_0xd8e9('0x109')]['substring'](_0x5461b3['dialCutDigit']):_0x159479[_0xd8e9('0x109')]):util['format'](_0xd8e9('0x116'),_[_0xd8e9('0x47')](_0x5461b3['TrunkBackup'])?_0x5461b3[_0xd8e9('0x7d')][_0xd8e9('0x2d')]:_0x5461b3[_0xd8e9('0x7e')]['name'],_[_0xd8e9('0x47')](_0x5461b3[_0xd8e9('0x117')])?'':_0x5461b3['dialPrefix']['trim']()||'',_0x5461b3['dialCutDigit']>0x0?_0x159479[_0xd8e9('0x109')]['substring'](_0x5461b3['dialCutDigit']):_0x159479[_0xd8e9('0x109')]);var _0x3b64cc=_0x2fa3e7[_0xd8e9('0x7c')](_0x5461b3['Trunk'])?ut['getCallerId'](_0x5461b3[_0xd8e9('0x7d')][_0xd8e9('0x11a')],_0x5461b3[_0xd8e9('0x11b')],_0x5461b3['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd8e9('0x11c')](_0x5461b3[_0xd8e9('0x11d')],_0x5461b3[_0xd8e9('0x11e')]):_0x5461b3[_0xd8e9('0x11d')]):ut[_0xd8e9('0x11f')](_['isNil'](_0x5461b3[_0xd8e9('0x7e')])?_0x5461b3[_0xd8e9('0x7d')][_0xd8e9('0x11a')]:_0x5461b3[_0xd8e9('0x7e')][_0xd8e9('0x11a')],_0x5461b3[_0xd8e9('0x11b')],_0x5461b3['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd8e9('0x11c')](_0x5461b3[_0xd8e9('0x11d')],_0x5461b3[_0xd8e9('0x11e')]):_0x5461b3['dialOriginateCallerIdNumber']);if(_0x3b64cc){_0x59cc89[_0xd8e9('0x120')]=ut[_0xd8e9('0x121')](_0x3b64cc);_0x59cc89['originatecalleridnum']=ut[_0xd8e9('0x122')](_0x3b64cc);}var _0x1ca0a4=ut[_0xd8e9('0x123')](_0x5461b3,_0x159479,_0x4dfbbd,_0x3b64cc,_0x483400,_0x59cc89);var _0x5f4b3e=utils['setXMDContactVariables'](_0x159479[_0xd8e9('0xed')]);Object['assign'](_0x1ca0a4,_0x5f4b3e);_['merge'](_0x59cc89,ut[_0xd8e9('0x124')](_0x1ca0a4));_0x59cc89[_0xd8e9('0x69')]=moment()[_0xd8e9('0x6a')](_0xd8e9('0x6b'));_0x5461b3[_0xd8e9('0x125')]=_0x1ca0a4;var _0x41f4b4=ut[_0xd8e9('0x126')](_0x59cc89,_0x5461b3,_0x1ca0a4,_0x59cc89[_0xd8e9('0xb4')],_0x39b6da);return ami[_0xd8e9('0x51')](_0x41f4b4)[_0xd8e9('0x5f')](function(_0x52dfd7){_0x5461b3[_0xd8e9('0x31')]+=0x1;logger['info']('[originated][increment]',_0x483400,_0xd8e9('0x93'),_0x5461b3['name'],'originated:\x20',_0x5461b3['originated']);_0x2f0dc9(_0x52dfd7);})[_0xd8e9('0x54')](function(_0x37d4a6){ut[_0xd8e9('0xe1')](_0x59cc89,0xe,_0xd8e9('0x127'));rpcDb[_0xd8e9('0xe2')](_0x59cc89,_0xd8e9('0x128'));_0x3adb59(_0x37d4a6);});});};Preview['prototype'][_0xd8e9('0x20')]=function(_0x57448b){if(this[_0xd8e9('0x15')][_0x57448b[_0xd8e9('0x8d')]]){this['actions'][_0x57448b[_0xd8e9('0x8d')]][_0xd8e9('0x53')]=_0x57448b['channel'];}};Preview[_0xd8e9('0xe')]['syncOriginateResponse']=function(_0x444654){var _0x35b998=this;var _0x4aebb0=this[_0xd8e9('0x15')][_0x444654[_0xd8e9('0x129')]];if(_0x4aebb0){if(_0x4aebb0[_0xd8e9('0xef')]&&this[_0xd8e9('0x16')][_0x4aebb0[_0xd8e9('0xef')]]){ut[_0xd8e9('0x12a')](_0x4aebb0,this[_0xd8e9('0x16')][_0x4aebb0[_0xd8e9('0xef')]][_0xd8e9('0x2d')],this['agents'][_0x4aebb0[_0xd8e9('0xef')]]['id']);}var _0x24fa5d=_[_0xd8e9('0x12b')](_0x4aebb0);_0x24fa5d[_0xd8e9('0x12c')]=moment()[_0xd8e9('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x33baf9=_0x35b998['campaignsPreview'][_0x4aebb0[_0xd8e9('0x49')]];if(ut[_0xd8e9('0x12d')](_0x444654[_0xd8e9('0x12e')])){if(_0x4aebb0[_0xd8e9('0xad')]){rpcDb['unlockContact'](_0x4aebb0['idContact']);}if(_0x4aebb0[_0xd8e9('0xb4')]){rpcDb[_0xd8e9('0x68')](_0x4aebb0[_0xd8e9('0x90')]);}ami[_0xd8e9('0x28')](_0xd8e9('0x12f'),ut[_0xd8e9('0x95')](_0x4aebb0,'rejected',this[_0xd8e9('0x12')][_0x4aebb0[_0xd8e9('0x49')]]));this[_0xd8e9('0x130')](_0x24fa5d,_0x33baf9,_0x444654);}else{_0x4aebb0[_0xd8e9('0x69')]=moment()[_0xd8e9('0x6a')](_0xd8e9('0x6b'));ut[_0xd8e9('0xe1')](_0x24fa5d,0x4,_0xd8e9('0x9a'));rpcDb[_0xd8e9('0xe2')](_0x24fa5d,_0xd8e9('0x131'));}}};Preview[_0xd8e9('0xe')][_0xd8e9('0x1c')]=function(_0x4a3df3){var _0x98c256=this[_0xd8e9('0x15')][_0x4a3df3[_0xd8e9('0x8d')]];var _0x312402;if(_0x98c256){_0x312402=this['campaignsPreview'][_0x98c256[_0xd8e9('0x49')]];logger[_0xd8e9('0x29')](_0xd8e9('0x132'),_0x4a3df3['linkedid'],'\x20Queue',_0x312402[_0xd8e9('0x2d')],_0xd8e9('0x4a'),_0x312402[_0xd8e9('0x4b')]);}if(this[_0xd8e9('0x15')][_0x4a3df3[_0xd8e9('0x8d')]]&&_0x4a3df3[_0xd8e9('0x8d')]!==_0x4a3df3[_0xd8e9('0xa0')]){if(_0x4a3df3[_0xd8e9('0x133')]==='16'&&this[_0xd8e9('0x15')][_0x4a3df3[_0xd8e9('0x8d')]][_0xd8e9('0x4c')]){this[_0xd8e9('0x81')](_0x4a3df3,_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3['cause']);}else if(this[_0xd8e9('0x15')][_0x4a3df3['linkedid']][_0xd8e9('0x4c')]){logger[_0xd8e9('0x29')](_0xd8e9('0x134'),_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3[_0xd8e9('0x133')],_0xd8e9('0x93'),_0x312402[_0xd8e9('0x2d')],_0xd8e9('0x4a'),_0x312402[_0xd8e9('0x4b')]);this[_0xd8e9('0x81')](_0x4a3df3,_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3['cause']);}}else if(_0x98c256&&_[_0xd8e9('0x47')](_0x98c256[_0xd8e9('0x135')])&&_0x312402[_0xd8e9('0x136')]&&_0x4a3df3[_0xd8e9('0x8d')]===_0x4a3df3['uniqueid']&&_[_0xd8e9('0x47')](_0x4a3df3[_0xd8e9('0xe0')])&&_0x4a3df3[_0xd8e9('0x133')]==='16'&&_0x4a3df3['channelstate']==='6'&&_[_0xd8e9('0xde')](_0x98c256[_0xd8e9('0x137')])){if(_0x98c256[_0xd8e9('0xad')]){rpcDb[_0xd8e9('0x104')](_0x98c256[_0xd8e9('0x90')]);}if(_0x98c256['activeContact']){rpcDb[_0xd8e9('0x68')](_0x98c256[_0xd8e9('0x90')]);}_0x4a3df3[_0xd8e9('0xe0')]='22';this[_0xd8e9('0x130')](_0x98c256,_0x312402,_0x4a3df3);}else if(_0x98c256&&_0x98c256['transfer']){if(_0x4a3df3[_0xd8e9('0x133')]==='16'&&this['actions'][_0x4a3df3['linkedid']][_0xd8e9('0x4c')]){logger[_0xd8e9('0x29')]('[syncHangup][talking][transfer]',_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3['cause'],_0xd8e9('0x93'),_0x312402['name'],_0xd8e9('0x4a'),_0x312402[_0xd8e9('0x4b')]);this[_0xd8e9('0x81')](_0x4a3df3,_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3[_0xd8e9('0x133')]);}else if(this[_0xd8e9('0x15')][_0x4a3df3[_0xd8e9('0x8d')]][_0xd8e9('0x4c')]){logger['info']('[syncHangup][talking][cause]',_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3[_0xd8e9('0x133')],'\x20Queue',_0x312402[_0xd8e9('0x2d')],_0xd8e9('0x4a'),_0x312402[_0xd8e9('0x4b')]);this[_0xd8e9('0x81')](_0x4a3df3,_0x4a3df3[_0xd8e9('0x8d')],_0x4a3df3[_0xd8e9('0x133')]);}}};Preview[_0xd8e9('0xe')][_0xd8e9('0x1f')]=function(_0x3536dc){if(this['actions'][_0x3536dc['destlinkedid']]&&_0x3536dc['destlinkedid']!==_0x3536dc['destuniqueid']){this[_0xd8e9('0x81')](_0x3536dc,_0x3536dc[_0xd8e9('0x138')],_0x3536dc['dialstatus']);}};Preview[_0xd8e9('0xe')][_0xd8e9('0x1d')]=function(_0x300b8e){if(this[_0xd8e9('0x15')][_0x300b8e[_0xd8e9('0x8d')]]&&_0x300b8e['linkedid']!==_0x300b8e[_0xd8e9('0xa0')]&&!this[_0xd8e9('0x15')][_0x300b8e[_0xd8e9('0x8d')]][_0xd8e9('0x4c')]){if(_0x300b8e[_0xd8e9('0x133')]==='1'){this[_0xd8e9('0x81')](_0x300b8e,_0x300b8e[_0xd8e9('0x8d')],_0x300b8e[_0xd8e9('0x133')]);}}};Preview[_0xd8e9('0xe')]['addVariable']=function(_0x2e0699,_0x96ac89,_0x42afc9){if(this[_0xd8e9('0x15')][_0x2e0699]){if(_[_0xd8e9('0x47')](this[_0xd8e9('0x15')][_0x2e0699][_0xd8e9('0x125')])){this[_0xd8e9('0x15')][_0x2e0699][_0xd8e9('0x125')]={};}this[_0xd8e9('0x15')][_0x2e0699][_0xd8e9('0x125')][_0x96ac89]=_0x42afc9;}};Preview[_0xd8e9('0xe')]['syncVarSet']=function(_0x528b41){try{if(!_[_0xd8e9('0x47')](_0x528b41)){if(ut[_0xd8e9('0x139')](_['keys'](_0x528b41['variable'])[0x0])){this['addVariable'](_0x528b41[_0xd8e9('0xa0')],_[_0xd8e9('0x13a')](_0x528b41[_0xd8e9('0x13b')])[0x0],_0x528b41[_0xd8e9('0x13c')]);}}}catch(_0x1402d3){logger[_0xd8e9('0x13d')](_0xd8e9('0x13e'),util['inspect'](_0x1402d3,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd8e9('0x24')]=function(_0x11ffbe){if(_0x11ffbe){if(this[_0xd8e9('0x15')][_0x11ffbe['transfertargetlinkedid']]){this[_0xd8e9('0x15')][_0x11ffbe[_0xd8e9('0x13f')]][_0xd8e9('0x137')]=!![];}}};Preview[_0xd8e9('0xe')][_0xd8e9('0x26')]=function(_0x25f602){if(_0x25f602){if(this[_0xd8e9('0x15')][_0x25f602['transfererlinkedid']]){this[_0xd8e9('0x15')][_0x25f602[_0xd8e9('0x140')]][_0xd8e9('0x137')]=!![];}}};module[_0xd8e9('0x141')]=Preview; \ No newline at end of file +var _0x993d=['keys','addVariable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','ioredis','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','info','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','available','paused','message','CAMPAIGN_STATUS','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','clockClearZombieChannels','hasOwnProperty','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','Queue','queue','originated:\x20','pTalking:\x20','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','isActive','INACTIVE','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','cloneAction','countnosuchnumberretry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','queueSummaryCountersUpdated','isUndefined','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','phone','substring','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','setXMDContactVariables','assign','merge','toLowerVariables','variablesAction','OriginateError','syncNewExten','actionid','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','destuniqueid','variables','syncVarSet','filterKey'];(function(_0x87d10c,_0x41644d){var _0x8bbbbe=function(_0x8646c8){while(--_0x8646c8){_0x87d10c['push'](_0x87d10c['shift']());}};_0x8bbbbe(++_0x41644d);}(_0x993d,0x151));var _0xd993=function(_0x1d11b3,_0xc42c6){_0x1d11b3=_0x1d11b3-0x0;var _0x211f54=_0x993d[_0x1d11b3];return _0x211f54;};'use strict';var util=require(_0xd993('0x0'));var _=require(_0xd993('0x1'));var uuid=require(_0xd993('0x2'));var moment=require(_0xd993('0x3'));var Redis=require(_0xd993('0x4'));var config=require('../../../config/environment');var logger=require(_0xd993('0x5'))(_0xd993('0x6'));var loggerAction=require(_0xd993('0x5'))('actionPreview');var ami=require(_0xd993('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xd993('0x8'));var Action=require(_0xd993('0x9'));var ut=require(_0xd993('0xa'));var utils=require(_0xd993('0xb'));config[_0xd993('0xc')]=_['defaults'](config['redis'],{'host':_0xd993('0xd'),'port':0x18eb});var io=require(_0xd993('0xe'))(new Redis(config[_0xd993('0xc')]));var Sequence=function(){};Sequence[_0xd993('0xf')][_0xd993('0x10')]=function(_0x6057bf){this[_0xd993('0x11')]=this['tail']?this[_0xd993('0x11')][_0xd993('0x12')](_0x6057bf):_0x6057bf();};function Preview(_0x3eca6b){this[_0xd993('0x13')]=new Sequence();this[_0xd993('0x14')]=_0x3eca6b[_0xd993('0x15')];this[_0xd993('0x16')]=_0x3eca6b['trunks'];this[_0xd993('0x17')]={};this['agents']=_0x3eca6b[_0xd993('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0xd993('0x19'),this[_0xd993('0x1a')][_0xd993('0x1b')](this));ami['on'](_0xd993('0x1c'),this[_0xd993('0x1d')]['bind'](this));ami['on'](_0xd993('0x1e'),this[_0xd993('0x1f')][_0xd993('0x1b')](this));ami['on'](_0xd993('0x20'),this[_0xd993('0x21')][_0xd993('0x1b')](this));ami['on']('newexten',this['syncNewExten'][_0xd993('0x1b')](this));ami['on'](_0xd993('0x22'),this['syncVarSet'][_0xd993('0x1b')](this));ami['on'](_0xd993('0x23'),this[_0xd993('0x24')][_0xd993('0x1b')](this));ami['on']('blindtransfer',this[_0xd993('0x25')][_0xd993('0x1b')](this));this[_0xd993('0x26')](this[_0xd993('0x14')]);}function emit(_0x14c7b1,_0x4f30db,_0x380957){io['to'](_0x14c7b1)[_0xd993('0x27')](_0x4f30db,_0x380957);}function emitVoiceQueueChannelRemove(_0x546714){logger[_0xd993('0x28')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd993('0x29')](_0x546714));emit(util[_0xd993('0x2a')](_0xd993('0x2b'),_0x546714[_0xd993('0x2c')]),_0xd993('0x2d'),_0x546714);io[_0xd993('0x27')](_0xd993('0x2e'),_0x546714);}function notSendMessagesQueue(_0x2c49ab){if(_0x2c49ab['sendMessageOneNotActive']){if(_0x2c49ab[_0xd993('0x2f')]===0x0&&_0x2c49ab[_0xd993('0x30')]===0x0){_0x2c49ab[_0xd993('0x31')]=![];_0x2c49ab[_0xd993('0x32')]=0x0;_0x2c49ab[_0xd993('0x33')]=0x0;_0x2c49ab[_0xd993('0x34')]=utils[_0xd993('0x35')]['INACTIVE'];ut[_0xd993('0x36')](_0xd993('0x37'),_0x2c49ab[_0xd993('0x2c')]+_0xd993('0x38'));}else{_0x2c49ab[_0xd993('0x34')]=utils[_0xd993('0x35')][_0xd993('0x39')];ut[_0xd993('0x36')](_0xd993('0x37'),_0x2c49ab[_0xd993('0x2c')]+_0xd993('0x3a'));}}}Preview[_0xd993('0xf')][_0xd993('0x26')]=function(){var _0x2efb39=this;setInterval(function(){_0x2efb39['syncCampaigns']();},0x7cf);};Preview[_0xd993('0xf')]['syncCampaigns']=function(){var _0x447018=this['campaignsPreview'];this[_0xd993('0x3b')]+=0x1;for(var _0x51f50a in _0x447018){if(_0x447018[_0xd993('0x3c')](_0x51f50a)&&(_0x447018[_0x51f50a]['dialMethod']===_0xd993('0x6')||_0x447018[_0x51f50a]['dialMethod']===_0xd993('0x3d'))&&_0x447018[_0x51f50a][_0xd993('0x3e')]===_0xd993('0x3f')){if(this[_0xd993('0x3b')]>0x7){this[_0xd993('0x3b')]=0x0;this[_0xd993('0x40')]();}}if(_0x447018['hasOwnProperty'](_0x51f50a)&&_0x447018[_0x51f50a]['dialMethod']===_0xd993('0x6')&&_0x447018[_0x51f50a]['type']===_0xd993('0x3f')){if(_0x447018[_0x51f50a][_0xd993('0x41')]){this[_0xd993('0x42')](_0x447018[_0x51f50a]);if(_0x447018[_0x51f50a][_0xd993('0x43')])this[_0xd993('0x44')](_0x447018[_0x51f50a]);}else{notSendMessagesQueue(_0x447018[_0x51f50a]);}}}};Preview[_0xd993('0xf')]['clearZombieChannel']=function(_0x1483b5){var _0x371368=this;this['sequence'][_0xd993('0x10')](function(){if(!_[_0xd993('0x45')](_0x371368[_0xd993('0x17')][_0x1483b5])){loggerAction['info']('[clearZombieChannels][talking]',_0x1483b5,_0xd993('0x46'),_0x371368['actions'][_0x1483b5][_0xd993('0x47')],_0xd993('0x48'),JSON[_0xd993('0x29')](_0x371368[_0xd993('0x14')][_0x371368[_0xd993('0x17')][_0x1483b5][_0xd993('0x47')]][_0xd993('0x2f')]),_0xd993('0x49'),JSON[_0xd993('0x29')](_0x371368['campaignsPreview'][_0x371368[_0xd993('0x17')][_0x1483b5][_0xd993('0x47')]]['pTalking']),JSON[_0xd993('0x29')](_0x371368[_0xd993('0x17')][_0x1483b5]['dialAnswer']),JSON[_0xd993('0x29')](_[_0xd993('0x4a')](_0x371368[_0xd993('0x17')][_0x1483b5],['contactId',_0xd993('0x4b'),_0xd993('0x4c'),_0xd993('0x4d')])));return ami[_0xd993('0x4e')]({'action':_0xd993('0x4f'),'channel':_0x371368['actions'][_0x1483b5][_0xd993('0x50')]})[_0xd993('0x51')](function(_0x4e23a8){if(_0x4e23a8['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x371368['actions'][_0x1483b5]){ut[_0xd993('0x52')](_0x371368[_0xd993('0x14')][_0x371368[_0xd993('0x17')][_0x1483b5][_0xd993('0x47')]],_0xd993('0x53'));if(_0x371368['actions'][_0x1483b5][_0xd993('0x54')]===!![]){ut[_0xd993('0x55')](_0x371368['campaignsPreview'][_0x371368[_0xd993('0x17')][_0x1483b5]['queue']],_0xd993('0x53'));ut[_0xd993('0x56')](_0xd993('0x57')+_0x1483b5,_0x371368[_0xd993('0x17')][_0x1483b5]['queue']);}ut[_0xd993('0x56')](_0xd993('0x58')+_0x1483b5,_0x371368[_0xd993('0x17')][_0x1483b5][_0xd993('0x47')]);delete _0x371368[_0xd993('0x17')][_0x1483b5];}},0x2328);}});}});};Preview['prototype'][_0xd993('0x40')]=function(){var _0x307627=this;loggerAction['info']('[action]',_[_0xd993('0x59')](this[_0xd993('0x17')]));for(var _0x5a34cc in this['actions']){if(_0x307627[_0xd993('0x17')][_0xd993('0x3c')](_0x5a34cc)){_0x307627['clearZombieChannel'](_0x5a34cc);}}};Preview['prototype'][_0xd993('0x44')]=function(_0x3f018d){var _0x54dc95=this;rpcDb[_0xd993('0x5a')](_0x3f018d['id'],ut[_0xd993('0x5b')](this['agents']))[_0xd993('0x5c')](function(_0x16b8e5){if(!_[_0xd993('0x45')](_0x16b8e5)){for(var _0x33e81d=0x0;_0x33e81d<_0x16b8e5[_0xd993('0x5d')];_0x33e81d+=0x1){if(ut['getDiff'](_0x16b8e5[_0x33e81d][_0xd993('0x5e')])<_0x3f018d[_0xd993('0x5f')]*0x3c){if(_0x16b8e5[_0x33e81d][_0xd993('0x60')]&&!_0x16b8e5[_0x33e81d][_0xd993('0x60')][_0xd993('0x61')]){_0x54dc95[_0xd993('0x62')](_0x16b8e5[_0x33e81d]['id'])[_0xd993('0x5c')](ut[_0xd993('0x63')](_0xd993('0x64')))[_0xd993('0x51')](ut[_0xd993('0x63')](_0xd993('0x64')));}else{rpcDb[_0xd993('0x65')](_0x16b8e5[_0x33e81d]['id']);}}else{var _0x1fcc54=new Action(_0x16b8e5[_0x33e81d],_0x3f018d);_0x1fcc54[_0xd993('0x66')]=moment()[_0xd993('0x2a')](_0xd993('0x67'));_0x3f018d['outboundReCallsDay']+=0x1;ut[_0xd993('0x68')](_0x1fcc54,0x17,_0xd993('0x69'));if(_0x3f018d[_0xd993('0x6a')]){rpcDb[_0xd993('0x6b')](ut[_0xd993('0x6c')](_0x16b8e5[_0x33e81d]));rpcDb[_0xd993('0x6d')](_0x1fcc54,_0xd993('0x6e'));}else{ut['logCustomer'](_0x1fcc54,0x16,_0xd993('0x6f'));rpcDb['createCustomerHistory'](_0x1fcc54,'[HistoryRecallClose]');rpcDb[_0xd993('0x70')](_0x1fcc54,'[HistoryRecallClose]');}}}}})[_0xd993('0x51')](ut[_0xd993('0x63')]('[getContactRecallMe]'));};Preview['prototype'][_0xd993('0x42')]=function(_0x3a00ba){_0x3a00ba[_0xd993('0x31')]=!![];if(ut['IsNotLoggedIn'](_0x3a00ba['loggedIn'])){_0x3a00ba[_0xd993('0x34')]=utils[_0xd993('0x35')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xd993('0x71')](_0x3a00ba[_0xd993('0x41')])){_0x3a00ba['message']=utils['CAMPAIGN_STATUS'][_0xd993('0x72')];}else if(!this[_0xd993('0x73')](_0x3a00ba[_0xd993('0x74')])){if(!this[_0xd993('0x73')](_0x3a00ba[_0xd993('0x75')])){_0x3a00ba[_0xd993('0x34')]=utils['CAMPAIGN_STATUS'][_0xd993('0x76')];}else{_0x3a00ba['message']=utils[_0xd993('0x35')][_0xd993('0x77')];}}else{_0x3a00ba[_0xd993('0x34')]=utils[_0xd993('0x35')]['ACTIVE'];}};Preview['prototype'][_0xd993('0x78')]=function(_0x3c7957,_0x379a7a,_0x9cd083){var _0x5d407d=this;var _0x25e3d1=this[_0xd993('0x17')][_0x379a7a];var _0x48b5cb=this['campaignsPreview'][_0x25e3d1[_0xd993('0x47')]];var _0x1ba633;var _0x41efa5=![];var _0x2fe5ea=0x2;var _0x1dd178=0x3;if(_0x48b5cb){switch(_0x9cd083){case'1':_0x48b5cb[_0xd993('0x79')]+=0x1;_0x25e3d1['countnosuchnumberretry']+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut['totalGlobal'](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x0,_0xd993('0x7b'));ami[_0xd993('0x27')](_0xd993('0x7c'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0x7e')));rpcDb[_0xd993('0x6d')](_0x25e3d1,'[callProgressDetectingCustomer][logNoSuch]');_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'0',_0x48b5cb)[_0xd993('0x5c')](function(_0x33b9a5){_0x41efa5=_0x33b9a5[_0xd993('0x80')]==0x1;_0x2fe5ea=_0x48b5cb[_0xd993('0x81')];_0x1dd178=_0x48b5cb[_0xd993('0x82')];if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb['dialGlobalMaxRetry']){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,'Global');rpcDb[_0xd993('0x70')](_0x1ba633,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x25e3d1[_0xd993('0x85')]>=_0x48b5cb[_0xd993('0x86')]){rpcDb[_0xd993('0x70')](_0x25e3d1,_0xd993('0x87'));}else{rpcDb[_0xd993('0x88')](ut['scheduledAt'](_0x25e3d1,'countnosuchnumberretry',_0x48b5cb[_0xd993('0x81')]),_0x25e3d1['unlockAgent'],_0x25e3d1[_0xd993('0x89')]);}}delete this[_0xd993('0x17')][_0x3c7957[_0xd993('0x8a')]];}else{_0x25e3d1[_0xd993('0x85')]++;logger['info'](_0xd993('0x8b'),_0x25e3d1[_0xd993('0x85')]);logger[_0xd993('0x28')]('id',_0x25e3d1[_0xd993('0x8c')]);_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnosuchnumberretry':_0x25e3d1[_0xd993('0x85')]}})[_0xd993('0x5c')](function(){_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)['then'](function(){});});}});break;case'ANSWER':var _0x1020f8=moment()[_0xd993('0x2a')](_0xd993('0x67'));_0x25e3d1[_0xd993('0x8f')]=_0x1020f8;_0x25e3d1[_0xd993('0x90')]=_0x1020f8;_0x25e3d1['dialAnswer']=!![];_0x48b5cb['pTalking']+=0x1;logger[_0xd993('0x28')](_0xd993('0x91'),_0x25e3d1[_0xd993('0x92')],_0xd993('0x93'),_0x48b5cb['name'],'pTalking:\x20',_0x48b5cb[_0xd993('0x30')]);ami[_0xd993('0x27')](_0xd993('0x94'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0x95'),this[_0xd993('0x14')][_0x25e3d1['queue']]));if(_0x48b5cb[_0xd993('0x96')]){ami[_0xd993('0x27')](_0xd993('0x97'),ut[_0xd993('0x98')](_0x25e3d1));}break;case'16':ami['emit'](_0xd993('0x99'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0x9a'),this[_0xd993('0x14')][_0x25e3d1[_0xd993('0x47')]]));emitVoiceQueueChannelRemove(ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0x9a')));_0x48b5cb[_0xd993('0x9b')]+=0x1;_0x48b5cb[_0xd993('0x9c')]+=0x1;_0x48b5cb['answered']+=0x1;ut['decrementTalkink'](_0x48b5cb,_0xd993('0x9d'));_0x25e3d1['countglobal']=ut[_0xd993('0x83')](_0x25e3d1);ut['logCustomer'](_0x25e3d1,0x4,_0xd993('0x9e'));rpcDb['createCustomerHistory'](_0x25e3d1,_0xd993('0x9f'));rpcDb['createCustomerFinal'](_0x25e3d1,_0xd993('0xa0'));rpcDb[_0xd993('0xa1')](_0x25e3d1);_0x48b5cb[_0xd993('0xa2')]+=_0x25e3d1[_0xd993('0xa3')];_0x48b5cb['sumBillable']+=_0x25e3d1[_0xd993('0xa3')];logger['info'](_0xd993('0xa4'),_0x25e3d1[_0xd993('0x92')],_0xd993('0x93'),_0x48b5cb[_0xd993('0x2c')],_0xd993('0x49'),_0x48b5cb['pTalking']);delete this[_0xd993('0x17')][_0x3c7957[_0xd993('0x8a')]];break;case _0xd993('0xa5'):_0x48b5cb[_0xd993('0xa6')]+=0x1;_0x25e3d1[_0xd993('0xa7')]+=0x1;_0x25e3d1['countglobal']=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x5,_0xd993('0xa8'));_0x2fe5ea=_0x48b5cb['dialBusyRetryFrequency'];_0x1dd178=_0x48b5cb[_0xd993('0x82')];ami[_0xd993('0x27')](_0xd993('0xa9'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0xaa')));rpcDb['createCustomerHistory'](_0x25e3d1,_0xd993('0xab'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'5',_0x48b5cb)[_0xd993('0x5c')](function(_0x4c1840){_0x41efa5=_0x4c1840[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb['dialGlobalMaxRetry']){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,_0xd993('0xac'));rpcDb[_0xd993('0x70')](_0x1ba633,_0xd993('0xad'));}else{if(_0x25e3d1[_0xd993('0xa7')]>=_0x48b5cb[_0xd993('0xae')]){rpcDb[_0xd993('0x70')](_0x25e3d1,_0xd993('0xab'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x25e3d1,_0xd993('0xa7'),_0x48b5cb['dialBusyRetryFrequency']),_0x25e3d1[_0xd993('0xaf')],_0x25e3d1[_0xd993('0x89')]);}}}else{_0x25e3d1[_0xd993('0xa7')]++;_0x5d407d['incrementPreviewCounters']({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countbusyretry':_0x25e3d1['countbusyretry']}})['then'](function(){_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});break;case _0xd993('0xb0'):_0x48b5cb[_0xd993('0xb1')]+=0x1;_0x25e3d1[_0xd993('0xb2')]+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x3,_0xd993('0xb3'));_0x2fe5ea=_0x48b5cb['dialNoAnswerRetryFrequency'];_0x1dd178=_0x48b5cb[_0xd993('0x82')];var _0x1046ed=ut[_0xd993('0xb4')](_0x25e3d1,_0x48b5cb);ami[_0xd993('0x27')](_0xd993('0xb5'),_0x1046ed);rpcDb[_0xd993('0x6d')](_0x25e3d1,_0xd993('0xb6'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'3',_0x48b5cb)[_0xd993('0x5c')](function(_0x4f63ce){_0x41efa5=_0x4f63ce[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb[_0xd993('0xb7')]){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,_0xd993('0xac'));rpcDb['createCustomerFinal'](_0x1ba633,_0xd993('0xb8'));}else{if(_0x25e3d1[_0xd993('0xb2')]>=_0x48b5cb[_0xd993('0xb9')]){rpcDb[_0xd993('0x70')](_0x25e3d1,_0xd993('0xb6'));}else{rpcDb[_0xd993('0x88')](ut[_0xd993('0xba')](_0x25e3d1,_0xd993('0xb2'),_0x48b5cb[_0xd993('0xbb')]),_0x25e3d1['unlockAgent'],_0x25e3d1[_0xd993('0x89')]);}}}else{_0x25e3d1['countnoanswerretry']++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnoanswerretry':_0x25e3d1[_0xd993('0xb2')]}})[_0xd993('0x5c')](function(){_0x5d407d['swapAdditionalPhones'](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});break;case'CONGESTION':_0x48b5cb['outboundCongestionCallsDay']+=0x1;_0x25e3d1[_0xd993('0xbc')]+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut[_0xd993('0x83')](_0x25e3d1);ut['logCustomer'](_0x25e3d1,0x8,_0xd993('0xbd'));_0x2fe5ea=_0x48b5cb['dialCongestionRetryFrequency'];_0x1dd178=_0x48b5cb[_0xd993('0x82')];ami[_0xd993('0x27')](_0xd993('0xbe'),ut[_0xd993('0x7d')](_0x25e3d1,'congestion'));rpcDb['createCustomerHistory'](_0x25e3d1,_0xd993('0xbf'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'8',_0x48b5cb)[_0xd993('0x5c')](function(_0x1208c9){_0x41efa5=_0x1208c9[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb[_0xd993('0xb7')]){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,'Global');rpcDb[_0xd993('0x70')](_0x1ba633,_0xd993('0xc0'));}else{if(_0x25e3d1[_0xd993('0xbc')]>=_0x48b5cb[_0xd993('0xc1')]){rpcDb[_0xd993('0x70')](_0x25e3d1,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd993('0x88')](ut[_0xd993('0xba')](_0x25e3d1,'countcongestionretry',_0x48b5cb[_0xd993('0xc2')]),_0x25e3d1[_0xd993('0xaf')],_0x25e3d1[_0xd993('0x89')]);}}}else{_0x25e3d1['countcongestionretry']++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countcongestionretry':_0x25e3d1['countcongestionretry']}})[_0xd993('0x5c')](function(){_0x5d407d['swapAdditionalPhones'](_0x25e3d1,_0x2fe5ea,_0x1dd178)['then'](function(){});});}});break;case _0xd993('0xc3'):_0x48b5cb[_0xd993('0xc4')]+=0x1;_0x25e3d1['countagentrejectretry']+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x14,_0xd993('0xc5'));_0x2fe5ea=_0x48b5cb[_0xd993('0xc6')];_0x1dd178=_0x48b5cb[_0xd993('0x82')];ami[_0xd993('0x27')](_0xd993('0xc7'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0xc8')));rpcDb['createCustomerHistory'](_0x25e3d1,_0xd993('0xc9'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'20',_0x48b5cb)['then'](function(_0x3c1558){_0x41efa5=_0x3c1558[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb['dialGlobalMaxRetry']){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0x14,_0xd993('0xc5'));rpcDb[_0xd993('0x70')](_0x1ba633,_0xd993('0xca'));}else{if(_0x25e3d1[_0xd993('0xcb')]>=_0x48b5cb[_0xd993('0xcc')]){rpcDb['createCustomerFinal'](_0x25e3d1,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd993('0x88')](ut['scheduledAt'](_0x25e3d1,_0xd993('0xcb'),_0x48b5cb[_0xd993('0xc6')]),_0x25e3d1['unlockAgent'],_0x25e3d1[_0xd993('0x89')]);}}}else{_0x25e3d1['countnoanswerretry']++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnoanswerretry':_0x25e3d1[_0xd993('0xb2')]}})[_0xd993('0x5c')](function(){_0x5d407d['swapAdditionalPhones'](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});break;case _0xd993('0xcd'):_0x48b5cb[_0xd993('0xce')]+=0x1;_0x25e3d1[_0xd993('0xcf')]+=0x1;_0x25e3d1['countglobal']=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0xb,_0xd993('0xd0'));rpcDb[_0xd993('0x6d')](_0x25e3d1,'[callProgressDetectingCustomer][logAbandoned]');_0x5d407d['verifyAdditionalPhones'](_0x25e3d1,'11',_0x48b5cb)[_0xd993('0x5c')](function(_0x191147){_0x41efa5=_0x191147[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut['totalGlobal'](_0x25e3d1)>=_0x48b5cb['dialGlobalMaxRetry']){_0x1ba633=ut['cloneAction'](_0x25e3d1,0xf,_0xd993('0xac'));rpcDb[_0xd993('0x70')](_0x1ba633,_0xd993('0xd1'));}else{if(_0x25e3d1[_0xd993('0xd2')]>=_0x48b5cb[_0xd993('0xd3')]){rpcDb[_0xd993('0x70')](_0x25e3d1,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xd993('0x88')](ut[_0xd993('0xba')](_0x25e3d1,_0xd993('0xcf'),_0x48b5cb['dialAbandonedRetryFrequency']),_0x25e3d1['unlockAgent'],_0x25e3d1[_0xd993('0x89')]);}}}else{_0x25e3d1[_0xd993('0xb2')]++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnoanswerretry':_0x25e3d1[_0xd993('0xb2')]}})['then'](function(){_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});break;case'18':_0x48b5cb[_0xd993('0xd4')]+=0x1;_0x25e3d1[_0xd993('0xd5')]+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x12,_0x3c7957[_0xd993('0xd6')]||_0x3c7957[_0xd993('0xd7')]);ami[_0xd993('0x27')](_0xd993('0xd8'),ut[_0xd993('0x7d')](_0x25e3d1,_0xd993('0xd9')));rpcDb[_0xd993('0x6d')](_0x25e3d1,_0xd993('0xda'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'18',_0x48b5cb)[_0xd993('0x5c')](function(_0x137a4c){_0x41efa5=_0x137a4c[_0xd993('0x80')]==0x1;if(!_0x41efa5){if(ut['totalGlobal'](_0x25e3d1)>=_0x48b5cb[_0xd993('0xb7')]){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0x12,'Global');rpcDb['createCustomerFinal'](_0x1ba633,_0xd993('0xda'));}else{rpcDb[_0xd993('0x70')](_0x25e3d1,_0xd993('0xda'));}}else{_0x25e3d1[_0xd993('0xb2')]++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnoanswerretry':_0x25e3d1[_0xd993('0xb2')]}})[_0xd993('0x5c')](function(){_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});delete this[_0xd993('0x17')][_0x3c7957['linkedid']];break;case'19':_0x48b5cb[_0xd993('0xd4')]+=0x1;_0x25e3d1[_0xd993('0x7a')]=ut['totalGlobal'](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0x13,_0x3c7957[_0xd993('0xd6')]||_0x3c7957[_0xd993('0xd7')]);ami[_0xd993('0x27')]('custom:amd',ut['buildObj'](_0x25e3d1,_0xd993('0xd9')));rpcDb[_0xd993('0x6d')](_0x25e3d1,_0xd993('0xdb'));_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'18',_0x48b5cb)[_0xd993('0x5c')](function(_0x4ef0f7){_0x41efa5=_0x4ef0f7['additional']==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb['dialGlobalMaxRetry']){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,_0xd993('0xac'));rpcDb[_0xd993('0x70')](_0x1ba633,_0xd993('0xdb'));}else{rpcDb['createCustomerFinal'](_0x25e3d1,'[callProgressDetectingCustomer][machine]');}}else{_0x25e3d1[_0xd993('0xb2')]++;_0x5d407d[_0xd993('0x8d')]({'id':_0x25e3d1[_0xd993('0x8c')],'field':{'countnoanswerretry':_0x25e3d1[_0xd993('0xb2')]}})[_0xd993('0x5c')](function(){_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});});}});delete this[_0xd993('0x17')][_0x3c7957[_0xd993('0x8a')]];break;default:if(_0x25e3d1[_0xd993('0x54')]){ut[_0xd993('0x55')](_0x48b5cb,_0xd993('0xdc'));ut[_0xd993('0x56')](_0xd993('0xdd')+_0x48b5cb[_0xd993('0x2c')],_0x3c7957);}_0x48b5cb[_0xd993('0xd4')]+=0x1;_0x25e3d1['countglobal']=ut[_0xd993('0x83')](_0x25e3d1);ut[_0xd993('0x68')](_0x25e3d1,0xc,_0x3c7957['cause-txt']||_0x3c7957[_0xd993('0xd7')]);_0x2fe5ea=_0x48b5cb[_0xd993('0xc6')];_0x1dd178=_0x48b5cb['callAdditionalPhoneAfterMin'];rpcDb[_0xd993('0x6d')](_0x25e3d1,'[callProgressDetectingCustomer][logUnknown]');_0x5d407d[_0xd993('0x7f')](_0x25e3d1,'20',_0x48b5cb)[_0xd993('0x5c')](function(_0x52e253){_0x41efa5=_0x52e253['additional']==0x1;if(!_0x41efa5){if(ut[_0xd993('0x83')](_0x25e3d1)>=_0x48b5cb[_0xd993('0xb7')]){_0x1ba633=ut[_0xd993('0x84')](_0x25e3d1,0xf,_0xd993('0xac'));rpcDb['createCustomerFinal'](_0x1ba633,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd993('0x70')](_0x25e3d1,_0xd993('0xde'));}delete this['actions'][_0x3c7957['linkedid']];}else{_0x5d407d[_0xd993('0x8e')](_0x25e3d1,_0x2fe5ea,_0x1dd178)[_0xd993('0x5c')](function(){});}});}if(!(_0x25e3d1[_0xd993('0x54')]&&_0x9cd083==='16')){ut['updateOriginated'](_0x48b5cb,_0xd993('0xdf'));logger[_0xd993('0x28')](_0xd993('0xe0'),_0x25e3d1[_0xd993('0x92')],_0xd993('0x93'),_0x48b5cb[_0xd993('0x2c')],_0xd993('0x48'),_0x48b5cb[_0xd993('0x2f')]);}if(_0x9cd083!==_0xd993('0xe1')){delete this['actions'][_0x3c7957[_0xd993('0x8a')]];delete this[_0xd993('0x17')][_0x3c7957[_0xd993('0xe2')]];}_0x48b5cb[_0xd993('0xe3')]=!![];}};Preview['prototype']['callProgressDetectingAgent']=function(_0x2f9fe5,_0x480dfa,_0x27fb60){if(_[_0xd993('0xe4')](_0x480dfa)&&'object'!==typeof _0x480dfa){return;}if(_['isUndefined'](_0x27fb60)&&'object'!==typeof _0x27fb60){return;}switch(_0x27fb60[_0xd993('0xe5')]){case'0':ut['logAgent'](_0x2f9fe5,0x0,_0xd993('0x7b'));rpcDb[_0xd993('0xe6')](_0x2f9fe5,_0xd993('0xe7'));break;case'3':ut[_0xd993('0xe8')](_0x2f9fe5,0x3,_0xd993('0xb3'));rpcDb[_0xd993('0xe6')](_0x2f9fe5,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xd993('0xe8')](_0x2f9fe5,0x5,_0xd993('0xa8'));rpcDb[_0xd993('0xe6')](_0x2f9fe5,_0xd993('0xe9'));break;case'8':ut[_0xd993('0xe8')](_0x2f9fe5,0x8,'Congestion');rpcDb[_0xd993('0xe6')](_0x2f9fe5,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xd993('0xe8')](_0x2f9fe5,0x16,_0xd993('0xea'));rpcDb[_0xd993('0xe6')](_0x2f9fe5,_0xd993('0xeb'));break;default:ut[_0xd993('0xe8')](_0x2f9fe5,0xc,_0x27fb60[_0xd993('0xe5')]);rpcDb[_0xd993('0xe6')](_0x2f9fe5,_0xd993('0xec'));}ut[_0xd993('0x52')](_0x480dfa,_0xd993('0xed'));logger[_0xd993('0x28')](_0xd993('0xee'),_0x2f9fe5['uniqueid'],'\x20Queue',_0x480dfa[_0xd993('0x2c')],_0xd993('0x48'),_0x480dfa[_0xd993('0x2f')]);delete this[_0xd993('0x17')][_0x2f9fe5[_0xd993('0x92')]];};Preview[_0xd993('0xf')][_0xd993('0x7f')]=function(_0x36855e,_0x4bdaf9,_0x20fd4d){return cmHopperAdditionalPhone[_0xd993('0x7f')](_0x36855e,_0x4bdaf9,_0x20fd4d)[_0xd993('0x51')](logger[_0xd993('0x28')](_0xd993('0xef')));};Preview['prototype'][_0xd993('0x8e')]=function(_0x222da8,_0x162ef7,_0x52cafe){return cmHopperAdditionalPhone[_0xd993('0x8e')](_0x222da8,_0x162ef7,_0x52cafe)[_0xd993('0x51')](logger[_0xd993('0x28')](_0xd993('0xf0')));};Preview[_0xd993('0xf')][_0xd993('0x8d')]=function(_0x2248d8){return Promise[_0xd993('0xf1')]()[_0xd993('0x5c')](cmHopperAdditionalPhone[_0xd993('0x8d')](_0x2248d8))[_0xd993('0x51')](logger[_0xd993('0x28')](_0xd993('0xf2')));};Preview[_0xd993('0xf')][_0xd993('0xf3')]=function(_0x19dd73,_0x4536a3,_0x235ea6,_0x4d7ca1,_0x49e6bf){var _0x10e6d9=this;return new Promise(function(_0x162831,_0x30fd69){if(_[_0xd993('0x45')](_0x4536a3)||_[_0xd993('0x45')](_0x4536a3[_0xd993('0xf4')])||_[_0xd993('0x45')](_0x4536a3['phone'])||_[_0xd993('0x45')](_0x4536a3[_0xd993('0x4c')])){_0x30fd69(ut['message'](_0xd993('0xf5'),_0x4d7ca1,_0x49e6bf));return;}var _0x9f8d0d=uuid['v4']();var _0x326d02=_0x10e6d9[_0xd993('0x14')][_0x4536a3[_0xd993('0x46')][_0xd993('0x2c')]];var _0x20b667=_0x235ea6?_0x10e6d9[_0xd993('0x18')][_0x235ea6]['id']:undefined;_0x10e6d9[_0xd993('0x17')][_0x9f8d0d]=new Action(_0x4536a3,_0x326d02,_0x9f8d0d,_0x235ea6,_0x20b667);var _0x14e3b9=_0x10e6d9[_0xd993('0x17')][_0x9f8d0d];_0x14e3b9[_0xd993('0xaf')]=_0x4d7ca1;_0x14e3b9[_0xd993('0x89')]=_0x49e6bf;_0x14e3b9[_0xd993('0xf6')]=_0x235ea6;if(_['isEmpty'](_0x19dd73)){_0x10e6d9[_0xd993('0xf7')](_0x14e3b9,_0x326d02,_0x4536a3,_0x235ea6)[_0xd993('0x5c')](function(_0x5338db){logger[_0xd993('0x28')](_0xd993('0xf8'),_0xd993('0xf9')+_0x14e3b9['queue']+'\x20IdHopper:\x20'+_0x14e3b9[_0xd993('0x8c')],JSON['stringify'](_0x5338db));ami['emit']('custom:agentcalled',ut[_0xd993('0x7d')](_0x14e3b9,'called',_0x10e6d9['campaignsPreview'][_0x14e3b9['queue']]));_0x162831(ut[_0xd993('0x34')](_0xd993('0xfa')));})[_0xd993('0x51')](function(_0x373126){ut[_0xd993('0x36')](_0xd993('0xfb'),_0x373126);_0x30fd69(ut[_0xd993('0x34')](_0xd993('0xfc'),_0x4d7ca1,_0x49e6bf));});}else{_0x326d02['outboundBlacklistCallsDay']+=0x1;ut[_0xd993('0xfd')](_0x14e3b9);rpcDb[_0xd993('0xfe')](_0x14e3b9,_0xd993('0xff'));delete _0x10e6d9[_0xd993('0x17')][_0x9f8d0d];_0x30fd69(ut[_0xd993('0x34')](_0xd993('0x100'),_0x4d7ca1,_0x49e6bf));}});};Preview[_0xd993('0xf')][_0xd993('0x73')]=function(_0x245374){return!_[_0xd993('0x45')](_0x245374)&&!_[_0xd993('0x45')](_0x245374[_0xd993('0x2c')])&&!_[_0xd993('0x45')](_0x245374[_0xd993('0x101')])&&_0x245374['active']&&!_['isNil'](this[_0xd993('0x16')][util[_0xd993('0x2a')](_0xd993('0x102'),_0x245374[_0xd993('0x2c')])])&&!_[_0xd993('0x45')](this['trunks'][util[_0xd993('0x2a')]('SIP/%s',_0x245374[_0xd993('0x2c')])][_0xd993('0x4f')])&&(this['trunks'][util['format'](_0xd993('0x102'),_0x245374[_0xd993('0x2c')])][_0xd993('0x4f')]===_0xd993('0x103')||this[_0xd993('0x16')][util[_0xd993('0x2a')](_0xd993('0x102'),_0x245374[_0xd993('0x2c')])][_0xd993('0x4f')]===_0xd993('0x104'));};Preview[_0xd993('0xf')][_0xd993('0x62')]=function(_0x5e3fbd,_0x249cf9){return this[_0xd993('0x105')](_0x5e3fbd,_0x249cf9)[_0xd993('0x5c')](function(_0x59c86e){return _[_0xd993('0x4a')](_0x59c86e,[_0xd993('0x34')]);})[_0xd993('0x51')](function(_0x2e1eb3){if(_0x2e1eb3[_0xd993('0x106')]){rpcDb[_0xd993('0x107')](_0x5e3fbd);}if(_0x2e1eb3[_0xd993('0x101')]){rpcDb[_0xd993('0x65')](_0x5e3fbd);}throw _[_0xd993('0x4a')](_0x2e1eb3,[_0xd993('0x34')]);});};Preview[_0xd993('0xf')]['execRun']=function(_0x2f36c1,_0x5207eb){var _0xa1cbd1=this;var _0xfdee79,_0x276655;return rpcDb[_0xd993('0x108')](_0x2f36c1)[_0xd993('0x5c')](function(_0x144010){if(!_[_0xd993('0x45')](_0x144010[0x0])){_0x276655=_0x144010[0x0]['recallme']?![]:!![];_0xfdee79=_0x144010[0x0][_0xd993('0x109')]?!![]:![];_0xfdee79=_0x5207eb?!![]:_0xfdee79;}var _0x5de53d=_0xa1cbd1[_0xd993('0x10a')](_0x144010);if(_0x5de53d[_0xd993('0x10b')]){rpcDb['checkIsBlackList'](_['pick'](_0x144010[0x0],[_0xd993('0x4c'),'phone']))[_0xd993('0x5c')](function(_0x11ea6d){_0xa1cbd1[_0xd993('0xf3')](_0x11ea6d,_0x144010[0x0],_0x5207eb,_0x276655,_0xfdee79)[_0xd993('0x5c')](function(_0x44d74f){return _0x44d74f;})[_0xd993('0x51')](function(_0x155d88){throw _0x155d88;});})[_0xd993('0x51')](function(_0xe17c34){ut['logger'](_0xd993('0x10c'),_0xe17c34);throw ut[_0xd993('0x34')](_0xd993('0x10d'),_0x276655,_0xfdee79);});}else{throw ut[_0xd993('0x34')](_0x5de53d[_0xd993('0x34')],_0x276655,_0xfdee79);}})[_0xd993('0x51')](function(_0x1b5d16){ut[_0xd993('0x36')](_0xd993('0x10e'),_0x1b5d16);throw ut[_0xd993('0x34')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xd993('0xf')]['validateContact']=function(_0x225db4){if(_[_0xd993('0x45')](_0x225db4)||_[_0xd993('0x10f')](_0x225db4)||!_['isNil'](_0x225db4[0x0][_0xd993('0x60')])&&_['isNil'](_0x225db4[0x0][_0xd993('0x60')][_0xd993('0x2c')])){ut[_0xd993('0x36')](_0xd993('0x110'),_0x225db4);return{'isValid':![],'message':_0xd993('0x111')};}var _0x1df4e7=this[_0xd993('0x14')][_0x225db4[0x0][_0xd993('0x46')][_0xd993('0x2c')]];_0x1df4e7['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0xd993('0x45')](_0x1df4e7)){ut[_0xd993('0x36')](_0xd993('0x112'),_0x1df4e7);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xd993('0x73')](_0x1df4e7['Trunk'])){ut[_0xd993('0x36')](_0xd993('0x113'),_0xd993('0x114')+_0x1df4e7['name']+_0xd993('0x115'));if(!this['isTrunkReachable'](_0x1df4e7[_0xd993('0x75')])){ut[_0xd993('0x36')](_0xd993('0x113'),_0x1df4e7[_0xd993('0x2c')]+_0xd993('0x116'));return{'isValid':![],'message':_0xd993('0x117')};}}if(!ut[_0xd993('0x71')](_0x1df4e7[_0xd993('0x41')])){ut[_0xd993('0x36')]('[Preview][validateContact][Campaign\x20Active]',_0x1df4e7['name']+_0xd993('0x118'));return{'isValid':![],'message':_0xd993('0x114')+_0x1df4e7['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xd993('0x119')};};Preview[_0xd993('0xf')]['execCall']=function(_0x294165,_0x4f3fdb,_0x4a4fb3,_0x4fbbd5){var _0x462c84=this;return new Promise(function(_0x3ba33c,_0x100b03){var _0x3c3261=_0x294165[_0xd993('0x92')];var _0x42ed79=_0x462c84['isTrunkReachable'](_0x4f3fdb[_0xd993('0x74')])?util[_0xd993('0x2a')](_0xd993('0x11a'),_0x4f3fdb['Trunk']['name'],_[_0xd993('0x45')](_0x4f3fdb[_0xd993('0x11b')])?'':_0x4f3fdb[_0xd993('0x11b')][_0xd993('0x11c')]()||'',_0x4f3fdb[_0xd993('0x11d')]>0x0?_0x4a4fb3[_0xd993('0x11e')][_0xd993('0x11f')](_0x4f3fdb[_0xd993('0x11d')]):_0x4a4fb3[_0xd993('0x11e')]):util[_0xd993('0x2a')](_0xd993('0x11a'),_[_0xd993('0x45')](_0x4f3fdb[_0xd993('0x75')])?_0x4f3fdb[_0xd993('0x74')][_0xd993('0x2c')]:_0x4f3fdb[_0xd993('0x75')]['name'],_[_0xd993('0x45')](_0x4f3fdb[_0xd993('0x11b')])?'':_0x4f3fdb[_0xd993('0x11b')][_0xd993('0x11c')]()||'',_0x4f3fdb[_0xd993('0x11d')]>0x0?_0x4a4fb3[_0xd993('0x11e')][_0xd993('0x11f')](_0x4f3fdb[_0xd993('0x11d')]):_0x4a4fb3[_0xd993('0x11e')]);var _0x33d7f5=_0x462c84[_0xd993('0x73')](_0x4f3fdb['Trunk'])?ut[_0xd993('0x120')](_0x4f3fdb[_0xd993('0x74')][_0xd993('0x121')],_0x4f3fdb[_0xd993('0x122')],_0x4f3fdb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd993('0x123')](_0x4f3fdb[_0xd993('0x124')],_0x4f3fdb['dialRandomLastDigitCallerIdNumber']):_0x4f3fdb[_0xd993('0x124')]):ut[_0xd993('0x120')](_['isNil'](_0x4f3fdb[_0xd993('0x75')])?_0x4f3fdb[_0xd993('0x74')][_0xd993('0x121')]:_0x4f3fdb[_0xd993('0x75')]['callerid'],_0x4f3fdb[_0xd993('0x122')],_0x4f3fdb[_0xd993('0x125')]>0x0?ut[_0xd993('0x123')](_0x4f3fdb[_0xd993('0x124')],_0x4f3fdb[_0xd993('0x125')]):_0x4f3fdb[_0xd993('0x124')]);if(_0x33d7f5){_0x294165[_0xd993('0x126')]=ut[_0xd993('0x127')](_0x33d7f5);_0x294165['originatecalleridnum']=ut[_0xd993('0x128')](_0x33d7f5);}var _0x79becf=ut[_0xd993('0x129')](_0x4f3fdb,_0x4a4fb3,_0x42ed79,_0x33d7f5,_0x3c3261,_0x294165);var _0x192cc9=utils[_0xd993('0x12a')](_0x4a4fb3[_0xd993('0xf4')]);Object[_0xd993('0x12b')](_0x79becf,_0x192cc9);_[_0xd993('0x12c')](_0x294165,ut[_0xd993('0x12d')](_0x79becf));_0x294165['starttime']=moment()['format'](_0xd993('0x67'));_0x4f3fdb['variables']=_0x79becf;var _0x14724e=ut[_0xd993('0x12e')](_0x294165,_0x4f3fdb,_0x79becf,_0x294165[_0xd993('0x89')],_0x4fbbd5);return ami['Action'](_0x14724e)[_0xd993('0x5c')](function(_0x28fbd8){_0x4f3fdb['originated']+=0x1;logger[_0xd993('0x28')]('[originated][increment]',_0x3c3261,_0xd993('0x93'),_0x4f3fdb[_0xd993('0x2c')],'originated:\x20',_0x4f3fdb[_0xd993('0x2f')]);_0x3ba33c(_0x28fbd8);})[_0xd993('0x51')](function(_0x531f5a){ut[_0xd993('0xe8')](_0x294165,0xe,_0xd993('0x12f'));rpcDb['createAgentHistory'](_0x294165,'[originateFailure][logOriginateFailure]');_0x100b03(_0x531f5a);});});};Preview[_0xd993('0xf')][_0xd993('0x130')]=function(_0x345877){if(this[_0xd993('0x17')][_0x345877['linkedid']]){this[_0xd993('0x17')][_0x345877['linkedid']]['channel']=_0x345877[_0xd993('0x50')];}};Preview['prototype'][_0xd993('0x1a')]=function(_0x201588){var _0x5e2507=this;var _0x24c673=this['actions'][_0x201588[_0xd993('0x131')]];if(_0x24c673){if(_0x24c673[_0xd993('0xf6')]&&this['agents'][_0x24c673[_0xd993('0xf6')]]){ut['logLookAgent'](_0x24c673,this[_0xd993('0x18')][_0x24c673[_0xd993('0xf6')]][_0xd993('0x2c')],this[_0xd993('0x18')][_0x24c673['lookAgent']]['id']);}var _0x2931f6=_['clone'](_0x24c673);_0x2931f6[_0xd993('0x8f')]=moment()['format'](_0xd993('0x67'));var _0x1237ca=_0x5e2507[_0xd993('0x14')][_0x24c673[_0xd993('0x47')]];if(ut[_0xd993('0x132')](_0x201588[_0xd993('0x133')])){if(_0x24c673[_0xd993('0xaf')]){rpcDb[_0xd993('0x107')](_0x24c673[_0xd993('0x8c')]);}if(_0x24c673[_0xd993('0x89')]){rpcDb[_0xd993('0x65')](_0x24c673['idContact']);}ami[_0xd993('0x27')](_0xd993('0x134'),ut[_0xd993('0x7d')](_0x24c673,_0xd993('0x135'),this[_0xd993('0x14')][_0x24c673[_0xd993('0x47')]]));this['callProgressDetectingAgent'](_0x2931f6,_0x1237ca,_0x201588);}else{_0x24c673[_0xd993('0x66')]=moment()['format'](_0xd993('0x67'));ut['logAgent'](_0x2931f6,0x4,'Answer');rpcDb[_0xd993('0xe6')](_0x2931f6,_0xd993('0x136'));}}};Preview['prototype'][_0xd993('0x1d')]=function(_0xf77bd){var _0x182b1d=this[_0xd993('0x17')][_0xf77bd[_0xd993('0x8a')]];var _0x1f1c29;if(_0x182b1d){_0x1f1c29=this[_0xd993('0x14')][_0x182b1d[_0xd993('0x47')]];logger[_0xd993('0x28')](_0xd993('0x137'),_0xf77bd['linkedid'],_0xd993('0x93'),_0x1f1c29[_0xd993('0x2c')],_0xd993('0x49'),_0x1f1c29['pTalking']);}if(this[_0xd993('0x17')][_0xf77bd[_0xd993('0x8a')]]&&_0xf77bd[_0xd993('0x8a')]!==_0xf77bd['uniqueid']){if(_0xf77bd['cause']==='16'&&this[_0xd993('0x17')][_0xf77bd[_0xd993('0x8a')]][_0xd993('0x54')]){this['callProgressDetectingCustomer'](_0xf77bd,_0xf77bd['linkedid'],_0xf77bd[_0xd993('0x138')]);}else if(this[_0xd993('0x17')][_0xf77bd[_0xd993('0x8a')]][_0xd993('0x54')]){logger[_0xd993('0x28')](_0xd993('0x139'),_0xf77bd[_0xd993('0x8a')],_0xf77bd['cause'],'\x20Queue',_0x1f1c29[_0xd993('0x2c')],'pTalking:\x20',_0x1f1c29[_0xd993('0x30')]);this[_0xd993('0x78')](_0xf77bd,_0xf77bd['linkedid'],_0xf77bd[_0xd993('0x138')]);}}else if(_0x182b1d&&_[_0xd993('0x45')](_0x182b1d[_0xd993('0x13a')])&&_0x1f1c29[_0xd993('0x13b')]&&_0xf77bd['linkedid']===_0xf77bd['uniqueid']&&_['isNil'](_0xf77bd[_0xd993('0xe5')])&&_0xf77bd[_0xd993('0x138')]==='16'&&_0xf77bd[_0xd993('0x13c')]==='6'&&_[_0xd993('0xe4')](_0x182b1d[_0xd993('0x13d')])){if(_0x182b1d['unlockAgent']){rpcDb['unlockContact'](_0x182b1d['idContact']);}if(_0x182b1d[_0xd993('0x89')]){rpcDb[_0xd993('0x65')](_0x182b1d[_0xd993('0x8c')]);}_0xf77bd[_0xd993('0xe5')]='22';this[_0xd993('0x13e')](_0x182b1d,_0x1f1c29,_0xf77bd);}else if(_0x182b1d&&_0x182b1d[_0xd993('0x13d')]){if(_0xf77bd['cause']==='16'&&this[_0xd993('0x17')][_0xf77bd['linkedid']][_0xd993('0x54')]){logger[_0xd993('0x28')]('[syncHangup][talking][transfer]',_0xf77bd[_0xd993('0x8a')],_0xf77bd[_0xd993('0x138')],_0xd993('0x93'),_0x1f1c29[_0xd993('0x2c')],_0xd993('0x49'),_0x1f1c29[_0xd993('0x30')]);this[_0xd993('0x78')](_0xf77bd,_0xf77bd[_0xd993('0x8a')],_0xf77bd['cause']);}else if(this[_0xd993('0x17')][_0xf77bd[_0xd993('0x8a')]]['dialAnswer']){logger[_0xd993('0x28')](_0xd993('0x139'),_0xf77bd[_0xd993('0x8a')],_0xf77bd[_0xd993('0x138')],_0xd993('0x93'),_0x1f1c29[_0xd993('0x2c')],'pTalking:\x20',_0x1f1c29['pTalking']);this[_0xd993('0x78')](_0xf77bd,_0xf77bd[_0xd993('0x8a')],_0xf77bd[_0xd993('0x138')]);}}};Preview[_0xd993('0xf')][_0xd993('0x21')]=function(_0x3067b7){if(this[_0xd993('0x17')][_0x3067b7[_0xd993('0xe2')]]&&_0x3067b7[_0xd993('0xe2')]!==_0x3067b7[_0xd993('0x13f')]){this['callProgressDetectingCustomer'](_0x3067b7,_0x3067b7[_0xd993('0xe2')],_0x3067b7['dialstatus']);}};Preview['prototype'][_0xd993('0x1f')]=function(_0x33bed5){if(this[_0xd993('0x17')][_0x33bed5[_0xd993('0x8a')]]&&_0x33bed5[_0xd993('0x8a')]!==_0x33bed5[_0xd993('0x92')]&&!this['actions'][_0x33bed5[_0xd993('0x8a')]][_0xd993('0x54')]){if(_0x33bed5[_0xd993('0x138')]==='1'){this[_0xd993('0x78')](_0x33bed5,_0x33bed5[_0xd993('0x8a')],_0x33bed5[_0xd993('0x138')]);}}};Preview[_0xd993('0xf')]['addVariable']=function(_0x405ca1,_0x1ab0c9,_0x40083e){if(this[_0xd993('0x17')][_0x405ca1]){if(_[_0xd993('0x45')](this[_0xd993('0x17')][_0x405ca1][_0xd993('0x140')])){this['actions'][_0x405ca1][_0xd993('0x140')]={};}this[_0xd993('0x17')][_0x405ca1][_0xd993('0x140')][_0x1ab0c9]=_0x40083e;}};Preview['prototype'][_0xd993('0x141')]=function(_0x4ba412){try{if(!_[_0xd993('0x45')](_0x4ba412)){if(ut[_0xd993('0x142')](_[_0xd993('0x143')](_0x4ba412['variable'])[0x0])){this[_0xd993('0x144')](_0x4ba412[_0xd993('0x92')],_['keys'](_0x4ba412['variable'])[0x0],_0x4ba412[_0xd993('0x145')]);}}}catch(_0x2b840a){logger['error'](_0xd993('0x146'),util[_0xd993('0x147')](_0x2b840a,{'showHidden':![],'depth':null}));}};Preview[_0xd993('0xf')][_0xd993('0x24')]=function(_0x5a7143){if(_0x5a7143){if(this['actions'][_0x5a7143['transfertargetlinkedid']]){this[_0xd993('0x17')][_0x5a7143[_0xd993('0x148')]][_0xd993('0x13d')]=!![];}}};Preview[_0xd993('0xf')][_0xd993('0x25')]=function(_0x481b70){if(_0x481b70){if(this[_0xd993('0x17')][_0x481b70[_0xd993('0x149')]]){this[_0xd993('0x17')][_0x481b70[_0xd993('0x149')]][_0xd993('0x13d')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 29034fe..a92cac3 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 _0x1e87=['calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[unlockContact]\x20','unlockContact','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0x4fb3c7,_0x391963){var _0x584eb9=function(_0x507dbb){while(--_0x507dbb){_0x4fb3c7['push'](_0x4fb3c7['shift']());}};_0x584eb9(++_0x391963);}(_0x1e87,0x180));var _0x71e8=function(_0x45515b,_0x1e16a8){_0x45515b=_0x45515b-0x0;var _0x20ed56=_0x1e87[_0x45515b];return _0x20ed56;};'use strict';var util=require(_0x71e8('0x0'));var BPromise=require('bluebird');var logger=require(_0x71e8('0x1'))(_0x71e8('0x2'));var cmHopper=require(_0x71e8('0x3'));var cmHopperHistory=require(_0x71e8('0x4'));var cmHopperBlack=require(_0x71e8('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x71e8('0x6'));function loggerCatch(_0x2df555){return function(_0x5ec98d){logger[_0x71e8('0x7')](_0x2df555,util[_0x71e8('0x8')](_0x5ec98d,{'showHidden':![],'depth':null}));};}function create(_0x131138){return cmHopperHistory[_0x71e8('0x9')](_0x131138)[_0x71e8('0xa')](loggerCatch(_0x71e8('0xb')));}function createAgent(_0x507b18){return BPromise[_0x71e8('0xc')]()['then'](agentReportPreview[_0x71e8('0x9')](_0x507b18))['catch'](loggerCatch(_0x71e8('0xb')));}function moveContact(_0x44e4f0){return cmHopper[_0x71e8('0xd')](_0x44e4f0,!![])['catch'](loggerCatch(_0x71e8('0xe')));}exports[_0x71e8('0xf')]=function(_0x3887f1){return cmHopperBlack['checkIsBlackList'](_0x3887f1)['catch'](loggerCatch(_0x71e8('0x10')));};exports['getContactPreview']=function(_0x25ef42){return BPromise[_0x71e8('0xc')]()[_0x71e8('0x11')](cmHopper['getContactPreview'](_0x25ef42))['catch'](loggerCatch(_0x71e8('0x12')));};exports[_0x71e8('0x9')]=function(_0x253f08,_0x46ce69){create(_0x253f08)[_0x71e8('0xa')](loggerCatch(_0x46ce69));moveContact(_0x253f08)['catch'](loggerCatch(_0x46ce69));};exports[_0x71e8('0x13')]=function(_0x41e292,_0x1c4403){createAgent(_0x41e292)[_0x71e8('0xa')](loggerCatch(_0x1c4403));};exports[_0x71e8('0x14')]=function(_0x51d660,_0x5160ee){create(_0x51d660)[_0x71e8('0xa')](loggerCatch(_0x5160ee));};exports[_0x71e8('0x15')]=function(_0x5837f8,_0xd7e9df){moveContact(_0x5837f8)[_0x71e8('0xa')](loggerCatch(_0xd7e9df));};exports[_0x71e8('0x16')]=function(_0x53571b,_0x47c04d,_0x285a9d){if(_0x47c04d){_0x53571b['UserId']=null;}if(_0x285a9d){_0x53571b[_0x71e8('0x17')]=![];}return cmHopper[_0x71e8('0x16')](_0x53571b)[_0x71e8('0xa')](loggerCatch(_0x71e8('0x18')));};exports[_0x71e8('0x19')]=function(_0x1f8efd){return cmHopper[_0x71e8('0x19')](_0x1f8efd)[_0x71e8('0xa')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0xb76d05){return cmHopper['unlockContact']({'UserId':null},_0xb76d05,0x1)[_0x71e8('0xa')](loggerCatch(_0x71e8('0x1a')));};exports['disableContact']=function(_0x346dbd){return cmHopper[_0x71e8('0x1b')]({'active':![]},_0x346dbd,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x71e8('0x1c')]=function(_0x4e54ba){var _0x2ead2b={};_0x2ead2b[_0x71e8('0x1d')]=_0x4e54ba[_0x71e8('0x1d')];_0x2ead2b[_0x71e8('0x1e')]=_0x4e54ba[_0x71e8('0x1e')];_0x2ead2b[_0x71e8('0x1f')]=_0x4e54ba[_0x71e8('0x1f')];_0x2ead2b[_0x71e8('0x20')]=_0x4e54ba[_0x71e8('0x20')];_0x2ead2b[_0x71e8('0x21')]=_0x4e54ba[_0x71e8('0x21')];_0x2ead2b[_0x71e8('0x22')]=_0x4e54ba[_0x71e8('0x23')];_0x2ead2b[_0x71e8('0x24')]=_0x4e54ba[_0x71e8('0x23')];_0x2ead2b[_0x71e8('0x25')]=0x1;_0x2ead2b[_0x71e8('0x26')]=_0x4e54ba[_0x71e8('0x27')];_0x2ead2b[_0x71e8('0x28')]=_0x4e54ba[_0x71e8('0x29')];_0x2ead2b[_0x71e8('0x2a')]=_0x71e8('0x2b');_0x2ead2b[_0x71e8('0x2c')]=_0x71e8('0x2d');_0x2ead2b[_0x71e8('0x2e')]=0x0;_0x2ead2b['assigned']=0x1;_0x2ead2b[_0x71e8('0x2f')]=_0x4e54ba['membername'];_0x2ead2b[_0x71e8('0x30')]='COMPLETED';return BPromise[_0x71e8('0xc')]()[_0x71e8('0x11')](voiceQueueReport[_0x71e8('0x31')](_0x2ead2b))[_0x71e8('0xa')](loggerCatch(_0x71e8('0x32')));};exports['getContactRecallMe']=function(_0x4ba2a6,_0x1ac6df){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x4ba2a6,_0x1ac6df))[_0x71e8('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x3d2a30){return cmHopper[_0x71e8('0x16')](_0x3d2a30,!![],!![])[_0x71e8('0xa')](loggerCatch(_0x71e8('0x33')));}; \ No newline at end of file +var _0xeacb=['disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeacb,0xeb));var _0xbeac=function(_0x1619d8,_0x2643fa){_0x1619d8=_0x1619d8-0x0;var _0x61c38d=_0xeacb[_0x1619d8];return _0x61c38d;};'use strict';var util=require(_0xbeac('0x0'));var BPromise=require(_0xbeac('0x1'));var logger=require(_0xbeac('0x2'))(_0xbeac('0x3'));var cmHopper=require(_0xbeac('0x4'));var cmHopperHistory=require(_0xbeac('0x5'));var cmHopperBlack=require(_0xbeac('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xbeac('0x7'));function loggerCatch(_0x44aae5){return function(_0x530c98){logger[_0xbeac('0x8')](_0x44aae5,util[_0xbeac('0x9')](_0x530c98,{'showHidden':![],'depth':null}));};}function create(_0x13487d){return cmHopperHistory[_0xbeac('0xa')](_0x13487d)[_0xbeac('0xb')](loggerCatch(_0xbeac('0xc')));}function createAgent(_0x1bf28c){return BPromise[_0xbeac('0xd')]()[_0xbeac('0xe')](agentReportPreview[_0xbeac('0xa')](_0x1bf28c))[_0xbeac('0xb')](loggerCatch(_0xbeac('0xc')));}function moveContact(_0x49c15f){return cmHopper[_0xbeac('0xf')](_0x49c15f,!![])['catch'](loggerCatch(_0xbeac('0x10')));}exports[_0xbeac('0x11')]=function(_0x30a919){return cmHopperBlack[_0xbeac('0x11')](_0x30a919)[_0xbeac('0xb')](loggerCatch(_0xbeac('0x12')));};exports[_0xbeac('0x13')]=function(_0x7fcad1){return BPromise[_0xbeac('0xd')]()[_0xbeac('0xe')](cmHopper['getContactPreview'](_0x7fcad1))[_0xbeac('0xb')](loggerCatch(_0xbeac('0x14')));};exports[_0xbeac('0xa')]=function(_0x5b88c5,_0x526258){create(_0x5b88c5)[_0xbeac('0xb')](loggerCatch(_0x526258));moveContact(_0x5b88c5)[_0xbeac('0xb')](loggerCatch(_0x526258));};exports[_0xbeac('0x15')]=function(_0x575464,_0x5e35fb){createAgent(_0x575464)[_0xbeac('0xb')](loggerCatch(_0x5e35fb));};exports[_0xbeac('0x16')]=function(_0x423d42,_0x9f116d){create(_0x423d42)['catch'](loggerCatch(_0x9f116d));};exports['createCustomerFinal']=function(_0x77ab12,_0x17db61){moveContact(_0x77ab12)[_0xbeac('0xb')](loggerCatch(_0x17db61));};exports['rescheduleContact']=function(_0x203a2f,_0x459f31,_0x2ae596){if(_0x459f31){_0x203a2f[_0xbeac('0x17')]=null;}if(_0x2ae596){_0x203a2f['active']=![];}return cmHopper[_0xbeac('0x18')](_0x203a2f)['catch'](loggerCatch(_0xbeac('0x19')));};exports['countReScheduled']=function(_0x279cc2){return cmHopper[_0xbeac('0x1a')](_0x279cc2)[_0xbeac('0xb')](loggerCatch(_0xbeac('0x1b')));};exports[_0xbeac('0x1c')]=function(_0x44b003){return cmHopper[_0xbeac('0x1c')]({'UserId':null},_0x44b003,0x1)[_0xbeac('0xb')](loggerCatch(_0xbeac('0x1d')));};exports[_0xbeac('0x1e')]=function(_0x106bba){return cmHopper[_0xbeac('0x1c')]({'active':![]},_0x106bba,0x1)[_0xbeac('0xb')](loggerCatch(_0xbeac('0x1f')));};exports[_0xbeac('0x20')]=function(_0x1d2df0){var _0xf944c9={};_0xf944c9['type']=_0x1d2df0[_0xbeac('0x21')];_0xf944c9[_0xbeac('0x22')]=_0x1d2df0[_0xbeac('0x22')];_0xf944c9['calleridnum']=_0x1d2df0[_0xbeac('0x23')];_0xf944c9[_0xbeac('0x24')]=_0x1d2df0[_0xbeac('0x24')];_0xf944c9[_0xbeac('0x25')]=_0x1d2df0['queue'];_0xf944c9[_0xbeac('0x26')]=_0x1d2df0['answertime'];_0xf944c9[_0xbeac('0x27')]=_0x1d2df0['answertime'];_0xf944c9[_0xbeac('0x28')]=0x1;_0xf944c9[_0xbeac('0x29')]=_0x1d2df0[_0xbeac('0x2a')];_0xf944c9['connectedlinename']=_0x1d2df0['membername'];_0xf944c9[_0xbeac('0x2b')]=_0xbeac('0x2c');_0xf944c9['exten']=_0xbeac('0x2d');_0xf944c9[_0xbeac('0x2e')]=0x0;_0xf944c9[_0xbeac('0x2f')]=0x1;_0xf944c9[_0xbeac('0x30')]=_0x1d2df0['membername'];_0xf944c9['queuecallerexitreason']='COMPLETED';return BPromise[_0xbeac('0xd')]()[_0xbeac('0xe')](voiceQueueReport[_0xbeac('0x31')](_0xf944c9))[_0xbeac('0xb')](loggerCatch(_0xbeac('0x32')));};exports[_0xbeac('0x33')]=function(_0x106c4f,_0x2a64cb){return BPromise[_0xbeac('0xd')]()[_0xbeac('0xe')](cmHopper[_0xbeac('0x33')](_0x106c4f,_0x2a64cb))[_0xbeac('0xb')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xbeac('0x34')]=function(_0x13acd3){return cmHopper[_0xbeac('0x18')](_0x13acd3,!![],!![])[_0xbeac('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 2f501c8..cb5457c 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 _0xe8e9=['lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','preview','XCALLY_IP_AGI','error','inspect','info','loggerError','logger2','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','membername','UserId','logCustomer','answertime','Failure','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn'];(function(_0x39a167,_0x26dee0){var _0x2ffd9f=function(_0x458cf9){while(--_0x458cf9){_0x39a167['push'](_0x39a167['shift']());}};_0x2ffd9f(++_0x26dee0);}(_0xe8e9,0x150));var _0x9e8e=function(_0x44b16b,_0x44cf88){_0x44b16b=_0x44b16b-0x0;var _0x3027cf=_0xe8e9[_0x44b16b];return _0x3027cf;};'use strict';var util=require(_0x9e8e('0x0'));var _=require(_0x9e8e('0x1'));var moment=require(_0x9e8e('0x2'));var logger=require('../../../../config/logger')(_0x9e8e('0x3'));var ipAgi=process['env'][_0x9e8e('0x4')]||'127.0.0.1';var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x40235e){return function(_0x5bd0b1){logger[_0x9e8e('0x5')](_0x40235e,util[_0x9e8e('0x6')](_0x5bd0b1,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3558f8,_0x4f4ebe){logger[_0x9e8e('0x7')](_0x3558f8,util[_0x9e8e('0x6')](_0x4f4ebe,{'showHidden':![],'depth':null}));};exports[_0x9e8e('0x8')]=function(_0x5e5262,_0x9583a1){logger['error'](_0x5e5262,util[_0x9e8e('0x6')](_0x9583a1,{'showHidden':![],'depth':null}));};exports[_0x9e8e('0x9')]=function(_0x425afa){return function(_0x41a090){logger[_0x9e8e('0x7')](_0x425afa,util[_0x9e8e('0x6')](_0x41a090,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4874e0,_0x428e9f,_0x1b9c30){return{'message':_0x4874e0,'unlock':_0x428e9f,'active':_0x1b9c30};};exports['getCallerId']=function(_0x3a3dbe,_0x266678,_0xc9a198){if(!_[_0x9e8e('0xa')](_0xc9a198)&&_0x9e8e('0xb')===typeof _0xc9a198&&!_[_0x9e8e('0xc')](_0xc9a198)){if(!_[_0x9e8e('0xa')](_0x266678)&&_0x9e8e('0xb')===typeof _0x266678&&!_[_0x9e8e('0xc')](_0x266678)){return util[_0x9e8e('0xd')]('\x22%s\x22\x20<%s>',_0x266678,_0xc9a198);}return util[_0x9e8e('0xd')]('\x22%s\x22\x20<%s>',_0xc9a198,_0xc9a198);}if(!_[_0x9e8e('0xa')](_0x3a3dbe)&&_0x9e8e('0xb')===typeof _0x3a3dbe&&!_[_0x9e8e('0xc')](_0x3a3dbe)){return _0x3a3dbe;}return _0x9e8e('0xe');};exports[_0x9e8e('0xf')]=function(_0x5ef99c){if(_['isNil'](_0x5ef99c)){return![];}return _0x5ef99c;};exports[_0x9e8e('0x10')]=function(_0x2738bc,_0x4dec63,_0x3773b2,_0x41714b,_0x8abe65,_0x453fcd){var _0x66ec={'XMD-QUEUE':_0x4dec63[_0x9e8e('0x11')]?_0x4dec63[_0x9e8e('0x11')][_0x9e8e('0x12')]:'','XMD-CALLERID':_0x41714b,'XMD-CALLERID-PREVIEW':_0x453fcd?util[_0x9e8e('0xd')](_0x9e8e('0x13'),_0x453fcd['calleridname'],_0x453fcd[_0x9e8e('0x14')]):_0x41714b,'XMD-DIALID':_0x8abe65,'XMD-CONTACTID':_0x4dec63[_0x9e8e('0x15')],'XMD-CDRTYPE':_0x9e8e('0x16'),'CALLERID(all)':_0x41714b,'XMD-VOICEQUEUEID':_0x4dec63[_0x9e8e('0x17')],'XMD-DIALCHANNEL':_0x3773b2,'XMD-DIALTIMEOUT':_0x2738bc[_0x9e8e('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x9e8e('0xd')](_0x9e8e('0x19'),_0x2738bc[_0x9e8e('0x1a')]?'g':'',_[_0x9e8e('0xc')](_0x2738bc[_0x9e8e('0x1b')])?'':_0x9e8e('0x1c')),'XMD-DIALURL':_0x2738bc[_0x9e8e('0x1d')]||'','XMD-AGI':_0x2738bc[_0x9e8e('0x1e')]?util[_0x9e8e('0xd')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2738bc[_0x9e8e('0x1e')]):_0x9e8e('0x1f'),'XMD-AGIAFTER':_0x2738bc[_0x9e8e('0x1a')]?util['format'](_0x9e8e('0x20'),ipAgi,_0x2738bc[_0x9e8e('0x1a')]):_0x9e8e('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x453fcd?_0x453fcd['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x453fcd?_0x453fcd['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x9e8e('0x21')};if(!_['isEmpty'](_0x2738bc[_0x9e8e('0x1b')])){_0x66ec[util[_0x9e8e('0xd')]('%s',_0x9e8e('0x22'))]=_0x2738bc[_0x9e8e('0x1b')];_0x66ec[util['format']('%s',_0x9e8e('0x23'))]=_0x8abe65;}return _0x66ec;};exports[_0x9e8e('0x24')]=function(_0x1a6be4){var _0x40034e={};for(var _0x23f9ee in _0x1a6be4){if(_0x1a6be4[_0x9e8e('0x25')](_0x23f9ee)){_0x40034e[util[_0x9e8e('0xd')]('%s',_[_0x9e8e('0x26')](_0x23f9ee))]=_0x1a6be4[_0x23f9ee];}}return{'variables':_0x40034e};};exports[_0x9e8e('0x27')]=function(_0x166260,_0x24d123){if(!_[_0x9e8e('0x28')](_0x166260)){if(_0x166260[_0x9e8e('0x25')](_0x9e8e('0x29'))){if(_0x166260[_0x9e8e('0x29')]>0x0){_0x166260['originated']-=0x1;}else{logger[_0x9e8e('0x5')](_0x9e8e('0x2a'),_0x24d123);}}}else{logger['error'](_0x9e8e('0x2b'),_0x24d123);}};exports[_0x9e8e('0x2c')]=function(_0x22e180){var _0x23d2c5=moment()[_0x9e8e('0xd')](_0x9e8e('0x2d'));_0x22e180[_0x9e8e('0x2e')]=0xd;_0x22e180[_0x9e8e('0x2f')]=_0x9e8e('0x30');_0x22e180[_0x9e8e('0x31')]=_0x23d2c5;_0x22e180[_0x9e8e('0x32')]=_0x23d2c5;_0x22e180[_0x9e8e('0x33')]=_0x23d2c5;};exports[_0x9e8e('0x34')]=function(_0x2faaa3,_0x1a5a4a,_0x47a699){var _0x1b8c59=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2faaa3[_0x9e8e('0x2e')]=_0x1a5a4a;_0x2faaa3[_0x9e8e('0x2f')]=_0x47a699;_0x2faaa3[_0x9e8e('0x32')]=_0x1b8c59;_0x2faaa3[_0x9e8e('0x35')]=utils[_0x9e8e('0x36')](_0x2faaa3[_0x9e8e('0x32')],_0x2faaa3[_0x9e8e('0x31')]);};exports['logLookAgent']=function(_0x4bff7c,_0x19bb13,_0x4d681b){_0x4bff7c[_0x9e8e('0x37')]=_0x19bb13;_0x4bff7c[_0x9e8e('0x38')]=_0x4d681b;};exports[_0x9e8e('0x39')]=function(_0x1a9fd3,_0x205b33,_0x524e46){var _0x11a967=moment()[_0x9e8e('0xd')](_0x9e8e('0x2d'));_0x1a9fd3[_0x9e8e('0x2e')]=_0x205b33;_0x1a9fd3[_0x9e8e('0x2f')]=_0x524e46;_0x1a9fd3[_0x9e8e('0x32')]=_0x1a9fd3['responsetime']?_0x1a9fd3[_0x9e8e('0x32')]:_0x11a967;_0x1a9fd3[_0x9e8e('0x33')]=_0x1a9fd3[_0x9e8e('0x33')]?_0x1a9fd3[_0x9e8e('0x33')]:_0x11a967;_0x1a9fd3['ringtime']=utils[_0x9e8e('0x36')](_0x1a9fd3['responsetime']||0x0,_0x1a9fd3['starttime']||0x0);_0x1a9fd3['talktime']=_0x1a9fd3['answertime']?utils[_0x9e8e('0x36')](_0x1a9fd3[_0x9e8e('0x33')],_0x1a9fd3[_0x9e8e('0x3a')]):0x0;};exports['isFailure']=function(_0x2eb104){return _0x2eb104===_0x9e8e('0x3b');};exports['variablesAction']=function(_0x2e0593,_0x2464fd,_0x234ccc,_0x21dee8,_0x18a334){var _0x44bda4=_0x21dee8?'RECALL':_0x2e0593[_0x9e8e('0x3c')];_0x44bda4=_0x18a334?_0x9e8e('0x3d'):_0x44bda4;return{'actionid':_0x2e0593[_0x9e8e('0x3e')],'action':_0x9e8e('0x3f'),'channel':_0x2e0593[_0x9e8e('0x40')],'callerid':util['format'](_0x9e8e('0x13'),_0x44bda4,_0x2e0593[_0x9e8e('0x14')]),'Exten':_0x9e8e('0x41'),'Context':'from-sip','Priority':'1','variable':_0x234ccc,'timeout':(_0x2464fd[_0x9e8e('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e0593[_0x9e8e('0x3e')]};};exports[_0x9e8e('0x43')]=function(_0x4e8bf1){return _0x4e8bf1[_0x9e8e('0x44')]+_0x4e8bf1[_0x9e8e('0x45')]+_0x4e8bf1['countnoanswerretry']+_0x4e8bf1[_0x9e8e('0x46')]+_0x4e8bf1[_0x9e8e('0x47')];};exports['cloneAction']=function(_0x119408){var _0x7284d5=_[_0x9e8e('0x48')](_0x119408);_0x7284d5[_0x9e8e('0x2e')]=0xf;_0x7284d5[_0x9e8e('0x2f')]=_0x9e8e('0x49');return _0x7284d5;};exports[_0x9e8e('0x4a')]=function(_0x43fe93,_0x2741cf,_0x4e5876){var _0x3fb54d={};_0x3fb54d[_0x2741cf]=_0x43fe93[_0x2741cf];_0x3fb54d[_0x9e8e('0x4b')]=![];_0x3fb54d[_0x9e8e('0x4c')]=moment()[_0x9e8e('0x4d')](_0x4e5876,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fb54d[_0x9e8e('0x15')]=_0x43fe93[_0x9e8e('0x15')];_0x3fb54d[_0x9e8e('0x4e')]=_0x43fe93[_0x9e8e('0x4e')];_0x3fb54d['VoiceQueueId']=_0x43fe93[_0x9e8e('0x17')]||undefined;return _0x3fb54d;};exports[_0x9e8e('0x4f')]=function(_0x70d09b,_0x4a60ee){if(!_['isNil'](_0x70d09b)){if(_0x70d09b[_0x9e8e('0x50')]>0x0){_0x70d09b['pTalking']-=0x1;}else{logger[_0x9e8e('0x5')](_0x4a60ee,_0x9e8e('0x51'));}}else{logger[_0x9e8e('0x5')](_0x4a60ee,_0x9e8e('0x52'));}};exports[_0x9e8e('0x53')]=function(_0x511055){if(_0x511055<=0x0){return!![];}return![];};function buildObj(_0x50143f,_0x1c6eb0,_0x4c4a37){_0x50143f[_0x9e8e('0x54')]=_0x1c6eb0;_0x50143f[_0x9e8e('0x12')]=_0x50143f[_0x9e8e('0x55')];_0x50143f[_0x9e8e('0x56')]=_0x50143f[_0x9e8e('0x40')];_0x50143f[_0x9e8e('0x57')]=_0x9e8e('0x58');if(_0x4c4a37){_0x50143f[_0x9e8e('0x59')]=_0x4c4a37[_0x9e8e('0x59')];}return _0x50143f;}exports['buildObj']=buildObj;exports[_0x9e8e('0x5a')]=function(_0x5164f2){var _0x47be2b={};_0x47be2b[_0x9e8e('0x55')]=_0x5164f2[_0x9e8e('0x55')];_0x47be2b[_0x9e8e('0x56')]=_0x5164f2[_0x9e8e('0x40')];_0x47be2b[_0x9e8e('0x3e')]=_0x5164f2['uniqueid'];return _0x47be2b;};exports[_0x9e8e('0x5b')]=function(_0x1e7200){var _0x91852=[];for(var _0x45ab08 in _0x1e7200){if(_0x1e7200[_0x9e8e('0x25')](_0x45ab08)){if(!_[_0x9e8e('0x28')](_0x1e7200[_0x45ab08])&&_0x1e7200[_0x45ab08]['state']===_0x9e8e('0x5c')&&_0x1e7200[_0x45ab08][_0x9e8e('0x5d')]===_0x9e8e('0x5e')){_0x91852['push'](_0x1e7200[_0x45ab08]['id']);}}}return _0x91852;};exports[_0x9e8e('0x5f')]=function(_0x19c0df){var _0x55a498=moment()[_0x9e8e('0x60')](0x0);var _0x5569d3=moment(_0x19c0df)[_0x9e8e('0x60')](0x0);return _0x55a498[_0x9e8e('0x61')](_0x5569d3,_0x9e8e('0x62'));};exports['createBody']=function(_0xd3a414){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd3a414[_0x9e8e('0x15')],'ListId':_0xd3a414[_0x9e8e('0x4e')],'VoiceQueueId':_0xd3a414[_0x9e8e('0x17')]||undefined,'CampaignId':_0xd3a414[_0x9e8e('0x63')]||undefined};};exports[_0x9e8e('0x64')]=function(_0xb8baca){if(_0xb8baca==='uniqueid'||_0xb8baca===_0x9e8e('0x65')||_0xb8baca===_0x9e8e('0x55')||_0xb8baca===_0x9e8e('0x66')||_0xb8baca===_0x9e8e('0x67')||_0xb8baca===_0x9e8e('0x68')||_0xb8baca===_0x9e8e('0x37')||_0xb8baca===_0x9e8e('0x40')||_0xb8baca===_0x9e8e('0x3c')||_0xb8baca===_0x9e8e('0x4b')||_0xb8baca==='calleridnum'||_0xb8baca===_0x9e8e('0x4c')||_0xb8baca===_0x9e8e('0x44')||_0xb8baca===_0x9e8e('0x45')||_0xb8baca===_0x9e8e('0x69')||_0xb8baca===_0x9e8e('0x6a')||_0xb8baca===_0x9e8e('0x6b')||_0xb8baca===_0x9e8e('0x6c')||_0xb8baca==='callbackat'||_0xb8baca===_0x9e8e('0x6d')||_0xb8baca===_0x9e8e('0x15')||_0xb8baca===_0x9e8e('0x4e')||_0xb8baca===_0x9e8e('0x38')||_0xb8baca===_0x9e8e('0x17')||_0xb8baca===_0x9e8e('0x6e')||_0xb8baca===_0x9e8e('0x6f')||_0xb8baca===_0x9e8e('0x70')||_0xb8baca==='xmd-phone'||_0xb8baca===_0x9e8e('0x71')||_0xb8baca==='xmd-dialurl'||_0xb8baca===_0x9e8e('0x72')||_0xb8baca===_0x9e8e('0x73')||_0xb8baca===_0x9e8e('0x74')||_0xb8baca===_0x9e8e('0x75')||_0xb8baca===_0x9e8e('0x76')||_0xb8baca==='xmd-cdrtype'||_0xb8baca===_0x9e8e('0x77')||_0xb8baca===_0x9e8e('0x78')||_0xb8baca===_0x9e8e('0x79')||_0xb8baca==='rtpaudioqos'||_0xb8baca===_0x9e8e('0x7a')||_0xb8baca==='rtpaudioqosjitter'||_0xb8baca==='rtpaudioqosjitterbridged'||_0xb8baca==='rtpaudioqosloss'||_0xb8baca===_0x9e8e('0x7b')||_0xb8baca===_0x9e8e('0x7c')||_0xb8baca===_0x9e8e('0x7d')||_0xb8baca==='rtpaudioqos'||_0xb8baca===_0x9e8e('0x7a')||_0xb8baca==='rtpaudioqosjitter'||_0xb8baca===_0x9e8e('0x7e')||_0xb8baca==='rtpaudioqosloss'||_0xb8baca==='rtpaudioqoslossbridged'||_0xb8baca===_0x9e8e('0x7c')||_0xb8baca==='rtpaudioqosrttbridged'||_0xb8baca===_0x9e8e('0x7f')||_0xb8baca==='bridgepvtcallid'||_0xb8baca===_0x9e8e('0x2e')||_0xb8baca==='statedesc'){return![];}return!![];};exports[_0x9e8e('0x80')]=function(_0x4d12a5,_0x3acc42){var _0x3f2f2e,_0x14b75b,_0x59cebe;if(_0x3acc42<=0x0){_0x3acc42=0x1;}_0x3f2f2e=new RegExp(_0x9e8e('0x81')+_0x3acc42+'}$');_0x14b75b=Math[_0x9e8e('0x82')](0xa,_0x3acc42-0x1);_0x59cebe=Math[_0x9e8e('0x82')](0xa,_0x3acc42)-0x1;return util[_0x9e8e('0xd')]('%s',_[_0x9e8e('0x83')](_0x4d12a5,_0x3f2f2e,_[_0x9e8e('0x84')](_0x14b75b,_0x59cebe)));};exports['extractCalleridName']=function(_0x2d2bde){var _0x3cd06f=_0x2d2bde[_0x9e8e('0x85')](/"(.*?)"/);return _0x3cd06f?_0x3cd06f[0x1]:_0x2d2bde;};exports[_0x9e8e('0x86')]=function(_0x19b127){var _0x5cb954=_0x19b127[_0x9e8e('0x85')](/<(.*?)>/);return _0x5cb954?_0x5cb954[0x1]:_0x19b127;};function buildNoAnswerEventPayload(_0xc3a31f,_0x5a9e80){var _0x494205=buildObj(_0xc3a31f,_0x9e8e('0x87'));if(!_[_0x9e8e('0xc')](_0x5a9e80[_0x9e8e('0x88')])){Object[_0x9e8e('0x89')](_0x5a9e80[_0x9e8e('0x88')])[_0x9e8e('0x8a')](function(_0x52f2bc){_0x494205[_0x52f2bc['toLowerCase']()]=_0x5a9e80[_0x9e8e('0x88')][_0x52f2bc];});}return _0x494205;}exports[_0x9e8e('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x10ee=['variables','keys','forEach','buildNoAnswerEventPayload','util','moment','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','getSeconds','membername','UserId','logCustomer','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','push','getDiff','milliseconds','seconds','createBody','VoiceQueueId','filterKey','type','campaigntype','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','noanswer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x10ee,0x11a));var _0xe10e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x10ee[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xe10e('0x0'));var _=require('lodash');var moment=require(_0xe10e('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xe10e('0x2')][_0xe10e('0x3')]||'127.0.0.1';var utils=require(_0xe10e('0x4'));exports[_0xe10e('0x5')]=function(_0x1aae88){return function(_0x5615b5){logger[_0xe10e('0x6')](_0x1aae88,util[_0xe10e('0x7')](_0x5615b5,{'showHidden':![],'depth':null}));};};exports[_0xe10e('0x8')]=function(_0x1700ac,_0x49b729){logger[_0xe10e('0x9')](_0x1700ac,util[_0xe10e('0x7')](_0x49b729,{'showHidden':![],'depth':null}));};exports[_0xe10e('0xa')]=function(_0x250d82,_0xa672f7){logger[_0xe10e('0x6')](_0x250d82,util['inspect'](_0xa672f7,{'showHidden':![],'depth':null}));};exports[_0xe10e('0xb')]=function(_0x57a9ef){return function(_0x55fe4f){logger[_0xe10e('0x9')](_0x57a9ef,util[_0xe10e('0x7')](_0x55fe4f,{'showHidden':![],'depth':null}));};};exports[_0xe10e('0xc')]=function(_0xb1c594,_0x9632ca,_0x2df700){return{'message':_0xb1c594,'unlock':_0x9632ca,'active':_0x2df700};};exports[_0xe10e('0xd')]=function(_0x2da01f,_0x3bd976,_0x2f3b40){if(!_[_0xe10e('0xe')](_0x2f3b40)&&_0xe10e('0xf')===typeof _0x2f3b40&&!_[_0xe10e('0x10')](_0x2f3b40)){if(!_[_0xe10e('0xe')](_0x3bd976)&&_0xe10e('0xf')===typeof _0x3bd976&&!_['isEmpty'](_0x3bd976)){return util[_0xe10e('0x11')](_0xe10e('0x12'),_0x3bd976,_0x2f3b40);}return util[_0xe10e('0x11')]('\x22%s\x22\x20<%s>',_0x2f3b40,_0x2f3b40);}if(!_['isUndefined'](_0x2da01f)&&_0xe10e('0xf')===typeof _0x2da01f&&!_[_0xe10e('0x10')](_0x2da01f)){return _0x2da01f;}return _0xe10e('0x13');};exports[_0xe10e('0x14')]=function(_0x4ff7eb){if(_[_0xe10e('0x15')](_0x4ff7eb)){return![];}return _0x4ff7eb;};exports[_0xe10e('0x16')]=function(_0x42a72d,_0x377b84,_0x24e09e,_0x1fac03,_0x283a98,_0x53099e){var _0x14510c={'XMD-QUEUE':_0x377b84[_0xe10e('0x17')]?_0x377b84[_0xe10e('0x17')][_0xe10e('0x18')]:'','XMD-CALLERID':_0x1fac03,'XMD-CALLERID-PREVIEW':_0x53099e?util[_0xe10e('0x11')](_0xe10e('0x12'),_0x53099e[_0xe10e('0x19')],_0x53099e['calleridnum']):_0x1fac03,'XMD-DIALID':_0x283a98,'XMD-CONTACTID':_0x377b84[_0xe10e('0x1a')],'XMD-CDRTYPE':_0xe10e('0x1b'),'CALLERID(all)':_0x1fac03,'XMD-VOICEQUEUEID':_0x377b84['VoiceQueueId'],'XMD-DIALCHANNEL':_0x24e09e,'XMD-DIALTIMEOUT':_0x42a72d[_0xe10e('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xe10e('0x11')](_0xe10e('0x1d'),_0x42a72d[_0xe10e('0x1e')]?'g':'',_[_0xe10e('0x10')](_0x42a72d['monitor_format'])?'':_0xe10e('0x1f')),'XMD-DIALURL':_0x42a72d['dialPreviewUrl']||'','XMD-AGI':_0x42a72d[_0xe10e('0x20')]?util['format'](_0xe10e('0x21'),ipAgi,_0x42a72d['dialQueueProject']):_0xe10e('0x22'),'XMD-AGIAFTER':_0x42a72d['dialQueueProject2']?util[_0xe10e('0x11')](_0xe10e('0x21'),ipAgi,_0x42a72d[_0xe10e('0x1e')]):_0xe10e('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x53099e?_0x53099e[_0xe10e('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x53099e?_0x53099e[_0xe10e('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xe10e('0x25')};if(!_[_0xe10e('0x10')](_0x42a72d['monitor_format'])){_0x14510c[util[_0xe10e('0x11')]('%s',_0xe10e('0x26'))]=_0x42a72d[_0xe10e('0x27')];_0x14510c[util[_0xe10e('0x11')]('%s',_0xe10e('0x28'))]=_0x283a98;}return _0x14510c;};exports[_0xe10e('0x29')]=function(_0x2f5836){var _0x12e4af={};for(var _0x5221c9 in _0x2f5836){if(_0x2f5836[_0xe10e('0x2a')](_0x5221c9)){_0x12e4af[util[_0xe10e('0x11')]('%s',_['toLower'](_0x5221c9))]=_0x2f5836[_0x5221c9];}}return{'variables':_0x12e4af};};exports['updateOriginated']=function(_0x580a48,_0x31ed1d){if(!_[_0xe10e('0x15')](_0x580a48)){if(_0x580a48[_0xe10e('0x2a')](_0xe10e('0x2b'))){if(_0x580a48[_0xe10e('0x2b')]>0x0){_0x580a48[_0xe10e('0x2b')]-=0x1;}else{logger[_0xe10e('0x6')](_0xe10e('0x2c'),_0x31ed1d);}}}else{logger[_0xe10e('0x6')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x31ed1d);}};exports[_0xe10e('0x2d')]=function(_0x97aec9){var _0x4af264=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x97aec9['state']=0xd;_0x97aec9['statedesc']=_0xe10e('0x2e');_0x97aec9[_0xe10e('0x2f')]=_0x4af264;_0x97aec9[_0xe10e('0x30')]=_0x4af264;_0x97aec9[_0xe10e('0x31')]=_0x4af264;};exports[_0xe10e('0x32')]=function(_0x165dd0,_0x2cffe3,_0x3f0355){var _0x48150d=moment()[_0xe10e('0x11')](_0xe10e('0x33'));_0x165dd0[_0xe10e('0x34')]=_0x2cffe3;_0x165dd0[_0xe10e('0x35')]=_0x3f0355;_0x165dd0[_0xe10e('0x30')]=_0x48150d;_0x165dd0[_0xe10e('0x36')]=utils[_0xe10e('0x37')](_0x165dd0[_0xe10e('0x30')],_0x165dd0['starttime']);};exports['logLookAgent']=function(_0x5e19e9,_0x3a18a7,_0x45a9a5){_0x5e19e9[_0xe10e('0x38')]=_0x3a18a7;_0x5e19e9[_0xe10e('0x39')]=_0x45a9a5;};exports[_0xe10e('0x3a')]=function(_0x2349b9,_0x59b4cb,_0x58d1cc){var _0x152aa9=moment()[_0xe10e('0x11')](_0xe10e('0x33'));_0x2349b9['state']=_0x59b4cb;_0x2349b9[_0xe10e('0x35')]=_0x58d1cc;_0x2349b9[_0xe10e('0x30')]=_0x2349b9[_0xe10e('0x30')]?_0x2349b9[_0xe10e('0x30')]:_0x152aa9;_0x2349b9['endtime']=_0x2349b9[_0xe10e('0x31')]?_0x2349b9[_0xe10e('0x31')]:_0x152aa9;_0x2349b9[_0xe10e('0x36')]=utils[_0xe10e('0x37')](_0x2349b9['responsetime']||0x0,_0x2349b9['starttime']||0x0);_0x2349b9['talktime']=_0x2349b9[_0xe10e('0x3b')]?utils[_0xe10e('0x37')](_0x2349b9[_0xe10e('0x31')],_0x2349b9[_0xe10e('0x3b')]):0x0;};exports[_0xe10e('0x3c')]=function(_0x5cf5ee){return _0x5cf5ee===_0xe10e('0x3d');};exports['variablesAction']=function(_0x52b38d,_0x2b5ffe,_0x1fa480,_0x3e6019,_0x14bbf4){var _0x4961f2=_0x3e6019?_0xe10e('0x3e'):_0x52b38d['calleridname'];_0x4961f2=_0x14bbf4?_0xe10e('0x3f'):_0x4961f2;return{'actionid':_0x52b38d[_0xe10e('0x40')],'action':'originate','channel':_0x52b38d[_0xe10e('0x41')],'callerid':util[_0xe10e('0x11')]('\x22%s\x22\x20<%s>',_0x4961f2,_0x52b38d[_0xe10e('0x42')]),'Exten':_0xe10e('0x43'),'Context':_0xe10e('0x44'),'Priority':'1','variable':_0x1fa480,'timeout':(_0x2b5ffe[_0xe10e('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52b38d[_0xe10e('0x40')]};};exports[_0xe10e('0x46')]=function(_0x12089a){return _0x12089a[_0xe10e('0x47')]+_0x12089a[_0xe10e('0x48')]+_0x12089a[_0xe10e('0x49')]+_0x12089a['countagentrejectretry']+_0x12089a[_0xe10e('0x4a')];};exports['cloneAction']=function(_0x3ae820){var _0x1694ab=_[_0xe10e('0x4b')](_0x3ae820);_0x1694ab[_0xe10e('0x34')]=0xf;_0x1694ab[_0xe10e('0x35')]=_0xe10e('0x4c');return _0x1694ab;};exports[_0xe10e('0x4d')]=function(_0x4c6a8b,_0x1ecc66,_0x5c8b00){var _0x2b29d6={};_0x2b29d6[_0x1ecc66]=_0x4c6a8b[_0x1ecc66];_0x2b29d6[_0xe10e('0x4e')]=![];_0x2b29d6[_0xe10e('0x4f')]=moment()[_0xe10e('0x50')](_0x5c8b00,'minutes')[_0xe10e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b29d6[_0xe10e('0x1a')]=_0x4c6a8b[_0xe10e('0x1a')];_0x2b29d6[_0xe10e('0x51')]=_0x4c6a8b['ListId'];_0x2b29d6['VoiceQueueId']=_0x4c6a8b['VoiceQueueId']||undefined;return _0x2b29d6;};exports[_0xe10e('0x52')]=function(_0x22729d,_0x3963a2){if(!_['isNil'](_0x22729d)){if(_0x22729d['pTalking']>0x0){_0x22729d[_0xe10e('0x53')]-=0x1;}else{logger[_0xe10e('0x6')](_0x3963a2,_0xe10e('0x54'));}}else{logger[_0xe10e('0x6')](_0x3963a2,_0xe10e('0x55'));}};exports[_0xe10e('0x56')]=function(_0x1d5572){if(_0x1d5572<=0x0){return!![];}return![];};function buildObj(_0x459e19,_0x583410,_0xa7275b){_0x459e19['lastevent']=_0x583410;_0x459e19[_0xe10e('0x18')]=_0x459e19[_0xe10e('0x57')];_0x459e19['interface']=_0x459e19[_0xe10e('0x41')];_0x459e19[_0xe10e('0x58')]=_0xe10e('0x59');if(_0xa7275b){_0x459e19['mandatoryDisposition']=_0xa7275b[_0xe10e('0x5a')];}return _0x459e19;}exports['buildObj']=buildObj;exports[_0xe10e('0x5b')]=function(_0x5888aa){var _0x5a1fef={};_0x5a1fef['queue']=_0x5888aa[_0xe10e('0x57')];_0x5a1fef[_0xe10e('0x5c')]=_0x5888aa[_0xe10e('0x41')];_0x5a1fef[_0xe10e('0x40')]=_0x5888aa['uniqueid'];return _0x5a1fef;};exports[_0xe10e('0x5d')]=function(_0x34d676){var _0x569535=[];for(var _0x1571b1 in _0x34d676){if(_0x34d676[_0xe10e('0x2a')](_0x1571b1)){if(!_[_0xe10e('0x15')](_0x34d676[_0x1571b1])&&_0x34d676[_0x1571b1]['state']===_0xe10e('0x5e')&&_0x34d676[_0x1571b1][_0xe10e('0x5f')]==='reachable'){_0x569535[_0xe10e('0x60')](_0x34d676[_0x1571b1]['id']);}}}return _0x569535;};exports[_0xe10e('0x61')]=function(_0x210183){var _0x53937a=moment()[_0xe10e('0x62')](0x0);var _0x138627=moment(_0x210183)['milliseconds'](0x0);return _0x53937a['diff'](_0x138627,_0xe10e('0x63'));};exports[_0xe10e('0x64')]=function(_0x52b91c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x52b91c[_0xe10e('0x1a')],'ListId':_0x52b91c[_0xe10e('0x51')],'VoiceQueueId':_0x52b91c[_0xe10e('0x65')]||undefined,'CampaignId':_0x52b91c['CampaignId']||undefined};};exports[_0xe10e('0x66')]=function(_0x579086){if(_0x579086===_0xe10e('0x40')||_0x579086==='idContact'||_0x579086==='queue'||_0x579086===_0xe10e('0x67')||_0x579086===_0xe10e('0x68')||_0x579086==='dialAnswer'||_0x579086===_0xe10e('0x38')||_0x579086==='channelAgent'||_0x579086===_0xe10e('0x19')||_0x579086==='active'||_0x579086==='calleridnum'||_0x579086===_0xe10e('0x4f')||_0x579086===_0xe10e('0x47')||_0x579086===_0xe10e('0x48')||_0x579086===_0xe10e('0x49')||_0x579086==='countglobal'||_0x579086===_0xe10e('0x69')||_0x579086===_0xe10e('0x6a')||_0x579086===_0xe10e('0x6b')||_0x579086===_0xe10e('0x6c')||_0x579086===_0xe10e('0x1a')||_0x579086===_0xe10e('0x51')||_0x579086===_0xe10e('0x39')||_0x579086==='VoiceQueueId'||_0x579086===_0xe10e('0x6d')||_0x579086===_0xe10e('0x6e')||_0x579086===_0xe10e('0x6f')||_0x579086===_0xe10e('0x70')||_0x579086===_0xe10e('0x71')||_0x579086===_0xe10e('0x72')||_0x579086===_0xe10e('0x73')||_0x579086==='xmd-dialoptions'||_0x579086==='xmd-dialid'||_0x579086==='xmd-dialchannel'||_0x579086===_0xe10e('0x74')||_0x579086===_0xe10e('0x75')||_0x579086===_0xe10e('0x76')||_0x579086===_0xe10e('0x77')||_0x579086===_0xe10e('0x78')||_0x579086===_0xe10e('0x79')||_0x579086===_0xe10e('0x7a')||_0x579086===_0xe10e('0x7b')||_0x579086==='rtpaudioqosjitterbridged'||_0x579086===_0xe10e('0x7c')||_0x579086==='rtpaudioqoslossbridged'||_0x579086===_0xe10e('0x7d')||_0x579086===_0xe10e('0x7e')||_0x579086===_0xe10e('0x79')||_0x579086===_0xe10e('0x7a')||_0x579086==='rtpaudioqosjitter'||_0x579086===_0xe10e('0x7f')||_0x579086===_0xe10e('0x7c')||_0x579086===_0xe10e('0x80')||_0x579086===_0xe10e('0x7d')||_0x579086==='rtpaudioqosrttbridged'||_0x579086===_0xe10e('0x81')||_0x579086==='bridgepvtcallid'||_0x579086===_0xe10e('0x34')||_0x579086===_0xe10e('0x35')){return![];}return!![];};exports[_0xe10e('0x82')]=function(_0x33d685,_0x560cc3){var _0x41425a,_0x41c2a4,_0x17653c;if(_0x560cc3<=0x0){_0x560cc3=0x1;}_0x41425a=new RegExp(_0xe10e('0x83')+_0x560cc3+'}$');_0x41c2a4=Math[_0xe10e('0x84')](0xa,_0x560cc3-0x1);_0x17653c=Math['pow'](0xa,_0x560cc3)-0x1;return util[_0xe10e('0x11')]('%s',_[_0xe10e('0x85')](_0x33d685,_0x41425a,_['random'](_0x41c2a4,_0x17653c)));};exports['extractCalleridName']=function(_0xbb08c0){var _0x18c1a9=_0xbb08c0['match'](/"(.*?)"/);return _0x18c1a9?_0x18c1a9[0x1]:_0xbb08c0;};exports['extractCalleridNumber']=function(_0x5cb32b){var _0x132dfe=_0x5cb32b['match'](/<(.*?)>/);return _0x132dfe?_0x132dfe[0x1]:_0x5cb32b;};function buildNoAnswerEventPayload(_0x156631,_0x3365c4){var _0x35e45d=buildObj(_0x156631,_0xe10e('0x86'));if(!_[_0xe10e('0x10')](_0x3365c4[_0xe10e('0x87')])){Object[_0xe10e('0x88')](_0x3365c4[_0xe10e('0x87')])[_0xe10e('0x89')](function(_0x5794f9){_0x35e45d[_0x5794f9['toLowerCase']()]=_0x3365c4['variables'][_0x5794f9];});}return _0x35e45d;}exports[_0xe10e('0x8a')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 5d9f287..e4dd4d3 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 _0xb074=['queuepause','voicequeuechannel','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x10efe2,_0x2a4de2){var _0x4a8488=function(_0x42aa6e){while(--_0x42aa6e){_0x10efe2['push'](_0x10efe2['shift']());}};_0x4a8488(++_0x2a4de2);}(_0xb074,0x13e));var _0x4b07=function(_0x44fd4c,_0x20edab){_0x44fd4c=_0x44fd4c-0x0;var _0x3021d4=_0xb074[_0x44fd4c];return _0x3021d4;};'use strict';exports['queueadd']={'queue':{'type':_0x4b07('0x0'),'required':!![]},'interface':{'type':_0x4b07('0x0'),'required':!![]},'membername':{'type':_0x4b07('0x0'),'required':!![]},'penalty':{'type':_0x4b07('0x1'),'required':![]},'paused':{'type':_0x4b07('0x2'),'required':![]}};exports[_0x4b07('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x4b07('0x0'),'required':!![]}};exports[_0x4b07('0x4')]={'interface':{'type':_0x4b07('0x0'),'required':!![]},'paused':{'type':_0x4b07('0x2')},'reason':{'type':_0x4b07('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x4b07('0x0'),'required':![]}};exports[_0x4b07('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x4b07('0x0'),'required':!![]},'filename':{'type':_0x4b07('0x0')},'format':{'type':_0x4b07('0x0')},'mixmonitorid':{'type':_0x4b07('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x4b07('0x0'),'required':!![]}};exports[_0x4b07('0x6')]={'uniqueid':{'type':_0x4b07('0x0'),'required':!![]},'exten':{'type':_0x4b07('0x0'),'required':!![]},'context':{'type':_0x4b07('0x0')}}; \ No newline at end of file +var _0x5b92=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x34e668,_0xe92467){var _0x3b84a2=function(_0x22d059){while(--_0x22d059){_0x34e668['push'](_0x34e668['shift']());}};_0x3b84a2(++_0xe92467);}(_0x5b92,0xb7));var _0x25b9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5b92[_0x5ddb1c];return _0x354adc;};'use strict';exports[_0x25b9('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x25b9('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x25b9('0x2'),'required':![]}};exports[_0x25b9('0x3')]={'queue':{'type':_0x25b9('0x1'),'required':!![]},'interface':{'type':_0x25b9('0x1'),'required':!![]}};exports[_0x25b9('0x4')]={'interface':{'type':_0x25b9('0x1'),'required':!![]},'paused':{'type':_0x25b9('0x2')},'reason':{'type':_0x25b9('0x1'),'required':![]}};exports[_0x25b9('0x5')]={'module':{'type':_0x25b9('0x1'),'required':![]}};exports[_0x25b9('0x6')]={'uniqueid':{'type':_0x25b9('0x1'),'required':!![]}};exports[_0x25b9('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x25b9('0x8')]={'uniqueid':{'type':_0x25b9('0x1'),'required':!![]}};exports[_0x25b9('0x9')]={'uniqueid':{'type':_0x25b9('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x25b9('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5e20e9c..e6b7f1e 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 _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x433c7b,_0xce426a){var _0x297f25=function(_0x11fcdd){while(--_0x11fcdd){_0x433c7b['push'](_0x433c7b['shift']());}};_0x297f25(++_0xce426a);}(_0xdb28,0x106));var _0x8db2=function(_0x1e4931,_0x38e278){_0x1e4931=_0x1e4931-0x0;var _0x366548=_0xdb28[_0x1e4931];return _0x366548;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file +var _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x5b2f1a,_0x5f21b6){var _0x1cff47=function(_0x1c175f){while(--_0x1c175f){_0x5b2f1a['push'](_0x5b2f1a['shift']());}};_0x1cff47(++_0x5f21b6);}(_0xdb28,0x106));var _0x8db2=function(_0x4828f5,_0x232ab2){_0x4828f5=_0x4828f5-0x0;var _0x14b2a9=_0xdb28[_0x4828f5];return _0x14b2a9;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 0f13b32..d60d79e 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1781=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1781,0x15b));var _0x1178=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1781[_0x21a9d9];return _0x46adce;};'use strict';function mergeDBDataToRealtime(_0x1cb772,_0x558c7b){var _0x549d4e=Object[_0x1178('0x0')]({},_0x1cb772);for(var _0x19233c in _0x558c7b){if(_0x549d4e[_0x1178('0x1')](_0x19233c)){_0x549d4e[_0x19233c]=_0x558c7b[_0x19233c];}}return _0x549d4e;}exports[_0x1178('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x8bf2=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x347ce2,_0x131d66){var _0x38d479=function(_0xf17344){while(--_0xf17344){_0x347ce2['push'](_0x347ce2['shift']());}};_0x38d479(++_0x131d66);}(_0x8bf2,0x154));var _0x28bf=function(_0x4b1dd4,_0x292d3a){_0x4b1dd4=_0x4b1dd4-0x0;var _0x2c87dd=_0x8bf2[_0x4b1dd4];return _0x2c87dd;};'use strict';function mergeDBDataToRealtime(_0x237a33,_0x5d19aa){var _0x256864=Object[_0x28bf('0x0')]({},_0x237a33);for(var _0x25434a in _0x5d19aa){if(_0x256864[_0x28bf('0x1')](_0x25434a)){_0x256864[_0x25434a]=_0x5d19aa[_0x25434a];}}return _0x256864;}exports[_0x28bf('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 31c371b..ceb76e2 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 _0xfc62=['transfererlinkedid','exports','lodash','util','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedTransfer','findAgent','find','isNil','telephones','accountcode','name','format','prototype','length','lastAssignedTo','interface','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','match','keys','getCallType','channel','split','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','getAgentByInternal','UserId','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','create','forEach','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','blindTransfer'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xfc62,0x1c4));var _0x2fc6=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xfc62[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x2fc6('0x0'));var moment=require('moment');var util=require(_0x2fc6('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x2fc6('0x2'));var RpcMemberReport=require(_0x2fc6('0x3'));var RpcVoiceQueueReport=require(_0x2fc6('0x4'));var RpcVoiceRecording=require(_0x2fc6('0x5'));var RpcVoiceTransferReport=require(_0x2fc6('0x6'));var VoiceQueueReport=require(_0x2fc6('0x7'));var VoiceCallReport=require(_0x2fc6('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x2fc6('0x9'));function Report(_0x5abc24){this[_0x2fc6('0xa')]=_0x5abc24;this[_0x2fc6('0xb')]=_0x5abc24[_0x2fc6('0xb')];this['telephones']=_0x5abc24['telephones'];}Report['prototype'][_0x2fc6('0xc')]=function(_0xd4114c){var _0x123550=new VoiceQueueReport(this[_0x2fc6('0xa')]);var _0x12fefc=new VoiceAgentReport(this[_0x2fc6('0xa')]);var _0x5615dc=new VoiceDialReport(this[_0x2fc6('0xa')]);var _0x590ad3=new VoiceCallReport(this[_0x2fc6('0xa')]);var _0x305801=new UserReport(this[_0x2fc6('0xa')]);if(config['xdr']&&config[_0x2fc6('0xd')][_0x2fc6('0xe')]){ami['on'](_0x2fc6('0xf'),this[_0x2fc6('0x10')][_0x2fc6('0x11')](this));ami['on'](_0x2fc6('0x12'),this[_0x2fc6('0x13')][_0x2fc6('0x11')](this));ami['on']('custom:voiceAgentReport',this[_0x2fc6('0x14')][_0x2fc6('0x11')](this));ami['on'](_0x2fc6('0x15'),this[_0x2fc6('0x16')][_0x2fc6('0x11')](this));ami['on']('blindtransfer',this['blindTransfer'][_0x2fc6('0x11')](this));ami['on']('attendedtransfer',this[_0x2fc6('0x17')][_0x2fc6('0x11')](this));}};Report['prototype'][_0x2fc6('0x18')]=function(_0x43c846){var _0x8b5b19;_0x8b5b19=_[_0x2fc6('0x19')](this[_0x2fc6('0xb')],function(_0x3ca7a2){return _0x3ca7a2['accountcode']==_0x43c846||_0x3ca7a2['name']==_0x43c846;});if(_[_0x2fc6('0x1a')](_0x8b5b19)){var _0x341afa=_[_0x2fc6('0x19')](this[_0x2fc6('0x1b')],function(_0x504389){return _0x504389[_0x2fc6('0x1c')]==_0x43c846||_0x504389[_0x2fc6('0x1d')]==_0x43c846;});if(_0x341afa){_0x8b5b19=_['find'](this[_0x2fc6('0xb')],function(_0x3c2eb3){return _0x3c2eb3['interface']==util[_0x2fc6('0x1e')]('SIP/%s',_0x341afa[_0x2fc6('0x1d')]);});}}return _0x8b5b19;};Report[_0x2fc6('0x1f')][_0x2fc6('0x10')]=function(_0xe60528){for(var _0x13f29f=0x0;_0x13f29f<_0xe60528[_0x2fc6('0x20')];_0x13f29f+=0x1){var _0x4ccb7b=this[_0x2fc6('0x18')](_0xe60528[_0x13f29f]['connectedlinenum']);if(_0x4ccb7b){_0xe60528[_0x13f29f][_0x2fc6('0x1c')]=_0x4ccb7b[_0x2fc6('0x1c')];_0xe60528[_0x13f29f]['assigned']=!![];_0xe60528[_0x13f29f][_0x2fc6('0x21')]=_0x4ccb7b[_0x2fc6('0x1d')];_0xe60528[_0x13f29f][_0x2fc6('0x22')]=_[_0x2fc6('0x1a')](_0x4ccb7b['interface'])?util[_0x2fc6('0x1e')](_0x2fc6('0x23'),_0x4ccb7b['name']):_0x4ccb7b[_0x2fc6('0x22')];if(_0xe60528[_0x13f29f][_0x2fc6('0x24')]){_0xe60528[_0x13f29f][_0x2fc6('0x25')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0xe60528[_0x13f29f]['queuecallerexit']){_0xe60528[_0x13f29f]['queuecallerexitAt']=moment()[_0x2fc6('0x1e')](_0x2fc6('0x26'));}RpcMemberReport[_0x2fc6('0x10')](_0xe60528[_0x13f29f]);}RpcVoiceQueueReport['create'](_0xe60528[_0x13f29f]);}};function extractCalleridNumber(_0x5ae87d){var _0x2410e5=_0x5ae87d[_0x2fc6('0x27')](/<(.*?)>/);return _0x2410e5?_0x2410e5[0x1]:_0x5ae87d;}Report[_0x2fc6('0x1f')]['getAgentByInternal']=function(_0x3b9525){for(var _0x12bf20=0x0;_0x12bf20/);return _0x227283?_0x227283[0x1]:_0x4668e1;}Report[_0xb630('0x10')][_0xb630('0x31')]=function(_0x5cfe0b){for(var _0x3f11a4=0x0;_0x3f11a4',_0x3db54e[_0xb630('0x49')],_0x3db54e[_0xb630('0x36')]);}if(RpcVoiceTransferReport[_0xb630('0x4a')][_0x3db54e['linkedid']]){var _0x2f67c5=RpcVoiceTransferReport[_0xb630('0x4a')][_0x3db54e[_0xb630('0x4b')]];_0x2f67c5[_0xb630('0x4c')]=_0x3db54e['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x2f67c5);delete RpcVoiceTransferReport[_0xb630('0x4a')][_0x3db54e[_0xb630('0x4b')]];}if(_[_0xb630('0x24')](_0x3db54e[_0xb630('0x3b')])){_0x3db54e[_0xb630('0x3b')]=this[_0xb630('0x34')](_0x3db54e);}if(_[_0xb630('0x24')](_0x3db54e[_0xb630('0x4d')])){var _0x24b6ed=_0x3db54e['channel'][_0xb630('0x4e')]('-')[0x0];var _0x1d1c58=this[_0xb630('0xe')][_0x24b6ed];if(!_0x1d1c58)_0x1d1c58=this[_0xb630('0x31')](_0x3db54e['accountcode']);if(_0x1d1c58){_0x3db54e['UserId']=_0x1d1c58['id'];_0x3db54e['membername']=_0x1d1c58[_0xb630('0x23')];}}RpcVoiceCallReport[_0xb630('0x2f')](_0x3db54e);if(_0x3db54e[_0xb630('0x4f')]){for(var _0x5ad727=0x0;_0x5ad727<_0x3db54e[_0xb630('0x50')][_0xb630('0x33')];_0x5ad727+=0x1){_0x3db54e[_0xb630('0x51')]=_0x3db54e[_0xb630('0x50')][_0x5ad727]['filename'];_0x3db54e[_0xb630('0x52')]=_0x3db54e[_0xb630('0x50')][_0x5ad727]['createdAt'];if(_0x3db54e[_0xb630('0x3a')]==_0xb630('0x43')){_0x3db54e[_0xb630('0x36')]=_0x3db54e[_0xb630('0x29')];_0x3db54e['calleridname']=_0x3db54e['connectedlinename'];_0x3db54e[_0xb630('0x29')]=_0x3db54e[_0xb630('0x25')];_0x3db54e[_0xb630('0x53')]=_0x3db54e['membername'];_0x3db54e['exten']=_0x3db54e['originatecalleridnum'];}else if(_0x3db54e[_0xb630('0x3a')]==_0xb630('0x54')){_0x3db54e[_0xb630('0x36')]=_0x3db54e['destination'];_0x3db54e[_0xb630('0x3a')]=_0x3db54e[_0xb630('0x45')];}RpcVoiceRecording[_0xb630('0x2f')](_0x3db54e);}}};Report[_0xb630('0x10')]['voiceAgentReport']=function(_0xc9707f){if(_['isArray'](_0xc9707f)){_0xc9707f[_0xb630('0x55')](function(_0x39f639){RpcVoiceAgentReport[_0xb630('0x2f')](_0x39f639);});}else{RpcVoiceAgentReport['create'](_0xc9707f);}};Report[_0xb630('0x10')][_0xb630('0x1c')]=function(_0xd5562f){RpcVoiceDialReport['create'](_0xd5562f);var _0x4a4ffc;var _0x314f77;var _0x212ec5=_0xd5562f['channel'];if(_[_0xb630('0x56')](_0x212ec5,_0xb630('0x57'))){_0x314f77=_0x212ec5[_0xb630('0x58')](_0x212ec5['indexOf']('/')+0x1,_0x212ec5[_0xb630('0x59')]('@'));_0x4a4ffc=_[_0xb630('0x22')](this['agents'],function(_0x292828){return _0x292828[_0xb630('0x5a')]==_0x314f77||_0x292828['phone']==_0x314f77||_0x292828['accountcode']==_0x314f77;});}else{_0x314f77=_0x212ec5['substring'](_0x212ec5['indexOf']('/')+0x1,_0x212ec5[_0xb630('0x5b')]('-'));_0x4a4ffc=this[_0xb630('0x21')](_0x314f77);}if(_0x4a4ffc){_0xd5562f[_0xb630('0x26')]=_[_0xb630('0x24')](_0x4a4ffc[_0xb630('0x26')])?util['format'](_0xb630('0x28'),_0x4a4ffc['name']):_0x4a4ffc[_0xb630('0x26')];_0xd5562f['membername']=_0x4a4ffc[_0xb630('0x23')];_0xd5562f[_0xb630('0x25')]=_0x4a4ffc[_0xb630('0x25')];RpcMemberReport[_0xb630('0x1c')](_0xd5562f);}};Report[_0xb630('0x10')][_0xb630('0x1e')]=function(_0x47804e){RpcVoiceTransferReport[_0xb630('0x4a')][_0x47804e[_0xb630('0x5c')]]=_0x47804e;};Report[_0xb630('0x10')][_0xb630('0x20')]=function(_0x3c2ae9){RpcVoiceTransferReport[_0xb630('0x20')](_0x3c2ae9);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index a346c87..08b2c63 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 _0x97b3=['prototype','isNotNull','isUndefined','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','merge','omit','state','emit','format','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','stateTime','toNumber','updateStatusRealtime','toLowerCase','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','mobile','phone','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','catch','error','actionSipPeerStatus','then'];(function(_0x5b9480,_0x58ac05){var _0x159277=function(_0x44c9f7){while(--_0x44c9f7){_0x5b9480['push'](_0x5b9480['shift']());}};_0x159277(++_0x58ac05);}(_0x97b3,0x70));var _0x397b=function(_0x41d4c0,_0x4a609a){_0x41d4c0=_0x41d4c0-0x0;var _0x21228c=_0x97b3[_0x41d4c0];return _0x21228c;};'use strict';var _=require(_0x397b('0x0'));var moment=require(_0x397b('0x1'));var util=require('util');var Redis=require(_0x397b('0x2'));var BPromise=require(_0x397b('0x3'));var config=require(_0x397b('0x4'));var logger=require(_0x397b('0x5'))(_0x397b('0x6'));var ami=require(_0x397b('0x7'));config[_0x397b('0x8')]=_['defaults'](config[_0x397b('0x8')],{'host':_0x397b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x397b('0x8')]));function UserReport(_0x3b6912){this['trunks']=_0x3b6912[_0x397b('0xa')];this[_0x397b('0xb')]=_0x3b6912[_0x397b('0xb')];this[_0x397b('0xc')]=_0x3b6912['telephones'];ami['on'](_0x397b('0xd'),this[_0x397b('0xe')][_0x397b('0xf')](this));ami['on'](_0x397b('0x10'),this[_0x397b('0xe')][_0x397b('0xf')](this));ami['on'](_0x397b('0x11'),this[_0x397b('0x12')][_0x397b('0xf')](this));ami['on'](_0x397b('0x13'),this[_0x397b('0x14')]['bind'](this));return this[_0x397b('0x15')]();}function showSipRegistrations(){Promise[_0x397b('0x16')]()['then'](ami[_0x397b('0x17')]())['catch'](function(_0x3eb968){logger['error'](_0x397b('0x18'),util[_0x397b('0x19')](_0x3eb968,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x397b('0x16')]()['then'](ami['actionDeviceStateList']())[_0x397b('0x1a')](function(_0x1f8699){logger[_0x397b('0x1b')]('[userReport][devicestatelist]',util[_0x397b('0x19')](_0x1f8699,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x397b('0x16')]()['then'](ami[_0x397b('0x1c')]())['catch'](function(_0xf2e603){logger[_0x397b('0x1b')]('[userReport][sippeerstatus]',util[_0x397b('0x19')](_0xf2e603,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x397b('0x15')]=function(){setInterval(function(){BPromise[_0x397b('0x16')]()['then'](showSipRegistrations())[_0x397b('0x1d')](listDeviceStates())[_0x397b('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0x397b('0x1e')][_0x397b('0x1f')]=function(_0x1257ac){return _0x1257ac!==null&&!_[_0x397b('0x20')](_0x1257ac);};UserReport[_0x397b('0x1e')]['emit']=function(_0x4e9779,_0x4535c9,_0x5ba851){io['to'](_0x4e9779)['emit'](_0x4535c9,_0x5ba851);};UserReport[_0x397b('0x1e')][_0x397b('0xe')]=function(_0x385f5a){try{if(this[_0x397b('0x1f')](_0x385f5a)){logger['info'](_0x397b('0x21'),_0x385f5a[_0x397b('0x22')],_0x385f5a['state']);logger[_0x397b('0x23')](_0x397b('0x24'),util[_0x397b('0x19')](_0x385f5a,{'showHidden':![],'depth':null}));var _0x1ec169=_[_0x397b('0x25')](this[_0x397b('0xa')],{'defaultuser':_0x385f5a[_0x397b('0x22')]});if(_0x1ec169){_0x385f5a[_0x397b('0x26')]=_0x385f5a['state'];_[_0x397b('0x27')](_0x1ec169,_[_0x397b('0x28')](_0x385f5a,['event','actionid',_0x397b('0x22'),_0x397b('0x29')]));logger[_0x397b('0x23')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x397b('0x19')](_0x1ec169,{'showHidden':![],'depth':null}));this[_0x397b('0x2a')](util[_0x397b('0x2b')]('trunk:%s',_0x1ec169[_0x397b('0x2c')]),_0x397b('0x2d'),_0x1ec169);}}}catch(_0x1c6709){logger[_0x397b('0x1b')](_0x397b('0x24'),util[_0x397b('0x19')](_0x1c6709,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x397b('0x12')]=function(_0x454836){try{if(this['isNotNull'](_0x454836)){logger[_0x397b('0x2e')](_0x397b('0x2f'),_0x454836[_0x397b('0x30')],_0x454836[_0x397b('0x29')]);logger['debug'](_0x397b('0x31'),util[_0x397b('0x19')](_0x454836,{'showHidden':![],'depth':null}));if(this[_0x397b('0xb')][_0x454836[_0x397b('0x30')]]){if(!this['agents'][_0x454836['device']][_0x397b('0x32')]||_0x454836[_0x397b('0x29')]['toLowerCase']()==_0x397b('0x33')){this['agents'][_0x454836[_0x397b('0x30')]][_0x397b('0x32')]=![];if(this['agents'][_0x454836['device']][_0x397b('0x29')]!==_0x454836[_0x397b('0x29')]['toLowerCase']()){this[_0x397b('0xb')][_0x454836['device']][_0x397b('0x34')]=_[_0x397b('0x35')](moment()[_0x397b('0x2b')]('x'));}this[_0x397b('0xb')][_0x454836[_0x397b('0x30')]]['state']=_0x454836[_0x397b('0x29')]['toLowerCase']();this[_0x397b('0xb')][_0x454836[_0x397b('0x30')]][_0x397b('0x36')](_0x454836);}}else if(this[_0x397b('0xc')][_0x454836[_0x397b('0x30')]]){if(this[_0x397b('0xc')][_0x454836['device']][_0x397b('0x29')]!==_0x454836[_0x397b('0x29')][_0x397b('0x37')]()){this[_0x397b('0xc')][_0x454836[_0x397b('0x30')]][_0x397b('0x34')]=_['toNumber'](moment()[_0x397b('0x2b')]('x'));}this[_0x397b('0xc')][_0x454836[_0x397b('0x30')]][_0x397b('0x29')]=_0x454836['state'][_0x397b('0x37')]();logger[_0x397b('0x23')](_0x397b('0x38'),util['inspect'](this['telephones'][_0x454836[_0x397b('0x30')]],{'showHidden':![],'depth':null}));this[_0x397b('0x2a')](util['format']('telephone:%s',this[_0x397b('0xc')][_0x454836['device']][_0x397b('0x2c')]),'telephone:save',this['telephones'][_0x454836['device']]);}else if(this[_0x397b('0xa')][_0x454836[_0x397b('0x30')]]){if(this[_0x397b('0xa')][_0x454836['device']]['state']!==_0x454836[_0x397b('0x29')]['toLowerCase']()){this[_0x397b('0xa')][_0x454836[_0x397b('0x30')]][_0x397b('0x34')]=_[_0x397b('0x35')](moment()['format']('x'));}this['trunks'][_0x454836[_0x397b('0x30')]][_0x397b('0x29')]=_0x454836[_0x397b('0x29')]['toLowerCase']();logger[_0x397b('0x23')](_0x397b('0x39'),util['inspect'](this[_0x397b('0xa')][_0x454836['device']],{'showHidden':![],'depth':null}));this[_0x397b('0x2a')](util[_0x397b('0x2b')](_0x397b('0x3a'),this[_0x397b('0xa')][_0x454836[_0x397b('0x30')]][_0x397b('0x2c')]),_0x397b('0x2d'),this['trunks'][_0x454836[_0x397b('0x30')]]);}else if(_['startsWith'](_0x454836[_0x397b('0x30')],_0x397b('0x3b'))){var _0x3e48f0=_0x454836[_0x397b('0x30')];var _0xe140b9=_0x3e48f0[_0x397b('0x3c')](_0x3e48f0[_0x397b('0x3d')]('/')+0x1,_0x3e48f0[_0x397b('0x3d')]('@'));var _0x307ffc=_[_0x397b('0x25')](this[_0x397b('0xb')],function(_0x49b947){return _0x49b947[_0x397b('0x3e')]==_0xe140b9||_0x49b947[_0x397b('0x3f')]==_0xe140b9||_0x49b947['accountcode']==_0xe140b9;});if(_0x307ffc){if(_0x307ffc['state']!==_0x454836['state'][_0x397b('0x37')]()){_0x307ffc[_0x397b('0x34')]=_['toNumber'](moment()[_0x397b('0x2b')]('x'));}_0x307ffc[_0x397b('0x29')]=_0x454836[_0x397b('0x29')][_0x397b('0x37')]();_0x307ffc[_0x397b('0x32')]=!![];_0x307ffc[_0x397b('0x36')](_0x454836);}}}}catch(_0x2957b1){logger[_0x397b('0x1b')](_0x397b('0x31'),util['inspect'](_0x2957b1,{'showHidden':![],'depth':null}));}};UserReport[_0x397b('0x1e')]['syncPeerStatus']=function(_0x1c9ed5){try{if(this['isNotNull'](_0x1c9ed5)&&this[_0x397b('0x1f')](_0x1c9ed5[_0x397b('0x13')])){logger[_0x397b('0x2e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1c9ed5[_0x397b('0x40')],_0x1c9ed5[_0x397b('0x41')],_0x1c9ed5[_0x397b('0x13')]);logger['debug'](_0x397b('0x42'),util[_0x397b('0x19')](_0x1c9ed5,{'showHidden':![],'depth':null}));if(this[_0x397b('0xb')][_0x1c9ed5[_0x397b('0x40')]]){if(!this[_0x397b('0xb')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x32')]||_0x1c9ed5[_0x397b('0x13')][_0x397b('0x37')]()==_0x397b('0x43')){this[_0x397b('0xb')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x32')]=![];this[_0x397b('0xb')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x44')]=_0x1c9ed5[_0x397b('0x13')][_0x397b('0x37')]();this['agents'][_0x1c9ed5['peer']][_0x397b('0x41')]=_0x1c9ed5['address'];this[_0x397b('0xb')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x36')](_0x1c9ed5);}}else if(this['telephones'][_0x1c9ed5[_0x397b('0x40')]]){this[_0x397b('0xc')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x44')]=_0x1c9ed5[_0x397b('0x13')][_0x397b('0x37')]();this[_0x397b('0xc')][_0x1c9ed5[_0x397b('0x40')]]['address']=_0x1c9ed5[_0x397b('0x41')];logger[_0x397b('0x23')](_0x397b('0x45'),util['inspect'](this[_0x397b('0xc')][_0x1c9ed5['peer']],{'showHidden':![],'depth':null}));this[_0x397b('0x2a')](util['format']('telephone:%s',this[_0x397b('0xc')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x2c')]),'telephone:save',this['telephones'][_0x1c9ed5[_0x397b('0x40')]]);}else if(this['trunks'][_0x1c9ed5['peer']]){this[_0x397b('0xa')][_0x1c9ed5[_0x397b('0x40')]]['status']=_0x1c9ed5[_0x397b('0x13')][_0x397b('0x37')]();this[_0x397b('0xa')][_0x1c9ed5[_0x397b('0x40')]][_0x397b('0x41')]=_0x1c9ed5[_0x397b('0x41')];logger[_0x397b('0x23')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x397b('0x19')](this[_0x397b('0xa')][_0x1c9ed5[_0x397b('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x397b('0x2b')](_0x397b('0x3a'),this['trunks'][_0x1c9ed5[_0x397b('0x40')]]['name']),_0x397b('0x2d'),this[_0x397b('0xa')][_0x1c9ed5['peer']]);}}}catch(_0x77091b){logger[_0x397b('0x1b')]('[userReport][peerstatus]',util[_0x397b('0x19')](_0x77091b,{'showHidden':![],'depth':null}));}};module[_0x397b('0x46')]=UserReport; \ No newline at end of file +var _0xa5e8=['error','inspect','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','find','username','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','peerstatus','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch'];(function(_0x1904d5,_0x3c9b12){var _0x83368e=function(_0x568fdd){while(--_0x568fdd){_0x1904d5['push'](_0x1904d5['shift']());}};_0x83368e(++_0x3c9b12);}(_0xa5e8,0x1b9));var _0x8a5e=function(_0x27973f,_0x32ae84){_0x27973f=_0x27973f-0x0;var _0x392c09=_0xa5e8[_0x27973f];return _0x392c09;};'use strict';var _=require(_0x8a5e('0x0'));var moment=require(_0x8a5e('0x1'));var util=require(_0x8a5e('0x2'));var Redis=require(_0x8a5e('0x3'));var BPromise=require(_0x8a5e('0x4'));var config=require('../../../config/environment');var logger=require(_0x8a5e('0x5'))(_0x8a5e('0x6'));var ami=require(_0x8a5e('0x7'));config[_0x8a5e('0x8')]=_[_0x8a5e('0x9')](config['redis'],{'host':_0x8a5e('0xa'),'port':0x18eb});var io=require(_0x8a5e('0xb'))(new Redis(config['redis']));function UserReport(_0x109114){this[_0x8a5e('0xc')]=_0x109114[_0x8a5e('0xc')];this['agents']=_0x109114[_0x8a5e('0xd')];this[_0x8a5e('0xe')]=_0x109114[_0x8a5e('0xe')];ami['on'](_0x8a5e('0xf'),this[_0x8a5e('0x10')][_0x8a5e('0x11')](this));ami['on'](_0x8a5e('0x12'),this[_0x8a5e('0x10')][_0x8a5e('0x11')](this));ami['on'](_0x8a5e('0x13'),this[_0x8a5e('0x14')][_0x8a5e('0x11')](this));ami['on']('peerstatus',this[_0x8a5e('0x15')][_0x8a5e('0x11')](this));return this[_0x8a5e('0x16')]();}function showSipRegistrations(){Promise[_0x8a5e('0x17')]()[_0x8a5e('0x18')](ami[_0x8a5e('0x19')]())[_0x8a5e('0x1a')](function(_0x39191f){logger[_0x8a5e('0x1b')]('[userReport][sipshowregistry]',util[_0x8a5e('0x1c')](_0x39191f,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8a5e('0x17')]()[_0x8a5e('0x18')](ami[_0x8a5e('0x1d')]())[_0x8a5e('0x1a')](function(_0x2605aa){logger[_0x8a5e('0x1b')](_0x8a5e('0x1e'),util[_0x8a5e('0x1c')](_0x2605aa,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x8a5e('0x17')]()['then'](ami['actionSipPeerStatus']())[_0x8a5e('0x1a')](function(_0x251964){logger[_0x8a5e('0x1b')](_0x8a5e('0x1f'),util[_0x8a5e('0x1c')](_0x251964,{'showHidden':![],'depth':null}));});}UserReport[_0x8a5e('0x20')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x8a5e('0x17')]()[_0x8a5e('0x18')](showSipRegistrations())[_0x8a5e('0x18')](listDeviceStates())[_0x8a5e('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x8a5e('0x20')][_0x8a5e('0x21')]=function(_0x1e3c05){return _0x1e3c05!==null&&!_[_0x8a5e('0x22')](_0x1e3c05);};UserReport['prototype']['emit']=function(_0xb7fb07,_0x51f49f,_0x3634e0){io['to'](_0xb7fb07)[_0x8a5e('0x23')](_0x51f49f,_0x3634e0);};UserReport[_0x8a5e('0x20')]['syncRegistry']=function(_0x302392){try{if(this['isNotNull'](_0x302392)){logger[_0x8a5e('0x24')](_0x8a5e('0x25'),_0x302392['username'],_0x302392[_0x8a5e('0x26')]);logger[_0x8a5e('0x27')]('[userReport][registry]',util[_0x8a5e('0x1c')](_0x302392,{'showHidden':![],'depth':null}));var _0x5df3ff=_[_0x8a5e('0x28')](this[_0x8a5e('0xc')],{'defaultuser':_0x302392[_0x8a5e('0x29')]});if(_0x5df3ff){_0x302392[_0x8a5e('0x2a')]=_0x302392[_0x8a5e('0x26')];_['merge'](_0x5df3ff,_[_0x8a5e('0x2b')](_0x302392,[_0x8a5e('0x2c'),_0x8a5e('0x2d'),'username',_0x8a5e('0x26')]));logger['debug'](_0x8a5e('0x2e'),util[_0x8a5e('0x1c')](_0x5df3ff,{'showHidden':![],'depth':null}));this[_0x8a5e('0x23')](util[_0x8a5e('0x2f')](_0x8a5e('0x30'),_0x5df3ff[_0x8a5e('0x31')]),_0x8a5e('0x32'),_0x5df3ff);}}}catch(_0x4a30b6){logger[_0x8a5e('0x1b')](_0x8a5e('0x33'),util['inspect'](_0x4a30b6,{'showHidden':![],'depth':null}));}};UserReport[_0x8a5e('0x20')][_0x8a5e('0x14')]=function(_0xce38e9){try{if(this['isNotNull'](_0xce38e9)){logger[_0x8a5e('0x24')](_0x8a5e('0x34'),_0xce38e9[_0x8a5e('0x35')],_0xce38e9[_0x8a5e('0x26')]);logger[_0x8a5e('0x27')](_0x8a5e('0x36'),util[_0x8a5e('0x1c')](_0xce38e9,{'showHidden':![],'depth':null}));if(this['agents'][_0xce38e9[_0x8a5e('0x35')]]){if(!this[_0x8a5e('0xd')][_0xce38e9['device']][_0x8a5e('0x37')]||_0xce38e9[_0x8a5e('0x26')][_0x8a5e('0x38')]()==_0x8a5e('0x39')){this[_0x8a5e('0xd')][_0xce38e9[_0x8a5e('0x35')]]['local']=![];if(this[_0x8a5e('0xd')][_0xce38e9[_0x8a5e('0x35')]][_0x8a5e('0x26')]!==_0xce38e9[_0x8a5e('0x26')][_0x8a5e('0x38')]()){this[_0x8a5e('0xd')][_0xce38e9[_0x8a5e('0x35')]][_0x8a5e('0x3a')]=_['toNumber'](moment()[_0x8a5e('0x2f')]('x'));}this[_0x8a5e('0xd')][_0xce38e9[_0x8a5e('0x35')]]['state']=_0xce38e9[_0x8a5e('0x26')][_0x8a5e('0x38')]();this['agents'][_0xce38e9['device']]['updateStatusRealtime'](_0xce38e9);}}else if(this[_0x8a5e('0xe')][_0xce38e9[_0x8a5e('0x35')]]){if(this['telephones'][_0xce38e9['device']][_0x8a5e('0x26')]!==_0xce38e9[_0x8a5e('0x26')][_0x8a5e('0x38')]()){this[_0x8a5e('0xe')][_0xce38e9['device']][_0x8a5e('0x3a')]=_[_0x8a5e('0x3b')](moment()[_0x8a5e('0x2f')]('x'));}this[_0x8a5e('0xe')][_0xce38e9[_0x8a5e('0x35')]][_0x8a5e('0x26')]=_0xce38e9[_0x8a5e('0x26')][_0x8a5e('0x38')]();logger[_0x8a5e('0x27')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x8a5e('0x1c')](this['telephones'][_0xce38e9[_0x8a5e('0x35')]],{'showHidden':![],'depth':null}));this[_0x8a5e('0x23')](util[_0x8a5e('0x2f')](_0x8a5e('0x3c'),this['telephones'][_0xce38e9[_0x8a5e('0x35')]][_0x8a5e('0x31')]),'telephone:save',this[_0x8a5e('0xe')][_0xce38e9[_0x8a5e('0x35')]]);}else if(this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]]){if(this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]]['state']!==_0xce38e9[_0x8a5e('0x26')]['toLowerCase']()){this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]]['stateTime']=_[_0x8a5e('0x3b')](moment()[_0x8a5e('0x2f')]('x'));}this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]][_0x8a5e('0x26')]=_0xce38e9[_0x8a5e('0x26')]['toLowerCase']();logger[_0x8a5e('0x27')](_0x8a5e('0x3d'),util['inspect'](this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]],{'showHidden':![],'depth':null}));this[_0x8a5e('0x23')](util[_0x8a5e('0x2f')](_0x8a5e('0x30'),this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]]['name']),_0x8a5e('0x32'),this[_0x8a5e('0xc')][_0xce38e9[_0x8a5e('0x35')]]);}else if(_[_0x8a5e('0x3e')](_0xce38e9['device'],'Local')){var _0x441747=_0xce38e9[_0x8a5e('0x35')];var _0x31d0e6=_0x441747[_0x8a5e('0x3f')](_0x441747['indexOf']('/')+0x1,_0x441747[_0x8a5e('0x40')]('@'));var _0x4973a7=_[_0x8a5e('0x28')](this[_0x8a5e('0xd')],function(_0x2058fc){return _0x2058fc[_0x8a5e('0x41')]==_0x31d0e6||_0x2058fc['phone']==_0x31d0e6||_0x2058fc['accountcode']==_0x31d0e6;});if(_0x4973a7){if(_0x4973a7[_0x8a5e('0x26')]!==_0xce38e9[_0x8a5e('0x26')]['toLowerCase']()){_0x4973a7[_0x8a5e('0x3a')]=_[_0x8a5e('0x3b')](moment()['format']('x'));}_0x4973a7[_0x8a5e('0x26')]=_0xce38e9[_0x8a5e('0x26')]['toLowerCase']();_0x4973a7[_0x8a5e('0x37')]=!![];_0x4973a7[_0x8a5e('0x42')](_0xce38e9);}}}}catch(_0xbd0e7b){logger[_0x8a5e('0x1b')]('[userReport][devicestatechange]',util['inspect'](_0xbd0e7b,{'showHidden':![],'depth':null}));}};UserReport[_0x8a5e('0x20')][_0x8a5e('0x15')]=function(_0x4da91d){try{if(this[_0x8a5e('0x21')](_0x4da91d)&&this[_0x8a5e('0x21')](_0x4da91d['peerstatus'])){logger[_0x8a5e('0x24')](_0x8a5e('0x43'),_0x4da91d[_0x8a5e('0x44')],_0x4da91d[_0x8a5e('0x45')],_0x4da91d[_0x8a5e('0x46')]);logger[_0x8a5e('0x27')](_0x8a5e('0x47'),util[_0x8a5e('0x1c')](_0x4da91d,{'showHidden':![],'depth':null}));if(this[_0x8a5e('0xd')][_0x4da91d[_0x8a5e('0x44')]]){if(!this['agents'][_0x4da91d[_0x8a5e('0x44')]]['local']||_0x4da91d['peerstatus'][_0x8a5e('0x38')]()==_0x8a5e('0x48')){this['agents'][_0x4da91d['peer']][_0x8a5e('0x37')]=![];this[_0x8a5e('0xd')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x49')]=_0x4da91d[_0x8a5e('0x46')][_0x8a5e('0x38')]();this['agents'][_0x4da91d[_0x8a5e('0x44')]]['address']=_0x4da91d[_0x8a5e('0x45')];this['agents'][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x42')](_0x4da91d);}}else if(this[_0x8a5e('0xe')][_0x4da91d[_0x8a5e('0x44')]]){this[_0x8a5e('0xe')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x49')]=_0x4da91d['peerstatus'][_0x8a5e('0x38')]();this[_0x8a5e('0xe')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x45')]=_0x4da91d[_0x8a5e('0x45')];logger['debug'](_0x8a5e('0x4a'),util[_0x8a5e('0x1c')](this[_0x8a5e('0xe')][_0x4da91d[_0x8a5e('0x44')]],{'showHidden':![],'depth':null}));this[_0x8a5e('0x23')](util[_0x8a5e('0x2f')](_0x8a5e('0x3c'),this[_0x8a5e('0xe')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x31')]),_0x8a5e('0x4b'),this['telephones'][_0x4da91d[_0x8a5e('0x44')]]);}else if(this[_0x8a5e('0xc')][_0x4da91d['peer']]){this[_0x8a5e('0xc')][_0x4da91d['peer']][_0x8a5e('0x49')]=_0x4da91d[_0x8a5e('0x46')][_0x8a5e('0x38')]();this[_0x8a5e('0xc')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x45')]=_0x4da91d[_0x8a5e('0x45')];logger['debug'](_0x8a5e('0x4c'),util[_0x8a5e('0x1c')](this[_0x8a5e('0xc')][_0x4da91d[_0x8a5e('0x44')]],{'showHidden':![],'depth':null}));this[_0x8a5e('0x23')](util[_0x8a5e('0x2f')]('trunk:%s',this[_0x8a5e('0xc')][_0x4da91d[_0x8a5e('0x44')]][_0x8a5e('0x31')]),'trunk:save',this[_0x8a5e('0xc')][_0x4da91d['peer']]);}}}catch(_0x562497){logger[_0x8a5e('0x1b')](_0x8a5e('0x47'),util[_0x8a5e('0x1c')](_0x562497,{'showHidden':![],'depth':null}));}};module[_0x8a5e('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 536d547..2fb1586 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 _0x9001=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../ami','defaults','redis','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','isNotNull','isUndefined','prototype','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','debug','uniqueid','inspect','interface','destuniqueid','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','merge','pick','destconnectedlinenum','exten','custom:agentconnect','user:%s','agentringnoanswer','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','agentringnoanswerAt','rejected','name','custom:agentringnoanswer','assign','[%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','agent','talktime','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged'];(function(_0x491903,_0x376417){var _0x193d8d=function(_0x1666ac){while(--_0x1666ac){_0x491903['push'](_0x491903['shift']());}};_0x193d8d(++_0x376417);}(_0x9001,0xc1));var _0x1900=function(_0x44cb8b,_0x6e47f9){_0x44cb8b=_0x44cb8b-0x0;var _0x3a1e11=_0x9001[_0x44cb8b];return _0x3a1e11;};'use strict';var _=require(_0x1900('0x0'));var moment=require('moment');var util=require(_0x1900('0x1'));var Redis=require(_0x1900('0x2'));var config=require(_0x1900('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x1900('0x4'));config['redis']=_[_0x1900('0x5')](config[_0x1900('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1900('0x7'))(new Redis(config['redis']));function VoiceAgentReport(_0x4dc136){this['channels']={};this[_0x1900('0x8')]=_0x4dc136[_0x1900('0x9')];this['voiceQueues']=_0x4dc136[_0x1900('0xa')];this[_0x1900('0xb')]=_0x4dc136[_0x1900('0xb')];this[_0x1900('0xc')]={};ami['on'](_0x1900('0xd'),this[_0x1900('0xe')][_0x1900('0xf')](this));ami['on'](_0x1900('0x10'),this[_0x1900('0x11')][_0x1900('0xf')](this));ami['on']('agentringnoanswer',this[_0x1900('0x12')][_0x1900('0xf')](this));ami['on']('queuecallerabandon',this[_0x1900('0x13')][_0x1900('0xf')](this));ami['on'](_0x1900('0x14'),this[_0x1900('0x15')][_0x1900('0xf')](this));ami['on']('varset',this[_0x1900('0x16')]['bind'](this));ami['on']('hangup',this[_0x1900('0x17')][_0x1900('0xf')](this));ami['on'](_0x1900('0x18'),this[_0x1900('0x19')][_0x1900('0xf')](this));ami['on'](_0x1900('0x1a'),this[_0x1900('0x1b')][_0x1900('0xf')](this));ami['on'](_0x1900('0x1c'),this[_0x1900('0x1d')][_0x1900('0xf')](this));ami['on'](_0x1900('0x1e'),this[_0x1900('0x1f')]['bind'](this));}VoiceAgentReport['prototype'][_0x1900('0x20')]=function(_0x5ab497,_0x425154,_0x3f4d63){io['to'](_0x5ab497)[_0x1900('0x20')](_0x425154,_0x3f4d63);};VoiceAgentReport['prototype'][_0x1900('0x21')]=function(_0x28a591){return _0x28a591!==null&&!_[_0x1900('0x22')](_0x28a591);};VoiceAgentReport[_0x1900('0x23')]['syncAgentCalled']=function(_0xcbcffe){try{if(this[_0x1900('0x21')](_0xcbcffe)){logger[_0x1900('0x24')](_0x1900('0x25'),_0xcbcffe['uniqueid'],_0xcbcffe['membername'],_0xcbcffe['destuniqueid']);logger[_0x1900('0x26')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0xcbcffe[_0x1900('0x27')],util[_0x1900('0x28')](_0xcbcffe,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0xcbcffe[_0x1900('0x27')]])){this[_0x1900('0x9')][_0xcbcffe[_0x1900('0x27')]]={};}var _0xb3940c=this[_0x1900('0xb')][_0xcbcffe[_0x1900('0x29')]];var _0x40c135=this[_0x1900('0x9')][_0xcbcffe[_0x1900('0x27')]][_0xcbcffe[_0x1900('0x2a')]];var _0x58b67f=this[_0x1900('0xa')][_0xcbcffe[_0x1900('0x2b')]];var _0x4c7e92=this['variables'][_0xcbcffe['uniqueid']];if(_[_0x1900('0x22')](_0x40c135)){_0x40c135={'agentcalledAt':moment()['format'](_0x1900('0x2c')),'lastevent':_0x1900('0x2d'),'mandatoryDisposition':_0x58b67f&&_0x58b67f[_0x1900('0x2e')]?_0x58b67f['mandatoryDisposition']:![],'type':_0x58b67f&&_0x58b67f[_0x1900('0x2f')]?_0x58b67f['type']:'inbound','variables':_0x4c7e92,'motionChannel':'voice'};}Object['assign'](_0x40c135,_[_0x1900('0x30')](_0xcbcffe,[_0x1900('0x31'),_0x1900('0x32')]));this[_0x1900('0x9')][_0xcbcffe['uniqueid']][_0xcbcffe['destuniqueid']]=_0x40c135;logger[_0x1900('0x26')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0xcbcffe['uniqueid'],util[_0x1900('0x28')](_0x40c135,{'showHidden':![],'depth':null}));ami[_0x1900('0x20')]('custom:agentcalled',_0x40c135);var _0x2ab7c4={'id':_0xb3940c['id'],'calleridnum':_0x40c135['calleridnum'],'queue':_0x40c135['queue'],'variables':_0x40c135['variables'],'uniqueid':_0xcbcffe['uniqueid']};logger[_0x1900('0x26')](_0x1900('0x33'),_0xcbcffe['uniqueid'],util[_0x1900('0x28')](_0x2ab7c4,{'showHidden':![],'depth':null}));this[_0x1900('0x20')](util[_0x1900('0x34')]('user:%s',_0xcbcffe[_0x1900('0x35')]),_0x1900('0x36'),_0x2ab7c4);}}catch(_0x3a914b){logger[_0x1900('0x37')](_0x1900('0x38'),_0xcbcffe[_0x1900('0x27')],util['inspect'](_0x3a914b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')]['syncAgentConnect']=function(_0x3aa2ab){try{if(this['isNotNull'](_0x3aa2ab)){if(this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]]){for(var _0x5b30f4 in this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]]){if(this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x1900('0x39')](_0x5b30f4)){if(_0x3aa2ab[_0x1900('0x2a')]===_0x5b30f4){logger[_0x1900('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x3aa2ab[_0x1900('0x27')],_0x3aa2ab[_0x1900('0x35')],_0x3aa2ab[_0x1900('0x2a')]);this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x3a')]=moment()[_0x1900('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x3b')]=_0x3aa2ab[_0x1900('0x3b')];this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x3c')]=_0x3aa2ab[_0x1900('0x3c')];this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x3d')]=_0x3aa2ab[_0x1900('0x3d')];this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['destchannelstatedesc']=_0x3aa2ab[_0x1900('0x3e')];this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['holdtime']=_0x3aa2ab[_0x1900('0x3f')];this['channels'][_0x3aa2ab['uniqueid']][_0x5b30f4][_0x1900('0x40')]='connect';if(this['voiceChannels'][this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['uniqueid']]){var _0x317aa9=this[_0x1900('0x8')][this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x27')]][_0x1900('0x41')];this['channels'][_0x3aa2ab['uniqueid']][_0x5b30f4][_0x1900('0x41')]=_0x317aa9;_0x3aa2ab[_0x1900('0x41')]=_0x317aa9;}_[_0x1900('0x42')](this[_0x1900('0xb')][_0x3aa2ab[_0x1900('0x29')]],_[_0x1900('0x43')](_0x3aa2ab,[_0x1900('0x2b'),_0x1900('0x44'),_0x1900('0x41')]));var _0xe17a23=this['agents'][_0x3aa2ab[_0x1900('0x29')]];var _0x565e82={'id':_0xe17a23['id'],'name':_0xe17a23['name'],'agentconnected':!![],'destaccountcode':_0xe17a23['accountcode'],'destconnectedlinenum':this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x3aa2ab['destuniqueid']][_0x1900('0x45')],'queue':this[_0x1900('0x9')][_0x3aa2ab['uniqueid']][_0x3aa2ab[_0x1900('0x2a')]]['queue'],'routealias':this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x3aa2ab['destuniqueid']][_0x1900('0x41')],'uniqueid':this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x3aa2ab['destuniqueid']][_0x1900('0x27')]};ami['emit'](_0x1900('0x46'),this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x3aa2ab[_0x1900('0x2a')]]);this[_0x1900('0x20')](util[_0x1900('0x34')](_0x1900('0x47'),_0x3aa2ab[_0x1900('0x35')]),'user:agentconnect',_0x565e82);}else if(!this[_0x1900('0x9')][_0x3aa2ab['uniqueid']][_0x5b30f4][_0x1900('0x48')]&&!this['channels'][_0x3aa2ab['uniqueid']][_0x5b30f4]['agentcomplete']){logger[_0x1900('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x3aa2ab[_0x1900('0x27')],this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x35')],_0x5b30f4);this[_0x1900('0x9')][_0x3aa2ab['uniqueid']][_0x5b30f4][_0x1900('0x48')]=!![];this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['agentringnoanswerAt']=moment()['format'](_0x1900('0x2c'));this[_0x1900('0x9')][_0x3aa2ab['uniqueid']][_0x5b30f4][_0x1900('0x49')]=_0x3aa2ab[_0x1900('0x2a')];this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['answeredelsewheremembername']=_0x3aa2ab['membername'];this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]['lastevent']=_0x1900('0x4a');this['channels'][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4][_0x1900('0x4b')]=_0x1900('0x4a');logger[_0x1900('0x26')](_0x1900('0x4c'),_0x3aa2ab[_0x1900('0x27')],util[_0x1900('0x28')](this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4],{'showHidden':![],'depth':null}));ami['emit'](_0x1900('0x4d'),this[_0x1900('0x9')][_0x3aa2ab[_0x1900('0x27')]][_0x5b30f4]);}else{logger[_0x1900('0x26')](_0x1900('0x4e'),_0x3aa2ab[_0x1900('0x27')]);}}}}}}catch(_0x19173e){logger[_0x1900('0x37')](_0x1900('0x4f'),_0x3aa2ab[_0x1900('0x27')],util[_0x1900('0x28')](_0x19173e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')][_0x1900('0x12')]=function(_0x510a1a){try{if(this[_0x1900('0x21')](_0x510a1a)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x510a1a[_0x1900('0x27')],util['inspect'](_0x510a1a,{'showHidden':![],'depth':null}));if(this[_0x1900('0x9')][_0x510a1a[_0x1900('0x27')]]&&this[_0x1900('0x9')][_0x510a1a[_0x1900('0x27')]][_0x510a1a[_0x1900('0x2a')]]){logger[_0x1900('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x510a1a[_0x1900('0x27')],_0x510a1a[_0x1900('0x35')],_0x510a1a[_0x1900('0x2a')]);var _0x381764=this[_0x1900('0xb')][_0x510a1a[_0x1900('0x29')]];var _0x5bf59b=this[_0x1900('0x9')][_0x510a1a[_0x1900('0x27')]][_0x510a1a['destuniqueid']];_0x5bf59b[_0x1900('0x48')]=!![];_0x5bf59b[_0x1900('0x50')]=moment()['format'](_0x1900('0x2c'));_0x5bf59b[_0x1900('0x40')]='rejected';_0x5bf59b[_0x1900('0x4b')]=_0x1900('0x51');var _0x18bd81={'id':_0x381764['id'],'name':_0x381764[_0x1900('0x52')],'queue':_0x5bf59b[_0x1900('0x2b')],'uniqueid':_0x5bf59b['uniqueid']};logger[_0x1900('0x26')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x510a1a['uniqueid'],util[_0x1900('0x28')](_0x18bd81,{'showHidden':![],'depth':null}));this[_0x1900('0x20')](util[_0x1900('0x34')](_0x1900('0x47'),_0x381764[_0x1900('0x52')]),'user:agentringnoanswer',_0x18bd81);ami[_0x1900('0x20')](_0x1900('0x53'),_0x5bf59b);this[_0x1900('0x9')][_0x510a1a['uniqueid']][_0x510a1a[_0x1900('0x2a')]]=Object[_0x1900('0x54')]({},_0x5bf59b);}}}catch(_0x121d4a){logger[_0x1900('0x37')]('[%s][voiceAgentReport][agentringnoanswer]',_0x510a1a[_0x1900('0x27')],util[_0x1900('0x28')](_0x121d4a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')][_0x1900('0x13')]=function(_0x38b31b){try{if(this[_0x1900('0x21')](_0x38b31b)){logger[_0x1900('0x26')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x38b31b[_0x1900('0x27')],util[_0x1900('0x28')](_0x38b31b,{'showHidden':![],'depth':null}));if(this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]]){for(var _0x49a16a in this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]]){if(this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]][_0x1900('0x39')](_0x49a16a)&&!this['channels'][_0x38b31b[_0x1900('0x27')]][_0x49a16a][_0x1900('0x48')]&&!this[_0x1900('0x9')][_0x38b31b['uniqueid']][_0x49a16a][_0x1900('0x14')]){logger[_0x1900('0x24')](_0x1900('0x55'),_0x38b31b[_0x1900('0x27')],this['channels'][_0x38b31b[_0x1900('0x27')]][_0x49a16a][_0x1900('0x35')],_0x49a16a);this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]][_0x49a16a][_0x1900('0x48')]=!![];this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]][_0x49a16a][_0x1900('0x50')]=moment()[_0x1900('0x34')](_0x1900('0x2c'));this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]][_0x49a16a]['lastevent']='abandoned';this['channels'][_0x38b31b[_0x1900('0x27')]][_0x49a16a]['reason']=_0x1900('0x56');logger[_0x1900('0x26')](_0x1900('0x57'),_0x38b31b[_0x1900('0x27')],util['inspect'](this[_0x1900('0x9')][_0x38b31b[_0x1900('0x27')]][_0x49a16a],{'showHidden':![],'depth':null}));ami[_0x1900('0x20')](_0x1900('0x58'),this['channels'][_0x38b31b['uniqueid']][_0x49a16a]);}}}}}catch(_0x2500f4){logger[_0x1900('0x37')](_0x1900('0x59'),_0x38b31b[_0x1900('0x27')],util[_0x1900('0x28')](_0x2500f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x5ac5af){try{if(this[_0x1900('0x21')](_0x5ac5af)){logger['debug'](_0x1900('0x5a'),_0x5ac5af[_0x1900('0x27')],util[_0x1900('0x28')](_0x5ac5af,{'showHidden':![],'depth':null}));if(this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]]){for(var _0x19c215 in this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]]){if(this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]]['hasOwnProperty'](_0x19c215)){if(this[_0x1900('0x9')][_0x5ac5af['uniqueid']][_0x19c215][_0x1900('0x3a')]&&!this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]][_0x19c215][_0x1900('0x14')]){logger['info'](_0x1900('0x5b'),_0x5ac5af[_0x1900('0x27')],this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]][_0x19c215]['membername'],_0x19c215);this['channels'][_0x5ac5af[_0x1900('0x27')]][_0x19c215]['agentcomplete']=!![];this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]][_0x19c215][_0x1900('0x5c')]=moment()[_0x1900('0x34')](_0x1900('0x2c'));this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]][_0x19c215][_0x1900('0x40')]=_0x1900('0x5d');this[_0x1900('0x9')][_0x5ac5af['uniqueid']][_0x19c215][_0x1900('0x4b')]=_0x5ac5af[_0x1900('0x4b')]==_0x1900('0x5e')?_0x1900('0x5f'):_0x5ac5af[_0x1900('0x4b')];this['channels'][_0x5ac5af[_0x1900('0x27')]][_0x19c215][_0x1900('0x60')]=_0x5ac5af[_0x1900('0x60')];if(this[_0x1900('0xa')][_0x5ac5af[_0x1900('0x2b')]]&&this['voiceQueues'][_0x5ac5af[_0x1900('0x2b')]]['acw']){this[_0x1900('0x9')][_0x5ac5af['uniqueid']][_0x19c215][_0x1900('0x61')]=this[_0x1900('0xa')][_0x5ac5af[_0x1900('0x2b')]][_0x1900('0x62')];this['channels'][_0x5ac5af[_0x1900('0x27')]][_0x19c215]['agentacw']=!![];}this[_0x1900('0xb')][_0x5ac5af[_0x1900('0x29')]]=_[_0x1900('0x30')](this['agents'][_0x5ac5af['interface']],[_0x1900('0x2b'),_0x1900('0x44')]);logger[_0x1900('0x26')](_0x1900('0x63'),_0x5ac5af[_0x1900('0x27')],util[_0x1900('0x28')](this[_0x1900('0x9')][_0x5ac5af[_0x1900('0x27')]][_0x19c215],{'showHidden':![],'depth':null}));ami[_0x1900('0x20')](_0x1900('0x64'),this[_0x1900('0x9')][_0x5ac5af['uniqueid']][_0x19c215]);logger[_0x1900('0x26')](_0x1900('0x65'),_0x5ac5af['uniqueid'],util[_0x1900('0x28')]({'id':this[_0x1900('0xb')][_0x5ac5af[_0x1900('0x29')]]['id'],'destaccountcode':_0x5ac5af[_0x1900('0x66')]},{'showHidden':![],'depth':null}));this[_0x1900('0x20')](util[_0x1900('0x34')](_0x1900('0x47'),_0x5ac5af[_0x1900('0x35')]),'user:agentcomplete',{'id':this[_0x1900('0xb')][_0x5ac5af[_0x1900('0x29')]]['id'],'destaccountcode':Number(_0x5ac5af['destaccountcode'])});}}}}}}catch(_0x11ee5d){logger[_0x1900('0x37')](_0x1900('0x67'),_0x5ac5af[_0x1900('0x27')],util[_0x1900('0x28')](_0x11ee5d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')]['syncVarSet']=function(_0x12330a){try{if(this['isNotNull'](_0x12330a)){logger[_0x1900('0x26')](_0x1900('0x68'),_0x12330a[_0x1900('0x27')],util[_0x1900('0x28')](_0x12330a,{'showHidden':![],'depth':null}));this[_0x1900('0x69')](_0x12330a[_0x1900('0x27')],_[_0x1900('0x6a')](_0x12330a[_0x1900('0x6b')])[0x0],_0x12330a[_0x1900('0x6c')]);if(this[_0x1900('0x9')][_0x12330a[_0x1900('0x27')]]){for(var _0x25e8e1 in this['channels'][_0x12330a[_0x1900('0x27')]]){if(this['channels'][_0x12330a[_0x1900('0x27')]][_0x1900('0x39')](_0x25e8e1)){logger['info'](_0x1900('0x6d'),_0x12330a[_0x1900('0x27')],_0x25e8e1,_[_0x1900('0x6a')](_0x12330a[_0x1900('0x6b')])[0x0],_0x12330a[_0x1900('0x6c')]);if(_[_0x1900('0x22')](this[_0x1900('0x9')][_0x12330a[_0x1900('0x27')]][_0x25e8e1][_0x1900('0xc')])){this[_0x1900('0x9')][_0x12330a['uniqueid']][_0x25e8e1][_0x1900('0xc')]={};}this['channels'][_0x12330a[_0x1900('0x27')]][_0x25e8e1][_0x1900('0xc')]=this[_0x1900('0xc')][_0x12330a[_0x1900('0x27')]];}}}}}catch(_0x2adca){logger['error']('[%s][voiceAgentReport][varset]',_0x12330a[_0x1900('0x27')],util[_0x1900('0x28')](_0x2adca,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')]['addVariable']=function(_0x2a04d8,_0x52a54d,_0x27bcd0){var _0x5b8622=['rtpaudioqos',_0x1900('0x6e'),_0x1900('0x6f'),_0x1900('0x70'),_0x1900('0x71'),'rtpaudioqoslossbridged',_0x1900('0x72'),_0x1900('0x73'),'sipcallid',_0x1900('0x74'),_0x1900('0x75'),_0x1900('0x76'),_0x1900('0x77'),_0x1900('0x78'),_0x1900('0x79'),_0x1900('0x7a'),_0x1900('0x35'),_0x1900('0x7b'),_0x1900('0x7c')];if(!_[_0x1900('0x7d')](_0x52a54d)&&!_[_0x1900('0x7e')](_0x5b8622,_0x52a54d)){if(_[_0x1900('0x22')](this[_0x1900('0xc')][_0x2a04d8])){this[_0x1900('0xc')][_0x2a04d8]={};}this[_0x1900('0xc')][_0x2a04d8][_0x52a54d]=_0x27bcd0;}};VoiceAgentReport[_0x1900('0x23')][_0x1900('0x17')]=function(_0x3a5f0a){try{if(this[_0x1900('0x21')](_0x3a5f0a)){logger[_0x1900('0x26')](_0x1900('0x7f'),_0x3a5f0a[_0x1900('0x27')],util[_0x1900('0x28')](_0x3a5f0a,{'showHidden':![],'depth':null}));if(this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]]){for(var _0x400d60 in this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]]){if(this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]][_0x1900('0x39')](_0x400d60)){if(this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]][_0x400d60][_0x1900('0x4b')]==_0x1900('0x5e')&&this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]][_0x400d60]['agentcomplete']){logger['info'](_0x1900('0x80'),_0x3a5f0a[_0x1900('0x27')],_0x400d60);this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]][_0x400d60][_0x1900('0x5c')]=moment()[_0x1900('0x34')](_0x1900('0x2c'));}}}logger[_0x1900('0x26')](_0x1900('0x81'),_0x3a5f0a[_0x1900('0x27')],util['inspect'](_['values'](this[_0x1900('0x9')][_0x3a5f0a['uniqueid']]),{'showHidden':![],'depth':null}));ami['emit'](_0x1900('0x82'),_['values'](this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]]));delete this[_0x1900('0x9')][_0x3a5f0a[_0x1900('0x27')]];}if(this[_0x1900('0xc')][_0x3a5f0a[_0x1900('0x27')]]){delete this[_0x1900('0xc')][_0x3a5f0a[_0x1900('0x27')]];}}}catch(_0x33d2c3){logger['error']('[%s][voiceAgentReport][hangup]',_0x3a5f0a[_0x1900('0x27')],util[_0x1900('0x28')](_0x33d2c3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1900('0x1d')]=function(_0x5d86ab){try{if(this[_0x1900('0x21')](_0x5d86ab)){logger[_0x1900('0x26')](_0x1900('0x83'),_0x5d86ab[_0x1900('0x27')],util[_0x1900('0x28')](_0x5d86ab,{'showHidden':![],'depth':null}));if(this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x84')]]){for(var _0x4dcd9b in this[_0x1900('0x9')][_0x5d86ab['transfereeuniqueid']]){if(this[_0x1900('0x9')][_0x5d86ab['transfereeuniqueid']][_0x1900('0x39')](_0x4dcd9b)){if(_0x5d86ab[_0x1900('0x85')]===_0x4dcd9b){logger['info'](_0x1900('0x86'),_0x5d86ab[_0x1900('0x27')],this['channels'][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b][_0x1900('0x35')],_0x4dcd9b);var _0x27b4f3=moment();this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b][_0x1900('0x14')]=!![];this['channels'][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b][_0x1900('0x5c')]=moment()[_0x1900('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1900('0x9')][_0x5d86ab['transfereeuniqueid']][_0x4dcd9b][_0x1900('0x40')]=_0x1900('0x5d');this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b][_0x1900('0x4b')]=_0x1900('0x5e');this['channels'][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b]['talktime']=_0x27b4f3[_0x1900('0x87')](this['channels'][_0x5d86ab[_0x1900('0x84')]][_0x4dcd9b][_0x1900('0x3a')],_0x1900('0x88'));}}}}if(this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x89')]]){var _0x381276=this[_0x1900('0x9')][_0x5d86ab['secondtransfereruniqueid']];this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x89')]]=this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x84')]];this[_0x1900('0x9')][_0x5d86ab[_0x1900('0x84')]]=_0x381276;}}}catch(_0x22ee2c){logger[_0x1900('0x37')](_0x1900('0x8a'),_0x5d86ab[_0x1900('0x27')],util[_0x1900('0x28')](_0x22ee2c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')]['syncBlindTransfer']=function(_0x4c2c34){try{if(this['isNotNull'](_0x4c2c34)){logger[_0x1900('0x26')](_0x1900('0x8b'),_0x4c2c34[_0x1900('0x27')],util['inspect'](_0x4c2c34,{'showHidden':![],'depth':null}));if(this['channels'][_0x4c2c34[_0x1900('0x84')]]){for(var _0x364726 in this[_0x1900('0x9')][_0x4c2c34[_0x1900('0x84')]]){if(this[_0x1900('0x9')][_0x4c2c34['transfereeuniqueid']]['hasOwnProperty'](_0x364726)){if(_0x4c2c34[_0x1900('0x8c')]===_0x364726){logger[_0x1900('0x24')](_0x1900('0x8d'),_0x4c2c34[_0x1900('0x27')],this[_0x1900('0x9')][_0x4c2c34[_0x1900('0x84')]][_0x364726][_0x1900('0x35')],_0x364726);var _0x309540=moment();this[_0x1900('0x9')][_0x4c2c34['transfereeuniqueid']][_0x364726]['agentcomplete']=!![];this['channels'][_0x4c2c34[_0x1900('0x84')]][_0x364726][_0x1900('0x5c')]=_0x309540;this[_0x1900('0x9')][_0x4c2c34[_0x1900('0x84')]][_0x364726][_0x1900('0x40')]=_0x1900('0x5d');this['channels'][_0x4c2c34['transfereeuniqueid']][_0x364726][_0x1900('0x4b')]=_0x1900('0x5e');this[_0x1900('0x9')][_0x4c2c34['transfereeuniqueid']][_0x364726][_0x1900('0x60')]=_0x309540[_0x1900('0x87')](this[_0x1900('0x9')][_0x4c2c34['transfereeuniqueid']][_0x364726][_0x1900('0x3a')],_0x1900('0x88'));}}}}}}catch(_0x4f3efc){logger[_0x1900('0x37')](_0x1900('0x8e'),_0x4c2c34[_0x1900('0x27')],util[_0x1900('0x28')](_0x4f3efc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x230528){var _0x36eb84='';try{if(this[_0x1900('0x21')](_0x230528)){logger[_0x1900('0x26')](_0x1900('0x8f'),_0x230528[_0x1900('0x27')],util[_0x1900('0x28')](_0x230528,{'showHidden':![],'depth':null}));if(_0x230528[_0x1900('0x90')]){_0x36eb84=_0x230528[_0x1900('0x90')][_0x1900('0x91')](0x0,_0x230528['channel']['lastIndexOf']('-'));if(this[_0x1900('0xb')][_0x36eb84]){logger[_0x1900('0x24')](_0x1900('0x92'),_0x230528[_0x1900('0x27')],_0x36eb84);this[_0x1900('0xb')][_0x36eb84]['onhold']=!![];}}}}catch(_0x49bcb4){logger[_0x1900('0x37')](_0x1900('0x93'),_0x230528['uniqueid'],util[_0x1900('0x28')](_0x49bcb4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1900('0x23')][_0x1900('0x1b')]=function(_0x24981b){var _0x45b3eb='';try{if(this[_0x1900('0x21')](_0x24981b)){logger[_0x1900('0x26')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x24981b[_0x1900('0x27')],util['inspect'](_0x24981b,{'showHidden':![],'depth':null}));if(_0x24981b[_0x1900('0x90')]){_0x45b3eb=_0x24981b[_0x1900('0x90')][_0x1900('0x91')](0x0,_0x24981b[_0x1900('0x90')]['lastIndexOf']('-'));if(this['agents'][_0x45b3eb]){logger[_0x1900('0x24')](_0x1900('0x94'),_0x24981b[_0x1900('0x27')],_0x45b3eb);this[_0x1900('0xb')][_0x45b3eb][_0x1900('0x95')]=![];}}}}catch(_0x280a78){logger['error'](_0x1900('0x96'),_0x24981b[_0x1900('0x27')],util[_0x1900('0x28')](_0x280a78,{'showHidden':![],'depth':null}));}};module[_0x1900('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x08a9=['mandatoryDisposition','type','inbound','voice','assign','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','inspect','isNotNull','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','holdtime','connect','routealias','merge','interface','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','lastevent','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','talktime','acw','acwtime','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','agentconnectAt','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','prototype','emit','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','isUndefined','queue','format','YYYY-MM-DD\x20HH:mm:ss','called'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x08a9,0x74));var _0x908a=function(_0x247999,_0x8fc29f){_0x247999=_0x247999-0x0;var _0x5e2245=_0x08a9[_0x247999];return _0x5e2245;};'use strict';var _=require(_0x908a('0x0'));var moment=require(_0x908a('0x1'));var util=require(_0x908a('0x2'));var Redis=require(_0x908a('0x3'));var config=require(_0x908a('0x4'));var logger=require(_0x908a('0x5'))(_0x908a('0x6'));var ami=require(_0x908a('0x7'));config['redis']=_['defaults'](config[_0x908a('0x8')],{'host':_0x908a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x908a('0x8')]));function VoiceAgentReport(_0x5f1882){this['channels']={};this[_0x908a('0xa')]=_0x5f1882[_0x908a('0xb')];this['voiceQueues']=_0x5f1882[_0x908a('0xc')];this[_0x908a('0xd')]=_0x5f1882['agents'];this[_0x908a('0xe')]={};ami['on'](_0x908a('0xf'),this[_0x908a('0x10')][_0x908a('0x11')](this));ami['on'](_0x908a('0x12'),this[_0x908a('0x13')]['bind'](this));ami['on'](_0x908a('0x14'),this[_0x908a('0x15')][_0x908a('0x11')](this));ami['on'](_0x908a('0x16'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x908a('0x17'),this[_0x908a('0x18')][_0x908a('0x11')](this));ami['on']('varset',this['syncVarSet'][_0x908a('0x11')](this));ami['on']('hangup',this[_0x908a('0x19')][_0x908a('0x11')](this));ami['on'](_0x908a('0x1a'),this[_0x908a('0x1b')][_0x908a('0x11')](this));ami['on'](_0x908a('0x1c'),this[_0x908a('0x1d')][_0x908a('0x11')](this));ami['on'](_0x908a('0x1e'),this['syncAttendedTransfer'][_0x908a('0x11')](this));ami['on']('blindtransfer',this[_0x908a('0x1f')][_0x908a('0x11')](this));}VoiceAgentReport[_0x908a('0x20')][_0x908a('0x21')]=function(_0x4e7b82,_0x3d2d5d,_0x33f5ab){io['to'](_0x4e7b82)[_0x908a('0x21')](_0x3d2d5d,_0x33f5ab);};VoiceAgentReport[_0x908a('0x20')]['isNotNull']=function(_0x2a6c30){return _0x2a6c30!==null&&!_['isUndefined'](_0x2a6c30);};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x10')]=function(_0x404a50){try{if(this['isNotNull'](_0x404a50)){logger[_0x908a('0x22')](_0x908a('0x23'),_0x404a50['uniqueid'],_0x404a50[_0x908a('0x24')],_0x404a50[_0x908a('0x25')]);logger[_0x908a('0x26')](_0x908a('0x27'),_0x404a50[_0x908a('0x28')],util['inspect'](_0x404a50,{'showHidden':![],'depth':null}));if(_[_0x908a('0x29')](this[_0x908a('0xb')][_0x404a50[_0x908a('0x28')]])){this[_0x908a('0xb')][_0x404a50[_0x908a('0x28')]]={};}var _0x35df34=this[_0x908a('0xd')][_0x404a50['interface']];var _0x2f6b94=this[_0x908a('0xb')][_0x404a50[_0x908a('0x28')]][_0x404a50[_0x908a('0x25')]];var _0x39d3de=this[_0x908a('0xc')][_0x404a50[_0x908a('0x2a')]];var _0x296fc1=this[_0x908a('0xe')][_0x404a50[_0x908a('0x28')]];if(_[_0x908a('0x29')](_0x2f6b94)){_0x2f6b94={'agentcalledAt':moment()[_0x908a('0x2b')](_0x908a('0x2c')),'lastevent':_0x908a('0x2d'),'mandatoryDisposition':_0x39d3de&&_0x39d3de[_0x908a('0x2e')]?_0x39d3de[_0x908a('0x2e')]:![],'type':_0x39d3de&&_0x39d3de[_0x908a('0x2f')]?_0x39d3de['type']:_0x908a('0x30'),'variables':_0x296fc1,'motionChannel':_0x908a('0x31')};}Object[_0x908a('0x32')](_0x2f6b94,_['omit'](_0x404a50,[_0x908a('0x33'),_0x908a('0x34')]));this[_0x908a('0xb')][_0x404a50[_0x908a('0x28')]][_0x404a50['destuniqueid']]=_0x2f6b94;logger[_0x908a('0x26')](_0x908a('0x35'),_0x404a50['uniqueid'],util['inspect'](_0x2f6b94,{'showHidden':![],'depth':null}));ami['emit'](_0x908a('0x36'),_0x2f6b94);var _0x57775b={'id':_0x35df34['id'],'calleridnum':_0x2f6b94[_0x908a('0x37')],'queue':_0x2f6b94[_0x908a('0x2a')],'variables':_0x2f6b94[_0x908a('0xe')],'uniqueid':_0x404a50['uniqueid']};logger[_0x908a('0x26')](_0x908a('0x38'),_0x404a50[_0x908a('0x28')],util['inspect'](_0x57775b,{'showHidden':![],'depth':null}));this[_0x908a('0x21')](util[_0x908a('0x2b')]('user:%s',_0x404a50[_0x908a('0x24')]),_0x908a('0x39'),_0x57775b);}}catch(_0x2ed4be){logger[_0x908a('0x3a')]('[%s][voiceAgentReport][agentcalled]',_0x404a50[_0x908a('0x28')],util[_0x908a('0x3b')](_0x2ed4be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x13')]=function(_0x4a9beb){try{if(this[_0x908a('0x3c')](_0x4a9beb)){if(this[_0x908a('0xb')][_0x4a9beb['uniqueid']]){for(var _0x23710f in this['channels'][_0x4a9beb[_0x908a('0x28')]]){if(this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x908a('0x3d')](_0x23710f)){if(_0x4a9beb[_0x908a('0x25')]===_0x23710f){logger['info'](_0x908a('0x3e'),_0x4a9beb[_0x908a('0x28')],_0x4a9beb[_0x908a('0x24')],_0x4a9beb['destuniqueid']);this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x23710f]['agentconnectAt']=moment()['format'](_0x908a('0x2c'));this['channels'][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x3f')]=_0x4a9beb[_0x908a('0x3f')];this['channels'][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x40')]=_0x4a9beb['connectedlinenum'];this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x41')]=_0x4a9beb[_0x908a('0x41')];this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x23710f]['destchannelstatedesc']=_0x4a9beb['destchannelstatedesc'];this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x42')]=_0x4a9beb[_0x908a('0x42')];this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x23710f]['lastevent']=_0x908a('0x43');if(this[_0x908a('0xa')][this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x28')]]){var _0x52be36=this[_0x908a('0xa')][this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x28')]][_0x908a('0x44')];this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x23710f][_0x908a('0x44')]=_0x52be36;_0x4a9beb[_0x908a('0x44')]=_0x52be36;}_[_0x908a('0x45')](this[_0x908a('0xd')][_0x4a9beb[_0x908a('0x46')]],_[_0x908a('0x47')](_0x4a9beb,[_0x908a('0x2a'),_0x908a('0x48'),_0x908a('0x44')]));var _0x4b9992=this['agents'][_0x4a9beb['interface']];var _0x5cba27={'id':_0x4b9992['id'],'name':_0x4b9992[_0x908a('0x49')],'agentconnected':!![],'destaccountcode':_0x4b9992[_0x908a('0x4a')],'destconnectedlinenum':this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x4a9beb[_0x908a('0x25')]][_0x908a('0x4b')],'queue':this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x4a9beb[_0x908a('0x25')]]['queue'],'routealias':this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x4a9beb[_0x908a('0x25')]][_0x908a('0x44')],'uniqueid':this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x4a9beb[_0x908a('0x25')]]['uniqueid']};ami['emit'](_0x908a('0x4c'),this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x4a9beb[_0x908a('0x25')]]);this[_0x908a('0x21')](util[_0x908a('0x2b')](_0x908a('0x4d'),_0x4a9beb['membername']),_0x908a('0x4e'),_0x5cba27);}else if(!this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x14')]&&!this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f]['agentcomplete']){logger['info'](_0x908a('0x4f'),_0x4a9beb['uniqueid'],this[_0x908a('0xb')][_0x4a9beb['uniqueid']][_0x23710f][_0x908a('0x24')],_0x23710f);this['channels'][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x14')]=!![];this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x50')]=moment()[_0x908a('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f]['answeredelsewheredestinationuniqueid']=_0x4a9beb['destuniqueid'];this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x51')]=_0x4a9beb['membername'];this['channels'][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x52')]='answered_elsewhere';this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f][_0x908a('0x53')]='answered_elsewhere';logger[_0x908a('0x26')](_0x908a('0x54'),_0x4a9beb['uniqueid'],util[_0x908a('0x3b')](this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f],{'showHidden':![],'depth':null}));ami[_0x908a('0x21')]('custom:agentansweredelsewhere',this[_0x908a('0xb')][_0x4a9beb[_0x908a('0x28')]][_0x23710f]);}else{logger[_0x908a('0x26')](_0x908a('0x55'),_0x4a9beb['uniqueid']);}}}}}}catch(_0x1a8c4c){logger[_0x908a('0x3a')](_0x908a('0x56'),_0x4a9beb[_0x908a('0x28')],util[_0x908a('0x3b')](_0x1a8c4c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x5bec78){try{if(this[_0x908a('0x3c')](_0x5bec78)){logger[_0x908a('0x26')](_0x908a('0x57'),_0x5bec78[_0x908a('0x28')],util[_0x908a('0x3b')](_0x5bec78,{'showHidden':![],'depth':null}));if(this[_0x908a('0xb')][_0x5bec78['uniqueid']]&&this['channels'][_0x5bec78[_0x908a('0x28')]][_0x5bec78[_0x908a('0x25')]]){logger[_0x908a('0x22')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x5bec78[_0x908a('0x28')],_0x5bec78[_0x908a('0x24')],_0x5bec78[_0x908a('0x25')]);var _0x4881b4=this[_0x908a('0xd')][_0x5bec78[_0x908a('0x46')]];var _0x4a8a95=this[_0x908a('0xb')][_0x5bec78['uniqueid']][_0x5bec78['destuniqueid']];_0x4a8a95[_0x908a('0x14')]=!![];_0x4a8a95[_0x908a('0x50')]=moment()[_0x908a('0x2b')](_0x908a('0x2c'));_0x4a8a95[_0x908a('0x52')]=_0x908a('0x58');_0x4a8a95[_0x908a('0x53')]=_0x908a('0x58');var _0x12ea11={'id':_0x4881b4['id'],'name':_0x4881b4['name'],'queue':_0x4a8a95[_0x908a('0x2a')],'uniqueid':_0x4a8a95[_0x908a('0x28')]};logger[_0x908a('0x26')](_0x908a('0x59'),_0x5bec78['uniqueid'],util[_0x908a('0x3b')](_0x12ea11,{'showHidden':![],'depth':null}));this['emit'](util[_0x908a('0x2b')]('user:%s',_0x4881b4['name']),_0x908a('0x5a'),_0x12ea11);ami[_0x908a('0x21')]('custom:agentringnoanswer',_0x4a8a95);this['channels'][_0x5bec78[_0x908a('0x28')]][_0x5bec78['destuniqueid']]=Object[_0x908a('0x32')]({},_0x4a8a95);}}}catch(_0x3612e6){logger[_0x908a('0x3a')]('[%s][voiceAgentReport][agentringnoanswer]',_0x5bec78[_0x908a('0x28')],util[_0x908a('0x3b')](_0x3612e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x5b')]=function(_0x145272){try{if(this[_0x908a('0x3c')](_0x145272)){logger[_0x908a('0x26')](_0x908a('0x5c'),_0x145272['uniqueid'],util[_0x908a('0x3b')](_0x145272,{'showHidden':![],'depth':null}));if(this[_0x908a('0xb')][_0x145272['uniqueid']]){for(var _0x58973c in this['channels'][_0x145272[_0x908a('0x28')]]){if(this['channels'][_0x145272[_0x908a('0x28')]][_0x908a('0x3d')](_0x58973c)&&!this[_0x908a('0xb')][_0x145272[_0x908a('0x28')]][_0x58973c]['agentringnoanswer']&&!this[_0x908a('0xb')][_0x145272[_0x908a('0x28')]][_0x58973c][_0x908a('0x17')]){logger[_0x908a('0x22')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x145272[_0x908a('0x28')],this[_0x908a('0xb')][_0x145272['uniqueid']][_0x58973c]['membername'],_0x58973c);this[_0x908a('0xb')][_0x145272[_0x908a('0x28')]][_0x58973c][_0x908a('0x14')]=!![];this['channels'][_0x145272[_0x908a('0x28')]][_0x58973c][_0x908a('0x50')]=moment()['format'](_0x908a('0x2c'));this[_0x908a('0xb')][_0x145272['uniqueid']][_0x58973c][_0x908a('0x52')]=_0x908a('0x5d');this[_0x908a('0xb')][_0x145272[_0x908a('0x28')]][_0x58973c][_0x908a('0x53')]=_0x908a('0x5d');logger[_0x908a('0x26')](_0x908a('0x5e'),_0x145272[_0x908a('0x28')],util['inspect'](this[_0x908a('0xb')][_0x145272['uniqueid']][_0x58973c],{'showHidden':![],'depth':null}));ami['emit'](_0x908a('0x5f'),this['channels'][_0x145272['uniqueid']][_0x58973c]);}}}}}catch(_0x272a42){logger[_0x908a('0x3a')](_0x908a('0x60'),_0x145272[_0x908a('0x28')],util[_0x908a('0x3b')](_0x272a42,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x5aaa22){try{if(this[_0x908a('0x3c')](_0x5aaa22)){logger[_0x908a('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5aaa22[_0x908a('0x28')],util[_0x908a('0x3b')](_0x5aaa22,{'showHidden':![],'depth':null}));if(this['channels'][_0x5aaa22['uniqueid']]){for(var _0x1ecb22 in this['channels'][_0x5aaa22[_0x908a('0x28')]]){if(this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x908a('0x3d')](_0x1ecb22)){if(this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22]['agentconnectAt']&&!this['channels'][_0x5aaa22['uniqueid']][_0x1ecb22][_0x908a('0x17')]){logger[_0x908a('0x22')](_0x908a('0x61'),_0x5aaa22[_0x908a('0x28')],this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x24')],_0x1ecb22);this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x17')]=!![];this['channels'][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x62')]=moment()[_0x908a('0x2b')](_0x908a('0x2c'));this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x52')]=_0x908a('0x63');this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x53')]=_0x5aaa22[_0x908a('0x53')]=='transfer'?'agent':_0x5aaa22['reason'];this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x64')]=_0x5aaa22[_0x908a('0x64')];if(this[_0x908a('0xc')][_0x5aaa22[_0x908a('0x2a')]]&&this[_0x908a('0xc')][_0x5aaa22[_0x908a('0x2a')]][_0x908a('0x65')]){this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22][_0x908a('0x66')]=this[_0x908a('0xc')][_0x5aaa22[_0x908a('0x2a')]]['acwTimeout'];this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22]['agentacw']=!![];}this[_0x908a('0xd')][_0x5aaa22['interface']]=_[_0x908a('0x67')](this[_0x908a('0xd')][_0x5aaa22[_0x908a('0x46')]],[_0x908a('0x2a'),_0x908a('0x48')]);logger[_0x908a('0x26')](_0x908a('0x68'),_0x5aaa22['uniqueid'],util['inspect'](this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22],{'showHidden':![],'depth':null}));ami[_0x908a('0x21')](_0x908a('0x69'),this[_0x908a('0xb')][_0x5aaa22[_0x908a('0x28')]][_0x1ecb22]);logger[_0x908a('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5aaa22['uniqueid'],util['inspect']({'id':this[_0x908a('0xd')][_0x5aaa22['interface']]['id'],'destaccountcode':_0x5aaa22[_0x908a('0x6a')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x908a('0x2b')]('user:%s',_0x5aaa22[_0x908a('0x24')]),_0x908a('0x6b'),{'id':this['agents'][_0x5aaa22[_0x908a('0x46')]]['id'],'destaccountcode':Number(_0x5aaa22[_0x908a('0x6a')])});}}}}}}catch(_0x368c8d){logger[_0x908a('0x3a')](_0x908a('0x6c'),_0x5aaa22[_0x908a('0x28')],util['inspect'](_0x368c8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x6d')]=function(_0x48179c){try{if(this[_0x908a('0x3c')](_0x48179c)){logger[_0x908a('0x26')](_0x908a('0x6e'),_0x48179c['uniqueid'],util['inspect'](_0x48179c,{'showHidden':![],'depth':null}));this['addVariable'](_0x48179c[_0x908a('0x28')],_[_0x908a('0x6f')](_0x48179c['variable'])[0x0],_0x48179c[_0x908a('0x70')]);if(this['channels'][_0x48179c['uniqueid']]){for(var _0x317ca8 in this[_0x908a('0xb')][_0x48179c['uniqueid']]){if(this['channels'][_0x48179c[_0x908a('0x28')]][_0x908a('0x3d')](_0x317ca8)){logger['info'](_0x908a('0x71'),_0x48179c['uniqueid'],_0x317ca8,_[_0x908a('0x6f')](_0x48179c[_0x908a('0x72')])[0x0],_0x48179c[_0x908a('0x70')]);if(_[_0x908a('0x29')](this[_0x908a('0xb')][_0x48179c['uniqueid']][_0x317ca8][_0x908a('0xe')])){this[_0x908a('0xb')][_0x48179c[_0x908a('0x28')]][_0x317ca8][_0x908a('0xe')]={};}this[_0x908a('0xb')][_0x48179c['uniqueid']][_0x317ca8][_0x908a('0xe')]=this[_0x908a('0xe')][_0x48179c[_0x908a('0x28')]];}}}}}catch(_0x26f758){logger[_0x908a('0x3a')]('[%s][voiceAgentReport][varset]',_0x48179c[_0x908a('0x28')],util[_0x908a('0x3b')](_0x26f758,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x73')]=function(_0x229b31,_0x474a45,_0x1139a3){var _0xddde7e=[_0x908a('0x74'),'rtpaudioqosbridged',_0x908a('0x75'),_0x908a('0x76'),_0x908a('0x77'),_0x908a('0x78'),_0x908a('0x79'),_0x908a('0x7a'),'sipcallid',_0x908a('0x7b'),_0x908a('0x7c'),_0x908a('0x7d'),_0x908a('0x7e'),_0x908a('0x7f'),_0x908a('0x80'),_0x908a('0x81'),_0x908a('0x24'),'memberpenalty',_0x908a('0x82')];if(!_['isNil'](_0x474a45)&&!_[_0x908a('0x83')](_0xddde7e,_0x474a45)){if(_[_0x908a('0x29')](this['variables'][_0x229b31])){this['variables'][_0x229b31]={};}this['variables'][_0x229b31][_0x474a45]=_0x1139a3;}};VoiceAgentReport['prototype'][_0x908a('0x19')]=function(_0x2c4314){try{if(this['isNotNull'](_0x2c4314)){logger[_0x908a('0x26')]('[%s][voiceAgentReport][hangup]\x20event:',_0x2c4314[_0x908a('0x28')],util[_0x908a('0x3b')](_0x2c4314,{'showHidden':![],'depth':null}));if(this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]]){for(var _0x5d7275 in this['channels'][_0x2c4314['uniqueid']]){if(this['channels'][_0x2c4314[_0x908a('0x28')]][_0x908a('0x3d')](_0x5d7275)){if(this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]][_0x5d7275][_0x908a('0x53')]==_0x908a('0x84')&&this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]][_0x5d7275][_0x908a('0x17')]){logger[_0x908a('0x22')](_0x908a('0x85'),_0x2c4314[_0x908a('0x28')],_0x5d7275);this['channels'][_0x2c4314[_0x908a('0x28')]][_0x5d7275]['agentcompleteAt']=moment()[_0x908a('0x2b')](_0x908a('0x2c'));}}}logger['debug'](_0x908a('0x86'),_0x2c4314[_0x908a('0x28')],util[_0x908a('0x3b')](_[_0x908a('0x87')](this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x908a('0x21')]('custom:voiceAgentReport',_[_0x908a('0x87')](this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]]));delete this[_0x908a('0xb')][_0x2c4314[_0x908a('0x28')]];}if(this[_0x908a('0xe')][_0x2c4314[_0x908a('0x28')]]){delete this[_0x908a('0xe')][_0x2c4314[_0x908a('0x28')]];}}}catch(_0x3cbd74){logger['error'](_0x908a('0x88'),_0x2c4314[_0x908a('0x28')],util[_0x908a('0x3b')](_0x3cbd74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x89')]=function(_0x5d43bc){try{if(this[_0x908a('0x3c')](_0x5d43bc)){logger[_0x908a('0x26')](_0x908a('0x8a'),_0x5d43bc[_0x908a('0x28')],util[_0x908a('0x3b')](_0x5d43bc,{'showHidden':![],'depth':null}));if(this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]]){for(var _0x1a96d6 in this[_0x908a('0xb')][_0x5d43bc['transfereeuniqueid']]){if(this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]]['hasOwnProperty'](_0x1a96d6)){if(_0x5d43bc[_0x908a('0x8c')]===_0x1a96d6){logger[_0x908a('0x22')](_0x908a('0x8d'),_0x5d43bc[_0x908a('0x28')],this[_0x908a('0xb')][_0x5d43bc['transfereeuniqueid']][_0x1a96d6][_0x908a('0x24')],_0x1a96d6);var _0x195782=moment();this[_0x908a('0xb')][_0x5d43bc['transfereeuniqueid']][_0x1a96d6][_0x908a('0x17')]=!![];this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]][_0x1a96d6][_0x908a('0x62')]=moment()[_0x908a('0x2b')](_0x908a('0x2c'));this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]][_0x1a96d6]['lastevent']=_0x908a('0x63');this[_0x908a('0xb')][_0x5d43bc['transfereeuniqueid']][_0x1a96d6]['reason']=_0x908a('0x84');this['channels'][_0x5d43bc['transfereeuniqueid']][_0x1a96d6]['talktime']=_0x195782[_0x908a('0x8e')](this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]][_0x1a96d6][_0x908a('0x8f')],'seconds');}}}}if(this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x90')]]){var _0x453d06=this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x90')]];this['channels'][_0x5d43bc[_0x908a('0x90')]]=this[_0x908a('0xb')][_0x5d43bc[_0x908a('0x8b')]];this['channels'][_0x5d43bc[_0x908a('0x8b')]]=_0x453d06;}}}catch(_0x261a51){logger['error'](_0x908a('0x91'),_0x5d43bc[_0x908a('0x28')],util['inspect'](_0x261a51,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')]['syncBlindTransfer']=function(_0x1157e1){try{if(this[_0x908a('0x3c')](_0x1157e1)){logger[_0x908a('0x26')](_0x908a('0x92'),_0x1157e1['uniqueid'],util[_0x908a('0x3b')](_0x1157e1,{'showHidden':![],'depth':null}));if(this[_0x908a('0xb')][_0x1157e1[_0x908a('0x8b')]]){for(var _0x36c7c1 in this[_0x908a('0xb')][_0x1157e1[_0x908a('0x8b')]]){if(this[_0x908a('0xb')][_0x1157e1[_0x908a('0x8b')]][_0x908a('0x3d')](_0x36c7c1)){if(_0x1157e1[_0x908a('0x93')]===_0x36c7c1){logger[_0x908a('0x22')](_0x908a('0x94'),_0x1157e1[_0x908a('0x28')],this[_0x908a('0xb')][_0x1157e1['transfereeuniqueid']][_0x36c7c1]['membername'],_0x36c7c1);var _0x55eb5f=moment();this[_0x908a('0xb')][_0x1157e1['transfereeuniqueid']][_0x36c7c1]['agentcomplete']=!![];this['channels'][_0x1157e1[_0x908a('0x8b')]][_0x36c7c1]['agentcompleteAt']=_0x55eb5f;this[_0x908a('0xb')][_0x1157e1[_0x908a('0x8b')]][_0x36c7c1][_0x908a('0x52')]=_0x908a('0x63');this[_0x908a('0xb')][_0x1157e1[_0x908a('0x8b')]][_0x36c7c1]['reason']='transfer';this['channels'][_0x1157e1['transfereeuniqueid']][_0x36c7c1][_0x908a('0x64')]=_0x55eb5f[_0x908a('0x8e')](this['channels'][_0x1157e1['transfereeuniqueid']][_0x36c7c1][_0x908a('0x8f')],_0x908a('0x95'));}}}}}}catch(_0x473bfe){logger['error'](_0x908a('0x96'),_0x1157e1[_0x908a('0x28')],util['inspect'](_0x473bfe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x1b')]=function(_0x22467c){var _0x368198='';try{if(this[_0x908a('0x3c')](_0x22467c)){logger[_0x908a('0x26')](_0x908a('0x97'),_0x22467c['uniqueid'],util[_0x908a('0x3b')](_0x22467c,{'showHidden':![],'depth':null}));if(_0x22467c[_0x908a('0x98')]){_0x368198=_0x22467c['channel'][_0x908a('0x99')](0x0,_0x22467c['channel'][_0x908a('0x9a')]('-'));if(this[_0x908a('0xd')][_0x368198]){logger[_0x908a('0x22')](_0x908a('0x9b'),_0x22467c[_0x908a('0x28')],_0x368198);this['agents'][_0x368198][_0x908a('0x9c')]=!![];}}}}catch(_0x41abd4){logger[_0x908a('0x3a')](_0x908a('0x9d'),_0x22467c['uniqueid'],util[_0x908a('0x3b')](_0x41abd4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x908a('0x20')][_0x908a('0x1d')]=function(_0x337f73){var _0xbe372='';try{if(this[_0x908a('0x3c')](_0x337f73)){logger[_0x908a('0x26')](_0x908a('0x9e'),_0x337f73['uniqueid'],util[_0x908a('0x3b')](_0x337f73,{'showHidden':![],'depth':null}));if(_0x337f73[_0x908a('0x98')]){_0xbe372=_0x337f73[_0x908a('0x98')][_0x908a('0x99')](0x0,_0x337f73[_0x908a('0x98')]['lastIndexOf']('-'));if(this[_0x908a('0xd')][_0xbe372]){logger[_0x908a('0x22')](_0x908a('0x9f'),_0x337f73[_0x908a('0x28')],_0xbe372);this[_0x908a('0xd')][_0xbe372][_0x908a('0x9c')]=![];}}}}catch(_0x3a2197){logger['error'](_0x908a('0xa0'),_0x337f73['uniqueid'],util[_0x908a('0x3b')](_0x3a2197,{'showHidden':![],'depth':null}));}};module[_0x908a('0xa1')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 063667b..683fdb7 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 _0xe023=['syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','xmcs-queue','sipcallid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','resolve','then','getSettings','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','BlindTransfer','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','info','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','pick','keys','from-sip','channel','split','exten','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','merge','context','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','seconds','disposition','includes','lastdata','set','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','connectedlinename','destinationchannel','UserId','xcally-motion-preview','membername','routealias','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xe023,0x109));var _0x3e02=function(_0x336983,_0x5b3c9b){_0x336983=_0x336983-0x0;var _0xd46ff0=_0xe023[_0x336983];return _0xd46ff0;};'use strict';var _=require(_0x3e02('0x0'));var moment=require('moment');var util=require(_0x3e02('0x1'));var path=require(_0x3e02('0x2'));var Redis=require(_0x3e02('0x3'));var config=require(_0x3e02('0x4'));var logger=require(_0x3e02('0x5'))(_0x3e02('0x6'));var ami=require(_0x3e02('0x7'));var Channel=require(_0x3e02('0x8'));var RpcSetting=require(_0x3e02('0x9'));var applications=['set',_0x3e02('0xa'),_0x3e02('0xb'),_0x3e02('0xc'),_0x3e02('0xd'),_0x3e02('0xe')];var dispositions=[_0x3e02('0xf'),'FAILED',_0x3e02('0x10'),_0x3e02('0xf'),_0x3e02('0xf'),_0x3e02('0xf'),'ANSWERED',_0x3e02('0x11'),_0x3e02('0x10'),'FAILED',_0x3e02('0x10')];config[_0x3e02('0x12')]=_[_0x3e02('0x13')](config[_0x3e02('0x12')],{'host':'localhost','port':0x18eb});var io=require(_0x3e02('0x14'))(new Redis(config[_0x3e02('0x12')]));function VoiceCallReport(_0x2bee6c){this[_0x3e02('0x15')]=_0x2bee6c[_0x3e02('0x15')];this[_0x3e02('0x16')]=_0x2bee6c[_0x3e02('0x16')];this[_0x3e02('0x17')]={};ami['on'](_0x3e02('0x18'),this[_0x3e02('0x19')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x1b'),this[_0x3e02('0x19')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x1c'),this[_0x3e02('0x1d')]['bind'](this));ami['on'](_0x3e02('0x1e'),this['syncNewState'][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x1f'),this[_0x3e02('0x20')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x21'),this[_0x3e02('0x22')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x23'),this[_0x3e02('0x24')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x25'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x3e02('0x26')][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x27'),this['syncMusicOnHoldStart'][_0x3e02('0x1a')](this));ami['on'](_0x3e02('0x28'),this['syncMusicOnHoldStop'][_0x3e02('0x1a')](this));try{logger[_0x3e02('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x3e02('0x2a')]();}catch(_0x5a778b){logger['error'](_0x3e02('0x2b'),util[_0x3e02('0x2c')](_0x5a778b,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x3e02('0x2d')]=function(_0x31df55){return _0x31df55!==null&&!_['isUndefined'](_0x31df55);};VoiceCallReport[_0x3e02('0x2e')][_0x3e02('0x2f')]=function(_0x45edb3,_0x2b7267,_0x4d6bf8){io['to'](_0x45edb3)['emit'](_0x2b7267,_0x4d6bf8);};VoiceCallReport[_0x3e02('0x2e')][_0x3e02('0x24')]=function(_0x1612c8){try{if(this[_0x3e02('0x2d')](_0x1612c8)){logger['info'](_0x3e02('0x30'),_0x1612c8[_0x3e02('0x31')],_0x1612c8[_0x3e02('0x32')],_0x1612c8[_0x3e02('0x33')]);logger[_0x3e02('0x34')](_0x3e02('0x35'),_0x1612c8[_0x3e02('0x31')],util[_0x3e02('0x2c')](_0x1612c8,{'showHidden':![],'depth':null}));if(_0x1612c8[_0x3e02('0x31')]===_0x1612c8[_0x3e02('0x36')]){if(!_[_0x3e02('0x37')](this['channels'][_0x1612c8[_0x3e02('0x31')]])){_['merge'](this['channels'][_0x1612c8[_0x3e02('0x31')]],_[_0x3e02('0x38')](_0x1612c8,_[_0x3e02('0x39')](this[_0x3e02('0x15')][_0x1612c8['uniqueid']])));}}if(_0x1612c8['context']===_0x3e02('0x3a')){if(this[_0x3e02('0x16')][_0x1612c8[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]]){if(_0x1612c8[_0x3e02('0x3d')]=='xcally-motion-preview'){this[_0x3e02('0x16')][_0x1612c8[_0x3e02('0x3b')]['split']('-')[0x0]][_0x3e02('0x3e')]=_0x1612c8[_0x3e02('0x3f')];this[_0x3e02('0x2f')](util[_0x3e02('0x40')](_0x3e02('0x41'),this['agents'][_0x1612c8[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]][_0x3e02('0x42')]),_0x3e02('0x43'),{'destaccountcode':this[_0x3e02('0x16')][_0x1612c8['channel'][_0x3e02('0x3c')]('-')[0x0]][_0x3e02('0x44')],'destconnectedlinenum':_0x1612c8[_0x3e02('0x3f')]});}}}}}catch(_0x23f1be){logger[_0x3e02('0x45')]('[%s][voiceCallReport][newcallerid]',_0x1612c8[_0x3e02('0x31')],util['inspect'](_0x23f1be,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3e02('0x1d')]=function(_0x2bcb17){try{if(this['isNotNull'](_0x2bcb17)){logger[_0x3e02('0x34')](_0x3e02('0x46'),_0x2bcb17[_0x3e02('0x31')],util[_0x3e02('0x2c')](_0x2bcb17,{'showHidden':![],'depth':null}));if(this[_0x3e02('0x15')][_0x2bcb17[_0x3e02('0x31')]]){return;}if(_0x2bcb17[_0x3e02('0x3b')]===_0x3e02('0x47')){return;}if(_0x2bcb17[_0x3e02('0x31')]!==_0x2bcb17[_0x3e02('0x36')]&&!this[_0x3e02('0x17')][_0x2bcb17[_0x3e02('0x36')]]){return;}logger['info'](_0x3e02('0x48'),_0x2bcb17[_0x3e02('0x31')],_0x2bcb17['context'],_0x2bcb17[_0x3e02('0x3d')]);this['channels'][_0x2bcb17[_0x3e02('0x31')]]=new Channel();this[_0x3e02('0x15')][_0x2bcb17[_0x3e02('0x31')]][_0x3e02('0x49')]=moment()[_0x3e02('0x40')](_0x3e02('0x4a'));this[_0x3e02('0x15')][_0x2bcb17[_0x3e02('0x31')]]['disposition']=dispositions[_[_0x3e02('0x4b')](_0x2bcb17['channelstate'])];_[_0x3e02('0x4c')](this[_0x3e02('0x15')][_0x2bcb17['uniqueid']],_['pick'](_0x2bcb17,_[_0x3e02('0x39')](this['channels'][_0x2bcb17['uniqueid']])));if(_0x2bcb17[_0x3e02('0x4d')]===_0x3e02('0x3a')){var _0x598597=this[_0x3e02('0x16')][_0x2bcb17['channel'][_0x3e02('0x3c')]('-')[0x0]];if(_0x598597&&typeof _0x598597[_0x3e02('0x3e')]==='undefined'){_0x598597[_0x3e02('0x3e')]=_0x2bcb17[_0x3e02('0x3d')];logger[_0x3e02('0x34')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x2bcb17[_0x3e02('0x31')],util[_0x3e02('0x2c')]({'id':_0x598597['id'],'destaccountcode':_0x598597[_0x3e02('0x44')],'destconnectedlinenum':_0x2bcb17['exten']},{'showHidden':![],'depth':null}));this[_0x3e02('0x2f')](util[_0x3e02('0x40')](_0x3e02('0x41'),_0x598597[_0x3e02('0x42')]),'user:agentconnect',{'id':_0x598597['id'],'destaccountcode':_0x598597['accountcode'],'destconnectedlinenum':_0x2bcb17[_0x3e02('0x3d')]});}}}}catch(_0x134b5c){logger[_0x3e02('0x45')]('[%s][voiceCallReport][newchannel]',_0x2bcb17[_0x3e02('0x31')],util['inspect'](_0x134b5c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3e02('0x2e')][_0x3e02('0x19')]=function(_0x433dbc){try{if(this['isNotNull'](_0x433dbc)){logger[_0x3e02('0x34')]('[%s][voiceCallReport][newexten]\x20event:',_0x433dbc['uniqueid'],util[_0x3e02('0x2c')](_0x433dbc,{'showHidden':![],'depth':null}));if(_0x433dbc[_0x3e02('0x3b')]==='OutgoingSpoolFailed'||_0x433dbc['exten']==='h')return;if(_0x433dbc[_0x3e02('0x31')]===_0x433dbc[_0x3e02('0x36')]||this['blindTransfers'][_0x433dbc['linkedid']]){_0x433dbc[_0x3e02('0x4e')]=_0x433dbc['application']?_0x433dbc['application'][_0x3e02('0x4f')]():undefined;_0x433dbc[_0x3e02('0x50')]=_0x433dbc[_0x3e02('0x51')]||_0x433dbc[_0x3e02('0x50')];if(_0x433dbc[_0x3e02('0x51')]&&!_0x433dbc[_0x3e02('0x51')][_0x3e02('0x52')](_0x3e02('0x53'))&&_0x433dbc[_0x3e02('0x4e')]!==_0x3e02('0xa')){_0x433dbc[_0x3e02('0x50')]=_0x433dbc[_0x3e02('0x50')][_0x3e02('0x4f')]();}logger[_0x3e02('0x29')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x433dbc[_0x3e02('0x31')],_0x433dbc['application'],_0x433dbc[_0x3e02('0x50')]);if(_[_0x3e02('0x37')](this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]])){this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]]=new Channel();this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]]['starttime']=_0x433dbc[_0x3e02('0x54')]?moment()['subtract'](moment[_0x3e02('0x54')](_0x433dbc['duration'])[_0x3e02('0x55')](),_0x3e02('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x3e02('0x40')](_0x3e02('0x4a'));this['channels'][_0x433dbc[_0x3e02('0x31')]][_0x3e02('0x56')]=_0x3e02('0xf');}_[_0x3e02('0x4c')](this['channels'][_0x433dbc[_0x3e02('0x31')]],_[_0x3e02('0x38')](_0x433dbc,_[_0x3e02('0x39')](this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]])));if(_[_0x3e02('0x57')](applications,_0x433dbc[_0x3e02('0x4e')])){this['channels'][_0x433dbc[_0x3e02('0x31')]]['lastapplication']=_0x433dbc['application'];this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]][_0x3e02('0x58')]=_0x433dbc[_0x3e02('0x50')];if(_0x433dbc[_0x3e02('0x4e')]===_0x3e02('0x59')&&_[_0x3e02('0x52')](_0x433dbc[_0x3e02('0x50')]['toLowerCase'](),_0x3e02('0x5a'))){var _0xf039d=_0x433dbc[_0x3e02('0x50')]['split']('=');var _0x194e59=_0xf039d[0x0][_0x3e02('0x4f')]()[_0x3e02('0x5b')](/cdr\((.*)\)/);if(_0x194e59){if(_0x194e59[0x1]===_0x3e02('0x5c')&&!_[_0x3e02('0x5d')](this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]][_0x194e59[0x1]]))return;this[_0x3e02('0x15')][_0x433dbc['uniqueid']][_0x194e59[0x1]]=_0xf039d[0x1];}}else if(_0x433dbc[_0x3e02('0x4e')]===_0x3e02('0xa')){this[_0x3e02('0x15')][_0x433dbc[_0x3e02('0x31')]][_0x3e02('0xa')]=_0x433dbc['applicationdata']['split'](',')[0x0];}}}}}catch(_0x4625f7){logger['error'](_0x3e02('0x5e'),_0x433dbc[_0x3e02('0x31')],util[_0x3e02('0x2c')](_0x4625f7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x3438c6){try{if(this[_0x3e02('0x2d')](_0x3438c6)){logger[_0x3e02('0x29')](_0x3e02('0x5f'),_0x3438c6[_0x3e02('0x31')],_0x3438c6[_0x3e02('0x36')],_0x3438c6[_0x3e02('0x32')],_0x3438c6[_0x3e02('0x33')]);logger[_0x3e02('0x34')](_0x3e02('0x60'),_0x3438c6[_0x3e02('0x31')],util['inspect'](_0x3438c6,{'showHidden':![],'depth':null}));if(_0x3438c6[_0x3e02('0x61')]!=='6')return;var _0x1b50d0=this[_0x3e02('0x16')][_0x3438c6[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]];if(_0x3438c6[_0x3e02('0x31')]!==_0x3438c6[_0x3e02('0x36')]){var _0x5e9bd3=moment();if(this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]]){if(!this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]]['answered']){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x62')]=!![];this['channels'][_0x3438c6['linkedid']][_0x3e02('0x63')]=_0x5e9bd3[_0x3e02('0x40')](_0x3e02('0x4a'));if(this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]]['starttime']){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x64')]=_0x5e9bd3['diff'](this[_0x3e02('0x15')][_0x3438c6['linkedid']][_0x3e02('0x49')],'seconds');}}this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x36')]=_0x3438c6['uniqueid'];if(_0x3438c6[_0x3e02('0x33')]!=='xcally-motion-preview'){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x3f')]=_0x3438c6[_0x3e02('0x33')];}this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x65')]=_0x3438c6[_0x3e02('0x32')];this[_0x3e02('0x15')][_0x3438c6['linkedid']][_0x3e02('0x66')]=_0x3438c6[_0x3e02('0x3b')];this['channels'][_0x3438c6[_0x3e02('0x36')]][_0x3e02('0x56')]=dispositions[_[_0x3e02('0x4b')](_0x3438c6[_0x3e02('0x61')])];if(_0x1b50d0){this[_0x3e02('0x15')][_0x3438c6['linkedid']][_0x3e02('0x67')]=_0x1b50d0['id'];this[_0x3e02('0x15')][_0x3438c6['linkedid']]['membername']=_0x1b50d0[_0x3e02('0x42')];}}if(this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]]){if(!this['channels'][_0x3438c6['uniqueid']][_0x3e02('0x62')]){this['channels'][_0x3438c6[_0x3e02('0x31')]]['answered']=!![];this['channels'][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x63')]=_0x5e9bd3[_0x3e02('0x40')](_0x3e02('0x4a'));if(this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]]['starttime']){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x64')]=_0x5e9bd3['diff'](this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x49')],_0x3e02('0x55'));}}if(_0x3438c6[_0x3e02('0x33')]!==_0x3e02('0x68')){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x3f')]=_0x3438c6[_0x3e02('0x33')];}this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]]['connectedlinename']=_0x3438c6[_0x3e02('0x32')];this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x66')]=_0x3438c6['channel'];this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]]['disposition']=dispositions[_[_0x3e02('0x4b')](_0x3438c6[_0x3e02('0x61')])];}}else{if(this[_0x3e02('0x15')][_0x3438c6['uniqueid']]){if(_0x1b50d0){this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x67')]=_0x1b50d0['id'];this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x69')]=_0x1b50d0['name'];}}}if(_0x3438c6[_0x3e02('0x4d')]==='from-sip'){if(_0x1b50d0){_0x1b50d0[_0x3e02('0x3e')]=_0x3438c6[_0x3e02('0x3d')];var _0x325e50,_0x4c592a;if(this['channels'][_0x3438c6[_0x3e02('0x31')]]){_0x325e50=this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0x6a')];_0x4c592a=this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x31')]][_0x3e02('0xa')];}else if(this['channels'][_0x3438c6['linkedid']]){_0x325e50=this['channels'][_0x3438c6['linkedid']][_0x3e02('0x6a')];_0x4c592a=this[_0x3e02('0x15')][_0x3438c6[_0x3e02('0x36')]]['queue'];}_0x1b50d0[_0x3e02('0xa')]=_0x4c592a;_0x1b50d0[_0x3e02('0x6a')]=_0x325e50;var _0x3d8b9e={'id':_0x1b50d0['id'],'name':_0x1b50d0[_0x3e02('0x42')],'agentconnected':!![],'destaccountcode':_0x1b50d0['accountcode'],'destconnectedlinenum':_0x3438c6[_0x3e02('0x3d')],'queue':_0x4c592a||undefined,'routealias':_0x325e50,'uniqueid':_0x3438c6[_0x3e02('0x36')]};logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x3438c6[_0x3e02('0x31')],util['inspect'](_0x3d8b9e,{'showHidden':![],'depth':null}));this[_0x3e02('0x2f')](util[_0x3e02('0x40')](_0x3e02('0x41'),_0x1b50d0[_0x3e02('0x42')]),'user:agentconnect',_0x3d8b9e);}}}}catch(_0x3ff728){logger[_0x3e02('0x45')](_0x3e02('0x6b'),_0x3438c6[_0x3e02('0x31')],util[_0x3e02('0x2c')](_0x3ff728,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3e02('0x2e')]['syncMixMonitorFilename']=function(_0x263ec9,_0x299d42){try{if(this[_0x3e02('0x15')][_0x263ec9]){logger[_0x3e02('0x29')](_0x3e02('0x6c'),_0x263ec9,_0x299d42);this[_0x3e02('0x15')][_0x263ec9][_0x3e02('0x6d')]=!![];if(_[_0x3e02('0x6e')](_0x299d42,_0x3e02('0x6f'))){_0x299d42=_0x299d42['replace'](_0x3e02('0x6f'),_0x3e02('0x70'));}this[_0x3e02('0x15')][_0x263ec9]['monitorFilename']=_0x299d42;var _0x1d6bb1=_[_0x3e02('0x71')](this[_0x3e02('0x15')][_0x263ec9][_0x3e02('0x72')],{'filename':_0x299d42});if(_[_0x3e02('0x5d')](_0x1d6bb1)){this[_0x3e02('0x15')][_0x263ec9]['monitors'][_0x3e02('0x73')]({'filename':_0x299d42,'createdAt':moment()[_0x3e02('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x3e02('0x74')});}}}catch(_0x2b5be9){logger[_0x3e02('0x45')](_0x3e02('0x75'),_0x263ec9,util[_0x3e02('0x2c')](_0x2b5be9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3e02('0x2e')][_0x3e02('0x20')]=function(_0x2a3bed){try{if(this['isNotNull'](_0x2a3bed)){logger[_0x3e02('0x34')]('[%s][voiceCallReport][varset]\x20event:',_0x2a3bed[_0x3e02('0x31')],util['inspect'](_0x2a3bed,{'showHidden':![],'depth':null}));if(this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]]&&_0x2a3bed[_0x3e02('0x3b')]!=_0x3e02('0x47')){if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')])){if(this['isNotNull'](_0x2a3bed[_0x3e02('0x76')]['mixmonitor_filename'])){logger[_0x3e02('0x29')](_0x3e02('0x77'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x79')](_0x2a3bed[_0x3e02('0x31')],_0x2a3bed['value']);}else if(this[_0x3e02('0x2d')](_0x2a3bed['variable'][_0x3e02('0x7a')])){logger[_0x3e02('0x29')](_0x3e02('0x7b'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed['value']);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]][_0x3e02('0x33')]=_0x2a3bed[_0x3e02('0x78')];}else if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')]['xmd-callerid'])){logger['info'](_0x3e02('0x7c'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed['value']);this[_0x3e02('0x15')][_0x2a3bed['uniqueid']]['callerid']=_0x2a3bed[_0x3e02('0x78')];}else if(this[_0x3e02('0x2d')](_0x2a3bed['variable']['xmd-cdrtype'])){logger[_0x3e02('0x29')](_0x3e02('0x7d'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]][_0x3e02('0x5c')]=_0x2a3bed[_0x3e02('0x78')];}else if(this['isNotNull'](_0x2a3bed[_0x3e02('0x76')][_0x3e02('0x7e')])){logger['info'](_0x3e02('0x7f'),_0x2a3bed['uniqueid'],_0x2a3bed['value'][_0x3e02('0x3c')](',')[0x0]);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]]['queue']=_0x2a3bed[_0x3e02('0x78')][_0x3e02('0x3c')](',')[0x0];}else if(this[_0x3e02('0x2d')](_0x2a3bed['variable'][_0x3e02('0x80')])){logger[_0x3e02('0x29')](_0x3e02('0x81'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this['channels'][_0x2a3bed['uniqueid']][_0x3e02('0x82')]=_0x2a3bed[_0x3e02('0x78')];}else if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')][_0x3e02('0x83')])){logger[_0x3e02('0x29')](_0x3e02('0x84'),_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]][_0x3e02('0x85')]=_0x2a3bed[_0x3e02('0x78')];}else if(this['isNotNull'](_0x2a3bed[_0x3e02('0x76')][_0x3e02('0x86')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2a3bed[_0x3e02('0x31')],_0x2a3bed['value']);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]]['calleridpreview']=_0x2a3bed[_0x3e02('0x78')];}else if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')][_0x3e02('0x87')])){logger[_0x3e02('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x31')]][_0x3e02('0xa')]=_0x2a3bed[_0x3e02('0x78')];}else if(this[_0x3e02('0x2d')](_0x2a3bed['variable'][_0x3e02('0x88')])){logger[_0x3e02('0x29')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2a3bed[_0x3e02('0x31')],_0x2a3bed[_0x3e02('0x78')]);this['channels'][_0x2a3bed[_0x3e02('0x31')]]['sipcalluniqueid']=_0x2a3bed[_0x3e02('0x78')];}}}else if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')]['mixmonitor_filename'])){if(_0x2a3bed['value']){var _0x3ceb59=path[_0x3e02('0x89')](_0x2a3bed[_0x3e02('0x78')])['name'];logger[_0x3e02('0x29')](_0x3e02('0x77'),_0x3ceb59,_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x79')](_0x3ceb59,_0x2a3bed[_0x3e02('0x78')]);}}else if(this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x36')]]){if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')])){if(this[_0x3e02('0x2d')](_0x2a3bed[_0x3e02('0x76')][_0x3e02('0x88')])){logger['info'](_0x3e02('0x8a'),_0x2a3bed[_0x3e02('0x36')],_0x2a3bed[_0x3e02('0x78')]);this[_0x3e02('0x15')][_0x2a3bed[_0x3e02('0x36')]]['sipcalllinkedid']=_0x2a3bed[_0x3e02('0x78')];}}}}}catch(_0x4b779c){logger[_0x3e02('0x45')](_0x3e02('0x8b'),_0x2a3bed[_0x3e02('0x31')],util['inspect'](_0x4b779c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3e02('0x2e')][_0x3e02('0x22')]=function(_0x45fd8a){try{if(this[_0x3e02('0x2d')](_0x45fd8a)){logger[_0x3e02('0x34')](_0x3e02('0x8c'),_0x45fd8a[_0x3e02('0x31')],util[_0x3e02('0x2c')](_0x45fd8a,{'showHidden':![],'depth':null}));if(this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]]){if(this['channels'][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x36')]]){this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x36')]]['uniqueid']=_0x45fd8a[_0x3e02('0x31')];this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x36')]][_0x3e02('0x62')]=this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x62')];this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x36')]][_0x3e02('0x63')]=this['channels'][_0x45fd8a['uniqueid']][_0x3e02('0x63')];this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]]['linkedid']][_0x3e02('0x66')]=this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x36')]][_0x3e02('0x3b')];this['channels'][this['blindTransfers'][_0x45fd8a['linkedid']]['linkedid']]['disposition']=this['channels'][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x56')];this['channels'][_0x45fd8a[_0x3e02('0x31')]]=this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x36')]];delete this['channels'][this[_0x3e02('0x17')][_0x45fd8a['linkedid']]['linkedid']];}else if(this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]]){this['channels'][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]]['uniqueid']=[this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]][_0x3e02('0x36')],this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]][_0x3e02('0x36')]=this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x31')]][_0x3e02('0x31')]][0x0];this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]]['uniqueid']][_0x3e02('0x62')]=this[_0x3e02('0x15')][_0x45fd8a['uniqueid']][_0x3e02('0x62')];this['channels'][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]][_0x3e02('0x63')]=this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x63')];this['channels'][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x31')]][_0x3e02('0x66')]=this[_0x3e02('0x15')][this['blindTransfers'][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]][_0x3e02('0x3b')];this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a['linkedid']][_0x3e02('0x31')]][_0x3e02('0x56')]=this[_0x3e02('0x15')][_0x45fd8a['uniqueid']][_0x3e02('0x56')];this[_0x3e02('0x15')][_0x45fd8a['uniqueid']]=this['channels'][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]];delete this[_0x3e02('0x15')][this[_0x3e02('0x17')][_0x45fd8a[_0x3e02('0x36')]][_0x3e02('0x31')]];}}if(this[_0x3e02('0x15')][_0x45fd8a['uniqueid']]){logger[_0x3e02('0x29')](_0x3e02('0x8d'),_0x45fd8a[_0x3e02('0x31')],_0x45fd8a[_0x3e02('0x8e')]);var _0xe1e9d0=moment();this[_0x3e02('0x15')][_0x45fd8a['uniqueid']]['endtime']=_0xe1e9d0[_0x3e02('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]]['duration']=_0xe1e9d0[_0x3e02('0x8f')](this[_0x3e02('0x15')][_0x45fd8a['uniqueid']]['starttime'],_0x3e02('0x55'));if(this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x62')]){this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x90')]=_0xe1e9d0['diff'](this[_0x3e02('0x15')][_0x45fd8a['uniqueid']][_0x3e02('0x63')],_0x3e02('0x55'));this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]][_0x3e02('0x64')]=this[_0x3e02('0x15')][_0x45fd8a[_0x3e02('0x31')]]['duration']-this[_0x3e02('0x15')][_0x45fd8a['uniqueid']][_0x3e02('0x90')];}if(_0x45fd8a['context']==='from-sip'){if(this[_0x3e02('0x16')][_0x45fd8a[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]]){this[_0x3e02('0x16')][_0x45fd8a[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]]=_[_0x3e02('0x91')](this[_0x3e02('0x16')][_0x45fd8a['channel'][_0x3e02('0x3c')]('-')[0x0]],[_0x3e02('0x3e')]);logger['debug'](_0x3e02('0x92'),_0x45fd8a[_0x3e02('0x31')],util[_0x3e02('0x2c')]({'id':this['agents'][_0x45fd8a['channel'][_0x3e02('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0x3e02('0x16')][_0x45fd8a['channel']['split']('-')[0x0]][_0x3e02('0x44')]},{'showHidden':![],'depth':null}));this[_0x3e02('0x2f')](util[_0x3e02('0x40')](_0x3e02('0x41'),this[_0x3e02('0x16')][_0x45fd8a[_0x3e02('0x3b')]['split']('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0x3e02('0x16')][_0x45fd8a[_0x3e02('0x3b')][_0x3e02('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0x3e02('0x16')][_0x45fd8a[_0x3e02('0x3b')]['split']('-')[0x0]]['accountcode']});for(var _0x1c4cc6=0x0;_0x1c4cc60x0?!![]:![];if(!_0x4f6fc2){return this[_0x2ba1('0x1a')](this[_0x2ba1('0x15')][_0x2ba1('0x72')]);}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x1c')]=function(_0x31c4a5){var _0x2056a9=this[_0x2ba1('0x15')]['id'];if(this[_0x2ba1('0x15')]['queuestatus'][_0x2056a9]&&this[_0x2ba1('0x15')][_0x2ba1('0x6f')][_0x2056a9][_0x31c4a5[_0x2ba1('0x67')]]){this['summary']['queuestatus'][_0x2056a9][_0x31c4a5[_0x2ba1('0x67')]][_0x2ba1('0x10')][_0x2ba1('0x73')](_0x31c4a5);}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x18')]=function(_0x425e21){var _0xa4681f=this;try{if(this[_0x2ba1('0x61')](_0x425e21)&&this['isNotNull'](_0x425e21[_0x2ba1('0x74')])){logger['debug'](_0x2ba1('0x75'),util[_0x2ba1('0x47')](_0x425e21,{'showHidden':![],'depth':null}));var _0x2c68b8=this[_0x2ba1('0x13')][_0x425e21[_0x2ba1('0x74')]];if(_0x2c68b8){logger[_0x2ba1('0x4f')](_0x2ba1('0x76'),_0x2c68b8[_0x2ba1('0x5f')]);this[_0x2ba1('0x15')][_0x2ba1('0x63')][_0x2c68b8['name']]={'summaryEvent':_0x425e21};this[_0x2ba1('0x15')][_0x2ba1('0x71')]+=0x1;return ami[_0x2ba1('0x66')]({'action':_0x2ba1('0x6f'),'queue':_0x2c68b8[_0x2ba1('0x5f')]})[_0x2ba1('0x77')](function(_0x245a08){if(!_0xa4681f['summary'][_0x2ba1('0x6f')][_0x425e21[_0x2ba1('0x67')]]){_0xa4681f[_0x2ba1('0x15')][_0x2ba1('0x6f')][_0x425e21['actionid']]={};}_0xa4681f[_0x2ba1('0x15')][_0x2ba1('0x6f')][_0x425e21[_0x2ba1('0x67')]][_0x245a08[_0x2ba1('0x67')]]={'queue':_0x2c68b8[_0x2ba1('0x5f')],'agents':[]};})['catch'](function(_0x1a0feb){throw _0x1a0feb;});}}}catch(_0x573e91){logger[_0x2ba1('0x45')](_0x2ba1('0x68'),util['inspect'](_0x573e91,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')]['syncQueueSummaryComplete']=function(_0x401ef9){if(this[_0x2ba1('0x15')][_0x2ba1('0x71')]>0x0){this[_0x2ba1('0x15')][_0x2ba1('0x72')]=_0x401ef9;return;}logger[_0x2ba1('0x4f')](_0x2ba1('0x78'),util[_0x2ba1('0x47')](_0x401ef9,{'showHidden':![],'depth':null}));this[_0x2ba1('0x15')]=initializeSummary();ami[_0x2ba1('0x4d')](_0x2ba1('0x79'),{});};VoiceQueueReport['prototype'][_0x2ba1('0x20')]=function(_0x6c3b40){try{if(this[_0x2ba1('0x61')](_0x6c3b40)){logger[_0x2ba1('0x4f')](_0x2ba1('0x7a'),_0x6c3b40[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x6c3b40,{'showHidden':![],'depth':null}));if(_[_0x2ba1('0x62')](this[_0x2ba1('0xe')][_0x6c3b40[_0x2ba1('0x52')]])){this[_0x2ba1('0xe')][_0x6c3b40[_0x2ba1('0x52')]]=[];}if(_[_0x2ba1('0x62')](this[_0x2ba1('0x11')][_0x6c3b40[_0x2ba1('0x52')]])){this['channels'][_0x6c3b40[_0x2ba1('0x52')]]={};}var _0x4a3051=new QueueReport();_0x4a3051[_0x2ba1('0x74')]=_0x6c3b40[_0x2ba1('0x74')];_0x4a3051[_0x2ba1('0x5c')]=this[_0x2ba1('0x13')][_0x4a3051['queue']]&&this[_0x2ba1('0x13')][_0x4a3051['queue']][_0x2ba1('0x5c')]?this[_0x2ba1('0x13')][_0x4a3051['queue']][_0x2ba1('0x5c')]||_0x2ba1('0x5d'):_0x2ba1('0x5d');_0x4a3051['queuecallerjoinAt']=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x4a3051[_0x2ba1('0x7c')]=_0x6c3b40['position'];_0x4a3051['count']=_0x6c3b40['count'];_0x4a3051[_0x2ba1('0x52')]=_0x6c3b40[_0x2ba1('0x52')];_0x4a3051[_0x2ba1('0x7d')]=this[_0x2ba1('0x11')][_0x6c3b40[_0x2ba1('0x52')]][_0x2ba1('0x7d')];logger['info'](_0x2ba1('0x7e'),_0x4a3051[_0x2ba1('0x74')],_0x4a3051[_0x2ba1('0x5c')]);Object[_0x2ba1('0x6e')](_0x4a3051,_[_0x2ba1('0x7f')](_0x6c3b40,_['keys'](_0x4a3051)));this[_0x2ba1('0xe')][_0x6c3b40[_0x2ba1('0x52')]]['push'](_0x4a3051);this['channels'][_0x6c3b40[_0x2ba1('0x52')]]=_0x4a3051;this[_0x2ba1('0x4e')](_0x4a3051,_0x2ba1('0x1f'));}}catch(_0x3e258d){logger[_0x2ba1('0x45')](_0x2ba1('0x7a'),_0x6c3b40[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x3e258d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x22')]=function(_0x1d57c7){try{if(this[_0x2ba1('0x61')](_0x1d57c7)){logger[_0x2ba1('0x4f')](_0x2ba1('0x80'),_0x1d57c7[_0x2ba1('0x52')],util['inspect'](_0x1d57c7,{'showHidden':![],'depth':null}));if(this[_0x2ba1('0xe')][_0x1d57c7[_0x2ba1('0x52')]]){var _0x4ab0bb=_[_0x2ba1('0x81')](this['queueReports'][_0x1d57c7[_0x2ba1('0x52')]]);_0x4ab0bb[_0x2ba1('0x3b')]=![];_0x4ab0bb[_0x2ba1('0x82')]=null;_0x4ab0bb[_0x2ba1('0x83')]=_0x1d57c7[_0x2ba1('0x83')];_0x4ab0bb['originalposition']=_0x1d57c7['originalposition'];_0x4ab0bb['queuecallerabandon']=!![];_0x4ab0bb['queuecallerabandonAt']=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x4ab0bb['queuecallerexitreason']=_0x2ba1('0x84');_0x4ab0bb[_0x2ba1('0x85')]=null;logger[_0x2ba1('0x86')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4ab0bb[_0x2ba1('0x74')],_0x4ab0bb[_0x2ba1('0x5c')]);this['channels'][_0x1d57c7[_0x2ba1('0x52')]]=_0x4ab0bb;this['emitVoiceQueueChannelRemove'](_0x4ab0bb,_0x2ba1('0x21'));}}}catch(_0x187e2f){logger[_0x2ba1('0x45')](_0x2ba1('0x80'),_0x1d57c7[_0x2ba1('0x52')],util['inspect'](_0x187e2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x23')]=function(_0x28857b){try{if(this[_0x2ba1('0x61')](_0x28857b)){logger[_0x2ba1('0x4f')](_0x2ba1('0x87'),_0x28857b[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x28857b,{'showHidden':![],'depth':null}));if(this[_0x2ba1('0xe')][_0x28857b[_0x2ba1('0x52')]]){var _0x4f857d=_[_0x2ba1('0x81')](this['queueReports'][_0x28857b[_0x2ba1('0x52')]]);_0x4f857d[_0x2ba1('0x88')]=moment()['format'](_0x2ba1('0x7b'));_0x4f857d[_0x2ba1('0x89')]=_0x28857b['connectedlinenum'];_0x4f857d[_0x2ba1('0x8a')]=_0x28857b[_0x2ba1('0x8a')];logger['info'](_0x2ba1('0x8b'),_0x4f857d[_0x2ba1('0x74')],_0x4f857d['type'],_0x28857b['connectedlinenum'],_0x28857b[_0x2ba1('0x8a')]);this[_0x2ba1('0x11')][_0x28857b[_0x2ba1('0x52')]]=_0x4f857d;this['emitVoiceQueueChannelSave'](_0x4f857d,_0x2ba1('0x8c'));}}}catch(_0xf6be72){logger[_0x2ba1('0x45')](_0x2ba1('0x87'),_0x28857b[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0xf6be72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x25')]=function(_0x9ef91e){try{if(this[_0x2ba1('0x61')](_0x9ef91e)){logger[_0x2ba1('0x4f')]('[%s][voiceQueueReport][agentconnect]',_0x9ef91e[_0x2ba1('0x52')],util['inspect'](_0x9ef91e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x9ef91e[_0x2ba1('0x52')]]){var _0x1a902e=_[_0x2ba1('0x81')](this[_0x2ba1('0xe')][_0x9ef91e[_0x2ba1('0x52')]]);_0x1a902e['queuecallercomplete']=!![];_0x1a902e[_0x2ba1('0x57')]=_0x2ba1('0x8d');logger[_0x2ba1('0x86')](_0x2ba1('0x8e'),_0x1a902e[_0x2ba1('0x74')],_0x1a902e[_0x2ba1('0x5c')]);}}}catch(_0xd5ba62){logger[_0x2ba1('0x45')](_0x2ba1('0x8f'),_0x9ef91e['uniqueid'],util[_0x2ba1('0x47')](_0xd5ba62,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0x24')]=function(_0x2491b3){try{if(this[_0x2ba1('0x61')](_0x2491b3)){logger[_0x2ba1('0x4f')]('[%s][voiceQueueReport][agentcomplete]',_0x2491b3[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x2491b3,{'showHidden':![],'depth':null}));if(this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x52')]]){var _0x2b7f67=_[_0x2ba1('0x81')](this['queueReports'][_0x2491b3[_0x2ba1('0x52')]]);_0x2b7f67['queuecallerabandon']=![];_0x2b7f67[_0x2ba1('0x90')]=null;_0x2b7f67['assigned']=!![];_0x2b7f67[_0x2ba1('0x85')]=_0x2491b3['membername'];_0x2b7f67[_0x2ba1('0x83')]=_0x2491b3[_0x2ba1('0x83')];_0x2b7f67['queuecallercomplete']=!![];_0x2b7f67[_0x2ba1('0x3a')]=![];_0x2b7f67[_0x2ba1('0x91')]=null;if(!_0x2b7f67[_0x2ba1('0x92')]){if(_0x2491b3['reason']=='transfer'){_0x2b7f67[_0x2ba1('0x57')]='COMPLETED';logger[_0x2ba1('0x86')](_0x2ba1('0x93'),_0x2b7f67[_0x2ba1('0x74')],_0x2b7f67[_0x2ba1('0x5c')]);}else{if(_[_0x2ba1('0x94')](_0x2491b3['channel'][_0x2ba1('0x95')](),_0x2ba1('0x96'))){if(this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x97')]]){var _0x18a2a8=_[_0x2ba1('0x81')](this[_0x2ba1('0xe')][_0x2491b3['linkedid']]);_0x18a2a8[_0x2ba1('0x3b')]=![];_0x18a2a8[_0x2ba1('0x3a')]=!![];_0x18a2a8['queuecallerexitAt']=moment(_0x2b7f67['queuecallerjoinAt'])['add'](_0x2491b3[_0x2ba1('0x83')],_0x2ba1('0x98'))[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x18a2a8[_0x2ba1('0x57')]='FORWARDTRANSFER';_0x18a2a8[_0x2ba1('0x92')]=!![];_0x18a2a8[_0x2ba1('0x99')]=_0x2ba1('0x9a');_0x18a2a8[_0x2ba1('0x9b')]=_0x2491b3[_0x2ba1('0x9c')];_0x18a2a8[_0x2ba1('0x9d')]=_0x2491b3[_0x2ba1('0x52')];logger[_0x2ba1('0x86')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x18a2a8['queue'],_0x18a2a8[_0x2ba1('0x5c')]);var _0x3f8bfc=this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x97')]];this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x97')]]=this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x52')]];this[_0x2ba1('0xe')][_0x2491b3[_0x2ba1('0x52')]]=_0x3f8bfc;}}else{_0x2b7f67[_0x2ba1('0x57')]='COMPLETEDBY'+_0x2491b3[_0x2ba1('0x9e')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2b7f67[_0x2ba1('0x74')],_0x2b7f67['type'],_0x2b7f67[_0x2ba1('0x57')]);}}}this[_0x2ba1('0x11')][_0x2491b3[_0x2ba1('0x52')]]=_0x2b7f67;}}}catch(_0x529bc3){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x2491b3[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x529bc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2ba1('0x27')]=function(_0x27f088){try{if(this[_0x2ba1('0x61')](_0x27f088)){logger[_0x2ba1('0x4f')](_0x2ba1('0x9f'),_0x27f088['uniqueid'],util['inspect'](_0x27f088,{'showHidden':![],'depth':null}));this[_0x2ba1('0xa0')](_0x27f088['uniqueid'],_[_0x2ba1('0xa1')](_0x27f088[_0x2ba1('0xa2')])[0x0],_0x27f088[_0x2ba1('0xa3')]);if(this[_0x2ba1('0xe')][_0x27f088[_0x2ba1('0x52')]]){var _0x189d08=_['last'](this[_0x2ba1('0xe')][_0x27f088[_0x2ba1('0x52')]]);if(_0x189d08){if(this[_0x2ba1('0x61')](_0x27f088[_0x2ba1('0xa2')])&&this[_0x2ba1('0x61')](_0x27f088[_0x2ba1('0xa2')]['queuestatus'])){switch(_0x27f088['value']){case _0x2ba1('0xa4'):_0x189d08[_0x2ba1('0x3a')]=![];_0x189d08[_0x2ba1('0x91')]=null;break;case _0x2ba1('0xa5'):_0x189d08[_0x2ba1('0xa6')]=_0x2ba1('0xa7');_0x189d08[_0x2ba1('0x3a')]=!![];_0x189d08[_0x2ba1('0x91')]=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x189d08[_0x2ba1('0x88')]=moment()[_0x2ba1('0x53')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2ba1('0x4f')](_0x2ba1('0xa8'),_0x27f088[_0x2ba1('0x52')],util['inspect'](_0x189d08,{'showHidden':![],'depth':null}));ami[_0x2ba1('0x4d')](_0x2ba1('0xa9'),_0x189d08);break;default:_0x189d08[_0x2ba1('0x3a')]=!![];_0x189d08['queuecallerexitAt']=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x189d08[_0x2ba1('0x88')]=moment()['format'](_0x2ba1('0x7b'));}_0x189d08[_0x2ba1('0x21')]=![];_0x189d08[_0x2ba1('0x90')]=null;_0x189d08['queuecallerexitreason']=_0x27f088['value'];this[_0x2ba1('0x11')][_0x27f088[_0x2ba1('0x52')]]=_0x189d08;this[_0x2ba1('0x4b')](_0x189d08,'varset');}else if(this[_0x2ba1('0x61')](_0x27f088[_0x2ba1('0xa2')])&&this[_0x2ba1('0x61')](_0x27f088[_0x2ba1('0xa2')][_0x2ba1('0xaa')])){if(!_0x189d08[_0x2ba1('0x21')]){_0x189d08[_0x2ba1('0x3a')]=!![];_0x189d08[_0x2ba1('0x91')]=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));_0x189d08['queuecallerexitreason']=_0x2ba1('0xab');_0x189d08[_0x2ba1('0x88')]=moment()[_0x2ba1('0x53')](_0x2ba1('0x7b'));this[_0x2ba1('0x11')][_0x27f088['uniqueid']]=_0x189d08;}}logger[_0x2ba1('0x86')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x27f088['uniqueid'],_0x189d08[_0x2ba1('0x74')],_0x189d08[_0x2ba1('0x5c')],_[_0x2ba1('0xa1')](_0x27f088[_0x2ba1('0xa2')])[0x0],_0x27f088['value']);_0x189d08['variables']=this[_0x2ba1('0x16')][_0x27f088[_0x2ba1('0x52')]];}}}}catch(_0x51145d){logger[_0x2ba1('0x45')](_0x2ba1('0x9f'),_0x27f088[_0x2ba1('0x52')],util[_0x2ba1('0x47')](_0x51145d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ba1('0xb')][_0x2ba1('0xa0')]=function(_0x58f34c,_0x43de41,_0x35ede8){var _0x423e03=[_0x2ba1('0xac'),_0x2ba1('0xad'),_0x2ba1('0xae'),_0x2ba1('0xaf'),'rtpaudioqosloss',_0x2ba1('0xb0'),_0x2ba1('0xb1'),_0x2ba1('0xb2'),_0x2ba1('0xb3'),_0x2ba1('0xb4'),_0x2ba1('0xb5'),'bridgepvtcallid',_0x2ba1('0xb6'),'memberdynamic',_0x2ba1('0xb7'),_0x2ba1('0xb8'),_0x2ba1('0xb9'),_0x2ba1('0xba'),_0x2ba1('0xbb')];if(!_[_0x2ba1('0x3f')](_0x43de41)&&!_[_0x2ba1('0xbc')](_0x423e03,_0x43de41)){if(_[_0x2ba1('0x62')](this[_0x2ba1('0x16')][_0x58f34c])){this[_0x2ba1('0x16')][_0x58f34c]={};}this[_0x2ba1('0x16')][_0x58f34c][_0x43de41]=_0x35ede8;}};VoiceQueueReport['prototype'][_0x2ba1('0xbd')]=function(_0x238ea8,_0x5e2f39,_0x5d0454){var _0x489d17={};for(var _0x4d96b8=0x0;_0x4d96b80x0?!![]:![];if(!_0x17f8a9){return this[_0x37cb('0x19')](this[_0x37cb('0x64')][_0x37cb('0x74')]);}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0x1c')]=function(_0x3a8049){var _0x278968=this[_0x37cb('0x64')]['id'];if(this[_0x37cb('0x64')][_0x37cb('0x66')][_0x278968]&&this['summary'][_0x37cb('0x66')][_0x278968][_0x3a8049['actionid']]){this[_0x37cb('0x64')]['queuestatus'][_0x278968][_0x3a8049[_0x37cb('0x65')]][_0x37cb('0x11')][_0x37cb('0x75')](_0x3a8049);}};VoiceQueueReport[_0x37cb('0x3e')]['syncQueueSummary']=function(_0x5ca29b){var _0xf43c34=this;try{if(this[_0x37cb('0x76')](_0x5ca29b)&&this[_0x37cb('0x76')](_0x5ca29b[_0x37cb('0x53')])){logger['debug'](_0x37cb('0x77'),util[_0x37cb('0x46')](_0x5ca29b,{'showHidden':![],'depth':null}));var _0x213937=this[_0x37cb('0x14')][_0x5ca29b[_0x37cb('0x53')]];if(_0x213937){logger[_0x37cb('0x4e')](_0x37cb('0x78'),_0x213937[_0x37cb('0x5e')]);this['summary'][_0x37cb('0x79')][_0x213937[_0x37cb('0x5e')]]={'summaryEvent':_0x5ca29b};this[_0x37cb('0x64')][_0x37cb('0x73')]+=0x1;return ami[_0x37cb('0x41')]({'action':_0x37cb('0x66'),'queue':_0x213937[_0x37cb('0x5e')]})[_0x37cb('0x7a')](function(_0x5a206f){if(!_0xf43c34[_0x37cb('0x64')][_0x37cb('0x66')][_0x5ca29b[_0x37cb('0x65')]]){_0xf43c34[_0x37cb('0x64')][_0x37cb('0x66')][_0x5ca29b[_0x37cb('0x65')]]={};}_0xf43c34[_0x37cb('0x64')][_0x37cb('0x66')][_0x5ca29b['actionid']][_0x5a206f[_0x37cb('0x65')]]={'queue':_0x213937[_0x37cb('0x5e')],'agents':[]};})[_0x37cb('0x44')](function(_0x3c3909){throw _0x3c3909;});}}}catch(_0x152ee9){logger['error'](_0x37cb('0x67'),util[_0x37cb('0x46')](_0x152ee9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x37cb('0x19')]=function(_0x7c6403){if(this[_0x37cb('0x64')][_0x37cb('0x73')]>0x0){this[_0x37cb('0x64')][_0x37cb('0x74')]=_0x7c6403;return;}logger['debug'](_0x37cb('0x7b'),util[_0x37cb('0x46')](_0x7c6403,{'showHidden':![],'depth':null}));this[_0x37cb('0x64')]=initializeSummary();ami[_0x37cb('0x4c')](_0x37cb('0x7c'),{});};VoiceQueueReport[_0x37cb('0x3e')]['syncQueueCallerJoin']=function(_0x542ef6){try{if(this[_0x37cb('0x76')](_0x542ef6)){logger[_0x37cb('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x542ef6[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x542ef6,{'showHidden':![],'depth':null}));if(_[_0x37cb('0x60')](this[_0x37cb('0x10')][_0x542ef6['uniqueid']])){this[_0x37cb('0x10')][_0x542ef6[_0x37cb('0x51')]]=[];}if(_[_0x37cb('0x60')](this[_0x37cb('0x12')][_0x542ef6[_0x37cb('0x51')]])){this[_0x37cb('0x12')][_0x542ef6[_0x37cb('0x51')]]={};}var _0x53b3fb=new QueueReport();_0x53b3fb[_0x37cb('0x53')]=_0x542ef6[_0x37cb('0x53')];_0x53b3fb[_0x37cb('0x70')]=this[_0x37cb('0x14')][_0x53b3fb[_0x37cb('0x53')]]&&this[_0x37cb('0x14')][_0x53b3fb[_0x37cb('0x53')]]['type']?this[_0x37cb('0x14')][_0x53b3fb[_0x37cb('0x53')]][_0x37cb('0x70')]||_0x37cb('0x5c'):'inbound';_0x53b3fb[_0x37cb('0x7d')]=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));_0x53b3fb[_0x37cb('0x7f')]=_0x542ef6['position'];_0x53b3fb['count']=_0x542ef6[_0x37cb('0x80')];_0x53b3fb['uniqueid']=_0x542ef6['uniqueid'];_0x53b3fb[_0x37cb('0x81')]=this[_0x37cb('0x12')][_0x542ef6[_0x37cb('0x51')]][_0x37cb('0x81')];logger['info'](_0x37cb('0x82'),_0x53b3fb['queue'],_0x53b3fb[_0x37cb('0x70')]);Object['assign'](_0x53b3fb,_['pick'](_0x542ef6,_['keys'](_0x53b3fb)));this[_0x37cb('0x10')][_0x542ef6[_0x37cb('0x51')]][_0x37cb('0x75')](_0x53b3fb);this[_0x37cb('0x12')][_0x542ef6[_0x37cb('0x51')]]=_0x53b3fb;this[_0x37cb('0x4d')](_0x53b3fb,_0x37cb('0x1e'));}}catch(_0x220752){logger[_0x37cb('0x47')](_0x37cb('0x83'),_0x542ef6[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x220752,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x3301a9){try{if(this[_0x37cb('0x76')](_0x3301a9)){logger[_0x37cb('0x4e')](_0x37cb('0x84'),_0x3301a9[_0x37cb('0x51')],util['inspect'](_0x3301a9,{'showHidden':![],'depth':null}));if(this[_0x37cb('0x10')][_0x3301a9[_0x37cb('0x51')]]){var _0x34181c=_['last'](this[_0x37cb('0x10')][_0x3301a9[_0x37cb('0x51')]]);_0x34181c[_0x37cb('0x3d')]=![];_0x34181c[_0x37cb('0x85')]=null;_0x34181c['holdtime']=_0x3301a9[_0x37cb('0x86')];_0x34181c[_0x37cb('0x87')]=_0x3301a9[_0x37cb('0x87')];_0x34181c[_0x37cb('0x20')]=!![];_0x34181c['queuecallerabandonAt']=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));_0x34181c[_0x37cb('0x88')]=_0x37cb('0x89');_0x34181c[_0x37cb('0x8a')]=null;logger['info'](_0x37cb('0x8b'),_0x34181c[_0x37cb('0x53')],_0x34181c[_0x37cb('0x70')]);this[_0x37cb('0x12')][_0x3301a9[_0x37cb('0x51')]]=_0x34181c;this[_0x37cb('0x4a')](_0x34181c,'queuecallerabandon');}}}catch(_0x101506){logger[_0x37cb('0x47')](_0x37cb('0x84'),_0x3301a9[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x101506,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0x22')]=function(_0x26712d){try{if(this[_0x37cb('0x76')](_0x26712d)){logger['debug'](_0x37cb('0x8c'),_0x26712d[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x26712d,{'showHidden':![],'depth':null}));if(this[_0x37cb('0x10')][_0x26712d[_0x37cb('0x51')]]){var _0x22e081=_[_0x37cb('0x8d')](this['queueReports'][_0x26712d['uniqueid']]);_0x22e081[_0x37cb('0x8e')]=moment()['format'](_0x37cb('0x7e'));_0x22e081[_0x37cb('0x8f')]=_0x26712d[_0x37cb('0x8f')];_0x22e081[_0x37cb('0x90')]=_0x26712d[_0x37cb('0x90')];logger['info'](_0x37cb('0x91'),_0x22e081[_0x37cb('0x53')],_0x22e081[_0x37cb('0x70')],_0x26712d[_0x37cb('0x8f')],_0x26712d[_0x37cb('0x90')]);this[_0x37cb('0x12')][_0x26712d[_0x37cb('0x51')]]=_0x22e081;this['emitVoiceQueueChannelSave'](_0x22e081,_0x37cb('0x21'));}}}catch(_0x14e54f){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x26712d[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x14e54f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0x26')]=function(_0x5a1d97){try{if(this[_0x37cb('0x76')](_0x5a1d97)){logger[_0x37cb('0x4e')](_0x37cb('0x92'),_0x5a1d97['uniqueid'],util[_0x37cb('0x46')](_0x5a1d97,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5a1d97[_0x37cb('0x51')]]){var _0x18a26b=_['last'](this['queueReports'][_0x5a1d97[_0x37cb('0x51')]]);_0x18a26b[_0x37cb('0x3d')]=!![];_0x18a26b[_0x37cb('0x88')]=_0x37cb('0x93');logger[_0x37cb('0x94')](_0x37cb('0x95'),_0x18a26b[_0x37cb('0x53')],_0x18a26b[_0x37cb('0x70')]);}}}catch(_0x4711c2){logger['error'](_0x37cb('0x92'),_0x5a1d97[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x4711c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37cb('0x3e')]['syncAgentComplete']=function(_0x3fc1a3){try{if(this['isNotNull'](_0x3fc1a3)){logger[_0x37cb('0x4e')]('[%s][voiceQueueReport][agentcomplete]',_0x3fc1a3['uniqueid'],util['inspect'](_0x3fc1a3,{'showHidden':![],'depth':null}));if(this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x51')]]){var _0x5b4ac1=_[_0x37cb('0x8d')](this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x51')]]);_0x5b4ac1[_0x37cb('0x20')]=![];_0x5b4ac1[_0x37cb('0x96')]=null;_0x5b4ac1[_0x37cb('0x97')]=!![];_0x5b4ac1[_0x37cb('0x8a')]=_0x3fc1a3[_0x37cb('0x98')];_0x5b4ac1[_0x37cb('0x86')]=_0x3fc1a3['holdtime'];_0x5b4ac1[_0x37cb('0x3d')]=!![];_0x5b4ac1['queuecallerexit']=![];_0x5b4ac1['queuecallerexitAt']=null;if(!_0x5b4ac1['transfer']){if(_0x3fc1a3['reason']=='transfer'){_0x5b4ac1['queuecallerexitreason']=_0x37cb('0x99');logger['info'](_0x37cb('0x9a'),_0x5b4ac1['queue'],_0x5b4ac1['type']);}else{if(_[_0x37cb('0x9b')](_0x3fc1a3['channel'][_0x37cb('0x9c')](),'local/')){if(this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x9d')]]){var _0x2a8f42=_[_0x37cb('0x8d')](this['queueReports'][_0x3fc1a3['linkedid']]);_0x2a8f42['queuecallercomplete']=![];_0x2a8f42['queuecallerexit']=!![];_0x2a8f42['queuecallerexitAt']=moment(_0x5b4ac1[_0x37cb('0x7d')])[_0x37cb('0x9e')](_0x3fc1a3['holdtime'],_0x37cb('0x9f'))[_0x37cb('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a8f42['queuecallerexitreason']=_0x37cb('0xa0');_0x2a8f42[_0x37cb('0xa1')]=!![];_0x2a8f42[_0x37cb('0xa2')]=_0x37cb('0xa3');_0x2a8f42['transferexten']=_0x3fc1a3['destexten'];_0x2a8f42[_0x37cb('0xa4')]=_0x3fc1a3[_0x37cb('0x51')];logger[_0x37cb('0x94')](_0x37cb('0xa5'),_0x2a8f42[_0x37cb('0x53')],_0x2a8f42[_0x37cb('0x70')]);var _0x252ba5=this[_0x37cb('0x10')][_0x3fc1a3['linkedid']];this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x9d')]]=this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x51')]];this[_0x37cb('0x10')][_0x3fc1a3[_0x37cb('0x51')]]=_0x252ba5;}}else{_0x5b4ac1['queuecallerexitreason']=_0x37cb('0xa6')+_0x3fc1a3[_0x37cb('0xa7')]['toUpperCase']();logger[_0x37cb('0x94')](_0x37cb('0xa8'),_0x5b4ac1['queue'],_0x5b4ac1[_0x37cb('0x70')],_0x5b4ac1[_0x37cb('0x88')]);}}}this[_0x37cb('0x12')][_0x3fc1a3['uniqueid']]=_0x5b4ac1;}}}catch(_0x4cecc2){logger[_0x37cb('0x47')]('[%s][voiceQueueReport][agentcomplete]',_0x3fc1a3['uniqueid'],util[_0x37cb('0x46')](_0x4cecc2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0x28')]=function(_0x238a9a){try{if(this['isNotNull'](_0x238a9a)){logger[_0x37cb('0x4e')]('[%s][voiceQueueReport][varset]',_0x238a9a[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x238a9a,{'showHidden':![],'depth':null}));this[_0x37cb('0xa9')](_0x238a9a[_0x37cb('0x51')],_[_0x37cb('0xaa')](_0x238a9a['variable'])[0x0],_0x238a9a['value']);if(this[_0x37cb('0x10')][_0x238a9a[_0x37cb('0x51')]]){var _0x380aa8=_[_0x37cb('0x8d')](this[_0x37cb('0x10')][_0x238a9a[_0x37cb('0x51')]]);if(_0x380aa8){if(this['isNotNull'](_0x238a9a[_0x37cb('0xab')])&&this[_0x37cb('0x76')](_0x238a9a[_0x37cb('0xab')]['queuestatus'])){switch(_0x238a9a[_0x37cb('0xac')]){case _0x37cb('0xad'):_0x380aa8['queuecallerexit']=![];_0x380aa8[_0x37cb('0xae')]=null;break;case'TIMEOUT':_0x380aa8[_0x37cb('0xaf')]='timeout';_0x380aa8['queuecallerexit']=!![];_0x380aa8['queuecallerexitAt']=moment()[_0x37cb('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x380aa8[_0x37cb('0x8e')]=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));logger['debug'](_0x37cb('0xb0'),_0x238a9a['uniqueid'],util['inspect'](_0x380aa8,{'showHidden':![],'depth':null}));ami['emit'](_0x37cb('0xb1'),_0x380aa8);break;default:_0x380aa8['queuecallerexit']=!![];_0x380aa8['queuecallerexitAt']=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));_0x380aa8[_0x37cb('0x8e')]=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));}_0x380aa8[_0x37cb('0x20')]=![];_0x380aa8['queuecallerabandonAt']=null;_0x380aa8[_0x37cb('0x88')]=_0x238a9a['value'];this[_0x37cb('0x12')][_0x238a9a[_0x37cb('0x51')]]=_0x380aa8;this[_0x37cb('0x4a')](_0x380aa8,_0x37cb('0x27'));}else if(this[_0x37cb('0x76')](_0x238a9a['variable'])&&this[_0x37cb('0x76')](_0x238a9a['variable'][_0x37cb('0xb2')])){if(!_0x380aa8[_0x37cb('0x20')]){_0x380aa8[_0x37cb('0x3c')]=!![];_0x380aa8[_0x37cb('0xae')]=moment()[_0x37cb('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x380aa8[_0x37cb('0x88')]=_0x37cb('0xb3');_0x380aa8[_0x37cb('0x8e')]=moment()[_0x37cb('0x58')](_0x37cb('0x7e'));this[_0x37cb('0x12')][_0x238a9a[_0x37cb('0x51')]]=_0x380aa8;}}logger['info'](_0x37cb('0xb4'),_0x238a9a[_0x37cb('0x51')],_0x380aa8['queue'],_0x380aa8[_0x37cb('0x70')],_['keys'](_0x238a9a[_0x37cb('0xab')])[0x0],_0x238a9a[_0x37cb('0xac')]);_0x380aa8[_0x37cb('0x16')]=this[_0x37cb('0x16')][_0x238a9a[_0x37cb('0x51')]];}}}}catch(_0x5bf4e2){logger[_0x37cb('0x47')](_0x37cb('0xb5'),_0x238a9a[_0x37cb('0x51')],util[_0x37cb('0x46')](_0x5bf4e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0xa9')]=function(_0x1a4002,_0x47a194,_0xb920c9){var _0x24be15=['rtpaudioqos',_0x37cb('0xb6'),_0x37cb('0xb7'),_0x37cb('0xb8'),'rtpaudioqosloss',_0x37cb('0xb9'),_0x37cb('0xba'),'rtpaudioqosrttbridged',_0x37cb('0xbb'),_0x37cb('0xbc'),_0x37cb('0xbd'),_0x37cb('0xbe'),_0x37cb('0xbf'),_0x37cb('0xc0'),_0x37cb('0xc1'),_0x37cb('0xc2'),_0x37cb('0x98'),'memberpenalty','memberrealtime'];if(!_[_0x37cb('0x40')](_0x47a194)&&!_[_0x37cb('0xc3')](_0x24be15,_0x47a194)){if(_[_0x37cb('0x60')](this[_0x37cb('0x16')][_0x1a4002])){this[_0x37cb('0x16')][_0x1a4002]={};}this['variables'][_0x1a4002][_0x47a194]=_0xb920c9;}};VoiceQueueReport[_0x37cb('0x3e')][_0x37cb('0xc4')]=function(_0x461be9,_0x117e7e,_0x3d88bc){var _0x5dbc48={};for(var _0x1de3ae=0x0;_0x1de3ae=0x0?moment(_0x4e6e98[_0x2f6d('0x16')])['diff'](_0x4e6e98[_0x2f6d('0x17')],_0x2f6d('0xf')):null,'data1':_0x2f6d('0x18'),'data2':_0x4e6e98[_0x2f6d('0x14')],'data3':_0x4e6e98[_0x2f6d('0x11')],'data4':_0x4e6e98[_0x2f6d('0x19')]||null,'role':'agent','internal':_0x4e6e98[_0x2f6d('0x14')]?_['toNumber'](_0x4e6e98['accountcode']):undefined,'uniqueid':_0x4e6e98[_0x2f6d('0x1a')]},'log':_0x2f6d('0x6')});}; \ No newline at end of file +var _0xd609=['voice','isNil','interface','format','queuecallerleaveAt','diff','calleridnum','exten','agent','toNumber','accountcode','voiceDialReport','membername','TALKING','starttime','endtime','seconds','outbound','dialstring','uniqueid','moment','lodash','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport'];(function(_0x207106,_0x4dcac4){var _0x50b6e3=function(_0x17bb1d){while(--_0x17bb1d){_0x207106['push'](_0x207106['shift']());}};_0x50b6e3(++_0x4dcac4);}(_0xd609,0x107));var _0x9d60=function(_0x3aeb3b,_0x59e630){_0x3aeb3b=_0x3aeb3b-0x0;var _0x1d3d53=_0xd609[_0x3aeb3b];return _0x1d3d53;};'use strict';var moment=require(_0x9d60('0x0'));var _=require(_0x9d60('0x1'));var util=require('util');var client=require(_0x9d60('0x2'));exports[_0x9d60('0x3')]=function(_0xc46ed7){var _0x105851=_0xc46ed7['queuecallercompleteAt']||_0xc46ed7[_0x9d60('0x4')];return client[_0x9d60('0x5')](_0x9d60('0x6'),{'body':{'channel':_0x9d60('0x7'),'membername':_0xc46ed7['lastAssignedTo'],'interface':_[_0x9d60('0x8')](_0xc46ed7[_0x9d60('0x9')])?util[_0x9d60('0xa')]('SIP/%s',_0xc46ed7['lastAssignedTo']):_0xc46ed7[_0x9d60('0x9')],'type':'TALKING','enterAt':_0xc46ed7[_0x9d60('0xb')],'exitAt':_0x105851,'duration':moment(_0x105851)[_0x9d60('0xc')](_0xc46ed7[_0x9d60('0xb')],'seconds'),'data1':'inbound','data2':_0xc46ed7[_0x9d60('0xd')],'data3':_0xc46ed7[_0x9d60('0xe')],'data4':null,'data5':_0xc46ed7['queue'],'role':_0x9d60('0xf'),'internal':_0xc46ed7['accountcode']?_[_0x9d60('0x10')](_0xc46ed7[_0x9d60('0x11')]):undefined,'uniqueid':_0xc46ed7['uniqueid']},'log':_0x9d60('0x6')});};exports[_0x9d60('0x12')]=function(_0x355ec3){return client['Request'](_0x9d60('0x6'),{'body':{'channel':_0x9d60('0x7'),'membername':_0x355ec3[_0x9d60('0x13')],'interface':_0x355ec3[_0x9d60('0x9')],'type':_0x9d60('0x14'),'enterAt':_0x355ec3[_0x9d60('0x15')],'exitAt':_0x355ec3[_0x9d60('0x16')],'duration':moment(_0x355ec3[_0x9d60('0x16')])[_0x9d60('0xc')](_0x355ec3[_0x9d60('0x15')],_0x9d60('0x17'))>=0x0?moment(_0x355ec3[_0x9d60('0x16')])[_0x9d60('0xc')](_0x355ec3[_0x9d60('0x15')],_0x9d60('0x17')):null,'data1':_0x9d60('0x18'),'data2':_0x355ec3['accountcode'],'data3':_0x355ec3['exten'],'data4':_0x355ec3[_0x9d60('0x19')]||null,'role':_0x9d60('0xf'),'internal':_0x355ec3['accountcode']?_[_0x9d60('0x10')](_0x355ec3[_0x9d60('0x11')]):undefined,'uniqueid':_0x355ec3[_0x9d60('0x1a')]},'log':_0x9d60('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d459e62..8874786 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 _0x28f2=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x5e5f5a,_0x5cb19a){var _0x4141ae=function(_0x4bb2ea){while(--_0x4bb2ea){_0x5e5f5a['push'](_0x5e5f5a['shift']());}};_0x4141ae(++_0x5cb19a);}(_0x28f2,0x193));var _0x228f=function(_0x29827b,_0x2c2f17){_0x29827b=_0x29827b-0x0;var _0x3767e7=_0x28f2[_0x29827b];return _0x3767e7;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(){return client[_0x228f('0x2')](_0x228f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x228f('0x4'),'previewRecallmeReminderInterval']},'log':_0x228f('0x5')});}; \ No newline at end of file +var _0x64eb=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x329d8d,_0x48b6c2){var _0x3bf18f=function(_0x151e83){while(--_0x151e83){_0x329d8d['push'](_0x329d8d['shift']());}};_0x3bf18f(++_0x48b6c2);}(_0x64eb,0xc6));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xb64e('0x0'));exports[_0xb64e('0x1')]=function(){return client['Request'](_0xb64e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xb64e('0x3')]},'log':_0xb64e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index e0b7a6a..928b1f9 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 _0x584e=['Request','html','GetTemplate','../client'];(function(_0x21c23e,_0x1d33e3){var _0xa7b7e2=function(_0x6ac2a8){while(--_0x6ac2a8){_0x21c23e['push'](_0x21c23e['shift']());}};_0xa7b7e2(++_0x1d33e3);}(_0x584e,0xa3));var _0xe584=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x584e[_0x454e6d];return _0x4bc294;};'use strict';var client=require(_0xe584('0x0'));exports['getTemplates']=function(_0x298634){return function(_0x420d0e){return client[_0xe584('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0xe584('0x2')]},'log':_0xe584('0x3')});};}; \ No newline at end of file +var _0x176a=['GetTemplate','html','../client','Request'];(function(_0x1490a9,_0x1cf7f2){var _0x418c4a=function(_0x4654fe){while(--_0x4654fe){_0x1490a9['push'](_0x1490a9['shift']());}};_0x418c4a(++_0x1cf7f2);}(_0x176a,0x8a));var _0xa176=function(_0xff7646,_0x5dfd0f){_0xff7646=_0xff7646-0x0;var _0x279698=_0x176a[_0xff7646];return _0x279698;};'use strict';var client=require(_0xa176('0x0'));exports['getTemplates']=function(_0x5cca11){return function(_0x506343){return client[_0xa176('0x1')](_0xa176('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xa176('0x3')]},'log':_0xa176('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index af3f6f9..13d42e5 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 _0x73de=['Actions','action','data1','data2','data5','data6','data7','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action'];(function(_0x1f6b27,_0x4fe06e){var _0x2017f0=function(_0x549a25){while(--_0x549a25){_0x1f6b27['push'](_0x1f6b27['shift']());}};_0x2017f0(++_0x4fe06e);}(_0x73de,0xc5));var _0xe73d=function(_0x1add90,_0x5465f7){_0x1add90=_0x1add90-0x0;var _0x1a246a=_0x73de[_0x1add90];return _0x1a246a;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x31e779){return function(_0x4b8e75){return client[_0xe73d('0x0')](_0xe73d('0x1'),{'options':{'raw':![],'attributes':['id',_0xe73d('0x2'),_0xe73d('0x3'),_0xe73d('0x4')],'include':[{'model':_0xe73d('0x5'),'as':_0xe73d('0x6'),'attributes':['id',_0xe73d('0x7'),_0xe73d('0x8'),_0xe73d('0x9')]},{'model':_0xe73d('0x5'),'as':_0xe73d('0xa'),'attributes':['id',_0xe73d('0x7'),_0xe73d('0x8'),_0xe73d('0x9')]},{'model':_0xe73d('0xb'),'as':_0xe73d('0xc'),'attributes':['id',_0xe73d('0xd'),_0xe73d('0xe'),_0xe73d('0xf'),'data3','data4',_0xe73d('0x10'),_0xe73d('0x11'),_0xe73d('0x12')]}]},'log':_0xe73d('0x1')});};}; \ No newline at end of file +var _0xe5fc=['data5','data7','GetTrigger','../client','getTriggers','name','channel','status','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions','data1','data2','data3','data4'];(function(_0x282494,_0x4b59d0){var _0x5c79e5=function(_0x55f4bf){while(--_0x55f4bf){_0x282494['push'](_0x282494['shift']());}};_0x5c79e5(++_0x4b59d0);}(_0xe5fc,0x12f));var _0xce5f=function(_0x18af5e,_0x3e44b8){_0x18af5e=_0x18af5e-0x0;var _0x2a4a45=_0xe5fc[_0x18af5e];return _0x2a4a45;};'use strict';var client=require(_0xce5f('0x0'));exports[_0xce5f('0x1')]=function(_0x1e3af1){return function(_0x44310a){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xce5f('0x2'),_0xce5f('0x3'),_0xce5f('0x4')],'include':[{'model':'Condition','as':_0xce5f('0x5'),'attributes':['id',_0xce5f('0x6'),_0xce5f('0x7'),_0xce5f('0x8')]},{'model':_0xce5f('0x9'),'as':_0xce5f('0xa'),'attributes':['id',_0xce5f('0x6'),_0xce5f('0x7'),_0xce5f('0x8')]},{'model':_0xce5f('0xb'),'as':_0xce5f('0xc'),'attributes':['id','action',_0xce5f('0xd'),_0xce5f('0xe'),_0xce5f('0xf'),_0xce5f('0x10'),_0xce5f('0x11'),'data6',_0xce5f('0x12')]}]},'log':_0xce5f('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b98142c..4d214ba 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 _0xae7a=['defaultuser','../client','getTrunks','GetTrunk','name'];(function(_0x5b4f50,_0x326bd1){var _0x2d4748=function(_0x482d75){while(--_0x482d75){_0x5b4f50['push'](_0x5b4f50['shift']());}};_0x2d4748(++_0x326bd1);}(_0xae7a,0x1a0));var _0xaae7=function(_0x434b31,_0x1e7782){_0x434b31=_0x434b31-0x0;var _0x4e262e=_0xae7a[_0x434b31];return _0x4e262e;};'use strict';var client=require(_0xaae7('0x0'));exports[_0xaae7('0x1')]=function(_0x4e505a){return function(_0x504597){return client['Request'](_0xaae7('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xaae7('0x3'),'registry',_0xaae7('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x6f7f=['Request','GetTrunk','registry','getTrunks'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6f7f,0x177));var _0xf6f7=function(_0xf6235e,_0x54b6d4){_0xf6235e=_0xf6235e-0x0;var _0x211352=_0x6f7f[_0xf6235e];return _0x211352;};'use strict';var client=require('../client');exports[_0xf6f7('0x0')]=function(_0x2d025d){return function(_0x2b4ee7){return client[_0xf6f7('0x1')](_0xf6f7('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xf6f7('0x3'),'defaultuser']},'log':_0xf6f7('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d83e050..ec7dbce 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x1d3bb5,_0x30add5){var _0x134674=function(_0x2b841a){while(--_0x2b841a){_0x1d3bb5['push'](_0x1d3bb5['shift']());}};_0x134674(++_0x30add5);}(_0xedd9,0xfc));var _0x9edd=function(_0x38d0e8,_0x4ad4bc){_0x38d0e8=_0x38d0e8-0x0;var _0x5f5b63=_0xedd9[_0x38d0e8];return _0x5f5b63;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4c444c,_0x22adba){var _0x883fbc=function(_0x40c100){while(--_0x40c100){_0x4c444c['push'](_0x4c444c['shift']());}};_0x883fbc(++_0x22adba);}(_0xedd9,0xfc));var _0x9edd=function(_0x44a8ec,_0xe17393){_0x44a8ec=_0x44a8ec-0x0;var _0x8f7d06=_0xedd9[_0x44a8ec];return _0x8f7d06;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c342af4..91ffed0 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 _0x3605=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x3df5e0,_0x1a0a53){var _0x494b26=function(_0x3eb9ad){while(--_0x3eb9ad){_0x3df5e0['push'](_0x3df5e0['shift']());}};_0x494b26(++_0x1a0a53);}(_0x3605,0x192));var _0x5360=function(_0x12e5b7,_0xac482){_0x12e5b7=_0x12e5b7-0x0;var _0x4f392b=_0x3605[_0x12e5b7];return _0x4f392b;};'use strict';var client=require(_0x5360('0x0'));exports[_0x5360('0x1')]=function(_0x467eb5){return client[_0x5360('0x2')](_0x5360('0x3'),{'body':_0x467eb5,'log':_0x5360('0x3')});};exports[_0x5360('0x4')]=function(_0x486b00,_0x3ca318,_0x5c3f5b){return client[_0x5360('0x2')](_0x5360('0x5'),{'body':_0x486b00,'options':{'where':{'uniqueid':_0x3ca318,'interface':_0x5c3f5b,'agentcomplete':!![]}},'log':_0x5360('0x5')});}; \ No newline at end of file +var _0xec67=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xec67,0x1e1));var _0x7ec6=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xec67[_0x532d78];return _0x5990c4;};'use strict';var client=require(_0x7ec6('0x0'));exports[_0x7ec6('0x1')]=function(_0x58b001){return client[_0x7ec6('0x2')](_0x7ec6('0x3'),{'body':_0x58b001,'log':_0x7ec6('0x3')});};exports['update']=function(_0x56d768,_0x5b5aaf,_0x8bfd27){return client[_0x7ec6('0x2')](_0x7ec6('0x4'),{'body':_0x56d768,'options':{'where':{'uniqueid':_0x5b5aaf,'interface':_0x8bfd27,'agentcomplete':!![]}},'log':_0x7ec6('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 54d1380..44f193c 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 _0x62c7=['CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request'];(function(_0x4197e8,_0x466fb8){var _0x5b6b00=function(_0x486b58){while(--_0x486b58){_0x4197e8['push'](_0x4197e8['shift']());}};_0x5b6b00(++_0x466fb8);}(_0x62c7,0x1db));var _0x762c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62c7[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x762c('0x0'));var util=require(_0x762c('0x1'));var _=require(_0x762c('0x2'));var client=require(_0x762c('0x3'));exports['create']=function(_0x4bfe2b){return client[_0x762c('0x4')](_0x762c('0x5'),{'body':_[_0x762c('0x6')](_0x4bfe2b,{'source':_0x4bfe2b['calleridnum'],'destinationcontext':_0x4bfe2b[_0x762c('0x7')],'callerid':_0x4bfe2b[_0x762c('0x8')],'amaflags':_0x762c('0x9')}),'log':_0x762c('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x762c('0x4')](_0x762c('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x762c('0xb')](_0x762c('0xc'))[_0x762c('0xd')](_0x762c('0xe')),moment()[_0x762c('0xf')](_0x762c('0xc'))[_0x762c('0xd')](_0x762c('0xe'))]}},'attributes':[_0x762c('0x10'),_0x762c('0x11'),'duration',_0x762c('0x12')]},'log':_0x762c('0x13')});};}; \ No newline at end of file +var _0x089d=['callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','calleridnum','context'];(function(_0x4f3288,_0x3e5fae){var _0x24786c=function(_0x5e1083){while(--_0x5e1083){_0x4f3288['push'](_0x4f3288['shift']());}};_0x24786c(++_0x3e5fae);}(_0x089d,0xca));var _0xd089=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x089d[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require(_0xd089('0x0'));var util=require(_0xd089('0x1'));var _=require(_0xd089('0x2'));var client=require('../client');exports['create']=function(_0x398d46){return client[_0xd089('0x3')](_0xd089('0x4'),{'body':_['merge'](_0x398d46,{'source':_0x398d46[_0xd089('0x5')],'destinationcontext':_0x398d46[_0xd089('0x6')],'callerid':_0x398d46[_0xd089('0x7')],'amaflags':_0xd089('0x8')}),'log':_0xd089('0x4')});};exports[_0xd089('0x9')]=function(){return function(){return client[_0xd089('0x3')](_0xd089('0xa'),{'options':{'where':{'type':[_0xd089('0xb')],'createdAt':{'$between':[moment()[_0xd089('0xc')]('day')[_0xd089('0xd')](_0xd089('0xe')),moment()['endOf']('day')[_0xd089('0xd')](_0xd089('0xe'))]}},'attributes':[_0xd089('0xf'),_0xd089('0x10'),_0xd089('0x11'),'billableseconds']},'log':_0xd089('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 57b5707..82c4b64 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 _0xbe94=['Request','CreateVoiceDialReport','../client','create'];(function(_0x322e89,_0x29cc1d){var _0x88f22b=function(_0x1aedce){while(--_0x1aedce){_0x322e89['push'](_0x322e89['shift']());}};_0x88f22b(++_0x29cc1d);}(_0xbe94,0x126));var _0x4be9=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xbe94[_0x5eb22e];return _0x27fed5;};'use strict';var client=require(_0x4be9('0x0'));exports[_0x4be9('0x1')]=function(_0x224254){return client[_0x4be9('0x2')](_0x4be9('0x3'),{'body':_0x224254,'log':_0x4be9('0x3')});}; \ No newline at end of file +var _0x59f0=['../client','create','Request','CreateVoiceDialReport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x59f0,0x118));var _0x059f=function(_0x42b9fe,_0x1db8cb){_0x42b9fe=_0x42b9fe-0x0;var _0x58c2f0=_0x59f0[_0x42b9fe];return _0x58c2f0;};'use strict';var client=require(_0x059f('0x0'));exports[_0x059f('0x1')]=function(_0x551e6f){return client[_0x059f('0x2')](_0x059f('0x3'),{'body':_0x551e6f,'log':_0x059f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 79ef87e..4d086a5 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 _0x2242=['getVoiceExtensions','Request','exten','recordingFormat','../client'];(function(_0x531cd1,_0x554a6d){var _0x49c479=function(_0x1c0a94){while(--_0x1c0a94){_0x531cd1['push'](_0x531cd1['shift']());}};_0x49c479(++_0x554a6d);}(_0x2242,0x1a3));var _0x2224=function(_0x132c0d,_0x37a413){_0x132c0d=_0x132c0d-0x0;var _0x9b4679=_0x2242[_0x132c0d];return _0x9b4679;};'use strict';var client=require(_0x2224('0x0'));exports[_0x2224('0x1')]=function(){return function(){return client[_0x2224('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x2224('0x3'),_0x2224('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xb43b=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x15cca8,_0x8fd236){var _0x16bdb4=function(_0x5a105a){while(--_0x5a105a){_0x15cca8['push'](_0x15cca8['shift']());}};_0x16bdb4(++_0x8fd236);}(_0xb43b,0x1b2));var _0xbb43=function(_0x7e5542,_0x2d4550){_0x7e5542=_0x7e5542-0x0;var _0x576f75=_0xb43b[_0x7e5542];return _0x576f75;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(){return function(){return client['Request'](_0xbb43('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbb43('0x3'),_0xbb43('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4cc6dab..a152a96 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 _0x38bd=['type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','active','Pause','mandatoryDispositionPause','name','Trunk','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x38bd,0x1cb));var _0xd38b=function(_0x485a85,_0x42a9df){_0x485a85=_0x485a85-0x0;var _0x13338f=_0x38bd[_0x485a85];return _0x13338f;};'use strict';var client=require('../client');exports[_0xd38b('0x0')]=function(){return function(){return client[_0xd38b('0x1')](_0xd38b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd38b('0x3'),_0xd38b('0x4'),'autopause','monitor_format',_0xd38b('0x5'),_0xd38b('0x6'),_0xd38b('0x7'),_0xd38b('0x8'),_0xd38b('0x9'),'dialPowerLevel',_0xd38b('0xa'),_0xd38b('0xb'),_0xd38b('0xc'),_0xd38b('0xd'),_0xd38b('0xe'),'dialOriginateTimeout',_0xd38b('0xf'),_0xd38b('0x10'),'dialQueueProject','dialCongestionMaxRetry',_0xd38b('0x11'),_0xd38b('0x12'),_0xd38b('0x13'),_0xd38b('0x14'),_0xd38b('0x15'),_0xd38b('0x16'),_0xd38b('0x17'),_0xd38b('0x18'),_0xd38b('0x19'),_0xd38b('0x1a'),_0xd38b('0x1b'),'dialAMDInitialSilence',_0xd38b('0x1c'),_0xd38b('0x1d'),'dialAMDTotalAnalysisTime',_0xd38b('0x1e'),'dialAMDBetweenWordsSilence',_0xd38b('0x1f'),_0xd38b('0x20'),_0xd38b('0x21'),'timeout',_0xd38b('0x22'),_0xd38b('0x23'),_0xd38b('0x24'),_0xd38b('0x25'),_0xd38b('0x26'),'dialQueueProject2','monitor_format','strategy',_0xd38b('0x27'),'dialCutDigit',_0xd38b('0x28'),'dialNoSuchNumberRetryFrequency',_0xd38b('0x29'),'dialDropRetryFrequency',_0xd38b('0x2a'),'dialAbandonedRetryFrequency',_0xd38b('0x2b'),_0xd38b('0x2c'),_0xd38b('0x2d'),_0xd38b('0x2e'),_0xd38b('0x2f'),_0xd38b('0x30'),_0xd38b('0x31'),_0xd38b('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name','callerid',_0xd38b('0x33')]},{'model':_0xd38b('0x34'),'as':_0xd38b('0x35'),'attributes':['id',_0xd38b('0x36')]},{'model':_0xd38b('0x37'),'as':'TrunkBackup','attributes':['id',_0xd38b('0x36'),'callerid','active']},{'model':_0xd38b('0x38'),'as':_0xd38b('0x38'),'attributes':['id',_0xd38b('0x36')],'include':[{'model':_0xd38b('0x38'),'as':'Intervals','attributes':['id',_0xd38b('0x36'),_0xd38b('0x39')]}]}]},'log':_0xd38b('0x0')});};}; \ No newline at end of file +var _0x4e3d=['Trunk','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'];(function(_0x5ac6b5,_0x4d5fad){var _0x530832=function(_0x7ff482){while(--_0x7ff482){_0x5ac6b5['push'](_0x5ac6b5['shift']());}};_0x530832(++_0x4d5fad);}(_0x4e3d,0x14b));var _0xd4e3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4e3d[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require('../client');exports[_0xd4e3('0x0')]=function(){return function(){return client['Request'](_0xd4e3('0x1'),{'options':{'raw':![],'attributes':['id',_0xd4e3('0x2'),_0xd4e3('0x3'),_0xd4e3('0x4'),'autopause','monitor_format','type',_0xd4e3('0x5'),_0xd4e3('0x6'),_0xd4e3('0x7'),'dialLimitQueue',_0xd4e3('0x8'),_0xd4e3('0x9'),_0xd4e3('0xa'),_0xd4e3('0xb'),_0xd4e3('0xc'),'dialOriginateCallerIdNumber',_0xd4e3('0xd'),'dialQueueOptions',_0xd4e3('0xe'),_0xd4e3('0xf'),_0xd4e3('0x10'),_0xd4e3('0x11'),_0xd4e3('0x12'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xd4e3('0x13'),_0xd4e3('0x14'),'dialTimezone','dialGlobalInterval',_0xd4e3('0x15'),_0xd4e3('0x16'),_0xd4e3('0x17'),'dialAMDInitialSilence',_0xd4e3('0x18'),_0xd4e3('0x19'),_0xd4e3('0x1a'),_0xd4e3('0x1b'),'dialAMDBetweenWordsSilence',_0xd4e3('0x1c'),_0xd4e3('0x1d'),'dialAMDMaximumWordLength',_0xd4e3('0x1e'),_0xd4e3('0x1f'),'dialRecallInQueue','dialOrderByScheduledAt',_0xd4e3('0x20'),_0xd4e3('0x21'),'dialQueueProject2',_0xd4e3('0x22'),'strategy',_0xd4e3('0x23'),_0xd4e3('0x24'),_0xd4e3('0x25'),_0xd4e3('0x26'),_0xd4e3('0x27'),'dialDropRetryFrequency',_0xd4e3('0x28'),'dialAbandonedRetryFrequency',_0xd4e3('0x29'),'dialMachineRetryFrequency',_0xd4e3('0x2a'),_0xd4e3('0x2b'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0xd4e3('0x2c'),_0xd4e3('0x2d'),_0xd4e3('0x2e')],'include':[{'model':_0xd4e3('0x2f'),'as':'Trunk','attributes':['id',_0xd4e3('0x2'),'callerid',_0xd4e3('0x30')]},{'model':'Pause','as':_0xd4e3('0x31'),'attributes':['id',_0xd4e3('0x2')]},{'model':'Trunk','as':_0xd4e3('0x32'),'attributes':['id','name',_0xd4e3('0x33'),_0xd4e3('0x30')]},{'model':_0xd4e3('0x34'),'as':_0xd4e3('0x34'),'attributes':['id',_0xd4e3('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xd4e3('0x2'),_0xd4e3('0x35')]}]}]},'log':_0xd4e3('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 54d85c7..a7f19a1 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(_0x38de0e,_0xbf1ad1){var _0xe5433d=function(_0x13716e){while(--_0x13716e){_0x38de0e['push'](_0x38de0e['shift']());}};_0xe5433d(++_0xbf1ad1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x3d5489,_0x332b8b){var _0x200432=function(_0xd545b7){while(--_0xd545b7){_0x3d5489['push'](_0x3d5489['shift']());}};_0x200432(++_0x332b8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 1a1e22a..b67f0c7 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 _0xfe34=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x53107e,_0x538415){var _0x178878=function(_0xe9e688){while(--_0xe9e688){_0x53107e['push'](_0x53107e['shift']());}};_0x178878(++_0x538415);}(_0xfe34,0xd3));var _0x4fe3=function(_0x921ef,_0x1f3f7e){_0x921ef=_0x921ef-0x0;var _0x11d378=_0xfe34[_0x921ef];return _0x11d378;};'use strict';var client=require(_0x4fe3('0x0'));exports[_0x4fe3('0x1')]=function(_0x52adb4){return function(){return client[_0x4fe3('0x2')](_0x4fe3('0x3'),{'options':{'where':{'VoiceQueueId':_0x52adb4,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x2de0=['Request','getVoiceQueueRtPauses','../client'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x2de0,0x98));var _0x02de=function(_0x14c94b,_0x2ca2ec){_0x14c94b=_0x14c94b-0x0;var _0x48e5f5=_0x2de0[_0x14c94b];return _0x48e5f5;};'use strict';var client=require(_0x02de('0x0'));exports['getVoiceQueueRtPauses']=function(_0x5f101c){return function(){return client[_0x02de('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5f101c,'paused':!![]},'raw':!![]},'log':_0x02de('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 1fa35c4..43afb36 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(_0x4c5618,_0x5b7dcb){var _0x3d4828=function(_0x1d0fbb){while(--_0x1d0fbb){_0x4c5618['push'](_0x4c5618['shift']());}};_0x3d4828(++_0x5b7dcb);}(_0x7a54,0x106));var _0x47a5=function(_0xc50498,_0x112fd4){_0xc50498=_0xc50498-0x0;var _0x34ce47=_0x7a54[_0xc50498];return _0x34ce47;};'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(_0x369cae,_0x584825){var _0x2f7925=function(_0x31f9a4){while(--_0x31f9a4){_0x369cae['push'](_0x369cae['shift']());}};_0x2f7925(++_0x584825);}(_0x7a54,0x106));var _0x47a5=function(_0x47731d,_0x373604){_0x47731d=_0x47731d-0x0;var _0x243666=_0x7a54[_0x47731d];return _0x243666;};'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 cea044d..5a00b26 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 _0x38d2=['transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client'];(function(_0x143c8c,_0x1fad74){var _0x5acec0=function(_0x315b23){while(--_0x315b23){_0x143c8c['push'](_0x143c8c['shift']());}};_0x5acec0(++_0x1fad74);}(_0x38d2,0x107));var _0x238d=function(_0x3f8f66,_0x4db283){_0x3f8f66=_0x3f8f66-0x0;var _0x330489=_0x38d2[_0x3f8f66];return _0x330489;};'use strict';var client=require(_0x238d('0x0'));exports[_0x238d('0x1')]={};exports[_0x238d('0x2')]=function(_0xe2a752){return client['Request'](_0x238d('0x3'),{'body':{'result':_0xe2a752[_0x238d('0x4')],'transfererchannel':_0xe2a752[_0x238d('0x5')],'transferercalleridnum':_0xe2a752['transferercalleridnum'],'transferercalleridname':_0xe2a752[_0x238d('0x6')],'transfererconnectedlinenum':_0xe2a752[_0x238d('0x7')],'transfererconnectedlinename':_0xe2a752[_0x238d('0x8')],'transfereraccountcode':_0xe2a752['transfereraccountcode'],'transferercontext':_0xe2a752[_0x238d('0x9')],'transfererexten':_0xe2a752[_0x238d('0xa')],'transfererlinkedid':_0xe2a752[_0x238d('0xb')],'transfereechannel':_0xe2a752[_0x238d('0xc')],'transfereecalleridnum':_0xe2a752[_0x238d('0xd')],'transfereecalleridname':_0xe2a752[_0x238d('0xe')],'transfereeconnectedlinenum':_0xe2a752[_0x238d('0xf')],'transfereeconnectedlinename':_0xe2a752[_0x238d('0x10')],'transfereeaccountcode':_0xe2a752[_0x238d('0x11')],'transfereecontext':_0xe2a752['transfereecontext'],'transfereeexten':_0xe2a752[_0x238d('0x12')],'transfereelinkedid':_0xe2a752[_0x238d('0x13')],'isexternal':_0xe2a752[_0x238d('0x14')],'context':_0xe2a752['context'],'extension':_0xe2a752[_0x238d('0x15')],'type':_0x238d('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x238d('0x17')]=function(_0x30db45){return client['Request'](_0x238d('0x3'),{'body':{'result':_0x30db45[_0x238d('0x4')],'transfererchannel':_0x30db45[_0x238d('0x18')],'transferercalleridnum':_0x30db45[_0x238d('0x19')],'transferercalleridname':_0x30db45[_0x238d('0x1a')],'transfererconnectedlinenum':_0x30db45[_0x238d('0x1b')],'transfererconnectedlinename':_0x30db45[_0x238d('0x1c')],'transfereraccountcode':_0x30db45[_0x238d('0x1d')],'transferercontext':_0x30db45['secondtransferercontext'],'transfererexten':_0x30db45[_0x238d('0x1e')],'transfererlinkedid':_0x30db45[_0x238d('0x1f')],'transfereechannel':_0x30db45[_0x238d('0x20')],'transfereecalleridnum':_0x30db45[_0x238d('0x21')],'transfereecalleridname':_0x30db45[_0x238d('0x22')],'transfereeconnectedlinenum':_0x30db45[_0x238d('0x23')],'transfereeconnectedlinename':_0x30db45[_0x238d('0x24')],'transfereeaccountcode':_0x30db45[_0x238d('0x25')],'transfereecontext':_0x30db45[_0x238d('0x26')],'transfereeexten':_0x30db45[_0x238d('0x27')],'transfereelinkedid':_0x30db45[_0x238d('0x28')],'isexternal':_0x30db45[_0x238d('0x14')],'context':_0x30db45[_0x238d('0x29')],'extension':_0x30db45[_0x238d('0x2a')],'type':_0x238d('0x2b')},'log':_0x238d('0x3')});}; \ No newline at end of file +var _0xe8c1=['origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x423c83,_0x4ab4b2){var _0x2a48d0=function(_0x57e0ba){while(--_0x57e0ba){_0x423c83['push'](_0x423c83['shift']());}};_0x2a48d0(++_0x4ab4b2);}(_0xe8c1,0x1b8));var _0x1e8c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xe8c1[_0x19b3f9];return _0x18c3f6;};'use strict';var client=require(_0x1e8c('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x110922){return client[_0x1e8c('0x1')](_0x1e8c('0x2'),{'body':{'result':_0x110922[_0x1e8c('0x3')],'transfererchannel':_0x110922[_0x1e8c('0x4')],'transferercalleridnum':_0x110922[_0x1e8c('0x5')],'transferercalleridname':_0x110922[_0x1e8c('0x6')],'transfererconnectedlinenum':_0x110922[_0x1e8c('0x7')],'transfererconnectedlinename':_0x110922[_0x1e8c('0x8')],'transfereraccountcode':_0x110922[_0x1e8c('0x9')],'transferercontext':_0x110922[_0x1e8c('0xa')],'transfererexten':_0x110922['transfererexten'],'transfererlinkedid':_0x110922[_0x1e8c('0xb')],'transfereechannel':_0x110922[_0x1e8c('0xc')],'transfereecalleridnum':_0x110922[_0x1e8c('0xd')],'transfereecalleridname':_0x110922[_0x1e8c('0xe')],'transfereeconnectedlinenum':_0x110922[_0x1e8c('0xf')],'transfereeconnectedlinename':_0x110922[_0x1e8c('0x10')],'transfereeaccountcode':_0x110922[_0x1e8c('0x11')],'transfereecontext':_0x110922[_0x1e8c('0x12')],'transfereeexten':_0x110922['transfereeexten'],'transfereelinkedid':_0x110922[_0x1e8c('0x13')],'isexternal':_0x110922[_0x1e8c('0x14')],'context':_0x110922[_0x1e8c('0x15')],'extension':_0x110922['extension'],'type':'blind'},'log':_0x1e8c('0x2')});};exports[_0x1e8c('0x16')]=function(_0x1aab55){return client[_0x1e8c('0x1')](_0x1e8c('0x2'),{'body':{'result':_0x1aab55[_0x1e8c('0x3')],'transfererchannel':_0x1aab55[_0x1e8c('0x17')],'transferercalleridnum':_0x1aab55[_0x1e8c('0x18')],'transferercalleridname':_0x1aab55['origtransferercalleridname'],'transfererconnectedlinenum':_0x1aab55[_0x1e8c('0x19')],'transfererconnectedlinename':_0x1aab55[_0x1e8c('0x1a')],'transfereraccountcode':_0x1aab55[_0x1e8c('0x1b')],'transferercontext':_0x1aab55['secondtransferercontext'],'transfererexten':_0x1aab55['secondtransfererexten'],'transfererlinkedid':_0x1aab55[_0x1e8c('0x1c')],'transfereechannel':_0x1aab55['transfertargetchannel'],'transfereecalleridnum':_0x1aab55[_0x1e8c('0x1d')],'transfereecalleridname':_0x1aab55[_0x1e8c('0x1e')],'transfereeconnectedlinenum':_0x1aab55[_0x1e8c('0x1f')],'transfereeconnectedlinename':_0x1aab55[_0x1e8c('0x20')],'transfereeaccountcode':_0x1aab55[_0x1e8c('0x21')],'transfereecontext':_0x1aab55[_0x1e8c('0x22')],'transfereeexten':_0x1aab55[_0x1e8c('0x23')],'transfereelinkedid':_0x1aab55[_0x1e8c('0x24')],'isexternal':_0x1aab55[_0x1e8c('0x14')],'context':_0x1aab55[_0x1e8c('0x25')],'extension':_0x1aab55['origtransfererexten'],'type':_0x1e8c('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index fed6755..124497d 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 _0xf072=['outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','voiceQueues','push','length','find','omit','undefined','channels','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','rec','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','inbound','outbound','filter','type','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0xf072,0x1cf));var _0x2f07=function(_0x438eb2,_0x163fde){_0x438eb2=_0x438eb2-0x0;var _0x3663cf=_0xf072[_0x438eb2];return _0x3663cf;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var jayson=require(_0x2f07('0x2'));var schema=require('validate');var moment=require(_0x2f07('0x3'));var config=require('../../../config/environment');var properties=require(_0x2f07('0x4'));var ami=require(_0x2f07('0x5'));var VoiceQueueSummary=require(_0x2f07('0x6'));exports['listen']=function(_0x1d5a33,_0x14d6e6,_0x3643bb){return new Promise(function(_0x2e6422,_0x235418){var _0xf73d1a={'QueuePause':function(_0x33b99c){return new Promise(function(_0x379b2e){var _0x4746c2=util[_0x2f07('0x7')](_0x2f07('0x8'),_0x2f07('0x9'),_0x33b99c[_0x2f07('0xa')]);if(_0x1d5a33[_0x2f07('0xb')]&&_0x1d5a33[_0x2f07('0xb')][_0x4746c2]&&_0x1d5a33['timers'][_0x4746c2][_0x2f07('0xc')]){_0x1d5a33[_0x2f07('0xb')][_0x4746c2][_0x2f07('0xd')]();}if(_0x1d5a33[_0x2f07('0xe')][_0x4746c2]){_0x1d5a33['agents'][_0x4746c2]['updateStatusRealtime']({'statePause':_0x33b99c[_0x2f07('0xf')]?!![]:![]});}_0x379b2e({'code':0xc8,'message':_0x2f07('0x10')});});},'Reload':function(_0x58549c){var _0x6eb88a=this;return new Promise(function(_0x34dbd4,_0x26edfa){if(ami['isConnected']()==![]){return _0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}_0x58549c=_['pick'](_0x58549c,_[_0x2f07('0x16')](properties['reload'][_0x2f07('0x17')]));_0x58549c[_0x2f07('0x18')]=_0x2f07('0x19');return ami[_0x2f07('0x1a')](_0x58549c)[_0x2f07('0x1b')](function(_0x46c9b4){_0x34dbd4({'code':0xc8,'message':_0x46c9b4[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x55bd60){_0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f5,_0x55bd60['message']));});});},'Command':function(_0x3cd3c0){var _0x2df6ed=this;return new Promise(function(_0x119b68,_0xd944d6){if(ami[_0x2f07('0x1e')]()==![]){return _0xd944d6(_0x2df6ed['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}_0x3cd3c0=_['pick'](_0x3cd3c0,_0x2f07('0x1f'));_0x3cd3c0['action']=_0x2f07('0x20');return ami[_0x2f07('0x1a')](_0x3cd3c0)[_0x2f07('0x1b')](function(_0x307888){_0x119b68({'code':0xc8,'message':_0x307888['content']});})[_0x2f07('0x1d')](function(_0x428d8c){_0xd944d6(_0x2df6ed[_0x2f07('0x11')](0x1f5,_0x428d8c['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x111376){var _0x113916=[];for(var _0x522006 in _0x1d5a33[_0x2f07('0x21')]){if(_0x1d5a33[_0x2f07('0x21')]['hasOwnProperty'](_0x522006)){var _0x427e13=_0x1d5a33['voiceQueues'][_0x522006];var _0x894cd4=new VoiceQueueSummary(_0x427e13);_0x113916[_0x2f07('0x22')](_0x894cd4);}}_0x111376({'count':_0x113916[_0x2f07('0x23')],'rows':_0x113916});});},'UpdateVoiceQueue':function(_0x18f599){return new Promise(function(_0x20e4f8,_0x139ea8){var _0x787aad=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x21')],{'id':parseInt(_0x18f599['id'])});var _0x468cd8=_[_0x2f07('0x25')](_0x18f599,['id']);if(_0x787aad){for(var _0x279eb3 in _0x468cd8){if(typeof _0x468cd8[_0x279eb3]!=='undefined'&&typeof _0x787aad[_0x279eb3]!==_0x2f07('0x26')){_0x787aad[_0x279eb3]=_0x468cd8[_0x279eb3];}}_0x20e4f8(_0x787aad);}else{_0x139ea8();}});},'VoiceChannels':function(){return new Promise(function(_0x2b806a){var _0xada137=_['values'](_0x1d5a33[_0x2f07('0x27')]);_0x2b806a({'count':_0xada137[_0x2f07('0x23')],'rows':_0xada137});});},'VoiceChannelMixMonitor':function(_0x115c97){var _0x5ad0de=this;return new Promise(function(_0xcd91be,_0x368e3d){if(ami[_0x2f07('0x1e')]()==![]){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}var _0x5b0407=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x115c97);if(_0x5b0407[_0x2f07('0x23')]>0x0){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5b0407,_0x2f07('0x1c'))[_0x2f07('0x15')](',\x20')));}var _0x3a2bb7=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x115c97[_0x2f07('0x2b')]});if(_0x3a2bb7&&_0x3a2bb7[_0x2f07('0x2c')]){var _0xa74d2c=util[_0x2f07('0x7')](_0x2f07('0x2d'),_0x115c97[_0x2f07('0x2e')]||_0x115c97['uniqueid'],_0x115c97['format']||_0x2f07('0x2f'));return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x30'),'channel':_0x3a2bb7['channel'],'file':_0xa74d2c,'options':'ai(mixmonitorid)'})[_0x2f07('0x1b')](function(_0x4acfb6){var _0x35c4e2=_[_0x2f07('0x24')](_0x3a2bb7[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0xa74d2c[_0x2f07('0x33')]()});if(_['isNil'](_0x35c4e2)){_0x3a2bb7[_0x2f07('0x31')]['push']({'filename':_0x2f07('0x32')+_0xa74d2c['toLowerCase'](),'createdAt':moment()[_0x2f07('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x4acfb6['mixmonitorid'],'status':_0x2f07('0x34')});}else{_0x35c4e2[_0x2f07('0x35')]=_0x4acfb6['mixmonitorid'];_0x35c4e2[_0x2f07('0x36')]=_0x2f07('0x34');}_0xcd91be({'code':0xc8,'message':[_0x115c97[_0x2f07('0x2b')],'MixMonitor\x20Success',_0x4acfb6[_0x2f07('0x35')]][_0x2f07('0x15')]('\x20'),'mixmonitorid':_0x4acfb6[_0x2f07('0x35')]});})[_0x2f07('0x1d')](function(_0x25b1a9){_0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,[_0x115c97[_0x2f07('0x2b')],_0x25b1a9[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')));});}else{return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x3f1b6b){var _0x46c665=this;return new Promise(function(_0x2ded2e,_0x5129c){if(ami['isConnected']()==![]){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x4d5932=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x3f1b6b);if(_0x4d5932[_0x2f07('0x23')]>0x0){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,_['map'](_0x4d5932,'message')[_0x2f07('0x15')](',\x20')));}var _0x437e94=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x3f1b6b['uniqueid']});if(_0x437e94){return Promise[_0x2f07('0x38')]()[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x39'),'channel':_0x437e94[_0x2f07('0x2c')],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x3a')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x437e94['destinationchannel'],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})['then'](function(){var _0x97c166=_['find'](_0x437e94[_0x2f07('0x31')],{'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]});if(_0x97c166){_0x97c166[_0x2f07('0x36')]='stop';}})[_0x2f07('0x1b')](function(){var _0x350ace=util['format']('%s.%s',_0x3f1b6b[_0x2f07('0x2e')]||_0x3f1b6b[_0x2f07('0x2b')],_0x3f1b6b[_0x2f07('0x7')]||_0x2f07('0x2f'));var _0x1596f8=_[_0x2f07('0x24')](_0x437e94[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0x350ace[_0x2f07('0x33')]()});if(_0x1596f8){_0x1596f8[_0x2f07('0x36')]=_0x2f07('0x3b');}})[_0x2f07('0x1b')](function(){_0x2ded2e({'code':0xc8,'message':[_0x3f1b6b[_0x2f07('0x2b')],_0x2f07('0x3c')][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x47ea61){_0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,[_0x3f1b6b[_0x2f07('0x2b')],_0x47ea61[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceQueuesChannels':function(_0x23a8ee){var _0x146d70=this;return new Promise(function(_0x5b920b){var _0x3354e0=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x3e')]);var _0x12523d={'count':_0x3354e0['length'],'rows':_0x3354e0};if(_0x23a8ee&&_0x23a8ee['type']){if(![_0x2f07('0x3f'),_0x2f07('0x40')]['includes'](_0x23a8ee['type'])){return _0x235418(_0x146d70[_0x2f07('0x11')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x2bfb93=_[_0x2f07('0x41')](_0x3354e0,function(_0x236e61){return _0x236e61[_0x2f07('0x42')]===_0x23a8ee[_0x2f07('0x42')];});_0x12523d[_0x2f07('0x43')]=_0x2bfb93[_0x2f07('0x23')];_0x12523d[_0x2f07('0x44')]=_0x2bfb93;}_0x5b920b(_0x12523d);});},'VoiceQueuesChannel':function(_0x418be3){var _0x3b381a=this;return new Promise(function(_0x49dfeb,_0x42fa33){var _0x399072=schema(properties[_0x2f07('0x45')])[_0x2f07('0x29')](_0x418be3);if(_0x399072['length']>0x0){return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f4,_['map'](_0x399072,'message')['join'](',\x20')));}var _0x43fa9b=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x3e')],{'uniqueid':_0x418be3[_0x2f07('0x2b')]});if(_0x43fa9b){_0x49dfeb(_0x43fa9b);}else{return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x13c1b0){var _0x4084d6=this;return new Promise(function(_0x402da6,_0x56e9be){if(ami[_0x2f07('0x1e')]()==![]){return _0x56e9be(_0x4084d6['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk'][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0xcef3d2=schema(properties[_0x2f07('0x46')])[_0x2f07('0x29')](_0x13c1b0);if(_0xcef3d2[_0x2f07('0x23')]>0x0){return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0xcef3d2,_0x2f07('0x1c'))['join'](',\x20')));}var _0x5c2dd2=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x13c1b0['uniqueid']});if(_0x5c2dd2&&_0x5c2dd2['channel']){return ami['Action']({'action':_0x2f07('0x47'),'channel':_0x5c2dd2['channel']})[_0x2f07('0x1b')](function(_0x41e88f){_0x402da6({'code':0xc8,'message':[_0x13c1b0[_0x2f07('0x2b')],_0x41e88f[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x16fab3){_0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,[_0x13c1b0['uniqueid'],_0x16fab3[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x7d22f5){var _0x365298=this;return new Promise(function(_0x939049,_0x28b3c3){if(ami['isConnected']()==![]){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x5990d5=schema(properties[_0x2f07('0x48')])[_0x2f07('0x29')](_0x7d22f5);if(_0x5990d5['length']>0x0){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5990d5,'message')[_0x2f07('0x15')](',\x20')));}var _0x71df4d=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x7d22f5['uniqueid']});if(_0x71df4d&&_0x71df4d[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':'Redirect','channel':_0x71df4d[_0x2f07('0x2c')],'exten':_0x7d22f5[_0x2f07('0x49')],'context':_0x7d22f5[_0x2f07('0x4a')]||_0x71df4d[_0x2f07('0x4a')],'priority':0x1})[_0x2f07('0x1b')](function(_0x26f986){_0x939049({'code':0xc8,'message':[_0x7d22f5[_0x2f07('0x2b')],_0x26f986[_0x2f07('0x1c')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x58e5ee){_0x28b3c3(_0x365298['error'](0x1f5,[_0x7d22f5['uniqueid'],_0x58e5ee['message'][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'Agents':function(_0x49ae15){return new Promise(function(_0x2fb109){var _0xed7e01=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0xe')]);if(_0x49ae15&&_0x49ae15['id']){var _0x5b68f9=_[_0x2f07('0x24')](_0xed7e01,function(_0x3dc5ee){return _0x3dc5ee['id']===_0x49ae15['id'];});_0x2fb109(_0x5b68f9);}else{_0x2fb109({'count':_0xed7e01['length'],'rows':_0xed7e01});}});},'Telephones':function(){return new Promise(function(_0x5cbc28){var _0x5da460=_['values'](_0x1d5a33[_0x2f07('0x4b')]);_0x5cbc28({'count':_0x5da460[_0x2f07('0x23')],'rows':_0x5da460});});},'Trunks':function(){return new Promise(function(_0x127a39){var _0x5db1db=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4c')]);_0x127a39({'count':_0x5db1db[_0x2f07('0x23')],'rows':_0x5db1db});});},'OutboundChannels':function(){return new Promise(function(_0x455841){var _0x285df7=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4d')]);_0x455841({'count':_0x285df7[_0x2f07('0x23')],'rows':_0x285df7});});},'Outbound':function(){return new Promise(function(_0x4d8bf0){_0x4d8bf0(_0x1d5a33['outbound']);});},'Campaigns':function(){return new Promise(function(_0x417618){var _0x1ab958=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4e')]);_0x417618({'count':_0x1ab958[_0x2f07('0x23')],'rows':_0x1ab958});});},'VoiceQueuesPreview':function(_0x220236){var _0xc4c1c6=this;return new Promise(function(_0x3650d9,_0x1eda37){_0x14d6e6[_0x2f07('0x4f')](_0x220236['id'])[_0x2f07('0x1b')](function(_0x5effb2){_0x3650d9({'code':0xc8,'message':_0x5effb2[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x4d738e){_0x1eda37(_0xc4c1c6[_0x2f07('0x11')](0x1f4,_0x4d738e[_0x2f07('0x1c')]));});});},'EventManager':function(_0x5b8f8c){var _0x1cc1f7=this;return new Promise(function(_0x31dd3,_0x212d68){if(!_0x5b8f8c[_0x2f07('0x50')]){return _0x212d68(_0x1cc1f7[_0x2f07('0x11')](0x1f4,_0x2f07('0x51')));}ami['emit'](_0x2f07('0x52')+_0x5b8f8c[_0x2f07('0x50')],_0x5b8f8c['message']);_0x31dd3({'code':0xc8,'message':_0x5b8f8c});});},'FaxAccounts':function(){return new Promise(function(_0xabe7e7){var _0x22c670=_[_0x2f07('0x3d')](_0x1d5a33['faxAccounts']);_0xabe7e7({'count':_0x22c670[_0x2f07('0x23')],'rows':_0x22c670});});},'SendFax':function(_0x4393bd){var _0x4d141f=this;return new Promise(function(_0x31d816,_0x4c182c){_0x3643bb[_0x2f07('0x53')](_0x4393bd)[_0x2f07('0x1b')](function(_0x1a0f5c){_0x31d816({'code':0xc8,'message':_0x1a0f5c[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x3a99ce){_0x4c182c(_0x4d141f[_0x2f07('0x11')](0x1f4,_0x3a99ce[_0x2f07('0x1c')]));});});},'CheckAfterSend':function(_0xbdb45c){var _0x4e7f9f=this;return new Promise(function(_0x2443d7,_0x199440){_0x3643bb[_0x2f07('0x54')](_0xbdb45c)[_0x2f07('0x1b')](function(_0x10f5bf){_0x2443d7({'code':0xc8,'message':_0x10f5bf[_0x2f07('0x1c')]});})['catch'](function(_0x52d5c6){_0x199440(_0x4e7f9f[_0x2f07('0x11')](0x1f4,_0x52d5c6[_0x2f07('0x1c')]));});});}};var _0x410a53=jayson[_0x2f07('0x55')](_0xf73d1a)['http']();_0x410a53['on'](_0x2f07('0x11'),function(_0x51db42){return _0x235418(_0x51db42);});_0x410a53[_0x2f07('0x56')](0x232a,'127.0.0.1',function(){console[_0x2f07('0x57')](_0x2f07('0x58'),0x232a);return _0x2e6422(_0x2f07('0x59')+0x232a);});});}; \ No newline at end of file +var _0x1b20=['context','telephones','trunks','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','pick','keys','reload','Reload','Action','message','catch','ami\x20disconnected','command','action','Command','then','content','voiceQueues','hasOwnProperty','length','find','omit','undefined','values','channels','uniqueid','format','wav','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','voicechannel','validate','map','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten'];(function(_0x33287e,_0x14414e){var _0x582601=function(_0x770da5){while(--_0x770da5){_0x33287e['push'](_0x33287e['shift']());}};_0x582601(++_0x14414e);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var jayson=require(_0x01b2('0x1'));var schema=require('validate');var moment=require('moment');var config=require(_0x01b2('0x2'));var properties=require(_0x01b2('0x3'));var ami=require(_0x01b2('0x4'));var VoiceQueueSummary=require(_0x01b2('0x5'));exports[_0x01b2('0x6')]=function(_0x365550,_0x419c17,_0x28de4a){return new Promise(function(_0x46e745,_0xa64ad1){var _0x43d561={'QueuePause':function(_0x323470){return new Promise(function(_0x508add){var _0x132a08=util['format'](_0x01b2('0x7'),_0x01b2('0x8'),_0x323470[_0x01b2('0x9')]);if(_0x365550[_0x01b2('0xa')]&&_0x365550[_0x01b2('0xa')][_0x132a08]&&_0x365550[_0x01b2('0xa')][_0x132a08][_0x01b2('0xb')]){_0x365550[_0x01b2('0xa')][_0x132a08]['updateAcw']();}if(_0x365550[_0x01b2('0xc')][_0x132a08]){_0x365550['agents'][_0x132a08][_0x01b2('0xd')]({'statePause':_0x323470['pause']?!![]:![]});}_0x508add({'code':0xc8,'message':_0x01b2('0xe')});});},'Reload':function(_0x8ac569){var _0x2c6d4d=this;return new Promise(function(_0x5ed1e2,_0x578477){if(ami[_0x01b2('0xf')]()==![]){return _0x578477(_0x2c6d4d[_0x01b2('0x10')](0x1f4,[config[_0x01b2('0x11')]['ip'],config[_0x01b2('0x11')][_0x01b2('0x12')],'ami\x20disconnected'][_0x01b2('0x13')]('\x20')));}_0x8ac569=_[_0x01b2('0x14')](_0x8ac569,_[_0x01b2('0x15')](properties[_0x01b2('0x16')]['module']));_0x8ac569['action']=_0x01b2('0x17');return ami[_0x01b2('0x18')](_0x8ac569)['then'](function(_0x1eafc4){_0x5ed1e2({'code':0xc8,'message':_0x1eafc4[_0x01b2('0x19')]});})[_0x01b2('0x1a')](function(_0x5986f5){_0x578477(_0x2c6d4d[_0x01b2('0x10')](0x1f5,_0x5986f5[_0x01b2('0x19')]));});});},'Command':function(_0x38c4c8){var _0xd2acbb=this;return new Promise(function(_0x1391f5,_0x56ea3c){if(ami[_0x01b2('0xf')]()==![]){return _0x56ea3c(_0xd2acbb['error'](0x1f4,[config[_0x01b2('0x11')]['ip'],config['asterisk'][_0x01b2('0x12')],_0x01b2('0x1b')][_0x01b2('0x13')]('\x20')));}_0x38c4c8=_['pick'](_0x38c4c8,_0x01b2('0x1c'));_0x38c4c8[_0x01b2('0x1d')]=_0x01b2('0x1e');return ami[_0x01b2('0x18')](_0x38c4c8)[_0x01b2('0x1f')](function(_0x479e94){_0x1391f5({'code':0xc8,'message':_0x479e94[_0x01b2('0x20')]});})['catch'](function(_0x54e866){_0x56ea3c(_0xd2acbb[_0x01b2('0x10')](0x1f5,_0x54e866[_0x01b2('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3fcb69){var _0x1d2e56=[];for(var _0x2e32c1 in _0x365550[_0x01b2('0x21')]){if(_0x365550['voiceQueues'][_0x01b2('0x22')](_0x2e32c1)){var _0x239543=_0x365550[_0x01b2('0x21')][_0x2e32c1];var _0x17274f=new VoiceQueueSummary(_0x239543);_0x1d2e56['push'](_0x17274f);}}_0x3fcb69({'count':_0x1d2e56[_0x01b2('0x23')],'rows':_0x1d2e56});});},'UpdateVoiceQueue':function(_0x586814){return new Promise(function(_0x122925,_0x1e6ac2){var _0x5da26c=_[_0x01b2('0x24')](_0x365550['voiceQueues'],{'id':parseInt(_0x586814['id'])});var _0x487c49=_[_0x01b2('0x25')](_0x586814,['id']);if(_0x5da26c){for(var _0x4363ec in _0x487c49){if(typeof _0x487c49[_0x4363ec]!=='undefined'&&typeof _0x5da26c[_0x4363ec]!==_0x01b2('0x26')){_0x5da26c[_0x4363ec]=_0x487c49[_0x4363ec];}}_0x122925(_0x5da26c);}else{_0x1e6ac2();}});},'VoiceChannels':function(){return new Promise(function(_0x4549a0){var _0x32aab0=_[_0x01b2('0x27')](_0x365550[_0x01b2('0x28')]);_0x4549a0({'count':_0x32aab0[_0x01b2('0x23')],'rows':_0x32aab0});});},'VoiceChannelMixMonitor':function(_0xd60b46){var _0x3169f5=this;return new Promise(function(_0x27eeb3,_0x11d8e5){if(ami[_0x01b2('0xf')]()==![]){return _0x11d8e5(_0x3169f5['error'](0x1f4,[config[_0x01b2('0x11')]['ip'],config[_0x01b2('0x11')][_0x01b2('0x12')],_0x01b2('0x1b')][_0x01b2('0x13')]('\x20')));}var _0x11dd4e=schema(properties['voicechannel'])['validate'](_0xd60b46);if(_0x11dd4e[_0x01b2('0x23')]>0x0){return _0x11d8e5(_0x3169f5['error'](0x1f4,_['map'](_0x11dd4e,_0x01b2('0x19'))[_0x01b2('0x13')](',\x20')));}var _0x21405c=_[_0x01b2('0x24')](_0x365550['channels'],{'uniqueid':_0xd60b46[_0x01b2('0x29')]});if(_0x21405c&&_0x21405c['channel']){var _0xcd6801=util['format']('%s.%s',_0xd60b46['filename']||_0xd60b46[_0x01b2('0x29')],_0xd60b46[_0x01b2('0x2a')]||_0x01b2('0x2b'));return ami[_0x01b2('0x18')]({'action':'MixMonitor','channel':_0x21405c[_0x01b2('0x2c')],'file':_0xcd6801,'options':_0x01b2('0x2d')})['then'](function(_0xecbce4){var _0x1b77f7=_[_0x01b2('0x24')](_0x21405c[_0x01b2('0x2e')],{'filename':_0x01b2('0x2f')+_0xcd6801[_0x01b2('0x30')]()});if(_['isNil'](_0x1b77f7)){_0x21405c[_0x01b2('0x2e')][_0x01b2('0x31')]({'filename':'/var/spool/asterisk/monitor/'+_0xcd6801['toLowerCase'](),'createdAt':moment()[_0x01b2('0x2a')](_0x01b2('0x32')),'mixmonitorid':_0xecbce4[_0x01b2('0x33')],'status':_0x01b2('0x34')});}else{_0x1b77f7[_0x01b2('0x33')]=_0xecbce4[_0x01b2('0x33')];_0x1b77f7['status']='rec';}_0x27eeb3({'code':0xc8,'message':[_0xd60b46[_0x01b2('0x29')],'MixMonitor\x20Success',_0xecbce4[_0x01b2('0x33')]][_0x01b2('0x13')]('\x20'),'mixmonitorid':_0xecbce4[_0x01b2('0x33')]});})[_0x01b2('0x1a')](function(_0xb381ec){_0x11d8e5(_0x3169f5['error'](0x1f5,[_0xd60b46[_0x01b2('0x29')],_0xb381ec[_0x01b2('0x19')][_0x01b2('0x30')]()]['join']('\x20')));});}else{return _0x11d8e5(_0x3169f5[_0x01b2('0x10')](0x1f5,_0x01b2('0x35')));}});},'VoiceChannelStopMixMonitor':function(_0x28a0f4){var _0x5a7b44=this;return new Promise(function(_0x34f646,_0x51e67c){if(ami[_0x01b2('0xf')]()==![]){return _0x51e67c(_0x5a7b44[_0x01b2('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x01b2('0x11')][_0x01b2('0x12')],'ami\x20disconnected'][_0x01b2('0x13')]('\x20')));}var _0x223029=schema(properties[_0x01b2('0x36')])[_0x01b2('0x37')](_0x28a0f4);if(_0x223029[_0x01b2('0x23')]>0x0){return _0x51e67c(_0x5a7b44['error'](0x1f4,_[_0x01b2('0x38')](_0x223029,_0x01b2('0x19'))[_0x01b2('0x13')](',\x20')));}var _0x5d1b39=_[_0x01b2('0x24')](_0x365550[_0x01b2('0x28')],{'uniqueid':_0x28a0f4[_0x01b2('0x29')]});if(_0x5d1b39){return Promise[_0x01b2('0x39')]()[_0x01b2('0x1f')](function(){if(_0x5d1b39[_0x01b2('0x2c')]){return ami[_0x01b2('0x18')]({'action':_0x01b2('0x3a'),'channel':_0x5d1b39['channel'],'mixmonitorid':_0x28a0f4[_0x01b2('0x33')]})[_0x01b2('0x1a')](function(){});}})[_0x01b2('0x1f')](function(){if(_0x5d1b39[_0x01b2('0x3b')]){return ami[_0x01b2('0x18')]({'action':_0x01b2('0x3a'),'channel':_0x5d1b39[_0x01b2('0x3b')],'mixmonitorid':_0x28a0f4['mixmonitorid']})[_0x01b2('0x1a')](function(){});}})[_0x01b2('0x1f')](function(){var _0x1855d2=_[_0x01b2('0x24')](_0x5d1b39['monitors'],{'mixmonitorid':_0x28a0f4['mixmonitorid']});if(_0x1855d2){_0x1855d2[_0x01b2('0x3c')]=_0x01b2('0x3d');}})[_0x01b2('0x1f')](function(){var _0x49370d=util[_0x01b2('0x2a')](_0x01b2('0x3e'),_0x28a0f4[_0x01b2('0x3f')]||_0x28a0f4[_0x01b2('0x29')],_0x28a0f4[_0x01b2('0x2a')]||_0x01b2('0x2b'));var _0x5b54c5=_[_0x01b2('0x24')](_0x5d1b39['monitors'],{'filename':_0x01b2('0x2f')+_0x49370d['toLowerCase']()});if(_0x5b54c5){_0x5b54c5['status']=_0x01b2('0x3d');}})[_0x01b2('0x1f')](function(){_0x34f646({'code':0xc8,'message':[_0x28a0f4[_0x01b2('0x29')],_0x01b2('0x40')][_0x01b2('0x13')]('\x20')});})['catch'](function(_0x47ff3c){_0x51e67c(_0x5a7b44[_0x01b2('0x10')](0x1f5,[_0x28a0f4[_0x01b2('0x29')],_0x47ff3c[_0x01b2('0x19')][_0x01b2('0x30')]()][_0x01b2('0x13')]('\x20')));});}else{return _0x51e67c(_0x5a7b44[_0x01b2('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x1dfc43){var _0x11248e=this;return new Promise(function(_0x12ec87){var _0x2b5bb5=_[_0x01b2('0x27')](_0x365550[_0x01b2('0x41')]);var _0x2a60c4={'count':_0x2b5bb5['length'],'rows':_0x2b5bb5};if(_0x1dfc43&&_0x1dfc43[_0x01b2('0x42')]){if(![_0x01b2('0x43'),_0x01b2('0x44')][_0x01b2('0x45')](_0x1dfc43[_0x01b2('0x42')])){return _0xa64ad1(_0x11248e[_0x01b2('0x10')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x8c3266=_[_0x01b2('0x46')](_0x2b5bb5,function(_0x1c9f3e){return _0x1c9f3e[_0x01b2('0x42')]===_0x1dfc43[_0x01b2('0x42')];});_0x2a60c4[_0x01b2('0x47')]=_0x8c3266[_0x01b2('0x23')];_0x2a60c4[_0x01b2('0x48')]=_0x8c3266;}_0x12ec87(_0x2a60c4);});},'VoiceQueuesChannel':function(_0x19ec33){var _0x1b5db2=this;return new Promise(function(_0x29ebdb,_0x43f453){var _0x11a8a0=schema(properties[_0x01b2('0x49')])['validate'](_0x19ec33);if(_0x11a8a0['length']>0x0){return _0x43f453(_0x1b5db2['error'](0x1f4,_['map'](_0x11a8a0,_0x01b2('0x19'))[_0x01b2('0x13')](',\x20')));}var _0x9daac7=_['find'](_0x365550[_0x01b2('0x41')],{'uniqueid':_0x19ec33['uniqueid']});if(_0x9daac7){_0x29ebdb(_0x9daac7);}else{return _0x43f453(_0x1b5db2[_0x01b2('0x10')](0x1f5,_0x01b2('0x35')));}});},'VoiceQueuesChannelHangup':function(_0x1f4de8){var _0x3eb974=this;return new Promise(function(_0x1dc49e,_0x5e9f8e){if(ami[_0x01b2('0xf')]()==![]){return _0x5e9f8e(_0x3eb974['error'](0x1f4,[config[_0x01b2('0x11')]['ip'],config[_0x01b2('0x11')]['username'],_0x01b2('0x1b')]['join']('\x20')));}var _0x2347ed=schema(properties[_0x01b2('0x4a')])[_0x01b2('0x37')](_0x1f4de8);if(_0x2347ed[_0x01b2('0x23')]>0x0){return _0x5e9f8e(_0x3eb974[_0x01b2('0x10')](0x1f4,_[_0x01b2('0x38')](_0x2347ed,_0x01b2('0x19'))[_0x01b2('0x13')](',\x20')));}var _0x2d4e47=_[_0x01b2('0x24')](_0x365550['queueChannels'],{'uniqueid':_0x1f4de8[_0x01b2('0x29')]});if(_0x2d4e47&&_0x2d4e47['channel']){return ami[_0x01b2('0x18')]({'action':_0x01b2('0x4b'),'channel':_0x2d4e47[_0x01b2('0x2c')]})['then'](function(_0x126538){_0x1dc49e({'code':0xc8,'message':[_0x1f4de8['uniqueid'],_0x126538['message'][_0x01b2('0x30')]()][_0x01b2('0x13')]('\x20')});})[_0x01b2('0x1a')](function(_0x5d3b04){_0x5e9f8e(_0x3eb974[_0x01b2('0x10')](0x1f5,[_0x1f4de8[_0x01b2('0x29')],_0x5d3b04[_0x01b2('0x19')]['toLowerCase']()][_0x01b2('0x13')]('\x20')));});}else{return _0x5e9f8e(_0x3eb974[_0x01b2('0x10')](0x1f5,_0x01b2('0x35')));}});},'VoiceQueuesChannelRedirect':function(_0x1b11ee){var _0x26ae10=this;return new Promise(function(_0x1e13af,_0x275465){if(ami['isConnected']()==![]){return _0x275465(_0x26ae10['error'](0x1f4,[config[_0x01b2('0x11')]['ip'],config['asterisk']['username'],_0x01b2('0x1b')]['join']('\x20')));}var _0xbe104b=schema(properties['voicequeuechannelredirect'])[_0x01b2('0x37')](_0x1b11ee);if(_0xbe104b[_0x01b2('0x23')]>0x0){return _0x275465(_0x26ae10[_0x01b2('0x10')](0x1f4,_[_0x01b2('0x38')](_0xbe104b,'message')[_0x01b2('0x13')](',\x20')));}var _0x5aa15c=_[_0x01b2('0x24')](_0x365550['queueChannels'],{'uniqueid':_0x1b11ee[_0x01b2('0x29')]});if(_0x5aa15c&&_0x5aa15c['channel']){return ami[_0x01b2('0x18')]({'action':_0x01b2('0x4c'),'channel':_0x5aa15c['channel'],'exten':_0x1b11ee[_0x01b2('0x4d')],'context':_0x1b11ee[_0x01b2('0x4e')]||_0x5aa15c[_0x01b2('0x4e')],'priority':0x1})[_0x01b2('0x1f')](function(_0x16c830){_0x1e13af({'code':0xc8,'message':[_0x1b11ee[_0x01b2('0x29')],_0x16c830[_0x01b2('0x19')][_0x01b2('0x30')]()][_0x01b2('0x13')]('\x20')});})[_0x01b2('0x1a')](function(_0x2cc237){_0x275465(_0x26ae10[_0x01b2('0x10')](0x1f5,[_0x1b11ee[_0x01b2('0x29')],_0x2cc237['message']['toLowerCase']()][_0x01b2('0x13')]('\x20')));});}else{return _0x275465(_0x26ae10[_0x01b2('0x10')](0x1f5,_0x01b2('0x35')));}});},'Agents':function(_0x427358){return new Promise(function(_0x21cecf){var _0x3a44d2=_[_0x01b2('0x27')](_0x365550[_0x01b2('0xc')]);if(_0x427358&&_0x427358['id']){var _0x5b292e=_[_0x01b2('0x24')](_0x3a44d2,function(_0x5f2a73){return _0x5f2a73['id']===_0x427358['id'];});_0x21cecf(_0x5b292e);}else{_0x21cecf({'count':_0x3a44d2[_0x01b2('0x23')],'rows':_0x3a44d2});}});},'Telephones':function(){return new Promise(function(_0x23bca9){var _0x390e18=_[_0x01b2('0x27')](_0x365550[_0x01b2('0x4f')]);_0x23bca9({'count':_0x390e18['length'],'rows':_0x390e18});});},'Trunks':function(){return new Promise(function(_0x5dd4d4){var _0x2b7bf6=_[_0x01b2('0x27')](_0x365550[_0x01b2('0x50')]);_0x5dd4d4({'count':_0x2b7bf6['length'],'rows':_0x2b7bf6});});},'OutboundChannels':function(){return new Promise(function(_0x3d3248){var _0x2f6d16=_[_0x01b2('0x27')](_0x365550['outboundChannels']);_0x3d3248({'count':_0x2f6d16[_0x01b2('0x23')],'rows':_0x2f6d16});});},'Outbound':function(){return new Promise(function(_0xdf1d4c){_0xdf1d4c(_0x365550[_0x01b2('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x5b34bb){var _0x4b8ee0=_[_0x01b2('0x27')](_0x365550['campaigns']);_0x5b34bb({'count':_0x4b8ee0[_0x01b2('0x23')],'rows':_0x4b8ee0});});},'VoiceQueuesPreview':function(_0x10d19f){var _0x2f41b6=this;return new Promise(function(_0x2e36f8,_0x19a417){_0x419c17[_0x01b2('0x51')](_0x10d19f['id'])['then'](function(_0x3cd94a){_0x2e36f8({'code':0xc8,'message':_0x3cd94a[_0x01b2('0x19')]});})[_0x01b2('0x1a')](function(_0x2612aa){_0x19a417(_0x2f41b6[_0x01b2('0x10')](0x1f4,_0x2612aa[_0x01b2('0x19')]));});});},'EventManager':function(_0x5038b2){var _0x12f5ed=this;return new Promise(function(_0x1dcd45,_0x2a5603){if(!_0x5038b2[_0x01b2('0x52')]){return _0x2a5603(_0x12f5ed[_0x01b2('0x10')](0x1f4,_0x01b2('0x53')));}ami['emit'](_0x01b2('0x54')+_0x5038b2['event'],_0x5038b2[_0x01b2('0x19')]);_0x1dcd45({'code':0xc8,'message':_0x5038b2});});},'FaxAccounts':function(){return new Promise(function(_0x5de7c2){var _0x5d03b0=_[_0x01b2('0x27')](_0x365550[_0x01b2('0x55')]);_0x5de7c2({'count':_0x5d03b0['length'],'rows':_0x5d03b0});});},'SendFax':function(_0x2e43df){var _0x4015e2=this;return new Promise(function(_0x288e34,_0x270479){_0x28de4a['send'](_0x2e43df)[_0x01b2('0x1f')](function(_0x42c703){_0x288e34({'code':0xc8,'message':_0x42c703[_0x01b2('0x19')]});})[_0x01b2('0x1a')](function(_0x20a0fd){_0x270479(_0x4015e2[_0x01b2('0x10')](0x1f4,_0x20a0fd[_0x01b2('0x19')]));});});},'CheckAfterSend':function(_0x44034b){var _0x31e865=this;return new Promise(function(_0x3cc29b,_0x24e16e){_0x28de4a['checkAfterSend'](_0x44034b)[_0x01b2('0x1f')](function(_0x3e17c3){_0x3cc29b({'code':0xc8,'message':_0x3e17c3[_0x01b2('0x19')]});})[_0x01b2('0x1a')](function(_0x903a9f){_0x24e16e(_0x31e865[_0x01b2('0x10')](0x1f4,_0x903a9f[_0x01b2('0x19')]));});});}};var _0x1c7f70=jayson['server'](_0x43d561)['http']();_0x1c7f70['on'](_0x01b2('0x10'),function(_0x15cd87){return _0xa64ad1(_0x15cd87);});_0x1c7f70[_0x01b2('0x6')](0x232a,_0x01b2('0x56'),function(){console[_0x01b2('0x57')](_0x01b2('0x58'),0x232a);return _0x46e745(_0x01b2('0x59')+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 26474ae..825c7c1 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 _0xe4aa=['format','user:%s','name','action','toLowerCase','length','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','localhost','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','mobile','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe4aa,0x114));var _0xae4a=function(_0x2d73e7,_0x363220){_0x2d73e7=_0x2d73e7-0x0;var _0x53f0a7=_0xe4aa[_0x2d73e7];return _0x53f0a7;};'use strict';var _=require(_0xae4a('0x0'));var BPromise=require(_0xae4a('0x1'));var Redis=require('ioredis');var util=require(_0xae4a('0x2'));var config=require(_0xae4a('0x3'));var logger=require(_0xae4a('0x4'))(_0xae4a('0x5'));var cmContactRpc=require(_0xae4a('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xae4a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5ba95b,_0x3cac16,_0x162094,_0x54c203,_0x39bed2){logger[_0xae4a('0x8')](_0xae4a('0x9'),_0x5ba95b,_0x3cac16['id'],_0x162094,_0x54c203,JSON[_0xae4a('0xa')](_0x39bed2));io['to'](_0x162094)[_0xae4a('0xb')](_0x54c203,_0x39bed2);}exports[_0xae4a('0xc')]=function(_0x35e99d,_0x3d2b70,_0x2903f2,_0x330e2a){var _0x741fb3,_0x2ec771;var _0x161db2={};var _0x117df5;var _0x413d44=Number(_0x2903f2['data1']);var _0x4ddb4c=_0x2903f2[_0xae4a('0xd')]?Boolean(Number(_0x2903f2['data2'])):![];var _0x3e0975;var _0x5c1bed=![];if(!_[_0xae4a('0xe')](_0x2903f2['data5'])){if(_0x2903f2[_0xae4a('0xf')]=='1')_0x5c1bed=!![];}if(!_0x5c1bed){if(_0x330e2a[_0xae4a('0x10')]){_0x161db2['id']=_0x330e2a[_0xae4a('0x10')];}}if(!_0x161db2['id']){_0x161db2['ListId']=_0x413d44;_0x3e0975=_0x2903f2[_0xae4a('0x11')]&&_0x2903f2[_0xae4a('0x11')]!=='0'?_0x2903f2[_0xae4a('0x11')][_0xae4a('0x12')](','):[_0xae4a('0x13')];_0x161db2['$or']=_[_0xae4a('0x14')](_0x3e0975,function(_0xf3529a){var _0x4ea4d0={};_0x4ea4d0[_0xf3529a]=_0x330e2a[_0xae4a('0x15')]?_0x330e2a[_0xae4a('0x16')]:_0x330e2a[_0xae4a('0x17')];return _0x4ea4d0;});_0x117df5=_0x330e2a[_0xae4a('0x15')]?_0x330e2a[_0xae4a('0x16')]:_0x330e2a[_0xae4a('0x17')];}var _0x383fcd=['id',_0xae4a('0x18'),'lastName',_0xae4a('0x13'),_0xae4a('0x19'),'fax',_0xae4a('0x1a'),_0xae4a('0x1b'),_0xae4a('0x1c'),_0xae4a('0x1d')];var _0xed5082=_[_0xae4a('0x1e')](_0x383fcd,_0x3e0975);BPromise[_0xae4a('0x1f')]()[_0xae4a('0x20')](cmContactRpc[_0xae4a('0x21')]({'attributes':_0xed5082,'where':_0x161db2,'phone':_0x117df5}))[_0xae4a('0x20')](function(_0xc0cadd){_0x2ec771=_0xc0cadd;if(!_[_0xae4a('0x22')](_0x2ec771)){if(_0x2ec771['length']===0x1){_0x741fb3=_0x2ec771[0x0];logger[_0xae4a('0x8')](_0xae4a('0x23'),_0x330e2a['uniqueid'],_0x3d2b70['id'],_0x741fb3['id']);}else{logger[_0xae4a('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x330e2a[_0xae4a('0x24')],_0x3d2b70['id'],_[_0xae4a('0x14')](_0x2ec771,'id')[_0xae4a('0x25')](','));}return;}else{logger[_0xae4a('0x8')](_0xae4a('0x26'),_0x330e2a['uniqueid'],_0x3d2b70['id']);var _0x1af6bf={'ListId':_0x413d44};var _0x5458eb=_0x2903f2[_0xae4a('0x27')]&&_0x2903f2[_0xae4a('0x27')]!=='0'?_0x2903f2[_0xae4a('0x27')]:_0xae4a('0x13');if(_0x4ddb4c){logger[_0xae4a('0x8')](_0xae4a('0x28'),_0x330e2a[_0xae4a('0x24')],_0x3d2b70['id']);_0x1af6bf[_0x5458eb]=_['isNil'](_0x330e2a[_0xae4a('0x15')])?_0x330e2a[_0xae4a('0x17')]:_0x330e2a[_0xae4a('0x16')];if(_[_0xae4a('0xe')](_0x330e2a[_0xae4a('0x15')])){_0x1af6bf[_0xae4a('0x18')]=_0x330e2a['calleridname']&&_0x330e2a[_0xae4a('0x29')]!==_0xae4a('0x2a')?_0x330e2a['calleridname']:'Unknown';}else{_0x1af6bf[_0xae4a('0x18')]=_0x330e2a[_0xae4a('0x2b')]&&_0x330e2a[_0xae4a('0x2b')]!==_0xae4a('0x2a')?_0x330e2a['destcalleridname']:_0xae4a('0x2c');}return BPromise[_0xae4a('0x1f')]()[_0xae4a('0x20')](cmContactRpc[_0xae4a('0x2d')](_0x1af6bf))[_0xae4a('0x20')](function(_0x130a8e){_0x741fb3=_0x130a8e;_0x2ec771[_0xae4a('0x2e')](_0x130a8e);if(_0x741fb3){logger[_0xae4a('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x330e2a[_0xae4a('0x24')],_0x3d2b70['id'],_0x741fb3['id']);}return;});}else{logger[_0xae4a('0x8')](_0xae4a('0x2f'),_0x330e2a[_0xae4a('0x24')],_0x3d2b70['id']);_0x1af6bf[_0x5458eb]=_['isNil'](_0x330e2a[_0xae4a('0x15')])?_0x330e2a[_0xae4a('0x17')]:_0x330e2a[_0xae4a('0x16')];if(_['isNil'](_0x330e2a['routeId'])){_0x1af6bf['firstName']=_0x330e2a['calleridname']&&_0x330e2a['calleridname']!==_0xae4a('0x2a')?_0x330e2a[_0xae4a('0x29')]:_0xae4a('0x2c');}else{_0x1af6bf[_0xae4a('0x18')]=_0x330e2a[_0xae4a('0x2b')]&&_0x330e2a[_0xae4a('0x2b')]!==_0xae4a('0x2a')?_0x330e2a[_0xae4a('0x2b')]:_0xae4a('0x2c');}_0x741fb3=_0x1af6bf;_0x2ec771[_0xae4a('0x2e')](_0x1af6bf);return;}}})['then'](function(){if(_0x35e99d){emit(_0x330e2a[_0xae4a('0x24')],_0x3d2b70,util[_0xae4a('0x30')](_0xae4a('0x31'),_0x35e99d[_0xae4a('0x32')]),util[_0xae4a('0x30')]('trigger:%s',_0x2903f2[_0xae4a('0x33')][_0xae4a('0x34')]()),{'evt':_['merge'](_0x330e2a,{'autoCreate':_0x4ddb4c}),'contact':_0x741fb3===undefined?{}:_0x741fb3,'contacts':_0x2ec771[_0xae4a('0x35')]===0x0?undefined:_0x2ec771});}});}; \ No newline at end of file +var _0x80cd=['../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','getContacts','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','info','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment'];(function(_0x2e0e3a,_0x20ae64){var _0x58e859=function(_0x5f1401){while(--_0x5f1401){_0x2e0e3a['push'](_0x2e0e3a['shift']());}};_0x58e859(++_0x20ae64);}(_0x80cd,0x146));var _0xd80c=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0x80cd[_0x75ce5b];return _0x22195e;};'use strict';var _=require('lodash');var BPromise=require(_0xd80c('0x0'));var Redis=require(_0xd80c('0x1'));var util=require(_0xd80c('0x2'));var config=require(_0xd80c('0x3'));var logger=require(_0xd80c('0x4'))(_0xd80c('0x5'));var cmContactRpc=require(_0xd80c('0x6'));config[_0xd80c('0x7')]=_['defaults'](config[_0xd80c('0x7')],{'host':_0xd80c('0x8'),'port':0x18eb});var io=require(_0xd80c('0x9'))(new Redis(config[_0xd80c('0x7')]));function emit(_0x508e19,_0x343595,_0x20cd74,_0x2dc89b,_0x3aa004){logger['info'](_0xd80c('0xa'),_0x508e19,_0x343595['id'],_0x20cd74,_0x2dc89b,JSON['stringify'](_0x3aa004));io['to'](_0x20cd74)['emit'](_0x2dc89b,_0x3aa004);}exports[_0xd80c('0xb')]=function(_0x511f14,_0x18720f,_0x41a78e,_0x28dce1){var _0x3c4807,_0x2e048b;var _0x380e84={};var _0x14be44;var _0x4ae830=Number(_0x41a78e[_0xd80c('0xc')]);var _0x107c85=_0x41a78e[_0xd80c('0xd')]?Boolean(Number(_0x41a78e[_0xd80c('0xd')])):![];var _0x3a5531;var _0x422969=![];if(!_[_0xd80c('0xe')](_0x41a78e[_0xd80c('0xf')])){if(_0x41a78e[_0xd80c('0xf')]=='1')_0x422969=!![];}if(!_0x422969){if(_0x28dce1['xmd-contactid']){_0x380e84['id']=_0x28dce1[_0xd80c('0x10')];}}if(!_0x380e84['id']){_0x380e84[_0xd80c('0x11')]=_0x4ae830;_0x3a5531=_0x41a78e[_0xd80c('0x12')]&&_0x41a78e[_0xd80c('0x12')]!=='0'?_0x41a78e[_0xd80c('0x12')]['split'](','):[_0xd80c('0x13')];_0x380e84[_0xd80c('0x14')]=_[_0xd80c('0x15')](_0x3a5531,function(_0x233677){var _0xbeab7c={};_0xbeab7c[_0x233677]=_0x28dce1[_0xd80c('0x16')]?_0x28dce1[_0xd80c('0x17')]:_0x28dce1[_0xd80c('0x18')];return _0xbeab7c;});_0x14be44=_0x28dce1['routeId']?_0x28dce1[_0xd80c('0x17')]:_0x28dce1[_0xd80c('0x18')];}var _0x229710=['id',_0xd80c('0x19'),'lastName',_0xd80c('0x13'),_0xd80c('0x1a'),_0xd80c('0x1b'),'ListId',_0xd80c('0x1c'),_0xd80c('0x1d'),'updatedAt'];var _0x31d666=_['union'](_0x229710,_0x3a5531);BPromise['resolve']()['then'](cmContactRpc[_0xd80c('0x1e')]({'attributes':_0x31d666,'where':_0x380e84,'phone':_0x14be44}))[_0xd80c('0x1f')](function(_0x205124){_0x2e048b=_0x205124;if(!_[_0xd80c('0x20')](_0x2e048b)){if(_0x2e048b[_0xd80c('0x21')]===0x1){_0x3c4807=_0x2e048b[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x28dce1[_0xd80c('0x22')],_0x18720f['id'],_0x3c4807['id']);}else{logger['info'](_0xd80c('0x23'),_0x28dce1[_0xd80c('0x22')],_0x18720f['id'],_[_0xd80c('0x15')](_0x2e048b,'id')[_0xd80c('0x24')](','));}return;}else{logger['info'](_0xd80c('0x25'),_0x28dce1[_0xd80c('0x22')],_0x18720f['id']);var _0x3bbf75={'ListId':_0x4ae830};var _0xc32df6=_0x41a78e[_0xd80c('0x26')]&&_0x41a78e[_0xd80c('0x26')]!=='0'?_0x41a78e[_0xd80c('0x26')]:_0xd80c('0x13');if(_0x107c85){logger[_0xd80c('0x27')](_0xd80c('0x28'),_0x28dce1[_0xd80c('0x22')],_0x18720f['id']);_0x3bbf75[_0xc32df6]=_[_0xd80c('0xe')](_0x28dce1[_0xd80c('0x16')])?_0x28dce1[_0xd80c('0x18')]:_0x28dce1[_0xd80c('0x17')];if(_['isNil'](_0x28dce1[_0xd80c('0x16')])){_0x3bbf75[_0xd80c('0x19')]=_0x28dce1[_0xd80c('0x29')]&&_0x28dce1[_0xd80c('0x29')]!==_0xd80c('0x2a')?_0x28dce1[_0xd80c('0x29')]:_0xd80c('0x2b');}else{_0x3bbf75['firstName']=_0x28dce1[_0xd80c('0x2c')]&&_0x28dce1[_0xd80c('0x2c')]!==_0xd80c('0x2a')?_0x28dce1[_0xd80c('0x2c')]:'Unknown';}return BPromise[_0xd80c('0x2d')]()['then'](cmContactRpc[_0xd80c('0x2e')](_0x3bbf75))[_0xd80c('0x1f')](function(_0x4e1464){_0x3c4807=_0x4e1464;_0x2e048b[_0xd80c('0x2f')](_0x4e1464);if(_0x3c4807){logger['info'](_0xd80c('0x30'),_0x28dce1[_0xd80c('0x22')],_0x18720f['id'],_0x3c4807['id']);}return;});}else{logger['info'](_0xd80c('0x31'),_0x28dce1[_0xd80c('0x22')],_0x18720f['id']);_0x3bbf75[_0xc32df6]=_[_0xd80c('0xe')](_0x28dce1[_0xd80c('0x16')])?_0x28dce1[_0xd80c('0x18')]:_0x28dce1[_0xd80c('0x17')];if(_[_0xd80c('0xe')](_0x28dce1[_0xd80c('0x16')])){_0x3bbf75['firstName']=_0x28dce1[_0xd80c('0x29')]&&_0x28dce1[_0xd80c('0x29')]!==_0xd80c('0x2a')?_0x28dce1['calleridname']:_0xd80c('0x2b');}else{_0x3bbf75[_0xd80c('0x19')]=_0x28dce1[_0xd80c('0x2c')]&&_0x28dce1['destcalleridname']!==''?_0x28dce1[_0xd80c('0x2c')]:_0xd80c('0x2b');}_0x3c4807=_0x3bbf75;_0x2e048b[_0xd80c('0x2f')](_0x3bbf75);return;}}})[_0xd80c('0x1f')](function(){if(_0x511f14){emit(_0x28dce1['uniqueid'],_0x18720f,util[_0xd80c('0x32')](_0xd80c('0x33'),_0x511f14['name']),util['format']('trigger:%s',_0x41a78e[_0xd80c('0x34')][_0xd80c('0x35')]()),{'evt':_[_0xd80c('0x36')](_0x28dce1,{'autoCreate':_0x107c85}),'contact':_0x3c4807===undefined?{}:_0x3c4807,'contacts':_0x2e048b[_0xd80c('0x21')]===0x0?undefined:_0x2e048b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 320f934..b214b7b 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 _0x1a2a=['custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','merge','variables','Actions','length','contactmanager','motionbar','popup','data2','render','html','template\x20not\x20found','isNil','location','data4','data5','windowHeight','data6','600','winApplication','winArguments','data3','user:%s','name','action','toLowerCase','data1','trigger:%s','format','exec','urlforward','script','parse','search','replace','checkTrigger','AllConditions','every','checkConditions','channel','AnyConditions','evt','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','event','queue','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd'];(function(_0x288d04,_0x260286){var _0x47778b=function(_0x37b4f2){while(--_0x37b4f2){_0x288d04['push'](_0x288d04['shift']());}};_0x47778b(++_0x260286);}(_0x1a2a,0xd3));var _0xa1a2=function(_0x2a1ff7,_0x4e44cb){_0x2a1ff7=_0x2a1ff7-0x0;var _0x168537=_0x1a2a[_0x2a1ff7];return _0x168537;};'use strict';var util=require(_0xa1a2('0x0'));var _=require(_0xa1a2('0x1'));var url=require(_0xa1a2('0x2'));var Mustache=require(_0xa1a2('0x3'));var Redis=require('ioredis');var urlforward=require(_0xa1a2('0x4'));var integration=require(_0xa1a2('0x5'));var cmContact=require('./cmContact');var script=require(_0xa1a2('0x6'));var config=require(_0xa1a2('0x7'));var logger=require(_0xa1a2('0x8'))(_0xa1a2('0x9'));var ami=require('../ami');config[_0xa1a2('0xa')]=_['defaults'](config[_0xa1a2('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xa1a2('0xb'))(new Redis(config[_0xa1a2('0xa')]));var operators={'equals':function(_0x30c8ff,_0x238546){return _0x30c8ff==_0x238546;},'not_equals':function(_0x26f003,_0x248b24){return _0x26f003!=_0x248b24;}};var barAndWebActions=['popup',_0xa1a2('0x2'),_0xa1a2('0xc')];function Trigger(_0x1817e0){this[_0xa1a2('0xd')]=_0x1817e0[_0xa1a2('0xd')];this[_0xa1a2('0xe')]=_0x1817e0[_0xa1a2('0xe')];this[_0xa1a2('0xf')]=_0x1817e0[_0xa1a2('0xf')];this['templates']=_0x1817e0[_0xa1a2('0x10')];this[_0xa1a2('0x11')]=_0x1817e0[_0xa1a2('0x11')];this[_0xa1a2('0x12')]=_0x1817e0[_0xa1a2('0x12')];this[_0xa1a2('0x13')]=_0x1817e0[_0xa1a2('0x13')];this[_0xa1a2('0x14')]=_0x1817e0[_0xa1a2('0x14')];this[_0xa1a2('0x15')]=_0x1817e0['sugarcrmAccounts'];this[_0xa1a2('0x16')]=_0x1817e0[_0xa1a2('0x16')];this['deskAccounts']=_0x1817e0['deskAccounts'];this[_0xa1a2('0x17')]=_0x1817e0[_0xa1a2('0x17')];this[_0xa1a2('0x18')]=_0x1817e0['servicenowAccounts'];this[_0xa1a2('0x19')]=_0x1817e0[_0xa1a2('0x19')];this['freshsalesAccounts']=_0x1817e0[_0xa1a2('0x1a')];this[_0xa1a2('0x1b')]={'zendesk':this[_0xa1a2('0x12')],'salesforce':this[_0xa1a2('0x14')],'freshdesk':this[_0xa1a2('0x13')],'sugarcrm':this[_0xa1a2('0x15')],'zoho':this[_0xa1a2('0x16')],'desk':this[_0xa1a2('0x1c')],'vtiger':this[_0xa1a2('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xa1a2('0x1a')],'servicenow':this[_0xa1a2('0x18')]};ami['on'](_0xa1a2('0x1d'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x20'),this[_0xa1a2('0x1e')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0xa1a2('0x1e')]['bind'](this));ami['on'](_0xa1a2('0x21'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x22'),this['syncCustomEvent'][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x23'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa1a2('0x24'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x25'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x26'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x27'),this['syncCustomEvent'][_0xa1a2('0x1f')](this));ami['on']('custom:timeout',this['syncCustomEvent']['bind'](this));ami['on'](_0xa1a2('0x28'),this[_0xa1a2('0x29')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x2a'),this['syncAgentDial']['bind'](this));ami['on'](_0xa1a2('0x2b'),this[_0xa1a2('0x29')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x2c'),this['syncCustomEvent'][_0xa1a2('0x1f')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0xa1a2('0x2d'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on']('custom:incomingmessage',this[_0xa1a2('0x1e')]['bind'](this));ami['on'](_0xa1a2('0x2e'),this[_0xa1a2('0x1e')]['bind'](this));ami['on'](_0xa1a2('0x2f'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa1a2('0x30'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));ami['on'](_0xa1a2('0x31'),this[_0xa1a2('0x1e')][_0xa1a2('0x1f')](this));}Trigger[_0xa1a2('0x32')][_0xa1a2('0x33')]=function(_0x1c62bd,_0x129a46,_0x14d883){logger['info'](_0x1c62bd,_0x129a46,JSON[_0xa1a2('0x34')](_0x14d883));io['to'](_0x1c62bd)[_0xa1a2('0x33')](_0x129a46,_0x14d883);};Trigger[_0xa1a2('0x32')][_0xa1a2('0x1e')]=function(_0x19b7e3){var _0x5b0cec=_[_0xa1a2('0x35')](_0x19b7e3);if(typeof _0x5b0cec[_0xa1a2('0x36')]===_0xa1a2('0x37')){_0x5b0cec[_0xa1a2('0x36')]=_0xa1a2('0x38');}logger[_0xa1a2('0x39')](_0xa1a2('0x1e'),util[_0xa1a2('0x3a')](_0x5b0cec,{'showHidden':!![],'depth':null}));this[_0xa1a2('0x3b')](_0x5b0cec);};Trigger[_0xa1a2('0x32')][_0xa1a2('0x29')]=function(_0x458e81){if(this[_0xa1a2('0xe')][_0x458e81[_0xa1a2('0x3c')]]){this[_0xa1a2('0x1e')](_0x458e81);}};Trigger[_0xa1a2('0x32')][_0xa1a2('0x3b')]=function(_0x5950b9){var _0x545c5c;for(var _0x100abe in this[_0xa1a2('0xd')]){if(this['triggers'][_0xa1a2('0x3d')](_0x100abe)){if(this[_0xa1a2('0xd')][_0x100abe]['status']){_0x545c5c=this['checkTrigger'](this['triggers'][_0x100abe],_0x5950b9);if(_0x545c5c){_[_0xa1a2('0x3e')](_0x5950b9,_0x5950b9[_0xa1a2('0x3f')]);for(var _0x38885d=0x0,_0x229f7c,_0x55bfba,_0xbceef8;_0x38885d0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0xd591c8,_0xc77555){var _0x3f7240=function(_0x151f98){while(--_0x151f98){_0xd591c8['push'](_0xd591c8['shift']());}};_0x3f7240(++_0xc77555);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 2473593..d3c5395 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 _0x1464=['redis','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','toLowerCase','destcalleridnum','body','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','type','customField','idField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','ticketType','queue','callDirection','phonecalls','ticketId','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','outbound','format','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1464,0x134));var _0x4146=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x1464[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x4146('0x0'));var rp=require(_0x4146('0x1'));var util=require(_0x4146('0x2'));var intUtil=require(_0x4146('0x3'));var md5=require(_0x4146('0x4'));var Redis=require(_0x4146('0x5'));var logger=require(_0x4146('0x6'))(_0x4146('0x7'));var config=require(_0x4146('0x8'));config['redis']=_[_0x4146('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4146('0xa')]));function getAuthToken(_0x565ac0,_0x4e6c51,_0x5aa3d5){if(_0x565ac0[_0x4146('0xb')]){_0x565ac0[_0x4146('0xc')]=_0x565ac0[_0x4146('0xd')][_0x4146('0xe')];_0x565ac0[_0x4146('0xf')]=_0x565ac0[_0x4146('0xd')][_0x4146('0x10')];return Promise[_0x4146('0x11')](_0x565ac0[_0x4146('0xd')]['data5']);}var _0x48b40e={'method':_0x4146('0x12'),'uri':_0x4e6c51,'form':{'client_id':_0x565ac0['clientId'],'resource':_0x565ac0['remoteUri'],'username':_0x565ac0[_0x4146('0x13')],'password':_0x565ac0[_0x4146('0x14')],'grant_type':_0x4146('0x14'),'client_secret':_0x565ac0[_0x4146('0x15')]},'json':!![]};return rp(_0x48b40e)[_0x4146('0x16')](function(_0x9d9fef){return _0x9d9fef[_0x4146('0x17')];})[_0x4146('0x18')](function(_0x1212f2){logger[_0x4146('0x19')]('['+[_0x5aa3d5[_0x4146('0x1a')]()]+']\x20Wrong\x20credentials!');return _0x1212f2[_0x4146('0x1b')];});}function getUser(_0x3120ab,_0x3e7554,_0x54dfee,_0x5cf15d,_0x34b7a3,_0x5186c2){return new Promise(function(_0x45bd12,_0x171002){return getAuthToken(_0x3e7554,_0x5cf15d,_0x5186c2)[_0x4146('0x16')](function(_0x3d576f){var _0x3f3616={'method':_0x4146('0x1c'),'uri':_0x34b7a3+_0x4146('0x1d'),'headers':{'Authorization':_0x4146('0x1e')+_0x3d576f,'OData-Version':_0x4146('0x1f')},'json':!![]};return rp(_0x3f3616);})[_0x4146('0x16')](function(_0x4c9345){var _0x1e3a87=_0x4c9345[_0x4146('0x20')];var _0x4077ff=![];var _0x44481c=null;if(!_[_0x4146('0x21')](_0x54dfee)){if(intUtil['validateEmail'](_0x54dfee[_0x4146('0x22')])){_0x3120ab['userEmail']=_0x54dfee[_0x4146('0x22')];for(_0x44481c=0x0;_0x44481c<_0x1e3a87[_0x4146('0x23')];_0x44481c++){if(_0x1e3a87[_0x44481c]['internalemailaddress']===_0x54dfee[_0x4146('0x22')]&&!_0x1e3a87[_0x44481c][_0x4146('0x24')]){_0x4077ff=!![];logger[_0x4146('0x25')]('['+[_0x5186c2[_0x4146('0x1a')]()]+_0x4146('0x26')+_0x1e3a87[_0x44481c][_0x4146('0x27')]+'!');_0x3120ab['userId']=_0x1e3a87[_0x44481c][_0x4146('0x27')];}}}}if(!_0x4077ff){logger[_0x4146('0x25')]('['+[_0x5186c2[_0x4146('0x1a')]()]+_0x4146('0x28'));_0x3120ab['userEmail']=_0x3e7554['username'];for(_0x44481c=0x0;_0x44481c<_0x1e3a87[_0x4146('0x23')];_0x44481c++){if(_0x1e3a87[_0x44481c][_0x4146('0x29')]===_0x3e7554[_0x4146('0x13')]){_0x3120ab[_0x4146('0x2a')]=_0x1e3a87[_0x44481c][_0x4146('0x27')];}}}_0x45bd12(_0x3120ab);})[_0x4146('0x18')](function(_0x120713){_0x171002(_0x120713[_0x4146('0x1b')]);});});}function createEndUser(_0x569ab1,_0x54fc3b,_0x792412,_0x2ff1e5,_0x487bbc,_0x5c05cb,_0x4523ce){return new Promise(function(_0x2176bb,_0x128430){return getAuthToken(_0x54fc3b,_0x792412,_0x5c05cb)['then'](function(_0x50fe19){var _0x129d66=_0x5c05cb[_0x4146('0x2b')]()==='outbound'?_0x487bbc[_0x4146('0x2c')]:_0x487bbc['calleridnum'];var _0xce7217={'method':_0x4146('0x12'),'uri':_0x2ff1e5+'contacts','body':{'fullname':_0x129d66,'firstname':_0x129d66,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x569ab1['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x50fe19,'OData-Version':_0x4146('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0xce7217[_0x4146('0x2d')][_0x4523ce]=_0x129d66;return rp(_0xce7217);})['then'](function(_0x14e4aa){var _0x4e419d=_0x14e4aa[_0x4146('0x2e')][_0x4146('0x2f')];var _0x3f8339=_0x4e419d[_0x4146('0x30')](_0x4e419d['lastIndexOf']('(')+0x1,_0x4e419d[_0x4146('0x31')](')'));_0x569ab1[_0x4146('0x32')]=_0x3f8339;_0x2176bb(_0x569ab1);})[_0x4146('0x18')](function(_0x197e7c){_0x128430(_0x197e7c[_0x4146('0x1b')]);});});}function getEndUser(_0x58c5c5,_0x58c56a,_0x7032f1,_0x557d8b,_0x364cd0,_0xd35553,_0x181729,_0x238b74){var _0x3e8e12=_0xd35553['toLowerCase']()==='outbound'?_0x364cd0[_0x4146('0x2c')]:_0x364cd0[_0x4146('0x33')];return getAuthToken(_0x58c56a,_0x7032f1,_0xd35553)[_0x4146('0x16')](function(_0x4523ed){_0x238b74=_0x238b74?_0x238b74:_0x4146('0x34');var _0x3f61aa={'method':'GET','uri':_0x557d8b+'contacts?$select='+_0x238b74+_0x4146('0x35')+_0x238b74+_0x4146('0x36')+_0x3e8e12[_0x4146('0x37')]('+',_0x4146('0x38'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x4523ed,'If-None-Match':null,'OData-Version':_0x4146('0x1f')},'json':!![]};return rp(_0x3f61aa);})[_0x4146('0x16')](function(_0x47cc92){var _0x40e31a=![];if(!_0x47cc92)return _0x40e31a;var _0x32271f=_0x47cc92['value'];for(var _0x59f85a=0x0;_0x59f85a<_0x32271f['length'];_0x59f85a++){if(_0x32271f[_0x59f85a][_0x238b74]===_0x3e8e12){_0x40e31a=!![];_0x58c5c5[_0x4146('0x32')]=_0x32271f[_0x59f85a][_0x4146('0x39')];}}return _0x40e31a;})[_0x4146('0x16')](function(_0xf02cc0){if(_0xf02cc0)return _0x58c5c5;if(_0x181729==='nothing'){logger[_0x4146('0x25')]('['+[_0xd35553['toUpperCase']()]+_0x4146('0x3a'));return _0x58c5c5;}return createEndUser(_0x58c5c5,_0x58c56a,_0x7032f1,_0x557d8b,_0x364cd0,_0xd35553,_0x238b74)['then'](function(_0x3fca78){logger[_0x4146('0x25')]('['+[_0xd35553[_0x4146('0x1a')]()]+']\x20Enduser\x20created!',_0x3fca78[_0x4146('0x32')]);return _0x3fca78;});});}function getCustomFields(_0x26d456,_0x4c50f0,_0x307de5){var _0x427110={};if(_0x26d456[_0x4146('0x23')]>0x0){_['forEach'](_0x26d456,function(_0x55becd){if(_[_0x4146('0x3b')]([_0x4146('0x3c'),'picklist'],_0x55becd[_0x4146('0x3d')])&&_0x55becd['nameField']&&!_0x55becd[_0x4146('0x3e')]){var _0x292dc3=_0x55becd[_0x4146('0x3f')][_0x4146('0x2b')]();var _0x1b98dc=_0x292dc3[_0x4146('0x30')](0x0,_0x292dc3[_0x4146('0x40')]('_'));var _0x2a545d=_0x292dc3['substring'](_0x292dc3[_0x4146('0x40')]('_')+0x1);if(_0x1b98dc===_0x307de5){_0x427110[_0x2a545d]=_0x55becd[_0x4146('0x41')];}}});}return _0x427110;}function getTicket(_0x1bd1df,_0x51385c,_0x34f115,_0x462680,_0x58da5b,_0x32f6b9,_0x4743a3){return new Promise(function(_0x3e9323,_0x408834){var _0x5c7818;return getAuthToken(_0x51385c,_0x34f115,_0x4743a3)[_0x4146('0x16')](function(_0x25a73e){if(_0x32f6b9['ticketType']===_0x4146('0x42')){_0x5c7818={'method':_0x4146('0x12'),'uri':_0x462680+_0x4146('0x43'),'body':Object[_0x4146('0x44')]({},{'title':intUtil[_0x4146('0x45')](_0x32f6b9[_0x4146('0x46')],_0x58da5b,'\x20'),'description':intUtil['getString'](_0x32f6b9[_0x4146('0x47')],_0x58da5b,'\x0a'),'customerid_contact@odata.bind':_0x1bd1df[_0x4146('0x32')]?_0x4146('0x48')+_0x1bd1df[_0x4146('0x32')]+')':undefined,'ownerid@odata.bind':_0x4146('0x49')+_0x1bd1df[_0x4146('0x2a')]+')','caseorigincode':'1'},getCustomFields(_0x32f6b9[_0x4146('0x4a')],_0x58da5b,_0x32f6b9[_0x4146('0x4b')])),'headers':{'Authorization':_0x4146('0x1e')+_0x25a73e,'OData-Version':_0x4146('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x32f6b9[_0x4146('0x4b')]==='phonecall'){var _0x395369=_0x1bd1df[_0x4146('0x32')]?[{'partyid_systemuser@odata.bind':_0x4146('0x49')+_0x1bd1df['userId']+')','participationtypemask':_0x1bd1df['callDirection']===_0x4146('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x4146('0x48')+_0x1bd1df['enduserId']+')','participationtypemask':_0x1bd1df[_0x4146('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1bd1df[_0x4146('0x2a')]+')','participationtypemask':_0x1bd1df[_0x4146('0x4d')]===_0x4146('0x4c')?0x2:0x1}];_0x5c7818={'method':'POST','uri':_0x462680+_0x4146('0x4e'),'body':Object[_0x4146('0x44')]({},{'subject':intUtil[_0x4146('0x45')](_0x32f6b9[_0x4146('0x46')],_0x58da5b,'\x20'),'phonenumber':String(_0x58da5b[_0x4146('0x33')]),'description':intUtil[_0x4146('0x45')](_0x32f6b9['Descriptions'],_0x58da5b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1bd1df[_0x4146('0x32')]?_0x4146('0x48')+_0x1bd1df[_0x4146('0x32')]+')':undefined,'ownerid@odata.bind':_0x4146('0x49')+_0x1bd1df[_0x4146('0x2a')]+')','directioncode':_0x1bd1df[_0x4146('0x4d')]===_0x4146('0x4c')?![]:!![],'phonecall_activity_parties':_0x395369},getCustomFields(_0x32f6b9[_0x4146('0x4a')],_0x58da5b,_0x32f6b9[_0x4146('0x4b')])),'headers':{'Authorization':'Bearer\x20'+_0x25a73e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5c7818);})['then'](function(_0x12ea01){var _0x56c885=_0x12ea01['headers'][_0x4146('0x2f')];var _0x137a74=_0x56c885[_0x4146('0x30')](_0x56c885['lastIndexOf']('(')+0x1,_0x56c885[_0x4146('0x31')](')'));_0x1bd1df[_0x4146('0x4f')]=_0x137a74;_0x3e9323(_0x1bd1df);})['catch'](function(_0x34f334){_0x408834(_0x34f334['message']);});});}function emit(_0x19b09b,_0x317444,_0x367093,_0x31b7d3){var _0xab36d1={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x19b09b,_0x367093,_0x31b7d3)};io['to'](util['format'](_0x4146('0x50'),_0x317444))['emit'](_0x4146('0x51'),_0xab36d1);}exports['cs']=function(_0x2ab04c,_0xcd82c5,_0x54a969,_0x47c272,_0x5229ec,_0x3e88b5,_0x14b087,_0x11ad15){var _0x12aee4={};_0x3e88b5[_0x4146('0xc')]=_0x3e88b5[_0x4146('0xb')]?intUtil[_0x4146('0x52')](_0x3e88b5[_0x4146('0xd')][_0x4146('0xe')]):intUtil[_0x4146('0x52')](_0x3e88b5[_0x4146('0xc')]);_0x3e88b5[_0x4146('0x53')]=intUtil[_0x4146('0x52')](_0x3e88b5[_0x4146('0x53')]);_0x12aee4['callDirection']=_0x11ad15===_0x4146('0x4c')||_0x11ad15===_0x4146('0x54')?_0x4146('0x4c'):_0x4146('0x55');var _0x11acc5=_0x3e88b5[_0x4146('0xb')]?util[_0x4146('0x56')](_0x4146('0x57'),_0x3e88b5['CloudProvider'][_0x4146('0xe')]):util[_0x4146('0x56')](_0x4146('0x57'),_0x3e88b5[_0x4146('0xc')]);var _0x5297d5=util[_0x4146('0x56')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3e88b5[_0x4146('0xf')]);var _0x4c8384=util[_0x4146('0x56')](_0x4146('0x58'),_0x3e88b5[_0x4146('0x53')],_0xcd82c5['uniqueid'],md5(_0xcd82c5[_0x4146('0x59')]));if(_0x5229ec&&_0x5229ec['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0xcd82c5[_0x4146('0x5a')]=_0x4c8384;}else if(_0x14b087&&_0x14b087[_0x4146('0x5b')]&&_0x14b087['recordingFormat']!==_0x4146('0x5c')){logger[_0x4146('0x25')]('[OUTBOUND]',_0x4146('0x5d'));_0xcd82c5[_0x4146('0x5a')]=_0x4c8384;}else{_0xcd82c5['recordingURL']='';}return getUser(_0x12aee4,_0x3e88b5,_0x47c272,_0x5297d5,_0x11acc5,_0x11ad15)[_0x4146('0x16')](function(_0x4fb6f9){logger[_0x4146('0x25')]('['+_0x11ad15['toUpperCase']()+_0x4146('0x5e'),_0x4fb6f9['userId']);logger['info']('['+_0x11ad15['toUpperCase']()+_0x4146('0x5f'),_0x4fb6f9[_0x4146('0x60')]);return getEndUser(_0x4fb6f9,_0x3e88b5,_0x5297d5,_0x11acc5,_0xcd82c5,_0x11ad15,_0x54a969[_0x4146('0x61')],_0x54a969['additionalSearchContact']);})[_0x4146('0x16')](function(_0x2fa860){logger[_0x4146('0x25')]('['+_0x11ad15['toUpperCase']()+_0x4146('0x62'),_0x2fa860[_0x4146('0x32')]);logger['info']('['+_0x11ad15[_0x4146('0x1a')]()+_0x4146('0x63'),_0xcd82c5[_0x4146('0x33')]);return getTicket(_0x2fa860,_0x3e88b5,_0x5297d5,_0x11acc5,_0xcd82c5,_0x54a969,_0x11ad15);})[_0x4146('0x16')](function(_0x51a501){logger[_0x4146('0x25')](util[_0x4146('0x56')]('['+_0x11ad15[_0x4146('0x1a')]()+_0x4146('0x64'),_0x54a969[_0x4146('0x4b')],_0x51a501['ticketId']));logger[_0x4146('0x25')](util['format']('['+_0x11ad15[_0x4146('0x1a')]()+_0x4146('0x65'),_0x11ad15));if(_0x11ad15!==_0x4146('0x54')&&_0x54a969[_0x4146('0x66')]){logger[_0x4146('0x25')]('['+_0x11ad15['toUpperCase']()+']',_0x4146('0x67'));emit(_0x3e88b5['remoteUri'],_0x47c272[_0x4146('0x68')],_0x54a969[_0x4146('0x4b')],_0x51a501[_0x4146('0x4f')]);}})[_0x4146('0x18')](function(_0x3892bd){logger['error']('['+_0x11ad15[_0x4146('0x1a')]()+_0x4146('0x69'),_0x3892bd[_0x4146('0x1b')]);console[_0x4146('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x3892bd);});}; \ No newline at end of file +var _0x7b4c=['userEmail','internalemailaddress','userId','toLowerCase','contacts','substring','lastIndexOf','enduserId','outbound','calleridnum','telephone1','GET','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','idField','indexOf','content','ticketType','incidents','assign','getString','/contacts(','/systemusers(','Fields','Bearer\x20','phonecall','callDirection','queue','phonecalls','Subjects','Descriptions','odata-entityid','format','emit','trigger:browser:url','stripTrailingSlash','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','4.0','validateEmail','email','length','isdisabled','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x5f0fec,_0x62015d){var _0x40f104=function(_0x32c924){while(--_0x32c924){_0x5f0fec['push'](_0x5f0fec['shift']());}};_0x40f104(++_0x62015d);}(_0x7b4c,0xaf));var _0xc7b4=function(_0x42f28c,_0x28c28d){_0x42f28c=_0x42f28c-0x0;var _0x3efbc6=_0x7b4c[_0x42f28c];return _0x3efbc6;};'use strict';var _=require('lodash');var rp=require(_0xc7b4('0x0'));var util=require('util');var intUtil=require(_0xc7b4('0x1'));var md5=require(_0xc7b4('0x2'));var Redis=require(_0xc7b4('0x3'));var logger=require(_0xc7b4('0x4'))(_0xc7b4('0x5'));var config=require(_0xc7b4('0x6'));config['redis']=_['defaults'](config[_0xc7b4('0x7')],{'host':_0xc7b4('0x8'),'port':0x18eb});var io=require(_0xc7b4('0x9'))(new Redis(config['redis']));function getAuthToken(_0x17aaa3,_0x578fe6,_0x4d2d2d){if(_0x17aaa3[_0xc7b4('0xa')]){_0x17aaa3[_0xc7b4('0xb')]=_0x17aaa3[_0xc7b4('0xc')][_0xc7b4('0xd')];_0x17aaa3['tenantId']=_0x17aaa3['CloudProvider']['data2'];return Promise[_0xc7b4('0xe')](_0x17aaa3[_0xc7b4('0xc')][_0xc7b4('0xf')]);}var _0xf3a20c={'method':_0xc7b4('0x10'),'uri':_0x578fe6,'form':{'client_id':_0x17aaa3[_0xc7b4('0x11')],'resource':_0x17aaa3[_0xc7b4('0xb')],'username':_0x17aaa3[_0xc7b4('0x12')],'password':_0x17aaa3[_0xc7b4('0x13')],'grant_type':'password','client_secret':_0x17aaa3['clientSecret']},'json':!![]};return rp(_0xf3a20c)[_0xc7b4('0x14')](function(_0x45631a){return _0x45631a[_0xc7b4('0x15')];})[_0xc7b4('0x16')](function(_0x2ae4f2){logger[_0xc7b4('0x17')]('['+[_0x4d2d2d[_0xc7b4('0x18')]()]+_0xc7b4('0x19'));return _0x2ae4f2[_0xc7b4('0x1a')];});}function getUser(_0x44c700,_0x589bde,_0x361d64,_0x2940c1,_0x5206b4,_0x386e0d){return new Promise(function(_0xaf56cc,_0x5006f9){return getAuthToken(_0x589bde,_0x2940c1,_0x386e0d)[_0xc7b4('0x14')](function(_0x1067c8){var _0x504296={'method':'GET','uri':_0x5206b4+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x1067c8,'OData-Version':_0xc7b4('0x1b')},'json':!![]};return rp(_0x504296);})['then'](function(_0x2c9c71){var _0x1f1228=_0x2c9c71['value'];var _0x2646e7=![];var _0x98dc11=null;if(!_['isNil'](_0x361d64)){if(intUtil[_0xc7b4('0x1c')](_0x361d64[_0xc7b4('0x1d')])){_0x44c700['userEmail']=_0x361d64[_0xc7b4('0x1d')];for(_0x98dc11=0x0;_0x98dc11<_0x1f1228[_0xc7b4('0x1e')];_0x98dc11++){if(_0x1f1228[_0x98dc11]['internalemailaddress']===_0x361d64[_0xc7b4('0x1d')]&&!_0x1f1228[_0x98dc11][_0xc7b4('0x1f')]){_0x2646e7=!![];logger[_0xc7b4('0x20')]('['+[_0x386e0d[_0xc7b4('0x18')]()]+']\x20Agent\x20found\x20'+_0x1f1228[_0x98dc11][_0xc7b4('0x21')]+'!');_0x44c700['userId']=_0x1f1228[_0x98dc11][_0xc7b4('0x21')];}}}}if(!_0x2646e7){logger['info']('['+[_0x386e0d[_0xc7b4('0x18')]()]+_0xc7b4('0x22'));_0x44c700[_0xc7b4('0x23')]=_0x589bde[_0xc7b4('0x12')];for(_0x98dc11=0x0;_0x98dc11<_0x1f1228[_0xc7b4('0x1e')];_0x98dc11++){if(_0x1f1228[_0x98dc11][_0xc7b4('0x24')]===_0x589bde[_0xc7b4('0x12')]){_0x44c700[_0xc7b4('0x25')]=_0x1f1228[_0x98dc11][_0xc7b4('0x21')];}}}_0xaf56cc(_0x44c700);})[_0xc7b4('0x16')](function(_0x3f57e8){_0x5006f9(_0x3f57e8[_0xc7b4('0x1a')]);});});}function createEndUser(_0x4b9c80,_0x9bc7af,_0x12939e,_0x531dfb,_0x5ef3d8,_0x2eec0b,_0x4498e5){return new Promise(function(_0x907f4b,_0x55bffc){return getAuthToken(_0x9bc7af,_0x12939e,_0x2eec0b)[_0xc7b4('0x14')](function(_0x1636f2){var _0x44fd9b=_0x2eec0b[_0xc7b4('0x26')]()==='outbound'?_0x5ef3d8['destcalleridnum']:_0x5ef3d8['calleridnum'];var _0x2f05be={'method':_0xc7b4('0x10'),'uri':_0x531dfb+_0xc7b4('0x27'),'body':{'fullname':_0x44fd9b,'firstname':_0x44fd9b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4b9c80[_0xc7b4('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1636f2,'OData-Version':_0xc7b4('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x2f05be['body'][_0x4498e5]=_0x44fd9b;return rp(_0x2f05be);})['then'](function(_0x47fd00){var _0x3edc99=_0x47fd00['headers']['odata-entityid'];var _0x4105b2=_0x3edc99[_0xc7b4('0x28')](_0x3edc99[_0xc7b4('0x29')]('(')+0x1,_0x3edc99[_0xc7b4('0x29')](')'));_0x4b9c80[_0xc7b4('0x2a')]=_0x4105b2;_0x907f4b(_0x4b9c80);})['catch'](function(_0x3fb7f7){_0x55bffc(_0x3fb7f7[_0xc7b4('0x1a')]);});});}function getEndUser(_0x42f96b,_0x14724d,_0x344818,_0x586640,_0x259a4e,_0x3574c,_0x4977d5,_0x4e4236){var _0x4e417f=_0x3574c['toLowerCase']()===_0xc7b4('0x2b')?_0x259a4e['destcalleridnum']:_0x259a4e[_0xc7b4('0x2c')];return getAuthToken(_0x14724d,_0x344818,_0x3574c)['then'](function(_0x9820cd){_0x4e4236=_0x4e4236?_0x4e4236:_0xc7b4('0x2d');var _0x2efd74={'method':_0xc7b4('0x2e'),'uri':_0x586640+'contacts?$select='+_0x4e4236+_0xc7b4('0x2f')+_0x4e4236+_0xc7b4('0x30')+_0x4e417f[_0xc7b4('0x31')]('+',_0xc7b4('0x32'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x9820cd,'If-None-Match':null,'OData-Version':_0xc7b4('0x1b')},'json':!![]};return rp(_0x2efd74);})[_0xc7b4('0x14')](function(_0x469251){var _0x22f1d1=![];if(!_0x469251)return _0x22f1d1;var _0x54a41e=_0x469251[_0xc7b4('0x33')];for(var _0x359af7=0x0;_0x359af7<_0x54a41e[_0xc7b4('0x1e')];_0x359af7++){if(_0x54a41e[_0x359af7][_0x4e4236]===_0x4e417f){_0x22f1d1=!![];_0x42f96b[_0xc7b4('0x2a')]=_0x54a41e[_0x359af7][_0xc7b4('0x34')];}}return _0x22f1d1;})['then'](function(_0x8a111a){if(_0x8a111a)return _0x42f96b;if(_0x4977d5===_0xc7b4('0x35')){logger[_0xc7b4('0x20')]('['+[_0x3574c[_0xc7b4('0x18')]()]+_0xc7b4('0x36'));return _0x42f96b;}return createEndUser(_0x42f96b,_0x14724d,_0x344818,_0x586640,_0x259a4e,_0x3574c,_0x4e4236)[_0xc7b4('0x14')](function(_0x119ab9){logger[_0xc7b4('0x20')]('['+[_0x3574c[_0xc7b4('0x18')]()]+_0xc7b4('0x37'),_0x119ab9[_0xc7b4('0x2a')]);return _0x119ab9;});});}function getCustomFields(_0x59a0c0,_0x38c45d,_0x5e5745){var _0x59b444={};if(_0x59a0c0['length']>0x0){_[_0xc7b4('0x38')](_0x59a0c0,function(_0x235b46){if(_[_0xc7b4('0x39')](['string',_0xc7b4('0x3a')],_0x235b46[_0xc7b4('0x3b')])&&_0x235b46[_0xc7b4('0x3c')]&&!_0x235b46['customField']){var _0x345982=_0x235b46[_0xc7b4('0x3d')][_0xc7b4('0x26')]();var _0x1bd151=_0x345982[_0xc7b4('0x28')](0x0,_0x345982[_0xc7b4('0x3e')]('_'));var _0x2c5e1a=_0x345982[_0xc7b4('0x28')](_0x345982[_0xc7b4('0x3e')]('_')+0x1);if(_0x1bd151===_0x5e5745){_0x59b444[_0x2c5e1a]=_0x235b46[_0xc7b4('0x3f')];}}});}return _0x59b444;}function getTicket(_0x618cbe,_0x281d6a,_0x469d74,_0x4200b2,_0x395504,_0x3c9266,_0xed7cd5){return new Promise(function(_0x3888a3,_0x5d6362){var _0xdedd8b;return getAuthToken(_0x281d6a,_0x469d74,_0xed7cd5)[_0xc7b4('0x14')](function(_0x396a2f){if(_0x3c9266[_0xc7b4('0x40')]==='incident'){_0xdedd8b={'method':_0xc7b4('0x10'),'uri':_0x4200b2+_0xc7b4('0x41'),'body':Object[_0xc7b4('0x42')]({},{'title':intUtil['getString'](_0x3c9266['Subjects'],_0x395504,'\x20'),'description':intUtil[_0xc7b4('0x43')](_0x3c9266['Descriptions'],_0x395504,'\x0a'),'customerid_contact@odata.bind':_0x618cbe[_0xc7b4('0x2a')]?_0xc7b4('0x44')+_0x618cbe[_0xc7b4('0x2a')]+')':undefined,'ownerid@odata.bind':_0xc7b4('0x45')+_0x618cbe[_0xc7b4('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3c9266[_0xc7b4('0x46')],_0x395504,_0x3c9266['ticketType'])),'headers':{'Authorization':_0xc7b4('0x47')+_0x396a2f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3c9266[_0xc7b4('0x40')]===_0xc7b4('0x48')){var _0x417624=_0x618cbe[_0xc7b4('0x2a')]?[{'partyid_systemuser@odata.bind':_0xc7b4('0x45')+_0x618cbe[_0xc7b4('0x25')]+')','participationtypemask':_0x618cbe[_0xc7b4('0x49')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xc7b4('0x44')+_0x618cbe[_0xc7b4('0x2a')]+')','participationtypemask':_0x618cbe[_0xc7b4('0x49')]===_0xc7b4('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc7b4('0x45')+_0x618cbe[_0xc7b4('0x25')]+')','participationtypemask':_0x618cbe[_0xc7b4('0x49')]==='queue'?0x2:0x1}];_0xdedd8b={'method':_0xc7b4('0x10'),'uri':_0x4200b2+_0xc7b4('0x4b'),'body':Object['assign']({},{'subject':intUtil[_0xc7b4('0x43')](_0x3c9266[_0xc7b4('0x4c')],_0x395504,'\x20'),'phonenumber':String(_0x395504[_0xc7b4('0x2c')]),'description':intUtil[_0xc7b4('0x43')](_0x3c9266[_0xc7b4('0x4d')],_0x395504,'\x0a'),'regardingobjectid_contact@odata.bind':_0x618cbe[_0xc7b4('0x2a')]?'/contacts('+_0x618cbe[_0xc7b4('0x2a')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x618cbe[_0xc7b4('0x25')]+')','directioncode':_0x618cbe[_0xc7b4('0x49')]==='queue'?![]:!![],'phonecall_activity_parties':_0x417624},getCustomFields(_0x3c9266[_0xc7b4('0x46')],_0x395504,_0x3c9266[_0xc7b4('0x40')])),'headers':{'Authorization':_0xc7b4('0x47')+_0x396a2f,'OData-Version':_0xc7b4('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xdedd8b);})[_0xc7b4('0x14')](function(_0x25f5e1){var _0x28a041=_0x25f5e1['headers'][_0xc7b4('0x4e')];var _0x2b64ad=_0x28a041[_0xc7b4('0x28')](_0x28a041[_0xc7b4('0x29')]('(')+0x1,_0x28a041[_0xc7b4('0x29')](')'));_0x618cbe['ticketId']=_0x2b64ad;_0x3888a3(_0x618cbe);})['catch'](function(_0xc02807){_0x5d6362(_0xc02807['message']);});});}function emit(_0x10a079,_0x19381c,_0x8e9018,_0x261106){var _0x3aef8e={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x10a079,_0x8e9018,_0x261106)};io['to'](util[_0xc7b4('0x4f')]('user:%s',_0x19381c))[_0xc7b4('0x50')](_0xc7b4('0x51'),_0x3aef8e);}exports['cs']=function(_0x5b7d22,_0x4dfb9c,_0x3eb905,_0x12e8f5,_0x43d904,_0xaf6f52,_0x17c44f,_0x3a9e31){var _0x56e2b0={};_0xaf6f52[_0xc7b4('0xb')]=_0xaf6f52['modernAuthentication']?intUtil[_0xc7b4('0x52')](_0xaf6f52[_0xc7b4('0xc')][_0xc7b4('0xd')]):intUtil[_0xc7b4('0x52')](_0xaf6f52[_0xc7b4('0xb')]);_0xaf6f52['serverUrl']=intUtil['stripTrailingSlash'](_0xaf6f52['serverUrl']);_0x56e2b0[_0xc7b4('0x49')]=_0x3a9e31===_0xc7b4('0x4a')||_0x3a9e31===_0xc7b4('0x53')?_0xc7b4('0x4a'):'outbound';var _0x4eda82=_0xaf6f52[_0xc7b4('0xa')]?util[_0xc7b4('0x4f')]('%s/api/data/v9.0/',_0xaf6f52[_0xc7b4('0xc')][_0xc7b4('0xd')]):util['format']('%s/api/data/v9.0/',_0xaf6f52[_0xc7b4('0xb')]);var _0x3cb8c3=util[_0xc7b4('0x4f')](_0xc7b4('0x54'),_0xaf6f52['tenantId']);var _0x5bdd78=util['format'](_0xc7b4('0x55'),_0xaf6f52[_0xc7b4('0x56')],_0x4dfb9c[_0xc7b4('0x57')],md5(_0x4dfb9c[_0xc7b4('0x57')]));if(_0x43d904&&_0x43d904[_0xc7b4('0x58')]){logger['info']('[QUEUE]',_0xc7b4('0x59'));_0x4dfb9c['recordingURL']=_0x5bdd78;}else if(_0x17c44f&&_0x17c44f[_0xc7b4('0x5a')]&&_0x17c44f[_0xc7b4('0x5a')]!==_0xc7b4('0x5b')){logger[_0xc7b4('0x20')](_0xc7b4('0x5c'),_0xc7b4('0x59'));_0x4dfb9c[_0xc7b4('0x5d')]=_0x5bdd78;}else{_0x4dfb9c[_0xc7b4('0x5d')]='';}return getUser(_0x56e2b0,_0xaf6f52,_0x12e8f5,_0x3cb8c3,_0x4eda82,_0x3a9e31)[_0xc7b4('0x14')](function(_0x2f334d){logger[_0xc7b4('0x20')]('['+_0x3a9e31[_0xc7b4('0x18')]()+_0xc7b4('0x5e'),_0x2f334d['userId']);logger['info']('['+_0x3a9e31[_0xc7b4('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x2f334d[_0xc7b4('0x23')]);return getEndUser(_0x2f334d,_0xaf6f52,_0x3cb8c3,_0x4eda82,_0x4dfb9c,_0x3a9e31,_0x3eb905[_0xc7b4('0x5f')],_0x3eb905[_0xc7b4('0x60')]);})[_0xc7b4('0x14')](function(_0x4a65b9){logger[_0xc7b4('0x20')]('['+_0x3a9e31['toUpperCase']()+_0xc7b4('0x61'),_0x4a65b9[_0xc7b4('0x2a')]);logger['info']('['+_0x3a9e31[_0xc7b4('0x18')]()+_0xc7b4('0x62'),_0x4dfb9c[_0xc7b4('0x2c')]);return getTicket(_0x4a65b9,_0xaf6f52,_0x3cb8c3,_0x4eda82,_0x4dfb9c,_0x3eb905,_0x3a9e31);})[_0xc7b4('0x14')](function(_0x1db5cb){logger['info'](util['format']('['+_0x3a9e31[_0xc7b4('0x18')]()+_0xc7b4('0x63'),_0x3eb905[_0xc7b4('0x40')],_0x1db5cb[_0xc7b4('0x64')]));logger[_0xc7b4('0x20')](util['format']('['+_0x3a9e31[_0xc7b4('0x18')]()+']\x20Call\x20direction:\x20%s',_0x3a9e31));if(_0x3a9e31!==_0xc7b4('0x53')&&_0x3eb905[_0xc7b4('0x65')]){logger['info']('['+_0x3a9e31[_0xc7b4('0x18')]()+']',_0xc7b4('0x66'));emit(_0xaf6f52[_0xc7b4('0xb')],_0x12e8f5[_0xc7b4('0x67')],_0x3eb905['ticketType'],_0x1db5cb[_0xc7b4('0x64')]);}})[_0xc7b4('0x16')](function(_0x387d3e){logger[_0xc7b4('0x17')]('['+_0x3a9e31[_0xc7b4('0x18')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x387d3e['message']);console[_0xc7b4('0x17')](_0xc7b4('0x68'),_0x387d3e);});}; \ 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 7f7cef1..5c07495 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 _0x655f=['remoteUri','POST','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Basic\x20%s','apiKey','toString','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','string','idField','content','variable','variableName','customVariable','Variable','name','push','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','keyBy','value','%s/api/v2/tickets'];(function(_0x2053e6,_0x174e07){var _0x531080=function(_0x55e04f){while(--_0x55e04f){_0x2053e6['push'](_0x2053e6['shift']());}};_0x531080(++_0x174e07);}(_0x655f,0x151));var _0xf655=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0x655f[_0x1aae33];return _0x2e91e9;};'use strict';var _=require(_0xf655('0x0'));var rp=require(_0xf655('0x1'));var md5=require(_0xf655('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xf655('0x3'));var logger=require(_0xf655('0x4'))(_0xf655('0x5'));config[_0xf655('0x6')]=_[_0xf655('0x7')](config['redis'],{'host':_0xf655('0x8'),'port':0x18eb});var io=require(_0xf655('0x9'))(new Redis(config[_0xf655('0x6')]));var headers={'Content-Type':_0xf655('0xa'),'Accept':'application/json'};function emit(_0x11089a,_0x29b373,_0x4bf96c){io['to'](_0x11089a)[_0xf655('0xb')](_0x29b373,_0x4bf96c);}function getTicket(_0x347989,_0x104fb0,_0x3b83b1,_0x39cb04,_0x1bb22e){logger[_0xf655('0xc')](_0xf655('0xd'));var _0x5087f1=_['merge']({'responder_id':_0x104fb0['id'],'requester_id':_0x3b83b1['id'],'name':util[_0xf655('0xe')](_0xf655('0xf'),_0x1bb22e[_0xf655('0x10')]),'phone':_0x1bb22e['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf655('0x11')](_0x39cb04[_0xf655('0x12')],_0x1bb22e,'\x20'),'description':intUtil[_0xf655('0x11')](_0x39cb04[_0xf655('0x13')],_0x1bb22e,_0xf655('0x14')),'tags':getTags(_0x39cb04[_0xf655('0x15')],'name')},getCustomFields(_0x39cb04[_0xf655('0x16')],_0x1bb22e));_0x5087f1[_0xf655('0x17')]=_['mapValues'](_[_0xf655('0x18')](_0x5087f1[_0xf655('0x17')],'id'),_0xf655('0x19'));return request({'uri':util[_0xf655('0xe')](_0xf655('0x1a'),_0x347989[_0xf655('0x1b')]),'method':_0xf655('0x1c'),'body':_0x5087f1})[_0xf655('0x1d')](function(_0x52d2c1){logger[_0xf655('0xc')](_0xf655('0x1e'));return _0x52d2c1;});}function getUser(_0xc49ed3,_0x397743){if(intUtil[_0xf655('0x1f')](_0x397743)){return request({'uri':util[_0xf655('0xe')]('%s/api/v2/agents',_0xc49ed3[_0xf655('0x1b')]),'qs':{'email':_0x397743}})['then'](function(_0x4f7da6){if(_0x4f7da6[_0xf655('0x20')]){logger[_0xf655('0xc')](_0xf655('0x21'));return _['find'](_0x4f7da6,function(_0x50b46a){return _0x50b46a['contact']['email']===_0x397743;});}else{logger[_0xf655('0xc')](_0xf655('0x22'));return request({'uri':util[_0xf655('0xe')](_0xf655('0x23'),_0xc49ed3[_0xf655('0x1b')])})[_0xf655('0x1d')](function(_0x24a44e){logger[_0xf655('0xc')](_0xf655('0x24'));return _0x24a44e;});}});}else{logger['info'](_0xf655('0x25'));return request({'uri':util[_0xf655('0xe')](_0xf655('0x23'),_0xc49ed3['remoteUri'])})['then'](function(_0x5af1ff){logger[_0xf655('0xc')]('Admin\x20account\x20selected.');return _0x5af1ff;});}}function getEndUser(_0x12c4bf,_0x4a07de,_0x148ee2){logger['info'](_0xf655('0x26'),_0x148ee2);return request({'uri':util[_0xf655('0xe')](_0xf655('0x27'),_0x12c4bf[_0xf655('0x1b')]),'qs':{'phone':_0x148ee2}})[_0xf655('0x1d')](function(_0x3427eb){if(_0x3427eb[_0xf655('0x20')]){logger[_0xf655('0xc')](_0xf655('0x28'));return _[_0xf655('0x29')](_0x3427eb,{'phone':_0x148ee2});}else{logger[_0xf655('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xf655('0x27'),_0x12c4bf[_0xf655('0x1b')]),'method':_0xf655('0x1c'),'body':{'name':_0x4a07de,'phone':_0x148ee2}})[_0xf655('0x1d')](function(_0x215256){logger[_0xf655('0xc')]('Enduser\x20created.');return _0x215256;});}});}function getAuth(_0x3a444c){return util[_0xf655('0xe')](_0xf655('0x2a'),new Buffer(_0x3a444c[_0xf655('0x2b')]+':X')[_0xf655('0x2c')]('base64'));}function request(_0x1e83fa){logger['debug']('[HTTP]',JSON[_0xf655('0x2d')](_0x1e83fa));return rp(_['defaults'](_0x1e83fa,{'method':_0xf655('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x22020e,_0x25e313){var _0x373953=[];if(_0x22020e&&_0x22020e['length']>0x0){_0x373953=_[_0xf655('0x2f')](_0x22020e,_0x25e313);}return _0x373953;}function getCustomFields(_0x3c174e,_0x2dc972){var _0xf41cf5=[];var _0x42645f={'custom_fields':[]};if(_0x3c174e['length']>0x0){_[_0xf655('0x30')](_0x3c174e,function(_0x424e5e){if(_[_0xf655('0x31')](['string',_0xf655('0x32')],_0x424e5e[_0xf655('0x33')])&&_0x424e5e[_0xf655('0x34')]&&!_0x424e5e[_0xf655('0x35')]){_0x42645f[_0x424e5e[_0xf655('0x34')][_0xf655('0x36')]()]=_0x424e5e['content']['toString']();}else if(_[_0xf655('0x31')]([_0xf655('0x37'),'picklist'],_0x424e5e[_0xf655('0x33')])&&_0x424e5e[_0xf655('0x38')]&&_0x424e5e[_0xf655('0x35')]){_0x42645f[_0xf655('0x17')]['push']({'id':_0x424e5e['idField'],'value':_0x424e5e[_0xf655('0x39')][_0xf655('0x2c')]()});}else if(_0x424e5e['type']===_0xf655('0x3a')&&_0x424e5e['variableName']&&_0x424e5e['idField']&&_0x424e5e[_0xf655('0x35')]){_0x2dc972[_0x424e5e[_0xf655('0x3b')]]&&_0x42645f['custom_fields']['push']({'id':_0x424e5e['idField'],'value':_0x2dc972[_0x424e5e[_0xf655('0x3b')]][_0xf655('0x2c')]()});}else if(_0x424e5e['type']===_0xf655('0x3c')&&_0x424e5e[_0xf655('0x3d')]&&_0x424e5e[_0xf655('0x3d')][_0xf655('0x3e')]&&_0x424e5e[_0xf655('0x38')]&&_0x424e5e['customField']){_0x2dc972[_0x424e5e[_0xf655('0x3d')][_0xf655('0x3e')]['toLowerCase']()]&&_0x42645f[_0xf655('0x17')][_0xf655('0x3f')]({'id':_0x424e5e['idField'],'value':_0x2dc972[_0x424e5e[_0xf655('0x3d')][_0xf655('0x3e')]['toLowerCase']()][_0xf655('0x2c')]()});}});}return _0x42645f;}exports['queue']=function(_0x47dde7,_0x7b4ee8,_0x16b72c,_0x4088e3,_0x458826,_0x3d5011){var _0x22d24b,_0x461654;_0x3d5011[_0xf655('0x1b')]=intUtil['stripTrailingSlash'](_0x3d5011['remoteUri']);_0x3d5011[_0xf655('0x40')]=intUtil[_0xf655('0x41')](_0x3d5011[_0xf655('0x40')]);if(_0x458826&&_0x458826[_0xf655('0x42')]){logger[_0xf655('0xc')]('[QUEUE]',_0xf655('0x43'));_0x7b4ee8[_0xf655('0x44')]=util[_0xf655('0xe')](_0xf655('0x45'),_0x3d5011[_0xf655('0x40')],_0x7b4ee8[_0xf655('0x46')],md5(_0x7b4ee8[_0xf655('0x46')]));}else{_0x7b4ee8[_0xf655('0x44')]='';}headers[_0xf655('0x47')]=getAuth(_0x3d5011);return getUser(_0x3d5011,_0x4088e3[_0xf655('0x48')])[_0xf655('0x1d')](function(_0x184dd7){_0x22d24b=_0x184dd7;logger[_0xf655('0xc')](_0xf655('0x49'),_0x22d24b['id']);return getEndUser(_0x3d5011,_0x7b4ee8['calleridname'],_0x7b4ee8[_0xf655('0x4a')]);})['then'](function(_0x5ec1b5){_0x461654=_0x5ec1b5;logger[_0xf655('0xc')](_0xf655('0x4b'),_0x461654['id']);return getTicket(_0x3d5011,_0x22d24b,_0x461654,_0x16b72c,_0x7b4ee8);})[_0xf655('0x1d')](function(_0x326e83){if(_0x326e83&&_0x326e83['id']){logger['info'](_0xf655('0x1e'));logger[_0xf655('0xc')](_0xf655('0x4c'),_0x326e83['id']);logger[_0xf655('0xc')](_0xf655('0x4d'),_0xf655('0x4e'));emit(util[_0xf655('0xe')]('user:%s',_0x4088e3[_0xf655('0x3e')]),'trigger:browser:url',{'uri':util[_0xf655('0xe')](_0xf655('0x4f'),_0x3d5011[_0xf655('0x1b')],_0x326e83['id'])});}})[_0xf655('0x50')](function(_0x3f24dd){logger[_0xf655('0x51')](_0xf655('0x4d'),JSON[_0xf655('0x2d')](_0x3f24dd));});};exports['outbound']=function(_0x474d98,_0x31054f,_0x8b0161,_0x2a949b,_0x6df2ea,_0x40be27,_0x221352){var _0x7c697,_0x3fefd7;_0x40be27[_0xf655('0x1b')]=intUtil[_0xf655('0x41')](_0x40be27[_0xf655('0x1b')]);_0x40be27['serverUrl']=intUtil[_0xf655('0x41')](_0x40be27[_0xf655('0x40')]);if(_0x221352&&_0x221352['recordingFormat']&&_0x221352[_0xf655('0x52')]!=='none'){logger['info'](_0xf655('0x53'),_0xf655('0x43'));_0x31054f['recordingURL']=util[_0xf655('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x40be27[_0xf655('0x40')],_0x31054f[_0xf655('0x46')],md5(_0x31054f[_0xf655('0x46')]));}headers[_0xf655('0x47')]=getAuth(_0x40be27);return getUser(_0x40be27,_0x2a949b[_0xf655('0x48')])['then'](function(_0x14787a){_0x7c697=_0x14787a;logger[_0xf655('0xc')]('The\x20User\x20ID\x20is:',_0x7c697['id']);return getEndUser(_0x40be27,_0x31054f[_0xf655('0x54')],_0x31054f[_0xf655('0x55')]);})['then'](function(_0x1d9b20){_0x3fefd7=_0x1d9b20;logger[_0xf655('0xc')](_0xf655('0x4b'),_0x3fefd7['id']);return getTicket(_0x40be27,_0x7c697,_0x3fefd7,_0x8b0161,_0x31054f);})[_0xf655('0x1d')](function(_0x3c473a){if(_0x3c473a&&_0x3c473a['id']){logger[_0xf655('0xc')](_0xf655('0x1e'));logger[_0xf655('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3c473a['id']);logger[_0xf655('0xc')](_0xf655('0x53'),_0xf655('0x4e'));emit(util[_0xf655('0xe')](_0xf655('0x56'),_0x2a949b['name']),_0xf655('0x57'),{'uri':util[_0xf655('0xe')](_0xf655('0x4f'),_0x40be27['remoteUri'],_0x3c473a['id'])});}})[_0xf655('0x50')](function(_0x57b714){logger[_0xf655('0x51')](_0xf655('0x53'),JSON['stringify'](_0x57b714));});};exports[_0xf655('0x58')]=function(_0x8dfb28,_0x36ef28,_0x12e4c7,_0x2dfb8d,_0x4ae978,_0x287625){var _0x1afca5,_0x18e81f;_0x287625[_0xf655('0x1b')]=intUtil[_0xf655('0x41')](_0x287625['remoteUri']);_0x287625[_0xf655('0x40')]=intUtil['stripTrailingSlash'](_0x287625['serverUrl']);if(_0x4ae978&&_0x4ae978[_0xf655('0x42')]){logger[_0xf655('0xc')]('['+_0x36ef28[_0xf655('0x59')][_0xf655('0x5a')]()+']',_0xf655('0x43'));_0x36ef28[_0xf655('0x44')]=util[_0xf655('0xe')](_0xf655('0x45'),_0x287625[_0xf655('0x40')],_0x36ef28[_0xf655('0x46')],md5(_0x36ef28[_0xf655('0x46')]));}else{_0x36ef28[_0xf655('0x44')]='';}headers[_0xf655('0x47')]=getAuth(_0x287625);return getUser(_0x287625,'')[_0xf655('0x1d')](function(_0x441d15){_0x1afca5=_0x441d15;logger['info']('The\x20User\x20ID\x20is:',_0x1afca5['id']);return getEndUser(_0x287625,_0x36ef28[_0xf655('0x10')],_0x36ef28[_0xf655('0x4a')]);})[_0xf655('0x1d')](function(_0x485233){_0x18e81f=_0x485233;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18e81f['id']);return getTicket(_0x287625,_0x1afca5,_0x18e81f,_0x12e4c7,_0x36ef28);})[_0xf655('0x1d')](function(_0x57d49a){if(_0x57d49a){logger[_0xf655('0xc')]('Ticket\x20created!');logger[_0xf655('0xc')](_0xf655('0x4c'),_0x57d49a['id']);}})[_0xf655('0x50')](function(_0x4dbdd9){logger['error']('['+_0x36ef28[_0xf655('0x59')][_0xf655('0x5a')]()+']',JSON[_0xf655('0x2d')](_0x4dbdd9));});}; \ No newline at end of file +var _0x85f7=['Fields','custom_fields','mapValues','keyBy','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','string','type','customField','toLowerCase','idField','content','variable','variableName','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','[QUEUE]','outbound','none','[OUTBOUND]','Authorization','email','destcalleridname','trigger:browser:url','%s/helpdesk/tickets/%d','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','redis','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x85f7,0x157));var _0x785f=function(_0x1d0de9,_0x13e43d){_0x1d0de9=_0x1d0de9-0x0;var _0x3fbc29=_0x85f7[_0x1d0de9];return _0x3fbc29;};'use strict';var _=require(_0x785f('0x0'));var rp=require(_0x785f('0x1'));var md5=require('md5');var util=require(_0x785f('0x2'));var Redis=require(_0x785f('0x3'));var intUtil=require(_0x785f('0x4'));var config=require(_0x785f('0x5'));var logger=require(_0x785f('0x6'))('freshdesk');config['redis']=_[_0x785f('0x7')](config['redis'],{'host':_0x785f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x785f('0x9')]));var headers={'Content-Type':_0x785f('0xa'),'Accept':_0x785f('0xa')};function emit(_0x5e2173,_0x4d4b01,_0x580737){io['to'](_0x5e2173)[_0x785f('0xb')](_0x4d4b01,_0x580737);}function getTicket(_0x513aa7,_0x21f65a,_0x29cb5b,_0x52c4aa,_0x5a5ecd){logger[_0x785f('0xc')](_0x785f('0xd'));var _0x50feb6=_[_0x785f('0xe')]({'responder_id':_0x21f65a['id'],'requester_id':_0x29cb5b['id'],'name':util[_0x785f('0xf')](_0x785f('0x10'),_0x5a5ecd[_0x785f('0x11')]),'phone':_0x5a5ecd[_0x785f('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x785f('0x13')](_0x52c4aa[_0x785f('0x14')],_0x5a5ecd,'\x20'),'description':intUtil[_0x785f('0x13')](_0x52c4aa[_0x785f('0x15')],_0x5a5ecd,_0x785f('0x16')),'tags':getTags(_0x52c4aa[_0x785f('0x17')],_0x785f('0x18'))},getCustomFields(_0x52c4aa[_0x785f('0x19')],_0x5a5ecd));_0x50feb6[_0x785f('0x1a')]=_[_0x785f('0x1b')](_[_0x785f('0x1c')](_0x50feb6[_0x785f('0x1a')],'id'),'value');return request({'uri':util['format']('%s/api/v2/tickets',_0x513aa7['remoteUri']),'method':_0x785f('0x1d'),'body':_0x50feb6})[_0x785f('0x1e')](function(_0x5eaa7c){logger[_0x785f('0xc')](_0x785f('0x1f'));return _0x5eaa7c;});}function getUser(_0x47434e,_0x1e8cb8){if(intUtil[_0x785f('0x20')](_0x1e8cb8)){return request({'uri':util[_0x785f('0xf')](_0x785f('0x21'),_0x47434e[_0x785f('0x22')]),'qs':{'email':_0x1e8cb8}})[_0x785f('0x1e')](function(_0x2d35cf){if(_0x2d35cf[_0x785f('0x23')]){logger[_0x785f('0xc')]('Agent\x20found!');return _['find'](_0x2d35cf,function(_0x9264bc){return _0x9264bc[_0x785f('0x24')]['email']===_0x1e8cb8;});}else{logger[_0x785f('0xc')](_0x785f('0x25'));return request({'uri':util[_0x785f('0xf')](_0x785f('0x26'),_0x47434e[_0x785f('0x22')])})[_0x785f('0x1e')](function(_0x9778b6){logger[_0x785f('0xc')](_0x785f('0x27'));return _0x9778b6;});}});}else{logger[_0x785f('0xc')](_0x785f('0x28'));return request({'uri':util[_0x785f('0xf')](_0x785f('0x26'),_0x47434e[_0x785f('0x22')])})[_0x785f('0x1e')](function(_0x5ebac3){logger[_0x785f('0xc')]('Admin\x20account\x20selected.');return _0x5ebac3;});}}function getEndUser(_0x26f085,_0x3f9f90,_0x1c9071){logger[_0x785f('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1c9071);return request({'uri':util[_0x785f('0xf')]('%s/api/v2/contacts',_0x26f085[_0x785f('0x22')]),'qs':{'phone':_0x1c9071}})['then'](function(_0x1d9b9c){if(_0x1d9b9c[_0x785f('0x23')]){logger['info'](_0x785f('0x29'));return _[_0x785f('0x2a')](_0x1d9b9c,{'phone':_0x1c9071});}else{logger[_0x785f('0xc')](_0x785f('0x2b'));return request({'uri':util[_0x785f('0xf')](_0x785f('0x2c'),_0x26f085[_0x785f('0x22')]),'method':_0x785f('0x1d'),'body':{'name':_0x3f9f90,'phone':_0x1c9071}})[_0x785f('0x1e')](function(_0x72ba2a){logger[_0x785f('0xc')](_0x785f('0x2d'));return _0x72ba2a;});}});}function getAuth(_0x55fdb5){return util[_0x785f('0xf')](_0x785f('0x2e'),new Buffer(_0x55fdb5[_0x785f('0x2f')]+':X')[_0x785f('0x30')](_0x785f('0x31')));}function request(_0x5d3cee){logger['debug'](_0x785f('0x32'),JSON[_0x785f('0x33')](_0x5d3cee));return rp(_[_0x785f('0x7')](_0x5d3cee,{'method':_0x785f('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x14b40b,_0xfa02b6){var _0x255a8a=[];if(_0x14b40b&&_0x14b40b['length']>0x0){_0x255a8a=_[_0x785f('0x35')](_0x14b40b,_0xfa02b6);}return _0x255a8a;}function getCustomFields(_0x557509,_0x55ca70){var _0x2688a5=[];var _0x2cd7c8={'custom_fields':[]};if(_0x557509['length']>0x0){_[_0x785f('0x36')](_0x557509,function(_0xc94020){if(_['includes']([_0x785f('0x37'),'picklist'],_0xc94020[_0x785f('0x38')])&&_0xc94020['nameField']&&!_0xc94020[_0x785f('0x39')]){_0x2cd7c8[_0xc94020['nameField'][_0x785f('0x3a')]()]=_0xc94020['content']['toString']();}else if(_['includes']([_0x785f('0x37'),'picklist'],_0xc94020[_0x785f('0x38')])&&_0xc94020['idField']&&_0xc94020[_0x785f('0x39')]){_0x2cd7c8[_0x785f('0x1a')]['push']({'id':_0xc94020[_0x785f('0x3b')],'value':_0xc94020[_0x785f('0x3c')]['toString']()});}else if(_0xc94020[_0x785f('0x38')]===_0x785f('0x3d')&&_0xc94020[_0x785f('0x3e')]&&_0xc94020[_0x785f('0x3b')]&&_0xc94020[_0x785f('0x39')]){_0x55ca70[_0xc94020[_0x785f('0x3e')]]&&_0x2cd7c8[_0x785f('0x1a')][_0x785f('0x3f')]({'id':_0xc94020['idField'],'value':_0x55ca70[_0xc94020['variableName']][_0x785f('0x30')]()});}else if(_0xc94020[_0x785f('0x38')]===_0x785f('0x40')&&_0xc94020[_0x785f('0x41')]&&_0xc94020[_0x785f('0x41')][_0x785f('0x18')]&&_0xc94020[_0x785f('0x3b')]&&_0xc94020['customField']){_0x55ca70[_0xc94020[_0x785f('0x41')]['name'][_0x785f('0x3a')]()]&&_0x2cd7c8[_0x785f('0x1a')][_0x785f('0x3f')]({'id':_0xc94020[_0x785f('0x3b')],'value':_0x55ca70[_0xc94020[_0x785f('0x41')][_0x785f('0x18')]['toLowerCase']()][_0x785f('0x30')]()});}});}return _0x2cd7c8;}exports[_0x785f('0x42')]=function(_0x816374,_0x127b47,_0xe7293,_0x86e613,_0x3735eb,_0x25ee44){var _0x5e3141,_0xdc64c8;_0x25ee44[_0x785f('0x22')]=intUtil['stripTrailingSlash'](_0x25ee44['remoteUri']);_0x25ee44[_0x785f('0x43')]=intUtil[_0x785f('0x44')](_0x25ee44[_0x785f('0x43')]);if(_0x3735eb&&_0x3735eb[_0x785f('0x45')]){logger[_0x785f('0xc')]('[QUEUE]',_0x785f('0x46'));_0x127b47[_0x785f('0x47')]=util[_0x785f('0xf')](_0x785f('0x48'),_0x25ee44[_0x785f('0x43')],_0x127b47[_0x785f('0x49')],md5(_0x127b47[_0x785f('0x49')]));}else{_0x127b47[_0x785f('0x47')]='';}headers['Authorization']=getAuth(_0x25ee44);return getUser(_0x25ee44,_0x86e613['email'])[_0x785f('0x1e')](function(_0x24d3bb){_0x5e3141=_0x24d3bb;logger[_0x785f('0xc')](_0x785f('0x4a'),_0x5e3141['id']);return getEndUser(_0x25ee44,_0x127b47[_0x785f('0x11')],_0x127b47['calleridnum']);})[_0x785f('0x1e')](function(_0x5b065e){_0xdc64c8=_0x5b065e;logger[_0x785f('0xc')](_0x785f('0x4b'),_0xdc64c8['id']);return getTicket(_0x25ee44,_0x5e3141,_0xdc64c8,_0xe7293,_0x127b47);})['then'](function(_0x17a941){if(_0x17a941&&_0x17a941['id']){logger[_0x785f('0xc')](_0x785f('0x1f'));logger[_0x785f('0xc')](_0x785f('0x4c'),_0x17a941['id']);logger[_0x785f('0xc')]('[QUEUE]',_0x785f('0x4d'));emit(util[_0x785f('0xf')](_0x785f('0x4e'),_0x86e613['name']),'trigger:browser:url',{'uri':util[_0x785f('0xf')]('%s/helpdesk/tickets/%d',_0x25ee44[_0x785f('0x22')],_0x17a941['id'])});}})[_0x785f('0x4f')](function(_0x4a7ea9){logger[_0x785f('0x50')](_0x785f('0x51'),JSON[_0x785f('0x33')](_0x4a7ea9));});};exports[_0x785f('0x52')]=function(_0x199053,_0x324aa1,_0x5a3d3e,_0x5b7422,_0x14a8d0,_0xb40bc7,_0x1095fc){var _0x3375a1,_0x20b52c;_0xb40bc7[_0x785f('0x22')]=intUtil[_0x785f('0x44')](_0xb40bc7[_0x785f('0x22')]);_0xb40bc7[_0x785f('0x43')]=intUtil[_0x785f('0x44')](_0xb40bc7[_0x785f('0x43')]);if(_0x1095fc&&_0x1095fc['recordingFormat']&&_0x1095fc['recordingFormat']!==_0x785f('0x53')){logger[_0x785f('0xc')](_0x785f('0x54'),_0x785f('0x46'));_0x324aa1[_0x785f('0x47')]=util[_0x785f('0xf')](_0x785f('0x48'),_0xb40bc7['serverUrl'],_0x324aa1[_0x785f('0x49')],md5(_0x324aa1['uniqueid']));}headers[_0x785f('0x55')]=getAuth(_0xb40bc7);return getUser(_0xb40bc7,_0x5b7422[_0x785f('0x56')])[_0x785f('0x1e')](function(_0x2b7c33){_0x3375a1=_0x2b7c33;logger[_0x785f('0xc')](_0x785f('0x4a'),_0x3375a1['id']);return getEndUser(_0xb40bc7,_0x324aa1[_0x785f('0x57')],_0x324aa1['destcalleridnum']);})['then'](function(_0x17b66a){_0x20b52c=_0x17b66a;logger[_0x785f('0xc')](_0x785f('0x4b'),_0x20b52c['id']);return getTicket(_0xb40bc7,_0x3375a1,_0x20b52c,_0x5a3d3e,_0x324aa1);})[_0x785f('0x1e')](function(_0x34928c){if(_0x34928c&&_0x34928c['id']){logger['info'](_0x785f('0x1f'));logger[_0x785f('0xc')](_0x785f('0x4c'),_0x34928c['id']);logger['info']('[OUTBOUND]',_0x785f('0x4d'));emit(util[_0x785f('0xf')]('user:%s',_0x5b7422[_0x785f('0x18')]),_0x785f('0x58'),{'uri':util[_0x785f('0xf')](_0x785f('0x59'),_0xb40bc7[_0x785f('0x22')],_0x34928c['id'])});}})[_0x785f('0x4f')](function(_0x1dc3da){logger[_0x785f('0x50')]('[OUTBOUND]',JSON[_0x785f('0x33')](_0x1dc3da));});};exports['unmanaged']=function(_0x58c6c2,_0x3d6f5d,_0x2d368c,_0x5e55ef,_0x403741,_0x49a1e0){var _0x3f5bf0,_0x31cc4a;_0x49a1e0[_0x785f('0x22')]=intUtil['stripTrailingSlash'](_0x49a1e0[_0x785f('0x22')]);_0x49a1e0[_0x785f('0x43')]=intUtil['stripTrailingSlash'](_0x49a1e0['serverUrl']);if(_0x403741&&_0x403741['monitor_format']){logger[_0x785f('0xc')]('['+_0x3d6f5d[_0x785f('0x5a')][_0x785f('0x5b')]()+']',_0x785f('0x46'));_0x3d6f5d[_0x785f('0x47')]=util[_0x785f('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49a1e0[_0x785f('0x43')],_0x3d6f5d[_0x785f('0x49')],md5(_0x3d6f5d[_0x785f('0x49')]));}else{_0x3d6f5d[_0x785f('0x47')]='';}headers[_0x785f('0x55')]=getAuth(_0x49a1e0);return getUser(_0x49a1e0,'')['then'](function(_0x199fb1){_0x3f5bf0=_0x199fb1;logger[_0x785f('0xc')](_0x785f('0x4a'),_0x3f5bf0['id']);return getEndUser(_0x49a1e0,_0x3d6f5d[_0x785f('0x11')],_0x3d6f5d[_0x785f('0x12')]);})[_0x785f('0x1e')](function(_0x44ff0c){_0x31cc4a=_0x44ff0c;logger[_0x785f('0xc')](_0x785f('0x4b'),_0x31cc4a['id']);return getTicket(_0x49a1e0,_0x3f5bf0,_0x31cc4a,_0x2d368c,_0x3d6f5d);})[_0x785f('0x1e')](function(_0x1d4502){if(_0x1d4502){logger[_0x785f('0xc')](_0x785f('0x1f'));logger['info'](_0x785f('0x4c'),_0x1d4502['id']);}})['catch'](function(_0x4600f8){logger[_0x785f('0x50')]('['+_0x3d6f5d[_0x785f('0x5a')][_0x785f('0x5b')]()+']',JSON[_0x785f('0x33')](_0x4600f8));});}; \ 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 3222906..3bfebc8 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 _0x4474=['find','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','/api/tasks','getString','Subjects','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name','lodash','util','moment','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','userId','User\x20found:','toUpperCase','/api/lookup?q='];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0x4474,0x7c));var _0x4447=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x4474[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0x4447('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x4447('0x1'));var moment=require(_0x4447('0x2'));var Promise=require('bluebird');var Redis=require(_0x4447('0x3'));var intUtil=require(_0x4447('0x4'));var config=require(_0x4447('0x5'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x4447('0x6')](config[_0x4447('0x7')],{'host':_0x4447('0x8'),'port':0x18eb});var io=require(_0x4447('0x9'))(new Redis(config[_0x4447('0x7')]));function getAdminId(_0x3db69d,_0x1ab362,_0x477215,_0x1e9e02){return new Promise(function(_0x246afb,_0x2bcb5e){var _0x5ea687=![];var _0x31df5e={'method':_0x4447('0xa'),'uri':_0x1e9e02+_0x4447('0xb'),'json':!![]};_0x31df5e['headers']=_0x477215;logger[_0x4447('0xc')](_0x4447('0xd'));return rp(_0x31df5e)[_0x4447('0xe')](function(_0x4583a7){if(_0x4583a7){var _0xab3b32=_0x4583a7[_0x4447('0xf')];var _0x215ba0=null;for(_0x215ba0=0x0;_0x215ba0<_0xab3b32[_0x4447('0x10')];_0x215ba0++){if(_0xab3b32[_0x215ba0]['email']===_0x3db69d[_0x4447('0x11')]){_0x3db69d['adminId']=_0xab3b32[_0x215ba0]['id'];_0x5ea687=!![];}}if(_0x5ea687){logger[_0x4447('0xc')](_0x4447('0x12'),_0x3db69d[_0x4447('0x13')]);_0x246afb(_0x3db69d);}else{_0x2bcb5e({'statusCode':0x194,'message':_0x4447('0x14')});}}else{_0x2bcb5e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x4447('0x15')](function(_0x130561){logger[_0x4447('0x16')]('['+[_0x1ab362['toUpperCase']()]+']',_0x130561[_0x4447('0x17')]);_0x2bcb5e(_0x130561);});});}function getUser(_0x1bf26d,_0x1bc77f,_0x1fd035){return function(_0x45f939){return new Promise(function(_0xcfde49,_0x5f4c60){var _0x3503c9={'method':_0x4447('0xa'),'uri':_0x1fd035+'/api/selector/owners','json':!![]};_0x3503c9[_0x4447('0x18')]=_0x1bc77f;logger[_0x4447('0xc')](_0x4447('0x19'));return rp(_0x3503c9)[_0x4447('0xe')](function(_0x5f3adb){if(_0x5f3adb){var _0x32a212=_0x5f3adb[_0x4447('0xf')];var _0x415f9b=![];var _0x262998=null;if(_0x45f939['agentEmail']!==null){logger[_0x4447('0xc')](_0x4447('0x1a'),_0x45f939[_0x4447('0x1b')]);_0x45f939[_0x4447('0x1c')]=_0x45f939[_0x4447('0x1b')];for(_0x262998=0x0;_0x262998<_0x32a212['length'];_0x262998++){if(_0x32a212[_0x262998][_0x4447('0x1d')]===_0x45f939[_0x4447('0x1b')]){_0x415f9b=!![];_0x45f939[_0x4447('0x1e')]=_0x32a212[_0x262998]['id'];logger['info'](_0x4447('0x1f'),_0x45f939[_0x4447('0x1e')]);}}}if(!_0x415f9b){logger[_0x4447('0xc')]('Admin\x20selected');_0x45f939[_0x4447('0x1c')]=_0x45f939[_0x4447('0x11')];_0x45f939['userId']=_0x45f939[_0x4447('0x13')];_0x415f9b=!![];}if(_0x415f9b){_0xcfde49(_0x45f939);}else{_0x5f4c60({'statusCode':0x194,'message':_0x4447('0x14')});}}else{_0x5f4c60({'statusCode':0x194,'message':_0x4447('0x14')});}})[_0x4447('0x15')](function(_0x198c2d){logger[_0x4447('0x16')]('['+[_0x1bf26d[_0x4447('0x20')]()]+']',_0x198c2d[_0x4447('0x17')]);_0x5f4c60(_0x198c2d);});});};}function searchContact(_0x2e1b89,_0x3c1de3,_0x592381,_0x519f21){return new Promise(function(_0x2c692a,_0x28374e){var _0xca68cd={'method':_0x4447('0xa'),'headers':_0x3c1de3,'uri':_0x2e1b89+_0x4447('0x21')+_0x519f21+'&f='+_0x592381+'&entities=contact','json':!![]};rp(_0xca68cd)[_0x4447('0xe')](function(_0x2355b1){var _0x36257b=_[_0x4447('0x22')](_0x2355b1['contacts']['contacts'],[_0x592381,_0x519f21]);_0x2c692a(_0x36257b);})[_0x4447('0x15')](function(_0x505d34){_0x28374e(_0x505d34);});});}function getEndUser(_0x37943d,_0x274d46,_0x22c0e0){return function(_0x1040b1){return new Promise(function(_0x96f9fd,_0x875bf5){logger[_0x4447('0xc')](util[_0x4447('0x23')](_0x4447('0x24'),_0x1040b1[_0x4447('0x25')]));searchContact(_0x22c0e0,_0x274d46,'mobile_number',_0x1040b1[_0x4447('0x25')])['then'](function(_0x50f992){if(_0x50f992){_0x1040b1[_0x4447('0x26')]=_0x50f992['id'];logger[_0x4447('0xc')]('Contact\x20found\x20mobile_number:',_0x1040b1['endUserId']);return _0x96f9fd(_0x1040b1);}searchContact(_0x22c0e0,_0x274d46,_0x4447('0x27'),_0x1040b1['contactNumber'])[_0x4447('0xe')](function(_0x1c9e2c){if(_0x1c9e2c){_0x1040b1[_0x4447('0x26')]=_0x1c9e2c['id'];logger[_0x4447('0xc')](_0x4447('0x28'),_0x1040b1[_0x4447('0x26')]);return _0x96f9fd(_0x1040b1);}createEndUser(_0x1040b1,_0x37943d,_0x274d46,_0x22c0e0)['then'](function(_0x5b2428){logger['info'](_0x4447('0x29'),_0x5b2428['endUserId']);return _0x96f9fd(_0x5b2428);});});})[_0x4447('0x15')](function(_0x171826){_0x875bf5(_0x171826);});});};}function createEndUser(_0x35ce9e,_0x553635,_0x5ef37d,_0x41bb30){return new Promise(function(_0x53a4cb,_0x2d588f){var _0x4b2d3e=moment();var _0x17bef2={'method':_0x4447('0x2a'),'uri':_0x41bb30+_0x4447('0x2b'),'body':{'contact':{'last_name':_0x35ce9e[_0x4447('0x25')],'work_number':_0x35ce9e[_0x4447('0x25')],'mobile_number':_0x35ce9e[_0x4447('0x25')],'owner_id':_0x35ce9e[_0x4447('0x1e')],'created_at':_0x4b2d3e[_0x4447('0x23')](_0x4447('0x2c'))}},'json':!![]};_0x17bef2[_0x4447('0x18')]=_0x5ef37d;logger[_0x4447('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x17bef2)[_0x4447('0xe')](function(_0x1f86df){_0x35ce9e['endUserId']=_0x1f86df[_0x4447('0x2d')]['id'];_0x53a4cb(_0x35ce9e);})[_0x4447('0x15')](function(_0x41c744){logger[_0x4447('0x16')]('['+[_0x553635[_0x4447('0x20')]()]+']',_0x41c744[_0x4447('0x17')]);_0x2d588f(_0x41c744[_0x4447('0x17')]);});});}function getTicket(_0x458d7b,_0x23cc2e,_0x142317,_0x240344,_0x2884c4){return function(_0x1d401a){logger[_0x4447('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x484ced,_0x26ba9c){var _0x19dd73=moment();var _0x162ffa={'method':_0x4447('0x2a'),'uri':_0x142317+_0x4447('0x2e'),'body':{'title':intUtil[_0x4447('0x2f')](_0x240344[_0x4447('0x30')],_0x2884c4,'\x20'),'description':intUtil[_0x4447('0x2f')](_0x240344['Descriptions'],_0x2884c4,'\x0a'),'owner_id':_0x1d401a[_0x4447('0x1e')],'creater_id':_0x1d401a[_0x4447('0x13')],'targetable_id':_0x1d401a[_0x4447('0x26')],'targetable_type':'Contact','created_at':_0x19dd73['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x19dd73[_0x4447('0x31')](0x1e,'m')[_0x4447('0x23')](_0x4447('0x2c'))},'json':!![]};_0x162ffa[_0x4447('0x18')]=_0x23cc2e;return rp(_0x162ffa)[_0x4447('0xe')](function(_0x49b486){_0x1d401a[_0x4447('0x32')]=_0x49b486[_0x4447('0x33')]['id'];logger[_0x4447('0xc')](_0x4447('0x34'),_0x1d401a[_0x4447('0x32')]);_0x484ced(_0x1d401a);})[_0x4447('0x15')](function(_0x26f634){logger[_0x4447('0x16')]('['+[_0x458d7b['toUpperCase']()]+']',_0x26f634['message']);_0x26ba9c(_0x26f634[_0x4447('0x17')]);});});};}function emit(_0x351703,_0x2a13b5,_0x63d2bb){var _0x2d94ea={'uri':_0x351703+_0x4447('0x35')+_0x63d2bb};io['to'](util[_0x4447('0x23')](_0x4447('0x36'),_0x2a13b5))[_0x4447('0x37')](_0x4447('0x38'),_0x2d94ea);}exports['cs']=function(_0x3c6d61,_0x3818d1,_0x430f9c,_0x51ea94,_0x30b95a,_0x239f35,_0x57c7b7,_0x2efc01){var _0x4515fd={};var _0x1284d8={'Authorization':_0x4447('0x39')+_0x239f35[_0x4447('0x3a')]};_0x239f35['remoteUri']=intUtil[_0x4447('0x3b')](_0x239f35[_0x4447('0x3c')]);_0x239f35[_0x4447('0x3d')]=intUtil[_0x4447('0x3b')](_0x239f35[_0x4447('0x3d')]);var _0x3bd26a=_0x239f35[_0x4447('0x3c')];_0x4515fd[_0x4447('0x11')]=_0x239f35[_0x4447('0x3e')];_0x4515fd[_0x4447('0x25')]=_0x2efc01[_0x4447('0x3f')]()===_0x4447('0x40')?_0x3818d1['destcalleridnum']:_0x3818d1['calleridnum'];_0x4515fd[_0x4447('0x41')]=_0x2efc01===_0x4447('0x42')||_0x2efc01===_0x4447('0x43')?_0x4447('0x42'):_0x4447('0x40');if(_0x51ea94){_0x4515fd[_0x4447('0x1b')]=_0x51ea94['email'];}var _0x23b0c7=util[_0x4447('0x23')](_0x4447('0x44'),_0x239f35[_0x4447('0x3d')],_0x3818d1[_0x4447('0x45')],md5(_0x3818d1[_0x4447('0x45')]));if(_0x30b95a&&_0x30b95a[_0x4447('0x46')]){logger[_0x4447('0xc')](_0x4447('0x47'),_0x4447('0x48'));_0x3818d1[_0x4447('0x49')]=_0x23b0c7;}else if(_0x57c7b7&&_0x57c7b7['recordingFormat']&&_0x57c7b7[_0x4447('0x4a')]!==_0x4447('0x4b')){logger[_0x4447('0xc')](_0x4447('0x4c'),_0x4447('0x48'));_0x3818d1['recordingURL']=_0x23b0c7;}else{_0x3818d1[_0x4447('0x49')]='';}return getAdminId(_0x4515fd,_0x2efc01,_0x1284d8,_0x3bd26a)[_0x4447('0xe')](getUser(_0x2efc01,_0x1284d8,_0x3bd26a))[_0x4447('0xe')](getEndUser(_0x2efc01,_0x1284d8,_0x3bd26a))[_0x4447('0xe')](getTicket(_0x2efc01,_0x1284d8,_0x3bd26a,_0x430f9c,_0x3818d1))[_0x4447('0xe')](function(_0x22be6e){logger[_0x4447('0xc')](util['format'](_0x4447('0x4d'),_0x22be6e[_0x4447('0x32')]));if(_0x2efc01!==_0x4447('0x43')){logger[_0x4447('0xc')]('['+[_0x2efc01[_0x4447('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3bd26a,_0x51ea94[_0x4447('0x4e')],_0x22be6e[_0x4447('0x26')]);}})[_0x4447('0x15')](function(_0x4494ce){logger[_0x4447('0x16')]('['+[_0x2efc01[_0x4447('0x20')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x4494ce,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa607=['contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','Subjects','getString','Descriptions','add','ticketId','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminId','error','/api/lookup?q=','&entities=contact','find','contacts','format'];(function(_0x10c6ad,_0x1dc570){var _0x1e41d6=function(_0x1a1bee){while(--_0x1a1bee){_0x10c6ad['push'](_0x10c6ad['shift']());}};_0x1e41d6(++_0x1dc570);}(_0xa607,0x17f));var _0x7a60=function(_0x1a48a0,_0x3c95f5){_0x1a48a0=_0x1a48a0-0x0;var _0x269714=_0xa607[_0x1a48a0];return _0x269714;};'use strict';var _=require(_0x7a60('0x0'));var rp=require(_0x7a60('0x1'));var md5=require(_0x7a60('0x2'));var util=require('util');var moment=require(_0x7a60('0x3'));var Promise=require(_0x7a60('0x4'));var Redis=require(_0x7a60('0x5'));var intUtil=require(_0x7a60('0x6'));var config=require(_0x7a60('0x7'));var logger=require(_0x7a60('0x8'))(_0x7a60('0x9'));config[_0x7a60('0xa')]=_[_0x7a60('0xb')](config['redis'],{'host':_0x7a60('0xc'),'port':0x18eb});var io=require(_0x7a60('0xd'))(new Redis(config[_0x7a60('0xa')]));function getAdminId(_0x2f348c,_0x15bd0f,_0x2a82f4,_0x2fefea){return new Promise(function(_0x12fed5,_0x337489){var _0x5650e0=![];var _0x3941f1={'method':_0x7a60('0xe'),'uri':_0x2fefea+_0x7a60('0xf'),'json':!![]};_0x3941f1[_0x7a60('0x10')]=_0x2a82f4;logger['info'](_0x7a60('0x11'));return rp(_0x3941f1)[_0x7a60('0x12')](function(_0x111f73){if(_0x111f73){var _0x44f432=_0x111f73[_0x7a60('0x13')];var _0x499940=null;for(_0x499940=0x0;_0x499940<_0x44f432[_0x7a60('0x14')];_0x499940++){if(_0x44f432[_0x499940][_0x7a60('0x15')]===_0x2f348c[_0x7a60('0x16')]){_0x2f348c['adminId']=_0x44f432[_0x499940]['id'];_0x5650e0=!![];}}if(_0x5650e0){logger[_0x7a60('0x17')](_0x7a60('0x18'),_0x2f348c['adminId']);_0x12fed5(_0x2f348c);}else{_0x337489({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x337489({'statusCode':0x194,'message':_0x7a60('0x19')});}})[_0x7a60('0x1a')](function(_0x221931){logger['error']('['+[_0x15bd0f[_0x7a60('0x1b')]()]+']',_0x221931[_0x7a60('0x1c')]);_0x337489(_0x221931);});});}function getUser(_0x252192,_0x9447db,_0xb0990c){return function(_0x4f0e5f){return new Promise(function(_0x230a30,_0x3d92e7){var _0x3b2f51={'method':_0x7a60('0xe'),'uri':_0xb0990c+_0x7a60('0xf'),'json':!![]};_0x3b2f51['headers']=_0x9447db;logger[_0x7a60('0x17')](_0x7a60('0x1d'));return rp(_0x3b2f51)[_0x7a60('0x12')](function(_0xe4c00f){if(_0xe4c00f){var _0x34b277=_0xe4c00f['users'];var _0x3dd5c3=![];var _0x1bf95a=null;if(_0x4f0e5f['agentEmail']!==null){logger['info']('Getting\x20user\x20with\x20email',_0x4f0e5f[_0x7a60('0x1e')]);_0x4f0e5f[_0x7a60('0x1f')]=_0x4f0e5f[_0x7a60('0x1e')];for(_0x1bf95a=0x0;_0x1bf95a<_0x34b277[_0x7a60('0x14')];_0x1bf95a++){if(_0x34b277[_0x1bf95a][_0x7a60('0x15')]===_0x4f0e5f[_0x7a60('0x1e')]){_0x3dd5c3=!![];_0x4f0e5f[_0x7a60('0x20')]=_0x34b277[_0x1bf95a]['id'];logger[_0x7a60('0x17')](_0x7a60('0x21'),_0x4f0e5f[_0x7a60('0x20')]);}}}if(!_0x3dd5c3){logger[_0x7a60('0x17')](_0x7a60('0x22'));_0x4f0e5f[_0x7a60('0x1f')]=_0x4f0e5f['adminEmail'];_0x4f0e5f[_0x7a60('0x20')]=_0x4f0e5f[_0x7a60('0x23')];_0x3dd5c3=!![];}if(_0x3dd5c3){_0x230a30(_0x4f0e5f);}else{_0x3d92e7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3d92e7({'statusCode':0x194,'message':_0x7a60('0x19')});}})['catch'](function(_0x5b9c1f){logger[_0x7a60('0x24')]('['+[_0x252192[_0x7a60('0x1b')]()]+']',_0x5b9c1f[_0x7a60('0x1c')]);_0x3d92e7(_0x5b9c1f);});});};}function searchContact(_0x481e74,_0x59623d,_0x17ca32,_0x2c6a85){return new Promise(function(_0x57dd50,_0x290a93){var _0xdbda06={'method':_0x7a60('0xe'),'headers':_0x59623d,'uri':_0x481e74+_0x7a60('0x25')+_0x2c6a85+'&f='+_0x17ca32+_0x7a60('0x26'),'json':!![]};rp(_0xdbda06)[_0x7a60('0x12')](function(_0x16394f){var _0x163524=_[_0x7a60('0x27')](_0x16394f[_0x7a60('0x28')]['contacts'],[_0x17ca32,_0x2c6a85]);_0x57dd50(_0x163524);})['catch'](function(_0x4ef6ea){_0x290a93(_0x4ef6ea);});});}function getEndUser(_0x4a6fc2,_0x7f10a,_0x1953fe){return function(_0x2cbb62){return new Promise(function(_0x5997a2,_0x443a18){logger['info'](util[_0x7a60('0x29')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2cbb62[_0x7a60('0x2a')]));searchContact(_0x1953fe,_0x7f10a,'mobile_number',_0x2cbb62[_0x7a60('0x2a')])['then'](function(_0x5506ec){if(_0x5506ec){_0x2cbb62[_0x7a60('0x2b')]=_0x5506ec['id'];logger[_0x7a60('0x17')](_0x7a60('0x2c'),_0x2cbb62['endUserId']);return _0x5997a2(_0x2cbb62);}searchContact(_0x1953fe,_0x7f10a,_0x7a60('0x2d'),_0x2cbb62[_0x7a60('0x2a')])['then'](function(_0x230a6c){if(_0x230a6c){_0x2cbb62[_0x7a60('0x2b')]=_0x230a6c['id'];logger[_0x7a60('0x17')](_0x7a60('0x2e'),_0x2cbb62[_0x7a60('0x2b')]);return _0x5997a2(_0x2cbb62);}createEndUser(_0x2cbb62,_0x4a6fc2,_0x7f10a,_0x1953fe)[_0x7a60('0x12')](function(_0x2a295e){logger[_0x7a60('0x17')](_0x7a60('0x2f'),_0x2a295e[_0x7a60('0x2b')]);return _0x5997a2(_0x2a295e);});});})[_0x7a60('0x1a')](function(_0x2cf4b0){_0x443a18(_0x2cf4b0);});});};}function createEndUser(_0x2bfc26,_0x9896dc,_0x5f326a,_0xc482cd){return new Promise(function(_0x4fbe23,_0x3368ea){var _0x4a9549=moment();var _0x210b92={'method':_0x7a60('0x30'),'uri':_0xc482cd+_0x7a60('0x31'),'body':{'contact':{'last_name':_0x2bfc26[_0x7a60('0x2a')],'work_number':_0x2bfc26[_0x7a60('0x2a')],'mobile_number':_0x2bfc26[_0x7a60('0x2a')],'owner_id':_0x2bfc26[_0x7a60('0x20')],'created_at':_0x4a9549['format'](_0x7a60('0x32'))}},'json':!![]};_0x210b92['headers']=_0x5f326a;logger[_0x7a60('0x17')](_0x7a60('0x33'));return rp(_0x210b92)[_0x7a60('0x12')](function(_0x1e68c6){_0x2bfc26[_0x7a60('0x2b')]=_0x1e68c6['contact']['id'];_0x4fbe23(_0x2bfc26);})[_0x7a60('0x1a')](function(_0x2b6db1){logger[_0x7a60('0x24')]('['+[_0x9896dc[_0x7a60('0x1b')]()]+']',_0x2b6db1[_0x7a60('0x1c')]);_0x3368ea(_0x2b6db1[_0x7a60('0x1c')]);});});}function getTicket(_0x64c310,_0x193a0d,_0x1832a3,_0x447669,_0x319712){return function(_0x5d2d80){logger[_0x7a60('0x17')]('Creating\x20new\x20task');return new Promise(function(_0x246bc4,_0x11fd93){var _0x58e342=moment();var _0x224a2f={'method':_0x7a60('0x30'),'uri':_0x1832a3+_0x7a60('0x34'),'body':{'title':intUtil['getString'](_0x447669[_0x7a60('0x35')],_0x319712,'\x20'),'description':intUtil[_0x7a60('0x36')](_0x447669[_0x7a60('0x37')],_0x319712,'\x0a'),'owner_id':_0x5d2d80['userId'],'creater_id':_0x5d2d80[_0x7a60('0x23')],'targetable_id':_0x5d2d80[_0x7a60('0x2b')],'targetable_type':'Contact','created_at':_0x58e342[_0x7a60('0x29')](_0x7a60('0x32')),'due_date':_0x58e342[_0x7a60('0x38')](0x1e,'m')['format'](_0x7a60('0x32'))},'json':!![]};_0x224a2f[_0x7a60('0x10')]=_0x193a0d;return rp(_0x224a2f)[_0x7a60('0x12')](function(_0x4f7c6d){_0x5d2d80[_0x7a60('0x39')]=_0x4f7c6d['task']['id'];logger['info'](_0x7a60('0x3a'),_0x5d2d80['ticketId']);_0x246bc4(_0x5d2d80);})[_0x7a60('0x1a')](function(_0x24a015){logger[_0x7a60('0x24')]('['+[_0x64c310[_0x7a60('0x1b')]()]+']',_0x24a015[_0x7a60('0x1c')]);_0x11fd93(_0x24a015[_0x7a60('0x1c')]);});});};}function emit(_0x2cdb51,_0x5b4e43,_0x3be719){var _0x10b4f8={'uri':_0x2cdb51+'/contacts/'+_0x3be719};io['to'](util[_0x7a60('0x29')](_0x7a60('0x3b'),_0x5b4e43))['emit'](_0x7a60('0x3c'),_0x10b4f8);}exports['cs']=function(_0x5adb49,_0x58fa9d,_0x32f3fd,_0x15c93f,_0x525b0f,_0x1aa7ca,_0x65c697,_0xfefc8c){var _0x209ab9={};var _0x280dbd={'Authorization':_0x7a60('0x3d')+_0x1aa7ca[_0x7a60('0x3e')]};_0x1aa7ca['remoteUri']=intUtil[_0x7a60('0x3f')](_0x1aa7ca[_0x7a60('0x40')]);_0x1aa7ca[_0x7a60('0x41')]=intUtil['stripTrailingSlash'](_0x1aa7ca['serverUrl']);var _0x14afd2=_0x1aa7ca[_0x7a60('0x40')];_0x209ab9['adminEmail']=_0x1aa7ca[_0x7a60('0x42')];_0x209ab9[_0x7a60('0x2a')]=_0xfefc8c[_0x7a60('0x43')]()===_0x7a60('0x44')?_0x58fa9d['destcalleridnum']:_0x58fa9d[_0x7a60('0x45')];_0x209ab9[_0x7a60('0x46')]=_0xfefc8c==='queue'||_0xfefc8c===_0x7a60('0x47')?_0x7a60('0x48'):_0x7a60('0x44');if(_0x15c93f){_0x209ab9[_0x7a60('0x1e')]=_0x15c93f[_0x7a60('0x15')];}var _0x1788b6=util[_0x7a60('0x29')](_0x7a60('0x49'),_0x1aa7ca[_0x7a60('0x41')],_0x58fa9d[_0x7a60('0x4a')],md5(_0x58fa9d['uniqueid']));if(_0x525b0f&&_0x525b0f[_0x7a60('0x4b')]){logger[_0x7a60('0x17')]('[QUEUE]',_0x7a60('0x4c'));_0x58fa9d[_0x7a60('0x4d')]=_0x1788b6;}else if(_0x65c697&&_0x65c697[_0x7a60('0x4e')]&&_0x65c697[_0x7a60('0x4e')]!==_0x7a60('0x4f')){logger[_0x7a60('0x17')](_0x7a60('0x50'),_0x7a60('0x4c'));_0x58fa9d[_0x7a60('0x4d')]=_0x1788b6;}else{_0x58fa9d[_0x7a60('0x4d')]='';}return getAdminId(_0x209ab9,_0xfefc8c,_0x280dbd,_0x14afd2)[_0x7a60('0x12')](getUser(_0xfefc8c,_0x280dbd,_0x14afd2))['then'](getEndUser(_0xfefc8c,_0x280dbd,_0x14afd2))[_0x7a60('0x12')](getTicket(_0xfefc8c,_0x280dbd,_0x14afd2,_0x32f3fd,_0x58fa9d))[_0x7a60('0x12')](function(_0x5b2d69){logger[_0x7a60('0x17')](util[_0x7a60('0x29')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5b2d69[_0x7a60('0x39')]));if(_0xfefc8c!==_0x7a60('0x47')){logger[_0x7a60('0x17')]('['+[_0xfefc8c['toUpperCase']()]+']',_0x7a60('0x51'));emit(_0x14afd2,_0x15c93f[_0x7a60('0x52')],_0x5b2d69[_0x7a60('0x2b')]);}})['catch'](function(_0x427486){logger[_0x7a60('0x24')]('['+[_0xfefc8c[_0x7a60('0x1b')]()]+_0x7a60('0x53'),util[_0x7a60('0x54')](_0x427486,{'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 72ee8d2..574c69e 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 _0x35bc=['unmanaged','zendesk','zoho','desk','unknown\x20integration','error','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','log'];(function(_0x112929,_0x7da466){var _0x333c16=function(_0x762dc0){while(--_0x762dc0){_0x112929['push'](_0x112929['shift']());}};_0x333c16(++_0x7da466);}(_0x35bc,0x10e));var _0xc35b=function(_0x2b70df,_0x224881){_0x2b70df=_0x2b70df-0x0;var _0x44b705=_0x35bc[_0x2b70df];return _0x44b705;};'use strict';var _=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var zendesk=require(_0xc35b('0x2'));var salesforce=require(_0xc35b('0x3'));var sugarcrm=require(_0xc35b('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xc35b('0x5'));var desk=require('./desk');var vtiger=require(_0xc35b('0x6'));var servicenow=require(_0xc35b('0x7'));var dynamics365=require(_0xc35b('0x8'));var freshsales=require(_0xc35b('0x9'));var integrations=['zendesk',_0xc35b('0xa'),_0xc35b('0xb'),_0xc35b('0xc'),'zoho','desk',_0xc35b('0xd'),_0xc35b('0xe'),_0xc35b('0xf'),_0xc35b('0x10')];exports['exec']=function(_0x158e23,_0x1bbf93,_0x2e25e3,_0xc068c6,_0x1cf935,_0x1d6153){if(_0x2e25e3){if(_[_0xc35b('0x11')](integrations,_0x158e23[_0xc35b('0x12')][_0xc35b('0x13')]())){try{var _0x50df62=null;var _0x394c42='';var _0x292d83=_0x2e25e3[_0x158e23[_0xc35b('0x12')]['toLowerCase']()];if(_0x292d83){var _0x9f74ae=_0x292d83[_0x158e23['data2']];if(_0x9f74ae){var _0x41e1c5=_[_0xc35b('0x14')](_0x9f74ae[_0xc35b('0x15')],{'id':parseInt(_0x158e23[_0xc35b('0x16')],0xa)});if(_0x41e1c5){if(_0xc068c6){if(_0x1cf935&&_0x1bbf93[_0xc35b('0x17')]){_0x394c42=_0xc35b('0x17');}else if(_0x1bbf93['routeId']){_0x394c42=_0xc35b('0x18');}else{console[_0xc35b('0x19')]('EVENT\x20UNKNOWN',_0x1bbf93);}}else{_0x394c42=_0xc35b('0x1a');}switch(_0x158e23[_0xc35b('0x12')][_0xc35b('0x13')]()){case _0xc35b('0x1b'):zendesk[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0xa'):salesforce[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0xb'):sugarcrm[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case'freshdesk':freshdesk[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0x1c'):zoho[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0x1d'):desk[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0xd'):vtiger[_0x394c42](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153);break;case _0xc35b('0xf'):freshsales['cs'](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153,_0x394c42);break;case _0xc35b('0x10'):servicenow['cs'](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153,_0x394c42);break;case _0xc35b('0xe'):dynamics365['cs'](_0x158e23,_0x1bbf93,_0x41e1c5,_0xc068c6,_0x1cf935,_0x9f74ae,_0x1d6153,_0x394c42);break;default:console[_0xc35b('0x19')](_0xc35b('0x1e'));}}else{_0x50df62=require('../../../../config/logger')(_0x158e23[_0xc35b('0x12')]['toLowerCase']());_0x50df62[_0xc35b('0x1f')]('[EXEC]',util['format'](_0xc35b('0x20'),_0x158e23[_0xc35b('0x12')][_0xc35b('0x13')](),_0x158e23[_0xc35b('0x16')]));}}else{_0x50df62=require(_0xc35b('0x21'))(_0x158e23['data1'][_0xc35b('0x13')]());_0x50df62[_0xc35b('0x1f')](_0xc35b('0x22'),util[_0xc35b('0x23')](_0xc35b('0x24'),_0x158e23['data1'][_0xc35b('0x13')](),_0x158e23['data2']));}}else{}}catch(_0x5bb977){console['error'](_0x5bb977);}}}}; \ No newline at end of file +var _0xc4bd=['lodash','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','data2','find','Configurations','queue','routeId','outbound','log','unmanaged','toLowerCase','zendesk','salesforce','desk','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','%s\x20account\x20#%s\x20not\x20found'];(function(_0x437cc1,_0x194bc7){var _0x270685=function(_0x12796d){while(--_0x12796d){_0x437cc1['push'](_0x437cc1['shift']());}};_0x270685(++_0x194bc7);}(_0xc4bd,0x75));var _0xdc4b=function(_0x420023,_0x24bdc0){_0x420023=_0x420023-0x0;var _0x1f7de8=_0xc4bd[_0x420023];return _0x1f7de8;};'use strict';var _=require(_0xdc4b('0x0'));var util=require(_0xdc4b('0x1'));var zendesk=require(_0xdc4b('0x2'));var salesforce=require(_0xdc4b('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xdc4b('0x4'));var desk=require(_0xdc4b('0x5'));var vtiger=require(_0xdc4b('0x6'));var servicenow=require(_0xdc4b('0x7'));var dynamics365=require(_0xdc4b('0x8'));var freshsales=require(_0xdc4b('0x9'));var integrations=['zendesk','salesforce',_0xdc4b('0xa'),_0xdc4b('0xb'),_0xdc4b('0xc'),'desk',_0xdc4b('0xd'),_0xdc4b('0xe'),_0xdc4b('0xf'),_0xdc4b('0x10')];exports[_0xdc4b('0x11')]=function(_0xbbced6,_0x58f89d,_0xd940a,_0x49e7ce,_0x48abc9,_0x50ad80){if(_0xd940a){if(_[_0xdc4b('0x12')](integrations,_0xbbced6[_0xdc4b('0x13')]['toLowerCase']())){try{var _0x20a9ab=null;var _0x9a6c80='';var _0x334eac=_0xd940a[_0xbbced6[_0xdc4b('0x13')]['toLowerCase']()];if(_0x334eac){var _0x2379c9=_0x334eac[_0xbbced6[_0xdc4b('0x14')]];if(_0x2379c9){var _0x17734f=_[_0xdc4b('0x15')](_0x2379c9[_0xdc4b('0x16')],{'id':parseInt(_0xbbced6['data3'],0xa)});if(_0x17734f){if(_0x49e7ce){if(_0x48abc9&&_0x58f89d[_0xdc4b('0x17')]){_0x9a6c80=_0xdc4b('0x17');}else if(_0x58f89d[_0xdc4b('0x18')]){_0x9a6c80=_0xdc4b('0x19');}else{console[_0xdc4b('0x1a')]('EVENT\x20UNKNOWN',_0x58f89d);}}else{_0x9a6c80=_0xdc4b('0x1b');}switch(_0xbbced6[_0xdc4b('0x13')][_0xdc4b('0x1c')]()){case _0xdc4b('0x1d'):zendesk[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0x1e'):salesforce[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0xa'):sugarcrm[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0xb'):freshdesk[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0xc'):zoho[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0x1f'):desk[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0xd'):vtiger[_0x9a6c80](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80);break;case _0xdc4b('0xf'):freshsales['cs'](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80,_0x9a6c80);break;case'servicenow':servicenow['cs'](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80,_0x9a6c80);break;case _0xdc4b('0xe'):dynamics365['cs'](_0xbbced6,_0x58f89d,_0x17734f,_0x49e7ce,_0x48abc9,_0x2379c9,_0x50ad80,_0x9a6c80);break;default:console[_0xdc4b('0x1a')]('unknown\x20integration');}}else{_0x20a9ab=require(_0xdc4b('0x20'))(_0xbbced6[_0xdc4b('0x13')][_0xdc4b('0x1c')]());_0x20a9ab['error'](_0xdc4b('0x21'),util[_0xdc4b('0x22')](_0xdc4b('0x23'),_0xbbced6[_0xdc4b('0x13')][_0xdc4b('0x1c')](),_0xbbced6[_0xdc4b('0x24')]));}}else{_0x20a9ab=require(_0xdc4b('0x20'))(_0xbbced6[_0xdc4b('0x13')]['toLowerCase']());_0x20a9ab[_0xdc4b('0x25')](_0xdc4b('0x21'),util['format'](_0xdc4b('0x26'),_0xbbced6[_0xdc4b('0x13')][_0xdc4b('0x1c')](),_0xbbced6['data2']));}}else{}}catch(_0x26c492){console[_0xdc4b('0x25')](_0x26c492);}}}}; \ 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 69af949..a3818df 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 _0x5dac=['Variable','password','concat','securityToken','Connection','https://login.salesforce.com','login','username','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','lodash','request-promise','moment','bluebird','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ActivityDate','utc','contact','endUserType','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','isNil','sobject','User','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','find','additionalSearchLead','$or','Lead','additionalSearchAccount','merge','Contact','Account','first','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','LastName','Company','create','forEach','includes','picklist','content','toString','variable','variableName','idField','customVariable','name'];(function(_0x142bc7,_0x2284eb){var _0x57f5a7=function(_0x25074c){while(--_0x25074c){_0x142bc7['push'](_0x142bc7['shift']());}};_0x57f5a7(++_0x2284eb);}(_0x5dac,0xa8));var _0xc5da=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5dac[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc5da('0x0'));var rp=require(_0xc5da('0x1'));var moment=require(_0xc5da('0x2'));var BPromise=require(_0xc5da('0x3'));var md5=require('md5');var jsforce=require(_0xc5da('0x4'));var util=require('util');var Redis=require(_0xc5da('0x5'));var intUtil=require(_0xc5da('0x6'));var config=require(_0xc5da('0x7'));var logger=require('../../../../config/logger')(_0xc5da('0x8'));config[_0xc5da('0x9')]=_['defaults'](config[_0xc5da('0x9')],{'host':_0xc5da('0xa'),'port':0x18eb});var io=require(_0xc5da('0xb'))(new Redis(config['redis']));function emit(_0x1d194e,_0x14bb91,_0x467b78){io['to'](_0x1d194e)[_0xc5da('0xc')](_0x14bb91,_0x467b78);}function getTicket(_0x443097,_0x11d5a4,_0x402725,_0x364378,_0x36bd9f,_0x1c5b79,_0x8ea39c,_0x2b5336){var _0xe4f181=Object[_0xc5da('0xd')]({},{'OwnerId':_0x11d5a4['id'],'Subject':intUtil[_0xc5da('0xe')](_0x364378['Subjects'],_0x36bd9f,'\x20'),'Description':intUtil[_0xc5da('0xe')](_0x364378[_0xc5da('0xf')],_0x36bd9f,'\x0a')},getCustomFields(_0x1c5b79,_0x36bd9f));if(_0x402725){if(_0x364378['ticketType']==='Task'){_0xe4f181[_0xc5da('0x10')]=moment[_0xc5da('0x11')]();_0xe4f181['IsReminderSet']=![];_0xe4f181['IsRecurrence']=![];if(_0x402725['endUserType']===_0xc5da('0x12')||_0x402725[_0xc5da('0x13')]===_0xc5da('0x14')){_0xe4f181[_0xc5da('0x15')]=_0x402725['id'];}else if(_0x402725[_0xc5da('0x13')]===_0xc5da('0x16')){_0xe4f181[_0xc5da('0x17')]=_0x402725['id'];}}else if(_0x364378[_0xc5da('0x18')]===_0xc5da('0x19')){if(_0x402725['endUserType']===_0xc5da('0x12')){_0xe4f181[_0xc5da('0x1a')]=_0x402725['id'];}else if(_0x402725[_0xc5da('0x13')]==='account'){_0xe4f181[_0xc5da('0x1b')]=_0x402725['id'];}else if(_0x402725[_0xc5da('0x13')]===_0xc5da('0x14')&&_0x364378['leadId']){_0xe4f181[_0x364378[_0xc5da('0x1c')]]=_0x402725['id'];}else{logger[_0xc5da('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x8ea39c['sobject'](_0x364378[_0xc5da('0x18')])['create'](_0xe4f181);}function getUser(_0x867672,_0x212fba,_0x32ea80){if(!_[_0xc5da('0x1e')](_0x212fba)&&intUtil['validateEmail'](_0x212fba)){var _0x326b8c={'Email':_0x212fba};var _0x1455c2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x32ea80[_0xc5da('0x1f')](_0xc5da('0x20'))['find'](_0x326b8c,_0x1455c2)[_0xc5da('0x21')]()[_0xc5da('0x22')](function(_0x163acb){if(_0x163acb[_0xc5da('0x23')]){var _0x2f506f=_['find'](_0x163acb,function(_0x38a632){return _0x38a632[_0xc5da('0x24')]===_0x212fba;});if(_0x2f506f){logger['info'](_0xc5da('0x25'),_0x212fba);return BPromise[_0xc5da('0x26')]({'id':_0x2f506f['Id'],'name':_0x2f506f[_0xc5da('0x27')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x212fba);return _0x32ea80[_0xc5da('0x28')]()[_0xc5da('0x22')](function(_0x3c172d){return BPromise[_0xc5da('0x26')]({'id':_0x3c172d[_0xc5da('0x29')],'name':_0x3c172d[_0xc5da('0x2a')]});});}});}else{logger[_0xc5da('0x1d')](_0xc5da('0x2b'),_0x212fba);return _0x32ea80[_0xc5da('0x28')]()[_0xc5da('0x22')](function(_0x1d6d5c){return BPromise[_0xc5da('0x26')]({'id':_0x1d6d5c[_0xc5da('0x29')],'name':_0x1d6d5c[_0xc5da('0x2a')]});});}}function getEndUser(_0x43b0fc,_0x5b41c3,_0x12db86,_0x5b0121,_0x11acd9){var _0x368c02={'$or':{'Phone':_0x5b0121}};var _0x15f526={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc5da('0x26')]()[_0xc5da('0x22')](function(){logger[_0xc5da('0x1d')](_0xc5da('0x2c'),_0x5b0121,_0x5b41c3[_0xc5da('0x2d')]);switch(_0x5b41c3[_0xc5da('0x2d')]){case'contact_lead':var _0x2711a7=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x2f')]){var _0x277022={};_0x277022[_0x5b41c3[_0xc5da('0x2f')]]=_0x5b0121;_['merge'](_0x2711a7['$or'],_0x277022);}return _0x11acd9[_0xc5da('0x1f')]('Contact')[_0xc5da('0x30')](_0x2711a7,_0x15f526)[_0xc5da('0x21')]()[_0xc5da('0x22')](function(_0x266880){if(_0x266880&&_0x266880['length']){return _0x266880;}else{var _0x2091a0=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x31')]){var _0xbc811e={};_0xbc811e[_0x5b41c3['additionalSearchLead']]=_0x5b0121;_['merge'](_0x2091a0[_0xc5da('0x32')],_0xbc811e);}return _0x11acd9[_0xc5da('0x1f')](_0xc5da('0x33'))['find'](_0x2091a0,_0x15f526);}});case'account_contact_lead':var _0x3f57dd=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x34')]){var _0x277022={};_0x277022[_0x5b41c3[_0xc5da('0x34')]]=_0x5b0121;_[_0xc5da('0x35')](_0x3f57dd[_0xc5da('0x32')],_0x277022);}return _0x11acd9[_0xc5da('0x1f')]('Account')[_0xc5da('0x30')](_0x3f57dd,_0x15f526)['execute']()[_0xc5da('0x22')](function(_0x52bc9f){if(_0x52bc9f&&_0x52bc9f[_0xc5da('0x23')]){return _0x52bc9f;}else{var _0x294aa2=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x2f')]){var _0x292446={};_0x292446[_0x5b41c3[_0xc5da('0x2f')]]=_0x5b0121;_[_0xc5da('0x35')](_0x294aa2[_0xc5da('0x32')],_0x292446);}return _0x11acd9['sobject'](_0xc5da('0x36'))[_0xc5da('0x30')](_0x294aa2,_0x15f526)[_0xc5da('0x22')](function(_0x223b86){if(_0x223b86&&_0x223b86[_0xc5da('0x23')]){return _0x223b86;}else{var _0x4047dd=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x31')]){var _0x78ded6={};_0x78ded6[_0x5b41c3[_0xc5da('0x31')]]=_0x5b0121;_[_0xc5da('0x35')](_0x4047dd['$or'],_0x78ded6);}return _0x11acd9[_0xc5da('0x1f')](_0xc5da('0x33'))[_0xc5da('0x30')](_0x4047dd,_0x15f526);}});}});case'contact':var _0x2711a7=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3['additionalSearchContact']){var _0x277022={};_0x277022[_0x5b41c3[_0xc5da('0x2f')]]=_0x5b0121;_[_0xc5da('0x35')](_0x2711a7['$or'],_0x277022);}return _0x11acd9[_0xc5da('0x1f')]('Contact')[_0xc5da('0x30')](_0x2711a7,_0x15f526)['execute']();case'lead':var _0x44a7c2=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x31')]){var _0x277022={};_0x277022[_0x5b41c3[_0xc5da('0x31')]]=_0x5b0121;_['merge'](_0x44a7c2['$or'],_0x277022);}return _0x11acd9['sobject'](_0xc5da('0x33'))[_0xc5da('0x30')](_0x44a7c2,_0x15f526);case'account':var _0x3f57dd=_[_0xc5da('0x2e')](_0x368c02);if(_0x5b41c3[_0xc5da('0x34')]){var _0x277022={};_0x277022[_0x5b41c3['additionalSearchAccount']]=_0x5b0121;_['merge'](_0x3f57dd[_0xc5da('0x32')],_0x277022);}return _0x11acd9[_0xc5da('0x1f')](_0xc5da('0x37'))['find'](_0x3f57dd,_0x15f526);default:return null;}})[_0xc5da('0x22')](function(_0x2731b0){if(_0x2731b0&&_0x2731b0['length']){var _0x25e64c=_[_0xc5da('0x38')](_0x2731b0);if(_0x25e64c){return BPromise[_0xc5da('0x26')]({'id':_0x25e64c['Id'],'name':_0x25e64c[_0xc5da('0x27')],'phone':_0x25e64c[_0xc5da('0x39')],'endUserType':_0x25e64c[_0xc5da('0x3a')][_0xc5da('0x3b')][_0xc5da('0x3c')]()});}}})[_0xc5da('0x22')](function(_0x5e3cd2){if(_0x5e3cd2){logger[_0xc5da('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5e3cd2[_0xc5da('0x13')],_0x5b0121);return BPromise[_0xc5da('0x26')](_0x5e3cd2);}else{logger[_0xc5da('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5b0121);var _0x16b2e4={'Phone':_0x5b0121};if(_0x5b41c3[_0xc5da('0x3d')]){if(_0x5b41c3[_0xc5da('0x3d')]==='contact'){logger[_0xc5da('0x1d')](_0xc5da('0x3e'),_0x5b0121,_0x5b41c3[_0xc5da('0x3d')]);_0x16b2e4['LastName']=_0x12db86!==_0xc5da('0x3f')?_0x12db86:util[_0xc5da('0x40')]('Caller\x20-\x20%s',_0x5b0121);}else if(_0x5b41c3['moduleCreate']==='lead'){logger[_0xc5da('0x1d')](_0xc5da('0x3e'),_0x5b0121,_0x5b41c3[_0xc5da('0x3d')]);_0x16b2e4[_0xc5da('0x41')]=_0x12db86!==_0xc5da('0x3f')?_0x12db86:util[_0xc5da('0x40')]('Caller\x20-\x20%s',_0x5b0121);_0x16b2e4[_0xc5da('0x42')]='No\x20Company';}else if(_0x5b41c3[_0xc5da('0x3d')]===_0xc5da('0x16')){logger[_0xc5da('0x1d')](_0xc5da('0x3e'),_0x5b0121,_0x5b41c3[_0xc5da('0x3d')]);_0x16b2e4[_0xc5da('0x27')]=_0x12db86!==_0xc5da('0x3f')?_0x12db86:util['format']('Caller\x20-\x20%s',_0x5b0121);}else{return null;}}return _0x11acd9['sobject'](_['upperFirst'](_0x5b41c3[_0xc5da('0x3d')]))[_0xc5da('0x43')](_0x16b2e4)[_0xc5da('0x22')](function(_0x10364b){return BPromise[_0xc5da('0x26')]({'id':_0x10364b['id'],'endUserType':_0x5b41c3[_0xc5da('0x3d')]});});}});}function getCustomFields(_0x53ba18,_0x295862){var _0x9dda18={};if(_0x53ba18[_0xc5da('0x23')]>0x0){_[_0xc5da('0x44')](_0x53ba18,function(_0x1b2a0a){if(_[_0xc5da('0x45')](['string',_0xc5da('0x46')],_0x1b2a0a[_0xc5da('0x3b')])&&_0x1b2a0a['idField']){_0x9dda18[_0x1b2a0a['idField']]=_0x1b2a0a[_0xc5da('0x47')][_0xc5da('0x48')]();}else if(_0x1b2a0a[_0xc5da('0x3b')]===_0xc5da('0x49')&&_0x1b2a0a[_0xc5da('0x4a')]&&_0x1b2a0a[_0xc5da('0x4b')]){_0x295862[_0x1b2a0a[_0xc5da('0x4a')]]&&(_0x9dda18[_0x1b2a0a[_0xc5da('0x4b')]]=_0x295862[_0x1b2a0a[_0xc5da('0x4a')]]['toString']());}else if(_0x1b2a0a[_0xc5da('0x3b')]===_0xc5da('0x4c')&&_0x1b2a0a['Variable']&&_0x1b2a0a['Variable'][_0xc5da('0x4d')]&&_0x1b2a0a[_0xc5da('0x4b')]){_0x295862[_0x1b2a0a[_0xc5da('0x4e')][_0xc5da('0x4d')][_0xc5da('0x3c')]()]&&(_0x9dda18[_0x1b2a0a[_0xc5da('0x4b')]]=_0x295862[_0x1b2a0a['Variable'][_0xc5da('0x4d')]['toLowerCase']()][_0xc5da('0x48')]());}});}return _0x9dda18;}function getConnection(_0x32e6d1){var _0x24fc85=_0x32e6d1[_0xc5da('0x4f')][_0xc5da('0x50')](_0x32e6d1[_0xc5da('0x51')]);var _0x1fa5d6=new jsforce[(_0xc5da('0x52'))]({'oauth2':{'loginUrl':_0x32e6d1['remoteUri']||_0xc5da('0x53'),'clientId':_0x32e6d1['clientId'],'clientSecret':_0x32e6d1['clientSecret']}});return _0x1fa5d6[_0xc5da('0x54')](_0x32e6d1[_0xc5da('0x55')],_0x24fc85)[_0xc5da('0x22')](function(){logger['info'](_0xc5da('0x56'));return _0x1fa5d6;});}exports[_0xc5da('0x57')]=function(_0x28d0a9,_0x15a458,_0x482932,_0x3e87d5,_0x58ab05,_0x1c3306){var _0x4b4a60,_0x46021a,_0x3e1f77,_0x29ac0b;_0x1c3306[_0xc5da('0x58')]=intUtil['stripTrailingSlash'](_0x1c3306[_0xc5da('0x58')]);_0x1c3306[_0xc5da('0x59')]=intUtil[_0xc5da('0x5a')](_0x1c3306[_0xc5da('0x59')]);if(_0x58ab05&&_0x58ab05[_0xc5da('0x5b')]){logger[_0xc5da('0x1d')](_0xc5da('0x5c'),_0xc5da('0x5d'));_0x15a458[_0xc5da('0x5e')]=util[_0xc5da('0x40')](_0xc5da('0x5f'),_0x1c3306['serverUrl'],_0x15a458[_0xc5da('0x60')],md5(_0x15a458[_0xc5da('0x60')]));}else{_0x15a458[_0xc5da('0x5e')]='';}return getConnection(_0x1c3306)['then'](function(_0x52a59c){_0x29ac0b=_0x52a59c;return getUser(_0x1c3306,_0x3e87d5[_0xc5da('0x61')],_0x29ac0b);})[_0xc5da('0x22')](function(_0x4fd095){_0x4b4a60=_0x4fd095;return getEndUser(_0x1c3306,_0x482932,_0x15a458[_0xc5da('0x62')],_0x15a458[_0xc5da('0x63')],_0x29ac0b);})[_0xc5da('0x22')](function(_0x36c184){_0x46021a=_0x36c184;return getTicket(_0x1c3306,_0x4b4a60,_0x46021a,_0x482932,_0x15a458,_0x482932['Fields'],_0x29ac0b,_0xc5da('0x57'));})[_0xc5da('0x22')](function(_0x320d75){_0x3e1f77=_0x320d75;logger[_0xc5da('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3e1f77['id']);logger[_0xc5da('0x1d')](_0xc5da('0x64'),_0x3e1f77['id'],_0x3e87d5[_0xc5da('0x4d')],_0x1c3306['type']);switch(_0x1c3306[_0xc5da('0x3b')]){case _0xc5da('0x65'):emit(util[_0xc5da('0x40')]('user:%s',_0x3e87d5['name']),_0xc5da('0x66'),{'recordId':_0x3e1f77['id']});break;case _0xc5da('0x67'):emit(util[_0xc5da('0x40')](_0xc5da('0x68'),_0x3e87d5[_0xc5da('0x4d')]),_0xc5da('0x69'),{'uri':util[_0xc5da('0x40')](_0xc5da('0x6a'),_0x29ac0b[_0xc5da('0x6b')],_0x3e1f77['id'])});break;default:logger[_0xc5da('0x6c')](_0xc5da('0x6d'));}})[_0xc5da('0x6e')](function(_0x5ed760){logger[_0xc5da('0x6c')](_0xc5da('0x5c'),_0x5ed760);});};exports['outbound']=function(_0x35630f,_0x57e6b9,_0x594641,_0x3d2a7e,_0x5c4781,_0x48aa23,_0x190e70){var _0x2d2ed8,_0x1785d2,_0x93caae,_0x537c9c;_0x48aa23[_0xc5da('0x58')]=intUtil[_0xc5da('0x5a')](_0x48aa23['serverUrl']);_0x48aa23[_0xc5da('0x59')]=intUtil[_0xc5da('0x5a')](_0x48aa23['remoteUri']);if(_0x190e70&&_0x190e70[_0xc5da('0x6f')]&&_0x190e70[_0xc5da('0x6f')]!==_0xc5da('0x70')){logger[_0xc5da('0x1d')](_0xc5da('0x71'),'Recording\x20is\x20enabled!');_0x57e6b9[_0xc5da('0x5e')]=util[_0xc5da('0x40')](_0xc5da('0x5f'),_0x48aa23[_0xc5da('0x58')],_0x57e6b9[_0xc5da('0x60')],md5(_0x57e6b9[_0xc5da('0x60')]));}return getConnection(_0x48aa23)[_0xc5da('0x22')](function(_0x56eb49){_0x537c9c=_0x56eb49;return getUser(_0x48aa23,_0x3d2a7e[_0xc5da('0x61')],_0x537c9c);})[_0xc5da('0x22')](function(_0x433d26){_0x2d2ed8=_0x433d26;return getEndUser(_0x48aa23,_0x594641,_0x57e6b9[_0xc5da('0x72')],_0x57e6b9[_0xc5da('0x73')],_0x537c9c);})[_0xc5da('0x22')](function(_0x1504ec){_0x1785d2=_0x1504ec;return getTicket(_0x48aa23,_0x2d2ed8,_0x1785d2,_0x594641,_0x57e6b9,_0x594641[_0xc5da('0x74')],_0x537c9c,_0xc5da('0x75'));})[_0xc5da('0x22')](function(_0x48bec9){_0x93caae=_0x48bec9;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x93caae['id']);logger[_0xc5da('0x1d')](_0xc5da('0x76'),_0x93caae['id'],_0x3d2a7e[_0xc5da('0x4d')],_0x48aa23[_0xc5da('0x3b')]);switch(_0x48aa23[_0xc5da('0x3b')]){case _0xc5da('0x65'):emit(util['format'](_0xc5da('0x68'),_0x3d2a7e[_0xc5da('0x4d')]),_0xc5da('0x66'),{'recordId':_0x93caae['id']});break;case'newTab':emit(util[_0xc5da('0x40')](_0xc5da('0x68'),_0x3d2a7e[_0xc5da('0x4d')]),'trigger:browser:url',{'uri':util[_0xc5da('0x40')](_0xc5da('0x6a'),_0x537c9c[_0xc5da('0x6b')],_0x93caae['id'])});break;default:logger[_0xc5da('0x6c')](_0xc5da('0x71'),_0xc5da('0x77'));}})[_0xc5da('0x6e')](function(_0x55be1c){logger[_0xc5da('0x6c')](_0xc5da('0x71'),_0x55be1c);});};exports[_0xc5da('0x78')]=function(_0x55bb8a,_0x53d9d4,_0x35d9ef,_0x4a0252,_0x3c132a,_0x2417e7){var _0x5d32a9,_0x39d0f8,_0x219a9f,_0x45bf96;_0x2417e7[_0xc5da('0x58')]=intUtil['stripTrailingSlash'](_0x2417e7['serverUrl']);_0x2417e7[_0xc5da('0x59')]=intUtil['stripTrailingSlash'](_0x2417e7[_0xc5da('0x59')]);if(_0x3c132a&&_0x3c132a[_0xc5da('0x5b')]){logger[_0xc5da('0x1d')]('['+_0x53d9d4[_0xc5da('0x79')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x53d9d4[_0xc5da('0x5e')]=util['format'](_0xc5da('0x5f'),_0x2417e7[_0xc5da('0x58')],_0x53d9d4[_0xc5da('0x60')],md5(_0x53d9d4[_0xc5da('0x60')]));}else{_0x53d9d4[_0xc5da('0x5e')]='';}return getConnection(_0x2417e7)[_0xc5da('0x22')](function(_0x2f40f7){_0x45bf96=_0x2f40f7;if(!_[_0xc5da('0x1e')](_0x4a0252)){return getUser(_0x2417e7,_0x4a0252['name'],_0x45bf96);}else{return getUser(_0x2417e7,null,_0x45bf96);}})[_0xc5da('0x22')](function(_0x2a67e4){_0x5d32a9=_0x2a67e4;return getEndUser(_0x2417e7,_0x35d9ef,_0x53d9d4[_0xc5da('0x62')],_0x53d9d4[_0xc5da('0x63')],_0x45bf96);})[_0xc5da('0x22')](function(_0x526fff){_0x39d0f8=_0x526fff;return getTicket(_0x2417e7,_0x5d32a9,_0x39d0f8,_0x35d9ef,_0x53d9d4,_0x35d9ef[_0xc5da('0x74')],_0x45bf96);})[_0xc5da('0x22')](function(_0x300783){_0x219a9f=_0x300783;logger[_0xc5da('0x1d')]('['+_0x53d9d4[_0xc5da('0x79')][_0xc5da('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x219a9f['id']);logger[_0xc5da('0x1d')]('['+_0x53d9d4[_0xc5da('0x79')][_0xc5da('0x7a')]()+']\x20Integration\x20account\x20type\x20%s.',_0x2417e7[_0xc5da('0x3b')]);})[_0xc5da('0x6e')](function(_0x12677b){logger[_0xc5da('0x6c')]('['+_0x53d9d4['lastevent'][_0xc5da('0x7a')]()+']',_0x12677b);});}; \ No newline at end of file +var _0x236a=['./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','assign','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','find','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','$or','Lead','account_contact_lead','additionalSearchAccount','Account','length','additionalSearchLead','account','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','customVariable','Variable','name','toString','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','calleridname','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','moment','bluebird','md5','jsforce','ioredis'];(function(_0x1dfcb9,_0x3f245e){var _0xc930a7=function(_0x4e8cfe){while(--_0x4e8cfe){_0x1dfcb9['push'](_0x1dfcb9['shift']());}};_0xc930a7(++_0x3f245e);}(_0x236a,0x183));var _0xa236=function(_0x280090,_0x5d0f72){_0x280090=_0x280090-0x0;var _0x5717f1=_0x236a[_0x280090];return _0x5717f1;};'use strict';var _=require(_0xa236('0x0'));var rp=require('request-promise');var moment=require(_0xa236('0x1'));var BPromise=require(_0xa236('0x2'));var md5=require(_0xa236('0x3'));var jsforce=require(_0xa236('0x4'));var util=require('util');var Redis=require(_0xa236('0x5'));var intUtil=require(_0xa236('0x6'));var config=require(_0xa236('0x7'));var logger=require(_0xa236('0x8'))('salesforce');config[_0xa236('0x9')]=_[_0xa236('0xa')](config['redis'],{'host':_0xa236('0xb'),'port':0x18eb});var io=require(_0xa236('0xc'))(new Redis(config[_0xa236('0x9')]));function emit(_0x284bd4,_0x46ddb9,_0x2248a9){io['to'](_0x284bd4)['emit'](_0x46ddb9,_0x2248a9);}function getTicket(_0x3dc1a7,_0x5527c2,_0xefe9d0,_0x41f69b,_0x59d717,_0x1e1284,_0x7e3bf,_0x1ea1a1){var _0x1700b8=Object[_0xa236('0xd')]({},{'OwnerId':_0x5527c2['id'],'Subject':intUtil['getString'](_0x41f69b['Subjects'],_0x59d717,'\x20'),'Description':intUtil['getString'](_0x41f69b[_0xa236('0xe')],_0x59d717,'\x0a')},getCustomFields(_0x1e1284,_0x59d717));if(_0xefe9d0){if(_0x41f69b[_0xa236('0xf')]===_0xa236('0x10')){_0x1700b8[_0xa236('0x11')]=moment[_0xa236('0x12')]();_0x1700b8[_0xa236('0x13')]=![];_0x1700b8[_0xa236('0x14')]=![];if(_0xefe9d0[_0xa236('0x15')]===_0xa236('0x16')||_0xefe9d0[_0xa236('0x15')]===_0xa236('0x17')){_0x1700b8[_0xa236('0x18')]=_0xefe9d0['id'];}else if(_0xefe9d0[_0xa236('0x15')]==='account'){_0x1700b8['WhatId']=_0xefe9d0['id'];}}else if(_0x41f69b[_0xa236('0xf')]==='Case'){if(_0xefe9d0['endUserType']===_0xa236('0x16')){_0x1700b8[_0xa236('0x19')]=_0xefe9d0['id'];}else if(_0xefe9d0[_0xa236('0x15')]==='account'){_0x1700b8[_0xa236('0x1a')]=_0xefe9d0['id'];}else if(_0xefe9d0['endUserType']===_0xa236('0x17')&&_0x41f69b[_0xa236('0x1b')]){_0x1700b8[_0x41f69b[_0xa236('0x1b')]]=_0xefe9d0['id'];}else{logger[_0xa236('0x1c')](_0xa236('0x1d'));}}}return _0x7e3bf['sobject'](_0x41f69b['ticketType'])[_0xa236('0x1e')](_0x1700b8);}function getUser(_0x22bb6c,_0x29326b,_0x478b42){if(!_[_0xa236('0x1f')](_0x29326b)&&intUtil['validateEmail'](_0x29326b)){var _0x26b18b={'Email':_0x29326b};var _0x3f4f2a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x478b42[_0xa236('0x20')]('User')[_0xa236('0x21')](_0x26b18b,_0x3f4f2a)['execute']()[_0xa236('0x22')](function(_0x5394aa){if(_0x5394aa['length']){var _0x462ac4=_['find'](_0x5394aa,function(_0x4dcb4c){return _0x4dcb4c[_0xa236('0x23')]===_0x29326b;});if(_0x462ac4){logger[_0xa236('0x1c')](_0xa236('0x24'),_0x29326b);return BPromise['resolve']({'id':_0x462ac4['Id'],'name':_0x462ac4[_0xa236('0x25')]});}}else{logger[_0xa236('0x1c')](_0xa236('0x26'),_0x29326b);return _0x478b42['identity']()[_0xa236('0x22')](function(_0x1a6767){return BPromise[_0xa236('0x27')]({'id':_0x1a6767[_0xa236('0x28')],'name':_0x1a6767[_0xa236('0x29')]});});}});}else{logger[_0xa236('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x29326b);return _0x478b42[_0xa236('0x2a')]()[_0xa236('0x22')](function(_0x28c5ae){return BPromise[_0xa236('0x27')]({'id':_0x28c5ae[_0xa236('0x28')],'name':_0x28c5ae[_0xa236('0x29')]});});}}function getEndUser(_0x40aedb,_0xb6b4e0,_0x42eb13,_0x2cf16d,_0x387345){var _0x48b06c={'$or':{'Phone':_0x2cf16d}};var _0x1f5587={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa236('0x27')]()['then'](function(){logger['info'](_0xa236('0x2b'),_0x2cf16d,_0xb6b4e0[_0xa236('0x2c')]);switch(_0xb6b4e0[_0xa236('0x2c')]){case _0xa236('0x2d'):var _0x52fca1=_[_0xa236('0x2e')](_0x48b06c);if(_0xb6b4e0[_0xa236('0x2f')]){var _0x5a344c={};_0x5a344c[_0xb6b4e0[_0xa236('0x2f')]]=_0x2cf16d;_[_0xa236('0x30')](_0x52fca1['$or'],_0x5a344c);}return _0x387345['sobject'](_0xa236('0x31'))[_0xa236('0x21')](_0x52fca1,_0x1f5587)[_0xa236('0x32')]()[_0xa236('0x22')](function(_0x1d64ae){if(_0x1d64ae&&_0x1d64ae['length']){return _0x1d64ae;}else{var _0x3bb353=_['cloneDeep'](_0x48b06c);if(_0xb6b4e0['additionalSearchLead']){var _0x3b5d47={};_0x3b5d47[_0xb6b4e0['additionalSearchLead']]=_0x2cf16d;_[_0xa236('0x30')](_0x3bb353[_0xa236('0x33')],_0x3b5d47);}return _0x387345[_0xa236('0x20')](_0xa236('0x34'))['find'](_0x3bb353,_0x1f5587);}});case _0xa236('0x35'):var _0x351b44=_['cloneDeep'](_0x48b06c);if(_0xb6b4e0[_0xa236('0x36')]){var _0x5a344c={};_0x5a344c[_0xb6b4e0[_0xa236('0x36')]]=_0x2cf16d;_[_0xa236('0x30')](_0x351b44[_0xa236('0x33')],_0x5a344c);}return _0x387345[_0xa236('0x20')](_0xa236('0x37'))[_0xa236('0x21')](_0x351b44,_0x1f5587)['execute']()[_0xa236('0x22')](function(_0x5d60e3){if(_0x5d60e3&&_0x5d60e3[_0xa236('0x38')]){return _0x5d60e3;}else{var _0x225c93=_[_0xa236('0x2e')](_0x48b06c);if(_0xb6b4e0[_0xa236('0x2f')]){var _0x25c402={};_0x25c402[_0xb6b4e0['additionalSearchContact']]=_0x2cf16d;_['merge'](_0x225c93[_0xa236('0x33')],_0x25c402);}return _0x387345[_0xa236('0x20')](_0xa236('0x31'))['find'](_0x225c93,_0x1f5587)['then'](function(_0x317e8e){if(_0x317e8e&&_0x317e8e[_0xa236('0x38')]){return _0x317e8e;}else{var _0x579395=_['cloneDeep'](_0x48b06c);if(_0xb6b4e0[_0xa236('0x39')]){var _0x788651={};_0x788651[_0xb6b4e0[_0xa236('0x39')]]=_0x2cf16d;_[_0xa236('0x30')](_0x579395['$or'],_0x788651);}return _0x387345[_0xa236('0x20')]('Lead')[_0xa236('0x21')](_0x579395,_0x1f5587);}});}});case _0xa236('0x16'):var _0x52fca1=_[_0xa236('0x2e')](_0x48b06c);if(_0xb6b4e0['additionalSearchContact']){var _0x5a344c={};_0x5a344c[_0xb6b4e0[_0xa236('0x2f')]]=_0x2cf16d;_[_0xa236('0x30')](_0x52fca1[_0xa236('0x33')],_0x5a344c);}return _0x387345['sobject'](_0xa236('0x31'))['find'](_0x52fca1,_0x1f5587)[_0xa236('0x32')]();case _0xa236('0x17'):var _0x5b9ade=_['cloneDeep'](_0x48b06c);if(_0xb6b4e0[_0xa236('0x39')]){var _0x5a344c={};_0x5a344c[_0xb6b4e0[_0xa236('0x39')]]=_0x2cf16d;_[_0xa236('0x30')](_0x5b9ade['$or'],_0x5a344c);}return _0x387345['sobject'](_0xa236('0x34'))['find'](_0x5b9ade,_0x1f5587);case _0xa236('0x3a'):var _0x351b44=_[_0xa236('0x2e')](_0x48b06c);if(_0xb6b4e0['additionalSearchAccount']){var _0x5a344c={};_0x5a344c[_0xb6b4e0[_0xa236('0x36')]]=_0x2cf16d;_['merge'](_0x351b44[_0xa236('0x33')],_0x5a344c);}return _0x387345[_0xa236('0x20')](_0xa236('0x37'))[_0xa236('0x21')](_0x351b44,_0x1f5587);default:return null;}})['then'](function(_0x22b9a4){if(_0x22b9a4&&_0x22b9a4[_0xa236('0x38')]){var _0x38840b=_['first'](_0x22b9a4);if(_0x38840b){return BPromise[_0xa236('0x27')]({'id':_0x38840b['Id'],'name':_0x38840b['Name'],'phone':_0x38840b['Phone'],'endUserType':_0x38840b[_0xa236('0x3b')][_0xa236('0x3c')][_0xa236('0x3d')]()});}}})[_0xa236('0x22')](function(_0x3aea93){if(_0x3aea93){logger[_0xa236('0x1c')](_0xa236('0x3e'),_0x3aea93[_0xa236('0x15')],_0x2cf16d);return BPromise[_0xa236('0x27')](_0x3aea93);}else{logger[_0xa236('0x1c')](_0xa236('0x3f'),_0x2cf16d);var _0x136ba2={'Phone':_0x2cf16d};if(_0xb6b4e0['moduleCreate']){if(_0xb6b4e0[_0xa236('0x40')]===_0xa236('0x16')){logger[_0xa236('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2cf16d,_0xb6b4e0[_0xa236('0x40')]);_0x136ba2[_0xa236('0x41')]=_0x42eb13!==''?_0x42eb13:util[_0xa236('0x42')](_0xa236('0x43'),_0x2cf16d);}else if(_0xb6b4e0[_0xa236('0x40')]===_0xa236('0x17')){logger[_0xa236('0x1c')](_0xa236('0x44'),_0x2cf16d,_0xb6b4e0[_0xa236('0x40')]);_0x136ba2[_0xa236('0x41')]=_0x42eb13!==''?_0x42eb13:util[_0xa236('0x42')](_0xa236('0x43'),_0x2cf16d);_0x136ba2[_0xa236('0x45')]=_0xa236('0x46');}else if(_0xb6b4e0[_0xa236('0x40')]===_0xa236('0x3a')){logger[_0xa236('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2cf16d,_0xb6b4e0['moduleCreate']);_0x136ba2[_0xa236('0x25')]=_0x42eb13!==_0xa236('0x47')?_0x42eb13:util[_0xa236('0x42')](_0xa236('0x43'),_0x2cf16d);}else{return null;}}return _0x387345['sobject'](_[_0xa236('0x48')](_0xb6b4e0[_0xa236('0x40')]))['create'](_0x136ba2)[_0xa236('0x22')](function(_0x36e549){return BPromise['resolve']({'id':_0x36e549['id'],'endUserType':_0xb6b4e0[_0xa236('0x40')]});});}});}function getCustomFields(_0x3e3a79,_0x2bba90){var _0x45f772={};if(_0x3e3a79[_0xa236('0x38')]>0x0){_[_0xa236('0x49')](_0x3e3a79,function(_0xe62b79){if(_[_0xa236('0x4a')]([_0xa236('0x4b'),_0xa236('0x4c')],_0xe62b79[_0xa236('0x3c')])&&_0xe62b79['idField']){_0x45f772[_0xe62b79[_0xa236('0x4d')]]=_0xe62b79[_0xa236('0x4e')]['toString']();}else if(_0xe62b79[_0xa236('0x3c')]===_0xa236('0x4f')&&_0xe62b79[_0xa236('0x50')]&&_0xe62b79[_0xa236('0x4d')]){_0x2bba90[_0xe62b79['variableName']]&&(_0x45f772[_0xe62b79[_0xa236('0x4d')]]=_0x2bba90[_0xe62b79['variableName']]['toString']());}else if(_0xe62b79['type']===_0xa236('0x51')&&_0xe62b79['Variable']&&_0xe62b79[_0xa236('0x52')]['name']&&_0xe62b79[_0xa236('0x4d')]){_0x2bba90[_0xe62b79[_0xa236('0x52')][_0xa236('0x53')][_0xa236('0x3d')]()]&&(_0x45f772[_0xe62b79[_0xa236('0x4d')]]=_0x2bba90[_0xe62b79[_0xa236('0x52')]['name'][_0xa236('0x3d')]()][_0xa236('0x54')]());}});}return _0x45f772;}function getConnection(_0x3a4c2d){var _0x488544=_0x3a4c2d[_0xa236('0x55')][_0xa236('0x56')](_0x3a4c2d[_0xa236('0x57')]);var _0x2e2a82=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3a4c2d[_0xa236('0x58')]||_0xa236('0x59'),'clientId':_0x3a4c2d[_0xa236('0x5a')],'clientSecret':_0x3a4c2d['clientSecret']}});return _0x2e2a82[_0xa236('0x5b')](_0x3a4c2d[_0xa236('0x5c')],_0x488544)[_0xa236('0x22')](function(){logger[_0xa236('0x1c')](_0xa236('0x5d'));return _0x2e2a82;});}exports[_0xa236('0x5e')]=function(_0xbfc813,_0x555e26,_0x286462,_0x517da7,_0x22de0e,_0xc2896a){var _0x1c644e,_0x36f27b,_0x5e4264,_0x4c67ec;_0xc2896a[_0xa236('0x5f')]=intUtil['stripTrailingSlash'](_0xc2896a[_0xa236('0x5f')]);_0xc2896a[_0xa236('0x58')]=intUtil['stripTrailingSlash'](_0xc2896a['remoteUri']);if(_0x22de0e&&_0x22de0e[_0xa236('0x60')]){logger[_0xa236('0x1c')]('[QUEUE]',_0xa236('0x61'));_0x555e26[_0xa236('0x62')]=util[_0xa236('0x42')](_0xa236('0x63'),_0xc2896a[_0xa236('0x5f')],_0x555e26['uniqueid'],md5(_0x555e26[_0xa236('0x64')]));}else{_0x555e26[_0xa236('0x62')]='';}return getConnection(_0xc2896a)[_0xa236('0x22')](function(_0x43074e){_0x4c67ec=_0x43074e;return getUser(_0xc2896a,_0x517da7[_0xa236('0x65')],_0x4c67ec);})[_0xa236('0x22')](function(_0x2fbb93){_0x1c644e=_0x2fbb93;return getEndUser(_0xc2896a,_0x286462,_0x555e26['calleridname'],_0x555e26[_0xa236('0x66')],_0x4c67ec);})[_0xa236('0x22')](function(_0x18d296){_0x36f27b=_0x18d296;return getTicket(_0xc2896a,_0x1c644e,_0x36f27b,_0x286462,_0x555e26,_0x286462['Fields'],_0x4c67ec,'queue');})[_0xa236('0x22')](function(_0x102fd4){_0x5e4264=_0x102fd4;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x5e4264['id']);logger[_0xa236('0x1c')](_0xa236('0x67'),_0x5e4264['id'],_0x517da7[_0xa236('0x53')],_0xc2896a[_0xa236('0x3c')]);switch(_0xc2896a[_0xa236('0x3c')]){case _0xa236('0x68'):emit(util[_0xa236('0x42')]('user:%s',_0x517da7[_0xa236('0x53')]),_0xa236('0x69'),{'recordId':_0x5e4264['id']});break;case _0xa236('0x6a'):emit(util[_0xa236('0x42')](_0xa236('0x6b'),_0x517da7[_0xa236('0x53')]),_0xa236('0x6c'),{'uri':util['format']('%s/%s/e',_0x4c67ec[_0xa236('0x6d')],_0x5e4264['id'])});break;default:logger[_0xa236('0x6e')](_0xa236('0x6f'));}})['catch'](function(_0x5a5577){logger[_0xa236('0x6e')](_0xa236('0x70'),_0x5a5577);});};exports[_0xa236('0x71')]=function(_0x356cbd,_0x4ce5ba,_0x5ca1b3,_0x2dfbfc,_0x158cbb,_0x1a32e3,_0x43ef6d){var _0x9993e2,_0x3a1553,_0x208262,_0x124f2e;_0x1a32e3['serverUrl']=intUtil[_0xa236('0x72')](_0x1a32e3[_0xa236('0x5f')]);_0x1a32e3[_0xa236('0x58')]=intUtil['stripTrailingSlash'](_0x1a32e3['remoteUri']);if(_0x43ef6d&&_0x43ef6d['recordingFormat']&&_0x43ef6d[_0xa236('0x73')]!==_0xa236('0x74')){logger[_0xa236('0x1c')](_0xa236('0x75'),_0xa236('0x61'));_0x4ce5ba['recordingURL']=util[_0xa236('0x42')](_0xa236('0x63'),_0x1a32e3[_0xa236('0x5f')],_0x4ce5ba[_0xa236('0x64')],md5(_0x4ce5ba[_0xa236('0x64')]));}return getConnection(_0x1a32e3)[_0xa236('0x22')](function(_0x976bf1){_0x124f2e=_0x976bf1;return getUser(_0x1a32e3,_0x2dfbfc[_0xa236('0x65')],_0x124f2e);})['then'](function(_0xde26b5){_0x9993e2=_0xde26b5;return getEndUser(_0x1a32e3,_0x5ca1b3,_0x4ce5ba[_0xa236('0x76')],_0x4ce5ba['destcalleridnum'],_0x124f2e);})[_0xa236('0x22')](function(_0x5ac926){_0x3a1553=_0x5ac926;return getTicket(_0x1a32e3,_0x9993e2,_0x3a1553,_0x5ca1b3,_0x4ce5ba,_0x5ca1b3[_0xa236('0x77')],_0x124f2e,_0xa236('0x71'));})[_0xa236('0x22')](function(_0x177dd7){_0x208262=_0x177dd7;logger['info'](_0xa236('0x78'),_0x208262['id']);logger[_0xa236('0x1c')](_0xa236('0x79'),_0x208262['id'],_0x2dfbfc[_0xa236('0x53')],_0x1a32e3[_0xa236('0x3c')]);switch(_0x1a32e3[_0xa236('0x3c')]){case _0xa236('0x68'):emit(util[_0xa236('0x42')](_0xa236('0x6b'),_0x2dfbfc[_0xa236('0x53')]),_0xa236('0x69'),{'recordId':_0x208262['id']});break;case _0xa236('0x6a'):emit(util['format'](_0xa236('0x6b'),_0x2dfbfc[_0xa236('0x53')]),_0xa236('0x6c'),{'uri':util[_0xa236('0x42')](_0xa236('0x7a'),_0x124f2e['instanceUrl'],_0x208262['id'])});break;default:logger[_0xa236('0x6e')](_0xa236('0x75'),_0xa236('0x7b'));}})['catch'](function(_0x380170){logger['error']('[OUTBOUND]',_0x380170);});};exports[_0xa236('0x7c')]=function(_0x4b6de0,_0x3f4248,_0x53fb08,_0x240a96,_0x2de007,_0x408334){var _0x1e9ad4,_0x588eaf,_0xf5588,_0x347e92;_0x408334[_0xa236('0x5f')]=intUtil[_0xa236('0x72')](_0x408334['serverUrl']);_0x408334[_0xa236('0x58')]=intUtil[_0xa236('0x72')](_0x408334[_0xa236('0x58')]);if(_0x2de007&&_0x2de007[_0xa236('0x60')]){logger[_0xa236('0x1c')]('['+_0x3f4248['lastevent'][_0xa236('0x7d')]()+']','Recording\x20is\x20enabled!');_0x3f4248['recordingURL']=util['format'](_0xa236('0x63'),_0x408334[_0xa236('0x5f')],_0x3f4248['uniqueid'],md5(_0x3f4248['uniqueid']));}else{_0x3f4248['recordingURL']='';}return getConnection(_0x408334)[_0xa236('0x22')](function(_0x2d7a79){_0x347e92=_0x2d7a79;if(!_[_0xa236('0x1f')](_0x240a96)){return getUser(_0x408334,_0x240a96[_0xa236('0x53')],_0x347e92);}else{return getUser(_0x408334,null,_0x347e92);}})[_0xa236('0x22')](function(_0x2a5900){_0x1e9ad4=_0x2a5900;return getEndUser(_0x408334,_0x53fb08,_0x3f4248[_0xa236('0x7e')],_0x3f4248['calleridnum'],_0x347e92);})[_0xa236('0x22')](function(_0x41ab7c){_0x588eaf=_0x41ab7c;return getTicket(_0x408334,_0x1e9ad4,_0x588eaf,_0x53fb08,_0x3f4248,_0x53fb08[_0xa236('0x77')],_0x347e92);})[_0xa236('0x22')](function(_0x557646){_0xf5588=_0x557646;logger[_0xa236('0x1c')]('['+_0x3f4248[_0xa236('0x7f')][_0xa236('0x7d')]()+_0xa236('0x80'),_0xf5588['id']);logger[_0xa236('0x1c')]('['+_0x3f4248['lastevent'][_0xa236('0x7d')]()+_0xa236('0x81'),_0x408334['type']);})[_0xa236('0x82')](function(_0x45a992){logger[_0xa236('0x6e')]('['+_0x3f4248[_0xa236('0x7f')]['toUpperCase']()+']',_0x45a992);});}; \ 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 ac524b5..7b64764 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 _0xc199=['forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name','outbound','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm'];(function(_0x298daa,_0x1be2bb){var _0x43ba8f=function(_0x180ff9){while(--_0x180ff9){_0x298daa['push'](_0x298daa['shift']());}};_0x43ba8f(++_0x1be2bb);}(_0xc199,0x192));var _0x9c19=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xc199[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x9c19('0x0'));var Promise=require(_0x9c19('0x1'));var rp=require('request-promise');var util=require(_0x9c19('0x2'));var md5=require(_0x9c19('0x3'));var Redis=require(_0x9c19('0x4'));var intUtil=require('./util');var config=require(_0x9c19('0x5'));var logger=require(_0x9c19('0x6'))('servicenow');config[_0x9c19('0x7')]=_['defaults'](config[_0x9c19('0x7')],{'host':_0x9c19('0x8'),'port':0x18eb});var io=require(_0x9c19('0x9'))(new Redis(config[_0x9c19('0x7')]));function getAdminUser(_0x5a0a54,_0x2f003f,_0x28fa92,_0x3b1edf,_0x4c59ce,_0x54afa7){return new Promise(function(_0x37a2fa,_0x4512ef){var _0x315ab1={'method':_0x9c19('0xa'),'uri':_0x3b1edf+_0x9c19('0xb')+'&'+_0x4c59ce+'&'+_0x54afa7,'auth':_0x2f003f,'json':!![]};return rp(_0x315ab1)[_0x9c19('0xc')](function(_0x395af8){if(_0x395af8[_0x9c19('0xd')][_0x9c19('0xe')]>0x0){_0x28fa92[_0x9c19('0xf')]=_0x395af8[_0x9c19('0xd')][0x0][_0x9c19('0x10')];}logger['info']('['+[_0x5a0a54[_0x9c19('0x11')]()]+_0x9c19('0x12'),_0x28fa92);_0x37a2fa(_0x28fa92);})[_0x9c19('0x13')](function(_0x523b04){logger[_0x9c19('0x14')]('['+[_0x5a0a54[_0x9c19('0x11')]()]+']',_0x523b04[_0x9c19('0x15')]);_0x4512ef(_0x523b04[_0x9c19('0x15')]);});});}function getUser(_0x465df5,_0x51b156,_0x516620,_0x2d47c9,_0x347344){return function(_0x69486){logger[_0x9c19('0x16')]('['+[_0x465df5['toUpperCase']()]+_0x9c19('0x17'),_0x69486);return new Promise(function(_0x5dc95d,_0x3d30f1){if(intUtil[_0x9c19('0x18')](_0x69486['userEmail'])){var _0x1581ba={'method':_0x9c19('0xa'),'uri':_0x516620+_0x9c19('0x19')+_0x69486[_0x9c19('0x1a')]+'&'+_0x2d47c9+'&'+_0x347344,'auth':_0x51b156,'json':!![]};logger[_0x9c19('0x16')]('['+[_0x465df5[_0x9c19('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x1581ba);return rp(_0x1581ba)[_0x9c19('0xc')](function(_0x22f35c){logger[_0x9c19('0x16')]('['+[_0x465df5['toUpperCase']()]+_0x9c19('0x1b'),_0x22f35c);if(_0x22f35c[_0x9c19('0xd')][_0x9c19('0xe')]>0x0&&String(_0x22f35c[_0x9c19('0xd')][0x0]['active'])==='true'){_0x69486[_0x9c19('0x1c')]=_0x22f35c[_0x9c19('0xd')][0x0]['sys_id'];}else{_0x69486[_0x9c19('0x1c')]=_0x69486[_0x9c19('0xf')];_0x69486[_0x9c19('0x1a')]=_0x69486[_0x9c19('0x1d')];}logger[_0x9c19('0x16')]('['+[_0x465df5[_0x9c19('0x11')]()]+_0x9c19('0x1e'),_0x69486);_0x5dc95d(_0x69486);})[_0x9c19('0x13')](function(_0x30fd00){logger['error']('['+[_0x465df5[_0x9c19('0x11')]()]+']',_0x30fd00[_0x9c19('0x15')]);_0x3d30f1(_0x30fd00[_0x9c19('0x15')]);});}else{logger[_0x9c19('0x16')]('['+[_0x465df5[_0x9c19('0x11')]()]+_0x9c19('0x1f'));_0x69486[_0x9c19('0x1c')]=_0x69486[_0x9c19('0xf')];_0x69486[_0x9c19('0x1a')]=_0x69486[_0x9c19('0x1d')];_0x5dc95d(_0x69486);}});};}function createEndUser(_0x3eb767,_0x4aecff,_0x31ccc4,_0x25daaa,_0x392087){logger[_0x9c19('0x16')]('['+[_0x3eb767[_0x9c19('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x31ccc4);return new Promise(function(_0x5a6f60,_0x4b4e41){var _0x3976e6={'method':_0x9c19('0x20'),'uri':_0x25daaa+_0x9c19('0x21')+_0x392087,'body':{'user_name':_0x31ccc4[_0x9c19('0x22')],'roles':_0x9c19('0x23'),'first_name':_0x31ccc4[_0x9c19('0x22')],'active':_0x9c19('0x24'),'date_format':_0x9c19('0x25'),'phone':_0x31ccc4[_0x9c19('0x22')]},'auth':_0x4aecff,'json':!![]};return rp(_0x3976e6)[_0x9c19('0xc')](function(_0x16c77a){logger['info']('['+[_0x3eb767['toUpperCase']()]+_0x9c19('0x26'),_0x16c77a[_0x9c19('0xd')]);_0x31ccc4[_0x9c19('0x27')]=_0x16c77a[_0x9c19('0xd')][_0x9c19('0x10')];_0x5a6f60(_0x31ccc4);})['catch'](function(_0x55080f){logger['error']('['+[_0x3eb767['toUpperCase']()]+']',_0x55080f[_0x9c19('0x15')]);_0x4b4e41(_0x55080f[_0x9c19('0x15')]);});});}function getEndUser(_0x4ee4bd,_0x27b5e9,_0x1ff072,_0x23a571,_0x944867){return function(_0x36b604){logger[_0x9c19('0x16')]('['+[_0x4ee4bd[_0x9c19('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x36b604);return new Promise(function(_0x8a36b7,_0xa68339){var _0x11ded0={'method':_0x9c19('0xa'),'uri':_0x1ff072+_0x9c19('0x28')+_0x36b604['endUserNumber']+'&'+_0x23a571+'&'+_0x944867,'auth':_0x27b5e9,'json':!![]};return rp(_0x11ded0)[_0x9c19('0xc')](function(_0x20a0ca){if(_0x20a0ca[_0x9c19('0xd')]['length']>0x0){_0x36b604[_0x9c19('0x27')]=_0x20a0ca[_0x9c19('0xd')][0x0][_0x9c19('0x10')];logger[_0x9c19('0x16')]('['+[_0x4ee4bd['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x36b604);_0x8a36b7(_0x36b604);}else{return createEndUser(_0x4ee4bd,_0x27b5e9,_0x36b604,_0x1ff072,_0x23a571)[_0x9c19('0xc')](function(_0x1ad2a8){logger[_0x9c19('0x16')]('['+[_0x4ee4bd['toUpperCase']()]+_0x9c19('0x29'),_0x1ad2a8);_0x8a36b7(_0x1ad2a8);});}})['catch'](function(_0x494006){logger[_0x9c19('0x14')]('['+[_0x4ee4bd[_0x9c19('0x11')]()]+']',_0x494006['message']);_0xa68339(_0x494006[_0x9c19('0x15')]);});});};}function getCustomFields(_0x29209e,_0x4f50de){var _0x389ab7={};if(_0x29209e[_0x9c19('0xe')]>0x0){_[_0x9c19('0x2a')](_0x29209e,function(_0xb91d1d){if(_[_0x9c19('0x2b')]([_0x9c19('0x2c'),_0x9c19('0x2d')],_0xb91d1d[_0x9c19('0x2e')])&&_0xb91d1d[_0x9c19('0x2f')]&&!_0xb91d1d[_0x9c19('0x30')]){_0x389ab7[_0xb91d1d['nameField'][_0x9c19('0x31')]()]=_0xb91d1d[_0x9c19('0x32')]['toString']();}else if(_[_0x9c19('0x2b')]([_0x9c19('0x2c'),_0x9c19('0x2d')],_0xb91d1d['type'])&&_0xb91d1d[_0x9c19('0x33')]&&_0xb91d1d[_0x9c19('0x30')]){_0x389ab7[_0xb91d1d[_0x9c19('0x33')][_0x9c19('0x31')]()]=_0xb91d1d[_0x9c19('0x32')][_0x9c19('0x34')]();}else if(_0xb91d1d[_0x9c19('0x2e')]===_0x9c19('0x35')&&_0xb91d1d[_0x9c19('0x36')]&&_0xb91d1d['idField']&&_0xb91d1d[_0x9c19('0x30')]){_0x389ab7[_0xb91d1d['idField'][_0x9c19('0x31')]()]=_0x4f50de[_0xb91d1d[_0x9c19('0x36')]][_0x9c19('0x34')]();}else if(_0xb91d1d['type']===_0x9c19('0x37')&&_0xb91d1d[_0x9c19('0x38')]&&_0xb91d1d[_0x9c19('0x38')][_0x9c19('0x39')]&&_0xb91d1d[_0x9c19('0x33')]&&_0xb91d1d[_0x9c19('0x30')]){_0x389ab7[_0xb91d1d[_0x9c19('0x33')][_0x9c19('0x31')]()]=_0x4f50de[_0xb91d1d[_0x9c19('0x38')]['name'][_0x9c19('0x31')]()][_0x9c19('0x34')]();}});}return _0x389ab7;}function getTicket(_0x2150a2,_0x358ef0,_0x166902,_0x2c3b1a,_0x1869e4,_0x1ac10f){return function(_0x528f84){logger[_0x9c19('0x16')]('['+[_0x2150a2[_0x9c19('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x528f84);return new Promise(function(_0x117e01,_0x4bf770){var _0x6a51bb=_0x2150a2[_0x9c19('0x31')]()===_0x9c19('0x3a')?_0x528f84[_0x9c19('0x1c')]:_0x528f84[_0x9c19('0x27')];var _0x1e5a8a={'method':'POST','uri':_0x166902+_0x9c19('0x3b')+'?'+_0x1ac10f,'body':Object[_0x9c19('0x3c')]({},{'active':_0x9c19('0x24'),'caller_id':_0x6a51bb,'assigned_to':_0x528f84['userId'],'short_description':intUtil['getString'](_0x2c3b1a[_0x9c19('0x3d')],_0x1869e4,'\x20'),'description':intUtil[_0x9c19('0x3e')](_0x2c3b1a[_0x9c19('0x3f')],_0x1869e4,'\x0a')},getCustomFields(_0x2c3b1a[_0x9c19('0x40')],_0x1869e4)),'auth':_0x358ef0,'json':!![]};return rp(_0x1e5a8a)[_0x9c19('0xc')](function(_0x391b9b){logger['info']('['+[_0x2150a2['toUpperCase']()]+_0x9c19('0x41'),_0x391b9b[_0x9c19('0xd')]);_0x528f84['ticketId']=_0x391b9b['result']['sys_id'];_0x528f84[_0x9c19('0x42')]=_0x391b9b[_0x9c19('0xd')][_0x9c19('0x43')];logger[_0x9c19('0x16')]('['+[_0x2150a2['toUpperCase']()]+_0x9c19('0x44'),_0x528f84);_0x117e01(_0x528f84);})[_0x9c19('0x13')](function(_0x451c87){logger[_0x9c19('0x14')]('['+[_0x2150a2[_0x9c19('0x11')]()]+']',_0x451c87['message']);_0x4bf770(_0x451c87[_0x9c19('0x15')]);});});};}function createRemoteTag(_0x2953da,_0x44bbd3,_0x2ab149,_0x35cdd0){return new Promise(function(_0x80c3a,_0x469540){var _0x1a32a2={'method':_0x9c19('0x20'),'uri':_0x2ab149+_0x9c19('0x45')+'?'+_0x35cdd0,'body':{'short_description':_0x2953da,'global':!![],'active':!![],'name':_0x2953da},'auth':_0x44bbd3,'json':!![]};return rp(_0x1a32a2)[_0x9c19('0xc')](function(_0x22e697){var _0xb1f024=_0x22e697[_0x9c19('0xd')][_0x9c19('0x10')];_0x80c3a(_0xb1f024);});});}function getRemoteTag(_0x232f91,_0x107483,_0x131ff1,_0x140d39,_0x18dbfa){return new Promise(function(_0xabd043,_0x2e5a58){var _0x38eb84={'method':_0x9c19('0xa'),'uri':_0x131ff1+_0x9c19('0x45')+_0x9c19('0x46')+_0x232f91+'&'+_0x140d39,'auth':_0x107483,'json':!![]};return rp(_0x38eb84)[_0x9c19('0xc')](function(_0x500bef){if(_0x500bef[_0x9c19('0xd')][_0x9c19('0xe')]>0x0){var _0x4d01e4=_0x500bef[_0x9c19('0xd')][0x0][_0x9c19('0x10')];_0xabd043(_0x4d01e4);}else{return createRemoteTag(_0x232f91,_0x107483,_0x131ff1,_0x140d39)[_0x9c19('0xc')](function(_0x372d7d){_0xabd043(_0x372d7d);});}});});}function assignTagToIncident(_0x2187c6,_0xd6356,_0x3e6757,_0x37ddad,_0x581b9f){return new Promise(function(_0x1cf804,_0x19cdba){var _0x4d4301={'method':_0x9c19('0x20'),'uri':_0x3e6757+_0x9c19('0x47')+'?'+_0x581b9f,'body':{'label':_0x2187c6,'table':_0x9c19('0x3b'),'id_type':_0x9c19('0x48'),'table_key':_0x37ddad[_0x9c19('0x49')],'title':_0x9c19('0x4a')+_0x37ddad[_0x9c19('0x42')],'id_display':_0x37ddad['ticketNumber']},'auth':_0xd6356,'json':!![]};return rp(_0x4d4301)[_0x9c19('0xc')](function(_0x58ace2){_0x1cf804();})[_0x9c19('0x13')](function(){_0x1cf804();});});}function manageTags(_0x54dd5a,_0x29f7da,_0x94ec9,_0x313380,_0x583644,_0x36d6c0,_0x117dff){return new Promise(function(_0x528533,_0x17fc8f){var _0x2e0055=[];_0x29f7da['forEach'](function(_0x5a009e){_0x2e0055[_0x9c19('0x4b')](getRemoteTag(_0x5a009e,_0x94ec9,_0x313380,_0x36d6c0,_0x117dff));});return Promise[_0x9c19('0x4c')](_0x2e0055)[_0x9c19('0xc')](function(_0x25dae9){if(_0x25dae9['length']){logger[_0x9c19('0x16')]('['+[_0x54dd5a['toUpperCase']()]+_0x9c19('0x4d'),_0x25dae9);var _0x2f12da=[];_0x25dae9['forEach'](function(_0x117a04){_0x2f12da[_0x9c19('0x4b')](assignTagToIncident(_0x117a04,_0x94ec9,_0x313380,_0x583644,_0x36d6c0));});return Promise['all'](_0x2f12da)['then'](function(){_0x528533();})[_0x9c19('0x13')](function(){_0x528533();});}else{_0x528533();}});});}function getTags(_0x46a53d,_0x1420b5,_0x598bc6,_0x4017a8,_0x4604d0,_0x5f0967){return function(_0xb9e2a4){return new Promise(function(_0x51c1de,_0x56c49a){var _0x32cb4a=[];var _0x8e5f31=_0x4017a8['Tags'];if(_0x8e5f31&&_0x8e5f31[_0x9c19('0xe')]>0x0){_0x32cb4a=_[_0x9c19('0x4e')](_0x8e5f31,_0x9c19('0x39'));}if(_0x32cb4a[_0x9c19('0xe')]>0x0){return manageTags(_0x46a53d,_0x32cb4a,_0x1420b5,_0x598bc6,_0xb9e2a4,_0x4604d0,_0x5f0967)[_0x9c19('0xc')](function(){_0x51c1de(_0xb9e2a4);});}else{_0x51c1de(_0xb9e2a4);}});};}function emit(_0xb4b674,_0x5dccfd,_0x7ba2ea){var _0x154b96=_0x9c19('0x4f')+_0x9c19('0x50')+_0x9c19('0x51')+_0x9c19('0x52');var _0x3defa9={'uri':_0xb4b674+_0x9c19('0x53')+_0x7ba2ea+_0x154b96};io['to'](util[_0x9c19('0x54')]('user:%s',_0x5dccfd))['emit'](_0x9c19('0x55'),_0x3defa9);}exports['cs']=function(_0x341090,_0x500f07,_0x5400a2,_0x42e4aa,_0x307187,_0x5e4341,_0xf3c684,_0x2fe6c4){var _0x5b20cf={};var _0x457df9={'user':_0x5e4341[_0x9c19('0x56')],'pass':_0x5e4341[_0x9c19('0x57')]};var _0x593d24=_0x9c19('0x58');var _0x3fff2e='sysparm_display_value=true';_0x5e4341[_0x9c19('0x59')]=intUtil[_0x9c19('0x5a')](_0x5e4341[_0x9c19('0x59')]);_0x5e4341['serverUrl']=intUtil['stripTrailingSlash'](_0x5e4341[_0x9c19('0x5b')]);var _0x5596b7=util[_0x9c19('0x54')]('%s/api/now/table/',_0x5e4341[_0x9c19('0x59')]);_0x5b20cf[_0x9c19('0x1a')]=!_[_0x9c19('0x5c')](_0x42e4aa)?_0x42e4aa['email']:null;_0x5b20cf['adminEmail']=_0x5e4341[_0x9c19('0x5d')];_0x5b20cf[_0x9c19('0x22')]=_0x2fe6c4[_0x9c19('0x31')]()==='outbound'?_0x500f07[_0x9c19('0x5e')]:_0x500f07[_0x9c19('0x5f')];_0x5b20cf[_0x9c19('0x60')]=_0x2fe6c4===_0x9c19('0x61')||_0x2fe6c4==='unmanaged'?_0x9c19('0x61'):'outbound';var _0x19712b=util[_0x9c19('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e4341[_0x9c19('0x5b')],_0x500f07[_0x9c19('0x62')],md5(_0x500f07[_0x9c19('0x62')]));if(_0x307187&&_0x307187[_0x9c19('0x63')]){logger[_0x9c19('0x16')](_0x9c19('0x64'),'Recording\x20is\x20enabled!');_0x500f07['recordingURL']=_0x19712b;}else if(_0xf3c684&&_0xf3c684[_0x9c19('0x65')]&&_0xf3c684[_0x9c19('0x65')]!==_0x9c19('0x66')){logger['info'](_0x9c19('0x67'),_0x9c19('0x68'));_0x500f07[_0x9c19('0x69')]=_0x19712b;}else{_0x500f07[_0x9c19('0x69')]='';}return getAdminUser(_0x2fe6c4,_0x457df9,_0x5b20cf,_0x5596b7,_0x3fff2e,_0x593d24)[_0x9c19('0xc')](getUser(_0x2fe6c4,_0x457df9,_0x5596b7,_0x3fff2e,_0x593d24))[_0x9c19('0xc')](getEndUser(_0x2fe6c4,_0x457df9,_0x5596b7,_0x3fff2e,_0x593d24))['then'](getTicket(_0x2fe6c4,_0x457df9,_0x5596b7,_0x5400a2,_0x500f07,_0x3fff2e))['then'](function(_0x36223c){logger['info'](util[_0x9c19('0x54')]('The\x20ticket\x20ID\x20is:\x20%s',_0x36223c[_0x9c19('0x49')]));logger[_0x9c19('0x16')](util[_0x9c19('0x54')](_0x9c19('0x6a'),_0x2fe6c4));if(_0x2fe6c4!==_0x9c19('0x6b')){logger[_0x9c19('0x16')]('['+[_0x2fe6c4[_0x9c19('0x11')]()]+']',_0x9c19('0x6c'));emit(_0x5e4341[_0x9c19('0x59')],_0x42e4aa['name'],_0x36223c[_0x9c19('0x49')]);}})[_0x9c19('0x13')](function(_0x49f4ef){logger[_0x9c19('0x14')]('['+[_0x2fe6c4[_0x9c19('0x11')]()]+_0x9c19('0x6d'),util[_0x9c19('0x6e')](_0x49f4ef,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb521=[']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','active','userId','sys_id','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','nameField','customField','toLowerCase','string','idField','content','toString','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x676195,_0x3aedd2){var _0x1f3e3d=function(_0x15fb03){while(--_0x15fb03){_0x676195['push'](_0x676195['shift']());}};_0x1f3e3d(++_0x3aedd2);}(_0xb521,0x155));var _0x1b52=function(_0x30cb3f,_0x859105){_0x30cb3f=_0x30cb3f-0x0;var _0x527cc1=_0xb521[_0x30cb3f];return _0x527cc1;};'use strict';var _=require(_0x1b52('0x0'));var Promise=require(_0x1b52('0x1'));var rp=require(_0x1b52('0x2'));var util=require(_0x1b52('0x3'));var md5=require(_0x1b52('0x4'));var Redis=require(_0x1b52('0x5'));var intUtil=require(_0x1b52('0x6'));var config=require(_0x1b52('0x7'));var logger=require(_0x1b52('0x8'))('servicenow');config[_0x1b52('0x9')]=_[_0x1b52('0xa')](config['redis'],{'host':_0x1b52('0xb'),'port':0x18eb});var io=require(_0x1b52('0xc'))(new Redis(config['redis']));function getAdminUser(_0x3c369f,_0x226079,_0x7e63dc,_0x5a1c8e,_0x48e874,_0x1e3256){return new Promise(function(_0x5b3df2,_0x4a3ff0){var _0x1de975={'method':_0x1b52('0xd'),'uri':_0x5a1c8e+_0x1b52('0xe')+'&'+_0x48e874+'&'+_0x1e3256,'auth':_0x226079,'json':!![]};return rp(_0x1de975)[_0x1b52('0xf')](function(_0x4d0412){if(_0x4d0412[_0x1b52('0x10')][_0x1b52('0x11')]>0x0){_0x7e63dc['adminId']=_0x4d0412[_0x1b52('0x10')][0x0]['sys_id'];}logger['info']('['+[_0x3c369f[_0x1b52('0x12')]()]+_0x1b52('0x13'),_0x7e63dc);_0x5b3df2(_0x7e63dc);})[_0x1b52('0x14')](function(_0x4b388c){logger[_0x1b52('0x15')]('['+[_0x3c369f[_0x1b52('0x12')]()]+']',_0x4b388c[_0x1b52('0x16')]);_0x4a3ff0(_0x4b388c[_0x1b52('0x16')]);});});}function getUser(_0x19b5aa,_0x35b882,_0x2e86e2,_0x3c7205,_0x1edcbb){return function(_0x3e74de){logger['info']('['+[_0x19b5aa['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x3e74de);return new Promise(function(_0x4c2031,_0x56c395){if(intUtil[_0x1b52('0x17')](_0x3e74de[_0x1b52('0x18')])){var _0x541258={'method':_0x1b52('0xd'),'uri':_0x2e86e2+_0x1b52('0x19')+_0x3e74de[_0x1b52('0x18')]+'&'+_0x3c7205+'&'+_0x1edcbb,'auth':_0x35b882,'json':!![]};logger[_0x1b52('0x1a')]('['+[_0x19b5aa[_0x1b52('0x12')]()]+_0x1b52('0x1b'),_0x541258);return rp(_0x541258)[_0x1b52('0xf')](function(_0x342b7d){logger[_0x1b52('0x1a')]('['+[_0x19b5aa[_0x1b52('0x12')]()]+'],\x20getUser\x20entity',_0x342b7d);if(_0x342b7d[_0x1b52('0x10')]['length']>0x0&&String(_0x342b7d[_0x1b52('0x10')][0x0][_0x1b52('0x1c')])==='true'){_0x3e74de[_0x1b52('0x1d')]=_0x342b7d[_0x1b52('0x10')][0x0][_0x1b52('0x1e')];}else{_0x3e74de[_0x1b52('0x1d')]=_0x3e74de[_0x1b52('0x1f')];_0x3e74de[_0x1b52('0x18')]=_0x3e74de[_0x1b52('0x20')];}logger[_0x1b52('0x1a')]('['+[_0x19b5aa[_0x1b52('0x12')]()]+_0x1b52('0x21'),_0x3e74de);_0x4c2031(_0x3e74de);})['catch'](function(_0x35476a){logger[_0x1b52('0x15')]('['+[_0x19b5aa[_0x1b52('0x12')]()]+']',_0x35476a['message']);_0x56c395(_0x35476a['message']);});}else{logger['info']('['+[_0x19b5aa[_0x1b52('0x12')]()]+_0x1b52('0x22'));_0x3e74de[_0x1b52('0x1d')]=_0x3e74de[_0x1b52('0x1f')];_0x3e74de[_0x1b52('0x18')]=_0x3e74de[_0x1b52('0x20')];_0x4c2031(_0x3e74de);}});};}function createEndUser(_0x3727d8,_0x432bff,_0x400a0a,_0x57a8ec,_0x17789d){logger[_0x1b52('0x1a')]('['+[_0x3727d8[_0x1b52('0x12')]()]+_0x1b52('0x23'),_0x400a0a);return new Promise(function(_0x1f11d3,_0x4816dd){var _0x4952d8={'method':_0x1b52('0x24'),'uri':_0x57a8ec+'sys_user?'+_0x17789d,'body':{'user_name':_0x400a0a[_0x1b52('0x25')],'roles':_0x1b52('0x26'),'first_name':_0x400a0a[_0x1b52('0x25')],'active':_0x1b52('0x27'),'date_format':_0x1b52('0x28'),'phone':_0x400a0a['endUserNumber']},'auth':_0x432bff,'json':!![]};return rp(_0x4952d8)[_0x1b52('0xf')](function(_0x5975f7){logger[_0x1b52('0x1a')]('['+[_0x3727d8[_0x1b52('0x12')]()]+_0x1b52('0x29'),_0x5975f7[_0x1b52('0x10')]);_0x400a0a['endUserId']=_0x5975f7[_0x1b52('0x10')][_0x1b52('0x1e')];_0x1f11d3(_0x400a0a);})['catch'](function(_0x329da7){logger[_0x1b52('0x15')]('['+[_0x3727d8[_0x1b52('0x12')]()]+']',_0x329da7['message']);_0x4816dd(_0x329da7[_0x1b52('0x16')]);});});}function getEndUser(_0x1c5a5e,_0xffdded,_0x2ac646,_0x1d94f4,_0x379980){return function(_0x3f2fbe){logger[_0x1b52('0x1a')]('['+[_0x1c5a5e['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x3f2fbe);return new Promise(function(_0x574035,_0x1fb512){var _0x70ec34={'method':_0x1b52('0xd'),'uri':_0x2ac646+'sys_user?sysparm_query=phone%3D'+_0x3f2fbe[_0x1b52('0x25')]+'&'+_0x1d94f4+'&'+_0x379980,'auth':_0xffdded,'json':!![]};return rp(_0x70ec34)[_0x1b52('0xf')](function(_0xa70e23){if(_0xa70e23[_0x1b52('0x10')]['length']>0x0){_0x3f2fbe[_0x1b52('0x2a')]=_0xa70e23[_0x1b52('0x10')][0x0][_0x1b52('0x1e')];logger[_0x1b52('0x1a')]('['+[_0x1c5a5e['toUpperCase']()]+_0x1b52('0x2b'),_0x3f2fbe);_0x574035(_0x3f2fbe);}else{return createEndUser(_0x1c5a5e,_0xffdded,_0x3f2fbe,_0x2ac646,_0x1d94f4)[_0x1b52('0xf')](function(_0x152a10){logger['info']('['+[_0x1c5a5e[_0x1b52('0x12')]()]+_0x1b52('0x2c'),_0x152a10);_0x574035(_0x152a10);});}})[_0x1b52('0x14')](function(_0x23ce3e){logger['error']('['+[_0x1c5a5e[_0x1b52('0x12')]()]+']',_0x23ce3e[_0x1b52('0x16')]);_0x1fb512(_0x23ce3e[_0x1b52('0x16')]);});});};}function getCustomFields(_0x4e0ecc,_0x2277f9){var _0x95e557={};if(_0x4e0ecc[_0x1b52('0x11')]>0x0){_[_0x1b52('0x2d')](_0x4e0ecc,function(_0x431091){if(_[_0x1b52('0x2e')](['string','picklist'],_0x431091[_0x1b52('0x2f')])&&_0x431091[_0x1b52('0x30')]&&!_0x431091[_0x1b52('0x31')]){_0x95e557[_0x431091[_0x1b52('0x30')][_0x1b52('0x32')]()]=_0x431091['content']['toString']();}else if(_['includes']([_0x1b52('0x33'),'picklist'],_0x431091[_0x1b52('0x2f')])&&_0x431091['idField']&&_0x431091[_0x1b52('0x31')]){_0x95e557[_0x431091[_0x1b52('0x34')]['toLowerCase']()]=_0x431091[_0x1b52('0x35')][_0x1b52('0x36')]();}else if(_0x431091[_0x1b52('0x2f')]===_0x1b52('0x37')&&_0x431091[_0x1b52('0x38')]&&_0x431091['idField']&&_0x431091[_0x1b52('0x31')]){_0x95e557[_0x431091[_0x1b52('0x34')]['toLowerCase']()]=_0x2277f9[_0x431091[_0x1b52('0x38')]][_0x1b52('0x36')]();}else if(_0x431091[_0x1b52('0x2f')]===_0x1b52('0x39')&&_0x431091['Variable']&&_0x431091[_0x1b52('0x3a')][_0x1b52('0x3b')]&&_0x431091[_0x1b52('0x34')]&&_0x431091[_0x1b52('0x31')]){_0x95e557[_0x431091[_0x1b52('0x34')][_0x1b52('0x32')]()]=_0x2277f9[_0x431091['Variable'][_0x1b52('0x3b')]['toLowerCase']()][_0x1b52('0x36')]();}});}return _0x95e557;}function getTicket(_0x1a6615,_0xd200d3,_0x23c469,_0x56f0f8,_0x257371,_0x44c2e8){return function(_0x1693f5){logger[_0x1b52('0x1a')]('['+[_0x1a6615[_0x1b52('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x1693f5);return new Promise(function(_0x35d5e9,_0x14fdb9){var _0xd94a2e=_0x1a6615[_0x1b52('0x32')]()===_0x1b52('0x3c')?_0x1693f5['userId']:_0x1693f5[_0x1b52('0x2a')];var _0x31d5c3={'method':_0x1b52('0x24'),'uri':_0x23c469+_0x1b52('0x3d')+'?'+_0x44c2e8,'body':Object[_0x1b52('0x3e')]({},{'active':_0x1b52('0x27'),'caller_id':_0xd94a2e,'assigned_to':_0x1693f5[_0x1b52('0x1d')],'short_description':intUtil[_0x1b52('0x3f')](_0x56f0f8[_0x1b52('0x40')],_0x257371,'\x20'),'description':intUtil['getString'](_0x56f0f8[_0x1b52('0x41')],_0x257371,'\x0a')},getCustomFields(_0x56f0f8['Fields'],_0x257371)),'auth':_0xd200d3,'json':!![]};return rp(_0x31d5c3)[_0x1b52('0xf')](function(_0x46540b){logger['info']('['+[_0x1a6615[_0x1b52('0x12')]()]+_0x1b52('0x42'),_0x46540b[_0x1b52('0x10')]);_0x1693f5[_0x1b52('0x43')]=_0x46540b[_0x1b52('0x10')][_0x1b52('0x1e')];_0x1693f5[_0x1b52('0x44')]=_0x46540b[_0x1b52('0x10')][_0x1b52('0x45')];logger[_0x1b52('0x1a')]('['+[_0x1a6615[_0x1b52('0x12')]()]+']\x20getTicket\x20crm',_0x1693f5);_0x35d5e9(_0x1693f5);})[_0x1b52('0x14')](function(_0xbe987){logger[_0x1b52('0x15')]('['+[_0x1a6615['toUpperCase']()]+']',_0xbe987[_0x1b52('0x16')]);_0x14fdb9(_0xbe987[_0x1b52('0x16')]);});});};}function createRemoteTag(_0x123ee8,_0x3a6ce1,_0x357795,_0x577a05){return new Promise(function(_0x241be1,_0x415f24){var _0x5bd68b={'method':_0x1b52('0x24'),'uri':_0x357795+_0x1b52('0x46')+'?'+_0x577a05,'body':{'short_description':_0x123ee8,'global':!![],'active':!![],'name':_0x123ee8},'auth':_0x3a6ce1,'json':!![]};return rp(_0x5bd68b)[_0x1b52('0xf')](function(_0x1b268d){var _0xf5f37a=_0x1b268d[_0x1b52('0x10')][_0x1b52('0x1e')];_0x241be1(_0xf5f37a);});});}function getRemoteTag(_0x273176,_0x58dd80,_0x4518e4,_0x226ed7,_0x329f4a){return new Promise(function(_0xaf144b,_0x5e7426){var _0x402a4a={'method':_0x1b52('0xd'),'uri':_0x4518e4+_0x1b52('0x46')+_0x1b52('0x47')+_0x273176+'&'+_0x226ed7,'auth':_0x58dd80,'json':!![]};return rp(_0x402a4a)[_0x1b52('0xf')](function(_0x561552){if(_0x561552[_0x1b52('0x10')][_0x1b52('0x11')]>0x0){var _0x586129=_0x561552[_0x1b52('0x10')][0x0]['sys_id'];_0xaf144b(_0x586129);}else{return createRemoteTag(_0x273176,_0x58dd80,_0x4518e4,_0x226ed7)['then'](function(_0x1c7f69){_0xaf144b(_0x1c7f69);});}});});}function assignTagToIncident(_0xa2b4a0,_0x19255a,_0x25d9c5,_0x3f63da,_0x30ab9d){return new Promise(function(_0x33cdeb,_0x54ebdb){var _0x475fbe={'method':_0x1b52('0x24'),'uri':_0x25d9c5+_0x1b52('0x48')+'?'+_0x30ab9d,'body':{'label':_0xa2b4a0,'table':_0x1b52('0x3d'),'id_type':_0x1b52('0x49'),'table_key':_0x3f63da['ticketId'],'title':_0x1b52('0x4a')+_0x3f63da[_0x1b52('0x44')],'id_display':_0x3f63da[_0x1b52('0x44')]},'auth':_0x19255a,'json':!![]};return rp(_0x475fbe)[_0x1b52('0xf')](function(_0x30f9d1){_0x33cdeb();})['catch'](function(){_0x33cdeb();});});}function manageTags(_0x33e715,_0x50dd80,_0x13d39b,_0x5a606e,_0x549262,_0x257d20,_0xccf44e){return new Promise(function(_0xfcf703,_0x1c01d2){var _0x1ad550=[];_0x50dd80[_0x1b52('0x2d')](function(_0x7840db){_0x1ad550[_0x1b52('0x4b')](getRemoteTag(_0x7840db,_0x13d39b,_0x5a606e,_0x257d20,_0xccf44e));});return Promise[_0x1b52('0x4c')](_0x1ad550)[_0x1b52('0xf')](function(_0x374938){if(_0x374938[_0x1b52('0x11')]){logger[_0x1b52('0x1a')]('['+[_0x33e715['toUpperCase']()]+_0x1b52('0x4d'),_0x374938);var _0x39d56b=[];_0x374938[_0x1b52('0x2d')](function(_0x26bac0){_0x39d56b['push'](assignTagToIncident(_0x26bac0,_0x13d39b,_0x5a606e,_0x549262,_0x257d20));});return Promise[_0x1b52('0x4c')](_0x39d56b)[_0x1b52('0xf')](function(){_0xfcf703();})[_0x1b52('0x14')](function(){_0xfcf703();});}else{_0xfcf703();}});});}function getTags(_0x31606e,_0x4ca7ed,_0x302479,_0x3e08e4,_0x5e4f95,_0x4b7f53){return function(_0x3edc47){return new Promise(function(_0x5e183f,_0x353e42){var _0x10e9d2=[];var _0x296c7c=_0x3e08e4[_0x1b52('0x4e')];if(_0x296c7c&&_0x296c7c[_0x1b52('0x11')]>0x0){_0x10e9d2=_[_0x1b52('0x4f')](_0x296c7c,'name');}if(_0x10e9d2[_0x1b52('0x11')]>0x0){return manageTags(_0x31606e,_0x10e9d2,_0x4ca7ed,_0x302479,_0x3edc47,_0x5e4f95,_0x4b7f53)[_0x1b52('0xf')](function(){_0x5e183f(_0x3edc47);});}else{_0x5e183f(_0x3edc47);}});};}function emit(_0x4ede7e,_0x16b22f,_0x417e2c){var _0xbc74c4=_0x1b52('0x50')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x1b52('0x51')+'%255EORDERBYDESCnumber';var _0x885037={'uri':_0x4ede7e+_0x1b52('0x52')+_0x417e2c+_0xbc74c4};io['to'](util[_0x1b52('0x53')](_0x1b52('0x54'),_0x16b22f))['emit'](_0x1b52('0x55'),_0x885037);}exports['cs']=function(_0x5ef254,_0x3d6e56,_0x338127,_0x588434,_0x552350,_0x3a3b7d,_0x51393e,_0x2c388d){var _0x41c055={};var _0x3dc66e={'user':_0x3a3b7d[_0x1b52('0x56')],'pass':_0x3a3b7d['password']};var _0x5726d6='sysparm_limit=1';var _0x494c5c=_0x1b52('0x57');_0x3a3b7d[_0x1b52('0x58')]=intUtil[_0x1b52('0x59')](_0x3a3b7d['remoteUri']);_0x3a3b7d[_0x1b52('0x5a')]=intUtil[_0x1b52('0x59')](_0x3a3b7d[_0x1b52('0x5a')]);var _0x448467=util[_0x1b52('0x53')](_0x1b52('0x5b'),_0x3a3b7d['remoteUri']);_0x41c055[_0x1b52('0x18')]=!_[_0x1b52('0x5c')](_0x588434)?_0x588434[_0x1b52('0x5d')]:null;_0x41c055[_0x1b52('0x20')]=_0x3a3b7d['email'];_0x41c055[_0x1b52('0x25')]=_0x2c388d[_0x1b52('0x32')]()===_0x1b52('0x3c')?_0x3d6e56[_0x1b52('0x5e')]:_0x3d6e56[_0x1b52('0x5f')];_0x41c055[_0x1b52('0x60')]=_0x2c388d===_0x1b52('0x61')||_0x2c388d===_0x1b52('0x62')?_0x1b52('0x61'):'outbound';var _0x82bc08=util[_0x1b52('0x53')](_0x1b52('0x63'),_0x3a3b7d['serverUrl'],_0x3d6e56[_0x1b52('0x64')],md5(_0x3d6e56['uniqueid']));if(_0x552350&&_0x552350[_0x1b52('0x65')]){logger[_0x1b52('0x1a')](_0x1b52('0x66'),_0x1b52('0x67'));_0x3d6e56[_0x1b52('0x68')]=_0x82bc08;}else if(_0x51393e&&_0x51393e['recordingFormat']&&_0x51393e[_0x1b52('0x69')]!==_0x1b52('0x6a')){logger['info'](_0x1b52('0x6b'),'Recording\x20is\x20enabled!');_0x3d6e56[_0x1b52('0x68')]=_0x82bc08;}else{_0x3d6e56[_0x1b52('0x68')]='';}return getAdminUser(_0x2c388d,_0x3dc66e,_0x41c055,_0x448467,_0x494c5c,_0x5726d6)[_0x1b52('0xf')](getUser(_0x2c388d,_0x3dc66e,_0x448467,_0x494c5c,_0x5726d6))['then'](getEndUser(_0x2c388d,_0x3dc66e,_0x448467,_0x494c5c,_0x5726d6))[_0x1b52('0xf')](getTicket(_0x2c388d,_0x3dc66e,_0x448467,_0x338127,_0x3d6e56,_0x494c5c))['then'](function(_0x2cd4ef){logger['info'](util[_0x1b52('0x53')](_0x1b52('0x6c'),_0x2cd4ef['ticketId']));logger['info'](util[_0x1b52('0x53')](_0x1b52('0x6d'),_0x2c388d));if(_0x2c388d!==_0x1b52('0x62')){logger[_0x1b52('0x1a')]('['+[_0x2c388d[_0x1b52('0x12')]()]+']',_0x1b52('0x6e'));emit(_0x3a3b7d['remoteUri'],_0x588434[_0x1b52('0x3b')],_0x2cd4ef[_0x1b52('0x43')]);}})[_0x1b52('0x14')](function(_0x577cb5){logger['error']('['+[_0x2c388d[_0x1b52('0x12')]()]+_0x1b52('0x6f'),util[_0x1b52('0x70')](_0x577cb5,{'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 cde6e2b..e6c2776 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 _0x818b=['Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','parent_type','direction','variableName','push','idField','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','length','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','entry_list','debug','map','forEach','type','string','customField','nameField','toLowerCase','custom_fields','content','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','catch','error','outbound','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by'];(function(_0x5ace25,_0x536239){var _0x4ba17a=function(_0x1ee54e){while(--_0x1ee54e){_0x5ace25['push'](_0x5ace25['shift']());}};_0x4ba17a(++_0x536239);}(_0x818b,0x150));var _0xb818=function(_0x26941f,_0x770776){_0x26941f=_0x26941f-0x0;var _0x3e585a=_0x818b[_0x26941f];return _0x3e585a;};'use strict';var _=require(_0xb818('0x0'));var rp=require(_0xb818('0x1'));var BPromise=require('bluebird');var md5=require(_0xb818('0x2'));var util=require(_0xb818('0x3'));var Redis=require(_0xb818('0x4'));var intUtil=require('./util');var config=require(_0xb818('0x5'));var logger=require(_0xb818('0x6'))('sugarcrm');config['redis']=_[_0xb818('0x7')](config[_0xb818('0x8')],{'host':_0xb818('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb818('0x8')]));var def={'method':_0xb818('0xa'),'json':!![]};function emit(_0x383efa,_0x1069ec,_0x1870ff){io['to'](_0x383efa)[_0xb818('0xb')](_0x1069ec,_0x1870ff);}function getTicket(_0x5d0ee8,_0x528bc7,_0x1a5a2a,_0x53424c,_0x34e3eb,_0x1ca66e,_0x10d12a,_0x3eb5fc){logger[_0xb818('0xc')](_0xb818('0xd'));var _0x2a3d43=new Date();var _0x5e5c06=[{'name':_0xb818('0xe'),'value':intUtil[_0xb818('0xf')](_0x53424c['Subjects'],_0x34e3eb,'\x20')},{'name':_0xb818('0x10'),'value':_0x528bc7['id']},{'name':_0xb818('0x11'),'value':_0x528bc7['id']},{'name':'description','value':intUtil['getString'](_0x53424c[_0xb818('0x12')],_0x34e3eb,'\x0a')},{'name':_0xb818('0x13'),'value':_0x2a3d43[_0xb818('0x14')]()[_0xb818('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xb818('0x16'),'value':'15'},{'name':_0xb818('0x17'),'value':_0x1a5a2a['id']},{'name':_0xb818('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x1a5a2a['name']},{'name':_0xb818('0x19'),'value':_0x3eb5fc}];if(_0x1ca66e['length']){_['forEach'](_0x1ca66e,function(_0xc7b8f6){if(_0x34e3eb[_0xc7b8f6[_0xb818('0x1a')]]){_0x5e5c06[_0xb818('0x1b')]({'name':_0xc7b8f6[_0xb818('0x1c')],'value':_0x34e3eb[_0xc7b8f6[_0xb818('0x1a')]]});}});}return request({'form':{'method':_0xb818('0x1d'),'input_type':_0xb818('0x1e'),'response_type':_0xb818('0x1e'),'rest_data':JSON[_0xb818('0x1f')]({'session':_0x10d12a['id'],'module_name':_0xb818('0x20'),'name_value_list':_0x5e5c06})}});}function getAuth(_0x1bb34c){return util[_0xb818('0x21')]('Basic\x20%s',new Buffer(_0x1bb34c['apiKey']+':X')[_0xb818('0x22')](_0xb818('0x23')));}function getServerInfo(_0x2601b6){return request({'form':{'method':_0xb818('0x24'),'input_type':_0xb818('0x1e'),'response_type':_0xb818('0x1e'),'rest_data':JSON['stringify']({'session':_0x2601b6['id']})}});}function getUser(_0x262fa7,_0x308d2b,_0x2167fa){if(!_[_0xb818('0x25')](_0x308d2b)){logger[_0xb818('0xc')](_0xb818('0x26'),_0x308d2b);return request({'form':{'method':_0xb818('0x27'),'input_type':_0xb818('0x1e'),'response_type':_0xb818('0x1e'),'rest_data':JSON[_0xb818('0x1f')]({'session':_0x2167fa['id'],'module_name':_0xb818('0x28'),'query':util[_0xb818('0x21')](_0xb818('0x29'),_0x308d2b),'order_by':'','offset':'0','select_fields':['id',_0xb818('0xe'),_0xb818('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb818('0x2b')](function(_0x586f43){if(_0x586f43['entry_list'][_0xb818('0x2c')]){var _0x27ae05=_[_0xb818('0x2d')](_0x586f43['entry_list'],function(_0x26c079){return _0x26c079[_0xb818('0x2e')][_0xb818('0x2a')]['value']===_0x308d2b;});if(_0x27ae05){logger[_0xb818('0xc')](_0xb818('0x2f'));return BPromise[_0xb818('0x30')]({'id':_0x27ae05[_0xb818('0x2e')]['id'][_0xb818('0x31')],'name':_0x27ae05[_0xb818('0x2e')][_0xb818('0xe')]['value']});}}logger['info'](_0xb818('0x32'));return BPromise[_0xb818('0x30')]({'id':_0x2167fa['name_value_list']['user_id'][_0xb818('0x31')],'name':_0x2167fa[_0xb818('0x2e')][_0xb818('0x2a')]['value']});});}else{logger[_0xb818('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb818('0x30')]({'id':_0x2167fa[_0xb818('0x2e')][_0xb818('0x33')]['value'],'name':_0x2167fa[_0xb818('0x2e')][_0xb818('0x2a')][_0xb818('0x31')]});}}function getEndUser(_0x54f0bb,_0x14540e,_0x146388,_0x2fd2e3){logger[_0xb818('0xc')]('Searching\x20enduser\x20with\x20phone',_0x146388);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb818('0x1f')]({'session':_0x2fd2e3['id'],'module_name':_0xb818('0x34'),'query':util[_0xb818('0x21')](_0xb818('0x35'),_0x146388),'order_by':'','offset':'0','select_fields':['id','name',_0xb818('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb818('0x2b')](function(_0xaaf37a){if(_0xaaf37a['entry_list'][_0xb818('0x2c')]){var _0x4b1727=_[_0xb818('0x2d')](_0xaaf37a['entry_list'],function(_0x2ef38f){return _0x2ef38f['name_value_list'][_0xb818('0x36')]['value']===_0x146388;});if(_0x4b1727){logger[_0xb818('0xc')]('Enduser\x20found!');return BPromise[_0xb818('0x30')]({'id':_0x4b1727[_0xb818('0x2e')]['id'][_0xb818('0x31')],'name':_0x4b1727[_0xb818('0x2e')][_0xb818('0xe')][_0xb818('0x31')],'phone':_0x4b1727[_0xb818('0x2e')][_0xb818('0x36')][_0xb818('0x31')]});}}else{logger['info'](_0xb818('0x37'));return request({'form':{'method':_0xb818('0x1d'),'input_type':_0xb818('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2fd2e3['id'],'module_name':_0xb818('0x34'),'name_value_list':[{'name':_0xb818('0x38'),'value':_0x14540e!==_0xb818('0x39')?_0x14540e:util['format'](_0xb818('0x3a'),_0x146388)},{'name':_0xb818('0x36'),'value':_0x146388}]})}})[_0xb818('0x2b')](function(_0x3ffd42){logger[_0xb818('0xc')]('Enduser\x20created.');return BPromise[_0xb818('0x30')]({'id':_0x3ffd42['id'],'name':_0x3ffd42['entry_list'][_0xb818('0x38')][_0xb818('0x31')],'phone':_0x3ffd42[_0xb818('0x3b')][_0xb818('0x36')]['value']});});}});}function request(_0xb47e46){logger[_0xb818('0x3c')]('[HTTP]',JSON[_0xb818('0x1f')](_0xb47e46));return rp(_['merge'](def,_0xb47e46));}function getTags(_0x502a93,_0x5bec8f){var _0x529968=[];if(_0x502a93&&_0x502a93[_0xb818('0x2c')]>0x0){_0x529968=_[_0xb818('0x3d')](_0x502a93,_0x5bec8f);}return _0x529968;}function getCustomFields(_0x4ca804,_0x2245aa){var _0x3e0fdf=[];var _0x56f61f={'custom_fields':[]};if(_0x4ca804[_0xb818('0x2c')]>0x0){_[_0xb818('0x3e')](_0x4ca804,function(_0x1bf997){if(_0x1bf997[_0xb818('0x3f')]===_0xb818('0x40')&&_0x1bf997['nameField']&&!_0x1bf997[_0xb818('0x41')]){_0x56f61f[_0x1bf997[_0xb818('0x42')][_0xb818('0x43')]()]=_0x1bf997['content'][_0xb818('0x22')]();}else if(_0x1bf997[_0xb818('0x3f')]===_0xb818('0x40')&&_0x1bf997[_0xb818('0x1c')]&&_0x1bf997['customField']){_0x56f61f[_0xb818('0x44')][_0xb818('0x1b')]({'id':_0x1bf997[_0xb818('0x1c')],'value':_0x1bf997[_0xb818('0x45')][_0xb818('0x22')]()});}else if(_0x1bf997[_0xb818('0x3f')]===_0xb818('0x46')&&_0x1bf997[_0xb818('0x1a')]&&_0x1bf997[_0xb818('0x1c')]&&_0x1bf997[_0xb818('0x41')]){_0x2245aa[_0x1bf997[_0xb818('0x1a')]]&&_0x56f61f[_0xb818('0x44')][_0xb818('0x1b')]({'id':_0x1bf997[_0xb818('0x1c')],'value':_0x2245aa[_0x1bf997[_0xb818('0x1a')]][_0xb818('0x22')]()});}else if(_0x1bf997['type']==='customVariable'&&_0x1bf997[_0xb818('0x47')]&&_0x1bf997[_0xb818('0x47')][_0xb818('0xe')]&&_0x1bf997[_0xb818('0x1c')]&&_0x1bf997['customField']){_0x2245aa[_0x1bf997[_0xb818('0x47')]['name'][_0xb818('0x43')]()]&&_0x56f61f[_0xb818('0x44')][_0xb818('0x1b')]({'id':_0x1bf997[_0xb818('0x1c')],'value':_0x2245aa[_0x1bf997[_0xb818('0x47')][_0xb818('0xe')][_0xb818('0x43')]()][_0xb818('0x22')]()});}});}return _0x56f61f;}function getConnection(_0x50a4dd){return request({'method':_0xb818('0xa'),'form':{'method':_0xb818('0x48'),'input_type':'JSON','response_type':_0xb818('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x50a4dd[_0xb818('0x49')],'password':_0x50a4dd[_0xb818('0x4a')],'encryption':_0xb818('0x4b')},'application':_0xb818('0x4c')})}})['then'](function(_0x3935a9){var _0x5e788a=_0x3935a9;if(_0x5e788a['id']){def[_0xb818('0x4d')]=_0x5e788a['id'];return BPromise[_0xb818('0x30')](_0x5e788a);}else{throw new Error(util[_0xb818('0x21')](_0xb818('0x4e'),_0x50a4dd['id']));}});}function setRelationship(_0x14eab8,_0x15df2d,_0x4c1baa,_0x16da67){return request({'form':{'method':'set_relationship','input_type':_0xb818('0x1e'),'response_type':_0xb818('0x1e'),'rest_data':JSON['stringify']({'session':_0x14eab8['id'],'module_name':'Calls','module_id':_0x4c1baa['id'],'link_field_name':_0x16da67,'related_ids':[_0x15df2d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb818('0x4f')]=function(_0x791f18,_0x3969ed,_0x1e9ec6,_0x23e838,_0x120d69,_0x27d564){var _0x160167,_0x4eaeb1,_0x11f4e9,_0x7adb8a;_0x27d564[_0xb818('0x50')]=intUtil['stripTrailingSlash'](_0x27d564[_0xb818('0x50')]);_0x27d564[_0xb818('0x51')]=intUtil[_0xb818('0x52')](_0x27d564['serverUrl']);def[_0xb818('0x53')]=util[_0xb818('0x21')](_0xb818('0x54'),_0x27d564['remoteUri']);if(_0x120d69&&_0x120d69[_0xb818('0x55')]){logger[_0xb818('0xc')](_0xb818('0x56'),_0xb818('0x57'));_0x3969ed[_0xb818('0x58')]=util[_0xb818('0x21')](_0xb818('0x59'),_0x27d564[_0xb818('0x51')],_0x3969ed['uniqueid'],md5(_0x3969ed['uniqueid']));}else{_0x3969ed[_0xb818('0x58')]='';}return getConnection(_0x27d564)[_0xb818('0x2b')](function(_0x4f0f09){_0x7adb8a=_0x4f0f09;return getUser(_0x27d564,_0x23e838[_0xb818('0xe')],_0x7adb8a);})['then'](function(_0x52c1e3){_0x160167=_0x52c1e3;logger[_0xb818('0xc')](_0xb818('0x5a'),_0x160167['id']);return getEndUser(_0x27d564,_0x3969ed[_0xb818('0x5b')],_0x3969ed[_0xb818('0x5c')],_0x7adb8a);})[_0xb818('0x2b')](function(_0x110221){_0x4eaeb1=_0x110221;logger[_0xb818('0xc')](_0xb818('0x5d'),_0x4eaeb1['id']);return getTicket(_0x27d564,_0x160167,_0x4eaeb1,_0x1e9ec6,_0x3969ed,_0x1e9ec6[_0xb818('0x5e')],_0x7adb8a,_0xb818('0x5f'));})[_0xb818('0x2b')](function(_0x2fcf47){_0x11f4e9=_0x2fcf47;logger[_0xb818('0xc')](_0xb818('0x60'));logger[_0xb818('0xc')]('The\x20Ticket\x20ID\x20is:',_0x11f4e9['id']);return setRelationship(_0x7adb8a,_0x160167,_0x11f4e9,_0xb818('0x61'));})[_0xb818('0x2b')](function(){return setRelationship(_0x7adb8a,_0x4eaeb1,_0x11f4e9,_0xb818('0x62'));})[_0xb818('0x2b')](function(){return getServerInfo(_0x7adb8a);})[_0xb818('0x2b')](function(_0x3d30ef){var _0x4ccc91=parseInt(_0x3d30ef[_0xb818('0x63')][_0xb818('0x64')](0x0));var _0x41f386=util[_0xb818('0x21')](_0xb818('0x65'),_0x27d564['remoteUri'],_0x11f4e9['id']);if(_0x4ccc91>0x6){_0x41f386=util[_0xb818('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x27d564[_0xb818('0x50')],_0x11f4e9['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb818('0x21')]('user:%s',_0x23e838['name']),_0xb818('0x66'),{'uri':_0x41f386});})[_0xb818('0x67')](function(_0x44bbed){logger[_0xb818('0x68')](_0xb818('0x56'),JSON[_0xb818('0x1f')](_0x44bbed));});};exports[_0xb818('0x69')]=function(_0xd308dc,_0x2fd9b9,_0x206d40,_0x3230df,_0x4fcaf2,_0x84666e,_0x3bf678){var _0x5f5101,_0x44bb8d,_0x56a6f4,_0x545939;_0x84666e[_0xb818('0x50')]=intUtil[_0xb818('0x52')](_0x84666e[_0xb818('0x50')]);_0x84666e[_0xb818('0x51')]=intUtil[_0xb818('0x52')](_0x84666e[_0xb818('0x51')]);def[_0xb818('0x53')]=util['format'](_0xb818('0x54'),_0x84666e[_0xb818('0x50')]);if(_0x3bf678&&_0x3bf678['recordingFormat']&&_0x3bf678['recordingFormat']!==_0xb818('0x6a')){logger[_0xb818('0xc')](_0xb818('0x6b'),_0xb818('0x57'));_0x2fd9b9['recordingURL']=util[_0xb818('0x21')](_0xb818('0x59'),_0x84666e[_0xb818('0x51')],_0x2fd9b9[_0xb818('0x6c')],md5(_0x2fd9b9[_0xb818('0x6c')]));}return getConnection(_0x84666e)[_0xb818('0x2b')](function(_0xe7d6a9){_0x545939=_0xe7d6a9;return getUser(_0x84666e,_0x3230df['name'],_0x545939);})[_0xb818('0x2b')](function(_0x28118d){_0x5f5101=_0x28118d;logger[_0xb818('0xc')]('The\x20User\x20ID\x20is:',_0x5f5101['id']);return getEndUser(_0x84666e,_0x2fd9b9[_0xb818('0x6d')],_0x2fd9b9[_0xb818('0x6e')],_0x545939);})[_0xb818('0x2b')](function(_0x4cd72e){_0x44bb8d=_0x4cd72e;logger[_0xb818('0xc')](_0xb818('0x5d'),_0x44bb8d['id']);return getTicket(_0x84666e,_0x5f5101,_0x44bb8d,_0x206d40,_0x2fd9b9,_0x206d40[_0xb818('0x5e')],_0x545939,'Outbound');})[_0xb818('0x2b')](function(_0xe1b804){_0x56a6f4=_0xe1b804;logger[_0xb818('0xc')](_0xb818('0x60'));logger[_0xb818('0xc')](_0xb818('0x6f'),_0x56a6f4['id']);return setRelationship(_0x545939,_0x5f5101,_0x56a6f4,_0xb818('0x61'));})[_0xb818('0x2b')](function(){return setRelationship(_0x545939,_0x44bb8d,_0x56a6f4,_0xb818('0x62'));})['then'](function(){return getServerInfo(_0x545939);})[_0xb818('0x2b')](function(_0x55848f){var _0x242b7c=parseInt(_0x55848f[_0xb818('0x63')]['charAt'](0x0));var _0x275f4d=util[_0xb818('0x21')](_0xb818('0x65'),_0x84666e['remoteUri'],_0x56a6f4['id']);if(_0x242b7c>0x6){_0x275f4d=util['format'](_0xb818('0x70'),_0x84666e[_0xb818('0x50')],_0x56a6f4['id']);}logger['info']('[OUTBOUND]',_0xb818('0x71'));emit(util[_0xb818('0x21')](_0xb818('0x72'),_0x3230df['name']),_0xb818('0x66'),{'uri':_0x275f4d});})[_0xb818('0x67')](function(_0x35dd36){logger['error'](_0xb818('0x6b'),JSON[_0xb818('0x1f')](_0x35dd36));});};exports[_0xb818('0x73')]=function(_0x45cc69,_0x23307c,_0xf91dcc,_0x4ff92d,_0x230ef9,_0x167709){var _0x15e4ef,_0x323df8,_0x36e1e1,_0x2057dc;_0x167709[_0xb818('0x50')]=intUtil[_0xb818('0x52')](_0x167709[_0xb818('0x50')]);_0x167709[_0xb818('0x51')]=intUtil[_0xb818('0x52')](_0x167709['serverUrl']);def[_0xb818('0x53')]=util[_0xb818('0x21')](_0xb818('0x54'),_0x167709[_0xb818('0x50')]);if(_0x230ef9&&_0x230ef9[_0xb818('0x55')]){logger['info']('['+_0x23307c[_0xb818('0x74')][_0xb818('0x75')]()+']',_0xb818('0x57'));_0x23307c[_0xb818('0x58')]=util[_0xb818('0x21')](_0xb818('0x59'),_0x167709['serverUrl'],_0x23307c[_0xb818('0x6c')],md5(_0x23307c[_0xb818('0x6c')]));}else{_0x23307c[_0xb818('0x58')]='';}return getConnection(_0x167709)[_0xb818('0x2b')](function(_0x40545){_0x2057dc=_0x40545;if(!_['isNil'](_0x4ff92d)){return getUser(_0x167709,_0x4ff92d['name'],_0x2057dc);}else{return getUser(_0x167709,null,_0x2057dc);}})['then'](function(_0x1b54d1){_0x15e4ef=_0x1b54d1;logger['info'](_0xb818('0x5a'),_0x15e4ef['id']);return getEndUser(_0x167709,_0x23307c['calleridname'],_0x23307c[_0xb818('0x5c')],_0x2057dc);})[_0xb818('0x2b')](function(_0x4cbc93){_0x323df8=_0x4cbc93;logger[_0xb818('0xc')](_0xb818('0x5d'),_0x323df8['id']);return getTicket(_0x167709,_0x15e4ef,_0x323df8,_0xf91dcc,_0x23307c,_0xf91dcc[_0xb818('0x5e')],_0x2057dc,_0xb818('0x5f'));})[_0xb818('0x2b')](function(_0xe62290){_0x36e1e1=_0xe62290;logger[_0xb818('0xc')](_0xb818('0x60'));logger['info'](_0xb818('0x6f'),_0x36e1e1['id']);return setRelationship(_0x2057dc,_0x15e4ef,_0x36e1e1,_0xb818('0x61'));})[_0xb818('0x2b')](function(){return setRelationship(_0x2057dc,_0x323df8,_0x36e1e1,_0xb818('0x62'));})[_0xb818('0x2b')](function(){return getServerInfo(_0x2057dc);})[_0xb818('0x67')](function(_0x3bdb19){logger[_0xb818('0x68')]('['+_0x23307c[_0xb818('0x74')][_0xb818('0x75')]()+']',JSON[_0xb818('0x1f')](_0x3bdb19));});}; \ No newline at end of file +var _0x1de9=['unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','getString','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','push','variableName','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','user_name','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','customField','toLowerCase','content','idField','custom_fields','variable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','uri','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','catch'];(function(_0x3fc7c1,_0x4d6afd){var _0x9f8580=function(_0x26a4fa){while(--_0x26a4fa){_0x3fc7c1['push'](_0x3fc7c1['shift']());}};_0x9f8580(++_0x4d6afd);}(_0x1de9,0x7a));var _0x91de=function(_0x555949,_0x3bff24){_0x555949=_0x555949-0x0;var _0x435f5f=_0x1de9[_0x555949];return _0x435f5f;};'use strict';var _=require(_0x91de('0x0'));var rp=require(_0x91de('0x1'));var BPromise=require(_0x91de('0x2'));var md5=require(_0x91de('0x3'));var util=require(_0x91de('0x4'));var Redis=require(_0x91de('0x5'));var intUtil=require(_0x91de('0x6'));var config=require(_0x91de('0x7'));var logger=require(_0x91de('0x8'))(_0x91de('0x9'));config[_0x91de('0xa')]=_['defaults'](config[_0x91de('0xa')],{'host':_0x91de('0xb'),'port':0x18eb});var io=require(_0x91de('0xc'))(new Redis(config[_0x91de('0xa')]));var def={'method':_0x91de('0xd'),'json':!![]};function emit(_0x43eda1,_0x50f5ae,_0x4effc4){io['to'](_0x43eda1)[_0x91de('0xe')](_0x50f5ae,_0x4effc4);}function getTicket(_0x5788df,_0x2500e7,_0x37b8dd,_0x86ea17,_0x38e5bb,_0x585e0e,_0x12da7c,_0x1d09d6){logger[_0x91de('0xf')](_0x91de('0x10'));var _0x268187=new Date();var _0x3bc171=[{'name':_0x91de('0x11'),'value':intUtil['getString'](_0x86ea17['Subjects'],_0x38e5bb,'\x20')},{'name':_0x91de('0x12'),'value':_0x2500e7['id']},{'name':_0x91de('0x13'),'value':_0x2500e7['id']},{'name':'description','value':intUtil[_0x91de('0x14')](_0x86ea17['Descriptions'],_0x38e5bb,'\x0a')},{'name':_0x91de('0x15'),'value':_0x268187[_0x91de('0x16')]()[_0x91de('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0x91de('0x18'),'value':'0'},{'name':_0x91de('0x19'),'value':'15'},{'name':_0x91de('0x1a'),'value':_0x37b8dd['id']},{'name':_0x91de('0x1b'),'value':_0x91de('0x1c')},{'name':_0x91de('0x1d'),'value':_0x37b8dd[_0x91de('0x11')]},{'name':'direction','value':_0x1d09d6}];if(_0x585e0e[_0x91de('0x1e')]){_['forEach'](_0x585e0e,function(_0x5b6606){if(_0x38e5bb[_0x5b6606['variableName']]){_0x3bc171[_0x91de('0x1f')]({'name':_0x5b6606['idField'],'value':_0x38e5bb[_0x5b6606[_0x91de('0x20')]]});}});}return request({'form':{'method':_0x91de('0x21'),'input_type':_0x91de('0x22'),'response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'session':_0x12da7c['id'],'module_name':_0x91de('0x24'),'name_value_list':_0x3bc171})}});}function getAuth(_0x4f388b){return util[_0x91de('0x25')]('Basic\x20%s',new Buffer(_0x4f388b['apiKey']+':X')[_0x91de('0x26')](_0x91de('0x27')));}function getServerInfo(_0x4ea18c){return request({'form':{'method':_0x91de('0x28'),'input_type':_0x91de('0x22'),'response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'session':_0x4ea18c['id']})}});}function getUser(_0x173771,_0x288a6f,_0x42de5e){if(!_['isNil'](_0x288a6f)){logger['info']('Getting\x20agent\x20with\x20name',_0x288a6f);return request({'form':{'method':_0x91de('0x29'),'input_type':_0x91de('0x22'),'response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'session':_0x42de5e['id'],'module_name':_0x91de('0x2a'),'query':util['format'](_0x91de('0x2b'),_0x288a6f),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x91de('0x2c')](function(_0x1a28f0){if(_0x1a28f0[_0x91de('0x2d')][_0x91de('0x1e')]){var _0x3622a2=_['find'](_0x1a28f0[_0x91de('0x2d')],function(_0x211ea8){return _0x211ea8['name_value_list'][_0x91de('0x2e')][_0x91de('0x2f')]===_0x288a6f;});if(_0x3622a2){logger[_0x91de('0xf')]('Agent\x20found!');return BPromise[_0x91de('0x30')]({'id':_0x3622a2[_0x91de('0x31')]['id'][_0x91de('0x2f')],'name':_0x3622a2[_0x91de('0x31')][_0x91de('0x11')][_0x91de('0x2f')]});}}logger['info'](_0x91de('0x32'));return BPromise['resolve']({'id':_0x42de5e['name_value_list'][_0x91de('0x33')][_0x91de('0x2f')],'name':_0x42de5e[_0x91de('0x31')][_0x91de('0x2e')][_0x91de('0x2f')]});});}else{logger[_0x91de('0xf')](_0x91de('0x34'));return BPromise['resolve']({'id':_0x42de5e[_0x91de('0x31')][_0x91de('0x33')][_0x91de('0x2f')],'name':_0x42de5e[_0x91de('0x31')][_0x91de('0x2e')][_0x91de('0x2f')]});}}function getEndUser(_0xdc6ec2,_0x4ec402,_0x2db49c,_0x4afa25){logger[_0x91de('0xf')]('Searching\x20enduser\x20with\x20phone',_0x2db49c);return request({'form':{'method':'get_entry_list','input_type':_0x91de('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4afa25['id'],'module_name':_0x91de('0x1c'),'query':util[_0x91de('0x25')](_0x91de('0x35'),_0x2db49c),'order_by':'','offset':'0','select_fields':['id','name',_0x91de('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x91de('0x2c')](function(_0x26051f){if(_0x26051f[_0x91de('0x2d')][_0x91de('0x1e')]){var _0x432f31=_[_0x91de('0x37')](_0x26051f[_0x91de('0x2d')],function(_0x2cbc1e){return _0x2cbc1e[_0x91de('0x31')][_0x91de('0x36')][_0x91de('0x2f')]===_0x2db49c;});if(_0x432f31){logger[_0x91de('0xf')](_0x91de('0x38'));return BPromise[_0x91de('0x30')]({'id':_0x432f31[_0x91de('0x31')]['id'][_0x91de('0x2f')],'name':_0x432f31[_0x91de('0x31')][_0x91de('0x11')]['value'],'phone':_0x432f31[_0x91de('0x31')][_0x91de('0x36')][_0x91de('0x2f')]});}}else{logger[_0x91de('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x91de('0x21'),'input_type':'JSON','response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'session':_0x4afa25['id'],'module_name':_0x91de('0x1c'),'name_value_list':[{'name':_0x91de('0x39'),'value':_0x4ec402!==_0x91de('0x3a')?_0x4ec402:util[_0x91de('0x25')]('Caller\x20-\x20%s',_0x2db49c)},{'name':_0x91de('0x36'),'value':_0x2db49c}]})}})[_0x91de('0x2c')](function(_0x48db0b){logger[_0x91de('0xf')](_0x91de('0x3b'));return BPromise[_0x91de('0x30')]({'id':_0x48db0b['id'],'name':_0x48db0b[_0x91de('0x2d')]['first_name'][_0x91de('0x2f')],'phone':_0x48db0b['entry_list'][_0x91de('0x36')]['value']});});}});}function request(_0x3ae414){logger[_0x91de('0x3c')](_0x91de('0x3d'),JSON[_0x91de('0x23')](_0x3ae414));return rp(_[_0x91de('0x3e')](def,_0x3ae414));}function getTags(_0x3f56db,_0x1a28a2){var _0x5dad7a=[];if(_0x3f56db&&_0x3f56db['length']>0x0){_0x5dad7a=_[_0x91de('0x3f')](_0x3f56db,_0x1a28a2);}return _0x5dad7a;}function getCustomFields(_0x2a014c,_0x3d47b7){var _0x3772b3=[];var _0x1122ef={'custom_fields':[]};if(_0x2a014c[_0x91de('0x1e')]>0x0){_[_0x91de('0x40')](_0x2a014c,function(_0x34c6e7){if(_0x34c6e7[_0x91de('0x41')]==='string'&&_0x34c6e7['nameField']&&!_0x34c6e7[_0x91de('0x42')]){_0x1122ef[_0x34c6e7['nameField'][_0x91de('0x43')]()]=_0x34c6e7[_0x91de('0x44')][_0x91de('0x26')]();}else if(_0x34c6e7[_0x91de('0x41')]==='string'&&_0x34c6e7[_0x91de('0x45')]&&_0x34c6e7['customField']){_0x1122ef[_0x91de('0x46')]['push']({'id':_0x34c6e7['idField'],'value':_0x34c6e7[_0x91de('0x44')][_0x91de('0x26')]()});}else if(_0x34c6e7[_0x91de('0x41')]===_0x91de('0x47')&&_0x34c6e7[_0x91de('0x20')]&&_0x34c6e7[_0x91de('0x45')]&&_0x34c6e7['customField']){_0x3d47b7[_0x34c6e7[_0x91de('0x20')]]&&_0x1122ef['custom_fields'][_0x91de('0x1f')]({'id':_0x34c6e7[_0x91de('0x45')],'value':_0x3d47b7[_0x34c6e7['variableName']][_0x91de('0x26')]()});}else if(_0x34c6e7[_0x91de('0x41')]==='customVariable'&&_0x34c6e7[_0x91de('0x48')]&&_0x34c6e7[_0x91de('0x48')][_0x91de('0x11')]&&_0x34c6e7[_0x91de('0x45')]&&_0x34c6e7['customField']){_0x3d47b7[_0x34c6e7['Variable']['name']['toLowerCase']()]&&_0x1122ef[_0x91de('0x46')][_0x91de('0x1f')]({'id':_0x34c6e7['idField'],'value':_0x3d47b7[_0x34c6e7[_0x91de('0x48')][_0x91de('0x11')][_0x91de('0x43')]()][_0x91de('0x26')]()});}});}return _0x1122ef;}function getConnection(_0x4d0228){return request({'method':'POST','form':{'method':_0x91de('0x49'),'input_type':_0x91de('0x22'),'response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'user_auth':{'user_name':_0x4d0228['username'],'password':_0x4d0228[_0x91de('0x4a')],'encryption':_0x91de('0x4b')},'application':_0x91de('0x4c')})}})[_0x91de('0x2c')](function(_0x423cd6){var _0x35e84a=_0x423cd6;if(_0x35e84a['id']){def[_0x91de('0x4d')]=_0x35e84a['id'];return BPromise[_0x91de('0x30')](_0x35e84a);}else{throw new Error(util[_0x91de('0x25')](_0x91de('0x4e'),_0x4d0228['id']));}});}function setRelationship(_0x30df2a,_0x1e5e5f,_0x5af5ab,_0x519bde){return request({'form':{'method':_0x91de('0x4f'),'input_type':_0x91de('0x22'),'response_type':_0x91de('0x22'),'rest_data':JSON[_0x91de('0x23')]({'session':_0x30df2a['id'],'module_name':_0x91de('0x24'),'module_id':_0x5af5ab['id'],'link_field_name':_0x519bde,'related_ids':[_0x1e5e5f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x91de('0x50')]=function(_0x4888bd,_0x189617,_0x47e909,_0x5736fe,_0x56ccfe,_0x25df4c){var _0x9989e4,_0x55125e,_0x12449f,_0x2461c0;_0x25df4c[_0x91de('0x51')]=intUtil[_0x91de('0x52')](_0x25df4c['remoteUri']);_0x25df4c[_0x91de('0x53')]=intUtil[_0x91de('0x52')](_0x25df4c[_0x91de('0x53')]);def['uri']=util[_0x91de('0x25')](_0x91de('0x54'),_0x25df4c[_0x91de('0x51')]);if(_0x56ccfe&&_0x56ccfe[_0x91de('0x55')]){logger['info'](_0x91de('0x56'),_0x91de('0x57'));_0x189617[_0x91de('0x58')]=util[_0x91de('0x25')](_0x91de('0x59'),_0x25df4c[_0x91de('0x53')],_0x189617[_0x91de('0x5a')],md5(_0x189617[_0x91de('0x5a')]));}else{_0x189617['recordingURL']='';}return getConnection(_0x25df4c)[_0x91de('0x2c')](function(_0x4e829f){_0x2461c0=_0x4e829f;return getUser(_0x25df4c,_0x5736fe['name'],_0x2461c0);})[_0x91de('0x2c')](function(_0x530dc2){_0x9989e4=_0x530dc2;logger[_0x91de('0xf')]('The\x20User\x20ID\x20is:',_0x9989e4['id']);return getEndUser(_0x25df4c,_0x189617[_0x91de('0x5b')],_0x189617[_0x91de('0x5c')],_0x2461c0);})[_0x91de('0x2c')](function(_0x1672a1){_0x55125e=_0x1672a1;logger[_0x91de('0xf')](_0x91de('0x5d'),_0x55125e['id']);return getTicket(_0x25df4c,_0x9989e4,_0x55125e,_0x47e909,_0x189617,_0x47e909[_0x91de('0x5e')],_0x2461c0,_0x91de('0x5f'));})['then'](function(_0x40726b){_0x12449f=_0x40726b;logger[_0x91de('0xf')](_0x91de('0x60'));logger[_0x91de('0xf')](_0x91de('0x61'),_0x12449f['id']);return setRelationship(_0x2461c0,_0x9989e4,_0x12449f,_0x91de('0x62'));})[_0x91de('0x2c')](function(){return setRelationship(_0x2461c0,_0x55125e,_0x12449f,'contacts');})[_0x91de('0x2c')](function(){return getServerInfo(_0x2461c0);})['then'](function(_0x12fad7){var _0x1fa6f2=parseInt(_0x12fad7[_0x91de('0x63')][_0x91de('0x64')](0x0));var _0x5f0c1e=util['format'](_0x91de('0x65'),_0x25df4c['remoteUri'],_0x12449f['id']);if(_0x1fa6f2>0x6){_0x5f0c1e=util[_0x91de('0x25')](_0x91de('0x66'),_0x25df4c[_0x91de('0x51')],_0x12449f['id']);}logger['info']('[QUEUE]',_0x91de('0x67'));emit(util[_0x91de('0x25')](_0x91de('0x68'),_0x5736fe[_0x91de('0x11')]),'trigger:browser:url',{'uri':_0x5f0c1e});})['catch'](function(_0x1f1641){logger[_0x91de('0x69')](_0x91de('0x56'),JSON[_0x91de('0x23')](_0x1f1641));});};exports['outbound']=function(_0x4f3dd4,_0x4b2b2e,_0x166fd3,_0x189e5e,_0x5d29f7,_0x5f510e,_0x1140a9){var _0x18ea88,_0x1f0d83,_0x3256cf,_0x25a1db;_0x5f510e[_0x91de('0x51')]=intUtil['stripTrailingSlash'](_0x5f510e[_0x91de('0x51')]);_0x5f510e['serverUrl']=intUtil[_0x91de('0x52')](_0x5f510e[_0x91de('0x53')]);def[_0x91de('0x6a')]=util[_0x91de('0x25')](_0x91de('0x54'),_0x5f510e[_0x91de('0x51')]);if(_0x1140a9&&_0x1140a9[_0x91de('0x6b')]&&_0x1140a9['recordingFormat']!=='none'){logger['info'](_0x91de('0x6c'),_0x91de('0x57'));_0x4b2b2e['recordingURL']=util['format'](_0x91de('0x59'),_0x5f510e['serverUrl'],_0x4b2b2e['uniqueid'],md5(_0x4b2b2e['uniqueid']));}return getConnection(_0x5f510e)[_0x91de('0x2c')](function(_0x58d472){_0x25a1db=_0x58d472;return getUser(_0x5f510e,_0x189e5e[_0x91de('0x11')],_0x25a1db);})[_0x91de('0x2c')](function(_0xbea444){_0x18ea88=_0xbea444;logger[_0x91de('0xf')]('The\x20User\x20ID\x20is:',_0x18ea88['id']);return getEndUser(_0x5f510e,_0x4b2b2e[_0x91de('0x6d')],_0x4b2b2e[_0x91de('0x6e')],_0x25a1db);})['then'](function(_0x493494){_0x1f0d83=_0x493494;logger[_0x91de('0xf')](_0x91de('0x5d'),_0x1f0d83['id']);return getTicket(_0x5f510e,_0x18ea88,_0x1f0d83,_0x166fd3,_0x4b2b2e,_0x166fd3['Fields'],_0x25a1db,_0x91de('0x6f'));})[_0x91de('0x2c')](function(_0x2eccfd){_0x3256cf=_0x2eccfd;logger[_0x91de('0xf')](_0x91de('0x60'));logger[_0x91de('0xf')](_0x91de('0x61'),_0x3256cf['id']);return setRelationship(_0x25a1db,_0x18ea88,_0x3256cf,_0x91de('0x62'));})[_0x91de('0x2c')](function(){return setRelationship(_0x25a1db,_0x1f0d83,_0x3256cf,'contacts');})['then'](function(){return getServerInfo(_0x25a1db);})[_0x91de('0x2c')](function(_0x5f6b9d){var _0x245e6c=parseInt(_0x5f6b9d[_0x91de('0x63')][_0x91de('0x64')](0x0));var _0x103340=util[_0x91de('0x25')](_0x91de('0x65'),_0x5f510e[_0x91de('0x51')],_0x3256cf['id']);if(_0x245e6c>0x6){_0x103340=util[_0x91de('0x25')](_0x91de('0x66'),_0x5f510e[_0x91de('0x51')],_0x3256cf['id']);}logger[_0x91de('0xf')](_0x91de('0x6c'),_0x91de('0x67'));emit(util[_0x91de('0x25')](_0x91de('0x68'),_0x189e5e['name']),_0x91de('0x70'),{'uri':_0x103340});})[_0x91de('0x71')](function(_0x5e51c9){logger[_0x91de('0x69')]('[OUTBOUND]',JSON[_0x91de('0x23')](_0x5e51c9));});};exports[_0x91de('0x72')]=function(_0xc7cd6f,_0x35f64d,_0x1f1cb5,_0x111a8c,_0x12d270,_0x599142){var _0x3f1fb8,_0x29be6e,_0x5ce2d7,_0xcf9bf2;_0x599142['remoteUri']=intUtil[_0x91de('0x52')](_0x599142[_0x91de('0x51')]);_0x599142[_0x91de('0x53')]=intUtil[_0x91de('0x52')](_0x599142[_0x91de('0x53')]);def[_0x91de('0x6a')]=util[_0x91de('0x25')](_0x91de('0x54'),_0x599142[_0x91de('0x51')]);if(_0x12d270&&_0x12d270[_0x91de('0x55')]){logger[_0x91de('0xf')]('['+_0x35f64d[_0x91de('0x73')][_0x91de('0x74')]()+']','Recording\x20is\x20enabled!');_0x35f64d['recordingURL']=util['format'](_0x91de('0x59'),_0x599142[_0x91de('0x53')],_0x35f64d[_0x91de('0x5a')],md5(_0x35f64d[_0x91de('0x5a')]));}else{_0x35f64d['recordingURL']='';}return getConnection(_0x599142)['then'](function(_0x1af500){_0xcf9bf2=_0x1af500;if(!_['isNil'](_0x111a8c)){return getUser(_0x599142,_0x111a8c[_0x91de('0x11')],_0xcf9bf2);}else{return getUser(_0x599142,null,_0xcf9bf2);}})[_0x91de('0x2c')](function(_0x7245ad){_0x3f1fb8=_0x7245ad;logger['info'](_0x91de('0x75'),_0x3f1fb8['id']);return getEndUser(_0x599142,_0x35f64d[_0x91de('0x5b')],_0x35f64d[_0x91de('0x5c')],_0xcf9bf2);})[_0x91de('0x2c')](function(_0x42427d){_0x29be6e=_0x42427d;logger[_0x91de('0xf')](_0x91de('0x5d'),_0x29be6e['id']);return getTicket(_0x599142,_0x3f1fb8,_0x29be6e,_0x1f1cb5,_0x35f64d,_0x1f1cb5['Fields'],_0xcf9bf2,_0x91de('0x5f'));})['then'](function(_0x418059){_0x5ce2d7=_0x418059;logger['info']('Ticket\x20created!');logger[_0x91de('0xf')]('The\x20Ticket\x20ID\x20is:',_0x5ce2d7['id']);return setRelationship(_0xcf9bf2,_0x3f1fb8,_0x5ce2d7,_0x91de('0x62'));})[_0x91de('0x2c')](function(){return setRelationship(_0xcf9bf2,_0x29be6e,_0x5ce2d7,'contacts');})[_0x91de('0x2c')](function(){return getServerInfo(_0xcf9bf2);})['catch'](function(_0x4ea9d7){logger[_0x91de('0x69')]('['+_0x35f64d['lastevent'][_0x91de('0x74')]()+']',JSON[_0x91de('0x23')](_0x4ea9d7));});}; \ 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 2d91df0..de0c140 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 _0xdf80=['key','keyContent','format','%s:\x20%s','join','substring','validateEmail','test','lodash','util','getString','sortBy','length','push','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyValue','keyType','string'];(function(_0x268f37,_0x41dc4d){var _0x15174b=function(_0x5599e6){while(--_0x5599e6){_0x268f37['push'](_0x268f37['shift']());}};_0x15174b(++_0x41dc4d);}(_0xdf80,0xa4));var _0x0df8=function(_0x270c25,_0x2f0ed7){_0x270c25=_0x270c25-0x0;var _0x3c8aa2=_0xdf80[_0x270c25];return _0x3c8aa2;};'use strict';var _=require(_0x0df8('0x0'));var util=require(_0x0df8('0x1'));exports[_0x0df8('0x2')]=function(_0x2b8f31,_0x51da0f,_0x9a840f){var _0x5cbc21=[];if(_0x2b8f31['length']>0x0){var _0x55adc0=_[_0x0df8('0x3')](_0x2b8f31,['id']);for(var _0x42461a=0x0;_0x42461a<_0x55adc0[_0x0df8('0x4')];_0x42461a++){var _0x537495=_0x55adc0[_0x42461a];if(_0x537495['type']==='string'){_0x5cbc21[_0x0df8('0x5')](_0x537495[_0x0df8('0x6')]);}else if(_0x537495['type']===_0x0df8('0x7')&&_0x537495[_0x0df8('0x8')]){_0x51da0f[_0x537495[_0x0df8('0x8')]]&&_0x5cbc21['push'](_0x51da0f[_0x537495['variableName']][_0x0df8('0x9')]());}else if(_0x537495[_0x0df8('0xa')]===_0x0df8('0xb')&&_0x537495[_0x0df8('0xc')]&&_0x537495[_0x0df8('0xc')][_0x0df8('0xd')]){_0x51da0f[_0x537495[_0x0df8('0xc')][_0x0df8('0xd')][_0x0df8('0xe')]()]&&_0x5cbc21[_0x0df8('0x5')](_0x51da0f[_0x537495[_0x0df8('0xc')][_0x0df8('0xd')][_0x0df8('0xe')]()][_0x0df8('0x9')]());}else if(_0x537495['type']===_0x0df8('0xf')){if(_0x537495[_0x0df8('0x10')]===_0x0df8('0x11')&&_0x537495[_0x0df8('0x12')]){_0x5cbc21['push'](util['format']('%s:\x20%s',_0x537495['key'],_0x537495[_0x0df8('0x13')]));}else if(_0x537495[_0x0df8('0x10')]===_0x0df8('0x7')&&_0x537495['variableName']&&_0x537495[_0x0df8('0x12')]){_0x51da0f[_0x537495[_0x0df8('0x8')]]&&_0x5cbc21[_0x0df8('0x5')](util[_0x0df8('0x14')]('%s:\x20%s',_0x537495[_0x0df8('0x12')],_0x51da0f[_0x537495[_0x0df8('0x8')]]));}else if(_0x537495[_0x0df8('0x10')]==='customVariable'&&_0x537495[_0x0df8('0xc')]&&_0x537495[_0x0df8('0xc')][_0x0df8('0xd')]&&_0x537495[_0x0df8('0x12')]){_0x51da0f[_0x537495[_0x0df8('0xc')]['name']['toLowerCase']()]&&_0x5cbc21[_0x0df8('0x5')](util[_0x0df8('0x14')](_0x0df8('0x15'),_0x537495[_0x0df8('0x12')],_0x51da0f[_0x537495[_0x0df8('0xc')]['name'][_0x0df8('0xe')]()]));}}}}return _0x5cbc21[_0x0df8('0x16')](_0x9a840f);};exports['stripTrailingSlash']=function(_0x1be5d2){var _0x5c547c=_0x1be5d2['slice'](-0x1);if(_0x5c547c==='/'){_0x1be5d2=_0x1be5d2[_0x0df8('0x17')](0x0,_0x1be5d2['lastIndexOf'](_0x5c547c));}return _0x1be5d2;};exports[_0x0df8('0x18')]=function(_0x1353fc){if(!_['isNil'](_0x1353fc)&&_0x1353fc!==''){var _0x580eb4=/^(([^<>()\[\]\\.,;:\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 _0x580eb4[_0x0df8('0x19')](String(_0x1353fc)[_0x0df8('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xd9f4=['variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','variable','customVariable','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','getString','length','type'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0xd9f4,0xc4));var _0x4d9f=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xd9f4[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x4d9f('0x0'));var util=require('util');exports[_0x4d9f('0x1')]=function(_0x9aeee,_0x9f2b02,_0x617fff){var _0x35a676=[];if(_0x9aeee[_0x4d9f('0x2')]>0x0){var _0x38c9ad=_['sortBy'](_0x9aeee,['id']);for(var _0x552415=0x0;_0x552415<_0x38c9ad['length'];_0x552415++){var _0x7014f=_0x38c9ad[_0x552415];if(_0x7014f[_0x4d9f('0x3')]==='string'){_0x35a676['push'](_0x7014f['content']);}else if(_0x7014f['type']==='variable'&&_0x7014f[_0x4d9f('0x4')]){_0x9f2b02[_0x7014f[_0x4d9f('0x4')]]&&_0x35a676[_0x4d9f('0x5')](_0x9f2b02[_0x7014f[_0x4d9f('0x4')]][_0x4d9f('0x6')]());}else if(_0x7014f['type']==='customVariable'&&_0x7014f[_0x4d9f('0x7')]&&_0x7014f['Variable']['name']){_0x9f2b02[_0x7014f[_0x4d9f('0x7')][_0x4d9f('0x8')][_0x4d9f('0x9')]()]&&_0x35a676[_0x4d9f('0x5')](_0x9f2b02[_0x7014f['Variable'][_0x4d9f('0x8')][_0x4d9f('0x9')]()][_0x4d9f('0x6')]());}else if(_0x7014f[_0x4d9f('0x3')]===_0x4d9f('0xa')){if(_0x7014f[_0x4d9f('0xb')]===_0x4d9f('0xc')&&_0x7014f[_0x4d9f('0xd')]){_0x35a676['push'](util[_0x4d9f('0xe')](_0x4d9f('0xf'),_0x7014f[_0x4d9f('0xd')],_0x7014f[_0x4d9f('0x10')]));}else if(_0x7014f[_0x4d9f('0xb')]===_0x4d9f('0x11')&&_0x7014f[_0x4d9f('0x4')]&&_0x7014f[_0x4d9f('0xd')]){_0x9f2b02[_0x7014f[_0x4d9f('0x4')]]&&_0x35a676['push'](util[_0x4d9f('0xe')](_0x4d9f('0xf'),_0x7014f['key'],_0x9f2b02[_0x7014f[_0x4d9f('0x4')]]));}else if(_0x7014f[_0x4d9f('0xb')]===_0x4d9f('0x12')&&_0x7014f['Variable']&&_0x7014f[_0x4d9f('0x7')]['name']&&_0x7014f[_0x4d9f('0xd')]){_0x9f2b02[_0x7014f[_0x4d9f('0x7')]['name'][_0x4d9f('0x9')]()]&&_0x35a676['push'](util[_0x4d9f('0xe')](_0x4d9f('0xf'),_0x7014f['key'],_0x9f2b02[_0x7014f[_0x4d9f('0x7')][_0x4d9f('0x8')][_0x4d9f('0x9')]()]));}}}}return _0x35a676[_0x4d9f('0x13')](_0x617fff);};exports[_0x4d9f('0x14')]=function(_0x49f675){var _0x1a67f9=_0x49f675['slice'](-0x1);if(_0x1a67f9==='/'){_0x49f675=_0x49f675[_0x4d9f('0x15')](0x0,_0x49f675[_0x4d9f('0x16')](_0x1a67f9));}return _0x49f675;};exports['validateEmail']=function(_0x11bdd3){if(!_[_0x4d9f('0x17')](_0x11bdd3)&&_0x11bdd3!==''){var _0x2fcb3c=/^(([^<>()\[\]\\.,;:\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 _0x2fcb3c[_0x4d9f('0x18')](String(_0x11bdd3)[_0x4d9f('0x9')]());}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 fc5997f..28cdbe5 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','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]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x126931,_0x2fa7cf){var _0x26ff5b=function(_0x34bdca){while(--_0x34bdca){_0x126931['push'](_0x126931['shift']());}};_0x26ff5b(++_0x2fa7cf);}(_0x34e8,0x12c));var _0x834e=function(_0x494e87,_0x34dac1){_0x494e87=_0x494e87-0x0;var _0x4fce0a=_0x34e8[_0x494e87];return _0x4fce0a;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ 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 77a0450..5e5a5c6 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 _0xe0d2=['user:%s','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','merge','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','authType','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','idField','push','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe0d2,0xe7));var _0x2e0d=function(_0x3f60da,_0x3e924e){_0x3f60da=_0x3f60da-0x0;var _0x3d5e0c=_0xe0d2[_0x3f60da];return _0x3d5e0c;};'use strict';var _=require('lodash');var rp=require(_0x2e0d('0x0'));var md5=require(_0x2e0d('0x1'));var util=require(_0x2e0d('0x2'));var Redis=require(_0x2e0d('0x3'));var intUtil=require(_0x2e0d('0x4'));var config=require(_0x2e0d('0x5'));var logger=require('../../../../config/logger')(_0x2e0d('0x6'));config[_0x2e0d('0x7')]=_['defaults'](config[_0x2e0d('0x7')],{'host':_0x2e0d('0x8'),'port':0x18eb});var io=require(_0x2e0d('0x9'))(new Redis(config[_0x2e0d('0x7')]));function emit(_0x4e3998,_0x116e22,_0x3ae57c){io['to'](_0x4e3998)[_0x2e0d('0xa')](_0x116e22,_0x3ae57c);}var headers={'Content-Type':_0x2e0d('0xb'),'Accept':_0x2e0d('0xb')};function getTicket(_0x39be01,_0x4781d7,_0x30bb55,_0x16a59a,_0x5f18c9){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0xd'),_0x39be01['remoteUri']),'method':'POST','body':{'ticket':_[_0x2e0d('0xe')]({'requester_id':_0x30bb55['id'],'submitter_id':_0x4781d7?_0x4781d7['id']:undefined,'assignee_id':_0x4781d7?_0x4781d7['id']:undefined,'tags':getTags(_0x16a59a['Tags'],_0x2e0d('0xf')),'subject':intUtil[_0x2e0d('0x10')](_0x16a59a[_0x2e0d('0x11')],_0x5f18c9,'\x20'),'description':intUtil[_0x2e0d('0x10')](_0x16a59a[_0x2e0d('0x12')],_0x5f18c9,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x16a59a[_0x2e0d('0x12')],_0x5f18c9,'\x0a')}},getCustomFields(_0x16a59a[_0x2e0d('0x13')],_0x5f18c9))}})[_0x2e0d('0x14')](function(_0x458476){logger[_0x2e0d('0x15')](_0x2e0d('0x16'));return _0x458476[_0x2e0d('0x17')];});}function getUser(_0x49fdc8,_0x2601b2){if(intUtil[_0x2e0d('0x18')](_0x2601b2)){logger[_0x2e0d('0x15')](_0x2e0d('0x19'),_0x2601b2);return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0x1a'),_0x49fdc8[_0x2e0d('0x1b')]),'qs':{'query':util[_0x2e0d('0xc')](_0x2e0d('0x1c'),_0x2601b2)}})['then'](function(_0x2ee99a){if(_0x2ee99a['count']){logger['info'](_0x2e0d('0x1d'));return _[_0x2e0d('0x1e')](_0x2ee99a['results'],{'email':_0x2601b2,'role':_0x2e0d('0x1f')});}else{logger[_0x2e0d('0x15')](_0x2e0d('0x20'));return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0x21'),_0x49fdc8[_0x2e0d('0x1b')])})[_0x2e0d('0x14')](function(_0x58d698){logger[_0x2e0d('0x15')](_0x2e0d('0x22'));return _0x58d698[_0x2e0d('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0x21'),_0x49fdc8[_0x2e0d('0x1b')])})['then'](function(_0x48fa6c){logger[_0x2e0d('0x15')](_0x2e0d('0x22'));return _0x48fa6c['user'];});}}function getEndUser(_0x3d4f13,_0xa76710,_0x1f12ff){logger[_0x2e0d('0x15')](_0x2e0d('0x24'),_0x1f12ff);return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0x1a'),_0x3d4f13['remoteUri']),'qs':{'query':util[_0x2e0d('0xc')](_0x2e0d('0x25'),_0x1f12ff)}})[_0x2e0d('0x14')](function(_0x80ece2){var _0x321fc9;if(_0x80ece2[_0x2e0d('0x26')][_0x2e0d('0x27')]){_0x80ece2[_0x2e0d('0x26')]=_['filter'](_0x80ece2[_0x2e0d('0x26')],{'suspended':![],'role':_0x2e0d('0x28')});if(_0x80ece2[_0x2e0d('0x26')][_0x2e0d('0x27')]){_0x321fc9=_[_0x2e0d('0x29')](_0x80ece2['results']);}}if(_0x321fc9){logger[_0x2e0d('0x15')](_0x2e0d('0x2a'));return _0x321fc9;}else{logger[_0x2e0d('0x15')](_0x2e0d('0x2b'));return request({'uri':util[_0x2e0d('0xc')](_0x2e0d('0x2c'),_0x3d4f13['remoteUri']),'method':_0x2e0d('0x2d'),'body':{'user':{'role':_0x2e0d('0x28'),'name':util['format'](_0x2e0d('0x2e'),_0xa76710||_0x1f12ff),'phone':_0x1f12ff}}})['then'](function(_0x3a6567){logger[_0x2e0d('0x15')](_0x2e0d('0x2f'));return _0x3a6567['user'];});}});}function getAuth(_0x4a2a82){var _0x1026fe;if(_0x4a2a82['authType']==='password'){_0x1026fe=util[_0x2e0d('0xc')]('%s:%s',_0x4a2a82['username'],_0x4a2a82[_0x2e0d('0x30')]);}else if(_0x4a2a82[_0x2e0d('0x31')]===_0x2e0d('0x32')){_0x1026fe=util[_0x2e0d('0xc')](_0x2e0d('0x33'),_0x4a2a82['username'],_0x4a2a82[_0x2e0d('0x32')]);}return util['format'](_0x2e0d('0x34'),new Buffer(_0x1026fe)[_0x2e0d('0x35')](_0x2e0d('0x36')));}function request(_0x178d4b){logger['debug'](_0x2e0d('0x37'),JSON[_0x2e0d('0x38')](_0x178d4b));return rp(_[_0x2e0d('0x39')](_0x178d4b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3894eb,_0x374f0e){var _0x208f45=[];if(_0x3894eb&&_0x3894eb[_0x2e0d('0x27')]>0x0){_0x208f45=_[_0x2e0d('0x3a')](_0x3894eb,_0x374f0e);}return _0x208f45;}function getCustomFields(_0x43d1b0,_0x458b24){var _0x510015=[];var _0xa1cf65={'custom_fields':[]};if(_0x43d1b0[_0x2e0d('0x27')]>0x0){_[_0x2e0d('0x3b')](_0x43d1b0,function(_0x13b697){if(_[_0x2e0d('0x3c')]([_0x2e0d('0x3d'),'picklist'],_0x13b697[_0x2e0d('0x3e')])&&_0x13b697[_0x2e0d('0x3f')]&&!_0x13b697[_0x2e0d('0x40')]){_0xa1cf65[_0x13b697[_0x2e0d('0x3f')][_0x2e0d('0x41')]()]=_0x13b697[_0x2e0d('0x42')][_0x2e0d('0x35')]();}else if(_['includes']([_0x2e0d('0x3d'),'picklist'],_0x13b697['type'])&&_0x13b697[_0x2e0d('0x43')]&&_0x13b697[_0x2e0d('0x40')]){_0xa1cf65['custom_fields'][_0x2e0d('0x44')]({'id':_0x13b697[_0x2e0d('0x43')],'value':_0x13b697[_0x2e0d('0x42')][_0x2e0d('0x35')]()});}else if(_0x13b697[_0x2e0d('0x3e')]==='variable'&&_0x13b697['variableName']&&_0x13b697[_0x2e0d('0x43')]&&_0x13b697[_0x2e0d('0x40')]){_0x458b24[_0x13b697[_0x2e0d('0x45')]]&&_0xa1cf65[_0x2e0d('0x46')]['push']({'id':_0x13b697[_0x2e0d('0x43')],'value':_0x458b24[_0x13b697['variableName']][_0x2e0d('0x35')]()});}else if(_0x13b697[_0x2e0d('0x3e')]===_0x2e0d('0x47')&&_0x13b697[_0x2e0d('0x48')]&&_0x13b697[_0x2e0d('0x48')][_0x2e0d('0xf')]&&_0x13b697[_0x2e0d('0x43')]&&_0x13b697[_0x2e0d('0x40')]){_0x458b24[_0x13b697[_0x2e0d('0x48')]['name'][_0x2e0d('0x41')]()]&&_0xa1cf65[_0x2e0d('0x46')][_0x2e0d('0x44')]({'id':_0x13b697[_0x2e0d('0x43')],'value':_0x458b24[_0x13b697[_0x2e0d('0x48')][_0x2e0d('0xf')]['toLowerCase']()]['toString']()});}});}return _0xa1cf65;}exports[_0x2e0d('0x49')]=function(_0x3fae0b,_0x253bdc,_0x3e73a3,_0x1532fe,_0x1d9086,_0x53bff8){var _0x4eeee7,_0x43a110;_0x53bff8[_0x2e0d('0x1b')]=intUtil[_0x2e0d('0x4a')](_0x53bff8[_0x2e0d('0x1b')]);_0x53bff8[_0x2e0d('0x4b')]=intUtil[_0x2e0d('0x4a')](_0x53bff8['serverUrl']);if(_0x1d9086&&_0x1d9086[_0x2e0d('0x4c')]){logger['info'](_0x2e0d('0x4d'),_0x2e0d('0x4e'));_0x253bdc[_0x2e0d('0x4f')]=util[_0x2e0d('0xc')](_0x2e0d('0x50'),_0x53bff8[_0x2e0d('0x4b')],_0x253bdc[_0x2e0d('0x51')],md5(_0x253bdc[_0x2e0d('0x51')]));}else{_0x253bdc[_0x2e0d('0x4f')]='';}headers[_0x2e0d('0x52')]=getAuth(_0x53bff8);return getUser(_0x53bff8,_0x1532fe[_0x2e0d('0x53')])[_0x2e0d('0x14')](function(_0x1ec456){_0x4eeee7=_0x1ec456;logger[_0x2e0d('0x15')](_0x2e0d('0x54'),_0x4eeee7['id']);return getEndUser(_0x53bff8,_0x253bdc[_0x2e0d('0x55')],_0x253bdc[_0x2e0d('0x56')]);})[_0x2e0d('0x14')](function(_0x508ef1){_0x43a110=_0x508ef1;logger[_0x2e0d('0x15')](_0x2e0d('0x57'),_0x43a110['id']);return getTicket(_0x53bff8,_0x4eeee7,_0x43a110,_0x3e73a3,_0x253bdc);})['then'](function(_0x1113b0){if(_0x1113b0){logger[_0x2e0d('0x15')](_0x2e0d('0x58'),_0x1113b0['id']);switch(_0x53bff8[_0x2e0d('0x3e')]){case'integrationTab':logger['info']('[QUEUE]',_0x2e0d('0x59'));return request({'uri':util[_0x2e0d('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x53bff8[_0x2e0d('0x1b')],_0x4eeee7['id'],_0x1113b0['id']),'method':_0x2e0d('0x2d')});case _0x2e0d('0x5a'):logger[_0x2e0d('0x15')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2e0d('0xc')]('user:%s',_0x1532fe[_0x2e0d('0xf')]),_0x2e0d('0x5b'),{'uri':util[_0x2e0d('0xc')]('%s/agent/tickets/%s',_0x53bff8[_0x2e0d('0x1b')][_0x2e0d('0x5c')](_0x2e0d('0x5d'),''),_0x1113b0['id'])});break;default:logger['error'](_0x2e0d('0x4d'),_0x2e0d('0x5e'));}}})[_0x2e0d('0x5f')](function(_0x4c7075){logger[_0x2e0d('0x60')](_0x2e0d('0x61'),util[_0x2e0d('0x62')](_0x4c7075,{'showHidden':!![],'depth':null}));});};exports[_0x2e0d('0x63')]=function(_0x3e2a28,_0x20fdba,_0x59aa9d,_0x5c4f4d,_0x1f832a,_0x762add,_0x53f6e6){var _0xf6a717,_0x5640bf;_0x762add[_0x2e0d('0x1b')]=intUtil[_0x2e0d('0x4a')](_0x762add[_0x2e0d('0x1b')]);_0x762add[_0x2e0d('0x4b')]=intUtil[_0x2e0d('0x4a')](_0x762add[_0x2e0d('0x4b')]);if(_0x53f6e6&&_0x53f6e6[_0x2e0d('0x64')]&&_0x53f6e6[_0x2e0d('0x64')]!==_0x2e0d('0x65')){logger[_0x2e0d('0x15')](_0x2e0d('0x66'),_0x2e0d('0x4e'));_0x20fdba['recordingURL']=util[_0x2e0d('0xc')](_0x2e0d('0x50'),_0x762add[_0x2e0d('0x4b')],_0x20fdba[_0x2e0d('0x51')],md5(_0x20fdba[_0x2e0d('0x51')]));}headers[_0x2e0d('0x52')]=getAuth(_0x762add);return getUser(_0x762add,_0x5c4f4d[_0x2e0d('0x53')])['then'](function(_0x123dc6){_0xf6a717=_0x123dc6;logger[_0x2e0d('0x15')](_0x2e0d('0x54'),_0xf6a717['id']);return getEndUser(_0x762add,_0x20fdba[_0x2e0d('0x67')],_0x20fdba[_0x2e0d('0x68')]);})[_0x2e0d('0x14')](function(_0xa63486){_0x5640bf=_0xa63486;logger[_0x2e0d('0x15')](_0x2e0d('0x57'),_0x5640bf['id']);return getTicket(_0x762add,_0xf6a717,_0x5640bf,_0x59aa9d,_0x20fdba);})[_0x2e0d('0x14')](function(_0x29475f){if(_0x29475f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x29475f['id']);switch(_0x762add['type']){case _0x2e0d('0x69'):logger[_0x2e0d('0x15')](_0x2e0d('0x66'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x2e0d('0x6a'),_0x762add[_0x2e0d('0x1b')],_0xf6a717['id'],_0x29475f['id']),'method':_0x2e0d('0x2d')});case'newTab':logger[_0x2e0d('0x15')](_0x2e0d('0x66'),_0x2e0d('0x6b'));emit(util[_0x2e0d('0xc')](_0x2e0d('0x6c'),_0x5c4f4d[_0x2e0d('0xf')]),'trigger:browser:url',{'uri':util[_0x2e0d('0xc')](_0x2e0d('0x6d'),_0x762add['remoteUri'][_0x2e0d('0x5c')](_0x2e0d('0x5d'),''),_0x29475f['id'])});break;default:logger[_0x2e0d('0x60')](_0x2e0d('0x66'),_0x2e0d('0x5e'));}}})[_0x2e0d('0x5f')](function(_0x3f155f){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3f155f,{'showHidden':!![],'depth':null}));});};exports[_0x2e0d('0x6e')]=function(_0x289c3d,_0x54dde4,_0x2a88a6,_0x1a0693,_0x5724aa,_0x501daf){var _0x334c1f,_0x1e5a55;_0x501daf['remoteUri']=intUtil[_0x2e0d('0x4a')](_0x501daf['remoteUri']);_0x501daf['serverUrl']=intUtil[_0x2e0d('0x4a')](_0x501daf[_0x2e0d('0x4b')]);if(_0x5724aa&&_0x5724aa['monitor_format']){logger[_0x2e0d('0x15')]('['+_0x54dde4[_0x2e0d('0x6f')][_0x2e0d('0x70')]()+']',_0x2e0d('0x4e'));_0x54dde4['recordingURL']=util[_0x2e0d('0xc')](_0x2e0d('0x50'),_0x501daf['serverUrl'],_0x54dde4[_0x2e0d('0x51')],md5(_0x54dde4[_0x2e0d('0x51')]));}else{_0x54dde4[_0x2e0d('0x4f')]='';}headers[_0x2e0d('0x52')]=getAuth(_0x501daf);return getUser(_0x501daf)['then'](function(_0x2d3d9b){_0x334c1f=_0x2d3d9b;logger['info'](_0x2e0d('0x54'),_0x334c1f['id']);return getEndUser(_0x501daf,_0x54dde4['calleridname'],_0x54dde4['calleridnum']);})['then'](function(_0x57ecfe){_0x1e5a55=_0x57ecfe;logger[_0x2e0d('0x15')](_0x2e0d('0x57'),_0x1e5a55['id']);return getTicket(_0x501daf,_0x334c1f,_0x1e5a55,_0x2a88a6,_0x54dde4);})[_0x2e0d('0x14')](function(_0x1e01bb){if(_0x1e01bb){logger[_0x2e0d('0x15')](_0x2e0d('0x58'),_0x1e01bb['id']);}})['catch'](function(_0x4d1f14){logger[_0x2e0d('0x60')]('['+_0x54dde4['lastevent'][_0x2e0d('0x70')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4d1f14,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x308a=['end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','toString','base64','debug','defaults','GET','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','push','variableName','custom_fields','customVariable','Variable','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','stripTrailingSlash','recordingFormat','none','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridname','The\x20Enduser\x20ID\x20is:','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results'];(function(_0x2287df,_0x5a4a24){var _0x2afbc1=function(_0x3af10a){while(--_0x3af10a){_0x2287df['push'](_0x2287df['shift']());}};_0x2afbc1(++_0x5a4a24);}(_0x308a,0xb1));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa308('0x0'));var rp=require(_0xa308('0x1'));var md5=require('md5');var util=require(_0xa308('0x2'));var Redis=require(_0xa308('0x3'));var intUtil=require(_0xa308('0x4'));var config=require(_0xa308('0x5'));var logger=require('../../../../config/logger')(_0xa308('0x6'));config[_0xa308('0x7')]=_['defaults'](config[_0xa308('0x7')],{'host':_0xa308('0x8'),'port':0x18eb});var io=require(_0xa308('0x9'))(new Redis(config[_0xa308('0x7')]));function emit(_0x65d750,_0x476999,_0x56bf6f){io['to'](_0x65d750)[_0xa308('0xa')](_0x476999,_0x56bf6f);}var headers={'Content-Type':_0xa308('0xb'),'Accept':_0xa308('0xb')};function getTicket(_0x186daa,_0x319b54,_0x1445f8,_0x3d6032,_0x2cbba1){logger[_0xa308('0xc')](_0xa308('0xd'));return request({'uri':util[_0xa308('0xe')]('%s/tickets.json',_0x186daa[_0xa308('0xf')]),'method':'POST','body':{'ticket':_[_0xa308('0x10')]({'requester_id':_0x1445f8['id'],'submitter_id':_0x319b54?_0x319b54['id']:undefined,'assignee_id':_0x319b54?_0x319b54['id']:undefined,'tags':getTags(_0x3d6032[_0xa308('0x11')],_0xa308('0x12')),'subject':intUtil[_0xa308('0x13')](_0x3d6032[_0xa308('0x14')],_0x2cbba1,'\x20'),'description':intUtil['getString'](_0x3d6032[_0xa308('0x15')],_0x2cbba1,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa308('0x13')](_0x3d6032['Descriptions'],_0x2cbba1,'\x0a')}},getCustomFields(_0x3d6032[_0xa308('0x16')],_0x2cbba1))}})[_0xa308('0x17')](function(_0x45e32a){logger[_0xa308('0xc')](_0xa308('0x18'));return _0x45e32a[_0xa308('0x19')];});}function getUser(_0x42e277,_0x3223ba){if(intUtil[_0xa308('0x1a')](_0x3223ba)){logger[_0xa308('0xc')](_0xa308('0x1b'),_0x3223ba);return request({'uri':util[_0xa308('0xe')]('%s/search.json',_0x42e277[_0xa308('0xf')]),'qs':{'query':util[_0xa308('0xe')](_0xa308('0x1c'),_0x3223ba)}})[_0xa308('0x17')](function(_0x27e614){if(_0x27e614[_0xa308('0x1d')]){logger['info'](_0xa308('0x1e'));return _[_0xa308('0x1f')](_0x27e614['results'],{'email':_0x3223ba,'role':_0xa308('0x20')});}else{logger[_0xa308('0xc')](_0xa308('0x21'));return request({'uri':util[_0xa308('0xe')]('%s/users/me.json',_0x42e277[_0xa308('0xf')])})[_0xa308('0x17')](function(_0x368b67){logger['info'](_0xa308('0x22'));return _0x368b67[_0xa308('0x23')];});}});}else{logger[_0xa308('0xc')](_0xa308('0x21'));return request({'uri':util['format']('%s/users/me.json',_0x42e277[_0xa308('0xf')])})[_0xa308('0x17')](function(_0x4912ea){logger[_0xa308('0xc')](_0xa308('0x22'));return _0x4912ea[_0xa308('0x23')];});}}function getEndUser(_0x27db3c,_0x2bdac2,_0x121180){logger[_0xa308('0xc')](_0xa308('0x24'),_0x121180);return request({'uri':util[_0xa308('0xe')](_0xa308('0x25'),_0x27db3c['remoteUri']),'qs':{'query':util['format'](_0xa308('0x26'),_0x121180)}})[_0xa308('0x17')](function(_0x22a8aa){var _0x56164a;if(_0x22a8aa['results'][_0xa308('0x27')]){_0x22a8aa[_0xa308('0x28')]=_['filter'](_0x22a8aa['results'],{'suspended':![],'role':_0xa308('0x29')});if(_0x22a8aa[_0xa308('0x28')][_0xa308('0x27')]){_0x56164a=_[_0xa308('0x2a')](_0x22a8aa['results']);}}if(_0x56164a){logger['info'](_0xa308('0x2b'));return _0x56164a;}else{logger[_0xa308('0xc')](_0xa308('0x2c'));return request({'uri':util['format'](_0xa308('0x2d'),_0x27db3c[_0xa308('0xf')]),'method':_0xa308('0x2e'),'body':{'user':{'role':_0xa308('0x29'),'name':util[_0xa308('0xe')](_0xa308('0x2f'),_0x2bdac2||_0x121180),'phone':_0x121180}}})[_0xa308('0x17')](function(_0x45c588){logger['info'](_0xa308('0x30'));return _0x45c588[_0xa308('0x23')];});}});}function getAuth(_0xdf53a7){var _0x1e3cd0;if(_0xdf53a7[_0xa308('0x31')]==='password'){_0x1e3cd0=util['format']('%s:%s',_0xdf53a7['username'],_0xdf53a7[_0xa308('0x32')]);}else if(_0xdf53a7[_0xa308('0x31')]===_0xa308('0x33')){_0x1e3cd0=util[_0xa308('0xe')](_0xa308('0x34'),_0xdf53a7['username'],_0xdf53a7['token']);}return util['format']('Basic\x20%s',new Buffer(_0x1e3cd0)[_0xa308('0x35')](_0xa308('0x36')));}function request(_0x5ce1e5){logger[_0xa308('0x37')]('[HTTP]',JSON['stringify'](_0x5ce1e5));return rp(_[_0xa308('0x38')](_0x5ce1e5,{'method':_0xa308('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x2a5360,_0x253517){var _0x5f3677=[];if(_0x2a5360&&_0x2a5360[_0xa308('0x27')]>0x0){_0x5f3677=_['map'](_0x2a5360,_0x253517);}return _0x5f3677;}function getCustomFields(_0x59425c,_0xc84ef3){var _0x4b7b09=[];var _0x49d378={'custom_fields':[]};if(_0x59425c[_0xa308('0x27')]>0x0){_[_0xa308('0x3a')](_0x59425c,function(_0x49f893){if(_[_0xa308('0x3b')]([_0xa308('0x3c'),'picklist'],_0x49f893[_0xa308('0x3d')])&&_0x49f893['nameField']&&!_0x49f893[_0xa308('0x3e')]){_0x49d378[_0x49f893[_0xa308('0x3f')][_0xa308('0x40')]()]=_0x49f893[_0xa308('0x41')]['toString']();}else if(_[_0xa308('0x3b')]([_0xa308('0x3c'),_0xa308('0x42')],_0x49f893['type'])&&_0x49f893[_0xa308('0x43')]&&_0x49f893[_0xa308('0x3e')]){_0x49d378['custom_fields'][_0xa308('0x44')]({'id':_0x49f893[_0xa308('0x43')],'value':_0x49f893[_0xa308('0x41')][_0xa308('0x35')]()});}else if(_0x49f893[_0xa308('0x3d')]==='variable'&&_0x49f893[_0xa308('0x45')]&&_0x49f893['idField']&&_0x49f893[_0xa308('0x3e')]){_0xc84ef3[_0x49f893[_0xa308('0x45')]]&&_0x49d378[_0xa308('0x46')][_0xa308('0x44')]({'id':_0x49f893['idField'],'value':_0xc84ef3[_0x49f893[_0xa308('0x45')]][_0xa308('0x35')]()});}else if(_0x49f893['type']===_0xa308('0x47')&&_0x49f893[_0xa308('0x48')]&&_0x49f893[_0xa308('0x48')][_0xa308('0x12')]&&_0x49f893['idField']&&_0x49f893['customField']){_0xc84ef3[_0x49f893[_0xa308('0x48')][_0xa308('0x12')][_0xa308('0x40')]()]&&_0x49d378['custom_fields'][_0xa308('0x44')]({'id':_0x49f893[_0xa308('0x43')],'value':_0xc84ef3[_0x49f893['Variable'][_0xa308('0x12')][_0xa308('0x40')]()][_0xa308('0x35')]()});}});}return _0x49d378;}exports['queue']=function(_0x36f306,_0x65de00,_0x4908b0,_0x1cf094,_0x1bf38a,_0x2754c1){var _0x4cc89a,_0x340ffc;_0x2754c1[_0xa308('0xf')]=intUtil['stripTrailingSlash'](_0x2754c1['remoteUri']);_0x2754c1[_0xa308('0x49')]=intUtil['stripTrailingSlash'](_0x2754c1['serverUrl']);if(_0x1bf38a&&_0x1bf38a[_0xa308('0x4a')]){logger[_0xa308('0xc')](_0xa308('0x4b'),_0xa308('0x4c'));_0x65de00[_0xa308('0x4d')]=util[_0xa308('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2754c1[_0xa308('0x49')],_0x65de00['uniqueid'],md5(_0x65de00[_0xa308('0x4e')]));}else{_0x65de00[_0xa308('0x4d')]='';}headers[_0xa308('0x4f')]=getAuth(_0x2754c1);return getUser(_0x2754c1,_0x1cf094[_0xa308('0x50')])[_0xa308('0x17')](function(_0x3a38ec){_0x4cc89a=_0x3a38ec;logger[_0xa308('0xc')]('The\x20User\x20ID\x20is:',_0x4cc89a['id']);return getEndUser(_0x2754c1,_0x65de00['calleridname'],_0x65de00[_0xa308('0x51')]);})[_0xa308('0x17')](function(_0x3f4426){_0x340ffc=_0x3f4426;logger[_0xa308('0xc')]('The\x20Enduser\x20ID\x20is:',_0x340ffc['id']);return getTicket(_0x2754c1,_0x4cc89a,_0x340ffc,_0x4908b0,_0x65de00);})[_0xa308('0x17')](function(_0x378c7f){if(_0x378c7f){logger[_0xa308('0xc')](_0xa308('0x52'),_0x378c7f['id']);switch(_0x2754c1[_0xa308('0x3d')]){case _0xa308('0x53'):logger[_0xa308('0xc')](_0xa308('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2754c1[_0xa308('0xf')],_0x4cc89a['id'],_0x378c7f['id']),'method':_0xa308('0x2e')});case _0xa308('0x54'):logger[_0xa308('0xc')](_0xa308('0x4b'),_0xa308('0x55'));emit(util[_0xa308('0xe')](_0xa308('0x56'),_0x1cf094[_0xa308('0x12')]),_0xa308('0x57'),{'uri':util[_0xa308('0xe')]('%s/agent/tickets/%s',_0x2754c1[_0xa308('0xf')][_0xa308('0x58')]('/api/v2',''),_0x378c7f['id'])});break;default:logger[_0xa308('0x59')]('[QUEUE]',_0xa308('0x5a'));}}})[_0xa308('0x5b')](function(_0x4fbbcf){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa308('0x5c')](_0x4fbbcf,{'showHidden':!![],'depth':null}));});};exports[_0xa308('0x5d')]=function(_0x846bed,_0x2af281,_0x57100e,_0x4e0180,_0x2d5710,_0x4e7e17,_0x1076c8){var _0x2615ea,_0x23506f;_0x4e7e17['remoteUri']=intUtil['stripTrailingSlash'](_0x4e7e17[_0xa308('0xf')]);_0x4e7e17[_0xa308('0x49')]=intUtil[_0xa308('0x5e')](_0x4e7e17[_0xa308('0x49')]);if(_0x1076c8&&_0x1076c8[_0xa308('0x5f')]&&_0x1076c8[_0xa308('0x5f')]!==_0xa308('0x60')){logger[_0xa308('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2af281['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e7e17['serverUrl'],_0x2af281['uniqueid'],md5(_0x2af281[_0xa308('0x4e')]));}headers[_0xa308('0x4f')]=getAuth(_0x4e7e17);return getUser(_0x4e7e17,_0x4e0180['email'])['then'](function(_0x1f9aff){_0x2615ea=_0x1f9aff;logger[_0xa308('0xc')]('The\x20User\x20ID\x20is:',_0x2615ea['id']);return getEndUser(_0x4e7e17,_0x2af281[_0xa308('0x61')],_0x2af281['destcalleridnum']);})[_0xa308('0x17')](function(_0x5ace7b){_0x23506f=_0x5ace7b;logger[_0xa308('0xc')]('The\x20Enduser\x20ID\x20is:',_0x23506f['id']);return getTicket(_0x4e7e17,_0x2615ea,_0x23506f,_0x57100e,_0x2af281);})[_0xa308('0x17')](function(_0x2f8445){if(_0x2f8445){logger[_0xa308('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2f8445['id']);switch(_0x4e7e17[_0xa308('0x3d')]){case'integrationTab':logger[_0xa308('0xc')](_0xa308('0x62'),_0xa308('0x63'));return request({'uri':util[_0xa308('0xe')](_0xa308('0x64'),_0x4e7e17[_0xa308('0xf')],_0x2615ea['id'],_0x2f8445['id']),'method':_0xa308('0x2e')});case'newTab':logger['info'](_0xa308('0x62'),_0xa308('0x55'));emit(util[_0xa308('0xe')](_0xa308('0x56'),_0x4e0180[_0xa308('0x12')]),_0xa308('0x57'),{'uri':util['format'](_0xa308('0x65'),_0x4e7e17[_0xa308('0xf')][_0xa308('0x58')](_0xa308('0x66'),''),_0x2f8445['id'])});break;default:logger[_0xa308('0x59')](_0xa308('0x62'),_0xa308('0x5a'));}}})[_0xa308('0x5b')](function(_0x437613){logger['error'](_0xa308('0x67'),util[_0xa308('0x5c')](_0x437613,{'showHidden':!![],'depth':null}));});};exports[_0xa308('0x68')]=function(_0x5e4e27,_0x5b78e0,_0x465681,_0x45f47e,_0x53d103,_0x23584a){var _0x23602d,_0x55d384;_0x23584a[_0xa308('0xf')]=intUtil[_0xa308('0x5e')](_0x23584a[_0xa308('0xf')]);_0x23584a['serverUrl']=intUtil['stripTrailingSlash'](_0x23584a[_0xa308('0x49')]);if(_0x53d103&&_0x53d103[_0xa308('0x4a')]){logger['info']('['+_0x5b78e0['lastevent'][_0xa308('0x69')]()+']',_0xa308('0x4c'));_0x5b78e0[_0xa308('0x4d')]=util[_0xa308('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23584a[_0xa308('0x49')],_0x5b78e0[_0xa308('0x4e')],md5(_0x5b78e0['uniqueid']));}else{_0x5b78e0['recordingURL']='';}headers[_0xa308('0x4f')]=getAuth(_0x23584a);return getUser(_0x23584a)[_0xa308('0x17')](function(_0x42a966){_0x23602d=_0x42a966;logger['info']('The\x20User\x20ID\x20is:',_0x23602d['id']);return getEndUser(_0x23584a,_0x5b78e0[_0xa308('0x6a')],_0x5b78e0[_0xa308('0x51')]);})[_0xa308('0x17')](function(_0x2e219c){_0x55d384=_0x2e219c;logger[_0xa308('0xc')](_0xa308('0x6b'),_0x55d384['id']);return getTicket(_0x23584a,_0x23602d,_0x55d384,_0x465681,_0x5b78e0);})[_0xa308('0x17')](function(_0x3dc36e){if(_0x3dc36e){logger['info']('The\x20Ticket\x20ID\x20is:',_0x3dc36e['id']);}})[_0xa308('0x5b')](function(_0x36389d){logger[_0xa308('0x59')]('['+_0x5b78e0[_0xa308('0x6c')][_0xa308('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xa308('0x5c')](_0x36389d,{'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 6ae559b..5c15abe 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 _0xd06e=['toString','customVariable','Variable','name','toLowerCase','indexOf','isNil','isBefore','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','startCase','Error:\x20','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','picklist','type','idField','variableName'];(function(_0x282858,_0x345063){var _0x202d6a=function(_0x4ec468){while(--_0x4ec468){_0x282858['push'](_0x282858['shift']());}};_0x202d6a(++_0x345063);}(_0xd06e,0x124));var _0xed06=function(_0x3d4adb,_0x122228){_0x3d4adb=_0x3d4adb-0x0;var _0x431749=_0xd06e[_0x3d4adb];return _0x431749;};'use strict';var _=require(_0xed06('0x0'));var rp=require(_0xed06('0x1'));var md5=require(_0xed06('0x2'));var util=require(_0xed06('0x3'));var intUtil=require('./util');var moment=require(_0xed06('0x4'));var Redis=require('ioredis');var BPromise=require(_0xed06('0x5'));var config=require(_0xed06('0x6'));var logger=require(_0xed06('0x7'))(_0xed06('0x8'));config[_0xed06('0x9')]=_[_0xed06('0xa')](config[_0xed06('0x9')],{'host':_0xed06('0xb'),'port':0x18eb});var io=require(_0xed06('0xc'))(new Redis(config[_0xed06('0x9')]));function emit(_0x3f011d,_0x55467e,_0x13c741){io['to'](_0x3f011d)[_0xed06('0xd')](_0x55467e,_0x13c741);}function request(_0x3a92fa){logger[_0xed06('0xe')](_0xed06('0xf'),JSON['stringify'](_0x3a92fa));return rp(_0x3a92fa);}function getCustomFields(_0x42ae12,_0x3ed271){var _0x4254e7={};if(_0x42ae12[_0xed06('0x10')]>0x0){_[_0xed06('0x11')](_0x42ae12,function(_0x2cad32){if(_['includes'](['string',_0xed06('0x12')],_0x2cad32[_0xed06('0x13')])&&_0x2cad32['idField']){_0x4254e7[_0x2cad32[_0xed06('0x14')]]=_0x2cad32['content']['toString']();}else if(_0x2cad32[_0xed06('0x13')]==='variable'&&_0x2cad32[_0xed06('0x15')]&&_0x2cad32['idField']&&_0x3ed271[_0x2cad32['variableName']]){_0x4254e7[_0x2cad32['idField']]=_0x3ed271[_0x2cad32['variableName']][_0xed06('0x16')]();}else if(_0x2cad32[_0xed06('0x13')]===_0xed06('0x17')&&_0x2cad32[_0xed06('0x18')]&&_0x2cad32[_0xed06('0x18')][_0xed06('0x19')]&&_0x2cad32[_0xed06('0x14')]&&_0x3ed271[_0x2cad32['Variable'][_0xed06('0x19')][_0xed06('0x1a')]()]){_0x4254e7[_0x2cad32[_0xed06('0x14')]]=_0x3ed271[_0x2cad32[_0xed06('0x18')]['name'][_0xed06('0x1a')]()]['toString']();}});}return _0x4254e7;}function getName(_0x2e0e34){if(_0x2e0e34[_0xed06('0x1b')]('\x20')>0x0){var _0x464ba0=_0x2e0e34['split'](/ (.+)/);if(_0x464ba0[0x1]){return _0x464ba0;}}return[_0x2e0e34,_0x2e0e34];}var accountsTokens={};function getAccessToken(_0x12cf76){return new Promise(function(_0x4cbae3,_0x13050b){if(!_[_0xed06('0x1c')](accountsTokens[_0x12cf76['id']])&&!_[_0xed06('0x1c')](accountsTokens[_0x12cf76['id']]['access_token'])){if(moment()[_0xed06('0x1d')](accountsTokens[_0x12cf76['id']]['expires_in'])){_0x4cbae3(accountsTokens[_0x12cf76['id']][_0xed06('0x1e')]);}}var _0x2f19b3;switch(_0x12cf76[_0xed06('0x1f')]){case'US':_0x2f19b3=_0xed06('0x20');break;case'AU':_0x2f19b3=_0xed06('0x21');break;case'EU':_0x2f19b3='https://accounts.zoho.eu';break;case'IN':_0x2f19b3=_0xed06('0x22');break;case'CN':_0x2f19b3=_0xed06('0x23');break;default:_0x2f19b3='https://accounts.zoho.eu';break;}var _0x46b8df={'method':_0xed06('0x24'),'uri':_0x2f19b3+'/oauth/v2/token','qs':{'refresh_token':_0x12cf76[_0xed06('0x25')],'client_id':_0x12cf76[_0xed06('0x26')],'client_secret':_0x12cf76[_0xed06('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x46b8df)[_0xed06('0x28')](function(_0x27c887){accountsTokens[_0x12cf76['id']]={'access_token':_0x27c887[_0xed06('0x1e')],'expires_in':moment()['add'](_0x27c887[_0xed06('0x29')],_0xed06('0x2a'))};_0x4cbae3(_0x27c887[_0xed06('0x1e')]);})[_0xed06('0x2b')](function(_0x4d0477){logger[_0xed06('0x2c')](_0xed06('0x2d'),_0x4d0477['stack']);_0x13050b(_0x4d0477);});});}function getUser(_0x20cf1a,_0x6e2406,_0x6c7728,_0xb6b2f3){logger['info'](_0xed06('0x2e'));return request({'method':_0xed06('0x2f'),'uri':util[_0xed06('0x30')](_0xed06('0x31'),_0x6e2406),'qs':{'type':_0xed06('0x32')},'headers':{'Authorization':_0xed06('0x33')+_0x20cf1a},'json':!![]})[_0xed06('0x28')](function(_0x5358e8){if(_0x5358e8[_0xed06('0x34')]){var _0x2524ff=-0x1;if(_[_0xed06('0x35')](_0x5358e8[_0xed06('0x34')])){if(!_[_0xed06('0x1c')](_0xb6b2f3)){_0x2524ff=_[_0xed06('0x36')](_0x5358e8['users'],function(_0x4a833a){return _0x4a833a[_0xed06('0x37')]===_0xb6b2f3;});}if(_0x2524ff>=0x0){logger[_0xed06('0x38')]('Agent\x20found!');}else{logger[_0xed06('0x38')]('Using\x20the\x20admin\x20account!');_0x2524ff=_['findIndex'](_0x5358e8['users'],function(_0xea9bed){return _0xea9bed['profile'][_0xed06('0x19')]===_0xed06('0x39');});}return _0x5358e8['users'][_0x2524ff];}else{if(_0x5358e8[_0xed06('0x3a')][_0xed06('0x3b')][_0xed06('0x19')]===_0xed06('0x39')){logger[_0xed06('0x38')](_0xed06('0x3c'));user=_0x5358e8['user'];return user;}else{logger[_0xed06('0x2c')](_0xed06('0x3d'),JSON[_0xed06('0x3e')](_0x5358e8));throw new Error(_0xed06('0x3f')+JSON[_0xed06('0x3e')](_0x5358e8));}}}else{logger[_0xed06('0x2c')](_0xed06('0x3d'),JSON[_0xed06('0x3e')](_0x5358e8));throw new Error(_0xed06('0x3f')+JSON[_0xed06('0x3e')](_0x5358e8));}})[_0xed06('0x2b')](function(_0x14320f){console[_0xed06('0x2c')](_0x14320f);});}function getZohoUser(_0x141312,_0x4660da){return new BPromise(function(_0x547e3a,_0x20e0ad){request(_0x141312)['then'](function(_0x3415fb){var _0x476b53=null;if(_0x3415fb){_0x476b53=_0x3415fb[_0xed06('0x40')][0x0];_0x476b53['enduserType']=_0x4660da;}_0x547e3a(_0x476b53);})[_0xed06('0x2b')](function(_0x1791ed){_0x20e0ad(_0x1791ed);});});}function createEndUser(_0x1c5dd8,_0xea79e6,_0x803e23,_0x29a0cc,_0x418557,_0xbbde9d){var _0x803e23=getName(_0x803e23);return request({'method':_0xed06('0x24'),'uri':_0xed06('0x41')+_0xea79e6+_0xed06('0x42')+_['startCase'](_0xbbde9d[_0xed06('0x43')])+'s','body':{'data':[{'Last_Name':_0x803e23[0x1],'First_Name':_0x803e23[0x0],'Phone':_0x29a0cc,'Owner':{'name':!_[_0xed06('0x1c')](_0x418557[_0xed06('0x44')]['name'])?_0x418557[_0xed06('0x44')][_0xed06('0x19')]:!_[_0xed06('0x1c')](_0x418557[_0xed06('0x45')])?_0x418557['first_name']+'\x20'+_0x418557[_0xed06('0x46')]:_0x418557[_0xed06('0x46')],'id':_0x418557['id']}}]},'headers':{'Authorization':_0xed06('0x33')+_0x1c5dd8},'json':!![]})['then'](function(_0x3a2a25){if(_0x3a2a25&&_0x3a2a25[_0xed06('0x40')][0x0][_0xed06('0x47')]===_0xed06('0x48')){var _0x2b1eb9=_0x3a2a25[_0xed06('0x40')][0x0][_0xed06('0x49')];_0x2b1eb9[_0xed06('0x4a')]=_[_0xed06('0x4b')](_0xbbde9d[_0xed06('0x43')])+'s';return _0x2b1eb9;}logger[_0xed06('0x2c')](_0xed06('0x3d'),JSON[_0xed06('0x3e')](data));throw new Error(_0xed06('0x4c')+JSON[_0xed06('0x3e')](data));})[_0xed06('0x2b')](function(_0x2d3268){console['log'](_0xed06('0x4d'),_0x2d3268);});}function getEndUser(_0x5f07e1,_0x104643,_0x344eb6,_0x128d1e,_0x3b6d7c,_0x3c73e7,_0x28f8b8){var _0x148e43={'method':_0xed06('0x2f'),'uri':'','headers':{'Authorization':_0xed06('0x33')+_0x5f07e1},'json':!![]};switch(_0x28f8b8['moduleSearch']){case _0xed06('0x4e'):_0x148e43[_0xed06('0x4f')]=_0xed06('0x41')+_0x104643+_0xed06('0x50')+_0x3b6d7c+'))';return getZohoUser(_0x148e43,_0xed06('0x51'))[_0xed06('0x28')](function(_0x5142d2){if(_0x5142d2)return _0x5142d2;_0x148e43[_0xed06('0x4f')]=_0xed06('0x41')+_0x104643+_0xed06('0x52')+_0x3b6d7c+'))';return getZohoUser(_0x148e43,_0xed06('0x53'))[_0xed06('0x28')](function(_0x1bf4df){if(_0x1bf4df)return _0x1bf4df;if(_0x28f8b8[_0xed06('0x43')]!=_0xed06('0x54')){return createEndUser(_0x5f07e1,_0x104643,_0x128d1e,_0x3b6d7c,_0x3c73e7,_0x28f8b8);}else{return{};}});});break;case'contact':_0x148e43[_0xed06('0x4f')]=_0xed06('0x41')+_0x104643+_0xed06('0x50')+_0x3b6d7c+'))';return getZohoUser(_0x148e43,_0xed06('0x51'))['then'](function(_0x93813b){if(_0x93813b)return _0x93813b;if(_0x28f8b8['moduleCreate']!=_0xed06('0x54')){return createEndUser(_0x5f07e1,_0x104643,_0x128d1e,_0x3b6d7c,_0x3c73e7,_0x28f8b8);}else{return{};}});break;case _0xed06('0x55'):_0x148e43[_0xed06('0x4f')]='https://www.zohoapis.'+_0x104643+_0xed06('0x52')+_0x3b6d7c+'))';return getZohoUser(_0x148e43,_0xed06('0x53'))[_0xed06('0x28')](function(_0x53ab3f){if(_0x53ab3f)return _0x53ab3f;if(_0x28f8b8[_0xed06('0x43')]!=_0xed06('0x54')){return createEndUser(_0x5f07e1,_0x104643,_0x128d1e,_0x3b6d7c,_0x3c73e7,_0x28f8b8);}else{return{};}});break;}}function getCall(_0x565da7,_0x1a21c4,_0x46167f,_0xe971e0,_0x52195f,_0x3ee423,_0x502088,_0x2dbfcf){logger[_0xed06('0x38')](_0xed06('0x56'));var _0x500371={};_0x500371[_0xed06('0x57')]={'name':!_[_0xed06('0x1c')](_0xe971e0[_0xed06('0x44')]['name'])&&!_[_0xed06('0x1c')](_0xe971e0[_0xed06('0x3b')][_0xed06('0x19')])&&_0xe971e0[_0xed06('0x3b')][_0xed06('0x19')]==='administrator'?_0xe971e0[_0xed06('0x44')][_0xed06('0x19')]:!_[_0xed06('0x1c')](_0xe971e0[_0xed06('0x45')])?_0xe971e0[_0xed06('0x45')]+'\x20'+_0xe971e0[_0xed06('0x46')]:_0xe971e0[_0xed06('0x46')],'id':_0xe971e0['id']};_0x500371[_0xed06('0x58')]=intUtil[_0xed06('0x59')](_0x3ee423[_0xed06('0x5a')],_0x502088,'\x20');_0x500371[_0xed06('0x5b')]=intUtil[_0xed06('0x59')](_0x3ee423[_0xed06('0x5c')],_0x502088,'\x0a');if(_0x52195f[_0xed06('0x4a')]==='Contacts'){_0x500371[_0xed06('0x5d')]={'name':!_[_0xed06('0x1c')](_0x52195f[_0xed06('0x5e')])?_0x52195f[_0xed06('0x5e')]:!_['isNil'](_0x52195f['First_Name'])?_0x52195f[_0xed06('0x5f')]+'\x20'+_0x52195f[_0xed06('0x60')]:_0x52195f[_0xed06('0x60')],'id':_0x52195f['id']};}if(_0x52195f[_0xed06('0x4a')]===_0xed06('0x53')){_0x500371[_0xed06('0x61')]={'name':!_['isNil'](_0x52195f[_0xed06('0x5e')])?_0x52195f[_0xed06('0x5e')]:!_['isNil'](_0x52195f[_0xed06('0x5f')])?_0x52195f[_0xed06('0x5f')]+'\x20'+_0x52195f[_0xed06('0x60')]:_0x52195f[_0xed06('0x60')],'id':_0x52195f['id']};_0x500371[_0xed06('0x62')]=_[_0xed06('0x4b')](_0x52195f[_0xed06('0x4a')]);}if(_0x502088[_0xed06('0x63')]){_0x500371[_0xed06('0x64')]=moment['utc'](parseInt(_0x502088[_0xed06('0x63')])*0x3e8)[_0xed06('0x30')]('mm:ss');}else if(_0x502088[_0xed06('0x65')]&&_0x502088[_0xed06('0x66')]){_0x500371[_0xed06('0x64')]=moment[_0xed06('0x67')](moment(_0x502088[_0xed06('0x66')],_0xed06('0x68'))[_0xed06('0x69')](moment(_0x502088[_0xed06('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xed06('0x30')](_0xed06('0x6b'));}switch(_0x502088[_0xed06('0x6c')]){case _0xed06('0x6d'):_0x500371[_0xed06('0x6e')]=_0xed06('0x6f');break;case'complete':case _0xed06('0x70'):_0x500371[_0xed06('0x6e')]=_0xed06('0x71');break;case _0xed06('0x72'):_0x500371[_0xed06('0x6e')]=_0xed06('0x73');break;case'abandoned':_0x500371[_0xed06('0x6e')]='Abandoned';break;case _0xed06('0x74'):_0x500371[_0xed06('0x6e')]=_0xed06('0x75');default:}_0x500371[_0xed06('0x76')]=(_0x2dbfcf===_0xed06('0x77')?moment(_0x502088[_0xed06('0x6a')])[_0xed06('0x30')](_0xed06('0x68')):moment(_0x502088['agentcalledAt'])[_0xed06('0x30')](_0xed06('0x68')))||moment()[_0xed06('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x500371[_0xed06('0x78')]=_0x2dbfcf||_0xed06('0x79');_0x500371=_[_0xed06('0x7a')](_0x500371,getCustomFields(_0x3ee423[_0xed06('0x7b')],_0x502088));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1a21c4+_0xed06('0x7c'),'headers':{'Authorization':_0xed06('0x33')+_0x565da7},'body':{'data':[_0x500371]},'json':!![]})[_0xed06('0x28')](function(_0x1959cf){if(_0x1959cf&&_0x1959cf['data'][0x0]['code']===_0xed06('0x48')){logger['info'](_0xed06('0x7d'));return{'id':_0x1959cf[_0xed06('0x40')][0x0][_0xed06('0x49')]['id']};}})[_0xed06('0x2b')](function(_0x2e2baf){logger[_0xed06('0x38')](_0xed06('0x7e'),_0x2e2baf['stack']);console[_0xed06('0x7f')]('err',_0x2e2baf);});}exports['queue']=function(_0x3ebcfa,_0x1ba3ab,_0x51d03d,_0x11583c,_0x387b63,_0x46f856){var _0x31402c,_0x4aa235,_0x516329;_0x46f856['host']=intUtil[_0xed06('0x80')](_0x46f856[_0xed06('0x81')]);_0x46f856['serverUrl']=intUtil[_0xed06('0x80')](_0x46f856[_0xed06('0x82')]);if(_0x387b63&&_0x387b63[_0xed06('0x83')]){logger[_0xed06('0x38')](_0xed06('0x84'),_0xed06('0x85'));_0x1ba3ab['recordingURL']=_0x46f856[_0xed06('0x82')]+'/api/voice/recordings/'+_0x1ba3ab[_0xed06('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x1ba3ab[_0xed06('0x86')]);}else{_0x1ba3ab[_0xed06('0x87')]='';}var _0x84d565=_0x46f856['host']===_0xed06('0x88')?'eu':_0xed06('0x89');return getAccessToken(_0x46f856)['then'](function(_0x4869f2){_0x516329=_0x4869f2;return getUser(_0x516329,_0x84d565,_0x46f856,_0x11583c['email']);})[_0xed06('0x28')](function(_0x4254de){_0x31402c=_0x4254de;logger[_0xed06('0x38')](_0xed06('0x8a'),_0x31402c['id']);return getEndUser(_0x516329,_0x84d565,_0x46f856,_0x1ba3ab[_0xed06('0x8b')],_0x1ba3ab[_0xed06('0x8c')],_0x31402c,_0x51d03d);})['then'](function(_0x24feb7){_0x4aa235=_0x24feb7;return getCall(_0x516329,_0x84d565,_0x46f856,_0x31402c,_0x4aa235,_0x51d03d,_0x1ba3ab,_0xed06('0x79'));})[_0xed06('0x28')](function(_0x2369d2){if(_0x2369d2){logger['info'](_0xed06('0x8d'),_0x2369d2['id']);logger['info'](_0xed06('0x84'),_0xed06('0x8e'));emit(util['format'](_0xed06('0x8f'),_0x11583c['name']),_0xed06('0x90'),{'uri':'https://crm.'+_0x46f856[_0xed06('0x81')]+_0xed06('0x91')+_0x2369d2['id']});}})[_0xed06('0x2b')](function(_0x3ba14b){logger[_0xed06('0x2c')](_0xed06('0x84'),JSON[_0xed06('0x3e')](_0x3ba14b));});};exports[_0xed06('0x77')]=function(_0x18f3d9,_0x362c3d,_0x21e3d1,_0x10c9a1,_0x44fb95,_0x1ebbd3,_0x40bfbc){var _0x448d04,_0x366f35,_0x3457f4;_0x1ebbd3['host']=intUtil['stripTrailingSlash'](_0x1ebbd3['host']);_0x1ebbd3[_0xed06('0x82')]=intUtil[_0xed06('0x80')](_0x1ebbd3[_0xed06('0x82')]);if(_0x40bfbc&&_0x40bfbc['recordingFormat']&&_0x40bfbc[_0xed06('0x92')]!==_0xed06('0x93')){logger[_0xed06('0x38')](_0xed06('0x94'),_0xed06('0x85'));_0x362c3d[_0xed06('0x87')]=_0x1ebbd3[_0xed06('0x82')]+_0xed06('0x95')+_0x362c3d['uniqueid']+_0xed06('0x96')+md5(_0x362c3d[_0xed06('0x86')]);}var _0x3c88d9=_0x1ebbd3['host']===_0xed06('0x88')?'eu':'com';return getAccessToken(_0x1ebbd3)[_0xed06('0x28')](function(_0x40f810){_0x3457f4=_0x40f810;return getUser(_0x3457f4,_0x3c88d9,_0x1ebbd3,_0x10c9a1[_0xed06('0x37')]);})['then'](function(_0x3c6365){_0x448d04=_0x3c6365;logger[_0xed06('0x38')]('The\x20User\x20ID\x20is:',_0x448d04['id']);return getEndUser(_0x3457f4,_0x3c88d9,_0x1ebbd3,_0x362c3d[_0xed06('0x97')],_0x362c3d[_0xed06('0x98')],_0x448d04,_0x21e3d1);})[_0xed06('0x28')](function(_0x3d4d86){_0x366f35=_0x3d4d86;return getCall(_0x3457f4,_0x3c88d9,_0x1ebbd3,_0x448d04,_0x366f35,_0x21e3d1,_0x362c3d,_0xed06('0x99'));})[_0xed06('0x28')](function(_0xbc8782){if(_0xbc8782){logger[_0xed06('0x38')](_0xed06('0x8d'),_0xbc8782['id']);logger['info'](_0xed06('0x94'),_0xed06('0x8e'));emit(util[_0xed06('0x30')](_0xed06('0x8f'),_0x10c9a1['name']),_0xed06('0x90'),{'uri':_0xed06('0x9a')+_0x1ebbd3[_0xed06('0x81')]+_0xed06('0x91')+_0xbc8782['id']});}})[_0xed06('0x2b')](function(_0x4e87fe){logger[_0xed06('0x2c')]('[OUTBOUND]',JSON['stringify'](_0x4e87fe));});};exports[_0xed06('0x9b')]=function(_0x3cf3ee,_0x2c3bef,_0x5bfbe6,_0x1ff804,_0x5945c2,_0x1a23a4){var _0x48570c,_0x4a6d20,_0x2e9fd9;_0x1a23a4['host']=intUtil['stripTrailingSlash'](_0x1a23a4[_0xed06('0x81')]);_0x1a23a4['serverUrl']=intUtil[_0xed06('0x80')](_0x1a23a4[_0xed06('0x82')]);if(_0x5945c2&&_0x5945c2[_0xed06('0x83')]){logger['info']('['+_0x2c3bef[_0xed06('0x6c')][_0xed06('0x9c')]()+']','Recording\x20is\x20enabled!');_0x2c3bef['recordingURL']=_0x1a23a4[_0xed06('0x82')]+_0xed06('0x95')+_0x2c3bef['uniqueid']+_0xed06('0x96')+md5(_0x2c3bef[_0xed06('0x86')]);}else{_0x2c3bef[_0xed06('0x87')]='';}var _0x48f269=_0x1a23a4['host']===_0xed06('0x88')?'eu':_0xed06('0x89');return getAccessToken(_0x1a23a4)[_0xed06('0x28')](function(_0x2e72b5){_0x2e9fd9=_0x2e72b5;return getUser(_0x2e9fd9,_0x48f269,_0x1a23a4);})[_0xed06('0x28')](function(_0x398a4f){_0x48570c=_0x398a4f;logger[_0xed06('0x38')](_0xed06('0x8a'),_0x48570c['id']);return getEndUser(_0x2e9fd9,_0x48f269,_0x1a23a4,_0x2c3bef[_0xed06('0x8b')],_0x2c3bef[_0xed06('0x8c')],_0x48570c,_0x5bfbe6);})[_0xed06('0x28')](function(_0x3d0550){_0x4a6d20=_0x3d0550;return getCall(_0x2e9fd9,_0x48f269,_0x1a23a4,_0x48570c,_0x4a6d20,_0x5bfbe6,_0x2c3bef,'Inbound');})[_0xed06('0x28')](function(_0x4ee80e){if(_0x4ee80e){logger['info'](_0xed06('0x8d'),_0x4ee80e['id']);}})['catch'](function(_0x2a7a72){logger[_0xed06('0x2c')]('['+_0x2c3bef[_0xed06('0x6c')]['toUpperCase']()+']',JSON[_0xed06('0x3e')](_0x2a7a72));});}; \ No newline at end of file +var _0x40b5=['Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','Outbound','trigger:browser:url','unmanaged','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','startCase','moduleCreate','role','last_name','Zoho-oauthtoken\x20','code','SUCCESS','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','Leads','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','enduserType','Full_Name','First_Name','What_Id','Last_Name','talktime','Call_Duration','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','mm:ss','Call_Result','Called','complete','Answered','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','starttime','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:'];(function(_0x175a02,_0xb92de3){var _0x5b70cc=function(_0x68dcd9){while(--_0x68dcd9){_0x175a02['push'](_0x175a02['shift']());}};_0x5b70cc(++_0xb92de3);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var rp=require(_0x540b('0x1'));var md5=require(_0x540b('0x2'));var util=require(_0x540b('0x3'));var intUtil=require(_0x540b('0x4'));var moment=require(_0x540b('0x5'));var Redis=require(_0x540b('0x6'));var BPromise=require('bluebird');var config=require(_0x540b('0x7'));var logger=require(_0x540b('0x8'))(_0x540b('0x9'));config[_0x540b('0xa')]=_[_0x540b('0xb')](config['redis'],{'host':_0x540b('0xc'),'port':0x18eb});var io=require(_0x540b('0xd'))(new Redis(config[_0x540b('0xa')]));function emit(_0x5aeb5f,_0x5a9a78,_0x4aed86){io['to'](_0x5aeb5f)['emit'](_0x5a9a78,_0x4aed86);}function request(_0x5c4ca0){logger['debug'](_0x540b('0xe'),JSON['stringify'](_0x5c4ca0));return rp(_0x5c4ca0);}function getCustomFields(_0x1746d4,_0x4e295b){var _0x5f23ae={};if(_0x1746d4[_0x540b('0xf')]>0x0){_[_0x540b('0x10')](_0x1746d4,function(_0x598bce){if(_[_0x540b('0x11')]([_0x540b('0x12'),_0x540b('0x13')],_0x598bce[_0x540b('0x14')])&&_0x598bce['idField']){_0x5f23ae[_0x598bce[_0x540b('0x15')]]=_0x598bce[_0x540b('0x16')][_0x540b('0x17')]();}else if(_0x598bce[_0x540b('0x14')]==='variable'&&_0x598bce[_0x540b('0x18')]&&_0x598bce['idField']&&_0x4e295b[_0x598bce['variableName']]){_0x5f23ae[_0x598bce[_0x540b('0x15')]]=_0x4e295b[_0x598bce[_0x540b('0x18')]][_0x540b('0x17')]();}else if(_0x598bce[_0x540b('0x14')]===_0x540b('0x19')&&_0x598bce['Variable']&&_0x598bce[_0x540b('0x1a')][_0x540b('0x1b')]&&_0x598bce[_0x540b('0x15')]&&_0x4e295b[_0x598bce[_0x540b('0x1a')][_0x540b('0x1b')][_0x540b('0x1c')]()]){_0x5f23ae[_0x598bce[_0x540b('0x15')]]=_0x4e295b[_0x598bce[_0x540b('0x1a')][_0x540b('0x1b')]['toLowerCase']()][_0x540b('0x17')]();}});}return _0x5f23ae;}function getName(_0x471429){if(_0x471429['indexOf']('\x20')>0x0){var _0x135cd7=_0x471429['split'](/ (.+)/);if(_0x135cd7[0x1]){return _0x135cd7;}}return[_0x471429,_0x471429];}var accountsTokens={};function getAccessToken(_0x342cbd){return new Promise(function(_0x5e49d7,_0x4a37f9){if(!_[_0x540b('0x1d')](accountsTokens[_0x342cbd['id']])&&!_['isNil'](accountsTokens[_0x342cbd['id']][_0x540b('0x1e')])){if(moment()[_0x540b('0x1f')](accountsTokens[_0x342cbd['id']][_0x540b('0x20')])){_0x5e49d7(accountsTokens[_0x342cbd['id']]['access_token']);}}var _0x445462;switch(_0x342cbd[_0x540b('0x21')]){case'US':_0x445462=_0x540b('0x22');break;case'AU':_0x445462=_0x540b('0x23');break;case'EU':_0x445462=_0x540b('0x24');break;case'IN':_0x445462=_0x540b('0x25');break;case'CN':_0x445462=_0x540b('0x26');break;default:_0x445462=_0x540b('0x24');break;}var _0x9478e1={'method':_0x540b('0x27'),'uri':_0x445462+'/oauth/v2/token','qs':{'refresh_token':_0x342cbd[_0x540b('0x28')],'client_id':_0x342cbd[_0x540b('0x29')],'client_secret':_0x342cbd['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x9478e1)[_0x540b('0x2a')](function(_0x3d6b0c){accountsTokens[_0x342cbd['id']]={'access_token':_0x3d6b0c[_0x540b('0x1e')],'expires_in':moment()[_0x540b('0x2b')](_0x3d6b0c['expires_in'],_0x540b('0x2c'))};_0x5e49d7(_0x3d6b0c[_0x540b('0x1e')]);})[_0x540b('0x2d')](function(_0x38a93b){logger[_0x540b('0x2e')](_0x540b('0x2f'),_0x38a93b[_0x540b('0x30')]);_0x4a37f9(_0x38a93b);});});}function getUser(_0x4ee8be,_0x574c97,_0x491eca,_0xfd6e3f){logger[_0x540b('0x31')](_0x540b('0x32'));return request({'method':'GET','uri':util['format'](_0x540b('0x33'),_0x574c97),'qs':{'type':_0x540b('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4ee8be},'json':!![]})[_0x540b('0x2a')](function(_0x4693b2){if(_0x4693b2[_0x540b('0x35')]){var _0x3179bb=-0x1;if(_[_0x540b('0x36')](_0x4693b2[_0x540b('0x35')])){if(!_[_0x540b('0x1d')](_0xfd6e3f)){_0x3179bb=_[_0x540b('0x37')](_0x4693b2[_0x540b('0x35')],function(_0x57ce86){return _0x57ce86[_0x540b('0x38')]===_0xfd6e3f;});}if(_0x3179bb>=0x0){logger['info'](_0x540b('0x39'));}else{logger[_0x540b('0x31')](_0x540b('0x3a'));_0x3179bb=_[_0x540b('0x37')](_0x4693b2[_0x540b('0x35')],function(_0xae5f9){return _0xae5f9[_0x540b('0x3b')][_0x540b('0x1b')]===_0x540b('0x3c');});}return _0x4693b2[_0x540b('0x35')][_0x3179bb];}else{if(_0x4693b2['user'][_0x540b('0x3b')]['name']===_0x540b('0x3c')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x4693b2['user'];return user;}else{logger[_0x540b('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x540b('0x3d')](_0x4693b2));throw new Error(_0x540b('0x3e')+JSON['stringify'](_0x4693b2));}}}else{logger['error'](_0x540b('0x3f'),JSON['stringify'](_0x4693b2));throw new Error(_0x540b('0x3e')+JSON[_0x540b('0x3d')](_0x4693b2));}})[_0x540b('0x2d')](function(_0x636df7){console[_0x540b('0x2e')](_0x636df7);});}function getZohoUser(_0x579732,_0x1c9393){return new BPromise(function(_0x36b77d,_0x2adc9f){request(_0x579732)[_0x540b('0x2a')](function(_0x48cf5b){var _0x4df448=null;if(_0x48cf5b){_0x4df448=_0x48cf5b[_0x540b('0x40')][0x0];_0x4df448['enduserType']=_0x1c9393;}_0x36b77d(_0x4df448);})[_0x540b('0x2d')](function(_0x382c24){_0x2adc9f(_0x382c24);});});}function createEndUser(_0x27055a,_0x57eec5,_0x5a8e76,_0x55bf49,_0x4fe6ee,_0x1484db){var _0x5a8e76=getName(_0x5a8e76);return request({'method':'POST','uri':_0x540b('0x41')+_0x57eec5+'/crm/v2/'+_[_0x540b('0x42')](_0x1484db[_0x540b('0x43')])+'s','body':{'data':[{'Last_Name':_0x5a8e76[0x1],'First_Name':_0x5a8e76[0x0],'Phone':_0x55bf49,'Owner':{'name':!_[_0x540b('0x1d')](_0x4fe6ee['role'][_0x540b('0x1b')])?_0x4fe6ee[_0x540b('0x44')][_0x540b('0x1b')]:!_['isNil'](_0x4fe6ee['first_name'])?_0x4fe6ee['first_name']+'\x20'+_0x4fe6ee['last_name']:_0x4fe6ee[_0x540b('0x45')],'id':_0x4fe6ee['id']}}]},'headers':{'Authorization':_0x540b('0x46')+_0x27055a},'json':!![]})[_0x540b('0x2a')](function(_0x39f1b2){if(_0x39f1b2&&_0x39f1b2[_0x540b('0x40')][0x0][_0x540b('0x47')]===_0x540b('0x48')){var _0x3511cf=_0x39f1b2['data'][0x0]['details'];_0x3511cf['enduserType']=_['startCase'](_0x1484db[_0x540b('0x43')])+'s';return _0x3511cf;}logger[_0x540b('0x2e')](_0x540b('0x3f'),JSON[_0x540b('0x3d')](data));throw new Error('Error:\x20'+JSON[_0x540b('0x3d')](data));})[_0x540b('0x2d')](function(_0xd7a3e){console[_0x540b('0x49')](_0x540b('0x4a'),_0xd7a3e);});}function getEndUser(_0x5d9101,_0x461d8e,_0x408e69,_0x2b0838,_0x111919,_0x517f27,_0x57f0bd){var _0x5a57a1={'method':_0x540b('0x4b'),'uri':'','headers':{'Authorization':_0x540b('0x46')+_0x5d9101},'json':!![]};switch(_0x57f0bd[_0x540b('0x4c')]){case _0x540b('0x4d'):_0x5a57a1[_0x540b('0x4e')]=_0x540b('0x41')+_0x461d8e+_0x540b('0x4f')+_0x111919+'))';return getZohoUser(_0x5a57a1,'Contacts')[_0x540b('0x2a')](function(_0x1d5ae7){if(_0x1d5ae7)return _0x1d5ae7;_0x5a57a1['uri']=_0x540b('0x41')+_0x461d8e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x111919+'))';return getZohoUser(_0x5a57a1,'Leads')[_0x540b('0x2a')](function(_0x2616e9){if(_0x2616e9)return _0x2616e9;if(_0x57f0bd[_0x540b('0x43')]!=_0x540b('0x50')){return createEndUser(_0x5d9101,_0x461d8e,_0x2b0838,_0x111919,_0x517f27,_0x57f0bd);}else{return{};}});});break;case _0x540b('0x51'):_0x5a57a1[_0x540b('0x4e')]='https://www.zohoapis.'+_0x461d8e+_0x540b('0x4f')+_0x111919+'))';return getZohoUser(_0x5a57a1,_0x540b('0x52'))['then'](function(_0x301776){if(_0x301776)return _0x301776;if(_0x57f0bd['moduleCreate']!=_0x540b('0x50')){return createEndUser(_0x5d9101,_0x461d8e,_0x2b0838,_0x111919,_0x517f27,_0x57f0bd);}else{return{};}});break;case _0x540b('0x53'):_0x5a57a1[_0x540b('0x4e')]=_0x540b('0x41')+_0x461d8e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x111919+'))';return getZohoUser(_0x5a57a1,_0x540b('0x54'))[_0x540b('0x2a')](function(_0x2e8641){if(_0x2e8641)return _0x2e8641;if(_0x57f0bd[_0x540b('0x43')]!=_0x540b('0x50')){return createEndUser(_0x5d9101,_0x461d8e,_0x2b0838,_0x111919,_0x517f27,_0x57f0bd);}else{return{};}});break;}}function getCall(_0x1d89c0,_0x382587,_0x4a5dcf,_0x4f5094,_0x4c58a9,_0x378017,_0x1cd691,_0x130e2d){logger[_0x540b('0x31')](_0x540b('0x55'));var _0x7c851f={};_0x7c851f[_0x540b('0x56')]={'name':!_[_0x540b('0x1d')](_0x4f5094[_0x540b('0x44')][_0x540b('0x1b')])&&!_['isNil'](_0x4f5094[_0x540b('0x3b')][_0x540b('0x1b')])&&_0x4f5094['profile'][_0x540b('0x1b')]===_0x540b('0x57')?_0x4f5094['role'][_0x540b('0x1b')]:!_[_0x540b('0x1d')](_0x4f5094[_0x540b('0x58')])?_0x4f5094[_0x540b('0x58')]+'\x20'+_0x4f5094[_0x540b('0x45')]:_0x4f5094[_0x540b('0x45')],'id':_0x4f5094['id']};_0x7c851f[_0x540b('0x59')]=intUtil[_0x540b('0x5a')](_0x378017[_0x540b('0x5b')],_0x1cd691,'\x20');_0x7c851f[_0x540b('0x5c')]=intUtil[_0x540b('0x5a')](_0x378017[_0x540b('0x5d')],_0x1cd691,'\x0a');if(_0x4c58a9[_0x540b('0x5e')]===_0x540b('0x52')){_0x7c851f['Who_Id']={'name':!_[_0x540b('0x1d')](_0x4c58a9[_0x540b('0x5f')])?_0x4c58a9['Full_Name']:!_[_0x540b('0x1d')](_0x4c58a9[_0x540b('0x60')])?_0x4c58a9['First_Name']+'\x20'+_0x4c58a9['Last_Name']:_0x4c58a9['Last_Name'],'id':_0x4c58a9['id']};}if(_0x4c58a9[_0x540b('0x5e')]===_0x540b('0x54')){_0x7c851f[_0x540b('0x61')]={'name':!_[_0x540b('0x1d')](_0x4c58a9['Full_Name'])?_0x4c58a9[_0x540b('0x5f')]:!_['isNil'](_0x4c58a9[_0x540b('0x60')])?_0x4c58a9[_0x540b('0x60')]+'\x20'+_0x4c58a9[_0x540b('0x62')]:_0x4c58a9[_0x540b('0x62')],'id':_0x4c58a9['id']};_0x7c851f['$se_module']=_[_0x540b('0x42')](_0x4c58a9[_0x540b('0x5e')]);}if(_0x1cd691[_0x540b('0x63')]){_0x7c851f[_0x540b('0x64')]=moment['utc'](parseInt(_0x1cd691[_0x540b('0x63')])*0x3e8)[_0x540b('0x65')]('mm:ss');}else if(_0x1cd691[_0x540b('0x66')]&&_0x1cd691['endtime']){_0x7c851f[_0x540b('0x64')]=moment['utc'](moment(_0x1cd691[_0x540b('0x67')],_0x540b('0x68'))['diff'](moment(_0x1cd691['starttime'],_0x540b('0x68'))))['format'](_0x540b('0x69'));}switch(_0x1cd691['lastevent']){case'called':_0x7c851f[_0x540b('0x6a')]=_0x540b('0x6b');break;case _0x540b('0x6c'):case'connect':_0x7c851f[_0x540b('0x6a')]=_0x540b('0x6d');break;case'rejected':_0x7c851f['Call_Result']=_0x540b('0x6e');break;case _0x540b('0x6f'):_0x7c851f['Call_Result']=_0x540b('0x70');break;case _0x540b('0x71'):_0x7c851f[_0x540b('0x6a')]='Timeout';default:}_0x7c851f[_0x540b('0x72')]=(_0x130e2d===_0x540b('0x73')?moment(_0x1cd691[_0x540b('0x74')])[_0x540b('0x65')](_0x540b('0x68')):moment(_0x1cd691['agentcalledAt'])[_0x540b('0x65')](_0x540b('0x68')))||moment()['format'](_0x540b('0x68'));_0x7c851f[_0x540b('0x75')]=_0x130e2d||_0x540b('0x76');_0x7c851f=_['merge'](_0x7c851f,getCustomFields(_0x378017[_0x540b('0x77')],_0x1cd691));return request({'method':_0x540b('0x27'),'uri':_0x540b('0x41')+_0x382587+_0x540b('0x78'),'headers':{'Authorization':_0x540b('0x46')+_0x1d89c0},'body':{'data':[_0x7c851f]},'json':!![]})['then'](function(_0x573713){if(_0x573713&&_0x573713[_0x540b('0x40')][0x0][_0x540b('0x47')]===_0x540b('0x48')){logger[_0x540b('0x31')](_0x540b('0x79'));return{'id':_0x573713[_0x540b('0x40')][0x0][_0x540b('0x7a')]['id']};}})[_0x540b('0x2d')](function(_0x33e956){logger['info'](_0x540b('0x7b'),_0x33e956['stack']);console[_0x540b('0x49')]('err',_0x33e956);});}exports['queue']=function(_0xe114cd,_0x7f429d,_0x164b82,_0x2119f5,_0x53e806,_0x4fbd42){var _0x49f0b7,_0xbd6a8b,_0xf4b76c;_0x4fbd42[_0x540b('0x7c')]=intUtil[_0x540b('0x7d')](_0x4fbd42[_0x540b('0x7c')]);_0x4fbd42[_0x540b('0x7e')]=intUtil[_0x540b('0x7d')](_0x4fbd42[_0x540b('0x7e')]);if(_0x53e806&&_0x53e806[_0x540b('0x7f')]){logger[_0x540b('0x31')]('[QUEUE]','Recording\x20is\x20enabled!');_0x7f429d[_0x540b('0x80')]=_0x4fbd42[_0x540b('0x7e')]+_0x540b('0x81')+_0x7f429d['uniqueid']+_0x540b('0x82')+md5(_0x7f429d[_0x540b('0x83')]);}else{_0x7f429d[_0x540b('0x80')]='';}var _0x22a9e8=_0x4fbd42[_0x540b('0x7c')]===_0x540b('0x84')?'eu':_0x540b('0x85');return getAccessToken(_0x4fbd42)['then'](function(_0x4a81c3){_0xf4b76c=_0x4a81c3;return getUser(_0xf4b76c,_0x22a9e8,_0x4fbd42,_0x2119f5[_0x540b('0x38')]);})[_0x540b('0x2a')](function(_0x281b07){_0x49f0b7=_0x281b07;logger[_0x540b('0x31')]('The\x20User\x20ID\x20is:',_0x49f0b7['id']);return getEndUser(_0xf4b76c,_0x22a9e8,_0x4fbd42,_0x7f429d[_0x540b('0x86')],_0x7f429d[_0x540b('0x87')],_0x49f0b7,_0x164b82);})[_0x540b('0x2a')](function(_0x75149f){_0xbd6a8b=_0x75149f;return getCall(_0xf4b76c,_0x22a9e8,_0x4fbd42,_0x49f0b7,_0xbd6a8b,_0x164b82,_0x7f429d,'Inbound');})[_0x540b('0x2a')](function(_0x44a6b0){if(_0x44a6b0){logger['info'](_0x540b('0x88'),_0x44a6b0['id']);logger[_0x540b('0x31')]('[QUEUE]',_0x540b('0x89'));emit(util[_0x540b('0x65')](_0x540b('0x8a'),_0x2119f5[_0x540b('0x1b')]),'trigger:browser:url',{'uri':_0x540b('0x8b')+_0x4fbd42['host']+_0x540b('0x8c')+_0x44a6b0['id']});}})[_0x540b('0x2d')](function(_0x1b071a){logger[_0x540b('0x2e')](_0x540b('0x8d'),JSON['stringify'](_0x1b071a));});};exports[_0x540b('0x73')]=function(_0x3ece6b,_0x13b8a1,_0x5f0bd7,_0x498618,_0x35a3d4,_0x409ce5,_0x4a1265){var _0x384e51,_0x244da5,_0x2ac9e5;_0x409ce5['host']=intUtil[_0x540b('0x7d')](_0x409ce5[_0x540b('0x7c')]);_0x409ce5['serverUrl']=intUtil[_0x540b('0x7d')](_0x409ce5[_0x540b('0x7e')]);if(_0x4a1265&&_0x4a1265[_0x540b('0x8e')]&&_0x4a1265[_0x540b('0x8e')]!==_0x540b('0x8f')){logger['info'](_0x540b('0x90'),_0x540b('0x91'));_0x13b8a1[_0x540b('0x80')]=_0x409ce5[_0x540b('0x7e')]+'/api/voice/recordings/'+_0x13b8a1[_0x540b('0x83')]+_0x540b('0x82')+md5(_0x13b8a1['uniqueid']);}var _0xfaf1c8=_0x409ce5[_0x540b('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x409ce5)['then'](function(_0x2fb8fc){_0x2ac9e5=_0x2fb8fc;return getUser(_0x2ac9e5,_0xfaf1c8,_0x409ce5,_0x498618[_0x540b('0x38')]);})['then'](function(_0x49dc87){_0x384e51=_0x49dc87;logger[_0x540b('0x31')](_0x540b('0x92'),_0x384e51['id']);return getEndUser(_0x2ac9e5,_0xfaf1c8,_0x409ce5,_0x13b8a1[_0x540b('0x93')],_0x13b8a1['destcalleridnum'],_0x384e51,_0x5f0bd7);})[_0x540b('0x2a')](function(_0x1d19e7){_0x244da5=_0x1d19e7;return getCall(_0x2ac9e5,_0xfaf1c8,_0x409ce5,_0x384e51,_0x244da5,_0x5f0bd7,_0x13b8a1,_0x540b('0x94'));})[_0x540b('0x2a')](function(_0x57db82){if(_0x57db82){logger[_0x540b('0x31')](_0x540b('0x88'),_0x57db82['id']);logger[_0x540b('0x31')]('[OUTBOUND]',_0x540b('0x89'));emit(util['format'](_0x540b('0x8a'),_0x498618[_0x540b('0x1b')]),_0x540b('0x95'),{'uri':_0x540b('0x8b')+_0x409ce5[_0x540b('0x7c')]+_0x540b('0x8c')+_0x57db82['id']});}})[_0x540b('0x2d')](function(_0x47f709){logger[_0x540b('0x2e')](_0x540b('0x90'),JSON[_0x540b('0x3d')](_0x47f709));});};exports[_0x540b('0x96')]=function(_0x279fbf,_0x3b6908,_0xde0938,_0x423e86,_0x1dd2f7,_0x57b054){var _0x2cbfa3,_0x5357c9,_0x95dcf;_0x57b054['host']=intUtil[_0x540b('0x7d')](_0x57b054['host']);_0x57b054[_0x540b('0x7e')]=intUtil[_0x540b('0x7d')](_0x57b054[_0x540b('0x7e')]);if(_0x1dd2f7&&_0x1dd2f7[_0x540b('0x7f')]){logger[_0x540b('0x31')]('['+_0x3b6908[_0x540b('0x97')]['toUpperCase']()+']',_0x540b('0x91'));_0x3b6908[_0x540b('0x80')]=_0x57b054['serverUrl']+'/api/voice/recordings/'+_0x3b6908[_0x540b('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x3b6908[_0x540b('0x83')]);}else{_0x3b6908['recordingURL']='';}var _0x210afe=_0x57b054[_0x540b('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x57b054)[_0x540b('0x2a')](function(_0x1a91e7){_0x95dcf=_0x1a91e7;return getUser(_0x95dcf,_0x210afe,_0x57b054);})[_0x540b('0x2a')](function(_0xf3c770){_0x2cbfa3=_0xf3c770;logger[_0x540b('0x31')](_0x540b('0x92'),_0x2cbfa3['id']);return getEndUser(_0x95dcf,_0x210afe,_0x57b054,_0x3b6908[_0x540b('0x86')],_0x3b6908['calleridnum'],_0x2cbfa3,_0xde0938);})[_0x540b('0x2a')](function(_0x1c8144){_0x5357c9=_0x1c8144;return getCall(_0x95dcf,_0x210afe,_0x57b054,_0x2cbfa3,_0x5357c9,_0xde0938,_0x3b6908,'Inbound');})[_0x540b('0x2a')](function(_0x4d9e85){if(_0x4d9e85){logger[_0x540b('0x31')]('The\x20Call\x20ID\x20is:',_0x4d9e85['id']);}})[_0x540b('0x2d')](function(_0x9d5a15){logger['error']('['+_0x3b6908[_0x540b('0x97')]['toUpperCase']()+']',JSON[_0x540b('0x3d')](_0x9d5a15));});}; \ 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 8f362bc..9517971 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 _0x473f=['data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x10f99a,_0x46e1f1){var _0x5aba0e=function(_0x37a737){while(--_0x37a737){_0x10f99a['push'](_0x10f99a['shift']());}};_0x5aba0e(++_0x46e1f1);}(_0x473f,0x1d6));var _0xf473=function(_0x447d99,_0x5bf37c){_0x447d99=_0x447d99-0x0;var _0x834081=_0x473f[_0x447d99];return _0x834081;};'use strict';var util=require(_0xf473('0x0'));var sh=require(_0xf473('0x1'));var Mustache=require(_0xf473('0x2'));var logger=require(_0xf473('0x3'))(_0xf473('0x4'));exports[_0xf473('0x5')]=function(_0x5da3de,_0x56a4b3){var _0x1d90d8=_0x5da3de[_0xf473('0x6')]?_0x5da3de[_0xf473('0x6')]:_0xf473('0x7');var _0xcdee1e=_0x5da3de[_0xf473('0x8')]?Mustache[_0xf473('0x9')](_0x5da3de[_0xf473('0x8')],_0x56a4b3):_0x56a4b3;sh['exec'](_0xcdee1e,function(_0x39f9b6,_0x5cf10a,_0x1d910e){if(_0x39f9b6!==0x0){logger['error'](util[_0xf473('0xa')](_0xf473('0xb'),_0x1d90d8,_0xcdee1e,_0x39f9b6,_0x1d910e));}else{logger[_0xf473('0xc')](util[_0xf473('0xa')](_0xf473('0xd'),_0x1d90d8,_0xcdee1e,_0x5cf10a));}});}; \ No newline at end of file +var _0x0d3a=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','data2','Script','data3','render','exec','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x4f3cf6,_0x1d8c0b){var _0x26309f=function(_0x5031c5){while(--_0x5031c5){_0x4f3cf6['push'](_0x4f3cf6['shift']());}};_0x26309f(++_0x1d8c0b);}(_0x0d3a,0x1c9));var _0xa0d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d3a[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xa0d3('0x0'));var sh=require(_0xa0d3('0x1'));var Mustache=require(_0xa0d3('0x2'));var logger=require(_0xa0d3('0x3'))('trigger');exports['exec']=function(_0x43f49,_0x5d3be8){var _0x4c91bc=_0x43f49[_0xa0d3('0x4')]?_0x43f49['data2']:_0xa0d3('0x5');var _0x2f6e87=_0x43f49[_0xa0d3('0x6')]?Mustache[_0xa0d3('0x7')](_0x43f49[_0xa0d3('0x6')],_0x5d3be8):_0x5d3be8;sh[_0xa0d3('0x8')](_0x2f6e87,function(_0x1418db,_0x28aa4a,_0x73fa42){if(_0x1418db!==0x0){logger['error'](util[_0xa0d3('0x9')](_0xa0d3('0xa'),_0x4c91bc,_0x2f6e87,_0x1418db,_0x73fa42));}else{logger[_0xa0d3('0xb')](util[_0xa0d3('0x9')](_0xa0d3('0xc'),_0x4c91bc,_0x2f6e87,_0x28aa4a));}});}; \ 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 a3ea94f..582b394 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 _0xd5d5=['statusCode','catch','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','then','isNil',',\x20request\x20body:\x20','object','stringify'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0xd5d5,0x185));var _0x5d5d=function(_0x24cf7f,_0xcda231){_0x24cf7f=_0x24cf7f-0x0;var _0x4c6742=_0xd5d5[_0x24cf7f];return _0x4c6742;};'use strict';var rp=require(_0x5d5d('0x0'));var util=require(_0x5d5d('0x1'));var _=require(_0x5d5d('0x2'));var Mustache=require(_0x5d5d('0x3'));var logger=require(_0x5d5d('0x4'))('trigger');exports[_0x5d5d('0x5')]=function(_0x3cb5b4,_0x26eae0){var _0x4d13e2,_0xe05d2c;var _0x20f487={'method':_0x3cb5b4[_0x5d5d('0x6')][_0x5d5d('0x7')](),'uri':Mustache[_0x5d5d('0x8')](_0x3cb5b4[_0x5d5d('0x9')],_0x26eae0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3cb5b4['data5'])===_0x5d5d('0xa')&&parseInt(_0x3cb5b4[_0x5d5d('0xb')])>=0x1&&parseInt(_0x3cb5b4['data5'])<=0xa?parseInt(_0x3cb5b4[_0x5d5d('0xb')])*0x3e8:0x5*0x3e8};try{_0x20f487[_0x5d5d('0xc')]=_0x3cb5b4[_0x5d5d('0xd')]?JSON[_0x5d5d('0xe')](Mustache[_0x5d5d('0x8')](_0x3cb5b4[_0x5d5d('0xd')],_0x26eae0)):{};}catch(_0x26924d){logger[_0x5d5d('0xf')](_0x26924d[_0x5d5d('0x10')]);}switch(_0x3cb5b4[_0x5d5d('0x6')]['toUpperCase']()){case _0x5d5d('0x11'):case _0x5d5d('0x12'):_0x4d13e2=null;_0x20f487['qs']=_0x26eae0;break;case _0x5d5d('0x13'):case _0x5d5d('0x14'):if(_0x3cb5b4[_0x5d5d('0x15')]){try{_0x4d13e2=JSON[_0x5d5d('0xe')](Mustache[_0x5d5d('0x8')](_0x3cb5b4[_0x5d5d('0x15')],_0x26eae0));_0x20f487[_0x5d5d('0x16')]=_0x4d13e2;}catch(_0x405c9d){logger[_0x5d5d('0xf')](_0x405c9d[_0x5d5d('0x10')]);logger[_0x5d5d('0xf')](_0x5d5d('0x17'));}}else{_0x4d13e2=_0x26eae0;_0x20f487[_0x5d5d('0x16')]=_0x4d13e2;}break;}logger[_0x5d5d('0x18')](util[_0x5d5d('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3cb5b4[_0x5d5d('0x6')],_0x3cb5b4[_0x5d5d('0x9')],JSON['stringify'](_0x20f487)));rp(_0x20f487)[_0x5d5d('0x1a')](function(_0x162dfa){_0x4d13e2=!_[_0x5d5d('0x1b')](_0x4d13e2)?_0x5d5d('0x1c')+_0x4d13e2:'';_0xe05d2c=typeof _0x162dfa['body']===_0x5d5d('0x1d')?JSON[_0x5d5d('0x1e')](_0x162dfa[_0x5d5d('0x16')]):_0x162dfa[_0x5d5d('0x16')];logger[_0x5d5d('0x18')](util[_0x5d5d('0x19')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3cb5b4[_0x5d5d('0x6')],_0x3cb5b4[_0x5d5d('0x9')],_0x162dfa[_0x5d5d('0x1f')],_0xe05d2c));})[_0x5d5d('0x20')](function(_0x33a394){logger[_0x5d5d('0xf')](util[_0x5d5d('0x19')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3cb5b4[_0x5d5d('0x6')],_0x3cb5b4[_0x5d5d('0x9')],_0x33a394['statusCode'],_0x33a394[_0x5d5d('0x21')],_0x33a394[_0x5d5d('0x22')]));});}; \ No newline at end of file +var _0xdd1c=['util','mustache','trigger','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','stack','GET','DELETE','PUT','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise'];(function(_0x2ae2cd,_0xb42c96){var _0xc52725=function(_0x4dda00){while(--_0x4dda00){_0x2ae2cd['push'](_0x2ae2cd['shift']());}};_0xc52725(++_0xb42c96);}(_0xdd1c,0x83));var _0xcdd1=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xdd1c[_0x2e249d];return _0x1faa37;};'use strict';var rp=require(_0xcdd1('0x0'));var util=require(_0xcdd1('0x1'));var _=require('lodash');var Mustache=require(_0xcdd1('0x2'));var logger=require('../../../../config/logger')(_0xcdd1('0x3'));exports[_0xcdd1('0x4')]=function(_0xd2b6d0,_0x139b10){var _0x16ad79,_0x449e34;var _0x49f55f={'method':_0xd2b6d0[_0xcdd1('0x5')][_0xcdd1('0x6')](),'uri':Mustache['render'](_0xd2b6d0[_0xcdd1('0x7')],_0x139b10),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xd2b6d0[_0xcdd1('0x8')])===_0xcdd1('0x9')&&parseInt(_0xd2b6d0[_0xcdd1('0x8')])>=0x1&&parseInt(_0xd2b6d0['data5'])<=0xa?parseInt(_0xd2b6d0['data5'])*0x3e8:0x5*0x3e8};try{_0x49f55f[_0xcdd1('0xa')]=_0xd2b6d0[_0xcdd1('0xb')]?JSON[_0xcdd1('0xc')](Mustache[_0xcdd1('0xd')](_0xd2b6d0[_0xcdd1('0xb')],_0x139b10)):{};}catch(_0x1870f9){logger['error'](_0x1870f9[_0xcdd1('0xe')]);}switch(_0xd2b6d0[_0xcdd1('0x5')]['toUpperCase']()){case _0xcdd1('0xf'):case _0xcdd1('0x10'):_0x16ad79=null;_0x49f55f['qs']=_0x139b10;break;case'POST':case _0xcdd1('0x11'):if(_0xd2b6d0['data7']){try{_0x16ad79=JSON[_0xcdd1('0xc')](Mustache['render'](_0xd2b6d0[_0xcdd1('0x12')],_0x139b10));_0x49f55f[_0xcdd1('0x13')]=_0x16ad79;}catch(_0x14ee27){logger[_0xcdd1('0x14')](_0x14ee27[_0xcdd1('0xe')]);logger[_0xcdd1('0x14')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x16ad79=_0x139b10;_0x49f55f['body']=_0x16ad79;}break;}logger[_0xcdd1('0x15')](util[_0xcdd1('0x16')](_0xcdd1('0x17'),_0xd2b6d0['data1'],_0xd2b6d0[_0xcdd1('0x7')],JSON[_0xcdd1('0x18')](_0x49f55f)));rp(_0x49f55f)[_0xcdd1('0x19')](function(_0x30cf2e){_0x16ad79=!_[_0xcdd1('0x1a')](_0x16ad79)?_0xcdd1('0x1b')+_0x16ad79:'';_0x449e34=typeof _0x30cf2e[_0xcdd1('0x13')]===_0xcdd1('0x1c')?JSON[_0xcdd1('0x18')](_0x30cf2e[_0xcdd1('0x13')]):_0x30cf2e[_0xcdd1('0x13')];logger[_0xcdd1('0x15')](util[_0xcdd1('0x16')](_0xcdd1('0x1d'),_0xd2b6d0['data1'],_0xd2b6d0['data2'],_0x30cf2e[_0xcdd1('0x1e')],_0x449e34));})['catch'](function(_0x27b940){logger[_0xcdd1('0x14')](util[_0xcdd1('0x16')](_0xcdd1('0x1f'),_0xd2b6d0[_0xcdd1('0x5')],_0xd2b6d0['data2'],_0x27b940['statusCode'],_0x27b940['name'],_0x27b940[_0xcdd1('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4e4e2cf..de2e64a 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 _0xbc16=['routing','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x3322f4,_0x443dfb){var _0x14aeca=function(_0x1968d4){while(--_0x1968d4){_0x3322f4['push'](_0x3322f4['shift']());}};_0x14aeca(++_0x443dfb);}(_0xbc16,0x183));var _0x6bc1=function(_0x19ee67,_0x329ee8){_0x19ee67=_0x19ee67-0x0;var _0x501f69=_0xbc16[_0x19ee67];return _0x501f69;};'use strict';var jayson=require(_0x6bc1('0x0'));var BPromise=require(_0x6bc1('0x1'));var logger=require(_0x6bc1('0x2'))(_0x6bc1('0x3'));var client=jayson['client'][_0x6bc1('0x4')]({'port':0x2329});client[_0x6bc1('0x5')]=function(_0x290fed,_0x31a544){return new BPromise(function(_0x318f43,_0x42ea68){return client[_0x6bc1('0x6')](_0x290fed,_0x31a544)[_0x6bc1('0x7')](function(_0x463c4a){logger[_0x6bc1('0x8')](_0x6bc1('0x9'),_0x6bc1('0x3'),_0x290fed,_0x31a544,_0x463c4a);if(_0x463c4a[_0x6bc1('0xa')]){logger[_0x6bc1('0xa')](_0x6bc1('0x9'),_0x6bc1('0x3'),_0x290fed,_0x463c4a['error'][_0x6bc1('0xb')],_0x31a544);return _0x42ea68(_0x463c4a[_0x6bc1('0xa')][_0x6bc1('0xb')]);}else{return _0x318f43(_0x463c4a[_0x6bc1('0xc')]);}})[_0x6bc1('0xd')](function(_0x13f9fb){logger[_0x6bc1('0xa')](_0x6bc1('0x9'),_0x6bc1('0x3'),_0x290fed,_0x13f9fb,_0x31a544);return _0x42ea68(_0x13f9fb);});});};module[_0x6bc1('0xe')]=client; \ No newline at end of file +var _0x633a=['debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then'];(function(_0x4b6eed,_0x2b2ea1){var _0x1523c3=function(_0x982808){while(--_0x982808){_0x4b6eed['push'](_0x4b6eed['shift']());}};_0x1523c3(++_0x2b2ea1);}(_0x633a,0x1cc));var _0xa633=function(_0xc42499,_0x511a21){_0xc42499=_0xc42499-0x0;var _0x4633d1=_0x633a[_0xc42499];return _0x4633d1;};'use strict';var jayson=require(_0xa633('0x0'));var BPromise=require(_0xa633('0x1'));var logger=require(_0xa633('0x2'))(_0xa633('0x3'));var client=jayson['client'][_0xa633('0x4')]({'port':0x2329});client[_0xa633('0x5')]=function(_0xfde693,_0x2a28be){return new BPromise(function(_0x506398,_0x48c37e){return client[_0xa633('0x6')](_0xfde693,_0x2a28be)[_0xa633('0x7')](function(_0x3619eb){logger[_0xa633('0x8')](_0xa633('0x9'),'routing',_0xfde693,_0x2a28be,_0x3619eb);if(_0x3619eb[_0xa633('0xa')]){logger[_0xa633('0xa')](_0xa633('0x9'),_0xa633('0x3'),_0xfde693,_0x3619eb[_0xa633('0xa')]['message'],_0x2a28be);return _0x48c37e(_0x3619eb[_0xa633('0xa')][_0xa633('0xb')]);}else{return _0x506398(_0x3619eb['result']);}})[_0xa633('0xc')](function(_0x11a2a7){logger[_0xa633('0xa')]('rpc',_0xa633('0x3'),_0xfde693,_0x11a2a7,_0x2a28be);return _0x48c37e(_0x11a2a7);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 92c47bd..a21c421 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 _0xe8bd=['initMailAccounts','then','refresh','mailAccounts','listen','getSettings','catch','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts'];(function(_0x542533,_0x29d85b){var _0x581e98=function(_0x40f9eb){while(--_0x40f9eb){_0x542533['push'](_0x542533['shift']());}};_0x581e98(++_0x29d85b);}(_0xe8bd,0x148));var _0xde8b=function(_0x1e71e1,_0xd25f42){_0x1e71e1=_0x1e71e1-0x0;var _0x4d6259=_0xe8bd[_0x1e71e1];return _0x4d6259;};'use strict';var server=require('./server');var Realtime=require(_0xde8b('0x0'));var EmailChannel=require(_0xde8b('0x1'));var mailAccount=require(_0xde8b('0x2'));var setting=require(_0xde8b('0x3'));var logger=require(_0xde8b('0x4'))(_0xde8b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xde8b('0x6')]()['then'](mailAccount[_0xde8b('0x7')]())['then'](realtime[_0xde8b('0x8')]())[_0xde8b('0x9')](function(){email[_0xde8b('0xa')](realtime[_0xde8b('0xb')]);return realtime;});}function main(){return server[_0xde8b('0xc')](realtime,email)[_0xde8b('0x9')](function(){return initRealtime();})[_0xde8b('0x9')](function(){return setting[_0xde8b('0xd')]();})['then'](function(_0x2dd5a4){return setInterval(initRealtime,_0x2dd5a4['loginMailFrequency']*0x3e8);})[_0xde8b('0xe')](function(_0x40acbe){logger['error'](_0xde8b('0xf'),_0x40acbe);});}main(); \ No newline at end of file +var _0xa55a=['then','initMailAccounts','mailAccounts','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','email','resolve','getMailAccounts'];(function(_0x34fe5f,_0x2bf817){var _0x3544a8=function(_0xc0c120){while(--_0xc0c120){_0x34fe5f['push'](_0x34fe5f['shift']());}};_0x3544a8(++_0x2bf817);}(_0xa55a,0xf5));var _0xaa55=function(_0xac84a5,_0x12ed84){_0xac84a5=_0xac84a5-0x0;var _0x3bf698=_0xa55a[_0xac84a5];return _0x3bf698;};'use strict';var server=require(_0xaa55('0x0'));var Realtime=require(_0xaa55('0x1'));var EmailChannel=require(_0xaa55('0x2'));var mailAccount=require(_0xaa55('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0xaa55('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xaa55('0x5')]()['then'](mailAccount[_0xaa55('0x6')]())[_0xaa55('0x7')](realtime[_0xaa55('0x8')]())['then'](function(){email['refresh'](realtime[_0xaa55('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xaa55('0x7')](function(){return initRealtime();})[_0xaa55('0x7')](function(){return setting['getSettings']();})[_0xaa55('0x7')](function(_0x5f4c21){return setInterval(initRealtime,_0x5f4c21['loginMailFrequency']*0x3e8);})['catch'](function(_0x438b4f){logger[_0xaa55('0xa')](_0xaa55('0xb'),_0x438b4f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1ed857d..3b16172 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 _0x3b34=['name','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messages','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','verifySmtp','Smtp','smtp','verify','then','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x3b34,0x1af));var _0x43b3=function(_0x4a8c28,_0x2b0254){_0x4a8c28=_0x4a8c28-0x0;var _0x1ee153=_0x3b34[_0x4a8c28];return _0x1ee153;};'use strict';var _=require(_0x43b3('0x0'));var moment=require(_0x43b3('0x1'));var BPromise=require(_0x43b3('0x2'));var md5=require(_0x43b3('0x3'));var Redis=require(_0x43b3('0x4'));var config=require('../../../config/environment');var logger=require(_0x43b3('0x5'))('email');config[_0x43b3('0x6')]=_[_0x43b3('0x7')](config['redis'],{'host':_0x43b3('0x8'),'port':0x18eb});var io=require(_0x43b3('0x9'))(new Redis(config[_0x43b3('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x43b3('0xa'));var mailAccount=require(_0x43b3('0xb'));var md5Accounts={};function EmailChannel(_0x3a2b56){logger[_0x43b3('0xc')]('start\x20email\x20channel');this[_0x43b3('0xd')]=_0x3a2b56[_0x43b3('0xd')];this[_0x43b3('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x43b3('0xf')][_0x43b3('0x10')]=function(_0x464d90){var _0x443e12=this[_0x43b3('0xd')][_0x464d90];var _0x4918bc={'id':_0x443e12['id'],'name':_0x443e12[_0x43b3('0x11')],'key':_0x443e12['key'],'active':_0x443e12[_0x43b3('0x12')],'Imap':{'status':_0x443e12[_0x43b3('0x13')][_0x43b3('0x14')],'messageStatus':_0x443e12[_0x43b3('0x13')][_0x43b3('0x15')],'total':_0x443e12[_0x43b3('0x13')][_0x43b3('0x16')]}};if(_[_0x43b3('0x17')](md5Accounts[_0x464d90])){md5Accounts[_0x464d90]={};}var _0x391e40=md5(JSON[_0x43b3('0x18')](_0x4918bc));if(md5Accounts[_0x464d90][_0x43b3('0x3')]!==_0x391e40){md5Accounts[_0x464d90]['md5']=_0x391e40;io[_0x43b3('0x10')](_0x43b3('0x19'),_0x4918bc);}};EmailChannel['prototype'][_0x43b3('0x1a')]=function(_0xfd57d9){for(var _0x22151a in _0xfd57d9){if(_0xfd57d9[_0x43b3('0x1b')](_0x22151a)){if(_0xfd57d9[_0x22151a][_0x43b3('0x13')]&&_0xfd57d9[_0x22151a][_0x43b3('0x12')]){var _0x2c1220=_0xfd57d9[_0x22151a][_0x43b3('0x13')];if(!_0x2c1220[_0x43b3('0x1c')]&&_0xfd57d9[_0x22151a][_0x43b3('0x1d')]!==_0x43b3('0x1e'))_0x2c1220[_0x43b3('0x1c')]=_0xfd57d9[_0x22151a][_0x43b3('0x1d')];if(!this[_0x43b3('0xe')][_0x43b3('0x1b')](_0x2c1220['id'])){this[_0x43b3('0xe')][_0x2c1220['id']]=new EmailImap(_0x2c1220,_0xfd57d9[_0x22151a][_0x43b3('0x1f')]);this['imapAccounts'][_0x2c1220['id']]['on'](_0x43b3('0x20'),this[_0x43b3('0x21')][_0x43b3('0x22')](this,_0x22151a));this['imapAccounts'][_0x2c1220['id']]['on'](_0x43b3('0x1f'),this[_0x43b3('0x23')][_0x43b3('0x22')](this,_0x22151a));this[_0x43b3('0xe')][_0x2c1220['id']]['on'](_0x43b3('0x24'),this['handleImapEnd'][_0x43b3('0x22')](this,_0x22151a));this['imapAccounts'][_0x2c1220['id']]['on'](_0x43b3('0x25'),this[_0x43b3('0x26')][_0x43b3('0x22')](this,_0x22151a));}}else{if(_[_0x43b3('0x17')](this['mailAccounts'][_0x22151a]['Imap'])){this[_0x43b3('0xd')][_0x22151a][_0x43b3('0x13')]={};}this[_0x43b3('0xd')][_0x22151a][_0x43b3('0x13')][_0x43b3('0x14')]='disabled';this[_0x43b3('0xd')][_0x22151a]['Imap']['messageStatus']='';this['emit'](_0x22151a);}}}};EmailChannel[_0x43b3('0xf')][_0x43b3('0x21')]=function(_0x3edabb,_0xaba7fe){if(this[_0x43b3('0xd')][_0x3edabb]){this[_0x43b3('0xd')][_0x3edabb]['Imap'][_0x43b3('0x14')]=_0x43b3('0x27');this[_0x43b3('0xd')][_0x3edabb][_0x43b3('0x13')]['messageStatus']=_0xaba7fe[_0x43b3('0x11')];if(_0xaba7fe[_0x43b3('0x28')]){this['mailAccounts'][_0x3edabb][_0x43b3('0x13')]['total']=_0xaba7fe['messages']['total'];}return this['emit'](_0x3edabb);}};EmailChannel['prototype'][_0x43b3('0x23')]=function(_0x2b1a53,_0x482301){logger[_0x43b3('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x482301[_0x43b3('0x29')],_0x482301[_0x43b3('0x2a')],_0x482301[_0x43b3('0x2b')],_0x2b1a53);if(this[_0x43b3('0xd')][_0x2b1a53]){return mailAccount[_0x43b3('0x2c')](_0x2b1a53,_0x482301)['then'](function(_0x3baf99){if(_0x3baf99){logger[_0x43b3('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x43b3('0x2d')](function(_0x114190){logger[_0x43b3('0x25')](_0x43b3('0x2e'),JSON['stringify'](_0x114190));});}};EmailChannel[_0x43b3('0xf')][_0x43b3('0x2f')]=function(_0x5abd6c){if(this[_0x43b3('0xd')][_0x5abd6c]&&this[_0x43b3('0xd')][_0x5abd6c]['Imap']){if(this[_0x43b3('0xe')][this[_0x43b3('0xd')][_0x5abd6c]['Imap']['id']]){delete this['imapAccounts'][this[_0x43b3('0xd')][_0x5abd6c][_0x43b3('0x13')]['id']];}this[_0x43b3('0xd')][_0x5abd6c]['Imap'][_0x43b3('0x30')]=moment();this[_0x43b3('0x10')](_0x5abd6c);}};EmailChannel[_0x43b3('0xf')][_0x43b3('0x26')]=function(_0x2fee5c,_0x29b017){if(this['mailAccounts'][_0x2fee5c]){this['mailAccounts'][_0x2fee5c][_0x43b3('0x13')][_0x43b3('0x14')]=_0x43b3('0x25');this[_0x43b3('0xd')][_0x2fee5c][_0x43b3('0x13')]['messageStatus']=_0x29b017;return this[_0x43b3('0x10')](_0x2fee5c);}};EmailChannel[_0x43b3('0xf')][_0x43b3('0x31')]=function(_0x553729,_0x4d211f){return this['smtp']['send'](_0x553729,_0x4d211f);};EmailChannel['prototype'][_0x43b3('0x32')]=function(_0x26f33a){var _0x5183b9=this;if(this[_0x43b3('0xd')][_0x26f33a['id']]){if(_[_0x43b3('0x17')](this[_0x43b3('0xd')][_0x26f33a['id']][_0x43b3('0x33')])){this[_0x43b3('0xd')][_0x26f33a['id']]['Smtp']={};}this[_0x43b3('0xd')][_0x26f33a['id']][_0x43b3('0x33')][_0x43b3('0x30')]=moment();return new BPromise(function(_0x4e0e70,_0x3579da){return _0x5183b9[_0x43b3('0x34')][_0x43b3('0x35')](_0x26f33a)[_0x43b3('0x36')](function(_0x4588d6){_0x5183b9[_0x43b3('0xd')][_0x26f33a['id']][_0x43b3('0x33')][_0x43b3('0x14')]=_0x43b3('0x37');_0x5183b9[_0x43b3('0xd')][_0x26f33a['id']]['Smtp']['messageStatus']='';_0x5183b9[_0x43b3('0x10')](_0x26f33a['id']);_0x4e0e70(_0x4588d6);})[_0x43b3('0x2d')](function(_0x44b745){_0x5183b9['mailAccounts'][_0x26f33a['id']][_0x43b3('0x33')]['status']='error';_0x5183b9[_0x43b3('0xd')][_0x26f33a['id']][_0x43b3('0x33')][_0x43b3('0x15')]=_0x44b745;_0x5183b9[_0x43b3('0x10')](_0x26f33a['id']);_0x3579da(_0x44b745);});});}return this[_0x43b3('0x34')][_0x43b3('0x35')](_0x26f33a);};module['exports']=EmailChannel; \ No newline at end of file +var _0xd319=['sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','Imap','service','custom','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','handleImapError'];(function(_0x32efb5,_0x1b6f42){var _0x5b644c=function(_0x44e59b){while(--_0x44e59b){_0x32efb5['push'](_0x32efb5['shift']());}};_0x5b644c(++_0x1b6f42);}(_0xd319,0xe3));var _0x9d31=function(_0x225491,_0x3a9357){_0x225491=_0x225491-0x0;var _0x4c8500=_0xd319[_0x225491];return _0x4c8500;};'use strict';var _=require(_0x9d31('0x0'));var moment=require(_0x9d31('0x1'));var BPromise=require(_0x9d31('0x2'));var md5=require(_0x9d31('0x3'));var Redis=require(_0x9d31('0x4'));var config=require(_0x9d31('0x5'));var logger=require('../../../config/logger')('email');config[_0x9d31('0x6')]=_['defaults'](config[_0x9d31('0x6')],{'host':_0x9d31('0x7'),'port':0x18eb});var io=require(_0x9d31('0x8'))(new Redis(config[_0x9d31('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x9d31('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x55a67e){logger[_0x9d31('0xa')](_0x9d31('0xb'));this[_0x9d31('0xc')]=_0x55a67e[_0x9d31('0xc')];this[_0x9d31('0xd')]={};this[_0x9d31('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x9d31('0xf')]=function(_0x56af2c){var _0x223f3b=this[_0x9d31('0xc')][_0x56af2c];var _0x2d52c8={'id':_0x223f3b['id'],'name':_0x223f3b[_0x9d31('0x10')],'key':_0x223f3b[_0x9d31('0x11')],'active':_0x223f3b[_0x9d31('0x12')],'Imap':{'status':_0x223f3b['Imap'][_0x9d31('0x13')],'messageStatus':_0x223f3b['Imap'][_0x9d31('0x14')],'total':_0x223f3b['Imap'][_0x9d31('0x15')]}};if(_[_0x9d31('0x16')](md5Accounts[_0x56af2c])){md5Accounts[_0x56af2c]={};}var _0x2e5656=md5(JSON[_0x9d31('0x17')](_0x2d52c8));if(md5Accounts[_0x56af2c][_0x9d31('0x3')]!==_0x2e5656){md5Accounts[_0x56af2c][_0x9d31('0x3')]=_0x2e5656;io[_0x9d31('0xf')](_0x9d31('0x18'),_0x2d52c8);}};EmailChannel[_0x9d31('0x19')][_0x9d31('0x1a')]=function(_0x2dbdc3){for(var _0x2c5b9e in _0x2dbdc3){if(_0x2dbdc3['hasOwnProperty'](_0x2c5b9e)){if(_0x2dbdc3[_0x2c5b9e][_0x9d31('0x1b')]&&_0x2dbdc3[_0x2c5b9e][_0x9d31('0x12')]){var _0x4ed07e=_0x2dbdc3[_0x2c5b9e]['Imap'];if(!_0x4ed07e[_0x9d31('0x1c')]&&_0x2dbdc3[_0x2c5b9e]['provider']!==_0x9d31('0x1d'))_0x4ed07e[_0x9d31('0x1c')]=_0x2dbdc3[_0x2c5b9e]['provider'];if(!this['imapAccounts']['hasOwnProperty'](_0x4ed07e['id'])){this[_0x9d31('0xd')][_0x4ed07e['id']]=new EmailImap(_0x4ed07e,_0x2dbdc3[_0x2c5b9e][_0x9d31('0x1e')]);this[_0x9d31('0xd')][_0x4ed07e['id']]['on'](_0x9d31('0x1f'),this[_0x9d31('0x20')][_0x9d31('0x21')](this,_0x2c5b9e));this[_0x9d31('0xd')][_0x4ed07e['id']]['on'](_0x9d31('0x1e'),this[_0x9d31('0x22')][_0x9d31('0x21')](this,_0x2c5b9e));this[_0x9d31('0xd')][_0x4ed07e['id']]['on']('end',this[_0x9d31('0x23')][_0x9d31('0x21')](this,_0x2c5b9e));this[_0x9d31('0xd')][_0x4ed07e['id']]['on'](_0x9d31('0x24'),this['handleImapError'][_0x9d31('0x21')](this,_0x2c5b9e));}}else{if(_[_0x9d31('0x16')](this[_0x9d31('0xc')][_0x2c5b9e][_0x9d31('0x1b')])){this[_0x9d31('0xc')][_0x2c5b9e][_0x9d31('0x1b')]={};}this[_0x9d31('0xc')][_0x2c5b9e][_0x9d31('0x1b')][_0x9d31('0x13')]='disabled';this['mailAccounts'][_0x2c5b9e][_0x9d31('0x1b')][_0x9d31('0x14')]='';this['emit'](_0x2c5b9e);}}}};EmailChannel[_0x9d31('0x19')][_0x9d31('0x20')]=function(_0x6d6250,_0x464539){if(this[_0x9d31('0xc')][_0x6d6250]){this['mailAccounts'][_0x6d6250]['Imap'][_0x9d31('0x13')]='connected';this[_0x9d31('0xc')][_0x6d6250][_0x9d31('0x1b')][_0x9d31('0x14')]=_0x464539['name'];if(_0x464539[_0x9d31('0x25')]){this[_0x9d31('0xc')][_0x6d6250][_0x9d31('0x1b')]['total']=_0x464539[_0x9d31('0x25')][_0x9d31('0x15')];}return this['emit'](_0x6d6250);}};EmailChannel[_0x9d31('0x19')]['handleImapEmail']=function(_0x1ca2b7,_0x181b65){logger[_0x9d31('0xa')](_0x9d31('0x26'),_0x181b65[_0x9d31('0x27')],_0x181b65[_0x9d31('0x28')],_0x181b65[_0x9d31('0x29')],_0x1ca2b7);if(this[_0x9d31('0xc')][_0x1ca2b7]){return mailAccount[_0x9d31('0x2a')](_0x1ca2b7,_0x181b65)[_0x9d31('0x2b')](function(_0xd24e62){if(_0xd24e62){logger[_0x9d31('0xa')](_0x9d31('0x2c'));}})[_0x9d31('0x2d')](function(_0x7ddbb8){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x9d31('0x17')](_0x7ddbb8));});}};EmailChannel[_0x9d31('0x19')][_0x9d31('0x23')]=function(_0x2168a1){if(this[_0x9d31('0xc')][_0x2168a1]&&this['mailAccounts'][_0x2168a1]['Imap']){if(this['imapAccounts'][this[_0x9d31('0xc')][_0x2168a1]['Imap']['id']]){delete this['imapAccounts'][this[_0x9d31('0xc')][_0x2168a1][_0x9d31('0x1b')]['id']];}this[_0x9d31('0xc')][_0x2168a1][_0x9d31('0x1b')][_0x9d31('0x2e')]=moment();this[_0x9d31('0xf')](_0x2168a1);}};EmailChannel[_0x9d31('0x19')][_0x9d31('0x2f')]=function(_0x35d2c3,_0x514b4a){if(this[_0x9d31('0xc')][_0x35d2c3]){this[_0x9d31('0xc')][_0x35d2c3][_0x9d31('0x1b')]['status']=_0x9d31('0x24');this[_0x9d31('0xc')][_0x35d2c3][_0x9d31('0x1b')]['messageStatus']=_0x514b4a;return this[_0x9d31('0xf')](_0x35d2c3);}};EmailChannel[_0x9d31('0x19')][_0x9d31('0x30')]=function(_0x34756b,_0x19a6ce){return this['smtp'][_0x9d31('0x31')](_0x34756b,_0x19a6ce);};EmailChannel[_0x9d31('0x19')][_0x9d31('0x32')]=function(_0x2ea859){var _0x4e70d2=this;if(this[_0x9d31('0xc')][_0x2ea859['id']]){if(_[_0x9d31('0x16')](this['mailAccounts'][_0x2ea859['id']][_0x9d31('0x33')])){this[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')]={};}this[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')][_0x9d31('0x2e')]=moment();return new BPromise(function(_0x3086be,_0x590de5){return _0x4e70d2[_0x9d31('0xe')][_0x9d31('0x34')](_0x2ea859)['then'](function(_0x131b7d){_0x4e70d2[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')][_0x9d31('0x13')]=_0x9d31('0x35');_0x4e70d2[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')][_0x9d31('0x14')]='';_0x4e70d2['emit'](_0x2ea859['id']);_0x3086be(_0x131b7d);})['catch'](function(_0x4cea8d){_0x4e70d2[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')][_0x9d31('0x13')]=_0x9d31('0x24');_0x4e70d2[_0x9d31('0xc')][_0x2ea859['id']][_0x9d31('0x33')]['messageStatus']=_0x4cea8d;_0x4e70d2[_0x9d31('0xf')](_0x2ea859['id']);_0x590de5(_0x4cea8d);});});}return this[_0x9d31('0xe')][_0x9d31('0x34')](_0x2ea859);};module[_0x9d31('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1596df2..4c32b10 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 _0xeea2=['handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleFetchError','handleEnd','hasOwnProperty','exports','lodash','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','once','ready','handleReady','bind','end','error','prototype','getAccount','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen'];(function(_0xd6aad,_0x3fd78e){var _0x1109e6=function(_0x37f59c){while(--_0x37f59c){_0xd6aad['push'](_0xd6aad['shift']());}};_0x1109e6(++_0x3fd78e);}(_0xeea2,0xce));var _0x2eea=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xeea2[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x2eea('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0x2eea('0x1'))[_0x2eea('0x2')];var Iconv=require(_0x2eea('0x3'))[_0x2eea('0x4')];var EventEmitter=require('events')[_0x2eea('0x5')];var utils=require(_0x2eea('0x6'));var logger=require(_0x2eea('0x7'))(_0x2eea('0x8'));function EmailImap(_0x6b482f,_0x4f4a23){this[_0x2eea('0x9')]=_0x6b482f[_0x2eea('0x9')];this[_0x2eea('0xa')]=this['getAccount'](_0x6b482f,_0x4f4a23);this[_0x2eea('0xb')]=new Imap(this[_0x2eea('0xa')]);this[_0x2eea('0xb')][_0x2eea('0xc')](_0x2eea('0xd'),this[_0x2eea('0xe')][_0x2eea('0xf')](this));this[_0x2eea('0xb')][_0x2eea('0xc')](_0x2eea('0x10'),this['handleEnd'][_0x2eea('0xf')](this));this[_0x2eea('0xb')]['on'](_0x2eea('0x11'),this['handleError'][_0x2eea('0xf')](this));this[_0x2eea('0xb')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x2eea('0x12')][_0x2eea('0x13')]=function(_0x14f9f4,_0x138a70){var _0x3513ee={'connTimeout':_0x14f9f4['connTimeout']?_0x14f9f4['connTimeout']*0x3e8:0x2710,'authTimeout':_0x14f9f4[_0x2eea('0x14')]?_0x14f9f4[_0x2eea('0x14')]*0x3e8:0x1388};if(_0x14f9f4[_0x2eea('0x15')]){_0x3513ee[_0x2eea('0x16')]=_0x14f9f4['user'];if(_0x14f9f4[_0x2eea('0x17')]){_0x3513ee[_0x2eea('0x18')]=utils[_0x2eea('0x19')](_0x14f9f4[_0x2eea('0x1a')][_0x2eea('0x1b')],_0x14f9f4[_0x2eea('0x16')]);}else{_0x3513ee['password']=_0x14f9f4[_0x2eea('0x1c')];}}else{if(_0x14f9f4[_0x2eea('0x1d')]){_0x3513ee[_0x2eea('0x16')]=_0x14f9f4[_0x2eea('0x16')];_0x3513ee[_0x2eea('0x1c')]=_0x14f9f4[_0x2eea('0x1c')];}}_0x3513ee[_0x2eea('0x8')]=_0x138a70||_0x14f9f4[_0x2eea('0x16')]||_0x2eea('0x1e');_0x3513ee[_0x2eea('0x1f')]=_0x14f9f4[_0x2eea('0x1f')];_0x3513ee[_0x2eea('0x20')]=_0x14f9f4[_0x2eea('0x20')]||0x3e1;if(_0x14f9f4['tls']){_0x3513ee[_0x2eea('0x21')]=!![];}else{_0x3513ee[_0x2eea('0x21')]=![];_0x3513ee[_0x2eea('0x22')]=_0x2eea('0x23');}return _0x3513ee;};EmailImap[_0x2eea('0x12')][_0x2eea('0xe')]=function(){this[_0x2eea('0xb')][_0x2eea('0x24')](this['mailbox'],![],this[_0x2eea('0x25')][_0x2eea('0xf')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x3b6bf7,_0x7969bb){if(_0x3b6bf7){this[_0x2eea('0x26')](_0x3b6bf7,!![]);}else{this[_0x2eea('0x27')](_0x2eea('0x28'),_0x7969bb);this[_0x2eea('0x29')]();}};EmailImap[_0x2eea('0x12')][_0x2eea('0x2a')]=function(_0x11c86a){if(_0x11c86a){this[_0x2eea('0x26')](_0x11c86a,!![]);}else{this['imap']['end']();}};EmailImap[_0x2eea('0x12')][_0x2eea('0x29')]=function(){this[_0x2eea('0xb')][_0x2eea('0x2b')]([_0x2eea('0x2c')],this[_0x2eea('0x2d')][_0x2eea('0xf')](this));};EmailImap[_0x2eea('0x12')][_0x2eea('0x2d')]=function(_0x431156,_0x57d2fe){if(_0x431156){this[_0x2eea('0x26')](_0x431156,!![]);}else{if(_0x57d2fe[_0x2eea('0x2e')]){try{var _0x28e414=this[_0x2eea('0xb')][_0x2eea('0x2f')](_0x57d2fe,{'bodies':'','markSeen':!![]});_0x28e414['on'](_0x2eea('0x30'),this[_0x2eea('0x31')][_0x2eea('0xf')](this));_0x28e414[_0x2eea('0xc')](_0x2eea('0x11'),this['handleFetchError']['bind'](this));_0x28e414[_0x2eea('0xc')](_0x2eea('0x10'),this[_0x2eea('0x32')][_0x2eea('0xf')](this));}catch(_0x3a0d74){logger[_0x2eea('0x11')](_0x3a0d74);}}else{this[_0x2eea('0xb')]['closeBox'](!![],this[_0x2eea('0x2a')][_0x2eea('0xf')](this));}}};EmailImap[_0x2eea('0x12')][_0x2eea('0x31')]=function(_0x112ca7){_0x112ca7['on']('body',this[_0x2eea('0x33')]['bind'](this));_0x112ca7['once'](_0x2eea('0x34'),this[_0x2eea('0x35')][_0x2eea('0xf')](this));_0x112ca7['once'](_0x2eea('0x10'),this[_0x2eea('0x36')][_0x2eea('0xf')](this));};EmailImap[_0x2eea('0x12')][_0x2eea('0x33')]=function(_0x3aaf21){simpleParser(_0x3aaf21,{'Iconv':Iconv},this['handleSimpleParser'][_0x2eea('0xf')](this));};EmailImap[_0x2eea('0x12')][_0x2eea('0x35')]=function(){};EmailImap[_0x2eea('0x12')]['handleMessageEnd']=function(){};EmailImap[_0x2eea('0x12')][_0x2eea('0x37')]=function(_0x216371,_0x497a07){if(_0x216371){logger[_0x2eea('0x11')](_0x216371);}else{var _0x46813e=this;utils[_0x2eea('0x38')](this[_0x2eea('0xa')],_0x497a07,function(_0x197f61){_0x46813e['emit'](_0x2eea('0x8'),_0x197f61);});}};EmailImap[_0x2eea('0x12')][_0x2eea('0x32')]=function(){this[_0x2eea('0xb')][_0x2eea('0x39')](!![],this[_0x2eea('0x2a')][_0x2eea('0xf')](this));};EmailImap[_0x2eea('0x12')][_0x2eea('0x3a')]=function(_0x31b59c){this[_0x2eea('0x26')](_0x31b59c);this[_0x2eea('0xb')][_0x2eea('0x39')](!![],this[_0x2eea('0x2a')][_0x2eea('0xf')](this));};EmailImap['prototype'][_0x2eea('0x3b')]=function(){this[_0x2eea('0x27')](_0x2eea('0x10'));};EmailImap[_0x2eea('0x12')][_0x2eea('0x26')]=function(_0x3bd104,_0x30503a){logger['error'](_0x2eea('0x26'),this[_0x2eea('0xa')][_0x2eea('0x8')],JSON['stringify'](_0x3bd104));var _0x1eddc3='';if(_0x3bd104){if(_0x3bd104['textCode']){_0x1eddc3=_0x3bd104['textCode'];}else{for(var _0x8fe9c4 in _0x3bd104){if(_0x3bd104[_0x2eea('0x3c')](_0x8fe9c4)){_0x1eddc3+=_['upperFirst'](_0x8fe9c4)+':\x20'+_0x3bd104[_0x8fe9c4]+'\x0a';}}}}if(_0x30503a){this[_0x2eea('0xb')]['end']();}else{this[_0x2eea('0x27')](_0x2eea('0x11'),_0x1eddc3);this[_0x2eea('0x27')](_0x2eea('0x10'));}};module[_0x2eea('0x3d')]=EmailImap; \ No newline at end of file +var _0x6942=['account','handleFetchEnd','handleFetchError','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','once','ready','handleReady','end','handleEnd','error','handleError','connect','inherits','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','data5','password','host','port','tls','autotls','openBox','handleOpenBox','bind','prototype','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','message','handleFetchMessage','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser'];(function(_0x2a4172,_0x5bd9f1){var _0x24e48d=function(_0x241747){while(--_0x241747){_0x2a4172['push'](_0x2a4172['shift']());}};_0x24e48d(++_0x5bd9f1);}(_0x6942,0xf7));var _0x2694=function(_0x1665f6,_0x86e2b){_0x1665f6=_0x1665f6-0x0;var _0x2593f9=_0x6942[_0x1665f6];return _0x2593f9;};'use strict';var _=require(_0x2694('0x0'));var util=require(_0x2694('0x1'));var Imap=require(_0x2694('0x2'));var simpleParser=require(_0x2694('0x3'))['simpleParser'];var Iconv=require(_0x2694('0x4'))[_0x2694('0x5')];var EventEmitter=require(_0x2694('0x6'))[_0x2694('0x7')];var utils=require(_0x2694('0x8'));var logger=require('../../../config/logger')(_0x2694('0x9'));function EmailImap(_0x29427b,_0x489900){this[_0x2694('0xa')]=_0x29427b[_0x2694('0xa')];this['account']=this['getAccount'](_0x29427b,_0x489900);this[_0x2694('0x2')]=new Imap(this['account']);this['imap'][_0x2694('0xb')](_0x2694('0xc'),this[_0x2694('0xd')]['bind'](this));this[_0x2694('0x2')][_0x2694('0xb')](_0x2694('0xe'),this[_0x2694('0xf')]['bind'](this));this[_0x2694('0x2')]['on'](_0x2694('0x10'),this[_0x2694('0x11')]['bind'](this));this['imap'][_0x2694('0x12')]();}util[_0x2694('0x13')](EmailImap,EventEmitter);EmailImap['prototype'][_0x2694('0x14')]=function(_0x21f996,_0x42c221){var _0x1fc45d={'connTimeout':_0x21f996[_0x2694('0x15')]?_0x21f996[_0x2694('0x15')]*0x3e8:0x2710,'authTimeout':_0x21f996[_0x2694('0x16')]?_0x21f996[_0x2694('0x16')]*0x3e8:0x1388};if(_0x21f996[_0x2694('0x17')]){_0x1fc45d[_0x2694('0x18')]=_0x21f996[_0x2694('0x18')];if(_0x21f996[_0x2694('0x19')]){_0x1fc45d['xoauth2']=utils[_0x2694('0x1a')](_0x21f996['CloudProvider'][_0x2694('0x1b')],_0x21f996[_0x2694('0x18')]);}else{_0x1fc45d['password']=_0x21f996[_0x2694('0x1c')];}}else{if(_0x21f996['authentication']){_0x1fc45d[_0x2694('0x18')]=_0x21f996['user'];_0x1fc45d['password']=_0x21f996['password'];}}_0x1fc45d['email']=_0x42c221||_0x21f996[_0x2694('0x18')]||'anonymous@xcally.com';_0x1fc45d[_0x2694('0x1d')]=_0x21f996[_0x2694('0x1d')];_0x1fc45d[_0x2694('0x1e')]=_0x21f996[_0x2694('0x1e')]||0x3e1;if(_0x21f996['tls']){_0x1fc45d['tls']=!![];}else{_0x1fc45d[_0x2694('0x1f')]=![];_0x1fc45d[_0x2694('0x20')]='required';}return _0x1fc45d;};EmailImap['prototype'][_0x2694('0xd')]=function(){this[_0x2694('0x2')][_0x2694('0x21')](this[_0x2694('0xa')],![],this[_0x2694('0x22')][_0x2694('0x23')](this));};EmailImap[_0x2694('0x24')][_0x2694('0x22')]=function(_0xc57230,_0x2c5ef0){if(_0xc57230){this[_0x2694('0x11')](_0xc57230,!![]);}else{this[_0x2694('0x25')](_0x2694('0x26'),_0x2c5ef0);this[_0x2694('0x27')]();}};EmailImap[_0x2694('0x24')][_0x2694('0x28')]=function(_0x2c5e52){if(_0x2c5e52){this[_0x2694('0x11')](_0x2c5e52,!![]);}else{this['imap'][_0x2694('0xe')]();}};EmailImap['prototype'][_0x2694('0x27')]=function(){this['imap'][_0x2694('0x29')]([_0x2694('0x2a')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x2694('0x24')]['handleReadUnseen']=function(_0x227392,_0x1c53ad){if(_0x227392){this['handleError'](_0x227392,!![]);}else{if(_0x1c53ad[_0x2694('0x2b')]){try{var _0x4ac964=this['imap']['fetch'](_0x1c53ad,{'bodies':'','markSeen':!![]});_0x4ac964['on'](_0x2694('0x2c'),this[_0x2694('0x2d')]['bind'](this));_0x4ac964[_0x2694('0xb')](_0x2694('0x10'),this['handleFetchError'][_0x2694('0x23')](this));_0x4ac964[_0x2694('0xb')]('end',this['handleFetchEnd'][_0x2694('0x23')](this));}catch(_0xace7b){logger[_0x2694('0x10')](_0xace7b);}}else{this[_0x2694('0x2')][_0x2694('0x2e')](!![],this[_0x2694('0x28')][_0x2694('0x23')](this));}}};EmailImap['prototype'][_0x2694('0x2d')]=function(_0x3df328){_0x3df328['on']('body',this[_0x2694('0x2f')]['bind'](this));_0x3df328[_0x2694('0xb')](_0x2694('0x30'),this[_0x2694('0x31')][_0x2694('0x23')](this));_0x3df328[_0x2694('0xb')](_0x2694('0xe'),this[_0x2694('0x32')][_0x2694('0x23')](this));};EmailImap['prototype'][_0x2694('0x2f')]=function(_0x587304){simpleParser(_0x587304,{'Iconv':Iconv},this[_0x2694('0x33')][_0x2694('0x23')](this));};EmailImap[_0x2694('0x24')][_0x2694('0x31')]=function(){};EmailImap[_0x2694('0x24')][_0x2694('0x32')]=function(){};EmailImap[_0x2694('0x24')]['handleSimpleParser']=function(_0x1dfe3f,_0x1e4765){if(_0x1dfe3f){logger['error'](_0x1dfe3f);}else{var _0x40ebb6=this;utils[_0x2694('0x34')](this[_0x2694('0x35')],_0x1e4765,function(_0x117a08){_0x40ebb6[_0x2694('0x25')]('email',_0x117a08);});}};EmailImap[_0x2694('0x24')][_0x2694('0x36')]=function(){this[_0x2694('0x2')][_0x2694('0x2e')](!![],this[_0x2694('0x28')][_0x2694('0x23')](this));};EmailImap[_0x2694('0x24')][_0x2694('0x37')]=function(_0x240cad){this[_0x2694('0x11')](_0x240cad);this[_0x2694('0x2')][_0x2694('0x2e')](!![],this['handleCloseBox'][_0x2694('0x23')](this));};EmailImap[_0x2694('0x24')][_0x2694('0xf')]=function(){this['emit'](_0x2694('0xe'));};EmailImap[_0x2694('0x24')]['handleError']=function(_0x42b686,_0x2045aa){logger[_0x2694('0x10')]('handleError',this['account'][_0x2694('0x9')],JSON['stringify'](_0x42b686));var _0x43e741='';if(_0x42b686){if(_0x42b686[_0x2694('0x38')]){_0x43e741=_0x42b686[_0x2694('0x38')];}else{for(var _0x54ba50 in _0x42b686){if(_0x42b686[_0x2694('0x39')](_0x54ba50)){_0x43e741+=_[_0x2694('0x3a')](_0x54ba50)+':\x20'+_0x42b686[_0x54ba50]+'\x0a';}}}}if(_0x2045aa){this[_0x2694('0x2')][_0x2694('0xe')]();}else{this['emit'](_0x2694('0x10'),_0x43e741);this[_0x2694('0x25')](_0x2694('0xe'));}};module[_0x2694('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 52d7226..7797323 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 _0x9a84=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail','verify','toString','Not\x20verifired','nodemailer'];(function(_0x3f3334,_0x204a84){var _0x4e8e29=function(_0x295330){while(--_0x295330){_0x3f3334['push'](_0x3f3334['shift']());}};_0x4e8e29(++_0x204a84);}(_0x9a84,0x1a3));var _0x49a8=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x9a84[_0xcb0eb2];return _0xbab9b8;};'use strict';var nodemailer=require(_0x49a8('0x0'));var inlineBase64=require(_0x49a8('0x1'));function EmailSmtp(){}EmailSmtp[_0x49a8('0x2')][_0x49a8('0x3')]=function(_0x5e9e73,_0x58ceec){return new Promise(function(_0x42fe37,_0x41d485){var _0x192838=nodemailer[_0x49a8('0x4')](_0x5e9e73);_0x192838[_0x49a8('0x5')]('compile',inlineBase64());_0x192838[_0x49a8('0x6')](_0x58ceec,function(_0x53f30c,_0x19dec6){if(_0x53f30c){_0x41d485(_0x53f30c['toString']());}else{_0x42fe37(_0x19dec6);}});});};EmailSmtp[_0x49a8('0x2')][_0x49a8('0x7')]=function(_0x35d024){return new Promise(function(_0x4ad054,_0x275991){var _0x377cc3=nodemailer[_0x49a8('0x4')](_0x35d024);_0x377cc3[_0x49a8('0x7')](function(_0x1d9e30,_0x1d2b1e){if(_0x1d9e30){_0x275991(_0x1d9e30[_0x49a8('0x8')]());}else{if(_0x1d2b1e){_0x4ad054(_0x1d2b1e);}else{_0x275991(_0x49a8('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x514b=['use','compile','sendMail','toString','Not\x20verifired','nodemailer','prototype','send','createTransport'];(function(_0x38b090,_0x471976){var _0x1788ad=function(_0x1c7880){while(--_0x1c7880){_0x38b090['push'](_0x38b090['shift']());}};_0x1788ad(++_0x471976);}(_0x514b,0x137));var _0xb514=function(_0x5b246b,_0x5de701){_0x5b246b=_0x5b246b-0x0;var _0x436974=_0x514b[_0x5b246b];return _0x436974;};'use strict';var nodemailer=require(_0xb514('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xb514('0x1')][_0xb514('0x2')]=function(_0x4eed57,_0x13dff3){return new Promise(function(_0x3fe3b9,_0x49d74b){var _0x50c016=nodemailer[_0xb514('0x3')](_0x4eed57);_0x50c016[_0xb514('0x4')](_0xb514('0x5'),inlineBase64());_0x50c016[_0xb514('0x6')](_0x13dff3,function(_0x499488,_0x56d6d6){if(_0x499488){_0x49d74b(_0x499488[_0xb514('0x7')]());}else{_0x3fe3b9(_0x56d6d6);}});});};EmailSmtp['prototype']['verify']=function(_0x1a59be){return new Promise(function(_0x45128f,_0x3fcf26){var _0x55e1e8=nodemailer['createTransport'](_0x1a59be);_0x55e1e8['verify'](function(_0x2fb4a2,_0xab6e43){if(_0x2fb4a2){_0x3fcf26(_0x2fb4a2['toString']());}else{if(_0xab6e43){_0x45128f(_0xab6e43);}else{_0x3fcf26(_0xb514('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 87468bd..cf35bcb 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 _0xb2e6=['headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','

Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','length','slice','join','split','pop','isEmpty','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x389a41[_0x6b2e('0x10')](0x0,-0x1)[_0x6b2e('0x11')]('\x20'):_0x31e3d5['name'];}return'Anonymous';}function getLastName(_0x41614d){var _0x342f0c=_[_0x6b2e('0x7')](_0x41614d[_0x6b2e('0x8')]);if(_0x342f0c&&_0x342f0c[_0x6b2e('0xc')]){var _0x350969=_0x342f0c[_0x6b2e('0xc')][_0x6b2e('0x12')](/\s+/);return _0x350969['length']>0x1?_0x350969[_0x6b2e('0x13')]():'';}return'';}function getMails(_0x38d49d,_0x46d2ad){var _0x40b1bf='';for(var _0x2af7cc=0x0;_0x2af7cc<_0x46d2ad['value']['length'];_0x2af7cc+=0x1){if(_0x46d2ad[_0x6b2e('0x8')][_0x2af7cc]['address']!==_0x38d49d){if(!_[_0x6b2e('0x14')](_0x40b1bf)){_0x40b1bf+=',';}_0x40b1bf+=_0x46d2ad[_0x6b2e('0x8')][_0x2af7cc][_0x6b2e('0xc')]||_0x46d2ad[_0x6b2e('0x8')][_0x2af7cc][_0x6b2e('0x9')]||'';_0x40b1bf+='\x20<';_0x40b1bf+=_0x46d2ad['value'][_0x2af7cc][_0x6b2e('0x9')]?_0x46d2ad[_0x6b2e('0x8')][_0x2af7cc]['address']:_0x6b2e('0xa')+random[_0x6b2e('0xb')](0x6)+_0x6b2e('0x15');_0x40b1bf+='>';}}return _0x40b1bf;}function parseEmail(_0x4fea33,_0x3c916e,_0x5bb230){if(_0x3c916e[_0x6b2e('0x16')]){var _0x318988=/)<[^<]*)*<\/script>/gi;while(_0x318988[_0x6b2e('0x17')](_0x3c916e[_0x6b2e('0x16')])){_0x3c916e['html']=_0x3c916e['html'][_0x6b2e('0x18')](_0x318988,'');}if(_0x3c916e[_0x6b2e('0x16')][_0x6b2e('0x19')](_0x6b2e('0x1a'))){var _0x476790=[];_0x3c916e[_0x6b2e('0x1b')]['forEach'](_0x58fc37=>{_0x476790[_0x6b2e('0x1c')](_0x58fc37[_0x6b2e('0x1d')]);});var _0x6d84d5=/]+>/g;var _0x20bb44=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x510748=_0x3c916e[_0x6b2e('0x16')]['replace'](_0x20bb44,'_SRC');var _0x2a333f=_0x510748['replace'](_0x6d84d5,_0x6b2e('0x1e'));for(let _0x4a1986=0x0;_0x4a1986<_0x476790[_0x6b2e('0xf')];_0x4a1986++){var _0x14c0db=_0x2a333f['replace'](_0x6b2e('0x1e'),_0x6b2e('0x1f')+_0x476790[_0x4a1986]+_0x6b2e('0x20'));_0x2a333f=_0x14c0db;}_0x3c916e['html']=_0x2a333f;}_0x5bb230['body']=_0x3c916e[_0x6b2e('0x16')];}else{_0x5bb230[_0x6b2e('0x21')]=_0x3c916e[_0x6b2e('0x22')];}if(_0x5bb230[_0x6b2e('0x21')]){_0x5bb230[_0x6b2e('0x21')]=_0x5bb230[_0x6b2e('0x21')][_0x6b2e('0x18')](/0x0){var _0x4473c9=[_0x6b2e('0x32'),_0x6b2e('0x33'),_0x6b2e('0x34')];for(var _0x25326e=0x0;_0x25326e<_0x3c916e[_0x6b2e('0x31')][_0x6b2e('0xf')];_0x25326e++){var _0x6a9e13=_[_0x6b2e('0xe')](_0x4473c9,_0x3c916e[_0x6b2e('0x31')][_0x25326e][_0x6b2e('0x35')]);if(_0x6a9e13>=0x0){_0x5bb230[_0x6b2e('0x36')]=!![];}}}return _0x5bb230;}exports['parser']=function(_0x49be5d,_0x497859,_0x3e5157){var _0xde16cf={'from':getAddress(_0x497859[_0x6b2e('0x37')]),'firstName':getFirstName(_0x497859[_0x6b2e('0x37')]),'lastName':getLastName(_0x497859[_0x6b2e('0x37')]),'mapKey':_0x6b2e('0x26'),'message':{'from':getMails(_0x49be5d[_0x6b2e('0x26')],_0x497859[_0x6b2e('0x37')]),'to':_0x49be5d['email'],'cc':'','subject':_0x497859[_0x6b2e('0x38')]||'','messageId':_0x497859[_0x6b2e('0x39')],'inReplyTo':_0x497859[_0x6b2e('0x3a')],'sentAt':moment(_0x497859['date'])['format'](_0x6b2e('0x3b')),'attach':![],'attachments':[]}};if(!_0x497859['html']&&!_0x497859[_0x6b2e('0x22')]){var _0x4db7f6=_['filter'](_0x497859[_0x6b2e('0x1b')],{'contentType':_0x6b2e('0x3c')});if(_0x4db7f6[_0x6b2e('0xf')]){logger[_0x6b2e('0x3d')](util['format'](_0x6b2e('0x3e'),_0x497859[_0x6b2e('0x39')]));tnef[_0x6b2e('0x3f')](_['first'](_0x4db7f6)['content'],function(_0x4c55fe,_0x20c1f8){if(_0x20c1f8){_0x497859['html']=_0x20c1f8['BodyHTML']||_0x6b2e('0x40');if(_0x20c1f8[_0x6b2e('0x41')]){for(var _0x3a7612=0x0;_0x3a7612<_0x20c1f8['Attachments']['length'];_0x3a7612++){var _0x2a82b2=_0x20c1f8[_0x6b2e('0x41')][_0x3a7612];_0xde16cf[_0x6b2e('0x24')][_0x6b2e('0x1b')][_0x6b2e('0x1c')]({'filename':_0x2a82b2[_0x6b2e('0x42')],'content':Buffer[_0x6b2e('0x37')](_0x2a82b2[_0x6b2e('0x43')])});}}}_0x3e5157(parseEmail(_0x49be5d,_0x497859,_0xde16cf));});}else{_0x497859[_0x6b2e('0x16')]=_0x6b2e('0x40');_0x3e5157(parseEmail(_0x49be5d,_0x497859,_0xde16cf));}}else{_0x3e5157(parseEmail(_0x49be5d,_0x497859,_0xde16cf));}};exports['generateXOAuth2Token']=function(_0x272eb0,_0x3e8c6d){var _0x51db5e=[_0x6b2e('0x44')+(_0x3e8c6d||''),_0x6b2e('0x45')+_0x272eb0,'',''];return Buffer['from'](_0x51db5e[_0x6b2e('0x11')](''),_0x6b2e('0x46'))[_0x6b2e('0x47')](_0x6b2e('0x48'));}; \ No newline at end of file +var _0xaf06=['path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','split','slice','join','Anonymous','pop','length','anonymous','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','isEmpty','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','now','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','

Empty\x20message

','Attachments','base64','lodash','randomstring'];(function(_0x3b3199,_0x10216d){var _0x4f592c=function(_0x1160c3){while(--_0x1160c3){_0x3b3199['push'](_0x3b3199['shift']());}};_0x4f592c(++_0x10216d);}(_0xaf06,0x112));var _0x6af0=function(_0x1171ca,_0xa4765){_0x1171ca=_0x1171ca-0x0;var _0x9c52fb=_0xaf06[_0x1171ca];return _0x9c52fb;};'use strict';var _=require(_0x6af0('0x0'));var moment=require('moment');var random=require(_0x6af0('0x1'));var fs=require('fs');var path=require(_0x6af0('0x2'));var util=require('util');var tnef=require(_0x6af0('0x3'));var logger=require(_0x6af0('0x4'))(_0x6af0('0x5'));var config=require(_0x6af0('0x6'));function getAddress(_0xb08898){var _0x3a19cc=_[_0x6af0('0x7')](_0xb08898[_0x6af0('0x8')]);return _0x3a19cc&&_0x3a19cc['address']?_0x3a19cc[_0x6af0('0x9')]:'anonymous'+random[_0x6af0('0xa')](0x6)+_0x6af0('0xb');}function getFirstName(_0x2bc9e2){var _0x40f1b=_[_0x6af0('0x7')](_0x2bc9e2[_0x6af0('0x8')]);if(_0x40f1b&&_0x40f1b[_0x6af0('0xc')]){if(_0x40f1b[_0x6af0('0xc')]==_0x40f1b[_0x6af0('0x9')]){return _0x40f1b[_0x6af0('0xc')]['substring'](0x0,_0x40f1b[_0x6af0('0xc')]['indexOf']('@'));}var _0x37d1a0=_0x40f1b[_0x6af0('0xc')][_0x6af0('0xd')](/\s+/);return _0x37d1a0['length']>0x1?_0x37d1a0[_0x6af0('0xe')](0x0,-0x1)[_0x6af0('0xf')]('\x20'):_0x40f1b[_0x6af0('0xc')];}return _0x6af0('0x10');}function getLastName(_0x16e5dc){var _0x58a1fe=_[_0x6af0('0x7')](_0x16e5dc[_0x6af0('0x8')]);if(_0x58a1fe&&_0x58a1fe[_0x6af0('0xc')]){var _0x3e33e5=_0x58a1fe[_0x6af0('0xc')][_0x6af0('0xd')](/\s+/);return _0x3e33e5['length']>0x1?_0x3e33e5[_0x6af0('0x11')]():'';}return'';}function getMails(_0x5f03e0,_0x984a69){var _0x1abffc='';for(var _0x2fbab9=0x0;_0x2fbab9<_0x984a69[_0x6af0('0x8')][_0x6af0('0x12')];_0x2fbab9+=0x1){if(_0x984a69[_0x6af0('0x8')][_0x2fbab9][_0x6af0('0x9')]!==_0x5f03e0){if(!_['isEmpty'](_0x1abffc)){_0x1abffc+=',';}_0x1abffc+=_0x984a69['value'][_0x2fbab9][_0x6af0('0xc')]||_0x984a69[_0x6af0('0x8')][_0x2fbab9][_0x6af0('0x9')]||'';_0x1abffc+='\x20<';_0x1abffc+=_0x984a69[_0x6af0('0x8')][_0x2fbab9][_0x6af0('0x9')]?_0x984a69['value'][_0x2fbab9]['address']:_0x6af0('0x13')+random[_0x6af0('0xa')](0x6)+'@xcally.com';_0x1abffc+='>';}}return _0x1abffc;}function parseEmail(_0x14de20,_0x46207e,_0xa36ffe){if(_0x46207e['html']){var _0xadc930=/)<[^<]*)*<\/script>/gi;while(_0xadc930['test'](_0x46207e['html'])){_0x46207e[_0x6af0('0x14')]=_0x46207e['html'][_0x6af0('0x15')](_0xadc930,'');}if(_0x46207e['html'][_0x6af0('0x16')](_0x6af0('0x17'))){var _0xcb0ae6=[];_0x46207e[_0x6af0('0x18')][_0x6af0('0x19')](_0x294c84=>{_0xcb0ae6[_0x6af0('0x1a')](_0x294c84[_0x6af0('0x1b')]);});var _0x243ce5=/]+>/g;var _0x4c494e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1524d7=_0x46207e[_0x6af0('0x14')][_0x6af0('0x15')](_0x4c494e,_0x6af0('0x1c'));var _0x46e371=_0x1524d7['replace'](_0x243ce5,_0x6af0('0x1d'));for(let _0x54aea6=0x0;_0x54aea6<_0xcb0ae6[_0x6af0('0x12')];_0x54aea6++){var _0x589e14=_0x46e371[_0x6af0('0x15')]('_IMG',_0x6af0('0x1e')+_0xcb0ae6[_0x54aea6]+_0x6af0('0x1f'));_0x46e371=_0x589e14;}_0x46207e['html']=_0x46e371;}_0xa36ffe[_0x6af0('0x20')]=_0x46207e[_0x6af0('0x14')];}else{_0xa36ffe[_0x6af0('0x20')]=_0x46207e[_0x6af0('0x21')];}if(_0xa36ffe[_0x6af0('0x20')]){_0xa36ffe['body']=_0xa36ffe[_0x6af0('0x20')][_0x6af0('0x15')](/0x0){var _0x5965c6=[_0x6af0('0x33'),_0x6af0('0x34'),_0x6af0('0x35')];for(var _0x20aec9=0x0;_0x20aec9<_0x46207e[_0x6af0('0x32')][_0x6af0('0x12')];_0x20aec9++){var _0x260a92=_[_0x6af0('0x36')](_0x5965c6,_0x46207e[_0x6af0('0x32')][_0x20aec9]['line']);if(_0x260a92>=0x0){_0xa36ffe[_0x6af0('0x37')]=!![];}}}return _0xa36ffe;}exports[_0x6af0('0x38')]=function(_0x4f55a3,_0x203829,_0x25560d){var _0x207bd6={'from':getAddress(_0x203829['from']),'firstName':getFirstName(_0x203829[_0x6af0('0x39')]),'lastName':getLastName(_0x203829[_0x6af0('0x39')]),'mapKey':_0x6af0('0x5'),'message':{'from':getMails(_0x4f55a3[_0x6af0('0x5')],_0x203829[_0x6af0('0x39')]),'to':_0x4f55a3[_0x6af0('0x5')],'cc':'','subject':_0x203829[_0x6af0('0x3a')]||'','messageId':_0x203829['messageId'],'inReplyTo':_0x203829[_0x6af0('0x3b')],'sentAt':moment(_0x203829[_0x6af0('0x3c')])[_0x6af0('0x2b')](_0x6af0('0x3d')),'attach':![],'attachments':[]}};if(!_0x203829[_0x6af0('0x14')]&&!_0x203829[_0x6af0('0x21')]){var _0x3d7e1a=_[_0x6af0('0x3e')](_0x203829['attachments'],{'contentType':'application/ms-tnef'});if(_0x3d7e1a['length']){logger[_0x6af0('0x3f')](util['format'](_0x6af0('0x40'),_0x203829['messageId']));tnef[_0x6af0('0x41')](_['first'](_0x3d7e1a)[_0x6af0('0x30')],function(_0x1c8594,_0x361802){if(_0x361802){_0x203829[_0x6af0('0x14')]=_0x361802['BodyHTML']||_0x6af0('0x42');if(_0x361802[_0x6af0('0x43')]){for(var _0x24cfa6=0x0;_0x24cfa6<_0x361802[_0x6af0('0x43')][_0x6af0('0x12')];_0x24cfa6++){var _0x57e090=_0x361802[_0x6af0('0x43')][_0x24cfa6];_0x207bd6[_0x6af0('0x22')][_0x6af0('0x18')][_0x6af0('0x1a')]({'filename':_0x57e090['Title'],'content':Buffer[_0x6af0('0x39')](_0x57e090['Data'])});}}}_0x25560d(parseEmail(_0x4f55a3,_0x203829,_0x207bd6));});}else{_0x203829['html']=_0x6af0('0x42');_0x25560d(parseEmail(_0x4f55a3,_0x203829,_0x207bd6));}}else{_0x25560d(parseEmail(_0x4f55a3,_0x203829,_0x207bd6));}};exports['generateXOAuth2Token']=function(_0xa1ee7e,_0x238271){var _0x4a8384=['user='+(_0x238271||''),'auth=Bearer\x20'+_0xa1ee7e,'',''];return Buffer[_0x6af0('0x39')](_0x4a8384[_0x6af0('0xf')](''),'utf-8')['toString'](_0x6af0('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 85b439f..f753a17 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 _0xb3d0=['name','Service','key','active','Imap','Smtp','exports','lodash'];(function(_0x183f90,_0x286958){var _0x2b017a=function(_0x4662a7){while(--_0x4662a7){_0x183f90['push'](_0x183f90['shift']());}};_0x2b017a(++_0x286958);}(_0xb3d0,0x1b7));var _0x0b3d=function(_0x1fcc6c,_0x1f3002){_0x1fcc6c=_0x1fcc6c-0x0;var _0x580e0f=_0xb3d0[_0x1fcc6c];return _0x580e0f;};'use strict';var _=require(_0x0b3d('0x0'));function MailAccount(_0x183364){this['id']=_0x183364['id']||0x0;this[_0x0b3d('0x1')]=_0x183364[_0x0b3d('0x1')]||_0x0b3d('0x2');this[_0x0b3d('0x3')]=_0x183364[_0x0b3d('0x3')]||'SERV';this[_0x0b3d('0x4')]=_0x183364[_0x0b3d('0x4')]||![];this['Imap']=_0x183364[_0x0b3d('0x5')]||[];this['Smtp']=_0x183364[_0x0b3d('0x6')]||[];}module[_0x0b3d('0x7')]=MailAccount; \ No newline at end of file +var _0x6426=['name','key','active','Imap','Smtp','exports','lodash'];(function(_0x1865f3,_0x5154be){var _0xb69290=function(_0x12e20b){while(--_0x12e20b){_0x1865f3['push'](_0x1865f3['shift']());}};_0xb69290(++_0x5154be);}(_0x6426,0xca));var _0x6642=function(_0x50c78d,_0xc42273){_0x50c78d=_0x50c78d-0x0;var _0x5ef890=_0x6426[_0x50c78d];return _0x5ef890;};'use strict';var _=require(_0x6642('0x0'));function MailAccount(_0x1db1d2){this['id']=_0x1db1d2['id']||0x0;this[_0x6642('0x1')]=_0x1db1d2[_0x6642('0x1')]||'Service';this['key']=_0x1db1d2[_0x6642('0x2')]||'SERV';this['active']=_0x1db1d2[_0x6642('0x3')]||![];this['Imap']=_0x1db1d2[_0x6642('0x4')]||[];this[_0x6642('0x5')]=_0x1db1d2[_0x6642('0x5')]||[];}module[_0x6642('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f169096..7d79591 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 _0x886e=['isUndefined','lodash','../model/mailAccount','hasOwnProperty','mergeFromDatabase','prototype','mailAccounts','length'];(function(_0x3eb3eb,_0x115800){var _0x5b0352=function(_0x1f1ad8){while(--_0x1f1ad8){_0x3eb3eb['push'](_0x3eb3eb['shift']());}};_0x5b0352(++_0x115800);}(_0x886e,0x149));var _0xe886=function(_0x2caa59,_0x5d8e7e){_0x2caa59=_0x2caa59-0x0;var _0x226c8b=_0x886e[_0x2caa59];return _0x226c8b;};'use strict';var _=require(_0xe886('0x0'));var MailAccount=require(_0xe886('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1afeaf,_0x2e0923,_0x2e26c2){var _0x28314d=_['mapKeys'](_0x1afeaf,function(_0x40317c,_0x1b3e9b){return _0x40317c[_0x2e26c2];});for(var _0x1e3bd0 in _0x2e0923){if(_0x2e0923[_0xe886('0x2')](_0x1e3bd0)){if(!_0x28314d[_0x1e3bd0]){delete _0x2e0923[_0x1e3bd0];}}}}Realtime['prototype'][_0xe886('0x3')]=function(_0x5e8fe7,_0x167f4f){for(var _0x4f4104 in _0x167f4f){if(_0x5e8fe7['hasOwnProperty'](_0x4f4104)){_0x5e8fe7[_0x4f4104]=_0x167f4f[_0x4f4104];}}};Realtime[_0xe886('0x4')]['initMailAccounts']=function(){var _0x48b79e=this;return function(_0x259f24){if(_0x259f24){freeIsNotKey(_0x259f24,_0x48b79e[_0xe886('0x5')],'id');for(var _0x9dfdb6=0x0,_0x4d9613={},_0x443484={};_0x9dfdb6<_0x259f24[_0xe886('0x6')];_0x9dfdb6+=0x1){_0x4d9613=_0x259f24[_0x9dfdb6];if(_[_0xe886('0x7')](_0x48b79e[_0xe886('0x5')][_0x4d9613['id']])){_0x48b79e[_0xe886('0x5')][_0x4d9613['id']]=new MailAccount(_0x4d9613);}else{_['merge'](_0x48b79e['mailAccounts'][_0x4d9613['id']],_0x4d9613);}}}return _0x48b79e[_0xe886('0x5')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0874=['merge','exports','../model/mailAccount','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x0874,0x14c));var _0x4087=function(_0x5cd26b,_0x4edbb7){_0x5cd26b=_0x5cd26b-0x0;var _0x4d2b2a=_0x0874[_0x5cd26b];return _0x4d2b2a;};'use strict';var _=require('lodash');var MailAccount=require(_0x4087('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x22cf16,_0x2eba4b,_0x28bcd8){var _0x261d87=_['mapKeys'](_0x22cf16,function(_0x599671,_0x39ed0c){return _0x599671[_0x28bcd8];});for(var _0x73d616 in _0x2eba4b){if(_0x2eba4b[_0x4087('0x1')](_0x73d616)){if(!_0x261d87[_0x73d616]){delete _0x2eba4b[_0x73d616];}}}}Realtime[_0x4087('0x2')][_0x4087('0x3')]=function(_0x53e9a2,_0x4b7e8e){for(var _0x54a52a in _0x4b7e8e){if(_0x53e9a2[_0x4087('0x1')](_0x54a52a)){_0x53e9a2[_0x54a52a]=_0x4b7e8e[_0x54a52a];}}};Realtime[_0x4087('0x2')][_0x4087('0x4')]=function(){var _0x1178b1=this;return function(_0xde0fd8){if(_0xde0fd8){freeIsNotKey(_0xde0fd8,_0x1178b1[_0x4087('0x5')],'id');for(var _0x71223=0x0,_0x595b6d={},_0x406205={};_0x71223<_0xde0fd8[_0x4087('0x6')];_0x71223+=0x1){_0x595b6d=_0xde0fd8[_0x71223];if(_[_0x4087('0x7')](_0x1178b1[_0x4087('0x5')][_0x595b6d['id']])){_0x1178b1['mailAccounts'][_0x595b6d['id']]=new MailAccount(_0x595b6d);}else{_[_0x4087('0x8')](_0x1178b1['mailAccounts'][_0x595b6d['id']],_0x595b6d);}}}return _0x1178b1[_0x4087('0x5')];};};module[_0x4087('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8ba8717..87ef055 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 _0xfc91=['ListId','TemplateId','MailServerIn','Imap','CloudProvider','MailServerOut','Smtp','type','data5','getMailAccount','notify','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','name','provider','service','email','active','key'];(function(_0x5dd48a,_0xaeb5fc){var _0x18a119=function(_0x28a989){while(--_0x28a989){_0x5dd48a['push'](_0x5dd48a['shift']());}};_0x18a119(++_0xaeb5fc);}(_0xfc91,0xb5));var _0x1fc9=function(_0x47f475,_0x36ccf3){_0x47f475=_0x47f475-0x0;var _0x21010c=_0xfc91[_0x47f475];return _0x21010c;};'use strict';var client=require('../client');exports[_0x1fc9('0x0')]=function(){return function(){return client['Request'](_0x1fc9('0x1'),{'options':{'attributes':['id',_0x1fc9('0x2'),_0x1fc9('0x3'),_0x1fc9('0x4'),_0x1fc9('0x5'),_0x1fc9('0x6'),_0x1fc9('0x7'),_0x1fc9('0x8'),_0x1fc9('0x9')],'raw':![],'include':[{'model':_0x1fc9('0xa'),'as':_0x1fc9('0xb'),'include':[{'model':_0x1fc9('0xc'),'attributes':['id','name',_0x1fc9('0x4'),'type','data5'],'as':_0x1fc9('0xc')}]},{'model':_0x1fc9('0xd'),'as':_0x1fc9('0xe'),'include':[{'model':_0x1fc9('0xc'),'attributes':['id',_0x1fc9('0x2'),_0x1fc9('0x4'),_0x1fc9('0xf'),_0x1fc9('0x10')],'as':_0x1fc9('0xc')}]}]},'log':_0x1fc9('0x11')});};};exports[_0x1fc9('0x12')]=function(_0x39729b,_0x401f24){return client[_0x1fc9('0x13')](_0x1fc9('0x14'),{'account':{'id':_0x39729b},'body':_0x401f24,'log':_0x1fc9('0x14')});}; \ No newline at end of file +var _0x8e20=['active','key','ListId','TemplateId','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','getMailAccount','notify','../client','getMailAccounts','Request','name','provider','email'];(function(_0x1a32a4,_0x787642){var _0x15f169=function(_0xdcdb46){while(--_0xdcdb46){_0x1a32a4['push'](_0x1a32a4['shift']());}};_0x15f169(++_0x787642);}(_0x8e20,0x1af));var _0x08e2=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0x8e20[_0x209bbf];return _0x592d4b;};'use strict';var client=require(_0x08e2('0x0'));exports[_0x08e2('0x1')]=function(){return function(){return client[_0x08e2('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x08e2('0x3'),_0x08e2('0x4'),'service',_0x08e2('0x5'),_0x08e2('0x6'),_0x08e2('0x7'),_0x08e2('0x8'),_0x08e2('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0x08e2('0xa'),'include':[{'model':_0x08e2('0xb'),'attributes':['id','name',_0x08e2('0xc'),_0x08e2('0xd'),_0x08e2('0xe')],'as':_0x08e2('0xb')}]},{'model':_0x08e2('0xf'),'as':_0x08e2('0x10'),'include':[{'model':'CloudProvider','attributes':['id',_0x08e2('0x3'),'service','type',_0x08e2('0xe')],'as':_0x08e2('0xb')}]}]},'log':_0x08e2('0x11')});};};exports[_0x08e2('0x12')]=function(_0x485c80,_0x504b35){return client[_0x08e2('0x2')]('NotifyMailAccount',{'account':{'id':_0x485c80},'body':_0x504b35,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 9fddab2..cf9d30a 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 _0x19a9=['Request','loginMailFrequency','getSettings'];(function(_0xefa181,_0x20acb2){var _0x52e84c=function(_0x1d821e){while(--_0x1d821e){_0xefa181['push'](_0xefa181['shift']());}};_0x52e84c(++_0x20acb2);}(_0x19a9,0xce));var _0x919a=function(_0x4f7671,_0x4076a6){_0x4f7671=_0x4f7671-0x0;var _0x2ae478=_0x19a9[_0x4f7671];return _0x2ae478;};'use strict';var client=require('../client');exports[_0x919a('0x0')]=function(){return client[_0x919a('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x919a('0x2')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xb4c9=['getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb4c9,0x68));var _0x9b4c=function(_0x238942,_0x3f45d9){_0x238942=_0x238942-0x0;var _0x3978ad=_0xb4c9[_0x238942];return _0x3978ad;};'use strict';var client=require('../client');exports[_0x9b4c('0x0')]=function(){return client[_0x9b4c('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9b4c('0x2')]},'log':_0x9b4c('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 961ca81..a3e51d5 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index ed58181..98b60c0 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 _0xaf37=['defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','lodash','express','sticky-session','createServer','timeout','listen','socket.io','polling','redis'];(function(_0xad729f,_0x2313c0){var _0x3a5aa6=function(_0x5bd716){while(--_0x5bd716){_0xad729f['push'](_0xad729f['shift']());}};_0x3a5aa6(++_0x2313c0);}(_0xaf37,0x137));var _0x7af3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xaf37[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7af3('0x0'));var http=require('http');var express=require(_0x7af3('0x1'));var sticky=require(_0x7af3('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x7af3('0x3')](app);server[_0x7af3('0x4')]=0xdbba0;if(sticky[_0x7af3('0x5')](server,config['port'])){var socketio=require(_0x7af3('0x6'))(server,{'transports':['websocket',_0x7af3('0x7')]});config[_0x7af3('0x8')]=_[_0x7af3('0x9')](config[_0x7af3('0x8')],{'host':_0x7af3('0xa'),'port':0x18eb});socketio['adapter'](require(_0x7af3('0xb'))({'pubClient':new Redis(config[_0x7af3('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x7af3('0xc'))[_0x7af3('0xd')]();require(_0x7af3('0xe'))[_0x7af3('0xd')](socketio);require(_0x7af3('0xf'))['default'](app);require(_0x7af3('0x10'))[_0x7af3('0xd')](app);}else{server[_0x7af3('0x11')](_0x7af3('0x12'),function(){console[_0x7af3('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module['exports']=app; \ No newline at end of file +var _0x53aa=['../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio'];(function(_0x544071,_0x2d90d0){var _0x136039=function(_0x4d4ec8){while(--_0x4d4ec8){_0x544071['push'](_0x544071['shift']());}};_0x136039(++_0x2d90d0);}(_0x53aa,0x119));var _0xa53a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x53aa[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xa53a('0x0'));var http=require('http');var express=require(_0xa53a('0x1'));var sticky=require(_0xa53a('0x2'));var Redis=require(_0xa53a('0x3'));var config=require(_0xa53a('0x4'));var app=express();var server=http[_0xa53a('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0xa53a('0x6')](server,config[_0xa53a('0x7')])){var socketio=require(_0xa53a('0x8'))(server,{'transports':[_0xa53a('0x9'),_0xa53a('0xa')]});config[_0xa53a('0xb')]=_[_0xa53a('0xc')](config['redis'],{'host':_0xa53a('0xd'),'port':0x18eb});socketio[_0xa53a('0xe')](require(_0xa53a('0xf'))({'pubClient':new Redis(config[_0xa53a('0xb')]),'subClient':new Redis(config[_0xa53a('0xb')])}));require('../../config/triggers')[_0xa53a('0x10')]();require(_0xa53a('0x11'))[_0xa53a('0x10')](socketio);require('../../config/express')[_0xa53a('0x10')](app);require(_0xa53a('0x12'))['default'](app);}else{server['once'](_0xa53a('0x13'),function(){console[_0xa53a('0x14')](_0xa53a('0x15'),config[_0xa53a('0x7')]);});}exports=module[_0xa53a('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f57010f..a87e43a 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 _0xf6b5=['routing','http','Request','request','then','debug','rpc','error','catch','exports','jayson/promise','bluebird'];(function(_0x329e40,_0x5ab84a){var _0x2c6493=function(_0x4b0ac9){while(--_0x4b0ac9){_0x329e40['push'](_0x329e40['shift']());}};_0x2c6493(++_0x5ab84a);}(_0xf6b5,0x15a));var _0x5f6b=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xf6b5[_0x36f47c];return _0x296c55;};'use strict';var jayson=require(_0x5f6b('0x0'));var BPromise=require(_0x5f6b('0x1'));var logger=require('../../config/logger')(_0x5f6b('0x2'));var client=jayson['client'][_0x5f6b('0x3')]({'port':0x2329});client[_0x5f6b('0x4')]=function(_0x3c9dda,_0x40d7c3){return new BPromise(function(_0x1ac246,_0x55ae52){return client[_0x5f6b('0x5')](_0x3c9dda,_0x40d7c3)[_0x5f6b('0x6')](function(_0x2cfefc){logger[_0x5f6b('0x7')](_0x5f6b('0x8'),_0x5f6b('0x2'),_0x3c9dda,_0x40d7c3,_0x2cfefc);if(_0x2cfefc['error']){logger['error'](_0x5f6b('0x8'),'routing',_0x3c9dda,_0x2cfefc['error']['message'],_0x40d7c3);return _0x55ae52(_0x2cfefc[_0x5f6b('0x9')]['message']);}else{return _0x1ac246(_0x2cfefc['result']);}})[_0x5f6b('0xa')](function(_0x2bdab6){logger[_0x5f6b('0x9')]('rpc',_0x5f6b('0x2'),_0x3c9dda,_0x2bdab6,_0x40d7c3);return _0x55ae52(_0x2bdab6);});});};module[_0x5f6b('0xb')]=client; \ No newline at end of file +var _0x2a18=['message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','rpc'];(function(_0x2a2a16,_0x20471b){var _0x5d7dab=function(_0x550209){while(--_0x550209){_0x2a2a16['push'](_0x2a2a16['shift']());}};_0x5d7dab(++_0x20471b);}(_0x2a18,0x1e4));var _0x82a1=function(_0x18a01c,_0xd1a13a){_0x18a01c=_0x18a01c-0x0;var _0x2b0cd6=_0x2a18[_0x18a01c];return _0x2b0cd6;};'use strict';var jayson=require(_0x82a1('0x0'));var BPromise=require(_0x82a1('0x1'));var logger=require(_0x82a1('0x2'))(_0x82a1('0x3'));var client=jayson[_0x82a1('0x4')][_0x82a1('0x5')]({'port':0x2329});client[_0x82a1('0x6')]=function(_0x5bd022,_0x3ebde1){return new BPromise(function(_0x1b8230,_0x1065d4){return client[_0x82a1('0x7')](_0x5bd022,_0x3ebde1)[_0x82a1('0x8')](function(_0x33804d){logger[_0x82a1('0x9')]('rpc',_0x82a1('0x3'),_0x5bd022,_0x3ebde1,_0x33804d);if(_0x33804d[_0x82a1('0xa')]){logger['error'](_0x82a1('0xb'),_0x82a1('0x3'),_0x5bd022,_0x33804d[_0x82a1('0xa')][_0x82a1('0xc')],_0x3ebde1);return _0x1065d4(_0x33804d['error'][_0x82a1('0xc')]);}else{return _0x1b8230(_0x33804d[_0x82a1('0xd')]);}})[_0x82a1('0xe')](function(_0x37a6a3){logger['error'](_0x82a1('0xb'),'routing',_0x5bd022,_0x37a6a3,_0x3ebde1);return _0x1065d4(_0x37a6a3);});});};module[_0x82a1('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index c04102d..033c1cc 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 _0xd23e=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','getAgents','then','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd23e,0x130));var _0xed23=function(_0x24b8ec,_0x3c8c5b){_0x24b8ec=_0x24b8ec-0x0;var _0x1d1b63=_0xd23e[_0x24b8ec];return _0x1d1b63;};'use strict';var BPromise=require('bluebird');var server=require(_0xed23('0x0'));var Realtime=require('./realtime');var user=require(_0xed23('0x1'));var interval=require(_0xed23('0x2'));var openchannelQueue=require(_0xed23('0x3'));var chatQueue=require(_0xed23('0x4'));var smsQueue=require(_0xed23('0x5'));var mailQueue=require(_0xed23('0x6'));var faxQueue=require(_0xed23('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xed23('0x8')]())[_0xed23('0x9')](realtime[_0xed23('0xa')]())['then'](interval['getIntervals']())[_0xed23('0x9')](realtime[_0xed23('0xb')]())[_0xed23('0x9')](openchannelQueue[_0xed23('0xc')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xed23('0xd')]())[_0xed23('0x9')](realtime[_0xed23('0xe')]())['then'](smsQueue['getSmsQueues']())['then'](realtime[_0xed23('0xf')]())[_0xed23('0x9')](mailQueue[_0xed23('0x10')]())[_0xed23('0x9')](realtime['initMailQueues']())['then'](faxQueue[_0xed23('0x11')]())[_0xed23('0x9')](realtime['initFaxQueues']())['then'](whatsappQueue[_0xed23('0x12')]())[_0xed23('0x9')](realtime['initWhatsappQueues']())[_0xed23('0x9')](function(){return realtime;});}function main(){return server[_0xed23('0x13')](realtime)['then'](function(_0x2f1bc8){return initRealtime();})[_0xed23('0x9')](function(_0x1c06e1){return setInterval(initRealtime,0x1388);})[_0xed23('0x14')](function(_0x1302ba){console[_0xed23('0x15')](_0x1302ba);});}main(); \ No newline at end of file +var _0xf667=['getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','listen','catch','log','bluebird','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then'];(function(_0x618a8e,_0x303940){var _0x45539e=function(_0x270deb){while(--_0x270deb){_0x618a8e['push'](_0x618a8e['shift']());}};_0x45539e(++_0x303940);}(_0xf667,0x105));var _0x7f66=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf667[_0x101e7b];return _0x4995c0;};'use strict';var BPromise=require(_0x7f66('0x0'));var server=require('./server');var Realtime=require(_0x7f66('0x1'));var user=require('./rpc/user');var interval=require(_0x7f66('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x7f66('0x3'));var smsQueue=require(_0x7f66('0x4'));var mailQueue=require(_0x7f66('0x5'));var faxQueue=require(_0x7f66('0x6'));var whatsappQueue=require(_0x7f66('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x7f66('0x8')](user['getAgents']())[_0x7f66('0x8')](realtime['initAgents']())[_0x7f66('0x8')](interval['getIntervals']())['then'](realtime['initIntervals']())[_0x7f66('0x8')](openchannelQueue[_0x7f66('0x9')]())['then'](realtime[_0x7f66('0xa')]())[_0x7f66('0x8')](chatQueue['getChatQueues']())[_0x7f66('0x8')](realtime[_0x7f66('0xb')]())[_0x7f66('0x8')](smsQueue[_0x7f66('0xc')]())['then'](realtime['initSmsQueues']())['then'](mailQueue[_0x7f66('0xd')]())[_0x7f66('0x8')](realtime[_0x7f66('0xe')]())[_0x7f66('0x8')](faxQueue['getFaxQueues']())[_0x7f66('0x8')](realtime['initFaxQueues']())[_0x7f66('0x8')](whatsappQueue['getWhatsappQueues']())[_0x7f66('0x8')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x7f66('0xf')](realtime)[_0x7f66('0x8')](function(_0x3209a0){return initRealtime();})[_0x7f66('0x8')](function(_0x30fff5){return setInterval(initRealtime,0x1388);})[_0x7f66('0x10')](function(_0x487293){console[_0x7f66('0x11')](_0x487293);});}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 b0bd362..a41a420 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x1c60c9,_0x2e8ee6){var _0x25592c=function(_0x4a5261){while(--_0x4a5261){_0x1c60c9['push'](_0x1c60c9['shift']());}};_0x25592c(++_0x2e8ee6);}(_0x7a54,0x106));var _0x47a5=function(_0x4170c4,_0x168eb2){_0x4170c4=_0x4170c4-0x0;var _0x14103b=_0x7a54[_0x4170c4];return _0x14103b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _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(_0xce2c01,_0x44872d){var _0x36b1ae=function(_0x37726f){while(--_0x37726f){_0xce2c01['push'](_0xce2c01['shift']());}};_0x36b1ae(++_0x44872d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'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 c697fc2..52010dc 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 _0x0a97=['jayson/promise','http','then','error','result','catch','SendMail','bluebird'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x0a97,0x16f));var _0x70a9=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x0a97[_0x411017];return _0x2adeea;};'use strict';var BPromise=require(_0x70a9('0x0'));var jayson=require(_0x70a9('0x1'));var client=jayson['client'][_0x70a9('0x2')]({'port':0x232b});function request(_0x377b57,_0x29cb25){return new BPromise(function(_0x189948,_0x1f427f){return client['request'](_0x377b57,_0x29cb25)[_0x70a9('0x3')](function(_0x6ca44e){if(_0x6ca44e[_0x70a9('0x4')]){return _0x1f427f(_0x6ca44e['error']['message']);}else{return _0x189948(_0x6ca44e[_0x70a9('0x5')]);}})[_0x70a9('0x6')](function(_0x4e1e8a){return _0x1f427f(_0x4e1e8a);});});}exports['sendMailMessage']=function(_0x14c511,_0x474c5d){return request(_0x70a9('0x7'),{'account':_0x14c511,'message':_0x474c5d});}; \ No newline at end of file +var _0x1c95=['request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x329f8d,_0x19fa11){var _0x15c43b=function(_0xc7024c){while(--_0xc7024c){_0x329f8d['push'](_0x329f8d['shift']());}};_0x15c43b(++_0x19fa11);}(_0x1c95,0x1ab));var _0x51c9=function(_0x1b600f,_0xb440ff){_0x1b600f=_0x1b600f-0x0;var _0x1fca54=_0x1c95[_0x1b600f];return _0x1fca54;};'use strict';var BPromise=require(_0x51c9('0x0'));var jayson=require(_0x51c9('0x1'));var client=jayson['client'][_0x51c9('0x2')]({'port':0x232b});function request(_0x4fe37f,_0x1ef561){return new BPromise(function(_0x5ec7c8,_0x593cd9){return client[_0x51c9('0x3')](_0x4fe37f,_0x1ef561)[_0x51c9('0x4')](function(_0x36bbe6){if(_0x36bbe6[_0x51c9('0x5')]){return _0x593cd9(_0x36bbe6[_0x51c9('0x5')]['message']);}else{return _0x5ec7c8(_0x36bbe6[_0x51c9('0x6')]);}})[_0x51c9('0x7')](function(_0x32a916){return _0x593cd9(_0x32a916);});});}exports[_0x51c9('0x8')]=function(_0x4f23df,_0x4eb343){return request(_0x51c9('0x9'),{'account':_0x4f23df,'message':_0x4eb343});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index c3f393a..8787e4b 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 _0x3d89=['mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelCurrentCapacity','busy','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','openchannel','fax','sms','Status','StatusTime','format','voicePause','chatStatusTime','smsStatusTime','whatsappStatusTime','openchannelStatusTime','openchannelCapacity','chatWaitingInteractions','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime'];(function(_0x1358b5,_0x510b90){var _0x3b3e5e=function(_0x4acb06){while(--_0x4acb06){_0x1358b5['push'](_0x1358b5['shift']());}};_0x3b3e5e(++_0x510b90);}(_0x3d89,0x19e));var _0x93d8=function(_0x57b78f,_0x29709d){_0x57b78f=_0x57b78f-0x0;var _0x275c6f=_0x3d89[_0x57b78f];return _0x275c6f;};'use strict';var _=require(_0x93d8('0x0'));var moment=require(_0x93d8('0x1'));var md5=require(_0x93d8('0x2'));var Redis=require(_0x93d8('0x3'));var config=require(_0x93d8('0x4'));config['redis']=_[_0x93d8('0x5')](config[_0x93d8('0x6')],{'host':_0x93d8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x93d8('0x6')]));function Agent(_0x88a944){this['id']=_0x88a944['id']||0x0;this[_0x93d8('0x8')]=_0x88a944[_0x93d8('0x8')]||'';this[_0x93d8('0x9')]=_0x88a944[_0x93d8('0x9')]||!![];this['voicePause']=_0x88a944['voicePause']||![];this['chatPause']=_0x88a944[_0x93d8('0xa')]||![];this[_0x93d8('0xb')]=_0x88a944['mailPause']||![];this[_0x93d8('0xc')]=_0x88a944[_0x93d8('0xc')]||![];this[_0x93d8('0xd')]=_0x88a944['smsPause']||![];this[_0x93d8('0xe')]=_0x88a944[_0x93d8('0xe')]||![];this[_0x93d8('0xf')]='unknown';this['chatStatusTime']=0x0;this[_0x93d8('0x10')]=_0x88a944[_0x93d8('0x10')]||0x0;this[_0x93d8('0x11')]=0x0;this[_0x93d8('0x12')]='unknown';this[_0x93d8('0x13')]=0x0;this[_0x93d8('0x14')]=_0x88a944['mailCapacity']||0x0;this[_0x93d8('0x15')]=0x0;this[_0x93d8('0x16')]=_0x93d8('0x17');this[_0x93d8('0x18')]=0x0;this['faxCapacity']=_0x88a944[_0x93d8('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x93d8('0x1a')]='unknown';this['smsStatusTime']=0x0;this[_0x93d8('0x1b')]=_0x88a944[_0x93d8('0x1b')]||0x0;this[_0x93d8('0x1c')]=0x0;this[_0x93d8('0x1d')]='unknown';this['whatsappStatusTime']=0x0;this[_0x93d8('0x1e')]=_0x88a944[_0x93d8('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x93d8('0x1f')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x88a944['openchannelCapacity']||0x0;this[_0x93d8('0x20')]=0x0;this[_0x93d8('0x21')]=![];this['busyQueue']=undefined;this['md5']='';this['chatWaitingInteractions']={};this[_0x93d8('0x22')]={};this[_0x93d8('0x23')]={};this['openchannelWaitingInteractions']={};this[_0x93d8('0x24')]={};this[_0x93d8('0x25')]={};this[_0x93d8('0x26')]();}Agent[_0x93d8('0x27')][_0x93d8('0x28')]=function(_0x31c87b){if(this[_0x31c87b+_0x93d8('0x29')]>0x0){if(this[_0x31c87b+_0x93d8('0x2a')]>0x0&&this[_0x31c87b+_0x93d8('0x29')]>=this[_0x31c87b+_0x93d8('0x2a')]){return _0x93d8('0x2b');}else{return _0x93d8('0x2c');}}else{return'idle';}};Agent[_0x93d8('0x27')][_0x93d8('0x26')]=function(){var _0x3b6ec4=[_0x93d8('0x2d'),'chat',_0x93d8('0x2e'),_0x93d8('0x2f'),_0x93d8('0x30'),'whatsapp'];for(var _0xe13729=0x0;_0xe13729<_0x3b6ec4['length'];_0xe13729+=0x1){var _0x5a03fe=this[_0x93d8('0x28')](_0x3b6ec4[_0xe13729]);if(this[_0x3b6ec4[_0xe13729]+_0x93d8('0x31')]!==_0x5a03fe){this[_0x3b6ec4[_0xe13729]+_0x93d8('0x32')]=_['toNumber'](moment()[_0x93d8('0x33')]('x'));}this[_0x3b6ec4[_0xe13729]+'Status']=_0x5a03fe;}var _0x19011c={'id':this['id'],'name':this[_0x93d8('0x8')],'online':this[_0x93d8('0x9')],'voicePause':this[_0x93d8('0x34')],'chatPause':this[_0x93d8('0xa')],'mailPause':this[_0x93d8('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x93d8('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x93d8('0xf')],'chatStatusTime':this[_0x93d8('0x35')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x93d8('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x93d8('0x14')],'mailCurrentCapacity':this[_0x93d8('0x15')],'faxStatus':this[_0x93d8('0x16')],'faxStatusTime':this[_0x93d8('0x18')],'faxCapacity':this[_0x93d8('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x93d8('0x36')],'smsCapacity':this[_0x93d8('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x93d8('0x37')],'whatsappCapacity':this[_0x93d8('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x93d8('0x1f')],'openchannelStatusTime':this[_0x93d8('0x38')],'openchannelCapacity':this[_0x93d8('0x39')],'openchannelCurrentCapacity':this[_0x93d8('0x20')],'busy':this[_0x93d8('0x21')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x93d8('0x3a')],'faxWaitingInteractions':this[_0x93d8('0x22')],'mailWaitingInteractions':this[_0x93d8('0x23')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x93d8('0x25')]};var _0x207f22=md5(JSON[_0x93d8('0x3b')](_0x19011c));if(this[_0x93d8('0x2')]!==_0x207f22){this[_0x93d8('0x2')]=_0x207f22;io[_0x93d8('0x3c')]('user:save',_0x19011c);}};module[_0x93d8('0x3d')]=Agent; \ No newline at end of file +var _0xa8d7=['fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatStatus','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelWaitingInteractions','stringify','user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','chat','openchannel'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa8d7,0xda));var _0x7a8d=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0xa8d7[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x7a8d('0x0'));var moment=require(_0x7a8d('0x1'));var md5=require(_0x7a8d('0x2'));var Redis=require('ioredis');var config=require(_0x7a8d('0x3'));config[_0x7a8d('0x4')]=_[_0x7a8d('0x5')](config[_0x7a8d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7a8d('0x6'))(new Redis(config['redis']));function Agent(_0x515d68){this['id']=_0x515d68['id']||0x0;this[_0x7a8d('0x7')]=_0x515d68['name']||'';this[_0x7a8d('0x8')]=_0x515d68[_0x7a8d('0x8')]||!![];this['voicePause']=_0x515d68[_0x7a8d('0x9')]||![];this[_0x7a8d('0xa')]=_0x515d68[_0x7a8d('0xa')]||![];this[_0x7a8d('0xb')]=_0x515d68['mailPause']||![];this[_0x7a8d('0xc')]=_0x515d68[_0x7a8d('0xc')]||![];this[_0x7a8d('0xd')]=_0x515d68[_0x7a8d('0xd')]||![];this[_0x7a8d('0xe')]=_0x515d68['openchannelPause']||![];this['chatStatus']=_0x7a8d('0xf');this[_0x7a8d('0x10')]=0x0;this[_0x7a8d('0x11')]=_0x515d68[_0x7a8d('0x11')]||0x0;this[_0x7a8d('0x12')]=0x0;this[_0x7a8d('0x13')]=_0x7a8d('0xf');this[_0x7a8d('0x14')]=0x0;this[_0x7a8d('0x15')]=_0x515d68[_0x7a8d('0x15')]||0x0;this[_0x7a8d('0x16')]=0x0;this[_0x7a8d('0x17')]=_0x7a8d('0xf');this[_0x7a8d('0x18')]=0x0;this[_0x7a8d('0x19')]=_0x515d68[_0x7a8d('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x7a8d('0x1a')]=_0x7a8d('0xf');this[_0x7a8d('0x1b')]=0x0;this['smsCapacity']=_0x515d68['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x7a8d('0x1c')]='unknown';this[_0x7a8d('0x1d')]=0x0;this['whatsappCapacity']=_0x515d68[_0x7a8d('0x1e')]||0x0;this[_0x7a8d('0x1f')]=0x0;this['openchannelStatus']=_0x7a8d('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x515d68[_0x7a8d('0x20')]||0x0;this[_0x7a8d('0x21')]=0x0;this[_0x7a8d('0x22')]=![];this[_0x7a8d('0x23')]=undefined;this[_0x7a8d('0x2')]='';this[_0x7a8d('0x24')]={};this[_0x7a8d('0x25')]={};this[_0x7a8d('0x26')]={};this['openchannelWaitingInteractions']={};this[_0x7a8d('0x27')]={};this[_0x7a8d('0x28')]={};this[_0x7a8d('0x29')]();}Agent[_0x7a8d('0x2a')][_0x7a8d('0x2b')]=function(_0x5dc52c){if(this[_0x5dc52c+_0x7a8d('0x2c')]>0x0){if(this[_0x5dc52c+'Capacity']>0x0&&this[_0x5dc52c+_0x7a8d('0x2c')]>=this[_0x5dc52c+_0x7a8d('0x2d')]){return _0x7a8d('0x2e');}else{return _0x7a8d('0x2f');}}else{return'idle';}};Agent[_0x7a8d('0x2a')][_0x7a8d('0x29')]=function(){var _0xa84039=['mail',_0x7a8d('0x30'),_0x7a8d('0x31'),_0x7a8d('0x32'),_0x7a8d('0x33'),_0x7a8d('0x34')];for(var _0x332bc8=0x0;_0x332bc8<_0xa84039[_0x7a8d('0x35')];_0x332bc8+=0x1){var _0x50a235=this[_0x7a8d('0x2b')](_0xa84039[_0x332bc8]);if(this[_0xa84039[_0x332bc8]+_0x7a8d('0x36')]!==_0x50a235){this[_0xa84039[_0x332bc8]+_0x7a8d('0x37')]=_[_0x7a8d('0x38')](moment()['format']('x'));}this[_0xa84039[_0x332bc8]+_0x7a8d('0x36')]=_0x50a235;}var _0x5061ad={'id':this['id'],'name':this[_0x7a8d('0x7')],'online':this[_0x7a8d('0x8')],'voicePause':this[_0x7a8d('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x7a8d('0xd')],'faxPause':this[_0x7a8d('0xc')],'openchannelPause':this[_0x7a8d('0xe')],'chatStatus':this[_0x7a8d('0x39')],'chatStatusTime':this[_0x7a8d('0x10')],'chatCapacity':this[_0x7a8d('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x7a8d('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x7a8d('0x15')],'mailCurrentCapacity':this[_0x7a8d('0x16')],'faxStatus':this[_0x7a8d('0x17')],'faxStatusTime':this[_0x7a8d('0x18')],'faxCapacity':this[_0x7a8d('0x19')],'faxCurrentCapacity':this[_0x7a8d('0x3a')],'smsStatus':this[_0x7a8d('0x1a')],'smsStatusTime':this[_0x7a8d('0x1b')],'smsCapacity':this[_0x7a8d('0x3b')],'smsCurrentCapacity':this[_0x7a8d('0x3c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x7a8d('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x7a8d('0x3d')],'openchannelStatusTime':this[_0x7a8d('0x3e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x7a8d('0x23')],'chatWaitingInteractions':this[_0x7a8d('0x24')],'faxWaitingInteractions':this[_0x7a8d('0x25')],'mailWaitingInteractions':this[_0x7a8d('0x26')],'openchannelWaitingInteractions':this[_0x7a8d('0x3f')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x26c467=md5(JSON[_0x7a8d('0x40')](_0x5061ad));if(this[_0x7a8d('0x2')]!==_0x26c467){this[_0x7a8d('0x2')]=_0x26c467;io['emit'](_0x7a8d('0x41'),_0x5061ad);}};module[_0x7a8d('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 32310c8..5d2634a 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 _0x24a5=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','chatPause','loggedIn','available','format','chat:queue:%s','emit','chat_queue:save','md5','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','Agents'];(function(_0x4562eb,_0x2943f4){var _0x2311f6=function(_0x27af50){while(--_0x27af50){_0x4562eb['push'](_0x4562eb['shift']());}};_0x2311f6(++_0x2943f4);}(_0x24a5,0x12f));var _0x524a=function(_0x1000e8,_0x14118c){_0x1000e8=_0x1000e8-0x0;var _0x5a05ef=_0x24a5[_0x1000e8];return _0x5a05ef;};'use strict';var _=require('lodash');var md5=require(_0x524a('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x524a('0x1'));config['redis']=_[_0x524a('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x524a('0x3'))(new Redis(config[_0x524a('0x4')]));function ChatQueue(_0x240468){this['id']=_0x240468['id']||0x0;this['name']=_0x240468[_0x524a('0x5')]||'';this[_0x524a('0x6')]=_0x240468[_0x524a('0x6')]||0xa;this[_0x524a('0x7')]=_0x240468[_0x524a('0x7')]||'beepall';this['Agents']=_0x240468[_0x524a('0x8')];this[_0x524a('0x9')]={};this[_0x524a('0xa')]=0x0;this['md5']='';this[_0x524a('0xb')]();this[_0x524a('0xc')]();}ChatQueue[_0x524a('0xd')]['updateRouting']=function(){var _0x6f774b=this[_0x524a('0x9')][_0x524a('0xe')];this[_0x524a('0x9')]=_[_0x524a('0xf')](this[_0x524a('0x8')],'id');this[_0x524a('0x9')][_0x524a('0xe')]=_0x6f774b;};ChatQueue[_0x524a('0xd')][_0x524a('0xc')]=function(){this['loggedIn']=0x0;this[_0x524a('0x10')]=0x0;for(var _0x372e51=0x0;_0x372e51=0x0?this['available']:0x0;var _0x2dec39={'id':this['id'],'available':this[_0x524a('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x524a('0x5')],'paused':this[_0x524a('0x10')],'waiting':this[_0x524a('0xa')]};var _0x1e65ff=md5(JSON['stringify'](_0x2dec39));if(this[_0x524a('0x0')]!==_0x1e65ff){this[_0x524a('0x0')]=_0x1e65ff;io['to'](util[_0x524a('0x16')](_0x524a('0x17'),_0x2dec39[_0x524a('0x5')]))[_0x524a('0x18')](_0x524a('0x19'),_0x2dec39);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x62fc=['paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x62fc,0x1e6));var _0xc62f=function(_0x1d2371,_0x666740){_0x1d2371=_0x1d2371-0x0;var _0x5d3f47=_0x62fc[_0x1d2371];return _0x5d3f47;};'use strict';var _=require(_0xc62f('0x0'));var md5=require(_0xc62f('0x1'));var util=require('util');var Redis=require(_0xc62f('0x2'));var config=require('../../../config/environment');config[_0xc62f('0x3')]=_['defaults'](config[_0xc62f('0x3')],{'host':_0xc62f('0x4'),'port':0x18eb});var io=require(_0xc62f('0x5'))(new Redis(config['redis']));function ChatQueue(_0x159cd1){this['id']=_0x159cd1['id']||0x0;this['name']=_0x159cd1[_0xc62f('0x6')]||'';this[_0xc62f('0x7')]=_0x159cd1['timeout']||0xa;this[_0xc62f('0x8')]=_0x159cd1[_0xc62f('0x8')]||'beepall';this[_0xc62f('0x9')]=_0x159cd1['Agents'];this[_0xc62f('0xa')]={};this[_0xc62f('0xb')]=0x0;this['md5']='';this[_0xc62f('0xc')]();this[_0xc62f('0xd')]();}ChatQueue[_0xc62f('0xe')][_0xc62f('0xc')]=function(){var _0x480537=this[_0xc62f('0xa')][_0xc62f('0xf')];this[_0xc62f('0xa')]=_[_0xc62f('0x10')](this[_0xc62f('0x9')],'id');this[_0xc62f('0xa')]['_rr']=_0x480537;};ChatQueue[_0xc62f('0xe')][_0xc62f('0xd')]=function(){this[_0xc62f('0x11')]=0x0;this[_0xc62f('0x12')]=0x0;for(var _0x20f271=0x0;_0x20f271=0x0?this[_0xc62f('0x16')]:0x0;var _0x5b2cf6={'id':this['id'],'available':this[_0xc62f('0x16')],'loggedIn':this[_0xc62f('0x11')],'name':this[_0xc62f('0x6')],'paused':this[_0xc62f('0x12')],'waiting':this[_0xc62f('0xb')]};var _0x46fd4f=md5(JSON[_0xc62f('0x17')](_0x5b2cf6));if(this['md5']!==_0x46fd4f){this[_0xc62f('0x1')]=_0x46fd4f;io['to'](util[_0xc62f('0x18')](_0xc62f('0x19'),_0x5b2cf6['name']))['emit'](_0xc62f('0x1a'),_0x5b2cf6);}};module[_0xc62f('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 bab817b..27e98e0 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 _0xd842=['faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','online'];(function(_0x51994c,_0x1e8b9b){var _0x483e04=function(_0x144516){while(--_0x144516){_0x51994c['push'](_0x51994c['shift']());}};_0x483e04(++_0x1e8b9b);}(_0xd842,0x19b));var _0x2d84=function(_0x128578,_0x5441ca){_0x128578=_0x128578-0x0;var _0x3b1118=_0xd842[_0x128578];return _0x3b1118;};'use strict';var _=require(_0x2d84('0x0'));var md5=require('md5');var util=require(_0x2d84('0x1'));var Redis=require(_0x2d84('0x2'));var config=require(_0x2d84('0x3'));config['redis']=_[_0x2d84('0x4')](config[_0x2d84('0x5')],{'host':_0x2d84('0x6'),'port':0x18eb});var io=require(_0x2d84('0x7'))(new Redis(config[_0x2d84('0x5')]));function FaxQueue(_0x30086a){this['id']=_0x30086a['id']||0x0;this[_0x2d84('0x8')]=_0x30086a[_0x2d84('0x8')]||'';this[_0x2d84('0x9')]=_0x30086a[_0x2d84('0x9')]||0xa;this[_0x2d84('0xa')]=_0x30086a['strategy']||_0x2d84('0xb');this[_0x2d84('0xc')]=_0x30086a[_0x2d84('0xc')];this[_0x2d84('0xd')]={};this['waiting']=0x0;this[_0x2d84('0xe')]='';this[_0x2d84('0xf')]();this[_0x2d84('0x10')]();}FaxQueue[_0x2d84('0x11')]['updateRouting']=function(){var _0x369957=this[_0x2d84('0xd')]['_rr'];this[_0x2d84('0xd')]=_[_0x2d84('0x12')](this[_0x2d84('0xc')],'id');this[_0x2d84('0xd')][_0x2d84('0x13')]=_0x369957;};FaxQueue[_0x2d84('0x11')][_0x2d84('0x10')]=function(){this[_0x2d84('0x14')]=0x0;this['paused']=0x0;for(var _0x30cf05=0x0;_0x30cf05=0x0?this[_0x2d84('0x19')]:0x0;var _0x1750c2={'id':this['id'],'available':this[_0x2d84('0x19')],'loggedIn':this[_0x2d84('0x14')],'name':this[_0x2d84('0x8')],'paused':this[_0x2d84('0x18')],'waiting':this['waiting']};var _0x51f88a=md5(JSON[_0x2d84('0x1a')](_0x1750c2));if(this[_0x2d84('0xe')]!==_0x51f88a){this['md5']=_0x51f88a;io['to'](util[_0x2d84('0x1b')](_0x2d84('0x1c'),_0x1750c2[_0x2d84('0x8')]))[_0x2d84('0x1d')](_0x2d84('0x1e'),_0x1750c2);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xfc20=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x29d6d9,_0x5c3cbb){var _0x24f7d9=function(_0x593c94){while(--_0x593c94){_0x29d6d9['push'](_0x29d6d9['shift']());}};_0x24f7d9(++_0x5c3cbb);}(_0xfc20,0xe3));var _0x0fc2=function(_0x31f2d1,_0x50083e){_0x31f2d1=_0x31f2d1-0x0;var _0x38f2bd=_0xfc20[_0x31f2d1];return _0x38f2bd;};'use strict';var _=require('lodash');var md5=require(_0x0fc2('0x0'));var util=require(_0x0fc2('0x1'));var Redis=require(_0x0fc2('0x2'));var config=require(_0x0fc2('0x3'));config['redis']=_[_0x0fc2('0x4')](config[_0x0fc2('0x5')],{'host':_0x0fc2('0x6'),'port':0x18eb});var io=require(_0x0fc2('0x7'))(new Redis(config[_0x0fc2('0x5')]));function FaxQueue(_0x229e6e){this['id']=_0x229e6e['id']||0x0;this[_0x0fc2('0x8')]=_0x229e6e[_0x0fc2('0x8')]||'';this[_0x0fc2('0x9')]=_0x229e6e[_0x0fc2('0x9')]||0xa;this['strategy']=_0x229e6e[_0x0fc2('0xa')]||_0x0fc2('0xb');this['Agents']=_0x229e6e[_0x0fc2('0xc')];this[_0x0fc2('0xd')]={};this[_0x0fc2('0xe')]=0x0;this[_0x0fc2('0x0')]='';this[_0x0fc2('0xf')]();this[_0x0fc2('0x10')]();}FaxQueue[_0x0fc2('0x11')]['updateRouting']=function(){var _0x9dc211=this[_0x0fc2('0xd')][_0x0fc2('0x12')];this[_0x0fc2('0xd')]=_[_0x0fc2('0x13')](this['Agents'],'id');this[_0x0fc2('0xd')][_0x0fc2('0x12')]=_0x9dc211;};FaxQueue[_0x0fc2('0x11')][_0x0fc2('0x10')]=function(){this[_0x0fc2('0x14')]=0x0;this[_0x0fc2('0x15')]=0x0;for(var _0x62218a=0x0;_0x62218a=0x0?this[_0x0fc2('0x17')]:0x0;var _0xe474ec={'id':this['id'],'available':this[_0x0fc2('0x17')],'loggedIn':this[_0x0fc2('0x14')],'name':this[_0x0fc2('0x8')],'paused':this[_0x0fc2('0x15')],'waiting':this[_0x0fc2('0xe')]};var _0x3cd8b3=md5(JSON[_0x0fc2('0x18')](_0xe474ec));if(this[_0x0fc2('0x0')]!==_0x3cd8b3){this[_0x0fc2('0x0')]=_0x3cd8b3;io['to'](util[_0x0fc2('0x19')](_0x0fc2('0x1a'),_0xe474ec[_0x0fc2('0x8')]))[_0x0fc2('0x1b')](_0x0fc2('0x1c'),_0xe474ec);}};module[_0x0fc2('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 2664704..68db457 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 _0x8cee=['name','Intervals','exports'];(function(_0x7c42d4,_0x3a4632){var _0x45eca5=function(_0x121105){while(--_0x121105){_0x7c42d4['push'](_0x7c42d4['shift']());}};_0x45eca5(++_0x3a4632);}(_0x8cee,0xe1));var _0xe8ce=function(_0x29b85d,_0x472608){_0x29b85d=_0x29b85d-0x0;var _0x594a39=_0x8cee[_0x29b85d];return _0x594a39;};'use strict';function Interval(_0xac5dda){this['id']=_0xac5dda['id']||0x0;this[_0xe8ce('0x0')]=_0xac5dda[_0xe8ce('0x0')]||'';this['Intervals']=_0xac5dda[_0xe8ce('0x1')]||{};}module[_0xe8ce('0x2')]=Interval; \ No newline at end of file +var _0xb0e5=['name','Intervals'];(function(_0x4c29e2,_0xba783a){var _0x50eb50=function(_0xb60fa1){while(--_0xb60fa1){_0x4c29e2['push'](_0x4c29e2['shift']());}};_0x50eb50(++_0xba783a);}(_0xb0e5,0x182));var _0x5b0e=function(_0x83487c,_0x1104d8){_0x83487c=_0x83487c-0x0;var _0x25ce18=_0xb0e5[_0x83487c];return _0x25ce18;};'use strict';function Interval(_0x582c51){this['id']=_0x582c51['id']||0x0;this[_0x5b0e('0x0')]=_0x582c51[_0x5b0e('0x0')]||'';this['Intervals']=_0x582c51[_0x5b0e('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 7c35461..e0545df 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 _0x1452=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x35a005,_0x51c4a4){var _0x1718d9=function(_0x548310){while(--_0x548310){_0x35a005['push'](_0x35a005['shift']());}};_0x1718d9(++_0x51c4a4);}(_0x1452,0xd6));var _0x2145=function(_0x4ea222,_0x2d0719){_0x4ea222=_0x4ea222-0x0;var _0x15f55b=_0x1452[_0x4ea222];return _0x15f55b;};'use strict';var _=require(_0x2145('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2145('0x1'));var config=require(_0x2145('0x2'));config[_0x2145('0x3')]=_[_0x2145('0x4')](config['redis'],{'host':_0x2145('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2145('0x3')]));function MailQueue(_0x28b8e4){this['id']=_0x28b8e4['id']||0x0;this[_0x2145('0x6')]=_0x28b8e4[_0x2145('0x6')]||'';this[_0x2145('0x7')]=_0x28b8e4[_0x2145('0x7')]||0xa;this[_0x2145('0x8')]=_0x28b8e4[_0x2145('0x8')]||_0x2145('0x9');this['Agents']=_0x28b8e4[_0x2145('0xa')];this[_0x2145('0xb')]={};this[_0x2145('0xc')]=0x0;this[_0x2145('0xd')]='';this[_0x2145('0xe')]();this[_0x2145('0xf')]();}MailQueue['prototype'][_0x2145('0xe')]=function(){var _0x53cc28=this[_0x2145('0xb')][_0x2145('0x10')];this[_0x2145('0xb')]=_[_0x2145('0x11')](this[_0x2145('0xa')],'id');this[_0x2145('0xb')][_0x2145('0x10')]=_0x53cc28;};MailQueue[_0x2145('0x12')][_0x2145('0xf')]=function(){this[_0x2145('0x13')]=0x0;this[_0x2145('0x14')]=0x0;for(var _0x3a0aba=0x0;_0x3a0aba=0x0?this['available']:0x0;var _0x4bc061={'id':this['id'],'available':this[_0x2145('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x2145('0xc')]};var _0x5bd6dc=md5(JSON[_0x2145('0x17')](_0x4bc061));if(this[_0x2145('0xd')]!==_0x5bd6dc){this[_0x2145('0xd')]=_0x5bd6dc;io['to'](util[_0x2145('0x18')](_0x2145('0x19'),_0x4bc061[_0x2145('0x6')]))[_0x2145('0x1a')](_0x2145('0x1b'),_0x4bc061);}};module['exports']=MailQueue; \ No newline at end of file +var _0x4ad9=['Agents','mapAgentsId','updateRouting','prototype','_rr','map','length','online','loggedIn','mailPause','available','paused','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ad9,0x117));var _0x94ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4ad9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x94ad('0x0'));var md5=require(_0x94ad('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x94ad('0x2'));config[_0x94ad('0x3')]=_[_0x94ad('0x4')](config[_0x94ad('0x3')],{'host':_0x94ad('0x5'),'port':0x18eb});var io=require(_0x94ad('0x6'))(new Redis(config[_0x94ad('0x3')]));function MailQueue(_0x12d25b){this['id']=_0x12d25b['id']||0x0;this['name']=_0x12d25b[_0x94ad('0x7')]||'';this[_0x94ad('0x8')]=_0x12d25b[_0x94ad('0x8')]||0xa;this[_0x94ad('0x9')]=_0x12d25b[_0x94ad('0x9')]||_0x94ad('0xa');this[_0x94ad('0xb')]=_0x12d25b[_0x94ad('0xb')];this[_0x94ad('0xc')]={};this['waiting']=0x0;this[_0x94ad('0x1')]='';this[_0x94ad('0xd')]();this['updateRealtime']();}MailQueue[_0x94ad('0xe')]['updateRouting']=function(){var _0x2a02ba=this[_0x94ad('0xc')][_0x94ad('0xf')];this[_0x94ad('0xc')]=_[_0x94ad('0x10')](this['Agents'],'id');this[_0x94ad('0xc')][_0x94ad('0xf')]=_0x2a02ba;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x24c025=0x0;_0x24c025=0x0?this[_0x94ad('0x15')]:0x0;var _0x13be3b={'id':this['id'],'available':this[_0x94ad('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x94ad('0x7')],'paused':this[_0x94ad('0x16')],'waiting':this['waiting']};var _0x162e4b=md5(JSON[_0x94ad('0x17')](_0x13be3b));if(this[_0x94ad('0x1')]!==_0x162e4b){this[_0x94ad('0x1')]=_0x162e4b;io['to'](util[_0x94ad('0x18')](_0x94ad('0x19'),_0x13be3b[_0x94ad('0x7')]))[_0x94ad('0x1a')](_0x94ad('0x1b'),_0x13be3b);}};module[_0x94ad('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f1da02d..ca4569c 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xadb5,0xad));var _0x5adb=function(_0xe52896,_0x5c7b03){_0xe52896=_0xe52896-0x0;var _0x272be9=_0xadb5[_0xe52896];return _0x272be9;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0xadb5,0xad));var _0x5adb=function(_0x3d7927,_0x5ab5ad){_0x3d7927=_0x3d7927-0x0;var _0x4ae48d=_0xadb5[_0x3d7927];return _0x4ae48d;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a3cf325..012e378 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 _0x1bb2=['sms_queue:save','exports','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','paused','length','online','smsPause','available','loggedIn','waiting','format','sms:queue:%s','emit'];(function(_0x2318b2,_0x5737ed){var _0x56634a=function(_0x3001c2){while(--_0x3001c2){_0x2318b2['push'](_0x2318b2['shift']());}};_0x56634a(++_0x5737ed);}(_0x1bb2,0x152));var _0x21bb=function(_0x2b9a6d,_0xda4a7a){_0x2b9a6d=_0x2b9a6d-0x0;var _0x330794=_0x1bb2[_0x2b9a6d];return _0x330794;};'use strict';var _=require('lodash');var md5=require(_0x21bb('0x0'));var util=require(_0x21bb('0x1'));var Redis=require(_0x21bb('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x21bb('0x3')](config[_0x21bb('0x4')],{'host':_0x21bb('0x5'),'port':0x18eb});var io=require(_0x21bb('0x6'))(new Redis(config[_0x21bb('0x4')]));function SmsQueue(_0xa0e9a1){this['id']=_0xa0e9a1['id']||0x0;this[_0x21bb('0x7')]=_0xa0e9a1[_0x21bb('0x7')]||'';this[_0x21bb('0x8')]=_0xa0e9a1[_0x21bb('0x8')]||0xa;this[_0x21bb('0x9')]=_0xa0e9a1[_0x21bb('0x9')]||'beepall';this[_0x21bb('0xa')]=_0xa0e9a1['Agents'];this[_0x21bb('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x21bb('0xc')]();this[_0x21bb('0xd')]();}SmsQueue[_0x21bb('0xe')][_0x21bb('0xc')]=function(){var _0x17f899=this[_0x21bb('0xb')][_0x21bb('0xf')];this[_0x21bb('0xb')]=_['map'](this[_0x21bb('0xa')],'id');this[_0x21bb('0xb')]['_rr']=_0x17f899;};SmsQueue[_0x21bb('0xe')][_0x21bb('0xd')]=function(){this['loggedIn']=0x0;this[_0x21bb('0x10')]=0x0;for(var _0xae34f3=0x0;_0xae34f3=0x0?this[_0x21bb('0x14')]:0x0;var _0x4393d8={'id':this['id'],'available':this[_0x21bb('0x14')],'loggedIn':this[_0x21bb('0x15')],'name':this['name'],'paused':this[_0x21bb('0x10')],'waiting':this[_0x21bb('0x16')]};var _0x436ea6=md5(JSON['stringify'](_0x4393d8));if(this[_0x21bb('0x0')]!==_0x436ea6){this[_0x21bb('0x0')]=_0x436ea6;io['to'](util[_0x21bb('0x17')](_0x21bb('0x18'),_0x4393d8[_0x21bb('0x7')]))[_0x21bb('0x19')](_0x21bb('0x1a'),_0x4393d8);}};module[_0x21bb('0x1b')]=SmsQueue; \ No newline at end of file +var _0x8a55=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0xc08f4,_0x32c956){var _0x2c84b3=function(_0x3622f3){while(--_0x3622f3){_0xc08f4['push'](_0xc08f4['shift']());}};_0x2c84b3(++_0x32c956);}(_0x8a55,0x185));var _0x58a5=function(_0x11c0e6,_0x53741d){_0x11c0e6=_0x11c0e6-0x0;var _0x527ffb=_0x8a55[_0x11c0e6];return _0x527ffb;};'use strict';var _=require(_0x58a5('0x0'));var md5=require(_0x58a5('0x1'));var util=require(_0x58a5('0x2'));var Redis=require(_0x58a5('0x3'));var config=require(_0x58a5('0x4'));config[_0x58a5('0x5')]=_[_0x58a5('0x6')](config[_0x58a5('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x58a5('0x7'))(new Redis(config[_0x58a5('0x5')]));function SmsQueue(_0x4e2752){this['id']=_0x4e2752['id']||0x0;this[_0x58a5('0x8')]=_0x4e2752[_0x58a5('0x8')]||'';this[_0x58a5('0x9')]=_0x4e2752[_0x58a5('0x9')]||0xa;this[_0x58a5('0xa')]=_0x4e2752[_0x58a5('0xa')]||'beepall';this[_0x58a5('0xb')]=_0x4e2752[_0x58a5('0xb')];this[_0x58a5('0xc')]={};this[_0x58a5('0xd')]=0x0;this[_0x58a5('0x1')]='';this[_0x58a5('0xe')]();this[_0x58a5('0xf')]();}SmsQueue[_0x58a5('0x10')][_0x58a5('0xe')]=function(){var _0x2f6bd9=this[_0x58a5('0xc')][_0x58a5('0x11')];this[_0x58a5('0xc')]=_[_0x58a5('0x12')](this['Agents'],'id');this[_0x58a5('0xc')][_0x58a5('0x11')]=_0x2f6bd9;};SmsQueue[_0x58a5('0x10')][_0x58a5('0xf')]=function(){this[_0x58a5('0x13')]=0x0;this['paused']=0x0;for(var _0x504295=0x0;_0x504295=0x0?this[_0x58a5('0x18')]:0x0;var _0x59c170={'id':this['id'],'available':this['available'],'loggedIn':this[_0x58a5('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x12abb2=md5(JSON[_0x58a5('0x19')](_0x59c170));if(this['md5']!==_0x12abb2){this[_0x58a5('0x1')]=_0x12abb2;io['to'](util[_0x58a5('0x1a')](_0x58a5('0x1b'),_0x59c170['name']))[_0x58a5('0x1c')](_0x58a5('0x1d'),_0x59c170);}};module[_0x58a5('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bca4514..6b0b10c 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 _0x4735=['length','available','loggedIn','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','Agents','_rr','paused'];(function(_0x420919,_0x47b52f){var _0x567fd8=function(_0xa2475d){while(--_0xa2475d){_0x420919['push'](_0x420919['shift']());}};_0x567fd8(++_0x47b52f);}(_0x4735,0x119));var _0x5473=function(_0x3b73c8,_0x222b86){_0x3b73c8=_0x3b73c8-0x0;var _0x1c927c=_0x4735[_0x3b73c8];return _0x1c927c;};'use strict';var _=require(_0x5473('0x0'));var md5=require(_0x5473('0x1'));var util=require(_0x5473('0x2'));var Redis=require('ioredis');var config=require(_0x5473('0x3'));config[_0x5473('0x4')]=_[_0x5473('0x5')](config[_0x5473('0x4')],{'host':_0x5473('0x6'),'port':0x18eb});var io=require(_0x5473('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x27542c){this['id']=_0x27542c['id']||0x0;this[_0x5473('0x8')]=_0x27542c[_0x5473('0x8')]||'';this['timeout']=_0x27542c[_0x5473('0x9')]||0xa;this['strategy']=_0x27542c[_0x5473('0xa')]||'beepall';this['Agents']=_0x27542c['Agents'];this[_0x5473('0xb')]={};this[_0x5473('0xc')]=0x0;this[_0x5473('0x1')]='';this[_0x5473('0xd')]();this[_0x5473('0xe')]();}WhatsappQueue[_0x5473('0xf')]['updateRouting']=function(){var _0x573f13=this[_0x5473('0xb')]['_rr'];this[_0x5473('0xb')]=_['map'](this[_0x5473('0x10')],'id');this[_0x5473('0xb')][_0x5473('0x11')]=_0x573f13;};WhatsappQueue[_0x5473('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x5473('0x12')]=0x0;for(var _0xc82dc7=0x0;_0xc82dc7=0x0?this[_0x5473('0x14')]:0x0;var _0x4eda57={'id':this['id'],'available':this[_0x5473('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x5473('0x8')],'paused':this[_0x5473('0x12')],'waiting':this[_0x5473('0xc')]};var _0x133aea=md5(JSON['stringify'](_0x4eda57));if(this[_0x5473('0x1')]!==_0x133aea){this['md5']=_0x133aea;io['to'](util['format']('whatsapp:queue:%s',_0x4eda57[_0x5473('0x8')]))[_0x5473('0x16')](_0x5473('0x17'),_0x4eda57);}};module[_0x5473('0x18')]=WhatsappQueue; \ No newline at end of file +var _0xc837=['updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0xbab353,_0x37e159){var _0x56871e=function(_0x474f77){while(--_0x474f77){_0xbab353['push'](_0xbab353['shift']());}};_0x56871e(++_0x37e159);}(_0xc837,0xe2));var _0x7c83=function(_0x4bc08a,_0x58660d){_0x4bc08a=_0x4bc08a-0x0;var _0x3ee179=_0xc837[_0x4bc08a];return _0x3ee179;};'use strict';var _=require('lodash');var md5=require(_0x7c83('0x0'));var util=require(_0x7c83('0x1'));var Redis=require(_0x7c83('0x2'));var config=require(_0x7c83('0x3'));config[_0x7c83('0x4')]=_[_0x7c83('0x5')](config[_0x7c83('0x4')],{'host':_0x7c83('0x6'),'port':0x18eb});var io=require(_0x7c83('0x7'))(new Redis(config[_0x7c83('0x4')]));function WhatsappQueue(_0x107bf6){this['id']=_0x107bf6['id']||0x0;this[_0x7c83('0x8')]=_0x107bf6[_0x7c83('0x8')]||'';this['timeout']=_0x107bf6[_0x7c83('0x9')]||0xa;this[_0x7c83('0xa')]=_0x107bf6[_0x7c83('0xa')]||_0x7c83('0xb');this[_0x7c83('0xc')]=_0x107bf6[_0x7c83('0xc')];this[_0x7c83('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0x7c83('0xe')]();this[_0x7c83('0xf')]();}WhatsappQueue[_0x7c83('0x10')][_0x7c83('0xe')]=function(){var _0x52d9ac=this[_0x7c83('0xd')][_0x7c83('0x11')];this[_0x7c83('0xd')]=_[_0x7c83('0x12')](this[_0x7c83('0xc')],'id');this[_0x7c83('0xd')][_0x7c83('0x11')]=_0x52d9ac;};WhatsappQueue[_0x7c83('0x10')][_0x7c83('0xf')]=function(){this['loggedIn']=0x0;this[_0x7c83('0x13')]=0x0;for(var _0x12887e=0x0;_0x12887e=0x0?this['available']:0x0;var _0x339782={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7c83('0x16')],'name':this[_0x7c83('0x8')],'paused':this[_0x7c83('0x13')],'waiting':this['waiting']};var _0x3d4ed8=md5(JSON[_0x7c83('0x19')](_0x339782));if(this[_0x7c83('0x0')]!==_0x3d4ed8){this['md5']=_0x3d4ed8;io['to'](util[_0x7c83('0x1a')]('whatsapp:queue:%s',_0x339782[_0x7c83('0x8')]))[_0x7c83('0x1b')](_0x7c83('0x1c'),_0x339782);}};module[_0x7c83('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 6ee4dab..3c8af80 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x53745b,_0x974d57){var _0x8c9562=function(_0x14dabc){while(--_0x14dabc){_0x53745b['push'](_0x53745b['shift']());}};_0x8c9562(++_0x974d57);}(_0xb10b,0x12a));var _0xbb10=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xb10b[_0x209fcd];return _0x501d5e;};'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 6304878..65e75f4 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 _0xaccf=['Request','AddTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x3f5672,_0xacd24f){var _0x5c4b36=function(_0x120d7e){while(--_0x120d7e){_0x3f5672['push'](_0x3f5672['shift']());}};_0x5c4b36(++_0xacd24f);}(_0xaccf,0xfe));var _0xfacc=function(_0x7c9243,_0x54d4dd){_0x7c9243=_0x7c9243-0x0;var _0xea5163=_0xaccf[_0x7c9243];return _0xea5163;};'use strict';var client=require(_0xfacc('0x0'));exports[_0xfacc('0x1')]=function(_0x19a8ec,_0x4a2f03){return client['Request'](_0xfacc('0x2'),{'body':_0x4a2f03,'options':{'where':{'id':_0x19a8ec}},'log':_0xfacc('0x3')});};exports['addTags']=function(_0x9f6f60,_0x1273a7){return client[_0xfacc('0x4')](_0xfacc('0x5'),{'body':_0x1273a7,'options':{'where':{'id':_0x9f6f60}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2f35=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x2f35,0x68));var _0x52f3=function(_0x52f73a,_0x4418dd){_0x52f73a=_0x52f73a-0x0;var _0x4b5d40=_0x2f35[_0x52f73a];return _0x4b5d40;};'use strict';var client=require(_0x52f3('0x0'));exports[_0x52f3('0x1')]=function(_0x573c0a,_0x168b5f){return client[_0x52f3('0x2')](_0x52f3('0x3'),{'body':_0x168b5f,'options':{'where':{'id':_0x573c0a}},'log':'updateChatInteraction'});};exports[_0x52f3('0x4')]=function(_0x25cadf,_0x50fb97){return client[_0x52f3('0x2')](_0x52f3('0x5'),{'body':_0x50fb97,'options':{'where':{'id':_0x25cadf}},'log':_0x52f3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2224fed..4fad828 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 _0x0016=['Request','../client','create'];(function(_0x193262,_0x2710bf){var _0x4fb60f=function(_0xecfd67){while(--_0xecfd67){_0x193262['push'](_0x193262['shift']());}};_0x4fb60f(++_0x2710bf);}(_0x0016,0x196));var _0x6001=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x0016[_0x3b150c];return _0x5cd414;};'use strict';var client=require(_0x6001('0x0'));exports[_0x6001('0x1')]=function(_0x53211f){return client[_0x6001('0x2')]('CreateChatMessage',{'body':_0x53211f,'log':'createChatMessage'});}; \ No newline at end of file +var _0x7ca2=['Request','createChatMessage','../client','create'];(function(_0x3b395a,_0xb9a82d){var _0x4aeef2=function(_0x44ef00){while(--_0x44ef00){_0x3b395a['push'](_0x3b395a['shift']());}};_0x4aeef2(++_0xb9a82d);}(_0x7ca2,0x196));var _0x27ca=function(_0x52d5ed,_0x516f5f){_0x52d5ed=_0x52d5ed-0x0;var _0x3f9b6c=_0x7ca2[_0x52d5ed];return _0x3f9b6c;};'use strict';var client=require(_0x27ca('0x0'));exports[_0x27ca('0x1')]=function(_0x38711a){return client[_0x27ca('0x2')]('CreateChatMessage',{'body':_0x38711a,'log':_0x27ca('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index cb0dd42..0b96584 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 _0x7676=['online','chatPause','../client','getChatQueues','Request','name','User'];(function(_0x1de43b,_0x499437){var _0xdf125b=function(_0xaf429e){while(--_0xaf429e){_0x1de43b['push'](_0x1de43b['shift']());}};_0xdf125b(++_0x499437);}(_0x7676,0xb8));var _0x6767=function(_0x3eafeb,_0x2a65c0){_0x3eafeb=_0x3eafeb-0x0;var _0xfc1f7b=_0x7676[_0x3eafeb];return _0xfc1f7b;};'use strict';var client=require(_0x6767('0x0'));exports[_0x6767('0x1')]=function(){return function(){return client[_0x6767('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x6767('0x3'),'timeout','strategy'],'include':[{'model':_0x6767('0x4'),'as':'Agents','attributes':['id',_0x6767('0x3'),_0x6767('0x5'),_0x6767('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x27c5=['chatPause','getChatQueues','Request','GetChatQueue','name','strategy','User','Agents','online'];(function(_0xa7228,_0x437876){var _0x273d85=function(_0x145d86){while(--_0x145d86){_0xa7228['push'](_0xa7228['shift']());}};_0x273d85(++_0x437876);}(_0x27c5,0x173));var _0x527c=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x27c5[_0x1be3b3];return _0x4f8b2d;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x527c('0x0')](_0x527c('0x1'),{'options':{'raw':![],'attributes':['id',_0x527c('0x2'),'timeout',_0x527c('0x3')],'include':[{'model':_0x527c('0x4'),'as':_0x527c('0x5'),'attributes':['id',_0x527c('0x2'),_0x527c('0x6'),_0x527c('0x7')]}]},'log':_0x527c('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a3455bc..f73e707 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 _0x57d4=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x9bbfd8,_0x1cb40a){var _0x1735c8=function(_0x2bc465){while(--_0x2bc465){_0x9bbfd8['push'](_0x9bbfd8['shift']());}};_0x1735c8(++_0x1cb40a);}(_0x57d4,0x78));var _0x457d=function(_0x518c47,_0x323b86){_0x518c47=_0x518c47-0x0;var _0x4f2fbe=_0x57d4[_0x518c47];return _0x4f2fbe;};'use strict';var client=require(_0x457d('0x0'));exports[_0x457d('0x1')]=function(_0x47a573){return client[_0x457d('0x2')](_0x457d('0x3'),{'body':_0x47a573,'log':_0x457d('0x3')});};exports[_0x457d('0x4')]=function(_0x1219e1,_0x3c89b2){return client[_0x457d('0x2')](_0x457d('0x5'),{'body':_0x3c89b2,'options':{'where':{'uniqueid':_0x1219e1},'order':[['id',_0x457d('0x6')]],'limit':0x1},'log':_0x457d('0x5')});}; \ No newline at end of file +var _0xdadd=['../client','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xdadd,0x1c8));var _0xddad=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0xdadd[_0x4e9861];return _0x49802f;};'use strict';var client=require(_0xddad('0x0'));exports['create']=function(_0x34afe8){return client['Request'](_0xddad('0x1'),{'body':_0x34afe8,'log':_0xddad('0x1')});};exports[_0xddad('0x2')]=function(_0x484d96,_0x3d18f1){return client[_0xddad('0x3')](_0xddad('0x4'),{'body':_0x3d18f1,'options':{'where':{'uniqueid':_0x484d96},'order':[['id',_0xddad('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 04984e9..e6f6669 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(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x7a54,0x106));var _0x47a5=function(_0x1ef4ed,_0x44806f){_0x1ef4ed=_0x1ef4ed-0x0;var _0x1d23d5=_0x7a54[_0x1ef4ed];return _0x1d23d5;};'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(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x7a54,0x106));var _0x47a5=function(_0x27e80e,_0x2280ca){_0x27e80e=_0x27e80e-0x0;var _0x43e0c3=_0x7a54[_0x27e80e];return _0x43e0c3;};'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 dd21394..8c8afc1 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 _0x0422=['../client','Request','CreateFaxMessage'];(function(_0x191452,_0x4d5e19){var _0x16d637=function(_0x7b5c39){while(--_0x7b5c39){_0x191452['push'](_0x191452['shift']());}};_0x16d637(++_0x4d5e19);}(_0x0422,0x162));var _0x2042=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x0422[_0x58a4ac];return _0x545810;};'use strict';var client=require(_0x2042('0x0'));exports['create']=function(_0x475889){return client[_0x2042('0x1')](_0x2042('0x2'),{'body':_0x475889,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x5dab=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x4ec93c,_0x175e38){var _0x576871=function(_0x1150d4){while(--_0x1150d4){_0x4ec93c['push'](_0x4ec93c['shift']());}};_0x576871(++_0x175e38);}(_0x5dab,0x115));var _0xb5da=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x5dab[_0x5b561d];return _0x431060;};'use strict';var client=require(_0xb5da('0x0'));exports['create']=function(_0xeac521){return client[_0xb5da('0x1')](_0xb5da('0x2'),{'body':_0xeac521,'log':_0xb5da('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1fc112e..81781af 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 _0x16dd=['../client','Request','GetFaxQueue','name','strategy','online','faxPause','getFaxQueues'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x16dd,0xf8));var _0xd16d=function(_0x353b16,_0x44e32a){_0x353b16=_0x353b16-0x0;var _0x5dd1e6=_0x16dd[_0x353b16];return _0x5dd1e6;};'use strict';var client=require(_0xd16d('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xd16d('0x1')](_0xd16d('0x2'),{'options':{'raw':![],'attributes':['id',_0xd16d('0x3'),'timeout',_0xd16d('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xd16d('0x3'),_0xd16d('0x5'),_0xd16d('0x6')]}]},'log':_0xd16d('0x7')});};}; \ No newline at end of file +var _0xe3d3=['../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User','Agents','name','faxPause'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xe3d3,0x154));var _0x3e3d=function(_0x1efe9c,_0x2d2abe){_0x1efe9c=_0x1efe9c-0x0;var _0x4802c9=_0xe3d3[_0x1efe9c];return _0x4802c9;};'use strict';var client=require(_0x3e3d('0x0'));exports[_0x3e3d('0x1')]=function(){return function(){return client[_0x3e3d('0x2')](_0x3e3d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3e3d('0x4'),_0x3e3d('0x5')],'include':[{'model':_0x3e3d('0x6'),'as':_0x3e3d('0x7'),'attributes':['id',_0x3e3d('0x8'),'online',_0x3e3d('0x9')]}]},'log':_0x3e3d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 53a21ab..e222296 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 _0x5f90=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','create'];(function(_0x18c44d,_0x33976d){var _0x71abcf=function(_0x43072b){while(--_0x43072b){_0x18c44d['push'](_0x18c44d['shift']());}};_0x71abcf(++_0x33976d);}(_0x5f90,0x9a));var _0x05f9=function(_0x596a15,_0x4f9222){_0x596a15=_0x596a15-0x0;var _0x2e8c91=_0x5f90[_0x596a15];return _0x2e8c91;};'use strict';var client=require('../client');exports[_0x05f9('0x0')]=function(_0x385197){return client[_0x05f9('0x1')](_0x05f9('0x2'),{'body':_0x385197,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x3e0450,_0x5badd6){return client[_0x05f9('0x1')](_0x05f9('0x3'),{'body':_0x5badd6,'options':{'where':{'uniqueid':_0x3e0450},'order':[['id',_0x05f9('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x666c=['create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC','../client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x666c,0x1f0));var _0xc666=function(_0x574de7,_0x24ce60){_0x574de7=_0x574de7-0x0;var _0x568f46=_0x666c[_0x574de7];return _0x568f46;};'use strict';var client=require(_0xc666('0x0'));exports[_0xc666('0x1')]=function(_0xa4555e){return client['Request'](_0xc666('0x2'),{'body':_0xa4555e,'log':_0xc666('0x2')});};exports[_0xc666('0x3')]=function(_0x16ab45,_0xe1401d){return client[_0xc666('0x4')](_0xc666('0x5'),{'body':_0xe1401d,'options':{'where':{'uniqueid':_0x16ab45},'order':[['id',_0xc666('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 03f69f6..a986d20 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 _0x3bfa=['getIntervals','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x4d55ca,_0x4c5f5c){var _0x6c5d34=function(_0xe918b2){while(--_0xe918b2){_0x4d55ca['push'](_0x4d55ca['shift']());}};_0x6c5d34(++_0x4c5f5c);}(_0x3bfa,0xd8));var _0xa3bf=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x3bfa[_0x1e7b16];return _0x37fadc;};'use strict';var client=require(_0xa3bf('0x0'));exports[_0xa3bf('0x1')]=function(){return function(){return client['Request'](_0xa3bf('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa3bf('0x3')],'include':[{'model':_0xa3bf('0x4'),'as':_0xa3bf('0x5'),'attributes':['id',_0xa3bf('0x3'),_0xa3bf('0x6')]}]},'log':_0xa3bf('0x1')});};}; \ No newline at end of file +var _0xc75d=['Intervals','name','interval','../client','getIntervals','Request','GetInterval'];(function(_0x28faf6,_0x4c12f0){var _0x835145=function(_0x2f040b){while(--_0x2f040b){_0x28faf6['push'](_0x28faf6['shift']());}};_0x835145(++_0x4c12f0);}(_0xc75d,0x65));var _0xdc75=function(_0x405890,_0x90bef6){_0x405890=_0x405890-0x0;var _0x3b4426=_0xc75d[_0x405890];return _0x3b4426;};'use strict';var client=require(_0xdc75('0x0'));exports[_0xdc75('0x1')]=function(){return function(){return client[_0xdc75('0x2')](_0xdc75('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xdc75('0x4'),'attributes':['id',_0xdc75('0x5'),_0xdc75('0x6')]}]},'log':_0xdc75('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1284219..62e566e 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 _0x7916=['Request','addTagsToChatInteraction','../client','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x1eb884,_0x20082e){var _0x540ade=function(_0x332539){while(--_0x332539){_0x1eb884['push'](_0x1eb884['shift']());}};_0x540ade(++_0x20082e);}(_0x7916,0x128));var _0x6791=function(_0x1f4476,_0x12e30f){_0x1f4476=_0x1f4476-0x0;var _0x33a316=_0x7916[_0x1f4476];return _0x33a316;};'use strict';var client=require(_0x6791('0x0'));exports['update']=function(_0xeb0b9f,_0xdaaf2b){return client['Request'](_0x6791('0x1'),{'body':_0xdaaf2b,'options':{'where':{'id':_0xeb0b9f}},'log':_0x6791('0x2')});};exports[_0x6791('0x3')]=function(_0x330476,_0x5e6303){return client[_0x6791('0x4')]('AddTagsToMailInteraction',{'body':_0x5e6303,'options':{'where':{'id':_0x330476}},'log':_0x6791('0x5')});}; \ No newline at end of file +var _0x8f4c=['update','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x542818,_0x33eb50){var _0x3b202c=function(_0x31272b){while(--_0x31272b){_0x542818['push'](_0x542818['shift']());}};_0x3b202c(++_0x33eb50);}(_0x8f4c,0x113));var _0xc8f4=function(_0x43cba5,_0x4a2f83){_0x43cba5=_0x43cba5-0x0;var _0x359d1a=_0x8f4c[_0x43cba5];return _0x359d1a;};'use strict';var client=require(_0xc8f4('0x0'));exports[_0xc8f4('0x1')]=function(_0xce26f2,_0x43926b){return client[_0xc8f4('0x2')](_0xc8f4('0x3'),{'body':_0x43926b,'options':{'where':{'id':_0xce26f2}},'log':'updateMailInteraction'});};exports[_0xc8f4('0x4')]=function(_0x47350d,_0x133764){return client['Request'](_0xc8f4('0x5'),{'body':_0x133764,'options':{'where':{'id':_0x47350d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 830efb3..16d0f57 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 _0xac18=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac18,0x105));var _0x8ac1=function(_0x3fabfd,_0x2da600){_0x3fabfd=_0x3fabfd-0x0;var _0x2804e1=_0xac18[_0x3fabfd];return _0x2804e1;};'use strict';var client=require(_0x8ac1('0x0'));exports[_0x8ac1('0x1')]=function(_0x3cae50){return client[_0x8ac1('0x2')](_0x8ac1('0x3'),{'body':_0x3cae50,'log':_0x8ac1('0x4')});}; \ No newline at end of file +var _0xe34f=['createMailMessage','../client','Request'];(function(_0x470244,_0x10294b){var _0x4e1052=function(_0x2dc9ec){while(--_0x2dc9ec){_0x470244['push'](_0x470244['shift']());}};_0x4e1052(++_0x10294b);}(_0xe34f,0x15a));var _0xfe34=function(_0x10ae06,_0x269932){_0x10ae06=_0x10ae06-0x0;var _0x56a368=_0xe34f[_0x10ae06];return _0x56a368;};'use strict';var client=require(_0xfe34('0x0'));exports['create']=function(_0x2e3762){return client[_0xfe34('0x1')]('CreateMailMessage',{'body':_0x2e3762,'log':_0xfe34('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9bc012c..fead054 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 _0xcb00=['GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request'];(function(_0x54fadc,_0x1fb2a8){var _0x2cc5e8=function(_0x28b160){while(--_0x28b160){_0x54fadc['push'](_0x54fadc['shift']());}};_0x2cc5e8(++_0x1fb2a8);}(_0xcb00,0x13c));var _0x0cb0=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xcb00[_0x1602ef];return _0x5870ee;};'use strict';var client=require(_0x0cb0('0x0'));exports[_0x0cb0('0x1')]=function(){return function(){return client[_0x0cb0('0x2')](_0x0cb0('0x3'),{'options':{'raw':![],'attributes':['id',_0x0cb0('0x4'),_0x0cb0('0x5'),_0x0cb0('0x6')],'include':[{'model':_0x0cb0('0x7'),'as':_0x0cb0('0x8'),'attributes':['id',_0x0cb0('0x4'),_0x0cb0('0x9'),_0x0cb0('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x3492=['User','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x3050e7,_0x1d080d){var _0x88f963=function(_0x4c9a22){while(--_0x4c9a22){_0x3050e7['push'](_0x3050e7['shift']());}};_0x88f963(++_0x1d080d);}(_0x3492,0x123));var _0x2349=function(_0x391839,_0x2a3019){_0x391839=_0x391839-0x0;var _0x1e6960=_0x3492[_0x391839];return _0x1e6960;};'use strict';var client=require(_0x2349('0x0'));exports[_0x2349('0x1')]=function(){return function(){return client[_0x2349('0x2')](_0x2349('0x3'),{'options':{'raw':![],'attributes':['id',_0x2349('0x4'),_0x2349('0x5'),'strategy'],'include':[{'model':_0x2349('0x6'),'as':'Agents','attributes':['id','name',_0x2349('0x7'),_0x2349('0x8')]}]},'log':_0x2349('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 5e9d39e..d5dee82 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 _0xc8ed=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0x353a30,_0x50c68a){var _0x213161=function(_0x440b8b){while(--_0x440b8b){_0x353a30['push'](_0x353a30['shift']());}};_0x213161(++_0x50c68a);}(_0xc8ed,0x1d7));var _0xdc8e=function(_0x5e0f7d,_0x4c5d99){_0x5e0f7d=_0x5e0f7d-0x0;var _0x43672b=_0xc8ed[_0x5e0f7d];return _0x43672b;};'use strict';var client=require(_0xdc8e('0x0'));exports[_0xdc8e('0x1')]=function(_0x2e2a85){return client[_0xdc8e('0x2')]('CreateMailQueueReport',{'body':_0x2e2a85,'log':_0xdc8e('0x3')});};exports[_0xdc8e('0x4')]=function(_0x394bf1,_0x33d38d){return client['Request'](_0xdc8e('0x5'),{'body':_0x33d38d,'options':{'where':{'uniqueid':_0x394bf1},'order':[['id',_0xdc8e('0x6')]],'limit':0x1},'log':_0xdc8e('0x5')});}; \ No newline at end of file +var _0xd389=['update','UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x30f768,_0x4872f0){var _0x3f4edc=function(_0x411c2a){while(--_0x411c2a){_0x30f768['push'](_0x30f768['shift']());}};_0x3f4edc(++_0x4872f0);}(_0xd389,0x135));var _0x9d38=function(_0x287f6c,_0x778cc9){_0x287f6c=_0x287f6c-0x0;var _0x40d97f=_0xd389[_0x287f6c];return _0x40d97f;};'use strict';var client=require(_0x9d38('0x0'));exports['create']=function(_0x50c11a){return client[_0x9d38('0x1')](_0x9d38('0x2'),{'body':_0x50c11a,'log':'CreateMailQueueReport'});};exports[_0x9d38('0x3')]=function(_0x2de500,_0x311f84){return client[_0x9d38('0x1')](_0x9d38('0x4'),{'body':_0x311f84,'options':{'where':{'uniqueid':_0x2de500},'order':[['id',_0x9d38('0x5')]],'limit':0x1},'log':_0x9d38('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d10bbc2..827b0bd 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 _0xa0e1=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x297df7,_0x8d74c2){var _0x5de49f=function(_0x5ebc1b){while(--_0x5ebc1b){_0x297df7['push'](_0x297df7['shift']());}};_0x5de49f(++_0x8d74c2);}(_0xa0e1,0x160));var _0x1a0e=function(_0x352731,_0x57d8ed){_0x352731=_0x352731-0x0;var _0x21ad59=_0xa0e1[_0x352731];return _0x21ad59;};'use strict';var client=require('../client');exports[_0x1a0e('0x0')]=function(_0x1eaaa3,_0x1e0b6c){return client[_0x1a0e('0x1')](_0x1a0e('0x2'),{'body':_0x1e0b6c,'options':{'where':{'id':_0x1eaaa3}},'log':_0x1a0e('0x3')});};exports[_0x1a0e('0x4')]=function(_0x3fcd36,_0x4e2d17){return client['Request'](_0x1a0e('0x5'),{'body':_0x4e2d17,'options':{'where':{'id':_0x3fcd36}},'log':_0x1a0e('0x6')});}; \ No newline at end of file +var _0xf41f=['addTagsToChatInteraction','update','Request','AddTagsToOpenchannelInteraction'];(function(_0x3b5587,_0x22a6f4){var _0x3fbb62=function(_0x41f5ce){while(--_0x41f5ce){_0x3b5587['push'](_0x3b5587['shift']());}};_0x3fbb62(++_0x22a6f4);}(_0xf41f,0x79));var _0xff41=function(_0x10ea83,_0x1c4798){_0x10ea83=_0x10ea83-0x0;var _0x77609f=_0xf41f[_0x10ea83];return _0x77609f;};'use strict';var client=require('../client');exports[_0xff41('0x0')]=function(_0x4236ac,_0xde32e6){return client[_0xff41('0x1')]('UpdateOpenchannelInteraction',{'body':_0xde32e6,'options':{'where':{'id':_0x4236ac}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x1a24a5,_0x4264a6){return client[_0xff41('0x1')](_0xff41('0x2'),{'body':_0x4264a6,'options':{'where':{'id':_0x1a24a5}},'log':_0xff41('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4b71e2f..60697b2 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 _0xa6cf=['create','Request','createOpenchannelMessage'];(function(_0x508e75,_0x56e716){var _0x38771f=function(_0x2849db){while(--_0x2849db){_0x508e75['push'](_0x508e75['shift']());}};_0x38771f(++_0x56e716);}(_0xa6cf,0x1b6));var _0xfa6c=function(_0x2c7824,_0x31d07f){_0x2c7824=_0x2c7824-0x0;var _0x453c6d=_0xa6cf[_0x2c7824];return _0x453c6d;};'use strict';var client=require('../client');exports[_0xfa6c('0x0')]=function(_0x24f640){return client[_0xfa6c('0x1')]('CreateOpenchannelMessage',{'body':_0x24f640,'log':_0xfa6c('0x2')});}; \ No newline at end of file +var _0xd269=['CreateOpenchannelMessage','../client'];(function(_0xb56a21,_0x3093c7){var _0x121573=function(_0x4bb965){while(--_0x4bb965){_0xb56a21['push'](_0xb56a21['shift']());}};_0x121573(++_0x3093c7);}(_0xd269,0x175));var _0x9d26=function(_0x582438,_0x3e6171){_0x582438=_0x582438-0x0;var _0x52d463=_0xd269[_0x582438];return _0x52d463;};'use strict';var client=require(_0x9d26('0x0'));exports['create']=function(_0x5116c3){return client['Request'](_0x9d26('0x1'),{'body':_0x5116c3,'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 6fe7053..5ac46c5 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 _0xabba=['timeout','strategy','name','online','openchannelPause','../client','GetOpenchannelQueue'];(function(_0x2ea20d,_0x5e8e3c){var _0x3ba66a=function(_0x164ca6){while(--_0x164ca6){_0x2ea20d['push'](_0x2ea20d['shift']());}};_0x3ba66a(++_0x5e8e3c);}(_0xabba,0x12b));var _0xaabb=function(_0x74022e,_0xee3b6c){_0x74022e=_0x74022e-0x0;var _0x5b1f8d=_0xabba[_0x74022e];return _0x5b1f8d;};'use strict';var client=require(_0xaabb('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0xaabb('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xaabb('0x2'),_0xaabb('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xaabb('0x4'),_0xaabb('0x5'),_0xaabb('0x6')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x3abb=['online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','Agents'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0x3abb,0xeb));var _0xb3ab=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x3abb[_0x500419];return _0x241c1a;};'use strict';var client=require(_0xb3ab('0x0'));exports[_0xb3ab('0x1')]=function(){return function(){return client[_0xb3ab('0x2')](_0xb3ab('0x3'),{'options':{'raw':![],'attributes':['id',_0xb3ab('0x4'),'timeout',_0xb3ab('0x5')],'include':[{'model':_0xb3ab('0x6'),'as':_0xb3ab('0x7'),'attributes':['id',_0xb3ab('0x4'),_0xb3ab('0x8'),'openchannelPause']}]},'log':_0xb3ab('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 59523c9..41723d7 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 _0x13b6=['UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x3134e0,_0x2eb7df){var _0x6cc72f=function(_0x1ba2a3){while(--_0x1ba2a3){_0x3134e0['push'](_0x3134e0['shift']());}};_0x6cc72f(++_0x2eb7df);}(_0x13b6,0x97));var _0x613b=function(_0x24fc1f,_0x38bdfd){_0x24fc1f=_0x24fc1f-0x0;var _0x1d10b6=_0x13b6[_0x24fc1f];return _0x1d10b6;};'use strict';var client=require(_0x613b('0x0'));exports['create']=function(_0x46234e){return client[_0x613b('0x1')](_0x613b('0x2'),{'body':_0x46234e,'log':_0x613b('0x2')});};exports['update']=function(_0x3d03ec,_0x1dc7f9){return client[_0x613b('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x1dc7f9,'options':{'where':{'uniqueid':_0x3d03ec},'order':[['id',_0x613b('0x3')]],'limit':0x1},'log':_0x613b('0x4')});}; \ No newline at end of file +var _0x60ab=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x41a7cc,_0x4700fd){var _0x4ed37d=function(_0x4aea45){while(--_0x4aea45){_0x41a7cc['push'](_0x41a7cc['shift']());}};_0x4ed37d(++_0x4700fd);}(_0x60ab,0x72));var _0xb60a=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x60ab[_0x485f53];return _0x480f1e;};'use strict';var client=require('../client');exports[_0xb60a('0x0')]=function(_0x39023c){return client[_0xb60a('0x1')]('CreateOpenchannelQueueReport',{'body':_0x39023c,'log':_0xb60a('0x2')});};exports[_0xb60a('0x3')]=function(_0x2c746b,_0x1cdcc5){return client[_0xb60a('0x1')](_0xb60a('0x4'),{'body':_0x1cdcc5,'options':{'where':{'uniqueid':_0x2c746b},'order':[['id',_0xb60a('0x5')]],'limit':0x1},'log':_0xb60a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 68b2ad2..4e240ca 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 _0x78b7=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x78b7,0x194));var _0x778b=function(_0x581332,_0x588a7b){_0x581332=_0x581332-0x0;var _0xfa58b4=_0x78b7[_0x581332];return _0xfa58b4;};'use strict';var client=require(_0x778b('0x0'));exports[_0x778b('0x1')]=function(_0x5d5912,_0x377816){return client[_0x778b('0x2')](_0x778b('0x3'),{'body':_0x377816,'options':{'where':{'id':_0x5d5912}},'log':_0x778b('0x4')});};exports[_0x778b('0x5')]=function(_0x4d298d,_0x4c91f3){return client[_0x778b('0x2')](_0x778b('0x6'),{'body':_0x4c91f3,'options':{'where':{'id':_0x4d298d}},'log':_0x778b('0x7')});}; \ No newline at end of file +var _0xf0ba=['AddTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xaf0b('0x0'));exports[_0xaf0b('0x1')]=function(_0x1caf8c,_0x38cf45){return client[_0xaf0b('0x2')]('UpdateSmsInteraction',{'body':_0x38cf45,'options':{'where':{'id':_0x1caf8c}},'log':_0xaf0b('0x3')});};exports[_0xaf0b('0x4')]=function(_0x4cffa5,_0xcd565f){return client['Request'](_0xaf0b('0x5'),{'body':_0xcd565f,'options':{'where':{'id':_0x4cffa5}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index d370680..99a44ac 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 _0x441c=['createSmsMessage','../client','create','Request'];(function(_0x3a3ff4,_0x487ab5){var _0x8ae91d=function(_0x507325){while(--_0x507325){_0x3a3ff4['push'](_0x3a3ff4['shift']());}};_0x8ae91d(++_0x487ab5);}(_0x441c,0x111));var _0xc441=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x441c[_0x5eaa0b];return _0x28b295;};'use strict';var client=require(_0xc441('0x0'));exports[_0xc441('0x1')]=function(_0x3f6b82){return client[_0xc441('0x2')]('CreateSmsMessage',{'body':_0x3f6b82,'log':_0xc441('0x3')});}; \ No newline at end of file +var _0x0fca=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x0fca,0x16f));var _0xa0fc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0fca[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0xa0fc('0x0'));exports[_0xa0fc('0x1')]=function(_0x367483){return client[_0xa0fc('0x2')](_0xa0fc('0x3'),{'body':_0x367483,'log':_0xa0fc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4f17d3a..5e9a400 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x114da0,_0x19188f){var _0x5f1d8a=function(_0x154c3d){while(--_0x154c3d){_0x114da0['push'](_0x114da0['shift']());}};_0x5f1d8a(++_0x19188f);}(_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 +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x41927e,_0x3243d6){var _0x3dfbd5=function(_0x768d1d){while(--_0x768d1d){_0x41927e['push'](_0x41927e['shift']());}};_0x3dfbd5(++_0x3243d6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c515c6b..a2d06e1 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0xedd9,0xfc));var _0x9edd=function(_0x35d83a,_0x403c49){_0x35d83a=_0x35d83a-0x0;var _0x458009=_0xedd9[_0x35d83a];return _0x458009;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x17474a,_0xd1a49c){var _0x3a5495=function(_0x10e1b4){while(--_0x10e1b4){_0x17474a['push'](_0x17474a['shift']());}};_0x3a5495(++_0xd1a49c);}(_0x008c,0x188));var _0xc008=function(_0x50d0a5,_0x3ece14){_0x50d0a5=_0x50d0a5-0x0;var _0x16a49c=_0x008c[_0x50d0a5];return _0x16a49c;};'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 1fed730..40c871a 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(_0x5bc6c7,_0x1cfb29){var _0x17aec5=function(_0x3204f8){while(--_0x3204f8){_0x5bc6c7['push'](_0x5bc6c7['shift']());}};_0x17aec5(++_0x1cfb29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x5ce44b,_0x1b2779){var _0x57a6cc=function(_0x9d5883){while(--_0x9d5883){_0x5ce44b['push'](_0x5ce44b['shift']());}};_0x57a6cc(++_0x1b2779);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 debb1e0..525d11e 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 _0x3024=['../client','update','Request','addTags','addTagsToWhatsappInteraction'];(function(_0xc08214,_0x4ea2a3){var _0x24f661=function(_0x29955a){while(--_0x29955a){_0xc08214['push'](_0xc08214['shift']());}};_0x24f661(++_0x4ea2a3);}(_0x3024,0x64));var _0x4302=function(_0x21e2be,_0x378028){_0x21e2be=_0x21e2be-0x0;var _0x1368a9=_0x3024[_0x21e2be];return _0x1368a9;};'use strict';var client=require(_0x4302('0x0'));exports[_0x4302('0x1')]=function(_0x56b9ec,_0x290d9f){return client[_0x4302('0x2')]('UpdateWhatsappInteraction',{'body':_0x290d9f,'options':{'where':{'id':_0x56b9ec}},'log':'updateWhatsappInteraction'});};exports[_0x4302('0x3')]=function(_0x4ba02d,_0x2d3e1d){return client[_0x4302('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x2d3e1d,'options':{'where':{'id':_0x4ba02d}},'log':_0x4302('0x4')});}; \ No newline at end of file +var _0xee3c=['../client','update','Request','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x30e444,_0x508ed2){var _0x540809=function(_0x5217bd){while(--_0x5217bd){_0x30e444['push'](_0x30e444['shift']());}};_0x540809(++_0x508ed2);}(_0xee3c,0x14a));var _0xcee3=function(_0x4032f0,_0x2ee6ce){_0x4032f0=_0x4032f0-0x0;var _0x4145ee=_0xee3c[_0x4032f0];return _0x4145ee;};'use strict';var client=require(_0xcee3('0x0'));exports[_0xcee3('0x1')]=function(_0x325d92,_0x3de08f){return client[_0xcee3('0x2')](_0xcee3('0x3'),{'body':_0x3de08f,'options':{'where':{'id':_0x325d92}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x435892,_0x4cd398){return client[_0xcee3('0x2')](_0xcee3('0x4'),{'body':_0x4cd398,'options':{'where':{'id':_0x435892}},'log':_0xcee3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f49f2b1..381c4e1 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 _0x1344=['../client','create','Request'];(function(_0x496509,_0x1a0cf0){var _0x372b97=function(_0x404415){while(--_0x404415){_0x496509['push'](_0x496509['shift']());}};_0x372b97(++_0x1a0cf0);}(_0x1344,0x1d4));var _0x4134=function(_0x47031d,_0x35d7b1){_0x47031d=_0x47031d-0x0;var _0x47cf26=_0x1344[_0x47031d];return _0x47cf26;};'use strict';var client=require(_0x4134('0x0'));exports[_0x4134('0x1')]=function(_0x32802b){return client[_0x4134('0x2')]('CreateWhatsappMessage',{'body':_0x32802b,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xe0cf=['../client','create','CreateWhatsappMessage'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe0cf,0x177));var _0xfe0c=function(_0x117f85,_0x5afa65){_0x117f85=_0x117f85-0x0;var _0x1c61a7=_0xe0cf[_0x117f85];return _0x1c61a7;};'use strict';var client=require(_0xfe0c('0x0'));exports[_0xfe0c('0x1')]=function(_0x566f24){return client['Request'](_0xfe0c('0x2'),{'body':_0x566f24,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f5e7c27..fb02a20 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 _0xa4d2=['online','whatsappPause','getWhatsappQueues','Request','name','timeout','User','Agents'];(function(_0x3e93c7,_0x9d5904){var _0xdba5b6=function(_0x3aadaa){while(--_0x3aadaa){_0x3e93c7['push'](_0x3e93c7['shift']());}};_0xdba5b6(++_0x9d5904);}(_0xa4d2,0xd3));var _0x2a4d=function(_0x32ac73,_0x55e1ab){_0x32ac73=_0x32ac73-0x0;var _0xdb1446=_0xa4d2[_0x32ac73];return _0xdb1446;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x2a4d('0x0')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x2a4d('0x1'),_0x2a4d('0x2'),'strategy'],'include':[{'model':_0x2a4d('0x3'),'as':_0x2a4d('0x4'),'attributes':['id',_0x2a4d('0x1'),_0x2a4d('0x5'),_0x2a4d('0x6')]}]},'log':_0x2a4d('0x7')});};}; \ No newline at end of file +var _0xb13e=['Request','GetWhatsappQueue','name','strategy','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x2aa02e,_0x597fe0){var _0xb7e780=function(_0x19fed9){while(--_0x19fed9){_0x2aa02e['push'](_0x2aa02e['shift']());}};_0xb7e780(++_0x597fe0);}(_0xb13e,0x127));var _0xeb13=function(_0x1f8122,_0x2f28ff){_0x1f8122=_0x1f8122-0x0;var _0x49d964=_0xb13e[_0x1f8122];return _0x49d964;};'use strict';var client=require('../client');exports[_0xeb13('0x0')]=function(){return function(){return client[_0xeb13('0x1')](_0xeb13('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb13('0x3'),'timeout',_0xeb13('0x4')],'include':[{'model':'User','as':_0xeb13('0x5'),'attributes':['id',_0xeb13('0x3'),_0xeb13('0x6'),_0xeb13('0x7')]}]},'log':_0xeb13('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index f197375..fda8edf 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 _0x1970=['create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x5d3807,_0xfb1b6){var _0x13b287=function(_0x124abc){while(--_0x124abc){_0x5d3807['push'](_0x5d3807['shift']());}};_0x13b287(++_0xfb1b6);}(_0x1970,0x1eb));var _0x0197=function(_0x1c8876,_0x12b63c){_0x1c8876=_0x1c8876-0x0;var _0x36170b=_0x1970[_0x1c8876];return _0x36170b;};'use strict';var client=require(_0x0197('0x0'));exports[_0x0197('0x1')]=function(_0x41939a){return client['Request'](_0x0197('0x2'),{'body':_0x41939a,'log':_0x0197('0x2')});};exports['update']=function(_0x32a7de,_0x1adf10){return client[_0x0197('0x3')](_0x0197('0x4'),{'body':_0x1adf10,'options':{'where':{'uniqueid':_0x32a7de},'order':[['id',_0x0197('0x5')]],'limit':0x1},'log':_0x0197('0x4')});}; \ No newline at end of file +var _0x8dcb=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8dcb,0x1f2));var _0xb8dc=function(_0x2741d1,_0x501426){_0x2741d1=_0x2741d1-0x0;var _0x521e37=_0x8dcb[_0x2741d1];return _0x521e37;};'use strict';var client=require(_0xb8dc('0x0'));exports[_0xb8dc('0x1')]=function(_0x21580f){return client[_0xb8dc('0x2')](_0xb8dc('0x3'),{'body':_0x21580f,'log':_0xb8dc('0x3')});};exports[_0xb8dc('0x4')]=function(_0x2a463a,_0x27dffd){return client['Request'](_0xb8dc('0x5'),{'body':_0x27dffd,'options':{'where':{'uniqueid':_0x2a463a},'order':[['id',_0xb8dc('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index d5d5419..bf31740 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 _0x4553=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','error','map','message','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy'];(function(_0x360345,_0x164145){var _0x5a1762=function(_0x44f90c){while(--_0x44f90c){_0x360345['push'](_0x360345['shift']());}};_0x5a1762(++_0x164145);}(_0x4553,0x144));var _0x3455=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x4553[_0x3ce3c];return _0x55a2c9;};'use strict';var schema=require(_0x3455('0x0'));var _=require(_0x3455('0x1'));var util=require('util');var seqqueue=require(_0x3455('0x2'));var logger=require(_0x3455('0x3'))(_0x3455('0x4'));var strategy=require(_0x3455('0x5'));var queue=schema({'name':{'type':_0x3455('0x6'),'required':!![],'message':_0x3455('0x7')},'timeout':{'type':_0x3455('0x8'),'message':_0x3455('0x9')}});function writeLog(_0x68d1bf,_0x47fb71,_0x450a27){return logger[_0x3455('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x68d1bf,_0x47fb71[_0x3455('0xb')],_0x450a27));}function handleFindAgent(_0x10a139){return function(_0x203633){return _0x203633['name']['toLowerCase']()===_0x10a139['toLowerCase']();};}exports['consequence']=function(_0x52ea35,_0x2a7064,_0x39d256,_0xe0bf9){return function(_0x18c679){try{var _0x5bb642={'name':_0x2a7064[0x0],'timeout':_0x2a7064[0x1]};var _0x163183=queue[_0x3455('0x0')](_0x5bb642,{'typecast':!![]});if(_0x163183['length']){logger[_0x3455('0xc')]('[%s][AGENT]\x20%s',_0x52ea35,_[_0x3455('0xd')](_0x163183,_0x3455('0xe'))['join'](',\x20'));_0x18c679[_0x3455('0xf')]();}else{var _0x3cf01a=_[_0x3455('0x10')](_0x39d256[_0x3455('0x11')],handleFindAgent(_0x5bb642[_0x3455('0xb')]));if(_0x3cf01a){var _0x6ca489=(_0x5bb642[_0x3455('0x12')]||0xa)*0x3e8;var _0x4859c0,_0x4b94dd;var _0x1c6371=seqqueue[_0x3455('0x13')](_0x6ca489);_0x1c6371['id']=_0x52ea35;_0x1c6371[_0x3455('0x14')]=_0x6ca489;_0x1c6371[_0x3455('0x15')]=_0xe0bf9[_0x3455('0x15')];writeLog(_0x52ea35,_0x3cf01a,util[_0x3455('0x16')](_0x3455('0x17'),_0x6ca489));_0x39d256[_0x3455('0x18')][_0x52ea35]['on'](_0x3455('0x19'),function(){logger[_0x3455('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x52ea35);clearTimeout(_0x4b94dd);_0x4b94dd=undefined;_0x1c6371[_0x3455('0x1a')]();if(_0x39d256[_0x3455('0x18')][_0x52ea35]){delete _0x39d256[_0x3455('0x18')][_0x52ea35];}_0x18c679[_0x3455('0xf')]();});_0x39d256['rules'][_0x52ea35]['on'](_0x3455('0x1b'),function(){if(_0x39d256['rules'][_0x52ea35]){delete _0x39d256[_0x3455('0x18')][_0x52ea35];}});_0x4b94dd=setTimeout(function(){logger[_0x3455('0xa')](_0x3455('0x1c'),_0x52ea35);clearTimeout(_0x4b94dd);_0x1c6371['close']();_0x18c679[_0x3455('0x1d')]();},_0x6ca489);strategy[_0x3455('0x1e')](_0x1c6371,_0x3cf01a,_0x39d256,_0xe0bf9);}else{logger[_0x3455('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x52ea35,_0x5bb642[_0x3455('0xb')]);_0x18c679[_0x3455('0xf')]();}}}catch(_0x4afe7f){console['log'](_0x4afe7f);logger['error'](_0x3455('0x1f'),_0x52ea35,_0x4afe7f[_0x3455('0x20')]);_0x18c679[_0x3455('0xf')]();}};}; \ No newline at end of file +var _0x5f03=['stop','find','agents','timeout','createQueue','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','length','error','message','join'];(function(_0x4f5d87,_0x4f37fb){var _0x593ffe=function(_0x3ba3eb){while(--_0x3ba3eb){_0x4f5d87['push'](_0x4f5d87['shift']());}};_0x593ffe(++_0x4f37fb);}(_0x5f03,0xd0));var _0x35f0=function(_0x3c2be8,_0x112d63){_0x3c2be8=_0x3c2be8-0x0;var _0x23cea3=_0x5f03[_0x3c2be8];return _0x23cea3;};'use strict';var schema=require(_0x35f0('0x0'));var _=require(_0x35f0('0x1'));var util=require(_0x35f0('0x2'));var seqqueue=require(_0x35f0('0x3'));var logger=require(_0x35f0('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x35f0('0x5')},'timeout':{'type':_0x35f0('0x6'),'message':_0x35f0('0x7')}});function writeLog(_0x2d6231,_0x492fdc,_0x3d47fb){return logger[_0x35f0('0x8')](util[_0x35f0('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2d6231,_0x492fdc['name'],_0x3d47fb));}function handleFindAgent(_0x2eb98d){return function(_0x57cb35){return _0x57cb35[_0x35f0('0xa')][_0x35f0('0xb')]()===_0x2eb98d[_0x35f0('0xb')]();};}exports['consequence']=function(_0x13e74b,_0x5c86e2,_0x4a6f45,_0x120244){return function(_0x3b6e6b){try{var _0xbce201={'name':_0x5c86e2[0x0],'timeout':_0x5c86e2[0x1]};var _0x57a0f9=queue['validate'](_0xbce201,{'typecast':!![]});if(_0x57a0f9[_0x35f0('0xc')]){logger[_0x35f0('0xd')]('[%s][AGENT]\x20%s',_0x13e74b,_['map'](_0x57a0f9,_0x35f0('0xe'))[_0x35f0('0xf')](',\x20'));_0x3b6e6b[_0x35f0('0x10')]();}else{var _0xc557dc=_[_0x35f0('0x11')](_0x4a6f45[_0x35f0('0x12')],handleFindAgent(_0xbce201[_0x35f0('0xa')]));if(_0xc557dc){var _0x4af3b1=(_0xbce201[_0x35f0('0x13')]||0xa)*0x3e8;var _0x1bfee2,_0x255252;var _0x138046=seqqueue[_0x35f0('0x14')](_0x4af3b1);_0x138046['id']=_0x13e74b;_0x138046['atimeout']=_0x4af3b1;_0x138046['channel']=_0x120244[_0x35f0('0x15')];writeLog(_0x13e74b,_0xc557dc,util[_0x35f0('0x9')]('START:%s',_0x4af3b1));_0x4a6f45[_0x35f0('0x16')][_0x13e74b]['on'](_0x35f0('0x17'),function(){logger[_0x35f0('0x8')](_0x35f0('0x18'),_0x13e74b);clearTimeout(_0x255252);_0x255252=undefined;_0x138046[_0x35f0('0x19')]();if(_0x4a6f45[_0x35f0('0x16')][_0x13e74b]){delete _0x4a6f45[_0x35f0('0x16')][_0x13e74b];}_0x3b6e6b[_0x35f0('0x10')]();});_0x4a6f45['rules'][_0x13e74b]['on'](_0x35f0('0x1a'),function(){if(_0x4a6f45[_0x35f0('0x16')][_0x13e74b]){delete _0x4a6f45['rules'][_0x13e74b];}});_0x255252=setTimeout(function(){logger[_0x35f0('0x8')](_0x35f0('0x1b'),_0x13e74b);clearTimeout(_0x255252);_0x138046[_0x35f0('0x19')]();_0x3b6e6b['next']();},_0x4af3b1);strategy[_0x35f0('0x1c')](_0x138046,_0xc557dc,_0x4a6f45,_0x120244);}else{logger[_0x35f0('0xd')](_0x35f0('0x1d'),_0x13e74b,_0xbce201['name']);_0x3b6e6b['stop']();}}}catch(_0x59b01c){console[_0x35f0('0x1e')](_0x59b01c);logger['error']('[%s][QUEUE]\x20%s',_0x13e74b,_0x59b01c[_0x35f0('0x1f')]);_0x3b6e6b['stop']();}};}; \ 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 0f0d768..716bd04 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 _0x4ab7=['$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','ChatWebsiteId','upperFirst','account','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime'];(function(_0x1bb448,_0x16e6f1){var _0x2430db=function(_0x5d4752){while(--_0x5d4752){_0x1bb448['push'](_0x1bb448['shift']());}};_0x2430db(++_0x16e6f1);}(_0x4ab7,0x102));var _0x74ab=function(_0x1249b6,_0xacddc3){_0x1249b6=_0x1249b6-0x0;var _0x65474f=_0x4ab7[_0x1249b6];return _0x65474f;};'use strict';var _=require(_0x74ab('0x0'));var moment=require(_0x74ab('0x1'));var AWS=require(_0x74ab('0x2'));var utils=require(_0x74ab('0x3'));var logger=require('../../../../config/logger')(_0x74ab('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x74ab('0x5')),'mailMessage':require(_0x74ab('0x6')),'smsMessage':require(_0x74ab('0x7')),'faxMessage':require(_0x74ab('0x8')),'whatsappMessage':require(_0x74ab('0x9'))};exports[_0x74ab('0xa')]=function(_0x521282,_0x100ca9){return function(_0x4589dd){try{if(!_[_0x74ab('0xb')](this['interaction'][_0x74ab('0xc')])){logger[_0x74ab('0xd')](_0x74ab('0xe'),_0x521282,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4589dd[_0x74ab('0xf')]();}var _0x207a57={'ContactId':this[_0x74ab('0x10')]['id'],'sentAt':moment()[_0x74ab('0x11')](_0x74ab('0x12')),'direction':_0x74ab('0x13')};if(this[_0x74ab('0x14')]==='sms'||this[_0x74ab('0x14')]===_0x74ab('0x15')){_0x207a57[_0x74ab('0x16')]=this[_0x74ab('0x17')][_0x74ab('0x16')];}var _0x5b0ee2=this[_0x74ab('0x14')];if(_0x5b0ee2==='chat'){_0x207a57[_0x74ab('0x18')]=this['account']['id'];}else{_0x207a57[_[_0x74ab('0x19')](_0x5b0ee2)+'AccountId']=this[_0x74ab('0x1a')]['id'];}_0x207a57[_['upperFirst'](_0x5b0ee2)+'InteractionId']=this['interaction']['id'];if(this[_0x74ab('0x17')][_0x74ab('0x1b')]){var _0x5f12f6=_0x100ca9[0x4];if(!_[_0x74ab('0x1c')](_0x5f12f6)){_0x207a57['body']=utils[_0x74ab('0x1d')](_0x5f12f6,this);return rpc[_0x5b0ee2+_0x74ab('0x1e')][_0x74ab('0x1f')](_0x207a57)[_0x74ab('0x20')](function(_0xa0a4c1){logger[_0x74ab('0xd')]('[%s][AMAZONLEX]\x20%s',_0x521282,_0x207a57[_0x74ab('0x21')]);})[_0x74ab('0x22')](function(_0x277a55){logger[_0x74ab('0x23')](_0x74ab('0xe'),_0x521282,JSON[_0x74ab('0x24')](_0x277a55));})[_0x74ab('0x25')](function(){logger['info'](_0x74ab('0x26'),_0x521282);_0x4589dd[_0x74ab('0x27')]();});}else{logger[_0x74ab('0xd')](_0x74ab('0x28'),_0x521282);_0x4589dd[_0x74ab('0x27')]();}}else{var _0x3394ac=this;var _0x4bc580=new AWS[(_0x74ab('0x29'))]({'accessKeyId':_0x100ca9[0x0],'secretAccessKey':_0x100ca9[0x1],'region':_0x100ca9[0x2]});var _0x152277={'botAlias':_0x74ab('0x2a'),'botName':_0x100ca9[0x3],'inputText':this[_0x74ab('0x2b')][_0x74ab('0x21')],'userId':this['channel']+':'+this[_0x74ab('0x17')]['id'][_0x74ab('0x2c')]()};_0x4bc580[_0x74ab('0x2d')](_0x152277,function(_0x27c53c,_0x4abc0b){if(_0x27c53c){logger[_0x74ab('0x23')](_0x74ab('0xe'),_0x521282,_0x27c53c[_0x74ab('0x2b')]);_0x4589dd[_0x74ab('0xf')]();}else if(_0x4abc0b&&_0x4abc0b[_0x74ab('0x2b')]){_0x3394ac[_0x74ab('0x21')][_0x74ab('0x2e')]=_0x4abc0b;_0x207a57[_0x74ab('0x21')]=_0x4abc0b[_0x74ab('0x2b')];_0x207a57['providerName']=_0x74ab('0x2e');_0x207a57[_0x74ab('0x2f')]=JSON[_0x74ab('0x24')](_0x4abc0b);return rpc[_0x5b0ee2+_0x74ab('0x1e')][_0x74ab('0x1f')](_0x207a57)['then'](function(_0x262acb){logger['info']('[%s][AMAZONLEX]\x20%s',_0x521282,_0x207a57[_0x74ab('0x21')]);if(_0x4abc0b[_0x74ab('0x30')]==_0x74ab('0x31')){_0x4589dd[_0x74ab('0xf')]();}else{_0x4589dd[_0x74ab('0x27')]();}})['catch'](function(_0x2cc568){logger[_0x74ab('0x23')]('[%s][AMAZONLEX]\x20%s',_0x521282,JSON['stringify'](_0x2cc568));_0x4589dd[_0x74ab('0xf')]();});}else{_0x4589dd[_0x74ab('0xf')]();}});}}catch(_0x216309){logger[_0x74ab('0x23')](_0x74ab('0xe'),_0x521282,JSON[_0x74ab('0x24')](_0x216309));_0x4589dd[_0x74ab('0x27')]();}};}; \ No newline at end of file +var _0xe3a2=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','postText','next','amazonlex','providerName','dialogState','Failed','catch','lodash','aws-sdk','./utils','routing'];(function(_0x4b600b,_0x5a9b60){var _0x2ae8c1=function(_0x125a43){while(--_0x125a43){_0x4b600b['push'](_0x4b600b['shift']());}};_0x2ae8c1(++_0x5a9b60);}(_0xe3a2,0x1be));var _0x2e3a=function(_0x3b42e0,_0x379f3f){_0x3b42e0=_0x3b42e0-0x0;var _0x428c96=_0xe3a2[_0x3b42e0];return _0x428c96;};'use strict';var _=require(_0x2e3a('0x0'));var moment=require('moment');var AWS=require(_0x2e3a('0x1'));var utils=require(_0x2e3a('0x2'));var logger=require('../../../../config/logger')(_0x2e3a('0x3'));var rpc={'chatMessage':require(_0x2e3a('0x4')),'openchannelMessage':require(_0x2e3a('0x5')),'mailMessage':require(_0x2e3a('0x6')),'smsMessage':require(_0x2e3a('0x7')),'faxMessage':require(_0x2e3a('0x8')),'whatsappMessage':require(_0x2e3a('0x9'))};exports[_0x2e3a('0xa')]=function(_0x297199,_0x35f816){return function(_0xd8866e){try{if(!_[_0x2e3a('0xb')](this[_0x2e3a('0xc')][_0x2e3a('0xd')])){logger[_0x2e3a('0xe')](_0x2e3a('0xf'),_0x297199,_0x2e3a('0x10'));return _0xd8866e['next']();}var _0x5cd95f={'ContactId':this[_0x2e3a('0x11')]['id'],'sentAt':moment()[_0x2e3a('0x12')](_0x2e3a('0x13')),'direction':'out'};if(this[_0x2e3a('0x14')]===_0x2e3a('0x15')||this['channel']===_0x2e3a('0x16')){_0x5cd95f[_0x2e3a('0x17')]=this[_0x2e3a('0xc')][_0x2e3a('0x17')];}var _0x375e6f=this[_0x2e3a('0x14')];if(_0x375e6f==='chat'){_0x5cd95f[_0x2e3a('0x18')]=this[_0x2e3a('0x19')]['id'];}else{_0x5cd95f[_[_0x2e3a('0x1a')](_0x375e6f)+_0x2e3a('0x1b')]=this[_0x2e3a('0x19')]['id'];}_0x5cd95f[_['upperFirst'](_0x375e6f)+_0x2e3a('0x1c')]=this[_0x2e3a('0xc')]['id'];if(this[_0x2e3a('0xc')][_0x2e3a('0x1d')]){var _0x36a329=_0x35f816[0x4];if(!_[_0x2e3a('0x1e')](_0x36a329)){_0x5cd95f[_0x2e3a('0x1f')]=utils[_0x2e3a('0x20')](_0x36a329,this);return rpc[_0x375e6f+_0x2e3a('0x21')][_0x2e3a('0x22')](_0x5cd95f)[_0x2e3a('0x23')](function(_0x2a0ef9){logger[_0x2e3a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x297199,_0x5cd95f['body']);})['catch'](function(_0x4a323b){logger[_0x2e3a('0x24')](_0x2e3a('0xf'),_0x297199,JSON[_0x2e3a('0x25')](_0x4a323b));})['finally'](function(){logger[_0x2e3a('0xe')](_0x2e3a('0x26'),_0x297199);_0xd8866e[_0x2e3a('0x27')]();});}else{logger['info'](_0x2e3a('0x28'),_0x297199);_0xd8866e[_0x2e3a('0x27')]();}}else{var _0x246f67=this;var _0x133953=new AWS['LexRuntime']({'accessKeyId':_0x35f816[0x0],'secretAccessKey':_0x35f816[0x1],'region':_0x35f816[0x2]});var _0x912dc={'botAlias':_0x2e3a('0x29'),'botName':_0x35f816[0x3],'inputText':this[_0x2e3a('0x2a')]['body'],'userId':this[_0x2e3a('0x14')]+':'+this[_0x2e3a('0xc')]['id']['toString']()};_0x133953[_0x2e3a('0x2b')](_0x912dc,function(_0x51f00b,_0x32c4f6){if(_0x51f00b){logger['error'](_0x2e3a('0xf'),_0x297199,_0x51f00b[_0x2e3a('0x2a')]);_0xd8866e[_0x2e3a('0x2c')]();}else if(_0x32c4f6&&_0x32c4f6[_0x2e3a('0x2a')]){_0x246f67[_0x2e3a('0x1f')][_0x2e3a('0x2d')]=_0x32c4f6;_0x5cd95f[_0x2e3a('0x1f')]=_0x32c4f6[_0x2e3a('0x2a')];_0x5cd95f[_0x2e3a('0x2e')]=_0x2e3a('0x2d');_0x5cd95f['providerResponse']=JSON['stringify'](_0x32c4f6);return rpc[_0x375e6f+_0x2e3a('0x21')]['create'](_0x5cd95f)[_0x2e3a('0x23')](function(_0x4abb8){logger[_0x2e3a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x297199,_0x5cd95f[_0x2e3a('0x1f')]);if(_0x32c4f6[_0x2e3a('0x2f')]==_0x2e3a('0x30')){_0xd8866e[_0x2e3a('0x2c')]();}else{_0xd8866e['stop']();}})[_0x2e3a('0x31')](function(_0x5f1192){logger[_0x2e3a('0x24')](_0x2e3a('0xf'),_0x297199,JSON[_0x2e3a('0x25')](_0x5f1192));_0xd8866e[_0x2e3a('0x2c')]();});}else{_0xd8866e[_0x2e3a('0x2c')]();}});}}catch(_0x534019){logger['error'](_0x2e3a('0xf'),_0x297199,JSON['stringify'](_0x534019));_0xd8866e[_0x2e3a('0x27')]();}};}; \ 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 f9eabe9..07cc3a2 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 _0xe46c=['messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','next','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','mail','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','InteractionId','Message'];(function(_0x6fca36,_0x34948c){var _0x5bd408=function(_0x59e715){while(--_0x59e715){_0x6fca36['push'](_0x6fca36['shift']());}};_0x5bd408(++_0x34948c);}(_0xe46c,0x1b8));var _0xce46=function(_0x53b5d3,_0x317067){_0x53b5d3=_0x53b5d3-0x0;var _0x2eff24=_0xe46c[_0x53b5d3];return _0x2eff24;};'use strict';var _=require(_0xce46('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0xce46('0x1'))(_0xce46('0x2'));var rpc={'chatMessage':require(_0xce46('0x3')),'openchannelMessage':require(_0xce46('0x4')),'mailMessage':require(_0xce46('0x5')),'smsMessage':require(_0xce46('0x6')),'faxMessage':require(_0xce46('0x7')),'whatsappMessage':require(_0xce46('0x8')),'chatInteraction':require(_0xce46('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xce46('0xa')),'faxInteraction':require(_0xce46('0xb')),'whatsappInteraction':require(_0xce46('0xc'))};var mailRpc=require(_0xce46('0xd'));exports[_0xce46('0xe')]=function(_0x1aca01,_0x3a7b55,_0x38810b,_0x3f1d38){return function(_0x246868){try{var _0x13a5b4=this[_0xce46('0xf')];if(_0x13a5b4==='mail'&&_0x3f1d38[_0xce46('0x10')]['isAutoreply']){logger[_0xce46('0x11')](_0xce46('0x12'),_0x1aca01,_0xce46('0x13'));return _0x246868['next']();}if(_0x3a7b55[0x0]==='1'&&(_['isNil'](this[_0xce46('0x14')][_0xce46('0x15')])||!this[_0xce46('0x14')][_0xce46('0x15')])){logger[_0xce46('0x11')](_0xce46('0x12'),_0x1aca01,_0xce46('0x16'));return _0x246868['next']();}if(_0x3a7b55[0x0]==='2'&&this[_0xce46('0x14')][_0xce46('0x17')]){logger[_0xce46('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1aca01,_0xce46('0x18'));return _0x246868['next']();}var _0x356e9d={'ContactId':this[_0xce46('0x19')]['id'],'sentAt':moment()[_0xce46('0x1a')](_0xce46('0x1b')),'direction':'out'};if(this[_0xce46('0xf')]==='mail'){_0x356e9d['body']=utils['getMustacheRender'](_0x3a7b55[0x2],this);}else{_0x356e9d[_0xce46('0x10')]=utils[_0xce46('0x1c')](_0x3a7b55[0x1],this);}if(this['message']){_0x356e9d['to']=this[_0xce46('0x1d')][_0xce46('0x1e')]||'';if(this[_0xce46('0xf')]===_0xce46('0x1f')&&_0x3a7b55[0x1]==='1'){_0x356e9d['cc']=this[_0xce46('0x1d')]['cc']||'';}_0x356e9d[_0xce46('0x1e')]=this['message']['to']||'';_0x356e9d[_0xce46('0x20')]=this[_0xce46('0x1d')]['phone']||'';_0x356e9d[_0xce46('0x21')]=!![];if(this['message'][_0xce46('0x22')]){_0x356e9d[_0xce46('0x22')]='';_0x356e9d[_0xce46('0x22')]+=_[_0xce46('0x23')](this[_0xce46('0x1d')][_0xce46('0x22')],_0xce46('0x24'))?'':_0xce46('0x25');_0x356e9d[_0xce46('0x22')]+=this[_0xce46('0x1d')][_0xce46('0x22')];}}if(this[_0xce46('0xf')]===_0xce46('0x26')){_0x356e9d['ChatWebsiteId']=this[_0xce46('0x27')]['id'];}else{_0x356e9d[_[_0xce46('0x28')](this['channel'])+'AccountId']=this[_0xce46('0x27')]['id'];}_0x356e9d[_[_0xce46('0x28')](this[_0xce46('0xf')])+_0xce46('0x29')]=this[_0xce46('0x14')]['id'];var _0x1b3eea=this[_0xce46('0x14')];if(rpc[this[_0xce46('0xf')]+_0xce46('0x2a')]){if(this[_0xce46('0xf')]==='mail'){_0x356e9d['inReplyTo']=this[_0xce46('0x1d')][_0xce46('0x2b')];_0x356e9d['html']=_0xce46('0x2c')+_[_0xce46('0x2d')](_0x356e9d[_0xce46('0x10')],'','','headers','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','moment','./utils','../../../../config/logger'];(function(_0x1b0d03,_0x2fda32){var _0x37cc8c=function(_0x17d854){while(--_0x17d854){_0x1b0d03['push'](_0x1b0d03['shift']());}};_0x37cc8c(++_0x2fda32);}(_0xe40e,0x1d8));var _0xee40=function(_0x23cfd6,_0x2bd876){_0x23cfd6=_0x23cfd6-0x0;var _0x4a39ef=_0xe40e[_0x23cfd6];return _0x4a39ef;};'use strict';var _=require(_0xee40('0x0'));var moment=require(_0xee40('0x1'));var utils=require(_0xee40('0x2'));var logger=require(_0xee40('0x3'))('routing');var rpc={'chatMessage':require(_0xee40('0x4')),'openchannelMessage':require(_0xee40('0x5')),'mailMessage':require(_0xee40('0x6')),'smsMessage':require(_0xee40('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xee40('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xee40('0x9')),'mailInteraction':require(_0xee40('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xee40('0xb')),'whatsappInteraction':require(_0xee40('0xc'))};var mailRpc=require(_0xee40('0xd'));exports['consequence']=function(_0x2f8b08,_0x5735fd,_0x201b40,_0x4b71a){return function(_0x49b0d4){try{var _0xb162b2=this[_0xee40('0xe')];if(_0xb162b2===_0xee40('0xf')&&_0x4b71a[_0xee40('0x10')][_0xee40('0x11')]){logger[_0xee40('0x12')](_0xee40('0x13'),_0x2f8b08,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x49b0d4[_0xee40('0x14')]();}if(_0x5735fd[0x0]==='1'&&(_[_0xee40('0x15')](this['interaction'][_0xee40('0x16')])||!this[_0xee40('0x17')][_0xee40('0x16')])){logger[_0xee40('0x12')](_0xee40('0x13'),_0x2f8b08,_0xee40('0x18'));return _0x49b0d4['next']();}if(_0x5735fd[0x0]==='2'&&this[_0xee40('0x17')]['autoreplyExecuted']){logger[_0xee40('0x12')](_0xee40('0x19'),_0x2f8b08,_0xee40('0x1a'));return _0x49b0d4[_0xee40('0x14')]();}var _0xf37bce={'ContactId':this[_0xee40('0x1b')]['id'],'sentAt':moment()[_0xee40('0x1c')](_0xee40('0x1d')),'direction':_0xee40('0x1e')};if(this[_0xee40('0xe')]===_0xee40('0xf')){_0xf37bce[_0xee40('0x10')]=utils[_0xee40('0x1f')](_0x5735fd[0x2],this);}else{_0xf37bce['body']=utils[_0xee40('0x1f')](_0x5735fd[0x1],this);}if(this[_0xee40('0x20')]){_0xf37bce['to']=this[_0xee40('0x20')]['from']||'';if(this[_0xee40('0xe')]===_0xee40('0xf')&&_0x5735fd[0x1]==='1'){_0xf37bce['cc']=this[_0xee40('0x20')]['cc']||'';}_0xf37bce[_0xee40('0x21')]=this[_0xee40('0x20')]['to']||'';_0xf37bce[_0xee40('0x22')]=this['message'][_0xee40('0x22')]||'';_0xf37bce['read']=!![];if(this[_0xee40('0x20')]['subject']){_0xf37bce['subject']='';_0xf37bce[_0xee40('0x23')]+=_[_0xee40('0x24')](this[_0xee40('0x20')][_0xee40('0x23')],'Re:')?'':_0xee40('0x25');_0xf37bce['subject']+=this[_0xee40('0x20')][_0xee40('0x23')];}}if(this[_0xee40('0xe')]==='chat'){_0xf37bce[_0xee40('0x26')]=this['account']['id'];}else{_0xf37bce[_[_0xee40('0x27')](this[_0xee40('0xe')])+'AccountId']=this[_0xee40('0x28')]['id'];}_0xf37bce[_[_0xee40('0x27')](this[_0xee40('0xe')])+_0xee40('0x29')]=this[_0xee40('0x17')]['id'];var _0xe94b73=this[_0xee40('0x17')];if(rpc[this[_0xee40('0xe')]+'Message']){if(this[_0xee40('0xe')]===_0xee40('0xf')){_0xf37bce[_0xee40('0x2a')]=this[_0xee40('0x20')][_0xee40('0x2b')];_0xf37bce[_0xee40('0x2c')]=_0xee40('0x2d')+_['replace'](_0xf37bce['body'],_0xee40('0x2e'),_0xee40('0x2f'))+_0xee40('0x30');_0xf37bce[_0xee40('0x31')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xee40('0x32')};return mailRpc[_0xee40('0x33')](this[_0xee40('0x28')][_0xee40('0x34')],_0xf37bce)[_0xee40('0x35')](function(_0x34afe8){logger[_0xee40('0x12')](_0xee40('0x36'),_0x2f8b08);_0xf37bce['messageId']=_0x34afe8['message']['messageId'];return rpc[_0xb162b2+_0xee40('0x37')]['create'](_0xf37bce);})[_0xee40('0x35')](function(_0x306b40){logger[_0xee40('0x12')]('[%s][AUTOREPLY]\x20%s',_0x2f8b08,JSON['stringify'](_0x306b40));})[_0xee40('0x38')](function(_0x1e81fd){logger[_0xee40('0x39')](_0xee40('0x3a'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x1e81fd));})[_0xee40('0x3c')](function(){Promise[_0xee40('0x3d')]()['then'](function(){if(_0x5735fd[0x0]!=='2'||_0xe94b73[_0xee40('0x3e')])return;return rpc[_0xb162b2+_0xee40('0x3f')][_0xee40('0x40')](_0xe94b73['id'],{'autoreplyExecuted':!![]})[_0xee40('0x35')](function(_0x4d394a){logger[_0xee40('0x12')](_0xee40('0x19'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x4d394a));})['catch'](function(_0x39cf7c){logger['error'](_0xee40('0x41'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x39cf7c));});})['then'](function(){_0x49b0d4['next']();});});}else{return rpc[this[_0xee40('0xe')]+_0xee40('0x37')][_0xee40('0x42')](_0xf37bce)[_0xee40('0x35')](function(){logger[_0xee40('0x12')](_0xee40('0x13'),_0x2f8b08,_0xf37bce['body']);})['catch'](function(_0x15c8bf){logger[_0xee40('0x39')](_0xee40('0x13'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x15c8bf));})[_0xee40('0x3c')](function(){Promise[_0xee40('0x3d')]()[_0xee40('0x35')](function(){if(_0x5735fd[0x0]!=='2'||_0xe94b73[_0xee40('0x3e')])return;return rpc[_0xb162b2+'Interaction'][_0xee40('0x40')](_0xe94b73['id'],{'autoreplyExecuted':!![]})[_0xee40('0x35')](function(_0x26cc51){logger[_0xee40('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2f8b08,JSON[_0xee40('0x3b')](_0x26cc51));})[_0xee40('0x38')](function(_0x43dbb1){logger['error'](_0xee40('0x41'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x43dbb1));});})['then'](function(){_0x49b0d4[_0xee40('0x14')]();});});}}}catch(_0x2b0e89){logger['error'](_0xee40('0x13'),_0x2f8b08,JSON[_0xee40('0x3b')](_0x2b0e89));_0x49b0d4[_0xee40('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 2aac0e4..9f0fa7e 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb519=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction'];(function(_0x1c7de8,_0x20fd2d){var _0x462188=function(_0x279e21){while(--_0x279e21){_0x1c7de8['push'](_0x1c7de8['shift']());}};_0x462188(++_0x20fd2d);}(_0xb519,0x15a));var _0x9b51=function(_0xb880b7,_0x279a54){_0xb880b7=_0xb880b7-0x0;var _0x49aa41=_0xb519[_0xb880b7];return _0x49aa41;};'use strict';var moment=require(_0x9b51('0x0'));var logger=require(_0x9b51('0x1'))('routing');var rpc={'chatInteraction':require(_0x9b51('0x2')),'openchannelInteraction':require(_0x9b51('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9b51('0x4'))};exports[_0x9b51('0x5')]=function(_0x2cf689,_0x319031,_0x167046,_0x35699b){return function(_0x1d4990){try{logger[_0x9b51('0x6')](_0x9b51('0x7'),_0x2cf689,_0x319031[0x0]);var _0x38b393={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x9b51('0x8'),'disposition':_0x319031[0x0]};if(rpc[_0x35699b[_0x9b51('0x9')]+_0x9b51('0xa')]){rpc[_0x35699b[_0x9b51('0x9')]+'Interaction'][_0x9b51('0xb')](_0x35699b[_0x9b51('0xc')]['id'],_0x38b393)[_0x9b51('0xd')](function(_0x48d204){logger[_0x9b51('0x6')](_0x9b51('0xe'),_0x2cf689,_0x35699b[_0x9b51('0xc')]['id']);})[_0x9b51('0xf')](function(_0x4bfd3f){logger[_0x9b51('0x10')](_0x9b51('0x11'),_0x2cf689,JSON['stringify'](_0x4bfd3f));})[_0x9b51('0x12')](function(){_0x1d4990['stop']();});}}catch(_0x5e834b){logger[_0x9b51('0x10')](_0x9b51('0x11'),_0x2cf689,JSON[_0x9b51('0x13')](_0x5e834b));_0x1d4990[_0x9b51('0x14')]();}};}; \ No newline at end of file +var _0x43cc=['stringify','finally','stop','[%s][CLOSE]\x20%s','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error'];(function(_0x541190,_0x3e2a58){var _0x5eed5b=function(_0x3bdf57){while(--_0x3bdf57){_0x541190['push'](_0x541190['shift']());}};_0x5eed5b(++_0x3e2a58);}(_0x43cc,0xac));var _0xc43c=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x43cc[_0x48cb1f];return _0x172c4d;};'use strict';var moment=require('moment');var logger=require(_0xc43c('0x0'))(_0xc43c('0x1'));var rpc={'chatInteraction':require(_0xc43c('0x2')),'openchannelInteraction':require(_0xc43c('0x3')),'smsInteraction':require(_0xc43c('0x4')),'mailInteraction':require(_0xc43c('0x5')),'faxInteraction':require(_0xc43c('0x6')),'whatsappInteraction':require(_0xc43c('0x7'))};exports[_0xc43c('0x8')]=function(_0x321c7f,_0x17b8f5,_0x5a50a7,_0x5d6e06){return function(_0x2e91fc){try{logger[_0xc43c('0x9')](_0xc43c('0xa'),_0x321c7f,_0x17b8f5[0x0]);var _0x379822={'closed':0x1,'closedAt':moment()[_0xc43c('0xb')](_0xc43c('0xc')),'closeReason':_0xc43c('0xd'),'disposition':_0x17b8f5[0x0]};if(rpc[_0x5d6e06['channel']+'Interaction']){rpc[_0x5d6e06[_0xc43c('0xe')]+_0xc43c('0xf')]['update'](_0x5d6e06['interaction']['id'],_0x379822)['then'](function(_0x58fbf0){logger[_0xc43c('0x9')](_0xc43c('0x10'),_0x321c7f,_0x5d6e06[_0xc43c('0x11')]['id']);})[_0xc43c('0x12')](function(_0xf4e93a){logger[_0xc43c('0x13')]('[%s][CLOSE]\x20%s',_0x321c7f,JSON[_0xc43c('0x14')](_0xf4e93a));})[_0xc43c('0x15')](function(){_0x2e91fc[_0xc43c('0x16')]();});}}catch(_0x1149ff){logger['error'](_0xc43c('0x17'),_0x321c7f,JSON[_0xc43c('0x14')](_0x1149ff));_0x2e91fc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index cff0011..edc704d 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01db=['out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','metadata','endConversation','lodash','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x37b2fd,_0x1dfd78){var _0x39d3c8=function(_0x473b7c){while(--_0x473b7c){_0x37b2fd['push'](_0x37b2fd['shift']());}};_0x39d3c8(++_0x1dfd78);}(_0x01db,0x171));var _0xb01d=function(_0x5876eb,_0x5d91d3){_0x5876eb=_0x5876eb-0x0;var _0xe6bb8d=_0x01db[_0x5876eb];return _0xe6bb8d;};'use strict';var _=require(_0xb01d('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xb01d('0x1'));var utils=require(_0xb01d('0x2'));var logger=require(_0xb01d('0x3'))('routing');var rpc={'chatMessage':require(_0xb01d('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb01d('0x5')),'faxMessage':require(_0xb01d('0x6')),'whatsappMessage':require(_0xb01d('0x7'))};exports[_0xb01d('0x8')]=function(_0x2622e9,_0x37720d){return function(_0x3c45a3){try{if(!_[_0xb01d('0x9')](this['interaction']['UserId'])){logger[_0xb01d('0xa')](_0xb01d('0xb'),_0x2622e9,_0xb01d('0xc'));return _0x3c45a3[_0xb01d('0xd')]();}var _0x147b7b={'ContactId':this[_0xb01d('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb01d('0xf')};if(this[_0xb01d('0x10')]===_0xb01d('0x11')||this[_0xb01d('0x10')]===_0xb01d('0x12')){_0x147b7b[_0xb01d('0x13')]=this[_0xb01d('0x14')]['phone'];}var _0x4ae3c4=this[_0xb01d('0x10')];if(_0x4ae3c4==='chat'){_0x147b7b[_0xb01d('0x15')]=this[_0xb01d('0x16')]['id'];}else{_0x147b7b[_['upperFirst'](_0x4ae3c4)+_0xb01d('0x17')]=this[_0xb01d('0x16')]['id'];}_0x147b7b[_[_0xb01d('0x18')](_0x4ae3c4)+_0xb01d('0x19')]=this['interaction']['id'];if(this[_0xb01d('0x14')]['created']){var _0xd9c0b0=_0x37720d[0x2];if(!_[_0xb01d('0x1a')](_0xd9c0b0)){_0x147b7b[_0xb01d('0x1b')]=utils[_0xb01d('0x1c')](_0xd9c0b0,this);return rpc[_0x4ae3c4+'Message'][_0xb01d('0x1d')](_0x147b7b)[_0xb01d('0x1e')](function(_0x39eaaf){logger['info'](_0xb01d('0xb'),_0x2622e9,_0x147b7b['body']);})[_0xb01d('0x1f')](function(_0x3fd01d){logger[_0xb01d('0x20')](_0xb01d('0xb'),_0x2622e9,JSON[_0xb01d('0x21')](_0x3fd01d));})['finally'](function(){logger[_0xb01d('0xa')](_0xb01d('0x22'),_0x2622e9);_0x3c45a3[_0xb01d('0x23')]();});}else{logger[_0xb01d('0xa')](_0xb01d('0x24'),_0x2622e9);_0x3c45a3[_0xb01d('0x23')]();}}else{var _0x28f643=this;var _0x42064d=apiai(_0x37720d[0x0],{'language':_0x37720d[0x1]||'en'});return _0x42064d[_0xb01d('0x25')](this[_0xb01d('0x26')][_0xb01d('0x1b')],{'sessionId':md5(this[_0xb01d('0x14')]['id'])})['then'](function(_0x446824){_0x28f643['body'][_0xb01d('0x27')]=_0x446824;_0x147b7b[_0xb01d('0x1b')]=_0x446824[_0xb01d('0x28')][_0xb01d('0x29')][_0xb01d('0x2a')];_0x147b7b[_0xb01d('0x2b')]=_0xb01d('0x27');_0x147b7b[_0xb01d('0x2c')]=JSON[_0xb01d('0x21')](_0x446824);return rpc[_0x4ae3c4+_0xb01d('0x2d')][_0xb01d('0x1d')](_0x147b7b)['then'](function(_0x2b9fac){logger[_0xb01d('0xa')](_0xb01d('0xb'),_0x2622e9,_0x147b7b['body']);if(_0x446824[_0xb01d('0x28')][_0xb01d('0x2e')][_0xb01d('0x2f')]){_0x3c45a3['next']();}else{_0x3c45a3[_0xb01d('0x23')]();}})['catch'](function(_0x13345a){logger[_0xb01d('0x20')](_0xb01d('0xb'),_0x2622e9,JSON['stringify'](_0x13345a));_0x3c45a3[_0xb01d('0xd')]();});})[_0xb01d('0x1f')](function(_0x1666a1){logger[_0xb01d('0x20')](_0xb01d('0xb'),_0x2622e9,_0x1666a1[_0xb01d('0x26')]);_0x3c45a3['next']();});}}catch(_0x1750db){logger[_0xb01d('0x20')](_0xb01d('0xb'),_0x2622e9,JSON['stringify'](_0x1750db));_0x3c45a3[_0xb01d('0x23')]();}};}; \ No newline at end of file +var _0xd2f5=['interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','getMustacheRender','Message','create','[%s][DIALOGFLOW]\x20%s','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','fulfillment','speech','providerName','providerResponse','stringify','result','endConversation','lodash','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd2f5,0x144));var _0x5d2f=function(_0x29b3be,_0x4d4267){_0x29b3be=_0x29b3be-0x0;var _0x5c25ef=_0xd2f5[_0x29b3be];return _0x5c25ef;};'use strict';var _=require(_0x5d2f('0x0'));var moment=require('moment');var apiai=require(_0x5d2f('0x1'));var md5=require('md5');var utils=require(_0x5d2f('0x2'));var logger=require('../../../../config/logger')(_0x5d2f('0x3'));var rpc={'chatMessage':require(_0x5d2f('0x4')),'openchannelMessage':require(_0x5d2f('0x5')),'mailMessage':require(_0x5d2f('0x6')),'smsMessage':require(_0x5d2f('0x7')),'faxMessage':require(_0x5d2f('0x8')),'whatsappMessage':require(_0x5d2f('0x9'))};exports[_0x5d2f('0xa')]=function(_0x4b2540,_0x443779){return function(_0x908c6){try{if(!_[_0x5d2f('0xb')](this[_0x5d2f('0xc')][_0x5d2f('0xd')])){logger[_0x5d2f('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4b2540,_0x5d2f('0xf'));return _0x908c6[_0x5d2f('0x10')]();}var _0x4e24af={'ContactId':this[_0x5d2f('0x11')]['id'],'sentAt':moment()[_0x5d2f('0x12')](_0x5d2f('0x13')),'direction':'out'};if(this[_0x5d2f('0x14')]===_0x5d2f('0x15')||this[_0x5d2f('0x14')]==='whatsapp'){_0x4e24af['phone']=this[_0x5d2f('0xc')]['phone'];}var _0x293e95=this[_0x5d2f('0x14')];if(_0x293e95==='chat'){_0x4e24af[_0x5d2f('0x16')]=this['account']['id'];}else{_0x4e24af[_[_0x5d2f('0x17')](_0x293e95)+_0x5d2f('0x18')]=this[_0x5d2f('0x19')]['id'];}_0x4e24af[_['upperFirst'](_0x293e95)+_0x5d2f('0x1a')]=this[_0x5d2f('0xc')]['id'];if(this[_0x5d2f('0xc')][_0x5d2f('0x1b')]){var _0x1536ee=_0x443779[0x2];if(!_['isEmpty'](_0x1536ee)){_0x4e24af[_0x5d2f('0x1c')]=utils[_0x5d2f('0x1d')](_0x1536ee,this);return rpc[_0x293e95+_0x5d2f('0x1e')][_0x5d2f('0x1f')](_0x4e24af)['then'](function(_0x27e16d){logger[_0x5d2f('0xe')](_0x5d2f('0x20'),_0x4b2540,_0x4e24af[_0x5d2f('0x1c')]);})[_0x5d2f('0x21')](function(_0x32ec09){logger[_0x5d2f('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x4b2540,JSON['stringify'](_0x32ec09));})['finally'](function(){logger[_0x5d2f('0xe')](_0x5d2f('0x23'),_0x4b2540);_0x908c6[_0x5d2f('0x24')]();});}else{logger[_0x5d2f('0xe')](_0x5d2f('0x25'),_0x4b2540);_0x908c6['stop']();}}else{var _0x5cc8d6=this;var _0x368693=apiai(_0x443779[0x0],{'language':_0x443779[0x1]||'en'});return _0x368693['textRequest'](this[_0x5d2f('0x26')][_0x5d2f('0x1c')],{'sessionId':md5(this[_0x5d2f('0xc')]['id'])})[_0x5d2f('0x27')](function(_0x6d4ad2){_0x5cc8d6[_0x5d2f('0x1c')][_0x5d2f('0x28')]=_0x6d4ad2;_0x4e24af[_0x5d2f('0x1c')]=_0x6d4ad2['result'][_0x5d2f('0x29')][_0x5d2f('0x2a')];_0x4e24af[_0x5d2f('0x2b')]=_0x5d2f('0x28');_0x4e24af[_0x5d2f('0x2c')]=JSON[_0x5d2f('0x2d')](_0x6d4ad2);return rpc[_0x293e95+_0x5d2f('0x1e')][_0x5d2f('0x1f')](_0x4e24af)['then'](function(_0x10351a){logger[_0x5d2f('0xe')](_0x5d2f('0x20'),_0x4b2540,_0x4e24af[_0x5d2f('0x1c')]);if(_0x6d4ad2[_0x5d2f('0x2e')]['metadata'][_0x5d2f('0x2f')]){_0x908c6[_0x5d2f('0x10')]();}else{_0x908c6[_0x5d2f('0x24')]();}})[_0x5d2f('0x21')](function(_0x536f1d){logger[_0x5d2f('0x22')](_0x5d2f('0x20'),_0x4b2540,JSON['stringify'](_0x536f1d));_0x908c6[_0x5d2f('0x10')]();});})[_0x5d2f('0x21')](function(_0x26e988){logger['error'](_0x5d2f('0x20'),_0x4b2540,_0x26e988[_0x5d2f('0x26')]);_0x908c6[_0x5d2f('0x10')]();});}}catch(_0x4b30e4){logger[_0x5d2f('0x22')](_0x5d2f('0x20'),_0x4b2540,JSON['stringify'](_0x4b30e4));_0x908c6[_0x5d2f('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index cd97cfb..b3bcf17 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf78=['dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','stack','lodash','dialogflow','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','body','Message','create','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length'];(function(_0x47b78c,_0x1b6295){var _0x230522=function(_0x3a26a4){while(--_0x3a26a4){_0x47b78c['push'](_0x47b78c['shift']());}};_0x230522(++_0x1b6295);}(_0xdf78,0x145));var _0x8df7=function(_0x42c366,_0x4122b3){_0x42c366=_0x42c366-0x0;var _0x146fb9=_0xdf78[_0x42c366];return _0x146fb9;};'use strict';var _=require(_0x8df7('0x0'));var dialogflow=require(_0x8df7('0x1'));var md5=require('md5');var moment=require(_0x8df7('0x2'));var Promise=require('bluebird');var logger=require(_0x8df7('0x3'))(_0x8df7('0x4'));var utils=require(_0x8df7('0x5'));var rpc={'chatMessage':require(_0x8df7('0x6')),'openchannelMessage':require(_0x8df7('0x7')),'mailMessage':require(_0x8df7('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8df7('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x5261ae,_0x317319,_0x2c6bb9,_0x2fa773){return new Promise(function(_0x16db0b,_0xf9d17d){var _0x57aaac=_['clone'](_0x2c6bb9);_0x57aaac[_0x8df7('0xa')]=_0x2fa773;return rpc[_0x317319+_0x8df7('0xb')][_0x8df7('0xc')](_0x57aaac)['then'](function(){logger['info'](_0x8df7('0xd'),_0x5261ae,_0x57aaac[_0x8df7('0xa')]);_0x16db0b();})[_0x8df7('0xe')](function(_0x40e99a){logger['error'](_0x8df7('0xd'),_0x5261ae,JSON['stringify'](_0x40e99a));_0xf9d17d(_0x40e99a);});});}exports[_0x8df7('0xf')]=function(_0x376612,_0x216ac6){return function(_0x551dab){try{if(!_[_0x8df7('0x10')](this[_0x8df7('0x11')][_0x8df7('0x12')])){logger[_0x8df7('0x13')](_0x8df7('0xd'),_0x376612,_0x8df7('0x14'));return _0x551dab[_0x8df7('0x15')]();}var _0xa724c1={'ContactId':this[_0x8df7('0x16')]['id'],'sentAt':moment()[_0x8df7('0x17')](_0x8df7('0x18')),'direction':_0x8df7('0x19')};if(this[_0x8df7('0x1a')]===_0x8df7('0x1b')||this[_0x8df7('0x1a')]==='whatsapp'){_0xa724c1['phone']=this[_0x8df7('0x11')][_0x8df7('0x1c')];}var _0x15f4f2=this[_0x8df7('0x1a')];if(_0x15f4f2===_0x8df7('0x1d')){_0xa724c1[_0x8df7('0x1e')]=this[_0x8df7('0x1f')]['id'];}else{_0xa724c1[_[_0x8df7('0x20')](_0x15f4f2)+'AccountId']=this[_0x8df7('0x1f')]['id'];}_0xa724c1[_[_0x8df7('0x20')](_0x15f4f2)+_0x8df7('0x21')]=this['interaction']['id'];if(this[_0x8df7('0x11')][_0x8df7('0x22')]){var _0x5e3641=_0x216ac6[0x4];if(!_[_0x8df7('0x23')](_0x5e3641)){_0xa724c1[_0x8df7('0xa')]=utils[_0x8df7('0x24')](_0x5e3641,this);return rpc[_0x15f4f2+_0x8df7('0xb')][_0x8df7('0xc')](_0xa724c1)[_0x8df7('0x25')](function(_0x5cd9f8){logger['info'](_0x8df7('0xd'),_0x376612,_0xa724c1[_0x8df7('0xa')]);})[_0x8df7('0xe')](function(_0x11c67e){logger[_0x8df7('0x26')](_0x8df7('0xd'),_0x376612,JSON[_0x8df7('0x27')](_0x11c67e));})[_0x8df7('0x28')](function(){logger[_0x8df7('0x13')](_0x8df7('0x29'),_0x376612);_0x551dab[_0x8df7('0x2a')]();});}else{logger[_0x8df7('0x13')](_0x8df7('0x2b'),_0x376612);_0x551dab[_0x8df7('0x2a')]();}}else{var _0x1c5fe7=this;var _0x57e721=_0x216ac6[0x2][_0x8df7('0x2c')](/\\n/g,'\x0a');var _0x3ff109={'credentials':{'private_key':_0x57e721,'client_email':_0x216ac6[0x1]}};var _0x27632a=new dialogflow[(_0x8df7('0x2d'))](_0x3ff109);var _0x348639=_0x27632a[_0x8df7('0x2e')](_0x216ac6[0x0],md5(_0x1c5fe7[_0x8df7('0x11')]['id']));var _0x46edbd={'session':_0x348639,'queryInput':{'text':{'text':_0x1c5fe7[_0x8df7('0x2f')][_0x8df7('0xa')],'languageCode':_0x216ac6[0x3]||'en'}}};return _0x27632a[_0x8df7('0x30')](_0x46edbd)[_0x8df7('0x25')](function(_0x3fcf6c){if(_0x3fcf6c&&_0x3fcf6c[_0x8df7('0x31')]){_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x32')]=_0x3fcf6c;var _0x7773f8=_0x3fcf6c[0x0];var _0x8c8b57=_0x7773f8['queryResult'][_0x8df7('0x33')]&&_0x7773f8[_0x8df7('0x34')][_0x8df7('0x33')]['fields']?_0x7773f8['queryResult']['diagnosticInfo'][_0x8df7('0x35')][_0x8df7('0x36')][_0x8df7('0x37')]:![];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x38')]=_0x7773f8[_0x8df7('0x34')]['action'];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x39')]=_0x7773f8['queryResult']['allRequiredParamsPresent'];_0x1c5fe7[_0x8df7('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x7773f8[_0x8df7('0x34')][_0x8df7('0x33')]&&_0x7773f8[_0x8df7('0x34')][_0x8df7('0x33')]['fields']?_0x7773f8['queryResult'][_0x8df7('0x33')][_0x8df7('0x35')][_0x8df7('0x36')][_0x8df7('0x37')]:![];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x3a')]=_0x7773f8[_0x8df7('0x34')][_0x8df7('0x3b')]['name'];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x3c')]=_0x7773f8['queryResult']['intent'][_0x8df7('0x3d')];_0x1c5fe7['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x7773f8['queryResult'][_0x8df7('0x3b')][_0x8df7('0x3e')];_0x1c5fe7['body'][_0x8df7('0x3f')]=_0x7773f8[_0x8df7('0x34')][_0x8df7('0x40')];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x41')]=_0x7773f8[_0x8df7('0x34')][_0x8df7('0x42')];_0x1c5fe7[_0x8df7('0xa')][_0x8df7('0x43')]=_0x7773f8[_0x8df7('0x34')][_0x8df7('0x44')];_0xa724c1[_0x8df7('0x45')]=_0x8df7('0x32');_0xa724c1[_0x8df7('0x46')]=JSON['stringify'](_0x3fcf6c);var _0x4308a1=[];for(var _0x16d9a4=0x0;_0x16d9a4<_0x3fcf6c['length'];_0x16d9a4++){var _0x4b0477=_0x3fcf6c[_0x16d9a4];if(_0x4b0477&&_0x4b0477[_0x8df7('0x34')]&&_0x4b0477['queryResult'][_0x8df7('0x47')]){_0x4308a1[_0x8df7('0x48')](createMessage(_0x376612,_0x15f4f2,_0xa724c1,_0x4b0477['queryResult'][_0x8df7('0x47')]));}}return Promise[_0x8df7('0x49')](_0x4308a1)[_0x8df7('0x25')](function(){if(_0x8c8b57){_0x551dab['next']();}else{_0x551dab['stop']();}})[_0x8df7('0xe')](function(_0x29457a){logger['error'](_0x8df7('0xd'),_0x376612,JSON[_0x8df7('0x27')](_0x29457a));_0x551dab['next']();});}})[_0x8df7('0xe')](function(_0x1af766){logger[_0x8df7('0x26')](_0x8df7('0xd'),_0x376612,_0x1af766[_0x8df7('0x2f')],_0x1af766[_0x8df7('0x4a')]);_0x551dab[_0x8df7('0x15')]();});}}catch(_0x2c11c6){logger[_0x8df7('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x376612,JSON[_0x8df7('0x27')](_0x2c11c6));_0x551dab[_0x8df7('0x2a')]();}};}; \ No newline at end of file +var _0x6d11=['DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','fulfillmentText','stack','next','md5','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','clone','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','consequence','isNil','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','created','getMustacheRender','then','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION'];(function(_0x4b79b3,_0x172604){var _0x76bb48=function(_0x137c29){while(--_0x137c29){_0x4b79b3['push'](_0x4b79b3['shift']());}};_0x76bb48(++_0x172604);}(_0x6d11,0x195));var _0x16d1=function(_0x1aa77d,_0x34d92c){_0x1aa77d=_0x1aa77d-0x0;var _0x132b30=_0x6d11[_0x1aa77d];return _0x132b30;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x16d1('0x0'));var moment=require('moment');var Promise=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0x16d1('0x3')),'openchannelMessage':require(_0x16d1('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x16d1('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x385b7d,_0x3ae03b,_0x3710ad,_0x3763a3){return new Promise(function(_0x492bda,_0x479d1b){var _0x45ede1=_[_0x16d1('0x6')](_0x3710ad);_0x45ede1['body']=_0x3763a3;return rpc[_0x3ae03b+_0x16d1('0x7')][_0x16d1('0x8')](_0x45ede1)['then'](function(){logger[_0x16d1('0x9')](_0x16d1('0xa'),_0x385b7d,_0x45ede1[_0x16d1('0xb')]);_0x492bda();})['catch'](function(_0x594d40){logger[_0x16d1('0xc')](_0x16d1('0xa'),_0x385b7d,JSON[_0x16d1('0xd')](_0x594d40));_0x479d1b(_0x594d40);});});}exports[_0x16d1('0xe')]=function(_0x2c5de3,_0x223ea4){return function(_0x393a15){try{if(!_[_0x16d1('0xf')](this['interaction']['UserId'])){logger[_0x16d1('0x9')]('[%s][DIALOGFLOWV2]\x20%s',_0x2c5de3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x393a15['next']();}var _0x329753={'ContactId':this[_0x16d1('0x10')]['id'],'sentAt':moment()[_0x16d1('0x11')](_0x16d1('0x12')),'direction':_0x16d1('0x13')};if(this[_0x16d1('0x14')]==='sms'||this['channel']==='whatsapp'){_0x329753[_0x16d1('0x15')]=this[_0x16d1('0x16')][_0x16d1('0x15')];}var _0x920d4c=this[_0x16d1('0x14')];if(_0x920d4c===_0x16d1('0x17')){_0x329753[_0x16d1('0x18')]=this[_0x16d1('0x19')]['id'];}else{_0x329753[_['upperFirst'](_0x920d4c)+_0x16d1('0x1a')]=this[_0x16d1('0x19')]['id'];}_0x329753[_[_0x16d1('0x1b')](_0x920d4c)+'InteractionId']=this['interaction']['id'];if(this[_0x16d1('0x16')][_0x16d1('0x1c')]){var _0x12fd91=_0x223ea4[0x4];if(!_['isEmpty'](_0x12fd91)){_0x329753['body']=utils[_0x16d1('0x1d')](_0x12fd91,this);return rpc[_0x920d4c+_0x16d1('0x7')][_0x16d1('0x8')](_0x329753)[_0x16d1('0x1e')](function(_0x32485e){logger[_0x16d1('0x9')](_0x16d1('0xa'),_0x2c5de3,_0x329753[_0x16d1('0xb')]);})[_0x16d1('0x1f')](function(_0x5d6f72){logger[_0x16d1('0xc')](_0x16d1('0xa'),_0x2c5de3,JSON[_0x16d1('0xd')](_0x5d6f72));})[_0x16d1('0x20')](function(){logger[_0x16d1('0x9')](_0x16d1('0x21'),_0x2c5de3);_0x393a15[_0x16d1('0x22')]();});}else{logger[_0x16d1('0x9')](_0x16d1('0x23'),_0x2c5de3);_0x393a15['stop']();}}else{var _0x12a025=this;var _0x1326e5=_0x223ea4[0x2][_0x16d1('0x24')](/\\n/g,'\x0a');var _0x386f1c={'credentials':{'private_key':_0x1326e5,'client_email':_0x223ea4[0x1]}};var _0x885035=new dialogflow['SessionsClient'](_0x386f1c);var _0x4e38a2=_0x885035['sessionPath'](_0x223ea4[0x0],md5(_0x12a025[_0x16d1('0x16')]['id']));var _0x13ff0f={'session':_0x4e38a2,'queryInput':{'text':{'text':_0x12a025[_0x16d1('0x25')][_0x16d1('0xb')],'languageCode':_0x223ea4[0x3]||'en'}}};return _0x885035[_0x16d1('0x26')](_0x13ff0f)['then'](function(_0x38cdd0){if(_0x38cdd0&&_0x38cdd0[_0x16d1('0x27')]){_0x12a025['body'][_0x16d1('0x28')]=_0x38cdd0;var _0x1635a7=_0x38cdd0[0x0];var _0x3598fa=_0x1635a7[_0x16d1('0x29')]['diagnosticInfo']&&_0x1635a7[_0x16d1('0x29')][_0x16d1('0x2a')][_0x16d1('0x2b')]?_0x1635a7[_0x16d1('0x29')][_0x16d1('0x2a')][_0x16d1('0x2b')][_0x16d1('0x2c')][_0x16d1('0x2d')]:![];_0x12a025[_0x16d1('0xb')][_0x16d1('0x2e')]=_0x1635a7[_0x16d1('0x29')]['action'];_0x12a025['body'][_0x16d1('0x2f')]=_0x1635a7['queryResult'][_0x16d1('0x30')];_0x12a025[_0x16d1('0xb')][_0x16d1('0x31')]=_0x1635a7['queryResult'][_0x16d1('0x2a')]&&_0x1635a7['queryResult']['diagnosticInfo']['fields']?_0x1635a7[_0x16d1('0x29')][_0x16d1('0x2a')]['fields']['end_conversation'][_0x16d1('0x2d')]:![];_0x12a025[_0x16d1('0xb')][_0x16d1('0x32')]=_0x1635a7[_0x16d1('0x29')][_0x16d1('0x33')][_0x16d1('0x34')];_0x12a025[_0x16d1('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x1635a7[_0x16d1('0x29')][_0x16d1('0x33')][_0x16d1('0x35')];_0x12a025[_0x16d1('0xb')][_0x16d1('0x36')]=_0x1635a7['queryResult'][_0x16d1('0x33')]['isFallback'];_0x12a025[_0x16d1('0xb')]['DIALOGFLOWV2_LANGUAGECODE']=_0x1635a7['queryResult'][_0x16d1('0x37')];_0x12a025[_0x16d1('0xb')][_0x16d1('0x38')]=_0x1635a7['queryResult'][_0x16d1('0x39')];_0x12a025[_0x16d1('0xb')][_0x16d1('0x3a')]=_0x1635a7[_0x16d1('0x29')][_0x16d1('0x3b')];_0x329753['providerName']='dialogflowV2';_0x329753[_0x16d1('0x3c')]=JSON[_0x16d1('0xd')](_0x38cdd0);var _0x10a97d=[];for(var _0x28d2da=0x0;_0x28d2da<_0x38cdd0[_0x16d1('0x27')];_0x28d2da++){var _0x1d43a1=_0x38cdd0[_0x28d2da];if(_0x1d43a1&&_0x1d43a1['queryResult']&&_0x1d43a1[_0x16d1('0x29')]['fulfillmentText']){_0x10a97d[_0x16d1('0x3d')](createMessage(_0x2c5de3,_0x920d4c,_0x329753,_0x1d43a1[_0x16d1('0x29')][_0x16d1('0x3e')]));}}return Promise['all'](_0x10a97d)['then'](function(){if(_0x3598fa){_0x393a15['next']();}else{_0x393a15[_0x16d1('0x22')]();}})['catch'](function(_0x5cc647){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2c5de3,JSON[_0x16d1('0xd')](_0x5cc647));_0x393a15['next']();});}})['catch'](function(_0x55cefb){logger['error'](_0x16d1('0xa'),_0x2c5de3,_0x55cefb[_0x16d1('0x25')],_0x55cefb[_0x16d1('0x3f')]);_0x393a15[_0x16d1('0x40')]();});}}catch(_0x787f35){logger[_0x16d1('0xc')](_0x16d1('0xa'),_0x2c5de3,JSON['stringify'](_0x787f35));_0x393a15['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index f90fba7..bf90d4d 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x767f=['consequence','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','./utils','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20false\x20is\x20a\x20number'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x767f,0x1de));var _0xf767=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x767f[_0x4792c8];return _0x35edb1;};'use strict';var schema=require(_0xf767('0x0'));var _=require(_0xf767('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xf767('0x2'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xf767('0x3')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xf767('0x4')}});exports[_0xf767('0x5')]=function(_0x2c8721,_0x22ae40){return function(_0x455cf6){try{var _0xebdca5={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x22ae40[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x22ae40[0x1],'priorityFalse':_0x22ae40[0x2]};var _0x5bdca6=gotoif[_0xf767('0x0')](_0xebdca5,{'typecast':!![]});if(_0x5bdca6[_0xf767('0x6')]){logger['error'](_0xf767('0x7'),_0x2c8721,_[_0xf767('0x8')](_0x5bdca6,_0xf767('0x9'))[_0xf767('0xa')](',\x20'));_0x455cf6[_0xf767('0xb')]();}else{try{var _0x788915=eval('('+_0xebdca5['condition']+')');var _0x4b8e4e=_0x788915?_0xebdca5['priorityTrue']:_0xebdca5[_0xf767('0xc')];logger[_0xf767('0xd')](_0xf767('0xe'),_0x2c8721,_0xebdca5[_0xf767('0xf')],_0x788915,_0x4b8e4e||_0xf767('0x10'));if(_0x4b8e4e){var _0x41d505=_[_0xf767('0x11')](_0x455cf6['rules'](),{'p':_0x4b8e4e});if(_0x41d505>=0x0){logger[_0xf767('0xd')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2c8721,_0x4b8e4e||_0xf767('0x10'),_0x41d505);_0x455cf6[_0xf767('0x10')](_0x41d505);}else{logger['info'](_0xf767('0x12'),_0x2c8721,_0x4b8e4e||'next');_0x455cf6[_0xf767('0xb')]();}}else{_0x455cf6['next']();}}catch(_0x23f474){logger[_0xf767('0x13')](_0xf767('0x14'),_0x2c8721,_0x23f474[_0xf767('0x9')]);_0x455cf6[_0xf767('0xb')]();}}}catch(_0x46c276){logger[_0xf767('0x13')]('[%s][GOTOIF]\x20%s',_0x2c8721,JSON['stringify'](_0x46c276));_0x455cf6['stop']();}};}; \ No newline at end of file +var _0x1179=['condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','join'];(function(_0x3f4027,_0x221cbb){var _0x4aea2e=function(_0x29bcbb){while(--_0x29bcbb){_0x3f4027['push'](_0x3f4027['shift']());}};_0x4aea2e(++_0x221cbb);}(_0x1179,0x139));var _0x9117=function(_0x1b453f,_0x17520b){_0x1b453f=_0x1b453f-0x0;var _0x581714=_0x1179[_0x1b453f];return _0x581714;};'use strict';var schema=require(_0x9117('0x0'));var _=require(_0x9117('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x9117('0x2'));var logger=require(_0x9117('0x3'))(_0x9117('0x4'));var gotoif=schema({'condition':{'type':_0x9117('0x5'),'required':!![],'message':_0x9117('0x6')},'priorityTrue':{'type':_0x9117('0x7'),'message':_0x9117('0x8')},'priorityFalse':{'type':_0x9117('0x7'),'message':_0x9117('0x9')}});exports['consequence']=function(_0x38383a,_0x2eb925){return function(_0x2554b0){try{var _0x19384f={'condition':htmlToText[_0x9117('0xa')](utils[_0x9117('0xb')](_0x2eb925[0x0],this),{'wordwrap':![]})[_0x9117('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2eb925[0x1],'priorityFalse':_0x2eb925[0x2]};var _0x11e8b6=gotoif[_0x9117('0x0')](_0x19384f,{'typecast':!![]});if(_0x11e8b6[_0x9117('0xd')]){logger[_0x9117('0xe')](_0x9117('0xf'),_0x38383a,_['map'](_0x11e8b6,'message')[_0x9117('0x10')](',\x20'));_0x2554b0['stop']();}else{try{var _0x45ac52=eval('('+_0x19384f[_0x9117('0x11')]+')');var _0x44d58e=_0x45ac52?_0x19384f[_0x9117('0x12')]:_0x19384f[_0x9117('0x13')];logger[_0x9117('0x14')](_0x9117('0x15'),_0x38383a,_0x19384f[_0x9117('0x11')],_0x45ac52,_0x44d58e||_0x9117('0x16'));if(_0x44d58e){var _0x8861f7=_['findIndex'](_0x2554b0[_0x9117('0x17')](),{'p':_0x44d58e});if(_0x8861f7>=0x0){logger['info'](_0x9117('0x18'),_0x38383a,_0x44d58e||_0x9117('0x16'),_0x8861f7);_0x2554b0[_0x9117('0x16')](_0x8861f7);}else{logger['info'](_0x9117('0x19'),_0x38383a,_0x44d58e||'next');_0x2554b0[_0x9117('0x1a')]();}}else{_0x2554b0['next']();}}catch(_0x583ce1){logger[_0x9117('0xe')](_0x9117('0x1b'),_0x38383a,_0x583ce1[_0x9117('0x1c')]);_0x2554b0[_0x9117('0x1a')]();}}}catch(_0x53d6c9){logger[_0x9117('0xe')](_0x9117('0xf'),_0x38383a,JSON[_0x9117('0x1d')](_0x53d6c9));_0x2554b0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index d3a70eb..c220171 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 _0xc5d4=['length','error','[%s][GOTOP]\x20%s','map','message','join','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x5a9680,_0x17ac66){var _0x460998=function(_0x374dbc){while(--_0x374dbc){_0x5a9680['push'](_0x5a9680['shift']());}};_0x460998(++_0x17ac66);}(_0xc5d4,0x13f));var _0x4c5d=function(_0xa02ecd,_0x47c5b0){_0xa02ecd=_0xa02ecd-0x0;var _0x1d2fec=_0xc5d4[_0xa02ecd];return _0x1d2fec;};'use strict';var schema=require(_0x4c5d('0x0'));var _=require(_0x4c5d('0x1'));var logger=require(_0x4c5d('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x4c5d('0x3')}});exports['consequence']=function(_0x183b19,_0x2999be){return function(_0x9dba59){try{var _0x46ce1a={'priority':_0x2999be[0x0]};var _0x10a23f=gotop[_0x4c5d('0x0')](_0x46ce1a,{'typecast':!![]});if(_0x10a23f[_0x4c5d('0x4')]){logger[_0x4c5d('0x5')](_0x4c5d('0x6'),_0x183b19,_[_0x4c5d('0x7')](_0x10a23f,_0x4c5d('0x8'))[_0x4c5d('0x9')](',\x20'));_0x9dba59['stop']();}else{logger['info'](_0x4c5d('0xa'),_0x183b19,_0x46ce1a[_0x4c5d('0xb')]);if(_0x46ce1a['priority']){var _0x302afe=_[_0x4c5d('0xc')](_0x9dba59[_0x4c5d('0xd')](),{'p':_0x46ce1a[_0x4c5d('0xb')]});if(_0x302afe>=0x0){logger[_0x4c5d('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x183b19,_0x46ce1a[_0x4c5d('0xb')]||_0x4c5d('0xf'),_0x302afe);_0x9dba59[_0x4c5d('0xf')](_0x302afe);}else{logger['info'](_0x4c5d('0x10'),_0x183b19,_0x46ce1a['priority']||_0x4c5d('0xf'));_0x9dba59['stop']();}}else{_0x9dba59[_0x4c5d('0xf')]();}}}catch(_0x278b57){logger[_0x4c5d('0x5')](_0x4c5d('0x6'),_0x183b19,JSON[_0x4c5d('0x11')](_0x278b57));_0x9dba59[_0x4c5d('0x12')]();}};}; \ No newline at end of file +var _0x316b=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','next','stringify','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x316b,0x1a6));var _0xb316=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x316b[_0x3f8759];return _0x2d33ca;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xb316('0x0'))('routing');var gotop=schema({'priority':{'type':_0xb316('0x1'),'required':!![],'message':_0xb316('0x2')}});exports[_0xb316('0x3')]=function(_0x4547a2,_0x5bd660){return function(_0x5f95fd){try{var _0x3d791d={'priority':_0x5bd660[0x0]};var _0xc7fc1f=gotop[_0xb316('0x4')](_0x3d791d,{'typecast':!![]});if(_0xc7fc1f[_0xb316('0x5')]){logger[_0xb316('0x6')](_0xb316('0x7'),_0x4547a2,_['map'](_0xc7fc1f,_0xb316('0x8'))['join'](',\x20'));_0x5f95fd['stop']();}else{logger[_0xb316('0x9')](_0xb316('0xa'),_0x4547a2,_0x3d791d[_0xb316('0xb')]);if(_0x3d791d[_0xb316('0xb')]){var _0x4709fc=_[_0xb316('0xc')](_0x5f95fd[_0xb316('0xd')](),{'p':_0x3d791d[_0xb316('0xb')]});if(_0x4709fc>=0x0){logger[_0xb316('0x9')](_0xb316('0xe'),_0x4547a2,_0x3d791d[_0xb316('0xb')]||'next',_0x4709fc);_0x5f95fd['next'](_0x4709fc);}else{logger['info'](_0xb316('0xf'),_0x4547a2,_0x3d791d['priority']||'next');_0x5f95fd[_0xb316('0x10')]();}}else{_0x5f95fd[_0xb316('0x11')]();}}}catch(_0x49aff6){logger[_0xb316('0x6')](_0xb316('0x7'),_0x4547a2,JSON[_0xb316('0x12')](_0x49aff6));_0x5f95fd[_0xb316('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 3ea676f..0be401f 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 _0xb7aa=['AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','ChatWebsiteId','account','upperFirst'];(function(_0x5b25d6,_0x33feae){var _0x41f2e9=function(_0x1c4b1e){while(--_0x1c4b1e){_0x5b25d6['push'](_0x5b25d6['shift']());}};_0x41f2e9(++_0x33feae);}(_0xb7aa,0x11a));var _0xab7a=function(_0x197bb4,_0x53f6da){_0x197bb4=_0x197bb4-0x0;var _0x2594f8=_0xb7aa[_0x197bb4];return _0x2594f8;};'use strict';var _=require(_0xab7a('0x0'));var utils=require(_0xab7a('0x1'));var logger=require(_0xab7a('0x2'))(_0xab7a('0x3'));var rpc={'chatMessage':require(_0xab7a('0x4')),'openchannelMessage':require(_0xab7a('0x5')),'mailMessage':require(_0xab7a('0x6')),'smsMessage':require(_0xab7a('0x7')),'faxMessage':require(_0xab7a('0x8')),'whatsappMessage':require(_0xab7a('0x9'))};exports['consequence']=function(_0x35e114,_0x1c761b){return function(_0x2ee412){try{var _0x29ef15={'body':utils['getMustacheRender'](_0x1c761b[0x0],this),'ContactId':this[_0xab7a('0xa')]['id']};if(this[_0xab7a('0xb')]==='chat'){_0x29ef15[_0xab7a('0xc')]=this[_0xab7a('0xd')]['id'];}else{_0x29ef15[_[_0xab7a('0xe')](this[_0xab7a('0xb')])+_0xab7a('0xf')]=this[_0xab7a('0xd')]['id'];}_0x29ef15[_[_0xab7a('0xe')](this[_0xab7a('0xb')])+_0xab7a('0x10')]=this[_0xab7a('0x11')]['id'];if(rpc[this['channel']+_0xab7a('0x12')]){return rpc[this[_0xab7a('0xb')]+_0xab7a('0x12')][_0xab7a('0x13')](_0x29ef15)['then'](function(_0x28e5de){logger[_0xab7a('0x14')](_0xab7a('0x15'),_0x35e114,_0x29ef15[_0xab7a('0x16')]);_0x2ee412['next']();})[_0xab7a('0x17')](function(_0x1cc43f){logger['error'](_0xab7a('0x15'),_0x35e114,JSON[_0xab7a('0x18')](_0x1cc43f));_0x2ee412[_0xab7a('0x19')]();});}}catch(_0x8ddb0d){logger[_0xab7a('0x1a')]('[%s][MESSAGE]\x20%s',_0x35e114,JSON[_0xab7a('0x18')](_0x8ddb0d));_0x2ee412[_0xab7a('0x19')]();}};}; \ No newline at end of file +var _0x3134=['[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info'];(function(_0x375b8e,_0x142acd){var _0x555ef4=function(_0x5f046a){while(--_0x5f046a){_0x375b8e['push'](_0x375b8e['shift']());}};_0x555ef4(++_0x142acd);}(_0x3134,0xdf));var _0x4313=function(_0x566f57,_0x280fae){_0x566f57=_0x566f57-0x0;var _0x201163=_0x3134[_0x566f57];return _0x201163;};'use strict';var _=require(_0x4313('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x4313('0x1'));var rpc={'chatMessage':require(_0x4313('0x2')),'openchannelMessage':require(_0x4313('0x3')),'mailMessage':require(_0x4313('0x4')),'smsMessage':require(_0x4313('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4313('0x6')]=function(_0xabfb98,_0x5045c9){return function(_0x85b15c){try{var _0x4def4a={'body':utils['getMustacheRender'](_0x5045c9[0x0],this),'ContactId':this[_0x4313('0x7')]['id']};if(this[_0x4313('0x8')]===_0x4313('0x9')){_0x4def4a[_0x4313('0xa')]=this[_0x4313('0xb')]['id'];}else{_0x4def4a[_[_0x4313('0xc')](this[_0x4313('0x8')])+_0x4313('0xd')]=this[_0x4313('0xb')]['id'];}_0x4def4a[_['upperFirst'](this[_0x4313('0x8')])+_0x4313('0xe')]=this[_0x4313('0xf')]['id'];if(rpc[this['channel']+_0x4313('0x10')]){return rpc[this[_0x4313('0x8')]+_0x4313('0x10')][_0x4313('0x11')](_0x4def4a)[_0x4313('0x12')](function(_0x3986a5){logger[_0x4313('0x13')](_0x4313('0x14'),_0xabfb98,_0x4def4a[_0x4313('0x15')]);_0x85b15c[_0x4313('0x16')]();})[_0x4313('0x17')](function(_0x2ca18f){logger[_0x4313('0x18')](_0x4313('0x14'),_0xabfb98,JSON[_0x4313('0x19')](_0x2ca18f));_0x85b15c[_0x4313('0x1a')]();});}}catch(_0x3a262e){logger[_0x4313('0x18')]('[%s][MESSAGE]\x20%s',_0xabfb98,JSON[_0x4313('0x19')](_0x3a262e));_0x85b15c[_0x4313('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 0081313..73a1ea0 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 _0xd23e=['consequence','info','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd23e,0x1ee));var _0xed23=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xd23e[_0x27c068];return _0xe5a67f;};'use strict';var utils=require(_0xed23('0x0'));var logger=require(_0xed23('0x1'))(_0xed23('0x2'));exports[_0xed23('0x3')]=function(_0x20b63b,_0x1b74e7){return function(_0x4ae9f9){try{logger[_0xed23('0x4')]('[%s][NOOP]\x20%s',_0x20b63b,utils['getMustacheRender'](_0x1b74e7[0x0],this));_0x4ae9f9['next']();}catch(_0x5d5557){logger['error'](_0xed23('0x5'),_0x20b63b,JSON['stringify'](_0x5d5557));_0x4ae9f9[_0xed23('0x6')]();}};}; \ No newline at end of file +var _0xa1bb=['stringify','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x2e0fc2,_0x4351dc){var _0x32bd4a=function(_0x190640){while(--_0x190640){_0x2e0fc2['push'](_0x2e0fc2['shift']());}};_0x32bd4a(++_0x4351dc);}(_0xa1bb,0x157));var _0xba1b=function(_0xe90b6f,_0x3fef7d){_0xe90b6f=_0xe90b6f-0x0;var _0x37c506=_0xa1bb[_0xe90b6f];return _0x37c506;};'use strict';var utils=require(_0xba1b('0x0'));var logger=require('../../../../config/logger')(_0xba1b('0x1'));exports[_0xba1b('0x2')]=function(_0x298926,_0x1c820b){return function(_0x2fc2c9){try{logger[_0xba1b('0x3')](_0xba1b('0x4'),_0x298926,utils[_0xba1b('0x5')](_0x1c820b[0x0],this));_0x2fc2c9[_0xba1b('0x6')]();}catch(_0x22b65d){logger[_0xba1b('0x7')](_0xba1b('0x4'),_0x298926,JSON[_0xba1b('0x8')](_0x22b65d));_0x2fc2c9['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 3d53a5c..2c8f330 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 _0x2652=['timeout','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','localhost','queue_id','queue','from','clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','chat','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x2652,0xa8));var _0x2265=function(_0x15cf1d,_0x381837){_0x15cf1d=_0x15cf1d-0x0;var _0x353d29=_0x2652[_0x15cf1d];return _0x353d29;};'use strict';var schema=require('validate');var _=require(_0x2265('0x0'));var util=require(_0x2265('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x2265('0x2'));var Redis=require(_0x2265('0x3'));var config=require(_0x2265('0x4'));var logger=require(_0x2265('0x5'))('routing');var strategy=require(_0x2265('0x6'));config[_0x2265('0x7')]=_['defaults'](config[_0x2265('0x7')],{'host':_0x2265('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2265('0x7')]));var attributes=['id',_0x2265('0x9'),'account',_0x2265('0xa'),_0x2265('0xb'),'joinAt'];function emit(_0x15b2ac,_0x3ab7ac,_0x38f552){io['to'](_0x15b2ac)['emit'](_0x3ab7ac,_0x38f552);}function emitChannelQueueInteraction(_0x3050f0,_0x24829a,_0x2f705b,_0x54a27b,_0x7c6cf6,_0x12720e,_0x220573,_0x3aec2b){var _0x2d5593=_[_0x2265('0xc')](_0x2f705b);_0x2d5593[_0x2265('0x9')]=_0x3aec2b;_0x2d5593[_0x2265('0xa')]=_0x24829a;_0x2d5593['account']=_0x54a27b;_0x2d5593['id']=_0x7c6cf6;if(_0x12720e){attributes[_0x2265('0xd')](_['capitalize'](_0x3050f0)+_0x2265('0xe'));_0x220573[util[_0x2265('0xf')](_0x2265('0x10'),_0x3050f0)][_0x7c6cf6]=_[_0x2265('0x11')](_0x2d5593,attributes);}else{delete _0x220573[util[_0x2265('0xf')](_0x2265('0x10'),_0x3050f0)][_0x7c6cf6];}emit(util[_0x2265('0xf')]('%s:queue:%s',_0x3050f0,_0x24829a),util[_0x2265('0xf')]('%s_queue_waiting_interaction:%s',_0x3050f0,_0x12720e?_0x2265('0x12'):_0x2265('0x13')),_['pick'](_0x2d5593,attributes));}var rpc={'openchannelQueueReport':require(_0x2265('0x14')),'mailQueueReport':require(_0x2265('0x15')),'chatQueueReport':require(_0x2265('0x16')),'smsQueueReport':require(_0x2265('0x17')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x2265('0x18'))};var queue=schema({'name':{'type':_0x2265('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x2265('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x728460,_0x4cdf80,_0x572aec,_0x2f6fc3){if(_0x728460&&_0x4cdf80&&_0x572aec){_0x4cdf80[_0x2265('0x1b')]+=0x1;var _0x43ae3f={'uniqueid':_0x728460,'from':_0x572aec[_0x2265('0x1c')]?_0x572aec[_0x2265('0x1c')][_0x2265('0xb')]:'','joinAt':moment()[_0x2265('0xf')](_0x2265('0x1d')),'ContactId':_0x572aec[_0x2265('0x1e')]?_0x572aec[_0x2265('0x1e')]['id']:null,'ListId':_0x572aec[_0x2265('0x1f')]?_0x572aec[_0x2265('0x1f')]['id']:null};_0x43ae3f[_[_0x2265('0x20')](_0x572aec[_0x2265('0x21')])+_0x2265('0x22')]=_0x4cdf80['id']||null;_0x43ae3f[_[_0x2265('0x20')](_0x572aec['channel'])+_0x2265('0xe')]=_0x572aec[_0x2265('0x23')]?_0x572aec[_0x2265('0x23')]['id']:null;_0x43ae3f[_['upperFirst'](_0x572aec[_0x2265('0x21')])+'MessageId']=_0x572aec[_0x2265('0x24')]?_0x572aec['message']['id']:null;_0x43ae3f[_['upperFirst'](_0x572aec[_0x2265('0x21')])+(_0x572aec['channel']!==_0x2265('0x25')?'AccountId':_0x2265('0x26'))]=_0x572aec[_0x2265('0x27')]?_0x572aec[_0x2265('0x27')]['id']:null;logger[_0x2265('0x28')](util['format'](_0x2265('0x29'),_0x728460,_0x4cdf80[_0x2265('0x2a')]));emitChannelQueueInteraction(_0x572aec[_0x2265('0x21')],_0x4cdf80[_0x2265('0x2a')],_0x43ae3f,_0x572aec[_0x2265('0x27')][_0x2265('0x2a')],_0x572aec[_0x2265('0x24')]['id'],!![],_0x2f6fc3,_0x4cdf80['id']);if(rpc[_0x572aec[_0x2265('0x21')]+_0x2265('0x2b')]){return rpc[_0x572aec[_0x2265('0x21')]+'QueueReport'][_0x2265('0x2c')](_0x43ae3f)[_0x2265('0x2d')](function(_0x4cc4bc){logger[_0x2265('0x2e')](_0x2265('0x2f'));});}}}function stopRouting(_0x46e756,_0x4976eb,_0x251e29,_0x564c3d){if(_0x46e756&&_0x4976eb){_0x4976eb[_0x2265('0x1b')]-=0x1;var _0x2084fb={'leaveAt':moment()[_0x2265('0xf')](_0x2265('0x1d')),'acceptAt':moment()[_0x2265('0xf')](_0x2265('0x1d')),'reason':'accepted'};logger[_0x2265('0x28')](util[_0x2265('0xf')](_0x2265('0x30'),_0x46e756,_0x4976eb[_0x2265('0x2a')]));emitChannelQueueInteraction(_0x251e29[_0x2265('0x21')],_0x4976eb[_0x2265('0x2a')],_0x251e29['body'],_0x251e29['account'][_0x2265('0x2a')],_0x251e29['message']['id'],![],_0x564c3d,_0x4976eb['id']);if(rpc[_0x251e29['channel']+_0x2265('0x2b')]){return rpc[_0x251e29['channel']+_0x2265('0x2b')][_0x2265('0x31')](_0x46e756,_0x2084fb)[_0x2265('0x2d')](function(_0x5a3b9f){logger[_0x2265('0x2e')](_0x2265('0x32'));});}}}function endRouting(_0x256e9b,_0x45ce06,_0x418db5,_0x3dfb82){if(_0x256e9b&&_0x45ce06){_0x45ce06[_0x2265('0x1b')]-=0x1;var _0x1f1a7d={'leaveAt':moment()[_0x2265('0xf')](_0x2265('0x1d')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2265('0x33')};logger[_0x2265('0x28')](util[_0x2265('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x256e9b,_0x45ce06[_0x2265('0x2a')]));emitChannelQueueInteraction(_0x418db5[_0x2265('0x21')],_0x45ce06[_0x2265('0x2a')],_0x418db5[_0x2265('0x1c')],_0x418db5[_0x2265('0x27')][_0x2265('0x2a')],_0x418db5['message']['id'],![],_0x3dfb82);if(rpc[_0x418db5[_0x2265('0x21')]+'QueueReport']){return rpc[_0x418db5[_0x2265('0x21')]+_0x2265('0x2b')][_0x2265('0x31')](_0x256e9b,_0x1f1a7d)[_0x2265('0x2d')](function(_0x39340d){logger[_0x2265('0x2e')](_0x2265('0x32'));});}}}function handleFindQueue(_0x5ae0f5){return function(_0x587d46){return _0x587d46[_0x2265('0x2a')][_0x2265('0x34')]()===_0x5ae0f5['toLowerCase']();};}exports[_0x2265('0x35')]=function(_0x1b0c4d,_0x1a8b85,_0x230255,_0x4fa644){return function(_0x2e9836){try{var _0x1bf928={'name':_0x1a8b85[0x0],'timeout':_0x1a8b85[0x1]};var _0x221bd4=queue[_0x2265('0x36')](_0x1bf928,{'typecast':!![]});if(_0x221bd4[_0x2265('0x37')]){logger[_0x2265('0x2e')](_0x2265('0x38'),_0x1b0c4d,_[_0x2265('0x39')](_0x221bd4,'message')[_0x2265('0x3a')](',\x20'));_0x2e9836[_0x2265('0x3b')]();}else{var _0xf9438e=_[_0x2265('0x3c')](_0x230255[_0x4fa644[_0x2265('0x21')]+_0x2265('0x3d')],handleFindQueue(_0x1bf928[_0x2265('0x2a')]));if(_0xf9438e){startRouting(_0x1b0c4d,_0xf9438e,_0x4fa644,_0x230255);var _0x5a434d=(_0xf9438e[_0x2265('0x33')]||0xa)*0x3e8;var _0x979945=(_0x1bf928['timeout']||0x14)*0x3e8;var _0x1e0f1d;if(_0x5a434d>_0x979945){_0x979945=_0x5a434d;}var _0x1511ff=seqqueue['createQueue'](_0x5a434d);_0x1511ff['id']=_0x1b0c4d;_0x1511ff[_0x2265('0x3e')]=_0x5a434d;_0x1511ff['qtimeout']=_0x979945;_0x1511ff[_0x2265('0x21')]=_0x4fa644[_0x2265('0x21')];_0x230255[_0x2265('0x3f')][_0x1b0c4d]['on'](_0x2265('0x40'),function(){logger[_0x2265('0x28')](_0x2265('0x41'),_0x1b0c4d);stopRouting(_0x1b0c4d,_0xf9438e,_0x4fa644,_0x230255);clearTimeout(_0x1e0f1d);_0x1e0f1d=undefined;_0x1511ff[_0x2265('0x42')](!![]);if(_0x230255['rules'][_0x1b0c4d]){delete _0x230255['rules'][_0x1b0c4d];}_0x2e9836[_0x2265('0x3b')]();});_0x230255[_0x2265('0x3f')][_0x1b0c4d]['on']('complete',function(){if(_0x230255['rules'][_0x1b0c4d]){delete _0x230255[_0x2265('0x3f')][_0x1b0c4d];}});_0x1e0f1d=setTimeout(function(){logger['info'](_0x2265('0x43'),_0x1b0c4d);endRouting(_0x1b0c4d,_0xf9438e,_0x4fa644,_0x230255);clearTimeout(_0x1e0f1d);_0x1511ff['close'](!![]);_0x2e9836['next']();},_0x979945);switch(_0xf9438e[_0x2265('0x44')]){case _0x2265('0x45'):strategy[_0x2265('0x45')](_0x1511ff,_0xf9438e,_0x230255,_0x4fa644);break;default:strategy['beepall'](_0x1511ff,_0xf9438e,_0x230255,_0x4fa644);}}else{logger['error'](_0x2265('0x46'),_0x1b0c4d,_0x1bf928[_0x2265('0x2a')]);_0x2e9836[_0x2265('0x3b')]();}}}catch(_0x3bae79){console[_0x2265('0x47')](_0x3bae79);logger[_0x2265('0x2e')](_0x2265('0x38'),_0x1b0c4d,_0x3bae79[_0x2265('0x48')]);_0x2e9836['stop']();}};}; \ No newline at end of file +var _0x5f85=['emit','clone','account','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','qtimeout','rules','end','info','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','moment','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5f85,0x1d8));var _0x55f8=function(_0x57f319,_0x27b333){_0x57f319=_0x57f319-0x0;var _0x28f49e=_0x5f85[_0x57f319];return _0x28f49e;};'use strict';var schema=require(_0x55f8('0x0'));var _=require('lodash');var util=require(_0x55f8('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x55f8('0x2'));var Redis=require('ioredis');var config=require(_0x55f8('0x3'));var logger=require('../../../../config/logger')(_0x55f8('0x4'));var strategy=require(_0x55f8('0x5'));config[_0x55f8('0x6')]=_[_0x55f8('0x7')](config['redis'],{'host':_0x55f8('0x8'),'port':0x18eb});var io=require(_0x55f8('0x9'))(new Redis(config[_0x55f8('0x6')]));var attributes=['id',_0x55f8('0xa'),'account',_0x55f8('0xb'),_0x55f8('0xc'),_0x55f8('0xd')];function emit(_0x5b26d3,_0x41d0a5,_0x5d73ba){io['to'](_0x5b26d3)[_0x55f8('0xe')](_0x41d0a5,_0x5d73ba);}function emitChannelQueueInteraction(_0x4361db,_0x57235e,_0x361101,_0x6d25e9,_0x2f332a,_0x5d7b48,_0x47ea68,_0x35a22e){var _0x1baa3a=_[_0x55f8('0xf')](_0x361101);_0x1baa3a['queue_id']=_0x35a22e;_0x1baa3a['queue']=_0x57235e;_0x1baa3a[_0x55f8('0x10')]=_0x6d25e9;_0x1baa3a['id']=_0x2f332a;if(_0x5d7b48){attributes[_0x55f8('0x11')](_[_0x55f8('0x12')](_0x4361db)+_0x55f8('0x13'));_0x47ea68[util[_0x55f8('0x14')](_0x55f8('0x15'),_0x4361db)][_0x2f332a]=_[_0x55f8('0x16')](_0x1baa3a,attributes);}else{delete _0x47ea68[util[_0x55f8('0x14')](_0x55f8('0x15'),_0x4361db)][_0x2f332a];}emit(util['format'](_0x55f8('0x17'),_0x4361db,_0x57235e),util[_0x55f8('0x14')](_0x55f8('0x18'),_0x4361db,_0x5d7b48?_0x55f8('0x19'):'remove'),_[_0x55f8('0x16')](_0x1baa3a,attributes));}var rpc={'openchannelQueueReport':require(_0x55f8('0x1a')),'mailQueueReport':require(_0x55f8('0x1b')),'chatQueueReport':require(_0x55f8('0x1c')),'smsQueueReport':require(_0x55f8('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x55f8('0x1e'))};var queue=schema({'name':{'type':_0x55f8('0x1f'),'required':!![],'message':_0x55f8('0x20')},'timeout':{'type':_0x55f8('0x21'),'message':_0x55f8('0x22')}});function startRouting(_0x3a5b9e,_0x31ba3e,_0x148778,_0x1c4b91){if(_0x3a5b9e&&_0x31ba3e&&_0x148778){_0x31ba3e[_0x55f8('0x23')]+=0x1;var _0x568948={'uniqueid':_0x3a5b9e,'from':_0x148778[_0x55f8('0x24')]?_0x148778[_0x55f8('0x24')][_0x55f8('0xc')]:'','joinAt':moment()[_0x55f8('0x14')](_0x55f8('0x25')),'ContactId':_0x148778[_0x55f8('0x26')]?_0x148778[_0x55f8('0x26')]['id']:null,'ListId':_0x148778[_0x55f8('0x27')]?_0x148778['list']['id']:null};_0x568948[_[_0x55f8('0x28')](_0x148778[_0x55f8('0x29')])+_0x55f8('0x2a')]=_0x31ba3e['id']||null;_0x568948[_[_0x55f8('0x28')](_0x148778[_0x55f8('0x29')])+'InteractionId']=_0x148778[_0x55f8('0x2b')]?_0x148778[_0x55f8('0x2b')]['id']:null;_0x568948[_['upperFirst'](_0x148778[_0x55f8('0x29')])+_0x55f8('0x2c')]=_0x148778['message']?_0x148778[_0x55f8('0x2d')]['id']:null;_0x568948[_[_0x55f8('0x28')](_0x148778[_0x55f8('0x29')])+(_0x148778[_0x55f8('0x29')]!==_0x55f8('0x2e')?_0x55f8('0x2f'):_0x55f8('0x30'))]=_0x148778[_0x55f8('0x10')]?_0x148778[_0x55f8('0x10')]['id']:null;logger['info'](util['format'](_0x55f8('0x31'),_0x3a5b9e,_0x31ba3e['name']));emitChannelQueueInteraction(_0x148778[_0x55f8('0x29')],_0x31ba3e[_0x55f8('0x32')],_0x568948,_0x148778[_0x55f8('0x10')]['name'],_0x148778['message']['id'],!![],_0x1c4b91,_0x31ba3e['id']);if(rpc[_0x148778[_0x55f8('0x29')]+_0x55f8('0x33')]){return rpc[_0x148778[_0x55f8('0x29')]+_0x55f8('0x33')][_0x55f8('0x34')](_0x568948)[_0x55f8('0x35')](function(_0x488a1c){logger[_0x55f8('0x36')](_0x55f8('0x37'));});}}}function stopRouting(_0x42295f,_0x3dfcb5,_0x436d96,_0x40a0f7){if(_0x42295f&&_0x3dfcb5){_0x3dfcb5[_0x55f8('0x23')]-=0x1;var _0x497b6={'leaveAt':moment()[_0x55f8('0x14')](_0x55f8('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util[_0x55f8('0x14')](_0x55f8('0x38'),_0x42295f,_0x3dfcb5[_0x55f8('0x32')]));emitChannelQueueInteraction(_0x436d96[_0x55f8('0x29')],_0x3dfcb5[_0x55f8('0x32')],_0x436d96['body'],_0x436d96[_0x55f8('0x10')][_0x55f8('0x32')],_0x436d96[_0x55f8('0x2d')]['id'],![],_0x40a0f7,_0x3dfcb5['id']);if(rpc[_0x436d96['channel']+_0x55f8('0x33')]){return rpc[_0x436d96[_0x55f8('0x29')]+'QueueReport'][_0x55f8('0x39')](_0x42295f,_0x497b6)[_0x55f8('0x35')](function(_0x5de5e1){logger[_0x55f8('0x36')]('update\x20queue\x20report');});}}}function endRouting(_0x1d6269,_0x5b381d,_0x150b42,_0x58cdb4){if(_0x1d6269&&_0x5b381d){_0x5b381d[_0x55f8('0x23')]-=0x1;var _0x15fb9f={'leaveAt':moment()[_0x55f8('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x55f8('0x14')](_0x55f8('0x25')),'reason':'timeout'};logger['info'](util['format'](_0x55f8('0x3a'),_0x1d6269,_0x5b381d[_0x55f8('0x32')]));emitChannelQueueInteraction(_0x150b42[_0x55f8('0x29')],_0x5b381d[_0x55f8('0x32')],_0x150b42[_0x55f8('0x24')],_0x150b42[_0x55f8('0x10')][_0x55f8('0x32')],_0x150b42[_0x55f8('0x2d')]['id'],![],_0x58cdb4);if(rpc[_0x150b42[_0x55f8('0x29')]+_0x55f8('0x33')]){return rpc[_0x150b42[_0x55f8('0x29')]+_0x55f8('0x33')][_0x55f8('0x39')](_0x1d6269,_0x15fb9f)[_0x55f8('0x35')](function(_0x4d84bd){logger['error'](_0x55f8('0x3b'));});}}}function handleFindQueue(_0x3d1117){return function(_0xeecf5c){return _0xeecf5c[_0x55f8('0x32')]['toLowerCase']()===_0x3d1117[_0x55f8('0x3c')]();};}exports['consequence']=function(_0x42e030,_0x1d6b1e,_0x23a654,_0x44c3f9){return function(_0x366df7){try{var _0x32dd32={'name':_0x1d6b1e[0x0],'timeout':_0x1d6b1e[0x1]};var _0x24a1e8=queue['validate'](_0x32dd32,{'typecast':!![]});if(_0x24a1e8['length']){logger[_0x55f8('0x36')](_0x55f8('0x3d'),_0x42e030,_[_0x55f8('0x3e')](_0x24a1e8,_0x55f8('0x2d'))[_0x55f8('0x3f')](',\x20'));_0x366df7[_0x55f8('0x40')]();}else{var _0x77cbc3=_[_0x55f8('0x41')](_0x23a654[_0x44c3f9['channel']+_0x55f8('0x42')],handleFindQueue(_0x32dd32[_0x55f8('0x32')]));if(_0x77cbc3){startRouting(_0x42e030,_0x77cbc3,_0x44c3f9,_0x23a654);var _0xa30444=(_0x77cbc3[_0x55f8('0x43')]||0xa)*0x3e8;var _0x31dfa9=(_0x32dd32[_0x55f8('0x43')]||0x14)*0x3e8;var _0xefe49a;if(_0xa30444>_0x31dfa9){_0x31dfa9=_0xa30444;}var _0x2c6b01=seqqueue[_0x55f8('0x44')](_0xa30444);_0x2c6b01['id']=_0x42e030;_0x2c6b01['atimeout']=_0xa30444;_0x2c6b01[_0x55f8('0x45')]=_0x31dfa9;_0x2c6b01['channel']=_0x44c3f9[_0x55f8('0x29')];_0x23a654[_0x55f8('0x46')][_0x42e030]['on'](_0x55f8('0x47'),function(){logger[_0x55f8('0x48')](_0x55f8('0x49'),_0x42e030);stopRouting(_0x42e030,_0x77cbc3,_0x44c3f9,_0x23a654);clearTimeout(_0xefe49a);_0xefe49a=undefined;_0x2c6b01[_0x55f8('0x4a')](!![]);if(_0x23a654[_0x55f8('0x46')][_0x42e030]){delete _0x23a654['rules'][_0x42e030];}_0x366df7[_0x55f8('0x40')]();});_0x23a654['rules'][_0x42e030]['on'](_0x55f8('0x4b'),function(){if(_0x23a654['rules'][_0x42e030]){delete _0x23a654[_0x55f8('0x46')][_0x42e030];}});_0xefe49a=setTimeout(function(){logger[_0x55f8('0x48')](_0x55f8('0x4c'),_0x42e030);endRouting(_0x42e030,_0x77cbc3,_0x44c3f9,_0x23a654);clearTimeout(_0xefe49a);_0x2c6b01['close'](!![]);_0x366df7[_0x55f8('0x4d')]();},_0x31dfa9);switch(_0x77cbc3['strategy']){case _0x55f8('0x4e'):strategy['rrmemory'](_0x2c6b01,_0x77cbc3,_0x23a654,_0x44c3f9);break;default:strategy['beepall'](_0x2c6b01,_0x77cbc3,_0x23a654,_0x44c3f9);}}else{logger[_0x55f8('0x36')](_0x55f8('0x4f'),_0x42e030,_0x32dd32[_0x55f8('0x32')]);_0x366df7[_0x55f8('0x40')]();}}}catch(_0x510727){console['log'](_0x510727);logger[_0x55f8('0x36')]('[%s][QUEUE]\x20%s',_0x42e030,_0x510727[_0x55f8('0x50')]);_0x366df7['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index f88592e..95c7177 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 _0xf873=['RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent','realtime','push','handleRun','bind','handleTimeout','squeue','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','saveWaitingNotification','showNotification','writeLog'];(function(_0x2eb828,_0x5b4396){var _0xdb47b7=function(_0x5797cb){while(--_0x5797cb){_0x2eb828['push'](_0x2eb828['shift']());}};_0xdb47b7(++_0x5b4396);}(_0xf873,0xb2));var _0x3f87=function(_0x282293,_0x372899){_0x282293=_0x282293-0x0;var _0x354754=_0xf873[_0x282293];return _0x354754;};'use strict';var _=require('lodash');var uuid=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var logger=require(_0x3f87('0x2'))(_0x3f87('0x3'));var Agent=function(_0x1c56a3,_0xd4592c,_0x2fbb4f,_0x1d68dd){this[_0x3f87('0x4')]=uuid['v4']();this['squeue']=_0x1c56a3;this[_0x3f87('0x5')]=_0xd4592c;this[_0x3f87('0x6')]=_0x2fbb4f;this[_0x3f87('0x3')]=_0x1d68dd;this['squeue'][_0x3f87('0x7')](this[_0x3f87('0x8')][_0x3f87('0x9')](this),this[_0x3f87('0xa')][_0x3f87('0x9')](this));this[_0x3f87('0xb')]['on']('timeout',this[_0x3f87('0xa')][_0x3f87('0x9')](this));this[_0x3f87('0xb')]['on'](_0x3f87('0xc'),this[_0x3f87('0xd')][_0x3f87('0x9')](this));};Agent[_0x3f87('0xe')][_0x3f87('0x7')]=function(){this[_0x3f87('0xb')][_0x3f87('0x7')](this[_0x3f87('0x8')][_0x3f87('0x9')](this),this[_0x3f87('0xa')][_0x3f87('0x9')](this));};Agent['prototype'][_0x3f87('0xd')]=function(){this[_0x3f87('0xa')](!![]);};Agent['prototype'][_0x3f87('0x8')]=function(){logger[_0x3f87('0xf')](_0x3f87('0x10'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);if(_[_0x3f87('0x11')](this[_0x3f87('0x6')][_0x3f87('0x12')][this['agent']['id']])){logger[_0x3f87('0xf')](_0x3f87('0x13'),this[_0x3f87('0xb')]['id'],this['agent']['id']);setTimeout(this[_0x3f87('0x7')]['bind'](this),0x3e8);}else{if(this[_0x3f87('0x3')][_0x3f87('0x14')]||util[_0x3f87('0x15')](this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this[_0x3f87('0x5')]['id']],this[_0x3f87('0xb')][_0x3f87('0x16')],![])){this[_0x3f87('0x6')]['agents'][this['agent']['id']]['busy']=!![];this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']]['busyQueue']=undefined;util[_0x3f87('0x17')](this[_0x3f87('0x6')],this[_0x3f87('0x3')],this[_0x3f87('0x5')],this[_0x3f87('0xb')][_0x3f87('0x16')]);util[_0x3f87('0x18')](this[_0x3f87('0x4')],this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']],null,this['routing']);util[_0x3f87('0x19')](this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this['agent']['id']],_0x3f87('0x1a')+(this[_0x3f87('0x3')][_0x3f87('0x14')]?_0x3f87('0x1b'):''));}else{logger[_0x3f87('0xf')](_0x3f87('0x1c'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);setTimeout(this[_0x3f87('0x7')][_0x3f87('0x9')](this),0x3e8);}}};Agent[_0x3f87('0xe')][_0x3f87('0xa')]=function(_0x439a7d){if(_[_0x3f87('0x11')](this[_0x3f87('0x6')][_0x3f87('0x12')][this['agent']['id']])){return logger[_0x3f87('0xf')](_0x3f87('0x13'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x3f87('0x5')]['id']);util[_0x3f87('0x1d')](this[_0x3f87('0x4')],this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this[_0x3f87('0x5')]['id']],null,this['routing']);this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']][_0x3f87('0x1e')]=![];this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']]['busyQueue']=undefined;util['removeWaitingNotification'](this[_0x3f87('0x6')],this[_0x3f87('0x3')],this[_0x3f87('0x5')],this[_0x3f87('0xb')][_0x3f87('0x16')]);util[_0x3f87('0x19')](this[_0x3f87('0xb')]['id'],this['realtime'][_0x3f87('0x12')][this['agent']['id']],_0x439a7d?_0x3f87('0x1f'):_0x3f87('0x20'));}if(!_0x439a7d){setTimeout(this[_0x3f87('0x7')][_0x3f87('0x9')](this),0x3e8);}};function agent(_0x51a33d,_0x3bc7f6,_0x54fe61,_0x1c3fe8){return new Agent(_0x51a33d,_0x3bc7f6,_0x54fe61,_0x1c3fe8);}module[_0x3f87('0x21')]=agent; \ No newline at end of file +var _0xcb66=['prototype','[%s][AGENT]\x20try\x20with\x20%s','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','realtime','agents','busy','busyQueue','saveWaitingNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained'];(function(_0x570a3d,_0x17b25a){var _0x5a0e92=function(_0x308277){while(--_0x308277){_0x570a3d['push'](_0x570a3d['shift']());}};_0x5a0e92(++_0x17b25a);}(_0xcb66,0x19f));var _0x6cb6=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0xcb66[_0x510b98];return _0x45e775;};'use strict';var _=require('lodash');var uuid=require(_0x6cb6('0x0'));var util=require(_0x6cb6('0x1'));var logger=require(_0x6cb6('0x2'))(_0x6cb6('0x3'));var Agent=function(_0x205243,_0x56618a,_0xe996ed,_0x2d7dbb){this[_0x6cb6('0x4')]=uuid['v4']();this[_0x6cb6('0x5')]=_0x205243;this[_0x6cb6('0x6')]=_0x56618a;this['realtime']=_0xe996ed;this['routing']=_0x2d7dbb;this[_0x6cb6('0x5')][_0x6cb6('0x7')](this[_0x6cb6('0x8')][_0x6cb6('0x9')](this),this[_0x6cb6('0xa')][_0x6cb6('0x9')](this));this[_0x6cb6('0x5')]['on'](_0x6cb6('0xb'),this[_0x6cb6('0xa')][_0x6cb6('0x9')](this));this[_0x6cb6('0x5')]['on'](_0x6cb6('0xc'),this[_0x6cb6('0xd')]['bind'](this));};Agent['prototype']['push']=function(){this['squeue'][_0x6cb6('0x7')](this[_0x6cb6('0x8')][_0x6cb6('0x9')](this),this[_0x6cb6('0xa')]['bind'](this));};Agent[_0x6cb6('0xe')][_0x6cb6('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x6cb6('0xe')][_0x6cb6('0x8')]=function(){logger['debug'](_0x6cb6('0xf'),this[_0x6cb6('0x5')]['id'],this['agent']['id']);if(_['isNil'](this['realtime']['agents'][this[_0x6cb6('0x6')]['id']])){logger[_0x6cb6('0x10')](_0x6cb6('0x11'),this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x6')]['id']);setTimeout(this[_0x6cb6('0x7')]['bind'](this),0x3e8);}else{if(this[_0x6cb6('0x3')][_0x6cb6('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],this['squeue'][_0x6cb6('0x13')],![])){this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']][_0x6cb6('0x16')]=!![];this['realtime']['agents'][this[_0x6cb6('0x6')]['id']][_0x6cb6('0x17')]=undefined;util[_0x6cb6('0x18')](this[_0x6cb6('0x14')],this['routing'],this[_0x6cb6('0x6')],this[_0x6cb6('0x5')]['channel']);util['showNotification'](this[_0x6cb6('0x4')],this['squeue']['id'],this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']],null,this[_0x6cb6('0x3')]);util[_0x6cb6('0x19')](this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']],_0x6cb6('0x1a')+(this['routing']['forcedOwnership']?':FORCED':''));}else{logger[_0x6cb6('0x10')](_0x6cb6('0x1b'),this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x6')]['id']);setTimeout(this[_0x6cb6('0x7')][_0x6cb6('0x9')](this),0x3e8);}}};Agent['prototype'][_0x6cb6('0xa')]=function(_0x4d4ad9){if(_[_0x6cb6('0x1c')](this['realtime'][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']])){return logger[_0x6cb6('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x6')]['id']);}else{logger[_0x6cb6('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x6')]['id']);util[_0x6cb6('0x1d')](this['notificationId'],this[_0x6cb6('0x5')]['id'],this[_0x6cb6('0x14')]['agents'][this[_0x6cb6('0x6')]['id']],null,this[_0x6cb6('0x3')]);this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']][_0x6cb6('0x16')]=![];this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']][_0x6cb6('0x17')]=undefined;util['removeWaitingNotification'](this[_0x6cb6('0x14')],this[_0x6cb6('0x3')],this[_0x6cb6('0x6')],this[_0x6cb6('0x5')]['channel']);util['writeLog'](this['squeue']['id'],this[_0x6cb6('0x14')][_0x6cb6('0x15')][this[_0x6cb6('0x6')]['id']],_0x4d4ad9?_0x6cb6('0x1e'):_0x6cb6('0x1f'));}if(!_0x4d4ad9){setTimeout(this[_0x6cb6('0x7')][_0x6cb6('0x9')](this),0x3e8);}};function agent(_0x950248,_0x4bbecb,_0x44d970,_0x559b1d){return new Agent(_0x950248,_0x4bbecb,_0x44d970,_0x559b1d);}module[_0x6cb6('0x20')]=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 cd16bb3..725e3ef 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 _0x0fcb=['name','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busy','busyQueue'];(function(_0x3878bd,_0x51e3e5){var _0x359e60=function(_0xe70276){while(--_0xe70276){_0x3878bd['push'](_0x3878bd['shift']());}};_0x359e60(++_0x51e3e5);}(_0x0fcb,0x76));var _0xb0fc=function(_0x17e1c4,_0x5c32be){_0x17e1c4=_0x17e1c4-0x0;var _0x344678=_0x0fcb[_0x17e1c4];return _0x344678;};'use strict';var _=require(_0xb0fc('0x0'));var uuid=require(_0xb0fc('0x1'));var util=require(_0xb0fc('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x154c1b,_0x451ba7,_0x46cbba,_0x297d70){this[_0xb0fc('0x3')]=uuid['v4']();this[_0xb0fc('0x4')]=_0x154c1b;this[_0xb0fc('0x5')]=_0x451ba7;this[_0xb0fc('0x6')]=_0x46cbba;this[_0xb0fc('0x7')]=_0x297d70;this[_0xb0fc('0x4')][_0xb0fc('0x8')](this[_0xb0fc('0x9')][_0xb0fc('0xa')](this),this[_0xb0fc('0xb')][_0xb0fc('0xa')](this));this[_0xb0fc('0x4')]['on'](_0xb0fc('0xc'),this[_0xb0fc('0xb')][_0xb0fc('0xa')](this));this[_0xb0fc('0x4')]['on'](_0xb0fc('0xd'),this[_0xb0fc('0xe')][_0xb0fc('0xa')](this));};Beepall[_0xb0fc('0xf')][_0xb0fc('0x8')]=function(){this[_0xb0fc('0x4')][_0xb0fc('0x8')](this['handleRun'][_0xb0fc('0xa')](this),this['handleTimeout']['bind'](this));};Beepall[_0xb0fc('0xf')][_0xb0fc('0xe')]=function(){this[_0xb0fc('0xb')](!![]);};Beepall[_0xb0fc('0xf')][_0xb0fc('0x9')]=function(){var _0x3fae20=!![];if(!_[_0xb0fc('0x10')](this[_0xb0fc('0x5')])&&!_[_0xb0fc('0x10')](this[_0xb0fc('0x5')][_0xb0fc('0x11')])&&this['queue'][_0xb0fc('0x11')][_0xb0fc('0x12')]>0x0){for(var _0x2a54e9=0x0,_0x25335a;_0x2a54e90x0){for(var _0x3f8dfc=0x0,_0x1e44b6;_0x3f8dfc0x0&&_0x58d600[_0x2843b1+_0xe019('0x23')]>=_0x58d600[_0x2843b1+'Capacity']){writeLog(_0x271537,_0x58d600,_0x2843b1[_0xe019('0x25')]()+_0xe019('0x26'));return![];}}return!![];};exports[_0xe019('0x27')]=function(_0x3ff102,_0x40e724,_0x4feb55,_0x2493cb,_0x306419){return sendNotification(!![],_0x3ff102,_0x40e724,_0x4feb55,_0x2493cb,_0x306419);};exports[_0xe019('0x28')]=function(_0x5d55e0,_0x16b401,_0x35a57c,_0x315ea2,_0x183ee8){return sendNotification(![],_0x5d55e0,_0x16b401,_0x35a57c,_0x315ea2,_0x183ee8);};exports[_0xe019('0x29')]=function(_0x285917,_0x488ca2,_0x3eb6cc){var _0x215453=_0x488ca2[_0xe019('0x2a')][_0xe019('0x2b')];if(!_0x215453&&_0x3eb6cc){_0x215453=_0x3eb6cc['id'];}var _0x19cca3=_[_0xe019('0x2c')](_0x285917[_0x488ca2[_0xe019('0x2d')]+'QueuesWaitingInteractions'],function(_0x5075ba){var _0x4f0b8f=_[_0xe019('0x2e')](_0x488ca2[_0xe019('0x2d')])+_0xe019('0x2f');return _0x5075ba[_0x4f0b8f]===_0x488ca2['interaction']['id'];});if(!_0x19cca3&&_0x215453){_0x19cca3=_[_0xe019('0x2c')](_0x285917['agents'][_0x215453][_0x488ca2['channel']+_0xe019('0x30')],function(_0xa80eab){return _0xa80eab['id']===_0x488ca2[_0xe019('0x2a')]['id'];});}return _0x19cca3;};exports[_0xe019('0x31')]=function(_0x558a52,_0x5b11fe,_0x2012b4,_0x4fb4e6){_0x558a52[_0xe019('0x32')][_0x2012b4['id']][_0x4fb4e6+'WaitingInteractions'][_0x5b11fe[_0xe019('0x15')]['id']]={'id':_0x5b11fe['interaction']['id']};};exports['removeWaitingNotification']=function(_0x505d8b,_0x3c1400,_0x24dc33,_0x30ed30){delete _0x505d8b['agents'][_0x24dc33['id']][_0x30ed30+_0xe019('0x30')][_0x3c1400[_0xe019('0x15')]['id']];};exports[_0xe019('0x33')]=writeLog; \ No newline at end of file +var _0x8e4e=['../../../../../config/logger','redis','defaults','format','user:%s','name','user:save','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','message','notification:%s','save','remove','isAgentAvailable','BUSY','online','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','hideNotification','UserId','some','channel','InteractionId','WaitingInteractions','interaction','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment'];(function(_0x5ca01f,_0x523028){var _0x2ed455=function(_0xf1ae5a){while(--_0xf1ae5a){_0x5ca01f['push'](_0x5ca01f['shift']());}};_0x2ed455(++_0x523028);}(_0x8e4e,0x1d4));var _0xe8e4=function(_0x590cb2,_0x138ebc){_0x590cb2=_0x590cb2-0x0;var _0x3263a2=_0x8e4e[_0x590cb2];return _0x3263a2;};'use strict';var _=require(_0xe8e4('0x0'));var util=require(_0xe8e4('0x1'));var utils=require(_0xe8e4('0x2'));var Redis=require(_0xe8e4('0x3'));var config=require(_0xe8e4('0x4'));var logger=require(_0xe8e4('0x5'))('routing');config[_0xe8e4('0x6')]=_[_0xe8e4('0x7')](config[_0xe8e4('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0xb18020,_0x2539b2,_0x4d9334,_0x2d113d,_0x568717,_0x19d81b){io['to'](util[_0xe8e4('0x8')](_0xe8e4('0x9'),_0x2d113d[_0xe8e4('0xa')]))['emit'](_0xe8e4('0xb'),_0x2d113d);var _0x14f0b6=_0x19d81b||{};var _0x1a392e=_0x4d9334['split']('.');var _0x53230e={'uniqueid':_0x2539b2,'channel':_0x1a392e[0x0],'id':_0x1a392e[0x1],'title':_0x1a392e[0x0]+'\x20interaction','interactionId':_0x1a392e[0x2],'queue':_0x568717?_0x568717['name']:null,'sound':_0x14f0b6[_0xe8e4('0xc')][_0xe8e4('0xd')],'shake':_0x14f0b6[_0xe8e4('0xc')][_0xe8e4('0xe')]};try{if(!_0x14f0b6[_0xe8e4('0xf')]){_0x14f0b6['body']={};}if(_0x568717){_0x14f0b6[_0xe8e4('0xf')][_0xe8e4('0x10')]=_0x568717;}else if(_0x14f0b6[_0xe8e4('0xf')][_0xe8e4('0x10')]){delete _0x14f0b6[_0xe8e4('0xf')][_0xe8e4('0x10')];}_0x53230e[_0xe8e4('0x11')]=utils[_0xe8e4('0x12')](_0x14f0b6[_0xe8e4('0xc')]['notificationTemplate'],_0x14f0b6);}catch(_0x1c7a47){_0x53230e['msg']=_0xe8e4('0x13');logger['error'](util[_0xe8e4('0x8')]('[%s][QUEUE]\x20%s',_0x2539b2,_0x1c7a47[_0xe8e4('0x14')]));}io['to'](util[_0xe8e4('0x8')]('user:%s',_0x2d113d[_0xe8e4('0xa')]))['emit'](util[_0xe8e4('0x8')](_0xe8e4('0x15'),_0xb18020?_0xe8e4('0x16'):_0xe8e4('0x17')),_0x53230e);}function writeLog(_0x1a2e04,_0x2bca4a,_0x595240){return logger['debug'](util[_0xe8e4('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1a2e04,_0x2bca4a[_0xe8e4('0xa')],_0x595240));}exports[_0xe8e4('0x18')]=function(_0x31522c,_0x1e5676,_0x2e327f,_0x40eabd){if(_0x1e5676['busy']){writeLog(_0x31522c,_0x1e5676,_0xe8e4('0x19'));return![];}if(!_0x1e5676[_0xe8e4('0x1a')]){writeLog(_0x31522c,_0x1e5676,'OFFLINE');return![];}if(_0x1e5676[_0x2e327f+_0xe8e4('0x1b')]){writeLog(_0x31522c,_0x1e5676,_0xe8e4('0x1c'));return![];}if(_0x40eabd&&_0x1e5676[_0xe8e4('0x1d')](_0x2e327f+'Capacity')&&_0x1e5676['hasOwnProperty'](_0x2e327f+_0xe8e4('0x1e'))){if(_0x1e5676[_0x2e327f+'Capacity']>0x0&&_0x1e5676[_0x2e327f+_0xe8e4('0x1e')]>=_0x1e5676[_0x2e327f+_0xe8e4('0x1f')]){writeLog(_0x31522c,_0x1e5676,_0x2e327f['toUpperCase']()+_0xe8e4('0x20'));return![];}}return!![];};exports['showNotification']=function(_0x414fd2,_0x5eb587,_0x2cbe9b,_0xc60d18,_0x1518c3){return sendNotification(!![],_0x414fd2,_0x5eb587,_0x2cbe9b,_0xc60d18,_0x1518c3);};exports[_0xe8e4('0x21')]=function(_0x5f4e27,_0x4976d5,_0x28aaa1,_0x412113,_0x316c39){return sendNotification(![],_0x5f4e27,_0x4976d5,_0x28aaa1,_0x412113,_0x316c39);};exports['checkWaitingNotifications']=function(_0x565f48,_0xdaccf6,_0x46dc47){var _0x1e7ac7=_0xdaccf6['interaction'][_0xe8e4('0x22')];if(!_0x1e7ac7&&_0x46dc47){_0x1e7ac7=_0x46dc47['id'];}var _0x171d7d=_[_0xe8e4('0x23')](_0x565f48[_0xdaccf6[_0xe8e4('0x24')]+'QueuesWaitingInteractions'],function(_0x162a49){var _0x1602f1=_['capitalize'](_0xdaccf6['channel'])+_0xe8e4('0x25');return _0x162a49[_0x1602f1]===_0xdaccf6['interaction']['id'];});if(!_0x171d7d&&_0x1e7ac7){_0x171d7d=_['some'](_0x565f48['agents'][_0x1e7ac7][_0xdaccf6[_0xe8e4('0x24')]+_0xe8e4('0x26')],function(_0x174bff){return _0x174bff['id']===_0xdaccf6[_0xe8e4('0x27')]['id'];});}return _0x171d7d;};exports[_0xe8e4('0x28')]=function(_0x1ba4e1,_0x4f8378,_0x550b25,_0x3f2c4d){_0x1ba4e1['agents'][_0x550b25['id']][_0x3f2c4d+_0xe8e4('0x26')][_0x4f8378[_0xe8e4('0x14')]['id']]={'id':_0x4f8378['interaction']['id']};};exports[_0xe8e4('0x29')]=function(_0x1d05cd,_0x5d0fce,_0xd976aa,_0x1a5549){delete _0x1d05cd['agents'][_0xd976aa['id']][_0x1a5549+'WaitingInteractions'][_0x5d0fce['message']['id']];};exports[_0xe8e4('0x2a')]=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 eebc65f..18cc533 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 _0xd319=['isObject','stringify','validate','shelljs','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error'];(function(_0x1a6a02,_0x1c090f){var _0x3b19f5=function(_0x4b8d69){while(--_0x4b8d69){_0x1a6a02['push'](_0x1a6a02['shift']());}};_0x3b19f5(++_0x1c090f);}(_0xd319,0x12e));var _0x9d31=function(_0x366a38,_0x3f9c95){_0x366a38=_0x366a38-0x0;var _0x35dbc0=_0xd319[_0x366a38];return _0x35dbc0;};'use strict';var schema=require(_0x9d31('0x0'));var sh=require(_0x9d31('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9d31('0x2'));var system=schema({'command':{'type':_0x9d31('0x3'),'required':!![],'message':_0x9d31('0x4')}});exports[_0x9d31('0x5')]=function(_0x65efb6,_0x3917ec){return function(_0x5ed79f){try{var _0x8ce2bd={'command':_0x3917ec[0x0]};var _0x13fdb1=system[_0x9d31('0x0')](_0x8ce2bd,{'typecast':!![]});if(_0x13fdb1[_0x9d31('0x6')]){logger['error'](_0x9d31('0x7'),_0x65efb6,_[_0x9d31('0x8')](_0x13fdb1,_0x9d31('0x9'))[_0x9d31('0xa')](',\x20'));logger[_0x9d31('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x65efb6);_0x5ed79f['next']();}else{var _0x3341e9=this;var _0x4177d5=utils['getMustacheRender'](_0x3917ec[0x0],this);logger[_0x9d31('0xb')](_0x9d31('0xc'),_0x65efb6,_0x4177d5);sh[_0x9d31('0xd')](_['trim'](_0x4177d5),function(_0x27b887,_0x30eb63){logger[_0x9d31('0xb')](_0x9d31('0xe'),_0x65efb6,_0x27b887);if(_0x27b887==0x0){var _0x7ef70=_0x30eb63[_0x9d31('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x9d31('0x10')](_0x3917ec[0x1])||_[_0x9d31('0x11')](_0x3917ec[0x1])){logger[_0x9d31('0xb')](_0x9d31('0x12'),_0x65efb6);_0x3341e9[_0x9d31('0x13')][_0x3917ec[0x1]]=_0x7ef70;}else{logger[_0x9d31('0xb')](_0x9d31('0x14'),_0x65efb6,_0x3917ec[0x1],_0x7ef70);_0x3341e9[_0x9d31('0x13')][_0x3917ec[0x1]]=_0x7ef70;}}_0x5ed79f[_0x9d31('0x15')]();});}}catch(_0x22be20){logger[_0x9d31('0x16')](_0x9d31('0x7'),_0x65efb6,_[_0x9d31('0x17')](_0x22be20)?JSON[_0x9d31('0x18')](_0x22be20):_0x22be20);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x65efb6);_0x5ed79f['next']();}};}; \ No newline at end of file +var _0x9751=['length','error','[%s][SYSTEM]\x20%s','message','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils','../../../../config/logger','string'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x9751,0x145));var _0x1975=function(_0x3d2f87,_0xa9f93a){_0x3d2f87=_0x3d2f87-0x0;var _0x45e78c=_0x9751[_0x3d2f87];return _0x45e78c;};'use strict';var schema=require(_0x1975('0x0'));var sh=require(_0x1975('0x1'));var _=require('lodash');var utils=require(_0x1975('0x2'));var logger=require(_0x1975('0x3'))('routing');var system=schema({'command':{'type':_0x1975('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x230ced,_0x2ef1c9){return function(_0x5a64b1){try{var _0x58150d={'command':_0x2ef1c9[0x0]};var _0x38e297=system[_0x1975('0x0')](_0x58150d,{'typecast':!![]});if(_0x38e297[_0x1975('0x5')]){logger[_0x1975('0x6')](_0x1975('0x7'),_0x230ced,_['map'](_0x38e297,_0x1975('0x8'))[_0x1975('0x9')](',\x20'));logger[_0x1975('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x230ced);_0x5a64b1[_0x1975('0xb')]();}else{var _0x24ea5e=this;var _0x1e4dfa=utils['getMustacheRender'](_0x2ef1c9[0x0],this);logger['info'](_0x1975('0xc'),_0x230ced,_0x1e4dfa);sh['exec'](_['trim'](_0x1e4dfa),function(_0x3e6913,_0x3090b7){logger[_0x1975('0xa')](_0x1975('0xd'),_0x230ced,_0x3e6913);if(_0x3e6913==0x0){var _0x4e8a1e=_0x3090b7[_0x1975('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0x1975('0xf')](_0x2ef1c9[0x1])||_[_0x1975('0x10')](_0x2ef1c9[0x1])){logger['info'](_0x1975('0x11'),_0x230ced);_0x24ea5e[_0x1975('0x12')][_0x2ef1c9[0x1]]=_0x4e8a1e;}else{logger[_0x1975('0xa')](_0x1975('0x13'),_0x230ced,_0x2ef1c9[0x1],_0x4e8a1e);_0x24ea5e[_0x1975('0x12')][_0x2ef1c9[0x1]]=_0x4e8a1e;}}_0x5a64b1[_0x1975('0xb')]();});}}catch(_0x4b62db){logger[_0x1975('0x6')](_0x1975('0x7'),_0x230ced,_['isObject'](_0x4b62db)?JSON[_0x1975('0x14')](_0x4b62db):_0x4b62db);logger[_0x1975('0xa')](_0x1975('0x15'),_0x230ced);_0x5a64b1[_0x1975('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index c83968d..491f615 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 _0xf2f0=['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/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x1fe23e,_0x588a40){var _0x36a1ca=function(_0x12d4ff){while(--_0x12d4ff){_0x1fe23e['push'](_0x1fe23e['shift']());}};_0x36a1ca(++_0x588a40);}(_0xf2f0,0xb1));var _0x0f2f=function(_0x3c8d6c,_0x51ae3a){_0x3c8d6c=_0x3c8d6c-0x0;var _0x146521=_0xf2f0[_0x3c8d6c];return _0x146521;};'use strict';var schema=require(_0x0f2f('0x0'));var _=require(_0x0f2f('0x1'));var rpc={'chatInteraction':require(_0x0f2f('0x2')),'openchannelInteraction':require(_0x0f2f('0x3')),'smsInteraction':require(_0x0f2f('0x4')),'mailInteraction':require(_0x0f2f('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x0f2f('0x6'))(_0x0f2f('0x7'));var tag=schema({'tag':{'type':_0x0f2f('0x8'),'required':!![],'message':_0x0f2f('0x9')}});exports[_0x0f2f('0xa')]=function(_0x4a7d2e,_0x1bcfb9,_0x55ba6b,_0x5133dc){return function(_0x4db5e1){try{var _0x3c571b={'tag':_0x1bcfb9[0x0]};var _0x16e638=tag[_0x0f2f('0x0')](_0x3c571b,{'typecast':!![]});if(_0x16e638[_0x0f2f('0xb')]){logger['error'](_0x0f2f('0xc'),_0x4a7d2e,_[_0x0f2f('0xd')](_0x16e638,_0x0f2f('0xe'))['join'](',\x20'));logger[_0x0f2f('0xf')](_0x0f2f('0x10'),_0x4a7d2e);_0x4db5e1[_0x0f2f('0x11')]();}else{var _0xf77ef={'ids':[_0x1bcfb9[0x0]]};if(rpc[_0x5133dc[_0x0f2f('0x12')]+_0x0f2f('0x13')]){rpc[_0x5133dc[_0x0f2f('0x12')]+_0x0f2f('0x13')][_0x0f2f('0x14')](_0x5133dc[_0x0f2f('0x15')]['id'],_0xf77ef)[_0x0f2f('0x16')](function(_0x416b24){logger['info'](_0x0f2f('0x17'),_0x4a7d2e,_0x1bcfb9[0x1],_0x5133dc[_0x0f2f('0x12')],_0x5133dc['interaction']['id']);})[_0x0f2f('0x18')](function(_0x10f24f){logger['error'](_0x0f2f('0xc'),_0x4a7d2e,JSON[_0x0f2f('0x19')](_0x10f24f));logger[_0x0f2f('0xf')](_0x0f2f('0x10'),_0x4a7d2e);})[_0x0f2f('0x1a')](function(){_0x4db5e1[_0x0f2f('0x11')]();});}}}catch(_0x22acbf){logger['error']('[%s][TAG]\x20%s',_0x4a7d2e,_[_0x0f2f('0x1b')](_0x22acbf)?JSON['stringify'](_0x22acbf):_0x22acbf);logger[_0x0f2f('0xf')](_0x0f2f('0x10'),_0x4a7d2e);_0x4db5e1[_0x0f2f('0x11')]();}};}; \ No newline at end of file +var _0xfead=['finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','map','message','join','info','next','Interaction','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xfead,0x18b));var _0xdfea=function(_0x22d76c,_0x1feded){_0x22d76c=_0x22d76c-0x0;var _0x9cc8fb=_0xfead[_0x22d76c];return _0x9cc8fb;};'use strict';var schema=require(_0xdfea('0x0'));var _=require(_0xdfea('0x1'));var rpc={'chatInteraction':require(_0xdfea('0x2')),'openchannelInteraction':require(_0xdfea('0x3')),'smsInteraction':require(_0xdfea('0x4')),'mailInteraction':require(_0xdfea('0x5')),'faxInteraction':require(_0xdfea('0x6')),'whatsappInteraction':require(_0xdfea('0x7'))};var logger=require(_0xdfea('0x8'))('routing');var tag=schema({'tag':{'type':_0xdfea('0x9'),'required':!![],'message':_0xdfea('0xa')}});exports['consequence']=function(_0x4e1335,_0x3ac340,_0x3a0643,_0x5192aa){return function(_0x2b32ff){try{var _0x3baea4={'tag':_0x3ac340[0x0]};var _0x2a17eb=tag['validate'](_0x3baea4,{'typecast':!![]});if(_0x2a17eb['length']){logger[_0xdfea('0xb')]('[%s][TAG]\x20%s',_0x4e1335,_[_0xdfea('0xc')](_0x2a17eb,_0xdfea('0xd'))[_0xdfea('0xe')](',\x20'));logger[_0xdfea('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4e1335);_0x2b32ff[_0xdfea('0x10')]();}else{var _0x49064f={'ids':[_0x3ac340[0x0]]};if(rpc[_0x5192aa['channel']+_0xdfea('0x11')]){rpc[_0x5192aa[_0xdfea('0x12')]+_0xdfea('0x11')]['addTags'](_0x5192aa[_0xdfea('0x13')]['id'],_0x49064f)[_0xdfea('0x14')](function(_0x3fc54d){logger[_0xdfea('0xf')](_0xdfea('0x15'),_0x4e1335,_0x3ac340[0x1],_0x5192aa[_0xdfea('0x12')],_0x5192aa[_0xdfea('0x13')]['id']);})[_0xdfea('0x16')](function(_0x5b2c7d){logger[_0xdfea('0xb')](_0xdfea('0x17'),_0x4e1335,JSON['stringify'](_0x5b2c7d));logger[_0xdfea('0xf')](_0xdfea('0x18'),_0x4e1335);})[_0xdfea('0x19')](function(){_0x2b32ff[_0xdfea('0x10')]();});}}}catch(_0x1901d0){logger['error'](_0xdfea('0x17'),_0x4e1335,_[_0xdfea('0x1a')](_0x1901d0)?JSON[_0xdfea('0x1b')](_0x1901d0):_0x1901d0);logger[_0xdfea('0xf')](_0xdfea('0x18'),_0x4e1335);_0x2b32ff['next']();}};}; \ 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 d4a12b9..50fea2f 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 _0x3669=['result','logged','&serviceId=','&sessionId=','&data=','info','stop','next','request-promise','../../../../config/logger','replace','push','urlOnRing','?params=','title','jsonrpc','2.0','method','login','params','stringify','POST','application/json-rpc','then','parse'];(function(_0x1cd65a,_0x29fa8f){var _0xf93849=function(_0x29fbe1){while(--_0x29fbe1){_0x1cd65a['push'](_0x1cd65a['shift']());}};_0xf93849(++_0x29fa8f);}(_0x3669,0x166));var _0x9366=function(_0x1bc876,_0x1ebedb){_0x1bc876=_0x1bc876-0x0;var _0x38dcb1=_0x3669[_0x1bc876];return _0x38dcb1;};'use strict';var rp=require(_0x9366('0x0'));var logger=require(_0x9366('0x1'))('routing');var _=require('lodash');var arr=[];exports['consequence']=function(_0x5cf012,_0x29d4e1){return function(_0x213151){var _0x331ba0=_0x29d4e1[0xa];var _0x5c8b85=_0x29d4e1[0xb];var _0x440a57=_0x29d4e1[0xc];var _0x401bd9=_0x29d4e1[0xd];var _0x4abc52=_0x29d4e1[0xe];var _0x1acb9d=_0x29d4e1[0xf][_0x9366('0x2')](/\n/g,'\x20-\x20');var _0x5a1d2c=_0x29d4e1[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x5c8b85)){arr[_0x9366('0x3')](_0x5c8b85);var _0x3aa979=_0x29d4e1[0x3];var _0x327b1c=_0x29d4e1[0x4];var _0x2e0ec8=_0x29d4e1[0x1];var _0x1ce5a4=_0x29d4e1[0x0];var _0x37cb2c={};_0x37cb2c['urlOnAnswer']=_0x29d4e1[0x8]+'?params='+_0x440a57+'|'+_0x331ba0+'|'+_0x401bd9+'|'+_0x5c8b85+'|'+_0x4abc52;_0x37cb2c[_0x9366('0x4')]=_0x29d4e1[0x7]+_0x9366('0x5')+_0x440a57+'|'+_0x331ba0+'|'+_0x401bd9+'|'+_0x5c8b85+'|'+_0x4abc52+'|'+_0x1acb9d+'|'+_0x5a1d2c;_0x37cb2c[_0x9366('0x6')]=_0x29d4e1[0x9];var _0x32b8ac={};_0x32b8ac[_0x9366('0x7')]=_0x9366('0x8');_0x32b8ac[_0x9366('0x9')]=_0x9366('0xa');var _0x5019f8=[];_0x5019f8[_0x9366('0x3')](_0x29d4e1[0x2]);_0x5019f8[_0x9366('0x3')](_0x29d4e1[0x5]);_0x5019f8['push'](_0x29d4e1[0x6]);_0x32b8ac[_0x9366('0xb')]=_0x5019f8;_0x32b8ac['id']=0x1;var _0xfb85d5=JSON[_0x9366('0xc')](_0x32b8ac);var _0x45ea7d={'encoding':'utf8','method':_0x9366('0xd'),'timeout':0x2710,'url':_0x3aa979,'headers':{'Content-Type':_0x9366('0xe')},'body':_0xfb85d5};return rp(_0x45ea7d)[_0x9366('0xf')](function(_0x310c6b){const _0x1a81bf=JSON[_0x9366('0x10')](_0x310c6b);if(!_0x1a81bf[_0x9366('0x11')][_0x9366('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x5cec7c=_0x5c8b85;var _0x58c317='channelId='+_0x2e0ec8+_0x9366('0x13')+_0x1ce5a4+_0x9366('0x14')+_0x5cec7c+_0x9366('0x15')+JSON[_0x9366('0xc')](_0x37cb2c);var _0x376299=_0x327b1c+'?'+_0x58c317;return rp(_0x376299);})['then'](function(_0x3457eb){logger[_0x9366('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5cf012,_0x3457eb);_0x213151[_0x9366('0x17')]();})['catch'](function(_0x8821fe){logger['error']('[%s][TVOX]\x20%s',_0x5cf012,_['isObject'](_0x8821fe)?JSON[_0x9366('0xc')](_0x8821fe):_0x8821fe);_0x213151[_0x9366('0x17')]();});}else{logger[_0x9366('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5cf012);_0x213151[_0x9366('0x18')]();}};}; \ No newline at end of file +var _0x2f28=['jsonrpc','method','login','params','stringify','utf8','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title'];(function(_0x1d2e5e,_0x145ae6){var _0x4a1d68=function(_0x3dd5b6){while(--_0x3dd5b6){_0x1d2e5e['push'](_0x1d2e5e['shift']());}};_0x4a1d68(++_0x145ae6);}(_0x2f28,0xfd));var _0x82f2=function(_0x3134ed,_0xaf0de3){_0x3134ed=_0x3134ed-0x0;var _0x5b974f=_0x2f28[_0x3134ed];return _0x5b974f;};'use strict';var rp=require(_0x82f2('0x0'));var logger=require(_0x82f2('0x1'))(_0x82f2('0x2'));var _=require(_0x82f2('0x3'));var arr=[];exports['consequence']=function(_0x440906,_0x2d92a5){return function(_0x2cdf72){var _0x580a5d=_0x2d92a5[0xa];var _0x154295=_0x2d92a5[0xb];var _0x17ec1c=_0x2d92a5[0xc];var _0x45c1f9=_0x2d92a5[0xd];var _0x3f2377=_0x2d92a5[0xe];var _0x1c0f2e=_0x2d92a5[0xf][_0x82f2('0x4')](/\n/g,_0x82f2('0x5'));var _0x219d53=_0x2d92a5[0x10][_0x82f2('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x154295)){arr[_0x82f2('0x6')](_0x154295);var _0x311128=_0x2d92a5[0x3];var _0x1f06ab=_0x2d92a5[0x4];var _0xf574f6=_0x2d92a5[0x1];var _0x48eb99=_0x2d92a5[0x0];var _0x2983bd={};_0x2983bd[_0x82f2('0x7')]=_0x2d92a5[0x8]+_0x82f2('0x8')+_0x17ec1c+'|'+_0x580a5d+'|'+_0x45c1f9+'|'+_0x154295+'|'+_0x3f2377;_0x2983bd[_0x82f2('0x9')]=_0x2d92a5[0x7]+_0x82f2('0x8')+_0x17ec1c+'|'+_0x580a5d+'|'+_0x45c1f9+'|'+_0x154295+'|'+_0x3f2377+'|'+_0x1c0f2e+'|'+_0x219d53;_0x2983bd[_0x82f2('0xa')]=_0x2d92a5[0x9];var _0x2a5d69={};_0x2a5d69[_0x82f2('0xb')]='2.0';_0x2a5d69[_0x82f2('0xc')]=_0x82f2('0xd');var _0x26b729=[];_0x26b729['push'](_0x2d92a5[0x2]);_0x26b729[_0x82f2('0x6')](_0x2d92a5[0x5]);_0x26b729[_0x82f2('0x6')](_0x2d92a5[0x6]);_0x2a5d69[_0x82f2('0xe')]=_0x26b729;_0x2a5d69['id']=0x1;var _0x1a3bef=JSON[_0x82f2('0xf')](_0x2a5d69);var _0x7c2565={'encoding':_0x82f2('0x10'),'method':_0x82f2('0x11'),'timeout':0x2710,'url':_0x311128,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1a3bef};return rp(_0x7c2565)[_0x82f2('0x12')](function(_0x229f28){const _0x141b22=JSON[_0x82f2('0x13')](_0x229f28);if(!_0x141b22[_0x82f2('0x14')][_0x82f2('0x15')]){throw new Error(_0x82f2('0x16'));}var _0x5e995a=_0x154295;var _0x1fe495='channelId='+_0xf574f6+_0x82f2('0x17')+_0x48eb99+'&sessionId='+_0x5e995a+_0x82f2('0x18')+JSON[_0x82f2('0xf')](_0x2983bd);var _0x6dac5d=_0x1f06ab+'?'+_0x1fe495;return rp(_0x6dac5d);})[_0x82f2('0x12')](function(_0x5137f6){logger[_0x82f2('0x19')](_0x82f2('0x1a'),_0x440906,_0x5137f6);_0x2cdf72[_0x82f2('0x1b')]();})[_0x82f2('0x1c')](function(_0x175a08){logger[_0x82f2('0x1d')](_0x82f2('0x1e'),_0x440906,_[_0x82f2('0x1f')](_0x175a08)?JSON[_0x82f2('0xf')](_0x175a08):_0x175a08);_0x2cdf72[_0x82f2('0x1b')]();});}else{logger[_0x82f2('0x19')](_0x82f2('0x20'),_0x440906);_0x2cdf72['next']();}};}; \ 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 02348ba..dea66cd 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x343ee5,_0x2d44d1){var _0x106c96=function(_0x3079a0){while(--_0x3079a0){_0x343ee5['push'](_0x343ee5['shift']());}};_0x106c96(++_0x2d44d1);}(_0xe706,0xa3));var _0x6e70=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0xe706[_0x2af3e1];return _0xfa27d;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x5477c4,_0x274469){var _0x188261=function(_0x642d89){while(--_0x642d89){_0x5477c4['push'](_0x5477c4['shift']());}};_0x188261(++_0x274469);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 491cbed..94d780f 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 _0xb907=['emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','waiting','mailQueues','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','IntervalId','isNil','Intervals','map','listen','rules','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','.js','toLowerCase','split','channel','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','message','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty'];(function(_0x4c9dce,_0x5dde24){var _0x2dbfe7=function(_0x2e2ef0){while(--_0x2e2ef0){_0x4c9dce['push'](_0x4c9dce['shift']());}};_0x2dbfe7(++_0x5dde24);}(_0xb907,0x14e));var _0x7b90=function(_0x293f54,_0x311cf5){_0x293f54=_0x293f54-0x0;var _0x36cdb9=_0xb907[_0x293f54];return _0x36cdb9;};'use strict';var _=require(_0x7b90('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x7b90('0x1'));var BPromise=require(_0x7b90('0x2'));var utils=require(_0x7b90('0x3'));var sUtils=require(_0x7b90('0x4'));var logger=require(_0x7b90('0x5'))(_0x7b90('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x7b90('0x7')),'smsQueueReport':require(_0x7b90('0x8')),'faxQueueReport':require(_0x7b90('0x9')),'whatsappQueueReport':require(_0x7b90('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x440c16,_0x55fcf8,_0x1b5b46){return util[_0x7b90('0xb')]('%s.%s.%s',_0x440c16,_0x55fcf8||0x0,_0x1b5b46||0x0);}function getIntervals(_0x2a6d9d,_0x2f5456){var _0x4dd6b3=[];if(!_['isNil'](_0x2f5456[_0x7b90('0xc')])&&!_[_0x7b90('0xd')](_0x2a6d9d[_0x2f5456[_0x7b90('0xc')]])&&!_[_0x7b90('0xd')](_0x2a6d9d[_0x2f5456[_0x7b90('0xc')]][_0x7b90('0xe')])){_0x4dd6b3=_[_0x7b90('0xf')](_0x2a6d9d[_0x2f5456[_0x7b90('0xc')]]['Intervals'],'interval');}else if(!_[_0x7b90('0xd')](_0x2f5456['interval'])){_0x4dd6b3=[_0x2f5456['interval']];}return _0x4dd6b3;}exports[_0x7b90('0x10')]=function(_0x511655){_0x511655[_0x7b90('0x11')]={};return new BPromise(function(_0x5d7d19,_0x3efc71){var _0xf7395b={'Start':function(_0x23aa78){var _0x2c6f53=this;return new Promise(function(_0x3a4fae,_0x549e9f){if(_0x23aa78){try{var _0x4d2358=[];var _0x5eaa1f=getId(_0x23aa78['channel'],_0x23aa78['message']?_0x23aa78['message']['id']:0x0,_0x23aa78[_0x7b90('0x12')]?_0x23aa78[_0x7b90('0x12')]['id']:0x0);var _0x671cc=sUtils[_0x7b90('0x13')](_0x511655,_0x23aa78);if(!_0x671cc&&_0x23aa78[_0x7b90('0x14')]&&_[_0x7b90('0x15')](_0x23aa78[_0x7b90('0x14')])&&_0x23aa78[_0x7b90('0x14')]['length']){for(var _0xdeca45=0x0;_0xdeca45<_0x23aa78[_0x7b90('0x14')][_0x7b90('0x16')];_0xdeca45+=0x1){var _0x2467f=_0x23aa78['applications'][_0xdeca45];if(fs[_0x7b90('0x17')](path[_0x7b90('0x18')](__dirname,_0x7b90('0x14'),_0x2467f[_0x7b90('0x19')]+_0x7b90('0x1a')))){var _0x23b4ec=[];switch(_0x2467f['app'][_0x7b90('0x1b')]()){case'autoreply':var _0xc1ea5c=_0x2467f['appdata'][_0x7b90('0x1c')](',');if(_0x23aa78[_0x7b90('0x1d')]==='mail'){_0x23b4ec[_0x7b90('0x1e')](_0xc1ea5c[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0xc1ea5c[0x1]);_0x23b4ec[_0x7b90('0x1e')](_0xc1ea5c['slice'](0x2,_0xc1ea5c[_0x7b90('0x16')])[_0x7b90('0x18')](','));}else{_0x23b4ec['push'](_0xc1ea5c[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0xc1ea5c[_0x7b90('0x1f')](0x1,_0xc1ea5c['length'])[_0x7b90('0x18')](','));}break;case _0x7b90('0x20'):var _0x20ff69=_0x2467f[_0x7b90('0x21')][_0x7b90('0x1c')](',');_0x23b4ec[_0x7b90('0x1e')](_0x20ff69[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0x20ff69[0x1]);_0x23b4ec[_0x7b90('0x1e')](_0x20ff69[_0x7b90('0x1f')](0x2,_0x20ff69[_0x7b90('0x16')])[_0x7b90('0x18')](','));break;case _0x7b90('0x22'):var _0x586a2e=_0x2467f[_0x7b90('0x21')][_0x7b90('0x1c')](',');_0x23b4ec['push'](_0x586a2e[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0x586a2e[0x1]);_0x23b4ec[_0x7b90('0x1e')](_0x586a2e[0x2]);_0x23b4ec[_0x7b90('0x1e')](_0x586a2e[0x3]);_0x23b4ec[_0x7b90('0x1e')](_0x586a2e[_0x7b90('0x1f')](0x4,_0x586a2e[_0x7b90('0x16')])[_0x7b90('0x18')](','));break;case _0x7b90('0x23'):var _0x23b696=_0x2467f[_0x7b90('0x21')][_0x7b90('0x1c')](',');_0x23b4ec[_0x7b90('0x1e')](_0x23b696[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0x23b696[0x1]);_0x23b4ec['push'](_0x23b696[0x2]);_0x23b4ec[_0x7b90('0x1e')](_0x23b696[0x3]);_0x23b4ec[_0x7b90('0x1e')](_0x23b696[_0x7b90('0x1f')](0x4,_0x23b696[_0x7b90('0x16')])[_0x7b90('0x18')](','));break;case _0x7b90('0x24'):_0x23b4ec['push'](_0x2467f[_0x7b90('0x21')]);break;case'tag':_0x23b4ec[_0x7b90('0x1e')](_0x2467f['TagId']);_0x23b4ec[_0x7b90('0x1e')](_0x2467f[_0x7b90('0x21')]);break;case'tvox':var _0x53148f=utils['getMustacheRender'](_0x23aa78['account'][_0x7b90('0x25')],_0x23aa78);var _0xdb24c8=_0x2467f[_0x7b90('0x21')][_0x7b90('0x1c')](',');_0x23b4ec['push'](_0xdb24c8[0x0]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x1]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x2]);_0x23b4ec['push'](_0xdb24c8[0x3]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x4]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x5]);_0x23b4ec['push'](_0xdb24c8[0x6]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x7]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x8]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0x9]);_0x23b4ec[_0x7b90('0x1e')](_0xdb24c8[0xa]);_0x23b4ec[_0x7b90('0x1e')](_0x23aa78['interaction']['id']);_0x23b4ec[_0x7b90('0x1e')](_0x23aa78[_0x7b90('0x24')]['id']);_0x23b4ec['push'](_0x2467f[_0x7b90('0x26')]);_0x23b4ec[_0x7b90('0x1e')](_0x23aa78['interaction'][_0x7b90('0x27')]);_0x23b4ec[_0x7b90('0x1e')](_0x23aa78['body'][_0x7b90('0x28')]);_0x23b4ec[_0x7b90('0x1e')](_0x53148f);break;default:_0x23b4ec=_[_0x7b90('0xd')](_0x2467f[_0x7b90('0x21')])?[]:_0x2467f['appdata'][_0x7b90('0x1c')](',');}var _0x45509c={'id':util[_0x7b90('0xb')](_0x7b90('0x29'),_0x5eaa1f,_0x2467f['id'],_0x2467f[_0x7b90('0x19')]),'condition':require(_0x7b90('0x2a'))[_0x7b90('0x2b')](_0x5eaa1f,getIntervals(_0x511655['intervals'],_0x2467f),_0x511655),'consequence':require(_0x7b90('0x2c')+_0x2467f['app'])['consequence'](_0x5eaa1f,_0x23b4ec,_0x511655,_0x23aa78),'p':_0x2467f[_0x7b90('0x2d')]||0x0};logger[_0x7b90('0x2e')](_0x7b90('0x2f'),_0x45509c['id'],_0x7b90('0x30'),getIntervals(_0x511655[_0x7b90('0x31')],_0x2467f)[_0x7b90('0x18')](_0x7b90('0x32')));_0x4d2358['push'](_0x45509c);}else{logger['error'](_0x7b90('0x33'),path[_0x7b90('0x18')](__dirname,_0x7b90('0x14'),_0x2467f[_0x7b90('0x19')]+_0x7b90('0x1a')));}}_0x511655[_0x7b90('0x11')][_0x5eaa1f]=new RuleEngine(_0x4d2358);_0x511655[_0x7b90('0x11')][_0x5eaa1f][_0x7b90('0x34')](_0x23aa78,function(_0x4abddc){logger[_0x7b90('0x2e')]('Applications\x20executed',JSON['stringify'](_0x4abddc[_0x7b90('0x35')]));if(_0x511655[_0x7b90('0x11')][_0x5eaa1f]){_0x511655[_0x7b90('0x11')][_0x5eaa1f]['emit'](_0x7b90('0x36'));}});return _0x3a4fae({'code':0xc8,'message':_0x23aa78});}else{if(_0x671cc){logger[_0x7b90('0x2e')](util[_0x7b90('0xb')](_0x7b90('0x37'),_0x5eaa1f));}else{logger[_0x7b90('0x2e')](_0x7b90('0x38'));}return _0x3a4fae({'code':0xc8,'message':_0x23aa78});}}catch(_0x1e9f92){logger[_0x7b90('0x39')](_0x1e9f92[_0x7b90('0x3a')]);return _0x549e9f(_0x2c6f53[_0x7b90('0x39')](0x1f4,_0x1e9f92));}}return _0x549e9f(_0x7b90('0x3b'));});},'AcceptMessage':function(_0x494d45){var _0x1676b2=this;return new Promise(function(_0x12cfb7,_0x31ea20){if(_0x494d45[_0x7b90('0x3c')]&&_0x494d45[_0x7b90('0x3c')]['id']){if(_0x511655[_0x7b90('0x3d')][_0x494d45['agent']['id']]){_0x511655[_0x7b90('0x3d')][_0x494d45[_0x7b90('0x3c')]['id']][_0x7b90('0x3e')]=![];_0x511655[_0x7b90('0x3d')][_0x494d45[_0x7b90('0x3c')]['id']][_0x7b90('0x3f')]=undefined;}}if(_0x494d45[_0x7b90('0x24')]&&_0x494d45[_0x7b90('0x24')]['id']){try{var _0x342ccb=getId(_0x494d45[_0x7b90('0x1d')],_0x494d45[_0x7b90('0x24')]?_0x494d45[_0x7b90('0x24')]['id']:0x0,_0x494d45[_0x7b90('0x12')]?_0x494d45[_0x7b90('0x12')]['id']:0x0);if(_0x511655['rules'][_0x342ccb]){_0x511655['rules'][_0x342ccb]['emit'](_0x7b90('0x40'));if(rpc[_0x494d45[_0x7b90('0x1d')]+'QueueReport']){rpc[_0x494d45[_0x7b90('0x1d')]+_0x7b90('0x41')][_0x7b90('0x42')](_0x342ccb,{'UserId':_0x494d45[_0x7b90('0x24')][_0x7b90('0x43')]})['catch'](function(){logger[_0x7b90('0x39')](_0x7b90('0x44'));});}}return _0x12cfb7({'code':0xc8,'message':_0x494d45});}catch(_0x2fd3e0){logger[_0x7b90('0x39')](_0x2fd3e0[_0x7b90('0x3a')]);return _0x31ea20(_0x1676b2[_0x7b90('0x39')](0x1f4,_0x2fd3e0));}}logger[_0x7b90('0x39')](_0x7b90('0x45'));return _0x31ea20(_0x1676b2[_0x7b90('0x39')](0x1f4,_0x7b90('0x45')));});},'RejectMessage':function(_0x2215ce){var _0x4516e7=this;return new Promise(function(_0x435696,_0xc8cd2c){if(_0x2215ce['agent']&&_0x2215ce[_0x7b90('0x3c')]['id']){try{if(_0x511655[_0x7b90('0x3d')][_0x2215ce[_0x7b90('0x3c')]['id']]){_0x511655[_0x7b90('0x3d')][_0x2215ce['agent']['id']]['busy']=![];_0x511655['agents'][_0x2215ce['agent']['id']][_0x7b90('0x3f')]=undefined;}return _0x435696({'code':0xc8,'message':_0x2215ce});}catch(_0x3f08eb){logger['error'](_0x3f08eb['stack']);return _0xc8cd2c(_0x4516e7[_0x7b90('0x39')](0x1f4,_0x3f08eb));}}logger[_0x7b90('0x39')](_0x7b90('0x45'));return _0xc8cd2c(_0x4516e7['error'](0x1f4,_0x7b90('0x45')));});},'AbandonInteraction':function(_0x547622){var _0x249813=this;return new Promise(function(_0x3e4b60,_0x4eda0f){if(_0x547622['channel']&&_0x547622[_0x7b90('0x12')]&&_0x547622[_0x7b90('0x12')]['id']){try{var _0x37654b=getId(_0x547622['channel'],_0x547622['message']?_0x547622[_0x7b90('0x24')]['id']:0x0,_0x547622[_0x7b90('0x12')]?_0x547622[_0x7b90('0x12')]['id']:0x0);if(_0x511655['rules'][_0x37654b]){_0x511655[_0x7b90('0x11')][_0x37654b][_0x7b90('0x46')](_0x7b90('0x40'));}return _0x3e4b60({'code':0xc8,'message':_0x547622});}catch(_0x1a4e15){logger[_0x7b90('0x39')](_0x1a4e15[_0x7b90('0x3a')]);return _0x4eda0f(_0x249813[_0x7b90('0x39')](0x1f4,_0x1a4e15));}}logger['error'](_0x7b90('0x45'));return _0x4eda0f(_0x249813[_0x7b90('0x39')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x193c73){var _0xda9ba=this;return new Promise(function(_0x3ccf6c,_0x17950a){if(_0x511655['agents'][_0x7b90('0x47')](_0x193c73['id'])){for(var _0x4d74d9 in _0x193c73[_0x7b90('0x48')]){if(_0x193c73['capacity'][_0x7b90('0x47')](_0x4d74d9)){if(_0x511655[_0x7b90('0x3d')][_0x193c73['id']][_0x7b90('0x47')](_0x4d74d9+'CurrentCapacity')){_0x511655['agents'][_0x193c73['id']][_0x4d74d9+_0x7b90('0x49')]=parseInt(_0x193c73[_0x7b90('0x48')][_0x4d74d9],0xa);}}}_0x511655[_0x7b90('0x3d')][_0x193c73['id']][_0x7b90('0x4a')]();return _0x3ccf6c({'code':0xc8,'message':_0x511655[_0x7b90('0x3d')][_0x193c73['id']]});}else{return _0x17950a(_0xda9ba[_0x7b90('0x39')](0x1f4,_0x7b90('0x4b')));}});},'Agents':function(_0x5c2973){return new Promise(function(_0x122f1c){var _0x128a77=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x3d')]);if(_0x5c2973&&_0x5c2973['id']){var _0x11f0c9=_[_0x7b90('0x4d')](_0x128a77,function(_0x57345a){return _0x57345a['id']===_0x5c2973['id'];});_0x122f1c(_0x11f0c9);}else{_0x122f1c({'count':_0x128a77[_0x7b90('0x16')],'rows':_0x128a77});}});},'ChatQueues':function(){return new Promise(function(_0x3991cb){var _0x470da1=[];for(var _0x58de70 in _0x511655[_0x7b90('0x4e')]){if(_0x511655[_0x7b90('0x4e')][_0x7b90('0x47')](_0x58de70)){var _0x38a830=_0x511655['chatQueues'][_0x58de70];var _0x527392={'id':_0x38a830['id'],'available':_0x38a830[_0x7b90('0x4f')],'loggedIn':_0x38a830[_0x7b90('0x50')],'name':_0x38a830['name'],'paused':_0x38a830['paused'],'waiting':_0x38a830[_0x7b90('0x51')]};_0x470da1[_0x7b90('0x1e')](_0x527392);}}_0x3991cb({'count':_0x470da1[_0x7b90('0x16')],'rows':_0x470da1});});},'MailQueues':function(){return new Promise(function(_0x505b1a){var _0x2189af=[];for(var _0x43ef67 in _0x511655[_0x7b90('0x52')]){if(_0x511655[_0x7b90('0x52')]['hasOwnProperty'](_0x43ef67)){var _0x59ef57=_0x511655[_0x7b90('0x52')][_0x43ef67];var _0x41c332={'id':_0x59ef57['id'],'available':_0x59ef57['available'],'loggedIn':_0x59ef57['loggedIn'],'name':_0x59ef57[_0x7b90('0x53')],'paused':_0x59ef57[_0x7b90('0x54')],'waiting':_0x59ef57['waiting']};_0x2189af[_0x7b90('0x1e')](_0x41c332);}}_0x505b1a({'count':_0x2189af[_0x7b90('0x16')],'rows':_0x2189af});});},'OpenchannelQueues':function(){return new Promise(function(_0x32ed6f){var _0x38303b=[];for(var _0x342b0d in _0x511655['openchannelQueues']){if(_0x511655[_0x7b90('0x55')][_0x7b90('0x47')](_0x342b0d)){var _0x375bfa=_0x511655['openchannelQueues'][_0x342b0d];var _0x2273f1={'id':_0x375bfa['id'],'available':_0x375bfa[_0x7b90('0x4f')],'loggedIn':_0x375bfa[_0x7b90('0x50')],'name':_0x375bfa['name'],'paused':_0x375bfa[_0x7b90('0x54')],'waiting':_0x375bfa[_0x7b90('0x51')]};_0x38303b[_0x7b90('0x1e')](_0x2273f1);}}_0x32ed6f({'count':_0x38303b['length'],'rows':_0x38303b});});},'SmsQueues':function(){return new Promise(function(_0x2ed072){var _0x14fda0=[];for(var _0x14b7f6 in _0x511655[_0x7b90('0x56')]){if(_0x511655['smsQueues'][_0x7b90('0x47')](_0x14b7f6)){var _0x2a7fd3=_0x511655[_0x7b90('0x56')][_0x14b7f6];var _0x52808f={'id':_0x2a7fd3['id'],'available':_0x2a7fd3[_0x7b90('0x4f')],'loggedIn':_0x2a7fd3[_0x7b90('0x50')],'name':_0x2a7fd3[_0x7b90('0x53')],'paused':_0x2a7fd3[_0x7b90('0x54')],'waiting':_0x2a7fd3[_0x7b90('0x51')]};_0x14fda0['push'](_0x52808f);}}_0x2ed072({'count':_0x14fda0[_0x7b90('0x16')],'rows':_0x14fda0});});},'FaxQueues':function(){return new Promise(function(_0x6c5044){var _0x1cd9b9=[];for(var _0x30b8d9 in _0x511655[_0x7b90('0x57')]){if(_0x511655['faxQueues'][_0x7b90('0x47')](_0x30b8d9)){var _0x5ac4ee=_0x511655[_0x7b90('0x57')][_0x30b8d9];var _0x2cefc9={'id':_0x5ac4ee['id'],'available':_0x5ac4ee[_0x7b90('0x4f')],'loggedIn':_0x5ac4ee[_0x7b90('0x50')],'name':_0x5ac4ee[_0x7b90('0x53')],'paused':_0x5ac4ee[_0x7b90('0x54')],'waiting':_0x5ac4ee[_0x7b90('0x51')]};_0x1cd9b9[_0x7b90('0x1e')](_0x2cefc9);}}_0x6c5044({'count':_0x1cd9b9[_0x7b90('0x16')],'rows':_0x1cd9b9});});},'WhatsappQueues':function(){return new Promise(function(_0x3333fb){var _0x1b9c8c=[];for(var _0x22cc76 in _0x511655[_0x7b90('0x58')]){if(_0x511655[_0x7b90('0x58')][_0x7b90('0x47')](_0x22cc76)){var _0x59514a=_0x511655[_0x7b90('0x58')][_0x22cc76];var _0x26453f={'id':_0x59514a['id'],'available':_0x59514a[_0x7b90('0x4f')],'loggedIn':_0x59514a['loggedIn'],'name':_0x59514a[_0x7b90('0x53')],'paused':_0x59514a['paused'],'waiting':_0x59514a[_0x7b90('0x51')]};_0x1b9c8c[_0x7b90('0x1e')](_0x26453f);}}_0x3333fb({'count':_0x1b9c8c['length'],'rows':_0x1b9c8c});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x201f57){var _0x4b481b=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x59')]);_0x201f57({'count':_0x4b481b['length'],'rows':_0x4b481b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x306417){var _0x8b7406=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x5a')]);_0x306417({'count':_0x8b7406[_0x7b90('0x16')],'rows':_0x8b7406});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3993e6){var _0x34825b=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x5b')]);_0x3993e6({'count':_0x34825b[_0x7b90('0x16')],'rows':_0x34825b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x740e42){var _0x51d857=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x5c')]);_0x740e42({'count':_0x51d857[_0x7b90('0x16')],'rows':_0x51d857});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x467b1d){var _0x73b8a0=_[_0x7b90('0x4c')](_0x511655['faxQueuesWaitingInteractions']);_0x467b1d({'count':_0x73b8a0[_0x7b90('0x16')],'rows':_0x73b8a0});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5b4edf){var _0x388ee7=_[_0x7b90('0x4c')](_0x511655[_0x7b90('0x5d')]);_0x5b4edf({'count':_0x388ee7['length'],'rows':_0x388ee7});});}};var _0x3f8dd7=jayson[_0x7b90('0x5e')](_0xf7395b)[_0x7b90('0x5f')]();_0x3f8dd7['on']('error',function(_0xac9771){logger[_0x7b90('0x39')](JSON[_0x7b90('0x60')](_0xac9771));return _0x3efc71(_0xac9771);});_0x3f8dd7['listen'](0x232c,_0x7b90('0x61'),function(){console[_0x7b90('0x62')](_0x7b90('0x63'),0x232c);return _0x5d7d19(_0x7b90('0x64')+0x232c);});});}; \ No newline at end of file +var _0x5367=['Intervals','interval','channel','message','interaction','isArray','applications','existsSync','join','app','toLowerCase','appdata','mail','push','slice','length','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busy','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','find','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map'];(function(_0x2ae14b,_0x47446c){var _0x4a21a2=function(_0x24012e){while(--_0x24012e){_0x2ae14b['push'](_0x2ae14b['shift']());}};_0x4a21a2(++_0x47446c);}(_0x5367,0x187));var _0x7536=function(_0xe18f7c,_0x1b2fe7){_0xe18f7c=_0xe18f7c-0x0;var _0x34ef15=_0x5367[_0xe18f7c];return _0x34ef15;};'use strict';var _=require(_0x7536('0x0'));var util=require(_0x7536('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x7536('0x2'));var BPromise=require(_0x7536('0x3'));var utils=require(_0x7536('0x4'));var sUtils=require(_0x7536('0x5'));var logger=require(_0x7536('0x6'))(_0x7536('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7536('0x8')),'chatQueueReport':require(_0x7536('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x7536('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x7536('0xb'));function getId(_0x48ac11,_0x5a8198,_0x4b219b){return util[_0x7536('0xc')](_0x7536('0xd'),_0x48ac11,_0x5a8198||0x0,_0x4b219b||0x0);}function getIntervals(_0x8b4cad,_0x409f62){var _0x368195=[];if(!_['isNil'](_0x409f62[_0x7536('0xe')])&&!_[_0x7536('0xf')](_0x8b4cad[_0x409f62[_0x7536('0xe')]])&&!_[_0x7536('0xf')](_0x8b4cad[_0x409f62[_0x7536('0xe')]]['Intervals'])){_0x368195=_[_0x7536('0x10')](_0x8b4cad[_0x409f62[_0x7536('0xe')]][_0x7536('0x11')],'interval');}else if(!_[_0x7536('0xf')](_0x409f62[_0x7536('0x12')])){_0x368195=[_0x409f62[_0x7536('0x12')]];}return _0x368195;}exports['listen']=function(_0x3bc992){_0x3bc992['rules']={};return new BPromise(function(_0x2ff931,_0x45a3e0){var _0x34435f={'Start':function(_0xc14865){var _0x5b7e2b=this;return new Promise(function(_0xc68a5a,_0x29b27f){if(_0xc14865){try{var _0x3e8d56=[];var _0x1ac2a5=getId(_0xc14865[_0x7536('0x13')],_0xc14865[_0x7536('0x14')]?_0xc14865[_0x7536('0x14')]['id']:0x0,_0xc14865[_0x7536('0x15')]?_0xc14865[_0x7536('0x15')]['id']:0x0);var _0x5d1ae0=sUtils['checkWaitingNotifications'](_0x3bc992,_0xc14865);if(!_0x5d1ae0&&_0xc14865['applications']&&_[_0x7536('0x16')](_0xc14865[_0x7536('0x17')])&&_0xc14865[_0x7536('0x17')]['length']){for(var _0x35d23f=0x0;_0x35d23f<_0xc14865['applications']['length'];_0x35d23f+=0x1){var _0x670d1=_0xc14865[_0x7536('0x17')][_0x35d23f];if(fs[_0x7536('0x18')](path[_0x7536('0x19')](__dirname,_0x7536('0x17'),_0x670d1[_0x7536('0x1a')]+'.js'))){var _0xb55e58=[];switch(_0x670d1['app'][_0x7536('0x1b')]()){case'autoreply':var _0x34eb8f=_0x670d1[_0x7536('0x1c')]['split'](',');if(_0xc14865[_0x7536('0x13')]===_0x7536('0x1d')){_0xb55e58['push'](_0x34eb8f[0x0]);_0xb55e58[_0x7536('0x1e')](_0x34eb8f[0x1]);_0xb55e58[_0x7536('0x1e')](_0x34eb8f[_0x7536('0x1f')](0x2,_0x34eb8f[_0x7536('0x20')])['join'](','));}else{_0xb55e58['push'](_0x34eb8f[0x0]);_0xb55e58[_0x7536('0x1e')](_0x34eb8f[_0x7536('0x1f')](0x1,_0x34eb8f[_0x7536('0x20')])['join'](','));}break;case _0x7536('0x21'):var _0xf59500=_0x670d1[_0x7536('0x1c')][_0x7536('0x22')](',');_0xb55e58[_0x7536('0x1e')](_0xf59500[0x0]);_0xb55e58[_0x7536('0x1e')](_0xf59500[0x1]);_0xb55e58[_0x7536('0x1e')](_0xf59500[_0x7536('0x1f')](0x2,_0xf59500[_0x7536('0x20')])[_0x7536('0x19')](','));break;case _0x7536('0x23'):var _0x2a1e06=_0x670d1['appdata'][_0x7536('0x22')](',');_0xb55e58['push'](_0x2a1e06[0x0]);_0xb55e58[_0x7536('0x1e')](_0x2a1e06[0x1]);_0xb55e58[_0x7536('0x1e')](_0x2a1e06[0x2]);_0xb55e58['push'](_0x2a1e06[0x3]);_0xb55e58[_0x7536('0x1e')](_0x2a1e06[_0x7536('0x1f')](0x4,_0x2a1e06[_0x7536('0x20')])[_0x7536('0x19')](','));break;case _0x7536('0x24'):var _0x55a2e6=_0x670d1['appdata'][_0x7536('0x22')](',');_0xb55e58['push'](_0x55a2e6[0x0]);_0xb55e58['push'](_0x55a2e6[0x1]);_0xb55e58['push'](_0x55a2e6[0x2]);_0xb55e58[_0x7536('0x1e')](_0x55a2e6[0x3]);_0xb55e58[_0x7536('0x1e')](_0x55a2e6[_0x7536('0x1f')](0x4,_0x55a2e6[_0x7536('0x20')])[_0x7536('0x19')](','));break;case _0x7536('0x14'):_0xb55e58['push'](_0x670d1[_0x7536('0x1c')]);break;case _0x7536('0x25'):_0xb55e58['push'](_0x670d1[_0x7536('0x26')]);_0xb55e58[_0x7536('0x1e')](_0x670d1['appdata']);break;case _0x7536('0x27'):var _0xd122cf=utils['getMustacheRender'](_0xc14865[_0x7536('0x28')][_0x7536('0x29')],_0xc14865);var _0x4bfa73=_0x670d1['appdata'][_0x7536('0x22')](',');_0xb55e58['push'](_0x4bfa73[0x0]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x1]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x2]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x3]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x4]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x5]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x6]);_0xb55e58['push'](_0x4bfa73[0x7]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x8]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0x9]);_0xb55e58[_0x7536('0x1e')](_0x4bfa73[0xa]);_0xb55e58['push'](_0xc14865[_0x7536('0x15')]['id']);_0xb55e58['push'](_0xc14865[_0x7536('0x14')]['id']);_0xb55e58['push'](_0x670d1['ChatWebsiteId']);_0xb55e58[_0x7536('0x1e')](_0xc14865[_0x7536('0x15')][_0x7536('0x2a')]);_0xb55e58[_0x7536('0x1e')](_0xc14865[_0x7536('0x2b')][_0x7536('0x2b')]);_0xb55e58[_0x7536('0x1e')](_0xd122cf);break;default:_0xb55e58=_[_0x7536('0xf')](_0x670d1[_0x7536('0x1c')])?[]:_0x670d1[_0x7536('0x1c')]['split'](',');}var _0x55fb42={'id':util[_0x7536('0xc')]('%s:%s:%s',_0x1ac2a5,_0x670d1['id'],_0x670d1[_0x7536('0x1a')]),'condition':require(_0x7536('0x2c'))[_0x7536('0x2d')](_0x1ac2a5,getIntervals(_0x3bc992[_0x7536('0x2e')],_0x670d1),_0x3bc992),'consequence':require(_0x7536('0x2f')+_0x670d1['app'])[_0x7536('0x30')](_0x1ac2a5,_0xb55e58,_0x3bc992,_0xc14865),'p':_0x670d1[_0x7536('0x31')]||0x0};logger[_0x7536('0x32')](_0x7536('0x33'),_0x55fb42['id'],'on\x20interval',getIntervals(_0x3bc992[_0x7536('0x2e')],_0x670d1)['join']('\x20|\x20'));_0x3e8d56[_0x7536('0x1e')](_0x55fb42);}else{logger['error'](_0x7536('0x34'),path[_0x7536('0x19')](__dirname,_0x7536('0x17'),_0x670d1['app']+_0x7536('0x35')));}}_0x3bc992[_0x7536('0x36')][_0x1ac2a5]=new RuleEngine(_0x3e8d56);_0x3bc992[_0x7536('0x36')][_0x1ac2a5][_0x7536('0x37')](_0xc14865,function(_0x195720){logger[_0x7536('0x32')]('Applications\x20executed',JSON[_0x7536('0x38')](_0x195720[_0x7536('0x39')]));if(_0x3bc992[_0x7536('0x36')][_0x1ac2a5]){_0x3bc992[_0x7536('0x36')][_0x1ac2a5][_0x7536('0x3a')]('complete');}});return _0xc68a5a({'code':0xc8,'message':_0xc14865});}else{if(_0x5d1ae0){logger[_0x7536('0x32')](util[_0x7536('0xc')](_0x7536('0x3b'),_0x1ac2a5));}else{logger[_0x7536('0x32')](_0x7536('0x3c'));}return _0xc68a5a({'code':0xc8,'message':_0xc14865});}}catch(_0x3edab1){logger[_0x7536('0x3d')](_0x3edab1['stack']);return _0x29b27f(_0x5b7e2b[_0x7536('0x3d')](0x1f4,_0x3edab1));}}return _0x29b27f(_0x7536('0x3e'));});},'AcceptMessage':function(_0x1d9347){var _0x13477c=this;return new Promise(function(_0x2fc59f,_0xc233d0){if(_0x1d9347[_0x7536('0x3f')]&&_0x1d9347[_0x7536('0x3f')]['id']){if(_0x3bc992[_0x7536('0x40')][_0x1d9347[_0x7536('0x3f')]['id']]){_0x3bc992[_0x7536('0x40')][_0x1d9347[_0x7536('0x3f')]['id']]['busy']=![];_0x3bc992['agents'][_0x1d9347['agent']['id']][_0x7536('0x41')]=undefined;}}if(_0x1d9347[_0x7536('0x14')]&&_0x1d9347['message']['id']){try{var _0xd200c=getId(_0x1d9347[_0x7536('0x13')],_0x1d9347[_0x7536('0x14')]?_0x1d9347[_0x7536('0x14')]['id']:0x0,_0x1d9347[_0x7536('0x15')]?_0x1d9347[_0x7536('0x15')]['id']:0x0);if(_0x3bc992['rules'][_0xd200c]){_0x3bc992[_0x7536('0x36')][_0xd200c]['emit']('end');if(rpc[_0x1d9347[_0x7536('0x13')]+'QueueReport']){rpc[_0x1d9347[_0x7536('0x13')]+_0x7536('0x42')][_0x7536('0x43')](_0xd200c,{'UserId':_0x1d9347[_0x7536('0x14')][_0x7536('0x44')]})[_0x7536('0x45')](function(){logger['error'](_0x7536('0x46'));});}}return _0x2fc59f({'code':0xc8,'message':_0x1d9347});}catch(_0xd7fbf9){logger[_0x7536('0x3d')](_0xd7fbf9[_0x7536('0x47')]);return _0xc233d0(_0x13477c[_0x7536('0x3d')](0x1f4,_0xd7fbf9));}}logger[_0x7536('0x3d')](_0x7536('0x48'));return _0xc233d0(_0x13477c[_0x7536('0x3d')](0x1f4,_0x7536('0x48')));});},'RejectMessage':function(_0x3b49c3){var _0xabbf78=this;return new Promise(function(_0x170c40,_0x379f1f){if(_0x3b49c3[_0x7536('0x3f')]&&_0x3b49c3[_0x7536('0x3f')]['id']){try{if(_0x3bc992[_0x7536('0x40')][_0x3b49c3['agent']['id']]){_0x3bc992[_0x7536('0x40')][_0x3b49c3['agent']['id']][_0x7536('0x49')]=![];_0x3bc992['agents'][_0x3b49c3[_0x7536('0x3f')]['id']][_0x7536('0x41')]=undefined;}return _0x170c40({'code':0xc8,'message':_0x3b49c3});}catch(_0x11e93b){logger[_0x7536('0x3d')](_0x11e93b['stack']);return _0x379f1f(_0xabbf78[_0x7536('0x3d')](0x1f4,_0x11e93b));}}logger[_0x7536('0x3d')](_0x7536('0x48'));return _0x379f1f(_0xabbf78['error'](0x1f4,_0x7536('0x48')));});},'AbandonInteraction':function(_0x2336f6){var _0x745e15=this;return new Promise(function(_0x2f987f,_0x1a420b){if(_0x2336f6[_0x7536('0x13')]&&_0x2336f6['interaction']&&_0x2336f6[_0x7536('0x15')]['id']){try{var _0x231f21=getId(_0x2336f6['channel'],_0x2336f6[_0x7536('0x14')]?_0x2336f6['message']['id']:0x0,_0x2336f6[_0x7536('0x15')]?_0x2336f6[_0x7536('0x15')]['id']:0x0);if(_0x3bc992[_0x7536('0x36')][_0x231f21]){_0x3bc992[_0x7536('0x36')][_0x231f21][_0x7536('0x3a')](_0x7536('0x4a'));}return _0x2f987f({'code':0xc8,'message':_0x2336f6});}catch(_0x578a3e){logger['error'](_0x578a3e[_0x7536('0x47')]);return _0x1a420b(_0x745e15[_0x7536('0x3d')](0x1f4,_0x578a3e));}}logger[_0x7536('0x3d')](_0x7536('0x48'));return _0x1a420b(_0x745e15['error'](0x1f4,_0x7536('0x48')));});},'AgentCapacity':function(_0x479537){var _0xcea9d8=this;return new Promise(function(_0x2d27f4,_0x393b85){if(_0x3bc992[_0x7536('0x40')]['hasOwnProperty'](_0x479537['id'])){for(var _0x2749b9 in _0x479537[_0x7536('0x4b')]){if(_0x479537[_0x7536('0x4b')][_0x7536('0x4c')](_0x2749b9)){if(_0x3bc992[_0x7536('0x40')][_0x479537['id']][_0x7536('0x4c')](_0x2749b9+_0x7536('0x4d'))){_0x3bc992[_0x7536('0x40')][_0x479537['id']][_0x2749b9+_0x7536('0x4d')]=parseInt(_0x479537[_0x7536('0x4b')][_0x2749b9],0xa);}}}_0x3bc992[_0x7536('0x40')][_0x479537['id']][_0x7536('0x4e')]();return _0x2d27f4({'code':0xc8,'message':_0x3bc992['agents'][_0x479537['id']]});}else{return _0x393b85(_0xcea9d8['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4155ee){return new Promise(function(_0x55b88a){var _0x4f31a6=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x40')]);if(_0x4155ee&&_0x4155ee['id']){var _0x560b4b=_[_0x7536('0x50')](_0x4f31a6,function(_0xff8e37){return _0xff8e37['id']===_0x4155ee['id'];});_0x55b88a(_0x560b4b);}else{_0x55b88a({'count':_0x4f31a6[_0x7536('0x20')],'rows':_0x4f31a6});}});},'ChatQueues':function(){return new Promise(function(_0x410c4f){var _0x17d1ca=[];for(var _0x54a82e in _0x3bc992[_0x7536('0x51')]){if(_0x3bc992['chatQueues'][_0x7536('0x4c')](_0x54a82e)){var _0x2b98c8=_0x3bc992[_0x7536('0x51')][_0x54a82e];var _0xde95c3={'id':_0x2b98c8['id'],'available':_0x2b98c8['available'],'loggedIn':_0x2b98c8[_0x7536('0x52')],'name':_0x2b98c8[_0x7536('0x53')],'paused':_0x2b98c8['paused'],'waiting':_0x2b98c8[_0x7536('0x54')]};_0x17d1ca['push'](_0xde95c3);}}_0x410c4f({'count':_0x17d1ca[_0x7536('0x20')],'rows':_0x17d1ca});});},'MailQueues':function(){return new Promise(function(_0x31f24c){var _0x4f437f=[];for(var _0x8ff34e in _0x3bc992[_0x7536('0x55')]){if(_0x3bc992[_0x7536('0x55')]['hasOwnProperty'](_0x8ff34e)){var _0x381317=_0x3bc992[_0x7536('0x55')][_0x8ff34e];var _0x150070={'id':_0x381317['id'],'available':_0x381317[_0x7536('0x56')],'loggedIn':_0x381317[_0x7536('0x52')],'name':_0x381317[_0x7536('0x53')],'paused':_0x381317[_0x7536('0x57')],'waiting':_0x381317['waiting']};_0x4f437f[_0x7536('0x1e')](_0x150070);}}_0x31f24c({'count':_0x4f437f['length'],'rows':_0x4f437f});});},'OpenchannelQueues':function(){return new Promise(function(_0x1fb3eb){var _0x981a47=[];for(var _0x51422d in _0x3bc992[_0x7536('0x58')]){if(_0x3bc992[_0x7536('0x58')][_0x7536('0x4c')](_0x51422d)){var _0x2300df=_0x3bc992['openchannelQueues'][_0x51422d];var _0x35ab4b={'id':_0x2300df['id'],'available':_0x2300df[_0x7536('0x56')],'loggedIn':_0x2300df['loggedIn'],'name':_0x2300df['name'],'paused':_0x2300df[_0x7536('0x57')],'waiting':_0x2300df[_0x7536('0x54')]};_0x981a47[_0x7536('0x1e')](_0x35ab4b);}}_0x1fb3eb({'count':_0x981a47[_0x7536('0x20')],'rows':_0x981a47});});},'SmsQueues':function(){return new Promise(function(_0x2d3226){var _0x345cd0=[];for(var _0x501210 in _0x3bc992[_0x7536('0x59')]){if(_0x3bc992['smsQueues'][_0x7536('0x4c')](_0x501210)){var _0x35f2d1=_0x3bc992[_0x7536('0x59')][_0x501210];var _0x79b995={'id':_0x35f2d1['id'],'available':_0x35f2d1['available'],'loggedIn':_0x35f2d1['loggedIn'],'name':_0x35f2d1[_0x7536('0x53')],'paused':_0x35f2d1['paused'],'waiting':_0x35f2d1['waiting']};_0x345cd0[_0x7536('0x1e')](_0x79b995);}}_0x2d3226({'count':_0x345cd0['length'],'rows':_0x345cd0});});},'FaxQueues':function(){return new Promise(function(_0x20b156){var _0x531045=[];for(var _0x1d373d in _0x3bc992[_0x7536('0x5a')]){if(_0x3bc992[_0x7536('0x5a')][_0x7536('0x4c')](_0x1d373d)){var _0x416f96=_0x3bc992[_0x7536('0x5a')][_0x1d373d];var _0x248b17={'id':_0x416f96['id'],'available':_0x416f96[_0x7536('0x56')],'loggedIn':_0x416f96[_0x7536('0x52')],'name':_0x416f96['name'],'paused':_0x416f96['paused'],'waiting':_0x416f96[_0x7536('0x54')]};_0x531045['push'](_0x248b17);}}_0x20b156({'count':_0x531045[_0x7536('0x20')],'rows':_0x531045});});},'WhatsappQueues':function(){return new Promise(function(_0x13732c){var _0x4d2221=[];for(var _0x538adb in _0x3bc992[_0x7536('0x5b')]){if(_0x3bc992[_0x7536('0x5b')]['hasOwnProperty'](_0x538adb)){var _0x530f1c=_0x3bc992[_0x7536('0x5b')][_0x538adb];var _0x357f24={'id':_0x530f1c['id'],'available':_0x530f1c[_0x7536('0x56')],'loggedIn':_0x530f1c['loggedIn'],'name':_0x530f1c[_0x7536('0x53')],'paused':_0x530f1c[_0x7536('0x57')],'waiting':_0x530f1c[_0x7536('0x54')]};_0x4d2221[_0x7536('0x1e')](_0x357f24);}}_0x13732c({'count':_0x4d2221[_0x7536('0x20')],'rows':_0x4d2221});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2485f1){var _0x4cc2d3=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x5c')]);_0x2485f1({'count':_0x4cc2d3['length'],'rows':_0x4cc2d3});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4221fe){var _0x28be7c=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x5d')]);_0x4221fe({'count':_0x28be7c[_0x7536('0x20')],'rows':_0x28be7c});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x31a997){var _0x596546=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x5e')]);_0x31a997({'count':_0x596546['length'],'rows':_0x596546});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4dc883){var _0x2f9024=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x5f')]);_0x4dc883({'count':_0x2f9024[_0x7536('0x20')],'rows':_0x2f9024});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x32e17c){var _0x3013dd=_[_0x7536('0x4f')](_0x3bc992[_0x7536('0x60')]);_0x32e17c({'count':_0x3013dd[_0x7536('0x20')],'rows':_0x3013dd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3a6bf5){var _0x5b7fd0=_[_0x7536('0x4f')](_0x3bc992['whatsappQueuesWaitingInteractions']);_0x3a6bf5({'count':_0x5b7fd0[_0x7536('0x20')],'rows':_0x5b7fd0});});}};var _0x48e846=jayson[_0x7536('0x61')](_0x34435f)['http']();_0x48e846['on'](_0x7536('0x3d'),function(_0x18c518){logger[_0x7536('0x3d')](JSON[_0x7536('0x38')](_0x18c518));return _0x45a3e0(_0x18c518);});_0x48e846[_0x7536('0x62')](0x232c,_0x7536('0x63'),function(){console['log'](_0x7536('0x64'),0x232c);return _0x2ff931(_0x7536('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 057a2f1..7fc1f5e 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 _0xd587=['true','catch','all','then','join','log','[%s][INTERVAL]\x20%s\x20%s','stack','bluebird','../../../config/logger','routing','http','request','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s'];(function(_0xaa4d4d,_0x20428d){var _0x56f6b8=function(_0x37b3bb){while(--_0x37b3bb){_0xaa4d4d['push'](_0xaa4d4d['shift']());}};_0x56f6b8(++_0x20428d);}(_0xd587,0xd0));var _0x7d58=function(_0x4f4d1e,_0x241493){_0x4f4d1e=_0x4f4d1e-0x0;var _0x40e4fd=_0xd587[_0x4f4d1e];return _0x40e4fd;};'use strict';var util=require('util');var BPromise=require(_0x7d58('0x0'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x7d58('0x1'))(_0x7d58('0x2'));var client=jayson['client'][_0x7d58('0x3')]({'port':0x232a});function request(_0x12ef86,_0x508824){return new BPromise(function(_0x2b7829,_0x2df1d1){return client[_0x7d58('0x4')](_0x12ef86,_0x508824)['then'](function(_0x42e612){if(_0x42e612[_0x7d58('0x5')]){return _0x2df1d1(_0x42e612['error'][_0x7d58('0x6')]);}else{return _0x2b7829(_0x42e612[_0x7d58('0x7')]);}})['catch'](function(_0x1b5986){return _0x2df1d1(_0x1b5986);});});}exports[_0x7d58('0x8')]=function(_0x3da7b9,_0x31f5cc,_0x43c73b){return function(_0x4bcedf){if(_0x43c73b[_0x7d58('0x9')]&&!_0x43c73b[_0x7d58('0x9')][_0x3da7b9]){logger[_0x7d58('0xa')](_0x7d58('0xb'),_0x3da7b9);return _0x4bcedf[_0x7d58('0xc')]();}var _0x3d280e=[];for(var _0x405dcb=0x0;_0x405dcb<_0x31f5cc['length'];_0x405dcb+=0x1){_0x3d280e[_0x7d58('0xd')](request(_0x7d58('0xe'),{'command':util[_0x7d58('0xf')](_0x7d58('0x10'),_0x31f5cc[_0x405dcb])})['then'](function(_0x23e072){return _0x23e072&&_0x23e072[_0x7d58('0x6')]&&_0x23e072[_0x7d58('0x6')]['indexOf'](_0x7d58('0x11'))>=0x0?!![]:![];})[_0x7d58('0x12')](function(_0x269431){logger[_0x7d58('0x5')]('[%s][INTERVAL]\x20%s',_0x3da7b9,_0x31f5cc[_0x405dcb]);}));}BPromise[_0x7d58('0x13')](_0x3d280e)[_0x7d58('0x14')](function(_0x5e06c2){var _0x2a1a6d=_['some'](_0x5e06c2);logger[_0x7d58('0xa')]('[%s][INTERVAL]\x20%s\x20%s',_0x3da7b9,_0x31f5cc[_0x7d58('0x15')]('\x20|\x20'),_0x2a1a6d);_0x4bcedf['when'](_0x2a1a6d);})[_0x7d58('0x12')](function(_0x185cf2){console[_0x7d58('0x16')](_0x185cf2);logger['error'](_0x7d58('0x17'),_0x3da7b9,_0x31f5cc[_0x7d58('0x15')]('\x20|\x20'),_0x185cf2[_0x7d58('0x18')]);_0x4bcedf[_0x7d58('0xc')]();});};}; \ No newline at end of file +var _0xba42=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','indexOf','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','util','bluebird','jayson/promise','../../../config/logger','client','http','request','then','error','message','result','catch','condition','rules'];(function(_0x292d59,_0x4c3328){var _0x1a89ea=function(_0x4baec7){while(--_0x4baec7){_0x292d59['push'](_0x292d59['shift']());}};_0x1a89ea(++_0x4c3328);}(_0xba42,0x15e));var _0x2ba4=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xba42[_0x10d670];return _0x20d6f8;};'use strict';var util=require(_0x2ba4('0x0'));var BPromise=require(_0x2ba4('0x1'));var jayson=require(_0x2ba4('0x2'));var _=require('lodash');var logger=require(_0x2ba4('0x3'))('routing');var client=jayson[_0x2ba4('0x4')][_0x2ba4('0x5')]({'port':0x232a});function request(_0xf8904,_0x29f4eb){return new BPromise(function(_0x40c16e,_0x44b379){return client[_0x2ba4('0x6')](_0xf8904,_0x29f4eb)[_0x2ba4('0x7')](function(_0x546b72){if(_0x546b72[_0x2ba4('0x8')]){return _0x44b379(_0x546b72['error'][_0x2ba4('0x9')]);}else{return _0x40c16e(_0x546b72[_0x2ba4('0xa')]);}})[_0x2ba4('0xb')](function(_0xd57013){return _0x44b379(_0xd57013);});});}exports[_0x2ba4('0xc')]=function(_0x3ef826,_0x33710a,_0x33ec8b){return function(_0x4b1932){if(_0x33ec8b['rules']&&!_0x33ec8b[_0x2ba4('0xd')][_0x3ef826]){logger[_0x2ba4('0xe')](_0x2ba4('0xf'),_0x3ef826);return _0x4b1932[_0x2ba4('0x10')]();}var _0x580e37=[];for(var _0x109f01=0x0;_0x109f01<_0x33710a[_0x2ba4('0x11')];_0x109f01+=0x1){_0x580e37['push'](request(_0x2ba4('0x12'),{'command':util['format'](_0x2ba4('0x13'),_0x33710a[_0x109f01])})[_0x2ba4('0x7')](function(_0x103d3e){return _0x103d3e&&_0x103d3e[_0x2ba4('0x9')]&&_0x103d3e['message'][_0x2ba4('0x14')]('true')>=0x0?!![]:![];})[_0x2ba4('0xb')](function(_0x4d476b){logger[_0x2ba4('0x8')]('[%s][INTERVAL]\x20%s',_0x3ef826,_0x33710a[_0x109f01]);}));}BPromise[_0x2ba4('0x15')](_0x580e37)[_0x2ba4('0x7')](function(_0xa2e98a){var _0x16ccbe=_[_0x2ba4('0x16')](_0xa2e98a);logger[_0x2ba4('0xe')](_0x2ba4('0x17'),_0x3ef826,_0x33710a['join'](_0x2ba4('0x18')),_0x16ccbe);_0x4b1932[_0x2ba4('0x19')](_0x16ccbe);})[_0x2ba4('0xb')](function(_0x587b1c){console[_0x2ba4('0x1a')](_0x587b1c);logger['error'](_0x2ba4('0x17'),_0x3ef826,_0x33710a[_0x2ba4('0x1b')](_0x2ba4('0x18')),_0x587b1c['stack']);_0x4b1932[_0x2ba4('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2cc8dba..e141f56 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 _0xbc9d=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','lodash','util','./utils','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','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','forIn','talktime','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected'];(function(_0x273409,_0x187856){var _0x572572=function(_0xd5228a){while(--_0xd5228a){_0x273409['push'](_0x273409['shift']());}};_0x572572(++_0x187856);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x158dd7,_0x1f5f90){_0x158dd7=_0x158dd7-0x0;var _0x1772ba=_0xbc9d[_0x158dd7];return _0x1772ba;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var utils=require(_0xdbc9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x434f6e,_0x35f89c){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x434f6e[_0xdbc9('0x3')],_0x434f6e[_0xdbc9('0x4')],_0x434f6e[_0xdbc9('0x5')],_0x434f6e[_0xdbc9('0x6')],_0x434f6e[_0xdbc9('0x7')],_0x434f6e[_0xdbc9('0x8')],_0x434f6e[_0xdbc9('0x9')],_0x434f6e['lastevent']));if(_0x434f6e[_0xdbc9('0x5')]){utils[_0xdbc9('0xa')](_0x434f6e[_0xdbc9('0x5')])['then'](function(_0x2c7ba5){if(_0x2c7ba5){_0x434f6e['type']=_0x2c7ba5['type'];_0x434f6e[_0xdbc9('0xb')]=_0x434f6e[_0xdbc9('0xc')]?_0x2c7ba5[_0xdbc9('0xd')]:![];_0x434f6e[_0xdbc9('0xe')]=_0x434f6e['agentacw']?_0x2c7ba5[_0xdbc9('0xf')]:0x0;}utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);});}else{utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);}if(_0x35f89c){delete transfers[_0x434f6e[_0xdbc9('0x3')]];}else{delete agents[_0x434f6e['destuniqueid']];}}exports['agentcalled']=function(_0x3d0fdd){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x3d0fdd);agents[_0x3d0fdd['destuniqueid']]=_0x3d0fdd;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x16')]=utils[_0xdbc9('0x17')]();agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x19');agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x9')]=null;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=null;utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x1c'),_0x3d0fdd[_0xdbc9('0x3')],agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x3d0fdd[_0xdbc9('0x15')]));}catch(_0x57a546){utils[_0xdbc9('0x1d')](util['format'](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x57a546);}};exports['agentringnoanswer']=function(_0x4408e9){try{if(!_['isNil'](agents[_0x4408e9['destuniqueid']])){utils['debug'](util['format'](_0xdbc9('0x1e'),_0x4408e9[_0xdbc9('0x3')]),_0x4408e9);utils['info'](util[_0xdbc9('0x13')](_0xdbc9('0x1f'),_0x4408e9['uniqueid'],agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x4408e9[_0xdbc9('0x15')]));agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x20')]=!![];agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();agents[_0x4408e9[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]]['holdtime']=_0x4408e9[_0xdbc9('0x24')]?parseInt(_0x4408e9[_0xdbc9('0x24')])/0x3e8:0x0;agents[_0x4408e9['destuniqueid']]['talktime']=0x0;unanswered[_0xdbc9('0x25')](_0x4408e9[_0xdbc9('0x15')]);}}catch(_0x473430){utils['error'](util[_0xdbc9('0x13')]('[%s][agents][agentringnoanswer]',_0x4408e9['uniqueid']),_0x473430);}};exports[_0xdbc9('0x26')]=function(_0x49da36){try{_['forIn'](agents,function(_0x417b17,_0x20eb4f){if(_0x417b17[_0xdbc9('0x3')]==_0x49da36['uniqueid']&&!_[_0xdbc9('0x27')](unanswered,_0x417b17[_0xdbc9('0x15')])){utils['debug'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x49da36);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x29'),_0x49da36[_0xdbc9('0x3')],_0x417b17[_0xdbc9('0x6')],_0x417b17['destuniqueid']));_0x417b17[_0xdbc9('0x20')]=!![];_0x417b17[_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();_0x417b17[_0xdbc9('0x18')]=_0xdbc9('0x2a');_0x417b17[_0xdbc9('0x23')]='abandoned';_0x417b17[_0xdbc9('0x2b')]=_0x49da36['holdtime'];_0x417b17['talktime']=0x0;writeDB(_0x417b17);}});}catch(_0x495c0e){utils['error'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x495c0e);}};exports[_0xdbc9('0x2c')]=function(_0x5527fc){try{if(agents[_0x5527fc[_0xdbc9('0x15')]]){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc[_0xdbc9('0x3')]),_0x5527fc);utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x2e'),_0x5527fc[_0xdbc9('0x3')],agents[_0x5527fc[_0xdbc9('0x15')]]['membername'],_0x5527fc[_0xdbc9('0x15')]));agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();agents[_0x5527fc['destuniqueid']]['connectedlinenum']=_0x5527fc[_0xdbc9('0x9')];agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=_0x5527fc[_0xdbc9('0x1a')];agents[_0x5527fc['destuniqueid']][_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];agents[_0x5527fc[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x30');_[_0xdbc9('0x31')](agents,function(_0x444219,_0x523c79){if(_0x444219[_0xdbc9('0x15')]!=_0x5527fc[_0xdbc9('0x15')]&&_0x444219['uniqueid']==_0x5527fc['uniqueid']){_0x444219[_0xdbc9('0x32')]=0x0;_0x444219[_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];_0x444219[_0xdbc9('0x20')]=!![];_0x444219['agentringnoanswerAt']=utils[_0xdbc9('0x17')]();_0x444219[_0xdbc9('0x18')]='answered_elsewhere';_0x444219[_0xdbc9('0x23')]=_0xdbc9('0x33');_0x444219['answeredelsewheredestinationuniqueid']=_0x5527fc[_0xdbc9('0x15')];_0x444219[_0xdbc9('0x34')]=_0x5527fc[_0xdbc9('0x6')];writeDB(_0x444219);}});}}catch(_0x3415c3){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc['uniqueid']),_0x3415c3);}};exports['agentcomplete']=function(_0x768856){try{if(!_[_0xdbc9('0x35')](agents[_0x768856[_0xdbc9('0x15')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x36'),_0x768856[_0xdbc9('0x3')]),_0x768856);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x37'),_0x768856[_0xdbc9('0x3')],agents[_0x768856['destuniqueid']]['membername'],_0x768856[_0xdbc9('0x15')]));agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0xc')]=!![];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x32')]=utils['diffTime'](agents[_0x768856['destuniqueid']][_0xdbc9('0x38')],agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x2f')]);agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0x768856[_0xdbc9('0x23')];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x18')]=_0xdbc9('0x39');writeDB(agents[_0x768856['destuniqueid']]);}}catch(_0x2c24a9){utils[_0xdbc9('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x768856[_0xdbc9('0x3')]),_0x2c24a9);}};exports[_0xdbc9('0x3a')]=function(_0x133a13){try{if(!_['isNil'](agents[_0x133a13[_0xdbc9('0x3b')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13['uniqueid']),_0x133a13);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x3d'),_0x133a13[_0xdbc9('0x3')],agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x6')],agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3')]));agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3e')]=!![];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3f')]=_0xdbc9('0x40');agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x41')]=_0x133a13['extension'];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x42')]=agents[_0x133a13['transfereruniqueid']]['uniqueid'];}}catch(_0xc7335d){utils['error'](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13[_0xdbc9('0x3')]),_0xc7335d);}};exports['attendedtransfer']=function(_0x32b38d){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x32b38d);if(_0x32b38d[_0xdbc9('0x44')]==_0x32b38d[_0xdbc9('0x45')]){if(!_[_0xdbc9('0x35')](agents[_0x32b38d['secondtransfereruniqueid']])){utils['info'](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d[_0xdbc9('0x47')]]['membername']));agents[_0x32b38d['secondtransfereruniqueid']][_0xdbc9('0x3e')]=!![];agents[_0x32b38d[_0xdbc9('0x47')]]['transfertype']='ATTENDED';agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x48')];agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x44')];}if(_0x32b38d['transfereeuniqueid']&&agents[_0x32b38d[_0xdbc9('0x49')]]){agents[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d['transfereeuniqueid']]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x49')]]);transfers[_0x32b38d[_0xdbc9('0x49')]]['calleridnum']=agents[_0x32b38d[_0xdbc9('0x47')]]['calleridnum'];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4c')]=agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x16')]=utils['now']();transfers[_0x32b38d[_0xdbc9('0x49')]]['agentconnectAt']=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x49')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x2;}}else if(_0x32b38d['secondtransfereruniqueid']==_0x32b38d['secondtransfererlinkedid']){if(!_[_0xdbc9('0x35')](agents[_0x32b38d[_0xdbc9('0x44')]])){utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x6')]));agents[_0x32b38d[_0xdbc9('0x44')]]['transfer']=!![];agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x3f')]=_0xdbc9('0x4d');agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x4e')];agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x47')];}if(_0x32b38d['transfertargetuniqueid']&&agents[_0x32b38d[_0xdbc9('0x4f')]]){agents[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d[_0xdbc9('0x4f')]]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x4f')]]);transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x8')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x8')];transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x4c')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x4f')]]['agentcalledAt']=utils['now']();transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x4f')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x2;}}}catch(_0x53843c){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x53843c);}};exports[_0xdbc9('0x50')]=function(_0xfdfb20){try{utils['debug'](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20['uniqueid']),_0xfdfb20);if(agents[_0xfdfb20['uniqueid']]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]===_0xdbc9('0x22')){if(_0xfdfb20[_0xdbc9('0x52')]==='21'){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]=_0xdbc9('0x53');agents[_0xfdfb20['uniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x53');}utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x54'),_0xfdfb20[_0xdbc9('0x3')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);var _0x1afbcd=unanswered[_0xdbc9('0x55')](_0xfdfb20[_0xdbc9('0x3')]);if(_0x1afbcd>-0x1){unanswered['splice'](_0x1afbcd,0x1);}}if(transfers[_0xfdfb20['uniqueid']]){transfers[_0xfdfb20[_0xdbc9('0x3')]]['agentcomplete']=!![];transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();transfers[_0xfdfb20[_0xdbc9('0x3')]]['talktime']=utils[_0xdbc9('0x56')](transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')],transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x2f')]);transfers[_0xfdfb20[_0xdbc9('0x3')]]['reason']=_0xdbc9('0x57');transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20[_0xdbc9('0x3')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['membername'],transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['lastevent']));writeDB(transfers[_0xfdfb20[_0xdbc9('0x3')]],!![]);}if(agents[_0xfdfb20[_0xdbc9('0x3')]]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x2f')]){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0xc')]=!![];agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')]=utils['now']();agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x32')]=utils[_0xdbc9('0x56')](agents[_0xfdfb20[_0xdbc9('0x3')]]['agentcompleteAt'],agents[_0xfdfb20[_0xdbc9('0x3')]]['agentconnectAt']);agents[_0xfdfb20['uniqueid']][_0xdbc9('0x23')]=agents[_0xfdfb20[_0xdbc9('0x3')]]['transfer']?_0xdbc9('0x3e'):_0xdbc9('0x57');agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20['uniqueid'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]]['reason'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);}}catch(_0x1839e4){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20[_0xdbc9('0x3')]),_0x1839e4);}}; \ No newline at end of file +var _0x7072=['acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','format','[%s][agents][agentcalled]','now','connectedlinename','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','holdtime','ringtime','talktime','push','error','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfer','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','util','./utils','info','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7072,0x138));var _0x2707=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7072[_0x58afd5];return _0x3e503b;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var utils=require(_0x2707('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x127e9c,_0x1bbc92){utils[_0x2707('0x2')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x127e9c[_0x2707('0x3')],_0x127e9c['channel'],_0x127e9c[_0x2707('0x4')],_0x127e9c[_0x2707('0x5')],_0x127e9c[_0x2707('0x6')],_0x127e9c[_0x2707('0x7')],_0x127e9c[_0x2707('0x8')],_0x127e9c[_0x2707('0x9')]));if(_0x127e9c[_0x2707('0x4')]){utils[_0x2707('0xa')](_0x127e9c[_0x2707('0x4')])[_0x2707('0xb')](function(_0x51ffc4){if(_0x51ffc4){_0x127e9c['type']=_0x51ffc4[_0x2707('0xc')];_0x127e9c[_0x2707('0xd')]=_0x127e9c[_0x2707('0xe')]?_0x51ffc4[_0x2707('0xf')]:![];_0x127e9c[_0x2707('0x10')]=_0x127e9c[_0x2707('0xd')]?_0x51ffc4[_0x2707('0x11')]:0x0;}utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);});}else{utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);}if(_0x1bbc92){delete transfers[_0x127e9c[_0x2707('0x3')]];}else{delete agents[_0x127e9c[_0x2707('0x14')]];}}exports['agentcalled']=function(_0x44c1d7){try{utils['debug'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x44c1d7);agents[_0x44c1d7[_0x2707('0x14')]]=_0x44c1d7;agents[_0x44c1d7[_0x2707('0x14')]]['agentcalledAt']=utils[_0x2707('0x17')]();agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x9')]='called';agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x8')]=null;agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x18')]=null;utils[_0x2707('0x2')](util[_0x2707('0x15')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x44c1d7[_0x2707('0x3')],agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x5')],_0x44c1d7['destuniqueid']));}catch(_0x529936){utils['error'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x529936);}};exports[_0x2707('0x19')]=function(_0x1a0e1a){try{if(!_[_0x2707('0x1a')](agents[_0x1a0e1a[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x1c'),_0x1a0e1a[_0x2707('0x3')]),_0x1a0e1a);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x1d'),_0x1a0e1a['uniqueid'],agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x5')],_0x1a0e1a[_0x2707('0x14')]));agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x19')]=!![];agents[_0x1a0e1a[_0x2707('0x14')]]['agentringnoanswerAt']=utils[_0x2707('0x17')]();agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x1e');agents[_0x1a0e1a[_0x2707('0x14')]]['reason']=_0x2707('0x1e');agents[_0x1a0e1a['destuniqueid']][_0x2707('0x1f')]=_0x1a0e1a[_0x2707('0x20')]?parseInt(_0x1a0e1a[_0x2707('0x20')])/0x3e8:0x0;agents[_0x1a0e1a['destuniqueid']][_0x2707('0x21')]=0x0;unanswered[_0x2707('0x22')](_0x1a0e1a[_0x2707('0x14')]);}}catch(_0x529be8){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentringnoanswer]',_0x1a0e1a[_0x2707('0x3')]),_0x529be8);}};exports['queuecallerabandon']=function(_0x5aaffb){try{_[_0x2707('0x24')](agents,function(_0x4e0c93,_0x2a0d24){if(_0x4e0c93[_0x2707('0x3')]==_0x5aaffb[_0x2707('0x3')]&&!_[_0x2707('0x25')](unanswered,_0x4e0c93['destuniqueid'])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x5aaffb);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x27'),_0x5aaffb[_0x2707('0x3')],_0x4e0c93[_0x2707('0x5')],_0x4e0c93['destuniqueid']));_0x4e0c93[_0x2707('0x19')]=!![];_0x4e0c93[_0x2707('0x28')]=utils['now']();_0x4e0c93['lastevent']='abandoned';_0x4e0c93['reason']='abandoned';_0x4e0c93[_0x2707('0x1f')]=_0x5aaffb['holdtime'];_0x4e0c93['talktime']=0x0;writeDB(_0x4e0c93);}});}catch(_0x4558bb){utils[_0x2707('0x23')](util['format'](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x4558bb);}};exports['agentconnect']=function(_0x5e6b51){try{if(agents[_0x5e6b51[_0x2707('0x14')]]){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x5e6b51);utils[_0x2707('0x2')](util['format'](_0x2707('0x29'),_0x5e6b51[_0x2707('0x3')],agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x5')],_0x5e6b51[_0x2707('0x14')]));agents[_0x5e6b51[_0x2707('0x14')]]['agentconnectAt']=utils[_0x2707('0x17')]();agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x8')]=_0x5e6b51[_0x2707('0x8')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x18')]=_0x5e6b51[_0x2707('0x18')];agents[_0x5e6b51['destuniqueid']][_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x2a');_[_0x2707('0x24')](agents,function(_0x3ed513,_0x39d9f6){if(_0x3ed513[_0x2707('0x14')]!=_0x5e6b51[_0x2707('0x14')]&&_0x3ed513[_0x2707('0x3')]==_0x5e6b51[_0x2707('0x3')]){_0x3ed513[_0x2707('0x21')]=0x0;_0x3ed513[_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];_0x3ed513[_0x2707('0x19')]=!![];_0x3ed513['agentringnoanswerAt']=utils[_0x2707('0x17')]();_0x3ed513[_0x2707('0x9')]='answered_elsewhere';_0x3ed513[_0x2707('0x2b')]='answered_elsewhere';_0x3ed513[_0x2707('0x2c')]=_0x5e6b51[_0x2707('0x14')];_0x3ed513[_0x2707('0x2d')]=_0x5e6b51[_0x2707('0x5')];writeDB(_0x3ed513);}});}}catch(_0x13e1c0){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x13e1c0);}};exports[_0x2707('0xe')]=function(_0x4c8dbf){try{if(!_[_0x2707('0x1a')](agents[_0x4c8dbf[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x4c8dbf[_0x2707('0x3')]),_0x4c8dbf);utils[_0x2707('0x2')](util['format'](_0x2707('0x2e'),_0x4c8dbf['uniqueid'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x5')],_0x4c8dbf[_0x2707('0x14')]));agents[_0x4c8dbf[_0x2707('0x14')]]['agentcomplete']=!![];agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x4c8dbf[_0x2707('0x14')]]['agentcompleteAt'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x31')]);agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2b')]=_0x4c8dbf[_0x2707('0x2b')];agents[_0x4c8dbf['destuniqueid']][_0x2707('0x9')]='complete';writeDB(agents[_0x4c8dbf[_0x2707('0x14')]]);}}catch(_0x6ada76){utils['error'](util[_0x2707('0x15')](_0x2707('0x32'),_0x4c8dbf[_0x2707('0x3')]),_0x6ada76);}};exports['blindtransfer']=function(_0x1a8034){try{if(!_['isNil'](agents[_0x1a8034[_0x2707('0x33')]])){utils[_0x2707('0x1b')](util['format'](_0x2707('0x34'),_0x1a8034[_0x2707('0x3')]),_0x1a8034);utils[_0x2707('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1a8034[_0x2707('0x3')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x5')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x3')]));agents[_0x1a8034['transfereruniqueid']]['transfer']=!![];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x35')]=_0x2707('0x36');agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x37')]=_0x1a8034[_0x2707('0x38')];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x39')]=agents[_0x1a8034[_0x2707('0x33')]]['uniqueid'];}}catch(_0x482ed1){utils[_0x2707('0x23')](util[_0x2707('0x15')](_0x2707('0x34'),_0x1a8034['uniqueid']),_0x482ed1);}};exports[_0x2707('0x3a')]=function(_0x40a1a8){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8[_0x2707('0x3b')]),_0x40a1a8);if(_0x40a1a8[_0x2707('0x3b')]==_0x40a1a8[_0x2707('0x3c')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3d')]])){utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3d')]]['membername']));agents[_0x40a1a8[_0x2707('0x3d')]]['transfer']=!![];agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x35')]='ATTENDED';agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x37')]=_0x40a1a8[_0x2707('0x3f')];agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x39')]=_0x40a1a8[_0x2707('0x3b')];}if(_0x40a1a8[_0x2707('0x40')]&&agents[_0x40a1a8[_0x2707('0x40')]]){agents[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x40')]]=_[_0x2707('0x42')](agents[_0x40a1a8['transfereeuniqueid']]);transfers[_0x40a1a8['transfereeuniqueid']]['calleridnum']=agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x40')]]['calleridname']=agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x43')];transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x40')]]['agentconnectAt']=utils['now']();transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x2;}}else if(_0x40a1a8[_0x2707('0x3d')]==_0x40a1a8[_0x2707('0x45')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3b')]])){utils[_0x2707('0x2')](util['format'](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x5')]));agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x46')]=!![];agents[_0x40a1a8['origtransfereruniqueid']]['transfertype']=_0x2707('0x47');agents[_0x40a1a8[_0x2707('0x3b')]]['transferexten']=_0x40a1a8['secondtransfererexten'];agents[_0x40a1a8['origtransfereruniqueid']]['transferuniqueid']=_0x40a1a8[_0x2707('0x3d')];}if(_0x40a1a8[_0x2707('0x48')]&&agents[_0x40a1a8['transfertargetuniqueid']]){agents[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x48')]]=_['clone'](agents[_0x40a1a8['transfertargetuniqueid']]);transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x7')]=agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x43')]=agents[_0x40a1a8[_0x2707('0x3b')]]['calleridname'];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x31')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8['transfertargetuniqueid']][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x2;}}}catch(_0x142606){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8['origtransfereruniqueid']),_0x142606);}};exports[_0x2707('0x49')]=function(_0x2b0df0){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x2b0df0);if(agents[_0x2b0df0['uniqueid']]&&agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]==='timeout'){if(_0x2b0df0[_0x2707('0x4b')]==='21'){agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')]=_0x2707('0x4c');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]='rejected';}utils[_0x2707('0x2')](util['format'](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],agents[_0x2b0df0['uniqueid']][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]));writeDB(agents[_0x2b0df0['uniqueid']]);var _0x3bfec3=unanswered[_0x2707('0x4e')](_0x2b0df0[_0x2707('0x3')]);if(_0x3bfec3>-0x1){unanswered[_0x2707('0x4f')](_0x3bfec3,0x1);}}if(transfers[_0x2b0df0[_0x2707('0x3')]]){transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0xe')]=!![];transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);transfers[_0x2b0df0[_0x2707('0x3')]]['reason']=_0x2707('0x50');transfers[_0x2b0df0['uniqueid']]['lastevent']=_0x2707('0x51');utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],transfers[_0x2b0df0[_0x2707('0x3')]]['membername'],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],transfers[_0x2b0df0[_0x2707('0x3')]]['lastevent']));writeDB(transfers[_0x2b0df0[_0x2707('0x3')]],!![]);}if(agents[_0x2b0df0[_0x2707('0x3')]]&&agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]){agents[_0x2b0df0['uniqueid']][_0x2707('0xe')]=!![];agents[_0x2b0df0['uniqueid']][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]=agents[_0x2b0df0['uniqueid']][_0x2707('0x46')]?_0x2707('0x46'):_0x2707('0x50');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]=_0x2707('0x51');utils['info'](util['format'](_0x2707('0x4d'),_0x2b0df0['uniqueid'],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0['uniqueid']][_0x2707('0x9')]));writeDB(agents[_0x2b0df0[_0x2707('0x3')]]);}}catch(_0x17b7b7){utils['error'](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x17b7b7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 4266019..9b083e4 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 _0x23bb=['newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','includes','noop','execif','lastapplication','lastdata','[%s][calls][newexten]','lodash','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','info','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','toNumber','ANSWERED','error','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x23bb,0x79));var _0xb23b=function(_0x10a96a,_0x2e8bda){_0x10a96a=_0x10a96a-0x0;var _0xf50a21=_0x23bb[_0x10a96a];return _0xf50a21;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xb23b('0x1'));var dispositions=[_0xb23b('0x2'),_0xb23b('0x3'),'FAILED',_0xb23b('0x2'),_0xb23b('0x2'),_0xb23b('0x2'),'ANSWERED','BUSY','FAILED',_0xb23b('0x3'),'FAILED'];var channels={};function writeDB(_0x4a2873){var _0x596a94;if(transfers[_0xb23b('0x4')][_0x4a2873['uniqueid']]){_0x596a94=_0x4a2873[_0xb23b('0x5')];_0x4a2873['uniqueid']=transfers[_0xb23b('0x4')][_0x4a2873[_0xb23b('0x5')]]['transfereeuniqueid'];}utils[_0xb23b('0x6')](util[_0xb23b('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4a2873[_0xb23b('0x5')],_0x4a2873[_0xb23b('0x8')],_0x4a2873[_0xb23b('0x9')],_0x4a2873['membername'],_0x4a2873[_0xb23b('0xa')],_0x4a2873[_0xb23b('0xb')],_0x4a2873[_0xb23b('0xc')],_0x4a2873[_0xb23b('0xd')]));if(_0x4a2873[_0xb23b('0xe')]){utils[_0xb23b('0xf')](_0x4a2873[_0xb23b('0xe')])[_0xb23b('0x10')](function(_0x114f6f){if(_0x114f6f){_0x4a2873[_0xb23b('0x11')]=_0x114f6f['id'];}utils[_0xb23b('0x12')](_0xb23b('0x13'),_0x4a2873);});}else{utils[_0xb23b('0x12')](_0xb23b('0x13'),_0x4a2873);}if(channels[_0x4a2873[_0xb23b('0x5')]]){delete channels[_0x4a2873[_0xb23b('0x5')]];}else if(_0x596a94&&channels[_0x596a94]){if(!transfers[_0xb23b('0x4')][_0x596a94]['recording'])delete transfers[_0xb23b('0x4')][_0x596a94];delete channels[_0x596a94];}}exports[_0xb23b('0x14')]=function(_0xe66b4c){try{utils[_0xb23b('0x15')](util[_0xb23b('0x7')]('[%s][calls][newchannel]',_0xe66b4c[_0xb23b('0x5')]),_0xe66b4c);if(_0xe66b4c['uniqueid']==_0xe66b4c[_0xb23b('0x16')]&&_0xe66b4c[_0xb23b('0x8')]!=_0xb23b('0x17')){utils['info'](util['format'](_0xb23b('0x18'),_0xe66b4c[_0xb23b('0x5')],_0xe66b4c[_0xb23b('0x19')],_0xe66b4c[_0xb23b('0x1a')]));channels[_0xe66b4c[_0xb23b('0x5')]]={'uniqueid':_0xe66b4c[_0xb23b('0x5')],'accountcode':_0xe66b4c[_0xb23b('0xe')],'source':_0xe66b4c['calleridnum'],'destination':_0xe66b4c[_0xb23b('0x1a')],'destinationcontext':_0xe66b4c[_0xb23b('0x19')],'channel':_0xe66b4c[_0xb23b('0x8')],'starttime':utils[_0xb23b('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xb23b('0x1c')};}}catch(_0x3bec93){utils['error'](util[_0xb23b('0x7')]('[%s][calls][newchannel]',_0xe66b4c[_0xb23b('0x5')]),_0x3bec93);}};exports['newstate']=function(_0x3968db){try{utils[_0xb23b('0x15')](util['format'](_0xb23b('0x1d'),_0x3968db[_0xb23b('0x5')]),_0x3968db);if(!_[_0xb23b('0x1e')](channels[_0x3968db[_0xb23b('0x5')]])&&_0x3968db[_0xb23b('0x1f')]==0x6){utils['info'](util[_0xb23b('0x7')](_0xb23b('0x20'),_0x3968db[_0xb23b('0x5')],_0x3968db[_0xb23b('0x19')],_0x3968db[_0xb23b('0x8')]));if(_[_0xb23b('0x1e')](channels[_0x3968db[_0xb23b('0x5')]][_0xb23b('0x21')])){channels[_0x3968db['uniqueid']][_0xb23b('0x21')]=utils[_0xb23b('0x1b')]();}}else if(!_[_0xb23b('0x1e')](channels[_0x3968db['linkedid']])&&_0x3968db[_0xb23b('0x1f')]==0x6&&_0x3968db[_0xb23b('0x19')]!=_0xb23b('0x22')){utils[_0xb23b('0x6')](util[_0xb23b('0x7')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3968db[_0xb23b('0x5')],_0x3968db[_0xb23b('0x16')],_0x3968db[_0xb23b('0x19')],_0x3968db[_0xb23b('0x8')]));channels[_0x3968db[_0xb23b('0x16')]][_0xb23b('0xe')]=_0x3968db[_0xb23b('0xe')];channels[_0x3968db[_0xb23b('0x16')]][_0xb23b('0x23')]=_0x3968db[_0xb23b('0x8')];if(_[_0xb23b('0x1e')](channels[_0x3968db[_0xb23b('0x16')]]['answertime'])){channels[_0x3968db[_0xb23b('0x16')]][_0xb23b('0x24')]=utils[_0xb23b('0x1b')]();}channels[_0x3968db[_0xb23b('0x16')]]['disposition']=dispositions[_[_0xb23b('0x25')](_0x3968db[_0xb23b('0x1f')])]||_0xb23b('0x26');}}catch(_0x47f628){utils[_0xb23b('0x27')](util['format'](_0xb23b('0x1d'),_0x3968db['uniqueid']),_0x47f628);}};exports[_0xb23b('0x28')]=function(_0x58b4b3){try{if(!_[_0xb23b('0x1e')](channels[_0x58b4b3['uniqueid']])){utils[_0xb23b('0x15')](util['format']('[%s][calls][hangup]',_0x58b4b3[_0xb23b('0x5')]),_0x58b4b3);if(_[_0xb23b('0x1e')](channels[_0x58b4b3[_0xb23b('0x5')]]['callerid'])){channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x29')]=_0x58b4b3[_0xb23b('0x2a')]+'\x20<'+_0x58b4b3[_0xb23b('0xb')]+'>';}utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x2b'),_0x58b4b3[_0xb23b('0x5')],channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x29')],_0x58b4b3['cause-txt']));channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x2c')]=utils[_0xb23b('0x1b')]();channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x2d')]=utils[_0xb23b('0x2e')](channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x2c')],channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x2f')]);channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x30')]=channels[_0x58b4b3[_0xb23b('0x5')]][_0xb23b('0x24')]?utils[_0xb23b('0x2e')](channels[_0x58b4b3['uniqueid']][_0xb23b('0x2c')],channels[_0x58b4b3['uniqueid']][_0xb23b('0x24')]):0x0;writeDB(channels[_0x58b4b3[_0xb23b('0x5')]]);}}catch(_0x2ecc6a){utils[_0xb23b('0x27')](util[_0xb23b('0x7')](_0xb23b('0x31'),_0x58b4b3['uniqueid']),_0x2ecc6a);}};exports[_0xb23b('0x32')]=function(_0x7926a7){try{if(!_[_0xb23b('0x1e')](channels[_0x7926a7[_0xb23b('0x33')]])){utils[_0xb23b('0x15')](util[_0xb23b('0x7')](_0xb23b('0x34'),_0x7926a7[_0xb23b('0x35')]),_0x7926a7);if(channels[_0x7926a7[_0xb23b('0x33')]][_0xb23b('0x8')]==_0x7926a7[_0xb23b('0x36')]){utils['info'](util[_0xb23b('0x7')](_0xb23b('0x37'),_0x7926a7['origtransfereruniqueid'],_0x7926a7[_0xb23b('0x33')],_0x7926a7[_0xb23b('0x38')]));channels[_0x7926a7['localtwolinkedid']][_0xb23b('0x23')]=_0x7926a7[_0xb23b('0x38')];channels[_0x7926a7[_0xb23b('0x33')]][_0xb23b('0x39')]=_0xb23b('0x3a');}else if(channels[_0x7926a7[_0xb23b('0x33')]][_0xb23b('0x8')]=_0x7926a7['transfertargetchannel']){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x37'),_0x7926a7['origtransfereruniqueid'],_0x7926a7['localtwolinkedid'],_0x7926a7[_0xb23b('0x3b')]));channels[_0x7926a7['localtwolinkedid']][_0xb23b('0x23')]=_0x7926a7[_0xb23b('0x3b')];channels[_0x7926a7['localtwolinkedid']][_0xb23b('0x39')]=_0xb23b('0x3a');}}}catch(_0x4175ba){utils['error'](util[_0xb23b('0x7')](_0xb23b('0x34'),_0x7926a7[_0xb23b('0x35')]),_0x4175ba);}};exports['musiconholdstart']=function(_0x13fc69){try{if(!_[_0xb23b('0x1e')](channels[_0x13fc69[_0xb23b('0x5')]])){utils[_0xb23b('0x15')](util[_0xb23b('0x7')](_0xb23b('0x3c'),_0x13fc69[_0xb23b('0x5')]),_0x13fc69);channels[_0x13fc69[_0xb23b('0x5')]][_0xb23b('0x3d')]=utils[_0xb23b('0x1b')]();utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x3e'),_0x13fc69[_0xb23b('0x5')],channels[_0x13fc69[_0xb23b('0x5')]]['musiconholdstartAt']));}}catch(_0xfa2bef){utils['error'](util[_0xb23b('0x7')]('[%s][calls][musiconholdstart]',_0x13fc69['uniqueid']),_0xfa2bef);}};exports[_0xb23b('0x3f')]=function(_0x5a7df9){try{if(!_[_0xb23b('0x1e')](channels[_0x5a7df9[_0xb23b('0x5')]])){utils['debug'](util[_0xb23b('0x7')]('[%s][calls][musiconholdstop]',_0x5a7df9['uniqueid']),_0x5a7df9);if(!_['isNil'](channels[_0x5a7df9[_0xb23b('0x5')]][_0xb23b('0x3d')])){channels[_0x5a7df9[_0xb23b('0x5')]][_0xb23b('0x40')]+=utils['diffTime'](utils['now'](),channels[_0x5a7df9[_0xb23b('0x5')]]['musiconholdstartAt']);utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x41'),_0x5a7df9[_0xb23b('0x5')],channels[_0x5a7df9[_0xb23b('0x5')]][_0xb23b('0x40')]));delete channels[_0x5a7df9[_0xb23b('0x5')]][_0xb23b('0x3d')];}}}catch(_0x57de7f){utils[_0xb23b('0x27')](util[_0xb23b('0x7')](_0xb23b('0x42'),_0x5a7df9[_0xb23b('0x5')]),_0x57de7f);}};exports[_0xb23b('0x43')]=function(_0x18f1ee){try{if(!_['isNil'](channels[_0x18f1ee['uniqueid']])){utils['debug'](util[_0xb23b('0x7')](_0xb23b('0x44'),_0x18f1ee['uniqueid']),_0x18f1ee);if(!_[_0xb23b('0x1e')](_0x18f1ee['variable'][_0xb23b('0x45')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x46'),_0x18f1ee[_0xb23b('0x5')],_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee[_0xb23b('0x5')]][_0xb23b('0x48')]=_0x18f1ee[_0xb23b('0x47')];}if(!_[_0xb23b('0x1e')](_0x18f1ee['variable'][_0xb23b('0x49')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x4a'),_0x18f1ee[_0xb23b('0x5')],_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee['uniqueid']][_0xb23b('0x4b')]=_0x18f1ee[_0xb23b('0x47')];channels[_0x18f1ee[_0xb23b('0x5')]][_0xb23b('0x29')]='\x22'+_0x18f1ee[_0xb23b('0x47')]+'\x22\x20<'+_0x18f1ee[_0xb23b('0x47')]+'>';}if(!_['isNil'](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x4d')])||!_[_0xb23b('0x1e')](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x4e')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x4f'),_0x18f1ee[_0xb23b('0x5')],!_[_0xb23b('0x1e')](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x4d')])?_0xb23b('0x4d'):_0xb23b('0x4e'),_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee['uniqueid']][_0xb23b('0x29')]=_0x18f1ee[_0xb23b('0x47')];}if(!_[_0xb23b('0x1e')](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x50')])||!_[_0xb23b('0x1e')](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x51')])){utils['info'](util[_0xb23b('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x18f1ee[_0xb23b('0x5')],!_['isNil'](_0x18f1ee['variable'][_0xb23b('0x50')])?_0xb23b('0x50'):'xmcs-queue',_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee[_0xb23b('0x5')]]['lastapplication']=_0xb23b('0x52');channels[_0x18f1ee[_0xb23b('0x5')]]['lastdata']=_0x18f1ee[_0xb23b('0x47')];channels[_0x18f1ee[_0xb23b('0x5')]][_0xb23b('0x9')]=!![];}if(!_['isNil'](_0x18f1ee['variable'][_0xb23b('0x53')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x54'),_0x18f1ee[_0xb23b('0x5')],_0x18f1ee['value']));channels[_0x18f1ee[_0xb23b('0x5')]][_0xb23b('0x55')]=_0x18f1ee[_0xb23b('0x47')];}if(!_[_0xb23b('0x1e')](_0x18f1ee['variable'][_0xb23b('0x56')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x18f1ee['uniqueid'],_0x18f1ee['value']));channels[_0x18f1ee[_0xb23b('0x5')]][_0xb23b('0x57')]=_0x18f1ee[_0xb23b('0x47')];}if(!_[_0xb23b('0x1e')](_0x18f1ee[_0xb23b('0x4c')][_0xb23b('0x58')])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')](_0xb23b('0x59'),_0x18f1ee[_0xb23b('0x5')],_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee[_0xb23b('0x5')]]['routeid']=_0x18f1ee[_0xb23b('0x47')];}if(!_['isNil'](_0x18f1ee[_0xb23b('0x4c')]['sipcallid'])){utils[_0xb23b('0x6')](util[_0xb23b('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x18f1ee['uniqueid'],_0x18f1ee[_0xb23b('0x47')]));channels[_0x18f1ee['uniqueid']][_0xb23b('0x5a')]=_0x18f1ee['value'];}}}catch(_0x4b03de){utils['error'](util['format']('[%s][calls][varset]',_0x18f1ee['uniqueid']),_0x4b03de);}};exports[_0xb23b('0x5b')]=function(_0x5b9350){try{if(!_[_0xb23b('0x1e')](channels[_0x5b9350[_0xb23b('0x5')]])){utils[_0xb23b('0x15')](util[_0xb23b('0x7')]('[%s][calls][newexten]',_0x5b9350[_0xb23b('0x5')]),_0x5b9350);utils[_0xb23b('0x6')](util[_0xb23b('0x7')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x5b9350['uniqueid'],_0x5b9350[_0xb23b('0x5c')],_0x5b9350['appdata']));if(_0x5b9350['application'][_0xb23b('0x5d')]()==_0xb23b('0x5e')&&_[_0xb23b('0x5f')](_0x5b9350['appdata'][_0xb23b('0x5d')](),_0xb23b('0x60'))){var _0x4aa507=_0x5b9350[_0xb23b('0x61')][_0xb23b('0x62')]('=');var _0x142e97=_0x4aa507[0x0]['substring'](_0x4aa507[0x0][_0xb23b('0x63')]('(')+0x1,_0x4aa507[0x0][_0xb23b('0x63')](')'));var _0x862066=_0x4aa507[0x1];channels[_0x5b9350[_0xb23b('0x5')]][_0x142e97]=_0x862066;}if(!_[_0xb23b('0x64')]([_0xb23b('0x28'),_0xb23b('0x65'),_0xb23b('0x66'),'set','gotoif'],_0x5b9350[_0xb23b('0x5c')][_0xb23b('0x5d')]())){channels[_0x5b9350[_0xb23b('0x5')]][_0xb23b('0x67')]=_0x5b9350[_0xb23b('0x5c')];channels[_0x5b9350[_0xb23b('0x5')]][_0xb23b('0x68')]=_0x5b9350[_0xb23b('0x61')];}}}catch(_0x262781){utils[_0xb23b('0x27')](util['format'](_0xb23b('0x69'),_0x5b9350[_0xb23b('0x5')]),_0x262781);}}; \ No newline at end of file +var _0x29e8=['error','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','origtransfererchannel','userfield','origtransfereruniqueid','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','[%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','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','noop','execif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','systemanswertime','channelstate','transfer','destinationchannel','answertime','now','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','cause-txt','duration','diffTime','endtime','starttime','billableseconds'];(function(_0xf2e4e7,_0xdef7e1){var _0x51c09=function(_0x1170ae){while(--_0x1170ae){_0xf2e4e7['push'](_0xf2e4e7['shift']());}};_0x51c09(++_0xdef7e1);}(_0x29e8,0x116));var _0x829e=function(_0x5611ec,_0x543fcb){_0x5611ec=_0x5611ec-0x0;var _0x274432=_0x29e8[_0x5611ec];return _0x274432;};'use strict';var _=require(_0x829e('0x0'));var util=require(_0x829e('0x1'));var utils=require(_0x829e('0x2'));var transfers=require(_0x829e('0x3'));var dispositions=['NO\x20ANSWER',_0x829e('0x4'),'FAILED',_0x829e('0x5'),_0x829e('0x5'),_0x829e('0x5'),_0x829e('0x6'),'BUSY','FAILED',_0x829e('0x4'),'FAILED'];var channels={};function writeDB(_0x4a2a28){var _0x2764f7;if(transfers['blinds'][_0x4a2a28[_0x829e('0x7')]]){_0x2764f7=_0x4a2a28['uniqueid'];_0x4a2a28['uniqueid']=transfers[_0x829e('0x8')][_0x4a2a28[_0x829e('0x7')]][_0x829e('0x9')];}utils[_0x829e('0xa')](util[_0x829e('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4a2a28[_0x829e('0x7')],_0x4a2a28[_0x829e('0xc')],_0x4a2a28[_0x829e('0xd')],_0x4a2a28[_0x829e('0xe')],_0x4a2a28['interface'],_0x4a2a28[_0x829e('0xf')],_0x4a2a28[_0x829e('0x10')],_0x4a2a28[_0x829e('0x11')]));if(_0x4a2a28['accountcode']){utils[_0x829e('0x12')](_0x4a2a28[_0x829e('0x13')])[_0x829e('0x14')](function(_0x1f81bb){if(_0x1f81bb){_0x4a2a28[_0x829e('0x15')]=_0x1f81bb['id'];}utils[_0x829e('0x16')]('CreateVoiceCallReport',_0x4a2a28);});}else{utils[_0x829e('0x16')](_0x829e('0x17'),_0x4a2a28);}if(channels[_0x4a2a28['uniqueid']]){delete channels[_0x4a2a28['uniqueid']];}else if(_0x2764f7&&channels[_0x2764f7]){if(!transfers[_0x829e('0x8')][_0x2764f7][_0x829e('0x18')])delete transfers[_0x829e('0x8')][_0x2764f7];delete channels[_0x2764f7];}}exports['newchannel']=function(_0x575bed){try{utils[_0x829e('0x19')](util['format'](_0x829e('0x1a'),_0x575bed[_0x829e('0x7')]),_0x575bed);if(_0x575bed['uniqueid']==_0x575bed[_0x829e('0x1b')]&&_0x575bed[_0x829e('0xc')]!=_0x829e('0x1c')){utils[_0x829e('0xa')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x575bed['uniqueid'],_0x575bed[_0x829e('0x1d')],_0x575bed[_0x829e('0x1e')]));channels[_0x575bed[_0x829e('0x7')]]={'uniqueid':_0x575bed['uniqueid'],'accountcode':_0x575bed['accountcode'],'source':_0x575bed['calleridnum'],'destination':_0x575bed['exten'],'destinationcontext':_0x575bed[_0x829e('0x1d')],'channel':_0x575bed[_0x829e('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x829e('0x5'),'amaflags':_0x829e('0x1f')};}}catch(_0x244b66){utils['error'](util[_0x829e('0xb')]('[%s][calls][newchannel]',_0x575bed[_0x829e('0x7')]),_0x244b66);}};exports[_0x829e('0x20')]=function(_0x460ee9){try{utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x21'),_0x460ee9[_0x829e('0x7')]),_0x460ee9);if(!_[_0x829e('0x22')](channels[_0x460ee9[_0x829e('0x7')]])&&_0x460ee9['channelstate']==0x6){utils[_0x829e('0xa')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x460ee9[_0x829e('0x7')],_0x460ee9[_0x829e('0x1d')],_0x460ee9[_0x829e('0xc')]));if(_[_0x829e('0x22')](channels[_0x460ee9[_0x829e('0x7')]][_0x829e('0x23')])){channels[_0x460ee9[_0x829e('0x7')]][_0x829e('0x23')]=utils['now']();}}else if(!_[_0x829e('0x22')](channels[_0x460ee9[_0x829e('0x1b')]])&&_0x460ee9[_0x829e('0x24')]==0x6&&_0x460ee9[_0x829e('0x1d')]!=_0x829e('0x25')){utils[_0x829e('0xa')](util[_0x829e('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x460ee9[_0x829e('0x7')],_0x460ee9[_0x829e('0x1b')],_0x460ee9['context'],_0x460ee9[_0x829e('0xc')]));channels[_0x460ee9['linkedid']][_0x829e('0x13')]=_0x460ee9['accountcode'];channels[_0x460ee9['linkedid']][_0x829e('0x26')]=_0x460ee9[_0x829e('0xc')];if(_[_0x829e('0x22')](channels[_0x460ee9[_0x829e('0x1b')]][_0x829e('0x27')])){channels[_0x460ee9[_0x829e('0x1b')]][_0x829e('0x27')]=utils[_0x829e('0x28')]();}channels[_0x460ee9[_0x829e('0x1b')]][_0x829e('0x29')]=dispositions[_[_0x829e('0x2a')](_0x460ee9[_0x829e('0x24')])]||'ANSWERED';}}catch(_0x36bc5b){utils['error'](util[_0x829e('0xb')](_0x829e('0x21'),_0x460ee9[_0x829e('0x7')]),_0x36bc5b);}};exports[_0x829e('0x2b')]=function(_0x1def40){try{if(!_[_0x829e('0x22')](channels[_0x1def40[_0x829e('0x7')]])){utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x2c'),_0x1def40[_0x829e('0x7')]),_0x1def40);if(_[_0x829e('0x22')](channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x2d')])){channels[_0x1def40[_0x829e('0x7')]]['callerid']=_0x1def40['calleridname']+'\x20<'+_0x1def40['calleridnum']+'>';}utils[_0x829e('0xa')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1def40[_0x829e('0x7')],channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x2d')],_0x1def40[_0x829e('0x2e')]));channels[_0x1def40[_0x829e('0x7')]]['endtime']=utils[_0x829e('0x28')]();channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x2f')]=utils[_0x829e('0x30')](channels[_0x1def40['uniqueid']][_0x829e('0x31')],channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x32')]);channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x33')]=channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x27')]?utils[_0x829e('0x30')](channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x31')],channels[_0x1def40[_0x829e('0x7')]][_0x829e('0x27')]):0x0;writeDB(channels[_0x1def40[_0x829e('0x7')]]);}}catch(_0x15240f){utils[_0x829e('0x34')](util[_0x829e('0xb')](_0x829e('0x2c'),_0x1def40[_0x829e('0x7')]),_0x15240f);}};exports[_0x829e('0x35')]=function(_0x184a96){try{if(!_[_0x829e('0x22')](channels[_0x184a96['localtwolinkedid']])){utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x36'),_0x184a96['origtransfereruniqueid']),_0x184a96);if(channels[_0x184a96[_0x829e('0x37')]][_0x829e('0xc')]==_0x184a96[_0x829e('0x38')]){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x39'),_0x184a96['origtransfereruniqueid'],_0x184a96['localtwolinkedid'],_0x184a96[_0x829e('0x3a')]));channels[_0x184a96[_0x829e('0x37')]][_0x829e('0x26')]=_0x184a96[_0x829e('0x3a')];channels[_0x184a96[_0x829e('0x37')]]['userfield']=_0x829e('0x3b');}else if(channels[_0x184a96['localtwolinkedid']]['channel']=_0x184a96['transfertargetchannel']){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x39'),_0x184a96['origtransfereruniqueid'],_0x184a96['localtwolinkedid'],_0x184a96[_0x829e('0x3c')]));channels[_0x184a96['localtwolinkedid']]['destinationchannel']=_0x184a96[_0x829e('0x3c')];channels[_0x184a96[_0x829e('0x37')]][_0x829e('0x3d')]='_attended';}}}catch(_0x1d8643){utils[_0x829e('0x34')](util['format'](_0x829e('0x36'),_0x184a96[_0x829e('0x3e')]),_0x1d8643);}};exports[_0x829e('0x3f')]=function(_0x4cd880){try{if(!_['isNil'](channels[_0x4cd880[_0x829e('0x7')]])){utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x40'),_0x4cd880[_0x829e('0x7')]),_0x4cd880);channels[_0x4cd880[_0x829e('0x7')]][_0x829e('0x41')]=utils[_0x829e('0x28')]();utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x42'),_0x4cd880[_0x829e('0x7')],channels[_0x4cd880[_0x829e('0x7')]][_0x829e('0x41')]));}}catch(_0x52b62b){utils[_0x829e('0x34')](util[_0x829e('0xb')](_0x829e('0x40'),_0x4cd880[_0x829e('0x7')]),_0x52b62b);}};exports['musiconholdstop']=function(_0x270f53){try{if(!_['isNil'](channels[_0x270f53['uniqueid']])){utils['debug'](util[_0x829e('0xb')](_0x829e('0x43'),_0x270f53[_0x829e('0x7')]),_0x270f53);if(!_['isNil'](channels[_0x270f53['uniqueid']][_0x829e('0x41')])){channels[_0x270f53[_0x829e('0x7')]][_0x829e('0x44')]+=utils[_0x829e('0x30')](utils[_0x829e('0x28')](),channels[_0x270f53[_0x829e('0x7')]][_0x829e('0x41')]);utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x45'),_0x270f53[_0x829e('0x7')],channels[_0x270f53[_0x829e('0x7')]][_0x829e('0x44')]));delete channels[_0x270f53[_0x829e('0x7')]][_0x829e('0x41')];}}}catch(_0x492855){utils[_0x829e('0x34')](util[_0x829e('0xb')](_0x829e('0x43'),_0x270f53[_0x829e('0x7')]),_0x492855);}};exports[_0x829e('0x46')]=function(_0x2203ae){try{if(!_[_0x829e('0x22')](channels[_0x2203ae[_0x829e('0x7')]])){utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x47'),_0x2203ae[_0x829e('0x7')]),_0x2203ae);if(!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x49')])){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x4a'),_0x2203ae[_0x829e('0x7')],_0x2203ae[_0x829e('0x4b')]));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x4c')]=_0x2203ae[_0x829e('0x4b')];}if(!_['isNil'](_0x2203ae[_0x829e('0x48')][_0x829e('0x4d')])){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x4e'),_0x2203ae[_0x829e('0x7')],_0x2203ae[_0x829e('0x4b')]));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x4f')]=_0x2203ae[_0x829e('0x4b')];channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x2d')]='\x22'+_0x2203ae[_0x829e('0x4b')]+_0x829e('0x50')+_0x2203ae[_0x829e('0x4b')]+'>';}if(!_['isNil'](_0x2203ae[_0x829e('0x48')][_0x829e('0x51')])||!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x52')])){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x53'),_0x2203ae[_0x829e('0x7')],!_['isNil'](_0x2203ae['variable']['xmd-callerid-preview'])?_0x829e('0x51'):_0x829e('0x52'),_0x2203ae['value']));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x2d')]=_0x2203ae[_0x829e('0x4b')];}if(!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x54')])||!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x55')])){utils[_0x829e('0xa')](util[_0x829e('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2203ae[_0x829e('0x7')],!_['isNil'](_0x2203ae['variable'][_0x829e('0x54')])?_0x829e('0x54'):_0x829e('0x55'),_0x2203ae['value']));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x56')]='Queue';channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x57')]=_0x2203ae[_0x829e('0x4b')];channels[_0x2203ae[_0x829e('0x7')]]['queue']=!![];}if(!_['isNil'](_0x2203ae[_0x829e('0x48')]['xmd-contactid'])){utils[_0x829e('0xa')](util['format'](_0x829e('0x58'),_0x2203ae[_0x829e('0x7')],_0x2203ae[_0x829e('0x4b')]));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x59')]=_0x2203ae[_0x829e('0x4b')];}if(!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x5a')])){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x5b'),_0x2203ae[_0x829e('0x7')],_0x2203ae[_0x829e('0x4b')]));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x5c')]=_0x2203ae[_0x829e('0x4b')];}if(!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')][_0x829e('0x5d')])){utils[_0x829e('0xa')](util['format'](_0x829e('0x5e'),_0x2203ae[_0x829e('0x7')],_0x2203ae[_0x829e('0x4b')]));channels[_0x2203ae[_0x829e('0x7')]][_0x829e('0x5f')]=_0x2203ae[_0x829e('0x4b')];}if(!_[_0x829e('0x22')](_0x2203ae[_0x829e('0x48')]['sipcallid'])){utils[_0x829e('0xa')](util[_0x829e('0xb')](_0x829e('0x60'),_0x2203ae[_0x829e('0x7')],_0x2203ae['value']));channels[_0x2203ae['uniqueid']][_0x829e('0x61')]=_0x2203ae['value'];}}}catch(_0x2565fd){utils[_0x829e('0x34')](util[_0x829e('0xb')]('[%s][calls][varset]',_0x2203ae['uniqueid']),_0x2565fd);}};exports[_0x829e('0x62')]=function(_0x12cb50){try{if(!_[_0x829e('0x22')](channels[_0x12cb50['uniqueid']])){utils[_0x829e('0x19')](util[_0x829e('0xb')](_0x829e('0x63'),_0x12cb50[_0x829e('0x7')]),_0x12cb50);utils[_0x829e('0xa')](util[_0x829e('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x12cb50[_0x829e('0x7')],_0x12cb50['application'],_0x12cb50['appdata']));if(_0x12cb50[_0x829e('0x64')][_0x829e('0x65')]()==_0x829e('0x66')&&_[_0x829e('0x67')](_0x12cb50[_0x829e('0x68')]['toLowerCase'](),_0x829e('0x69'))){var _0x399abd=_0x12cb50[_0x829e('0x68')]['split']('=');var _0x5b1759=_0x399abd[0x0][_0x829e('0x6a')](_0x399abd[0x0][_0x829e('0x6b')]('(')+0x1,_0x399abd[0x0][_0x829e('0x6b')](')'));var _0x1734fd=_0x399abd[0x1];channels[_0x12cb50[_0x829e('0x7')]][_0x5b1759]=_0x1734fd;}if(!_['includes']([_0x829e('0x2b'),_0x829e('0x6c'),_0x829e('0x6d'),_0x829e('0x66'),'gotoif'],_0x12cb50[_0x829e('0x64')][_0x829e('0x65')]())){channels[_0x12cb50[_0x829e('0x7')]][_0x829e('0x56')]=_0x12cb50['application'];channels[_0x12cb50[_0x829e('0x7')]]['lastdata']=_0x12cb50[_0x829e('0x68')];}}}catch(_0x586a3b){utils[_0x829e('0x34')](util[_0x829e('0xb')]('[%s][calls][newexten]',_0x12cb50[_0x829e('0x7')]),_0x586a3b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 241a4bc..138058e 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 _0x2f4b=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','info'];(function(_0x23e6ed,_0x28912e){var _0x1c585e=function(_0x9144c9){while(--_0x9144c9){_0x23e6ed['push'](_0x23e6ed['shift']());}};_0x1c585e(++_0x28912e);}(_0x2f4b,0x1df));var _0xb2f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2f4b[_0xa464c9];return _0x3d73c4;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0xb2f4('0x0')](_0xb2f4('0x1'));};exports[_0xb2f4('0x2')]=function(){utils[_0xb2f4('0x0')](_0xb2f4('0x3'));};exports[_0xb2f4('0x4')]=function(){utils[_0xb2f4('0x0')](_0xb2f4('0x5'));};exports[_0xb2f4('0x6')]=function(_0x175ee6){utils[_0xb2f4('0x6')](_0xb2f4('0x7'),_0x175ee6);};exports[_0xb2f4('0x8')]=function(){utils[_0xb2f4('0x0')]('[core]\x20close');};exports[_0xb2f4('0x9')]=function(_0x1ad33d){}; \ No newline at end of file +var _0xf121=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf121,0x76));var _0x1f12=function(_0x2bea70,_0x3ff17c){_0x2bea70=_0x2bea70-0x0;var _0x264d07=_0xf121[_0x2bea70];return _0x264d07;};'use strict';var utils=require('./utils');exports[_0x1f12('0x0')]=function(){utils[_0x1f12('0x1')](_0x1f12('0x2'));};exports[_0x1f12('0x3')]=function(){utils[_0x1f12('0x1')](_0x1f12('0x4'));};exports[_0x1f12('0x5')]=function(){utils['info'](_0x1f12('0x6'));};exports['error']=function(_0x595cea){utils[_0x1f12('0x7')]('[core]\x20error',_0x595cea);};exports[_0x1f12('0x8')]=function(){utils['info'](_0x1f12('0x9'));};exports[_0x1f12('0xa')]=function(_0x496636){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4550f36..671f783 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 _0xf0ee=['varset','debug','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','ANSWER','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','appdata','toLowerCase','cdr(routeid)','split','error'];(function(_0x3dc047,_0x1c98cf){var _0x3abeb8=function(_0xd30e02){while(--_0xd30e02){_0x3dc047['push'](_0x3dc047['shift']());}};_0x3abeb8(++_0x1c98cf);}(_0xf0ee,0xdb));var _0xef0e=function(_0x4a855e,_0x5be1ac){_0x4a855e=_0x4a855e-0x0;var _0x51cf72=_0xf0ee[_0x4a855e];return _0x51cf72;};'use strict';var _=require(_0xef0e('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x5e64b6){utils[_0xef0e('0x1')](util[_0xef0e('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5e64b6[_0xef0e('0x3')],_0x5e64b6[_0xef0e('0x4')],_0x5e64b6[_0xef0e('0x5')],_0x5e64b6[_0xef0e('0x6')],_0x5e64b6[_0xef0e('0x7')],_0x5e64b6[_0xef0e('0x8')]));utils[_0xef0e('0x9')](_0xef0e('0xa'),_0x5e64b6);delete dials[_0x5e64b6[_0xef0e('0x3')]];}exports[_0xef0e('0xb')]=function(_0xb6b84){try{utils['debug'](util['format'](_0xef0e('0xc'),_0xb6b84['uniqueid']),_0xb6b84);utils[_0xef0e('0x1')](util[_0xef0e('0x2')](_0xef0e('0xd'),_0xb6b84[_0xef0e('0x3')],_0xb6b84[_0xef0e('0xe')],_0xb6b84['appdata']));if(_0xb6b84[_0xef0e('0xe')]['toLowerCase']()==_0xef0e('0xf')&&_['startsWith'](_0xb6b84[_0xef0e('0x10')][_0xef0e('0x11')](),_0xef0e('0x12'))){var _0x2623b2=_0xb6b84[_0xef0e('0x10')][_0xef0e('0x13')]('=');dials[_0xb6b84[_0xef0e('0x3')]]={'routeId':_0x2623b2[0x1]};}}catch(_0x483b6d){utils[_0xef0e('0x14')](util['format'](_0xef0e('0xc'),_0xb6b84[_0xef0e('0x3')]),_0x483b6d);}};exports[_0xef0e('0x15')]=function(_0xfbb006){try{utils[_0xef0e('0x16')](util[_0xef0e('0x2')](_0xef0e('0x17'),_0xfbb006[_0xef0e('0x3')]),_0xfbb006);if(!_['isNil'](_0xfbb006['variable']['outboundrouteid'])){utils[_0xef0e('0x1')](util['format'](_0xef0e('0x18'),_0xfbb006[_0xef0e('0x3')],_0xfbb006['value']));dials[_0xfbb006['uniqueid']]={'routeId':_0xfbb006[_0xef0e('0x19')]};}}catch(_0x4c4901){utils['error'](util['format'](_0xef0e('0x17'),_0xfbb006[_0xef0e('0x3')]),_0x4c4901);}};exports[_0xef0e('0x1a')]=function(_0x40b12b){try{if(!_[_0xef0e('0x1b')](dials[_0x40b12b['uniqueid']])){utils[_0xef0e('0x16')](util[_0xef0e('0x2')](_0xef0e('0x1c'),_0x40b12b['uniqueid']),_0x40b12b);dials[_0x40b12b[_0xef0e('0x3')]]=_[_0xef0e('0x1d')](dials[_0x40b12b[_0xef0e('0x3')]],_0x40b12b);dials[_0x40b12b['uniqueid']]['starttime']=utils[_0xef0e('0x1e')]();dials[_0x40b12b[_0xef0e('0x3')]]['lastevent']=_0xef0e('0x1f');utils['info'](util['format'](_0xef0e('0x20'),_0x40b12b[_0xef0e('0x3')],dials[_0x40b12b[_0xef0e('0x3')]][_0xef0e('0x21')]));}}catch(_0x421020){utils['error'](util[_0xef0e('0x2')](_0xef0e('0x1c'),_0x40b12b['uniqueid']),_0x421020);}};exports[_0xef0e('0x22')]=function(_0x553d40){try{if(!_[_0xef0e('0x1b')](dials[_0x553d40['uniqueid']])){utils[_0xef0e('0x16')](util[_0xef0e('0x2')]('[%s][dials][dialend]',_0x553d40[_0xef0e('0x3')]),_0x553d40);dials[_0x553d40[_0xef0e('0x3')]][_0xef0e('0x8')]=_0x553d40['dialstatus'];if(_0x553d40[_0xef0e('0x8')]==_0xef0e('0x23')){dials[_0x553d40[_0xef0e('0x3')]]=_[_0xef0e('0x1d')](dials[_0x553d40['uniqueid']],_0x553d40);dials[_0x553d40[_0xef0e('0x3')]][_0xef0e('0x24')]=utils[_0xef0e('0x1e')]();dials[_0x553d40[_0xef0e('0x3')]][_0xef0e('0x25')]='connect';utils['info'](util[_0xef0e('0x2')](_0xef0e('0x26'),_0x553d40[_0xef0e('0x3')],_0x553d40[_0xef0e('0x8')],dials[_0x553d40[_0xef0e('0x3')]]['answertime']));}else{utils[_0xef0e('0x1')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x553d40[_0xef0e('0x3')],_0x553d40[_0xef0e('0x8')]));}}}catch(_0xcccbcd){utils[_0xef0e('0x14')](util[_0xef0e('0x2')](_0xef0e('0x27'),_0x553d40['uniqueid']),_0xcccbcd);}};exports[_0xef0e('0x28')]=function(_0x1c7256){try{if(!_['isNil'](dials[_0x1c7256[_0xef0e('0x3')]])){utils[_0xef0e('0x16')](util[_0xef0e('0x2')]('[%s][dials][hangup]',_0x1c7256[_0xef0e('0x3')]),_0x1c7256);utils[_0xef0e('0x1')](util[_0xef0e('0x2')](_0xef0e('0x29'),_0x1c7256[_0xef0e('0x3')],_0x1c7256['calleridnum'],_0x1c7256['calleridname'],_0x1c7256['cause-txt']));dials[_0x1c7256['uniqueid']]=_[_0xef0e('0x1d')](dials[_0x1c7256['uniqueid']],{'endtime':utils[_0xef0e('0x1e')](),'lastevent':_0xef0e('0x2a')});dials[_0x1c7256['uniqueid']][_0xef0e('0x2b')]=utils[_0xef0e('0x2c')](dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x2d')],dials[_0x1c7256[_0xef0e('0x3')]]['starttime']);dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x2e')]=utils[_0xef0e('0x2c')](dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x24')]||dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x2d')],dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x21')]);dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x2f')]=dials[_0x1c7256['uniqueid']]['answertime']?utils[_0xef0e('0x2c')](dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x2d')],dials[_0x1c7256[_0xef0e('0x3')]][_0xef0e('0x24')]):0x0;writeDB(dials[_0x1c7256['uniqueid']]);}}catch(_0x4d1214){utils['error'](util[_0xef0e('0x2')]('[%s][dials][hangup]',_0x1c7256[_0xef0e('0x3')]),_0x4d1214);}}; \ No newline at end of file +var _0xd808=['dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','holdtime','endtime','billableseconds','util','./utils','info','format','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','debug','[%s][dials][newexten]','uniqueid','application','set','startsWith','appdata','cdr(routeid)','split','error','[%s][dials][varset]','isNil','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xd808,0x100));var _0x8d80=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0xd808[_0x5ef905];return _0x367808;};'use strict';var _=require('lodash');var util=require(_0x8d80('0x0'));var utils=require(_0x8d80('0x1'));var dials={};function writeDB(_0xb03af8){utils[_0x8d80('0x2')](util[_0x8d80('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0xb03af8['uniqueid'],_0xb03af8[_0x8d80('0x4')],_0xb03af8[_0x8d80('0x5')],_0xb03af8[_0x8d80('0x6')],_0xb03af8[_0x8d80('0x7')],_0xb03af8[_0x8d80('0x8')]));utils[_0x8d80('0x9')]('CreateVoiceDialReport',_0xb03af8);delete dials[_0xb03af8['uniqueid']];}exports['newexten']=function(_0x3e75a5){try{utils[_0x8d80('0xa')](util['format'](_0x8d80('0xb'),_0x3e75a5['uniqueid']),_0x3e75a5);utils[_0x8d80('0x2')](util[_0x8d80('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3e75a5[_0x8d80('0xc')],_0x3e75a5[_0x8d80('0xd')],_0x3e75a5['appdata']));if(_0x3e75a5[_0x8d80('0xd')]['toLowerCase']()==_0x8d80('0xe')&&_[_0x8d80('0xf')](_0x3e75a5[_0x8d80('0x10')]['toLowerCase'](),_0x8d80('0x11'))){var _0x1756f9=_0x3e75a5[_0x8d80('0x10')][_0x8d80('0x12')]('=');dials[_0x3e75a5[_0x8d80('0xc')]]={'routeId':_0x1756f9[0x1]};}}catch(_0x12a6ee){utils[_0x8d80('0x13')](util[_0x8d80('0x3')](_0x8d80('0xb'),_0x3e75a5['uniqueid']),_0x12a6ee);}};exports['varset']=function(_0x2c3a74){try{utils[_0x8d80('0xa')](util[_0x8d80('0x3')](_0x8d80('0x14'),_0x2c3a74[_0x8d80('0xc')]),_0x2c3a74);if(!_[_0x8d80('0x15')](_0x2c3a74['variable']['outboundrouteid'])){utils[_0x8d80('0x2')](util[_0x8d80('0x3')](_0x8d80('0x16'),_0x2c3a74[_0x8d80('0xc')],_0x2c3a74[_0x8d80('0x17')]));dials[_0x2c3a74[_0x8d80('0xc')]]={'routeId':_0x2c3a74[_0x8d80('0x17')]};}}catch(_0x261829){utils[_0x8d80('0x13')](util[_0x8d80('0x3')](_0x8d80('0x14'),_0x2c3a74[_0x8d80('0xc')]),_0x261829);}};exports[_0x8d80('0x18')]=function(_0x4cc580){try{if(!_[_0x8d80('0x15')](dials[_0x4cc580[_0x8d80('0xc')]])){utils[_0x8d80('0xa')](util['format']('[%s][dials][dialbegin]',_0x4cc580[_0x8d80('0xc')]),_0x4cc580);dials[_0x4cc580[_0x8d80('0xc')]]=_[_0x8d80('0x19')](dials[_0x4cc580[_0x8d80('0xc')]],_0x4cc580);dials[_0x4cc580['uniqueid']][_0x8d80('0x1a')]=utils[_0x8d80('0x1b')]();dials[_0x4cc580[_0x8d80('0xc')]][_0x8d80('0x1c')]=_0x8d80('0x1d');utils[_0x8d80('0x2')](util[_0x8d80('0x3')](_0x8d80('0x1e'),_0x4cc580['uniqueid'],dials[_0x4cc580[_0x8d80('0xc')]][_0x8d80('0x1a')]));}}catch(_0x3e9fce){utils[_0x8d80('0x13')](util[_0x8d80('0x3')](_0x8d80('0x1f'),_0x4cc580[_0x8d80('0xc')]),_0x3e9fce);}};exports[_0x8d80('0x20')]=function(_0x1a6b1d){try{if(!_[_0x8d80('0x15')](dials[_0x1a6b1d['uniqueid']])){utils[_0x8d80('0xa')](util['format'](_0x8d80('0x21'),_0x1a6b1d[_0x8d80('0xc')]),_0x1a6b1d);dials[_0x1a6b1d['uniqueid']][_0x8d80('0x8')]=_0x1a6b1d[_0x8d80('0x8')];if(_0x1a6b1d[_0x8d80('0x8')]==_0x8d80('0x22')){dials[_0x1a6b1d[_0x8d80('0xc')]]=_[_0x8d80('0x19')](dials[_0x1a6b1d[_0x8d80('0xc')]],_0x1a6b1d);dials[_0x1a6b1d[_0x8d80('0xc')]][_0x8d80('0x23')]=utils[_0x8d80('0x1b')]();dials[_0x1a6b1d[_0x8d80('0xc')]][_0x8d80('0x1c')]='connect';utils[_0x8d80('0x2')](util[_0x8d80('0x3')](_0x8d80('0x24'),_0x1a6b1d['uniqueid'],_0x1a6b1d[_0x8d80('0x8')],dials[_0x1a6b1d[_0x8d80('0xc')]]['answertime']));}else{utils[_0x8d80('0x2')](util['format'](_0x8d80('0x25'),_0x1a6b1d[_0x8d80('0xc')],_0x1a6b1d[_0x8d80('0x8')]));}}}catch(_0x2652f8){utils[_0x8d80('0x13')](util['format'](_0x8d80('0x21'),_0x1a6b1d['uniqueid']),_0x2652f8);}};exports[_0x8d80('0x26')]=function(_0x4f1e4a){try{if(!_[_0x8d80('0x15')](dials[_0x4f1e4a['uniqueid']])){utils['debug'](util[_0x8d80('0x3')](_0x8d80('0x27'),_0x4f1e4a[_0x8d80('0xc')]),_0x4f1e4a);utils[_0x8d80('0x2')](util[_0x8d80('0x3')](_0x8d80('0x28'),_0x4f1e4a['uniqueid'],_0x4f1e4a[_0x8d80('0x6')],_0x4f1e4a[_0x8d80('0x29')],_0x4f1e4a[_0x8d80('0x2a')]));dials[_0x4f1e4a[_0x8d80('0xc')]]=_[_0x8d80('0x19')](dials[_0x4f1e4a[_0x8d80('0xc')]],{'endtime':utils[_0x8d80('0x1b')](),'lastevent':_0x8d80('0x2b')});dials[_0x4f1e4a[_0x8d80('0xc')]]['duration']=utils[_0x8d80('0x2c')](dials[_0x4f1e4a['uniqueid']]['endtime'],dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x1a')]);dials[_0x4f1e4a['uniqueid']][_0x8d80('0x2d')]=utils[_0x8d80('0x2c')](dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x23')]||dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x2e')],dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x1a')]);dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x2f')]=dials[_0x4f1e4a[_0x8d80('0xc')]][_0x8d80('0x23')]?utils['diffTime'](dials[_0x4f1e4a[_0x8d80('0xc')]]['endtime'],dials[_0x4f1e4a[_0x8d80('0xc')]]['answertime']):0x0;writeDB(dials[_0x4f1e4a['uniqueid']]);}}catch(_0x346516){utils[_0x8d80('0x13')](util['format']('[%s][dials][hangup]',_0x4f1e4a[_0x8d80('0xc')]),_0x346516);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0d8a862..ba2da0f 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 _0x961c=['production','local','asterisk','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env'];(function(_0x352489,_0x273baf){var _0x3b05f1=function(_0x20c5e2){while(--_0x20c5e2){_0x352489['push'](_0x352489['shift']());}};_0x3b05f1(++_0x273baf);}(_0x961c,0x8a));var _0xc961=function(_0x15022c,_0x5cc375){_0x15022c=_0x15022c-0x0;var _0x3caa8c=_0x961c[_0x15022c];return _0x3caa8c;};var AsteriskManager=require(_0xc961('0x0'));var config=require('../../config/environment');var utils=require(_0xc961('0x1'));var util=require(_0xc961('0x2'));var isXDREnabled=config['xdr']&&config[_0xc961('0x3')]['disabled']?!config[_0xc961('0x3')][_0xc961('0x4')]:!![];var isProduction=config[_0xc961('0x5')]===_0xc961('0x6')||![];var isLocalAsterisk=config[_0xc961('0x3')]&&config[_0xc961('0x3')][_0xc961('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0xc961('0x8')]['ip'],config[_0xc961('0x8')][_0xc961('0x9')],config[_0xc961('0x8')]['password'],!![]);ami[_0xc961('0xa')]();if(!isXDREnabled){utils[_0xc961('0xb')](_0xc961('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xc961('0xb')](_0xc961('0xd'));}else{var agents=require(_0xc961('0xe'));var calls=require(_0xc961('0xf'));var queues=require(_0xc961('0x10'));var recordings=require(_0xc961('0x11'));var members=require(_0xc961('0x12'));var dials=require(_0xc961('0x13'));var transfers=require('./transfers.controller');var core=require(_0xc961('0x14'));ami['on']('connect',core[_0xc961('0x15')]);ami['on'](_0xc961('0x16'),core[_0xc961('0x16')]);ami['on'](_0xc961('0x17'),core[_0xc961('0x17')]);ami['on'](_0xc961('0x18'),core[_0xc961('0x18')]);ami['on'](_0xc961('0x19'),core[_0xc961('0x19')]);ami['on'](_0xc961('0x1a'),core[_0xc961('0x1a')]);ami['on'](_0xc961('0x1b'),function(_0x569cb7){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')]('[%s][index][devicestatechange]',_0x569cb7[_0xc961('0x1e')]),_0x569cb7);members[_0xc961('0x1b')](_0x569cb7);}catch(_0x47be63){utils[_0xc961('0x18')](util['format'](_0xc961('0x1f'),_0x569cb7[_0xc961('0x1e')]),_0x47be63);}});ami['on'](_0xc961('0x20'),function(_0x3e642a){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x21'),_0x3e642a[_0xc961('0x22')]),_0x3e642a);agents['agentcalled'](_0x3e642a);}catch(_0x36b5cb){utils[_0xc961('0x18')](util['format'](_0xc961('0x21'),_0x3e642a[_0xc961('0x22')]),_0x36b5cb);}});ami['on'](_0xc961('0x23'),function(_0xb3b44c){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x24'),_0xb3b44c[_0xc961('0x22')]),_0xb3b44c);agents['agentringnoanswer'](_0xb3b44c);}catch(_0x2d8dd9){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x24'),_0xb3b44c[_0xc961('0x22')]),_0x2d8dd9);}});ami['on']('agentconnect',function(_0x556ddc){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x25'),_0x556ddc[_0xc961('0x22')]),_0x556ddc);agents[_0xc961('0x26')](_0x556ddc);queues[_0xc961('0x26')](_0x556ddc);}catch(_0x4e8736){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x25'),_0x556ddc[_0xc961('0x22')]),_0x4e8736);}});ami['on'](_0xc961('0x27'),function(_0x5db56e){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x28'),_0x5db56e[_0xc961('0x22')]),_0x5db56e);agents['agentcomplete'](_0x5db56e);queues[_0xc961('0x27')](_0x5db56e);members[_0xc961('0x27')](_0x5db56e);}catch(_0x31babe){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x28'),_0x5db56e['uniqueid']),_0x31babe);}});ami['on'](_0xc961('0x29'),function(_0x11eb75){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x2a'),_0x11eb75[_0xc961('0x22')]),_0x11eb75);agents[_0xc961('0x29')](_0x11eb75);queues[_0xc961('0x29')](_0x11eb75);}catch(_0xf04c35){utils[_0xc961('0x18')](util[_0xc961('0x1d')]('[%s][index][queuecallerabandon]',_0x11eb75[_0xc961('0x22')]),_0xf04c35);}});ami['on']('queuecallerjoin',function(_0x199462){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x2b'),_0x199462['uniqueid']),_0x199462);queues[_0xc961('0x2c')](_0x199462);recordings[_0xc961('0x2c')](_0x199462);}catch(_0x2daa0c){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x2b'),_0x199462['uniqueid']),_0x2daa0c);}});ami['on'](_0xc961('0x2d'),function(_0x1089d8){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x2e'),_0x1089d8[_0xc961('0x22')]),_0x1089d8);queues['queuecallerleave'](_0x1089d8);}catch(_0x5529b2){utils[_0xc961('0x18')](util[_0xc961('0x1d')]('[%s][index][queuecallerleave]',_0x1089d8[_0xc961('0x22')]),_0x5529b2);}});ami['on'](_0xc961('0x2f'),function(_0x467c65){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x30'),_0x467c65['uniqueid']),_0x467c65);queues[_0xc961('0x2f')](_0x467c65);calls[_0xc961('0x2f')](_0x467c65);}catch(_0x3ffdbb){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x30'),_0x467c65['uniqueid']),_0x3ffdbb);}});ami['on']('musiconholdstop',function(_0x37bde0){try{utils['debug'](util[_0xc961('0x1d')](_0xc961('0x31'),_0x37bde0[_0xc961('0x22')]),_0x37bde0);queues['musiconholdstop'](_0x37bde0);calls[_0xc961('0x32')](_0x37bde0);}catch(_0x1cc714){utils[_0xc961('0x18')](util['format'](_0xc961('0x31'),_0x37bde0['uniqueid']),_0x1cc714);}});ami['on'](_0xc961('0x33'),function(_0x40b0d6){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')]('[%s][index][newstate]',_0x40b0d6[_0xc961('0x22')]),_0x40b0d6);calls['newstate'](_0x40b0d6);recordings[_0xc961('0x33')](_0x40b0d6);}catch(_0x53a04f){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x34'),_0x40b0d6['uniqueid']),_0x53a04f);}});ami['on'](_0xc961('0x35'),function(_0x320e16){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x36'),_0x320e16[_0xc961('0x22')]),_0x320e16);calls[_0xc961('0x35')](_0x320e16);recordings[_0xc961('0x35')](_0x320e16);dials[_0xc961('0x35')](_0x320e16);agents[_0xc961('0x35')](_0x320e16);queues[_0xc961('0x35')](_0x320e16);}catch(_0x5e25c9){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x36'),_0x320e16[_0xc961('0x22')]),_0x5e25c9);}});ami['on'](_0xc961('0x37'),function(_0x21205a){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')]('[%s][index][cdr]',_0x21205a[_0xc961('0x22')]),_0x21205a);members['cdr'](_0x21205a);}catch(_0x55633c){utils[_0xc961('0x18')](util['format'](_0xc961('0x38'),_0x21205a['uniqueid']),_0x55633c);}});ami['on'](_0xc961('0x39'),function(_0x4a57e9){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x3a'),_0x4a57e9[_0xc961('0x22')]),_0x4a57e9);queues[_0xc961('0x39')](_0x4a57e9);agents[_0xc961('0x39')](_0x4a57e9);transfers[_0xc961('0x39')](_0x4a57e9);recordings[_0xc961('0x39')](_0x4a57e9);}catch(_0x1e8e61){utils[_0xc961('0x18')](util['format'](_0xc961('0x3a'),_0x4a57e9['uniqueid']),_0x1e8e61);}});ami['on'](_0xc961('0x3b'),function(_0x16d9a2){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x3c'),_0x16d9a2[_0xc961('0x3d')]),_0x16d9a2);queues['attendedtransfer'](_0x16d9a2);transfers[_0xc961('0x3b')](_0x16d9a2);agents[_0xc961('0x3b')](_0x16d9a2);calls[_0xc961('0x3b')](_0x16d9a2);}catch(_0x3edb11){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x3c'),_0x16d9a2['origtransfereruniqueid']),_0x3edb11);}});ami['on'](_0xc961('0x3e'),function(_0x3d5816){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x3f'),_0x3d5816[_0xc961('0x22')]),_0x3d5816);queues[_0xc961('0x3e')](_0x3d5816);recordings[_0xc961('0x3e')](_0x3d5816);calls[_0xc961('0x3e')](_0x3d5816);dials['varset'](_0x3d5816);}catch(_0x650723){utils['error'](util['format'](_0xc961('0x3f'),_0x3d5816[_0xc961('0x22')]),_0x650723);}});ami['on']('newexten',function(_0x15ba8e){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x40'),_0x15ba8e[_0xc961('0x22')]),_0x15ba8e);calls[_0xc961('0x41')](_0x15ba8e);recordings[_0xc961('0x41')](_0x15ba8e);dials[_0xc961('0x41')](_0x15ba8e);}catch(_0x55439b){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x40'),_0x15ba8e[_0xc961('0x22')]),_0x55439b);}});ami['on'](_0xc961('0x42'),function(_0x2f3014){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x43'),_0x2f3014[_0xc961('0x22')]),_0x2f3014);calls['newchannel'](_0x2f3014);recordings['newchannel'](_0x2f3014);}catch(_0x5122d9){utils[_0xc961('0x18')](util[_0xc961('0x1d')]('[%s][index][newchannel]',_0x2f3014[_0xc961('0x22')]),_0x5122d9);}});ami['on'](_0xc961('0x44'),function(_0x4fc02a){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')]('[%s][index][dialbegin]',_0x4fc02a[_0xc961('0x22')]),_0x4fc02a);dials[_0xc961('0x44')](_0x4fc02a);}catch(_0x23431f){utils[_0xc961('0x18')](util[_0xc961('0x1d')](_0xc961('0x45'),_0x4fc02a[_0xc961('0x22')]),_0x23431f);}});ami['on'](_0xc961('0x46'),function(_0x4e568a){try{utils[_0xc961('0x1c')](util[_0xc961('0x1d')](_0xc961('0x47'),_0x4e568a[_0xc961('0x22')]),_0x4e568a);dials[_0xc961('0x46')](_0x4e568a);}catch(_0x24ce76){utils['error'](util['format'](_0xc961('0x47'),_0x4e568a[_0xc961('0x22')]),_0x24ce76);}});} \ No newline at end of file +var _0x9a82=['[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend'];(function(_0x2c55a2,_0x3bc170){var _0x20fdcb=function(_0x36ee86){while(--_0x36ee86){_0x2c55a2['push'](_0x2c55a2['shift']());}};_0x20fdcb(++_0x3bc170);}(_0x9a82,0x109));var _0x29a8=function(_0x138980,_0x99e2d5){_0x138980=_0x138980-0x0;var _0x45bf47=_0x9a82[_0x138980];return _0x45bf47;};var AsteriskManager=require(_0x29a8('0x0'));var config=require(_0x29a8('0x1'));var utils=require(_0x29a8('0x2'));var util=require(_0x29a8('0x3'));var isXDREnabled=config[_0x29a8('0x4')]&&config[_0x29a8('0x4')][_0x29a8('0x5')]?!config[_0x29a8('0x4')][_0x29a8('0x5')]:!![];var isProduction=config['env']===_0x29a8('0x6')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x29a8('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x29a8('0x8')][_0x29a8('0x9')],config[_0x29a8('0x8')]['ip'],config[_0x29a8('0x8')][_0x29a8('0xa')],config[_0x29a8('0x8')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x29a8('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0x29a8('0xc'));var queues=require(_0x29a8('0xd'));var recordings=require('./recordings.controller');var members=require(_0x29a8('0xe'));var dials=require(_0x29a8('0xf'));var transfers=require('./transfers.controller');var core=require(_0x29a8('0x10'));ami['on'](_0x29a8('0x11'),core[_0x29a8('0x11')]);ami['on'](_0x29a8('0x12'),core[_0x29a8('0x12')]);ami['on'](_0x29a8('0x13'),core[_0x29a8('0x13')]);ami['on'](_0x29a8('0x14'),core[_0x29a8('0x14')]);ami['on']('close',core[_0x29a8('0x15')]);ami['on'](_0x29a8('0x16'),core[_0x29a8('0x16')]);ami['on'](_0x29a8('0x17'),function(_0x27ec3b){try{utils[_0x29a8('0x18')](util['format']('[%s][index][devicestatechange]',_0x27ec3b['device']),_0x27ec3b);members['devicestatechange'](_0x27ec3b);}catch(_0xdf246c){utils[_0x29a8('0x14')](util[_0x29a8('0x19')]('[%s][index][devicestatechange]',_0x27ec3b['device']),_0xdf246c);}});ami['on']('agentcalled',function(_0x370339){try{utils[_0x29a8('0x18')](util['format'](_0x29a8('0x1a'),_0x370339[_0x29a8('0x1b')]),_0x370339);agents[_0x29a8('0x1c')](_0x370339);}catch(_0x41394c){utils['error'](util[_0x29a8('0x19')]('[%s][index][agentcalled]',_0x370339['uniqueid']),_0x41394c);}});ami['on'](_0x29a8('0x1d'),function(_0x4ace69){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x1e'),_0x4ace69[_0x29a8('0x1b')]),_0x4ace69);agents[_0x29a8('0x1d')](_0x4ace69);}catch(_0x1671c7){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x1e'),_0x4ace69[_0x29a8('0x1b')]),_0x1671c7);}});ami['on'](_0x29a8('0x1f'),function(_0x3e370c){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x20'),_0x3e370c[_0x29a8('0x1b')]),_0x3e370c);agents[_0x29a8('0x1f')](_0x3e370c);queues[_0x29a8('0x1f')](_0x3e370c);}catch(_0x42c739){utils[_0x29a8('0x14')](util['format'](_0x29a8('0x20'),_0x3e370c[_0x29a8('0x1b')]),_0x42c739);}});ami['on']('agentcomplete',function(_0x25dcce){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x21'),_0x25dcce[_0x29a8('0x1b')]),_0x25dcce);agents[_0x29a8('0x22')](_0x25dcce);queues[_0x29a8('0x22')](_0x25dcce);members[_0x29a8('0x22')](_0x25dcce);}catch(_0x7d95a9){utils[_0x29a8('0x14')](util['format']('[%s][index][agentcomplete]',_0x25dcce['uniqueid']),_0x7d95a9);}});ami['on'](_0x29a8('0x23'),function(_0xe3ddc0){try{utils['debug'](util[_0x29a8('0x19')](_0x29a8('0x24'),_0xe3ddc0[_0x29a8('0x1b')]),_0xe3ddc0);agents[_0x29a8('0x23')](_0xe3ddc0);queues[_0x29a8('0x23')](_0xe3ddc0);}catch(_0x5c2c13){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x24'),_0xe3ddc0['uniqueid']),_0x5c2c13);}});ami['on'](_0x29a8('0x25'),function(_0x5362a5){try{utils[_0x29a8('0x18')](util['format']('[%s][index][queuecallerjoin]',_0x5362a5[_0x29a8('0x1b')]),_0x5362a5);queues[_0x29a8('0x25')](_0x5362a5);recordings[_0x29a8('0x25')](_0x5362a5);}catch(_0x13c509){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x26'),_0x5362a5[_0x29a8('0x1b')]),_0x13c509);}});ami['on'](_0x29a8('0x27'),function(_0x3962b4){try{utils[_0x29a8('0x18')](util['format'](_0x29a8('0x28'),_0x3962b4['uniqueid']),_0x3962b4);queues[_0x29a8('0x27')](_0x3962b4);}catch(_0x2797bb){utils[_0x29a8('0x14')](util['format'](_0x29a8('0x28'),_0x3962b4[_0x29a8('0x1b')]),_0x2797bb);}});ami['on']('musiconholdstart',function(_0x51462d){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')]('[%s][index][musiconholdstart]',_0x51462d[_0x29a8('0x1b')]),_0x51462d);queues[_0x29a8('0x29')](_0x51462d);calls[_0x29a8('0x29')](_0x51462d);}catch(_0x40d8ea){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x2a'),_0x51462d[_0x29a8('0x1b')]),_0x40d8ea);}});ami['on'](_0x29a8('0x2b'),function(_0x3a5637){try{utils['debug'](util[_0x29a8('0x19')](_0x29a8('0x2c'),_0x3a5637[_0x29a8('0x1b')]),_0x3a5637);queues[_0x29a8('0x2b')](_0x3a5637);calls[_0x29a8('0x2b')](_0x3a5637);}catch(_0x420c8b){utils['error'](util[_0x29a8('0x19')](_0x29a8('0x2c'),_0x3a5637[_0x29a8('0x1b')]),_0x420c8b);}});ami['on'](_0x29a8('0x2d'),function(_0x3e348b){try{utils['debug'](util[_0x29a8('0x19')](_0x29a8('0x2e'),_0x3e348b['uniqueid']),_0x3e348b);calls[_0x29a8('0x2d')](_0x3e348b);recordings[_0x29a8('0x2d')](_0x3e348b);}catch(_0xdfdd6c){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x2e'),_0x3e348b[_0x29a8('0x1b')]),_0xdfdd6c);}});ami['on']('hangup',function(_0x562f25){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x2f'),_0x562f25['uniqueid']),_0x562f25);calls['hangup'](_0x562f25);recordings['hangup'](_0x562f25);dials[_0x29a8('0x30')](_0x562f25);agents[_0x29a8('0x30')](_0x562f25);queues[_0x29a8('0x30')](_0x562f25);}catch(_0x1bd96c){utils['error'](util[_0x29a8('0x19')](_0x29a8('0x2f'),_0x562f25[_0x29a8('0x1b')]),_0x1bd96c);}});ami['on'](_0x29a8('0x31'),function(_0x51752b){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x32'),_0x51752b[_0x29a8('0x1b')]),_0x51752b);members[_0x29a8('0x31')](_0x51752b);}catch(_0x361dd9){utils[_0x29a8('0x14')](util[_0x29a8('0x19')]('[%s][index][cdr]',_0x51752b[_0x29a8('0x1b')]),_0x361dd9);}});ami['on'](_0x29a8('0x33'),function(_0x301caf){try{utils['debug'](util[_0x29a8('0x19')]('[%s][index][blindtransfer]',_0x301caf['uniqueid']),_0x301caf);queues[_0x29a8('0x33')](_0x301caf);agents[_0x29a8('0x33')](_0x301caf);transfers[_0x29a8('0x33')](_0x301caf);recordings[_0x29a8('0x33')](_0x301caf);}catch(_0x217e8b){utils[_0x29a8('0x14')](util['format']('[%s][index][blindtransfer]',_0x301caf[_0x29a8('0x1b')]),_0x217e8b);}});ami['on'](_0x29a8('0x34'),function(_0x163eb3){try{utils['debug'](util[_0x29a8('0x19')](_0x29a8('0x35'),_0x163eb3['origtransfereruniqueid']),_0x163eb3);queues[_0x29a8('0x34')](_0x163eb3);transfers[_0x29a8('0x34')](_0x163eb3);agents[_0x29a8('0x34')](_0x163eb3);calls['attendedtransfer'](_0x163eb3);}catch(_0x12f09b){utils[_0x29a8('0x14')](util[_0x29a8('0x19')]('[%s][index][attendedtransfer]',_0x163eb3[_0x29a8('0x36')]),_0x12f09b);}});ami['on'](_0x29a8('0x37'),function(_0x246829){try{utils['debug'](util[_0x29a8('0x19')](_0x29a8('0x38'),_0x246829[_0x29a8('0x1b')]),_0x246829);queues['varset'](_0x246829);recordings['varset'](_0x246829);calls[_0x29a8('0x37')](_0x246829);dials['varset'](_0x246829);}catch(_0x19f799){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x38'),_0x246829[_0x29a8('0x1b')]),_0x19f799);}});ami['on']('newexten',function(_0x2d4b92){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x39'),_0x2d4b92[_0x29a8('0x1b')]),_0x2d4b92);calls['newexten'](_0x2d4b92);recordings['newexten'](_0x2d4b92);dials[_0x29a8('0x3a')](_0x2d4b92);}catch(_0x188de7){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x39'),_0x2d4b92['uniqueid']),_0x188de7);}});ami['on'](_0x29a8('0x3b'),function(_0x468605){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x3c'),_0x468605[_0x29a8('0x1b')]),_0x468605);calls[_0x29a8('0x3b')](_0x468605);recordings[_0x29a8('0x3b')](_0x468605);}catch(_0x415d59){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x3c'),_0x468605['uniqueid']),_0x415d59);}});ami['on'](_0x29a8('0x3d'),function(_0x1a1ff4){try{utils[_0x29a8('0x18')](util['format'](_0x29a8('0x3e'),_0x1a1ff4[_0x29a8('0x1b')]),_0x1a1ff4);dials[_0x29a8('0x3d')](_0x1a1ff4);}catch(_0x565eef){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x3f'),_0x1a1ff4['uniqueid']),_0x565eef);}});ami['on'](_0x29a8('0x40'),function(_0x4790c7){try{utils[_0x29a8('0x18')](util[_0x29a8('0x19')](_0x29a8('0x41'),_0x4790c7[_0x29a8('0x1b')]),_0x4790c7);dials[_0x29a8('0x40')](_0x4790c7);}catch(_0x5ad699){utils[_0x29a8('0x14')](util[_0x29a8('0x19')](_0x29a8('0x41'),_0x4790c7[_0x29a8('0x1b')]),_0x5ad699);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9f734f0..e10bd52 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 _0xac3d=['uniqueid','interface','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','now','NOT_INUSE','isNil','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','channel','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','exitAt','destinationchannel','source','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s'];(function(_0x35178e,_0x550006){var _0x44e370=function(_0x22798f){while(--_0x22798f){_0x35178e['push'](_0x35178e['shift']());}};_0x44e370(++_0x550006);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdac3('0x0'));var util=require(_0xdac3('0x1'));var utils=require('./utils');var members={};var exclude=[_0xdac3('0x2'),_0xdac3('0x3')];function writeDB(_0x42e49f){utils[_0xdac3('0x4')](util[_0xdac3('0x5')](_0xdac3('0x6'),_0x42e49f[_0xdac3('0x7')],_0x42e49f[_0xdac3('0x8')],_0x42e49f['channel'],_0x42e49f[_0xdac3('0x9')],_0x42e49f['membername'],_0x42e49f[_0xdac3('0xa')]));if(_0x42e49f['interface']){utils[_0xdac3('0xb')](_0x42e49f[_0xdac3('0x8')])[_0xdac3('0xc')](function(_0x5665fd){if(_0x5665fd){_0x42e49f[_0xdac3('0xd')]=_0x5665fd[_0xdac3('0xe')];_0x42e49f[_0xdac3('0xf')]=_0x5665fd[_0xdac3('0xf')];utils[_0xdac3('0x10')](_0xdac3('0x11'),_0x42e49f);}else{utils[_0xdac3('0x12')](_0x42e49f[_0xdac3('0x8')][_0xdac3('0x13')]('/')[0x1])[_0xdac3('0xc')](function(_0x4a70ab){if(_0x4a70ab){_0x42e49f[_0xdac3('0xd')]=_0x4a70ab[_0xdac3('0xe')];_0x42e49f['internal']=_0x4a70ab[_0xdac3('0xf')];utils['request'](_0xdac3('0x11'),_0x42e49f);}});}})['catch'](function(_0x566f67){utils[_0xdac3('0x14')](util[_0xdac3('0x5')](_0xdac3('0x15'),_0x42e49f[_0xdac3('0x7')]),_0x566f67);});}delete members[_0x42e49f[_0xdac3('0x8')]];}function startsWith(_0x48d17f,_0x189044){return _[_0xdac3('0x16')](_0x48d17f,function(_0x1c3620){return _[_0xdac3('0x17')](_0x189044,_0x1c3620);});}exports['devicestatechange']=function(_0x221014){try{utils[_0xdac3('0x18')](util[_0xdac3('0x5')](_0xdac3('0x19'),members[_0x221014[_0xdac3('0x1a')]]?members[_0x221014[_0xdac3('0x1a')]][_0xdac3('0x7')]:_0x221014[_0xdac3('0x1a')]),_0x221014);utils['info'](util[_0xdac3('0x5')](_0xdac3('0x1b'),members[_0x221014['device']]?members[_0x221014[_0xdac3('0x1a')]][_0xdac3('0x7')]:_0x221014['device'],_0x221014['state'],_0x221014[_0xdac3('0x1a')]));switch(_0x221014[_0xdac3('0x1c')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x221014['device'])){members[_0x221014['device']]={'channel':_0xdac3('0x1d'),'interface':_0x221014['device'],'type':_0xdac3('0x1e'),'enterAt':utils[_0xdac3('0x1f')](),'role':'agent'};}break;case _0xdac3('0x20'):if(!_[_0xdac3('0x21')](members[_0x221014[_0xdac3('0x1a')]])){members[_0x221014['device']]['exitAt']=utils[_0xdac3('0x1f')]();members[_0x221014[_0xdac3('0x1a')]][_0xdac3('0x22')]=utils[_0xdac3('0x23')](members[_0x221014['device']]['exitAt'],members[_0x221014[_0xdac3('0x1a')]][_0xdac3('0x24')]);if(members[_0x221014['device']][_0xdac3('0x7')]){writeDB(members[_0x221014['device']]);}}break;default:break;}}catch(_0x367826){utils[_0xdac3('0x14')](util[_0xdac3('0x5')](_0xdac3('0x19'),members[_0x221014[_0xdac3('0x1a')]]?members[_0x221014['device']]['uniqueid']:_0x221014[_0xdac3('0x1a')]),_0x367826);}};exports[_0xdac3('0x25')]=function(_0x181534){try{if(!_[_0xdac3('0x21')](members[_0x181534[_0xdac3('0x8')]])){utils[_0xdac3('0x18')](util['format'](_0xdac3('0x26'),_0x181534[_0xdac3('0x7')]),_0x181534);utils[_0xdac3('0x4')](util[_0xdac3('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x181534[_0xdac3('0x7')],_0x181534[_0xdac3('0x8')],_0x181534[_0xdac3('0x27')]));members[_0x181534['interface']]=_[_0xdac3('0x28')](members[_0x181534[_0xdac3('0x8')]],{'data4':_0x181534[_0xdac3('0x27')],'uniqueid':_0x181534[_0xdac3('0x7')]});}}catch(_0x137298){utils[_0xdac3('0x14')](util[_0xdac3('0x5')](_0xdac3('0x26'),_0x181534[_0xdac3('0x7')]),_0x137298);}};exports[_0xdac3('0x29')]=function(_0x1cb85d){try{utils[_0xdac3('0x18')](util['format'](_0xdac3('0x2a'),_0x1cb85d[_0xdac3('0x7')]),_0x1cb85d);if(_0x1cb85d[_0xdac3('0x2b')]){var _0x242310=_0x1cb85d[_0xdac3('0x2b')][_0xdac3('0x13')]('-')[0x0];if(!_[_0xdac3('0x21')](members[_0x242310])){members[_0x242310]=_['assign'](members[_0x242310],{'data1':members[_0x242310]['data1']||_0x1cb85d[_0xdac3('0xa')],'data2':members[_0x242310]['data2']||_0x1cb85d['source'],'data3':members[_0x242310][_0xdac3('0x2c')]||_0x1cb85d[_0xdac3('0x2d')],'uniqueid':members[_0x242310]['uniqueid']||_0x1cb85d[_0xdac3('0x7')]});utils[_0xdac3('0x4')](util[_0xdac3('0x5')](_0xdac3('0x2e'),_0x1cb85d[_0xdac3('0x7')],members[_0x242310][_0xdac3('0x2f')],members[_0x242310][_0xdac3('0x9')],members[_0x242310]['data3']));if(members[_0x242310][_0xdac3('0x30')]){writeDB(members[_0x242310]);}}}if(_0x1cb85d[_0xdac3('0x31')]){var _0x12fe40=_0x1cb85d[_0xdac3('0x31')][_0xdac3('0x13')]('-')[0x0];if(!_[_0xdac3('0x21')](members[_0x12fe40])){members[_0x12fe40]=_[_0xdac3('0x28')](members[_0x12fe40],{'data1':members[_0x12fe40][_0xdac3('0x2f')]||_0x1cb85d[_0xdac3('0xa')],'data2':members[_0x12fe40]['data2']||_0x1cb85d[_0xdac3('0x32')],'data3':members[_0x12fe40][_0xdac3('0x2c')]||_0x1cb85d[_0xdac3('0x2d')],'uniqueid':members[_0x12fe40][_0xdac3('0x7')]||_0x1cb85d[_0xdac3('0x7')]});utils[_0xdac3('0x4')](util[_0xdac3('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1cb85d[_0xdac3('0x7')],members[_0x12fe40]['data1'],members[_0x12fe40][_0xdac3('0x9')],members[_0x12fe40]['data3']));if(members[_0x12fe40]['exitAt']){writeDB(members[_0x12fe40]);}}}}catch(_0x20ce4){utils[_0xdac3('0x14')](util['format'](_0xdac3('0x2a'),_0x1cb85d['uniqueid']),_0x20ce4);}}; \ No newline at end of file +var _0x0241=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','getUserByInterface','then','internal','request','getUserByName','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','cdr','[%s][members][cdr]','channel','split','type','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','assign','data1','lodash','./utils','Local/_attended@transfer','Queue:','format'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x0241,0x65));var _0x1024=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0241[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x1024('0x0'));var util=require('util');var utils=require(_0x1024('0x1'));var members={};var exclude=[_0x1024('0x2'),_0x1024('0x3')];function writeDB(_0x3f453f){utils['info'](util[_0x1024('0x4')](_0x1024('0x5'),_0x3f453f[_0x1024('0x6')],_0x3f453f[_0x1024('0x7')],_0x3f453f['channel'],_0x3f453f['data2'],_0x3f453f[_0x1024('0x8')],_0x3f453f['type']));if(_0x3f453f[_0x1024('0x7')]){utils[_0x1024('0x9')](_0x3f453f['interface'])[_0x1024('0xa')](function(_0x15c52a){if(_0x15c52a){_0x3f453f['membername']=_0x15c52a['name'];_0x3f453f[_0x1024('0xb')]=_0x15c52a[_0x1024('0xb')];utils[_0x1024('0xc')]('CreateMemberReport',_0x3f453f);}else{utils[_0x1024('0xd')](_0x3f453f[_0x1024('0x7')]['split']('/')[0x1])[_0x1024('0xa')](function(_0x3c680b){if(_0x3c680b){_0x3f453f[_0x1024('0x8')]=_0x3c680b['name'];_0x3f453f[_0x1024('0xb')]=_0x3c680b['internal'];utils['request'](_0x1024('0xe'),_0x3f453f);}});}})[_0x1024('0xf')](function(_0xbcda87){utils[_0x1024('0x10')](util[_0x1024('0x4')](_0x1024('0x11'),_0x3f453f[_0x1024('0x6')]),_0xbcda87);});}delete members[_0x3f453f[_0x1024('0x7')]];}function startsWith(_0x30fcb5,_0x5d2bcd){return _[_0x1024('0x12')](_0x30fcb5,function(_0x4ebf31){return _[_0x1024('0x13')](_0x5d2bcd,_0x4ebf31);});}exports['devicestatechange']=function(_0x5e7022){try{utils[_0x1024('0x14')](util[_0x1024('0x4')](_0x1024('0x15'),members[_0x5e7022[_0x1024('0x16')]]?members[_0x5e7022['device']]['uniqueid']:_0x5e7022[_0x1024('0x16')]),_0x5e7022);utils[_0x1024('0x17')](util[_0x1024('0x4')](_0x1024('0x18'),members[_0x5e7022[_0x1024('0x16')]]?members[_0x5e7022['device']]['uniqueid']:_0x5e7022[_0x1024('0x16')],_0x5e7022[_0x1024('0x19')],_0x5e7022[_0x1024('0x16')]));switch(_0x5e7022['state']){case _0x1024('0x1a'):case _0x1024('0x1b'):if(!startsWith(exclude,_0x5e7022[_0x1024('0x16')])){members[_0x5e7022['device']]={'channel':_0x1024('0x1c'),'interface':_0x5e7022[_0x1024('0x16')],'type':_0x1024('0x1d'),'enterAt':utils[_0x1024('0x1e')](),'role':_0x1024('0x1f')};}break;case _0x1024('0x20'):if(!_[_0x1024('0x21')](members[_0x5e7022['device']])){members[_0x5e7022[_0x1024('0x16')]]['exitAt']=utils[_0x1024('0x1e')]();members[_0x5e7022[_0x1024('0x16')]][_0x1024('0x22')]=utils[_0x1024('0x23')](members[_0x5e7022[_0x1024('0x16')]][_0x1024('0x24')],members[_0x5e7022[_0x1024('0x16')]][_0x1024('0x25')]);if(members[_0x5e7022[_0x1024('0x16')]][_0x1024('0x6')]){writeDB(members[_0x5e7022[_0x1024('0x16')]]);}}break;default:break;}}catch(_0x4f1b62){utils['error'](util[_0x1024('0x4')](_0x1024('0x15'),members[_0x5e7022[_0x1024('0x16')]]?members[_0x5e7022['device']]['uniqueid']:_0x5e7022[_0x1024('0x16')]),_0x4f1b62);}};exports['agentcomplete']=function(_0x2c4f86){try{if(!_[_0x1024('0x21')](members[_0x2c4f86['interface']])){utils[_0x1024('0x14')](util['format'](_0x1024('0x26'),_0x2c4f86['uniqueid']),_0x2c4f86);utils['info'](util[_0x1024('0x4')](_0x1024('0x27'),_0x2c4f86['uniqueid'],_0x2c4f86[_0x1024('0x7')],_0x2c4f86['queue']));members[_0x2c4f86[_0x1024('0x7')]]=_['assign'](members[_0x2c4f86['interface']],{'data4':_0x2c4f86['queue'],'uniqueid':_0x2c4f86[_0x1024('0x6')]});}}catch(_0x580c19){utils[_0x1024('0x10')](util[_0x1024('0x4')](_0x1024('0x26'),_0x2c4f86['uniqueid']),_0x580c19);}};exports[_0x1024('0x28')]=function(_0x5c8295){try{utils['debug'](util[_0x1024('0x4')](_0x1024('0x29'),_0x5c8295[_0x1024('0x6')]),_0x5c8295);if(_0x5c8295[_0x1024('0x2a')]){var _0xfc1a2b=_0x5c8295[_0x1024('0x2a')][_0x1024('0x2b')]('-')[0x0];if(!_[_0x1024('0x21')](members[_0xfc1a2b])){members[_0xfc1a2b]=_['assign'](members[_0xfc1a2b],{'data1':members[_0xfc1a2b]['data1']||_0x5c8295[_0x1024('0x2c')],'data2':members[_0xfc1a2b][_0x1024('0x2d')]||_0x5c8295[_0x1024('0x2e')],'data3':members[_0xfc1a2b]['data3']||_0x5c8295[_0x1024('0x2f')],'uniqueid':members[_0xfc1a2b][_0x1024('0x6')]||_0x5c8295[_0x1024('0x6')]});utils[_0x1024('0x17')](util[_0x1024('0x4')](_0x1024('0x30'),_0x5c8295[_0x1024('0x6')],members[_0xfc1a2b]['data1'],members[_0xfc1a2b][_0x1024('0x2d')],members[_0xfc1a2b][_0x1024('0x31')]));if(members[_0xfc1a2b][_0x1024('0x24')]){writeDB(members[_0xfc1a2b]);}}}if(_0x5c8295[_0x1024('0x32')]){var _0x36754c=_0x5c8295[_0x1024('0x32')]['split']('-')[0x0];if(!_[_0x1024('0x21')](members[_0x36754c])){members[_0x36754c]=_[_0x1024('0x33')](members[_0x36754c],{'data1':members[_0x36754c][_0x1024('0x34')]||_0x5c8295[_0x1024('0x2c')],'data2':members[_0x36754c][_0x1024('0x2d')]||_0x5c8295[_0x1024('0x2e')],'data3':members[_0x36754c][_0x1024('0x31')]||_0x5c8295[_0x1024('0x2f')],'uniqueid':members[_0x36754c][_0x1024('0x6')]||_0x5c8295[_0x1024('0x6')]});utils[_0x1024('0x17')](util[_0x1024('0x4')](_0x1024('0x30'),_0x5c8295[_0x1024('0x6')],members[_0x36754c][_0x1024('0x34')],members[_0x36754c][_0x1024('0x2d')],members[_0x36754c]['data3']));if(members[_0x36754c][_0x1024('0x24')]){writeDB(members[_0x36754c]);}}}}catch(_0x7d1855){utils[_0x1024('0x10')](util[_0x1024('0x4')](_0x1024('0x29'),_0x5c8295[_0x1024('0x6')]),_0x7d1855);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 048a428..85ba440 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 _0x86e5=['[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','name','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','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','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]'];(function(_0x252b5d,_0x5c7f7f){var _0x1a5b93=function(_0x509323){while(--_0x509323){_0x252b5d['push'](_0x252b5d['shift']());}};_0x1a5b93(++_0x5c7f7f);}(_0x86e5,0x1b4));var _0x586e=function(_0x165fac,_0x1a80e3){_0x165fac=_0x165fac-0x0;var _0x41de58=_0x86e5[_0x165fac];return _0x41de58;};'use strict';var _=require(_0x586e('0x0'));var util=require('util');var utils=require(_0x586e('0x1'));var queues={};function writeDB(_0x5249ab){utils[_0x586e('0x2')](util[_0x586e('0x3')](_0x586e('0x4'),_0x5249ab[_0x586e('0x5')],_0x5249ab[_0x586e('0x6')],_0x5249ab[_0x586e('0x7')],_0x5249ab['lastAssignedTo'],_0x5249ab[_0x586e('0x8')],_0x5249ab[_0x586e('0x9')],_0x5249ab[_0x586e('0xa')]));if(_0x5249ab['queue']){utils[_0x586e('0xb')](_0x5249ab['queue'])['then'](function(_0x5d8f03){if(_0x5d8f03){_0x5249ab[_0x586e('0xc')]=_0x5d8f03[_0x586e('0xc')];}utils[_0x586e('0xd')](_0x586e('0xe'),_0x5249ab);});}else{utils[_0x586e('0xd')](_0x586e('0xe'),_0x5249ab);}if(_0x5249ab[_0x586e('0xf')]){delete queues[_0x5249ab['transfereduniqueid']];}else{delete queues[_0x5249ab['uniqueid']];}}exports[_0x586e('0x10')]=function(_0x18c32a){try{utils['debug'](util[_0x586e('0x3')](_0x586e('0x11'),_0x18c32a[_0x586e('0x5')]),_0x18c32a);utils[_0x586e('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x18c32a[_0x586e('0x5')],_0x18c32a['queue'],_0x18c32a[_0x586e('0x12')]));queues[_0x18c32a['uniqueid']]=_[_0x586e('0x13')](_0x18c32a,{'originalposition':_0x18c32a[_0x586e('0x12')],'queuecallerjoinAt':utils[_0x586e('0x14')](),'mohtime':0x0});}catch(_0x9b4cb3){utils[_0x586e('0x15')](util['format'](_0x586e('0x11'),_0x18c32a['uniqueid']),_0x9b4cb3);}};exports[_0x586e('0x16')]=function(_0x52e476){try{if(!_[_0x586e('0x17')](queues[_0x52e476[_0x586e('0x5')]])){utils['debug'](util[_0x586e('0x3')](_0x586e('0x18'),_0x52e476[_0x586e('0x5')]),_0x52e476);if(queues[_0x52e476['uniqueid']][_0x586e('0x19')]){if(!queues[_0x52e476[_0x586e('0x5')]][_0x586e('0x1a')]&&!queues[_0x52e476[_0x586e('0x5')]]['queuecallerexit']){queues[_0x52e476[_0x586e('0x5')]][_0x586e('0x1b')]=!![];queues[_0x52e476['uniqueid']]['queuecallercompleteAt']=utils[_0x586e('0x14')]();queues[_0x52e476[_0x586e('0x5')]][_0x586e('0xa')]=_0x586e('0x1c');}utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x52e476[_0x586e('0x5')],queues[_0x52e476[_0x586e('0x5')]][_0x586e('0x1d')],queues[_0x52e476[_0x586e('0x5')]][_0x586e('0xa')]));writeDB(queues[_0x52e476[_0x586e('0x5')]]);}else if(queues[_0x52e476[_0x586e('0x5')]]['transfereduniqueid']){utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x52e476['uniqueid'],queues[_0x52e476[_0x586e('0x5')]][_0x586e('0x1d')],queues[_0x52e476[_0x586e('0x5')]][_0x586e('0xf')]));queues[queues[_0x52e476[_0x586e('0x5')]][_0x586e('0xf')]]=queues[_0x52e476[_0x586e('0x5')]];queues[queues[_0x52e476[_0x586e('0x5')]][_0x586e('0xf')]][_0x586e('0x1e')]=0x2;delete queues[_0x52e476[_0x586e('0x5')]];}}}catch(_0x4190eb){utils[_0x586e('0x15')](util[_0x586e('0x3')](_0x586e('0x18'),_0x52e476[_0x586e('0x5')]),_0x4190eb);}};exports[_0x586e('0x1f')]=function(_0xab280f){try{utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x21'),_0xab280f['uniqueid']),_0xab280f);if(!_[_0x586e('0x17')](_0xab280f[_0x586e('0x22')][_0x586e('0x23')])&&_0xab280f[_0x586e('0x24')][_0x586e('0x25')]()!==_0x586e('0x26')){if(!_[_0x586e('0x17')](queues[_0xab280f[_0x586e('0x5')]])){queues[_0xab280f[_0x586e('0x5')]]['queuecallerabandon']=![];queues[_0xab280f[_0x586e('0x5')]][_0x586e('0x27')]=null;queues[_0xab280f['uniqueid']][_0x586e('0x28')]=!![];queues[_0xab280f[_0x586e('0x5')]][_0x586e('0x29')]=utils['now']();queues[_0xab280f['uniqueid']][_0x586e('0xa')]=_0xab280f[_0x586e('0x24')][_0x586e('0x25')]();utils['info'](util['format'](_0x586e('0x2a'),_0xab280f[_0x586e('0x5')],queues[_0xab280f['uniqueid']][_0x586e('0x1d')],_0xab280f[_0x586e('0x24')],queues[_0xab280f[_0x586e('0x5')]][_0x586e('0xa')]));writeDB(queues[_0xab280f[_0x586e('0x5')]]);}}else if(!_[_0x586e('0x17')](_0xab280f[_0x586e('0x22')][_0x586e('0x2b')])){if(!_[_0x586e('0x17')](queues[_0xab280f['uniqueid']])&&!queues[_0xab280f[_0x586e('0x5')]][_0x586e('0x1a')]){queues[_0xab280f[_0x586e('0x5')]]['queuecallerabandon']=![];queues[_0xab280f['uniqueid']]['queuecallerabandonAt']=null;queues[_0xab280f['uniqueid']][_0x586e('0x28')]=!![];queues[_0xab280f['uniqueid']][_0x586e('0x29')]=utils[_0x586e('0x14')]();queues[_0xab280f[_0x586e('0x5')]][_0x586e('0xa')]=_0x586e('0x2c');utils[_0x586e('0x2')](util['format'](_0x586e('0x2d'),_0xab280f[_0x586e('0x5')],queues[_0xab280f[_0x586e('0x5')]]['name'],_0xab280f[_0x586e('0x24')],queues[_0xab280f[_0x586e('0x5')]]['queuecallerexitreason']));}}}catch(_0x30dce2){utils['error'](util[_0x586e('0x3')](_0x586e('0x21'),_0xab280f[_0x586e('0x5')]),_0x30dce2);}};exports[_0x586e('0x1a')]=function(_0x5adbbb){try{if(!_[_0x586e('0x17')](queues[_0x5adbbb[_0x586e('0x5')]])){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x2e'),_0x5adbbb[_0x586e('0x5')]),_0x5adbbb);queues[_0x5adbbb[_0x586e('0x5')]][_0x586e('0x28')]=![];queues[_0x5adbbb[_0x586e('0x5')]]['queuecallerexitAt']=null;queues[_0x5adbbb[_0x586e('0x5')]][_0x586e('0x1a')]=!![];queues[_0x5adbbb[_0x586e('0x5')]]['queuecallerabandonAt']=utils[_0x586e('0x14')]();queues[_0x5adbbb['uniqueid']][_0x586e('0xa')]=_0x586e('0x2f');utils['info'](util[_0x586e('0x3')](_0x586e('0x30'),_0x5adbbb[_0x586e('0x5')],queues[_0x5adbbb[_0x586e('0x5')]][_0x586e('0x1d')],queues[_0x5adbbb[_0x586e('0x5')]][_0x586e('0xa')]));}}catch(_0x20823a){utils[_0x586e('0x15')](util['format'](_0x586e('0x2e'),_0x5adbbb['uniqueid']),_0x20823a);}};exports['queuecallerleave']=function(_0x274929){try{if(!_[_0x586e('0x17')](queues[_0x274929['uniqueid']])){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x31'),_0x274929['uniqueid']),_0x274929);utils['info'](util[_0x586e('0x3')](_0x586e('0x32'),_0x274929['uniqueid'],queues[_0x274929[_0x586e('0x5')]][_0x586e('0x1d')],_0x274929['connectedlinenum'],_0x274929['connectedlinename']));queues[_0x274929[_0x586e('0x5')]][_0x586e('0x33')]=!![];queues[_0x274929['uniqueid']][_0x586e('0x19')]=utils['now']();queues[_0x274929[_0x586e('0x5')]][_0x586e('0x34')]=utils[_0x586e('0x35')](queues[_0x274929[_0x586e('0x5')]]['queuecallerleaveAt'],queues[_0x274929[_0x586e('0x5')]][_0x586e('0x36')]);queues[_0x274929['uniqueid']]['position']=_0x274929['position'];queues[_0x274929[_0x586e('0x5')]]['count']=_0x274929['count'];queues[_0x274929[_0x586e('0x5')]][_0x586e('0x37')]=_0x274929[_0x586e('0x37')];queues[_0x274929[_0x586e('0x5')]][_0x586e('0x38')]=_0x274929['connectedlinename'];}}catch(_0x11a77d){utils[_0x586e('0x15')](util[_0x586e('0x3')]('[%s][queues][queuecallerleave]',_0x274929['uniqueid']),_0x11a77d);}};exports[_0x586e('0x39')]=function(_0x401ea5){try{if(!_['isNil'](queues[_0x401ea5[_0x586e('0x5')]])){utils['debug'](util[_0x586e('0x3')](_0x586e('0x3a'),_0x401ea5['uniqueid']),_0x401ea5);utils[_0x586e('0x2')](util[_0x586e('0x3')](_0x586e('0x3b'),_0x401ea5[_0x586e('0x5')],queues[_0x401ea5['uniqueid']][_0x586e('0x1d')],_0x401ea5[_0x586e('0x3c')],_0x401ea5[_0x586e('0x3d')]));queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0x1a')]=![];queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0x1a')]=![];queues[_0x401ea5['uniqueid']][_0x586e('0x27')]=null;queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0x28')]=![];queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0xa')]=null;queues[_0x401ea5['uniqueid']][_0x586e('0x29')]=null;queues[_0x401ea5[_0x586e('0x5')]]['assigned']=!![];queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0x9')]=_0x401ea5[_0x586e('0x3d')];queues[_0x401ea5[_0x586e('0x5')]][_0x586e('0x3e')]=_0x401ea5['membername'];}}catch(_0x14466c){utils[_0x586e('0x15')](util[_0x586e('0x3')](_0x586e('0x3a'),_0x401ea5[_0x586e('0x5')]),_0x14466c);}};exports['agentcomplete']=function(_0x579cca){try{if(!_[_0x586e('0x17')](queues[_0x579cca['uniqueid']])){if(queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x19')]){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x3f'),_0x579cca[_0x586e('0x5')]),_0x579cca);queues[_0x579cca['uniqueid']][_0x586e('0x1a')]=![];queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x1a')]=![];queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x27')]=null;queues[_0x579cca['uniqueid']][_0x586e('0x28')]=![];queues[_0x579cca[_0x586e('0x5')]]['queuecallerexitAt']=null;queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x40')]=!![];queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x3e')]=_0x579cca[_0x586e('0x3c')];queues[_0x579cca['uniqueid']][_0x586e('0x1b')]=!![];queues[_0x579cca['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x579cca[_0x586e('0x41')]=='transfer'){if(!queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x42')]){queues[_0x579cca[_0x586e('0x5')]][_0x586e('0xa')]=_0x586e('0x43');}}else{queues[_0x579cca[_0x586e('0x5')]][_0x586e('0xa')]=_0x586e('0x44')+_0x579cca[_0x586e('0x41')][_0x586e('0x25')]();}utils[_0x586e('0x2')](util[_0x586e('0x3')](_0x586e('0x45'),_0x579cca[_0x586e('0x5')],queues[_0x579cca[_0x586e('0x5')]][_0x586e('0x1d')],_0x579cca[_0x586e('0x3c')],queues[_0x579cca['uniqueid']][_0x586e('0xa')]));writeDB(queues[_0x579cca[_0x586e('0x5')]]);}}}catch(_0x18b5c7){utils[_0x586e('0x15')](util['format'](_0x586e('0x3f'),_0x579cca[_0x586e('0x5')]),_0x18b5c7);}};exports['blindtransfer']=function(_0x534c53){try{if(!_['isNil'](queues[_0x534c53[_0x586e('0x46')]])){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x47'),_0x534c53[_0x586e('0x5')]),_0x534c53);queues[_0x534c53[_0x586e('0x46')]][_0x586e('0x42')]=!![];queues[_0x534c53['transfereeuniqueid']]['transfertype']=_0x586e('0x48');queues[_0x534c53['transfereeuniqueid']]['transferexten']=_0x534c53['extension'];queues[_0x534c53[_0x586e('0x46')]][_0x586e('0x49')]=_0x534c53[_0x586e('0x46')];queues[_0x534c53[_0x586e('0x46')]][_0x586e('0xa')]=_0x586e('0x4a');utils['info'](util['format'](_0x586e('0x4b'),_0x534c53[_0x586e('0x5')],queues[_0x534c53[_0x586e('0x46')]]['name'],_0x534c53[_0x586e('0x46')],_0x534c53['extension']));}}catch(_0x14f6e0){utils[_0x586e('0x15')](util[_0x586e('0x3')](_0x586e('0x47'),_0x534c53[_0x586e('0x5')]),_0x14f6e0);}};exports[_0x586e('0x4c')]=function(_0x3d1920){try{utils[_0x586e('0x20')](util['format'](_0x586e('0x4d'),_0x3d1920[_0x586e('0x4e')]),_0x3d1920);if(_0x3d1920[_0x586e('0x4e')]==_0x3d1920['origtransfererlinkedid']){if(!_[_0x586e('0x17')](queues[_0x3d1920[_0x586e('0x4f')]])){utils[_0x586e('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3d1920[_0x586e('0x4e')],queues[_0x3d1920[_0x586e('0x4f')]][_0x586e('0x1d')],_0x3d1920[_0x586e('0x50')]));queues[_0x3d1920[_0x586e('0x4f')]]['transfer']=!![];queues[_0x3d1920['secondtransfererlinkedid']][_0x586e('0x51')]=_0x586e('0x52');queues[_0x3d1920[_0x586e('0x4f')]]['transferexten']=_0x3d1920[_0x586e('0x50')];queues[_0x3d1920[_0x586e('0x4f')]][_0x586e('0x49')]=_0x3d1920[_0x586e('0x4e')];queues[_0x3d1920['secondtransfererlinkedid']][_0x586e('0xa')]=_0x586e('0x53');}if(!_[_0x586e('0x17')](queues[_0x3d1920[_0x586e('0x54')]])){if(_0x3d1920['transfereelinkedid']&&queues[_0x3d1920[_0x586e('0x55')]]){queues[_0x3d1920['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x3d1920[_0x586e('0x46')]]=_['clone'](queues[_0x3d1920['transfereelinkedid']]);queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0xf')]=_0x3d1920[_0x586e('0x56')];queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x1e')]=0x2;queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x8')]=queues[_0x3d1920[_0x586e('0x4f')]][_0x586e('0x8')];queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x57')]=queues[_0x3d1920[_0x586e('0x4f')]]['calleridname'];queues[_0x3d1920['transfereeuniqueid']][_0x586e('0x36')]=utils['now']();queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x19')]=utils[_0x586e('0x14')]();queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x34')]=0x0;queues[_0x3d1920[_0x586e('0x46')]]['mohtime']=0x0;utils[_0x586e('0x2')](util['format'](_0x586e('0x58'),_0x3d1920[_0x586e('0x4e')],queues[_0x3d1920[_0x586e('0x46')]]['name'],queues[_0x3d1920[_0x586e('0x46')]][_0x586e('0x8')],queues[_0x3d1920['transfereeuniqueid']][_0x586e('0x57')]));}else{utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3d1920[_0x586e('0x4e')],queues[_0x3d1920[_0x586e('0x54')]]['name'],_0x3d1920[_0x586e('0x4f')]));queues[_0x3d1920[_0x586e('0x54')]][_0x586e('0xf')]=_0x3d1920[_0x586e('0x4f')];}}}else if(_0x3d1920[_0x586e('0x59')]==_0x3d1920[_0x586e('0x4f')]){if(!_['isNil'](queues[_0x3d1920['origtransfererlinkedid']])){utils['info'](util[_0x586e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3d1920['origtransfereruniqueid'],queues[_0x3d1920[_0x586e('0x54')]]['name'],_0x3d1920['secondtransfereruniqueid'],_0x3d1920[_0x586e('0x5a')]));queues[_0x3d1920[_0x586e('0x54')]][_0x586e('0x42')]=!![];queues[_0x3d1920['origtransfererlinkedid']]['transfertype']=_0x586e('0x52');queues[_0x3d1920['origtransfererlinkedid']]['transferexten']=_0x3d1920[_0x586e('0x5a')];queues[_0x3d1920['origtransfererlinkedid']]['transferuniqueid']=_0x3d1920[_0x586e('0x59')];queues[_0x3d1920[_0x586e('0x54')]][_0x586e('0xa')]=_0x586e('0x53');}if(!_[_0x586e('0x17')](queues[_0x3d1920['secondtransfererlinkedid']])){if(_0x3d1920['transfertargetlinkedid']&&queues[_0x3d1920[_0x586e('0x5b')]]){queues[_0x3d1920[_0x586e('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x3d1920[_0x586e('0x56')]]=_[_0x586e('0x5c')](queues[_0x3d1920['transfertargetlinkedid']]);queues[_0x3d1920['transfertargetuniqueid']]['transfereduniqueid']=_0x3d1920['transfertargetuniqueid'];queues[_0x3d1920[_0x586e('0x56')]][_0x586e('0x1e')]=0x2;queues[_0x3d1920['transfertargetuniqueid']][_0x586e('0x8')]=queues[_0x3d1920[_0x586e('0x54')]][_0x586e('0x8')];queues[_0x3d1920['transfertargetuniqueid']][_0x586e('0x57')]=queues[_0x3d1920[_0x586e('0x54')]][_0x586e('0x57')];queues[_0x3d1920[_0x586e('0x56')]][_0x586e('0x36')]=utils[_0x586e('0x14')]();queues[_0x3d1920['transfertargetuniqueid']][_0x586e('0x19')]=utils[_0x586e('0x14')]();queues[_0x3d1920['transfertargetuniqueid']][_0x586e('0x34')]=0x0;queues[_0x3d1920[_0x586e('0x56')]][_0x586e('0x5d')]=0x0;utils[_0x586e('0x2')](util['format'](_0x586e('0x5e'),_0x3d1920[_0x586e('0x4e')],queues[_0x3d1920['transfertargetuniqueid']]['name'],queues[_0x3d1920['transfertargetuniqueid']][_0x586e('0xf')],queues[_0x3d1920[_0x586e('0x56')]]['calleridnum'],queues[_0x3d1920[_0x586e('0x56')]][_0x586e('0x57')]));}else{utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3d1920[_0x586e('0x4e')],queues[_0x3d1920['secondtransfererlinkedid']][_0x586e('0x1d')],_0x3d1920[_0x586e('0x54')]));queues[_0x3d1920[_0x586e('0x4f')]][_0x586e('0xf')]=_0x3d1920['origtransfererlinkedid'];}}}}catch(_0x46a1c4){utils[_0x586e('0x15')](util[_0x586e('0x3')]('[%s][queues][attendedtransfer]',_0x3d1920['origtransfereruniqueid']),_0x46a1c4);}};exports[_0x586e('0x5f')]=function(_0x1f99b1){try{if(!_[_0x586e('0x17')](queues[_0x1f99b1[_0x586e('0x5')]])){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x60'),_0x1f99b1['uniqueid']),_0x1f99b1);queues[_0x1f99b1[_0x586e('0x5')]]['musiconholdstartAt']=utils['now']();utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1f99b1[_0x586e('0x5')],queues[_0x1f99b1[_0x586e('0x5')]][_0x586e('0x1d')],queues[_0x1f99b1['uniqueid']][_0x586e('0x61')]));}}catch(_0x76c5b){utils[_0x586e('0x15')](util['format'](_0x586e('0x60'),_0x1f99b1['uniqueid']),_0x76c5b);}};exports['musiconholdstop']=function(_0x534518){try{if(!_[_0x586e('0x17')](queues[_0x534518[_0x586e('0x5')]])){if(!_[_0x586e('0x17')](queues[_0x534518[_0x586e('0x5')]][_0x586e('0x61')])){utils[_0x586e('0x20')](util[_0x586e('0x3')](_0x586e('0x62'),_0x534518[_0x586e('0x5')]),_0x534518);queues[_0x534518[_0x586e('0x5')]][_0x586e('0x5d')]+=utils['diffTime'](utils[_0x586e('0x14')](),queues[_0x534518['uniqueid']][_0x586e('0x61')]);utils[_0x586e('0x2')](util[_0x586e('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x534518['uniqueid'],queues[_0x534518[_0x586e('0x5')]][_0x586e('0x1d')],queues[_0x534518[_0x586e('0x5')]][_0x586e('0x5d')]));delete queues[_0x534518[_0x586e('0x5')]][_0x586e('0x61')];}}}catch(_0x5a439d){utils[_0x586e('0x15')](util[_0x586e('0x3')](_0x586e('0x62'),_0x534518[_0x586e('0x5')]),_0x5a439d);}}; \ No newline at end of file +var _0xee27=['[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%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','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','debug','[%s][queues][hangup]','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0xee27,0xe2));var _0x7ee2=function(_0x3ed7ab,_0x1bd279){_0x3ed7ab=_0x3ed7ab-0x0;var _0x3951b7=_0xee27[_0x3ed7ab];return _0x3951b7;};'use strict';var _=require(_0x7ee2('0x0'));var util=require(_0x7ee2('0x1'));var utils=require(_0x7ee2('0x2'));var queues={};function writeDB(_0x11b752){utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x5'),_0x11b752[_0x7ee2('0x6')],_0x11b752[_0x7ee2('0x7')],_0x11b752['queue'],_0x11b752[_0x7ee2('0x8')],_0x11b752[_0x7ee2('0x9')],_0x11b752[_0x7ee2('0xa')],_0x11b752[_0x7ee2('0xb')]));if(_0x11b752[_0x7ee2('0xc')]){utils[_0x7ee2('0xd')](_0x11b752[_0x7ee2('0xc')])[_0x7ee2('0xe')](function(_0x3c9331){if(_0x3c9331){_0x11b752['type']=_0x3c9331[_0x7ee2('0xf')];}utils[_0x7ee2('0x10')](_0x7ee2('0x11'),_0x11b752);});}else{utils[_0x7ee2('0x10')](_0x7ee2('0x11'),_0x11b752);}if(_0x11b752[_0x7ee2('0x12')]){delete queues[_0x11b752[_0x7ee2('0x12')]];}else{delete queues[_0x11b752[_0x7ee2('0x6')]];}}exports['queuecallerjoin']=function(_0x4731c3){try{utils['debug'](util[_0x7ee2('0x4')]('[%s][queues][queuecallerjoin]',_0x4731c3[_0x7ee2('0x6')]),_0x4731c3);utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x13'),_0x4731c3[_0x7ee2('0x6')],_0x4731c3[_0x7ee2('0xc')],_0x4731c3[_0x7ee2('0x14')]));queues[_0x4731c3[_0x7ee2('0x6')]]=_['assign'](_0x4731c3,{'originalposition':_0x4731c3['position'],'queuecallerjoinAt':utils[_0x7ee2('0x15')](),'mohtime':0x0});}catch(_0x172b1b){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x17'),_0x4731c3[_0x7ee2('0x6')]),_0x172b1b);}};exports[_0x7ee2('0x18')]=function(_0x48539b){try{if(!_[_0x7ee2('0x19')](queues[_0x48539b['uniqueid']])){utils[_0x7ee2('0x1a')](util[_0x7ee2('0x4')](_0x7ee2('0x1b'),_0x48539b['uniqueid']),_0x48539b);if(queues[_0x48539b['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0x1c')]&&!queues[_0x48539b['uniqueid']]['queuecallerexit']){queues[_0x48539b['uniqueid']]['queuecallercomplete']=!![];queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0x1d')]=utils['now']();queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0xb')]=_0x7ee2('0x1e');}utils['info'](util[_0x7ee2('0x4')](_0x7ee2('0x1f'),_0x48539b[_0x7ee2('0x6')],queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0x20')],queues[_0x48539b[_0x7ee2('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x48539b['uniqueid']]);}else if(queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0x12')]){utils['info'](util[_0x7ee2('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x48539b['uniqueid'],queues[_0x48539b['uniqueid']][_0x7ee2('0x20')],queues[_0x48539b['uniqueid']][_0x7ee2('0x12')]));queues[queues[_0x48539b[_0x7ee2('0x6')]][_0x7ee2('0x12')]]=queues[_0x48539b[_0x7ee2('0x6')]];queues[queues[_0x48539b[_0x7ee2('0x6')]]['transfereduniqueid']][_0x7ee2('0x21')]=0x2;delete queues[_0x48539b[_0x7ee2('0x6')]];}}}catch(_0x41a8a7){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x1b'),_0x48539b[_0x7ee2('0x6')]),_0x41a8a7);}};exports[_0x7ee2('0x22')]=function(_0x223878){try{utils['debug'](util['format'](_0x7ee2('0x23'),_0x223878['uniqueid']),_0x223878);if(!_[_0x7ee2('0x19')](_0x223878[_0x7ee2('0x24')][_0x7ee2('0x25')])&&_0x223878[_0x7ee2('0x26')][_0x7ee2('0x27')]()!==_0x7ee2('0x28')){if(!_[_0x7ee2('0x19')](queues[_0x223878[_0x7ee2('0x6')]])){queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x1c')]=![];queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x29')]=null;queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x2a')]=!![];queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x2b')]=utils[_0x7ee2('0x15')]();queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0xb')]=_0x223878[_0x7ee2('0x26')][_0x7ee2('0x27')]();utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x223878[_0x7ee2('0x6')],queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x20')],_0x223878[_0x7ee2('0x26')],queues[_0x223878['uniqueid']][_0x7ee2('0xb')]));writeDB(queues[_0x223878[_0x7ee2('0x6')]]);}}else if(!_['isNil'](_0x223878[_0x7ee2('0x24')][_0x7ee2('0x2c')])){if(!_[_0x7ee2('0x19')](queues[_0x223878[_0x7ee2('0x6')]])&&!queues[_0x223878['uniqueid']][_0x7ee2('0x1c')]){queues[_0x223878['uniqueid']][_0x7ee2('0x1c')]=![];queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x29')]=null;queues[_0x223878[_0x7ee2('0x6')]]['queuecallerexit']=!![];queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x2b')]=utils[_0x7ee2('0x15')]();queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0xb')]=_0x7ee2('0x2d');utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x2e'),_0x223878[_0x7ee2('0x6')],queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0x20')],_0x223878['value'],queues[_0x223878[_0x7ee2('0x6')]][_0x7ee2('0xb')]));}}}catch(_0x47ca6e){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')]('[%s][queues][varset]',_0x223878[_0x7ee2('0x6')]),_0x47ca6e);}};exports[_0x7ee2('0x1c')]=function(_0x192b65){try{if(!_[_0x7ee2('0x19')](queues[_0x192b65[_0x7ee2('0x6')]])){utils['debug'](util['format'](_0x7ee2('0x2f'),_0x192b65[_0x7ee2('0x6')]),_0x192b65);queues[_0x192b65[_0x7ee2('0x6')]]['queuecallerexit']=![];queues[_0x192b65[_0x7ee2('0x6')]]['queuecallerexitAt']=null;queues[_0x192b65[_0x7ee2('0x6')]][_0x7ee2('0x1c')]=!![];queues[_0x192b65['uniqueid']][_0x7ee2('0x29')]=utils[_0x7ee2('0x15')]();queues[_0x192b65[_0x7ee2('0x6')]]['queuecallerexitreason']='ABANDONED';utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x30'),_0x192b65[_0x7ee2('0x6')],queues[_0x192b65[_0x7ee2('0x6')]][_0x7ee2('0x20')],queues[_0x192b65['uniqueid']][_0x7ee2('0xb')]));}}catch(_0x3ae3b7){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x2f'),_0x192b65[_0x7ee2('0x6')]),_0x3ae3b7);}};exports[_0x7ee2('0x31')]=function(_0x4cc0d2){try{if(!_[_0x7ee2('0x19')](queues[_0x4cc0d2[_0x7ee2('0x6')]])){utils[_0x7ee2('0x1a')](util[_0x7ee2('0x4')](_0x7ee2('0x32'),_0x4cc0d2[_0x7ee2('0x6')]),_0x4cc0d2);utils['info'](util[_0x7ee2('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4cc0d2[_0x7ee2('0x6')],queues[_0x4cc0d2[_0x7ee2('0x6')]]['name'],_0x4cc0d2[_0x7ee2('0x33')],_0x4cc0d2['connectedlinename']));queues[_0x4cc0d2[_0x7ee2('0x6')]][_0x7ee2('0x31')]=!![];queues[_0x4cc0d2[_0x7ee2('0x6')]][_0x7ee2('0x34')]=utils[_0x7ee2('0x15')]();queues[_0x4cc0d2['uniqueid']][_0x7ee2('0x35')]=utils['diffTime'](queues[_0x4cc0d2['uniqueid']][_0x7ee2('0x34')],queues[_0x4cc0d2[_0x7ee2('0x6')]][_0x7ee2('0x36')]);queues[_0x4cc0d2[_0x7ee2('0x6')]][_0x7ee2('0x14')]=_0x4cc0d2['position'];queues[_0x4cc0d2[_0x7ee2('0x6')]]['count']=_0x4cc0d2[_0x7ee2('0x37')];queues[_0x4cc0d2[_0x7ee2('0x6')]][_0x7ee2('0x33')]=_0x4cc0d2[_0x7ee2('0x33')];queues[_0x4cc0d2['uniqueid']][_0x7ee2('0x38')]=_0x4cc0d2[_0x7ee2('0x38')];}}catch(_0x5109bb){utils[_0x7ee2('0x16')](util['format'](_0x7ee2('0x32'),_0x4cc0d2[_0x7ee2('0x6')]),_0x5109bb);}};exports[_0x7ee2('0x39')]=function(_0x17c312){try{if(!_[_0x7ee2('0x19')](queues[_0x17c312[_0x7ee2('0x6')]])){utils['debug'](util[_0x7ee2('0x4')](_0x7ee2('0x3a'),_0x17c312[_0x7ee2('0x6')]),_0x17c312);utils['info'](util[_0x7ee2('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x17c312[_0x7ee2('0x6')],queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x20')],_0x17c312[_0x7ee2('0x3b')],_0x17c312[_0x7ee2('0x3c')]));queues[_0x17c312['uniqueid']][_0x7ee2('0x1c')]=![];queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x1c')]=![];queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x29')]=null;queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x2a')]=![];queues[_0x17c312[_0x7ee2('0x6')]]['queuecallerexitreason']=null;queues[_0x17c312[_0x7ee2('0x6')]]['queuecallerexitAt']=null;queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x3d')]=!![];queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0xa')]=_0x17c312[_0x7ee2('0x3c')];queues[_0x17c312[_0x7ee2('0x6')]][_0x7ee2('0x8')]=_0x17c312[_0x7ee2('0x3b')];}}catch(_0x30b263){utils['error'](util[_0x7ee2('0x4')](_0x7ee2('0x3a'),_0x17c312[_0x7ee2('0x6')]),_0x30b263);}};exports[_0x7ee2('0x3e')]=function(_0x1a1a15){try{if(!_[_0x7ee2('0x19')](queues[_0x1a1a15[_0x7ee2('0x6')]])){if(queues[_0x1a1a15[_0x7ee2('0x6')]]['queuecallerleaveAt']){utils[_0x7ee2('0x1a')](util['format'](_0x7ee2('0x3f'),_0x1a1a15[_0x7ee2('0x6')]),_0x1a1a15);queues[_0x1a1a15['uniqueid']]['queuecallerabandon']=![];queues[_0x1a1a15['uniqueid']][_0x7ee2('0x1c')]=![];queues[_0x1a1a15[_0x7ee2('0x6')]]['queuecallerabandonAt']=null;queues[_0x1a1a15['uniqueid']]['queuecallerexit']=![];queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0x2b')]=null;queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0x3d')]=!![];queues[_0x1a1a15[_0x7ee2('0x6')]]['lastAssignedTo']=_0x1a1a15[_0x7ee2('0x3b')];queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0x40')]=!![];queues[_0x1a1a15['uniqueid']][_0x7ee2('0x1d')]=utils['now']();if(_0x1a1a15[_0x7ee2('0x41')]=='transfer'){if(!queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0x42')]){queues[_0x1a1a15[_0x7ee2('0x6')]]['queuecallerexitreason']=_0x7ee2('0x43');}}else{queues[_0x1a1a15[_0x7ee2('0x6')]]['queuecallerexitreason']='COMPLETEDBY'+_0x1a1a15[_0x7ee2('0x41')][_0x7ee2('0x27')]();}utils['info'](util[_0x7ee2('0x4')](_0x7ee2('0x44'),_0x1a1a15[_0x7ee2('0x6')],queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0x20')],_0x1a1a15[_0x7ee2('0x3b')],queues[_0x1a1a15[_0x7ee2('0x6')]][_0x7ee2('0xb')]));writeDB(queues[_0x1a1a15[_0x7ee2('0x6')]]);}}}catch(_0x19f91f){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x3f'),_0x1a1a15[_0x7ee2('0x6')]),_0x19f91f);}};exports['blindtransfer']=function(_0x42d4a1){try{if(!_['isNil'](queues[_0x42d4a1['transfereeuniqueid']])){utils[_0x7ee2('0x1a')](util[_0x7ee2('0x4')](_0x7ee2('0x45'),_0x42d4a1[_0x7ee2('0x6')]),_0x42d4a1);queues[_0x42d4a1[_0x7ee2('0x46')]][_0x7ee2('0x42')]=!![];queues[_0x42d4a1['transfereeuniqueid']][_0x7ee2('0x47')]=_0x7ee2('0x48');queues[_0x42d4a1[_0x7ee2('0x46')]][_0x7ee2('0x49')]=_0x42d4a1[_0x7ee2('0x4a')];queues[_0x42d4a1[_0x7ee2('0x46')]][_0x7ee2('0x4b')]=_0x42d4a1[_0x7ee2('0x46')];queues[_0x42d4a1[_0x7ee2('0x46')]][_0x7ee2('0xb')]=_0x7ee2('0x4c');utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x4d'),_0x42d4a1[_0x7ee2('0x6')],queues[_0x42d4a1['transfereeuniqueid']]['name'],_0x42d4a1['transfereeuniqueid'],_0x42d4a1[_0x7ee2('0x4a')]));}}catch(_0x1cb440){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')]('[%s][queues][blindtransfer]',_0x42d4a1['uniqueid']),_0x1cb440);}};exports['attendedtransfer']=function(_0x42998e){try{utils[_0x7ee2('0x1a')](util['format'](_0x7ee2('0x4e'),_0x42998e[_0x7ee2('0x4f')]),_0x42998e);if(_0x42998e[_0x7ee2('0x4f')]==_0x42998e[_0x7ee2('0x50')]){if(!_['isNil'](queues[_0x42998e[_0x7ee2('0x51')]])){utils[_0x7ee2('0x3')](util['format'](_0x7ee2('0x52'),_0x42998e[_0x7ee2('0x4f')],queues[_0x42998e['secondtransfererlinkedid']][_0x7ee2('0x20')],_0x42998e['origtransfererexten']));queues[_0x42998e[_0x7ee2('0x51')]][_0x7ee2('0x42')]=!![];queues[_0x42998e[_0x7ee2('0x51')]][_0x7ee2('0x47')]='ATTENDED';queues[_0x42998e[_0x7ee2('0x51')]]['transferexten']=_0x42998e[_0x7ee2('0x53')];queues[_0x42998e[_0x7ee2('0x51')]][_0x7ee2('0x4b')]=_0x42998e[_0x7ee2('0x4f')];queues[_0x42998e['secondtransfererlinkedid']][_0x7ee2('0xb')]=_0x7ee2('0x54');}if(!_[_0x7ee2('0x19')](queues[_0x42998e['origtransfererlinkedid']])){if(_0x42998e[_0x7ee2('0x55')]&&queues[_0x42998e['transfereelinkedid']]){queues[_0x42998e[_0x7ee2('0x55')]][_0x7ee2('0x21')]=0x1;queues[_0x42998e['transfereeuniqueid']]=_[_0x7ee2('0x56')](queues[_0x42998e[_0x7ee2('0x55')]]);queues[_0x42998e['transfereeuniqueid']][_0x7ee2('0x12')]=_0x42998e['transfertargetuniqueid'];queues[_0x42998e[_0x7ee2('0x46')]]['queuecallerenterreason']=0x2;queues[_0x42998e['transfereeuniqueid']][_0x7ee2('0x9')]=queues[_0x42998e['secondtransfererlinkedid']][_0x7ee2('0x9')];queues[_0x42998e['transfereeuniqueid']][_0x7ee2('0x57')]=queues[_0x42998e[_0x7ee2('0x51')]]['calleridname'];queues[_0x42998e[_0x7ee2('0x46')]]['queuecallerjoinAt']=utils[_0x7ee2('0x15')]();queues[_0x42998e['transfereeuniqueid']][_0x7ee2('0x34')]=utils[_0x7ee2('0x15')]();queues[_0x42998e[_0x7ee2('0x46')]][_0x7ee2('0x35')]=0x0;queues[_0x42998e[_0x7ee2('0x46')]][_0x7ee2('0x58')]=0x0;utils['info'](util[_0x7ee2('0x4')](_0x7ee2('0x59'),_0x42998e[_0x7ee2('0x4f')],queues[_0x42998e['transfereeuniqueid']]['name'],queues[_0x42998e[_0x7ee2('0x46')]][_0x7ee2('0x9')],queues[_0x42998e[_0x7ee2('0x46')]][_0x7ee2('0x57')]));}else{utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x5a'),_0x42998e['origtransfereruniqueid'],queues[_0x42998e[_0x7ee2('0x50')]][_0x7ee2('0x20')],_0x42998e['secondtransfererlinkedid']));queues[_0x42998e['origtransfererlinkedid']][_0x7ee2('0x12')]=_0x42998e[_0x7ee2('0x51')];}}}else if(_0x42998e['secondtransfereruniqueid']==_0x42998e[_0x7ee2('0x51')]){if(!_[_0x7ee2('0x19')](queues[_0x42998e[_0x7ee2('0x50')]])){utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x5b'),_0x42998e['origtransfereruniqueid'],queues[_0x42998e[_0x7ee2('0x50')]][_0x7ee2('0x20')],_0x42998e[_0x7ee2('0x5c')],_0x42998e['secondtransfererexten']));queues[_0x42998e['origtransfererlinkedid']][_0x7ee2('0x42')]=!![];queues[_0x42998e[_0x7ee2('0x50')]][_0x7ee2('0x47')]=_0x7ee2('0x5d');queues[_0x42998e['origtransfererlinkedid']]['transferexten']=_0x42998e[_0x7ee2('0x5e')];queues[_0x42998e[_0x7ee2('0x50')]][_0x7ee2('0x4b')]=_0x42998e[_0x7ee2('0x5c')];queues[_0x42998e['origtransfererlinkedid']][_0x7ee2('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x7ee2('0x19')](queues[_0x42998e[_0x7ee2('0x51')]])){if(_0x42998e[_0x7ee2('0x5f')]&&queues[_0x42998e[_0x7ee2('0x5f')]]){queues[_0x42998e[_0x7ee2('0x5f')]][_0x7ee2('0x21')]=0x1;queues[_0x42998e[_0x7ee2('0x60')]]=_[_0x7ee2('0x56')](queues[_0x42998e[_0x7ee2('0x5f')]]);queues[_0x42998e[_0x7ee2('0x60')]]['transfereduniqueid']=_0x42998e[_0x7ee2('0x60')];queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x21')]=0x2;queues[_0x42998e[_0x7ee2('0x60')]]['calleridnum']=queues[_0x42998e[_0x7ee2('0x50')]]['calleridnum'];queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x57')]=queues[_0x42998e['origtransfererlinkedid']][_0x7ee2('0x57')];queues[_0x42998e['transfertargetuniqueid']][_0x7ee2('0x36')]=utils[_0x7ee2('0x15')]();queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x34')]=utils[_0x7ee2('0x15')]();queues[_0x42998e['transfertargetuniqueid']][_0x7ee2('0x35')]=0x0;queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x58')]=0x0;utils['info'](util[_0x7ee2('0x4')](_0x7ee2('0x61'),_0x42998e[_0x7ee2('0x4f')],queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x20')],queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x12')],queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x9')],queues[_0x42998e[_0x7ee2('0x60')]][_0x7ee2('0x57')]));}else{utils[_0x7ee2('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x42998e['origtransfereruniqueid'],queues[_0x42998e[_0x7ee2('0x51')]][_0x7ee2('0x20')],_0x42998e[_0x7ee2('0x50')]));queues[_0x42998e['secondtransfererlinkedid']]['transfereduniqueid']=_0x42998e[_0x7ee2('0x50')];}}}}catch(_0x40161d){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x4e'),_0x42998e[_0x7ee2('0x4f')]),_0x40161d);}};exports[_0x7ee2('0x62')]=function(_0x4be6b3){try{if(!_[_0x7ee2('0x19')](queues[_0x4be6b3[_0x7ee2('0x6')]])){utils['debug'](util['format'](_0x7ee2('0x63'),_0x4be6b3['uniqueid']),_0x4be6b3);queues[_0x4be6b3[_0x7ee2('0x6')]][_0x7ee2('0x64')]=utils['now']();utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x65'),_0x4be6b3[_0x7ee2('0x6')],queues[_0x4be6b3[_0x7ee2('0x6')]][_0x7ee2('0x20')],queues[_0x4be6b3[_0x7ee2('0x6')]][_0x7ee2('0x64')]));}}catch(_0x2dbe09){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x63'),_0x4be6b3[_0x7ee2('0x6')]),_0x2dbe09);}};exports['musiconholdstop']=function(_0x2a1c41){try{if(!_[_0x7ee2('0x19')](queues[_0x2a1c41[_0x7ee2('0x6')]])){if(!_[_0x7ee2('0x19')](queues[_0x2a1c41['uniqueid']][_0x7ee2('0x64')])){utils[_0x7ee2('0x1a')](util[_0x7ee2('0x4')]('[%s][queues][musiconholdstop]',_0x2a1c41[_0x7ee2('0x6')]),_0x2a1c41);queues[_0x2a1c41[_0x7ee2('0x6')]]['mohtime']+=utils[_0x7ee2('0x66')](utils['now'](),queues[_0x2a1c41[_0x7ee2('0x6')]]['musiconholdstartAt']);utils[_0x7ee2('0x3')](util[_0x7ee2('0x4')](_0x7ee2('0x67'),_0x2a1c41['uniqueid'],queues[_0x2a1c41[_0x7ee2('0x6')]][_0x7ee2('0x20')],queues[_0x2a1c41[_0x7ee2('0x6')]][_0x7ee2('0x58')]));delete queues[_0x2a1c41['uniqueid']][_0x7ee2('0x64')];}}}catch(_0x260561){utils[_0x7ee2('0x16')](util[_0x7ee2('0x4')](_0x7ee2('0x68'),_0x2a1c41['uniqueid']),_0x260561);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 69dcfd0..9d90a79 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 _0xe785=['calleridname','cause-txt','connectedlinenum','connectedlinename','clone','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','channel','error','newstate','[%s][recordings][newstate]','channelstate','context','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum'];(function(_0x36fb0d,_0x220801){var _0x515e2e=function(_0x38afe2){while(--_0x38afe2){_0x36fb0d['push'](_0x36fb0d['shift']());}};_0x515e2e(++_0x220801);}(_0xe785,0x13c));var _0x5e78=function(_0x422a93,_0xcaa914){_0x422a93=_0x422a93-0x0;var _0xae0bdd=_0xe785[_0x422a93];return _0xae0bdd;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x506ea8){var _0x4f6c52;utils[_0x5e78('0x2')](util[_0x5e78('0x3')](_0x5e78('0x4'),_0x506ea8[_0x5e78('0x5')]));if(transfers[_0x5e78('0x6')][_0x506ea8[_0x5e78('0x5')]]){_0x4f6c52=_0x506ea8[_0x5e78('0x5')];_0x506ea8['uniqueid']=transfers['blinds'][_0x506ea8['uniqueid']]['transfereeuniqueid'];}if(_0x506ea8[_0x5e78('0x7')]){utils[_0x5e78('0x8')](_0x506ea8[_0x5e78('0x7')])[_0x5e78('0x9')](function(_0x19c5f7){if(_0x19c5f7){_0x506ea8[_0x5e78('0xa')]=_0x19c5f7[_0x5e78('0xb')];_0x506ea8[_0x5e78('0xc')]=_0x19c5f7['id'];}utils[_0x5e78('0xd')](_0x5e78('0xe'),_0x506ea8);});}else{utils[_0x5e78('0xd')](_0x5e78('0xe'),_0x506ea8);}if(_0x4f6c52)delete transfers[_0x5e78('0x6')][_0x4f6c52];}exports['newchannel']=function(_0x2d5817){try{utils[_0x5e78('0xf')](util[_0x5e78('0x3')](_0x5e78('0x10'),_0x2d5817[_0x5e78('0x5')]),_0x2d5817);if(_0x2d5817['uniqueid']==_0x2d5817['linkedid']){utils[_0x5e78('0x2')](util[_0x5e78('0x3')](_0x5e78('0x11'),_0x2d5817[_0x5e78('0x5')],_0x2d5817['context'],_0x2d5817['exten']));recordings[_0x2d5817['uniqueid']]={'uniqueid':_0x2d5817['uniqueid'],'accountcode':_0x2d5817[_0x5e78('0x7')],'exten':_0x2d5817['exten'],'context':_0x2d5817['context'],'channel':_0x2d5817[_0x5e78('0x12')],'monitors':[]};}}catch(_0x33f649){utils[_0x5e78('0x13')](util[_0x5e78('0x3')]('[%s][recordings][newchannel]',_0x2d5817[_0x5e78('0x5')]),_0x33f649);}};exports[_0x5e78('0x14')]=function(_0x1c4dba){try{utils[_0x5e78('0xf')](util[_0x5e78('0x3')](_0x5e78('0x15'),_0x1c4dba[_0x5e78('0x5')]),_0x1c4dba);if(!_['isNil'](recordings[_0x1c4dba[_0x5e78('0x5')]])&&_0x1c4dba[_0x5e78('0x16')]==0x6){utils[_0x5e78('0x2')](util[_0x5e78('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1c4dba[_0x5e78('0x5')],_0x1c4dba[_0x5e78('0x17')],_0x1c4dba[_0x5e78('0x12')]));}else if(!_[_0x5e78('0x18')](recordings[_0x1c4dba['linkedid']])&&_0x1c4dba[_0x5e78('0x16')]==0x6&&_0x1c4dba[_0x5e78('0x17')]!=_0x5e78('0x19')){utils[_0x5e78('0x2')](util[_0x5e78('0x3')](_0x5e78('0x1a'),_0x1c4dba[_0x5e78('0x5')],_0x1c4dba[_0x5e78('0x1b')],_0x1c4dba[_0x5e78('0x17')],_0x1c4dba[_0x5e78('0x12')]));recordings[_0x1c4dba[_0x5e78('0x1b')]][_0x5e78('0x7')]=_0x1c4dba[_0x5e78('0x7')];}}catch(_0x65f804){utils[_0x5e78('0x13')](util[_0x5e78('0x3')]('[%s][recordings][newstate]',_0x1c4dba[_0x5e78('0x5')]),_0x65f804);}};exports[_0x5e78('0x1c')]=function(_0x5524be){try{if(!_[_0x5e78('0x18')](_0x5524be[_0x5e78('0x1d')])&&!_[_0x5e78('0x18')](_0x5524be['variable'][_0x5e78('0x1e')])){utils['debug'](util[_0x5e78('0x3')]('[%s][recordings][varset]',_0x5524be[_0x5e78('0x5')]),_0x5524be);utils[_0x5e78('0x2')](util[_0x5e78('0x3')](_0x5e78('0x1f'),_0x5524be[_0x5e78('0x5')],_0x5524be['variable'],_0x5524be[_0x5e78('0x20')]));if(_[_0x5e78('0x21')](_0x5524be[_0x5e78('0x20')],_0x5e78('0x22'))){_0x5524be[_0x5e78('0x20')]=_0x5524be[_0x5e78('0x20')][_0x5e78('0x23')](_0x5e78('0x22'),'.WAV');}if(recordings[_0x5524be['linkedid']]){var _0x460ea4=_[_0x5e78('0x24')](recordings[_0x5524be[_0x5e78('0x1b')]]['monitors'],{'value':_0x5524be['value']});if(_[_0x5e78('0x18')](_0x460ea4)){recordings[_0x5524be['linkedid']][_0x5e78('0x25')][_0x5e78('0x26')]({'value':_0x5524be[_0x5e78('0x20')]});}}}}catch(_0x1088dc){utils[_0x5e78('0x13')](util[_0x5e78('0x3')](_0x5e78('0x27'),_0x5524be['uniqueid']),_0x1088dc);}};exports[_0x5e78('0x28')]=function(_0x3ea412){try{if(!_[_0x5e78('0x18')](recordings[_0x3ea412[_0x5e78('0x5')]])){utils['debug'](util['format'](_0x5e78('0x29'),_0x3ea412['uniqueid']),_0x3ea412);utils[_0x5e78('0x2')](util['format'](_0x5e78('0x2a'),_0x3ea412['uniqueid'],_0x3ea412[_0x5e78('0x2b')],_0x3ea412[_0x5e78('0x2c')],_0x3ea412[_0x5e78('0x2d')]));recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x2b')]=_0x3ea412[_0x5e78('0x2b')];recordings[_0x3ea412['uniqueid']][_0x5e78('0x2c')]=_0x3ea412[_0x5e78('0x2c')];recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x2e')]=_0x3ea412[_0x5e78('0x2e')];recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x2f')]=_0x3ea412[_0x5e78('0x2f')];if(recordings[_0x3ea412['uniqueid']]['type']=='outbound'&&recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x7')]){recordings[_0x3ea412['uniqueid']][_0x5e78('0x2e')]=recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x7')];recordings[_0x3ea412[_0x5e78('0x5')]][_0x5e78('0x2f')]='';}recordings[_0x3ea412['uniqueid']][_0x5e78('0x25')]['forEach'](function(_0x4cfb4f){var _0x4ae3b9=_[_0x5e78('0x30')](recordings[_0x3ea412[_0x5e78('0x5')]]);_0x4ae3b9[_0x5e78('0x20')]=_0x4cfb4f['value'];writeDB(_0x4ae3b9);});delete recordings[_0x3ea412[_0x5e78('0x5')]];}}catch(_0xea900e){utils['error'](util['format']('[%s][recordings][hangup]',_0x3ea412[_0x5e78('0x5')]),_0xea900e);}};exports[_0x5e78('0x31')]=function(_0x208616){try{if(!_[_0x5e78('0x18')](recordings[_0x208616[_0x5e78('0x5')]])){utils[_0x5e78('0xf')](util[_0x5e78('0x3')]('[%s][recordings][newexten]',_0x208616[_0x5e78('0x5')]),_0x208616);utils[_0x5e78('0x2')](util[_0x5e78('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x208616[_0x5e78('0x5')],_0x208616[_0x5e78('0x32')],_0x208616[_0x5e78('0x33')]));if(_0x208616[_0x5e78('0x32')][_0x5e78('0x34')]()==_0x5e78('0x35')&&_[_0x5e78('0x36')](_0x208616['appdata'][_0x5e78('0x34')](),_0x5e78('0x37'))){var _0x3c2ea6=_0x208616[_0x5e78('0x33')][_0x5e78('0x38')]('=');var _0xd94a1b=_0x3c2ea6[0x0][_0x5e78('0x39')](_0x3c2ea6[0x0][_0x5e78('0x3a')]('(')+0x1,_0x3c2ea6[0x0][_0x5e78('0x3a')](')'));var _0x2330e3=_0x3c2ea6[0x1];recordings[_0x208616['uniqueid']][_0xd94a1b]=_0x2330e3;}}}catch(_0x54d28d){utils[_0x5e78('0x13')](util['format'](_0x5e78('0x3b'),_0x208616[_0x5e78('0x5')]),_0x54d28d);}};exports[_0x5e78('0x3c')]=function(_0x42e330){try{if(!_[_0x5e78('0x18')](recordings[_0x42e330[_0x5e78('0x5')]])){utils[_0x5e78('0xf')](util[_0x5e78('0x3')]('[%s][recordings][queuecallerjoin]',_0x42e330['uniqueid']),_0x42e330);utils[_0x5e78('0x2')](util[_0x5e78('0x3')](_0x5e78('0x3d'),_0x42e330[_0x5e78('0x5')],_0x42e330[_0x5e78('0x3e')]));recordings[_0x42e330[_0x5e78('0x5')]]['queue']=_0x42e330['queue'];}}catch(_0x3e6113){utils[_0x5e78('0x13')](util[_0x5e78('0x3')](_0x5e78('0x3f'),_0x42e330['uniqueid']),_0x3e6113);}};exports[_0x5e78('0x40')]=function(_0x51440c){try{utils[_0x5e78('0xf')](util['format']('[%s][recordings][blindtransfer]',_0x51440c['uniqueid']),_0x51440c);utils[_0x5e78('0x2')](util['format'](_0x5e78('0x41'),_0x51440c[_0x5e78('0x5')],_0x51440c[_0x5e78('0x42')],_0x51440c[_0x5e78('0x43')],_0x51440c['transfereecalleridnum'],_0x51440c[_0x5e78('0x44')]));if(recordings[_0x51440c['transfereruniqueid']]&&transfers['blinds'][_0x51440c[_0x5e78('0x45')]]){transfers[_0x5e78('0x6')][_0x51440c[_0x5e78('0x45')]][_0x5e78('0x46')]=!![];}}catch(_0x1c6808){utils[_0x5e78('0x13')](util[_0x5e78('0x3')](_0x5e78('0x47'),_0x51440c[_0x5e78('0x5')]),_0x1c6808);}}; \ No newline at end of file +var _0xb016=['connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','exten','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xb016,0x1c5));var _0x6b01=function(_0x5eb7d7,_0xdefdbe){_0x5eb7d7=_0x5eb7d7-0x0;var _0x4821a6=_0xb016[_0x5eb7d7];return _0x4821a6;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x6b01('0x0'));var transfers=require(_0x6b01('0x1'));var recordings={};function writeDB(_0x18a319){var _0x1f95d5;utils[_0x6b01('0x2')](util[_0x6b01('0x3')](_0x6b01('0x4'),_0x18a319[_0x6b01('0x5')]));if(transfers[_0x6b01('0x6')][_0x18a319['uniqueid']]){_0x1f95d5=_0x18a319[_0x6b01('0x5')];_0x18a319[_0x6b01('0x5')]=transfers[_0x6b01('0x6')][_0x18a319[_0x6b01('0x5')]][_0x6b01('0x7')];}if(_0x18a319['accountcode']){utils[_0x6b01('0x8')](_0x18a319[_0x6b01('0x9')])[_0x6b01('0xa')](function(_0x16cee4){if(_0x16cee4){_0x18a319[_0x6b01('0xb')]=_0x16cee4[_0x6b01('0xc')];_0x18a319[_0x6b01('0xd')]=_0x16cee4['id'];}utils[_0x6b01('0xe')](_0x6b01('0xf'),_0x18a319);});}else{utils[_0x6b01('0xe')]('CreateVoiceRecording',_0x18a319);}if(_0x1f95d5)delete transfers[_0x6b01('0x6')][_0x1f95d5];}exports[_0x6b01('0x10')]=function(_0x169034){try{utils[_0x6b01('0x11')](util[_0x6b01('0x3')](_0x6b01('0x12'),_0x169034[_0x6b01('0x5')]),_0x169034);if(_0x169034[_0x6b01('0x5')]==_0x169034['linkedid']){utils['info'](util[_0x6b01('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x169034[_0x6b01('0x5')],_0x169034[_0x6b01('0x13')],_0x169034[_0x6b01('0x14')]));recordings[_0x169034['uniqueid']]={'uniqueid':_0x169034[_0x6b01('0x5')],'accountcode':_0x169034[_0x6b01('0x9')],'exten':_0x169034[_0x6b01('0x14')],'context':_0x169034[_0x6b01('0x13')],'channel':_0x169034['channel'],'monitors':[]};}}catch(_0x258c2a){utils[_0x6b01('0x15')](util['format'](_0x6b01('0x12'),_0x169034[_0x6b01('0x5')]),_0x258c2a);}};exports['newstate']=function(_0x188c21){try{utils[_0x6b01('0x11')](util['format'](_0x6b01('0x16'),_0x188c21[_0x6b01('0x5')]),_0x188c21);if(!_[_0x6b01('0x17')](recordings[_0x188c21[_0x6b01('0x5')]])&&_0x188c21[_0x6b01('0x18')]==0x6){utils[_0x6b01('0x2')](util[_0x6b01('0x3')](_0x6b01('0x19'),_0x188c21['uniqueid'],_0x188c21[_0x6b01('0x13')],_0x188c21[_0x6b01('0x1a')]));}else if(!_[_0x6b01('0x17')](recordings[_0x188c21[_0x6b01('0x1b')]])&&_0x188c21[_0x6b01('0x18')]==0x6&&_0x188c21[_0x6b01('0x13')]!='transfer'){utils[_0x6b01('0x2')](util[_0x6b01('0x3')](_0x6b01('0x1c'),_0x188c21[_0x6b01('0x5')],_0x188c21[_0x6b01('0x1b')],_0x188c21[_0x6b01('0x13')],_0x188c21['channel']));recordings[_0x188c21[_0x6b01('0x1b')]][_0x6b01('0x9')]=_0x188c21[_0x6b01('0x9')];}}catch(_0x2ddb79){utils[_0x6b01('0x15')](util['format'](_0x6b01('0x16'),_0x188c21[_0x6b01('0x5')]),_0x2ddb79);}};exports[_0x6b01('0x1d')]=function(_0x2c8bbe){try{if(!_[_0x6b01('0x17')](_0x2c8bbe[_0x6b01('0x1e')])&&!_['isNil'](_0x2c8bbe['variable'][_0x6b01('0x1f')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x2c8bbe[_0x6b01('0x5')]),_0x2c8bbe);utils[_0x6b01('0x2')](util[_0x6b01('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2c8bbe[_0x6b01('0x5')],_0x2c8bbe[_0x6b01('0x1e')],_0x2c8bbe[_0x6b01('0x20')]));if(_['endsWith'](_0x2c8bbe[_0x6b01('0x20')],_0x6b01('0x21'))){_0x2c8bbe[_0x6b01('0x20')]=_0x2c8bbe[_0x6b01('0x20')][_0x6b01('0x22')](_0x6b01('0x21'),_0x6b01('0x23'));}if(recordings[_0x2c8bbe[_0x6b01('0x1b')]]){var _0x4d08d0=_[_0x6b01('0x24')](recordings[_0x2c8bbe[_0x6b01('0x1b')]][_0x6b01('0x25')],{'value':_0x2c8bbe[_0x6b01('0x20')]});if(_[_0x6b01('0x17')](_0x4d08d0)){recordings[_0x2c8bbe[_0x6b01('0x1b')]][_0x6b01('0x25')][_0x6b01('0x26')]({'value':_0x2c8bbe[_0x6b01('0x20')]});}}}}catch(_0x13ca57){utils[_0x6b01('0x15')](util[_0x6b01('0x3')](_0x6b01('0x27'),_0x2c8bbe[_0x6b01('0x5')]),_0x13ca57);}};exports['hangup']=function(_0x4ce56c){try{if(!_['isNil'](recordings[_0x4ce56c[_0x6b01('0x5')]])){utils[_0x6b01('0x11')](util[_0x6b01('0x3')](_0x6b01('0x28'),_0x4ce56c[_0x6b01('0x5')]),_0x4ce56c);utils[_0x6b01('0x2')](util[_0x6b01('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4ce56c['uniqueid'],_0x4ce56c[_0x6b01('0x29')],_0x4ce56c[_0x6b01('0x2a')],_0x4ce56c[_0x6b01('0x2b')]));recordings[_0x4ce56c['uniqueid']][_0x6b01('0x29')]=_0x4ce56c[_0x6b01('0x29')];recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x2a')]=_0x4ce56c[_0x6b01('0x2a')];recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x2c')]=_0x4ce56c[_0x6b01('0x2c')];recordings[_0x4ce56c[_0x6b01('0x5')]]['connectedlinename']=_0x4ce56c[_0x6b01('0x2d')];if(recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x2e')]=='outbound'&&recordings[_0x4ce56c['uniqueid']][_0x6b01('0x9')]){recordings[_0x4ce56c['uniqueid']][_0x6b01('0x2c')]=recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x9')];recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x2d')]='';}recordings[_0x4ce56c[_0x6b01('0x5')]][_0x6b01('0x25')][_0x6b01('0x2f')](function(_0x3f535e){var _0x15ae65=_[_0x6b01('0x30')](recordings[_0x4ce56c['uniqueid']]);_0x15ae65[_0x6b01('0x20')]=_0x3f535e[_0x6b01('0x20')];writeDB(_0x15ae65);});delete recordings[_0x4ce56c['uniqueid']];}}catch(_0x7b5644){utils[_0x6b01('0x15')](util[_0x6b01('0x3')](_0x6b01('0x28'),_0x4ce56c[_0x6b01('0x5')]),_0x7b5644);}};exports[_0x6b01('0x31')]=function(_0x1c4336){try{if(!_[_0x6b01('0x17')](recordings[_0x1c4336[_0x6b01('0x5')]])){utils[_0x6b01('0x11')](util[_0x6b01('0x3')]('[%s][recordings][newexten]',_0x1c4336[_0x6b01('0x5')]),_0x1c4336);utils[_0x6b01('0x2')](util[_0x6b01('0x3')](_0x6b01('0x32'),_0x1c4336[_0x6b01('0x5')],_0x1c4336['application'],_0x1c4336['appdata']));if(_0x1c4336[_0x6b01('0x33')][_0x6b01('0x34')]()==_0x6b01('0x35')&&_[_0x6b01('0x36')](_0x1c4336[_0x6b01('0x37')][_0x6b01('0x34')](),_0x6b01('0x38'))){var _0x1af280=_0x1c4336[_0x6b01('0x37')][_0x6b01('0x39')]('=');var _0x30f710=_0x1af280[0x0]['substring'](_0x1af280[0x0][_0x6b01('0x3a')]('(')+0x1,_0x1af280[0x0][_0x6b01('0x3a')](')'));var _0x29bae4=_0x1af280[0x1];recordings[_0x1c4336[_0x6b01('0x5')]][_0x30f710]=_0x29bae4;}}}catch(_0x5c3d52){utils['error'](util[_0x6b01('0x3')](_0x6b01('0x3b'),_0x1c4336[_0x6b01('0x5')]),_0x5c3d52);}};exports[_0x6b01('0x3c')]=function(_0x41b211){try{if(!_[_0x6b01('0x17')](recordings[_0x41b211[_0x6b01('0x5')]])){utils[_0x6b01('0x11')](util['format'](_0x6b01('0x3d'),_0x41b211[_0x6b01('0x5')]),_0x41b211);utils['info'](util[_0x6b01('0x3')](_0x6b01('0x3e'),_0x41b211[_0x6b01('0x5')],_0x41b211[_0x6b01('0x3f')]));recordings[_0x41b211[_0x6b01('0x5')]][_0x6b01('0x3f')]=_0x41b211['queue'];}}catch(_0x43878f){utils['error'](util[_0x6b01('0x3')](_0x6b01('0x3d'),_0x41b211[_0x6b01('0x5')]),_0x43878f);}};exports['blindtransfer']=function(_0x3b07ce){try{utils[_0x6b01('0x11')](util['format'](_0x6b01('0x40'),_0x3b07ce[_0x6b01('0x5')]),_0x3b07ce);utils[_0x6b01('0x2')](util[_0x6b01('0x3')](_0x6b01('0x41'),_0x3b07ce[_0x6b01('0x5')],_0x3b07ce[_0x6b01('0x42')],_0x3b07ce[_0x6b01('0x43')],_0x3b07ce[_0x6b01('0x44')],_0x3b07ce[_0x6b01('0x45')]));if(recordings[_0x3b07ce[_0x6b01('0x46')]]&&transfers[_0x6b01('0x6')][_0x3b07ce[_0x6b01('0x46')]]){transfers[_0x6b01('0x6')][_0x3b07ce[_0x6b01('0x46')]]['recording']=!![];}}catch(_0x39f986){utils[_0x6b01('0x15')](util[_0x6b01('0x3')](_0x6b01('0x40'),_0x3b07ce[_0x6b01('0x5')]),_0x39f986);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b00ffd4..5a90367 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 _0x1568=['blinds','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request'];(function(_0x4edea5,_0x593fdb){var _0x4fb8b0=function(_0x5360db){while(--_0x5360db){_0x4edea5['push'](_0x4edea5['shift']());}};_0x4fb8b0(++_0x593fdb);}(_0x1568,0x1d7));var _0x8156=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1568[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8156('0x0'));var util=require('util');var utils=require(_0x8156('0x1'));function writeDB(_0x137832){utils[_0x8156('0x2')](util[_0x8156('0x3')](_0x8156('0x4'),_0x137832[_0x8156('0x5')]===_0x8156('0x6')?_0x137832['origtransfereruniqueid']:_0x137832[_0x8156('0x7')],_0x137832[_0x8156('0x5')]));utils[_0x8156('0x8')]('CreateVoiceTransferReport',_0x137832);}exports[_0x8156('0x9')]={};exports[_0x8156('0xa')]=function(_0x90403d){try{utils['debug'](util[_0x8156('0x3')]('[%s][transfers][blindtransfer]',_0x90403d[_0x8156('0x7')]),_0x90403d);utils[_0x8156('0x2')](util[_0x8156('0x3')](_0x8156('0xb'),_0x90403d['uniqueid'],_0x90403d[_0x8156('0xc')],_0x90403d['transferercalleridname'],_0x90403d['transfereecalleridnum'],_0x90403d[_0x8156('0xd')]));_0x90403d[_0x8156('0x5')]='blind';exports[_0x8156('0x9')][_0x90403d[_0x8156('0xe')]]=_0x90403d;writeDB(_0x90403d);}catch(_0x3f0d7a){utils['error'](util[_0x8156('0x3')](_0x8156('0xf'),_0x90403d[_0x8156('0x7')]),_0x3f0d7a);}};exports[_0x8156('0x10')]=function(_0x1a975e){try{utils[_0x8156('0x11')](util[_0x8156('0x3')](_0x8156('0x12'),_0x1a975e[_0x8156('0x13')]),_0x1a975e);utils[_0x8156('0x2')](util['format'](_0x8156('0x14'),_0x1a975e['origtransfereruniqueid'],_0x1a975e['origtransferercalleridnum'],_0x1a975e[_0x8156('0x15')],_0x1a975e['transfertargetcalleridnum'],_0x1a975e[_0x8156('0x16')]));_0x1a975e=_[_0x8156('0x17')](_0x1a975e,{'transfererchannel':_0x1a975e[_0x8156('0x18')],'transferercalleridnum':_0x1a975e['origtransferercalleridnum'],'transferercalleridname':_0x1a975e['origtransferercalleridname'],'transfererconnectedlinenum':_0x1a975e[_0x8156('0x19')],'transfererconnectedlinename':_0x1a975e[_0x8156('0x1a')],'transfereraccountcode':_0x1a975e[_0x8156('0x1b')],'transferercontext':_0x1a975e['secondtransferercontext'],'transfererexten':_0x1a975e[_0x8156('0x1c')],'transfererlinkedid':_0x1a975e[_0x8156('0x1d')],'context':_0x1a975e[_0x8156('0x1e')],'extension':_0x1a975e[_0x8156('0x1f')],'type':_0x8156('0x6')});if(_[_0x8156('0x20')](_0x1a975e[_0x8156('0x21')])){_0x1a975e=_[_0x8156('0x17')](_0x1a975e,{'transfereechannel':_0x1a975e['transfertargetchannel'],'transfereecalleridnum':_0x1a975e[_0x8156('0x22')],'transfereecalleridname':_0x1a975e[_0x8156('0x16')],'transfereeconnectedlinenum':_0x1a975e[_0x8156('0x23')],'transfereeconnectedlinename':_0x1a975e[_0x8156('0x24')],'transfereeaccountcode':_0x1a975e[_0x8156('0x25')],'transfereecontext':_0x1a975e['transfertargetcontext'],'transfereeexten':_0x1a975e[_0x8156('0x26')],'transfereelinkedid':_0x1a975e[_0x8156('0x27')]});}writeDB(_0x1a975e);}catch(_0x5cbd77){utils['error'](util[_0x8156('0x3')](_0x8156('0x12'),_0x1a975e[_0x8156('0x13')]),_0x5cbd77);}}; \ No newline at end of file +var _0x9104=['util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','type','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransfererexten','transfereechannel','assign','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash'];(function(_0x20bf3f,_0x6729a7){var _0x10c51f=function(_0x1886d2){while(--_0x1886d2){_0x20bf3f['push'](_0x20bf3f['shift']());}};_0x10c51f(++_0x6729a7);}(_0x9104,0xf5));var _0x4910=function(_0x496ab6,_0x430b41){_0x496ab6=_0x496ab6-0x0;var _0xbec9f6=_0x9104[_0x496ab6];return _0xbec9f6;};'use strict';var _=require(_0x4910('0x0'));var util=require(_0x4910('0x1'));var utils=require(_0x4910('0x2'));function writeDB(_0x5eefea){utils[_0x4910('0x3')](util[_0x4910('0x4')](_0x4910('0x5'),_0x5eefea['type']===_0x4910('0x6')?_0x5eefea[_0x4910('0x7')]:_0x5eefea['uniqueid'],_0x5eefea[_0x4910('0x8')]));utils['request'](_0x4910('0x9'),_0x5eefea);}exports['blinds']={};exports[_0x4910('0xa')]=function(_0xcd570a){try{utils[_0x4910('0xb')](util[_0x4910('0x4')](_0x4910('0xc'),_0xcd570a[_0x4910('0xd')]),_0xcd570a);utils['info'](util[_0x4910('0x4')](_0x4910('0xe'),_0xcd570a[_0x4910('0xd')],_0xcd570a[_0x4910('0xf')],_0xcd570a[_0x4910('0x10')],_0xcd570a[_0x4910('0x11')],_0xcd570a[_0x4910('0x12')]));_0xcd570a[_0x4910('0x8')]='blind';exports[_0x4910('0x13')][_0xcd570a[_0x4910('0x14')]]=_0xcd570a;writeDB(_0xcd570a);}catch(_0x7104f1){utils[_0x4910('0x15')](util[_0x4910('0x4')](_0x4910('0xc'),_0xcd570a[_0x4910('0xd')]),_0x7104f1);}};exports[_0x4910('0x16')]=function(_0xe31c1f){try{utils[_0x4910('0xb')](util[_0x4910('0x4')](_0x4910('0x17'),_0xe31c1f['origtransfereruniqueid']),_0xe31c1f);utils['info'](util['format'](_0x4910('0x18'),_0xe31c1f[_0x4910('0x7')],_0xe31c1f[_0x4910('0x19')],_0xe31c1f[_0x4910('0x1a')],_0xe31c1f['transfertargetcalleridnum'],_0xe31c1f[_0x4910('0x1b')]));_0xe31c1f=_['assign'](_0xe31c1f,{'transfererchannel':_0xe31c1f[_0x4910('0x1c')],'transferercalleridnum':_0xe31c1f[_0x4910('0x19')],'transferercalleridname':_0xe31c1f[_0x4910('0x1a')],'transfererconnectedlinenum':_0xe31c1f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xe31c1f[_0x4910('0x1d')],'transfereraccountcode':_0xe31c1f['origtransfereraccountcode'],'transferercontext':_0xe31c1f[_0x4910('0x1e')],'transfererexten':_0xe31c1f['secondtransfererexten'],'transfererlinkedid':_0xe31c1f[_0x4910('0x1f')],'context':_0xe31c1f['origtransferercontext'],'extension':_0xe31c1f[_0x4910('0x20')],'type':_0x4910('0x6')});if(_['isNil'](_0xe31c1f[_0x4910('0x21')])){_0xe31c1f=_[_0x4910('0x22')](_0xe31c1f,{'transfereechannel':_0xe31c1f['transfertargetchannel'],'transfereecalleridnum':_0xe31c1f[_0x4910('0x23')],'transfereecalleridname':_0xe31c1f[_0x4910('0x1b')],'transfereeconnectedlinenum':_0xe31c1f[_0x4910('0x24')],'transfereeconnectedlinename':_0xe31c1f[_0x4910('0x25')],'transfereeaccountcode':_0xe31c1f[_0x4910('0x26')],'transfereecontext':_0xe31c1f['transfertargetcontext'],'transfereeexten':_0xe31c1f[_0x4910('0x27')],'transfereelinkedid':_0xe31c1f[_0x4910('0x28')]});}writeDB(_0xe31c1f);}catch(_0xeb4b20){utils[_0x4910('0x15')](util[_0x4910('0x4')](_0x4910('0x17'),_0xe31c1f[_0x4910('0x7')]),_0xeb4b20);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5834170..d781cea 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 _0x6b21=['interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b21,0x75));var _0x16b2=function(_0x58fadc,_0x20d845){_0x58fadc=_0x58fadc-0x0;var _0xde5d58=_0x6b21[_0x58fadc];return _0xde5d58;};'use strict';var BPromise=require(_0x16b2('0x0'));var jayson=require(_0x16b2('0x1'));var moment=require(_0x16b2('0x2'));var util=require(_0x16b2('0x3'));var client=jayson['client'][_0x16b2('0x4')]({'port':0x2329});var logger=require(_0x16b2('0x5'))(_0x16b2('0x6'));exports['info']=function(_0x43edbe,_0x11ebee){logger[_0x16b2('0x7')](_0x43edbe,_0x11ebee?util['inspect'](_0x11ebee,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x54512e,_0x1039b7){logger['debug'](_0x54512e,_0x1039b7?util[_0x16b2('0x8')](_0x1039b7,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4b4a72,_0x3ecfdf){logger[_0x16b2('0x9')](_0x4b4a72,_0x3ecfdf?util[_0x16b2('0x8')](_0x3ecfdf,{'showHidden':![],'depth':null}):'');};exports[_0x16b2('0xa')]=function(_0x13a0b2,_0xff009a){return client[_0x16b2('0xa')](_0x13a0b2,{'body':_0xff009a})[_0x16b2('0xb')](function(_0x5a09a3){logger[_0x16b2('0xc')](_0x16b2('0xd'),_0x13a0b2,_0x5a09a3?util[_0x16b2('0x8')](_0x5a09a3,{'showHidden':![],'depth':null}):'');})[_0x16b2('0xe')](function(_0x31ca52){logger['error']('[utils][request]\x20name:%s',_0x13a0b2,_0x31ca52?util[_0x16b2('0x8')](_0x31ca52,{'showHidden':![],'depth':null}):'');});};function getUser(_0x310a23){return client[_0x16b2('0xa')](_0x16b2('0xf'),{'options':{'raw':!![],'attributes':['id',_0x16b2('0x10'),_0x16b2('0x11'),_0x16b2('0x12')],'where':_0x310a23,'limit':0x1}})['then'](function(_0x624cb3){logger['debug'](_0x16b2('0x13'),JSON['stringify'](_0x310a23),_0x624cb3?util[_0x16b2('0x8')](_0x624cb3,{'showHidden':![],'depth':null}):'');return _0x624cb3[_0x16b2('0x14')][_0x16b2('0x15')]?_0x624cb3['result'][0x0]:null;});}exports[_0x16b2('0x16')]=function(_0x48d4e9){return new BPromise(function(_0x3eb663,_0x4bf4cf){if(_0x48d4e9){return getUser({'internal':_0x48d4e9})[_0x16b2('0xb')](function(_0x188398){logger[_0x16b2('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x48d4e9,_0x188398?_0x16b2('0x17'):_0x16b2('0x18'));return _0x3eb663(_0x188398);})[_0x16b2('0xe')](function(_0x3b3362){logger[_0x16b2('0x9')]('[utils][getUserByInternal]',_0x3b3362?util[_0x16b2('0x8')](_0x3b3362,{'showHidden':![],'depth':null}):'');return _0x3eb663(null);});}return _0x3eb663(null);});};exports[_0x16b2('0x19')]=function(_0x1c6cfa){return new BPromise(function(_0x4ae9df,_0xe2910d){if(_0x1c6cfa){return getUser({'interface':_0x1c6cfa})[_0x16b2('0xb')](function(_0x2a9b1b){logger[_0x16b2('0x7')](_0x16b2('0x1a'),_0x1c6cfa,_0x2a9b1b?_0x16b2('0x17'):'notfound');return _0x4ae9df(_0x2a9b1b);})['catch'](function(_0x3e17e1){logger[_0x16b2('0x9')](_0x16b2('0x1b'),_0x3e17e1?util[_0x16b2('0x8')](_0x3e17e1,{'showHidden':![],'depth':null}):'');return _0x4ae9df(null);});}return _0x4ae9df(null);});};exports[_0x16b2('0x1c')]=function(_0x429bc5){return new BPromise(function(_0x3a4001,_0x67f973){if(_0x429bc5){return getUser({'name':_0x429bc5})[_0x16b2('0xb')](function(_0x3a962f){logger[_0x16b2('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x429bc5,_0x3a962f?_0x16b2('0x17'):_0x16b2('0x18'));return _0x3a4001(_0x3a962f);})[_0x16b2('0xe')](function(_0x4e2b41){logger[_0x16b2('0x9')](_0x16b2('0x1d'),_0x4e2b41?util[_0x16b2('0x8')](_0x4e2b41,{'showHidden':![],'depth':null}):'');return _0x3a4001(null);});}return _0x3a4001(null);});};exports['getVoiceQueueByName']=function(_0x2b4520){return new BPromise(function(_0x397196,_0x41a772){if(_0x2b4520){return client['request'](_0x16b2('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x16b2('0x11'),_0x16b2('0x1f'),_0x16b2('0x20'),_0x16b2('0x21')],'where':{'name':_0x2b4520},'limit':0x1}})[_0x16b2('0xb')](function(_0xae9320){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x2b4520,_0xae9320?util[_0x16b2('0x8')](_0xae9320,{'showHidden':![],'depth':null}):'');logger[_0x16b2('0x7')](_0x16b2('0x22'),_0x2b4520,_0xae9320?'found':_0x16b2('0x18'));return _0x397196(_0xae9320[_0x16b2('0x14')][_0x16b2('0x15')]?_0xae9320[_0x16b2('0x14')][0x0]:null);})[_0x16b2('0xe')](function(_0x496b4d){logger['error'](_0x16b2('0x23'),_0x496b4d?util[_0x16b2('0x8')](_0x496b4d,{'showHidden':![],'depth':null}):'');return _0x397196(null);});}return _0x397196(null);});};exports['addTime']=function(_0x58e170,_0x2daf71){return moment(_0x58e170)[_0x16b2('0x24')](_0x2daf71,_0x16b2('0x25'))[_0x16b2('0x26')](_0x16b2('0x27'));};exports['subtractTime']=function(_0xe54e9f,_0x1a9fbd){return moment(_0xe54e9f)[_0x16b2('0x28')](_0x1a9fbd,_0x16b2('0x25'))[_0x16b2('0x26')](_0x16b2('0x27'));};exports[_0x16b2('0x29')]=function(_0x477e4c,_0x3e0b79){return moment(_0x477e4c)[_0x16b2('0x2a')](moment(_0x3e0b79),_0x16b2('0x25'));};exports['sumTime']=function(_0x16fb00,_0x2f3b39){return parseInt(_0x16fb00,0xa)+parseInt(_0x2f3b39,0xa);};exports['now']=function(){return moment()[_0x16b2('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x16b2('0x2b')]=function(_0x598d05,_0x48b091){if(_0x48b091){return moment(_0x598d05)[_0x16b2('0x2b')](_0x48b091);}return!![];};exports['isBefore']=function(_0x2a938c,_0x47d683){if(_0x47d683){return moment(_0x2a938c)[_0x16b2('0x2c')](_0x47d683);}else if(_0x2a938c){return!![];}return![];}; \ No newline at end of file +var _0xa5c5=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','name','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime'];(function(_0x40612d,_0x15508a){var _0x4258f2=function(_0x577d70){while(--_0x577d70){_0x40612d['push'](_0x40612d['shift']());}};_0x4258f2(++_0x15508a);}(_0xa5c5,0xba));var _0x5a5c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa5c5[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x5a5c('0x0'));var jayson=require(_0x5a5c('0x1'));var moment=require(_0x5a5c('0x2'));var util=require('util');var client=jayson[_0x5a5c('0x3')][_0x5a5c('0x4')]({'port':0x2329});var logger=require(_0x5a5c('0x5'))(_0x5a5c('0x6'));exports[_0x5a5c('0x7')]=function(_0x54e820,_0x3986ff){logger[_0x5a5c('0x7')](_0x54e820,_0x3986ff?util[_0x5a5c('0x8')](_0x3986ff,{'showHidden':![],'depth':null}):'');};exports[_0x5a5c('0x9')]=function(_0x4dc66e,_0x27876a){logger[_0x5a5c('0x9')](_0x4dc66e,_0x27876a?util[_0x5a5c('0x8')](_0x27876a,{'showHidden':![],'depth':null}):'');};exports[_0x5a5c('0xa')]=function(_0x5b061b,_0x349e05){logger[_0x5a5c('0xa')](_0x5b061b,_0x349e05?util[_0x5a5c('0x8')](_0x349e05,{'showHidden':![],'depth':null}):'');};exports[_0x5a5c('0xb')]=function(_0x42efe1,_0x3cb67e){return client[_0x5a5c('0xb')](_0x42efe1,{'body':_0x3cb67e})[_0x5a5c('0xc')](function(_0x29122f){logger[_0x5a5c('0x9')](_0x5a5c('0xd'),_0x42efe1,_0x29122f?util[_0x5a5c('0x8')](_0x29122f,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2db85a){logger['error'](_0x5a5c('0xd'),_0x42efe1,_0x2db85a?util['inspect'](_0x2db85a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1389db){return client[_0x5a5c('0xb')](_0x5a5c('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x5a5c('0xf'),'interface'],'where':_0x1389db,'limit':0x1}})[_0x5a5c('0xc')](function(_0x117558){logger[_0x5a5c('0x9')](_0x5a5c('0x10'),JSON['stringify'](_0x1389db),_0x117558?util['inspect'](_0x117558,{'showHidden':![],'depth':null}):'');return _0x117558[_0x5a5c('0x11')][_0x5a5c('0x12')]?_0x117558[_0x5a5c('0x11')][0x0]:null;});}exports[_0x5a5c('0x13')]=function(_0x17b534){return new BPromise(function(_0x5ccd84,_0x171efb){if(_0x17b534){return getUser({'internal':_0x17b534})[_0x5a5c('0xc')](function(_0x495211){logger[_0x5a5c('0x7')](_0x5a5c('0x14'),_0x17b534,_0x495211?_0x5a5c('0x15'):_0x5a5c('0x16'));return _0x5ccd84(_0x495211);})[_0x5a5c('0x17')](function(_0x1b27b2){logger[_0x5a5c('0xa')]('[utils][getUserByInternal]',_0x1b27b2?util[_0x5a5c('0x8')](_0x1b27b2,{'showHidden':![],'depth':null}):'');return _0x5ccd84(null);});}return _0x5ccd84(null);});};exports[_0x5a5c('0x18')]=function(_0x384c14){return new BPromise(function(_0x3e5f16,_0x368eb0){if(_0x384c14){return getUser({'interface':_0x384c14})[_0x5a5c('0xc')](function(_0x537a0a){logger[_0x5a5c('0x7')](_0x5a5c('0x19'),_0x384c14,_0x537a0a?_0x5a5c('0x15'):_0x5a5c('0x16'));return _0x3e5f16(_0x537a0a);})[_0x5a5c('0x17')](function(_0x957ed1){logger[_0x5a5c('0xa')](_0x5a5c('0x1a'),_0x957ed1?util['inspect'](_0x957ed1,{'showHidden':![],'depth':null}):'');return _0x3e5f16(null);});}return _0x3e5f16(null);});};exports[_0x5a5c('0x1b')]=function(_0x2de170){return new BPromise(function(_0x3b6f76,_0x17f5ba){if(_0x2de170){return getUser({'name':_0x2de170})[_0x5a5c('0xc')](function(_0x75c4fc){logger[_0x5a5c('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2de170,_0x75c4fc?_0x5a5c('0x15'):'notfound');return _0x3b6f76(_0x75c4fc);})[_0x5a5c('0x17')](function(_0x1fb9b3){logger['error']('[utils][getUserByName]',_0x1fb9b3?util[_0x5a5c('0x8')](_0x1fb9b3,{'showHidden':![],'depth':null}):'');return _0x3b6f76(null);});}return _0x3b6f76(null);});};exports['getVoiceQueueByName']=function(_0x2ac622){return new BPromise(function(_0x2b22b6,_0x2a7c25){if(_0x2ac622){return client[_0x5a5c('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5a5c('0xf'),_0x5a5c('0x1c'),_0x5a5c('0x1d'),'acwTimeout'],'where':{'name':_0x2ac622},'limit':0x1}})[_0x5a5c('0xc')](function(_0x15c554){logger[_0x5a5c('0x9')](_0x5a5c('0x1e'),_0x2ac622,_0x15c554?util['inspect'](_0x15c554,{'showHidden':![],'depth':null}):'');logger[_0x5a5c('0x7')](_0x5a5c('0x1f'),_0x2ac622,_0x15c554?_0x5a5c('0x15'):'notfound');return _0x2b22b6(_0x15c554[_0x5a5c('0x11')]['length']?_0x15c554[_0x5a5c('0x11')][0x0]:null);})['catch'](function(_0x20c9ce){logger[_0x5a5c('0xa')](_0x5a5c('0x20'),_0x20c9ce?util[_0x5a5c('0x8')](_0x20c9ce,{'showHidden':![],'depth':null}):'');return _0x2b22b6(null);});}return _0x2b22b6(null);});};exports[_0x5a5c('0x21')]=function(_0x7a6824,_0x3dc5bb){return moment(_0x7a6824)[_0x5a5c('0x22')](_0x3dc5bb,_0x5a5c('0x23'))[_0x5a5c('0x24')](_0x5a5c('0x25'));};exports[_0x5a5c('0x26')]=function(_0x51e65b,_0xcc6c58){return moment(_0x51e65b)['subtract'](_0xcc6c58,_0x5a5c('0x23'))[_0x5a5c('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5a5c('0x27')]=function(_0x55f58a,_0xb5c5e8){return moment(_0x55f58a)['diff'](moment(_0xb5c5e8),'seconds');};exports[_0x5a5c('0x28')]=function(_0x36dee0,_0x43ddde){return parseInt(_0x36dee0,0xa)+parseInt(_0x43ddde,0xa);};exports[_0x5a5c('0x29')]=function(){return moment()['format'](_0x5a5c('0x25'));};exports[_0x5a5c('0x2a')]=function(_0x495b2d,_0x10bf90){if(_0x10bf90){return moment(_0x495b2d)[_0x5a5c('0x2a')](_0x10bf90);}return!![];};exports['isBefore']=function(_0x1f819e,_0x2d0eb0){if(_0x2d0eb0){return moment(_0x1f819e)[_0x5a5c('0x2b')](_0x2d0eb0);}else if(_0x1f819e){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 d9ab1af..6e8a726 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 _0xc89b=['fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','log','xcally','name','ensureDir','then','client','catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','agent_name','test','setupLoggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc89b,0x64));var _0xbc89=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc89b[_0x134c2e];return _0x2825db;};var fs=require(_0xbc89('0x0'));var _=require(_0xbc89('0x1'));var ewinston=require('express-winston');var path=require(_0xbc89('0x2'));var util=require(_0xbc89('0x3'));var fileLogger=require(_0xbc89('0x4'))[_0xbc89('0x5')];var safeTemplate=require(_0xbc89('0x6'))['safeTemplate'];var maskSensitiveData=require(_0xbc89('0x7'))[_0xbc89('0x8')];function ClientSideLogger(){function _0x501f73(_0x1a8353){var _0x53b306=path[_0xbc89('0x9')]('/var',_0xbc89('0xa'),_0xbc89('0xb'));var _0x2b0e13=path['join']('client',_0x1a8353['role']+'-'+_0x1a8353[_0xbc89('0xc')]);return fs[_0xbc89('0xd')](path[_0xbc89('0x9')](_0x53b306,_0x2b0e13))[_0xbc89('0xe')](function(){var _0x136b2d=fileLogger(_0xbc89('0xf'),path[_0xbc89('0x9')](_0x53b306,_0x2b0e13));return _0x136b2d;})[_0xbc89('0x10')](function(_0x330f72){throw _0x330f72;});}this[_0xbc89('0xa')]=function(_0x41561e,_0x35c894,_0x203b56,_0x195364){return _0x501f73(_0x41561e['user'])[_0xbc89('0xe')](function(_0x51959a){var _0x41924b=_0x51959a[_0x35c894];return _0x41924b;})[_0xbc89('0xe')](function(_0x1317d7){var _0x16b6b2=_0x41561e[_0xbc89('0x11')]?_0x41561e['user']['id']:_0xbc89('0x12');var _0x353696=_0x195364[_0xbc89('0x13')];var _0x123f30=_0x195364[_0xbc89('0x14')];var _0x26deba=new Date(Number(_0x123f30));return _0x1317d7(_0x16b6b2,_0x26deba,_0x203b56,_0x353696);})[_0xbc89('0x10')](function(_0x572ffe){fileLogger(_0xbc89('0xf'))[_0xbc89('0x15')](_0x572ffe);});};}function setupLoggers(_0x2a76c4){return new Promise(function(_0x1cd54e){var _0x33f567=new ClientSideLogger();var _0x303ad2=fileLogger(_0xbc89('0x16'));var _0x4b2355=fileLogger(_0xbc89('0x17'));_0x2a76c4[_0xbc89('0x18')](_0xbc89('0x19'),_0x33f567);_0x2a76c4[_0xbc89('0x1a')](ewinston[_0xbc89('0x1b')]({'winstonInstance':_0x303ad2,'meta':![],'statusLevels':!![],'msg':function(_0x5d5d4d,_0x4bfad0){var _0x4d440e=_0xbc89('0x1c');if(!_[_0xbc89('0x1d')](_0x5d5d4d[_0xbc89('0x1e')])){_0x4d440e+=_0xbc89('0x1f');var _0x5f5595=_0x5d5d4d['body'];maskSensitiveData(_0x5f5595);}return safeTemplate(util[_0xbc89('0x20')](_0x4d440e,_0x5d5d4d[_0xbc89('0x21')],_0x5d5d4d[_0xbc89('0x22')][_0xbc89('0x23')]?_0x5d5d4d[_0xbc89('0x22')][_0xbc89('0x23')]:_0x5d5d4d[_0xbc89('0x24')][_0xbc89('0x25')]||_0x5d5d4d['ip'],_0x5d5d4d[_0xbc89('0x26')],_0x4bfad0['statusCode'],_0x4bfad0[_0xbc89('0x27')],_0x5d5d4d[_0xbc89('0x11')]?_0x5d5d4d['user']['id']:null,_0x5d5d4d[_0xbc89('0x11')]?_0x5d5d4d[_0xbc89('0x11')][_0xbc89('0xc')]:null,_0x5d5d4d[_0xbc89('0x11')]?_0x5d5d4d['user'][_0xbc89('0x28')]:null,_0x5f5595?util[_0xbc89('0x29')](_0x5f5595,![],null):''));}}));_0x2a76c4[_0xbc89('0x1a')](ewinston[_0xbc89('0x1b')]({'winstonInstance':_0x4b2355,'meta':![],'statusLevels':!![],'msg':function(_0x50f183,_0x149409){var _0xd9cc27=_0xbc89('0x2a');if(_0x50f183[_0xbc89('0x1e')]&&_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2b')]&&_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2c')]){_0xd9cc27=_0xbc89('0x2d');}return util[_0xbc89('0x20')](_0xd9cc27,_0x50f183[_0xbc89('0x21')],_0x50f183[_0xbc89('0x22')]['x-forwarded-for']?_0x50f183['headers']['x-forwarded-for']:_0x50f183[_0xbc89('0x24')][_0xbc89('0x25')]||_0x50f183['ip'],_0x50f183[_0xbc89('0x26')],_0x149409[_0xbc89('0x2e')],_0x149409[_0xbc89('0x27')],_0x50f183[_0xbc89('0x11')]?_0x50f183[_0xbc89('0x11')]['id']:null,_0x50f183[_0xbc89('0x11')]?_0x50f183[_0xbc89('0x11')][_0xbc89('0xc')]:null,_0x50f183[_0xbc89('0x11')]?_0x50f183[_0xbc89('0x11')][_0xbc89('0x28')]:null,_0x50f183[_0xbc89('0x1e')]&&_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2b')]?_0x50f183['body'][_0xbc89('0x2b')]:'other',_0x50f183[_0xbc89('0x1e')]&&_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2c')]?_0x50f183[_0xbc89('0x1e')]['agent_id']:'',_0x50f183[_0xbc89('0x1e')]&&_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2f')]?_0x50f183[_0xbc89('0x1e')][_0xbc89('0x2f')]:'');},'ignoreRoute':function(_0x4d4f64){var _0x88d22e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x88d22e[_0xbc89('0x30')](_0x4d4f64[_0xbc89('0x26')]);}}));return _0x1cd54e();});}exports[_0xbc89('0x31')]=setupLoggers; \ No newline at end of file +var _0xdb7c=['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','statusCode','responseTime','agent_name','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','role','name','ensureDir','catch','user','then','no-user','data','timestamp','error','api','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','url','inspect','device'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xdb7c,0x149));var _0xcdb7=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xdb7c[_0x1bc013];return _0x55df36;};var fs=require(_0xcdb7('0x0'));var _=require(_0xcdb7('0x1'));var ewinston=require(_0xcdb7('0x2'));var path=require('path');var util=require(_0xcdb7('0x3'));var fileLogger=require(_0xcdb7('0x4'))[_0xcdb7('0x5')];var safeTemplate=require(_0xcdb7('0x6'))[_0xcdb7('0x7')];var maskSensitiveData=require(_0xcdb7('0x8'))[_0xcdb7('0x9')];function ClientSideLogger(){function _0x2b9e4c(_0xb19005){var _0x5843fd=path[_0xcdb7('0xa')](_0xcdb7('0xb'),_0xcdb7('0xc'),'xcally');var _0x297dd9=path['join'](_0xcdb7('0xd'),_0xb19005[_0xcdb7('0xe')]+'-'+_0xb19005[_0xcdb7('0xf')]);return fs[_0xcdb7('0x10')](path[_0xcdb7('0xa')](_0x5843fd,_0x297dd9))['then'](function(){var _0x55f46d=fileLogger(_0xcdb7('0xd'),path[_0xcdb7('0xa')](_0x5843fd,_0x297dd9));return _0x55f46d;})[_0xcdb7('0x11')](function(_0x5bf7b9){throw _0x5bf7b9;});}this[_0xcdb7('0xc')]=function(_0x20ed0b,_0xbfa256,_0x158b45,_0x391690){return _0x2b9e4c(_0x20ed0b[_0xcdb7('0x12')])[_0xcdb7('0x13')](function(_0x6f7048){var _0x465ffb=_0x6f7048[_0xbfa256];return _0x465ffb;})[_0xcdb7('0x13')](function(_0xc6964f){var _0x44912c=_0x20ed0b['user']?_0x20ed0b[_0xcdb7('0x12')]['id']:_0xcdb7('0x14');var _0x5a1978=_0x391690[_0xcdb7('0x15')];var _0x5206b3=_0x391690[_0xcdb7('0x16')];var _0x5af634=new Date(Number(_0x5206b3));return _0xc6964f(_0x44912c,_0x5af634,_0x158b45,_0x5a1978);})['catch'](function(_0x51a375){fileLogger(_0xcdb7('0xd'))[_0xcdb7('0x17')](_0x51a375);});};}function setupLoggers(_0x199c07){return new Promise(function(_0x18e545){var _0x3f4ab5=new ClientSideLogger();var _0x5aa4af=fileLogger(_0xcdb7('0x18'));var _0x58f053=fileLogger('auth');_0x199c07[_0xcdb7('0x19')]('client-side-logger',_0x3f4ab5);_0x199c07['use'](ewinston[_0xcdb7('0x1a')]({'winstonInstance':_0x5aa4af,'meta':![],'statusLevels':!![],'msg':function(_0x95c453,_0x38cac5){var _0x5e8a1a=_0xcdb7('0x1b');if(!_[_0xcdb7('0x1c')](_0x95c453[_0xcdb7('0x1d')])){_0x5e8a1a+=_0xcdb7('0x1e');var _0x516f9e=_0x95c453[_0xcdb7('0x1d')];maskSensitiveData(_0x516f9e);}return safeTemplate(util[_0xcdb7('0x1f')](_0x5e8a1a,_0x95c453[_0xcdb7('0x20')],_0x95c453['headers'][_0xcdb7('0x21')]?_0x95c453['headers']['x-forwarded-for']:_0x95c453[_0xcdb7('0x22')][_0xcdb7('0x23')]||_0x95c453['ip'],_0x95c453[_0xcdb7('0x24')],_0x38cac5['statusCode'],_0x38cac5['responseTime'],_0x95c453[_0xcdb7('0x12')]?_0x95c453[_0xcdb7('0x12')]['id']:null,_0x95c453[_0xcdb7('0x12')]?_0x95c453[_0xcdb7('0x12')][_0xcdb7('0xf')]:null,_0x95c453[_0xcdb7('0x12')]?_0x95c453['user']['role']:null,_0x516f9e?util[_0xcdb7('0x25')](_0x516f9e,![],null):''));}}));_0x199c07['use'](ewinston[_0xcdb7('0x1a')]({'winstonInstance':_0x58f053,'meta':![],'statusLevels':!![],'msg':function(_0x4917fe,_0x49102d){var _0x2a8598='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4917fe[_0xcdb7('0x1d')]&&_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x26')]&&_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x27')]){_0x2a8598=_0xcdb7('0x28');}return util[_0xcdb7('0x1f')](_0x2a8598,_0x4917fe[_0xcdb7('0x20')],_0x4917fe['headers']['x-forwarded-for']?_0x4917fe[_0xcdb7('0x29')][_0xcdb7('0x21')]:_0x4917fe['connection'][_0xcdb7('0x23')]||_0x4917fe['ip'],_0x4917fe[_0xcdb7('0x24')],_0x49102d[_0xcdb7('0x2a')],_0x49102d[_0xcdb7('0x2b')],_0x4917fe[_0xcdb7('0x12')]?_0x4917fe[_0xcdb7('0x12')]['id']:null,_0x4917fe[_0xcdb7('0x12')]?_0x4917fe[_0xcdb7('0x12')][_0xcdb7('0xf')]:null,_0x4917fe[_0xcdb7('0x12')]?_0x4917fe[_0xcdb7('0x12')][_0xcdb7('0xe')]:null,_0x4917fe[_0xcdb7('0x1d')]&&_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x26')]?_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x26')]:'other',_0x4917fe[_0xcdb7('0x1d')]&&_0x4917fe['body'][_0xcdb7('0x27')]?_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x27')]:'',_0x4917fe[_0xcdb7('0x1d')]&&_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x2c')]?_0x4917fe[_0xcdb7('0x1d')][_0xcdb7('0x2c')]:'');},'ignoreRoute':function(_0x249a44){var _0x547434=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x547434['test'](_0x249a44['url']);}}));return _0x18e545();});}exports[_0xcdb7('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index c4422ec..c118b3d 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaacf=['toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','concat','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','ddd','includes','dowCompare','min','format','MMM','test','isMoment','padStart','length','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort'];(function(_0x281a67,_0x2e1385){var _0x29b139=function(_0xf30152){while(--_0xf30152){_0x281a67['push'](_0x281a67['shift']());}};_0x29b139(++_0x2e1385);}(_0xaacf,0x155));var _0xfaac=function(_0x4c09a9,_0x1ceaa0){_0x4c09a9=_0x4c09a9-0x0;var _0x529c06=_0xaacf[_0x4c09a9];return _0x529c06;};var _=require('lodash');var moment=require(_0xfaac('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xfaac('0x1')](function(_0x2ae051){return _0x2ae051[_0xfaac('0x2')];})[_0xfaac('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfaac('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x7d7d0){if(!_0x7d7d0[_0xfaac('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x335936){var _0x3c3239=_0x335936[_0xfaac('0x6')](':')[_0xfaac('0x1')](function(_0x2b3695){return parseInt(_0x2b3695,0xa);});var _0x1eed74=_0x3c3239[0x0];var _0x37f732=_0x3c3239[0x1];if(_0x1eed74<0x0||_0x1eed74>0x17||_0x37f732<0x0||_0x37f732>0x3b){throw new Error(EINVALID_DATE);}return[_0x1eed74,_0x37f732];}function circularDoWInterval(_0x2eeac9,_0x54c0a9){if(_0x2eeac9===_0x54c0a9){return[_0x2eeac9];}else{var _0x22620e=moment[_0xfaac('0x7')]();moment[_0xfaac('0x7')]('en');var _0x43fd21=moment[_0xfaac('0x8')]()[_0xfaac('0x1')](function(_0x4a9ec4){return _0x4a9ec4[_0xfaac('0x9')]();});moment[_0xfaac('0x7')](_0x22620e);var _0x522f5f=_0x43fd21[_0xfaac('0xa')](_0x2eeac9);var _0x59ca03=_0x43fd21['indexOf'](_0x54c0a9);if(_0x59ca03>_0x522f5f){return _0x43fd21[_0xfaac('0xb')](_0x522f5f,_0x59ca03+0x1);}else{var _0x2b4be7=_0x43fd21[_0xfaac('0xb')](0x0,_0x59ca03+0x1);var _0xa152a6=_0x43fd21[_0xfaac('0xb')](_0x522f5f);return _0xa152a6['concat'](_0x2b4be7);}}}module[_0xfaac('0xc')][_0xfaac('0xd')]=circularDoWInterval;function circularMonthInterval(_0x25ae94,_0x5bd7e7){if(_0x25ae94===_0x5bd7e7){return[_0x25ae94];}else{var _0x41b1be=moment[_0xfaac('0x7')]();moment[_0xfaac('0x7')]('en');var _0x2536b6=moment[_0xfaac('0xe')]()[_0xfaac('0x1')](function(_0x17d423){return _0x17d423[_0xfaac('0x9')]();});moment[_0xfaac('0x7')](_0x41b1be);var _0x4dc9c4=_0x2536b6[_0xfaac('0xa')](_0x25ae94);var _0x529c96=_0x2536b6['indexOf'](_0x5bd7e7);if(_0x529c96>_0x4dc9c4){return _0x2536b6[_0xfaac('0xb')](_0x4dc9c4,_0x529c96+0x1);}else{var _0x561137=_0x2536b6[_0xfaac('0xb')](0x0,_0x529c96+0x1);var _0x4b1636=_0x2536b6[_0xfaac('0xb')](_0x4dc9c4);return _0x4b1636[_0xfaac('0xf')](_0x561137);}}}module['exports'][_0xfaac('0x10')]=circularMonthInterval;function parseDom(_0x2fb2eb){var _0x2dadf8=parseInt(_0x2fb2eb,0xa);if(_0x2dadf8<0x1||_0x2dadf8>0x1f){throw new Error(EINVALID_DATE);}return _0x2dadf8;}function timeCompare(_0x55892c,_0x57383f,_0x1a85fa){var _0x18d771=_0x55892c[_0xfaac('0x11')]();var _0x19b966=extractTime(_0x57383f);var _0x3fce73=_0x19b966[0x0];var _0x5e48ce=_0x19b966[0x1];var _0x3f74d7=_0x55892c[_0xfaac('0x11')]()[_0xfaac('0x12')](_0x3fce73)[_0xfaac('0x13')](_0x5e48ce);throwIfDateNotValid(_0x3f74d7);var _0x2383e0=extractTime(_0x1a85fa);var _0x24dc98=_0x2383e0[0x0];var _0x5d86a6=_0x2383e0[0x1];var _0x25b5a1=_0x55892c['clone']()[_0xfaac('0x12')](_0x24dc98)['minutes'](_0x5d86a6);throwIfDateNotValid(_0x25b5a1);if(_0x25b5a1[_0xfaac('0x14')](_0x3f74d7)){var _0x2838b4=_0x18d771[_0xfaac('0x11')]()[_0xfaac('0x15')](_0xfaac('0x16'));var _0x46fa53=_0x18d771[_0xfaac('0x11')]()['endOf'](_0xfaac('0x16'));return _0x18d771[_0xfaac('0x17')](_0x3f74d7,_0x46fa53,undefined,'[]')||_0x18d771[_0xfaac('0x17')](_0x2838b4,_0x25b5a1,undefined,'[]');}else{return _0x18d771['isBetween'](_0x3f74d7,_0x25b5a1,undefined,'[]');}}module[_0xfaac('0xc')][_0xfaac('0x18')]=timeCompare;function dowCompare(_0x3e937e,_0x226d1d,_0x4cb20d){var _0x36f601=_0x3e937e[_0xfaac('0x7')]('en')['format'](_0xfaac('0x19'))[_0xfaac('0x9')]();return circularDoWInterval(_0x226d1d,_0x4cb20d)[_0xfaac('0x1a')](_0x36f601);}module[_0xfaac('0xc')][_0xfaac('0x1b')]=dowCompare;function domCompare(_0x4fa14,_0xeb0022,_0x46999b){var _0x290ea5=_0x4fa14['date']();if(_0xeb0022===_0x46999b){return _0x290ea5===_0xeb0022;}else{var _0x196e34=_0x4fa14['daysInMonth']();var _0x912667=_0xeb0022<_0x46999b;let _0x26a4ec=![];var _0x229ab5=0x0;var _0xc417ac=0x0;if(_0x912667){_0x229ab5=Math['max'](0x1,_0xeb0022);_0xc417ac=Math[_0xfaac('0x1c')](_0x46999b,_0x196e34);_0x26a4ec=_0x290ea5>=_0x229ab5&&_0x290ea5<=_0xc417ac;}else{_0x229ab5=Math[_0xfaac('0x1c')](_0xeb0022,_0x196e34);_0xc417ac=Math['max'](0x1,_0x46999b);_0x26a4ec=_0x290ea5>=_0x229ab5||_0x290ea5<=_0xc417ac;}return _0x26a4ec;}}module[_0xfaac('0xc')]['domCompare']=domCompare;function monthCompare(_0x14064c,_0xbef191,_0x3d30bd){var _0x5bae47=_0x14064c['locale']('en')[_0xfaac('0x1d')](_0xfaac('0x1e'))[_0xfaac('0x9')]();return circularMonthInterval(_0xbef191,_0x3d30bd)[_0xfaac('0x1a')](_0x5bae47);}module[_0xfaac('0xc')]['monthCompare']=monthCompare;function iftime(_0x5f2d69,_0x2bde23=moment['tz']['guess'](),_0x3ade98=moment()){if(!validateRx[_0xfaac('0x1f')](_0x5f2d69)){throw new Error(EINVALID_STRING);}else{var _0x347a7e=(moment[_0xfaac('0x20')](_0x3ade98)?_0x3ade98[_0xfaac('0x11')]():moment(_0x3ade98))['tz'](_0x2bde23)['locale']('en');throwIfDateNotValid(_0x347a7e);var _0x25e091=_0x5f2d69[_0xfaac('0x6')](',');var _0x25bb56=_0x25e091[0x0];var _0x594055=_0x25e091[0x1];var _0x473a0e=_0x25e091[0x2];var _0x136921=_0x25e091[0x3];let _0x307262=!![];if(_0x25bb56!=='*'){var _0x3ed439=_0x25bb56[_0xfaac('0x6')]('-');var _0x1ad7c2=_[_0xfaac('0x21')](_0x3ed439[0x0],0x5,'0');var _0x40caa1=_0x3ed439[_0xfaac('0x22')]===0x2?_[_0xfaac('0x21')](_0x3ed439[0x1],0x5,'0'):_0x1ad7c2;_0x307262=timeCompare(_0x347a7e,_0x1ad7c2,_0x40caa1);}let _0x38fc5f=!![];if(_0x594055!=='*'){var _0x56a818=_0x594055['split']('-');var _0x55347a=_0x56a818[0x0];var _0x2b8299=_0x56a818[_0xfaac('0x22')]===0x2?_0x56a818[0x1]:_0x55347a;_0x38fc5f=dowCompare(_0x347a7e,_0x55347a,_0x2b8299);}let _0x2ba62c=!![];if(_0x473a0e!=='*'){var _0xc592a4=_0x473a0e[_0xfaac('0x6')]('-');var _0x32ff04=parseDom(_0xc592a4[0x0]);var _0xe14bad=_0xc592a4[_0xfaac('0x22')]===0x2?parseDom(_0xc592a4[0x1]):_0x32ff04;_0x2ba62c=domCompare(_0x347a7e,_0x32ff04,_0xe14bad);}let _0x18fee1=!![];if(_0x136921!=='*'){var _0x4f2a1d=_0x136921[_0xfaac('0x6')]('-');var _0x567791=_0x4f2a1d[0x0];var _0x5ecd25=_0x4f2a1d[_0xfaac('0x22')]===0x2?_0x4f2a1d[0x1]:_0x4f2a1d[0x0];_0x18fee1=monthCompare(_0x347a7e,_0x567791,_0x5ecd25);}return _0x307262&&_0x38fc5f&&_0x2ba62c&&_0x18fee1;}}module[_0xfaac('0xc')]['iftime']=iftime; \ No newline at end of file +var _0x7a8c=['clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','includes','dowCompare','date','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','length','padStart','iftime','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','toLowerCase','locale','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7a8c,0x177));var _0xc7a8=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x7a8c[_0x5f1391];return _0x50ebe3;};var _=require('lodash');var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x1195c7){return _0x1195c7[_0xc7a8('0x0')];})[_0xc7a8('0x1')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xc7a8('0x2');var EINVALID_DATE=_0xc7a8('0x3');function throwIfDateNotValid(_0x3db148){if(!_0x3db148[_0xc7a8('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x58c6ad){var _0x2be935=_0x58c6ad[_0xc7a8('0x5')](':')[_0xc7a8('0x6')](function(_0x55c781){return parseInt(_0x55c781,0xa);});var _0x4ba16d=_0x2be935[0x0];var _0x5dd650=_0x2be935[0x1];if(_0x4ba16d<0x0||_0x4ba16d>0x17||_0x5dd650<0x0||_0x5dd650>0x3b){throw new Error(EINVALID_DATE);}return[_0x4ba16d,_0x5dd650];}function circularDoWInterval(_0x516ea,_0x2a418d){if(_0x516ea===_0x2a418d){return[_0x516ea];}else{var _0xf6ee5c=moment['locale']();moment['locale']('en');var _0xb3ba5b=moment['weekdaysShort']()[_0xc7a8('0x6')](function(_0x66917c){return _0x66917c[_0xc7a8('0x7')]();});moment[_0xc7a8('0x8')](_0xf6ee5c);var _0x288849=_0xb3ba5b[_0xc7a8('0x9')](_0x516ea);var _0x29a612=_0xb3ba5b[_0xc7a8('0x9')](_0x2a418d);if(_0x29a612>_0x288849){return _0xb3ba5b[_0xc7a8('0xa')](_0x288849,_0x29a612+0x1);}else{var _0x55d9b1=_0xb3ba5b['slice'](0x0,_0x29a612+0x1);var _0x4524d4=_0xb3ba5b['slice'](_0x288849);return _0x4524d4[_0xc7a8('0xb')](_0x55d9b1);}}}module[_0xc7a8('0xc')][_0xc7a8('0xd')]=circularDoWInterval;function circularMonthInterval(_0x194fae,_0x1549c0){if(_0x194fae===_0x1549c0){return[_0x194fae];}else{var _0x2238a8=moment[_0xc7a8('0x8')]();moment[_0xc7a8('0x8')]('en');var _0x5a58d7=moment['monthsShort']()[_0xc7a8('0x6')](function(_0x4ea868){return _0x4ea868[_0xc7a8('0x7')]();});moment[_0xc7a8('0x8')](_0x2238a8);var _0x874083=_0x5a58d7[_0xc7a8('0x9')](_0x194fae);var _0x4bf156=_0x5a58d7[_0xc7a8('0x9')](_0x1549c0);if(_0x4bf156>_0x874083){return _0x5a58d7[_0xc7a8('0xa')](_0x874083,_0x4bf156+0x1);}else{var _0x186b6e=_0x5a58d7[_0xc7a8('0xa')](0x0,_0x4bf156+0x1);var _0x3cc995=_0x5a58d7[_0xc7a8('0xa')](_0x874083);return _0x3cc995[_0xc7a8('0xb')](_0x186b6e);}}}module[_0xc7a8('0xc')][_0xc7a8('0xe')]=circularMonthInterval;function parseDom(_0xb797fe){var _0x43661a=parseInt(_0xb797fe,0xa);if(_0x43661a<0x1||_0x43661a>0x1f){throw new Error(EINVALID_DATE);}return _0x43661a;}function timeCompare(_0x236e9c,_0xf7aba,_0xbe0c9e){var _0x95aa53=_0x236e9c[_0xc7a8('0xf')]();var _0x3fa9b5=extractTime(_0xf7aba);var _0x88ebf3=_0x3fa9b5[0x0];var _0x1dec1d=_0x3fa9b5[0x1];var _0x542b39=_0x236e9c[_0xc7a8('0xf')]()[_0xc7a8('0x10')](_0x88ebf3)[_0xc7a8('0x11')](_0x1dec1d);throwIfDateNotValid(_0x542b39);var _0x4dc18b=extractTime(_0xbe0c9e);var _0x2461e5=_0x4dc18b[0x0];var _0x4fbba7=_0x4dc18b[0x1];var _0x3bf6e8=_0x236e9c['clone']()[_0xc7a8('0x10')](_0x2461e5)[_0xc7a8('0x11')](_0x4fbba7);throwIfDateNotValid(_0x3bf6e8);if(_0x3bf6e8[_0xc7a8('0x12')](_0x542b39)){var _0x4b424f=_0x95aa53[_0xc7a8('0xf')]()[_0xc7a8('0x13')](_0xc7a8('0x14'));var _0x3294ca=_0x95aa53[_0xc7a8('0xf')]()[_0xc7a8('0x15')]('day');return _0x95aa53[_0xc7a8('0x16')](_0x542b39,_0x3294ca,undefined,'[]')||_0x95aa53['isBetween'](_0x4b424f,_0x3bf6e8,undefined,'[]');}else{return _0x95aa53[_0xc7a8('0x16')](_0x542b39,_0x3bf6e8,undefined,'[]');}}module[_0xc7a8('0xc')][_0xc7a8('0x17')]=timeCompare;function dowCompare(_0x27fca2,_0x3cadd3,_0x693438){var _0x2043ac=_0x27fca2['locale']('en')[_0xc7a8('0x18')]('ddd')[_0xc7a8('0x7')]();return circularDoWInterval(_0x3cadd3,_0x693438)[_0xc7a8('0x19')](_0x2043ac);}module[_0xc7a8('0xc')][_0xc7a8('0x1a')]=dowCompare;function domCompare(_0x281e6d,_0x2c8b38,_0x2a03e2){var _0x1ce4bc=_0x281e6d[_0xc7a8('0x1b')]();if(_0x2c8b38===_0x2a03e2){return _0x1ce4bc===_0x2c8b38;}else{var _0x497733=_0x281e6d['daysInMonth']();var _0xf959c9=_0x2c8b38<_0x2a03e2;let _0x1b1567=![];var _0x18f83a=0x0;var _0x2ac8bd=0x0;if(_0xf959c9){_0x18f83a=Math[_0xc7a8('0x1c')](0x1,_0x2c8b38);_0x2ac8bd=Math['min'](_0x2a03e2,_0x497733);_0x1b1567=_0x1ce4bc>=_0x18f83a&&_0x1ce4bc<=_0x2ac8bd;}else{_0x18f83a=Math[_0xc7a8('0x1d')](_0x2c8b38,_0x497733);_0x2ac8bd=Math[_0xc7a8('0x1c')](0x1,_0x2a03e2);_0x1b1567=_0x1ce4bc>=_0x18f83a||_0x1ce4bc<=_0x2ac8bd;}return _0x1b1567;}}module[_0xc7a8('0xc')][_0xc7a8('0x1e')]=domCompare;function monthCompare(_0x1fa352,_0x4123f7,_0x5918fd){var _0x49e1dc=_0x1fa352[_0xc7a8('0x8')]('en')['format'](_0xc7a8('0x1f'))[_0xc7a8('0x7')]();return circularMonthInterval(_0x4123f7,_0x5918fd)[_0xc7a8('0x19')](_0x49e1dc);}module[_0xc7a8('0xc')][_0xc7a8('0x20')]=monthCompare;function iftime(_0x4f07ca,_0x1d9af8=moment['tz'][_0xc7a8('0x21')](),_0x2f5334=moment()){if(!validateRx[_0xc7a8('0x22')](_0x4f07ca)){throw new Error(EINVALID_STRING);}else{var _0x3f73c4=(moment[_0xc7a8('0x23')](_0x2f5334)?_0x2f5334[_0xc7a8('0xf')]():moment(_0x2f5334))['tz'](_0x1d9af8)[_0xc7a8('0x8')]('en');throwIfDateNotValid(_0x3f73c4);var _0x188b04=_0x4f07ca[_0xc7a8('0x5')](',');var _0x1140c4=_0x188b04[0x0];var _0x3cb009=_0x188b04[0x1];var _0xc2e2bc=_0x188b04[0x2];var _0x56c466=_0x188b04[0x3];let _0x118115=!![];if(_0x1140c4!=='*'){var _0x2e31cb=_0x1140c4[_0xc7a8('0x5')]('-');var _0x5d262d=_['padStart'](_0x2e31cb[0x0],0x5,'0');var _0x36a8d5=_0x2e31cb[_0xc7a8('0x24')]===0x2?_[_0xc7a8('0x25')](_0x2e31cb[0x1],0x5,'0'):_0x5d262d;_0x118115=timeCompare(_0x3f73c4,_0x5d262d,_0x36a8d5);}let _0x243741=!![];if(_0x3cb009!=='*'){var _0xbadf37=_0x3cb009[_0xc7a8('0x5')]('-');var _0x1a181c=_0xbadf37[0x0];var _0x380995=_0xbadf37['length']===0x2?_0xbadf37[0x1]:_0x1a181c;_0x243741=dowCompare(_0x3f73c4,_0x1a181c,_0x380995);}let _0xf68758=!![];if(_0xc2e2bc!=='*'){var _0x4092fd=_0xc2e2bc[_0xc7a8('0x5')]('-');var _0x1f32fd=parseDom(_0x4092fd[0x0]);var _0x157b83=_0x4092fd[_0xc7a8('0x24')]===0x2?parseDom(_0x4092fd[0x1]):_0x1f32fd;_0xf68758=domCompare(_0x3f73c4,_0x1f32fd,_0x157b83);}let _0x2b63c0=!![];if(_0x56c466!=='*'){var _0x584021=_0x56c466[_0xc7a8('0x5')]('-');var _0xe9f655=_0x584021[0x0];var _0x310457=_0x584021[_0xc7a8('0x24')]===0x2?_0x584021[0x1]:_0x584021[0x0];_0x2b63c0=monthCompare(_0x3f73c4,_0xe9f655,_0x310457);}return _0x118115&&_0x243741&&_0xf68758&&_0x2b63c0;}}module[_0xc7a8('0xc')][_0xc7a8('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 52714c8..dc585ae 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20blue','bold\x20cyan','join','%s-%s.log','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0xf3cd,0x1bc));var _0xdf3c=function(_0x484ad6,_0x4efaee){_0x484ad6=_0x484ad6-0x0;var _0x4950d0=_0xf3cd[_0x484ad6];return _0x4950d0;};'use strict';var path=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var winston=require(_0xdf3c('0x3'));var config=require(_0xdf3c('0x4'));var debugLevel=config[_0xdf3c('0x5')]?config[_0xdf3c('0x5')][_0xdf3c('0x6')]():_0xdf3c('0x7');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':_0xdf3c('0x8'),'error':_0xdf3c('0x9'),'warn':'bold\x20yellow','info':_0xdf3c('0xa'),'print':_0xdf3c('0xb'),'success':_0xdf3c('0xc'),'http':'gray','verbose':'bold\x20magenta','debug':_0xdf3c('0xd'),'silly':_0xdf3c('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x108955,_0xdf9e95,_0x424180){var _0x127745=_0x108955||'/var/log/xcally';return path[_0xdf3c('0xf')](_0x127745,util['format'](_0xdf3c('0x10'),_0xdf9e95,_0x424180));}function formatter(_0x4b6bd4,_0x772951){_0x772951['message']=_0x772951['message'][_0xdf3c('0x11')](/@@{/g,_0xdf3c('0x12'))[_0xdf3c('0x11')](/}@@/g,_0xdf3c('0x13'))['replace'](/@{/g,'{{')[_0xdf3c('0x11')](/}@/g,'}}');return util[_0xdf3c('0x14')](_0xdf3c('0x15'),moment()[_0xdf3c('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x772951[_0xdf3c('0x16')][_0xdf3c('0x17')](),_0x4b6bd4,_0x772951['message']);}function fileFormat(_0x2ede4f,_0x43eedb){_0x43eedb['message']=_0x43eedb[_0xdf3c('0x18')][_0xdf3c('0x11')](/@@{/g,_0xdf3c('0x12'))[_0xdf3c('0x11')](/}@@/g,_0xdf3c('0x13'))[_0xdf3c('0x11')](/@{/g,'{{')[_0xdf3c('0x11')](/}@/g,'}}');var _0x1a093e=_0x43eedb[_0xdf3c('0x19')]&&Object['keys'](_0x43eedb[_0xdf3c('0x19')])['length']?'\x0a\x09'+JSON[_0xdf3c('0x1a')](_0x43eedb[_0xdf3c('0x19')]):'';return util[_0xdf3c('0x14')](_0xdf3c('0x1b'),moment()[_0xdf3c('0x14')](_0xdf3c('0x1c')),_0x43eedb[_0xdf3c('0x16')]['toUpperCase'](),_0x2ede4f,_0x43eedb[_0xdf3c('0x18')],_0x1a093e);}function consoleLogger(){var _0x26ac02=new winston[(_0xdf3c('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdf3c('0x1e'))][(_0xdf3c('0x1f'))]({'level':_0xdf3c('0x20'),'json':![],'formatter':function(_0xecb49c){return formatter('',_0xecb49c);}})]});return _0x26ac02;}function fileLogger(_0x51173e,_0x2b5908){var _0x292084=new winston[(_0xdf3c('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xdf3c('0x21'))]({'name':util[_0xdf3c('0x14')](_0xdf3c('0x22'),_0x51173e,'error'),'filename':getLogFileName(_0x2b5908,_0x51173e,_0xdf3c('0x23')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2d8865){return fileFormat(_0x51173e,_0x2d8865);}}),new winston[(_0xdf3c('0x1e'))][(_0xdf3c('0x21'))]({'name':util[_0xdf3c('0x14')]('%s-%s',_0x51173e,debugLevel),'filename':getLogFileName(_0x2b5908,_0x51173e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30adc1){return fileFormat(_0x51173e,_0x30adc1);}}),new winston[(_0xdf3c('0x1e'))][(_0xdf3c('0x1f'))]({'level':_0xdf3c('0x20'),'json':![],'formatter':function(_0x3bfff2){return fileFormat(_0x51173e,_0x3bfff2);}})]});return _0x292084;}exports[_0xdf3c('0x24')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x5ca9=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','warn','transports','File','%s-%s','error','Console','fileLogger','path','moment','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','keys','length','stringify'];(function(_0x299afe,_0x4b7d9c){var _0x577bca=function(_0x29c68a){while(--_0x29c68a){_0x299afe['push'](_0x299afe['shift']());}};_0x577bca(++_0x4b7d9c);}(_0x5ca9,0x1c5));var _0x95ca=function(_0x4fe409,_0x57740d){_0x4fe409=_0x4fe409-0x0;var _0x4a5523=_0x5ca9[_0x4fe409];return _0x4a5523;};'use strict';var path=require(_0x95ca('0x0'));var util=require('util');var moment=require(_0x95ca('0x1'));var winston=require('winston');var config=require(_0x95ca('0x2'));var debugLevel=config[_0x95ca('0x3')]?config['debugLevel']['toLowerCase']():_0x95ca('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':_0x95ca('0x5'),'error':_0x95ca('0x6'),'warn':_0x95ca('0x7'),'info':'white','print':_0x95ca('0x8'),'success':_0x95ca('0x9'),'http':'gray','verbose':_0x95ca('0xa'),'debug':_0x95ca('0xb'),'silly':_0x95ca('0xc')};winston[_0x95ca('0xd')](XC_LOG_COLORS);function getLogFileName(_0xd22ca5,_0x5208c0,_0x2d8e79){var _0x54284c=_0xd22ca5||_0x95ca('0xe');return path['join'](_0x54284c,util[_0x95ca('0xf')](_0x95ca('0x10'),_0x5208c0,_0x2d8e79));}function formatter(_0x57b9de,_0x3055cf){_0x3055cf[_0x95ca('0x11')]=_0x3055cf[_0x95ca('0x11')][_0x95ca('0x12')](/@@{/g,_0x95ca('0x13'))[_0x95ca('0x12')](/}@@/g,_0x95ca('0x14'))[_0x95ca('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x95ca('0xf')](_0x95ca('0x15'),moment()[_0x95ca('0xf')](_0x95ca('0x16')),_0x3055cf[_0x95ca('0x17')]['toUpperCase'](),_0x57b9de,_0x3055cf[_0x95ca('0x11')]);}function fileFormat(_0x55ef82,_0x3cdee0){_0x3cdee0[_0x95ca('0x11')]=_0x3cdee0[_0x95ca('0x11')][_0x95ca('0x12')](/@@{/g,_0x95ca('0x13'))[_0x95ca('0x12')](/}@@/g,_0x95ca('0x14'))[_0x95ca('0x12')](/@{/g,'{{')[_0x95ca('0x12')](/}@/g,'}}');var _0x5e0a53=_0x3cdee0[_0x95ca('0x18')]&&Object[_0x95ca('0x19')](_0x3cdee0[_0x95ca('0x18')])[_0x95ca('0x1a')]?'\x0a\x09'+JSON[_0x95ca('0x1b')](_0x3cdee0[_0x95ca('0x18')]):'';return util[_0x95ca('0xf')](_0x95ca('0x1c'),moment()[_0x95ca('0xf')](_0x95ca('0x16')),_0x3cdee0[_0x95ca('0x17')][_0x95ca('0x1d')](),_0x55ef82,_0x3cdee0[_0x95ca('0x11')],_0x5e0a53);}function consoleLogger(){var _0x49deec=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x95ca('0x1e'),'json':![],'formatter':function(_0x492f7c){return formatter('',_0x492f7c);}})]});return _0x49deec;}function fileLogger(_0x17bb34,_0x10a221){var _0x4f23cc=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x95ca('0x1f'))][(_0x95ca('0x20'))]({'name':util[_0x95ca('0xf')](_0x95ca('0x21'),_0x17bb34,_0x95ca('0x22')),'filename':getLogFileName(_0x10a221,_0x17bb34,_0x95ca('0x22')),'level':_0x95ca('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x324d7d){return fileFormat(_0x17bb34,_0x324d7d);}}),new winston['transports'][(_0x95ca('0x20'))]({'name':util[_0x95ca('0xf')]('%s-%s',_0x17bb34,debugLevel),'filename':getLogFileName(_0x10a221,_0x17bb34,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10ea81){return fileFormat(_0x17bb34,_0x10ea81);}}),new winston[(_0x95ca('0x1f'))][(_0x95ca('0x23'))]({'level':_0x95ca('0x1e'),'json':![],'formatter':function(_0x5a69cf){return fileFormat(_0x17bb34,_0x5a69cf);}})]});return _0x4f23cc;}exports['consoleLogger']=consoleLogger;exports[_0x95ca('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 5a083f3..0de5e0a 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 _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0xe951a1,_0x68fa85){var _0x324fcd=function(_0x1fbcc5){while(--_0x1fbcc5){_0xe951a1['push'](_0xe951a1['shift']());}};_0x324fcd(++_0x68fa85);}(_0xda2d,0x102));var _0xdda2=function(_0x10516a,_0x4c2447){_0x10516a=_0x10516a-0x0;var _0x39ab5a=_0xda2d[_0x10516a];return _0x39ab5a;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('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(_0x133e66,_0x2b0d46){var _0x1e5066=function(_0x449d08){while(--_0x449d08){_0x133e66['push'](_0x133e66['shift']());}};_0x1e5066(++_0x2b0d46);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0x0b0e[_0x53361f];return _0x279237;};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 a10be09..e180036 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 _0x7708=['lodash','\x20}\x20}','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0x58a4e1,_0x37b40d){var _0x547002=function(_0x4fdfd3){while(--_0x4fdfd3){_0x58a4e1['push'](_0x58a4e1['shift']());}};_0x547002(++_0x37b40d);}(_0x7708,0x188));var _0x8770=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x7708[_0x36a469];return _0x3347fc;};var _=require(_0x8770('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24909b){return _0x24909b==='{{'?'{\x20{\x20':_0x8770('0x1');}function safeTemplate(_0x5a8b5b){var _0x5ca46f=_0x5a8b5b;if(typeof _0x5a8b5b==='string'){_0x5ca46f=_0x5a8b5b['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8770('0x2')](_0x5a8b5b)){_0x5ca46f=_0x5a8b5b[_0x8770('0x3')](function(_0x577b13){return safeTemplate(_0x577b13);});}else if(_[_0x8770('0x4')](_0x5a8b5b)){_0x5ca46f=Object['keys'](_0x5a8b5b)[_0x8770('0x5')](function(_0x42d305,_0x2b0295){_0x42d305[_0x2b0295]=safeTemplate(_0x5a8b5b[_0x2b0295]);return _0x42d305;},{});}return _0x5ca46f;}module[_0x8770('0x6')][_0x8770('0x7')]=safeTemplate; \ No newline at end of file +var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x3948b9,_0x49ad6c){var _0x92e289=function(_0x57d216){while(--_0x57d216){_0x3948b9['push'](_0x3948b9['shift']());}};_0x92e289(++_0x49ad6c);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 265f617..db776c2 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd395=['resolve','isArray','apps','findIndex','motion2','env','NODE_PATH','pathExists','readJSON','then','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','server/app.json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd395,0x199));var _0x5d39=function(_0x54019c,_0x544c62){_0x54019c=_0x54019c-0x0;var _0x6443d7=_0xd395[_0x54019c];return _0x6443d7;};var fs=require(_0x5d39('0x0'));var path=require(_0x5d39('0x1'));var config=require(_0x5d39('0x2'));var root=config[_0x5d39('0x3')];var APP_JSON_PATH=path['resolve'](root,_0x5d39('0x4'));var NODEPATH=path[_0x5d39('0x5')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x36b469){let _0x1c36ad=![];if(Array[_0x5d39('0x6')](_0x36b469[_0x5d39('0x7')])){var _0x2ecf94=_0x36b469['apps'][_0x5d39('0x8')](function(_0x52054f){return _0x52054f['name']===_0x5d39('0x9');});if(_0x2ecf94>-0x1){var _0x123662=_0x36b469['apps'][_0x2ecf94];if(typeof _0x123662[_0x5d39('0xa')]['NODE_PATH']!=='string'){_0x123662[_0x5d39('0xa')][_0x5d39('0xb')]=NODEPATH;_0x1c36ad=!![];}}return{'appConfig':_0x36b469,'updated':_0x1c36ad};}}function updateAppConfig(_0x4a73d3){return fs[_0x5d39('0xc')](APP_JSON_PATH)['then'](function(_0x55e32e){if(_0x55e32e){return fs[_0x5d39('0xd')](APP_JSON_PATH)[_0x5d39('0xe')](function(_0x2c264c){var _0x3ae8bc=setLegacyLibsNodeEnvPath(_0x2c264c);if(_0x3ae8bc['updated']){_0x4a73d3['info'](_0x5d39('0xf'));return fs[_0x5d39('0x10')](APP_JSON_PATH,_0x2c264c,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x5d39('0x5')]();}});}module[_0x5d39('0x11')]=updateAppConfig; \ No newline at end of file +var _0xe571=['isArray','apps','name','motion2','NODE_PATH','string','pathExists','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','server/app.json','resolve','legacy-libs'];(function(_0x233811,_0x1283e9){var _0x292f41=function(_0xe78d9d){while(--_0xe78d9d){_0x233811['push'](_0x233811['shift']());}};_0x292f41(++_0x1283e9);}(_0xe571,0x1e0));var _0x1e57=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe571[_0x122ef9];return _0x42fba0;};var fs=require(_0x1e57('0x0'));var path=require(_0x1e57('0x1'));var config=require(_0x1e57('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x1e57('0x3'));var NODEPATH=path[_0x1e57('0x4')](root,_0x1e57('0x5'));function setLegacyLibsNodeEnvPath(_0x3dc212){let _0x2835c8=![];if(Array[_0x1e57('0x6')](_0x3dc212['apps'])){var _0x568513=_0x3dc212[_0x1e57('0x7')]['findIndex'](function(_0x418c6f){return _0x418c6f[_0x1e57('0x8')]===_0x1e57('0x9');});if(_0x568513>-0x1){var _0x15af9d=_0x3dc212[_0x1e57('0x7')][_0x568513];if(typeof _0x15af9d['env'][_0x1e57('0xa')]!==_0x1e57('0xb')){_0x15af9d['env'][_0x1e57('0xa')]=NODEPATH;_0x2835c8=!![];}}return{'appConfig':_0x3dc212,'updated':_0x2835c8};}}function updateAppConfig(_0x4eafb7){return fs[_0x1e57('0xc')](APP_JSON_PATH)['then'](function(_0x70501f){if(_0x70501f){return fs[_0x1e57('0xd')](APP_JSON_PATH)['then'](function(_0x238b8c){var _0xf61794=setLegacyLibsNodeEnvPath(_0x238b8c);if(_0xf61794['updated']){_0x4eafb7[_0x1e57('0xe')](_0x1e57('0xf'));return fs[_0x1e57('0x10')](APP_JSON_PATH,_0x238b8c,{'spaces':0x2});}else{return Promise[_0x1e57('0x4')]();}});}else{return Promise[_0x1e57('0x4')]();}});}module[_0x1e57('0x11')]=updateAppConfig; \ No newline at end of file